From 6e871d9b48bde1592de2f56ff336022cb2f992ca Mon Sep 17 00:00:00 2001 From: support Date: Tue, 8 Nov 2022 15:46:18 +0000 Subject: [PATCH] Built motion from commit 843129c8.|2.6.21 --- 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/components/realtime/queues.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/api.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/events.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/project.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/models/action.js | 2 +- server/services/ami/dialer/models/agentComplete.js | 2 +- server/services/ami/dialer/models/final.js | 2 +- server/services/ami/dialer/models/hangup.js | 2 +- server/services/ami/dialer/models/history.js | 2 +- .../ami/dialer/models/queueCallerAbandon.js | 2 +- server/services/ami/dialer/utils/hopper.js | 2 +- server/services/ami/dialer/utils/index.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/voiceQueueSummary.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/realtime/utils.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/interval.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/iftime.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- server/utils/update-app-config.js | 2 +- 1203 files changed, 1203 insertions(+), 1203 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index b2be332..aaa573f 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-11-08T15:16:21.662Z", + "time": "2022-11-08T15:36:05.801Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index c076d25..9405555 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-08T15:16:21.662Z", + "time": "2022-11-08T15:36:05.801Z", "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 58f9330..9ca6be1 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 _0xf9e4=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','integration','jscripty','urlForward','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x103c4c,_0x285348){var _0x3fc15e=function(_0x40e0e6){while(--_0x40e0e6){_0x103c4c['push'](_0x103c4c['shift']());}};_0x3fc15e(++_0x285348);}(_0xf9e4,0x164));var _0x4f9e=function(_0x33d8fc,_0x3b265c){_0x33d8fc=_0x33d8fc-0x0;var _0x3d721c=_0xf9e4[_0x33d8fc];return _0x3d721c;};'use strict';var Sequelize=require('sequelize');module[_0x4f9e('0x0')]={'name':{'type':Sequelize[_0x4f9e('0x1')],'get':function(_0x3510ef){return this[_0x4f9e('0x2')](_0x4f9e('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x4f9e('0x4'),'motionbar',_0x4f9e('0x5'),_0x4f9e('0x6'),'browser','bot','script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x4f9e('0x7')},'data1':{'type':Sequelize[_0x4f9e('0x8')](0x1000),'comment':_0x4f9e('0x9')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x4f9e('0xa')},'data3':{'type':Sequelize[_0x4f9e('0x8')](0x1000),'comment':_0x4f9e('0xb')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x4f9e('0x8')](0x1000),'comments':_0x4f9e('0xc')},'data6':{'type':Sequelize['STRING'],'comments':_0x4f9e('0xd')},'data7':{'type':Sequelize[_0x4f9e('0xe')],'comments':_0x4f9e('0xf')}}; \ No newline at end of file +var _0x8178=['exports','getDataValue','STRING','contactManager','integration','motionbar','urlForward','browser','bot','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize'];(function(_0x1d9ce6,_0x5d9e2c){var _0x5eb5f2=function(_0x35ea22){while(--_0x35ea22){_0x1d9ce6['push'](_0x1d9ce6['shift']());}};_0x5eb5f2(++_0x5d9e2c);}(_0x8178,0x8f));var _0x8817=function(_0x96fa16,_0xa3a7ac){_0x96fa16=_0x96fa16-0x0;var _0x57f3a4=_0x8178[_0x96fa16];return _0x57f3a4;};'use strict';var Sequelize=require(_0x8817('0x0'));module[_0x8817('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x326154){return this[_0x8817('0x2')]('action');}},'action':{'type':Sequelize[_0x8817('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x8817('0x4'),_0x8817('0x5'),_0x8817('0x6'),'jscripty',_0x8817('0x7'),_0x8817('0x8'),_0x8817('0x9'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x8817('0x3')](0x1000),'comment':_0x8817('0xa')},'data2':{'type':Sequelize[_0x8817('0x3')](0x1000),'comment':_0x8817('0xb')},'data3':{'type':Sequelize[_0x8817('0x3')](0x1000),'comment':_0x8817('0xc')},'data4':{'type':Sequelize[_0x8817('0x3')](0x1000),'comments':_0x8817('0xd')},'data5':{'type':Sequelize[_0x8817('0x3')](0x1000),'comments':_0x8817('0xe')},'data6':{'type':Sequelize[_0x8817('0x3')],'comments':_0x8817('0xf')},'data7':{'type':Sequelize[_0x8817('0x10')],'comments':_0x8817('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index dcb85fa..0a4a6e2 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 _0x0cb3=['body','Action','find','params','destroy','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','offset','count','Content-Range','json','apply','reject','save','update','then','error','name','send'];(function(_0x51c0d3,_0x32c5a6){var _0x2d52cc=function(_0x6f365f){while(--_0x6f365f){_0x51c0d3['push'](_0x51c0d3['shift']());}};_0x2d52cc(++_0x32c5a6);}(_0x0cb3,0x14f));var _0x30cb=function(_0x50ea1e,_0x5628a3){_0x50ea1e=_0x50ea1e-0x0;var _0x6e164b=_0x0cb3[_0x50ea1e];return _0x6e164b;};'use strict';var emlformat=require(_0x30cb('0x0'));var rimraf=require(_0x30cb('0x1'));var zipdir=require(_0x30cb('0x2'));var jsonpatch=require(_0x30cb('0x3'));var rp=require(_0x30cb('0x4'));var moment=require(_0x30cb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x30cb('0x6'));var util=require(_0x30cb('0x7'));var path=require('path');var sox=require(_0x30cb('0x8'));var csv=require(_0x30cb('0x9'));var ejs=require(_0x30cb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x30cb('0xb'));var squel=require(_0x30cb('0xc'));var crypto=require(_0x30cb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x30cb('0xe'));var toCsv=require(_0x30cb('0x9'));var querystring=require(_0x30cb('0xf'));var Papa=require('papaparse');var Redis=require(_0x30cb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x30cb('0x11'));var as=require(_0x30cb('0x12'));var hardwareService=require(_0x30cb('0x13'));var logger=require(_0x30cb('0x14'))(_0x30cb('0x15'));var utils=require(_0x30cb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x30cb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c7fb6,_0x1a5c05){_0x1a5c05=_0x1a5c05||0xcc;return function(_0xe942c9){if(_0xe942c9){return _0x5c7fb6[_0x30cb('0x18')](_0x1a5c05);}return _0x5c7fb6[_0x30cb('0x19')](_0x1a5c05)[_0x30cb('0x1a')]();};}function respondWithResult(_0x34ab9d,_0x1f6a68){_0x1f6a68=_0x1f6a68||0xc8;return function(_0x209ade){if(_0x209ade){return _0x34ab9d[_0x30cb('0x19')](_0x1f6a68)['json'](_0x209ade);}};}function respondWithFilteredResult(_0x4fe3a5,_0x1ed09a){return function(_0x586d65){if(_0x586d65){var _0x15fa5c=typeof _0x1ed09a['offset']===_0x30cb('0x1b')&&typeof _0x1ed09a[_0x30cb('0x1c')]===_0x30cb('0x1b');var _0x5534b0=_0x586d65['count'];var _0x36891d=_0x15fa5c?0x0:_0x1ed09a[_0x30cb('0x1d')];var _0x198879=_0x15fa5c?_0x586d65[_0x30cb('0x1e')]:_0x1ed09a[_0x30cb('0x1d')]+_0x1ed09a['limit'];var _0xbd63ca;if(_0x198879>=_0x5534b0){_0x198879=_0x5534b0;_0xbd63ca=0xc8;}else{_0xbd63ca=0xce;}_0x4fe3a5[_0x30cb('0x19')](_0xbd63ca);return _0x4fe3a5['set'](_0x30cb('0x1f'),_0x36891d+'-'+_0x198879+'/'+_0x5534b0)[_0x30cb('0x20')](_0x586d65);}return null;};}function patchUpdates(_0x5a5459){return function(_0x30950e){try{jsonpatch[_0x30cb('0x21')](_0x30950e,_0x5a5459,!![]);}catch(_0xc0c4e8){return BPromise[_0x30cb('0x22')](_0xc0c4e8);}return _0x30950e[_0x30cb('0x23')]();};}function saveUpdates(_0x493e88,_0x46034e){return function(_0x2f0680){if(_0x2f0680){return _0x2f0680[_0x30cb('0x24')](_0x493e88)[_0x30cb('0x25')](function(_0x1fb0ce){return _0x1fb0ce;});}return null;};}function removeEntity(_0x3c51b5,_0x4b811b){return function(_0x59974f){if(_0x59974f){return _0x59974f['destroy']()[_0x30cb('0x25')](function(){_0x3c51b5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x210cb1,_0x20f56d){return function(_0x580a7d){if(!_0x580a7d){_0x210cb1[_0x30cb('0x18')](0x194);}return _0x580a7d;};}function handleError(_0x2056ad,_0x591b79){_0x591b79=_0x591b79||0x1f4;return function(_0x1a0385){logger[_0x30cb('0x26')](_0x1a0385['stack']);if(_0x1a0385['name']){delete _0x1a0385[_0x30cb('0x27')];}_0x2056ad[_0x30cb('0x19')](_0x591b79)[_0x30cb('0x28')](_0x1a0385);};}exports['update']=function(_0x1b3ca5,_0xd624d0){if(_0x1b3ca5[_0x30cb('0x29')]['id']){delete _0x1b3ca5['body']['id'];}return db[_0x30cb('0x2a')][_0x30cb('0x2b')]({'where':{'id':_0x1b3ca5[_0x30cb('0x2c')]['id']}})[_0x30cb('0x25')](handleEntityNotFound(_0xd624d0,null))[_0x30cb('0x25')](saveUpdates(_0x1b3ca5[_0x30cb('0x29')],null))[_0x30cb('0x25')](respondWithResult(_0xd624d0,null))['catch'](handleError(_0xd624d0,null));};exports[_0x30cb('0x2d')]=function(_0x48232d,_0xc75894){return db['Action'][_0x30cb('0x2b')]({'where':{'id':_0x48232d['params']['id']}})[_0x30cb('0x25')](handleEntityNotFound(_0xc75894,null))['then'](removeEntity(_0xc75894,null))[_0x30cb('0x2e')](handleError(_0xc75894,null));}; \ No newline at end of file +var _0x66a4=['json','apply','save','update','then','destroy','error','stack','name','send','body','find','catch','Action','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','../../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','Content-Range'];(function(_0x1aa3fe,_0x27c5fa){var _0x163cee=function(_0x2a1505){while(--_0x2a1505){_0x1aa3fe['push'](_0x1aa3fe['shift']());}};_0x163cee(++_0x27c5fa);}(_0x66a4,0xcb));var _0x466a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x66a4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x466a('0x0'));var rimraf=require(_0x466a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x466a('0x2'));var rp=require(_0x466a('0x3'));var moment=require(_0x466a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x466a('0x5'));var util=require(_0x466a('0x6'));var path=require(_0x466a('0x7'));var sox=require('sox');var csv=require(_0x466a('0x8'));var ejs=require(_0x466a('0x9'));var fs=require('fs');var fs_extra=require(_0x466a('0xa'));var _=require(_0x466a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x466a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x466a('0x8'));var querystring=require('querystring');var Papa=require(_0x466a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x466a('0xe'));var as=require(_0x466a('0xf'));var hardwareService=require(_0x466a('0x10'));var logger=require(_0x466a('0x11'))(_0x466a('0x12'));var utils=require(_0x466a('0x13'));var config=require(_0x466a('0x14'));var licenseUtil=require(_0x466a('0x15'));var db=require(_0x466a('0x16'))['db'];function respondWithStatusCode(_0x212c10,_0x5c2bad){_0x5c2bad=_0x5c2bad||0xcc;return function(_0xd54736){if(_0xd54736){return _0x212c10[_0x466a('0x17')](_0x5c2bad);}return _0x212c10[_0x466a('0x18')](_0x5c2bad)[_0x466a('0x19')]();};}function respondWithResult(_0x3602c5,_0x4dac95){_0x4dac95=_0x4dac95||0xc8;return function(_0x4421ba){if(_0x4421ba){return _0x3602c5[_0x466a('0x18')](_0x4dac95)['json'](_0x4421ba);}};}function respondWithFilteredResult(_0x107555,_0x3277fb){return function(_0x19447b){if(_0x19447b){var _0x2d0c3f=typeof _0x3277fb[_0x466a('0x1a')]===_0x466a('0x1b')&&typeof _0x3277fb[_0x466a('0x1c')]==='undefined';var _0x45cf5d=_0x19447b[_0x466a('0x1d')];var _0x516eae=_0x2d0c3f?0x0:_0x3277fb[_0x466a('0x1a')];var _0xada0=_0x2d0c3f?_0x19447b[_0x466a('0x1d')]:_0x3277fb['offset']+_0x3277fb['limit'];var _0x47199d;if(_0xada0>=_0x45cf5d){_0xada0=_0x45cf5d;_0x47199d=0xc8;}else{_0x47199d=0xce;}_0x107555[_0x466a('0x18')](_0x47199d);return _0x107555[_0x466a('0x1e')](_0x466a('0x1f'),_0x516eae+'-'+_0xada0+'/'+_0x45cf5d)[_0x466a('0x20')](_0x19447b);}return null;};}function patchUpdates(_0x2a8c1f){return function(_0xd8e6a){try{jsonpatch[_0x466a('0x21')](_0xd8e6a,_0x2a8c1f,!![]);}catch(_0x1b8671){return BPromise['reject'](_0x1b8671);}return _0xd8e6a[_0x466a('0x22')]();};}function saveUpdates(_0x5320b2,_0x1f9c94){return function(_0x21fc1f){if(_0x21fc1f){return _0x21fc1f[_0x466a('0x23')](_0x5320b2)[_0x466a('0x24')](function(_0x27cee4){return _0x27cee4;});}return null;};}function removeEntity(_0x366a02,_0x4f3e69){return function(_0x22329d){if(_0x22329d){return _0x22329d[_0x466a('0x25')]()[_0x466a('0x24')](function(){_0x366a02[_0x466a('0x18')](0xcc)[_0x466a('0x19')]();});}};}function handleEntityNotFound(_0x4839b7,_0xbc3f72){return function(_0x4745b4){if(!_0x4745b4){_0x4839b7[_0x466a('0x17')](0x194);}return _0x4745b4;};}function handleError(_0x3c3425,_0x39ad92){_0x39ad92=_0x39ad92||0x1f4;return function(_0xa381a9){logger[_0x466a('0x26')](_0xa381a9[_0x466a('0x27')]);if(_0xa381a9[_0x466a('0x28')]){delete _0xa381a9[_0x466a('0x28')];}_0x3c3425['status'](_0x39ad92)[_0x466a('0x29')](_0xa381a9);};}exports[_0x466a('0x23')]=function(_0x478432,_0x33ab97){if(_0x478432[_0x466a('0x2a')]['id']){delete _0x478432[_0x466a('0x2a')]['id'];}return db['Action'][_0x466a('0x2b')]({'where':{'id':_0x478432['params']['id']}})['then'](handleEntityNotFound(_0x33ab97,null))['then'](saveUpdates(_0x478432[_0x466a('0x2a')],null))[_0x466a('0x24')](respondWithResult(_0x33ab97,null))[_0x466a('0x2c')](handleError(_0x33ab97,null));};exports[_0x466a('0x25')]=function(_0x18547d,_0x32b885){return db[_0x466a('0x2d')][_0x466a('0x2b')]({'where':{'id':_0x18547d[_0x466a('0x2e')]['id']}})[_0x466a('0x24')](handleEntityNotFound(_0x32b885,null))[_0x466a('0x24')](removeEntity(_0x32b885,null))[_0x466a('0x2c')](handleError(_0x32b885,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 35c4ef4..841541e 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 _0x56d1=['util','../../config/logger','moment','bluebird','request-promise','./action.attributes','exports','define','Action','tools_actions','lodash'];(function(_0x2601b4,_0x315e78){var _0x3e3661=function(_0x13b45b){while(--_0x13b45b){_0x2601b4['push'](_0x2601b4['shift']());}};_0x3e3661(++_0x315e78);}(_0x56d1,0x1ac));var _0x156d=function(_0x5c25f7,_0x3a69dc){_0x5c25f7=_0x5c25f7-0x0;var _0x1d51d1=_0x56d1[_0x5c25f7];return _0x1d51d1;};'use strict';var _=require(_0x156d('0x0'));var util=require(_0x156d('0x1'));var logger=require(_0x156d('0x2'))('api');var moment=require(_0x156d('0x3'));var BPromise=require(_0x156d('0x4'));var rp=require(_0x156d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x156d('0x6'));module[_0x156d('0x7')]=function(_0x424719,_0xeffe79){return _0x424719[_0x156d('0x8')](_0x156d('0x9'),attributes,{'tableName':_0x156d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a0c=['request-promise','path','rimraf','../../config/environment','./action.attributes','define','tools_actions','util','../../config/logger','api','moment','bluebird'];(function(_0x18154a,_0xb9c26e){var _0x3955a9=function(_0x54f36c){while(--_0x54f36c){_0x18154a['push'](_0x18154a['shift']());}};_0x3955a9(++_0xb9c26e);}(_0x9a0c,0x8b));var _0xc9a0=function(_0x44b61f,_0x2ec2b0){_0x44b61f=_0x44b61f-0x0;var _0x11dcfd=_0x9a0c[_0x44b61f];return _0x11dcfd;};'use strict';var _=require('lodash');var util=require(_0xc9a0('0x0'));var logger=require(_0xc9a0('0x1'))(_0xc9a0('0x2'));var moment=require(_0xc9a0('0x3'));var BPromise=require(_0xc9a0('0x4'));var rp=require(_0xc9a0('0x5'));var fs=require('fs');var path=require(_0xc9a0('0x6'));var rimraf=require(_0xc9a0('0x7'));var config=require(_0xc9a0('0x8'));var attributes=require(_0xc9a0('0x9'));module['exports']=function(_0x2195d7,_0x150993){return _0x2195d7[_0xc9a0('0xa')]('Action',attributes,{'tableName':_0xc9a0('0xb'),'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 805a82b..1fd0425 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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x1af0fb,_0x1c0eed){var _0x4b6d6f=function(_0x5698f6){while(--_0x5698f6){_0x1af0fb['push'](_0x1af0fb['shift']());}};_0x4b6d6f(++_0x1c0eed);}(_0x1261,0x144));var _0x1126=function(_0x5cc3d4,_0xbcbf9b){_0x5cc3d4=_0x5cc3d4-0x0;var _0x17ca31=_0x1261[_0x5cc3d4];return _0x17ca31;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0xfb3df8,_0x2222d2){var _0x2ef9d7=function(_0x22f873){while(--_0x22f873){_0xfb3df8['push'](_0xfb3df8['shift']());}};_0x2ef9d7(++_0x2222d2);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index bd18b35..0c5b660 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 _0xfcf0=['../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x841c20,_0x356d9b){var _0x14f8a5=function(_0x5b2e33){while(--_0x5b2e33){_0x841c20['push'](_0x841c20['shift']());}};_0x14f8a5(++_0x356d9b);}(_0xfcf0,0x16e));var _0x0fcf=function(_0x3ef4f1,_0x5f0f9b){_0x3ef4f1=_0x3ef4f1-0x0;var _0x69953c=_0xfcf0[_0x3ef4f1];return _0x69953c;};'use strict';var multer=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var path=require(_0x0fcf('0x2'));var timeout=require(_0x0fcf('0x3'));var express=require(_0x0fcf('0x4'));var router=express[_0x0fcf('0x5')]();var fs_extra=require(_0x0fcf('0x6'));var auth=require(_0x0fcf('0x7'));var interaction=require(_0x0fcf('0x8'));var config=require(_0x0fcf('0x9'));var controller=require(_0x0fcf('0xa'));router[_0x0fcf('0xb')](_0x0fcf('0xc'),auth[_0x0fcf('0xd')](),controller[_0x0fcf('0xe')]);router[_0x0fcf('0xf')](_0x0fcf('0xc'),auth[_0x0fcf('0xd')](),controller[_0x0fcf('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc4fd=['./action.controller','put','/:id','isAuthenticated','delete','util','path','connect-timeout','express','../../config/environment'];(function(_0x542bad,_0x3d5bbd){var _0x3d6a75=function(_0x205bd0){while(--_0x205bd0){_0x542bad['push'](_0x542bad['shift']());}};_0x3d6a75(++_0x3d5bbd);}(_0xc4fd,0x159));var _0xdc4f=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0xc4fd[_0x1f8053];return _0x174fd8;};'use strict';var multer=require('multer');var util=require(_0xdc4f('0x0'));var path=require(_0xdc4f('0x1'));var timeout=require(_0xdc4f('0x2'));var express=require(_0xdc4f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdc4f('0x4'));var controller=require(_0xdc4f('0x5'));router[_0xdc4f('0x6')](_0xdc4f('0x7'),auth[_0xdc4f('0x8')](),controller['update']);router[_0xdc4f('0x9')](_0xdc4f('0x7'),auth[_0xdc4f('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 6d98fa8..08549c4 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 _0x5fd1=['STRING','TEXT','sequelize'];(function(_0xe7281f,_0x2d77c3){var _0x90dc99=function(_0x1e335b){while(--_0x1e335b){_0xe7281f['push'](_0xe7281f['shift']());}};_0x90dc99(++_0x2d77c3);}(_0x5fd1,0x155));var _0x15fd=function(_0x26552c,_0x24f852){_0x26552c=_0x26552c-0x0;var _0x19fe2b=_0x5fd1[_0x26552c];return _0x19fe2b;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'name':{'type':Sequelize[_0x15fd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x15fd('0x1')]},'parent':{'type':Sequelize[_0x15fd('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x15fd('0x2')]}}; \ No newline at end of file +var _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x4f66c2,_0x47d4ed){var _0x447633=function(_0x3205d4){while(--_0x3205d4){_0x4f66c2['push'](_0x4f66c2['shift']());}};_0x447633(++_0x47d4ed);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x15e6fe,_0x1a5c39){_0x15e6fe=_0x15e6fe-0x0;var _0x34894d=_0xfdbd[_0x15e6fe];return _0x34894d;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index baf8bc7..8d77b68 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 _0xd7e3=['GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','joins','parse','includes','foreignTable','parentKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SEC_TO_TIME(%s)','IS\x20NULL','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','from','function','alias','foreignKey','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','generate','csv','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','operator','debug','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)'];(function(_0x23ec89,_0x11c956){var _0x51aea2=function(_0x42e3d2){while(--_0x42e3d2){_0x23ec89['push'](_0x23ec89['shift']());}};_0x51aea2(++_0x11c956);}(_0xd7e3,0xec));var _0x3d7e=function(_0x32f235,_0x4a7643){_0x32f235=_0x32f235-0x0;var _0x31ca4f=_0xd7e3[_0x32f235];return _0x31ca4f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3d7e('0x0'));var rp=require('request-promise');var moment=require(_0x3d7e('0x1'));var BPromise=require(_0x3d7e('0x2'));var Mustache=require(_0x3d7e('0x3'));var util=require(_0x3d7e('0x4'));var path=require(_0x3d7e('0x5'));var sox=require(_0x3d7e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d7e('0x7'));var _=require('lodash');var squel=require(_0x3d7e('0x8'));var crypto=require(_0x3d7e('0x9'));var jsforce=require(_0x3d7e('0xa'));var deskjs=require(_0x3d7e('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3d7e('0xc'));var Papa=require(_0x3d7e('0xd'));var Redis=require(_0x3d7e('0xe'));var authService=require(_0x3d7e('0xf'));var qs=require(_0x3d7e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d7e('0x11'));var logger=require(_0x3d7e('0x12'))(_0x3d7e('0x13'));var utils=require('../../config/utils');var config=require(_0x3d7e('0x14'));var licenseUtil=require(_0x3d7e('0x15'));var db=require(_0x3d7e('0x16'))['db'];var dbH=require(_0x3d7e('0x16'))[_0x3d7e('0x17')];function respondWithStatusCode(_0x4ae8b2,_0x4197d2){_0x4197d2=_0x4197d2||0xcc;return function(_0x37253d){if(_0x37253d){return _0x4ae8b2[_0x3d7e('0x18')](_0x4197d2);}return _0x4ae8b2[_0x3d7e('0x19')](_0x4197d2)[_0x3d7e('0x1a')]();};}function respondWithResult(_0x5629c5,_0x4b0245){_0x4b0245=_0x4b0245||0xc8;return function(_0x2a2949){if(_0x2a2949){return _0x5629c5[_0x3d7e('0x19')](_0x4b0245)[_0x3d7e('0x1b')](_0x2a2949);}};}function respondWithFilteredResult(_0x4ed64b,_0x52b0ad){return function(_0x564ffd){if(_0x564ffd){var _0x457885=typeof _0x52b0ad['offset']===_0x3d7e('0x1c')&&typeof _0x52b0ad[_0x3d7e('0x1d')]===_0x3d7e('0x1c');var _0x4c725a=_0x564ffd['count'];var _0x4873bb=_0x457885?0x0:_0x52b0ad[_0x3d7e('0x1e')];var _0xdca310=_0x457885?_0x564ffd[_0x3d7e('0x1f')]:_0x52b0ad['offset']+_0x52b0ad[_0x3d7e('0x1d')];var _0x284453;if(_0xdca310>=_0x4c725a){_0xdca310=_0x4c725a;_0x284453=0xc8;}else{_0x284453=0xce;}_0x4ed64b['status'](_0x284453);return _0x4ed64b[_0x3d7e('0x20')](_0x3d7e('0x21'),_0x4873bb+'-'+_0xdca310+'/'+_0x4c725a)[_0x3d7e('0x1b')](_0x564ffd);}return null;};}function patchUpdates(_0x20fb4c){return function(_0x30c4e3){try{jsonpatch[_0x3d7e('0x22')](_0x30c4e3,_0x20fb4c,!![]);}catch(_0x2e46e0){return BPromise[_0x3d7e('0x23')](_0x2e46e0);}return _0x30c4e3[_0x3d7e('0x24')]();};}function saveUpdates(_0x2ec63d,_0x255c8a){return function(_0xf6574d){if(_0xf6574d){return _0xf6574d[_0x3d7e('0x25')](_0x2ec63d)['then'](function(_0x4336f9){return _0x4336f9;});}return null;};}function removeEntity(_0x1b658e,_0x3daee4){return function(_0x12b9cc){if(_0x12b9cc){return _0x12b9cc[_0x3d7e('0x26')]()[_0x3d7e('0x27')](function(){var _0x40aee6=_0x12b9cc[_0x3d7e('0x28')]({'plain':!![]});var _0x5dac30=_0x3d7e('0x29');return db[_0x3d7e('0x2a')][_0x3d7e('0x26')]({'where':{'type':_0x5dac30,'resourceId':_0x40aee6['id']}})[_0x3d7e('0x27')](function(){return _0x12b9cc;});})[_0x3d7e('0x27')](function(){_0x1b658e[_0x3d7e('0x19')](0xcc)[_0x3d7e('0x1a')]();});}};}function handleEntityNotFound(_0xe05cea,_0x44c61e){return function(_0xab6cc7){if(!_0xab6cc7){_0xe05cea[_0x3d7e('0x18')](0x194);}return _0xab6cc7;};}function handleError(_0x4f5712,_0x22fb3b){_0x22fb3b=_0x22fb3b||0x1f4;return function(_0x4cc3d1){logger[_0x3d7e('0x2b')](_0x4cc3d1[_0x3d7e('0x2c')]);if(_0x4cc3d1[_0x3d7e('0x2d')]){delete _0x4cc3d1[_0x3d7e('0x2d')];}_0x4f5712[_0x3d7e('0x19')](_0x22fb3b)[_0x3d7e('0x2e')](_0x4cc3d1);};}exports[_0x3d7e('0x2f')]=function(_0x137a40,_0x496c55){var _0xa0806b={},_0x5d9290={},_0x55bdc1={'count':0x0,'rows':[]};var _0x3cb75e=_[_0x3d7e('0x30')](db[_0x3d7e('0x31')]['rawAttributes'],function(_0x154ad5){return{'name':_0x154ad5[_0x3d7e('0x32')],'type':_0x154ad5['type']['key']};});_0x5d9290[_0x3d7e('0x33')]=_[_0x3d7e('0x30')](_0x3cb75e,_0x3d7e('0x2d'));_0x5d9290[_0x3d7e('0x34')]=_[_0x3d7e('0x35')](_0x137a40[_0x3d7e('0x34')]);_0x5d9290[_0x3d7e('0x36')]=_[_0x3d7e('0x37')](_0x5d9290[_0x3d7e('0x33')],_0x5d9290['query']);_0xa0806b[_0x3d7e('0x38')]=_[_0x3d7e('0x37')](_0x5d9290['model'],qs['fields'](_0x137a40['query'][_0x3d7e('0x39')]));_0xa0806b[_0x3d7e('0x38')]=_0xa0806b[_0x3d7e('0x38')][_0x3d7e('0x3a')]?_0xa0806b[_0x3d7e('0x38')]:_0x5d9290[_0x3d7e('0x33')];if(!_0x137a40['query'][_0x3d7e('0x3b')](_0x3d7e('0x3c'))){_0xa0806b[_0x3d7e('0x1d')]=qs[_0x3d7e('0x1d')](_0x137a40[_0x3d7e('0x34')][_0x3d7e('0x1d')]);_0xa0806b[_0x3d7e('0x1e')]=qs[_0x3d7e('0x1e')](_0x137a40[_0x3d7e('0x34')][_0x3d7e('0x1e')]);}_0xa0806b[_0x3d7e('0x3d')]=qs[_0x3d7e('0x3e')](_0x137a40[_0x3d7e('0x34')][_0x3d7e('0x3e')]);_0xa0806b['where']=qs[_0x3d7e('0x36')](_[_0x3d7e('0x3f')](_0x137a40[_0x3d7e('0x34')],_0x5d9290['filters']),_0x3cb75e);if(_0x137a40[_0x3d7e('0x34')][_0x3d7e('0x40')]){_0xa0806b[_0x3d7e('0x41')]=_[_0x3d7e('0x42')](_0xa0806b['where'],{'$or':_['map'](_0x3cb75e,function(_0xe78480){if(_0xe78480[_0x3d7e('0x43')]!==_0x3d7e('0x44')){var _0x1b3dd8={};_0x1b3dd8[_0xe78480[_0x3d7e('0x2d')]]={'$like':'%'+_0x137a40[_0x3d7e('0x34')][_0x3d7e('0x40')]+'%'};return _0x1b3dd8;}})});}_0xa0806b=_[_0x3d7e('0x42')]({},_0xa0806b,_0x137a40[_0x3d7e('0x45')]);var _0x21c302={'where':_0xa0806b[_0x3d7e('0x41')]};return db[_0x3d7e('0x31')][_0x3d7e('0x1f')](_0x21c302)[_0x3d7e('0x27')](function(_0x16ef3d){_0x55bdc1[_0x3d7e('0x1f')]=_0x16ef3d;if(_0x137a40[_0x3d7e('0x34')][_0x3d7e('0x46')]){_0xa0806b[_0x3d7e('0x47')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x3d7e('0x48')](_0xa0806b);})[_0x3d7e('0x27')](function(_0x2434a1){_0x55bdc1[_0x3d7e('0x49')]=_0x2434a1;return _0x55bdc1;})[_0x3d7e('0x27')](respondWithFilteredResult(_0x496c55,_0xa0806b))[_0x3d7e('0x4a')](handleError(_0x496c55,null));};exports[_0x3d7e('0x4b')]=function(_0x393b4a,_0x4e29e4){var _0x3b1489={'raw':![],'where':{'id':_0x393b4a[_0x3d7e('0x4c')]['id']}},_0x95b2c6={};_0x95b2c6[_0x3d7e('0x33')]=_[_0x3d7e('0x35')](db[_0x3d7e('0x31')][_0x3d7e('0x4d')]);_0x95b2c6['query']=_[_0x3d7e('0x35')](_0x393b4a[_0x3d7e('0x34')]);_0x95b2c6[_0x3d7e('0x36')]=_['intersection'](_0x95b2c6[_0x3d7e('0x33')],_0x95b2c6[_0x3d7e('0x34')]);_0x3b1489[_0x3d7e('0x38')]=_[_0x3d7e('0x37')](_0x95b2c6[_0x3d7e('0x33')],qs[_0x3d7e('0x39')](_0x393b4a[_0x3d7e('0x34')][_0x3d7e('0x39')]));_0x3b1489['attributes']=_0x3b1489['attributes'][_0x3d7e('0x3a')]?_0x3b1489['attributes']:_0x95b2c6[_0x3d7e('0x33')];if(_0x393b4a[_0x3d7e('0x34')][_0x3d7e('0x46')]){_0x3b1489[_0x3d7e('0x47')]=[{'all':!![]}];}_0x3b1489=_[_0x3d7e('0x42')]({},_0x3b1489,_0x393b4a[_0x3d7e('0x45')]);return db[_0x3d7e('0x31')][_0x3d7e('0x4e')](_0x3b1489)[_0x3d7e('0x27')](handleEntityNotFound(_0x4e29e4,null))[_0x3d7e('0x27')](respondWithResult(_0x4e29e4,null))[_0x3d7e('0x4a')](handleError(_0x4e29e4,null));};exports[_0x3d7e('0x4f')]=function(_0x5f24d5,_0xe5081f){return db[_0x3d7e('0x31')][_0x3d7e('0x4f')](_0x5f24d5[_0x3d7e('0x50')],{})[_0x3d7e('0x27')](function(_0x2604b3){var _0xe99dc4=_0x5f24d5[_0x3d7e('0x51')][_0x3d7e('0x28')]({'plain':!![]});if(!_0xe99dc4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe99dc4['role']==='user'){var _0xe3137c=_0x2604b3[_0x3d7e('0x28')]({'plain':!![]});var _0x1cafc3=_0x3d7e('0x52');return db[_0x3d7e('0x53')][_0x3d7e('0x4e')]({'where':{'name':_0x1cafc3,'userProfileId':_0xe99dc4[_0x3d7e('0x54')]},'raw':!![]})['then'](function(_0x2b11c3){if(_0x2b11c3&&_0x2b11c3[_0x3d7e('0x55')]===0x0){return db[_0x3d7e('0x2a')]['create']({'name':_0xe3137c[_0x3d7e('0x2d')],'resourceId':_0xe3137c['id'],'type':_0x3d7e('0x29'),'sectionId':_0x2b11c3['id']},{})['then'](function(){return _0x2604b3;});}else{return _0x2604b3;}})[_0x3d7e('0x4a')](function(_0x55c231){logger[_0x3d7e('0x2b')](_0x3d7e('0x56'),_0x55c231);throw _0x55c231;});}return _0x2604b3;})[_0x3d7e('0x27')](respondWithResult(_0xe5081f,0xc9))['catch'](handleError(_0xe5081f,null));};exports[_0x3d7e('0x25')]=function(_0x709d85,_0x4289e7){if(_0x709d85[_0x3d7e('0x50')]['id']){delete _0x709d85[_0x3d7e('0x50')]['id'];}return db[_0x3d7e('0x31')][_0x3d7e('0x4e')]({'where':{'id':_0x709d85[_0x3d7e('0x4c')]['id']}})[_0x3d7e('0x27')](handleEntityNotFound(_0x4289e7,null))[_0x3d7e('0x27')](saveUpdates(_0x709d85[_0x3d7e('0x50')],null))['then'](respondWithResult(_0x4289e7,null))[_0x3d7e('0x4a')](handleError(_0x4289e7,null));};exports[_0x3d7e('0x26')]=function(_0x5f1a56,_0x29e4e7){return db[_0x3d7e('0x31')]['find']({'where':{'id':_0x5f1a56['params']['id']}})[_0x3d7e('0x27')](handleEntityNotFound(_0x29e4e7,null))[_0x3d7e('0x27')](removeEntity(_0x29e4e7,null))[_0x3d7e('0x4a')](handleError(_0x29e4e7,null));};exports[_0x3d7e('0x57')]=function(_0x1709db,_0x5b1240){var _0x67377b=0xa;var _0x2181ba=[_0x3d7e('0x58'),_0x3d7e('0x59'),_0x3d7e('0x5a'),_0x3d7e('0x5b')];var _0xb6e199={'SUM':_0x3d7e('0x5c'),'COUNT':_0x3d7e('0x5d'),'COUNT DISTINCT':_0x3d7e('0x5e'),'MAX':_0x3d7e('0x5f'),'MIN':_0x3d7e('0x60'),'AVG':_0x3d7e('0x61'),'GROUP_CONCAT':_0x3d7e('0x62'),'GROUP_CONCAT ASC':_0x3d7e('0x63'),'GROUP_CONCAT DESC':_0x3d7e('0x64')};var _0x1f535a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3d7e('0x65'),'HOUR':_0x3d7e('0x66'),'ROUND':_0x3d7e('0x67'),'UNIX_TIMESTAMP':_0x3d7e('0x68')};var _0x26fa01=function(_0x30d8b2){return!_['includes'](['IS\x20NULL',_0x3d7e('0x69'),_0x3d7e('0x6a'),_0x3d7e('0x6b')],_0x30d8b2);};var _0x11536c=function(_0x518c94){if(!_0x518c94||!_0x518c94[_0x3d7e('0x6c')][_0x3d7e('0x3a')]){return'';}for(var _0x560db2='(',_0x1b9eb7=0x0;_0x1b9eb7<_0x518c94[_0x3d7e('0x6c')][_0x3d7e('0x3a')];_0x1b9eb7+=0x1){_0x1b9eb7>0x0&&(_0x560db2+='\x20'+_0x518c94['operator']+'\x20');_0x560db2+=_0x518c94['rules'][_0x1b9eb7][_0x3d7e('0x6d')]?_0x11536c(_0x518c94[_0x3d7e('0x6c')][_0x1b9eb7]['group']):_0x518c94[_0x3d7e('0x6c')][_0x1b9eb7][_0x3d7e('0x6e')]+'\x20'+_0x518c94[_0x3d7e('0x6c')][_0x1b9eb7][_0x3d7e('0x6f')]+(_0x26fa01(_0x518c94[_0x3d7e('0x6c')][_0x1b9eb7]['condition'])?'\x20'+_0x518c94[_0x3d7e('0x6c')][_0x1b9eb7][_0x3d7e('0x70')]:'');}return _0x560db2+')';};var _0x4eaa10={'where':{'id':_0x1709db[_0x3d7e('0x4c')]['id']}},_0x257395,_0x3ef55d,_0xd3cf57,_0x190323,_0x328289;_0x4eaa10=_[_0x3d7e('0x42')]({},_0x4eaa10,_0x1709db[_0x3d7e('0x45')]);return db['AnalyticCustomReport'][_0x3d7e('0x4e')](_0x4eaa10)['then'](function(_0x3e6612){if(_0x3e6612){_0x257395=_0x3e6612;return _0x3e6612[_0x3d7e('0x71')]();}return null;})['then'](function(_0xae3bb2){if(_0xae3bb2){if(!_0xae3bb2['length']){throw new db['Sequelize'][(_0x3d7e('0x72'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3ef55d=_0xae3bb2;return db[_0x3d7e('0x73')]['findAll']({'raw':!![]});}return null;})[_0x3d7e('0x27')](function(_0x4d7da9){if(_0x4d7da9){_0xd3cf57=_[_0x3d7e('0x74')](_0x4d7da9,'id');var _0x3371d6;var _0x10a8e4=squel[_0x3d7e('0x75')]();_0x10a8e4['from'](_0x257395[_0x3d7e('0x76')]);for(var _0x4cde80=0x0;_0x4cde80<_0x3ef55d[_0x3d7e('0x3a')];_0x4cde80+=0x1){_0x3371d6=_0x3ef55d[_0x4cde80][_0x3d7e('0x77')]?_0xd3cf57[_0x3ef55d[_0x4cde80][_0x3d7e('0x77')]][_0x3d7e('0x78')]:_0x3ef55d[_0x4cde80][_0x3d7e('0x6e')];_0x3371d6=_0x3ef55d[_0x4cde80]['function']?_[_0x3d7e('0x79')](_0xb6e199[_0x3ef55d[_0x4cde80]['function']],'%s',_0x3371d6):_0x3371d6;_0x3371d6=_0x3ef55d[_0x4cde80][_0x3d7e('0x7a')]?_[_0x3d7e('0x79')](_0x1f535a[_0x3ef55d[_0x4cde80][_0x3d7e('0x7a')]],'%s',_0x3371d6):_0x3371d6;if(_0x3ef55d[_0x4cde80][_0x3d7e('0x7b')]){_0x10a8e4['group'](_0x3371d6);}_0x3ef55d[_0x4cde80]['orderBy']&&_0x10a8e4['order'](_0x3371d6,_0x3ef55d[_0x4cde80][_0x3d7e('0x7c')]===_0x3d7e('0x7d')?![]:!![]);_0x10a8e4[_0x3d7e('0x6e')](_0x3371d6,_0x3ef55d[_0x4cde80]['alias']||_0x3371d6);}if(_0x257395[_0x3d7e('0x7e')]){_0x257395[_0x3d7e('0x7e')]=JSON[_0x3d7e('0x7f')](_0x257395[_0x3d7e('0x7e')]);for(var _0xed484=0x0;_0xed484<_0x257395[_0x3d7e('0x7e')][_0x3d7e('0x3a')];_0xed484+=0x1){if(_0x257395[_0x3d7e('0x7e')][_0xed484][_0x3d7e('0x43')]&&_[_0x3d7e('0x80')](_0x2181ba,_0x257395[_0x3d7e('0x7e')][_0xed484][_0x3d7e('0x43')])&&_0x257395[_0x3d7e('0x7e')][_0xed484]['parentKey']&&_0x257395[_0x3d7e('0x7e')][_0xed484][_0x3d7e('0x81')]&&_0x257395[_0x3d7e('0x7e')][_0xed484]['foreignKey']){_0x10a8e4[_0x257395[_0x3d7e('0x7e')][_0xed484][_0x3d7e('0x43')]](_0x257395['joins'][_0xed484][_0x3d7e('0x81')],null,util[_0x3d7e('0x7a')]('%s.%s\x20=\x20%s.%s',_0x257395[_0x3d7e('0x76')],_0x257395['joins'][_0xed484][_0x3d7e('0x82')],_0x257395[_0x3d7e('0x7e')][_0xed484][_0x3d7e('0x81')],_0x257395['joins'][_0xed484]['foreignKey']));}}}if(_0x257395['conditions']){_0x257395['conditions']=JSON[_0x3d7e('0x7f')](_0x257395['conditions']);_0x10a8e4['where'](_0x11536c(_0x257395[_0x3d7e('0x83')][_0x3d7e('0x6d')]));}_0x328289=_0x10a8e4[_0x3d7e('0x84')]();_0x10a8e4[_0x3d7e('0x1d')](_0x67377b);_0x10a8e4[_0x3d7e('0x1e')](0x0);logger['debug'](_0x3d7e('0x85'),_0x10a8e4[_0x3d7e('0x86')]());return dbH[_0x3d7e('0x87')][_0x3d7e('0x34')](_0x10a8e4[_0x3d7e('0x86')](),{'type':dbH[_0x3d7e('0x87')][_0x3d7e('0x88')][_0x3d7e('0x89')]});}})[_0x3d7e('0x27')](respondWithResult(_0x5b1240,null))[_0x3d7e('0x4a')](handleError(_0x5b1240,null));};function runReport(_0x2d7e5e,_0x3146b4,_0x4123f0){var _0x4a190d=_0x3146b4[_0x3d7e('0x2d')];var _0x5141e1=0xa;var _0x3fee38=[_0x3d7e('0x58'),'left_join',_0x3d7e('0x5a'),_0x3d7e('0x5b')];var _0x25200c={'SUM':_0x3d7e('0x5c'),'COUNT':_0x3d7e('0x5d'),'COUNT DISTINCT':_0x3d7e('0x5e'),'MAX':_0x3d7e('0x5f'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x3d7e('0x62'),'GROUP_CONCAT ASC':_0x3d7e('0x63'),'GROUP_CONCAT DESC':_0x3d7e('0x64')};var _0xb35c9b={'SEC_TO_TIME':_0x3d7e('0x8a'),'DATE':_0x3d7e('0x65'),'HOUR':_0x3d7e('0x66'),'ROUND':_0x3d7e('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x10caaf=function(_0x4fc817){return!_[_0x3d7e('0x80')]([_0x3d7e('0x8b'),_0x3d7e('0x69'),_0x3d7e('0x6a'),_0x3d7e('0x6b')],_0x4fc817);};var _0x53a247=function(_0x580e12){if(!_0x580e12||!_0x580e12['rules']['length']){return'';}for(var _0x93e94c='(',_0x5ab5b6=0x0;_0x5ab5b6<_0x580e12[_0x3d7e('0x6c')]['length'];_0x5ab5b6+=0x1){_0x5ab5b6>0x0&&(_0x93e94c+='\x20'+_0x580e12['operator']+'\x20');_0x93e94c+=_0x580e12['rules'][_0x5ab5b6][_0x3d7e('0x6d')]?_0x53a247(_0x580e12[_0x3d7e('0x6c')][_0x5ab5b6][_0x3d7e('0x6d')]):_0x580e12[_0x3d7e('0x6c')][_0x5ab5b6][_0x3d7e('0x6e')]+'\x20'+_0x580e12['rules'][_0x5ab5b6][_0x3d7e('0x6f')]+(_0x10caaf(_0x580e12[_0x3d7e('0x6c')][_0x5ab5b6][_0x3d7e('0x6f')])?'\x20'+_0x580e12[_0x3d7e('0x6c')][_0x5ab5b6][_0x3d7e('0x70')]:'');}return _0x93e94c+')';};var _0x55d762={'where':{'id':_0x2d7e5e['id']}},_0x329c05,_0x16965e,_0x186605,_0x570622,_0x158c6f;_0x55d762=_[_0x3d7e('0x42')]({},_0x55d762,_0x4123f0);return db[_0x3d7e('0x31')]['find'](_0x55d762)[_0x3d7e('0x27')](function(_0x3c28a0){if(_0x3c28a0){_0x329c05=_0x3c28a0;return _0x3c28a0[_0x3d7e('0x71')]();}return null;})[_0x3d7e('0x27')](function(_0x55f397){if(_0x55f397){if(!_0x55f397[_0x3d7e('0x3a')]){throw new db[(_0x3d7e('0x8c'))]['ValidationErrorItem'](_0x3d7e('0x8d'),0x193);}_0x16965e=_0x55f397;return db[_0x3d7e('0x73')]['findAll']({'raw':!![]});}return null;})[_0x3d7e('0x27')](function(_0x573574){if(_0x573574){_0x186605=_[_0x3d7e('0x74')](_0x573574,'id');var _0x349b47;var _0x46ac72=squel[_0x3d7e('0x75')]();_0x46ac72[_0x3d7e('0x8e')](_0x329c05[_0x3d7e('0x76')]);for(var _0x44c860=0x0;_0x44c860<_0x16965e[_0x3d7e('0x3a')];_0x44c860+=0x1){_0x349b47=_0x16965e[_0x44c860][_0x3d7e('0x77')]?_0x186605[_0x16965e[_0x44c860][_0x3d7e('0x77')]][_0x3d7e('0x78')]:_0x16965e[_0x44c860][_0x3d7e('0x6e')];_0x349b47=_0x16965e[_0x44c860][_0x3d7e('0x8f')]?_[_0x3d7e('0x79')](_0x25200c[_0x16965e[_0x44c860][_0x3d7e('0x8f')]],'%s',_0x349b47):_0x349b47;_0x349b47=_0x16965e[_0x44c860][_0x3d7e('0x7a')]?_['replace'](_0xb35c9b[_0x16965e[_0x44c860][_0x3d7e('0x7a')]],'%s',_0x349b47):_0x349b47;if(_0x16965e[_0x44c860][_0x3d7e('0x7b')]){_0x46ac72[_0x3d7e('0x6d')](_0x349b47);}_0x16965e[_0x44c860][_0x3d7e('0x7c')]&&_0x46ac72['order'](_0x349b47,_0x16965e[_0x44c860][_0x3d7e('0x7c')]===_0x3d7e('0x7d')?![]:!![]);_0x46ac72[_0x3d7e('0x6e')](_0x349b47,_0x16965e[_0x44c860][_0x3d7e('0x90')]||_0x349b47);}if(_0x329c05[_0x3d7e('0x7e')]){_0x329c05['joins']=JSON[_0x3d7e('0x7f')](_0x329c05[_0x3d7e('0x7e')]);for(var _0x56549e=0x0;_0x56549e<_0x329c05[_0x3d7e('0x7e')][_0x3d7e('0x3a')];_0x56549e+=0x1){if(_0x329c05['joins'][_0x56549e][_0x3d7e('0x43')]&&_[_0x3d7e('0x80')](_0x3fee38,_0x329c05['joins'][_0x56549e]['type'])&&_0x329c05[_0x3d7e('0x7e')][_0x56549e]['parentKey']&&_0x329c05['joins'][_0x56549e][_0x3d7e('0x81')]&&_0x329c05['joins'][_0x56549e][_0x3d7e('0x91')]){_0x46ac72[_0x329c05['joins'][_0x56549e][_0x3d7e('0x43')]](_0x329c05[_0x3d7e('0x7e')][_0x56549e]['foreignTable'],null,util[_0x3d7e('0x7a')](_0x3d7e('0x92'),_0x329c05[_0x3d7e('0x76')],_0x329c05[_0x3d7e('0x7e')][_0x56549e][_0x3d7e('0x82')],_0x329c05[_0x3d7e('0x7e')][_0x56549e][_0x3d7e('0x81')],_0x329c05[_0x3d7e('0x7e')][_0x56549e][_0x3d7e('0x91')]));}}}if(_0x329c05[_0x3d7e('0x83')]){_0x329c05[_0x3d7e('0x83')]=JSON[_0x3d7e('0x7f')](_0x329c05[_0x3d7e('0x83')]);_0x46ac72['where'](_0x53a247(_0x329c05[_0x3d7e('0x83')][_0x3d7e('0x6d')]));}_0x158c6f=_0x46ac72[_0x3d7e('0x84')]();_0x46ac72[_0x3d7e('0x1d')](_0x5141e1);_0x46ac72[_0x3d7e('0x1e')](0x0);return;}})[_0x3d7e('0x27')](function(){if(_0x3146b4[_0x3d7e('0x93')]===_0x3d7e('0x94')){return null;}var _0x257d15=_[_0x3d7e('0x42')](_0x3146b4,{'name':_0x3146b4[_0x3d7e('0x95')]||_0x3146b4[_0x3d7e('0x2d')]||_0x329c05[_0x3d7e('0x2d')],'basename':_0x4a190d,'savename':util[_0x3d7e('0x7a')](_0x3d7e('0x96'),_0x3146b4['name']||_0x329c05['name'],require('randomstring')[_0x3d7e('0x97')](0x4),_0x3146b4[_0x3d7e('0x93')]||_0x3d7e('0x98')),'reportId':_0x329c05['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x3d7e('0x4f')](_0x257d15,{'raw':!![]});})['then'](function(_0x12d35d){if(_0x329c05[_0x3d7e('0x76')]==='cdr'){_0x158c6f[_0x3d7e('0x41')](_0x329c05[_0x3d7e('0x76')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3146b4['startDate'],_0x3146b4[_0x3d7e('0x99')]);}else{_0x158c6f[_0x3d7e('0x41')](_0x329c05[_0x3d7e('0x76')]+_0x3d7e('0x9a'),_0x3146b4[_0x3d7e('0x9b')],_0x3146b4[_0x3d7e('0x99')]);}if(_0x12d35d){logger['info'](_0x3d7e('0x9c'),_0x158c6f[_0x3d7e('0x86')]());require(_0x3d7e('0x9d'))[_0x3d7e('0x9e')](path['join'](__dirname,_0x3d7e('0x9f'),_0x12d35d[_0x3d7e('0x93')]),[_0x12d35d['id'],_0x158c6f[_0x3d7e('0x86')](),path['join'](__dirname,_0x3d7e('0xa0'),_0x12d35d[_0x3d7e('0xa1')]),_0x4a190d]);return _0x12d35d;}else{var _0x3368d2=squel['select']();_0x3368d2['from']('('+_0x158c6f['toString']()+')',_0x3d7e('0xa2'));_0x3368d2[_0x3d7e('0x6e')]('COUNT(*)',_0x3d7e('0x1f'));_0x158c6f['limit'](_0x3146b4[_0x3d7e('0x1d')]||_0x5141e1);_0x158c6f[_0x3d7e('0x1e')](_0x3146b4['offset']||0x0);return dbH[_0x3d7e('0x87')][_0x3d7e('0x34')](_0x3368d2['toString'](),{'type':dbH['sequelize'][_0x3d7e('0x88')][_0x3d7e('0x89')]})[_0x3d7e('0x27')](function(_0x3aba5a){if(!_0x3aba5a['length']){_0x570622=0x0;}else{_0x570622=_0x3aba5a[0x0][_0x3d7e('0x1f')]||0x0;}return dbH[_0x3d7e('0x87')][_0x3d7e('0x34')](_0x158c6f[_0x3d7e('0x86')](),{'type':dbH[_0x3d7e('0x87')][_0x3d7e('0x88')][_0x3d7e('0x89')]});})[_0x3d7e('0x27')](function(_0x5a319a){return{'rows':_0x5a319a||[],'count':_0x570622};});}});}exports[_0x3d7e('0xa3')]=function(_0x441641,_0x5dd259){return runReport(_0x441641[_0x3d7e('0x4c')],_0x441641['query'],_0x441641[_0x3d7e('0x45')])[_0x3d7e('0x27')](respondWithResult(_0x5dd259,null))[_0x3d7e('0x4a')](handleError(_0x5dd259,null));};exports[_0x3d7e('0xa4')]=runReport;exports[_0x3d7e('0x34')]=function(_0x591751,_0x5ac10e){var _0x383ff3=0xa;var _0x3d4270=[_0x3d7e('0x58'),_0x3d7e('0x59'),_0x3d7e('0x5a'),_0x3d7e('0x5b')];var _0x39d2dc={'SUM':_0x3d7e('0x5c'),'COUNT':_0x3d7e('0x5d'),'COUNT DISTINCT':_0x3d7e('0x5e'),'MAX':_0x3d7e('0x5f'),'MIN':_0x3d7e('0x60'),'AVG':_0x3d7e('0x61'),'GROUP_CONCAT':_0x3d7e('0x62'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3d7e('0x64')};var _0x5cdb9c={'SEC_TO_TIME':_0x3d7e('0x8a'),'DATE':_0x3d7e('0x65'),'HOUR':_0x3d7e('0x66'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3d7e('0x68')};var _0x2482c6=function(_0x4de2de){return!_[_0x3d7e('0x80')]([_0x3d7e('0x8b'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x3d7e('0x6b')],_0x4de2de);};var _0x2822b8=function(_0x1d2cf8){if(!_0x1d2cf8||!_0x1d2cf8['rules'][_0x3d7e('0x3a')]){return'';}for(var _0x2fba5c='(',_0x43509a=0x0;_0x43509a<_0x1d2cf8['rules'][_0x3d7e('0x3a')];_0x43509a+=0x1){_0x43509a>0x0&&(_0x2fba5c+='\x20'+_0x1d2cf8[_0x3d7e('0xa5')]+'\x20');_0x2fba5c+=_0x1d2cf8[_0x3d7e('0x6c')][_0x43509a][_0x3d7e('0x6d')]?_0x2822b8(_0x1d2cf8['rules'][_0x43509a][_0x3d7e('0x6d')]):_0x1d2cf8[_0x3d7e('0x6c')][_0x43509a][_0x3d7e('0x6e')]+'\x20'+_0x1d2cf8['rules'][_0x43509a][_0x3d7e('0x6f')]+(_0x2482c6(_0x1d2cf8[_0x3d7e('0x6c')][_0x43509a][_0x3d7e('0x6f')])?'\x20'+_0x1d2cf8['rules'][_0x43509a][_0x3d7e('0x70')]:'');}return _0x2fba5c+')';};var _0x30ef30={'where':{'id':_0x591751[_0x3d7e('0x4c')]['id']}},_0x3e641b,_0x3c782a,_0x90038d,_0x4138b3,_0x418eda;_0x30ef30=_[_0x3d7e('0x42')]({},_0x30ef30,_0x591751[_0x3d7e('0x45')]);return db[_0x3d7e('0x31')][_0x3d7e('0x4e')](_0x30ef30)['then'](function(_0x450dbb){if(_0x450dbb){_0x3e641b=_0x450dbb;return _0x450dbb[_0x3d7e('0x71')]();}return null;})[_0x3d7e('0x27')](function(_0x3a73a3){if(_0x3a73a3){if(!_0x3a73a3[_0x3d7e('0x3a')]){throw new db[(_0x3d7e('0x8c'))]['ValidationErrorItem'](_0x3d7e('0x8d'),0x193);}_0x3c782a=_0x3a73a3;return db[_0x3d7e('0x73')][_0x3d7e('0x48')]({'raw':!![]});}return null;})['then'](function(_0x4014df){if(_0x4014df){_0x90038d=_['keyBy'](_0x4014df,'id');var _0x1ee2c6;var _0xc4c1b3=squel['select']();_0xc4c1b3['from'](_0x3e641b['table']);for(var _0x413185=0x0;_0x413185<_0x3c782a['length'];_0x413185+=0x1){_0x1ee2c6=_0x3c782a[_0x413185][_0x3d7e('0x77')]?_0x90038d[_0x3c782a[_0x413185][_0x3d7e('0x77')]][_0x3d7e('0x78')]:_0x3c782a[_0x413185][_0x3d7e('0x6e')];_0x1ee2c6=_0x3c782a[_0x413185][_0x3d7e('0x8f')]?_[_0x3d7e('0x79')](_0x39d2dc[_0x3c782a[_0x413185][_0x3d7e('0x8f')]],'%s',_0x1ee2c6):_0x1ee2c6;_0x1ee2c6=_0x3c782a[_0x413185]['format']?_['replace'](_0x5cdb9c[_0x3c782a[_0x413185]['format']],'%s',_0x1ee2c6):_0x1ee2c6;if(_0x3c782a[_0x413185][_0x3d7e('0x7b')]){_0xc4c1b3[_0x3d7e('0x6d')](_0x1ee2c6);}_0x3c782a[_0x413185][_0x3d7e('0x7c')]&&_0xc4c1b3['order'](_0x1ee2c6,_0x3c782a[_0x413185][_0x3d7e('0x7c')]===_0x3d7e('0x7d')?![]:!![]);_0xc4c1b3[_0x3d7e('0x6e')](_0x1ee2c6,_0x3c782a[_0x413185][_0x3d7e('0x90')]||_0x1ee2c6);}if(_0x3e641b[_0x3d7e('0x7e')]){_0x3e641b['joins']=JSON[_0x3d7e('0x7f')](_0x3e641b[_0x3d7e('0x7e')]);for(var _0x21e934=0x0;_0x21e934<_0x3e641b[_0x3d7e('0x7e')][_0x3d7e('0x3a')];_0x21e934+=0x1){if(_0x3e641b[_0x3d7e('0x7e')][_0x21e934]['type']&&_[_0x3d7e('0x80')](_0x3d4270,_0x3e641b['joins'][_0x21e934]['type'])&&_0x3e641b[_0x3d7e('0x7e')][_0x21e934][_0x3d7e('0x82')]&&_0x3e641b[_0x3d7e('0x7e')][_0x21e934][_0x3d7e('0x81')]&&_0x3e641b[_0x3d7e('0x7e')][_0x21e934][_0x3d7e('0x91')]){_0xc4c1b3[_0x3e641b['joins'][_0x21e934]['type']](_0x3e641b[_0x3d7e('0x7e')][_0x21e934][_0x3d7e('0x81')],null,util[_0x3d7e('0x7a')](_0x3d7e('0x92'),_0x3e641b[_0x3d7e('0x76')],_0x3e641b[_0x3d7e('0x7e')][_0x21e934][_0x3d7e('0x82')],_0x3e641b[_0x3d7e('0x7e')][_0x21e934][_0x3d7e('0x81')],_0x3e641b[_0x3d7e('0x7e')][_0x21e934]['foreignKey']));}}}if(_0x3e641b[_0x3d7e('0x83')]){_0x3e641b['conditions']=JSON[_0x3d7e('0x7f')](_0x3e641b[_0x3d7e('0x83')]);_0xc4c1b3[_0x3d7e('0x41')](_0x2822b8(_0x3e641b[_0x3d7e('0x83')][_0x3d7e('0x6d')]));}_0x418eda=_0xc4c1b3['clone']();_0xc4c1b3['limit'](_0x383ff3);_0xc4c1b3[_0x3d7e('0x1e')](0x0);logger[_0x3d7e('0xa6')](_0x3d7e('0x85'),_0xc4c1b3[_0x3d7e('0x86')]());return dbH[_0x3d7e('0x87')][_0x3d7e('0x34')](_0xc4c1b3[_0x3d7e('0x86')](),{'type':dbH[_0x3d7e('0x87')][_0x3d7e('0x88')][_0x3d7e('0x89')]});}})['then'](function(){return{'sql':_0x418eda['toString']()};})[_0x3d7e('0x27')](respondWithResult(_0x5ac10e,null))[_0x3d7e('0x4a')](handleError(_0x5ac10e,null));}; \ No newline at end of file +var _0x9068=['from','function','alias','%s.%s\x20=\x20%s.%s','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','COUNT(%s)','HOUR(%s)','ROUND(%s)','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','left_join','cross_join','COUNT(DISTINCT\x20%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)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','joins','parse','foreignTable','foreignKey','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','right_join','SUM(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','operator','condition'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0x9068,0x16b));var _0x8906=function(_0xb7202,_0x4aa500){_0xb7202=_0xb7202-0x0;var _0x6488bb=_0x9068[_0xb7202];return _0x6488bb;};'use strict';var emlformat=require(_0x8906('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8906('0x1'));var rp=require(_0x8906('0x2'));var moment=require(_0x8906('0x3'));var BPromise=require(_0x8906('0x4'));var Mustache=require(_0x8906('0x5'));var util=require(_0x8906('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8906('0x7'));var ejs=require(_0x8906('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8906('0x9'));var squel=require(_0x8906('0xa'));var crypto=require('crypto');var jsforce=require(_0x8906('0xb'));var deskjs=require(_0x8906('0xc'));var toCsv=require(_0x8906('0x7'));var querystring=require(_0x8906('0xd'));var Papa=require('papaparse');var Redis=require(_0x8906('0xe'));var authService=require(_0x8906('0xf'));var qs=require(_0x8906('0x10'));var as=require(_0x8906('0x11'));var hardwareService=require(_0x8906('0x12'));var logger=require(_0x8906('0x13'))(_0x8906('0x14'));var utils=require('../../config/utils');var config=require(_0x8906('0x15'));var licenseUtil=require(_0x8906('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0x8906('0x17'))[_0x8906('0x18')];function respondWithStatusCode(_0x1116a7,_0x10ec66){_0x10ec66=_0x10ec66||0xcc;return function(_0x14680b){if(_0x14680b){return _0x1116a7[_0x8906('0x19')](_0x10ec66);}return _0x1116a7[_0x8906('0x1a')](_0x10ec66)[_0x8906('0x1b')]();};}function respondWithResult(_0x312e9e,_0x44d9cd){_0x44d9cd=_0x44d9cd||0xc8;return function(_0x23e9bd){if(_0x23e9bd){return _0x312e9e['status'](_0x44d9cd)[_0x8906('0x1c')](_0x23e9bd);}};}function respondWithFilteredResult(_0x465442,_0x1d339a){return function(_0x3eea79){if(_0x3eea79){var _0x43fcba=typeof _0x1d339a['offset']===_0x8906('0x1d')&&typeof _0x1d339a[_0x8906('0x1e')]==='undefined';var _0x37a8c6=_0x3eea79[_0x8906('0x1f')];var _0x2c6ccd=_0x43fcba?0x0:_0x1d339a[_0x8906('0x20')];var _0x2d9ac6=_0x43fcba?_0x3eea79[_0x8906('0x1f')]:_0x1d339a[_0x8906('0x20')]+_0x1d339a['limit'];var _0x1a0088;if(_0x2d9ac6>=_0x37a8c6){_0x2d9ac6=_0x37a8c6;_0x1a0088=0xc8;}else{_0x1a0088=0xce;}_0x465442[_0x8906('0x1a')](_0x1a0088);return _0x465442[_0x8906('0x21')](_0x8906('0x22'),_0x2c6ccd+'-'+_0x2d9ac6+'/'+_0x37a8c6)[_0x8906('0x1c')](_0x3eea79);}return null;};}function patchUpdates(_0x410c26){return function(_0xca9d1d){try{jsonpatch['apply'](_0xca9d1d,_0x410c26,!![]);}catch(_0x4a5ce1){return BPromise[_0x8906('0x23')](_0x4a5ce1);}return _0xca9d1d[_0x8906('0x24')]();};}function saveUpdates(_0x51130f,_0x4205b9){return function(_0x28e02c){if(_0x28e02c){return _0x28e02c[_0x8906('0x25')](_0x51130f)[_0x8906('0x26')](function(_0x513949){return _0x513949;});}return null;};}function removeEntity(_0xe11c4c,_0x55efb2){return function(_0x323d05){if(_0x323d05){return _0x323d05[_0x8906('0x27')]()[_0x8906('0x26')](function(){var _0x28cfbc=_0x323d05[_0x8906('0x28')]({'plain':!![]});var _0x11966e=_0x8906('0x29');return db[_0x8906('0x2a')][_0x8906('0x27')]({'where':{'type':_0x11966e,'resourceId':_0x28cfbc['id']}})['then'](function(){return _0x323d05;});})[_0x8906('0x26')](function(){_0xe11c4c[_0x8906('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e0c69,_0x50e20a){return function(_0x41cdb0){if(!_0x41cdb0){_0x2e0c69['sendStatus'](0x194);}return _0x41cdb0;};}function handleError(_0x5259f8,_0x1ecbd7){_0x1ecbd7=_0x1ecbd7||0x1f4;return function(_0x51da11){logger['error'](_0x51da11[_0x8906('0x2b')]);if(_0x51da11[_0x8906('0x2c')]){delete _0x51da11[_0x8906('0x2c')];}_0x5259f8[_0x8906('0x1a')](_0x1ecbd7)['send'](_0x51da11);};}exports[_0x8906('0x2d')]=function(_0x5161d9,_0x1c295e){var _0x38a913={},_0x346417={},_0x4495a7={'count':0x0,'rows':[]};var _0x4ba32e=_[_0x8906('0x2e')](db[_0x8906('0x2f')][_0x8906('0x30')],function(_0x204fed){return{'name':_0x204fed[_0x8906('0x31')],'type':_0x204fed['type'][_0x8906('0x32')]};});_0x346417['model']=_['map'](_0x4ba32e,_0x8906('0x2c'));_0x346417['query']=_[_0x8906('0x33')](_0x5161d9[_0x8906('0x34')]);_0x346417['filters']=_[_0x8906('0x35')](_0x346417['model'],_0x346417[_0x8906('0x34')]);_0x38a913[_0x8906('0x36')]=_['intersection'](_0x346417[_0x8906('0x37')],qs[_0x8906('0x38')](_0x5161d9[_0x8906('0x34')][_0x8906('0x38')]));_0x38a913['attributes']=_0x38a913['attributes'][_0x8906('0x39')]?_0x38a913[_0x8906('0x36')]:_0x346417[_0x8906('0x37')];if(!_0x5161d9[_0x8906('0x34')][_0x8906('0x3a')](_0x8906('0x3b'))){_0x38a913[_0x8906('0x1e')]=qs[_0x8906('0x1e')](_0x5161d9[_0x8906('0x34')][_0x8906('0x1e')]);_0x38a913[_0x8906('0x20')]=qs['offset'](_0x5161d9[_0x8906('0x34')]['offset']);}_0x38a913[_0x8906('0x3c')]=qs['sort'](_0x5161d9[_0x8906('0x34')]['sort']);_0x38a913[_0x8906('0x3d')]=qs[_0x8906('0x3e')](_[_0x8906('0x3f')](_0x5161d9[_0x8906('0x34')],_0x346417[_0x8906('0x3e')]),_0x4ba32e);if(_0x5161d9[_0x8906('0x34')][_0x8906('0x40')]){_0x38a913[_0x8906('0x3d')]=_[_0x8906('0x41')](_0x38a913[_0x8906('0x3d')],{'$or':_[_0x8906('0x2e')](_0x4ba32e,function(_0x5bfa64){if(_0x5bfa64[_0x8906('0x42')]!==_0x8906('0x43')){var _0x28521d={};_0x28521d[_0x5bfa64[_0x8906('0x2c')]]={'$like':'%'+_0x5161d9[_0x8906('0x34')]['filter']+'%'};return _0x28521d;}})});}_0x38a913=_[_0x8906('0x41')]({},_0x38a913,_0x5161d9[_0x8906('0x44')]);var _0x3470f9={'where':_0x38a913[_0x8906('0x3d')]};return db[_0x8906('0x2f')][_0x8906('0x1f')](_0x3470f9)[_0x8906('0x26')](function(_0x9e50db){_0x4495a7[_0x8906('0x1f')]=_0x9e50db;if(_0x5161d9[_0x8906('0x34')][_0x8906('0x45')]){_0x38a913[_0x8906('0x46')]=[{'all':!![]}];}return db[_0x8906('0x2f')][_0x8906('0x47')](_0x38a913);})[_0x8906('0x26')](function(_0x375745){_0x4495a7[_0x8906('0x48')]=_0x375745;return _0x4495a7;})[_0x8906('0x26')](respondWithFilteredResult(_0x1c295e,_0x38a913))[_0x8906('0x49')](handleError(_0x1c295e,null));};exports[_0x8906('0x4a')]=function(_0x5ce579,_0x449a0a){var _0x56aba3={'raw':![],'where':{'id':_0x5ce579['params']['id']}},_0x305972={};_0x305972[_0x8906('0x37')]=_['keys'](db[_0x8906('0x2f')]['rawAttributes']);_0x305972['query']=_[_0x8906('0x33')](_0x5ce579[_0x8906('0x34')]);_0x305972['filters']=_['intersection'](_0x305972[_0x8906('0x37')],_0x305972[_0x8906('0x34')]);_0x56aba3[_0x8906('0x36')]=_['intersection'](_0x305972['model'],qs[_0x8906('0x38')](_0x5ce579[_0x8906('0x34')][_0x8906('0x38')]));_0x56aba3[_0x8906('0x36')]=_0x56aba3[_0x8906('0x36')][_0x8906('0x39')]?_0x56aba3[_0x8906('0x36')]:_0x305972[_0x8906('0x37')];if(_0x5ce579[_0x8906('0x34')][_0x8906('0x45')]){_0x56aba3[_0x8906('0x46')]=[{'all':!![]}];}_0x56aba3=_[_0x8906('0x41')]({},_0x56aba3,_0x5ce579[_0x8906('0x44')]);return db[_0x8906('0x2f')][_0x8906('0x4b')](_0x56aba3)[_0x8906('0x26')](handleEntityNotFound(_0x449a0a,null))[_0x8906('0x26')](respondWithResult(_0x449a0a,null))[_0x8906('0x49')](handleError(_0x449a0a,null));};exports[_0x8906('0x4c')]=function(_0x1f83cf,_0x1ae67e){return db['AnalyticCustomReport']['create'](_0x1f83cf[_0x8906('0x4d')],{})[_0x8906('0x26')](function(_0x22ce03){var _0x111dd1=_0x1f83cf[_0x8906('0x4e')][_0x8906('0x28')]({'plain':!![]});if(!_0x111dd1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x111dd1[_0x8906('0x4f')]===_0x8906('0x4e')){var _0x487dbe=_0x22ce03['get']({'plain':!![]});var _0x363439=_0x8906('0x50');return db[_0x8906('0x51')]['find']({'where':{'name':_0x363439,'userProfileId':_0x111dd1[_0x8906('0x52')]},'raw':!![]})[_0x8906('0x26')](function(_0x15788e){if(_0x15788e&&_0x15788e[_0x8906('0x53')]===0x0){return db[_0x8906('0x2a')][_0x8906('0x4c')]({'name':_0x487dbe[_0x8906('0x2c')],'resourceId':_0x487dbe['id'],'type':_0x8906('0x29'),'sectionId':_0x15788e['id']},{})['then'](function(){return _0x22ce03;});}else{return _0x22ce03;}})[_0x8906('0x49')](function(_0x29c21c){logger['error'](_0x8906('0x54'),_0x29c21c);throw _0x29c21c;});}return _0x22ce03;})[_0x8906('0x26')](respondWithResult(_0x1ae67e,0xc9))['catch'](handleError(_0x1ae67e,null));};exports[_0x8906('0x25')]=function(_0x3f7119,_0x450d58){if(_0x3f7119[_0x8906('0x4d')]['id']){delete _0x3f7119[_0x8906('0x4d')]['id'];}return db['AnalyticCustomReport'][_0x8906('0x4b')]({'where':{'id':_0x3f7119['params']['id']}})[_0x8906('0x26')](handleEntityNotFound(_0x450d58,null))['then'](saveUpdates(_0x3f7119['body'],null))[_0x8906('0x26')](respondWithResult(_0x450d58,null))[_0x8906('0x49')](handleError(_0x450d58,null));};exports['destroy']=function(_0x45fb50,_0x5661cc){return db['AnalyticCustomReport']['find']({'where':{'id':_0x45fb50[_0x8906('0x55')]['id']}})['then'](handleEntityNotFound(_0x5661cc,null))[_0x8906('0x26')](removeEntity(_0x5661cc,null))[_0x8906('0x49')](handleError(_0x5661cc,null));};exports[_0x8906('0x56')]=function(_0x2377f4,_0x230aa6){var _0x203f93=0xa;var _0x1b0c1b=['join',_0x8906('0x57'),'right_join',_0x8906('0x58')];var _0x24f040={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x8906('0x59'),'MAX':_0x8906('0x5a'),'MIN':_0x8906('0x5b'),'AVG':_0x8906('0x5c'),'GROUP_CONCAT':_0x8906('0x5d'),'GROUP_CONCAT ASC':_0x8906('0x5e'),'GROUP_CONCAT DESC':_0x8906('0x5f')};var _0x41ebe6={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x8906('0x60'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x8906('0x61')};var _0x25b076=function(_0x2526ec){return!_[_0x8906('0x62')]([_0x8906('0x63'),_0x8906('0x64'),_0x8906('0x65'),'IS\x20NOT\x20EMPTY'],_0x2526ec);};var _0x5edf44=function(_0x10a173){if(!_0x10a173||!_0x10a173[_0x8906('0x66')][_0x8906('0x39')]){return'';}for(var _0x2339dc='(',_0x8863b7=0x0;_0x8863b7<_0x10a173[_0x8906('0x66')][_0x8906('0x39')];_0x8863b7+=0x1){_0x8863b7>0x0&&(_0x2339dc+='\x20'+_0x10a173['operator']+'\x20');_0x2339dc+=_0x10a173[_0x8906('0x66')][_0x8863b7][_0x8906('0x67')]?_0x5edf44(_0x10a173[_0x8906('0x66')][_0x8863b7]['group']):_0x10a173[_0x8906('0x66')][_0x8863b7][_0x8906('0x68')]+'\x20'+_0x10a173[_0x8906('0x66')][_0x8863b7]['condition']+(_0x25b076(_0x10a173['rules'][_0x8863b7]['condition'])?'\x20'+_0x10a173[_0x8906('0x66')][_0x8863b7][_0x8906('0x69')]:'');}return _0x2339dc+')';};var _0x3af030={'where':{'id':_0x2377f4[_0x8906('0x55')]['id']}},_0x248234,_0x353eb4,_0x53bb45,_0x54155e,_0x3a7bd1;_0x3af030=_['merge']({},_0x3af030,_0x2377f4[_0x8906('0x44')]);return db['AnalyticCustomReport'][_0x8906('0x4b')](_0x3af030)[_0x8906('0x26')](function(_0x1f905b){if(_0x1f905b){_0x248234=_0x1f905b;return _0x1f905b[_0x8906('0x6a')]();}return null;})[_0x8906('0x26')](function(_0x4f8408){if(_0x4f8408){if(!_0x4f8408[_0x8906('0x39')]){throw new db[(_0x8906('0x6b'))][(_0x8906('0x6c'))](_0x8906('0x6d'),0x193);}_0x353eb4=_0x4f8408;return db[_0x8906('0x6e')][_0x8906('0x47')]({'raw':!![]});}return null;})[_0x8906('0x26')](function(_0x10bc1d){if(_0x10bc1d){_0x53bb45=_[_0x8906('0x6f')](_0x10bc1d,'id');var _0x1c0574;var _0x1c326f=squel[_0x8906('0x70')]();_0x1c326f['from'](_0x248234[_0x8906('0x71')]);for(var _0x22a3c5=0x0;_0x22a3c5<_0x353eb4[_0x8906('0x39')];_0x22a3c5+=0x1){_0x1c0574=_0x353eb4[_0x22a3c5][_0x8906('0x72')]?_0x53bb45[_0x353eb4[_0x22a3c5][_0x8906('0x72')]][_0x8906('0x73')]:_0x353eb4[_0x22a3c5][_0x8906('0x68')];_0x1c0574=_0x353eb4[_0x22a3c5]['function']?_[_0x8906('0x74')](_0x24f040[_0x353eb4[_0x22a3c5]['function']],'%s',_0x1c0574):_0x1c0574;_0x1c0574=_0x353eb4[_0x22a3c5][_0x8906('0x75')]?_['replace'](_0x41ebe6[_0x353eb4[_0x22a3c5][_0x8906('0x75')]],'%s',_0x1c0574):_0x1c0574;if(_0x353eb4[_0x22a3c5][_0x8906('0x76')]){_0x1c326f[_0x8906('0x67')](_0x1c0574);}_0x353eb4[_0x22a3c5][_0x8906('0x77')]&&_0x1c326f[_0x8906('0x3c')](_0x1c0574,_0x353eb4[_0x22a3c5][_0x8906('0x77')]===_0x8906('0x78')?![]:!![]);_0x1c326f[_0x8906('0x68')](_0x1c0574,_0x353eb4[_0x22a3c5]['alias']||_0x1c0574);}if(_0x248234[_0x8906('0x79')]){_0x248234[_0x8906('0x79')]=JSON[_0x8906('0x7a')](_0x248234[_0x8906('0x79')]);for(var _0x2a070e=0x0;_0x2a070e<_0x248234[_0x8906('0x79')][_0x8906('0x39')];_0x2a070e+=0x1){if(_0x248234['joins'][_0x2a070e][_0x8906('0x42')]&&_[_0x8906('0x62')](_0x1b0c1b,_0x248234[_0x8906('0x79')][_0x2a070e][_0x8906('0x42')])&&_0x248234[_0x8906('0x79')][_0x2a070e]['parentKey']&&_0x248234[_0x8906('0x79')][_0x2a070e][_0x8906('0x7b')]&&_0x248234[_0x8906('0x79')][_0x2a070e][_0x8906('0x7c')]){_0x1c326f[_0x248234['joins'][_0x2a070e][_0x8906('0x42')]](_0x248234[_0x8906('0x79')][_0x2a070e][_0x8906('0x7b')],null,util[_0x8906('0x75')]('%s.%s\x20=\x20%s.%s',_0x248234[_0x8906('0x71')],_0x248234[_0x8906('0x79')][_0x2a070e][_0x8906('0x7d')],_0x248234[_0x8906('0x79')][_0x2a070e]['foreignTable'],_0x248234['joins'][_0x2a070e][_0x8906('0x7c')]));}}}if(_0x248234[_0x8906('0x7e')]){_0x248234[_0x8906('0x7e')]=JSON[_0x8906('0x7a')](_0x248234[_0x8906('0x7e')]);_0x1c326f['where'](_0x5edf44(_0x248234['conditions'][_0x8906('0x67')]));}_0x3a7bd1=_0x1c326f[_0x8906('0x7f')]();_0x1c326f['limit'](_0x203f93);_0x1c326f[_0x8906('0x20')](0x0);logger[_0x8906('0x80')](_0x8906('0x81'),_0x1c326f[_0x8906('0x82')]());return dbH[_0x8906('0x83')][_0x8906('0x34')](_0x1c326f['toString'](),{'type':dbH[_0x8906('0x83')][_0x8906('0x84')][_0x8906('0x85')]});}})[_0x8906('0x26')](respondWithResult(_0x230aa6,null))[_0x8906('0x49')](handleError(_0x230aa6,null));};function runReport(_0x10034d,_0x5d3cd6,_0x6e67c8){var _0x4ec4af=_0x5d3cd6['name'];var _0x135393=0xa;var _0x4efc1f=[_0x8906('0x86'),_0x8906('0x57'),_0x8906('0x87'),'cross_join'];var _0x51407a={'SUM':_0x8906('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x8906('0x59'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x8906('0x5c'),'GROUP_CONCAT':_0x8906('0x5d'),'GROUP_CONCAT ASC':_0x8906('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2d24ed={'SEC_TO_TIME':_0x8906('0x89'),'DATE':_0x8906('0x60'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x8906('0x61')};var _0x173713=function(_0x17c4d5){return!_[_0x8906('0x62')]([_0x8906('0x63'),_0x8906('0x64'),_0x8906('0x65'),_0x8906('0x8a')],_0x17c4d5);};var _0x341e7b=function(_0x49f1e5){if(!_0x49f1e5||!_0x49f1e5[_0x8906('0x66')][_0x8906('0x39')]){return'';}for(var _0x290243='(',_0x2cb688=0x0;_0x2cb688<_0x49f1e5['rules'][_0x8906('0x39')];_0x2cb688+=0x1){_0x2cb688>0x0&&(_0x290243+='\x20'+_0x49f1e5[_0x8906('0x8b')]+'\x20');_0x290243+=_0x49f1e5[_0x8906('0x66')][_0x2cb688][_0x8906('0x67')]?_0x341e7b(_0x49f1e5['rules'][_0x2cb688][_0x8906('0x67')]):_0x49f1e5['rules'][_0x2cb688][_0x8906('0x68')]+'\x20'+_0x49f1e5[_0x8906('0x66')][_0x2cb688][_0x8906('0x8c')]+(_0x173713(_0x49f1e5['rules'][_0x2cb688][_0x8906('0x8c')])?'\x20'+_0x49f1e5['rules'][_0x2cb688][_0x8906('0x69')]:'');}return _0x290243+')';};var _0x39c919={'where':{'id':_0x10034d['id']}},_0x4ce213,_0x12d218,_0x4d63bf,_0x2fcf86,_0x7d547f;_0x39c919=_[_0x8906('0x41')]({},_0x39c919,_0x6e67c8);return db[_0x8906('0x2f')][_0x8906('0x4b')](_0x39c919)[_0x8906('0x26')](function(_0x3c12b4){if(_0x3c12b4){_0x4ce213=_0x3c12b4;return _0x3c12b4[_0x8906('0x6a')]();}return null;})[_0x8906('0x26')](function(_0xa83f11){if(_0xa83f11){if(!_0xa83f11[_0x8906('0x39')]){throw new db[(_0x8906('0x6b'))][(_0x8906('0x6c'))](_0x8906('0x6d'),0x193);}_0x12d218=_0xa83f11;return db[_0x8906('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x8906('0x26')](function(_0x41339e){if(_0x41339e){_0x4d63bf=_['keyBy'](_0x41339e,'id');var _0x4da5f9;var _0x511c1f=squel[_0x8906('0x70')]();_0x511c1f[_0x8906('0x8d')](_0x4ce213[_0x8906('0x71')]);for(var _0x57b457=0x0;_0x57b457<_0x12d218[_0x8906('0x39')];_0x57b457+=0x1){_0x4da5f9=_0x12d218[_0x57b457][_0x8906('0x72')]?_0x4d63bf[_0x12d218[_0x57b457][_0x8906('0x72')]][_0x8906('0x73')]:_0x12d218[_0x57b457][_0x8906('0x68')];_0x4da5f9=_0x12d218[_0x57b457][_0x8906('0x8e')]?_[_0x8906('0x74')](_0x51407a[_0x12d218[_0x57b457][_0x8906('0x8e')]],'%s',_0x4da5f9):_0x4da5f9;_0x4da5f9=_0x12d218[_0x57b457]['format']?_[_0x8906('0x74')](_0x2d24ed[_0x12d218[_0x57b457][_0x8906('0x75')]],'%s',_0x4da5f9):_0x4da5f9;if(_0x12d218[_0x57b457][_0x8906('0x76')]){_0x511c1f[_0x8906('0x67')](_0x4da5f9);}_0x12d218[_0x57b457][_0x8906('0x77')]&&_0x511c1f[_0x8906('0x3c')](_0x4da5f9,_0x12d218[_0x57b457]['orderBy']===_0x8906('0x78')?![]:!![]);_0x511c1f['field'](_0x4da5f9,_0x12d218[_0x57b457][_0x8906('0x8f')]||_0x4da5f9);}if(_0x4ce213[_0x8906('0x79')]){_0x4ce213[_0x8906('0x79')]=JSON[_0x8906('0x7a')](_0x4ce213[_0x8906('0x79')]);for(var _0x315df2=0x0;_0x315df2<_0x4ce213['joins']['length'];_0x315df2+=0x1){if(_0x4ce213['joins'][_0x315df2][_0x8906('0x42')]&&_[_0x8906('0x62')](_0x4efc1f,_0x4ce213['joins'][_0x315df2]['type'])&&_0x4ce213[_0x8906('0x79')][_0x315df2]['parentKey']&&_0x4ce213[_0x8906('0x79')][_0x315df2][_0x8906('0x7b')]&&_0x4ce213[_0x8906('0x79')][_0x315df2][_0x8906('0x7c')]){_0x511c1f[_0x4ce213[_0x8906('0x79')][_0x315df2][_0x8906('0x42')]](_0x4ce213[_0x8906('0x79')][_0x315df2][_0x8906('0x7b')],null,util[_0x8906('0x75')](_0x8906('0x90'),_0x4ce213['table'],_0x4ce213[_0x8906('0x79')][_0x315df2]['parentKey'],_0x4ce213[_0x8906('0x79')][_0x315df2][_0x8906('0x7b')],_0x4ce213['joins'][_0x315df2][_0x8906('0x7c')]));}}}if(_0x4ce213[_0x8906('0x7e')]){_0x4ce213[_0x8906('0x7e')]=JSON['parse'](_0x4ce213[_0x8906('0x7e')]);_0x511c1f[_0x8906('0x3d')](_0x341e7b(_0x4ce213[_0x8906('0x7e')]['group']));}_0x7d547f=_0x511c1f['clone']();_0x511c1f[_0x8906('0x1e')](_0x135393);_0x511c1f['offset'](0x0);return;}})[_0x8906('0x26')](function(){if(_0x5d3cd6['output']===_0x8906('0x91')){return null;}var _0x587f6e=_[_0x8906('0x41')](_0x5d3cd6,{'name':_0x5d3cd6[_0x8906('0x92')]||_0x5d3cd6[_0x8906('0x2c')]||_0x4ce213[_0x8906('0x2c')],'basename':_0x4ec4af,'savename':util[_0x8906('0x75')](_0x8906('0x93'),_0x5d3cd6[_0x8906('0x2c')]||_0x4ce213[_0x8906('0x2c')],require(_0x8906('0x94'))[_0x8906('0x95')](0x4),_0x5d3cd6[_0x8906('0x96')]||_0x8906('0x97')),'reportId':_0x4ce213['id'],'reportType':'custom'});return db[_0x8906('0x98')][_0x8906('0x4c')](_0x587f6e,{'raw':!![]});})[_0x8906('0x26')](function(_0x3097f4){if(_0x4ce213[_0x8906('0x71')]==='cdr'){_0x7d547f['where'](_0x4ce213[_0x8906('0x71')]+_0x8906('0x99'),_0x5d3cd6[_0x8906('0x9a')],_0x5d3cd6['endDate']);}else{_0x7d547f[_0x8906('0x3d')](_0x4ce213[_0x8906('0x71')]+_0x8906('0x9b'),_0x5d3cd6[_0x8906('0x9a')],_0x5d3cd6[_0x8906('0x9c')]);}if(_0x3097f4){logger[_0x8906('0x9d')]('Run\x20Query:',_0x7d547f['toString']());require(_0x8906('0x9e'))['fork'](path['join'](__dirname,_0x8906('0x9f'),_0x3097f4[_0x8906('0x96')]),[_0x3097f4['id'],_0x7d547f['toString'](),path[_0x8906('0x86')](__dirname,_0x8906('0xa0'),_0x3097f4['savename']),_0x4ec4af]);return _0x3097f4;}else{var _0x4a9159=squel['select']();_0x4a9159['from']('('+_0x7d547f[_0x8906('0x82')]()+')',_0x8906('0xa1'));_0x4a9159[_0x8906('0x68')](_0x8906('0xa2'),'count');_0x7d547f[_0x8906('0x1e')](_0x5d3cd6[_0x8906('0x1e')]||_0x135393);_0x7d547f[_0x8906('0x20')](_0x5d3cd6[_0x8906('0x20')]||0x0);return dbH[_0x8906('0x83')]['query'](_0x4a9159[_0x8906('0x82')](),{'type':dbH[_0x8906('0x83')]['QueryTypes'][_0x8906('0x85')]})[_0x8906('0x26')](function(_0x5db18b){if(!_0x5db18b[_0x8906('0x39')]){_0x2fcf86=0x0;}else{_0x2fcf86=_0x5db18b[0x0][_0x8906('0x1f')]||0x0;}return dbH[_0x8906('0x83')][_0x8906('0x34')](_0x7d547f[_0x8906('0x82')](),{'type':dbH[_0x8906('0x83')][_0x8906('0x84')]['SELECT']});})[_0x8906('0x26')](function(_0x40165e){return{'rows':_0x40165e||[],'count':_0x2fcf86};});}});}exports[_0x8906('0xa3')]=function(_0x350db3,_0x4300c4){return runReport(_0x350db3['params'],_0x350db3[_0x8906('0x34')],_0x350db3[_0x8906('0x44')])[_0x8906('0x26')](respondWithResult(_0x4300c4,null))[_0x8906('0x49')](handleError(_0x4300c4,null));};exports[_0x8906('0xa4')]=runReport;exports[_0x8906('0x34')]=function(_0x28a918,_0x262485){var _0x17c6d0=0xa;var _0x16cc88=[_0x8906('0x86'),'left_join','right_join',_0x8906('0x58')];var _0x2cdb5f={'SUM':_0x8906('0x88'),'COUNT':_0x8906('0xa5'),'COUNT DISTINCT':_0x8906('0x59'),'MAX':_0x8906('0x5a'),'MIN':'MIN(%s)','AVG':_0x8906('0x5c'),'GROUP_CONCAT':_0x8906('0x5d'),'GROUP_CONCAT ASC':_0x8906('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34b2fc={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x8906('0x60'),'HOUR':_0x8906('0xa6'),'ROUND':_0x8906('0xa7'),'UNIX_TIMESTAMP':_0x8906('0x61')};var _0x5a26fa=function(_0xcd753){return!_[_0x8906('0x62')]([_0x8906('0x63'),_0x8906('0x64'),_0x8906('0x65'),_0x8906('0x8a')],_0xcd753);};var _0x4967a8=function(_0x45c39a){if(!_0x45c39a||!_0x45c39a[_0x8906('0x66')][_0x8906('0x39')]){return'';}for(var _0x247754='(',_0x9b4f95=0x0;_0x9b4f95<_0x45c39a[_0x8906('0x66')][_0x8906('0x39')];_0x9b4f95+=0x1){_0x9b4f95>0x0&&(_0x247754+='\x20'+_0x45c39a['operator']+'\x20');_0x247754+=_0x45c39a[_0x8906('0x66')][_0x9b4f95][_0x8906('0x67')]?_0x4967a8(_0x45c39a[_0x8906('0x66')][_0x9b4f95][_0x8906('0x67')]):_0x45c39a[_0x8906('0x66')][_0x9b4f95][_0x8906('0x68')]+'\x20'+_0x45c39a[_0x8906('0x66')][_0x9b4f95][_0x8906('0x8c')]+(_0x5a26fa(_0x45c39a[_0x8906('0x66')][_0x9b4f95]['condition'])?'\x20'+_0x45c39a['rules'][_0x9b4f95][_0x8906('0x69')]:'');}return _0x247754+')';};var _0x2adf95={'where':{'id':_0x28a918['params']['id']}},_0x47eeb2,_0x523ea3,_0x6215be,_0x206e85,_0x1ead9d;_0x2adf95=_[_0x8906('0x41')]({},_0x2adf95,_0x28a918[_0x8906('0x44')]);return db[_0x8906('0x2f')]['find'](_0x2adf95)[_0x8906('0x26')](function(_0x2ad16e){if(_0x2ad16e){_0x47eeb2=_0x2ad16e;return _0x2ad16e[_0x8906('0x6a')]();}return null;})[_0x8906('0x26')](function(_0x4e4dff){if(_0x4e4dff){if(!_0x4e4dff[_0x8906('0x39')]){throw new db['Sequelize'][(_0x8906('0x6c'))](_0x8906('0x6d'),0x193);}_0x523ea3=_0x4e4dff;return db[_0x8906('0x6e')][_0x8906('0x47')]({'raw':!![]});}return null;})[_0x8906('0x26')](function(_0x2f3c88){if(_0x2f3c88){_0x6215be=_[_0x8906('0x6f')](_0x2f3c88,'id');var _0x4b2461;var _0x4159cf=squel[_0x8906('0x70')]();_0x4159cf[_0x8906('0x8d')](_0x47eeb2[_0x8906('0x71')]);for(var _0x46d22d=0x0;_0x46d22d<_0x523ea3[_0x8906('0x39')];_0x46d22d+=0x1){_0x4b2461=_0x523ea3[_0x46d22d][_0x8906('0x72')]?_0x6215be[_0x523ea3[_0x46d22d]['MetricId']]['metric']:_0x523ea3[_0x46d22d][_0x8906('0x68')];_0x4b2461=_0x523ea3[_0x46d22d][_0x8906('0x8e')]?_[_0x8906('0x74')](_0x2cdb5f[_0x523ea3[_0x46d22d]['function']],'%s',_0x4b2461):_0x4b2461;_0x4b2461=_0x523ea3[_0x46d22d][_0x8906('0x75')]?_[_0x8906('0x74')](_0x34b2fc[_0x523ea3[_0x46d22d][_0x8906('0x75')]],'%s',_0x4b2461):_0x4b2461;if(_0x523ea3[_0x46d22d][_0x8906('0x76')]){_0x4159cf[_0x8906('0x67')](_0x4b2461);}_0x523ea3[_0x46d22d][_0x8906('0x77')]&&_0x4159cf[_0x8906('0x3c')](_0x4b2461,_0x523ea3[_0x46d22d]['orderBy']==='DESC'?![]:!![]);_0x4159cf['field'](_0x4b2461,_0x523ea3[_0x46d22d][_0x8906('0x8f')]||_0x4b2461);}if(_0x47eeb2[_0x8906('0x79')]){_0x47eeb2['joins']=JSON[_0x8906('0x7a')](_0x47eeb2[_0x8906('0x79')]);for(var _0x12c892=0x0;_0x12c892<_0x47eeb2['joins'][_0x8906('0x39')];_0x12c892+=0x1){if(_0x47eeb2[_0x8906('0x79')][_0x12c892][_0x8906('0x42')]&&_[_0x8906('0x62')](_0x16cc88,_0x47eeb2[_0x8906('0x79')][_0x12c892][_0x8906('0x42')])&&_0x47eeb2['joins'][_0x12c892][_0x8906('0x7d')]&&_0x47eeb2[_0x8906('0x79')][_0x12c892]['foreignTable']&&_0x47eeb2[_0x8906('0x79')][_0x12c892][_0x8906('0x7c')]){_0x4159cf[_0x47eeb2[_0x8906('0x79')][_0x12c892]['type']](_0x47eeb2[_0x8906('0x79')][_0x12c892][_0x8906('0x7b')],null,util[_0x8906('0x75')](_0x8906('0x90'),_0x47eeb2[_0x8906('0x71')],_0x47eeb2[_0x8906('0x79')][_0x12c892][_0x8906('0x7d')],_0x47eeb2[_0x8906('0x79')][_0x12c892][_0x8906('0x7b')],_0x47eeb2[_0x8906('0x79')][_0x12c892]['foreignKey']));}}}if(_0x47eeb2['conditions']){_0x47eeb2[_0x8906('0x7e')]=JSON[_0x8906('0x7a')](_0x47eeb2[_0x8906('0x7e')]);_0x4159cf[_0x8906('0x3d')](_0x4967a8(_0x47eeb2[_0x8906('0x7e')][_0x8906('0x67')]));}_0x1ead9d=_0x4159cf[_0x8906('0x7f')]();_0x4159cf[_0x8906('0x1e')](_0x17c6d0);_0x4159cf['offset'](0x0);logger['debug'](_0x8906('0x81'),_0x4159cf[_0x8906('0x82')]());return dbH['sequelize'][_0x8906('0x34')](_0x4159cf[_0x8906('0x82')](),{'type':dbH[_0x8906('0x83')][_0x8906('0x84')][_0x8906('0x85')]});}})['then'](function(){return{'sql':_0x1ead9d[_0x8906('0x82')]()};})[_0x8906('0x26')](respondWithResult(_0x262485,null))['catch'](handleError(_0x262485,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 5cadff2..e2a9641 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 _0x6e06=['AnalyticCustomReport','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e06,0x1ae));var _0x66e0=function(_0x37a1bd,_0x4bc832){_0x37a1bd=_0x37a1bd-0x0;var _0x42f356=_0x6e06[_0x37a1bd];return _0x42f356;};'use strict';var _=require(_0x66e0('0x0'));var util=require(_0x66e0('0x1'));var logger=require(_0x66e0('0x2'))('api');var moment=require(_0x66e0('0x3'));var BPromise=require(_0x66e0('0x4'));var rp=require(_0x66e0('0x5'));var fs=require('fs');var path=require(_0x66e0('0x6'));var rimraf=require(_0x66e0('0x7'));var config=require(_0x66e0('0x8'));var attributes=require(_0x66e0('0x9'));module[_0x66e0('0xa')]=function(_0x41d2b4,_0x13424a){return _0x41d2b4[_0x66e0('0xb')](_0x66e0('0xc'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf5b5=['lodash','util','api','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0x16ecce,_0x3c33d3){var _0x2de037=function(_0x5c849f){while(--_0x5c849f){_0x16ecce['push'](_0x16ecce['shift']());}};_0x2de037(++_0x3c33d3);}(_0xf5b5,0xa8));var _0x5f5b=function(_0x327305,_0x293655){_0x327305=_0x327305-0x0;var _0x11a463=_0xf5b5[_0x327305];return _0x11a463;};'use strict';var _=require(_0x5f5b('0x0'));var util=require(_0x5f5b('0x1'));var logger=require('../../config/logger')(_0x5f5b('0x2'));var moment=require('moment');var BPromise=require(_0x5f5b('0x3'));var rp=require(_0x5f5b('0x4'));var fs=require('fs');var path=require(_0x5f5b('0x5'));var rimraf=require('rimraf');var config=require(_0x5f5b('0x6'));var attributes=require(_0x5f5b('0x7'));module[_0x5f5b('0x8')]=function(_0x46e756,_0x2fbbb2){return _0x46e756[_0x5f5b('0x9')](_0x5f5b('0xa'),attributes,{'tableName':_0x5f5b('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 c526993..e9f4fa3 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 _0xc5f1=['request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','request\x20sent','message','catch','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc5f1,0xac));var _0x1c5f=function(_0x5adb18,_0x2a67ed){_0x5adb18=_0x5adb18-0x0;var _0x11155e=_0xc5f1[_0x5adb18];return _0x11155e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x1c5f('0x0'));var rs=require(_0x1c5f('0x1'));var fs=require('fs');var Redis=require(_0x1c5f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1c5f('0x3'));var logger=require('../../config/logger')(_0x1c5f('0x4'));var config=require(_0x1c5f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1c5f('0x6')][_0x1c5f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x576878,_0x517a16,_0x1910a6){return new BPromise(function(_0x5752dd,_0xc8dcb7){return client[_0x1c5f('0x8')](_0x576878,_0x1910a6)[_0x1c5f('0x9')](function(_0x41fafe){logger[_0x1c5f('0xa')](_0x1c5f('0xb'),_0x517a16,'request\x20sent');logger[_0x1c5f('0xc')](_0x1c5f('0xd'),_0x517a16,'request\x20sent',JSON[_0x1c5f('0xe')](_0x41fafe));if(_0x41fafe[_0x1c5f('0xf')]){if(_0x41fafe[_0x1c5f('0xf')][_0x1c5f('0x10')]===0x1f4){logger[_0x1c5f('0xf')](_0x1c5f('0xb'),_0x517a16,_0x41fafe[_0x1c5f('0xf')]['message']);return _0xc8dcb7(_0x41fafe[_0x1c5f('0xf')]['message']);}logger[_0x1c5f('0xf')](_0x1c5f('0xb'),_0x517a16,_0x41fafe['error']['message']);return _0x5752dd(_0x41fafe[_0x1c5f('0xf')]['message']);}else{logger[_0x1c5f('0xa')](_0x1c5f('0xb'),_0x517a16,_0x1c5f('0x11'));_0x5752dd(_0x41fafe['result'][_0x1c5f('0x12')]);}})[_0x1c5f('0x13')](function(_0x48bb64){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x517a16,_0x48bb64);_0xc8dcb7(_0x48bb64);});});} \ No newline at end of file +var _0x8254=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x17218c,_0x3e8bf6){var _0x2fb49a=function(_0x1d293c){while(--_0x1d293c){_0x17218c['push'](_0x17218c['shift']());}};_0x2fb49a(++_0x3e8bf6);}(_0x8254,0x18e));var _0x4825=function(_0x2ca927,_0x5ea473){_0x2ca927=_0x2ca927-0x0;var _0x23193e=_0x8254[_0x2ca927];return _0x23193e;};'use strict';var _=require(_0x4825('0x0'));var util=require(_0x4825('0x1'));var moment=require('moment');var BPromise=require(_0x4825('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4825('0x3'))['db'];var utils=require(_0x4825('0x4'));var logger=require(_0x4825('0x5'))(_0x4825('0x6'));var config=require(_0x4825('0x7'));var jayson=require(_0x4825('0x8'));var client=jayson[_0x4825('0x9')][_0x4825('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1756e2,_0x34a49b,_0x4c4db5){return new BPromise(function(_0x29985e,_0x1a78a0){return client[_0x4825('0xb')](_0x1756e2,_0x4c4db5)['then'](function(_0x126011){logger[_0x4825('0xc')](_0x4825('0xd'),_0x34a49b,'request\x20sent');logger[_0x4825('0xe')](_0x4825('0xf'),_0x34a49b,_0x4825('0x10'),JSON[_0x4825('0x11')](_0x126011));if(_0x126011[_0x4825('0x12')]){if(_0x126011[_0x4825('0x12')][_0x4825('0x13')]===0x1f4){logger[_0x4825('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x34a49b,_0x126011[_0x4825('0x12')][_0x4825('0x14')]);return _0x1a78a0(_0x126011[_0x4825('0x12')][_0x4825('0x14')]);}logger['error'](_0x4825('0xd'),_0x34a49b,_0x126011[_0x4825('0x12')]['message']);return _0x29985e(_0x126011[_0x4825('0x12')]['message']);}else{logger[_0x4825('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x34a49b,_0x4825('0x10'));_0x29985e(_0x126011[_0x4825('0x15')][_0x4825('0x14')]);}})[_0x4825('0x16')](function(_0x3c6719){logger[_0x4825('0x12')](_0x4825('0xd'),_0x34a49b,_0x3c6719);_0x1a78a0(_0x3c6719);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index d762f08..5f61910 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 _0x5d06=['index','/:id','isAuthenticated','show','/:id/preview','preview','query','post','create','put','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d06,0xe9));var _0x65d0=function(_0x524bb4,_0x3bdf50){_0x524bb4=_0x524bb4-0x0;var _0x3ed61e=_0x5d06[_0x524bb4];return _0x3ed61e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x65d0('0x0'));var timeout=require(_0x65d0('0x1'));var express=require(_0x65d0('0x2'));var router=express[_0x65d0('0x3')]();var fs_extra=require(_0x65d0('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x65d0('0x5'));var controller=require('./analyticCustomReport.controller');router[_0x65d0('0x6')]('/',auth['isAuthenticated'](),controller[_0x65d0('0x7')]);router[_0x65d0('0x6')](_0x65d0('0x8'),auth[_0x65d0('0x9')](),controller[_0x65d0('0xa')]);router[_0x65d0('0x6')](_0x65d0('0xb'),auth[_0x65d0('0x9')](),controller[_0x65d0('0xc')]);router[_0x65d0('0x6')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0x65d0('0x6')]('/:id/query',auth[_0x65d0('0x9')](),controller[_0x65d0('0xd')]);router[_0x65d0('0xe')]('/',auth['isAuthenticated'](),controller[_0x65d0('0xf')]);router[_0x65d0('0x10')](_0x65d0('0x8'),auth[_0x65d0('0x9')](),controller['update']);router[_0x65d0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x65d0('0x12')]);module[_0x65d0('0x13')]=router; \ No newline at end of file +var _0xa13a=['/:id/run','run','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/preview','preview'];(function(_0x2bb82d,_0x42c7f8){var _0x5e0b92=function(_0x19f44b){while(--_0x19f44b){_0x2bb82d['push'](_0x2bb82d['shift']());}};_0x5e0b92(++_0x42c7f8);}(_0xa13a,0x167));var _0xaa13=function(_0x27168d,_0x2be904){_0x27168d=_0x27168d-0x0;var _0x13f957=_0xa13a[_0x27168d];return _0x13f957;};'use strict';var multer=require(_0xaa13('0x0'));var util=require(_0xaa13('0x1'));var path=require(_0xaa13('0x2'));var timeout=require(_0xaa13('0x3'));var express=require(_0xaa13('0x4'));var router=express[_0xaa13('0x5')]();var fs_extra=require(_0xaa13('0x6'));var auth=require(_0xaa13('0x7'));var interaction=require(_0xaa13('0x8'));var config=require(_0xaa13('0x9'));var controller=require('./analyticCustomReport.controller');router[_0xaa13('0xa')]('/',auth[_0xaa13('0xb')](),controller['index']);router[_0xaa13('0xa')](_0xaa13('0xc'),auth[_0xaa13('0xb')](),controller[_0xaa13('0xd')]);router[_0xaa13('0xa')](_0xaa13('0xe'),auth[_0xaa13('0xb')](),controller[_0xaa13('0xf')]);router[_0xaa13('0xa')](_0xaa13('0x10'),auth['isAuthenticated'](),controller[_0xaa13('0x11')]);router[_0xaa13('0xa')]('/:id/query',auth[_0xaa13('0xb')](),controller['query']);router[_0xaa13('0x12')]('/',auth[_0xaa13('0xb')](),controller[_0xaa13('0x13')]);router[_0xaa13('0x14')](_0xaa13('0xc'),auth[_0xaa13('0xb')](),controller[_0xaa13('0x15')]);router[_0xaa13('0x16')]('/:id',auth[_0xaa13('0xb')](),controller[_0xaa13('0x17')]);module[_0xaa13('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index ed357af..f25d92b 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 _0x53ec=['STRING','TEXT','sequelize','exports'];(function(_0x27dac9,_0x26a40b){var _0xd97067=function(_0x5a2931){while(--_0x5a2931){_0x27dac9['push'](_0x27dac9['shift']());}};_0xd97067(++_0x26a40b);}(_0x53ec,0x192));var _0xc53e=function(_0x1aaf79,_0x298f15){_0x1aaf79=_0x1aaf79-0x0;var _0x12e371=_0x53ec[_0x1aaf79];return _0x12e371;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc53e('0x2')]},'parent':{'type':Sequelize[_0xc53e('0x2')]},'table':{'type':Sequelize[_0xc53e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xc53e('0x3')]}}; \ No newline at end of file +var _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x4ded50,_0x4a6af3){var _0xa92135=function(_0xe09b41){while(--_0xe09b41){_0x4ded50['push'](_0x4ded50['shift']());}};_0xa92135(++_0x4a6af3);}(_0xac9d,0x14d));var _0xdac9=function(_0x262f0d,_0x51e151){_0x262f0d=_0x262f0d-0x0;var _0x21dc30=_0xac9d[_0x262f0d];return _0x21dc30;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index f820fe0..c17d329 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 _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x3461ce,_0x47bbe7){var _0x44cb21=function(_0x299579){while(--_0x299579){_0x3461ce['push'](_0x3461ce['shift']());}};_0x44cb21(++_0x47bbe7);}(_0x31f0,0xb7));var _0x031f=function(_0x49b7b1,_0x4d5142){_0x49b7b1=_0x49b7b1-0x0;var _0x17d402=_0x31f0[_0x49b7b1];return _0x17d402;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));}; \ No newline at end of file +var _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x49d9a1,_0x22ed55){var _0x14e747=function(_0x568cba){while(--_0x568cba){_0x49d9a1['push'](_0x49d9a1['shift']());}};_0x14e747(++_0x22ed55);}(_0x31f0,0xb7));var _0x031f=function(_0x39c2aa,_0x47f584){_0x39c2aa=_0x39c2aa-0x0;var _0x5986a5=_0x31f0[_0x39c2aa];return _0x5986a5;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 7d4726a..d6690ed 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 _0x871a=['../../config/logger','api','moment','bluebird','rimraf','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x27eea2,_0x16c120){var _0x26656f=function(_0x3fd7e4){while(--_0x3fd7e4){_0x27eea2['push'](_0x27eea2['shift']());}};_0x26656f(++_0x16c120);}(_0x871a,0xd1));var _0xa871=function(_0x40ec4e,_0x5d8b1b){_0x40ec4e=_0x40ec4e-0x0;var _0x333401=_0x871a[_0x40ec4e];return _0x333401;};'use strict';var _=require(_0xa871('0x0'));var util=require('util');var logger=require(_0xa871('0x1'))(_0xa871('0x2'));var moment=require(_0xa871('0x3'));var BPromise=require(_0xa871('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa871('0x5'));var config=require('../../config/environment');var attributes=require(_0xa871('0x6'));module['exports']=function(_0x5a7954,_0x473f77){return _0x5a7954[_0xa871('0x7')](_0xa871('0x8'),attributes,{'tableName':_0xa871('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce67=['exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4e4061,_0x26503b){var _0x371dbd=function(_0x31a31f){while(--_0x31a31f){_0x4e4061['push'](_0x4e4061['shift']());}};_0x371dbd(++_0x26503b);}(_0xce67,0xd0));var _0x7ce6=function(_0x4d0a9e,_0x34d885){_0x4d0a9e=_0x4d0a9e-0x0;var _0x11ad9d=_0xce67[_0x4d0a9e];return _0x11ad9d;};'use strict';var _=require('lodash');var util=require(_0x7ce6('0x0'));var logger=require(_0x7ce6('0x1'))(_0x7ce6('0x2'));var moment=require('moment');var BPromise=require(_0x7ce6('0x3'));var rp=require(_0x7ce6('0x4'));var fs=require('fs');var path=require(_0x7ce6('0x5'));var rimraf=require(_0x7ce6('0x6'));var config=require(_0x7ce6('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x7ce6('0x8')]=function(_0x2efe47,_0x4986f9){return _0x2efe47[_0x7ce6('0x9')](_0x7ce6('0xa'),attributes,{'tableName':_0x7ce6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 422a7dd..7099aa4 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 _0x397f=['error','code','message','request\x20sent','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug'];(function(_0x5e3562,_0x89b7b7){var _0x1a1b3b=function(_0x1047a2){while(--_0x1047a2){_0x5e3562['push'](_0x5e3562['shift']());}};_0x1a1b3b(++_0x89b7b7);}(_0x397f,0x1ba));var _0xf397=function(_0x471596,_0x157724){_0x471596=_0x471596-0x0;var _0x311dc2=_0x397f[_0x471596];return _0x311dc2;};'use strict';var _=require(_0xf397('0x0'));var util=require(_0xf397('0x1'));var moment=require('moment');var BPromise=require(_0xf397('0x2'));var rs=require(_0xf397('0x3'));var fs=require('fs');var Redis=require(_0xf397('0x4'));var db=require(_0xf397('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf397('0x6'))(_0xf397('0x7'));var config=require('../../config/environment');var jayson=require(_0xf397('0x8'));var client=jayson[_0xf397('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b79b,_0x114135,_0x531bf1){return new BPromise(function(_0x5861fd,_0x2a1770){return client['request'](_0x10b79b,_0x531bf1)[_0xf397('0xa')](function(_0x19ce73){logger[_0xf397('0xb')](_0xf397('0xc'),_0x114135,'request\x20sent');logger[_0xf397('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x114135,'request\x20sent',JSON['stringify'](_0x19ce73));if(_0x19ce73[_0xf397('0xe')]){if(_0x19ce73['error'][_0xf397('0xf')]===0x1f4){logger['error'](_0xf397('0xc'),_0x114135,_0x19ce73[_0xf397('0xe')]['message']);return _0x2a1770(_0x19ce73[_0xf397('0xe')][_0xf397('0x10')]);}logger[_0xf397('0xe')](_0xf397('0xc'),_0x114135,_0x19ce73[_0xf397('0xe')][_0xf397('0x10')]);return _0x5861fd(_0x19ce73[_0xf397('0xe')][_0xf397('0x10')]);}else{logger[_0xf397('0xb')](_0xf397('0xc'),_0x114135,_0xf397('0x11'));_0x5861fd(_0x19ce73['result'][_0xf397('0x10')]);}})[_0xf397('0x12')](function(_0x570d0b){logger[_0xf397('0xe')](_0xf397('0xc'),_0x114135,_0x570d0b);_0x2a1770(_0x570d0b);});});} \ No newline at end of file +var _0x6ae9=['catch','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x244934,_0x2f37dd){var _0x496a02=function(_0x34f092){while(--_0x34f092){_0x244934['push'](_0x244934['shift']());}};_0x496a02(++_0x2f37dd);}(_0x6ae9,0xe5));var _0x96ae=function(_0x45f469,_0x5d0c18){_0x45f469=_0x45f469-0x0;var _0x30db88=_0x6ae9[_0x45f469];return _0x30db88;};'use strict';var _=require('lodash');var util=require(_0x96ae('0x0'));var moment=require(_0x96ae('0x1'));var BPromise=require('bluebird');var rs=require(_0x96ae('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x96ae('0x3'));var logger=require(_0x96ae('0x4'))(_0x96ae('0x5'));var config=require('../../config/environment');var jayson=require(_0x96ae('0x6'));var client=jayson[_0x96ae('0x7')][_0x96ae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42d800,_0x8d7c53,_0x3f83d3){return new BPromise(function(_0x5a3672,_0x5e7fc9){return client['request'](_0x42d800,_0x3f83d3)[_0x96ae('0x9')](function(_0x30b430){logger['info'](_0x96ae('0xa'),_0x8d7c53,_0x96ae('0xb'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x8d7c53,'request\x20sent',JSON[_0x96ae('0xc')](_0x30b430));if(_0x30b430[_0x96ae('0xd')]){if(_0x30b430['error'][_0x96ae('0xe')]===0x1f4){logger[_0x96ae('0xd')](_0x96ae('0xa'),_0x8d7c53,_0x30b430['error']['message']);return _0x5e7fc9(_0x30b430['error'][_0x96ae('0xf')]);}logger['error'](_0x96ae('0xa'),_0x8d7c53,_0x30b430['error'][_0x96ae('0xf')]);return _0x5a3672(_0x30b430['error'][_0x96ae('0xf')]);}else{logger[_0x96ae('0x10')](_0x96ae('0xa'),_0x8d7c53,_0x96ae('0xb'));_0x5a3672(_0x30b430[_0x96ae('0x11')][_0x96ae('0xf')]);}})[_0x96ae('0x12')](function(_0x2d1b72){logger['error'](_0x96ae('0xa'),_0x8d7c53,_0x2d1b72);_0x5e7fc9(_0x2d1b72);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index f4b9742..3ed41d3 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 _0x652a=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','/:id/preview','preview','run','/:id/query','query','post','create','put','update','destroy','exports','multer','util'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x652a,0x1ae));var _0xa652=function(_0x5a210e,_0x3afbfa){_0x5a210e=_0x5a210e-0x0;var _0x29f905=_0x652a[_0x5a210e];return _0x29f905;};'use strict';var multer=require(_0xa652('0x0'));var util=require(_0xa652('0x1'));var path=require(_0xa652('0x2'));var timeout=require(_0xa652('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa652('0x4'));var auth=require(_0xa652('0x5'));var interaction=require(_0xa652('0x6'));var config=require(_0xa652('0x7'));var controller=require(_0xa652('0x8'));router['get']('/',auth[_0xa652('0x9')](),controller[_0xa652('0xa')]);router[_0xa652('0xb')](_0xa652('0xc'),auth[_0xa652('0x9')](),controller['show']);router['get'](_0xa652('0xd'),auth[_0xa652('0x9')](),controller[_0xa652('0xe')]);router[_0xa652('0xb')]('/:id/run',auth['isAuthenticated'](),controller[_0xa652('0xf')]);router[_0xa652('0xb')](_0xa652('0x10'),auth[_0xa652('0x9')](),controller[_0xa652('0x11')]);router[_0xa652('0x12')]('/',auth[_0xa652('0x9')](),controller[_0xa652('0x13')]);router[_0xa652('0x14')](_0xa652('0xc'),auth[_0xa652('0x9')](),controller[_0xa652('0x15')]);router['delete'](_0xa652('0xc'),auth['isAuthenticated'](),controller[_0xa652('0x16')]);module[_0xa652('0x17')]=router; \ No newline at end of file +var _0xf7f6=['express','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id/preview','preview','/:id/run','run','/:id/query','post','put','update','delete','destroy','exports','path'];(function(_0x581eb4,_0x4c5b92){var _0x12f4f4=function(_0x2b6a70){while(--_0x2b6a70){_0x581eb4['push'](_0x581eb4['shift']());}};_0x12f4f4(++_0x4c5b92);}(_0xf7f6,0x1b7));var _0x6f7f=function(_0x14a44f,_0x37ae29){_0x14a44f=_0x14a44f-0x0;var _0x4dfea0=_0xf7f6[_0x14a44f];return _0x4dfea0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f7f('0x0'));var timeout=require('connect-timeout');var express=require(_0x6f7f('0x1'));var router=express[_0x6f7f('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6f7f('0x3'));var config=require(_0x6f7f('0x4'));var controller=require(_0x6f7f('0x5'));router[_0x6f7f('0x6')]('/',auth[_0x6f7f('0x7')](),controller[_0x6f7f('0x8')]);router[_0x6f7f('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6f7f('0x6')](_0x6f7f('0x9'),auth[_0x6f7f('0x7')](),controller[_0x6f7f('0xa')]);router[_0x6f7f('0x6')](_0x6f7f('0xb'),auth[_0x6f7f('0x7')](),controller[_0x6f7f('0xc')]);router[_0x6f7f('0x6')](_0x6f7f('0xd'),auth['isAuthenticated'](),controller['query']);router[_0x6f7f('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6f7f('0xf')]('/:id',auth[_0x6f7f('0x7')](),controller[_0x6f7f('0x10')]);router[_0x6f7f('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6f7f('0x12')]);module[_0x6f7f('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 54a8f27..36f3f7a 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 _0x01a6=['scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','pdf','csv','DATE','Loading','manual'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x01a6,0x85));var _0x601a=function(_0x4f3ddb,_0x268fe7){_0x4f3ddb=_0x4f3ddb-0x0;var _0x23f84c=_0x01a6[_0x4f3ddb];return _0x23f84c;};'use strict';var Sequelize=require(_0x601a('0x0'));var moment=require(_0x601a('0x1'));module[_0x601a('0x2')]={'name':{'type':Sequelize[_0x601a('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x601a('0x4')]('csv',_0x601a('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x601a('0x6')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x601a('0x7')]},'endDate':{'type':Sequelize[_0x601a('0x7')]},'status':{'type':Sequelize[_0x601a('0x3')],'defaultValue':_0x601a('0x8')},'type':{'type':Sequelize[_0x601a('0x4')](_0x601a('0x9'),_0x601a('0xa')),'allowNull':![],'defaultValue':_0x601a('0x9')},'reportId':{'type':Sequelize[_0x601a('0xb')](0xb)[_0x601a('0xc')]},'reportType':{'type':Sequelize[_0x601a('0x3')]}}; \ No newline at end of file +var _0xfa37=['manual','INTEGER','UNSIGNED','moment','exports','ENUM','pdf','xlsx','csv','STRING','scheduled'];(function(_0x3dcdab,_0x4f63d7){var _0xfb5f36=function(_0x1d249b){while(--_0x1d249b){_0x3dcdab['push'](_0x3dcdab['shift']());}};_0xfb5f36(++_0x4f63d7);}(_0xfa37,0x137));var _0x7fa3=function(_0x17b636,_0xd1e496){_0x17b636=_0x17b636-0x0;var _0x5ea05e=_0xfa37[_0x17b636];return _0x5ea05e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7fa3('0x0'));module[_0x7fa3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x7fa3('0x2')]('csv',_0x7fa3('0x3'),_0x7fa3('0x4')),'allowNull':![],'defaultValue':_0x7fa3('0x5')},'savename':{'type':Sequelize[_0x7fa3('0x6')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x7fa3('0x2')]('manual',_0x7fa3('0x7')),'allowNull':![],'defaultValue':_0x7fa3('0x8')},'reportId':{'type':Sequelize[_0x7fa3('0x9')](0xb)[_0x7fa3('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index e1edd35..1119587 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 _0xdc47=['index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','output','toLowerCase','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','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','status','end','json','offset','undefined','count','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send'];(function(_0x5c4585,_0x3d0eab){var _0x21dede=function(_0x5c3d6a){while(--_0x5c3d6a){_0x5c4585['push'](_0x5c4585['shift']());}};_0x21dede(++_0x3d0eab);}(_0xdc47,0x1c5));var _0x7dc4=function(_0x594ece,_0x2a1f27){_0x594ece=_0x594ece-0x0;var _0x471bc4=_0xdc47[_0x594ece];return _0x471bc4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7dc4('0x0'));var jsonpatch=require(_0x7dc4('0x1'));var rp=require(_0x7dc4('0x2'));var moment=require(_0x7dc4('0x3'));var BPromise=require(_0x7dc4('0x4'));var Mustache=require(_0x7dc4('0x5'));var util=require(_0x7dc4('0x6'));var path=require(_0x7dc4('0x7'));var sox=require('sox');var csv=require(_0x7dc4('0x8'));var ejs=require(_0x7dc4('0x9'));var fs=require('fs');var fs_extra=require(_0x7dc4('0xa'));var _=require(_0x7dc4('0xb'));var squel=require(_0x7dc4('0xc'));var crypto=require(_0x7dc4('0xd'));var jsforce=require(_0x7dc4('0xe'));var deskjs=require(_0x7dc4('0xf'));var toCsv=require(_0x7dc4('0x8'));var querystring=require('querystring');var Papa=require(_0x7dc4('0x10'));var Redis=require(_0x7dc4('0x11'));var authService=require(_0x7dc4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7dc4('0x13'));var hardwareService=require(_0x7dc4('0x14'));var logger=require(_0x7dc4('0x15'))('api');var utils=require(_0x7dc4('0x16'));var config=require(_0x7dc4('0x17'));var licenseUtil=require(_0x7dc4('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6f967a,_0x39dfbc){_0x39dfbc=_0x39dfbc||0xcc;return function(_0x551f51){if(_0x551f51){return _0x6f967a['sendStatus'](_0x39dfbc);}return _0x6f967a[_0x7dc4('0x19')](_0x39dfbc)[_0x7dc4('0x1a')]();};}function respondWithResult(_0x19b667,_0xe1a35c){_0xe1a35c=_0xe1a35c||0xc8;return function(_0x4204a3){if(_0x4204a3){return _0x19b667[_0x7dc4('0x19')](_0xe1a35c)[_0x7dc4('0x1b')](_0x4204a3);}};}function respondWithFilteredResult(_0x3b0065,_0x295e42){return function(_0x38458f){if(_0x38458f){var _0x18d859=typeof _0x295e42[_0x7dc4('0x1c')]===_0x7dc4('0x1d')&&typeof _0x295e42['limit']===_0x7dc4('0x1d');var _0x29c009=_0x38458f[_0x7dc4('0x1e')];var _0x4b3c64=_0x18d859?0x0:_0x295e42[_0x7dc4('0x1c')];var _0x5a05b1=_0x18d859?_0x38458f[_0x7dc4('0x1e')]:_0x295e42[_0x7dc4('0x1c')]+_0x295e42['limit'];var _0x26978d;if(_0x5a05b1>=_0x29c009){_0x5a05b1=_0x29c009;_0x26978d=0xc8;}else{_0x26978d=0xce;}_0x3b0065[_0x7dc4('0x19')](_0x26978d);return _0x3b0065['set']('Content-Range',_0x4b3c64+'-'+_0x5a05b1+'/'+_0x29c009)['json'](_0x38458f);}return null;};}function patchUpdates(_0x3071d5){return function(_0x5719c4){try{jsonpatch['apply'](_0x5719c4,_0x3071d5,!![]);}catch(_0x226662){return BPromise[_0x7dc4('0x1f')](_0x226662);}return _0x5719c4[_0x7dc4('0x20')]();};}function saveUpdates(_0x87f2e5,_0x261b4a){return function(_0x2c848e){if(_0x2c848e){return _0x2c848e['update'](_0x87f2e5)[_0x7dc4('0x21')](function(_0x4c6242){return _0x4c6242;});}return null;};}function removeEntity(_0x235459,_0x381b7a){return function(_0x303231){if(_0x303231){return _0x303231[_0x7dc4('0x22')]()['then'](function(){var _0x2fea8c=_0x303231[_0x7dc4('0x23')]({'plain':!![]});var _0x2f891e=_0x7dc4('0x24');return db[_0x7dc4('0x25')][_0x7dc4('0x22')]({'where':{'type':_0x2f891e,'resourceId':_0x2fea8c['id']}})[_0x7dc4('0x21')](function(){return _0x303231;});})['then'](function(){_0x235459[_0x7dc4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x526ba0,_0x474b87){return function(_0x51ae70){if(!_0x51ae70){_0x526ba0['sendStatus'](0x194);}return _0x51ae70;};}function handleError(_0x3679c5,_0x44ca9d){_0x44ca9d=_0x44ca9d||0x1f4;return function(_0x5dc686){logger[_0x7dc4('0x26')](_0x5dc686[_0x7dc4('0x27')]);if(_0x5dc686[_0x7dc4('0x28')]){delete _0x5dc686[_0x7dc4('0x28')];}_0x3679c5[_0x7dc4('0x19')](_0x44ca9d)[_0x7dc4('0x29')](_0x5dc686);};}exports[_0x7dc4('0x2a')]=function(_0x46a683,_0x3c3e22){var _0x31efe0={},_0x4766a3={},_0x1ec8ab={'count':0x0,'rows':[]};var _0x9b5061=_[_0x7dc4('0x2b')](db[_0x7dc4('0x2c')][_0x7dc4('0x2d')],function(_0x41eb08){return{'name':_0x41eb08[_0x7dc4('0x2e')],'type':_0x41eb08[_0x7dc4('0x2f')][_0x7dc4('0x30')]};});_0x4766a3[_0x7dc4('0x31')]=_[_0x7dc4('0x2b')](_0x9b5061,_0x7dc4('0x28'));_0x4766a3[_0x7dc4('0x32')]=_['keys'](_0x46a683[_0x7dc4('0x32')]);_0x4766a3['filters']=_[_0x7dc4('0x33')](_0x4766a3[_0x7dc4('0x31')],_0x4766a3[_0x7dc4('0x32')]);_0x31efe0[_0x7dc4('0x34')]=_[_0x7dc4('0x33')](_0x4766a3[_0x7dc4('0x31')],qs[_0x7dc4('0x35')](_0x46a683[_0x7dc4('0x32')][_0x7dc4('0x35')]));_0x31efe0[_0x7dc4('0x34')]=_0x31efe0[_0x7dc4('0x34')][_0x7dc4('0x36')]?_0x31efe0[_0x7dc4('0x34')]:_0x4766a3[_0x7dc4('0x31')];if(!_0x46a683[_0x7dc4('0x32')][_0x7dc4('0x37')](_0x7dc4('0x38'))){_0x31efe0[_0x7dc4('0x39')]=qs[_0x7dc4('0x39')](_0x46a683[_0x7dc4('0x32')][_0x7dc4('0x39')]);_0x31efe0[_0x7dc4('0x1c')]=qs['offset'](_0x46a683['query']['offset']);}_0x31efe0[_0x7dc4('0x3a')]=qs['sort'](_0x46a683[_0x7dc4('0x32')][_0x7dc4('0x3b')]);_0x31efe0[_0x7dc4('0x3c')]=qs[_0x7dc4('0x3d')](_[_0x7dc4('0x3e')](_0x46a683['query'],_0x4766a3[_0x7dc4('0x3d')]),_0x9b5061);if(_0x46a683[_0x7dc4('0x32')][_0x7dc4('0x3f')]){_0x31efe0['where']=_[_0x7dc4('0x40')](_0x31efe0[_0x7dc4('0x3c')],{'$or':_[_0x7dc4('0x2b')](_0x9b5061,function(_0x1ef679){if(_0x1ef679[_0x7dc4('0x2f')]!==_0x7dc4('0x41')){var _0x5a2801={};_0x5a2801[_0x1ef679[_0x7dc4('0x28')]]={'$like':'%'+_0x46a683['query']['filter']+'%'};return _0x5a2801;}})});}_0x31efe0=_['merge']({},_0x31efe0,_0x46a683[_0x7dc4('0x42')]);var _0x2478fe={'where':_0x31efe0[_0x7dc4('0x3c')]};return db[_0x7dc4('0x2c')]['count'](_0x2478fe)['then'](function(_0xdb657e){_0x1ec8ab[_0x7dc4('0x1e')]=_0xdb657e;if(_0x46a683[_0x7dc4('0x32')][_0x7dc4('0x43')]){_0x31efe0[_0x7dc4('0x44')]=[{'all':!![]}];}return db[_0x7dc4('0x2c')]['findAll'](_0x31efe0);})[_0x7dc4('0x21')](function(_0x40e272){_0x1ec8ab[_0x7dc4('0x45')]=_0x40e272;return _0x1ec8ab;})['then'](respondWithFilteredResult(_0x3c3e22,_0x31efe0))[_0x7dc4('0x46')](handleError(_0x3c3e22,null));};exports[_0x7dc4('0x47')]=function(_0x5e47bf,_0x9415ca){var _0x5ed41e={'raw':!![],'where':{'id':_0x5e47bf[_0x7dc4('0x48')]['id']}},_0x289fcb={};_0x289fcb[_0x7dc4('0x31')]=_[_0x7dc4('0x49')](db[_0x7dc4('0x2c')][_0x7dc4('0x2d')]);_0x289fcb['query']=_[_0x7dc4('0x49')](_0x5e47bf[_0x7dc4('0x32')]);_0x289fcb['filters']=_[_0x7dc4('0x33')](_0x289fcb['model'],_0x289fcb[_0x7dc4('0x32')]);_0x5ed41e[_0x7dc4('0x34')]=_[_0x7dc4('0x33')](_0x289fcb[_0x7dc4('0x31')],qs[_0x7dc4('0x35')](_0x5e47bf['query'][_0x7dc4('0x35')]));_0x5ed41e[_0x7dc4('0x34')]=_0x5ed41e[_0x7dc4('0x34')][_0x7dc4('0x36')]?_0x5ed41e['attributes']:_0x289fcb[_0x7dc4('0x31')];if(_0x5e47bf[_0x7dc4('0x32')]['includeAll']){_0x5ed41e['include']=[{'all':!![]}];}_0x5ed41e=_[_0x7dc4('0x40')]({},_0x5ed41e,_0x5e47bf[_0x7dc4('0x42')]);return db['AnalyticExtractedReport'][_0x7dc4('0x4a')](_0x5ed41e)['then'](handleEntityNotFound(_0x9415ca,null))[_0x7dc4('0x21')](respondWithResult(_0x9415ca,null))['catch'](handleError(_0x9415ca,null));};exports['create']=function(_0x3dbd41,_0x2498a5){return db['AnalyticExtractedReport'][_0x7dc4('0x4b')](_0x3dbd41[_0x7dc4('0x4c')],{})[_0x7dc4('0x21')](function(_0x594a2f){var _0x193892=_0x3dbd41[_0x7dc4('0x4d')][_0x7dc4('0x23')]({'plain':!![]});if(!_0x193892)throw new Error(_0x7dc4('0x4e'));if(_0x193892[_0x7dc4('0x4f')]==='user'){var _0x280b98=_0x594a2f['get']({'plain':!![]});var _0x3fbd47=_0x7dc4('0x24');return db[_0x7dc4('0x50')][_0x7dc4('0x4a')]({'where':{'name':_0x3fbd47,'userProfileId':_0x193892[_0x7dc4('0x51')]},'raw':!![]})[_0x7dc4('0x21')](function(_0x4e5290){if(_0x4e5290&&_0x4e5290['autoAssociation']===0x0){return db[_0x7dc4('0x25')][_0x7dc4('0x4b')]({'name':_0x280b98[_0x7dc4('0x28')],'resourceId':_0x280b98['id'],'type':_0x4e5290[_0x7dc4('0x28')],'sectionId':_0x4e5290['id']},{})['then'](function(){return _0x594a2f;});}else{return _0x594a2f;}})[_0x7dc4('0x46')](function(_0x2055d6){logger[_0x7dc4('0x26')](_0x7dc4('0x52'),_0x2055d6);throw _0x2055d6;});}return _0x594a2f;})[_0x7dc4('0x21')](respondWithResult(_0x2498a5,0xc9))['catch'](handleError(_0x2498a5,null));};exports[_0x7dc4('0x53')]=function(_0xa847ed,_0x170990){if(_0xa847ed['body']['id']){delete _0xa847ed[_0x7dc4('0x4c')]['id'];}return db[_0x7dc4('0x2c')][_0x7dc4('0x4a')]({'where':{'id':_0xa847ed[_0x7dc4('0x48')]['id']}})['then'](handleEntityNotFound(_0x170990,null))[_0x7dc4('0x21')](saveUpdates(_0xa847ed[_0x7dc4('0x4c')],null))[_0x7dc4('0x21')](respondWithResult(_0x170990,null))[_0x7dc4('0x46')](handleError(_0x170990,null));};exports['destroy']=function(_0x1c533f,_0x59df16){return db[_0x7dc4('0x2c')][_0x7dc4('0x4a')]({'where':{'id':_0x1c533f[_0x7dc4('0x48')]['id']}})[_0x7dc4('0x21')](handleEntityNotFound(_0x59df16,null))['then'](removeEntity(_0x59df16,null))['catch'](handleError(_0x59df16,null));};exports[_0x7dc4('0x54')]=function(_0xb544c3,_0x9807e2,_0x4ba7c9){return db['AnalyticExtractedReport'][_0x7dc4('0x4a')]({'where':{'id':_0xb544c3[_0x7dc4('0x48')]['id']},'attributes':[_0x7dc4('0x28'),_0x7dc4('0x55'),_0x7dc4('0x56'),'output'],'raw':!![]})[_0x7dc4('0x21')](handleEntityNotFound(_0x9807e2,null))[_0x7dc4('0x21')](function(_0x26d76f){if(_0x26d76f){if(!fs[_0x7dc4('0x57')](path[_0x7dc4('0x58')](config[_0x7dc4('0x59')],_0x7dc4('0x5a'),_0x26d76f[_0x7dc4('0x56')]))){throw new db[(_0x7dc4('0x5b'))][(_0x7dc4('0x5c'))](_0x7dc4('0x5d'));}if(_0xb544c3[_0x7dc4('0x32')][_0x7dc4('0x5e')]){return _0x9807e2['sendStatus'](0xc8);}return _0x9807e2[_0x7dc4('0x54')](path['join'](config[_0x7dc4('0x59')],'server/files/reports',_0x26d76f[_0x7dc4('0x56')]),util[_0x7dc4('0x5f')](_0x7dc4('0x60'),_0x26d76f[_0x7dc4('0x55')]||_0x26d76f[_0x7dc4('0x28')],_0x26d76f[_0x7dc4('0x61')][_0x7dc4('0x62')]()));}})[_0x7dc4('0x46')](handleError(_0x9807e2,null));}; \ No newline at end of file +var _0xc66c=['count','offset','limit','set','apply','save','update','then','destroy','get','UserProfileResource','error','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','find','create','body','user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','params','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x5d95ba,_0x4392db){var _0x434d1e=function(_0x1d9554){while(--_0x1d9554){_0x5d95ba['push'](_0x5d95ba['shift']());}};_0x434d1e(++_0x4392db);}(_0xc66c,0x109));var _0xcc66=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xc66c[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xcc66('0x0'));var rimraf=require(_0xcc66('0x1'));var zipdir=require(_0xcc66('0x2'));var jsonpatch=require(_0xcc66('0x3'));var rp=require(_0xcc66('0x4'));var moment=require(_0xcc66('0x5'));var BPromise=require(_0xcc66('0x6'));var Mustache=require(_0xcc66('0x7'));var util=require(_0xcc66('0x8'));var path=require(_0xcc66('0x9'));var sox=require(_0xcc66('0xa'));var csv=require(_0xcc66('0xb'));var ejs=require(_0xcc66('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc66('0xd'));var squel=require(_0xcc66('0xe'));var crypto=require(_0xcc66('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xcc66('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcc66('0x11'));var Papa=require(_0xcc66('0x12'));var Redis=require(_0xcc66('0x13'));var authService=require(_0xcc66('0x14'));var qs=require(_0xcc66('0x15'));var as=require(_0xcc66('0x16'));var hardwareService=require(_0xcc66('0x17'));var logger=require(_0xcc66('0x18'))('api');var utils=require('../../config/utils');var config=require(_0xcc66('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc66('0x1a'))['db'];function respondWithStatusCode(_0x5fb432,_0x5a349f){_0x5a349f=_0x5a349f||0xcc;return function(_0x4447f0){if(_0x4447f0){return _0x5fb432[_0xcc66('0x1b')](_0x5a349f);}return _0x5fb432[_0xcc66('0x1c')](_0x5a349f)[_0xcc66('0x1d')]();};}function respondWithResult(_0x3565e0,_0x3d19ae){_0x3d19ae=_0x3d19ae||0xc8;return function(_0x1f037f){if(_0x1f037f){return _0x3565e0[_0xcc66('0x1c')](_0x3d19ae)[_0xcc66('0x1e')](_0x1f037f);}};}function respondWithFilteredResult(_0x30e562,_0x637641){return function(_0xdcf6ac){if(_0xdcf6ac){var _0x363f22=typeof _0x637641['offset']===_0xcc66('0x1f')&&typeof _0x637641['limit']===_0xcc66('0x1f');var _0x3b2579=_0xdcf6ac[_0xcc66('0x20')];var _0x5d6c50=_0x363f22?0x0:_0x637641[_0xcc66('0x21')];var _0x3cab54=_0x363f22?_0xdcf6ac[_0xcc66('0x20')]:_0x637641[_0xcc66('0x21')]+_0x637641[_0xcc66('0x22')];var _0x142326;if(_0x3cab54>=_0x3b2579){_0x3cab54=_0x3b2579;_0x142326=0xc8;}else{_0x142326=0xce;}_0x30e562[_0xcc66('0x1c')](_0x142326);return _0x30e562[_0xcc66('0x23')]('Content-Range',_0x5d6c50+'-'+_0x3cab54+'/'+_0x3b2579)[_0xcc66('0x1e')](_0xdcf6ac);}return null;};}function patchUpdates(_0x1cf2b0){return function(_0x3da892){try{jsonpatch[_0xcc66('0x24')](_0x3da892,_0x1cf2b0,!![]);}catch(_0x41d779){return BPromise['reject'](_0x41d779);}return _0x3da892[_0xcc66('0x25')]();};}function saveUpdates(_0x41d0c0,_0x15a96c){return function(_0x1dfb07){if(_0x1dfb07){return _0x1dfb07[_0xcc66('0x26')](_0x41d0c0)[_0xcc66('0x27')](function(_0x36c688){return _0x36c688;});}return null;};}function removeEntity(_0x57361a,_0x4f465b){return function(_0x2e1ebd){if(_0x2e1ebd){return _0x2e1ebd[_0xcc66('0x28')]()[_0xcc66('0x27')](function(){var _0x40c7ba=_0x2e1ebd[_0xcc66('0x29')]({'plain':!![]});var _0x1aac06='ExtractedReports';return db[_0xcc66('0x2a')][_0xcc66('0x28')]({'where':{'type':_0x1aac06,'resourceId':_0x40c7ba['id']}})['then'](function(){return _0x2e1ebd;});})[_0xcc66('0x27')](function(){_0x57361a[_0xcc66('0x1c')](0xcc)[_0xcc66('0x1d')]();});}};}function handleEntityNotFound(_0x5e879d,_0x5375dd){return function(_0x503c94){if(!_0x503c94){_0x5e879d[_0xcc66('0x1b')](0x194);}return _0x503c94;};}function handleError(_0xccf38b,_0xe293ba){_0xe293ba=_0xe293ba||0x1f4;return function(_0x403235){logger[_0xcc66('0x2b')](_0x403235['stack']);if(_0x403235[_0xcc66('0x2c')]){delete _0x403235[_0xcc66('0x2c')];}_0xccf38b[_0xcc66('0x1c')](_0xe293ba)[_0xcc66('0x2d')](_0x403235);};}exports[_0xcc66('0x2e')]=function(_0x46a18c,_0x2b2cb5){var _0xc503fe={},_0x3a32e2={},_0x45c6a4={'count':0x0,'rows':[]};var _0xe19e40=_['map'](db[_0xcc66('0x2f')][_0xcc66('0x30')],function(_0x3b6ba3){return{'name':_0x3b6ba3[_0xcc66('0x31')],'type':_0x3b6ba3[_0xcc66('0x32')]['key']};});_0x3a32e2[_0xcc66('0x33')]=_['map'](_0xe19e40,'name');_0x3a32e2[_0xcc66('0x34')]=_[_0xcc66('0x35')](_0x46a18c[_0xcc66('0x34')]);_0x3a32e2[_0xcc66('0x36')]=_[_0xcc66('0x37')](_0x3a32e2[_0xcc66('0x33')],_0x3a32e2[_0xcc66('0x34')]);_0xc503fe[_0xcc66('0x38')]=_[_0xcc66('0x37')](_0x3a32e2[_0xcc66('0x33')],qs[_0xcc66('0x39')](_0x46a18c['query']['fields']));_0xc503fe[_0xcc66('0x38')]=_0xc503fe[_0xcc66('0x38')][_0xcc66('0x3a')]?_0xc503fe[_0xcc66('0x38')]:_0x3a32e2[_0xcc66('0x33')];if(!_0x46a18c['query'][_0xcc66('0x3b')](_0xcc66('0x3c'))){_0xc503fe[_0xcc66('0x22')]=qs['limit'](_0x46a18c[_0xcc66('0x34')][_0xcc66('0x22')]);_0xc503fe[_0xcc66('0x21')]=qs[_0xcc66('0x21')](_0x46a18c[_0xcc66('0x34')][_0xcc66('0x21')]);}_0xc503fe[_0xcc66('0x3d')]=qs[_0xcc66('0x3e')](_0x46a18c[_0xcc66('0x34')][_0xcc66('0x3e')]);_0xc503fe[_0xcc66('0x3f')]=qs[_0xcc66('0x36')](_[_0xcc66('0x40')](_0x46a18c[_0xcc66('0x34')],_0x3a32e2[_0xcc66('0x36')]),_0xe19e40);if(_0x46a18c[_0xcc66('0x34')]['filter']){_0xc503fe[_0xcc66('0x3f')]=_['merge'](_0xc503fe[_0xcc66('0x3f')],{'$or':_['map'](_0xe19e40,function(_0x3bf9fe){if(_0x3bf9fe[_0xcc66('0x32')]!==_0xcc66('0x41')){var _0x407146={};_0x407146[_0x3bf9fe[_0xcc66('0x2c')]]={'$like':'%'+_0x46a18c[_0xcc66('0x34')][_0xcc66('0x42')]+'%'};return _0x407146;}})});}_0xc503fe=_[_0xcc66('0x43')]({},_0xc503fe,_0x46a18c[_0xcc66('0x44')]);var _0x54329f={'where':_0xc503fe['where']};return db['AnalyticExtractedReport'][_0xcc66('0x20')](_0x54329f)[_0xcc66('0x27')](function(_0x3bf84a){_0x45c6a4[_0xcc66('0x20')]=_0x3bf84a;if(_0x46a18c[_0xcc66('0x34')][_0xcc66('0x45')]){_0xc503fe['include']=[{'all':!![]}];}return db[_0xcc66('0x2f')][_0xcc66('0x46')](_0xc503fe);})['then'](function(_0x54ac15){_0x45c6a4[_0xcc66('0x47')]=_0x54ac15;return _0x45c6a4;})['then'](respondWithFilteredResult(_0x2b2cb5,_0xc503fe))[_0xcc66('0x48')](handleError(_0x2b2cb5,null));};exports[_0xcc66('0x49')]=function(_0x54b4ac,_0xd0fd8f){var _0x477429={'raw':!![],'where':{'id':_0x54b4ac['params']['id']}},_0x28a2a2={};_0x28a2a2[_0xcc66('0x33')]=_[_0xcc66('0x35')](db['AnalyticExtractedReport'][_0xcc66('0x30')]);_0x28a2a2[_0xcc66('0x34')]=_['keys'](_0x54b4ac[_0xcc66('0x34')]);_0x28a2a2[_0xcc66('0x36')]=_[_0xcc66('0x37')](_0x28a2a2['model'],_0x28a2a2[_0xcc66('0x34')]);_0x477429[_0xcc66('0x38')]=_[_0xcc66('0x37')](_0x28a2a2['model'],qs[_0xcc66('0x39')](_0x54b4ac['query'][_0xcc66('0x39')]));_0x477429[_0xcc66('0x38')]=_0x477429[_0xcc66('0x38')][_0xcc66('0x3a')]?_0x477429[_0xcc66('0x38')]:_0x28a2a2[_0xcc66('0x33')];if(_0x54b4ac[_0xcc66('0x34')]['includeAll']){_0x477429['include']=[{'all':!![]}];}_0x477429=_[_0xcc66('0x43')]({},_0x477429,_0x54b4ac[_0xcc66('0x44')]);return db[_0xcc66('0x2f')][_0xcc66('0x4a')](_0x477429)[_0xcc66('0x27')](handleEntityNotFound(_0xd0fd8f,null))[_0xcc66('0x27')](respondWithResult(_0xd0fd8f,null))[_0xcc66('0x48')](handleError(_0xd0fd8f,null));};exports['create']=function(_0x3da368,_0x386f5f){return db[_0xcc66('0x2f')][_0xcc66('0x4b')](_0x3da368[_0xcc66('0x4c')],{})[_0xcc66('0x27')](function(_0x302db0){var _0x397527=_0x3da368[_0xcc66('0x4d')][_0xcc66('0x29')]({'plain':!![]});if(!_0x397527)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x397527[_0xcc66('0x4e')]===_0xcc66('0x4d')){var _0x213ff4=_0x302db0[_0xcc66('0x29')]({'plain':!![]});var _0x5e0273=_0xcc66('0x4f');return db[_0xcc66('0x50')][_0xcc66('0x4a')]({'where':{'name':_0x5e0273,'userProfileId':_0x397527[_0xcc66('0x51')]},'raw':!![]})['then'](function(_0x49dea3){if(_0x49dea3&&_0x49dea3[_0xcc66('0x52')]===0x0){return db[_0xcc66('0x2a')][_0xcc66('0x4b')]({'name':_0x213ff4['name'],'resourceId':_0x213ff4['id'],'type':_0x49dea3[_0xcc66('0x2c')],'sectionId':_0x49dea3['id']},{})[_0xcc66('0x27')](function(){return _0x302db0;});}else{return _0x302db0;}})['catch'](function(_0x503de7){logger[_0xcc66('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x503de7);throw _0x503de7;});}return _0x302db0;})[_0xcc66('0x27')](respondWithResult(_0x386f5f,0xc9))[_0xcc66('0x48')](handleError(_0x386f5f,null));};exports[_0xcc66('0x26')]=function(_0x31f749,_0x3cb85c){if(_0x31f749['body']['id']){delete _0x31f749['body']['id'];}return db[_0xcc66('0x2f')][_0xcc66('0x4a')]({'where':{'id':_0x31f749['params']['id']}})[_0xcc66('0x27')](handleEntityNotFound(_0x3cb85c,null))[_0xcc66('0x27')](saveUpdates(_0x31f749['body'],null))['then'](respondWithResult(_0x3cb85c,null))[_0xcc66('0x48')](handleError(_0x3cb85c,null));};exports[_0xcc66('0x28')]=function(_0x2b4810,_0x42856b){return db[_0xcc66('0x2f')][_0xcc66('0x4a')]({'where':{'id':_0x2b4810[_0xcc66('0x53')]['id']}})[_0xcc66('0x27')](handleEntityNotFound(_0x42856b,null))[_0xcc66('0x27')](removeEntity(_0x42856b,null))[_0xcc66('0x48')](handleError(_0x42856b,null));};exports[_0xcc66('0x54')]=function(_0x4682c8,_0x2a52d1,_0x28e9a7){return db['AnalyticExtractedReport'][_0xcc66('0x4a')]({'where':{'id':_0x4682c8[_0xcc66('0x53')]['id']},'attributes':['name',_0xcc66('0x55'),_0xcc66('0x56'),_0xcc66('0x57')],'raw':!![]})[_0xcc66('0x27')](handleEntityNotFound(_0x2a52d1,null))['then'](function(_0x411a1d){if(_0x411a1d){if(!fs[_0xcc66('0x58')](path[_0xcc66('0x59')](config[_0xcc66('0x5a')],_0xcc66('0x5b'),_0x411a1d[_0xcc66('0x56')]))){throw new db[(_0xcc66('0x5c'))][(_0xcc66('0x5d'))](_0xcc66('0x5e'));}if(_0x4682c8[_0xcc66('0x34')][_0xcc66('0x5f')]){return _0x2a52d1['sendStatus'](0xc8);}return _0x2a52d1[_0xcc66('0x54')](path[_0xcc66('0x59')](config[_0xcc66('0x5a')],_0xcc66('0x5b'),_0x411a1d[_0xcc66('0x56')]),util[_0xcc66('0x60')](_0xcc66('0x61'),_0x411a1d[_0xcc66('0x55')]||_0x411a1d[_0xcc66('0x2c')],_0x411a1d[_0xcc66('0x57')][_0xcc66('0x62')]()));}})['catch'](handleError(_0x2a52d1,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 7c90211..917b631 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 _0xe63a=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x1225f7,_0x54c678){var _0x1c1632=function(_0x5d382c){while(--_0x5d382c){_0x1225f7['push'](_0x1225f7['shift']());}};_0x1c1632(++_0x54c678);}(_0xe63a,0x186));var _0xae63=function(_0x35ce68,_0x33d898){_0x35ce68=_0x35ce68-0x0;var _0x1893c4=_0xe63a[_0x35ce68];return _0x1893c4;};'use strict';var _=require('lodash');var util=require(_0xae63('0x0'));var logger=require(_0xae63('0x1'))('api');var moment=require(_0xae63('0x2'));var BPromise=require(_0xae63('0x3'));var rp=require(_0xae63('0x4'));var fs=require('fs');var path=require(_0xae63('0x5'));var rimraf=require('rimraf');var config=require(_0xae63('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0xae63('0x7')]=function(_0x44961a,_0x230b5a){return _0x44961a['define'](_0xae63('0x8'),attributes,{'tableName':_0xae63('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03a4=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger'];(function(_0x292b13,_0xeb7b87){var _0x21ab12=function(_0x7887ac){while(--_0x7887ac){_0x292b13['push'](_0x292b13['shift']());}};_0x21ab12(++_0xeb7b87);}(_0x03a4,0x135));var _0x403a=function(_0x25242b,_0xe3f463){_0x25242b=_0x25242b-0x0;var _0xdd6876=_0x03a4[_0x25242b];return _0xdd6876;};'use strict';var _=require(_0x403a('0x0'));var util=require(_0x403a('0x1'));var logger=require(_0x403a('0x2'))(_0x403a('0x3'));var moment=require(_0x403a('0x4'));var BPromise=require('bluebird');var rp=require(_0x403a('0x5'));var fs=require('fs');var path=require(_0x403a('0x6'));var rimraf=require(_0x403a('0x7'));var config=require(_0x403a('0x8'));var attributes=require('./analyticExtractedReport.attributes');module[_0x403a('0x9')]=function(_0x3229e9,_0x41e521){return _0x3229e9[_0x403a('0xa')](_0x403a('0xb'),attributes,{'tableName':_0x403a('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 b56c5fb..5b5ef98 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 _0xd01d=['error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1f14ec,_0x5f5e08){var _0x42eab3=function(_0x3df32d){while(--_0x3df32d){_0x1f14ec['push'](_0x1f14ec['shift']());}};_0x42eab3(++_0x5f5e08);}(_0xd01d,0xbe));var _0xdd01=function(_0x62d2d2,_0x30a6fc){_0x62d2d2=_0x62d2d2-0x0;var _0x43d52b=_0xd01d[_0x62d2d2];return _0x43d52b;};'use strict';var _=require('lodash');var util=require(_0xdd01('0x0'));var moment=require('moment');var BPromise=require(_0xdd01('0x1'));var rs=require(_0xdd01('0x2'));var fs=require('fs');var Redis=require(_0xdd01('0x3'));var db=require(_0xdd01('0x4'))['db'];var utils=require(_0xdd01('0x5'));var logger=require(_0xdd01('0x6'))(_0xdd01('0x7'));var config=require(_0xdd01('0x8'));var jayson=require(_0xdd01('0x9'));var client=jayson[_0xdd01('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ce4b4,_0x44599f,_0xb1caa3){return new BPromise(function(_0x400f5a,_0x15afb1){return client[_0xdd01('0xb')](_0x5ce4b4,_0xb1caa3)['then'](function(_0x2c9fd4){logger[_0xdd01('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x44599f,'request\x20sent');logger[_0xdd01('0xd')](_0xdd01('0xe'),_0x44599f,_0xdd01('0xf'),JSON[_0xdd01('0x10')](_0x2c9fd4));if(_0x2c9fd4[_0xdd01('0x11')]){if(_0x2c9fd4['error'][_0xdd01('0x12')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x44599f,_0x2c9fd4[_0xdd01('0x11')][_0xdd01('0x13')]);return _0x15afb1(_0x2c9fd4[_0xdd01('0x11')][_0xdd01('0x13')]);}logger[_0xdd01('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x44599f,_0x2c9fd4[_0xdd01('0x11')]['message']);return _0x400f5a(_0x2c9fd4[_0xdd01('0x11')][_0xdd01('0x13')]);}else{logger['info'](_0xdd01('0x14'),_0x44599f,'request\x20sent');_0x400f5a(_0x2c9fd4[_0xdd01('0x15')][_0xdd01('0x13')]);}})[_0xdd01('0x16')](function(_0x4ce145){logger[_0xdd01('0x11')](_0xdd01('0x14'),_0x44599f,_0x4ce145);_0x15afb1(_0x4ce145);});});} \ No newline at end of file +var _0x7f8e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment'];(function(_0x4709c8,_0x3384ca){var _0x478cdd=function(_0x5193ce){while(--_0x5193ce){_0x4709c8['push'](_0x4709c8['shift']());}};_0x478cdd(++_0x3384ca);}(_0x7f8e,0x141));var _0xe7f8=function(_0x433592,_0x58a48e){_0x433592=_0x433592-0x0;var _0x58c07c=_0x7f8e[_0x433592];return _0x58c07c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7f8('0x0'));var BPromise=require(_0xe7f8('0x1'));var rs=require(_0xe7f8('0x2'));var fs=require('fs');var Redis=require(_0xe7f8('0x3'));var db=require(_0xe7f8('0x4'))['db'];var utils=require(_0xe7f8('0x5'));var logger=require(_0xe7f8('0x6'))(_0xe7f8('0x7'));var config=require(_0xe7f8('0x8'));var jayson=require(_0xe7f8('0x9'));var client=jayson['client'][_0xe7f8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48591e,_0x18bc40,_0x2ee24b){return new BPromise(function(_0x46b853,_0x4c4623){return client[_0xe7f8('0xb')](_0x48591e,_0x2ee24b)[_0xe7f8('0xc')](function(_0xfc275f){logger[_0xe7f8('0xd')](_0xe7f8('0xe'),_0x18bc40,_0xe7f8('0xf'));logger[_0xe7f8('0x10')](_0xe7f8('0x11'),_0x18bc40,'request\x20sent',JSON[_0xe7f8('0x12')](_0xfc275f));if(_0xfc275f['error']){if(_0xfc275f[_0xe7f8('0x13')][_0xe7f8('0x14')]===0x1f4){logger[_0xe7f8('0x13')](_0xe7f8('0xe'),_0x18bc40,_0xfc275f[_0xe7f8('0x13')]['message']);return _0x4c4623(_0xfc275f[_0xe7f8('0x13')]['message']);}logger[_0xe7f8('0x13')](_0xe7f8('0xe'),_0x18bc40,_0xfc275f['error'][_0xe7f8('0x15')]);return _0x46b853(_0xfc275f[_0xe7f8('0x13')][_0xe7f8('0x15')]);}else{logger['info'](_0xe7f8('0xe'),_0x18bc40,_0xe7f8('0xf'));_0x46b853(_0xfc275f['result'][_0xe7f8('0x15')]);}})[_0xe7f8('0x16')](function(_0x52a58c){logger[_0xe7f8('0x13')](_0xe7f8('0xe'),_0x18bc40,_0x52a58c);_0x4c4623(_0x52a58c);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index aef87f0..dd77fd5 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 _0xa4c2=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','delete','destroy','exports','multer'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xa4c2,0x71));var _0x2a4c=function(_0x5d1fac,_0x5169f0){_0x5d1fac=_0x5d1fac-0x0;var _0x4c0a7a=_0xa4c2[_0x5d1fac];return _0x4c0a7a;};'use strict';var multer=require(_0x2a4c('0x0'));var util=require(_0x2a4c('0x1'));var path=require(_0x2a4c('0x2'));var timeout=require(_0x2a4c('0x3'));var express=require(_0x2a4c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2a4c('0x5'));var config=require(_0x2a4c('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0x2a4c('0x7')]('/',auth[_0x2a4c('0x8')](),controller[_0x2a4c('0x9')]);router[_0x2a4c('0x7')](_0x2a4c('0xa'),auth[_0x2a4c('0x8')](),controller[_0x2a4c('0xb')]);router[_0x2a4c('0x7')](_0x2a4c('0xc'),auth[_0x2a4c('0x8')](),controller[_0x2a4c('0xd')]);router[_0x2a4c('0xe')]('/',auth['isAuthenticated'](),controller[_0x2a4c('0xf')]);router['put'](_0x2a4c('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x2a4c('0x10')](_0x2a4c('0xa'),auth[_0x2a4c('0x8')](),controller[_0x2a4c('0x11')]);module[_0x2a4c('0x12')]=router; \ No newline at end of file +var _0x6493=['update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put'];(function(_0x18d710,_0x153c7c){var _0x54f4eb=function(_0x170c6b){while(--_0x170c6b){_0x18d710['push'](_0x18d710['shift']());}};_0x54f4eb(++_0x153c7c);}(_0x6493,0x17d));var _0x3649=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x6493[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x3649('0x0'));var util=require(_0x3649('0x1'));var path=require('path');var timeout=require(_0x3649('0x2'));var express=require(_0x3649('0x3'));var router=express[_0x3649('0x4')]();var fs_extra=require(_0x3649('0x5'));var auth=require(_0x3649('0x6'));var interaction=require(_0x3649('0x7'));var config=require(_0x3649('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0x3649('0x9')]('/',auth[_0x3649('0xa')](),controller['index']);router['get'](_0x3649('0xb'),auth[_0x3649('0xa')](),controller[_0x3649('0xc')]);router[_0x3649('0x9')](_0x3649('0xd'),auth[_0x3649('0xa')](),controller[_0x3649('0xe')]);router[_0x3649('0xf')]('/',auth['isAuthenticated'](),controller[_0x3649('0x10')]);router[_0x3649('0x11')](_0x3649('0xb'),auth[_0x3649('0xa')](),controller[_0x3649('0x12')]);router[_0x3649('0x13')]('/:id',auth[_0x3649('0xa')](),controller[_0x3649('0x14')]);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 12c7f69..f887908 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 _0x058c=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x3b1c97,_0x251df8){var _0x704b56=function(_0x392e84){while(--_0x392e84){_0x3b1c97['push'](_0x3b1c97['shift']());}};_0x704b56(++_0x251df8);}(_0x058c,0x69));var _0xc058=function(_0x12a32a,_0x200871){_0x12a32a=_0x12a32a-0x0;var _0x45c462=_0x058c[_0x12a32a];return _0x45c462;};'use strict';var Sequelize=require(_0xc058('0x0'));module[_0xc058('0x1')]={'field':{'type':Sequelize[_0xc058('0x2')]},'alias':{'type':Sequelize[_0xc058('0x3')]},'function':{'type':Sequelize[_0xc058('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc058('0x3')]},'custom':{'type':Sequelize[_0xc058('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xc002=['STRING','BOOLEAN','sequelize','exports'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xc002,0x1c6));var _0x2c00=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xc002[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require(_0x2c00('0x0'));module[_0x2c00('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x2c00('0x2')]},'function':{'type':Sequelize[_0x2c00('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x2c00('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2c00('0x2')]},'custom':{'type':Sequelize[_0x2c00('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 a58df08..d3bfa7d 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 _0x9c86=['undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','AnalyticFieldReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','length','find','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','rimraf','zip-dir','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset'];(function(_0x23867c,_0x3fb176){var _0x649736=function(_0x35645e){while(--_0x35645e){_0x23867c['push'](_0x23867c['shift']());}};_0x649736(++_0x3fb176);}(_0x9c86,0x133));var _0x69c8=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9c86[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x69c8('0x0'));var zipdir=require(_0x69c8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x69c8('0x2'));var BPromise=require(_0x69c8('0x3'));var Mustache=require(_0x69c8('0x4'));var util=require('util');var path=require(_0x69c8('0x5'));var sox=require(_0x69c8('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x69c8('0x7'));var _=require(_0x69c8('0x8'));var squel=require(_0x69c8('0x9'));var crypto=require(_0x69c8('0xa'));var jsforce=require(_0x69c8('0xb'));var deskjs=require(_0x69c8('0xc'));var toCsv=require(_0x69c8('0xd'));var querystring=require('querystring');var Papa=require(_0x69c8('0xe'));var Redis=require(_0x69c8('0xf'));var authService=require(_0x69c8('0x10'));var qs=require(_0x69c8('0x11'));var as=require(_0x69c8('0x12'));var hardwareService=require(_0x69c8('0x13'));var logger=require(_0x69c8('0x14'))(_0x69c8('0x15'));var utils=require(_0x69c8('0x16'));var config=require(_0x69c8('0x17'));var licenseUtil=require(_0x69c8('0x18'));var db=require(_0x69c8('0x19'))['db'];function respondWithStatusCode(_0x1b59d7,_0x32fc88){_0x32fc88=_0x32fc88||0xcc;return function(_0x4af15e){if(_0x4af15e){return _0x1b59d7['sendStatus'](_0x32fc88);}return _0x1b59d7[_0x69c8('0x1a')](_0x32fc88)[_0x69c8('0x1b')]();};}function respondWithResult(_0x16c827,_0x4ee703){_0x4ee703=_0x4ee703||0xc8;return function(_0x55d5cd){if(_0x55d5cd){return _0x16c827['status'](_0x4ee703)['json'](_0x55d5cd);}};}function respondWithFilteredResult(_0x3c4764,_0x1ff214){return function(_0x302cc8){if(_0x302cc8){var _0x735b63=typeof _0x1ff214[_0x69c8('0x1c')]===_0x69c8('0x1d')&&typeof _0x1ff214[_0x69c8('0x1e')]===_0x69c8('0x1d');var _0x9461f4=_0x302cc8[_0x69c8('0x1f')];var _0x744014=_0x735b63?0x0:_0x1ff214[_0x69c8('0x1c')];var _0x116c60=_0x735b63?_0x302cc8[_0x69c8('0x1f')]:_0x1ff214[_0x69c8('0x1c')]+_0x1ff214[_0x69c8('0x1e')];var _0x4ff218;if(_0x116c60>=_0x9461f4){_0x116c60=_0x9461f4;_0x4ff218=0xc8;}else{_0x4ff218=0xce;}_0x3c4764[_0x69c8('0x1a')](_0x4ff218);return _0x3c4764[_0x69c8('0x20')](_0x69c8('0x21'),_0x744014+'-'+_0x116c60+'/'+_0x9461f4)[_0x69c8('0x22')](_0x302cc8);}return null;};}function patchUpdates(_0x2a268d){return function(_0x569e88){try{jsonpatch[_0x69c8('0x23')](_0x569e88,_0x2a268d,!![]);}catch(_0x14e73c){return BPromise[_0x69c8('0x24')](_0x14e73c);}return _0x569e88[_0x69c8('0x25')]();};}function saveUpdates(_0x5d7354,_0x16d69e){return function(_0x5284e8){if(_0x5284e8){return _0x5284e8[_0x69c8('0x26')](_0x5d7354)[_0x69c8('0x27')](function(_0x3592e0){return _0x3592e0;});}return null;};}function removeEntity(_0x2a3895,_0x7e6643){return function(_0x499378){if(_0x499378){return _0x499378[_0x69c8('0x28')]()['then'](function(){_0x2a3895['status'](0xcc)[_0x69c8('0x1b')]();});}};}function handleEntityNotFound(_0x28b90b,_0x5c7b8d){return function(_0x4216af){if(!_0x4216af){_0x28b90b[_0x69c8('0x29')](0x194);}return _0x4216af;};}function handleError(_0x2ae3d6,_0x1e1a84){_0x1e1a84=_0x1e1a84||0x1f4;return function(_0x5d0f15){logger['error'](_0x5d0f15[_0x69c8('0x2a')]);if(_0x5d0f15['name']){delete _0x5d0f15[_0x69c8('0x2b')];}_0x2ae3d6[_0x69c8('0x1a')](_0x1e1a84)[_0x69c8('0x2c')](_0x5d0f15);};}exports[_0x69c8('0x2d')]=function(_0x53c37a,_0x4e5e8b){var _0x593a5e={},_0x3f1698={},_0x3efb75={'count':0x0,'rows':[]};var _0x2d6b01=_[_0x69c8('0x2e')](db[_0x69c8('0x2f')]['rawAttributes'],function(_0x2eba8e){return{'name':_0x2eba8e[_0x69c8('0x30')],'type':_0x2eba8e[_0x69c8('0x31')][_0x69c8('0x32')]};});_0x3f1698[_0x69c8('0x33')]=_['map'](_0x2d6b01,_0x69c8('0x2b'));_0x3f1698['query']=_[_0x69c8('0x34')](_0x53c37a[_0x69c8('0x35')]);_0x3f1698[_0x69c8('0x36')]=_[_0x69c8('0x37')](_0x3f1698['model'],_0x3f1698[_0x69c8('0x35')]);_0x593a5e[_0x69c8('0x38')]=_[_0x69c8('0x37')](_0x3f1698['model'],qs[_0x69c8('0x39')](_0x53c37a['query']['fields']));_0x593a5e[_0x69c8('0x38')]=_0x593a5e['attributes']['length']?_0x593a5e[_0x69c8('0x38')]:_0x3f1698['model'];if(!_0x53c37a['query']['hasOwnProperty'](_0x69c8('0x3a'))){_0x593a5e['limit']=qs['limit'](_0x53c37a[_0x69c8('0x35')][_0x69c8('0x1e')]);_0x593a5e[_0x69c8('0x1c')]=qs[_0x69c8('0x1c')](_0x53c37a['query'][_0x69c8('0x1c')]);}_0x593a5e['order']=qs[_0x69c8('0x3b')](_0x53c37a[_0x69c8('0x35')][_0x69c8('0x3b')]);_0x593a5e[_0x69c8('0x3c')]=qs[_0x69c8('0x36')](_['pick'](_0x53c37a[_0x69c8('0x35')],_0x3f1698[_0x69c8('0x36')]),_0x2d6b01);if(_0x53c37a[_0x69c8('0x35')][_0x69c8('0x3d')]){_0x593a5e[_0x69c8('0x3c')]=_[_0x69c8('0x3e')](_0x593a5e['where'],{'$or':_[_0x69c8('0x2e')](_0x2d6b01,function(_0x22ac19){if(_0x22ac19['type']!==_0x69c8('0x3f')){var _0x13ca73={};_0x13ca73[_0x22ac19[_0x69c8('0x2b')]]={'$like':'%'+_0x53c37a[_0x69c8('0x35')][_0x69c8('0x3d')]+'%'};return _0x13ca73;}})});}_0x593a5e=_[_0x69c8('0x3e')]({},_0x593a5e,_0x53c37a[_0x69c8('0x40')]);var _0x11261d={'where':_0x593a5e['where']};return db[_0x69c8('0x2f')][_0x69c8('0x1f')](_0x11261d)[_0x69c8('0x27')](function(_0x8d167){_0x3efb75['count']=_0x8d167;if(_0x53c37a[_0x69c8('0x35')][_0x69c8('0x41')]){_0x593a5e[_0x69c8('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x593a5e);})['then'](function(_0xf3908e){_0x3efb75[_0x69c8('0x43')]=_0xf3908e;return _0x3efb75;})['then'](respondWithFilteredResult(_0x4e5e8b,_0x593a5e))[_0x69c8('0x44')](handleError(_0x4e5e8b,null));};exports['show']=function(_0x479222,_0x19aa5b){var _0x4a620e={'raw':![],'where':{'id':_0x479222[_0x69c8('0x45')]['id']}},_0x1611b3={};_0x1611b3[_0x69c8('0x33')]=_[_0x69c8('0x34')](db[_0x69c8('0x2f')][_0x69c8('0x46')]);_0x1611b3[_0x69c8('0x35')]=_[_0x69c8('0x34')](_0x479222[_0x69c8('0x35')]);_0x1611b3[_0x69c8('0x36')]=_[_0x69c8('0x37')](_0x1611b3[_0x69c8('0x33')],_0x1611b3[_0x69c8('0x35')]);_0x4a620e[_0x69c8('0x38')]=_[_0x69c8('0x37')](_0x1611b3['model'],qs['fields'](_0x479222[_0x69c8('0x35')][_0x69c8('0x39')]));_0x4a620e[_0x69c8('0x38')]=_0x4a620e['attributes'][_0x69c8('0x47')]?_0x4a620e[_0x69c8('0x38')]:_0x1611b3['model'];if(_0x479222[_0x69c8('0x35')][_0x69c8('0x41')]){_0x4a620e[_0x69c8('0x42')]=[{'all':!![]}];}_0x4a620e=_['merge']({},_0x4a620e,_0x479222[_0x69c8('0x40')]);return db[_0x69c8('0x2f')][_0x69c8('0x48')](_0x4a620e)['then'](handleEntityNotFound(_0x19aa5b,null))[_0x69c8('0x27')](respondWithResult(_0x19aa5b,null))[_0x69c8('0x44')](handleError(_0x19aa5b,null));};exports[_0x69c8('0x49')]=function(_0x28aba4,_0x19fe81){return db[_0x69c8('0x2f')][_0x69c8('0x49')](_0x28aba4[_0x69c8('0x4a')],{})[_0x69c8('0x27')](respondWithResult(_0x19fe81,0xc9))[_0x69c8('0x44')](handleError(_0x19fe81,null));};exports[_0x69c8('0x4b')]=function(_0x1734cb,_0x1619c5){return db[_0x69c8('0x2f')][_0x69c8('0x4b')](_0x1734cb[_0x69c8('0x4a')],{'raw':![],'individualHooks':!![]})[_0x69c8('0x27')](respondWithResult(_0x1619c5,0xc9))[_0x69c8('0x44')](handleError(_0x1619c5,null));};exports[_0x69c8('0x26')]=function(_0x5835e7,_0x26df8f){if(_0x5835e7[_0x69c8('0x4a')]['id']){delete _0x5835e7[_0x69c8('0x4a')]['id'];}return db[_0x69c8('0x2f')][_0x69c8('0x48')]({'where':{'id':_0x5835e7[_0x69c8('0x45')]['id']}})['then'](handleEntityNotFound(_0x26df8f,null))['then'](saveUpdates(_0x5835e7[_0x69c8('0x4a')],null))['then'](respondWithResult(_0x26df8f,null))[_0x69c8('0x44')](handleError(_0x26df8f,null));};exports[_0x69c8('0x28')]=function(_0x28fe5a,_0x349f52){return db[_0x69c8('0x2f')][_0x69c8('0x48')]({'where':{'id':_0x28fe5a[_0x69c8('0x45')]['id']}})[_0x69c8('0x27')](handleEntityNotFound(_0x349f52,null))['then'](removeEntity(_0x349f52,null))[_0x69c8('0x44')](handleError(_0x349f52,null));};exports['bulkDestroy']=function(_0x4bf0c7,_0xf69ceb){return db['AnalyticFieldReport'][_0x69c8('0x28')]({'where':{'id':_0x4bf0c7[_0x69c8('0x35')][_0x69c8('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x69c8('0x27')](respondWithResult(_0xf69ceb,0xcc))[_0x69c8('0x44')](handleError(_0xf69ceb,null));};exports[_0x69c8('0x4d')]=function(_0x5e6251,_0x49183a,_0x55f11f){return db[_0x69c8('0x4e')][_0x69c8('0x4f')]({'where':{'id':_0x5e6251[_0x69c8('0x45')]['id']}})[_0x69c8('0x27')](handleEntityNotFound(_0x49183a,null))[_0x69c8('0x27')](function(_0x436252){if(_0x436252){return db[_0x69c8('0x50')][_0x69c8('0x51')](function(_0x1e0f9b){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x5e6251[_0x69c8('0x45')]['id']},'transaction':_0x1e0f9b})[_0x69c8('0x27')](function(_0x2af11d){var _0x5ed540=_['map'](_0x5e6251['body'],function(_0xedf871){delete _0xedf871['id'];_0xedf871[_0x69c8('0x52')]=_0x5e6251[_0x69c8('0x45')]['id'];return _0xedf871;});return db[_0x69c8('0x2f')][_0x69c8('0x4b')](_0x5ed540,{'transaction':_0x1e0f9b});});})[_0x69c8('0x27')](function(){return db[_0x69c8('0x2f')][_0x69c8('0x53')]({'where':{'CustomReportId':_0x5e6251[_0x69c8('0x45')]['id']}});});}})[_0x69c8('0x27')](respondWithResult(_0x49183a,null))[_0x69c8('0x44')](handleError(_0x49183a,null));}; \ No newline at end of file +var _0x3691=['squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','find','create','bulkCreate','body','params','AnalyticCustomReport','findOne','sequelize','transaction','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x588ff9,_0x56dd34){var _0x496347=function(_0x51fbb7){while(--_0x51fbb7){_0x588ff9['push'](_0x588ff9['shift']());}};_0x496347(++_0x56dd34);}(_0x3691,0x98));var _0x1369=function(_0x224016,_0x587d40){_0x224016=_0x224016-0x0;var _0x172839=_0x3691[_0x224016];return _0x172839;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1369('0x0'));var zipdir=require(_0x1369('0x1'));var jsonpatch=require(_0x1369('0x2'));var rp=require(_0x1369('0x3'));var moment=require(_0x1369('0x4'));var BPromise=require(_0x1369('0x5'));var Mustache=require('mustache');var util=require(_0x1369('0x6'));var path=require(_0x1369('0x7'));var sox=require(_0x1369('0x8'));var csv=require(_0x1369('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1369('0xa'));var _=require(_0x1369('0xb'));var squel=require(_0x1369('0xc'));var crypto=require(_0x1369('0xd'));var jsforce=require(_0x1369('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1369('0x9'));var querystring=require(_0x1369('0xf'));var Papa=require(_0x1369('0x10'));var Redis=require('ioredis');var authService=require(_0x1369('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1369('0x12'));var hardwareService=require(_0x1369('0x13'));var logger=require(_0x1369('0x14'))(_0x1369('0x15'));var utils=require(_0x1369('0x16'));var config=require(_0x1369('0x17'));var licenseUtil=require(_0x1369('0x18'));var db=require(_0x1369('0x19'))['db'];function respondWithStatusCode(_0x57f01b,_0x365837){_0x365837=_0x365837||0xcc;return function(_0x935722){if(_0x935722){return _0x57f01b[_0x1369('0x1a')](_0x365837);}return _0x57f01b[_0x1369('0x1b')](_0x365837)[_0x1369('0x1c')]();};}function respondWithResult(_0x524c2f,_0x31c6f9){_0x31c6f9=_0x31c6f9||0xc8;return function(_0x379d4f){if(_0x379d4f){return _0x524c2f[_0x1369('0x1b')](_0x31c6f9)[_0x1369('0x1d')](_0x379d4f);}};}function respondWithFilteredResult(_0x1274c8,_0x257d36){return function(_0x180041){if(_0x180041){var _0x391e19=typeof _0x257d36[_0x1369('0x1e')]===_0x1369('0x1f')&&typeof _0x257d36[_0x1369('0x20')]===_0x1369('0x1f');var _0x5e4dcd=_0x180041[_0x1369('0x21')];var _0x876a03=_0x391e19?0x0:_0x257d36[_0x1369('0x1e')];var _0x385d8d=_0x391e19?_0x180041[_0x1369('0x21')]:_0x257d36[_0x1369('0x1e')]+_0x257d36[_0x1369('0x20')];var _0x5a2314;if(_0x385d8d>=_0x5e4dcd){_0x385d8d=_0x5e4dcd;_0x5a2314=0xc8;}else{_0x5a2314=0xce;}_0x1274c8[_0x1369('0x1b')](_0x5a2314);return _0x1274c8['set'](_0x1369('0x22'),_0x876a03+'-'+_0x385d8d+'/'+_0x5e4dcd)['json'](_0x180041);}return null;};}function patchUpdates(_0x159914){return function(_0x277efb){try{jsonpatch[_0x1369('0x23')](_0x277efb,_0x159914,!![]);}catch(_0x60e33c){return BPromise[_0x1369('0x24')](_0x60e33c);}return _0x277efb[_0x1369('0x25')]();};}function saveUpdates(_0x5c894e,_0x53a93e){return function(_0x1d5373){if(_0x1d5373){return _0x1d5373[_0x1369('0x26')](_0x5c894e)[_0x1369('0x27')](function(_0x49d0bc){return _0x49d0bc;});}return null;};}function removeEntity(_0x86407,_0x2e6079){return function(_0x5872cc){if(_0x5872cc){return _0x5872cc[_0x1369('0x28')]()[_0x1369('0x27')](function(){_0x86407[_0x1369('0x1b')](0xcc)[_0x1369('0x1c')]();});}};}function handleEntityNotFound(_0x5db94a,_0x461a6d){return function(_0xdd26e){if(!_0xdd26e){_0x5db94a[_0x1369('0x1a')](0x194);}return _0xdd26e;};}function handleError(_0x22b6fd,_0x213604){_0x213604=_0x213604||0x1f4;return function(_0x31d588){logger[_0x1369('0x29')](_0x31d588[_0x1369('0x2a')]);if(_0x31d588[_0x1369('0x2b')]){delete _0x31d588[_0x1369('0x2b')];}_0x22b6fd[_0x1369('0x1b')](_0x213604)[_0x1369('0x2c')](_0x31d588);};}exports[_0x1369('0x2d')]=function(_0x59435c,_0x394822){var _0x4f2aa1={},_0x16a0a0={},_0x400a10={'count':0x0,'rows':[]};var _0x30ea4a=_['map'](db[_0x1369('0x2e')][_0x1369('0x2f')],function(_0x274b7a){return{'name':_0x274b7a[_0x1369('0x30')],'type':_0x274b7a[_0x1369('0x31')]['key']};});_0x16a0a0[_0x1369('0x32')]=_['map'](_0x30ea4a,_0x1369('0x2b'));_0x16a0a0[_0x1369('0x33')]=_[_0x1369('0x34')](_0x59435c[_0x1369('0x33')]);_0x16a0a0['filters']=_[_0x1369('0x35')](_0x16a0a0['model'],_0x16a0a0['query']);_0x4f2aa1[_0x1369('0x36')]=_[_0x1369('0x35')](_0x16a0a0[_0x1369('0x32')],qs[_0x1369('0x37')](_0x59435c[_0x1369('0x33')]['fields']));_0x4f2aa1['attributes']=_0x4f2aa1[_0x1369('0x36')][_0x1369('0x38')]?_0x4f2aa1[_0x1369('0x36')]:_0x16a0a0['model'];if(!_0x59435c[_0x1369('0x33')][_0x1369('0x39')](_0x1369('0x3a'))){_0x4f2aa1[_0x1369('0x20')]=qs['limit'](_0x59435c[_0x1369('0x33')][_0x1369('0x20')]);_0x4f2aa1[_0x1369('0x1e')]=qs['offset'](_0x59435c[_0x1369('0x33')][_0x1369('0x1e')]);}_0x4f2aa1[_0x1369('0x3b')]=qs[_0x1369('0x3c')](_0x59435c[_0x1369('0x33')][_0x1369('0x3c')]);_0x4f2aa1[_0x1369('0x3d')]=qs[_0x1369('0x3e')](_[_0x1369('0x3f')](_0x59435c['query'],_0x16a0a0[_0x1369('0x3e')]),_0x30ea4a);if(_0x59435c[_0x1369('0x33')][_0x1369('0x40')]){_0x4f2aa1[_0x1369('0x3d')]=_[_0x1369('0x41')](_0x4f2aa1[_0x1369('0x3d')],{'$or':_['map'](_0x30ea4a,function(_0x5324f9){if(_0x5324f9[_0x1369('0x31')]!==_0x1369('0x42')){var _0x6cab3d={};_0x6cab3d[_0x5324f9['name']]={'$like':'%'+_0x59435c[_0x1369('0x33')][_0x1369('0x40')]+'%'};return _0x6cab3d;}})});}_0x4f2aa1=_[_0x1369('0x41')]({},_0x4f2aa1,_0x59435c['options']);var _0x247d2d={'where':_0x4f2aa1['where']};return db['AnalyticFieldReport']['count'](_0x247d2d)[_0x1369('0x27')](function(_0x4959c5){_0x400a10['count']=_0x4959c5;if(_0x59435c[_0x1369('0x33')][_0x1369('0x43')]){_0x4f2aa1[_0x1369('0x44')]=[{'all':!![]}];}return db[_0x1369('0x2e')][_0x1369('0x45')](_0x4f2aa1);})[_0x1369('0x27')](function(_0x1a7de2){_0x400a10[_0x1369('0x46')]=_0x1a7de2;return _0x400a10;})[_0x1369('0x27')](respondWithFilteredResult(_0x394822,_0x4f2aa1))[_0x1369('0x47')](handleError(_0x394822,null));};exports[_0x1369('0x48')]=function(_0x44b99b,_0x1e0b2b){var _0x493844={'raw':![],'where':{'id':_0x44b99b['params']['id']}},_0x3caee4={};_0x3caee4[_0x1369('0x32')]=_[_0x1369('0x34')](db[_0x1369('0x2e')][_0x1369('0x2f')]);_0x3caee4[_0x1369('0x33')]=_[_0x1369('0x34')](_0x44b99b['query']);_0x3caee4['filters']=_[_0x1369('0x35')](_0x3caee4[_0x1369('0x32')],_0x3caee4[_0x1369('0x33')]);_0x493844[_0x1369('0x36')]=_['intersection'](_0x3caee4[_0x1369('0x32')],qs[_0x1369('0x37')](_0x44b99b[_0x1369('0x33')][_0x1369('0x37')]));_0x493844[_0x1369('0x36')]=_0x493844[_0x1369('0x36')][_0x1369('0x38')]?_0x493844[_0x1369('0x36')]:_0x3caee4[_0x1369('0x32')];if(_0x44b99b[_0x1369('0x33')]['includeAll']){_0x493844[_0x1369('0x44')]=[{'all':!![]}];}_0x493844=_[_0x1369('0x41')]({},_0x493844,_0x44b99b['options']);return db[_0x1369('0x2e')][_0x1369('0x49')](_0x493844)[_0x1369('0x27')](handleEntityNotFound(_0x1e0b2b,null))[_0x1369('0x27')](respondWithResult(_0x1e0b2b,null))[_0x1369('0x47')](handleError(_0x1e0b2b,null));};exports[_0x1369('0x4a')]=function(_0x5ae39d,_0x588ca5){return db[_0x1369('0x2e')][_0x1369('0x4a')](_0x5ae39d['body'],{})[_0x1369('0x27')](respondWithResult(_0x588ca5,0xc9))[_0x1369('0x47')](handleError(_0x588ca5,null));};exports[_0x1369('0x4b')]=function(_0x430b4d,_0x54398c){return db['AnalyticFieldReport'][_0x1369('0x4b')](_0x430b4d[_0x1369('0x4c')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x54398c,0xc9))[_0x1369('0x47')](handleError(_0x54398c,null));};exports[_0x1369('0x26')]=function(_0x178872,_0x54cb2a){if(_0x178872['body']['id']){delete _0x178872[_0x1369('0x4c')]['id'];}return db['AnalyticFieldReport'][_0x1369('0x49')]({'where':{'id':_0x178872[_0x1369('0x4d')]['id']}})['then'](handleEntityNotFound(_0x54cb2a,null))[_0x1369('0x27')](saveUpdates(_0x178872['body'],null))[_0x1369('0x27')](respondWithResult(_0x54cb2a,null))[_0x1369('0x47')](handleError(_0x54cb2a,null));};exports[_0x1369('0x28')]=function(_0x2de908,_0x4e3749){return db[_0x1369('0x2e')]['find']({'where':{'id':_0x2de908['params']['id']}})[_0x1369('0x27')](handleEntityNotFound(_0x4e3749,null))[_0x1369('0x27')](removeEntity(_0x4e3749,null))[_0x1369('0x47')](handleError(_0x4e3749,null));};exports['bulkDestroy']=function(_0x5ae345,_0x1951fb){return db[_0x1369('0x2e')][_0x1369('0x28')]({'where':{'id':_0x5ae345[_0x1369('0x33')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1951fb,0xcc))[_0x1369('0x47')](handleError(_0x1951fb,null));};exports['addFields']=function(_0x1dc859,_0x2fe76f,_0x545b2d){return db[_0x1369('0x4e')][_0x1369('0x4f')]({'where':{'id':_0x1dc859[_0x1369('0x4d')]['id']}})[_0x1369('0x27')](handleEntityNotFound(_0x2fe76f,null))['then'](function(_0x1b5762){if(_0x1b5762){return db[_0x1369('0x50')][_0x1369('0x51')](function(_0x4955be){return db[_0x1369('0x2e')][_0x1369('0x28')]({'where':{'CustomReportId':_0x1dc859[_0x1369('0x4d')]['id']},'transaction':_0x4955be})['then'](function(_0x24e979){var _0x19e417=_['map'](_0x1dc859[_0x1369('0x4c')],function(_0x91f37e){delete _0x91f37e['id'];_0x91f37e['CustomReportId']=_0x1dc859[_0x1369('0x4d')]['id'];return _0x91f37e;});return db['AnalyticFieldReport']['bulkCreate'](_0x19e417,{'transaction':_0x4955be});});})['then'](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x1dc859[_0x1369('0x4d')]['id']}});});}})[_0x1369('0x27')](respondWithResult(_0x2fe76f,null))[_0x1369('0x47')](handleError(_0x2fe76f,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 9e6023f..8481415 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 _0xf32c=['request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','util','../../config/logger','api','moment','bluebird'];(function(_0x157901,_0x5f3733){var _0x171bee=function(_0x37eb58){while(--_0x37eb58){_0x157901['push'](_0x157901['shift']());}};_0x171bee(++_0x5f3733);}(_0xf32c,0x1cf));var _0xcf32=function(_0x2a67cb,_0x359895){_0x2a67cb=_0x2a67cb-0x0;var _0x3e7c03=_0xf32c[_0x2a67cb];return _0x3e7c03;};'use strict';var _=require('lodash');var util=require(_0xcf32('0x0'));var logger=require(_0xcf32('0x1'))(_0xcf32('0x2'));var moment=require(_0xcf32('0x3'));var BPromise=require(_0xcf32('0x4'));var rp=require(_0xcf32('0x5'));var fs=require('fs');var path=require(_0xcf32('0x6'));var rimraf=require(_0xcf32('0x7'));var config=require(_0xcf32('0x8'));var attributes=require(_0xcf32('0x9'));module['exports']=function(_0x3ea0e7,_0x4d38de){return _0x3ea0e7[_0xcf32('0xa')](_0xcf32('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d6c=['bluebird','rimraf','./analyticFieldReport.attributes','exports','analytics_report_fields','lodash','../../config/logger','api','moment'];(function(_0x1a6134,_0x4f419c){var _0x5c878e=function(_0x4f8dd3){while(--_0x4f8dd3){_0x1a6134['push'](_0x1a6134['shift']());}};_0x5c878e(++_0x4f419c);}(_0x1d6c,0x101));var _0xc1d6=function(_0x1b02a6,_0x314c1b){_0x1b02a6=_0x1b02a6-0x0;var _0x27400f=_0x1d6c[_0x1b02a6];return _0x27400f;};'use strict';var _=require(_0xc1d6('0x0'));var util=require('util');var logger=require(_0xc1d6('0x1'))(_0xc1d6('0x2'));var moment=require(_0xc1d6('0x3'));var BPromise=require(_0xc1d6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc1d6('0x5'));var config=require('../../config/environment');var attributes=require(_0xc1d6('0x6'));module[_0xc1d6('0x7')]=function(_0x86b0c8,_0x3b5c82){return _0x86b0c8['define']('AnalyticFieldReport',attributes,{'tableName':_0xc1d6('0x8'),'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 4130a19..8ac08df 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 _0xdb6a=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2603af,_0x53f2e1){var _0x20825a=function(_0x41c00a){while(--_0x41c00a){_0x2603af['push'](_0x2603af['shift']());}};_0x20825a(++_0x53f2e1);}(_0xdb6a,0x196));var _0xadb6=function(_0x498cd1,_0x160097){_0x498cd1=_0x498cd1-0x0;var _0x12f00d=_0xdb6a[_0x498cd1];return _0x12f00d;};'use strict';var _=require('lodash');var util=require(_0xadb6('0x0'));var moment=require(_0xadb6('0x1'));var BPromise=require(_0xadb6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xadb6('0x3'))['db'];var utils=require(_0xadb6('0x4'));var logger=require(_0xadb6('0x5'))(_0xadb6('0x6'));var config=require('../../config/environment');var jayson=require(_0xadb6('0x7'));var client=jayson[_0xadb6('0x8')][_0xadb6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46185b,_0x178d91,_0x2ba4d5){return new BPromise(function(_0x2ee4ec,_0x2abcba){return client[_0xadb6('0xa')](_0x46185b,_0x2ba4d5)['then'](function(_0x26fe44){logger[_0xadb6('0xb')](_0xadb6('0xc'),_0x178d91,_0xadb6('0xd'));logger[_0xadb6('0xe')](_0xadb6('0xf'),_0x178d91,_0xadb6('0xd'),JSON[_0xadb6('0x10')](_0x26fe44));if(_0x26fe44['error']){if(_0x26fe44['error'][_0xadb6('0x11')]===0x1f4){logger[_0xadb6('0x12')](_0xadb6('0xc'),_0x178d91,_0x26fe44[_0xadb6('0x12')][_0xadb6('0x13')]);return _0x2abcba(_0x26fe44[_0xadb6('0x12')][_0xadb6('0x13')]);}logger[_0xadb6('0x12')](_0xadb6('0xc'),_0x178d91,_0x26fe44[_0xadb6('0x12')][_0xadb6('0x13')]);return _0x2ee4ec(_0x26fe44[_0xadb6('0x12')]['message']);}else{logger[_0xadb6('0xb')](_0xadb6('0xc'),_0x178d91,_0xadb6('0xd'));_0x2ee4ec(_0x26fe44['result'][_0xadb6('0x13')]);}})[_0xadb6('0x14')](function(_0x23976d){logger[_0xadb6('0x12')](_0xadb6('0xc'),_0x178d91,_0x23976d);_0x2abcba(_0x23976d);});});} \ No newline at end of file +var _0xb4b6=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s'];(function(_0x4d6e55,_0x59afcc){var _0x2184c6=function(_0x59729b){while(--_0x59729b){_0x4d6e55['push'](_0x4d6e55['shift']());}};_0x2184c6(++_0x59afcc);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x5a283e,_0x379421){_0x5a283e=_0x5a283e-0x0;var _0x26145e=_0xb4b6[_0x5a283e];return _0x26145e;};'use strict';var _=require('lodash');var util=require(_0x6b4b('0x0'));var moment=require(_0x6b4b('0x1'));var BPromise=require(_0x6b4b('0x2'));var rs=require(_0x6b4b('0x3'));var fs=require('fs');var Redis=require(_0x6b4b('0x4'));var db=require(_0x6b4b('0x5'))['db'];var utils=require(_0x6b4b('0x6'));var logger=require(_0x6b4b('0x7'))(_0x6b4b('0x8'));var config=require('../../config/environment');var jayson=require(_0x6b4b('0x9'));var client=jayson['client'][_0x6b4b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25eef2,_0x8b279d,_0x127577){return new BPromise(function(_0x2e6b81,_0x572b2d){return client[_0x6b4b('0xb')](_0x25eef2,_0x127577)[_0x6b4b('0xc')](function(_0x40b391){logger[_0x6b4b('0xd')](_0x6b4b('0xe'),_0x8b279d,_0x6b4b('0xf'));logger[_0x6b4b('0x10')](_0x6b4b('0x11'),_0x8b279d,'request\x20sent',JSON[_0x6b4b('0x12')](_0x40b391));if(_0x40b391['error']){if(_0x40b391[_0x6b4b('0x13')][_0x6b4b('0x14')]===0x1f4){logger[_0x6b4b('0x13')](_0x6b4b('0xe'),_0x8b279d,_0x40b391[_0x6b4b('0x13')][_0x6b4b('0x15')]);return _0x572b2d(_0x40b391[_0x6b4b('0x13')]['message']);}logger[_0x6b4b('0x13')](_0x6b4b('0xe'),_0x8b279d,_0x40b391[_0x6b4b('0x13')]['message']);return _0x2e6b81(_0x40b391['error'][_0x6b4b('0x15')]);}else{logger[_0x6b4b('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x8b279d,_0x6b4b('0xf'));_0x2e6b81(_0x40b391[_0x6b4b('0x16')][_0x6b4b('0x15')]);}})[_0x6b4b('0x17')](function(_0x22a176){logger[_0x6b4b('0x13')](_0x6b4b('0xe'),_0x8b279d,_0x22a176);_0x572b2d(_0x22a176);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 0edc647..b62d5cf 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(_0x20d41b,_0x526b81){var _0x835995=function(_0x378ce5){while(--_0x378ce5){_0x20d41b['push'](_0x20d41b['shift']());}};_0x835995(++_0x526b81);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x2449ab,_0x3247a6){var _0x46b935=function(_0x284c7e){while(--_0x284c7e){_0x2449ab['push'](_0x2449ab['shift']());}};_0x46b935(++_0x3247a6);}(_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('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 5a1b0d5..f7495b8 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 _0x2964=['exports','STRING','name','TEXT','sequelize'];(function(_0x285a8e,_0x916795){var _0x81b7a1=function(_0x419c7e){while(--_0x419c7e){_0x285a8e['push'](_0x285a8e['shift']());}};_0x81b7a1(++_0x916795);}(_0x2964,0x108));var _0x4296=function(_0x257068,_0x7b0845){_0x257068=_0x257068-0x0;var _0x2a04bf=_0x2964[_0x257068];return _0x2a04bf;};'use strict';var Sequelize=require(_0x4296('0x0'));module[_0x4296('0x1')]={'name':{'type':Sequelize[_0x4296('0x2')],'allowNull':![],'unique':_0x4296('0x3')},'table':{'type':Sequelize[_0x4296('0x2')]},'metric':{'type':Sequelize[_0x4296('0x4')]},'description':{'type':Sequelize[_0x4296('0x2')]}}; \ No newline at end of file +var _0x1707=['STRING','TEXT','sequelize'];(function(_0x1761f0,_0x27fe8b){var _0x371d9f=function(_0x4b1a4e){while(--_0x4b1a4e){_0x1761f0['push'](_0x1761f0['shift']());}};_0x371d9f(++_0x27fe8b);}(_0x1707,0x1df));var _0x7170=function(_0x3944a8,_0x4899f3){_0x3944a8=_0x3944a8-0x0;var _0x551a29=_0x1707[_0x3944a8];return _0x551a29;};'use strict';var Sequelize=require(_0x7170('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x7170('0x1')]},'metric':{'type':Sequelize[_0x7170('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index bb84682..a2465ed 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 _0x84ab=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','map','AnalyticMetric','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','include','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x5ce8b9,_0x5cded8){var _0xe34be0=function(_0xe3d4e5){while(--_0xe3d4e5){_0x5ce8b9['push'](_0x5ce8b9['shift']());}};_0xe34be0(++_0x5cded8);}(_0x84ab,0x12f));var _0xb84a=function(_0x2e04ef,_0x31a596){_0x2e04ef=_0x2e04ef-0x0;var _0x5722b0=_0x84ab[_0x2e04ef];return _0x5722b0;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];function respondWithStatusCode(_0x4d3758,_0x83444e){_0x83444e=_0x83444e||0xcc;return function(_0x4777dc){if(_0x4777dc){return _0x4d3758[_0xb84a('0x16')](_0x83444e);}return _0x4d3758[_0xb84a('0x17')](_0x83444e)[_0xb84a('0x18')]();};}function respondWithResult(_0x11dfe9,_0x12ccab){_0x12ccab=_0x12ccab||0xc8;return function(_0x475b){if(_0x475b){return _0x11dfe9[_0xb84a('0x17')](_0x12ccab)[_0xb84a('0x19')](_0x475b);}};}function respondWithFilteredResult(_0xc0b2e0,_0x1251ec){return function(_0x5716bd){if(_0x5716bd){var _0x11dd4d=typeof _0x1251ec[_0xb84a('0x1a')]===_0xb84a('0x1b')&&typeof _0x1251ec[_0xb84a('0x1c')]===_0xb84a('0x1b');var _0x1be87a=_0x5716bd[_0xb84a('0x1d')];var _0x34d82f=_0x11dd4d?0x0:_0x1251ec[_0xb84a('0x1a')];var _0x3f7437=_0x11dd4d?_0x5716bd[_0xb84a('0x1d')]:_0x1251ec[_0xb84a('0x1a')]+_0x1251ec[_0xb84a('0x1c')];var _0x200289;if(_0x3f7437>=_0x1be87a){_0x3f7437=_0x1be87a;_0x200289=0xc8;}else{_0x200289=0xce;}_0xc0b2e0['status'](_0x200289);return _0xc0b2e0[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x34d82f+'-'+_0x3f7437+'/'+_0x1be87a)['json'](_0x5716bd);}return null;};}function patchUpdates(_0xac76d3){return function(_0x61ef03){try{jsonpatch[_0xb84a('0x20')](_0x61ef03,_0xac76d3,!![]);}catch(_0x19f637){return BPromise['reject'](_0x19f637);}return _0x61ef03['save']();};}function saveUpdates(_0x1466ae,_0x19097d){return function(_0x2d70fd){if(_0x2d70fd){return _0x2d70fd[_0xb84a('0x21')](_0x1466ae)[_0xb84a('0x22')](function(_0x3b8fb2){return _0x3b8fb2;});}return null;};}function removeEntity(_0x8b28cd,_0x21d0d3){return function(_0x3aa06f){if(_0x3aa06f){return _0x3aa06f[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){var _0x1aab7d=_0x3aa06f[_0xb84a('0x24')]({'plain':!![]});var _0x409df0=_0xb84a('0x25');return db[_0xb84a('0x26')][_0xb84a('0x23')]({'where':{'type':_0x409df0,'resourceId':_0x1aab7d['id']}})[_0xb84a('0x22')](function(){return _0x3aa06f;});})[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x1db72c,_0x2fe40d){return function(_0x35d1f7){if(!_0x35d1f7){_0x1db72c[_0xb84a('0x16')](0x194);}return _0x35d1f7;};}function handleError(_0x97d71b,_0x5349ea){_0x5349ea=_0x5349ea||0x1f4;return function(_0x582954){logger[_0xb84a('0x27')](_0x582954[_0xb84a('0x28')]);if(_0x582954['name']){delete _0x582954[_0xb84a('0x29')];}_0x97d71b[_0xb84a('0x17')](_0x5349ea)['send'](_0x582954);};}exports['index']=function(_0x28f2e7,_0x8e9319){var _0x49ba3d={},_0x251778={},_0xba1147={'count':0x0,'rows':[]};var _0x3abc22=_[_0xb84a('0x2a')](db[_0xb84a('0x2b')][_0xb84a('0x2c')],function(_0x34b212){return{'name':_0x34b212[_0xb84a('0x2d')],'type':_0x34b212['type'][_0xb84a('0x2e')]};});_0x251778['model']=_['map'](_0x3abc22,_0xb84a('0x29'));_0x251778[_0xb84a('0x2f')]=_['keys'](_0x28f2e7['query']);_0x251778[_0xb84a('0x30')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],_0x251778[_0xb84a('0x2f')]);_0x49ba3d[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],qs[_0xb84a('0x34')](_0x28f2e7['query'][_0xb84a('0x34')]));_0x49ba3d[_0xb84a('0x33')]=_0x49ba3d[_0xb84a('0x33')][_0xb84a('0x35')]?_0x49ba3d[_0xb84a('0x33')]:_0x251778[_0xb84a('0x32')];if(!_0x28f2e7[_0xb84a('0x2f')]['hasOwnProperty'](_0xb84a('0x36'))){_0x49ba3d['limit']=qs[_0xb84a('0x1c')](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x49ba3d['offset']=qs['offset'](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1a')]);}_0x49ba3d[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_0x28f2e7[_0xb84a('0x2f')]['sort']);_0x49ba3d[_0xb84a('0x39')]=qs[_0xb84a('0x30')](_['pick'](_0x28f2e7[_0xb84a('0x2f')],_0x251778[_0xb84a('0x30')]),_0x3abc22);if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3a')]){_0x49ba3d['where']=_['merge'](_0x49ba3d['where'],{'$or':_[_0xb84a('0x2a')](_0x3abc22,function(_0x11e1ac){if(_0x11e1ac[_0xb84a('0x3b')]!==_0xb84a('0x3c')){var _0x55b0b8={};_0x55b0b8[_0x11e1ac[_0xb84a('0x29')]]={'$like':'%'+_0x28f2e7['query'][_0xb84a('0x3a')]+'%'};return _0x55b0b8;}})});}_0x49ba3d=_['merge']({},_0x49ba3d,_0x28f2e7['options']);var _0x59d7a1={'where':_0x49ba3d[_0xb84a('0x39')]};return db[_0xb84a('0x2b')][_0xb84a('0x1d')](_0x59d7a1)[_0xb84a('0x22')](function(_0x5e547e){_0xba1147[_0xb84a('0x1d')]=_0x5e547e;if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x49ba3d[_0xb84a('0x3e')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x49ba3d);})[_0xb84a('0x22')](function(_0x1f3e04){_0xba1147['rows']=_0x1f3e04;return _0xba1147;})[_0xb84a('0x22')](respondWithFilteredResult(_0x8e9319,_0x49ba3d))[_0xb84a('0x3f')](handleError(_0x8e9319,null));};exports[_0xb84a('0x40')]=function(_0x25280a,_0x3f005b){var _0x241536={'raw':!![],'where':{'id':_0x25280a[_0xb84a('0x41')]['id']}},_0x24d700={};_0x24d700[_0xb84a('0x32')]=_[_0xb84a('0x42')](db[_0xb84a('0x2b')][_0xb84a('0x2c')]);_0x24d700[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x25280a[_0xb84a('0x2f')]);_0x24d700['filters']=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],_0x24d700[_0xb84a('0x2f')]);_0x241536[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],qs['fields'](_0x25280a[_0xb84a('0x2f')]['fields']));_0x241536[_0xb84a('0x33')]=_0x241536[_0xb84a('0x33')][_0xb84a('0x35')]?_0x241536[_0xb84a('0x33')]:_0x24d700['model'];if(_0x25280a[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x241536[_0xb84a('0x3e')]=[{'all':!![]}];}_0x241536=_['merge']({},_0x241536,_0x25280a['options']);return db[_0xb84a('0x2b')][_0xb84a('0x43')](_0x241536)[_0xb84a('0x22')](handleEntityNotFound(_0x3f005b,null))['then'](respondWithResult(_0x3f005b,null))['catch'](handleError(_0x3f005b,null));};exports['create']=function(_0x45630d,_0x384a0d){return db[_0xb84a('0x2b')][_0xb84a('0x44')](_0x45630d[_0xb84a('0x45')],{})['then'](function(_0x4b40fe){var _0x5b853a=_0x45630d['user'][_0xb84a('0x24')]({'plain':!![]});if(!_0x5b853a)throw new Error(_0xb84a('0x46'));if(_0x5b853a['role']===_0xb84a('0x47')){var _0xc8bac2=_0x4b40fe[_0xb84a('0x24')]({'plain':!![]});var _0x2f70f0=_0xb84a('0x25');return db[_0xb84a('0x48')]['find']({'where':{'name':_0x2f70f0,'userProfileId':_0x5b853a['userProfileId']},'raw':!![]})[_0xb84a('0x22')](function(_0x50172a){if(_0x50172a&&_0x50172a[_0xb84a('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0xc8bac2['name'],'resourceId':_0xc8bac2['id'],'type':_0x50172a[_0xb84a('0x29')],'sectionId':_0x50172a['id']},{})[_0xb84a('0x22')](function(){return _0x4b40fe;});}else{return _0x4b40fe;}})[_0xb84a('0x3f')](function(_0x25b6a0){logger[_0xb84a('0x27')](_0xb84a('0x4a'),_0x25b6a0);throw _0x25b6a0;});}return _0x4b40fe;})[_0xb84a('0x22')](respondWithResult(_0x384a0d,0xc9))[_0xb84a('0x3f')](handleError(_0x384a0d,null));};exports['update']=function(_0x5afdd0,_0x4c5bdf){if(_0x5afdd0[_0xb84a('0x45')]['id']){delete _0x5afdd0[_0xb84a('0x45')]['id'];}return db['AnalyticMetric'][_0xb84a('0x43')]({'where':{'id':_0x5afdd0['params']['id']}})['then'](handleEntityNotFound(_0x4c5bdf,null))['then'](saveUpdates(_0x5afdd0[_0xb84a('0x45')],null))[_0xb84a('0x22')](respondWithResult(_0x4c5bdf,null))[_0xb84a('0x3f')](handleError(_0x4c5bdf,null));};exports['destroy']=function(_0x5f757e,_0x2e98bf){return db[_0xb84a('0x2b')]['find']({'where':{'id':_0x5f757e[_0xb84a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e98bf,null))['then'](removeEntity(_0x2e98bf,null))[_0xb84a('0x3f')](handleError(_0x2e98bf,null));}; \ No newline at end of file +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(_0x155dfb,_0x2c7ac3){_0x155dfb=_0x155dfb-0x0;var _0x282ae2=_0x1cb9[_0x155dfb];return _0x282ae2;};'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 diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index a176498..29d14bc 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 _0x02ca=['path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4887ad,_0xce3905){var _0x45e86b=function(_0x31b638){while(--_0x31b638){_0x4887ad['push'](_0x4887ad['shift']());}};_0x45e86b(++_0xce3905);}(_0x02ca,0x97));var _0xa02c=function(_0x5af099,_0x2b2d5a){_0x5af099=_0x5af099-0x0;var _0x398227=_0x02ca[_0x5af099];return _0x398227;};'use strict';var _=require(_0xa02c('0x0'));var util=require('util');var logger=require(_0xa02c('0x1'))(_0xa02c('0x2'));var moment=require(_0xa02c('0x3'));var BPromise=require(_0xa02c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa02c('0x5'));var rimraf=require(_0xa02c('0x6'));var config=require(_0xa02c('0x7'));var attributes=require(_0xa02c('0x8'));module[_0xa02c('0x9')]=function(_0x46533c,_0xa0f1fe){return _0x46533c[_0xa02c('0xa')](_0xa02c('0xb'),attributes,{'tableName':_0xa02c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf603=['rimraf','../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x5ca5bc,_0x5b8a9d){var _0x26ca86=function(_0x1ad9a6){while(--_0x1ad9a6){_0x5ca5bc['push'](_0x5ca5bc['shift']());}};_0x26ca86(++_0x5b8a9d);}(_0xf603,0x124));var _0x3f60=function(_0x5579da,_0x48a561){_0x5579da=_0x5579da-0x0;var _0x1e1c31=_0xf603[_0x5579da];return _0x1e1c31;};'use strict';var _=require(_0x3f60('0x0'));var util=require(_0x3f60('0x1'));var logger=require('../../config/logger')(_0x3f60('0x2'));var moment=require(_0x3f60('0x3'));var BPromise=require(_0x3f60('0x4'));var rp=require(_0x3f60('0x5'));var fs=require('fs');var path=require(_0x3f60('0x6'));var rimraf=require(_0x3f60('0x7'));var config=require(_0x3f60('0x8'));var attributes=require(_0x3f60('0x9'));module[_0x3f60('0xa')]=function(_0x49d1e0,_0x59bc82){return _0x49d1e0['define'](_0x3f60('0xb'),attributes,{'tableName':_0x3f60('0xc'),'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 8548191..636d5d6 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 _0xad68=['request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x38738b,_0x1c5949){var _0x178692=function(_0x96263f){while(--_0x96263f){_0x38738b['push'](_0x38738b['shift']());}};_0x178692(++_0x1c5949);}(_0xad68,0x146));var _0x8ad6=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0xad68[_0x479509];return _0x382da8;};'use strict';var _=require(_0x8ad6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8ad6('0x1'));var rs=require(_0x8ad6('0x2'));var fs=require('fs');var Redis=require(_0x8ad6('0x3'));var db=require(_0x8ad6('0x4'))['db'];var utils=require(_0x8ad6('0x5'));var logger=require(_0x8ad6('0x6'))(_0x8ad6('0x7'));var config=require(_0x8ad6('0x8'));var jayson=require(_0x8ad6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4553a6,_0x1ee9ef,_0x445758){return new BPromise(function(_0x2a5181,_0x4ed3da){return client[_0x8ad6('0xa')](_0x4553a6,_0x445758)[_0x8ad6('0xb')](function(_0x16e11d){logger[_0x8ad6('0xc')](_0x8ad6('0xd'),_0x1ee9ef,_0x8ad6('0xe'));logger[_0x8ad6('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x1ee9ef,_0x8ad6('0xe'),JSON['stringify'](_0x16e11d));if(_0x16e11d[_0x8ad6('0x10')]){if(_0x16e11d['error'][_0x8ad6('0x11')]===0x1f4){logger[_0x8ad6('0x10')](_0x8ad6('0xd'),_0x1ee9ef,_0x16e11d[_0x8ad6('0x10')][_0x8ad6('0x12')]);return _0x4ed3da(_0x16e11d[_0x8ad6('0x10')][_0x8ad6('0x12')]);}logger[_0x8ad6('0x10')](_0x8ad6('0xd'),_0x1ee9ef,_0x16e11d[_0x8ad6('0x10')][_0x8ad6('0x12')]);return _0x2a5181(_0x16e11d[_0x8ad6('0x10')]['message']);}else{logger['info'](_0x8ad6('0xd'),_0x1ee9ef,_0x8ad6('0xe'));_0x2a5181(_0x16e11d[_0x8ad6('0x13')][_0x8ad6('0x12')]);}})[_0x8ad6('0x14')](function(_0x5d2c80){logger[_0x8ad6('0x10')](_0x8ad6('0xd'),_0x1ee9ef,_0x5d2c80);_0x4ed3da(_0x5d2c80);});});} \ No newline at end of file +var _0x6e54=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','catch','lodash'];(function(_0x52fe08,_0x529536){var _0x506424=function(_0x3266a5){while(--_0x3266a5){_0x52fe08['push'](_0x52fe08['shift']());}};_0x506424(++_0x529536);}(_0x6e54,0x6d));var _0x46e5=function(_0x174a72,_0x46034c){_0x174a72=_0x174a72-0x0;var _0x32cecd=_0x6e54[_0x174a72];return _0x32cecd;};'use strict';var _=require(_0x46e5('0x0'));var util=require(_0x46e5('0x1'));var moment=require(_0x46e5('0x2'));var BPromise=require('bluebird');var rs=require(_0x46e5('0x3'));var fs=require('fs');var Redis=require(_0x46e5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x46e5('0x5'));var logger=require(_0x46e5('0x6'))(_0x46e5('0x7'));var config=require(_0x46e5('0x8'));var jayson=require(_0x46e5('0x9'));var client=jayson[_0x46e5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x185820,_0x4cb699,_0x10422d){return new BPromise(function(_0x1b7e94,_0x3436fc){return client[_0x46e5('0xb')](_0x185820,_0x10422d)['then'](function(_0x5f1706){logger[_0x46e5('0xc')](_0x46e5('0xd'),_0x4cb699,_0x46e5('0xe'));logger['debug'](_0x46e5('0xf'),_0x4cb699,_0x46e5('0xe'),JSON[_0x46e5('0x10')](_0x5f1706));if(_0x5f1706[_0x46e5('0x11')]){if(_0x5f1706[_0x46e5('0x11')][_0x46e5('0x12')]===0x1f4){logger[_0x46e5('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x4cb699,_0x5f1706[_0x46e5('0x11')]['message']);return _0x3436fc(_0x5f1706['error']['message']);}logger[_0x46e5('0x11')](_0x46e5('0xd'),_0x4cb699,_0x5f1706[_0x46e5('0x11')]['message']);return _0x1b7e94(_0x5f1706[_0x46e5('0x11')]['message']);}else{logger[_0x46e5('0xc')](_0x46e5('0xd'),_0x4cb699,_0x46e5('0xe'));_0x1b7e94(_0x5f1706[_0x46e5('0x13')][_0x46e5('0x14')]);}})[_0x46e5('0x15')](function(_0x3c6981){logger[_0x46e5('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x4cb699,_0x3c6981);_0x3436fc(_0x3c6981);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 058c253..e323677 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 _0x5c1f=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id','show','update','delete','destroy'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5c1f,0x1b3));var _0xf5c1=function(_0x2ac4af,_0x288c53){_0x2ac4af=_0x2ac4af-0x0;var _0x3a36df=_0x5c1f[_0x2ac4af];return _0x3a36df;};'use strict';var multer=require(_0xf5c1('0x0'));var util=require('util');var path=require(_0xf5c1('0x1'));var timeout=require(_0xf5c1('0x2'));var express=require('express');var router=express[_0xf5c1('0x3')]();var fs_extra=require(_0xf5c1('0x4'));var auth=require(_0xf5c1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0xf5c1('0x6')]('/',auth[_0xf5c1('0x7')](),controller['index']);router[_0xf5c1('0x6')](_0xf5c1('0x8'),auth[_0xf5c1('0x7')](),controller[_0xf5c1('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf5c1('0x8'),auth[_0xf5c1('0x7')](),controller[_0xf5c1('0xa')]);router[_0xf5c1('0xb')](_0xf5c1('0x8'),auth[_0xf5c1('0x7')](),controller[_0xf5c1('0xc')]);module[_0xf5c1('0xd')]=router; \ No newline at end of file +var _0x1dcc=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','put','update'];(function(_0xaaf2e2,_0x19d28a){var _0x28bc36=function(_0x53bdb5){while(--_0x53bdb5){_0xaaf2e2['push'](_0xaaf2e2['shift']());}};_0x28bc36(++_0x19d28a);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x2545eb,_0x24f447){_0x2545eb=_0x2545eb-0x0;var _0x1e1bc1=_0x1dcc[_0x2545eb];return _0x1e1bc1;};'use strict';var multer=require(_0xc1dc('0x0'));var util=require(_0xc1dc('0x1'));var path=require(_0xc1dc('0x2'));var timeout=require(_0xc1dc('0x3'));var express=require('express');var router=express[_0xc1dc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc1dc('0x5'));var interaction=require(_0xc1dc('0x6'));var config=require(_0xc1dc('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xc1dc('0x8')](),controller[_0xc1dc('0x9')]);router[_0xc1dc('0xa')]('/:id',auth[_0xc1dc('0x8')](),controller[_0xc1dc('0xb')]);router['post']('/',auth[_0xc1dc('0x8')](),controller['create']);router[_0xc1dc('0xc')]('/:id',auth[_0xc1dc('0x8')](),controller[_0xc1dc('0xd')]);router[_0xc1dc('0xe')](_0xc1dc('0xf'),auth[_0xc1dc('0x8')](),controller[_0xc1dc('0x10')]);module[_0xc1dc('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 0018375..69a9e57 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 _0x554d=['sequelize','TEXT'];(function(_0xdc7170,_0x571276){var _0x9e8216=function(_0x4ebfbc){while(--_0x4ebfbc){_0xdc7170['push'](_0xdc7170['shift']());}};_0x9e8216(++_0x571276);}(_0x554d,0x1c8));var _0xd554=function(_0x546e23,_0x245680){_0x546e23=_0x546e23-0x0;var _0x21676a=_0x554d[_0x546e23];return _0x21676a;};'use strict';var Sequelize=require(_0xd554('0x0'));module['exports']={'tree':{'type':Sequelize[_0xd554('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x9f6e=['TEXT','sequelize','exports'];(function(_0x2f371e,_0x579eea){var _0x518ccc=function(_0x14992d){while(--_0x14992d){_0x2f371e['push'](_0x2f371e['shift']());}};_0x518ccc(++_0x579eea);}(_0x9f6e,0x1ae));var _0xe9f6=function(_0x2cb734,_0x40a942){_0x2cb734=_0x2cb734-0x0;var _0x16e278=_0x9f6e[_0x2cb734];return _0x16e278;};'use strict';var Sequelize=require(_0xe9f6('0x0'));module[_0xe9f6('0x1')]={'tree':{'type':Sequelize[_0xe9f6('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 7859a73..4170c32 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 _0xc016=['error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','merge','filter','options','AnalyticTreeReport','includeAll','findAll','then','show','params','keys','find','catch','create','body','update','destroy','rimraf','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','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0xc016,0x6d));var _0x6c01=function(_0xac74af,_0x332ed2){_0xac74af=_0xac74af-0x0;var _0x3a512d=_0xc016[_0xac74af];return _0x3a512d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c01('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6c01('0x1'));var BPromise=require(_0x6c01('0x2'));var Mustache=require(_0x6c01('0x3'));var util=require('util');var path=require(_0x6c01('0x4'));var sox=require(_0x6c01('0x5'));var csv=require(_0x6c01('0x6'));var ejs=require(_0x6c01('0x7'));var fs=require('fs');var fs_extra=require(_0x6c01('0x8'));var _=require(_0x6c01('0x9'));var squel=require(_0x6c01('0xa'));var crypto=require(_0x6c01('0xb'));var jsforce=require(_0x6c01('0xc'));var deskjs=require(_0x6c01('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6c01('0xe'));var Papa=require(_0x6c01('0xf'));var Redis=require(_0x6c01('0x10'));var authService=require(_0x6c01('0x11'));var qs=require(_0x6c01('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c01('0x13'));var logger=require('../../config/logger')(_0x6c01('0x14'));var utils=require(_0x6c01('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6c01('0x16'));var db=require(_0x6c01('0x17'))['db'];function respondWithStatusCode(_0x2ae879,_0x490273){_0x490273=_0x490273||0xcc;return function(_0x33bf22){if(_0x33bf22){return _0x2ae879[_0x6c01('0x18')](_0x490273);}return _0x2ae879[_0x6c01('0x19')](_0x490273)[_0x6c01('0x1a')]();};}function respondWithResult(_0x11f8b8,_0x98b12f){_0x98b12f=_0x98b12f||0xc8;return function(_0x1baef7){if(_0x1baef7){return _0x11f8b8[_0x6c01('0x19')](_0x98b12f)['json'](_0x1baef7);}};}function respondWithFilteredResult(_0x32fcb2,_0x291c44){return function(_0x57f409){if(_0x57f409){var _0x483473=typeof _0x291c44[_0x6c01('0x1b')]===_0x6c01('0x1c')&&typeof _0x291c44[_0x6c01('0x1d')]==='undefined';var _0x300900=_0x57f409[_0x6c01('0x1e')];var _0x4d0a2d=_0x483473?0x0:_0x291c44[_0x6c01('0x1b')];var _0x4852d7=_0x483473?_0x57f409['count']:_0x291c44['offset']+_0x291c44[_0x6c01('0x1d')];var _0x482bc2;if(_0x4852d7>=_0x300900){_0x4852d7=_0x300900;_0x482bc2=0xc8;}else{_0x482bc2=0xce;}_0x32fcb2[_0x6c01('0x19')](_0x482bc2);return _0x32fcb2[_0x6c01('0x1f')](_0x6c01('0x20'),_0x4d0a2d+'-'+_0x4852d7+'/'+_0x300900)[_0x6c01('0x21')](_0x57f409);}return null;};}function patchUpdates(_0x190b4f){return function(_0x139d3d){try{jsonpatch['apply'](_0x139d3d,_0x190b4f,!![]);}catch(_0x21b67b){return BPromise[_0x6c01('0x22')](_0x21b67b);}return _0x139d3d['save']();};}function saveUpdates(_0x16bbb0,_0x4f3bed){return function(_0x315ae9){if(_0x315ae9){return _0x315ae9['update'](_0x16bbb0)['then'](function(_0x248c01){return _0x248c01;});}return null;};}function removeEntity(_0x433df3,_0x5e53a4){return function(_0x57eda6){if(_0x57eda6){return _0x57eda6['destroy']()['then'](function(){_0x433df3[_0x6c01('0x19')](0xcc)[_0x6c01('0x1a')]();});}};}function handleEntityNotFound(_0x569287,_0x3b5d81){return function(_0x14d629){if(!_0x14d629){_0x569287[_0x6c01('0x18')](0x194);}return _0x14d629;};}function handleError(_0x2ec2d3,_0x191591){_0x191591=_0x191591||0x1f4;return function(_0x3c900f){logger[_0x6c01('0x23')](_0x3c900f[_0x6c01('0x24')]);if(_0x3c900f[_0x6c01('0x25')]){delete _0x3c900f[_0x6c01('0x25')];}_0x2ec2d3[_0x6c01('0x19')](_0x191591)[_0x6c01('0x26')](_0x3c900f);};}exports[_0x6c01('0x27')]=function(_0x3dc4f6,_0x30b128){var _0x38883b={},_0x22067b={},_0x41dd1a={'count':0x0,'rows':[]};var _0x220502=_[_0x6c01('0x28')](db['AnalyticTreeReport'][_0x6c01('0x29')],function(_0x1b584a){return{'name':_0x1b584a[_0x6c01('0x2a')],'type':_0x1b584a[_0x6c01('0x2b')][_0x6c01('0x2c')]};});_0x22067b[_0x6c01('0x2d')]=_[_0x6c01('0x28')](_0x220502,'name');_0x22067b[_0x6c01('0x2e')]=_['keys'](_0x3dc4f6[_0x6c01('0x2e')]);_0x22067b[_0x6c01('0x2f')]=_[_0x6c01('0x30')](_0x22067b[_0x6c01('0x2d')],_0x22067b[_0x6c01('0x2e')]);_0x38883b[_0x6c01('0x31')]=_[_0x6c01('0x30')](_0x22067b[_0x6c01('0x2d')],qs[_0x6c01('0x32')](_0x3dc4f6[_0x6c01('0x2e')][_0x6c01('0x32')]));_0x38883b[_0x6c01('0x31')]=_0x38883b[_0x6c01('0x31')][_0x6c01('0x33')]?_0x38883b[_0x6c01('0x31')]:_0x22067b[_0x6c01('0x2d')];if(!_0x3dc4f6[_0x6c01('0x2e')]['hasOwnProperty'](_0x6c01('0x34'))){_0x38883b[_0x6c01('0x1d')]=qs[_0x6c01('0x1d')](_0x3dc4f6['query'][_0x6c01('0x1d')]);_0x38883b[_0x6c01('0x1b')]=qs[_0x6c01('0x1b')](_0x3dc4f6[_0x6c01('0x2e')][_0x6c01('0x1b')]);}_0x38883b[_0x6c01('0x35')]=qs['sort'](_0x3dc4f6[_0x6c01('0x2e')]['sort']);_0x38883b[_0x6c01('0x36')]=qs[_0x6c01('0x2f')](_[_0x6c01('0x37')](_0x3dc4f6[_0x6c01('0x2e')],_0x22067b[_0x6c01('0x2f')]),_0x220502);if(_0x3dc4f6[_0x6c01('0x2e')]['filter']){_0x38883b[_0x6c01('0x36')]=_[_0x6c01('0x38')](_0x38883b[_0x6c01('0x36')],{'$or':_[_0x6c01('0x28')](_0x220502,function(_0x704767){if(_0x704767[_0x6c01('0x2b')]!=='VIRTUAL'){var _0x3fa4bd={};_0x3fa4bd[_0x704767[_0x6c01('0x25')]]={'$like':'%'+_0x3dc4f6[_0x6c01('0x2e')][_0x6c01('0x39')]+'%'};return _0x3fa4bd;}})});}_0x38883b=_[_0x6c01('0x38')]({},_0x38883b,_0x3dc4f6[_0x6c01('0x3a')]);var _0x4102e6={'where':_0x38883b[_0x6c01('0x36')]};return db[_0x6c01('0x3b')][_0x6c01('0x1e')](_0x4102e6)['then'](function(_0x38b95a){_0x41dd1a[_0x6c01('0x1e')]=_0x38b95a;if(_0x3dc4f6[_0x6c01('0x2e')][_0x6c01('0x3c')]){_0x38883b['include']=[{'all':!![]}];}return db[_0x6c01('0x3b')][_0x6c01('0x3d')](_0x38883b);})['then'](function(_0x31400d){_0x41dd1a['rows']=_0x31400d;return _0x41dd1a;})[_0x6c01('0x3e')](respondWithFilteredResult(_0x30b128,_0x38883b))['catch'](handleError(_0x30b128,null));};exports[_0x6c01('0x3f')]=function(_0x12d6b2,_0x4b5500){var _0x490ac5={'raw':!![],'where':{'id':_0x12d6b2[_0x6c01('0x40')]['id']}},_0x240feb={};_0x240feb[_0x6c01('0x2d')]=_[_0x6c01('0x41')](db['AnalyticTreeReport'][_0x6c01('0x29')]);_0x240feb['query']=_[_0x6c01('0x41')](_0x12d6b2[_0x6c01('0x2e')]);_0x240feb['filters']=_[_0x6c01('0x30')](_0x240feb[_0x6c01('0x2d')],_0x240feb[_0x6c01('0x2e')]);_0x490ac5[_0x6c01('0x31')]=_[_0x6c01('0x30')](_0x240feb[_0x6c01('0x2d')],qs[_0x6c01('0x32')](_0x12d6b2[_0x6c01('0x2e')][_0x6c01('0x32')]));_0x490ac5[_0x6c01('0x31')]=_0x490ac5[_0x6c01('0x31')][_0x6c01('0x33')]?_0x490ac5[_0x6c01('0x31')]:_0x240feb[_0x6c01('0x2d')];if(_0x12d6b2[_0x6c01('0x2e')]['includeAll']){_0x490ac5['include']=[{'all':!![]}];}_0x490ac5=_[_0x6c01('0x38')]({},_0x490ac5,_0x12d6b2[_0x6c01('0x3a')]);return db[_0x6c01('0x3b')][_0x6c01('0x42')](_0x490ac5)[_0x6c01('0x3e')](handleEntityNotFound(_0x4b5500,null))['then'](respondWithResult(_0x4b5500,null))[_0x6c01('0x43')](handleError(_0x4b5500,null));};exports[_0x6c01('0x44')]=function(_0x368c56,_0x1746a7){return db['AnalyticTreeReport'][_0x6c01('0x44')](_0x368c56[_0x6c01('0x45')],{})[_0x6c01('0x3e')](respondWithResult(_0x1746a7,0xc9))[_0x6c01('0x43')](handleError(_0x1746a7,null));};exports[_0x6c01('0x46')]=function(_0x37400c,_0x1905f9){if(_0x37400c['body']['id']){delete _0x37400c[_0x6c01('0x45')]['id'];}return db[_0x6c01('0x3b')]['find']({'where':{'id':_0x37400c['params']['id']}})[_0x6c01('0x3e')](handleEntityNotFound(_0x1905f9,null))[_0x6c01('0x3e')](saveUpdates(_0x37400c[_0x6c01('0x45')],null))[_0x6c01('0x3e')](respondWithResult(_0x1905f9,null))[_0x6c01('0x43')](handleError(_0x1905f9,null));};exports[_0x6c01('0x47')]=function(_0x42d8c0,_0x5f3796){return db['AnalyticTreeReport']['find']({'where':{'id':_0x42d8c0['params']['id']}})[_0x6c01('0x3e')](handleEntityNotFound(_0x5f3796,null))[_0x6c01('0x3e')](removeEntity(_0x5f3796,null))[_0x6c01('0x43')](handleError(_0x5f3796,null));}; \ No newline at end of file +var _0x797f=['intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x1bb412,_0x46680){var _0x34fa8f=function(_0x21cdd1){while(--_0x21cdd1){_0x1bb412['push'](_0x1bb412['shift']());}};_0x34fa8f(++_0x46680);}(_0x797f,0x13e));var _0xf797=function(_0x5234fc,_0x8196f){_0x5234fc=_0x5234fc-0x0;var _0x40a58c=_0x797f[_0x5234fc];return _0x40a58c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf797('0x0'));var zipdir=require(_0xf797('0x1'));var jsonpatch=require(_0xf797('0x2'));var rp=require('request-promise');var moment=require(_0xf797('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf797('0x4'));var util=require(_0xf797('0x5'));var path=require(_0xf797('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf797('0x7'));var squel=require(_0xf797('0x8'));var crypto=require(_0xf797('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xf797('0xa'));var toCsv=require(_0xf797('0xb'));var querystring=require('querystring');var Papa=require(_0xf797('0xc'));var Redis=require(_0xf797('0xd'));var authService=require(_0xf797('0xe'));var qs=require(_0xf797('0xf'));var as=require(_0xf797('0x10'));var hardwareService=require(_0xf797('0x11'));var logger=require(_0xf797('0x12'))(_0xf797('0x13'));var utils=require('../../config/utils');var config=require(_0xf797('0x14'));var licenseUtil=require(_0xf797('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b79fe,_0x543768){_0x543768=_0x543768||0xcc;return function(_0x560512){if(_0x560512){return _0x1b79fe[_0xf797('0x16')](_0x543768);}return _0x1b79fe[_0xf797('0x17')](_0x543768)['end']();};}function respondWithResult(_0x43a92f,_0x1e3010){_0x1e3010=_0x1e3010||0xc8;return function(_0x52630a){if(_0x52630a){return _0x43a92f[_0xf797('0x17')](_0x1e3010)['json'](_0x52630a);}};}function respondWithFilteredResult(_0x2830d0,_0x22a8e9){return function(_0x26106e){if(_0x26106e){var _0x2d82cc=typeof _0x22a8e9[_0xf797('0x18')]===_0xf797('0x19')&&typeof _0x22a8e9['limit']==='undefined';var _0xc97a8d=_0x26106e[_0xf797('0x1a')];var _0x89f6a0=_0x2d82cc?0x0:_0x22a8e9['offset'];var _0xbaac8d=_0x2d82cc?_0x26106e[_0xf797('0x1a')]:_0x22a8e9[_0xf797('0x18')]+_0x22a8e9[_0xf797('0x1b')];var _0xd6a9a5;if(_0xbaac8d>=_0xc97a8d){_0xbaac8d=_0xc97a8d;_0xd6a9a5=0xc8;}else{_0xd6a9a5=0xce;}_0x2830d0['status'](_0xd6a9a5);return _0x2830d0[_0xf797('0x1c')](_0xf797('0x1d'),_0x89f6a0+'-'+_0xbaac8d+'/'+_0xc97a8d)[_0xf797('0x1e')](_0x26106e);}return null;};}function patchUpdates(_0x27482d){return function(_0x7222f9){try{jsonpatch[_0xf797('0x1f')](_0x7222f9,_0x27482d,!![]);}catch(_0x5272c2){return BPromise[_0xf797('0x20')](_0x5272c2);}return _0x7222f9[_0xf797('0x21')]();};}function saveUpdates(_0x27b032,_0x32147a){return function(_0xcc1ba8){if(_0xcc1ba8){return _0xcc1ba8[_0xf797('0x22')](_0x27b032)[_0xf797('0x23')](function(_0x29c6bf){return _0x29c6bf;});}return null;};}function removeEntity(_0x1155d6,_0x1dadf1){return function(_0x15a801){if(_0x15a801){return _0x15a801[_0xf797('0x24')]()[_0xf797('0x23')](function(){_0x1155d6[_0xf797('0x17')](0xcc)[_0xf797('0x25')]();});}};}function handleEntityNotFound(_0x4a4976,_0x3e19b7){return function(_0x3b81bb){if(!_0x3b81bb){_0x4a4976[_0xf797('0x16')](0x194);}return _0x3b81bb;};}function handleError(_0x2ccf20,_0x1222cf){_0x1222cf=_0x1222cf||0x1f4;return function(_0x26926f){logger[_0xf797('0x26')](_0x26926f['stack']);if(_0x26926f[_0xf797('0x27')]){delete _0x26926f['name'];}_0x2ccf20['status'](_0x1222cf)[_0xf797('0x28')](_0x26926f);};}exports[_0xf797('0x29')]=function(_0x56c2c0,_0x1770d2){var _0x3190cc={},_0x40324c={},_0xc9c7f2={'count':0x0,'rows':[]};var _0x155c29=_[_0xf797('0x2a')](db[_0xf797('0x2b')][_0xf797('0x2c')],function(_0x110f50){return{'name':_0x110f50[_0xf797('0x2d')],'type':_0x110f50[_0xf797('0x2e')][_0xf797('0x2f')]};});_0x40324c[_0xf797('0x30')]=_[_0xf797('0x2a')](_0x155c29,_0xf797('0x27'));_0x40324c[_0xf797('0x31')]=_[_0xf797('0x32')](_0x56c2c0[_0xf797('0x31')]);_0x40324c[_0xf797('0x33')]=_[_0xf797('0x34')](_0x40324c[_0xf797('0x30')],_0x40324c[_0xf797('0x31')]);_0x3190cc['attributes']=_[_0xf797('0x34')](_0x40324c[_0xf797('0x30')],qs['fields'](_0x56c2c0[_0xf797('0x31')][_0xf797('0x35')]));_0x3190cc[_0xf797('0x36')]=_0x3190cc[_0xf797('0x36')][_0xf797('0x37')]?_0x3190cc[_0xf797('0x36')]:_0x40324c[_0xf797('0x30')];if(!_0x56c2c0[_0xf797('0x31')][_0xf797('0x38')](_0xf797('0x39'))){_0x3190cc[_0xf797('0x1b')]=qs[_0xf797('0x1b')](_0x56c2c0['query'][_0xf797('0x1b')]);_0x3190cc[_0xf797('0x18')]=qs[_0xf797('0x18')](_0x56c2c0[_0xf797('0x31')][_0xf797('0x18')]);}_0x3190cc['order']=qs[_0xf797('0x3a')](_0x56c2c0[_0xf797('0x31')]['sort']);_0x3190cc['where']=qs['filters'](_[_0xf797('0x3b')](_0x56c2c0['query'],_0x40324c['filters']),_0x155c29);if(_0x56c2c0[_0xf797('0x31')][_0xf797('0x3c')]){_0x3190cc[_0xf797('0x3d')]=_['merge'](_0x3190cc['where'],{'$or':_[_0xf797('0x2a')](_0x155c29,function(_0x11f27e){if(_0x11f27e[_0xf797('0x2e')]!==_0xf797('0x3e')){var _0x520d7a={};_0x520d7a[_0x11f27e[_0xf797('0x27')]]={'$like':'%'+_0x56c2c0['query']['filter']+'%'};return _0x520d7a;}})});}_0x3190cc=_[_0xf797('0x3f')]({},_0x3190cc,_0x56c2c0[_0xf797('0x40')]);var _0x139d6c={'where':_0x3190cc[_0xf797('0x3d')]};return db[_0xf797('0x2b')][_0xf797('0x1a')](_0x139d6c)[_0xf797('0x23')](function(_0x1ce934){_0xc9c7f2['count']=_0x1ce934;if(_0x56c2c0[_0xf797('0x31')][_0xf797('0x41')]){_0x3190cc[_0xf797('0x42')]=[{'all':!![]}];}return db[_0xf797('0x2b')]['findAll'](_0x3190cc);})[_0xf797('0x23')](function(_0x2fe23a){_0xc9c7f2[_0xf797('0x43')]=_0x2fe23a;return _0xc9c7f2;})['then'](respondWithFilteredResult(_0x1770d2,_0x3190cc))[_0xf797('0x44')](handleError(_0x1770d2,null));};exports[_0xf797('0x45')]=function(_0x13220a,_0xc3f668){var _0x597727={'raw':!![],'where':{'id':_0x13220a[_0xf797('0x46')]['id']}},_0x463e16={};_0x463e16[_0xf797('0x30')]=_['keys'](db[_0xf797('0x2b')][_0xf797('0x2c')]);_0x463e16[_0xf797('0x31')]=_[_0xf797('0x32')](_0x13220a[_0xf797('0x31')]);_0x463e16[_0xf797('0x33')]=_[_0xf797('0x34')](_0x463e16[_0xf797('0x30')],_0x463e16[_0xf797('0x31')]);_0x597727[_0xf797('0x36')]=_['intersection'](_0x463e16[_0xf797('0x30')],qs[_0xf797('0x35')](_0x13220a['query']['fields']));_0x597727[_0xf797('0x36')]=_0x597727['attributes'][_0xf797('0x37')]?_0x597727[_0xf797('0x36')]:_0x463e16[_0xf797('0x30')];if(_0x13220a[_0xf797('0x31')][_0xf797('0x41')]){_0x597727[_0xf797('0x42')]=[{'all':!![]}];}_0x597727=_['merge']({},_0x597727,_0x13220a[_0xf797('0x40')]);return db['AnalyticTreeReport'][_0xf797('0x47')](_0x597727)[_0xf797('0x23')](handleEntityNotFound(_0xc3f668,null))['then'](respondWithResult(_0xc3f668,null))[_0xf797('0x44')](handleError(_0xc3f668,null));};exports[_0xf797('0x48')]=function(_0x411599,_0x57878a){return db[_0xf797('0x2b')][_0xf797('0x48')](_0x411599['body'],{})[_0xf797('0x23')](respondWithResult(_0x57878a,0xc9))[_0xf797('0x44')](handleError(_0x57878a,null));};exports[_0xf797('0x22')]=function(_0x3c1c21,_0x16051c){if(_0x3c1c21[_0xf797('0x49')]['id']){delete _0x3c1c21[_0xf797('0x49')]['id'];}return db['AnalyticTreeReport'][_0xf797('0x47')]({'where':{'id':_0x3c1c21[_0xf797('0x46')]['id']}})['then'](handleEntityNotFound(_0x16051c,null))[_0xf797('0x23')](saveUpdates(_0x3c1c21[_0xf797('0x49')],null))['then'](respondWithResult(_0x16051c,null))['catch'](handleError(_0x16051c,null));};exports[_0xf797('0x24')]=function(_0x2c0336,_0x175ba3){return db[_0xf797('0x2b')][_0xf797('0x47')]({'where':{'id':_0x2c0336[_0xf797('0x46')]['id']}})[_0xf797('0x23')](handleEntityNotFound(_0x175ba3,null))['then'](removeEntity(_0x175ba3,null))[_0xf797('0x44')](handleError(_0x175ba3,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index eac431d..c4af719 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 _0xdeca=['exports','define','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes'];(function(_0x1fce52,_0x3b012c){var _0x3ca568=function(_0x1d3c35){while(--_0x1d3c35){_0x1fce52['push'](_0x1fce52['shift']());}};_0x3ca568(++_0x3b012c);}(_0xdeca,0xb6));var _0xadec=function(_0x252ddb,_0x32ecc8){_0x252ddb=_0x252ddb-0x0;var _0xdd78d5=_0xdeca[_0x252ddb];return _0xdd78d5;};'use strict';var _=require(_0xadec('0x0'));var util=require(_0xadec('0x1'));var logger=require(_0xadec('0x2'))('api');var moment=require('moment');var BPromise=require(_0xadec('0x3'));var rp=require(_0xadec('0x4'));var fs=require('fs');var path=require(_0xadec('0x5'));var rimraf=require(_0xadec('0x6'));var config=require('../../config/environment');var attributes=require(_0xadec('0x7'));module[_0xadec('0x8')]=function(_0x23b3f2,_0x49a317){return _0x23b3f2[_0xadec('0x9')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadfc=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','api','request-promise','path'];(function(_0x4152a9,_0x24d08d){var _0x3bb207=function(_0x59bb06){while(--_0x59bb06){_0x4152a9['push'](_0x4152a9['shift']());}};_0x3bb207(++_0x24d08d);}(_0xadfc,0x17c));var _0xcadf=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xadfc[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xcadf('0x0'));var util=require(_0xcadf('0x1'));var logger=require('../../config/logger')(_0xcadf('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcadf('0x3'));var fs=require('fs');var path=require(_0xcadf('0x4'));var rimraf=require(_0xcadf('0x5'));var config=require(_0xcadf('0x6'));var attributes=require(_0xcadf('0x7'));module[_0xcadf('0x8')]=function(_0x58621c,_0xb9010f){return _0x58621c[_0xcadf('0x9')](_0xcadf('0xa'),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 4a63c5f..680a392 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 _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(_0x3d1fb3,_0x2e5bb7){var _0x1361fe=function(_0x3d3a0d){while(--_0x3d3a0d){_0x3d1fb3['push'](_0x3d1fb3['shift']());}};_0x1361fe(++_0x2e5bb7);}(_0xdb28,0x106));var _0x8db2=function(_0x543617,_0x35b427){_0x543617=_0x543617-0x0;var _0x3178c4=_0xdb28[_0x543617];return _0x3178c4;};'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 +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x1b929c,_0x200c6a){var _0x52ca51=function(_0x3d5114){while(--_0x3d5114){_0x1b929c['push'](_0x1b929c['shift']());}};_0x52ca51(++_0x200c6a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xc4aa[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index c538433..6509ec7 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 _0x9723=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9723,0x1ce));var _0x3972=function(_0x3db122,_0x5e6bee){_0x3db122=_0x3db122-0x0;var _0x325b67=_0x9723[_0x3db122];return _0x325b67;};'use strict';var multer=require(_0x3972('0x0'));var util=require(_0x3972('0x1'));var path=require(_0x3972('0x2'));var timeout=require(_0x3972('0x3'));var express=require(_0x3972('0x4'));var router=express['Router']();var fs_extra=require(_0x3972('0x5'));var auth=require(_0x3972('0x6'));var interaction=require(_0x3972('0x7'));var config=require(_0x3972('0x8'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0x3972('0x9')](),controller['index']);router['get'](_0x3972('0xa'),auth['isAuthenticated'](),controller[_0x3972('0xb')]);router[_0x3972('0xc')]('/',auth[_0x3972('0x9')](),controller[_0x3972('0xd')]);router[_0x3972('0xe')](_0x3972('0xa'),auth[_0x3972('0x9')](),controller['update']);router[_0x3972('0xf')](_0x3972('0xa'),auth[_0x3972('0x9')](),controller[_0x3972('0x10')]);module[_0x3972('0x11')]=router; \ No newline at end of file +var _0x2922=['/:id','show','post','create','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x2922,0x15b));var _0x2292=function(_0x597cb7,_0x448d77){_0x597cb7=_0x597cb7-0x0;var _0x23e80a=_0x2922[_0x597cb7];return _0x23e80a;};'use strict';var multer=require(_0x2292('0x0'));var util=require(_0x2292('0x1'));var path=require(_0x2292('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2292('0x3')]();var fs_extra=require(_0x2292('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2292('0x5'));var config=require(_0x2292('0x6'));var controller=require(_0x2292('0x7'));router['get']('/',auth[_0x2292('0x8')](),controller[_0x2292('0x9')]);router['get'](_0x2292('0xa'),auth[_0x2292('0x8')](),controller[_0x2292('0xb')]);router[_0x2292('0xc')]('/',auth[_0x2292('0x8')](),controller[_0x2292('0xd')]);router['put'](_0x2292('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x2292('0xe')](_0x2292('0xa'),auth[_0x2292('0x8')](),controller[_0x2292('0xf')]);module[_0x2292('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 5eb5544..b11ab4f 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 _0x50a6=['exports','STRING','sequelize'];(function(_0x460fd7,_0x2012db){var _0x44d1c2=function(_0x545e11){while(--_0x545e11){_0x460fd7['push'](_0x460fd7['shift']());}};_0x44d1c2(++_0x2012db);}(_0x50a6,0xa4));var _0x650a=function(_0x1d5895,_0x1acd4a){_0x1d5895=_0x1d5895-0x0;var _0x12977e=_0x50a6[_0x1d5895];return _0x12977e;};'use strict';var Sequelize=require(_0x650a('0x0'));module[_0x650a('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x650a('0x2')]}}; \ No newline at end of file +var _0x8c99=['STRING','sequelize','exports'];(function(_0x143356,_0x5c9842){var _0x33ef23=function(_0x4962a7){while(--_0x4962a7){_0x143356['push'](_0x143356['shift']());}};_0x33ef23(++_0x5c9842);}(_0x8c99,0x1a8));var _0x98c9=function(_0x5af97c,_0x24a49f){_0x5af97c=_0x5af97c-0x0;var _0x3472ae=_0x8c99[_0x5af97c];return _0x3472ae;};'use strict';var Sequelize=require(_0x98c9('0x0'));module[_0x98c9('0x1')]={'name':{'type':Sequelize[_0x98c9('0x2')]},'basename':{'type':Sequelize[_0x98c9('0x2')]},'type':{'type':Sequelize[_0x98c9('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index ab2abda..bde6dba 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 _0x577c=['filename','download','findOne','server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','then','stack','name','map','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','Attachment','includeAll','findAll','rows','show','keys','include','options','find','catch','clone','params','get','omit','createdAt','updatedAt','create','update','body','destroy','file','originalname','basename'];(function(_0x2dacca,_0x3b55a5){var _0x4e8745=function(_0x4c4515){while(--_0x4c4515){_0x2dacca['push'](_0x2dacca['shift']());}};_0x4e8745(++_0x3b55a5);}(_0x577c,0x15e));var _0xc577=function(_0x3c1ca7,_0x264ab5){_0x3c1ca7=_0x3c1ca7-0x0;var _0x2f7e2f=_0x577c[_0x3c1ca7];return _0x2f7e2f;};'use strict';var emlformat=require(_0xc577('0x0'));var rimraf=require(_0xc577('0x1'));var zipdir=require(_0xc577('0x2'));var jsonpatch=require(_0xc577('0x3'));var rp=require('request-promise');var moment=require(_0xc577('0x4'));var BPromise=require(_0xc577('0x5'));var Mustache=require(_0xc577('0x6'));var util=require('util');var path=require(_0xc577('0x7'));var sox=require(_0xc577('0x8'));var csv=require(_0xc577('0x9'));var ejs=require(_0xc577('0xa'));var fs=require('fs');var fs_extra=require(_0xc577('0xb'));var _=require('lodash');var squel=require(_0xc577('0xc'));var crypto=require(_0xc577('0xd'));var jsforce=require(_0xc577('0xe'));var deskjs=require(_0xc577('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc577('0x10'));var authService=require(_0xc577('0x11'));var qs=require(_0xc577('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc577('0x13'))(_0xc577('0x14'));var utils=require('../../config/utils');var config=require(_0xc577('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc577('0x16'))['db'];function respondWithStatusCode(_0x2d41d1,_0x128a23){_0x128a23=_0x128a23||0xcc;return function(_0x28888b){if(_0x28888b){return _0x2d41d1[_0xc577('0x17')](_0x128a23);}return _0x2d41d1[_0xc577('0x18')](_0x128a23)[_0xc577('0x19')]();};}function respondWithResult(_0x10ec88,_0x21899b){_0x21899b=_0x21899b||0xc8;return function(_0x3de44a){if(_0x3de44a){return _0x10ec88[_0xc577('0x18')](_0x21899b)[_0xc577('0x1a')](_0x3de44a);}};}function respondWithFilteredResult(_0x323995,_0x7935f6){return function(_0x5c59c7){if(_0x5c59c7){var _0x56501c=typeof _0x7935f6['offset']===_0xc577('0x1b')&&typeof _0x7935f6[_0xc577('0x1c')]===_0xc577('0x1b');var _0xf170ed=_0x5c59c7[_0xc577('0x1d')];var _0x50bf9b=_0x56501c?0x0:_0x7935f6['offset'];var _0x1d69ab=_0x56501c?_0x5c59c7[_0xc577('0x1d')]:_0x7935f6[_0xc577('0x1e')]+_0x7935f6[_0xc577('0x1c')];var _0x16ed07;if(_0x1d69ab>=_0xf170ed){_0x1d69ab=_0xf170ed;_0x16ed07=0xc8;}else{_0x16ed07=0xce;}_0x323995[_0xc577('0x18')](_0x16ed07);return _0x323995[_0xc577('0x1f')](_0xc577('0x20'),_0x50bf9b+'-'+_0x1d69ab+'/'+_0xf170ed)[_0xc577('0x1a')](_0x5c59c7);}return null;};}function patchUpdates(_0x528069){return function(_0x48920b){try{jsonpatch[_0xc577('0x21')](_0x48920b,_0x528069,!![]);}catch(_0x2fabb0){return BPromise['reject'](_0x2fabb0);}return _0x48920b['save']();};}function saveUpdates(_0x1b84c3,_0x15c922){return function(_0x5843ee){if(_0x5843ee){return _0x5843ee['update'](_0x1b84c3)['then'](function(_0x5855cd){return _0x5855cd;});}return null;};}function removeEntity(_0x56d584,_0x14b8a6){return function(_0x38bc4b){if(_0x38bc4b){return _0x38bc4b['destroy']()[_0xc577('0x22')](function(){_0x56d584[_0xc577('0x18')](0xcc)[_0xc577('0x19')]();});}};}function handleEntityNotFound(_0x38d25d,_0x53fd02){return function(_0x161cb1){if(!_0x161cb1){_0x38d25d[_0xc577('0x17')](0x194);}return _0x161cb1;};}function handleError(_0x592586,_0x2b27a8){_0x2b27a8=_0x2b27a8||0x1f4;return function(_0x527987){logger['error'](_0x527987[_0xc577('0x23')]);if(_0x527987['name']){delete _0x527987[_0xc577('0x24')];}_0x592586[_0xc577('0x18')](_0x2b27a8)['send'](_0x527987);};}exports['index']=function(_0x11af9b,_0x5f1064){var _0xa50a72={},_0x268cbf={},_0x4348a0={'count':0x0,'rows':[]};var _0x290789=_[_0xc577('0x25')](db['Attachment'][_0xc577('0x26')],function(_0x2a95b6){return{'name':_0x2a95b6[_0xc577('0x27')],'type':_0x2a95b6[_0xc577('0x28')]['key']};});_0x268cbf['model']=_[_0xc577('0x25')](_0x290789,_0xc577('0x24'));_0x268cbf[_0xc577('0x29')]=_['keys'](_0x11af9b[_0xc577('0x29')]);_0x268cbf[_0xc577('0x2a')]=_[_0xc577('0x2b')](_0x268cbf['model'],_0x268cbf[_0xc577('0x29')]);_0xa50a72[_0xc577('0x2c')]=_[_0xc577('0x2b')](_0x268cbf[_0xc577('0x2d')],qs[_0xc577('0x2e')](_0x11af9b[_0xc577('0x29')][_0xc577('0x2e')]));_0xa50a72[_0xc577('0x2c')]=_0xa50a72[_0xc577('0x2c')][_0xc577('0x2f')]?_0xa50a72[_0xc577('0x2c')]:_0x268cbf[_0xc577('0x2d')];if(!_0x11af9b[_0xc577('0x29')][_0xc577('0x30')](_0xc577('0x31'))){_0xa50a72[_0xc577('0x1c')]=qs[_0xc577('0x1c')](_0x11af9b['query'][_0xc577('0x1c')]);_0xa50a72[_0xc577('0x1e')]=qs[_0xc577('0x1e')](_0x11af9b['query'][_0xc577('0x1e')]);}_0xa50a72[_0xc577('0x32')]=qs[_0xc577('0x33')](_0x11af9b['query']['sort']);_0xa50a72[_0xc577('0x34')]=qs['filters'](_[_0xc577('0x35')](_0x11af9b[_0xc577('0x29')],_0x268cbf[_0xc577('0x2a')]),_0x290789);if(_0x11af9b[_0xc577('0x29')]['filter']){_0xa50a72[_0xc577('0x34')]=_[_0xc577('0x36')](_0xa50a72['where'],{'$or':_[_0xc577('0x25')](_0x290789,function(_0xf5e624){if(_0xf5e624[_0xc577('0x28')]!==_0xc577('0x37')){var _0x134dea={};_0x134dea[_0xf5e624[_0xc577('0x24')]]={'$like':'%'+_0x11af9b[_0xc577('0x29')][_0xc577('0x38')]+'%'};return _0x134dea;}})});}_0xa50a72=_[_0xc577('0x36')]({},_0xa50a72,_0x11af9b['options']);var _0x452c03={'where':_0xa50a72[_0xc577('0x34')]};return db[_0xc577('0x39')][_0xc577('0x1d')](_0x452c03)['then'](function(_0x437374){_0x4348a0[_0xc577('0x1d')]=_0x437374;if(_0x11af9b[_0xc577('0x29')][_0xc577('0x3a')]){_0xa50a72['include']=[{'all':!![]}];}return db[_0xc577('0x39')][_0xc577('0x3b')](_0xa50a72);})[_0xc577('0x22')](function(_0x178878){_0x4348a0[_0xc577('0x3c')]=_0x178878;return _0x4348a0;})[_0xc577('0x22')](respondWithFilteredResult(_0x5f1064,_0xa50a72))['catch'](handleError(_0x5f1064,null));};exports[_0xc577('0x3d')]=function(_0x2319f1,_0x2d3302){var _0x4758c4={'raw':!![],'where':{'id':_0x2319f1['params']['id']}},_0x2d8f74={};_0x2d8f74[_0xc577('0x2d')]=_['keys'](db[_0xc577('0x39')][_0xc577('0x26')]);_0x2d8f74['query']=_[_0xc577('0x3e')](_0x2319f1['query']);_0x2d8f74[_0xc577('0x2a')]=_[_0xc577('0x2b')](_0x2d8f74[_0xc577('0x2d')],_0x2d8f74['query']);_0x4758c4[_0xc577('0x2c')]=_[_0xc577('0x2b')](_0x2d8f74[_0xc577('0x2d')],qs[_0xc577('0x2e')](_0x2319f1[_0xc577('0x29')][_0xc577('0x2e')]));_0x4758c4['attributes']=_0x4758c4['attributes'][_0xc577('0x2f')]?_0x4758c4[_0xc577('0x2c')]:_0x2d8f74[_0xc577('0x2d')];if(_0x2319f1[_0xc577('0x29')]['includeAll']){_0x4758c4[_0xc577('0x3f')]=[{'all':!![]}];}_0x4758c4=_[_0xc577('0x36')]({},_0x4758c4,_0x2319f1[_0xc577('0x40')]);return db[_0xc577('0x39')][_0xc577('0x41')](_0x4758c4)[_0xc577('0x22')](handleEntityNotFound(_0x2d3302,null))['then'](respondWithResult(_0x2d3302,null))[_0xc577('0x42')](handleError(_0x2d3302,null));};exports[_0xc577('0x43')]=function(_0x2579cf,_0xa33745){var _0x2b71f8={'where':{'id':_0x2579cf[_0xc577('0x44')]['id']}},_0x1db00c={};_0x1db00c[_0xc577('0x2d')]=_[_0xc577('0x3e')](db[_0xc577('0x39')]['rawAttributes']);_0x2b71f8['attributes']=_['intersection'](_0x1db00c[_0xc577('0x2d')],qs[_0xc577('0x2e')](_0x2579cf[_0xc577('0x29')]['fields']));_0x2b71f8[_0xc577('0x2c')]=_0x2b71f8[_0xc577('0x2c')][_0xc577('0x2f')]?_0x2b71f8[_0xc577('0x2c')]:_0x1db00c[_0xc577('0x2d')];if(_0x2579cf['query'][_0xc577('0x3a')]){_0x2b71f8[_0xc577('0x3f')]=[{'all':!![]}];}_0x2b71f8=_[_0xc577('0x36')]({},_0x2b71f8,_0x2579cf['options']);return db[_0xc577('0x39')][_0xc577('0x41')](_0x2b71f8)[_0xc577('0x22')](handleEntityNotFound(_0xa33745,null))[_0xc577('0x22')](function(_0x3523d6){if(_0x3523d6){var _0x2a9298=_0x3523d6[_0xc577('0x45')]({'plain':!![]});_0x2a9298=qs[_0xc577('0x46')](_0x2a9298,['id',_0xc577('0x47'),_0xc577('0x48')]);_0x2579cf['body']=_[_0xc577('0x46')](_0x2579cf['body'],['id',_0xc577('0x47'),_0xc577('0x48')]);return db['Attachment'][_0xc577('0x49')](_[_0xc577('0x36')](_0x2a9298,_0x2579cf['body']),{'include':_0x2579cf['query'][_0xc577('0x3a')]?[{'all':!![]}]:undefined});}})[_0xc577('0x22')](respondWithResult(_0xa33745,0xc9))['catch'](handleError(_0xa33745,null));};exports[_0xc577('0x4a')]=function(_0x2184e4,_0x4fa08a){if(_0x2184e4[_0xc577('0x4b')]['id']){delete _0x2184e4[_0xc577('0x4b')]['id'];}return db[_0xc577('0x39')][_0xc577('0x41')]({'where':{'id':_0x2184e4[_0xc577('0x44')]['id']}})['then'](handleEntityNotFound(_0x4fa08a,null))[_0xc577('0x22')](saveUpdates(_0x2184e4[_0xc577('0x4b')],null))[_0xc577('0x22')](respondWithResult(_0x4fa08a,null))[_0xc577('0x42')](handleError(_0x4fa08a,null));};exports[_0xc577('0x4c')]=function(_0x22b967,_0x344299){return db[_0xc577('0x39')][_0xc577('0x41')]({'where':{'id':_0x22b967['params']['id']}})[_0xc577('0x22')](handleEntityNotFound(_0x344299,null))[_0xc577('0x22')](removeEntity(_0x344299,null))[_0xc577('0x42')](handleError(_0x344299,null));};exports[_0xc577('0x49')]=function(_0x1f7521,_0x169036,_0x20c036){_0x1f7521['body'][_0xc577('0x24')]=_0x1f7521[_0xc577('0x4d')][_0xc577('0x4e')];_0x1f7521[_0xc577('0x4b')][_0xc577('0x4f')]=_0x1f7521[_0xc577('0x4d')][_0xc577('0x50')];_0x1f7521[_0xc577('0x4b')][_0xc577('0x28')]=_0x1f7521['file']['mimetype'];return db[_0xc577('0x39')][_0xc577('0x49')](_0x1f7521[_0xc577('0x4b')])[_0xc577('0x22')](respondWithResult(_0x169036,0xc9))[_0xc577('0x42')](handleError(_0x169036,null));};exports[_0xc577('0x51')]=function(_0x13efdf,_0xc0b259,_0x402f8c){return db['Attachment'][_0xc577('0x52')]({'where':{'id':_0x13efdf['params']['id']},'raw':!![]})[_0xc577('0x22')](handleEntityNotFound(_0xc0b259,null))[_0xc577('0x22')](function(_0x4f8b7b){if(_0x4f8b7b){var _0x3b9453=_0x4f8b7b['ChatOfflineMessageId']!==null;var _0x5e7adf=path['join'](config['root'],_0xc577('0x53'));if(_0x3b9453){_0x5e7adf=path[_0xc577('0x54')](_0x5e7adf,_0xc577('0x55'));}var _0x3f2feb=path['join'](_0x5e7adf,_0x4f8b7b['basename']);return _0xc0b259[_0xc577('0x51')](_0x3f2feb);}})[_0xc577('0x42')](handleError(_0xc0b259,null));}; \ No newline at end of file +var _0x1bc5=['download','ChatOfflineMessageId','root','server/files/attachments/','join','basename','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','Attachment','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','rawAttributes','includeAll','find','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','filename','mimetype'];(function(_0x59c9e7,_0x37fb5c){var _0x4777be=function(_0x22310d){while(--_0x22310d){_0x59c9e7['push'](_0x59c9e7['shift']());}};_0x4777be(++_0x37fb5c);}(_0x1bc5,0x1b9));var _0x51bc=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x1bc5[_0x550d12];return _0x12103d;};'use strict';var emlformat=require(_0x51bc('0x0'));var rimraf=require(_0x51bc('0x1'));var zipdir=require(_0x51bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x51bc('0x3'));var moment=require(_0x51bc('0x4'));var BPromise=require(_0x51bc('0x5'));var Mustache=require(_0x51bc('0x6'));var util=require(_0x51bc('0x7'));var path=require(_0x51bc('0x8'));var sox=require(_0x51bc('0x9'));var csv=require(_0x51bc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51bc('0xb'));var _=require('lodash');var squel=require(_0x51bc('0xc'));var crypto=require(_0x51bc('0xd'));var jsforce=require(_0x51bc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x51bc('0xa'));var querystring=require('querystring');var Papa=require(_0x51bc('0xf'));var Redis=require('ioredis');var authService=require(_0x51bc('0x10'));var qs=require(_0x51bc('0x11'));var as=require(_0x51bc('0x12'));var hardwareService=require(_0x51bc('0x13'));var logger=require(_0x51bc('0x14'))('api');var utils=require(_0x51bc('0x15'));var config=require(_0x51bc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x51bc('0x17'))['db'];function respondWithStatusCode(_0x1b7888,_0x2179d7){_0x2179d7=_0x2179d7||0xcc;return function(_0x1e379a){if(_0x1e379a){return _0x1b7888[_0x51bc('0x18')](_0x2179d7);}return _0x1b7888[_0x51bc('0x19')](_0x2179d7)[_0x51bc('0x1a')]();};}function respondWithResult(_0x321848,_0x1a9b4a){_0x1a9b4a=_0x1a9b4a||0xc8;return function(_0x3e413a){if(_0x3e413a){return _0x321848[_0x51bc('0x19')](_0x1a9b4a)[_0x51bc('0x1b')](_0x3e413a);}};}function respondWithFilteredResult(_0x5cd304,_0xa59767){return function(_0x3f6268){if(_0x3f6268){var _0x1ef8ef=typeof _0xa59767[_0x51bc('0x1c')]===_0x51bc('0x1d')&&typeof _0xa59767[_0x51bc('0x1e')]==='undefined';var _0x35b38b=_0x3f6268[_0x51bc('0x1f')];var _0x5d246b=_0x1ef8ef?0x0:_0xa59767[_0x51bc('0x1c')];var _0x43a932=_0x1ef8ef?_0x3f6268['count']:_0xa59767[_0x51bc('0x1c')]+_0xa59767['limit'];var _0x4c34e1;if(_0x43a932>=_0x35b38b){_0x43a932=_0x35b38b;_0x4c34e1=0xc8;}else{_0x4c34e1=0xce;}_0x5cd304[_0x51bc('0x19')](_0x4c34e1);return _0x5cd304[_0x51bc('0x20')](_0x51bc('0x21'),_0x5d246b+'-'+_0x43a932+'/'+_0x35b38b)[_0x51bc('0x1b')](_0x3f6268);}return null;};}function patchUpdates(_0x53f138){return function(_0x258b37){try{jsonpatch[_0x51bc('0x22')](_0x258b37,_0x53f138,!![]);}catch(_0x4e3db9){return BPromise[_0x51bc('0x23')](_0x4e3db9);}return _0x258b37['save']();};}function saveUpdates(_0x167c11,_0x32e92a){return function(_0x26c101){if(_0x26c101){return _0x26c101[_0x51bc('0x24')](_0x167c11)[_0x51bc('0x25')](function(_0x129890){return _0x129890;});}return null;};}function removeEntity(_0x1da8ea,_0x409afc){return function(_0x91ed12){if(_0x91ed12){return _0x91ed12[_0x51bc('0x26')]()['then'](function(){_0x1da8ea[_0x51bc('0x19')](0xcc)[_0x51bc('0x1a')]();});}};}function handleEntityNotFound(_0x1c739e,_0xf015d1){return function(_0x41b575){if(!_0x41b575){_0x1c739e[_0x51bc('0x18')](0x194);}return _0x41b575;};}function handleError(_0x2e8654,_0x5398c5){_0x5398c5=_0x5398c5||0x1f4;return function(_0x32cffc){logger[_0x51bc('0x27')](_0x32cffc['stack']);if(_0x32cffc[_0x51bc('0x28')]){delete _0x32cffc[_0x51bc('0x28')];}_0x2e8654['status'](_0x5398c5)[_0x51bc('0x29')](_0x32cffc);};}exports[_0x51bc('0x2a')]=function(_0x307a7b,_0x3f1a4d){var _0x35eed4={},_0x5a3409={},_0x4dde76={'count':0x0,'rows':[]};var _0x276903=_[_0x51bc('0x2b')](db[_0x51bc('0x2c')]['rawAttributes'],function(_0x1f8a0b){return{'name':_0x1f8a0b['fieldName'],'type':_0x1f8a0b['type']['key']};});_0x5a3409[_0x51bc('0x2d')]=_[_0x51bc('0x2b')](_0x276903,_0x51bc('0x28'));_0x5a3409[_0x51bc('0x2e')]=_[_0x51bc('0x2f')](_0x307a7b[_0x51bc('0x2e')]);_0x5a3409[_0x51bc('0x30')]=_[_0x51bc('0x31')](_0x5a3409[_0x51bc('0x2d')],_0x5a3409[_0x51bc('0x2e')]);_0x35eed4[_0x51bc('0x32')]=_[_0x51bc('0x31')](_0x5a3409[_0x51bc('0x2d')],qs[_0x51bc('0x33')](_0x307a7b[_0x51bc('0x2e')][_0x51bc('0x33')]));_0x35eed4[_0x51bc('0x32')]=_0x35eed4[_0x51bc('0x32')][_0x51bc('0x34')]?_0x35eed4[_0x51bc('0x32')]:_0x5a3409[_0x51bc('0x2d')];if(!_0x307a7b[_0x51bc('0x2e')][_0x51bc('0x35')](_0x51bc('0x36'))){_0x35eed4[_0x51bc('0x1e')]=qs['limit'](_0x307a7b[_0x51bc('0x2e')][_0x51bc('0x1e')]);_0x35eed4[_0x51bc('0x1c')]=qs[_0x51bc('0x1c')](_0x307a7b['query'][_0x51bc('0x1c')]);}_0x35eed4[_0x51bc('0x37')]=qs[_0x51bc('0x38')](_0x307a7b[_0x51bc('0x2e')]['sort']);_0x35eed4[_0x51bc('0x39')]=qs['filters'](_[_0x51bc('0x3a')](_0x307a7b[_0x51bc('0x2e')],_0x5a3409[_0x51bc('0x30')]),_0x276903);if(_0x307a7b[_0x51bc('0x2e')][_0x51bc('0x3b')]){_0x35eed4[_0x51bc('0x39')]=_[_0x51bc('0x3c')](_0x35eed4['where'],{'$or':_[_0x51bc('0x2b')](_0x276903,function(_0x3d1fcb){if(_0x3d1fcb['type']!==_0x51bc('0x3d')){var _0x452a54={};_0x452a54[_0x3d1fcb['name']]={'$like':'%'+_0x307a7b['query'][_0x51bc('0x3b')]+'%'};return _0x452a54;}})});}_0x35eed4=_['merge']({},_0x35eed4,_0x307a7b[_0x51bc('0x3e')]);var _0x1676f5={'where':_0x35eed4[_0x51bc('0x39')]};return db[_0x51bc('0x2c')][_0x51bc('0x1f')](_0x1676f5)[_0x51bc('0x25')](function(_0x32140a){_0x4dde76[_0x51bc('0x1f')]=_0x32140a;if(_0x307a7b[_0x51bc('0x2e')]['includeAll']){_0x35eed4[_0x51bc('0x3f')]=[{'all':!![]}];}return db[_0x51bc('0x2c')][_0x51bc('0x40')](_0x35eed4);})[_0x51bc('0x25')](function(_0x304739){_0x4dde76['rows']=_0x304739;return _0x4dde76;})[_0x51bc('0x25')](respondWithFilteredResult(_0x3f1a4d,_0x35eed4))[_0x51bc('0x41')](handleError(_0x3f1a4d,null));};exports['show']=function(_0x1e874b,_0x41f265){var _0x50dcb1={'raw':!![],'where':{'id':_0x1e874b[_0x51bc('0x42')]['id']}},_0x151a38={};_0x151a38[_0x51bc('0x2d')]=_['keys'](db['Attachment'][_0x51bc('0x43')]);_0x151a38[_0x51bc('0x2e')]=_['keys'](_0x1e874b['query']);_0x151a38[_0x51bc('0x30')]=_[_0x51bc('0x31')](_0x151a38[_0x51bc('0x2d')],_0x151a38['query']);_0x50dcb1['attributes']=_[_0x51bc('0x31')](_0x151a38[_0x51bc('0x2d')],qs['fields'](_0x1e874b['query']['fields']));_0x50dcb1[_0x51bc('0x32')]=_0x50dcb1[_0x51bc('0x32')][_0x51bc('0x34')]?_0x50dcb1[_0x51bc('0x32')]:_0x151a38[_0x51bc('0x2d')];if(_0x1e874b[_0x51bc('0x2e')][_0x51bc('0x44')]){_0x50dcb1[_0x51bc('0x3f')]=[{'all':!![]}];}_0x50dcb1=_[_0x51bc('0x3c')]({},_0x50dcb1,_0x1e874b[_0x51bc('0x3e')]);return db[_0x51bc('0x2c')][_0x51bc('0x45')](_0x50dcb1)[_0x51bc('0x25')](handleEntityNotFound(_0x41f265,null))[_0x51bc('0x25')](respondWithResult(_0x41f265,null))[_0x51bc('0x41')](handleError(_0x41f265,null));};exports[_0x51bc('0x46')]=function(_0x564eed,_0x1b9fe6){var _0x32375e={'where':{'id':_0x564eed[_0x51bc('0x42')]['id']}},_0x249bfb={};_0x249bfb[_0x51bc('0x2d')]=_[_0x51bc('0x2f')](db[_0x51bc('0x2c')]['rawAttributes']);_0x32375e['attributes']=_[_0x51bc('0x31')](_0x249bfb[_0x51bc('0x2d')],qs[_0x51bc('0x33')](_0x564eed[_0x51bc('0x2e')][_0x51bc('0x33')]));_0x32375e[_0x51bc('0x32')]=_0x32375e[_0x51bc('0x32')][_0x51bc('0x34')]?_0x32375e[_0x51bc('0x32')]:_0x249bfb[_0x51bc('0x2d')];if(_0x564eed[_0x51bc('0x2e')][_0x51bc('0x44')]){_0x32375e[_0x51bc('0x3f')]=[{'all':!![]}];}_0x32375e=_[_0x51bc('0x3c')]({},_0x32375e,_0x564eed['options']);return db['Attachment'][_0x51bc('0x45')](_0x32375e)[_0x51bc('0x25')](handleEntityNotFound(_0x1b9fe6,null))[_0x51bc('0x25')](function(_0x778a8b){if(_0x778a8b){var _0x3e8d74=_0x778a8b[_0x51bc('0x47')]({'plain':!![]});_0x3e8d74=qs[_0x51bc('0x48')](_0x3e8d74,['id',_0x51bc('0x49'),_0x51bc('0x4a')]);_0x564eed[_0x51bc('0x4b')]=_[_0x51bc('0x48')](_0x564eed[_0x51bc('0x4b')],['id','createdAt','updatedAt']);return db[_0x51bc('0x2c')][_0x51bc('0x4c')](_['merge'](_0x3e8d74,_0x564eed['body']),{'include':_0x564eed[_0x51bc('0x2e')][_0x51bc('0x44')]?[{'all':!![]}]:undefined});}})[_0x51bc('0x25')](respondWithResult(_0x1b9fe6,0xc9))[_0x51bc('0x41')](handleError(_0x1b9fe6,null));};exports[_0x51bc('0x24')]=function(_0x42debf,_0x203278){if(_0x42debf['body']['id']){delete _0x42debf[_0x51bc('0x4b')]['id'];}return db[_0x51bc('0x2c')]['find']({'where':{'id':_0x42debf[_0x51bc('0x42')]['id']}})[_0x51bc('0x25')](handleEntityNotFound(_0x203278,null))[_0x51bc('0x25')](saveUpdates(_0x42debf[_0x51bc('0x4b')],null))[_0x51bc('0x25')](respondWithResult(_0x203278,null))[_0x51bc('0x41')](handleError(_0x203278,null));};exports['destroy']=function(_0x502c11,_0x40a825){return db[_0x51bc('0x2c')][_0x51bc('0x45')]({'where':{'id':_0x502c11[_0x51bc('0x42')]['id']}})[_0x51bc('0x25')](handleEntityNotFound(_0x40a825,null))[_0x51bc('0x25')](removeEntity(_0x40a825,null))[_0x51bc('0x41')](handleError(_0x40a825,null));};exports['create']=function(_0x4d4b43,_0xf5a251,_0x22bb16){_0x4d4b43['body']['name']=_0x4d4b43[_0x51bc('0x4d')][_0x51bc('0x4e')];_0x4d4b43[_0x51bc('0x4b')]['basename']=_0x4d4b43[_0x51bc('0x4d')][_0x51bc('0x4f')];_0x4d4b43[_0x51bc('0x4b')]['type']=_0x4d4b43['file'][_0x51bc('0x50')];return db[_0x51bc('0x2c')]['create'](_0x4d4b43[_0x51bc('0x4b')])[_0x51bc('0x25')](respondWithResult(_0xf5a251,0xc9))[_0x51bc('0x41')](handleError(_0xf5a251,null));};exports[_0x51bc('0x51')]=function(_0x9e9dd5,_0xb44325,_0x82dbba){return db[_0x51bc('0x2c')]['findOne']({'where':{'id':_0x9e9dd5[_0x51bc('0x42')]['id']},'raw':!![]})[_0x51bc('0x25')](handleEntityNotFound(_0xb44325,null))['then'](function(_0x421947){if(_0x421947){var _0x6db193=_0x421947[_0x51bc('0x52')]!==null;var _0x2b5453=path['join'](config[_0x51bc('0x53')],_0x51bc('0x54'));if(_0x6db193){_0x2b5453=path['join'](_0x2b5453,'offline-chat/');}var _0x2f3eaf=path[_0x51bc('0x55')](_0x2b5453,_0x421947[_0x51bc('0x56')]);return _0xb44325[_0x51bc('0x51')](_0x2f3eaf);}})[_0x51bc('0x41')](handleError(_0xb44325,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 311d565..4a79cee 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 _0xd3bd=['./attachment.attributes','exports','define','attachments','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0xd3bd,0x14e));var _0xdd3b=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xd3bd[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0xdd3b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdd3b('0x1'));var moment=require('moment');var BPromise=require(_0xdd3b('0x2'));var rp=require(_0xdd3b('0x3'));var fs=require('fs');var path=require(_0xdd3b('0x4'));var rimraf=require(_0xdd3b('0x5'));var config=require('../../config/environment');var attributes=require(_0xdd3b('0x6'));module[_0xdd3b('0x7')]=function(_0x3318a1,_0x32b833){return _0x3318a1[_0xdd3b('0x8')]('Attachment',attributes,{'tableName':_0xdd3b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcac=['rimraf','../../config/environment','./attachment.attributes','define','Attachment','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x129f65,_0x195173){var _0x428657=function(_0x31de88){while(--_0x31de88){_0x129f65['push'](_0x129f65['shift']());}};_0x428657(++_0x195173);}(_0xfcac,0xc5));var _0xcfca=function(_0x3c30f3,_0x2380ef){_0x3c30f3=_0x3c30f3-0x0;var _0x492cbb=_0xfcac[_0x3c30f3];return _0x492cbb;};'use strict';var _=require(_0xcfca('0x0'));var util=require(_0xcfca('0x1'));var logger=require(_0xcfca('0x2'))('api');var moment=require(_0xcfca('0x3'));var BPromise=require(_0xcfca('0x4'));var rp=require(_0xcfca('0x5'));var fs=require('fs');var path=require(_0xcfca('0x6'));var rimraf=require(_0xcfca('0x7'));var config=require(_0xcfca('0x8'));var attributes=require(_0xcfca('0x9'));module['exports']=function(_0x4cf2ad,_0x4d13e9){return _0x4cf2ad[_0xcfca('0xa')](_0xcfca('0xb'),attributes,{'tableName':'attachments','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 c7604f7..fbed451 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 _0xc125=['request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','body','options','raw','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x239908,_0x17fa86){var _0x5981dc=function(_0xdeea7e){while(--_0xdeea7e){_0x239908['push'](_0x239908['shift']());}};_0x5981dc(++_0x17fa86);}(_0xc125,0x150));var _0x5c12=function(_0x16775d,_0x512c02){_0x16775d=_0x16775d-0x0;var _0x46fb98=_0xc125[_0x16775d];return _0x46fb98;};'use strict';var _=require('lodash');var util=require(_0x5c12('0x0'));var moment=require('moment');var BPromise=require(_0x5c12('0x1'));var rs=require(_0x5c12('0x2'));var fs=require('fs');var Redis=require(_0x5c12('0x3'));var db=require(_0x5c12('0x4'))['db'];var utils=require(_0x5c12('0x5'));var logger=require(_0x5c12('0x6'))(_0x5c12('0x7'));var config=require(_0x5c12('0x8'));var jayson=require(_0x5c12('0x9'));var client=jayson[_0x5c12('0xa')][_0x5c12('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11ace0,_0x4cab65,_0x1d0635){return new BPromise(function(_0x4465e3,_0x52a111){return client[_0x5c12('0xc')](_0x11ace0,_0x1d0635)[_0x5c12('0xd')](function(_0x3f7347){logger[_0x5c12('0xe')](_0x5c12('0xf'),_0x4cab65,_0x5c12('0x10'));logger[_0x5c12('0x11')](_0x5c12('0x12'),_0x4cab65,'request\x20sent',JSON[_0x5c12('0x13')](_0x3f7347));if(_0x3f7347[_0x5c12('0x14')]){if(_0x3f7347[_0x5c12('0x14')][_0x5c12('0x15')]===0x1f4){logger[_0x5c12('0x14')]('Attachment,\x20%s,\x20%s',_0x4cab65,_0x3f7347['error'][_0x5c12('0x16')]);return _0x52a111(_0x3f7347['error'][_0x5c12('0x16')]);}logger[_0x5c12('0x14')](_0x5c12('0xf'),_0x4cab65,_0x3f7347['error']['message']);return _0x4465e3(_0x3f7347[_0x5c12('0x14')][_0x5c12('0x16')]);}else{logger['info'](_0x5c12('0xf'),_0x4cab65,_0x5c12('0x10'));_0x4465e3(_0x3f7347[_0x5c12('0x17')]['message']);}})['catch'](function(_0x1d6487){logger[_0x5c12('0x14')](_0x5c12('0xf'),_0x4cab65,_0x1d6487);_0x52a111(_0x1d6487);});});}exports[_0x5c12('0x18')]=function(_0x1bd895){var _0xf1daab=this;return new Promise(function(_0x16543f,_0x2a6528){return db['Attachment']['create'](_0x1bd895[_0x5c12('0x19')],{'raw':_0x1bd895[_0x5c12('0x1a')]?_0x1bd895[_0x5c12('0x1a')][_0x5c12('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3ea1b5){logger['info'](_0x5c12('0x18'),_0x1bd895);logger[_0x5c12('0x11')]('CreateAttachment',_0x1bd895,JSON['stringify'](_0x3ea1b5));_0x16543f(_0x3ea1b5);})[_0x5c12('0x1c')](function(_0x5f7e40){logger['error'](_0x5c12('0x18'),_0x5f7e40['message'],_0x1bd895);_0x2a6528(_0xf1daab[_0x5c12('0x14')](0x1f4,_0x5f7e40[_0x5c12('0x16')]));});});}; \ No newline at end of file +var _0x780f=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateAttachment','Attachment','body','options','raw','then','stringify'];(function(_0x454426,_0x382598){var _0x3d71ae=function(_0x59c0d2){while(--_0x59c0d2){_0x454426['push'](_0x454426['shift']());}};_0x3d71ae(++_0x382598);}(_0x780f,0x6c));var _0xf780=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x780f[_0x23b655];return _0x364b32;};'use strict';var _=require(_0xf780('0x0'));var util=require(_0xf780('0x1'));var moment=require(_0xf780('0x2'));var BPromise=require(_0xf780('0x3'));var rs=require(_0xf780('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf780('0x5'));var logger=require(_0xf780('0x6'))(_0xf780('0x7'));var config=require(_0xf780('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf780('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bd856,_0x93539d,_0x1c3fdc){return new BPromise(function(_0xa12d00,_0x44f14c){return client[_0xf780('0xa')](_0x1bd856,_0x1c3fdc)['then'](function(_0x2c8221){logger[_0xf780('0xb')](_0xf780('0xc'),_0x93539d,_0xf780('0xd'));logger[_0xf780('0xe')](_0xf780('0xf'),_0x93539d,_0xf780('0xd'),JSON['stringify'](_0x2c8221));if(_0x2c8221['error']){if(_0x2c8221[_0xf780('0x10')][_0xf780('0x11')]===0x1f4){logger[_0xf780('0x10')](_0xf780('0xc'),_0x93539d,_0x2c8221['error'][_0xf780('0x12')]);return _0x44f14c(_0x2c8221[_0xf780('0x10')][_0xf780('0x12')]);}logger[_0xf780('0x10')]('Attachment,\x20%s,\x20%s',_0x93539d,_0x2c8221[_0xf780('0x10')]['message']);return _0xa12d00(_0x2c8221[_0xf780('0x10')][_0xf780('0x12')]);}else{logger[_0xf780('0xb')](_0xf780('0xc'),_0x93539d,_0xf780('0xd'));_0xa12d00(_0x2c8221[_0xf780('0x13')][_0xf780('0x12')]);}})['catch'](function(_0x450198){logger[_0xf780('0x10')](_0xf780('0xc'),_0x93539d,_0x450198);_0x44f14c(_0x450198);});});}exports[_0xf780('0x14')]=function(_0x5d5a81){var _0x188554=this;return new Promise(function(_0x53dfee,_0x3ede41){return db[_0xf780('0x15')]['create'](_0x5d5a81[_0xf780('0x16')],{'raw':_0x5d5a81[_0xf780('0x17')]?_0x5d5a81['options'][_0xf780('0x18')]===undefined?!![]:![]:!![]})[_0xf780('0x19')](function(_0x3c7054){logger[_0xf780('0xb')](_0xf780('0x14'),_0x5d5a81);logger[_0xf780('0xe')]('CreateAttachment',_0x5d5a81,JSON[_0xf780('0x1a')](_0x3c7054));_0x53dfee(_0x3c7054);})['catch'](function(_0x5853ea){logger[_0xf780('0x10')](_0xf780('0x14'),_0x5853ea[_0xf780('0x12')],_0x5d5a81);_0x3ede41(_0x188554['error'](0x1f4,_0x5853ea[_0xf780('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 538e603..b5e8166 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xbc2d60,_0x1874b4){var _0x5d30ba=function(_0x58a70c){while(--_0x58a70c){_0xbc2d60['push'](_0xbc2d60['shift']());}};_0x5d30ba(++_0x1874b4);}(_0x2032,0xd9));var _0x2203=function(_0x401564,_0x3021a5){_0x401564=_0x401564-0x0;var _0x34eed6=_0x2032[_0x401564];return _0x34eed6;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x431ac7,_0x348c8d){var _0x20b0cf=function(_0x58305e){while(--_0x58305e){_0x431ac7['push'](_0x431ac7['shift']());}};_0x20b0cf(++_0x348c8d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x47b294,_0x17c3d9){_0x47b294=_0x47b294-0x0;var _0x5bd98c=_0x5f2f[_0x47b294];return _0x5bd98c;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index f7d3fc2..0b9ade8 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 _0x2f6f=['Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blocked','admin','blockedAt','add','blockDuration','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','password','User','passport','Strategy','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/logger','undefined','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x3d34f0,_0x4a5dc0){var _0x135ecd=function(_0x9a81d5){while(--_0x9a81d5){_0x3d34f0['push'](_0x3d34f0['shift']());}};_0x135ecd(++_0x4a5dc0);}(_0x2f6f,0x102));var _0xf2f6=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2f6f[_0x1facfa];return _0x9ec701;};'use strict';var passport=require(_0xf2f6('0x0'));var LocalStrategy=require('passport-local')[_0xf2f6('0x1')];var moment=require('moment');var ActiveDirectory=require(_0xf2f6('0x2'));var BPromise=require(_0xf2f6('0x3'));var util=require('util');var db=require(_0xf2f6('0x4'))['db'];var authService=require(_0xf2f6('0x5'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0xf2f6('0x6'))('api');function isActiveDirectoryConfigured(_0x406ca9){var _0x5707fb=![];if(typeof _0x406ca9['activedirectory']!==_0xf2f6('0x7')){_0x5707fb=_0x406ca9[_0xf2f6('0x8')][_0xf2f6('0x9')]&&_0x406ca9[_0xf2f6('0x8')][_0xf2f6('0xa')]&&_0x406ca9[_0xf2f6('0x8')][_0xf2f6('0xb')];}return _0x5707fb;}function adAuthenticate(_0x33bfe7,_0x3bc54f,_0x339078){return new BPromise(function(_0x17106b,_0x1b721d){try{var _0xdafc96=new ActiveDirectory(_0x33bfe7);_0xdafc96[_0xf2f6('0xc')](_0x3bc54f,_0x339078,function(_0x341841,_0xe760a){if(_0x341841){logger[_0xf2f6('0xd')](_0xf2f6('0xe'),_0x3bc54f,util[_0xf2f6('0xf')](_0x341841,{'showHidden':![],'depth':null}));_0x1b721d('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0xe760a){logger[_0xf2f6('0xd')](_0xf2f6('0x10'),_0x3bc54f);_0x1b721d(_0xf2f6('0x11'));}else{_0x17106b(_0xe760a);}});}catch(_0x29c871){_0x1b721d(_0x29c871);}});}function ActiveDirectoryAuthenticate(_0x309506,_0x3bc789,_0x31b177,_0x2c3caf){var _0x1dd9f3,_0x245171;if(!isActiveDirectoryConfigured(config)){logger[_0xf2f6('0xd')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x3bc789);return _0x2c3caf(null,![],{'message':_0xf2f6('0x11')});}return db[_0xf2f6('0x12')][_0xf2f6('0x13')]({'where':{'id':0x1},'attributes':[_0xf2f6('0x14'),'blockDuration'],'raw':!![]})[_0xf2f6('0x15')](function(_0xa80ad9){_0x1dd9f3=_0xa80ad9;if(!_0x1dd9f3['adSsoEnabled']){logger['error'](_0xf2f6('0x16'),_0x3bc789);throw new Error(_0xf2f6('0x11'));}return _0x309506[_0xf2f6('0x13')]({'attributes':['id',_0xf2f6('0x17'),'password',_0xf2f6('0x18'),_0xf2f6('0x19'),_0xf2f6('0x1a'),_0xf2f6('0x1b'),'blockedAt','online'],'where':{'name':_0x3bc789,'role':{'$or':[_0xf2f6('0x1c'),'user','agent']},'adSsoEnabled':!![]}});})[_0xf2f6('0x15')](function(_0x5820a4){if(!_0x5820a4||_0x5820a4&&_0x5820a4['name']!==_0x3bc789){throw new Error(_0xf2f6('0x11'));}_0x245171=_0x5820a4;var _0xd61087=_0x245171['name']+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0xf2f6('0x8')],_0xd61087,_0x31b177);})['then'](function(_0x418777){if(_0x245171[_0xf2f6('0x1a')]){throw new Error(_0xf2f6('0x11'));}if(_0x1dd9f3['blockDuration']>0x0){if(_0x245171[_0xf2f6('0x1b')]){if(moment(_0x245171[_0xf2f6('0x1d')])[_0xf2f6('0x1e')](_0x1dd9f3[_0xf2f6('0x1f')],'minutes')>moment()){throw new Error(_0xf2f6('0x11'));}return utils[_0xf2f6('0x20')](_0x245171,0x0,![],null)['then'](function(){return utils[_0xf2f6('0x21')](_0x245171);})['then'](function(){return _0x2c3caf(null,_0x245171);});}else{return utils['getLicense'](_0x245171)[_0xf2f6('0x15')](function(){return _0x2c3caf(null,_0x245171);});}}else{return utils[_0xf2f6('0x21')](_0x245171)[_0xf2f6('0x15')](function(){return _0x2c3caf(null,_0x245171);});}})[_0xf2f6('0x22')](function(_0x130001){return _0x2c3caf(null,![],_0x130001);});}function handleError(_0x24f4f4,_0xde15c4,_0x518bff){return _0x24f4f4[_0xf2f6('0x23')](_0xde15c4||0x1f4)[_0xf2f6('0x24')]({'message':_0x518bff?_0x518bff[_0xf2f6('0x25')]||_0x518bff:''});}exports[_0xf2f6('0x26')]=function(_0x591512,_0x6d0842,_0x58eb4c){passport[_0xf2f6('0xc')](_0xf2f6('0x27'),function(_0x4a25a3,_0x3c2b39,_0x3e12c8){var _0x18dbb7=_0x4a25a3||_0x3e12c8;if(_0x18dbb7){return handleError(_0x6d0842,0x191,_0x18dbb7);}if(!_0x3c2b39){return handleError(_0x6d0842,0x194,{'message':_0xf2f6('0x28')});}else{var _0x4712c7={'payload':{'id':_0x3c2b39['id'],'role':_0x3c2b39[_0xf2f6('0x19')]},'options':{'expiresIn':0x15180}};return authService[_0xf2f6('0x29')](_0x4712c7)[_0xf2f6('0x15')](function(_0x40ba2a){_0x6d0842[_0xf2f6('0x2a')]({'id':_0x3c2b39['id'],'token':_0x40ba2a,'statusCall':'','isAlreadyLogged':_0x3c2b39[_0xf2f6('0x2b')]});});}})(_0x591512,_0x6d0842,_0x58eb4c);};passport['use']('ad-login',new LocalStrategy({'usernameField':_0xf2f6('0x17'),'passwordField':_0xf2f6('0x2c')},function(_0x323435,_0x5d17c9,_0x47dfb9){return ActiveDirectoryAuthenticate(db[_0xf2f6('0x2d')],_0x323435,_0x5d17c9,_0x47dfb9);})); \ No newline at end of file +var _0x9abe=['Setting','findOne','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt','online','admin','user','disabled','add','minutes','then','getLicense','send','message','login','ad-login','signToken','json','User','passport-local','Strategy','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials'];(function(_0x209ad2,_0x320c8f){var _0x326562=function(_0x5422eb){while(--_0x5422eb){_0x209ad2['push'](_0x209ad2['shift']());}};_0x326562(++_0x320c8f);}(_0x9abe,0x1db));var _0xe9ab=function(_0x475a05,_0x1ac18a){_0x475a05=_0x475a05-0x0;var _0x17212b=_0x9abe[_0x475a05];return _0x17212b;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xe9ab('0x0'))[_0xe9ab('0x1')];var moment=require(_0xe9ab('0x2'));var ActiveDirectory=require(_0xe9ab('0x3'));var BPromise=require(_0xe9ab('0x4'));var util=require('util');var db=require(_0xe9ab('0x5'))['db'];var authService=require(_0xe9ab('0x6'));var utils=require(_0xe9ab('0x7'));var config=require(_0xe9ab('0x8'));var logger=require(_0xe9ab('0x9'))(_0xe9ab('0xa'));function isActiveDirectoryConfigured(_0x18d081){var _0x1620cc=![];if(typeof _0x18d081[_0xe9ab('0xb')]!=='undefined'){_0x1620cc=_0x18d081[_0xe9ab('0xb')][_0xe9ab('0xc')]&&_0x18d081[_0xe9ab('0xb')][_0xe9ab('0xd')]&&_0x18d081[_0xe9ab('0xb')][_0xe9ab('0xe')];}return _0x1620cc;}function adAuthenticate(_0x1ea35d,_0x5607df,_0x5cee77){return new BPromise(function(_0x3e0d07,_0x325fa0){try{var _0x51f644=new ActiveDirectory(_0x1ea35d);_0x51f644[_0xe9ab('0xf')](_0x5607df,_0x5cee77,function(_0x3b3e7d,_0x150481){if(_0x3b3e7d){logger[_0xe9ab('0x10')](_0xe9ab('0x11'),_0x5607df,util['inspect'](_0x3b3e7d,{'showHidden':![],'depth':null}));_0x325fa0(_0xe9ab('0x12'));}else if(!_0x150481){logger[_0xe9ab('0x10')](_0xe9ab('0x13'),_0x5607df);_0x325fa0(_0xe9ab('0x12'));}else{_0x3e0d07(_0x150481);}});}catch(_0x38e2e4){_0x325fa0(_0x38e2e4);}});}function ActiveDirectoryAuthenticate(_0x274766,_0x51be0c,_0x17ceb1,_0x328847){var _0x24fdfb,_0x3d6c8d;if(!isActiveDirectoryConfigured(config)){logger[_0xe9ab('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x51be0c);return _0x328847(null,![],{'message':_0xe9ab('0x12')});}return db[_0xe9ab('0x14')][_0xe9ab('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xe9ab('0x16')],'raw':!![]})['then'](function(_0x958413){_0x24fdfb=_0x958413;if(!_0x24fdfb['adSsoEnabled']){logger['error'](_0xe9ab('0x17'),_0x51be0c);throw new Error(_0xe9ab('0x12'));}return _0x274766[_0xe9ab('0x15')]({'attributes':['id',_0xe9ab('0x18'),_0xe9ab('0x19'),_0xe9ab('0x1a'),_0xe9ab('0x1b'),'disabled',_0xe9ab('0x1c'),_0xe9ab('0x1d'),_0xe9ab('0x1e')],'where':{'name':_0x51be0c,'role':{'$or':[_0xe9ab('0x1f'),_0xe9ab('0x20'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x2e0e3d){if(!_0x2e0e3d||_0x2e0e3d&&_0x2e0e3d[_0xe9ab('0x18')]!==_0x51be0c){throw new Error(_0xe9ab('0x12'));}_0x3d6c8d=_0x2e0e3d;var _0x57a4ac=_0x3d6c8d['name']+'@'+config[_0xe9ab('0xb')][_0xe9ab('0xe')];return adAuthenticate(config[_0xe9ab('0xb')],_0x57a4ac,_0x17ceb1);})['then'](function(_0x21e42a){if(_0x3d6c8d[_0xe9ab('0x21')]){throw new Error(_0xe9ab('0x12'));}if(_0x24fdfb['blockDuration']>0x0){if(_0x3d6c8d[_0xe9ab('0x1c')]){if(moment(_0x3d6c8d[_0xe9ab('0x1d')])[_0xe9ab('0x22')](_0x24fdfb[_0xe9ab('0x16')],_0xe9ab('0x23'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x3d6c8d,0x0,![],null)[_0xe9ab('0x24')](function(){return utils[_0xe9ab('0x25')](_0x3d6c8d);})[_0xe9ab('0x24')](function(){return _0x328847(null,_0x3d6c8d);});}else{return utils[_0xe9ab('0x25')](_0x3d6c8d)['then'](function(){return _0x328847(null,_0x3d6c8d);});}}else{return utils['getLicense'](_0x3d6c8d)['then'](function(){return _0x328847(null,_0x3d6c8d);});}})['catch'](function(_0x47c565){return _0x328847(null,![],_0x47c565);});}function handleError(_0x3f65cc,_0x4488d0,_0x31508c){return _0x3f65cc['status'](_0x4488d0||0x1f4)[_0xe9ab('0x26')]({'message':_0x31508c?_0x31508c[_0xe9ab('0x27')]||_0x31508c:''});}exports[_0xe9ab('0x28')]=function(_0x2737e8,_0x29e4ac,_0xf63265){passport[_0xe9ab('0xf')](_0xe9ab('0x29'),function(_0x447bdf,_0x164463,_0x2d8a20){var _0x470890=_0x447bdf||_0x2d8a20;if(_0x470890){return handleError(_0x29e4ac,0x191,_0x470890);}if(!_0x164463){return handleError(_0x29e4ac,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x16c5a3={'payload':{'id':_0x164463['id'],'role':_0x164463['role']},'options':{'expiresIn':0x15180}};return authService[_0xe9ab('0x2a')](_0x16c5a3)[_0xe9ab('0x24')](function(_0xbaf875){_0x29e4ac[_0xe9ab('0x2b')]({'id':_0x164463['id'],'token':_0xbaf875,'statusCall':'','isAlreadyLogged':_0x164463[_0xe9ab('0x1e')]});});}})(_0x2737e8,_0x29e4ac,_0xf63265);};passport['use'](_0xe9ab('0x29'),new LocalStrategy({'usernameField':_0xe9ab('0x18'),'passwordField':_0xe9ab('0x19')},function(_0x4a585a,_0x1c6bb9,_0x48983a){return ActiveDirectoryAuthenticate(db[_0xe9ab('0x2c')],_0x4a585a,_0x1c6bb9,_0x48983a);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index fa4b1a9..5987345 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 _0xd9bf=['exports','express','./authActiveDirectory.controller','post'];(function(_0x332597,_0x33648e){var _0x70870e=function(_0x415f6f){while(--_0x415f6f){_0x332597['push'](_0x332597['shift']());}};_0x70870e(++_0x33648e);}(_0xd9bf,0x185));var _0xfd9b=function(_0x4e611e,_0x11bf5a){_0x4e611e=_0x4e611e-0x0;var _0x4c4b9e=_0xd9bf[_0x4e611e];return _0x4c4b9e;};'use strict';var express=require(_0xfd9b('0x0'));var router=express['Router']();var controller=require(_0xfd9b('0x1'));router[_0xfd9b('0x2')]('/',controller['login']);module[_0xfd9b('0x3')]=router; \ No newline at end of file +var _0x7730=['Router','exports'];(function(_0x37d86b,_0x4a4334){var _0x14847d=function(_0x591420){while(--_0x591420){_0x37d86b['push'](_0x37d86b['shift']());}};_0x14847d(++_0x4a4334);}(_0x7730,0x6e));var _0x0773=function(_0x4a3ee3,_0x304512){_0x4a3ee3=_0x4a3ee3-0x0;var _0x56d16d=_0x7730[_0x4a3ee3];return _0x56d16d;};'use strict';var express=require('express');var router=express[_0x0773('0x0')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller['login']);module[_0x0773('0x1')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 805c863..3b58854 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x7a54,0x106));var _0x47a5=function(_0x297ff4,_0x508fb9){_0x297ff4=_0x297ff4-0x0;var _0x444009=_0x7a54[_0x297ff4];return _0x444009;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x51a157,_0x972af){var _0x3b014b=function(_0x42b519){while(--_0x42b519){_0x51a157['push'](_0x51a157['shift']());}};_0x3b014b(++_0x972af);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 6317cb0..b5c39e7 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 _0x11dc=['callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x3cb32e,_0x65382e){var _0x3b6f16=function(_0x4a8a70){while(--_0x4a8a70){_0x3cb32e['push'](_0x3cb32e['shift']());}};_0x3b6f16(++_0x65382e);}(_0x11dc,0x93));var _0xc11d=function(_0x3b67e4,_0x2a5d46){_0x3b67e4=_0x3b67e4-0x0;var _0x21adcf=_0x11dc[_0x3b67e4];return _0x21adcf;};'use strict';var express=require(_0xc11d('0x0'));var passport=require(_0xc11d('0x1'));var router=express[_0xc11d('0x2')]();var controller=require(_0xc11d('0x3'));var userController=require(_0xc11d('0x4'));var authService=require(_0xc11d('0x5'));router[_0xc11d('0x6')]('/',controller[_0xc11d('0x7')]);router['get'](_0xc11d('0x8'),controller[_0xc11d('0x9')],authService[_0xc11d('0xa')],userController[_0xc11d('0x7')],authService[_0xc11d('0xb')]);module[_0xc11d('0xc')]=router; \ No newline at end of file +var _0x2168=['get','login','callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x424b47,_0x39bca7){var _0x1c5df7=function(_0x4e36e1){while(--_0x4e36e1){_0x424b47['push'](_0x424b47['shift']());}};_0x1c5df7(++_0x39bca7);}(_0x2168,0x15b));var _0x8216=function(_0x2ba748,_0xe1030b){_0x2ba748=_0x2ba748-0x0;var _0x5e2b4c=_0x2168[_0x2ba748];return _0x5e2b4c;};'use strict';var express=require('express');var passport=require(_0x8216('0x0'));var router=express[_0x8216('0x1')]();var controller=require(_0x8216('0x2'));var userController=require(_0x8216('0x3'));var authService=require(_0x8216('0x4'));router[_0x8216('0x5')]('/',controller[_0x8216('0x6')]);router[_0x8216('0x5')]('/callback',controller[_0x8216('0x7')],authService[_0x8216('0x8')],userController[_0x8216('0x6')],authService[_0x8216('0x9')]);module[_0x8216('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 4307ee5..98bc4ec 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 _0x208b=['disabled','blocked','blockedAt','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','allowedLoginAttempts','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','Setting','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','validatePasswordHistory','previousPasswords','passwordHistoryLimit','Password\x20reset!','use','util','passport','Strategy','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','findOne','then','name','password','salt','role'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x208b,0xde));var _0xb208=function(_0x25b0ea,_0x193595){_0x25b0ea=_0x25b0ea-0x0;var _0x49fb97=_0x208b[_0x25b0ea];return _0x49fb97;};'use strict';var util=require(_0xb208('0x0'));var passport=require(_0xb208('0x1'));var LocalStrategy=require('passport-local')[_0xb208('0x2')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xb208('0x3'));var moment=require(_0xb208('0x4'));var db=require(_0xb208('0x5'))['db'];var authService=require(_0xb208('0x6'));var utils=require(_0xb208('0x7'));var client=jayson[_0xb208('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x1ffac9,_0x5bf3d5,_0x1aa5f7,_0xcd29ad){var _0x3818fc,_0x3112a7;return db['Setting'][_0xb208('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xb208('0xa')](function(_0x431a59){_0x3818fc=_0x431a59;return _0x1ffac9[_0xb208('0x9')]({'attributes':['id',_0xb208('0xb'),_0xb208('0xc'),_0xb208('0xd'),_0xb208('0xe'),_0xb208('0xf'),_0xb208('0x10'),_0xb208('0x11'),'loginAttempts'],'where':{'name':_0x5bf3d5,'role':{'$or':[_0xb208('0x12'),'user',_0xb208('0x13')]}}});})[_0xb208('0xa')](function(_0x34b460){if(!_0x34b460||_0x34b460&&_0x34b460['name']!==_0x5bf3d5){throw new Error(_0xb208('0x14'));}else{_0x3112a7=_0x34b460;return _0x3112a7;}})[_0xb208('0xa')](function(){_0x3112a7[_0xb208('0x15')](_0x1aa5f7,function(_0x5b689b,_0x48985f){var _0x2a4388=_0x3112a7[_0xb208('0x16')]+0x1;if(_0x5b689b){return _0xcd29ad(_0x5b689b);}else if(!_0x48985f){if(_0x3112a7[_0xb208('0xf')]){return _0xcd29ad(null,![],{'message':_0xb208('0x14')});}else if(_0x3818fc[_0xb208('0x17')]>0x0){if(_0x3112a7['blocked']){if(_0x3818fc[_0xb208('0x18')]>0x0){if(moment(_0x3112a7[_0xb208('0x11')])[_0xb208('0x19')](_0x3818fc[_0xb208('0x18')],_0xb208('0x1a'))>moment()){return _0xcd29ad(null,![],{'message':_0xb208('0x14')});}else{return utils['clearBlockUser'](_0x3112a7,_0x2a4388,![],null)[_0xb208('0xa')](function(){return _0xcd29ad(null,![],{'message':_0xb208('0x14')});});}}else{return _0xcd29ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2a4388>=_0x3818fc[_0xb208('0x17')]){return utils[_0xb208('0x1b')](_0x3112a7,0x0,!![],moment())[_0xb208('0xa')](function(){return _0xcd29ad(null,![],{'message':_0xb208('0x14')});});}else{return utils[_0xb208('0x1b')](_0x3112a7,_0x2a4388,![],null)[_0xb208('0xa')](function(){return _0xcd29ad(null,![],{'message':_0xb208('0x14')});});}}}else{return _0xcd29ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3112a7[_0xb208('0xf')]){return _0xcd29ad(null,![],{'message':_0xb208('0x14')});}else if(_0x3818fc['allowedLoginAttempts']>0x0){if(_0x3112a7[_0xb208('0x10')]){if(_0x3818fc[_0xb208('0x18')]>0x0){if(moment(_0x3112a7[_0xb208('0x11')])[_0xb208('0x19')](_0x3818fc[_0xb208('0x18')],_0xb208('0x1a'))>moment()){return _0xcd29ad(null,![],{'message':_0xb208('0x14')});}else{return utils[_0xb208('0x1b')](_0x3112a7,0x0,![],null)[_0xb208('0xa')](function(){return utils[_0xb208('0x1c')](_0x3112a7);})[_0xb208('0xa')](function(){return _0xcd29ad(null,_0x3112a7);});}}else{return _0xcd29ad(null,![],{'message':_0xb208('0x14')});}}else{return utils[_0xb208('0x1b')](_0x3112a7,0x0,![],null)[_0xb208('0xa')](function(){return utils[_0xb208('0x1c')](_0x3112a7);})[_0xb208('0xa')](function(){return _0xcd29ad(null,_0x3112a7);})[_0xb208('0x1d')](function(_0x29a7b9){return _0xcd29ad(null,![],_0x29a7b9);});}}else{if(_0x3112a7['blocked']){return _0xcd29ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xb208('0x1c')](_0x3112a7)[_0xb208('0xa')](function(){return _0xcd29ad(null,_0x3112a7);});}}}});})[_0xb208('0x1d')](function(_0x34476d){return _0xcd29ad(null,![],_0x34476d);});}function sendServiceMail(_0x1a5148){return db[_0xb208('0x1e')][_0xb208('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xb208('0xb'),_0xb208('0x20')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0xb208('0x21')],'as':_0xb208('0x21')}]}]})['then'](function(_0x2f6c2f){if(!_0x2f6c2f){throw new Error(_0xb208('0x22'));}var _0x1c0caf=_0x2f6c2f[_0xb208('0x23')]();var _0x7ca56b={'account':_0x1c0caf,'message':_[_0xb208('0x24')]({'from':util['format'](_0xb208('0x25'),_0x2f6c2f[_0xb208('0xb')],_0x2f6c2f[_0xb208('0x20')]||_0x2f6c2f['Smtp'][_0xb208('0x26')])},_0x1a5148)};return client[_0xb208('0x27')](_0xb208('0x28'),_0x7ca56b);})[_0xb208('0xa')](function(_0x55a6a5){if(_0x55a6a5[_0xb208('0x29')]){throw new Error(util['format'](_0xb208('0x2a'),_0x55a6a5['error']['message']||JSON[_0xb208('0x2b')](_0x55a6a5[_0xb208('0x29')])));}return!![];});}function handleError(_0x3c16b2,_0x47485d,_0x2046d1){return _0x3c16b2[_0xb208('0x2c')](_0x47485d||0x1f4)['send']({'message':_0x2046d1?_0x2046d1[_0xb208('0x2d')]||_0x2046d1:''});}exports[_0xb208('0x2e')]=function(_0xd78a96,_0x3b79e5,_0x594713){passport[_0xb208('0x15')](_0xb208('0x2f'),function(_0x4fc5d3,_0x17aad6,_0x4ac769){var _0x38da21=_0x4fc5d3||_0x4ac769;if(_0x38da21){return handleError(_0x3b79e5,0x191,_0x38da21);}if(!_0x17aad6){return handleError(_0x3b79e5,0x194,{'message':_0xb208('0x30')});}else{var _0x98382d={'payload':{'id':_0x17aad6['id'],'role':_0x17aad6['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x98382d)['then'](function(_0x2974e7){_0x3b79e5['json']({'id':_0x17aad6['id'],'token':_0x2974e7,'statusCall':'','isAlreadyLogged':_0x17aad6[_0xb208('0x31')]});});}})(_0xd78a96,_0x3b79e5,_0x594713);};exports[_0xb208('0x32')]=function(_0x13b85d,_0x4017db){if(!_0x13b85d[_0xb208('0x33')][_0xb208('0x20')]){return handleError(_0x4017db,0x1f4,{'message':_0xb208('0x34')});}var _0x54ec20=rs['generate']();_0x13b85d['body'][_0xb208('0x20')]=_0x13b85d['body'][_0xb208('0x20')][_0xb208('0x35')]()['toLowerCase']();var _0x195f0b;return db[_0xb208('0x36')][_0xb208('0x9')]({'where':{'id':0x1},'attributes':[_0xb208('0x17'),_0xb208('0x18')],'raw':!![]})['then'](function(_0x9ae07){_0x195f0b=_0x9ae07;return db[_0xb208('0x37')][_0xb208('0x1f')]({'where':{'email':_0x13b85d[_0xb208('0x33')]['email']}});})[_0xb208('0xa')](function(_0x1b9595){if(!_0x1b9595){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x1b9595[_0xb208('0xf')]){throw new Error(_0xb208('0x38'));}if(_0x1b9595[_0xb208('0x10')]){if(moment(_0x1b9595['blockedAt'])['add'](_0x195f0b['blockDuration'],'minutes')>moment()){throw new Error(_0xb208('0x39'));}else{_0x1b9595[_0xb208('0x10')]=![];_0x1b9595['blockedAt']=null;}}_0x1b9595['resetPasswordToken']=_0x54ec20;_0x1b9595[_0xb208('0x3a')]=Date[_0xb208('0x3b')]()+0x36ee80;return _0x1b9595[_0xb208('0x3c')]();})[_0xb208('0xa')](function(){return sendServiceMail({'to':_0x13b85d[_0xb208('0x33')][_0xb208('0x20')],'subject':_0xb208('0x3d'),'text':'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://'+_0x13b85d[_0xb208('0x3e')][_0xb208('0x3f')]+_0xb208('0x40')+_0x54ec20+'\x0a\x0a'+_0xb208('0x41')});})[_0xb208('0xa')](function(){_0x4017db[_0xb208('0x2c')](0xc8)['send']({'message':_0xb208('0x42')});})[_0xb208('0x1d')](function(_0x3079c6){return handleError(_0x4017db,0x1f4,_0x3079c6);});};exports[_0xb208('0x43')]=function(_0x24a65e,_0x187cb3){return db['User'][_0xb208('0x1f')]({'where':{'resetPasswordToken':_0x24a65e[_0xb208('0x44')][_0xb208('0x45')],'resetPasswordExpires':{'$gt':Date[_0xb208('0x3b')]()}}})[_0xb208('0xa')](function(_0x3ae239){if(!_0x3ae239){throw new Error(_0xb208('0x46'));}return db[_0xb208('0x36')][_0xb208('0x9')]({'attributes':['id',_0xb208('0x47'),_0xb208('0x48'),'passwordHistoryLimit']})[_0xb208('0xa')](function(_0x39afef){if(_0x39afef[_0xb208('0x47')])authService[_0xb208('0x49')](_0x24a65e[_0xb208('0x33')][_0xb208('0xc')]);if(!_0x39afef[_0xb208('0x48')]||!_0x3ae239['previousPasswords'])return _0x3ae239;authService[_0xb208('0x4a')](_0x24a65e['body'][_0xb208('0xc')],_0x3ae239[_0xb208('0x4b')],_0x39afef[_0xb208('0x4c')]);return _0x3ae239;})['then'](function(){_0x3ae239['password']=_0x24a65e['body']['password'];_0x3ae239['resetPasswordToken']=null;_0x3ae239['resetPasswordExpires']=null;return _0x3ae239[_0xb208('0x3c')]();});})[_0xb208('0xa')](function(){_0x187cb3['status'](0xc8)['send']({'message':_0xb208('0x4d')});})[_0xb208('0x1d')](function(_0x28bde7){return handleError(_0x187cb3,0x1f4,_0x28bde7);});};passport[_0xb208('0x4e')](_0xb208('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':_0xb208('0xc')},function(_0x3a69a6,_0x1bf686,_0x89062a){return localAuthenticate(db['User'],_0x3a69a6,_0x1bf686,_0x89062a);})); \ No newline at end of file +var _0xe73f=['https://','headers','host','/reset/','send','Reset\x20Email\x20sent!','reset','find','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','Password\x20reset!','passport','passport-local','Strategy','jayson/promise','randomstring','../../mysqldb','../../config/utils','http','Setting','blockDuration','then','name','password','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','Smtp','error','message','stringify','status','login','local-login','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','findOne','User','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'];(function(_0xeaa265,_0x50d2f7){var _0x541f59=function(_0x440460){while(--_0x440460){_0xeaa265['push'](_0xeaa265['shift']());}};_0x541f59(++_0x50d2f7);}(_0xe73f,0x13c));var _0xfe73=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xe73f[_0x5c351c];return _0x26f3b3;};'use strict';var util=require('util');var passport=require(_0xfe73('0x0'));var LocalStrategy=require(_0xfe73('0x1'))[_0xfe73('0x2')];var jayson=require(_0xfe73('0x3'));var _=require('lodash');var rs=require(_0xfe73('0x4'));var moment=require('moment');var db=require(_0xfe73('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xfe73('0x6'));var client=jayson['client'][_0xfe73('0x7')]({'port':0x232b});function localAuthenticate(_0x3de497,_0x3c5cb5,_0x38d22b,_0x941ca4){var _0x461c55,_0x221fd9;return db[_0xfe73('0x8')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xfe73('0x9')],'raw':!![]})[_0xfe73('0xa')](function(_0x4b0425){_0x461c55=_0x4b0425;return _0x3de497['findOne']({'attributes':['id',_0xfe73('0xb'),_0xfe73('0xc'),'salt',_0xfe73('0xd'),_0xfe73('0xe'),_0xfe73('0xf'),_0xfe73('0x10'),_0xfe73('0x11')],'where':{'name':_0x3c5cb5,'role':{'$or':[_0xfe73('0x12'),'user',_0xfe73('0x13')]}}});})[_0xfe73('0xa')](function(_0x520d77){if(!_0x520d77||_0x520d77&&_0x520d77[_0xfe73('0xb')]!==_0x3c5cb5){throw new Error(_0xfe73('0x14'));}else{_0x221fd9=_0x520d77;return _0x221fd9;}})[_0xfe73('0xa')](function(){_0x221fd9[_0xfe73('0x15')](_0x38d22b,function(_0x1c9026,_0x57b833){var _0x59444e=_0x221fd9[_0xfe73('0x11')]+0x1;if(_0x1c9026){return _0x941ca4(_0x1c9026);}else if(!_0x57b833){if(_0x221fd9[_0xfe73('0xe')]){return _0x941ca4(null,![],{'message':_0xfe73('0x14')});}else if(_0x461c55[_0xfe73('0x16')]>0x0){if(_0x221fd9[_0xfe73('0xf')]){if(_0x461c55[_0xfe73('0x9')]>0x0){if(moment(_0x221fd9[_0xfe73('0x10')])[_0xfe73('0x17')](_0x461c55[_0xfe73('0x9')],_0xfe73('0x18'))>moment()){return _0x941ca4(null,![],{'message':_0xfe73('0x14')});}else{return utils[_0xfe73('0x19')](_0x221fd9,_0x59444e,![],null)[_0xfe73('0xa')](function(){return _0x941ca4(null,![],{'message':_0xfe73('0x14')});});}}else{return _0x941ca4(null,![],{'message':_0xfe73('0x14')});}}else{if(_0x59444e>=_0x461c55[_0xfe73('0x16')]){return utils[_0xfe73('0x19')](_0x221fd9,0x0,!![],moment())['then'](function(){return _0x941ca4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xfe73('0x19')](_0x221fd9,_0x59444e,![],null)[_0xfe73('0xa')](function(){return _0x941ca4(null,![],{'message':_0xfe73('0x14')});});}}}else{return _0x941ca4(null,![],{'message':_0xfe73('0x14')});}}else{if(_0x221fd9[_0xfe73('0xe')]){return _0x941ca4(null,![],{'message':_0xfe73('0x14')});}else if(_0x461c55[_0xfe73('0x16')]>0x0){if(_0x221fd9[_0xfe73('0xf')]){if(_0x461c55[_0xfe73('0x9')]>0x0){if(moment(_0x221fd9['blockedAt'])[_0xfe73('0x17')](_0x461c55[_0xfe73('0x9')],_0xfe73('0x18'))>moment()){return _0x941ca4(null,![],{'message':_0xfe73('0x14')});}else{return utils['clearBlockUser'](_0x221fd9,0x0,![],null)[_0xfe73('0xa')](function(){return utils[_0xfe73('0x1a')](_0x221fd9);})[_0xfe73('0xa')](function(){return _0x941ca4(null,_0x221fd9);});}}else{return _0x941ca4(null,![],{'message':_0xfe73('0x14')});}}else{return utils['clearBlockUser'](_0x221fd9,0x0,![],null)[_0xfe73('0xa')](function(){return utils['getLicense'](_0x221fd9);})[_0xfe73('0xa')](function(){return _0x941ca4(null,_0x221fd9);})[_0xfe73('0x1b')](function(_0xfca884){return _0x941ca4(null,![],_0xfca884);});}}else{if(_0x221fd9[_0xfe73('0xf')]){return _0x941ca4(null,![],{'message':_0xfe73('0x14')});}else{return utils[_0xfe73('0x1a')](_0x221fd9)[_0xfe73('0xa')](function(){return _0x941ca4(null,_0x221fd9);});}}}});})[_0xfe73('0x1b')](function(_0x3adb9d){return _0x941ca4(null,![],_0x3adb9d);});}function sendServiceMail(_0x5c6077){return db[_0xfe73('0x1c')]['find']({'where':{'service':!![]},'attributes':['id','name',_0xfe73('0x1d')],'include':[{'model':db[_0xfe73('0x1e')],'as':'Smtp','include':[{'model':db[_0xfe73('0x1f')],'as':_0xfe73('0x1f')}]}]})[_0xfe73('0xa')](function(_0x4f3623){if(!_0x4f3623){throw new Error(_0xfe73('0x20'));}var _0x147dc1=_0x4f3623[_0xfe73('0x21')]();var _0x2df85f={'account':_0x147dc1,'message':_[_0xfe73('0x22')]({'from':util[_0xfe73('0x23')]('\x22%s\x22\x20<%s>',_0x4f3623[_0xfe73('0xb')],_0x4f3623[_0xfe73('0x1d')]||_0x4f3623[_0xfe73('0x24')]['user'])},_0x5c6077)};return client['request']('SendMail',_0x2df85f);})[_0xfe73('0xa')](function(_0x67d01a){if(_0x67d01a[_0xfe73('0x25')]){throw new Error(util[_0xfe73('0x23')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x67d01a[_0xfe73('0x25')][_0xfe73('0x26')]||JSON[_0xfe73('0x27')](_0x67d01a[_0xfe73('0x25')])));}return!![];});}function handleError(_0x5e0d5b,_0xe3ddd9,_0x1e8675){return _0x5e0d5b[_0xfe73('0x28')](_0xe3ddd9||0x1f4)['send']({'message':_0x1e8675?_0x1e8675[_0xfe73('0x26')]||_0x1e8675:''});}exports[_0xfe73('0x29')]=function(_0xb5acd1,_0x1f167,_0x4cd90d){passport[_0xfe73('0x15')](_0xfe73('0x2a'),function(_0x3b55b5,_0x229cd4,_0x5da986){var _0x434930=_0x3b55b5||_0x5da986;if(_0x434930){return handleError(_0x1f167,0x191,_0x434930);}if(!_0x229cd4){return handleError(_0x1f167,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2e3ae3={'payload':{'id':_0x229cd4['id'],'role':_0x229cd4[_0xfe73('0xd')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e3ae3)[_0xfe73('0xa')](function(_0x3d4225){_0x1f167[_0xfe73('0x2b')]({'id':_0x229cd4['id'],'token':_0x3d4225,'statusCall':'','isAlreadyLogged':_0x229cd4['online']});});}})(_0xb5acd1,_0x1f167,_0x4cd90d);};exports[_0xfe73('0x2c')]=function(_0x140d9b,_0x1325f3){if(!_0x140d9b[_0xfe73('0x2d')][_0xfe73('0x1d')]){return handleError(_0x1325f3,0x1f4,{'message':_0xfe73('0x2e')});}var _0x33e2f4=rs[_0xfe73('0x2f')]();_0x140d9b[_0xfe73('0x2d')][_0xfe73('0x1d')]=_0x140d9b[_0xfe73('0x2d')]['email'][_0xfe73('0x30')]()[_0xfe73('0x31')]();var _0x39f83c;return db[_0xfe73('0x8')][_0xfe73('0x32')]({'where':{'id':0x1},'attributes':[_0xfe73('0x16'),_0xfe73('0x9')],'raw':!![]})[_0xfe73('0xa')](function(_0x5a775f){_0x39f83c=_0x5a775f;return db[_0xfe73('0x33')]['find']({'where':{'email':_0x140d9b['body'][_0xfe73('0x1d')]}});})[_0xfe73('0xa')](function(_0x38f8fb){if(!_0x38f8fb){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x38f8fb[_0xfe73('0xe')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x38f8fb[_0xfe73('0xf')]){if(moment(_0x38f8fb[_0xfe73('0x10')])['add'](_0x39f83c[_0xfe73('0x9')],'minutes')>moment()){throw new Error(_0xfe73('0x34'));}else{_0x38f8fb['blocked']=![];_0x38f8fb[_0xfe73('0x10')]=null;}}_0x38f8fb[_0xfe73('0x35')]=_0x33e2f4;_0x38f8fb[_0xfe73('0x36')]=Date[_0xfe73('0x37')]()+0x36ee80;return _0x38f8fb[_0xfe73('0x38')]();})[_0xfe73('0xa')](function(){return sendServiceMail({'to':_0x140d9b['body'][_0xfe73('0x1d')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xfe73('0x39')+_0xfe73('0x3a')+_0xfe73('0x3b')+_0x140d9b[_0xfe73('0x3c')][_0xfe73('0x3d')]+_0xfe73('0x3e')+_0x33e2f4+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x1325f3[_0xfe73('0x28')](0xc8)[_0xfe73('0x3f')]({'message':_0xfe73('0x40')});})['catch'](function(_0x5e128c){return handleError(_0x1325f3,0x1f4,_0x5e128c);});};exports[_0xfe73('0x41')]=function(_0x22af40,_0x4b576e){return db['User'][_0xfe73('0x42')]({'where':{'resetPasswordToken':_0x22af40[_0xfe73('0x43')]['token'],'resetPasswordExpires':{'$gt':Date[_0xfe73('0x37')]()}}})[_0xfe73('0xa')](function(_0x44919d){if(!_0x44919d){throw new Error(_0xfe73('0x44'));}return db[_0xfe73('0x8')][_0xfe73('0x32')]({'attributes':['id','securePassword',_0xfe73('0x45'),_0xfe73('0x46')]})[_0xfe73('0xa')](function(_0x344650){if(_0x344650[_0xfe73('0x47')])authService['validatePasswordPattern'](_0x22af40['body']['password']);if(!_0x344650[_0xfe73('0x45')]||!_0x44919d[_0xfe73('0x48')])return _0x44919d;authService[_0xfe73('0x49')](_0x22af40[_0xfe73('0x2d')][_0xfe73('0xc')],_0x44919d[_0xfe73('0x48')],_0x344650[_0xfe73('0x46')]);return _0x44919d;})[_0xfe73('0xa')](function(){_0x44919d[_0xfe73('0xc')]=_0x22af40[_0xfe73('0x2d')][_0xfe73('0xc')];_0x44919d[_0xfe73('0x35')]=null;_0x44919d[_0xfe73('0x36')]=null;return _0x44919d[_0xfe73('0x38')]();});})['then'](function(){_0x4b576e[_0xfe73('0x28')](0xc8)['send']({'message':_0xfe73('0x4a')});})[_0xfe73('0x1b')](function(_0x2c5082){return handleError(_0x4b576e,0x1f4,_0x2c5082);});};passport['use'](_0xfe73('0x2a'),new LocalStrategy({'usernameField':_0xfe73('0xb'),'passwordField':_0xfe73('0xc')},function(_0x44d6a5,_0x29557c,_0x3958d5){return localAuthenticate(db[_0xfe73('0x33')],_0x44d6a5,_0x29557c,_0x3958d5);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 6b7bce7..e119b49 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 _0xa3e0=['login','/forgot','forgot','/reset/:token','exports','express','Router','./authLocal.controller','post'];(function(_0x2a48db,_0x470216){var _0x341b0f=function(_0x50d640){while(--_0x50d640){_0x2a48db['push'](_0x2a48db['shift']());}};_0x341b0f(++_0x470216);}(_0xa3e0,0x68));var _0x0a3e=function(_0x2a8761,_0x21852a){_0x2a8761=_0x2a8761-0x0;var _0x314436=_0xa3e0[_0x2a8761];return _0x314436;};'use strict';var express=require(_0x0a3e('0x0'));var router=express[_0x0a3e('0x1')]();var controller=require(_0x0a3e('0x2'));router[_0x0a3e('0x3')]('/',controller[_0x0a3e('0x4')]);router[_0x0a3e('0x3')](_0x0a3e('0x5'),controller[_0x0a3e('0x6')]);router['post'](_0x0a3e('0x7'),controller['reset']);module[_0x0a3e('0x8')]=router; \ No newline at end of file +var _0xf661=['reset','exports','express','Router','./authLocal.controller','post','/forgot','forgot','/reset/:token'];(function(_0x70854a,_0x41c1ba){var _0x55a004=function(_0x5de2af){while(--_0x5de2af){_0x70854a['push'](_0x70854a['shift']());}};_0x55a004(++_0x41c1ba);}(_0xf661,0x6e));var _0x1f66=function(_0x3a3473,_0x56a37e){_0x3a3473=_0x3a3473-0x0;var _0x11ab5c=_0xf661[_0x3a3473];return _0x11ab5c;};'use strict';var express=require(_0x1f66('0x0'));var router=express[_0x1f66('0x1')]();var controller=require(_0x1f66('0x2'));router[_0x1f66('0x3')]('/',controller['login']);router[_0x1f66('0x3')](_0x1f66('0x4'),controller[_0x1f66('0x5')]);router[_0x1f66('0x3')](_0x1f66('0x6'),controller[_0x1f66('0x7')]);module[_0x1f66('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 f7c1c8e..11ea55e 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 _0xffe1=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x2c130a,_0x1e6b5f){var _0x1688c8=function(_0x17b1d5){while(--_0x17b1d5){_0x2c130a['push'](_0x2c130a['shift']());}};_0x1688c8(++_0x1e6b5f);}(_0xffe1,0xab));var _0x1ffe=function(_0x1b7544,_0x1c53fd){_0x1b7544=_0x1b7544-0x0;var _0x48fe3a=_0xffe1[_0x1b7544];return _0x48fe3a;};'use strict';var Sequelize=require(_0x1ffe('0x0'));module['exports']={'name':{'type':Sequelize[_0x1ffe('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x1ffe('0x1')]},'description':{'type':Sequelize[_0x1ffe('0x1')]},'status':{'type':Sequelize[_0x1ffe('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1ffe('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x9027=['STRING','BOOLEAN','exports'];(function(_0x2e7f96,_0x2ffe43){var _0x315277=function(_0x26bcae){while(--_0x26bcae){_0x2e7f96['push'](_0x2e7f96['shift']());}};_0x315277(++_0x2ffe43);}(_0x9027,0xfb));var _0x7902=function(_0x14a34e,_0xbd7c8c){_0x14a34e=_0x14a34e-0x0;var _0x3b12ae=_0x9027[_0x14a34e];return _0x3b12ae;};'use strict';var Sequelize=require('sequelize');module[_0x7902('0x0')]={'name':{'type':Sequelize[_0x7902('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x7902('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x7902('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 019847e..bc9031a 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 _0x21b6=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','update','body','addConditions','Condition','ids','omit','getConditions','addActions','getActions','Action','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','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','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','name','send','index','map','Automation','rawAttributes','fieldName','type','model'];(function(_0x42272f,_0x458082){var _0x14d4e6=function(_0x43b52f){while(--_0x43b52f){_0x42272f['push'](_0x42272f['shift']());}};_0x14d4e6(++_0x458082);}(_0x21b6,0x1c1));var _0x621b=function(_0x31d08c,_0x2e04d4){_0x31d08c=_0x31d08c-0x0;var _0xc59ae2=_0x21b6[_0x31d08c];return _0xc59ae2;};'use strict';var emlformat=require(_0x621b('0x0'));var rimraf=require(_0x621b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x621b('0x2'));var rp=require(_0x621b('0x3'));var moment=require(_0x621b('0x4'));var BPromise=require(_0x621b('0x5'));var Mustache=require(_0x621b('0x6'));var util=require(_0x621b('0x7'));var path=require(_0x621b('0x8'));var sox=require(_0x621b('0x9'));var csv=require(_0x621b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x621b('0xb'));var squel=require(_0x621b('0xc'));var crypto=require(_0x621b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x621b('0xe'));var toCsv=require(_0x621b('0xa'));var querystring=require('querystring');var Papa=require(_0x621b('0xf'));var Redis=require(_0x621b('0x10'));var authService=require(_0x621b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x621b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x621b('0x13'))(_0x621b('0x14'));var utils=require(_0x621b('0x15'));var config=require(_0x621b('0x16'));var licenseUtil=require(_0x621b('0x17'));var db=require(_0x621b('0x18'))['db'];function respondWithStatusCode(_0x1dea7d,_0x43eb4f){_0x43eb4f=_0x43eb4f||0xcc;return function(_0x147fe7){if(_0x147fe7){return _0x1dea7d[_0x621b('0x19')](_0x43eb4f);}return _0x1dea7d[_0x621b('0x1a')](_0x43eb4f)[_0x621b('0x1b')]();};}function respondWithResult(_0x415aaa,_0x38ab19){_0x38ab19=_0x38ab19||0xc8;return function(_0x5a40f9){if(_0x5a40f9){return _0x415aaa['status'](_0x38ab19)[_0x621b('0x1c')](_0x5a40f9);}};}function respondWithFilteredResult(_0x10cdfe,_0x34429a){return function(_0x3ab7ef){if(_0x3ab7ef){var _0x1a20f6=typeof _0x34429a[_0x621b('0x1d')]===_0x621b('0x1e')&&typeof _0x34429a[_0x621b('0x1f')]===_0x621b('0x1e');var _0x38355f=_0x3ab7ef[_0x621b('0x20')];var _0x37be9d=_0x1a20f6?0x0:_0x34429a['offset'];var _0x3b46f7=_0x1a20f6?_0x3ab7ef['count']:_0x34429a['offset']+_0x34429a[_0x621b('0x1f')];var _0x161202;if(_0x3b46f7>=_0x38355f){_0x3b46f7=_0x38355f;_0x161202=0xc8;}else{_0x161202=0xce;}_0x10cdfe[_0x621b('0x1a')](_0x161202);return _0x10cdfe[_0x621b('0x21')](_0x621b('0x22'),_0x37be9d+'-'+_0x3b46f7+'/'+_0x38355f)['json'](_0x3ab7ef);}return null;};}function patchUpdates(_0x3a8d1e){return function(_0x11f14b){try{jsonpatch[_0x621b('0x23')](_0x11f14b,_0x3a8d1e,!![]);}catch(_0x1e4314){return BPromise['reject'](_0x1e4314);}return _0x11f14b[_0x621b('0x24')]();};}function saveUpdates(_0x26e401,_0x4d6215){return function(_0x4947d9){if(_0x4947d9){return _0x4947d9['update'](_0x26e401)[_0x621b('0x25')](function(_0x22efd6){return _0x22efd6;});}return null;};}function removeEntity(_0x4402a7,_0x5b008a){return function(_0x2f5ef7){if(_0x2f5ef7){return _0x2f5ef7[_0x621b('0x26')]()[_0x621b('0x25')](function(){_0x4402a7[_0x621b('0x1a')](0xcc)[_0x621b('0x1b')]();});}};}function handleEntityNotFound(_0x197734,_0x46ac08){return function(_0x181f15){if(!_0x181f15){_0x197734[_0x621b('0x19')](0x194);}return _0x181f15;};}function handleError(_0x28345f,_0x144254){_0x144254=_0x144254||0x1f4;return function(_0x20f3b4){logger[_0x621b('0x27')](_0x20f3b4['stack']);if(_0x20f3b4[_0x621b('0x28')]){delete _0x20f3b4['name'];}_0x28345f[_0x621b('0x1a')](_0x144254)[_0x621b('0x29')](_0x20f3b4);};}exports[_0x621b('0x2a')]=function(_0x42b8b0,_0x1ee82b){var _0x466c26={},_0x19d467={},_0x29b32f={'count':0x0,'rows':[]};var _0x4957a1=_[_0x621b('0x2b')](db[_0x621b('0x2c')][_0x621b('0x2d')],function(_0x37e7cc){return{'name':_0x37e7cc[_0x621b('0x2e')],'type':_0x37e7cc[_0x621b('0x2f')]['key']};});_0x19d467[_0x621b('0x30')]=_[_0x621b('0x2b')](_0x4957a1,_0x621b('0x28'));_0x19d467[_0x621b('0x31')]=_[_0x621b('0x32')](_0x42b8b0[_0x621b('0x31')]);_0x19d467[_0x621b('0x33')]=_[_0x621b('0x34')](_0x19d467['model'],_0x19d467[_0x621b('0x31')]);_0x466c26[_0x621b('0x35')]=_[_0x621b('0x34')](_0x19d467[_0x621b('0x30')],qs['fields'](_0x42b8b0[_0x621b('0x31')][_0x621b('0x36')]));_0x466c26[_0x621b('0x35')]=_0x466c26[_0x621b('0x35')][_0x621b('0x37')]?_0x466c26[_0x621b('0x35')]:_0x19d467[_0x621b('0x30')];if(!_0x42b8b0[_0x621b('0x31')][_0x621b('0x38')](_0x621b('0x39'))){_0x466c26[_0x621b('0x1f')]=qs[_0x621b('0x1f')](_0x42b8b0[_0x621b('0x31')]['limit']);_0x466c26['offset']=qs['offset'](_0x42b8b0['query'][_0x621b('0x1d')]);}_0x466c26[_0x621b('0x3a')]=qs[_0x621b('0x3b')](_0x42b8b0['query'][_0x621b('0x3b')]);_0x466c26[_0x621b('0x3c')]=qs[_0x621b('0x33')](_[_0x621b('0x3d')](_0x42b8b0[_0x621b('0x31')],_0x19d467[_0x621b('0x33')]),_0x4957a1);if(_0x42b8b0['query'][_0x621b('0x3e')]){_0x466c26[_0x621b('0x3c')]=_[_0x621b('0x3f')](_0x466c26[_0x621b('0x3c')],{'$or':_[_0x621b('0x2b')](_0x4957a1,function(_0x31d597){if(_0x31d597['type']!==_0x621b('0x40')){var _0x26b2bd={};_0x26b2bd[_0x31d597[_0x621b('0x28')]]={'$like':'%'+_0x42b8b0[_0x621b('0x31')][_0x621b('0x3e')]+'%'};return _0x26b2bd;}})});}_0x466c26=_[_0x621b('0x3f')]({},_0x466c26,_0x42b8b0[_0x621b('0x41')]);var _0x4b1689={'where':_0x466c26[_0x621b('0x3c')]};return db['Automation'][_0x621b('0x20')](_0x4b1689)[_0x621b('0x25')](function(_0x2b009a){_0x29b32f[_0x621b('0x20')]=_0x2b009a;if(_0x42b8b0[_0x621b('0x31')][_0x621b('0x42')]){_0x466c26[_0x621b('0x43')]=[{'all':!![]}];}return db[_0x621b('0x2c')]['findAll'](_0x466c26);})[_0x621b('0x25')](function(_0x57a84f){_0x29b32f[_0x621b('0x44')]=_0x57a84f;return _0x29b32f;})[_0x621b('0x25')](respondWithFilteredResult(_0x1ee82b,_0x466c26))[_0x621b('0x45')](handleError(_0x1ee82b,null));};exports['show']=function(_0x3aa5e4,_0x4c94bd){var _0x5cbc4e={'raw':![],'where':{'id':_0x3aa5e4[_0x621b('0x46')]['id']}},_0x1f65a3={};_0x1f65a3[_0x621b('0x30')]=_[_0x621b('0x32')](db[_0x621b('0x2c')][_0x621b('0x2d')]);_0x1f65a3[_0x621b('0x31')]=_['keys'](_0x3aa5e4[_0x621b('0x31')]);_0x1f65a3['filters']=_['intersection'](_0x1f65a3['model'],_0x1f65a3[_0x621b('0x31')]);_0x5cbc4e[_0x621b('0x35')]=_[_0x621b('0x34')](_0x1f65a3[_0x621b('0x30')],qs[_0x621b('0x36')](_0x3aa5e4[_0x621b('0x31')][_0x621b('0x36')]));_0x5cbc4e[_0x621b('0x35')]=_0x5cbc4e['attributes'][_0x621b('0x37')]?_0x5cbc4e[_0x621b('0x35')]:_0x1f65a3[_0x621b('0x30')];if(_0x3aa5e4[_0x621b('0x31')][_0x621b('0x42')]){_0x5cbc4e[_0x621b('0x43')]=[{'all':!![]}];}_0x5cbc4e=_[_0x621b('0x3f')]({},_0x5cbc4e,_0x3aa5e4['options']);return db['Automation'][_0x621b('0x47')](_0x5cbc4e)['then'](handleEntityNotFound(_0x4c94bd,null))[_0x621b('0x25')](respondWithResult(_0x4c94bd,null))[_0x621b('0x45')](handleError(_0x4c94bd,null));};exports[_0x621b('0x48')]=function(_0x1e7d30,_0x257aa9){return db[_0x621b('0x2c')][_0x621b('0x48')](_0x1e7d30['body'],{})[_0x621b('0x25')](respondWithResult(_0x257aa9,0xc9))[_0x621b('0x45')](handleError(_0x257aa9,null));};exports[_0x621b('0x49')]=function(_0x5d6a26,_0x33174b){if(_0x5d6a26['body']['id']){delete _0x5d6a26[_0x621b('0x4a')]['id'];}return db[_0x621b('0x2c')][_0x621b('0x47')]({'where':{'id':_0x5d6a26[_0x621b('0x46')]['id']}})['then'](handleEntityNotFound(_0x33174b,null))['then'](saveUpdates(_0x5d6a26[_0x621b('0x4a')],null))['then'](respondWithResult(_0x33174b,null))[_0x621b('0x45')](handleError(_0x33174b,null));};exports[_0x621b('0x26')]=function(_0x31a59b,_0x2a2200){return db[_0x621b('0x2c')]['find']({'where':{'id':_0x31a59b['params']['id']}})['then'](handleEntityNotFound(_0x2a2200,null))['then'](removeEntity(_0x2a2200,null))[_0x621b('0x45')](handleError(_0x2a2200,null));};exports[_0x621b('0x4b')]=function(_0x377e58,_0x559a82,_0x9134c2){return db[_0x621b('0x4c')][_0x621b('0x47')]({'where':{'id':_0x377e58[_0x621b('0x46')]['id']}})[_0x621b('0x25')](handleEntityNotFound(_0x559a82,null))[_0x621b('0x25')](function(_0x551e58){if(_0x551e58){return _0x551e58['addConditions'](_0x377e58[_0x621b('0x4a')][_0x621b('0x4d')],_[_0x621b('0x4e')](_0x377e58[_0x621b('0x4a')],['ids','id'])||{});}})[_0x621b('0x25')](respondWithResult(_0x559a82,null))[_0x621b('0x45')](handleError(_0x559a82,null));};exports['getConditions']=function(_0x1fb364,_0x27955d,_0x30d083){var _0x931381={};var _0x2e92ad={};var _0x5cc5ec;var _0x444dc3;return db[_0x621b('0x2c')]['findOne']({'where':{'id':_0x1fb364[_0x621b('0x46')]['id']}})['then'](handleEntityNotFound(_0x27955d,null))[_0x621b('0x25')](function(_0x458506){if(_0x458506){_0x5cc5ec=_0x458506;_0x2e92ad[_0x621b('0x30')]=_[_0x621b('0x32')](db[_0x621b('0x4c')][_0x621b('0x2d')]);_0x2e92ad[_0x621b('0x31')]=_['keys'](_0x1fb364[_0x621b('0x31')]);_0x2e92ad[_0x621b('0x33')]=_[_0x621b('0x34')](_0x2e92ad[_0x621b('0x30')],_0x2e92ad['query']);_0x931381[_0x621b('0x35')]=_['intersection'](_0x2e92ad[_0x621b('0x30')],qs[_0x621b('0x36')](_0x1fb364[_0x621b('0x31')][_0x621b('0x36')]));_0x931381[_0x621b('0x35')]=_0x931381[_0x621b('0x35')][_0x621b('0x37')]?_0x931381[_0x621b('0x35')]:_0x2e92ad[_0x621b('0x30')];_0x931381[_0x621b('0x3a')]=qs['sort'](_0x1fb364[_0x621b('0x31')]['sort']);_0x931381[_0x621b('0x3c')]=qs[_0x621b('0x33')](_[_0x621b('0x3d')](_0x1fb364[_0x621b('0x31')],_0x2e92ad['filters']));if(_0x1fb364[_0x621b('0x31')][_0x621b('0x3e')]){_0x931381[_0x621b('0x3c')]=_['merge'](_0x931381['where'],{'$or':_[_0x621b('0x2b')](_0x931381[_0x621b('0x35')],function(_0x27e319){var _0x3d999a={};_0x3d999a[_0x27e319]={'$like':'%'+_0x1fb364[_0x621b('0x31')][_0x621b('0x3e')]+'%'};return _0x3d999a;})});}_0x931381=_['merge']({},_0x931381,_0x1fb364['options']);return _0x5cc5ec[_0x621b('0x4f')](_0x931381);}})[_0x621b('0x25')](function(_0x445420){if(_0x445420){_0x444dc3=_0x445420[_0x621b('0x37')];if(!_0x1fb364[_0x621b('0x31')]['hasOwnProperty'](_0x621b('0x39'))){_0x931381[_0x621b('0x1f')]=qs['limit'](_0x1fb364[_0x621b('0x31')][_0x621b('0x1f')]);_0x931381['offset']=qs[_0x621b('0x1d')](_0x1fb364[_0x621b('0x31')][_0x621b('0x1d')]);}return _0x5cc5ec['getConditions'](_0x931381);}})[_0x621b('0x25')](function(_0x5f83fb){if(_0x5f83fb){return _0x5f83fb?{'count':_0x444dc3,'rows':_0x5f83fb}:null;}})[_0x621b('0x25')](respondWithResult(_0x27955d,null))['catch'](handleError(_0x27955d,null));};exports[_0x621b('0x50')]=function(_0x4fd3df,_0x5210d0,_0x1c2522){return db['Action'][_0x621b('0x47')]({'where':{'id':_0x4fd3df['params']['id']}})[_0x621b('0x25')](handleEntityNotFound(_0x5210d0,null))[_0x621b('0x25')](function(_0x21895){if(_0x21895){return _0x21895[_0x621b('0x50')](_0x4fd3df[_0x621b('0x4a')][_0x621b('0x4d')],_[_0x621b('0x4e')](_0x4fd3df[_0x621b('0x4a')],[_0x621b('0x4d'),'id'])||{});}})[_0x621b('0x25')](respondWithResult(_0x5210d0,null))[_0x621b('0x45')](handleError(_0x5210d0,null));};exports[_0x621b('0x51')]=function(_0x1f8b32,_0xaeb3b4,_0x3bd22f){var _0x5392ee={};var _0x4d7ee1={};var _0x35cafb;var _0x4e74c3;return db[_0x621b('0x2c')]['findOne']({'where':{'id':_0x1f8b32[_0x621b('0x46')]['id']}})['then'](handleEntityNotFound(_0xaeb3b4,null))['then'](function(_0x453874){if(_0x453874){_0x35cafb=_0x453874;_0x4d7ee1[_0x621b('0x30')]=_[_0x621b('0x32')](db[_0x621b('0x52')][_0x621b('0x2d')]);_0x4d7ee1[_0x621b('0x31')]=_['keys'](_0x1f8b32['query']);_0x4d7ee1[_0x621b('0x33')]=_[_0x621b('0x34')](_0x4d7ee1[_0x621b('0x30')],_0x4d7ee1[_0x621b('0x31')]);_0x5392ee[_0x621b('0x35')]=_['intersection'](_0x4d7ee1['model'],qs['fields'](_0x1f8b32[_0x621b('0x31')][_0x621b('0x36')]));_0x5392ee['attributes']=_0x5392ee['attributes']['length']?_0x5392ee[_0x621b('0x35')]:_0x4d7ee1[_0x621b('0x30')];_0x5392ee['order']=qs[_0x621b('0x3b')](_0x1f8b32['query'][_0x621b('0x3b')]);_0x5392ee[_0x621b('0x3c')]=qs['filters'](_[_0x621b('0x3d')](_0x1f8b32[_0x621b('0x31')],_0x4d7ee1['filters']));if(_0x1f8b32['query'][_0x621b('0x3e')]){_0x5392ee[_0x621b('0x3c')]=_[_0x621b('0x3f')](_0x5392ee[_0x621b('0x3c')],{'$or':_['map'](_0x5392ee['attributes'],function(_0x47ef5d){var _0x18e005={};_0x18e005[_0x47ef5d]={'$like':'%'+_0x1f8b32[_0x621b('0x31')][_0x621b('0x3e')]+'%'};return _0x18e005;})});}_0x5392ee=_[_0x621b('0x3f')]({},_0x5392ee,_0x1f8b32['options']);return _0x35cafb[_0x621b('0x51')](_0x5392ee);}})[_0x621b('0x25')](function(_0x52466a){if(_0x52466a){_0x4e74c3=_0x52466a['length'];if(!_0x1f8b32[_0x621b('0x31')][_0x621b('0x38')](_0x621b('0x39'))){_0x5392ee[_0x621b('0x1f')]=qs[_0x621b('0x1f')](_0x1f8b32['query'][_0x621b('0x1f')]);_0x5392ee[_0x621b('0x1d')]=qs[_0x621b('0x1d')](_0x1f8b32[_0x621b('0x31')]['offset']);}return _0x35cafb[_0x621b('0x51')](_0x5392ee);}})[_0x621b('0x25')](function(_0x4b8aa5){if(_0x4b8aa5){return _0x4b8aa5?{'count':_0x4e74c3,'rows':_0x4b8aa5}:null;}})[_0x621b('0x25')](respondWithResult(_0xaeb3b4,null))['catch'](handleError(_0xaeb3b4,null));}; \ No newline at end of file +var _0xbe25=['index','map','Automation','rawAttributes','fieldName','key','query','filters','intersection','attributes','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','fields','options','find','create','body','update','Condition','addConditions','omit','ids','findOne','getConditions','addActions','Action','getActions','order','eml-format','rimraf','fast-json-patch','request-promise','moment','util','to-csv','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','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','stack','name','send'];(function(_0x2cfedd,_0x4537b4){var _0x246997=function(_0xc665b7){while(--_0xc665b7){_0x2cfedd['push'](_0x2cfedd['shift']());}};_0x246997(++_0x4537b4);}(_0xbe25,0xd0));var _0x5be2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xbe25[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x5be2('0x0'));var rimraf=require(_0x5be2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5be2('0x2'));var rp=require(_0x5be2('0x3'));var moment=require(_0x5be2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5be2('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5be2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5be2('0x7'));var _=require(_0x5be2('0x8'));var squel=require(_0x5be2('0x9'));var crypto=require(_0x5be2('0xa'));var jsforce=require(_0x5be2('0xb'));var deskjs=require(_0x5be2('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5be2('0xd'));var Papa=require(_0x5be2('0xe'));var Redis=require(_0x5be2('0xf'));var authService=require(_0x5be2('0x10'));var qs=require(_0x5be2('0x11'));var as=require(_0x5be2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5be2('0x13'));var utils=require(_0x5be2('0x14'));var config=require(_0x5be2('0x15'));var licenseUtil=require(_0x5be2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e6b97,_0x75e0aa){_0x75e0aa=_0x75e0aa||0xcc;return function(_0x13a811){if(_0x13a811){return _0x1e6b97[_0x5be2('0x17')](_0x75e0aa);}return _0x1e6b97[_0x5be2('0x18')](_0x75e0aa)[_0x5be2('0x19')]();};}function respondWithResult(_0x1bc296,_0x358108){_0x358108=_0x358108||0xc8;return function(_0x58d5f8){if(_0x58d5f8){return _0x1bc296[_0x5be2('0x18')](_0x358108)[_0x5be2('0x1a')](_0x58d5f8);}};}function respondWithFilteredResult(_0x4d8982,_0x42c440){return function(_0x11f18b){if(_0x11f18b){var _0x23a210=typeof _0x42c440[_0x5be2('0x1b')]===_0x5be2('0x1c')&&typeof _0x42c440[_0x5be2('0x1d')]===_0x5be2('0x1c');var _0x40ea61=_0x11f18b[_0x5be2('0x1e')];var _0x520758=_0x23a210?0x0:_0x42c440[_0x5be2('0x1b')];var _0x2c309e=_0x23a210?_0x11f18b[_0x5be2('0x1e')]:_0x42c440[_0x5be2('0x1b')]+_0x42c440[_0x5be2('0x1d')];var _0x24b279;if(_0x2c309e>=_0x40ea61){_0x2c309e=_0x40ea61;_0x24b279=0xc8;}else{_0x24b279=0xce;}_0x4d8982[_0x5be2('0x18')](_0x24b279);return _0x4d8982['set'](_0x5be2('0x1f'),_0x520758+'-'+_0x2c309e+'/'+_0x40ea61)[_0x5be2('0x1a')](_0x11f18b);}return null;};}function patchUpdates(_0x14886b){return function(_0x27b020){try{jsonpatch[_0x5be2('0x20')](_0x27b020,_0x14886b,!![]);}catch(_0x4793cc){return BPromise[_0x5be2('0x21')](_0x4793cc);}return _0x27b020['save']();};}function saveUpdates(_0x55d5b3,_0xcc5b){return function(_0x240390){if(_0x240390){return _0x240390['update'](_0x55d5b3)[_0x5be2('0x22')](function(_0x563dec){return _0x563dec;});}return null;};}function removeEntity(_0x5ce77f,_0x4dc105){return function(_0x23d04f){if(_0x23d04f){return _0x23d04f['destroy']()['then'](function(){_0x5ce77f[_0x5be2('0x18')](0xcc)[_0x5be2('0x19')]();});}};}function handleEntityNotFound(_0x6bd2fa,_0x1d5b9b){return function(_0x55db9b){if(!_0x55db9b){_0x6bd2fa[_0x5be2('0x17')](0x194);}return _0x55db9b;};}function handleError(_0x5491a3,_0x54ab1e){_0x54ab1e=_0x54ab1e||0x1f4;return function(_0x456be9){logger['error'](_0x456be9[_0x5be2('0x23')]);if(_0x456be9[_0x5be2('0x24')]){delete _0x456be9['name'];}_0x5491a3[_0x5be2('0x18')](_0x54ab1e)[_0x5be2('0x25')](_0x456be9);};}exports[_0x5be2('0x26')]=function(_0x565d38,_0xdda074){var _0x178cc0={},_0x25c1b2={},_0x452b9d={'count':0x0,'rows':[]};var _0x35ef66=_[_0x5be2('0x27')](db[_0x5be2('0x28')][_0x5be2('0x29')],function(_0x4ef1f7){return{'name':_0x4ef1f7[_0x5be2('0x2a')],'type':_0x4ef1f7['type'][_0x5be2('0x2b')]};});_0x25c1b2['model']=_[_0x5be2('0x27')](_0x35ef66,_0x5be2('0x24'));_0x25c1b2[_0x5be2('0x2c')]=_['keys'](_0x565d38[_0x5be2('0x2c')]);_0x25c1b2[_0x5be2('0x2d')]=_['intersection'](_0x25c1b2['model'],_0x25c1b2[_0x5be2('0x2c')]);_0x178cc0['attributes']=_[_0x5be2('0x2e')](_0x25c1b2['model'],qs['fields'](_0x565d38[_0x5be2('0x2c')]['fields']));_0x178cc0[_0x5be2('0x2f')]=_0x178cc0[_0x5be2('0x2f')][_0x5be2('0x30')]?_0x178cc0[_0x5be2('0x2f')]:_0x25c1b2[_0x5be2('0x31')];if(!_0x565d38['query'][_0x5be2('0x32')](_0x5be2('0x33'))){_0x178cc0[_0x5be2('0x1d')]=qs[_0x5be2('0x1d')](_0x565d38[_0x5be2('0x2c')][_0x5be2('0x1d')]);_0x178cc0[_0x5be2('0x1b')]=qs[_0x5be2('0x1b')](_0x565d38[_0x5be2('0x2c')]['offset']);}_0x178cc0['order']=qs[_0x5be2('0x34')](_0x565d38[_0x5be2('0x2c')][_0x5be2('0x34')]);_0x178cc0[_0x5be2('0x35')]=qs[_0x5be2('0x2d')](_[_0x5be2('0x36')](_0x565d38[_0x5be2('0x2c')],_0x25c1b2[_0x5be2('0x2d')]),_0x35ef66);if(_0x565d38[_0x5be2('0x2c')][_0x5be2('0x37')]){_0x178cc0['where']=_[_0x5be2('0x38')](_0x178cc0[_0x5be2('0x35')],{'$or':_[_0x5be2('0x27')](_0x35ef66,function(_0x1e9d9f){if(_0x1e9d9f[_0x5be2('0x39')]!==_0x5be2('0x3a')){var _0xa5f26={};_0xa5f26[_0x1e9d9f[_0x5be2('0x24')]]={'$like':'%'+_0x565d38['query']['filter']+'%'};return _0xa5f26;}})});}_0x178cc0=_[_0x5be2('0x38')]({},_0x178cc0,_0x565d38['options']);var _0x5b0784={'where':_0x178cc0['where']};return db['Automation'][_0x5be2('0x1e')](_0x5b0784)['then'](function(_0x1454ad){_0x452b9d[_0x5be2('0x1e')]=_0x1454ad;if(_0x565d38[_0x5be2('0x2c')][_0x5be2('0x3b')]){_0x178cc0[_0x5be2('0x3c')]=[{'all':!![]}];}return db[_0x5be2('0x28')][_0x5be2('0x3d')](_0x178cc0);})[_0x5be2('0x22')](function(_0x50a0bb){_0x452b9d[_0x5be2('0x3e')]=_0x50a0bb;return _0x452b9d;})[_0x5be2('0x22')](respondWithFilteredResult(_0xdda074,_0x178cc0))[_0x5be2('0x3f')](handleError(_0xdda074,null));};exports['show']=function(_0x4b94cb,_0x39d3d2){var _0x366cc6={'raw':![],'where':{'id':_0x4b94cb[_0x5be2('0x40')]['id']}},_0x3458e2={};_0x3458e2[_0x5be2('0x31')]=_['keys'](db[_0x5be2('0x28')][_0x5be2('0x29')]);_0x3458e2[_0x5be2('0x2c')]=_[_0x5be2('0x41')](_0x4b94cb['query']);_0x3458e2[_0x5be2('0x2d')]=_[_0x5be2('0x2e')](_0x3458e2[_0x5be2('0x31')],_0x3458e2['query']);_0x366cc6['attributes']=_[_0x5be2('0x2e')](_0x3458e2[_0x5be2('0x31')],qs['fields'](_0x4b94cb[_0x5be2('0x2c')][_0x5be2('0x42')]));_0x366cc6[_0x5be2('0x2f')]=_0x366cc6['attributes'][_0x5be2('0x30')]?_0x366cc6[_0x5be2('0x2f')]:_0x3458e2['model'];if(_0x4b94cb['query'][_0x5be2('0x3b')]){_0x366cc6[_0x5be2('0x3c')]=[{'all':!![]}];}_0x366cc6=_[_0x5be2('0x38')]({},_0x366cc6,_0x4b94cb[_0x5be2('0x43')]);return db[_0x5be2('0x28')][_0x5be2('0x44')](_0x366cc6)[_0x5be2('0x22')](handleEntityNotFound(_0x39d3d2,null))['then'](respondWithResult(_0x39d3d2,null))[_0x5be2('0x3f')](handleError(_0x39d3d2,null));};exports['create']=function(_0x35f5e0,_0x3d64ec){return db['Automation'][_0x5be2('0x45')](_0x35f5e0[_0x5be2('0x46')],{})[_0x5be2('0x22')](respondWithResult(_0x3d64ec,0xc9))['catch'](handleError(_0x3d64ec,null));};exports[_0x5be2('0x47')]=function(_0x2e42f0,_0x42b491){if(_0x2e42f0['body']['id']){delete _0x2e42f0['body']['id'];}return db[_0x5be2('0x28')][_0x5be2('0x44')]({'where':{'id':_0x2e42f0[_0x5be2('0x40')]['id']}})[_0x5be2('0x22')](handleEntityNotFound(_0x42b491,null))[_0x5be2('0x22')](saveUpdates(_0x2e42f0[_0x5be2('0x46')],null))['then'](respondWithResult(_0x42b491,null))[_0x5be2('0x3f')](handleError(_0x42b491,null));};exports['destroy']=function(_0x177877,_0x328e77){return db[_0x5be2('0x28')][_0x5be2('0x44')]({'where':{'id':_0x177877[_0x5be2('0x40')]['id']}})['then'](handleEntityNotFound(_0x328e77,null))[_0x5be2('0x22')](removeEntity(_0x328e77,null))[_0x5be2('0x3f')](handleError(_0x328e77,null));};exports['addConditions']=function(_0x4f7b9a,_0x129abf,_0x2b9209){return db[_0x5be2('0x48')][_0x5be2('0x44')]({'where':{'id':_0x4f7b9a[_0x5be2('0x40')]['id']}})[_0x5be2('0x22')](handleEntityNotFound(_0x129abf,null))[_0x5be2('0x22')](function(_0x3faf39){if(_0x3faf39){return _0x3faf39[_0x5be2('0x49')](_0x4f7b9a['body']['ids'],_[_0x5be2('0x4a')](_0x4f7b9a['body'],[_0x5be2('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x129abf,null))[_0x5be2('0x3f')](handleError(_0x129abf,null));};exports['getConditions']=function(_0x2a4819,_0x4554b5,_0x237c23){var _0x3dce0e={};var _0x38f8e3={};var _0xac8b17;var _0x30a1d8;return db['Automation'][_0x5be2('0x4c')]({'where':{'id':_0x2a4819[_0x5be2('0x40')]['id']}})[_0x5be2('0x22')](handleEntityNotFound(_0x4554b5,null))['then'](function(_0x22b50b){if(_0x22b50b){_0xac8b17=_0x22b50b;_0x38f8e3[_0x5be2('0x31')]=_['keys'](db[_0x5be2('0x48')]['rawAttributes']);_0x38f8e3[_0x5be2('0x2c')]=_[_0x5be2('0x41')](_0x2a4819[_0x5be2('0x2c')]);_0x38f8e3[_0x5be2('0x2d')]=_['intersection'](_0x38f8e3[_0x5be2('0x31')],_0x38f8e3[_0x5be2('0x2c')]);_0x3dce0e['attributes']=_[_0x5be2('0x2e')](_0x38f8e3[_0x5be2('0x31')],qs[_0x5be2('0x42')](_0x2a4819['query'][_0x5be2('0x42')]));_0x3dce0e[_0x5be2('0x2f')]=_0x3dce0e[_0x5be2('0x2f')][_0x5be2('0x30')]?_0x3dce0e[_0x5be2('0x2f')]:_0x38f8e3[_0x5be2('0x31')];_0x3dce0e['order']=qs[_0x5be2('0x34')](_0x2a4819[_0x5be2('0x2c')][_0x5be2('0x34')]);_0x3dce0e['where']=qs['filters'](_[_0x5be2('0x36')](_0x2a4819[_0x5be2('0x2c')],_0x38f8e3[_0x5be2('0x2d')]));if(_0x2a4819[_0x5be2('0x2c')]['filter']){_0x3dce0e['where']=_[_0x5be2('0x38')](_0x3dce0e['where'],{'$or':_[_0x5be2('0x27')](_0x3dce0e['attributes'],function(_0x179d7c){var _0x51401e={};_0x51401e[_0x179d7c]={'$like':'%'+_0x2a4819[_0x5be2('0x2c')][_0x5be2('0x37')]+'%'};return _0x51401e;})});}_0x3dce0e=_[_0x5be2('0x38')]({},_0x3dce0e,_0x2a4819['options']);return _0xac8b17[_0x5be2('0x4d')](_0x3dce0e);}})[_0x5be2('0x22')](function(_0x51371e){if(_0x51371e){_0x30a1d8=_0x51371e[_0x5be2('0x30')];if(!_0x2a4819['query']['hasOwnProperty'](_0x5be2('0x33'))){_0x3dce0e[_0x5be2('0x1d')]=qs[_0x5be2('0x1d')](_0x2a4819[_0x5be2('0x2c')][_0x5be2('0x1d')]);_0x3dce0e['offset']=qs[_0x5be2('0x1b')](_0x2a4819[_0x5be2('0x2c')][_0x5be2('0x1b')]);}return _0xac8b17[_0x5be2('0x4d')](_0x3dce0e);}})[_0x5be2('0x22')](function(_0x581c17){if(_0x581c17){return _0x581c17?{'count':_0x30a1d8,'rows':_0x581c17}:null;}})[_0x5be2('0x22')](respondWithResult(_0x4554b5,null))[_0x5be2('0x3f')](handleError(_0x4554b5,null));};exports[_0x5be2('0x4e')]=function(_0x1b64dc,_0x3ec730,_0x5527c9){return db[_0x5be2('0x4f')][_0x5be2('0x44')]({'where':{'id':_0x1b64dc['params']['id']}})['then'](handleEntityNotFound(_0x3ec730,null))['then'](function(_0x42ccd2){if(_0x42ccd2){return _0x42ccd2['addActions'](_0x1b64dc[_0x5be2('0x46')][_0x5be2('0x4b')],_[_0x5be2('0x4a')](_0x1b64dc['body'],[_0x5be2('0x4b'),'id'])||{});}})[_0x5be2('0x22')](respondWithResult(_0x3ec730,null))[_0x5be2('0x3f')](handleError(_0x3ec730,null));};exports[_0x5be2('0x50')]=function(_0x128d32,_0x2a96eb,_0x4ef8bf){var _0x2c9952={};var _0x173c29={};var _0x362082;var _0x4d7cdf;return db['Automation'][_0x5be2('0x4c')]({'where':{'id':_0x128d32['params']['id']}})[_0x5be2('0x22')](handleEntityNotFound(_0x2a96eb,null))[_0x5be2('0x22')](function(_0x306efc){if(_0x306efc){_0x362082=_0x306efc;_0x173c29[_0x5be2('0x31')]=_['keys'](db['Action']['rawAttributes']);_0x173c29['query']=_[_0x5be2('0x41')](_0x128d32['query']);_0x173c29[_0x5be2('0x2d')]=_[_0x5be2('0x2e')](_0x173c29['model'],_0x173c29[_0x5be2('0x2c')]);_0x2c9952[_0x5be2('0x2f')]=_[_0x5be2('0x2e')](_0x173c29['model'],qs[_0x5be2('0x42')](_0x128d32[_0x5be2('0x2c')][_0x5be2('0x42')]));_0x2c9952[_0x5be2('0x2f')]=_0x2c9952[_0x5be2('0x2f')]['length']?_0x2c9952[_0x5be2('0x2f')]:_0x173c29[_0x5be2('0x31')];_0x2c9952[_0x5be2('0x51')]=qs[_0x5be2('0x34')](_0x128d32['query'][_0x5be2('0x34')]);_0x2c9952[_0x5be2('0x35')]=qs['filters'](_[_0x5be2('0x36')](_0x128d32[_0x5be2('0x2c')],_0x173c29[_0x5be2('0x2d')]));if(_0x128d32['query'][_0x5be2('0x37')]){_0x2c9952[_0x5be2('0x35')]=_['merge'](_0x2c9952[_0x5be2('0x35')],{'$or':_['map'](_0x2c9952[_0x5be2('0x2f')],function(_0x3c114b){var _0x18e218={};_0x18e218[_0x3c114b]={'$like':'%'+_0x128d32['query'][_0x5be2('0x37')]+'%'};return _0x18e218;})});}_0x2c9952=_[_0x5be2('0x38')]({},_0x2c9952,_0x128d32[_0x5be2('0x43')]);return _0x362082[_0x5be2('0x50')](_0x2c9952);}})[_0x5be2('0x22')](function(_0x19461e){if(_0x19461e){_0x4d7cdf=_0x19461e[_0x5be2('0x30')];if(!_0x128d32[_0x5be2('0x2c')][_0x5be2('0x32')](_0x5be2('0x33'))){_0x2c9952[_0x5be2('0x1d')]=qs[_0x5be2('0x1d')](_0x128d32[_0x5be2('0x2c')][_0x5be2('0x1d')]);_0x2c9952[_0x5be2('0x1b')]=qs[_0x5be2('0x1b')](_0x128d32[_0x5be2('0x2c')][_0x5be2('0x1b')]);}return _0x362082['getActions'](_0x2c9952);}})[_0x5be2('0x22')](function(_0x50a73d){if(_0x50a73d){return _0x50a73d?{'count':_0x4d7cdf,'rows':_0x50a73d}:null;}})[_0x5be2('0x22')](respondWithResult(_0x2a96eb,null))['catch'](handleError(_0x2a96eb,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index c42bbf5..d10224d 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 _0x2fa7=['rimraf','../../config/environment','exports','tools_automations','lodash','../../config/logger','api','bluebird','path'];(function(_0x43b487,_0x21893a){var _0x2f707a=function(_0x477ee0){while(--_0x477ee0){_0x43b487['push'](_0x43b487['shift']());}};_0x2f707a(++_0x21893a);}(_0x2fa7,0xf7));var _0x72fa=function(_0x2b105d,_0x49a464){_0x2b105d=_0x2b105d-0x0;var _0x4a9915=_0x2fa7[_0x2b105d];return _0x4a9915;};'use strict';var _=require(_0x72fa('0x0'));var util=require('util');var logger=require(_0x72fa('0x1'))(_0x72fa('0x2'));var moment=require('moment');var BPromise=require(_0x72fa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x72fa('0x4'));var rimraf=require(_0x72fa('0x5'));var config=require(_0x72fa('0x6'));var attributes=require('./automation.attributes');module[_0x72fa('0x7')]=function(_0x174374,_0x2ac0ad){return _0x174374['define']('Automation',attributes,{'tableName':_0x72fa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c2e=['tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x5e72a3,_0x1c012f){var _0x1c4f8b=function(_0xab9390){while(--_0xab9390){_0x5e72a3['push'](_0x5e72a3['shift']());}};_0x1c4f8b(++_0x1c012f);}(_0x5c2e,0x11e));var _0xe5c2=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x5c2e[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0xe5c2('0x0'));var util=require(_0xe5c2('0x1'));var logger=require(_0xe5c2('0x2'))(_0xe5c2('0x3'));var moment=require(_0xe5c2('0x4'));var BPromise=require(_0xe5c2('0x5'));var rp=require(_0xe5c2('0x6'));var fs=require('fs');var path=require(_0xe5c2('0x7'));var rimraf=require(_0xe5c2('0x8'));var config=require(_0xe5c2('0x9'));var attributes=require(_0xe5c2('0xa'));module[_0xe5c2('0xb')]=function(_0x22840a,_0x247761){return _0x22840a[_0xe5c2('0xc')](_0xe5c2('0xd'),attributes,{'tableName':_0xe5c2('0xe'),'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 05198db..7ee91bc 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 _0x18f3=['rpc','../../config/environment','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x18f3,0x19f));var _0x318f=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x18f3[_0x16d10f];return _0x50c823;};'use strict';var _=require('lodash');var util=require(_0x318f('0x0'));var moment=require(_0x318f('0x1'));var BPromise=require(_0x318f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x318f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x318f('0x4'))(_0x318f('0x5'));var config=require(_0x318f('0x6'));var jayson=require(_0x318f('0x7'));var client=jayson['client'][_0x318f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3579e8,_0x49188c,_0x59abcf){return new BPromise(function(_0x4618c1,_0x547785){return client[_0x318f('0x9')](_0x3579e8,_0x59abcf)[_0x318f('0xa')](function(_0x1479df){logger[_0x318f('0xb')](_0x318f('0xc'),_0x49188c,_0x318f('0xd'));logger[_0x318f('0xe')](_0x318f('0xf'),_0x49188c,_0x318f('0xd'),JSON[_0x318f('0x10')](_0x1479df));if(_0x1479df[_0x318f('0x11')]){if(_0x1479df[_0x318f('0x11')][_0x318f('0x12')]===0x1f4){logger[_0x318f('0x11')](_0x318f('0xc'),_0x49188c,_0x1479df['error']['message']);return _0x547785(_0x1479df[_0x318f('0x11')][_0x318f('0x13')]);}logger[_0x318f('0x11')](_0x318f('0xc'),_0x49188c,_0x1479df[_0x318f('0x11')][_0x318f('0x13')]);return _0x4618c1(_0x1479df[_0x318f('0x11')]['message']);}else{logger[_0x318f('0xb')]('Automation,\x20%s,\x20%s',_0x49188c,'request\x20sent');_0x4618c1(_0x1479df[_0x318f('0x14')][_0x318f('0x13')]);}})['catch'](function(_0x594af8){logger[_0x318f('0x11')]('Automation,\x20%s,\x20%s',_0x49188c,_0x594af8);_0x547785(_0x594af8);});});} \ No newline at end of file +var _0x676c=['then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','Automation,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x4c161c,_0x2545c6){var _0x461d8b=function(_0x5094d9){while(--_0x5094d9){_0x4c161c['push'](_0x4c161c['shift']());}};_0x461d8b(++_0x2545c6);}(_0x676c,0x198));var _0xc676=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x676c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc676('0x0'));var util=require(_0xc676('0x1'));var moment=require(_0xc676('0x2'));var BPromise=require('bluebird');var rs=require(_0xc676('0x3'));var fs=require('fs');var Redis=require(_0xc676('0x4'));var db=require(_0xc676('0x5'))['db'];var utils=require(_0xc676('0x6'));var logger=require(_0xc676('0x7'))(_0xc676('0x8'));var config=require('../../config/environment');var jayson=require(_0xc676('0x9'));var client=jayson[_0xc676('0xa')][_0xc676('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c7510,_0x36fa26,_0x4a71a8){return new BPromise(function(_0x26ad9c,_0x5e8ad4){return client['request'](_0x2c7510,_0x4a71a8)[_0xc676('0xc')](function(_0x27912c){logger['info']('Automation,\x20%s,\x20%s',_0x36fa26,_0xc676('0xd'));logger[_0xc676('0xe')](_0xc676('0xf'),_0x36fa26,'request\x20sent',JSON['stringify'](_0x27912c));if(_0x27912c[_0xc676('0x10')]){if(_0x27912c[_0xc676('0x10')][_0xc676('0x11')]===0x1f4){logger[_0xc676('0x10')]('Automation,\x20%s,\x20%s',_0x36fa26,_0x27912c[_0xc676('0x10')][_0xc676('0x12')]);return _0x5e8ad4(_0x27912c[_0xc676('0x10')][_0xc676('0x12')]);}logger[_0xc676('0x10')](_0xc676('0x13'),_0x36fa26,_0x27912c[_0xc676('0x10')]['message']);return _0x26ad9c(_0x27912c[_0xc676('0x10')]['message']);}else{logger['info'](_0xc676('0x13'),_0x36fa26,'request\x20sent');_0x26ad9c(_0x27912c['result']['message']);}})[_0xc676('0x14')](function(_0x4ee99d){logger[_0xc676('0x10')](_0xc676('0x13'),_0x36fa26,_0x4ee99d);_0x5e8ad4(_0x4ee99d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index c1e73c6..03dede1 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 _0x1f38=['./automation.controller','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2577eb,_0x3aa698){var _0x520e63=function(_0x4e1581){while(--_0x4e1581){_0x2577eb['push'](_0x2577eb['shift']());}};_0x520e63(++_0x3aa698);}(_0x1f38,0xd7));var _0x81f3=function(_0x14c00f,_0x11b192){_0x14c00f=_0x14c00f-0x0;var _0x19fbda=_0x1f38[_0x14c00f];return _0x19fbda;};'use strict';var multer=require(_0x81f3('0x0'));var util=require(_0x81f3('0x1'));var path=require(_0x81f3('0x2'));var timeout=require(_0x81f3('0x3'));var express=require(_0x81f3('0x4'));var router=express[_0x81f3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x81f3('0x6'));var interaction=require(_0x81f3('0x7'));var config=require(_0x81f3('0x8'));var controller=require(_0x81f3('0x9'));router[_0x81f3('0xa')]('/',auth['isAuthenticated'](),controller[_0x81f3('0xb')]);router[_0x81f3('0xa')](_0x81f3('0xc'),auth[_0x81f3('0xd')](),controller[_0x81f3('0xe')]);router[_0x81f3('0xa')](_0x81f3('0xf'),auth[_0x81f3('0xd')](),controller[_0x81f3('0x10')]);router[_0x81f3('0xa')](_0x81f3('0x11'),auth['isAuthenticated'](),controller[_0x81f3('0x12')]);router[_0x81f3('0x13')]('/',auth[_0x81f3('0xd')](),controller[_0x81f3('0x14')]);router[_0x81f3('0x13')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x81f3('0x15')]);router[_0x81f3('0x13')](_0x81f3('0x11'),auth[_0x81f3('0xd')](),controller[_0x81f3('0x16')]);router[_0x81f3('0x17')]('/:id',auth[_0x81f3('0xd')](),controller[_0x81f3('0x18')]);router[_0x81f3('0x19')]('/:id',auth[_0x81f3('0xd')](),controller[_0x81f3('0x1a')]);module[_0x81f3('0x1b')]=router; \ No newline at end of file +var _0x0ef0=['index','show','/:id/conditions','/:id/actions','post','create','addConditions','addActions','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0ef0,0x80));var _0x00ef=function(_0x3c5aa6,_0x4c4f86){_0x3c5aa6=_0x3c5aa6-0x0;var _0x49e397=_0x0ef0[_0x3c5aa6];return _0x49e397;};'use strict';var multer=require(_0x00ef('0x0'));var util=require(_0x00ef('0x1'));var path=require('path');var timeout=require(_0x00ef('0x2'));var express=require(_0x00ef('0x3'));var router=express[_0x00ef('0x4')]();var fs_extra=require(_0x00ef('0x5'));var auth=require(_0x00ef('0x6'));var interaction=require(_0x00ef('0x7'));var config=require('../../config/environment');var controller=require('./automation.controller');router[_0x00ef('0x8')]('/',auth[_0x00ef('0x9')](),controller[_0x00ef('0xa')]);router[_0x00ef('0x8')]('/:id',auth[_0x00ef('0x9')](),controller[_0x00ef('0xb')]);router[_0x00ef('0x8')](_0x00ef('0xc'),auth[_0x00ef('0x9')](),controller['getConditions']);router[_0x00ef('0x8')](_0x00ef('0xd'),auth[_0x00ef('0x9')](),controller['getActions']);router[_0x00ef('0xe')]('/',auth['isAuthenticated'](),controller[_0x00ef('0xf')]);router[_0x00ef('0xe')](_0x00ef('0xc'),auth[_0x00ef('0x9')](),controller[_0x00ef('0x10')]);router['post'](_0x00ef('0xd'),auth['isAuthenticated'](),controller[_0x00ef('0x11')]);router[_0x00ef('0x12')](_0x00ef('0x13'),auth['isAuthenticated'](),controller[_0x00ef('0x14')]);router['delete']('/:id',auth[_0x00ef('0x9')](),controller[_0x00ef('0x15')]);module[_0x00ef('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 6f7047a..515c4c9 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 _0x7de0=['ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM'];(function(_0x4625b1,_0x214560){var _0x3b00d5=function(_0x4177ec){while(--_0x4177ec){_0x4625b1['push'](_0x4625b1['shift']());}};_0x3b00d5(++_0x214560);}(_0x7de0,0x17c));var _0x07de=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x7de0[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0x07de('0x0'));module[_0x07de('0x1')]={'name':{'type':Sequelize[_0x07de('0x2')],'unique':_0x07de('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x07de('0x4')](_0x07de('0x5')),'allowNull':![],'defaultValue':_0x07de('0x5')},'description':{'type':Sequelize[_0x07de('0x2')]},'active':{'type':Sequelize[_0x07de('0x6')],'defaultValue':0x0,'comment':_0x07de('0x7')},'limitCalls':{'type':Sequelize[_0x07de('0x8')](0x4)[_0x07de('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x07de('0xa')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x07de('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x07de('0x8')](0x3)[_0x07de('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x07de('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x07de('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x07de('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x07de('0x8')](0x5)[_0x07de('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x07de('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x07de('0x8')](0x3)[_0x07de('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x07de('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0x07de('0x8')](0x5)[_0x07de('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x07de('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x07de('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x07de('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x07de('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x07de('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x07de('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x07de('0x10'),_0x07de('0x11'),_0x07de('0x12')),'defaultValue':_0x07de('0x10')},'dialAMDActive':{'type':Sequelize[_0x07de('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x07de('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x07de('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x07de('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x07de('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x07de('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x07de('0x8')](0x9)[_0x07de('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x07de('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x07de('0x8')](0x9)[_0x07de('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x07de('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x07de('0x8')](0x9)[_0x07de('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x07de('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x07de('0x8')](0x9)[_0x07de('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x07de('0x8')](0x5)[_0x07de('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x07de('0x8')](0x9)[_0x07de('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x07de('0x4')](_0x07de('0x18'),_0x07de('0x19')),'defaultValue':_0x07de('0x18')},'dialPrefix':{'type':Sequelize[_0x07de('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x07de('0x8')](0x3)[_0x07de('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x07de('0x1a')},'dialCutDigit':{'type':Sequelize[_0x07de('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x07de('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x07de('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x07de('0x8')](0x5)[_0x07de('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x07de('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0x07de('0x8')](0x3)[_0x07de('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x07de('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x07de('0x8')](0x5)[_0x07de('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x07de('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x07de('0x8')](0x3)[_0x07de('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x07de('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x07de('0x8')](0x3)[_0x07de('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x07de('0x8')](0x5)[_0x07de('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x07de('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x07de('0x8')](0x3)[_0x07de('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x07de('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x07de('0x8')](0x5)[_0x07de('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x07de('0x22')}}; \ No newline at end of file +var _0x5b2e=['#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)'];(function(_0x569e0d,_0x292024){var _0x29789f=function(_0x1d3f07){while(--_0x1d3f07){_0x569e0d['push'](_0x569e0d['shift']());}};_0x29789f(++_0x292024);}(_0x5b2e,0x147));var _0xe5b2=function(_0x71afd6,_0x19a6d1){_0x71afd6=_0x71afd6-0x0;var _0x420e2d=_0x5b2e[_0x71afd6];return _0x420e2d;};'use strict';var Sequelize=require(_0xe5b2('0x0'));module[_0xe5b2('0x1')]={'name':{'type':Sequelize[_0xe5b2('0x2')],'unique':_0xe5b2('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xe5b2('0x4')](_0xe5b2('0x5')),'allowNull':![],'defaultValue':_0xe5b2('0x5')},'description':{'type':Sequelize[_0xe5b2('0x2')]},'active':{'type':Sequelize[_0xe5b2('0x6')],'defaultValue':0x0,'comment':_0xe5b2('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xe5b2('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xe5b2('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe5b2('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xe5b2('0xa')](0x3)[_0xe5b2('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe5b2('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe5b2('0xa')](0x3)[_0xe5b2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe5b2('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe5b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe5b2('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0xe5b2('0xa')](0x3)[_0xe5b2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe5b2('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe5b2('0xa')](0x5)[_0xe5b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe5b2('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe5b2('0x8')],'defaultValue':0x3,'comment':_0xe5b2('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe5b2('0xa')](0x5)[_0xe5b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe5b2('0x11')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe5b2('0xa')](0x3)[_0xe5b2('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe5b2('0x12')},'dialTimezone':{'type':Sequelize[_0xe5b2('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe5b2('0x2')],'defaultValue':_0xe5b2('0x13')},'dialCheckDuplicateType':{'type':Sequelize[_0xe5b2('0x4')]('always','never',_0xe5b2('0x14')),'defaultValue':_0xe5b2('0x15')},'dialAMDActive':{'type':Sequelize[_0xe5b2('0x6')],'defaultValue':0x0,'comment':_0xe5b2('0x16')},'dialAMDInitialSilence':{'type':Sequelize[_0xe5b2('0xa')](0x9)[_0xe5b2('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xe5b2('0xa')](0x9)[_0xe5b2('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe5b2('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe5b2('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe5b2('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe5b2('0xa')](0x9)[_0xe5b2('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe5b2('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0xe5b2('0xa')](0x9)[_0xe5b2('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe5b2('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe5b2('0xa')](0x9)[_0xe5b2('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe5b2('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe5b2('0xa')](0x9)[_0xe5b2('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe5b2('0xa')](0x5)[_0xe5b2('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xe5b2('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe5b2('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe5b2('0x4')](_0xe5b2('0x1d'),_0xe5b2('0x1e')),'defaultValue':_0xe5b2('0x1d')},'dialPrefix':{'type':Sequelize[_0xe5b2('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe5b2('0xa')](0x3)[_0xe5b2('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe5b2('0x1f')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xe5b2('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe5b2('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe5b2('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe5b2('0x21')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe5b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe5b2('0x22')},'dialDropMaxRetry':{'type':Sequelize[_0xe5b2('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xe5b2('0xa')](0x5)[_0xe5b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe5b2('0xa')](0x3)[_0xe5b2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe5b2('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe5b2('0xa')](0x5)[_0xe5b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe5b2('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0xe5b2('0xa')](0x3)[_0xe5b2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe5b2('0x25')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe5b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe5b2('0xa')](0x3)[_0xe5b2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe5b2('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe5b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe5b2('0x27')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index eb0dcda..062c315 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 _0xc664=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../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','Content-Range','reject','save','update','then','destroy','get','sendStatus','error','stack','name','index','map','Campaign','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','options','include','findAll','params','keys','rawAttributes','includeAll','merge','find','catch','create','user','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','clone','length','omit','createdAt','updatedAt','body','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','order','CampaignId','CmHopper','rows','getHopperHistories','CmHopperHistory','getHopperFinals','pick','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','ListId','select','field','phone','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','insert','NOW()','ContactId','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','CmList','getBlackLists','addBlackLists'];(function(_0xa20ed6,_0xe77cb0){var _0xa09de6=function(_0x3d0f51){while(--_0x3d0f51){_0xa20ed6['push'](_0xa20ed6['shift']());}};_0xa09de6(++_0xe77cb0);}(_0xc664,0x90));var _0x4c66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc664[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4c66('0x0'));var rimraf=require(_0x4c66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c66('0x2'));var rp=require(_0x4c66('0x3'));var moment=require(_0x4c66('0x4'));var BPromise=require(_0x4c66('0x5'));var Mustache=require(_0x4c66('0x6'));var util=require('util');var path=require(_0x4c66('0x7'));var sox=require(_0x4c66('0x8'));var csv=require(_0x4c66('0x9'));var ejs=require(_0x4c66('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4c66('0xb'));var squel=require(_0x4c66('0xc'));var crypto=require(_0x4c66('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4c66('0x9'));var querystring=require(_0x4c66('0xe'));var Papa=require(_0x4c66('0xf'));var Redis=require(_0x4c66('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4c66('0x11'));var as=require(_0x4c66('0x12'));var hardwareService=require(_0x4c66('0x13'));var logger=require(_0x4c66('0x14'))(_0x4c66('0x15'));var utils=require(_0x4c66('0x16'));var config=require(_0x4c66('0x17'));var licenseUtil=require(_0x4c66('0x18'));var db=require(_0x4c66('0x19'))['db'];function respondWithStatusCode(_0x497cdf,_0x49d412){_0x49d412=_0x49d412||0xcc;return function(_0x51b6f9){if(_0x51b6f9){return _0x497cdf['sendStatus'](_0x49d412);}return _0x497cdf[_0x4c66('0x1a')](_0x49d412)[_0x4c66('0x1b')]();};}function respondWithResult(_0x1b3135,_0x5833b7){_0x5833b7=_0x5833b7||0xc8;return function(_0x1d37a5){if(_0x1d37a5){return _0x1b3135[_0x4c66('0x1a')](_0x5833b7)[_0x4c66('0x1c')](_0x1d37a5);}};}function respondWithFilteredResult(_0x16b20d,_0x46280e){return function(_0x23d1b6){if(_0x23d1b6){var _0x108f8c=typeof _0x46280e[_0x4c66('0x1d')]===_0x4c66('0x1e')&&typeof _0x46280e[_0x4c66('0x1f')]===_0x4c66('0x1e');var _0x541c11=_0x23d1b6[_0x4c66('0x20')];var _0x1a85cc=_0x108f8c?0x0:_0x46280e[_0x4c66('0x1d')];var _0x4d1a49=_0x108f8c?_0x23d1b6['count']:_0x46280e['offset']+_0x46280e['limit'];var _0x1cfd00;if(_0x4d1a49>=_0x541c11){_0x4d1a49=_0x541c11;_0x1cfd00=0xc8;}else{_0x1cfd00=0xce;}_0x16b20d[_0x4c66('0x1a')](_0x1cfd00);return _0x16b20d['set'](_0x4c66('0x21'),_0x1a85cc+'-'+_0x4d1a49+'/'+_0x541c11)['json'](_0x23d1b6);}return null;};}function patchUpdates(_0x160601){return function(_0x53af34){try{jsonpatch['apply'](_0x53af34,_0x160601,!![]);}catch(_0x53c879){return BPromise[_0x4c66('0x22')](_0x53c879);}return _0x53af34[_0x4c66('0x23')]();};}function saveUpdates(_0x19c37d,_0x862fa4){return function(_0x20bc50){if(_0x20bc50){return _0x20bc50[_0x4c66('0x24')](_0x19c37d)[_0x4c66('0x25')](function(_0x963188){return _0x963188;});}return null;};}function removeEntity(_0x2e6126,_0x362e69){return function(_0x35084b){if(_0x35084b){return _0x35084b[_0x4c66('0x26')]()['then'](function(){var _0x195f6e=_0x35084b[_0x4c66('0x27')]({'plain':!![]});var _0x2881e4='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x2881e4,'resourceId':_0x195f6e['id']}})[_0x4c66('0x25')](function(){return _0x35084b;});})[_0x4c66('0x25')](function(){_0x2e6126[_0x4c66('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cfc9f,_0xb9d88a){return function(_0x5921a7){if(!_0x5921a7){_0x2cfc9f[_0x4c66('0x28')](0x194);}return _0x5921a7;};}function handleError(_0x176e95,_0x14c1d3){_0x14c1d3=_0x14c1d3||0x1f4;return function(_0x2f9d56){logger[_0x4c66('0x29')](_0x2f9d56[_0x4c66('0x2a')]);if(_0x2f9d56[_0x4c66('0x2b')]){delete _0x2f9d56[_0x4c66('0x2b')];}_0x176e95[_0x4c66('0x1a')](_0x14c1d3)['send'](_0x2f9d56);};}exports[_0x4c66('0x2c')]=function(_0x75656c,_0x404c10){var _0x597872={},_0x17db64={},_0x454755={'count':0x0,'rows':[]};var _0x32c5dc=_[_0x4c66('0x2d')](db[_0x4c66('0x2e')]['rawAttributes'],function(_0x5eaab4){return{'name':_0x5eaab4[_0x4c66('0x2f')],'type':_0x5eaab4[_0x4c66('0x30')][_0x4c66('0x31')]};});_0x17db64['model']=_[_0x4c66('0x2d')](_0x32c5dc,'name');_0x17db64[_0x4c66('0x32')]=_['keys'](_0x75656c[_0x4c66('0x32')]);_0x17db64[_0x4c66('0x33')]=_[_0x4c66('0x34')](_0x17db64[_0x4c66('0x35')],_0x17db64[_0x4c66('0x32')]);_0x597872[_0x4c66('0x36')]=_[_0x4c66('0x34')](_0x17db64[_0x4c66('0x35')],qs[_0x4c66('0x37')](_0x75656c[_0x4c66('0x32')][_0x4c66('0x37')]));_0x597872[_0x4c66('0x36')]=_0x597872['attributes']['length']?_0x597872[_0x4c66('0x36')]:_0x17db64['model'];if(!_0x75656c[_0x4c66('0x32')][_0x4c66('0x38')](_0x4c66('0x39'))){_0x597872[_0x4c66('0x1f')]=qs['limit'](_0x75656c[_0x4c66('0x32')][_0x4c66('0x1f')]);_0x597872[_0x4c66('0x1d')]=qs[_0x4c66('0x1d')](_0x75656c[_0x4c66('0x32')][_0x4c66('0x1d')]);}_0x597872['order']=qs['sort'](_0x75656c['query'][_0x4c66('0x3a')]);_0x597872['where']=qs[_0x4c66('0x33')](_['pick'](_0x75656c[_0x4c66('0x32')],_0x17db64['filters']),_0x32c5dc);if(_0x75656c[_0x4c66('0x32')][_0x4c66('0x3b')]){_0x597872[_0x4c66('0x3c')]=_['merge'](_0x597872[_0x4c66('0x3c')],{'$or':_[_0x4c66('0x2d')](_0x32c5dc,function(_0x4842ef){if(_0x4842ef[_0x4c66('0x30')]!==_0x4c66('0x3d')){var _0x3b0b36={};_0x3b0b36[_0x4842ef['name']]={'$like':'%'+_0x75656c[_0x4c66('0x32')][_0x4c66('0x3b')]+'%'};return _0x3b0b36;}})});}_0x597872=_['merge']({},_0x597872,_0x75656c[_0x4c66('0x3e')]);var _0x478ce4={'where':_0x597872[_0x4c66('0x3c')]};return db[_0x4c66('0x2e')][_0x4c66('0x20')](_0x478ce4)['then'](function(_0xc7a687){_0x454755[_0x4c66('0x20')]=_0xc7a687;if(_0x75656c['query']['includeAll']){_0x597872[_0x4c66('0x3f')]=[{'all':!![]}];}return db[_0x4c66('0x2e')][_0x4c66('0x40')](_0x597872);})[_0x4c66('0x25')](function(_0x5eb957){_0x454755['rows']=_0x5eb957;return _0x454755;})[_0x4c66('0x25')](respondWithFilteredResult(_0x404c10,_0x597872))['catch'](handleError(_0x404c10,null));};exports['show']=function(_0x4b8fe5,_0x27e8fe){var _0x3c5d75={'raw':![],'where':{'id':_0x4b8fe5[_0x4c66('0x41')]['id']}},_0x414603={};_0x414603[_0x4c66('0x35')]=_[_0x4c66('0x42')](db[_0x4c66('0x2e')][_0x4c66('0x43')]);_0x414603[_0x4c66('0x32')]=_[_0x4c66('0x42')](_0x4b8fe5[_0x4c66('0x32')]);_0x414603['filters']=_[_0x4c66('0x34')](_0x414603[_0x4c66('0x35')],_0x414603[_0x4c66('0x32')]);_0x3c5d75['attributes']=_['intersection'](_0x414603[_0x4c66('0x35')],qs[_0x4c66('0x37')](_0x4b8fe5['query'][_0x4c66('0x37')]));_0x3c5d75[_0x4c66('0x36')]=_0x3c5d75[_0x4c66('0x36')]['length']?_0x3c5d75[_0x4c66('0x36')]:_0x414603['model'];if(_0x4b8fe5[_0x4c66('0x32')][_0x4c66('0x44')]){_0x3c5d75[_0x4c66('0x3f')]=[{'all':!![]}];}_0x3c5d75=_[_0x4c66('0x45')]({},_0x3c5d75,_0x4b8fe5[_0x4c66('0x3e')]);return db[_0x4c66('0x2e')][_0x4c66('0x46')](_0x3c5d75)[_0x4c66('0x25')](handleEntityNotFound(_0x27e8fe,null))[_0x4c66('0x25')](respondWithResult(_0x27e8fe,null))[_0x4c66('0x47')](handleError(_0x27e8fe,null));};exports[_0x4c66('0x48')]=function(_0x388499,_0x23d036){return db['Campaign'][_0x4c66('0x48')](_0x388499['body'],{})[_0x4c66('0x25')](function(_0x4330bd){var _0x2444f=_0x388499[_0x4c66('0x49')][_0x4c66('0x27')]({'plain':!![]});if(!_0x2444f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2444f['role']===_0x4c66('0x49')){var _0x46dd9b=_0x4330bd[_0x4c66('0x27')]({'plain':!![]});var _0x1c45e3=_0x4c66('0x4a');return db[_0x4c66('0x4b')]['find']({'where':{'name':_0x1c45e3,'userProfileId':_0x2444f[_0x4c66('0x4c')]},'raw':!![]})[_0x4c66('0x25')](function(_0x4e4dbf){if(_0x4e4dbf&&_0x4e4dbf[_0x4c66('0x4d')]===0x0){return db[_0x4c66('0x4e')][_0x4c66('0x48')]({'name':_0x46dd9b[_0x4c66('0x2b')],'resourceId':_0x46dd9b['id'],'type':_0x4e4dbf['name'],'sectionId':_0x4e4dbf['id']},{})[_0x4c66('0x25')](function(){return _0x4330bd;});}else{return _0x4330bd;}})[_0x4c66('0x47')](function(_0x1efdc7){logger[_0x4c66('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1efdc7);throw _0x1efdc7;});}return _0x4330bd;})[_0x4c66('0x25')](respondWithResult(_0x23d036,0xc9))[_0x4c66('0x47')](handleError(_0x23d036,null));};exports[_0x4c66('0x4f')]=function(_0x296d23,_0x28634b){var _0x56dfb3={'where':{'id':_0x296d23['params']['id']}},_0x5c73ad={};_0x5c73ad[_0x4c66('0x35')]=_[_0x4c66('0x42')](db[_0x4c66('0x2e')][_0x4c66('0x43')]);_0x56dfb3[_0x4c66('0x36')]=_[_0x4c66('0x34')](_0x5c73ad[_0x4c66('0x35')],qs['fields'](_0x296d23['query']['fields']));_0x56dfb3[_0x4c66('0x36')]=_0x56dfb3[_0x4c66('0x36')][_0x4c66('0x50')]?_0x56dfb3[_0x4c66('0x36')]:_0x5c73ad['model'];if(_0x296d23[_0x4c66('0x32')][_0x4c66('0x44')]){_0x56dfb3['include']=[{'all':!![]}];}_0x56dfb3=_[_0x4c66('0x45')]({},_0x56dfb3,_0x296d23[_0x4c66('0x3e')]);return db[_0x4c66('0x2e')]['find'](_0x56dfb3)['then'](handleEntityNotFound(_0x28634b,null))[_0x4c66('0x25')](function(_0x331f82){if(_0x331f82){var _0x141266=_0x331f82[_0x4c66('0x27')]({'plain':!![]});_0x141266=qs[_0x4c66('0x51')](_0x141266,['id',_0x4c66('0x52'),_0x4c66('0x53')]);_0x296d23[_0x4c66('0x54')]=_['omit'](_0x296d23[_0x4c66('0x54')],['id','createdAt',_0x4c66('0x53')]);return db['Campaign'][_0x4c66('0x48')](_[_0x4c66('0x45')](_0x141266,_0x296d23[_0x4c66('0x54')]),{'include':_0x296d23[_0x4c66('0x32')][_0x4c66('0x44')]?[{'all':!![]}]:undefined})[_0x4c66('0x25')](function(_0x1d1dbf){var _0x2c318e=_0x296d23[_0x4c66('0x49')]['get']({'plain':!![]});if(!_0x2c318e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c318e[_0x4c66('0x55')]===_0x4c66('0x49')){var _0x222e1f=_0x1d1dbf[_0x4c66('0x27')]({'plain':!![]});var _0xb7e4be=_0x4c66('0x4a');return db['UserProfileSection'][_0x4c66('0x46')]({'where':{'name':_0xb7e4be,'userProfileId':_0x2c318e[_0x4c66('0x4c')]},'raw':!![]})[_0x4c66('0x25')](function(_0x36efed){if(_0x36efed&&_0x36efed[_0x4c66('0x4d')]===0x0){return db[_0x4c66('0x4e')][_0x4c66('0x48')]({'name':_0x222e1f[_0x4c66('0x2b')],'resourceId':_0x222e1f['id'],'type':_0x36efed[_0x4c66('0x2b')],'sectionId':_0x36efed['id']},{})[_0x4c66('0x25')](function(){return _0x1d1dbf;});}else{return _0x1d1dbf;}})[_0x4c66('0x47')](function(_0x44182c){logger[_0x4c66('0x29')](_0x4c66('0x56'),_0x44182c);throw _0x44182c;});}return _0x1d1dbf;});}})[_0x4c66('0x25')](respondWithResult(_0x28634b,0xc9))[_0x4c66('0x47')](handleError(_0x28634b,null));};exports[_0x4c66('0x24')]=function(_0x25580d,_0x379fdf){if(_0x25580d[_0x4c66('0x54')]['id']){delete _0x25580d[_0x4c66('0x54')]['id'];}return db[_0x4c66('0x2e')][_0x4c66('0x46')]({'where':{'id':_0x25580d[_0x4c66('0x41')]['id']}})['then'](handleEntityNotFound(_0x379fdf,null))[_0x4c66('0x25')](saveUpdates(_0x25580d[_0x4c66('0x54')],null))[_0x4c66('0x25')](respondWithResult(_0x379fdf,null))[_0x4c66('0x47')](handleError(_0x379fdf,null));};exports[_0x4c66('0x26')]=function(_0x40a87d,_0x448039){return db[_0x4c66('0x2e')][_0x4c66('0x46')]({'where':{'id':_0x40a87d[_0x4c66('0x41')]['id']}})['then'](handleEntityNotFound(_0x448039,null))[_0x4c66('0x25')](removeEntity(_0x448039,null))['catch'](handleError(_0x448039,null));};exports[_0x4c66('0x57')]=function(_0x73b27b,_0x4b4473,_0x3e7d83){var _0x58d4c5={'raw':!![],'where':{}};var _0x26086c={};var _0x507bab={'count':0x0,'rows':[]};return db[_0x4c66('0x2e')][_0x4c66('0x58')]({'where':{'id':_0x73b27b[_0x4c66('0x41')]['id']}})[_0x4c66('0x25')](handleEntityNotFound(_0x4b4473,null))[_0x4c66('0x25')](function(_0x39db47){if(_0x39db47){_0x26086c[_0x4c66('0x35')]=_[_0x4c66('0x42')](db['CmHopper'][_0x4c66('0x43')]);_0x26086c[_0x4c66('0x32')]=_[_0x4c66('0x42')](_0x73b27b[_0x4c66('0x32')]);_0x26086c[_0x4c66('0x33')]=_['intersection'](_0x26086c[_0x4c66('0x35')],_0x26086c[_0x4c66('0x32')]);_0x58d4c5['attributes']=_[_0x4c66('0x34')](_0x26086c[_0x4c66('0x35')],qs['fields'](_0x73b27b[_0x4c66('0x32')][_0x4c66('0x37')]));_0x58d4c5['attributes']=_0x58d4c5['attributes'][_0x4c66('0x50')]?_0x58d4c5[_0x4c66('0x36')]:_0x26086c[_0x4c66('0x35')];if(!_0x73b27b[_0x4c66('0x32')][_0x4c66('0x38')](_0x4c66('0x39'))){_0x58d4c5[_0x4c66('0x1f')]=qs[_0x4c66('0x1f')](_0x73b27b[_0x4c66('0x32')][_0x4c66('0x1f')]);_0x58d4c5[_0x4c66('0x1d')]=qs['offset'](_0x73b27b['query']['offset']);}_0x58d4c5[_0x4c66('0x59')]=qs[_0x4c66('0x3a')](_0x73b27b[_0x4c66('0x32')][_0x4c66('0x3a')]);_0x58d4c5[_0x4c66('0x3c')]=qs[_0x4c66('0x33')](_['pick'](_0x73b27b['query'],_0x26086c[_0x4c66('0x33')]));_0x58d4c5['where'][_0x4c66('0x5a')]=_0x39db47['id'];if(_0x73b27b[_0x4c66('0x32')][_0x4c66('0x3b')]){_0x58d4c5[_0x4c66('0x3c')]=_[_0x4c66('0x45')](_0x58d4c5[_0x4c66('0x3c')],{'$or':_[_0x4c66('0x2d')](_0x58d4c5[_0x4c66('0x36')],function(_0x36dfdb){var _0x26071b={};_0x26071b[_0x36dfdb]={'$like':'%'+_0x73b27b[_0x4c66('0x32')][_0x4c66('0x3b')]+'%'};return _0x26071b;})});}_0x58d4c5=_[_0x4c66('0x45')]({},_0x58d4c5,_0x73b27b[_0x4c66('0x3e')]);return db['CmHopper'][_0x4c66('0x20')]({'where':_0x58d4c5[_0x4c66('0x3c')]})[_0x4c66('0x25')](function(_0xf70cbb){_0x507bab[_0x4c66('0x20')]=_0xf70cbb;if(_0x73b27b[_0x4c66('0x32')][_0x4c66('0x44')]){_0x58d4c5['include']=[{'all':!![]}];}return db[_0x4c66('0x5b')][_0x4c66('0x40')](_0x58d4c5);})[_0x4c66('0x25')](function(_0x10815f){_0x507bab[_0x4c66('0x5c')]=_0x10815f;return _0x507bab;});}})[_0x4c66('0x25')](respondWithFilteredResult(_0x4b4473,_0x58d4c5))[_0x4c66('0x47')](handleError(_0x4b4473,null));};exports[_0x4c66('0x5d')]=function(_0x18da89,_0x2b51fa,_0x4b177a){var _0x366dd0={'raw':!![],'where':{}};var _0x1f1219={};var _0x45245e={'count':0x0,'rows':[]};return db[_0x4c66('0x2e')][_0x4c66('0x58')]({'where':{'id':_0x18da89[_0x4c66('0x41')]['id']}})[_0x4c66('0x25')](handleEntityNotFound(_0x2b51fa,null))[_0x4c66('0x25')](function(_0x1e9482){if(_0x1e9482){_0x1f1219[_0x4c66('0x35')]=_[_0x4c66('0x42')](db[_0x4c66('0x5e')][_0x4c66('0x43')]);_0x1f1219[_0x4c66('0x32')]=_[_0x4c66('0x42')](_0x18da89[_0x4c66('0x32')]);_0x1f1219[_0x4c66('0x33')]=_[_0x4c66('0x34')](_0x1f1219[_0x4c66('0x35')],_0x1f1219[_0x4c66('0x32')]);_0x366dd0[_0x4c66('0x36')]=_['intersection'](_0x1f1219[_0x4c66('0x35')],qs['fields'](_0x18da89[_0x4c66('0x32')][_0x4c66('0x37')]));_0x366dd0[_0x4c66('0x36')]=_0x366dd0[_0x4c66('0x36')]['length']?_0x366dd0[_0x4c66('0x36')]:_0x1f1219[_0x4c66('0x35')];if(!_0x18da89[_0x4c66('0x32')][_0x4c66('0x38')](_0x4c66('0x39'))){_0x366dd0['limit']=qs[_0x4c66('0x1f')](_0x18da89['query']['limit']);_0x366dd0[_0x4c66('0x1d')]=qs[_0x4c66('0x1d')](_0x18da89['query'][_0x4c66('0x1d')]);}_0x366dd0[_0x4c66('0x59')]=qs[_0x4c66('0x3a')](_0x18da89[_0x4c66('0x32')]['sort']);_0x366dd0[_0x4c66('0x3c')]=qs[_0x4c66('0x33')](_['pick'](_0x18da89[_0x4c66('0x32')],_0x1f1219[_0x4c66('0x33')]));_0x366dd0[_0x4c66('0x3c')][_0x4c66('0x5a')]=_0x1e9482['id'];if(_0x18da89['query'][_0x4c66('0x3b')]){_0x366dd0['where']=_[_0x4c66('0x45')](_0x366dd0['where'],{'$or':_[_0x4c66('0x2d')](_0x366dd0[_0x4c66('0x36')],function(_0x4a6262){var _0x4b8117={};_0x4b8117[_0x4a6262]={'$like':'%'+_0x18da89[_0x4c66('0x32')][_0x4c66('0x3b')]+'%'};return _0x4b8117;})});}_0x366dd0=_[_0x4c66('0x45')]({},_0x366dd0,_0x18da89[_0x4c66('0x3e')]);return db[_0x4c66('0x5e')][_0x4c66('0x20')]({'where':_0x366dd0[_0x4c66('0x3c')]})[_0x4c66('0x25')](function(_0x2f0321){_0x45245e[_0x4c66('0x20')]=_0x2f0321;if(_0x18da89[_0x4c66('0x32')][_0x4c66('0x44')]){_0x366dd0[_0x4c66('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4c66('0x40')](_0x366dd0);})['then'](function(_0x2e9b69){_0x45245e[_0x4c66('0x5c')]=_0x2e9b69;return _0x45245e;});}})['then'](respondWithFilteredResult(_0x2b51fa,_0x366dd0))[_0x4c66('0x47')](handleError(_0x2b51fa,null));};exports[_0x4c66('0x5f')]=function(_0x2b52ce,_0x4181c4,_0x135b67){var _0x1470da={'raw':!![],'where':{}};var _0x1d5271={};var _0x363e98={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x2b52ce['params']['id']}})[_0x4c66('0x25')](handleEntityNotFound(_0x4181c4,null))[_0x4c66('0x25')](function(_0x28a657){if(_0x28a657){_0x1d5271[_0x4c66('0x35')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x1d5271[_0x4c66('0x32')]=_[_0x4c66('0x42')](_0x2b52ce['query']);_0x1d5271[_0x4c66('0x33')]=_[_0x4c66('0x34')](_0x1d5271[_0x4c66('0x35')],_0x1d5271[_0x4c66('0x32')]);_0x1470da['attributes']=_[_0x4c66('0x34')](_0x1d5271['model'],qs[_0x4c66('0x37')](_0x2b52ce[_0x4c66('0x32')]['fields']));_0x1470da[_0x4c66('0x36')]=_0x1470da[_0x4c66('0x36')][_0x4c66('0x50')]?_0x1470da[_0x4c66('0x36')]:_0x1d5271[_0x4c66('0x35')];if(!_0x2b52ce[_0x4c66('0x32')][_0x4c66('0x38')](_0x4c66('0x39'))){_0x1470da['limit']=qs[_0x4c66('0x1f')](_0x2b52ce['query'][_0x4c66('0x1f')]);_0x1470da[_0x4c66('0x1d')]=qs[_0x4c66('0x1d')](_0x2b52ce[_0x4c66('0x32')][_0x4c66('0x1d')]);}_0x1470da[_0x4c66('0x59')]=qs[_0x4c66('0x3a')](_0x2b52ce[_0x4c66('0x32')][_0x4c66('0x3a')]);_0x1470da[_0x4c66('0x3c')]=qs['filters'](_[_0x4c66('0x60')](_0x2b52ce[_0x4c66('0x32')],_0x1d5271['filters']));_0x1470da['where']['CampaignId']=_0x28a657['id'];if(_0x2b52ce[_0x4c66('0x32')][_0x4c66('0x3b')]){_0x1470da['where']=_[_0x4c66('0x45')](_0x1470da['where'],{'$or':_['map'](_0x1470da[_0x4c66('0x36')],function(_0x2fdc10){var _0x1c44e1={};_0x1c44e1[_0x2fdc10]={'$like':'%'+_0x2b52ce[_0x4c66('0x32')][_0x4c66('0x3b')]+'%'};return _0x1c44e1;})});}_0x1470da=_[_0x4c66('0x45')]({},_0x1470da,_0x2b52ce['options']);return db[_0x4c66('0x61')]['count']({'where':_0x1470da['where']})[_0x4c66('0x25')](function(_0x24a969){_0x363e98['count']=_0x24a969;if(_0x2b52ce[_0x4c66('0x32')][_0x4c66('0x44')]){_0x1470da[_0x4c66('0x3f')]=[{'all':!![]}];}return db[_0x4c66('0x61')]['findAll'](_0x1470da);})[_0x4c66('0x25')](function(_0x3cef93){_0x363e98[_0x4c66('0x5c')]=_0x3cef93;return _0x363e98;});}})[_0x4c66('0x25')](respondWithFilteredResult(_0x4181c4,_0x1470da))[_0x4c66('0x47')](handleError(_0x4181c4,null));};exports[_0x4c66('0x62')]=function(_0x33dd3b,_0xc1ba95,_0x1ffffa){var _0x186f39={'raw':!![],'where':{}};var _0x39c100={};var _0x114ca9={'count':0x0,'rows':[]};return db[_0x4c66('0x2e')][_0x4c66('0x58')]({'where':{'id':_0x33dd3b[_0x4c66('0x41')]['id']}})['then'](handleEntityNotFound(_0xc1ba95,null))[_0x4c66('0x25')](function(_0x5074d0){if(_0x5074d0){_0x39c100[_0x4c66('0x35')]=_[_0x4c66('0x42')](db[_0x4c66('0x63')][_0x4c66('0x43')]);_0x39c100[_0x4c66('0x32')]=_[_0x4c66('0x42')](_0x33dd3b[_0x4c66('0x32')]);_0x39c100[_0x4c66('0x33')]=_[_0x4c66('0x34')](_0x39c100[_0x4c66('0x35')],_0x39c100[_0x4c66('0x32')]);_0x186f39[_0x4c66('0x36')]=_[_0x4c66('0x34')](_0x39c100[_0x4c66('0x35')],qs[_0x4c66('0x37')](_0x33dd3b[_0x4c66('0x32')]['fields']));_0x186f39['attributes']=_0x186f39[_0x4c66('0x36')]['length']?_0x186f39[_0x4c66('0x36')]:_0x39c100['model'];if(!_0x33dd3b[_0x4c66('0x32')][_0x4c66('0x38')](_0x4c66('0x39'))){_0x186f39[_0x4c66('0x1f')]=qs[_0x4c66('0x1f')](_0x33dd3b['query'][_0x4c66('0x1f')]);_0x186f39['offset']=qs[_0x4c66('0x1d')](_0x33dd3b[_0x4c66('0x32')][_0x4c66('0x1d')]);}_0x186f39['order']=qs['sort'](_0x33dd3b[_0x4c66('0x32')][_0x4c66('0x3a')]);_0x186f39[_0x4c66('0x3c')]=qs[_0x4c66('0x33')](_[_0x4c66('0x60')](_0x33dd3b[_0x4c66('0x32')],_0x39c100[_0x4c66('0x33')]));_0x186f39[_0x4c66('0x3c')][_0x4c66('0x5a')]=_0x5074d0['id'];if(_0x33dd3b[_0x4c66('0x32')][_0x4c66('0x3b')]){_0x186f39[_0x4c66('0x3c')]=_[_0x4c66('0x45')](_0x186f39[_0x4c66('0x3c')],{'$or':_[_0x4c66('0x2d')](_0x186f39['attributes'],function(_0xd5ea8c){var _0x3f7438={};_0x3f7438[_0xd5ea8c]={'$like':'%'+_0x33dd3b[_0x4c66('0x32')][_0x4c66('0x3b')]+'%'};return _0x3f7438;})});}_0x186f39=_[_0x4c66('0x45')]({},_0x186f39,_0x33dd3b[_0x4c66('0x3e')]);return db[_0x4c66('0x63')][_0x4c66('0x20')]({'where':_0x186f39['where']})['then'](function(_0x4e5a15){_0x114ca9[_0x4c66('0x20')]=_0x4e5a15;if(_0x33dd3b[_0x4c66('0x32')][_0x4c66('0x44')]){_0x186f39[_0x4c66('0x3f')]=[{'all':!![]}];}return db[_0x4c66('0x63')][_0x4c66('0x40')](_0x186f39);})[_0x4c66('0x25')](function(_0x2f847f){_0x114ca9[_0x4c66('0x5c')]=_0x2f847f;return _0x114ca9;});}})[_0x4c66('0x25')](respondWithFilteredResult(_0xc1ba95,_0x186f39))[_0x4c66('0x47')](handleError(_0xc1ba95,null));};exports[_0x4c66('0x64')]=function(_0x4f284d,_0x386545,_0x5278b0){var _0xa0f4de={};var _0x101d30={};var _0x3f647d;var _0x5c2230;return db['Campaign'][_0x4c66('0x58')]({'where':{'id':_0x4f284d['params']['id']}})[_0x4c66('0x25')](handleEntityNotFound(_0x386545,null))[_0x4c66('0x25')](function(_0x401890){if(_0x401890){_0x3f647d=_0x401890;_0x101d30[_0x4c66('0x35')]=_[_0x4c66('0x42')](db['CmList']['rawAttributes']);_0x101d30[_0x4c66('0x32')]=_[_0x4c66('0x42')](_0x4f284d[_0x4c66('0x32')]);_0x101d30['filters']=_[_0x4c66('0x34')](_0x101d30['model'],_0x101d30[_0x4c66('0x32')]);_0xa0f4de['attributes']=_[_0x4c66('0x34')](_0x101d30[_0x4c66('0x35')],qs['fields'](_0x4f284d[_0x4c66('0x32')]['fields']));_0xa0f4de[_0x4c66('0x36')]=_0xa0f4de[_0x4c66('0x36')]['length']?_0xa0f4de[_0x4c66('0x36')]:_0x101d30[_0x4c66('0x35')];_0xa0f4de[_0x4c66('0x59')]=qs[_0x4c66('0x3a')](_0x4f284d[_0x4c66('0x32')]['sort']);_0xa0f4de[_0x4c66('0x3c')]=qs[_0x4c66('0x33')](_[_0x4c66('0x60')](_0x4f284d['query'],_0x101d30[_0x4c66('0x33')]));if(_0x4f284d[_0x4c66('0x32')][_0x4c66('0x3b')]){_0xa0f4de['where']=_['merge'](_0xa0f4de[_0x4c66('0x3c')],{'$or':_['map'](_0xa0f4de['attributes'],function(_0x26319d){var _0x46e172={};_0x46e172[_0x26319d]={'$like':'%'+_0x4f284d[_0x4c66('0x32')][_0x4c66('0x3b')]+'%'};return _0x46e172;})});}_0xa0f4de=_[_0x4c66('0x45')]({},_0xa0f4de,_0x4f284d[_0x4c66('0x3e')]);return _0x3f647d[_0x4c66('0x64')](_0xa0f4de);}})[_0x4c66('0x25')](function(_0xd42e41){if(_0xd42e41){_0x5c2230=_0xd42e41[_0x4c66('0x50')];if(!_0x4f284d['query'][_0x4c66('0x38')](_0x4c66('0x39'))){_0xa0f4de[_0x4c66('0x1f')]=qs[_0x4c66('0x1f')](_0x4f284d[_0x4c66('0x32')]['limit']);_0xa0f4de[_0x4c66('0x1d')]=qs[_0x4c66('0x1d')](_0x4f284d[_0x4c66('0x32')]['offset']);}return _0x3f647d[_0x4c66('0x64')](_0xa0f4de);}})[_0x4c66('0x25')](function(_0x2cc5ee){if(_0x2cc5ee){return _0x2cc5ee?{'count':_0x5c2230,'rows':_0x2cc5ee}:null;}})[_0x4c66('0x25')](respondWithResult(_0x386545,null))['catch'](handleError(_0x386545,null));};exports[_0x4c66('0x65')]=function(_0x43106e,_0x44586b,_0x16845c){var _0x3138d8,_0x56f9ad;var _0xedf932=[];var _0x51459e=moment()[_0x4c66('0x66')](_0x4c66('0x67'));return db['Campaign'][_0x4c66('0x46')]({'where':{'id':_0x43106e[_0x4c66('0x41')]['id']}})[_0x4c66('0x25')](handleEntityNotFound(_0x44586b,null))[_0x4c66('0x25')](function(_0x378bca){if(_0x378bca){_0x56f9ad=_0x378bca;return _0x378bca[_0x4c66('0x65')](_0x43106e[_0x4c66('0x54')]['ids'],_[_0x4c66('0x51')](_0x43106e[_0x4c66('0x54')],[_0x4c66('0x68'),'id'])||{});}return null;})['spread'](function(_0x339380){var _0x32271d;var _0x1b79f9;_0x3138d8=_0x339380||[];var _0x5e543a=[];if(_0x339380){for(var _0x45aa93=0x0;_0x45aa93<_0x339380[_0x4c66('0x50')];_0x45aa93+=0x1){var _0x287fe5=_0x339380[_0x45aa93][_0x4c66('0x27')]({'plain':!![]});_0x56f9ad[_0x4c66('0x69')]=_0x43106e[_0x4c66('0x54')]['dialCheckDuplicateType']?_0x43106e['body'][_0x4c66('0x69')]:_0x56f9ad[_0x4c66('0x69')];switch(_0x56f9ad[_0x4c66('0x69')]){case _0x4c66('0x6a'):_0x32271d=squel['insert']()[_0x4c66('0x6b')](_0x4c66('0x6c'))[_0x4c66('0x6d')](['phone',_0x4c66('0x6e'),'ContactId',_0x4c66('0x6f'),'CampaignId',_0x4c66('0x52'),_0x4c66('0x53')],squel[_0x4c66('0x70')]()[_0x4c66('0x71')](_0x4c66('0x72'),_0x4c66('0x72'))[_0x4c66('0x71')]('NOW()',_0x4c66('0x6e'))[_0x4c66('0x71')]('id','ContactId')[_0x4c66('0x71')](_0x287fe5['CmListId'][_0x4c66('0x73')](),_0x4c66('0x6f'))['field'](_0x43106e[_0x4c66('0x41')]['id'][_0x4c66('0x73')](),_0x4c66('0x5a'))['field']('\x27'+_0x51459e+'\x27',_0x4c66('0x52'))[_0x4c66('0x71')]('\x27'+_0x51459e+'\x27',_0x4c66('0x53'))[_0x4c66('0x74')](_0x4c66('0x75'))[_0x4c66('0x3c')](_0x4c66('0x76'))[_0x4c66('0x3c')](_0x4c66('0x77'),_0x287fe5[_0x4c66('0x78')][_0x4c66('0x73')]())[_0x4c66('0x3c')](_0x4c66('0x79'))['where'](_0x4c66('0x7a'),squel[_0x4c66('0x70')]()['field'](_0x4c66('0x7b'))[_0x4c66('0x74')](_0x4c66('0x7c'))[_0x4c66('0x3c')](_0x4c66('0x7d'),_0x43106e[_0x4c66('0x41')]['id'][_0x4c66('0x73')]()))[_0x4c66('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x4c66('0x70')]()[_0x4c66('0x71')]('COALESCE(phone,\x27\x27)')['from'](_0x4c66('0x6c'))['where'](_0x4c66('0x7d'),_0x43106e[_0x4c66('0x41')]['id'][_0x4c66('0x73')]())))['toString']();break;case'onlyIfOpen':_0x32271d=squel[_0x4c66('0x7e')]()[_0x4c66('0x6b')](_0x4c66('0x6c'))[_0x4c66('0x6d')](['phone',_0x4c66('0x6e'),'ContactId',_0x4c66('0x6f'),'CampaignId',_0x4c66('0x52'),_0x4c66('0x53')],squel[_0x4c66('0x70')]()[_0x4c66('0x71')](_0x4c66('0x72'),'phone')['field'](_0x4c66('0x7f'),_0x4c66('0x6e'))[_0x4c66('0x71')]('id',_0x4c66('0x80'))['field'](_0x287fe5[_0x4c66('0x78')][_0x4c66('0x73')](),'ListId')[_0x4c66('0x71')](_0x43106e[_0x4c66('0x41')]['id'][_0x4c66('0x73')](),_0x4c66('0x5a'))['field']('\x27'+_0x51459e+'\x27',_0x4c66('0x52'))[_0x4c66('0x71')]('\x27'+_0x51459e+'\x27','updatedAt')[_0x4c66('0x74')](_0x4c66('0x75'))[_0x4c66('0x3c')](_0x4c66('0x76'))[_0x4c66('0x3c')](_0x4c66('0x77'),_0x287fe5['CmListId'][_0x4c66('0x73')]())['where'](_0x4c66('0x79'))['where'](_0x4c66('0x7a'),squel[_0x4c66('0x70')]()['field']('COALESCE(phone,\x27\x27)')[_0x4c66('0x74')](_0x4c66('0x6c'))['where'](_0x4c66('0x7d'),_0x43106e[_0x4c66('0x41')]['id'][_0x4c66('0x73')]())))[_0x4c66('0x73')]();break;default:_0x32271d=squel[_0x4c66('0x7e')]()['into'](_0x4c66('0x6c'))[_0x4c66('0x6d')]([_0x4c66('0x72'),_0x4c66('0x6e'),_0x4c66('0x80'),_0x4c66('0x6f'),_0x4c66('0x5a'),'createdAt','updatedAt'],squel['select']()[_0x4c66('0x71')](_0x4c66('0x72'),_0x4c66('0x72'))[_0x4c66('0x71')](_0x4c66('0x7f'),_0x4c66('0x6e'))[_0x4c66('0x71')]('id',_0x4c66('0x80'))['field'](_0x287fe5[_0x4c66('0x78')][_0x4c66('0x73')](),'ListId')[_0x4c66('0x71')](_0x43106e['params']['id'][_0x4c66('0x73')](),_0x4c66('0x5a'))[_0x4c66('0x71')]('\x27'+_0x51459e+'\x27',_0x4c66('0x52'))[_0x4c66('0x71')]('\x27'+_0x51459e+'\x27','updatedAt')[_0x4c66('0x74')](_0x4c66('0x75'))[_0x4c66('0x3c')](_0x4c66('0x76'))['where'](_0x4c66('0x77'),_0x287fe5[_0x4c66('0x78')]['toString']())[_0x4c66('0x3c')](_0x4c66('0x79')))[_0x4c66('0x73')]();}_0x1b79f9=squel[_0x4c66('0x7e')]()['into'](_0x4c66('0x81'))[_0x4c66('0x6d')]([_0x4c66('0x82'),'scheduledAt','phone',_0x4c66('0x83'),'createdAt',_0x4c66('0x53')],squel[_0x4c66('0x70')]()[_0x4c66('0x71')]('h.id','id')[_0x4c66('0x71')]('NOW()','scheduledAt')['field'](_0x4c66('0x84'),'phone')[_0x4c66('0x71')](_0x4c66('0x85'),'OrderBy')['field']('\x27'+_0x51459e+'\x27',_0x4c66('0x52'))[_0x4c66('0x71')]('\x27'+_0x51459e+'\x27',_0x4c66('0x53'))[_0x4c66('0x74')]('cm_contact_has_items','ci')['join'](_0x4c66('0x6c'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x4c66('0x3c')](_0x4c66('0x86'),_0x287fe5['CmListId']['toString']())[_0x4c66('0x3c')](_0x4c66('0x87'),_0x43106e[_0x4c66('0x41')]['id'][_0x4c66('0x73')]())[_0x4c66('0x3c')](_0x4c66('0x88'),_0x51459e))[_0x4c66('0x73')]();_0x5e543a[_0x4c66('0x89')](db[_0x4c66('0x8a')][_0x4c66('0x32')](_0x32271d));_0xedf932[_0x4c66('0x89')](db[_0x4c66('0x8a')][_0x4c66('0x32')](_0x1b79f9));}return BPromise[_0x4c66('0x8b')](_0x5e543a);}})[_0x4c66('0x25')](function(){return BPromise['all'](_0xedf932);})[_0x4c66('0x25')](function(){return _0x3138d8;})[_0x4c66('0x25')](respondWithResult(_0x44586b,null))[_0x4c66('0x47')](handleError(_0x44586b,null));};exports[_0x4c66('0x8c')]=function(_0x385e65,_0x186bdb,_0xe20e6b){return db[_0x4c66('0x2e')][_0x4c66('0x46')]({'where':{'id':_0x385e65[_0x4c66('0x41')]['id']}})[_0x4c66('0x25')](handleEntityNotFound(_0x186bdb,null))[_0x4c66('0x25')](function(_0x3a5103){if(_0x3a5103){return _0x3a5103[_0x4c66('0x8c')](_0x385e65['query'][_0x4c66('0x68')]);}})[_0x4c66('0x25')](function(_0x1be6a4){if(_0x1be6a4){return db[_0x4c66('0x5b')][_0x4c66('0x26')]({'where':{'ListId':_0x385e65[_0x4c66('0x32')][_0x4c66('0x68')],'CampaignId':_0x385e65[_0x4c66('0x41')]['id']}})[_0x4c66('0x25')](function(){return _0x1be6a4;});}})[_0x4c66('0x25')](respondWithStatusCode(_0x186bdb,null))[_0x4c66('0x47')](handleError(_0x186bdb,null));};exports['getBlackLists']=function(_0x5b71fe,_0x10a784,_0x3298e8){var _0x4f532d={};var _0x49220c={};var _0xa3b3fa;var _0xdd4890;return db[_0x4c66('0x2e')][_0x4c66('0x58')]({'where':{'id':_0x5b71fe['params']['id']}})['then'](handleEntityNotFound(_0x10a784,null))['then'](function(_0x2cbd6e){if(_0x2cbd6e){_0xa3b3fa=_0x2cbd6e;_0x49220c[_0x4c66('0x35')]=_[_0x4c66('0x42')](db[_0x4c66('0x8d')][_0x4c66('0x43')]);_0x49220c[_0x4c66('0x32')]=_['keys'](_0x5b71fe[_0x4c66('0x32')]);_0x49220c['filters']=_[_0x4c66('0x34')](_0x49220c[_0x4c66('0x35')],_0x49220c[_0x4c66('0x32')]);_0x4f532d[_0x4c66('0x36')]=_['intersection'](_0x49220c[_0x4c66('0x35')],qs[_0x4c66('0x37')](_0x5b71fe[_0x4c66('0x32')][_0x4c66('0x37')]));_0x4f532d['attributes']=_0x4f532d['attributes'][_0x4c66('0x50')]?_0x4f532d['attributes']:_0x49220c['model'];_0x4f532d[_0x4c66('0x59')]=qs[_0x4c66('0x3a')](_0x5b71fe[_0x4c66('0x32')][_0x4c66('0x3a')]);_0x4f532d[_0x4c66('0x3c')]=qs['filters'](_[_0x4c66('0x60')](_0x5b71fe[_0x4c66('0x32')],_0x49220c['filters']));if(_0x5b71fe['query'][_0x4c66('0x3b')]){_0x4f532d['where']=_[_0x4c66('0x45')](_0x4f532d[_0x4c66('0x3c')],{'$or':_[_0x4c66('0x2d')](_0x4f532d[_0x4c66('0x36')],function(_0x1ac46b){var _0xdb5087={};_0xdb5087[_0x1ac46b]={'$like':'%'+_0x5b71fe[_0x4c66('0x32')][_0x4c66('0x3b')]+'%'};return _0xdb5087;})});}_0x4f532d=_[_0x4c66('0x45')]({},_0x4f532d,_0x5b71fe[_0x4c66('0x3e')]);return _0xa3b3fa['getBlackLists'](_0x4f532d);}})['then'](function(_0x1f3e31){if(_0x1f3e31){_0xdd4890=_0x1f3e31[_0x4c66('0x50')];if(!_0x5b71fe[_0x4c66('0x32')][_0x4c66('0x38')](_0x4c66('0x39'))){_0x4f532d[_0x4c66('0x1f')]=qs[_0x4c66('0x1f')](_0x5b71fe[_0x4c66('0x32')]['limit']);_0x4f532d[_0x4c66('0x1d')]=qs[_0x4c66('0x1d')](_0x5b71fe[_0x4c66('0x32')][_0x4c66('0x1d')]);}return _0xa3b3fa[_0x4c66('0x8e')](_0x4f532d);}})[_0x4c66('0x25')](function(_0x34562d){if(_0x34562d){return _0x34562d?{'count':_0xdd4890,'rows':_0x34562d}:null;}})[_0x4c66('0x25')](respondWithResult(_0x10a784,null))['catch'](handleError(_0x10a784,null));};exports[_0x4c66('0x8f')]=function(_0x279c35,_0x567ade,_0x26ea79){var _0x4e8fbc,_0x34e11a;var _0x5240fa=[];var _0x768600=moment()['format'](_0x4c66('0x67'));return db[_0x4c66('0x2e')][_0x4c66('0x46')]({'where':{'id':_0x279c35[_0x4c66('0x41')]['id']}})['then'](handleEntityNotFound(_0x567ade,null))[_0x4c66('0x25')](function(_0x5c0dd6){if(_0x5c0dd6){_0x34e11a=_0x5c0dd6;return _0x5c0dd6[_0x4c66('0x8f')](_0x279c35[_0x4c66('0x54')][_0x4c66('0x68')],_[_0x4c66('0x51')](_0x279c35[_0x4c66('0x54')],['ids','id'])||{});}return null;})['spread'](function(_0x361c7d){var _0x3ccf7c;var _0x12ce2d;_0x4e8fbc=_0x361c7d||[];var _0x25c56f=[];if(_0x361c7d){for(var _0x18278f=0x0;_0x18278f<_0x361c7d[_0x4c66('0x50')];_0x18278f+=0x1){var _0x18fce0=_0x361c7d[_0x18278f]['get']({'plain':!![]});_0x3ccf7c=squel[_0x4c66('0x7e')]()[_0x4c66('0x6b')]('cm_hopper_black')[_0x4c66('0x6d')]([_0x4c66('0x72'),_0x4c66('0x80'),'ListId',_0x4c66('0x5a'),_0x4c66('0x52'),_0x4c66('0x53')],squel['select']()[_0x4c66('0x71')](_0x4c66('0x72'),_0x4c66('0x72'))[_0x4c66('0x71')]('id','ContactId')[_0x4c66('0x71')](_0x18fce0['CmListId'][_0x4c66('0x73')](),_0x4c66('0x6f'))[_0x4c66('0x71')](_0x279c35['params']['id'][_0x4c66('0x73')](),_0x4c66('0x5a'))[_0x4c66('0x71')]('NOW()',_0x4c66('0x52'))[_0x4c66('0x71')](_0x4c66('0x7f'),'updatedAt')[_0x4c66('0x74')](_0x4c66('0x75'))[_0x4c66('0x3c')]('deletedAt\x20IS\x20NULL')[_0x4c66('0x3c')](_0x4c66('0x77'),_0x18fce0['CmListId'][_0x4c66('0x73')]())[_0x4c66('0x3c')](_0x4c66('0x79')))[_0x4c66('0x73')]();_0x25c56f[_0x4c66('0x89')](db[_0x4c66('0x8a')][_0x4c66('0x32')](_0x3ccf7c));}return BPromise[_0x4c66('0x8b')](_0x25c56f);}})[_0x4c66('0x25')](function(){return _0x4e8fbc;})[_0x4c66('0x25')](respondWithResult(_0x567ade,null))['catch'](handleError(_0x567ade,null));};exports['removeBlackLists']=function(_0x3a5825,_0xdc302c,_0x38eda3){return db[_0x4c66('0x2e')][_0x4c66('0x46')]({'where':{'id':_0x3a5825[_0x4c66('0x41')]['id']}})[_0x4c66('0x25')](handleEntityNotFound(_0xdc302c,null))[_0x4c66('0x25')](function(_0x535218){if(_0x535218){return _0x535218['removeBlackLists'](_0x3a5825[_0x4c66('0x32')][_0x4c66('0x68')]);}})[_0x4c66('0x25')](function(_0x5e6ba6){if(_0x5e6ba6){return db[_0x4c66('0x63')][_0x4c66('0x26')]({'where':{'ListId':_0x3a5825[_0x4c66('0x32')][_0x4c66('0x68')],'CampaignId':_0x3a5825[_0x4c66('0x41')]['id']}})[_0x4c66('0x25')](function(){return _0x5e6ba6;});}})[_0x4c66('0x25')](respondWithStatusCode(_0xdc302c,null))['catch'](handleError(_0xdc302c,null));}; \ No newline at end of file +var _0x280d=['index','Campaign','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','user','get','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','getHoppers','findOne','CmHopper','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','phone','ContactId','ListId','select','field','scheduledAt','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','into','fromQuery','NOW()','cm_contacts','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','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','sendStatus','end','json','undefined','limit','count','offset','status','set','apply','save','destroy','then','IvrCampaigns','UserProfileResource','error','stack','name','send'];(function(_0x162246,_0x4e5038){var _0x32ac95=function(_0x22270b){while(--_0x22270b){_0x162246['push'](_0x162246['shift']());}};_0x32ac95(++_0x4e5038);}(_0x280d,0x69));var _0xd280=function(_0xc01a99,_0x48e35d){_0xc01a99=_0xc01a99-0x0;var _0x24d29a=_0x280d[_0xc01a99];return _0x24d29a;};'use strict';var emlformat=require(_0xd280('0x0'));var rimraf=require(_0xd280('0x1'));var zipdir=require(_0xd280('0x2'));var jsonpatch=require(_0xd280('0x3'));var rp=require(_0xd280('0x4'));var moment=require(_0xd280('0x5'));var BPromise=require(_0xd280('0x6'));var Mustache=require(_0xd280('0x7'));var util=require('util');var path=require('path');var sox=require(_0xd280('0x8'));var csv=require(_0xd280('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd280('0xa'));var squel=require(_0xd280('0xb'));var crypto=require(_0xd280('0xc'));var jsforce=require(_0xd280('0xd'));var deskjs=require(_0xd280('0xe'));var toCsv=require(_0xd280('0x9'));var querystring=require('querystring');var Papa=require(_0xd280('0xf'));var Redis=require(_0xd280('0x10'));var authService=require(_0xd280('0x11'));var qs=require(_0xd280('0x12'));var as=require(_0xd280('0x13'));var hardwareService=require(_0xd280('0x14'));var logger=require(_0xd280('0x15'))(_0xd280('0x16'));var utils=require(_0xd280('0x17'));var config=require(_0xd280('0x18'));var licenseUtil=require(_0xd280('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb57722,_0xa79c8f){_0xa79c8f=_0xa79c8f||0xcc;return function(_0x3f53c9){if(_0x3f53c9){return _0xb57722[_0xd280('0x1a')](_0xa79c8f);}return _0xb57722['status'](_0xa79c8f)[_0xd280('0x1b')]();};}function respondWithResult(_0xd57f29,_0x3cb365){_0x3cb365=_0x3cb365||0xc8;return function(_0x431686){if(_0x431686){return _0xd57f29['status'](_0x3cb365)[_0xd280('0x1c')](_0x431686);}};}function respondWithFilteredResult(_0x402862,_0x5ba8d0){return function(_0x30ea1d){if(_0x30ea1d){var _0x50e159=typeof _0x5ba8d0['offset']===_0xd280('0x1d')&&typeof _0x5ba8d0[_0xd280('0x1e')]===_0xd280('0x1d');var _0x414413=_0x30ea1d[_0xd280('0x1f')];var _0xffc5c3=_0x50e159?0x0:_0x5ba8d0[_0xd280('0x20')];var _0x2e96eb=_0x50e159?_0x30ea1d[_0xd280('0x1f')]:_0x5ba8d0[_0xd280('0x20')]+_0x5ba8d0[_0xd280('0x1e')];var _0x366f25;if(_0x2e96eb>=_0x414413){_0x2e96eb=_0x414413;_0x366f25=0xc8;}else{_0x366f25=0xce;}_0x402862[_0xd280('0x21')](_0x366f25);return _0x402862[_0xd280('0x22')]('Content-Range',_0xffc5c3+'-'+_0x2e96eb+'/'+_0x414413)['json'](_0x30ea1d);}return null;};}function patchUpdates(_0xd12e16){return function(_0x289701){try{jsonpatch[_0xd280('0x23')](_0x289701,_0xd12e16,!![]);}catch(_0x2a4869){return BPromise['reject'](_0x2a4869);}return _0x289701[_0xd280('0x24')]();};}function saveUpdates(_0x25765a,_0x1bf3ad){return function(_0x4af05f){if(_0x4af05f){return _0x4af05f['update'](_0x25765a)['then'](function(_0x2f5337){return _0x2f5337;});}return null;};}function removeEntity(_0x28fb35,_0x450db9){return function(_0x4b9fff){if(_0x4b9fff){return _0x4b9fff[_0xd280('0x25')]()[_0xd280('0x26')](function(){var _0x445db8=_0x4b9fff['get']({'plain':!![]});var _0x54cbcc=_0xd280('0x27');return db[_0xd280('0x28')]['destroy']({'where':{'type':_0x54cbcc,'resourceId':_0x445db8['id']}})[_0xd280('0x26')](function(){return _0x4b9fff;});})[_0xd280('0x26')](function(){_0x28fb35['status'](0xcc)[_0xd280('0x1b')]();});}};}function handleEntityNotFound(_0x77ccc3,_0x38f6fb){return function(_0x461607){if(!_0x461607){_0x77ccc3[_0xd280('0x1a')](0x194);}return _0x461607;};}function handleError(_0x15a84a,_0x5ccaf0){_0x5ccaf0=_0x5ccaf0||0x1f4;return function(_0x48a9f3){logger[_0xd280('0x29')](_0x48a9f3[_0xd280('0x2a')]);if(_0x48a9f3[_0xd280('0x2b')]){delete _0x48a9f3[_0xd280('0x2b')];}_0x15a84a[_0xd280('0x21')](_0x5ccaf0)[_0xd280('0x2c')](_0x48a9f3);};}exports[_0xd280('0x2d')]=function(_0x37e972,_0x22f374){var _0x349e06={},_0x516743={},_0x3aea0d={'count':0x0,'rows':[]};var _0x4e3f8a=_['map'](db[_0xd280('0x2e')]['rawAttributes'],function(_0x2693d6){return{'name':_0x2693d6[_0xd280('0x2f')],'type':_0x2693d6[_0xd280('0x30')][_0xd280('0x31')]};});_0x516743['model']=_[_0xd280('0x32')](_0x4e3f8a,_0xd280('0x2b'));_0x516743[_0xd280('0x33')]=_[_0xd280('0x34')](_0x37e972['query']);_0x516743['filters']=_[_0xd280('0x35')](_0x516743[_0xd280('0x36')],_0x516743[_0xd280('0x33')]);_0x349e06['attributes']=_[_0xd280('0x35')](_0x516743[_0xd280('0x36')],qs[_0xd280('0x37')](_0x37e972[_0xd280('0x33')]['fields']));_0x349e06[_0xd280('0x38')]=_0x349e06[_0xd280('0x38')][_0xd280('0x39')]?_0x349e06[_0xd280('0x38')]:_0x516743[_0xd280('0x36')];if(!_0x37e972['query'][_0xd280('0x3a')](_0xd280('0x3b'))){_0x349e06[_0xd280('0x1e')]=qs['limit'](_0x37e972['query'][_0xd280('0x1e')]);_0x349e06[_0xd280('0x20')]=qs['offset'](_0x37e972[_0xd280('0x33')][_0xd280('0x20')]);}_0x349e06[_0xd280('0x3c')]=qs[_0xd280('0x3d')](_0x37e972['query'][_0xd280('0x3d')]);_0x349e06['where']=qs['filters'](_['pick'](_0x37e972[_0xd280('0x33')],_0x516743[_0xd280('0x3e')]),_0x4e3f8a);if(_0x37e972[_0xd280('0x33')][_0xd280('0x3f')]){_0x349e06[_0xd280('0x40')]=_['merge'](_0x349e06[_0xd280('0x40')],{'$or':_[_0xd280('0x32')](_0x4e3f8a,function(_0x4b3fb0){if(_0x4b3fb0[_0xd280('0x30')]!==_0xd280('0x41')){var _0x4b67cb={};_0x4b67cb[_0x4b3fb0[_0xd280('0x2b')]]={'$like':'%'+_0x37e972['query'][_0xd280('0x3f')]+'%'};return _0x4b67cb;}})});}_0x349e06=_[_0xd280('0x42')]({},_0x349e06,_0x37e972['options']);var _0x35c25d={'where':_0x349e06[_0xd280('0x40')]};return db[_0xd280('0x2e')][_0xd280('0x1f')](_0x35c25d)[_0xd280('0x26')](function(_0x18d5b8){_0x3aea0d['count']=_0x18d5b8;if(_0x37e972[_0xd280('0x33')][_0xd280('0x43')]){_0x349e06[_0xd280('0x44')]=[{'all':!![]}];}return db['Campaign'][_0xd280('0x45')](_0x349e06);})[_0xd280('0x26')](function(_0x4bb700){_0x3aea0d[_0xd280('0x46')]=_0x4bb700;return _0x3aea0d;})[_0xd280('0x26')](respondWithFilteredResult(_0x22f374,_0x349e06))[_0xd280('0x47')](handleError(_0x22f374,null));};exports[_0xd280('0x48')]=function(_0x1aa3db,_0x2e9685){var _0x3355ab={'raw':![],'where':{'id':_0x1aa3db[_0xd280('0x49')]['id']}},_0x40e0d5={};_0x40e0d5['model']=_[_0xd280('0x34')](db[_0xd280('0x2e')][_0xd280('0x4a')]);_0x40e0d5[_0xd280('0x33')]=_[_0xd280('0x34')](_0x1aa3db[_0xd280('0x33')]);_0x40e0d5[_0xd280('0x3e')]=_[_0xd280('0x35')](_0x40e0d5['model'],_0x40e0d5[_0xd280('0x33')]);_0x3355ab[_0xd280('0x38')]=_[_0xd280('0x35')](_0x40e0d5[_0xd280('0x36')],qs[_0xd280('0x37')](_0x1aa3db['query'][_0xd280('0x37')]));_0x3355ab[_0xd280('0x38')]=_0x3355ab[_0xd280('0x38')][_0xd280('0x39')]?_0x3355ab[_0xd280('0x38')]:_0x40e0d5['model'];if(_0x1aa3db[_0xd280('0x33')][_0xd280('0x43')]){_0x3355ab[_0xd280('0x44')]=[{'all':!![]}];}_0x3355ab=_['merge']({},_0x3355ab,_0x1aa3db[_0xd280('0x4b')]);return db['Campaign']['find'](_0x3355ab)[_0xd280('0x26')](handleEntityNotFound(_0x2e9685,null))[_0xd280('0x26')](respondWithResult(_0x2e9685,null))['catch'](handleError(_0x2e9685,null));};exports[_0xd280('0x4c')]=function(_0x512daa,_0x5519af){return db['Campaign']['create'](_0x512daa[_0xd280('0x4d')],{})[_0xd280('0x26')](function(_0x3cffaa){var _0x5b2c56=_0x512daa[_0xd280('0x4e')][_0xd280('0x4f')]({'plain':!![]});if(!_0x5b2c56)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b2c56['role']===_0xd280('0x4e')){var _0x112ffe=_0x3cffaa[_0xd280('0x4f')]({'plain':!![]});var _0x26dd6f=_0xd280('0x27');return db[_0xd280('0x50')][_0xd280('0x51')]({'where':{'name':_0x26dd6f,'userProfileId':_0x5b2c56['userProfileId']},'raw':!![]})[_0xd280('0x26')](function(_0x7eb2d1){if(_0x7eb2d1&&_0x7eb2d1['autoAssociation']===0x0){return db[_0xd280('0x28')][_0xd280('0x4c')]({'name':_0x112ffe[_0xd280('0x2b')],'resourceId':_0x112ffe['id'],'type':_0x7eb2d1[_0xd280('0x2b')],'sectionId':_0x7eb2d1['id']},{})[_0xd280('0x26')](function(){return _0x3cffaa;});}else{return _0x3cffaa;}})[_0xd280('0x47')](function(_0x9cc2e7){logger[_0xd280('0x29')](_0xd280('0x52'),_0x9cc2e7);throw _0x9cc2e7;});}return _0x3cffaa;})[_0xd280('0x26')](respondWithResult(_0x5519af,0xc9))[_0xd280('0x47')](handleError(_0x5519af,null));};exports[_0xd280('0x53')]=function(_0xc80cb7,_0x2d4cf5){var _0x30b54d={'where':{'id':_0xc80cb7[_0xd280('0x49')]['id']}},_0x3f0656={};_0x3f0656[_0xd280('0x36')]=_['keys'](db[_0xd280('0x2e')][_0xd280('0x4a')]);_0x30b54d[_0xd280('0x38')]=_[_0xd280('0x35')](_0x3f0656[_0xd280('0x36')],qs['fields'](_0xc80cb7[_0xd280('0x33')][_0xd280('0x37')]));_0x30b54d[_0xd280('0x38')]=_0x30b54d['attributes']['length']?_0x30b54d[_0xd280('0x38')]:_0x3f0656[_0xd280('0x36')];if(_0xc80cb7[_0xd280('0x33')]['includeAll']){_0x30b54d['include']=[{'all':!![]}];}_0x30b54d=_[_0xd280('0x42')]({},_0x30b54d,_0xc80cb7[_0xd280('0x4b')]);return db['Campaign']['find'](_0x30b54d)[_0xd280('0x26')](handleEntityNotFound(_0x2d4cf5,null))[_0xd280('0x26')](function(_0x372d5b){if(_0x372d5b){var _0x3e1fe7=_0x372d5b['get']({'plain':!![]});_0x3e1fe7=qs[_0xd280('0x54')](_0x3e1fe7,['id',_0xd280('0x55'),_0xd280('0x56')]);_0xc80cb7['body']=_[_0xd280('0x54')](_0xc80cb7[_0xd280('0x4d')],['id',_0xd280('0x55'),_0xd280('0x56')]);return db[_0xd280('0x2e')]['create'](_[_0xd280('0x42')](_0x3e1fe7,_0xc80cb7[_0xd280('0x4d')]),{'include':_0xc80cb7[_0xd280('0x33')][_0xd280('0x43')]?[{'all':!![]}]:undefined})[_0xd280('0x26')](function(_0x19afe9){var _0x2066cf=_0xc80cb7[_0xd280('0x4e')][_0xd280('0x4f')]({'plain':!![]});if(!_0x2066cf)throw new Error(_0xd280('0x57'));if(_0x2066cf[_0xd280('0x58')]===_0xd280('0x4e')){var _0x9dceb6=_0x19afe9[_0xd280('0x4f')]({'plain':!![]});var _0x1fecc2='IvrCampaigns';return db[_0xd280('0x50')]['find']({'where':{'name':_0x1fecc2,'userProfileId':_0x2066cf['userProfileId']},'raw':!![]})[_0xd280('0x26')](function(_0x3d6bc6){if(_0x3d6bc6&&_0x3d6bc6['autoAssociation']===0x0){return db[_0xd280('0x28')]['create']({'name':_0x9dceb6[_0xd280('0x2b')],'resourceId':_0x9dceb6['id'],'type':_0x3d6bc6[_0xd280('0x2b')],'sectionId':_0x3d6bc6['id']},{})[_0xd280('0x26')](function(){return _0x19afe9;});}else{return _0x19afe9;}})['catch'](function(_0x1267c2){logger[_0xd280('0x29')](_0xd280('0x52'),_0x1267c2);throw _0x1267c2;});}return _0x19afe9;});}})[_0xd280('0x26')](respondWithResult(_0x2d4cf5,0xc9))['catch'](handleError(_0x2d4cf5,null));};exports['update']=function(_0x2995b5,_0x3c3b6a){if(_0x2995b5[_0xd280('0x4d')]['id']){delete _0x2995b5[_0xd280('0x4d')]['id'];}return db[_0xd280('0x2e')][_0xd280('0x51')]({'where':{'id':_0x2995b5[_0xd280('0x49')]['id']}})[_0xd280('0x26')](handleEntityNotFound(_0x3c3b6a,null))[_0xd280('0x26')](saveUpdates(_0x2995b5['body'],null))[_0xd280('0x26')](respondWithResult(_0x3c3b6a,null))[_0xd280('0x47')](handleError(_0x3c3b6a,null));};exports[_0xd280('0x25')]=function(_0x591b76,_0x60136){return db[_0xd280('0x2e')][_0xd280('0x51')]({'where':{'id':_0x591b76[_0xd280('0x49')]['id']}})[_0xd280('0x26')](handleEntityNotFound(_0x60136,null))[_0xd280('0x26')](removeEntity(_0x60136,null))[_0xd280('0x47')](handleError(_0x60136,null));};exports[_0xd280('0x59')]=function(_0x59054f,_0x4962b4,_0x1b65c0){var _0x9ba016={'raw':!![],'where':{}};var _0x2c46bb={};var _0x4ad4f0={'count':0x0,'rows':[]};return db[_0xd280('0x2e')][_0xd280('0x5a')]({'where':{'id':_0x59054f[_0xd280('0x49')]['id']}})[_0xd280('0x26')](handleEntityNotFound(_0x4962b4,null))['then'](function(_0x44129f){if(_0x44129f){_0x2c46bb[_0xd280('0x36')]=_['keys'](db[_0xd280('0x5b')]['rawAttributes']);_0x2c46bb['query']=_[_0xd280('0x34')](_0x59054f[_0xd280('0x33')]);_0x2c46bb[_0xd280('0x3e')]=_['intersection'](_0x2c46bb['model'],_0x2c46bb[_0xd280('0x33')]);_0x9ba016[_0xd280('0x38')]=_[_0xd280('0x35')](_0x2c46bb[_0xd280('0x36')],qs[_0xd280('0x37')](_0x59054f['query'][_0xd280('0x37')]));_0x9ba016[_0xd280('0x38')]=_0x9ba016[_0xd280('0x38')][_0xd280('0x39')]?_0x9ba016[_0xd280('0x38')]:_0x2c46bb[_0xd280('0x36')];if(!_0x59054f[_0xd280('0x33')][_0xd280('0x3a')]('nolimit')){_0x9ba016[_0xd280('0x1e')]=qs[_0xd280('0x1e')](_0x59054f[_0xd280('0x33')]['limit']);_0x9ba016[_0xd280('0x20')]=qs['offset'](_0x59054f[_0xd280('0x33')][_0xd280('0x20')]);}_0x9ba016[_0xd280('0x3c')]=qs[_0xd280('0x3d')](_0x59054f['query'][_0xd280('0x3d')]);_0x9ba016['where']=qs[_0xd280('0x3e')](_[_0xd280('0x5c')](_0x59054f[_0xd280('0x33')],_0x2c46bb['filters']));_0x9ba016[_0xd280('0x40')][_0xd280('0x5d')]=_0x44129f['id'];if(_0x59054f[_0xd280('0x33')][_0xd280('0x3f')]){_0x9ba016['where']=_[_0xd280('0x42')](_0x9ba016[_0xd280('0x40')],{'$or':_[_0xd280('0x32')](_0x9ba016[_0xd280('0x38')],function(_0x63c71b){var _0x17d908={};_0x17d908[_0x63c71b]={'$like':'%'+_0x59054f[_0xd280('0x33')][_0xd280('0x3f')]+'%'};return _0x17d908;})});}_0x9ba016=_[_0xd280('0x42')]({},_0x9ba016,_0x59054f[_0xd280('0x4b')]);return db[_0xd280('0x5b')]['count']({'where':_0x9ba016[_0xd280('0x40')]})['then'](function(_0x1acf33){_0x4ad4f0[_0xd280('0x1f')]=_0x1acf33;if(_0x59054f[_0xd280('0x33')][_0xd280('0x43')]){_0x9ba016[_0xd280('0x44')]=[{'all':!![]}];}return db[_0xd280('0x5b')][_0xd280('0x45')](_0x9ba016);})[_0xd280('0x26')](function(_0x9e684c){_0x4ad4f0[_0xd280('0x46')]=_0x9e684c;return _0x4ad4f0;});}})['then'](respondWithFilteredResult(_0x4962b4,_0x9ba016))[_0xd280('0x47')](handleError(_0x4962b4,null));};exports[_0xd280('0x5e')]=function(_0x4aa2ec,_0x29ec18,_0x1e1de0){var _0x4e6ddf={'raw':!![],'where':{}};var _0x42f225={};var _0x161089={'count':0x0,'rows':[]};return db[_0xd280('0x2e')][_0xd280('0x5a')]({'where':{'id':_0x4aa2ec[_0xd280('0x49')]['id']}})[_0xd280('0x26')](handleEntityNotFound(_0x29ec18,null))['then'](function(_0x3470fc){if(_0x3470fc){_0x42f225[_0xd280('0x36')]=_[_0xd280('0x34')](db[_0xd280('0x5f')]['rawAttributes']);_0x42f225['query']=_[_0xd280('0x34')](_0x4aa2ec[_0xd280('0x33')]);_0x42f225['filters']=_[_0xd280('0x35')](_0x42f225[_0xd280('0x36')],_0x42f225['query']);_0x4e6ddf[_0xd280('0x38')]=_['intersection'](_0x42f225[_0xd280('0x36')],qs[_0xd280('0x37')](_0x4aa2ec[_0xd280('0x33')][_0xd280('0x37')]));_0x4e6ddf[_0xd280('0x38')]=_0x4e6ddf[_0xd280('0x38')]['length']?_0x4e6ddf[_0xd280('0x38')]:_0x42f225[_0xd280('0x36')];if(!_0x4aa2ec[_0xd280('0x33')][_0xd280('0x3a')](_0xd280('0x3b'))){_0x4e6ddf['limit']=qs[_0xd280('0x1e')](_0x4aa2ec[_0xd280('0x33')]['limit']);_0x4e6ddf['offset']=qs[_0xd280('0x20')](_0x4aa2ec[_0xd280('0x33')][_0xd280('0x20')]);}_0x4e6ddf[_0xd280('0x3c')]=qs['sort'](_0x4aa2ec['query'][_0xd280('0x3d')]);_0x4e6ddf[_0xd280('0x40')]=qs['filters'](_[_0xd280('0x5c')](_0x4aa2ec['query'],_0x42f225[_0xd280('0x3e')]));_0x4e6ddf[_0xd280('0x40')]['CampaignId']=_0x3470fc['id'];if(_0x4aa2ec['query'][_0xd280('0x3f')]){_0x4e6ddf['where']=_[_0xd280('0x42')](_0x4e6ddf[_0xd280('0x40')],{'$or':_[_0xd280('0x32')](_0x4e6ddf['attributes'],function(_0x5eb0b5){var _0x481731={};_0x481731[_0x5eb0b5]={'$like':'%'+_0x4aa2ec[_0xd280('0x33')][_0xd280('0x3f')]+'%'};return _0x481731;})});}_0x4e6ddf=_[_0xd280('0x42')]({},_0x4e6ddf,_0x4aa2ec[_0xd280('0x4b')]);return db[_0xd280('0x5f')][_0xd280('0x1f')]({'where':_0x4e6ddf['where']})[_0xd280('0x26')](function(_0x3dd86b){_0x161089[_0xd280('0x1f')]=_0x3dd86b;if(_0x4aa2ec[_0xd280('0x33')]['includeAll']){_0x4e6ddf[_0xd280('0x44')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xd280('0x45')](_0x4e6ddf);})[_0xd280('0x26')](function(_0x145be2){_0x161089[_0xd280('0x46')]=_0x145be2;return _0x161089;});}})[_0xd280('0x26')](respondWithFilteredResult(_0x29ec18,_0x4e6ddf))[_0xd280('0x47')](handleError(_0x29ec18,null));};exports[_0xd280('0x60')]=function(_0x583a74,_0x384a7f,_0x3e1d38){var _0x985133={'raw':!![],'where':{}};var _0x3c21e4={};var _0x550aef={'count':0x0,'rows':[]};return db['Campaign'][_0xd280('0x5a')]({'where':{'id':_0x583a74[_0xd280('0x49')]['id']}})[_0xd280('0x26')](handleEntityNotFound(_0x384a7f,null))[_0xd280('0x26')](function(_0x1dac8f){if(_0x1dac8f){_0x3c21e4['model']=_[_0xd280('0x34')](db[_0xd280('0x61')][_0xd280('0x4a')]);_0x3c21e4[_0xd280('0x33')]=_['keys'](_0x583a74[_0xd280('0x33')]);_0x3c21e4[_0xd280('0x3e')]=_[_0xd280('0x35')](_0x3c21e4['model'],_0x3c21e4['query']);_0x985133['attributes']=_[_0xd280('0x35')](_0x3c21e4[_0xd280('0x36')],qs[_0xd280('0x37')](_0x583a74[_0xd280('0x33')][_0xd280('0x37')]));_0x985133[_0xd280('0x38')]=_0x985133['attributes'][_0xd280('0x39')]?_0x985133[_0xd280('0x38')]:_0x3c21e4[_0xd280('0x36')];if(!_0x583a74[_0xd280('0x33')][_0xd280('0x3a')](_0xd280('0x3b'))){_0x985133['limit']=qs[_0xd280('0x1e')](_0x583a74[_0xd280('0x33')][_0xd280('0x1e')]);_0x985133['offset']=qs[_0xd280('0x20')](_0x583a74[_0xd280('0x33')]['offset']);}_0x985133[_0xd280('0x3c')]=qs[_0xd280('0x3d')](_0x583a74['query'][_0xd280('0x3d')]);_0x985133['where']=qs[_0xd280('0x3e')](_[_0xd280('0x5c')](_0x583a74[_0xd280('0x33')],_0x3c21e4[_0xd280('0x3e')]));_0x985133[_0xd280('0x40')][_0xd280('0x5d')]=_0x1dac8f['id'];if(_0x583a74[_0xd280('0x33')][_0xd280('0x3f')]){_0x985133[_0xd280('0x40')]=_['merge'](_0x985133[_0xd280('0x40')],{'$or':_['map'](_0x985133[_0xd280('0x38')],function(_0x58ed60){var _0x1436e0={};_0x1436e0[_0x58ed60]={'$like':'%'+_0x583a74[_0xd280('0x33')][_0xd280('0x3f')]+'%'};return _0x1436e0;})});}_0x985133=_[_0xd280('0x42')]({},_0x985133,_0x583a74[_0xd280('0x4b')]);return db[_0xd280('0x61')][_0xd280('0x1f')]({'where':_0x985133[_0xd280('0x40')]})[_0xd280('0x26')](function(_0x14f90c){_0x550aef[_0xd280('0x1f')]=_0x14f90c;if(_0x583a74['query'][_0xd280('0x43')]){_0x985133[_0xd280('0x44')]=[{'all':!![]}];}return db[_0xd280('0x61')][_0xd280('0x45')](_0x985133);})[_0xd280('0x26')](function(_0x16b4c8){_0x550aef[_0xd280('0x46')]=_0x16b4c8;return _0x550aef;});}})[_0xd280('0x26')](respondWithFilteredResult(_0x384a7f,_0x985133))[_0xd280('0x47')](handleError(_0x384a7f,null));};exports[_0xd280('0x62')]=function(_0xb20efa,_0x1f8054,_0x51fe98){var _0x340736={'raw':!![],'where':{}};var _0x288aed={};var _0x3a2a92={'count':0x0,'rows':[]};return db[_0xd280('0x2e')][_0xd280('0x5a')]({'where':{'id':_0xb20efa[_0xd280('0x49')]['id']}})['then'](handleEntityNotFound(_0x1f8054,null))['then'](function(_0x2a7e45){if(_0x2a7e45){_0x288aed['model']=_[_0xd280('0x34')](db[_0xd280('0x63')][_0xd280('0x4a')]);_0x288aed[_0xd280('0x33')]=_[_0xd280('0x34')](_0xb20efa[_0xd280('0x33')]);_0x288aed['filters']=_[_0xd280('0x35')](_0x288aed[_0xd280('0x36')],_0x288aed[_0xd280('0x33')]);_0x340736[_0xd280('0x38')]=_[_0xd280('0x35')](_0x288aed[_0xd280('0x36')],qs[_0xd280('0x37')](_0xb20efa[_0xd280('0x33')][_0xd280('0x37')]));_0x340736[_0xd280('0x38')]=_0x340736[_0xd280('0x38')][_0xd280('0x39')]?_0x340736[_0xd280('0x38')]:_0x288aed['model'];if(!_0xb20efa[_0xd280('0x33')]['hasOwnProperty']('nolimit')){_0x340736[_0xd280('0x1e')]=qs['limit'](_0xb20efa[_0xd280('0x33')][_0xd280('0x1e')]);_0x340736[_0xd280('0x20')]=qs[_0xd280('0x20')](_0xb20efa[_0xd280('0x33')][_0xd280('0x20')]);}_0x340736[_0xd280('0x3c')]=qs[_0xd280('0x3d')](_0xb20efa[_0xd280('0x33')][_0xd280('0x3d')]);_0x340736[_0xd280('0x40')]=qs[_0xd280('0x3e')](_['pick'](_0xb20efa['query'],_0x288aed[_0xd280('0x3e')]));_0x340736[_0xd280('0x40')][_0xd280('0x5d')]=_0x2a7e45['id'];if(_0xb20efa['query'][_0xd280('0x3f')]){_0x340736[_0xd280('0x40')]=_['merge'](_0x340736[_0xd280('0x40')],{'$or':_[_0xd280('0x32')](_0x340736['attributes'],function(_0x18fca3){var _0x2a1c43={};_0x2a1c43[_0x18fca3]={'$like':'%'+_0xb20efa[_0xd280('0x33')]['filter']+'%'};return _0x2a1c43;})});}_0x340736=_[_0xd280('0x42')]({},_0x340736,_0xb20efa[_0xd280('0x4b')]);return db[_0xd280('0x63')][_0xd280('0x1f')]({'where':_0x340736[_0xd280('0x40')]})[_0xd280('0x26')](function(_0x43faa5){_0x3a2a92[_0xd280('0x1f')]=_0x43faa5;if(_0xb20efa[_0xd280('0x33')][_0xd280('0x43')]){_0x340736[_0xd280('0x44')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xd280('0x45')](_0x340736);})[_0xd280('0x26')](function(_0x5c3099){_0x3a2a92[_0xd280('0x46')]=_0x5c3099;return _0x3a2a92;});}})['then'](respondWithFilteredResult(_0x1f8054,_0x340736))[_0xd280('0x47')](handleError(_0x1f8054,null));};exports[_0xd280('0x64')]=function(_0x1b2792,_0x5d5b21,_0xa8f657){var _0xdb25c6={};var _0x17f31a={};var _0x4a6090;var _0x47910b;return db[_0xd280('0x2e')][_0xd280('0x5a')]({'where':{'id':_0x1b2792[_0xd280('0x49')]['id']}})[_0xd280('0x26')](handleEntityNotFound(_0x5d5b21,null))[_0xd280('0x26')](function(_0x55ee85){if(_0x55ee85){_0x4a6090=_0x55ee85;_0x17f31a['model']=_['keys'](db[_0xd280('0x65')][_0xd280('0x4a')]);_0x17f31a[_0xd280('0x33')]=_[_0xd280('0x34')](_0x1b2792['query']);_0x17f31a[_0xd280('0x3e')]=_[_0xd280('0x35')](_0x17f31a['model'],_0x17f31a['query']);_0xdb25c6[_0xd280('0x38')]=_['intersection'](_0x17f31a[_0xd280('0x36')],qs[_0xd280('0x37')](_0x1b2792[_0xd280('0x33')][_0xd280('0x37')]));_0xdb25c6[_0xd280('0x38')]=_0xdb25c6['attributes'][_0xd280('0x39')]?_0xdb25c6[_0xd280('0x38')]:_0x17f31a[_0xd280('0x36')];_0xdb25c6[_0xd280('0x3c')]=qs['sort'](_0x1b2792[_0xd280('0x33')]['sort']);_0xdb25c6[_0xd280('0x40')]=qs['filters'](_['pick'](_0x1b2792[_0xd280('0x33')],_0x17f31a[_0xd280('0x3e')]));if(_0x1b2792['query'][_0xd280('0x3f')]){_0xdb25c6[_0xd280('0x40')]=_[_0xd280('0x42')](_0xdb25c6[_0xd280('0x40')],{'$or':_['map'](_0xdb25c6['attributes'],function(_0x48c244){var _0x2adadc={};_0x2adadc[_0x48c244]={'$like':'%'+_0x1b2792[_0xd280('0x33')][_0xd280('0x3f')]+'%'};return _0x2adadc;})});}_0xdb25c6=_['merge']({},_0xdb25c6,_0x1b2792[_0xd280('0x4b')]);return _0x4a6090[_0xd280('0x64')](_0xdb25c6);}})[_0xd280('0x26')](function(_0x30a1aa){if(_0x30a1aa){_0x47910b=_0x30a1aa[_0xd280('0x39')];if(!_0x1b2792[_0xd280('0x33')][_0xd280('0x3a')](_0xd280('0x3b'))){_0xdb25c6[_0xd280('0x1e')]=qs[_0xd280('0x1e')](_0x1b2792[_0xd280('0x33')]['limit']);_0xdb25c6['offset']=qs[_0xd280('0x20')](_0x1b2792[_0xd280('0x33')][_0xd280('0x20')]);}return _0x4a6090[_0xd280('0x64')](_0xdb25c6);}})[_0xd280('0x26')](function(_0x37b503){if(_0x37b503){return _0x37b503?{'count':_0x47910b,'rows':_0x37b503}:null;}})[_0xd280('0x26')](respondWithResult(_0x5d5b21,null))[_0xd280('0x47')](handleError(_0x5d5b21,null));};exports[_0xd280('0x66')]=function(_0x398929,_0x3f1a44,_0x2df1b9){var _0x18ddcf,_0x316155;var _0x75db42=[];var _0x17d6ef=moment()['format'](_0xd280('0x67'));return db[_0xd280('0x2e')][_0xd280('0x51')]({'where':{'id':_0x398929[_0xd280('0x49')]['id']}})['then'](handleEntityNotFound(_0x3f1a44,null))['then'](function(_0x44e150){if(_0x44e150){_0x316155=_0x44e150;return _0x44e150[_0xd280('0x66')](_0x398929[_0xd280('0x4d')][_0xd280('0x68')],_[_0xd280('0x54')](_0x398929[_0xd280('0x4d')],[_0xd280('0x68'),'id'])||{});}return null;})[_0xd280('0x69')](function(_0x1c8a4f){var _0x59e08f;var _0x1927ea;_0x18ddcf=_0x1c8a4f||[];var _0x15df34=[];if(_0x1c8a4f){for(var _0x18d3ac=0x0;_0x18d3ac<_0x1c8a4f['length'];_0x18d3ac+=0x1){var _0x1add54=_0x1c8a4f[_0x18d3ac][_0xd280('0x4f')]({'plain':!![]});_0x316155['dialCheckDuplicateType']=_0x398929[_0xd280('0x4d')][_0xd280('0x6a')]?_0x398929['body'][_0xd280('0x6a')]:_0x316155['dialCheckDuplicateType'];switch(_0x316155[_0xd280('0x6a')]){case _0xd280('0x6b'):_0x59e08f=squel['insert']()['into']('cm_hopper')['fromQuery']([_0xd280('0x6c'),'scheduledAt',_0xd280('0x6d'),_0xd280('0x6e'),'CampaignId',_0xd280('0x55'),_0xd280('0x56')],squel[_0xd280('0x6f')]()[_0xd280('0x70')]('phone',_0xd280('0x6c'))[_0xd280('0x70')]('NOW()',_0xd280('0x71'))[_0xd280('0x70')]('id',_0xd280('0x6d'))[_0xd280('0x70')](_0x1add54[_0xd280('0x72')][_0xd280('0x73')](),_0xd280('0x6e'))[_0xd280('0x70')](_0x398929[_0xd280('0x49')]['id'][_0xd280('0x73')](),_0xd280('0x5d'))[_0xd280('0x70')]('\x27'+_0x17d6ef+'\x27','createdAt')[_0xd280('0x70')]('\x27'+_0x17d6ef+'\x27',_0xd280('0x56'))['from']('cm_contacts')['where'](_0xd280('0x74'))['where'](_0xd280('0x75'),_0x1add54['CmListId'][_0xd280('0x73')]())['where'](_0xd280('0x76'))[_0xd280('0x40')](_0xd280('0x77'),squel['select']()[_0xd280('0x70')](_0xd280('0x78'))[_0xd280('0x79')]('cm_hopper_final')['where'](_0xd280('0x7a'),_0x398929['params']['id'][_0xd280('0x73')]()))[_0xd280('0x40')](_0xd280('0x77'),squel['select']()['field'](_0xd280('0x7b'))[_0xd280('0x79')](_0xd280('0x7c'))[_0xd280('0x40')](_0xd280('0x7a'),_0x398929[_0xd280('0x49')]['id'][_0xd280('0x73')]())))[_0xd280('0x73')]();break;case _0xd280('0x7d'):_0x59e08f=squel[_0xd280('0x7e')]()[_0xd280('0x7f')]('cm_hopper')[_0xd280('0x80')]([_0xd280('0x6c'),_0xd280('0x71'),'ContactId',_0xd280('0x6e'),_0xd280('0x5d'),_0xd280('0x55'),'updatedAt'],squel[_0xd280('0x6f')]()[_0xd280('0x70')](_0xd280('0x6c'),_0xd280('0x6c'))[_0xd280('0x70')](_0xd280('0x81'),_0xd280('0x71'))[_0xd280('0x70')]('id',_0xd280('0x6d'))['field'](_0x1add54['CmListId']['toString'](),_0xd280('0x6e'))['field'](_0x398929[_0xd280('0x49')]['id'][_0xd280('0x73')](),_0xd280('0x5d'))[_0xd280('0x70')]('\x27'+_0x17d6ef+'\x27','createdAt')['field']('\x27'+_0x17d6ef+'\x27',_0xd280('0x56'))[_0xd280('0x79')](_0xd280('0x82'))[_0xd280('0x40')](_0xd280('0x74'))[_0xd280('0x40')]('ListId\x20=\x20?',_0x1add54[_0xd280('0x72')][_0xd280('0x73')]())[_0xd280('0x40')](_0xd280('0x76'))[_0xd280('0x40')](_0xd280('0x77'),squel['select']()[_0xd280('0x70')](_0xd280('0x7b'))[_0xd280('0x79')](_0xd280('0x7c'))[_0xd280('0x40')](_0xd280('0x7a'),_0x398929[_0xd280('0x49')]['id'][_0xd280('0x73')]())))[_0xd280('0x73')]();break;default:_0x59e08f=squel[_0xd280('0x7e')]()[_0xd280('0x7f')]('cm_hopper')[_0xd280('0x80')]([_0xd280('0x6c'),_0xd280('0x71'),_0xd280('0x6d'),_0xd280('0x6e'),_0xd280('0x5d'),_0xd280('0x55'),'updatedAt'],squel[_0xd280('0x6f')]()[_0xd280('0x70')]('phone',_0xd280('0x6c'))['field']('NOW()',_0xd280('0x71'))[_0xd280('0x70')]('id',_0xd280('0x6d'))[_0xd280('0x70')](_0x1add54[_0xd280('0x72')][_0xd280('0x73')](),_0xd280('0x6e'))[_0xd280('0x70')](_0x398929['params']['id']['toString'](),_0xd280('0x5d'))[_0xd280('0x70')]('\x27'+_0x17d6ef+'\x27',_0xd280('0x55'))[_0xd280('0x70')]('\x27'+_0x17d6ef+'\x27','updatedAt')['from']('cm_contacts')[_0xd280('0x40')](_0xd280('0x74'))[_0xd280('0x40')]('ListId\x20=\x20?',_0x1add54[_0xd280('0x72')][_0xd280('0x73')]())[_0xd280('0x40')](_0xd280('0x76')))[_0xd280('0x73')]();}_0x1927ea=squel['insert']()[_0xd280('0x7f')](_0xd280('0x83'))[_0xd280('0x80')](['cmHopperId','scheduledAt',_0xd280('0x6c'),_0xd280('0x84'),_0xd280('0x55'),_0xd280('0x56')],squel[_0xd280('0x6f')]()['field'](_0xd280('0x85'),'id')['field']('NOW()',_0xd280('0x71'))['field'](_0xd280('0x86'),'phone')[_0xd280('0x70')](_0xd280('0x87'),_0xd280('0x84'))[_0xd280('0x70')]('\x27'+_0x17d6ef+'\x27','createdAt')[_0xd280('0x70')]('\x27'+_0x17d6ef+'\x27','updatedAt')[_0xd280('0x79')](_0xd280('0x88'),'ci')[_0xd280('0x89')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0xd280('0x8a'),_0x1add54[_0xd280('0x72')]['toString']())[_0xd280('0x40')](_0xd280('0x8b'),_0x398929[_0xd280('0x49')]['id'][_0xd280('0x73')]())[_0xd280('0x40')](_0xd280('0x8c'),_0x17d6ef))[_0xd280('0x73')]();_0x15df34[_0xd280('0x8d')](db[_0xd280('0x8e')][_0xd280('0x33')](_0x59e08f));_0x75db42[_0xd280('0x8d')](db[_0xd280('0x8e')][_0xd280('0x33')](_0x1927ea));}return BPromise[_0xd280('0x8f')](_0x15df34);}})[_0xd280('0x26')](function(){return BPromise['all'](_0x75db42);})[_0xd280('0x26')](function(){return _0x18ddcf;})[_0xd280('0x26')](respondWithResult(_0x3f1a44,null))['catch'](handleError(_0x3f1a44,null));};exports['removeLists']=function(_0x55be07,_0x349d72,_0x26f59f){return db[_0xd280('0x2e')]['find']({'where':{'id':_0x55be07[_0xd280('0x49')]['id']}})[_0xd280('0x26')](handleEntityNotFound(_0x349d72,null))[_0xd280('0x26')](function(_0x33d79d){if(_0x33d79d){return _0x33d79d[_0xd280('0x90')](_0x55be07[_0xd280('0x33')][_0xd280('0x68')]);}})[_0xd280('0x26')](function(_0x486f3f){if(_0x486f3f){return db[_0xd280('0x5b')][_0xd280('0x25')]({'where':{'ListId':_0x55be07['query'][_0xd280('0x68')],'CampaignId':_0x55be07[_0xd280('0x49')]['id']}})['then'](function(){return _0x486f3f;});}})[_0xd280('0x26')](respondWithStatusCode(_0x349d72,null))['catch'](handleError(_0x349d72,null));};exports[_0xd280('0x91')]=function(_0x160ad8,_0x9def36,_0x2b024a){var _0x1be5c8={};var _0x2c0201={};var _0x100ef6;var _0x15d807;return db[_0xd280('0x2e')][_0xd280('0x5a')]({'where':{'id':_0x160ad8['params']['id']}})[_0xd280('0x26')](handleEntityNotFound(_0x9def36,null))['then'](function(_0x1ffbd3){if(_0x1ffbd3){_0x100ef6=_0x1ffbd3;_0x2c0201[_0xd280('0x36')]=_[_0xd280('0x34')](db[_0xd280('0x65')][_0xd280('0x4a')]);_0x2c0201['query']=_[_0xd280('0x34')](_0x160ad8[_0xd280('0x33')]);_0x2c0201['filters']=_[_0xd280('0x35')](_0x2c0201[_0xd280('0x36')],_0x2c0201[_0xd280('0x33')]);_0x1be5c8['attributes']=_[_0xd280('0x35')](_0x2c0201[_0xd280('0x36')],qs[_0xd280('0x37')](_0x160ad8['query'][_0xd280('0x37')]));_0x1be5c8['attributes']=_0x1be5c8[_0xd280('0x38')][_0xd280('0x39')]?_0x1be5c8[_0xd280('0x38')]:_0x2c0201[_0xd280('0x36')];_0x1be5c8[_0xd280('0x3c')]=qs[_0xd280('0x3d')](_0x160ad8[_0xd280('0x33')][_0xd280('0x3d')]);_0x1be5c8['where']=qs[_0xd280('0x3e')](_[_0xd280('0x5c')](_0x160ad8['query'],_0x2c0201['filters']));if(_0x160ad8[_0xd280('0x33')][_0xd280('0x3f')]){_0x1be5c8[_0xd280('0x40')]=_[_0xd280('0x42')](_0x1be5c8[_0xd280('0x40')],{'$or':_[_0xd280('0x32')](_0x1be5c8['attributes'],function(_0x362cc1){var _0x46bba2={};_0x46bba2[_0x362cc1]={'$like':'%'+_0x160ad8[_0xd280('0x33')][_0xd280('0x3f')]+'%'};return _0x46bba2;})});}_0x1be5c8=_[_0xd280('0x42')]({},_0x1be5c8,_0x160ad8['options']);return _0x100ef6[_0xd280('0x91')](_0x1be5c8);}})[_0xd280('0x26')](function(_0x27bffe){if(_0x27bffe){_0x15d807=_0x27bffe['length'];if(!_0x160ad8[_0xd280('0x33')][_0xd280('0x3a')](_0xd280('0x3b'))){_0x1be5c8[_0xd280('0x1e')]=qs['limit'](_0x160ad8[_0xd280('0x33')]['limit']);_0x1be5c8[_0xd280('0x20')]=qs[_0xd280('0x20')](_0x160ad8[_0xd280('0x33')][_0xd280('0x20')]);}return _0x100ef6[_0xd280('0x91')](_0x1be5c8);}})[_0xd280('0x26')](function(_0x14aad2){if(_0x14aad2){return _0x14aad2?{'count':_0x15d807,'rows':_0x14aad2}:null;}})['then'](respondWithResult(_0x9def36,null))[_0xd280('0x47')](handleError(_0x9def36,null));};exports[_0xd280('0x92')]=function(_0x460711,_0x56d0ca,_0x19581d){var _0x43a5eb,_0xec9f96;var _0x1866b6=[];var _0x1b1c52=moment()[_0xd280('0x93')](_0xd280('0x67'));return db['Campaign'][_0xd280('0x51')]({'where':{'id':_0x460711[_0xd280('0x49')]['id']}})['then'](handleEntityNotFound(_0x56d0ca,null))['then'](function(_0x22a776){if(_0x22a776){_0xec9f96=_0x22a776;return _0x22a776['addBlackLists'](_0x460711['body'][_0xd280('0x68')],_['omit'](_0x460711[_0xd280('0x4d')],[_0xd280('0x68'),'id'])||{});}return null;})[_0xd280('0x69')](function(_0x1ac5e2){var _0x3e0eaa;var _0x36e8fc;_0x43a5eb=_0x1ac5e2||[];var _0x4997ac=[];if(_0x1ac5e2){for(var _0x2156ac=0x0;_0x2156ac<_0x1ac5e2['length'];_0x2156ac+=0x1){var _0x44bc17=_0x1ac5e2[_0x2156ac]['get']({'plain':!![]});_0x3e0eaa=squel[_0xd280('0x7e')]()[_0xd280('0x7f')](_0xd280('0x94'))[_0xd280('0x80')]([_0xd280('0x6c'),_0xd280('0x6d'),'ListId','CampaignId',_0xd280('0x55'),_0xd280('0x56')],squel[_0xd280('0x6f')]()['field']('phone','phone')[_0xd280('0x70')]('id','ContactId')[_0xd280('0x70')](_0x44bc17[_0xd280('0x72')]['toString'](),_0xd280('0x6e'))[_0xd280('0x70')](_0x460711[_0xd280('0x49')]['id'][_0xd280('0x73')](),_0xd280('0x5d'))[_0xd280('0x70')](_0xd280('0x81'),_0xd280('0x55'))[_0xd280('0x70')](_0xd280('0x81'),_0xd280('0x56'))[_0xd280('0x79')](_0xd280('0x82'))[_0xd280('0x40')]('deletedAt\x20IS\x20NULL')[_0xd280('0x40')]('ListId\x20=\x20?',_0x44bc17[_0xd280('0x72')][_0xd280('0x73')]())[_0xd280('0x40')](_0xd280('0x76')))[_0xd280('0x73')]();_0x4997ac[_0xd280('0x8d')](db[_0xd280('0x8e')]['query'](_0x3e0eaa));}return BPromise['all'](_0x4997ac);}})[_0xd280('0x26')](function(){return _0x43a5eb;})[_0xd280('0x26')](respondWithResult(_0x56d0ca,null))[_0xd280('0x47')](handleError(_0x56d0ca,null));};exports[_0xd280('0x95')]=function(_0x3e73fd,_0x32ff06,_0x4be3aa){return db[_0xd280('0x2e')][_0xd280('0x51')]({'where':{'id':_0x3e73fd[_0xd280('0x49')]['id']}})[_0xd280('0x26')](handleEntityNotFound(_0x32ff06,null))[_0xd280('0x26')](function(_0x25cf77){if(_0x25cf77){return _0x25cf77['removeBlackLists'](_0x3e73fd[_0xd280('0x33')][_0xd280('0x68')]);}})[_0xd280('0x26')](function(_0x51c877){if(_0x51c877){return db[_0xd280('0x63')][_0xd280('0x25')]({'where':{'ListId':_0x3e73fd['query']['ids'],'CampaignId':_0x3e73fd['params']['id']}})[_0xd280('0x26')](function(){return _0x51c877;});}})[_0xd280('0x26')](respondWithStatusCode(_0x32ff06,null))['catch'](handleError(_0x32ff06,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index b3ccb20..3516553 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 8c7cb32..c4cdfce 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 _0x4ded=['message','info','result','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','error','code','Campaign,\x20%s,\x20%s'];(function(_0xfa79a5,_0x256ce5){var _0x41e7b9=function(_0x50aa78){while(--_0x50aa78){_0xfa79a5['push'](_0xfa79a5['shift']());}};_0x41e7b9(++_0x256ce5);}(_0x4ded,0x116));var _0xd4de=function(_0xf5c127,_0x1ab6c5){_0xf5c127=_0xf5c127-0x0;var _0x1981ea=_0x4ded[_0xf5c127];return _0x1981ea;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var moment=require(_0xd4de('0x2'));var BPromise=require(_0xd4de('0x3'));var rs=require(_0xd4de('0x4'));var fs=require('fs');var Redis=require(_0xd4de('0x5'));var db=require(_0xd4de('0x6'))['db'];var utils=require(_0xd4de('0x7'));var logger=require(_0xd4de('0x8'))(_0xd4de('0x9'));var config=require(_0xd4de('0xa'));var jayson=require(_0xd4de('0xb'));var client=jayson['client'][_0xd4de('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2433b8,_0x15eb91,_0x2c56d5){return new BPromise(function(_0x4453c2,_0x1e8c35){return client['request'](_0x2433b8,_0x2c56d5)[_0xd4de('0xd')](function(_0x5ebcf3){logger['info']('Campaign,\x20%s,\x20%s',_0x15eb91,_0xd4de('0xe'));logger[_0xd4de('0xf')]('Campaign,\x20%s,\x20%s,\x20%s',_0x15eb91,'request\x20sent',JSON['stringify'](_0x5ebcf3));if(_0x5ebcf3[_0xd4de('0x10')]){if(_0x5ebcf3['error'][_0xd4de('0x11')]===0x1f4){logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);return _0x1e8c35(_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);}logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);return _0x4453c2(_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);}else{logger[_0xd4de('0x14')](_0xd4de('0x12'),_0x15eb91,_0xd4de('0xe'));_0x4453c2(_0x5ebcf3[_0xd4de('0x15')]['message']);}})['catch'](function(_0x3df820){logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x3df820);_0x1e8c35(_0x3df820);});});}exports[_0xd4de('0x16')]=function(_0x5b1d1c){var _0x4d0df6=this;return new Promise(function(_0x1e91d5,_0x54b757){return db[_0xd4de('0x17')][_0xd4de('0x18')]({'raw':_0x5b1d1c['options']?_0x5b1d1c[_0xd4de('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5b1d1c[_0xd4de('0x19')]?_0x5b1d1c[_0xd4de('0x19')][_0xd4de('0x1a')]||null:null,'attributes':_0x5b1d1c[_0xd4de('0x19')]?_0x5b1d1c['options'][_0xd4de('0x1b')]||null:null,'limit':_0x5b1d1c[_0xd4de('0x19')]?_0x5b1d1c[_0xd4de('0x19')][_0xd4de('0x1c')]||null:null,'include':_0x5b1d1c[_0xd4de('0x19')]?_0x5b1d1c[_0xd4de('0x19')][_0xd4de('0x1d')]?_[_0xd4de('0x1e')](_0x5b1d1c[_0xd4de('0x19')][_0xd4de('0x1d')],function(_0x534b37){return{'model':db[_0x534b37[_0xd4de('0x1f')]],'as':_0x534b37['as'],'attributes':_0x534b37[_0xd4de('0x1b')],'include':_0x534b37[_0xd4de('0x1d')]?_[_0xd4de('0x1e')](_0x534b37[_0xd4de('0x1d')],function(_0x984904){return{'model':db[_0x984904[_0xd4de('0x1f')]],'as':_0x984904['as'],'attributes':_0x984904[_0xd4de('0x1b')],'include':_0x984904[_0xd4de('0x1d')]?_[_0xd4de('0x1e')](_0x984904[_0xd4de('0x1d')],function(_0xb2d8a1){return{'model':db[_0xb2d8a1['model']],'as':_0xb2d8a1['as'],'attributes':_0xb2d8a1[_0xd4de('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd4de('0xd')](function(_0x5005b0){logger[_0xd4de('0x14')]('GetCampaign',_0x5b1d1c);logger[_0xd4de('0xf')](_0xd4de('0x16'),_0x5b1d1c,JSON[_0xd4de('0x20')](_0x5005b0));_0x1e91d5(_0x5005b0);})['catch'](function(_0xd4de93){logger[_0xd4de('0x10')](_0xd4de('0x16'),_0xd4de93['message'],_0x5b1d1c);_0x54b757(_0x4d0df6[_0xd4de('0x10')](0x1f4,_0xd4de93[_0xd4de('0x13')]));});});}; \ No newline at end of file +var _0x3a25=['error','code','message','result','catch','GetCampaign','Campaign','options','raw','where','limit','include','map','model','attributes','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x3a25,0x15d));var _0x53a2=function(_0x465445,_0x4d1916){_0x465445=_0x465445-0x0;var _0x250dfe=_0x3a25[_0x465445];return _0x250dfe;};'use strict';var _=require(_0x53a2('0x0'));var util=require(_0x53a2('0x1'));var moment=require(_0x53a2('0x2'));var BPromise=require(_0x53a2('0x3'));var rs=require(_0x53a2('0x4'));var fs=require('fs');var Redis=require(_0x53a2('0x5'));var db=require(_0x53a2('0x6'))['db'];var utils=require(_0x53a2('0x7'));var logger=require(_0x53a2('0x8'))(_0x53a2('0x9'));var config=require(_0x53a2('0xa'));var jayson=require(_0x53a2('0xb'));var client=jayson[_0x53a2('0xc')][_0x53a2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x409fff,_0x4d53b8,_0x3ee956){return new BPromise(function(_0x5dc70e,_0x17aa09){return client[_0x53a2('0xe')](_0x409fff,_0x3ee956)[_0x53a2('0xf')](function(_0x42bf42){logger[_0x53a2('0x10')](_0x53a2('0x11'),_0x4d53b8,_0x53a2('0x12'));logger[_0x53a2('0x13')](_0x53a2('0x14'),_0x4d53b8,_0x53a2('0x12'),JSON['stringify'](_0x42bf42));if(_0x42bf42['error']){if(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x16')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x4d53b8,_0x42bf42['error'][_0x53a2('0x17')]);return _0x17aa09(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x17')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x4d53b8,_0x42bf42['error'][_0x53a2('0x17')]);return _0x5dc70e(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x17')]);}else{logger[_0x53a2('0x10')]('Campaign,\x20%s,\x20%s',_0x4d53b8,_0x53a2('0x12'));_0x5dc70e(_0x42bf42[_0x53a2('0x18')][_0x53a2('0x17')]);}})[_0x53a2('0x19')](function(_0x34c7de){logger['error']('Campaign,\x20%s,\x20%s',_0x4d53b8,_0x34c7de);_0x17aa09(_0x34c7de);});});}exports[_0x53a2('0x1a')]=function(_0x446b71){var _0x443c6e=this;return new Promise(function(_0x104fb6,_0x1d23f2){return db[_0x53a2('0x1b')]['findAll']({'raw':_0x446b71['options']?_0x446b71[_0x53a2('0x1c')][_0x53a2('0x1d')]===undefined?!![]:![]:!![],'where':_0x446b71['options']?_0x446b71[_0x53a2('0x1c')][_0x53a2('0x1e')]||null:null,'attributes':_0x446b71[_0x53a2('0x1c')]?_0x446b71[_0x53a2('0x1c')]['attributes']||null:null,'limit':_0x446b71[_0x53a2('0x1c')]?_0x446b71[_0x53a2('0x1c')][_0x53a2('0x1f')]||null:null,'include':_0x446b71[_0x53a2('0x1c')]?_0x446b71[_0x53a2('0x1c')][_0x53a2('0x20')]?_[_0x53a2('0x21')](_0x446b71[_0x53a2('0x1c')]['include'],function(_0x579b10){return{'model':db[_0x579b10[_0x53a2('0x22')]],'as':_0x579b10['as'],'attributes':_0x579b10[_0x53a2('0x23')],'include':_0x579b10[_0x53a2('0x20')]?_[_0x53a2('0x21')](_0x579b10[_0x53a2('0x20')],function(_0xa39167){return{'model':db[_0xa39167['model']],'as':_0xa39167['as'],'attributes':_0xa39167[_0x53a2('0x23')],'include':_0xa39167[_0x53a2('0x20')]?_[_0x53a2('0x21')](_0xa39167[_0x53a2('0x20')],function(_0x323c8a){return{'model':db[_0x323c8a[_0x53a2('0x22')]],'as':_0x323c8a['as'],'attributes':_0x323c8a[_0x53a2('0x23')]};}):[]};}):[]};}):[]:[]})[_0x53a2('0xf')](function(_0x2f2062){logger[_0x53a2('0x10')](_0x53a2('0x1a'),_0x446b71);logger[_0x53a2('0x13')](_0x53a2('0x1a'),_0x446b71,JSON[_0x53a2('0x24')](_0x2f2062));_0x104fb6(_0x2f2062);})[_0x53a2('0x19')](function(_0xf12019){logger[_0x53a2('0x15')]('GetCampaign',_0xf12019[_0x53a2('0x17')],_0x446b71);_0x1d23f2(_0x443c6e[_0x53a2('0x15')](0x1f4,_0xf12019[_0x53a2('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 871e19c..32d0379 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 _0x21ce=['show','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','update','destroy','delete','removeBlackLists','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x21f3e5,_0x2dea32){var _0x4ccc0f=function(_0x308256){while(--_0x308256){_0x21f3e5['push'](_0x21f3e5['shift']());}};_0x4ccc0f(++_0x2dea32);}(_0x21ce,0x196));var _0xe21c=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x21ce[_0x465a0c];return _0x1e202e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe21c('0x0'));var timeout=require('connect-timeout');var express=require(_0xe21c('0x1'));var router=express[_0xe21c('0x2')]();var fs_extra=require(_0xe21c('0x3'));var auth=require(_0xe21c('0x4'));var interaction=require(_0xe21c('0x5'));var config=require(_0xe21c('0x6'));var controller=require('./campaign.controller');router[_0xe21c('0x7')]('/',auth[_0xe21c('0x8')](),controller['index']);router[_0xe21c('0x7')](_0xe21c('0x9'),auth['isAuthenticated'](),controller[_0xe21c('0xa')]);router[_0xe21c('0x7')]('/:id/hoppers',auth[_0xe21c('0x8')](),controller[_0xe21c('0xb')]);router['get']('/:id/hopper_histories',auth[_0xe21c('0x8')](),controller[_0xe21c('0xc')]);router['get'](_0xe21c('0xd'),auth[_0xe21c('0x8')](),controller[_0xe21c('0xe')]);router[_0xe21c('0x7')](_0xe21c('0xf'),auth[_0xe21c('0x8')](),controller[_0xe21c('0x10')]);router[_0xe21c('0x7')](_0xe21c('0x11'),auth['isAuthenticated'](),controller[_0xe21c('0x12')]);router['get'](_0xe21c('0x13'),auth[_0xe21c('0x8')](),controller[_0xe21c('0x14')]);router[_0xe21c('0x15')]('/',auth['isAuthenticated'](),controller[_0xe21c('0x16')]);router[_0xe21c('0x15')](_0xe21c('0x17'),auth[_0xe21c('0x8')](),controller[_0xe21c('0x18')]);router['post'](_0xe21c('0x11'),auth[_0xe21c('0x8')](),controller[_0xe21c('0x19')]);router[_0xe21c('0x15')](_0xe21c('0x13'),auth[_0xe21c('0x8')](),controller['addBlackLists']);router[_0xe21c('0x1a')](_0xe21c('0x9'),auth[_0xe21c('0x8')](),controller[_0xe21c('0x1b')]);router['delete'](_0xe21c('0x9'),auth[_0xe21c('0x8')](),controller[_0xe21c('0x1c')]);router['delete'](_0xe21c('0x11'),auth[_0xe21c('0x8')](),controller['removeLists']);router[_0xe21c('0x1d')](_0xe21c('0x13'),auth['isAuthenticated'](),controller[_0xe21c('0x1e')]);module[_0xe21c('0x1f')]=router; \ No newline at end of file +var _0xd91d=['isAuthenticated','index','/:id','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','/:id/blacklists','create','post','clone','addLists','put','update','delete','destroy','removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x3f2b3c,_0x5a722f){var _0x88b2de=function(_0x1f2b42){while(--_0x1f2b42){_0x3f2b3c['push'](_0x3f2b3c['shift']());}};_0x88b2de(++_0x5a722f);}(_0xd91d,0x71));var _0xdd91=function(_0x1aa273,_0x2d6c24){_0x1aa273=_0x1aa273-0x0;var _0x5085af=_0xd91d[_0x1aa273];return _0x5085af;};'use strict';var multer=require(_0xdd91('0x0'));var util=require(_0xdd91('0x1'));var path=require(_0xdd91('0x2'));var timeout=require(_0xdd91('0x3'));var express=require(_0xdd91('0x4'));var router=express[_0xdd91('0x5')]();var fs_extra=require(_0xdd91('0x6'));var auth=require(_0xdd91('0x7'));var interaction=require(_0xdd91('0x8'));var config=require(_0xdd91('0x9'));var controller=require('./campaign.controller');router[_0xdd91('0xa')]('/',auth[_0xdd91('0xb')](),controller[_0xdd91('0xc')]);router[_0xdd91('0xa')](_0xdd91('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xdd91('0xa')]('/:id/hoppers',auth[_0xdd91('0xb')](),controller[_0xdd91('0xe')]);router[_0xdd91('0xa')](_0xdd91('0xf'),auth['isAuthenticated'](),controller[_0xdd91('0x10')]);router[_0xdd91('0xa')](_0xdd91('0x11'),auth['isAuthenticated'](),controller[_0xdd91('0x12')]);router[_0xdd91('0xa')]('/:id/hopper_black',auth[_0xdd91('0xb')](),controller['getHopperBlacks']);router[_0xdd91('0xa')](_0xdd91('0x13'),auth[_0xdd91('0xb')](),controller['getLists']);router[_0xdd91('0xa')](_0xdd91('0x14'),auth[_0xdd91('0xb')](),controller['getBlackLists']);router['post']('/',auth[_0xdd91('0xb')](),controller[_0xdd91('0x15')]);router[_0xdd91('0x16')]('/:id/clone',auth[_0xdd91('0xb')](),controller[_0xdd91('0x17')]);router[_0xdd91('0x16')](_0xdd91('0x13'),auth['isAuthenticated'](),controller[_0xdd91('0x18')]);router[_0xdd91('0x16')]('/:id/blacklists',auth[_0xdd91('0xb')](),controller['addBlackLists']);router[_0xdd91('0x19')](_0xdd91('0xd'),auth[_0xdd91('0xb')](),controller[_0xdd91('0x1a')]);router[_0xdd91('0x1b')]('/:id',auth[_0xdd91('0xb')](),controller[_0xdd91('0x1c')]);router[_0xdd91('0x1b')]('/:id/lists',auth[_0xdd91('0xb')](),controller[_0xdd91('0x1d')]);router[_0xdd91('0x1b')]('/:id/blacklists',auth['isAuthenticated'](),controller['removeBlackLists']);module[_0xdd91('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 7c64840..0f4bce0 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 _0x94c4=['VIRTUAL','getDataValue','sequelize','exports','STRING','TEXT'];(function(_0x3bc52e,_0x19b574){var _0x4ddad7=function(_0x51cf46){while(--_0x51cf46){_0x3bc52e['push'](_0x3bc52e['shift']());}};_0x4ddad7(++_0x19b574);}(_0x94c4,0x128));var _0x494c=function(_0x2c9877,_0x51efc0){_0x2c9877=_0x2c9877-0x0;var _0x1ce656=_0x94c4[_0x2c9877];return _0x1ce656;};'use strict';var Sequelize=require(_0x494c('0x0'));module[_0x494c('0x1')]={'key':{'type':Sequelize[_0x494c('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x494c('0x3')],'length':'medium','allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x494c('0x4')],'get':function(){return this[_0x494c('0x5')]('key');}}}; \ No newline at end of file +var _0x495a=['medium','VIRTUAL','getDataValue','sequelize','exports','STRING','TEXT'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x495a,0x145));var _0xa495=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x495a[_0x474bc0];return _0x4b24cf;};'use strict';var Sequelize=require(_0xa495('0x0'));module[_0xa495('0x1')]={'key':{'type':Sequelize[_0xa495('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xa495('0x3')],'length':_0xa495('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xa495('0x2')]},'name':{'type':Sequelize[_0xa495('0x5')],'get':function(){return this[_0xa495('0x6')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 9c52d32..470845a 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 _0x23c1=['destroy','then','get','CannedAnswers','UserProfileResource','end','error','name','send','index','CannedAnswer','rawAttributes','fieldName','type','model','map','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','pick','where','filter','merge','includeAll','include','findAll','catch','show','params','keys','intersection','options','body','find','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','save','update'];(function(_0x54214a,_0x5ef767){var _0x5a1f04=function(_0x4e5d1f){while(--_0x4e5d1f){_0x54214a['push'](_0x54214a['shift']());}};_0x5a1f04(++_0x5ef767);}(_0x23c1,0x18c));var _0x123c=function(_0x4b5d42,_0x1a06bb){_0x4b5d42=_0x4b5d42-0x0;var _0x146f55=_0x23c1[_0x4b5d42];return _0x146f55;};'use strict';var emlformat=require(_0x123c('0x0'));var rimraf=require(_0x123c('0x1'));var zipdir=require(_0x123c('0x2'));var jsonpatch=require(_0x123c('0x3'));var rp=require(_0x123c('0x4'));var moment=require(_0x123c('0x5'));var BPromise=require(_0x123c('0x6'));var Mustache=require('mustache');var util=require(_0x123c('0x7'));var path=require(_0x123c('0x8'));var sox=require('sox');var csv=require(_0x123c('0x9'));var ejs=require(_0x123c('0xa'));var fs=require('fs');var fs_extra=require(_0x123c('0xb'));var _=require(_0x123c('0xc'));var squel=require('squel');var crypto=require(_0x123c('0xd'));var jsforce=require(_0x123c('0xe'));var deskjs=require(_0x123c('0xf'));var toCsv=require(_0x123c('0x9'));var querystring=require(_0x123c('0x10'));var Papa=require(_0x123c('0x11'));var Redis=require(_0x123c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x123c('0x13'));var as=require(_0x123c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x123c('0x15'));var config=require(_0x123c('0x16'));var licenseUtil=require(_0x123c('0x17'));var db=require(_0x123c('0x18'))['db'];function respondWithStatusCode(_0x1b9768,_0x54b066){_0x54b066=_0x54b066||0xcc;return function(_0x56d7f2){if(_0x56d7f2){return _0x1b9768[_0x123c('0x19')](_0x54b066);}return _0x1b9768['status'](_0x54b066)['end']();};}function respondWithResult(_0x340e38,_0x44d472){_0x44d472=_0x44d472||0xc8;return function(_0x131e03){if(_0x131e03){return _0x340e38[_0x123c('0x1a')](_0x44d472)['json'](_0x131e03);}};}function respondWithFilteredResult(_0x2e2aeb,_0x3a45da){return function(_0x24fd17){if(_0x24fd17){var _0x46009c=typeof _0x3a45da[_0x123c('0x1b')]==='undefined'&&typeof _0x3a45da[_0x123c('0x1c')]===_0x123c('0x1d');var _0x478a6a=_0x24fd17['count'];var _0x155a65=_0x46009c?0x0:_0x3a45da[_0x123c('0x1b')];var _0x85d52d=_0x46009c?_0x24fd17[_0x123c('0x1e')]:_0x3a45da[_0x123c('0x1b')]+_0x3a45da['limit'];var _0x9fd6e6;if(_0x85d52d>=_0x478a6a){_0x85d52d=_0x478a6a;_0x9fd6e6=0xc8;}else{_0x9fd6e6=0xce;}_0x2e2aeb['status'](_0x9fd6e6);return _0x2e2aeb[_0x123c('0x1f')]('Content-Range',_0x155a65+'-'+_0x85d52d+'/'+_0x478a6a)['json'](_0x24fd17);}return null;};}function patchUpdates(_0x217f38){return function(_0x2442b2){try{jsonpatch['apply'](_0x2442b2,_0x217f38,!![]);}catch(_0x3af396){return BPromise['reject'](_0x3af396);}return _0x2442b2[_0x123c('0x20')]();};}function saveUpdates(_0x236aa9,_0x51efba){return function(_0x3432ab){if(_0x3432ab){return _0x3432ab[_0x123c('0x21')](_0x236aa9)['then'](function(_0x3f6664){return _0x3f6664;});}return null;};}function removeEntity(_0x171ea7,_0xc4be78){return function(_0x208ed6){if(_0x208ed6){return _0x208ed6[_0x123c('0x22')]()[_0x123c('0x23')](function(){var _0x36292e=_0x208ed6[_0x123c('0x24')]({'plain':!![]});var _0xf1ad6b=_0x123c('0x25');return db[_0x123c('0x26')][_0x123c('0x22')]({'where':{'type':_0xf1ad6b,'resourceId':_0x36292e['id']}})[_0x123c('0x23')](function(){return _0x208ed6;});})[_0x123c('0x23')](function(){_0x171ea7['status'](0xcc)[_0x123c('0x27')]();});}};}function handleEntityNotFound(_0x56252f,_0x5c1ebd){return function(_0x5d1a01){if(!_0x5d1a01){_0x56252f['sendStatus'](0x194);}return _0x5d1a01;};}function handleError(_0x3ca3fb,_0x1bb111){_0x1bb111=_0x1bb111||0x1f4;return function(_0x595b3a){logger[_0x123c('0x28')](_0x595b3a['stack']);if(_0x595b3a[_0x123c('0x29')]){delete _0x595b3a[_0x123c('0x29')];}_0x3ca3fb[_0x123c('0x1a')](_0x1bb111)[_0x123c('0x2a')](_0x595b3a);};}exports[_0x123c('0x2b')]=function(_0x588e8e,_0x37dc02){var _0x22fd13={},_0x503fb5={},_0x13fca8={'count':0x0,'rows':[]};var _0x552e22=_['map'](db[_0x123c('0x2c')][_0x123c('0x2d')],function(_0x2cd7eb){return{'name':_0x2cd7eb[_0x123c('0x2e')],'type':_0x2cd7eb[_0x123c('0x2f')]['key']};});_0x503fb5[_0x123c('0x30')]=_[_0x123c('0x31')](_0x552e22,'name');_0x503fb5['query']=_['keys'](_0x588e8e[_0x123c('0x32')]);_0x503fb5[_0x123c('0x33')]=_['intersection'](_0x503fb5[_0x123c('0x30')],_0x503fb5[_0x123c('0x32')]);_0x22fd13[_0x123c('0x34')]=_['intersection'](_0x503fb5['model'],qs[_0x123c('0x35')](_0x588e8e[_0x123c('0x32')]['fields']));_0x22fd13[_0x123c('0x34')]=_0x22fd13[_0x123c('0x34')]['length']?_0x22fd13['attributes']:_0x503fb5[_0x123c('0x30')];if(!_0x588e8e['query'][_0x123c('0x36')](_0x123c('0x37'))){_0x22fd13[_0x123c('0x1c')]=qs['limit'](_0x588e8e[_0x123c('0x32')][_0x123c('0x1c')]);_0x22fd13[_0x123c('0x1b')]=qs['offset'](_0x588e8e['query'][_0x123c('0x1b')]);}_0x22fd13['order']=qs[_0x123c('0x38')](_0x588e8e[_0x123c('0x32')][_0x123c('0x38')]);_0x22fd13['where']=qs['filters'](_[_0x123c('0x39')](_0x588e8e[_0x123c('0x32')],_0x503fb5[_0x123c('0x33')]),_0x552e22);if(_0x588e8e[_0x123c('0x32')]['filter']){_0x22fd13[_0x123c('0x3a')]=_['merge'](_0x22fd13[_0x123c('0x3a')],{'$or':[{'key':{'$like':'%'+_0x588e8e[_0x123c('0x32')][_0x123c('0x3b')]+'%'}},{'value':{'$like':'%'+_0x588e8e[_0x123c('0x32')][_0x123c('0x3b')]+'%'}}]});}_0x22fd13=_[_0x123c('0x3c')]({},_0x22fd13,_0x588e8e['options']);var _0x1eece0={'where':_0x22fd13[_0x123c('0x3a')]};return db[_0x123c('0x2c')][_0x123c('0x1e')](_0x1eece0)[_0x123c('0x23')](function(_0x49a445){_0x13fca8[_0x123c('0x1e')]=_0x49a445;if(_0x588e8e[_0x123c('0x32')][_0x123c('0x3d')]){_0x22fd13[_0x123c('0x3e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x123c('0x3f')](_0x22fd13);})[_0x123c('0x23')](function(_0x4ace35){_0x13fca8['rows']=_0x4ace35;return _0x13fca8;})[_0x123c('0x23')](respondWithFilteredResult(_0x37dc02,_0x22fd13))[_0x123c('0x40')](handleError(_0x37dc02,null));};exports[_0x123c('0x41')]=function(_0x3d8479,_0x3927d3){var _0x49e430={'raw':!![],'where':{'id':_0x3d8479[_0x123c('0x42')]['id']}},_0x1a4d97={};_0x1a4d97[_0x123c('0x30')]=_[_0x123c('0x43')](db[_0x123c('0x2c')][_0x123c('0x2d')]);_0x1a4d97[_0x123c('0x32')]=_[_0x123c('0x43')](_0x3d8479[_0x123c('0x32')]);_0x1a4d97[_0x123c('0x33')]=_[_0x123c('0x44')](_0x1a4d97['model'],_0x1a4d97['query']);_0x49e430['attributes']=_[_0x123c('0x44')](_0x1a4d97[_0x123c('0x30')],qs[_0x123c('0x35')](_0x3d8479[_0x123c('0x32')][_0x123c('0x35')]));_0x49e430[_0x123c('0x34')]=_0x49e430[_0x123c('0x34')]['length']?_0x49e430[_0x123c('0x34')]:_0x1a4d97[_0x123c('0x30')];if(_0x3d8479['query'][_0x123c('0x3d')]){_0x49e430['include']=[{'all':!![]}];}_0x49e430=_[_0x123c('0x3c')]({},_0x49e430,_0x3d8479[_0x123c('0x45')]);return db[_0x123c('0x2c')]['find'](_0x49e430)['then'](handleEntityNotFound(_0x3927d3,null))[_0x123c('0x23')](respondWithResult(_0x3927d3,null))[_0x123c('0x40')](handleError(_0x3927d3,null));};exports[_0x123c('0x21')]=function(_0x4897f7,_0x26d68e){if(_0x4897f7[_0x123c('0x46')]['id']){delete _0x4897f7[_0x123c('0x46')]['id'];}return db[_0x123c('0x2c')]['find']({'where':{'id':_0x4897f7[_0x123c('0x42')]['id']}})[_0x123c('0x23')](handleEntityNotFound(_0x26d68e,null))['then'](saveUpdates(_0x4897f7['body'],null))[_0x123c('0x23')](respondWithResult(_0x26d68e,null))[_0x123c('0x40')](handleError(_0x26d68e,null));};exports[_0x123c('0x22')]=function(_0x5eb2dd,_0x234532){return db[_0x123c('0x2c')][_0x123c('0x47')]({'where':{'id':_0x5eb2dd['params']['id']}})[_0x123c('0x23')](handleEntityNotFound(_0x234532,null))[_0x123c('0x23')](removeEntity(_0x234532,null))['catch'](handleError(_0x234532,null));};exports[_0x123c('0x48')]=function(_0x2477dd,_0x3e905b){var _0x3b453f={'key':_0x2477dd['body'][_0x123c('0x49')]};if(_0x2477dd[_0x123c('0x46')][_0x123c('0x4a')]){_0x3b453f[_0x123c('0x4a')]=_0x2477dd[_0x123c('0x46')][_0x123c('0x4a')];}else if(_0x2477dd[_0x123c('0x46')][_0x123c('0x4b')]){_0x3b453f['SmsAccountId']=_0x2477dd[_0x123c('0x46')][_0x123c('0x4b')];}else if(_0x2477dd[_0x123c('0x46')][_0x123c('0x4c')]){_0x3b453f[_0x123c('0x4c')]=_0x2477dd[_0x123c('0x46')]['OpenchannelAccountId'];}else if(_0x2477dd[_0x123c('0x46')][_0x123c('0x4d')]){_0x3b453f[_0x123c('0x4d')]=_0x2477dd[_0x123c('0x46')][_0x123c('0x4d')];}return db[_0x123c('0x2c')]['find']({'where':_0x3b453f})['then'](function(_0x36fcce){if(_0x36fcce){throw new db['Sequelize'][(_0x123c('0x4e'))](_0x123c('0x4f'));}return db[_0x123c('0x2c')]['create'](_0x2477dd[_0x123c('0x46')]);})['then'](function(_0x2d9b4d){var _0x308768=_0x2477dd[_0x123c('0x50')]['get']({'plain':!![]});if(!_0x308768)throw new Error(_0x123c('0x51'));if(_0x308768[_0x123c('0x52')]==='user'){var _0x28450e=_0x2d9b4d[_0x123c('0x24')]({'plain':!![]});return db[_0x123c('0x53')][_0x123c('0x47')]({'where':{'name':_0x123c('0x25'),'userProfileId':_0x308768[_0x123c('0x54')]},'raw':!![]})[_0x123c('0x23')](function(_0x289baa){if(_0x289baa&&_0x289baa[_0x123c('0x55')]===0x0){return db['UserProfileResource'][_0x123c('0x48')]({'name':_0x28450e[_0x123c('0x29')],'resourceId':_0x28450e['id'],'type':_0x289baa['name'],'sectionId':_0x289baa['id']},{})[_0x123c('0x23')](function(){return _0x2d9b4d;});}else{return _0x2d9b4d;}})[_0x123c('0x40')](function(_0x277135){logger[_0x123c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x277135);throw _0x277135;});}return _0x2d9b4d;})['then'](respondWithResult(_0x3e905b,0xc9))['catch'](handleError(_0x3e905b,null));}; \ No newline at end of file +var _0x0195=['lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','CannedAnswer','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','filter','includeAll','include','findAll','catch','show','params','options','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CannedAnswers','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x56fa0c,_0x17a7cd){var _0x37e578=function(_0x18c9fd){while(--_0x18c9fd){_0x56fa0c['push'](_0x56fa0c['shift']());}};_0x37e578(++_0x17a7cd);}(_0x0195,0xa4));var _0x5019=function(_0x19de2c,_0x474a0e){_0x19de2c=_0x19de2c-0x0;var _0x14d4d8=_0x0195[_0x19de2c];return _0x14d4d8;};'use strict';var emlformat=require(_0x5019('0x0'));var rimraf=require(_0x5019('0x1'));var zipdir=require(_0x5019('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5019('0x3'));var Mustache=require(_0x5019('0x4'));var util=require('util');var path=require(_0x5019('0x5'));var sox=require(_0x5019('0x6'));var csv=require(_0x5019('0x7'));var ejs=require(_0x5019('0x8'));var fs=require('fs');var fs_extra=require(_0x5019('0x9'));var _=require(_0x5019('0xa'));var squel=require('squel');var crypto=require(_0x5019('0xb'));var jsforce=require(_0x5019('0xc'));var deskjs=require(_0x5019('0xd'));var toCsv=require(_0x5019('0x7'));var querystring=require('querystring');var Papa=require(_0x5019('0xe'));var Redis=require(_0x5019('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5019('0x10'));var as=require(_0x5019('0x11'));var hardwareService=require(_0x5019('0x12'));var logger=require(_0x5019('0x13'))(_0x5019('0x14'));var utils=require(_0x5019('0x15'));var config=require(_0x5019('0x16'));var licenseUtil=require(_0x5019('0x17'));var db=require(_0x5019('0x18'))['db'];function respondWithStatusCode(_0x520a0c,_0x5ce903){_0x5ce903=_0x5ce903||0xcc;return function(_0x5ff3db){if(_0x5ff3db){return _0x520a0c[_0x5019('0x19')](_0x5ce903);}return _0x520a0c[_0x5019('0x1a')](_0x5ce903)['end']();};}function respondWithResult(_0x80c672,_0x4d65b2){_0x4d65b2=_0x4d65b2||0xc8;return function(_0x258a3c){if(_0x258a3c){return _0x80c672[_0x5019('0x1a')](_0x4d65b2)['json'](_0x258a3c);}};}function respondWithFilteredResult(_0x3a8324,_0x309518){return function(_0x5d6fcf){if(_0x5d6fcf){var _0x488e47=typeof _0x309518[_0x5019('0x1b')]===_0x5019('0x1c')&&typeof _0x309518[_0x5019('0x1d')]===_0x5019('0x1c');var _0x3ddb2e=_0x5d6fcf[_0x5019('0x1e')];var _0x26ee1d=_0x488e47?0x0:_0x309518[_0x5019('0x1b')];var _0x6c2279=_0x488e47?_0x5d6fcf[_0x5019('0x1e')]:_0x309518[_0x5019('0x1b')]+_0x309518[_0x5019('0x1d')];var _0x51c4c;if(_0x6c2279>=_0x3ddb2e){_0x6c2279=_0x3ddb2e;_0x51c4c=0xc8;}else{_0x51c4c=0xce;}_0x3a8324[_0x5019('0x1a')](_0x51c4c);return _0x3a8324[_0x5019('0x1f')](_0x5019('0x20'),_0x26ee1d+'-'+_0x6c2279+'/'+_0x3ddb2e)[_0x5019('0x21')](_0x5d6fcf);}return null;};}function patchUpdates(_0x36aa8f){return function(_0x4438cc){try{jsonpatch['apply'](_0x4438cc,_0x36aa8f,!![]);}catch(_0x1b3f6a){return BPromise[_0x5019('0x22')](_0x1b3f6a);}return _0x4438cc['save']();};}function saveUpdates(_0x55123d,_0x3fe61d){return function(_0x17900f){if(_0x17900f){return _0x17900f[_0x5019('0x23')](_0x55123d)[_0x5019('0x24')](function(_0x26127e){return _0x26127e;});}return null;};}function removeEntity(_0x42b4a7,_0x1c331b){return function(_0x33bb4e){if(_0x33bb4e){return _0x33bb4e[_0x5019('0x25')]()['then'](function(){var _0x3ffabb=_0x33bb4e[_0x5019('0x26')]({'plain':!![]});var _0x22ea6e='CannedAnswers';return db[_0x5019('0x27')][_0x5019('0x25')]({'where':{'type':_0x22ea6e,'resourceId':_0x3ffabb['id']}})[_0x5019('0x24')](function(){return _0x33bb4e;});})[_0x5019('0x24')](function(){_0x42b4a7[_0x5019('0x1a')](0xcc)[_0x5019('0x28')]();});}};}function handleEntityNotFound(_0xb005dd,_0x376320){return function(_0x445058){if(!_0x445058){_0xb005dd['sendStatus'](0x194);}return _0x445058;};}function handleError(_0xa9e529,_0x2eb976){_0x2eb976=_0x2eb976||0x1f4;return function(_0x280bf6){logger[_0x5019('0x29')](_0x280bf6[_0x5019('0x2a')]);if(_0x280bf6[_0x5019('0x2b')]){delete _0x280bf6[_0x5019('0x2b')];}_0xa9e529[_0x5019('0x1a')](_0x2eb976)[_0x5019('0x2c')](_0x280bf6);};}exports[_0x5019('0x2d')]=function(_0x4d9aa5,_0x38cd51){var _0x3fcb85={},_0x2a750a={},_0x36646c={'count':0x0,'rows':[]};var _0x503160=_[_0x5019('0x2e')](db[_0x5019('0x2f')][_0x5019('0x30')],function(_0x5b18e9){return{'name':_0x5b18e9['fieldName'],'type':_0x5b18e9[_0x5019('0x31')]['key']};});_0x2a750a[_0x5019('0x32')]=_[_0x5019('0x2e')](_0x503160,_0x5019('0x2b'));_0x2a750a[_0x5019('0x33')]=_[_0x5019('0x34')](_0x4d9aa5['query']);_0x2a750a[_0x5019('0x35')]=_[_0x5019('0x36')](_0x2a750a[_0x5019('0x32')],_0x2a750a['query']);_0x3fcb85[_0x5019('0x37')]=_[_0x5019('0x36')](_0x2a750a[_0x5019('0x32')],qs[_0x5019('0x38')](_0x4d9aa5[_0x5019('0x33')][_0x5019('0x38')]));_0x3fcb85[_0x5019('0x37')]=_0x3fcb85[_0x5019('0x37')][_0x5019('0x39')]?_0x3fcb85[_0x5019('0x37')]:_0x2a750a['model'];if(!_0x4d9aa5[_0x5019('0x33')]['hasOwnProperty'](_0x5019('0x3a'))){_0x3fcb85['limit']=qs[_0x5019('0x1d')](_0x4d9aa5[_0x5019('0x33')][_0x5019('0x1d')]);_0x3fcb85[_0x5019('0x1b')]=qs[_0x5019('0x1b')](_0x4d9aa5[_0x5019('0x33')][_0x5019('0x1b')]);}_0x3fcb85[_0x5019('0x3b')]=qs[_0x5019('0x3c')](_0x4d9aa5['query'][_0x5019('0x3c')]);_0x3fcb85[_0x5019('0x3d')]=qs['filters'](_['pick'](_0x4d9aa5['query'],_0x2a750a[_0x5019('0x35')]),_0x503160);if(_0x4d9aa5[_0x5019('0x33')]['filter']){_0x3fcb85[_0x5019('0x3d')]=_[_0x5019('0x3e')](_0x3fcb85[_0x5019('0x3d')],{'$or':[{'key':{'$like':'%'+_0x4d9aa5[_0x5019('0x33')][_0x5019('0x3f')]+'%'}},{'value':{'$like':'%'+_0x4d9aa5[_0x5019('0x33')]['filter']+'%'}}]});}_0x3fcb85=_[_0x5019('0x3e')]({},_0x3fcb85,_0x4d9aa5['options']);var _0x4dda8b={'where':_0x3fcb85[_0x5019('0x3d')]};return db[_0x5019('0x2f')][_0x5019('0x1e')](_0x4dda8b)[_0x5019('0x24')](function(_0xb35ef8){_0x36646c[_0x5019('0x1e')]=_0xb35ef8;if(_0x4d9aa5['query'][_0x5019('0x40')]){_0x3fcb85[_0x5019('0x41')]=[{'all':!![]}];}return db[_0x5019('0x2f')][_0x5019('0x42')](_0x3fcb85);})[_0x5019('0x24')](function(_0x5d4ce9){_0x36646c['rows']=_0x5d4ce9;return _0x36646c;})['then'](respondWithFilteredResult(_0x38cd51,_0x3fcb85))[_0x5019('0x43')](handleError(_0x38cd51,null));};exports[_0x5019('0x44')]=function(_0x9b5f4a,_0x34d041){var _0x5ba06f={'raw':!![],'where':{'id':_0x9b5f4a[_0x5019('0x45')]['id']}},_0x38336a={};_0x38336a[_0x5019('0x32')]=_[_0x5019('0x34')](db[_0x5019('0x2f')]['rawAttributes']);_0x38336a[_0x5019('0x33')]=_['keys'](_0x9b5f4a['query']);_0x38336a[_0x5019('0x35')]=_[_0x5019('0x36')](_0x38336a[_0x5019('0x32')],_0x38336a[_0x5019('0x33')]);_0x5ba06f[_0x5019('0x37')]=_[_0x5019('0x36')](_0x38336a[_0x5019('0x32')],qs[_0x5019('0x38')](_0x9b5f4a[_0x5019('0x33')]['fields']));_0x5ba06f[_0x5019('0x37')]=_0x5ba06f['attributes'][_0x5019('0x39')]?_0x5ba06f[_0x5019('0x37')]:_0x38336a[_0x5019('0x32')];if(_0x9b5f4a[_0x5019('0x33')][_0x5019('0x40')]){_0x5ba06f[_0x5019('0x41')]=[{'all':!![]}];}_0x5ba06f=_[_0x5019('0x3e')]({},_0x5ba06f,_0x9b5f4a[_0x5019('0x46')]);return db['CannedAnswer'][_0x5019('0x47')](_0x5ba06f)['then'](handleEntityNotFound(_0x34d041,null))[_0x5019('0x24')](respondWithResult(_0x34d041,null))['catch'](handleError(_0x34d041,null));};exports[_0x5019('0x23')]=function(_0x556fbc,_0x415545){if(_0x556fbc[_0x5019('0x48')]['id']){delete _0x556fbc[_0x5019('0x48')]['id'];}return db[_0x5019('0x2f')][_0x5019('0x47')]({'where':{'id':_0x556fbc['params']['id']}})['then'](handleEntityNotFound(_0x415545,null))[_0x5019('0x24')](saveUpdates(_0x556fbc[_0x5019('0x48')],null))[_0x5019('0x24')](respondWithResult(_0x415545,null))[_0x5019('0x43')](handleError(_0x415545,null));};exports['destroy']=function(_0x53fa15,_0x4782d3){return db[_0x5019('0x2f')]['find']({'where':{'id':_0x53fa15['params']['id']}})[_0x5019('0x24')](handleEntityNotFound(_0x4782d3,null))[_0x5019('0x24')](removeEntity(_0x4782d3,null))['catch'](handleError(_0x4782d3,null));};exports['create']=function(_0x497f84,_0x5bb3fd){var _0x331b60={'key':_0x497f84[_0x5019('0x48')]['key']};if(_0x497f84[_0x5019('0x48')]['MailAccountId']){_0x331b60[_0x5019('0x49')]=_0x497f84[_0x5019('0x48')][_0x5019('0x49')];}else if(_0x497f84[_0x5019('0x48')]['SmsAccountId']){_0x331b60[_0x5019('0x4a')]=_0x497f84[_0x5019('0x48')][_0x5019('0x4a')];}else if(_0x497f84[_0x5019('0x48')][_0x5019('0x4b')]){_0x331b60[_0x5019('0x4b')]=_0x497f84[_0x5019('0x48')][_0x5019('0x4b')];}else if(_0x497f84['body'][_0x5019('0x4c')]){_0x331b60[_0x5019('0x4c')]=_0x497f84[_0x5019('0x48')][_0x5019('0x4c')];}return db[_0x5019('0x2f')][_0x5019('0x47')]({'where':_0x331b60})[_0x5019('0x24')](function(_0xdd2a76){if(_0xdd2a76){throw new db[(_0x5019('0x4d'))][(_0x5019('0x4e'))](_0x5019('0x4f'));}return db[_0x5019('0x2f')][_0x5019('0x50')](_0x497f84[_0x5019('0x48')]);})[_0x5019('0x24')](function(_0x23cb92){var _0x43ad6b=_0x497f84[_0x5019('0x51')]['get']({'plain':!![]});if(!_0x43ad6b)throw new Error(_0x5019('0x52'));if(_0x43ad6b[_0x5019('0x53')]===_0x5019('0x51')){var _0x175efd=_0x23cb92['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x5019('0x54'),'userProfileId':_0x43ad6b['userProfileId']},'raw':!![]})[_0x5019('0x24')](function(_0x1e2e54){if(_0x1e2e54&&_0x1e2e54[_0x5019('0x55')]===0x0){return db['UserProfileResource'][_0x5019('0x50')]({'name':_0x175efd[_0x5019('0x2b')],'resourceId':_0x175efd['id'],'type':_0x1e2e54[_0x5019('0x2b')],'sectionId':_0x1e2e54['id']},{})[_0x5019('0x24')](function(){return _0x23cb92;});}else{return _0x23cb92;}})[_0x5019('0x43')](function(_0x5c2546){logger[_0x5019('0x29')](_0x5019('0x56'),_0x5c2546);throw _0x5c2546;});}return _0x23cb92;})[_0x5019('0x24')](respondWithResult(_0x5bb3fd,0xc9))[_0x5019('0x43')](handleError(_0x5bb3fd,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 56302a4..ea245fc 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 _0xfc5a=['api','moment','bluebird','request-promise','rimraf','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfc5a,0x169));var _0xafc5=function(_0xc28702,_0x145b87){_0xc28702=_0xc28702-0x0;var _0x3b6e9e=_0xfc5a[_0xc28702];return _0x3b6e9e;};'use strict';var _=require(_0xafc5('0x0'));var util=require(_0xafc5('0x1'));var logger=require(_0xafc5('0x2'))(_0xafc5('0x3'));var moment=require(_0xafc5('0x4'));var BPromise=require(_0xafc5('0x5'));var rp=require(_0xafc5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xafc5('0x7'));var config=require('../../config/environment');var attributes=require(_0xafc5('0x8'));module['exports']=function(_0x32c787,_0x21f714){return _0x32c787[_0xafc5('0x9')](_0xafc5('0xa'),attributes,{'tableName':_0xafc5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xafc5('0xc'),'collate':_0xafc5('0xd')});}; \ No newline at end of file +var _0x6669=['moment','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x21f170,_0x22e663){var _0x2f27a2=function(_0x59842c){while(--_0x59842c){_0x21f170['push'](_0x21f170['shift']());}};_0x2f27a2(++_0x22e663);}(_0x6669,0x184));var _0x9666=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x6669[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require(_0x9666('0x0'));var util=require(_0x9666('0x1'));var logger=require(_0x9666('0x2'))(_0x9666('0x3'));var moment=require(_0x9666('0x4'));var BPromise=require(_0x9666('0x5'));var rp=require(_0x9666('0x6'));var fs=require('fs');var path=require(_0x9666('0x7'));var rimraf=require('rimraf');var config=require(_0x9666('0x8'));var attributes=require(_0x9666('0x9'));module['exports']=function(_0x55f0c3,_0x174435){return _0x55f0c3['define'](_0x9666('0xa'),attributes,{'tableName':_0x9666('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9666('0xc'),'collate':_0x9666('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index ede7f2f..95b2500 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(_0xe81156,_0x1a5668){var _0x4807a1=function(_0x91221a){while(--_0x91221a){_0xe81156['push'](_0xe81156['shift']());}};_0x4807a1(++_0x1a5668);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x550285,_0x517e84){var _0x29b05f=function(_0x22969a){while(--_0x22969a){_0x550285['push'](_0x550285['shift']());}};_0x29b05f(++_0x517e84);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 02f548d..22c78f8 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 _0x7be4=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','post','create','put','update','multer','util'];(function(_0x3dc596,_0x43ff29){var _0x301b03=function(_0x20f2da){while(--_0x20f2da){_0x3dc596['push'](_0x3dc596['shift']());}};_0x301b03(++_0x43ff29);}(_0x7be4,0x8e));var _0x47be=function(_0x38547b,_0x323ea3){_0x38547b=_0x38547b-0x0;var _0x1fd9f8=_0x7be4[_0x38547b];return _0x1fd9f8;};'use strict';var multer=require(_0x47be('0x0'));var util=require(_0x47be('0x1'));var path=require(_0x47be('0x2'));var timeout=require(_0x47be('0x3'));var express=require(_0x47be('0x4'));var router=express[_0x47be('0x5')]();var fs_extra=require(_0x47be('0x6'));var auth=require(_0x47be('0x7'));var interaction=require(_0x47be('0x8'));var config=require(_0x47be('0x9'));var controller=require(_0x47be('0xa'));router[_0x47be('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x47be('0xb')](_0x47be('0xc'),auth[_0x47be('0xd')](),controller['show']);router[_0x47be('0xe')]('/',auth[_0x47be('0xd')](),controller[_0x47be('0xf')]);router[_0x47be('0x10')](_0x47be('0xc'),auth[_0x47be('0xd')](),controller[_0x47be('0x11')]);router['delete'](_0x47be('0xc'),auth[_0x47be('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd024=['post','create','put','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show'];(function(_0xc8781a,_0x23039e){var _0x24ff2d=function(_0x5b404d){while(--_0x5b404d){_0xc8781a['push'](_0xc8781a['shift']());}};_0x24ff2d(++_0x23039e);}(_0xd024,0x132));var _0x4d02=function(_0x551d3b,_0xd0f971){_0x551d3b=_0x551d3b-0x0;var _0x157b6c=_0xd024[_0x551d3b];return _0x157b6c;};'use strict';var multer=require(_0x4d02('0x0'));var util=require(_0x4d02('0x1'));var path=require('path');var timeout=require(_0x4d02('0x2'));var express=require(_0x4d02('0x3'));var router=express[_0x4d02('0x4')]();var fs_extra=require(_0x4d02('0x5'));var auth=require(_0x4d02('0x6'));var interaction=require(_0x4d02('0x7'));var config=require(_0x4d02('0x8'));var controller=require(_0x4d02('0x9'));router[_0x4d02('0xa')]('/',auth[_0x4d02('0xb')](),controller[_0x4d02('0xc')]);router[_0x4d02('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4d02('0xd')]);router[_0x4d02('0xe')]('/',auth[_0x4d02('0xb')](),controller[_0x4d02('0xf')]);router[_0x4d02('0x10')](_0x4d02('0x11'),auth[_0x4d02('0xb')](),controller['update']);router[_0x4d02('0x12')](_0x4d02('0x11'),auth[_0x4d02('0xb')](),controller['destroy']);module[_0x4d02('0x13')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 64eb053..99d5508 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 _0xb5f8=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x4a4fd8,_0x1e63fa){var _0x217aaf=function(_0x26beab){while(--_0x26beab){_0x4a4fd8['push'](_0x4a4fd8['shift']());}};_0x217aaf(++_0x1e63fa);}(_0xb5f8,0x88));var _0x8b5f=function(_0x211f31,_0x83767e){_0x211f31=_0x211f31-0x0;var _0x525a01=_0xb5f8[_0x211f31];return _0x525a01;};'use strict';var Sequelize=require(_0x8b5f('0x0'));module[_0x8b5f('0x1')]={'calldate':{'type':Sequelize[_0x8b5f('0x2')],'allowNull':![],'defaultValue':_0x8b5f('0x3')},'clid':{'type':Sequelize[_0x8b5f('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x8b5f('0x4')]},'dcontext':{'type':Sequelize[_0x8b5f('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x8b5f('0x4')]},'lastapp':{'type':Sequelize[_0x8b5f('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x8b5f('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8b5f('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8b5f('0x4')]},'userfield':{'type':Sequelize[_0x8b5f('0x4')]},'uniqueid':{'type':Sequelize[_0x8b5f('0x4')]},'linkedid':{'type':Sequelize[_0x8b5f('0x4')]},'sequence':{'type':Sequelize[_0x8b5f('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8b5f('0x4')]},'tag':{'type':Sequelize[_0x8b5f('0x4')]}}; \ No newline at end of file +var _0xe0dc=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0xe0dc,0x77));var _0xce0d=function(_0x1fa19c,_0x5c740b){_0x1fa19c=_0x1fa19c-0x0;var _0x5b332d=_0xe0dc[_0x1fa19c];return _0x5b332d;};'use strict';var Sequelize=require('sequelize');module[_0xce0d('0x0')]={'calldate':{'type':Sequelize[_0xce0d('0x1')],'allowNull':![],'defaultValue':_0xce0d('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xce0d('0x3')]},'dst':{'type':Sequelize[_0xce0d('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xce0d('0x3')]},'dstchannel':{'type':Sequelize[_0xce0d('0x3')]},'lastapp':{'type':Sequelize[_0xce0d('0x3')]},'lastdata':{'type':Sequelize[_0xce0d('0x3')]},'duration':{'type':Sequelize[_0xce0d('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xce0d('0x3')]},'amaflags':{'type':Sequelize[_0xce0d('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xce0d('0x3')]},'userfield':{'type':Sequelize[_0xce0d('0x3')]},'uniqueid':{'type':Sequelize[_0xce0d('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xce0d('0x3')]},'peeraccount':{'type':Sequelize[_0xce0d('0x3')]},'type':{'type':Sequelize[_0xce0d('0x3')]},'tag':{'type':Sequelize[_0xce0d('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 58d9b5f..4ae0f5b 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 _0x0d4d=['zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','Content-Range','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','Cdr','rows','catch','show','params','keys','length','find','create','body','destroy','describe','eml-format','rimraf'];(function(_0x9964b0,_0xaa88bf){var _0x1efb5f=function(_0x2071d2){while(--_0x2071d2){_0x9964b0['push'](_0x9964b0['shift']());}};_0x1efb5f(++_0xaa88bf);}(_0x0d4d,0x132));var _0xd0d4=function(_0x4a9ccf,_0x1cfae6){_0x4a9ccf=_0x4a9ccf-0x0;var _0x4f8971=_0x0d4d[_0x4a9ccf];return _0x4f8971;};'use strict';var emlformat=require(_0xd0d4('0x0'));var rimraf=require(_0xd0d4('0x1'));var zipdir=require(_0xd0d4('0x2'));var jsonpatch=require(_0xd0d4('0x3'));var rp=require(_0xd0d4('0x4'));var moment=require(_0xd0d4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd0d4('0x6'));var util=require('util');var path=require(_0xd0d4('0x7'));var sox=require(_0xd0d4('0x8'));var csv=require('to-csv');var ejs=require(_0xd0d4('0x9'));var fs=require('fs');var fs_extra=require(_0xd0d4('0xa'));var _=require(_0xd0d4('0xb'));var squel=require('squel');var crypto=require(_0xd0d4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd0d4('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd0d4('0xe'));var Papa=require(_0xd0d4('0xf'));var Redis=require(_0xd0d4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd0d4('0x11'));var as=require(_0xd0d4('0x12'));var hardwareService=require(_0xd0d4('0x13'));var logger=require(_0xd0d4('0x14'))(_0xd0d4('0x15'));var utils=require(_0xd0d4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd0d4('0x17'));var db=require(_0xd0d4('0x18'))['db'];function respondWithStatusCode(_0x29ee49,_0x2ddeca){_0x2ddeca=_0x2ddeca||0xcc;return function(_0x38ca06){if(_0x38ca06){return _0x29ee49[_0xd0d4('0x19')](_0x2ddeca);}return _0x29ee49['status'](_0x2ddeca)[_0xd0d4('0x1a')]();};}function respondWithResult(_0x2131c8,_0x10a175){_0x10a175=_0x10a175||0xc8;return function(_0x5d6dd7){if(_0x5d6dd7){return _0x2131c8['status'](_0x10a175)[_0xd0d4('0x1b')](_0x5d6dd7);}};}function respondWithFilteredResult(_0x186405,_0x553b47){return function(_0x29bda4){if(_0x29bda4){var _0x1e8608=typeof _0x553b47['offset']==='undefined'&&typeof _0x553b47[_0xd0d4('0x1c')]===_0xd0d4('0x1d');var _0x268e1a=_0x29bda4['count'];var _0x5cf4c6=_0x1e8608?0x0:_0x553b47['offset'];var _0x407cda=_0x1e8608?_0x29bda4[_0xd0d4('0x1e')]:_0x553b47[_0xd0d4('0x1f')]+_0x553b47['limit'];var _0x568c75;if(_0x407cda>=_0x268e1a){_0x407cda=_0x268e1a;_0x568c75=0xc8;}else{_0x568c75=0xce;}_0x186405[_0xd0d4('0x20')](_0x568c75);return _0x186405['set'](_0xd0d4('0x21'),_0x5cf4c6+'-'+_0x407cda+'/'+_0x268e1a)[_0xd0d4('0x1b')](_0x29bda4);}return null;};}function patchUpdates(_0x1dcc1b){return function(_0x485cd8){try{jsonpatch[_0xd0d4('0x22')](_0x485cd8,_0x1dcc1b,!![]);}catch(_0x4d9fac){return BPromise['reject'](_0x4d9fac);}return _0x485cd8[_0xd0d4('0x23')]();};}function saveUpdates(_0xda03dd,_0x49b6f0){return function(_0x50f959){if(_0x50f959){return _0x50f959[_0xd0d4('0x24')](_0xda03dd)[_0xd0d4('0x25')](function(_0x398a00){return _0x398a00;});}return null;};}function removeEntity(_0x4c94b1,_0x1d8033){return function(_0x1c0831){if(_0x1c0831){return _0x1c0831['destroy']()[_0xd0d4('0x25')](function(){_0x4c94b1['status'](0xcc)[_0xd0d4('0x1a')]();});}};}function handleEntityNotFound(_0x1b03ef,_0x16808c){return function(_0x5380c3){if(!_0x5380c3){_0x1b03ef['sendStatus'](0x194);}return _0x5380c3;};}function handleError(_0x131de5,_0x4e7cc1){_0x4e7cc1=_0x4e7cc1||0x1f4;return function(_0x50e7f0){logger[_0xd0d4('0x26')](_0x50e7f0[_0xd0d4('0x27')]);if(_0x50e7f0[_0xd0d4('0x28')]){delete _0x50e7f0[_0xd0d4('0x28')];}_0x131de5['status'](_0x4e7cc1)[_0xd0d4('0x29')](_0x50e7f0);};}exports[_0xd0d4('0x2a')]=function(_0x45acf8,_0x22e142){var _0x7eecce={},_0xefce4f={},_0x1b07e8={'count':0x0,'rows':[]};var _0x266b91=_[_0xd0d4('0x2b')](db['Cdr'][_0xd0d4('0x2c')],function(_0x7aa87e){return{'name':_0x7aa87e[_0xd0d4('0x2d')],'type':_0x7aa87e[_0xd0d4('0x2e')][_0xd0d4('0x2f')]};});_0xefce4f[_0xd0d4('0x30')]=_['map'](_0x266b91,'name');_0xefce4f[_0xd0d4('0x31')]=_['keys'](_0x45acf8[_0xd0d4('0x31')]);_0xefce4f[_0xd0d4('0x32')]=_[_0xd0d4('0x33')](_0xefce4f[_0xd0d4('0x30')],_0xefce4f[_0xd0d4('0x31')]);_0x7eecce[_0xd0d4('0x34')]=_[_0xd0d4('0x33')](_0xefce4f['model'],qs['fields'](_0x45acf8[_0xd0d4('0x31')][_0xd0d4('0x35')]));_0x7eecce['attributes']=_0x7eecce[_0xd0d4('0x34')]['length']?_0x7eecce['attributes']:_0xefce4f[_0xd0d4('0x30')];if(!_0x45acf8[_0xd0d4('0x31')][_0xd0d4('0x36')](_0xd0d4('0x37'))){_0x7eecce['limit']=qs['limit'](_0x45acf8[_0xd0d4('0x31')][_0xd0d4('0x1c')]);_0x7eecce[_0xd0d4('0x1f')]=qs['offset'](_0x45acf8[_0xd0d4('0x31')][_0xd0d4('0x1f')]);}_0x7eecce[_0xd0d4('0x38')]=qs[_0xd0d4('0x39')](_0x45acf8[_0xd0d4('0x31')][_0xd0d4('0x39')]);_0x7eecce[_0xd0d4('0x3a')]=qs[_0xd0d4('0x32')](_['pick'](_0x45acf8[_0xd0d4('0x31')],_0xefce4f['filters']),_0x266b91);if(_0x45acf8['query'][_0xd0d4('0x3b')]){_0x7eecce['where']=_[_0xd0d4('0x3c')](_0x7eecce[_0xd0d4('0x3a')],{'$or':_[_0xd0d4('0x2b')](_0x266b91,function(_0x1d6329){if(_0x1d6329[_0xd0d4('0x2e')]!==_0xd0d4('0x3d')){var _0x560e77={};_0x560e77[_0x1d6329[_0xd0d4('0x28')]]={'$like':'%'+_0x45acf8[_0xd0d4('0x31')]['filter']+'%'};return _0x560e77;}})});}_0x7eecce=_['merge']({},_0x7eecce,_0x45acf8[_0xd0d4('0x3e')]);var _0x3e6527={'where':_0x7eecce[_0xd0d4('0x3a')]};return db['Cdr'][_0xd0d4('0x1e')](_0x3e6527)[_0xd0d4('0x25')](function(_0x230101){_0x1b07e8[_0xd0d4('0x1e')]=_0x230101;if(_0x45acf8[_0xd0d4('0x31')][_0xd0d4('0x3f')]){_0x7eecce[_0xd0d4('0x40')]=[{'all':!![]}];}return db[_0xd0d4('0x41')]['findAll'](_0x7eecce);})[_0xd0d4('0x25')](function(_0x4174e8){_0x1b07e8[_0xd0d4('0x42')]=_0x4174e8;return _0x1b07e8;})['then'](respondWithFilteredResult(_0x22e142,_0x7eecce))[_0xd0d4('0x43')](handleError(_0x22e142,null));};exports[_0xd0d4('0x44')]=function(_0x5db657,_0x11b77e){var _0x32d1c1={'raw':!![],'where':{'id':_0x5db657[_0xd0d4('0x45')]['id']}},_0x429b84={};_0x429b84[_0xd0d4('0x30')]=_[_0xd0d4('0x46')](db['Cdr'][_0xd0d4('0x2c')]);_0x429b84[_0xd0d4('0x31')]=_[_0xd0d4('0x46')](_0x5db657[_0xd0d4('0x31')]);_0x429b84['filters']=_[_0xd0d4('0x33')](_0x429b84[_0xd0d4('0x30')],_0x429b84[_0xd0d4('0x31')]);_0x32d1c1[_0xd0d4('0x34')]=_[_0xd0d4('0x33')](_0x429b84[_0xd0d4('0x30')],qs[_0xd0d4('0x35')](_0x5db657['query'][_0xd0d4('0x35')]));_0x32d1c1[_0xd0d4('0x34')]=_0x32d1c1['attributes'][_0xd0d4('0x47')]?_0x32d1c1[_0xd0d4('0x34')]:_0x429b84[_0xd0d4('0x30')];if(_0x5db657[_0xd0d4('0x31')][_0xd0d4('0x3f')]){_0x32d1c1[_0xd0d4('0x40')]=[{'all':!![]}];}_0x32d1c1=_['merge']({},_0x32d1c1,_0x5db657[_0xd0d4('0x3e')]);return db['Cdr'][_0xd0d4('0x48')](_0x32d1c1)[_0xd0d4('0x25')](handleEntityNotFound(_0x11b77e,null))['then'](respondWithResult(_0x11b77e,null))[_0xd0d4('0x43')](handleError(_0x11b77e,null));};exports['create']=function(_0x5d61d5,_0x1dad8b){return db['Cdr'][_0xd0d4('0x49')](_0x5d61d5[_0xd0d4('0x4a')],{})['then'](respondWithResult(_0x1dad8b,0xc9))[_0xd0d4('0x43')](handleError(_0x1dad8b,null));};exports['update']=function(_0xdf2562,_0x258cd1){if(_0xdf2562[_0xd0d4('0x4a')]['id']){delete _0xdf2562[_0xd0d4('0x4a')]['id'];}return db[_0xd0d4('0x41')][_0xd0d4('0x48')]({'where':{'id':_0xdf2562[_0xd0d4('0x45')]['id']}})[_0xd0d4('0x25')](handleEntityNotFound(_0x258cd1,null))[_0xd0d4('0x25')](saveUpdates(_0xdf2562['body'],null))['then'](respondWithResult(_0x258cd1,null))[_0xd0d4('0x43')](handleError(_0x258cd1,null));};exports[_0xd0d4('0x4b')]=function(_0x333a5b,_0x6af64e){return db[_0xd0d4('0x41')][_0xd0d4('0x48')]({'where':{'id':_0x333a5b[_0xd0d4('0x45')]['id']}})[_0xd0d4('0x25')](handleEntityNotFound(_0x6af64e,null))[_0xd0d4('0x25')](removeEntity(_0x6af64e,null))['catch'](handleError(_0x6af64e,null));};exports[_0xd0d4('0x4c')]=function(_0x5b23bb,_0x4b97e1){return db[_0xd0d4('0x41')]['describe']()[_0xd0d4('0x25')](respondWithResult(_0x4b97e1,null))[_0xd0d4('0x43')](handleError(_0x4b97e1,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','Cdr','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x1d7d68,_0x4a407d){var _0x456c44=function(_0x348a5a){while(--_0x348a5a){_0x1d7d68['push'](_0x1d7d68['shift']());}};_0x456c44(++_0x4a407d);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['Cdr']['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['Cdr'][_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['Cdr'][_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/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 08ff287..6381708 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x27d10b,_0x30617f){var _0x47b9b2=function(_0x5c9fb4){while(--_0x5c9fb4){_0x27d10b['push'](_0x27d10b['shift']());}};_0x47b9b2(++_0x30617f);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x455a39,_0x1634ca){var _0x2938d1=function(_0x30a823){while(--_0x30a823){_0x455a39['push'](_0x455a39['shift']());}};_0x2938d1(++_0x1634ca);}(_0x7a54,0x106));var _0x47a5=function(_0x13635f,_0x2bc3eb){_0x13635f=_0x13635f-0x0;var _0x4c59d6=_0x7a54[_0x13635f];return _0x4c59d6;};'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 7bef8eb..ee92607 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 _0x1ceb=['debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x1ceb,0x1e9));var _0xb1ce=function(_0x3d993b,_0x372bd6){_0x3d993b=_0x3d993b-0x0;var _0x308571=_0x1ceb[_0x3d993b];return _0x308571;};'use strict';var _=require(_0xb1ce('0x0'));var util=require(_0xb1ce('0x1'));var moment=require(_0xb1ce('0x2'));var BPromise=require(_0xb1ce('0x3'));var rs=require(_0xb1ce('0x4'));var fs=require('fs');var Redis=require(_0xb1ce('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb1ce('0x6'));var logger=require(_0xb1ce('0x7'))('rpc');var config=require(_0xb1ce('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb1ce('0x9')][_0xb1ce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49eaf4,_0xdd7c32,_0x285589){return new BPromise(function(_0x390f63,_0x3ee426){return client[_0xb1ce('0xb')](_0x49eaf4,_0x285589)['then'](function(_0x328c77){logger[_0xb1ce('0xc')](_0xb1ce('0xd'),_0xdd7c32,_0xb1ce('0xe'));logger[_0xb1ce('0xf')](_0xb1ce('0x10'),_0xdd7c32,_0xb1ce('0xe'),JSON['stringify'](_0x328c77));if(_0x328c77['error']){if(_0x328c77[_0xb1ce('0x11')][_0xb1ce('0x12')]===0x1f4){logger[_0xb1ce('0x11')](_0xb1ce('0xd'),_0xdd7c32,_0x328c77[_0xb1ce('0x11')][_0xb1ce('0x13')]);return _0x3ee426(_0x328c77[_0xb1ce('0x11')]['message']);}logger['error'](_0xb1ce('0xd'),_0xdd7c32,_0x328c77[_0xb1ce('0x11')]['message']);return _0x390f63(_0x328c77[_0xb1ce('0x11')][_0xb1ce('0x13')]);}else{logger[_0xb1ce('0xc')](_0xb1ce('0xd'),_0xdd7c32,_0xb1ce('0xe'));_0x390f63(_0x328c77[_0xb1ce('0x14')][_0xb1ce('0x13')]);}})['catch'](function(_0x506afa){logger[_0xb1ce('0x11')](_0xb1ce('0xd'),_0xdd7c32,_0x506afa);_0x3ee426(_0x506afa);});});} \ No newline at end of file +var _0x965b=['rpc','../../config/environment','jayson/promise','client','http','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x438e9f,_0x23ced8){var _0x4a3d3e=function(_0x3dae95){while(--_0x3dae95){_0x438e9f['push'](_0x438e9f['shift']());}};_0x4a3d3e(++_0x23ced8);}(_0x965b,0x19c));var _0xb965=function(_0x53e086,_0x46e0fd){_0x53e086=_0x53e086-0x0;var _0x472905=_0x965b[_0x53e086];return _0x472905;};'use strict';var _=require(_0xb965('0x0'));var util=require('util');var moment=require(_0xb965('0x1'));var BPromise=require(_0xb965('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb965('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb965('0x4'));var logger=require(_0xb965('0x5'))(_0xb965('0x6'));var config=require(_0xb965('0x7'));var jayson=require(_0xb965('0x8'));var client=jayson[_0xb965('0x9')][_0xb965('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39c7f5,_0x7bb5ce,_0x46eaff){return new BPromise(function(_0x160b03,_0x14a276){return client['request'](_0x39c7f5,_0x46eaff)['then'](function(_0x334662){logger['info'](_0xb965('0xb'),_0x7bb5ce,'request\x20sent');logger[_0xb965('0xc')](_0xb965('0xd'),_0x7bb5ce,_0xb965('0xe'),JSON[_0xb965('0xf')](_0x334662));if(_0x334662['error']){if(_0x334662['error'][_0xb965('0x10')]===0x1f4){logger[_0xb965('0x11')](_0xb965('0xb'),_0x7bb5ce,_0x334662['error'][_0xb965('0x12')]);return _0x14a276(_0x334662[_0xb965('0x11')][_0xb965('0x12')]);}logger[_0xb965('0x11')](_0xb965('0xb'),_0x7bb5ce,_0x334662[_0xb965('0x11')][_0xb965('0x12')]);return _0x160b03(_0x334662[_0xb965('0x11')][_0xb965('0x12')]);}else{logger[_0xb965('0x13')](_0xb965('0xb'),_0x7bb5ce,'request\x20sent');_0x160b03(_0x334662[_0xb965('0x14')][_0xb965('0x12')]);}})[_0xb965('0x15')](function(_0x2107e4){logger[_0xb965('0x11')](_0xb965('0xb'),_0x7bb5ce,_0x2107e4);_0x14a276(_0x2107e4);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index f7c978d..5a2e1d3 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3ca2af,_0x1bd36a){var _0xbaccc4=function(_0x5232b3){while(--_0x5232b3){_0x3ca2af['push'](_0x3ca2af['shift']());}};_0xbaccc4(++_0x1bd36a);}(_0xb10b,0x12a));var _0xbb10=function(_0xe22ceb,_0x27dc83){_0xe22ceb=_0xe22ceb-0x0;var _0x45bb58=_0xb10b[_0xe22ceb];return _0x45bb58;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _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(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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 diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 91eaa9e..4467be6 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 _0xd649=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0xed5f9c,_0x5a25cd){var _0x3a1c43=function(_0x251202){while(--_0x251202){_0xed5f9c['push'](_0xed5f9c['shift']());}};_0x3a1c43(++_0x5a25cd);}(_0xd649,0x1a0));var _0x9d64=function(_0x5b2b86,_0x597991){_0x5b2b86=_0x5b2b86-0x0;var _0x5abebf=_0xd649[_0x5b2b86];return _0x5abebf;};'use strict';var Sequelize=require(_0x9d64('0x0'));module[_0x9d64('0x1')]={'priority':{'type':Sequelize[_0x9d64('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9d64('0x3')],'allowNull':![],'defaultValue':_0x9d64('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9d64('0x3')]},'interval':{'type':Sequelize[_0x9d64('0x3')],'defaultValue':_0x9d64('0x5')}}; \ No newline at end of file +var _0x41ce=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x50f6a9,_0x1a4d60){var _0x492707=function(_0x47f609){while(--_0x47f609){_0x50f6a9['push'](_0x50f6a9['shift']());}};_0x492707(++_0x1a4d60);}(_0x41ce,0x1db));var _0xe41c=function(_0x5b58dc,_0x3b444c){_0x5b58dc=_0x5b58dc-0x0;var _0x2c6532=_0x41ce[_0x5b58dc];return _0x2c6532;};'use strict';var Sequelize=require(_0xe41c('0x0'));module[_0xe41c('0x1')]={'priority':{'type':Sequelize[_0xe41c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe41c('0x3')],'allowNull':![],'defaultValue':_0xe41c('0x4')},'appdata':{'type':Sequelize[_0xe41c('0x5')]()},'description':{'type':Sequelize[_0xe41c('0x3')]},'interval':{'type':Sequelize[_0xe41c('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index d3c30b3..e9af6f9 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 _0x570f=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','params','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','length','includeAll','include','merge','options','body','find','catch','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x570f,0x152));var _0xf570=function(_0x112fcf,_0x32d733){_0x112fcf=_0x112fcf-0x0;var _0x439cdc=_0x570f[_0x112fcf];return _0x439cdc;};'use strict';var emlformat=require(_0xf570('0x0'));var rimraf=require(_0xf570('0x1'));var zipdir=require(_0xf570('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf570('0x3'));var BPromise=require(_0xf570('0x4'));var Mustache=require(_0xf570('0x5'));var util=require(_0xf570('0x6'));var path=require(_0xf570('0x7'));var sox=require(_0xf570('0x8'));var csv=require(_0xf570('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf570('0xa'));var _=require('lodash');var squel=require(_0xf570('0xb'));var crypto=require('crypto');var jsforce=require(_0xf570('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf570('0x9'));var querystring=require('querystring');var Papa=require(_0xf570('0xd'));var Redis=require(_0xf570('0xe'));var authService=require(_0xf570('0xf'));var qs=require(_0xf570('0x10'));var as=require(_0xf570('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf570('0x12'))(_0xf570('0x13'));var utils=require(_0xf570('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf570('0x15'));var db=require(_0xf570('0x16'))['db'];function respondWithStatusCode(_0x40559e,_0x51cb42){_0x51cb42=_0x51cb42||0xcc;return function(_0x32e0b0){if(_0x32e0b0){return _0x40559e[_0xf570('0x17')](_0x51cb42);}return _0x40559e[_0xf570('0x18')](_0x51cb42)[_0xf570('0x19')]();};}function respondWithResult(_0x4c6917,_0x9a5e4f){_0x9a5e4f=_0x9a5e4f||0xc8;return function(_0x2e0329){if(_0x2e0329){return _0x4c6917[_0xf570('0x18')](_0x9a5e4f)[_0xf570('0x1a')](_0x2e0329);}};}function respondWithFilteredResult(_0xf2d7f0,_0xf3423e){return function(_0x2531f9){if(_0x2531f9){var _0x1065a9=typeof _0xf3423e[_0xf570('0x1b')]===_0xf570('0x1c')&&typeof _0xf3423e[_0xf570('0x1d')]==='undefined';var _0x110d00=_0x2531f9[_0xf570('0x1e')];var _0x23aa99=_0x1065a9?0x0:_0xf3423e[_0xf570('0x1b')];var _0x11b542=_0x1065a9?_0x2531f9['count']:_0xf3423e[_0xf570('0x1b')]+_0xf3423e[_0xf570('0x1d')];var _0x29c3f4;if(_0x11b542>=_0x110d00){_0x11b542=_0x110d00;_0x29c3f4=0xc8;}else{_0x29c3f4=0xce;}_0xf2d7f0['status'](_0x29c3f4);return _0xf2d7f0[_0xf570('0x1f')](_0xf570('0x20'),_0x23aa99+'-'+_0x11b542+'/'+_0x110d00)[_0xf570('0x1a')](_0x2531f9);}return null;};}function patchUpdates(_0x1a3e91){return function(_0x576a2f){try{jsonpatch[_0xf570('0x21')](_0x576a2f,_0x1a3e91,!![]);}catch(_0xd2058e){return BPromise[_0xf570('0x22')](_0xd2058e);}return _0x576a2f[_0xf570('0x23')]();};}function saveUpdates(_0x2488bd,_0x570703){return function(_0xe71f1){if(_0xe71f1){return _0xe71f1[_0xf570('0x24')](_0x2488bd)[_0xf570('0x25')](function(_0x1151d1){return _0x1151d1;});}return null;};}function removeEntity(_0x4844e5,_0x46bd4a){return function(_0x40c4f1){if(_0x40c4f1){return _0x40c4f1[_0xf570('0x26')]()[_0xf570('0x25')](function(){_0x4844e5[_0xf570('0x18')](0xcc)[_0xf570('0x19')]();});}};}function handleEntityNotFound(_0x5a3ab7,_0x39d487){return function(_0x23c6f0){if(!_0x23c6f0){_0x5a3ab7[_0xf570('0x17')](0x194);}return _0x23c6f0;};}function handleError(_0x1e42ce,_0xe4b67f){_0xe4b67f=_0xe4b67f||0x1f4;return function(_0x268be7){logger[_0xf570('0x27')](_0x268be7[_0xf570('0x28')]);if(_0x268be7[_0xf570('0x29')]){delete _0x268be7[_0xf570('0x29')];}_0x1e42ce[_0xf570('0x18')](_0xe4b67f)[_0xf570('0x2a')](_0x268be7);};}exports['show']=function(_0x54eff1,_0x2eece8){var _0x29ee27={'raw':!![],'where':{'id':_0x54eff1[_0xf570('0x2b')]['id']}},_0x18680a={};_0x18680a[_0xf570('0x2c')]=_[_0xf570('0x2d')](db[_0xf570('0x2e')][_0xf570('0x2f')]);_0x18680a[_0xf570('0x30')]=_['keys'](_0x54eff1[_0xf570('0x30')]);_0x18680a['filters']=_[_0xf570('0x31')](_0x18680a[_0xf570('0x2c')],_0x18680a[_0xf570('0x30')]);_0x29ee27['attributes']=_[_0xf570('0x31')](_0x18680a[_0xf570('0x2c')],qs['fields'](_0x54eff1[_0xf570('0x30')]['fields']));_0x29ee27[_0xf570('0x32')]=_0x29ee27[_0xf570('0x32')][_0xf570('0x33')]?_0x29ee27[_0xf570('0x32')]:_0x18680a['model'];if(_0x54eff1['query'][_0xf570('0x34')]){_0x29ee27[_0xf570('0x35')]=[{'all':!![]}];}_0x29ee27=_[_0xf570('0x36')]({},_0x29ee27,_0x54eff1[_0xf570('0x37')]);return db[_0xf570('0x2e')]['find'](_0x29ee27)[_0xf570('0x25')](handleEntityNotFound(_0x2eece8,null))['then'](respondWithResult(_0x2eece8,null))['catch'](handleError(_0x2eece8,null));};exports['update']=function(_0x4d1d3a,_0x5626ae){if(_0x4d1d3a[_0xf570('0x38')]['id']){delete _0x4d1d3a[_0xf570('0x38')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x4d1d3a[_0xf570('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5626ae,null))['then'](saveUpdates(_0x4d1d3a[_0xf570('0x38')],null))['then'](respondWithResult(_0x5626ae,null))['catch'](handleError(_0x5626ae,null));};exports['destroy']=function(_0x2862cf,_0x4120e9){return db[_0xf570('0x2e')][_0xf570('0x39')]({'where':{'id':_0x2862cf[_0xf570('0x2b')]['id']}})[_0xf570('0x25')](handleEntityNotFound(_0x4120e9,null))[_0xf570('0x25')](removeEntity(_0x4120e9,null))[_0xf570('0x3a')](handleError(_0x4120e9,null));}; \ No newline at end of file +var _0x2c1b=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','apply','reject','update','then','destroy','error','stack','name','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','include','merge','options','find','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x357809,_0x4066dc){var _0x2bdfe3=function(_0x3933c8){while(--_0x3933c8){_0x357809['push'](_0x357809['shift']());}};_0x2bdfe3(++_0x4066dc);}(_0x2c1b,0xb0));var _0xb2c1=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x2c1b[_0xda464c];return _0x19e222;};'use strict';var emlformat=require(_0xb2c1('0x0'));var rimraf=require(_0xb2c1('0x1'));var zipdir=require(_0xb2c1('0x2'));var jsonpatch=require(_0xb2c1('0x3'));var rp=require(_0xb2c1('0x4'));var moment=require(_0xb2c1('0x5'));var BPromise=require(_0xb2c1('0x6'));var Mustache=require('mustache');var util=require(_0xb2c1('0x7'));var path=require(_0xb2c1('0x8'));var sox=require(_0xb2c1('0x9'));var csv=require(_0xb2c1('0xa'));var ejs=require(_0xb2c1('0xb'));var fs=require('fs');var fs_extra=require(_0xb2c1('0xc'));var _=require(_0xb2c1('0xd'));var squel=require(_0xb2c1('0xe'));var crypto=require(_0xb2c1('0xf'));var jsforce=require(_0xb2c1('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb2c1('0x11'));var Papa=require(_0xb2c1('0x12'));var Redis=require(_0xb2c1('0x13'));var authService=require(_0xb2c1('0x14'));var qs=require(_0xb2c1('0x15'));var as=require(_0xb2c1('0x16'));var hardwareService=require(_0xb2c1('0x17'));var logger=require(_0xb2c1('0x18'))('api');var utils=require(_0xb2c1('0x19'));var config=require(_0xb2c1('0x1a'));var licenseUtil=require(_0xb2c1('0x1b'));var db=require(_0xb2c1('0x1c'))['db'];function respondWithStatusCode(_0x218998,_0x4cc09b){_0x4cc09b=_0x4cc09b||0xcc;return function(_0x404159){if(_0x404159){return _0x218998[_0xb2c1('0x1d')](_0x4cc09b);}return _0x218998[_0xb2c1('0x1e')](_0x4cc09b)['end']();};}function respondWithResult(_0x3c4313,_0x4470e5){_0x4470e5=_0x4470e5||0xc8;return function(_0x22a2b3){if(_0x22a2b3){return _0x3c4313[_0xb2c1('0x1e')](_0x4470e5)[_0xb2c1('0x1f')](_0x22a2b3);}};}function respondWithFilteredResult(_0x47571f,_0x2b4d8f){return function(_0x46d620){if(_0x46d620){var _0x1e26f3=typeof _0x2b4d8f['offset']===_0xb2c1('0x20')&&typeof _0x2b4d8f['limit']==='undefined';var _0x59268e=_0x46d620['count'];var _0x486411=_0x1e26f3?0x0:_0x2b4d8f[_0xb2c1('0x21')];var _0x16c1ed=_0x1e26f3?_0x46d620[_0xb2c1('0x22')]:_0x2b4d8f[_0xb2c1('0x21')]+_0x2b4d8f[_0xb2c1('0x23')];var _0x165875;if(_0x16c1ed>=_0x59268e){_0x16c1ed=_0x59268e;_0x165875=0xc8;}else{_0x165875=0xce;}_0x47571f[_0xb2c1('0x1e')](_0x165875);return _0x47571f[_0xb2c1('0x24')]('Content-Range',_0x486411+'-'+_0x16c1ed+'/'+_0x59268e)[_0xb2c1('0x1f')](_0x46d620);}return null;};}function patchUpdates(_0x42f519){return function(_0x2af0fa){try{jsonpatch[_0xb2c1('0x25')](_0x2af0fa,_0x42f519,!![]);}catch(_0x49d87c){return BPromise[_0xb2c1('0x26')](_0x49d87c);}return _0x2af0fa['save']();};}function saveUpdates(_0x27d5bf,_0x31ae39){return function(_0x2f6c51){if(_0x2f6c51){return _0x2f6c51[_0xb2c1('0x27')](_0x27d5bf)[_0xb2c1('0x28')](function(_0x270fb2){return _0x270fb2;});}return null;};}function removeEntity(_0x4af0bd,_0xc3f671){return function(_0x40dac3){if(_0x40dac3){return _0x40dac3[_0xb2c1('0x29')]()[_0xb2c1('0x28')](function(){_0x4af0bd[_0xb2c1('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48f58c,_0x1e8853){return function(_0x4b69e6){if(!_0x4b69e6){_0x48f58c[_0xb2c1('0x1d')](0x194);}return _0x4b69e6;};}function handleError(_0x4b3ff3,_0x3c85c3){_0x3c85c3=_0x3c85c3||0x1f4;return function(_0xe4bcba){logger[_0xb2c1('0x2a')](_0xe4bcba[_0xb2c1('0x2b')]);if(_0xe4bcba[_0xb2c1('0x2c')]){delete _0xe4bcba[_0xb2c1('0x2c')];}_0x4b3ff3[_0xb2c1('0x1e')](_0x3c85c3)['send'](_0xe4bcba);};}exports['show']=function(_0x2d9a64,_0x56f382){var _0x2ca910={'raw':!![],'where':{'id':_0x2d9a64['params']['id']}},_0x39c7cc={};_0x39c7cc[_0xb2c1('0x2d')]=_[_0xb2c1('0x2e')](db[_0xb2c1('0x2f')][_0xb2c1('0x30')]);_0x39c7cc[_0xb2c1('0x31')]=_[_0xb2c1('0x2e')](_0x2d9a64['query']);_0x39c7cc[_0xb2c1('0x32')]=_[_0xb2c1('0x33')](_0x39c7cc[_0xb2c1('0x2d')],_0x39c7cc[_0xb2c1('0x31')]);_0x2ca910[_0xb2c1('0x34')]=_[_0xb2c1('0x33')](_0x39c7cc[_0xb2c1('0x2d')],qs[_0xb2c1('0x35')](_0x2d9a64[_0xb2c1('0x31')][_0xb2c1('0x35')]));_0x2ca910[_0xb2c1('0x34')]=_0x2ca910[_0xb2c1('0x34')]['length']?_0x2ca910[_0xb2c1('0x34')]:_0x39c7cc[_0xb2c1('0x2d')];if(_0x2d9a64[_0xb2c1('0x31')]['includeAll']){_0x2ca910[_0xb2c1('0x36')]=[{'all':!![]}];}_0x2ca910=_[_0xb2c1('0x37')]({},_0x2ca910,_0x2d9a64[_0xb2c1('0x38')]);return db['ChatApplication'][_0xb2c1('0x39')](_0x2ca910)[_0xb2c1('0x28')](handleEntityNotFound(_0x56f382,null))[_0xb2c1('0x28')](respondWithResult(_0x56f382,null))[_0xb2c1('0x3a')](handleError(_0x56f382,null));};exports[_0xb2c1('0x27')]=function(_0x5b3a19,_0x5e6759){if(_0x5b3a19[_0xb2c1('0x3b')]['id']){delete _0x5b3a19['body']['id'];}return db[_0xb2c1('0x2f')][_0xb2c1('0x39')]({'where':{'id':_0x5b3a19['params']['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x5e6759,null))[_0xb2c1('0x28')](saveUpdates(_0x5b3a19[_0xb2c1('0x3b')],null))[_0xb2c1('0x28')](respondWithResult(_0x5e6759,null))['catch'](handleError(_0x5e6759,null));};exports[_0xb2c1('0x29')]=function(_0x367c76,_0x42e6a0){return db[_0xb2c1('0x2f')]['find']({'where':{'id':_0x367c76[_0xb2c1('0x3c')]['id']}})[_0xb2c1('0x28')](handleEntityNotFound(_0x42e6a0,null))[_0xb2c1('0x28')](removeEntity(_0x42e6a0,null))[_0xb2c1('0x3a')](handleError(_0x42e6a0,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 70f8fd8..74d4015 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 _0xf587=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf587,0x1d1));var _0x7f58=function(_0x1138c4,_0x841d33){_0x1138c4=_0x1138c4-0x0;var _0x200cc1=_0xf587[_0x1138c4];return _0x200cc1;};'use strict';var _=require(_0x7f58('0x0'));var util=require('util');var logger=require(_0x7f58('0x1'))(_0x7f58('0x2'));var moment=require(_0x7f58('0x3'));var BPromise=require(_0x7f58('0x4'));var rp=require(_0x7f58('0x5'));var fs=require('fs');var path=require(_0x7f58('0x6'));var rimraf=require(_0x7f58('0x7'));var config=require(_0x7f58('0x8'));var attributes=require(_0x7f58('0x9'));module[_0x7f58('0xa')]=function(_0x5b59db,_0x25cf0d){return _0x5b59db[_0x7f58('0xb')](_0x7f58('0xc'),attributes,{'tableName':_0x7f58('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7f58('0xe'),'collate':_0x7f58('0xf')});}; \ No newline at end of file +var _0x6367=['utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','../../config/environment','./chatApplication.attributes','exports','define','utf8mb4'];(function(_0xa1bce0,_0x5a7ef8){var _0x29389f=function(_0x508bd0){while(--_0x508bd0){_0xa1bce0['push'](_0xa1bce0['shift']());}};_0x29389f(++_0x5a7ef8);}(_0x6367,0x1d5));var _0x7636=function(_0x43d701,_0x4bb2e9){_0x43d701=_0x43d701-0x0;var _0x2ec4c6=_0x6367[_0x43d701];return _0x2ec4c6;};'use strict';var _=require('lodash');var util=require(_0x7636('0x0'));var logger=require('../../config/logger')(_0x7636('0x1'));var moment=require(_0x7636('0x2'));var BPromise=require(_0x7636('0x3'));var rp=require(_0x7636('0x4'));var fs=require('fs');var path=require(_0x7636('0x5'));var rimraf=require('rimraf');var config=require(_0x7636('0x6'));var attributes=require(_0x7636('0x7'));module[_0x7636('0x8')]=function(_0x1dee30,_0x5297d0){return _0x1dee30[_0x7636('0x9')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7636('0xa'),'collate':_0x7636('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 93dcd02..779e511 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 _0xd942=['code','message','result','catch','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3a634e,_0x273db2){var _0x2ecddb=function(_0x3a9d2d){while(--_0x3a9d2d){_0x3a634e['push'](_0x3a634e['shift']());}};_0x2ecddb(++_0x273db2);}(_0xd942,0x169));var _0x2d94=function(_0x4da2a1,_0x5ed7bf){_0x4da2a1=_0x4da2a1-0x0;var _0x12fc29=_0xd942[_0x4da2a1];return _0x12fc29;};'use strict';var _=require('lodash');var util=require(_0x2d94('0x0'));var moment=require(_0x2d94('0x1'));var BPromise=require('bluebird');var rs=require(_0x2d94('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2d94('0x3'));var logger=require(_0x2d94('0x4'))('rpc');var config=require(_0x2d94('0x5'));var jayson=require(_0x2d94('0x6'));var client=jayson[_0x2d94('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1700a6,_0x580afc,_0x3b25f0){return new BPromise(function(_0x2e6a63,_0x588e70){return client['request'](_0x1700a6,_0x3b25f0)['then'](function(_0x597c35){logger['info'](_0x2d94('0x8'),_0x580afc,_0x2d94('0x9'));logger[_0x2d94('0xa')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x580afc,'request\x20sent',JSON[_0x2d94('0xb')](_0x597c35));if(_0x597c35['error']){if(_0x597c35[_0x2d94('0xc')][_0x2d94('0xd')]===0x1f4){logger[_0x2d94('0xc')](_0x2d94('0x8'),_0x580afc,_0x597c35[_0x2d94('0xc')][_0x2d94('0xe')]);return _0x588e70(_0x597c35[_0x2d94('0xc')][_0x2d94('0xe')]);}logger[_0x2d94('0xc')](_0x2d94('0x8'),_0x580afc,_0x597c35['error'][_0x2d94('0xe')]);return _0x2e6a63(_0x597c35[_0x2d94('0xc')][_0x2d94('0xe')]);}else{logger['info'](_0x2d94('0x8'),_0x580afc,_0x2d94('0x9'));_0x2e6a63(_0x597c35[_0x2d94('0xf')][_0x2d94('0xe')]);}})[_0x2d94('0x10')](function(_0x3cd5bb){logger[_0x2d94('0xc')]('ChatApplication,\x20%s,\x20%s',_0x580afc,_0x3cd5bb);_0x588e70(_0x3cd5bb);});});} \ No newline at end of file +var _0x28a7=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x597fd8,_0x1b29f4){var _0x4d8d6c=function(_0x5ddaf3){while(--_0x5ddaf3){_0x597fd8['push'](_0x597fd8['shift']());}};_0x4d8d6c(++_0x1b29f4);}(_0x28a7,0xdd));var _0x728a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x28a7[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x728a('0x0'));var util=require(_0x728a('0x1'));var moment=require(_0x728a('0x2'));var BPromise=require('bluebird');var rs=require(_0x728a('0x3'));var fs=require('fs');var Redis=require(_0x728a('0x4'));var db=require(_0x728a('0x5'))['db'];var utils=require(_0x728a('0x6'));var logger=require('../../config/logger')(_0x728a('0x7'));var config=require(_0x728a('0x8'));var jayson=require(_0x728a('0x9'));var client=jayson['client'][_0x728a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x281216,_0x566121,_0x558789){return new BPromise(function(_0x501fae,_0x287f3a){return client[_0x728a('0xb')](_0x281216,_0x558789)[_0x728a('0xc')](function(_0x3b4e19){logger[_0x728a('0xd')](_0x728a('0xe'),_0x566121,_0x728a('0xf'));logger['debug'](_0x728a('0x10'),_0x566121,_0x728a('0xf'),JSON[_0x728a('0x11')](_0x3b4e19));if(_0x3b4e19['error']){if(_0x3b4e19[_0x728a('0x12')]['code']===0x1f4){logger[_0x728a('0x12')](_0x728a('0xe'),_0x566121,_0x3b4e19[_0x728a('0x12')][_0x728a('0x13')]);return _0x287f3a(_0x3b4e19[_0x728a('0x12')][_0x728a('0x13')]);}logger[_0x728a('0x12')](_0x728a('0xe'),_0x566121,_0x3b4e19[_0x728a('0x12')][_0x728a('0x13')]);return _0x501fae(_0x3b4e19[_0x728a('0x12')][_0x728a('0x13')]);}else{logger['info'](_0x728a('0xe'),_0x566121,_0x728a('0xf'));_0x501fae(_0x3b4e19[_0x728a('0x14')][_0x728a('0x13')]);}})[_0x728a('0x15')](function(_0x3c5109){logger[_0x728a('0x12')](_0x728a('0xe'),_0x566121,_0x3c5109);_0x287f3a(_0x3c5109);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index e67ab5b..7b5972f 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 _0xa4e5=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xa4e5,0x69));var _0x5a4e=function(_0x1cb950,_0x2e8909){_0x1cb950=_0x1cb950-0x0;var _0x8baeaf=_0xa4e5[_0x1cb950];return _0x8baeaf;};'use strict';var multer=require(_0x5a4e('0x0'));var util=require(_0x5a4e('0x1'));var path=require(_0x5a4e('0x2'));var timeout=require(_0x5a4e('0x3'));var express=require(_0x5a4e('0x4'));var router=express['Router']();var fs_extra=require(_0x5a4e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5a4e('0x6'));var config=require('../../config/environment');var controller=require(_0x5a4e('0x7'));router[_0x5a4e('0x8')](_0x5a4e('0x9'),auth[_0x5a4e('0xa')](),controller[_0x5a4e('0xb')]);router[_0x5a4e('0xc')]('/:id',auth[_0x5a4e('0xa')](),controller[_0x5a4e('0xd')]);router[_0x5a4e('0xe')](_0x5a4e('0x9'),auth[_0x5a4e('0xa')](),controller[_0x5a4e('0xf')]);module[_0x5a4e('0x10')]=router; \ No newline at end of file +var _0x525c=['get','/:id','put','isAuthenticated','update','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller'];(function(_0x331a50,_0x43baea){var _0x36fb76=function(_0x19fed8){while(--_0x19fed8){_0x331a50['push'](_0x331a50['shift']());}};_0x36fb76(++_0x43baea);}(_0x525c,0x77));var _0xc525=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x525c[_0x4b2863];return _0x567d67;};'use strict';var multer=require(_0xc525('0x0'));var util=require('util');var path=require(_0xc525('0x1'));var timeout=require(_0xc525('0x2'));var express=require('express');var router=express[_0xc525('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc525('0x4'));var interaction=require(_0xc525('0x5'));var config=require('../../config/environment');var controller=require(_0xc525('0x6'));router[_0xc525('0x7')](_0xc525('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xc525('0x9')](_0xc525('0x8'),auth[_0xc525('0xa')](),controller[_0xc525('0xb')]);router[_0xc525('0xc')](_0xc525('0x8'),auth[_0xc525('0xa')](),controller['destroy']);module[_0xc525('0xd')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 0f85463..5a02317 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 _0x672a=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x672a,0x122));var _0xa672=function(_0x5943d3,_0x41e5fe){_0x5943d3=_0x5943d3-0x0;var _0x2e8469=_0x672a[_0x5943d3];return _0x2e8469;};'use strict';var Sequelize=require(_0xa672('0x0'));module[_0xa672('0x1')]={'name':{'type':Sequelize[_0xa672('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa672('0x2')]},'write':{'type':Sequelize[_0xa672('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x46e4=['STRING','BOOLEAN','sequelize'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x46e4,0xdd));var _0x446e=function(_0x279702,_0x12e9b5){_0x279702=_0x279702-0x0;var _0x34f62e=_0x46e4[_0x279702];return _0x34f62e;};'use strict';var Sequelize=require(_0x446e('0x0'));module['exports']={'name':{'type':Sequelize[_0x446e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x446e('0x1')]},'write':{'type':Sequelize[_0x446e('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index e09a570..e93eb67 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 _0xab0e=['VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','update','describe','getUnread','ChatInternalMessage','user','omit','ids','findOne','User','pick','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','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','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','end','status','offset','undefined','limit','count','json','apply','reject','save','then','destroy','stack','name','index','ChatGroup','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge'];(function(_0x53b9be,_0x5816dc){var _0x559306=function(_0x28b8f9){while(--_0x28b8f9){_0x53b9be['push'](_0x53b9be['shift']());}};_0x559306(++_0x5816dc);}(_0xab0e,0x137));var _0xeab0=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xab0e[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0xeab0('0x0'));var rimraf=require(_0xeab0('0x1'));var zipdir=require(_0xeab0('0x2'));var jsonpatch=require(_0xeab0('0x3'));var rp=require(_0xeab0('0x4'));var moment=require('moment');var BPromise=require(_0xeab0('0x5'));var Mustache=require('mustache');var util=require(_0xeab0('0x6'));var path=require(_0xeab0('0x7'));var sox=require(_0xeab0('0x8'));var csv=require(_0xeab0('0x9'));var ejs=require(_0xeab0('0xa'));var fs=require('fs');var fs_extra=require(_0xeab0('0xb'));var _=require(_0xeab0('0xc'));var squel=require(_0xeab0('0xd'));var crypto=require(_0xeab0('0xe'));var jsforce=require(_0xeab0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xeab0('0x9'));var querystring=require(_0xeab0('0x10'));var Papa=require(_0xeab0('0x11'));var Redis=require(_0xeab0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xeab0('0x13'));var as=require(_0xeab0('0x14'));var hardwareService=require(_0xeab0('0x15'));var logger=require('../../config/logger')(_0xeab0('0x16'));var utils=require('../../config/utils');var config=require(_0xeab0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xeab0('0x18'))['db'];config[_0xeab0('0x19')]=_[_0xeab0('0x1a')](config[_0xeab0('0x19')],{'host':_0xeab0('0x1b'),'port':0x18eb});var socket=require(_0xeab0('0x1c'))(new Redis(config[_0xeab0('0x19')]));require(_0xeab0('0x1d'))['register'](socket);function respondWithStatusCode(_0x337c01,_0x53465f){_0x53465f=_0x53465f||0xcc;return function(_0x3e95fd){if(_0x3e95fd){return _0x337c01['sendStatus'](_0x53465f);}return _0x337c01['status'](_0x53465f)[_0xeab0('0x1e')]();};}function respondWithResult(_0xf0cd8f,_0x3e2057){_0x3e2057=_0x3e2057||0xc8;return function(_0x400447){if(_0x400447){return _0xf0cd8f[_0xeab0('0x1f')](_0x3e2057)['json'](_0x400447);}};}function respondWithFilteredResult(_0xda3494,_0xc2eb8d){return function(_0x2951ce){if(_0x2951ce){var _0x3538f8=typeof _0xc2eb8d[_0xeab0('0x20')]===_0xeab0('0x21')&&typeof _0xc2eb8d[_0xeab0('0x22')]===_0xeab0('0x21');var _0x569afb=_0x2951ce[_0xeab0('0x23')];var _0x85b0a6=_0x3538f8?0x0:_0xc2eb8d[_0xeab0('0x20')];var _0x4f9a33=_0x3538f8?_0x2951ce['count']:_0xc2eb8d[_0xeab0('0x20')]+_0xc2eb8d[_0xeab0('0x22')];var _0x5d8b51;if(_0x4f9a33>=_0x569afb){_0x4f9a33=_0x569afb;_0x5d8b51=0xc8;}else{_0x5d8b51=0xce;}_0xda3494['status'](_0x5d8b51);return _0xda3494['set']('Content-Range',_0x85b0a6+'-'+_0x4f9a33+'/'+_0x569afb)[_0xeab0('0x24')](_0x2951ce);}return null;};}function patchUpdates(_0x3b5907){return function(_0x48ac71){try{jsonpatch[_0xeab0('0x25')](_0x48ac71,_0x3b5907,!![]);}catch(_0x39af8a){return BPromise[_0xeab0('0x26')](_0x39af8a);}return _0x48ac71[_0xeab0('0x27')]();};}function saveUpdates(_0x4408fa,_0xf0f532){return function(_0x10fc66){if(_0x10fc66){return _0x10fc66['update'](_0x4408fa)[_0xeab0('0x28')](function(_0x1931f4){return _0x1931f4;});}return null;};}function removeEntity(_0x291aba,_0xe65c98){return function(_0x273f9d){if(_0x273f9d){return _0x273f9d[_0xeab0('0x29')]()['then'](function(){_0x291aba[_0xeab0('0x1f')](0xcc)[_0xeab0('0x1e')]();});}};}function handleEntityNotFound(_0x1b411b,_0x5a1d05){return function(_0xe469f5){if(!_0xe469f5){_0x1b411b['sendStatus'](0x194);}return _0xe469f5;};}function handleError(_0x880810,_0x2e5b3a){_0x2e5b3a=_0x2e5b3a||0x1f4;return function(_0x36db47){logger['error'](_0x36db47[_0xeab0('0x2a')]);if(_0x36db47[_0xeab0('0x2b')]){delete _0x36db47[_0xeab0('0x2b')];}_0x880810['status'](_0x2e5b3a)['send'](_0x36db47);};}exports[_0xeab0('0x2c')]=function(_0x28e80c,_0x5604c3){var _0x16c6c8={},_0x22bde7={},_0x25cd31={'count':0x0,'rows':[]};var _0x2f8c5f=_['map'](db[_0xeab0('0x2d')]['rawAttributes'],function(_0x9dabb0){return{'name':_0x9dabb0[_0xeab0('0x2e')],'type':_0x9dabb0[_0xeab0('0x2f')][_0xeab0('0x30')]};});_0x22bde7[_0xeab0('0x31')]=_[_0xeab0('0x32')](_0x2f8c5f,_0xeab0('0x2b'));_0x22bde7[_0xeab0('0x33')]=_[_0xeab0('0x34')](_0x28e80c[_0xeab0('0x33')]);_0x22bde7[_0xeab0('0x35')]=_[_0xeab0('0x36')](_0x22bde7[_0xeab0('0x31')],_0x22bde7[_0xeab0('0x33')]);_0x16c6c8['attributes']=_[_0xeab0('0x36')](_0x22bde7['model'],qs['fields'](_0x28e80c['query'][_0xeab0('0x37')]));_0x16c6c8[_0xeab0('0x38')]=_0x16c6c8[_0xeab0('0x38')][_0xeab0('0x39')]?_0x16c6c8[_0xeab0('0x38')]:_0x22bde7[_0xeab0('0x31')];if(!_0x28e80c[_0xeab0('0x33')][_0xeab0('0x3a')](_0xeab0('0x3b'))){_0x16c6c8[_0xeab0('0x22')]=qs['limit'](_0x28e80c[_0xeab0('0x33')][_0xeab0('0x22')]);_0x16c6c8[_0xeab0('0x20')]=qs[_0xeab0('0x20')](_0x28e80c[_0xeab0('0x33')][_0xeab0('0x20')]);}_0x16c6c8[_0xeab0('0x3c')]=qs[_0xeab0('0x3d')](_0x28e80c[_0xeab0('0x33')][_0xeab0('0x3d')]);_0x16c6c8['where']=qs[_0xeab0('0x35')](_['pick'](_0x28e80c[_0xeab0('0x33')],_0x22bde7['filters']),_0x2f8c5f);if(_0x28e80c[_0xeab0('0x33')][_0xeab0('0x3e')]){_0x16c6c8[_0xeab0('0x3f')]=_[_0xeab0('0x40')](_0x16c6c8['where'],{'$or':_[_0xeab0('0x32')](_0x2f8c5f,function(_0x9349c0){if(_0x9349c0[_0xeab0('0x2f')]!==_0xeab0('0x41')){var _0xc4b507={};_0xc4b507[_0x9349c0[_0xeab0('0x2b')]]={'$like':'%'+_0x28e80c[_0xeab0('0x33')][_0xeab0('0x3e')]+'%'};return _0xc4b507;}})});}_0x16c6c8=_[_0xeab0('0x40')]({},_0x16c6c8,_0x28e80c[_0xeab0('0x42')]);var _0x23c32a={'where':_0x16c6c8[_0xeab0('0x3f')]};return db[_0xeab0('0x2d')]['count'](_0x23c32a)[_0xeab0('0x28')](function(_0x2a7808){_0x25cd31[_0xeab0('0x23')]=_0x2a7808;if(_0x28e80c[_0xeab0('0x33')][_0xeab0('0x43')]){_0x16c6c8[_0xeab0('0x44')]=[{'all':!![]}];}return db[_0xeab0('0x2d')]['findAll'](_0x16c6c8);})[_0xeab0('0x28')](function(_0x342648){_0x25cd31['rows']=_0x342648;return _0x25cd31;})[_0xeab0('0x28')](respondWithFilteredResult(_0x5604c3,_0x16c6c8))[_0xeab0('0x45')](handleError(_0x5604c3,null));};exports[_0xeab0('0x46')]=function(_0x30b4dd,_0x5e8e3c){var _0x314632={'raw':!![],'where':{'id':_0x30b4dd[_0xeab0('0x47')]['id']}},_0x45f721={};_0x45f721['model']=_[_0xeab0('0x34')](db[_0xeab0('0x2d')][_0xeab0('0x48')]);_0x45f721['query']=_[_0xeab0('0x34')](_0x30b4dd['query']);_0x45f721[_0xeab0('0x35')]=_['intersection'](_0x45f721['model'],_0x45f721[_0xeab0('0x33')]);_0x314632['attributes']=_[_0xeab0('0x36')](_0x45f721[_0xeab0('0x31')],qs['fields'](_0x30b4dd[_0xeab0('0x33')][_0xeab0('0x37')]));_0x314632[_0xeab0('0x38')]=_0x314632[_0xeab0('0x38')][_0xeab0('0x39')]?_0x314632[_0xeab0('0x38')]:_0x45f721['model'];if(_0x30b4dd[_0xeab0('0x33')]['includeAll']){_0x314632[_0xeab0('0x44')]=[{'all':!![]}];}_0x314632=_[_0xeab0('0x40')]({},_0x314632,_0x30b4dd[_0xeab0('0x42')]);return db[_0xeab0('0x2d')][_0xeab0('0x49')](_0x314632)[_0xeab0('0x28')](handleEntityNotFound(_0x5e8e3c,null))[_0xeab0('0x28')](respondWithResult(_0x5e8e3c,null))[_0xeab0('0x45')](handleError(_0x5e8e3c,null));};exports[_0xeab0('0x4a')]=function(_0x106ed7,_0x1516d0){return db[_0xeab0('0x2d')][_0xeab0('0x4a')](_0x106ed7[_0xeab0('0x4b')],{})[_0xeab0('0x28')](respondWithResult(_0x1516d0,0xc9))[_0xeab0('0x45')](handleError(_0x1516d0,null));};exports[_0xeab0('0x4c')]=function(_0x395850,_0x164073){if(_0x395850[_0xeab0('0x4b')]['id']){delete _0x395850[_0xeab0('0x4b')]['id'];}return db[_0xeab0('0x2d')][_0xeab0('0x49')]({'where':{'id':_0x395850[_0xeab0('0x47')]['id']}})[_0xeab0('0x28')](handleEntityNotFound(_0x164073,null))[_0xeab0('0x28')](saveUpdates(_0x395850[_0xeab0('0x4b')],null))[_0xeab0('0x28')](respondWithResult(_0x164073,null))['catch'](handleError(_0x164073,null));};exports['destroy']=function(_0x246cfd,_0x49bf2e){return db['ChatGroup'][_0xeab0('0x49')]({'where':{'id':_0x246cfd[_0xeab0('0x47')]['id']}})[_0xeab0('0x28')](handleEntityNotFound(_0x49bf2e,null))[_0xeab0('0x28')](removeEntity(_0x49bf2e,null))[_0xeab0('0x45')](handleError(_0x49bf2e,null));};exports[_0xeab0('0x4d')]=function(_0x4c6d2,_0xc6050a){return db[_0xeab0('0x2d')][_0xeab0('0x4d')]()[_0xeab0('0x28')](respondWithResult(_0xc6050a,null))[_0xeab0('0x45')](handleError(_0xc6050a,null));};exports[_0xeab0('0x4e')]=function(_0x4e9b9e,_0x24752a,_0x541fef){return db[_0xeab0('0x4f')][_0xeab0('0x23')]({'where':{'ChatGroupId':_0x4e9b9e['params']['id'],'ToId':_0x4e9b9e[_0xeab0('0x50')]['id'],'read':![]}})['then'](function(_0x132455){return{'id':_['toInteger'](_0x4e9b9e[_0xeab0('0x47')]['id']),'count':_0x132455};})['then'](respondWithResult(_0x24752a,null))[_0xeab0('0x45')](handleError(_0x24752a,null));};exports['addMembers']=function(_0x23614a,_0x132efa,_0x2b71e5){return db['ChatGroup'][_0xeab0('0x49')]({'where':{'id':_0x23614a[_0xeab0('0x47')]['id']}})['then'](handleEntityNotFound(_0x132efa,null))[_0xeab0('0x28')](function(_0x332c6a){if(_0x332c6a){return _0x332c6a['addMembers'](_0x23614a[_0xeab0('0x4b')]['ids'],_[_0xeab0('0x51')](_0x23614a[_0xeab0('0x4b')],[_0xeab0('0x52'),'id'])||{});}})[_0xeab0('0x28')](respondWithResult(_0x132efa,null))[_0xeab0('0x45')](handleError(_0x132efa,null));};exports['getMembers']=function(_0x35c65e,_0x279765,_0x5407bb){var _0x4836b1={};var _0xcc43a9={};var _0x15e0ef;var _0x76e39e;return db[_0xeab0('0x2d')][_0xeab0('0x53')]({'where':{'id':_0x35c65e[_0xeab0('0x47')]['id']}})[_0xeab0('0x28')](handleEntityNotFound(_0x279765,null))[_0xeab0('0x28')](function(_0x28b1de){if(_0x28b1de){_0x15e0ef=_0x28b1de;_0xcc43a9['model']=_['keys'](db[_0xeab0('0x54')][_0xeab0('0x48')]);_0xcc43a9[_0xeab0('0x33')]=_[_0xeab0('0x34')](_0x35c65e[_0xeab0('0x33')]);_0xcc43a9[_0xeab0('0x35')]=_[_0xeab0('0x36')](_0xcc43a9['model'],_0xcc43a9[_0xeab0('0x33')]);_0x4836b1[_0xeab0('0x38')]=_[_0xeab0('0x36')](_0xcc43a9[_0xeab0('0x31')],qs[_0xeab0('0x37')](_0x35c65e[_0xeab0('0x33')]['fields']));_0x4836b1['attributes']=_0x4836b1[_0xeab0('0x38')][_0xeab0('0x39')]?_0x4836b1[_0xeab0('0x38')]:_0xcc43a9[_0xeab0('0x31')];_0x4836b1[_0xeab0('0x3c')]=qs[_0xeab0('0x3d')](_0x35c65e[_0xeab0('0x33')][_0xeab0('0x3d')]);_0x4836b1[_0xeab0('0x3f')]=qs[_0xeab0('0x35')](_[_0xeab0('0x55')](_0x35c65e[_0xeab0('0x33')],_0xcc43a9[_0xeab0('0x35')]));if(_0x35c65e[_0xeab0('0x33')][_0xeab0('0x3e')]){_0x4836b1[_0xeab0('0x3f')]=_[_0xeab0('0x40')](_0x4836b1['where'],{'$or':_[_0xeab0('0x32')](_0x4836b1[_0xeab0('0x38')],function(_0x2698ab){var _0x328d35={};_0x328d35[_0x2698ab]={'$like':'%'+_0x35c65e[_0xeab0('0x33')][_0xeab0('0x3e')]+'%'};return _0x328d35;})});}_0x4836b1=_[_0xeab0('0x40')]({},_0x4836b1,_0x35c65e[_0xeab0('0x42')]);return _0x15e0ef[_0xeab0('0x56')](_0x4836b1);}})['then'](function(_0x1fe998){if(_0x1fe998){_0x76e39e=_0x1fe998[_0xeab0('0x39')];if(!_0x35c65e[_0xeab0('0x33')][_0xeab0('0x3a')](_0xeab0('0x3b'))){_0x4836b1[_0xeab0('0x22')]=qs[_0xeab0('0x22')](_0x35c65e['query'][_0xeab0('0x22')]);_0x4836b1['offset']=qs[_0xeab0('0x20')](_0x35c65e[_0xeab0('0x33')][_0xeab0('0x20')]);}return _0x15e0ef[_0xeab0('0x56')](_0x4836b1);}})['then'](function(_0x412fcd){if(_0x412fcd){return _0x412fcd?{'count':_0x76e39e,'rows':_0x412fcd}:null;}})['then'](respondWithResult(_0x279765,null))[_0xeab0('0x45')](handleError(_0x279765,null));};exports['removeMembers']=function(_0x26d19f,_0x32fd64,_0x378586){return db[_0xeab0('0x2d')][_0xeab0('0x49')]({'where':{'id':_0x26d19f[_0xeab0('0x47')]['id']}})[_0xeab0('0x28')](handleEntityNotFound(_0x32fd64,null))[_0xeab0('0x28')](function(_0x288129){if(_0x288129){return _0x288129[_0xeab0('0x57')](_0x26d19f[_0xeab0('0x33')][_0xeab0('0x52')]);}})['then'](respondWithStatusCode(_0x32fd64,null))['catch'](handleError(_0x32fd64,null));};exports[_0xeab0('0x58')]=function(_0x31e02e,_0x156afc,_0x3f9031){if(_0x31e02e[_0xeab0('0x4b')]['id']){delete _0x31e02e[_0xeab0('0x4b')]['id'];}return db[_0xeab0('0x2d')][_0xeab0('0x49')]({'where':{'id':_0x31e02e['params']['id']}})[_0xeab0('0x28')](handleEntityNotFound(_0x156afc,null))[_0xeab0('0x28')](function(_0x5c3ccc){if(_0x5c3ccc){_0x31e02e[_0xeab0('0x4b')][_0xeab0('0x59')]=_0x5c3ccc['id'];return db[_0xeab0('0x4f')]['create'](_0x31e02e[_0xeab0('0x4b')]);}})[_0xeab0('0x28')](respondWithResult(_0x156afc,null))[_0xeab0('0x45')](handleError(_0x156afc,null));};exports[_0xeab0('0x5a')]=function(_0x562cab,_0x4e0ac9,_0x2e7971){var _0x6173a2={};var _0x10b88f={};var _0x2b0c4f;var _0xb50b1d;return db['ChatGroup'][_0xeab0('0x53')]({'where':{'id':_0x562cab[_0xeab0('0x47')]['id']}})[_0xeab0('0x28')](handleEntityNotFound(_0x4e0ac9,null))[_0xeab0('0x28')](function(_0x44d1d7){if(_0x44d1d7){_0x2b0c4f=_0x44d1d7;_0x10b88f['model']=_[_0xeab0('0x34')](db[_0xeab0('0x4f')][_0xeab0('0x48')]);_0x10b88f[_0xeab0('0x33')]=_[_0xeab0('0x34')](_0x562cab[_0xeab0('0x33')]);_0x10b88f[_0xeab0('0x35')]=_[_0xeab0('0x36')](_0x10b88f[_0xeab0('0x31')],_0x10b88f['query']);_0x6173a2[_0xeab0('0x38')]=_[_0xeab0('0x36')](_0x10b88f[_0xeab0('0x31')],qs[_0xeab0('0x37')](_0x562cab[_0xeab0('0x33')][_0xeab0('0x37')]));_0x6173a2[_0xeab0('0x38')]=_0x6173a2[_0xeab0('0x38')][_0xeab0('0x39')]?_0x6173a2[_0xeab0('0x38')]:_0x10b88f[_0xeab0('0x31')];_0x6173a2[_0xeab0('0x3c')]=qs['sort'](_0x562cab[_0xeab0('0x33')][_0xeab0('0x3d')]);_0x6173a2[_0xeab0('0x3f')]=qs[_0xeab0('0x35')](_['pick'](_0x562cab['query'],_0x10b88f[_0xeab0('0x35')]));if(_0x562cab[_0xeab0('0x33')]['filter']){_0x6173a2[_0xeab0('0x3f')]=_[_0xeab0('0x40')](_0x6173a2[_0xeab0('0x3f')],{'$or':_[_0xeab0('0x32')](_0x6173a2[_0xeab0('0x38')],function(_0x3fe215){var _0x30c0f6={};_0x30c0f6[_0x3fe215]={'$like':'%'+_0x562cab[_0xeab0('0x33')][_0xeab0('0x3e')]+'%'};return _0x30c0f6;})});}if(_0x562cab[_0xeab0('0x33')]['$gte']){var _0x43de7a=_0x562cab['query'][_0xeab0('0x5b')]['split'](',');var _0x2aecac={};_0x2aecac[_0x43de7a[0x0]]={'$gte':moment(_0x43de7a[0x1])[_0xeab0('0x5c')](_0xeab0('0x5d'))};_0x6173a2[_0xeab0('0x3f')]=_[_0xeab0('0x40')](_0x6173a2[_0xeab0('0x3f')],_0x2aecac);}_0x6173a2=_[_0xeab0('0x40')]({},_0x6173a2,_0x562cab['options']);return _0x2b0c4f['getMessages'](_0x6173a2);}})[_0xeab0('0x28')](function(_0x51da52){if(_0x51da52){_0xb50b1d=_0x51da52['length'];if(!_0x562cab[_0xeab0('0x33')]['hasOwnProperty'](_0xeab0('0x3b'))){_0x6173a2[_0xeab0('0x22')]=qs[_0xeab0('0x22')](_0x562cab[_0xeab0('0x33')][_0xeab0('0x22')]);_0x6173a2[_0xeab0('0x20')]=qs[_0xeab0('0x20')](_0x562cab[_0xeab0('0x33')][_0xeab0('0x20')]);}return _0x2b0c4f[_0xeab0('0x5a')](_0x6173a2);}})[_0xeab0('0x28')](function(_0x18a651){if(_0x18a651){return _0x18a651?{'count':_0xb50b1d,'rows':_0x18a651}:null;}})['then'](respondWithResult(_0x4e0ac9,null))['catch'](handleError(_0x4e0ac9,null));}; \ No newline at end of file +var _0xbb2f=['ChatGroup','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','getUnread','ChatInternalMessage','user','addMembers','ids','getMembers','User','filter','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','Content-Range','reject','update','then','destroy','error','stack','name','index','map'];(function(_0x1e194b,_0x3e2e5e){var _0x325932=function(_0x86db79){while(--_0x86db79){_0x1e194b['push'](_0x1e194b['shift']());}};_0x325932(++_0x3e2e5e);}(_0xbb2f,0x8c));var _0xfbb2=function(_0x15c443,_0x500021){_0x15c443=_0x15c443-0x0;var _0x206225=_0xbb2f[_0x15c443];return _0x206225;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfbb2('0x0'));var zipdir=require(_0xfbb2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfbb2('0x2'));var BPromise=require(_0xfbb2('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfbb2('0x4'));var ejs=require(_0xfbb2('0x5'));var fs=require('fs');var fs_extra=require(_0xfbb2('0x6'));var _=require(_0xfbb2('0x7'));var squel=require(_0xfbb2('0x8'));var crypto=require(_0xfbb2('0x9'));var jsforce=require(_0xfbb2('0xa'));var deskjs=require(_0xfbb2('0xb'));var toCsv=require(_0xfbb2('0x4'));var querystring=require(_0xfbb2('0xc'));var Papa=require(_0xfbb2('0xd'));var Redis=require(_0xfbb2('0xe'));var authService=require(_0xfbb2('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfbb2('0x10'));var hardwareService=require(_0xfbb2('0x11'));var logger=require('../../config/logger')(_0xfbb2('0x12'));var utils=require(_0xfbb2('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xfbb2('0x14'));var db=require(_0xfbb2('0x15'))['db'];config[_0xfbb2('0x16')]=_['defaults'](config[_0xfbb2('0x16')],{'host':_0xfbb2('0x17'),'port':0x18eb});var socket=require(_0xfbb2('0x18'))(new Redis(config[_0xfbb2('0x16')]));require(_0xfbb2('0x19'))[_0xfbb2('0x1a')](socket);function respondWithStatusCode(_0x11ff63,_0x10ef08){_0x10ef08=_0x10ef08||0xcc;return function(_0x341995){if(_0x341995){return _0x11ff63[_0xfbb2('0x1b')](_0x10ef08);}return _0x11ff63[_0xfbb2('0x1c')](_0x10ef08)[_0xfbb2('0x1d')]();};}function respondWithResult(_0x36e980,_0x450594){_0x450594=_0x450594||0xc8;return function(_0x107138){if(_0x107138){return _0x36e980[_0xfbb2('0x1c')](_0x450594)[_0xfbb2('0x1e')](_0x107138);}};}function respondWithFilteredResult(_0x21f301,_0x41809b){return function(_0x4bb843){if(_0x4bb843){var _0x10582f=typeof _0x41809b[_0xfbb2('0x1f')]===_0xfbb2('0x20')&&typeof _0x41809b[_0xfbb2('0x21')]===_0xfbb2('0x20');var _0x1caae3=_0x4bb843['count'];var _0x1a61e6=_0x10582f?0x0:_0x41809b[_0xfbb2('0x1f')];var _0x7cb4=_0x10582f?_0x4bb843['count']:_0x41809b[_0xfbb2('0x1f')]+_0x41809b[_0xfbb2('0x21')];var _0x4a192e;if(_0x7cb4>=_0x1caae3){_0x7cb4=_0x1caae3;_0x4a192e=0xc8;}else{_0x4a192e=0xce;}_0x21f301[_0xfbb2('0x1c')](_0x4a192e);return _0x21f301['set'](_0xfbb2('0x22'),_0x1a61e6+'-'+_0x7cb4+'/'+_0x1caae3)[_0xfbb2('0x1e')](_0x4bb843);}return null;};}function patchUpdates(_0x4044a2){return function(_0x354bf8){try{jsonpatch['apply'](_0x354bf8,_0x4044a2,!![]);}catch(_0x3e4d04){return BPromise[_0xfbb2('0x23')](_0x3e4d04);}return _0x354bf8['save']();};}function saveUpdates(_0x328bd2,_0x19ee10){return function(_0x5bd75f){if(_0x5bd75f){return _0x5bd75f[_0xfbb2('0x24')](_0x328bd2)[_0xfbb2('0x25')](function(_0x410dcb){return _0x410dcb;});}return null;};}function removeEntity(_0xf2dce7,_0x337560){return function(_0x2d48cc){if(_0x2d48cc){return _0x2d48cc[_0xfbb2('0x26')]()[_0xfbb2('0x25')](function(){_0xf2dce7[_0xfbb2('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x134e34,_0x909a64){return function(_0x1f7f9d){if(!_0x1f7f9d){_0x134e34[_0xfbb2('0x1b')](0x194);}return _0x1f7f9d;};}function handleError(_0x4196fc,_0x41fd91){_0x41fd91=_0x41fd91||0x1f4;return function(_0x213fd0){logger[_0xfbb2('0x27')](_0x213fd0[_0xfbb2('0x28')]);if(_0x213fd0[_0xfbb2('0x29')]){delete _0x213fd0[_0xfbb2('0x29')];}_0x4196fc[_0xfbb2('0x1c')](_0x41fd91)['send'](_0x213fd0);};}exports[_0xfbb2('0x2a')]=function(_0x8248c0,_0x3d022b){var _0x1afa44={},_0x5b767c={},_0x4302a5={'count':0x0,'rows':[]};var _0x2986b1=_[_0xfbb2('0x2b')](db[_0xfbb2('0x2c')][_0xfbb2('0x2d')],function(_0x463f0c){return{'name':_0x463f0c[_0xfbb2('0x2e')],'type':_0x463f0c['type']['key']};});_0x5b767c[_0xfbb2('0x2f')]=_['map'](_0x2986b1,_0xfbb2('0x29'));_0x5b767c[_0xfbb2('0x30')]=_[_0xfbb2('0x31')](_0x8248c0[_0xfbb2('0x30')]);_0x5b767c[_0xfbb2('0x32')]=_[_0xfbb2('0x33')](_0x5b767c[_0xfbb2('0x2f')],_0x5b767c['query']);_0x1afa44[_0xfbb2('0x34')]=_[_0xfbb2('0x33')](_0x5b767c[_0xfbb2('0x2f')],qs[_0xfbb2('0x35')](_0x8248c0[_0xfbb2('0x30')]['fields']));_0x1afa44[_0xfbb2('0x34')]=_0x1afa44[_0xfbb2('0x34')][_0xfbb2('0x36')]?_0x1afa44[_0xfbb2('0x34')]:_0x5b767c[_0xfbb2('0x2f')];if(!_0x8248c0[_0xfbb2('0x30')][_0xfbb2('0x37')]('nolimit')){_0x1afa44[_0xfbb2('0x21')]=qs['limit'](_0x8248c0[_0xfbb2('0x30')]['limit']);_0x1afa44[_0xfbb2('0x1f')]=qs[_0xfbb2('0x1f')](_0x8248c0[_0xfbb2('0x30')]['offset']);}_0x1afa44[_0xfbb2('0x38')]=qs[_0xfbb2('0x39')](_0x8248c0[_0xfbb2('0x30')][_0xfbb2('0x39')]);_0x1afa44['where']=qs['filters'](_[_0xfbb2('0x3a')](_0x8248c0[_0xfbb2('0x30')],_0x5b767c['filters']),_0x2986b1);if(_0x8248c0[_0xfbb2('0x30')]['filter']){_0x1afa44[_0xfbb2('0x3b')]=_[_0xfbb2('0x3c')](_0x1afa44[_0xfbb2('0x3b')],{'$or':_[_0xfbb2('0x2b')](_0x2986b1,function(_0x2e5477){if(_0x2e5477['type']!==_0xfbb2('0x3d')){var _0x100092={};_0x100092[_0x2e5477[_0xfbb2('0x29')]]={'$like':'%'+_0x8248c0[_0xfbb2('0x30')]['filter']+'%'};return _0x100092;}})});}_0x1afa44=_['merge']({},_0x1afa44,_0x8248c0[_0xfbb2('0x3e')]);var _0x2a2b66={'where':_0x1afa44[_0xfbb2('0x3b')]};return db['ChatGroup'][_0xfbb2('0x3f')](_0x2a2b66)[_0xfbb2('0x25')](function(_0x19f048){_0x4302a5[_0xfbb2('0x3f')]=_0x19f048;if(_0x8248c0[_0xfbb2('0x30')][_0xfbb2('0x40')]){_0x1afa44[_0xfbb2('0x41')]=[{'all':!![]}];}return db['ChatGroup'][_0xfbb2('0x42')](_0x1afa44);})[_0xfbb2('0x25')](function(_0x10defd){_0x4302a5[_0xfbb2('0x43')]=_0x10defd;return _0x4302a5;})[_0xfbb2('0x25')](respondWithFilteredResult(_0x3d022b,_0x1afa44))['catch'](handleError(_0x3d022b,null));};exports[_0xfbb2('0x44')]=function(_0x85653e,_0x5b4fe0){var _0x58407f={'raw':!![],'where':{'id':_0x85653e['params']['id']}},_0x259472={};_0x259472[_0xfbb2('0x2f')]=_[_0xfbb2('0x31')](db[_0xfbb2('0x2c')][_0xfbb2('0x2d')]);_0x259472[_0xfbb2('0x30')]=_[_0xfbb2('0x31')](_0x85653e[_0xfbb2('0x30')]);_0x259472[_0xfbb2('0x32')]=_['intersection'](_0x259472[_0xfbb2('0x2f')],_0x259472[_0xfbb2('0x30')]);_0x58407f[_0xfbb2('0x34')]=_[_0xfbb2('0x33')](_0x259472[_0xfbb2('0x2f')],qs[_0xfbb2('0x35')](_0x85653e[_0xfbb2('0x30')][_0xfbb2('0x35')]));_0x58407f[_0xfbb2('0x34')]=_0x58407f[_0xfbb2('0x34')][_0xfbb2('0x36')]?_0x58407f['attributes']:_0x259472[_0xfbb2('0x2f')];if(_0x85653e[_0xfbb2('0x30')][_0xfbb2('0x40')]){_0x58407f[_0xfbb2('0x41')]=[{'all':!![]}];}_0x58407f=_[_0xfbb2('0x3c')]({},_0x58407f,_0x85653e[_0xfbb2('0x3e')]);return db[_0xfbb2('0x2c')][_0xfbb2('0x45')](_0x58407f)[_0xfbb2('0x25')](handleEntityNotFound(_0x5b4fe0,null))['then'](respondWithResult(_0x5b4fe0,null))[_0xfbb2('0x46')](handleError(_0x5b4fe0,null));};exports[_0xfbb2('0x47')]=function(_0x3c1a10,_0x84686a){return db[_0xfbb2('0x2c')]['create'](_0x3c1a10['body'],{})[_0xfbb2('0x25')](respondWithResult(_0x84686a,0xc9))[_0xfbb2('0x46')](handleError(_0x84686a,null));};exports[_0xfbb2('0x24')]=function(_0x2a514d,_0x3c4254){if(_0x2a514d[_0xfbb2('0x48')]['id']){delete _0x2a514d['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x2a514d[_0xfbb2('0x49')]['id']}})['then'](handleEntityNotFound(_0x3c4254,null))[_0xfbb2('0x25')](saveUpdates(_0x2a514d['body'],null))[_0xfbb2('0x25')](respondWithResult(_0x3c4254,null))['catch'](handleError(_0x3c4254,null));};exports[_0xfbb2('0x26')]=function(_0x2f3e6d,_0x5268b9){return db['ChatGroup'][_0xfbb2('0x45')]({'where':{'id':_0x2f3e6d[_0xfbb2('0x49')]['id']}})['then'](handleEntityNotFound(_0x5268b9,null))[_0xfbb2('0x25')](removeEntity(_0x5268b9,null))[_0xfbb2('0x46')](handleError(_0x5268b9,null));};exports[_0xfbb2('0x4a')]=function(_0x123496,_0x403a12){return db[_0xfbb2('0x2c')][_0xfbb2('0x4a')]()['then'](respondWithResult(_0x403a12,null))[_0xfbb2('0x46')](handleError(_0x403a12,null));};exports[_0xfbb2('0x4b')]=function(_0x4eee5d,_0x47b47b,_0x5e4f61){return db[_0xfbb2('0x4c')][_0xfbb2('0x3f')]({'where':{'ChatGroupId':_0x4eee5d['params']['id'],'ToId':_0x4eee5d[_0xfbb2('0x4d')]['id'],'read':![]}})[_0xfbb2('0x25')](function(_0x10d700){return{'id':_['toInteger'](_0x4eee5d[_0xfbb2('0x49')]['id']),'count':_0x10d700};})[_0xfbb2('0x25')](respondWithResult(_0x47b47b,null))[_0xfbb2('0x46')](handleError(_0x47b47b,null));};exports[_0xfbb2('0x4e')]=function(_0x3c0011,_0x35da37,_0x557588){return db[_0xfbb2('0x2c')]['find']({'where':{'id':_0x3c0011[_0xfbb2('0x49')]['id']}})['then'](handleEntityNotFound(_0x35da37,null))[_0xfbb2('0x25')](function(_0x597b7e){if(_0x597b7e){return _0x597b7e['addMembers'](_0x3c0011[_0xfbb2('0x48')]['ids'],_['omit'](_0x3c0011[_0xfbb2('0x48')],[_0xfbb2('0x4f'),'id'])||{});}})[_0xfbb2('0x25')](respondWithResult(_0x35da37,null))['catch'](handleError(_0x35da37,null));};exports[_0xfbb2('0x50')]=function(_0x3eb87f,_0x45d8ac,_0x24779b){var _0xb00ec={};var _0x243c73={};var _0x407544;var _0x172bcb;return db[_0xfbb2('0x2c')]['findOne']({'where':{'id':_0x3eb87f['params']['id']}})[_0xfbb2('0x25')](handleEntityNotFound(_0x45d8ac,null))[_0xfbb2('0x25')](function(_0x5e22cb){if(_0x5e22cb){_0x407544=_0x5e22cb;_0x243c73[_0xfbb2('0x2f')]=_[_0xfbb2('0x31')](db[_0xfbb2('0x51')][_0xfbb2('0x2d')]);_0x243c73[_0xfbb2('0x30')]=_['keys'](_0x3eb87f[_0xfbb2('0x30')]);_0x243c73[_0xfbb2('0x32')]=_['intersection'](_0x243c73[_0xfbb2('0x2f')],_0x243c73[_0xfbb2('0x30')]);_0xb00ec[_0xfbb2('0x34')]=_[_0xfbb2('0x33')](_0x243c73['model'],qs[_0xfbb2('0x35')](_0x3eb87f[_0xfbb2('0x30')][_0xfbb2('0x35')]));_0xb00ec['attributes']=_0xb00ec[_0xfbb2('0x34')][_0xfbb2('0x36')]?_0xb00ec[_0xfbb2('0x34')]:_0x243c73['model'];_0xb00ec[_0xfbb2('0x38')]=qs[_0xfbb2('0x39')](_0x3eb87f['query'][_0xfbb2('0x39')]);_0xb00ec[_0xfbb2('0x3b')]=qs[_0xfbb2('0x32')](_[_0xfbb2('0x3a')](_0x3eb87f[_0xfbb2('0x30')],_0x243c73[_0xfbb2('0x32')]));if(_0x3eb87f[_0xfbb2('0x30')]['filter']){_0xb00ec[_0xfbb2('0x3b')]=_[_0xfbb2('0x3c')](_0xb00ec['where'],{'$or':_[_0xfbb2('0x2b')](_0xb00ec[_0xfbb2('0x34')],function(_0x1d94c4){var _0x415b75={};_0x415b75[_0x1d94c4]={'$like':'%'+_0x3eb87f[_0xfbb2('0x30')][_0xfbb2('0x52')]+'%'};return _0x415b75;})});}_0xb00ec=_[_0xfbb2('0x3c')]({},_0xb00ec,_0x3eb87f[_0xfbb2('0x3e')]);return _0x407544[_0xfbb2('0x50')](_0xb00ec);}})[_0xfbb2('0x25')](function(_0x418381){if(_0x418381){_0x172bcb=_0x418381[_0xfbb2('0x36')];if(!_0x3eb87f[_0xfbb2('0x30')][_0xfbb2('0x37')](_0xfbb2('0x53'))){_0xb00ec[_0xfbb2('0x21')]=qs[_0xfbb2('0x21')](_0x3eb87f[_0xfbb2('0x30')]['limit']);_0xb00ec['offset']=qs[_0xfbb2('0x1f')](_0x3eb87f[_0xfbb2('0x30')][_0xfbb2('0x1f')]);}return _0x407544[_0xfbb2('0x50')](_0xb00ec);}})[_0xfbb2('0x25')](function(_0x955fda){if(_0x955fda){return _0x955fda?{'count':_0x172bcb,'rows':_0x955fda}:null;}})['then'](respondWithResult(_0x45d8ac,null))[_0xfbb2('0x46')](handleError(_0x45d8ac,null));};exports['removeMembers']=function(_0x20bbd2,_0x2eca0b,_0x40e127){return db[_0xfbb2('0x2c')]['find']({'where':{'id':_0x20bbd2[_0xfbb2('0x49')]['id']}})[_0xfbb2('0x25')](handleEntityNotFound(_0x2eca0b,null))['then'](function(_0x75cbab){if(_0x75cbab){return _0x75cbab[_0xfbb2('0x54')](_0x20bbd2[_0xfbb2('0x30')]['ids']);}})[_0xfbb2('0x25')](respondWithStatusCode(_0x2eca0b,null))[_0xfbb2('0x46')](handleError(_0x2eca0b,null));};exports[_0xfbb2('0x55')]=function(_0x7d9e5f,_0x449d01,_0x1b3041){if(_0x7d9e5f[_0xfbb2('0x48')]['id']){delete _0x7d9e5f[_0xfbb2('0x48')]['id'];}return db[_0xfbb2('0x2c')]['find']({'where':{'id':_0x7d9e5f[_0xfbb2('0x49')]['id']}})[_0xfbb2('0x25')](handleEntityNotFound(_0x449d01,null))[_0xfbb2('0x25')](function(_0x38508e){if(_0x38508e){_0x7d9e5f[_0xfbb2('0x48')][_0xfbb2('0x56')]=_0x38508e['id'];return db[_0xfbb2('0x4c')]['create'](_0x7d9e5f[_0xfbb2('0x48')]);}})[_0xfbb2('0x25')](respondWithResult(_0x449d01,null))[_0xfbb2('0x46')](handleError(_0x449d01,null));};exports[_0xfbb2('0x57')]=function(_0x161bd1,_0x83a5db,_0x57ec99){var _0x55d77d={};var _0x58ead7={};var _0x236a1b;var _0x516d4d;return db[_0xfbb2('0x2c')][_0xfbb2('0x58')]({'where':{'id':_0x161bd1[_0xfbb2('0x49')]['id']}})['then'](handleEntityNotFound(_0x83a5db,null))[_0xfbb2('0x25')](function(_0x148213){if(_0x148213){_0x236a1b=_0x148213;_0x58ead7[_0xfbb2('0x2f')]=_[_0xfbb2('0x31')](db[_0xfbb2('0x4c')][_0xfbb2('0x2d')]);_0x58ead7[_0xfbb2('0x30')]=_['keys'](_0x161bd1[_0xfbb2('0x30')]);_0x58ead7['filters']=_[_0xfbb2('0x33')](_0x58ead7[_0xfbb2('0x2f')],_0x58ead7[_0xfbb2('0x30')]);_0x55d77d[_0xfbb2('0x34')]=_['intersection'](_0x58ead7[_0xfbb2('0x2f')],qs['fields'](_0x161bd1[_0xfbb2('0x30')][_0xfbb2('0x35')]));_0x55d77d[_0xfbb2('0x34')]=_0x55d77d[_0xfbb2('0x34')][_0xfbb2('0x36')]?_0x55d77d[_0xfbb2('0x34')]:_0x58ead7[_0xfbb2('0x2f')];_0x55d77d[_0xfbb2('0x38')]=qs[_0xfbb2('0x39')](_0x161bd1[_0xfbb2('0x30')][_0xfbb2('0x39')]);_0x55d77d[_0xfbb2('0x3b')]=qs[_0xfbb2('0x32')](_[_0xfbb2('0x3a')](_0x161bd1[_0xfbb2('0x30')],_0x58ead7['filters']));if(_0x161bd1[_0xfbb2('0x30')][_0xfbb2('0x52')]){_0x55d77d[_0xfbb2('0x3b')]=_[_0xfbb2('0x3c')](_0x55d77d[_0xfbb2('0x3b')],{'$or':_['map'](_0x55d77d[_0xfbb2('0x34')],function(_0x594f8d){var _0x2445aa={};_0x2445aa[_0x594f8d]={'$like':'%'+_0x161bd1[_0xfbb2('0x30')][_0xfbb2('0x52')]+'%'};return _0x2445aa;})});}if(_0x161bd1[_0xfbb2('0x30')][_0xfbb2('0x59')]){var _0x206275=_0x161bd1['query'][_0xfbb2('0x59')][_0xfbb2('0x5a')](',');var _0x48952e={};_0x48952e[_0x206275[0x0]]={'$gte':moment(_0x206275[0x1])['format'](_0xfbb2('0x5b'))};_0x55d77d[_0xfbb2('0x3b')]=_[_0xfbb2('0x3c')](_0x55d77d['where'],_0x48952e);}_0x55d77d=_[_0xfbb2('0x3c')]({},_0x55d77d,_0x161bd1[_0xfbb2('0x3e')]);return _0x236a1b['getMessages'](_0x55d77d);}})[_0xfbb2('0x25')](function(_0x52f98d){if(_0x52f98d){_0x516d4d=_0x52f98d[_0xfbb2('0x36')];if(!_0x161bd1[_0xfbb2('0x30')][_0xfbb2('0x37')](_0xfbb2('0x53'))){_0x55d77d['limit']=qs['limit'](_0x161bd1[_0xfbb2('0x30')][_0xfbb2('0x21')]);_0x55d77d[_0xfbb2('0x1f')]=qs[_0xfbb2('0x1f')](_0x161bd1[_0xfbb2('0x30')][_0xfbb2('0x1f')]);}return _0x236a1b[_0xfbb2('0x57')](_0x55d77d);}})[_0xfbb2('0x25')](function(_0x34d6c1){if(_0x34d6c1){return _0x34d6c1?{'count':_0x516d4d,'rows':_0x34d6c1}:null;}})[_0xfbb2('0x25')](respondWithResult(_0x83a5db,null))[_0xfbb2('0x46')](handleError(_0x83a5db,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index dff7761..e0c9930 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 _0x12b6=['events','../../mysqldb','save','remove','emit','hook','exports'];(function(_0x56b06c,_0x132309){var _0x1d8047=function(_0x73605b){while(--_0x73605b){_0x56b06c['push'](_0x56b06c['shift']());}};_0x1d8047(++_0x132309);}(_0x12b6,0x1b9));var _0x612b=function(_0x555890,_0xd516c8){_0x555890=_0x555890-0x0;var _0x3e574b=_0x12b6[_0x555890];return _0x3e574b;};'use strict';var EventEmitter=require(_0x612b('0x0'));var ChatGroup=require(_0x612b('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x612b('0x2'),'afterUpdate':'update','afterDestroy':_0x612b('0x3')};function emitEvent(_0x39113d){return function(_0x489cb0,_0x317928,_0x1d70a7){ChatGroupEvents['emit'](_0x39113d+':'+_0x489cb0['id'],_0x489cb0);ChatGroupEvents[_0x612b('0x4')](_0x39113d,_0x489cb0);_0x1d70a7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x612b('0x5')](e,emitEvent(event));}}module[_0x612b('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0x8165=['ChatGroup','setMaxListeners','save','update','hook','exports','events','../../mysqldb'];(function(_0x1075cd,_0x23da2e){var _0x1f60e4=function(_0x419812){while(--_0x419812){_0x1075cd['push'](_0x1075cd['shift']());}};_0x1f60e4(++_0x23da2e);}(_0x8165,0x96));var _0x5816=function(_0x28fef8,_0x16886b){_0x28fef8=_0x28fef8-0x0;var _0x3790c6=_0x8165[_0x28fef8];return _0x3790c6;};'use strict';var EventEmitter=require(_0x5816('0x0'));var ChatGroup=require(_0x5816('0x1'))['db'][_0x5816('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5816('0x3')](0x0);var events={'afterCreate':_0x5816('0x4'),'afterUpdate':_0x5816('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1f23ed){return function(_0x1f4c2a,_0x383fb4,_0x4a3662){ChatGroupEvents['emit'](_0x1f23ed+':'+_0x1f4c2a['id'],_0x1f4c2a);ChatGroupEvents['emit'](_0x1f23ed,_0x1f4c2a);_0x4a3662(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x5816('0x6')](e,emitEvent(event));}}module[_0x5816('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 60b0065..36f8537 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 _0xbb1a=['./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x435044,_0x36ab8e){var _0x33d4c6=function(_0x15efa0){while(--_0x15efa0){_0x435044['push'](_0x435044['shift']());}};_0x33d4c6(++_0x36ab8e);}(_0xbb1a,0x18a));var _0xabb1=function(_0x37643c,_0x229693){_0x37643c=_0x37643c-0x0;var _0x1ca222=_0xbb1a[_0x37643c];return _0x1ca222;};'use strict';var _=require(_0xabb1('0x0'));var util=require(_0xabb1('0x1'));var logger=require(_0xabb1('0x2'))('api');var moment=require(_0xabb1('0x3'));var BPromise=require(_0xabb1('0x4'));var rp=require(_0xabb1('0x5'));var fs=require('fs');var path=require(_0xabb1('0x6'));var rimraf=require(_0xabb1('0x7'));var config=require(_0xabb1('0x8'));var attributes=require(_0xabb1('0x9'));module['exports']=function(_0x2369fa,_0x346857){return _0x2369fa[_0xabb1('0xa')](_0xabb1('0xb'),attributes,{'tableName':_0xabb1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc46d=['exports','lodash','util','api','moment','bluebird','request-promise','rimraf','./chatGroup.attributes'];(function(_0x421a70,_0x3a07ca){var _0x335fb5=function(_0x5c034b){while(--_0x5c034b){_0x421a70['push'](_0x421a70['shift']());}};_0x335fb5(++_0x3a07ca);}(_0xc46d,0xd9));var _0xdc46=function(_0x4416af,_0x2076c9){_0x4416af=_0x4416af-0x0;var _0xe134cc=_0xc46d[_0x4416af];return _0xe134cc;};'use strict';var _=require(_0xdc46('0x0'));var util=require(_0xdc46('0x1'));var logger=require('../../config/logger')(_0xdc46('0x2'));var moment=require(_0xdc46('0x3'));var BPromise=require(_0xdc46('0x4'));var rp=require(_0xdc46('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc46('0x6'));var config=require('../../config/environment');var attributes=require(_0xdc46('0x7'));module[_0xdc46('0x8')]=function(_0xdc7d17,_0x245af1){return _0xdc7d17['define']('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 d47877d..511cb17 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 _0x0b36=['rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatGroup,\x20%s,\x20%s','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4bd82c,_0x1df689){var _0x224fd3=function(_0x338977){while(--_0x338977){_0x4bd82c['push'](_0x4bd82c['shift']());}};_0x224fd3(++_0x1df689);}(_0x0b36,0x80));var _0x60b3=function(_0x567943,_0x4991f4){_0x567943=_0x567943-0x0;var _0x5cfd0e=_0x0b36[_0x567943];return _0x5cfd0e;};'use strict';var _=require('lodash');var util=require(_0x60b3('0x0'));var moment=require(_0x60b3('0x1'));var BPromise=require('bluebird');var rs=require(_0x60b3('0x2'));var fs=require('fs');var Redis=require(_0x60b3('0x3'));var db=require(_0x60b3('0x4'))['db'];var utils=require(_0x60b3('0x5'));var logger=require(_0x60b3('0x6'))(_0x60b3('0x7'));var config=require(_0x60b3('0x8'));var jayson=require(_0x60b3('0x9'));var client=jayson[_0x60b3('0xa')]['http']({'port':0x232a});config[_0x60b3('0xb')]=_[_0x60b3('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x60b3('0xd'))(new Redis(config[_0x60b3('0xb')]));require(_0x60b3('0xe'))[_0x60b3('0xf')](socket);function respondWithRpcPromise(_0x477b55,_0x32ac65,_0x1e6197){return new BPromise(function(_0x244e2b,_0x748253){return client[_0x60b3('0x10')](_0x477b55,_0x1e6197)[_0x60b3('0x11')](function(_0x33709e){logger['info']('ChatGroup,\x20%s,\x20%s',_0x32ac65,'request\x20sent');logger['debug'](_0x60b3('0x12'),_0x32ac65,_0x60b3('0x13'),JSON[_0x60b3('0x14')](_0x33709e));if(_0x33709e[_0x60b3('0x15')]){if(_0x33709e['error'][_0x60b3('0x16')]===0x1f4){logger[_0x60b3('0x15')]('ChatGroup,\x20%s,\x20%s',_0x32ac65,_0x33709e[_0x60b3('0x15')][_0x60b3('0x17')]);return _0x748253(_0x33709e[_0x60b3('0x15')]['message']);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x32ac65,_0x33709e[_0x60b3('0x15')]['message']);return _0x244e2b(_0x33709e['error'][_0x60b3('0x17')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x32ac65,_0x60b3('0x13'));_0x244e2b(_0x33709e[_0x60b3('0x18')][_0x60b3('0x17')]);}})[_0x60b3('0x19')](function(_0x4da745){logger['error'](_0x60b3('0x1a'),_0x32ac65,_0x4da745);_0x748253(_0x4da745);});});} \ No newline at end of file +var _0x7df1=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatGroup,\x20%s,\x20%s'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0x7df1,0xe4));var _0x17df=function(_0x25744c,_0x450a70){_0x25744c=_0x25744c-0x0;var _0x387d52=_0x7df1[_0x25744c];return _0x387d52;};'use strict';var _=require(_0x17df('0x0'));var util=require(_0x17df('0x1'));var moment=require(_0x17df('0x2'));var BPromise=require('bluebird');var rs=require(_0x17df('0x3'));var fs=require('fs');var Redis=require(_0x17df('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x17df('0x5'))(_0x17df('0x6'));var config=require(_0x17df('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x17df('0x8')]['http']({'port':0x232a});config[_0x17df('0x9')]=_['defaults'](config['redis'],{'host':_0x17df('0xa'),'port':0x18eb});var socket=require(_0x17df('0xb'))(new Redis(config['redis']));require(_0x17df('0xc'))[_0x17df('0xd')](socket);function respondWithRpcPromise(_0x1c4279,_0x153bff,_0x57125b){return new BPromise(function(_0x5a777a,_0x502e2e){return client[_0x17df('0xe')](_0x1c4279,_0x57125b)['then'](function(_0x42b73a){logger[_0x17df('0xf')]('ChatGroup,\x20%s,\x20%s',_0x153bff,'request\x20sent');logger[_0x17df('0x10')](_0x17df('0x11'),_0x153bff,_0x17df('0x12'),JSON['stringify'](_0x42b73a));if(_0x42b73a[_0x17df('0x13')]){if(_0x42b73a[_0x17df('0x13')][_0x17df('0x14')]===0x1f4){logger[_0x17df('0x13')](_0x17df('0x15'),_0x153bff,_0x42b73a[_0x17df('0x13')][_0x17df('0x16')]);return _0x502e2e(_0x42b73a[_0x17df('0x13')]['message']);}logger['error'](_0x17df('0x15'),_0x153bff,_0x42b73a[_0x17df('0x13')][_0x17df('0x16')]);return _0x5a777a(_0x42b73a[_0x17df('0x13')]['message']);}else{logger[_0x17df('0xf')]('ChatGroup,\x20%s,\x20%s',_0x153bff,_0x17df('0x12'));_0x5a777a(_0x42b73a[_0x17df('0x17')][_0x17df('0x16')]);}})[_0x17df('0x18')](function(_0x98228b){logger['error'](_0x17df('0x15'),_0x153bff,_0x98228b);_0x502e2e(_0x98228b);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 681c229..7988054 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 _0x5b34=['save','remove','update','emit','removeListener','register','length','chatGroup:','./chatGroup.events'];(function(_0x19003b,_0x2e2f13){var _0x30fb3a=function(_0x22c5e2){while(--_0x22c5e2){_0x19003b['push'](_0x19003b['shift']());}};_0x30fb3a(++_0x2e2f13);}(_0x5b34,0xf2));var _0x45b3=function(_0x1d997a,_0x5e45e7){_0x1d997a=_0x1d997a-0x0;var _0x4e1846=_0x5b34[_0x1d997a];return _0x4e1846;};'use strict';var ChatGroupEvents=require(_0x45b3('0x0'));var events=[_0x45b3('0x1'),_0x45b3('0x2'),_0x45b3('0x3')];function createListener(_0x54bb13,_0x78e884){return function(_0x561c75){_0x78e884[_0x45b3('0x4')](_0x54bb13,_0x561c75);};}function removeListener(_0x67e8b3,_0x339b97){return function(){ChatGroupEvents[_0x45b3('0x5')](_0x67e8b3,_0x339b97);};}exports[_0x45b3('0x6')]=function(_0x525bda){for(var _0x4baffe=0x0,_0x17f447=events[_0x45b3('0x7')];_0x4baffe<_0x17f447;_0x4baffe++){var _0x38748e=events[_0x4baffe];var _0x2c65cc=createListener(_0x45b3('0x8')+_0x38748e,_0x525bda);ChatGroupEvents['on'](_0x38748e,_0x2c65cc);}}; \ No newline at end of file +var _0xa50c=['emit','register','chatGroup:','./chatGroup.events','save','remove'];(function(_0x3451e6,_0x50dddb){var _0x51e8e9=function(_0x2b659e){while(--_0x2b659e){_0x3451e6['push'](_0x3451e6['shift']());}};_0x51e8e9(++_0x50dddb);}(_0xa50c,0x123));var _0xca50=function(_0x165d3c,_0x3ba20d){_0x165d3c=_0x165d3c-0x0;var _0xc27339=_0xa50c[_0x165d3c];return _0xc27339;};'use strict';var ChatGroupEvents=require(_0xca50('0x0'));var events=[_0xca50('0x1'),_0xca50('0x2'),'update'];function createListener(_0x48e7d8,_0x5c1b51){return function(_0x32c900){_0x5c1b51[_0xca50('0x3')](_0x48e7d8,_0x32c900);};}function removeListener(_0x48705b,_0x3ef00e){return function(){ChatGroupEvents['removeListener'](_0x48705b,_0x3ef00e);};}exports[_0xca50('0x4')]=function(_0x33bc80){for(var _0x35f9cd=0x0,_0x28feac=events['length'];_0x35f9cd<_0x28feac;_0x35f9cd++){var _0x2c3d36=events[_0x35f9cd];var _0xc865ae=createListener(_0xca50('0x5')+_0x2c3d36,_0x33bc80);ChatGroupEvents['on'](_0x2c3d36,_0xc865ae);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 4d61d33..b71023d 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 _0x591a=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','update','delete','destroy','removeMembers','exports','multer'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x591a,0xc3));var _0xa591=function(_0x3ec1da,_0x1e36f5){_0x3ec1da=_0x3ec1da-0x0;var _0x472358=_0x591a[_0x3ec1da];return _0x472358;};'use strict';var multer=require(_0xa591('0x0'));var util=require(_0xa591('0x1'));var path=require(_0xa591('0x2'));var timeout=require(_0xa591('0x3'));var express=require(_0xa591('0x4'));var router=express[_0xa591('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa591('0x6'));var interaction=require(_0xa591('0x7'));var config=require(_0xa591('0x8'));var controller=require('./chatGroup.controller');router[_0xa591('0x9')]('/',auth[_0xa591('0xa')](),controller[_0xa591('0xb')]);router[_0xa591('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xa591('0x9')](_0xa591('0xc'),auth[_0xa591('0xa')](),controller[_0xa591('0xd')]);router[_0xa591('0x9')](_0xa591('0xe'),auth[_0xa591('0xa')](),controller[_0xa591('0xf')]);router['get'](_0xa591('0x10'),auth[_0xa591('0xa')](),controller[_0xa591('0x11')]);router[_0xa591('0x9')](_0xa591('0x12'),auth['isAuthenticated'](),controller[_0xa591('0x13')]);router[_0xa591('0x14')]('/',auth['isAuthenticated'](),controller[_0xa591('0x15')]);router[_0xa591('0x14')](_0xa591('0x10'),auth[_0xa591('0xa')](),controller['addMembers']);router[_0xa591('0x14')](_0xa591('0x12'),auth[_0xa591('0xa')](),controller[_0xa591('0x16')]);router['put'](_0xa591('0xc'),auth[_0xa591('0xa')](),controller[_0xa591('0x17')]);router[_0xa591('0x18')]('/:id',auth[_0xa591('0xa')](),controller[_0xa591('0x19')]);router[_0xa591('0x18')](_0xa591('0x10'),auth[_0xa591('0xa')](),controller[_0xa591('0x1a')]);module[_0xa591('0x1b')]=router; \ No newline at end of file +var _0x29e0=['../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','create','addMessage','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x656cf,_0x16e68c){var _0x5d833a=function(_0x32689e){while(--_0x32689e){_0x656cf['push'](_0x656cf['shift']());}};_0x5d833a(++_0x16e68c);}(_0x29e0,0x124));var _0x029e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x029e('0x0'));var util=require(_0x029e('0x1'));var path=require(_0x029e('0x2'));var timeout=require(_0x029e('0x3'));var express=require(_0x029e('0x4'));var router=express[_0x029e('0x5')]();var fs_extra=require(_0x029e('0x6'));var auth=require(_0x029e('0x7'));var interaction=require(_0x029e('0x8'));var config=require(_0x029e('0x9'));var controller=require(_0x029e('0xa'));router['get']('/',auth[_0x029e('0xb')](),controller[_0x029e('0xc')]);router[_0x029e('0xd')]('/describe',auth['isAuthenticated'](),controller[_0x029e('0xe')]);router[_0x029e('0xd')](_0x029e('0xf'),auth[_0x029e('0xb')](),controller[_0x029e('0x10')]);router['get'](_0x029e('0x11'),auth[_0x029e('0xb')](),controller[_0x029e('0x12')]);router['get'](_0x029e('0x13'),auth[_0x029e('0xb')](),controller[_0x029e('0x14')]);router[_0x029e('0xd')]('/:id/messages',auth[_0x029e('0xb')](),controller[_0x029e('0x15')]);router[_0x029e('0x16')]('/',auth[_0x029e('0xb')](),controller[_0x029e('0x17')]);router[_0x029e('0x16')](_0x029e('0x13'),auth[_0x029e('0xb')](),controller['addMembers']);router[_0x029e('0x16')]('/:id/messages',auth[_0x029e('0xb')](),controller[_0x029e('0x18')]);router['put'](_0x029e('0xf'),auth[_0x029e('0xb')](),controller[_0x029e('0x19')]);router[_0x029e('0x1a')](_0x029e('0xf'),auth[_0x029e('0xb')](),controller[_0x029e('0x1b')]);router[_0x029e('0x1a')]('/:id/members',auth['isAuthenticated'](),controller[_0x029e('0x1c')]);module[_0x029e('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index b62f864..e043380 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 _0x8c15=['star','TEXT','STRING','DATE','long','out','BOOLEAN','INTEGER','sequelize','exports','ENUM','thumb'];(function(_0x158cc5,_0x56598a){var _0x4fecc9=function(_0x19aeb9){while(--_0x19aeb9){_0x158cc5['push'](_0x158cc5['shift']());}};_0x4fecc9(++_0x56598a);}(_0x8c15,0xc8));var _0x58c1=function(_0x4d3fca,_0x1665ed){_0x4d3fca=_0x4d3fca-0x0;var _0x2aa8ee=_0x8c15[_0x4d3fca];return _0x2aa8ee;};'use strict';var Sequelize=require(_0x58c1('0x0'));module[_0x58c1('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x58c1('0x2')]('star',_0x58c1('0x3')),'defaultValue':_0x58c1('0x4')},'ratingMessage':{'type':Sequelize[_0x58c1('0x5')]},'pathTranscript':{'type':Sequelize[_0x58c1('0x5')]},'mailTranscript':{'type':Sequelize[_0x58c1('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x58c1('0x7')]},'disposition':{'type':Sequelize[_0x58c1('0x6')]},'secondDisposition':{'type':Sequelize[_0x58c1('0x6')]},'thirdDisposition':{'type':Sequelize[_0x58c1('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x58c1('0x6')]},'browserVersion':{'type':Sequelize[_0x58c1('0x6')]},'osName':{'type':Sequelize[_0x58c1('0x6')]},'osVersion':{'type':Sequelize[_0x58c1('0x6')]},'deviceModel':{'type':Sequelize[_0x58c1('0x6')]},'deviceVendor':{'type':Sequelize[_0x58c1('0x6')]},'deviceType':{'type':Sequelize[_0x58c1('0x6')]},'referer':{'type':Sequelize[_0x58c1('0x5')]},'customerIp':{'type':Sequelize[_0x58c1('0x6')]},'formData':{'type':Sequelize[_0x58c1('0x5')](_0x58c1('0x8'))},'read1stAt':{'type':Sequelize[_0x58c1('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x58c1('0x2')]('in',_0x58c1('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x58c1('0x6')]},'customerPort':{'type':Sequelize[_0x58c1('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x58c1('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x58c1('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x58c1('0xb')]}}; \ No newline at end of file +var _0xe26e=['out','INTEGER','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT','STRING','DATE','long'];(function(_0x2a1f53,_0x5310d2){var _0x57c10f=function(_0x3a985c){while(--_0x3a985c){_0x2a1f53['push'](_0x2a1f53['shift']());}};_0x57c10f(++_0x5310d2);}(_0xe26e,0x1d6));var _0xee26=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe26e[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xee26('0x0'));module[_0xee26('0x1')]={'closed':{'type':Sequelize[_0xee26('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xee26('0x3')](_0xee26('0x4'),_0xee26('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xee26('0x6')]},'pathTranscript':{'type':Sequelize[_0xee26('0x6')]},'mailTranscript':{'type':Sequelize[_0xee26('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xee26('0x8')]},'disposition':{'type':Sequelize[_0xee26('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xee26('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xee26('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xee26('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xee26('0x7')]},'referer':{'type':Sequelize[_0xee26('0x6')]},'customerIp':{'type':Sequelize[_0xee26('0x7')]},'formData':{'type':Sequelize['TEXT'](_0xee26('0x9'))},'read1stAt':{'type':Sequelize[_0xee26('0x8')]},'lastMsgAt':{'type':Sequelize[_0xee26('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xee26('0x3')]('in',_0xee26('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xee26('0x7')]},'customerPort':{'type':Sequelize[_0xee26('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xee26('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xee26('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xee26('0xb')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index f8b701b..7b029ca 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 _0x95b5=['ContactId','website_alias','agentAlias','agent_alias','alias','agent_fullname','fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ChatMessage','omit','ids','getMessages','nolimit','order','sort','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','getMyMessages','hasOwnProperty','secret','includeAgent','include','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','push','Contact','firstName','Attachment','get','mkdirSync','Account','Owner','osName','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','createWriteStream','lastName','read','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','update','end','name','send','render','agent','interaction','account','map','ChatInteraction','rawAttributes','type','getOptions','findAll','chat','query','user','params','model','keys','filters','intersection','fields','attributes','merge','options','find','create','body','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','originalname','basename','file','filename','mimetype','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','ChatWebsiteId','length','%s%d','System','customer','Visitor'];(function(_0xafcf00,_0x4429a3){var _0x513af4=function(_0x59554d){while(--_0x59554d){_0xafcf00['push'](_0xafcf00['shift']());}};_0x513af4(++_0x4429a3);}(_0x95b5,0x12b));var _0x595b=function(_0x1c206c,_0x30bdcf){_0x1c206c=_0x1c206c-0x0;var _0x188aaa=_0x95b5[_0x1c206c];return _0x188aaa;};'use strict';var rimraf=require(_0x595b('0x0'));var zipdir=require(_0x595b('0x1'));var rp=require('request-promise');var moment=require(_0x595b('0x2'));var BPromise=require(_0x595b('0x3'));var Mustache=require(_0x595b('0x4'));var util=require(_0x595b('0x5'));var path=require(_0x595b('0x6'));var ejs=require(_0x595b('0x7'));var fs=require('fs');var _=require(_0x595b('0x8'));var Redis=require(_0x595b('0x9'));var interaction=require(_0x595b('0xa'));var qs=require(_0x595b('0xb'));var pdf=require(_0x595b('0xc'));var logger=require('../../config/logger')(_0x595b('0xd'));var config=require('../../config/environment');var db=require(_0x595b('0xe'))['db'];config[_0x595b('0xf')]=_[_0x595b('0x10')](config[_0x595b('0xf')],{'host':_0x595b('0x11'),'port':0x18eb});var socket=require(_0x595b('0x12'))(new Redis(config['redis']));require(_0x595b('0x13'))[_0x595b('0x14')](socket);var jayson=require(_0x595b('0x15'));var client=jayson[_0x595b('0x16')][_0x595b('0x17')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0xc0a1de,_0xb2b8a1,_0x4750ff,_0x1dd7f2){return new BPromise(function(_0x44b028,_0xe90d6d){var _0x57a763=_0x1dd7f2||client;return _0x57a763[_0x595b('0x18')](_0xc0a1de,_0x4750ff)[_0x595b('0x19')](function(_0x1cb83b){logger[_0x595b('0x1a')](_0x595b('0x1b'),_0xb2b8a1,_0x595b('0x1c'));logger['debug'](_0x595b('0x1d'),_0xb2b8a1,'request\x20sent',JSON[_0x595b('0x1e')](_0x1cb83b));if(_0x1cb83b['error']){if(_0x1cb83b[_0x595b('0x1f')][_0x595b('0x20')]===0x1f4){logger[_0x595b('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0xb2b8a1,_0x1cb83b[_0x595b('0x1f')][_0x595b('0x21')]);return _0xe90d6d(_0x1cb83b['error'][_0x595b('0x21')]);}logger['error'](_0x595b('0x1b'),_0xb2b8a1,_0x1cb83b[_0x595b('0x1f')][_0x595b('0x21')]);return _0x44b028(_0x1cb83b[_0x595b('0x1f')][_0x595b('0x21')]);}else{logger[_0x595b('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0xb2b8a1,_0x595b('0x1c'));_0x44b028(_0x1cb83b[_0x595b('0x22')][_0x595b('0x21')]);}})[_0x595b('0x23')](function(_0x5a5d47){logger['error'](_0x595b('0x1b'),_0xb2b8a1,_0x5a5d47);_0xe90d6d(_0x5a5d47);});});}function respondWithStatusCode(_0x483df8,_0x171fef){_0x171fef=_0x171fef||0xcc;return function(_0x2c4e16){if(_0x2c4e16){return _0x483df8[_0x595b('0x24')](_0x171fef);}return _0x483df8[_0x595b('0x25')](_0x171fef)['end']();};}function respondWithResult(_0x812663,_0x3d93d1){_0x3d93d1=_0x3d93d1||0xc8;return function(_0x591293){if(_0x591293){return _0x812663[_0x595b('0x25')](_0x3d93d1)['json'](_0x591293);}};}function respondWithFilteredResult(_0x614f73,_0xd8cbdd){return function(_0x403949){if(_0x403949){var _0x12986e=typeof _0xd8cbdd[_0x595b('0x26')]===_0x595b('0x27')&&typeof _0xd8cbdd[_0x595b('0x28')]==='undefined';var _0x521b6d=_0x403949[_0x595b('0x29')];var _0x552860=_0x12986e?0x0:_0xd8cbdd[_0x595b('0x26')];var _0x576d4f=_0x12986e?_0x403949[_0x595b('0x29')]:_0xd8cbdd[_0x595b('0x26')]+_0xd8cbdd[_0x595b('0x28')];var _0x518b7a;if(_0x576d4f>=_0x521b6d){_0x576d4f=_0x521b6d;_0x518b7a=0xc8;}else{_0x518b7a=0xce;}_0x614f73[_0x595b('0x25')](_0x518b7a);return _0x614f73[_0x595b('0x2a')](_0x595b('0x2b'),_0x552860+'-'+_0x576d4f+'/'+_0x521b6d)['json'](_0x403949);}return null;};}function saveUpdates(_0x2a77cb){return function(_0x563d87){if(_0x563d87){return _0x563d87[_0x595b('0x2c')](_0x2a77cb)[_0x595b('0x19')](function(_0x4f20ba){return _0x4f20ba;});}return null;};}function removeEntity(_0x32c540){return function(_0xb54ce0){if(_0xb54ce0){return _0xb54ce0['destroy']()[_0x595b('0x19')](function(){_0x32c540[_0x595b('0x25')](0xcc)[_0x595b('0x2d')]();});}};}function handleEntityNotFound(_0x33193a){return function(_0x4ab045){if(!_0x4ab045){_0x33193a[_0x595b('0x24')](0x194);}return _0x4ab045;};}function handleError(_0x30260a,_0x25cce5){_0x25cce5=_0x25cce5||0x1f4;return function(_0x1e27b9){logger[_0x595b('0x1f')](_0x1e27b9['stack']);if(_0x1e27b9[_0x595b('0x2e')]){delete _0x1e27b9['name'];}_0x30260a['status'](_0x25cce5)[_0x595b('0x2f')](_0x1e27b9);};}function getMustacheRender(_0xed737a,_0x24155e){return Mustache[_0x595b('0x30')](_0xed737a,_['merge'](_0x24155e['body'],{'contact':_0x24155e['contact'],'message':_0x24155e['message'],'agent':_0x24155e[_0x595b('0x31')],'interaction':_0x24155e[_0x595b('0x32')],'account':_0x24155e[_0x595b('0x33')]}))||'';}exports['index']=function(_0x48f1a3,_0x3b1528){var _0x4ad4a2={};var _0x2ea48b=_[_0x595b('0x34')](db[_0x595b('0x35')][_0x595b('0x36')],function(_0x3d1d6b){return{'name':_0x3d1d6b['fieldName'],'type':_0x3d1d6b[_0x595b('0x37')]['key']};});_0x4ad4a2=qs[_0x595b('0x38')](_0x2ea48b,_0x48f1a3);return interaction[_0x595b('0x39')](_0x595b('0x3a'),_0x48f1a3[_0x595b('0x3b')],_0x48f1a3[_0x595b('0x3c')],_0x4ad4a2,_0x2ea48b)[_0x595b('0x19')](respondWithFilteredResult(_0x3b1528,_0x4ad4a2))['catch'](handleError(_0x3b1528,null));};exports['show']=function(_0x56a181,_0x23d160){var _0x287dd1={'raw':![],'where':{'id':_0x56a181[_0x595b('0x3d')]['id']}},_0x4cb5d5={};_0x4cb5d5[_0x595b('0x3e')]=_[_0x595b('0x3f')](db['ChatInteraction'][_0x595b('0x36')]);_0x4cb5d5[_0x595b('0x3b')]=_['keys'](_0x56a181[_0x595b('0x3b')]);_0x4cb5d5[_0x595b('0x40')]=_[_0x595b('0x41')](_0x4cb5d5[_0x595b('0x3e')],_0x4cb5d5[_0x595b('0x3b')]);_0x287dd1['attributes']=_['intersection'](_0x4cb5d5[_0x595b('0x3e')],qs[_0x595b('0x42')](_0x56a181[_0x595b('0x3b')][_0x595b('0x42')]));_0x287dd1[_0x595b('0x43')]=_0x287dd1[_0x595b('0x43')]['length']?_0x287dd1['attributes']:_0x4cb5d5['model'];if(_0x56a181[_0x595b('0x3b')]['includeAll']){_0x287dd1['include']=[{'all':!![]}];}_0x287dd1=_[_0x595b('0x44')]({},_0x287dd1,_0x56a181[_0x595b('0x45')]);return db[_0x595b('0x35')][_0x595b('0x46')](_0x287dd1)['then'](handleEntityNotFound(_0x23d160,null))['then'](respondWithResult(_0x23d160,null))[_0x595b('0x23')](handleError(_0x23d160,null));};exports[_0x595b('0x47')]=function(_0x16fad7,_0x32a1ac){return db[_0x595b('0x35')][_0x595b('0x47')](_0x16fad7[_0x595b('0x48')],{})['then'](respondWithResult(_0x32a1ac,0xc9))[_0x595b('0x23')](handleError(_0x32a1ac,null));};exports[_0x595b('0x2c')]=function(_0x1e3300,_0xcd9981){if(_0x1e3300[_0x595b('0x48')]['id']){delete _0x1e3300[_0x595b('0x48')]['id'];}return db[_0x595b('0x35')][_0x595b('0x46')]({'where':{'id':_0x1e3300[_0x595b('0x3d')]['id']}})['then'](handleEntityNotFound(_0xcd9981,null))[_0x595b('0x19')](saveUpdates(_0x1e3300[_0x595b('0x48')],null))[_0x595b('0x19')](respondWithResult(_0xcd9981,null))[_0x595b('0x23')](handleError(_0xcd9981,null));};exports['destroy']=function(_0x292097,_0x539322){return db[_0x595b('0x35')]['find']({'where':{'id':_0x292097[_0x595b('0x3d')]['id']}})['then'](handleEntityNotFound(_0x539322,null))[_0x595b('0x19')](removeEntity(_0x539322,null))['catch'](handleError(_0x539322,null));};exports['describe']=function(_0x3d9213,_0x1e405f){return db[_0x595b('0x35')][_0x595b('0x49')]()[_0x595b('0x19')](respondWithResult(_0x1e405f,null))['catch'](handleError(_0x1e405f,null));};exports[_0x595b('0x4a')]=function(_0x2a08f8,_0x19f60c){var _0x327a49=_0x2a08f8[_0x595b('0x3d')]['id'];var _0x2f9e12;var _0x3adcea;var _0x21e262;return db['ChatInteraction']['findOne']({'where':{'id':_0x327a49}})[_0x595b('0x19')](function(_0x5887d1){_0x2f9e12=_0x5887d1;return db[_0x595b('0x4b')][_0x595b('0x4c')]({'where':{'id':_0x5887d1['ChatWebsiteId']},'attributes':['id',_0x595b('0x4d'),_0x595b('0x4e'),'vidaooTopic',_0x595b('0x4f'),_0x595b('0x50')],'raw':!![]});})[_0x595b('0x19')](function(_0x3c035a){if(_0x3c035a&&_0x3c035a[_0x595b('0x4d')]&&_0x3c035a[_0x595b('0x4e')]){_0x3adcea=_0x3c035a;var _0x219859={'interaction':{'id':_0x327a49},'agent':{'id':_0x2a08f8[_0x595b('0x3c')]['id'],'name':_0x2a08f8['user'][_0x595b('0x2e')],'fullname':_0x2a08f8[_0x595b('0x3c')]['fullname'],'email':_0x2a08f8['user'][_0x595b('0x51')]},'contact':_0x2a08f8['body'][_0x595b('0x52')],'account':_0x2a08f8[_0x595b('0x48')][_0x595b('0x33')]};var _0x181deb={'rejectUnauthorized':![],'method':_0x595b('0x53'),'url':_0x595b('0x54'),'headers':{'X-APIKEY':_0x3c035a[_0x595b('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2a08f8['user']['email']],'buttons':null,'topic':_0x3adcea['vidaooTopic'],'note':_[_0x595b('0x55')](_0x3adcea[_0x595b('0x4f')])?null:getMustacheRender(_0x3adcea['vidaooNote'],_0x219859),'metadata':null},'redirect':_0x595b('0x56'),'json':!![]};try{if(!_[_0x595b('0x55')](_0x3adcea[_0x595b('0x50')])){var _0x451d52=getMustacheRender(_0x3adcea[_0x595b('0x50')],_0x219859);var _0x2219a2=JSON[_0x595b('0x57')](_0x451d52);_0x181deb[_0x595b('0x48')][_0x595b('0x58')]=_0x2219a2;}}catch(_0x422f7f){throw new db['Sequelize'][(_0x595b('0x59'))](_0x595b('0x5a'));}return rp(_0x181deb);}else{throw new db[(_0x595b('0x5b'))][(_0x595b('0x59'))](_0x595b('0x5c'));}})[_0x595b('0x19')](function(_0x568fc4){_0x21e262=_0x568fc4;if(_0x21e262['id']){var _0x39ca73={'body':_0x21e262['join_url'],'ChatWebsiteId':_0x3adcea['id'],'ChatInteractionId':_0x2f9e12['id'],'direction':_0x595b('0x5d'),'UserId':_0x2a08f8[_0x595b('0x3c')]['id']};return db['ChatMessage']['create'](_0x39ca73,{});}else{throw new db[(_0x595b('0x5b'))][(_0x595b('0x59'))](_0x595b('0x5e'));}})[_0x595b('0x19')](function(){return _0x2f9e12[_0x595b('0x5f')]({'vidaooSessionId':_0x21e262['id']});})[_0x595b('0x19')](respondWithResult(_0x19f60c,null))[_0x595b('0x23')](handleError(_0x19f60c,null));};exports[_0x595b('0x60')]=function(_0x4e065d,_0x3e8867){if(_0x4e065d['body']['id']){delete _0x4e065d[_0x595b('0x48')]['id'];}return db[_0x595b('0x35')][_0x595b('0x46')]({'where':{'id':_0x4e065d[_0x595b('0x3d')]['id']},'include':[{'model':db[_0x595b('0x61')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x3e8867,null))[_0x595b('0x19')](saveUpdates(_0x4e065d[_0x595b('0x48')],null))['then'](respondWithResult(_0x3e8867,null))[_0x595b('0x23')](handleError(_0x3e8867,null));};exports[_0x595b('0x62')]=function(_0x1582c1,_0x36746e){if(_0x1582c1['body']['id']){delete _0x1582c1[_0x595b('0x48')]['id'];}return db[_0x595b('0x35')][_0x595b('0x46')]({'where':{'id':_0x1582c1[_0x595b('0x3d')]['id']}})[_0x595b('0x19')](function(_0x45090b){if(!_0x45090b){logger[_0x595b('0x1f')](_0x595b('0x63'),_0x595b('0x62'),0x194,_0x595b('0x64'));_0x36746e['sendStatus'](0x194);}else{if(_0x45090b[_0x595b('0x65')]){throw new db['Sequelize'][(_0x595b('0x59'))](_0x595b('0x66'));}}return _0x45090b;})[_0x595b('0x19')](function(_0x4aecbf){if(_0x4aecbf){return _0x4aecbf['update']({'closed':_0x1582c1['body'][_0x595b('0x67')],'disposition':_0x1582c1[_0x595b('0x48')][_0x595b('0x68')]})[_0x595b('0x19')](function(_0x23dc7d){return _0x23dc7d;});}})[_0x595b('0x19')](function(){return respondWithRpcPromise(_0x595b('0x69'),'abandon',_0x1582c1[_0x595b('0x48')],client9004);})[_0x595b('0x19')](respondWithResult(_0x36746e,null))[_0x595b('0x23')](handleError(_0x36746e,null));};exports['attachmentUpload']=function(_0x53cd15,_0x4f0949){_0x53cd15[_0x595b('0x48')]['name']=_0x53cd15['file'][_0x595b('0x6a')];_0x53cd15[_0x595b('0x48')][_0x595b('0x6b')]=_0x53cd15[_0x595b('0x6c')][_0x595b('0x6d')];_0x53cd15['body'][_0x595b('0x37')]=_0x53cd15['file'][_0x595b('0x6e')];return db['Attachment'][_0x595b('0x47')](_0x53cd15[_0x595b('0x48')])[_0x595b('0x19')](respondWithResult(_0x4f0949,0xc9))[_0x595b('0x23')](handleError(_0x4f0949,null));};exports[_0x595b('0x6f')]=function(_0x3fb413,_0x1a58ef){return db[_0x595b('0x35')]['findOne']({'where':{'id':_0x3fb413[_0x595b('0x3d')]['id']},'raw':!![]})[_0x595b('0x19')](handleEntityNotFound(_0x1a58ef,null))[_0x595b('0x19')](function(_0x44eb36){if(_0x44eb36){if(_0x44eb36['closed']){return _0x1a58ef[_0x595b('0x25')](0x193)['json']({'status':0x193,'message':_0x595b('0x70')});}return db['Attachment']['findOne']({'where':{'id':_0x3fb413[_0x595b('0x3b')][_0x595b('0x71')]},'raw':!![]})[_0x595b('0x19')](handleEntityNotFound(_0x1a58ef,null));}})[_0x595b('0x19')](function(_0x11ae04){if(_0x11ae04){var _0x10036f=_0x11ae04['ChatOfflineMessageId']!==null;var _0x37dc8=path[_0x595b('0x72')](config[_0x595b('0x73')],_0x595b('0x74'));if(_0x10036f){_0x37dc8=path['join'](_0x37dc8,_0x595b('0x75'));}var _0x1f3260=path['join'](_0x37dc8,_0x11ae04['basename']);return _0x1a58ef[_0x595b('0x76')](_0x1f3260);}})['catch'](handleError(_0x1a58ef,null));};exports[_0x595b('0x77')]=function(_0x122d46,_0x3307db){var _0x4d0fce=null;var _0x41ead7=null;var _0x4d998d=null;if(_0x122d46[_0x595b('0x48')]['id']){delete _0x122d46[_0x595b('0x48')]['id'];}if(_0x122d46[_0x595b('0x48')][_0x595b('0x78')]){_0x4d998d=path[_0x595b('0x72')](config['root'],_0x595b('0x79'),util[_0x595b('0x7a')](_0x595b('0x7b'),Date['now']()));_0x122d46[_0x595b('0x48')][_0x595b('0x7c')]=_0x4d998d;}return db['ChatInteraction'][_0x595b('0x46')]({'where':{'id':_0x122d46[_0x595b('0x3d')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x595b('0x7d'),'include':[{'model':db[_0x595b('0x7e')],'as':_0x595b('0x7e')}]}]})[_0x595b('0x19')](handleEntityNotFound(_0x3307db,null))['then'](saveUpdates(_0x122d46[_0x595b('0x48')],null))[_0x595b('0x19')](function(_0x491f71){if(_0x491f71){_0x4d0fce=_0x491f71;return db[_0x595b('0x4b')][_0x595b('0x46')]({'where':{'id':_0x4d0fce[_0x595b('0x7f')]}});}})[_0x595b('0x19')](function(_0x4a976f){if(_0x4a976f){_0x41ead7=_0x4a976f;return db[_0x595b('0x61')][_0x595b('0x46')]({'where':{'id':_0x4d0fce['ContactId']}});}})[_0x595b('0x19')](function(_0x585978){if(_0x585978){if(_0x4d998d){var _0x449cb8=null;for(var _0x5b89bf=0x1;_0x5b89bf<_0x4d0fce[_0x595b('0x7d')][_0x595b('0x80')];++_0x5b89bf){_0x449cb8=_0x4d0fce['Messages'][_0x5b89bf];var _0x36ef8b=_0x449cb8[_0x595b('0x65')]?util[_0x595b('0x7a')](_0x595b('0x81'),_0x41ead7['agentAlias'],_0x449cb8[_0x595b('0x65')]):_0x595b('0x82');var _0x56a803=_0x122d46['body'][_0x595b('0x83')]||util[_0x595b('0x7a')](_0x595b('0x81'),_0x595b('0x84'),_0x449cb8[_0x595b('0x85')]);switch(_0x41ead7['agentIdentifier']){case _0x595b('0x86'):_0x36ef8b=_0x449cb8[_0x595b('0x65')]?util[_0x595b('0x7a')](_0x595b('0x81'),_0x41ead7[_0x595b('0x87')],_0x449cb8[_0x595b('0x65')]):_0x595b('0x82');break;case _0x595b('0x88'):_0x36ef8b=_0x449cb8[_0x595b('0x65')]?_0x449cb8['User'][_0x595b('0x89')]||_0x449cb8[_0x595b('0x7e')]['fullname']:_0x595b('0x82');break;case _0x595b('0x8a'):_0x36ef8b=_0x449cb8['UserId']?_0x449cb8[_0x595b('0x7e')][_0x595b('0x8b')]:_0x595b('0x82');break;default:_0x36ef8b=_0x449cb8[_0x595b('0x65')]?util[_0x595b('0x7a')]('%s%d',_0x41ead7['agentAlias'],_0x449cb8['UserId']):_0x595b('0x82');}var _0x40650d=util[_0x595b('0x7a')](_0x595b('0x8c'),moment(_0x449cb8[_0x595b('0x8d')])[_0x595b('0x7a')](_0x595b('0x8e')),_0x449cb8[_0x595b('0x8f')]==='in'?_0x56a803:_0x36ef8b,_0x449cb8['body']);if(!_0x449cb8['secret']){fs[_0x595b('0x90')](_0x4d998d,_0x40650d);}}return db[_0x595b('0x91')][_0x595b('0x4c')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x595b('0x92'),'raw':!![],'include':[{'model':db[_0x595b('0x93')],'as':_0x595b('0x93'),'raw':!![]}]}]});}}})[_0x595b('0x19')](function(_0x4bb56d){if(!_0x4bb56d||!_0x4bb56d[_0x595b('0x92')]||!_0x122d46[_0x595b('0x48')])return _0x4d0fce;var _0x234651=_0x4bb56d[_0x595b('0x94')]();return respondWithRpcPromise(_0x595b('0x95'),_0x595b('0x96'),{'account':_0x234651,'message':{'from':util['format'](_0x595b('0x97'),_0x4bb56d[_0x595b('0x2e')],_0x4bb56d[_0x595b('0x51')]||_0x4bb56d['Smtp'][_0x595b('0x3c')]),'to':_0x122d46['body'][_0x595b('0x78')],'subject':_0x595b('0x98'),'text':util[_0x595b('0x7a')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x122d46[_0x595b('0x48')][_0x595b('0x78')]),'attachments':[{'path':_0x4d998d}]}})['then'](function(){return _0x4d0fce;})[_0x595b('0x23')](function(_0x20a8e2){logger[_0x595b('0x1f')](_0x20a8e2);});})[_0x595b('0x19')](respondWithStatusCode(_0x3307db,0xc8))[_0x595b('0x23')](handleError(_0x3307db,null));};exports[_0x595b('0x99')]=function(_0x5c1a98,_0x2d267b){return db[_0x595b('0x9a')]['find']({'where':{'id':_0x5c1a98[_0x595b('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2d267b,null))[_0x595b('0x19')](function(_0x127842){if(_0x127842){return _0x127842[_0x595b('0x99')](_0x5c1a98[_0x595b('0x48')]['ids'],_[_0x595b('0x9b')](_0x5c1a98[_0x595b('0x48')],[_0x595b('0x9c'),'id'])||{});}})[_0x595b('0x19')](respondWithResult(_0x2d267b,null))['catch'](handleError(_0x2d267b,null));};exports[_0x595b('0x9d')]=function(_0x2fcfc6,_0x5f5b6e){var _0x3aaedd={'raw':![],'where':{}};var _0x483b36={};var _0x3ff346={'count':0x0,'rows':[]};return db[_0x595b('0x35')][_0x595b('0x4c')]({'where':{'id':_0x2fcfc6[_0x595b('0x3d')]['id']}})[_0x595b('0x19')](handleEntityNotFound(_0x5f5b6e,null))[_0x595b('0x19')](function(_0x32e6c7){if(_0x32e6c7){_0x483b36[_0x595b('0x3e')]=_[_0x595b('0x3f')](db[_0x595b('0x9a')]['rawAttributes']);_0x483b36[_0x595b('0x3b')]=_[_0x595b('0x3f')](_0x2fcfc6['query']);_0x483b36[_0x595b('0x40')]=_[_0x595b('0x41')](_0x483b36['model'],_0x483b36[_0x595b('0x3b')]);_0x3aaedd[_0x595b('0x43')]=_[_0x595b('0x41')](_0x483b36[_0x595b('0x3e')],qs[_0x595b('0x42')](_0x2fcfc6[_0x595b('0x3b')]['fields']));_0x3aaedd[_0x595b('0x43')]=_0x3aaedd[_0x595b('0x43')][_0x595b('0x80')]?_0x3aaedd['attributes']:_0x483b36[_0x595b('0x3e')];if(!_0x2fcfc6[_0x595b('0x3b')]['hasOwnProperty'](_0x595b('0x9e'))){_0x3aaedd[_0x595b('0x28')]=qs[_0x595b('0x28')](_0x2fcfc6['query'][_0x595b('0x28')]);_0x3aaedd[_0x595b('0x26')]=qs[_0x595b('0x26')](_0x2fcfc6[_0x595b('0x3b')][_0x595b('0x26')]);}_0x3aaedd[_0x595b('0x9f')]=qs[_0x595b('0xa0')](_0x2fcfc6['query'][_0x595b('0xa0')]);_0x3aaedd['where']=qs[_0x595b('0x40')](_[_0x595b('0xa1')](_0x2fcfc6[_0x595b('0x3b')],_0x483b36[_0x595b('0x40')]));_0x3aaedd[_0x595b('0xa2')][_0x595b('0xa3')]=_0x32e6c7['id'];if(_0x2fcfc6[_0x595b('0x3b')][_0x595b('0xa4')]){_0x3aaedd['where']=_[_0x595b('0x44')](_0x3aaedd[_0x595b('0xa2')],{'$or':_['map'](_0x3aaedd['attributes'],function(_0x298372){var _0x2f1c38={};_0x2f1c38[_0x298372]={'$like':'%'+_0x2fcfc6[_0x595b('0x3b')][_0x595b('0xa4')]+'%'};return _0x2f1c38;})});}if(_0x2fcfc6['query'][_0x595b('0xa5')]){var _0x25e70c=_0x2fcfc6[_0x595b('0x3b')][_0x595b('0xa5')][_0x595b('0xa6')](',');var _0x3159e7={};_0x3159e7[_0x25e70c[0x0]]={'$gte':moment(_0x25e70c[0x1])['format'](_0x595b('0xa7'))};_0x3aaedd[_0x595b('0xa2')]=_['merge'](_0x3aaedd[_0x595b('0xa2')],_0x3159e7);}_0x3aaedd=_[_0x595b('0x44')]({},_0x3aaedd,_0x2fcfc6['options']);return db[_0x595b('0x9a')][_0x595b('0x29')]({'where':_0x3aaedd[_0x595b('0xa2')]})[_0x595b('0x19')](function(_0x3ba09a){_0x3ff346[_0x595b('0x29')]=_0x3ba09a;if(_0x2fcfc6[_0x595b('0x3b')][_0x595b('0xa8')]){_0x3aaedd['include']=[{'all':!![]}];}return db[_0x595b('0x9a')]['findAll'](_0x3aaedd);})['then'](function(_0xb92a75){_0x3ff346[_0x595b('0xa9')]=_0xb92a75;return _0x3ff346;});}})[_0x595b('0x19')](respondWithFilteredResult(_0x5f5b6e,_0x3aaedd))['catch'](handleError(_0x5f5b6e,null));};exports[_0x595b('0xaa')]=function(_0x11f176,_0x2bc580){var _0x1653ce={'where':{}},_0x4c51d2={},_0x3ffa58={'count':0x0,'rows':[]};return db[_0x595b('0x35')][_0x595b('0x4c')]({'where':{'id':_0x11f176[_0x595b('0x3d')]['id']}})[_0x595b('0x19')](handleEntityNotFound(_0x2bc580,null))['then'](function(_0x6f994f){if(_0x6f994f){_0x4c51d2[_0x595b('0x3e')]=_[_0x595b('0x3f')](db[_0x595b('0x9a')][_0x595b('0x36')]);_0x4c51d2[_0x595b('0x3b')]=_[_0x595b('0x3f')](_0x11f176['query']);_0x4c51d2[_0x595b('0x40')]=_[_0x595b('0x41')](_0x4c51d2[_0x595b('0x3e')],_0x4c51d2[_0x595b('0x3b')]);_0x1653ce[_0x595b('0x43')]=_[_0x595b('0x41')](_0x4c51d2[_0x595b('0x3e')],qs[_0x595b('0x42')](_0x11f176[_0x595b('0x3b')][_0x595b('0x42')]));_0x1653ce['attributes']=_0x1653ce['attributes'][_0x595b('0x80')]?_0x1653ce['attributes']:_0x4c51d2['model'];if(!_0x11f176['query'][_0x595b('0xab')]('nolimit')){_0x1653ce[_0x595b('0x28')]=qs['limit'](_0x11f176[_0x595b('0x3b')][_0x595b('0x28')]);_0x1653ce[_0x595b('0x26')]=qs[_0x595b('0x26')](_0x11f176[_0x595b('0x3b')]['offset']);}_0x1653ce['order']=qs[_0x595b('0xa0')](_0x11f176[_0x595b('0x3b')][_0x595b('0xa0')]);_0x1653ce[_0x595b('0xa2')]=qs[_0x595b('0x40')](_['pick'](_0x11f176[_0x595b('0x3b')],_0x4c51d2[_0x595b('0x40')]));_0x1653ce[_0x595b('0xa2')]['ChatInteractionId']=_0x6f994f['id'];if(_0x11f176[_0x595b('0x3b')][_0x595b('0xa4')]){_0x1653ce[_0x595b('0xa2')]=_['merge'](_0x1653ce[_0x595b('0xa2')],{'$or':_['map'](_0x1653ce[_0x595b('0x43')],function(_0x3bfad5){var _0x427181={};_0x427181[_0x3bfad5]={'$like':'%'+_0x11f176[_0x595b('0x3b')][_0x595b('0xa4')]+'%'};return _0x427181;})});}_0x1653ce['where'][_0x595b('0xac')]=![];if(_0x11f176['query']['id']){_0x1653ce[_0x595b('0xa2')]['id']={'$gt':_0x11f176['query']['id']};}_0x1653ce=_[_0x595b('0x44')]({},_0x1653ce,_0x11f176[_0x595b('0x45')]);return db[_0x595b('0x9a')][_0x595b('0x29')]({'where':_0x1653ce[_0x595b('0xa2')]})[_0x595b('0x19')](function(_0x32ad92){_0x3ffa58['count']=_0x32ad92;_0x1653ce['include']=[];if(_0x11f176[_0x595b('0x3b')][_0x595b('0xad')]){_0x1653ce[_0x595b('0xae')]['push']({'model':db['User'],'as':_0x595b('0x7e'),'attributes':['id',_0x595b('0x8b'),_0x595b('0x89')]});}if(_0x11f176[_0x595b('0x3b')][_0x595b('0xa8')]){_0x1653ce['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x1653ce);})[_0x595b('0x19')](function(_0x2635dd){_0x3ffa58[_0x595b('0xa9')]=_0x2635dd;return _0x3ffa58;});}})[_0x595b('0x19')](respondWithFilteredResult(_0x2bc580,_0x1653ce))[_0x595b('0x23')](handleError(_0x2bc580,null));};exports[_0x595b('0xaf')]=function(_0x2db340,_0xc750d){return db['ChatInteraction']['find']({'where':{'id':_0x2db340[_0x595b('0x3d')]['id']}})[_0x595b('0x19')](handleEntityNotFound(_0xc750d,null))[_0x595b('0x19')](function(_0x10099d){if(_0x10099d){return _0x10099d[_0x595b('0xb0')](_0x2db340['body'][_0x595b('0x9c')],_[_0x595b('0x9b')](_0x2db340['body'],['ids','id'])||{})[_0x595b('0xb1')](function(){return db[_0x595b('0xb2')][_0x595b('0x39')]({'attributes':['id',_0x595b('0x2e'),_0x595b('0xb3')],'where':{'id':_0x2db340[_0x595b('0x48')][_0x595b('0x9c')]}});})[_0x595b('0x19')](function(_0x36b61d){socket[_0x595b('0xb4')](_0x595b('0xb5'),{'id':Number(_0x2db340[_0x595b('0x3d')]['id']),'tags':_0x36b61d||[]});return{'id':Number(_0x2db340[_0x595b('0x3d')]['id']),'tags':_0x36b61d||[]};});}})['then'](respondWithResult(_0xc750d,null))[_0x595b('0x23')](handleError(_0xc750d,null));};exports[_0x595b('0xb6')]=function(_0x1a5827,_0x209017){return db['ChatInteraction'][_0x595b('0x46')]({'where':{'id':_0x1a5827[_0x595b('0x3d')]['id']}})[_0x595b('0x19')](handleEntityNotFound(_0x209017,null))['then'](function(_0x10313e){if(_0x10313e){return _0x10313e[_0x595b('0xb6')](_0x1a5827[_0x595b('0x3b')][_0x595b('0x9c')]);}})[_0x595b('0x19')](respondWithStatusCode(_0x209017,null))[_0x595b('0x23')](handleError(_0x209017,null));};exports[_0x595b('0x76')]=function(_0xb65e59,_0x3d2141){var _0x2da7de=moment()[_0x595b('0xb7')]()[_0x595b('0xb8')]();var _0x2c6370=path['join'](config[_0x595b('0x73')],_0x595b('0xb9'),_0x595b('0xba'),_0x595b('0xbb'));var _0x29e9be=path[_0x595b('0x72')](config[_0x595b('0x73')],_0x595b('0xb9'),_0x595b('0xba'),_0x595b('0xbc'));var _0x1bf78a=path[_0x595b('0x72')](_0x2c6370,_0x2da7de);var _0x27e1d3=util[_0x595b('0x7a')](_0x595b('0xbd'),_0xb65e59[_0x595b('0x3d')]['id'],_0x2da7de);var _0x1f482c=path[_0x595b('0x72')](_0x2c6370,_0x27e1d3);var _0x33fe72=[];_0x33fe72[_0x595b('0xbe')]({'model':db['User'],'as':_0x595b('0x7e'),'attributes':['id',_0x595b('0x8b')],'raw':!![]});_0x33fe72[_0x595b('0xbe')]({'model':db[_0x595b('0x61')],'as':_0x595b('0xbf'),'attributes':['id',_0x595b('0xc0'),'lastName'],'raw':!![]});if(_0xb65e59[_0x595b('0x3b')]['attachments']){_0x33fe72['push']({'model':db['Attachment'],'as':_0x595b('0xc1'),'raw':!![]});}var _0x17a9de=[{'model':db[_0x595b('0x9a')],'as':_0x595b('0x7d'),'attributes':['id',_0x595b('0x48'),'createdAt',_0x595b('0x8f'),_0x595b('0xac'),'read'],'include':_0x33fe72}];_0x17a9de[_0x595b('0xbe')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id','name']});_0x17a9de[_0x595b('0xbe')]({'model':db[_0x595b('0x7e')],'as':'Owner','attributes':['id','fullname']});return db[_0x595b('0x35')][_0x595b('0x46')]({'where':{'id':_0xb65e59[_0x595b('0x3d')]['id']},'include':_0x17a9de})['then'](handleEntityNotFound(_0x3d2141,null))['then'](function(_0x4f9413){if(_0x4f9413){var _0x564fca=_0x4f9413[_0x595b('0xc2')]({'plain':!![]});fs[_0x595b('0xc3')](_0x1bf78a);var _0x594a46={'channel':'Chat','account':_0x564fca[_0x595b('0xc4')][_0x595b('0x2e')],'agent':_0x564fca[_0x595b('0xc5')]?_0x564fca[_0x595b('0xc5')][_0x595b('0x8b')]:'N.A.','createdAt':moment(_0x564fca[_0x595b('0x8d')])[_0x595b('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x564fca[_0x595b('0x67')]?moment(_0x564fca['closedAt'])[_0x595b('0x7a')](_0x595b('0xa7'))[_0x595b('0xb8')]():'','disposition':_0x564fca['disposition'],'chatInfo':{'browser':_0x564fca['browserName'],'os':_0x564fca[_0x595b('0xc6')],'referer':_0x564fca['referer'],'customerIp':_0x564fca[_0x595b('0xc7')],'customerPort':_0x564fca[_0x595b('0xc8')]?_0x564fca['customerPort']:_0x595b('0xc9')},'messages':_(_0x564fca['Messages'])[_0x595b('0xca')]()[_0x595b('0xa4')]({'secret':![]})[_0x595b('0x34')](function(_0x5a8376){if(_0x5a8376[_0x595b('0xc1')]){var _0x2c963c=path[_0x595b('0x72')](_0x29e9be,_0x5a8376[_0x595b('0xc1')][_0x595b('0x6b')]);if(fs[_0x595b('0xcb')](_0x2c963c)){fs[_0x595b('0xcc')](_0x2c963c)['pipe'](fs[_0x595b('0xcd')](path[_0x595b('0x72')](_0x1bf78a,_0x5a8376[_0x595b('0xc1')][_0x595b('0x6b')])));}}return{'date':moment(_0x5a8376[_0x595b('0x8d')])[_0x595b('0x7a')](_0x595b('0xa7'))['toString'](),'sender':_0x5a8376[_0x595b('0x8f')]==='out'?_0x5a8376[_0x595b('0x7e')]?_0x5a8376['User']['fullname']:_0x595b('0x82'):_0x5a8376['Contact']['firstName']+(_0x5a8376[_0x595b('0xbf')][_0x595b('0xce')]?'\x20'+_0x5a8376['Contact'][_0x595b('0xce')]:''),'body':_0x5a8376[_0x595b('0xc1')]?_0x5a8376[_0x595b('0xc1')]['basename']:_0x5a8376[_0x595b('0x48')],'direction':_0x5a8376[_0x595b('0x8f')]===_0x595b('0x5d')?'A':'C','secret':_0x5a8376[_0x595b('0xac')],'read':_0x5a8376[_0x595b('0xcf')],'attachment':_0x5a8376[_0x595b('0xc1')]};})['value']()};return ejs[_0x595b('0xd0')](path[_0x595b('0x72')](config[_0x595b('0x73')],_0x595b('0xb9'),_0x595b('0xd1'),_0x595b('0xd2')),{'interaction':_0x594a46})[_0x595b('0x19')](function(_0x141abf){var _0x5abb18=path[_0x595b('0x72')](_0x1bf78a,_0x595b('0xd3')+_0x564fca['id']+'-'+_0x2da7de+_0x595b('0xd4'));var _0x1a4944={'path':_0x5abb18,'channel':_0x595b('0xd5'),'interactionId':_0x564fca['id']};return pdf['createPdfFromHTML'](_0x141abf,_0x1a4944);})['then'](function(){return new Promise(function(_0x294689,_0x9f549a){zipdir(_0x1bf78a,{'saveTo':_0x1f482c},function(_0x491a39,_0x1e9bd2){if(_0x491a39)return _0x9f549a(_0x491a39);return _0x294689(_0x1e9bd2);});})[_0x595b('0x19')](function(){return new BPromise(function(_0x5120ff,_0x2d0b62){rimraf(_0x1bf78a,function(_0x1772a6){if(_0x1772a6)_0x2d0b62(_0x1772a6);return _0x5120ff();});});})[_0x595b('0x19')](function(){return _0x3d2141[_0x595b('0x76')](_0x1f482c,_0x27e1d3,function(_0x1df836){if(_0x1df836){logger[_0x595b('0x1f')](_0x595b('0xd6'),_0x1df836);}else{fs[_0x595b('0xd7')](_0x1f482c);}});});});}else{return _0x3d2141[_0x595b('0x24')](0xc8);}})[_0x595b('0x23')](handleError(_0x3d2141,null));}; \ No newline at end of file +var _0xa780=['info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','undefined','Content-Range','update','then','stack','name','render','merge','body','contact','agent','interaction','index','map','ChatInteraction','rawAttributes','fieldName','key','getOptions','chat','query','catch','show','model','filters','intersection','attributes','fields','length','includeAll','include','find','create','params','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','Interaction\x20already\x20assigned','disposition','AbandonInteraction','file','basename','filename','type','mimetype','closed','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','agentAlias','System','customer','%s%d','ContactId','agentIdentifier','website_alias','agent_alias','UserId','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','keys','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','options','count','findAll','rows','getMyMessages','secret','includeAgent','setTags','spread','Tag','color','chatInteractionTags:save','removeTags','unix','server','files','tmp','push','Contact','lastName','attachments','read','Account','Owner','get','Chat','N.A.','toString','closedAt','browserName','osName','customerPort','tail','existsSync','createReadStream','pipe','out','firstName','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request'];(function(_0x239dd9,_0x17e241){var _0x562ead=function(_0x4d3bd7){while(--_0x4d3bd7){_0x239dd9['push'](_0x239dd9['shift']());}};_0x562ead(++_0x17e241);}(_0xa780,0x191));var _0x0a78=function(_0xd04285,_0x6205df){_0xd04285=_0xd04285-0x0;var _0x41082b=_0xa780[_0xd04285];return _0x41082b;};'use strict';var rimraf=require(_0x0a78('0x0'));var zipdir=require(_0x0a78('0x1'));var rp=require(_0x0a78('0x2'));var moment=require('moment');var BPromise=require(_0x0a78('0x3'));var Mustache=require(_0x0a78('0x4'));var util=require(_0x0a78('0x5'));var path=require(_0x0a78('0x6'));var ejs=require(_0x0a78('0x7'));var fs=require('fs');var _=require(_0x0a78('0x8'));var Redis=require(_0x0a78('0x9'));var interaction=require(_0x0a78('0xa'));var qs=require(_0x0a78('0xb'));var pdf=require(_0x0a78('0xc'));var logger=require(_0x0a78('0xd'))(_0x0a78('0xe'));var config=require(_0x0a78('0xf'));var db=require('../../mysqldb')['db'];config[_0x0a78('0x10')]=_[_0x0a78('0x11')](config[_0x0a78('0x10')],{'host':_0x0a78('0x12'),'port':0x18eb});var socket=require(_0x0a78('0x13'))(new Redis(config['redis']));require(_0x0a78('0x14'))[_0x0a78('0x15')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0a78('0x16')][_0x0a78('0x17')]({'port':0x232b});var client9004=jayson[_0x0a78('0x16')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5f507a,_0x35ae32,_0xd1a3e0,_0x10fb84){return new BPromise(function(_0x2ca38f,_0x792833){var _0x2d8bed=_0x10fb84||client;return _0x2d8bed[_0x0a78('0x18')](_0x5f507a,_0xd1a3e0)['then'](function(_0x56d9ab){logger[_0x0a78('0x19')](_0x0a78('0x1a'),_0x35ae32,'request\x20sent');logger[_0x0a78('0x1b')](_0x0a78('0x1c'),_0x35ae32,'request\x20sent',JSON[_0x0a78('0x1d')](_0x56d9ab));if(_0x56d9ab[_0x0a78('0x1e')]){if(_0x56d9ab[_0x0a78('0x1e')][_0x0a78('0x1f')]===0x1f4){logger[_0x0a78('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x35ae32,_0x56d9ab['error'][_0x0a78('0x20')]);return _0x792833(_0x56d9ab[_0x0a78('0x1e')][_0x0a78('0x20')]);}logger[_0x0a78('0x1e')](_0x0a78('0x1a'),_0x35ae32,_0x56d9ab[_0x0a78('0x1e')][_0x0a78('0x20')]);return _0x2ca38f(_0x56d9ab[_0x0a78('0x1e')]['message']);}else{logger[_0x0a78('0x19')](_0x0a78('0x1a'),_0x35ae32,'request\x20sent');_0x2ca38f(_0x56d9ab[_0x0a78('0x21')]['message']);}})['catch'](function(_0x21d245){logger[_0x0a78('0x1e')](_0x0a78('0x1a'),_0x35ae32,_0x21d245);_0x792833(_0x21d245);});});}function respondWithStatusCode(_0x57e4dc,_0x27e598){_0x27e598=_0x27e598||0xcc;return function(_0x33c204){if(_0x33c204){return _0x57e4dc[_0x0a78('0x22')](_0x27e598);}return _0x57e4dc[_0x0a78('0x23')](_0x27e598)[_0x0a78('0x24')]();};}function respondWithResult(_0x3faeb7,_0x2948b4){_0x2948b4=_0x2948b4||0xc8;return function(_0x4323ff){if(_0x4323ff){return _0x3faeb7[_0x0a78('0x23')](_0x2948b4)[_0x0a78('0x25')](_0x4323ff);}};}function respondWithFilteredResult(_0x182cae,_0x2a9f56){return function(_0x347f67){if(_0x347f67){var _0x2d66cf=typeof _0x2a9f56[_0x0a78('0x26')]==='undefined'&&typeof _0x2a9f56[_0x0a78('0x27')]===_0x0a78('0x28');var _0x577c53=_0x347f67['count'];var _0x5f5071=_0x2d66cf?0x0:_0x2a9f56[_0x0a78('0x26')];var _0x34fae1=_0x2d66cf?_0x347f67['count']:_0x2a9f56[_0x0a78('0x26')]+_0x2a9f56[_0x0a78('0x27')];var _0x5e9abc;if(_0x34fae1>=_0x577c53){_0x34fae1=_0x577c53;_0x5e9abc=0xc8;}else{_0x5e9abc=0xce;}_0x182cae[_0x0a78('0x23')](_0x5e9abc);return _0x182cae['set'](_0x0a78('0x29'),_0x5f5071+'-'+_0x34fae1+'/'+_0x577c53)[_0x0a78('0x25')](_0x347f67);}return null;};}function saveUpdates(_0x2ed64c){return function(_0x54794e){if(_0x54794e){return _0x54794e[_0x0a78('0x2a')](_0x2ed64c)[_0x0a78('0x2b')](function(_0x15f991){return _0x15f991;});}return null;};}function removeEntity(_0x4a41e3){return function(_0x5effd4){if(_0x5effd4){return _0x5effd4['destroy']()[_0x0a78('0x2b')](function(){_0x4a41e3[_0x0a78('0x23')](0xcc)[_0x0a78('0x24')]();});}};}function handleEntityNotFound(_0x2da857){return function(_0x158bce){if(!_0x158bce){_0x2da857[_0x0a78('0x22')](0x194);}return _0x158bce;};}function handleError(_0x2f0116,_0x5b15ce){_0x5b15ce=_0x5b15ce||0x1f4;return function(_0x1bcaf5){logger[_0x0a78('0x1e')](_0x1bcaf5[_0x0a78('0x2c')]);if(_0x1bcaf5[_0x0a78('0x2d')]){delete _0x1bcaf5[_0x0a78('0x2d')];}_0x2f0116[_0x0a78('0x23')](_0x5b15ce)['send'](_0x1bcaf5);};}function getMustacheRender(_0x527f7c,_0xfbe1e8){return Mustache[_0x0a78('0x2e')](_0x527f7c,_[_0x0a78('0x2f')](_0xfbe1e8[_0x0a78('0x30')],{'contact':_0xfbe1e8[_0x0a78('0x31')],'message':_0xfbe1e8[_0x0a78('0x20')],'agent':_0xfbe1e8[_0x0a78('0x32')],'interaction':_0xfbe1e8[_0x0a78('0x33')],'account':_0xfbe1e8['account']}))||'';}exports[_0x0a78('0x34')]=function(_0x334875,_0xca5a0){var _0x31d80d={};var _0x27b75d=_[_0x0a78('0x35')](db[_0x0a78('0x36')][_0x0a78('0x37')],function(_0x2d0718){return{'name':_0x2d0718[_0x0a78('0x38')],'type':_0x2d0718['type'][_0x0a78('0x39')]};});_0x31d80d=qs[_0x0a78('0x3a')](_0x27b75d,_0x334875);return interaction['findAll'](_0x0a78('0x3b'),_0x334875[_0x0a78('0x3c')],_0x334875['user'],_0x31d80d,_0x27b75d)[_0x0a78('0x2b')](respondWithFilteredResult(_0xca5a0,_0x31d80d))[_0x0a78('0x3d')](handleError(_0xca5a0,null));};exports[_0x0a78('0x3e')]=function(_0x3b5d15,_0x48379c){var _0x374c53={'raw':![],'where':{'id':_0x3b5d15['params']['id']}},_0x2daf98={};_0x2daf98[_0x0a78('0x3f')]=_['keys'](db[_0x0a78('0x36')][_0x0a78('0x37')]);_0x2daf98['query']=_['keys'](_0x3b5d15[_0x0a78('0x3c')]);_0x2daf98[_0x0a78('0x40')]=_[_0x0a78('0x41')](_0x2daf98[_0x0a78('0x3f')],_0x2daf98[_0x0a78('0x3c')]);_0x374c53[_0x0a78('0x42')]=_[_0x0a78('0x41')](_0x2daf98[_0x0a78('0x3f')],qs[_0x0a78('0x43')](_0x3b5d15['query']['fields']));_0x374c53[_0x0a78('0x42')]=_0x374c53[_0x0a78('0x42')][_0x0a78('0x44')]?_0x374c53[_0x0a78('0x42')]:_0x2daf98[_0x0a78('0x3f')];if(_0x3b5d15[_0x0a78('0x3c')][_0x0a78('0x45')]){_0x374c53[_0x0a78('0x46')]=[{'all':!![]}];}_0x374c53=_[_0x0a78('0x2f')]({},_0x374c53,_0x3b5d15['options']);return db[_0x0a78('0x36')][_0x0a78('0x47')](_0x374c53)[_0x0a78('0x2b')](handleEntityNotFound(_0x48379c,null))[_0x0a78('0x2b')](respondWithResult(_0x48379c,null))[_0x0a78('0x3d')](handleError(_0x48379c,null));};exports[_0x0a78('0x48')]=function(_0x79f6e4,_0x487df7){return db[_0x0a78('0x36')][_0x0a78('0x48')](_0x79f6e4[_0x0a78('0x30')],{})['then'](respondWithResult(_0x487df7,0xc9))[_0x0a78('0x3d')](handleError(_0x487df7,null));};exports[_0x0a78('0x2a')]=function(_0x4fd22a,_0x1a5636){if(_0x4fd22a[_0x0a78('0x30')]['id']){delete _0x4fd22a[_0x0a78('0x30')]['id'];}return db[_0x0a78('0x36')][_0x0a78('0x47')]({'where':{'id':_0x4fd22a[_0x0a78('0x49')]['id']}})[_0x0a78('0x2b')](handleEntityNotFound(_0x1a5636,null))[_0x0a78('0x2b')](saveUpdates(_0x4fd22a[_0x0a78('0x30')],null))[_0x0a78('0x2b')](respondWithResult(_0x1a5636,null))[_0x0a78('0x3d')](handleError(_0x1a5636,null));};exports['destroy']=function(_0x548710,_0x2cde81){return db['ChatInteraction'][_0x0a78('0x47')]({'where':{'id':_0x548710[_0x0a78('0x49')]['id']}})[_0x0a78('0x2b')](handleEntityNotFound(_0x2cde81,null))[_0x0a78('0x2b')](removeEntity(_0x2cde81,null))[_0x0a78('0x3d')](handleError(_0x2cde81,null));};exports[_0x0a78('0x4a')]=function(_0x1b1c60,_0x268756){return db[_0x0a78('0x36')][_0x0a78('0x4a')]()[_0x0a78('0x2b')](respondWithResult(_0x268756,null))[_0x0a78('0x3d')](handleError(_0x268756,null));};exports[_0x0a78('0x4b')]=function(_0x2382c2,_0x171569){var _0x339362=_0x2382c2[_0x0a78('0x49')]['id'];var _0x1447a9;var _0x3b38ae;var _0x47aae3;return db[_0x0a78('0x36')][_0x0a78('0x4c')]({'where':{'id':_0x339362}})[_0x0a78('0x2b')](function(_0x19ef68){_0x1447a9=_0x19ef68;return db[_0x0a78('0x4d')][_0x0a78('0x4c')]({'where':{'id':_0x19ef68[_0x0a78('0x4e')]},'attributes':['id',_0x0a78('0x4f'),_0x0a78('0x50'),_0x0a78('0x51'),_0x0a78('0x52'),_0x0a78('0x53')],'raw':!![]});})[_0x0a78('0x2b')](function(_0x31aa50){if(_0x31aa50&&_0x31aa50[_0x0a78('0x4f')]&&_0x31aa50[_0x0a78('0x50')]){_0x3b38ae=_0x31aa50;var _0x36c45e={'interaction':{'id':_0x339362},'agent':{'id':_0x2382c2[_0x0a78('0x54')]['id'],'name':_0x2382c2[_0x0a78('0x54')][_0x0a78('0x2d')],'fullname':_0x2382c2[_0x0a78('0x54')][_0x0a78('0x55')],'email':_0x2382c2[_0x0a78('0x54')][_0x0a78('0x56')]},'contact':_0x2382c2[_0x0a78('0x30')][_0x0a78('0x31')],'account':_0x2382c2[_0x0a78('0x30')][_0x0a78('0x57')]};var _0x1b6d62={'rejectUnauthorized':![],'method':_0x0a78('0x58'),'url':_0x0a78('0x59'),'headers':{'X-APIKEY':_0x31aa50[_0x0a78('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2382c2[_0x0a78('0x54')]['email']],'buttons':null,'topic':_0x3b38ae['vidaooTopic'],'note':_[_0x0a78('0x5a')](_0x3b38ae[_0x0a78('0x52')])?null:getMustacheRender(_0x3b38ae[_0x0a78('0x52')],_0x36c45e),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x0a78('0x5a')](_0x3b38ae[_0x0a78('0x53')])){var _0x425176=getMustacheRender(_0x3b38ae[_0x0a78('0x53')],_0x36c45e);var _0x45ea86=JSON[_0x0a78('0x5b')](_0x425176);_0x1b6d62[_0x0a78('0x30')][_0x0a78('0x5c')]=_0x45ea86;}}catch(_0x373b4b){throw new db['Sequelize'][(_0x0a78('0x5d'))](_0x0a78('0x5e'));}return rp(_0x1b6d62);}else{throw new db[(_0x0a78('0x5f'))]['ValidationError'](_0x0a78('0x60'));}})[_0x0a78('0x2b')](function(_0x4d7233){_0x47aae3=_0x4d7233;if(_0x47aae3['id']){var _0xeb2dae={'body':_0x47aae3[_0x0a78('0x61')],'ChatWebsiteId':_0x3b38ae['id'],'ChatInteractionId':_0x1447a9['id'],'direction':'out','UserId':_0x2382c2[_0x0a78('0x54')]['id']};return db[_0x0a78('0x62')][_0x0a78('0x48')](_0xeb2dae,{});}else{throw new db['Sequelize'][(_0x0a78('0x5d'))](_0x0a78('0x63'));}})['then'](function(){return _0x1447a9[_0x0a78('0x64')]({'vidaooSessionId':_0x47aae3['id']});})[_0x0a78('0x2b')](respondWithResult(_0x171569,null))[_0x0a78('0x3d')](handleError(_0x171569,null));};exports[_0x0a78('0x65')]=function(_0x284c02,_0x36836c){if(_0x284c02[_0x0a78('0x30')]['id']){delete _0x284c02[_0x0a78('0x30')]['id'];}return db[_0x0a78('0x36')]['find']({'where':{'id':_0x284c02['params']['id']},'include':[{'model':db[_0x0a78('0x66')],'as':'Contact'}]})[_0x0a78('0x2b')](handleEntityNotFound(_0x36836c,null))['then'](saveUpdates(_0x284c02['body'],null))[_0x0a78('0x2b')](respondWithResult(_0x36836c,null))[_0x0a78('0x3d')](handleError(_0x36836c,null));};exports[_0x0a78('0x67')]=function(_0x343b2e,_0x3beb65){if(_0x343b2e[_0x0a78('0x30')]['id']){delete _0x343b2e[_0x0a78('0x30')]['id'];}return db[_0x0a78('0x36')][_0x0a78('0x47')]({'where':{'id':_0x343b2e[_0x0a78('0x49')]['id']}})[_0x0a78('0x2b')](function(_0x4614ec){if(!_0x4614ec){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x0a78('0x67'),0x194,'entity\x20not\x20found');_0x3beb65[_0x0a78('0x22')](0x194);}else{if(_0x4614ec['UserId']){throw new db[(_0x0a78('0x5f'))][(_0x0a78('0x5d'))](_0x0a78('0x68'));}}return _0x4614ec;})['then'](function(_0x221ab7){if(_0x221ab7){return _0x221ab7[_0x0a78('0x2a')]({'closed':_0x343b2e[_0x0a78('0x30')]['closed'],'disposition':_0x343b2e['body'][_0x0a78('0x69')]})['then'](function(_0x19878f){return _0x19878f;});}})[_0x0a78('0x2b')](function(){return respondWithRpcPromise(_0x0a78('0x6a'),_0x0a78('0x67'),_0x343b2e[_0x0a78('0x30')],client9004);})[_0x0a78('0x2b')](respondWithResult(_0x3beb65,null))['catch'](handleError(_0x3beb65,null));};exports['attachmentUpload']=function(_0x46f87e,_0x4b3f3a){_0x46f87e[_0x0a78('0x30')][_0x0a78('0x2d')]=_0x46f87e[_0x0a78('0x6b')]['originalname'];_0x46f87e[_0x0a78('0x30')][_0x0a78('0x6c')]=_0x46f87e[_0x0a78('0x6b')][_0x0a78('0x6d')];_0x46f87e[_0x0a78('0x30')][_0x0a78('0x6e')]=_0x46f87e[_0x0a78('0x6b')][_0x0a78('0x6f')];return db['Attachment'][_0x0a78('0x48')](_0x46f87e['body'])[_0x0a78('0x2b')](respondWithResult(_0x4b3f3a,0xc9))['catch'](handleError(_0x4b3f3a,null));};exports['attachmentDownload']=function(_0x4809a4,_0x2bcae5){return db[_0x0a78('0x36')][_0x0a78('0x4c')]({'where':{'id':_0x4809a4['params']['id']},'raw':!![]})[_0x0a78('0x2b')](handleEntityNotFound(_0x2bcae5,null))[_0x0a78('0x2b')](function(_0x442365){if(_0x442365){if(_0x442365[_0x0a78('0x70')]){return _0x2bcae5[_0x0a78('0x23')](0x193)['json']({'status':0x193,'message':_0x0a78('0x71')});}return db[_0x0a78('0x72')][_0x0a78('0x4c')]({'where':{'id':_0x4809a4[_0x0a78('0x3c')][_0x0a78('0x73')]},'raw':!![]})[_0x0a78('0x2b')](handleEntityNotFound(_0x2bcae5,null));}})[_0x0a78('0x2b')](function(_0xfb6097){if(_0xfb6097){var _0x2b9771=_0xfb6097['ChatOfflineMessageId']!==null;var _0x50cef0=path[_0x0a78('0x74')](config[_0x0a78('0x75')],_0x0a78('0x76'));if(_0x2b9771){_0x50cef0=path[_0x0a78('0x74')](_0x50cef0,_0x0a78('0x77'));}var _0x2a6e11=path[_0x0a78('0x74')](_0x50cef0,_0xfb6097[_0x0a78('0x6c')]);return _0x2bcae5['download'](_0x2a6e11);}})[_0x0a78('0x3d')](handleError(_0x2bcae5,null));};exports[_0x0a78('0x78')]=function(_0x346bab,_0x38f833){var _0x355340=null;var _0x142d83=null;var _0xab7558=null;if(_0x346bab[_0x0a78('0x30')]['id']){delete _0x346bab['body']['id'];}if(_0x346bab['body'][_0x0a78('0x79')]){_0xab7558=path[_0x0a78('0x74')](config[_0x0a78('0x75')],_0x0a78('0x7a'),util[_0x0a78('0x7b')](_0x0a78('0x7c'),Date[_0x0a78('0x7d')]()));_0x346bab['body']['pathTranscript']=_0xab7558;}return db[_0x0a78('0x36')]['find']({'where':{'id':_0x346bab[_0x0a78('0x49')]['id']},'include':[{'model':db[_0x0a78('0x62')],'as':_0x0a78('0x7e'),'include':[{'model':db[_0x0a78('0x7f')],'as':_0x0a78('0x7f')}]}]})[_0x0a78('0x2b')](handleEntityNotFound(_0x38f833,null))[_0x0a78('0x2b')](saveUpdates(_0x346bab[_0x0a78('0x30')],null))['then'](function(_0x3861ed){if(_0x3861ed){_0x355340=_0x3861ed;return db[_0x0a78('0x4d')]['find']({'where':{'id':_0x355340[_0x0a78('0x4e')]}});}})['then'](function(_0x4fab2d){if(_0x4fab2d){_0x142d83=_0x4fab2d;return db['CmContact'][_0x0a78('0x47')]({'where':{'id':_0x355340['ContactId']}});}})[_0x0a78('0x2b')](function(_0x45ad28){if(_0x45ad28){if(_0xab7558){var _0x1d2c08=null;for(var _0x26ecb0=0x1;_0x26ecb0<_0x355340['Messages'][_0x0a78('0x44')];++_0x26ecb0){_0x1d2c08=_0x355340[_0x0a78('0x7e')][_0x26ecb0];var _0x24540d=_0x1d2c08['UserId']?util[_0x0a78('0x7b')]('%s%d',_0x142d83[_0x0a78('0x80')],_0x1d2c08['UserId']):_0x0a78('0x81');var _0x40224c=_0x346bab['body'][_0x0a78('0x82')]||util[_0x0a78('0x7b')](_0x0a78('0x83'),'Visitor',_0x1d2c08[_0x0a78('0x84')]);switch(_0x142d83[_0x0a78('0x85')]){case _0x0a78('0x86'):_0x24540d=_0x1d2c08['UserId']?util[_0x0a78('0x7b')]('%s%d',_0x142d83[_0x0a78('0x80')],_0x1d2c08['UserId']):_0x0a78('0x81');break;case _0x0a78('0x87'):_0x24540d=_0x1d2c08[_0x0a78('0x88')]?_0x1d2c08['User'][_0x0a78('0x89')]||_0x1d2c08[_0x0a78('0x7f')]['fullname']:_0x0a78('0x81');break;case _0x0a78('0x8a'):_0x24540d=_0x1d2c08[_0x0a78('0x88')]?_0x1d2c08[_0x0a78('0x7f')][_0x0a78('0x55')]:'System';break;default:_0x24540d=_0x1d2c08[_0x0a78('0x88')]?util['format'](_0x0a78('0x83'),_0x142d83['agentAlias'],_0x1d2c08['UserId']):_0x0a78('0x81');}var _0x2f04fe=util[_0x0a78('0x7b')](_0x0a78('0x8b'),moment(_0x1d2c08[_0x0a78('0x8c')])[_0x0a78('0x7b')]('MM/DD/YYYY\x20HH:mm:ss'),_0x1d2c08[_0x0a78('0x8d')]==='in'?_0x40224c:_0x24540d,_0x1d2c08['body']);if(!_0x1d2c08['secret']){fs[_0x0a78('0x8e')](_0xab7558,_0x2f04fe);}}return db['MailAccount'][_0x0a78('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0x0a78('0x8f')],'as':_0x0a78('0x90'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x0a78('0x91'),'raw':!![]}]}]});}}})[_0x0a78('0x2b')](function(_0x14fa4b){if(!_0x14fa4b||!_0x14fa4b['Smtp']||!_0x346bab[_0x0a78('0x30')])return _0x355340;var _0x4cfd76=_0x14fa4b[_0x0a78('0x92')]();return respondWithRpcPromise(_0x0a78('0x93'),_0x0a78('0x94'),{'account':_0x4cfd76,'message':{'from':util[_0x0a78('0x7b')](_0x0a78('0x95'),_0x14fa4b['name'],_0x14fa4b[_0x0a78('0x56')]||_0x14fa4b[_0x0a78('0x90')][_0x0a78('0x54')]),'to':_0x346bab['body'][_0x0a78('0x79')],'subject':_0x0a78('0x96'),'text':util[_0x0a78('0x7b')](_0x0a78('0x97'),_0x346bab[_0x0a78('0x30')][_0x0a78('0x79')]),'attachments':[{'path':_0xab7558}]}})['then'](function(){return _0x355340;})[_0x0a78('0x3d')](function(_0x224ef3){logger[_0x0a78('0x1e')](_0x224ef3);});})[_0x0a78('0x2b')](respondWithStatusCode(_0x38f833,0xc8))['catch'](handleError(_0x38f833,null));};exports[_0x0a78('0x98')]=function(_0xf0cc0c,_0x30c54d){return db[_0x0a78('0x62')][_0x0a78('0x47')]({'where':{'id':_0xf0cc0c[_0x0a78('0x49')]['id']}})['then'](handleEntityNotFound(_0x30c54d,null))[_0x0a78('0x2b')](function(_0x1b754d){if(_0x1b754d){return _0x1b754d[_0x0a78('0x98')](_0xf0cc0c[_0x0a78('0x30')][_0x0a78('0x99')],_[_0x0a78('0x9a')](_0xf0cc0c[_0x0a78('0x30')],[_0x0a78('0x99'),'id'])||{});}})['then'](respondWithResult(_0x30c54d,null))[_0x0a78('0x3d')](handleError(_0x30c54d,null));};exports['getMessages']=function(_0x5ef0f4,_0xdfc100){var _0x59f4ee={'raw':![],'where':{}};var _0x49582f={};var _0x53e003={'count':0x0,'rows':[]};return db[_0x0a78('0x36')][_0x0a78('0x4c')]({'where':{'id':_0x5ef0f4['params']['id']}})[_0x0a78('0x2b')](handleEntityNotFound(_0xdfc100,null))[_0x0a78('0x2b')](function(_0x35e378){if(_0x35e378){_0x49582f[_0x0a78('0x3f')]=_[_0x0a78('0x9b')](db[_0x0a78('0x62')][_0x0a78('0x37')]);_0x49582f[_0x0a78('0x3c')]=_['keys'](_0x5ef0f4[_0x0a78('0x3c')]);_0x49582f[_0x0a78('0x40')]=_[_0x0a78('0x41')](_0x49582f['model'],_0x49582f[_0x0a78('0x3c')]);_0x59f4ee['attributes']=_[_0x0a78('0x41')](_0x49582f[_0x0a78('0x3f')],qs[_0x0a78('0x43')](_0x5ef0f4[_0x0a78('0x3c')][_0x0a78('0x43')]));_0x59f4ee['attributes']=_0x59f4ee[_0x0a78('0x42')][_0x0a78('0x44')]?_0x59f4ee[_0x0a78('0x42')]:_0x49582f[_0x0a78('0x3f')];if(!_0x5ef0f4[_0x0a78('0x3c')][_0x0a78('0x9c')](_0x0a78('0x9d'))){_0x59f4ee[_0x0a78('0x27')]=qs[_0x0a78('0x27')](_0x5ef0f4[_0x0a78('0x3c')][_0x0a78('0x27')]);_0x59f4ee[_0x0a78('0x26')]=qs[_0x0a78('0x26')](_0x5ef0f4[_0x0a78('0x3c')]['offset']);}_0x59f4ee[_0x0a78('0x9e')]=qs[_0x0a78('0x9f')](_0x5ef0f4['query']['sort']);_0x59f4ee[_0x0a78('0xa0')]=qs[_0x0a78('0x40')](_[_0x0a78('0xa1')](_0x5ef0f4[_0x0a78('0x3c')],_0x49582f[_0x0a78('0x40')]));_0x59f4ee['where'][_0x0a78('0xa2')]=_0x35e378['id'];if(_0x5ef0f4[_0x0a78('0x3c')][_0x0a78('0xa3')]){_0x59f4ee[_0x0a78('0xa0')]=_[_0x0a78('0x2f')](_0x59f4ee[_0x0a78('0xa0')],{'$or':_[_0x0a78('0x35')](_0x59f4ee[_0x0a78('0x42')],function(_0x265b63){var _0x2035f9={};_0x2035f9[_0x265b63]={'$like':'%'+_0x5ef0f4[_0x0a78('0x3c')][_0x0a78('0xa3')]+'%'};return _0x2035f9;})});}if(_0x5ef0f4[_0x0a78('0x3c')]['$gte']){var _0x22a2de=_0x5ef0f4['query'][_0x0a78('0xa4')]['split'](',');var _0x290c13={};_0x290c13[_0x22a2de[0x0]]={'$gte':moment(_0x22a2de[0x1])[_0x0a78('0x7b')](_0x0a78('0xa5'))};_0x59f4ee[_0x0a78('0xa0')]=_[_0x0a78('0x2f')](_0x59f4ee[_0x0a78('0xa0')],_0x290c13);}_0x59f4ee=_[_0x0a78('0x2f')]({},_0x59f4ee,_0x5ef0f4[_0x0a78('0xa6')]);return db['ChatMessage'][_0x0a78('0xa7')]({'where':_0x59f4ee['where']})[_0x0a78('0x2b')](function(_0x54b124){_0x53e003['count']=_0x54b124;if(_0x5ef0f4[_0x0a78('0x3c')][_0x0a78('0x45')]){_0x59f4ee['include']=[{'all':!![]}];}return db[_0x0a78('0x62')][_0x0a78('0xa8')](_0x59f4ee);})['then'](function(_0x30c74f){_0x53e003[_0x0a78('0xa9')]=_0x30c74f;return _0x53e003;});}})['then'](respondWithFilteredResult(_0xdfc100,_0x59f4ee))[_0x0a78('0x3d')](handleError(_0xdfc100,null));};exports[_0x0a78('0xaa')]=function(_0xc90436,_0x16b65c){var _0x4f9f87={'where':{}},_0x127764={},_0x3c9767={'count':0x0,'rows':[]};return db[_0x0a78('0x36')]['findOne']({'where':{'id':_0xc90436[_0x0a78('0x49')]['id']}})[_0x0a78('0x2b')](handleEntityNotFound(_0x16b65c,null))[_0x0a78('0x2b')](function(_0x26add9){if(_0x26add9){_0x127764[_0x0a78('0x3f')]=_[_0x0a78('0x9b')](db['ChatMessage'][_0x0a78('0x37')]);_0x127764[_0x0a78('0x3c')]=_[_0x0a78('0x9b')](_0xc90436[_0x0a78('0x3c')]);_0x127764[_0x0a78('0x40')]=_[_0x0a78('0x41')](_0x127764['model'],_0x127764[_0x0a78('0x3c')]);_0x4f9f87[_0x0a78('0x42')]=_[_0x0a78('0x41')](_0x127764[_0x0a78('0x3f')],qs[_0x0a78('0x43')](_0xc90436['query'][_0x0a78('0x43')]));_0x4f9f87[_0x0a78('0x42')]=_0x4f9f87[_0x0a78('0x42')][_0x0a78('0x44')]?_0x4f9f87[_0x0a78('0x42')]:_0x127764[_0x0a78('0x3f')];if(!_0xc90436[_0x0a78('0x3c')][_0x0a78('0x9c')]('nolimit')){_0x4f9f87[_0x0a78('0x27')]=qs[_0x0a78('0x27')](_0xc90436['query'][_0x0a78('0x27')]);_0x4f9f87['offset']=qs['offset'](_0xc90436[_0x0a78('0x3c')]['offset']);}_0x4f9f87['order']=qs[_0x0a78('0x9f')](_0xc90436['query'][_0x0a78('0x9f')]);_0x4f9f87[_0x0a78('0xa0')]=qs[_0x0a78('0x40')](_['pick'](_0xc90436[_0x0a78('0x3c')],_0x127764['filters']));_0x4f9f87[_0x0a78('0xa0')][_0x0a78('0xa2')]=_0x26add9['id'];if(_0xc90436[_0x0a78('0x3c')][_0x0a78('0xa3')]){_0x4f9f87[_0x0a78('0xa0')]=_[_0x0a78('0x2f')](_0x4f9f87['where'],{'$or':_['map'](_0x4f9f87[_0x0a78('0x42')],function(_0x457309){var _0x4b1e94={};_0x4b1e94[_0x457309]={'$like':'%'+_0xc90436[_0x0a78('0x3c')][_0x0a78('0xa3')]+'%'};return _0x4b1e94;})});}_0x4f9f87[_0x0a78('0xa0')][_0x0a78('0xab')]=![];if(_0xc90436[_0x0a78('0x3c')]['id']){_0x4f9f87[_0x0a78('0xa0')]['id']={'$gt':_0xc90436[_0x0a78('0x3c')]['id']};}_0x4f9f87=_[_0x0a78('0x2f')]({},_0x4f9f87,_0xc90436[_0x0a78('0xa6')]);return db['ChatMessage'][_0x0a78('0xa7')]({'where':_0x4f9f87[_0x0a78('0xa0')]})[_0x0a78('0x2b')](function(_0x23c00b){_0x3c9767[_0x0a78('0xa7')]=_0x23c00b;_0x4f9f87['include']=[];if(_0xc90436[_0x0a78('0x3c')][_0x0a78('0xac')]){_0x4f9f87['include']['push']({'model':db['User'],'as':_0x0a78('0x7f'),'attributes':['id','fullname',_0x0a78('0x89')]});}if(_0xc90436[_0x0a78('0x3c')][_0x0a78('0x45')]){_0x4f9f87[_0x0a78('0x46')]=[{'all':!![]}];}return db['ChatMessage'][_0x0a78('0xa8')](_0x4f9f87);})[_0x0a78('0x2b')](function(_0x4c414a){_0x3c9767[_0x0a78('0xa9')]=_0x4c414a;return _0x3c9767;});}})['then'](respondWithFilteredResult(_0x16b65c,_0x4f9f87))[_0x0a78('0x3d')](handleError(_0x16b65c,null));};exports['addTags']=function(_0x79f8c1,_0xbb045e){return db['ChatInteraction'][_0x0a78('0x47')]({'where':{'id':_0x79f8c1[_0x0a78('0x49')]['id']}})['then'](handleEntityNotFound(_0xbb045e,null))[_0x0a78('0x2b')](function(_0x371be2){if(_0x371be2){return _0x371be2[_0x0a78('0xad')](_0x79f8c1[_0x0a78('0x30')]['ids'],_[_0x0a78('0x9a')](_0x79f8c1[_0x0a78('0x30')],[_0x0a78('0x99'),'id'])||{})[_0x0a78('0xae')](function(){return db[_0x0a78('0xaf')][_0x0a78('0xa8')]({'attributes':['id',_0x0a78('0x2d'),_0x0a78('0xb0')],'where':{'id':_0x79f8c1[_0x0a78('0x30')][_0x0a78('0x99')]}});})['then'](function(_0x57a93f){socket['emit'](_0x0a78('0xb1'),{'id':Number(_0x79f8c1['params']['id']),'tags':_0x57a93f||[]});return{'id':Number(_0x79f8c1[_0x0a78('0x49')]['id']),'tags':_0x57a93f||[]};});}})['then'](respondWithResult(_0xbb045e,null))[_0x0a78('0x3d')](handleError(_0xbb045e,null));};exports[_0x0a78('0xb2')]=function(_0x45ddb0,_0x129853){return db[_0x0a78('0x36')][_0x0a78('0x47')]({'where':{'id':_0x45ddb0[_0x0a78('0x49')]['id']}})['then'](handleEntityNotFound(_0x129853,null))['then'](function(_0x4d69ce){if(_0x4d69ce){return _0x4d69ce['removeTags'](_0x45ddb0[_0x0a78('0x3c')]['ids']);}})[_0x0a78('0x2b')](respondWithStatusCode(_0x129853,null))[_0x0a78('0x3d')](handleError(_0x129853,null));};exports['download']=function(_0x5b54b1,_0x540d50){var _0x40cf1d=moment()[_0x0a78('0xb3')]()['toString']();var _0x55e139=path[_0x0a78('0x74')](config[_0x0a78('0x75')],_0x0a78('0xb4'),_0x0a78('0xb5'),_0x0a78('0xb6'));var _0x23ec2b=path[_0x0a78('0x74')](config[_0x0a78('0x75')],_0x0a78('0xb4'),_0x0a78('0xb5'),'attachments');var _0x58b32f=path[_0x0a78('0x74')](_0x55e139,_0x40cf1d);var _0x338acb=util[_0x0a78('0x7b')]('transcript-%d-%s.zip',_0x5b54b1[_0x0a78('0x49')]['id'],_0x40cf1d);var _0x53ac51=path[_0x0a78('0x74')](_0x55e139,_0x338acb);var _0x5ed7d1=[];_0x5ed7d1[_0x0a78('0xb7')]({'model':db[_0x0a78('0x7f')],'as':_0x0a78('0x7f'),'attributes':['id','fullname'],'raw':!![]});_0x5ed7d1[_0x0a78('0xb7')]({'model':db['CmContact'],'as':_0x0a78('0xb8'),'attributes':['id','firstName',_0x0a78('0xb9')],'raw':!![]});if(_0x5b54b1['query'][_0x0a78('0xba')]){_0x5ed7d1[_0x0a78('0xb7')]({'model':db['Attachment'],'as':_0x0a78('0x72'),'raw':!![]});}var _0x3679cd=[{'model':db[_0x0a78('0x62')],'as':_0x0a78('0x7e'),'attributes':['id',_0x0a78('0x30'),_0x0a78('0x8c'),'direction','secret',_0x0a78('0xbb')],'include':_0x5ed7d1}];_0x3679cd[_0x0a78('0xb7')]({'model':db['ChatWebsite'],'as':_0x0a78('0xbc'),'attributes':['id','name']});_0x3679cd[_0x0a78('0xb7')]({'model':db[_0x0a78('0x7f')],'as':_0x0a78('0xbd'),'attributes':['id',_0x0a78('0x55')]});return db[_0x0a78('0x36')][_0x0a78('0x47')]({'where':{'id':_0x5b54b1[_0x0a78('0x49')]['id']},'include':_0x3679cd})[_0x0a78('0x2b')](handleEntityNotFound(_0x540d50,null))[_0x0a78('0x2b')](function(_0x13eacd){if(_0x13eacd){var _0x54b6bc=_0x13eacd[_0x0a78('0xbe')]({'plain':!![]});fs['mkdirSync'](_0x58b32f);var _0x75ee00={'channel':_0x0a78('0xbf'),'account':_0x54b6bc[_0x0a78('0xbc')][_0x0a78('0x2d')],'agent':_0x54b6bc['Owner']?_0x54b6bc[_0x0a78('0xbd')][_0x0a78('0x55')]:_0x0a78('0xc0'),'createdAt':moment(_0x54b6bc[_0x0a78('0x8c')])[_0x0a78('0x7b')](_0x0a78('0xa5'))[_0x0a78('0xc1')](),'closedAt':_0x54b6bc[_0x0a78('0x70')]?moment(_0x54b6bc[_0x0a78('0xc2')])[_0x0a78('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x54b6bc[_0x0a78('0x69')],'chatInfo':{'browser':_0x54b6bc[_0x0a78('0xc3')],'os':_0x54b6bc[_0x0a78('0xc4')],'referer':_0x54b6bc['referer'],'customerIp':_0x54b6bc['customerIp'],'customerPort':_0x54b6bc['customerPort']?_0x54b6bc[_0x0a78('0xc5')]:_0x0a78('0xc0')},'messages':_(_0x54b6bc[_0x0a78('0x7e')])[_0x0a78('0xc6')]()[_0x0a78('0xa3')]({'secret':![]})[_0x0a78('0x35')](function(_0x569c96){if(_0x569c96[_0x0a78('0x72')]){var _0x398cc2=path[_0x0a78('0x74')](_0x23ec2b,_0x569c96[_0x0a78('0x72')]['basename']);if(fs[_0x0a78('0xc7')](_0x398cc2)){fs[_0x0a78('0xc8')](_0x398cc2)[_0x0a78('0xc9')](fs['createWriteStream'](path[_0x0a78('0x74')](_0x58b32f,_0x569c96['Attachment'][_0x0a78('0x6c')])));}}return{'date':moment(_0x569c96[_0x0a78('0x8c')])[_0x0a78('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0a78('0xc1')](),'sender':_0x569c96['direction']===_0x0a78('0xca')?_0x569c96[_0x0a78('0x7f')]?_0x569c96[_0x0a78('0x7f')]['fullname']:_0x0a78('0x81'):_0x569c96[_0x0a78('0xb8')][_0x0a78('0xcb')]+(_0x569c96['Contact'][_0x0a78('0xb9')]?'\x20'+_0x569c96[_0x0a78('0xb8')]['lastName']:''),'body':_0x569c96[_0x0a78('0x72')]?_0x569c96['Attachment'][_0x0a78('0x6c')]:_0x569c96[_0x0a78('0x30')],'direction':_0x569c96[_0x0a78('0x8d')]===_0x0a78('0xca')?'A':'C','secret':_0x569c96[_0x0a78('0xab')],'read':_0x569c96[_0x0a78('0xbb')],'attachment':_0x569c96[_0x0a78('0x72')]};})[_0x0a78('0xcc')]()};return ejs[_0x0a78('0xcd')](path[_0x0a78('0x74')](config[_0x0a78('0x75')],_0x0a78('0xb4'),'views',_0x0a78('0xce')),{'interaction':_0x75ee00})['then'](function(_0x4625b4){var _0x55d269=path[_0x0a78('0x74')](_0x58b32f,_0x0a78('0xcf')+_0x54b6bc['id']+'-'+_0x40cf1d+_0x0a78('0xd0'));var _0x4c6f04={'path':_0x55d269,'channel':'Chat','interactionId':_0x54b6bc['id']};return pdf[_0x0a78('0xd1')](_0x4625b4,_0x4c6f04);})[_0x0a78('0x2b')](function(){return new Promise(function(_0x5202a5,_0x16faa1){zipdir(_0x58b32f,{'saveTo':_0x53ac51},function(_0x139925,_0x92e198){if(_0x139925)return _0x16faa1(_0x139925);return _0x5202a5(_0x92e198);});})[_0x0a78('0x2b')](function(){return new BPromise(function(_0x2273fe,_0x3b4f2b){rimraf(_0x58b32f,function(_0x2707bb){if(_0x2707bb)_0x3b4f2b(_0x2707bb);return _0x2273fe();});});})[_0x0a78('0x2b')](function(){return _0x540d50[_0x0a78('0xd2')](_0x53ac51,_0x338acb,function(_0x337a2c){if(_0x337a2c){logger[_0x0a78('0x1e')](_0x0a78('0xd3'),_0x337a2c);}else{fs[_0x0a78('0xd4')](_0x53ac51);}});});});}else{return _0x540d50[_0x0a78('0x22')](0xc8);}})[_0x0a78('0x3d')](handleError(_0x540d50,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 77cb826..bac8e5e 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 _0x1205=['unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','update','remove','then','setDataValue'];(function(_0x5bf80a,_0xf41282){var _0x3d9ee6=function(_0x5f111a){while(--_0x5f111a){_0x5bf80a['push'](_0x5bf80a['shift']());}};_0x3d9ee6(++_0xf41282);}(_0x1205,0x1f4));var _0x5120=function(_0x36252e,_0x15448e){_0x36252e=_0x36252e-0x0;var _0x36b7e4=_0x1205[_0x36252e];return _0x36b7e4;};'use strict';var EventEmitter=require(_0x5120('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x5120('0x1')];var ChatMessage=require(_0x5120('0x2'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5120('0x3'),'afterDestroy':_0x5120('0x4')};function emitEvent(_0x39beec){return function(_0x3ba0e6,_0x2f0358,_0x5ea69a){_0x3ba0e6['getUsers']({'attributes':['id'],'raw':!![]})[_0x5120('0x5')](function(_0x924086){_0x3ba0e6[_0x5120('0x6')]('Users',_0x924086['map'](function(_0x14df65){return{'id':_0x14df65['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3ba0e6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5120('0x5')](function(_0x3a58e4){_0x3ba0e6[_0x5120('0x6')](_0x5120('0x7'),_0x3a58e4['length']);ChatInteractionEvents[_0x5120('0x8')](_0x39beec+':'+_0x3ba0e6['id'],_0x3ba0e6);ChatInteractionEvents[_0x5120('0x8')](_0x39beec,_0x3ba0e6);_0x5ea69a(null);})[_0x5120('0x9')](_0x5ea69a(null));};}for(var e in events){if(events[_0x5120('0xa')](e)){var event=events[e];ChatInteraction[_0x5120('0xb')](e,emitEvent(event));}}module[_0x5120('0xc')]=ChatInteractionEvents; \ No newline at end of file +var _0xd3a7=['events','../../mysqldb','ChatInteraction','setMaxListeners','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x5ab832,_0x62d3b5){var _0x2d3fbe=function(_0x2d9dd9){while(--_0x2d9dd9){_0x5ab832['push'](_0x5ab832['shift']());}};_0x2d3fbe(++_0x62d3b5);}(_0xd3a7,0x1b5));var _0x7d3a=function(_0x1c4e11,_0x3af035){_0x1c4e11=_0x1c4e11-0x0;var _0x4ee8b=_0xd3a7[_0x1c4e11];return _0x4ee8b;};'use strict';var EventEmitter=require(_0x7d3a('0x0'));var ChatInteraction=require(_0x7d3a('0x1'))['db'][_0x7d3a('0x2')];var ChatMessage=require(_0x7d3a('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x7d3a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7d3a('0x4'),'afterDestroy':_0x7d3a('0x5')};function emitEvent(_0x4e364c){return function(_0x58b7aa,_0x244f42,_0x32e703){_0x58b7aa[_0x7d3a('0x6')]({'attributes':['id'],'raw':!![]})[_0x7d3a('0x7')](function(_0x78ec14){_0x58b7aa['setDataValue'](_0x7d3a('0x8'),_0x78ec14[_0x7d3a('0x9')](function(_0x291750){return{'id':_0x291750['id']};}));return ChatMessage[_0x7d3a('0xa')]({'where':{'ChatInteractionId':_0x58b7aa['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7d3a('0x7')](function(_0x5d5109){_0x58b7aa[_0x7d3a('0xb')](_0x7d3a('0xc'),_0x5d5109[_0x7d3a('0xd')]);ChatInteractionEvents[_0x7d3a('0xe')](_0x4e364c+':'+_0x58b7aa['id'],_0x58b7aa);ChatInteractionEvents[_0x7d3a('0xe')](_0x4e364c,_0x58b7aa);_0x32e703(null);})[_0x7d3a('0xf')](_0x32e703(null));};}for(var e in events){if(events[_0x7d3a('0x10')](e)){var event=events[e];ChatInteraction[_0x7d3a('0x11')](e,emitEvent(event));}}module[_0x7d3a('0x12')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index e796e47..f39295a 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 _0x7e1a=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes'];(function(_0x596ce7,_0x493098){var _0x406e6d=function(_0x1dc160){while(--_0x1dc160){_0x596ce7['push'](_0x596ce7['shift']());}};_0x406e6d(++_0x493098);}(_0x7e1a,0x106));var _0xa7e1=function(_0x4975ed,_0x390b86){_0x4975ed=_0x4975ed-0x0;var _0x3986d0=_0x7e1a[_0x4975ed];return _0x3986d0;};'use strict';var _=require(_0xa7e1('0x0'));var util=require(_0xa7e1('0x1'));var logger=require('../../config/logger')(_0xa7e1('0x2'));var moment=require(_0xa7e1('0x3'));var BPromise=require(_0xa7e1('0x4'));var rp=require(_0xa7e1('0x5'));var fs=require('fs');var path=require(_0xa7e1('0x6'));var rimraf=require(_0xa7e1('0x7'));var config=require(_0xa7e1('0x8'));var attributes=require(_0xa7e1('0x9'));module['exports']=function(_0x325266,_0x42165c){return _0x325266['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b2ef0,_0xeda455,_0xfa5622){if(_0x1b2ef0['changed'](_0xa7e1('0xa'))){_0x1b2ef0[_0xa7e1('0xb')]=moment()[_0xa7e1('0xc')](_0xa7e1('0xd'));}_0xfa5622(null,_0x1b2ef0);}},'charset':_0xa7e1('0xe'),'collate':_0xa7e1('0xf')});}; \ No newline at end of file +var _0x3294=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x14b8c7,_0x4839ea){var _0x4bb5a3=function(_0x17cf53){while(--_0x17cf53){_0x14b8c7['push'](_0x14b8c7['shift']());}};_0x4bb5a3(++_0x4839ea);}(_0x3294,0x190));var _0x4329=function(_0x1d9124,_0x170c23){_0x1d9124=_0x1d9124-0x0;var _0x540366=_0x3294[_0x1d9124];return _0x540366;};'use strict';var _=require(_0x4329('0x0'));var util=require(_0x4329('0x1'));var logger=require(_0x4329('0x2'))('api');var moment=require(_0x4329('0x3'));var BPromise=require('bluebird');var rp=require(_0x4329('0x4'));var fs=require('fs');var path=require(_0x4329('0x5'));var rimraf=require(_0x4329('0x6'));var config=require(_0x4329('0x7'));var attributes=require(_0x4329('0x8'));module['exports']=function(_0x4b93ec,_0x28328b){return _0x4b93ec[_0x4329('0x9')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a34c0,_0x44fa10,_0x42cbb5){if(_0x2a34c0[_0x4329('0xa')](_0x4329('0xb'))){_0x2a34c0[_0x4329('0xc')]=moment()['format'](_0x4329('0xd'));}_0x42cbb5(null,_0x2a34c0);}},'charset':_0x4329('0xe'),'collate':_0x4329('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 9ad2ac5..92f0099 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 _0xda67=['message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x248a21,_0x27a27f){var _0x3f1b26=function(_0x5f57c2){while(--_0x5f57c2){_0x248a21['push'](_0x248a21['shift']());}};_0x3f1b26(++_0x27a27f);}(_0xda67,0xee));var _0x7da6=function(_0x5dca66,_0x11ac16){_0x5dca66=_0x5dca66-0x0;var _0x1107a2=_0xda67[_0x5dca66];return _0x1107a2;};'use strict';var _=require('lodash');var util=require(_0x7da6('0x0'));var moment=require(_0x7da6('0x1'));var BPromise=require(_0x7da6('0x2'));var rs=require(_0x7da6('0x3'));var fs=require('fs');var Redis=require(_0x7da6('0x4'));var db=require(_0x7da6('0x5'))['db'];var utils=require(_0x7da6('0x6'));var logger=require(_0x7da6('0x7'))(_0x7da6('0x8'));var config=require(_0x7da6('0x9'));var jayson=require(_0x7da6('0xa'));var client=jayson[_0x7da6('0xb')][_0x7da6('0xc')]({'port':0x232a});config[_0x7da6('0xd')]=_[_0x7da6('0xe')](config[_0x7da6('0xd')],{'host':_0x7da6('0xf'),'port':0x18eb});var socket=require(_0x7da6('0x10'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x7da6('0x11')](socket);function respondWithRpcPromise(_0xba022,_0x42b8d9,_0x414ee7){return new BPromise(function(_0x5be447,_0x42a651){return client['request'](_0xba022,_0x414ee7)[_0x7da6('0x12')](function(_0x403b77){logger[_0x7da6('0x13')](_0x7da6('0x14'),_0x42b8d9,_0x7da6('0x15'));logger[_0x7da6('0x16')](_0x7da6('0x17'),_0x42b8d9,'request\x20sent',JSON[_0x7da6('0x18')](_0x403b77));if(_0x403b77[_0x7da6('0x19')]){if(_0x403b77[_0x7da6('0x19')]['code']===0x1f4){logger[_0x7da6('0x19')](_0x7da6('0x14'),_0x42b8d9,_0x403b77['error'][_0x7da6('0x1a')]);return _0x42a651(_0x403b77[_0x7da6('0x19')]['message']);}logger[_0x7da6('0x19')](_0x7da6('0x14'),_0x42b8d9,_0x403b77[_0x7da6('0x19')][_0x7da6('0x1a')]);return _0x5be447(_0x403b77[_0x7da6('0x19')][_0x7da6('0x1a')]);}else{logger[_0x7da6('0x13')](_0x7da6('0x14'),_0x42b8d9,'request\x20sent');_0x5be447(_0x403b77[_0x7da6('0x1b')]['message']);}})[_0x7da6('0x1c')](function(_0x3a905e){logger[_0x7da6('0x19')](_0x7da6('0x14'),_0x42b8d9,_0x3a905e);_0x42a651(_0x3a905e);});});}exports[_0x7da6('0x1d')]=function(_0x1c39d9){var _0x3698cb=this;return new Promise(function(_0x1d6b90,_0x37a22d){return db[_0x7da6('0x1e')][_0x7da6('0x1f')](_0x1c39d9[_0x7da6('0x20')],{'raw':_0x1c39d9[_0x7da6('0x21')]?_0x1c39d9[_0x7da6('0x21')][_0x7da6('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c39d9['options']?_0x1c39d9[_0x7da6('0x21')][_0x7da6('0x23')]||null:null,'attributes':_0x1c39d9[_0x7da6('0x21')]?_0x1c39d9[_0x7da6('0x21')]['attributes']||null:null,'limit':_0x1c39d9['options']?_0x1c39d9[_0x7da6('0x21')][_0x7da6('0x24')]||null:null})[_0x7da6('0x12')](function(_0x27bb8c){logger[_0x7da6('0x13')](_0x7da6('0x1d'),_0x1c39d9);logger['debug']('UpdateChatInteraction',_0x1c39d9,JSON[_0x7da6('0x18')](_0x27bb8c));_0x1d6b90(_0x27bb8c);})[_0x7da6('0x1c')](function(_0x229be2){logger[_0x7da6('0x19')](_0x7da6('0x1d'),_0x229be2[_0x7da6('0x1a')],_0x1c39d9);_0x37a22d(_0x3698cb[_0x7da6('0x19')](0x1f4,_0x229be2[_0x7da6('0x1a')]));});});};exports[_0x7da6('0x25')]=function(_0x44a25a){return new Promise(function(_0x16a639,_0xa93abd){return db['ChatInteraction'][_0x7da6('0x26')]({'where':_0x44a25a[_0x7da6('0x21')]?_0x44a25a[_0x7da6('0x21')]['where']||null:null})[_0x7da6('0x12')](function(_0x31de51){if(_0x31de51){return _0x31de51[_0x7da6('0x27')](_0x44a25a[_0x7da6('0x20')][_0x7da6('0x28')],_[_0x7da6('0x29')](_0x44a25a[_0x7da6('0x20')],[_0x7da6('0x28'),'id'])||{});}})[_0x7da6('0x2a')](function(_0x38b141){logger[_0x7da6('0x13')](_0x7da6('0x2b'),_0x44a25a);logger[_0x7da6('0x16')](_0x7da6('0x2b'),_0x44a25a,JSON[_0x7da6('0x18')](_0x38b141));_0x16a639(_0x38b141);})[_0x7da6('0x1c')](function(_0x5da095){logger['error'](_0x7da6('0x2b'),_0x5da095[_0x7da6('0x1a')],_0x44a25a);_0xa93abd(_this[_0x7da6('0x19')](0x1f4,_0x5da095['message']));});});}; \ No newline at end of file +var _0xfefe=['raw','where','attributes','limit','stringify','AddTagsToChatInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options'];(function(_0x2c5655,_0x2cab10){var _0xe23b4f=function(_0xa1c823){while(--_0xa1c823){_0x2c5655['push'](_0x2c5655['shift']());}};_0xe23b4f(++_0x2cab10);}(_0xfefe,0x16b));var _0xefef=function(_0x293072,_0x2bdfb4){_0x293072=_0x293072-0x0;var _0xe4290c=_0xfefe[_0x293072];return _0xe4290c;};'use strict';var _=require(_0xefef('0x0'));var util=require(_0xefef('0x1'));var moment=require(_0xefef('0x2'));var BPromise=require(_0xefef('0x3'));var rs=require(_0xefef('0x4'));var fs=require('fs');var Redis=require(_0xefef('0x5'));var db=require(_0xefef('0x6'))['db'];var utils=require(_0xefef('0x7'));var logger=require('../../config/logger')(_0xefef('0x8'));var config=require('../../config/environment');var jayson=require(_0xefef('0x9'));var client=jayson[_0xefef('0xa')][_0xefef('0xb')]({'port':0x232a});config[_0xefef('0xc')]=_[_0xefef('0xd')](config[_0xefef('0xc')],{'host':_0xefef('0xe'),'port':0x18eb});var socket=require(_0xefef('0xf'))(new Redis(config[_0xefef('0xc')]));require(_0xefef('0x10'))['register'](socket);function respondWithRpcPromise(_0x2d0f5c,_0x21f32c,_0x22a003){return new BPromise(function(_0x4d6338,_0x4e4f0f){return client[_0xefef('0x11')](_0x2d0f5c,_0x22a003)[_0xefef('0x12')](function(_0x4cf2d1){logger[_0xefef('0x13')](_0xefef('0x14'),_0x21f32c,'request\x20sent');logger[_0xefef('0x15')](_0xefef('0x16'),_0x21f32c,_0xefef('0x17'),JSON['stringify'](_0x4cf2d1));if(_0x4cf2d1[_0xefef('0x18')]){if(_0x4cf2d1[_0xefef('0x18')]['code']===0x1f4){logger[_0xefef('0x18')](_0xefef('0x14'),_0x21f32c,_0x4cf2d1[_0xefef('0x18')][_0xefef('0x19')]);return _0x4e4f0f(_0x4cf2d1[_0xefef('0x18')][_0xefef('0x19')]);}logger[_0xefef('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x21f32c,_0x4cf2d1['error'][_0xefef('0x19')]);return _0x4d6338(_0x4cf2d1['error']['message']);}else{logger[_0xefef('0x13')](_0xefef('0x14'),_0x21f32c,_0xefef('0x17'));_0x4d6338(_0x4cf2d1[_0xefef('0x1a')][_0xefef('0x19')]);}})[_0xefef('0x1b')](function(_0x310097){logger['error'](_0xefef('0x14'),_0x21f32c,_0x310097);_0x4e4f0f(_0x310097);});});}exports[_0xefef('0x1c')]=function(_0x171510){var _0x1b69e9=this;return new Promise(function(_0x2b817b,_0x20f4e6){return db[_0xefef('0x1d')][_0xefef('0x1e')](_0x171510[_0xefef('0x1f')],{'raw':_0x171510[_0xefef('0x20')]?_0x171510[_0xefef('0x20')][_0xefef('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x171510[_0xefef('0x20')]?_0x171510['options'][_0xefef('0x22')]||null:null,'attributes':_0x171510[_0xefef('0x20')]?_0x171510[_0xefef('0x20')][_0xefef('0x23')]||null:null,'limit':_0x171510[_0xefef('0x20')]?_0x171510[_0xefef('0x20')][_0xefef('0x24')]||null:null})[_0xefef('0x12')](function(_0x371f31){logger[_0xefef('0x13')](_0xefef('0x1c'),_0x171510);logger[_0xefef('0x15')](_0xefef('0x1c'),_0x171510,JSON[_0xefef('0x25')](_0x371f31));_0x2b817b(_0x371f31);})[_0xefef('0x1b')](function(_0x1396bb){logger[_0xefef('0x18')]('UpdateChatInteraction',_0x1396bb[_0xefef('0x19')],_0x171510);_0x20f4e6(_0x1b69e9[_0xefef('0x18')](0x1f4,_0x1396bb['message']));});});};exports[_0xefef('0x26')]=function(_0x261351){return new Promise(function(_0x271d18,_0x3072b0){return db[_0xefef('0x1d')][_0xefef('0x27')]({'where':_0x261351[_0xefef('0x20')]?_0x261351[_0xefef('0x20')][_0xefef('0x22')]||null:null})['then'](function(_0x3ec2ea){if(_0x3ec2ea){return _0x3ec2ea[_0xefef('0x28')](_0x261351[_0xefef('0x1f')]['ids'],_['omit'](_0x261351[_0xefef('0x1f')],[_0xefef('0x29'),'id'])||{});}})[_0xefef('0x2a')](function(_0x13ac8e){logger['info'](_0xefef('0x2b'),_0x261351);logger['debug']('AddTags',_0x261351,JSON[_0xefef('0x25')](_0x13ac8e));_0x271d18(_0x13ac8e);})[_0xefef('0x1b')](function(_0x115706){logger[_0xefef('0x18')](_0xefef('0x2b'),_0x115706[_0xefef('0x19')],_0x261351);_0x3072b0(_this[_0xefef('0x18')](0x1f4,_0x115706[_0xefef('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 2109eec..d3d389c 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 _0xdab6=['update','emit','removeListener','length','chatInteraction:','save','remove'];(function(_0x3c3fa0,_0x4224be){var _0x4eaa8d=function(_0x239f34){while(--_0x239f34){_0x3c3fa0['push'](_0x3c3fa0['shift']());}};_0x4eaa8d(++_0x4224be);}(_0xdab6,0x10f));var _0x6dab=function(_0x52adbf,_0x397f83){_0x52adbf=_0x52adbf-0x0;var _0x183ad3=_0xdab6[_0x52adbf];return _0x183ad3;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x6dab('0x0'),_0x6dab('0x1'),_0x6dab('0x2')];function createListener(_0x2d68a6,_0x230997){return function(_0x3228ef){_0x230997[_0x6dab('0x3')](_0x2d68a6,_0x3228ef);};}function removeListener(_0x25609d,_0x272226){return function(){ChatInteractionEvents[_0x6dab('0x4')](_0x25609d,_0x272226);};}exports['register']=function(_0x481149){for(var _0x1b7229=0x0,_0x44c491=events[_0x6dab('0x5')];_0x1b7229<_0x44c491;_0x1b7229++){var _0x72c626=events[_0x1b7229];var _0x58cfcf=createListener(_0x6dab('0x6')+_0x72c626,_0x481149);ChatInteractionEvents['on'](_0x72c626,_0x58cfcf);}}; \ No newline at end of file +var _0x28e0=['remove','update','emit','removeListener','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x4eb128,_0x46295d){var _0x53a283=function(_0x202224){while(--_0x202224){_0x4eb128['push'](_0x4eb128['shift']());}};_0x53a283(++_0x46295d);}(_0x28e0,0x126));var _0x028e=function(_0x24998c,_0x450c59){_0x24998c=_0x24998c-0x0;var _0x5be667=_0x28e0[_0x24998c];return _0x5be667;};'use strict';var ChatInteractionEvents=require(_0x028e('0x0'));var events=[_0x028e('0x1'),_0x028e('0x2'),_0x028e('0x3')];function createListener(_0x3b9623,_0x5ae235){return function(_0x438d41){_0x5ae235[_0x028e('0x4')](_0x3b9623,_0x438d41);};}function removeListener(_0x3d13d3,_0x142856){return function(){ChatInteractionEvents[_0x028e('0x5')](_0x3d13d3,_0x142856);};}exports['register']=function(_0x244880){for(var _0x1c8003=0x0,_0x867642=events[_0x028e('0x6')];_0x1c8003<_0x867642;_0x1c8003++){var _0x72b573=events[_0x1c8003];var _0x5f1cb7=createListener(_0x028e('0x7')+_0x72b573,_0x244880);ChatInteractionEvents['on'](_0x72b573,_0x5f1cb7);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 52191fb..31d1724 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 _0xe486=['/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','update','customUpdate','/:id/abandon','close','delete','chatinteraction:destroy','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','isAuthenticated','getMessages'];(function(_0x53f202,_0x464ab8){var _0x5c3651=function(_0xe47558){while(--_0xe47558){_0x53f202['push'](_0x53f202['shift']());}};_0x5c3651(++_0x464ab8);}(_0xe486,0x11b));var _0x6e48=function(_0x4a715c,_0x57165f){_0x4a715c=_0x4a715c-0x0;var _0x168cfe=_0xe486[_0x4a715c];return _0x168cfe;};'use strict';var multer=require('multer');var util=require(_0x6e48('0x0'));var path=require(_0x6e48('0x1'));var timeout=require('connect-timeout');var express=require(_0x6e48('0x2'));var router=express[_0x6e48('0x3')]();var fs_extra=require(_0x6e48('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6e48('0x5'));var config=require(_0x6e48('0x6'));var controller=require(_0x6e48('0x7'));router[_0x6e48('0x8')]('/',auth['isAuthenticated'](),controller[_0x6e48('0x9')]);router[_0x6e48('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x6e48('0x8')](_0x6e48('0xa'),auth[_0x6e48('0xb')](),controller[_0x6e48('0xc')]);router[_0x6e48('0x8')](_0x6e48('0xd'),auth[_0x6e48('0xb')](),controller['attachmentDownload']);router['get'](_0x6e48('0xe'),auth[_0x6e48('0xf')](),controller[_0x6e48('0x10')]);router[_0x6e48('0x8')](_0x6e48('0x11'),auth[_0x6e48('0xb')](),controller[_0x6e48('0x12')]);router[_0x6e48('0x8')]('/:id/download',auth[_0x6e48('0xf')](),controller[_0x6e48('0x13')]);router[_0x6e48('0x14')]('/',auth['isAuthenticated'](),controller[_0x6e48('0x15')]);router[_0x6e48('0x14')](_0x6e48('0x16'),auth[_0x6e48('0xf')](),controller[_0x6e48('0x17')]);var upload=multer({'storage':multer[_0x6e48('0x18')]({'destination':function(_0x527485,_0x7d7ac8,_0x2221a3){_0x2221a3(null,path[_0x6e48('0x19')](config[_0x6e48('0x1a')],_0x6e48('0x1b')));},'filename':function(_0x4a5e41,_0x199a67,_0x500d16){_0x500d16(null,util[_0x6e48('0x1c')](_0x6e48('0x1d'),Date[_0x6e48('0x1e')](),_0x199a67['originalname'][_0x6e48('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x6e48('0x20'),upload[_0x6e48('0x21')](_0x6e48('0x22')),controller[_0x6e48('0x23')]);router[_0x6e48('0x14')](_0x6e48('0xe'),auth['isChatInteractionAuthorized'](),controller[_0x6e48('0x24')]);router['post'](_0x6e48('0x25'),auth[_0x6e48('0xf')](),interaction[_0x6e48('0x26')](_0x6e48('0x27'),'chatinteraction:addtags'),controller[_0x6e48('0x28')]);router[_0x6e48('0x29')]('/:id',auth[_0x6e48('0xf')](),interaction['tracked'](_0x6e48('0x27'),'chatinteraction:update'),controller[_0x6e48('0x2a')]);router[_0x6e48('0x29')]('/:id/custom_update',controller[_0x6e48('0x2b')]);router[_0x6e48('0x29')](_0x6e48('0x2c'),auth[_0x6e48('0xb')](),controller['abandon']);router[_0x6e48('0x29')]('/:id/close',controller[_0x6e48('0x2d')]);router[_0x6e48('0x2e')]('/:id',auth[_0x6e48('0xf')](),interaction[_0x6e48('0x26')](_0x6e48('0x27'),_0x6e48('0x2f')),controller[_0x6e48('0x30')]);router[_0x6e48('0x2e')]('/:id/tags',auth[_0x6e48('0xf')](),controller['removeTags']);module[_0x6e48('0x31')]=router; \ No newline at end of file +var _0xe9ef=['%s-%s','now','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','/:id','chatinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','getMyMessages','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/'];(function(_0x29632e,_0x5ecba4){var _0x426e04=function(_0x4eb357){while(--_0x4eb357){_0x29632e['push'](_0x29632e['shift']());}};_0x426e04(++_0x5ecba4);}(_0xe9ef,0x80));var _0xfe9e=function(_0x49beea,_0x47add1){_0x49beea=_0x49beea-0x0;var _0x27693a=_0xe9ef[_0x49beea];return _0x27693a;};'use strict';var multer=require('multer');var util=require(_0xfe9e('0x0'));var path=require(_0xfe9e('0x1'));var timeout=require(_0xfe9e('0x2'));var express=require(_0xfe9e('0x3'));var router=express['Router']();var fs_extra=require(_0xfe9e('0x4'));var auth=require(_0xfe9e('0x5'));var interaction=require(_0xfe9e('0x6'));var config=require(_0xfe9e('0x7'));var controller=require(_0xfe9e('0x8'));router[_0xfe9e('0x9')]('/',auth['isAuthenticated'](),controller[_0xfe9e('0xa')]);router[_0xfe9e('0x9')](_0xfe9e('0xb'),auth[_0xfe9e('0xc')](),controller[_0xfe9e('0xd')]);router[_0xfe9e('0x9')]('/:id',auth[_0xfe9e('0xe')](),controller[_0xfe9e('0xf')]);router[_0xfe9e('0x9')](_0xfe9e('0x10'),auth[_0xfe9e('0xe')](),controller['attachmentDownload']);router[_0xfe9e('0x9')](_0xfe9e('0x11'),auth[_0xfe9e('0xc')](),controller[_0xfe9e('0x12')]);router['get']('/:id/my_messages',auth[_0xfe9e('0xe')](),controller[_0xfe9e('0x13')]);router['get']('/:id/download',auth[_0xfe9e('0xc')](),controller[_0xfe9e('0x14')]);router[_0xfe9e('0x15')]('/',auth[_0xfe9e('0xc')](),controller[_0xfe9e('0x16')]);router[_0xfe9e('0x15')]('/:id/vidaoo',auth[_0xfe9e('0xc')](),controller[_0xfe9e('0x17')]);var upload=multer({'storage':multer[_0xfe9e('0x18')]({'destination':function(_0x433828,_0x3d15ca,_0x289e80){_0x289e80(null,path[_0xfe9e('0x19')](config[_0xfe9e('0x1a')],_0xfe9e('0x1b')));},'filename':function(_0x40cfb8,_0x410e48,_0x20c630){_0x20c630(null,util['format'](_0xfe9e('0x1c'),Date[_0xfe9e('0x1d')](),_0x410e48['originalname'][_0xfe9e('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xfe9e('0x15')](_0xfe9e('0x1f'),upload[_0xfe9e('0x20')]('file'),controller[_0xfe9e('0x21')]);router[_0xfe9e('0x15')](_0xfe9e('0x11'),auth[_0xfe9e('0xe')](),controller[_0xfe9e('0x22')]);router['post']('/:id/tags',auth[_0xfe9e('0xc')](),interaction[_0xfe9e('0x23')](_0xfe9e('0x24'),_0xfe9e('0x25')),controller['addTags']);router[_0xfe9e('0x26')]('/:id',auth[_0xfe9e('0xc')](),interaction[_0xfe9e('0x23')](_0xfe9e('0x24'),_0xfe9e('0x27')),controller[_0xfe9e('0x28')]);router[_0xfe9e('0x26')](_0xfe9e('0x29'),controller[_0xfe9e('0x2a')]);router[_0xfe9e('0x26')](_0xfe9e('0x2b'),auth[_0xfe9e('0xe')](),controller['abandon']);router['put'](_0xfe9e('0x2c'),controller[_0xfe9e('0x2d')]);router[_0xfe9e('0x2e')](_0xfe9e('0x2f'),auth[_0xfe9e('0xc')](),interaction[_0xfe9e('0x23')](_0xfe9e('0x24'),_0xfe9e('0x30')),controller[_0xfe9e('0x31')]);router[_0xfe9e('0x2e')]('/:id/tags',auth[_0xfe9e('0xc')](),controller[_0xfe9e('0x32')]);module[_0xfe9e('0x33')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index bf4e732..b6aca5b 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 _0x89c0=['medium','BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x36080f,_0x43f834){var _0x3136e1=function(_0x12ada9){while(--_0x12ada9){_0x36080f['push'](_0x36080f['shift']());}};_0x3136e1(++_0x43f834);}(_0x89c0,0xcf));var _0x089c=function(_0x26be02,_0x59a9b7){_0x26be02=_0x26be02-0x0;var _0x28c5f5=_0x89c0[_0x26be02];return _0x28c5f5;};'use strict';var Sequelize=require(_0x089c('0x0'));module[_0x089c('0x1')]={'body':{'type':Sequelize[_0x089c('0x2')](_0x089c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x089c('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x089c('0x5')]}}; \ No newline at end of file +var _0x366f=['medium','BOOLEAN','sequelize','exports','TEXT'];(function(_0x4f9147,_0x433ce1){var _0x191c23=function(_0x21fee9){while(--_0x21fee9){_0x4f9147['push'](_0x4f9147['shift']());}};_0x191c23(++_0x433ce1);}(_0x366f,0x165));var _0xf366=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x366f[_0x4d8ed9];return _0x1e2140;};'use strict';var Sequelize=require(_0xf366('0x0'));module[_0xf366('0x1')]={'body':{'type':Sequelize[_0xf366('0x2')](_0xf366('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf366('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 663cbf5..3c798a0 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 _0xa6b5=['filter','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','params','include','create','body','find','destroy','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','push','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatInternalMessage.socket','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','save','update','then','error','stack','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0xb7bf50,_0x4d36fc){var _0x335364=function(_0x2e5f44){while(--_0x2e5f44){_0xb7bf50['push'](_0xb7bf50['shift']());}};_0x335364(++_0x4d36fc);}(_0xa6b5,0xa5));var _0x5a6b=function(_0x1152c7,_0x59d34b){_0x1152c7=_0x1152c7-0x0;var _0x81135=_0xa6b5[_0x1152c7];return _0x81135;};'use strict';var emlformat=require(_0x5a6b('0x0'));var rimraf=require(_0x5a6b('0x1'));var zipdir=require(_0x5a6b('0x2'));var jsonpatch=require(_0x5a6b('0x3'));var rp=require(_0x5a6b('0x4'));var moment=require(_0x5a6b('0x5'));var BPromise=require(_0x5a6b('0x6'));var Mustache=require('mustache');var util=require(_0x5a6b('0x7'));var path=require(_0x5a6b('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5a6b('0x9'));var _=require(_0x5a6b('0xa'));var squel=require(_0x5a6b('0xb'));var crypto=require('crypto');var jsforce=require(_0x5a6b('0xc'));var deskjs=require(_0x5a6b('0xd'));var toCsv=require(_0x5a6b('0xe'));var querystring=require(_0x5a6b('0xf'));var Papa=require(_0x5a6b('0x10'));var Redis=require(_0x5a6b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5a6b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a6b('0x13'));var logger=require(_0x5a6b('0x14'))(_0x5a6b('0x15'));var utils=require(_0x5a6b('0x16'));var config=require(_0x5a6b('0x17'));var licenseUtil=require(_0x5a6b('0x18'));var db=require('../../mysqldb')['db'];config[_0x5a6b('0x19')]=_[_0x5a6b('0x1a')](config[_0x5a6b('0x19')],{'host':_0x5a6b('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5a6b('0x19')]));require(_0x5a6b('0x1c'))['register'](socket);function respondWithStatusCode(_0x176128,_0x26d228){_0x26d228=_0x26d228||0xcc;return function(_0x131ac3){if(_0x131ac3){return _0x176128[_0x5a6b('0x1d')](_0x26d228);}return _0x176128[_0x5a6b('0x1e')](_0x26d228)[_0x5a6b('0x1f')]();};}function respondWithResult(_0x31fdfd,_0x39d122){_0x39d122=_0x39d122||0xc8;return function(_0x536cc6){if(_0x536cc6){return _0x31fdfd['status'](_0x39d122)[_0x5a6b('0x20')](_0x536cc6);}};}function respondWithFilteredResult(_0x28bc98,_0x1a9102){return function(_0xc1a1ca){if(_0xc1a1ca){var _0x1bf662=typeof _0x1a9102[_0x5a6b('0x21')]==='undefined'&&typeof _0x1a9102[_0x5a6b('0x22')]===_0x5a6b('0x23');var _0x329d94=_0xc1a1ca['count'];var _0x25909d=_0x1bf662?0x0:_0x1a9102[_0x5a6b('0x21')];var _0x1509cc=_0x1bf662?_0xc1a1ca['count']:_0x1a9102[_0x5a6b('0x21')]+_0x1a9102['limit'];var _0x52b975;if(_0x1509cc>=_0x329d94){_0x1509cc=_0x329d94;_0x52b975=0xc8;}else{_0x52b975=0xce;}_0x28bc98[_0x5a6b('0x1e')](_0x52b975);return _0x28bc98['set'](_0x5a6b('0x24'),_0x25909d+'-'+_0x1509cc+'/'+_0x329d94)[_0x5a6b('0x20')](_0xc1a1ca);}return null;};}function patchUpdates(_0x5430ec){return function(_0x41d596){try{jsonpatch[_0x5a6b('0x25')](_0x41d596,_0x5430ec,!![]);}catch(_0x202dfe){return BPromise['reject'](_0x202dfe);}return _0x41d596[_0x5a6b('0x26')]();};}function saveUpdates(_0x123909,_0x3765e6){return function(_0x3f56aa){if(_0x3f56aa){return _0x3f56aa[_0x5a6b('0x27')](_0x123909)[_0x5a6b('0x28')](function(_0x1daf4c){return _0x1daf4c;});}return null;};}function removeEntity(_0x1fa7f0,_0x5c2a93){return function(_0x55620f){if(_0x55620f){return _0x55620f['destroy']()[_0x5a6b('0x28')](function(){_0x1fa7f0[_0x5a6b('0x1e')](0xcc)[_0x5a6b('0x1f')]();});}};}function handleEntityNotFound(_0x483526,_0x25f287){return function(_0x1ef776){if(!_0x1ef776){_0x483526[_0x5a6b('0x1d')](0x194);}return _0x1ef776;};}function handleError(_0x3b9136,_0x44c458){_0x44c458=_0x44c458||0x1f4;return function(_0x2f1b93){logger[_0x5a6b('0x29')](_0x2f1b93[_0x5a6b('0x2a')]);if(_0x2f1b93['name']){delete _0x2f1b93['name'];}_0x3b9136['status'](_0x44c458)[_0x5a6b('0x2b')](_0x2f1b93);};}exports[_0x5a6b('0x2c')]=function(_0x49a8dd,_0x55906f){var _0x54351e={},_0x40de08={},_0x15958e={'count':0x0,'rows':[]};var _0x1de597=_[_0x5a6b('0x2d')](db[_0x5a6b('0x2e')][_0x5a6b('0x2f')],function(_0x5b38af){return{'name':_0x5b38af['fieldName'],'type':_0x5b38af[_0x5a6b('0x30')][_0x5a6b('0x31')]};});_0x40de08[_0x5a6b('0x32')]=_[_0x5a6b('0x2d')](_0x1de597,_0x5a6b('0x33'));_0x40de08['query']=_[_0x5a6b('0x34')](_0x49a8dd[_0x5a6b('0x35')]);_0x40de08['filters']=_[_0x5a6b('0x36')](_0x40de08[_0x5a6b('0x32')],_0x40de08[_0x5a6b('0x35')]);_0x54351e[_0x5a6b('0x37')]=_['intersection'](_0x40de08[_0x5a6b('0x32')],qs[_0x5a6b('0x38')](_0x49a8dd[_0x5a6b('0x35')]['fields']));_0x54351e['attributes']=_0x54351e[_0x5a6b('0x37')][_0x5a6b('0x39')]?_0x54351e[_0x5a6b('0x37')]:_0x40de08[_0x5a6b('0x32')];if(!_0x49a8dd[_0x5a6b('0x35')][_0x5a6b('0x3a')](_0x5a6b('0x3b'))){_0x54351e[_0x5a6b('0x22')]=qs[_0x5a6b('0x22')](_0x49a8dd[_0x5a6b('0x35')]['limit']);_0x54351e[_0x5a6b('0x21')]=qs[_0x5a6b('0x21')](_0x49a8dd[_0x5a6b('0x35')]['offset']);}_0x54351e[_0x5a6b('0x3c')]=qs['sort'](_0x49a8dd[_0x5a6b('0x35')][_0x5a6b('0x3d')]);_0x54351e[_0x5a6b('0x3e')]=qs[_0x5a6b('0x3f')](_[_0x5a6b('0x40')](_0x49a8dd[_0x5a6b('0x35')],_0x40de08[_0x5a6b('0x3f')]),_0x1de597);if(_0x49a8dd[_0x5a6b('0x35')][_0x5a6b('0x41')]){_0x54351e['where']=_['merge'](_0x54351e[_0x5a6b('0x3e')],{'$or':_['map'](_0x1de597,function(_0x1e5471){if(_0x1e5471['type']!==_0x5a6b('0x42')){var _0x304f50={};_0x304f50[_0x1e5471[_0x5a6b('0x33')]]={'$like':'%'+_0x49a8dd[_0x5a6b('0x35')][_0x5a6b('0x41')]+'%'};return _0x304f50;}})});}_0x54351e=_[_0x5a6b('0x43')]({},_0x54351e,_0x49a8dd[_0x5a6b('0x44')]);var _0x554ea7={'where':_0x54351e[_0x5a6b('0x3e')]};return db['ChatInternalMessage'][_0x5a6b('0x45')](_0x554ea7)['then'](function(_0x456dc4){_0x15958e[_0x5a6b('0x45')]=_0x456dc4;if(_0x49a8dd['query'][_0x5a6b('0x46')]){_0x54351e['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x5a6b('0x47')](_0x54351e);})[_0x5a6b('0x28')](function(_0x3f332f){_0x15958e[_0x5a6b('0x48')]=_0x3f332f;return _0x15958e;})[_0x5a6b('0x28')](respondWithFilteredResult(_0x55906f,_0x54351e))[_0x5a6b('0x49')](handleError(_0x55906f,null));};exports[_0x5a6b('0x4a')]=function(_0x1c5b68,_0x540d73){var _0x551ae4={'raw':!![],'where':{'id':_0x1c5b68[_0x5a6b('0x4b')]['id']}},_0x14c8cc={};_0x14c8cc[_0x5a6b('0x32')]=_[_0x5a6b('0x34')](db[_0x5a6b('0x2e')][_0x5a6b('0x2f')]);_0x14c8cc['query']=_[_0x5a6b('0x34')](_0x1c5b68[_0x5a6b('0x35')]);_0x14c8cc[_0x5a6b('0x3f')]=_[_0x5a6b('0x36')](_0x14c8cc['model'],_0x14c8cc[_0x5a6b('0x35')]);_0x551ae4['attributes']=_[_0x5a6b('0x36')](_0x14c8cc[_0x5a6b('0x32')],qs[_0x5a6b('0x38')](_0x1c5b68[_0x5a6b('0x35')][_0x5a6b('0x38')]));_0x551ae4[_0x5a6b('0x37')]=_0x551ae4['attributes']['length']?_0x551ae4[_0x5a6b('0x37')]:_0x14c8cc['model'];if(_0x1c5b68[_0x5a6b('0x35')][_0x5a6b('0x46')]){_0x551ae4[_0x5a6b('0x4c')]=[{'all':!![]}];}_0x551ae4=_[_0x5a6b('0x43')]({},_0x551ae4,_0x1c5b68[_0x5a6b('0x44')]);return db['ChatInternalMessage']['find'](_0x551ae4)[_0x5a6b('0x28')](handleEntityNotFound(_0x540d73,null))[_0x5a6b('0x28')](respondWithResult(_0x540d73,null))[_0x5a6b('0x49')](handleError(_0x540d73,null));};exports[_0x5a6b('0x4d')]=function(_0x524f24,_0x4b5286){return db[_0x5a6b('0x2e')][_0x5a6b('0x4d')](_0x524f24[_0x5a6b('0x4e')],{})[_0x5a6b('0x28')](respondWithResult(_0x4b5286,0xc9))[_0x5a6b('0x49')](handleError(_0x4b5286,null));};exports[_0x5a6b('0x27')]=function(_0x2fa1df,_0x150362){if(_0x2fa1df['body']['id']){delete _0x2fa1df[_0x5a6b('0x4e')]['id'];}return db[_0x5a6b('0x2e')][_0x5a6b('0x4f')]({'where':{'id':_0x2fa1df[_0x5a6b('0x4b')]['id']}})[_0x5a6b('0x28')](handleEntityNotFound(_0x150362,null))[_0x5a6b('0x28')](saveUpdates(_0x2fa1df[_0x5a6b('0x4e')],null))['then'](respondWithResult(_0x150362,null))[_0x5a6b('0x49')](handleError(_0x150362,null));};exports[_0x5a6b('0x50')]=function(_0x29456c,_0x1a7eeb){return db[_0x5a6b('0x2e')][_0x5a6b('0x4f')]({'where':{'id':_0x29456c[_0x5a6b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1a7eeb,null))[_0x5a6b('0x28')](removeEntity(_0x1a7eeb,null))[_0x5a6b('0x49')](handleError(_0x1a7eeb,null));};exports[_0x5a6b('0x51')]=function(_0x24d08c,_0x3d1cc8){return db[_0x5a6b('0x2e')][_0x5a6b('0x51')]()[_0x5a6b('0x28')](respondWithResult(_0x3d1cc8,null))[_0x5a6b('0x49')](handleError(_0x3d1cc8,null));};function wrapUser(_0x4aefd3){return function(_0x23ec56){var _0xe3fbab=_0x4aefd3[_0x5a6b('0x52')]({'plain':!![]});_0xe3fbab[_0x5a6b('0x53')]=[];if(_0x23ec56){_0xe3fbab[_0x5a6b('0x54')]=_0x23ec56['createdAt'];_0xe3fbab[_0x5a6b('0x55')]=_0x23ec56;}else{_0xe3fbab[_0x5a6b('0x54')]=moment(0x0)[_0x5a6b('0x56')](_0x5a6b('0x57'));_0xe3fbab[_0x5a6b('0x55')]={};}return _0xe3fbab;};}exports[_0x5a6b('0x58')]=function(_0x2742cb,_0x5d8d55,_0x203420){var _0x30480a=[];return db[_0x5a6b('0x59')][_0x5a6b('0x47')]({'where':{'role':[_0x5a6b('0x5a'),_0x5a6b('0x5b'),_0x5a6b('0x5c')]},'attributes':['id',_0x5a6b('0x5d'),_0x5a6b('0x33'),'role',_0x5a6b('0x5e'),_0x5a6b('0x5f'),_0x5a6b('0x60'),_0x5a6b('0x61'),_0x5a6b('0x62'),_0x5a6b('0x63')],'order':qs[_0x5a6b('0x3d')](_0x5a6b('0x64')),'include':[{'model':db[_0x5a6b('0x65')],'as':_0x5a6b('0x66'),'attributes':['id',_0x5a6b('0x33'),_0x5a6b('0x30')],'through':{'attributes':[]}}]})[_0x5a6b('0x28')](function(_0x4d157b){if(_0x4d157b){var _0x18b7cb=_0x2742cb[_0x5a6b('0x5c')][_0x5a6b('0x52')]({'plain':!![]});if(!_0x18b7cb)throw new Error(_0x5a6b('0x67'));if(_0x18b7cb[_0x5a6b('0x68')]===_0x5a6b('0x5c')){return db[_0x5a6b('0x69')]['find']({'where':{'name':_0x5a6b('0x6a'),'userProfileId':_0x18b7cb[_0x5a6b('0x6b')]},'raw':!![]})[_0x5a6b('0x28')](function(_0x5ca70c){if(_0x5ca70c){if(_0x5ca70c['autoAssociation']===0x0){return db[_0x5a6b('0x6c')][_0x5a6b('0x47')]({'where':{'sectionId':_0x5ca70c['id']},'raw':!![]})[_0x5a6b('0x28')](function(_0x2de921){var _0x5400bb=[];if(_[_0x5a6b('0x6d')](_0x2de921)){_0x5400bb=_[_0x5a6b('0x41')](_0x4d157b,function(_0x11a8af){if(_0x11a8af[_0x5a6b('0x68')]!=='agent'){return _0x11a8af;}});return _0x5400bb;}else{for(var _0xedba30=0x0;_0xedba30<_0x4d157b[_0x5a6b('0x39')];_0xedba30++){var _0x48d9f7=_0x4d157b[_0xedba30];if(_0x48d9f7[_0x5a6b('0x68')]==='agent'){var _0x38962c=_[_0x5a6b('0x4f')](_0x2de921,function(_0x25c8bb){return _0x25c8bb['resourceId']===_0x48d9f7['id'];});if(_0x38962c)_0x5400bb[_0x5a6b('0x6e')](_0x48d9f7);}else{_0x5400bb[_0x5a6b('0x6e')](_0x48d9f7);}}return _0x5400bb;}});}else{return _0x4d157b;}}else{var _0xb66cce=_[_0x5a6b('0x41')](_0x4d157b,function(_0x350cc4){if(_0x350cc4[_0x5a6b('0x68')]!==_0x5a6b('0x5a')){return _0x350cc4;}});return _0xb66cce;}});}else{return _0x4d157b;}}})[_0x5a6b('0x28')](function(_0x58d530){var _0x50691b=[];if(_0x58d530){_0x30480a=_0x58d530;for(var _0x5347f3=0x0;_0x5347f3<_0x58d530[_0x5a6b('0x39')];_0x5347f3+=0x1){_0x30480a[_0x5347f3][_0x5a6b('0x53')]=[];_0x50691b[_0x5a6b('0x6e')](db[_0x5a6b('0x2e')][_0x5a6b('0x4f')]({'where':{'FromId':[_0x2742cb[_0x5a6b('0x5c')]['id'],_0x58d530[_0x5347f3]['id']],'ToId':[_0x2742cb[_0x5a6b('0x5c')]['id'],_0x58d530[_0x5347f3]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x5a6b('0x6f'),_0x5a6b('0x70'),'body'],'order':qs['sort'](_0x5a6b('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5a6b('0x28')](wrapUser(_0x58d530[_0x5347f3])));}return BPromise[_0x5a6b('0x72')](_0x50691b);}return[];})[_0x5a6b('0x28')](function(_0x449e8a){return{'rows':_0x449e8a,'count':_0x449e8a[_0x5a6b('0x39')]};})['then'](respondWithResult(_0x5d8d55,null))[_0x5a6b('0x49')](handleError(_0x5d8d55,null));}; \ No newline at end of file +var _0x0ec8=['defaults','redis','localhost','./chatInternalMessage.socket','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','sendStatus','error','name','send','index','map','ChatInternalMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','find','catch','create','body','params','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','role','userpic','online','allowmessenger','showWebBar','-online','VoiceQueue','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x2dceb0,_0x5a6d32){var _0x46352d=function(_0x38444d){while(--_0x38444d){_0x2dceb0['push'](_0x2dceb0['shift']());}};_0x46352d(++_0x5a6d32);}(_0x0ec8,0x129));var _0x80ec=function(_0xd969cb,_0x245997){_0xd969cb=_0xd969cb-0x0;var _0x42ecd2=_0x0ec8[_0xd969cb];return _0x42ecd2;};'use strict';var emlformat=require(_0x80ec('0x0'));var rimraf=require(_0x80ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x80ec('0x2'));var rp=require(_0x80ec('0x3'));var moment=require('moment');var BPromise=require(_0x80ec('0x4'));var Mustache=require('mustache');var util=require(_0x80ec('0x5'));var path=require(_0x80ec('0x6'));var sox=require(_0x80ec('0x7'));var csv=require(_0x80ec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x80ec('0x9'));var _=require(_0x80ec('0xa'));var squel=require(_0x80ec('0xb'));var crypto=require('crypto');var jsforce=require(_0x80ec('0xc'));var deskjs=require(_0x80ec('0xd'));var toCsv=require(_0x80ec('0x8'));var querystring=require(_0x80ec('0xe'));var Papa=require(_0x80ec('0xf'));var Redis=require(_0x80ec('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x80ec('0x11'));var as=require(_0x80ec('0x12'));var hardwareService=require(_0x80ec('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x80ec('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x80ec('0x15')](config[_0x80ec('0x16')],{'host':_0x80ec('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x80ec('0x18'))['register'](socket);function respondWithStatusCode(_0x14d473,_0x2a9eea){_0x2a9eea=_0x2a9eea||0xcc;return function(_0x3d4b14){if(_0x3d4b14){return _0x14d473['sendStatus'](_0x2a9eea);}return _0x14d473['status'](_0x2a9eea)[_0x80ec('0x19')]();};}function respondWithResult(_0x134818,_0x4c927b){_0x4c927b=_0x4c927b||0xc8;return function(_0x4b729c){if(_0x4b729c){return _0x134818[_0x80ec('0x1a')](_0x4c927b)[_0x80ec('0x1b')](_0x4b729c);}};}function respondWithFilteredResult(_0x3b6e48,_0x2f6b30){return function(_0x41c62c){if(_0x41c62c){var _0x58b02d=typeof _0x2f6b30['offset']===_0x80ec('0x1c')&&typeof _0x2f6b30[_0x80ec('0x1d')]===_0x80ec('0x1c');var _0x52be55=_0x41c62c[_0x80ec('0x1e')];var _0x30ec8d=_0x58b02d?0x0:_0x2f6b30[_0x80ec('0x1f')];var _0x692d1d=_0x58b02d?_0x41c62c[_0x80ec('0x1e')]:_0x2f6b30['offset']+_0x2f6b30[_0x80ec('0x1d')];var _0x486d88;if(_0x692d1d>=_0x52be55){_0x692d1d=_0x52be55;_0x486d88=0xc8;}else{_0x486d88=0xce;}_0x3b6e48[_0x80ec('0x1a')](_0x486d88);return _0x3b6e48[_0x80ec('0x20')](_0x80ec('0x21'),_0x30ec8d+'-'+_0x692d1d+'/'+_0x52be55)[_0x80ec('0x1b')](_0x41c62c);}return null;};}function patchUpdates(_0x545777){return function(_0x5cf164){try{jsonpatch[_0x80ec('0x22')](_0x5cf164,_0x545777,!![]);}catch(_0x156411){return BPromise['reject'](_0x156411);}return _0x5cf164['save']();};}function saveUpdates(_0x540646,_0x4efa2d){return function(_0x25d466){if(_0x25d466){return _0x25d466[_0x80ec('0x23')](_0x540646)[_0x80ec('0x24')](function(_0x3d823f){return _0x3d823f;});}return null;};}function removeEntity(_0x20de50,_0x235f34){return function(_0x5a8ba3){if(_0x5a8ba3){return _0x5a8ba3[_0x80ec('0x25')]()[_0x80ec('0x24')](function(){_0x20de50[_0x80ec('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x440ab4,_0x221218){return function(_0x4d8d9a){if(!_0x4d8d9a){_0x440ab4[_0x80ec('0x26')](0x194);}return _0x4d8d9a;};}function handleError(_0x33d8a5,_0x3b31d3){_0x3b31d3=_0x3b31d3||0x1f4;return function(_0x13f274){logger[_0x80ec('0x27')](_0x13f274['stack']);if(_0x13f274[_0x80ec('0x28')]){delete _0x13f274[_0x80ec('0x28')];}_0x33d8a5[_0x80ec('0x1a')](_0x3b31d3)[_0x80ec('0x29')](_0x13f274);};}exports[_0x80ec('0x2a')]=function(_0x39eb0d,_0x5d70ea){var _0x2dab80={},_0x1eaeaf={},_0x1963ae={'count':0x0,'rows':[]};var _0x1dc07f=_[_0x80ec('0x2b')](db[_0x80ec('0x2c')]['rawAttributes'],function(_0x3b0279){return{'name':_0x3b0279[_0x80ec('0x2d')],'type':_0x3b0279[_0x80ec('0x2e')][_0x80ec('0x2f')]};});_0x1eaeaf[_0x80ec('0x30')]=_[_0x80ec('0x2b')](_0x1dc07f,_0x80ec('0x28'));_0x1eaeaf[_0x80ec('0x31')]=_[_0x80ec('0x32')](_0x39eb0d[_0x80ec('0x31')]);_0x1eaeaf[_0x80ec('0x33')]=_[_0x80ec('0x34')](_0x1eaeaf[_0x80ec('0x30')],_0x1eaeaf['query']);_0x2dab80[_0x80ec('0x35')]=_[_0x80ec('0x34')](_0x1eaeaf['model'],qs[_0x80ec('0x36')](_0x39eb0d[_0x80ec('0x31')][_0x80ec('0x36')]));_0x2dab80['attributes']=_0x2dab80[_0x80ec('0x35')][_0x80ec('0x37')]?_0x2dab80[_0x80ec('0x35')]:_0x1eaeaf[_0x80ec('0x30')];if(!_0x39eb0d['query'][_0x80ec('0x38')](_0x80ec('0x39'))){_0x2dab80['limit']=qs['limit'](_0x39eb0d[_0x80ec('0x31')][_0x80ec('0x1d')]);_0x2dab80[_0x80ec('0x1f')]=qs['offset'](_0x39eb0d[_0x80ec('0x31')]['offset']);}_0x2dab80[_0x80ec('0x3a')]=qs[_0x80ec('0x3b')](_0x39eb0d[_0x80ec('0x31')]['sort']);_0x2dab80['where']=qs[_0x80ec('0x33')](_[_0x80ec('0x3c')](_0x39eb0d[_0x80ec('0x31')],_0x1eaeaf[_0x80ec('0x33')]),_0x1dc07f);if(_0x39eb0d[_0x80ec('0x31')][_0x80ec('0x3d')]){_0x2dab80[_0x80ec('0x3e')]=_[_0x80ec('0x3f')](_0x2dab80[_0x80ec('0x3e')],{'$or':_[_0x80ec('0x2b')](_0x1dc07f,function(_0x4e4187){if(_0x4e4187[_0x80ec('0x2e')]!==_0x80ec('0x40')){var _0x1e446e={};_0x1e446e[_0x4e4187['name']]={'$like':'%'+_0x39eb0d[_0x80ec('0x31')][_0x80ec('0x3d')]+'%'};return _0x1e446e;}})});}_0x2dab80=_[_0x80ec('0x3f')]({},_0x2dab80,_0x39eb0d[_0x80ec('0x41')]);var _0x287598={'where':_0x2dab80[_0x80ec('0x3e')]};return db['ChatInternalMessage']['count'](_0x287598)[_0x80ec('0x24')](function(_0x3a845b){_0x1963ae['count']=_0x3a845b;if(_0x39eb0d['query'][_0x80ec('0x42')]){_0x2dab80[_0x80ec('0x43')]=[{'all':!![]}];}return db[_0x80ec('0x2c')][_0x80ec('0x44')](_0x2dab80);})['then'](function(_0x18c491){_0x1963ae['rows']=_0x18c491;return _0x1963ae;})[_0x80ec('0x24')](respondWithFilteredResult(_0x5d70ea,_0x2dab80))['catch'](handleError(_0x5d70ea,null));};exports['show']=function(_0x20df89,_0x4a7e42){var _0x2b64b2={'raw':!![],'where':{'id':_0x20df89['params']['id']}},_0x255505={};_0x255505[_0x80ec('0x30')]=_[_0x80ec('0x32')](db[_0x80ec('0x2c')]['rawAttributes']);_0x255505['query']=_[_0x80ec('0x32')](_0x20df89[_0x80ec('0x31')]);_0x255505[_0x80ec('0x33')]=_[_0x80ec('0x34')](_0x255505['model'],_0x255505[_0x80ec('0x31')]);_0x2b64b2[_0x80ec('0x35')]=_[_0x80ec('0x34')](_0x255505[_0x80ec('0x30')],qs[_0x80ec('0x36')](_0x20df89['query'][_0x80ec('0x36')]));_0x2b64b2['attributes']=_0x2b64b2['attributes'][_0x80ec('0x37')]?_0x2b64b2[_0x80ec('0x35')]:_0x255505[_0x80ec('0x30')];if(_0x20df89['query']['includeAll']){_0x2b64b2['include']=[{'all':!![]}];}_0x2b64b2=_[_0x80ec('0x3f')]({},_0x2b64b2,_0x20df89[_0x80ec('0x41')]);return db[_0x80ec('0x2c')][_0x80ec('0x45')](_0x2b64b2)[_0x80ec('0x24')](handleEntityNotFound(_0x4a7e42,null))[_0x80ec('0x24')](respondWithResult(_0x4a7e42,null))[_0x80ec('0x46')](handleError(_0x4a7e42,null));};exports['create']=function(_0x49772b,_0x3507b6){return db[_0x80ec('0x2c')][_0x80ec('0x47')](_0x49772b['body'],{})[_0x80ec('0x24')](respondWithResult(_0x3507b6,0xc9))[_0x80ec('0x46')](handleError(_0x3507b6,null));};exports['update']=function(_0x5e8bc4,_0x4a175c){if(_0x5e8bc4[_0x80ec('0x48')]['id']){delete _0x5e8bc4[_0x80ec('0x48')]['id'];}return db[_0x80ec('0x2c')]['find']({'where':{'id':_0x5e8bc4[_0x80ec('0x49')]['id']}})[_0x80ec('0x24')](handleEntityNotFound(_0x4a175c,null))[_0x80ec('0x24')](saveUpdates(_0x5e8bc4[_0x80ec('0x48')],null))[_0x80ec('0x24')](respondWithResult(_0x4a175c,null))[_0x80ec('0x46')](handleError(_0x4a175c,null));};exports['destroy']=function(_0x4d8a35,_0x2a2998){return db[_0x80ec('0x2c')][_0x80ec('0x45')]({'where':{'id':_0x4d8a35[_0x80ec('0x49')]['id']}})[_0x80ec('0x24')](handleEntityNotFound(_0x2a2998,null))[_0x80ec('0x24')](removeEntity(_0x2a2998,null))[_0x80ec('0x46')](handleError(_0x2a2998,null));};exports['describe']=function(_0x1fd78a,_0x45b639){return db['ChatInternalMessage'][_0x80ec('0x4a')]()['then'](respondWithResult(_0x45b639,null))[_0x80ec('0x46')](handleError(_0x45b639,null));};function wrapUser(_0x61559d){return function(_0x58675b){var _0xea794b=_0x61559d[_0x80ec('0x4b')]({'plain':!![]});_0xea794b['messages']=[];if(_0x58675b){_0xea794b[_0x80ec('0x4c')]=_0x58675b[_0x80ec('0x4d')];_0xea794b[_0x80ec('0x4e')]=_0x58675b;}else{_0xea794b['lastMessageAt']=moment(0x0)[_0x80ec('0x4f')](_0x80ec('0x50'));_0xea794b[_0x80ec('0x4e')]={};}return _0xea794b;};}exports[_0x80ec('0x51')]=function(_0x4acf0c,_0x8e76bc,_0x54121d){var _0x3f6cbb=[];return db[_0x80ec('0x52')]['findAll']({'where':{'role':[_0x80ec('0x53'),_0x80ec('0x54'),'user']},'attributes':['id',_0x80ec('0x55'),_0x80ec('0x28'),_0x80ec('0x56'),_0x80ec('0x57'),'internal',_0x80ec('0x58'),'lastLoginAt',_0x80ec('0x59'),_0x80ec('0x5a')],'order':qs[_0x80ec('0x3b')](_0x80ec('0x5b')),'include':[{'model':db[_0x80ec('0x5c')],'as':'VoiceQueues','attributes':['id','name','type'],'through':{'attributes':[]}}]})['then'](function(_0x5974e5){if(_0x5974e5){var _0x11b84f=_0x4acf0c[_0x80ec('0x5d')]['get']({'plain':!![]});if(!_0x11b84f)throw new Error(_0x80ec('0x5e'));if(_0x11b84f[_0x80ec('0x56')]===_0x80ec('0x5d')){return db[_0x80ec('0x5f')][_0x80ec('0x45')]({'where':{'name':_0x80ec('0x60'),'userProfileId':_0x11b84f[_0x80ec('0x61')]},'raw':!![]})[_0x80ec('0x24')](function(_0x4fc36a){if(_0x4fc36a){if(_0x4fc36a[_0x80ec('0x62')]===0x0){return db[_0x80ec('0x63')]['findAll']({'where':{'sectionId':_0x4fc36a['id']},'raw':!![]})[_0x80ec('0x24')](function(_0x5b8bc7){var _0x287b5e=[];if(_[_0x80ec('0x64')](_0x5b8bc7)){_0x287b5e=_[_0x80ec('0x3d')](_0x5974e5,function(_0x11255e){if(_0x11255e[_0x80ec('0x56')]!==_0x80ec('0x53')){return _0x11255e;}});return _0x287b5e;}else{for(var _0xc0f4d6=0x0;_0xc0f4d6<_0x5974e5['length'];_0xc0f4d6++){var _0x4b0aa4=_0x5974e5[_0xc0f4d6];if(_0x4b0aa4[_0x80ec('0x56')]===_0x80ec('0x53')){var _0x35f46e=_[_0x80ec('0x45')](_0x5b8bc7,function(_0x5cdccf){return _0x5cdccf[_0x80ec('0x65')]===_0x4b0aa4['id'];});if(_0x35f46e)_0x287b5e['push'](_0x4b0aa4);}else{_0x287b5e['push'](_0x4b0aa4);}}return _0x287b5e;}});}else{return _0x5974e5;}}else{var _0x2fd685=_[_0x80ec('0x3d')](_0x5974e5,function(_0xd57655){if(_0xd57655[_0x80ec('0x56')]!==_0x80ec('0x53')){return _0xd57655;}});return _0x2fd685;}});}else{return _0x5974e5;}}})[_0x80ec('0x24')](function(_0x2b6b21){var _0x54985b=[];if(_0x2b6b21){_0x3f6cbb=_0x2b6b21;for(var _0xde337b=0x0;_0xde337b<_0x2b6b21[_0x80ec('0x37')];_0xde337b+=0x1){_0x3f6cbb[_0xde337b]['messages']=[];_0x54985b[_0x80ec('0x66')](db[_0x80ec('0x2c')]['find']({'where':{'FromId':[_0x4acf0c[_0x80ec('0x5d')]['id'],_0x2b6b21[_0xde337b]['id']],'ToId':[_0x4acf0c[_0x80ec('0x5d')]['id'],_0x2b6b21[_0xde337b]['id']],'ChatGroupId':null},'attributes':['id',_0x80ec('0x4d'),_0x80ec('0x67'),_0x80ec('0x68'),_0x80ec('0x69'),_0x80ec('0x48')],'order':qs[_0x80ec('0x3b')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x80ec('0x24')](wrapUser(_0x2b6b21[_0xde337b])));}return BPromise['all'](_0x54985b);}return[];})[_0x80ec('0x24')](function(_0x1a4181){return{'rows':_0x1a4181,'count':_0x1a4181[_0x80ec('0x37')]};})[_0x80ec('0x24')](respondWithResult(_0x8e76bc,null))[_0x80ec('0x46')](handleError(_0x8e76bc,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 4957093..bd6857f 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 _0x784b=['ChatInternalMessage','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x27c068,_0x342981){var _0xe5a67f=function(_0x20658a){while(--_0x20658a){_0x27c068['push'](_0x27c068['shift']());}};_0xe5a67f(++_0x342981);}(_0x784b,0x115));var _0xb784=function(_0x527e8a,_0x206e6d){_0x527e8a=_0x527e8a-0x0;var _0x3b7e20=_0x784b[_0x527e8a];return _0x3b7e20;};'use strict';var EventEmitter=require(_0xb784('0x0'));var ChatInternalMessage=require(_0xb784('0x1'))['db'][_0xb784('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb784('0x3'),'afterUpdate':_0xb784('0x4'),'afterDestroy':_0xb784('0x5')};function emitEvent(_0x5b5ea9){return function(_0x41a61e,_0x3ec908,_0xaaef12){ChatInternalMessageEvents[_0xb784('0x6')](_0x5b5ea9+':'+_0x41a61e['id'],_0x41a61e);ChatInternalMessageEvents[_0xb784('0x6')](_0x5b5ea9,_0x41a61e);_0xaaef12(null);};}for(var e in events){if(events[_0xb784('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xb784('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x6d8e=['hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove'];(function(_0x1c1f78,_0x2419f6){var _0x156579=function(_0x1eeba1){while(--_0x1eeba1){_0x1c1f78['push'](_0x1c1f78['shift']());}};_0x156579(++_0x2419f6);}(_0x6d8e,0x8e));var _0xe6d8=function(_0x2e6d1d,_0x1073ea){_0x2e6d1d=_0x2e6d1d-0x0;var _0x2527db=_0x6d8e[_0x2e6d1d];return _0x2527db;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xe6d8('0x0'))['db'][_0xe6d8('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe6d8('0x2')](0x0);var events={'afterCreate':_0xe6d8('0x3'),'afterUpdate':'update','afterDestroy':_0xe6d8('0x4')};function emitEvent(_0x3a0b9a){return function(_0x100869,_0x55a4b5,_0x2d8d44){ChatInternalMessageEvents['emit'](_0x3a0b9a+':'+_0x100869['id'],_0x100869);ChatInternalMessageEvents['emit'](_0x3a0b9a,_0x100869);_0x2d8d44(null);};}for(var e in events){if(events[_0xe6d8('0x5')](e)){var event=events[e];ChatInternalMessage[_0xe6d8('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index b9cd296..fcfeb1c 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 _0x595f=['moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x17a425,_0x29ace3){var _0x5d8e4c=function(_0x245c03){while(--_0x245c03){_0x17a425['push'](_0x17a425['shift']());}};_0x5d8e4c(++_0x29ace3);}(_0x595f,0xb3));var _0xf595=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x595f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf595('0x0'));var util=require(_0xf595('0x1'));var logger=require(_0xf595('0x2'))('api');var moment=require(_0xf595('0x3'));var BPromise=require(_0xf595('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf595('0x5'));var rimraf=require(_0xf595('0x6'));var config=require(_0xf595('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0xf595('0x8')]=function(_0x5284d6,_0x1698b1){return _0x5284d6[_0xf595('0x9')](_0xf595('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf595('0xb'),'collate':_0xf595('0xc')});}; \ No newline at end of file +var _0x5218=['moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x1d2f15,_0x1107c6){var _0x19efd2=function(_0x5e7bf7){while(--_0x5e7bf7){_0x1d2f15['push'](_0x1d2f15['shift']());}};_0x19efd2(++_0x1107c6);}(_0x5218,0xdc));var _0x8521=function(_0x5dfdbe,_0x1772fb){_0x5dfdbe=_0x5dfdbe-0x0;var _0x166d58=_0x5218[_0x5dfdbe];return _0x166d58;};'use strict';var _=require(_0x8521('0x0'));var util=require(_0x8521('0x1'));var logger=require(_0x8521('0x2'))(_0x8521('0x3'));var moment=require(_0x8521('0x4'));var BPromise=require(_0x8521('0x5'));var rp=require(_0x8521('0x6'));var fs=require('fs');var path=require(_0x8521('0x7'));var rimraf=require(_0x8521('0x8'));var config=require('../../config/environment');var attributes=require(_0x8521('0x9'));module[_0x8521('0xa')]=function(_0x30f29a,_0x3a3277){return _0x30f29a[_0x8521('0xb')](_0x8521('0xc'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8521('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 7e5c9b3..414f5cf 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 _0x2e2b=['stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x2e2b,0xc9));var _0xb2e2=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x2e2b[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0xb2e2('0x0'));var util=require(_0xb2e2('0x1'));var moment=require('moment');var BPromise=require(_0xb2e2('0x2'));var rs=require(_0xb2e2('0x3'));var fs=require('fs');var Redis=require(_0xb2e2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb2e2('0x5'))(_0xb2e2('0x6'));var config=require(_0xb2e2('0x7'));var jayson=require(_0xb2e2('0x8'));var client=jayson[_0xb2e2('0x9')][_0xb2e2('0xa')]({'port':0x232a});config[_0xb2e2('0xb')]=_[_0xb2e2('0xc')](config['redis'],{'host':_0xb2e2('0xd'),'port':0x18eb});var socket=require(_0xb2e2('0xe'))(new Redis(config[_0xb2e2('0xb')]));require(_0xb2e2('0xf'))[_0xb2e2('0x10')](socket);function respondWithRpcPromise(_0x4c72ff,_0x3b17f2,_0x150b6a){return new BPromise(function(_0x118f39,_0x2d85c2){return client[_0xb2e2('0x11')](_0x4c72ff,_0x150b6a)[_0xb2e2('0x12')](function(_0x37b1f2){logger[_0xb2e2('0x13')](_0xb2e2('0x14'),_0x3b17f2,'request\x20sent');logger['debug'](_0xb2e2('0x15'),_0x3b17f2,_0xb2e2('0x16'),JSON[_0xb2e2('0x17')](_0x37b1f2));if(_0x37b1f2[_0xb2e2('0x18')]){if(_0x37b1f2[_0xb2e2('0x18')][_0xb2e2('0x19')]===0x1f4){logger[_0xb2e2('0x18')](_0xb2e2('0x14'),_0x3b17f2,_0x37b1f2[_0xb2e2('0x18')]['message']);return _0x2d85c2(_0x37b1f2[_0xb2e2('0x18')]['message']);}logger[_0xb2e2('0x18')](_0xb2e2('0x14'),_0x3b17f2,_0x37b1f2['error'][_0xb2e2('0x1a')]);return _0x118f39(_0x37b1f2[_0xb2e2('0x18')][_0xb2e2('0x1a')]);}else{logger[_0xb2e2('0x13')](_0xb2e2('0x14'),_0x3b17f2,_0xb2e2('0x16'));_0x118f39(_0x37b1f2['result'][_0xb2e2('0x1a')]);}})[_0xb2e2('0x1b')](function(_0x297ee0){logger['error'](_0xb2e2('0x14'),_0x3b17f2,_0x297ee0);_0x2d85c2(_0x297ee0);});});} \ No newline at end of file +var _0xf243=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug'];(function(_0x31a938,_0x4daec6){var _0x1bf341=function(_0x514261){while(--_0x514261){_0x31a938['push'](_0x31a938['shift']());}};_0x1bf341(++_0x4daec6);}(_0xf243,0x181));var _0x3f24=function(_0x3f7855,_0x535342){_0x3f7855=_0x3f7855-0x0;var _0x301fb7=_0xf243[_0x3f7855];return _0x301fb7;};'use strict';var _=require(_0x3f24('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3f24('0x1'));var rs=require(_0x3f24('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f24('0x3'))['db'];var utils=require(_0x3f24('0x4'));var logger=require(_0x3f24('0x5'))(_0x3f24('0x6'));var config=require(_0x3f24('0x7'));var jayson=require(_0x3f24('0x8'));var client=jayson[_0x3f24('0x9')]['http']({'port':0x232a});config[_0x3f24('0xa')]=_[_0x3f24('0xb')](config[_0x3f24('0xa')],{'host':_0x3f24('0xc'),'port':0x18eb});var socket=require(_0x3f24('0xd'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x3f24('0xe')](socket);function respondWithRpcPromise(_0xe0c991,_0x26d13a,_0xba162b){return new BPromise(function(_0x30654b,_0x46c93f){return client[_0x3f24('0xf')](_0xe0c991,_0xba162b)[_0x3f24('0x10')](function(_0x380b20){logger[_0x3f24('0x11')](_0x3f24('0x12'),_0x26d13a,'request\x20sent');logger[_0x3f24('0x13')](_0x3f24('0x14'),_0x26d13a,_0x3f24('0x15'),JSON[_0x3f24('0x16')](_0x380b20));if(_0x380b20['error']){if(_0x380b20['error'][_0x3f24('0x17')]===0x1f4){logger[_0x3f24('0x18')](_0x3f24('0x12'),_0x26d13a,_0x380b20[_0x3f24('0x18')][_0x3f24('0x19')]);return _0x46c93f(_0x380b20['error'][_0x3f24('0x19')]);}logger[_0x3f24('0x18')](_0x3f24('0x12'),_0x26d13a,_0x380b20['error'][_0x3f24('0x19')]);return _0x30654b(_0x380b20[_0x3f24('0x18')]['message']);}else{logger['info'](_0x3f24('0x12'),_0x26d13a,_0x3f24('0x15'));_0x30654b(_0x380b20['result'][_0x3f24('0x19')]);}})[_0x3f24('0x1a')](function(_0x219232){logger['error'](_0x3f24('0x12'),_0x26d13a,_0x219232);_0x46c93f(_0x219232);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 77bf1b9..3898296 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 _0x0c6f=['length','chatInternalMessage:','save','remove','update','emit','removeListener','register'];(function(_0x1a69df,_0xaad1db){var _0xb82082=function(_0x46cdea){while(--_0x46cdea){_0x1a69df['push'](_0x1a69df['shift']());}};_0xb82082(++_0xaad1db);}(_0x0c6f,0x112));var _0xf0c6=function(_0x56418e,_0x362812){_0x56418e=_0x56418e-0x0;var _0x5b160c=_0x0c6f[_0x56418e];return _0x5b160c;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xf0c6('0x0'),_0xf0c6('0x1'),_0xf0c6('0x2')];function createListener(_0x293eae,_0x4e3a7c){return function(_0x3a9f24){_0x4e3a7c[_0xf0c6('0x3')](_0x293eae,_0x3a9f24);};}function removeListener(_0x373f7d,_0x4fcb7e){return function(){ChatInternalMessageEvents[_0xf0c6('0x4')](_0x373f7d,_0x4fcb7e);};}exports[_0xf0c6('0x5')]=function(_0x45e44c){for(var _0x5be49b=0x0,_0x395a0e=events[_0xf0c6('0x6')];_0x5be49b<_0x395a0e;_0x5be49b++){var _0x21d98c=events[_0x5be49b];var _0x5cc242=createListener(_0xf0c6('0x7')+_0x21d98c,_0x45e44c);ChatInternalMessageEvents['on'](_0x21d98c,_0x5cc242);}}; \ No newline at end of file +var _0x844e=['emit','removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0x844e,0xfc));var _0xe844=function(_0x561ea6,_0x216259){_0x561ea6=_0x561ea6-0x0;var _0x2cbbae=_0x844e[_0x561ea6];return _0x2cbbae;};'use strict';var ChatInternalMessageEvents=require(_0xe844('0x0'));var events=[_0xe844('0x1'),_0xe844('0x2'),_0xe844('0x3')];function createListener(_0x170a53,_0x57bce0){return function(_0x18afd5){_0x57bce0[_0xe844('0x4')](_0x170a53,_0x18afd5);};}function removeListener(_0x37fcc9,_0x2a0553){return function(){ChatInternalMessageEvents[_0xe844('0x5')](_0x37fcc9,_0x2a0553);};}exports['register']=function(_0x2e29a5){for(var _0x1b7823=0x0,_0x2e0ee9=events[_0xe844('0x6')];_0x1b7823<_0x2e0ee9;_0x1b7823++){var _0x309476=events[_0x1b7823];var _0x265622=createListener(_0xe844('0x7')+_0x309476,_0x2e29a5);ChatInternalMessageEvents['on'](_0x309476,_0x265622);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 62811e3..14069e8 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 _0x0539=['/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','getUsers','post','create'];(function(_0x34ab70,_0x26d42b){var _0xbfc91e=function(_0x5aad62){while(--_0x5aad62){_0x34ab70['push'](_0x34ab70['shift']());}};_0xbfc91e(++_0x26d42b);}(_0x0539,0x112));var _0x9053=function(_0x57dc54,_0xbd45cc){_0x57dc54=_0x57dc54-0x0;var _0x5b0ff4=_0x0539[_0x57dc54];return _0x5b0ff4;};'use strict';var multer=require(_0x9053('0x0'));var util=require(_0x9053('0x1'));var path=require('path');var timeout=require(_0x9053('0x2'));var express=require(_0x9053('0x3'));var router=express[_0x9053('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9053('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9053('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x9053('0x7')]('/',auth[_0x9053('0x8')](),controller[_0x9053('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x9053('0xa')]);router[_0x9053('0x7')]('/users',auth[_0x9053('0x8')](),controller[_0x9053('0xb')]);router[_0x9053('0x7')]('/:id',auth[_0x9053('0x8')](),controller['show']);router[_0x9053('0xc')]('/',auth[_0x9053('0x8')](),controller[_0x9053('0xd')]);router['put'](_0x9053('0xe'),controller['update']);router[_0x9053('0xf')]('/:id',auth[_0x9053('0x8')](),controller[_0x9053('0x10')]);module[_0x9053('0x11')]=router; \ No newline at end of file +var _0x6e3d=['put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers','/:id','show','post'];(function(_0x31c7c2,_0x3febc2){var _0x3536fc=function(_0x476e52){while(--_0x476e52){_0x31c7c2['push'](_0x31c7c2['shift']());}};_0x3536fc(++_0x3febc2);}(_0x6e3d,0x190));var _0xd6e3=function(_0x17a32f,_0x5a51a){_0x17a32f=_0x17a32f-0x0;var _0x15a293=_0x6e3d[_0x17a32f];return _0x15a293;};'use strict';var multer=require(_0xd6e3('0x0'));var util=require('util');var path=require(_0xd6e3('0x1'));var timeout=require(_0xd6e3('0x2'));var express=require(_0xd6e3('0x3'));var router=express[_0xd6e3('0x4')]();var fs_extra=require(_0xd6e3('0x5'));var auth=require(_0xd6e3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd6e3('0x7'));var controller=require(_0xd6e3('0x8'));router[_0xd6e3('0x9')]('/',auth[_0xd6e3('0xa')](),controller['index']);router[_0xd6e3('0x9')](_0xd6e3('0xb'),auth[_0xd6e3('0xa')](),controller[_0xd6e3('0xc')]);router['get'](_0xd6e3('0xd'),auth[_0xd6e3('0xa')](),controller[_0xd6e3('0xe')]);router[_0xd6e3('0x9')](_0xd6e3('0xf'),auth['isAuthenticated'](),controller[_0xd6e3('0x10')]);router[_0xd6e3('0x11')]('/',auth[_0xd6e3('0xa')](),controller['create']);router[_0xd6e3('0x12')](_0xd6e3('0xf'),controller['update']);router[_0xd6e3('0x13')]('/:id',auth[_0xd6e3('0xa')](),controller[_0xd6e3('0x14')]);module[_0xd6e3('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 fe2fd09..c3b6f74 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 _0x153c=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x355e1d,_0x3536ec){var _0x389764=function(_0x29645c){while(--_0x29645c){_0x355e1d['push'](_0x355e1d['shift']());}};_0x389764(++_0x3536ec);}(_0x153c,0x8c));var _0xc153=function(_0x5c63ea,_0x1c139b){_0x5c63ea=_0x5c63ea-0x0;var _0x2c9038=_0x153c[_0x5c63ea];return _0x2c9038;};'use strict';var Sequelize=require(_0xc153('0x0'));module[_0xc153('0x1')]={'body':{'type':Sequelize[_0xc153('0x2')](_0xc153('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xc153('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc153('0x5')]('in',_0xc153('0x6')),'defaultValue':_0xc153('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc153('0x7')]},'providerName':{'type':Sequelize[_0xc153('0x8')]},'providerResponse':{'type':Sequelize[_0xc153('0x2')]}}; \ No newline at end of file +var _0xf45e=['ENUM','out','DATE','STRING','sequelize','TEXT','BOOLEAN'];(function(_0x412f73,_0x3f1870){var _0x5733b7=function(_0x3b25f6){while(--_0x3b25f6){_0x412f73['push'](_0x412f73['shift']());}};_0x5733b7(++_0x3f1870);}(_0xf45e,0x115));var _0xef45=function(_0x460321,_0x5bc325){_0x460321=_0x460321-0x0;var _0x4a7888=_0xf45e[_0x460321];return _0x4a7888;};'use strict';var Sequelize=require(_0xef45('0x0'));module['exports']={'body':{'type':Sequelize[_0xef45('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xef45('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xef45('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xef45('0x3')]('in',_0xef45('0x4')),'defaultValue':_0xef45('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xef45('0x5')]},'providerName':{'type':Sequelize[_0xef45('0x6')]},'providerResponse':{'type':Sequelize[_0xef45('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 3094045..1037730 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 _0xd96b=['findAll','rows','params','create','body','find','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','EventManager','acceptmessage','parse','ChatInteraction','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SIP/%s','event','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','register','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','sendStatus','name','index','map','ChatMessage','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include'];(function(_0x51575c,_0x5d3060){var _0x34ee93=function(_0x29398a){while(--_0x29398a){_0x51575c['push'](_0x51575c['shift']());}};_0x34ee93(++_0x5d3060);}(_0xd96b,0xbe));var _0xbd96=function(_0x50c3a5,_0x1e1952){_0x50c3a5=_0x50c3a5-0x0;var _0x316f2d=_0xd96b[_0x50c3a5];return _0x316f2d;};'use strict';var emlformat=require(_0xbd96('0x0'));var rimraf=require(_0xbd96('0x1'));var zipdir=require(_0xbd96('0x2'));var jsonpatch=require(_0xbd96('0x3'));var rp=require(_0xbd96('0x4'));var moment=require('moment');var BPromise=require(_0xbd96('0x5'));var Mustache=require(_0xbd96('0x6'));var util=require(_0xbd96('0x7'));var path=require(_0xbd96('0x8'));var sox=require(_0xbd96('0x9'));var csv=require(_0xbd96('0xa'));var ejs=require(_0xbd96('0xb'));var fs=require('fs');var fs_extra=require(_0xbd96('0xc'));var _=require(_0xbd96('0xd'));var squel=require(_0xbd96('0xe'));var crypto=require('crypto');var jsforce=require(_0xbd96('0xf'));var deskjs=require(_0xbd96('0x10'));var toCsv=require(_0xbd96('0xa'));var querystring=require(_0xbd96('0x11'));var Papa=require(_0xbd96('0x12'));var Redis=require(_0xbd96('0x13'));var authService=require(_0xbd96('0x14'));var qs=require(_0xbd96('0x15'));var as=require(_0xbd96('0x16'));var hardwareService=require(_0xbd96('0x17'));var logger=require(_0xbd96('0x18'))(_0xbd96('0x19'));var utils=require('../../config/utils');var config=require(_0xbd96('0x1a'));var licenseUtil=require(_0xbd96('0x1b'));var db=require(_0xbd96('0x1c'))['db'];config['redis']=_[_0xbd96('0x1d')](config[_0xbd96('0x1e')],{'host':_0xbd96('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbd96('0x20'))[_0xbd96('0x21')](socket);var jayson=require('jayson/promise');var client=jayson[_0xbd96('0x22')][_0xbd96('0x23')]({'port':0x232c});var client9002=jayson[_0xbd96('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3239a3,_0x1a4a8b,_0x3f0c01,_0x353fcf){return new BPromise(function(_0x2571a5,_0x3ac9af){var _0x30951c=_0x353fcf||client;return _0x30951c[_0xbd96('0x24')](_0x3239a3,_0x3f0c01)[_0xbd96('0x25')](function(_0x548594){logger['info'](_0xbd96('0x26'),_0x1a4a8b,_0xbd96('0x27'));logger[_0xbd96('0x28')](_0xbd96('0x29'),_0x1a4a8b,_0xbd96('0x27'),JSON[_0xbd96('0x2a')](_0x548594));if(_0x548594[_0xbd96('0x2b')]){if(_0x548594[_0xbd96('0x2b')][_0xbd96('0x2c')]===0x1f4){logger[_0xbd96('0x2b')](_0xbd96('0x26'),_0x1a4a8b,_0x548594[_0xbd96('0x2b')][_0xbd96('0x2d')]);return _0x3ac9af(_0x548594['error'][_0xbd96('0x2d')]);}logger[_0xbd96('0x2b')](_0xbd96('0x26'),_0x1a4a8b,_0x548594[_0xbd96('0x2b')][_0xbd96('0x2d')]);return _0x2571a5(_0x548594['error'][_0xbd96('0x2d')]);}else{logger[_0xbd96('0x2e')](_0xbd96('0x26'),_0x1a4a8b,_0xbd96('0x27'));_0x2571a5(_0x548594['result'][_0xbd96('0x2d')]);}})[_0xbd96('0x2f')](function(_0x33dd2f){logger[_0xbd96('0x2b')](_0xbd96('0x26'),_0x1a4a8b,_0x33dd2f);_0x3ac9af(_0x33dd2f);});});}function respondWithStatusCode(_0x1d4ff3,_0x9aba54){_0x9aba54=_0x9aba54||0xcc;return function(_0x1c8acf){if(_0x1c8acf){return _0x1d4ff3['sendStatus'](_0x9aba54);}return _0x1d4ff3[_0xbd96('0x30')](_0x9aba54)[_0xbd96('0x31')]();};}function respondWithResult(_0x2a0fca,_0x1fdc12){_0x1fdc12=_0x1fdc12||0xc8;return function(_0x36f194){if(_0x36f194){return _0x2a0fca[_0xbd96('0x30')](_0x1fdc12)[_0xbd96('0x32')](_0x36f194);}};}function respondWithFilteredResult(_0x242389,_0x488f27){return function(_0x488a6f){if(_0x488a6f){var _0x11b247=typeof _0x488f27[_0xbd96('0x33')]===_0xbd96('0x34')&&typeof _0x488f27[_0xbd96('0x35')]==='undefined';var _0x3b06fb=_0x488a6f[_0xbd96('0x36')];var _0x2aea9c=_0x11b247?0x0:_0x488f27[_0xbd96('0x33')];var _0x3f628f=_0x11b247?_0x488a6f[_0xbd96('0x36')]:_0x488f27[_0xbd96('0x33')]+_0x488f27['limit'];var _0x135f5e;if(_0x3f628f>=_0x3b06fb){_0x3f628f=_0x3b06fb;_0x135f5e=0xc8;}else{_0x135f5e=0xce;}_0x242389[_0xbd96('0x30')](_0x135f5e);return _0x242389[_0xbd96('0x37')]('Content-Range',_0x2aea9c+'-'+_0x3f628f+'/'+_0x3b06fb)['json'](_0x488a6f);}return null;};}function patchUpdates(_0xa785c5){return function(_0x58934f){try{jsonpatch[_0xbd96('0x38')](_0x58934f,_0xa785c5,!![]);}catch(_0x31238e){return BPromise[_0xbd96('0x39')](_0x31238e);}return _0x58934f[_0xbd96('0x3a')]();};}function saveUpdates(_0x229025,_0x279a4e){return function(_0x55e57d){if(_0x55e57d){return _0x55e57d[_0xbd96('0x3b')](_0x229025)[_0xbd96('0x25')](function(_0xb8e760){return _0xb8e760;});}return null;};}function removeEntity(_0x43f32,_0x55083c){return function(_0xbda61){if(_0xbda61){return _0xbda61[_0xbd96('0x3c')]()['then'](function(){_0x43f32[_0xbd96('0x30')](0xcc)[_0xbd96('0x31')]();});}};}function handleEntityNotFound(_0x2d6126,_0x215fa7){return function(_0x4f684b){if(!_0x4f684b){_0x2d6126[_0xbd96('0x3d')](0x194);}return _0x4f684b;};}function handleError(_0x4a48b2,_0x3c6b13){_0x3c6b13=_0x3c6b13||0x1f4;return function(_0x10e638){logger[_0xbd96('0x2b')](_0x10e638['stack']);if(_0x10e638[_0xbd96('0x3e')]){delete _0x10e638[_0xbd96('0x3e')];}_0x4a48b2[_0xbd96('0x30')](_0x3c6b13)['send'](_0x10e638);};}exports[_0xbd96('0x3f')]=function(_0x2385f6,_0x1b9a01){var _0x13c177={},_0x566d41={},_0x4cd6c8={'count':0x0,'rows':[]};var _0x5692c0=_[_0xbd96('0x40')](db[_0xbd96('0x41')][_0xbd96('0x42')],function(_0x54d83e){return{'name':_0x54d83e[_0xbd96('0x43')],'type':_0x54d83e[_0xbd96('0x44')]['key']};});_0x566d41[_0xbd96('0x45')]=_[_0xbd96('0x40')](_0x5692c0,_0xbd96('0x3e'));_0x566d41[_0xbd96('0x46')]=_[_0xbd96('0x47')](_0x2385f6[_0xbd96('0x46')]);_0x566d41[_0xbd96('0x48')]=_['intersection'](_0x566d41[_0xbd96('0x45')],_0x566d41[_0xbd96('0x46')]);_0x13c177[_0xbd96('0x49')]=_[_0xbd96('0x4a')](_0x566d41[_0xbd96('0x45')],qs[_0xbd96('0x4b')](_0x2385f6[_0xbd96('0x46')]['fields']));_0x13c177[_0xbd96('0x49')]=_0x13c177[_0xbd96('0x49')][_0xbd96('0x4c')]?_0x13c177[_0xbd96('0x49')]:_0x566d41[_0xbd96('0x45')];if(!_0x2385f6[_0xbd96('0x46')][_0xbd96('0x4d')](_0xbd96('0x4e'))){_0x13c177[_0xbd96('0x35')]=qs[_0xbd96('0x35')](_0x2385f6[_0xbd96('0x46')][_0xbd96('0x35')]);_0x13c177[_0xbd96('0x33')]=qs[_0xbd96('0x33')](_0x2385f6['query'][_0xbd96('0x33')]);}_0x13c177['order']=qs[_0xbd96('0x4f')](_0x2385f6[_0xbd96('0x46')][_0xbd96('0x4f')]);_0x13c177[_0xbd96('0x50')]=qs['filters'](_[_0xbd96('0x51')](_0x2385f6['query'],_0x566d41[_0xbd96('0x48')]),_0x5692c0);if(_0x2385f6[_0xbd96('0x46')][_0xbd96('0x52')]){_0x13c177[_0xbd96('0x50')]=_['merge'](_0x13c177[_0xbd96('0x50')],{'$or':_[_0xbd96('0x40')](_0x5692c0,function(_0x2989c1){if(_0x2989c1[_0xbd96('0x44')]!==_0xbd96('0x53')){var _0x12c927={};_0x12c927[_0x2989c1[_0xbd96('0x3e')]]={'$like':'%'+_0x2385f6['query'][_0xbd96('0x52')]+'%'};return _0x12c927;}})});}_0x13c177=_[_0xbd96('0x54')]({},_0x13c177,_0x2385f6[_0xbd96('0x55')]);var _0x308d4e={'where':_0x13c177['where']};return db[_0xbd96('0x41')][_0xbd96('0x36')](_0x308d4e)[_0xbd96('0x25')](function(_0x37e2ad){_0x4cd6c8[_0xbd96('0x36')]=_0x37e2ad;if(_0x2385f6[_0xbd96('0x46')][_0xbd96('0x56')]){_0x13c177[_0xbd96('0x57')]=[{'all':!![]}];}return db['ChatMessage'][_0xbd96('0x58')](_0x13c177);})['then'](function(_0x40b9bc){_0x4cd6c8[_0xbd96('0x59')]=_0x40b9bc;return _0x4cd6c8;})['then'](respondWithFilteredResult(_0x1b9a01,_0x13c177))['catch'](handleError(_0x1b9a01,null));};exports['show']=function(_0x4b9256,_0x18d390){var _0x20bab7={'raw':!![],'where':{'id':_0x4b9256[_0xbd96('0x5a')]['id']}},_0x52d491={};_0x52d491[_0xbd96('0x45')]=_[_0xbd96('0x47')](db[_0xbd96('0x41')][_0xbd96('0x42')]);_0x52d491[_0xbd96('0x46')]=_[_0xbd96('0x47')](_0x4b9256[_0xbd96('0x46')]);_0x52d491[_0xbd96('0x48')]=_['intersection'](_0x52d491[_0xbd96('0x45')],_0x52d491[_0xbd96('0x46')]);_0x20bab7[_0xbd96('0x49')]=_['intersection'](_0x52d491['model'],qs[_0xbd96('0x4b')](_0x4b9256[_0xbd96('0x46')][_0xbd96('0x4b')]));_0x20bab7[_0xbd96('0x49')]=_0x20bab7['attributes'][_0xbd96('0x4c')]?_0x20bab7[_0xbd96('0x49')]:_0x52d491[_0xbd96('0x45')];if(_0x4b9256[_0xbd96('0x46')][_0xbd96('0x56')]){_0x20bab7[_0xbd96('0x57')]=[{'all':!![]}];}_0x20bab7=_[_0xbd96('0x54')]({},_0x20bab7,_0x4b9256[_0xbd96('0x55')]);return db[_0xbd96('0x41')]['find'](_0x20bab7)['then'](handleEntityNotFound(_0x18d390,null))[_0xbd96('0x25')](respondWithResult(_0x18d390,null))['catch'](handleError(_0x18d390,null));};exports[_0xbd96('0x5b')]=function(_0x265a1c,_0x21c082){return db[_0xbd96('0x41')][_0xbd96('0x5b')](_0x265a1c[_0xbd96('0x5c')],{})[_0xbd96('0x25')](respondWithResult(_0x21c082,0xc9))[_0xbd96('0x2f')](handleError(_0x21c082,null));};exports[_0xbd96('0x3b')]=function(_0x388f3c,_0x4d623d){if(_0x388f3c['body']['id']){delete _0x388f3c['body']['id'];}return db[_0xbd96('0x41')]['find']({'where':{'id':_0x388f3c['params']['id']}})[_0xbd96('0x25')](handleEntityNotFound(_0x4d623d,null))[_0xbd96('0x25')](saveUpdates(_0x388f3c['body'],null))[_0xbd96('0x25')](respondWithResult(_0x4d623d,null))[_0xbd96('0x2f')](handleError(_0x4d623d,null));};exports[_0xbd96('0x3c')]=function(_0x5c7ab6,_0x10ebcb){return db[_0xbd96('0x41')][_0xbd96('0x5d')]({'where':{'id':_0x5c7ab6[_0xbd96('0x5a')]['id']}})['then'](handleEntityNotFound(_0x10ebcb,null))['then'](removeEntity(_0x10ebcb,null))['catch'](handleError(_0x10ebcb,null));};exports[_0xbd96('0x5e')]=function(_0x1d1c15,_0x1a0b81){return db['ChatMessage'][_0xbd96('0x5e')]()[_0xbd96('0x25')](respondWithResult(_0x1a0b81,null))[_0xbd96('0x2f')](handleError(_0x1a0b81,null));};var interaction_log=require('../../config/logger')(_0xbd96('0x5f'));exports[_0xbd96('0x60')]=function(_0xc8db36,_0x267c7e,_0x11038d){var _0x323dbe={'agent':{},'channel':_0xbd96('0x61')};if(_0xc8db36['body']['id']){delete _0xc8db36[_0xbd96('0x5c')]['id'];}_0xc8db36['body'][_0xbd96('0x62')]=!![];_0xc8db36[_0xbd96('0x5c')][_0xbd96('0x63')]=moment()['format'](_0xbd96('0x64'));_0xc8db36[_0xbd96('0x5c')][_0xbd96('0x65')]=_0xc8db36[_0xbd96('0x5c')]['UserId']||_0xc8db36[_0xbd96('0x66')]['id'];_0x323dbe[_0xbd96('0x67')]['id']=_0xc8db36[_0xbd96('0x5c')]['UserId'];return db['ChatMessage'][_0xbd96('0x5d')]({'where':{'id':_0xc8db36[_0xbd96('0x5a')]['id'],'UserId':null}})[_0xbd96('0x25')](handleEntityNotFound(_0x267c7e,null))[_0xbd96('0x25')](saveUpdates(_0xc8db36[_0xbd96('0x5c')],null))['then'](function(_0x2d8681){if(_0x2d8681){_0x323dbe[_0xbd96('0x2d')]=_0x2d8681[_0xbd96('0x68')]({'plain':!![]});return db['ChatInteraction'][_0xbd96('0x5d')]({'where':{'id':_0x2d8681['ChatInteractionId']}});}return null;})[_0xbd96('0x25')](handleEntityNotFound(_0x267c7e,null))[_0xbd96('0x25')](function(_0x4dedd8){if(_0x4dedd8){return _0x4dedd8[_0xbd96('0x3b')]({'UserId':_0xc8db36[_0xbd96('0x5c')][_0xbd96('0x65')],'read1stAt':_[_0xbd96('0x69')](_0x4dedd8[_0xbd96('0x6a')])?moment()[_0xbd96('0x6b')](_0xbd96('0x64')):undefined});}return null;})['then'](function(_0x23ffb3){if(_0x23ffb3){_0x323dbe[_0xbd96('0x6c')]=_0x23ffb3[_0xbd96('0x68')]({'plain':!![]});interaction_log[_0xbd96('0x2e')](_0xbd96('0x6d'),_0xc8db36['user']['id'],_0xc8db36[_0xbd96('0x66')][_0xbd96('0x3e')],_0xc8db36[_0xbd96('0x66')][_0xbd96('0x6e')],_0x323dbe[_0xbd96('0x6c')]['id'],_0xc8db36[_0xbd96('0x5c')]?JSON[_0xbd96('0x2a')](_0xc8db36['body']):_0xbd96('0x6f'));return respondWithRpcPromise('AcceptMessage',_0xbd96('0x70'),_0x323dbe);}return null;})[_0xbd96('0x25')](function(_0x26db12){var _0x1036bc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x26db12[_0xbd96('0x2d')][_0xbd96('0x71')];return db['sequelize'][_0xbd96('0x46')](_0x1036bc,{'type':db[_0xbd96('0x72')][_0xbd96('0x73')][_0xbd96('0x74')],'raw':!![]})['then'](function(_0x52ac68){return _0x52ac68;});})['then'](function(_0x2b1ca8){if(_0x2b1ca8){_0x323dbe[_0xbd96('0x2d')][_0xbd96('0x75')]=_0x2b1ca8[0x0];if(!_0xc8db36[_0xbd96('0x5c')][_0xbd96('0x65')])return;return db[_0xbd96('0x76')]['find']({'where':{'id':_0xc8db36[_0xbd96('0x5c')][_0xbd96('0x65')],'role':_0xbd96('0x67')},'attributes':['id',_0xbd96('0x3e'),_0xbd96('0x77'),_0xbd96('0x78'),_0xbd96('0x79')],'raw':!![]});}return null;})[_0xbd96('0x25')](function(_0xd0ba66){if(!_0xd0ba66)return null;_0x323dbe[_0xbd96('0x2d')][_0xbd96('0x67')]=_0xd0ba66;return _0x323dbe;})[_0xbd96('0x25')](function(_0x1caa54){if(_0x1caa54){if(_0xc8db36[_0xbd96('0x5c')][_0xbd96('0x7a')]){_0x323dbe['message'][_0xbd96('0x7b')]=util[_0xbd96('0x6b')]('SIP/%s',_0xc8db36[_0xbd96('0x66')]['name']);_0x323dbe[_0xbd96('0x2d')][_0xbd96('0x7c')]=_0x323dbe['channel'];_0x323dbe['message'][_0xbd96('0x7d')]=_0x323dbe[_0xbd96('0x7c')];_0x323dbe[_0xbd96('0x2d')]['event']='accept';return respondWithRpcPromise(_0xbd96('0x7e'),'EventManager',{'event':_0xbd96('0x7f'),'message':_[_0xbd96('0x54')](_0x323dbe[_0xbd96('0x2d')],JSON[_0xbd96('0x80')](_0x323dbe[_0xbd96('0x6c')]['formData']))},client9002)[_0xbd96('0x25')](function(){return _0x323dbe;});}return _0x323dbe;}return null;})[_0xbd96('0x25')](respondWithResult(_0x267c7e,null))['catch'](handleError(_0x267c7e,null));};var interaction_log=require('../../config/logger')(_0xbd96('0x5f'));exports[_0xbd96('0x39')]=function(_0x31f7e3,_0x5c2405,_0x33765e){var _0x217a50={'agent':{},'channel':_0xbd96('0x61')};if(_0x31f7e3[_0xbd96('0x5c')]['id']){delete _0x31f7e3[_0xbd96('0x5c')]['id'];}_0x31f7e3[_0xbd96('0x5c')][_0xbd96('0x65')]=_0x31f7e3[_0xbd96('0x5c')][_0xbd96('0x65')]||_0x31f7e3[_0xbd96('0x66')]['id'];_0x217a50['agent']['id']=_0x31f7e3[_0xbd96('0x5c')]['UserId'];return db[_0xbd96('0x41')]['find']({'where':{'id':_0x31f7e3[_0xbd96('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5c2405,null))[_0xbd96('0x25')](function(_0x70fd87){if(_0x70fd87){_0x217a50['message']=_0x70fd87[_0xbd96('0x68')]({'plain':!![]});return db[_0xbd96('0x81')]['find']({'where':{'id':_0x70fd87[_0xbd96('0x82')]}});}return null;})[_0xbd96('0x25')](handleEntityNotFound(_0x5c2405,null))[_0xbd96('0x25')](function(_0x5801ee){if(_0x5801ee){_0x217a50['interaction']=_0x5801ee[_0xbd96('0x68')]({'plain':!![]});interaction_log[_0xbd96('0x2e')](_0xbd96('0x83'),_0x31f7e3[_0xbd96('0x66')]['id'],_0x31f7e3['user'][_0xbd96('0x3e')],_0x31f7e3[_0xbd96('0x66')]['role'],_0x217a50[_0xbd96('0x6c')]['id'],_0x31f7e3['body']?JSON[_0xbd96('0x2a')](_0x31f7e3[_0xbd96('0x5c')]):_0xbd96('0x6f'));return respondWithRpcPromise(_0xbd96('0x84'),'rejectMessage',_0x217a50);}return null;})[_0xbd96('0x25')](function(_0x54c7ba){var _0x2f0892=_0xbd96('0x85')+_0x54c7ba[_0xbd96('0x2d')][_0xbd96('0x71')];return db[_0xbd96('0x86')][_0xbd96('0x46')](_0x2f0892,{'type':db[_0xbd96('0x72')][_0xbd96('0x73')]['SELECT'],'raw':!![]})[_0xbd96('0x25')](function(_0x22f6e9){return _0x22f6e9;});})[_0xbd96('0x25')](function(_0x47ad18){if(_0x47ad18){_0x217a50[_0xbd96('0x2d')]['contact']=_0x47ad18[0x0];if(!_0x31f7e3[_0xbd96('0x5c')][_0xbd96('0x65')])return;return db[_0xbd96('0x76')][_0xbd96('0x5d')]({'where':{'id':_0x31f7e3[_0xbd96('0x5c')][_0xbd96('0x65')],'role':'agent'},'attributes':['id',_0xbd96('0x3e'),_0xbd96('0x77'),_0xbd96('0x78'),_0xbd96('0x79')],'raw':!![]});}return null;})[_0xbd96('0x25')](function(_0x386ad4){if(!_0x386ad4)return null;_0x217a50['message'][_0xbd96('0x67')]=_0x386ad4;return _0x217a50;})['then'](function(_0x4910b3){if(_0x4910b3){_0x4910b3[_0xbd96('0x2d')][_0xbd96('0x7b')]=util['format'](_0xbd96('0x87'),_0x31f7e3[_0xbd96('0x66')][_0xbd96('0x3e')]);_0x4910b3[_0xbd96('0x2d')][_0xbd96('0x7c')]=_0x217a50['channel'];_0x4910b3[_0xbd96('0x2d')][_0xbd96('0x7d')]=_0x217a50[_0xbd96('0x7c')];_0x4910b3['message'][_0xbd96('0x88')]=_0xbd96('0x39');respondWithRpcPromise(_0xbd96('0x7e'),_0xbd96('0x7e'),{'event':_0xbd96('0x89'),'message':_['merge'](_0x217a50['message'],JSON[_0xbd96('0x80')](_0x217a50[_0xbd96('0x6c')][_0xbd96('0x8a')]))},client9002);return _0x217a50;}return null;})[_0xbd96('0x25')](respondWithResult(_0x5c2405,null))[_0xbd96('0x2f')](handleError(_0x5c2405,null));}; \ No newline at end of file +var _0x8f56=['desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','ChatMessage','include','params','keys','includeAll','find','create','body','update','describe','../../config/logger','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','read1stAt','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','interaction','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','QueryTypes','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x170d3f,_0x52306d){var _0x254970=function(_0x51a408){while(--_0x51a408){_0x170d3f['push'](_0x170d3f['shift']());}};_0x254970(++_0x52306d);}(_0x8f56,0x72));var _0x68f5=function(_0x364811,_0x60ddf9){_0x364811=_0x364811-0x0;var _0x3706c9=_0x8f56[_0x364811];return _0x3706c9;};'use strict';var emlformat=require(_0x68f5('0x0'));var rimraf=require(_0x68f5('0x1'));var zipdir=require(_0x68f5('0x2'));var jsonpatch=require(_0x68f5('0x3'));var rp=require(_0x68f5('0x4'));var moment=require(_0x68f5('0x5'));var BPromise=require(_0x68f5('0x6'));var Mustache=require(_0x68f5('0x7'));var util=require(_0x68f5('0x8'));var path=require(_0x68f5('0x9'));var sox=require(_0x68f5('0xa'));var csv=require('to-csv');var ejs=require(_0x68f5('0xb'));var fs=require('fs');var fs_extra=require(_0x68f5('0xc'));var _=require(_0x68f5('0xd'));var squel=require(_0x68f5('0xe'));var crypto=require('crypto');var jsforce=require(_0x68f5('0xf'));var deskjs=require(_0x68f5('0x10'));var toCsv=require(_0x68f5('0x11'));var querystring=require('querystring');var Papa=require(_0x68f5('0x12'));var Redis=require('ioredis');var authService=require(_0x68f5('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x68f5('0x14'));var hardwareService=require(_0x68f5('0x15'));var logger=require('../../config/logger')(_0x68f5('0x16'));var utils=require('../../config/utils');var config=require(_0x68f5('0x17'));var licenseUtil=require(_0x68f5('0x18'));var db=require(_0x68f5('0x19'))['db'];config[_0x68f5('0x1a')]=_['defaults'](config[_0x68f5('0x1a')],{'host':_0x68f5('0x1b'),'port':0x18eb});var socket=require(_0x68f5('0x1c'))(new Redis(config['redis']));require(_0x68f5('0x1d'))[_0x68f5('0x1e')](socket);var jayson=require(_0x68f5('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x68f5('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x19dc9d,_0x1bf827,_0x32b476,_0x5e96a9){return new BPromise(function(_0x5291a3,_0x4c80bd){var _0x175f62=_0x5e96a9||client;return _0x175f62[_0x68f5('0x21')](_0x19dc9d,_0x32b476)[_0x68f5('0x22')](function(_0x1bd358){logger[_0x68f5('0x23')](_0x68f5('0x24'),_0x1bf827,_0x68f5('0x25'));logger[_0x68f5('0x26')](_0x68f5('0x27'),_0x1bf827,_0x68f5('0x25'),JSON['stringify'](_0x1bd358));if(_0x1bd358['error']){if(_0x1bd358[_0x68f5('0x28')]['code']===0x1f4){logger[_0x68f5('0x28')](_0x68f5('0x24'),_0x1bf827,_0x1bd358[_0x68f5('0x28')]['message']);return _0x4c80bd(_0x1bd358['error'][_0x68f5('0x29')]);}logger[_0x68f5('0x28')]('ChatMessage,\x20%s,\x20%s',_0x1bf827,_0x1bd358[_0x68f5('0x28')][_0x68f5('0x29')]);return _0x5291a3(_0x1bd358['error']['message']);}else{logger['info'](_0x68f5('0x24'),_0x1bf827,'request\x20sent');_0x5291a3(_0x1bd358['result'][_0x68f5('0x29')]);}})[_0x68f5('0x2a')](function(_0x3be724){logger['error'](_0x68f5('0x24'),_0x1bf827,_0x3be724);_0x4c80bd(_0x3be724);});});}function respondWithStatusCode(_0x59a220,_0x2180e6){_0x2180e6=_0x2180e6||0xcc;return function(_0x2b8974){if(_0x2b8974){return _0x59a220[_0x68f5('0x2b')](_0x2180e6);}return _0x59a220[_0x68f5('0x2c')](_0x2180e6)['end']();};}function respondWithResult(_0x151786,_0x51ed40){_0x51ed40=_0x51ed40||0xc8;return function(_0x5f53b1){if(_0x5f53b1){return _0x151786[_0x68f5('0x2c')](_0x51ed40)[_0x68f5('0x2d')](_0x5f53b1);}};}function respondWithFilteredResult(_0x433c79,_0x10aef0){return function(_0x4bd8af){if(_0x4bd8af){var _0x1711c6=typeof _0x10aef0[_0x68f5('0x2e')]===_0x68f5('0x2f')&&typeof _0x10aef0[_0x68f5('0x30')]===_0x68f5('0x2f');var _0x131b36=_0x4bd8af[_0x68f5('0x31')];var _0xb79a72=_0x1711c6?0x0:_0x10aef0[_0x68f5('0x2e')];var _0x132d06=_0x1711c6?_0x4bd8af[_0x68f5('0x31')]:_0x10aef0[_0x68f5('0x2e')]+_0x10aef0[_0x68f5('0x30')];var _0x54f6ea;if(_0x132d06>=_0x131b36){_0x132d06=_0x131b36;_0x54f6ea=0xc8;}else{_0x54f6ea=0xce;}_0x433c79[_0x68f5('0x2c')](_0x54f6ea);return _0x433c79[_0x68f5('0x32')](_0x68f5('0x33'),_0xb79a72+'-'+_0x132d06+'/'+_0x131b36)[_0x68f5('0x2d')](_0x4bd8af);}return null;};}function patchUpdates(_0x4e9b27){return function(_0x379b64){try{jsonpatch[_0x68f5('0x34')](_0x379b64,_0x4e9b27,!![]);}catch(_0x4cf5fd){return BPromise[_0x68f5('0x35')](_0x4cf5fd);}return _0x379b64[_0x68f5('0x36')]();};}function saveUpdates(_0x5e92bc,_0x5720e9){return function(_0x3da5b7){if(_0x3da5b7){return _0x3da5b7['update'](_0x5e92bc)[_0x68f5('0x22')](function(_0x1d8a19){return _0x1d8a19;});}return null;};}function removeEntity(_0x437a88,_0x65dce){return function(_0x48ba01){if(_0x48ba01){return _0x48ba01[_0x68f5('0x37')]()[_0x68f5('0x22')](function(){_0x437a88[_0x68f5('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe44294,_0x5ed0b4){return function(_0x4c6929){if(!_0x4c6929){_0xe44294[_0x68f5('0x2b')](0x194);}return _0x4c6929;};}function handleError(_0x20c9f7,_0x17e076){_0x17e076=_0x17e076||0x1f4;return function(_0x3db523){logger[_0x68f5('0x28')](_0x3db523[_0x68f5('0x38')]);if(_0x3db523[_0x68f5('0x39')]){delete _0x3db523[_0x68f5('0x39')];}_0x20c9f7['status'](_0x17e076)['send'](_0x3db523);};}exports[_0x68f5('0x3a')]=function(_0x5eb0ce,_0x43e87d){var _0x5d429c={},_0x199a69={},_0x27f56a={'count':0x0,'rows':[]};var _0x18dd72=_[_0x68f5('0x3b')](db['ChatMessage'][_0x68f5('0x3c')],function(_0xe57e3a){return{'name':_0xe57e3a[_0x68f5('0x3d')],'type':_0xe57e3a[_0x68f5('0x3e')][_0x68f5('0x3f')]};});_0x199a69[_0x68f5('0x40')]=_[_0x68f5('0x3b')](_0x18dd72,'name');_0x199a69['query']=_['keys'](_0x5eb0ce[_0x68f5('0x41')]);_0x199a69[_0x68f5('0x42')]=_[_0x68f5('0x43')](_0x199a69['model'],_0x199a69[_0x68f5('0x41')]);_0x5d429c[_0x68f5('0x44')]=_[_0x68f5('0x43')](_0x199a69['model'],qs[_0x68f5('0x45')](_0x5eb0ce[_0x68f5('0x41')][_0x68f5('0x45')]));_0x5d429c[_0x68f5('0x44')]=_0x5d429c['attributes'][_0x68f5('0x46')]?_0x5d429c[_0x68f5('0x44')]:_0x199a69['model'];if(!_0x5eb0ce[_0x68f5('0x41')]['hasOwnProperty'](_0x68f5('0x47'))){_0x5d429c[_0x68f5('0x30')]=qs[_0x68f5('0x30')](_0x5eb0ce[_0x68f5('0x41')][_0x68f5('0x30')]);_0x5d429c['offset']=qs[_0x68f5('0x2e')](_0x5eb0ce['query'][_0x68f5('0x2e')]);}_0x5d429c[_0x68f5('0x48')]=qs[_0x68f5('0x49')](_0x5eb0ce[_0x68f5('0x41')][_0x68f5('0x49')]);_0x5d429c[_0x68f5('0x4a')]=qs[_0x68f5('0x42')](_['pick'](_0x5eb0ce[_0x68f5('0x41')],_0x199a69[_0x68f5('0x42')]),_0x18dd72);if(_0x5eb0ce[_0x68f5('0x41')][_0x68f5('0x4b')]){_0x5d429c[_0x68f5('0x4a')]=_[_0x68f5('0x4c')](_0x5d429c[_0x68f5('0x4a')],{'$or':_[_0x68f5('0x3b')](_0x18dd72,function(_0x234ae0){if(_0x234ae0[_0x68f5('0x3e')]!=='VIRTUAL'){var _0x31a372={};_0x31a372[_0x234ae0[_0x68f5('0x39')]]={'$like':'%'+_0x5eb0ce[_0x68f5('0x41')]['filter']+'%'};return _0x31a372;}})});}_0x5d429c=_[_0x68f5('0x4c')]({},_0x5d429c,_0x5eb0ce[_0x68f5('0x4d')]);var _0x2512d6={'where':_0x5d429c['where']};return db[_0x68f5('0x4e')][_0x68f5('0x31')](_0x2512d6)[_0x68f5('0x22')](function(_0x3ef9f0){_0x27f56a['count']=_0x3ef9f0;if(_0x5eb0ce[_0x68f5('0x41')]['includeAll']){_0x5d429c[_0x68f5('0x4f')]=[{'all':!![]}];}return db[_0x68f5('0x4e')]['findAll'](_0x5d429c);})[_0x68f5('0x22')](function(_0xd358e4){_0x27f56a['rows']=_0xd358e4;return _0x27f56a;})['then'](respondWithFilteredResult(_0x43e87d,_0x5d429c))[_0x68f5('0x2a')](handleError(_0x43e87d,null));};exports['show']=function(_0x565bf7,_0x543899){var _0x123b42={'raw':!![],'where':{'id':_0x565bf7[_0x68f5('0x50')]['id']}},_0x34be81={};_0x34be81['model']=_['keys'](db[_0x68f5('0x4e')][_0x68f5('0x3c')]);_0x34be81[_0x68f5('0x41')]=_[_0x68f5('0x51')](_0x565bf7['query']);_0x34be81[_0x68f5('0x42')]=_[_0x68f5('0x43')](_0x34be81[_0x68f5('0x40')],_0x34be81[_0x68f5('0x41')]);_0x123b42[_0x68f5('0x44')]=_[_0x68f5('0x43')](_0x34be81[_0x68f5('0x40')],qs[_0x68f5('0x45')](_0x565bf7[_0x68f5('0x41')][_0x68f5('0x45')]));_0x123b42['attributes']=_0x123b42[_0x68f5('0x44')]['length']?_0x123b42['attributes']:_0x34be81[_0x68f5('0x40')];if(_0x565bf7[_0x68f5('0x41')][_0x68f5('0x52')]){_0x123b42['include']=[{'all':!![]}];}_0x123b42=_[_0x68f5('0x4c')]({},_0x123b42,_0x565bf7[_0x68f5('0x4d')]);return db[_0x68f5('0x4e')][_0x68f5('0x53')](_0x123b42)[_0x68f5('0x22')](handleEntityNotFound(_0x543899,null))[_0x68f5('0x22')](respondWithResult(_0x543899,null))[_0x68f5('0x2a')](handleError(_0x543899,null));};exports['create']=function(_0x2c7e7e,_0x2d2345){return db[_0x68f5('0x4e')][_0x68f5('0x54')](_0x2c7e7e[_0x68f5('0x55')],{})['then'](respondWithResult(_0x2d2345,0xc9))[_0x68f5('0x2a')](handleError(_0x2d2345,null));};exports[_0x68f5('0x56')]=function(_0x76d9fe,_0x279d4e){if(_0x76d9fe[_0x68f5('0x55')]['id']){delete _0x76d9fe['body']['id'];}return db[_0x68f5('0x4e')][_0x68f5('0x53')]({'where':{'id':_0x76d9fe['params']['id']}})[_0x68f5('0x22')](handleEntityNotFound(_0x279d4e,null))[_0x68f5('0x22')](saveUpdates(_0x76d9fe[_0x68f5('0x55')],null))[_0x68f5('0x22')](respondWithResult(_0x279d4e,null))[_0x68f5('0x2a')](handleError(_0x279d4e,null));};exports[_0x68f5('0x37')]=function(_0x42428c,_0x197b40){return db[_0x68f5('0x4e')][_0x68f5('0x53')]({'where':{'id':_0x42428c[_0x68f5('0x50')]['id']}})[_0x68f5('0x22')](handleEntityNotFound(_0x197b40,null))[_0x68f5('0x22')](removeEntity(_0x197b40,null))['catch'](handleError(_0x197b40,null));};exports[_0x68f5('0x57')]=function(_0x4ebae0,_0x432deb){return db[_0x68f5('0x4e')]['describe']()[_0x68f5('0x22')](respondWithResult(_0x432deb,null))[_0x68f5('0x2a')](handleError(_0x432deb,null));};var interaction_log=require(_0x68f5('0x58'))('chat-interactions');exports[_0x68f5('0x59')]=function(_0x3584b7,_0x2c8430,_0x3e21dd){var _0x1c04fc={'agent':{},'channel':_0x68f5('0x5a')};if(_0x3584b7[_0x68f5('0x55')]['id']){delete _0x3584b7[_0x68f5('0x55')]['id'];}_0x3584b7['body'][_0x68f5('0x5b')]=!![];_0x3584b7[_0x68f5('0x55')][_0x68f5('0x5c')]=moment()[_0x68f5('0x5d')](_0x68f5('0x5e'));_0x3584b7[_0x68f5('0x55')][_0x68f5('0x5f')]=_0x3584b7[_0x68f5('0x55')][_0x68f5('0x5f')]||_0x3584b7[_0x68f5('0x60')]['id'];_0x1c04fc[_0x68f5('0x61')]['id']=_0x3584b7[_0x68f5('0x55')]['UserId'];return db[_0x68f5('0x4e')][_0x68f5('0x53')]({'where':{'id':_0x3584b7[_0x68f5('0x50')]['id'],'UserId':null}})[_0x68f5('0x22')](handleEntityNotFound(_0x2c8430,null))[_0x68f5('0x22')](saveUpdates(_0x3584b7[_0x68f5('0x55')],null))[_0x68f5('0x22')](function(_0x2e2cb5){if(_0x2e2cb5){_0x1c04fc[_0x68f5('0x29')]=_0x2e2cb5['get']({'plain':!![]});return db[_0x68f5('0x62')][_0x68f5('0x53')]({'where':{'id':_0x2e2cb5['ChatInteractionId']}});}return null;})[_0x68f5('0x22')](handleEntityNotFound(_0x2c8430,null))[_0x68f5('0x22')](function(_0x35e410){if(_0x35e410){return _0x35e410[_0x68f5('0x56')]({'UserId':_0x3584b7['body']['UserId'],'read1stAt':_['isNil'](_0x35e410[_0x68f5('0x63')])?moment()[_0x68f5('0x5d')](_0x68f5('0x5e')):undefined});}return null;})[_0x68f5('0x22')](function(_0x3ed989){if(_0x3ed989){_0x1c04fc['interaction']=_0x3ed989[_0x68f5('0x64')]({'plain':!![]});interaction_log[_0x68f5('0x23')](_0x68f5('0x65'),_0x3584b7['user']['id'],_0x3584b7[_0x68f5('0x60')]['name'],_0x3584b7[_0x68f5('0x60')][_0x68f5('0x66')],_0x1c04fc['interaction']['id'],_0x3584b7[_0x68f5('0x55')]?JSON[_0x68f5('0x67')](_0x3584b7[_0x68f5('0x55')]):_0x68f5('0x68'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x1c04fc);}return null;})[_0x68f5('0x22')](function(_0x94b3b6){var _0x4ad6f6=_0x68f5('0x69')+_0x94b3b6[_0x68f5('0x29')][_0x68f5('0x6a')];return db[_0x68f5('0x6b')]['query'](_0x4ad6f6,{'type':db['Sequelize']['QueryTypes'][_0x68f5('0x6c')],'raw':!![]})[_0x68f5('0x22')](function(_0x4a3ee5){return _0x4a3ee5;});})[_0x68f5('0x22')](function(_0x889104){if(_0x889104){_0x1c04fc[_0x68f5('0x29')][_0x68f5('0x6d')]=_0x889104[0x0];if(!_0x3584b7[_0x68f5('0x55')][_0x68f5('0x5f')])return;return db[_0x68f5('0x6e')][_0x68f5('0x53')]({'where':{'id':_0x3584b7[_0x68f5('0x55')][_0x68f5('0x5f')],'role':_0x68f5('0x61')},'attributes':['id',_0x68f5('0x39'),_0x68f5('0x6f'),_0x68f5('0x70'),_0x68f5('0x71')],'raw':!![]});}return null;})[_0x68f5('0x22')](function(_0x3cda1f){if(!_0x3cda1f)return null;_0x1c04fc['message'][_0x68f5('0x61')]=_0x3cda1f;return _0x1c04fc;})[_0x68f5('0x22')](function(_0x41e8af){if(_0x41e8af){if(_0x3584b7['body'][_0x68f5('0x72')]){_0x1c04fc[_0x68f5('0x29')][_0x68f5('0x73')]=util[_0x68f5('0x5d')](_0x68f5('0x74'),_0x3584b7[_0x68f5('0x60')][_0x68f5('0x39')]);_0x1c04fc[_0x68f5('0x29')][_0x68f5('0x75')]=_0x1c04fc[_0x68f5('0x75')];_0x1c04fc[_0x68f5('0x29')][_0x68f5('0x76')]=_0x1c04fc[_0x68f5('0x75')];_0x1c04fc[_0x68f5('0x29')]['event']=_0x68f5('0x59');return respondWithRpcPromise('EventManager',_0x68f5('0x77'),{'event':_0x68f5('0x78'),'message':_[_0x68f5('0x4c')](_0x1c04fc[_0x68f5('0x29')],JSON[_0x68f5('0x79')](_0x1c04fc[_0x68f5('0x7a')][_0x68f5('0x7b')]))},client9002)[_0x68f5('0x22')](function(){return _0x1c04fc;});}return _0x1c04fc;}return null;})[_0x68f5('0x22')](respondWithResult(_0x2c8430,null))['catch'](handleError(_0x2c8430,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['reject']=function(_0x5eb3b1,_0x53705f,_0x105b36){var _0x5b632f={'agent':{},'channel':_0x68f5('0x5a')};if(_0x5eb3b1[_0x68f5('0x55')]['id']){delete _0x5eb3b1['body']['id'];}_0x5eb3b1[_0x68f5('0x55')][_0x68f5('0x5f')]=_0x5eb3b1[_0x68f5('0x55')]['UserId']||_0x5eb3b1[_0x68f5('0x60')]['id'];_0x5b632f['agent']['id']=_0x5eb3b1[_0x68f5('0x55')][_0x68f5('0x5f')];return db[_0x68f5('0x4e')][_0x68f5('0x53')]({'where':{'id':_0x5eb3b1[_0x68f5('0x50')]['id'],'UserId':null}})[_0x68f5('0x22')](handleEntityNotFound(_0x53705f,null))[_0x68f5('0x22')](function(_0x5da32c){if(_0x5da32c){_0x5b632f[_0x68f5('0x29')]=_0x5da32c['get']({'plain':!![]});return db['ChatInteraction'][_0x68f5('0x53')]({'where':{'id':_0x5da32c[_0x68f5('0x7c')]}});}return null;})[_0x68f5('0x22')](handleEntityNotFound(_0x53705f,null))[_0x68f5('0x22')](function(_0x1df284){if(_0x1df284){_0x5b632f[_0x68f5('0x7a')]=_0x1df284['get']({'plain':!![]});interaction_log[_0x68f5('0x23')](_0x68f5('0x7d'),_0x5eb3b1[_0x68f5('0x60')]['id'],_0x5eb3b1[_0x68f5('0x60')][_0x68f5('0x39')],_0x5eb3b1['user'][_0x68f5('0x66')],_0x5b632f[_0x68f5('0x7a')]['id'],_0x5eb3b1[_0x68f5('0x55')]?JSON[_0x68f5('0x67')](_0x5eb3b1[_0x68f5('0x55')]):_0x68f5('0x68'));return respondWithRpcPromise(_0x68f5('0x7e'),'rejectMessage',_0x5b632f);}return null;})[_0x68f5('0x22')](function(_0x290220){var _0x305bf4=_0x68f5('0x69')+_0x290220['message'][_0x68f5('0x6a')];return db[_0x68f5('0x6b')][_0x68f5('0x41')](_0x305bf4,{'type':db['Sequelize'][_0x68f5('0x7f')][_0x68f5('0x6c')],'raw':!![]})[_0x68f5('0x22')](function(_0x2187eb){return _0x2187eb;});})[_0x68f5('0x22')](function(_0x516acf){if(_0x516acf){_0x5b632f[_0x68f5('0x29')][_0x68f5('0x6d')]=_0x516acf[0x0];if(!_0x5eb3b1[_0x68f5('0x55')][_0x68f5('0x5f')])return;return db[_0x68f5('0x6e')][_0x68f5('0x53')]({'where':{'id':_0x5eb3b1[_0x68f5('0x55')][_0x68f5('0x5f')],'role':'agent'},'attributes':['id',_0x68f5('0x39'),'fullname',_0x68f5('0x70'),_0x68f5('0x71')],'raw':!![]});}return null;})[_0x68f5('0x22')](function(_0x3b805e){if(!_0x3b805e)return null;_0x5b632f[_0x68f5('0x29')][_0x68f5('0x61')]=_0x3b805e;return _0x5b632f;})['then'](function(_0x2527fc){if(_0x2527fc){_0x2527fc['message'][_0x68f5('0x73')]=util['format']('SIP/%s',_0x5eb3b1['user'][_0x68f5('0x39')]);_0x2527fc[_0x68f5('0x29')]['channel']=_0x5b632f[_0x68f5('0x75')];_0x2527fc[_0x68f5('0x29')]['motionChannel']=_0x5b632f['channel'];_0x2527fc[_0x68f5('0x29')][_0x68f5('0x80')]=_0x68f5('0x35');respondWithRpcPromise(_0x68f5('0x77'),'EventManager',{'event':_0x68f5('0x81'),'message':_[_0x68f5('0x4c')](_0x5b632f[_0x68f5('0x29')],JSON[_0x68f5('0x79')](_0x5b632f[_0x68f5('0x7a')]['formData']))},client9002);return _0x5b632f;}return null;})[_0x68f5('0x22')](respondWithResult(_0x53705f,null))[_0x68f5('0x2a')](handleError(_0x53705f,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 79f2201..82b9a0e 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 _0xd171=['ChatMessage','setMaxListeners','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x2ed99e,_0x3cb226){var _0x2e176c=function(_0x3582a7){while(--_0x3582a7){_0x2ed99e['push'](_0x2ed99e['shift']());}};_0x2e176c(++_0x3cb226);}(_0xd171,0xf7));var _0x1d17=function(_0x5c12ae,_0x29ab56){_0x5c12ae=_0x5c12ae-0x0;var _0x6b60d1=_0xd171[_0x5c12ae];return _0x6b60d1;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x1d17('0x0'))['db'][_0x1d17('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1d17('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1d17('0x3'),'afterDestroy':_0x1d17('0x4')};function emitEvent(_0x2d522a){return function(_0x1c4ce2,_0x284616,_0xa61071){ChatMessageEvents[_0x1d17('0x5')](_0x2d522a+':'+_0x1c4ce2['id'],_0x1c4ce2);ChatMessageEvents['emit'](_0x2d522a,_0x1c4ce2);_0xa61071(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x1d17('0x6')](e,emitEvent(event));}}module[_0x1d17('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x2bd2=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x30e0f5,_0x5e4826){var _0x3b5800=function(_0x3d9155){while(--_0x3d9155){_0x30e0f5['push'](_0x30e0f5['shift']());}};_0x3b5800(++_0x5e4826);}(_0x2bd2,0x1cc));var _0x22bd=function(_0x1a2d75,_0x47cf1c){_0x1a2d75=_0x1a2d75-0x0;var _0x331753=_0x2bd2[_0x1a2d75];return _0x331753;};'use strict';var EventEmitter=require(_0x22bd('0x0'));var ChatMessage=require(_0x22bd('0x1'))['db'][_0x22bd('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x22bd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x22bd('0x4'),'afterDestroy':'remove'};function emitEvent(_0x55f157){return function(_0x720a36,_0x4b4882,_0x1c66b3){ChatMessageEvents['emit'](_0x55f157+':'+_0x720a36['id'],_0x720a36);ChatMessageEvents[_0x22bd('0x5')](_0x55f157,_0x720a36);_0x1c66b3(null);};}for(var e in events){if(events[_0x22bd('0x6')](e)){var event=events[e];ChatMessage[_0x22bd('0x7')](e,emitEvent(event));}}module[_0x22bd('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 01690d1..538a1b2 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 _0xb642=['api','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','utf8mb4_unicode_ci','lodash','util'];(function(_0x47a5bd,_0x508329){var _0x5c2184=function(_0x40ddea){while(--_0x40ddea){_0x47a5bd['push'](_0x47a5bd['shift']());}};_0x5c2184(++_0x508329);}(_0xb642,0x8a));var _0x2b64=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb642[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x2b64('0x0'));var util=require(_0x2b64('0x1'));var logger=require('../../config/logger')(_0x2b64('0x2'));var moment=require('moment');var BPromise=require(_0x2b64('0x3'));var rp=require(_0x2b64('0x4'));var fs=require('fs');var path=require(_0x2b64('0x5'));var rimraf=require(_0x2b64('0x6'));var config=require(_0x2b64('0x7'));var attributes=require(_0x2b64('0x8'));module[_0x2b64('0x9')]=function(_0xda7784,_0x2d6287){return _0xda7784[_0x2b64('0xa')](_0x2b64('0xb'),attributes,{'tableName':_0x2b64('0xc'),'paranoid':![],'indexes':[{'name':_0x2b64('0xd'),'fields':[_0x2b64('0xe')],'type':_0x2b64('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6ae688,_0x2c874d,_0x3e9479){var _0x170e4d=_0xda7784['models'];var _0x417ee1=_0x6ae688['get']({'plain':!![]});if(_0x417ee1['direction']['toLowerCase']()==='in'||_0x417ee1[_0x2b64('0x10')][_0x2b64('0x11')]()===_0x2b64('0x12')&&!_0x417ee1[_0x2b64('0x13')]&&!_[_0x2b64('0x14')](_0x417ee1[_0x2b64('0x15')])){_0x170e4d[_0x2b64('0x16')]['findOne']({'where':{'id':_0x417ee1[_0x2b64('0x17')]}})[_0x2b64('0x18')](function(_0x263747){if(_0x263747){_0x263747[_0x2b64('0x19')]({'lastMsgAt':_0x417ee1[_0x2b64('0x1a')],'lastMsgDirection':_0x417ee1[_0x2b64('0x10')][_0x2b64('0x11')]()});}})['catch'](function(_0x3d06c2){console['error'](_0x3d06c2);});}_0x3e9479();}},'charset':'utf8mb4','collate':_0x2b64('0x1b')});}; \ No newline at end of file +var _0xaf93=['util','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','models','get','toLowerCase','direction','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x29afd5,_0xd6faae){var _0x33e0b4=function(_0x2257f5){while(--_0x2257f5){_0x29afd5['push'](_0x29afd5['shift']());}};_0x33e0b4(++_0xd6faae);}(_0xaf93,0x151));var _0x3af9=function(_0x191d10,_0x50aa28){_0x191d10=_0x191d10-0x0;var _0x208332=_0xaf93[_0x191d10];return _0x208332;};'use strict';var _=require(_0x3af9('0x0'));var util=require(_0x3af9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3af9('0x2'));var BPromise=require(_0x3af9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3af9('0x4'));var rimraf=require(_0x3af9('0x5'));var config=require(_0x3af9('0x6'));var attributes=require(_0x3af9('0x7'));module[_0x3af9('0x8')]=function(_0x1ad446,_0x333abb){return _0x1ad446['define'](_0x3af9('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x3af9('0xa'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x43ca48,_0x5d655f,_0x4e8c72){var _0x1313eb=_0x1ad446[_0x3af9('0xb')];var _0x42b89a=_0x43ca48[_0x3af9('0xc')]({'plain':!![]});if(_0x42b89a['direction'][_0x3af9('0xd')]()==='in'||_0x42b89a[_0x3af9('0xe')][_0x3af9('0xd')]()===_0x3af9('0xf')&&!_0x42b89a[_0x3af9('0x10')]&&!_[_0x3af9('0x11')](_0x42b89a[_0x3af9('0x12')])){_0x1313eb[_0x3af9('0x13')]['findOne']({'where':{'id':_0x42b89a[_0x3af9('0x14')]}})['then'](function(_0x152254){if(_0x152254){_0x152254[_0x3af9('0x15')]({'lastMsgAt':_0x42b89a[_0x3af9('0x16')],'lastMsgDirection':_0x42b89a['direction'][_0x3af9('0xd')]()});}})[_0x3af9('0x17')](function(_0x37cb8b){console['error'](_0x37cb8b);});}_0x4e8c72();}},'charset':_0x3af9('0x18'),'collate':_0x3af9('0x19')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 8ec8f22..f0f33dc 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 _0x65ff=['localhost','socket.io-emitter','register','then','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults'];(function(_0x35e2fb,_0x69d8f3){var _0x2d8bfc=function(_0x4ad386){while(--_0x4ad386){_0x35e2fb['push'](_0x35e2fb['shift']());}};_0x2d8bfc(++_0x69d8f3);}(_0x65ff,0x1d4));var _0xf65f=function(_0x5aed69,_0x259b5e){_0x5aed69=_0x5aed69-0x0;var _0x48b0f9=_0x65ff[_0x5aed69];return _0x48b0f9;};'use strict';var _=require(_0xf65f('0x0'));var util=require(_0xf65f('0x1'));var moment=require(_0xf65f('0x2'));var BPromise=require(_0xf65f('0x3'));var rs=require(_0xf65f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf65f('0x5'))['db'];var utils=require(_0xf65f('0x6'));var logger=require(_0xf65f('0x7'))('rpc');var config=require(_0xf65f('0x8'));var jayson=require(_0xf65f('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xf65f('0xa')]=_[_0xf65f('0xb')](config[_0xf65f('0xa')],{'host':_0xf65f('0xc'),'port':0x18eb});var socket=require(_0xf65f('0xd'))(new Redis(config[_0xf65f('0xa')]));require('./chatMessage.socket')[_0xf65f('0xe')](socket);function respondWithRpcPromise(_0x542793,_0x40ec23,_0x55c317){return new BPromise(function(_0xe32b4e,_0x1239b8){return client['request'](_0x542793,_0x55c317)[_0xf65f('0xf')](function(_0x4b751c){logger['info'](_0xf65f('0x10'),_0x40ec23,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x40ec23,_0xf65f('0x11'),JSON[_0xf65f('0x12')](_0x4b751c));if(_0x4b751c['error']){if(_0x4b751c[_0xf65f('0x13')][_0xf65f('0x14')]===0x1f4){logger[_0xf65f('0x13')](_0xf65f('0x10'),_0x40ec23,_0x4b751c['error'][_0xf65f('0x15')]);return _0x1239b8(_0x4b751c[_0xf65f('0x13')][_0xf65f('0x15')]);}logger['error'](_0xf65f('0x10'),_0x40ec23,_0x4b751c['error'][_0xf65f('0x15')]);return _0xe32b4e(_0x4b751c[_0xf65f('0x13')]['message']);}else{logger[_0xf65f('0x16')](_0xf65f('0x10'),_0x40ec23,'request\x20sent');_0xe32b4e(_0x4b751c[_0xf65f('0x17')][_0xf65f('0x15')]);}})[_0xf65f('0x18')](function(_0x3a2856){logger[_0xf65f('0x13')](_0xf65f('0x10'),_0x40ec23,_0x3a2856);_0x1239b8(_0x3a2856);});});}exports[_0xf65f('0x19')]=function(_0x3e684a){var _0x44df9e=this;return new Promise(function(_0x198ff6,_0x43d936){return db[_0xf65f('0x1a')][_0xf65f('0x1b')](_0x3e684a[_0xf65f('0x1c')],{'raw':_0x3e684a[_0xf65f('0x1d')]?_0x3e684a[_0xf65f('0x1d')][_0xf65f('0x1e')]===undefined?!![]:![]:!![]})[_0xf65f('0xf')](function(_0x2ed175){logger['info']('CreateChatMessage',_0x3e684a);logger[_0xf65f('0x1f')](_0xf65f('0x19'),_0x3e684a,JSON[_0xf65f('0x12')](_0x2ed175));_0x198ff6(_0x2ed175);})[_0xf65f('0x18')](function(_0x4b3160){logger[_0xf65f('0x13')](_0xf65f('0x19'),_0x4b3160[_0xf65f('0x15')],_0x3e684a);_0x43d936(_0x44df9e[_0xf65f('0x13')](0x1f4,_0x4b3160['message']));});});}; \ No newline at end of file +var _0xfc89=['code','message','info','result','CreateChatMessage','ChatMessage','create','options','catch','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','register','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x46b579,_0x566d72){var _0x373a12=function(_0xe47070){while(--_0xe47070){_0x46b579['push'](_0x46b579['shift']());}};_0x373a12(++_0x566d72);}(_0xfc89,0xf3));var _0x9fc8=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xfc89[_0x618414];return _0x21c19a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9fc8('0x0'));var BPromise=require('bluebird');var rs=require(_0x9fc8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9fc8('0x2'))['db'];var utils=require(_0x9fc8('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x9fc8('0x4'));var jayson=require(_0x9fc8('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0x9fc8('0x6')]=_[_0x9fc8('0x7')](config[_0x9fc8('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x9fc8('0x8'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x9fc8('0x9')](socket);function respondWithRpcPromise(_0x474545,_0x35ecf0,_0x463b45){return new BPromise(function(_0xd246c8,_0x459ec9){return client['request'](_0x474545,_0x463b45)[_0x9fc8('0xa')](function(_0x6b2947){logger['info'](_0x9fc8('0xb'),_0x35ecf0,'request\x20sent');logger[_0x9fc8('0xc')](_0x9fc8('0xd'),_0x35ecf0,_0x9fc8('0xe'),JSON[_0x9fc8('0xf')](_0x6b2947));if(_0x6b2947[_0x9fc8('0x10')]){if(_0x6b2947['error'][_0x9fc8('0x11')]===0x1f4){logger[_0x9fc8('0x10')](_0x9fc8('0xb'),_0x35ecf0,_0x6b2947['error'][_0x9fc8('0x12')]);return _0x459ec9(_0x6b2947[_0x9fc8('0x10')]['message']);}logger[_0x9fc8('0x10')](_0x9fc8('0xb'),_0x35ecf0,_0x6b2947['error'][_0x9fc8('0x12')]);return _0xd246c8(_0x6b2947[_0x9fc8('0x10')][_0x9fc8('0x12')]);}else{logger[_0x9fc8('0x13')]('ChatMessage,\x20%s,\x20%s',_0x35ecf0,_0x9fc8('0xe'));_0xd246c8(_0x6b2947[_0x9fc8('0x14')][_0x9fc8('0x12')]);}})['catch'](function(_0x4edb29){logger['error'](_0x9fc8('0xb'),_0x35ecf0,_0x4edb29);_0x459ec9(_0x4edb29);});});}exports[_0x9fc8('0x15')]=function(_0x7a7769){var _0x3eea18=this;return new Promise(function(_0x41eb18,_0x92fcf7){return db[_0x9fc8('0x16')][_0x9fc8('0x17')](_0x7a7769['body'],{'raw':_0x7a7769[_0x9fc8('0x18')]?_0x7a7769[_0x9fc8('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x9fc8('0xa')](function(_0x289b65){logger[_0x9fc8('0x13')](_0x9fc8('0x15'),_0x7a7769);logger[_0x9fc8('0xc')]('CreateChatMessage',_0x7a7769,JSON[_0x9fc8('0xf')](_0x289b65));_0x41eb18(_0x289b65);})[_0x9fc8('0x19')](function(_0x22c1da){logger[_0x9fc8('0x10')]('CreateChatMessage',_0x22c1da[_0x9fc8('0x12')],_0x7a7769);_0x92fcf7(_0x3eea18['error'](0x1f4,_0x22c1da[_0x9fc8('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 0b0ff1f..752e849 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 _0xcd59=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x4d55a6,_0x16f460){var _0x158b2d=function(_0x5e296c){while(--_0x5e296c){_0x4d55a6['push'](_0x4d55a6['shift']());}};_0x158b2d(++_0x16f460);}(_0xcd59,0x14b));var _0x9cd5=function(_0x24c963,_0x5f32a4){_0x24c963=_0x24c963-0x0;var _0x32a0eb=_0xcd59[_0x24c963];return _0x32a0eb;};'use strict';var ChatMessageEvents=require(_0x9cd5('0x0'));var events=[_0x9cd5('0x1'),_0x9cd5('0x2'),_0x9cd5('0x3')];function createListener(_0x271070,_0x302b21){return function(_0x4b93b9){_0x302b21[_0x9cd5('0x4')](_0x271070,_0x4b93b9);};}function removeListener(_0x191236,_0xf96efa){return function(){ChatMessageEvents[_0x9cd5('0x5')](_0x191236,_0xf96efa);};}exports[_0x9cd5('0x6')]=function(_0x2db192){for(var _0x46277c=0x0,_0x2cd19a=events[_0x9cd5('0x7')];_0x46277c<_0x2cd19a;_0x46277c++){var _0x3f888f=events[_0x46277c];var _0x545407=createListener(_0x9cd5('0x8')+_0x3f888f,_0x2db192);ChatMessageEvents['on'](_0x3f888f,_0x545407);}}; \ No newline at end of file +var _0xc978=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x4f155c,_0x5f3eb3){var _0x4bbf91=function(_0x1338c5){while(--_0x1338c5){_0x4f155c['push'](_0x4f155c['shift']());}};_0x4bbf91(++_0x5f3eb3);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var ChatMessageEvents=require(_0x8c97('0x0'));var events=[_0x8c97('0x1'),_0x8c97('0x2'),_0x8c97('0x3')];function createListener(_0x371c48,_0x44d4ea){return function(_0x5ef47d){_0x44d4ea[_0x8c97('0x4')](_0x371c48,_0x5ef47d);};}function removeListener(_0x23c28d,_0x3ad972){return function(){ChatMessageEvents[_0x8c97('0x5')](_0x23c28d,_0x3ad972);};}exports[_0x8c97('0x6')]=function(_0x2a9434){for(var _0xabd146=0x0,_0x524196=events[_0x8c97('0x7')];_0xabd146<_0x524196;_0xabd146++){var _0x1b5864=events[_0xabd146];var _0x332cd1=createListener(_0x8c97('0x8')+_0x1b5864,_0x2a9434);ChatMessageEvents['on'](_0x1b5864,_0x332cd1);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index b6fbdac..822b9c0 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 _0x38fe=['../../config/environment','./chatMessage.controller','get','index','isAuthenticated','describe','show','tracked','chat','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3c307c,_0x1b06c4){var _0x32cf08=function(_0x371144){while(--_0x371144){_0x3c307c['push'](_0x3c307c['shift']());}};_0x32cf08(++_0x1b06c4);}(_0x38fe,0xbc));var _0xe38f=function(_0x159caa,_0x26cc40){_0x159caa=_0x159caa-0x0;var _0x19385b=_0x38fe[_0x159caa];return _0x19385b;};'use strict';var multer=require(_0xe38f('0x0'));var util=require(_0xe38f('0x1'));var path=require(_0xe38f('0x2'));var timeout=require(_0xe38f('0x3'));var express=require(_0xe38f('0x4'));var router=express[_0xe38f('0x5')]();var fs_extra=require(_0xe38f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe38f('0x7'));var config=require(_0xe38f('0x8'));var controller=require(_0xe38f('0x9'));router[_0xe38f('0xa')]('/',auth['isAuthenticated'](),controller[_0xe38f('0xb')]);router[_0xe38f('0xa')]('/describe',auth[_0xe38f('0xc')](),controller[_0xe38f('0xd')]);router[_0xe38f('0xa')]('/:id',auth[_0xe38f('0xc')](),controller[_0xe38f('0xe')]);router['post']('/',auth[_0xe38f('0xc')](),interaction[_0xe38f('0xf')](_0xe38f('0x10'),'chatmessage:create'),controller[_0xe38f('0x11')]);router[_0xe38f('0x12')](_0xe38f('0x13'),controller[_0xe38f('0x14')]);router[_0xe38f('0x12')](_0xe38f('0x15'),auth[_0xe38f('0xc')](),controller[_0xe38f('0x16')]);router['put'](_0xe38f('0x17'),auth[_0xe38f('0xc')](),controller[_0xe38f('0x18')]);router[_0xe38f('0x19')](_0xe38f('0x13'),auth['isAuthenticated'](),controller[_0xe38f('0x1a')]);module[_0xe38f('0x1b')]=router; \ No newline at end of file +var _0x0c05=['/:id','show','post','tracked','chat','chatmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index'];(function(_0x3f578f,_0x51f172){var _0x32c754=function(_0x1bd873){while(--_0x1bd873){_0x3f578f['push'](_0x3f578f['shift']());}};_0x32c754(++_0x51f172);}(_0x0c05,0x1ea));var _0x50c0=function(_0x3235a7,_0x24cb3b){_0x3235a7=_0x3235a7-0x0;var _0x56d0b5=_0x0c05[_0x3235a7];return _0x56d0b5;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x50c0('0x0'));var express=require(_0x50c0('0x1'));var router=express[_0x50c0('0x2')]();var fs_extra=require(_0x50c0('0x3'));var auth=require(_0x50c0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x50c0('0x5'));var controller=require(_0x50c0('0x6'));router[_0x50c0('0x7')]('/',auth[_0x50c0('0x8')](),controller[_0x50c0('0x9')]);router['get']('/describe',auth[_0x50c0('0x8')](),controller['describe']);router[_0x50c0('0x7')](_0x50c0('0xa'),auth[_0x50c0('0x8')](),controller[_0x50c0('0xb')]);router[_0x50c0('0xc')]('/',auth['isAuthenticated'](),interaction[_0x50c0('0xd')](_0x50c0('0xe'),_0x50c0('0xf')),controller[_0x50c0('0x10')]);router[_0x50c0('0x11')]('/:id',controller[_0x50c0('0x12')]);router[_0x50c0('0x11')]('/:id/accept',auth[_0x50c0('0x8')](),controller[_0x50c0('0x13')]);router['put'](_0x50c0('0x14'),auth['isAuthenticated'](),controller[_0x50c0('0x15')]);router[_0x50c0('0x16')](_0x50c0('0xa'),auth[_0x50c0('0x8')](),controller[_0x50c0('0x17')]);module[_0x50c0('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index cb14348..4cb43f2 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['medium','TEXT','exports'];(function(_0x5e2e52,_0x13015e){var _0x5631c7=function(_0x186732){while(--_0x186732){_0x5e2e52['push'](_0x5e2e52['shift']());}};_0x5631c7(++_0x13015e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0xb10b=['medium','sequelize','TEXT'];(function(_0x5eed58,_0x12e45c){var _0x1b3cb1=function(_0x19f488){while(--_0x19f488){_0x5eed58['push'](_0x5eed58['shift']());}};_0x1b3cb1(++_0x12e45c);}(_0xb10b,0x12a));var _0xbb10=function(_0x285db,_0x4f4926){_0x285db=_0x285db-0x0;var _0x2ebec6=_0xb10b[_0x285db];return _0x2ebec6;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('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 f5ed24b..a5a7eee 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(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x7a54,0x106));var _0x47a5=function(_0x73f4b7,_0x455cc2){_0x73f4b7=_0x73f4b7-0x0;var _0x5573d8=_0x7a54[_0x73f4b7];return _0x5573d8;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x30d250,_0x62812d){var _0xe8ee29=function(_0x2e574e){while(--_0x2e574e){_0x30d250['push'](_0x30d250['shift']());}};_0xe8ee29(++_0x62812d);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 74b1030..8b24447 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 _0x8e29=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','emit'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x8e29,0x143));var _0x98e2=function(_0x347fe1,_0x19acfe){_0x347fe1=_0x347fe1-0x0;var _0x2e5ba0=_0x8e29[_0x347fe1];return _0x2e5ba0;};'use strict';var EventEmitter=require(_0x98e2('0x0'));var ChatOfflineMessage=require(_0x98e2('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x98e2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x98e2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x521065){return function(_0x3e5108,_0x3112c8,_0x4f3543){ChatOfflineMessageEvents[_0x98e2('0x4')](_0x521065+':'+_0x3e5108['id'],_0x3e5108);ChatOfflineMessageEvents[_0x98e2('0x4')](_0x521065,_0x3e5108);_0x4f3543(null);};}for(var e in events){if(events[_0x98e2('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x98e2('0x6')](e,emitEvent(event));}}module[_0x98e2('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x9c94=['hook','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x41bf7e,_0x18dc03){var _0x56e21e=function(_0x2ce8b7){while(--_0x2ce8b7){_0x41bf7e['push'](_0x41bf7e['shift']());}};_0x56e21e(++_0x18dc03);}(_0x9c94,0x99));var _0x49c9=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x9c94[_0x172747];return _0x509692;};'use strict';var EventEmitter=require(_0x49c9('0x0'));var ChatOfflineMessage=require(_0x49c9('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x49c9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x49c9('0x3'),'afterDestroy':_0x49c9('0x4')};function emitEvent(_0x5ec825){return function(_0x1c5f95,_0x26b4f7,_0x1d9b76){ChatOfflineMessageEvents['emit'](_0x5ec825+':'+_0x1c5f95['id'],_0x1c5f95);ChatOfflineMessageEvents[_0x49c9('0x5')](_0x5ec825,_0x1c5f95);_0x1d9b76(null);};}for(var e in events){if(events[_0x49c9('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x49c9('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 022ed57..d2cfde8 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 _0x32f5=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x32f5,0xfe));var _0x532f=function(_0x336804,_0xc50f6e){_0x336804=_0x336804-0x0;var _0x468660=_0x32f5[_0x336804];return _0x468660;};'use strict';var attributes=require(_0x532f('0x0'));module[_0x532f('0x1')]=function(_0xe8f4b6){return _0xe8f4b6[_0x532f('0x2')](_0x532f('0x3'),attributes,{'tableName':_0x532f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x532f('0x5'),'collate':_0x532f('0x6')});}; \ No newline at end of file +var _0x5935=['ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x70c97a,_0xd4d263){var _0x5cb362=function(_0x163f30){while(--_0x163f30){_0x70c97a['push'](_0x70c97a['shift']());}};_0x5cb362(++_0xd4d263);}(_0x5935,0x1b1));var _0x5593=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0x5935[_0x243217];return _0x478029;};'use strict';var attributes=require(_0x5593('0x0'));module[_0x5593('0x1')]=function(_0x1d1c8d){return _0x1d1c8d['define'](_0x5593('0x2'),attributes,{'tableName':_0x5593('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5593('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 63831d8..ab35dab 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 _0x36bb=['error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x188be2,_0x353598){var _0x1d1fca=function(_0x1bcc9f){while(--_0x1bcc9f){_0x188be2['push'](_0x188be2['shift']());}};_0x1d1fca(++_0x353598);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb36b('0x0'));var util=require(_0xb36b('0x1'));var moment=require(_0xb36b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb36b('0x3'));var fs=require('fs');var Redis=require(_0xb36b('0x4'));var db=require(_0xb36b('0x5'))['db'];var utils=require(_0xb36b('0x6'));var logger=require(_0xb36b('0x7'))(_0xb36b('0x8'));var config=require(_0xb36b('0x9'));var jayson=require(_0xb36b('0xa'));var client=jayson[_0xb36b('0xb')][_0xb36b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x181f45,_0x2e9885,_0x229483){return new BPromise(function(_0x30e907,_0x28647b){return client[_0xb36b('0xd')](_0x181f45,_0x229483)[_0xb36b('0xe')](function(_0x38d0d6){logger[_0xb36b('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2e9885,_0xb36b('0x10'));logger[_0xb36b('0x11')](_0xb36b('0x12'),_0x2e9885,'request\x20sent',JSON[_0xb36b('0x13')](_0x38d0d6));if(_0x38d0d6[_0xb36b('0x14')]){if(_0x38d0d6[_0xb36b('0x14')][_0xb36b('0x15')]===0x1f4){logger[_0xb36b('0x14')](_0xb36b('0x16'),_0x2e9885,_0x38d0d6[_0xb36b('0x14')][_0xb36b('0x17')]);return _0x28647b(_0x38d0d6[_0xb36b('0x14')][_0xb36b('0x17')]);}logger[_0xb36b('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2e9885,_0x38d0d6[_0xb36b('0x14')]['message']);return _0x30e907(_0x38d0d6['error'][_0xb36b('0x17')]);}else{logger[_0xb36b('0xf')](_0xb36b('0x16'),_0x2e9885,_0xb36b('0x10'));_0x30e907(_0x38d0d6[_0xb36b('0x18')][_0xb36b('0x17')]);}})['catch'](function(_0x12f119){logger[_0xb36b('0x14')](_0xb36b('0x16'),_0x2e9885,_0x12f119);_0x28647b(_0x12f119);});});} \ No newline at end of file +var _0x815b=['randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x815b,0xb4));var _0xb815=function(_0x10be36,_0x351b39){_0x10be36=_0x10be36-0x0;var _0x922e3c=_0x815b[_0x10be36];return _0x922e3c;};'use strict';var _=require(_0xb815('0x0'));var util=require(_0xb815('0x1'));var moment=require(_0xb815('0x2'));var BPromise=require(_0xb815('0x3'));var rs=require(_0xb815('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb815('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb815('0x6'));var config=require(_0xb815('0x7'));var jayson=require(_0xb815('0x8'));var client=jayson['client'][_0xb815('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f7a40,_0x4930f6,_0xeba45d){return new BPromise(function(_0x479b09,_0x4d0873){return client[_0xb815('0xa')](_0x3f7a40,_0xeba45d)[_0xb815('0xb')](function(_0x3f8c27){logger[_0xb815('0xc')](_0xb815('0xd'),_0x4930f6,_0xb815('0xe'));logger[_0xb815('0xf')](_0xb815('0x10'),_0x4930f6,'request\x20sent',JSON[_0xb815('0x11')](_0x3f8c27));if(_0x3f8c27[_0xb815('0x12')]){if(_0x3f8c27[_0xb815('0x12')][_0xb815('0x13')]===0x1f4){logger[_0xb815('0x12')](_0xb815('0xd'),_0x4930f6,_0x3f8c27[_0xb815('0x12')]['message']);return _0x4d0873(_0x3f8c27['error'][_0xb815('0x14')]);}logger[_0xb815('0x12')](_0xb815('0xd'),_0x4930f6,_0x3f8c27[_0xb815('0x12')][_0xb815('0x14')]);return _0x479b09(_0x3f8c27[_0xb815('0x12')][_0xb815('0x14')]);}else{logger[_0xb815('0xc')](_0xb815('0xd'),_0x4930f6,_0xb815('0xe'));_0x479b09(_0x3f8c27[_0xb815('0x15')][_0xb815('0x14')]);}})[_0xb815('0x16')](function(_0x52d8dd){logger['error'](_0xb815('0xd'),_0x4930f6,_0x52d8dd);_0x4d0873(_0x52d8dd);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 616fcc6..eac04c8 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 _0xb8d3=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','destroy','multer'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb8d3,0xe3));var _0x3b8d=function(_0x249d99,_0x16b584){_0x249d99=_0x249d99-0x0;var _0x5bfb05=_0xb8d3[_0x249d99];return _0x5bfb05;};'use strict';var multer=require(_0x3b8d('0x0'));var util=require(_0x3b8d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3b8d('0x2'));var router=express[_0x3b8d('0x3')]();var fs_extra=require(_0x3b8d('0x4'));var auth=require(_0x3b8d('0x5'));var interaction=require(_0x3b8d('0x6'));var config=require(_0x3b8d('0x7'));var controller=require(_0x3b8d('0x8'));router[_0x3b8d('0x9')]('/',auth[_0x3b8d('0xa')](),controller[_0x3b8d('0xb')]);router[_0x3b8d('0x9')](_0x3b8d('0xc'),auth[_0x3b8d('0xa')](),controller['describe']);router['get'](_0x3b8d('0xd'),auth[_0x3b8d('0xa')](),controller[_0x3b8d('0xe')]);router['post']('/',auth[_0x3b8d('0xa')](),controller[_0x3b8d('0xf')]);router[_0x3b8d('0x10')](_0x3b8d('0xd'),auth[_0x3b8d('0xa')](),controller[_0x3b8d('0x11')]);router['delete']('/:id',auth[_0x3b8d('0xa')](),controller[_0x3b8d('0x12')]);module['exports']=router; \ No newline at end of file +var _0x1beb=['describe','show','post','create','delete','/:id','exports','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe'];(function(_0x559a0a,_0x4576b8){var _0x287f62=function(_0xb167ff){while(--_0xb167ff){_0x559a0a['push'](_0x559a0a['shift']());}};_0x287f62(++_0x4576b8);}(_0x1beb,0x7f));var _0xb1be=function(_0x1a1e0b,_0x25a7db){_0x1a1e0b=_0x1a1e0b-0x0;var _0x49d1ca=_0x1beb[_0x1a1e0b];return _0x49d1ca;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb1be('0x0'));var router=express[_0xb1be('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xb1be('0x2'));var interaction=require(_0xb1be('0x3'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0xb1be('0x4')](),controller[_0xb1be('0x5')]);router[_0xb1be('0x6')](_0xb1be('0x7'),auth[_0xb1be('0x4')](),controller[_0xb1be('0x8')]);router[_0xb1be('0x6')]('/:id',auth[_0xb1be('0x4')](),controller[_0xb1be('0x9')]);router[_0xb1be('0xa')]('/',auth[_0xb1be('0x4')](),controller[_0xb1be('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb1be('0xc')](_0xb1be('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xb1be('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 074f1db..dcad31d 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 _0x95f4=['mouseOver','INTEGER','sequelize','exports','STRING','timeout'];(function(_0x53a167,_0x4bf6c7){var _0x150263=function(_0x422191){while(--_0x422191){_0x53a167['push'](_0x53a167['shift']());}};_0x150263(++_0x4bf6c7);}(_0x95f4,0xd4));var _0x495f=function(_0x5195ab,_0x56bf56){_0x5195ab=_0x5195ab-0x0;var _0x125f14=_0x95f4[_0x5195ab];return _0x125f14;};'use strict';var Sequelize=require(_0x495f('0x0'));module[_0x495f('0x1')]={'name':{'type':Sequelize[_0x495f('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x495f('0x3')),'defaultValue':_0x495f('0x4')},'selector':{'type':Sequelize[_0x495f('0x2')]},'timeout':{'type':Sequelize[_0x495f('0x5')]}}; \ No newline at end of file +var _0x12ae=['mouseOver','timeout','INTEGER','sequelize','STRING','ENUM'];(function(_0x2046e1,_0x16d217){var _0x1909f1=function(_0x2c2b54){while(--_0x2c2b54){_0x2046e1['push'](_0x2046e1['shift']());}};_0x1909f1(++_0x16d217);}(_0x12ae,0x141));var _0xe12a=function(_0x3fefb1,_0x4fb79d){_0x3fefb1=_0x3fefb1-0x0;var _0x15fae7=_0x12ae[_0x3fefb1];return _0x15fae7;};'use strict';var Sequelize=require(_0xe12a('0x0'));module['exports']={'name':{'type':Sequelize[_0xe12a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe12a('0x2')](_0xe12a('0x3'),_0xe12a('0x4')),'defaultValue':_0xe12a('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xe12a('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 095ebeb..500476f 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 _0x2b37=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x34061b,_0x404908){var _0x3540ff=function(_0x2cff67){while(--_0x2cff67){_0x34061b['push'](_0x34061b['shift']());}};_0x3540ff(++_0x404908);}(_0x2b37,0x12b));var _0x72b3=function(_0x11c4f2,_0x5dd7a1){_0x11c4f2=_0x11c4f2-0x0;var _0x3b2c0b=_0x2b37[_0x11c4f2];return _0x3b2c0b;};'use strict';var emlformat=require(_0x72b3('0x0'));var rimraf=require(_0x72b3('0x1'));var zipdir=require(_0x72b3('0x2'));var jsonpatch=require(_0x72b3('0x3'));var rp=require(_0x72b3('0x4'));var moment=require(_0x72b3('0x5'));var BPromise=require(_0x72b3('0x6'));var Mustache=require(_0x72b3('0x7'));var util=require(_0x72b3('0x8'));var path=require(_0x72b3('0x9'));var sox=require('sox');var csv=require(_0x72b3('0xa'));var ejs=require(_0x72b3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72b3('0xc'));var squel=require(_0x72b3('0xd'));var crypto=require(_0x72b3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x72b3('0xf'));var toCsv=require(_0x72b3('0xa'));var querystring=require(_0x72b3('0x10'));var Papa=require('papaparse');var Redis=require(_0x72b3('0x11'));var authService=require(_0x72b3('0x12'));var qs=require(_0x72b3('0x13'));var as=require(_0x72b3('0x14'));var hardwareService=require(_0x72b3('0x15'));var logger=require(_0x72b3('0x16'))(_0x72b3('0x17'));var utils=require('../../config/utils');var config=require(_0x72b3('0x18'));var licenseUtil=require(_0x72b3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1db1f9,_0x4ab8f5){_0x4ab8f5=_0x4ab8f5||0xcc;return function(_0x4edac4){if(_0x4edac4){return _0x1db1f9[_0x72b3('0x1a')](_0x4ab8f5);}return _0x1db1f9[_0x72b3('0x1b')](_0x4ab8f5)[_0x72b3('0x1c')]();};}function respondWithResult(_0xbf084f,_0xa8f49d){_0xa8f49d=_0xa8f49d||0xc8;return function(_0x2e6e53){if(_0x2e6e53){return _0xbf084f[_0x72b3('0x1b')](_0xa8f49d)[_0x72b3('0x1d')](_0x2e6e53);}};}function respondWithFilteredResult(_0xced6a,_0x27b991){return function(_0x207bcc){if(_0x207bcc){var _0x516e01=typeof _0x27b991[_0x72b3('0x1e')]===_0x72b3('0x1f')&&typeof _0x27b991[_0x72b3('0x20')]===_0x72b3('0x1f');var _0x35ae21=_0x207bcc[_0x72b3('0x21')];var _0x1b6578=_0x516e01?0x0:_0x27b991['offset'];var _0x9c95ab=_0x516e01?_0x207bcc[_0x72b3('0x21')]:_0x27b991[_0x72b3('0x1e')]+_0x27b991[_0x72b3('0x20')];var _0x22b6aa;if(_0x9c95ab>=_0x35ae21){_0x9c95ab=_0x35ae21;_0x22b6aa=0xc8;}else{_0x22b6aa=0xce;}_0xced6a[_0x72b3('0x1b')](_0x22b6aa);return _0xced6a['set'](_0x72b3('0x22'),_0x1b6578+'-'+_0x9c95ab+'/'+_0x35ae21)['json'](_0x207bcc);}return null;};}function patchUpdates(_0x9a086c){return function(_0x42799e){try{jsonpatch[_0x72b3('0x23')](_0x42799e,_0x9a086c,!![]);}catch(_0x42f03f){return BPromise[_0x72b3('0x24')](_0x42f03f);}return _0x42799e['save']();};}function saveUpdates(_0x48cd73,_0x4261ee){return function(_0x233df1){if(_0x233df1){return _0x233df1[_0x72b3('0x25')](_0x48cd73)[_0x72b3('0x26')](function(_0x2c9c71){return _0x2c9c71;});}return null;};}function removeEntity(_0x2e82a4,_0x105a74){return function(_0x277cee){if(_0x277cee){return _0x277cee['destroy']()['then'](function(){_0x2e82a4[_0x72b3('0x1b')](0xcc)[_0x72b3('0x1c')]();});}};}function handleEntityNotFound(_0x1ce783,_0x46e584){return function(_0x3df948){if(!_0x3df948){_0x1ce783['sendStatus'](0x194);}return _0x3df948;};}function handleError(_0x31553b,_0x274434){_0x274434=_0x274434||0x1f4;return function(_0x5836e1){logger[_0x72b3('0x27')](_0x5836e1[_0x72b3('0x28')]);if(_0x5836e1[_0x72b3('0x29')]){delete _0x5836e1['name'];}_0x31553b[_0x72b3('0x1b')](_0x274434)[_0x72b3('0x2a')](_0x5836e1);};}exports[_0x72b3('0x2b')]=function(_0x546dfd,_0xfa238c){var _0x19afed={'raw':!![],'where':{'id':_0x546dfd[_0x72b3('0x2c')]['id']}},_0x26bead={};_0x26bead[_0x72b3('0x2d')]=_[_0x72b3('0x2e')](db[_0x72b3('0x2f')][_0x72b3('0x30')]);_0x26bead[_0x72b3('0x31')]=_['keys'](_0x546dfd[_0x72b3('0x31')]);_0x26bead[_0x72b3('0x32')]=_[_0x72b3('0x33')](_0x26bead['model'],_0x26bead['query']);_0x19afed[_0x72b3('0x34')]=_[_0x72b3('0x33')](_0x26bead[_0x72b3('0x2d')],qs['fields'](_0x546dfd['query'][_0x72b3('0x35')]));_0x19afed[_0x72b3('0x34')]=_0x19afed[_0x72b3('0x34')][_0x72b3('0x36')]?_0x19afed[_0x72b3('0x34')]:_0x26bead[_0x72b3('0x2d')];if(_0x546dfd[_0x72b3('0x31')][_0x72b3('0x37')]){_0x19afed[_0x72b3('0x38')]=[{'all':!![]}];}_0x19afed=_[_0x72b3('0x39')]({},_0x19afed,_0x546dfd[_0x72b3('0x3a')]);return db['ChatProactiveAction'][_0x72b3('0x3b')](_0x19afed)[_0x72b3('0x26')](handleEntityNotFound(_0xfa238c,null))[_0x72b3('0x26')](respondWithResult(_0xfa238c,null))[_0x72b3('0x3c')](handleError(_0xfa238c,null));};exports[_0x72b3('0x3d')]=function(_0x3b7f0e,_0x7a9d85){return db['ChatProactiveAction'][_0x72b3('0x3d')](_0x3b7f0e[_0x72b3('0x3e')],{})['then'](respondWithResult(_0x7a9d85,0xc9))[_0x72b3('0x3c')](handleError(_0x7a9d85,null));};exports['update']=function(_0x3c5257,_0x354c1e){if(_0x3c5257[_0x72b3('0x3e')]['id']){delete _0x3c5257['body']['id'];}return db[_0x72b3('0x2f')][_0x72b3('0x3b')]({'where':{'id':_0x3c5257[_0x72b3('0x2c')]['id']}})[_0x72b3('0x26')](handleEntityNotFound(_0x354c1e,null))['then'](saveUpdates(_0x3c5257[_0x72b3('0x3e')],null))['then'](respondWithResult(_0x354c1e,null))[_0x72b3('0x3c')](handleError(_0x354c1e,null));};exports[_0x72b3('0x3f')]=function(_0x432b3f,_0x4467dc){return db[_0x72b3('0x2f')]['find']({'where':{'id':_0x432b3f[_0x72b3('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4467dc,null))['then'](removeEntity(_0x4467dc,null))[_0x72b3('0x3c')](handleError(_0x4467dc,null));}; \ No newline at end of file +var _0x54da=['moment','mustache','util','path','sox','fs-extra','lodash','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','name','show','params','keys','ChatProactiveAction','query','intersection','model','fields','attributes','length','includeAll','include','options','catch','create','update','body','find','destroy','eml-format','zip-dir'];(function(_0x1325b5,_0x20c67e){var _0x49e29c=function(_0x142646){while(--_0x142646){_0x1325b5['push'](_0x1325b5['shift']());}};_0x49e29c(++_0x20c67e);}(_0x54da,0x9d));var _0xa54d=function(_0x590861,_0x42c7f3){_0x590861=_0x590861-0x0;var _0x1d0a80=_0x54da[_0x590861];return _0x1d0a80;};'use strict';var emlformat=require(_0xa54d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa54d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa54d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa54d('0x3'));var util=require(_0xa54d('0x4'));var path=require(_0xa54d('0x5'));var sox=require(_0xa54d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa54d('0x7'));var _=require(_0xa54d('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa54d('0x9'));var toCsv=require(_0xa54d('0xa'));var querystring=require(_0xa54d('0xb'));var Papa=require('papaparse');var Redis=require(_0xa54d('0xc'));var authService=require(_0xa54d('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa54d('0xe'));var logger=require('../../config/logger')(_0xa54d('0xf'));var utils=require(_0xa54d('0x10'));var config=require(_0xa54d('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xa54d('0x12'))['db'];function respondWithStatusCode(_0x4aa983,_0x4f1d93){_0x4f1d93=_0x4f1d93||0xcc;return function(_0x5ea2b6){if(_0x5ea2b6){return _0x4aa983[_0xa54d('0x13')](_0x4f1d93);}return _0x4aa983[_0xa54d('0x14')](_0x4f1d93)[_0xa54d('0x15')]();};}function respondWithResult(_0x11d38f,_0xd5c470){_0xd5c470=_0xd5c470||0xc8;return function(_0x5f30f9){if(_0x5f30f9){return _0x11d38f[_0xa54d('0x14')](_0xd5c470)[_0xa54d('0x16')](_0x5f30f9);}};}function respondWithFilteredResult(_0x272e8d,_0xdf2d8){return function(_0x23cd06){if(_0x23cd06){var _0xfc1686=typeof _0xdf2d8[_0xa54d('0x17')]===_0xa54d('0x18')&&typeof _0xdf2d8[_0xa54d('0x19')]===_0xa54d('0x18');var _0x3227f7=_0x23cd06[_0xa54d('0x1a')];var _0x49e221=_0xfc1686?0x0:_0xdf2d8[_0xa54d('0x17')];var _0x1fd2bc=_0xfc1686?_0x23cd06[_0xa54d('0x1a')]:_0xdf2d8[_0xa54d('0x17')]+_0xdf2d8[_0xa54d('0x19')];var _0xa4a36b;if(_0x1fd2bc>=_0x3227f7){_0x1fd2bc=_0x3227f7;_0xa4a36b=0xc8;}else{_0xa4a36b=0xce;}_0x272e8d['status'](_0xa4a36b);return _0x272e8d['set'](_0xa54d('0x1b'),_0x49e221+'-'+_0x1fd2bc+'/'+_0x3227f7)[_0xa54d('0x16')](_0x23cd06);}return null;};}function patchUpdates(_0x44cc3d){return function(_0x23fc6d){try{jsonpatch[_0xa54d('0x1c')](_0x23fc6d,_0x44cc3d,!![]);}catch(_0x2d5893){return BPromise[_0xa54d('0x1d')](_0x2d5893);}return _0x23fc6d[_0xa54d('0x1e')]();};}function saveUpdates(_0x4e4250,_0x42a376){return function(_0x47b7ea){if(_0x47b7ea){return _0x47b7ea['update'](_0x4e4250)[_0xa54d('0x1f')](function(_0x99c1b3){return _0x99c1b3;});}return null;};}function removeEntity(_0x5b135f,_0x5695ad){return function(_0x1447d8){if(_0x1447d8){return _0x1447d8['destroy']()[_0xa54d('0x1f')](function(){_0x5b135f[_0xa54d('0x14')](0xcc)[_0xa54d('0x15')]();});}};}function handleEntityNotFound(_0x346086,_0x37dd6c){return function(_0x468d2e){if(!_0x468d2e){_0x346086[_0xa54d('0x13')](0x194);}return _0x468d2e;};}function handleError(_0x33eb45,_0x4497a0){_0x4497a0=_0x4497a0||0x1f4;return function(_0x15030a){logger[_0xa54d('0x20')](_0x15030a['stack']);if(_0x15030a[_0xa54d('0x21')]){delete _0x15030a[_0xa54d('0x21')];}_0x33eb45[_0xa54d('0x14')](_0x4497a0)['send'](_0x15030a);};}exports[_0xa54d('0x22')]=function(_0xb8661f,_0x13f701){var _0x58b625={'raw':!![],'where':{'id':_0xb8661f[_0xa54d('0x23')]['id']}},_0x2e10ff={};_0x2e10ff['model']=_[_0xa54d('0x24')](db[_0xa54d('0x25')]['rawAttributes']);_0x2e10ff[_0xa54d('0x26')]=_[_0xa54d('0x24')](_0xb8661f['query']);_0x2e10ff['filters']=_[_0xa54d('0x27')](_0x2e10ff[_0xa54d('0x28')],_0x2e10ff['query']);_0x58b625['attributes']=_[_0xa54d('0x27')](_0x2e10ff[_0xa54d('0x28')],qs[_0xa54d('0x29')](_0xb8661f['query']['fields']));_0x58b625['attributes']=_0x58b625[_0xa54d('0x2a')][_0xa54d('0x2b')]?_0x58b625['attributes']:_0x2e10ff[_0xa54d('0x28')];if(_0xb8661f[_0xa54d('0x26')][_0xa54d('0x2c')]){_0x58b625[_0xa54d('0x2d')]=[{'all':!![]}];}_0x58b625=_['merge']({},_0x58b625,_0xb8661f[_0xa54d('0x2e')]);return db[_0xa54d('0x25')]['find'](_0x58b625)[_0xa54d('0x1f')](handleEntityNotFound(_0x13f701,null))[_0xa54d('0x1f')](respondWithResult(_0x13f701,null))[_0xa54d('0x2f')](handleError(_0x13f701,null));};exports[_0xa54d('0x30')]=function(_0x2ecf81,_0x69b869){return db[_0xa54d('0x25')][_0xa54d('0x30')](_0x2ecf81['body'],{})['then'](respondWithResult(_0x69b869,0xc9))[_0xa54d('0x2f')](handleError(_0x69b869,null));};exports[_0xa54d('0x31')]=function(_0x59627b,_0x49d4b8){if(_0x59627b[_0xa54d('0x32')]['id']){delete _0x59627b[_0xa54d('0x32')]['id'];}return db['ChatProactiveAction'][_0xa54d('0x33')]({'where':{'id':_0x59627b[_0xa54d('0x23')]['id']}})['then'](handleEntityNotFound(_0x49d4b8,null))[_0xa54d('0x1f')](saveUpdates(_0x59627b['body'],null))[_0xa54d('0x1f')](respondWithResult(_0x49d4b8,null))[_0xa54d('0x2f')](handleError(_0x49d4b8,null));};exports[_0xa54d('0x34')]=function(_0x482af2,_0x4f9eab){return db[_0xa54d('0x25')][_0xa54d('0x33')]({'where':{'id':_0x482af2[_0xa54d('0x23')]['id']}})[_0xa54d('0x1f')](handleEntityNotFound(_0x4f9eab,null))[_0xa54d('0x1f')](removeEntity(_0x4f9eab,null))[_0xa54d('0x2f')](handleError(_0x4f9eab,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 1abde05..9a74ac8 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 _0x6e44=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define','chat_proactive_actions','lodash'];(function(_0x55e69e,_0x153900){var _0x555871=function(_0x5bde84){while(--_0x5bde84){_0x55e69e['push'](_0x55e69e['shift']());}};_0x555871(++_0x153900);}(_0x6e44,0x10d));var _0x46e4=function(_0x4ab4a2,_0x41b416){_0x4ab4a2=_0x4ab4a2-0x0;var _0x57f331=_0x6e44[_0x4ab4a2];return _0x57f331;};'use strict';var _=require(_0x46e4('0x0'));var util=require(_0x46e4('0x1'));var logger=require(_0x46e4('0x2'))('api');var moment=require(_0x46e4('0x3'));var BPromise=require(_0x46e4('0x4'));var rp=require(_0x46e4('0x5'));var fs=require('fs');var path=require(_0x46e4('0x6'));var rimraf=require('rimraf');var config=require(_0x46e4('0x7'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x13cb00,_0x43907f){return _0x13cb00[_0x46e4('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x46e4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa700=['../../config/logger','api','bluebird','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','util'];(function(_0x4e0359,_0x205155){var _0x450f0a=function(_0x2056c6){while(--_0x2056c6){_0x4e0359['push'](_0x4e0359['shift']());}};_0x450f0a(++_0x205155);}(_0xa700,0x1e5));var _0x0a70=function(_0x2d0f87,_0x23395a){_0x2d0f87=_0x2d0f87-0x0;var _0x47bea0=_0xa700[_0x2d0f87];return _0x47bea0;};'use strict';var _=require('lodash');var util=require(_0x0a70('0x0'));var logger=require(_0x0a70('0x1'))(_0x0a70('0x2'));var moment=require('moment');var BPromise=require(_0x0a70('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0a70('0x4'));var config=require('../../config/environment');var attributes=require(_0x0a70('0x5'));module['exports']=function(_0x148eb7,_0x3c55f0){return _0x148eb7[_0x0a70('0x6')](_0x0a70('0x7'),attributes,{'tableName':_0x0a70('0x8'),'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 a5ddf23..d1c515f 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 _0x6594=['info','result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4da78e,_0x13cb84){var _0x4463b1=function(_0x41aaf1){while(--_0x41aaf1){_0x4da78e['push'](_0x4da78e['shift']());}};_0x4463b1(++_0x13cb84);}(_0x6594,0xcb));var _0x4659=function(_0xe1b2a8,_0x38f786){_0xe1b2a8=_0xe1b2a8-0x0;var _0x554804=_0x6594[_0xe1b2a8];return _0x554804;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4659('0x0'));var fs=require('fs');var Redis=require(_0x4659('0x1'));var db=require(_0x4659('0x2'))['db'];var utils=require(_0x4659('0x3'));var logger=require(_0x4659('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4659('0x5'));var client=jayson[_0x4659('0x6')][_0x4659('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45d2e8,_0x4e707c,_0x3adf40){return new BPromise(function(_0x39b740,_0xd896b7){return client[_0x4659('0x8')](_0x45d2e8,_0x3adf40)[_0x4659('0x9')](function(_0x27a2ea){logger['info'](_0x4659('0xa'),_0x4e707c,_0x4659('0xb'));logger[_0x4659('0xc')](_0x4659('0xd'),_0x4e707c,_0x4659('0xb'),JSON[_0x4659('0xe')](_0x27a2ea));if(_0x27a2ea[_0x4659('0xf')]){if(_0x27a2ea['error']['code']===0x1f4){logger[_0x4659('0xf')](_0x4659('0xa'),_0x4e707c,_0x27a2ea[_0x4659('0xf')][_0x4659('0x10')]);return _0xd896b7(_0x27a2ea[_0x4659('0xf')][_0x4659('0x10')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4e707c,_0x27a2ea[_0x4659('0xf')]['message']);return _0x39b740(_0x27a2ea[_0x4659('0xf')][_0x4659('0x10')]);}else{logger[_0x4659('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x4e707c,_0x4659('0xb'));_0x39b740(_0x27a2ea[_0x4659('0x12')][_0x4659('0x10')]);}})[_0x4659('0x13')](function(_0x59cacd){logger[_0x4659('0xf')](_0x4659('0xa'),_0x4e707c,_0x59cacd);_0xd896b7(_0x59cacd);});});} \ No newline at end of file +var _0x3ea4=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3ea4,0x198));var _0x43ea=function(_0x5a7e78,_0x400b57){_0x5a7e78=_0x5a7e78-0x0;var _0xa8d4a1=_0x3ea4[_0x5a7e78];return _0xa8d4a1;};'use strict';var _=require('lodash');var util=require(_0x43ea('0x0'));var moment=require('moment');var BPromise=require(_0x43ea('0x1'));var rs=require(_0x43ea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43ea('0x3'));var logger=require('../../config/logger')(_0x43ea('0x4'));var config=require(_0x43ea('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x43ea('0x6')][_0x43ea('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xc9d95d,_0x9144f,_0x2b16b3){return new BPromise(function(_0x17e0af,_0x2e0ca5){return client[_0x43ea('0x8')](_0xc9d95d,_0x2b16b3)[_0x43ea('0x9')](function(_0x15c493){logger[_0x43ea('0xa')](_0x43ea('0xb'),_0x9144f,_0x43ea('0xc'));logger[_0x43ea('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x9144f,_0x43ea('0xc'),JSON[_0x43ea('0xe')](_0x15c493));if(_0x15c493[_0x43ea('0xf')]){if(_0x15c493[_0x43ea('0xf')][_0x43ea('0x10')]===0x1f4){logger[_0x43ea('0xf')](_0x43ea('0xb'),_0x9144f,_0x15c493[_0x43ea('0xf')][_0x43ea('0x11')]);return _0x2e0ca5(_0x15c493[_0x43ea('0xf')][_0x43ea('0x11')]);}logger[_0x43ea('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x9144f,_0x15c493[_0x43ea('0xf')][_0x43ea('0x11')]);return _0x17e0af(_0x15c493['error'][_0x43ea('0x11')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x9144f,_0x43ea('0xc'));_0x17e0af(_0x15c493['result'][_0x43ea('0x11')]);}})[_0x43ea('0x12')](function(_0x5b72c9){logger[_0x43ea('0xf')](_0x43ea('0xb'),_0x9144f,_0x5b72c9);_0x2e0ca5(_0x5b72c9);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index b3c3f15..a8ec211 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 _0x46ed=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports'];(function(_0x5ac0f0,_0xee4d98){var _0x4aceec=function(_0x3a9044){while(--_0x3a9044){_0x5ac0f0['push'](_0x5ac0f0['shift']());}};_0x4aceec(++_0xee4d98);}(_0x46ed,0x168));var _0xd46e=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x46ed[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd46e('0x5'));var interaction=require(_0xd46e('0x6'));var config=require('../../config/environment');var controller=require(_0xd46e('0x7'));router[_0xd46e('0x8')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller[_0xd46e('0xb')]);router[_0xd46e('0xc')]('/',auth[_0xd46e('0xa')](),controller[_0xd46e('0xd')]);router[_0xd46e('0xe')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller['update']);router[_0xd46e('0xf')](_0xd46e('0x9'),auth['isAuthenticated'](),controller[_0xd46e('0x10')]);module[_0xd46e('0x11')]=router; \ No newline at end of file +var _0x8ef6=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','show','post','isAuthenticated','put','/:id','update','delete'];(function(_0x2a24b2,_0x171540){var _0x2ed7d3=function(_0x49a1e7){while(--_0x49a1e7){_0x2a24b2['push'](_0x2a24b2['shift']());}};_0x2ed7d3(++_0x171540);}(_0x8ef6,0xf2));var _0x68ef=function(_0x33e444,_0x53abb7){_0x33e444=_0x33e444-0x0;var _0x1c0ebf=_0x8ef6[_0x33e444];return _0x1c0ebf;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x68ef('0xb')]);router[_0x68ef('0xc')]('/',auth[_0x68ef('0xd')](),controller['create']);router[_0x68ef('0xe')](_0x68ef('0xf'),auth[_0x68ef('0xd')](),controller[_0x68ef('0x10')]);router[_0x68ef('0x11')](_0x68ef('0xf'),auth[_0x68ef('0xd')](),controller[_0x68ef('0x12')]);module[_0x68ef('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 756c1ec..0599c59 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 _0x5682=['roundrobin','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x5682,0xda));var _0x2568=function(_0x36f072,_0x4bb66d){_0x36f072=_0x36f072-0x0;var _0xf6d54f=_0x5682[_0x36f072];return _0xf6d54f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2568('0x0')],'unique':_0x2568('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2568('0x0')]},'timeout':{'type':Sequelize[_0x2568('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2568('0x3')](_0x2568('0x4'),_0x2568('0x5'),_0x2568('0x6'))}}; \ No newline at end of file +var _0x32b8=['ENUM','rrmemory','beepall','sequelize','STRING','name','INTEGER'];(function(_0x1d6e00,_0x29c9ec){var _0x3cbd21=function(_0x1ed118){while(--_0x1ed118){_0x1d6e00['push'](_0x1d6e00['shift']());}};_0x3cbd21(++_0x29c9ec);}(_0x32b8,0x153));var _0x832b=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x32b8[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x832b('0x0'));module['exports']={'name':{'type':Sequelize[_0x832b('0x1')],'unique':_0x832b('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x832b('0x1')]},'timeout':{'type':Sequelize[_0x832b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x832b('0x4')](_0x832b('0x5'),_0x832b('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 0af66b1..a87d2b3 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 _0xb530=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','rawAttributes','order','sort','ChatQueueId','filter','merge','User','findAndCountAll','map','UserId','agent','updatedAt','format','SIP','chatPause','createdAt','getTeams','Team','pick','nolimit','addTeams','ids','Agents','voicePause','flatMap','sequelize','transaction','each','forEach','emit','userChatQueue:save','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','union','compact','value','removeTeams','removeAgents','addAgents','spread','isArray','userChatQueue:remove','getAgents','hasOwnProperty','bluebird','util','lodash','squel','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','status','end','json','offset','undefined','limit','count','update','then','get','ChatQueues','UserProfileResource','destroy','sendStatus','error','name','send','index','fieldName','type','key','getOptions','where','include','query','ChatQueue','findAll','rows','catch','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll','options','find'];(function(_0x2a859c,_0x188595){var _0x26be98=function(_0x33c4ee){while(--_0x33c4ee){_0x2a859c['push'](_0x2a859c['shift']());}};_0x26be98(++_0x188595);}(_0xb530,0x133));var _0x0b53=function(_0x559ce4,_0x202e15){_0x559ce4=_0x559ce4-0x0;var _0x493763=_0xb530[_0x559ce4];return _0x493763;};'use strict';var BPromise=require(_0x0b53('0x0'));var util=require(_0x0b53('0x1'));var _=require(_0x0b53('0x2'));var squel=require(_0x0b53('0x3'));var Redis=require(_0x0b53('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x0b53('0x5'))('api');var config=require(_0x0b53('0x6'));var db=require(_0x0b53('0x7'))['db'];config[_0x0b53('0x8')]=_['defaults'](config['redis'],{'host':_0x0b53('0x9'),'port':0x18eb});var socket=require(_0x0b53('0xa'))(new Redis(config['redis']));require(_0x0b53('0xb'))['register'](socket);function respondWithStatusCode(_0x1fa9b7,_0x530a64){_0x530a64=_0x530a64||0xcc;return function(_0x347653){if(_0x347653){return _0x1fa9b7['sendStatus'](_0x530a64);}return _0x1fa9b7[_0x0b53('0xc')](_0x530a64)[_0x0b53('0xd')]();};}function respondWithResult(_0x270b15,_0x3bef33){_0x3bef33=_0x3bef33||0xc8;return function(_0x5b9304){if(_0x5b9304){return _0x270b15[_0x0b53('0xc')](_0x3bef33)[_0x0b53('0xe')](_0x5b9304);}};}function respondWithFilteredResult(_0x160f57,_0x40acf0){return function(_0x45269b){if(_0x45269b){var _0x282ca6=typeof _0x40acf0[_0x0b53('0xf')]===_0x0b53('0x10')&&typeof _0x40acf0[_0x0b53('0x11')]===_0x0b53('0x10');var _0x1515a3=_0x45269b[_0x0b53('0x12')];var _0x418182=_0x282ca6?0x0:_0x40acf0[_0x0b53('0xf')];var _0x449639=_0x282ca6?_0x45269b[_0x0b53('0x12')]:_0x40acf0[_0x0b53('0xf')]+_0x40acf0[_0x0b53('0x11')];var _0x17dc49;if(_0x449639>=_0x1515a3){_0x449639=_0x1515a3;_0x17dc49=0xc8;}else{_0x17dc49=0xce;}_0x160f57[_0x0b53('0xc')](_0x17dc49);return _0x160f57['set']('Content-Range',_0x418182+'-'+_0x449639+'/'+_0x1515a3)[_0x0b53('0xe')](_0x45269b);}return null;};}function saveUpdates(_0x7580e){return function(_0x554707){if(_0x554707){return _0x554707[_0x0b53('0x13')](_0x7580e)['then'](function(_0x2ca711){return _0x2ca711;});}return null;};}function removeEntity(_0x57961f){return function(_0x23af55){if(_0x23af55){return _0x23af55['destroy']()[_0x0b53('0x14')](function(){var _0x22c08e=_0x23af55[_0x0b53('0x15')]({'plain':!![]});var _0x439bab=_0x0b53('0x16');return db[_0x0b53('0x17')][_0x0b53('0x18')]({'where':{'type':_0x439bab,'resourceId':_0x22c08e['id']}})[_0x0b53('0x14')](function(){return _0x23af55;});})[_0x0b53('0x14')](function(){_0x57961f[_0x0b53('0xc')](0xcc)[_0x0b53('0xd')]();});}};}function handleEntityNotFound(_0x1865c2){return function(_0x2be9a3){if(!_0x2be9a3){_0x1865c2[_0x0b53('0x19')](0x194);}return _0x2be9a3;};}function handleError(_0x141b7d,_0x1cddcd){_0x1cddcd=_0x1cddcd||0x1f4;return function(_0xfe7791){logger[_0x0b53('0x1a')](_0xfe7791['stack']);if(_0xfe7791[_0x0b53('0x1b')]){delete _0xfe7791[_0x0b53('0x1b')];}_0x141b7d[_0x0b53('0xc')](_0x1cddcd)[_0x0b53('0x1c')](_0xfe7791);};}exports[_0x0b53('0x1d')]=function(_0x300b99,_0x5ec5d7){var _0x4850b6={};var _0x54fd5c={'count':0x0,'rows':[]};var _0x49a95f=_['map'](db['ChatQueue']['rawAttributes'],function(_0x3167ae){return{'name':_0x3167ae[_0x0b53('0x1e')],'type':_0x3167ae[_0x0b53('0x1f')][_0x0b53('0x20')]};});_0x4850b6=qs[_0x0b53('0x21')](_0x49a95f,_0x300b99);var _0x41f3b2={'where':_0x4850b6[_0x0b53('0x22')]};return db['ChatQueue'][_0x0b53('0x12')](_0x41f3b2)[_0x0b53('0x14')](function(_0x5f257a){_0x54fd5c[_0x0b53('0x12')]=_0x5f257a;_0x4850b6[_0x0b53('0x23')]=qs[_0x0b53('0x23')](_0x300b99[_0x0b53('0x24')]);return db[_0x0b53('0x25')][_0x0b53('0x26')](_0x4850b6);})['then'](function(_0x41da25){_0x54fd5c[_0x0b53('0x27')]=_0x41da25;return _0x54fd5c;})['then'](respondWithFilteredResult(_0x5ec5d7,_0x4850b6))[_0x0b53('0x28')](handleError(_0x5ec5d7,null));};exports[_0x0b53('0x29')]=function(_0x3a41b9,_0x4aaa37){var _0x215790={'raw':!![],'where':{'id':_0x3a41b9[_0x0b53('0x2a')]['id']}},_0x4d6c17={};_0x4d6c17['model']=_[_0x0b53('0x2b')](db['ChatQueue']['rawAttributes']);_0x4d6c17[_0x0b53('0x24')]=_[_0x0b53('0x2b')](_0x3a41b9['query']);_0x4d6c17[_0x0b53('0x2c')]=_[_0x0b53('0x2d')](_0x4d6c17[_0x0b53('0x2e')],_0x4d6c17[_0x0b53('0x24')]);_0x215790[_0x0b53('0x2f')]=_[_0x0b53('0x2d')](_0x4d6c17[_0x0b53('0x2e')],qs[_0x0b53('0x30')](_0x3a41b9[_0x0b53('0x24')][_0x0b53('0x30')]));_0x215790[_0x0b53('0x2f')]=_0x215790[_0x0b53('0x2f')][_0x0b53('0x31')]?_0x215790[_0x0b53('0x2f')]:_0x4d6c17[_0x0b53('0x2e')];if(_0x3a41b9[_0x0b53('0x24')][_0x0b53('0x32')]){_0x215790[_0x0b53('0x23')]=[{'all':!![]}];}_0x215790=_['merge']({},_0x215790,_0x3a41b9[_0x0b53('0x33')]);return db[_0x0b53('0x25')][_0x0b53('0x34')](_0x215790)[_0x0b53('0x14')](handleEntityNotFound(_0x4aaa37,null))[_0x0b53('0x14')](respondWithResult(_0x4aaa37,null))['catch'](handleError(_0x4aaa37,null));};exports[_0x0b53('0x35')]=function(_0x22fdb5,_0x2c98e2){return db[_0x0b53('0x25')][_0x0b53('0x35')](_0x22fdb5[_0x0b53('0x36')],{})[_0x0b53('0x14')](function(_0x4c65e2){var _0x36bbae=_0x22fdb5[_0x0b53('0x37')][_0x0b53('0x15')]({'plain':!![]});if(!_0x36bbae)throw new Error(_0x0b53('0x38'));if(_0x36bbae[_0x0b53('0x39')]==='user'){var _0x546397=_0x4c65e2[_0x0b53('0x15')]({'plain':!![]});var _0x13ae34=_0x0b53('0x16');return db[_0x0b53('0x3a')][_0x0b53('0x34')]({'where':{'name':_0x13ae34,'userProfileId':_0x36bbae[_0x0b53('0x3b')]},'raw':!![]})['then'](function(_0x349c23){if(_0x349c23&&_0x349c23['autoAssociation']===0x0){return db[_0x0b53('0x17')]['create']({'name':_0x546397[_0x0b53('0x1b')],'resourceId':_0x546397['id'],'type':_0x349c23[_0x0b53('0x1b')],'sectionId':_0x349c23['id']},{})[_0x0b53('0x14')](function(){return _0x4c65e2;});}else{return _0x4c65e2;}})[_0x0b53('0x28')](function(_0x5d31ef){logger[_0x0b53('0x1a')](_0x0b53('0x3c'),_0x5d31ef);throw _0x5d31ef;});}return _0x4c65e2;})[_0x0b53('0x14')](respondWithResult(_0x2c98e2,0xc9))[_0x0b53('0x28')](handleError(_0x2c98e2,null));};exports[_0x0b53('0x13')]=function(_0x2549f3,_0x547100){if(_0x2549f3['body']['id']){delete _0x2549f3[_0x0b53('0x36')]['id'];}return db[_0x0b53('0x25')]['find']({'where':{'id':_0x2549f3['params']['id']}})[_0x0b53('0x14')](handleEntityNotFound(_0x547100,null))[_0x0b53('0x14')](saveUpdates(_0x2549f3['body'],null))[_0x0b53('0x14')](respondWithResult(_0x547100,null))[_0x0b53('0x28')](handleError(_0x547100,null));};exports[_0x0b53('0x18')]=function(_0x147b10,_0x4b86ef){return db['ChatQueue'][_0x0b53('0x34')]({'where':{'id':_0x147b10['params']['id']}})[_0x0b53('0x14')](handleEntityNotFound(_0x4b86ef,null))[_0x0b53('0x14')](removeEntity(_0x4b86ef,null))[_0x0b53('0x28')](handleError(_0x4b86ef,null));};exports['describe']=function(_0x31d086,_0x3ef291){return db['ChatQueue'][_0x0b53('0x3d')]()['then'](respondWithResult(_0x3ef291,null))[_0x0b53('0x28')](handleError(_0x3ef291,null));};exports[_0x0b53('0x3e')]=function(_0x2f1fa2,_0x1d52b3){var _0x580f5e={'raw':!![],'where':{}},_0x41afd3={},_0x315768;return db[_0x0b53('0x25')][_0x0b53('0x3f')]({'where':{'id':_0x2f1fa2[_0x0b53('0x2a')]['id']}})[_0x0b53('0x14')](handleEntityNotFound(_0x1d52b3,null))[_0x0b53('0x14')](function(_0x417d07){if(_0x417d07){_0x315768=_0x417d07['get']({'plain':!![]});_0x41afd3[_0x0b53('0x2e')]=_[_0x0b53('0x2b')](db[_0x0b53('0x40')][_0x0b53('0x41')]);_0x41afd3['query']=_[_0x0b53('0x2b')](_0x2f1fa2[_0x0b53('0x24')]);_0x41afd3['filters']=_[_0x0b53('0x2d')](_0x41afd3[_0x0b53('0x2e')],_0x41afd3[_0x0b53('0x24')]);_0x580f5e['attributes']=_[_0x0b53('0x2d')](_0x41afd3[_0x0b53('0x2e')],qs[_0x0b53('0x30')](_0x2f1fa2[_0x0b53('0x24')][_0x0b53('0x30')]));_0x580f5e[_0x0b53('0x2f')]=_0x580f5e[_0x0b53('0x2f')]['length']?_0x580f5e['attributes']:_0x41afd3[_0x0b53('0x2e')];if(!_0x2f1fa2['query']['hasOwnProperty']('nolimit')){_0x580f5e[_0x0b53('0x11')]=qs[_0x0b53('0x11')](_0x2f1fa2[_0x0b53('0x24')][_0x0b53('0x11')]);_0x580f5e[_0x0b53('0xf')]=qs[_0x0b53('0xf')](_0x2f1fa2[_0x0b53('0x24')][_0x0b53('0xf')]);}_0x580f5e[_0x0b53('0x42')]=qs[_0x0b53('0x43')](_0x2f1fa2['query'][_0x0b53('0x43')]);_0x580f5e['where']=qs[_0x0b53('0x2c')](_['pick'](_0x2f1fa2[_0x0b53('0x24')],_0x41afd3[_0x0b53('0x2c')]));_0x580f5e[_0x0b53('0x22')][_0x0b53('0x44')]=_0x417d07['id'];if(_0x2f1fa2[_0x0b53('0x24')][_0x0b53('0x45')]){_0x580f5e[_0x0b53('0x22')]=_[_0x0b53('0x46')](_0x580f5e['where'],{'$or':_['map'](_0x580f5e['attributes'],function(_0xf601a7){var _0xe0426b={};_0xe0426b[_0xf601a7]={'$like':'%'+_0x2f1fa2[_0x0b53('0x24')]['filter']+'%'};return _0xe0426b;})});}_0x580f5e=_['merge']({},_0x580f5e,_0x2f1fa2[_0x0b53('0x33')]);return db['UserChatQueue'][_0x0b53('0x26')](_0x580f5e);}})[_0x0b53('0x14')](function(_0x1f1d83){if(_0x1f1d83){return db[_0x0b53('0x47')][_0x0b53('0x48')]({'where':{'id':_[_0x0b53('0x49')](_0x1f1d83,_0x0b53('0x4a')),'role':_0x0b53('0x4b')},'attributes':['id',_0x0b53('0x1b'),'chatPause',_0x0b53('0x4c'),'createdAt']});}})['then'](function(_0x9d9e2b){if(_0x9d9e2b){return{'count':_0x9d9e2b[_0x0b53('0x12')],'rows':_[_0x0b53('0x49')](_0x9d9e2b[_0x0b53('0x27')],function(_0x5a9b78){return{'membername':_0x5a9b78[_0x0b53('0x1b')],'UserId':_0x5a9b78['id'],'queue_name':_0x315768['name'],'ChatQueueId':_0x315768['id'],'interface':util[_0x0b53('0x4d')]('%s/%s',_0x0b53('0x4e'),_0x5a9b78['name']),'penalty':0x0,'paused':_0x5a9b78[_0x0b53('0x4f')],'createdAt':_0x5a9b78[_0x0b53('0x50')],'updatedAt':_0x5a9b78[_0x0b53('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1d52b3,_0x580f5e))[_0x0b53('0x28')](handleError(_0x1d52b3,null));};exports[_0x0b53('0x51')]=function(_0x1b3076,_0x9e7efd){var _0x199f56={};var _0x5d4c2e={};var _0x21d028;var _0x2dd51a;return db[_0x0b53('0x25')][_0x0b53('0x3f')]({'where':{'id':_0x1b3076[_0x0b53('0x2a')]['id']}})[_0x0b53('0x14')](handleEntityNotFound(_0x9e7efd,null))[_0x0b53('0x14')](function(_0x33842f){if(_0x33842f){_0x21d028=_0x33842f;_0x5d4c2e[_0x0b53('0x2e')]=_[_0x0b53('0x2b')](db[_0x0b53('0x52')][_0x0b53('0x41')]);_0x5d4c2e[_0x0b53('0x24')]=_['keys'](_0x1b3076[_0x0b53('0x24')]);_0x5d4c2e[_0x0b53('0x2c')]=_['intersection'](_0x5d4c2e['model'],_0x5d4c2e['query']);_0x199f56['attributes']=_[_0x0b53('0x2d')](_0x5d4c2e[_0x0b53('0x2e')],qs[_0x0b53('0x30')](_0x1b3076[_0x0b53('0x24')]['fields']));_0x199f56[_0x0b53('0x2f')]=_0x199f56[_0x0b53('0x2f')]['length']?_0x199f56[_0x0b53('0x2f')]:_0x5d4c2e[_0x0b53('0x2e')];_0x199f56[_0x0b53('0x42')]=qs[_0x0b53('0x43')](_0x1b3076[_0x0b53('0x24')][_0x0b53('0x43')]);_0x199f56[_0x0b53('0x22')]=qs[_0x0b53('0x2c')](_[_0x0b53('0x53')](_0x1b3076[_0x0b53('0x24')],_0x5d4c2e[_0x0b53('0x2c')]));if(_0x1b3076['query'][_0x0b53('0x45')]){_0x199f56[_0x0b53('0x22')]=_[_0x0b53('0x46')](_0x199f56[_0x0b53('0x22')],{'$or':_[_0x0b53('0x49')](_0x199f56[_0x0b53('0x2f')],function(_0x50ee2f){var _0x45d13a={};_0x45d13a[_0x50ee2f]={'$like':'%'+_0x1b3076['query'][_0x0b53('0x45')]+'%'};return _0x45d13a;})});}_0x199f56=_[_0x0b53('0x46')]({},_0x199f56,_0x1b3076[_0x0b53('0x33')]);return _0x21d028[_0x0b53('0x51')](_0x199f56);}})['then'](function(_0x46324c){if(_0x46324c){_0x2dd51a=_0x46324c[_0x0b53('0x31')];if(!_0x1b3076[_0x0b53('0x24')]['hasOwnProperty'](_0x0b53('0x54'))){_0x199f56['limit']=qs['limit'](_0x1b3076[_0x0b53('0x24')][_0x0b53('0x11')]);_0x199f56['offset']=qs[_0x0b53('0xf')](_0x1b3076[_0x0b53('0x24')][_0x0b53('0xf')]);}return _0x21d028[_0x0b53('0x51')](_0x199f56);}})[_0x0b53('0x14')](function(_0x578d83){if(_0x578d83){return _0x578d83?{'count':_0x2dd51a,'rows':_0x578d83}:null;}})[_0x0b53('0x14')](respondWithResult(_0x9e7efd,null))[_0x0b53('0x28')](handleError(_0x9e7efd,null));};exports[_0x0b53('0x55')]=function(_0x8af186,_0x2d6a8a){var _0x5a3eb7=_0x8af186['body'][_0x0b53('0x56')];return db['Team'][_0x0b53('0x26')]({'where':{'id':_0x5a3eb7},'attributes':['id'],'include':[{'model':db[_0x0b53('0x47')],'as':_0x0b53('0x57'),'attributes':['id',_0x0b53('0x1b'),'online',_0x0b53('0x58'),'interface'],'raw':!![]}]})['then'](function(_0xbce7d4){if(_0xbce7d4){var _0xbe762e=_[_0x0b53('0x59')](_0xbce7d4,function(_0x522291){var _0x13c016=_0x522291['get']({'plain':!![]});return _0x13c016['Agents'];});return db[_0x0b53('0x25')]['find']({'where':{'id':_0x8af186[_0x0b53('0x2a')]['id']}})['then'](function(_0x5242ec){return db[_0x0b53('0x5a')][_0x0b53('0x5b')](function(_0x1b612c){return _0x5242ec[_0x0b53('0x55')](_0x5a3eb7,{'transaction':_0x1b612c})[_0x0b53('0x14')](function(){return BPromise[_0x0b53('0x5c')](_0xbe762e,function(_0x54176c){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x54176c['id'],'ChatQueueId':_0x8af186[_0x0b53('0x2a')]['id']},'transaction':_0x1b612c});});})[_0x0b53('0x14')](function(){_0xbe762e[_0x0b53('0x5d')](function(_0x39e877){socket[_0x0b53('0x5e')](_0x0b53('0x5f'),{'UserId':_0x39e877['id'],'ChatQueueId':_0x5242ec['id']});});});});});}})[_0x0b53('0x14')](respondWithStatusCode(_0x2d6a8a,null))[_0x0b53('0x28')](handleError(_0x2d6a8a,null));};exports['removeTeams']=function(_0x24970b,_0x301aa4){return db[_0x0b53('0x52')][_0x0b53('0x26')]({'where':{'id':_0x24970b['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0b53('0x57'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x301aa4,null))['then'](function(_0x507eb9){var _0x5bce34=_[_0x0b53('0x49')](_0x507eb9,'id');var _0x22f177=[];var _0x3776b6=[];var _0x56ee92=squel[_0x0b53('0x60')]();_0x56ee92[_0x0b53('0x61')](_0x0b53('0x62'))['from']('team_has_chat_queues','tq')['join'](_0x0b53('0x63'),'ut',_0x0b53('0x64'))['where'](_0x0b53('0x65'),_0x24970b[_0x0b53('0x2a')]['id']);for(var _0x4a52c9=0x0;_0x4a52c9<_0x507eb9[_0x0b53('0x31')];_0x4a52c9+=0x1){let _0x35a2a0=_0x507eb9[_0x4a52c9];for(var _0x23cea1=0x0;_0x23cea1<_0x35a2a0['Agents'][_0x0b53('0x31')];_0x23cea1+=0x1){let _0x1fd753=_0x35a2a0[_0x0b53('0x57')][_0x23cea1];var _0x4f141e=_0x56ee92[_0x0b53('0x66')]();_0x4f141e[_0x0b53('0x22')](_0x0b53('0x67'),_0x1fd753['id']);_0x3776b6['push'](db[_0x0b53('0x5a')]['query'](_0x4f141e[_0x0b53('0x68')](),{'type':db[_0x0b53('0x5a')][_0x0b53('0x69')][_0x0b53('0x6a')]})[_0x0b53('0x14')](function(_0x32f6bd){if(_0x32f6bd['length']===0x1){return _0x1fd753['id'];}else{var _0x1a6add=_['every'](_[_0x0b53('0x49')](_0x32f6bd,'TeamId'),function(_0x1c7c7c){return _[_0x0b53('0x6b')](_0x5bce34,_0x1c7c7c);});if(_0x1a6add){return _0x1fd753['id'];}}}));}}return BPromise[_0x0b53('0x6c')](_0x3776b6)[_0x0b53('0x14')](function(_0x4f2a89){_0x22f177=_(_0x22f177)[_0x0b53('0x6d')](_0x4f2a89)[_0x0b53('0x6e')]()[_0x0b53('0x6f')]();return db[_0x0b53('0x25')][_0x0b53('0x34')]({'where':{'id':_0x24970b[_0x0b53('0x2a')]['id']}})[_0x0b53('0x14')](function(_0x450c50){return db[_0x0b53('0x5a')][_0x0b53('0x5b')](function(_0x1556db){return _0x450c50[_0x0b53('0x70')](_0x24970b['query'][_0x0b53('0x56')],{'transaction':_0x1556db})[_0x0b53('0x14')](function(){if(!_['isEmpty'](_0x22f177)){return _0x450c50[_0x0b53('0x71')](_0x22f177,{'transaction':_0x1556db});}})[_0x0b53('0x14')](function(){_0x22f177[_0x0b53('0x5d')](function(_0x3f9f80){socket['emit']('userChatQueue:remove',{'UserId':_0x3f9f80,'ChatQueueId':_0x450c50['id']});});});});});});})[_0x0b53('0x14')](respondWithStatusCode(_0x301aa4,null))['catch'](handleError(_0x301aa4,null));};exports[_0x0b53('0x72')]=function(_0x56892e,_0x29952f){return db['ChatQueue'][_0x0b53('0x34')]({'where':{'id':_0x56892e[_0x0b53('0x2a')]['id']}})[_0x0b53('0x14')](handleEntityNotFound(_0x29952f,null))[_0x0b53('0x14')](function(_0x1019ef){if(_0x1019ef){return _0x1019ef['addAgents'](_0x56892e[_0x0b53('0x36')]['ids'],_['omit'](_0x56892e['body'],[_0x0b53('0x56'),'id'])||{})[_0x0b53('0x73')](function(_0x1f5a78){for(var _0x560766=0x0;_0x560766<_0x56892e[_0x0b53('0x36')][_0x0b53('0x56')]['length'];_0x560766+=0x1){socket[_0x0b53('0x5e')](_0x0b53('0x5f'),{'UserId':Number(_0x56892e[_0x0b53('0x36')][_0x0b53('0x56')][_0x560766]),'ChatQueueId':Number(_0x56892e[_0x0b53('0x2a')]['id'])});}return _0x1f5a78;});}})[_0x0b53('0x14')](respondWithResult(_0x29952f,null))[_0x0b53('0x28')](handleError(_0x29952f,null));};exports[_0x0b53('0x71')]=function(_0x2b8dad,_0x4870d0){return db[_0x0b53('0x25')][_0x0b53('0x34')]({'where':{'id':_0x2b8dad[_0x0b53('0x2a')]['id']}})[_0x0b53('0x14')](handleEntityNotFound(_0x4870d0,null))['then'](function(_0x4d5438){if(_0x4d5438){return _0x4d5438['removeAgents'](_0x2b8dad[_0x0b53('0x24')][_0x0b53('0x56')])['then'](function(){if(_[_0x0b53('0x74')](_0x2b8dad['query']['ids'])){for(var _0x357a15=0x0;_0x357a15<_0x2b8dad[_0x0b53('0x24')]['ids'][_0x0b53('0x31')];_0x357a15+=0x1){socket['emit'](_0x0b53('0x75'),{'UserId':Number(_0x2b8dad[_0x0b53('0x24')][_0x0b53('0x56')][_0x357a15]),'ChatQueueId':Number(_0x2b8dad[_0x0b53('0x2a')]['id'])});}}else{socket[_0x0b53('0x5e')]('userChatQueue:remove',{'UserId':Number(_0x2b8dad[_0x0b53('0x24')]['ids']),'ChatQueueId':Number(_0x2b8dad[_0x0b53('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x4870d0,null))['catch'](handleError(_0x4870d0,null));};exports[_0x0b53('0x76')]=function(_0x2b1658,_0x5183e5){var _0x220620={};var _0x198f37={};var _0x308cae;var _0x2ea174;return db[_0x0b53('0x25')]['findOne']({'where':{'id':_0x2b1658[_0x0b53('0x2a')]['id']}})[_0x0b53('0x14')](handleEntityNotFound(_0x5183e5,null))['then'](function(_0xc42ad){if(_0xc42ad){_0x308cae=_0xc42ad;_0x198f37[_0x0b53('0x2e')]=_[_0x0b53('0x2b')](db[_0x0b53('0x47')][_0x0b53('0x41')]);_0x198f37[_0x0b53('0x24')]=_[_0x0b53('0x2b')](_0x2b1658[_0x0b53('0x24')]);_0x198f37[_0x0b53('0x2c')]=_[_0x0b53('0x2d')](_0x198f37['model'],_0x198f37[_0x0b53('0x24')]);_0x220620['attributes']=_['intersection'](_0x198f37[_0x0b53('0x2e')],qs[_0x0b53('0x30')](_0x2b1658[_0x0b53('0x24')][_0x0b53('0x30')]));_0x220620['attributes']=_0x220620['attributes'][_0x0b53('0x31')]?_0x220620['attributes']:_0x198f37['model'];_0x220620[_0x0b53('0x42')]=qs[_0x0b53('0x43')](_0x2b1658['query'][_0x0b53('0x43')]);_0x220620[_0x0b53('0x22')]=qs[_0x0b53('0x2c')](_['pick'](_0x2b1658['query'],_0x198f37[_0x0b53('0x2c')]));if(_0x2b1658['query'][_0x0b53('0x45')]){_0x220620[_0x0b53('0x22')]=_['merge'](_0x220620[_0x0b53('0x22')],{'$or':_[_0x0b53('0x49')](_0x220620['attributes'],function(_0x58de22){var _0x1a8863={};_0x1a8863[_0x58de22]={'$like':'%'+_0x2b1658[_0x0b53('0x24')][_0x0b53('0x45')]+'%'};return _0x1a8863;})});}_0x220620=_[_0x0b53('0x46')]({},_0x220620,_0x2b1658['options']);return _0x308cae[_0x0b53('0x76')](_0x220620);}})[_0x0b53('0x14')](function(_0xda4606){if(_0xda4606){_0x2ea174=_0xda4606[_0x0b53('0x31')];if(!_0x2b1658[_0x0b53('0x24')][_0x0b53('0x77')]('nolimit')){_0x220620[_0x0b53('0x11')]=qs[_0x0b53('0x11')](_0x2b1658[_0x0b53('0x24')]['limit']);_0x220620['offset']=qs[_0x0b53('0xf')](_0x2b1658[_0x0b53('0x24')][_0x0b53('0xf')]);}return _0x308cae['getAgents'](_0x220620);}})['then'](function(_0x9b4193){if(_0x9b4193){return _0x9b4193?{'count':_0x2ea174,'rows':_0x9b4193}:null;}})['then'](respondWithResult(_0x5183e5,null))[_0x0b53('0x28')](handleError(_0x5183e5,null));}; \ No newline at end of file +var _0x4253=['ChatQueue','include','query','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','hasOwnProperty','nolimit','sort','pick','ChatQueueId','filter','findAll','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','order','ids','User','Agents','online','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','value','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','where'];(function(_0x30eac3,_0x5a6302){var _0x5033da=function(_0x415212){while(--_0x415212){_0x30eac3['push'](_0x30eac3['shift']());}};_0x5033da(++_0x5a6302);}(_0x4253,0x157));var _0x3425=function(_0x587f65,_0x331cb1){_0x587f65=_0x587f65-0x0;var _0x31981f=_0x4253[_0x587f65];return _0x31981f;};'use strict';var BPromise=require(_0x3425('0x0'));var util=require('util');var _=require(_0x3425('0x1'));var squel=require('squel');var Redis=require(_0x3425('0x2'));var qs=require(_0x3425('0x3'));var logger=require(_0x3425('0x4'))('api');var config=require(_0x3425('0x5'));var db=require(_0x3425('0x6'))['db'];config[_0x3425('0x7')]=_['defaults'](config[_0x3425('0x7')],{'host':_0x3425('0x8'),'port':0x18eb});var socket=require(_0x3425('0x9'))(new Redis(config['redis']));require(_0x3425('0xa'))[_0x3425('0xb')](socket);function respondWithStatusCode(_0x2d6cf9,_0x22fc1d){_0x22fc1d=_0x22fc1d||0xcc;return function(_0x1cc624){if(_0x1cc624){return _0x2d6cf9['sendStatus'](_0x22fc1d);}return _0x2d6cf9['status'](_0x22fc1d)[_0x3425('0xc')]();};}function respondWithResult(_0x55ce41,_0x5568a0){_0x5568a0=_0x5568a0||0xc8;return function(_0x54eb14){if(_0x54eb14){return _0x55ce41[_0x3425('0xd')](_0x5568a0)[_0x3425('0xe')](_0x54eb14);}};}function respondWithFilteredResult(_0x10201f,_0x537cf0){return function(_0x2a351e){if(_0x2a351e){var _0x5104f7=typeof _0x537cf0[_0x3425('0xf')]===_0x3425('0x10')&&typeof _0x537cf0[_0x3425('0x11')]===_0x3425('0x10');var _0x3659c7=_0x2a351e[_0x3425('0x12')];var _0x44565e=_0x5104f7?0x0:_0x537cf0[_0x3425('0xf')];var _0x4c68b=_0x5104f7?_0x2a351e[_0x3425('0x12')]:_0x537cf0[_0x3425('0xf')]+_0x537cf0[_0x3425('0x11')];var _0x1dd6c4;if(_0x4c68b>=_0x3659c7){_0x4c68b=_0x3659c7;_0x1dd6c4=0xc8;}else{_0x1dd6c4=0xce;}_0x10201f[_0x3425('0xd')](_0x1dd6c4);return _0x10201f[_0x3425('0x13')](_0x3425('0x14'),_0x44565e+'-'+_0x4c68b+'/'+_0x3659c7)[_0x3425('0xe')](_0x2a351e);}return null;};}function saveUpdates(_0x1a9e44){return function(_0x262b86){if(_0x262b86){return _0x262b86[_0x3425('0x15')](_0x1a9e44)[_0x3425('0x16')](function(_0x35a3d0){return _0x35a3d0;});}return null;};}function removeEntity(_0x214b8f){return function(_0x2d3482){if(_0x2d3482){return _0x2d3482[_0x3425('0x17')]()[_0x3425('0x16')](function(){var _0x163fac=_0x2d3482[_0x3425('0x18')]({'plain':!![]});var _0xcbf5f4='ChatQueues';return db['UserProfileResource'][_0x3425('0x17')]({'where':{'type':_0xcbf5f4,'resourceId':_0x163fac['id']}})[_0x3425('0x16')](function(){return _0x2d3482;});})[_0x3425('0x16')](function(){_0x214b8f[_0x3425('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cdaaa){return function(_0x509157){if(!_0x509157){_0x2cdaaa[_0x3425('0x19')](0x194);}return _0x509157;};}function handleError(_0x47a4a8,_0x2adf96){_0x2adf96=_0x2adf96||0x1f4;return function(_0x1013cb){logger['error'](_0x1013cb[_0x3425('0x1a')]);if(_0x1013cb[_0x3425('0x1b')]){delete _0x1013cb['name'];}_0x47a4a8[_0x3425('0xd')](_0x2adf96)[_0x3425('0x1c')](_0x1013cb);};}exports[_0x3425('0x1d')]=function(_0x32cca1,_0x10a75e){var _0x4f7f06={};var _0xe3c2df={'count':0x0,'rows':[]};var _0x1acd42=_[_0x3425('0x1e')](db['ChatQueue'][_0x3425('0x1f')],function(_0x4eddcf){return{'name':_0x4eddcf[_0x3425('0x20')],'type':_0x4eddcf['type'][_0x3425('0x21')]};});_0x4f7f06=qs['getOptions'](_0x1acd42,_0x32cca1);var _0x43fb90={'where':_0x4f7f06[_0x3425('0x22')]};return db[_0x3425('0x23')][_0x3425('0x12')](_0x43fb90)[_0x3425('0x16')](function(_0x46dd8c){_0xe3c2df['count']=_0x46dd8c;_0x4f7f06['include']=qs[_0x3425('0x24')](_0x32cca1[_0x3425('0x25')]);return db[_0x3425('0x23')]['findAll'](_0x4f7f06);})[_0x3425('0x16')](function(_0x4f8b29){_0xe3c2df[_0x3425('0x26')]=_0x4f8b29;return _0xe3c2df;})['then'](respondWithFilteredResult(_0x10a75e,_0x4f7f06))[_0x3425('0x27')](handleError(_0x10a75e,null));};exports[_0x3425('0x28')]=function(_0x3ef8ad,_0x29b1cc){var _0x488293={'raw':!![],'where':{'id':_0x3ef8ad[_0x3425('0x29')]['id']}},_0x2f4c90={};_0x2f4c90[_0x3425('0x2a')]=_[_0x3425('0x2b')](db[_0x3425('0x23')]['rawAttributes']);_0x2f4c90[_0x3425('0x25')]=_[_0x3425('0x2b')](_0x3ef8ad[_0x3425('0x25')]);_0x2f4c90[_0x3425('0x2c')]=_[_0x3425('0x2d')](_0x2f4c90['model'],_0x2f4c90[_0x3425('0x25')]);_0x488293[_0x3425('0x2e')]=_['intersection'](_0x2f4c90[_0x3425('0x2a')],qs[_0x3425('0x2f')](_0x3ef8ad['query'][_0x3425('0x2f')]));_0x488293[_0x3425('0x2e')]=_0x488293[_0x3425('0x2e')][_0x3425('0x30')]?_0x488293['attributes']:_0x2f4c90[_0x3425('0x2a')];if(_0x3ef8ad[_0x3425('0x25')][_0x3425('0x31')]){_0x488293[_0x3425('0x24')]=[{'all':!![]}];}_0x488293=_[_0x3425('0x32')]({},_0x488293,_0x3ef8ad[_0x3425('0x33')]);return db[_0x3425('0x23')][_0x3425('0x34')](_0x488293)[_0x3425('0x16')](handleEntityNotFound(_0x29b1cc,null))[_0x3425('0x16')](respondWithResult(_0x29b1cc,null))['catch'](handleError(_0x29b1cc,null));};exports[_0x3425('0x35')]=function(_0x477f0c,_0x300b8b){return db[_0x3425('0x23')][_0x3425('0x35')](_0x477f0c[_0x3425('0x36')],{})[_0x3425('0x16')](function(_0x309f36){var _0x9d4f71=_0x477f0c[_0x3425('0x37')][_0x3425('0x18')]({'plain':!![]});if(!_0x9d4f71)throw new Error(_0x3425('0x38'));if(_0x9d4f71[_0x3425('0x39')]==='user'){var _0x1cbe6a=_0x309f36[_0x3425('0x18')]({'plain':!![]});var _0x579f92=_0x3425('0x3a');return db[_0x3425('0x3b')][_0x3425('0x34')]({'where':{'name':_0x579f92,'userProfileId':_0x9d4f71[_0x3425('0x3c')]},'raw':!![]})[_0x3425('0x16')](function(_0x15a1bf){if(_0x15a1bf&&_0x15a1bf[_0x3425('0x3d')]===0x0){return db['UserProfileResource'][_0x3425('0x35')]({'name':_0x1cbe6a[_0x3425('0x1b')],'resourceId':_0x1cbe6a['id'],'type':_0x15a1bf[_0x3425('0x1b')],'sectionId':_0x15a1bf['id']},{})[_0x3425('0x16')](function(){return _0x309f36;});}else{return _0x309f36;}})[_0x3425('0x27')](function(_0x1f32e3){logger[_0x3425('0x3e')](_0x3425('0x3f'),_0x1f32e3);throw _0x1f32e3;});}return _0x309f36;})[_0x3425('0x16')](respondWithResult(_0x300b8b,0xc9))[_0x3425('0x27')](handleError(_0x300b8b,null));};exports['update']=function(_0xadfc65,_0x4c9628){if(_0xadfc65[_0x3425('0x36')]['id']){delete _0xadfc65[_0x3425('0x36')]['id'];}return db['ChatQueue'][_0x3425('0x34')]({'where':{'id':_0xadfc65[_0x3425('0x29')]['id']}})[_0x3425('0x16')](handleEntityNotFound(_0x4c9628,null))['then'](saveUpdates(_0xadfc65[_0x3425('0x36')],null))['then'](respondWithResult(_0x4c9628,null))[_0x3425('0x27')](handleError(_0x4c9628,null));};exports[_0x3425('0x17')]=function(_0x312c1c,_0x755e6b){return db['ChatQueue'][_0x3425('0x34')]({'where':{'id':_0x312c1c[_0x3425('0x29')]['id']}})[_0x3425('0x16')](handleEntityNotFound(_0x755e6b,null))[_0x3425('0x16')](removeEntity(_0x755e6b,null))[_0x3425('0x27')](handleError(_0x755e6b,null));};exports['describe']=function(_0xde6a4e,_0x55afa9){return db[_0x3425('0x23')][_0x3425('0x40')]()[_0x3425('0x16')](respondWithResult(_0x55afa9,null))[_0x3425('0x27')](handleError(_0x55afa9,null));};exports[_0x3425('0x41')]=function(_0x4ae4d5,_0x21fa2c){var _0x3fc57f={'raw':!![],'where':{}},_0xbbfead={},_0x1bf93c;return db[_0x3425('0x23')]['findOne']({'where':{'id':_0x4ae4d5[_0x3425('0x29')]['id']}})[_0x3425('0x16')](handleEntityNotFound(_0x21fa2c,null))[_0x3425('0x16')](function(_0x3aee9d){if(_0x3aee9d){_0x1bf93c=_0x3aee9d[_0x3425('0x18')]({'plain':!![]});_0xbbfead[_0x3425('0x2a')]=_[_0x3425('0x2b')](db[_0x3425('0x42')][_0x3425('0x1f')]);_0xbbfead[_0x3425('0x25')]=_[_0x3425('0x2b')](_0x4ae4d5[_0x3425('0x25')]);_0xbbfead[_0x3425('0x2c')]=_[_0x3425('0x2d')](_0xbbfead['model'],_0xbbfead[_0x3425('0x25')]);_0x3fc57f[_0x3425('0x2e')]=_['intersection'](_0xbbfead['model'],qs['fields'](_0x4ae4d5[_0x3425('0x25')][_0x3425('0x2f')]));_0x3fc57f['attributes']=_0x3fc57f[_0x3425('0x2e')]['length']?_0x3fc57f[_0x3425('0x2e')]:_0xbbfead[_0x3425('0x2a')];if(!_0x4ae4d5['query'][_0x3425('0x43')](_0x3425('0x44'))){_0x3fc57f[_0x3425('0x11')]=qs[_0x3425('0x11')](_0x4ae4d5[_0x3425('0x25')][_0x3425('0x11')]);_0x3fc57f[_0x3425('0xf')]=qs['offset'](_0x4ae4d5[_0x3425('0x25')]['offset']);}_0x3fc57f['order']=qs['sort'](_0x4ae4d5[_0x3425('0x25')][_0x3425('0x45')]);_0x3fc57f['where']=qs[_0x3425('0x2c')](_[_0x3425('0x46')](_0x4ae4d5[_0x3425('0x25')],_0xbbfead[_0x3425('0x2c')]));_0x3fc57f['where'][_0x3425('0x47')]=_0x3aee9d['id'];if(_0x4ae4d5[_0x3425('0x25')][_0x3425('0x48')]){_0x3fc57f[_0x3425('0x22')]=_['merge'](_0x3fc57f[_0x3425('0x22')],{'$or':_[_0x3425('0x1e')](_0x3fc57f[_0x3425('0x2e')],function(_0x1a4adf){var _0x3a27bb={};_0x3a27bb[_0x1a4adf]={'$like':'%'+_0x4ae4d5[_0x3425('0x25')][_0x3425('0x48')]+'%'};return _0x3a27bb;})});}_0x3fc57f=_[_0x3425('0x32')]({},_0x3fc57f,_0x4ae4d5[_0x3425('0x33')]);return db['UserChatQueue'][_0x3425('0x49')](_0x3fc57f);}})['then'](function(_0x418992){if(_0x418992){return db['User'][_0x3425('0x4a')]({'where':{'id':_[_0x3425('0x1e')](_0x418992,_0x3425('0x4b')),'role':_0x3425('0x4c')},'attributes':['id','name',_0x3425('0x4d'),_0x3425('0x4e'),_0x3425('0x4f')]});}})[_0x3425('0x16')](function(_0x57496d){if(_0x57496d){return{'count':_0x57496d[_0x3425('0x12')],'rows':_[_0x3425('0x1e')](_0x57496d[_0x3425('0x26')],function(_0x1a08fb){return{'membername':_0x1a08fb['name'],'UserId':_0x1a08fb['id'],'queue_name':_0x1bf93c[_0x3425('0x1b')],'ChatQueueId':_0x1bf93c['id'],'interface':util[_0x3425('0x50')]('%s/%s',_0x3425('0x51'),_0x1a08fb[_0x3425('0x1b')]),'penalty':0x0,'paused':_0x1a08fb[_0x3425('0x4d')],'createdAt':_0x1a08fb[_0x3425('0x4f')],'updatedAt':_0x1a08fb[_0x3425('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x21fa2c,_0x3fc57f))[_0x3425('0x27')](handleError(_0x21fa2c,null));};exports[_0x3425('0x52')]=function(_0x10c7b6,_0x117873){var _0x3abda0={};var _0x170caa={};var _0x8e1a58;var _0x4149c7;return db[_0x3425('0x23')][_0x3425('0x53')]({'where':{'id':_0x10c7b6['params']['id']}})[_0x3425('0x16')](handleEntityNotFound(_0x117873,null))['then'](function(_0x114999){if(_0x114999){_0x8e1a58=_0x114999;_0x170caa[_0x3425('0x2a')]=_[_0x3425('0x2b')](db[_0x3425('0x54')][_0x3425('0x1f')]);_0x170caa['query']=_['keys'](_0x10c7b6['query']);_0x170caa[_0x3425('0x2c')]=_[_0x3425('0x2d')](_0x170caa['model'],_0x170caa[_0x3425('0x25')]);_0x3abda0['attributes']=_[_0x3425('0x2d')](_0x170caa['model'],qs['fields'](_0x10c7b6[_0x3425('0x25')][_0x3425('0x2f')]));_0x3abda0['attributes']=_0x3abda0['attributes'][_0x3425('0x30')]?_0x3abda0[_0x3425('0x2e')]:_0x170caa[_0x3425('0x2a')];_0x3abda0[_0x3425('0x55')]=qs['sort'](_0x10c7b6[_0x3425('0x25')][_0x3425('0x45')]);_0x3abda0['where']=qs[_0x3425('0x2c')](_[_0x3425('0x46')](_0x10c7b6[_0x3425('0x25')],_0x170caa['filters']));if(_0x10c7b6[_0x3425('0x25')][_0x3425('0x48')]){_0x3abda0[_0x3425('0x22')]=_[_0x3425('0x32')](_0x3abda0['where'],{'$or':_['map'](_0x3abda0[_0x3425('0x2e')],function(_0x3a8bc8){var _0x32ef35={};_0x32ef35[_0x3a8bc8]={'$like':'%'+_0x10c7b6[_0x3425('0x25')][_0x3425('0x48')]+'%'};return _0x32ef35;})});}_0x3abda0=_[_0x3425('0x32')]({},_0x3abda0,_0x10c7b6[_0x3425('0x33')]);return _0x8e1a58['getTeams'](_0x3abda0);}})[_0x3425('0x16')](function(_0x2d2ab1){if(_0x2d2ab1){_0x4149c7=_0x2d2ab1[_0x3425('0x30')];if(!_0x10c7b6[_0x3425('0x25')][_0x3425('0x43')](_0x3425('0x44'))){_0x3abda0[_0x3425('0x11')]=qs['limit'](_0x10c7b6[_0x3425('0x25')][_0x3425('0x11')]);_0x3abda0['offset']=qs[_0x3425('0xf')](_0x10c7b6['query'][_0x3425('0xf')]);}return _0x8e1a58['getTeams'](_0x3abda0);}})[_0x3425('0x16')](function(_0x49c940){if(_0x49c940){return _0x49c940?{'count':_0x4149c7,'rows':_0x49c940}:null;}})['then'](respondWithResult(_0x117873,null))['catch'](handleError(_0x117873,null));};exports['addTeams']=function(_0xae4975,_0x2ee041){var _0x5834c2=_0xae4975[_0x3425('0x36')][_0x3425('0x56')];return db[_0x3425('0x54')]['findAll']({'where':{'id':_0x5834c2},'attributes':['id'],'include':[{'model':db[_0x3425('0x57')],'as':_0x3425('0x58'),'attributes':['id',_0x3425('0x1b'),_0x3425('0x59'),'voicePause',_0x3425('0x5a')],'raw':!![]}]})[_0x3425('0x16')](function(_0xba39bd){if(_0xba39bd){var _0x194ddf=_[_0x3425('0x5b')](_0xba39bd,function(_0x2be122){var _0x272ccf=_0x2be122[_0x3425('0x18')]({'plain':!![]});return _0x272ccf[_0x3425('0x58')];});return db[_0x3425('0x23')][_0x3425('0x34')]({'where':{'id':_0xae4975['params']['id']}})[_0x3425('0x16')](function(_0x226c90){return db['sequelize'][_0x3425('0x5c')](function(_0x40c04c){return _0x226c90[_0x3425('0x5d')](_0x5834c2,{'transaction':_0x40c04c})[_0x3425('0x16')](function(){return BPromise[_0x3425('0x5e')](_0x194ddf,function(_0x3a9749){return db[_0x3425('0x42')][_0x3425('0x5f')]({'where':{'UserId':_0x3a9749['id'],'ChatQueueId':_0xae4975['params']['id']},'transaction':_0x40c04c});});})[_0x3425('0x16')](function(){_0x194ddf[_0x3425('0x60')](function(_0x274fad){socket['emit'](_0x3425('0x61'),{'UserId':_0x274fad['id'],'ChatQueueId':_0x226c90['id']});});});});});}})[_0x3425('0x16')](respondWithStatusCode(_0x2ee041,null))[_0x3425('0x27')](handleError(_0x2ee041,null));};exports[_0x3425('0x62')]=function(_0x46cb22,_0x211e3){return db[_0x3425('0x54')]['findAll']({'where':{'id':_0x46cb22['query'][_0x3425('0x56')]},'attributes':['id'],'include':[{'model':db[_0x3425('0x57')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x3425('0x16')](handleEntityNotFound(_0x211e3,null))[_0x3425('0x16')](function(_0x593921){var _0x23f919=_[_0x3425('0x1e')](_0x593921,'id');var _0x4638ba=[];var _0x201ac8=[];var _0x23667f=squel[_0x3425('0x63')]();_0x23667f[_0x3425('0x64')](_0x3425('0x65'))[_0x3425('0x66')](_0x3425('0x67'),'tq')[_0x3425('0x68')]('user_has_teams','ut',_0x3425('0x69'))[_0x3425('0x22')](_0x3425('0x6a'),_0x46cb22[_0x3425('0x29')]['id']);for(var _0x3f79b6=0x0;_0x3f79b6<_0x593921[_0x3425('0x30')];_0x3f79b6+=0x1){let _0x3e7788=_0x593921[_0x3f79b6];for(var _0x232448=0x0;_0x232448<_0x3e7788['Agents'][_0x3425('0x30')];_0x232448+=0x1){let _0x10a3d7=_0x3e7788['Agents'][_0x232448];var _0x7ae6e0=_0x23667f[_0x3425('0x6b')]();_0x7ae6e0[_0x3425('0x22')](_0x3425('0x6c'),_0x10a3d7['id']);_0x201ac8[_0x3425('0x6d')](db[_0x3425('0x6e')][_0x3425('0x25')](_0x7ae6e0[_0x3425('0x6f')](),{'type':db[_0x3425('0x6e')][_0x3425('0x70')][_0x3425('0x71')]})[_0x3425('0x16')](function(_0x349f80){if(_0x349f80[_0x3425('0x30')]===0x1){return _0x10a3d7['id'];}else{var _0x399931=_[_0x3425('0x72')](_[_0x3425('0x1e')](_0x349f80,_0x3425('0x73')),function(_0x560e94){return _['includes'](_0x23f919,_0x560e94);});if(_0x399931){return _0x10a3d7['id'];}}}));}}return BPromise[_0x3425('0x74')](_0x201ac8)[_0x3425('0x16')](function(_0x5b11bb){_0x4638ba=_(_0x4638ba)['union'](_0x5b11bb)['compact']()[_0x3425('0x75')]();return db['ChatQueue'][_0x3425('0x34')]({'where':{'id':_0x46cb22[_0x3425('0x29')]['id']}})[_0x3425('0x16')](function(_0x3da680){return db[_0x3425('0x6e')][_0x3425('0x5c')](function(_0x21c7ca){return _0x3da680[_0x3425('0x62')](_0x46cb22[_0x3425('0x25')]['ids'],{'transaction':_0x21c7ca})[_0x3425('0x16')](function(){if(!_['isEmpty'](_0x4638ba)){return _0x3da680[_0x3425('0x76')](_0x4638ba,{'transaction':_0x21c7ca});}})[_0x3425('0x16')](function(){_0x4638ba[_0x3425('0x60')](function(_0x10abbf){socket[_0x3425('0x77')](_0x3425('0x78'),{'UserId':_0x10abbf,'ChatQueueId':_0x3da680['id']});});});});});});})[_0x3425('0x16')](respondWithStatusCode(_0x211e3,null))[_0x3425('0x27')](handleError(_0x211e3,null));};exports[_0x3425('0x79')]=function(_0x23e459,_0x1ae341){return db[_0x3425('0x23')][_0x3425('0x34')]({'where':{'id':_0x23e459[_0x3425('0x29')]['id']}})[_0x3425('0x16')](handleEntityNotFound(_0x1ae341,null))[_0x3425('0x16')](function(_0x153d80){if(_0x153d80){return _0x153d80[_0x3425('0x79')](_0x23e459[_0x3425('0x36')][_0x3425('0x56')],_[_0x3425('0x7a')](_0x23e459['body'],[_0x3425('0x56'),'id'])||{})[_0x3425('0x7b')](function(_0x494d77){for(var _0x29aaa0=0x0;_0x29aaa0<_0x23e459[_0x3425('0x36')][_0x3425('0x56')]['length'];_0x29aaa0+=0x1){socket[_0x3425('0x77')]('userChatQueue:save',{'UserId':Number(_0x23e459['body'][_0x3425('0x56')][_0x29aaa0]),'ChatQueueId':Number(_0x23e459[_0x3425('0x29')]['id'])});}return _0x494d77;});}})[_0x3425('0x16')](respondWithResult(_0x1ae341,null))['catch'](handleError(_0x1ae341,null));};exports[_0x3425('0x76')]=function(_0x1da223,_0x14423e){return db['ChatQueue']['find']({'where':{'id':_0x1da223['params']['id']}})['then'](handleEntityNotFound(_0x14423e,null))[_0x3425('0x16')](function(_0x4309e5){if(_0x4309e5){return _0x4309e5[_0x3425('0x76')](_0x1da223[_0x3425('0x25')][_0x3425('0x56')])['then'](function(){if(_[_0x3425('0x7c')](_0x1da223[_0x3425('0x25')]['ids'])){for(var _0x1ae112=0x0;_0x1ae112<_0x1da223[_0x3425('0x25')][_0x3425('0x56')]['length'];_0x1ae112+=0x1){socket[_0x3425('0x77')]('userChatQueue:remove',{'UserId':Number(_0x1da223[_0x3425('0x25')]['ids'][_0x1ae112]),'ChatQueueId':Number(_0x1da223[_0x3425('0x29')]['id'])});}}else{socket[_0x3425('0x77')](_0x3425('0x78'),{'UserId':Number(_0x1da223[_0x3425('0x25')]['ids']),'ChatQueueId':Number(_0x1da223[_0x3425('0x29')]['id'])});}});}})[_0x3425('0x16')](respondWithStatusCode(_0x14423e,null))[_0x3425('0x27')](handleError(_0x14423e,null));};exports[_0x3425('0x7d')]=function(_0x268c1e,_0x5f36e8){var _0x3d288e={};var _0x3f9497={};var _0x5b0bd4;var _0x30d584;return db[_0x3425('0x23')][_0x3425('0x53')]({'where':{'id':_0x268c1e[_0x3425('0x29')]['id']}})[_0x3425('0x16')](handleEntityNotFound(_0x5f36e8,null))[_0x3425('0x16')](function(_0x470549){if(_0x470549){_0x5b0bd4=_0x470549;_0x3f9497[_0x3425('0x2a')]=_[_0x3425('0x2b')](db['User']['rawAttributes']);_0x3f9497[_0x3425('0x25')]=_[_0x3425('0x2b')](_0x268c1e[_0x3425('0x25')]);_0x3f9497[_0x3425('0x2c')]=_[_0x3425('0x2d')](_0x3f9497[_0x3425('0x2a')],_0x3f9497['query']);_0x3d288e['attributes']=_[_0x3425('0x2d')](_0x3f9497[_0x3425('0x2a')],qs[_0x3425('0x2f')](_0x268c1e['query'][_0x3425('0x2f')]));_0x3d288e[_0x3425('0x2e')]=_0x3d288e[_0x3425('0x2e')]['length']?_0x3d288e[_0x3425('0x2e')]:_0x3f9497[_0x3425('0x2a')];_0x3d288e[_0x3425('0x55')]=qs[_0x3425('0x45')](_0x268c1e['query'][_0x3425('0x45')]);_0x3d288e[_0x3425('0x22')]=qs[_0x3425('0x2c')](_[_0x3425('0x46')](_0x268c1e[_0x3425('0x25')],_0x3f9497[_0x3425('0x2c')]));if(_0x268c1e[_0x3425('0x25')][_0x3425('0x48')]){_0x3d288e[_0x3425('0x22')]=_[_0x3425('0x32')](_0x3d288e[_0x3425('0x22')],{'$or':_[_0x3425('0x1e')](_0x3d288e[_0x3425('0x2e')],function(_0x1aa2d9){var _0x55087c={};_0x55087c[_0x1aa2d9]={'$like':'%'+_0x268c1e[_0x3425('0x25')][_0x3425('0x48')]+'%'};return _0x55087c;})});}_0x3d288e=_['merge']({},_0x3d288e,_0x268c1e['options']);return _0x5b0bd4[_0x3425('0x7d')](_0x3d288e);}})[_0x3425('0x16')](function(_0x45ad24){if(_0x45ad24){_0x30d584=_0x45ad24['length'];if(!_0x268c1e[_0x3425('0x25')][_0x3425('0x43')](_0x3425('0x44'))){_0x3d288e[_0x3425('0x11')]=qs[_0x3425('0x11')](_0x268c1e['query']['limit']);_0x3d288e['offset']=qs[_0x3425('0xf')](_0x268c1e[_0x3425('0x25')]['offset']);}return _0x5b0bd4['getAgents'](_0x3d288e);}})['then'](function(_0x757a80){if(_0x757a80){return _0x757a80?{'count':_0x30d584,'rows':_0x757a80}:null;}})[_0x3425('0x16')](respondWithResult(_0x5f36e8,null))[_0x3425('0x27')](handleError(_0x5f36e8,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 265f7b8..604f9a4 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 _0x3189=['hasOwnProperty','hook','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','emit'];(function(_0x2f7e8b,_0x485137){var _0x213db3=function(_0x41c784){while(--_0x41c784){_0x2f7e8b['push'](_0x2f7e8b['shift']());}};_0x213db3(++_0x485137);}(_0x3189,0x134));var _0x9318=function(_0x31e00f,_0x1a4e77){_0x31e00f=_0x31e00f-0x0;var _0x260194=_0x3189[_0x31e00f];return _0x260194;};'use strict';var EventEmitter=require(_0x9318('0x0'));var ChatQueue=require(_0x9318('0x1'))['db'][_0x9318('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x9318('0x3')](0x0);var events={'afterCreate':_0x9318('0x4'),'afterUpdate':_0x9318('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2798e7){return function(_0x54a583,_0x4c74e4,_0x311d15){ChatQueueEvents['emit'](_0x2798e7+':'+_0x54a583['id'],_0x54a583);ChatQueueEvents[_0x9318('0x6')](_0x2798e7,_0x54a583);_0x311d15(null);};}for(var e in events){if(events[_0x9318('0x7')](e)){var event=events[e];ChatQueue[_0x9318('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x769b=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','update','emit'];(function(_0x3b9765,_0xb8bdf6){var _0x2ecc5f=function(_0x18bbac){while(--_0x18bbac){_0x3b9765['push'](_0x3b9765['shift']());}};_0x2ecc5f(++_0xb8bdf6);}(_0x769b,0x123));var _0xb769=function(_0x2aa4fd,_0xd4a864){_0x2aa4fd=_0x2aa4fd-0x0;var _0x266dc6=_0x769b[_0x2aa4fd];return _0x266dc6;};'use strict';var EventEmitter=require(_0xb769('0x0'));var ChatQueue=require(_0xb769('0x1'))['db'][_0xb769('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb769('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb769('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3fdb49){return function(_0x5b67ea,_0x23fbaa,_0x487f34){ChatQueueEvents[_0xb769('0x5')](_0x3fdb49+':'+_0x5b67ea['id'],_0x5b67ea);ChatQueueEvents[_0xb769('0x5')](_0x3fdb49,_0x5b67ea);_0x487f34(null);};}for(var e in events){if(events[_0xb769('0x6')](e)){var event=events[e];ChatQueue[_0xb769('0x7')](e,emitEvent(event));}}module[_0xb769('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index f388df9..3e038a8 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 _0x6c4b=['rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3763e9,_0xc54cb1){var _0x2ced2d=function(_0x3cd012){while(--_0x3cd012){_0x3763e9['push'](_0x3763e9['shift']());}};_0x2ced2d(++_0xc54cb1);}(_0x6c4b,0x156));var _0xb6c4=function(_0x47da3c,_0x1ab06d){_0x47da3c=_0x47da3c-0x0;var _0x1d0942=_0x6c4b[_0x47da3c];return _0x1d0942;};'use strict';var _=require(_0xb6c4('0x0'));var util=require(_0xb6c4('0x1'));var logger=require(_0xb6c4('0x2'))(_0xb6c4('0x3'));var moment=require(_0xb6c4('0x4'));var BPromise=require(_0xb6c4('0x5'));var rp=require(_0xb6c4('0x6'));var fs=require('fs');var path=require(_0xb6c4('0x7'));var rimraf=require(_0xb6c4('0x8'));var config=require('../../config/environment');var attributes=require(_0xb6c4('0x9'));module[_0xb6c4('0xa')]=function(_0x4bb081,_0x33a817){return _0x4bb081[_0xb6c4('0xb')](_0xb6c4('0xc'),attributes,{'tableName':_0xb6c4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc050=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','util','../../config/logger'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xc050,0x65));var _0x0c05=function(_0x2c2d99,_0x1a61ce){_0x2c2d99=_0x2c2d99-0x0;var _0xc9af40=_0xc050[_0x2c2d99];return _0xc9af40;};'use strict';var _=require(_0x0c05('0x0'));var util=require(_0x0c05('0x1'));var logger=require(_0x0c05('0x2'))('api');var moment=require(_0x0c05('0x3'));var BPromise=require(_0x0c05('0x4'));var rp=require(_0x0c05('0x5'));var fs=require('fs');var path=require(_0x0c05('0x6'));var rimraf=require(_0x0c05('0x7'));var config=require(_0x0c05('0x8'));var attributes=require(_0x0c05('0x9'));module[_0x0c05('0xa')]=function(_0x424e3f,_0x2b8789){return _0x424e3f[_0x0c05('0xb')](_0x0c05('0xc'),attributes,{'tableName':'chat_queues','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 d24159b..c97c1d2 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 _0x98f9=['model','include','then','GetChatQueue','stringify','ShowChatQueue','where','catch','lodash','bluebird','../../config/utils','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','findAll','options','raw','attributes','limit','map'];(function(_0x293d1e,_0x3de227){var _0x2851eb=function(_0x4fb17a){while(--_0x4fb17a){_0x293d1e['push'](_0x293d1e['shift']());}};_0x2851eb(++_0x3de227);}(_0x98f9,0x1a8));var _0x998f=function(_0x227978,_0x3d1003){_0x227978=_0x227978-0x0;var _0x15f45f=_0x98f9[_0x227978];return _0x15f45f;};'use strict';var _=require(_0x998f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x998f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x998f('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x998f('0x3'));var jayson=require(_0x998f('0x4'));var client=jayson['client'][_0x998f('0x5')]({'port':0x232a});config[_0x998f('0x6')]=_['defaults'](config[_0x998f('0x6')],{'host':_0x998f('0x7'),'port':0x18eb});var socket=require(_0x998f('0x8'))(new Redis(config[_0x998f('0x6')]));require(_0x998f('0x9'))[_0x998f('0xa')](socket);function respondWithRpcPromise(_0x497098,_0x1abdc0,_0x3491df){return new BPromise(function(_0x135c21,_0x2358a4){return client['request'](_0x497098,_0x3491df)['then'](function(_0x5a3d5e){logger[_0x998f('0xb')](_0x998f('0xc'),_0x1abdc0,_0x998f('0xd'));logger[_0x998f('0xe')](_0x998f('0xf'),_0x1abdc0,'request\x20sent',JSON['stringify'](_0x5a3d5e));if(_0x5a3d5e[_0x998f('0x10')]){if(_0x5a3d5e[_0x998f('0x10')]['code']===0x1f4){logger[_0x998f('0x10')](_0x998f('0xc'),_0x1abdc0,_0x5a3d5e['error']['message']);return _0x2358a4(_0x5a3d5e[_0x998f('0x10')][_0x998f('0x11')]);}logger[_0x998f('0x10')](_0x998f('0xc'),_0x1abdc0,_0x5a3d5e[_0x998f('0x10')][_0x998f('0x11')]);return _0x135c21(_0x5a3d5e[_0x998f('0x10')][_0x998f('0x11')]);}else{logger[_0x998f('0xb')](_0x998f('0xc'),_0x1abdc0,'request\x20sent');_0x135c21(_0x5a3d5e['result'][_0x998f('0x11')]);}})['catch'](function(_0x1ee5fb){logger[_0x998f('0x10')]('ChatQueue,\x20%s,\x20%s',_0x1abdc0,_0x1ee5fb);_0x2358a4(_0x1ee5fb);});});}exports['GetChatQueue']=function(_0x22a4ab){var _0x5ad916=this;return new Promise(function(_0x1ee3ea,_0x464f9a){return db['ChatQueue'][_0x998f('0x12')]({'raw':_0x22a4ab['options']?_0x22a4ab[_0x998f('0x13')][_0x998f('0x14')]===undefined?!![]:![]:!![],'where':_0x22a4ab['options']?_0x22a4ab[_0x998f('0x13')]['where']||null:null,'attributes':_0x22a4ab['options']?_0x22a4ab['options'][_0x998f('0x15')]||null:null,'limit':_0x22a4ab[_0x998f('0x13')]?_0x22a4ab[_0x998f('0x13')][_0x998f('0x16')]||null:null,'include':_0x22a4ab['options']?_0x22a4ab[_0x998f('0x13')]['include']?_[_0x998f('0x17')](_0x22a4ab['options']['include'],function(_0xa622f1){return{'model':db[_0xa622f1[_0x998f('0x18')]],'as':_0xa622f1['as'],'attributes':_0xa622f1[_0x998f('0x15')],'include':_0xa622f1[_0x998f('0x19')]?_[_0x998f('0x17')](_0xa622f1[_0x998f('0x19')],function(_0x27c075){return{'model':db[_0x27c075[_0x998f('0x18')]],'as':_0x27c075['as'],'attributes':_0x27c075[_0x998f('0x15')],'include':_0x27c075[_0x998f('0x19')]?_[_0x998f('0x17')](_0x27c075[_0x998f('0x19')],function(_0xba1837){return{'model':db[_0xba1837[_0x998f('0x18')]],'as':_0xba1837['as'],'attributes':_0xba1837['attributes']};}):[]};}):[]};}):[]:[]})[_0x998f('0x1a')](function(_0x55d8a9){logger[_0x998f('0xb')](_0x998f('0x1b'),_0x22a4ab);logger['debug'](_0x998f('0x1b'),_0x22a4ab,JSON[_0x998f('0x1c')](_0x55d8a9));_0x1ee3ea(_0x55d8a9);})['catch'](function(_0x1ee365){logger[_0x998f('0x10')]('GetChatQueue',_0x1ee365[_0x998f('0x11')],_0x22a4ab);_0x464f9a(_0x5ad916['error'](0x1f4,_0x1ee365[_0x998f('0x11')]));});});};exports[_0x998f('0x1d')]=function(_0x3fff53){var _0x451900=this;return new Promise(function(_0x36a89e,_0x5d1fb8){return db['ChatQueue']['find']({'raw':_0x3fff53[_0x998f('0x13')]?_0x3fff53[_0x998f('0x13')][_0x998f('0x14')]===undefined?!![]:![]:!![],'where':_0x3fff53[_0x998f('0x13')]?_0x3fff53[_0x998f('0x13')][_0x998f('0x1e')]||null:null,'attributes':_0x3fff53[_0x998f('0x13')]?_0x3fff53[_0x998f('0x13')][_0x998f('0x15')]||null:null,'include':_0x3fff53[_0x998f('0x13')]?_0x3fff53[_0x998f('0x13')][_0x998f('0x19')]?_[_0x998f('0x17')](_0x3fff53[_0x998f('0x13')]['include'],function(_0x4f52bc){return{'model':db[_0x4f52bc['model']],'as':_0x4f52bc['as'],'attributes':_0x4f52bc['attributes'],'include':_0x4f52bc[_0x998f('0x19')]?_['map'](_0x4f52bc[_0x998f('0x19')],function(_0x25ecff){return{'model':db[_0x25ecff[_0x998f('0x18')]],'as':_0x25ecff['as'],'attributes':_0x25ecff[_0x998f('0x15')],'include':_0x25ecff[_0x998f('0x19')]?_['map'](_0x25ecff[_0x998f('0x19')],function(_0x3e52e5){return{'model':db[_0x3e52e5['model']],'as':_0x3e52e5['as'],'attributes':_0x3e52e5[_0x998f('0x15')]};}):[]};}):[]};}):[]:[]})[_0x998f('0x1a')](function(_0x4d54e4){logger[_0x998f('0xb')]('ShowChatQueue',_0x3fff53);logger[_0x998f('0xe')](_0x998f('0x1d'),_0x3fff53,JSON['stringify'](_0x4d54e4));_0x36a89e(_0x4d54e4);})[_0x998f('0x1f')](function(_0x3a7c9f){logger['error']('ShowChatQueue',_0x3a7c9f['message'],_0x3fff53);_0x5d1fb8(_0x451900[_0x998f('0x10')](0x1f4,_0x3a7c9f[_0x998f('0x11')]));});});}; \ No newline at end of file +var _0x2a4e=['redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetChatQueue','raw','options','where','attributes','limit','include','map','model','find','ShowChatQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x25a802,_0x302a01){var _0x34764f=function(_0x1849ef){while(--_0x1849ef){_0x25a802['push'](_0x25a802['shift']());}};_0x34764f(++_0x302a01);}(_0x2a4e,0x1df));var _0xe2a4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a4e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe2a4('0x0'));var util=require('util');var moment=require(_0xe2a4('0x1'));var BPromise=require(_0xe2a4('0x2'));var rs=require(_0xe2a4('0x3'));var fs=require('fs');var Redis=require(_0xe2a4('0x4'));var db=require(_0xe2a4('0x5'))['db'];var utils=require(_0xe2a4('0x6'));var logger=require(_0xe2a4('0x7'))(_0xe2a4('0x8'));var config=require(_0xe2a4('0x9'));var jayson=require(_0xe2a4('0xa'));var client=jayson[_0xe2a4('0xb')][_0xe2a4('0xc')]({'port':0x232a});config[_0xe2a4('0xd')]=_[_0xe2a4('0xe')](config[_0xe2a4('0xd')],{'host':_0xe2a4('0xf'),'port':0x18eb});var socket=require(_0xe2a4('0x10'))(new Redis(config[_0xe2a4('0xd')]));require(_0xe2a4('0x11'))['register'](socket);function respondWithRpcPromise(_0x2bcfbd,_0x5ac6d5,_0x12a3de){return new BPromise(function(_0x524a46,_0x37b3ad){return client[_0xe2a4('0x12')](_0x2bcfbd,_0x12a3de)[_0xe2a4('0x13')](function(_0x220cc3){logger[_0xe2a4('0x14')](_0xe2a4('0x15'),_0x5ac6d5,_0xe2a4('0x16'));logger[_0xe2a4('0x17')](_0xe2a4('0x18'),_0x5ac6d5,'request\x20sent',JSON[_0xe2a4('0x19')](_0x220cc3));if(_0x220cc3[_0xe2a4('0x1a')]){if(_0x220cc3[_0xe2a4('0x1a')][_0xe2a4('0x1b')]===0x1f4){logger[_0xe2a4('0x1a')](_0xe2a4('0x15'),_0x5ac6d5,_0x220cc3['error'][_0xe2a4('0x1c')]);return _0x37b3ad(_0x220cc3[_0xe2a4('0x1a')][_0xe2a4('0x1c')]);}logger[_0xe2a4('0x1a')](_0xe2a4('0x15'),_0x5ac6d5,_0x220cc3[_0xe2a4('0x1a')]['message']);return _0x524a46(_0x220cc3['error']['message']);}else{logger[_0xe2a4('0x14')](_0xe2a4('0x15'),_0x5ac6d5,_0xe2a4('0x16'));_0x524a46(_0x220cc3['result']['message']);}})[_0xe2a4('0x1d')](function(_0x5ab14b){logger['error'](_0xe2a4('0x15'),_0x5ac6d5,_0x5ab14b);_0x37b3ad(_0x5ab14b);});});}exports[_0xe2a4('0x1e')]=function(_0x123658){var _0x30b75b=this;return new Promise(function(_0x1ac839,_0x13dc98){return db['ChatQueue']['findAll']({'raw':_0x123658['options']?_0x123658['options'][_0xe2a4('0x1f')]===undefined?!![]:![]:!![],'where':_0x123658[_0xe2a4('0x20')]?_0x123658[_0xe2a4('0x20')][_0xe2a4('0x21')]||null:null,'attributes':_0x123658[_0xe2a4('0x20')]?_0x123658['options'][_0xe2a4('0x22')]||null:null,'limit':_0x123658[_0xe2a4('0x20')]?_0x123658[_0xe2a4('0x20')][_0xe2a4('0x23')]||null:null,'include':_0x123658[_0xe2a4('0x20')]?_0x123658[_0xe2a4('0x20')]['include']?_['map'](_0x123658[_0xe2a4('0x20')][_0xe2a4('0x24')],function(_0x4f5603){return{'model':db[_0x4f5603['model']],'as':_0x4f5603['as'],'attributes':_0x4f5603['attributes'],'include':_0x4f5603[_0xe2a4('0x24')]?_[_0xe2a4('0x25')](_0x4f5603[_0xe2a4('0x24')],function(_0x32681b){return{'model':db[_0x32681b[_0xe2a4('0x26')]],'as':_0x32681b['as'],'attributes':_0x32681b['attributes'],'include':_0x32681b[_0xe2a4('0x24')]?_[_0xe2a4('0x25')](_0x32681b[_0xe2a4('0x24')],function(_0x17e5a6){return{'model':db[_0x17e5a6['model']],'as':_0x17e5a6['as'],'attributes':_0x17e5a6[_0xe2a4('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe2a4('0x13')](function(_0x18d4d9){logger[_0xe2a4('0x14')]('GetChatQueue',_0x123658);logger[_0xe2a4('0x17')](_0xe2a4('0x1e'),_0x123658,JSON['stringify'](_0x18d4d9));_0x1ac839(_0x18d4d9);})[_0xe2a4('0x1d')](function(_0x1853e0){logger[_0xe2a4('0x1a')]('GetChatQueue',_0x1853e0[_0xe2a4('0x1c')],_0x123658);_0x13dc98(_0x30b75b['error'](0x1f4,_0x1853e0[_0xe2a4('0x1c')]));});});};exports['ShowChatQueue']=function(_0x235dd4){var _0x217e62=this;return new Promise(function(_0x27c96d,_0x3e0dd5){return db['ChatQueue'][_0xe2a4('0x27')]({'raw':_0x235dd4['options']?_0x235dd4[_0xe2a4('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x235dd4[_0xe2a4('0x20')]?_0x235dd4[_0xe2a4('0x20')][_0xe2a4('0x21')]||null:null,'attributes':_0x235dd4[_0xe2a4('0x20')]?_0x235dd4['options'][_0xe2a4('0x22')]||null:null,'include':_0x235dd4['options']?_0x235dd4[_0xe2a4('0x20')][_0xe2a4('0x24')]?_['map'](_0x235dd4[_0xe2a4('0x20')][_0xe2a4('0x24')],function(_0x27163a){return{'model':db[_0x27163a['model']],'as':_0x27163a['as'],'attributes':_0x27163a['attributes'],'include':_0x27163a[_0xe2a4('0x24')]?_['map'](_0x27163a[_0xe2a4('0x24')],function(_0x4d24fc){return{'model':db[_0x4d24fc[_0xe2a4('0x26')]],'as':_0x4d24fc['as'],'attributes':_0x4d24fc[_0xe2a4('0x22')],'include':_0x4d24fc[_0xe2a4('0x24')]?_[_0xe2a4('0x25')](_0x4d24fc[_0xe2a4('0x24')],function(_0x5a039c){return{'model':db[_0x5a039c[_0xe2a4('0x26')]],'as':_0x5a039c['as'],'attributes':_0x5a039c[_0xe2a4('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x310178){logger[_0xe2a4('0x14')](_0xe2a4('0x28'),_0x235dd4);logger[_0xe2a4('0x17')](_0xe2a4('0x28'),_0x235dd4,JSON[_0xe2a4('0x19')](_0x310178));_0x27c96d(_0x310178);})[_0xe2a4('0x1d')](function(_0x4e3940){logger[_0xe2a4('0x1a')](_0xe2a4('0x28'),_0x4e3940['message'],_0x235dd4);_0x3e0dd5(_0x217e62[_0xe2a4('0x1a')](0x1f4,_0x4e3940[_0xe2a4('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 9e1465e..132cb5c 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 _0xf72b=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','emit'];(function(_0x4da7f8,_0x5d836d){var _0x4968d0=function(_0x2bdd0b){while(--_0x2bdd0b){_0x4da7f8['push'](_0x4da7f8['shift']());}};_0x4968d0(++_0x5d836d);}(_0xf72b,0x1d9));var _0xbf72=function(_0x2bec9a,_0x3d4d94){_0x2bec9a=_0x2bec9a-0x0;var _0x3d6342=_0xf72b[_0x2bec9a];return _0x3d6342;};'use strict';var ChatQueueEvents=require(_0xbf72('0x0'));var events=['save',_0xbf72('0x1'),'update'];function createListener(_0xd09dd2,_0x1880d0){return function(_0x5a9feb){_0x1880d0[_0xbf72('0x2')](_0xd09dd2,_0x5a9feb);};}function removeListener(_0x550a9e,_0x37afc8){return function(){ChatQueueEvents[_0xbf72('0x3')](_0x550a9e,_0x37afc8);};}exports[_0xbf72('0x4')]=function(_0x2b8440){for(var _0x5ee060=0x0,_0x41c11d=events[_0xbf72('0x5')];_0x5ee060<_0x41c11d;_0x5ee060++){var _0x119807=events[_0x5ee060];var _0xd0402c=createListener(_0xbf72('0x6')+_0x119807,_0x2b8440);ChatQueueEvents['on'](_0x119807,_0xd0402c);}}; \ No newline at end of file +var _0x2123=['./chatQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x177698,_0x1e8287){var _0x23a1ea=function(_0x89b86f){while(--_0x89b86f){_0x177698['push'](_0x177698['shift']());}};_0x23a1ea(++_0x1e8287);}(_0x2123,0x190));var _0x3212=function(_0x53a69f,_0x39dc5f){_0x53a69f=_0x53a69f-0x0;var _0x258bc1=_0x2123[_0x53a69f];return _0x258bc1;};'use strict';var ChatQueueEvents=require(_0x3212('0x0'));var events=[_0x3212('0x1'),_0x3212('0x2'),_0x3212('0x3')];function createListener(_0x7158b8,_0x2ff863){return function(_0x8c047){_0x2ff863[_0x3212('0x4')](_0x7158b8,_0x8c047);};}function removeListener(_0x304f80,_0x6ca653){return function(){ChatQueueEvents[_0x3212('0x5')](_0x304f80,_0x6ca653);};}exports[_0x3212('0x6')]=function(_0x5d9d36){for(var _0x3859e4=0x0,_0x2b1302=events[_0x3212('0x7')];_0x3859e4<_0x2b1302;_0x3859e4++){var _0x4b35e9=events[_0x3859e4];var _0x3e17a3=createListener('chatQueue:'+_0x4b35e9,_0x5d9d36);ChatQueueEvents['on'](_0x4b35e9,_0x3e17a3);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index bf3f43d..a25b19f 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(_0x1e2d10,_0x559545){var _0x48acb0=function(_0xb2dbea){while(--_0xb2dbea){_0x1e2d10['push'](_0x1e2d10['shift']());}};_0x48acb0(++_0x559545);}(_0x7217,0x19e));var _0x7721=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x7217[_0x3b5250];return _0xc844a1;};'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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x5fc3,0xa8));var _0x35fc=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0x5fc3[_0x597484];return _0x218e64;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 6c194fa..0b38f2b 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 _0x4c31=['sequelize','exports','DATE','STRING','moment'];(function(_0x2069cd,_0x164d0b){var _0x308b27=function(_0x2faaec){while(--_0x2faaec){_0x2069cd['push'](_0x2069cd['shift']());}};_0x308b27(++_0x164d0b);}(_0x4c31,0x95));var _0x14c3=function(_0xde71b6,_0x4566af){_0xde71b6=_0xde71b6-0x0;var _0xe029ae=_0x4c31[_0xde71b6];return _0xe029ae;};'use strict';var moment=require(_0x14c3('0x0'));var Sequelize=require(_0x14c3('0x1'));module[_0x14c3('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x14c3('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x14c3('0x3')]},'reason':{'type':Sequelize[_0x14c3('0x4')]}}; \ No newline at end of file +var _0x8ff4=['exports','STRING','DATE','moment'];(function(_0x575428,_0x4effe7){var _0x1ca522=function(_0x2a309f){while(--_0x2a309f){_0x575428['push'](_0x575428['shift']());}};_0x1ca522(++_0x4effe7);}(_0x8ff4,0x1b3));var _0x48ff=function(_0x263a16,_0x489c01){_0x263a16=_0x263a16-0x0;var _0x251824=_0x8ff4[_0x263a16];return _0x251824;};'use strict';var moment=require(_0x48ff('0x0'));var Sequelize=require('sequelize');module[_0x48ff('0x1')]={'uniqueid':{'type':Sequelize[_0x48ff('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x48ff('0x2')]},'joinAt':{'type':Sequelize[_0x48ff('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x48ff('0x3')]},'reason':{'type':Sequelize[_0x48ff('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index a259197..cf894d7 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 _0xa4bd=['count','set','reject','save','update','then','destroy','stack','name','index','ChatQueueReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xa4bd,0x1e4));var _0xda4b=function(_0x238189,_0x3f8202){_0x238189=_0x238189-0x0;var _0x2b852f=_0xa4bd[_0x238189];return _0x2b852f;};'use strict';var emlformat=require(_0xda4b('0x0'));var rimraf=require(_0xda4b('0x1'));var zipdir=require(_0xda4b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda4b('0x3'));var moment=require(_0xda4b('0x4'));var BPromise=require(_0xda4b('0x5'));var Mustache=require(_0xda4b('0x6'));var util=require(_0xda4b('0x7'));var path=require(_0xda4b('0x8'));var sox=require(_0xda4b('0x9'));var csv=require(_0xda4b('0xa'));var ejs=require(_0xda4b('0xb'));var fs=require('fs');var fs_extra=require(_0xda4b('0xc'));var _=require('lodash');var squel=require(_0xda4b('0xd'));var crypto=require(_0xda4b('0xe'));var jsforce=require(_0xda4b('0xf'));var deskjs=require(_0xda4b('0x10'));var toCsv=require('to-csv');var querystring=require(_0xda4b('0x11'));var Papa=require(_0xda4b('0x12'));var Redis=require(_0xda4b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xda4b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda4b('0x15'));var logger=require(_0xda4b('0x16'))(_0xda4b('0x17'));var utils=require(_0xda4b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xda4b('0x19'));var db=require(_0xda4b('0x1a'))['db'];function respondWithStatusCode(_0x2781d3,_0x2f9554){_0x2f9554=_0x2f9554||0xcc;return function(_0x2d3243){if(_0x2d3243){return _0x2781d3[_0xda4b('0x1b')](_0x2f9554);}return _0x2781d3[_0xda4b('0x1c')](_0x2f9554)[_0xda4b('0x1d')]();};}function respondWithResult(_0xb5881c,_0xb70e25){_0xb70e25=_0xb70e25||0xc8;return function(_0x4c25db){if(_0x4c25db){return _0xb5881c[_0xda4b('0x1c')](_0xb70e25)[_0xda4b('0x1e')](_0x4c25db);}};}function respondWithFilteredResult(_0xb7ec2c,_0x2fb875){return function(_0x1a3115){if(_0x1a3115){var _0x12e7fc=typeof _0x2fb875[_0xda4b('0x1f')]===_0xda4b('0x20')&&typeof _0x2fb875[_0xda4b('0x21')]===_0xda4b('0x20');var _0x30185e=_0x1a3115[_0xda4b('0x22')];var _0x5ed049=_0x12e7fc?0x0:_0x2fb875[_0xda4b('0x1f')];var _0x56c65e=_0x12e7fc?_0x1a3115['count']:_0x2fb875[_0xda4b('0x1f')]+_0x2fb875[_0xda4b('0x21')];var _0x42834c;if(_0x56c65e>=_0x30185e){_0x56c65e=_0x30185e;_0x42834c=0xc8;}else{_0x42834c=0xce;}_0xb7ec2c[_0xda4b('0x1c')](_0x42834c);return _0xb7ec2c[_0xda4b('0x23')]('Content-Range',_0x5ed049+'-'+_0x56c65e+'/'+_0x30185e)['json'](_0x1a3115);}return null;};}function patchUpdates(_0x2397de){return function(_0x139bfa){try{jsonpatch['apply'](_0x139bfa,_0x2397de,!![]);}catch(_0x2a8425){return BPromise[_0xda4b('0x24')](_0x2a8425);}return _0x139bfa[_0xda4b('0x25')]();};}function saveUpdates(_0x56566a,_0x48d8a8){return function(_0x3e9f20){if(_0x3e9f20){return _0x3e9f20[_0xda4b('0x26')](_0x56566a)[_0xda4b('0x27')](function(_0x1c57ce){return _0x1c57ce;});}return null;};}function removeEntity(_0x318d48,_0x606e86){return function(_0x108adf){if(_0x108adf){return _0x108adf[_0xda4b('0x28')]()[_0xda4b('0x27')](function(){_0x318d48[_0xda4b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f6ecc,_0x5f19ef){return function(_0x3046dc){if(!_0x3046dc){_0x2f6ecc[_0xda4b('0x1b')](0x194);}return _0x3046dc;};}function handleError(_0x4a7cac,_0x5ecf1a){_0x5ecf1a=_0x5ecf1a||0x1f4;return function(_0x1b03f1){logger['error'](_0x1b03f1[_0xda4b('0x29')]);if(_0x1b03f1[_0xda4b('0x2a')]){delete _0x1b03f1[_0xda4b('0x2a')];}_0x4a7cac[_0xda4b('0x1c')](_0x5ecf1a)['send'](_0x1b03f1);};}exports[_0xda4b('0x2b')]=function(_0x1ce977,_0x18f78a){var _0x550ec4={},_0x52022b={},_0x218bb2={'count':0x0,'rows':[]};var _0x1277cc=_['map'](db[_0xda4b('0x2c')][_0xda4b('0x2d')],function(_0x5312ab){return{'name':_0x5312ab[_0xda4b('0x2e')],'type':_0x5312ab[_0xda4b('0x2f')]['key']};});_0x52022b[_0xda4b('0x30')]=_[_0xda4b('0x31')](_0x1277cc,_0xda4b('0x2a'));_0x52022b['query']=_['keys'](_0x1ce977[_0xda4b('0x32')]);_0x52022b[_0xda4b('0x33')]=_[_0xda4b('0x34')](_0x52022b['model'],_0x52022b[_0xda4b('0x32')]);_0x550ec4['attributes']=_[_0xda4b('0x34')](_0x52022b[_0xda4b('0x30')],qs['fields'](_0x1ce977[_0xda4b('0x32')][_0xda4b('0x35')]));_0x550ec4[_0xda4b('0x36')]=_0x550ec4[_0xda4b('0x36')]['length']?_0x550ec4['attributes']:_0x52022b['model'];if(!_0x1ce977[_0xda4b('0x32')][_0xda4b('0x37')]('nolimit')){_0x550ec4['limit']=qs[_0xda4b('0x21')](_0x1ce977[_0xda4b('0x32')]['limit']);_0x550ec4[_0xda4b('0x1f')]=qs[_0xda4b('0x1f')](_0x1ce977['query'][_0xda4b('0x1f')]);}_0x550ec4[_0xda4b('0x38')]=qs[_0xda4b('0x39')](_0x1ce977[_0xda4b('0x32')][_0xda4b('0x39')]);_0x550ec4['where']=qs[_0xda4b('0x33')](_['pick'](_0x1ce977[_0xda4b('0x32')],_0x52022b[_0xda4b('0x33')]),_0x1277cc);if(_0x1ce977['query'][_0xda4b('0x3a')]){_0x550ec4['where']=_[_0xda4b('0x3b')](_0x550ec4[_0xda4b('0x3c')],{'$or':_[_0xda4b('0x31')](_0x1277cc,function(_0x46b8e1){if(_0x46b8e1[_0xda4b('0x2f')]!==_0xda4b('0x3d')){var _0x5b7350={};_0x5b7350[_0x46b8e1[_0xda4b('0x2a')]]={'$like':'%'+_0x1ce977[_0xda4b('0x32')][_0xda4b('0x3a')]+'%'};return _0x5b7350;}})});}_0x550ec4=_[_0xda4b('0x3b')]({},_0x550ec4,_0x1ce977[_0xda4b('0x3e')]);var _0x710929={'where':_0x550ec4['where']};return db['ChatQueueReport'][_0xda4b('0x22')](_0x710929)[_0xda4b('0x27')](function(_0x18b7bb){_0x218bb2[_0xda4b('0x22')]=_0x18b7bb;if(_0x1ce977[_0xda4b('0x32')][_0xda4b('0x3f')]){_0x550ec4[_0xda4b('0x40')]=[{'all':!![]}];}return db[_0xda4b('0x2c')]['findAll'](_0x550ec4);})['then'](function(_0x5a7988){_0x218bb2[_0xda4b('0x41')]=_0x5a7988;return _0x218bb2;})[_0xda4b('0x27')](respondWithFilteredResult(_0x18f78a,_0x550ec4))[_0xda4b('0x42')](handleError(_0x18f78a,null));};exports[_0xda4b('0x43')]=function(_0x1b0f58,_0x1d875b){var _0x59f5a8={'raw':!![],'where':{'id':_0x1b0f58[_0xda4b('0x44')]['id']}},_0x1b1abb={};_0x1b1abb[_0xda4b('0x30')]=_[_0xda4b('0x45')](db[_0xda4b('0x2c')][_0xda4b('0x2d')]);_0x1b1abb[_0xda4b('0x32')]=_[_0xda4b('0x45')](_0x1b0f58[_0xda4b('0x32')]);_0x1b1abb[_0xda4b('0x33')]=_[_0xda4b('0x34')](_0x1b1abb[_0xda4b('0x30')],_0x1b1abb[_0xda4b('0x32')]);_0x59f5a8[_0xda4b('0x36')]=_[_0xda4b('0x34')](_0x1b1abb[_0xda4b('0x30')],qs[_0xda4b('0x35')](_0x1b0f58[_0xda4b('0x32')][_0xda4b('0x35')]));_0x59f5a8[_0xda4b('0x36')]=_0x59f5a8[_0xda4b('0x36')]['length']?_0x59f5a8[_0xda4b('0x36')]:_0x1b1abb[_0xda4b('0x30')];if(_0x1b0f58[_0xda4b('0x32')][_0xda4b('0x3f')]){_0x59f5a8['include']=[{'all':!![]}];}_0x59f5a8=_[_0xda4b('0x3b')]({},_0x59f5a8,_0x1b0f58[_0xda4b('0x3e')]);return db[_0xda4b('0x2c')][_0xda4b('0x46')](_0x59f5a8)[_0xda4b('0x27')](handleEntityNotFound(_0x1d875b,null))[_0xda4b('0x27')](respondWithResult(_0x1d875b,null))[_0xda4b('0x42')](handleError(_0x1d875b,null));};exports[_0xda4b('0x47')]=function(_0x633f12,_0x579261){return db[_0xda4b('0x2c')][_0xda4b('0x47')](_0x633f12[_0xda4b('0x48')],{})[_0xda4b('0x27')](respondWithResult(_0x579261,0xc9))[_0xda4b('0x42')](handleError(_0x579261,null));};exports[_0xda4b('0x26')]=function(_0x5c8aef,_0x2311be){if(_0x5c8aef[_0xda4b('0x48')]['id']){delete _0x5c8aef[_0xda4b('0x48')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x5c8aef[_0xda4b('0x44')]['id']}})['then'](handleEntityNotFound(_0x2311be,null))[_0xda4b('0x27')](saveUpdates(_0x5c8aef['body'],null))[_0xda4b('0x27')](respondWithResult(_0x2311be,null))[_0xda4b('0x42')](handleError(_0x2311be,null));};exports[_0xda4b('0x28')]=function(_0x4c139e,_0x50fd28){return db[_0xda4b('0x2c')][_0xda4b('0x46')]({'where':{'id':_0x4c139e['params']['id']}})[_0xda4b('0x27')](handleEntityNotFound(_0x50fd28,null))[_0xda4b('0x27')](removeEntity(_0x50fd28,null))[_0xda4b('0x42')](handleError(_0x50fd28,null));};exports['describe']=function(_0x521cd4,_0x162d6f){return db['ChatQueueReport'][_0xda4b('0x49')]()[_0xda4b('0x27')](respondWithResult(_0x162d6f,null))[_0xda4b('0x42')](handleError(_0x162d6f,null));}; \ No newline at end of file +var _0xe0c1=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','destroy','then','error','name','send','index','map','ChatQueueReport','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','filter','include','findAll','rows','catch','params','length','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service'];(function(_0x36909d,_0x2795f1){var _0x1fd29d=function(_0x27d0fa){while(--_0x27d0fa){_0x36909d['push'](_0x36909d['shift']());}};_0x1fd29d(++_0x2795f1);}(_0xe0c1,0x10f));var _0x1e0c=function(_0x1e6db6,_0x372a8d){_0x1e6db6=_0x1e6db6-0x0;var _0x506f4c=_0xe0c1[_0x1e6db6];return _0x506f4c;};'use strict';var emlformat=require(_0x1e0c('0x0'));var rimraf=require(_0x1e0c('0x1'));var zipdir=require(_0x1e0c('0x2'));var jsonpatch=require(_0x1e0c('0x3'));var rp=require(_0x1e0c('0x4'));var moment=require(_0x1e0c('0x5'));var BPromise=require(_0x1e0c('0x6'));var Mustache=require('mustache');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(_0x1e0c('0x7'));var _=require(_0x1e0c('0x8'));var squel=require(_0x1e0c('0x9'));var crypto=require(_0x1e0c('0xa'));var jsforce=require(_0x1e0c('0xb'));var deskjs=require(_0x1e0c('0xc'));var toCsv=require(_0x1e0c('0xd'));var querystring=require(_0x1e0c('0xe'));var Papa=require('papaparse');var Redis=require(_0x1e0c('0xf'));var authService=require(_0x1e0c('0x10'));var qs=require(_0x1e0c('0x11'));var as=require(_0x1e0c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e0c('0x13'))(_0x1e0c('0x14'));var utils=require(_0x1e0c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1e0c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x138605,_0x39305e){_0x39305e=_0x39305e||0xcc;return function(_0x432542){if(_0x432542){return _0x138605[_0x1e0c('0x17')](_0x39305e);}return _0x138605[_0x1e0c('0x18')](_0x39305e)[_0x1e0c('0x19')]();};}function respondWithResult(_0x1aece1,_0x1c2616){_0x1c2616=_0x1c2616||0xc8;return function(_0x1fbc44){if(_0x1fbc44){return _0x1aece1[_0x1e0c('0x18')](_0x1c2616)['json'](_0x1fbc44);}};}function respondWithFilteredResult(_0x3970ae,_0x57ad85){return function(_0x2500d7){if(_0x2500d7){var _0xcf9c3b=typeof _0x57ad85[_0x1e0c('0x1a')]===_0x1e0c('0x1b')&&typeof _0x57ad85[_0x1e0c('0x1c')]===_0x1e0c('0x1b');var _0x35a9cc=_0x2500d7['count'];var _0x4315aa=_0xcf9c3b?0x0:_0x57ad85[_0x1e0c('0x1a')];var _0x122cd2=_0xcf9c3b?_0x2500d7[_0x1e0c('0x1d')]:_0x57ad85['offset']+_0x57ad85['limit'];var _0x596304;if(_0x122cd2>=_0x35a9cc){_0x122cd2=_0x35a9cc;_0x596304=0xc8;}else{_0x596304=0xce;}_0x3970ae[_0x1e0c('0x18')](_0x596304);return _0x3970ae[_0x1e0c('0x1e')](_0x1e0c('0x1f'),_0x4315aa+'-'+_0x122cd2+'/'+_0x35a9cc)[_0x1e0c('0x20')](_0x2500d7);}return null;};}function patchUpdates(_0x3f2a59){return function(_0x3a94f0){try{jsonpatch[_0x1e0c('0x21')](_0x3a94f0,_0x3f2a59,!![]);}catch(_0x3c955c){return BPromise['reject'](_0x3c955c);}return _0x3a94f0['save']();};}function saveUpdates(_0x3885d2,_0x38d8bd){return function(_0x3b1200){if(_0x3b1200){return _0x3b1200[_0x1e0c('0x22')](_0x3885d2)['then'](function(_0x4743e7){return _0x4743e7;});}return null;};}function removeEntity(_0x891c5e,_0x1edf97){return function(_0x1cf772){if(_0x1cf772){return _0x1cf772[_0x1e0c('0x23')]()[_0x1e0c('0x24')](function(){_0x891c5e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d7c49,_0x3867c6){return function(_0x4296b5){if(!_0x4296b5){_0x1d7c49[_0x1e0c('0x17')](0x194);}return _0x4296b5;};}function handleError(_0x5cec62,_0x3d4323){_0x3d4323=_0x3d4323||0x1f4;return function(_0x104bf4){logger[_0x1e0c('0x25')](_0x104bf4['stack']);if(_0x104bf4[_0x1e0c('0x26')]){delete _0x104bf4[_0x1e0c('0x26')];}_0x5cec62[_0x1e0c('0x18')](_0x3d4323)[_0x1e0c('0x27')](_0x104bf4);};}exports[_0x1e0c('0x28')]=function(_0x4e0cea,_0x6ffd65){var _0x582a18={},_0x1e49a9={},_0x4adfa7={'count':0x0,'rows':[]};var _0x105ca4=_[_0x1e0c('0x29')](db[_0x1e0c('0x2a')][_0x1e0c('0x2b')],function(_0x11cb84){return{'name':_0x11cb84['fieldName'],'type':_0x11cb84[_0x1e0c('0x2c')][_0x1e0c('0x2d')]};});_0x1e49a9['model']=_['map'](_0x105ca4,_0x1e0c('0x26'));_0x1e49a9['query']=_[_0x1e0c('0x2e')](_0x4e0cea[_0x1e0c('0x2f')]);_0x1e49a9[_0x1e0c('0x30')]=_[_0x1e0c('0x31')](_0x1e49a9[_0x1e0c('0x32')],_0x1e49a9[_0x1e0c('0x2f')]);_0x582a18[_0x1e0c('0x33')]=_[_0x1e0c('0x31')](_0x1e49a9[_0x1e0c('0x32')],qs[_0x1e0c('0x34')](_0x4e0cea['query'][_0x1e0c('0x34')]));_0x582a18['attributes']=_0x582a18[_0x1e0c('0x33')]['length']?_0x582a18[_0x1e0c('0x33')]:_0x1e49a9['model'];if(!_0x4e0cea[_0x1e0c('0x2f')][_0x1e0c('0x35')]('nolimit')){_0x582a18['limit']=qs['limit'](_0x4e0cea[_0x1e0c('0x2f')]['limit']);_0x582a18['offset']=qs[_0x1e0c('0x1a')](_0x4e0cea[_0x1e0c('0x2f')][_0x1e0c('0x1a')]);}_0x582a18[_0x1e0c('0x36')]=qs[_0x1e0c('0x37')](_0x4e0cea[_0x1e0c('0x2f')]['sort']);_0x582a18[_0x1e0c('0x38')]=qs[_0x1e0c('0x30')](_[_0x1e0c('0x39')](_0x4e0cea[_0x1e0c('0x2f')],_0x1e49a9[_0x1e0c('0x30')]),_0x105ca4);if(_0x4e0cea[_0x1e0c('0x2f')]['filter']){_0x582a18[_0x1e0c('0x38')]=_[_0x1e0c('0x3a')](_0x582a18[_0x1e0c('0x38')],{'$or':_[_0x1e0c('0x29')](_0x105ca4,function(_0x12bd17){if(_0x12bd17[_0x1e0c('0x2c')]!=='VIRTUAL'){var _0x12b779={};_0x12b779[_0x12bd17[_0x1e0c('0x26')]]={'$like':'%'+_0x4e0cea['query'][_0x1e0c('0x3b')]+'%'};return _0x12b779;}})});}_0x582a18=_[_0x1e0c('0x3a')]({},_0x582a18,_0x4e0cea['options']);var _0x5347d0={'where':_0x582a18[_0x1e0c('0x38')]};return db[_0x1e0c('0x2a')][_0x1e0c('0x1d')](_0x5347d0)[_0x1e0c('0x24')](function(_0x53b77c){_0x4adfa7['count']=_0x53b77c;if(_0x4e0cea[_0x1e0c('0x2f')]['includeAll']){_0x582a18[_0x1e0c('0x3c')]=[{'all':!![]}];}return db[_0x1e0c('0x2a')][_0x1e0c('0x3d')](_0x582a18);})['then'](function(_0x5760b6){_0x4adfa7[_0x1e0c('0x3e')]=_0x5760b6;return _0x4adfa7;})['then'](respondWithFilteredResult(_0x6ffd65,_0x582a18))[_0x1e0c('0x3f')](handleError(_0x6ffd65,null));};exports['show']=function(_0x2f72e1,_0x524c35){var _0x3ab785={'raw':!![],'where':{'id':_0x2f72e1[_0x1e0c('0x40')]['id']}},_0x52c87e={};_0x52c87e[_0x1e0c('0x32')]=_[_0x1e0c('0x2e')](db[_0x1e0c('0x2a')][_0x1e0c('0x2b')]);_0x52c87e[_0x1e0c('0x2f')]=_['keys'](_0x2f72e1['query']);_0x52c87e[_0x1e0c('0x30')]=_[_0x1e0c('0x31')](_0x52c87e[_0x1e0c('0x32')],_0x52c87e[_0x1e0c('0x2f')]);_0x3ab785[_0x1e0c('0x33')]=_[_0x1e0c('0x31')](_0x52c87e['model'],qs[_0x1e0c('0x34')](_0x2f72e1[_0x1e0c('0x2f')]['fields']));_0x3ab785['attributes']=_0x3ab785[_0x1e0c('0x33')][_0x1e0c('0x41')]?_0x3ab785[_0x1e0c('0x33')]:_0x52c87e[_0x1e0c('0x32')];if(_0x2f72e1[_0x1e0c('0x2f')][_0x1e0c('0x42')]){_0x3ab785[_0x1e0c('0x3c')]=[{'all':!![]}];}_0x3ab785=_[_0x1e0c('0x3a')]({},_0x3ab785,_0x2f72e1[_0x1e0c('0x43')]);return db[_0x1e0c('0x2a')][_0x1e0c('0x44')](_0x3ab785)[_0x1e0c('0x24')](handleEntityNotFound(_0x524c35,null))['then'](respondWithResult(_0x524c35,null))[_0x1e0c('0x3f')](handleError(_0x524c35,null));};exports['create']=function(_0x2e5dd5,_0x2d8de9){return db[_0x1e0c('0x2a')][_0x1e0c('0x45')](_0x2e5dd5[_0x1e0c('0x46')],{})[_0x1e0c('0x24')](respondWithResult(_0x2d8de9,0xc9))[_0x1e0c('0x3f')](handleError(_0x2d8de9,null));};exports[_0x1e0c('0x22')]=function(_0x4cc6e7,_0x5d3178){if(_0x4cc6e7[_0x1e0c('0x46')]['id']){delete _0x4cc6e7[_0x1e0c('0x46')]['id'];}return db[_0x1e0c('0x2a')]['find']({'where':{'id':_0x4cc6e7[_0x1e0c('0x40')]['id']}})[_0x1e0c('0x24')](handleEntityNotFound(_0x5d3178,null))[_0x1e0c('0x24')](saveUpdates(_0x4cc6e7['body'],null))['then'](respondWithResult(_0x5d3178,null))[_0x1e0c('0x3f')](handleError(_0x5d3178,null));};exports[_0x1e0c('0x23')]=function(_0x5be24a,_0x36fc9b){return db[_0x1e0c('0x2a')][_0x1e0c('0x44')]({'where':{'id':_0x5be24a['params']['id']}})[_0x1e0c('0x24')](handleEntityNotFound(_0x36fc9b,null))['then'](removeEntity(_0x36fc9b,null))[_0x1e0c('0x3f')](handleError(_0x36fc9b,null));};exports[_0x1e0c('0x47')]=function(_0x252609,_0x26e276){return db[_0x1e0c('0x2a')][_0x1e0c('0x47')]()[_0x1e0c('0x24')](respondWithResult(_0x26e276,null))[_0x1e0c('0x3f')](handleError(_0x26e276,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 873fb53..f8e3547 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x27ea7b,_0x3b8d27){var _0x11fc0d=function(_0x2a87d3){while(--_0x2a87d3){_0x27ea7b['push'](_0x27ea7b['shift']());}};_0x11fc0d(++_0x3b8d27);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'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':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'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(_0x533bf7,_0x29485b){var _0x9e4c57=function(_0xe4211f){while(--_0xe4211f){_0x533bf7['push'](_0x533bf7['shift']());}};_0x9e4c57(++_0x29485b);}(_0xb10b,0x12a));var _0xbb10=function(_0x4dc7f5,_0x312c14){_0x4dc7f5=_0x4dc7f5-0x0;var _0x3e37db=_0xb10b[_0x4dc7f5];return _0x3e37db;};'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 0ac6dbd..6ff7d2d 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 _0x28ed=['body','options','raw','stringify','UpdateChatQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x28ed,0x1c2));var _0xd28e=function(_0x1e4827,_0x2e9087){_0x1e4827=_0x1e4827-0x0;var _0xd9b038=_0x28ed[_0x1e4827];return _0xd9b038;};'use strict';var _=require(_0xd28e('0x0'));var util=require(_0xd28e('0x1'));var moment=require(_0xd28e('0x2'));var BPromise=require(_0xd28e('0x3'));var rs=require(_0xd28e('0x4'));var fs=require('fs');var Redis=require(_0xd28e('0x5'));var db=require(_0xd28e('0x6'))['db'];var utils=require(_0xd28e('0x7'));var logger=require(_0xd28e('0x8'))('rpc');var config=require(_0xd28e('0x9'));var jayson=require(_0xd28e('0xa'));var client=jayson[_0xd28e('0xb')][_0xd28e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x505e54,_0xcf04c2,_0x5c0af4){return new BPromise(function(_0x28577c,_0x2da116){return client['request'](_0x505e54,_0x5c0af4)[_0xd28e('0xd')](function(_0x265ca5){logger[_0xd28e('0xe')](_0xd28e('0xf'),_0xcf04c2,_0xd28e('0x10'));logger[_0xd28e('0x11')](_0xd28e('0x12'),_0xcf04c2,_0xd28e('0x10'),JSON['stringify'](_0x265ca5));if(_0x265ca5[_0xd28e('0x13')]){if(_0x265ca5['error'][_0xd28e('0x14')]===0x1f4){logger[_0xd28e('0x13')](_0xd28e('0xf'),_0xcf04c2,_0x265ca5[_0xd28e('0x13')]['message']);return _0x2da116(_0x265ca5[_0xd28e('0x13')][_0xd28e('0x15')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0xcf04c2,_0x265ca5['error'][_0xd28e('0x15')]);return _0x28577c(_0x265ca5[_0xd28e('0x13')][_0xd28e('0x15')]);}else{logger['info'](_0xd28e('0xf'),_0xcf04c2,_0xd28e('0x10'));_0x28577c(_0x265ca5[_0xd28e('0x16')]['message']);}})[_0xd28e('0x17')](function(_0x3933ce){logger[_0xd28e('0x13')](_0xd28e('0xf'),_0xcf04c2,_0x3933ce);_0x2da116(_0x3933ce);});});}exports[_0xd28e('0x18')]=function(_0x2e1f5b){var _0x3af875=this;return new Promise(function(_0x4dae56,_0x486845){return db[_0xd28e('0x19')]['create'](_0x2e1f5b[_0xd28e('0x1a')],{'raw':_0x2e1f5b[_0xd28e('0x1b')]?_0x2e1f5b[_0xd28e('0x1b')][_0xd28e('0x1c')]===undefined?!![]:![]:!![]})[_0xd28e('0xd')](function(_0x406516){logger[_0xd28e('0xe')](_0xd28e('0x18'),_0x2e1f5b);logger[_0xd28e('0x11')](_0xd28e('0x18'),_0x2e1f5b,JSON[_0xd28e('0x1d')](_0x406516));_0x4dae56(_0x406516);})[_0xd28e('0x17')](function(_0x2df551){logger['error'](_0xd28e('0x18'),_0x2df551[_0xd28e('0x15')],_0x2e1f5b);_0x486845(_0x3af875[_0xd28e('0x13')](0x1f4,_0x2df551[_0xd28e('0x15')]));});});};exports[_0xd28e('0x1e')]=function(_0x1fc505){var _0x5d16e9=this;return new Promise(function(_0x4bbaa1,_0x159bf1){return db[_0xd28e('0x19')][_0xd28e('0x1f')](_0x1fc505[_0xd28e('0x1a')],{'raw':_0x1fc505['options']?_0x1fc505[_0xd28e('0x1b')][_0xd28e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fc505[_0xd28e('0x1b')]?_0x1fc505[_0xd28e('0x1b')]['where']||null:null,'attributes':_0x1fc505['options']?_0x1fc505[_0xd28e('0x1b')][_0xd28e('0x20')]||null:null,'limit':_0x1fc505[_0xd28e('0x1b')]?_0x1fc505[_0xd28e('0x1b')][_0xd28e('0x21')]||null:null})['then'](function(_0x20aa61){logger[_0xd28e('0xe')](_0xd28e('0x1e'),_0x1fc505);logger[_0xd28e('0x11')]('UpdateChatQueueReport',_0x1fc505,JSON['stringify'](_0x20aa61));_0x4bbaa1(_0x20aa61);})[_0xd28e('0x17')](function(_0xa3d23f){logger[_0xd28e('0x13')](_0xd28e('0x1e'),_0xa3d23f[_0xd28e('0x15')],_0x1fc505);_0x159bf1(_0x5d16e9[_0xd28e('0x13')](0x1f4,_0xa3d23f[_0xd28e('0x15')]));});});}; \ No newline at end of file +var _0x25b7=['attributes','limit','UpdateChatQueueReport','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','body','where'];(function(_0x2dfe17,_0x384bf5){var _0x10c656=function(_0x1626b1){while(--_0x1626b1){_0x2dfe17['push'](_0x2dfe17['shift']());}};_0x10c656(++_0x384bf5);}(_0x25b7,0x1d4));var _0x725b=function(_0x204d97,_0x51d215){_0x204d97=_0x204d97-0x0;var _0x2c8a87=_0x25b7[_0x204d97];return _0x2c8a87;};'use strict';var _=require(_0x725b('0x0'));var util=require('util');var moment=require(_0x725b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x725b('0x2'));var db=require(_0x725b('0x3'))['db'];var utils=require(_0x725b('0x4'));var logger=require(_0x725b('0x5'))(_0x725b('0x6'));var config=require(_0x725b('0x7'));var jayson=require(_0x725b('0x8'));var client=jayson[_0x725b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2997d2,_0xcd7a40,_0x1dffa2){return new BPromise(function(_0x19280e,_0x408c2b){return client[_0x725b('0xa')](_0x2997d2,_0x1dffa2)[_0x725b('0xb')](function(_0x2e7466){logger[_0x725b('0xc')](_0x725b('0xd'),_0xcd7a40,_0x725b('0xe'));logger[_0x725b('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0xcd7a40,_0x725b('0xe'),JSON[_0x725b('0x10')](_0x2e7466));if(_0x2e7466[_0x725b('0x11')]){if(_0x2e7466[_0x725b('0x11')][_0x725b('0x12')]===0x1f4){logger[_0x725b('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0xcd7a40,_0x2e7466[_0x725b('0x11')][_0x725b('0x13')]);return _0x408c2b(_0x2e7466['error']['message']);}logger[_0x725b('0x11')](_0x725b('0xd'),_0xcd7a40,_0x2e7466['error'][_0x725b('0x13')]);return _0x19280e(_0x2e7466[_0x725b('0x11')][_0x725b('0x13')]);}else{logger[_0x725b('0xc')](_0x725b('0xd'),_0xcd7a40,'request\x20sent');_0x19280e(_0x2e7466['result'][_0x725b('0x13')]);}})[_0x725b('0x14')](function(_0x3bd867){logger[_0x725b('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0xcd7a40,_0x3bd867);_0x408c2b(_0x3bd867);});});}exports[_0x725b('0x15')]=function(_0x194a02){var _0x41794c=this;return new Promise(function(_0x415346,_0x474aaa){return db[_0x725b('0x16')][_0x725b('0x17')](_0x194a02['body'],{'raw':_0x194a02[_0x725b('0x18')]?_0x194a02[_0x725b('0x18')][_0x725b('0x19')]===undefined?!![]:![]:!![]})[_0x725b('0xb')](function(_0x110ebf){logger[_0x725b('0xc')](_0x725b('0x15'),_0x194a02);logger[_0x725b('0xf')]('CreateChatQueueReport',_0x194a02,JSON[_0x725b('0x10')](_0x110ebf));_0x415346(_0x110ebf);})[_0x725b('0x14')](function(_0x34cbfd){logger['error']('CreateChatQueueReport',_0x34cbfd[_0x725b('0x13')],_0x194a02);_0x474aaa(_0x41794c[_0x725b('0x11')](0x1f4,_0x34cbfd[_0x725b('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x1ac09a){var _0x20ac93=this;return new Promise(function(_0xbbfac1,_0x227191){return db[_0x725b('0x16')]['update'](_0x1ac09a[_0x725b('0x1a')],{'raw':_0x1ac09a[_0x725b('0x18')]?_0x1ac09a[_0x725b('0x18')][_0x725b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ac09a['options']?_0x1ac09a[_0x725b('0x18')][_0x725b('0x1b')]||null:null,'attributes':_0x1ac09a['options']?_0x1ac09a['options'][_0x725b('0x1c')]||null:null,'limit':_0x1ac09a[_0x725b('0x18')]?_0x1ac09a['options'][_0x725b('0x1d')]||null:null})['then'](function(_0x2e73ee){logger[_0x725b('0xc')]('UpdateChatQueueReport',_0x1ac09a);logger['debug'](_0x725b('0x1e'),_0x1ac09a,JSON[_0x725b('0x10')](_0x2e73ee));_0xbbfac1(_0x2e73ee);})[_0x725b('0x14')](function(_0x42f071){logger[_0x725b('0x11')](_0x725b('0x1e'),_0x42f071[_0x725b('0x13')],_0x1ac09a);_0x227191(_0x20ac93[_0x725b('0x11')](0x1f4,_0x42f071[_0x725b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 4c8472d..733cba9 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 _0xd53c=['fs-extra','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xd53c,0x87));var _0xcd53=function(_0x4b5a2b,_0x22e187){_0x4b5a2b=_0x4b5a2b-0x0;var _0x3b2a84=_0xd53c[_0x4b5a2b];return _0x3b2a84;};'use strict';var multer=require(_0xcd53('0x0'));var util=require(_0xcd53('0x1'));var path=require(_0xcd53('0x2'));var timeout=require(_0xcd53('0x3'));var express=require(_0xcd53('0x4'));var router=express['Router']();var fs_extra=require(_0xcd53('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcd53('0x6'));var controller=require(_0xcd53('0x7'));router[_0xcd53('0x8')]('/',auth['isAuthenticated'](),controller[_0xcd53('0x9')]);router[_0xcd53('0x8')](_0xcd53('0xa'),auth[_0xcd53('0xb')](),controller[_0xcd53('0xc')]);router['get'](_0xcd53('0xd'),auth[_0xcd53('0xb')](),controller[_0xcd53('0xe')]);router[_0xcd53('0xf')]('/',auth[_0xcd53('0xb')](),controller['create']);router[_0xcd53('0x10')](_0xcd53('0xd'),auth[_0xcd53('0xb')](),controller[_0xcd53('0x11')]);router[_0xcd53('0x12')](_0xcd53('0xd'),auth['isAuthenticated'](),controller[_0xcd53('0x13')]);module['exports']=router; \ No newline at end of file +var _0x759b=['isAuthenticated','index','/describe','describe','/:id','show','put','update','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get'];(function(_0x459b74,_0x5773bd){var _0x46cb16=function(_0x97867f){while(--_0x97867f){_0x459b74['push'](_0x459b74['shift']());}};_0x46cb16(++_0x5773bd);}(_0x759b,0x108));var _0xb759=function(_0x54bb5e,_0xc9513a){_0x54bb5e=_0x54bb5e-0x0;var _0x2cfe75=_0x759b[_0x54bb5e];return _0x2cfe75;};'use strict';var multer=require('multer');var util=require(_0xb759('0x0'));var path=require(_0xb759('0x1'));var timeout=require('connect-timeout');var express=require(_0xb759('0x2'));var router=express['Router']();var fs_extra=require(_0xb759('0x3'));var auth=require(_0xb759('0x4'));var interaction=require(_0xb759('0x5'));var config=require('../../config/environment');var controller=require(_0xb759('0x6'));router[_0xb759('0x7')]('/',auth[_0xb759('0x8')](),controller[_0xb759('0x9')]);router[_0xb759('0x7')](_0xb759('0xa'),auth[_0xb759('0x8')](),controller[_0xb759('0xb')]);router[_0xb759('0x7')](_0xb759('0xc'),auth[_0xb759('0x8')](),controller[_0xb759('0xd')]);router['post']('/',auth[_0xb759('0x8')](),controller['create']);router[_0xb759('0xe')](_0xb759('0xc'),auth['isAuthenticated'](),controller[_0xb759('0xf')]);router['delete']('/:id',auth[_0xb759('0x8')](),controller['destroy']);module[_0xb759('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 3eaf1c9..62f8b55 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x30c6fb,_0x2b15bd){var _0x5d0b3e=function(_0x2828be){while(--_0x2828be){_0x30c6fb['push'](_0x30c6fb['shift']());}};_0x5d0b3e(++_0x2b15bd);}(_0xaa88,0x137));var _0x8aa8=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0xaa88[_0x291f8b];return _0x275171;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x598868,_0x1454a4){var _0x1ec1d8=function(_0x47d771){while(--_0x47d771){_0x598868['push'](_0x598868['shift']());}};_0x1ec1d8(++_0x1454a4);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3b16e1,_0x3bda3e){_0x3b16e1=_0x3b16e1-0x0;var _0x311d1b=_0xf3cd[_0x3b16e1];return _0x311d1b;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index cbfeb82..ea66e09 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 _0xa1fc=['fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','find','create','body','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','name','send','index','map','ChatTransferReport','rawAttributes'];(function(_0x2d7d58,_0x236b0b){var _0x2aefbc=function(_0x3ca326){while(--_0x3ca326){_0x2d7d58['push'](_0x2d7d58['shift']());}};_0x2aefbc(++_0x236b0b);}(_0xa1fc,0x140));var _0xca1f=function(_0x2bf999,_0x4645b1){_0x2bf999=_0x2bf999-0x0;var _0x4cf8f8=_0xa1fc[_0x2bf999];return _0x4cf8f8;};'use strict';var emlformat=require(_0xca1f('0x0'));var rimraf=require(_0xca1f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xca1f('0x2'));var moment=require('moment');var BPromise=require(_0xca1f('0x3'));var Mustache=require(_0xca1f('0x4'));var util=require(_0xca1f('0x5'));var path=require('path');var sox=require(_0xca1f('0x6'));var csv=require(_0xca1f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca1f('0x8'));var _=require(_0xca1f('0x9'));var squel=require('squel');var crypto=require(_0xca1f('0xa'));var jsforce=require(_0xca1f('0xb'));var deskjs=require(_0xca1f('0xc'));var toCsv=require(_0xca1f('0x7'));var querystring=require(_0xca1f('0xd'));var Papa=require(_0xca1f('0xe'));var Redis=require(_0xca1f('0xf'));var authService=require(_0xca1f('0x10'));var qs=require(_0xca1f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca1f('0x12'));var logger=require(_0xca1f('0x13'))(_0xca1f('0x14'));var utils=require(_0xca1f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xca1f('0x16'));var db=require(_0xca1f('0x17'))['db'];function respondWithStatusCode(_0x318e1f,_0x52be92){_0x52be92=_0x52be92||0xcc;return function(_0x21ca87){if(_0x21ca87){return _0x318e1f[_0xca1f('0x18')](_0x52be92);}return _0x318e1f['status'](_0x52be92)[_0xca1f('0x19')]();};}function respondWithResult(_0x568947,_0x2dcba2){_0x2dcba2=_0x2dcba2||0xc8;return function(_0x551bcd){if(_0x551bcd){return _0x568947[_0xca1f('0x1a')](_0x2dcba2)[_0xca1f('0x1b')](_0x551bcd);}};}function respondWithFilteredResult(_0x33e83b,_0x12c407){return function(_0xfe25d9){if(_0xfe25d9){var _0x64dc18=typeof _0x12c407[_0xca1f('0x1c')]==='undefined'&&typeof _0x12c407[_0xca1f('0x1d')]===_0xca1f('0x1e');var _0x1c7f29=_0xfe25d9[_0xca1f('0x1f')];var _0x3b93a3=_0x64dc18?0x0:_0x12c407[_0xca1f('0x1c')];var _0x30f021=_0x64dc18?_0xfe25d9[_0xca1f('0x1f')]:_0x12c407[_0xca1f('0x1c')]+_0x12c407[_0xca1f('0x1d')];var _0x14b13a;if(_0x30f021>=_0x1c7f29){_0x30f021=_0x1c7f29;_0x14b13a=0xc8;}else{_0x14b13a=0xce;}_0x33e83b['status'](_0x14b13a);return _0x33e83b[_0xca1f('0x20')](_0xca1f('0x21'),_0x3b93a3+'-'+_0x30f021+'/'+_0x1c7f29)[_0xca1f('0x1b')](_0xfe25d9);}return null;};}function patchUpdates(_0x13a76d){return function(_0x2bc477){try{jsonpatch['apply'](_0x2bc477,_0x13a76d,!![]);}catch(_0x379a38){return BPromise[_0xca1f('0x22')](_0x379a38);}return _0x2bc477[_0xca1f('0x23')]();};}function saveUpdates(_0x2d8213,_0x1ce9af){return function(_0x77665d){if(_0x77665d){return _0x77665d[_0xca1f('0x24')](_0x2d8213)[_0xca1f('0x25')](function(_0x785795){return _0x785795;});}return null;};}function removeEntity(_0x459d08,_0x5a1cd2){return function(_0x564d7b){if(_0x564d7b){return _0x564d7b[_0xca1f('0x26')]()[_0xca1f('0x25')](function(){_0x459d08[_0xca1f('0x1a')](0xcc)[_0xca1f('0x19')]();});}};}function handleEntityNotFound(_0x58bdce,_0x5d0693){return function(_0x2b4d35){if(!_0x2b4d35){_0x58bdce[_0xca1f('0x18')](0x194);}return _0x2b4d35;};}function handleError(_0x4db54c,_0x23c74a){_0x23c74a=_0x23c74a||0x1f4;return function(_0x378f64){logger['error'](_0x378f64['stack']);if(_0x378f64[_0xca1f('0x27')]){delete _0x378f64[_0xca1f('0x27')];}_0x4db54c[_0xca1f('0x1a')](_0x23c74a)[_0xca1f('0x28')](_0x378f64);};}exports[_0xca1f('0x29')]=function(_0x52fbb2,_0x3d07de){var _0x1fd472={},_0x3f9f72={},_0x36de85={'count':0x0,'rows':[]};var _0x1fa97b=_[_0xca1f('0x2a')](db[_0xca1f('0x2b')][_0xca1f('0x2c')],function(_0x557876){return{'name':_0x557876[_0xca1f('0x2d')],'type':_0x557876[_0xca1f('0x2e')][_0xca1f('0x2f')]};});_0x3f9f72[_0xca1f('0x30')]=_['map'](_0x1fa97b,_0xca1f('0x27'));_0x3f9f72[_0xca1f('0x31')]=_[_0xca1f('0x32')](_0x52fbb2['query']);_0x3f9f72['filters']=_[_0xca1f('0x33')](_0x3f9f72['model'],_0x3f9f72[_0xca1f('0x31')]);_0x1fd472[_0xca1f('0x34')]=_[_0xca1f('0x33')](_0x3f9f72[_0xca1f('0x30')],qs['fields'](_0x52fbb2[_0xca1f('0x31')][_0xca1f('0x35')]));_0x1fd472[_0xca1f('0x34')]=_0x1fd472[_0xca1f('0x34')][_0xca1f('0x36')]?_0x1fd472['attributes']:_0x3f9f72['model'];if(!_0x52fbb2['query'][_0xca1f('0x37')](_0xca1f('0x38'))){_0x1fd472[_0xca1f('0x1d')]=qs[_0xca1f('0x1d')](_0x52fbb2['query'][_0xca1f('0x1d')]);_0x1fd472[_0xca1f('0x1c')]=qs[_0xca1f('0x1c')](_0x52fbb2[_0xca1f('0x31')][_0xca1f('0x1c')]);}_0x1fd472[_0xca1f('0x39')]=qs['sort'](_0x52fbb2['query']['sort']);_0x1fd472[_0xca1f('0x3a')]=qs['filters'](_['pick'](_0x52fbb2[_0xca1f('0x31')],_0x3f9f72[_0xca1f('0x3b')]),_0x1fa97b);if(_0x52fbb2[_0xca1f('0x31')][_0xca1f('0x3c')]){_0x1fd472[_0xca1f('0x3a')]=_['merge'](_0x1fd472['where'],{'$or':_[_0xca1f('0x2a')](_0x1fa97b,function(_0x65a102){if(_0x65a102['type']!==_0xca1f('0x3d')){var _0x4666ca={};_0x4666ca[_0x65a102[_0xca1f('0x27')]]={'$like':'%'+_0x52fbb2[_0xca1f('0x31')][_0xca1f('0x3c')]+'%'};return _0x4666ca;}})});}_0x1fd472=_[_0xca1f('0x3e')]({},_0x1fd472,_0x52fbb2[_0xca1f('0x3f')]);var _0x249099={'where':_0x1fd472[_0xca1f('0x3a')]};return db['ChatTransferReport'][_0xca1f('0x1f')](_0x249099)[_0xca1f('0x25')](function(_0x219aea){_0x36de85[_0xca1f('0x1f')]=_0x219aea;if(_0x52fbb2[_0xca1f('0x31')][_0xca1f('0x40')]){_0x1fd472[_0xca1f('0x41')]=[{'all':!![]}];}return db[_0xca1f('0x2b')][_0xca1f('0x42')](_0x1fd472);})[_0xca1f('0x25')](function(_0x3ceab2){_0x36de85[_0xca1f('0x43')]=_0x3ceab2;return _0x36de85;})[_0xca1f('0x25')](respondWithFilteredResult(_0x3d07de,_0x1fd472))[_0xca1f('0x44')](handleError(_0x3d07de,null));};exports['show']=function(_0x3b6d02,_0x495f69){var _0x2da7ec={'raw':!![],'where':{'id':_0x3b6d02['params']['id']}},_0x28a874={};_0x28a874['model']=_[_0xca1f('0x32')](db[_0xca1f('0x2b')][_0xca1f('0x2c')]);_0x28a874[_0xca1f('0x31')]=_[_0xca1f('0x32')](_0x3b6d02[_0xca1f('0x31')]);_0x28a874[_0xca1f('0x3b')]=_[_0xca1f('0x33')](_0x28a874[_0xca1f('0x30')],_0x28a874[_0xca1f('0x31')]);_0x2da7ec[_0xca1f('0x34')]=_['intersection'](_0x28a874[_0xca1f('0x30')],qs[_0xca1f('0x35')](_0x3b6d02[_0xca1f('0x31')][_0xca1f('0x35')]));_0x2da7ec[_0xca1f('0x34')]=_0x2da7ec['attributes'][_0xca1f('0x36')]?_0x2da7ec[_0xca1f('0x34')]:_0x28a874[_0xca1f('0x30')];if(_0x3b6d02[_0xca1f('0x31')][_0xca1f('0x40')]){_0x2da7ec['include']=[{'all':!![]}];}_0x2da7ec=_[_0xca1f('0x3e')]({},_0x2da7ec,_0x3b6d02['options']);return db['ChatTransferReport'][_0xca1f('0x45')](_0x2da7ec)[_0xca1f('0x25')](handleEntityNotFound(_0x495f69,null))[_0xca1f('0x25')](respondWithResult(_0x495f69,null))[_0xca1f('0x44')](handleError(_0x495f69,null));};exports['create']=function(_0x563cd6,_0x5480e7){return db[_0xca1f('0x2b')][_0xca1f('0x46')](_0x563cd6[_0xca1f('0x47')],{})[_0xca1f('0x25')](respondWithResult(_0x5480e7,0xc9))[_0xca1f('0x44')](handleError(_0x5480e7,null));};exports[_0xca1f('0x24')]=function(_0x2a602f,_0x559ea0){if(_0x2a602f[_0xca1f('0x47')]['id']){delete _0x2a602f[_0xca1f('0x47')]['id'];}return db[_0xca1f('0x2b')][_0xca1f('0x45')]({'where':{'id':_0x2a602f['params']['id']}})[_0xca1f('0x25')](handleEntityNotFound(_0x559ea0,null))['then'](saveUpdates(_0x2a602f['body'],null))[_0xca1f('0x25')](respondWithResult(_0x559ea0,null))[_0xca1f('0x44')](handleError(_0x559ea0,null));};exports[_0xca1f('0x26')]=function(_0x42502d,_0x56ef95){return db['ChatTransferReport'][_0xca1f('0x45')]({'where':{'id':_0x42502d['params']['id']}})[_0xca1f('0x25')](handleEntityNotFound(_0x56ef95,null))[_0xca1f('0x25')](removeEntity(_0x56ef95,null))[_0xca1f('0x44')](handleError(_0x56ef95,null));};exports[_0xca1f('0x48')]=function(_0x2fa114,_0x115daf){return db['ChatTransferReport'][_0xca1f('0x48')]()[_0xca1f('0x25')](respondWithResult(_0x115daf,null))[_0xca1f('0x44')](handleError(_0x115daf,null));}; \ No newline at end of file +var _0x813e=['ChatTransferReport','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','includeAll','include','rows','show','rawAttributes','options','find','catch','create','body','destroy','params','describe','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','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','end','status','json','undefined','limit','count','offset','set','apply','save','update','then','error','stack','name','send','index'];(function(_0x4be863,_0xc4e4b4){var _0x11a70e=function(_0x26b4b4){while(--_0x26b4b4){_0x4be863['push'](_0x4be863['shift']());}};_0x11a70e(++_0xc4e4b4);}(_0x813e,0xb3));var _0xe813=function(_0x45964b,_0xe849e5){_0x45964b=_0x45964b-0x0;var _0x4dc863=_0x813e[_0x45964b];return _0x4dc863;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe813('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe813('0x1'));var Mustache=require(_0xe813('0x2'));var util=require(_0xe813('0x3'));var path=require(_0xe813('0x4'));var sox=require(_0xe813('0x5'));var csv=require(_0xe813('0x6'));var ejs=require(_0xe813('0x7'));var fs=require('fs');var fs_extra=require(_0xe813('0x8'));var _=require('lodash');var squel=require(_0xe813('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe813('0xa'));var toCsv=require(_0xe813('0x6'));var querystring=require(_0xe813('0xb'));var Papa=require(_0xe813('0xc'));var Redis=require(_0xe813('0xd'));var authService=require(_0xe813('0xe'));var qs=require(_0xe813('0xf'));var as=require(_0xe813('0x10'));var hardwareService=require(_0xe813('0x11'));var logger=require(_0xe813('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xe813('0x13'));var licenseUtil=require(_0xe813('0x14'));var db=require(_0xe813('0x15'))['db'];function respondWithStatusCode(_0x4ed318,_0x4a1bdd){_0x4a1bdd=_0x4a1bdd||0xcc;return function(_0x36008b){if(_0x36008b){return _0x4ed318[_0xe813('0x16')](_0x4a1bdd);}return _0x4ed318['status'](_0x4a1bdd)[_0xe813('0x17')]();};}function respondWithResult(_0x4ed62d,_0xbd511c){_0xbd511c=_0xbd511c||0xc8;return function(_0x471ab1){if(_0x471ab1){return _0x4ed62d[_0xe813('0x18')](_0xbd511c)[_0xe813('0x19')](_0x471ab1);}};}function respondWithFilteredResult(_0x10cc07,_0x4ff5ad){return function(_0x26928f){if(_0x26928f){var _0x2e3930=typeof _0x4ff5ad['offset']===_0xe813('0x1a')&&typeof _0x4ff5ad[_0xe813('0x1b')]==='undefined';var _0x2d120b=_0x26928f[_0xe813('0x1c')];var _0x24ca48=_0x2e3930?0x0:_0x4ff5ad[_0xe813('0x1d')];var _0x6756bb=_0x2e3930?_0x26928f[_0xe813('0x1c')]:_0x4ff5ad[_0xe813('0x1d')]+_0x4ff5ad[_0xe813('0x1b')];var _0x1e6560;if(_0x6756bb>=_0x2d120b){_0x6756bb=_0x2d120b;_0x1e6560=0xc8;}else{_0x1e6560=0xce;}_0x10cc07['status'](_0x1e6560);return _0x10cc07[_0xe813('0x1e')]('Content-Range',_0x24ca48+'-'+_0x6756bb+'/'+_0x2d120b)[_0xe813('0x19')](_0x26928f);}return null;};}function patchUpdates(_0x4188ea){return function(_0x376d95){try{jsonpatch[_0xe813('0x1f')](_0x376d95,_0x4188ea,!![]);}catch(_0x2de41e){return BPromise['reject'](_0x2de41e);}return _0x376d95[_0xe813('0x20')]();};}function saveUpdates(_0x114d7f,_0x417139){return function(_0x257464){if(_0x257464){return _0x257464[_0xe813('0x21')](_0x114d7f)[_0xe813('0x22')](function(_0x41427c){return _0x41427c;});}return null;};}function removeEntity(_0x116bba,_0x4c2701){return function(_0x29157d){if(_0x29157d){return _0x29157d['destroy']()[_0xe813('0x22')](function(){_0x116bba[_0xe813('0x18')](0xcc)[_0xe813('0x17')]();});}};}function handleEntityNotFound(_0x1a5f7d,_0x1f0a68){return function(_0x4987ea){if(!_0x4987ea){_0x1a5f7d['sendStatus'](0x194);}return _0x4987ea;};}function handleError(_0x78c887,_0x1f868){_0x1f868=_0x1f868||0x1f4;return function(_0x2ca697){logger[_0xe813('0x23')](_0x2ca697[_0xe813('0x24')]);if(_0x2ca697[_0xe813('0x25')]){delete _0x2ca697[_0xe813('0x25')];}_0x78c887['status'](_0x1f868)[_0xe813('0x26')](_0x2ca697);};}exports[_0xe813('0x27')]=function(_0x10bda3,_0x179e16){var _0x17b551={},_0x45da58={},_0x2c9f3f={'count':0x0,'rows':[]};var _0x2a5c6a=_['map'](db[_0xe813('0x28')]['rawAttributes'],function(_0x4b6ae8){return{'name':_0x4b6ae8[_0xe813('0x29')],'type':_0x4b6ae8['type'][_0xe813('0x2a')]};});_0x45da58[_0xe813('0x2b')]=_[_0xe813('0x2c')](_0x2a5c6a,'name');_0x45da58[_0xe813('0x2d')]=_[_0xe813('0x2e')](_0x10bda3[_0xe813('0x2d')]);_0x45da58[_0xe813('0x2f')]=_[_0xe813('0x30')](_0x45da58[_0xe813('0x2b')],_0x45da58[_0xe813('0x2d')]);_0x17b551[_0xe813('0x31')]=_[_0xe813('0x30')](_0x45da58[_0xe813('0x2b')],qs[_0xe813('0x32')](_0x10bda3[_0xe813('0x2d')][_0xe813('0x32')]));_0x17b551[_0xe813('0x31')]=_0x17b551[_0xe813('0x31')][_0xe813('0x33')]?_0x17b551[_0xe813('0x31')]:_0x45da58[_0xe813('0x2b')];if(!_0x10bda3[_0xe813('0x2d')][_0xe813('0x34')]('nolimit')){_0x17b551[_0xe813('0x1b')]=qs[_0xe813('0x1b')](_0x10bda3[_0xe813('0x2d')][_0xe813('0x1b')]);_0x17b551['offset']=qs['offset'](_0x10bda3[_0xe813('0x2d')][_0xe813('0x1d')]);}_0x17b551[_0xe813('0x35')]=qs[_0xe813('0x36')](_0x10bda3[_0xe813('0x2d')][_0xe813('0x36')]);_0x17b551[_0xe813('0x37')]=qs[_0xe813('0x2f')](_[_0xe813('0x38')](_0x10bda3[_0xe813('0x2d')],_0x45da58[_0xe813('0x2f')]),_0x2a5c6a);if(_0x10bda3[_0xe813('0x2d')]['filter']){_0x17b551[_0xe813('0x37')]=_[_0xe813('0x39')](_0x17b551[_0xe813('0x37')],{'$or':_[_0xe813('0x2c')](_0x2a5c6a,function(_0x507b6f){if(_0x507b6f[_0xe813('0x3a')]!==_0xe813('0x3b')){var _0x396fdc={};_0x396fdc[_0x507b6f['name']]={'$like':'%'+_0x10bda3[_0xe813('0x2d')]['filter']+'%'};return _0x396fdc;}})});}_0x17b551=_[_0xe813('0x39')]({},_0x17b551,_0x10bda3['options']);var _0x1bb450={'where':_0x17b551[_0xe813('0x37')]};return db[_0xe813('0x28')]['count'](_0x1bb450)[_0xe813('0x22')](function(_0x3be0c3){_0x2c9f3f[_0xe813('0x1c')]=_0x3be0c3;if(_0x10bda3[_0xe813('0x2d')][_0xe813('0x3c')]){_0x17b551[_0xe813('0x3d')]=[{'all':!![]}];}return db[_0xe813('0x28')]['findAll'](_0x17b551);})[_0xe813('0x22')](function(_0x52cda4){_0x2c9f3f[_0xe813('0x3e')]=_0x52cda4;return _0x2c9f3f;})[_0xe813('0x22')](respondWithFilteredResult(_0x179e16,_0x17b551))['catch'](handleError(_0x179e16,null));};exports[_0xe813('0x3f')]=function(_0x256e58,_0x5873a3){var _0x58d516={'raw':!![],'where':{'id':_0x256e58['params']['id']}},_0x14b4c7={};_0x14b4c7[_0xe813('0x2b')]=_[_0xe813('0x2e')](db['ChatTransferReport'][_0xe813('0x40')]);_0x14b4c7['query']=_['keys'](_0x256e58[_0xe813('0x2d')]);_0x14b4c7[_0xe813('0x2f')]=_[_0xe813('0x30')](_0x14b4c7['model'],_0x14b4c7['query']);_0x58d516[_0xe813('0x31')]=_[_0xe813('0x30')](_0x14b4c7[_0xe813('0x2b')],qs[_0xe813('0x32')](_0x256e58[_0xe813('0x2d')][_0xe813('0x32')]));_0x58d516['attributes']=_0x58d516[_0xe813('0x31')][_0xe813('0x33')]?_0x58d516[_0xe813('0x31')]:_0x14b4c7[_0xe813('0x2b')];if(_0x256e58[_0xe813('0x2d')][_0xe813('0x3c')]){_0x58d516['include']=[{'all':!![]}];}_0x58d516=_[_0xe813('0x39')]({},_0x58d516,_0x256e58[_0xe813('0x41')]);return db['ChatTransferReport'][_0xe813('0x42')](_0x58d516)['then'](handleEntityNotFound(_0x5873a3,null))['then'](respondWithResult(_0x5873a3,null))[_0xe813('0x43')](handleError(_0x5873a3,null));};exports['create']=function(_0x7baceb,_0x37062c){return db[_0xe813('0x28')][_0xe813('0x44')](_0x7baceb[_0xe813('0x45')],{})[_0xe813('0x22')](respondWithResult(_0x37062c,0xc9))[_0xe813('0x43')](handleError(_0x37062c,null));};exports[_0xe813('0x21')]=function(_0x5109f1,_0x2cfa1d){if(_0x5109f1[_0xe813('0x45')]['id']){delete _0x5109f1[_0xe813('0x45')]['id'];}return db[_0xe813('0x28')]['find']({'where':{'id':_0x5109f1['params']['id']}})[_0xe813('0x22')](handleEntityNotFound(_0x2cfa1d,null))[_0xe813('0x22')](saveUpdates(_0x5109f1['body'],null))['then'](respondWithResult(_0x2cfa1d,null))[_0xe813('0x43')](handleError(_0x2cfa1d,null));};exports[_0xe813('0x46')]=function(_0x1d8257,_0x2d83a9){return db[_0xe813('0x28')]['find']({'where':{'id':_0x1d8257[_0xe813('0x47')]['id']}})['then'](handleEntityNotFound(_0x2d83a9,null))[_0xe813('0x22')](removeEntity(_0x2d83a9,null))[_0xe813('0x43')](handleError(_0x2d83a9,null));};exports[_0xe813('0x48')]=function(_0x118842,_0xe06680){return db[_0xe813('0x28')][_0xe813('0x48')]()[_0xe813('0x22')](respondWithResult(_0xe06680,null))[_0xe813('0x43')](handleError(_0xe06680,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 3bc6c50..fb48aed 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 _0x46d2=['rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','lodash','util','bluebird','request-promise','path'];(function(_0x470f84,_0x16ccfc){var _0x293fcc=function(_0x5203e8){while(--_0x5203e8){_0x470f84['push'](_0x470f84['shift']());}};_0x293fcc(++_0x16ccfc);}(_0x46d2,0x171));var _0x246d=function(_0x530c85,_0x572467){_0x530c85=_0x530c85-0x0;var _0x26af50=_0x46d2[_0x530c85];return _0x26af50;};'use strict';var _=require(_0x246d('0x0'));var util=require(_0x246d('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x246d('0x2'));var rp=require(_0x246d('0x3'));var fs=require('fs');var path=require(_0x246d('0x4'));var rimraf=require(_0x246d('0x5'));var config=require('../../config/environment');var attributes=require(_0x246d('0x6'));module[_0x246d('0x7')]=function(_0x59e88c,_0x23f8ca){return _0x59e88c[_0x246d('0x8')](_0x246d('0x9'),attributes,{'tableName':_0x246d('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x24e4=['uniqueid','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer'];(function(_0x4adead,_0x3e7eef){var _0x34cfca=function(_0x4b52ca){while(--_0x4b52ca){_0x4adead['push'](_0x4adead['shift']());}};_0x34cfca(++_0x3e7eef);}(_0x24e4,0x9d));var _0x424e=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x24e4[_0x1beef3];return _0x5af964;};'use strict';var _=require('lodash');var util=require(_0x424e('0x0'));var logger=require(_0x424e('0x1'))(_0x424e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x424e('0x3'));var fs=require('fs');var path=require(_0x424e('0x4'));var rimraf=require(_0x424e('0x5'));var config=require(_0x424e('0x6'));var attributes=require(_0x424e('0x7'));module[_0x424e('0x8')]=function(_0x438889,_0x1fe71c){return _0x438889['define'](_0x424e('0x9'),attributes,{'tableName':_0x424e('0xa'),'paranoid':![],'indexes':[{'name':_0x424e('0xb'),'fields':[_0x424e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 558107a..1d380fc 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 _0xa858=['catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result'];(function(_0x52ef2d,_0x3897d2){var _0x2f64e1=function(_0x14a006){while(--_0x14a006){_0x52ef2d['push'](_0x52ef2d['shift']());}};_0x2f64e1(++_0x3897d2);}(_0xa858,0x1a3));var _0x8a85=function(_0x4c88a0,_0x38bb3c){_0x4c88a0=_0x4c88a0-0x0;var _0x3d729e=_0xa858[_0x4c88a0];return _0x3d729e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8a85('0x0'));var BPromise=require('bluebird');var rs=require(_0x8a85('0x1'));var fs=require('fs');var Redis=require(_0x8a85('0x2'));var db=require(_0x8a85('0x3'))['db'];var utils=require(_0x8a85('0x4'));var logger=require(_0x8a85('0x5'))(_0x8a85('0x6'));var config=require(_0x8a85('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8a85('0x8')][_0x8a85('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x336533,_0x5c27df,_0x1da30d){return new BPromise(function(_0x46d3ac,_0x25f54b){return client[_0x8a85('0xa')](_0x336533,_0x1da30d)[_0x8a85('0xb')](function(_0x21ac91){logger[_0x8a85('0xc')](_0x8a85('0xd'),_0x5c27df,'request\x20sent');logger[_0x8a85('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5c27df,'request\x20sent',JSON[_0x8a85('0xf')](_0x21ac91));if(_0x21ac91['error']){if(_0x21ac91[_0x8a85('0x10')][_0x8a85('0x11')]===0x1f4){logger[_0x8a85('0x10')](_0x8a85('0xd'),_0x5c27df,_0x21ac91['error']['message']);return _0x25f54b(_0x21ac91['error'][_0x8a85('0x12')]);}logger[_0x8a85('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x5c27df,_0x21ac91[_0x8a85('0x10')][_0x8a85('0x12')]);return _0x46d3ac(_0x21ac91[_0x8a85('0x10')][_0x8a85('0x12')]);}else{logger[_0x8a85('0xc')](_0x8a85('0xd'),_0x5c27df,_0x8a85('0x13'));_0x46d3ac(_0x21ac91[_0x8a85('0x14')][_0x8a85('0x12')]);}})[_0x8a85('0x15')](function(_0xced71f){logger[_0x8a85('0x10')](_0x8a85('0xd'),_0x5c27df,_0xced71f);_0x25f54b(_0xced71f);});});} \ No newline at end of file +var _0x8c58=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3df9dd,_0x26f5cd){var _0x4f11e4=function(_0x1993fe){while(--_0x1993fe){_0x3df9dd['push'](_0x3df9dd['shift']());}};_0x4f11e4(++_0x26f5cd);}(_0x8c58,0xb3));var _0x88c5=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x8c58[_0x234ae1];return _0x227ba0;};'use strict';var _=require(_0x88c5('0x0'));var util=require(_0x88c5('0x1'));var moment=require(_0x88c5('0x2'));var BPromise=require(_0x88c5('0x3'));var rs=require(_0x88c5('0x4'));var fs=require('fs');var Redis=require(_0x88c5('0x5'));var db=require(_0x88c5('0x6'))['db'];var utils=require(_0x88c5('0x7'));var logger=require(_0x88c5('0x8'))(_0x88c5('0x9'));var config=require(_0x88c5('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x88c5('0xb')][_0x88c5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc79814,_0x1d69b9,_0xce3efb){return new BPromise(function(_0x347f35,_0x54767e){return client[_0x88c5('0xd')](_0xc79814,_0xce3efb)[_0x88c5('0xe')](function(_0x421b98){logger[_0x88c5('0xf')](_0x88c5('0x10'),_0x1d69b9,'request\x20sent');logger[_0x88c5('0x11')](_0x88c5('0x12'),_0x1d69b9,_0x88c5('0x13'),JSON['stringify'](_0x421b98));if(_0x421b98[_0x88c5('0x14')]){if(_0x421b98[_0x88c5('0x14')][_0x88c5('0x15')]===0x1f4){logger[_0x88c5('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x1d69b9,_0x421b98[_0x88c5('0x14')][_0x88c5('0x16')]);return _0x54767e(_0x421b98[_0x88c5('0x14')][_0x88c5('0x16')]);}logger[_0x88c5('0x14')](_0x88c5('0x10'),_0x1d69b9,_0x421b98[_0x88c5('0x14')][_0x88c5('0x16')]);return _0x347f35(_0x421b98[_0x88c5('0x14')][_0x88c5('0x16')]);}else{logger['info'](_0x88c5('0x10'),_0x1d69b9,_0x88c5('0x13'));_0x347f35(_0x421b98[_0x88c5('0x17')][_0x88c5('0x16')]);}})[_0x88c5('0x18')](function(_0xd283a0){logger[_0x88c5('0x14')](_0x88c5('0x10'),_0x1d69b9,_0xd283a0);_0x54767e(_0xd283a0);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index c98be70..07c34ef 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 _0xeb6a=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','/:id','create','put','update','delete','exports'];(function(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0xeb6a,0x7e));var _0xaeb6=function(_0x34ff21,_0x5d7c60){_0x34ff21=_0x34ff21-0x0;var _0x3b2a35=_0xeb6a[_0x34ff21];return _0x3b2a35;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaeb6('0x0'));var timeout=require(_0xaeb6('0x1'));var express=require(_0xaeb6('0x2'));var router=express[_0xaeb6('0x3')]();var fs_extra=require(_0xaeb6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xaeb6('0x5'));var config=require(_0xaeb6('0x6'));var controller=require(_0xaeb6('0x7'));router['get']('/',auth[_0xaeb6('0x8')](),controller[_0xaeb6('0x9')]);router[_0xaeb6('0xa')](_0xaeb6('0xb'),auth[_0xaeb6('0x8')](),controller['describe']);router['get'](_0xaeb6('0xc'),auth[_0xaeb6('0x8')](),controller['show']);router['post']('/',auth[_0xaeb6('0x8')](),controller[_0xaeb6('0xd')]);router[_0xaeb6('0xe')]('/:id',auth[_0xaeb6('0x8')](),controller[_0xaeb6('0xf')]);router[_0xaeb6('0x10')](_0xaeb6('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xaeb6('0x11')]=router; \ No newline at end of file +var _0xf3c8=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','update','destroy'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xf3c8,0x12c));var _0x8f3c=function(_0x58ee6b,_0x11d776){_0x58ee6b=_0x58ee6b-0x0;var _0x1d9210=_0xf3c8[_0x58ee6b];return _0x1d9210;};'use strict';var multer=require(_0x8f3c('0x0'));var util=require(_0x8f3c('0x1'));var path=require(_0x8f3c('0x2'));var timeout=require(_0x8f3c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8f3c('0x4'));var auth=require(_0x8f3c('0x5'));var interaction=require(_0x8f3c('0x6'));var config=require(_0x8f3c('0x7'));var controller=require(_0x8f3c('0x8'));router[_0x8f3c('0x9')]('/',auth[_0x8f3c('0xa')](),controller[_0x8f3c('0xb')]);router[_0x8f3c('0x9')](_0x8f3c('0xc'),auth['isAuthenticated'](),controller[_0x8f3c('0xd')]);router[_0x8f3c('0x9')]('/:id',auth[_0x8f3c('0xa')](),controller[_0x8f3c('0xe')]);router[_0x8f3c('0xf')]('/',auth[_0x8f3c('0xa')](),controller['create']);router[_0x8f3c('0x10')](_0x8f3c('0x11'),auth['isAuthenticated'](),controller[_0x8f3c('0x12')]);router['delete']('/:id',auth[_0x8f3c('0xa')](),controller[_0x8f3c('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 004507d..232bee2 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 _0x5e5d=['New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','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','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','INTEGER','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','thumb','input','name','text','onlineForm','parse','getDataValue','setDataValue','stringify','textarea','Comments','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.'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e5d,0x1b6));var _0xd5e5=function(_0x5029b4,_0x4b5398){_0x5029b4=_0x5029b4-0x0;var _0xa47784=_0x5e5d[_0x5029b4];return _0xa47784;};'use strict';var Sequelize=require(_0xd5e5('0x0'));var rs=require(_0xd5e5('0x1'));module[_0xd5e5('0x2')]={'name':{'type':Sequelize[_0xd5e5('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd5e5('0x4')},'description':{'type':Sequelize[_0xd5e5('0x3')]},'mapKey':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':_0xd5e5('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xd5e5('0x5')},'key':{'type':Sequelize[_0xd5e5('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':_0xd5e5('0x6')},'customerAlias':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd5e5('0x3')],'allowNull':![],'defaultValue':_0xd5e5('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd5e5('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd5e5('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xd5e5('0x3')],'allowNull':![],'defaultValue':_0xd5e5('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd5e5('0x3')]},'animation':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd5e5('0xa')]('rounded','squared'),'defaultValue':_0xd5e5('0xb')},'header_online':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':_0xd5e5('0xc')},'start_chat_button':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':_0xd5e5('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd5e5('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd5e5('0xf')]},'closingQuestion':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':_0xd5e5('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':_0xd5e5('0x11')},'placeholderMessage':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':_0xd5e5('0x12')},'closingMessage':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':_0xd5e5('0x13')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xd5e5('0x14')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xd5e5('0x15')},'conditionAgreement':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd5e5('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0xd5e5('0x17'),_0xd5e5('0x18')),'defaultValue':_0xd5e5('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd5e5('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xd5e5('0x19'),'variable':null,'config':{'placeholder':_0xd5e5('0x1a'),'type':_0xd5e5('0x1b'),'required':!![]},'props':{'title':_0xd5e5('0x1a'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xd5e5('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xd5e5('0x1c'))?JSON[_0xd5e5('0x1d')](this[_0xd5e5('0x1e')](_0xd5e5('0x1c'))):{};},'set':function(_0x4f7abd){return this[_0xd5e5('0x1f')]('onlineForm',JSON[_0xd5e5('0x20')](_0x4f7abd));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xd5e5('0x20')]({'items':[{'type':_0xd5e5('0x19'),'props':{'title':_0xd5e5('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xd5e5('0x5'),'type':_0xd5e5('0x5')},'variable':null},{'type':_0xd5e5('0x21'),'config':{'placeholder':_0xd5e5('0x22')},'props':{'title':_0xd5e5('0x22'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xd5e5('0x23'))?JSON[_0xd5e5('0x1d')](this[_0xd5e5('0x1e')](_0xd5e5('0x23'))):{};},'set':function(_0x283638){return this[_0xd5e5('0x1f')]('offlineForm',JSON[_0xd5e5('0x20')](_0x283638));}},'token':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':function(){return rs[_0xd5e5('0x24')]();}},'autoclose':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd5e5('0x3')]},'forwardOffline':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd5e5('0x3')]},'waitingTitle':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':_0xd5e5('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd5e5('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xd5e5('0x27')},'offlineMessageBody':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':_0xd5e5('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd5e5('0x29')},'skipUnmanaged':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':_0xd5e5('0x15')},'sendUnmanaged':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':_0xd5e5('0x14')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd5e5('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xd5e5('0xf')],'defaultValue':function(){return _0xd5e5('0x2a');}},'notificationSound':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':_0xd5e5('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd5e5('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd5e5('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':_0xd5e5('0x2c')},'messagesAlignment':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':_0xd5e5('0x2d')},'defaultTitle':{'type':Sequelize[_0xd5e5('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd5e5('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd5e5('0x3')],'allowNull':![],'defaultValue':_0xd5e5('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd5e5('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd5e5('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xd5e5('0x2f')},'systemAvatar':{'type':Sequelize[_0xd5e5('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xd5e5('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':![],'comment':_0xd5e5('0x31'),'set':function(_0x59a570){if(!_0x59a570)this[_0xd5e5('0x1f')](_0xd5e5('0x32'),null);this['setDataValue'](_0xd5e5('0x33'),_0x59a570);}},'vidaooEscalation':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd5e5('0x3')]},'vidaooTopic':{'type':Sequelize[_0xd5e5('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':function(){return _0xd5e5('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd5e5('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd5e5('0xf')]}}; \ No newline at end of file +var _0x0d2d=['text','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','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}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','TEXT','input','name'];(function(_0x44ca6e,_0x5e2c91){var _0x2edab2=function(_0x3afa91){while(--_0x3afa91){_0x44ca6e['push'](_0x44ca6e['shift']());}};_0x2edab2(++_0x5e2c91);}(_0x0d2d,0x112));var _0xd0d2=function(_0x5a7449,_0x5d0560){_0x5a7449=_0x5a7449-0x0;var _0x59d9e9=_0x0d2d[_0x5a7449];return _0x59d9e9;};'use strict';var Sequelize=require(_0xd0d2('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xd0d2('0x1')],'allowNull':![],'unique':_0xd0d2('0x2')},'description':{'type':Sequelize[_0xd0d2('0x1')]},'mapKey':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xd0d2('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0x4')},'customerAlias':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd0d2('0x1')],'allowNull':![],'defaultValue':_0xd0d2('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd0d2('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd0d2('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xd0d2('0x1')],'allowNull':![],'defaultValue':_0xd0d2('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd0d2('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd0d2('0x1')]},'animation':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd0d2('0x9')](_0xd0d2('0xa'),_0xd0d2('0xb')),'defaultValue':_0xd0d2('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0xc')},'offline_chat_button':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0xd')},'header_offline':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0xe')},'download_transcript':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd0d2('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xd0d2('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd0d2('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0x12')},'closingMessage':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0x13')},'closingMessageButton':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0xd')},'skipMessageButton':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0x14')},'conditionAgreement':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xd0d2('0x9')](_0xd0d2('0x15'),_0xd0d2('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd0d2('0x17')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xd0d2('0x18'),'variable':null,'config':{'placeholder':_0xd0d2('0x19'),'type':_0xd0d2('0x1a'),'required':!![]},'props':{'title':_0xd0d2('0x19'),'helpText':''}},{'type':_0xd0d2('0x18'),'props':{'title':_0xd0d2('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xd0d2('0x3'),'type':_0xd0d2('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd0d2('0x1b')](_0xd0d2('0x1c'))?JSON['parse'](this[_0xd0d2('0x1b')](_0xd0d2('0x1c'))):{};},'set':function(_0x19c192){return this[_0xd0d2('0x1d')](_0xd0d2('0x1c'),JSON[_0xd0d2('0x1e')](_0x19c192));}},'offlineForm':{'type':Sequelize[_0xd0d2('0x17')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xd0d2('0x18'),'props':{'title':_0xd0d2('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xd0d2('0x3')},'variable':null},{'type':_0xd0d2('0x1f'),'config':{'placeholder':_0xd0d2('0x20')},'props':{'title':'Comments','helpText':_0xd0d2('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xd0d2('0x1b')](_0xd0d2('0x22'))?JSON[_0xd0d2('0x23')](this[_0xd0d2('0x1b')](_0xd0d2('0x22'))):{};},'set':function(_0x2aad9e){return this[_0xd0d2('0x1d')](_0xd0d2('0x22'),JSON[_0xd0d2('0x1e')](_0x2aad9e));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd0d2('0x24')]();}},'autoclose':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd0d2('0x1')]},'waitingTitle':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0x25')},'waitingMessage':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xd0d2('0x26')},'offlineMessageBody':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0x14')},'sendUnmanaged':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd0d2('0x17')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd0d2('0x28');}},'notificationSound':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xd0d2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd0d2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0x29')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0x2a')},'messagesAlignment':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0x2b')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd0d2('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd0d2('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd0d2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':_0xd0d2('0x2d')},'systemAvatar':{'type':Sequelize[_0xd0d2('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd0d2('0x7')],'comment':_0xd0d2('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x465abe){if(!_0x465abe)this[_0xd0d2('0x1d')]('mandatoryDispositionPauseId',null);this[_0xd0d2('0x1d')](_0xd0d2('0x2f'),_0x465abe);}},'vidaooEscalation':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd0d2('0x30')},'vidaooNote':{'type':Sequelize[_0xd0d2('0x1')],'defaultValue':function(){return _0xd0d2('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd0d2('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd0d2('0x17')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 958e927..3b34670 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 _0x1891=['pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','show','mandatoryDispositionPause','options','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','params','describe','getDispositions','findOne','hasOwnProperty','ChatWebsiteId','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','agentAvatar','file','filename','customerAvatar','addSystemAvatar','getLogo','root','getLicense','custom','isNil','existsSync','server/files/images/logos/','join','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','systemAvatar','notify','chat','CmContact','Sequelize','createdAt','difference','updatedAt','CompanyId','ListId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','ChatApplication','Applications','applications','orderBy','priority','asc','account','defaults','contact','headers','threadId','ChatInteraction','externalUrl','interaction','messageId','created','autoclose','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','includes','mapKeyOffline','CmList','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','fromString','originalname','attachments','offline-chat','sequelize','Attachment','MailAccount','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','mimetype','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','server','addInteraction','omit','getInteractions','Contact','fullname','internal','Tag','Tags','tag','getProactiveActions','../../config/license/util','License','chatLicenseExceeded','readFileSync','URL','address','3.5.0','remote','x-forwarded-for','connection','referer','virtual','replace','alignment','verticalAlignment','color','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','util','fs-extra','lodash','querystring','url','../../config/environment','../../errors/api','APIOutOfIntervalError','APINotFoundError','handleError','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','http','client','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','get','ChatWebsites','destroy','stack','name','send','getSnippet','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','OFFLINE','No\x20timezone','map','Interval','Intervals','all','some','user-agent-parser','user-agent','cf-connecting-ip','firstName','lastName','x-real-port','browser','version','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','stringify','index','Pause','ChatWebsite','rawAttributes','fieldName','key','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x2ee790,_0x5a8661){var _0x5a54a5=function(_0x2713a4){while(--_0x2713a4){_0x2ee790['push'](_0x2ee790['shift']());}};_0x5a54a5(++_0x5a8661);}(_0x1891,0xc6));var _0x1189=function(_0x44474f,_0x431580){_0x44474f=_0x44474f-0x0;var _0x427d97=_0x1891[_0x44474f];return _0x427d97;};'use strict';var Mustache=require('mustache');var util=require(_0x1189('0x0'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1189('0x1'));var _=require(_0x1189('0x2'));var querystring=require(_0x1189('0x3'));var htmlToText=require('html-to-text');var Redis=require('ioredis');var jayson=require('jayson/promise');var url=require(_0x1189('0x4'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x1189('0x5'));var APIOutOfIntervalError=require(_0x1189('0x6'))[_0x1189('0x7')];var APINotFoundError=require(_0x1189('0x6'))[_0x1189('0x8')];var APIHandleError=require(_0x1189('0x6'))[_0x1189('0x9')];var db=require('../../mysqldb')['db'];config[_0x1189('0xa')]=_['defaults'](config[_0x1189('0xa')],{'host':_0x1189('0xb'),'port':0x18eb});var socket=require(_0x1189('0xc'))(new Redis(config[_0x1189('0xa')]));require(_0x1189('0xd'))[_0x1189('0xe')](socket);var client=jayson['client'][_0x1189('0xf')]({'port':0x232c});var client9002=jayson[_0x1189('0x10')][_0x1189('0xf')]({'port':0x232a});var client9003=jayson[_0x1189('0x10')][_0x1189('0xf')]({'port':0x232b});var client9001=jayson[_0x1189('0x10')][_0x1189('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x2e40a1,_0x19d729,_0x52bc23,_0x11e296){return new Promise(function(_0x2fae08,_0xd99977){var _0x4eb9a8=_0x11e296||client;return _0x4eb9a8[_0x1189('0x11')](_0x2e40a1,_0x52bc23)['then'](function(_0x55caf9){logger['info'](_0x1189('0x12'),_0x19d729,_0x1189('0x13'));logger[_0x1189('0x14')](_0x1189('0x15'),_0x19d729,_0x1189('0x13'),JSON['stringify'](_0x55caf9));if(_0x55caf9[_0x1189('0x16')]){if(_0x55caf9['error']['code']===0x1f4){logger[_0x1189('0x16')](_0x1189('0x12'),_0x19d729,_0x55caf9[_0x1189('0x16')]['message']);return _0xd99977(_0x55caf9[_0x1189('0x16')][_0x1189('0x17')]);}logger[_0x1189('0x16')](_0x1189('0x12'),_0x19d729,_0x55caf9[_0x1189('0x16')][_0x1189('0x17')]);return _0x2fae08(_0x55caf9[_0x1189('0x16')][_0x1189('0x17')]);}else{logger[_0x1189('0x18')](_0x1189('0x12'),_0x19d729,_0x1189('0x13'));_0x2fae08(_0x55caf9['result'][_0x1189('0x17')]);}})[_0x1189('0x19')](function(_0x44435c){logger[_0x1189('0x16')](_0x1189('0x12'),_0x19d729,_0x44435c);_0xd99977(_0x44435c);});});}function respondWithStatusCode(_0x1b1972,_0x4eba15){_0x4eba15=_0x4eba15||0xcc;return function(_0x3d44e7){if(_0x3d44e7){return _0x1b1972[_0x1189('0x1a')](_0x4eba15);}return _0x1b1972[_0x1189('0x1b')](_0x4eba15)[_0x1189('0x1c')]();};}function respondWithResult(_0xc42546,_0x1ec339){_0x1ec339=_0x1ec339||0xc8;return function(_0x4a7eae){if(_0x4a7eae){return _0xc42546[_0x1189('0x1b')](_0x1ec339)['json'](_0x4a7eae);}};}function respondWithFilteredResult(_0x36bcef,_0x53cfc8){return function(_0x9f3105){if(_0x9f3105){var _0x2d9b25=typeof _0x53cfc8[_0x1189('0x1d')]===_0x1189('0x1e')&&typeof _0x53cfc8[_0x1189('0x1f')]===_0x1189('0x1e');var _0x2ca262=_0x9f3105[_0x1189('0x20')];var _0x4eaab6=_0x2d9b25?0x0:_0x53cfc8['offset'];var _0x33a033=_0x2d9b25?_0x9f3105['count']:_0x53cfc8[_0x1189('0x1d')]+_0x53cfc8[_0x1189('0x1f')];var _0x29d1c3;if(_0x33a033>=_0x2ca262){_0x33a033=_0x2ca262;_0x29d1c3=0xc8;}else{_0x29d1c3=0xce;}_0x36bcef['status'](_0x29d1c3);return _0x36bcef[_0x1189('0x21')](_0x1189('0x22'),_0x4eaab6+'-'+_0x33a033+'/'+_0x2ca262)[_0x1189('0x23')](_0x9f3105);}return null;};}function saveUpdates(_0x4a40f1){return function(_0x10b124){if(_0x10b124){return _0x10b124[_0x1189('0x24')](_0x4a40f1)[_0x1189('0x25')](function(_0x5393f1){return _0x5393f1;});}return null;};}function removeEntity(_0x2e780){return function(_0x1f573a){if(_0x1f573a){return _0x1f573a['destroy']()[_0x1189('0x25')](function(){var _0x706424=_0x1f573a[_0x1189('0x26')]({'plain':!![]});var _0x3cd0ab=_0x1189('0x27');return db['UserProfileResource'][_0x1189('0x28')]({'where':{'type':_0x3cd0ab,'resourceId':_0x706424['id']}})['then'](function(){return _0x1f573a;});})[_0x1189('0x25')](function(){_0x2e780['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bef6b){return function(_0xe3b208){if(!_0xe3b208){_0x1bef6b[_0x1189('0x1a')](0x194);}return _0xe3b208;};}function handleError(_0x472b7b,_0x37fdfd){_0x37fdfd=_0x37fdfd||0x1f4;return function(_0x5df62f){logger[_0x1189('0x16')](_0x5df62f[_0x1189('0x29')]);if(_0x5df62f[_0x1189('0x2a')]){delete _0x5df62f[_0x1189('0x2a')];}_0x472b7b[_0x1189('0x1b')](_0x37fdfd)[_0x1189('0x2b')](_0x5df62f);};}function iftimePromise(_0x44688a,_0x4a2d48){return respondWithRpcPromise('Command',_0x1189('0x2c'),{'command':_0x4a2d48[_0x1189('0x2d')]?util[_0x1189('0x2e')](_0x1189('0x2f'),_0x44688a[_0x1189('0x30')],_0x4a2d48[_0x1189('0x2d')]):util[_0x1189('0x2e')](_0x1189('0x31'),_0x44688a[_0x1189('0x30')])},client9002)[_0x1189('0x25')](function(_0x527b92){var _0x4aa679=_0x527b92&&_0x527b92[_0x1189('0x32')](_0x1189('0x33'))>=0x0?!![]:![];logger[_0x1189('0x18')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4a2d48['id'],_0x44688a['id'],_0x44688a[_0x1189('0x30')],_0x4aa679?'ONLINE':_0x1189('0x34'),_0x4a2d48[_0x1189('0x2d')]?_0x4a2d48[_0x1189('0x2d')]:_0x1189('0x35'));return _0x4aa679;})[_0x1189('0x19')](function(_0x360b8f){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4a2d48['id'],_0x44688a['id'],_0x44688a[_0x1189('0x30')],util['inspect'](_0x360b8f,{'showHidden':![],'depth':null}),_0x4a2d48[_0x1189('0x2d')]?_0x4a2d48[_0x1189('0x2d')]:'No\x20timezone');return![];});}function checkWebsiteIntervals(_0xe71ebb){var _0xef5651=_[_0x1189('0x36')](_0xe71ebb[_0x1189('0x37')][_0x1189('0x38')],function(_0x540f97){var _0x328b5a=_0x540f97[_0x1189('0x26')]({'plain':!![]});return iftimePromise(_0x328b5a,_0xe71ebb);});return Promise[_0x1189('0x39')](_0xef5651)[_0x1189('0x25')](function(_0x541bbb){return _[_0x1189('0x3a')](_0x541bbb);});}function createInteractionObject(_0x16fd2d,_0x404b0b,_0x2fe903,_0x190382){var _0x442327=require(_0x1189('0x3b'));var _0x8735f5=new _0x442327();var _0x5f40b4=_0x8735f5['setUA'](_0x2fe903[_0x1189('0x3c')])['getResult']();var _0x33484e=_0x404b0b['customerIp'];if(_0x2fe903[_0x1189('0x3d')]){_0x33484e=_0x2fe903[_0x1189('0x3d')];}else if(_0x2fe903['x-forwarded-for']){_0x33484e=_['first'](_0x2fe903['x-forwarded-for']['split'](','));}return{'ContactId':_0x190382['id'],'ChatWebsiteId':_0x16fd2d,'from':(_0x190382[_0x1189('0x3e')]||'')+'\x20'+(_0x190382[_0x1189('0x3f')]||''),'customerIp':_0x33484e,'customerPort':_0x2fe903[_0x1189('0x40')]?_0x2fe903[_0x1189('0x40')]:null,'referer':_0x404b0b['referer'],'browserName':_0x5f40b4[_0x1189('0x41')][_0x1189('0x2a')]&&_0x5f40b4[_0x1189('0x41')][_0x1189('0x42')]?util['format'](_0x1189('0x43'),_0x5f40b4[_0x1189('0x41')][_0x1189('0x2a')],_0x5f40b4[_0x1189('0x41')]['version']):'unknown','browserVersion':_0x5f40b4['browser'][_0x1189('0x42')]||_0x1189('0x44'),'osName':util['format'](_0x1189('0x43'),_0x5f40b4['os']['name'],_0x5f40b4['os'][_0x1189('0x42')]),'osVersion':_0x5f40b4['os'][_0x1189('0x42')],'deviceModel':_0x5f40b4[_0x1189('0x45')][_0x1189('0x46')]&&_0x5f40b4['device'][_0x1189('0x47')]?util[_0x1189('0x2e')](_0x1189('0x48'),_0x5f40b4[_0x1189('0x45')][_0x1189('0x46')],_0x5f40b4['device'][_0x1189('0x47')],_0x5f40b4['device'][_0x1189('0x49')]):null,'deviceVendor':_0x5f40b4[_0x1189('0x45')][_0x1189('0x47')],'deviceType':_0x5f40b4['device'][_0x1189('0x49')],'formData':JSON[_0x1189('0x4a')](_0x404b0b)};}exports[_0x1189('0x4b')]=function(_0x680652,_0x3dcacb){var _0x5bf1c1={'include':[{'model':db[_0x1189('0x4c')],'as':'mandatoryDispositionPause'}]},_0x19c10f={},_0x533d9f={'count':0x0,'rows':[]};var _0x283821=_[_0x1189('0x36')](db[_0x1189('0x4d')][_0x1189('0x4e')],function(_0xa3a22){return{'name':_0xa3a22[_0x1189('0x4f')],'type':_0xa3a22[_0x1189('0x49')][_0x1189('0x50')]};});_0x19c10f[_0x1189('0x46')]=_['map'](_0x283821,_0x1189('0x2a'));_0x19c10f['query']=_[_0x1189('0x51')](_0x680652[_0x1189('0x52')]);_0x19c10f[_0x1189('0x53')]=_['intersection'](_0x19c10f[_0x1189('0x46')],_0x19c10f[_0x1189('0x52')]);_0x5bf1c1[_0x1189('0x54')]=_[_0x1189('0x55')](_0x19c10f[_0x1189('0x46')],qs[_0x1189('0x56')](_0x680652[_0x1189('0x52')]['fields']));_0x5bf1c1[_0x1189('0x54')]=_0x5bf1c1['attributes'][_0x1189('0x57')]?_0x5bf1c1[_0x1189('0x54')]:_0x19c10f[_0x1189('0x46')];if(!_0x680652['query']['hasOwnProperty'](_0x1189('0x58'))){_0x5bf1c1[_0x1189('0x1f')]=qs['limit'](_0x680652[_0x1189('0x52')]['limit']);_0x5bf1c1[_0x1189('0x1d')]=qs['offset'](_0x680652['query'][_0x1189('0x1d')]);}_0x5bf1c1[_0x1189('0x59')]=qs[_0x1189('0x5a')](_0x680652['query'][_0x1189('0x5a')]);_0x5bf1c1['where']=qs[_0x1189('0x53')](_[_0x1189('0x5b')](_0x680652[_0x1189('0x52')],_0x19c10f[_0x1189('0x53')]),_0x283821);if(_0x680652[_0x1189('0x52')][_0x1189('0x5c')]){_0x5bf1c1['where']=_[_0x1189('0x5d')](_0x5bf1c1[_0x1189('0x5e')],{'$or':_[_0x1189('0x36')](_0x283821,function(_0x4ef137){if(_0x4ef137['type']!==_0x1189('0x5f')){var _0x1a0362={};_0x1a0362[_0x4ef137[_0x1189('0x2a')]]={'$like':'%'+_0x680652[_0x1189('0x52')][_0x1189('0x5c')]+'%'};return _0x1a0362;}})});}_0x5bf1c1=_[_0x1189('0x5d')]({},_0x5bf1c1,_0x680652['options']);var _0x279df0={'where':_0x5bf1c1['where']};return db[_0x1189('0x4d')]['count'](_0x279df0)[_0x1189('0x25')](function(_0x3e002f){_0x533d9f[_0x1189('0x20')]=_0x3e002f;if(_0x680652['query'][_0x1189('0x60')]){_0x5bf1c1[_0x1189('0x61')]=[{'all':!![]}];}return db[_0x1189('0x4d')][_0x1189('0x62')](_0x5bf1c1);})[_0x1189('0x25')](function(_0x447e26){_0x533d9f[_0x1189('0x63')]=_0x447e26;return _0x533d9f;})[_0x1189('0x25')](respondWithFilteredResult(_0x3dcacb,_0x5bf1c1))['catch'](handleError(_0x3dcacb,null));};exports[_0x1189('0x64')]=function(_0x378f80,_0x1a841c){var _0x59afbb={'raw':![],'where':{'id':_0x378f80['params']['id']},'include':[{'model':db[_0x1189('0x4c')],'as':_0x1189('0x65')}]},_0x5a18ee={};_0x5a18ee[_0x1189('0x46')]=_[_0x1189('0x51')](db[_0x1189('0x4d')][_0x1189('0x4e')]);_0x5a18ee[_0x1189('0x52')]=_[_0x1189('0x51')](_0x378f80[_0x1189('0x52')]);_0x5a18ee['filters']=_[_0x1189('0x55')](_0x5a18ee[_0x1189('0x46')],_0x5a18ee[_0x1189('0x52')]);_0x59afbb[_0x1189('0x54')]=_[_0x1189('0x55')](_0x5a18ee['model'],qs['fields'](_0x378f80['query']['fields']));_0x59afbb[_0x1189('0x54')]=_0x59afbb[_0x1189('0x54')][_0x1189('0x57')]?_0x59afbb['attributes']:_0x5a18ee[_0x1189('0x46')];if(_0x378f80[_0x1189('0x52')][_0x1189('0x60')]){_0x59afbb[_0x1189('0x61')]=[{'all':!![]}];}_0x59afbb=_['merge']({},_0x59afbb,_0x378f80[_0x1189('0x66')]);return db['ChatWebsite'][_0x1189('0x67')](_0x59afbb)['then'](handleEntityNotFound(_0x1a841c,null))[_0x1189('0x25')](respondWithResult(_0x1a841c,null))[_0x1189('0x19')](handleError(_0x1a841c,null));};exports[_0x1189('0x68')]=function(_0x420b65,_0x3fcd32){return db['ChatWebsite'][_0x1189('0x68')](_0x420b65[_0x1189('0x69')],{})['then'](function(_0x13e860){var _0x20759e=_0x420b65[_0x1189('0x6a')]['get']({'plain':!![]});if(!_0x20759e)throw new Error(_0x1189('0x6b'));if(_0x20759e[_0x1189('0x6c')]===_0x1189('0x6a')){var _0x1c5bd9=_0x13e860['get']({'plain':!![]});var _0x4f3088=_0x1189('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x4f3088,'userProfileId':_0x20759e[_0x1189('0x6d')]},'raw':!![]})[_0x1189('0x25')](function(_0x3053ee){if(_0x3053ee&&_0x3053ee[_0x1189('0x6e')]===0x0){return db[_0x1189('0x6f')][_0x1189('0x68')]({'name':_0x1c5bd9['name'],'resourceId':_0x1c5bd9['id'],'type':_0x3053ee['name'],'sectionId':_0x3053ee['id']},{})[_0x1189('0x25')](function(){return _0x13e860;});}else{return _0x13e860;}})['catch'](function(_0x33f6e8){logger[_0x1189('0x16')](_0x1189('0x70'),_0x33f6e8);throw _0x33f6e8;});}return _0x13e860;})[_0x1189('0x25')](respondWithResult(_0x3fcd32,0xc9))[_0x1189('0x19')](handleError(_0x3fcd32,null));};exports[_0x1189('0x24')]=function(_0x4a7a73,_0x10c777){if(_0x4a7a73[_0x1189('0x69')]['id']){delete _0x4a7a73[_0x1189('0x69')]['id'];}return db[_0x1189('0x4d')][_0x1189('0x67')]({'where':{'id':_0x4a7a73[_0x1189('0x71')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x1189('0x25')](handleEntityNotFound(_0x10c777,null))[_0x1189('0x25')](saveUpdates(_0x4a7a73[_0x1189('0x69')],null))['then'](respondWithResult(_0x10c777,null))['catch'](handleError(_0x10c777,null));};exports[_0x1189('0x28')]=function(_0x26e505,_0x3f2270){return db[_0x1189('0x4d')]['find']({'where':{'id':_0x26e505[_0x1189('0x71')]['id']}})[_0x1189('0x25')](handleEntityNotFound(_0x3f2270,null))[_0x1189('0x25')](removeEntity(_0x3f2270,null))[_0x1189('0x19')](handleError(_0x3f2270,null));};exports[_0x1189('0x72')]=function(_0x26cd06,_0x38bcc5){return db[_0x1189('0x4d')]['describe']()[_0x1189('0x25')](respondWithResult(_0x38bcc5,null))['catch'](handleError(_0x38bcc5,null));};exports['addDisposition']=function(_0x37789e,_0x25ddc4){if(_0x37789e[_0x1189('0x69')]['id']){delete _0x37789e[_0x1189('0x69')]['id'];}return db[_0x1189('0x4d')][_0x1189('0x67')]({'where':{'id':_0x37789e[_0x1189('0x71')]['id']}})[_0x1189('0x25')](handleEntityNotFound(_0x25ddc4,null))[_0x1189('0x25')](function(_0x19ee0a){if(_0x19ee0a){_0x37789e[_0x1189('0x69')]['ChatWebsiteId']=_0x19ee0a['id'];return db['Disposition'][_0x1189('0x68')](_0x37789e[_0x1189('0x69')]);}})[_0x1189('0x25')](respondWithResult(_0x25ddc4,null))[_0x1189('0x19')](handleError(_0x25ddc4,null));};exports[_0x1189('0x73')]=function(_0x1d89f2,_0x479253){var _0x14c2f0={'raw':![],'where':{}};var _0xd58862={};var _0x21e8ff={'count':0x0,'rows':[]};return db[_0x1189('0x4d')][_0x1189('0x74')]({'where':{'id':_0x1d89f2[_0x1189('0x71')]['id']}})['then'](handleEntityNotFound(_0x479253,null))[_0x1189('0x25')](function(_0x519307){if(_0x519307){_0xd58862[_0x1189('0x46')]=_[_0x1189('0x51')](db['Disposition'][_0x1189('0x4e')]);_0xd58862[_0x1189('0x52')]=_[_0x1189('0x51')](_0x1d89f2[_0x1189('0x52')]);_0xd58862['filters']=_[_0x1189('0x55')](_0xd58862[_0x1189('0x46')],_0xd58862[_0x1189('0x52')]);_0x14c2f0[_0x1189('0x54')]=_[_0x1189('0x55')](_0xd58862[_0x1189('0x46')],qs[_0x1189('0x56')](_0x1d89f2[_0x1189('0x52')][_0x1189('0x56')]));_0x14c2f0[_0x1189('0x54')]=_0x14c2f0[_0x1189('0x54')]['length']?_0x14c2f0[_0x1189('0x54')]:_0xd58862[_0x1189('0x46')];if(!_0x1d89f2[_0x1189('0x52')][_0x1189('0x75')]('nolimit')){_0x14c2f0[_0x1189('0x1f')]=qs[_0x1189('0x1f')](_0x1d89f2[_0x1189('0x52')]['limit']);_0x14c2f0[_0x1189('0x1d')]=qs['offset'](_0x1d89f2['query'][_0x1189('0x1d')]);}_0x14c2f0['order']=qs[_0x1189('0x5a')](_0x1d89f2[_0x1189('0x52')][_0x1189('0x5a')]);_0x14c2f0[_0x1189('0x5e')]=qs[_0x1189('0x53')](_['pick'](_0x1d89f2['query'],_0xd58862[_0x1189('0x53')]));_0x14c2f0['where'][_0x1189('0x76')]=_0x519307['id'];if(_0x1d89f2[_0x1189('0x52')][_0x1189('0x5c')]){_0x14c2f0['where']=_['merge'](_0x14c2f0[_0x1189('0x5e')],{'$or':_['map'](_0x14c2f0[_0x1189('0x54')],function(_0x386b82){var _0xb621ce={};_0xb621ce[_0x386b82]={'$like':'%'+_0x1d89f2[_0x1189('0x52')]['filter']+'%'};return _0xb621ce;})});}_0x14c2f0=_['merge']({},_0x14c2f0,_0x1d89f2['options']);return db[_0x1189('0x77')][_0x1189('0x20')]({'where':_0x14c2f0[_0x1189('0x5e')]})[_0x1189('0x25')](function(_0xb26b08){_0x21e8ff[_0x1189('0x20')]=_0xb26b08;if(_0x1d89f2['query']['includeAll']){_0x14c2f0[_0x1189('0x61')]=[{'all':!![]}];}return db[_0x1189('0x77')][_0x1189('0x62')](_0x14c2f0);})[_0x1189('0x25')](function(_0x5baff0){_0x21e8ff[_0x1189('0x63')]=_0x5baff0;return _0x21e8ff;});}})['then'](respondWithFilteredResult(_0x479253,_0x14c2f0))[_0x1189('0x19')](handleError(_0x479253,null));};exports[_0x1189('0x78')]=function(_0x706ade,_0x23a66a){return db[_0x1189('0x4d')][_0x1189('0x67')]({'where':{'id':_0x706ade[_0x1189('0x71')]['id']}})[_0x1189('0x25')](handleEntityNotFound(_0x23a66a,null))[_0x1189('0x25')](function(_0x1c3ec2){if(_0x1c3ec2){return _0x1c3ec2[_0x1189('0x78')](_0x706ade['query']['ids']);}})['then'](respondWithStatusCode(_0x23a66a,null))['catch'](handleError(_0x23a66a,null));};exports[_0x1189('0x79')]=function(_0x23c351,_0x17f7ba){if(_0x23c351['body']['id']){delete _0x23c351[_0x1189('0x69')]['id'];}return db[_0x1189('0x4d')][_0x1189('0x67')]({'where':{'id':_0x23c351[_0x1189('0x71')]['id']}})[_0x1189('0x25')](handleEntityNotFound(_0x17f7ba,null))['then'](function(_0x1dbbbc){if(_0x1dbbbc){_0x23c351['body'][_0x1189('0x76')]=_0x1dbbbc['id'];return db[_0x1189('0x7a')]['create'](_0x23c351['body']);}})['then'](respondWithResult(_0x17f7ba,null))['catch'](handleError(_0x17f7ba,null));};exports[_0x1189('0x7b')]=function(_0x3845bf,_0x36c0b2){var _0x2aa6a5={'raw':![],'where':{}};var _0x866771={};var _0x17180e={'count':0x0,'rows':[]};return db[_0x1189('0x4d')]['findOne']({'where':{'id':_0x3845bf[_0x1189('0x71')]['id']}})['then'](handleEntityNotFound(_0x36c0b2,null))[_0x1189('0x25')](function(_0x41d718){if(_0x41d718){_0x866771[_0x1189('0x46')]=_[_0x1189('0x51')](db[_0x1189('0x7a')]['rawAttributes']);_0x866771[_0x1189('0x52')]=_[_0x1189('0x51')](_0x3845bf[_0x1189('0x52')]);_0x866771[_0x1189('0x53')]=_[_0x1189('0x55')](_0x866771[_0x1189('0x46')],_0x866771['query']);_0x2aa6a5['attributes']=_[_0x1189('0x55')](_0x866771[_0x1189('0x46')],qs[_0x1189('0x56')](_0x3845bf[_0x1189('0x52')][_0x1189('0x56')]));_0x2aa6a5[_0x1189('0x54')]=_0x2aa6a5[_0x1189('0x54')][_0x1189('0x57')]?_0x2aa6a5[_0x1189('0x54')]:_0x866771[_0x1189('0x46')];if(!_0x3845bf[_0x1189('0x52')][_0x1189('0x75')]('nolimit')){_0x2aa6a5[_0x1189('0x1f')]=qs[_0x1189('0x1f')](_0x3845bf[_0x1189('0x52')]['limit']);_0x2aa6a5[_0x1189('0x1d')]=qs[_0x1189('0x1d')](_0x3845bf[_0x1189('0x52')][_0x1189('0x1d')]);}_0x2aa6a5[_0x1189('0x59')]=qs[_0x1189('0x5a')](_0x3845bf[_0x1189('0x52')]['sort']);_0x2aa6a5[_0x1189('0x5e')]=qs[_0x1189('0x53')](_['pick'](_0x3845bf[_0x1189('0x52')],_0x866771[_0x1189('0x53')]));_0x2aa6a5[_0x1189('0x5e')][_0x1189('0x76')]=_0x41d718['id'];if(_0x3845bf[_0x1189('0x52')][_0x1189('0x5c')]){_0x2aa6a5[_0x1189('0x5e')]=_[_0x1189('0x5d')](_0x2aa6a5[_0x1189('0x5e')],{'$or':_['map'](_0x2aa6a5[_0x1189('0x54')],function(_0x21d29a){var _0x595b6c={};_0x595b6c[_0x21d29a]={'$like':'%'+_0x3845bf[_0x1189('0x52')][_0x1189('0x5c')]+'%'};return _0x595b6c;})});}_0x2aa6a5=_[_0x1189('0x5d')]({},_0x2aa6a5,_0x3845bf[_0x1189('0x66')]);return db[_0x1189('0x7a')]['count']({'where':_0x2aa6a5[_0x1189('0x5e')]})[_0x1189('0x25')](function(_0x2af551){_0x17180e[_0x1189('0x20')]=_0x2af551;if(_0x3845bf[_0x1189('0x52')][_0x1189('0x60')]){_0x2aa6a5[_0x1189('0x61')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1189('0x62')](_0x2aa6a5);})[_0x1189('0x25')](function(_0x2d7449){_0x17180e[_0x1189('0x63')]=_0x2d7449;return _0x17180e;});}})[_0x1189('0x25')](respondWithFilteredResult(_0x36c0b2,_0x2aa6a5))[_0x1189('0x19')](handleError(_0x36c0b2,null));};exports[_0x1189('0x7c')]=function(_0x1e6b91,_0x1332fe){return db[_0x1189('0x4d')][_0x1189('0x67')]({'where':{'id':_0x1e6b91[_0x1189('0x71')]['id']}})[_0x1189('0x25')](handleEntityNotFound(_0x1332fe,null))['then'](function(_0x424048){if(_0x424048){return _0x424048[_0x1189('0x7c')](_0x1e6b91[_0x1189('0x52')][_0x1189('0x7d')]);}})['then'](respondWithStatusCode(_0x1332fe,null))[_0x1189('0x19')](handleError(_0x1332fe,null));};exports[_0x1189('0x7e')]=function(_0x54e340,_0x564b27){_0x54e340['body'][_0x1189('0x7f')]=_0x54e340['file']['filename'];return db[_0x1189('0x4d')][_0x1189('0x67')]({'where':{'id':_0x54e340[_0x1189('0x71')]['id']}})[_0x1189('0x25')](handleEntityNotFound(_0x564b27,null))[_0x1189('0x25')](saveUpdates(_0x54e340[_0x1189('0x69')],null))[_0x1189('0x25')](respondWithResult(_0x564b27,null))[_0x1189('0x19')](handleError(_0x564b27,null));};exports['addAvatar']=function(_0x32b5a2,_0x6e28ae){_0x32b5a2['body'][_0x1189('0x80')]=_0x32b5a2[_0x1189('0x81')][_0x1189('0x82')];return db[_0x1189('0x4d')]['find']({'where':{'id':_0x32b5a2['params']['id']}})[_0x1189('0x25')](handleEntityNotFound(_0x6e28ae,null))[_0x1189('0x25')](saveUpdates(_0x32b5a2[_0x1189('0x69')],null))[_0x1189('0x25')](respondWithResult(_0x6e28ae,null))[_0x1189('0x19')](handleError(_0x6e28ae,null));};exports['addCustomerAvatar']=function(_0x9c7915,_0x34e7dd){_0x9c7915['body'][_0x1189('0x83')]=_0x9c7915['file'][_0x1189('0x82')];return db['ChatWebsite'][_0x1189('0x67')]({'where':{'id':_0x9c7915[_0x1189('0x71')]['id']}})[_0x1189('0x25')](handleEntityNotFound(_0x34e7dd,null))['then'](saveUpdates(_0x9c7915['body'],null))['then'](respondWithResult(_0x34e7dd,null))[_0x1189('0x19')](handleError(_0x34e7dd,null));};exports[_0x1189('0x84')]=function(_0x12b70d,_0x1cb504){_0x12b70d['body']['systemAvatar']=_0x12b70d[_0x1189('0x81')][_0x1189('0x82')];return db[_0x1189('0x4d')][_0x1189('0x67')]({'where':{'id':_0x12b70d[_0x1189('0x71')]['id']}})[_0x1189('0x25')](handleEntityNotFound(_0x1cb504,null))['then'](saveUpdates(_0x12b70d['body'],null))[_0x1189('0x25')](respondWithResult(_0x1cb504,null))[_0x1189('0x19')](handleError(_0x1cb504,null));};exports[_0x1189('0x85')]=function(_0x4404c5,_0x56789d){var _0x4e9363=path['join'](config[_0x1189('0x86')],'server/files/images/logos/default_logo.svg');var _0x54a5eb={'where':{'id':_0x4404c5[_0x1189('0x71')]['id']},'attributes':['id',_0x1189('0x7f')],'raw':!![]};var _0x173519=![];return require('../../config/license/util')[_0x1189('0x87')]()['then'](function(_0x749aff){if(_0x749aff){_0x173519=_0x749aff[_0x1189('0x88')];}})[_0x1189('0x25')](function(){return db[_0x1189('0x4d')][_0x1189('0x67')](_0x54a5eb);})[_0x1189('0x25')](handleEntityNotFound(_0x56789d,null))[_0x1189('0x25')](function(_0x1ce9f2){if(_0x1ce9f2){if(!_[_0x1189('0x89')](_0x1ce9f2[_0x1189('0x7f')])){if(fs[_0x1189('0x8a')](path['join'](config[_0x1189('0x86')],_0x1189('0x8b'),_0x1ce9f2[_0x1189('0x7f')]))&&_0x173519){_0x4e9363=path[_0x1189('0x8c')](config[_0x1189('0x86')],_0x1189('0x8b'),_0x1ce9f2[_0x1189('0x7f')]);}}return _0x56789d[_0x1189('0x8d')](_0x4e9363);}})[_0x1189('0x19')](handleError(_0x56789d,null));};exports['getAvatar']=function(_0x57461c,_0x56c028){var _0x62e048=path[_0x1189('0x8c')](config[_0x1189('0x86')],_0x1189('0x8e'));var _0xecbb9={'where':{'id':_0x57461c[_0x1189('0x71')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x1189('0x4d')][_0x1189('0x67')](_0xecbb9)[_0x1189('0x25')](handleEntityNotFound(_0x56c028,null))[_0x1189('0x25')](function(_0x1d8f57){if(_0x1d8f57){if(!_[_0x1189('0x89')](_0x1d8f57[_0x1189('0x80')])){if(fs[_0x1189('0x8a')](path['join'](config[_0x1189('0x86')],_0x1189('0x8f'),_0x1d8f57[_0x1189('0x80')]))){_0x62e048=path['join'](config['root'],_0x1189('0x8f'),_0x1d8f57[_0x1189('0x80')]);}}return _0x56c028[_0x1189('0x8d')](_0x62e048);}})['catch'](handleError(_0x56c028,null));};exports[_0x1189('0x90')]=function(_0xc466e1,_0x156025){var _0x16f343=path['join'](config[_0x1189('0x86')],_0x1189('0x91'));var _0x2cf28a={'where':{'id':_0xc466e1[_0x1189('0x71')]['id']},'attributes':['id',_0x1189('0x83'),_0x1189('0x92')],'raw':!![]};return db[_0x1189('0x4d')]['find'](_0x2cf28a)['then'](handleEntityNotFound(_0x156025,null))[_0x1189('0x25')](function(_0xf00826){if(_0xf00826){if(!_[_0x1189('0x89')](_0xf00826[_0x1189('0x83')])){if(fs[_0x1189('0x8a')](path[_0x1189('0x8c')](config[_0x1189('0x86')],_0x1189('0x8f'),_0xf00826[_0x1189('0x83')]))&&_0xf00826['showCustomerAvatar']){_0x16f343=path['join'](config[_0x1189('0x86')],_0x1189('0x8f'),_0xf00826['customerAvatar']);}}return _0x156025[_0x1189('0x8d')](_0x16f343);}})['catch'](handleError(_0x156025,null));};exports[_0x1189('0x93')]=function(_0x2713b6,_0x1e9e7b){var _0x38100d=path[_0x1189('0x8c')](config[_0x1189('0x86')],'server/files/images/avatars/system_avatar.png');var _0x1fc965={'where':{'id':_0x2713b6['params']['id']},'attributes':['id',_0x1189('0x94')],'raw':!![]};return db[_0x1189('0x4d')][_0x1189('0x67')](_0x1fc965)['then'](handleEntityNotFound(_0x1e9e7b,null))['then'](function(_0x209548){if(_0x209548){if(!_[_0x1189('0x89')](_0x209548['systemAvatar'])){if(fs[_0x1189('0x8a')](path['join'](config[_0x1189('0x86')],_0x1189('0x8f'),_0x209548[_0x1189('0x94')]))){_0x38100d=path[_0x1189('0x8c')](config[_0x1189('0x86')],_0x1189('0x8f'),_0x209548[_0x1189('0x94')]);}}return _0x1e9e7b[_0x1189('0x8d')](_0x38100d);}})[_0x1189('0x19')](handleError(_0x1e9e7b,null));};exports[_0x1189('0x95')]=function(_0x52c0bd,_0x3b2f3a){var _0x4fb85d={'body':_0x52c0bd[_0x1189('0x69')],'channel':_0x1189('0x96')};var _0x4055fa=[];var _0x8260aa=[];var _0x331352={};var _0xdded7e=![];return db[_0x1189('0x97')][_0x1189('0x72')]()['then'](function(_0x2ba20c){if(!_0x2ba20c){throw new db[(_0x1189('0x98'))]['ValidationError']('no\x20available\x20attributes');}_0x4055fa=_['difference'](_[_0x1189('0x51')](_0x2ba20c),[_0x1189('0x99'),'updatedAt']);_0x8260aa=_[_0x1189('0x9a')](_[_0x1189('0x51')](_0x2ba20c),['createdAt',_0x1189('0x9b'),_0x1189('0x9c'),_0x1189('0x9d')]);if(_0x52c0bd[_0x1189('0x69')]['id']){delete _0x52c0bd[_0x1189('0x69')]['id'];}if(_[_0x1189('0x89')](_0x52c0bd[_0x1189('0x69')][_0x1189('0x9e')])){throw new db[(_0x1189('0x98'))][(_0x1189('0x9f'))]('from\x20is\x20mandatory');}if(_[_0x1189('0x89')](_0x52c0bd[_0x1189('0x69')][_0x1189('0x69')])||_0x52c0bd[_0x1189('0x69')][_0x1189('0x69')]===''){throw new db['Sequelize'][(_0x1189('0x9f'))](_0x1189('0xa0'));}if(_[_0x1189('0x89')](_0x52c0bd[_0x1189('0x69')][_0x1189('0xa1')])){throw new db[(_0x1189('0x98'))][(_0x1189('0x9f'))](_0x1189('0xa2')+_0x8260aa);}if(!_['includes'](_0x8260aa,_0x52c0bd[_0x1189('0x69')][_0x1189('0xa1')])){throw new db[(_0x1189('0x98'))][(_0x1189('0x9f'))](_0x1189('0xa3')+_0x8260aa);}_0x331352[_0x52c0bd[_0x1189('0x69')][_0x1189('0xa1')]]=_0x52c0bd[_0x1189('0x69')][_0x1189('0x9e')];})['then'](function(){return db[_0x1189('0x4d')][_0x1189('0x67')]({'where':{'id':_0x52c0bd[_0x1189('0x71')]['id']},'include':[{'model':db['CmList'],'as':_0x1189('0xa4'),'include':[{'model':db[_0x1189('0x97')],'as':_0x1189('0xa5'),'where':_0x331352,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x1189('0xa6')],'as':_0x1189('0xa7')},{'model':db['Interval'],'as':_0x1189('0x37'),'include':[{'model':db['Interval'],'as':_0x1189('0x38'),'attributes':['id','interval'],'raw':!![]}]}]});})['then'](function(_0x466e25){if(!_0x466e25)throw new APINotFoundError(util[_0x1189('0x2e')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x52c0bd['params']['id']));if(!_0x466e25[_0x1189('0x37')]||!_0x466e25[_0x1189('0x37')]['Intervals'])return[_0x466e25,!![]];return[_0x466e25,checkWebsiteIntervals(_0x466e25)];})['spread'](function(_0x1a57a3,_0x949fc1){if(!_0x949fc1)throw new APIOutOfIntervalError();if(!_0x1a57a3['List'])return;_0x4fb85d['account']=_0x1a57a3;_0x4fb85d['list']=_0x1a57a3[_0x1189('0xa4')];_0x4fb85d[_0x1189('0xa8')]=_[_0x1189('0xa9')](_0x1a57a3[_0x1189('0xa7')],[_0x1189('0xaa')],[_0x1189('0xab')]);if(_0x4fb85d['account'][_0x1189('0xa7')]){delete _0x4fb85d[_0x1189('0xac')][_0x1189('0xa7')];}if(_0x4fb85d['account'][_0x1189('0xa4')]&&_0x4fb85d[_0x1189('0xac')][_0x1189('0xa4')][_0x1189('0xa5')][_0x1189('0x57')]){return _0x4fb85d['account'][_0x1189('0xa4')][_0x1189('0xa5')][0x0];}var _0x2cdf36=_[_0x1189('0xad')](_0x52c0bd[_0x1189('0x69')],{'firstName':_0x52c0bd['body'][_0x1189('0x9e')],'ListId':_0x1a57a3[_0x1189('0x9d')]});_0x2cdf36[_0x52c0bd[_0x1189('0x69')]['mapKey']]=_0x52c0bd[_0x1189('0x69')]['from'];return db[_0x1189('0x97')][_0x1189('0x68')](_0x2cdf36,{'fields':_0x4055fa,'raw':!![]});})['then'](function(_0x520737){_0x4fb85d[_0x1189('0xae')]=_0x520737;var _0x437aa1=createInteractionObject(_0x52c0bd['params']['id'],_0x52c0bd[_0x1189('0x69')],_0x52c0bd[_0x1189('0xaf')],_0x520737);var _0x38663e={'ChatWebsiteId':_0x52c0bd['params']['id'],'closed':![]};if(_0x52c0bd[_0x1189('0x69')][_0x1189('0xb0')]){_0x38663e['threadId']=_0x52c0bd[_0x1189('0x69')][_0x1189('0xb0')];return db[_0x1189('0xb1')][_0x1189('0x67')]({'where':_0x38663e})[_0x1189('0x25')](function(_0x4d06a6){if(_0x4d06a6){_0xdded7e=!![];return _0x4d06a6;}_0x437aa1[_0x1189('0xb0')]=_0x52c0bd[_0x1189('0x69')][_0x1189('0xb0')];_0x437aa1['externalUrl']=_0x52c0bd['body'][_0x1189('0xb2')];return db[_0x1189('0xb1')]['create'](_0x437aa1);});}_0x38663e['ContactId']=_0x520737['id'];if(_0x52c0bd[_0x1189('0x69')]['interaction']&&_0x52c0bd['body']['interaction']['id']){_0x38663e['id']=_0x52c0bd['body'][_0x1189('0xb3')]['id'];return db[_0x1189('0xb1')][_0x1189('0x67')]({'where':_0x38663e})[_0x1189('0x25')](function(_0x324011){if(_0x324011){_0xdded7e=!![];return _0x324011;}return db['ChatInteraction'][_0x1189('0x68')](_0x437aa1);});}return db['ChatInteraction'][_0x1189('0x68')](_0x437aa1);})[_0x1189('0x25')](function(_0x5e1646){if(!_0xdded7e)return _0x5e1646;var _0x3678ea={'from':(_0x4fb85d['contact'][_0x1189('0x3e')]||'')+'\x20'+(_0x4fb85d['contact'][_0x1189('0x3f')]||'')};if(_0x52c0bd[_0x1189('0x69')]['threadId']&&_0x52c0bd[_0x1189('0x69')]['messageId']&&_0x52c0bd['body'][_0x1189('0xb0')]!=_0x52c0bd[_0x1189('0x69')][_0x1189('0xb4')]){_0x3678ea[_0x1189('0xb0')]=_0x52c0bd[_0x1189('0x69')][_0x1189('0xb4')];}return _0x5e1646[_0x1189('0x24')](_0x3678ea);})[_0x1189('0x25')](function(_0x25d79b){_0x4fb85d[_0x1189('0xb3')]=_0x25d79b[_0x1189('0x26')]({'plain':!![]});_0x4fb85d[_0x1189('0xb3')]['created']=!_0xdded7e;if(_0x4fb85d[_0x1189('0xb3')][_0x1189('0xb5')]){if(_0x4fb85d[_0x1189('0xac')][_0x1189('0xb6')]){_0x4fb85d['applications']['push']({'id':0x0,'priority':_0x4fb85d[_0x1189('0xa8')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0x1189('0xb7')});}}return db[_0x1189('0xb8')]['create']({'body':_0x52c0bd['body'][_0x1189('0x69')],'ChatWebsiteId':_0x52c0bd[_0x1189('0x71')]['id'],'ChatInteractionId':_0x25d79b['id'],'direction':'in','ContactId':_0x4fb85d[_0x1189('0xae')]['id'],'AttachmentId':_0x52c0bd[_0x1189('0x69')][_0x1189('0xb9')]});})['then'](function(_0xe138eb){_0x4fb85d['message']=_0xe138eb;if(!_0x4fb85d[_0x1189('0xb3')][_0x1189('0xba')]){return;}return db[_0x1189('0xbb')][_0x1189('0x67')]({'attributes':['id',_0x1189('0x2a')],'where':{'id':_0x4fb85d[_0x1189('0xb3')][_0x1189('0xba')]}});})[_0x1189('0x25')](function(_0x41f936){if(_0x41f936){_0x4fb85d[_0x1189('0xa8')][_0x1189('0xbc')]({'id':0x0,'priority':0x0,'app':_0x1189('0xbd'),'appdata':_0x41f936[_0x1189('0x2a')]+','+(_0x4fb85d['account']['waitForTheAssignedAgent']||0xa),'interval':_0x1189('0xb7')});_0x4fb85d[_0x1189('0xbe')]=!![];}if(!_0x4fb85d[_0x1189('0xb3')]['queueId']){return;}return db[_0x1189('0xbf')][_0x1189('0x67')]({'attributes':['id','name'],'where':{'id':_0x4fb85d[_0x1189('0xb3')]['queueId']}});})[_0x1189('0x25')](function(_0xc40cc9){if(_0xc40cc9){_0x4fb85d['applications'][_0x1189('0xbc')]({'id':0x0,'priority':0x1,'app':_0x1189('0xc0'),'appdata':_0xc40cc9['name']+','+(_0x4fb85d[_0x1189('0xac')][_0x1189('0xc1')]||0x12c),'interval':_0x1189('0xb7')});}return respondWithRpcPromise(_0x1189('0xc2'),_0x1189('0xc3'),_0x4fb85d);})[_0x1189('0x25')](function(_0x340c39){respondWithRpcPromise(_0x1189('0xc4'),_0x1189('0xc4'),{'event':_0x1189('0x95'),'message':_0x340c39},client9002);return _0x340c39;})[_0x1189('0x25')](respondWithResult(_0x3b2f3a,null))['catch'](APIHandleError(_0x3b2f3a));};exports[_0x1189('0xc5')]=function(_0x4bf96e,_0x2d9bf3){var _0xfbf9c4,_0x34942b,_0x4e96a7;var _0x4a8479=[];var _0x1063fb={};var _0x4a7cea=_0x4bf96e[_0x1189('0xc6')]||[];var _0x3233e5=[];var _0x5938d1;return db[_0x1189('0x97')][_0x1189('0x72')]()[_0x1189('0x25')](function(_0x3a89d6){if(!_0x3a89d6){throw new db['Sequelize'][(_0x1189('0x9f'))](_0x1189('0xc7'));}_0x4a8479=_['difference'](_[_0x1189('0x51')](_0x3a89d6),[_0x1189('0x99'),'updatedAt','CompanyId','ListId']);if(_0x4bf96e[_0x1189('0x69')]['id']){delete _0x4bf96e[_0x1189('0x69')]['id'];}if(_[_0x1189('0x89')](_0x4bf96e[_0x1189('0x69')][_0x1189('0x9e')])){throw _0x2d9bf3[_0x1189('0x1b')](0x1f4)[_0x1189('0x2b')](new db[(_0x1189('0x98'))][(_0x1189('0x9f'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x4bf96e[_0x1189('0x69')][_0x1189('0x69')])||_0x4bf96e['body'][_0x1189('0x69')]===''){throw _0x2d9bf3[_0x1189('0x1b')](0x1f4)[_0x1189('0x2b')](new db[(_0x1189('0x98'))][(_0x1189('0x9f'))](_0x1189('0xa0')));}if(_['isNil'](_0x4bf96e[_0x1189('0x69')]['mapKeyOffline'])){throw _0x2d9bf3[_0x1189('0x1b')](0x1f4)['send'](new db[(_0x1189('0x98'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4a8479));}if(!_[_0x1189('0xc8')](_0x4a8479,_0x4bf96e[_0x1189('0x69')][_0x1189('0xc9')])){throw _0x2d9bf3['status'](0x1f4)['send'](new db['Sequelize']['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4a8479));}_0x1063fb[_0x4bf96e[_0x1189('0x69')][_0x1189('0xc9')]]=_0x4bf96e[_0x1189('0x69')][_0x1189('0x9e')];})['then'](function(){return db[_0x1189('0x4d')]['find']({'where':{'id':_0x4bf96e[_0x1189('0x71')]['id']},'include':[{'model':db[_0x1189('0xca')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x1189('0x25')](handleEntityNotFound(_0x2d9bf3,null))['then'](function(_0x41b167){if(_0x41b167&&_0x41b167['List']){_0x34942b=_0x41b167;var _0x31a6e5=_[_0x1189('0xad')](_0x4bf96e[_0x1189('0x69')],{'firstName':_0x4bf96e[_0x1189('0x69')][_0x1189('0x9e')],'phone':_0x4bf96e[_0x1189('0x69')][_0x1189('0x9e')],'ListId':_0x41b167[_0x1189('0x9d')]});_0x31a6e5[_0x4bf96e['body']['mapKeyOffline']]=_0x4bf96e['body'][_0x1189('0x9e')];return db['CmContact']['findOrCreate']({'where':_0x1063fb,'defaults':_0x31a6e5});}})[_0x1189('0xcb')](function(_0x5dc3c8){if(_0x5dc3c8){_0x4e96a7=_0x5dc3c8;var _0x254573=fs['readFileSync'](path[_0x1189('0x8c')](config[_0x1189('0x86')],_0x1189('0xcc')),_0x1189('0xcd'));var _0x46fdb4=ejs[_0x1189('0xce')](_0x254573,{'body':_['toPairs'](_0x4bf96e['body']['body']),'bodyTitle':_0x34942b[_0x1189('0xcf')]});return db[_0x1189('0xd0')]['create']({'body':_0x46fdb4,'plainBody':htmlToText[_0x1189('0xd1')](_0x46fdb4),'ContactId':_0x5dc3c8['id'],'ChatWebsiteId':_0x34942b['id']});}})[_0x1189('0x25')](function(_0x5b2383){_0x5938d1=_0x5b2383;if(_0x4a7cea[_0x1189('0x57')]){var _0x324b29=_0x4a7cea[_0x1189('0x36')](function(_0x2b3656){return{'name':_0x2b3656[_0x1189('0xd2')],'basename':_0x2b3656[_0x1189('0x82')],'type':_0x2b3656['mimetype'],'ChatOfflineMessageId':_0x5b2383['id']};});_0x3233e5=_0x324b29[_0x1189('0x36')](_0x4897ef=>{var _0x36e8ec={'filename':_0x4897ef[_0x1189('0x2a')],'path':path[_0x1189('0x8c')](config[_0x1189('0x86')],'server',_0x1189('0xc6'),_0x1189('0xd3'),_0x1189('0xd4'),_0x4897ef['basename'])};return _0x36e8ec;});if(!_0x34942b['openNewInteraction']){return db[_0x1189('0xd5')]['transaction'](function(_0x5a2f5c){return db[_0x1189('0xd6')]['bulkCreate'](_0x324b29,{'transaction':_0x5a2f5c});});}}})['then'](function(){if(_0x5938d1){_0xfbf9c4=_0x5938d1;return db[_0x1189('0xd7')][_0x1189('0x74')]({'where':{'service':!![]},'include':[{'model':db[_0x1189('0xd8')],'as':_0x1189('0xd9'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x1189('0xda'),'raw':!![]}]}]});}})['then'](function(_0x41faae){if(_0x41faae&&_0x41faae['Smtp']&&_0x34942b[_0x1189('0xdb')]&&_0x34942b[_0x1189('0xdc')]){var _0x1d0dc5=_0x41faae[_0x1189('0xdd')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x1d0dc5,'message':{'from':util['format'](_0x1189('0xde'),_0x41faae[_0x1189('0x2a')],_0x41faae[_0x1189('0xdf')]||_0x41faae[_0x1189('0xd9')][_0x1189('0x6a')]),'to':_0x34942b[_0x1189('0xdc')],'subject':_0x34942b[_0x1189('0xe0')],'html':_0xfbf9c4[_0x1189('0x69')],'attachments':_0x3233e5}},client9003)[_0x1189('0x25')](function(){return _0xfbf9c4;})[_0x1189('0x19')](function(_0x22242f){logger[_0x1189('0x16')](_0x22242f);});}})[_0x1189('0x25')](function(){if(_0x34942b&&_0x34942b[_0x1189('0xe1')]&&_0x34942b[_0x1189('0xe2')]){var _0x2396be=[];if(_0x4a7cea[_0x1189('0x57')]){_0x2396be=_0x4a7cea['map'](function(_0x1efe0d){return{'name':_0x1efe0d[_0x1189('0xd2')],'basename':_0x1efe0d[_0x1189('0x82')],'type':_0x1efe0d[_0x1189('0xe3')],'ChatOfflineMessageId':_0x5938d1['id']};});}var _0x4c0000;if(!_[_0x1189('0x89')](_0x34942b['subjectOffline'])){var _0x1c868f=_[_0x1189('0x36')](_0x4bf96e[_0x1189('0x69')],function(_0x32c255){return _0x32c255;});var _0xf22b0d=_[_0x1189('0xe4')](_0x1c868f)[0x0];var _0x57c611=_[_0x1189('0xe5')](_0xf22b0d,function(_0x2df513){return _0x2df513;});_0x4c0000=_0x57c611[0x1][_0x34942b[_0x1189('0xe6')]];}var _0x91131a={'from':_0x4e96a7[_0x1189('0xdf')],'firstName':_0x4e96a7[_0x1189('0x3e')],'lastName':_0x4e96a7[_0x1189('0x3f')],'mapKey':_0x1189('0xdf'),'message':{'from':_0x4e96a7[_0x1189('0xdf')],'to':_0x34942b[_0x1189('0xd7')][_0x1189('0xdf')],'cc':'','subject':_[_0x1189('0x89')](_0x4c0000)?_0x34942b['offlineMessageSubject']:_0x4c0000,'messageId':'','sentAt':new Date(),'attach':_0x2396be[_0x1189('0x57')],'attachments':_0x2396be,'originChannel':_0x1189('0xe7'),'ChatWebsiteId':_0x34942b['id'],'ChatOfflineMessageId':_0xfbf9c4['id'],'originTo':_0x34942b[_0x1189('0xd7')][_0x1189('0xdf')]},'body':_0xfbf9c4['body']};var _0x39ec9a={'account':{'id':_0x34942b[_0x1189('0xe2')]},'body':_0x91131a,'log':_0x1189('0xe8')};return respondWithRpcPromise(_0x1189('0xe8'),_0x1189('0xe9'),_0x39ec9a,client9001)['then'](function(){return _0xfbf9c4;})['catch'](function(_0x11b4e9){logger[_0x1189('0x16')](_0x11b4e9);});}return;})[_0x1189('0x25')](function(){if(_0xfbf9c4){return _0xfbf9c4;}})[_0x1189('0x25')](respondWithResult(_0x2d9bf3,null))[_0x1189('0x19')](function(){for(var _0x185bed of _0x4a7cea){var _0x2bc74f=path['join'](config[_0x1189('0x86')],_0x1189('0xea'),_0x1189('0xc6'),_0x1189('0xd3'),_0x1189('0xd4'),_0x185bed[_0x1189('0x82')]);fs_extra['remove'](_0x2bc74f)[_0x1189('0x19')](function(_0x2b670c){logger[_0x1189('0x16')]('Could\x20not\x20remove\x20attachment\x20file',_0x2bc74f,_0x2b670c);});}});};exports['addInteraction']=function(_0x57b0d8,_0x2a31f1){return db['ChatInteraction'][_0x1189('0x67')]({'where':{'id':_0x57b0d8[_0x1189('0x71')]['id']}})[_0x1189('0x25')](handleEntityNotFound(_0x2a31f1,null))[_0x1189('0x25')](function(_0x58a29d){if(_0x58a29d){return _0x58a29d[_0x1189('0xeb')](_0x57b0d8[_0x1189('0x69')]['ids'],_[_0x1189('0xec')](_0x57b0d8[_0x1189('0x69')],[_0x1189('0x7d'),'id'])||{});}})[_0x1189('0x25')](respondWithResult(_0x2a31f1,null))[_0x1189('0x19')](handleError(_0x2a31f1,null));};exports[_0x1189('0xed')]=function(_0x1a7ab4,_0x19b703){var _0x4fda9f={'raw':![],'where':{}};var _0x3f5b44={};var _0x287a6c={'count':0x0,'rows':[]};return db[_0x1189('0x4d')][_0x1189('0x74')]({'where':{'id':_0x1a7ab4[_0x1189('0x71')]['id']}})[_0x1189('0x25')](handleEntityNotFound(_0x19b703,null))[_0x1189('0x25')](function(_0x3a514d){if(_0x3a514d){_0x3f5b44[_0x1189('0x46')]=_[_0x1189('0x51')](db[_0x1189('0xb1')]['rawAttributes']);_0x3f5b44[_0x1189('0x52')]=_[_0x1189('0x51')](_0x1a7ab4[_0x1189('0x52')]);_0x3f5b44[_0x1189('0x53')]=_['intersection'](_0x3f5b44[_0x1189('0x46')],_0x3f5b44[_0x1189('0x52')]);_0x4fda9f[_0x1189('0x54')]=_['intersection'](_0x3f5b44['model'],qs[_0x1189('0x56')](_0x1a7ab4['query'][_0x1189('0x56')]));_0x4fda9f[_0x1189('0x54')]=_0x4fda9f['attributes'][_0x1189('0x57')]?_0x4fda9f[_0x1189('0x54')]:_0x3f5b44['model'];if(!_0x1a7ab4[_0x1189('0x52')][_0x1189('0x75')](_0x1189('0x58'))){_0x4fda9f[_0x1189('0x1f')]=qs['limit'](_0x1a7ab4['query'][_0x1189('0x1f')]);_0x4fda9f['offset']=qs[_0x1189('0x1d')](_0x1a7ab4[_0x1189('0x52')][_0x1189('0x1d')]);}_0x4fda9f['order']=qs['sort'](_0x1a7ab4[_0x1189('0x52')][_0x1189('0x5a')]);_0x4fda9f[_0x1189('0x5e')]=qs['filters'](_[_0x1189('0x5b')](_0x1a7ab4[_0x1189('0x52')],_0x3f5b44[_0x1189('0x53')]));_0x4fda9f[_0x1189('0x5e')][_0x1189('0x76')]=_0x3a514d['id'];if(_0x1a7ab4[_0x1189('0x52')]['filter']){_0x4fda9f[_0x1189('0x5e')]=_[_0x1189('0x5d')](_0x4fda9f[_0x1189('0x5e')],{'$or':_[_0x1189('0x36')](_0x4fda9f[_0x1189('0x54')],function(_0x1c384a){var _0x5cd3fe={};_0x5cd3fe[_0x1c384a]={'$like':'%'+_0x1a7ab4[_0x1189('0x52')][_0x1189('0x5c')]+'%'};return _0x5cd3fe;})});}_0x4fda9f=_[_0x1189('0x5d')]({},_0x4fda9f,_0x1a7ab4[_0x1189('0x66')]);return db['ChatInteraction'][_0x1189('0x20')]({'where':_0x4fda9f[_0x1189('0x5e')]})[_0x1189('0x25')](function(_0x516215){_0x287a6c[_0x1189('0x20')]=_0x516215;if(_0x1a7ab4[_0x1189('0x52')][_0x1189('0x60')]){_0x4fda9f['include']=[{'model':db[_0x1189('0x97')],'as':_0x1189('0xee'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x1189('0xef'),_0x1189('0xf0')],'required':![]},{'model':db[_0x1189('0xf1')],'as':_0x1189('0xf2'),'attributes':['id',_0x1189('0x2a'),'color'],'where':_0x1a7ab4[_0x1189('0x52')][_0x1189('0xf3')]?{'id':_0x1a7ab4['query'][_0x1189('0xf3')]}:undefined,'required':_0x1a7ab4[_0x1189('0x52')]['tag']?!![]:![]}];}return db[_0x1189('0xb1')][_0x1189('0x62')](_0x4fda9f);})[_0x1189('0x25')](function(_0x2f4e1b){_0x287a6c[_0x1189('0x63')]=_0x2f4e1b;return _0x287a6c;});}})[_0x1189('0x25')](respondWithFilteredResult(_0x19b703,_0x4fda9f))[_0x1189('0x19')](handleError(_0x19b703,null));};exports[_0x1189('0x2c')]=function(_0x2f2544,_0x38013f){var _0x2a4a83=0x0;var _0x56ce74=0x0;var _0x412faa=![];var _0x522d45;var _0x1af055;return db['ChatWebsite'][_0x1189('0x67')]({'where':{'id':_0x2f2544['params']['id']},'include':[{'model':db[_0x1189('0x37')],'as':_0x1189('0x37'),'include':[{'model':db[_0x1189('0x37')],'as':_0x1189('0x38'),'attributes':['id',_0x1189('0x30')]}]}]})[_0x1189('0x25')](handleEntityNotFound(_0x38013f,null))[_0x1189('0x25')](function(_0x5ed2e6){if(_0x5ed2e6){_0x522d45=_0x5ed2e6;return _0x5ed2e6[_0x1189('0xf4')]({'raw':!![]});}})['then'](function(_0x22d0bf){if(_0x522d45){if(_0x22d0bf){_0x1af055=_0x22d0bf;}}return require(_0x1189('0xf5'))[_0x1189('0x87')]();})[_0x1189('0x25')](function(_0x488225){if(_0x488225){_0x56ce74=_0x488225['virtual'];_0x412faa=_0x488225[_0x1189('0x88')];}})['then'](function(){return db[_0x1189('0xb1')][_0x1189('0x20')]({'where':{'closed':![]}});})[_0x1189('0x25')](function(_0x5d42bb){_0x2a4a83=_0x5d42bb;if(_0x56ce74&&_0x5d42bb>_0x56ce74){return db[_0x1189('0xf6')][_0x1189('0x74')]({'where':{'id':0x1}})[_0x1189('0x25')](function(_0xa5ebe6){if(_0xa5ebe6){_0xa5ebe6['increment'](_0x1189('0xf7'));}});}})['then'](function(){if(!_0x522d45[_0x1189('0x37')]||!_0x522d45[_0x1189('0x37')][_0x1189('0x38')])return!![];return checkWebsiteIntervals(_0x522d45);})[_0x1189('0x25')](function(_0x3c316f){var _0x476825=fs[_0x1189('0xf8')](path[_0x1189('0x8c')](config[_0x1189('0x86')],'server/files/chat/iframe.ejs'),_0x1189('0xcd'));var _0x22229d=new url[(_0x1189('0xf9'))](_0x522d45[_0x1189('0xfa')])['origin'];var _0x4254b1=_0x1189('0xfb');var _0x299ca5=![];var _0x18afb1={'chatVersion':_0x4254b1,'chatWebsiteAddressOrigin':_0x22229d,'remote':_0x522d45[_0x1189('0xfc')],'query':querystring[_0x1189('0x4a')](_[_0x1189('0x5d')](_0x522d45[_0x1189('0x26')]({'plain':!![]}),{'customerIp':_0x2f2544['headers'][_0x1189('0xfd')]||_0x2f2544[_0x1189('0xaf')]['x-real-ip']||_0x2f2544[_0x1189('0xfe')]['remoteAddress']||_0x2f2544['ip'],'referer':_0x2f2544[_0x1189('0xaf')][_0x1189('0xff')],'openedInteractions':_0x2a4a83,'maxInteractions':_0x56ce74,'virtual':_0x412faa[_0x1189('0x100')],'online':_0x3c316f,'custom':_0x412faa}))[_0x1189('0x101')](/'/g,'\x5c\x27')};_0x38013f[_0x1189('0x2b')](ejs[_0x1189('0xce')](Mustache[_0x1189('0xce')](_0x476825,_0x18afb1),{'proactiveActions':_0x1af055,'alignment':_0x522d45[_0x1189('0x102')],'verticalAlignment':_0x522d45[_0x1189('0x103')],'div_color':_0x522d45[_0x1189('0x104')],'labelText':_0x522d45['labelText'],'text_color':_0x522d45[_0x1189('0x105')],'text_button_color':_0x522d45['textButtonColor'],'button_color':_0x522d45[_0x1189('0x106')],'background_color':_0x522d45[_0x1189('0x107')],'hideWhenOffline':_0x522d45[_0x1189('0x108')],'intervalId':_0x522d45[_0x1189('0x109')],'isDevelopment':_0x299ca5,'chatVersion':_0x4254b1}));})[_0x1189('0x19')](handleError(_0x38013f,null));};exports[_0x1189('0x10a')]=function(_0x3d25a4,_0x4d2bea){var _0x3a3dd8=_0x3d25a4[_0x1189('0x71')]['id'];var _0x406f0f=_0x3d25a4[_0x1189('0x69')];var _0x5e5db6=0xc8;var _0x35dd09=null;return db[_0x1189('0xd5')][_0x1189('0x10b')]({'isolationLevel':db['sequelize'][_0x1189('0x10c')]['ISOLATION_LEVELS'][_0x1189('0x10d')]},function(_0x3c821d){return db[_0x1189('0x4d')][_0x1189('0x74')]({'where':{'id':_0x3a3dd8},'transaction':_0x3c821d})[_0x1189('0x25')](function(_0x3aa346){if(_0x3aa346){return db[_0x1189('0xa6')][_0x1189('0x28')]({'where':{'ChatWebsiteId':_0x3a3dd8},'transaction':_0x3c821d})[_0x1189('0x25')](function(){var _0x51e8bb=_[_0x1189('0x36')](_0x406f0f,function(_0x43c375){_0x43c375[_0x1189('0x76')]=_0x3a3dd8;return _0x43c375;});return db['ChatApplication']['bulkCreate'](_0x51e8bb,{'transaction':_0x3c821d});});}else{_0x5e5db6=0x194;_0x35dd09=[];}});})[_0x1189('0x25')](function(){if(_0x5e5db6!==0x194){return db[_0x1189('0xa6')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x3a3dd8},'order':_0x1189('0xaa')})[_0x1189('0x25')](function(_0x35ee35){_0x35dd09=_0x35ee35;});}})[_0x1189('0x19')](function(_0x81ab58){_0x5e5db6=0x1f4;logger[_0x1189('0x16')](_0x81ab58[_0x1189('0x29')]);if(_0x81ab58[_0x1189('0x2a')]){delete _0x81ab58[_0x1189('0x2a')];}_0x35dd09=_0x81ab58;})[_0x1189('0x10e')](function(){if(_0x35dd09===null){_0x4d2bea[_0x1189('0x1a')](_0x5e5db6);}else{if(_0x5e5db6===0x1f4){_0x4d2bea[_0x1189('0x1b')](_0x5e5db6)[_0x1189('0x2b')](_0x35dd09);}else{_0x4d2bea[_0x1189('0x1b')](_0x5e5db6)[_0x1189('0x23')](_0x35dd09);}}});};exports['getApplications']=function(_0x478d1c,_0x3cefe8){var _0xc098da={};var _0x36fe72={};var _0x5e542a;var _0x50f884;return db[_0x1189('0x4d')]['findOne']({'where':{'id':_0x478d1c[_0x1189('0x71')]['id']}})[_0x1189('0x25')](handleEntityNotFound(_0x3cefe8,null))[_0x1189('0x25')](function(_0x4029fc){if(_0x4029fc){_0x5e542a=_0x4029fc;_0x36fe72[_0x1189('0x46')]=_[_0x1189('0x51')](db[_0x1189('0xa6')]['rawAttributes']);_0x36fe72[_0x1189('0x52')]=_[_0x1189('0x51')](_0x478d1c[_0x1189('0x52')]);_0x36fe72[_0x1189('0x53')]=_[_0x1189('0x55')](_0x36fe72['model'],_0x36fe72[_0x1189('0x52')]);_0xc098da[_0x1189('0x54')]=_[_0x1189('0x55')](_0x36fe72[_0x1189('0x46')],qs[_0x1189('0x56')](_0x478d1c[_0x1189('0x52')][_0x1189('0x56')]));_0xc098da[_0x1189('0x54')]=_0xc098da[_0x1189('0x54')][_0x1189('0x57')]?_0xc098da[_0x1189('0x54')]:_0x36fe72[_0x1189('0x46')];_0xc098da[_0x1189('0x59')]=qs[_0x1189('0x5a')](_0x478d1c[_0x1189('0x52')]['sort']);_0xc098da['where']=qs[_0x1189('0x53')](_[_0x1189('0x5b')](_0x478d1c[_0x1189('0x52')],_0x36fe72['filters']));if(_0x478d1c[_0x1189('0x52')][_0x1189('0x5c')]){_0xc098da[_0x1189('0x5e')]=_[_0x1189('0x5d')](_0xc098da[_0x1189('0x5e')],{'$or':_['map'](_0xc098da[_0x1189('0x54')],function(_0x267cc2){var _0x2d4a2a={};_0x2d4a2a[_0x267cc2]={'$like':'%'+_0x478d1c[_0x1189('0x52')][_0x1189('0x5c')]+'%'};return _0x2d4a2a;})});}_0xc098da=_[_0x1189('0x5d')]({},_0xc098da,_0x478d1c[_0x1189('0x66')]);return _0x5e542a[_0x1189('0x10f')](_0xc098da);}})[_0x1189('0x25')](function(_0x1b49c3){if(_0x1b49c3){_0x50f884=_0x1b49c3['length'];if(!_0x478d1c[_0x1189('0x52')]['hasOwnProperty'](_0x1189('0x58'))){_0xc098da[_0x1189('0x1f')]=qs[_0x1189('0x1f')](_0x478d1c['query'][_0x1189('0x1f')]);_0xc098da[_0x1189('0x1d')]=qs['offset'](_0x478d1c[_0x1189('0x52')][_0x1189('0x1d')]);}return _0x5e542a[_0x1189('0x10f')](_0xc098da);}})[_0x1189('0x25')](function(_0x13c6a6){if(_0x13c6a6){return _0x13c6a6?{'count':_0x50f884,'rows':_0x13c6a6}:null;}})[_0x1189('0x25')](respondWithResult(_0x3cefe8,null))[_0x1189('0x19')](handleError(_0x3cefe8,null));};exports[_0x1189('0x110')]=function(_0x224d5c,_0x576540){return db[_0x1189('0x111')][_0x1189('0x67')]({'where':{'id':_0x224d5c[_0x1189('0x71')]['id']}})['then'](handleEntityNotFound(_0x576540,null))['then'](function(_0x3b8ee7){if(_0x3b8ee7){return _0x3b8ee7[_0x1189('0x110')](_0x224d5c[_0x1189('0x69')][_0x1189('0x7d')],_[_0x1189('0xec')](_0x224d5c[_0x1189('0x69')],[_0x1189('0x7d'),'id'])||{});}})['then'](respondWithResult(_0x576540,null))['catch'](handleError(_0x576540,null));};exports[_0x1189('0xf4')]=function(_0x23d916,_0xbd28e){var _0x32ac95={};var _0x2948aa={};var _0x1b75aa;var _0x5d09a1;return db['ChatWebsite']['findOne']({'where':{'id':_0x23d916[_0x1189('0x71')]['id']}})[_0x1189('0x25')](handleEntityNotFound(_0xbd28e,null))[_0x1189('0x25')](function(_0x823604){if(_0x823604){_0x1b75aa=_0x823604;_0x2948aa[_0x1189('0x46')]=_[_0x1189('0x51')](db[_0x1189('0x112')][_0x1189('0x4e')]);_0x2948aa[_0x1189('0x52')]=_[_0x1189('0x51')](_0x23d916[_0x1189('0x52')]);_0x2948aa[_0x1189('0x53')]=_[_0x1189('0x55')](_0x2948aa[_0x1189('0x46')],_0x2948aa[_0x1189('0x52')]);_0x32ac95[_0x1189('0x54')]=_[_0x1189('0x55')](_0x2948aa[_0x1189('0x46')],qs[_0x1189('0x56')](_0x23d916[_0x1189('0x52')]['fields']));_0x32ac95[_0x1189('0x54')]=_0x32ac95[_0x1189('0x54')][_0x1189('0x57')]?_0x32ac95['attributes']:_0x2948aa['model'];_0x32ac95['order']=qs[_0x1189('0x5a')](_0x23d916['query'][_0x1189('0x5a')]);_0x32ac95[_0x1189('0x5e')]=qs[_0x1189('0x53')](_['pick'](_0x23d916['query'],_0x2948aa[_0x1189('0x53')]));if(_0x23d916['query'][_0x1189('0x5c')]){_0x32ac95[_0x1189('0x5e')]=_[_0x1189('0x5d')](_0x32ac95[_0x1189('0x5e')],{'$or':_[_0x1189('0x36')](_0x32ac95['attributes'],function(_0x10c810){var _0x36655c={};_0x36655c[_0x10c810]={'$like':'%'+_0x23d916['query']['filter']+'%'};return _0x36655c;})});}_0x32ac95=_[_0x1189('0x5d')]({},_0x32ac95,_0x23d916[_0x1189('0x66')]);return _0x1b75aa[_0x1189('0xf4')](_0x32ac95);}})[_0x1189('0x25')](function(_0x33e8b4){if(_0x33e8b4){_0x5d09a1=_0x33e8b4[_0x1189('0x57')];if(!_0x23d916[_0x1189('0x52')][_0x1189('0x75')](_0x1189('0x58'))){_0x32ac95[_0x1189('0x1f')]=qs[_0x1189('0x1f')](_0x23d916[_0x1189('0x52')]['limit']);_0x32ac95[_0x1189('0x1d')]=qs['offset'](_0x23d916['query']['offset']);}return _0x1b75aa[_0x1189('0xf4')](_0x32ac95);}})[_0x1189('0x25')](function(_0x2bda87){if(_0x2bda87){return _0x2bda87?{'count':_0x5d09a1,'rows':_0x2bda87}:null;}})['then'](respondWithResult(_0xbd28e,null))[_0x1189('0x19')](handleError(_0xbd28e,null));};exports[_0x1189('0x113')]=function(_0x1654eb,_0x26cccc){var _0x141b81=_0x1654eb[_0x1189('0x52')][_0x1189('0x114')]===_0x1189('0x115')?_0x1189('0x116'):_0x1189('0x117');return db[_0x1189('0x4d')][_0x1189('0x67')]({'attributes':['id',_0x141b81],'where':{'id':_0x1654eb[_0x1189('0x71')]['id']}})[_0x1189('0x25')](handleEntityNotFound(_0x26cccc,null))[_0x1189('0x25')](function(_0x4da176){if(_0x4da176){var _0x3077d0=_0x4da176[_0x141b81];var _0x255a19=_0x3077d0&&_0x3077d0[_0x1189('0x118')]?_0x3077d0['items']:[];_0x26cccc[_0x1189('0x2b')]({'fromKey':_[_0x1189('0x89')](_0x3077d0['fromKey'])?undefined:_0x3077d0['fromKey'],'count':_0x255a19['length'],'rows':_0x255a19});}})[_0x1189('0x19')](handleError(_0x26cccc,null));};exports[_0x1189('0x119')]=function(_0x2a0073,_0x19d656){var _0xa5bcc9={'raw':![],'where':{}};var _0xb17e47={};var _0x56c8d3={'count':0x0,'rows':[]};return db[_0x1189('0x4d')][_0x1189('0x74')]({'where':{'id':_0x2a0073[_0x1189('0x71')]['id']}})[_0x1189('0x25')](handleEntityNotFound(_0x19d656,null))[_0x1189('0x25')](function(_0x3856c3){if(_0x3856c3){_0xb17e47[_0x1189('0x46')]=_[_0x1189('0x51')](db['ChatOfflineMessage'][_0x1189('0x4e')]);_0xb17e47[_0x1189('0x52')]=_[_0x1189('0x51')](_0x2a0073[_0x1189('0x52')]);_0xb17e47[_0x1189('0x53')]=_['intersection'](_0xb17e47[_0x1189('0x46')],_0xb17e47[_0x1189('0x52')]);_0xa5bcc9[_0x1189('0x54')]=_['intersection'](_0xb17e47[_0x1189('0x46')],qs[_0x1189('0x56')](_0x2a0073['query'][_0x1189('0x56')]));_0xa5bcc9['attributes']=_0xa5bcc9[_0x1189('0x54')][_0x1189('0x57')]?_0xa5bcc9['attributes']:_0xb17e47['model'];if(!_0x2a0073[_0x1189('0x52')][_0x1189('0x75')](_0x1189('0x58'))){_0xa5bcc9[_0x1189('0x1f')]=qs[_0x1189('0x1f')](_0x2a0073[_0x1189('0x52')][_0x1189('0x1f')]);_0xa5bcc9['offset']=qs[_0x1189('0x1d')](_0x2a0073[_0x1189('0x52')][_0x1189('0x1d')]);}_0xa5bcc9[_0x1189('0x59')]=qs[_0x1189('0x5a')](_0x2a0073[_0x1189('0x52')][_0x1189('0x5a')]);_0xa5bcc9[_0x1189('0x5e')]=qs['filters'](_[_0x1189('0x5b')](_0x2a0073[_0x1189('0x52')],_0xb17e47[_0x1189('0x53')]));_0xa5bcc9['where'][_0x1189('0x76')]=_0x3856c3['id'];if(_0x2a0073[_0x1189('0x52')][_0x1189('0x5c')]){_0xa5bcc9['where']=_[_0x1189('0x5d')](_0xa5bcc9['where'],{'$or':_[_0x1189('0x36')](_0xa5bcc9[_0x1189('0x54')],function(_0x26d9b0){var _0x4e6c51={};_0x4e6c51[_0x26d9b0]={'$like':'%'+_0x2a0073[_0x1189('0x52')]['filter']+'%'};return _0x4e6c51;})});}_0xa5bcc9=_[_0x1189('0x5d')]({},_0xa5bcc9,_0x2a0073['options']);return db[_0x1189('0xd0')][_0x1189('0x20')]({'where':_0xa5bcc9[_0x1189('0x5e')]})[_0x1189('0x25')](function(_0x42d8bc){_0x56c8d3[_0x1189('0x20')]=_0x42d8bc;if(_0x2a0073[_0x1189('0x52')][_0x1189('0x60')]){_0xa5bcc9[_0x1189('0x61')]=[{'all':!![]}];}else{_0xa5bcc9[_0x1189('0x61')]=[{'model':db[_0x1189('0x97')],'as':_0x1189('0xee'),'required':![]},{'model':db['Attachment'],'as':_0x1189('0x11a'),'required':![]}];}return db[_0x1189('0xd0')]['findAll'](_0xa5bcc9);})[_0x1189('0x25')](function(_0x2563cf){_0x56c8d3[_0x1189('0x63')]=_0x2563cf;return _0x56c8d3;});}})[_0x1189('0x25')](respondWithFilteredResult(_0x19d656,_0xa5bcc9))[_0x1189('0x19')](handleError(_0x19d656,null));};exports[_0x1189('0x11b')]=function(_0x43d5d5,_0x589fa0){return db[_0x1189('0x4d')][_0x1189('0x67')]({'where':{'id':_0x43d5d5['params']['id']}})[_0x1189('0x25')](handleEntityNotFound(_0x589fa0,null))[_0x1189('0x25')](function(_0x2178a7){if(_0x2178a7){return _0x2178a7[_0x1189('0x11b')](_0x43d5d5[_0x1189('0x69')]['ids'],_[_0x1189('0xec')](_0x43d5d5[_0x1189('0x69')],[_0x1189('0x7d'),'id'])||{})[_0x1189('0xcb')](function(_0x2663da){for(var _0x185c90=0x0;_0x185c90<_0x43d5d5[_0x1189('0x69')][_0x1189('0x7d')][_0x1189('0x57')];_0x185c90+=0x1){socket[_0x1189('0x11c')](_0x1189('0x11d'),{'UserId':Number(_0x43d5d5[_0x1189('0x69')]['ids'][_0x185c90]),'ChatWebsiteId':Number(_0x43d5d5[_0x1189('0x71')]['id'])});}return _0x2663da;});}})[_0x1189('0x25')](respondWithResult(_0x589fa0,null))[_0x1189('0x19')](handleError(_0x589fa0,null));};exports[_0x1189('0x11e')]=function(_0x32327d,_0x50c188){return db[_0x1189('0x4d')][_0x1189('0x67')]({'where':{'id':_0x32327d[_0x1189('0x71')]['id']}})[_0x1189('0x25')](handleEntityNotFound(_0x50c188,null))['then'](function(_0xa19f13){if(_0xa19f13){return _0xa19f13[_0x1189('0x11e')](_0x32327d[_0x1189('0x52')][_0x1189('0x7d')])['then'](function(){if(_['isArray'](_0x32327d[_0x1189('0x52')][_0x1189('0x7d')])){for(var _0x4664ae=0x0;_0x4664ae<_0x32327d[_0x1189('0x52')][_0x1189('0x7d')][_0x1189('0x57')];_0x4664ae+=0x1){socket[_0x1189('0x11c')](_0x1189('0x11f'),{'UserId':Number(_0x32327d[_0x1189('0x52')][_0x1189('0x7d')][_0x4664ae]),'ChatWebsiteId':Number(_0x32327d['params']['id'])});}}else{socket[_0x1189('0x11c')]('userChatWebsite:remove',{'UserId':Number(_0x32327d['query'][_0x1189('0x7d')]),'ChatWebsiteId':Number(_0x32327d[_0x1189('0x71')]['id'])});}});}})[_0x1189('0x25')](respondWithStatusCode(_0x50c188,null))['catch'](handleError(_0x50c188,null));};exports[_0x1189('0x120')]=function(_0x46f827,_0x40bea7){var _0x30fd5d={};var _0x3b5ddd={};var _0x12581a;var _0x27a2c4;return db[_0x1189('0x4d')][_0x1189('0x74')]({'where':{'id':_0x46f827[_0x1189('0x71')]['id']}})['then'](handleEntityNotFound(_0x40bea7,null))['then'](function(_0x255f10){if(_0x255f10){_0x12581a=_0x255f10;_0x3b5ddd[_0x1189('0x46')]=_['keys'](db[_0x1189('0xbb')][_0x1189('0x4e')]);_0x3b5ddd[_0x1189('0x52')]=_['keys'](_0x46f827[_0x1189('0x52')]);_0x3b5ddd['filters']=_['intersection'](_0x3b5ddd['model'],_0x3b5ddd[_0x1189('0x52')]);_0x30fd5d['attributes']=_[_0x1189('0x55')](_0x3b5ddd[_0x1189('0x46')],qs[_0x1189('0x56')](_0x46f827[_0x1189('0x52')][_0x1189('0x56')]));_0x30fd5d[_0x1189('0x54')]=_0x30fd5d['attributes'][_0x1189('0x57')]?_0x30fd5d[_0x1189('0x54')]:_0x3b5ddd[_0x1189('0x46')];_0x30fd5d[_0x1189('0x59')]=qs[_0x1189('0x5a')](_0x46f827['query']['sort']);_0x30fd5d[_0x1189('0x5e')]=qs['filters'](_[_0x1189('0x5b')](_0x46f827['query'],_0x3b5ddd['filters']));if(_0x46f827[_0x1189('0x52')][_0x1189('0x5c')]){_0x30fd5d[_0x1189('0x5e')]=_[_0x1189('0x5d')](_0x30fd5d[_0x1189('0x5e')],{'$or':_[_0x1189('0x36')](_0x30fd5d['attributes'],function(_0x280d2d){var _0x3832f5={};_0x3832f5[_0x280d2d]={'$like':'%'+_0x46f827[_0x1189('0x52')][_0x1189('0x5c')]+'%'};return _0x3832f5;})});}_0x30fd5d=_[_0x1189('0x5d')]({},_0x30fd5d,_0x46f827['options']);return _0x12581a[_0x1189('0x120')](_0x30fd5d);}})['then'](function(_0x5d5a10){if(_0x5d5a10){_0x27a2c4=_0x5d5a10['length'];if(!_0x46f827['query'][_0x1189('0x75')](_0x1189('0x58'))){_0x30fd5d['limit']=qs[_0x1189('0x1f')](_0x46f827['query'][_0x1189('0x1f')]);_0x30fd5d[_0x1189('0x1d')]=qs[_0x1189('0x1d')](_0x46f827[_0x1189('0x52')][_0x1189('0x1d')]);}return _0x12581a[_0x1189('0x120')](_0x30fd5d);}})['then'](function(_0x45befb){if(_0x45befb){return _0x45befb?{'count':_0x27a2c4,'rows':_0x45befb}:null;}})[_0x1189('0x25')](respondWithResult(_0x40bea7,null))[_0x1189('0x19')](handleError(_0x40bea7,null));}; \ No newline at end of file +var _0x0412=['body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','Contacts','DESC','ChatApplication','Interval','Intervals','spread','account','list','applications','orderBy','Applications','asc','threadId','ChatInteraction','externalUrl','ContactId','interaction','contact','messageId','created','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','agent','queueId','ChatQueue','unshift','queue','EventManager','offline','files','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','offline-chat','openNewInteraction','Attachment','findOne','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','user','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Contact','fullname','internal','Tag','Tags','color','tag','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','utf8','address','origin','3.5.0','remote','headers','connection','replace','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','priority','finally','getApplications','addProactiveActions','omit','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','getOfflineMessages','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','util','ejs','fs-extra','lodash','querystring','jayson/promise','url','../../components/parsers/qs','../../config/logger','api','../../config/environment','APIOutOfIntervalError','../../errors/api','APINotFoundError','handleError','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','http','client','request','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','count','offset','limit','set','update','then','destroy','ChatWebsites','UserProfileResource','end','stack','name','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','map','get','all','some','user-agent-parser','setUA','user-agent','getResult','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','model','type','index','Pause','ChatWebsite','rawAttributes','fieldName','key','query','keys','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','intersection','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','length','nolimit','removeDispositions','ids','CannedAnswer','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0412,0x86));var _0x2041=function(_0x12eea6,_0x5bb66a){_0x12eea6=_0x12eea6-0x0;var _0x42bbc3=_0x0412[_0x12eea6];return _0x42bbc3;};'use strict';var Mustache=require('mustache');var util=require(_0x2041('0x0'));var path=require('path');var ejs=require(_0x2041('0x1'));var fs=require('fs');var fs_extra=require(_0x2041('0x2'));var _=require(_0x2041('0x3'));var querystring=require(_0x2041('0x4'));var htmlToText=require('html-to-text');var Redis=require('ioredis');var jayson=require(_0x2041('0x5'));var url=require(_0x2041('0x6'));var qs=require(_0x2041('0x7'));var logger=require(_0x2041('0x8'))(_0x2041('0x9'));var config=require(_0x2041('0xa'));var APIOutOfIntervalError=require('../../errors/api')[_0x2041('0xb')];var APINotFoundError=require(_0x2041('0xc'))[_0x2041('0xd')];var APIHandleError=require(_0x2041('0xc'))[_0x2041('0xe')];var db=require(_0x2041('0xf'))['db'];config[_0x2041('0x10')]=_[_0x2041('0x11')](config[_0x2041('0x10')],{'host':_0x2041('0x12'),'port':0x18eb});var socket=require(_0x2041('0x13'))(new Redis(config['redis']));require(_0x2041('0x14'))[_0x2041('0x15')](socket);var client=jayson['client'][_0x2041('0x16')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0x2041('0x17')][_0x2041('0x16')]({'port':0x2329});function respondWithRpcPromise(_0x2b3c7d,_0x2ee48a,_0x500a7a,_0x39a518){return new Promise(function(_0x414e6d,_0x4f52f5){var _0x43a200=_0x39a518||client;return _0x43a200[_0x2041('0x18')](_0x2b3c7d,_0x500a7a)['then'](function(_0x258524){logger[_0x2041('0x19')](_0x2041('0x1a'),_0x2ee48a,'request\x20sent');logger['debug'](_0x2041('0x1b'),_0x2ee48a,_0x2041('0x1c'),JSON[_0x2041('0x1d')](_0x258524));if(_0x258524[_0x2041('0x1e')]){if(_0x258524['error'][_0x2041('0x1f')]===0x1f4){logger[_0x2041('0x1e')](_0x2041('0x1a'),_0x2ee48a,_0x258524['error'][_0x2041('0x20')]);return _0x4f52f5(_0x258524[_0x2041('0x1e')][_0x2041('0x20')]);}logger[_0x2041('0x1e')]('ChatWebsite,\x20%s,\x20%s',_0x2ee48a,_0x258524[_0x2041('0x1e')][_0x2041('0x20')]);return _0x414e6d(_0x258524[_0x2041('0x1e')][_0x2041('0x20')]);}else{logger[_0x2041('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x2ee48a,'request\x20sent');_0x414e6d(_0x258524[_0x2041('0x21')]['message']);}})[_0x2041('0x22')](function(_0x536c58){logger[_0x2041('0x1e')](_0x2041('0x1a'),_0x2ee48a,_0x536c58);_0x4f52f5(_0x536c58);});});}function respondWithStatusCode(_0x5e477a,_0x5c9670){_0x5c9670=_0x5c9670||0xcc;return function(_0x480985){if(_0x480985){return _0x5e477a[_0x2041('0x23')](_0x5c9670);}return _0x5e477a[_0x2041('0x24')](_0x5c9670)['end']();};}function respondWithResult(_0x585244,_0x4e0ea7){_0x4e0ea7=_0x4e0ea7||0xc8;return function(_0x5b0d6d){if(_0x5b0d6d){return _0x585244[_0x2041('0x24')](_0x4e0ea7)[_0x2041('0x25')](_0x5b0d6d);}};}function respondWithFilteredResult(_0x379746,_0x76b3ea){return function(_0x11cc89){if(_0x11cc89){var _0x50024d=typeof _0x76b3ea['offset']===_0x2041('0x26')&&typeof _0x76b3ea['limit']===_0x2041('0x26');var _0x1719e4=_0x11cc89[_0x2041('0x27')];var _0x43a05c=_0x50024d?0x0:_0x76b3ea[_0x2041('0x28')];var _0x1694f8=_0x50024d?_0x11cc89[_0x2041('0x27')]:_0x76b3ea['offset']+_0x76b3ea[_0x2041('0x29')];var _0x4c88fb;if(_0x1694f8>=_0x1719e4){_0x1694f8=_0x1719e4;_0x4c88fb=0xc8;}else{_0x4c88fb=0xce;}_0x379746[_0x2041('0x24')](_0x4c88fb);return _0x379746[_0x2041('0x2a')]('Content-Range',_0x43a05c+'-'+_0x1694f8+'/'+_0x1719e4)['json'](_0x11cc89);}return null;};}function saveUpdates(_0x3aedc4){return function(_0x4ffb00){if(_0x4ffb00){return _0x4ffb00[_0x2041('0x2b')](_0x3aedc4)[_0x2041('0x2c')](function(_0x5a4272){return _0x5a4272;});}return null;};}function removeEntity(_0x492804){return function(_0x4bfe72){if(_0x4bfe72){return _0x4bfe72[_0x2041('0x2d')]()[_0x2041('0x2c')](function(){var _0xda9ce8=_0x4bfe72['get']({'plain':!![]});var _0x2843fd=_0x2041('0x2e');return db[_0x2041('0x2f')]['destroy']({'where':{'type':_0x2843fd,'resourceId':_0xda9ce8['id']}})['then'](function(){return _0x4bfe72;});})['then'](function(){_0x492804[_0x2041('0x24')](0xcc)[_0x2041('0x30')]();});}};}function handleEntityNotFound(_0x443ad5){return function(_0x8b4595){if(!_0x8b4595){_0x443ad5['sendStatus'](0x194);}return _0x8b4595;};}function handleError(_0x4b29ad,_0x1de652){_0x1de652=_0x1de652||0x1f4;return function(_0x4630bb){logger[_0x2041('0x1e')](_0x4630bb[_0x2041('0x31')]);if(_0x4630bb[_0x2041('0x32')]){delete _0x4630bb[_0x2041('0x32')];}_0x4b29ad[_0x2041('0x24')](_0x1de652)['send'](_0x4630bb);};}function iftimePromise(_0x50c3ee,_0x235563){return respondWithRpcPromise(_0x2041('0x33'),_0x2041('0x34'),{'command':_0x235563[_0x2041('0x35')]?util['format'](_0x2041('0x36'),_0x50c3ee[_0x2041('0x37')],_0x235563['timezone']):util['format'](_0x2041('0x38'),_0x50c3ee[_0x2041('0x37')])},client9002)[_0x2041('0x2c')](function(_0x13433d){var _0x42582f=_0x13433d&&_0x13433d[_0x2041('0x39')](_0x2041('0x3a'))>=0x0?!![]:![];logger[_0x2041('0x19')](_0x2041('0x3b'),_0x235563['id'],_0x50c3ee['id'],_0x50c3ee[_0x2041('0x37')],_0x42582f?_0x2041('0x3c'):_0x2041('0x3d'),_0x235563[_0x2041('0x35')]?_0x235563[_0x2041('0x35')]:_0x2041('0x3e'));return _0x42582f;})['catch'](function(_0x189758){logger['error'](_0x2041('0x3b'),_0x235563['id'],_0x50c3ee['id'],_0x50c3ee['interval'],util[_0x2041('0x3f')](_0x189758,{'showHidden':![],'depth':null}),_0x235563[_0x2041('0x35')]?_0x235563[_0x2041('0x35')]:_0x2041('0x3e'));return![];});}function checkWebsiteIntervals(_0x3fd3ec){var _0x1a2988=_[_0x2041('0x40')](_0x3fd3ec['Interval']['Intervals'],function(_0x5dfaf4){var _0x3e0cee=_0x5dfaf4[_0x2041('0x41')]({'plain':!![]});return iftimePromise(_0x3e0cee,_0x3fd3ec);});return Promise[_0x2041('0x42')](_0x1a2988)[_0x2041('0x2c')](function(_0x19b00f){return _[_0x2041('0x43')](_0x19b00f);});}function createInteractionObject(_0x37a701,_0x549a0c,_0x441c08,_0x1d4632){var _0x45c9e2=require(_0x2041('0x44'));var _0x418443=new _0x45c9e2();var _0x1ab6eb=_0x418443[_0x2041('0x45')](_0x441c08[_0x2041('0x46')])[_0x2041('0x47')]();var _0x44dfa7=_0x549a0c['customerIp'];if(_0x441c08[_0x2041('0x48')]){_0x44dfa7=_0x441c08[_0x2041('0x48')];}else if(_0x441c08[_0x2041('0x49')]){_0x44dfa7=_[_0x2041('0x4a')](_0x441c08['x-forwarded-for']['split'](','));}return{'ContactId':_0x1d4632['id'],'ChatWebsiteId':_0x37a701,'from':(_0x1d4632[_0x2041('0x4b')]||'')+'\x20'+(_0x1d4632[_0x2041('0x4c')]||''),'customerIp':_0x44dfa7,'customerPort':_0x441c08[_0x2041('0x4d')]?_0x441c08[_0x2041('0x4d')]:null,'referer':_0x549a0c[_0x2041('0x4e')],'browserName':_0x1ab6eb[_0x2041('0x4f')][_0x2041('0x32')]&&_0x1ab6eb['browser'][_0x2041('0x50')]?util[_0x2041('0x51')](_0x2041('0x52'),_0x1ab6eb['browser'][_0x2041('0x32')],_0x1ab6eb[_0x2041('0x4f')]['version']):_0x2041('0x53'),'browserVersion':_0x1ab6eb['browser'][_0x2041('0x50')]||_0x2041('0x53'),'osName':util[_0x2041('0x51')](_0x2041('0x52'),_0x1ab6eb['os'][_0x2041('0x32')],_0x1ab6eb['os'][_0x2041('0x50')]),'osVersion':_0x1ab6eb['os'][_0x2041('0x50')],'deviceModel':_0x1ab6eb[_0x2041('0x54')]['model']&&_0x1ab6eb[_0x2041('0x54')][_0x2041('0x55')]?util[_0x2041('0x51')]('%s\x20%s\x20%s',_0x1ab6eb['device'][_0x2041('0x56')],_0x1ab6eb['device'][_0x2041('0x55')],_0x1ab6eb[_0x2041('0x54')][_0x2041('0x57')]):null,'deviceVendor':_0x1ab6eb[_0x2041('0x54')][_0x2041('0x55')],'deviceType':_0x1ab6eb[_0x2041('0x54')][_0x2041('0x57')],'formData':JSON[_0x2041('0x1d')](_0x549a0c)};}exports[_0x2041('0x58')]=function(_0x2eb613,_0x18d53b){var _0x10e38f={'include':[{'model':db[_0x2041('0x59')],'as':'mandatoryDispositionPause'}]},_0x575961={},_0x178c71={'count':0x0,'rows':[]};var _0x15674b=_[_0x2041('0x40')](db[_0x2041('0x5a')][_0x2041('0x5b')],function(_0x36fbaf){return{'name':_0x36fbaf[_0x2041('0x5c')],'type':_0x36fbaf['type'][_0x2041('0x5d')]};});_0x575961[_0x2041('0x56')]=_['map'](_0x15674b,_0x2041('0x32'));_0x575961[_0x2041('0x5e')]=_[_0x2041('0x5f')](_0x2eb613[_0x2041('0x5e')]);_0x575961['filters']=_['intersection'](_0x575961[_0x2041('0x56')],_0x575961['query']);_0x10e38f[_0x2041('0x60')]=_['intersection'](_0x575961[_0x2041('0x56')],qs[_0x2041('0x61')](_0x2eb613[_0x2041('0x5e')][_0x2041('0x61')]));_0x10e38f[_0x2041('0x60')]=_0x10e38f[_0x2041('0x60')]['length']?_0x10e38f[_0x2041('0x60')]:_0x575961[_0x2041('0x56')];if(!_0x2eb613[_0x2041('0x5e')][_0x2041('0x62')]('nolimit')){_0x10e38f[_0x2041('0x29')]=qs[_0x2041('0x29')](_0x2eb613[_0x2041('0x5e')][_0x2041('0x29')]);_0x10e38f['offset']=qs[_0x2041('0x28')](_0x2eb613[_0x2041('0x5e')][_0x2041('0x28')]);}_0x10e38f[_0x2041('0x63')]=qs[_0x2041('0x64')](_0x2eb613['query'][_0x2041('0x64')]);_0x10e38f[_0x2041('0x65')]=qs['filters'](_[_0x2041('0x66')](_0x2eb613['query'],_0x575961[_0x2041('0x67')]),_0x15674b);if(_0x2eb613['query'][_0x2041('0x68')]){_0x10e38f[_0x2041('0x65')]=_[_0x2041('0x69')](_0x10e38f[_0x2041('0x65')],{'$or':_[_0x2041('0x40')](_0x15674b,function(_0x46b972){if(_0x46b972['type']!=='VIRTUAL'){var _0xa54025={};_0xa54025[_0x46b972['name']]={'$like':'%'+_0x2eb613['query']['filter']+'%'};return _0xa54025;}})});}_0x10e38f=_[_0x2041('0x69')]({},_0x10e38f,_0x2eb613[_0x2041('0x6a')]);var _0x47cb7d={'where':_0x10e38f['where']};return db[_0x2041('0x5a')]['count'](_0x47cb7d)[_0x2041('0x2c')](function(_0x44055a){_0x178c71[_0x2041('0x27')]=_0x44055a;if(_0x2eb613[_0x2041('0x5e')][_0x2041('0x6b')]){_0x10e38f[_0x2041('0x6c')]=[{'all':!![]}];}return db[_0x2041('0x5a')][_0x2041('0x6d')](_0x10e38f);})['then'](function(_0x4a6b7a){_0x178c71[_0x2041('0x6e')]=_0x4a6b7a;return _0x178c71;})['then'](respondWithFilteredResult(_0x18d53b,_0x10e38f))[_0x2041('0x22')](handleError(_0x18d53b,null));};exports[_0x2041('0x6f')]=function(_0x2a239a,_0x50ff1f){var _0xb59fb0={'raw':![],'where':{'id':_0x2a239a[_0x2041('0x70')]['id']},'include':[{'model':db[_0x2041('0x59')],'as':_0x2041('0x71')}]},_0x2e2859={};_0x2e2859['model']=_['keys'](db[_0x2041('0x5a')][_0x2041('0x5b')]);_0x2e2859['query']=_[_0x2041('0x5f')](_0x2a239a[_0x2041('0x5e')]);_0x2e2859['filters']=_[_0x2041('0x72')](_0x2e2859[_0x2041('0x56')],_0x2e2859[_0x2041('0x5e')]);_0xb59fb0[_0x2041('0x60')]=_['intersection'](_0x2e2859[_0x2041('0x56')],qs[_0x2041('0x61')](_0x2a239a[_0x2041('0x5e')][_0x2041('0x61')]));_0xb59fb0[_0x2041('0x60')]=_0xb59fb0[_0x2041('0x60')]['length']?_0xb59fb0[_0x2041('0x60')]:_0x2e2859[_0x2041('0x56')];if(_0x2a239a[_0x2041('0x5e')][_0x2041('0x6b')]){_0xb59fb0[_0x2041('0x6c')]=[{'all':!![]}];}_0xb59fb0=_[_0x2041('0x69')]({},_0xb59fb0,_0x2a239a[_0x2041('0x6a')]);return db['ChatWebsite']['find'](_0xb59fb0)['then'](handleEntityNotFound(_0x50ff1f,null))[_0x2041('0x2c')](respondWithResult(_0x50ff1f,null))[_0x2041('0x22')](handleError(_0x50ff1f,null));};exports[_0x2041('0x73')]=function(_0x1c200b,_0x4c6558){return db[_0x2041('0x5a')]['create'](_0x1c200b[_0x2041('0x74')],{})[_0x2041('0x2c')](function(_0x21d2c9){var _0x53e0b1=_0x1c200b['user']['get']({'plain':!![]});if(!_0x53e0b1)throw new Error(_0x2041('0x75'));if(_0x53e0b1['role']==='user'){var _0x2d8770=_0x21d2c9[_0x2041('0x41')]({'plain':!![]});var _0x13bf5c=_0x2041('0x2e');return db[_0x2041('0x76')][_0x2041('0x77')]({'where':{'name':_0x13bf5c,'userProfileId':_0x53e0b1[_0x2041('0x78')]},'raw':!![]})[_0x2041('0x2c')](function(_0x4529c0){if(_0x4529c0&&_0x4529c0[_0x2041('0x79')]===0x0){return db[_0x2041('0x2f')]['create']({'name':_0x2d8770[_0x2041('0x32')],'resourceId':_0x2d8770['id'],'type':_0x4529c0[_0x2041('0x32')],'sectionId':_0x4529c0['id']},{})['then'](function(){return _0x21d2c9;});}else{return _0x21d2c9;}})['catch'](function(_0x857430){logger[_0x2041('0x1e')](_0x2041('0x7a'),_0x857430);throw _0x857430;});}return _0x21d2c9;})[_0x2041('0x2c')](respondWithResult(_0x4c6558,0xc9))[_0x2041('0x22')](handleError(_0x4c6558,null));};exports[_0x2041('0x2b')]=function(_0x41944b,_0x4967c0){if(_0x41944b[_0x2041('0x74')]['id']){delete _0x41944b[_0x2041('0x74')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x41944b[_0x2041('0x70')]['id']},'include':[{'model':db[_0x2041('0x59')],'as':_0x2041('0x71')}]})[_0x2041('0x2c')](handleEntityNotFound(_0x4967c0,null))[_0x2041('0x2c')](saveUpdates(_0x41944b[_0x2041('0x74')],null))[_0x2041('0x2c')](respondWithResult(_0x4967c0,null))[_0x2041('0x22')](handleError(_0x4967c0,null));};exports[_0x2041('0x2d')]=function(_0x1e6f95,_0xe5ada6){return db[_0x2041('0x5a')][_0x2041('0x77')]({'where':{'id':_0x1e6f95[_0x2041('0x70')]['id']}})[_0x2041('0x2c')](handleEntityNotFound(_0xe5ada6,null))[_0x2041('0x2c')](removeEntity(_0xe5ada6,null))['catch'](handleError(_0xe5ada6,null));};exports['describe']=function(_0xea19e3,_0x102433){return db['ChatWebsite'][_0x2041('0x7b')]()[_0x2041('0x2c')](respondWithResult(_0x102433,null))[_0x2041('0x22')](handleError(_0x102433,null));};exports[_0x2041('0x7c')]=function(_0x2d056c,_0x222097){if(_0x2d056c[_0x2041('0x74')]['id']){delete _0x2d056c[_0x2041('0x74')]['id'];}return db['ChatWebsite'][_0x2041('0x77')]({'where':{'id':_0x2d056c['params']['id']}})[_0x2041('0x2c')](handleEntityNotFound(_0x222097,null))[_0x2041('0x2c')](function(_0x5431c6){if(_0x5431c6){_0x2d056c['body'][_0x2041('0x7d')]=_0x5431c6['id'];return db[_0x2041('0x7e')][_0x2041('0x73')](_0x2d056c[_0x2041('0x74')]);}})[_0x2041('0x2c')](respondWithResult(_0x222097,null))[_0x2041('0x22')](handleError(_0x222097,null));};exports[_0x2041('0x7f')]=function(_0x53ba74,_0x4396b8){var _0x38a299={'raw':![],'where':{}};var _0x49d1dc={};var _0x5f0834={'count':0x0,'rows':[]};return db[_0x2041('0x5a')]['findOne']({'where':{'id':_0x53ba74[_0x2041('0x70')]['id']}})['then'](handleEntityNotFound(_0x4396b8,null))[_0x2041('0x2c')](function(_0x3bbfd3){if(_0x3bbfd3){_0x49d1dc[_0x2041('0x56')]=_[_0x2041('0x5f')](db[_0x2041('0x7e')][_0x2041('0x5b')]);_0x49d1dc['query']=_[_0x2041('0x5f')](_0x53ba74[_0x2041('0x5e')]);_0x49d1dc['filters']=_[_0x2041('0x72')](_0x49d1dc[_0x2041('0x56')],_0x49d1dc[_0x2041('0x5e')]);_0x38a299['attributes']=_['intersection'](_0x49d1dc[_0x2041('0x56')],qs[_0x2041('0x61')](_0x53ba74[_0x2041('0x5e')][_0x2041('0x61')]));_0x38a299[_0x2041('0x60')]=_0x38a299['attributes'][_0x2041('0x80')]?_0x38a299[_0x2041('0x60')]:_0x49d1dc[_0x2041('0x56')];if(!_0x53ba74['query'][_0x2041('0x62')](_0x2041('0x81'))){_0x38a299[_0x2041('0x29')]=qs[_0x2041('0x29')](_0x53ba74['query'][_0x2041('0x29')]);_0x38a299[_0x2041('0x28')]=qs[_0x2041('0x28')](_0x53ba74[_0x2041('0x5e')][_0x2041('0x28')]);}_0x38a299[_0x2041('0x63')]=qs[_0x2041('0x64')](_0x53ba74[_0x2041('0x5e')][_0x2041('0x64')]);_0x38a299[_0x2041('0x65')]=qs[_0x2041('0x67')](_['pick'](_0x53ba74[_0x2041('0x5e')],_0x49d1dc[_0x2041('0x67')]));_0x38a299[_0x2041('0x65')][_0x2041('0x7d')]=_0x3bbfd3['id'];if(_0x53ba74[_0x2041('0x5e')][_0x2041('0x68')]){_0x38a299[_0x2041('0x65')]=_[_0x2041('0x69')](_0x38a299[_0x2041('0x65')],{'$or':_[_0x2041('0x40')](_0x38a299[_0x2041('0x60')],function(_0x568334){var _0x192f71={};_0x192f71[_0x568334]={'$like':'%'+_0x53ba74[_0x2041('0x5e')][_0x2041('0x68')]+'%'};return _0x192f71;})});}_0x38a299=_[_0x2041('0x69')]({},_0x38a299,_0x53ba74[_0x2041('0x6a')]);return db[_0x2041('0x7e')][_0x2041('0x27')]({'where':_0x38a299[_0x2041('0x65')]})[_0x2041('0x2c')](function(_0x216816){_0x5f0834[_0x2041('0x27')]=_0x216816;if(_0x53ba74[_0x2041('0x5e')][_0x2041('0x6b')]){_0x38a299['include']=[{'all':!![]}];}return db[_0x2041('0x7e')][_0x2041('0x6d')](_0x38a299);})[_0x2041('0x2c')](function(_0x3da025){_0x5f0834['rows']=_0x3da025;return _0x5f0834;});}})['then'](respondWithFilteredResult(_0x4396b8,_0x38a299))[_0x2041('0x22')](handleError(_0x4396b8,null));};exports[_0x2041('0x82')]=function(_0x22a9db,_0x1e5466){return db['ChatWebsite']['find']({'where':{'id':_0x22a9db['params']['id']}})[_0x2041('0x2c')](handleEntityNotFound(_0x1e5466,null))[_0x2041('0x2c')](function(_0x2541de){if(_0x2541de){return _0x2541de[_0x2041('0x82')](_0x22a9db[_0x2041('0x5e')][_0x2041('0x83')]);}})[_0x2041('0x2c')](respondWithStatusCode(_0x1e5466,null))['catch'](handleError(_0x1e5466,null));};exports['addAnswer']=function(_0x3a034a,_0x3191d6){if(_0x3a034a[_0x2041('0x74')]['id']){delete _0x3a034a[_0x2041('0x74')]['id'];}return db[_0x2041('0x5a')][_0x2041('0x77')]({'where':{'id':_0x3a034a['params']['id']}})[_0x2041('0x2c')](handleEntityNotFound(_0x3191d6,null))[_0x2041('0x2c')](function(_0x234fc8){if(_0x234fc8){_0x3a034a[_0x2041('0x74')][_0x2041('0x7d')]=_0x234fc8['id'];return db[_0x2041('0x84')][_0x2041('0x73')](_0x3a034a[_0x2041('0x74')]);}})[_0x2041('0x2c')](respondWithResult(_0x3191d6,null))[_0x2041('0x22')](handleError(_0x3191d6,null));};exports['getAnswers']=function(_0x5628d0,_0x3379b2){var _0x3efa91={'raw':![],'where':{}};var _0x588a10={};var _0x50dbe4={'count':0x0,'rows':[]};return db[_0x2041('0x5a')]['findOne']({'where':{'id':_0x5628d0[_0x2041('0x70')]['id']}})['then'](handleEntityNotFound(_0x3379b2,null))[_0x2041('0x2c')](function(_0xbbefa5){if(_0xbbefa5){_0x588a10[_0x2041('0x56')]=_['keys'](db[_0x2041('0x84')][_0x2041('0x5b')]);_0x588a10[_0x2041('0x5e')]=_[_0x2041('0x5f')](_0x5628d0['query']);_0x588a10[_0x2041('0x67')]=_[_0x2041('0x72')](_0x588a10[_0x2041('0x56')],_0x588a10[_0x2041('0x5e')]);_0x3efa91[_0x2041('0x60')]=_[_0x2041('0x72')](_0x588a10[_0x2041('0x56')],qs['fields'](_0x5628d0[_0x2041('0x5e')][_0x2041('0x61')]));_0x3efa91[_0x2041('0x60')]=_0x3efa91[_0x2041('0x60')][_0x2041('0x80')]?_0x3efa91[_0x2041('0x60')]:_0x588a10[_0x2041('0x56')];if(!_0x5628d0['query'][_0x2041('0x62')](_0x2041('0x81'))){_0x3efa91['limit']=qs[_0x2041('0x29')](_0x5628d0[_0x2041('0x5e')][_0x2041('0x29')]);_0x3efa91[_0x2041('0x28')]=qs[_0x2041('0x28')](_0x5628d0[_0x2041('0x5e')][_0x2041('0x28')]);}_0x3efa91[_0x2041('0x63')]=qs[_0x2041('0x64')](_0x5628d0[_0x2041('0x5e')]['sort']);_0x3efa91[_0x2041('0x65')]=qs[_0x2041('0x67')](_[_0x2041('0x66')](_0x5628d0['query'],_0x588a10[_0x2041('0x67')]));_0x3efa91[_0x2041('0x65')]['ChatWebsiteId']=_0xbbefa5['id'];if(_0x5628d0['query'][_0x2041('0x68')]){_0x3efa91[_0x2041('0x65')]=_[_0x2041('0x69')](_0x3efa91[_0x2041('0x65')],{'$or':_[_0x2041('0x40')](_0x3efa91[_0x2041('0x60')],function(_0x453c1f){var _0x58e394={};_0x58e394[_0x453c1f]={'$like':'%'+_0x5628d0[_0x2041('0x5e')][_0x2041('0x68')]+'%'};return _0x58e394;})});}_0x3efa91=_[_0x2041('0x69')]({},_0x3efa91,_0x5628d0[_0x2041('0x6a')]);return db[_0x2041('0x84')][_0x2041('0x27')]({'where':_0x3efa91['where']})['then'](function(_0x374e8f){_0x50dbe4[_0x2041('0x27')]=_0x374e8f;if(_0x5628d0[_0x2041('0x5e')][_0x2041('0x6b')]){_0x3efa91['include']=[{'all':!![]}];}return db[_0x2041('0x84')]['findAll'](_0x3efa91);})[_0x2041('0x2c')](function(_0x44416f){_0x50dbe4[_0x2041('0x6e')]=_0x44416f;return _0x50dbe4;});}})[_0x2041('0x2c')](respondWithFilteredResult(_0x3379b2,_0x3efa91))[_0x2041('0x22')](handleError(_0x3379b2,null));};exports[_0x2041('0x85')]=function(_0x306f9d,_0x3b758e){return db[_0x2041('0x5a')][_0x2041('0x77')]({'where':{'id':_0x306f9d[_0x2041('0x70')]['id']}})['then'](handleEntityNotFound(_0x3b758e,null))[_0x2041('0x2c')](function(_0x590590){if(_0x590590){return _0x590590[_0x2041('0x85')](_0x306f9d['query'][_0x2041('0x83')]);}})[_0x2041('0x2c')](respondWithStatusCode(_0x3b758e,null))['catch'](handleError(_0x3b758e,null));};exports['addLogo']=function(_0x1f4990,_0x19b7f6){_0x1f4990[_0x2041('0x74')][_0x2041('0x86')]=_0x1f4990[_0x2041('0x87')][_0x2041('0x88')];return db['ChatWebsite'][_0x2041('0x77')]({'where':{'id':_0x1f4990['params']['id']}})[_0x2041('0x2c')](handleEntityNotFound(_0x19b7f6,null))[_0x2041('0x2c')](saveUpdates(_0x1f4990[_0x2041('0x74')],null))[_0x2041('0x2c')](respondWithResult(_0x19b7f6,null))['catch'](handleError(_0x19b7f6,null));};exports[_0x2041('0x89')]=function(_0x7b8f71,_0x5411c1){_0x7b8f71[_0x2041('0x74')][_0x2041('0x8a')]=_0x7b8f71['file'][_0x2041('0x88')];return db[_0x2041('0x5a')]['find']({'where':{'id':_0x7b8f71[_0x2041('0x70')]['id']}})[_0x2041('0x2c')](handleEntityNotFound(_0x5411c1,null))['then'](saveUpdates(_0x7b8f71[_0x2041('0x74')],null))[_0x2041('0x2c')](respondWithResult(_0x5411c1,null))['catch'](handleError(_0x5411c1,null));};exports[_0x2041('0x8b')]=function(_0x3f171a,_0x34072d){_0x3f171a['body'][_0x2041('0x8c')]=_0x3f171a[_0x2041('0x87')]['filename'];return db[_0x2041('0x5a')][_0x2041('0x77')]({'where':{'id':_0x3f171a[_0x2041('0x70')]['id']}})['then'](handleEntityNotFound(_0x34072d,null))['then'](saveUpdates(_0x3f171a[_0x2041('0x74')],null))[_0x2041('0x2c')](respondWithResult(_0x34072d,null))[_0x2041('0x22')](handleError(_0x34072d,null));};exports['addSystemAvatar']=function(_0x191286,_0x50f155){_0x191286[_0x2041('0x74')][_0x2041('0x8d')]=_0x191286['file'][_0x2041('0x88')];return db[_0x2041('0x5a')]['find']({'where':{'id':_0x191286[_0x2041('0x70')]['id']}})['then'](handleEntityNotFound(_0x50f155,null))[_0x2041('0x2c')](saveUpdates(_0x191286[_0x2041('0x74')],null))['then'](respondWithResult(_0x50f155,null))[_0x2041('0x22')](handleError(_0x50f155,null));};exports[_0x2041('0x8e')]=function(_0x2bc92e,_0xf83ebd){var _0xc3416f=path[_0x2041('0x8f')](config[_0x2041('0x90')],_0x2041('0x91'));var _0xdf5f9={'where':{'id':_0x2bc92e[_0x2041('0x70')]['id']},'attributes':['id',_0x2041('0x86')],'raw':!![]};var _0x27d558=![];return require(_0x2041('0x92'))[_0x2041('0x93')]()[_0x2041('0x2c')](function(_0x1c8c2f){if(_0x1c8c2f){_0x27d558=_0x1c8c2f[_0x2041('0x94')];}})[_0x2041('0x2c')](function(){return db[_0x2041('0x5a')][_0x2041('0x77')](_0xdf5f9);})['then'](handleEntityNotFound(_0xf83ebd,null))[_0x2041('0x2c')](function(_0x616db5){if(_0x616db5){if(!_[_0x2041('0x95')](_0x616db5[_0x2041('0x86')])){if(fs[_0x2041('0x96')](path[_0x2041('0x8f')](config[_0x2041('0x90')],_0x2041('0x97'),_0x616db5[_0x2041('0x86')]))&&_0x27d558){_0xc3416f=path[_0x2041('0x8f')](config[_0x2041('0x90')],_0x2041('0x97'),_0x616db5[_0x2041('0x86')]);}}return _0xf83ebd[_0x2041('0x98')](_0xc3416f);}})[_0x2041('0x22')](handleError(_0xf83ebd,null));};exports['getAvatar']=function(_0x43c786,_0x43436f){var _0x30abeb=path[_0x2041('0x8f')](config[_0x2041('0x90')],_0x2041('0x99'));var _0x41c3b4={'where':{'id':_0x43c786[_0x2041('0x70')]['id']},'attributes':['id',_0x2041('0x8a')],'raw':!![]};return db[_0x2041('0x5a')][_0x2041('0x77')](_0x41c3b4)[_0x2041('0x2c')](handleEntityNotFound(_0x43436f,null))[_0x2041('0x2c')](function(_0x52fe13){if(_0x52fe13){if(!_[_0x2041('0x95')](_0x52fe13[_0x2041('0x8a')])){if(fs[_0x2041('0x96')](path[_0x2041('0x8f')](config[_0x2041('0x90')],'server/files/images/avatars/',_0x52fe13[_0x2041('0x8a')]))){_0x30abeb=path['join'](config['root'],_0x2041('0x9a'),_0x52fe13['agentAvatar']);}}return _0x43436f[_0x2041('0x98')](_0x30abeb);}})[_0x2041('0x22')](handleError(_0x43436f,null));};exports[_0x2041('0x9b')]=function(_0x58a6be,_0x574bde){var _0x566d4f=path[_0x2041('0x8f')](config[_0x2041('0x90')],_0x2041('0x9c'));var _0x2af4a6={'where':{'id':_0x58a6be[_0x2041('0x70')]['id']},'attributes':['id','customerAvatar',_0x2041('0x9d')],'raw':!![]};return db[_0x2041('0x5a')][_0x2041('0x77')](_0x2af4a6)[_0x2041('0x2c')](handleEntityNotFound(_0x574bde,null))['then'](function(_0x4a41c3){if(_0x4a41c3){if(!_[_0x2041('0x95')](_0x4a41c3[_0x2041('0x8c')])){if(fs[_0x2041('0x96')](path[_0x2041('0x8f')](config[_0x2041('0x90')],_0x2041('0x9a'),_0x4a41c3[_0x2041('0x8c')]))&&_0x4a41c3[_0x2041('0x9d')]){_0x566d4f=path[_0x2041('0x8f')](config[_0x2041('0x90')],_0x2041('0x9a'),_0x4a41c3['customerAvatar']);}}return _0x574bde['download'](_0x566d4f);}})['catch'](handleError(_0x574bde,null));};exports[_0x2041('0x9e')]=function(_0xe6ff44,_0xb7f0a1){var _0x59b7fa=path[_0x2041('0x8f')](config['root'],_0x2041('0x9f'));var _0x29f820={'where':{'id':_0xe6ff44[_0x2041('0x70')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x2041('0x5a')][_0x2041('0x77')](_0x29f820)[_0x2041('0x2c')](handleEntityNotFound(_0xb7f0a1,null))[_0x2041('0x2c')](function(_0xf151d6){if(_0xf151d6){if(!_['isNil'](_0xf151d6[_0x2041('0x8d')])){if(fs[_0x2041('0x96')](path[_0x2041('0x8f')](config['root'],_0x2041('0x9a'),_0xf151d6[_0x2041('0x8d')]))){_0x59b7fa=path[_0x2041('0x8f')](config['root'],_0x2041('0x9a'),_0xf151d6[_0x2041('0x8d')]);}}return _0xb7f0a1[_0x2041('0x98')](_0x59b7fa);}})[_0x2041('0x22')](handleError(_0xb7f0a1,null));};exports[_0x2041('0xa0')]=function(_0x4f0730,_0x56cb5c){var _0xdd1def={'body':_0x4f0730['body'],'channel':_0x2041('0xa1')};var _0x19f60a=[];var _0x476e90=[];var _0x37ec8e={};var _0x2adf1a=![];return db[_0x2041('0xa2')][_0x2041('0x7b')]()[_0x2041('0x2c')](function(_0x3e1800){if(!_0x3e1800){throw new db[(_0x2041('0xa3'))]['ValidationError'](_0x2041('0xa4'));}_0x19f60a=_[_0x2041('0xa5')](_[_0x2041('0x5f')](_0x3e1800),[_0x2041('0xa6'),_0x2041('0xa7')]);_0x476e90=_['difference'](_[_0x2041('0x5f')](_0x3e1800),['createdAt','updatedAt',_0x2041('0xa8'),_0x2041('0xa9')]);if(_0x4f0730['body']['id']){delete _0x4f0730['body']['id'];}if(_[_0x2041('0x95')](_0x4f0730[_0x2041('0x74')][_0x2041('0xaa')])){throw new db[(_0x2041('0xa3'))][(_0x2041('0xab'))]('from\x20is\x20mandatory');}if(_[_0x2041('0x95')](_0x4f0730[_0x2041('0x74')][_0x2041('0x74')])||_0x4f0730[_0x2041('0x74')]['body']===''){throw new db[(_0x2041('0xa3'))]['ValidationError'](_0x2041('0xac'));}if(_[_0x2041('0x95')](_0x4f0730[_0x2041('0x74')]['mapKey'])){throw new db[(_0x2041('0xa3'))][(_0x2041('0xab'))](_0x2041('0xad')+_0x476e90);}if(!_[_0x2041('0xae')](_0x476e90,_0x4f0730['body']['mapKey'])){throw new db['Sequelize'][(_0x2041('0xab'))](_0x2041('0xaf')+_0x476e90);}_0x37ec8e[_0x4f0730[_0x2041('0x74')][_0x2041('0xb0')]]=_0x4f0730['body']['from'];})[_0x2041('0x2c')](function(){return db[_0x2041('0x5a')][_0x2041('0x77')]({'where':{'id':_0x4f0730['params']['id']},'include':[{'model':db[_0x2041('0xb1')],'as':_0x2041('0xb2'),'include':[{'model':db[_0x2041('0xa2')],'as':_0x2041('0xb3'),'where':_0x37ec8e,'limit':0x1,'order':[[_0x2041('0xa7'),_0x2041('0xb4')]]}]},{'model':db[_0x2041('0xb5')],'as':'Applications'},{'model':db[_0x2041('0xb6')],'as':_0x2041('0xb6'),'include':[{'model':db['Interval'],'as':_0x2041('0xb7'),'attributes':['id',_0x2041('0x37')],'raw':!![]}]}]});})[_0x2041('0x2c')](function(_0x3a1a75){if(!_0x3a1a75)throw new APINotFoundError(util[_0x2041('0x51')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x4f0730[_0x2041('0x70')]['id']));if(!_0x3a1a75[_0x2041('0xb6')]||!_0x3a1a75[_0x2041('0xb6')][_0x2041('0xb7')])return[_0x3a1a75,!![]];return[_0x3a1a75,checkWebsiteIntervals(_0x3a1a75)];})[_0x2041('0xb8')](function(_0x20d319,_0x20ab40){if(!_0x20ab40)throw new APIOutOfIntervalError();if(!_0x20d319[_0x2041('0xb2')])return;_0xdd1def[_0x2041('0xb9')]=_0x20d319;_0xdd1def[_0x2041('0xba')]=_0x20d319[_0x2041('0xb2')];_0xdd1def[_0x2041('0xbb')]=_[_0x2041('0xbc')](_0x20d319[_0x2041('0xbd')],['priority'],[_0x2041('0xbe')]);if(_0xdd1def[_0x2041('0xb9')][_0x2041('0xbd')]){delete _0xdd1def[_0x2041('0xb9')][_0x2041('0xbd')];}if(_0xdd1def['account'][_0x2041('0xb2')]&&_0xdd1def[_0x2041('0xb9')][_0x2041('0xb2')][_0x2041('0xb3')][_0x2041('0x80')]){return _0xdd1def['account'][_0x2041('0xb2')][_0x2041('0xb3')][0x0];}var _0x3c35f3=_[_0x2041('0x11')](_0x4f0730[_0x2041('0x74')],{'firstName':_0x4f0730['body'][_0x2041('0xaa')],'ListId':_0x20d319[_0x2041('0xa9')]});_0x3c35f3[_0x4f0730[_0x2041('0x74')][_0x2041('0xb0')]]=_0x4f0730[_0x2041('0x74')][_0x2041('0xaa')];return db['CmContact']['create'](_0x3c35f3,{'fields':_0x19f60a,'raw':!![]});})['then'](function(_0x124f98){_0xdd1def['contact']=_0x124f98;var _0x28df2d=createInteractionObject(_0x4f0730[_0x2041('0x70')]['id'],_0x4f0730[_0x2041('0x74')],_0x4f0730['headers'],_0x124f98);var _0x1dd792={'ChatWebsiteId':_0x4f0730[_0x2041('0x70')]['id'],'closed':![]};if(_0x4f0730['body'][_0x2041('0xbf')]){_0x1dd792[_0x2041('0xbf')]=_0x4f0730[_0x2041('0x74')]['threadId'];return db[_0x2041('0xc0')][_0x2041('0x77')]({'where':_0x1dd792})[_0x2041('0x2c')](function(_0x460b6f){if(_0x460b6f){_0x2adf1a=!![];return _0x460b6f;}_0x28df2d[_0x2041('0xbf')]=_0x4f0730[_0x2041('0x74')][_0x2041('0xbf')];_0x28df2d[_0x2041('0xc1')]=_0x4f0730[_0x2041('0x74')][_0x2041('0xc1')];return db[_0x2041('0xc0')][_0x2041('0x73')](_0x28df2d);});}_0x1dd792[_0x2041('0xc2')]=_0x124f98['id'];if(_0x4f0730[_0x2041('0x74')][_0x2041('0xc3')]&&_0x4f0730[_0x2041('0x74')][_0x2041('0xc3')]['id']){_0x1dd792['id']=_0x4f0730[_0x2041('0x74')][_0x2041('0xc3')]['id'];return db[_0x2041('0xc0')][_0x2041('0x77')]({'where':_0x1dd792})[_0x2041('0x2c')](function(_0x50998e){if(_0x50998e){_0x2adf1a=!![];return _0x50998e;}return db[_0x2041('0xc0')][_0x2041('0x73')](_0x28df2d);});}return db[_0x2041('0xc0')]['create'](_0x28df2d);})['then'](function(_0x195861){if(!_0x2adf1a)return _0x195861;var _0x1e565b={'from':(_0xdd1def[_0x2041('0xc4')][_0x2041('0x4b')]||'')+'\x20'+(_0xdd1def[_0x2041('0xc4')]['lastName']||'')};if(_0x4f0730[_0x2041('0x74')]['threadId']&&_0x4f0730[_0x2041('0x74')][_0x2041('0xc5')]&&_0x4f0730[_0x2041('0x74')][_0x2041('0xbf')]!=_0x4f0730[_0x2041('0x74')][_0x2041('0xc5')]){_0x1e565b[_0x2041('0xbf')]=_0x4f0730[_0x2041('0x74')][_0x2041('0xc5')];}return _0x195861[_0x2041('0x2b')](_0x1e565b);})['then'](function(_0x202dc2){_0xdd1def[_0x2041('0xc3')]=_0x202dc2[_0x2041('0x41')]({'plain':!![]});_0xdd1def[_0x2041('0xc3')]['created']=!_0x2adf1a;if(_0xdd1def[_0x2041('0xc3')][_0x2041('0xc6')]){if(_0xdd1def[_0x2041('0xb9')]['autoclose']){_0xdd1def[_0x2041('0xbb')]['push']({'id':0x0,'priority':_0xdd1def[_0x2041('0xbb')][_0x2041('0x80')]+0x1,'app':_0x2041('0xc7'),'appdata':_0x2041('0xc8'),'interval':_0x2041('0xc9')});}}return db[_0x2041('0xca')]['create']({'body':_0x4f0730[_0x2041('0x74')]['body'],'ChatWebsiteId':_0x4f0730[_0x2041('0x70')]['id'],'ChatInteractionId':_0x202dc2['id'],'direction':'in','ContactId':_0xdd1def[_0x2041('0xc4')]['id'],'AttachmentId':_0x4f0730[_0x2041('0x74')]['AttachmentId']});})[_0x2041('0x2c')](function(_0xcf28f5){_0xdd1def['message']=_0xcf28f5;if(!_0xdd1def['interaction'][_0x2041('0xcb')]){return;}return db[_0x2041('0xcc')][_0x2041('0x77')]({'attributes':['id',_0x2041('0x32')],'where':{'id':_0xdd1def[_0x2041('0xc3')][_0x2041('0xcb')]}});})['then'](function(_0x5bdd03){if(_0x5bdd03){_0xdd1def['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x2041('0xcd'),'appdata':_0x5bdd03[_0x2041('0x32')]+','+(_0xdd1def[_0x2041('0xb9')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0xdd1def['forcedOwnership']=!![];}if(!_0xdd1def['interaction'][_0x2041('0xce')]){return;}return db[_0x2041('0xcf')][_0x2041('0x77')]({'attributes':['id',_0x2041('0x32')],'where':{'id':_0xdd1def[_0x2041('0xc3')][_0x2041('0xce')]}});})['then'](function(_0x2d9640){if(_0x2d9640){_0xdd1def[_0x2041('0xbb')][_0x2041('0xd0')]({'id':0x0,'priority':0x1,'app':_0x2041('0xd1'),'appdata':_0x2d9640['name']+','+(_0xdd1def['account']['waitForTheAssignedQueue']||0x12c),'interval':_0x2041('0xc9')});}return respondWithRpcPromise('Start','startRouting',_0xdd1def);})[_0x2041('0x2c')](function(_0x437ce4){respondWithRpcPromise(_0x2041('0xd2'),_0x2041('0xd2'),{'event':'notify','message':_0x437ce4},client9002);return _0x437ce4;})['then'](respondWithResult(_0x56cb5c,null))['catch'](APIHandleError(_0x56cb5c));};exports[_0x2041('0xd3')]=function(_0x38b073,_0x5458a7){var _0x232989,_0x128e72,_0x1dc0ff;var _0xa35c01=[];var _0x352a9c={};var _0x51e47a=_0x38b073[_0x2041('0xd4')]||[];var _0x38a258=[];var _0x571ea1;return db['CmContact'][_0x2041('0x7b')]()[_0x2041('0x2c')](function(_0x23627a){if(!_0x23627a){throw new db[(_0x2041('0xa3'))][(_0x2041('0xab'))](_0x2041('0xa4'));}_0xa35c01=_['difference'](_[_0x2041('0x5f')](_0x23627a),[_0x2041('0xa6'),_0x2041('0xa7'),_0x2041('0xa8'),_0x2041('0xa9')]);if(_0x38b073[_0x2041('0x74')]['id']){delete _0x38b073[_0x2041('0x74')]['id'];}if(_[_0x2041('0x95')](_0x38b073['body'][_0x2041('0xaa')])){throw _0x5458a7[_0x2041('0x24')](0x1f4)['send'](new db[(_0x2041('0xa3'))][(_0x2041('0xab'))]('from\x20is\x20mandatory'));}if(_[_0x2041('0x95')](_0x38b073[_0x2041('0x74')][_0x2041('0x74')])||_0x38b073[_0x2041('0x74')][_0x2041('0x74')]===''){throw _0x5458a7[_0x2041('0x24')](0x1f4)['send'](new db[(_0x2041('0xa3'))][(_0x2041('0xab'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x2041('0x95')](_0x38b073[_0x2041('0x74')]['mapKeyOffline'])){throw _0x5458a7[_0x2041('0x24')](0x1f4)[_0x2041('0xd5')](new db['Sequelize']['ValidationError'](_0x2041('0xd6')+_0xa35c01));}if(!_[_0x2041('0xae')](_0xa35c01,_0x38b073[_0x2041('0x74')][_0x2041('0xd7')])){throw _0x5458a7[_0x2041('0x24')](0x1f4)[_0x2041('0xd5')](new db['Sequelize'][(_0x2041('0xab'))](_0x2041('0xd8')+_0xa35c01));}_0x352a9c[_0x38b073[_0x2041('0x74')][_0x2041('0xd7')]]=_0x38b073[_0x2041('0x74')]['from'];})[_0x2041('0x2c')](function(){return db[_0x2041('0x5a')][_0x2041('0x77')]({'where':{'id':_0x38b073[_0x2041('0x70')]['id']},'include':[{'model':db[_0x2041('0xb1')],'as':'List'},{'model':db[_0x2041('0xd9')],'as':_0x2041('0xd9')}]});})[_0x2041('0x2c')](handleEntityNotFound(_0x5458a7,null))['then'](function(_0x1ed4a5){if(_0x1ed4a5&&_0x1ed4a5[_0x2041('0xb2')]){_0x128e72=_0x1ed4a5;var _0x217294=_[_0x2041('0x11')](_0x38b073[_0x2041('0x74')],{'firstName':_0x38b073[_0x2041('0x74')][_0x2041('0xaa')],'phone':_0x38b073['body'][_0x2041('0xaa')],'ListId':_0x1ed4a5[_0x2041('0xa9')]});_0x217294[_0x38b073['body'][_0x2041('0xd7')]]=_0x38b073[_0x2041('0x74')][_0x2041('0xaa')];return db[_0x2041('0xa2')][_0x2041('0xda')]({'where':_0x352a9c,'defaults':_0x217294});}})['spread'](function(_0x52a921){if(_0x52a921){_0x1dc0ff=_0x52a921;var _0x3f4364=fs[_0x2041('0xdb')](path['join'](config[_0x2041('0x90')],_0x2041('0xdc')),'utf8');var _0x10d71c=ejs[_0x2041('0xdd')](_0x3f4364,{'body':_['toPairs'](_0x38b073['body'][_0x2041('0x74')]),'bodyTitle':_0x128e72[_0x2041('0xde')]});return db[_0x2041('0xdf')][_0x2041('0x73')]({'body':_0x10d71c,'plainBody':htmlToText['fromString'](_0x10d71c),'ContactId':_0x52a921['id'],'ChatWebsiteId':_0x128e72['id']});}})[_0x2041('0x2c')](function(_0x179e78){_0x571ea1=_0x179e78;if(_0x51e47a[_0x2041('0x80')]){var _0x37629f=_0x51e47a[_0x2041('0x40')](function(_0x63f2f7){return{'name':_0x63f2f7[_0x2041('0xe0')],'basename':_0x63f2f7[_0x2041('0x88')],'type':_0x63f2f7[_0x2041('0xe1')],'ChatOfflineMessageId':_0x179e78['id']};});_0x38a258=_0x37629f[_0x2041('0x40')](_0x243dad=>{var _0x7e48fb={'filename':_0x243dad['name'],'path':path['join'](config[_0x2041('0x90')],_0x2041('0xe2'),_0x2041('0xd4'),'attachments',_0x2041('0xe3'),_0x243dad['basename'])};return _0x7e48fb;});if(!_0x128e72[_0x2041('0xe4')]){return db['sequelize']['transaction'](function(_0x27da2e){return db[_0x2041('0xe5')]['bulkCreate'](_0x37629f,{'transaction':_0x27da2e});});}}})[_0x2041('0x2c')](function(){if(_0x571ea1){_0x232989=_0x571ea1;return db[_0x2041('0xd9')][_0x2041('0xe6')]({'where':{'service':!![]},'include':[{'model':db[_0x2041('0xe7')],'as':_0x2041('0xe8'),'raw':!![],'include':[{'model':db[_0x2041('0xe9')],'as':_0x2041('0xe9'),'raw':!![]}]}]});}})['then'](function(_0x44dc8e){if(_0x44dc8e&&_0x44dc8e['Smtp']&&_0x128e72[_0x2041('0xea')]&&_0x128e72[_0x2041('0xeb')]){var _0x67ae73=_0x44dc8e[_0x2041('0xec')]();return respondWithRpcPromise(_0x2041('0xed'),_0x2041('0xee'),{'account':_0x67ae73,'message':{'from':util[_0x2041('0x51')](_0x2041('0xef'),_0x44dc8e[_0x2041('0x32')],_0x44dc8e['email']||_0x44dc8e['Smtp'][_0x2041('0xf0')]),'to':_0x128e72[_0x2041('0xeb')],'subject':_0x128e72[_0x2041('0xf1')],'html':_0x232989[_0x2041('0x74')],'attachments':_0x38a258}},client9003)[_0x2041('0x2c')](function(){return _0x232989;})[_0x2041('0x22')](function(_0x2f50ca){logger[_0x2041('0x1e')](_0x2f50ca);});}})[_0x2041('0x2c')](function(){if(_0x128e72&&_0x128e72[_0x2041('0xe4')]&&_0x128e72[_0x2041('0xf2')]){var _0x436e5d=[];if(_0x51e47a[_0x2041('0x80')]){_0x436e5d=_0x51e47a[_0x2041('0x40')](function(_0x576913){return{'name':_0x576913[_0x2041('0xe0')],'basename':_0x576913['filename'],'type':_0x576913['mimetype'],'ChatOfflineMessageId':_0x571ea1['id']};});}var _0x221d0c;if(!_[_0x2041('0x95')](_0x128e72[_0x2041('0xf3')])){var _0x3aef3f=_[_0x2041('0x40')](_0x38b073[_0x2041('0x74')],function(_0x4c983b){return _0x4c983b;});var _0x58519a=_[_0x2041('0xf4')](_0x3aef3f)[0x0];var _0x2da1ab=_[_0x2041('0xf5')](_0x58519a,function(_0x2ba7a4){return _0x2ba7a4;});_0x221d0c=_0x2da1ab[0x1][_0x128e72[_0x2041('0xf3')]];}var _0x5b3764={'from':_0x1dc0ff['email'],'firstName':_0x1dc0ff[_0x2041('0x4b')],'lastName':_0x1dc0ff['lastName'],'mapKey':_0x2041('0xf6'),'message':{'from':_0x1dc0ff[_0x2041('0xf6')],'to':_0x128e72['MailAccount'][_0x2041('0xf6')],'cc':'','subject':_[_0x2041('0x95')](_0x221d0c)?_0x128e72['offlineMessageSubject']:_0x221d0c,'messageId':'','sentAt':new Date(),'attach':_0x436e5d[_0x2041('0x80')],'attachments':_0x436e5d,'originChannel':_0x2041('0xf7'),'ChatWebsiteId':_0x128e72['id'],'ChatOfflineMessageId':_0x232989['id'],'originTo':_0x128e72[_0x2041('0xd9')][_0x2041('0xf6')]},'body':_0x232989[_0x2041('0x74')]};var _0x54cde2={'account':{'id':_0x128e72['MailAccountId']},'body':_0x5b3764,'log':_0x2041('0xf8')};return respondWithRpcPromise(_0x2041('0xf8'),_0x2041('0xf9'),_0x54cde2,client9001)[_0x2041('0x2c')](function(){return _0x232989;})[_0x2041('0x22')](function(_0x33d42b){logger[_0x2041('0x1e')](_0x33d42b);});}return;})[_0x2041('0x2c')](function(){if(_0x232989){return _0x232989;}})[_0x2041('0x2c')](respondWithResult(_0x5458a7,null))['catch'](function(){for(var _0x5a81b0 of _0x51e47a){var _0x1eae91=path[_0x2041('0x8f')](config[_0x2041('0x90')],'server',_0x2041('0xd4'),'attachments',_0x2041('0xe3'),_0x5a81b0[_0x2041('0x88')]);fs_extra[_0x2041('0xfa')](_0x1eae91)[_0x2041('0x22')](function(_0x246395){logger[_0x2041('0x1e')](_0x2041('0xfb'),_0x1eae91,_0x246395);});}});};exports['addInteraction']=function(_0x23a045,_0x68a7d8){return db[_0x2041('0xc0')][_0x2041('0x77')]({'where':{'id':_0x23a045[_0x2041('0x70')]['id']}})['then'](handleEntityNotFound(_0x68a7d8,null))[_0x2041('0x2c')](function(_0x3ca2a5){if(_0x3ca2a5){return _0x3ca2a5[_0x2041('0xfc')](_0x23a045[_0x2041('0x74')][_0x2041('0x83')],_['omit'](_0x23a045[_0x2041('0x74')],[_0x2041('0x83'),'id'])||{});}})[_0x2041('0x2c')](respondWithResult(_0x68a7d8,null))[_0x2041('0x22')](handleError(_0x68a7d8,null));};exports['getInteractions']=function(_0x1ae8c8,_0x3579bf){var _0x37227a={'raw':![],'where':{}};var _0x5af4b1={};var _0x2ba7d5={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x1ae8c8['params']['id']}})['then'](handleEntityNotFound(_0x3579bf,null))[_0x2041('0x2c')](function(_0x11a879){if(_0x11a879){_0x5af4b1[_0x2041('0x56')]=_['keys'](db['ChatInteraction'][_0x2041('0x5b')]);_0x5af4b1['query']=_[_0x2041('0x5f')](_0x1ae8c8['query']);_0x5af4b1['filters']=_[_0x2041('0x72')](_0x5af4b1[_0x2041('0x56')],_0x5af4b1[_0x2041('0x5e')]);_0x37227a[_0x2041('0x60')]=_[_0x2041('0x72')](_0x5af4b1[_0x2041('0x56')],qs[_0x2041('0x61')](_0x1ae8c8[_0x2041('0x5e')][_0x2041('0x61')]));_0x37227a[_0x2041('0x60')]=_0x37227a[_0x2041('0x60')][_0x2041('0x80')]?_0x37227a[_0x2041('0x60')]:_0x5af4b1[_0x2041('0x56')];if(!_0x1ae8c8[_0x2041('0x5e')][_0x2041('0x62')](_0x2041('0x81'))){_0x37227a['limit']=qs[_0x2041('0x29')](_0x1ae8c8[_0x2041('0x5e')][_0x2041('0x29')]);_0x37227a[_0x2041('0x28')]=qs['offset'](_0x1ae8c8[_0x2041('0x5e')][_0x2041('0x28')]);}_0x37227a['order']=qs[_0x2041('0x64')](_0x1ae8c8['query'][_0x2041('0x64')]);_0x37227a[_0x2041('0x65')]=qs[_0x2041('0x67')](_[_0x2041('0x66')](_0x1ae8c8[_0x2041('0x5e')],_0x5af4b1[_0x2041('0x67')]));_0x37227a[_0x2041('0x65')][_0x2041('0x7d')]=_0x11a879['id'];if(_0x1ae8c8['query'][_0x2041('0x68')]){_0x37227a['where']=_[_0x2041('0x69')](_0x37227a[_0x2041('0x65')],{'$or':_[_0x2041('0x40')](_0x37227a['attributes'],function(_0x5e4fd3){var _0x286360={};_0x286360[_0x5e4fd3]={'$like':'%'+_0x1ae8c8[_0x2041('0x5e')][_0x2041('0x68')]+'%'};return _0x286360;})});}_0x37227a=_['merge']({},_0x37227a,_0x1ae8c8[_0x2041('0x6a')]);return db[_0x2041('0xc0')][_0x2041('0x27')]({'where':_0x37227a[_0x2041('0x65')]})['then'](function(_0x4c9b0f){_0x2ba7d5[_0x2041('0x27')]=_0x4c9b0f;if(_0x1ae8c8[_0x2041('0x5e')][_0x2041('0x6b')]){_0x37227a[_0x2041('0x6c')]=[{'model':db['CmContact'],'as':_0x2041('0xfd'),'required':![]},{'model':db[_0x2041('0xcc')],'as':'Owner','attributes':['name',_0x2041('0xfe'),_0x2041('0xff')],'required':![]},{'model':db[_0x2041('0x100')],'as':_0x2041('0x101'),'attributes':['id',_0x2041('0x32'),_0x2041('0x102')],'where':_0x1ae8c8['query'][_0x2041('0x103')]?{'id':_0x1ae8c8[_0x2041('0x5e')][_0x2041('0x103')]}:undefined,'required':_0x1ae8c8[_0x2041('0x5e')][_0x2041('0x103')]?!![]:![]}];}return db[_0x2041('0xc0')][_0x2041('0x6d')](_0x37227a);})[_0x2041('0x2c')](function(_0x4a13b4){_0x2ba7d5['rows']=_0x4a13b4;return _0x2ba7d5;});}})[_0x2041('0x2c')](respondWithFilteredResult(_0x3579bf,_0x37227a))['catch'](handleError(_0x3579bf,null));};exports[_0x2041('0x34')]=function(_0x3d16ec,_0xb9d5db){var _0x1d0543=0x0;var _0x1a95fc=0x0;var _0x812fcb=![];var _0x15f21b;var _0x4856b4;return db['ChatWebsite'][_0x2041('0x77')]({'where':{'id':_0x3d16ec['params']['id']},'include':[{'model':db[_0x2041('0xb6')],'as':_0x2041('0xb6'),'include':[{'model':db[_0x2041('0xb6')],'as':_0x2041('0xb7'),'attributes':['id','interval']}]}]})[_0x2041('0x2c')](handleEntityNotFound(_0xb9d5db,null))[_0x2041('0x2c')](function(_0xf913fa){if(_0xf913fa){_0x15f21b=_0xf913fa;return _0xf913fa['getProactiveActions']({'raw':!![]});}})[_0x2041('0x2c')](function(_0x4f7f90){if(_0x15f21b){if(_0x4f7f90){_0x4856b4=_0x4f7f90;}}return require(_0x2041('0x92'))[_0x2041('0x93')]();})[_0x2041('0x2c')](function(_0x5f002d){if(_0x5f002d){_0x1a95fc=_0x5f002d[_0x2041('0x104')];_0x812fcb=_0x5f002d[_0x2041('0x94')];}})['then'](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0x2041('0x2c')](function(_0x3312ab){_0x1d0543=_0x3312ab;if(_0x1a95fc&&_0x3312ab>_0x1a95fc){return db[_0x2041('0x105')][_0x2041('0xe6')]({'where':{'id':0x1}})[_0x2041('0x2c')](function(_0x453b6d){if(_0x453b6d){_0x453b6d[_0x2041('0x106')](_0x2041('0x107'));}});}})[_0x2041('0x2c')](function(){if(!_0x15f21b[_0x2041('0xb6')]||!_0x15f21b[_0x2041('0xb6')][_0x2041('0xb7')])return!![];return checkWebsiteIntervals(_0x15f21b);})[_0x2041('0x2c')](function(_0x237b8b){var _0x47670a=fs['readFileSync'](path['join'](config['root'],_0x2041('0x108')),_0x2041('0x109'));var _0x467557=new url['URL'](_0x15f21b[_0x2041('0x10a')])[_0x2041('0x10b')];var _0x31618a=_0x2041('0x10c');var _0x2e4b9c=![];var _0x44d443={'chatVersion':_0x31618a,'chatWebsiteAddressOrigin':_0x467557,'remote':_0x15f21b[_0x2041('0x10d')],'query':querystring[_0x2041('0x1d')](_[_0x2041('0x69')](_0x15f21b[_0x2041('0x41')]({'plain':!![]}),{'customerIp':_0x3d16ec['headers'][_0x2041('0x49')]||_0x3d16ec[_0x2041('0x10e')]['x-real-ip']||_0x3d16ec[_0x2041('0x10f')]['remoteAddress']||_0x3d16ec['ip'],'referer':_0x3d16ec[_0x2041('0x10e')][_0x2041('0x4e')],'openedInteractions':_0x1d0543,'maxInteractions':_0x1a95fc,'virtual':_0x812fcb['virtual'],'online':_0x237b8b,'custom':_0x812fcb}))[_0x2041('0x110')](/'/g,'\x5c\x27')};_0xb9d5db[_0x2041('0xd5')](ejs[_0x2041('0xdd')](Mustache[_0x2041('0xdd')](_0x47670a,_0x44d443),{'proactiveActions':_0x4856b4,'alignment':_0x15f21b['alignment'],'verticalAlignment':_0x15f21b['verticalAlignment'],'div_color':_0x15f21b[_0x2041('0x102')],'labelText':_0x15f21b[_0x2041('0x111')],'text_color':_0x15f21b[_0x2041('0x112')],'text_button_color':_0x15f21b[_0x2041('0x113')],'button_color':_0x15f21b['color_button'],'background_color':_0x15f21b[_0x2041('0x114')],'hideWhenOffline':_0x15f21b[_0x2041('0x115')],'intervalId':_0x15f21b[_0x2041('0x116')],'isDevelopment':_0x2e4b9c,'chatVersion':_0x31618a}));})[_0x2041('0x22')](handleError(_0xb9d5db,null));};exports[_0x2041('0x117')]=function(_0x35a7ba,_0x23c1f8){var _0x20b45c=_0x35a7ba[_0x2041('0x70')]['id'];var _0x48734c=_0x35a7ba[_0x2041('0x74')];var _0x1575c6=0xc8;var _0xea92aa=null;return db[_0x2041('0x118')][_0x2041('0x119')]({'isolationLevel':db['sequelize'][_0x2041('0x11a')][_0x2041('0x11b')]['READ_COMMITTED']},function(_0x51d4cd){return db[_0x2041('0x5a')][_0x2041('0xe6')]({'where':{'id':_0x20b45c},'transaction':_0x51d4cd})['then'](function(_0x2593fa){if(_0x2593fa){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x20b45c},'transaction':_0x51d4cd})[_0x2041('0x2c')](function(){var _0x30d6b5=_[_0x2041('0x40')](_0x48734c,function(_0x339685){_0x339685[_0x2041('0x7d')]=_0x20b45c;return _0x339685;});return db['ChatApplication'][_0x2041('0x11c')](_0x30d6b5,{'transaction':_0x51d4cd});});}else{_0x1575c6=0x194;_0xea92aa=[];}});})['then'](function(){if(_0x1575c6!==0x194){return db[_0x2041('0xb5')][_0x2041('0x11d')]({'where':{'ChatWebsiteId':_0x20b45c},'order':_0x2041('0x11e')})[_0x2041('0x2c')](function(_0x405dda){_0xea92aa=_0x405dda;});}})['catch'](function(_0x210b26){_0x1575c6=0x1f4;logger[_0x2041('0x1e')](_0x210b26[_0x2041('0x31')]);if(_0x210b26[_0x2041('0x32')]){delete _0x210b26[_0x2041('0x32')];}_0xea92aa=_0x210b26;})[_0x2041('0x11f')](function(){if(_0xea92aa===null){_0x23c1f8[_0x2041('0x23')](_0x1575c6);}else{if(_0x1575c6===0x1f4){_0x23c1f8['status'](_0x1575c6)[_0x2041('0xd5')](_0xea92aa);}else{_0x23c1f8[_0x2041('0x24')](_0x1575c6)['json'](_0xea92aa);}}});};exports[_0x2041('0x120')]=function(_0x28e3f7,_0xe93cf1){var _0x50dd97={};var _0x1709c1={};var _0x4ed22a;var _0x46e91f;return db[_0x2041('0x5a')]['findOne']({'where':{'id':_0x28e3f7[_0x2041('0x70')]['id']}})[_0x2041('0x2c')](handleEntityNotFound(_0xe93cf1,null))[_0x2041('0x2c')](function(_0xdf1b4f){if(_0xdf1b4f){_0x4ed22a=_0xdf1b4f;_0x1709c1[_0x2041('0x56')]=_['keys'](db[_0x2041('0xb5')][_0x2041('0x5b')]);_0x1709c1[_0x2041('0x5e')]=_[_0x2041('0x5f')](_0x28e3f7[_0x2041('0x5e')]);_0x1709c1[_0x2041('0x67')]=_[_0x2041('0x72')](_0x1709c1['model'],_0x1709c1[_0x2041('0x5e')]);_0x50dd97[_0x2041('0x60')]=_['intersection'](_0x1709c1['model'],qs['fields'](_0x28e3f7['query']['fields']));_0x50dd97[_0x2041('0x60')]=_0x50dd97['attributes']['length']?_0x50dd97['attributes']:_0x1709c1[_0x2041('0x56')];_0x50dd97['order']=qs[_0x2041('0x64')](_0x28e3f7[_0x2041('0x5e')]['sort']);_0x50dd97[_0x2041('0x65')]=qs['filters'](_['pick'](_0x28e3f7[_0x2041('0x5e')],_0x1709c1[_0x2041('0x67')]));if(_0x28e3f7[_0x2041('0x5e')][_0x2041('0x68')]){_0x50dd97[_0x2041('0x65')]=_['merge'](_0x50dd97[_0x2041('0x65')],{'$or':_[_0x2041('0x40')](_0x50dd97[_0x2041('0x60')],function(_0x1b9a25){var _0x1e4fbc={};_0x1e4fbc[_0x1b9a25]={'$like':'%'+_0x28e3f7[_0x2041('0x5e')][_0x2041('0x68')]+'%'};return _0x1e4fbc;})});}_0x50dd97=_[_0x2041('0x69')]({},_0x50dd97,_0x28e3f7['options']);return _0x4ed22a[_0x2041('0x120')](_0x50dd97);}})[_0x2041('0x2c')](function(_0x4104ac){if(_0x4104ac){_0x46e91f=_0x4104ac[_0x2041('0x80')];if(!_0x28e3f7[_0x2041('0x5e')][_0x2041('0x62')](_0x2041('0x81'))){_0x50dd97[_0x2041('0x29')]=qs[_0x2041('0x29')](_0x28e3f7[_0x2041('0x5e')]['limit']);_0x50dd97[_0x2041('0x28')]=qs[_0x2041('0x28')](_0x28e3f7[_0x2041('0x5e')][_0x2041('0x28')]);}return _0x4ed22a[_0x2041('0x120')](_0x50dd97);}})[_0x2041('0x2c')](function(_0x2485cf){if(_0x2485cf){return _0x2485cf?{'count':_0x46e91f,'rows':_0x2485cf}:null;}})[_0x2041('0x2c')](respondWithResult(_0xe93cf1,null))[_0x2041('0x22')](handleError(_0xe93cf1,null));};exports[_0x2041('0x121')]=function(_0x46efa3,_0x43954d){return db['chatProactiveAction'][_0x2041('0x77')]({'where':{'id':_0x46efa3[_0x2041('0x70')]['id']}})[_0x2041('0x2c')](handleEntityNotFound(_0x43954d,null))[_0x2041('0x2c')](function(_0x41948b){if(_0x41948b){return _0x41948b[_0x2041('0x121')](_0x46efa3[_0x2041('0x74')][_0x2041('0x83')],_[_0x2041('0x122')](_0x46efa3[_0x2041('0x74')],[_0x2041('0x83'),'id'])||{});}})[_0x2041('0x2c')](respondWithResult(_0x43954d,null))[_0x2041('0x22')](handleError(_0x43954d,null));};exports[_0x2041('0x123')]=function(_0x5c4607,_0x112a04){var _0xfebf98={};var _0x26e728={};var _0x403a71;var _0x3c43fd;return db[_0x2041('0x5a')]['findOne']({'where':{'id':_0x5c4607[_0x2041('0x70')]['id']}})['then'](handleEntityNotFound(_0x112a04,null))[_0x2041('0x2c')](function(_0x1a9302){if(_0x1a9302){_0x403a71=_0x1a9302;_0x26e728[_0x2041('0x56')]=_[_0x2041('0x5f')](db[_0x2041('0x124')]['rawAttributes']);_0x26e728['query']=_['keys'](_0x5c4607[_0x2041('0x5e')]);_0x26e728[_0x2041('0x67')]=_['intersection'](_0x26e728[_0x2041('0x56')],_0x26e728[_0x2041('0x5e')]);_0xfebf98[_0x2041('0x60')]=_[_0x2041('0x72')](_0x26e728['model'],qs[_0x2041('0x61')](_0x5c4607['query'][_0x2041('0x61')]));_0xfebf98[_0x2041('0x60')]=_0xfebf98[_0x2041('0x60')][_0x2041('0x80')]?_0xfebf98['attributes']:_0x26e728[_0x2041('0x56')];_0xfebf98[_0x2041('0x63')]=qs[_0x2041('0x64')](_0x5c4607[_0x2041('0x5e')]['sort']);_0xfebf98[_0x2041('0x65')]=qs[_0x2041('0x67')](_[_0x2041('0x66')](_0x5c4607[_0x2041('0x5e')],_0x26e728[_0x2041('0x67')]));if(_0x5c4607['query'][_0x2041('0x68')]){_0xfebf98['where']=_[_0x2041('0x69')](_0xfebf98[_0x2041('0x65')],{'$or':_[_0x2041('0x40')](_0xfebf98[_0x2041('0x60')],function(_0x4696bd){var _0x332495={};_0x332495[_0x4696bd]={'$like':'%'+_0x5c4607[_0x2041('0x5e')][_0x2041('0x68')]+'%'};return _0x332495;})});}_0xfebf98=_[_0x2041('0x69')]({},_0xfebf98,_0x5c4607[_0x2041('0x6a')]);return _0x403a71[_0x2041('0x123')](_0xfebf98);}})[_0x2041('0x2c')](function(_0x5ea408){if(_0x5ea408){_0x3c43fd=_0x5ea408[_0x2041('0x80')];if(!_0x5c4607[_0x2041('0x5e')]['hasOwnProperty'](_0x2041('0x81'))){_0xfebf98[_0x2041('0x29')]=qs[_0x2041('0x29')](_0x5c4607['query'][_0x2041('0x29')]);_0xfebf98[_0x2041('0x28')]=qs['offset'](_0x5c4607[_0x2041('0x5e')][_0x2041('0x28')]);}return _0x403a71[_0x2041('0x123')](_0xfebf98);}})[_0x2041('0x2c')](function(_0x10f819){if(_0x10f819){return _0x10f819?{'count':_0x3c43fd,'rows':_0x10f819}:null;}})[_0x2041('0x2c')](respondWithResult(_0x112a04,null))[_0x2041('0x22')](handleError(_0x112a04,null));};exports[_0x2041('0x125')]=function(_0x1f186d,_0xa22685){var _0x45c970=_0x1f186d[_0x2041('0x5e')][_0x2041('0x126')]===_0x2041('0x127')?_0x2041('0x128'):_0x2041('0x129');return db[_0x2041('0x5a')][_0x2041('0x77')]({'attributes':['id',_0x45c970],'where':{'id':_0x1f186d[_0x2041('0x70')]['id']}})[_0x2041('0x2c')](handleEntityNotFound(_0xa22685,null))['then'](function(_0x501bf9){if(_0x501bf9){var _0x3254a9=_0x501bf9[_0x45c970];var _0x4fc3f4=_0x3254a9&&_0x3254a9[_0x2041('0x12a')]?_0x3254a9[_0x2041('0x12a')]:[];_0xa22685[_0x2041('0xd5')]({'fromKey':_['isNil'](_0x3254a9['fromKey'])?undefined:_0x3254a9['fromKey'],'count':_0x4fc3f4[_0x2041('0x80')],'rows':_0x4fc3f4});}})[_0x2041('0x22')](handleError(_0xa22685,null));};exports[_0x2041('0x12b')]=function(_0x26301f,_0x499e46){var _0x3660ff={'raw':![],'where':{}};var _0x2e8ba1={};var _0x17870f={'count':0x0,'rows':[]};return db[_0x2041('0x5a')][_0x2041('0xe6')]({'where':{'id':_0x26301f[_0x2041('0x70')]['id']}})[_0x2041('0x2c')](handleEntityNotFound(_0x499e46,null))['then'](function(_0x20f09d){if(_0x20f09d){_0x2e8ba1['model']=_[_0x2041('0x5f')](db[_0x2041('0xdf')][_0x2041('0x5b')]);_0x2e8ba1[_0x2041('0x5e')]=_[_0x2041('0x5f')](_0x26301f['query']);_0x2e8ba1[_0x2041('0x67')]=_[_0x2041('0x72')](_0x2e8ba1[_0x2041('0x56')],_0x2e8ba1[_0x2041('0x5e')]);_0x3660ff[_0x2041('0x60')]=_['intersection'](_0x2e8ba1['model'],qs['fields'](_0x26301f[_0x2041('0x5e')][_0x2041('0x61')]));_0x3660ff[_0x2041('0x60')]=_0x3660ff[_0x2041('0x60')][_0x2041('0x80')]?_0x3660ff[_0x2041('0x60')]:_0x2e8ba1[_0x2041('0x56')];if(!_0x26301f[_0x2041('0x5e')][_0x2041('0x62')](_0x2041('0x81'))){_0x3660ff['limit']=qs[_0x2041('0x29')](_0x26301f['query'][_0x2041('0x29')]);_0x3660ff[_0x2041('0x28')]=qs[_0x2041('0x28')](_0x26301f['query'][_0x2041('0x28')]);}_0x3660ff[_0x2041('0x63')]=qs[_0x2041('0x64')](_0x26301f['query'][_0x2041('0x64')]);_0x3660ff[_0x2041('0x65')]=qs[_0x2041('0x67')](_['pick'](_0x26301f[_0x2041('0x5e')],_0x2e8ba1[_0x2041('0x67')]));_0x3660ff['where']['ChatWebsiteId']=_0x20f09d['id'];if(_0x26301f[_0x2041('0x5e')][_0x2041('0x68')]){_0x3660ff['where']=_['merge'](_0x3660ff[_0x2041('0x65')],{'$or':_[_0x2041('0x40')](_0x3660ff[_0x2041('0x60')],function(_0x49837a){var _0x3fbaef={};_0x3fbaef[_0x49837a]={'$like':'%'+_0x26301f[_0x2041('0x5e')][_0x2041('0x68')]+'%'};return _0x3fbaef;})});}_0x3660ff=_['merge']({},_0x3660ff,_0x26301f['options']);return db[_0x2041('0xdf')][_0x2041('0x27')]({'where':_0x3660ff[_0x2041('0x65')]})[_0x2041('0x2c')](function(_0x52c9ff){_0x17870f[_0x2041('0x27')]=_0x52c9ff;if(_0x26301f['query'][_0x2041('0x6b')]){_0x3660ff['include']=[{'all':!![]}];}else{_0x3660ff[_0x2041('0x6c')]=[{'model':db[_0x2041('0xa2')],'as':'Contact','required':![]},{'model':db[_0x2041('0xe5')],'as':_0x2041('0x12c'),'required':![]}];}return db[_0x2041('0xdf')]['findAll'](_0x3660ff);})['then'](function(_0x33f21c){_0x17870f[_0x2041('0x6e')]=_0x33f21c;return _0x17870f;});}})[_0x2041('0x2c')](respondWithFilteredResult(_0x499e46,_0x3660ff))[_0x2041('0x22')](handleError(_0x499e46,null));};exports[_0x2041('0x12d')]=function(_0x323406,_0xeb25a8){return db[_0x2041('0x5a')]['find']({'where':{'id':_0x323406['params']['id']}})[_0x2041('0x2c')](handleEntityNotFound(_0xeb25a8,null))[_0x2041('0x2c')](function(_0x486162){if(_0x486162){return _0x486162[_0x2041('0x12d')](_0x323406[_0x2041('0x74')][_0x2041('0x83')],_[_0x2041('0x122')](_0x323406[_0x2041('0x74')],['ids','id'])||{})[_0x2041('0xb8')](function(_0x2cf533){for(var _0x4381d2=0x0;_0x4381d2<_0x323406[_0x2041('0x74')][_0x2041('0x83')][_0x2041('0x80')];_0x4381d2+=0x1){socket[_0x2041('0x12e')]('userChatWebsite:save',{'UserId':Number(_0x323406[_0x2041('0x74')][_0x2041('0x83')][_0x4381d2]),'ChatWebsiteId':Number(_0x323406['params']['id'])});}return _0x2cf533;});}})[_0x2041('0x2c')](respondWithResult(_0xeb25a8,null))[_0x2041('0x22')](handleError(_0xeb25a8,null));};exports[_0x2041('0x12f')]=function(_0x8406e0,_0x5ce8f7){return db[_0x2041('0x5a')][_0x2041('0x77')]({'where':{'id':_0x8406e0['params']['id']}})[_0x2041('0x2c')](handleEntityNotFound(_0x5ce8f7,null))[_0x2041('0x2c')](function(_0x59172b){if(_0x59172b){return _0x59172b[_0x2041('0x12f')](_0x8406e0[_0x2041('0x5e')][_0x2041('0x83')])[_0x2041('0x2c')](function(){if(_['isArray'](_0x8406e0[_0x2041('0x5e')][_0x2041('0x83')])){for(var _0x1bf063=0x0;_0x1bf063<_0x8406e0[_0x2041('0x5e')]['ids'][_0x2041('0x80')];_0x1bf063+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x8406e0[_0x2041('0x5e')][_0x2041('0x83')][_0x1bf063]),'ChatWebsiteId':Number(_0x8406e0['params']['id'])});}}else{socket[_0x2041('0x12e')](_0x2041('0x130'),{'UserId':Number(_0x8406e0[_0x2041('0x5e')][_0x2041('0x83')]),'ChatWebsiteId':Number(_0x8406e0['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5ce8f7,null))[_0x2041('0x22')](handleError(_0x5ce8f7,null));};exports[_0x2041('0x131')]=function(_0x2d50d5,_0xc9882f){var _0x3568e1={};var _0x5f2202={};var _0x4aa29a;var _0xde3767;return db['ChatWebsite'][_0x2041('0xe6')]({'where':{'id':_0x2d50d5[_0x2041('0x70')]['id']}})[_0x2041('0x2c')](handleEntityNotFound(_0xc9882f,null))[_0x2041('0x2c')](function(_0x46ea89){if(_0x46ea89){_0x4aa29a=_0x46ea89;_0x5f2202[_0x2041('0x56')]=_[_0x2041('0x5f')](db[_0x2041('0xcc')]['rawAttributes']);_0x5f2202[_0x2041('0x5e')]=_[_0x2041('0x5f')](_0x2d50d5[_0x2041('0x5e')]);_0x5f2202[_0x2041('0x67')]=_[_0x2041('0x72')](_0x5f2202['model'],_0x5f2202['query']);_0x3568e1['attributes']=_[_0x2041('0x72')](_0x5f2202[_0x2041('0x56')],qs[_0x2041('0x61')](_0x2d50d5[_0x2041('0x5e')][_0x2041('0x61')]));_0x3568e1['attributes']=_0x3568e1[_0x2041('0x60')][_0x2041('0x80')]?_0x3568e1['attributes']:_0x5f2202[_0x2041('0x56')];_0x3568e1[_0x2041('0x63')]=qs['sort'](_0x2d50d5['query']['sort']);_0x3568e1[_0x2041('0x65')]=qs['filters'](_[_0x2041('0x66')](_0x2d50d5[_0x2041('0x5e')],_0x5f2202['filters']));if(_0x2d50d5['query'][_0x2041('0x68')]){_0x3568e1[_0x2041('0x65')]=_['merge'](_0x3568e1[_0x2041('0x65')],{'$or':_[_0x2041('0x40')](_0x3568e1[_0x2041('0x60')],function(_0x9a02e3){var _0x414899={};_0x414899[_0x9a02e3]={'$like':'%'+_0x2d50d5['query']['filter']+'%'};return _0x414899;})});}_0x3568e1=_[_0x2041('0x69')]({},_0x3568e1,_0x2d50d5[_0x2041('0x6a')]);return _0x4aa29a[_0x2041('0x131')](_0x3568e1);}})[_0x2041('0x2c')](function(_0x54a297){if(_0x54a297){_0xde3767=_0x54a297[_0x2041('0x80')];if(!_0x2d50d5[_0x2041('0x5e')]['hasOwnProperty'](_0x2041('0x81'))){_0x3568e1[_0x2041('0x29')]=qs[_0x2041('0x29')](_0x2d50d5[_0x2041('0x5e')][_0x2041('0x29')]);_0x3568e1[_0x2041('0x28')]=qs['offset'](_0x2d50d5[_0x2041('0x5e')][_0x2041('0x28')]);}return _0x4aa29a[_0x2041('0x131')](_0x3568e1);}})[_0x2041('0x2c')](function(_0x5c59c7){if(_0x5c59c7){return _0x5c59c7?{'count':_0xde3767,'rows':_0x5c59c7}:null;}})['then'](respondWithResult(_0xc9882f,null))['catch'](handleError(_0xc9882f,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 831b41d..f26262e 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 _0x5a2a=['hook','events','../../mysqldb','ChatWebsite','setMaxListeners','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x4649c6,_0x27675f){_0x4649c6=_0x4649c6-0x0;var _0x573160=_0x5a2a[_0x4649c6];return _0x573160;};'use strict';var EventEmitter=require(_0xa5a2('0x0'));var ChatWebsite=require(_0xa5a2('0x1'))['db'][_0xa5a2('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa5a2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4e464d){return function(_0x2cf196,_0x479d0a,_0x14bf26){ChatWebsiteEvents[_0xa5a2('0x4')](_0x4e464d+':'+_0x2cf196['id'],_0x2cf196);ChatWebsiteEvents[_0xa5a2('0x4')](_0x4e464d,_0x2cf196);_0x14bf26(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xa5a2('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0xd6bb=['events','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x53f897,_0x539857){var _0x6879f8=function(_0xa3c36){while(--_0xa3c36){_0x53f897['push'](_0x53f897['shift']());}};_0x6879f8(++_0x539857);}(_0xd6bb,0x1cc));var _0xbd6b=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0xd6bb[_0x1e4f2f];return _0xccea89;};'use strict';var EventEmitter=require(_0xbd6b('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xbd6b('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xbd6b('0x2')](0x0);var events={'afterCreate':_0xbd6b('0x3'),'afterUpdate':_0xbd6b('0x4'),'afterDestroy':_0xbd6b('0x5')};function emitEvent(_0x48ff17){return function(_0x43b80d,_0x1785c7,_0x14d012){ChatWebsiteEvents['emit'](_0x48ff17+':'+_0x43b80d['id'],_0x43b80d);ChatWebsiteEvents[_0xbd6b('0x6')](_0x48ff17,_0x43b80d);_0x14d012(null);};}for(var e in events){if(events[_0xbd6b('0x7')](e)){var event=events[e];ChatWebsite[_0xbd6b('0x8')](e,emitEvent(event));}}module[_0xbd6b('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 201761c..f3ea9ae 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 _0x29f9=['./chatWebsite.attributes','define','chat_websites','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2b7663,_0x25f675){var _0x59bbe4=function(_0x1f75e9){while(--_0x1f75e9){_0x2b7663['push'](_0x2b7663['shift']());}};_0x59bbe4(++_0x25f675);}(_0x29f9,0x1c5));var _0x929f=function(_0x42fd44,_0x68f360){_0x42fd44=_0x42fd44-0x0;var _0xfd1662=_0x29f9[_0x42fd44];return _0xfd1662;};'use strict';var _=require(_0x929f('0x0'));var util=require(_0x929f('0x1'));var logger=require(_0x929f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x929f('0x3'));var rp=require(_0x929f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x929f('0x5'));var config=require(_0x929f('0x6'));var attributes=require(_0x929f('0x7'));module['exports']=function(_0x159465,_0x1ac918){return _0x159465[_0x929f('0x8')]('ChatWebsite',attributes,{'tableName':_0x929f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x432c=['define','util','../../config/logger','moment','bluebird','path','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x4b1be5,_0x3933bd){var _0x4a68bf=function(_0x4c06b0){while(--_0x4c06b0){_0x4b1be5['push'](_0x4b1be5['shift']());}};_0x4a68bf(++_0x3933bd);}(_0x432c,0x196));var _0xc432=function(_0x16e6bd,_0x164cd9){_0x16e6bd=_0x16e6bd-0x0;var _0x25f3c8=_0x432c[_0x16e6bd];return _0x25f3c8;};'use strict';var _=require('lodash');var util=require(_0xc432('0x0'));var logger=require(_0xc432('0x1'))('api');var moment=require(_0xc432('0x2'));var BPromise=require(_0xc432('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc432('0x4'));var rimraf=require('rimraf');var config=require(_0xc432('0x5'));var attributes=require(_0xc432('0x6'));module[_0xc432('0x7')]=function(_0x2ad150,_0x46e137){return _0x2ad150[_0xc432('0x8')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 5439318..4c55975 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 _0xc4c7=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x56f919,_0x4094df){var _0x13e3f5=function(_0x1c9d87){while(--_0x1c9d87){_0x56f919['push'](_0x56f919['shift']());}};_0x13e3f5(++_0x4094df);}(_0xc4c7,0xd9));var _0x7c4c=function(_0x305c31,_0x466b17){_0x305c31=_0x305c31-0x0;var _0x17f39f=_0xc4c7[_0x305c31];return _0x17f39f;};'use strict';var _=require(_0x7c4c('0x0'));var util=require(_0x7c4c('0x1'));var moment=require(_0x7c4c('0x2'));var BPromise=require(_0x7c4c('0x3'));var rs=require(_0x7c4c('0x4'));var fs=require('fs');var Redis=require(_0x7c4c('0x5'));var db=require(_0x7c4c('0x6'))['db'];var utils=require(_0x7c4c('0x7'));var logger=require(_0x7c4c('0x8'))(_0x7c4c('0x9'));var config=require(_0x7c4c('0xa'));var jayson=require(_0x7c4c('0xb'));var client=jayson[_0x7c4c('0xc')][_0x7c4c('0xd')]({'port':0x232a});config['redis']=_[_0x7c4c('0xe')](config[_0x7c4c('0xf')],{'host':_0x7c4c('0x10'),'port':0x18eb});var socket=require(_0x7c4c('0x11'))(new Redis(config[_0x7c4c('0xf')]));require('./chatWebsite.socket')[_0x7c4c('0x12')](socket);function respondWithRpcPromise(_0x4a469f,_0x477d35,_0x371ae2){return new BPromise(function(_0x52dd15,_0x220381){return client[_0x7c4c('0x13')](_0x4a469f,_0x371ae2)[_0x7c4c('0x14')](function(_0x55ca36){logger['info'](_0x7c4c('0x15'),_0x477d35,_0x7c4c('0x16'));logger[_0x7c4c('0x17')](_0x7c4c('0x18'),_0x477d35,_0x7c4c('0x16'),JSON[_0x7c4c('0x19')](_0x55ca36));if(_0x55ca36[_0x7c4c('0x1a')]){if(_0x55ca36[_0x7c4c('0x1a')][_0x7c4c('0x1b')]===0x1f4){logger[_0x7c4c('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x477d35,_0x55ca36['error']['message']);return _0x220381(_0x55ca36['error']['message']);}logger[_0x7c4c('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x477d35,_0x55ca36['error'][_0x7c4c('0x1c')]);return _0x52dd15(_0x55ca36[_0x7c4c('0x1a')][_0x7c4c('0x1c')]);}else{logger[_0x7c4c('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x477d35,'request\x20sent');_0x52dd15(_0x55ca36[_0x7c4c('0x1e')][_0x7c4c('0x1c')]);}})[_0x7c4c('0x1f')](function(_0x2358a8){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x477d35,_0x2358a8);_0x220381(_0x2358a8);});});} \ No newline at end of file +var _0x0e25=['info','result','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','message'];(function(_0x555729,_0x16309c){var _0xef110c=function(_0x37ada7){while(--_0x37ada7){_0x555729['push'](_0x555729['shift']());}};_0xef110c(++_0x16309c);}(_0x0e25,0x1e6));var _0x50e2=function(_0x2e3ad4,_0x1f7f19){_0x2e3ad4=_0x2e3ad4-0x0;var _0x55a9dd=_0x0e25[_0x2e3ad4];return _0x55a9dd;};'use strict';var _=require('lodash');var util=require(_0x50e2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50e2('0x1'));var fs=require('fs');var Redis=require(_0x50e2('0x2'));var db=require(_0x50e2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x50e2('0x4'))(_0x50e2('0x5'));var config=require(_0x50e2('0x6'));var jayson=require(_0x50e2('0x7'));var client=jayson['client'][_0x50e2('0x8')]({'port':0x232a});config[_0x50e2('0x9')]=_[_0x50e2('0xa')](config[_0x50e2('0x9')],{'host':_0x50e2('0xb'),'port':0x18eb});var socket=require(_0x50e2('0xc'))(new Redis(config[_0x50e2('0x9')]));require('./chatWebsite.socket')[_0x50e2('0xd')](socket);function respondWithRpcPromise(_0x1798ad,_0x13d501,_0x313e7f){return new BPromise(function(_0x1ed458,_0xe861c8){return client[_0x50e2('0xe')](_0x1798ad,_0x313e7f)['then'](function(_0x9f745b){logger['info'](_0x50e2('0xf'),_0x13d501,_0x50e2('0x10'));logger[_0x50e2('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x13d501,_0x50e2('0x10'),JSON['stringify'](_0x9f745b));if(_0x9f745b[_0x50e2('0x12')]){if(_0x9f745b[_0x50e2('0x12')]['code']===0x1f4){logger[_0x50e2('0x12')](_0x50e2('0xf'),_0x13d501,_0x9f745b['error'][_0x50e2('0x13')]);return _0xe861c8(_0x9f745b['error'][_0x50e2('0x13')]);}logger[_0x50e2('0x12')](_0x50e2('0xf'),_0x13d501,_0x9f745b['error']['message']);return _0x1ed458(_0x9f745b[_0x50e2('0x12')][_0x50e2('0x13')]);}else{logger[_0x50e2('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x13d501,'request\x20sent');_0x1ed458(_0x9f745b[_0x50e2('0x15')]['message']);}})['catch'](function(_0x482bc7){logger[_0x50e2('0x12')](_0x50e2('0xf'),_0x13d501,_0x482bc7);_0xe861c8(_0x482bc7);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index fd77b2c..bbbeb87 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 _0x44b2=['chatWebsite:','./chatWebsite.events','save','emit','removeListener','length'];(function(_0x1a8076,_0x270397){var _0x3df2d8=function(_0x22ffb3){while(--_0x22ffb3){_0x1a8076['push'](_0x1a8076['shift']());}};_0x3df2d8(++_0x270397);}(_0x44b2,0x16f));var _0x244b=function(_0x39cf56,_0x3e9787){_0x39cf56=_0x39cf56-0x0;var _0x4b9b47=_0x44b2[_0x39cf56];return _0x4b9b47;};'use strict';var ChatWebsiteEvents=require(_0x244b('0x0'));var events=[_0x244b('0x1'),'remove','update'];function createListener(_0x5305d5,_0x51063d){return function(_0x5bfee7){_0x51063d[_0x244b('0x2')](_0x5305d5,_0x5bfee7);};}function removeListener(_0x14396f,_0x429f57){return function(){ChatWebsiteEvents[_0x244b('0x3')](_0x14396f,_0x429f57);};}exports['register']=function(_0x3bdc30){for(var _0x571d8c=0x0,_0x40bdf9=events[_0x244b('0x4')];_0x571d8c<_0x40bdf9;_0x571d8c++){var _0x373f40=events[_0x571d8c];var _0x8da797=createListener(_0x244b('0x5')+_0x373f40,_0x3bdc30);ChatWebsiteEvents['on'](_0x373f40,_0x8da797);}}; \ No newline at end of file +var _0x25d4=['removeListener','length','update'];(function(_0x4dd25e,_0x4c31db){var _0x44b075=function(_0x521b6b){while(--_0x521b6b){_0x4dd25e['push'](_0x4dd25e['shift']());}};_0x44b075(++_0x4c31db);}(_0x25d4,0x1ac));var _0x425d=function(_0x30e4b6,_0x33a537){_0x30e4b6=_0x30e4b6-0x0;var _0x101bfd=_0x25d4[_0x30e4b6];return _0x101bfd;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save','remove',_0x425d('0x0')];function createListener(_0x4ed849,_0x39fe71){return function(_0x328cb5){_0x39fe71['emit'](_0x4ed849,_0x328cb5);};}function removeListener(_0x194208,_0x1fe768){return function(){ChatWebsiteEvents[_0x425d('0x1')](_0x194208,_0x1fe768);};}exports['register']=function(_0x273946){for(var _0x5af745=0x0,_0x8b3f79=events[_0x425d('0x2')];_0x5af745<_0x8b3f79;_0x5af745++){var _0x48c6bf=events[_0x5af745];var _0x238f9f=createListener('chatWebsite:'+_0x48c6bf,_0x273946);ChatWebsiteEvents['on'](_0x48c6bf,_0x238f9f);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 2e9d769..7d3b9a7 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 _0x1ccf=['path','express','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/applications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','format','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','now','/:id/customer_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','/:id/offline','any','offline','addInteraction','addApplications','/:id/users','addAgents','update','delete','destroy','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x49bad2,_0x323724){var _0x531d39=function(_0x30d13e){while(--_0x30d13e){_0x49bad2['push'](_0x49bad2['shift']());}};_0x531d39(++_0x323724);}(_0x1ccf,0xca));var _0xf1cc=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1ccf[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0xf1cc('0x0'));var util=require(_0xf1cc('0x1'));var path=require(_0xf1cc('0x2'));var timeout=require('connect-timeout');var express=require(_0xf1cc('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf1cc('0x4'));var config=require('../../config/environment');var controller=require(_0xf1cc('0x5'));router[_0xf1cc('0x6')]('/',auth[_0xf1cc('0x7')](),controller[_0xf1cc('0x8')]);router[_0xf1cc('0x6')](_0xf1cc('0x9'),auth[_0xf1cc('0x7')](),controller[_0xf1cc('0xa')]);router[_0xf1cc('0x6')](_0xf1cc('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf1cc('0x6')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf1cc('0xc')]);router[_0xf1cc('0x6')]('/:id/canned_answers',auth[_0xf1cc('0x7')](),controller['getAnswers']);router[_0xf1cc('0x6')](_0xf1cc('0xd'),controller[_0xf1cc('0xe')]);router[_0xf1cc('0x6')](_0xf1cc('0xf'),controller[_0xf1cc('0x10')]);router['get']('/:id/customer_avatar',controller[_0xf1cc('0x11')]);router[_0xf1cc('0x6')](_0xf1cc('0x12'),controller[_0xf1cc('0x13')]);router[_0xf1cc('0x6')](_0xf1cc('0x14'),auth[_0xf1cc('0x7')](),controller[_0xf1cc('0x15')]);router['get']('/:id/snippet',controller['getSnippet']);router[_0xf1cc('0x6')](_0xf1cc('0x16'),auth[_0xf1cc('0x7')](),controller['getApplications']);router['get'](_0xf1cc('0x17'),auth[_0xf1cc('0x7')](),controller['getProactiveActions']);router[_0xf1cc('0x6')](_0xf1cc('0x18'),controller[_0xf1cc('0x19')]);router[_0xf1cc('0x6')](_0xf1cc('0x1a'),auth[_0xf1cc('0x7')](),controller[_0xf1cc('0x1b')]);router[_0xf1cc('0x6')]('/:id/users',auth[_0xf1cc('0x7')](),controller[_0xf1cc('0x1c')]);router[_0xf1cc('0x1d')]('/',auth[_0xf1cc('0x7')](),controller[_0xf1cc('0x1e')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf1cc('0x1f')]);router['post'](_0xf1cc('0x20'),auth[_0xf1cc('0x7')](),controller[_0xf1cc('0x21')]);var upload=multer({'storage':multer[_0xf1cc('0x22')]({'destination':function(_0x335876,_0x2cd086,_0xd81856){_0xd81856(null,path[_0xf1cc('0x23')](config[_0xf1cc('0x24')],'server/files/images/logos/'));},'filename':function(_0x397020,_0x46ca55,_0x4c3662){_0x4c3662(null,util[_0xf1cc('0x25')](_0xf1cc('0x26'),Date['now'](),_0x46ca55[_0xf1cc('0x27')]));}})});router[_0xf1cc('0x1d')](_0xf1cc('0xd'),upload[_0xf1cc('0x28')](_0xf1cc('0x29')),controller[_0xf1cc('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4da7ed,_0x53ade7,_0x12af2d){_0x12af2d(null,path[_0xf1cc('0x23')](config[_0xf1cc('0x24')],_0xf1cc('0x2b')));},'filename':function(_0x2c8094,_0x5213e3,_0x1a0204){_0x1a0204(null,util[_0xf1cc('0x25')](_0xf1cc('0x26'),Date[_0xf1cc('0x2c')](),_0x5213e3[_0xf1cc('0x27')]));}})});router[_0xf1cc('0x1d')](_0xf1cc('0xf'),upload[_0xf1cc('0x28')](_0xf1cc('0x29')),controller['addAvatar']);var upload=multer({'storage':multer[_0xf1cc('0x22')]({'destination':function(_0x4735ca,_0x43ea05,_0x3620c7){_0x3620c7(null,path[_0xf1cc('0x23')](config[_0xf1cc('0x24')],_0xf1cc('0x2b')));},'filename':function(_0x26f3be,_0x2403dd,_0x8eaaff){_0x8eaaff(null,util[_0xf1cc('0x25')](_0xf1cc('0x26'),Date[_0xf1cc('0x2c')](),_0x2403dd[_0xf1cc('0x27')]));}})});router[_0xf1cc('0x1d')](_0xf1cc('0x2d'),upload['single'](_0xf1cc('0x29')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xf1cc('0x22')]({'destination':function(_0x5796f3,_0x2e3dd5,_0x5ecf41){_0x5ecf41(null,path['join'](config[_0xf1cc('0x24')],_0xf1cc('0x2b')));},'filename':function(_0x316a65,_0x2649eb,_0x261209){_0x261209(null,util[_0xf1cc('0x25')](_0xf1cc('0x26'),Date['now'](),_0x2649eb['originalname']));}})});router[_0xf1cc('0x1d')]('/:id/system_avatar',upload[_0xf1cc('0x28')](_0xf1cc('0x29')),controller[_0xf1cc('0x2e')]);router['post'](_0xf1cc('0x2f'),controller[_0xf1cc('0x30')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x17521f,_0x8881ad,_0x33ec78){const _0x2d9d77=path[_0xf1cc('0x23')](config[_0xf1cc('0x24')],_0xf1cc('0x31'),_0xf1cc('0x32'),_0xf1cc('0x33'));fs_extra[_0xf1cc('0x34')](_0x2d9d77,function(){_0x33ec78(null,_0x2d9d77);});},'filename':function(_0x57cf12,_0x39709c,_0x38d75c){const _0xa3cf43=_0x39709c[_0xf1cc('0x27')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2a5af0=path['extname'](_0xa3cf43);const _0x404654=Date[_0xf1cc('0x2c')]()+'-'+_0xa3cf43['replace'](_0x2a5af0,'')+_0x2a5af0;_0x38d75c(null,_0x404654);}})});router[_0xf1cc('0x1d')](_0xf1cc('0x35'),offlineUploadMulter[_0xf1cc('0x36')](),controller[_0xf1cc('0x37')]);router[_0xf1cc('0x1d')](_0xf1cc('0x14'),auth[_0xf1cc('0x7')](),controller[_0xf1cc('0x38')]);router[_0xf1cc('0x1d')](_0xf1cc('0x16'),auth[_0xf1cc('0x7')](),controller[_0xf1cc('0x39')]);router[_0xf1cc('0x1d')](_0xf1cc('0x17'),auth['isAuthenticated'](),controller['addProactiveActions']);router['post'](_0xf1cc('0x3a'),auth[_0xf1cc('0x7')](),controller[_0xf1cc('0x3b')]);router['put'](_0xf1cc('0xb'),auth[_0xf1cc('0x7')](),controller[_0xf1cc('0x3c')]);router[_0xf1cc('0x3d')](_0xf1cc('0xb'),auth[_0xf1cc('0x7')](),controller[_0xf1cc('0x3e')]);router[_0xf1cc('0x3d')](_0xf1cc('0x3f'),auth[_0xf1cc('0x7')](),controller[_0xf1cc('0x40')]);router[_0xf1cc('0x3d')]('/:id/canned_answers',auth[_0xf1cc('0x7')](),controller[_0xf1cc('0x41')]);router[_0xf1cc('0x3d')](_0xf1cc('0x3a'),auth[_0xf1cc('0x7')](),controller[_0xf1cc('0x42')]);module[_0xf1cc('0x43')]=router; \ No newline at end of file +var _0x72b8=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatWebsite.controller','isAuthenticated','get','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','join','server/files/images/logos/','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','format','now','addAvatar','addCustomerAvatar','root','%s-%s','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','addInteraction','/:id/applications','/:id/users','addAgents','put','delete','removeDispositions','removeAnswers'];(function(_0x469ac7,_0xc3c777){var _0x2fc7d9=function(_0x2c56a6){while(--_0x2c56a6){_0x469ac7['push'](_0x469ac7['shift']());}};_0x2fc7d9(++_0xc3c777);}(_0x72b8,0x16a));var _0x872b=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x72b8[_0x1d1779];return _0x2377e9;};'use strict';var multer=require(_0x872b('0x0'));var util=require(_0x872b('0x1'));var path=require(_0x872b('0x2'));var timeout=require(_0x872b('0x3'));var express=require(_0x872b('0x4'));var router=express[_0x872b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x872b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x872b('0x7'));var controller=require(_0x872b('0x8'));router['get']('/',auth[_0x872b('0x9')](),controller['index']);router[_0x872b('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x872b('0xb')]);router['get'](_0x872b('0xc'),auth[_0x872b('0x9')](),controller[_0x872b('0xd')]);router['get'](_0x872b('0xe'),auth[_0x872b('0x9')](),controller[_0x872b('0xf')]);router[_0x872b('0xa')](_0x872b('0x10'),auth['isAuthenticated'](),controller[_0x872b('0x11')]);router['get'](_0x872b('0x12'),controller['getLogo']);router['get'](_0x872b('0x13'),controller['getAvatar']);router[_0x872b('0xa')](_0x872b('0x14'),controller[_0x872b('0x15')]);router[_0x872b('0xa')](_0x872b('0x16'),controller[_0x872b('0x17')]);router[_0x872b('0xa')](_0x872b('0x18'),auth[_0x872b('0x9')](),controller[_0x872b('0x19')]);router['get'](_0x872b('0x1a'),controller[_0x872b('0x1b')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x872b('0xa')](_0x872b('0x1c'),auth[_0x872b('0x9')](),controller[_0x872b('0x1d')]);router[_0x872b('0xa')]('/:id/fields',controller[_0x872b('0x1e')]);router[_0x872b('0xa')](_0x872b('0x1f'),auth['isAuthenticated'](),controller[_0x872b('0x20')]);router[_0x872b('0xa')]('/:id/users',auth[_0x872b('0x9')](),controller[_0x872b('0x21')]);router[_0x872b('0x22')]('/',auth[_0x872b('0x9')](),controller[_0x872b('0x23')]);router[_0x872b('0x22')](_0x872b('0xe'),auth[_0x872b('0x9')](),controller[_0x872b('0x24')]);router['post'](_0x872b('0x10'),auth[_0x872b('0x9')](),controller[_0x872b('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4f0319,_0x556ba9,_0x220273){_0x220273(null,path[_0x872b('0x26')](config['root'],_0x872b('0x27')));},'filename':function(_0xa8d4dc,_0x367bd7,_0xb2fd16){_0xb2fd16(null,util['format']('%s-%s',Date['now'](),_0x367bd7[_0x872b('0x28')]));}})});router['post'](_0x872b('0x12'),upload[_0x872b('0x29')](_0x872b('0x2a')),controller[_0x872b('0x2b')]);var upload=multer({'storage':multer[_0x872b('0x2c')]({'destination':function(_0x770916,_0x1e17cc,_0x236e67){_0x236e67(null,path[_0x872b('0x26')](config['root'],_0x872b('0x2d')));},'filename':function(_0x465082,_0x5ac98d,_0x232b3e){_0x232b3e(null,util[_0x872b('0x2e')]('%s-%s',Date[_0x872b('0x2f')](),_0x5ac98d[_0x872b('0x28')]));}})});router['post'](_0x872b('0x13'),upload[_0x872b('0x29')]('file'),controller[_0x872b('0x30')]);var upload=multer({'storage':multer[_0x872b('0x2c')]({'destination':function(_0x451f87,_0x226501,_0xcc1515){_0xcc1515(null,path[_0x872b('0x26')](config['root'],_0x872b('0x2d')));},'filename':function(_0x5260b8,_0x399086,_0x428c60){_0x428c60(null,util[_0x872b('0x2e')]('%s-%s',Date['now'](),_0x399086[_0x872b('0x28')]));}})});router[_0x872b('0x22')](_0x872b('0x14'),upload[_0x872b('0x29')](_0x872b('0x2a')),controller[_0x872b('0x31')]);var upload=multer({'storage':multer[_0x872b('0x2c')]({'destination':function(_0x4d72df,_0x43114b,_0x4c802d){_0x4c802d(null,path[_0x872b('0x26')](config[_0x872b('0x32')],'server/files/images/avatars/'));},'filename':function(_0x5f0f2b,_0x67f2c8,_0xa74f1c){_0xa74f1c(null,util[_0x872b('0x2e')](_0x872b('0x33'),Date['now'](),_0x67f2c8['originalname']));}})});router[_0x872b('0x22')](_0x872b('0x16'),upload['single'](_0x872b('0x2a')),controller[_0x872b('0x34')]);router[_0x872b('0x22')](_0x872b('0x35'),controller[_0x872b('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x872b('0x2c')]({'destination':function(_0x21749c,_0x60cd5e,_0x1aa3ee){const _0x3e60db=path[_0x872b('0x26')](config['root'],_0x872b('0x37'),_0x872b('0x38'),_0x872b('0x39'));fs_extra[_0x872b('0x3a')](_0x3e60db,function(){_0x1aa3ee(null,_0x3e60db);});},'filename':function(_0xe61124,_0x350f19,_0x4544a0){const _0xed3b2e=_0x350f19['originalname'][_0x872b('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x188bdf=path[_0x872b('0x3c')](_0xed3b2e);const _0x1f1017=Date[_0x872b('0x2f')]()+'-'+_0xed3b2e[_0x872b('0x3b')](_0x188bdf,'')+_0x188bdf;_0x4544a0(null,_0x1f1017);}})});router[_0x872b('0x22')](_0x872b('0x3d'),offlineUploadMulter['any'](),controller['offline']);router[_0x872b('0x22')](_0x872b('0x18'),auth['isAuthenticated'](),controller[_0x872b('0x3e')]);router[_0x872b('0x22')](_0x872b('0x3f'),auth[_0x872b('0x9')](),controller['addApplications']);router['post'](_0x872b('0x1c'),auth[_0x872b('0x9')](),controller['addProactiveActions']);router[_0x872b('0x22')](_0x872b('0x40'),auth['isAuthenticated'](),controller[_0x872b('0x41')]);router[_0x872b('0x42')](_0x872b('0xc'),auth[_0x872b('0x9')](),controller['update']);router[_0x872b('0x43')](_0x872b('0xc'),auth[_0x872b('0x9')](),controller['destroy']);router[_0x872b('0x43')]('/:id/dispositions',auth[_0x872b('0x9')](),controller[_0x872b('0x44')]);router[_0x872b('0x43')](_0x872b('0x10'),auth[_0x872b('0x9')](),controller[_0x872b('0x45')]);router[_0x872b('0x43')](_0x872b('0x40'),auth[_0x872b('0x9')](),controller[_0x872b('0x46')]);module[_0x872b('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 47e694c..b18853c 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 _0x4aeb=['../config/environment','env','production','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x4aeb,0x131));var _0xb4ae=function(_0x5edeac,_0x420165){_0x5edeac=_0x5edeac-0x0;var _0x1cebed=_0x4aeb[_0x5edeac];return _0x1cebed;};var beaverLogger=require(_0xb4ae('0x0'));var express=require(_0xb4ae('0x1'));var auth=require(_0xb4ae('0x2'));var config=require(_0xb4ae('0x3'));var router=express['Router']();var isProduction=config[_0xb4ae('0x4')]===_0xb4ae('0x5')||![];function clientSideLogs(_0x1644fd,_0x4f784c,_0xeaf8fd){var _0x4b4bf1=_0x1644fd['app']['get']('client-side-logger');if(!_0x4b4bf1){throw new Error(_0xb4ae('0x6'));}return beaverLogger[_0xb4ae('0x7')]({'uri':'/client-logs','logger':_0x4b4bf1,'enableCors':!isProduction})(_0x1644fd,_0x4f784c,_0xeaf8fd);}router[_0xb4ae('0x8')](auth[_0xb4ae('0x9')](),clientSideLogs);module[_0xb4ae('0xa')]=router; \ No newline at end of file +var _0x503d=['client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','beaver-logger/server','express','../config/environment','Router','env','production','app','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x503d,0x1d4));var _0xd503=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x503d[_0x5a6644];return _0x3a2a5d;};var beaverLogger=require(_0xd503('0x0'));var express=require(_0xd503('0x1'));var auth=require('../components/auth/service');var config=require(_0xd503('0x2'));var router=express[_0xd503('0x3')]();var isProduction=config[_0xd503('0x4')]===_0xd503('0x5')||![];function clientSideLogs(_0x1ea2ab,_0x1070fe,_0x22928c){var _0x705f5a=_0x1ea2ab[_0xd503('0x6')][_0xd503('0x7')](_0xd503('0x8'));if(!_0x705f5a){throw new Error(_0xd503('0x9'));}return beaverLogger[_0xd503('0xa')]({'uri':_0xd503('0xb'),'logger':_0x705f5a,'enableCors':!isProduction})(_0x1ea2ab,_0x1070fe,_0x22928c);}router[_0xd503('0xc')](auth[_0xd503('0xd')](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 071d7c7..7af8e9a 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 _0x9f5f=['MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token'];(function(_0x33eca6,_0x891651){var _0x1ada39=function(_0x31ab8c){while(--_0x31ab8c){_0x33eca6['push'](_0x33eca6['shift']());}};_0x1ada39(++_0x891651);}(_0x9f5f,0x122));var _0xf9f5=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x9f5f[_0x82129b];return _0x2ae5dc;};'use strict';var Sequelize=require(_0xf9f5('0x0'));module['exports']={'name':{'type':Sequelize[_0xf9f5('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf9f5('0x2')](_0xf9f5('0x3'),_0xf9f5('0x4'),_0xf9f5('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf9f5('0x2')](_0xf9f5('0x6'),_0xf9f5('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0xf9f5('0x8')},'data2':{'type':Sequelize[_0xf9f5('0x1')],'comment':_0xf9f5('0x9')},'data3':{'type':Sequelize['STRING'],'comment':_0xf9f5('0xa')},'data4':{'type':Sequelize[_0xf9f5('0x1')],'comment':_0xf9f5('0xb')},'data5':{'type':Sequelize[_0xf9f5('0xc')],'comment':_0xf9f5('0xd')},'data6':{'type':Sequelize[_0xf9f5('0xc')],'comment':_0xf9f5('0xe')},'data7':{'type':Sequelize[_0xf9f5('0xc')],'comment':_0xf9f5('0xf')}}; \ No newline at end of file +var _0xbd74=['MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xbd74,0x14d));var _0x4bd7=function(_0x4dc6ce,_0x2cff7b){_0x4dc6ce=_0x4dc6ce-0x0;var _0x2e4197=_0xbd74[_0x4dc6ce];return _0x2e4197;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4bd7('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4bd7('0x1')](_0x4bd7('0x2'),'Google',_0x4bd7('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4bd7('0x1')](_0x4bd7('0x4'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x4bd7('0x0')],'comment':_0x4bd7('0x5')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x4bd7('0x0')],'comment':_0x4bd7('0x6')},'data5':{'type':Sequelize[_0x4bd7('0x7')],'comment':_0x4bd7('0x8')},'data6':{'type':Sequelize[_0x4bd7('0x7')],'comment':_0x4bd7('0x9')},'data7':{'type':Sequelize['TEXT'],'comment':_0x4bd7('0xa')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index f28e50a..295fb5d 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 _0x22df=['where','pick','filter','type','VIRTUAL','merge','include','service','MicrosoftAzure','decryptString','data3','show','params','CloudProvider','rawAttributes','intersection','includeAll','options','find','catch','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','base64','toString','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','set','update','destroy','then','error','stack','name','send','padEnd','slice','map','fieldName','model','query','keys','filters','attributes','fields','length','nolimit','order','sort'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0x22df,0x14d));var _0xf22d=function(_0x4eaefb,_0x546773){_0x4eaefb=_0x4eaefb-0x0;var _0x275fd7=_0x22df[_0x4eaefb];return _0x275fd7;};'use strict';var _=require(_0xf22d('0x0'));var Redis=require(_0xf22d('0x1'));var qs=require(_0xf22d('0x2'));var encryptor=require(_0xf22d('0x3'));var config=require(_0xf22d('0x4'));var logger=require(_0xf22d('0x5'))(_0xf22d('0x6'));var db=require(_0xf22d('0x7'))['db'];var oauth=require(_0xf22d('0x8'));config['redis']=_[_0xf22d('0x9')](config[_0xf22d('0xa')],{'host':_0xf22d('0xb'),'port':0x18eb});var socket=require(_0xf22d('0xc'))(new Redis(config[_0xf22d('0xa')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x97257d,_0xd393ac){_0xd393ac=_0xd393ac||0xcc;return function(_0xee52a6){if(_0xee52a6){return _0x97257d[_0xf22d('0xd')](_0xd393ac);}return _0x97257d[_0xf22d('0xe')](_0xd393ac)[_0xf22d('0xf')]();};}function respondWithResult(_0x43af96,_0x495243){_0x495243=_0x495243||0xc8;return function(_0x58197e){if(_0x58197e){return _0x43af96[_0xf22d('0xe')](_0x495243)[_0xf22d('0x10')](_0x58197e);}};}function respondWithFilteredResult(_0x4eaa7b,_0xbb9ac4){return function(_0x133f69){if(_0x133f69){var _0x3c0eb0=typeof _0xbb9ac4['offset']===_0xf22d('0x11')&&typeof _0xbb9ac4[_0xf22d('0x12')]===_0xf22d('0x11');var _0x23d75f=_0x133f69[_0xf22d('0x13')];var _0x18dbd1=_0x3c0eb0?0x0:_0xbb9ac4[_0xf22d('0x14')];var _0x12e14d=_0x3c0eb0?_0x133f69[_0xf22d('0x13')]:_0xbb9ac4[_0xf22d('0x14')]+_0xbb9ac4[_0xf22d('0x12')];var _0x43c345;if(_0x12e14d>=_0x23d75f){_0x12e14d=_0x23d75f;_0x43c345=0xc8;}else{_0x43c345=0xce;}_0x4eaa7b['status'](_0x43c345);return _0x4eaa7b[_0xf22d('0x15')]('Content-Range',_0x18dbd1+'-'+_0x12e14d+'/'+_0x23d75f)[_0xf22d('0x10')](_0x133f69);}return null;};}function saveUpdates(_0x4b8250){return function(_0x11f499){if(_0x11f499){return _0x11f499[_0xf22d('0x16')](_0x4b8250)['then'](function(_0x8fc3f7){return _0x8fc3f7;});}return null;};}function removeEntity(_0x4265e4){return function(_0x219305){if(_0x219305){return _0x219305[_0xf22d('0x17')]()[_0xf22d('0x18')](function(){_0x4265e4[_0xf22d('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47bf78){return function(_0x2b584a){if(!_0x2b584a){_0x47bf78['sendStatus'](0x194);}return _0x2b584a;};}function handleError(_0x8e3d76,_0x4d3168){_0x4d3168=_0x4d3168||0x1f4;return function(_0x4a3bd0){logger[_0xf22d('0x19')](_0x4a3bd0[_0xf22d('0x1a')]);if(_0x4a3bd0[_0xf22d('0x1b')]){delete _0x4a3bd0['name'];}_0x8e3d76[_0xf22d('0xe')](_0x4d3168)[_0xf22d('0x1c')](_0x4a3bd0);};}function maskClientSecret(_0x49d462){return _[_0xf22d('0x1d')](_0x49d462[_0xf22d('0x1e')](0x0,0x3),0x14,'*');}exports['index']=function(_0x500ce9,_0x33c338){var _0x461b87={},_0xc8eae9={},_0x28fce5={'count':0x0,'rows':[]};var _0x38e0e5=_[_0xf22d('0x1f')](db['CloudProvider']['rawAttributes'],function(_0x430e7f){return{'name':_0x430e7f[_0xf22d('0x20')],'type':_0x430e7f['type']['key']};});_0xc8eae9[_0xf22d('0x21')]=_[_0xf22d('0x1f')](_0x38e0e5,'name');_0xc8eae9[_0xf22d('0x22')]=_[_0xf22d('0x23')](_0x500ce9['query']);_0xc8eae9[_0xf22d('0x24')]=_['intersection'](_0xc8eae9[_0xf22d('0x21')],_0xc8eae9[_0xf22d('0x22')]);_0x461b87[_0xf22d('0x25')]=_['intersection'](_0xc8eae9[_0xf22d('0x21')],qs['fields'](_0x500ce9[_0xf22d('0x22')][_0xf22d('0x26')]));_0x461b87['attributes']=_0x461b87['attributes'][_0xf22d('0x27')]?_0x461b87[_0xf22d('0x25')]:_0xc8eae9['model'];if(!_0x500ce9['query']['hasOwnProperty'](_0xf22d('0x28'))){_0x461b87[_0xf22d('0x12')]=qs[_0xf22d('0x12')](_0x500ce9[_0xf22d('0x22')][_0xf22d('0x12')]);_0x461b87[_0xf22d('0x14')]=qs['offset'](_0x500ce9[_0xf22d('0x22')][_0xf22d('0x14')]);}_0x461b87[_0xf22d('0x29')]=qs['sort'](_0x500ce9[_0xf22d('0x22')][_0xf22d('0x2a')]);_0x461b87[_0xf22d('0x2b')]=qs[_0xf22d('0x24')](_[_0xf22d('0x2c')](_0x500ce9[_0xf22d('0x22')],_0xc8eae9[_0xf22d('0x24')]),_0x38e0e5);if(_0x500ce9['query'][_0xf22d('0x2d')]){_0x461b87['where']=_['merge'](_0x461b87['where'],{'$or':_['map'](_0x38e0e5,function(_0x43cfc7){if(_0x43cfc7[_0xf22d('0x2e')]!==_0xf22d('0x2f')){var _0x149758={};_0x149758[_0x43cfc7['name']]={'$like':'%'+_0x500ce9['query']['filter']+'%'};return _0x149758;}})});}_0x461b87=_[_0xf22d('0x30')]({},_0x461b87,_0x500ce9['options']);var _0x43111e={'where':_0x461b87[_0xf22d('0x2b')]};return db['CloudProvider']['count'](_0x43111e)[_0xf22d('0x18')](function(_0x10112a){_0x28fce5[_0xf22d('0x13')]=_0x10112a;if(_0x500ce9['query']['includeAll']){_0x461b87[_0xf22d('0x31')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x461b87);})[_0xf22d('0x18')](function(_0x2cd753){_0x28fce5['rows']=_[_0xf22d('0x1f')](_0x2cd753,function(_0x392b8a){if(_0x392b8a[_0xf22d('0x32')]===_0xf22d('0x33')){var _0x5b74a5=encryptor[_0xf22d('0x34')](_0x392b8a[_0xf22d('0x35')]);_0x392b8a[_0xf22d('0x35')]=maskClientSecret(_0x5b74a5);}return _0x392b8a;});return _0x28fce5;})[_0xf22d('0x18')](respondWithFilteredResult(_0x33c338,_0x461b87))['catch'](handleError(_0x33c338,null));};exports[_0xf22d('0x36')]=function(_0x4079fe,_0x732ce1){var _0x41af28={'raw':!![],'where':{'id':_0x4079fe[_0xf22d('0x37')]['id']}},_0x2eff7b={};_0x2eff7b[_0xf22d('0x21')]=_[_0xf22d('0x23')](db[_0xf22d('0x38')][_0xf22d('0x39')]);_0x2eff7b['query']=_['keys'](_0x4079fe['query']);_0x2eff7b[_0xf22d('0x24')]=_[_0xf22d('0x3a')](_0x2eff7b[_0xf22d('0x21')],_0x2eff7b[_0xf22d('0x22')]);_0x41af28[_0xf22d('0x25')]=_[_0xf22d('0x3a')](_0x2eff7b[_0xf22d('0x21')],qs[_0xf22d('0x26')](_0x4079fe[_0xf22d('0x22')][_0xf22d('0x26')]));_0x41af28[_0xf22d('0x25')]=_0x41af28[_0xf22d('0x25')][_0xf22d('0x27')]?_0x41af28['attributes']:_0x2eff7b[_0xf22d('0x21')];if(_0x4079fe['query'][_0xf22d('0x3b')]){_0x41af28[_0xf22d('0x31')]=[{'all':!![]}];}_0x41af28=_[_0xf22d('0x30')]({},_0x41af28,_0x4079fe[_0xf22d('0x3c')]);return db[_0xf22d('0x38')][_0xf22d('0x3d')](_0x41af28)[_0xf22d('0x18')](handleEntityNotFound(_0x732ce1,null))[_0xf22d('0x18')](function(_0x3e6512){if(_0x3e6512[_0xf22d('0x32')]===_0xf22d('0x33')){var _0x2ff7e3=encryptor[_0xf22d('0x34')](_0x3e6512[_0xf22d('0x35')]);_0x3e6512[_0xf22d('0x35')]=maskClientSecret(_0x2ff7e3);}return _0x3e6512;})[_0xf22d('0x18')](respondWithResult(_0x732ce1,null))[_0xf22d('0x3e')](handleError(_0x732ce1,null));};exports[_0xf22d('0x3f')]=function(_0x283aaa,_0x60f1fc){if(!_0x283aaa[_0xf22d('0x40')][_0xf22d('0x1b')])throw new Error(_0xf22d('0x41'));if(!_0x283aaa[_0xf22d('0x40')]['service'])throw new Error(_0xf22d('0x42'));var _0x193577=db[_0xf22d('0x38')]['rawAttributes']['service']['values'];if(!_0x193577[_0xf22d('0x43')](_0x283aaa['body']['service']))throw new Error(_0xf22d('0x44')+_0x193577[_0xf22d('0x45')](',\x20'));if(_0x283aaa[_0xf22d('0x40')][_0xf22d('0x32')]===_0xf22d('0x33')&&_0x283aaa['body'][_0xf22d('0x35')]){_0x283aaa[_0xf22d('0x40')][_0xf22d('0x35')]=encryptor[_0xf22d('0x46')](_0x283aaa[_0xf22d('0x40')][_0xf22d('0x35')]);}return db[_0xf22d('0x38')][_0xf22d('0x3f')](_0x283aaa['body'],{})['then'](respondWithResult(_0x60f1fc,0xc9))[_0xf22d('0x3e')](handleError(_0x60f1fc,null));};exports[_0xf22d('0x16')]=function(_0x33e707,_0x19ef4a){if(_0x33e707['body']['id']){delete _0x33e707[_0xf22d('0x40')]['id'];}return db[_0xf22d('0x38')]['find']({'where':{'id':_0x33e707[_0xf22d('0x37')]['id']}})[_0xf22d('0x18')](handleEntityNotFound(_0x19ef4a,null))[_0xf22d('0x18')](function(_0x126c0f){if(_0x126c0f[_0xf22d('0x32')]===_0xf22d('0x33')&&_0x33e707[_0xf22d('0x40')]['data3']){_0x33e707[_0xf22d('0x40')][_0xf22d('0x35')]=encryptor[_0xf22d('0x46')](_0x33e707[_0xf22d('0x40')][_0xf22d('0x35')]);}return _0x126c0f;})[_0xf22d('0x18')](saveUpdates(_0x33e707['body'],null))[_0xf22d('0x18')](respondWithResult(_0x19ef4a,null))[_0xf22d('0x3e')](handleError(_0x19ef4a,null));};exports[_0xf22d('0x17')]=function(_0x1dfda6,_0x1e271a){return db['CloudProvider'][_0xf22d('0x3d')]({'where':{'id':_0x1dfda6[_0xf22d('0x37')]['id']}})[_0xf22d('0x18')](handleEntityNotFound(_0x1e271a,null))[_0xf22d('0x18')](removeEntity(_0x1e271a,null))['catch'](handleError(_0x1e271a,null));};exports[_0xf22d('0x47')]=function(_0x3780dc,_0x18a351){return db[_0xf22d('0x38')][_0xf22d('0x48')]({'where':{'id':_0x3780dc['params']['id']},'raw':!![]})[_0xf22d('0x18')](function(_0x5b10c4){if(!_0x5b10c4)return _0x18a351['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x5b10c4,_0x3780dc['user']['id'])};})[_0xf22d('0x18')](respondWithResult(_0x18a351,null))[_0xf22d('0x3e')](handleError(_0x18a351,null));};exports[_0xf22d('0x49')]=function(_0x5c28b1,_0x31e7f4){var _0x594ba9=_0x5c28b1['body'];var _0x3614cd;var _0x31dbd3;if(_0x594ba9[_0xf22d('0x19')])throw _0x594ba9;redis['get'](_0x594ba9[_0xf22d('0x4a')])['then'](function(_0x3966eb){if(!_0x3966eb)throw new Error(_0xf22d('0x4b'));_0x3614cd=JSON[_0xf22d('0x4c')](_0x3966eb);var _0x419235=Buffer['from'](_0x594ba9[_0xf22d('0x4a')],_0xf22d('0x4d'))[_0xf22d('0x4e')]('ascii');_0x31dbd3=JSON[_0xf22d('0x4c')](_0x419235);if(!oauth['isValidIdToken'](_0x594ba9[_0xf22d('0x4f')],_0x3614cd['oauth2Claims']))throw new Error(_0xf22d('0x50'));redis[_0xf22d('0x51')](_0x594ba9[_0xf22d('0x4a')]);return oauth[_0xf22d('0x52')](_0x594ba9[_0xf22d('0x53')],_0x3614cd);})['then'](function(_0x2a4868){_0x3614cd[_0xf22d('0x54')]=_0x2a4868[_0xf22d('0x55')];_0x3614cd[_0xf22d('0x56')]=_0x2a4868[_0xf22d('0x57')];return db['CloudProvider']['update']({'data5':_0x3614cd[_0xf22d('0x54')],'data6':_0x3614cd[_0xf22d('0x56')]},{'where':{'id':_0x3614cd['id']}});})[_0xf22d('0x18')](function(){oauth[_0xf22d('0x58')](_0x3614cd);socket[_0xf22d('0x59')](_0xf22d('0x5a'),{'id':_0x31dbd3['id']});return;})[_0xf22d('0x18')](respondWithStatusCode(_0x31e7f4,null))[_0xf22d('0x3e')](function(_0x437c29){if(_0x31dbd3){socket[_0xf22d('0x59')](_0xf22d('0x5b'),{'id':_0x31dbd3['id']});}if(!_0x3614cd){logger['error'](_0xf22d('0x5c'),_0x437c29);return _0x31e7f4[_0xf22d('0xe')](0x1f4)['send'](_0x437c29['message']);}logger[_0xf22d('0x19')](_0xf22d('0x5d'),_0x3614cd['id'],JSON['stringify'](_0x437c29));});}; \ No newline at end of file +var _0xb741=['del','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','update','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','stringify','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','destroy','then','name','send','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','data3','catch','show','params','length','options','find','service','decryptString','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','MicrosoftAzure','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','state','parse','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token'];(function(_0x1705d6,_0x2ec716){var _0x1a1f24=function(_0x4ce718){while(--_0x4ce718){_0x1705d6['push'](_0x1705d6['shift']());}};_0x1a1f24(++_0x2ec716);}(_0xb741,0x118));var _0x1b74=function(_0x426b14,_0x402c5f){_0x426b14=_0x426b14-0x0;var _0x40308f=_0xb741[_0x426b14];return _0x40308f;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x1b74('0x0'));var encryptor=require(_0x1b74('0x1'));var config=require('../../config/environment');var logger=require(_0x1b74('0x2'))(_0x1b74('0x3'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config[_0x1b74('0x4')]=_[_0x1b74('0x5')](config[_0x1b74('0x4')],{'host':_0x1b74('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1b74('0x4')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x2c6e1f,_0x1e8267){_0x1e8267=_0x1e8267||0xcc;return function(_0x306226){if(_0x306226){return _0x2c6e1f[_0x1b74('0x7')](_0x1e8267);}return _0x2c6e1f[_0x1b74('0x8')](_0x1e8267)[_0x1b74('0x9')]();};}function respondWithResult(_0x3c7fff,_0x1da619){_0x1da619=_0x1da619||0xc8;return function(_0x562264){if(_0x562264){return _0x3c7fff[_0x1b74('0x8')](_0x1da619)[_0x1b74('0xa')](_0x562264);}};}function respondWithFilteredResult(_0x161f34,_0x36bdc4){return function(_0x545311){if(_0x545311){var _0xd8a779=typeof _0x36bdc4[_0x1b74('0xb')]===_0x1b74('0xc')&&typeof _0x36bdc4[_0x1b74('0xd')]===_0x1b74('0xc');var _0x5c377e=_0x545311['count'];var _0x55e147=_0xd8a779?0x0:_0x36bdc4[_0x1b74('0xb')];var _0xbdbf61=_0xd8a779?_0x545311[_0x1b74('0xe')]:_0x36bdc4['offset']+_0x36bdc4[_0x1b74('0xd')];var _0x487c4b;if(_0xbdbf61>=_0x5c377e){_0xbdbf61=_0x5c377e;_0x487c4b=0xc8;}else{_0x487c4b=0xce;}_0x161f34['status'](_0x487c4b);return _0x161f34['set'](_0x1b74('0xf'),_0x55e147+'-'+_0xbdbf61+'/'+_0x5c377e)[_0x1b74('0xa')](_0x545311);}return null;};}function saveUpdates(_0x34f3f1){return function(_0x3a07e2){if(_0x3a07e2){return _0x3a07e2['update'](_0x34f3f1)['then'](function(_0x59f20d){return _0x59f20d;});}return null;};}function removeEntity(_0xd636e8){return function(_0x167bb2){if(_0x167bb2){return _0x167bb2[_0x1b74('0x10')]()[_0x1b74('0x11')](function(){_0xd636e8['status'](0xcc)[_0x1b74('0x9')]();});}};}function handleEntityNotFound(_0x5a71fb){return function(_0x2fc851){if(!_0x2fc851){_0x5a71fb[_0x1b74('0x7')](0x194);}return _0x2fc851;};}function handleError(_0x3d2c38,_0x2670fe){_0x2670fe=_0x2670fe||0x1f4;return function(_0x1be130){logger['error'](_0x1be130['stack']);if(_0x1be130['name']){delete _0x1be130[_0x1b74('0x12')];}_0x3d2c38[_0x1b74('0x8')](_0x2670fe)[_0x1b74('0x13')](_0x1be130);};}function maskClientSecret(_0x4e38d2){return _['padEnd'](_0x4e38d2['slice'](0x0,0x3),0x14,'*');}exports[_0x1b74('0x14')]=function(_0x4867e6,_0x14214d){var _0x97d8db={},_0x23d463={},_0x2cdf6b={'count':0x0,'rows':[]};var _0x281d3e=_[_0x1b74('0x15')](db[_0x1b74('0x16')][_0x1b74('0x17')],function(_0x4f936a){return{'name':_0x4f936a[_0x1b74('0x18')],'type':_0x4f936a[_0x1b74('0x19')][_0x1b74('0x1a')]};});_0x23d463[_0x1b74('0x1b')]=_[_0x1b74('0x15')](_0x281d3e,_0x1b74('0x12'));_0x23d463[_0x1b74('0x1c')]=_['keys'](_0x4867e6[_0x1b74('0x1c')]);_0x23d463[_0x1b74('0x1d')]=_[_0x1b74('0x1e')](_0x23d463[_0x1b74('0x1b')],_0x23d463['query']);_0x97d8db[_0x1b74('0x1f')]=_['intersection'](_0x23d463['model'],qs[_0x1b74('0x20')](_0x4867e6['query'][_0x1b74('0x20')]));_0x97d8db['attributes']=_0x97d8db[_0x1b74('0x1f')]['length']?_0x97d8db['attributes']:_0x23d463['model'];if(!_0x4867e6[_0x1b74('0x1c')][_0x1b74('0x21')](_0x1b74('0x22'))){_0x97d8db[_0x1b74('0xd')]=qs[_0x1b74('0xd')](_0x4867e6[_0x1b74('0x1c')][_0x1b74('0xd')]);_0x97d8db[_0x1b74('0xb')]=qs[_0x1b74('0xb')](_0x4867e6[_0x1b74('0x1c')][_0x1b74('0xb')]);}_0x97d8db[_0x1b74('0x23')]=qs[_0x1b74('0x24')](_0x4867e6['query'][_0x1b74('0x24')]);_0x97d8db[_0x1b74('0x25')]=qs[_0x1b74('0x1d')](_[_0x1b74('0x26')](_0x4867e6['query'],_0x23d463[_0x1b74('0x1d')]),_0x281d3e);if(_0x4867e6[_0x1b74('0x1c')][_0x1b74('0x27')]){_0x97d8db['where']=_[_0x1b74('0x28')](_0x97d8db[_0x1b74('0x25')],{'$or':_[_0x1b74('0x15')](_0x281d3e,function(_0x42f49e){if(_0x42f49e[_0x1b74('0x19')]!==_0x1b74('0x29')){var _0x2334f4={};_0x2334f4[_0x42f49e[_0x1b74('0x12')]]={'$like':'%'+_0x4867e6[_0x1b74('0x1c')][_0x1b74('0x27')]+'%'};return _0x2334f4;}})});}_0x97d8db=_[_0x1b74('0x28')]({},_0x97d8db,_0x4867e6['options']);var _0x27ea19={'where':_0x97d8db[_0x1b74('0x25')]};return db[_0x1b74('0x16')][_0x1b74('0xe')](_0x27ea19)[_0x1b74('0x11')](function(_0x57df34){_0x2cdf6b[_0x1b74('0xe')]=_0x57df34;if(_0x4867e6[_0x1b74('0x1c')][_0x1b74('0x2a')]){_0x97d8db[_0x1b74('0x2b')]=[{'all':!![]}];}return db[_0x1b74('0x16')][_0x1b74('0x2c')](_0x97d8db);})['then'](function(_0x4637e4){_0x2cdf6b['rows']=_[_0x1b74('0x15')](_0x4637e4,function(_0x50a1ec){if(_0x50a1ec['service']==='MicrosoftAzure'){var _0x1cc1be=encryptor['decryptString'](_0x50a1ec['data3']);_0x50a1ec[_0x1b74('0x2d')]=maskClientSecret(_0x1cc1be);}return _0x50a1ec;});return _0x2cdf6b;})[_0x1b74('0x11')](respondWithFilteredResult(_0x14214d,_0x97d8db))[_0x1b74('0x2e')](handleError(_0x14214d,null));};exports[_0x1b74('0x2f')]=function(_0x90e285,_0x323c8e){var _0x3438f6={'raw':!![],'where':{'id':_0x90e285[_0x1b74('0x30')]['id']}},_0x43171c={};_0x43171c[_0x1b74('0x1b')]=_['keys'](db['CloudProvider'][_0x1b74('0x17')]);_0x43171c[_0x1b74('0x1c')]=_['keys'](_0x90e285[_0x1b74('0x1c')]);_0x43171c[_0x1b74('0x1d')]=_[_0x1b74('0x1e')](_0x43171c[_0x1b74('0x1b')],_0x43171c[_0x1b74('0x1c')]);_0x3438f6['attributes']=_['intersection'](_0x43171c[_0x1b74('0x1b')],qs['fields'](_0x90e285[_0x1b74('0x1c')][_0x1b74('0x20')]));_0x3438f6['attributes']=_0x3438f6[_0x1b74('0x1f')][_0x1b74('0x31')]?_0x3438f6[_0x1b74('0x1f')]:_0x43171c[_0x1b74('0x1b')];if(_0x90e285[_0x1b74('0x1c')]['includeAll']){_0x3438f6[_0x1b74('0x2b')]=[{'all':!![]}];}_0x3438f6=_[_0x1b74('0x28')]({},_0x3438f6,_0x90e285[_0x1b74('0x32')]);return db['CloudProvider'][_0x1b74('0x33')](_0x3438f6)[_0x1b74('0x11')](handleEntityNotFound(_0x323c8e,null))[_0x1b74('0x11')](function(_0xa0714c){if(_0xa0714c[_0x1b74('0x34')]==='MicrosoftAzure'){var _0x5f0438=encryptor[_0x1b74('0x35')](_0xa0714c[_0x1b74('0x2d')]);_0xa0714c[_0x1b74('0x2d')]=maskClientSecret(_0x5f0438);}return _0xa0714c;})['then'](respondWithResult(_0x323c8e,null))[_0x1b74('0x2e')](handleError(_0x323c8e,null));};exports[_0x1b74('0x36')]=function(_0x174ba0,_0x4be9a8){if(!_0x174ba0[_0x1b74('0x37')]['name'])throw new Error(_0x1b74('0x38'));if(!_0x174ba0[_0x1b74('0x37')][_0x1b74('0x34')])throw new Error(_0x1b74('0x39'));var _0x386590=db['CloudProvider'][_0x1b74('0x17')][_0x1b74('0x34')]['values'];if(!_0x386590[_0x1b74('0x3a')](_0x174ba0[_0x1b74('0x37')][_0x1b74('0x34')]))throw new Error(_0x1b74('0x3b')+_0x386590['join'](',\x20'));if(_0x174ba0[_0x1b74('0x37')]['service']===_0x1b74('0x3c')&&_0x174ba0['body'][_0x1b74('0x2d')]){_0x174ba0[_0x1b74('0x37')][_0x1b74('0x2d')]=encryptor['encryptString'](_0x174ba0['body']['data3']);}return db[_0x1b74('0x16')][_0x1b74('0x36')](_0x174ba0['body'],{})[_0x1b74('0x11')](respondWithResult(_0x4be9a8,0xc9))[_0x1b74('0x2e')](handleError(_0x4be9a8,null));};exports['update']=function(_0x584637,_0x3456d1){if(_0x584637[_0x1b74('0x37')]['id']){delete _0x584637[_0x1b74('0x37')]['id'];}return db[_0x1b74('0x16')][_0x1b74('0x33')]({'where':{'id':_0x584637['params']['id']}})[_0x1b74('0x11')](handleEntityNotFound(_0x3456d1,null))[_0x1b74('0x11')](function(_0x106f31){if(_0x106f31[_0x1b74('0x34')]===_0x1b74('0x3c')&&_0x584637['body']['data3']){_0x584637[_0x1b74('0x37')]['data3']=encryptor['encryptString'](_0x584637['body'][_0x1b74('0x2d')]);}return _0x106f31;})['then'](saveUpdates(_0x584637['body'],null))['then'](respondWithResult(_0x3456d1,null))['catch'](handleError(_0x3456d1,null));};exports['destroy']=function(_0x5221a4,_0x39f151){return db[_0x1b74('0x16')]['find']({'where':{'id':_0x5221a4['params']['id']}})['then'](handleEntityNotFound(_0x39f151,null))[_0x1b74('0x11')](removeEntity(_0x39f151,null))[_0x1b74('0x2e')](handleError(_0x39f151,null));};exports[_0x1b74('0x3d')]=function(_0x3756f4,_0x1e213e){return db['CloudProvider'][_0x1b74('0x3e')]({'where':{'id':_0x3756f4[_0x1b74('0x30')]['id']},'raw':!![]})['then'](function(_0x4c6144){if(!_0x4c6144)return _0x1e213e[_0x1b74('0x7')](0x194);return{'url':oauth[_0x1b74('0x3f')](_0x4c6144,_0x3756f4[_0x1b74('0x40')]['id'])};})['then'](respondWithResult(_0x1e213e,null))[_0x1b74('0x2e')](handleError(_0x1e213e,null));};exports[_0x1b74('0x41')]=function(_0x55819e,_0x11cd53){var _0x587688=_0x55819e[_0x1b74('0x37')];var _0x103fe8;var _0x2fb859;if(_0x587688[_0x1b74('0x42')])throw _0x587688;redis['get'](_0x587688[_0x1b74('0x43')])[_0x1b74('0x11')](function(_0x3615e1){if(!_0x3615e1)throw new Error('Invalid\x20state\x20parameter');_0x103fe8=JSON[_0x1b74('0x44')](_0x3615e1);var _0x15f535=Buffer['from'](_0x587688[_0x1b74('0x43')],_0x1b74('0x45'))[_0x1b74('0x46')](_0x1b74('0x47'));_0x2fb859=JSON['parse'](_0x15f535);if(!oauth[_0x1b74('0x48')](_0x587688[_0x1b74('0x49')],_0x103fe8[_0x1b74('0x4a')]))throw new Error(_0x1b74('0x4b'));redis[_0x1b74('0x4c')](_0x587688[_0x1b74('0x43')]);return oauth[_0x1b74('0x4d')](_0x587688['code'],_0x103fe8);})[_0x1b74('0x11')](function(_0x289622){_0x103fe8[_0x1b74('0x4e')]=_0x289622[_0x1b74('0x4f')];_0x103fe8[_0x1b74('0x50')]=_0x289622[_0x1b74('0x51')];return db['CloudProvider'][_0x1b74('0x52')]({'data5':_0x103fe8['data5'],'data6':_0x103fe8[_0x1b74('0x50')]},{'where':{'id':_0x103fe8['id']}});})[_0x1b74('0x11')](function(){oauth[_0x1b74('0x53')](_0x103fe8);socket[_0x1b74('0x54')](_0x1b74('0x55'),{'id':_0x2fb859['id']});return;})['then'](respondWithStatusCode(_0x11cd53,null))['catch'](function(_0xce325f){if(_0x2fb859){socket[_0x1b74('0x54')](_0x1b74('0x56'),{'id':_0x2fb859['id']});}if(!_0x103fe8){logger[_0x1b74('0x42')]('Invalid\x20authentication\x20state\x20parameter',_0xce325f);return _0x11cd53[_0x1b74('0x8')](0x1f4)[_0x1b74('0x13')](_0xce325f[_0x1b74('0x57')]);}logger[_0x1b74('0x42')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x103fe8['id'],JSON[_0x1b74('0x58')](_0xce325f));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index d253d81..bccbaa5 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 _0xd65c=['path','rimraf','../../config/environment','./cloudProvider.attributes','define','cloud_providers','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x700cdb,_0x482979){var _0x2a106e=function(_0xb6f6){while(--_0xb6f6){_0x700cdb['push'](_0x700cdb['shift']());}};_0x2a106e(++_0x482979);}(_0xd65c,0x102));var _0xcd65=function(_0x5bc202,_0x314535){_0x5bc202=_0x5bc202-0x0;var _0x253744=_0xd65c[_0x5bc202];return _0x253744;};'use strict';var _=require(_0xcd65('0x0'));var util=require(_0xcd65('0x1'));var logger=require(_0xcd65('0x2'))('api');var moment=require(_0xcd65('0x3'));var BPromise=require(_0xcd65('0x4'));var rp=require(_0xcd65('0x5'));var fs=require('fs');var path=require(_0xcd65('0x6'));var rimraf=require(_0xcd65('0x7'));var config=require(_0xcd65('0x8'));var attributes=require(_0xcd65('0x9'));module['exports']=function(_0x83b897,_0x178cf9){return _0x83b897[_0xcd65('0xa')]('CloudProvider',attributes,{'tableName':_0xcd65('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ff6=['lodash','util','api','moment','request-promise','path','rimraf','./cloudProvider.attributes','CloudProvider','cloud_providers'];(function(_0x53a7b8,_0x4f3f47){var _0x104501=function(_0x51f97b){while(--_0x51f97b){_0x53a7b8['push'](_0x53a7b8['shift']());}};_0x104501(++_0x4f3f47);}(_0x9ff6,0x15e));var _0x69ff=function(_0x51b764,_0x527497){_0x51b764=_0x51b764-0x0;var _0x1d9607=_0x9ff6[_0x51b764];return _0x1d9607;};'use strict';var _=require(_0x69ff('0x0'));var util=require(_0x69ff('0x1'));var logger=require('../../config/logger')(_0x69ff('0x2'));var moment=require(_0x69ff('0x3'));var BPromise=require('bluebird');var rp=require(_0x69ff('0x4'));var fs=require('fs');var path=require(_0x69ff('0x5'));var rimraf=require(_0x69ff('0x6'));var config=require('../../config/environment');var attributes=require(_0x69ff('0x7'));module['exports']=function(_0x5c5e6b,_0x2bdde8){return _0x5c5e6b['define'](_0x69ff('0x8'),attributes,{'tableName':_0x69ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index ee104fc..91e7339 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 _0x80a2=['lodash','crypto','jsonwebtoken','moment','util','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','localhost','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office.com/SMTP.Send','/token','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','code','id_token','stringify','toString','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','key','value','oauth2Claims','set','decode','issuer','aud','audience','isAfter','resolve','then','data3','CloudProvider','findOne','data6','decryptString','POST','{TENANT_ID}','data2','access_token','refresh_token','data5','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s'];(function(_0xd2cb55,_0x288c31){var _0x23c873=function(_0x540ac0){while(--_0x540ac0){_0xd2cb55['push'](_0xd2cb55['shift']());}};_0x23c873(++_0x288c31);}(_0x80a2,0x8c));var _0x280a=function(_0x574647,_0x268196){_0x574647=_0x574647-0x0;var _0x103c05=_0x80a2[_0x574647];return _0x103c05;};'use strict';var _=require(_0x280a('0x0'));var crypto=require(_0x280a('0x1'));var jwt=require(_0x280a('0x2'));var moment=require(_0x280a('0x3'));var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0x280a('0x4'));var encryptor=require(_0x280a('0x5'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x280a('0x6'));var schedule=require(_0x280a('0x7'));var db=require(_0x280a('0x8'))['db'];config['redis']=_[_0x280a('0x9')](config['redis'],{'host':_0x280a('0xa'),'port':0x18eb});var redis=new Redis(config[_0x280a('0xb')]);var MICROSOFT_AUTH_URL=_0x280a('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x280a('0xd'),_0x280a('0xe'),'email',_0x280a('0xf'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0x280a('0x10')],'Dynamics365':[_0x280a('0xd'),_0x280a('0xf')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x280a('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5c5eec){var _0x18918e=_['map'](AZURE_AUTH_SCOPES[_0x5c5eec[_0x280a('0x12')]]);if(_0x5c5eec['type']===_0x280a('0x13'))_0x18918e[_0x280a('0x14')](_0x5c5eec[_0x280a('0x15')]+_0x280a('0x16'));return _0x18918e[_0x280a('0x17')]('\x20');}function getAccessTokenScope(_0x1aada5){if(_0x1aada5[_0x280a('0x12')]===_0x280a('0x18'))return _0x280a('0x19');if(_0x1aada5['type']===_0x280a('0x13'))return _0x1aada5[_0x280a('0x15')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x470c87,_0x4f588d){var _0x1e519b=MICROSOFT_AUTH_URL[_0x280a('0x1a')]('{TENANT_ID}',_0x470c87['data2']);var _0x36bc15=[_0x280a('0x1b'),_0x280a('0x1c')];var _0x6f5812=Buffer['from'](JSON[_0x280a('0x1d')]({'id':_0x4f588d}))[_0x280a('0x1e')]('base64');var _0x5987f6=crypto['randomBytes'](0x10)[_0x280a('0x1e')]('hex');var _0x43cf68=getAuthorizationScopes(_0x470c87);var _0x41a67b=[{'key':'client_id','value':_0x470c87[_0x280a('0x1f')]},{'key':_0x280a('0x20'),'value':encodeURIComponent(_0x36bc15['join']('\x20'))},{'key':_0x280a('0x21'),'value':_0x470c87[_0x280a('0x22')]},{'key':_0x280a('0x23'),'value':_0x280a('0x24')},{'key':_0x280a('0x25'),'value':encodeURIComponent(_0x43cf68)},{'key':_0x280a('0x26'),'value':_0x6f5812},{'key':_0x280a('0x27'),'value':_0x5987f6},{'key':'prompt','value':'login'}];var _0x4805cd=_0x1e519b+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x41a67b,function(_0x266d72){return _0x266d72[_0x280a('0x28')]+'='+_0x266d72[_0x280a('0x29')];})['join']('&');_0x470c87[_0x280a('0x2a')]={'issuer':_0x1e519b[_0x280a('0x1a')]('oauth2/',''),'audience':_0x470c87[_0x280a('0x1f')],'state':_0x6f5812,'nonce':_0x5987f6};redis[_0x280a('0x2b')](_0x6f5812,JSON[_0x280a('0x1d')](_0x470c87));return _0x4805cd;}function isValidIdToken(_0x20d13c,_0x3d0b06){try{var _0xc8457=jwt[_0x280a('0x2c')](_0x20d13c,{'complete':!![]});var _0x46d16f=_0xc8457['payload'];if(_0x46d16f['iss']!==_0x3d0b06[_0x280a('0x2d')])return![];if(_0x46d16f[_0x280a('0x2e')]!==_0x3d0b06[_0x280a('0x2f')])return![];if(_0x46d16f[_0x280a('0x27')]!==_0x3d0b06['nonce'])return![];if(moment()[_0x280a('0x30')](moment['unix'](_0x46d16f['exp'])))return![];return!![];}catch(_0x3a8588){throw _0x3a8588;}}function refreshOauth2MicrosoftAccessToken(_0x5c67f8){return Promise[_0x280a('0x31')]()[_0x280a('0x32')](function(){if(_0x5c67f8[_0x280a('0x33')])return _0x5c67f8;return db[_0x280a('0x34')][_0x280a('0x35')]({'where':{'id':_0x5c67f8['id']},'raw':!![]});})[_0x280a('0x32')](function(_0x181a83){var _0x28d9ad={'grant_type':'refresh_token','refresh_token':_0x181a83[_0x280a('0x36')],'scope':getAccessTokenScope(_0x181a83),'redirect_uri':_0x181a83[_0x280a('0x22')],'client_id':_0x181a83[_0x280a('0x1f')],'client_secret':encryptor[_0x280a('0x37')](_0x181a83['data3'])};var _0x4b54bc={'method':_0x280a('0x38'),'uri':MICROSOFT_AUTH_URL[_0x280a('0x1a')](_0x280a('0x39'),_0x181a83[_0x280a('0x3a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x28d9ad,'json':!![]};return rp(_0x4b54bc);})[_0x280a('0x32')](function(_0x28d5b0){_0x5c67f8['data5']=_0x28d5b0[_0x280a('0x3b')];_0x5c67f8[_0x280a('0x36')]=_0x28d5b0[_0x280a('0x3c')];return db[_0x280a('0x34')]['update']({'data5':_0x5c67f8[_0x280a('0x3d')],'data6':_0x5c67f8[_0x280a('0x36')]},{'where':{'id':_0x5c67f8['id']}});})[_0x280a('0x32')](function(){return _0x5c67f8;})[_0x280a('0x3e')](function(_0x372e1c){logger['error'](_0x280a('0x3f'),_0x5c67f8['id'],_0x372e1c);});}function getOauth2MicrosoftAccessToken(_0x59984d,_0x1f8980){var _0x53e0fe={'grant_type':_0x280a('0x40'),'code':_0x59984d,'scope':getAccessTokenScope(_0x1f8980),'redirect_uri':_0x1f8980['data4'],'client_id':_0x1f8980['data1'],'client_secret':encryptor[_0x280a('0x37')](_0x1f8980[_0x280a('0x33')])};var _0x331046={'method':_0x280a('0x38'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x1f8980[_0x280a('0x3a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x53e0fe,'json':!![]};return rp(_0x331046);}function startRefreshInterval(_0x13f45f){var _0x2c6dfd=schedule[_0x280a('0x41')];if(_0x2c6dfd[_0x13f45f['id']])clearInterval(_0x2c6dfd[_0x13f45f['id']]);_0x2c6dfd[_0x13f45f['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x13f45f['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x280a('0x41')]=_0x2c6dfd;}function startAllRefreshIntervals(){return db[_0x280a('0x34')][_0x280a('0x42')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x280a('0x32')](function(_0x3dcebf){var _0x417e66=_0x3dcebf['map'](function(_0x1f32e9){return refreshOauth2MicrosoftAccessToken(_0x1f32e9)[_0x280a('0x32')](function(_0x31bd47){startRefreshInterval(_0x31bd47);});});return Promise[_0x280a('0x43')](_0x417e66);})[_0x280a('0x3e')](function(_0x4b8e8e){var _0x359751=_0x4b8e8e?util['inspect'](_0x4b8e8e,{'showHidden':![],'depth':null}):'';logger[_0x280a('0x44')](_0x280a('0x45'),_0x359751);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x6844=['data5','access_token','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','type','Dynamics365','push','data7','/.default','join','Outlook365','{TENANT_ID}','data2','code','from','stringify','toString','base64','hex','client_id','data1','response_type','redirect_uri','data4','form_post','scope','state','nonce','login','map','key','value','replace','set','decode','payload','issuer','audience','isAfter','unix','resolve','then','findOne','data6','decryptString','data3'];(function(_0x46f715,_0x25ed97){var _0x1213e3=function(_0xd9f66d){while(--_0xd9f66d){_0x46f715['push'](_0x46f715['shift']());}};_0x1213e3(++_0x25ed97);}(_0x6844,0x1cd));var _0x4684=function(_0x23b478,_0x3e738a){_0x23b478=_0x23b478-0x0;var _0x11648e=_0x6844[_0x23b478];return _0x11648e;};'use strict';var _=require(_0x4684('0x0'));var crypto=require(_0x4684('0x1'));var jwt=require(_0x4684('0x2'));var moment=require(_0x4684('0x3'));var Redis=require(_0x4684('0x4'));var rp=require('request-promise');var util=require(_0x4684('0x5'));var encryptor=require(_0x4684('0x6'));var config=require('../../config/environment');var logger=require(_0x4684('0x7'))(_0x4684('0x8'));var schedule=require(_0x4684('0x9'));var db=require(_0x4684('0xa'))['db'];config[_0x4684('0xb')]=_[_0x4684('0xc')](config[_0x4684('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x4684('0xb')]);var MICROSOFT_AUTH_URL=_0x4684('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x4684('0xe'),_0x4684('0xf'),_0x4684('0x10'),_0x4684('0x11'),_0x4684('0x12'),_0x4684('0x13'),_0x4684('0x14')],'Dynamics365':[_0x4684('0xe'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x4684('0x15');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1c6cc1){var _0x1f7c84=_['map'](AZURE_AUTH_SCOPES[_0x1c6cc1[_0x4684('0x16')]]);if(_0x1c6cc1[_0x4684('0x16')]===_0x4684('0x17'))_0x1f7c84[_0x4684('0x18')](_0x1c6cc1[_0x4684('0x19')]+_0x4684('0x1a'));return _0x1f7c84[_0x4684('0x1b')]('\x20');}function getAccessTokenScope(_0x24da25){if(_0x24da25[_0x4684('0x16')]===_0x4684('0x1c'))return _0x4684('0x12');if(_0x24da25[_0x4684('0x16')]==='Dynamics365')return _0x24da25[_0x4684('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x57114c,_0xc76d10){var _0x4410aa=MICROSOFT_AUTH_URL['replace'](_0x4684('0x1d'),_0x57114c[_0x4684('0x1e')]);var _0x3a714d=[_0x4684('0x1f'),'id_token'];var _0xbf0cc7=Buffer[_0x4684('0x20')](JSON[_0x4684('0x21')]({'id':_0xc76d10}))[_0x4684('0x22')](_0x4684('0x23'));var _0x5c2ba1=crypto['randomBytes'](0x10)['toString'](_0x4684('0x24'));var _0x31a8f5=getAuthorizationScopes(_0x57114c);var _0x46fc6c=[{'key':_0x4684('0x25'),'value':_0x57114c[_0x4684('0x26')]},{'key':_0x4684('0x27'),'value':encodeURIComponent(_0x3a714d[_0x4684('0x1b')]('\x20'))},{'key':_0x4684('0x28'),'value':_0x57114c[_0x4684('0x29')]},{'key':'response_mode','value':_0x4684('0x2a')},{'key':_0x4684('0x2b'),'value':encodeURIComponent(_0x31a8f5)},{'key':_0x4684('0x2c'),'value':_0xbf0cc7},{'key':_0x4684('0x2d'),'value':_0x5c2ba1},{'key':'prompt','value':_0x4684('0x2e')}];var _0x3e9041=_0x4410aa+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x4684('0x2f')](_0x46fc6c,function(_0x433860){return _0x433860[_0x4684('0x30')]+'='+_0x433860[_0x4684('0x31')];})['join']('&');_0x57114c['oauth2Claims']={'issuer':_0x4410aa[_0x4684('0x32')]('oauth2/',''),'audience':_0x57114c['data1'],'state':_0xbf0cc7,'nonce':_0x5c2ba1};redis[_0x4684('0x33')](_0xbf0cc7,JSON[_0x4684('0x21')](_0x57114c));return _0x3e9041;}function isValidIdToken(_0x336e3f,_0x1b9a44){try{var _0x3f5cd6=jwt[_0x4684('0x34')](_0x336e3f,{'complete':!![]});var _0xc4d70f=_0x3f5cd6[_0x4684('0x35')];if(_0xc4d70f['iss']!==_0x1b9a44[_0x4684('0x36')])return![];if(_0xc4d70f['aud']!==_0x1b9a44[_0x4684('0x37')])return![];if(_0xc4d70f[_0x4684('0x2d')]!==_0x1b9a44['nonce'])return![];if(moment()[_0x4684('0x38')](moment[_0x4684('0x39')](_0xc4d70f['exp'])))return![];return!![];}catch(_0x3fdee4){throw _0x3fdee4;}}function refreshOauth2MicrosoftAccessToken(_0x3dc6fa){return Promise[_0x4684('0x3a')]()[_0x4684('0x3b')](function(){if(_0x3dc6fa['data3'])return _0x3dc6fa;return db['CloudProvider'][_0x4684('0x3c')]({'where':{'id':_0x3dc6fa['id']},'raw':!![]});})['then'](function(_0x1a6502){var _0x242f50={'grant_type':'refresh_token','refresh_token':_0x1a6502[_0x4684('0x3d')],'scope':getAccessTokenScope(_0x1a6502),'redirect_uri':_0x1a6502[_0x4684('0x29')],'client_id':_0x1a6502[_0x4684('0x26')],'client_secret':encryptor[_0x4684('0x3e')](_0x1a6502[_0x4684('0x3f')])};var _0x6a58d1={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x4684('0x32')](_0x4684('0x1d'),_0x1a6502[_0x4684('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x242f50,'json':!![]};return rp(_0x6a58d1);})[_0x4684('0x3b')](function(_0xd88536){_0x3dc6fa[_0x4684('0x40')]=_0xd88536[_0x4684('0x41')];_0x3dc6fa[_0x4684('0x3d')]=_0xd88536['refresh_token'];return db['CloudProvider'][_0x4684('0x42')]({'data5':_0x3dc6fa[_0x4684('0x40')],'data6':_0x3dc6fa[_0x4684('0x3d')]},{'where':{'id':_0x3dc6fa['id']}});})[_0x4684('0x3b')](function(){return _0x3dc6fa;})['catch'](function(_0x5e681c){logger[_0x4684('0x43')](_0x4684('0x44'),_0x3dc6fa['id'],_0x5e681c);});}function getOauth2MicrosoftAccessToken(_0x5f15b3,_0x482603){var _0x3d65f2={'grant_type':_0x4684('0x45'),'code':_0x5f15b3,'scope':getAccessTokenScope(_0x482603),'redirect_uri':_0x482603[_0x4684('0x29')],'client_id':_0x482603[_0x4684('0x26')],'client_secret':encryptor['decryptString'](_0x482603[_0x4684('0x3f')])};var _0xde0902={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x4684('0x32')]('{TENANT_ID}',_0x482603[_0x4684('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3d65f2,'json':!![]};return rp(_0xde0902);}function startRefreshInterval(_0x3df8f5){var _0x20e867=schedule[_0x4684('0x46')];if(_0x20e867[_0x3df8f5['id']])clearInterval(_0x20e867[_0x3df8f5['id']]);_0x20e867[_0x3df8f5['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x4684('0x47')](this,{'id':_0x3df8f5['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x4684('0x46')]=_0x20e867;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x4684('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x4684('0x3b')](function(_0x14da2c){var _0x5612e0=_0x14da2c[_0x4684('0x2f')](function(_0x32c954){return refreshOauth2MicrosoftAccessToken(_0x32c954)[_0x4684('0x3b')](function(_0x4cd4a6){startRefreshInterval(_0x4cd4a6);});});return Promise[_0x4684('0x49')](_0x5612e0);})['catch'](function(_0x106bc4){var _0x20be96=_0x106bc4?util['inspect'](_0x106bc4,{'showHidden':![],'depth':null}):'';logger['error'](_0x4684('0x4a'),_0x20be96);});}module['exports']={'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 71d4d8c..46055ed 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 _0x8286=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8286,0x66));var _0x6828=function(_0x9ce4ee,_0x4b2621){_0x9ce4ee=_0x9ce4ee-0x0;var _0x6cf8eb=_0x8286[_0x9ce4ee];return _0x6cf8eb;};'use strict';var _=require(_0x6828('0x0'));var util=require(_0x6828('0x1'));var moment=require(_0x6828('0x2'));var BPromise=require(_0x6828('0x3'));var rs=require(_0x6828('0x4'));var fs=require('fs');var Redis=require(_0x6828('0x5'));var db=require(_0x6828('0x6'))['db'];var utils=require(_0x6828('0x7'));var logger=require(_0x6828('0x8'))(_0x6828('0x9'));var config=require(_0x6828('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6828('0xb')][_0x6828('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5863bf,_0x28c1f2,_0x361730){return new BPromise(function(_0x2e0e4f,_0x4c2c37){return client[_0x6828('0xd')](_0x5863bf,_0x361730)[_0x6828('0xe')](function(_0x1d9cf3){logger[_0x6828('0xf')](_0x6828('0x10'),_0x28c1f2,_0x6828('0x11'));logger[_0x6828('0x12')](_0x6828('0x13'),_0x28c1f2,_0x6828('0x11'),JSON['stringify'](_0x1d9cf3));if(_0x1d9cf3['error']){if(_0x1d9cf3[_0x6828('0x14')]['code']===0x1f4){logger[_0x6828('0x14')]('CloudProvider,\x20%s,\x20%s',_0x28c1f2,_0x1d9cf3[_0x6828('0x14')][_0x6828('0x15')]);return _0x4c2c37(_0x1d9cf3[_0x6828('0x14')][_0x6828('0x15')]);}logger[_0x6828('0x14')](_0x6828('0x10'),_0x28c1f2,_0x1d9cf3['error'][_0x6828('0x15')]);return _0x2e0e4f(_0x1d9cf3[_0x6828('0x14')][_0x6828('0x15')]);}else{logger['info'](_0x6828('0x10'),_0x28c1f2,_0x6828('0x11'));_0x2e0e4f(_0x1d9cf3[_0x6828('0x16')]['message']);}})[_0x6828('0x17')](function(_0x114e48){logger['error'](_0x6828('0x10'),_0x28c1f2,_0x114e48);_0x4c2c37(_0x114e48);});});} \ No newline at end of file +var _0xb94c=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring'];(function(_0x9fb081,_0x48f480){var _0x43f8b0=function(_0x418570){while(--_0x418570){_0x9fb081['push'](_0x9fb081['shift']());}};_0x43f8b0(++_0x48f480);}(_0xb94c,0x176));var _0xcb94=function(_0x1bc547,_0x24124a){_0x1bc547=_0x1bc547-0x0;var _0x424d29=_0xb94c[_0x1bc547];return _0x424d29;};'use strict';var _=require(_0xcb94('0x0'));var util=require(_0xcb94('0x1'));var moment=require('moment');var BPromise=require(_0xcb94('0x2'));var rs=require(_0xcb94('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb94('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb94('0x5'))(_0xcb94('0x6'));var config=require(_0xcb94('0x7'));var jayson=require(_0xcb94('0x8'));var client=jayson[_0xcb94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ab328,_0x27441c,_0x20f879){return new BPromise(function(_0x22cac1,_0x16288f){return client['request'](_0x3ab328,_0x20f879)[_0xcb94('0xa')](function(_0x3305c9){logger[_0xcb94('0xb')](_0xcb94('0xc'),_0x27441c,'request\x20sent');logger[_0xcb94('0xd')](_0xcb94('0xe'),_0x27441c,_0xcb94('0xf'),JSON[_0xcb94('0x10')](_0x3305c9));if(_0x3305c9[_0xcb94('0x11')]){if(_0x3305c9[_0xcb94('0x11')][_0xcb94('0x12')]===0x1f4){logger[_0xcb94('0x11')](_0xcb94('0xc'),_0x27441c,_0x3305c9[_0xcb94('0x11')]['message']);return _0x16288f(_0x3305c9[_0xcb94('0x11')][_0xcb94('0x13')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x27441c,_0x3305c9['error']['message']);return _0x22cac1(_0x3305c9[_0xcb94('0x11')][_0xcb94('0x13')]);}else{logger[_0xcb94('0xb')]('CloudProvider,\x20%s,\x20%s',_0x27441c,_0xcb94('0xf'));_0x22cac1(_0x3305c9['result'][_0xcb94('0x13')]);}})[_0xcb94('0x14')](function(_0x3dbfbb){logger[_0xcb94('0x11')](_0xcb94('0xc'),_0x27441c,_0x3dbfbb);_0x16288f(_0x3dbfbb);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 2fb0842..2a69adb 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(_0x385c76,_0xb97335){var _0x5c8367=function(_0xdfcd3){while(--_0xdfcd3){_0x385c76['push'](_0x385c76['shift']());}};_0x5c8367(++_0xb97335);}(_0x1261,0x144));var _0x1126=function(_0x503699,_0x152145){_0x503699=_0x503699-0x0;var _0xd66c82=_0x1261[_0x503699];return _0xd66c82;};'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 _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x384da0,_0x51c6bc){var _0x272e86=function(_0x5c2f00){while(--_0x5c2f00){_0x384da0['push'](_0x384da0['shift']());}};_0x272e86(++_0x51c6bc);}(_0xadb5,0xad));var _0x5adb=function(_0x2cf7c3,_0xa99485){_0x2cf7c3=_0x2cf7c3-0x0;var _0x230f55=_0xadb5[_0x2cf7c3];return _0x230f55;};'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['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 49178bb..a8e226e 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 _0xd2e2=['STRING','name','sequelize','exports'];(function(_0x4777fc,_0x40806d){var _0x28523f=function(_0x303fec){while(--_0x303fec){_0x4777fc['push'](_0x4777fc['shift']());}};_0x28523f(++_0x40806d);}(_0xd2e2,0xa2));var _0x2d2e=function(_0x36e34d,_0x23b320){_0x36e34d=_0x36e34d-0x0;var _0x2ff10d=_0xd2e2[_0x36e34d];return _0x2ff10d;};'use strict';var Sequelize=require(_0x2d2e('0x0'));module[_0x2d2e('0x1')]={'name':{'type':Sequelize[_0x2d2e('0x2')],'unique':_0x2d2e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2d2e('0x2')]},'companyId':{'type':Sequelize[_0x2d2e('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x2d2e('0x2')]},'fax':{'type':Sequelize[_0x2d2e('0x2')]},'type':{'type':Sequelize[_0x2d2e('0x2')]},'street':{'type':Sequelize[_0x2d2e('0x2')]},'postalCode':{'type':Sequelize[_0x2d2e('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2d2e('0x2')]},'email':{'type':Sequelize[_0x2d2e('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2d2e('0x2')]},'sStreet':{'type':Sequelize[_0x2d2e('0x2')]},'sPostalCode':{'type':Sequelize[_0x2d2e('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x70e4=['name','sequelize','exports','STRING'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x70e4,0x13d));var _0x470e=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0x70e4[_0x1acc2d];return _0xabfa6d;};'use strict';var Sequelize=require(_0x470e('0x0'));module[_0x470e('0x1')]={'name':{'type':Sequelize[_0x470e('0x2')],'unique':_0x470e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x470e('0x2')]},'companyId':{'type':Sequelize[_0x470e('0x2')]},'website':{'type':Sequelize[_0x470e('0x2')]},'phone':{'type':Sequelize[_0x470e('0x2')]},'fax':{'type':Sequelize[_0x470e('0x2')]},'type':{'type':Sequelize[_0x470e('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x470e('0x2')]},'city':{'type':Sequelize[_0x470e('0x2')]},'country':{'type':Sequelize[_0x470e('0x2')]},'email':{'type':Sequelize[_0x470e('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x470e('0x2')]},'sStreet':{'type':Sequelize[_0x470e('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x470e('0x2')]},'sCountry':{'type':Sequelize['STRING']},'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 d46f7dc..e06f9a8 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 _0x5889=['fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','options','includeAll','rows','catch','show','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','describe','addContacts','ids','omit','getContacts','findOne','filter','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','model','keys','query','intersection'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x5889,0x161));var _0x9588=function(_0x3cc121,_0x18d080){_0x3cc121=_0x3cc121-0x0;var _0x5bcaf2=_0x5889[_0x3cc121];return _0x5bcaf2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9588('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9588('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9588('0x2'));var Mustache=require('mustache');var util=require(_0x9588('0x3'));var path=require(_0x9588('0x4'));var sox=require(_0x9588('0x5'));var csv=require(_0x9588('0x6'));var ejs=require(_0x9588('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9588('0x8'));var crypto=require('crypto');var jsforce=require(_0x9588('0x9'));var deskjs=require(_0x9588('0xa'));var toCsv=require('to-csv');var querystring=require(_0x9588('0xb'));var Papa=require(_0x9588('0xc'));var Redis=require('ioredis');var authService=require(_0x9588('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x9588('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9588('0xf'))('api');var utils=require(_0x9588('0x10'));var config=require(_0x9588('0x11'));var licenseUtil=require(_0x9588('0x12'));var db=require(_0x9588('0x13'))['db'];function respondWithStatusCode(_0x5a3918,_0x3dd648){_0x3dd648=_0x3dd648||0xcc;return function(_0x7dfbf6){if(_0x7dfbf6){return _0x5a3918[_0x9588('0x14')](_0x3dd648);}return _0x5a3918[_0x9588('0x15')](_0x3dd648)[_0x9588('0x16')]();};}function respondWithResult(_0x373c10,_0x38d7d0){_0x38d7d0=_0x38d7d0||0xc8;return function(_0x189cb9){if(_0x189cb9){return _0x373c10[_0x9588('0x15')](_0x38d7d0)[_0x9588('0x17')](_0x189cb9);}};}function respondWithFilteredResult(_0x3286f7,_0xb892b5){return function(_0x1c4a54){if(_0x1c4a54){var _0x462256=typeof _0xb892b5[_0x9588('0x18')]===_0x9588('0x19')&&typeof _0xb892b5[_0x9588('0x1a')]===_0x9588('0x19');var _0x54e6a2=_0x1c4a54[_0x9588('0x1b')];var _0x2b62ca=_0x462256?0x0:_0xb892b5[_0x9588('0x18')];var _0x3393b8=_0x462256?_0x1c4a54['count']:_0xb892b5[_0x9588('0x18')]+_0xb892b5[_0x9588('0x1a')];var _0x28614b;if(_0x3393b8>=_0x54e6a2){_0x3393b8=_0x54e6a2;_0x28614b=0xc8;}else{_0x28614b=0xce;}_0x3286f7[_0x9588('0x15')](_0x28614b);return _0x3286f7[_0x9588('0x1c')](_0x9588('0x1d'),_0x2b62ca+'-'+_0x3393b8+'/'+_0x54e6a2)[_0x9588('0x17')](_0x1c4a54);}return null;};}function patchUpdates(_0x175e19){return function(_0x5350b1){try{jsonpatch['apply'](_0x5350b1,_0x175e19,!![]);}catch(_0x4cc2b8){return BPromise['reject'](_0x4cc2b8);}return _0x5350b1[_0x9588('0x1e')]();};}function saveUpdates(_0x57222d,_0x1ab1fa){return function(_0x4e42a6){if(_0x4e42a6){return _0x4e42a6[_0x9588('0x1f')](_0x57222d)[_0x9588('0x20')](function(_0x24a852){return _0x24a852;});}return null;};}function removeEntity(_0x3cbf5e,_0x21942a){return function(_0x129d3a){if(_0x129d3a){return _0x129d3a[_0x9588('0x21')]()[_0x9588('0x20')](function(){var _0x591771=_0x129d3a[_0x9588('0x22')]({'plain':!![]});var _0x11fba6=_0x9588('0x23');return db[_0x9588('0x24')][_0x9588('0x21')]({'where':{'type':_0x11fba6,'resourceId':_0x591771['id']}})[_0x9588('0x20')](function(){return _0x129d3a;});})[_0x9588('0x20')](function(){_0x3cbf5e[_0x9588('0x15')](0xcc)[_0x9588('0x16')]();});}};}function handleEntityNotFound(_0x51ac15,_0x2fff20){return function(_0x3db882){if(!_0x3db882){_0x51ac15[_0x9588('0x14')](0x194);}return _0x3db882;};}function handleError(_0x5f5627,_0x15275c){_0x15275c=_0x15275c||0x1f4;return function(_0x10d594){logger[_0x9588('0x25')](_0x10d594[_0x9588('0x26')]);if(_0x10d594[_0x9588('0x27')]){delete _0x10d594[_0x9588('0x27')];}_0x5f5627[_0x9588('0x15')](_0x15275c)[_0x9588('0x28')](_0x10d594);};}exports[_0x9588('0x29')]=function(_0x16f833,_0x28ec79){var _0x1a8c7c={},_0x19e762={},_0x3815b1={'count':0x0,'rows':[]};return db[_0x9588('0x2a')]['describe']()[_0x9588('0x20')](function(_0x53cc51){_0x19e762[_0x9588('0x2b')]=_[_0x9588('0x2c')](_0x53cc51);_0x19e762['query']=_['keys'](_0x16f833[_0x9588('0x2d')]);_0x19e762['filters']=_[_0x9588('0x2e')](_0x19e762[_0x9588('0x2b')],_0x19e762[_0x9588('0x2d')]);_0x1a8c7c['attributes']=_[_0x9588('0x2e')](_0x19e762['model'],qs['fields'](_0x16f833[_0x9588('0x2d')][_0x9588('0x2f')]));_0x1a8c7c[_0x9588('0x30')]=_0x1a8c7c[_0x9588('0x30')]['length']?_0x1a8c7c[_0x9588('0x30')]:_0x19e762[_0x9588('0x2b')];if(!_0x16f833[_0x9588('0x2d')][_0x9588('0x31')](_0x9588('0x32'))){_0x1a8c7c[_0x9588('0x1a')]=qs[_0x9588('0x1a')](_0x16f833[_0x9588('0x2d')][_0x9588('0x1a')]);_0x1a8c7c[_0x9588('0x18')]=qs[_0x9588('0x18')](_0x16f833[_0x9588('0x2d')]['offset']);}_0x1a8c7c[_0x9588('0x33')]=qs['sort'](_0x16f833['query'][_0x9588('0x34')]);_0x1a8c7c[_0x9588('0x35')]=qs[_0x9588('0x36')](_[_0x9588('0x37')](_0x16f833[_0x9588('0x2d')],_0x19e762[_0x9588('0x36')]),_0x53cc51);if(_0x16f833[_0x9588('0x2d')]['filter']){_0x1a8c7c['where']=_[_0x9588('0x38')](_0x1a8c7c[_0x9588('0x35')],{'$or':_[_0x9588('0x39')](_0x1a8c7c['attributes'],function(_0x54f34c){var _0x1ccfa0={};_0x1ccfa0[_0x54f34c]={'$like':'%'+_0x16f833[_0x9588('0x2d')]['filter']+'%'};return _0x1ccfa0;})});}_0x1a8c7c=_['merge']({},_0x1a8c7c,_0x16f833[_0x9588('0x3a')]);var _0x1dfeed={'where':_0x1a8c7c['where']};return db[_0x9588('0x2a')][_0x9588('0x1b')](_0x1dfeed)[_0x9588('0x20')](function(_0x1d5c38){_0x3815b1[_0x9588('0x1b')]=_0x1d5c38;if(_0x16f833[_0x9588('0x2d')][_0x9588('0x3b')]){_0x1a8c7c['include']=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x1a8c7c);})['then'](function(_0x15dcea){_0x3815b1[_0x9588('0x3c')]=_0x15dcea;return _0x3815b1;})[_0x9588('0x20')](respondWithFilteredResult(_0x28ec79,_0x1a8c7c))[_0x9588('0x3d')](handleError(_0x28ec79,null));})[_0x9588('0x3d')](handleError(_0x28ec79,null));};exports[_0x9588('0x3e')]=function(_0x22c529,_0x19285d){var _0x302cb6={'raw':![],'where':{'id':_0x22c529[_0x9588('0x3f')]['id']}},_0x4d40e9={};_0x4d40e9[_0x9588('0x2b')]=_[_0x9588('0x2c')](db['CmCompany']['rawAttributes']);_0x4d40e9[_0x9588('0x2d')]=_[_0x9588('0x2c')](_0x22c529['query']);_0x4d40e9['filters']=_['intersection'](_0x4d40e9[_0x9588('0x2b')],_0x4d40e9[_0x9588('0x2d')]);_0x302cb6[_0x9588('0x30')]=_[_0x9588('0x2e')](_0x4d40e9[_0x9588('0x2b')],qs[_0x9588('0x2f')](_0x22c529['query']['fields']));_0x302cb6['attributes']=_0x302cb6[_0x9588('0x30')][_0x9588('0x40')]?_0x302cb6[_0x9588('0x30')]:_0x4d40e9[_0x9588('0x2b')];if(_0x22c529[_0x9588('0x2d')][_0x9588('0x3b')]){_0x302cb6[_0x9588('0x41')]=[{'all':!![]}];}_0x302cb6=_[_0x9588('0x38')]({},_0x302cb6,_0x22c529[_0x9588('0x3a')]);return db[_0x9588('0x2a')][_0x9588('0x42')](_0x302cb6)[_0x9588('0x20')](handleEntityNotFound(_0x19285d,null))[_0x9588('0x20')](respondWithResult(_0x19285d,null))[_0x9588('0x3d')](handleError(_0x19285d,null));};exports[_0x9588('0x43')]=function(_0xda03fa,_0x99abeb){return db['CmCompany'][_0x9588('0x43')](_0xda03fa[_0x9588('0x44')],{})[_0x9588('0x20')](function(_0x1ae2ef){var _0x43bee7=_0xda03fa[_0x9588('0x45')][_0x9588('0x22')]({'plain':!![]});if(!_0x43bee7)throw new Error(_0x9588('0x46'));if(_0x43bee7['role']===_0x9588('0x45')){var _0x50441e=_0x1ae2ef[_0x9588('0x22')]({'plain':!![]});var _0x51ed6c='Companies';return db[_0x9588('0x47')][_0x9588('0x42')]({'where':{'name':_0x51ed6c,'userProfileId':_0x43bee7[_0x9588('0x48')]},'raw':!![]})[_0x9588('0x20')](function(_0x2ff92b){if(_0x2ff92b&&_0x2ff92b['autoAssociation']===0x0){return db[_0x9588('0x24')][_0x9588('0x43')]({'name':_0x50441e[_0x9588('0x27')],'resourceId':_0x50441e['id'],'type':_0x2ff92b[_0x9588('0x27')],'sectionId':_0x2ff92b['id']},{})[_0x9588('0x20')](function(){return _0x1ae2ef;});}else{return _0x1ae2ef;}})[_0x9588('0x3d')](function(_0x595375){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x595375);throw _0x595375;});}return _0x1ae2ef;})[_0x9588('0x20')](respondWithResult(_0x99abeb,0xc9))[_0x9588('0x3d')](handleError(_0x99abeb,null));};exports['update']=function(_0x8047b6,_0x5d568b){if(_0x8047b6[_0x9588('0x44')]['id']){delete _0x8047b6['body']['id'];}return db[_0x9588('0x2a')][_0x9588('0x42')]({'where':{'id':_0x8047b6[_0x9588('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5d568b,null))[_0x9588('0x20')](saveUpdates(_0x8047b6[_0x9588('0x44')],null))['then'](respondWithResult(_0x5d568b,null))[_0x9588('0x3d')](handleError(_0x5d568b,null));};exports[_0x9588('0x21')]=function(_0x49ce9c,_0x3e8e23){return db[_0x9588('0x2a')][_0x9588('0x42')]({'where':{'id':_0x49ce9c[_0x9588('0x3f')]['id']}})[_0x9588('0x20')](handleEntityNotFound(_0x3e8e23,null))['then'](removeEntity(_0x3e8e23,null))[_0x9588('0x3d')](handleError(_0x3e8e23,null));};exports[_0x9588('0x49')]=function(_0x50fdb5,_0x2102db){return db[_0x9588('0x2a')][_0x9588('0x49')]()[_0x9588('0x20')](respondWithResult(_0x2102db,null))[_0x9588('0x3d')](handleError(_0x2102db,null));};exports[_0x9588('0x4a')]=function(_0x47d542,_0x35c2f1,_0x49ec26){return db['CmContact'][_0x9588('0x42')]({'where':{'id':_0x47d542[_0x9588('0x3f')]['id']}})['then'](handleEntityNotFound(_0x35c2f1,null))[_0x9588('0x20')](function(_0x1abc80){if(_0x1abc80){return _0x1abc80[_0x9588('0x4a')](_0x47d542[_0x9588('0x44')][_0x9588('0x4b')],_[_0x9588('0x4c')](_0x47d542[_0x9588('0x44')],[_0x9588('0x4b'),'id'])||{});}})[_0x9588('0x20')](respondWithResult(_0x35c2f1,null))[_0x9588('0x3d')](handleError(_0x35c2f1,null));};exports[_0x9588('0x4d')]=function(_0x50173d,_0x5ee624,_0x19b626){var _0x208a6c={};var _0x5e8607={};var _0x3ed5e6;var _0x3c947d;return db[_0x9588('0x2a')][_0x9588('0x4e')]({'where':{'id':_0x50173d[_0x9588('0x3f')]['id']}})[_0x9588('0x20')](handleEntityNotFound(_0x5ee624,null))[_0x9588('0x20')](function(_0x23b10d){if(_0x23b10d){_0x3ed5e6=_0x23b10d;_0x5e8607[_0x9588('0x2b')]=_['keys'](db['CmContact']['rawAttributes']);_0x5e8607['query']=_['keys'](_0x50173d[_0x9588('0x2d')]);_0x5e8607[_0x9588('0x36')]=_[_0x9588('0x2e')](_0x5e8607['model'],_0x5e8607[_0x9588('0x2d')]);_0x208a6c['attributes']=_[_0x9588('0x2e')](_0x5e8607['model'],qs[_0x9588('0x2f')](_0x50173d[_0x9588('0x2d')][_0x9588('0x2f')]));_0x208a6c[_0x9588('0x30')]=_0x208a6c['attributes'][_0x9588('0x40')]?_0x208a6c[_0x9588('0x30')]:_0x5e8607[_0x9588('0x2b')];_0x208a6c[_0x9588('0x33')]=qs['sort'](_0x50173d['query']['sort']);_0x208a6c[_0x9588('0x35')]=qs['filters'](_[_0x9588('0x37')](_0x50173d[_0x9588('0x2d')],_0x5e8607[_0x9588('0x36')]));if(_0x50173d[_0x9588('0x2d')][_0x9588('0x4f')]){_0x208a6c[_0x9588('0x35')]=_['merge'](_0x208a6c[_0x9588('0x35')],{'$or':_[_0x9588('0x39')](_0x208a6c[_0x9588('0x30')],function(_0x183039){var _0x40b7d4={};_0x40b7d4[_0x183039]={'$like':'%'+_0x50173d[_0x9588('0x2d')][_0x9588('0x4f')]+'%'};return _0x40b7d4;})});}_0x208a6c=_['merge']({},_0x208a6c,_0x50173d['options']);return _0x3ed5e6[_0x9588('0x4d')](_0x208a6c);}})[_0x9588('0x20')](function(_0x8859ef){if(_0x8859ef){_0x3c947d=_0x8859ef[_0x9588('0x40')];if(!_0x50173d[_0x9588('0x2d')]['hasOwnProperty'](_0x9588('0x32'))){_0x208a6c[_0x9588('0x1a')]=qs[_0x9588('0x1a')](_0x50173d[_0x9588('0x2d')][_0x9588('0x1a')]);_0x208a6c['offset']=qs['offset'](_0x50173d['query'][_0x9588('0x18')]);}return _0x3ed5e6[_0x9588('0x4d')](_0x208a6c);}})[_0x9588('0x20')](function(_0x12e8c1){if(_0x12e8c1){return _0x12e8c1?{'count':_0x3c947d,'rows':_0x12e8c1}:null;}})[_0x9588('0x20')](respondWithResult(_0x5ee624,null))[_0x9588('0x3d')](handleError(_0x5ee624,null));}; \ No newline at end of file +var _0xda3c=['findAll','rows','catch','show','params','length','find','create','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addContacts','CmContact','ids','getContacts','findOne','rawAttributes','hasOwnProperty','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','reject','update','destroy','then','get','Companies','UserProfileResource','error','stack','name','send','keys','query','intersection','model','fields','attributes','order','sort','filters','pick','filter','where','merge','map','options','CmCompany','includeAll','include'];(function(_0x9f0eb6,_0x532f7f){var _0x396ba4=function(_0x49b05a){while(--_0x49b05a){_0x9f0eb6['push'](_0x9f0eb6['shift']());}};_0x396ba4(++_0x532f7f);}(_0xda3c,0x16e));var _0xcda3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xda3c[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xcda3('0x0'));var rimraf=require(_0xcda3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcda3('0x2'));var rp=require(_0xcda3('0x3'));var moment=require(_0xcda3('0x4'));var BPromise=require(_0xcda3('0x5'));var Mustache=require('mustache');var util=require(_0xcda3('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xcda3('0x7'));var ejs=require(_0xcda3('0x8'));var fs=require('fs');var fs_extra=require(_0xcda3('0x9'));var _=require(_0xcda3('0xa'));var squel=require(_0xcda3('0xb'));var crypto=require(_0xcda3('0xc'));var jsforce=require(_0xcda3('0xd'));var deskjs=require(_0xcda3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcda3('0xf'));var Papa=require(_0xcda3('0x10'));var Redis=require(_0xcda3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcda3('0x12'));var hardwareService=require(_0xcda3('0x13'));var logger=require(_0xcda3('0x14'))(_0xcda3('0x15'));var utils=require(_0xcda3('0x16'));var config=require(_0xcda3('0x17'));var licenseUtil=require(_0xcda3('0x18'));var db=require(_0xcda3('0x19'))['db'];function respondWithStatusCode(_0xc3543c,_0x39fbcf){_0x39fbcf=_0x39fbcf||0xcc;return function(_0x2c69c8){if(_0x2c69c8){return _0xc3543c[_0xcda3('0x1a')](_0x39fbcf);}return _0xc3543c['status'](_0x39fbcf)[_0xcda3('0x1b')]();};}function respondWithResult(_0x401189,_0x483526){_0x483526=_0x483526||0xc8;return function(_0x153d0d){if(_0x153d0d){return _0x401189['status'](_0x483526)[_0xcda3('0x1c')](_0x153d0d);}};}function respondWithFilteredResult(_0x2d515d,_0x8c0b53){return function(_0x59c433){if(_0x59c433){var _0x44932d=typeof _0x8c0b53[_0xcda3('0x1d')]===_0xcda3('0x1e')&&typeof _0x8c0b53[_0xcda3('0x1f')]===_0xcda3('0x1e');var _0x17e924=_0x59c433[_0xcda3('0x20')];var _0x32b119=_0x44932d?0x0:_0x8c0b53['offset'];var _0x216453=_0x44932d?_0x59c433['count']:_0x8c0b53[_0xcda3('0x1d')]+_0x8c0b53[_0xcda3('0x1f')];var _0x10ab68;if(_0x216453>=_0x17e924){_0x216453=_0x17e924;_0x10ab68=0xc8;}else{_0x10ab68=0xce;}_0x2d515d[_0xcda3('0x21')](_0x10ab68);return _0x2d515d[_0xcda3('0x22')]('Content-Range',_0x32b119+'-'+_0x216453+'/'+_0x17e924)['json'](_0x59c433);}return null;};}function patchUpdates(_0x301b59){return function(_0x59688e){try{jsonpatch['apply'](_0x59688e,_0x301b59,!![]);}catch(_0x277493){return BPromise[_0xcda3('0x23')](_0x277493);}return _0x59688e['save']();};}function saveUpdates(_0x15c153,_0x2614a1){return function(_0x150b6e){if(_0x150b6e){return _0x150b6e[_0xcda3('0x24')](_0x15c153)['then'](function(_0x16aedb){return _0x16aedb;});}return null;};}function removeEntity(_0x546b43,_0x4a64f4){return function(_0x50b8af){if(_0x50b8af){return _0x50b8af[_0xcda3('0x25')]()[_0xcda3('0x26')](function(){var _0x3093a4=_0x50b8af[_0xcda3('0x27')]({'plain':!![]});var _0x1da327=_0xcda3('0x28');return db[_0xcda3('0x29')][_0xcda3('0x25')]({'where':{'type':_0x1da327,'resourceId':_0x3093a4['id']}})[_0xcda3('0x26')](function(){return _0x50b8af;});})[_0xcda3('0x26')](function(){_0x546b43[_0xcda3('0x21')](0xcc)[_0xcda3('0x1b')]();});}};}function handleEntityNotFound(_0x55a34d,_0xd0ba71){return function(_0x414bf1){if(!_0x414bf1){_0x55a34d[_0xcda3('0x1a')](0x194);}return _0x414bf1;};}function handleError(_0x3a882d,_0x3fcf7f){_0x3fcf7f=_0x3fcf7f||0x1f4;return function(_0x45961a){logger[_0xcda3('0x2a')](_0x45961a[_0xcda3('0x2b')]);if(_0x45961a[_0xcda3('0x2c')]){delete _0x45961a[_0xcda3('0x2c')];}_0x3a882d[_0xcda3('0x21')](_0x3fcf7f)[_0xcda3('0x2d')](_0x45961a);};}exports['index']=function(_0x1dd310,_0x442d8a){var _0x18e32e={},_0x53601f={},_0x540866={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0xcda3('0x26')](function(_0x5e3745){_0x53601f['model']=_[_0xcda3('0x2e')](_0x5e3745);_0x53601f['query']=_[_0xcda3('0x2e')](_0x1dd310[_0xcda3('0x2f')]);_0x53601f['filters']=_[_0xcda3('0x30')](_0x53601f[_0xcda3('0x31')],_0x53601f[_0xcda3('0x2f')]);_0x18e32e['attributes']=_[_0xcda3('0x30')](_0x53601f[_0xcda3('0x31')],qs[_0xcda3('0x32')](_0x1dd310[_0xcda3('0x2f')][_0xcda3('0x32')]));_0x18e32e[_0xcda3('0x33')]=_0x18e32e[_0xcda3('0x33')]['length']?_0x18e32e[_0xcda3('0x33')]:_0x53601f[_0xcda3('0x31')];if(!_0x1dd310['query']['hasOwnProperty']('nolimit')){_0x18e32e[_0xcda3('0x1f')]=qs['limit'](_0x1dd310[_0xcda3('0x2f')][_0xcda3('0x1f')]);_0x18e32e[_0xcda3('0x1d')]=qs['offset'](_0x1dd310['query'][_0xcda3('0x1d')]);}_0x18e32e[_0xcda3('0x34')]=qs['sort'](_0x1dd310[_0xcda3('0x2f')][_0xcda3('0x35')]);_0x18e32e['where']=qs[_0xcda3('0x36')](_[_0xcda3('0x37')](_0x1dd310[_0xcda3('0x2f')],_0x53601f[_0xcda3('0x36')]),_0x5e3745);if(_0x1dd310[_0xcda3('0x2f')][_0xcda3('0x38')]){_0x18e32e[_0xcda3('0x39')]=_[_0xcda3('0x3a')](_0x18e32e[_0xcda3('0x39')],{'$or':_[_0xcda3('0x3b')](_0x18e32e['attributes'],function(_0x486f9e){var _0x26dcb6={};_0x26dcb6[_0x486f9e]={'$like':'%'+_0x1dd310[_0xcda3('0x2f')][_0xcda3('0x38')]+'%'};return _0x26dcb6;})});}_0x18e32e=_['merge']({},_0x18e32e,_0x1dd310[_0xcda3('0x3c')]);var _0x335d0f={'where':_0x18e32e['where']};return db[_0xcda3('0x3d')][_0xcda3('0x20')](_0x335d0f)[_0xcda3('0x26')](function(_0x2dcf45){_0x540866[_0xcda3('0x20')]=_0x2dcf45;if(_0x1dd310[_0xcda3('0x2f')][_0xcda3('0x3e')]){_0x18e32e[_0xcda3('0x3f')]=[{'all':!![]}];}return db[_0xcda3('0x3d')][_0xcda3('0x40')](_0x18e32e);})[_0xcda3('0x26')](function(_0x3eb4db){_0x540866[_0xcda3('0x41')]=_0x3eb4db;return _0x540866;})[_0xcda3('0x26')](respondWithFilteredResult(_0x442d8a,_0x18e32e))['catch'](handleError(_0x442d8a,null));})[_0xcda3('0x42')](handleError(_0x442d8a,null));};exports[_0xcda3('0x43')]=function(_0x586d92,_0x139166){var _0x198d9f={'raw':![],'where':{'id':_0x586d92[_0xcda3('0x44')]['id']}},_0x2a7822={};_0x2a7822[_0xcda3('0x31')]=_[_0xcda3('0x2e')](db['CmCompany']['rawAttributes']);_0x2a7822[_0xcda3('0x2f')]=_[_0xcda3('0x2e')](_0x586d92[_0xcda3('0x2f')]);_0x2a7822['filters']=_['intersection'](_0x2a7822[_0xcda3('0x31')],_0x2a7822[_0xcda3('0x2f')]);_0x198d9f['attributes']=_[_0xcda3('0x30')](_0x2a7822['model'],qs[_0xcda3('0x32')](_0x586d92[_0xcda3('0x2f')][_0xcda3('0x32')]));_0x198d9f[_0xcda3('0x33')]=_0x198d9f[_0xcda3('0x33')][_0xcda3('0x45')]?_0x198d9f[_0xcda3('0x33')]:_0x2a7822['model'];if(_0x586d92[_0xcda3('0x2f')][_0xcda3('0x3e')]){_0x198d9f[_0xcda3('0x3f')]=[{'all':!![]}];}_0x198d9f=_[_0xcda3('0x3a')]({},_0x198d9f,_0x586d92[_0xcda3('0x3c')]);return db[_0xcda3('0x3d')][_0xcda3('0x46')](_0x198d9f)[_0xcda3('0x26')](handleEntityNotFound(_0x139166,null))[_0xcda3('0x26')](respondWithResult(_0x139166,null))['catch'](handleError(_0x139166,null));};exports[_0xcda3('0x47')]=function(_0x5e0518,_0xbc26b){return db[_0xcda3('0x3d')][_0xcda3('0x47')](_0x5e0518['body'],{})['then'](function(_0x29c2f4){var _0x3a1ff4=_0x5e0518[_0xcda3('0x48')][_0xcda3('0x27')]({'plain':!![]});if(!_0x3a1ff4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a1ff4[_0xcda3('0x49')]==='user'){var _0x3cba44=_0x29c2f4[_0xcda3('0x27')]({'plain':!![]});var _0x146f13=_0xcda3('0x28');return db[_0xcda3('0x4a')]['find']({'where':{'name':_0x146f13,'userProfileId':_0x3a1ff4['userProfileId']},'raw':!![]})[_0xcda3('0x26')](function(_0x256d44){if(_0x256d44&&_0x256d44['autoAssociation']===0x0){return db['UserProfileResource'][_0xcda3('0x47')]({'name':_0x3cba44[_0xcda3('0x2c')],'resourceId':_0x3cba44['id'],'type':_0x256d44[_0xcda3('0x2c')],'sectionId':_0x256d44['id']},{})['then'](function(){return _0x29c2f4;});}else{return _0x29c2f4;}})[_0xcda3('0x42')](function(_0x4a0273){logger['error'](_0xcda3('0x4b'),_0x4a0273);throw _0x4a0273;});}return _0x29c2f4;})[_0xcda3('0x26')](respondWithResult(_0xbc26b,0xc9))[_0xcda3('0x42')](handleError(_0xbc26b,null));};exports[_0xcda3('0x24')]=function(_0xf46b9f,_0x5b0150){if(_0xf46b9f[_0xcda3('0x4c')]['id']){delete _0xf46b9f[_0xcda3('0x4c')]['id'];}return db[_0xcda3('0x3d')][_0xcda3('0x46')]({'where':{'id':_0xf46b9f[_0xcda3('0x44')]['id']}})[_0xcda3('0x26')](handleEntityNotFound(_0x5b0150,null))['then'](saveUpdates(_0xf46b9f[_0xcda3('0x4c')],null))[_0xcda3('0x26')](respondWithResult(_0x5b0150,null))[_0xcda3('0x42')](handleError(_0x5b0150,null));};exports['destroy']=function(_0x2e2dda,_0x24f8f3){return db[_0xcda3('0x3d')][_0xcda3('0x46')]({'where':{'id':_0x2e2dda[_0xcda3('0x44')]['id']}})['then'](handleEntityNotFound(_0x24f8f3,null))[_0xcda3('0x26')](removeEntity(_0x24f8f3,null))[_0xcda3('0x42')](handleError(_0x24f8f3,null));};exports[_0xcda3('0x4d')]=function(_0x4eb787,_0x128648){return db[_0xcda3('0x3d')]['describe']()[_0xcda3('0x26')](respondWithResult(_0x128648,null))[_0xcda3('0x42')](handleError(_0x128648,null));};exports[_0xcda3('0x4e')]=function(_0x32b757,_0x2abbc7,_0x3ba9cb){return db[_0xcda3('0x4f')][_0xcda3('0x46')]({'where':{'id':_0x32b757['params']['id']}})[_0xcda3('0x26')](handleEntityNotFound(_0x2abbc7,null))['then'](function(_0x5dc21e){if(_0x5dc21e){return _0x5dc21e[_0xcda3('0x4e')](_0x32b757[_0xcda3('0x4c')][_0xcda3('0x50')],_['omit'](_0x32b757['body'],[_0xcda3('0x50'),'id'])||{});}})['then'](respondWithResult(_0x2abbc7,null))[_0xcda3('0x42')](handleError(_0x2abbc7,null));};exports[_0xcda3('0x51')]=function(_0x4a2387,_0x1c98fc,_0x1258ab){var _0xde2069={};var _0x1147c9={};var _0x5a0ed7;var _0x4b1213;return db[_0xcda3('0x3d')][_0xcda3('0x52')]({'where':{'id':_0x4a2387['params']['id']}})[_0xcda3('0x26')](handleEntityNotFound(_0x1c98fc,null))[_0xcda3('0x26')](function(_0x31a9e9){if(_0x31a9e9){_0x5a0ed7=_0x31a9e9;_0x1147c9['model']=_[_0xcda3('0x2e')](db['CmContact'][_0xcda3('0x53')]);_0x1147c9[_0xcda3('0x2f')]=_[_0xcda3('0x2e')](_0x4a2387['query']);_0x1147c9[_0xcda3('0x36')]=_[_0xcda3('0x30')](_0x1147c9[_0xcda3('0x31')],_0x1147c9['query']);_0xde2069['attributes']=_['intersection'](_0x1147c9['model'],qs[_0xcda3('0x32')](_0x4a2387[_0xcda3('0x2f')][_0xcda3('0x32')]));_0xde2069[_0xcda3('0x33')]=_0xde2069[_0xcda3('0x33')][_0xcda3('0x45')]?_0xde2069[_0xcda3('0x33')]:_0x1147c9[_0xcda3('0x31')];_0xde2069['order']=qs[_0xcda3('0x35')](_0x4a2387['query'][_0xcda3('0x35')]);_0xde2069[_0xcda3('0x39')]=qs[_0xcda3('0x36')](_[_0xcda3('0x37')](_0x4a2387[_0xcda3('0x2f')],_0x1147c9[_0xcda3('0x36')]));if(_0x4a2387[_0xcda3('0x2f')][_0xcda3('0x38')]){_0xde2069[_0xcda3('0x39')]=_['merge'](_0xde2069['where'],{'$or':_['map'](_0xde2069[_0xcda3('0x33')],function(_0x4f04bf){var _0x3e1a19={};_0x3e1a19[_0x4f04bf]={'$like':'%'+_0x4a2387[_0xcda3('0x2f')][_0xcda3('0x38')]+'%'};return _0x3e1a19;})});}_0xde2069=_[_0xcda3('0x3a')]({},_0xde2069,_0x4a2387[_0xcda3('0x3c')]);return _0x5a0ed7[_0xcda3('0x51')](_0xde2069);}})[_0xcda3('0x26')](function(_0x4fda47){if(_0x4fda47){_0x4b1213=_0x4fda47[_0xcda3('0x45')];if(!_0x4a2387[_0xcda3('0x2f')][_0xcda3('0x54')](_0xcda3('0x55'))){_0xde2069[_0xcda3('0x1f')]=qs[_0xcda3('0x1f')](_0x4a2387['query'][_0xcda3('0x1f')]);_0xde2069['offset']=qs[_0xcda3('0x1d')](_0x4a2387[_0xcda3('0x2f')][_0xcda3('0x1d')]);}return _0x5a0ed7[_0xcda3('0x51')](_0xde2069);}})[_0xcda3('0x26')](function(_0x43b598){if(_0x43b598){return _0x43b598?{'count':_0x4b1213,'rows':_0x43b598}:null;}})['then'](respondWithResult(_0x1c98fc,null))[_0xcda3('0x42')](handleError(_0x1c98fc,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 67b8251..874f1d7 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 _0xd9cb=['rimraf','../../config/environment','exports','cm_companies','util','../../config/logger','api','request-promise','path'];(function(_0x2d9415,_0x1e3bfd){var _0x21c190=function(_0x164c1f){while(--_0x164c1f){_0x2d9415['push'](_0x2d9415['shift']());}};_0x21c190(++_0x1e3bfd);}(_0xd9cb,0x199));var _0xbd9c=function(_0x51fd2f,_0x187163){_0x51fd2f=_0x51fd2f-0x0;var _0x446e0e=_0xd9cb[_0x51fd2f];return _0x446e0e;};'use strict';var _=require('lodash');var util=require(_0xbd9c('0x0'));var logger=require(_0xbd9c('0x1'))(_0xbd9c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbd9c('0x3'));var fs=require('fs');var path=require(_0xbd9c('0x4'));var rimraf=require(_0xbd9c('0x5'));var config=require(_0xbd9c('0x6'));var attributes=require('./cmCompany.attributes');module[_0xbd9c('0x7')]=function(_0x485c1d,_0x3c517f){return _0x485c1d['define']('CmCompany',attributes,{'tableName':_0xbd9c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa01=['./cmCompany.attributes','exports','define','CmCompany','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x589cdf,_0x53f463){var _0x5f0774=function(_0x530589){while(--_0x530589){_0x589cdf['push'](_0x589cdf['shift']());}};_0x5f0774(++_0x53f463);}(_0xfa01,0xd0));var _0x1fa0=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfa01[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x1fa0('0x0'));var util=require(_0x1fa0('0x1'));var logger=require('../../config/logger')(_0x1fa0('0x2'));var moment=require(_0x1fa0('0x3'));var BPromise=require(_0x1fa0('0x4'));var rp=require(_0x1fa0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1fa0('0x6'));var config=require(_0x1fa0('0x7'));var attributes=require(_0x1fa0('0x8'));module[_0x1fa0('0x9')]=function(_0x4f5db1,_0xb336ec){return _0x4f5db1[_0x1fa0('0xa')](_0x1fa0('0xb'),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 5b02f1b..94b2bc2 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 _0xf36e=['debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x13cc5a,_0x3551d7){var _0x422826=function(_0x581f42){while(--_0x581f42){_0x13cc5a['push'](_0x13cc5a['shift']());}};_0x422826(++_0x3551d7);}(_0xf36e,0x148));var _0xef36=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf36e[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xef36('0x0'));var util=require(_0xef36('0x1'));var moment=require(_0xef36('0x2'));var BPromise=require(_0xef36('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef36('0x4'));var db=require(_0xef36('0x5'))['db'];var utils=require(_0xef36('0x6'));var logger=require(_0xef36('0x7'))(_0xef36('0x8'));var config=require(_0xef36('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xef36('0xa')][_0xef36('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f2e2e,_0x454f9a,_0x2b0064){return new BPromise(function(_0x504526,_0x1e1caf){return client[_0xef36('0xc')](_0x3f2e2e,_0x2b0064)[_0xef36('0xd')](function(_0x21acad){logger[_0xef36('0xe')](_0xef36('0xf'),_0x454f9a,_0xef36('0x10'));logger[_0xef36('0x11')](_0xef36('0x12'),_0x454f9a,'request\x20sent',JSON[_0xef36('0x13')](_0x21acad));if(_0x21acad[_0xef36('0x14')]){if(_0x21acad[_0xef36('0x14')][_0xef36('0x15')]===0x1f4){logger[_0xef36('0x14')](_0xef36('0xf'),_0x454f9a,_0x21acad[_0xef36('0x14')][_0xef36('0x16')]);return _0x1e1caf(_0x21acad[_0xef36('0x14')][_0xef36('0x16')]);}logger[_0xef36('0x14')](_0xef36('0xf'),_0x454f9a,_0x21acad['error']['message']);return _0x504526(_0x21acad['error'][_0xef36('0x16')]);}else{logger[_0xef36('0xe')](_0xef36('0xf'),_0x454f9a,_0xef36('0x10'));_0x504526(_0x21acad['result'][_0xef36('0x16')]);}})['catch'](function(_0x18a1a0){logger['error']('CmCompany,\x20%s,\x20%s',_0x454f9a,_0x18a1a0);_0x1e1caf(_0x18a1a0);});});} \ No newline at end of file +var _0xc57a=['../../config/utils','../../config/logger','rpc','client','http','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x50d8b2,_0x46f88d){var _0x2f9972=function(_0x4f728b){while(--_0x4f728b){_0x50d8b2['push'](_0x50d8b2['shift']());}};_0x2f9972(++_0x46f88d);}(_0xc57a,0x80));var _0xac57=function(_0x169ff3,_0x13fb48){_0x169ff3=_0x169ff3-0x0;var _0x4f8172=_0xc57a[_0x169ff3];return _0x4f8172;};'use strict';var _=require(_0xac57('0x0'));var util=require(_0xac57('0x1'));var moment=require(_0xac57('0x2'));var BPromise=require(_0xac57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac57('0x4'))['db'];var utils=require(_0xac57('0x5'));var logger=require(_0xac57('0x6'))(_0xac57('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xac57('0x8')][_0xac57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd3b366,_0x3a7107,_0x512213){return new BPromise(function(_0x3682b2,_0x327399){return client['request'](_0xd3b366,_0x512213)['then'](function(_0x27107b){logger[_0xac57('0xa')](_0xac57('0xb'),_0x3a7107,_0xac57('0xc'));logger[_0xac57('0xd')](_0xac57('0xe'),_0x3a7107,_0xac57('0xc'),JSON['stringify'](_0x27107b));if(_0x27107b['error']){if(_0x27107b[_0xac57('0xf')]['code']===0x1f4){logger['error'](_0xac57('0xb'),_0x3a7107,_0x27107b[_0xac57('0xf')][_0xac57('0x10')]);return _0x327399(_0x27107b['error'][_0xac57('0x10')]);}logger[_0xac57('0xf')]('CmCompany,\x20%s,\x20%s',_0x3a7107,_0x27107b['error'][_0xac57('0x10')]);return _0x3682b2(_0x27107b[_0xac57('0xf')][_0xac57('0x10')]);}else{logger[_0xac57('0xa')]('CmCompany,\x20%s,\x20%s',_0x3a7107,_0xac57('0xc'));_0x3682b2(_0x27107b[_0xac57('0x11')][_0xac57('0x10')]);}})[_0xac57('0x12')](function(_0x3fc9f6){logger['error'](_0xac57('0xb'),_0x3a7107,_0x3fc9f6);_0x327399(_0x3fc9f6);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index afc0149..d5e8c70 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 _0xc06a=['/:id/contacts','addContacts','put','/:id','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./cmCompany.controller','get','isAuthenticated','/describe','describe','show','getContacts','post'];(function(_0x336b34,_0x24fe0e){var _0x55ccdd=function(_0x41b462){while(--_0x41b462){_0x336b34['push'](_0x336b34['shift']());}};_0x55ccdd(++_0x24fe0e);}(_0xc06a,0x1be));var _0xac06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc06a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xac06('0x0'));var util=require(_0xac06('0x1'));var path=require('path');var timeout=require(_0xac06('0x2'));var express=require('express');var router=express[_0xac06('0x3')]();var fs_extra=require(_0xac06('0x4'));var auth=require(_0xac06('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xac06('0x6'));router[_0xac06('0x7')]('/',auth[_0xac06('0x8')](),controller['index']);router['get'](_0xac06('0x9'),auth['isAuthenticated'](),controller[_0xac06('0xa')]);router['get']('/:id',auth[_0xac06('0x8')](),controller[_0xac06('0xb')]);router[_0xac06('0x7')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xac06('0xc')]);router[_0xac06('0xd')]('/',auth[_0xac06('0x8')](),controller['create']);router[_0xac06('0xd')](_0xac06('0xe'),auth[_0xac06('0x8')](),controller[_0xac06('0xf')]);router[_0xac06('0x10')](_0xac06('0x11'),auth[_0xac06('0x8')](),controller['update']);router[_0xac06('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xac06('0x13')]);module['exports']=router; \ No newline at end of file +var _0x084d=['get','isAuthenticated','index','/describe','describe','/:id','getContacts','create','post','/:id/contacts','addContacts','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller'];(function(_0x22ee59,_0x57ecb7){var _0x283692=function(_0x179c53){while(--_0x179c53){_0x22ee59['push'](_0x22ee59['shift']());}};_0x283692(++_0x57ecb7);}(_0x084d,0x147));var _0xd084=function(_0x2f31c7,_0x426615){_0x2f31c7=_0x2f31c7-0x0;var _0x3c1bfb=_0x084d[_0x2f31c7];return _0x3c1bfb;};'use strict';var multer=require(_0xd084('0x0'));var util=require(_0xd084('0x1'));var path=require(_0xd084('0x2'));var timeout=require(_0xd084('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd084('0x4'));var auth=require(_0xd084('0x5'));var interaction=require(_0xd084('0x6'));var config=require(_0xd084('0x7'));var controller=require(_0xd084('0x8'));router[_0xd084('0x9')]('/',auth[_0xd084('0xa')](),controller[_0xd084('0xb')]);router[_0xd084('0x9')](_0xd084('0xc'),auth[_0xd084('0xa')](),controller[_0xd084('0xd')]);router['get'](_0xd084('0xe'),auth[_0xd084('0xa')](),controller['show']);router[_0xd084('0x9')]('/:id/contacts',auth[_0xd084('0xa')](),controller[_0xd084('0xf')]);router['post']('/',auth[_0xd084('0xa')](),controller[_0xd084('0x10')]);router[_0xd084('0x11')](_0xd084('0x12'),auth[_0xd084('0xa')](),controller[_0xd084('0x13')]);router['put'](_0xd084('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xd084('0xa')](),controller[_0xd084('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 1c2c778..b856a52 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 _0xd927=['INTEGER','UNSIGNED','DATE','NOW','sequelize','exports','STRING'];(function(_0x34febf,_0x291d12){var _0x806c16=function(_0x4a315d){while(--_0x4a315d){_0x34febf['push'](_0x34febf['shift']());}};_0x806c16(++_0x291d12);}(_0xd927,0x9e));var _0x7d92=function(_0x2b45c0,_0x44a4c5){_0x2b45c0=_0x2b45c0-0x0;var _0x45c367=_0xd927[_0x2b45c0];return _0x45c367;};'use strict';var _=require('lodash');var Sequelize=require(_0x7d92('0x0'));module[_0x7d92('0x1')]={'firstName':{'type':Sequelize[_0x7d92('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x7d92('0x2')]},'street':{'type':Sequelize[_0x7d92('0x2')]},'postalCode':{'type':Sequelize[_0x7d92('0x2')]},'city':{'type':Sequelize[_0x7d92('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x7d92('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x7d92('0x2')]},'mobile':{'type':Sequelize[_0x7d92('0x2')]},'fax':{'type':Sequelize[_0x7d92('0x2')]},'email':{'type':Sequelize[_0x7d92('0x2')]},'url':{'type':Sequelize[_0x7d92('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x7d92('0x2')]},'skype':{'type':Sequelize[_0x7d92('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x7d92('0x2')]},'wechat':{'type':Sequelize[_0x7d92('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x7d92('0x3')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x7d92('0x3')](0x2)[_0x7d92('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7d92('0x5')],'defaultValue':Sequelize[_0x7d92('0x6')]},'dialTimezone':{'type':Sequelize[_0x7d92('0x2')]},'utcOffset':{'type':Sequelize[_0x7d92('0x3')]}}; \ No newline at end of file +var _0x23fa=['TEXT','INTEGER','UNSIGNED','DATE','sequelize','STRING'];(function(_0x10503c,_0x2447e7){var _0x5a062f=function(_0x40b19a){while(--_0x40b19a){_0x10503c['push'](_0x10503c['shift']());}};_0x5a062f(++_0x2447e7);}(_0x23fa,0x1c6));var _0xa23f=function(_0x8687cf,_0x1ad97e){_0x8687cf=_0x8687cf-0x0;var _0xc6eb3=_0x23fa[_0x8687cf];return _0xc6eb3;};'use strict';var _=require('lodash');var Sequelize=require(_0xa23f('0x0'));module['exports']={'firstName':{'type':Sequelize[_0xa23f('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0xa23f('0x1')]},'street':{'type':Sequelize[_0xa23f('0x1')]},'postalCode':{'type':Sequelize[_0xa23f('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa23f('0x1')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa23f('0x2')]},'phone':{'type':Sequelize[_0xa23f('0x1')]},'mobile':{'type':Sequelize[_0xa23f('0x1')]},'fax':{'type':Sequelize[_0xa23f('0x1')]},'email':{'type':Sequelize[_0xa23f('0x1')]},'url':{'type':Sequelize[_0xa23f('0x1')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xa23f('0x1')]},'twitter':{'type':Sequelize[_0xa23f('0x1')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xa23f('0x1')]},'viber':{'type':Sequelize[_0xa23f('0x1')]},'line':{'type':Sequelize[_0xa23f('0x1')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xa23f('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xa23f('0x1')]},'priority':{'type':Sequelize[_0xa23f('0x3')](0x2)[_0xa23f('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa23f('0x5')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xa23f('0x1')]},'utcOffset':{'type':Sequelize[_0xa23f('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 4f33f98..fd10c38 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 _0xfba3=['limit','count','set','Content-Range','update','then','destroy','sendStatus','error','name','send','getOptions','findAll','user','catch','CmContact','find','params','describe','tags','keys','startsWith','displayName','query','analytics','CmCustomField','cf_','columnName','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','hasOwnProperty','merge','body','length','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','isNil','dialTimezone','timezones','bulkCreate','duplicates','where','push','ListId','findOrCreate','spread','additionalPhones','contact','all','show','Tag','Tags','color','tag','Phones','ContactItemType','sequelize','literal','omit','map','format','cf_%d','utcOffset','$and','pickBy','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','getTags','findOne','model','rawAttributes','filters','intersection','fields','attributes','order','sort','pick','filter','nolimit','setTags','ids','setAdditionalPhones','items','item_types','ItemTypeId','description','OrderBy','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','ItemType','CmHopperId','item','ItemType.OrderBy','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','options','includeAll','include','rows','getHopperHistories','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','filename','0777','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','createReadStream','meta','import','User','agent','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','getJourney','chat','sms','openchannel','fax','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','parse','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','endtime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','DESC','findAndCountAll','get','fullname','Website','closed','closedAt','note','disposition','secondDisposition','UserId','Account','key','Owner','browserName','customerIp','deviceModel','ratingMessage','ratingType','ratingValue','referer','mail','subject','substatus','externalUrl','Interaction','flatten','reverse','slice','moment','bluebird','util','lodash','ioredis','../../components/contacts','../../components/parsers/qs','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register','status','json','offset','undefined'];(function(_0x1b58d4,_0x25a510){var _0x5252d0=function(_0x4d7dfc){while(--_0x4d7dfc){_0x1b58d4['push'](_0x1b58d4['shift']());}};_0x5252d0(++_0x25a510);}(_0xfba3,0xf1));var _0x3fba=function(_0x2720bd,_0x1e50f0){_0x2720bd=_0x2720bd-0x0;var _0x2aaf1a=_0xfba3[_0x2720bd];return _0x2aaf1a;};'use strict';var moment=require(_0x3fba('0x0'));var BPromise=require(_0x3fba('0x1'));var util=require(_0x3fba('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x3fba('0x3'));var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x3fba('0x4'));var contacts=require(_0x3fba('0x5'));var qs=require(_0x3fba('0x6'));var logger=require('../../config/logger')(_0x3fba('0x7'));var config=require(_0x3fba('0x8'));var shared=require(_0x3fba('0x9'));var db=require(_0x3fba('0xa'))['db'];config[_0x3fba('0xb')]=_[_0x3fba('0xc')](config[_0x3fba('0xb')],{'host':_0x3fba('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3fba('0xb')]));require(_0x3fba('0xe'))[_0x3fba('0xf')](socket);function respondWithResult(_0x45ddb8,_0x5499c0){_0x5499c0=_0x5499c0||0xc8;return function(_0x58a03b){if(_0x58a03b){return _0x45ddb8[_0x3fba('0x10')](_0x5499c0)[_0x3fba('0x11')](_0x58a03b);}};}function respondWithFilteredResult(_0x527032,_0x372b61){return function(_0x19f1dc){if(_0x19f1dc){var _0x5d6bcd=typeof _0x372b61[_0x3fba('0x12')]===_0x3fba('0x13')&&typeof _0x372b61[_0x3fba('0x14')]===_0x3fba('0x13');var _0x18c150=_0x19f1dc[_0x3fba('0x15')];var _0x53ef83=_0x5d6bcd?0x0:_0x372b61['offset'];var _0x354a6f=_0x5d6bcd?_0x19f1dc[_0x3fba('0x15')]:_0x372b61['offset']+_0x372b61[_0x3fba('0x14')];var _0x5e5bd0;if(_0x354a6f>=_0x18c150){_0x354a6f=_0x18c150;_0x5e5bd0=0xc8;}else{_0x5e5bd0=0xce;}_0x527032[_0x3fba('0x10')](_0x5e5bd0);return _0x527032[_0x3fba('0x16')](_0x3fba('0x17'),_0x53ef83+'-'+_0x354a6f+'/'+_0x18c150)[_0x3fba('0x11')](_0x19f1dc);}return null;};}function saveUpdates(_0x5378a0){return function(_0x4a9026){if(_0x4a9026){return _0x4a9026[_0x3fba('0x18')](_0x5378a0)[_0x3fba('0x19')](function(_0x558392){return _0x558392;});}return null;};}function removeEntity(_0x558e9f){return function(_0x101384){if(_0x101384){return _0x101384[_0x3fba('0x1a')]()[_0x3fba('0x19')](function(){_0x558e9f[_0x3fba('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59a1be){return function(_0x50933d){if(!_0x50933d){_0x59a1be[_0x3fba('0x1b')](0x194);}return _0x50933d;};}function handleError(_0x2ac5b3,_0x1115b4){_0x1115b4=_0x1115b4||0x1f4;return function(_0x4ba762){logger[_0x3fba('0x1c')](_0x4ba762['stack']);if(_0x4ba762[_0x3fba('0x1d')]){delete _0x4ba762[_0x3fba('0x1d')];}_0x2ac5b3[_0x3fba('0x10')](_0x1115b4)[_0x3fba('0x1e')](_0x4ba762);};}exports['index']=function(_0x523e43,_0x49d0a4){var _0x5ccbfc={};return contacts['describe']()[_0x3fba('0x19')](function(_0x1de405){_0x5ccbfc=qs[_0x3fba('0x1f')](_0x1de405,_0x523e43);return contacts[_0x3fba('0x20')](_0x523e43['query'],_0x523e43[_0x3fba('0x21')],_0x5ccbfc,_0x1de405);})[_0x3fba('0x19')](respondWithFilteredResult(_0x49d0a4,_0x5ccbfc))[_0x3fba('0x22')](handleError(_0x49d0a4,null));};exports[_0x3fba('0x1a')]=function(_0x5a398b,_0x5d74ed){return db[_0x3fba('0x23')][_0x3fba('0x24')]({'where':{'id':_0x5a398b[_0x3fba('0x25')]['id']}})[_0x3fba('0x19')](handleEntityNotFound(_0x5d74ed,null))[_0x3fba('0x19')](removeEntity(_0x5d74ed,null))[_0x3fba('0x22')](handleError(_0x5d74ed,null));};exports[_0x3fba('0x26')]=function(_0x570507,_0x2f7b45){return db[_0x3fba('0x23')][_0x3fba('0x26')]()[_0x3fba('0x19')](function(_0x3a2e37){delete _0x3a2e37[_0x3fba('0x27')];for(var _0x229b7f=0x0;_0x229b7f0x0){return new Promise(function(_0x4aaa00){var _0x1be8b2=[];for(var _0x4c0ceb=0x0;_0x4c0ceb<_0x2f7e78['length'];_0x4c0ceb++){_0x1be8b2[_0x3fba('0x5d')](insertAdditionalPhones(_0x2f7e78[_0x4c0ceb][_0x3fba('0x62')],_0x2f7e78[_0x4c0ceb][_0x3fba('0x61')]));}Promise[_0x3fba('0x63')](_0x1be8b2)[_0x3fba('0x19')](function(){_0x4aaa00(0x1);});})[_0x3fba('0x19')](function(){return{'success':_0x286f43,'failure':_0x17cbee,'duplicates':_0x1a8f6f};});}else{return{'success':_0x286f43,'failure':_0x17cbee,'duplicates':_0x1a8f6f};}}})['then'](respondWithResult(_0x370cef,0xc9))[_0x3fba('0x22')](handleError(_0x370cef,null));};exports[_0x3fba('0x64')]=function(_0xcc7b0d,_0x2a140b){var _0x55d343;return db[_0x3fba('0x23')][_0x3fba('0x26')]()['then'](function(_0x2288cc){return db['CmContact'][_0x3fba('0x24')]({'where':{'id':_0xcc7b0d[_0x3fba('0x25')]['id']},'include':[{'model':db[_0x3fba('0x65')],'as':_0x3fba('0x66'),'attributes':['id',_0x3fba('0x1d'),_0x3fba('0x67')],'required':_0xcc7b0d[_0x3fba('0x2b')][_0x3fba('0x68')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x3fba('0x69'),'where':{'CmContactId':_0xcc7b0d[_0x3fba('0x25')]['id']},'required':![],'include':[{'model':db[_0x3fba('0x6a')],'as':'ItemType'}]}],'order':[db[_0x3fba('0x6b')][_0x3fba('0x6c')]('Phones.OrderBy')],'attributes':_['keys'](_0x2288cc)});})[_0x3fba('0x19')](function(_0x42cf6d){if(!_[_0x3fba('0x57')](_0x42cf6d)){_0x55d343=_0x42cf6d['get']({'plain':!![]});var _0x9c384e={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x42cf6d&&_0x42cf6d[_0x3fba('0x5e')]){if(_0x42cf6d[_0x3fba('0x5e')]){_0x9c384e['where']['$and'][_0x3fba('0x5d')]({'ListId':{'$ne':_0x42cf6d[_0x3fba('0x5e')]}});}}return db['CmCustomField']['findAll'](_0x9c384e);}})['then'](function(_0x29b233){if(!_[_0x3fba('0x57')](_0x29b233)){return _[_0x3fba('0x6d')](_0x55d343,_[_0x3fba('0x6e')](_0x29b233,function(_0x337424){return util[_0x3fba('0x6f')](_0x3fba('0x70'),_0x337424['id']);}));}})['then'](handleEntityNotFound(_0x2a140b,null))[_0x3fba('0x19')](respondWithResult(_0x2a140b,null))[_0x3fba('0x22')](handleError(_0x2a140b,null));};exports['update']=function(_0xcd206a,_0x46b818){var _0x311b10;if(_0xcd206a[_0x3fba('0x38')]['id']){delete _0xcd206a[_0x3fba('0x38')]['id'];}if(!_[_0x3fba('0x57')](_0xcd206a[_0x3fba('0x38')]['dialTimezone'])){var _0x11bbe0=_0xcd206a['body'][_0x3fba('0x58')];if(!_[_0x3fba('0x57')](shared[_0x3fba('0x59')][_0x11bbe0]))_0xcd206a[_0x3fba('0x38')][_0x3fba('0x71')]=shared[_0x3fba('0x59')][_0x11bbe0][_0x3fba('0x71')];}return db[_0x3fba('0x23')][_0x3fba('0x24')]({'where':{'id':_0xcd206a[_0x3fba('0x25')]['id']}})[_0x3fba('0x19')](handleEntityNotFound(_0x46b818,null))[_0x3fba('0x19')](saveUpdates(_0xcd206a[_0x3fba('0x38')],null))[_0x3fba('0x19')](function(_0x2f8d1e){_0x311b10=_0x2f8d1e;var _0x45e414={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2f8d1e&&_0x2f8d1e[_0x3fba('0x5e')]){if(_0x2f8d1e[_0x3fba('0x5e')]){_0x45e414[_0x3fba('0x5c')][_0x3fba('0x72')][_0x3fba('0x5d')]({'ListId':{'$ne':_0x2f8d1e[_0x3fba('0x5e')]}});}}return db[_0x3fba('0x2d')][_0x3fba('0x20')](_0x45e414);})[_0x3fba('0x19')](function(_0x3e6d90){if(_0x3e6d90){return _[_0x3fba('0x6d')](_[_0x3fba('0x73')](_0xcd206a[_0x3fba('0x38')],function(_0x2d51c8,_0x498ab5){return _[_0x3fba('0x29')](_0x498ab5,_0x3fba('0x2e'));}),_[_0x3fba('0x6e')](_0x3e6d90,function(_0x2da8a6){return util[_0x3fba('0x6f')](_0x3fba('0x70'),_0x2da8a6['id']);}));}})[_0x3fba('0x19')](function(_0x3ec90c){if(_0x3ec90c&&!_[_0x3fba('0x74')](_0x3ec90c)){var _0x33d14f=squel['update']()[_0x3fba('0x75')](_0x3fba('0x76'))[_0x3fba('0x77')](_0x3ec90c)[_0x3fba('0x5c')](_0x3fba('0x78'),_0xcd206a[_0x3fba('0x25')]['id'])[_0x3fba('0x79')]();return db[_0x3fba('0x6b')][_0x3fba('0x2b')](_0x33d14f[_0x3fba('0x7a')],{'replacements':_0x33d14f[_0x3fba('0x33')]});}})[_0x3fba('0x19')](function(){if(_0xcd206a[_0x3fba('0x38')][_0x3fba('0x7b')]&&_0x311b10){return db['CmHopper'][_0x3fba('0x18')]({'phone':_0xcd206a[_0x3fba('0x38')]['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x311b10['id']}});}})[_0x3fba('0x19')](function(){return _0x311b10;})['then'](respondWithResult(_0x46b818,null))[_0x3fba('0x22')](handleError(_0x46b818,null));};exports[_0x3fba('0x7c')]=function(_0x354045,_0x2d8593){var _0x2d3ec2={};var _0x454f16={};var _0x228e56;var _0x2439fb;return db[_0x3fba('0x23')][_0x3fba('0x7d')]({'where':{'id':_0x354045['params']['id']}})[_0x3fba('0x19')](handleEntityNotFound(_0x2d8593,null))['then'](function(_0xd7994){if(_0xd7994){_0x228e56=_0xd7994;_0x454f16[_0x3fba('0x7e')]=_['keys'](db[_0x3fba('0x65')][_0x3fba('0x7f')]);_0x454f16[_0x3fba('0x2b')]=_['keys'](_0x354045[_0x3fba('0x2b')]);_0x454f16[_0x3fba('0x80')]=_['intersection'](_0x454f16[_0x3fba('0x7e')],_0x454f16[_0x3fba('0x2b')]);_0x2d3ec2['attributes']=_[_0x3fba('0x81')](_0x454f16['model'],qs[_0x3fba('0x82')](_0x354045['query'][_0x3fba('0x82')]));_0x2d3ec2[_0x3fba('0x83')]=_0x2d3ec2[_0x3fba('0x83')][_0x3fba('0x39')]?_0x2d3ec2[_0x3fba('0x83')]:_0x454f16[_0x3fba('0x7e')];_0x2d3ec2[_0x3fba('0x84')]=qs[_0x3fba('0x85')](_0x354045[_0x3fba('0x2b')][_0x3fba('0x85')]);_0x2d3ec2['where']=qs[_0x3fba('0x80')](_[_0x3fba('0x86')](_0x354045['query'],_0x454f16['filters']));if(_0x354045[_0x3fba('0x2b')][_0x3fba('0x87')]){_0x2d3ec2[_0x3fba('0x5c')]=_['merge'](_0x2d3ec2['where'],{'$or':_['map'](_0x2d3ec2[_0x3fba('0x83')],function(_0x31541c){var _0x496180={};_0x496180[_0x31541c]={'$like':'%'+_0x354045[_0x3fba('0x2b')][_0x3fba('0x87')]+'%'};return _0x496180;})});}_0x2d3ec2=_[_0x3fba('0x37')]({},_0x2d3ec2,_0x354045['options']);return _0x228e56[_0x3fba('0x7c')](_0x2d3ec2);}})[_0x3fba('0x19')](function(_0xf337fc){if(_0xf337fc){_0x2439fb=_0xf337fc[_0x3fba('0x39')];if(!_0x354045[_0x3fba('0x2b')][_0x3fba('0x36')](_0x3fba('0x88'))){_0x2d3ec2[_0x3fba('0x14')]=qs[_0x3fba('0x14')](_0x354045[_0x3fba('0x2b')]['limit']);_0x2d3ec2['offset']=qs[_0x3fba('0x12')](_0x354045[_0x3fba('0x2b')]['offset']);}return _0x228e56[_0x3fba('0x7c')](_0x2d3ec2);}})[_0x3fba('0x19')](function(_0x54632d){if(_0x54632d){return _0x54632d?{'count':_0x2439fb,'rows':_0x54632d}:null;}})[_0x3fba('0x19')](respondWithResult(_0x2d8593,null))[_0x3fba('0x22')](handleError(_0x2d8593,null));};exports[_0x3fba('0x89')]=function(_0x3e5321,_0x5eda1e){if(_0x3e5321['body']['id']){delete _0x3e5321[_0x3fba('0x38')]['id'];}return db[_0x3fba('0x23')][_0x3fba('0x7d')]({'where':{'id':_0x3e5321[_0x3fba('0x25')]['id']}})[_0x3fba('0x19')](handleEntityNotFound(_0x5eda1e,null))[_0x3fba('0x19')](function(_0x1723a5){if(_0x1723a5){return _0x1723a5['setTags'](_0x3e5321[_0x3fba('0x38')][_0x3fba('0x8a')]||[]);}return null;})[_0x3fba('0x19')](respondWithResult(_0x5eda1e,null))[_0x3fba('0x22')](handleError(_0x5eda1e,null));};exports[_0x3fba('0x8b')]=function(_0x8f81ea,_0x3aa924){var _0x3d7678=[];_0x3d7678[_0x3fba('0x5d')](addAdditionalPhones(_0x8f81ea[_0x3fba('0x38')]));Promise['all'](_0x3d7678)[_0x3fba('0x19')](function(){_0x3d7678=[];_0x3d7678['push'](deleteCmHopperPhones(_0x8f81ea['body']['id']));_0x3d7678[_0x3fba('0x5d')](addCmHopperPhones(_0x8f81ea[_0x3fba('0x38')]['id']));Promise[_0x3fba('0x63')](_0x3d7678)[_0x3fba('0x19')](function(){return[0x1];})['then'](respondWithResult(_0x3aa924,null));});};function addAdditionalPhones(_0x595a6e){var _0x1764d5;return new Promise(function(_0x525bd4){return db[_0x3fba('0x4c')]['destroy']({'where':{'CmContactId':_0x595a6e['id']}})[_0x3fba('0x19')](function(){db[_0x3fba('0x6a')]['findAll']({'raw':!![],'attributes':['id','OrderBy']})['then'](function(_0x4d8074){var _0x359752=[];for(var _0x208fad=0x0;_0x208fad<_0x595a6e[_0x3fba('0x8c')][_0x3fba('0x39')];_0x208fad++){var _0x1b66fa=_0x595a6e[_0x3fba('0x8d')]?_['isNil'](_0x595a6e[_0x3fba('0x8d')][_0x208fad])?'':_0x595a6e['item_types'][_0x208fad]:_0x595a6e[_0x3fba('0x8c')][_0x208fad][_0x3fba('0x8e')]?_0x595a6e['items'][_0x208fad][_0x3fba('0x8e')]:'';var _0x2dbd52=_[_0x3fba('0x57')](_0x595a6e['items'][_0x208fad]['description'])?'':_0x595a6e[_0x3fba('0x8c')][_0x208fad][_0x3fba('0x8f')];var _0x11047a=_0x1b66fa+':'+_0x595a6e['items'][_0x208fad][_0x3fba('0x7b')]+'§'+_0x2dbd52;if(_[_0x3fba('0x57')](_0x1764d5))_0x1764d5=_0x11047a;else _0x1764d5+=';'+_0x11047a;var _0x2ea35c=null;var _0x37bc78=null;if(_0x595a6e[_0x3fba('0x8d')]){if(!_[_0x3fba('0x57')](_0x595a6e['item_types'][_0x208fad])){_0x37bc78=_[_0x3fba('0x24')](_0x4d8074,function(_0x334ed1){return _0x334ed1['id']===_0x595a6e[_0x3fba('0x8d')][_0x208fad];});if(!_[_0x3fba('0x57')](_0x37bc78)){_0x2ea35c=_0x37bc78[_0x3fba('0x90')];}}}else{if(!_[_0x3fba('0x57')](_0x595a6e[_0x3fba('0x8c')][_0x208fad])){_0x37bc78=_[_0x3fba('0x24')](_0x4d8074,function(_0x3d628a){return _0x3d628a['id']===_0x595a6e['items'][_0x208fad][_0x3fba('0x8e')];});if(!_['isNil'](_0x37bc78)){_0x2ea35c=_0x208fad;}}}if(_[_0x3fba('0x57')](_0x2ea35c)){_0x2ea35c=0x64;}_0x359752[_0x3fba('0x5d')](addAdditionalPhone(_0x595a6e['id'],_0x595a6e[_0x3fba('0x8c')][_0x208fad][_0x3fba('0x7b')],_0x595a6e[_0x3fba('0x8d')]?_[_0x3fba('0x57')](_0x595a6e[_0x3fba('0x8d')][_0x208fad])?null:_0x595a6e[_0x3fba('0x8d')][_0x208fad]:_0x595a6e[_0x3fba('0x8c')][_0x208fad][_0x3fba('0x8e')]?_0x595a6e[_0x3fba('0x8c')][_0x208fad][_0x3fba('0x8e')]:null,_0x2ea35c,_0x2dbd52));}Promise['all'](_0x359752)[_0x3fba('0x19')](function(){db[_0x3fba('0x23')]['update']({'AdditionalPhones':_0x1764d5},{'where':{'id':_0x595a6e['id']}})[_0x3fba('0x19')](function(){_0x525bd4(0x1);});});});});});}function addAdditionalPhone(_0x498e33,_0x4b132a,_0x24c0e4,_0x47d457,_0x1c09de){return db[_0x3fba('0x4c')][_0x3fba('0x24')]({'where':{'CmContactId':_0x498e33,'item':_0x4b132a}})['then'](function(_0x5ce515){if(_0x5ce515)logger[_0x3fba('0x34')](_0x3fba('0x91'),_0x5ce515);else{db[_0x3fba('0x4c')][_0x3fba('0x41')]({'CmContactId':_0x498e33,'item':_0x4b132a,'ItemTypeId':_0x24c0e4,'OrderBy':_0x47d457,'ItemClass':_0x3fba('0x92'),'description':_0x1c09de});}});}function deleteCmHopperPhones(_0x1c8dda){return new Promise(function(_0x259157){return db[_0x3fba('0x3e')][_0x3fba('0x20')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1c8dda}})[_0x3fba('0x19')](function(_0x343562){db[_0x3fba('0x93')][_0x3fba('0x1a')]({'where':{'CmHopperId':{'$in':_[_0x3fba('0x6e')](_0x343562,'id')}}});})[_0x3fba('0x19')](function(){_0x259157(0x1);});});}function addCmHopperPhones(_0x16c172){return new Promise(function(_0x39df93){return db[_0x3fba('0x3e')][_0x3fba('0x20')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x16c172}})[_0x3fba('0x19')](function(_0x48ef1a){var _0x2445e5=[];_[_0x3fba('0x6e')](_0x48ef1a,function(_0x3d9c9f){_0x2445e5[_0x3fba('0x5d')](createCmHopperPhone(_0x16c172,_0x3d9c9f['id']));});Promise['all'](_0x2445e5)[_0x3fba('0x19')](function(){_0x39df93(0x1);});});});}function createCmHopperPhone(_0x3c23a3,_0x3e7801){return new Promise(function(_0x30f513){db[_0x3fba('0x4c')][_0x3fba('0x20')]({'raw':!![],'attributes':['item',_0x3fba('0x90')],'where':{'CmContactId':_0x3c23a3,'ItemClass':_0x3fba('0x92')},'include':[{'model':db[_0x3fba('0x6a')],'attributes':[_0x3fba('0x90')],'as':_0x3fba('0x94')}],'order':[_0x3fba('0x90'),db[_0x3fba('0x6b')]['literal']('`ItemType`.OrderBy')]})[_0x3fba('0x19')](function(_0x155100){var _0x5ba766=0x1;var _0x15db04=_[_0x3fba('0x6e')](_0x155100,function(_0x58a896){_0x58a896[_0x3fba('0x95')]=_0x3e7801;_0x58a896[_0x3fba('0x7b')]=_0x58a896[_0x3fba('0x96')];_0x58a896[_0x3fba('0x90')]=_0x5ba766;delete _0x58a896[_0x3fba('0x97')];_0x5ba766=_0x5ba766+0x1;return _0x58a896;});return db[_0x3fba('0x93')][_0x3fba('0x5a')](_0x15db04,{});})['then'](function(){_0x30f513(0x1);});});}function insertAdditionalPhones(_0x534c49,_0x36815c){return new Promise(function(_0x2e662b){var _0x348c13=[];for(var _0x3d728f=0x0;_0x3d728f<_0x36815c[_0x3fba('0x39')];_0x3d728f++){var _0x4d3d81=_0x36815c[_0x3d728f];_0x348c13['push'](parseContactItemType(_0x4d3d81));}Promise['all'](_0x348c13)[_0x3fba('0x19')](function(){var _0xc54995={'id':_0x534c49['id'],'items':_0x36815c};return addAdditionalPhones(_0xc54995)[_0x3fba('0x19')](function(){return addCmHopperPhones(_0x534c49['id']);});})['then'](function(){_0x2e662b(_0x534c49);});});}function parseContactItemType(_0x2bc8b6){return new Promise(function(_0x7140e3){if(_0x2bc8b6[_0x3fba('0x36')](_0x3fba('0x8e'))){_0x7140e3(_0x2bc8b6);}else{return db[_0x3fba('0x6a')]['find']({'where':{'name':_0x2bc8b6[_0x3fba('0x94')]}})[_0x3fba('0x19')](function(_0x526e22){if(_[_0x3fba('0x57')](_0x526e22))_0x2bc8b6['ItemTypeId']=null;else _0x2bc8b6['ItemTypeId']=_0x526e22['id'];_0x7140e3(_0x2bc8b6);});}});}exports['getAdditionalPhones']=function(_0x144efa,_0xc78555){return db[_0x3fba('0x4c')]['findAll']({'raw':!![],'where':{'CmContactId':_0x144efa[_0x3fba('0x25')]['id'],'ItemClass':_0x3fba('0x92')},'include':[{'model':db[_0x3fba('0x6a')],'as':_0x3fba('0x94')}],'order':[[_0x3fba('0x90')],[db['sequelize'][_0x3fba('0x6c')](_0x3fba('0x98'))]]})[_0x3fba('0x19')](function(_0x537658){return _0x537658;})['then'](respondWithResult(_0xc78555,null))['catch'](handleError(_0xc78555,null));};exports[_0x3fba('0x99')]=function(_0xdcc720,_0x2377ac){return db[_0x3fba('0x4c')][_0x3fba('0x20')]({'raw':!![],'where':{'CmContactId':_0xdcc720[_0x3fba('0x38')][_0x3fba('0x9a')]}})[_0x3fba('0x19')](function(_0x26b4b1){var _0x971fc5=_['map'](_0x26b4b1,function(_0x4928c8){_0x4928c8[_0x3fba('0x9b')]=_0xdcc720[_0x3fba('0x38')][_0x3fba('0x9c')];return _0x4928c8;});return db[_0x3fba('0x4c')][_0x3fba('0x5a')](_0x971fc5,{});})[_0x3fba('0x19')](function(){return addCmHopperPhones(_0xdcc720[_0x3fba('0x38')][_0x3fba('0x9c')]);})[_0x3fba('0x19')](function(){return['ok'];})[_0x3fba('0x19')](respondWithResult(_0x2377ac,null))['catch'](handleError(_0x2377ac,null));};exports[_0x3fba('0x9d')]=function(_0x17c613,_0xfcfdd6){var _0x411cf0=[];_0x411cf0[_0x3fba('0x5d')](createCmHopperPhone(_0x17c613['body']['id'],_0x17c613['body'][_0x3fba('0x9e')]));Promise[_0x3fba('0x63')](_0x411cf0)[_0x3fba('0x19')](function(){return[0x1];})[_0x3fba('0x19')](respondWithResult(_0xfcfdd6,null));};exports[_0x3fba('0x9f')]=function(_0x6031cd,_0x468fd9){var _0x4f4dd0={'raw':![],'where':{}};var _0x2538a2={};var _0x17fd99={'count':0x0,'rows':[]};return db[_0x3fba('0x23')]['findOne']({'where':{'id':_0x6031cd[_0x3fba('0x25')]['id']}})[_0x3fba('0x19')](handleEntityNotFound(_0x468fd9,null))[_0x3fba('0x19')](function(_0xc03c49){if(_0xc03c49){_0x2538a2[_0x3fba('0x7e')]=_[_0x3fba('0x28')](db[_0x3fba('0x3e')][_0x3fba('0x7f')]);_0x2538a2[_0x3fba('0x2b')]=_[_0x3fba('0x28')](_0x6031cd[_0x3fba('0x2b')]);_0x2538a2['filters']=_[_0x3fba('0x81')](_0x2538a2[_0x3fba('0x7e')],_0x2538a2[_0x3fba('0x2b')]);_0x4f4dd0[_0x3fba('0x83')]=_[_0x3fba('0x81')](_0x2538a2[_0x3fba('0x7e')],qs[_0x3fba('0x82')](_0x6031cd[_0x3fba('0x2b')][_0x3fba('0x82')]));_0x4f4dd0['attributes']=_0x4f4dd0[_0x3fba('0x83')]['length']?_0x4f4dd0[_0x3fba('0x83')]:_0x2538a2[_0x3fba('0x7e')];if(!_0x6031cd[_0x3fba('0x2b')][_0x3fba('0x36')](_0x3fba('0x88'))){_0x4f4dd0['limit']=qs[_0x3fba('0x14')](_0x6031cd[_0x3fba('0x2b')]['limit']);_0x4f4dd0[_0x3fba('0x12')]=qs[_0x3fba('0x12')](_0x6031cd['query'][_0x3fba('0x12')]);}_0x4f4dd0[_0x3fba('0x84')]=qs['sort'](_0x6031cd['query'][_0x3fba('0x85')]);_0x4f4dd0[_0x3fba('0x5c')]=qs[_0x3fba('0x80')](_[_0x3fba('0x86')](_0x6031cd[_0x3fba('0x2b')],_0x2538a2[_0x3fba('0x80')]));_0x4f4dd0[_0x3fba('0x5c')][_0x3fba('0xa0')]=_0xc03c49['id'];if(_0x6031cd[_0x3fba('0x2b')][_0x3fba('0x87')]){_0x4f4dd0[_0x3fba('0x5c')]=_[_0x3fba('0x37')](_0x4f4dd0['where'],{'$or':_[_0x3fba('0x6e')](_0x4f4dd0[_0x3fba('0x83')],function(_0x12820a){var _0x240bdf={};_0x240bdf[_0x12820a]={'$like':'%'+_0x6031cd[_0x3fba('0x2b')][_0x3fba('0x87')]+'%'};return _0x240bdf;})});}_0x4f4dd0=_[_0x3fba('0x37')]({},_0x4f4dd0,_0x6031cd[_0x3fba('0xa1')]);return db[_0x3fba('0x3e')][_0x3fba('0x15')]({'where':_0x4f4dd0[_0x3fba('0x5c')]})[_0x3fba('0x19')](function(_0x1f415a){_0x17fd99[_0x3fba('0x15')]=_0x1f415a;if(_0x6031cd['query'][_0x3fba('0xa2')]){_0x4f4dd0[_0x3fba('0xa3')]=[{'all':!![]}];}return db[_0x3fba('0x3e')][_0x3fba('0x20')](_0x4f4dd0);})['then'](function(_0xd218d4){_0x17fd99[_0x3fba('0xa4')]=_0xd218d4;return _0x17fd99;});}})[_0x3fba('0x19')](respondWithFilteredResult(_0x468fd9,_0x4f4dd0))[_0x3fba('0x22')](handleError(_0x468fd9,null));};exports[_0x3fba('0xa5')]=function(_0x35cbe4,_0x4a7277){var _0x1fdb21={'raw':!![],'where':{}};var _0x501056={};var _0x227f53={'count':0x0,'rows':[]};return db[_0x3fba('0x23')]['findOne']({'where':{'id':_0x35cbe4['params']['id']}})[_0x3fba('0x19')](handleEntityNotFound(_0x4a7277,null))[_0x3fba('0x19')](function(_0x217a65){if(_0x217a65){_0x501056['model']=_['keys'](db[_0x3fba('0x4e')][_0x3fba('0x7f')]);_0x501056[_0x3fba('0x2b')]=_['keys'](_0x35cbe4[_0x3fba('0x2b')]);_0x501056['filters']=_[_0x3fba('0x81')](_0x501056[_0x3fba('0x7e')],_0x501056[_0x3fba('0x2b')]);_0x1fdb21[_0x3fba('0x83')]=_[_0x3fba('0x81')](_0x501056['model'],qs[_0x3fba('0x82')](_0x35cbe4['query'][_0x3fba('0x82')]));_0x1fdb21['attributes']=_0x1fdb21['attributes'][_0x3fba('0x39')]?_0x1fdb21[_0x3fba('0x83')]:_0x501056['model'];if(!_0x35cbe4[_0x3fba('0x2b')][_0x3fba('0x36')](_0x3fba('0x88'))){_0x1fdb21['limit']=qs[_0x3fba('0x14')](_0x35cbe4[_0x3fba('0x2b')][_0x3fba('0x14')]);_0x1fdb21['offset']=qs[_0x3fba('0x12')](_0x35cbe4['query']['offset']);}_0x1fdb21['order']=qs[_0x3fba('0x85')](_0x35cbe4[_0x3fba('0x2b')][_0x3fba('0x85')]);_0x1fdb21[_0x3fba('0x5c')]=qs[_0x3fba('0x80')](_[_0x3fba('0x86')](_0x35cbe4[_0x3fba('0x2b')],_0x501056['filters']));_0x1fdb21[_0x3fba('0x5c')][_0x3fba('0xa0')]=_0x217a65['id'];if(_0x35cbe4[_0x3fba('0x2b')][_0x3fba('0x87')]){_0x1fdb21[_0x3fba('0x5c')]=_[_0x3fba('0x37')](_0x1fdb21[_0x3fba('0x5c')],{'$or':_['map'](_0x1fdb21[_0x3fba('0x83')],function(_0x3fce90){var _0x51c833={};_0x51c833[_0x3fce90]={'$like':'%'+_0x35cbe4[_0x3fba('0x2b')][_0x3fba('0x87')]+'%'};return _0x51c833;})});}_0x1fdb21=_[_0x3fba('0x37')]({},_0x1fdb21,_0x35cbe4[_0x3fba('0xa1')]);return db[_0x3fba('0x4e')]['count']({'where':_0x1fdb21[_0x3fba('0x5c')]})[_0x3fba('0x19')](function(_0x11ebdd){_0x227f53['count']=_0x11ebdd;if(_0x35cbe4[_0x3fba('0x2b')]['includeAll']){_0x1fdb21[_0x3fba('0xa3')]=[{'all':!![]}];}return db[_0x3fba('0x4e')][_0x3fba('0x20')](_0x1fdb21);})[_0x3fba('0x19')](function(_0x348397){_0x227f53[_0x3fba('0xa4')]=_0x348397;return _0x227f53;});}})[_0x3fba('0x19')](respondWithFilteredResult(_0x4a7277,_0x1fdb21))['catch'](handleError(_0x4a7277,null));};exports[_0x3fba('0xa6')]=function(_0x2f799a,_0xb70e3f){var _0x53e2d2={'raw':!![],'where':{}};var _0x5c5a19={};var _0x40380d={'count':0x0,'rows':[]};return db[_0x3fba('0x23')][_0x3fba('0x7d')]({'where':{'id':_0x2f799a[_0x3fba('0x25')]['id']}})[_0x3fba('0x19')](handleEntityNotFound(_0xb70e3f,null))[_0x3fba('0x19')](function(_0x583b09){if(_0x583b09){_0x5c5a19[_0x3fba('0x7e')]=_[_0x3fba('0x28')](db[_0x3fba('0x4d')]['rawAttributes']);_0x5c5a19[_0x3fba('0x2b')]=_[_0x3fba('0x28')](_0x2f799a['query']);_0x5c5a19[_0x3fba('0x80')]=_[_0x3fba('0x81')](_0x5c5a19[_0x3fba('0x7e')],_0x5c5a19[_0x3fba('0x2b')]);_0x53e2d2[_0x3fba('0x83')]=_['intersection'](_0x5c5a19['model'],qs['fields'](_0x2f799a[_0x3fba('0x2b')]['fields']));_0x53e2d2[_0x3fba('0x83')]=_0x53e2d2[_0x3fba('0x83')]['length']?_0x53e2d2[_0x3fba('0x83')]:_0x5c5a19[_0x3fba('0x7e')];if(!_0x2f799a[_0x3fba('0x2b')][_0x3fba('0x36')](_0x3fba('0x88'))){_0x53e2d2['limit']=qs[_0x3fba('0x14')](_0x2f799a[_0x3fba('0x2b')][_0x3fba('0x14')]);_0x53e2d2[_0x3fba('0x12')]=qs['offset'](_0x2f799a['query'][_0x3fba('0x12')]);}_0x53e2d2['order']=qs[_0x3fba('0x85')](_0x2f799a[_0x3fba('0x2b')][_0x3fba('0x85')]);_0x53e2d2[_0x3fba('0x5c')]=qs[_0x3fba('0x80')](_[_0x3fba('0x86')](_0x2f799a[_0x3fba('0x2b')],_0x5c5a19[_0x3fba('0x80')]));_0x53e2d2[_0x3fba('0x5c')][_0x3fba('0xa0')]=_0x583b09['id'];if(_0x2f799a[_0x3fba('0x2b')][_0x3fba('0x87')]){_0x53e2d2[_0x3fba('0x5c')]=_[_0x3fba('0x37')](_0x53e2d2['where'],{'$or':_[_0x3fba('0x6e')](_0x53e2d2[_0x3fba('0x83')],function(_0x450f98){var _0xac89e1={};_0xac89e1[_0x450f98]={'$like':'%'+_0x2f799a['query']['filter']+'%'};return _0xac89e1;})});}_0x53e2d2=_['merge']({},_0x53e2d2,_0x2f799a['options']);return db[_0x3fba('0x4d')][_0x3fba('0x15')]({'where':_0x53e2d2[_0x3fba('0x5c')]})['then'](function(_0x2732b9){_0x40380d[_0x3fba('0x15')]=_0x2732b9;if(_0x2f799a[_0x3fba('0x2b')]['includeAll']){_0x53e2d2['include']=[{'all':!![]}];}return db[_0x3fba('0x4d')][_0x3fba('0x20')](_0x53e2d2);})[_0x3fba('0x19')](function(_0x4bc066){_0x40380d[_0x3fba('0xa4')]=_0x4bc066;return _0x40380d;});}})[_0x3fba('0x19')](respondWithFilteredResult(_0xb70e3f,_0x53e2d2))[_0x3fba('0x22')](handleError(_0xb70e3f,null));};exports[_0x3fba('0xa7')]=function(_0x5a9561,_0x4ae054){var _0x3f9e8d={'raw':!![],'where':{}};var _0x6e3026={};var _0x517e3e={'count':0x0,'rows':[]};return db[_0x3fba('0x23')][_0x3fba('0x7d')]({'where':{'id':_0x5a9561['params']['id']}})[_0x3fba('0x19')](handleEntityNotFound(_0x4ae054,null))[_0x3fba('0x19')](function(_0x2c3ff4){if(_0x2c3ff4){_0x6e3026[_0x3fba('0x7e')]=_['keys'](db[_0x3fba('0xa8')][_0x3fba('0x7f')]);_0x6e3026['query']=_[_0x3fba('0x28')](_0x5a9561[_0x3fba('0x2b')]);_0x6e3026[_0x3fba('0x80')]=_['intersection'](_0x6e3026[_0x3fba('0x7e')],_0x6e3026[_0x3fba('0x2b')]);_0x3f9e8d['attributes']=_['intersection'](_0x6e3026[_0x3fba('0x7e')],qs['fields'](_0x5a9561[_0x3fba('0x2b')][_0x3fba('0x82')]));_0x3f9e8d[_0x3fba('0x83')]=_0x3f9e8d['attributes'][_0x3fba('0x39')]?_0x3f9e8d[_0x3fba('0x83')]:_0x6e3026['model'];if(!_0x5a9561[_0x3fba('0x2b')][_0x3fba('0x36')](_0x3fba('0x88'))){_0x3f9e8d[_0x3fba('0x14')]=qs[_0x3fba('0x14')](_0x5a9561[_0x3fba('0x2b')][_0x3fba('0x14')]);_0x3f9e8d[_0x3fba('0x12')]=qs[_0x3fba('0x12')](_0x5a9561[_0x3fba('0x2b')]['offset']);}_0x3f9e8d[_0x3fba('0x84')]=qs[_0x3fba('0x85')](_0x5a9561[_0x3fba('0x2b')][_0x3fba('0x85')]);_0x3f9e8d['where']=qs[_0x3fba('0x80')](_[_0x3fba('0x86')](_0x5a9561[_0x3fba('0x2b')],_0x6e3026['filters']));_0x3f9e8d[_0x3fba('0x5c')][_0x3fba('0xa0')]=_0x2c3ff4['id'];if(_0x5a9561['query']['filter']){_0x3f9e8d[_0x3fba('0x5c')]=_[_0x3fba('0x37')](_0x3f9e8d['where'],{'$or':_[_0x3fba('0x6e')](_0x3f9e8d[_0x3fba('0x83')],function(_0x4ffc31){var _0x20eb98={};_0x20eb98[_0x4ffc31]={'$like':'%'+_0x5a9561[_0x3fba('0x2b')][_0x3fba('0x87')]+'%'};return _0x20eb98;})});}_0x3f9e8d=_['merge']({},_0x3f9e8d,_0x5a9561['options']);return db[_0x3fba('0xa8')][_0x3fba('0x15')]({'where':_0x3f9e8d[_0x3fba('0x5c')]})['then'](function(_0x559eb4){_0x517e3e[_0x3fba('0x15')]=_0x559eb4;if(_0x5a9561[_0x3fba('0x2b')][_0x3fba('0xa2')]){_0x3f9e8d[_0x3fba('0xa3')]=[{'all':!![]}];}return db[_0x3fba('0xa8')][_0x3fba('0x20')](_0x3f9e8d);})[_0x3fba('0x19')](function(_0x576990){_0x517e3e[_0x3fba('0xa4')]=_0x576990;return _0x517e3e;});}})[_0x3fba('0x19')](respondWithFilteredResult(_0x4ae054,_0x3f9e8d))['catch'](handleError(_0x4ae054,null));};exports[_0x3fba('0xa9')]=function(_0x131533,_0x4971ff){try{if(!_0x131533['body'][_0x3fba('0x5e')]){throw new Error(_0x3fba('0xaa'));}if(!_0x131533[_0x3fba('0x38')][_0x3fba('0xab')]){throw new Error(_0x3fba('0xac'));}if(!_0x131533['body'][_0x3fba('0xad')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x131533[_0x3fba('0x38')]['socket_timestamp']){throw new Error(_0x3fba('0xae'));}var _0x16f6b5=_0x131533[_0x3fba('0x38')]['binding_keys'][_0x3fba('0xaf')](',');var _0x39a22a=_0x131533[_0x3fba('0x38')]['binding_values']['split'](',');if(!_0x16f6b5[_0x3fba('0x39')]||!_0x39a22a[_0x3fba('0x39')]||_0x16f6b5[_0x3fba('0x39')]!==_0x39a22a[_0x3fba('0x39')]){throw new Error(_0x3fba('0xb0'));}_0x131533[_0x3fba('0x38')][_0x3fba('0x82')]=_[_0x3fba('0xb1')](_0x16f6b5,_0x39a22a);if(!_0x131533[_0x3fba('0x38')][_0x3fba('0x82')][_0x3fba('0x7b')]){throw new Error(_0x3fba('0xb2'));}if(!_0x131533[_0x3fba('0x38')][_0x3fba('0x82')][_0x3fba('0xb3')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0xb7c96a=path[_0x3fba('0x3b')](config[_0x3fba('0xb4')],_0x3fba('0xb5'),_0x131533[_0x3fba('0xb6')][_0x3fba('0xb7')]);fs['chmodSync'](_0xb7c96a,parseInt(_0x3fba('0xb8'),0x8));var _0x513f77=require('child_process')[_0x3fba('0xb9')](path[_0x3fba('0x3b')](__dirname,_0x3fba('0xba')),[_0xb7c96a,_0x131533[_0x3fba('0x38')][_0x3fba('0xab')],_0x131533[_0x3fba('0x38')][_0x3fba('0xad')],_0x131533[_0x3fba('0x38')]['ListId'],_0x131533[_0x3fba('0x38')][_0x3fba('0xbb')],_0x131533['body'][_0x3fba('0x5b')],_0x131533[_0x3fba('0x38')][_0x3fba('0xbc')]]);return _0x4971ff[_0x3fba('0x10')](0xc8)[_0x3fba('0x11')]({'message':_0x3fba('0xbd'),'pid':_0x513f77['pid']});}catch(_0x32e1e1){return _0x4971ff[_0x3fba('0x10')](0x1f4)[_0x3fba('0x1e')](_0x32e1e1);}};exports['upload']=function(_0x3c4317,_0x2a6165){var _0x2f247d=fs[_0x3fba('0xbe')](_0x3c4317[_0x3fba('0xb6')]['path']);Papa['parse'](_0x2f247d,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x2dc140){return _0x2a6165[_0x3fba('0x10')](0xc8)['json']({'file':_0x3c4317[_0x3fba('0xb6')],'fields':_0x2dc140[_0x3fba('0xbf')][_0x3fba('0x82')]});}});};exports[_0x3fba('0xc0')]=function(_0x2d1243,_0x5e4a81){return db[_0x3fba('0xc1')][_0x3fba('0x20')]({'raw':!![],'attributes':['id'],'where':{'role':_0x3fba('0xc2')}})[_0x3fba('0x19')](function(_0x45fbdd){var _0x151b56=![];if(!_0x2d1243[_0x3fba('0x38')][_0x3fba('0x5e')]){throw new Error('No\x20ListId\x20specified');}if(!_0x2d1243[_0x3fba('0x38')][_0x3fba('0xc3')][_0x3fba('0x7b')]){throw new Error(_0x3fba('0xb2'));}if(!_0x2d1243[_0x3fba('0x38')]['binding'][_0x3fba('0xb3')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x2d1243[_0x3fba('0x38')][_0x3fba('0xbc')]){throw new Error(_0x3fba('0xae'));}var _0x5ddd83=require('child_process')[_0x3fba('0xb9')](path[_0x3fba('0x3b')](__dirname,_0x3fba('0xc4')),[_0x2d1243[_0x3fba('0x25')]['id'],JSON[_0x3fba('0xc5')](_0x2d1243[_0x3fba('0x38')]),JSON[_0x3fba('0xc5')](_0x45fbdd)]);_0x5ddd83['on'](_0x3fba('0xc6'),function(){_0x151b56=!![];return _0x5e4a81[_0x3fba('0x10')](0xc8)[_0x3fba('0x11')]({'message':_0x3fba('0xc7'),'pid':_0x5ddd83[_0x3fba('0xc8')]});});_0x5ddd83['on'](_0x3fba('0xc9'),function(_0x250b6f){if(_0x250b6f&&!_0x151b56){return _0x5e4a81[_0x3fba('0x10')](0x1f4)[_0x3fba('0x11')]({'message':_0x3fba('0xca'),'pid':_0x5ddd83['pid']});}});})['catch'](handleError(_0x5e4a81,null));};exports['importUpdates']=function(_0x4ce239,_0xfafc6){return db[_0x3fba('0xc1')][_0x3fba('0x20')]({'raw':!![],'attributes':['id'],'where':{'role':_0x3fba('0xc2')}})[_0x3fba('0x19')](function(_0x3f398f){var _0x52693e=![];if(!_0x4ce239['body']['ListId']){throw new Error(_0x3fba('0xaa'));}if(!_0x4ce239[_0x3fba('0x38')][_0x3fba('0xc3')][_0x3fba('0x7b')]){throw new Error(_0x3fba('0xb2'));}if(!_0x4ce239['body']['binding'][_0x3fba('0xb3')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x4ce239[_0x3fba('0x38')][_0x3fba('0xbc')]){throw new Error(_0x3fba('0xae'));}var _0x570b53=require('child_process')['fork'](path['join'](__dirname,_0x3fba('0xcb')),[_0x4ce239['params']['id'],JSON[_0x3fba('0xc5')](_0x4ce239[_0x3fba('0x38')]),JSON[_0x3fba('0xc5')](_0x3f398f)]);_0x570b53['on'](_0x3fba('0xc6'),function(){_0x52693e=!![];return _0xfafc6['status'](0xc8)[_0x3fba('0x11')]({'message':_0x3fba('0xc7'),'pid':_0x570b53[_0x3fba('0xc8')]});});_0x570b53['on'](_0x3fba('0xc9'),function(_0x2aa22d){if(_0x2aa22d&&!_0x52693e){return _0xfafc6[_0x3fba('0x10')](0x1f4)[_0x3fba('0x11')]({'message':'error\x20child\x20process','pid':_0x570b53['pid']});}});})['catch'](handleError(_0xfafc6,null));};exports[_0x3fba('0xcc')]=function(_0x4af20c,_0x41a210){var _0x7560f8=['mail',_0x3fba('0xcd'),_0x3fba('0xce'),_0x3fba('0xcf'),_0x3fba('0xd0'),'whatsapp',_0x3fba('0xd1')];var _0x45df23={'offset':0x0,'order':qs[_0x3fba('0x85')](_0x3fba('0xd2'))},_0x3bdb6f={'count':0x0,'rows':[]};Promise[_0x3fba('0xd3')]()[_0x3fba('0x19')](function(){if(_0x4af20c[_0x3fba('0x2b')][_0x3fba('0xd4')]){if(!_[_0x3fba('0xd5')](_0x7560f8,_0x4af20c[_0x3fba('0x2b')][_0x3fba('0xd4')][_0x3fba('0xd6')]())){throw new Error(_0x3fba('0xd7'));}_0x7560f8=[_0x4af20c[_0x3fba('0x2b')][_0x3fba('0xd4')][_0x3fba('0xd6')]()];}if(_0x4af20c[_0x3fba('0x2b')]['range']){try{var _0x4c34f5=JSON[_0x3fba('0xd8')](_0x4af20c[_0x3fba('0x2b')][_0x3fba('0xd9')]);if(!moment(_0x4c34f5['from'])[_0x3fba('0xda')]()){throw new Error(_0x3fba('0xdb'));}if(!moment(_0x4c34f5['to'])[_0x3fba('0xda')]()){throw new Error(_0x3fba('0xdc'));}}catch(_0x4df465){throw new Error(_0x3fba('0xdd'));}}if(!_0x4af20c[_0x3fba('0x2b')][_0x3fba('0x36')]('nolimit')){_0x45df23[_0x3fba('0x14')]=qs[_0x3fba('0x14')](_0x4af20c['query'][_0x3fba('0x14')]||0xa);_0x45df23[_0x3fba('0x12')]=qs[_0x3fba('0x12')](_0x4af20c[_0x3fba('0x2b')][_0x3fba('0x12')]);}var _0x3c0387=_0x7560f8[_0x3fba('0x6e')](function(_0x498477){if(_0x498477==='voice'){var _0x535be3={'attributes':['id','uniqueid',_0x3fba('0x32'),_0x3fba('0xde'),_0x3fba('0xdf'),_0x3fba('0xe0'),_0x3fba('0xe1'),_0x3fba('0xe2'),_0x3fba('0xe3'),'note',_0x3fba('0xe4'),_0x3fba('0xe5'),_0x3fba('0xe6'),_0x3fba('0xe7'),'UserId'],'where':{'ContactId':_0x4af20c[_0x3fba('0x25')]['id']},'include':[{'model':db[_0x3fba('0xc1')],'as':_0x3fba('0xc1'),'attributes':['id',_0x3fba('0x1d'),'fullname','alias']}],'order':[[_0x3fba('0xe4'),_0x3fba('0xe8')]]};if(_0x4af20c[_0x3fba('0x2b')][_0x3fba('0xd9')]){_0x535be3[_0x3fba('0x5c')]['createdAt']={'$gte':_0x4c34f5['from'],'$lte':_0x4c34f5['to']};}return db[_0x3fba('0x50')][_0x3fba('0xe9')](_0x535be3)[_0x3fba('0x19')](function(_0x2295cc){_0x3bdb6f[_0x3fba('0x15')]+=_0x2295cc[_0x3fba('0x15')];return _[_0x3fba('0x6e')](_0x2295cc[_0x3fba('0xa4')],function(_0x597f18){var _0x11d664=_0x597f18[_0x3fba('0xea')]({'plain':!![]});_0x11d664[_0x3fba('0xd4')]=_0x498477;if(_0x11d664['User']){_0x11d664[_0x3fba('0xc1')]={'id':_0x11d664[_0x3fba('0xc1')]['id'],'name':_0x11d664[_0x3fba('0xc1')]['name'],'fullname':_0x11d664[_0x3fba('0xc1')][_0x3fba('0xeb')],'alias':_0x11d664['User'][_0x3fba('0x30')]};}return _0x11d664;});});}else{var _0x4a21c5=_['startCase'](_0x498477)+(_0x498477==='chat'?_0x3fba('0xec'):'Account');var _0x42ab42={'attributes':['id',_0x3fba('0xed'),_0x3fba('0xee'),_0x3fba('0xe4'),_0x3fba('0xef'),_0x3fba('0xf0'),_0x3fba('0xf1'),'thirdDisposition',_0x3fba('0xf2'),_0x4a21c5+'Id'],'where':{'ContactId':_0x4af20c[_0x3fba('0x25')]['id']},'include':[{'model':db[_0x4a21c5],'as':_0x3fba('0xf3'),'attributes':['id',_0x3fba('0x1d'),_0x3fba('0xf4')]},{'model':db[_0x3fba('0xc1')],'as':_0x3fba('0xf5'),'attributes':['id',_0x3fba('0x1d'),'fullname']},{'model':db[_0x3fba('0x65')],'as':_0x3fba('0x66'),'attributes':['id',_0x3fba('0x1d'),_0x3fba('0x67')],'through':{'attributes':[]}}],'order':[['createdAt','DESC']]};if(_0x4af20c[_0x3fba('0x2b')][_0x3fba('0xd9')]){_0x42ab42[_0x3fba('0x5c')]['createdAt']={'$gte':_0x4c34f5['from'],'$lte':_0x4c34f5['to']};}switch(_0x498477){case _0x3fba('0xcd'):_0x42ab42[_0x3fba('0x83')][_0x3fba('0x5d')](_0x3fba('0xf6'),_0x3fba('0xf7'),'customerPort',_0x3fba('0xf8'),'osName',_0x3fba('0xf9'),_0x3fba('0xfa'),_0x3fba('0xfb'),_0x3fba('0xfc'));break;case _0x3fba('0xfd'):_0x42ab42['attributes']['push'](_0x3fba('0xfe'),_0x3fba('0xff'));break;case'openchannel':_0x42ab42[_0x3fba('0x83')][_0x3fba('0x5d')](_0x3fba('0x100'),'threadId');break;}return db[_['startCase'](_0x498477)+_0x3fba('0x101')][_0x3fba('0xe9')](_0x42ab42)[_0x3fba('0x19')](function(_0x4e99cf){_0x3bdb6f[_0x3fba('0x15')]+=_0x4e99cf[_0x3fba('0x15')];return _[_0x3fba('0x6e')](_0x4e99cf[_0x3fba('0xa4')],function(_0xd5a4e4){var _0x1e855c=_0xd5a4e4[_0x3fba('0xea')]({'plain':!![]});_0x1e855c['channel']=_0x498477;if(_0x1e855c[_0x3fba('0xf5')]){_0x1e855c[_0x3fba('0xf5')]={'id':_0x1e855c[_0x3fba('0xf5')]['id'],'name':_0x1e855c[_0x3fba('0xf5')][_0x3fba('0x1d')],'fullname':_0x1e855c['Owner'][_0x3fba('0xeb')]};}return _0x1e855c;});});}});return Promise['all'](_0x3c0387);})['then'](function(_0x16528f){return _(_0x16528f)[_0x3fba('0x102')]()['sortBy'](_0x3fba('0xe4'))[_0x3fba('0x103')]()['value']();})[_0x3fba('0x19')](function(_0x5ed6f2){_0x3bdb6f[_0x3fba('0xa4')]=_0x45df23[_0x3fba('0x14')]?_0x5ed6f2[_0x3fba('0x104')](_0x45df23['offset'],_0x45df23['offset']+_0x45df23[_0x3fba('0x14')]):_0x5ed6f2;return _0x3bdb6f;})[_0x3fba('0x19')](respondWithFilteredResult(_0x41a210,_0x45df23))[_0x3fba('0x22')](handleError(_0x41a210,null));}; \ No newline at end of file +var _0x3d05=['exit','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','resolve','channel','includes','Invalid\x20channel','toLowerCase','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','destination','callerid','starttime','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','range','Website','Account','disposition','secondDisposition','thirdDisposition','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','threadId','Interaction','findAndCountAll','Owner','flatten','reverse','moment','bluebird','util','path','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','undefined','limit','count','offset','status','set','Content-Range','json','update','then','destroy','end','error','stack','name','send','index','describe','query','catch','CmContact','find','params','keys','length','startsWith','cf_','columnName','CmCustomField','findAll','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','hasOwnProperty','merge','body','from','get','isArray','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','ReportAgentPreview','VoiceCallReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','ListId','spread','push','contact','all','Tag','Tags','color','tag','CmContactHasItem','ContactItemType','ItemType','sequelize','Phones.OrderBy','map','$and','omit','pickBy','format','cf_%d','isEmpty','cm_contacts','setFields','toParam','text','phone','getTags','findOne','model','attributes','intersection','fields','order','pick','options','nolimit','setTags','ids','setAdditionalPhones','OrderBy','item_types','ItemTypeId','items','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','CmContactId','toContactId','hopperId','rawAttributes','filters','ContactId','filter','include','rows','getHopperHistories','CmHopperHistory','sort','includeAll','getHopperFinals','CmHopperFinal','getJscriptySessions','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','filename','0777','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','meta','import','User','binding','child_process','fork','stringify','message','start\x20child\x20process\x20correctly!','importUpdates','agent','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csvUpdates'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x3d05,0x12a));var _0x53d0=function(_0x59b439,_0x14ae7b){_0x59b439=_0x59b439-0x0;var _0x521ea3=_0x3d05[_0x59b439];return _0x521ea3;};'use strict';var moment=require(_0x53d0('0x0'));var BPromise=require(_0x53d0('0x1'));var util=require(_0x53d0('0x2'));var path=require(_0x53d0('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x53d0('0x4'));var Papa=require(_0x53d0('0x5'));var Redis=require(_0x53d0('0x6'));var contacts=require(_0x53d0('0x7'));var qs=require(_0x53d0('0x8'));var logger=require(_0x53d0('0x9'))(_0x53d0('0xa'));var config=require(_0x53d0('0xb'));var shared=require(_0x53d0('0xc'));var db=require(_0x53d0('0xd'))['db'];config[_0x53d0('0xe')]=_[_0x53d0('0xf')](config[_0x53d0('0xe')],{'host':_0x53d0('0x10'),'port':0x18eb});var socket=require(_0x53d0('0x11'))(new Redis(config[_0x53d0('0xe')]));require('./cmContact.socket')[_0x53d0('0x12')](socket);function respondWithResult(_0xb80080,_0x95faee){_0x95faee=_0x95faee||0xc8;return function(_0xaebe57){if(_0xaebe57){return _0xb80080['status'](_0x95faee)['json'](_0xaebe57);}};}function respondWithFilteredResult(_0x2438aa,_0x57c4ec){return function(_0x4b3175){if(_0x4b3175){var _0x532c34=typeof _0x57c4ec['offset']===_0x53d0('0x13')&&typeof _0x57c4ec[_0x53d0('0x14')]===_0x53d0('0x13');var _0x398e4c=_0x4b3175[_0x53d0('0x15')];var _0x978644=_0x532c34?0x0:_0x57c4ec['offset'];var _0x62a23=_0x532c34?_0x4b3175['count']:_0x57c4ec[_0x53d0('0x16')]+_0x57c4ec[_0x53d0('0x14')];var _0x1bb8d0;if(_0x62a23>=_0x398e4c){_0x62a23=_0x398e4c;_0x1bb8d0=0xc8;}else{_0x1bb8d0=0xce;}_0x2438aa[_0x53d0('0x17')](_0x1bb8d0);return _0x2438aa[_0x53d0('0x18')](_0x53d0('0x19'),_0x978644+'-'+_0x62a23+'/'+_0x398e4c)[_0x53d0('0x1a')](_0x4b3175);}return null;};}function saveUpdates(_0x26750c){return function(_0x689b19){if(_0x689b19){return _0x689b19[_0x53d0('0x1b')](_0x26750c)[_0x53d0('0x1c')](function(_0x529536){return _0x529536;});}return null;};}function removeEntity(_0x34004b){return function(_0x45118d){if(_0x45118d){return _0x45118d[_0x53d0('0x1d')]()[_0x53d0('0x1c')](function(){_0x34004b[_0x53d0('0x17')](0xcc)[_0x53d0('0x1e')]();});}};}function handleEntityNotFound(_0x42c6c1){return function(_0x4a2ce8){if(!_0x4a2ce8){_0x42c6c1['sendStatus'](0x194);}return _0x4a2ce8;};}function handleError(_0x2f0424,_0x416c8f){_0x416c8f=_0x416c8f||0x1f4;return function(_0x350282){logger[_0x53d0('0x1f')](_0x350282[_0x53d0('0x20')]);if(_0x350282[_0x53d0('0x21')]){delete _0x350282[_0x53d0('0x21')];}_0x2f0424[_0x53d0('0x17')](_0x416c8f)[_0x53d0('0x22')](_0x350282);};}exports[_0x53d0('0x23')]=function(_0x38741a,_0x1e4bbd){var _0x334f12={};return contacts[_0x53d0('0x24')]()['then'](function(_0x3ff1d9){_0x334f12=qs['getOptions'](_0x3ff1d9,_0x38741a);return contacts['findAll'](_0x38741a[_0x53d0('0x25')],_0x38741a['user'],_0x334f12,_0x3ff1d9);})[_0x53d0('0x1c')](respondWithFilteredResult(_0x1e4bbd,_0x334f12))[_0x53d0('0x26')](handleError(_0x1e4bbd,null));};exports[_0x53d0('0x1d')]=function(_0x52ad33,_0x1ca0c5){return db[_0x53d0('0x27')][_0x53d0('0x28')]({'where':{'id':_0x52ad33[_0x53d0('0x29')]['id']}})[_0x53d0('0x1c')](handleEntityNotFound(_0x1ca0c5,null))[_0x53d0('0x1c')](removeEntity(_0x1ca0c5,null))[_0x53d0('0x26')](handleError(_0x1ca0c5,null));};exports[_0x53d0('0x24')]=function(_0x556f3b,_0x214524){return db[_0x53d0('0x27')]['describe']()[_0x53d0('0x1c')](function(_0x5ea445){delete _0x5ea445['tags'];for(var _0x376d25=0x0;_0x376d250x0){return new Promise(function(_0x5c1429){var _0x407295=[];for(var _0x4aa77b=0x0;_0x4aa77b<_0x491f86[_0x53d0('0x2b')];_0x4aa77b++){_0x407295[_0x53d0('0x5f')](insertAdditionalPhones(_0x491f86[_0x4aa77b][_0x53d0('0x60')],_0x491f86[_0x4aa77b][_0x53d0('0x57')]));}Promise[_0x53d0('0x61')](_0x407295)[_0x53d0('0x1c')](function(){_0x5c1429(0x1);});})[_0x53d0('0x1c')](function(){return{'success':_0xae8a4b,'failure':_0x997528,'duplicates':_0x40a717};});}else{return{'success':_0xae8a4b,'failure':_0x997528,'duplicates':_0x40a717};}}})[_0x53d0('0x1c')](respondWithResult(_0x5a1576,0xc9))['catch'](handleError(_0x5a1576,null));};exports['show']=function(_0x255340,_0x4bb3d0){var _0x429fb7;return db[_0x53d0('0x27')][_0x53d0('0x24')]()[_0x53d0('0x1c')](function(_0xad2501){return db[_0x53d0('0x27')][_0x53d0('0x28')]({'where':{'id':_0x255340[_0x53d0('0x29')]['id']},'include':[{'model':db[_0x53d0('0x62')],'as':_0x53d0('0x63'),'attributes':['id',_0x53d0('0x21'),_0x53d0('0x64')],'required':_0x255340[_0x53d0('0x25')][_0x53d0('0x65')]?!![]:![]},{'model':db[_0x53d0('0x66')],'as':'Phones','where':{'CmContactId':_0x255340[_0x53d0('0x29')]['id']},'required':![],'include':[{'model':db[_0x53d0('0x67')],'as':_0x53d0('0x68')}]}],'order':[db[_0x53d0('0x69')]['literal'](_0x53d0('0x6a'))],'attributes':_[_0x53d0('0x2a')](_0xad2501)});})[_0x53d0('0x1c')](function(_0x117234){if(!_[_0x53d0('0x53')](_0x117234)){_0x429fb7=_0x117234[_0x53d0('0x3b')]({'plain':!![]});var _0x9a32c4={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x117234&&_0x117234[_0x53d0('0x5d')]){if(_0x117234[_0x53d0('0x5d')]){_0x9a32c4[_0x53d0('0x5b')]['$and'][_0x53d0('0x5f')]({'ListId':{'$ne':_0x117234[_0x53d0('0x5d')]}});}}return db[_0x53d0('0x2f')][_0x53d0('0x30')](_0x9a32c4);}})['then'](function(_0xd712b1){if(!_[_0x53d0('0x53')](_0xd712b1)){return _['omit'](_0x429fb7,_[_0x53d0('0x6b')](_0xd712b1,function(_0x1fcc9f){return util['format']('cf_%d',_0x1fcc9f['id']);}));}})[_0x53d0('0x1c')](handleEntityNotFound(_0x4bb3d0,null))[_0x53d0('0x1c')](respondWithResult(_0x4bb3d0,null))[_0x53d0('0x26')](handleError(_0x4bb3d0,null));};exports[_0x53d0('0x1b')]=function(_0x325ea9,_0x5d17d0){var _0x113900;if(_0x325ea9['body']['id']){delete _0x325ea9[_0x53d0('0x39')]['id'];}if(!_['isNil'](_0x325ea9[_0x53d0('0x39')]['dialTimezone'])){var _0x325e0f=_0x325ea9[_0x53d0('0x39')][_0x53d0('0x54')];if(!_[_0x53d0('0x53')](shared[_0x53d0('0x55')][_0x325e0f]))_0x325ea9[_0x53d0('0x39')][_0x53d0('0x56')]=shared[_0x53d0('0x55')][_0x325e0f][_0x53d0('0x56')];}return db[_0x53d0('0x27')][_0x53d0('0x28')]({'where':{'id':_0x325ea9['params']['id']}})[_0x53d0('0x1c')](handleEntityNotFound(_0x5d17d0,null))[_0x53d0('0x1c')](saveUpdates(_0x325ea9[_0x53d0('0x39')],null))[_0x53d0('0x1c')](function(_0x211a17){_0x113900=_0x211a17;var _0x5020c5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x211a17&&_0x211a17[_0x53d0('0x5d')]){if(_0x211a17[_0x53d0('0x5d')]){_0x5020c5['where'][_0x53d0('0x6c')]['push']({'ListId':{'$ne':_0x211a17['ListId']}});}}return db['CmCustomField'][_0x53d0('0x30')](_0x5020c5);})['then'](function(_0x1e9987){if(_0x1e9987){return _[_0x53d0('0x6d')](_[_0x53d0('0x6e')](_0x325ea9[_0x53d0('0x39')],function(_0x3eb677,_0x20d8af){return _[_0x53d0('0x2c')](_0x20d8af,'cf_');}),_[_0x53d0('0x6b')](_0x1e9987,function(_0x1d21cc){return util[_0x53d0('0x6f')](_0x53d0('0x70'),_0x1d21cc['id']);}));}})['then'](function(_0x496e82){if(_0x496e82&&!_[_0x53d0('0x71')](_0x496e82)){var _0xb9cf9b=squel[_0x53d0('0x1b')]()['table'](_0x53d0('0x72'))[_0x53d0('0x73')](_0x496e82)[_0x53d0('0x5b')]('id\x20=\x20?',_0x325ea9[_0x53d0('0x29')]['id'])[_0x53d0('0x74')]();return db[_0x53d0('0x69')]['query'](_0xb9cf9b[_0x53d0('0x75')],{'replacements':_0xb9cf9b[_0x53d0('0x34')]});}})[_0x53d0('0x1c')](function(){if(_0x325ea9[_0x53d0('0x39')][_0x53d0('0x76')]&&_0x113900){return db[_0x53d0('0x40')][_0x53d0('0x1b')]({'phone':_0x325ea9[_0x53d0('0x39')][_0x53d0('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x113900['id']}});}})[_0x53d0('0x1c')](function(){return _0x113900;})[_0x53d0('0x1c')](respondWithResult(_0x5d17d0,null))[_0x53d0('0x26')](handleError(_0x5d17d0,null));};exports[_0x53d0('0x77')]=function(_0x24bb27,_0x164013){var _0x7d1b5c={};var _0x4035a1={};var _0x5af64e;var _0x51adca;return db[_0x53d0('0x27')][_0x53d0('0x78')]({'where':{'id':_0x24bb27['params']['id']}})['then'](handleEntityNotFound(_0x164013,null))[_0x53d0('0x1c')](function(_0xaf9d80){if(_0xaf9d80){_0x5af64e=_0xaf9d80;_0x4035a1[_0x53d0('0x79')]=_[_0x53d0('0x2a')](db[_0x53d0('0x62')]['rawAttributes']);_0x4035a1[_0x53d0('0x25')]=_[_0x53d0('0x2a')](_0x24bb27[_0x53d0('0x25')]);_0x4035a1['filters']=_['intersection'](_0x4035a1[_0x53d0('0x79')],_0x4035a1['query']);_0x7d1b5c[_0x53d0('0x7a')]=_[_0x53d0('0x7b')](_0x4035a1[_0x53d0('0x79')],qs['fields'](_0x24bb27[_0x53d0('0x25')][_0x53d0('0x7c')]));_0x7d1b5c[_0x53d0('0x7a')]=_0x7d1b5c['attributes'][_0x53d0('0x2b')]?_0x7d1b5c[_0x53d0('0x7a')]:_0x4035a1[_0x53d0('0x79')];_0x7d1b5c[_0x53d0('0x7d')]=qs['sort'](_0x24bb27[_0x53d0('0x25')]['sort']);_0x7d1b5c[_0x53d0('0x5b')]=qs['filters'](_[_0x53d0('0x7e')](_0x24bb27[_0x53d0('0x25')],_0x4035a1['filters']));if(_0x24bb27['query']['filter']){_0x7d1b5c[_0x53d0('0x5b')]=_['merge'](_0x7d1b5c[_0x53d0('0x5b')],{'$or':_['map'](_0x7d1b5c[_0x53d0('0x7a')],function(_0x12b53a){var _0x4335a7={};_0x4335a7[_0x12b53a]={'$like':'%'+_0x24bb27[_0x53d0('0x25')]['filter']+'%'};return _0x4335a7;})});}_0x7d1b5c=_[_0x53d0('0x38')]({},_0x7d1b5c,_0x24bb27[_0x53d0('0x7f')]);return _0x5af64e[_0x53d0('0x77')](_0x7d1b5c);}})['then'](function(_0x49165d){if(_0x49165d){_0x51adca=_0x49165d[_0x53d0('0x2b')];if(!_0x24bb27['query'][_0x53d0('0x37')](_0x53d0('0x80'))){_0x7d1b5c['limit']=qs['limit'](_0x24bb27[_0x53d0('0x25')][_0x53d0('0x14')]);_0x7d1b5c['offset']=qs[_0x53d0('0x16')](_0x24bb27[_0x53d0('0x25')][_0x53d0('0x16')]);}return _0x5af64e[_0x53d0('0x77')](_0x7d1b5c);}})[_0x53d0('0x1c')](function(_0xe2aafb){if(_0xe2aafb){return _0xe2aafb?{'count':_0x51adca,'rows':_0xe2aafb}:null;}})[_0x53d0('0x1c')](respondWithResult(_0x164013,null))[_0x53d0('0x26')](handleError(_0x164013,null));};exports[_0x53d0('0x81')]=function(_0x52798e,_0x38e929){if(_0x52798e[_0x53d0('0x39')]['id']){delete _0x52798e[_0x53d0('0x39')]['id'];}return db[_0x53d0('0x27')][_0x53d0('0x78')]({'where':{'id':_0x52798e['params']['id']}})['then'](handleEntityNotFound(_0x38e929,null))[_0x53d0('0x1c')](function(_0x2cab67){if(_0x2cab67){return _0x2cab67['setTags'](_0x52798e['body'][_0x53d0('0x82')]||[]);}return null;})[_0x53d0('0x1c')](respondWithResult(_0x38e929,null))[_0x53d0('0x26')](handleError(_0x38e929,null));};exports[_0x53d0('0x83')]=function(_0x309a43,_0x436d46){var _0x453bcf=[];_0x453bcf[_0x53d0('0x5f')](addAdditionalPhones(_0x309a43[_0x53d0('0x39')]));Promise[_0x53d0('0x61')](_0x453bcf)[_0x53d0('0x1c')](function(){_0x453bcf=[];_0x453bcf[_0x53d0('0x5f')](deleteCmHopperPhones(_0x309a43[_0x53d0('0x39')]['id']));_0x453bcf[_0x53d0('0x5f')](addCmHopperPhones(_0x309a43[_0x53d0('0x39')]['id']));Promise[_0x53d0('0x61')](_0x453bcf)[_0x53d0('0x1c')](function(){return[0x1];})[_0x53d0('0x1c')](respondWithResult(_0x436d46,null));});};function addAdditionalPhones(_0x263861){var _0x3da709;return new Promise(function(_0x3b2108){return db[_0x53d0('0x66')]['destroy']({'where':{'CmContactId':_0x263861['id']}})[_0x53d0('0x1c')](function(){db[_0x53d0('0x67')][_0x53d0('0x30')]({'raw':!![],'attributes':['id',_0x53d0('0x84')]})[_0x53d0('0x1c')](function(_0x3e1e24){var _0x32fe30=[];for(var _0x147e95=0x0;_0x147e95<_0x263861['items'][_0x53d0('0x2b')];_0x147e95++){var _0x1e2141=_0x263861[_0x53d0('0x85')]?_[_0x53d0('0x53')](_0x263861['item_types'][_0x147e95])?'':_0x263861[_0x53d0('0x85')][_0x147e95]:_0x263861['items'][_0x147e95][_0x53d0('0x86')]?_0x263861[_0x53d0('0x87')][_0x147e95][_0x53d0('0x86')]:'';var _0x147bf9=_[_0x53d0('0x53')](_0x263861[_0x53d0('0x87')][_0x147e95]['description'])?'':_0x263861['items'][_0x147e95]['description'];var _0x1776bd=_0x1e2141+':'+_0x263861[_0x53d0('0x87')][_0x147e95][_0x53d0('0x76')]+'§'+_0x147bf9;if(_[_0x53d0('0x53')](_0x3da709))_0x3da709=_0x1776bd;else _0x3da709+=';'+_0x1776bd;var _0x40eb7c=null;var _0x1f03d1=null;if(_0x263861[_0x53d0('0x85')]){if(!_[_0x53d0('0x53')](_0x263861[_0x53d0('0x85')][_0x147e95])){_0x1f03d1=_[_0x53d0('0x28')](_0x3e1e24,function(_0x35b5d2){return _0x35b5d2['id']===_0x263861[_0x53d0('0x85')][_0x147e95];});if(!_[_0x53d0('0x53')](_0x1f03d1)){_0x40eb7c=_0x1f03d1['OrderBy'];}}}else{if(!_[_0x53d0('0x53')](_0x263861['items'][_0x147e95])){_0x1f03d1=_[_0x53d0('0x28')](_0x3e1e24,function(_0x206969){return _0x206969['id']===_0x263861['items'][_0x147e95]['ItemTypeId'];});if(!_['isNil'](_0x1f03d1)){_0x40eb7c=_0x147e95;}}}if(_[_0x53d0('0x53')](_0x40eb7c)){_0x40eb7c=0x64;}_0x32fe30['push'](addAdditionalPhone(_0x263861['id'],_0x263861['items'][_0x147e95][_0x53d0('0x76')],_0x263861[_0x53d0('0x85')]?_['isNil'](_0x263861[_0x53d0('0x85')][_0x147e95])?null:_0x263861['item_types'][_0x147e95]:_0x263861[_0x53d0('0x87')][_0x147e95][_0x53d0('0x86')]?_0x263861[_0x53d0('0x87')][_0x147e95]['ItemTypeId']:null,_0x40eb7c,_0x147bf9));}Promise[_0x53d0('0x61')](_0x32fe30)[_0x53d0('0x1c')](function(){db['CmContact'][_0x53d0('0x1b')]({'AdditionalPhones':_0x3da709},{'where':{'id':_0x263861['id']}})[_0x53d0('0x1c')](function(){_0x3b2108(0x1);});});});});});}function addAdditionalPhone(_0x4a3333,_0x1e884d,_0x3ed1b8,_0x57f3d7,_0xf3075d){return db[_0x53d0('0x66')][_0x53d0('0x28')]({'where':{'CmContactId':_0x4a3333,'item':_0x1e884d}})[_0x53d0('0x1c')](function(_0x1cd98f){if(_0x1cd98f)logger['info']('contact\x20phone\x20exists',_0x1cd98f);else{db[_0x53d0('0x66')]['create']({'CmContactId':_0x4a3333,'item':_0x1e884d,'ItemTypeId':_0x3ed1b8,'OrderBy':_0x57f3d7,'ItemClass':_0x53d0('0x88'),'description':_0xf3075d});}});}function deleteCmHopperPhones(_0x2435cd){return new Promise(function(_0x4e72e2){return db[_0x53d0('0x40')][_0x53d0('0x30')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x2435cd}})[_0x53d0('0x1c')](function(_0x1ab44e){db[_0x53d0('0x89')][_0x53d0('0x1d')]({'where':{'CmHopperId':{'$in':_[_0x53d0('0x6b')](_0x1ab44e,'id')}}});})['then'](function(){_0x4e72e2(0x1);});});}function addCmHopperPhones(_0x2c0c39){return new Promise(function(_0x479b04){return db[_0x53d0('0x40')][_0x53d0('0x30')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x2c0c39}})[_0x53d0('0x1c')](function(_0x58299e){var _0x47bd3e=[];_[_0x53d0('0x6b')](_0x58299e,function(_0x4936de){_0x47bd3e[_0x53d0('0x5f')](createCmHopperPhone(_0x2c0c39,_0x4936de['id']));});Promise['all'](_0x47bd3e)['then'](function(){_0x479b04(0x1);});});});}function createCmHopperPhone(_0x16ae39,_0x1a9a29){return new Promise(function(_0x3aa898){db[_0x53d0('0x66')]['findAll']({'raw':!![],'attributes':[_0x53d0('0x8a'),'OrderBy'],'where':{'CmContactId':_0x16ae39,'ItemClass':_0x53d0('0x88')},'include':[{'model':db[_0x53d0('0x67')],'attributes':[_0x53d0('0x84')],'as':_0x53d0('0x68')}],'order':[_0x53d0('0x84'),db[_0x53d0('0x69')]['literal'](_0x53d0('0x8b'))]})[_0x53d0('0x1c')](function(_0x1108f6){var _0x7b043a=0x1;var _0x2bea81=_[_0x53d0('0x6b')](_0x1108f6,function(_0x2f5fec){_0x2f5fec[_0x53d0('0x8c')]=_0x1a9a29;_0x2f5fec['phone']=_0x2f5fec[_0x53d0('0x8a')];_0x2f5fec[_0x53d0('0x84')]=_0x7b043a;delete _0x2f5fec[_0x53d0('0x8d')];_0x7b043a=_0x7b043a+0x1;return _0x2f5fec;});return db[_0x53d0('0x89')][_0x53d0('0x58')](_0x2bea81,{});})['then'](function(){_0x3aa898(0x1);});});}function insertAdditionalPhones(_0x14516f,_0x16fe44){return new Promise(function(_0x5bb2ff){var _0x36c84a=[];for(var _0x34083a=0x0;_0x34083a<_0x16fe44[_0x53d0('0x2b')];_0x34083a++){var _0x422f08=_0x16fe44[_0x34083a];_0x36c84a[_0x53d0('0x5f')](parseContactItemType(_0x422f08));}Promise[_0x53d0('0x61')](_0x36c84a)[_0x53d0('0x1c')](function(){var _0x31e61c={'id':_0x14516f['id'],'items':_0x16fe44};return addAdditionalPhones(_0x31e61c)[_0x53d0('0x1c')](function(){return addCmHopperPhones(_0x14516f['id']);});})[_0x53d0('0x1c')](function(){_0x5bb2ff(_0x14516f);});});}function parseContactItemType(_0x13c098){return new Promise(function(_0x544059){if(_0x13c098[_0x53d0('0x37')](_0x53d0('0x86'))){_0x544059(_0x13c098);}else{return db[_0x53d0('0x67')][_0x53d0('0x28')]({'where':{'name':_0x13c098['ItemType']}})[_0x53d0('0x1c')](function(_0x376a08){if(_[_0x53d0('0x53')](_0x376a08))_0x13c098[_0x53d0('0x86')]=null;else _0x13c098[_0x53d0('0x86')]=_0x376a08['id'];_0x544059(_0x13c098);});}});}exports[_0x53d0('0x8e')]=function(_0x52cbfe,_0x4d5a1d){return db[_0x53d0('0x66')][_0x53d0('0x30')]({'raw':!![],'where':{'CmContactId':_0x52cbfe[_0x53d0('0x29')]['id'],'ItemClass':_0x53d0('0x88')},'include':[{'model':db[_0x53d0('0x67')],'as':'ItemType'}],'order':[['OrderBy'],[db[_0x53d0('0x69')]['literal'](_0x53d0('0x8b'))]]})[_0x53d0('0x1c')](function(_0x177823){return _0x177823;})[_0x53d0('0x1c')](respondWithResult(_0x4d5a1d,null))['catch'](handleError(_0x4d5a1d,null));};exports[_0x53d0('0x8f')]=function(_0x56d486,_0x2e0b5f){return db[_0x53d0('0x66')][_0x53d0('0x30')]({'raw':!![],'where':{'CmContactId':_0x56d486['body']['fromContactId']}})[_0x53d0('0x1c')](function(_0xa0efbf){var _0x312666=_[_0x53d0('0x6b')](_0xa0efbf,function(_0x37aec2){_0x37aec2[_0x53d0('0x90')]=_0x56d486['body'][_0x53d0('0x91')];return _0x37aec2;});return db[_0x53d0('0x66')][_0x53d0('0x58')](_0x312666,{});})['then'](function(){return addCmHopperPhones(_0x56d486[_0x53d0('0x39')][_0x53d0('0x91')]);})[_0x53d0('0x1c')](function(){return['ok'];})[_0x53d0('0x1c')](respondWithResult(_0x2e0b5f,null))[_0x53d0('0x26')](handleError(_0x2e0b5f,null));};exports['rescheduleAdditionalPhones']=function(_0x18a620,_0x465c7c){var _0x94cb0a=[];_0x94cb0a['push'](createCmHopperPhone(_0x18a620[_0x53d0('0x39')]['id'],_0x18a620[_0x53d0('0x39')][_0x53d0('0x92')]));Promise[_0x53d0('0x61')](_0x94cb0a)[_0x53d0('0x1c')](function(){return[0x1];})['then'](respondWithResult(_0x465c7c,null));};exports['getHoppers']=function(_0x109647,_0x4556d8){var _0x3b4d18={'raw':![],'where':{}};var _0x427fb6={};var _0x396584={'count':0x0,'rows':[]};return db[_0x53d0('0x27')]['findOne']({'where':{'id':_0x109647[_0x53d0('0x29')]['id']}})[_0x53d0('0x1c')](handleEntityNotFound(_0x4556d8,null))['then'](function(_0x57255a){if(_0x57255a){_0x427fb6[_0x53d0('0x79')]=_[_0x53d0('0x2a')](db[_0x53d0('0x40')][_0x53d0('0x93')]);_0x427fb6['query']=_[_0x53d0('0x2a')](_0x109647[_0x53d0('0x25')]);_0x427fb6[_0x53d0('0x94')]=_[_0x53d0('0x7b')](_0x427fb6['model'],_0x427fb6['query']);_0x3b4d18['attributes']=_[_0x53d0('0x7b')](_0x427fb6[_0x53d0('0x79')],qs[_0x53d0('0x7c')](_0x109647[_0x53d0('0x25')][_0x53d0('0x7c')]));_0x3b4d18['attributes']=_0x3b4d18['attributes'][_0x53d0('0x2b')]?_0x3b4d18[_0x53d0('0x7a')]:_0x427fb6['model'];if(!_0x109647[_0x53d0('0x25')][_0x53d0('0x37')](_0x53d0('0x80'))){_0x3b4d18[_0x53d0('0x14')]=qs['limit'](_0x109647[_0x53d0('0x25')][_0x53d0('0x14')]);_0x3b4d18[_0x53d0('0x16')]=qs[_0x53d0('0x16')](_0x109647[_0x53d0('0x25')]['offset']);}_0x3b4d18[_0x53d0('0x7d')]=qs['sort'](_0x109647[_0x53d0('0x25')]['sort']);_0x3b4d18[_0x53d0('0x5b')]=qs[_0x53d0('0x94')](_[_0x53d0('0x7e')](_0x109647['query'],_0x427fb6[_0x53d0('0x94')]));_0x3b4d18[_0x53d0('0x5b')][_0x53d0('0x95')]=_0x57255a['id'];if(_0x109647[_0x53d0('0x25')]['filter']){_0x3b4d18['where']=_[_0x53d0('0x38')](_0x3b4d18[_0x53d0('0x5b')],{'$or':_['map'](_0x3b4d18['attributes'],function(_0x4086f1){var _0x70386a={};_0x70386a[_0x4086f1]={'$like':'%'+_0x109647[_0x53d0('0x25')][_0x53d0('0x96')]+'%'};return _0x70386a;})});}_0x3b4d18=_[_0x53d0('0x38')]({},_0x3b4d18,_0x109647[_0x53d0('0x7f')]);return db[_0x53d0('0x40')][_0x53d0('0x15')]({'where':_0x3b4d18[_0x53d0('0x5b')]})[_0x53d0('0x1c')](function(_0x334220){_0x396584['count']=_0x334220;if(_0x109647[_0x53d0('0x25')]['includeAll']){_0x3b4d18[_0x53d0('0x97')]=[{'all':!![]}];}return db[_0x53d0('0x40')]['findAll'](_0x3b4d18);})[_0x53d0('0x1c')](function(_0x340933){_0x396584[_0x53d0('0x98')]=_0x340933;return _0x396584;});}})[_0x53d0('0x1c')](respondWithFilteredResult(_0x4556d8,_0x3b4d18))[_0x53d0('0x26')](handleError(_0x4556d8,null));};exports[_0x53d0('0x99')]=function(_0x3b8b2a,_0x459b24){var _0x55a5ec={'raw':!![],'where':{}};var _0x2ef241={};var _0x26b33f={'count':0x0,'rows':[]};return db[_0x53d0('0x27')]['findOne']({'where':{'id':_0x3b8b2a[_0x53d0('0x29')]['id']}})[_0x53d0('0x1c')](handleEntityNotFound(_0x459b24,null))[_0x53d0('0x1c')](function(_0x1d6d2b){if(_0x1d6d2b){_0x2ef241[_0x53d0('0x79')]=_[_0x53d0('0x2a')](db[_0x53d0('0x9a')][_0x53d0('0x93')]);_0x2ef241[_0x53d0('0x25')]=_['keys'](_0x3b8b2a['query']);_0x2ef241[_0x53d0('0x94')]=_[_0x53d0('0x7b')](_0x2ef241[_0x53d0('0x79')],_0x2ef241['query']);_0x55a5ec[_0x53d0('0x7a')]=_[_0x53d0('0x7b')](_0x2ef241['model'],qs[_0x53d0('0x7c')](_0x3b8b2a[_0x53d0('0x25')][_0x53d0('0x7c')]));_0x55a5ec[_0x53d0('0x7a')]=_0x55a5ec['attributes'][_0x53d0('0x2b')]?_0x55a5ec[_0x53d0('0x7a')]:_0x2ef241[_0x53d0('0x79')];if(!_0x3b8b2a[_0x53d0('0x25')][_0x53d0('0x37')](_0x53d0('0x80'))){_0x55a5ec[_0x53d0('0x14')]=qs[_0x53d0('0x14')](_0x3b8b2a['query'][_0x53d0('0x14')]);_0x55a5ec[_0x53d0('0x16')]=qs['offset'](_0x3b8b2a[_0x53d0('0x25')][_0x53d0('0x16')]);}_0x55a5ec[_0x53d0('0x7d')]=qs[_0x53d0('0x9b')](_0x3b8b2a[_0x53d0('0x25')][_0x53d0('0x9b')]);_0x55a5ec['where']=qs['filters'](_[_0x53d0('0x7e')](_0x3b8b2a[_0x53d0('0x25')],_0x2ef241[_0x53d0('0x94')]));_0x55a5ec[_0x53d0('0x5b')][_0x53d0('0x95')]=_0x1d6d2b['id'];if(_0x3b8b2a[_0x53d0('0x25')]['filter']){_0x55a5ec[_0x53d0('0x5b')]=_[_0x53d0('0x38')](_0x55a5ec['where'],{'$or':_['map'](_0x55a5ec[_0x53d0('0x7a')],function(_0x4ad67f){var _0x1798a0={};_0x1798a0[_0x4ad67f]={'$like':'%'+_0x3b8b2a['query']['filter']+'%'};return _0x1798a0;})});}_0x55a5ec=_[_0x53d0('0x38')]({},_0x55a5ec,_0x3b8b2a[_0x53d0('0x7f')]);return db[_0x53d0('0x9a')][_0x53d0('0x15')]({'where':_0x55a5ec[_0x53d0('0x5b')]})[_0x53d0('0x1c')](function(_0x267828){_0x26b33f['count']=_0x267828;if(_0x3b8b2a[_0x53d0('0x25')][_0x53d0('0x9c')]){_0x55a5ec[_0x53d0('0x97')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x53d0('0x30')](_0x55a5ec);})['then'](function(_0x42eebf){_0x26b33f[_0x53d0('0x98')]=_0x42eebf;return _0x26b33f;});}})[_0x53d0('0x1c')](respondWithFilteredResult(_0x459b24,_0x55a5ec))[_0x53d0('0x26')](handleError(_0x459b24,null));};exports[_0x53d0('0x9d')]=function(_0x8f5b6b,_0x150cd0){var _0x5a36e4={'raw':!![],'where':{}};var _0x10d6cd={};var _0x522444={'count':0x0,'rows':[]};return db['CmContact'][_0x53d0('0x78')]({'where':{'id':_0x8f5b6b[_0x53d0('0x29')]['id']}})[_0x53d0('0x1c')](handleEntityNotFound(_0x150cd0,null))[_0x53d0('0x1c')](function(_0x31a8e6){if(_0x31a8e6){_0x10d6cd[_0x53d0('0x79')]=_[_0x53d0('0x2a')](db[_0x53d0('0x9e')]['rawAttributes']);_0x10d6cd[_0x53d0('0x25')]=_['keys'](_0x8f5b6b[_0x53d0('0x25')]);_0x10d6cd[_0x53d0('0x94')]=_[_0x53d0('0x7b')](_0x10d6cd[_0x53d0('0x79')],_0x10d6cd[_0x53d0('0x25')]);_0x5a36e4['attributes']=_[_0x53d0('0x7b')](_0x10d6cd[_0x53d0('0x79')],qs[_0x53d0('0x7c')](_0x8f5b6b[_0x53d0('0x25')][_0x53d0('0x7c')]));_0x5a36e4[_0x53d0('0x7a')]=_0x5a36e4['attributes'][_0x53d0('0x2b')]?_0x5a36e4[_0x53d0('0x7a')]:_0x10d6cd['model'];if(!_0x8f5b6b['query'][_0x53d0('0x37')]('nolimit')){_0x5a36e4[_0x53d0('0x14')]=qs['limit'](_0x8f5b6b[_0x53d0('0x25')][_0x53d0('0x14')]);_0x5a36e4[_0x53d0('0x16')]=qs[_0x53d0('0x16')](_0x8f5b6b[_0x53d0('0x25')][_0x53d0('0x16')]);}_0x5a36e4['order']=qs[_0x53d0('0x9b')](_0x8f5b6b['query']['sort']);_0x5a36e4[_0x53d0('0x5b')]=qs['filters'](_['pick'](_0x8f5b6b[_0x53d0('0x25')],_0x10d6cd['filters']));_0x5a36e4[_0x53d0('0x5b')]['ContactId']=_0x31a8e6['id'];if(_0x8f5b6b[_0x53d0('0x25')][_0x53d0('0x96')]){_0x5a36e4[_0x53d0('0x5b')]=_[_0x53d0('0x38')](_0x5a36e4[_0x53d0('0x5b')],{'$or':_[_0x53d0('0x6b')](_0x5a36e4[_0x53d0('0x7a')],function(_0x4ffbac){var _0x558521={};_0x558521[_0x4ffbac]={'$like':'%'+_0x8f5b6b['query'][_0x53d0('0x96')]+'%'};return _0x558521;})});}_0x5a36e4=_['merge']({},_0x5a36e4,_0x8f5b6b[_0x53d0('0x7f')]);return db[_0x53d0('0x9e')]['count']({'where':_0x5a36e4[_0x53d0('0x5b')]})[_0x53d0('0x1c')](function(_0x5bba41){_0x522444[_0x53d0('0x15')]=_0x5bba41;if(_0x8f5b6b[_0x53d0('0x25')][_0x53d0('0x9c')]){_0x5a36e4[_0x53d0('0x97')]=[{'all':!![]}];}return db[_0x53d0('0x9e')][_0x53d0('0x30')](_0x5a36e4);})[_0x53d0('0x1c')](function(_0x4895ed){_0x522444[_0x53d0('0x98')]=_0x4895ed;return _0x522444;});}})[_0x53d0('0x1c')](respondWithFilteredResult(_0x150cd0,_0x5a36e4))['catch'](handleError(_0x150cd0,null));};exports[_0x53d0('0x9f')]=function(_0x527573,_0x10fd69){var _0xd682d4={'raw':!![],'where':{}};var _0x2ed3e7={};var _0x2810bc={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x527573[_0x53d0('0x29')]['id']}})[_0x53d0('0x1c')](handleEntityNotFound(_0x10fd69,null))[_0x53d0('0x1c')](function(_0x240df0){if(_0x240df0){_0x2ed3e7[_0x53d0('0x79')]=_['keys'](db[_0x53d0('0x4f')]['rawAttributes']);_0x2ed3e7[_0x53d0('0x25')]=_[_0x53d0('0x2a')](_0x527573[_0x53d0('0x25')]);_0x2ed3e7['filters']=_[_0x53d0('0x7b')](_0x2ed3e7[_0x53d0('0x79')],_0x2ed3e7[_0x53d0('0x25')]);_0xd682d4[_0x53d0('0x7a')]=_[_0x53d0('0x7b')](_0x2ed3e7[_0x53d0('0x79')],qs[_0x53d0('0x7c')](_0x527573[_0x53d0('0x25')]['fields']));_0xd682d4['attributes']=_0xd682d4[_0x53d0('0x7a')][_0x53d0('0x2b')]?_0xd682d4[_0x53d0('0x7a')]:_0x2ed3e7[_0x53d0('0x79')];if(!_0x527573[_0x53d0('0x25')][_0x53d0('0x37')](_0x53d0('0x80'))){_0xd682d4[_0x53d0('0x14')]=qs[_0x53d0('0x14')](_0x527573[_0x53d0('0x25')]['limit']);_0xd682d4[_0x53d0('0x16')]=qs[_0x53d0('0x16')](_0x527573[_0x53d0('0x25')]['offset']);}_0xd682d4[_0x53d0('0x7d')]=qs[_0x53d0('0x9b')](_0x527573[_0x53d0('0x25')][_0x53d0('0x9b')]);_0xd682d4[_0x53d0('0x5b')]=qs[_0x53d0('0x94')](_[_0x53d0('0x7e')](_0x527573[_0x53d0('0x25')],_0x2ed3e7['filters']));_0xd682d4[_0x53d0('0x5b')][_0x53d0('0x95')]=_0x240df0['id'];if(_0x527573[_0x53d0('0x25')][_0x53d0('0x96')]){_0xd682d4['where']=_[_0x53d0('0x38')](_0xd682d4[_0x53d0('0x5b')],{'$or':_[_0x53d0('0x6b')](_0xd682d4['attributes'],function(_0x21bfc0){var _0x4ddcf1={};_0x4ddcf1[_0x21bfc0]={'$like':'%'+_0x527573[_0x53d0('0x25')][_0x53d0('0x96')]+'%'};return _0x4ddcf1;})});}_0xd682d4=_['merge']({},_0xd682d4,_0x527573[_0x53d0('0x7f')]);return db[_0x53d0('0x4f')]['count']({'where':_0xd682d4[_0x53d0('0x5b')]})[_0x53d0('0x1c')](function(_0x1248c9){_0x2810bc[_0x53d0('0x15')]=_0x1248c9;if(_0x527573['query'][_0x53d0('0x9c')]){_0xd682d4[_0x53d0('0x97')]=[{'all':!![]}];}return db[_0x53d0('0x4f')]['findAll'](_0xd682d4);})[_0x53d0('0x1c')](function(_0x111bec){_0x2810bc[_0x53d0('0x98')]=_0x111bec;return _0x2810bc;});}})[_0x53d0('0x1c')](respondWithFilteredResult(_0x10fd69,_0xd682d4))[_0x53d0('0x26')](handleError(_0x10fd69,null));};exports['uploadCsv']=function(_0x5677fe,_0x15d763){try{if(!_0x5677fe[_0x53d0('0x39')][_0x53d0('0x5d')]){throw new Error(_0x53d0('0xa0'));}if(!_0x5677fe[_0x53d0('0x39')][_0x53d0('0xa1')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x5677fe[_0x53d0('0x39')][_0x53d0('0xa2')]){throw new Error(_0x53d0('0xa3'));}if(!_0x5677fe[_0x53d0('0x39')][_0x53d0('0xa4')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x28f2d7=_0x5677fe[_0x53d0('0x39')][_0x53d0('0xa1')]['split'](',');var _0x5a29ab=_0x5677fe[_0x53d0('0x39')]['binding_values']['split'](',');if(!_0x28f2d7[_0x53d0('0x2b')]||!_0x5a29ab[_0x53d0('0x2b')]||_0x28f2d7[_0x53d0('0x2b')]!==_0x5a29ab['length']){throw new Error(_0x53d0('0xa5'));}_0x5677fe['body'][_0x53d0('0x7c')]=_[_0x53d0('0xa6')](_0x28f2d7,_0x5a29ab);if(!_0x5677fe[_0x53d0('0x39')][_0x53d0('0x7c')][_0x53d0('0x76')]){throw new Error(_0x53d0('0xa7'));}if(!_0x5677fe[_0x53d0('0x39')][_0x53d0('0x7c')][_0x53d0('0xa8')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x484853=path[_0x53d0('0x3e')](config[_0x53d0('0xa9')],_0x53d0('0xaa'),_0x5677fe[_0x53d0('0xab')][_0x53d0('0xac')]);fs['chmodSync'](_0x484853,parseInt(_0x53d0('0xad'),0x8));var _0x1d5739=require('child_process')['fork'](path[_0x53d0('0x3e')](__dirname,_0x53d0('0xae')),[_0x484853,_0x5677fe[_0x53d0('0x39')][_0x53d0('0xa1')],_0x5677fe[_0x53d0('0x39')]['binding_values'],_0x5677fe[_0x53d0('0x39')][_0x53d0('0x5d')],_0x5677fe['body'][_0x53d0('0xaf')],_0x5677fe['body'][_0x53d0('0x5a')],_0x5677fe[_0x53d0('0x39')][_0x53d0('0xa4')]]);return _0x15d763['status'](0xc8)['json']({'message':_0x53d0('0xb0'),'pid':_0x1d5739[_0x53d0('0xb1')]});}catch(_0x31d64c){return _0x15d763[_0x53d0('0x17')](0x1f4)['send'](_0x31d64c);}};exports[_0x53d0('0xb2')]=function(_0x187c09,_0xa81ae5){var _0x3a3791=fs[_0x53d0('0xb3')](_0x187c09['file'][_0x53d0('0x3')]);Papa['parse'](_0x3a3791,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x16ed2d){return _0xa81ae5[_0x53d0('0x17')](0xc8)[_0x53d0('0x1a')]({'file':_0x187c09[_0x53d0('0xab')],'fields':_0x16ed2d[_0x53d0('0xb4')][_0x53d0('0x7c')]});}});};exports[_0x53d0('0xb5')]=function(_0x1ddf9c,_0xd2f928){return db[_0x53d0('0xb6')][_0x53d0('0x30')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x53d0('0x1c')](function(_0x526afe){var _0x5d6470=![];if(!_0x1ddf9c['body']['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x1ddf9c[_0x53d0('0x39')][_0x53d0('0xb7')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x1ddf9c[_0x53d0('0x39')]['binding'][_0x53d0('0xa8')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x1ddf9c['body']['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x2825d5=require(_0x53d0('0xb8'))[_0x53d0('0xb9')](path[_0x53d0('0x3e')](__dirname,'../../components/import/cm/csv2'),[_0x1ddf9c['params']['id'],JSON[_0x53d0('0xba')](_0x1ddf9c[_0x53d0('0x39')]),JSON[_0x53d0('0xba')](_0x526afe)]);_0x2825d5['on'](_0x53d0('0xbb'),function(){_0x5d6470=!![];return _0xd2f928['status'](0xc8)[_0x53d0('0x1a')]({'message':_0x53d0('0xbc'),'pid':_0x2825d5[_0x53d0('0xb1')]});});_0x2825d5['on']('exit',function(_0x37b1fd){if(_0x37b1fd&&!_0x5d6470){return _0xd2f928[_0x53d0('0x17')](0x1f4)['json']({'message':'error\x20child\x20process','pid':_0x2825d5[_0x53d0('0xb1')]});}});})[_0x53d0('0x26')](handleError(_0xd2f928,null));};exports[_0x53d0('0xbd')]=function(_0x29a5f6,_0x22bc2f){return db[_0x53d0('0xb6')][_0x53d0('0x30')]({'raw':!![],'attributes':['id'],'where':{'role':_0x53d0('0xbe')}})['then'](function(_0x1662f4){var _0x1b8b9f=![];if(!_0x29a5f6[_0x53d0('0x39')][_0x53d0('0x5d')]){throw new Error(_0x53d0('0xa0'));}if(!_0x29a5f6['body']['binding']['phone']){throw new Error(_0x53d0('0xa7'));}if(!_0x29a5f6[_0x53d0('0x39')][_0x53d0('0xb7')][_0x53d0('0xa8')]){throw new Error(_0x53d0('0xbf'));}if(!_0x29a5f6[_0x53d0('0x39')][_0x53d0('0xa4')]){throw new Error(_0x53d0('0xc0'));}var _0x46203b=require('child_process')[_0x53d0('0xb9')](path[_0x53d0('0x3e')](__dirname,_0x53d0('0xc1')),[_0x29a5f6['params']['id'],JSON[_0x53d0('0xba')](_0x29a5f6[_0x53d0('0x39')]),JSON[_0x53d0('0xba')](_0x1662f4)]);_0x46203b['on'](_0x53d0('0xbb'),function(){_0x1b8b9f=!![];return _0x22bc2f[_0x53d0('0x17')](0xc8)[_0x53d0('0x1a')]({'message':_0x53d0('0xbc'),'pid':_0x46203b['pid']});});_0x46203b['on'](_0x53d0('0xc2'),function(_0x5a5afe){if(_0x5a5afe&&!_0x1b8b9f){return _0x22bc2f[_0x53d0('0x17')](0x1f4)['json']({'message':_0x53d0('0xc3'),'pid':_0x46203b[_0x53d0('0xb1')]});}});})[_0x53d0('0x26')](handleError(_0x22bc2f,null));};exports[_0x53d0('0xc4')]=function(_0x2de4e0,_0x4bf1e9){var _0x39b0b3=[_0x53d0('0xc5'),_0x53d0('0xc6'),_0x53d0('0xc7'),_0x53d0('0xc8'),_0x53d0('0xc9'),_0x53d0('0xca'),'voice'];var _0x212882={'offset':0x0,'order':qs[_0x53d0('0x9b')]('-createdAt')},_0x246940={'count':0x0,'rows':[]};Promise[_0x53d0('0xcb')]()[_0x53d0('0x1c')](function(){if(_0x2de4e0[_0x53d0('0x25')][_0x53d0('0xcc')]){if(!_[_0x53d0('0xcd')](_0x39b0b3,_0x2de4e0[_0x53d0('0x25')][_0x53d0('0xcc')]['toLowerCase']())){throw new Error(_0x53d0('0xce'));}_0x39b0b3=[_0x2de4e0[_0x53d0('0x25')][_0x53d0('0xcc')][_0x53d0('0xcf')]()];}if(_0x2de4e0['query']['range']){try{var _0xb69c87=JSON[_0x53d0('0xd0')](_0x2de4e0[_0x53d0('0x25')]['range']);if(!moment(_0xb69c87['from'])[_0x53d0('0xd1')]()){throw new Error(_0x53d0('0xd2'));}if(!moment(_0xb69c87['to'])['isValid']()){throw new Error(_0x53d0('0xd3'));}}catch(_0xd496dd){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x2de4e0[_0x53d0('0x25')][_0x53d0('0x37')]('nolimit')){_0x212882[_0x53d0('0x14')]=qs['limit'](_0x2de4e0['query'][_0x53d0('0x14')]||0xa);_0x212882['offset']=qs[_0x53d0('0x16')](_0x2de4e0[_0x53d0('0x25')][_0x53d0('0x16')]);}var _0x29ddf5=_0x39b0b3[_0x53d0('0x6b')](function(_0x5973aa){if(_0x5973aa==='voice'){var _0xa57e77={'attributes':['id',_0x53d0('0xd4'),_0x53d0('0x33'),'source',_0x53d0('0xd5'),_0x53d0('0xd6'),_0x53d0('0xd7'),_0x53d0('0xd8'),'duration',_0x53d0('0xd9'),_0x53d0('0xda'),_0x53d0('0xdb'),_0x53d0('0xdc'),_0x53d0('0xdd'),_0x53d0('0xde')],'where':{'ContactId':_0x2de4e0[_0x53d0('0x29')]['id']},'include':[{'model':db[_0x53d0('0xb6')],'as':_0x53d0('0xb6'),'attributes':['id','name',_0x53d0('0xdf'),_0x53d0('0x31')]}],'order':[[_0x53d0('0xda'),_0x53d0('0xe0')]]};if(_0x2de4e0[_0x53d0('0x25')][_0x53d0('0xe1')]){_0xa57e77[_0x53d0('0x5b')]['createdAt']={'$gte':_0xb69c87[_0x53d0('0x3a')],'$lte':_0xb69c87['to']};}return db[_0x53d0('0x4c')]['findAndCountAll'](_0xa57e77)[_0x53d0('0x1c')](function(_0x51c941){_0x246940[_0x53d0('0x15')]+=_0x51c941[_0x53d0('0x15')];return _[_0x53d0('0x6b')](_0x51c941[_0x53d0('0x98')],function(_0xf405ca){var _0xe86435=_0xf405ca['get']({'plain':!![]});_0xe86435[_0x53d0('0xcc')]=_0x5973aa;if(_0xe86435[_0x53d0('0xb6')]){_0xe86435[_0x53d0('0xb6')]={'id':_0xe86435['User']['id'],'name':_0xe86435[_0x53d0('0xb6')][_0x53d0('0x21')],'fullname':_0xe86435[_0x53d0('0xb6')][_0x53d0('0xdf')],'alias':_0xe86435[_0x53d0('0xb6')][_0x53d0('0x31')]};}return _0xe86435;});});}else{var _0x2a9a9e=_['startCase'](_0x5973aa)+(_0x5973aa==='chat'?_0x53d0('0xe2'):_0x53d0('0xe3'));var _0x4fdca5={'attributes':['id','closed','closedAt','createdAt',_0x53d0('0xd9'),_0x53d0('0xe4'),_0x53d0('0xe5'),_0x53d0('0xe6'),_0x53d0('0xde'),_0x2a9a9e+'Id'],'where':{'ContactId':_0x2de4e0[_0x53d0('0x29')]['id']},'include':[{'model':db[_0x2a9a9e],'as':_0x53d0('0xe3'),'attributes':['id',_0x53d0('0x21'),'key']},{'model':db[_0x53d0('0xb6')],'as':'Owner','attributes':['id',_0x53d0('0x21'),_0x53d0('0xdf')]},{'model':db[_0x53d0('0x62')],'as':'Tags','attributes':['id',_0x53d0('0x21'),_0x53d0('0x64')],'through':{'attributes':[]}}],'order':[[_0x53d0('0xda'),'DESC']]};if(_0x2de4e0[_0x53d0('0x25')][_0x53d0('0xe1')]){_0x4fdca5[_0x53d0('0x5b')][_0x53d0('0xda')]={'$gte':_0xb69c87[_0x53d0('0x3a')],'$lte':_0xb69c87['to']};}switch(_0x5973aa){case _0x53d0('0xc6'):_0x4fdca5[_0x53d0('0x7a')][_0x53d0('0x5f')](_0x53d0('0xe7'),_0x53d0('0xe8'),_0x53d0('0xe9'),_0x53d0('0xea'),'osName',_0x53d0('0xeb'),_0x53d0('0xec'),_0x53d0('0xed'),_0x53d0('0xee'));break;case _0x53d0('0xc5'):_0x4fdca5['attributes'][_0x53d0('0x5f')](_0x53d0('0xef'),'substatus');break;case _0x53d0('0xc8'):_0x4fdca5[_0x53d0('0x7a')]['push']('externalUrl',_0x53d0('0xf0'));break;}return db[_['startCase'](_0x5973aa)+_0x53d0('0xf1')][_0x53d0('0xf2')](_0x4fdca5)[_0x53d0('0x1c')](function(_0x796ff3){_0x246940['count']+=_0x796ff3[_0x53d0('0x15')];return _['map'](_0x796ff3[_0x53d0('0x98')],function(_0x30d6a1){var _0x2c3522=_0x30d6a1[_0x53d0('0x3b')]({'plain':!![]});_0x2c3522[_0x53d0('0xcc')]=_0x5973aa;if(_0x2c3522[_0x53d0('0xf3')]){_0x2c3522['Owner']={'id':_0x2c3522[_0x53d0('0xf3')]['id'],'name':_0x2c3522['Owner'][_0x53d0('0x21')],'fullname':_0x2c3522[_0x53d0('0xf3')][_0x53d0('0xdf')]};}return _0x2c3522;});});}});return Promise[_0x53d0('0x61')](_0x29ddf5);})[_0x53d0('0x1c')](function(_0x4900aa){return _(_0x4900aa)[_0x53d0('0xf4')]()['sortBy'](_0x53d0('0xda'))[_0x53d0('0xf5')]()['value']();})['then'](function(_0x1f468b){_0x246940['rows']=_0x212882[_0x53d0('0x14')]?_0x1f468b['slice'](_0x212882[_0x53d0('0x16')],_0x212882[_0x53d0('0x16')]+_0x212882[_0x53d0('0x14')]):_0x1f468b;return _0x246940;})[_0x53d0('0x1c')](respondWithFilteredResult(_0x4bf1e9,_0x212882))[_0x53d0('0x26')](handleError(_0x4bf1e9,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 57211f7..ccc6ed1 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 _0x3c67=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','update','remove'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x3c67,0x15c));var _0x73c6=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x3c67[_0x209941];return _0x1e8729;};'use strict';var EventEmitter=require(_0x73c6('0x0'));var CmContact=require('../../mysqldb')['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x73c6('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x73c6('0x2'),'afterDestroy':_0x73c6('0x3')};function emitEvent(_0x52981e){return function(_0x6819f4,_0x471b48,_0x39832d){CmContactEvents[_0x73c6('0x4')](_0x52981e+':'+_0x6819f4['id'],_0x6819f4);CmContactEvents[_0x73c6('0x4')](_0x52981e,_0x6819f4);_0x39832d(null);};}for(var e in events){if(events[_0x73c6('0x5')](e)){var event=events[e];CmContact[_0x73c6('0x6')](e,emitEvent(event));}}module[_0x73c6('0x7')]=CmContactEvents; \ No newline at end of file +var _0x5acf=['update','remove','emit','hook','../../mysqldb','CmContact','setMaxListeners','save'];(function(_0x281a31,_0x3022b9){var _0xcb8c6d=function(_0x57959a){while(--_0x57959a){_0x281a31['push'](_0x281a31['shift']());}};_0xcb8c6d(++_0x3022b9);}(_0x5acf,0x1cc));var _0xf5ac=function(_0xd7a900,_0x9e1e7e){_0xd7a900=_0xd7a900-0x0;var _0x585433=_0x5acf[_0xd7a900];return _0x585433;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xf5ac('0x0'))['db'][_0xf5ac('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xf5ac('0x2')](0x0);var events={'afterCreate':_0xf5ac('0x3'),'afterUpdate':_0xf5ac('0x4'),'afterDestroy':_0xf5ac('0x5')};function emitEvent(_0x2403a3){return function(_0x17cd73,_0x413824,_0x37a304){CmContactEvents[_0xf5ac('0x6')](_0x2403a3+':'+_0x17cd73['id'],_0x17cd73);CmContactEvents[_0xf5ac('0x6')](_0x2403a3,_0x17cd73);_0x37a304(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0xf5ac('0x7')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 3aa3e27..3632deb 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 _0x0d83=['destroy','ContactId','VoiceQueueId','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','bluebird','request-promise','path','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','lastName','mobile','fax','email','FULLTEXT','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','VoiceQueue','then','dialTimezone','timezones','utcOffset','add','minutes','ret','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','priority','format','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','ListId','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','CmList','dialCheckDuplicateType','onlyIfOpen','CmHopperBlack','cmContact,\x20%s,\x20%s','length','always','BlackLists','List\x20not\x20found'];(function(_0x196a2f,_0x2818e5){var _0x55867a=function(_0x45f536){while(--_0x45f536){_0x196a2f['push'](_0x196a2f['shift']());}};_0x55867a(++_0x2818e5);}(_0x0d83,0xdd));var _0x30d8=function(_0x5360ea,_0x28c9d3){_0x5360ea=_0x5360ea-0x0;var _0x5a5d6f=_0x0d83[_0x5360ea];return _0x5a5d6f;};'use strict';var _=require(_0x30d8('0x0'));var util=require(_0x30d8('0x1'));var logger=require(_0x30d8('0x2'))(_0x30d8('0x3'));var moment=require('moment');var BPromise=require(_0x30d8('0x4'));var rp=require(_0x30d8('0x5'));var fs=require('fs');var path=require(_0x30d8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var shared=require('../../config/environment/shared');var attributes=require(_0x30d8('0x7'));module[_0x30d8('0x8')]=function(_0x4fbdff,_0x4929cb){return _0x4fbdff[_0x30d8('0x9')](_0x30d8('0xa'),attributes,{'tableName':_0x30d8('0xb'),'paranoid':!![],'indexes':[{'name':_0x30d8('0xc'),'fields':[_0x30d8('0xc')]},{'name':_0x30d8('0xd'),'fields':['firstName',_0x30d8('0xe'),_0x30d8('0xc'),_0x30d8('0xf'),_0x30d8('0x10'),_0x30d8('0x11')],'type':_0x30d8('0x12')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x30d8('0x13'),'hooks':{'afterCreate':function(_0x15ca5b,_0x9f8651,_0x2ad45b){var _0x9ad17d=_0x4fbdff[_0x30d8('0x14')];var _0x2b5fe4=_0x15ca5b[_0x30d8('0x15')]({'plain':!![]});function _0x2c9ba8(){return function(_0x3b97dc){logger[_0x30d8('0x16')](_0x30d8('0x17'),_0x30d8('0x18'),util[_0x30d8('0x19')](_0x3b97dc,{'showHidden':![],'depth':null}));};}function _0x49f883(_0x136cf7,_0x30a0cb){var _0x4e6597=_0x30a0cb[_0x30d8('0x1a')]?_0x30a0cb['scheduledat']:moment()['format'](_0x30d8('0x1b'));return new BPromise(function(_0x1877c2,_0x3be58e){if(_[_0x30d8('0x1c')](_0x30a0cb['dialTimezone'])){_0x1877c2({'ret':_0x4e6597});}else{_0x9ad17d[_0x30d8('0x1d')]['findOne']({'where':{'id':_0x136cf7['id']}})[_0x30d8('0x1e')](function(_0xa07bd5){if(!_['isNil'](_0xa07bd5)){var _0x32ccb8=_0xa07bd5[_0x30d8('0x1f')];if(!_[_0x30d8('0x1c')](_0x32ccb8)){var _0x39cf9f=shared[_0x30d8('0x20')];var _0x40faf1=_0x39cf9f[_0x32ccb8];var _0x240467=_0x39cf9f[_0x30a0cb[_0x30d8('0x1f')]];if(!_['isNil'](_0x40faf1)&&!_[_0x30d8('0x1c')](_0x240467)){var _0x480a37=_0x40faf1[_0x30d8('0x21')]-_0x240467[_0x30d8('0x21')];_0x4e6597=_0x30a0cb[_0x30d8('0x1a')]?_0x30a0cb[_0x30d8('0x1a')]:moment();var _0x20bb76=moment(_0x4e6597)[_0x30d8('0x22')](_0x480a37,_0x30d8('0x23'));_0x1877c2({'ret':_0x20bb76['format'](_0x30d8('0x1b'))});}else _0x1877c2({'ret':_0x4e6597});}else _0x1877c2({'ret':_0x4e6597});}else{_0x1877c2({'ret':_0x4e6597});}});}});return 0xa;}var _0x1da51e=function(_0x15bd94){return new BPromise(function(_0x27f7ca,_0x132cd4){_0x49f883(_0x15bd94,_0x2b5fe4)['then'](function(_0x1669d8){_0x2b5fe4[_0x30d8('0x1a')]=_0x1669d8[_0x30d8('0x24')];_0x9ad17d['CmHopper'][_0x30d8('0x25')]({'where':{'phone':_0x2b5fe4[_0x30d8('0xc')],'VoiceQueueId':_0x15bd94['id']}})[_0x30d8('0x1e')](function(_0x1f2739){if(!_[_0x30d8('0x1c')](_0x1f2739)){throw new Error(_0x30d8('0x26')+_0x2b5fe4[_0x30d8('0xc')]+_0x30d8('0x27')+_0x15bd94['id']);}return _0x9ad17d[_0x30d8('0x28')][_0x30d8('0x29')]({'phone':_0x2b5fe4[_0x30d8('0xc')],'ContactId':_0x2b5fe4['id'],'ListId':_0x2b5fe4['ListId'],'priority':_0x2b5fe4[_0x30d8('0x2a')]?_0x2b5fe4[_0x30d8('0x2a')]:0x2,'scheduledat':_0x2b5fe4[_0x30d8('0x1a')]?_0x2b5fe4[_0x30d8('0x1a')]:moment()[_0x30d8('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2b5fe4['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2b5fe4[_0x30d8('0x2c')]?_0x2b5fe4[_0x30d8('0x2c')]:undefined,'callbackat':_0x2b5fe4['callbackUniqueid']?moment()[_0x30d8('0x2b')](_0x30d8('0x1b')):undefined,'VoiceQueueId':_0x15bd94['id']});})[_0x30d8('0x2d')](function(_0x429594){_0x132cd4(_0x429594);});});});};var _0x48130c=function(_0x50ab26){return new BPromise(function(_0x351d47,_0x3646f3){_0x49f883(_0x50ab26,_0x2b5fe4)[_0x30d8('0x1e')](function(_0x1fc61c){_0x2b5fe4[_0x30d8('0x1a')]=_0x1fc61c[_0x30d8('0x24')];_0x9ad17d[_0x30d8('0x28')][_0x30d8('0x25')]({'where':{'phone':_0x2b5fe4[_0x30d8('0xc')],'VoiceQueueId':_0x50ab26['id']}})[_0x30d8('0x1e')](function(_0x4f4e1d){if(!_[_0x30d8('0x1c')](_0x4f4e1d)){throw new Error(_0x30d8('0x26')+_0x2b5fe4[_0x30d8('0xc')]+_0x30d8('0x2e')+_0x50ab26['id']);}return _0x9ad17d[_0x30d8('0x2f')][_0x30d8('0x25')]({'where':{'calleridnum':_0x2b5fe4['phone'],'VoiceQueueId':_0x50ab26['id']}});})['then'](function(_0x57b913){if(!_[_0x30d8('0x1c')](_0x57b913)){throw new Error(_0x30d8('0x30')+_0x2b5fe4[_0x30d8('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x50ab26['id']);}return _0x9ad17d[_0x30d8('0x28')]['create']({'phone':_0x2b5fe4[_0x30d8('0xc')],'ContactId':_0x2b5fe4['id'],'ListId':_0x2b5fe4[_0x30d8('0x31')],'priority':_0x2b5fe4['priority']?_0x2b5fe4[_0x30d8('0x2a')]:0x2,'scheduledat':_0x2b5fe4[_0x30d8('0x1a')]?_0x2b5fe4[_0x30d8('0x1a')]:moment()[_0x30d8('0x2b')](_0x30d8('0x1b')),'callback':_0x2b5fe4[_0x30d8('0x2c')]?!![]:![],'callbackuniqueid':_0x2b5fe4['callbackUniqueid']?_0x2b5fe4[_0x30d8('0x2c')]:undefined,'callbackat':_0x2b5fe4[_0x30d8('0x2c')]?moment()['format'](_0x30d8('0x1b')):undefined,'VoiceQueueId':_0x50ab26['id']});})[_0x30d8('0x2d')](function(_0x4ec609){_0x3646f3(_0x4ec609);});});});};function _0x1fc464(){return function(_0x583eb4){logger['error'](_0x30d8('0x17'),'afterCreate',util[_0x30d8('0x19')](_0x583eb4,{'showHidden':![],'depth':null}));};}function _0x28f976(_0x292918,_0x58adfd){var _0x17a1d6=_0x58adfd[_0x30d8('0x1a')]?_0x58adfd[_0x30d8('0x1a')]:moment()['format'](_0x30d8('0x1b'));return new BPromise(function(_0x2280fb,_0x55ed43){if(_[_0x30d8('0x1c')](_0x58adfd[_0x30d8('0x1f')])){_0x2280fb({'ret':_0x17a1d6});}else{_0x9ad17d[_0x30d8('0x32')][_0x30d8('0x25')]({'where':{'id':_0x292918['id']}})[_0x30d8('0x1e')](function(_0xd602c5){if(!_['isNil'](_0xd602c5)){var _0x4ed849=_0xd602c5['dialTimezone'];if(!_['isNil'](_0x4ed849)){var _0x14f498=shared[_0x30d8('0x20')];var _0x2abe2c=_0x14f498[_0x4ed849];var _0x560220=_0x14f498[_0x58adfd['dialTimezone']];if(!_['isNil'](_0x2abe2c)&&!_[_0x30d8('0x1c')](_0x560220)){var _0x1e2fa9=_0x2abe2c[_0x30d8('0x21')]-_0x560220['utcOffset'];_0x17a1d6=_0x58adfd[_0x30d8('0x1a')]?_0x58adfd['scheduledat']:moment();var _0x5135c0=moment(_0x17a1d6)[_0x30d8('0x22')](_0x1e2fa9,_0x30d8('0x23'));_0x2280fb({'ret':_0x5135c0[_0x30d8('0x2b')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x2280fb({'ret':_0x17a1d6});}else _0x2280fb({'ret':_0x17a1d6});}else{_0x2280fb({'ret':_0x17a1d6});}});}});return 0xa;}var _0x2d2016=function(_0x5a4fa0){return new BPromise(function(_0x4da841,_0x1c8f03){_0x28f976(_0x5a4fa0,_0x2b5fe4)['then'](function(_0x203f6b){_0x2b5fe4[_0x30d8('0x1a')]=_0x203f6b['ret'];_0x9ad17d[_0x30d8('0x28')][_0x30d8('0x25')]({'where':{'phone':_0x2b5fe4[_0x30d8('0xc')],'CampaignId':_0x5a4fa0['id']}})[_0x30d8('0x1e')](function(_0x55d073){if(!_[_0x30d8('0x1c')](_0x55d073)){throw new Error(_0x30d8('0x26')+_0x2b5fe4['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x5a4fa0['id']);}return _0x9ad17d[_0x30d8('0x28')][_0x30d8('0x29')]({'phone':_0x2b5fe4['phone'],'ContactId':_0x2b5fe4['id'],'ListId':_0x2b5fe4[_0x30d8('0x31')],'priority':_0x2b5fe4[_0x30d8('0x2a')]?_0x2b5fe4[_0x30d8('0x2a')]:0x2,'scheduledat':_0x2b5fe4[_0x30d8('0x1a')]?_0x2b5fe4[_0x30d8('0x1a')]:moment()['format'](_0x30d8('0x1b')),'callback':_0x2b5fe4['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2b5fe4[_0x30d8('0x2c')]?_0x2b5fe4[_0x30d8('0x2c')]:undefined,'callbackat':_0x2b5fe4[_0x30d8('0x2c')]?moment()['format'](_0x30d8('0x1b')):undefined,'CampaignId':_0x5a4fa0['id']});})[_0x30d8('0x2d')](function(_0x4c5b83){_0x1c8f03(_0x4c5b83);});});});};var _0x298fde=function(_0x14d0f5){return new BPromise(function(_0x429ead,_0x2ac678){_0x28f976(_0x14d0f5,_0x2b5fe4)[_0x30d8('0x1e')](function(_0x1d6144){_0x2b5fe4[_0x30d8('0x1a')]=_0x1d6144[_0x30d8('0x24')];_0x9ad17d[_0x30d8('0x28')][_0x30d8('0x25')]({'where':{'phone':_0x2b5fe4['phone'],'CampaignId':_0x14d0f5['id']}})['then'](function(_0x28ea3c){if(!_[_0x30d8('0x1c')](_0x28ea3c)){throw new Error(_0x30d8('0x26')+_0x2b5fe4[_0x30d8('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x14d0f5['id']);}return _0x9ad17d['CmHopperFinal'][_0x30d8('0x25')]({'where':{'calleridnum':_0x2b5fe4['phone'],'CampaignId':_0x14d0f5['id']}});})[_0x30d8('0x1e')](function(_0x32f58f){if(!_[_0x30d8('0x1c')](_0x32f58f)){throw new Error(_0x30d8('0x30')+_0x2b5fe4[_0x30d8('0xc')]+_0x30d8('0x33')+_0x14d0f5['id']);}return _0x9ad17d[_0x30d8('0x28')][_0x30d8('0x29')]({'phone':_0x2b5fe4[_0x30d8('0xc')],'ContactId':_0x2b5fe4['id'],'ListId':_0x2b5fe4['ListId'],'priority':_0x2b5fe4['priority']?_0x2b5fe4[_0x30d8('0x2a')]:0x2,'scheduledat':_0x2b5fe4[_0x30d8('0x1a')]?_0x2b5fe4[_0x30d8('0x1a')]:moment()['format'](_0x30d8('0x1b')),'callback':_0x2b5fe4['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2b5fe4[_0x30d8('0x2c')]?_0x2b5fe4['callbackUniqueid']:undefined,'callbackat':_0x2b5fe4['callbackUniqueid']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x14d0f5['id']});})[_0x30d8('0x2d')](function(_0x28cbf8){_0x2ac678(_0x28cbf8);});});});};if(_0x2b5fe4[_0x30d8('0x31')]){_0x9ad17d[_0x30d8('0x1d')][_0x30d8('0x34')]({'where':{'type':_0x30d8('0x35')},'attributes':['id','dialCheckDuplicateType',_0x30d8('0x1f')],'include':[{'model':_0x9ad17d[_0x30d8('0x36')],'as':'Lists','where':{'id':_0x2b5fe4[_0x30d8('0x31')]}}]})[_0x30d8('0x1e')](function(_0x1394b7){if(_0x1394b7){var _0x6fd312=[];for(var _0x423531=0x0,_0x2f153f;_0x423531<_0x1394b7['length'];_0x423531+=0x1){_0x2f153f=_0x1394b7[_0x423531][_0x30d8('0x15')]({'plain':!![]});switch(_0x2f153f[_0x30d8('0x37')]){case'always':_0x48130c(_0x2f153f)['catch'](_0x2c9ba8());break;case _0x30d8('0x38'):_0x1da51e(_0x2f153f)[_0x30d8('0x2d')](_0x2c9ba8());break;default:_0x28f976(_0x2f153f,_0x2b5fe4)[_0x30d8('0x1e')](function(_0x4f7a1d){_0x2b5fe4[_0x30d8('0x1a')]=_0x4f7a1d['ret'];_0x9ad17d[_0x30d8('0x28')][_0x30d8('0x29')]({'phone':_0x2b5fe4[_0x30d8('0xc')],'ContactId':_0x2b5fe4['id'],'ListId':_0x2b5fe4[_0x30d8('0x31')],'scheduledat':_0x2b5fe4['scheduledat']?_0x2b5fe4['scheduledat']:moment()['format'](_0x30d8('0x1b')),'priority':_0x2b5fe4[_0x30d8('0x2a')]?_0x2b5fe4[_0x30d8('0x2a')]:0x2,'callback':_0x2b5fe4[_0x30d8('0x2c')]?!![]:![],'callbackuniqueid':_0x2b5fe4[_0x30d8('0x2c')]?_0x2b5fe4[_0x30d8('0x2c')]:undefined,'callbackat':_0x2b5fe4[_0x30d8('0x2c')]?moment()[_0x30d8('0x2b')](_0x30d8('0x1b')):undefined,'VoiceQueueId':_0x2f153f['id']})[_0x30d8('0x2d')](_0x2c9ba8());});}}}})['then'](function(){return _0x9ad17d['VoiceQueue'][_0x30d8('0x34')]({'where':{'type':_0x30d8('0x35')},'attributes':['id'],'include':[{'model':_0x9ad17d[_0x30d8('0x36')],'as':'BlackLists','where':{'id':_0x2b5fe4[_0x30d8('0x31')]}}]})['then'](function(_0x4f1975){if(_0x4f1975){var _0x5c0c41=[];for(var _0x29a6f7=0x0,_0x5b0041;_0x29a6f7<_0x4f1975['length'];_0x29a6f7+=0x1){_0x5b0041=_0x4f1975[_0x29a6f7]['get']({'plain':!![]});_0x9ad17d[_0x30d8('0x39')][_0x30d8('0x29')]({'phone':_0x2b5fe4[_0x30d8('0xc')],'ContactId':_0x2b5fe4['id'],'ListId':_0x2b5fe4[_0x30d8('0x31')],'VoiceQueueId':_0x5b0041['id']})[_0x30d8('0x2d')](function(_0x295c72){logger[_0x30d8('0x16')](_0x30d8('0x3a'),'afterCreate',_0x295c72['message']);});}}});})['then'](function(){return _0x9ad17d[_0x30d8('0x32')][_0x30d8('0x34')]({'attributes':['id',_0x30d8('0x37'),_0x30d8('0x1f')],'include':[{'model':_0x9ad17d[_0x30d8('0x36')],'as':'Lists','where':{'id':_0x2b5fe4[_0x30d8('0x31')]}}]})[_0x30d8('0x1e')](function(_0x6a5509){if(_0x6a5509){var _0x3b588e=[];for(var _0x49e33a=0x0,_0x44ae32;_0x49e33a<_0x6a5509[_0x30d8('0x3b')];_0x49e33a+=0x1){_0x44ae32=_0x6a5509[_0x49e33a]['get']({'plain':!![]});switch(_0x44ae32['dialCheckDuplicateType']){case _0x30d8('0x3c'):_0x298fde(_0x44ae32)[_0x30d8('0x2d')](_0x1fc464());break;case _0x30d8('0x38'):_0x2d2016(_0x44ae32)['catch'](_0x1fc464());break;default:_0x9ad17d[_0x30d8('0x28')][_0x30d8('0x29')]({'phone':_0x2b5fe4[_0x30d8('0xc')],'ContactId':_0x2b5fe4['id'],'ListId':_0x2b5fe4[_0x30d8('0x31')],'scheduledat':_0x2b5fe4[_0x30d8('0x1a')]?_0x2b5fe4[_0x30d8('0x1a')]:moment()[_0x30d8('0x2b')](_0x30d8('0x1b')),'priority':_0x2b5fe4['priority']?_0x2b5fe4[_0x30d8('0x2a')]:0x2,'callback':_0x2b5fe4['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2b5fe4[_0x30d8('0x2c')]?_0x2b5fe4[_0x30d8('0x2c')]:undefined,'callbackat':_0x2b5fe4[_0x30d8('0x2c')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x44ae32['id']})[_0x30d8('0x2d')](_0x1fc464());}}}});})['then'](function(){return _0x9ad17d['Campaign']['findAll']({'attributes':['id'],'include':[{'model':_0x9ad17d[_0x30d8('0x36')],'as':_0x30d8('0x3d'),'where':{'id':_0x2b5fe4[_0x30d8('0x31')]}}]})['then'](function(_0x3057a8){if(_0x3057a8){var _0x257f71=[];for(var _0x1cb209=0x0,_0x42f56;_0x1cb209<_0x3057a8[_0x30d8('0x3b')];_0x1cb209+=0x1){_0x42f56=_0x3057a8[_0x1cb209][_0x30d8('0x15')]({'plain':!![]});_0x9ad17d[_0x30d8('0x39')][_0x30d8('0x29')]({'phone':_0x2b5fe4['phone'],'ContactId':_0x2b5fe4['id'],'ListId':_0x2b5fe4['ListId'],'CampaignId':_0x42f56['id']})['catch'](function(_0x5ea634){logger[_0x30d8('0x16')]('cmContact,\x20%s,\x20%s','afterCreate',_0x5ea634['message']);});}}});})[_0x30d8('0x1e')](function(){_0x2ad45b();})[_0x30d8('0x2d')](function(_0x191399){logger[_0x30d8('0x16')](_0x30d8('0x3a'),_0x30d8('0x18'),_0x191399['message']);_0x2ad45b(_0x191399);});}else{_0x2ad45b(new Error(_0x30d8('0x3e')));}},'afterDestroy':function(_0x36af23,_0x4f6386,_0xcbef00){var _0x2e8b1e=_0x4fbdff[_0x30d8('0x14')];var _0x4376b6=_0x36af23[_0x30d8('0x15')]({'plain':!![]});return _0x2e8b1e[_0x30d8('0x28')]['findAll']({'raw':!![],'where':{'ListId':_0x4376b6['ListId'],'ContactId':_0x4376b6['id']}})[_0x30d8('0x1e')](function(_0x31dbfa){if(!_['isEmpty'](_0x31dbfa)){var _0x19c2a2=[];for(var _0x242ac5=0x0;_0x242ac5<_0x31dbfa['length'];_0x242ac5+=0x1){var _0x5a8a39=_0x2e8b1e[_0x30d8('0x28')][_0x30d8('0x3f')]({'where':{'ListId':_0x31dbfa[_0x242ac5][_0x30d8('0x31')],'ContactId':_0x31dbfa[_0x242ac5][_0x30d8('0x40')],'VoiceQueueId':_0x31dbfa[_0x242ac5][_0x30d8('0x41')],'CampaignId':_0x31dbfa[_0x242ac5][_0x30d8('0x42')]}});_0x19c2a2[_0x30d8('0x43')](_0x5a8a39);}return BPromise['all'](_0x19c2a2);}})[_0x30d8('0x1e')](function(_0x4d636e){logger[_0x30d8('0x44')](_0x30d8('0x45'),util[_0x30d8('0x19')](_0x4d636e,{'showHidden':![],'depth':null}));_0xcbef00();})[_0x30d8('0x2d')](function(_0x58ba4c){logger[_0x30d8('0x16')](_0x30d8('0x46'),util[_0x30d8('0x19')](_0x58ba4c,{'showHidden':![],'depth':null}));_0xcbef00(_0x58ba4c);});}}});}; \ No newline at end of file +var _0xb893=['firstName','lastName','email','utf8mb4','utf8mb4_unicode_ci','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','VoiceQueue','findOne','then','isNil','timezones','utcOffset','add','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','length','onlyIfOpen','message','Lists','always','BlackLists','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','ContactId','VoiceQueueId','push','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment/shared','./cmContact.attributes','define','cm_contacts','phone','fti_cm_contacts'];(function(_0x7da8f7,_0x20279b){var _0x5e966e=function(_0x3623c3){while(--_0x3623c3){_0x7da8f7['push'](_0x7da8f7['shift']());}};_0x5e966e(++_0x20279b);}(_0xb893,0x10b));var _0x3b89=function(_0x58973b,_0x4cef8c){_0x58973b=_0x58973b-0x0;var _0x225602=_0xb893[_0x58973b];return _0x225602;};'use strict';var _=require(_0x3b89('0x0'));var util=require(_0x3b89('0x1'));var logger=require('../../config/logger')(_0x3b89('0x2'));var moment=require(_0x3b89('0x3'));var BPromise=require(_0x3b89('0x4'));var rp=require(_0x3b89('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b89('0x6'));var config=require('../../config/environment');var shared=require(_0x3b89('0x7'));var attributes=require(_0x3b89('0x8'));module['exports']=function(_0x522283,_0xfb091e){return _0x522283[_0x3b89('0x9')]('CmContact',attributes,{'tableName':_0x3b89('0xa'),'paranoid':!![],'indexes':[{'name':_0x3b89('0xb'),'fields':[_0x3b89('0xb')]},{'name':_0x3b89('0xc'),'fields':[_0x3b89('0xd'),_0x3b89('0xe'),_0x3b89('0xb'),'mobile','fax',_0x3b89('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x3b89('0x10'),'collate':_0x3b89('0x11'),'hooks':{'afterCreate':function(_0x48f3e5,_0xf740c7,_0x4ed7a8){var _0x2be1e6=_0x522283['models'];var _0x525468=_0x48f3e5[_0x3b89('0x12')]({'plain':!![]});function _0x4b1cab(){return function(_0x199c11){logger[_0x3b89('0x13')](_0x3b89('0x14'),_0x3b89('0x15'),util[_0x3b89('0x16')](_0x199c11,{'showHidden':![],'depth':null}));};}function _0x43367f(_0x3cbdd0,_0x3c434f){var _0x1a30a5=_0x3c434f['scheduledat']?_0x3c434f[_0x3b89('0x17')]:moment()[_0x3b89('0x18')](_0x3b89('0x19'));return new BPromise(function(_0x202440,_0x4d54dc){if(_['isNil'](_0x3c434f[_0x3b89('0x1a')])){_0x202440({'ret':_0x1a30a5});}else{_0x2be1e6[_0x3b89('0x1b')][_0x3b89('0x1c')]({'where':{'id':_0x3cbdd0['id']}})[_0x3b89('0x1d')](function(_0x333b5b){if(!_['isNil'](_0x333b5b)){var _0x247ccf=_0x333b5b[_0x3b89('0x1a')];if(!_[_0x3b89('0x1e')](_0x247ccf)){var _0x158824=shared[_0x3b89('0x1f')];var _0x3b5eaa=_0x158824[_0x247ccf];var _0x1647fe=_0x158824[_0x3c434f[_0x3b89('0x1a')]];if(!_[_0x3b89('0x1e')](_0x3b5eaa)&&!_[_0x3b89('0x1e')](_0x1647fe)){var _0x24383a=_0x3b5eaa[_0x3b89('0x20')]-_0x1647fe['utcOffset'];_0x1a30a5=_0x3c434f['scheduledat']?_0x3c434f[_0x3b89('0x17')]:moment();var _0x58f817=moment(_0x1a30a5)[_0x3b89('0x21')](_0x24383a,_0x3b89('0x22'));_0x202440({'ret':_0x58f817['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x202440({'ret':_0x1a30a5});}else _0x202440({'ret':_0x1a30a5});}else{_0x202440({'ret':_0x1a30a5});}});}});return 0xa;}var _0x2e0bc1=function(_0x3b38f7){return new BPromise(function(_0x27b8cc,_0xed229d){_0x43367f(_0x3b38f7,_0x525468)[_0x3b89('0x1d')](function(_0x421bfb){_0x525468[_0x3b89('0x17')]=_0x421bfb[_0x3b89('0x23')];_0x2be1e6[_0x3b89('0x24')][_0x3b89('0x1c')]({'where':{'phone':_0x525468['phone'],'VoiceQueueId':_0x3b38f7['id']}})['then'](function(_0x3bef40){if(!_[_0x3b89('0x1e')](_0x3bef40)){throw new Error(_0x3b89('0x25')+_0x525468[_0x3b89('0xb')]+_0x3b89('0x26')+_0x3b38f7['id']);}return _0x2be1e6[_0x3b89('0x24')][_0x3b89('0x27')]({'phone':_0x525468[_0x3b89('0xb')],'ContactId':_0x525468['id'],'ListId':_0x525468[_0x3b89('0x28')],'priority':_0x525468[_0x3b89('0x29')]?_0x525468[_0x3b89('0x29')]:0x2,'scheduledat':_0x525468[_0x3b89('0x17')]?_0x525468[_0x3b89('0x17')]:moment()[_0x3b89('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x525468['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x525468[_0x3b89('0x2a')]?_0x525468[_0x3b89('0x2a')]:undefined,'callbackat':_0x525468[_0x3b89('0x2a')]?moment()[_0x3b89('0x18')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x3b38f7['id']});})[_0x3b89('0x2b')](function(_0x37e7b0){_0xed229d(_0x37e7b0);});});});};var _0x140059=function(_0x4255de){return new BPromise(function(_0x22d845,_0x131616){_0x43367f(_0x4255de,_0x525468)['then'](function(_0xf554a3){_0x525468[_0x3b89('0x17')]=_0xf554a3[_0x3b89('0x23')];_0x2be1e6[_0x3b89('0x24')]['findOne']({'where':{'phone':_0x525468[_0x3b89('0xb')],'VoiceQueueId':_0x4255de['id']}})[_0x3b89('0x1d')](function(_0x28ab03){if(!_[_0x3b89('0x1e')](_0x28ab03)){throw new Error(_0x3b89('0x25')+_0x525468[_0x3b89('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x4255de['id']);}return _0x2be1e6[_0x3b89('0x2c')][_0x3b89('0x1c')]({'where':{'calleridnum':_0x525468[_0x3b89('0xb')],'VoiceQueueId':_0x4255de['id']}});})[_0x3b89('0x1d')](function(_0x204461){if(!_[_0x3b89('0x1e')](_0x204461)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x525468[_0x3b89('0xb')]+_0x3b89('0x2d')+_0x4255de['id']);}return _0x2be1e6[_0x3b89('0x24')]['create']({'phone':_0x525468['phone'],'ContactId':_0x525468['id'],'ListId':_0x525468[_0x3b89('0x28')],'priority':_0x525468['priority']?_0x525468[_0x3b89('0x29')]:0x2,'scheduledat':_0x525468['scheduledat']?_0x525468[_0x3b89('0x17')]:moment()[_0x3b89('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x525468[_0x3b89('0x2a')]?!![]:![],'callbackuniqueid':_0x525468[_0x3b89('0x2a')]?_0x525468[_0x3b89('0x2a')]:undefined,'callbackat':_0x525468[_0x3b89('0x2a')]?moment()[_0x3b89('0x18')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x4255de['id']});})['catch'](function(_0x548059){_0x131616(_0x548059);});});});};function _0x3fed98(){return function(_0x4c4ce2){logger[_0x3b89('0x13')](_0x3b89('0x14'),_0x3b89('0x15'),util[_0x3b89('0x16')](_0x4c4ce2,{'showHidden':![],'depth':null}));};}function _0x272b24(_0x1c64ec,_0x473c4e){var _0x3c5c12=_0x473c4e[_0x3b89('0x17')]?_0x473c4e['scheduledat']:moment()[_0x3b89('0x18')](_0x3b89('0x19'));return new BPromise(function(_0x4fab75,_0x26d1d4){if(_[_0x3b89('0x1e')](_0x473c4e[_0x3b89('0x1a')])){_0x4fab75({'ret':_0x3c5c12});}else{_0x2be1e6[_0x3b89('0x2e')][_0x3b89('0x1c')]({'where':{'id':_0x1c64ec['id']}})[_0x3b89('0x1d')](function(_0xf03059){if(!_['isNil'](_0xf03059)){var _0x5811c7=_0xf03059['dialTimezone'];if(!_[_0x3b89('0x1e')](_0x5811c7)){var _0x1bce1b=shared[_0x3b89('0x1f')];var _0xc79f3a=_0x1bce1b[_0x5811c7];var _0xa64774=_0x1bce1b[_0x473c4e[_0x3b89('0x1a')]];if(!_[_0x3b89('0x1e')](_0xc79f3a)&&!_[_0x3b89('0x1e')](_0xa64774)){var _0x228d4e=_0xc79f3a[_0x3b89('0x20')]-_0xa64774[_0x3b89('0x20')];_0x3c5c12=_0x473c4e['scheduledat']?_0x473c4e[_0x3b89('0x17')]:moment();var _0x5321f0=moment(_0x3c5c12)[_0x3b89('0x21')](_0x228d4e,_0x3b89('0x22'));_0x4fab75({'ret':_0x5321f0['format'](_0x3b89('0x19'))});}else _0x4fab75({'ret':_0x3c5c12});}else _0x4fab75({'ret':_0x3c5c12});}else{_0x4fab75({'ret':_0x3c5c12});}});}});return 0xa;}var _0x408098=function(_0xc9f98b){return new BPromise(function(_0x30b581,_0x3e7773){_0x272b24(_0xc9f98b,_0x525468)[_0x3b89('0x1d')](function(_0xebf728){_0x525468['scheduledat']=_0xebf728[_0x3b89('0x23')];_0x2be1e6[_0x3b89('0x24')][_0x3b89('0x1c')]({'where':{'phone':_0x525468[_0x3b89('0xb')],'CampaignId':_0xc9f98b['id']}})['then'](function(_0x528725){if(!_['isNil'](_0x528725)){throw new Error(_0x3b89('0x25')+_0x525468['phone']+_0x3b89('0x2f')+_0xc9f98b['id']);}return _0x2be1e6[_0x3b89('0x24')][_0x3b89('0x27')]({'phone':_0x525468[_0x3b89('0xb')],'ContactId':_0x525468['id'],'ListId':_0x525468[_0x3b89('0x28')],'priority':_0x525468[_0x3b89('0x29')]?_0x525468[_0x3b89('0x29')]:0x2,'scheduledat':_0x525468[_0x3b89('0x17')]?_0x525468['scheduledat']:moment()[_0x3b89('0x18')](_0x3b89('0x19')),'callback':_0x525468[_0x3b89('0x2a')]?!![]:![],'callbackuniqueid':_0x525468[_0x3b89('0x2a')]?_0x525468[_0x3b89('0x2a')]:undefined,'callbackat':_0x525468[_0x3b89('0x2a')]?moment()[_0x3b89('0x18')](_0x3b89('0x19')):undefined,'CampaignId':_0xc9f98b['id']});})['catch'](function(_0x4f653b){_0x3e7773(_0x4f653b);});});});};var _0x4dca6d=function(_0x15779a){return new BPromise(function(_0x5b04ac,_0x58472b){_0x272b24(_0x15779a,_0x525468)['then'](function(_0xa8322){_0x525468[_0x3b89('0x17')]=_0xa8322['ret'];_0x2be1e6[_0x3b89('0x24')]['findOne']({'where':{'phone':_0x525468[_0x3b89('0xb')],'CampaignId':_0x15779a['id']}})['then'](function(_0x1a0d51){if(!_['isNil'](_0x1a0d51)){throw new Error(_0x3b89('0x25')+_0x525468['phone']+_0x3b89('0x30')+_0x15779a['id']);}return _0x2be1e6['CmHopperFinal'][_0x3b89('0x1c')]({'where':{'calleridnum':_0x525468[_0x3b89('0xb')],'CampaignId':_0x15779a['id']}});})[_0x3b89('0x1d')](function(_0x4a1e31){if(!_[_0x3b89('0x1e')](_0x4a1e31)){throw new Error(_0x3b89('0x31')+_0x525468[_0x3b89('0xb')]+_0x3b89('0x32')+_0x15779a['id']);}return _0x2be1e6[_0x3b89('0x24')][_0x3b89('0x27')]({'phone':_0x525468[_0x3b89('0xb')],'ContactId':_0x525468['id'],'ListId':_0x525468[_0x3b89('0x28')],'priority':_0x525468[_0x3b89('0x29')]?_0x525468[_0x3b89('0x29')]:0x2,'scheduledat':_0x525468[_0x3b89('0x17')]?_0x525468['scheduledat']:moment()[_0x3b89('0x18')](_0x3b89('0x19')),'callback':_0x525468[_0x3b89('0x2a')]?!![]:![],'callbackuniqueid':_0x525468[_0x3b89('0x2a')]?_0x525468['callbackUniqueid']:undefined,'callbackat':_0x525468[_0x3b89('0x2a')]?moment()[_0x3b89('0x18')](_0x3b89('0x19')):undefined,'CampaignId':_0x15779a['id']});})[_0x3b89('0x2b')](function(_0x2f9c47){_0x58472b(_0x2f9c47);});});});};if(_0x525468[_0x3b89('0x28')]){_0x2be1e6[_0x3b89('0x1b')][_0x3b89('0x33')]({'where':{'type':_0x3b89('0x34')},'attributes':['id',_0x3b89('0x35'),_0x3b89('0x1a')],'include':[{'model':_0x2be1e6[_0x3b89('0x36')],'as':'Lists','where':{'id':_0x525468['ListId']}}]})[_0x3b89('0x1d')](function(_0x2507ae){if(_0x2507ae){var _0x1d589b=[];for(var _0x562345=0x0,_0x253ecc;_0x562345<_0x2507ae[_0x3b89('0x37')];_0x562345+=0x1){_0x253ecc=_0x2507ae[_0x562345][_0x3b89('0x12')]({'plain':!![]});switch(_0x253ecc[_0x3b89('0x35')]){case'always':_0x140059(_0x253ecc)[_0x3b89('0x2b')](_0x4b1cab());break;case _0x3b89('0x38'):_0x2e0bc1(_0x253ecc)['catch'](_0x4b1cab());break;default:_0x272b24(_0x253ecc,_0x525468)[_0x3b89('0x1d')](function(_0x4c3ea3){_0x525468[_0x3b89('0x17')]=_0x4c3ea3[_0x3b89('0x23')];_0x2be1e6[_0x3b89('0x24')][_0x3b89('0x27')]({'phone':_0x525468['phone'],'ContactId':_0x525468['id'],'ListId':_0x525468[_0x3b89('0x28')],'scheduledat':_0x525468[_0x3b89('0x17')]?_0x525468[_0x3b89('0x17')]:moment()['format'](_0x3b89('0x19')),'priority':_0x525468[_0x3b89('0x29')]?_0x525468[_0x3b89('0x29')]:0x2,'callback':_0x525468[_0x3b89('0x2a')]?!![]:![],'callbackuniqueid':_0x525468[_0x3b89('0x2a')]?_0x525468['callbackUniqueid']:undefined,'callbackat':_0x525468[_0x3b89('0x2a')]?moment()[_0x3b89('0x18')](_0x3b89('0x19')):undefined,'VoiceQueueId':_0x253ecc['id']})[_0x3b89('0x2b')](_0x4b1cab());});}}}})[_0x3b89('0x1d')](function(){return _0x2be1e6[_0x3b89('0x1b')][_0x3b89('0x33')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x2be1e6[_0x3b89('0x36')],'as':'BlackLists','where':{'id':_0x525468[_0x3b89('0x28')]}}]})[_0x3b89('0x1d')](function(_0x3e8a02){if(_0x3e8a02){var _0x474c1b=[];for(var _0xcaf4fb=0x0,_0x26194b;_0xcaf4fb<_0x3e8a02['length'];_0xcaf4fb+=0x1){_0x26194b=_0x3e8a02[_0xcaf4fb][_0x3b89('0x12')]({'plain':!![]});_0x2be1e6['CmHopperBlack'][_0x3b89('0x27')]({'phone':_0x525468[_0x3b89('0xb')],'ContactId':_0x525468['id'],'ListId':_0x525468['ListId'],'VoiceQueueId':_0x26194b['id']})[_0x3b89('0x2b')](function(_0x2fa7bd){logger['error']('cmContact,\x20%s,\x20%s',_0x3b89('0x15'),_0x2fa7bd[_0x3b89('0x39')]);});}}});})[_0x3b89('0x1d')](function(){return _0x2be1e6[_0x3b89('0x2e')][_0x3b89('0x33')]({'attributes':['id',_0x3b89('0x35'),_0x3b89('0x1a')],'include':[{'model':_0x2be1e6[_0x3b89('0x36')],'as':_0x3b89('0x3a'),'where':{'id':_0x525468['ListId']}}]})['then'](function(_0x24f45d){if(_0x24f45d){var _0x3b10a1=[];for(var _0x8cd517=0x0,_0x2894e8;_0x8cd517<_0x24f45d[_0x3b89('0x37')];_0x8cd517+=0x1){_0x2894e8=_0x24f45d[_0x8cd517]['get']({'plain':!![]});switch(_0x2894e8[_0x3b89('0x35')]){case _0x3b89('0x3b'):_0x4dca6d(_0x2894e8)[_0x3b89('0x2b')](_0x3fed98());break;case _0x3b89('0x38'):_0x408098(_0x2894e8)[_0x3b89('0x2b')](_0x3fed98());break;default:_0x2be1e6[_0x3b89('0x24')]['create']({'phone':_0x525468[_0x3b89('0xb')],'ContactId':_0x525468['id'],'ListId':_0x525468['ListId'],'scheduledat':_0x525468[_0x3b89('0x17')]?_0x525468['scheduledat']:moment()['format'](_0x3b89('0x19')),'priority':_0x525468[_0x3b89('0x29')]?_0x525468[_0x3b89('0x29')]:0x2,'callback':_0x525468['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x525468[_0x3b89('0x2a')]?_0x525468[_0x3b89('0x2a')]:undefined,'callbackat':_0x525468[_0x3b89('0x2a')]?moment()['format'](_0x3b89('0x19')):undefined,'CampaignId':_0x2894e8['id']})['catch'](_0x3fed98());}}}});})['then'](function(){return _0x2be1e6[_0x3b89('0x2e')]['findAll']({'attributes':['id'],'include':[{'model':_0x2be1e6[_0x3b89('0x36')],'as':_0x3b89('0x3c'),'where':{'id':_0x525468[_0x3b89('0x28')]}}]})[_0x3b89('0x1d')](function(_0x1ba3d9){if(_0x1ba3d9){var _0x5071cc=[];for(var _0x340ff0=0x0,_0x64a2ce;_0x340ff0<_0x1ba3d9[_0x3b89('0x37')];_0x340ff0+=0x1){_0x64a2ce=_0x1ba3d9[_0x340ff0][_0x3b89('0x12')]({'plain':!![]});_0x2be1e6['CmHopperBlack'][_0x3b89('0x27')]({'phone':_0x525468['phone'],'ContactId':_0x525468['id'],'ListId':_0x525468[_0x3b89('0x28')],'CampaignId':_0x64a2ce['id']})[_0x3b89('0x2b')](function(_0x3b32ae){logger[_0x3b89('0x13')](_0x3b89('0x3d'),_0x3b89('0x15'),_0x3b32ae[_0x3b89('0x39')]);});}}});})['then'](function(){_0x4ed7a8();})['catch'](function(_0x3dc64c){logger[_0x3b89('0x13')](_0x3b89('0x3d'),_0x3b89('0x15'),_0x3dc64c[_0x3b89('0x39')]);_0x4ed7a8(_0x3dc64c);});}else{_0x4ed7a8(new Error(_0x3b89('0x3e')));}},'afterDestroy':function(_0x54a965,_0x3779a3,_0x2d34a0){var _0x1bfbf6=_0x522283['models'];var _0x53d530=_0x54a965[_0x3b89('0x12')]({'plain':!![]});return _0x1bfbf6[_0x3b89('0x24')]['findAll']({'raw':!![],'where':{'ListId':_0x53d530['ListId'],'ContactId':_0x53d530['id']}})[_0x3b89('0x1d')](function(_0x4db9ea){if(!_[_0x3b89('0x3f')](_0x4db9ea)){var _0x2e372d=[];for(var _0x5e21ed=0x0;_0x5e21ed<_0x4db9ea[_0x3b89('0x37')];_0x5e21ed+=0x1){var _0x1cd7b8=_0x1bfbf6[_0x3b89('0x24')]['destroy']({'where':{'ListId':_0x4db9ea[_0x5e21ed]['ListId'],'ContactId':_0x4db9ea[_0x5e21ed][_0x3b89('0x40')],'VoiceQueueId':_0x4db9ea[_0x5e21ed][_0x3b89('0x41')],'CampaignId':_0x4db9ea[_0x5e21ed]['CampaignId']}});_0x2e372d[_0x3b89('0x42')](_0x1cd7b8);}return BPromise[_0x3b89('0x43')](_0x2e372d);}})['then'](function(_0x547640){logger['info'](_0x3b89('0x44'),util[_0x3b89('0x16')](_0x547640,{'showHidden':![],'depth':null}));_0x2d34a0();})['catch'](function(_0xb5836c){logger[_0x3b89('0x13')](_0x3b89('0x45'),util[_0x3b89('0x16')](_0xb5836c,{'showHidden':![],'depth':null}));_0x2d34a0(_0xb5836c);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index d628f6e..e338431 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x2ce6da,_0x50a0a9){var _0x196b27=function(_0x14ab18){while(--_0x14ab18){_0x2ce6da['push'](_0x2ce6da['shift']());}};_0x196b27(++_0x50a0a9);}(_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 moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x210c09,_0x231fe5){var _0x5a2f11=function(_0x17e37e){while(--_0x17e37e){_0x210c09['push'](_0x210c09['shift']());}};_0x5a2f11(++_0x231fe5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 a193dfa..1a656f2 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 _0x6a24=['exports','STRING','INTEGER','PHONE','sequelize'];(function(_0x53e3de,_0x13da7b){var _0x7b905b=function(_0x29b56a){while(--_0x29b56a){_0x53e3de['push'](_0x53e3de['shift']());}};_0x7b905b(++_0x13da7b);}(_0x6a24,0xd1));var _0x46a2=function(_0x16e8d1,_0x125a78){_0x16e8d1=_0x16e8d1-0x0;var _0x5de05c=_0x6a24[_0x16e8d1];return _0x5de05c;};'use strict';var Sequelize=require(_0x46a2('0x0'));module[_0x46a2('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x46a2('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x46a2('0x3')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x46a2('0x2')],'defaultValue':_0x46a2('0x4')},'OrderBy':{'type':Sequelize[_0x46a2('0x3')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0xb49a=['PHONE','sequelize','exports','INTEGER','STRING'];(function(_0x253ffd,_0x2063b7){var _0x54cc3a=function(_0x237a16){while(--_0x237a16){_0x253ffd['push'](_0x253ffd['shift']());}};_0x54cc3a(++_0x2063b7);}(_0xb49a,0xfb));var _0xab49=function(_0x1d4fb5,_0x205c2f){_0x1d4fb5=_0x1d4fb5-0x0;var _0x566c83=_0xb49a[_0x1d4fb5];return _0x566c83;};'use strict';var Sequelize=require(_0xab49('0x0'));module[_0xab49('0x1')]={'CmContactId':{'type':Sequelize[_0xab49('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xab49('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xab49('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xab49('0x4')},'OrderBy':{'type':Sequelize[_0xab49('0x2')],'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 e18ff8c..451eab1 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 _0x4eda=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','rawAttributes','keys','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','CmContactHasItems','destroy','error','stack','name','send','index','map','CmContactHasItem','fieldName','type','key','query','filters','intersection','model','attributes'];(function(_0x351f94,_0x249f07){var _0x30460e=function(_0x267cf4){while(--_0x267cf4){_0x351f94['push'](_0x351f94['shift']());}};_0x30460e(++_0x249f07);}(_0x4eda,0x1e2));var _0xa4ed=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4eda[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xa4ed('0x0'));var rimraf=require(_0xa4ed('0x1'));var zipdir=require(_0xa4ed('0x2'));var jsonpatch=require(_0xa4ed('0x3'));var rp=require(_0xa4ed('0x4'));var moment=require(_0xa4ed('0x5'));var BPromise=require(_0xa4ed('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa4ed('0x7'));var sox=require('sox');var csv=require(_0xa4ed('0x8'));var ejs=require(_0xa4ed('0x9'));var fs=require('fs');var fs_extra=require(_0xa4ed('0xa'));var _=require(_0xa4ed('0xb'));var squel=require(_0xa4ed('0xc'));var crypto=require(_0xa4ed('0xd'));var jsforce=require(_0xa4ed('0xe'));var deskjs=require(_0xa4ed('0xf'));var toCsv=require(_0xa4ed('0x8'));var querystring=require(_0xa4ed('0x10'));var Papa=require('papaparse');var Redis=require(_0xa4ed('0x11'));var authService=require(_0xa4ed('0x12'));var qs=require(_0xa4ed('0x13'));var as=require(_0xa4ed('0x14'));var hardwareService=require(_0xa4ed('0x15'));var logger=require(_0xa4ed('0x16'))(_0xa4ed('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa4ed('0x18'));var db=require(_0xa4ed('0x19'))['db'];function respondWithStatusCode(_0xa35560,_0x232b38){_0x232b38=_0x232b38||0xcc;return function(_0x2a0d83){if(_0x2a0d83){return _0xa35560[_0xa4ed('0x1a')](_0x232b38);}return _0xa35560[_0xa4ed('0x1b')](_0x232b38)[_0xa4ed('0x1c')]();};}function respondWithResult(_0x2410f3,_0x3ac5fc){_0x3ac5fc=_0x3ac5fc||0xc8;return function(_0x351322){if(_0x351322){return _0x2410f3[_0xa4ed('0x1b')](_0x3ac5fc)[_0xa4ed('0x1d')](_0x351322);}};}function respondWithFilteredResult(_0x981b0,_0x1db542){return function(_0x565739){if(_0x565739){var _0x4bc70e=typeof _0x1db542[_0xa4ed('0x1e')]==='undefined'&&typeof _0x1db542[_0xa4ed('0x1f')]===_0xa4ed('0x20');var _0x4af2c8=_0x565739[_0xa4ed('0x21')];var _0x5868bf=_0x4bc70e?0x0:_0x1db542[_0xa4ed('0x1e')];var _0x17cad2=_0x4bc70e?_0x565739[_0xa4ed('0x21')]:_0x1db542[_0xa4ed('0x1e')]+_0x1db542[_0xa4ed('0x1f')];var _0x53b48a;if(_0x17cad2>=_0x4af2c8){_0x17cad2=_0x4af2c8;_0x53b48a=0xc8;}else{_0x53b48a=0xce;}_0x981b0[_0xa4ed('0x1b')](_0x53b48a);return _0x981b0[_0xa4ed('0x22')](_0xa4ed('0x23'),_0x5868bf+'-'+_0x17cad2+'/'+_0x4af2c8)['json'](_0x565739);}return null;};}function patchUpdates(_0x9f4a3b){return function(_0x31c1c5){try{jsonpatch[_0xa4ed('0x24')](_0x31c1c5,_0x9f4a3b,!![]);}catch(_0x3a81ec){return BPromise[_0xa4ed('0x25')](_0x3a81ec);}return _0x31c1c5[_0xa4ed('0x26')]();};}function saveUpdates(_0x52e167,_0x36f822){return function(_0x3ff2a1){if(_0x3ff2a1){return _0x3ff2a1[_0xa4ed('0x27')](_0x52e167)[_0xa4ed('0x28')](function(_0x4fb50a){return _0x4fb50a;});}return null;};}function removeEntity(_0x54fdd7,_0x13db03){return function(_0x34c1b3){if(_0x34c1b3){return _0x34c1b3['destroy']()[_0xa4ed('0x28')](function(){var _0x290fd3=_0x34c1b3['get']({'plain':!![]});var _0x1eb890=_0xa4ed('0x29');return db['UserProfileResource'][_0xa4ed('0x2a')]({'where':{'type':_0x1eb890,'resourceId':_0x290fd3['id']}})[_0xa4ed('0x28')](function(){return _0x34c1b3;});})[_0xa4ed('0x28')](function(){_0x54fdd7[_0xa4ed('0x1b')](0xcc)[_0xa4ed('0x1c')]();});}};}function handleEntityNotFound(_0x21d836,_0x5cdc9a){return function(_0x256add){if(!_0x256add){_0x21d836[_0xa4ed('0x1a')](0x194);}return _0x256add;};}function handleError(_0x35f72b,_0xfb03b1){_0xfb03b1=_0xfb03b1||0x1f4;return function(_0x1f4a8a){logger[_0xa4ed('0x2b')](_0x1f4a8a[_0xa4ed('0x2c')]);if(_0x1f4a8a[_0xa4ed('0x2d')]){delete _0x1f4a8a[_0xa4ed('0x2d')];}_0x35f72b[_0xa4ed('0x1b')](_0xfb03b1)[_0xa4ed('0x2e')](_0x1f4a8a);};}exports[_0xa4ed('0x2f')]=function(_0x86c7cf,_0x1c6898){var _0x5e7a8f={},_0x3dd92e={},_0x383440={'count':0x0,'rows':[]};var _0x3ef08e=_[_0xa4ed('0x30')](db[_0xa4ed('0x31')]['rawAttributes'],function(_0x51830f){return{'name':_0x51830f[_0xa4ed('0x32')],'type':_0x51830f[_0xa4ed('0x33')][_0xa4ed('0x34')]};});_0x3dd92e['model']=_['map'](_0x3ef08e,_0xa4ed('0x2d'));_0x3dd92e[_0xa4ed('0x35')]=_['keys'](_0x86c7cf[_0xa4ed('0x35')]);_0x3dd92e[_0xa4ed('0x36')]=_[_0xa4ed('0x37')](_0x3dd92e[_0xa4ed('0x38')],_0x3dd92e[_0xa4ed('0x35')]);_0x5e7a8f[_0xa4ed('0x39')]=_[_0xa4ed('0x37')](_0x3dd92e[_0xa4ed('0x38')],qs[_0xa4ed('0x3a')](_0x86c7cf['query'][_0xa4ed('0x3a')]));_0x5e7a8f[_0xa4ed('0x39')]=_0x5e7a8f['attributes'][_0xa4ed('0x3b')]?_0x5e7a8f['attributes']:_0x3dd92e['model'];if(!_0x86c7cf[_0xa4ed('0x35')][_0xa4ed('0x3c')](_0xa4ed('0x3d'))){_0x5e7a8f[_0xa4ed('0x1f')]=qs['limit'](_0x86c7cf['query'][_0xa4ed('0x1f')]);_0x5e7a8f[_0xa4ed('0x1e')]=qs[_0xa4ed('0x1e')](_0x86c7cf[_0xa4ed('0x35')][_0xa4ed('0x1e')]);}_0x5e7a8f[_0xa4ed('0x3e')]=qs[_0xa4ed('0x3f')](_0x86c7cf[_0xa4ed('0x35')][_0xa4ed('0x3f')]);_0x5e7a8f[_0xa4ed('0x40')]=qs[_0xa4ed('0x36')](_[_0xa4ed('0x41')](_0x86c7cf[_0xa4ed('0x35')],_0x3dd92e[_0xa4ed('0x36')]),_0x3ef08e);if(_0x86c7cf['query']['filter']){_0x5e7a8f['where']=_[_0xa4ed('0x42')](_0x5e7a8f[_0xa4ed('0x40')],{'$or':_[_0xa4ed('0x30')](_0x3ef08e,function(_0x37d2d0){if(_0x37d2d0['type']!==_0xa4ed('0x43')){var _0x2c755e={};_0x2c755e[_0x37d2d0[_0xa4ed('0x2d')]]={'$like':'%'+_0x86c7cf[_0xa4ed('0x35')][_0xa4ed('0x44')]+'%'};return _0x2c755e;}})});}_0x5e7a8f=_[_0xa4ed('0x42')]({},_0x5e7a8f,_0x86c7cf['options']);var _0x1e3f5c={'where':_0x5e7a8f[_0xa4ed('0x40')]};return db[_0xa4ed('0x31')][_0xa4ed('0x21')](_0x1e3f5c)[_0xa4ed('0x28')](function(_0x15f6f1){_0x383440[_0xa4ed('0x21')]=_0x15f6f1;if(_0x86c7cf[_0xa4ed('0x35')][_0xa4ed('0x45')]){_0x5e7a8f[_0xa4ed('0x46')]=[{'all':!![]}];}return db[_0xa4ed('0x31')]['findAll'](_0x5e7a8f);})['then'](function(_0x378fd9){_0x383440[_0xa4ed('0x47')]=_0x378fd9;return _0x383440;})[_0xa4ed('0x28')](respondWithFilteredResult(_0x1c6898,_0x5e7a8f))[_0xa4ed('0x48')](handleError(_0x1c6898,null));};exports[_0xa4ed('0x49')]=function(_0x185e46,_0x4f50e6){var _0x4b6d14={'raw':!![],'where':{'id':_0x185e46[_0xa4ed('0x4a')]['id']}},_0x31aa4b={};_0x31aa4b[_0xa4ed('0x38')]=_['keys'](db['CmContactHasItem'][_0xa4ed('0x4b')]);_0x31aa4b[_0xa4ed('0x35')]=_[_0xa4ed('0x4c')](_0x185e46[_0xa4ed('0x35')]);_0x31aa4b[_0xa4ed('0x36')]=_[_0xa4ed('0x37')](_0x31aa4b[_0xa4ed('0x38')],_0x31aa4b[_0xa4ed('0x35')]);_0x4b6d14[_0xa4ed('0x39')]=_[_0xa4ed('0x37')](_0x31aa4b[_0xa4ed('0x38')],qs[_0xa4ed('0x3a')](_0x185e46[_0xa4ed('0x35')]['fields']));_0x4b6d14['attributes']=_0x4b6d14[_0xa4ed('0x39')]['length']?_0x4b6d14['attributes']:_0x31aa4b[_0xa4ed('0x38')];if(_0x185e46[_0xa4ed('0x35')]['includeAll']){_0x4b6d14[_0xa4ed('0x46')]=[{'all':!![]}];}_0x4b6d14=_[_0xa4ed('0x42')]({},_0x4b6d14,_0x185e46[_0xa4ed('0x4d')]);return db[_0xa4ed('0x31')]['find'](_0x4b6d14)['then'](handleEntityNotFound(_0x4f50e6,null))['then'](respondWithResult(_0x4f50e6,null))['catch'](handleError(_0x4f50e6,null));};exports[_0xa4ed('0x4e')]=function(_0x52bbab,_0x27aaba){return db[_0xa4ed('0x31')][_0xa4ed('0x4e')](_0x52bbab['body'],{})['then'](function(_0x2fdcb7){var _0x51ff13=_0x52bbab[_0xa4ed('0x4f')][_0xa4ed('0x50')]({'plain':!![]});if(!_0x51ff13)throw new Error(_0xa4ed('0x51'));if(_0x51ff13[_0xa4ed('0x52')]==='user'){var _0x5d0e99=_0x2fdcb7[_0xa4ed('0x50')]({'plain':!![]});var _0x54787d=_0xa4ed('0x29');return db[_0xa4ed('0x53')][_0xa4ed('0x54')]({'where':{'name':_0x54787d,'userProfileId':_0x51ff13[_0xa4ed('0x55')]},'raw':!![]})['then'](function(_0x4fe936){if(_0x4fe936&&_0x4fe936[_0xa4ed('0x56')]===0x0){return db[_0xa4ed('0x57')][_0xa4ed('0x4e')]({'name':_0x5d0e99['name'],'resourceId':_0x5d0e99['id'],'type':_0x4fe936['name'],'sectionId':_0x4fe936['id']},{})['then'](function(){return _0x2fdcb7;});}else{return _0x2fdcb7;}})[_0xa4ed('0x48')](function(_0x5ce077){logger['error'](_0xa4ed('0x58'),_0x5ce077);throw _0x5ce077;});}return _0x2fdcb7;})[_0xa4ed('0x28')](respondWithResult(_0x27aaba,0xc9))['catch'](handleError(_0x27aaba,null));};exports[_0xa4ed('0x27')]=function(_0x43efba,_0x386161){if(_0x43efba[_0xa4ed('0x59')]['id']){delete _0x43efba[_0xa4ed('0x59')]['id'];}return db[_0xa4ed('0x31')][_0xa4ed('0x54')]({'where':{'id':_0x43efba[_0xa4ed('0x4a')]['id']}})[_0xa4ed('0x28')](handleEntityNotFound(_0x386161,null))[_0xa4ed('0x28')](saveUpdates(_0x43efba[_0xa4ed('0x59')],null))[_0xa4ed('0x28')](respondWithResult(_0x386161,null))[_0xa4ed('0x48')](handleError(_0x386161,null));};exports[_0xa4ed('0x2a')]=function(_0x336711,_0x47d2e4){return db['CmContactHasItem'][_0xa4ed('0x54')]({'where':{'id':_0x336711['params']['id']}})[_0xa4ed('0x28')](handleEntityNotFound(_0x47d2e4,null))[_0xa4ed('0x28')](removeEntity(_0x47d2e4,null))['catch'](handleError(_0x47d2e4,null));}; \ No newline at end of file +var _0xf0f1=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','status','sendStatus','stack','name','send','index','map','CmContactHasItem','fieldName','key','keys','query','model','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','intersection','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0xb8b7f,_0x3f1a20){var _0x4dda4b=function(_0x4810e3){while(--_0x4810e3){_0xb8b7f['push'](_0xb8b7f['shift']());}};_0x4dda4b(++_0x3f1a20);}(_0xf0f1,0x1e6));var _0x1f0f=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xf0f1[_0x4ff09b];return _0x3f5c2e;};'use strict';var emlformat=require(_0x1f0f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1f0f('0x1'));var rp=require('request-promise');var moment=require(_0x1f0f('0x2'));var BPromise=require(_0x1f0f('0x3'));var Mustache=require(_0x1f0f('0x4'));var util=require(_0x1f0f('0x5'));var path=require(_0x1f0f('0x6'));var sox=require(_0x1f0f('0x7'));var csv=require(_0x1f0f('0x8'));var ejs=require(_0x1f0f('0x9'));var fs=require('fs');var fs_extra=require(_0x1f0f('0xa'));var _=require(_0x1f0f('0xb'));var squel=require(_0x1f0f('0xc'));var crypto=require(_0x1f0f('0xd'));var jsforce=require(_0x1f0f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1f0f('0x8'));var querystring=require(_0x1f0f('0xf'));var Papa=require(_0x1f0f('0x10'));var Redis=require(_0x1f0f('0x11'));var authService=require(_0x1f0f('0x12'));var qs=require(_0x1f0f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f0f('0x14'));var logger=require(_0x1f0f('0x15'))('api');var utils=require(_0x1f0f('0x16'));var config=require(_0x1f0f('0x17'));var licenseUtil=require(_0x1f0f('0x18'));var db=require(_0x1f0f('0x19'))['db'];function respondWithStatusCode(_0x4a1818,_0x11c6f8){_0x11c6f8=_0x11c6f8||0xcc;return function(_0x56e036){if(_0x56e036){return _0x4a1818['sendStatus'](_0x11c6f8);}return _0x4a1818['status'](_0x11c6f8)['end']();};}function respondWithResult(_0x551672,_0xbeb9b4){_0xbeb9b4=_0xbeb9b4||0xc8;return function(_0x27e09c){if(_0x27e09c){return _0x551672['status'](_0xbeb9b4)['json'](_0x27e09c);}};}function respondWithFilteredResult(_0x103742,_0x4c6b17){return function(_0x54beec){if(_0x54beec){var _0x20e7bd=typeof _0x4c6b17[_0x1f0f('0x1a')]==='undefined'&&typeof _0x4c6b17[_0x1f0f('0x1b')]===_0x1f0f('0x1c');var _0x1f5cfe=_0x54beec[_0x1f0f('0x1d')];var _0x1001da=_0x20e7bd?0x0:_0x4c6b17[_0x1f0f('0x1a')];var _0x480511=_0x20e7bd?_0x54beec[_0x1f0f('0x1d')]:_0x4c6b17['offset']+_0x4c6b17[_0x1f0f('0x1b')];var _0x2b752e;if(_0x480511>=_0x1f5cfe){_0x480511=_0x1f5cfe;_0x2b752e=0xc8;}else{_0x2b752e=0xce;}_0x103742['status'](_0x2b752e);return _0x103742[_0x1f0f('0x1e')](_0x1f0f('0x1f'),_0x1001da+'-'+_0x480511+'/'+_0x1f5cfe)[_0x1f0f('0x20')](_0x54beec);}return null;};}function patchUpdates(_0x1e579d){return function(_0x19fb6f){try{jsonpatch[_0x1f0f('0x21')](_0x19fb6f,_0x1e579d,!![]);}catch(_0x29a053){return BPromise[_0x1f0f('0x22')](_0x29a053);}return _0x19fb6f[_0x1f0f('0x23')]();};}function saveUpdates(_0x53d620,_0x3ea3e1){return function(_0x4e9803){if(_0x4e9803){return _0x4e9803[_0x1f0f('0x24')](_0x53d620)[_0x1f0f('0x25')](function(_0x5961ec){return _0x5961ec;});}return null;};}function removeEntity(_0xf620af,_0x5f1e79){return function(_0x3b4a7b){if(_0x3b4a7b){return _0x3b4a7b[_0x1f0f('0x26')]()[_0x1f0f('0x25')](function(){var _0x528066=_0x3b4a7b[_0x1f0f('0x27')]({'plain':!![]});var _0x4f81ff='CmContactHasItems';return db[_0x1f0f('0x28')][_0x1f0f('0x26')]({'where':{'type':_0x4f81ff,'resourceId':_0x528066['id']}})[_0x1f0f('0x25')](function(){return _0x3b4a7b;});})[_0x1f0f('0x25')](function(){_0xf620af[_0x1f0f('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5093a1,_0x52c5a0){return function(_0x521eb0){if(!_0x521eb0){_0x5093a1[_0x1f0f('0x2a')](0x194);}return _0x521eb0;};}function handleError(_0x36b8f8,_0x4f4179){_0x4f4179=_0x4f4179||0x1f4;return function(_0xf20d90){logger['error'](_0xf20d90[_0x1f0f('0x2b')]);if(_0xf20d90[_0x1f0f('0x2c')]){delete _0xf20d90[_0x1f0f('0x2c')];}_0x36b8f8[_0x1f0f('0x29')](_0x4f4179)[_0x1f0f('0x2d')](_0xf20d90);};}exports[_0x1f0f('0x2e')]=function(_0x3f85f6,_0x8738f7){var _0x43a1e4={},_0x2c89e3={},_0x445335={'count':0x0,'rows':[]};var _0x21b417=_[_0x1f0f('0x2f')](db[_0x1f0f('0x30')]['rawAttributes'],function(_0x36d4aa){return{'name':_0x36d4aa[_0x1f0f('0x31')],'type':_0x36d4aa['type'][_0x1f0f('0x32')]};});_0x2c89e3['model']=_[_0x1f0f('0x2f')](_0x21b417,_0x1f0f('0x2c'));_0x2c89e3['query']=_[_0x1f0f('0x33')](_0x3f85f6[_0x1f0f('0x34')]);_0x2c89e3['filters']=_['intersection'](_0x2c89e3[_0x1f0f('0x35')],_0x2c89e3[_0x1f0f('0x34')]);_0x43a1e4[_0x1f0f('0x36')]=_['intersection'](_0x2c89e3[_0x1f0f('0x35')],qs['fields'](_0x3f85f6['query'][_0x1f0f('0x37')]));_0x43a1e4['attributes']=_0x43a1e4['attributes']['length']?_0x43a1e4[_0x1f0f('0x36')]:_0x2c89e3['model'];if(!_0x3f85f6['query'][_0x1f0f('0x38')]('nolimit')){_0x43a1e4[_0x1f0f('0x1b')]=qs['limit'](_0x3f85f6['query']['limit']);_0x43a1e4[_0x1f0f('0x1a')]=qs['offset'](_0x3f85f6[_0x1f0f('0x34')][_0x1f0f('0x1a')]);}_0x43a1e4[_0x1f0f('0x39')]=qs['sort'](_0x3f85f6[_0x1f0f('0x34')][_0x1f0f('0x3a')]);_0x43a1e4[_0x1f0f('0x3b')]=qs[_0x1f0f('0x3c')](_[_0x1f0f('0x3d')](_0x3f85f6[_0x1f0f('0x34')],_0x2c89e3['filters']),_0x21b417);if(_0x3f85f6['query'][_0x1f0f('0x3e')]){_0x43a1e4['where']=_[_0x1f0f('0x3f')](_0x43a1e4[_0x1f0f('0x3b')],{'$or':_[_0x1f0f('0x2f')](_0x21b417,function(_0x22ef2d){if(_0x22ef2d[_0x1f0f('0x40')]!==_0x1f0f('0x41')){var _0xa5d20c={};_0xa5d20c[_0x22ef2d[_0x1f0f('0x2c')]]={'$like':'%'+_0x3f85f6['query']['filter']+'%'};return _0xa5d20c;}})});}_0x43a1e4=_[_0x1f0f('0x3f')]({},_0x43a1e4,_0x3f85f6[_0x1f0f('0x42')]);var _0x8da8e6={'where':_0x43a1e4[_0x1f0f('0x3b')]};return db[_0x1f0f('0x30')][_0x1f0f('0x1d')](_0x8da8e6)[_0x1f0f('0x25')](function(_0x5849b0){_0x445335['count']=_0x5849b0;if(_0x3f85f6[_0x1f0f('0x34')][_0x1f0f('0x43')]){_0x43a1e4[_0x1f0f('0x44')]=[{'all':!![]}];}return db[_0x1f0f('0x30')]['findAll'](_0x43a1e4);})['then'](function(_0x54cce0){_0x445335[_0x1f0f('0x45')]=_0x54cce0;return _0x445335;})[_0x1f0f('0x25')](respondWithFilteredResult(_0x8738f7,_0x43a1e4))[_0x1f0f('0x46')](handleError(_0x8738f7,null));};exports['show']=function(_0x5da0d8,_0x2a8e46){var _0x17da85={'raw':!![],'where':{'id':_0x5da0d8[_0x1f0f('0x47')]['id']}},_0x124613={};_0x124613[_0x1f0f('0x35')]=_[_0x1f0f('0x33')](db['CmContactHasItem']['rawAttributes']);_0x124613[_0x1f0f('0x34')]=_[_0x1f0f('0x33')](_0x5da0d8[_0x1f0f('0x34')]);_0x124613[_0x1f0f('0x3c')]=_['intersection'](_0x124613[_0x1f0f('0x35')],_0x124613['query']);_0x17da85['attributes']=_[_0x1f0f('0x48')](_0x124613[_0x1f0f('0x35')],qs[_0x1f0f('0x37')](_0x5da0d8[_0x1f0f('0x34')]['fields']));_0x17da85[_0x1f0f('0x36')]=_0x17da85[_0x1f0f('0x36')][_0x1f0f('0x49')]?_0x17da85[_0x1f0f('0x36')]:_0x124613[_0x1f0f('0x35')];if(_0x5da0d8[_0x1f0f('0x34')][_0x1f0f('0x43')]){_0x17da85[_0x1f0f('0x44')]=[{'all':!![]}];}_0x17da85=_[_0x1f0f('0x3f')]({},_0x17da85,_0x5da0d8[_0x1f0f('0x42')]);return db[_0x1f0f('0x30')][_0x1f0f('0x4a')](_0x17da85)[_0x1f0f('0x25')](handleEntityNotFound(_0x2a8e46,null))['then'](respondWithResult(_0x2a8e46,null))['catch'](handleError(_0x2a8e46,null));};exports['create']=function(_0x3dd8d4,_0x37af6f){return db[_0x1f0f('0x30')][_0x1f0f('0x4b')](_0x3dd8d4[_0x1f0f('0x4c')],{})['then'](function(_0x517303){var _0x1bb5f2=_0x3dd8d4[_0x1f0f('0x4d')][_0x1f0f('0x27')]({'plain':!![]});if(!_0x1bb5f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bb5f2[_0x1f0f('0x4e')]===_0x1f0f('0x4d')){var _0x44d3c3=_0x517303[_0x1f0f('0x27')]({'plain':!![]});var _0x491b81='CmContactHasItems';return db[_0x1f0f('0x4f')]['find']({'where':{'name':_0x491b81,'userProfileId':_0x1bb5f2[_0x1f0f('0x50')]},'raw':!![]})[_0x1f0f('0x25')](function(_0x15a165){if(_0x15a165&&_0x15a165[_0x1f0f('0x51')]===0x0){return db[_0x1f0f('0x28')][_0x1f0f('0x4b')]({'name':_0x44d3c3[_0x1f0f('0x2c')],'resourceId':_0x44d3c3['id'],'type':_0x15a165[_0x1f0f('0x2c')],'sectionId':_0x15a165['id']},{})['then'](function(){return _0x517303;});}else{return _0x517303;}})[_0x1f0f('0x46')](function(_0x8d017e){logger['error'](_0x1f0f('0x52'),_0x8d017e);throw _0x8d017e;});}return _0x517303;})['then'](respondWithResult(_0x37af6f,0xc9))[_0x1f0f('0x46')](handleError(_0x37af6f,null));};exports[_0x1f0f('0x24')]=function(_0x2a01e9,_0x28b77d){if(_0x2a01e9[_0x1f0f('0x4c')]['id']){delete _0x2a01e9[_0x1f0f('0x4c')]['id'];}return db[_0x1f0f('0x30')][_0x1f0f('0x4a')]({'where':{'id':_0x2a01e9[_0x1f0f('0x47')]['id']}})[_0x1f0f('0x25')](handleEntityNotFound(_0x28b77d,null))[_0x1f0f('0x25')](saveUpdates(_0x2a01e9['body'],null))[_0x1f0f('0x25')](respondWithResult(_0x28b77d,null))[_0x1f0f('0x46')](handleError(_0x28b77d,null));};exports[_0x1f0f('0x26')]=function(_0x2b4627,_0x4b4ff4){return db[_0x1f0f('0x30')][_0x1f0f('0x4a')]({'where':{'id':_0x2b4627[_0x1f0f('0x47')]['id']}})['then'](handleEntityNotFound(_0x4b4ff4,null))[_0x1f0f('0x25')](removeEntity(_0x4b4ff4,null))[_0x1f0f('0x46')](handleError(_0x4b4ff4,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index c0f0716..ac99e76 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 _0xc752=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','define','CmContactHasItem','cm_contact_has_items'];(function(_0x5cbbeb,_0x201924){var _0x135976=function(_0x2a5b14){while(--_0x2a5b14){_0x5cbbeb['push'](_0x5cbbeb['shift']());}};_0x135976(++_0x201924);}(_0xc752,0x1ad));var _0x2c75=function(_0x1a4602,_0x58fe1f){_0x1a4602=_0x1a4602-0x0;var _0x422703=_0xc752[_0x1a4602];return _0x422703;};'use strict';var _=require(_0x2c75('0x0'));var util=require(_0x2c75('0x1'));var logger=require(_0x2c75('0x2'))('api');var moment=require(_0x2c75('0x3'));var BPromise=require(_0x2c75('0x4'));var rp=require(_0x2c75('0x5'));var fs=require('fs');var path=require(_0x2c75('0x6'));var rimraf=require(_0x2c75('0x7'));var config=require(_0x2c75('0x8'));var attributes=require(_0x2c75('0x9'));module['exports']=function(_0x3f68c6,_0x37dd03){return _0x3f68c6[_0x2c75('0xa')](_0x2c75('0xb'),attributes,{'tableName':_0x2c75('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1224=['path','rimraf','../../config/environment','./cmContactHasItem.attributes','define','CmContactHasItem','lodash','util','bluebird','request-promise'];(function(_0x55a9a1,_0x3c9f3b){var _0x323023=function(_0x2712a7){while(--_0x2712a7){_0x55a9a1['push'](_0x55a9a1['shift']());}};_0x323023(++_0x3c9f3b);}(_0x1224,0x92));var _0x4122=function(_0x43f756,_0xae9f58){_0x43f756=_0x43f756-0x0;var _0x5ba710=_0x1224[_0x43f756];return _0x5ba710;};'use strict';var _=require(_0x4122('0x0'));var util=require(_0x4122('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4122('0x2'));var rp=require(_0x4122('0x3'));var fs=require('fs');var path=require(_0x4122('0x4'));var rimraf=require(_0x4122('0x5'));var config=require(_0x4122('0x6'));var attributes=require(_0x4122('0x7'));module['exports']=function(_0x47ac65,_0x4d804c){return _0x47ac65[_0x4122('0x8')](_0x4122('0x9'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index cf82a5c..d9bc627 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 _0x61b4=['../../config/environment','jayson/promise','client','http','request','then','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','error','message','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x61b4,0xdc));var _0x461b=function(_0x1d774d,_0x28a381){_0x1d774d=_0x1d774d-0x0;var _0x41314f=_0x61b4[_0x1d774d];return _0x41314f;};'use strict';var _=require('lodash');var util=require(_0x461b('0x0'));var moment=require(_0x461b('0x1'));var BPromise=require('bluebird');var rs=require(_0x461b('0x2'));var fs=require('fs');var Redis=require(_0x461b('0x3'));var db=require(_0x461b('0x4'))['db'];var utils=require(_0x461b('0x5'));var logger=require(_0x461b('0x6'))(_0x461b('0x7'));var config=require(_0x461b('0x8'));var jayson=require(_0x461b('0x9'));var client=jayson[_0x461b('0xa')][_0x461b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fac29,_0x13b82b,_0x42845e){return new BPromise(function(_0x53f020,_0x5cc964){return client[_0x461b('0xc')](_0x1fac29,_0x42845e)[_0x461b('0xd')](function(_0x3f659e){logger['info'](_0x461b('0xe'),_0x13b82b,_0x461b('0xf'));logger[_0x461b('0x10')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x13b82b,_0x461b('0xf'),JSON['stringify'](_0x3f659e));if(_0x3f659e['error']){if(_0x3f659e['error']['code']===0x1f4){logger[_0x461b('0x11')](_0x461b('0xe'),_0x13b82b,_0x3f659e[_0x461b('0x11')]['message']);return _0x5cc964(_0x3f659e[_0x461b('0x11')][_0x461b('0x12')]);}logger[_0x461b('0x11')](_0x461b('0xe'),_0x13b82b,_0x3f659e[_0x461b('0x11')][_0x461b('0x12')]);return _0x53f020(_0x3f659e[_0x461b('0x11')][_0x461b('0x12')]);}else{logger['info'](_0x461b('0xe'),_0x13b82b,_0x461b('0xf'));_0x53f020(_0x3f659e['result'][_0x461b('0x12')]);}})['catch'](function(_0xef888d){logger['error'](_0x461b('0xe'),_0x13b82b,_0xef888d);_0x5cc964(_0xef888d);});});} \ No newline at end of file +var _0x64a4=['error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0x64a4,0x1d2));var _0x464a=function(_0xeb30cd,_0xd1768d){_0xeb30cd=_0xeb30cd-0x0;var _0x5a77cd=_0x64a4[_0xeb30cd];return _0x5a77cd;};'use strict';var _=require(_0x464a('0x0'));var util=require(_0x464a('0x1'));var moment=require('moment');var BPromise=require(_0x464a('0x2'));var rs=require(_0x464a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x464a('0x4'))['db'];var utils=require(_0x464a('0x5'));var logger=require(_0x464a('0x6'))(_0x464a('0x7'));var config=require(_0x464a('0x8'));var jayson=require(_0x464a('0x9'));var client=jayson['client'][_0x464a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b3f51,_0xa4e3a1,_0x265dee){return new BPromise(function(_0x4a9757,_0x127582){return client[_0x464a('0xb')](_0x5b3f51,_0x265dee)[_0x464a('0xc')](function(_0x41cbd6){logger[_0x464a('0xd')](_0x464a('0xe'),_0xa4e3a1,_0x464a('0xf'));logger['debug'](_0x464a('0x10'),_0xa4e3a1,_0x464a('0xf'),JSON[_0x464a('0x11')](_0x41cbd6));if(_0x41cbd6[_0x464a('0x12')]){if(_0x41cbd6['error'][_0x464a('0x13')]===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0xa4e3a1,_0x41cbd6[_0x464a('0x12')][_0x464a('0x14')]);return _0x127582(_0x41cbd6['error']['message']);}logger['error'](_0x464a('0xe'),_0xa4e3a1,_0x41cbd6['error'][_0x464a('0x14')]);return _0x4a9757(_0x41cbd6[_0x464a('0x12')][_0x464a('0x14')]);}else{logger[_0x464a('0xd')]('CmContactHasItem,\x20%s,\x20%s',_0xa4e3a1,'request\x20sent');_0x4a9757(_0x41cbd6['result']['message']);}})[_0x464a('0x15')](function(_0x1fe58a){logger[_0x464a('0x12')](_0x464a('0xe'),_0xa4e3a1,_0x1fe58a);_0x127582(_0x1fe58a);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 9904f35..59e53d7 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 _0xb460=['../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','index','/:id','isAuthenticated','show','post','put','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xb460,0x8b));var _0x0b46=function(_0x5688f7,_0xc0c7f7){_0x5688f7=_0x5688f7-0x0;var _0x5e80cc=_0xb460[_0x5688f7];return _0x5e80cc;};'use strict';var multer=require('multer');var util=require(_0x0b46('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0b46('0x1'));var router=express[_0x0b46('0x2')]();var fs_extra=require(_0x0b46('0x3'));var auth=require(_0x0b46('0x4'));var interaction=require(_0x0b46('0x5'));var config=require(_0x0b46('0x6'));var controller=require(_0x0b46('0x7'));router[_0x0b46('0x8')]('/',auth['isAuthenticated'](),controller[_0x0b46('0x9')]);router['get'](_0x0b46('0xa'),auth[_0x0b46('0xb')](),controller[_0x0b46('0xc')]);router[_0x0b46('0xd')]('/',auth[_0x0b46('0xb')](),controller['create']);router[_0x0b46('0xe')](_0x0b46('0xa'),auth[_0x0b46('0xb')](),controller['update']);router[_0x0b46('0xf')]('/:id',auth[_0x0b46('0xb')](),controller[_0x0b46('0x10')]);module[_0x0b46('0x11')]=router; \ No newline at end of file +var _0xa57f=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','post','put','isAuthenticated','update','delete','destroy'];(function(_0x42c6f1,_0x338d7b){var _0x3c7398=function(_0x151494){while(--_0x151494){_0x42c6f1['push'](_0x42c6f1['shift']());}};_0x3c7398(++_0x338d7b);}(_0xa57f,0x77));var _0xfa57=function(_0x38a287,_0x393cf8){_0x38a287=_0x38a287-0x0;var _0x4f3556=_0xa57f[_0x38a287];return _0x4f3556;};'use strict';var multer=require('multer');var util=require(_0xfa57('0x0'));var path=require(_0xfa57('0x1'));var timeout=require(_0xfa57('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfa57('0x3'));var auth=require(_0xfa57('0x4'));var interaction=require(_0xfa57('0x5'));var config=require(_0xfa57('0x6'));var controller=require('./cmContactHasItem.controller');router[_0xfa57('0x7')]('/',auth['isAuthenticated'](),controller[_0xfa57('0x8')]);router[_0xfa57('0x7')](_0xfa57('0x9'),auth['isAuthenticated'](),controller[_0xfa57('0xa')]);router[_0xfa57('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfa57('0xc')](_0xfa57('0x9'),auth[_0xfa57('0xd')](),controller[_0xfa57('0xe')]);router[_0xfa57('0xf')](_0xfa57('0x9'),auth['isAuthenticated'](),controller[_0xfa57('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 986ef04..2110fed 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 _0xc038=['name','long','type','select','parse','values','isArray','BOOLEAN','ENUM','voice','sequelize','lodash','exports','alias','STRING','setDataValue','getDataValue'];(function(_0x1a72e2,_0x1027f3){var _0x5f0ed4=function(_0x234d14){while(--_0x234d14){_0x1a72e2['push'](_0x1a72e2['shift']());}};_0x5f0ed4(++_0x1027f3);}(_0xc038,0xc5));var _0x8c03=function(_0x3c0dc9,_0x4a6adc){_0x3c0dc9=_0x3c0dc9-0x0;var _0x389ced=_0xc038[_0x3c0dc9];return _0x389ced;};'use strict';var Sequelize=require(_0x8c03('0x0'));var _=require(_0x8c03('0x1'));module[_0x8c03('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4deb93){return this['getDataValue'](_0x8c03('0x3'));}},'alias':{'type':Sequelize[_0x8c03('0x4')],'allowNull':![],'set':function(_0x40b83f){this[_0x8c03('0x5')](_0x8c03('0x3'),_0x40b83f?_0x40b83f:this[_0x8c03('0x6')](_0x8c03('0x7')));}},'type':{'type':Sequelize[_0x8c03('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x8c03('0x8')),'get':function(){if(this['getDataValue'](_0x8c03('0x9'))===_0x8c03('0xa')){return JSON[_0x8c03('0xb')](this[_0x8c03('0x6')](_0x8c03('0xc')));}else{return this[_0x8c03('0x6')](_0x8c03('0xc'));}},'set':function(_0x3c2ad2){if(Array[_0x8c03('0xd')](_0x3c2ad2)){this[_0x8c03('0x5')](_0x8c03('0xc'),JSON['stringify'](_0x3c2ad2));}else{this[_0x8c03('0x5')]('values',_0x3c2ad2);}}},'required':{'type':Sequelize[_0x8c03('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x8c03('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x8c03('0xf')](_0x8c03('0x10'))}}; \ No newline at end of file +var _0x62fd=['values','isArray','setDataValue','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','name','TEXT','long','type','select','parse'];(function(_0x323102,_0x1ad655){var _0x27f9bf=function(_0x52a4cc){while(--_0x52a4cc){_0x323102['push'](_0x323102['shift']());}};_0x27f9bf(++_0x1ad655);}(_0x62fd,0x78));var _0xd62f=function(_0x3c0fe4,_0x1c0c02){_0x3c0fe4=_0x3c0fe4-0x0;var _0x427e85=_0x62fd[_0x3c0fe4];return _0x427e85;};'use strict';var Sequelize=require(_0xd62f('0x0'));var _=require(_0xd62f('0x1'));module[_0xd62f('0x2')]={'name':{'type':Sequelize[_0xd62f('0x3')],'get':function(_0x585ad9){return this[_0xd62f('0x4')](_0xd62f('0x5'));}},'alias':{'type':Sequelize[_0xd62f('0x6')],'allowNull':![],'set':function(_0x2bdf72){this['setDataValue'](_0xd62f('0x5'),_0x2bdf72?_0x2bdf72:this[_0xd62f('0x4')](_0xd62f('0x7')));}},'type':{'type':Sequelize[_0xd62f('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xd62f('0x8')](_0xd62f('0x9')),'get':function(){if(this[_0xd62f('0x4')](_0xd62f('0xa'))===_0xd62f('0xb')){return JSON[_0xd62f('0xc')](this[_0xd62f('0x4')](_0xd62f('0xd')));}else{return this['getDataValue'](_0xd62f('0xd'));}},'set':function(_0x456d3b){if(Array[_0xd62f('0xe')](_0x456d3b)){this['setDataValue'](_0xd62f('0xd'),JSON['stringify'](_0x456d3b));}else{this[_0xd62f('0xf')]('values',_0x456d3b);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xd62f('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xd62f('0x11')](_0xd62f('0x12'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index d1e2375..157d8df 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 _0xf791=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','save','then','destroy','sendStatus','error','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','length','nolimit','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','update','body','find','create','sequelize','Sequelize','text','TEXT','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0xd2b477,_0x5a4172){var _0x3c4c98=function(_0x594b1c){while(--_0x594b1c){_0xd2b477['push'](_0xd2b477['shift']());}};_0x3c4c98(++_0x5a4172);}(_0xf791,0xf0));var _0x1f79=function(_0x3401ce,_0x5d1579){_0x3401ce=_0x3401ce-0x0;var _0x1bb79d=_0xf791[_0x3401ce];return _0x1bb79d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f79('0x0'));var zipdir=require(_0x1f79('0x1'));var jsonpatch=require(_0x1f79('0x2'));var rp=require('request-promise');var moment=require(_0x1f79('0x3'));var BPromise=require(_0x1f79('0x4'));var Mustache=require(_0x1f79('0x5'));var util=require('util');var path=require(_0x1f79('0x6'));var sox=require('sox');var csv=require(_0x1f79('0x7'));var ejs=require(_0x1f79('0x8'));var fs=require('fs');var fs_extra=require(_0x1f79('0x9'));var _=require(_0x1f79('0xa'));var squel=require(_0x1f79('0xb'));var crypto=require(_0x1f79('0xc'));var jsforce=require(_0x1f79('0xd'));var deskjs=require(_0x1f79('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1f79('0xf'));var Papa=require(_0x1f79('0x10'));var Redis=require(_0x1f79('0x11'));var authService=require(_0x1f79('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1f79('0x13'));var hardwareService=require(_0x1f79('0x14'));var logger=require(_0x1f79('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x1f79('0x16'));var licenseUtil=require(_0x1f79('0x17'));var db=require(_0x1f79('0x18'))['db'];function respondWithStatusCode(_0x15481d,_0x3e3fb7){_0x3e3fb7=_0x3e3fb7||0xcc;return function(_0x435ed1){if(_0x435ed1){return _0x15481d['sendStatus'](_0x3e3fb7);}return _0x15481d[_0x1f79('0x19')](_0x3e3fb7)[_0x1f79('0x1a')]();};}function respondWithResult(_0x3b04a4,_0x717e66){_0x717e66=_0x717e66||0xc8;return function(_0x3401ce){if(_0x3401ce){return _0x3b04a4[_0x1f79('0x19')](_0x717e66)[_0x1f79('0x1b')](_0x3401ce);}};}function respondWithFilteredResult(_0x520411,_0x389acb){return function(_0x1a072b){if(_0x1a072b){var _0x17b585=typeof _0x389acb[_0x1f79('0x1c')]==='undefined'&&typeof _0x389acb[_0x1f79('0x1d')]==='undefined';var _0x5766a9=_0x1a072b['count'];var _0x31ba52=_0x17b585?0x0:_0x389acb[_0x1f79('0x1c')];var _0x1833d3=_0x17b585?_0x1a072b[_0x1f79('0x1e')]:_0x389acb[_0x1f79('0x1c')]+_0x389acb[_0x1f79('0x1d')];var _0x1756dc;if(_0x1833d3>=_0x5766a9){_0x1833d3=_0x5766a9;_0x1756dc=0xc8;}else{_0x1756dc=0xce;}_0x520411[_0x1f79('0x19')](_0x1756dc);return _0x520411[_0x1f79('0x1f')](_0x1f79('0x20'),_0x31ba52+'-'+_0x1833d3+'/'+_0x5766a9)[_0x1f79('0x1b')](_0x1a072b);}return null;};}function patchUpdates(_0x50a6a0){return function(_0x27173b){try{jsonpatch['apply'](_0x27173b,_0x50a6a0,!![]);}catch(_0x53bf4d){return BPromise['reject'](_0x53bf4d);}return _0x27173b[_0x1f79('0x21')]();};}function saveUpdates(_0x42c70f,_0x4a10e1){return function(_0x26d86b){if(_0x26d86b){return _0x26d86b['update'](_0x42c70f)[_0x1f79('0x22')](function(_0x5e20b9){return _0x5e20b9;});}return null;};}function removeEntity(_0x38e07f,_0x257273){return function(_0xd66cdd){if(_0xd66cdd){return _0xd66cdd[_0x1f79('0x23')]()[_0x1f79('0x22')](function(){_0x38e07f['status'](0xcc)[_0x1f79('0x1a')]();});}};}function handleEntityNotFound(_0x1fdd95,_0x22d652){return function(_0x415d59){if(!_0x415d59){_0x1fdd95[_0x1f79('0x24')](0x194);}return _0x415d59;};}function handleError(_0xb78d6,_0x52f3f6){_0x52f3f6=_0x52f3f6||0x1f4;return function(_0x2cc1cd){logger[_0x1f79('0x25')](_0x2cc1cd['stack']);if(_0x2cc1cd[_0x1f79('0x26')]){delete _0x2cc1cd[_0x1f79('0x26')];}_0xb78d6[_0x1f79('0x19')](_0x52f3f6)[_0x1f79('0x27')](_0x2cc1cd);};}exports[_0x1f79('0x28')]=function(_0x1b9f40,_0x48beb4){var _0xa4c0a5={},_0xdb06db={},_0x58569e={'count':0x0,'rows':[]};var _0x511d24=_[_0x1f79('0x29')](db[_0x1f79('0x2a')][_0x1f79('0x2b')],function(_0x22119e){return{'name':_0x22119e[_0x1f79('0x2c')],'type':_0x22119e[_0x1f79('0x2d')][_0x1f79('0x2e')]};});_0xdb06db[_0x1f79('0x2f')]=_[_0x1f79('0x30')](_['map'](_0x511d24,_0x1f79('0x26')),[_0x1f79('0x26')]);_0xdb06db[_0x1f79('0x31')]=_[_0x1f79('0x32')](_0x1b9f40[_0x1f79('0x31')]);_0xdb06db[_0x1f79('0x33')]=_[_0x1f79('0x34')](_0xdb06db[_0x1f79('0x2f')],_0xdb06db[_0x1f79('0x31')]);_0xa4c0a5['attributes']=_[_0x1f79('0x34')](_0xdb06db[_0x1f79('0x2f')],qs[_0x1f79('0x35')](_0x1b9f40['query'][_0x1f79('0x35')]));_0xa4c0a5[_0x1f79('0x36')]=_0xa4c0a5[_0x1f79('0x36')][_0x1f79('0x37')]?_0xa4c0a5[_0x1f79('0x36')]:_0xdb06db['model'];if(!_0x1b9f40['query']['hasOwnProperty'](_0x1f79('0x38'))){_0xa4c0a5[_0x1f79('0x1d')]=qs[_0x1f79('0x1d')](_0x1b9f40[_0x1f79('0x31')][_0x1f79('0x1d')]);_0xa4c0a5['offset']=qs[_0x1f79('0x1c')](_0x1b9f40[_0x1f79('0x31')][_0x1f79('0x1c')]);}_0xa4c0a5['order']=qs['sort'](_0x1b9f40[_0x1f79('0x31')]['sort']);_0xa4c0a5[_0x1f79('0x39')]=qs['filters'](_['pick'](_0x1b9f40['query'],_0xdb06db[_0x1f79('0x33')]),_0x511d24);if(_0x1b9f40[_0x1f79('0x31')][_0x1f79('0x3a')]){_0xa4c0a5['where']=_[_0x1f79('0x3b')](_0xa4c0a5[_0x1f79('0x39')],{'$or':_['map'](_0x511d24,function(_0x39e6df){if(_0x39e6df['type']!==_0x1f79('0x3c')){var _0x35d80e={};_0x35d80e[_0x39e6df[_0x1f79('0x26')]]={'$like':'%'+_0x1b9f40['query'][_0x1f79('0x3a')]+'%'};return _0x35d80e;}})});}_0xa4c0a5=_['merge']({},_0xa4c0a5,_0x1b9f40[_0x1f79('0x3d')]);var _0x1b9774={'where':_0xa4c0a5[_0x1f79('0x39')]};return db['CmCustomField']['count'](_0x1b9774)['then'](function(_0x520aab){_0x58569e[_0x1f79('0x1e')]=_0x520aab;if(_0x1b9f40['query'][_0x1f79('0x3e')]){_0xa4c0a5[_0x1f79('0x3f')]=[{'all':!![]}];}return db['CmCustomField'][_0x1f79('0x40')](_0xa4c0a5);})[_0x1f79('0x22')](function(_0x22520e){_0x58569e[_0x1f79('0x41')]=_0x22520e;return _0x58569e;})[_0x1f79('0x22')](respondWithFilteredResult(_0x48beb4,_0xa4c0a5))[_0x1f79('0x42')](handleError(_0x48beb4,null));};exports[_0x1f79('0x43')]=function(_0x2525b6,_0xa5e6d6){var _0x3e93e4={'raw':!![],'where':{'id':_0x2525b6[_0x1f79('0x44')]['id']}},_0x5f2c26={};_0x5f2c26[_0x1f79('0x2f')]=_[_0x1f79('0x32')](db[_0x1f79('0x2a')]['rawAttributes']);_0x5f2c26['query']=_['keys'](_0x2525b6[_0x1f79('0x31')]);_0x5f2c26['filters']=_[_0x1f79('0x34')](_0x5f2c26[_0x1f79('0x2f')],_0x5f2c26['query']);_0x3e93e4[_0x1f79('0x36')]=_[_0x1f79('0x34')](_0x5f2c26[_0x1f79('0x2f')],qs[_0x1f79('0x35')](_0x2525b6[_0x1f79('0x31')][_0x1f79('0x35')]));_0x3e93e4[_0x1f79('0x36')]=_0x3e93e4[_0x1f79('0x36')][_0x1f79('0x37')]?_0x3e93e4[_0x1f79('0x36')]:_0x5f2c26[_0x1f79('0x2f')];if(_0x2525b6[_0x1f79('0x31')][_0x1f79('0x3e')]){_0x3e93e4[_0x1f79('0x3f')]=[{'all':!![]}];}_0x3e93e4=_[_0x1f79('0x3b')]({},_0x3e93e4,_0x2525b6[_0x1f79('0x3d')]);return db['CmCustomField']['find'](_0x3e93e4)[_0x1f79('0x22')](handleEntityNotFound(_0xa5e6d6,null))[_0x1f79('0x22')](respondWithResult(_0xa5e6d6,null))[_0x1f79('0x42')](handleError(_0xa5e6d6,null));};exports[_0x1f79('0x45')]=function(_0x324180,_0x4912f5){if(_0x324180[_0x1f79('0x46')]['id']){delete _0x324180['body']['id'];}return db[_0x1f79('0x2a')][_0x1f79('0x47')]({'where':{'id':_0x324180[_0x1f79('0x44')]['id']}})[_0x1f79('0x22')](handleEntityNotFound(_0x4912f5,null))[_0x1f79('0x22')](saveUpdates(_0x324180[_0x1f79('0x46')],null))[_0x1f79('0x22')](respondWithResult(_0x4912f5,null))[_0x1f79('0x42')](handleError(_0x4912f5,null));};exports[_0x1f79('0x23')]=function(_0x4a4d90,_0x143816){return db[_0x1f79('0x2a')][_0x1f79('0x47')]({'where':{'id':_0x4a4d90['params']['id']}})['then'](handleEntityNotFound(_0x143816,null))[_0x1f79('0x22')](removeEntity(_0x143816,null))['catch'](handleError(_0x143816,null));};exports[_0x1f79('0x48')]=function(_0x4477ea,_0x150d69){var _0x3e9df1;return db[_0x1f79('0x49')]['transaction'](function(_0x1222f4){return db[_0x1f79('0x2a')][_0x1f79('0x48')](_0x4477ea[_0x1f79('0x46')],{'transaction':_0x1222f4})[_0x1f79('0x22')](function(_0xdc366b){_0x3e9df1=_0xdc366b;var _0x5d8c6a={'type':db[_0x1f79('0x4a')]['TEXT'],'transaction':_0x1222f4};switch(_0x4477ea['body'][_0x1f79('0x2d')]){case _0x1f79('0x4b'):_0x5d8c6a['type']=db[_0x1f79('0x4a')][_0x1f79('0x4c')];break;case _0x1f79('0x4d'):_0x5d8c6a[_0x1f79('0x2d')]=db[_0x1f79('0x4a')]['INTEGER'];break;case _0x1f79('0x4e'):_0x5d8c6a[_0x1f79('0x2d')]=db[_0x1f79('0x4a')][_0x1f79('0x4f')];_0x5d8c6a[_0x1f79('0x50')]=![];break;default:}return db[_0x1f79('0x49')][_0x1f79('0x51')][_0x1f79('0x52')]('cm_contacts',util[_0x1f79('0x53')](_0x1f79('0x54'),_0x3e9df1['id']),_0x5d8c6a);})['then'](function(){return _0x3e9df1;});})['then'](respondWithResult(_0x150d69,0xc9))[_0x1f79('0x42')](handleError(_0x150d69,null));}; \ No newline at end of file +var _0xc08c=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','differenceBy','query','keys','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','CmCustomField','includeAll','include','rows','show','intersection','merge','options','update','body','find','catch','params','transaction','Sequelize','TEXT','text','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc08c,0xef));var _0xcc08=function(_0x1501e1,_0x5343a7){_0x1501e1=_0x1501e1-0x0;var _0x1c2ce2=_0xc08c[_0x1501e1];return _0x1c2ce2;};'use strict';var emlformat=require(_0xcc08('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc08('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc08('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcc08('0x3'));var util=require(_0xcc08('0x4'));var path=require(_0xcc08('0x5'));var sox=require(_0xcc08('0x6'));var csv=require(_0xcc08('0x7'));var ejs=require(_0xcc08('0x8'));var fs=require('fs');var fs_extra=require(_0xcc08('0x9'));var _=require(_0xcc08('0xa'));var squel=require(_0xcc08('0xb'));var crypto=require('crypto');var jsforce=require(_0xcc08('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcc08('0x7'));var querystring=require(_0xcc08('0xd'));var Papa=require('papaparse');var Redis=require(_0xcc08('0xe'));var authService=require(_0xcc08('0xf'));var qs=require(_0xcc08('0x10'));var as=require(_0xcc08('0x11'));var hardwareService=require(_0xcc08('0x12'));var logger=require(_0xcc08('0x13'))(_0xcc08('0x14'));var utils=require(_0xcc08('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcc08('0x16'));var db=require(_0xcc08('0x17'))['db'];function respondWithStatusCode(_0x102a3b,_0x1b581f){_0x1b581f=_0x1b581f||0xcc;return function(_0x27e7b8){if(_0x27e7b8){return _0x102a3b[_0xcc08('0x18')](_0x1b581f);}return _0x102a3b['status'](_0x1b581f)[_0xcc08('0x19')]();};}function respondWithResult(_0x25306d,_0x4becf5){_0x4becf5=_0x4becf5||0xc8;return function(_0x3011c0){if(_0x3011c0){return _0x25306d[_0xcc08('0x1a')](_0x4becf5)[_0xcc08('0x1b')](_0x3011c0);}};}function respondWithFilteredResult(_0xc33946,_0x477db8){return function(_0x339c24){if(_0x339c24){var _0x2117d2=typeof _0x477db8[_0xcc08('0x1c')]===_0xcc08('0x1d')&&typeof _0x477db8['limit']===_0xcc08('0x1d');var _0x54fb5c=_0x339c24[_0xcc08('0x1e')];var _0x3528e2=_0x2117d2?0x0:_0x477db8[_0xcc08('0x1c')];var _0x2a276a=_0x2117d2?_0x339c24[_0xcc08('0x1e')]:_0x477db8[_0xcc08('0x1c')]+_0x477db8[_0xcc08('0x1f')];var _0x1d0ea8;if(_0x2a276a>=_0x54fb5c){_0x2a276a=_0x54fb5c;_0x1d0ea8=0xc8;}else{_0x1d0ea8=0xce;}_0xc33946[_0xcc08('0x1a')](_0x1d0ea8);return _0xc33946[_0xcc08('0x20')](_0xcc08('0x21'),_0x3528e2+'-'+_0x2a276a+'/'+_0x54fb5c)[_0xcc08('0x1b')](_0x339c24);}return null;};}function patchUpdates(_0x376b10){return function(_0x152b5a){try{jsonpatch[_0xcc08('0x22')](_0x152b5a,_0x376b10,!![]);}catch(_0x2a3a20){return BPromise['reject'](_0x2a3a20);}return _0x152b5a['save']();};}function saveUpdates(_0x1c2a91,_0x5a7b84){return function(_0x3d34e0){if(_0x3d34e0){return _0x3d34e0['update'](_0x1c2a91)[_0xcc08('0x23')](function(_0x4dda98){return _0x4dda98;});}return null;};}function removeEntity(_0x5216d1,_0x4a5f13){return function(_0x423988){if(_0x423988){return _0x423988[_0xcc08('0x24')]()[_0xcc08('0x23')](function(){_0x5216d1[_0xcc08('0x1a')](0xcc)[_0xcc08('0x19')]();});}};}function handleEntityNotFound(_0x308952,_0x143e75){return function(_0x113a4d){if(!_0x113a4d){_0x308952[_0xcc08('0x18')](0x194);}return _0x113a4d;};}function handleError(_0xa476c8,_0x2bcf66){_0x2bcf66=_0x2bcf66||0x1f4;return function(_0x28aeef){logger[_0xcc08('0x25')](_0x28aeef[_0xcc08('0x26')]);if(_0x28aeef[_0xcc08('0x27')]){delete _0x28aeef['name'];}_0xa476c8[_0xcc08('0x1a')](_0x2bcf66)[_0xcc08('0x28')](_0x28aeef);};}exports[_0xcc08('0x29')]=function(_0x378a87,_0x1ac4aa){var _0x37aad1={},_0x537d05={},_0x4dbf57={'count':0x0,'rows':[]};var _0x381d92=_[_0xcc08('0x2a')](db['CmCustomField'][_0xcc08('0x2b')],function(_0x592e40){return{'name':_0x592e40['fieldName'],'type':_0x592e40[_0xcc08('0x2c')][_0xcc08('0x2d')]};});_0x537d05[_0xcc08('0x2e')]=_[_0xcc08('0x2f')](_[_0xcc08('0x2a')](_0x381d92,_0xcc08('0x27')),[_0xcc08('0x27')]);_0x537d05[_0xcc08('0x30')]=_[_0xcc08('0x31')](_0x378a87[_0xcc08('0x30')]);_0x537d05['filters']=_['intersection'](_0x537d05[_0xcc08('0x2e')],_0x537d05[_0xcc08('0x30')]);_0x37aad1[_0xcc08('0x32')]=_['intersection'](_0x537d05[_0xcc08('0x2e')],qs['fields'](_0x378a87[_0xcc08('0x30')][_0xcc08('0x33')]));_0x37aad1['attributes']=_0x37aad1[_0xcc08('0x32')][_0xcc08('0x34')]?_0x37aad1[_0xcc08('0x32')]:_0x537d05['model'];if(!_0x378a87[_0xcc08('0x30')][_0xcc08('0x35')]('nolimit')){_0x37aad1[_0xcc08('0x1f')]=qs[_0xcc08('0x1f')](_0x378a87[_0xcc08('0x30')][_0xcc08('0x1f')]);_0x37aad1['offset']=qs[_0xcc08('0x1c')](_0x378a87[_0xcc08('0x30')]['offset']);}_0x37aad1[_0xcc08('0x36')]=qs['sort'](_0x378a87[_0xcc08('0x30')][_0xcc08('0x37')]);_0x37aad1[_0xcc08('0x38')]=qs[_0xcc08('0x39')](_[_0xcc08('0x3a')](_0x378a87[_0xcc08('0x30')],_0x537d05['filters']),_0x381d92);if(_0x378a87[_0xcc08('0x30')][_0xcc08('0x3b')]){_0x37aad1[_0xcc08('0x38')]=_['merge'](_0x37aad1[_0xcc08('0x38')],{'$or':_[_0xcc08('0x2a')](_0x381d92,function(_0x1c5cc8){if(_0x1c5cc8[_0xcc08('0x2c')]!==_0xcc08('0x3c')){var _0x4d0191={};_0x4d0191[_0x1c5cc8[_0xcc08('0x27')]]={'$like':'%'+_0x378a87[_0xcc08('0x30')]['filter']+'%'};return _0x4d0191;}})});}_0x37aad1=_['merge']({},_0x37aad1,_0x378a87['options']);var _0x3a8913={'where':_0x37aad1[_0xcc08('0x38')]};return db[_0xcc08('0x3d')][_0xcc08('0x1e')](_0x3a8913)[_0xcc08('0x23')](function(_0x134f71){_0x4dbf57[_0xcc08('0x1e')]=_0x134f71;if(_0x378a87[_0xcc08('0x30')][_0xcc08('0x3e')]){_0x37aad1[_0xcc08('0x3f')]=[{'all':!![]}];}return db[_0xcc08('0x3d')]['findAll'](_0x37aad1);})[_0xcc08('0x23')](function(_0x3b91c3){_0x4dbf57[_0xcc08('0x40')]=_0x3b91c3;return _0x4dbf57;})[_0xcc08('0x23')](respondWithFilteredResult(_0x1ac4aa,_0x37aad1))['catch'](handleError(_0x1ac4aa,null));};exports[_0xcc08('0x41')]=function(_0x5312a2,_0x541be2){var _0x46ee19={'raw':!![],'where':{'id':_0x5312a2['params']['id']}},_0x1bbe1d={};_0x1bbe1d[_0xcc08('0x2e')]=_[_0xcc08('0x31')](db[_0xcc08('0x3d')]['rawAttributes']);_0x1bbe1d[_0xcc08('0x30')]=_['keys'](_0x5312a2[_0xcc08('0x30')]);_0x1bbe1d[_0xcc08('0x39')]=_[_0xcc08('0x42')](_0x1bbe1d[_0xcc08('0x2e')],_0x1bbe1d[_0xcc08('0x30')]);_0x46ee19[_0xcc08('0x32')]=_[_0xcc08('0x42')](_0x1bbe1d[_0xcc08('0x2e')],qs[_0xcc08('0x33')](_0x5312a2['query'][_0xcc08('0x33')]));_0x46ee19[_0xcc08('0x32')]=_0x46ee19[_0xcc08('0x32')][_0xcc08('0x34')]?_0x46ee19[_0xcc08('0x32')]:_0x1bbe1d['model'];if(_0x5312a2[_0xcc08('0x30')][_0xcc08('0x3e')]){_0x46ee19[_0xcc08('0x3f')]=[{'all':!![]}];}_0x46ee19=_[_0xcc08('0x43')]({},_0x46ee19,_0x5312a2[_0xcc08('0x44')]);return db[_0xcc08('0x3d')]['find'](_0x46ee19)[_0xcc08('0x23')](handleEntityNotFound(_0x541be2,null))[_0xcc08('0x23')](respondWithResult(_0x541be2,null))['catch'](handleError(_0x541be2,null));};exports[_0xcc08('0x45')]=function(_0x21e92f,_0x581089){if(_0x21e92f[_0xcc08('0x46')]['id']){delete _0x21e92f['body']['id'];}return db[_0xcc08('0x3d')][_0xcc08('0x47')]({'where':{'id':_0x21e92f['params']['id']}})['then'](handleEntityNotFound(_0x581089,null))[_0xcc08('0x23')](saveUpdates(_0x21e92f['body'],null))[_0xcc08('0x23')](respondWithResult(_0x581089,null))[_0xcc08('0x48')](handleError(_0x581089,null));};exports[_0xcc08('0x24')]=function(_0x504e54,_0xf79c35){return db['CmCustomField']['find']({'where':{'id':_0x504e54[_0xcc08('0x49')]['id']}})[_0xcc08('0x23')](handleEntityNotFound(_0xf79c35,null))[_0xcc08('0x23')](removeEntity(_0xf79c35,null))['catch'](handleError(_0xf79c35,null));};exports['create']=function(_0x43c6cf,_0x40f602){var _0x6ede51;return db['sequelize'][_0xcc08('0x4a')](function(_0x5739db){return db[_0xcc08('0x3d')]['create'](_0x43c6cf[_0xcc08('0x46')],{'transaction':_0x5739db})['then'](function(_0x497990){_0x6ede51=_0x497990;var _0xa424dc={'type':db[_0xcc08('0x4b')][_0xcc08('0x4c')],'transaction':_0x5739db};switch(_0x43c6cf[_0xcc08('0x46')][_0xcc08('0x2c')]){case _0xcc08('0x4d'):_0xa424dc[_0xcc08('0x2c')]=db['Sequelize'][_0xcc08('0x4c')];break;case _0xcc08('0x4e'):_0xa424dc[_0xcc08('0x2c')]=db[_0xcc08('0x4b')]['INTEGER'];break;case _0xcc08('0x4f'):_0xa424dc[_0xcc08('0x2c')]=db['Sequelize'][_0xcc08('0x50')];_0xa424dc[_0xcc08('0x51')]=![];break;default:}return db['sequelize'][_0xcc08('0x52')][_0xcc08('0x53')]('cm_contacts',util[_0xcc08('0x54')](_0xcc08('0x55'),_0x6ede51['id']),_0xa424dc);})['then'](function(){return _0x6ede51;});})['then'](respondWithResult(_0x40f602,0xc9))[_0xcc08('0x48')](handleError(_0x40f602,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 0c549d5..1e6a5f9 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 _0x8040=['api','moment','bluebird','path','rimraf','../../config/environment','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x210a3a,_0x1f5265){var _0x328725=function(_0x21de5f){while(--_0x21de5f){_0x210a3a['push'](_0x210a3a['shift']());}};_0x328725(++_0x1f5265);}(_0x8040,0x17a));var _0x0804=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x8040[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x0804('0x0'));var util=require(_0x0804('0x1'));var logger=require('../../config/logger')(_0x0804('0x2'));var moment=require(_0x0804('0x3'));var BPromise=require(_0x0804('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0804('0x5'));var rimraf=require(_0x0804('0x6'));var config=require(_0x0804('0x7'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x463ae8,_0x1021f0){return _0x463ae8['define'](_0x0804('0x8'),attributes,{'tableName':_0x0804('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaca6=['request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','api','moment','bluebird'];(function(_0x398306,_0x5cd3d8){var _0x4abbd0=function(_0xf77b4){while(--_0xf77b4){_0x398306['push'](_0x398306['shift']());}};_0x4abbd0(++_0x5cd3d8);}(_0xaca6,0xb1));var _0x6aca=function(_0x1f84e8,_0x3e1cc8){_0x1f84e8=_0x1f84e8-0x0;var _0x13837a=_0xaca6[_0x1f84e8];return _0x13837a;};'use strict';var _=require(_0x6aca('0x0'));var util=require(_0x6aca('0x1'));var logger=require('../../config/logger')(_0x6aca('0x2'));var moment=require(_0x6aca('0x3'));var BPromise=require(_0x6aca('0x4'));var rp=require(_0x6aca('0x5'));var fs=require('fs');var path=require(_0x6aca('0x6'));var rimraf=require(_0x6aca('0x7'));var config=require(_0x6aca('0x8'));var attributes=require(_0x6aca('0x9'));module[_0x6aca('0xa')]=function(_0x553587,_0x4f28e3){return _0x553587[_0x6aca('0xb')](_0x6aca('0xc'),attributes,{'tableName':_0x6aca('0xd'),'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 3066c22..b8a246a 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 _0x63cc=['CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5de56d,_0x1e883d){var _0x1770d2=function(_0x25d4dc){while(--_0x25d4dc){_0x5de56d['push'](_0x5de56d['shift']());}};_0x1770d2(++_0x1e883d);}(_0x63cc,0x85));var _0xc63c=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x63cc[_0xd7b0a4];return _0x184e9e;};'use strict';var _=require(_0xc63c('0x0'));var util=require(_0xc63c('0x1'));var moment=require(_0xc63c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc63c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc63c('0x4'));var logger=require(_0xc63c('0x5'))('rpc');var config=require(_0xc63c('0x6'));var jayson=require(_0xc63c('0x7'));var client=jayson['client'][_0xc63c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58f333,_0x4b301b,_0x336f30){return new BPromise(function(_0x3c10a6,_0x45d3e4){return client['request'](_0x58f333,_0x336f30)[_0xc63c('0x9')](function(_0x1391d6){logger[_0xc63c('0xa')](_0xc63c('0xb'),_0x4b301b,_0xc63c('0xc'));logger[_0xc63c('0xd')](_0xc63c('0xe'),_0x4b301b,_0xc63c('0xc'),JSON[_0xc63c('0xf')](_0x1391d6));if(_0x1391d6['error']){if(_0x1391d6[_0xc63c('0x10')][_0xc63c('0x11')]===0x1f4){logger[_0xc63c('0x10')]('CmCustomField,\x20%s,\x20%s',_0x4b301b,_0x1391d6[_0xc63c('0x10')]['message']);return _0x45d3e4(_0x1391d6['error'][_0xc63c('0x12')]);}logger['error'](_0xc63c('0xb'),_0x4b301b,_0x1391d6[_0xc63c('0x10')][_0xc63c('0x12')]);return _0x3c10a6(_0x1391d6['error']['message']);}else{logger[_0xc63c('0xa')](_0xc63c('0xb'),_0x4b301b,_0xc63c('0xc'));_0x3c10a6(_0x1391d6[_0xc63c('0x13')][_0xc63c('0x12')]);}})[_0xc63c('0x14')](function(_0x671cc6){logger[_0xc63c('0x10')]('CmCustomField,\x20%s,\x20%s',_0x4b301b,_0x671cc6);_0x45d3e4(_0x671cc6);});});} \ No newline at end of file +var _0x2e20=['../../config/environment','jayson/promise','client','http','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x2e20,0x66));var _0x02e2=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0x2e20[_0x5a1a51];return _0x47edd7;};'use strict';var _=require(_0x02e2('0x0'));var util=require(_0x02e2('0x1'));var moment=require(_0x02e2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02e2('0x3'));var db=require(_0x02e2('0x4'))['db'];var utils=require(_0x02e2('0x5'));var logger=require(_0x02e2('0x6'))(_0x02e2('0x7'));var config=require(_0x02e2('0x8'));var jayson=require(_0x02e2('0x9'));var client=jayson[_0x02e2('0xa')][_0x02e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x226930,_0x572d7f,_0x23a038){return new BPromise(function(_0x2095e4,_0x1f268c){return client['request'](_0x226930,_0x23a038)[_0x02e2('0xc')](function(_0x16c017){logger[_0x02e2('0xd')](_0x02e2('0xe'),_0x572d7f,_0x02e2('0xf'));logger[_0x02e2('0x10')](_0x02e2('0x11'),_0x572d7f,_0x02e2('0xf'),JSON['stringify'](_0x16c017));if(_0x16c017[_0x02e2('0x12')]){if(_0x16c017[_0x02e2('0x12')]['code']===0x1f4){logger['error'](_0x02e2('0xe'),_0x572d7f,_0x16c017[_0x02e2('0x12')][_0x02e2('0x13')]);return _0x1f268c(_0x16c017[_0x02e2('0x12')][_0x02e2('0x13')]);}logger['error'](_0x02e2('0xe'),_0x572d7f,_0x16c017['error'][_0x02e2('0x13')]);return _0x2095e4(_0x16c017['error']['message']);}else{logger['info'](_0x02e2('0xe'),_0x572d7f,_0x02e2('0xf'));_0x2095e4(_0x16c017[_0x02e2('0x14')][_0x02e2('0x13')]);}})[_0x02e2('0x15')](function(_0x41cacc){logger[_0x02e2('0x12')]('CmCustomField,\x20%s,\x20%s',_0x572d7f,_0x41cacc);_0x1f268c(_0x41cacc);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 97fc91c..bb3a2b9 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 _0x4540=['../../config/environment','./cmCustomField.controller','get','isAuthenticated','post','create','put','/:id','update','delete','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x363b81,_0x81e6ca){var _0x1d92fb=function(_0x129644){while(--_0x129644){_0x363b81['push'](_0x363b81['shift']());}};_0x1d92fb(++_0x81e6ca);}(_0x4540,0x17b));var _0x0454=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4540[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0454('0x0'));var util=require(_0x0454('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0454('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0454('0x3'));var interaction=require(_0x0454('0x4'));var config=require(_0x0454('0x5'));var controller=require(_0x0454('0x6'));router[_0x0454('0x7')]('/',auth[_0x0454('0x8')](),controller['index']);router[_0x0454('0x7')]('/:id',auth[_0x0454('0x8')](),controller['show']);router[_0x0454('0x9')]('/',auth['isAuthenticated'](),controller[_0x0454('0xa')]);router[_0x0454('0xb')](_0x0454('0xc'),auth['isAuthenticated'](),controller[_0x0454('0xd')]);router[_0x0454('0xe')](_0x0454('0xc'),auth[_0x0454('0x8')](),controller['destroy']);module[_0x0454('0xf')]=router; \ No newline at end of file +var _0xc3a8=['update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x1ad41d,_0xbf3160){var _0xd39b3d=function(_0x58b40f){while(--_0x58b40f){_0x1ad41d['push'](_0x1ad41d['shift']());}};_0xd39b3d(++_0xbf3160);}(_0xc3a8,0xe8));var _0x8c3a=function(_0x31b350,_0x5be290){_0x31b350=_0x31b350-0x0;var _0x1870dc=_0xc3a8[_0x31b350];return _0x1870dc;};'use strict';var multer=require(_0x8c3a('0x0'));var util=require(_0x8c3a('0x1'));var path=require(_0x8c3a('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c3a('0x3'));var router=express['Router']();var fs_extra=require(_0x8c3a('0x4'));var auth=require(_0x8c3a('0x5'));var interaction=require(_0x8c3a('0x6'));var config=require(_0x8c3a('0x7'));var controller=require('./cmCustomField.controller');router[_0x8c3a('0x8')]('/',auth[_0x8c3a('0x9')](),controller[_0x8c3a('0xa')]);router[_0x8c3a('0x8')](_0x8c3a('0xb'),auth[_0x8c3a('0x9')](),controller['show']);router[_0x8c3a('0xc')]('/',auth[_0x8c3a('0x9')](),controller[_0x8c3a('0xd')]);router[_0x8c3a('0xe')](_0x8c3a('0xb'),auth['isAuthenticated'](),controller[_0x8c3a('0xf')]);router[_0x8c3a('0x10')]('/:id',auth[_0x8c3a('0x9')](),controller[_0x8c3a('0x11')]);module[_0x8c3a('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 8739fc8..3917afb 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 _0xaa1c=['STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','exports'];(function(_0x12d5f5,_0x39af33){var _0x54558b=function(_0x59ed24){while(--_0x59ed24){_0x12d5f5['push'](_0x12d5f5['shift']());}};_0x54558b(++_0x39af33);}(_0xaa1c,0x10c));var _0xcaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1c[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xcaa1('0x0'));var Sequelize=require('sequelize');module[_0xcaa1('0x1')]={'phone':{'type':Sequelize[_0xcaa1('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xcaa1('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xcaa1('0x4')],'defaultValue':moment()[_0xcaa1('0x5')](_0xcaa1('0x6'))},'countbusyretry':{'type':Sequelize[_0xcaa1('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xcaa1('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xcaa1('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xcaa1('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xcaa1('0x4')]},'priority':{'type':Sequelize[_0xcaa1('0x7')](0x2)[_0xcaa1('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xcaa1('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xcaa1('0x7')],'unique':_0xcaa1('0x9')},'ListId':{'type':Sequelize[_0xcaa1('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xcaa1('0x7')],'unique':_0xcaa1('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xcaa1('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xcaa1('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xcaa1('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xcaa1('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xcaa1('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xcaa1('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xcaa1('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0xcaa1('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xcab1=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','STRING','BOOLEAN','DATE'];(function(_0x2097a1,_0x37773a){var _0x2c38c4=function(_0x3039f7){while(--_0x3039f7){_0x2097a1['push'](_0x2097a1['shift']());}};_0x2c38c4(++_0x37773a);}(_0xcab1,0x9e));var _0x1cab=function(_0x3c4897,_0x4bc2c1){_0x3c4897=_0x3c4897-0x0;var _0xc0c2c7=_0xcab1[_0x3c4897];return _0xc0c2c7;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x1cab('0x0')],'allowNull':![]},'active':{'type':Sequelize[_0x1cab('0x1')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x1cab('0x2')],'defaultValue':moment()['format'](_0x1cab('0x3'))},'countbusyretry':{'type':Sequelize[_0x1cab('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1cab('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x1cab('0x1')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1cab('0x0')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1cab('0x2')]},'priority':{'type':Sequelize[_0x1cab('0x4')](0x2)[_0x1cab('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x1cab('0x1')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x1cab('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x1cab('0x6')},'UserId':{'type':Sequelize[_0x1cab('0x4')]},'VoiceQueueId':{'type':Sequelize[_0x1cab('0x4')],'unique':_0x1cab('0x6')},'CampaignId':{'type':Sequelize[_0x1cab('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x1cab('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1cab('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1cab('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1cab('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x1cab('0x4')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x1cab('0x0')]},'recallmeNotifiedDate':{'type':Sequelize[_0x1cab('0x2')],'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 9e45f81..0bb693f 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 _0x4300=['Company','List','Queue','dialActive','getPreviewRecall','findOne','CmList','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','getTimezones','timezones','push','utcOffset','getTimezone','moment','../../config/environment','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','update','then','error','CmHopper','rawAttributes','fieldName','model','map','name','query','keys','intersection','filters','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','length','find','body','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','create','CmHopperAdditionalPhone','end','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','phone','recallme','UPDATE','Contact','CmCompany'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x4300,0x1a6));var _0x0430=function(_0x2e4f87,_0x158f90){_0x2e4f87=_0x2e4f87-0x0;var _0x3167ac=_0x4300[_0x2e4f87];return _0x3167ac;};'use strict';var moment=require(_0x0430('0x0'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var shared=require(_0x0430('0x1'));var db=require(_0x0430('0x2'))['db'];function respondWithResult(_0x1c139f,_0x2a1e62){_0x2a1e62=_0x2a1e62||0xc8;return function(_0x1735aa){if(_0x1735aa){return _0x1c139f['status'](_0x2a1e62)[_0x0430('0x3')](_0x1735aa);}};}function respondWithFilteredResult(_0x5943c0,_0x16efe3){return function(_0x5b03ef){if(_0x5b03ef){var _0x2388b9=typeof _0x16efe3[_0x0430('0x4')]===_0x0430('0x5')&&typeof _0x16efe3[_0x0430('0x6')]===_0x0430('0x5');var _0x108a08=_0x5b03ef[_0x0430('0x7')];var _0x3af75c=_0x2388b9?0x0:_0x16efe3[_0x0430('0x4')];var _0x4972da=_0x2388b9?_0x5b03ef[_0x0430('0x7')]:_0x16efe3[_0x0430('0x4')]+_0x16efe3[_0x0430('0x6')];var _0x22e630;if(_0x4972da>=_0x108a08){_0x4972da=_0x108a08;_0x22e630=0xc8;}else{_0x22e630=0xce;}_0x5943c0[_0x0430('0x8')](_0x22e630);return _0x5943c0[_0x0430('0x9')](_0x0430('0xa'),_0x3af75c+'-'+_0x4972da+'/'+_0x108a08)[_0x0430('0x3')](_0x5b03ef);}return null;};}function saveUpdates(_0x5315a3,_0x4b382a){return function(_0x4292f7){if(_0x4292f7){return _0x4292f7[_0x0430('0xb')](_0x5315a3)[_0x0430('0xc')](function(_0x32caa1){return _0x32caa1;});}return null;};}function handleEntityNotFound(_0x671534,_0x39d4e2){return function(_0x182e2c){if(!_0x182e2c){_0x671534['sendStatus'](0x194);}return _0x182e2c;};}function handleError(_0xb34f43,_0x40e6dc){_0x40e6dc=_0x40e6dc||0x1f4;return function(_0x8fe471){logger[_0x0430('0xd')](_0x8fe471['stack']);if(_0x8fe471['name']){delete _0x8fe471['name'];}_0xb34f43[_0x0430('0x8')](_0x40e6dc)['send'](_0x8fe471);};}exports['index']=function(_0x1a3239,_0x2f23b9){var _0x391791={},_0xd33c3c={},_0x15d020={'count':0x0,'rows':[]};var _0x5ed513=_['map'](db[_0x0430('0xe')][_0x0430('0xf')],function(_0x35ffdb){return{'name':_0x35ffdb[_0x0430('0x10')],'type':_0x35ffdb['type']['key']};});_0xd33c3c[_0x0430('0x11')]=_[_0x0430('0x12')](_0x5ed513,_0x0430('0x13'));_0xd33c3c[_0x0430('0x14')]=_[_0x0430('0x15')](_0x1a3239[_0x0430('0x14')]);_0xd33c3c['filters']=_[_0x0430('0x16')](_0xd33c3c[_0x0430('0x11')],_0xd33c3c[_0x0430('0x14')]);_0xd33c3c[_0x0430('0x17')]=_['concat'](_0xd33c3c[_0x0430('0x17')],[_0x0430('0x18'),_0x0430('0x19'),_0x0430('0x1a'),_0x0430('0x1b'),_0x0430('0x1c'),_0x0430('0x1d'),_0x0430('0x1e'),_0x0430('0x1f'),'$not',_0x0430('0x20'),'$notBetween','$in',_0x0430('0x21'),_0x0430('0x22'),'$notLike',_0x0430('0x23'),_0x0430('0x24'),_0x0430('0x22'),_0x0430('0x25'),_0x0430('0x26'),_0x0430('0x27'),_0x0430('0x28')]);_0x391791[_0x0430('0x29')]=_[_0x0430('0x16')](_0xd33c3c['model'],qs['fields'](_0x1a3239['query'][_0x0430('0x2a')]));_0x391791['attributes']=_0x391791[_0x0430('0x29')]['length']?_0x391791['attributes']:_0xd33c3c[_0x0430('0x11')];if(!_0x1a3239[_0x0430('0x14')][_0x0430('0x2b')](_0x0430('0x2c'))){_0x391791['limit']=qs['limit'](_0x1a3239[_0x0430('0x14')][_0x0430('0x6')]);_0x391791['offset']=qs['offset'](_0x1a3239[_0x0430('0x14')][_0x0430('0x4')]);}_0x391791[_0x0430('0x2d')]=qs[_0x0430('0x2e')](_0x1a3239[_0x0430('0x14')][_0x0430('0x2e')]);_0x391791[_0x0430('0x2f')]=qs[_0x0430('0x17')](_[_0x0430('0x30')](_0x1a3239['query'],_0xd33c3c[_0x0430('0x17')]),_0x5ed513);if(_0x1a3239[_0x0430('0x14')][_0x0430('0x31')]){_0x391791['where']=_[_0x0430('0x32')](_0x391791['where'],{'$or':_[_0x0430('0x12')](_0x5ed513,function(_0x504b68){if(_0x504b68['type']!==_0x0430('0x33')){var _0x38e33b={};_0x38e33b[_0x504b68[_0x0430('0x13')]]={'$like':'%'+_0x1a3239[_0x0430('0x14')][_0x0430('0x31')]+'%'};return _0x38e33b;}})});}_0x391791=_[_0x0430('0x32')]({},_0x391791,_0x1a3239['options']);var _0x659aca={'where':_0x391791[_0x0430('0x2f')]};return db[_0x0430('0xe')][_0x0430('0x7')](_0x659aca)[_0x0430('0xc')](function(_0x41490f){_0x15d020[_0x0430('0x7')]=_0x41490f;if(_0x1a3239[_0x0430('0x14')][_0x0430('0x34')]){_0x391791[_0x0430('0x35')]=[{'all':!![]}];}return db['CmHopper'][_0x0430('0x36')](_0x391791);})[_0x0430('0xc')](function(_0x418255){_0x15d020[_0x0430('0x37')]=_0x418255;return _0x15d020;})[_0x0430('0xc')](respondWithFilteredResult(_0x2f23b9,_0x391791))[_0x0430('0x38')](handleError(_0x2f23b9,null));};exports['show']=function(_0xaf12ad,_0x3adadb){var _0x50cdcd={'raw':!![],'where':{'id':_0xaf12ad[_0x0430('0x39')]['id']}},_0x2eeff1={};_0x2eeff1[_0x0430('0x11')]=_[_0x0430('0x15')](db[_0x0430('0xe')][_0x0430('0xf')]);_0x2eeff1[_0x0430('0x14')]=_[_0x0430('0x15')](_0xaf12ad[_0x0430('0x14')]);_0x2eeff1['filters']=_[_0x0430('0x16')](_0x2eeff1[_0x0430('0x11')],_0x2eeff1[_0x0430('0x14')]);_0x50cdcd[_0x0430('0x29')]=_['intersection'](_0x2eeff1[_0x0430('0x11')],qs[_0x0430('0x2a')](_0xaf12ad[_0x0430('0x14')][_0x0430('0x2a')]));_0x50cdcd[_0x0430('0x29')]=_0x50cdcd[_0x0430('0x29')][_0x0430('0x3a')]?_0x50cdcd[_0x0430('0x29')]:_0x2eeff1[_0x0430('0x11')];if(_0xaf12ad[_0x0430('0x14')][_0x0430('0x34')]){_0x50cdcd['include']=[{'all':!![]}];}_0x50cdcd=_[_0x0430('0x32')]({},_0x50cdcd,_0xaf12ad['options']);return db['CmHopper'][_0x0430('0x3b')](_0x50cdcd)['then'](handleEntityNotFound(_0x3adadb,null))['then'](respondWithResult(_0x3adadb,null))[_0x0430('0x38')](handleError(_0x3adadb,null));};exports['create']=function(_0x5d7b2f,_0x424e40){return db['CmHopper']['create'](_0x5d7b2f[_0x0430('0x3c')],{})['then'](respondWithResult(_0x424e40,0xc9))['catch'](handleError(_0x424e40,null));};exports[_0x0430('0xb')]=function(_0x175c07,_0x129f61){if(_0x175c07['body']['id']){delete _0x175c07[_0x0430('0x3c')]['id'];}return db[_0x0430('0xe')][_0x0430('0x3b')]({'where':{'id':_0x175c07['params']['id']}})['then'](handleEntityNotFound(_0x129f61,null))[_0x0430('0xc')](saveUpdates(_0x175c07[_0x0430('0x3c')],null))[_0x0430('0xc')](respondWithResult(_0x129f61,null))[_0x0430('0x38')](handleError(_0x129f61,null));};exports['describe']=function(_0x5a4500,_0x5b107e){return db[_0x0430('0xe')][_0x0430('0x3d')]()[_0x0430('0xc')](respondWithResult(_0x5b107e,null))[_0x0430('0x38')](handleError(_0x5b107e,null));};exports[_0x0430('0x3e')]=function(_0x421280,_0x5c3184){var _0x53879b;var _0x29ed30=_0x421280[_0x0430('0x39')]['id'];return db[_0x0430('0xe')][_0x0430('0x3b')]({'where':{'id':_0x421280[_0x0430('0x39')]['id']}})[_0x0430('0xc')](handleEntityNotFound(_0x5c3184,null))[_0x0430('0xc')](function(_0x2a3092){if(_0x2a3092){return _0x2a3092[_0x0430('0x3e')]()[_0x0430('0xc')](function(_0x4387db){return _0x4387db;});}})[_0x0430('0xc')](function(_0x4a2097){_0x53879b=_0x4a2097;if(_0x4a2097){if(_0x4a2097['VoiceQueueId']||_0x4a2097[_0x0430('0x3f')]){return db[_0x4a2097[_0x0430('0x40')]?_0x0430('0x41'):_0x0430('0x42')][_0x0430('0x3b')]({'where':{'id':_0x4a2097[_0x0430('0x40')]?_0x4a2097[_0x0430('0x40')]:_0x4a2097[_0x0430('0x3f')]},'attributes':['id',_0x0430('0x13')],'raw':!![]});}}})[_0x0430('0xc')](function(_0x40b02a){var _0x1a7698={};if(_0x40b02a){_[_0x0430('0x32')](_0x1a7698,_[_0x0430('0x43')](_0x53879b[_0x0430('0x44')],[_0x0430('0x45'),_0x0430('0x46'),'id']));_0x1a7698[_0x0430('0x47')]=0x15;_0x1a7698['statedesc']=_0x0430('0x48');_0x1a7698[_0x0430('0x49')]=_0x40b02a[_0x0430('0x13')];_0x1a7698[_0x0430('0x4a')]=_0x421280[_0x0430('0x4b')][_0x0430('0x13')];_0x1a7698[_0x0430('0x4c')]=_0x421280[_0x0430('0x4b')]['id'];_0x1a7698[_0x0430('0x48')]=!![];_0x1a7698['deletedat']=moment()[_0x0430('0x4d')](_0x0430('0x4e'));_0x1a7698[_0x0430('0x4f')]=_0x53879b['phone'];_0x1a7698[_0x0430('0x50')]=_0x53879b['VoiceQueueId']?_0x0430('0x51'):_0x0430('0x52');return db[_0x0430('0x53')][_0x0430('0x3b')]({'where':{'id':_0x1a7698[_0x0430('0x54')]},'attributes':[_0x0430('0x55'),'lastName']})[_0x0430('0xc')](function(_0x2bb9d7){if(!_[_0x0430('0x56')](_0x5c3184)&&!_[_0x0430('0x56')](_0x2bb9d7[_0x0430('0x55')])){_0x1a7698[_0x0430('0x57')]=_0x2bb9d7[_0x0430('0x55')];if(!_[_0x0430('0x56')](_0x2bb9d7[_0x0430('0x58')])){_0x1a7698[_0x0430('0x57')]+='\x20'+_0x2bb9d7[_0x0430('0x58')];}}})[_0x0430('0x59')](function(){return db['CmHopperFinal'][_0x0430('0x5a')](_0x1a7698);});}})[_0x0430('0xc')](function(_0x8d5d6a){return db[_0x0430('0x5b')][_0x0430('0x3e')]({'where':{'CmHopperId':_0x29ed30}});})[_0x0430('0xc')](function(){return _0x5c3184[_0x0430('0x8')](0xcc)[_0x0430('0x5c')]();})[_0x0430('0x38')](handleError(_0x5c3184,null));};exports['getPreview']=function(_0x2dbf77,_0x19381c){var _0x30298f=[];return db[_0x0430('0x53')][_0x0430('0x3d')]()[_0x0430('0xc')](function(_0xc78054){_0x30298f=_[_0x0430('0x15')](_0xc78054);return _0x2dbf77[_0x0430('0x4b')][_0x0430('0x5d')]({'where':{'type':_0x0430('0x5e'),'dialActive':!![],'dialMethod':_0x0430('0x5f')},'attributes':['id',_0x0430('0x60'),_0x0430('0x61')],'raw':!![]});})['then'](function(_0x1d0503){if(_0x1d0503&&_0x1d0503[_0x0430('0x3a')]){return db[_0x0430('0x62')][_0x0430('0x63')](function(_0x294c98){var _0x5982cf={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x0430('0x4e'))},'VoiceQueueId':{'$in':_[_0x0430('0x12')](_0x1d0503,'id')},'$or':[{'UserId':null},{'UserId':_0x2dbf77[_0x0430('0x4b')]['id']}]};var _0x27ca0c={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1d0503)[_0x0430('0x31')](['dialPreviewAutoRecallMe',0x0])[_0x0430('0x12')]('id')[_0x0430('0x64')]()},'$or':[{'UserId':null},{'UserId':_0x2dbf77['user']['id']}]};var _0x1335cb={'$or':[_0x5982cf,_0x27ca0c]};var _0x3c6a59=[];if(_0x2dbf77[_0x0430('0x3c')]['direction']&&_0x2dbf77[_0x0430('0x3c')][_0x0430('0x65')]===_0x0430('0x66')){if(!_[_0x0430('0x67')](_0x2dbf77[_0x0430('0x3c')][_0x0430('0x68')])){_0x1335cb['id']={'$in':_0x2dbf77[_0x0430('0x3c')][_0x0430('0x68')]};}_0x3c6a59=[[_0x0430('0x69'),_0x0430('0x6a')],[_0x0430('0x6b'),_0x1d0503[0x0]['dialOrderByScheduledAt']===_0x0430('0x6a')?_0x0430('0x6c'):_0x0430('0x6a')],db['sequelize'][_0x0430('0x6d')](_0x0430('0x6e')),['id',_0x0430('0x6c')]];}else{if(!_[_0x0430('0x67')](_0x2dbf77[_0x0430('0x3c')][_0x0430('0x68')])){_0x1335cb['id']={'$notIn':_0x2dbf77[_0x0430('0x3c')][_0x0430('0x68')]};}_0x3c6a59=[[_0x0430('0x69'),_0x0430('0x6c')],[_0x0430('0x6b'),_0x1d0503[0x0][_0x0430('0x60')]],db[_0x0430('0x62')][_0x0430('0x6d')](_0x0430('0x6f')),['id',_0x0430('0x6a')]];}return db['CmHopper']['findOne']({'attributes':['id',_0x0430('0x70'),_0x0430('0x71'),_0x0430('0x72')],'where':_0x1335cb,'order':_0x3c6a59,'transaction':_0x294c98,'lock':_0x294c98['LOCK'][_0x0430('0x73')],'include':[{'model':db['CmContact'],'as':_0x0430('0x74'),'attributes':_0x30298f,'include':[{'model':db[_0x0430('0x75')],'as':_0x0430('0x76'),'attributes':['id',_0x0430('0x13')]}]},{'model':db['CmList'],'as':_0x0430('0x77'),'attributes':['id','name']},{'model':db[_0x0430('0x41')],'as':_0x0430('0x78'),'attributes':['id',_0x0430('0x13'),_0x0430('0x79')]}]})[_0x0430('0xc')](function(_0x7af0bf){if(_0x7af0bf){return _0x7af0bf[_0x0430('0xb')]({'UserId':_0x2dbf77['user']['id']},{'transaction':_0x294c98});}});});}})['then'](handleEntityNotFound(_0x19381c,null))[_0x0430('0xc')](respondWithResult(_0x19381c,null))[_0x0430('0x38')](handleError(_0x19381c,null));};exports[_0x0430('0x7a')]=function(_0xaa3495,_0x57899b,_0x9f7f5b){var _0x107b74=[];var _0x3ba680=_0xaa3495['params']['id'];var _0x34aa92=_0xaa3495[_0x0430('0x4b')]['id'];return db['CmContact']['describe']()['then'](function(_0x843e42){_0x107b74=_[_0x0430('0x15')](_0x843e42);return db[_0x0430('0x62')][_0x0430('0x63')](function(_0x153163){const _0x3fc4a5={'id':_0x3ba680};return db[_0x0430('0xe')][_0x0430('0x7b')]({'attributes':['id',_0x0430('0x70'),'recallme'],'where':_0x3fc4a5,'transaction':_0x153163,'lock':_0x153163['LOCK'][_0x0430('0x73')],'include':[{'model':db[_0x0430('0x53')],'as':_0x0430('0x74'),'attributes':_0x107b74,'include':[{'model':db[_0x0430('0x75')],'as':'Company','attributes':['id',_0x0430('0x13')]}]},{'model':db[_0x0430('0x7c')],'as':_0x0430('0x77'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0x0430('0x78'),'attributes':['id',_0x0430('0x13'),_0x0430('0x79')]}]})[_0x0430('0xc')](function(_0x12e3ea){if(_0x12e3ea){return _0x12e3ea[_0x0430('0xb')]({'UserId':_0x34aa92},{'transaction':_0x153163});}});});})['then'](handleEntityNotFound(_0x57899b,null))[_0x0430('0xc')](respondWithResult(_0x57899b,null))[_0x0430('0x38')](handleError(_0x57899b,null));};exports[_0x0430('0x7d')]=function(_0xb51729,_0x2a3ee5){return _0xb51729['user']['getVoiceQueues']({'where':{'type':_0x0430('0x5e'),'dialActive':!![],'dialMethod':_0x0430('0x5f')},'attributes':['id'],'raw':!![]})['then'](function(_0x201f83){if(_0x201f83&&_0x201f83['length']){return db[_0x0430('0xe')][_0x0430('0x7')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0430('0x4d')](_0x0430('0x4e'))},'VoiceQueueId':{'$in':_[_0x0430('0x12')](_0x201f83,'id')},'$or':[{'UserId':null},{'UserId':_0xb51729['user']['id']}]}});}return 0x0;})['then'](function(_0x129b13){if(!_['isNil'](_0x129b13)&&_[_0x0430('0x7e')](_0x129b13)){return _0x2a3ee5[_0x0430('0x8')](0xc8)[_0x0430('0x3')]({'contacts':_0x129b13});}else{logger[_0x0430('0xd')](_0x0430('0x7f'),_0x0430('0x7d'),0x194,_0x0430('0x80'));_0x2a3ee5[_0x0430('0x81')](0x194);}})['catch'](handleError(_0x2a3ee5,null));};exports[_0x0430('0x82')]=function(_0x1bb341,_0x49d492){var _0x3ea758=shared[_0x0430('0x83')];var _0x18b1cd=[];_[_0x0430('0x12')](_0x3ea758,function(_0x1898d0){_0x18b1cd[_0x0430('0x84')]({'id':_0x1898d0[_0x0430('0x13')],'name':_0x1898d0[_0x0430('0x13')],'utcOffset':_0x1898d0[_0x0430('0x85')]});});return _0x49d492['status'](0xc8)[_0x0430('0x3')]({'tz':_0x18b1cd});};exports[_0x0430('0x86')]=function(_0x40c745,_0xcdba62){var _0x177dff=shared[_0x0430('0x83')];var _0x4c7b9e={};if(!_[_0x0430('0x56')](_0x177dff[_0x40c745['body']['id']]))_0x4c7b9e=_0x177dff[_0x40c745[_0x0430('0x3c')]['id']];return _0xcdba62[_0x0430('0x8')](0xc8)['json'](_0x4c7b9e);}; \ No newline at end of file +var _0x25fa=['undefined','limit','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','concat','$and','$or','$gt','$gte','$lte','$ne','$not','$notBetween','$notIn','$like','$iLike','$notILike','$overlap','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','CmHopper','rows','catch','show','params','merge','options','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','updatedAt','statedesc','membername','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','isNumber','json','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','getTimezone','moment','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','status','offset'];(function(_0x386f73,_0x4ab3c6){var _0xda2950=function(_0x35b9cf){while(--_0x35b9cf){_0x386f73['push'](_0x386f73['shift']());}};_0xda2950(++_0x4ab3c6);}(_0x25fa,0x109));var _0xa25f=function(_0x3ba99d,_0x26518f){_0x3ba99d=_0x3ba99d-0x0;var _0x1947f5=_0x25fa[_0x3ba99d];return _0x1947f5;};'use strict';var moment=require(_0xa25f('0x0'));var _=require('lodash');var qs=require(_0xa25f('0x1'));var logger=require(_0xa25f('0x2'))('api');var shared=require(_0xa25f('0x3'));var db=require(_0xa25f('0x4'))['db'];function respondWithResult(_0x256155,_0x4d0b34){_0x4d0b34=_0x4d0b34||0xc8;return function(_0x4e444d){if(_0x4e444d){return _0x256155[_0xa25f('0x5')](_0x4d0b34)['json'](_0x4e444d);}};}function respondWithFilteredResult(_0x2ea9ea,_0x3ab530){return function(_0x29666d){if(_0x29666d){var _0x455225=typeof _0x3ab530[_0xa25f('0x6')]===_0xa25f('0x7')&&typeof _0x3ab530[_0xa25f('0x8')]===_0xa25f('0x7');var _0xa27a42=_0x29666d['count'];var _0x1bca18=_0x455225?0x0:_0x3ab530[_0xa25f('0x6')];var _0x507a36=_0x455225?_0x29666d[_0xa25f('0x9')]:_0x3ab530[_0xa25f('0x6')]+_0x3ab530[_0xa25f('0x8')];var _0x22df56;if(_0x507a36>=_0xa27a42){_0x507a36=_0xa27a42;_0x22df56=0xc8;}else{_0x22df56=0xce;}_0x2ea9ea['status'](_0x22df56);return _0x2ea9ea[_0xa25f('0xa')](_0xa25f('0xb'),_0x1bca18+'-'+_0x507a36+'/'+_0xa27a42)['json'](_0x29666d);}return null;};}function saveUpdates(_0x3e970c,_0x465e41){return function(_0x50bb78){if(_0x50bb78){return _0x50bb78[_0xa25f('0xc')](_0x3e970c)[_0xa25f('0xd')](function(_0x1c6052){return _0x1c6052;});}return null;};}function handleEntityNotFound(_0x4b3792,_0x199e18){return function(_0x2a627f){if(!_0x2a627f){_0x4b3792[_0xa25f('0xe')](0x194);}return _0x2a627f;};}function handleError(_0x363668,_0x465809){_0x465809=_0x465809||0x1f4;return function(_0x2d2417){logger[_0xa25f('0xf')](_0x2d2417[_0xa25f('0x10')]);if(_0x2d2417['name']){delete _0x2d2417[_0xa25f('0x11')];}_0x363668[_0xa25f('0x5')](_0x465809)[_0xa25f('0x12')](_0x2d2417);};}exports[_0xa25f('0x13')]=function(_0x18705c,_0x427105){var _0x4a4805={},_0x292171={},_0x5a2d5c={'count':0x0,'rows':[]};var _0x32b868=_['map'](db['CmHopper'][_0xa25f('0x14')],function(_0x489c83){return{'name':_0x489c83[_0xa25f('0x15')],'type':_0x489c83[_0xa25f('0x16')][_0xa25f('0x17')]};});_0x292171[_0xa25f('0x18')]=_[_0xa25f('0x19')](_0x32b868,'name');_0x292171[_0xa25f('0x1a')]=_[_0xa25f('0x1b')](_0x18705c[_0xa25f('0x1a')]);_0x292171[_0xa25f('0x1c')]=_['intersection'](_0x292171[_0xa25f('0x18')],_0x292171[_0xa25f('0x1a')]);_0x292171[_0xa25f('0x1c')]=_[_0xa25f('0x1d')](_0x292171['filters'],[_0xa25f('0x1e'),_0xa25f('0x1f'),_0xa25f('0x20'),_0xa25f('0x21'),'$lt',_0xa25f('0x22'),_0xa25f('0x23'),'$eq',_0xa25f('0x24'),'$between',_0xa25f('0x25'),'$in',_0xa25f('0x26'),_0xa25f('0x27'),'$notLike',_0xa25f('0x28'),_0xa25f('0x29'),'$like',_0xa25f('0x2a'),'$contains',_0xa25f('0x2b'),_0xa25f('0x2c')]);_0x4a4805[_0xa25f('0x2d')]=_[_0xa25f('0x2e')](_0x292171[_0xa25f('0x18')],qs['fields'](_0x18705c[_0xa25f('0x1a')][_0xa25f('0x2f')]));_0x4a4805[_0xa25f('0x2d')]=_0x4a4805[_0xa25f('0x2d')][_0xa25f('0x30')]?_0x4a4805['attributes']:_0x292171[_0xa25f('0x18')];if(!_0x18705c[_0xa25f('0x1a')][_0xa25f('0x31')](_0xa25f('0x32'))){_0x4a4805[_0xa25f('0x8')]=qs[_0xa25f('0x8')](_0x18705c[_0xa25f('0x1a')][_0xa25f('0x8')]);_0x4a4805[_0xa25f('0x6')]=qs['offset'](_0x18705c['query']['offset']);}_0x4a4805[_0xa25f('0x33')]=qs[_0xa25f('0x34')](_0x18705c[_0xa25f('0x1a')][_0xa25f('0x34')]);_0x4a4805[_0xa25f('0x35')]=qs[_0xa25f('0x1c')](_[_0xa25f('0x36')](_0x18705c[_0xa25f('0x1a')],_0x292171[_0xa25f('0x1c')]),_0x32b868);if(_0x18705c[_0xa25f('0x1a')][_0xa25f('0x37')]){_0x4a4805['where']=_['merge'](_0x4a4805[_0xa25f('0x35')],{'$or':_[_0xa25f('0x19')](_0x32b868,function(_0x3d11b7){if(_0x3d11b7['type']!=='VIRTUAL'){var _0x4aadc1={};_0x4aadc1[_0x3d11b7[_0xa25f('0x11')]]={'$like':'%'+_0x18705c[_0xa25f('0x1a')][_0xa25f('0x37')]+'%'};return _0x4aadc1;}})});}_0x4a4805=_['merge']({},_0x4a4805,_0x18705c['options']);var _0x3ced19={'where':_0x4a4805[_0xa25f('0x35')]};return db['CmHopper']['count'](_0x3ced19)[_0xa25f('0xd')](function(_0x33ad7a){_0x5a2d5c[_0xa25f('0x9')]=_0x33ad7a;if(_0x18705c['query'][_0xa25f('0x38')]){_0x4a4805[_0xa25f('0x39')]=[{'all':!![]}];}return db[_0xa25f('0x3a')]['findAll'](_0x4a4805);})['then'](function(_0x3108bb){_0x5a2d5c[_0xa25f('0x3b')]=_0x3108bb;return _0x5a2d5c;})[_0xa25f('0xd')](respondWithFilteredResult(_0x427105,_0x4a4805))[_0xa25f('0x3c')](handleError(_0x427105,null));};exports[_0xa25f('0x3d')]=function(_0x1ae57f,_0x276fa6){var _0x3382f4={'raw':!![],'where':{'id':_0x1ae57f[_0xa25f('0x3e')]['id']}},_0x4af661={};_0x4af661[_0xa25f('0x18')]=_[_0xa25f('0x1b')](db[_0xa25f('0x3a')][_0xa25f('0x14')]);_0x4af661[_0xa25f('0x1a')]=_[_0xa25f('0x1b')](_0x1ae57f[_0xa25f('0x1a')]);_0x4af661[_0xa25f('0x1c')]=_[_0xa25f('0x2e')](_0x4af661[_0xa25f('0x18')],_0x4af661[_0xa25f('0x1a')]);_0x3382f4[_0xa25f('0x2d')]=_['intersection'](_0x4af661[_0xa25f('0x18')],qs['fields'](_0x1ae57f[_0xa25f('0x1a')][_0xa25f('0x2f')]));_0x3382f4[_0xa25f('0x2d')]=_0x3382f4['attributes'][_0xa25f('0x30')]?_0x3382f4[_0xa25f('0x2d')]:_0x4af661[_0xa25f('0x18')];if(_0x1ae57f[_0xa25f('0x1a')]['includeAll']){_0x3382f4[_0xa25f('0x39')]=[{'all':!![]}];}_0x3382f4=_[_0xa25f('0x3f')]({},_0x3382f4,_0x1ae57f[_0xa25f('0x40')]);return db[_0xa25f('0x3a')][_0xa25f('0x41')](_0x3382f4)[_0xa25f('0xd')](handleEntityNotFound(_0x276fa6,null))['then'](respondWithResult(_0x276fa6,null))[_0xa25f('0x3c')](handleError(_0x276fa6,null));};exports[_0xa25f('0x42')]=function(_0x4c77c3,_0x2a91c7){return db[_0xa25f('0x3a')][_0xa25f('0x42')](_0x4c77c3[_0xa25f('0x43')],{})[_0xa25f('0xd')](respondWithResult(_0x2a91c7,0xc9))[_0xa25f('0x3c')](handleError(_0x2a91c7,null));};exports[_0xa25f('0xc')]=function(_0x1eae26,_0x1c355f){if(_0x1eae26[_0xa25f('0x43')]['id']){delete _0x1eae26[_0xa25f('0x43')]['id'];}return db[_0xa25f('0x3a')][_0xa25f('0x41')]({'where':{'id':_0x1eae26['params']['id']}})[_0xa25f('0xd')](handleEntityNotFound(_0x1c355f,null))[_0xa25f('0xd')](saveUpdates(_0x1eae26[_0xa25f('0x43')],null))[_0xa25f('0xd')](respondWithResult(_0x1c355f,null))['catch'](handleError(_0x1c355f,null));};exports[_0xa25f('0x44')]=function(_0x43888b,_0x93cee1){return db['CmHopper'][_0xa25f('0x44')]()[_0xa25f('0xd')](respondWithResult(_0x93cee1,null))[_0xa25f('0x3c')](handleError(_0x93cee1,null));};exports[_0xa25f('0x45')]=function(_0x18c9f2,_0x3b6d34){var _0x31a553;var _0x2a5848=_0x18c9f2['params']['id'];return db[_0xa25f('0x3a')][_0xa25f('0x41')]({'where':{'id':_0x18c9f2[_0xa25f('0x3e')]['id']}})[_0xa25f('0xd')](handleEntityNotFound(_0x3b6d34,null))[_0xa25f('0xd')](function(_0x37ebf2){if(_0x37ebf2){return _0x37ebf2[_0xa25f('0x45')]()[_0xa25f('0xd')](function(_0x26a096){return _0x26a096;});}})[_0xa25f('0xd')](function(_0x2cd16c){_0x31a553=_0x2cd16c;if(_0x2cd16c){if(_0x2cd16c[_0xa25f('0x46')]||_0x2cd16c[_0xa25f('0x47')]){return db[_0x2cd16c[_0xa25f('0x46')]?_0xa25f('0x48'):_0xa25f('0x49')][_0xa25f('0x41')]({'where':{'id':_0x2cd16c[_0xa25f('0x46')]?_0x2cd16c[_0xa25f('0x46')]:_0x2cd16c[_0xa25f('0x47')]},'attributes':['id',_0xa25f('0x11')],'raw':!![]});}}})[_0xa25f('0xd')](function(_0x52671e){var _0x1de4c4={};if(_0x52671e){_[_0xa25f('0x3f')](_0x1de4c4,_[_0xa25f('0x4a')](_0x31a553[_0xa25f('0x4b')],['createdAt',_0xa25f('0x4c'),'id']));_0x1de4c4['state']=0x15;_0x1de4c4[_0xa25f('0x4d')]='deleted';_0x1de4c4['campaign']=_0x52671e[_0xa25f('0x11')];_0x1de4c4[_0xa25f('0x4e')]=_0x18c9f2[_0xa25f('0x4f')][_0xa25f('0x11')];_0x1de4c4[_0xa25f('0x50')]=_0x18c9f2[_0xa25f('0x4f')]['id'];_0x1de4c4[_0xa25f('0x51')]=!![];_0x1de4c4[_0xa25f('0x52')]=moment()[_0xa25f('0x53')](_0xa25f('0x54'));_0x1de4c4[_0xa25f('0x55')]=_0x31a553[_0xa25f('0x56')];_0x1de4c4['campaigntype']=_0x31a553[_0xa25f('0x46')]?_0xa25f('0x57'):_0xa25f('0x58');return db[_0xa25f('0x59')]['find']({'where':{'id':_0x1de4c4[_0xa25f('0x5a')]},'attributes':['firstName',_0xa25f('0x5b')]})[_0xa25f('0xd')](function(_0x36d202){if(!_[_0xa25f('0x5c')](_0x3b6d34)&&!_['isNil'](_0x36d202[_0xa25f('0x5d')])){_0x1de4c4[_0xa25f('0x5e')]=_0x36d202[_0xa25f('0x5d')];if(!_['isNil'](_0x36d202[_0xa25f('0x5b')])){_0x1de4c4['calleridname']+='\x20'+_0x36d202[_0xa25f('0x5b')];}}})['finally'](function(){return db[_0xa25f('0x5f')][_0xa25f('0x42')](_0x1de4c4);});}})[_0xa25f('0xd')](function(_0x37aae1){return db[_0xa25f('0x60')][_0xa25f('0x45')]({'where':{'CmHopperId':_0x2a5848}});})['then'](function(){return _0x3b6d34[_0xa25f('0x5')](0xcc)[_0xa25f('0x61')]();})[_0xa25f('0x3c')](handleError(_0x3b6d34,null));};exports[_0xa25f('0x62')]=function(_0x229f26,_0x2cb2e2){var _0x449bdd=[];return db['CmContact']['describe']()['then'](function(_0xa312d0){_0x449bdd=_[_0xa25f('0x1b')](_0xa312d0);return _0x229f26[_0xa25f('0x4f')][_0xa25f('0x63')]({'where':{'type':_0xa25f('0x64'),'dialActive':!![],'dialMethod':_0xa25f('0x65')},'attributes':['id',_0xa25f('0x66'),_0xa25f('0x67')],'raw':!![]});})[_0xa25f('0xd')](function(_0xb81111){if(_0xb81111&&_0xb81111[_0xa25f('0x30')]){return db['sequelize'][_0xa25f('0x68')](function(_0xeef605){var _0x322db7={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa25f('0x53')](_0xa25f('0x54'))},'VoiceQueueId':{'$in':_['map'](_0xb81111,'id')},'$or':[{'UserId':null},{'UserId':_0x229f26[_0xa25f('0x4f')]['id']}]};var _0x45a8a2={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0xb81111)['filter']([_0xa25f('0x67'),0x0])[_0xa25f('0x19')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x229f26[_0xa25f('0x4f')]['id']}]};var _0xdca81a={'$or':[_0x322db7,_0x45a8a2]};var _0xe0d429=[];if(_0x229f26[_0xa25f('0x43')][_0xa25f('0x69')]&&_0x229f26['body'][_0xa25f('0x69')]===_0xa25f('0x6a')){if(!_[_0xa25f('0x6b')](_0x229f26['body'][_0xa25f('0x6c')])){_0xdca81a['id']={'$in':_0x229f26[_0xa25f('0x43')][_0xa25f('0x6c')]};}_0xe0d429=[['priority',_0xa25f('0x6d')],[_0xa25f('0x6e'),_0xb81111[0x0][_0xa25f('0x66')]===_0xa25f('0x6d')?'DESC':'ASC'],db[_0xa25f('0x6f')][_0xa25f('0x70')](_0xa25f('0x71')),['id',_0xa25f('0x72')]];}else{if(!_[_0xa25f('0x6b')](_0x229f26[_0xa25f('0x43')][_0xa25f('0x6c')])){_0xdca81a['id']={'$notIn':_0x229f26['body']['hopperIds']};}_0xe0d429=[[_0xa25f('0x73'),'DESC'],[_0xa25f('0x6e'),_0xb81111[0x0][_0xa25f('0x66')]],db[_0xa25f('0x6f')][_0xa25f('0x70')](_0xa25f('0x74')),['id',_0xa25f('0x6d')]];}return db[_0xa25f('0x3a')]['findOne']({'attributes':['id',_0xa25f('0x75'),'phone',_0xa25f('0x76')],'where':_0xdca81a,'order':_0xe0d429,'transaction':_0xeef605,'lock':_0xeef605[_0xa25f('0x77')][_0xa25f('0x78')],'include':[{'model':db[_0xa25f('0x59')],'as':_0xa25f('0x79'),'attributes':_0x449bdd,'include':[{'model':db[_0xa25f('0x7a')],'as':_0xa25f('0x7b'),'attributes':['id',_0xa25f('0x11')]}]},{'model':db[_0xa25f('0x7c')],'as':_0xa25f('0x7d'),'attributes':['id',_0xa25f('0x11')]},{'model':db[_0xa25f('0x48')],'as':_0xa25f('0x7e'),'attributes':['id',_0xa25f('0x11'),_0xa25f('0x7f')]}]})[_0xa25f('0xd')](function(_0x4066f9){if(_0x4066f9){return _0x4066f9[_0xa25f('0xc')]({'UserId':_0x229f26[_0xa25f('0x4f')]['id']},{'transaction':_0xeef605});}});});}})[_0xa25f('0xd')](handleEntityNotFound(_0x2cb2e2,null))['then'](respondWithResult(_0x2cb2e2,null))[_0xa25f('0x3c')](handleError(_0x2cb2e2,null));};exports['getPreviewRecall']=function(_0x25a924,_0x46ab86,_0x5cb5f0){var _0x2e3f12=[];var _0x325b94=_0x25a924[_0xa25f('0x3e')]['id'];var _0x985656=_0x25a924['user']['id'];return db[_0xa25f('0x59')][_0xa25f('0x44')]()[_0xa25f('0xd')](function(_0x1007f5){_0x2e3f12=_[_0xa25f('0x1b')](_0x1007f5);return db[_0xa25f('0x6f')][_0xa25f('0x68')](function(_0x2f3d8c){const _0x1ceffa={'id':_0x325b94};return db[_0xa25f('0x3a')]['findOne']({'attributes':['id',_0xa25f('0x75'),_0xa25f('0x76')],'where':_0x1ceffa,'transaction':_0x2f3d8c,'lock':_0x2f3d8c[_0xa25f('0x77')][_0xa25f('0x78')],'include':[{'model':db['CmContact'],'as':_0xa25f('0x79'),'attributes':_0x2e3f12,'include':[{'model':db[_0xa25f('0x7a')],'as':_0xa25f('0x7b'),'attributes':['id',_0xa25f('0x11')]}]},{'model':db[_0xa25f('0x7c')],'as':_0xa25f('0x7d'),'attributes':['id',_0xa25f('0x11')]},{'model':db[_0xa25f('0x48')],'as':'Queue','attributes':['id',_0xa25f('0x11'),_0xa25f('0x7f')]}]})[_0xa25f('0xd')](function(_0x4c6798){if(_0x4c6798){return _0x4c6798[_0xa25f('0xc')]({'UserId':_0x985656},{'transaction':_0x2f3d8c});}});});})[_0xa25f('0xd')](handleEntityNotFound(_0x46ab86,null))[_0xa25f('0xd')](respondWithResult(_0x46ab86,null))[_0xa25f('0x3c')](handleError(_0x46ab86,null));};exports['getOpenContacts']=function(_0x4d8625,_0x46186e){return _0x4d8625[_0xa25f('0x4f')][_0xa25f('0x63')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xa25f('0x65')},'attributes':['id'],'raw':!![]})[_0xa25f('0xd')](function(_0x48e423){if(_0x48e423&&_0x48e423[_0xa25f('0x30')]){return db[_0xa25f('0x3a')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa25f('0x53')](_0xa25f('0x54'))},'VoiceQueueId':{'$in':_[_0xa25f('0x19')](_0x48e423,'id')},'$or':[{'UserId':null},{'UserId':_0x4d8625['user']['id']}]}});}return 0x0;})[_0xa25f('0xd')](function(_0x750430){if(!_['isNil'](_0x750430)&&_[_0xa25f('0x80')](_0x750430)){return _0x46186e[_0xa25f('0x5')](0xc8)[_0xa25f('0x81')]({'contacts':_0x750430});}else{logger[_0xa25f('0xf')](_0xa25f('0x82'),_0xa25f('0x83'),0x194,_0xa25f('0x84'));_0x46186e['sendStatus'](0x194);}})['catch'](handleError(_0x46186e,null));};exports[_0xa25f('0x85')]=function(_0x3734da,_0x1527b7){var _0x37fe95=shared[_0xa25f('0x86')];var _0x4a1864=[];_[_0xa25f('0x19')](_0x37fe95,function(_0x24d32b){_0x4a1864['push']({'id':_0x24d32b['name'],'name':_0x24d32b['name'],'utcOffset':_0x24d32b['utcOffset']});});return _0x1527b7[_0xa25f('0x5')](0xc8)['json']({'tz':_0x4a1864});};exports[_0xa25f('0x87')]=function(_0x3cf45e,_0x570b2a){var _0x534dc4=shared[_0xa25f('0x86')];var _0x9d5ba4={};if(!_[_0xa25f('0x5c')](_0x534dc4[_0x3cf45e['body']['id']]))_0x9d5ba4=_0x534dc4[_0x3cf45e[_0xa25f('0x43')]['id']];return _0x570b2a[_0xa25f('0x5')](0xc8)[_0xa25f('0x81')](_0x9d5ba4);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index ec46a4e..8611efd 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 _0xd117=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0xd117,0x182));var _0x7d11=function(_0x10aa73,_0xc744f4){_0x10aa73=_0x10aa73-0x0;var _0x3496d9=_0xd117[_0x10aa73];return _0x3496d9;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));module[_0x7d11('0xb')]=function(_0x27d7e8,_0x40c3c4){return _0x27d7e8[_0x7d11('0xc')](_0x7d11('0xd'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x7d11('0xe'),'fields':[_0x7d11('0xe')]},{'name':_0x7d11('0xf'),'fields':['phone']},{'name':_0x7d11('0x10'),'fields':[_0x7d11('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc6ac=['./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x3c1866,_0x5dd00e){_0x3c1866=_0x3c1866-0x0;var _0x46b2c3=_0xc6ac[_0x3c1866];return _0x46b2c3;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[{'name':_0xcc6a('0xe'),'fields':['scheduledat']},{'name':_0xcc6a('0xf'),'fields':[_0xcc6a('0xf')]},{'name':_0xcc6a('0x10'),'fields':[_0xcc6a('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 2569fe3..8d923ff 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 _0x54e1=['literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','User','CmList','List','lodash','util','moment','../../mysqldb','../../config/logger','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','map','include','model','debug','stringify','catch','error','message','ShowCmHopper','find','then','info','CreateCmHopper','create','body','UpdateCmHopper','active','destroy','DestroyCmHopper','sequelize','transaction','order','LOCK','UPDATE','keys','Agent','name','voicePause','length','UserId','push','includes','update','all','GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','CmContact','describe','GetCmHopperPreview','Contact','GetContactByPhone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x54e1,0x147));var _0x154e=function(_0x9aedb0,_0x1ddf6f){_0x9aedb0=_0x9aedb0-0x0;var _0x145a61=_0x54e1[_0x9aedb0];return _0x145a61;};'use strict';var _=require(_0x154e('0x0'));var util=require(_0x154e('0x1'));var moment=require(_0x154e('0x2'));var BPromise=require('bluebird');var db=require(_0x154e('0x3'))['db'];var logger=require(_0x154e('0x4'))('rpc');exports[_0x154e('0x5')]=function(_0x2de1b1){var _0x487cca=this;return new Promise(function(_0x2431df,_0x4362b1){return db[_0x154e('0x6')][_0x154e('0x7')]({'raw':_0x2de1b1[_0x154e('0x8')]?_0x2de1b1[_0x154e('0x8')][_0x154e('0x9')]===undefined?!![]:![]:!![],'where':_0x2de1b1[_0x154e('0x8')]?_0x2de1b1[_0x154e('0x8')][_0x154e('0xa')]||null:null,'attributes':_0x2de1b1[_0x154e('0x8')]?_0x2de1b1[_0x154e('0x8')][_0x154e('0xb')]||null:null,'limit':_0x2de1b1[_0x154e('0x8')]?_0x2de1b1[_0x154e('0x8')][_0x154e('0xc')]||null:null,'include':_0x2de1b1['options']?_0x2de1b1[_0x154e('0x8')]['include']?_[_0x154e('0xd')](_0x2de1b1['options'][_0x154e('0xe')],function(_0x3696da){return{'model':db[_0x3696da[_0x154e('0xf')]],'as':_0x3696da['as'],'attributes':_0x3696da[_0x154e('0xb')],'include':_0x3696da[_0x154e('0xe')]?_[_0x154e('0xd')](_0x3696da[_0x154e('0xe')],function(_0x41739a){return{'model':db[_0x41739a[_0x154e('0xf')]],'as':_0x41739a['as'],'attributes':_0x41739a[_0x154e('0xb')],'include':_0x41739a[_0x154e('0xe')]?_[_0x154e('0xd')](_0x41739a[_0x154e('0xe')],function(_0x1d38c4){return{'model':db[_0x1d38c4[_0x154e('0xf')]],'as':_0x1d38c4['as'],'attributes':_0x1d38c4[_0x154e('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1cb541){logger['info']('GetCmHopper',_0x2de1b1);logger[_0x154e('0x10')](_0x154e('0x5'),_0x2de1b1,JSON[_0x154e('0x11')](_0x1cb541));_0x2431df(_0x1cb541);})[_0x154e('0x12')](function(_0x221e60){logger[_0x154e('0x13')](_0x154e('0x5'),_0x221e60[_0x154e('0x14')],_0x2de1b1);_0x4362b1(_0x487cca[_0x154e('0x13')](0x1f4,_0x221e60[_0x154e('0x14')]));});});};exports[_0x154e('0x15')]=function(_0x3497e5){var _0x587880=this;return new Promise(function(_0x21cd1e,_0x373b41){return db[_0x154e('0x6')][_0x154e('0x16')]({'raw':_0x3497e5[_0x154e('0x8')]?_0x3497e5[_0x154e('0x8')][_0x154e('0x9')]===undefined?!![]:![]:!![],'where':_0x3497e5[_0x154e('0x8')]?_0x3497e5['options'][_0x154e('0xa')]||null:null,'attributes':_0x3497e5[_0x154e('0x8')]?_0x3497e5['options']['attributes']||null:null,'include':_0x3497e5[_0x154e('0x8')]?_0x3497e5[_0x154e('0x8')]['include']?_[_0x154e('0xd')](_0x3497e5[_0x154e('0x8')]['include'],function(_0x229748){return{'model':db[_0x229748['model']],'as':_0x229748['as'],'attributes':_0x229748[_0x154e('0xb')],'include':_0x229748[_0x154e('0xe')]?_['map'](_0x229748['include'],function(_0x26d95f){return{'model':db[_0x26d95f[_0x154e('0xf')]],'as':_0x26d95f['as'],'attributes':_0x26d95f[_0x154e('0xb')],'include':_0x26d95f['include']?_[_0x154e('0xd')](_0x26d95f[_0x154e('0xe')],function(_0x4c0b2a){return{'model':db[_0x4c0b2a[_0x154e('0xf')]],'as':_0x4c0b2a['as'],'attributes':_0x4c0b2a[_0x154e('0xb')]};}):[]};}):[]};}):[]:[]})[_0x154e('0x17')](function(_0x40d5e4){logger[_0x154e('0x18')](_0x154e('0x15'),_0x3497e5);logger['debug'](_0x154e('0x15'),_0x3497e5,JSON[_0x154e('0x11')](_0x40d5e4));_0x21cd1e(_0x40d5e4);})[_0x154e('0x12')](function(_0x340e90){logger['error'](_0x154e('0x15'),_0x340e90[_0x154e('0x14')],_0x3497e5);_0x373b41(_0x587880[_0x154e('0x13')](0x1f4,_0x340e90[_0x154e('0x14')]));});});};exports[_0x154e('0x19')]=function(_0x57f13b){var _0x5919ef=this;return new Promise(function(_0x545d11,_0x1f922d){return db[_0x154e('0x6')][_0x154e('0x1a')](_0x57f13b[_0x154e('0x1b')],{'raw':_0x57f13b[_0x154e('0x8')]?_0x57f13b['options'][_0x154e('0x9')]===undefined?!![]:![]:!![]})[_0x154e('0x17')](function(_0x1952b3){logger[_0x154e('0x18')](_0x154e('0x19'),_0x57f13b);logger[_0x154e('0x10')](_0x154e('0x19'),_0x57f13b,JSON['stringify'](_0x1952b3));_0x545d11(_0x1952b3);})[_0x154e('0x12')](function(_0x14472a){logger[_0x154e('0x13')](_0x154e('0x19'),_0x14472a[_0x154e('0x14')],_0x57f13b);_0x1f922d(_0x5919ef[_0x154e('0x13')](0x1f4,_0x14472a[_0x154e('0x14')]));});});};exports[_0x154e('0x1c')]=function(_0x23c753){var _0x3637e0=this;return new Promise(function(_0x1876d9,_0x15b60b){return db[_0x154e('0x6')]['update'](_0x23c753['body'],{'raw':_0x23c753[_0x154e('0x8')]?_0x23c753[_0x154e('0x8')][_0x154e('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23c753[_0x154e('0x8')]?_0x23c753[_0x154e('0x8')]['where']||null:null,'attributes':_0x23c753[_0x154e('0x8')]?_0x23c753[_0x154e('0x8')][_0x154e('0xb')]||null:null,'limit':_0x23c753[_0x154e('0x8')]?_0x23c753[_0x154e('0x8')][_0x154e('0xc')]||null:null})[_0x154e('0x17')](function(_0x3891d8){logger[_0x154e('0x18')](_0x154e('0x1c'),_0x23c753);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x154e('0x11')](_0x23c753['options'][_0x154e('0xa')]),_0x23c753[_0x154e('0x1b')][_0x154e('0x1d')]);logger[_0x154e('0x10')](_0x154e('0x1c'),_0x23c753,JSON['stringify'](_0x3891d8));_0x1876d9(_0x3891d8);})[_0x154e('0x12')](function(_0x3ba3ea){logger[_0x154e('0x13')](_0x154e('0x1c'),_0x3ba3ea[_0x154e('0x14')],_0x23c753);_0x15b60b(_0x3637e0[_0x154e('0x13')](0x1f4,_0x3ba3ea['message']));});});};exports['DestroyCmHopper']=function(_0x20fc53){var _0x1a292a=this;return new Promise(function(_0x4a182d,_0x468b2a){return db[_0x154e('0x6')][_0x154e('0x1e')]({'where':_0x20fc53[_0x154e('0x8')]?_0x20fc53['options'][_0x154e('0xa')]||null:null})[_0x154e('0x17')](function(_0x424368){logger[_0x154e('0x18')](_0x154e('0x1f'),_0x20fc53);logger[_0x154e('0x10')](_0x154e('0x1f'),_0x20fc53,JSON['stringify'](_0x424368));_0x4a182d(_0x424368);})[_0x154e('0x12')](function(_0xef7179){logger[_0x154e('0x13')](_0x154e('0x1f'),_0xef7179['message'],_0x20fc53);_0x468b2a(_0x1a292a[_0x154e('0x13')](0x1f4,_0xef7179[_0x154e('0x14')]));});});};exports['GetContactDialer']=function(_0x52389d){var _0x1c3b31=this;return new Promise(function(_0xa62745,_0x323328){return db['CmContact']['describe']()[_0x154e('0x17')](function(_0x2e6143){return db[_0x154e('0x20')][_0x154e('0x21')](function(_0x4cfc55){return db[_0x154e('0x6')][_0x154e('0x7')]({'where':_0x52389d[_0x154e('0x8')]?_0x52389d['options'][_0x154e('0xa')]||null:null,'attributes':_0x52389d[_0x154e('0x8')]?_0x52389d[_0x154e('0x8')][_0x154e('0xb')]||null:null,'limit':_0x52389d[_0x154e('0x8')]?_0x52389d[_0x154e('0x8')][_0x154e('0xc')]||null:null,'order':_0x52389d[_0x154e('0x8')]?_0x52389d[_0x154e('0x8')][_0x154e('0x22')]||null:null,'transaction':_0x4cfc55,'lock':_0x4cfc55[_0x154e('0x23')][_0x154e('0x24')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0x154e('0x25')](_0x2e6143)},{'model':db['User'],'as':_0x154e('0x26'),'attributes':['id',_0x154e('0x27'),_0x154e('0x28')]}]})['then'](function(_0x34a28d){var _0xefe878=[];var _0x23a754=[];for(var _0x28216c=0x0;_0x28216c<_0x34a28d[_0x154e('0x29')];_0x28216c+=0x1){var _0x4ccde0=_0x34a28d[_0x28216c][_0x154e('0x2a')];if(_0x4ccde0===null){_0xefe878[_0x154e('0x2b')](_0x34a28d[_0x28216c]['update'](_0x52389d[_0x154e('0x1b')],{'transaction':_0x4cfc55}));}else if(!_0x23a754[_0x154e('0x2c')](_0x4ccde0)){_0x23a754['push'](_0x4ccde0);_0xefe878[_0x154e('0x2b')](_0x34a28d[_0x28216c][_0x154e('0x2d')](_0x52389d[_0x154e('0x1b')],{'transaction':_0x4cfc55}));}}return BPromise[_0x154e('0x2e')](_0xefe878);});})[_0x154e('0x17')](function(_0x3d2e45){logger[_0x154e('0x18')](_0x154e('0x2f'),_0x52389d);if(_0x3d2e45[_0x154e('0x29')]>0x0){logger[_0x154e('0x18')](_0x154e('0x30'),_0x3d2e45[0x0][_0x154e('0x31')]['id'],_0x3d2e45[0x0][_0x154e('0x31')][_0x154e('0x32')],_0x3d2e45[0x0][_0x154e('0x31')][_0x154e('0x1d')]);}logger['debug'](_0x154e('0x2f'),_0x52389d,JSON[_0x154e('0x11')](_0x3d2e45));_0xa62745(_0x3d2e45);})[_0x154e('0x12')](function(_0x35dcb2){logger[_0x154e('0x13')](_0x154e('0x2f'),_0x35dcb2[_0x154e('0x14')],_0x52389d);_0x323328(_0x1c3b31[_0x154e('0x13')](0x1f4,_0x35dcb2['message']));});});});};exports['MoveContactManagedDialer']=function(_0x1b03aa){var _0x5b67c9=this;return new Promise(function(_0x396817,_0x2cb1d9){return db[_0x154e('0x20')]['transaction'](function(_0xa65291){return db[_0x154e('0x33')][_0x154e('0x1a')](_0x1b03aa[_0x154e('0x1b')],{'raw':_0x1b03aa['options']?_0x1b03aa[_0x154e('0x8')]['raw']===undefined?!![]:![]:!![],'transaction':_0xa65291})['then'](function(){logger[_0x154e('0x18')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x154e('0x11')](_0x1b03aa['options'][_0x154e('0xa')]),_0x1b03aa[_0x154e('0x8')][_0x154e('0xa')]['active']);return db[_0x154e('0x6')][_0x154e('0x1e')]({'where':_0x1b03aa['options']?_0x1b03aa['options']['where']||null:null,'transaction':_0xa65291});});})[_0x154e('0x17')](function(_0x4b8565){logger[_0x154e('0x18')](_0x154e('0x34'),_0x1b03aa);logger[_0x154e('0x10')](_0x154e('0x34'),_0x1b03aa,JSON[_0x154e('0x11')](_0x4b8565));_0x396817(_0x4b8565);})[_0x154e('0x12')](function(_0x518c45){logger[_0x154e('0x13')](_0x154e('0x34'),_0x518c45[_0x154e('0x14')],_0x1b03aa);_0x2cb1d9(_0x5b67c9[_0x154e('0x13')](0x1f4,_0x518c45[_0x154e('0x14')]));});});};exports[_0x154e('0x35')]=function(_0x282177){var _0x2b1706=this;return new Promise(function(_0x4dad06,_0x8958b9){return db['CmHopper'][_0x154e('0x7')]({'raw':_0x282177[_0x154e('0x8')]?_0x282177[_0x154e('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x282177[_0x154e('0x8')]?_0x282177[_0x154e('0x8')][_0x154e('0xa')]||null:null,'attributes':[[db[_0x154e('0x20')]['fn']('COUNT',db[_0x154e('0x20')]['fn']('IF',db[_0x154e('0x20')]['literal'](_0x154e('0x36')+util['format'](_0x154e('0x37'),moment()[_0x154e('0x38')](_0x154e('0x39')))+_0x154e('0x3a')))),_0x154e('0x3b')]]})[_0x154e('0x17')](function(_0xf4d18c){logger[_0x154e('0x18')](_0x154e('0x35'),_0x282177);logger[_0x154e('0x10')](_0x154e('0x35'),_0x282177,JSON[_0x154e('0x11')](_0xf4d18c));_0x4dad06(_0xf4d18c);})[_0x154e('0x12')](function(_0x3902ef){logger['error'](_0x154e('0x35'),_0x3902ef[_0x154e('0x14')],_0x282177);_0x8958b9(_0x2b1706[_0x154e('0x13')](0x1f4,_0x3902ef[_0x154e('0x14')]));});});};exports[_0x154e('0x3c')]=function(_0x5fefb0){var _0x16dde3=this;return new Promise(function(_0x3ce182,_0x52555f){return db[_0x154e('0x3d')][_0x154e('0x3e')]()['then'](function(){return db[_0x154e('0x20')][_0x154e('0x21')](function(_0x6d49a8){return db[_0x154e('0x6')]['findAll']({'where':_0x5fefb0[_0x154e('0x8')]?_0x5fefb0['options'][_0x154e('0xa')]||null:null,'attributes':_0x5fefb0['options']?_0x5fefb0['options']['attributes']||null:null,'limit':0x1,'order':_0x5fefb0[_0x154e('0x8')]?_0x5fefb0[_0x154e('0x8')][_0x154e('0x22')]||null:null,'group':db[_0x154e('0x6')][_0x154e('0x2a')],'transaction':_0x6d49a8,'lock':_0x6d49a8[_0x154e('0x23')][_0x154e('0x24')],'include':_0x5fefb0['options']?_0x5fefb0[_0x154e('0x8')][_0x154e('0xe')]?_['map'](_0x5fefb0[_0x154e('0x8')][_0x154e('0xe')],function(_0x53baa5){return{'model':db[_0x53baa5[_0x154e('0xf')]],'as':_0x53baa5['as'],'attributes':_0x53baa5[_0x154e('0xb')],'include':_0x53baa5[_0x154e('0xe')]?_[_0x154e('0xd')](_0x53baa5[_0x154e('0xe')],function(_0x395bfb){return{'model':db[_0x395bfb[_0x154e('0xf')]],'as':_0x395bfb['as'],'attributes':_0x395bfb[_0x154e('0xb')],'include':_0x395bfb[_0x154e('0xe')]?_[_0x154e('0xd')](_0x395bfb[_0x154e('0xe')],function(_0x8c931c){return{'model':db[_0x8c931c['model']],'as':_0x8c931c['as'],'attributes':_0x8c931c[_0x154e('0xb')]};}):[]};}):[]};}):[]:[]})[_0x154e('0x17')](function(_0xf3f3e9){var _0x50b348=[];for(var _0x297c59=0x0;_0x297c59<_0xf3f3e9[_0x154e('0x29')];_0x297c59+=0x1){_0x50b348[_0x154e('0x2b')](_0xf3f3e9[_0x297c59]['update'](_0x5fefb0['body'],{'transaction':_0x6d49a8}));}return BPromise[_0x154e('0x2e')](_0x50b348);});})[_0x154e('0x17')](function(_0x7633e8){logger[_0x154e('0x18')]('GetContactRecallMe',_0x5fefb0);logger[_0x154e('0x10')](_0x154e('0x3c'),_0x5fefb0,JSON[_0x154e('0x11')](_0x7633e8));_0x3ce182(_0x7633e8);})[_0x154e('0x12')](function(_0x4e8198){logger['error'](_0x154e('0x3c'),_0x4e8198[_0x154e('0x14')],_0x5fefb0);_0x52555f(_0x16dde3[_0x154e('0x13')](0x1f4,_0x4e8198[_0x154e('0x14')]));});});});};exports[_0x154e('0x3f')]=function(_0x1bf2c1){var _0x49c825=this;return new Promise(function(_0x3b9da7,_0x141044){db['CmContact'][_0x154e('0x3e')]()[_0x154e('0x17')](function(_0x219162){return db[_0x154e('0x6')][_0x154e('0x7')]({'raw':_0x1bf2c1['options']?_0x1bf2c1[_0x154e('0x8')][_0x154e('0x9')]===undefined?!![]:![]:!![],'where':_0x1bf2c1['options']?_0x1bf2c1[_0x154e('0x8')][_0x154e('0xa')]||null:null,'attributes':_0x1bf2c1[_0x154e('0x8')]?_0x1bf2c1[_0x154e('0x8')][_0x154e('0xb')]||null:null,'limit':_0x1bf2c1['options']?_0x1bf2c1[_0x154e('0x8')][_0x154e('0xc')]||null:null,'include':_0x1bf2c1['options']?_0x1bf2c1[_0x154e('0x8')][_0x154e('0xe')]?_[_0x154e('0xd')](_0x1bf2c1[_0x154e('0x8')][_0x154e('0xe')],function(_0xac03e4){return{'model':db[_0xac03e4[_0x154e('0xf')]],'as':_0xac03e4['as'],'attributes':_0xac03e4['as']===_0x154e('0x40')?_['keys'](_0x219162):_0xac03e4[_0x154e('0xb')],'include':_0xac03e4[_0x154e('0xe')]?_[_0x154e('0xd')](_0xac03e4['include'],function(_0x466a21){return{'model':db[_0x466a21[_0x154e('0xf')]],'as':_0x466a21['as'],'attributes':_0x466a21[_0x154e('0xb')],'include':_0x466a21[_0x154e('0xe')]?_[_0x154e('0xd')](_0x466a21[_0x154e('0xe')],function(_0x4dcd27){return{'model':db[_0x4dcd27[_0x154e('0xf')]],'as':_0x4dcd27['as'],'attributes':_0x4dcd27[_0x154e('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x147315){logger[_0x154e('0x18')](_0x154e('0x5'),_0x1bf2c1);logger[_0x154e('0x10')](_0x154e('0x5'),_0x1bf2c1,JSON['stringify'](_0x147315));_0x3b9da7(_0x147315);})[_0x154e('0x12')](function(_0x494aa0){logger['error']('GetCmHopper',_0x494aa0['message'],_0x1bf2c1);_0x141044(_0x49c825['error'](0x1f4,_0x494aa0[_0x154e('0x14')]));});});});};exports[_0x154e('0x41')]=function(_0x3813cf){var _0xe5c498=this;return new Promise(function(_0x22a2af,_0x1853bc){return db[_0x154e('0x3d')]['findOne']({'raw':!![],'where':{'phone':_0x3813cf['options'][_0x154e('0xa')]['phone']},'attributes':['id',_0x154e('0x42')],'order':[['id',_0x154e('0x43')]]})[_0x154e('0x17')](function(_0x222786){logger[_0x154e('0x18')](_0x154e('0x44'),_0x3813cf);logger[_0x154e('0x10')](_0x154e('0x44'),_0x3813cf,JSON['stringify'](_0x222786));_0x22a2af(_0x222786);})[_0x154e('0x12')](function(_0x4d8b6c){logger[_0x154e('0x13')](_0x154e('0x44'),_0x4d8b6c[_0x154e('0x14')],_0x3813cf);_0x1853bc(_0xe5c498['error'](0x1f4,_0x4d8b6c[_0x154e('0x14')]));});});};exports['ResetActiveCalls']=function(_0x1e4c6a){var _0x2e2281=this;return new Promise(function(_0x25fb35,_0x3f15c7){return db[_0x154e('0x20')][_0x154e('0x21')](function(_0x156abd){var _0x5aa742=_0x1e4c6a[_0x154e('0x8')]&&_0x1e4c6a[_0x154e('0x8')][_0x154e('0xa')]?_0x1e4c6a[_0x154e('0x8')][_0x154e('0xa')]:{};return db[_0x154e('0x6')][_0x154e('0x2d')](_0x1e4c6a[_0x154e('0x1b')],{'where':_0x5aa742,'transaction':_0x156abd})['then'](function(_0x16385b){logger[_0x154e('0x18')](_0x154e('0x45'),_0x1e4c6a);logger[_0x154e('0x10')]('ResetActiveCalls',_0x1e4c6a,JSON['stringify'](_0x16385b));_0x25fb35(_0x16385b);})[_0x154e('0x12')](function(_0x230f9f){logger[_0x154e('0x13')](_0x154e('0x45'),_0x230f9f[_0x154e('0x14')],_0x1e4c6a);_0x3f15c7(_0x2e2281[_0x154e('0x13')](0x1f4,_0x230f9f['message']));});});});};exports[_0x154e('0x46')]=function(_0x4cabfb){var _0xd03ddb=this;var _0x2608b2=_0x4cabfb[_0x154e('0x1b')][_0x154e('0xa')][_0x154e('0x47')];var _0xf65b8f=_0x4cabfb['body'][_0x154e('0xa')][_0x154e('0x48')];var _0x106d21=_0x4cabfb['body'][_0x154e('0xa')]['availableAgentsIds'];return new Promise(function(_0x24108c,_0x2b9372){return db[_0x154e('0x6')][_0x154e('0x7')]({'where':{'voiceQueueId':{'$in':_0x2608b2},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x154e('0x20')][_0x154e('0x49')](_0x154e('0x4a')+_0xf65b8f+_0x154e('0x4b')),'$gt':db[_0x154e('0x20')][_0x154e('0x49')](_0x154e('0x4c'))}},'UserId':{'$in':_0x106d21}},'include':[{'model':db[_0x154e('0x3d')],'as':_0x154e('0x40')},{'model':db[_0x154e('0x4d')],'as':'Agent','attributes':['id',_0x154e('0x27'),_0x154e('0x28')]},{'model':db[_0x154e('0x4e')],'as':_0x154e('0x4f')}]})[_0x154e('0x17')](function(_0x586092){if(_0x586092[_0x154e('0x29')]>0x0){return db[_0x154e('0x20')][_0x154e('0x21')](function(_0x202525){return db[_0x154e('0x6')]['update']({'recallmeNotifiedDate':db['sequelize'][_0x154e('0x49')](_0x154e('0x4c'))},{'where':{'id':{'$in':_[_0x154e('0xd')](_0x586092,'id')}},'transaction':_0x202525})['then'](function(){_0x24108c(_0x586092);})['catch'](function(_0x291aad){logger[_0x154e('0x13')](_0x154e('0x46'),_0x291aad[_0x154e('0x14')],_0x4cabfb);_0x2b9372(_0xd03ddb[_0x154e('0x13')](0x1f4,_0x291aad['message']));});})[_0x154e('0x12')](function(_0x1f604f){logger[_0x154e('0x13')](_0x154e('0x46'),_0x1f604f[_0x154e('0x14')],_0x4cabfb);_0x2b9372(_0xd03ddb[_0x154e('0x13')](0x1f4,_0x1f604f[_0x154e('0x14')]));});}else{_0x24108c(_0x586092);}});});}; \ No newline at end of file +var _0x9c5b=['interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','Contact','List','util','moment','../../mysqldb','../../config/logger','GetCmHopper','CmHopper','options','raw','attributes','limit','include','model','map','then','info','debug','stringify','catch','error','ShowCmHopper','find','where','message','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','findAll','order','UPDATE','keys','User','Agent','name','voicePause','length','includes','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','literal','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','LOCK','GetCmHopperPreview','GetContactByPhone','phone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds'];(function(_0x3dfbc3,_0x41a601){var _0x53fc9e=function(_0xaeae50){while(--_0xaeae50){_0x3dfbc3['push'](_0x3dfbc3['shift']());}};_0x53fc9e(++_0x41a601);}(_0x9c5b,0xa3));var _0xb9c5=function(_0x28d833,_0x4277bd){_0x28d833=_0x28d833-0x0;var _0x7efd99=_0x9c5b[_0x28d833];return _0x7efd99;};'use strict';var _=require('lodash');var util=require(_0xb9c5('0x0'));var moment=require(_0xb9c5('0x1'));var BPromise=require('bluebird');var db=require(_0xb9c5('0x2'))['db'];var logger=require(_0xb9c5('0x3'))('rpc');exports[_0xb9c5('0x4')]=function(_0x13bd7d){var _0x5430f8=this;return new Promise(function(_0x493078,_0x4c8833){return db[_0xb9c5('0x5')]['findAll']({'raw':_0x13bd7d[_0xb9c5('0x6')]?_0x13bd7d['options'][_0xb9c5('0x7')]===undefined?!![]:![]:!![],'where':_0x13bd7d[_0xb9c5('0x6')]?_0x13bd7d[_0xb9c5('0x6')]['where']||null:null,'attributes':_0x13bd7d['options']?_0x13bd7d[_0xb9c5('0x6')][_0xb9c5('0x8')]||null:null,'limit':_0x13bd7d['options']?_0x13bd7d[_0xb9c5('0x6')][_0xb9c5('0x9')]||null:null,'include':_0x13bd7d[_0xb9c5('0x6')]?_0x13bd7d[_0xb9c5('0x6')][_0xb9c5('0xa')]?_['map'](_0x13bd7d[_0xb9c5('0x6')]['include'],function(_0x5c64fc){return{'model':db[_0x5c64fc[_0xb9c5('0xb')]],'as':_0x5c64fc['as'],'attributes':_0x5c64fc[_0xb9c5('0x8')],'include':_0x5c64fc['include']?_[_0xb9c5('0xc')](_0x5c64fc['include'],function(_0x58fbf6){return{'model':db[_0x58fbf6[_0xb9c5('0xb')]],'as':_0x58fbf6['as'],'attributes':_0x58fbf6['attributes'],'include':_0x58fbf6[_0xb9c5('0xa')]?_['map'](_0x58fbf6[_0xb9c5('0xa')],function(_0x41c0f2){return{'model':db[_0x41c0f2['model']],'as':_0x41c0f2['as'],'attributes':_0x41c0f2[_0xb9c5('0x8')]};}):[]};}):[]};}):[]:[]})[_0xb9c5('0xd')](function(_0x2bf40d){logger[_0xb9c5('0xe')](_0xb9c5('0x4'),_0x13bd7d);logger[_0xb9c5('0xf')](_0xb9c5('0x4'),_0x13bd7d,JSON[_0xb9c5('0x10')](_0x2bf40d));_0x493078(_0x2bf40d);})[_0xb9c5('0x11')](function(_0x5cd5b0){logger[_0xb9c5('0x12')]('GetCmHopper',_0x5cd5b0['message'],_0x13bd7d);_0x4c8833(_0x5430f8[_0xb9c5('0x12')](0x1f4,_0x5cd5b0['message']));});});};exports[_0xb9c5('0x13')]=function(_0x3eff64){var _0x4fb202=this;return new Promise(function(_0xaa7ce,_0x587b7d){return db[_0xb9c5('0x5')][_0xb9c5('0x14')]({'raw':_0x3eff64[_0xb9c5('0x6')]?_0x3eff64['options'][_0xb9c5('0x7')]===undefined?!![]:![]:!![],'where':_0x3eff64[_0xb9c5('0x6')]?_0x3eff64[_0xb9c5('0x6')][_0xb9c5('0x15')]||null:null,'attributes':_0x3eff64[_0xb9c5('0x6')]?_0x3eff64[_0xb9c5('0x6')][_0xb9c5('0x8')]||null:null,'include':_0x3eff64['options']?_0x3eff64[_0xb9c5('0x6')][_0xb9c5('0xa')]?_[_0xb9c5('0xc')](_0x3eff64[_0xb9c5('0x6')][_0xb9c5('0xa')],function(_0x4d3145){return{'model':db[_0x4d3145[_0xb9c5('0xb')]],'as':_0x4d3145['as'],'attributes':_0x4d3145['attributes'],'include':_0x4d3145['include']?_[_0xb9c5('0xc')](_0x4d3145[_0xb9c5('0xa')],function(_0x27f3c5){return{'model':db[_0x27f3c5['model']],'as':_0x27f3c5['as'],'attributes':_0x27f3c5['attributes'],'include':_0x27f3c5[_0xb9c5('0xa')]?_[_0xb9c5('0xc')](_0x27f3c5['include'],function(_0x22e241){return{'model':db[_0x22e241[_0xb9c5('0xb')]],'as':_0x22e241['as'],'attributes':_0x22e241[_0xb9c5('0x8')]};}):[]};}):[]};}):[]:[]})[_0xb9c5('0xd')](function(_0x433f68){logger['info'](_0xb9c5('0x13'),_0x3eff64);logger[_0xb9c5('0xf')](_0xb9c5('0x13'),_0x3eff64,JSON[_0xb9c5('0x10')](_0x433f68));_0xaa7ce(_0x433f68);})['catch'](function(_0x5a1816){logger['error']('ShowCmHopper',_0x5a1816[_0xb9c5('0x16')],_0x3eff64);_0x587b7d(_0x4fb202[_0xb9c5('0x12')](0x1f4,_0x5a1816['message']));});});};exports[_0xb9c5('0x17')]=function(_0x1e7749){var _0x3366c3=this;return new Promise(function(_0x3cac08,_0x352038){return db[_0xb9c5('0x5')][_0xb9c5('0x18')](_0x1e7749[_0xb9c5('0x19')],{'raw':_0x1e7749['options']?_0x1e7749[_0xb9c5('0x6')][_0xb9c5('0x7')]===undefined?!![]:![]:!![]})[_0xb9c5('0xd')](function(_0x279ca7){logger[_0xb9c5('0xe')](_0xb9c5('0x17'),_0x1e7749);logger[_0xb9c5('0xf')](_0xb9c5('0x17'),_0x1e7749,JSON[_0xb9c5('0x10')](_0x279ca7));_0x3cac08(_0x279ca7);})['catch'](function(_0x2c4dd7){logger['error'](_0xb9c5('0x17'),_0x2c4dd7[_0xb9c5('0x16')],_0x1e7749);_0x352038(_0x3366c3[_0xb9c5('0x12')](0x1f4,_0x2c4dd7['message']));});});};exports[_0xb9c5('0x1a')]=function(_0x481081){var _0x6ff2f4=this;return new Promise(function(_0x4bac33,_0x1485da){return db[_0xb9c5('0x5')][_0xb9c5('0x1b')](_0x481081[_0xb9c5('0x19')],{'raw':_0x481081[_0xb9c5('0x6')]?_0x481081[_0xb9c5('0x6')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x481081[_0xb9c5('0x6')]?_0x481081[_0xb9c5('0x6')][_0xb9c5('0x15')]||null:null,'attributes':_0x481081[_0xb9c5('0x6')]?_0x481081[_0xb9c5('0x6')][_0xb9c5('0x8')]||null:null,'limit':_0x481081[_0xb9c5('0x6')]?_0x481081[_0xb9c5('0x6')][_0xb9c5('0x9')]||null:null})[_0xb9c5('0xd')](function(_0x296030){logger[_0xb9c5('0xe')]('UpdateCmHopper',_0x481081);logger[_0xb9c5('0xe')](_0xb9c5('0x1c'),JSON[_0xb9c5('0x10')](_0x481081[_0xb9c5('0x6')]['where']),_0x481081[_0xb9c5('0x19')][_0xb9c5('0x1d')]);logger['debug'](_0xb9c5('0x1a'),_0x481081,JSON[_0xb9c5('0x10')](_0x296030));_0x4bac33(_0x296030);})['catch'](function(_0x17cb85){logger[_0xb9c5('0x12')](_0xb9c5('0x1a'),_0x17cb85[_0xb9c5('0x16')],_0x481081);_0x1485da(_0x6ff2f4['error'](0x1f4,_0x17cb85[_0xb9c5('0x16')]));});});};exports[_0xb9c5('0x1e')]=function(_0x182576){var _0x1be4de=this;return new Promise(function(_0x4f047d,_0xcb5340){return db[_0xb9c5('0x5')][_0xb9c5('0x1f')]({'where':_0x182576[_0xb9c5('0x6')]?_0x182576['options'][_0xb9c5('0x15')]||null:null})['then'](function(_0x4b3827){logger[_0xb9c5('0xe')]('DestroyCmHopper',_0x182576);logger[_0xb9c5('0xf')]('DestroyCmHopper',_0x182576,JSON['stringify'](_0x4b3827));_0x4f047d(_0x4b3827);})['catch'](function(_0x505512){logger[_0xb9c5('0x12')](_0xb9c5('0x1e'),_0x505512[_0xb9c5('0x16')],_0x182576);_0xcb5340(_0x1be4de[_0xb9c5('0x12')](0x1f4,_0x505512[_0xb9c5('0x16')]));});});};exports[_0xb9c5('0x20')]=function(_0xfad4){var _0x199794=this;return new Promise(function(_0xb82f56,_0x13dcec){return db[_0xb9c5('0x21')][_0xb9c5('0x22')]()[_0xb9c5('0xd')](function(_0x22e92d){return db[_0xb9c5('0x23')][_0xb9c5('0x24')](function(_0x5572ef){return db['CmHopper'][_0xb9c5('0x25')]({'where':_0xfad4[_0xb9c5('0x6')]?_0xfad4[_0xb9c5('0x6')]['where']||null:null,'attributes':_0xfad4['options']?_0xfad4['options'][_0xb9c5('0x8')]||null:null,'limit':_0xfad4['options']?_0xfad4[_0xb9c5('0x6')][_0xb9c5('0x9')]||null:null,'order':_0xfad4[_0xb9c5('0x6')]?_0xfad4[_0xb9c5('0x6')][_0xb9c5('0x26')]||null:null,'transaction':_0x5572ef,'lock':_0x5572ef['LOCK'][_0xb9c5('0x27')],'include':[{'model':db[_0xb9c5('0x21')],'as':'Contact','attributes':_[_0xb9c5('0x28')](_0x22e92d)},{'model':db[_0xb9c5('0x29')],'as':_0xb9c5('0x2a'),'attributes':['id',_0xb9c5('0x2b'),_0xb9c5('0x2c')]}]})[_0xb9c5('0xd')](function(_0x4b03dc){var _0x469ea4=[];var _0x5eb4ed=[];for(var _0x20371c=0x0;_0x20371c<_0x4b03dc[_0xb9c5('0x2d')];_0x20371c+=0x1){var _0x4d292b=_0x4b03dc[_0x20371c]['UserId'];if(_0x4d292b===null){_0x469ea4['push'](_0x4b03dc[_0x20371c][_0xb9c5('0x1b')](_0xfad4['body'],{'transaction':_0x5572ef}));}else if(!_0x5eb4ed[_0xb9c5('0x2e')](_0x4d292b)){_0x5eb4ed[_0xb9c5('0x2f')](_0x4d292b);_0x469ea4[_0xb9c5('0x2f')](_0x4b03dc[_0x20371c]['update'](_0xfad4[_0xb9c5('0x19')],{'transaction':_0x5572ef}));}}return BPromise[_0xb9c5('0x30')](_0x469ea4);});})[_0xb9c5('0xd')](function(_0x55745f){logger[_0xb9c5('0xe')](_0xb9c5('0x20'),_0xfad4);if(_0x55745f[_0xb9c5('0x2d')]>0x0){logger[_0xb9c5('0xe')](_0xb9c5('0x31'),_0x55745f[0x0][_0xb9c5('0x32')]['id'],_0x55745f[0x0][_0xb9c5('0x32')][_0xb9c5('0x33')],_0x55745f[0x0]['dataValues'][_0xb9c5('0x1d')]);}logger['debug'](_0xb9c5('0x20'),_0xfad4,JSON[_0xb9c5('0x10')](_0x55745f));_0xb82f56(_0x55745f);})[_0xb9c5('0x11')](function(_0x2b2eaa){logger['error'](_0xb9c5('0x20'),_0x2b2eaa[_0xb9c5('0x16')],_0xfad4);_0x13dcec(_0x199794[_0xb9c5('0x12')](0x1f4,_0x2b2eaa[_0xb9c5('0x16')]));});});});};exports[_0xb9c5('0x34')]=function(_0x49a9b3){var _0x44e3e1=this;return new Promise(function(_0x4f53bb,_0x49cc15){return db[_0xb9c5('0x23')][_0xb9c5('0x24')](function(_0xfcc9da){return db[_0xb9c5('0x35')][_0xb9c5('0x18')](_0x49a9b3['body'],{'raw':_0x49a9b3[_0xb9c5('0x6')]?_0x49a9b3[_0xb9c5('0x6')][_0xb9c5('0x7')]===undefined?!![]:![]:!![],'transaction':_0xfcc9da})[_0xb9c5('0xd')](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xb9c5('0x10')](_0x49a9b3[_0xb9c5('0x6')][_0xb9c5('0x15')]),_0x49a9b3['options']['where'][_0xb9c5('0x1d')]);return db[_0xb9c5('0x5')][_0xb9c5('0x1f')]({'where':_0x49a9b3[_0xb9c5('0x6')]?_0x49a9b3[_0xb9c5('0x6')][_0xb9c5('0x15')]||null:null,'transaction':_0xfcc9da});});})['then'](function(_0x3f96a1){logger[_0xb9c5('0xe')](_0xb9c5('0x34'),_0x49a9b3);logger['debug']('MoveContactManagedDialer',_0x49a9b3,JSON[_0xb9c5('0x10')](_0x3f96a1));_0x4f53bb(_0x3f96a1);})[_0xb9c5('0x11')](function(_0x2695a5){logger[_0xb9c5('0x12')](_0xb9c5('0x34'),_0x2695a5[_0xb9c5('0x16')],_0x49a9b3);_0x49cc15(_0x44e3e1[_0xb9c5('0x12')](0x1f4,_0x2695a5['message']));});});};exports[_0xb9c5('0x36')]=function(_0x1c9a80){var _0xa81d0a=this;return new Promise(function(_0x27f03f,_0x270814){return db[_0xb9c5('0x5')][_0xb9c5('0x25')]({'raw':_0x1c9a80[_0xb9c5('0x6')]?_0x1c9a80['options'][_0xb9c5('0x7')]===undefined?!![]:![]:!![],'where':_0x1c9a80['options']?_0x1c9a80[_0xb9c5('0x6')][_0xb9c5('0x15')]||null:null,'attributes':[[db['sequelize']['fn'](_0xb9c5('0x37'),db['sequelize']['fn']('IF',db[_0xb9c5('0x23')][_0xb9c5('0x38')]('`scheduledat`\x20>=\x20'+util[_0xb9c5('0x39')]('\x22%s\x22',moment()[_0xb9c5('0x39')](_0xb9c5('0x3a')))+_0xb9c5('0x3b')))),_0xb9c5('0x3c')]]})[_0xb9c5('0xd')](function(_0x256b34){logger[_0xb9c5('0xe')](_0xb9c5('0x36'),_0x1c9a80);logger[_0xb9c5('0xf')]('CountReScheduled',_0x1c9a80,JSON[_0xb9c5('0x10')](_0x256b34));_0x27f03f(_0x256b34);})[_0xb9c5('0x11')](function(_0x4429f6){logger[_0xb9c5('0x12')](_0xb9c5('0x36'),_0x4429f6['message'],_0x1c9a80);_0x270814(_0xa81d0a[_0xb9c5('0x12')](0x1f4,_0x4429f6[_0xb9c5('0x16')]));});});};exports[_0xb9c5('0x3d')]=function(_0x3a4ede){var _0x465dce=this;return new Promise(function(_0x24abc6,_0x4be2e8){return db[_0xb9c5('0x21')]['describe']()[_0xb9c5('0xd')](function(){return db[_0xb9c5('0x23')]['transaction'](function(_0x3d7668){return db[_0xb9c5('0x5')][_0xb9c5('0x25')]({'where':_0x3a4ede[_0xb9c5('0x6')]?_0x3a4ede['options'][_0xb9c5('0x15')]||null:null,'attributes':_0x3a4ede['options']?_0x3a4ede[_0xb9c5('0x6')][_0xb9c5('0x8')]||null:null,'limit':0x1,'order':_0x3a4ede['options']?_0x3a4ede[_0xb9c5('0x6')]['order']||null:null,'group':db[_0xb9c5('0x5')][_0xb9c5('0x3e')],'transaction':_0x3d7668,'lock':_0x3d7668[_0xb9c5('0x3f')]['UPDATE'],'include':_0x3a4ede[_0xb9c5('0x6')]?_0x3a4ede[_0xb9c5('0x6')][_0xb9c5('0xa')]?_[_0xb9c5('0xc')](_0x3a4ede[_0xb9c5('0x6')][_0xb9c5('0xa')],function(_0x48757b){return{'model':db[_0x48757b[_0xb9c5('0xb')]],'as':_0x48757b['as'],'attributes':_0x48757b[_0xb9c5('0x8')],'include':_0x48757b[_0xb9c5('0xa')]?_[_0xb9c5('0xc')](_0x48757b[_0xb9c5('0xa')],function(_0x4c3d52){return{'model':db[_0x4c3d52[_0xb9c5('0xb')]],'as':_0x4c3d52['as'],'attributes':_0x4c3d52['attributes'],'include':_0x4c3d52[_0xb9c5('0xa')]?_[_0xb9c5('0xc')](_0x4c3d52[_0xb9c5('0xa')],function(_0x3b39aa){return{'model':db[_0x3b39aa['model']],'as':_0x3b39aa['as'],'attributes':_0x3b39aa[_0xb9c5('0x8')]};}):[]};}):[]};}):[]:[]})[_0xb9c5('0xd')](function(_0x50a0b3){var _0x54c3a3=[];for(var _0x14920c=0x0;_0x14920c<_0x50a0b3[_0xb9c5('0x2d')];_0x14920c+=0x1){_0x54c3a3[_0xb9c5('0x2f')](_0x50a0b3[_0x14920c][_0xb9c5('0x1b')](_0x3a4ede[_0xb9c5('0x19')],{'transaction':_0x3d7668}));}return BPromise[_0xb9c5('0x30')](_0x54c3a3);});})['then'](function(_0x4105d4){logger['info']('GetContactRecallMe',_0x3a4ede);logger[_0xb9c5('0xf')](_0xb9c5('0x3d'),_0x3a4ede,JSON[_0xb9c5('0x10')](_0x4105d4));_0x24abc6(_0x4105d4);})[_0xb9c5('0x11')](function(_0x1e6e76){logger[_0xb9c5('0x12')](_0xb9c5('0x3d'),_0x1e6e76[_0xb9c5('0x16')],_0x3a4ede);_0x4be2e8(_0x465dce[_0xb9c5('0x12')](0x1f4,_0x1e6e76[_0xb9c5('0x16')]));});});});};exports[_0xb9c5('0x40')]=function(_0x126c1d){var _0x26e77f=this;return new Promise(function(_0x5246f7,_0x23742a){db[_0xb9c5('0x21')][_0xb9c5('0x22')]()[_0xb9c5('0xd')](function(_0x16c5ba){return db['CmHopper'][_0xb9c5('0x25')]({'raw':_0x126c1d[_0xb9c5('0x6')]?_0x126c1d[_0xb9c5('0x6')][_0xb9c5('0x7')]===undefined?!![]:![]:!![],'where':_0x126c1d['options']?_0x126c1d[_0xb9c5('0x6')][_0xb9c5('0x15')]||null:null,'attributes':_0x126c1d['options']?_0x126c1d[_0xb9c5('0x6')]['attributes']||null:null,'limit':_0x126c1d[_0xb9c5('0x6')]?_0x126c1d[_0xb9c5('0x6')][_0xb9c5('0x9')]||null:null,'include':_0x126c1d['options']?_0x126c1d[_0xb9c5('0x6')][_0xb9c5('0xa')]?_[_0xb9c5('0xc')](_0x126c1d['options']['include'],function(_0x3457a7){return{'model':db[_0x3457a7[_0xb9c5('0xb')]],'as':_0x3457a7['as'],'attributes':_0x3457a7['as']==='Contact'?_['keys'](_0x16c5ba):_0x3457a7['attributes'],'include':_0x3457a7[_0xb9c5('0xa')]?_[_0xb9c5('0xc')](_0x3457a7[_0xb9c5('0xa')],function(_0x1bc137){return{'model':db[_0x1bc137[_0xb9c5('0xb')]],'as':_0x1bc137['as'],'attributes':_0x1bc137[_0xb9c5('0x8')],'include':_0x1bc137[_0xb9c5('0xa')]?_[_0xb9c5('0xc')](_0x1bc137[_0xb9c5('0xa')],function(_0x7fd535){return{'model':db[_0x7fd535[_0xb9c5('0xb')]],'as':_0x7fd535['as'],'attributes':_0x7fd535[_0xb9c5('0x8')]};}):[]};}):[]};}):[]:[]})[_0xb9c5('0xd')](function(_0x7f7398){logger[_0xb9c5('0xe')](_0xb9c5('0x4'),_0x126c1d);logger[_0xb9c5('0xf')](_0xb9c5('0x4'),_0x126c1d,JSON[_0xb9c5('0x10')](_0x7f7398));_0x5246f7(_0x7f7398);})[_0xb9c5('0x11')](function(_0x213e91){logger['error'](_0xb9c5('0x4'),_0x213e91[_0xb9c5('0x16')],_0x126c1d);_0x23742a(_0x26e77f['error'](0x1f4,_0x213e91[_0xb9c5('0x16')]));});});});};exports[_0xb9c5('0x41')]=function(_0x12151a){var _0x3bf159=this;return new Promise(function(_0x3ee140,_0x1feb28){return db['CmContact']['findOne']({'raw':!![],'where':{'phone':_0x12151a[_0xb9c5('0x6')][_0xb9c5('0x15')][_0xb9c5('0x42')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0xb9c5('0xd')](function(_0x25402a){logger[_0xb9c5('0xe')](_0xb9c5('0x43'),_0x12151a);logger['debug'](_0xb9c5('0x43'),_0x12151a,JSON[_0xb9c5('0x10')](_0x25402a));_0x3ee140(_0x25402a);})[_0xb9c5('0x11')](function(_0x563fdd){logger['error'](_0xb9c5('0x43'),_0x563fdd['message'],_0x12151a);_0x1feb28(_0x3bf159[_0xb9c5('0x12')](0x1f4,_0x563fdd[_0xb9c5('0x16')]));});});};exports[_0xb9c5('0x44')]=function(_0x40df25){var _0x1e3273=this;return new Promise(function(_0x537f33,_0x54fdf4){return db['sequelize'][_0xb9c5('0x24')](function(_0x4a825e){var _0x25697d=_0x40df25[_0xb9c5('0x6')]&&_0x40df25[_0xb9c5('0x6')][_0xb9c5('0x15')]?_0x40df25[_0xb9c5('0x6')][_0xb9c5('0x15')]:{};return db[_0xb9c5('0x5')][_0xb9c5('0x1b')](_0x40df25['body'],{'where':_0x25697d,'transaction':_0x4a825e})[_0xb9c5('0xd')](function(_0x5cb84d){logger[_0xb9c5('0xe')](_0xb9c5('0x44'),_0x40df25);logger[_0xb9c5('0xf')](_0xb9c5('0x44'),_0x40df25,JSON['stringify'](_0x5cb84d));_0x537f33(_0x5cb84d);})['catch'](function(_0x3fce44){logger[_0xb9c5('0x12')](_0xb9c5('0x44'),_0x3fce44['message'],_0x40df25);_0x54fdf4(_0x1e3273['error'](0x1f4,_0x3fce44[_0xb9c5('0x16')]));});});});};exports[_0xb9c5('0x45')]=function(_0x26ed63){var _0x106fa5=this;var _0x4bb5ef=_0x26ed63[_0xb9c5('0x19')][_0xb9c5('0x15')][_0xb9c5('0x46')];var _0x37459b=_0x26ed63[_0xb9c5('0x19')][_0xb9c5('0x15')][_0xb9c5('0x47')];var _0x1058bc=_0x26ed63[_0xb9c5('0x19')][_0xb9c5('0x15')][_0xb9c5('0x48')];return new Promise(function(_0x1453ee,_0x57edcd){return db['CmHopper'][_0xb9c5('0x25')]({'where':{'voiceQueueId':{'$in':_0x4bb5ef},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xb9c5('0x23')][_0xb9c5('0x38')](_0xb9c5('0x49')+_0x37459b+_0xb9c5('0x4a')),'$gt':db[_0xb9c5('0x23')][_0xb9c5('0x38')](_0xb9c5('0x4b'))}},'UserId':{'$in':_0x1058bc}},'include':[{'model':db[_0xb9c5('0x21')],'as':_0xb9c5('0x4c')},{'model':db[_0xb9c5('0x29')],'as':_0xb9c5('0x2a'),'attributes':['id','name','voicePause']},{'model':db['CmList'],'as':_0xb9c5('0x4d')}]})['then'](function(_0x50b5ab){if(_0x50b5ab[_0xb9c5('0x2d')]>0x0){return db[_0xb9c5('0x23')][_0xb9c5('0x24')](function(_0x594e21){return db[_0xb9c5('0x5')][_0xb9c5('0x1b')]({'recallmeNotifiedDate':db[_0xb9c5('0x23')]['literal'](_0xb9c5('0x4b'))},{'where':{'id':{'$in':_[_0xb9c5('0xc')](_0x50b5ab,'id')}},'transaction':_0x594e21})['then'](function(){_0x1453ee(_0x50b5ab);})[_0xb9c5('0x11')](function(_0x36b153){logger[_0xb9c5('0x12')](_0xb9c5('0x45'),_0x36b153[_0xb9c5('0x16')],_0x26ed63);_0x57edcd(_0x106fa5[_0xb9c5('0x12')](0x1f4,_0x36b153['message']));});})[_0xb9c5('0x11')](function(_0xfc70c4){logger[_0xb9c5('0x12')](_0xb9c5('0x45'),_0xfc70c4[_0xb9c5('0x16')],_0x26ed63);_0x57edcd(_0x106fa5[_0xb9c5('0x12')](0x1f4,_0xfc70c4[_0xb9c5('0x16')]));});}else{_0x1453ee(_0x50b5ab);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 24ea4ce..debd726 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 _0xf25f=['/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','getTimezone','put','update','destroy','exports','Router','../../components/auth/service','./cmHopper.controller','get','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','getTimezones'];(function(_0x34f798,_0x5bbc91){var _0x1177d5=function(_0x444fe5){while(--_0x444fe5){_0x34f798['push'](_0x34f798['shift']());}};_0x1177d5(++_0x5bbc91);}(_0xf25f,0x1d9));var _0xff25=function(_0xca5bc1,_0x139621){_0xca5bc1=_0xca5bc1-0x0;var _0x447cd9=_0xf25f[_0xca5bc1];return _0x447cd9;};'use strict';var express=require('express');var router=express[_0xff25('0x0')]();var auth=require(_0xff25('0x1'));var controller=require(_0xff25('0x2'));router[_0xff25('0x3')]('/',auth['isAuthenticated'](),controller['index']);router[_0xff25('0x3')](_0xff25('0x4'),auth[_0xff25('0x5')](),controller[_0xff25('0x6')]);router['get'](_0xff25('0x7'),auth[_0xff25('0x5')](),controller[_0xff25('0x8')]);router[_0xff25('0x3')]('/timezones',auth[_0xff25('0x5')](),controller[_0xff25('0x9')]);router[_0xff25('0x3')](_0xff25('0xa'),auth[_0xff25('0x5')](),controller[_0xff25('0xb')]);router[_0xff25('0x3')](_0xff25('0xc'),auth[_0xff25('0x5')](),controller[_0xff25('0xd')]);router[_0xff25('0xe')]('/',auth[_0xff25('0x5')](),controller[_0xff25('0xf')]);router[_0xff25('0xe')](_0xff25('0x10'),auth[_0xff25('0x5')](),controller[_0xff25('0x11')]);router[_0xff25('0xe')]('/timezone',auth['isAuthenticated'](),controller[_0xff25('0x12')]);router[_0xff25('0x13')](_0xff25('0xa'),auth[_0xff25('0x5')](),controller[_0xff25('0x14')]);router['delete'](_0xff25('0xa'),auth[_0xff25('0x5')](),controller[_0xff25('0x15')]);module[_0xff25('0x16')]=router; \ No newline at end of file +var _0xc79f=['express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','/describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','/:id/previewrecall','getPreviewRecall','post','/preview','getPreview','put','delete'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0xc79f,0x1ee));var _0xfc79=function(_0x21ba41,_0x4727db){_0x21ba41=_0x21ba41-0x0;var _0x293e00=_0xc79f[_0x21ba41];return _0x293e00;};'use strict';var express=require(_0xfc79('0x0'));var router=express[_0xfc79('0x1')]();var auth=require(_0xfc79('0x2'));var controller=require(_0xfc79('0x3'));router[_0xfc79('0x4')]('/',auth[_0xfc79('0x5')](),controller['index']);router[_0xfc79('0x4')](_0xfc79('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0xfc79('0x4')](_0xfc79('0x7'),auth[_0xfc79('0x5')](),controller[_0xfc79('0x8')]);router[_0xfc79('0x4')](_0xfc79('0x9'),auth[_0xfc79('0x5')](),controller[_0xfc79('0xa')]);router['get'](_0xfc79('0xb'),auth[_0xfc79('0x5')](),controller['show']);router[_0xfc79('0x4')](_0xfc79('0xc'),auth[_0xfc79('0x5')](),controller[_0xfc79('0xd')]);router[_0xfc79('0xe')]('/',auth[_0xfc79('0x5')](),controller['create']);router[_0xfc79('0xe')](_0xfc79('0xf'),auth[_0xfc79('0x5')](),controller[_0xfc79('0x10')]);router[_0xfc79('0xe')]('/timezone',auth[_0xfc79('0x5')](),controller['getTimezone']);router[_0xfc79('0x11')](_0xfc79('0xb'),auth[_0xfc79('0x5')](),controller['update']);router[_0xfc79('0x12')](_0xfc79('0xb'),auth[_0xfc79('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index ebb65d1..b337956 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 _0xe0bb=['format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','INTEGER','STRING','DATE'];(function(_0x58b5d7,_0x4cc485){var _0x3a0460=function(_0x243b56){while(--_0x243b56){_0x58b5d7['push'](_0x58b5d7['shift']());}};_0x3a0460(++_0x4cc485);}(_0xe0bb,0x72));var _0xbe0b=function(_0xf33afd,_0x2363b6){_0xf33afd=_0xf33afd-0x0;var _0x5f432a=_0xe0bb[_0xf33afd];return _0x5f432a;};'use strict';var moment=require(_0xbe0b('0x0'));var Sequelize=require(_0xbe0b('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0xbe0b('0x2')]},'phone':{'type':Sequelize[_0xbe0b('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xbe0b('0x4')],'defaultValue':moment()[_0xbe0b('0x5')](_0xbe0b('0x6'))},'countbusyretry':{'type':Sequelize[_0xbe0b('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xbe0b('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xbe0b('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xbe0b('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xbe0b('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xbe0b('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbe0b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x82c1=['YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','STRING'];(function(_0x324a24,_0x4beba4){var _0x231de9=function(_0x3c642b){while(--_0x3c642b){_0x324a24['push'](_0x324a24['shift']());}};_0x231de9(++_0x4beba4);}(_0x82c1,0x16f));var _0x182c=function(_0x41eacf,_0x4e975d){_0x41eacf=_0x41eacf-0x0;var _0x41b628=_0x82c1[_0x41eacf];return _0x41b628;};'use strict';var moment=require(_0x182c('0x0'));var Sequelize=require(_0x182c('0x1'));module[_0x182c('0x2')]={'CmHopperId':{'type':Sequelize[_0x182c('0x3')]},'phone':{'type':Sequelize[_0x182c('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x182c('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0x182c('0x5'))},'countbusyretry':{'type':Sequelize[_0x182c('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x182c('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x182c('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x182c('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x182c('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x182c('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x182c('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x182c('0x3')],'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 b19e858..5890b06 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 _0xfce7=['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','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','CmHopperAdditionalPhone','rawAttributes','model','map','query','keys','intersection','attributes','hasOwnProperty','nolimit','sort','filters','filter','where','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','fields','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CmHopperAdditionalPhones','userProfileId'];(function(_0x4d2e6e,_0x44a250){var _0x21abc0=function(_0x208031){while(--_0x208031){_0x4d2e6e['push'](_0x4d2e6e['shift']());}};_0x21abc0(++_0x44a250);}(_0xfce7,0x141));var _0x7fce=function(_0x29f80e,_0x9027ff){_0x29f80e=_0x29f80e-0x0;var _0x5c7eaa=_0xfce7[_0x29f80e];return _0x5c7eaa;};'use strict';var emlformat=require(_0x7fce('0x0'));var rimraf=require(_0x7fce('0x1'));var zipdir=require(_0x7fce('0x2'));var jsonpatch=require(_0x7fce('0x3'));var rp=require(_0x7fce('0x4'));var moment=require(_0x7fce('0x5'));var BPromise=require(_0x7fce('0x6'));var Mustache=require(_0x7fce('0x7'));var util=require(_0x7fce('0x8'));var path=require(_0x7fce('0x9'));var sox=require(_0x7fce('0xa'));var csv=require(_0x7fce('0xb'));var ejs=require(_0x7fce('0xc'));var fs=require('fs');var fs_extra=require(_0x7fce('0xd'));var _=require(_0x7fce('0xe'));var squel=require(_0x7fce('0xf'));var crypto=require(_0x7fce('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7fce('0xb'));var querystring=require(_0x7fce('0x11'));var Papa=require(_0x7fce('0x12'));var Redis=require(_0x7fce('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7fce('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fce('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x7fce('0x16'));var licenseUtil=require(_0x7fce('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5183ed,_0xec9302){_0xec9302=_0xec9302||0xcc;return function(_0x18701f){if(_0x18701f){return _0x5183ed[_0x7fce('0x18')](_0xec9302);}return _0x5183ed[_0x7fce('0x19')](_0xec9302)['end']();};}function respondWithResult(_0x4f868c,_0x14da1e){_0x14da1e=_0x14da1e||0xc8;return function(_0x55200a){if(_0x55200a){return _0x4f868c[_0x7fce('0x19')](_0x14da1e)[_0x7fce('0x1a')](_0x55200a);}};}function respondWithFilteredResult(_0x295eed,_0x4567bc){return function(_0x90477d){if(_0x90477d){var _0x1f4b32=typeof _0x4567bc[_0x7fce('0x1b')]==='undefined'&&typeof _0x4567bc[_0x7fce('0x1c')]===_0x7fce('0x1d');var _0x59515b=_0x90477d[_0x7fce('0x1e')];var _0x5e4df7=_0x1f4b32?0x0:_0x4567bc[_0x7fce('0x1b')];var _0x2eb022=_0x1f4b32?_0x90477d[_0x7fce('0x1e')]:_0x4567bc[_0x7fce('0x1b')]+_0x4567bc[_0x7fce('0x1c')];var _0x47b588;if(_0x2eb022>=_0x59515b){_0x2eb022=_0x59515b;_0x47b588=0xc8;}else{_0x47b588=0xce;}_0x295eed[_0x7fce('0x19')](_0x47b588);return _0x295eed[_0x7fce('0x1f')](_0x7fce('0x20'),_0x5e4df7+'-'+_0x2eb022+'/'+_0x59515b)[_0x7fce('0x1a')](_0x90477d);}return null;};}function patchUpdates(_0x248658){return function(_0x116a54){try{jsonpatch[_0x7fce('0x21')](_0x116a54,_0x248658,!![]);}catch(_0x34ae52){return BPromise['reject'](_0x34ae52);}return _0x116a54['save']();};}function saveUpdates(_0x3c190a,_0x297091){return function(_0x21d88e){if(_0x21d88e){return _0x21d88e[_0x7fce('0x22')](_0x3c190a)[_0x7fce('0x23')](function(_0x3dd44c){return _0x3dd44c;});}return null;};}function removeEntity(_0x476b1f,_0x49ed54){return function(_0x43547e){if(_0x43547e){return _0x43547e[_0x7fce('0x24')]()[_0x7fce('0x23')](function(){var _0x1cf575=_0x43547e[_0x7fce('0x25')]({'plain':!![]});var _0xbcc82b='CmHopperAdditionalPhones';return db[_0x7fce('0x26')][_0x7fce('0x24')]({'where':{'type':_0xbcc82b,'resourceId':_0x1cf575['id']}})[_0x7fce('0x23')](function(){return _0x43547e;});})['then'](function(){_0x476b1f[_0x7fce('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd94215,_0x6fc219){return function(_0xaac850){if(!_0xaac850){_0xd94215[_0x7fce('0x18')](0x194);}return _0xaac850;};}function handleError(_0x2ec2f2,_0x501832){_0x501832=_0x501832||0x1f4;return function(_0x14696b){logger[_0x7fce('0x27')](_0x14696b[_0x7fce('0x28')]);if(_0x14696b[_0x7fce('0x29')]){delete _0x14696b[_0x7fce('0x29')];}_0x2ec2f2[_0x7fce('0x19')](_0x501832)[_0x7fce('0x2a')](_0x14696b);};}exports[_0x7fce('0x2b')]=function(_0xe1ec8a,_0x5e0161){var _0x1a4dac={},_0x161f5c={},_0x2eb4f9={'count':0x0,'rows':[]};var _0x38be56=_['map'](db[_0x7fce('0x2c')][_0x7fce('0x2d')],function(_0xa83d66){return{'name':_0xa83d66['fieldName'],'type':_0xa83d66['type']['key']};});_0x161f5c[_0x7fce('0x2e')]=_[_0x7fce('0x2f')](_0x38be56,_0x7fce('0x29'));_0x161f5c[_0x7fce('0x30')]=_[_0x7fce('0x31')](_0xe1ec8a[_0x7fce('0x30')]);_0x161f5c['filters']=_[_0x7fce('0x32')](_0x161f5c[_0x7fce('0x2e')],_0x161f5c[_0x7fce('0x30')]);_0x1a4dac[_0x7fce('0x33')]=_['intersection'](_0x161f5c[_0x7fce('0x2e')],qs['fields'](_0xe1ec8a[_0x7fce('0x30')]['fields']));_0x1a4dac[_0x7fce('0x33')]=_0x1a4dac[_0x7fce('0x33')]['length']?_0x1a4dac['attributes']:_0x161f5c[_0x7fce('0x2e')];if(!_0xe1ec8a[_0x7fce('0x30')][_0x7fce('0x34')](_0x7fce('0x35'))){_0x1a4dac['limit']=qs[_0x7fce('0x1c')](_0xe1ec8a['query'][_0x7fce('0x1c')]);_0x1a4dac[_0x7fce('0x1b')]=qs['offset'](_0xe1ec8a['query']['offset']);}_0x1a4dac['order']=qs[_0x7fce('0x36')](_0xe1ec8a[_0x7fce('0x30')][_0x7fce('0x36')]);_0x1a4dac['where']=qs['filters'](_['pick'](_0xe1ec8a['query'],_0x161f5c[_0x7fce('0x37')]),_0x38be56);if(_0xe1ec8a['query'][_0x7fce('0x38')]){_0x1a4dac[_0x7fce('0x39')]=_['merge'](_0x1a4dac[_0x7fce('0x39')],{'$or':_[_0x7fce('0x2f')](_0x38be56,function(_0x356c6b){if(_0x356c6b[_0x7fce('0x3a')]!==_0x7fce('0x3b')){var _0x5c5657={};_0x5c5657[_0x356c6b['name']]={'$like':'%'+_0xe1ec8a[_0x7fce('0x30')][_0x7fce('0x38')]+'%'};return _0x5c5657;}})});}_0x1a4dac=_[_0x7fce('0x3c')]({},_0x1a4dac,_0xe1ec8a[_0x7fce('0x3d')]);var _0x343401={'where':_0x1a4dac[_0x7fce('0x39')]};return db[_0x7fce('0x2c')][_0x7fce('0x1e')](_0x343401)[_0x7fce('0x23')](function(_0x26e473){_0x2eb4f9[_0x7fce('0x1e')]=_0x26e473;if(_0xe1ec8a[_0x7fce('0x30')]['includeAll']){_0x1a4dac[_0x7fce('0x3e')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0x7fce('0x3f')](_0x1a4dac);})[_0x7fce('0x23')](function(_0x4dccde){_0x2eb4f9[_0x7fce('0x40')]=_0x4dccde;return _0x2eb4f9;})[_0x7fce('0x23')](respondWithFilteredResult(_0x5e0161,_0x1a4dac))[_0x7fce('0x41')](handleError(_0x5e0161,null));};exports[_0x7fce('0x42')]=function(_0x1537f9,_0x5edd43){var _0x30060a={'raw':!![],'where':{'id':_0x1537f9[_0x7fce('0x43')]['id']}},_0x385d7d={};_0x385d7d[_0x7fce('0x2e')]=_[_0x7fce('0x31')](db[_0x7fce('0x2c')][_0x7fce('0x2d')]);_0x385d7d[_0x7fce('0x30')]=_['keys'](_0x1537f9[_0x7fce('0x30')]);_0x385d7d[_0x7fce('0x37')]=_[_0x7fce('0x32')](_0x385d7d[_0x7fce('0x2e')],_0x385d7d['query']);_0x30060a['attributes']=_[_0x7fce('0x32')](_0x385d7d['model'],qs[_0x7fce('0x44')](_0x1537f9['query'][_0x7fce('0x44')]));_0x30060a[_0x7fce('0x33')]=_0x30060a[_0x7fce('0x33')][_0x7fce('0x45')]?_0x30060a[_0x7fce('0x33')]:_0x385d7d[_0x7fce('0x2e')];if(_0x1537f9['query'][_0x7fce('0x46')]){_0x30060a[_0x7fce('0x3e')]=[{'all':!![]}];}_0x30060a=_[_0x7fce('0x3c')]({},_0x30060a,_0x1537f9[_0x7fce('0x3d')]);return db['CmHopperAdditionalPhone'][_0x7fce('0x47')](_0x30060a)[_0x7fce('0x23')](handleEntityNotFound(_0x5edd43,null))['then'](respondWithResult(_0x5edd43,null))[_0x7fce('0x41')](handleError(_0x5edd43,null));};exports[_0x7fce('0x48')]=function(_0x284795,_0x51ffd1){return db[_0x7fce('0x2c')][_0x7fce('0x48')](_0x284795[_0x7fce('0x49')],{})['then'](function(_0x1d96e0){var _0x490493=_0x284795['user'][_0x7fce('0x25')]({'plain':!![]});if(!_0x490493)throw new Error(_0x7fce('0x4a'));if(_0x490493[_0x7fce('0x4b')]===_0x7fce('0x4c')){var _0x1c5311=_0x1d96e0[_0x7fce('0x25')]({'plain':!![]});var _0x350782=_0x7fce('0x4d');return db['UserProfileSection'][_0x7fce('0x47')]({'where':{'name':_0x350782,'userProfileId':_0x490493[_0x7fce('0x4e')]},'raw':!![]})[_0x7fce('0x23')](function(_0x5d84af){if(_0x5d84af&&_0x5d84af['autoAssociation']===0x0){return db[_0x7fce('0x26')][_0x7fce('0x48')]({'name':_0x1c5311['name'],'resourceId':_0x1c5311['id'],'type':_0x5d84af[_0x7fce('0x29')],'sectionId':_0x5d84af['id']},{})[_0x7fce('0x23')](function(){return _0x1d96e0;});}else{return _0x1d96e0;}})[_0x7fce('0x41')](function(_0x224b6b){logger[_0x7fce('0x27')](_0x7fce('0x4f'),_0x224b6b);throw _0x224b6b;});}return _0x1d96e0;})['then'](respondWithResult(_0x51ffd1,0xc9))[_0x7fce('0x41')](handleError(_0x51ffd1,null));};exports['update']=function(_0x385665,_0x166407){if(_0x385665[_0x7fce('0x49')]['id']){delete _0x385665[_0x7fce('0x49')]['id'];}return db[_0x7fce('0x2c')][_0x7fce('0x47')]({'where':{'id':_0x385665['params']['id']}})[_0x7fce('0x23')](handleEntityNotFound(_0x166407,null))['then'](saveUpdates(_0x385665[_0x7fce('0x49')],null))[_0x7fce('0x23')](respondWithResult(_0x166407,null))[_0x7fce('0x41')](handleError(_0x166407,null));};exports[_0x7fce('0x24')]=function(_0x19782f,_0x1406df){return db['CmHopperAdditionalPhone'][_0x7fce('0x47')]({'where':{'id':_0x19782f[_0x7fce('0x43')]['id']}})['then'](handleEntityNotFound(_0x1406df,null))[_0x7fce('0x23')](removeEntity(_0x1406df,null))[_0x7fce('0x41')](handleError(_0x1406df,null));}; \ No newline at end of file +var _0x7e18=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','UserProfileResource','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','set','Content-Range','apply','reject','then','CmHopperAdditionalPhones','destroy','error','stack','name','send','map','CmHopperAdditionalPhone','fieldName','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','options','count','includeAll','include','findAll','rows','show','params','length','catch'];(function(_0x7797b2,_0x1361ba){var _0xa4e42f=function(_0x5e05a3){while(--_0x5e05a3){_0x7797b2['push'](_0x7797b2['shift']());}};_0xa4e42f(++_0x1361ba);}(_0x7e18,0x1d7));var _0x87e1=function(_0x1a9a89,_0x286aac){_0x1a9a89=_0x1a9a89-0x0;var _0x81bb7c=_0x7e18[_0x1a9a89];return _0x81bb7c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x87e1('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x87e1('0x1'));var BPromise=require(_0x87e1('0x2'));var Mustache=require(_0x87e1('0x3'));var util=require('util');var path=require('path');var sox=require(_0x87e1('0x4'));var csv=require(_0x87e1('0x5'));var ejs=require(_0x87e1('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87e1('0x7'));var squel=require(_0x87e1('0x8'));var crypto=require(_0x87e1('0x9'));var jsforce=require(_0x87e1('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x87e1('0x5'));var querystring=require(_0x87e1('0xb'));var Papa=require(_0x87e1('0xc'));var Redis=require('ioredis');var authService=require(_0x87e1('0xd'));var qs=require(_0x87e1('0xe'));var as=require(_0x87e1('0xf'));var hardwareService=require(_0x87e1('0x10'));var logger=require(_0x87e1('0x11'))(_0x87e1('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x87e1('0x13'));var db=require(_0x87e1('0x14'))['db'];function respondWithStatusCode(_0x384e19,_0x4e8477){_0x4e8477=_0x4e8477||0xcc;return function(_0x288e17){if(_0x288e17){return _0x384e19[_0x87e1('0x15')](_0x4e8477);}return _0x384e19[_0x87e1('0x16')](_0x4e8477)[_0x87e1('0x17')]();};}function respondWithResult(_0x58ca8d,_0x27107d){_0x27107d=_0x27107d||0xc8;return function(_0x5ca59d){if(_0x5ca59d){return _0x58ca8d[_0x87e1('0x16')](_0x27107d)[_0x87e1('0x18')](_0x5ca59d);}};}function respondWithFilteredResult(_0x355f60,_0x2760d3){return function(_0x54eccf){if(_0x54eccf){var _0x65098b=typeof _0x2760d3[_0x87e1('0x19')]===_0x87e1('0x1a')&&typeof _0x2760d3['limit']==='undefined';var _0x544a40=_0x54eccf['count'];var _0x43969d=_0x65098b?0x0:_0x2760d3[_0x87e1('0x19')];var _0x38f209=_0x65098b?_0x54eccf['count']:_0x2760d3[_0x87e1('0x19')]+_0x2760d3['limit'];var _0x4a0653;if(_0x38f209>=_0x544a40){_0x38f209=_0x544a40;_0x4a0653=0xc8;}else{_0x4a0653=0xce;}_0x355f60[_0x87e1('0x16')](_0x4a0653);return _0x355f60[_0x87e1('0x1b')](_0x87e1('0x1c'),_0x43969d+'-'+_0x38f209+'/'+_0x544a40)['json'](_0x54eccf);}return null;};}function patchUpdates(_0x4926f7){return function(_0x245ccb){try{jsonpatch[_0x87e1('0x1d')](_0x245ccb,_0x4926f7,!![]);}catch(_0x500566){return BPromise[_0x87e1('0x1e')](_0x500566);}return _0x245ccb['save']();};}function saveUpdates(_0x44669f,_0x5243d3){return function(_0x51c4c4){if(_0x51c4c4){return _0x51c4c4['update'](_0x44669f)[_0x87e1('0x1f')](function(_0xbbdcd7){return _0xbbdcd7;});}return null;};}function removeEntity(_0x376af6,_0x3bb7db){return function(_0x22b22f){if(_0x22b22f){return _0x22b22f['destroy']()['then'](function(){var _0x547ebb=_0x22b22f['get']({'plain':!![]});var _0x1371ed=_0x87e1('0x20');return db['UserProfileResource'][_0x87e1('0x21')]({'where':{'type':_0x1371ed,'resourceId':_0x547ebb['id']}})['then'](function(){return _0x22b22f;});})[_0x87e1('0x1f')](function(){_0x376af6[_0x87e1('0x16')](0xcc)[_0x87e1('0x17')]();});}};}function handleEntityNotFound(_0x224908,_0x27dc1e){return function(_0x4dde81){if(!_0x4dde81){_0x224908[_0x87e1('0x15')](0x194);}return _0x4dde81;};}function handleError(_0x40c5f6,_0x15b409){_0x15b409=_0x15b409||0x1f4;return function(_0x477c3a){logger[_0x87e1('0x22')](_0x477c3a[_0x87e1('0x23')]);if(_0x477c3a[_0x87e1('0x24')]){delete _0x477c3a['name'];}_0x40c5f6[_0x87e1('0x16')](_0x15b409)[_0x87e1('0x25')](_0x477c3a);};}exports['index']=function(_0x4626d6,_0x3165fd){var _0x341a1a={},_0x7de7d7={},_0x813872={'count':0x0,'rows':[]};var _0x1652eb=_[_0x87e1('0x26')](db[_0x87e1('0x27')]['rawAttributes'],function(_0x3e0cca){return{'name':_0x3e0cca[_0x87e1('0x28')],'type':_0x3e0cca['type']['key']};});_0x7de7d7['model']=_[_0x87e1('0x26')](_0x1652eb,_0x87e1('0x24'));_0x7de7d7[_0x87e1('0x29')]=_[_0x87e1('0x2a')](_0x4626d6[_0x87e1('0x29')]);_0x7de7d7[_0x87e1('0x2b')]=_[_0x87e1('0x2c')](_0x7de7d7['model'],_0x7de7d7[_0x87e1('0x29')]);_0x341a1a[_0x87e1('0x2d')]=_[_0x87e1('0x2c')](_0x7de7d7[_0x87e1('0x2e')],qs[_0x87e1('0x2f')](_0x4626d6['query'][_0x87e1('0x2f')]));_0x341a1a[_0x87e1('0x2d')]=_0x341a1a[_0x87e1('0x2d')]['length']?_0x341a1a[_0x87e1('0x2d')]:_0x7de7d7[_0x87e1('0x2e')];if(!_0x4626d6[_0x87e1('0x29')][_0x87e1('0x30')](_0x87e1('0x31'))){_0x341a1a[_0x87e1('0x32')]=qs[_0x87e1('0x32')](_0x4626d6[_0x87e1('0x29')][_0x87e1('0x32')]);_0x341a1a[_0x87e1('0x19')]=qs[_0x87e1('0x19')](_0x4626d6['query'][_0x87e1('0x19')]);}_0x341a1a[_0x87e1('0x33')]=qs[_0x87e1('0x34')](_0x4626d6[_0x87e1('0x29')][_0x87e1('0x34')]);_0x341a1a[_0x87e1('0x35')]=qs[_0x87e1('0x2b')](_[_0x87e1('0x36')](_0x4626d6[_0x87e1('0x29')],_0x7de7d7['filters']),_0x1652eb);if(_0x4626d6[_0x87e1('0x29')][_0x87e1('0x37')]){_0x341a1a[_0x87e1('0x35')]=_[_0x87e1('0x38')](_0x341a1a[_0x87e1('0x35')],{'$or':_['map'](_0x1652eb,function(_0x574a5e){if(_0x574a5e[_0x87e1('0x39')]!=='VIRTUAL'){var _0x349606={};_0x349606[_0x574a5e[_0x87e1('0x24')]]={'$like':'%'+_0x4626d6[_0x87e1('0x29')][_0x87e1('0x37')]+'%'};return _0x349606;}})});}_0x341a1a=_[_0x87e1('0x38')]({},_0x341a1a,_0x4626d6[_0x87e1('0x3a')]);var _0x53f896={'where':_0x341a1a[_0x87e1('0x35')]};return db[_0x87e1('0x27')][_0x87e1('0x3b')](_0x53f896)[_0x87e1('0x1f')](function(_0x275e08){_0x813872[_0x87e1('0x3b')]=_0x275e08;if(_0x4626d6[_0x87e1('0x29')][_0x87e1('0x3c')]){_0x341a1a[_0x87e1('0x3d')]=[{'all':!![]}];}return db[_0x87e1('0x27')][_0x87e1('0x3e')](_0x341a1a);})[_0x87e1('0x1f')](function(_0x478609){_0x813872[_0x87e1('0x3f')]=_0x478609;return _0x813872;})[_0x87e1('0x1f')](respondWithFilteredResult(_0x3165fd,_0x341a1a))['catch'](handleError(_0x3165fd,null));};exports[_0x87e1('0x40')]=function(_0x5edce0,_0x12f2f1){var _0xf0a4c0={'raw':!![],'where':{'id':_0x5edce0[_0x87e1('0x41')]['id']}},_0x31d2de={};_0x31d2de['model']=_[_0x87e1('0x2a')](db['CmHopperAdditionalPhone']['rawAttributes']);_0x31d2de[_0x87e1('0x29')]=_[_0x87e1('0x2a')](_0x5edce0[_0x87e1('0x29')]);_0x31d2de['filters']=_['intersection'](_0x31d2de[_0x87e1('0x2e')],_0x31d2de[_0x87e1('0x29')]);_0xf0a4c0[_0x87e1('0x2d')]=_['intersection'](_0x31d2de[_0x87e1('0x2e')],qs[_0x87e1('0x2f')](_0x5edce0[_0x87e1('0x29')][_0x87e1('0x2f')]));_0xf0a4c0[_0x87e1('0x2d')]=_0xf0a4c0[_0x87e1('0x2d')][_0x87e1('0x42')]?_0xf0a4c0[_0x87e1('0x2d')]:_0x31d2de[_0x87e1('0x2e')];if(_0x5edce0[_0x87e1('0x29')]['includeAll']){_0xf0a4c0[_0x87e1('0x3d')]=[{'all':!![]}];}_0xf0a4c0=_[_0x87e1('0x38')]({},_0xf0a4c0,_0x5edce0['options']);return db[_0x87e1('0x27')]['find'](_0xf0a4c0)[_0x87e1('0x1f')](handleEntityNotFound(_0x12f2f1,null))['then'](respondWithResult(_0x12f2f1,null))[_0x87e1('0x43')](handleError(_0x12f2f1,null));};exports['create']=function(_0x427f5c,_0x580c79){return db[_0x87e1('0x27')]['create'](_0x427f5c[_0x87e1('0x44')],{})['then'](function(_0x1d2e65){var _0x4ec582=_0x427f5c[_0x87e1('0x45')]['get']({'plain':!![]});if(!_0x4ec582)throw new Error(_0x87e1('0x46'));if(_0x4ec582[_0x87e1('0x47')]===_0x87e1('0x45')){var _0x243b1e=_0x1d2e65[_0x87e1('0x48')]({'plain':!![]});var _0x4d0e95=_0x87e1('0x20');return db[_0x87e1('0x49')][_0x87e1('0x4a')]({'where':{'name':_0x4d0e95,'userProfileId':_0x4ec582[_0x87e1('0x4b')]},'raw':!![]})[_0x87e1('0x1f')](function(_0x359542){if(_0x359542&&_0x359542['autoAssociation']===0x0){return db[_0x87e1('0x4c')]['create']({'name':_0x243b1e[_0x87e1('0x24')],'resourceId':_0x243b1e['id'],'type':_0x359542[_0x87e1('0x24')],'sectionId':_0x359542['id']},{})[_0x87e1('0x1f')](function(){return _0x1d2e65;});}else{return _0x1d2e65;}})[_0x87e1('0x43')](function(_0x1a79ea){logger[_0x87e1('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a79ea);throw _0x1a79ea;});}return _0x1d2e65;})[_0x87e1('0x1f')](respondWithResult(_0x580c79,0xc9))[_0x87e1('0x43')](handleError(_0x580c79,null));};exports['update']=function(_0x7fc4d8,_0x191454){if(_0x7fc4d8['body']['id']){delete _0x7fc4d8[_0x87e1('0x44')]['id'];}return db[_0x87e1('0x27')][_0x87e1('0x4a')]({'where':{'id':_0x7fc4d8[_0x87e1('0x41')]['id']}})['then'](handleEntityNotFound(_0x191454,null))[_0x87e1('0x1f')](saveUpdates(_0x7fc4d8[_0x87e1('0x44')],null))[_0x87e1('0x1f')](respondWithResult(_0x191454,null))[_0x87e1('0x43')](handleError(_0x191454,null));};exports[_0x87e1('0x21')]=function(_0x1ea114,_0x3ade9b){return db[_0x87e1('0x27')][_0x87e1('0x4a')]({'where':{'id':_0x1ea114[_0x87e1('0x41')]['id']}})['then'](handleEntityNotFound(_0x3ade9b,null))[_0x87e1('0x1f')](removeEntity(_0x3ade9b,null))[_0x87e1('0x43')](handleError(_0x3ade9b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 0dcdd06..9db90a4 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 _0x5c1d=['moment','bluebird','request-promise','path','rimraf','./cmHopperAdditionalPhone.attributes','exports','cm_hopper_additional_phones','lodash','util','../../config/logger','api'];(function(_0x30667e,_0x58a931){var _0x3b37c6=function(_0x4e83e7){while(--_0x4e83e7){_0x30667e['push'](_0x30667e['shift']());}};_0x3b37c6(++_0x58a931);}(_0x5c1d,0x194));var _0xd5c1=function(_0x20ee53,_0x37c343){_0x20ee53=_0x20ee53-0x0;var _0xff840b=_0x5c1d[_0x20ee53];return _0xff840b;};'use strict';var _=require(_0xd5c1('0x0'));var util=require(_0xd5c1('0x1'));var logger=require(_0xd5c1('0x2'))(_0xd5c1('0x3'));var moment=require(_0xd5c1('0x4'));var BPromise=require(_0xd5c1('0x5'));var rp=require(_0xd5c1('0x6'));var fs=require('fs');var path=require(_0xd5c1('0x7'));var rimraf=require(_0xd5c1('0x8'));var config=require('../../config/environment');var attributes=require(_0xd5c1('0x9'));module[_0xd5c1('0xa')]=function(_0x15895e,_0x4e85c6){return _0x15895e['define']('CmHopperAdditionalPhone',attributes,{'tableName':_0xd5c1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4061=['CmHopperAdditionalPhone','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./cmHopperAdditionalPhone.attributes','exports','define'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x4061,0x11f));var _0x1406=function(_0x4ebe4b,_0x20ade5){_0x4ebe4b=_0x4ebe4b-0x0;var _0x297a5c=_0x4061[_0x4ebe4b];return _0x297a5c;};'use strict';var _=require(_0x1406('0x0'));var util=require(_0x1406('0x1'));var logger=require(_0x1406('0x2'))('api');var moment=require(_0x1406('0x3'));var BPromise=require(_0x1406('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1406('0x5'));var rimraf=require(_0x1406('0x6'));var config=require('../../config/environment');var attributes=require(_0x1406('0x7'));module[_0x1406('0x8')]=function(_0x53ab85,_0x2d036e){return _0x53ab85[_0x1406('0x9')](_0x1406('0xa'),attributes,{'tableName':'cm_hopper_additional_phones','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 fdcff75..850ea15 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 _0x2fe8=['countnosuchnumberretry','countabandonedretry','countmachineretry','SwapAdditionalPhones','duration','waitTime','scheduledat','minutes','add','phone','isNil','createdAt','updatedAt','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','then','findOne','OrderBy','ASC','countbusyretry','countdropretry','countagentrejectretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countcongestionretry','countnoanswerretry'];(function(_0x5d9e75,_0x4e46cc){var _0x43cfac=function(_0x46d88d){while(--_0x46d88d){_0x5d9e75['push'](_0x5d9e75['shift']());}};_0x43cfac(++_0x4e46cc);}(_0x2fe8,0x1d9));var _0x82fe=function(_0x48fdbb,_0x3907ea){_0x48fdbb=_0x48fdbb-0x0;var _0x1f4f15=_0x2fe8[_0x48fdbb];return _0x1f4f15;};'use strict';var _=require(_0x82fe('0x0'));var util=require(_0x82fe('0x1'));var moment=require('moment');var BPromise=require(_0x82fe('0x2'));var rs=require(_0x82fe('0x3'));var fs=require('fs');var Redis=require(_0x82fe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x82fe('0x5'));var logger=require('../../config/logger')(_0x82fe('0x6'));var config=require(_0x82fe('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x82fe('0x8')][_0x82fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1382d2,_0x58d6bb,_0xbdee25){return new BPromise(function(_0x474f11,_0x2d26a3){return client[_0x82fe('0xa')](_0x1382d2,_0xbdee25)['then'](function(_0x277059){logger[_0x82fe('0xb')](_0x82fe('0xc'),_0x58d6bb,_0x82fe('0xd'));logger[_0x82fe('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x58d6bb,'request\x20sent',JSON[_0x82fe('0xf')](_0x277059));if(_0x277059[_0x82fe('0x10')]){if(_0x277059['error'][_0x82fe('0x11')]===0x1f4){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x58d6bb,_0x277059['error']['message']);return _0x2d26a3(_0x277059[_0x82fe('0x10')][_0x82fe('0x12')]);}logger[_0x82fe('0x10')](_0x82fe('0xc'),_0x58d6bb,_0x277059[_0x82fe('0x10')][_0x82fe('0x12')]);return _0x474f11(_0x277059[_0x82fe('0x10')]['message']);}else{logger[_0x82fe('0xb')](_0x82fe('0xc'),_0x58d6bb,'request\x20sent');_0x474f11(_0x277059[_0x82fe('0x13')]['message']);}})[_0x82fe('0x14')](function(_0x5a6871){logger[_0x82fe('0x10')](_0x82fe('0xc'),_0x58d6bb,_0x5a6871);_0x2d26a3(_0x5a6871);});});}exports[_0x82fe('0x15')]=function(_0x4fa6b6){var _0x42bd63=this;return new Promise(function(_0x21fabb,_0x360aa7){return db[_0x82fe('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x4fa6b6[_0x82fe('0x17')][_0x82fe('0x18')],'ListId':_0x4fa6b6['body'][_0x82fe('0x19')],'VoiceQueueId':_0x4fa6b6[_0x82fe('0x17')][_0x82fe('0x1a')]===undefined?null:_0x4fa6b6[_0x82fe('0x17')][_0x82fe('0x1a')],'CampaignId':_0x4fa6b6[_0x82fe('0x17')][_0x82fe('0x1b')]===undefined?null:_0x4fa6b6[_0x82fe('0x17')]['CampaignId']}})[_0x82fe('0x1c')](function(_0x539396){if(_0x539396!=null){return db['CmHopperAdditionalPhone'][_0x82fe('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x539396['id'],'OrderBy':{'$gt':_0x539396['OrderBy']}},'order':[[_0x82fe('0x1e'),_0x82fe('0x1f')]]})[_0x82fe('0x1c')](function(_0x170ddd){var _0x2648f6=0x0;if(_0x170ddd){if(_0x170ddd[_0x82fe('0x20')]+_0x170ddd['countcongestionretry']+_0x170ddd['countnoanswerretry']+_0x170ddd['countnosuchnumberretry']+_0x170ddd[_0x82fe('0x21')]+_0x170ddd['countabandonedretry']+_0x170ddd['countmachineretry']+_0x170ddd[_0x82fe('0x22')]<_0x4fa6b6[_0x82fe('0x23')][_0x82fe('0x24')])_0x2648f6=0x1;_0x21fabb({'additional':_0x2648f6});}else{return db[_0x82fe('0x25')][_0x82fe('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x539396['id']},'order':[[_0x82fe('0x1e'),'ASC']]})['then'](function(_0x3410eb){var _0xee2a28=0x0;if(_0x3410eb){if(_0x3410eb['countbusyretry']+_0x3410eb[_0x82fe('0x26')]+_0x3410eb[_0x82fe('0x27')]+_0x3410eb[_0x82fe('0x28')]+_0x3410eb[_0x82fe('0x21')]+_0x3410eb[_0x82fe('0x29')]+_0x3410eb[_0x82fe('0x2a')]+_0x3410eb[_0x82fe('0x22')]<_0x4fa6b6[_0x82fe('0x23')][_0x82fe('0x24')])_0xee2a28=0x1;_0x21fabb({'additional':_0xee2a28});}else{_0x21fabb({'additional':0x0});}})[_0x82fe('0x14')](function(_0xa0360b){logger['error'](_0x82fe('0x15'),_0xa0360b[_0x82fe('0x12')]);_0x360aa7(_0x42bd63[_0x82fe('0x10')](0x1f4,_0xa0360b[_0x82fe('0x12')]));});}})[_0x82fe('0x14')](function(_0xf31e7c){logger['error']('VerifyAdditionalPhones',_0xf31e7c[_0x82fe('0x12')]);_0x360aa7(_0x42bd63['error'](0x1f4,_0xf31e7c[_0x82fe('0x12')]));});}else _0x21fabb({'additional':0x0});});});};exports[_0x82fe('0x2b')]=function(_0x17b00d){var _0x562fd4=this;return new Promise(function(_0x4ab622,_0x2b18e0){return db[_0x82fe('0x16')][_0x82fe('0x1d')]({'raw':!![],'where':{'ContactId':_0x17b00d[_0x82fe('0x17')][_0x82fe('0x18')],'ListId':_0x17b00d['body'][_0x82fe('0x19')],'VoiceQueueId':_0x17b00d['body'][_0x82fe('0x1a')]===undefined?null:_0x17b00d[_0x82fe('0x17')][_0x82fe('0x1a')],'CampaignId':_0x17b00d[_0x82fe('0x17')][_0x82fe('0x1b')]===undefined?null:_0x17b00d[_0x82fe('0x17')][_0x82fe('0x1b')]}})[_0x82fe('0x1c')](function(_0x45df00){if(_0x45df00!=null){return db[_0x82fe('0x25')][_0x82fe('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x45df00['id'],'OrderBy':{'$gte':_0x45df00[_0x82fe('0x1e')]}},'order':[[_0x82fe('0x1e'),_0x82fe('0x1f')]]})['then'](function(_0x4a38bf){if(_0x4a38bf)return activateAdditionalPhone(_0x45df00,_0x17b00d[_0x82fe('0x17')],_0x4a38bf,_0x17b00d[_0x82fe('0x2c')],_0x17b00d['waitTime'])[_0x82fe('0x1c')](function(_0x307c7e){_0x4ab622(_0x307c7e);});else{return db[_0x82fe('0x25')][_0x82fe('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x45df00['id']},'order':[[_0x82fe('0x1e'),'ASC']]})['then'](function(_0x285ac6){if(_0x285ac6)return activateAdditionalPhone(_0x45df00,_0x17b00d[_0x82fe('0x17')],_0x285ac6,_0x17b00d['duration'],_0x17b00d[_0x82fe('0x2d')])['then'](function(_0x44a6f7){_0x4ab622(_0x44a6f7);});else{_0x4ab622({'id':_0x45df00['id'],'phone':''});}})['catch'](function(_0x154813){logger[_0x82fe('0x10')](_0x82fe('0x15'),_0x154813[_0x82fe('0x12')]);_0x2b18e0(_0x562fd4['error'](0x1f4,_0x154813['message']));});}})['catch'](function(_0x33410a){logger[_0x82fe('0x10')](_0x82fe('0x15'),_0x33410a[_0x82fe('0x12')]);_0x2b18e0(_0x562fd4[_0x82fe('0x10')](0x1f4,_0x33410a[_0x82fe('0x12')]));});}else _0x4ab622(0x1);});});};function activateAdditionalPhone(_0x107fc3,_0x249758,_0xca853a,_0x303314,_0x3f5855){return new Promise(function(_0x50b9ae,_0x158581){var _0x3b06c9;if(_['isNil'](_0xca853a['scheduledat'])){_0xca853a[_0x82fe('0x2e')]=moment();}if(moment()>moment(_0xca853a['scheduledat'])){_0x3b06c9=moment()['add'](_0x3f5855||0x3,_0x82fe('0x2f'));}else{if(_0xca853a[_0x82fe('0x1e')]==0x0){_0x3b06c9=moment(_0xca853a[_0x82fe('0x2e')]);}else{_0x3b06c9=moment()[_0x82fe('0x30')](_0x3f5855||0x3,_0x82fe('0x2f'));}}if(_['isNil'](_0x3b06c9)){_0x3b06c9=moment()[_0x82fe('0x30')](_0x3f5855||0x3,_0x82fe('0x2f'));}var _0x318cdc={'phone':_0x107fc3[_0x82fe('0x31')],'active':0x0,'OrderBy':_[_0x82fe('0x32')](_0x107fc3[_0x82fe('0x1e')])?0x0:_0x107fc3['OrderBy'],'scheduledat':moment()[_0x82fe('0x30')](_0x303314||0x1,_0x82fe('0x2f')),'countbusyretry':_0x249758['countbusyretry'],'countcongestionretry':_0x249758[_0x82fe('0x26')],'countnoanswerretry':_0x249758['countnoanswerretry'],'countnosuchnumberretry':_0x249758[_0x82fe('0x28')],'countdropretry':_0x249758[_0x82fe('0x21')],'countabandonedretry':_0x249758[_0x82fe('0x29')],'countmachineretry':_0x249758[_0x82fe('0x2a')],'countagentrejectretry':_0x249758[_0x82fe('0x22')],'createdAt':_0x249758[_0x82fe('0x33')],'updatedAt':_0x249758[_0x82fe('0x34')]};var _0xdc7108={'CmHopperId':_0x107fc3['id'],'phone':_0xca853a[_0x82fe('0x31')],'active':0x0,'OrderBy':_['isNil'](_0xca853a['OrderBy'])?0x0:_0xca853a[_0x82fe('0x1e')],'scheduledat':_0x3b06c9,'countbusyretry':_0xca853a[_0x82fe('0x20')],'countcongestionretry':_0xca853a[_0x82fe('0x26')],'countnoanswerretry':_0xca853a[_0x82fe('0x27')],'countnosuchnumberretry':_0xca853a[_0x82fe('0x28')],'countdropretry':_0xca853a[_0x82fe('0x21')],'countabandonedretry':_0xca853a['countabandonedretry'],'countmachineretry':_0xca853a[_0x82fe('0x2a')],'countagentrejectretry':_0xca853a[_0x82fe('0x22')],'createdAt':_0xca853a[_0x82fe('0x33')],'updatedAt':_0xca853a['updatedAt']};return db['sequelize'][_0x82fe('0x35')](function(_0x5baddc){return db[_0x82fe('0x25')][_0x82fe('0x36')](_0x318cdc,{'where':{'id':_0xca853a['id']}},{'transaction':_0x5baddc})['then'](function(){return db[_0x82fe('0x16')]['update'](_0xdc7108,{'where':{'id':_0x107fc3['id']}},{'transaction':_0x5baddc});});})[_0x82fe('0x1c')](function(_0x41c752){_0x50b9ae({'id':_0x107fc3['id'],'phone':_0xca853a[_0x82fe('0x31')]});})[_0x82fe('0x14')](function(_0x1e32e5){logger[_0x82fe('0x10')](_0x82fe('0x37'),_0x1e32e5[_0x82fe('0x12')]);_0x158581({'error':_0x1e32e5['message']});});});}exports[_0x82fe('0x38')]=function(_0x2c60a2){var _0x4e1ced=this;return new Promise(function(_0x13c2a6,_0x3cad46){return db['CmHopper'][_0x82fe('0x36')](_0x2c60a2[_0x82fe('0x17')]['field'],{'where':{'id':_0x2c60a2[_0x82fe('0x17')]['id']}})['then'](function(_0x630a0f){_0x13c2a6(_0x630a0f);})['catch'](function(_0x3fc397){logger[_0x82fe('0x10')](_0x82fe('0x38'),_0x3fc397[_0x82fe('0x12')]);_0x3cad46(_0x4e1ced[_0x82fe('0x10')](0x1f4,_0x3fc397[_0x82fe('0x12')]));});});}; \ No newline at end of file +var _0x1ff9=['countabandonedretry','sequelize','transaction','update','activateAdditionalPhone','field','IncrementPreviewCounters','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','entity','CmHopperAdditionalPhone','ASC','then','catch','VerifyAdditionalPhones','SwapAdditionalPhones','CmHopper','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt'];(function(_0x18ff40,_0x35df49){var _0x4b02d5=function(_0x2b7c6e){while(--_0x2b7c6e){_0x18ff40['push'](_0x18ff40['shift']());}};_0x4b02d5(++_0x35df49);}(_0x1ff9,0x1df));var _0x91ff=function(_0x3c0ad6,_0x26ebc2){_0x3c0ad6=_0x3c0ad6-0x0;var _0x3f1e08=_0x1ff9[_0x3c0ad6];return _0x3f1e08;};'use strict';var _=require(_0x91ff('0x0'));var util=require(_0x91ff('0x1'));var moment=require('moment');var BPromise=require(_0x91ff('0x2'));var rs=require(_0x91ff('0x3'));var fs=require('fs');var Redis=require(_0x91ff('0x4'));var db=require(_0x91ff('0x5'))['db'];var utils=require(_0x91ff('0x6'));var logger=require(_0x91ff('0x7'))(_0x91ff('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x91ff('0x9')][_0x91ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a26c9,_0x54f12,_0x4deec6){return new BPromise(function(_0xf3dd1,_0x25f494){return client[_0x91ff('0xb')](_0x3a26c9,_0x4deec6)['then'](function(_0x6c2a7f){logger['info'](_0x91ff('0xc'),_0x54f12,_0x91ff('0xd'));logger[_0x91ff('0xe')](_0x91ff('0xf'),_0x54f12,_0x91ff('0xd'),JSON[_0x91ff('0x10')](_0x6c2a7f));if(_0x6c2a7f[_0x91ff('0x11')]){if(_0x6c2a7f[_0x91ff('0x11')][_0x91ff('0x12')]===0x1f4){logger[_0x91ff('0x11')](_0x91ff('0xc'),_0x54f12,_0x6c2a7f[_0x91ff('0x11')][_0x91ff('0x13')]);return _0x25f494(_0x6c2a7f[_0x91ff('0x11')][_0x91ff('0x13')]);}logger[_0x91ff('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x54f12,_0x6c2a7f[_0x91ff('0x11')][_0x91ff('0x13')]);return _0xf3dd1(_0x6c2a7f[_0x91ff('0x11')][_0x91ff('0x13')]);}else{logger[_0x91ff('0x14')](_0x91ff('0xc'),_0x54f12,_0x91ff('0xd'));_0xf3dd1(_0x6c2a7f['result'][_0x91ff('0x13')]);}})['catch'](function(_0x2133e6){logger[_0x91ff('0x11')](_0x91ff('0xc'),_0x54f12,_0x2133e6);_0x25f494(_0x2133e6);});});}exports['VerifyAdditionalPhones']=function(_0x2b193b){var _0x21e519=this;return new Promise(function(_0x1d0c18,_0x31e03d){return db['CmHopper'][_0x91ff('0x15')]({'raw':!![],'where':{'ContactId':_0x2b193b[_0x91ff('0x16')][_0x91ff('0x17')],'ListId':_0x2b193b['body'][_0x91ff('0x18')],'VoiceQueueId':_0x2b193b[_0x91ff('0x16')][_0x91ff('0x19')]===undefined?null:_0x2b193b['body'][_0x91ff('0x19')],'CampaignId':_0x2b193b[_0x91ff('0x16')][_0x91ff('0x1a')]===undefined?null:_0x2b193b[_0x91ff('0x16')][_0x91ff('0x1a')]}})['then'](function(_0x2b1317){if(_0x2b1317!=null){return db['CmHopperAdditionalPhone'][_0x91ff('0x15')]({'raw':!![],'where':{'CmHopperId':_0x2b1317['id'],'OrderBy':{'$gt':_0x2b1317[_0x91ff('0x1b')]}},'order':[[_0x91ff('0x1b'),'ASC']]})['then'](function(_0x23259b){var _0x38c3c5=0x0;if(_0x23259b){if(_0x23259b[_0x91ff('0x1c')]+_0x23259b[_0x91ff('0x1d')]+_0x23259b[_0x91ff('0x1e')]+_0x23259b[_0x91ff('0x1f')]+_0x23259b[_0x91ff('0x20')]+_0x23259b['countabandonedretry']+_0x23259b[_0x91ff('0x21')]+_0x23259b[_0x91ff('0x22')]<_0x2b193b[_0x91ff('0x23')]['dialGlobalMaxRetry'])_0x38c3c5=0x1;_0x1d0c18({'additional':_0x38c3c5});}else{return db[_0x91ff('0x24')][_0x91ff('0x15')]({'raw':!![],'where':{'CmHopperId':_0x2b1317['id']},'order':[[_0x91ff('0x1b'),_0x91ff('0x25')]]})[_0x91ff('0x26')](function(_0x13db57){var _0x5be7ef=0x0;if(_0x13db57){if(_0x13db57[_0x91ff('0x1c')]+_0x13db57[_0x91ff('0x1d')]+_0x13db57[_0x91ff('0x1e')]+_0x13db57['countnosuchnumberretry']+_0x13db57[_0x91ff('0x20')]+_0x13db57['countabandonedretry']+_0x13db57[_0x91ff('0x21')]+_0x13db57[_0x91ff('0x22')]<_0x2b193b[_0x91ff('0x23')]['dialGlobalMaxRetry'])_0x5be7ef=0x1;_0x1d0c18({'additional':_0x5be7ef});}else{_0x1d0c18({'additional':0x0});}})[_0x91ff('0x27')](function(_0x31129d){logger[_0x91ff('0x11')](_0x91ff('0x28'),_0x31129d['message']);_0x31e03d(_0x21e519[_0x91ff('0x11')](0x1f4,_0x31129d['message']));});}})[_0x91ff('0x27')](function(_0x1c5b9e){logger[_0x91ff('0x11')]('VerifyAdditionalPhones',_0x1c5b9e[_0x91ff('0x13')]);_0x31e03d(_0x21e519[_0x91ff('0x11')](0x1f4,_0x1c5b9e['message']));});}else _0x1d0c18({'additional':0x0});});});};exports[_0x91ff('0x29')]=function(_0x42c23e){var _0x28ecf7=this;return new Promise(function(_0x1b42b3,_0x321e9d){return db[_0x91ff('0x2a')]['findOne']({'raw':!![],'where':{'ContactId':_0x42c23e[_0x91ff('0x16')][_0x91ff('0x17')],'ListId':_0x42c23e[_0x91ff('0x16')][_0x91ff('0x18')],'VoiceQueueId':_0x42c23e[_0x91ff('0x16')][_0x91ff('0x19')]===undefined?null:_0x42c23e[_0x91ff('0x16')][_0x91ff('0x19')],'CampaignId':_0x42c23e['body'][_0x91ff('0x1a')]===undefined?null:_0x42c23e[_0x91ff('0x16')][_0x91ff('0x1a')]}})[_0x91ff('0x26')](function(_0x32e79f){if(_0x32e79f!=null){return db[_0x91ff('0x24')][_0x91ff('0x15')]({'raw':!![],'where':{'CmHopperId':_0x32e79f['id'],'OrderBy':{'$gte':_0x32e79f[_0x91ff('0x1b')]}},'order':[[_0x91ff('0x1b'),'ASC']]})[_0x91ff('0x26')](function(_0xc232a){if(_0xc232a)return activateAdditionalPhone(_0x32e79f,_0x42c23e[_0x91ff('0x16')],_0xc232a,_0x42c23e[_0x91ff('0x2b')],_0x42c23e['waitTime'])[_0x91ff('0x26')](function(_0x5df2da){_0x1b42b3(_0x5df2da);});else{return db[_0x91ff('0x24')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x32e79f['id']},'order':[[_0x91ff('0x1b'),_0x91ff('0x25')]]})[_0x91ff('0x26')](function(_0x50c717){if(_0x50c717)return activateAdditionalPhone(_0x32e79f,_0x42c23e['body'],_0x50c717,_0x42c23e[_0x91ff('0x2b')],_0x42c23e[_0x91ff('0x2c')])['then'](function(_0x28ec88){_0x1b42b3(_0x28ec88);});else{_0x1b42b3({'id':_0x32e79f['id'],'phone':''});}})['catch'](function(_0x213157){logger[_0x91ff('0x11')](_0x91ff('0x28'),_0x213157[_0x91ff('0x13')]);_0x321e9d(_0x28ecf7[_0x91ff('0x11')](0x1f4,_0x213157['message']));});}})['catch'](function(_0x3c402c){logger[_0x91ff('0x11')](_0x91ff('0x28'),_0x3c402c[_0x91ff('0x13')]);_0x321e9d(_0x28ecf7[_0x91ff('0x11')](0x1f4,_0x3c402c[_0x91ff('0x13')]));});}else _0x1b42b3(0x1);});});};function activateAdditionalPhone(_0x53a057,_0x811476,_0x11922c,_0x11362a,_0x65747c){return new Promise(function(_0x3a5724,_0x7758c1){var _0x35666b;if(_[_0x91ff('0x2d')](_0x11922c['scheduledat'])){_0x11922c[_0x91ff('0x2e')]=moment();}if(moment()>moment(_0x11922c[_0x91ff('0x2e')])){_0x35666b=moment()[_0x91ff('0x2f')](_0x65747c||0x3,_0x91ff('0x30'));}else{if(_0x11922c['OrderBy']==0x0){_0x35666b=moment(_0x11922c[_0x91ff('0x2e')]);}else{_0x35666b=moment()[_0x91ff('0x2f')](_0x65747c||0x3,'minutes');}}if(_['isNil'](_0x35666b)){_0x35666b=moment()[_0x91ff('0x2f')](_0x65747c||0x3,_0x91ff('0x30'));}var _0x48ed95={'phone':_0x53a057[_0x91ff('0x31')],'active':0x0,'OrderBy':_[_0x91ff('0x2d')](_0x53a057[_0x91ff('0x1b')])?0x0:_0x53a057['OrderBy'],'scheduledat':moment()[_0x91ff('0x2f')](_0x11362a||0x1,_0x91ff('0x30')),'countbusyretry':_0x811476[_0x91ff('0x1c')],'countcongestionretry':_0x811476[_0x91ff('0x1d')],'countnoanswerretry':_0x811476[_0x91ff('0x1e')],'countnosuchnumberretry':_0x811476[_0x91ff('0x1f')],'countdropretry':_0x811476[_0x91ff('0x20')],'countabandonedretry':_0x811476['countabandonedretry'],'countmachineretry':_0x811476[_0x91ff('0x21')],'countagentrejectretry':_0x811476[_0x91ff('0x22')],'createdAt':_0x811476[_0x91ff('0x32')],'updatedAt':_0x811476[_0x91ff('0x33')]};var _0xc41bda={'CmHopperId':_0x53a057['id'],'phone':_0x11922c['phone'],'active':0x0,'OrderBy':_[_0x91ff('0x2d')](_0x11922c[_0x91ff('0x1b')])?0x0:_0x11922c['OrderBy'],'scheduledat':_0x35666b,'countbusyretry':_0x11922c[_0x91ff('0x1c')],'countcongestionretry':_0x11922c[_0x91ff('0x1d')],'countnoanswerretry':_0x11922c[_0x91ff('0x1e')],'countnosuchnumberretry':_0x11922c[_0x91ff('0x1f')],'countdropretry':_0x11922c[_0x91ff('0x20')],'countabandonedretry':_0x11922c[_0x91ff('0x34')],'countmachineretry':_0x11922c[_0x91ff('0x21')],'countagentrejectretry':_0x11922c[_0x91ff('0x22')],'createdAt':_0x11922c[_0x91ff('0x32')],'updatedAt':_0x11922c[_0x91ff('0x33')]};return db[_0x91ff('0x35')][_0x91ff('0x36')](function(_0x449f04){return db[_0x91ff('0x24')][_0x91ff('0x37')](_0x48ed95,{'where':{'id':_0x11922c['id']}},{'transaction':_0x449f04})[_0x91ff('0x26')](function(){return db[_0x91ff('0x2a')][_0x91ff('0x37')](_0xc41bda,{'where':{'id':_0x53a057['id']}},{'transaction':_0x449f04});});})['then'](function(_0x449200){_0x3a5724({'id':_0x53a057['id'],'phone':_0x11922c[_0x91ff('0x31')]});})[_0x91ff('0x27')](function(_0x53b294){logger['error'](_0x91ff('0x38'),_0x53b294[_0x91ff('0x13')]);_0x7758c1({'error':_0x53b294[_0x91ff('0x13')]});});});}exports['IncrementPreviewCounters']=function(_0x597de7){var _0x4fbe14=this;return new Promise(function(_0x2e5e39,_0x44b361){return db[_0x91ff('0x2a')]['update'](_0x597de7[_0x91ff('0x16')][_0x91ff('0x39')],{'where':{'id':_0x597de7[_0x91ff('0x16')]['id']}})['then'](function(_0x39ca9d){_0x2e5e39(_0x39ca9d);})['catch'](function(_0x1c5a37){logger[_0x91ff('0x11')](_0x91ff('0x3a'),_0x1c5a37['message']);_0x44b361(_0x4fbe14['error'](0x1f4,_0x1c5a37['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 6fb09e9..27922cb 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 _0x22f3=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','exports','multer'];(function(_0x519610,_0x16b547){var _0x33aa8a=function(_0x3585b0){while(--_0x3585b0){_0x519610['push'](_0x519610['shift']());}};_0x33aa8a(++_0x16b547);}(_0x22f3,0x155));var _0x322f=function(_0x263a0a,_0x2aebeb){_0x263a0a=_0x263a0a-0x0;var _0x9fdcb=_0x22f3[_0x263a0a];return _0x9fdcb;};'use strict';var multer=require(_0x322f('0x0'));var util=require(_0x322f('0x1'));var path=require(_0x322f('0x2'));var timeout=require(_0x322f('0x3'));var express=require(_0x322f('0x4'));var router=express['Router']();var fs_extra=require(_0x322f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x322f('0x6'));var config=require(_0x322f('0x7'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x322f('0x8')]('/',auth['isAuthenticated'](),controller[_0x322f('0x9')]);router['get'](_0x322f('0xa'),auth['isAuthenticated'](),controller[_0x322f('0xb')]);router[_0x322f('0xc')]('/',auth[_0x322f('0xd')](),controller[_0x322f('0xe')]);router[_0x322f('0xf')](_0x322f('0xa'),auth[_0x322f('0xd')](),controller[_0x322f('0x10')]);router[_0x322f('0x11')](_0x322f('0xa'),auth[_0x322f('0xd')](),controller['destroy']);module[_0x322f('0x12')]=router; \ No newline at end of file +var _0x8a83=['Router','fs-extra','../../components/auth/service','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','/:id','show','post','create','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x32df0d,_0x475241){var _0xd8b308=function(_0x643128){while(--_0x643128){_0x32df0d['push'](_0x32df0d['shift']());}};_0xd8b308(++_0x475241);}(_0x8a83,0x10a));var _0x38a8=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x8a83[_0x2053ea];return _0x2232c4;};'use strict';var multer=require('multer');var util=require(_0x38a8('0x0'));var path=require(_0x38a8('0x1'));var timeout=require(_0x38a8('0x2'));var express=require(_0x38a8('0x3'));var router=express[_0x38a8('0x4')]();var fs_extra=require(_0x38a8('0x5'));var auth=require(_0x38a8('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x38a8('0x7'));router['get']('/',auth[_0x38a8('0x8')](),controller[_0x38a8('0x9')]);router[_0x38a8('0xa')](_0x38a8('0xb'),auth['isAuthenticated'](),controller[_0x38a8('0xc')]);router[_0x38a8('0xd')]('/',auth[_0x38a8('0x8')](),controller[_0x38a8('0xe')]);router['put'](_0x38a8('0xb'),auth[_0x38a8('0x8')](),controller[_0x38a8('0xf')]);router[_0x38a8('0x10')](_0x38a8('0xb'),auth[_0x38a8('0x8')](),controller[_0x38a8('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 0611249..e3cb63c 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 _0x3f8a=['INTEGER','moment','sequelize','exports','STRING','contactListQueue'];(function(_0x4bfcbe,_0x4630f5){var _0x5b65e6=function(_0x5dcfc8){while(--_0x5dcfc8){_0x4bfcbe['push'](_0x4bfcbe['shift']());}};_0x5b65e6(++_0x4630f5);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x5e7fdc,_0x538e74){_0x5e7fdc=_0x5e7fdc-0x0;var _0x496831=_0x3f8a[_0x5e7fdc];return _0x496831;};'use strict';var moment=require(_0xa3f8('0x0'));var Sequelize=require(_0xa3f8('0x1'));module[_0xa3f8('0x2')]={'phone':{'type':Sequelize[_0xa3f8('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xa3f8('0x4')},'ListId':{'type':Sequelize[_0xa3f8('0x5')],'unique':_0xa3f8('0x4')},'VoiceQueueId':{'type':Sequelize[_0xa3f8('0x5')],'unique':_0xa3f8('0x4')}}; \ No newline at end of file +var _0x41fe=['sequelize','exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x41fe,0xd1));var _0xe41f=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x41fe[_0x13b8f3];return _0x1a6d06;};'use strict';var moment=require(_0xe41f('0x0'));var Sequelize=require(_0xe41f('0x1'));module[_0xe41f('0x2')]={'phone':{'type':Sequelize[_0xe41f('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xe41f('0x4')],'unique':_0xe41f('0x5')},'ListId':{'type':Sequelize[_0xe41f('0x4')],'unique':_0xe41f('0x5')},'VoiceQueueId':{'type':Sequelize[_0xe41f('0x4')],'unique':_0xe41f('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index bad29fa..6daf896 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 _0xa914=['../../config/license/hardware','../../config/logger','api','../../config/environment','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','CmHopperBlack','findAll','catch','show','params','length','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x43742a,_0x33d380){var _0x38a337=function(_0x4911cd){while(--_0x4911cd){_0x43742a['push'](_0x43742a['shift']());}};_0x38a337(++_0x33d380);}(_0xa914,0x83));var _0x4a91=function(_0x196192,_0x58189a){_0x196192=_0x196192-0x0;var _0x3fdb0f=_0xa914[_0x196192];return _0x3fdb0f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a91('0x0'));var zipdir=require(_0x4a91('0x1'));var jsonpatch=require(_0x4a91('0x2'));var rp=require(_0x4a91('0x3'));var moment=require(_0x4a91('0x4'));var BPromise=require(_0x4a91('0x5'));var Mustache=require(_0x4a91('0x6'));var util=require(_0x4a91('0x7'));var path=require(_0x4a91('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4a91('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a91('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4a91('0xb'));var deskjs=require(_0x4a91('0xc'));var toCsv=require(_0x4a91('0xd'));var querystring=require(_0x4a91('0xe'));var Papa=require(_0x4a91('0xf'));var Redis=require(_0x4a91('0x10'));var authService=require(_0x4a91('0x11'));var qs=require(_0x4a91('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a91('0x13'));var logger=require(_0x4a91('0x14'))(_0x4a91('0x15'));var utils=require('../../config/utils');var config=require(_0x4a91('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16abf0,_0x22da39){_0x22da39=_0x22da39||0xcc;return function(_0x9b241b){if(_0x9b241b){return _0x16abf0['sendStatus'](_0x22da39);}return _0x16abf0['status'](_0x22da39)['end']();};}function respondWithResult(_0x226de8,_0x55dc1e){_0x55dc1e=_0x55dc1e||0xc8;return function(_0x4530dd){if(_0x4530dd){return _0x226de8[_0x4a91('0x17')](_0x55dc1e)[_0x4a91('0x18')](_0x4530dd);}};}function respondWithFilteredResult(_0x4bc140,_0x243018){return function(_0x3800f){if(_0x3800f){var _0x225b24=typeof _0x243018[_0x4a91('0x19')]==='undefined'&&typeof _0x243018[_0x4a91('0x1a')]===_0x4a91('0x1b');var _0x66e667=_0x3800f[_0x4a91('0x1c')];var _0x149944=_0x225b24?0x0:_0x243018[_0x4a91('0x19')];var _0x414661=_0x225b24?_0x3800f[_0x4a91('0x1c')]:_0x243018['offset']+_0x243018[_0x4a91('0x1a')];var _0x3ef1e3;if(_0x414661>=_0x66e667){_0x414661=_0x66e667;_0x3ef1e3=0xc8;}else{_0x3ef1e3=0xce;}_0x4bc140[_0x4a91('0x17')](_0x3ef1e3);return _0x4bc140[_0x4a91('0x1d')](_0x4a91('0x1e'),_0x149944+'-'+_0x414661+'/'+_0x66e667)['json'](_0x3800f);}return null;};}function patchUpdates(_0x481d68){return function(_0x5a257a){try{jsonpatch[_0x4a91('0x1f')](_0x5a257a,_0x481d68,!![]);}catch(_0x6688e9){return BPromise[_0x4a91('0x20')](_0x6688e9);}return _0x5a257a[_0x4a91('0x21')]();};}function saveUpdates(_0x4ae31e,_0x253081){return function(_0x45d436){if(_0x45d436){return _0x45d436[_0x4a91('0x22')](_0x4ae31e)[_0x4a91('0x23')](function(_0x34dbbb){return _0x34dbbb;});}return null;};}function removeEntity(_0x448340,_0x5c4aa4){return function(_0x12ae5a){if(_0x12ae5a){return _0x12ae5a[_0x4a91('0x24')]()['then'](function(){_0x448340['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f4576,_0x4b70c7){return function(_0x3cc981){if(!_0x3cc981){_0x5f4576[_0x4a91('0x25')](0x194);}return _0x3cc981;};}function handleError(_0x1f1e84,_0x2e5a40){_0x2e5a40=_0x2e5a40||0x1f4;return function(_0x1df1ca){logger[_0x4a91('0x26')](_0x1df1ca[_0x4a91('0x27')]);if(_0x1df1ca[_0x4a91('0x28')]){delete _0x1df1ca[_0x4a91('0x28')];}_0x1f1e84[_0x4a91('0x17')](_0x2e5a40)[_0x4a91('0x29')](_0x1df1ca);};}exports[_0x4a91('0x2a')]=function(_0x1081aa,_0x563e22){var _0x437095={},_0x3f2dd9={},_0x3d0884={'count':0x0,'rows':[]};var _0x387e57=_['map'](db['CmHopperBlack'][_0x4a91('0x2b')],function(_0x4a35cb){return{'name':_0x4a35cb[_0x4a91('0x2c')],'type':_0x4a35cb[_0x4a91('0x2d')]['key']};});_0x3f2dd9[_0x4a91('0x2e')]=_[_0x4a91('0x2f')](_0x387e57,'name');_0x3f2dd9['query']=_[_0x4a91('0x30')](_0x1081aa[_0x4a91('0x31')]);_0x3f2dd9['filters']=_[_0x4a91('0x32')](_0x3f2dd9[_0x4a91('0x2e')],_0x3f2dd9[_0x4a91('0x31')]);_0x437095[_0x4a91('0x33')]=_[_0x4a91('0x32')](_0x3f2dd9[_0x4a91('0x2e')],qs[_0x4a91('0x34')](_0x1081aa[_0x4a91('0x31')][_0x4a91('0x34')]));_0x437095[_0x4a91('0x33')]=_0x437095['attributes']['length']?_0x437095[_0x4a91('0x33')]:_0x3f2dd9[_0x4a91('0x2e')];if(!_0x1081aa[_0x4a91('0x31')][_0x4a91('0x35')](_0x4a91('0x36'))){_0x437095['limit']=qs[_0x4a91('0x1a')](_0x1081aa[_0x4a91('0x31')][_0x4a91('0x1a')]);_0x437095[_0x4a91('0x19')]=qs[_0x4a91('0x19')](_0x1081aa[_0x4a91('0x31')][_0x4a91('0x19')]);}_0x437095[_0x4a91('0x37')]=qs['sort'](_0x1081aa['query'][_0x4a91('0x38')]);_0x437095[_0x4a91('0x39')]=qs[_0x4a91('0x3a')](_[_0x4a91('0x3b')](_0x1081aa[_0x4a91('0x31')],_0x3f2dd9['filters']),_0x387e57);if(_0x1081aa[_0x4a91('0x31')]['filter']){_0x437095[_0x4a91('0x39')]=_[_0x4a91('0x3c')](_0x437095['where'],{'$or':_[_0x4a91('0x2f')](_0x387e57,function(_0x340d50){if(_0x340d50['type']!==_0x4a91('0x3d')){var _0xde069b={};_0xde069b[_0x340d50[_0x4a91('0x28')]]={'$like':'%'+_0x1081aa[_0x4a91('0x31')][_0x4a91('0x3e')]+'%'};return _0xde069b;}})});}_0x437095=_[_0x4a91('0x3c')]({},_0x437095,_0x1081aa[_0x4a91('0x3f')]);var _0x35b458={'where':_0x437095[_0x4a91('0x39')]};return db['CmHopperBlack'][_0x4a91('0x1c')](_0x35b458)['then'](function(_0x4b6351){_0x3d0884[_0x4a91('0x1c')]=_0x4b6351;if(_0x1081aa[_0x4a91('0x31')][_0x4a91('0x40')]){_0x437095[_0x4a91('0x41')]=[{'all':!![]}];}return db[_0x4a91('0x42')][_0x4a91('0x43')](_0x437095);})[_0x4a91('0x23')](function(_0x26e189){_0x3d0884['rows']=_0x26e189;return _0x3d0884;})[_0x4a91('0x23')](respondWithFilteredResult(_0x563e22,_0x437095))[_0x4a91('0x44')](handleError(_0x563e22,null));};exports[_0x4a91('0x45')]=function(_0x554b70,_0x169509){var _0x3dd75b={'raw':!![],'where':{'id':_0x554b70[_0x4a91('0x46')]['id']}},_0x16cd15={};_0x16cd15[_0x4a91('0x2e')]=_[_0x4a91('0x30')](db[_0x4a91('0x42')][_0x4a91('0x2b')]);_0x16cd15[_0x4a91('0x31')]=_[_0x4a91('0x30')](_0x554b70[_0x4a91('0x31')]);_0x16cd15[_0x4a91('0x3a')]=_[_0x4a91('0x32')](_0x16cd15[_0x4a91('0x2e')],_0x16cd15[_0x4a91('0x31')]);_0x3dd75b[_0x4a91('0x33')]=_[_0x4a91('0x32')](_0x16cd15[_0x4a91('0x2e')],qs['fields'](_0x554b70['query']['fields']));_0x3dd75b['attributes']=_0x3dd75b[_0x4a91('0x33')][_0x4a91('0x47')]?_0x3dd75b[_0x4a91('0x33')]:_0x16cd15['model'];if(_0x554b70['query'][_0x4a91('0x40')]){_0x3dd75b['include']=[{'all':!![]}];}_0x3dd75b=_[_0x4a91('0x3c')]({},_0x3dd75b,_0x554b70[_0x4a91('0x3f')]);return db[_0x4a91('0x42')][_0x4a91('0x48')](_0x3dd75b)[_0x4a91('0x23')](handleEntityNotFound(_0x169509,null))['then'](respondWithResult(_0x169509,null))['catch'](handleError(_0x169509,null));};exports['update']=function(_0x861d13,_0x5bb849){if(_0x861d13['body']['id']){delete _0x861d13[_0x4a91('0x49')]['id'];}return db['CmHopperBlack'][_0x4a91('0x48')]({'where':{'id':_0x861d13[_0x4a91('0x46')]['id']}})[_0x4a91('0x23')](handleEntityNotFound(_0x5bb849,null))[_0x4a91('0x23')](saveUpdates(_0x861d13[_0x4a91('0x49')],null))[_0x4a91('0x23')](respondWithResult(_0x5bb849,null))[_0x4a91('0x44')](handleError(_0x5bb849,null));};exports[_0x4a91('0x24')]=function(_0x10c56c,_0x307a5a){return db['CmHopperBlack']['find']({'where':{'id':_0x10c56c[_0x4a91('0x46')]['id']}})[_0x4a91('0x23')](handleEntityNotFound(_0x307a5a,null))[_0x4a91('0x23')](removeEntity(_0x307a5a,null))[_0x4a91('0x44')](handleError(_0x307a5a,null));};exports[_0x4a91('0x4a')]=function(_0x37138a,_0x209e9e){return db[_0x4a91('0x42')][_0x4a91('0x4a')]()['then'](respondWithResult(_0x209e9e,null))['catch'](handleError(_0x209e9e,null));}; \ No newline at end of file +var _0xce85=['key','model','map','keys','filters','attributes','intersection','fields','query','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','params','length','include','catch','update','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','lodash','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','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','sendStatus','stack','name','send','index','CmHopperBlack','rawAttributes','type'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xce85,0x1b8));var _0x5ce8=function(_0x368714,_0x597df4){_0x368714=_0x368714-0x0;var _0x1e9404=_0xce85[_0x368714];return _0x1e9404;};'use strict';var emlformat=require(_0x5ce8('0x0'));var rimraf=require(_0x5ce8('0x1'));var zipdir=require(_0x5ce8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ce8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5ce8('0x4'));var util=require(_0x5ce8('0x5'));var path=require('path');var sox=require(_0x5ce8('0x6'));var csv=require(_0x5ce8('0x7'));var ejs=require(_0x5ce8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ce8('0x9'));var squel=require('squel');var crypto=require(_0x5ce8('0xa'));var jsforce=require(_0x5ce8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5ce8('0x7'));var querystring=require(_0x5ce8('0xc'));var Papa=require(_0x5ce8('0xd'));var Redis=require(_0x5ce8('0xe'));var authService=require(_0x5ce8('0xf'));var qs=require(_0x5ce8('0x10'));var as=require(_0x5ce8('0x11'));var hardwareService=require(_0x5ce8('0x12'));var logger=require(_0x5ce8('0x13'))(_0x5ce8('0x14'));var utils=require(_0x5ce8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5ce8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x506091,_0x4d6395){_0x4d6395=_0x4d6395||0xcc;return function(_0x99a473){if(_0x99a473){return _0x506091['sendStatus'](_0x4d6395);}return _0x506091[_0x5ce8('0x17')](_0x4d6395)[_0x5ce8('0x18')]();};}function respondWithResult(_0x33bc39,_0x1f1493){_0x1f1493=_0x1f1493||0xc8;return function(_0x46209d){if(_0x46209d){return _0x33bc39[_0x5ce8('0x17')](_0x1f1493)[_0x5ce8('0x19')](_0x46209d);}};}function respondWithFilteredResult(_0x3c39f2,_0x4933ff){return function(_0x2cd61b){if(_0x2cd61b){var _0x38b944=typeof _0x4933ff[_0x5ce8('0x1a')]===_0x5ce8('0x1b')&&typeof _0x4933ff['limit']===_0x5ce8('0x1b');var _0x450685=_0x2cd61b[_0x5ce8('0x1c')];var _0x3dc77d=_0x38b944?0x0:_0x4933ff[_0x5ce8('0x1a')];var _0x3aa61e=_0x38b944?_0x2cd61b[_0x5ce8('0x1c')]:_0x4933ff[_0x5ce8('0x1a')]+_0x4933ff[_0x5ce8('0x1d')];var _0x237dd4;if(_0x3aa61e>=_0x450685){_0x3aa61e=_0x450685;_0x237dd4=0xc8;}else{_0x237dd4=0xce;}_0x3c39f2[_0x5ce8('0x17')](_0x237dd4);return _0x3c39f2[_0x5ce8('0x1e')](_0x5ce8('0x1f'),_0x3dc77d+'-'+_0x3aa61e+'/'+_0x450685)[_0x5ce8('0x19')](_0x2cd61b);}return null;};}function patchUpdates(_0x1f1ff0){return function(_0x50f457){try{jsonpatch[_0x5ce8('0x20')](_0x50f457,_0x1f1ff0,!![]);}catch(_0x275835){return BPromise['reject'](_0x275835);}return _0x50f457['save']();};}function saveUpdates(_0x2857d7,_0x32e44b){return function(_0x3b7d91){if(_0x3b7d91){return _0x3b7d91['update'](_0x2857d7)[_0x5ce8('0x21')](function(_0x243b0b){return _0x243b0b;});}return null;};}function removeEntity(_0xbc2c25,_0x575789){return function(_0x1ea6ff){if(_0x1ea6ff){return _0x1ea6ff[_0x5ce8('0x22')]()[_0x5ce8('0x21')](function(){_0xbc2c25[_0x5ce8('0x17')](0xcc)[_0x5ce8('0x18')]();});}};}function handleEntityNotFound(_0x364fc7,_0x23a6fb){return function(_0x2559ea){if(!_0x2559ea){_0x364fc7[_0x5ce8('0x23')](0x194);}return _0x2559ea;};}function handleError(_0x2755e1,_0x2f4c8b){_0x2f4c8b=_0x2f4c8b||0x1f4;return function(_0x5b47dd){logger['error'](_0x5b47dd[_0x5ce8('0x24')]);if(_0x5b47dd[_0x5ce8('0x25')]){delete _0x5b47dd['name'];}_0x2755e1[_0x5ce8('0x17')](_0x2f4c8b)[_0x5ce8('0x26')](_0x5b47dd);};}exports[_0x5ce8('0x27')]=function(_0x59b66b,_0x12ed7c){var _0x1fa4eb={},_0x289abe={},_0x33ffd0={'count':0x0,'rows':[]};var _0x56025e=_['map'](db[_0x5ce8('0x28')][_0x5ce8('0x29')],function(_0x19c041){return{'name':_0x19c041['fieldName'],'type':_0x19c041[_0x5ce8('0x2a')][_0x5ce8('0x2b')]};});_0x289abe[_0x5ce8('0x2c')]=_[_0x5ce8('0x2d')](_0x56025e,'name');_0x289abe['query']=_[_0x5ce8('0x2e')](_0x59b66b['query']);_0x289abe[_0x5ce8('0x2f')]=_['intersection'](_0x289abe['model'],_0x289abe['query']);_0x1fa4eb[_0x5ce8('0x30')]=_[_0x5ce8('0x31')](_0x289abe[_0x5ce8('0x2c')],qs[_0x5ce8('0x32')](_0x59b66b[_0x5ce8('0x33')]['fields']));_0x1fa4eb[_0x5ce8('0x30')]=_0x1fa4eb[_0x5ce8('0x30')]['length']?_0x1fa4eb[_0x5ce8('0x30')]:_0x289abe[_0x5ce8('0x2c')];if(!_0x59b66b[_0x5ce8('0x33')]['hasOwnProperty'](_0x5ce8('0x34'))){_0x1fa4eb[_0x5ce8('0x1d')]=qs[_0x5ce8('0x1d')](_0x59b66b[_0x5ce8('0x33')][_0x5ce8('0x1d')]);_0x1fa4eb[_0x5ce8('0x1a')]=qs[_0x5ce8('0x1a')](_0x59b66b[_0x5ce8('0x33')][_0x5ce8('0x1a')]);}_0x1fa4eb['order']=qs[_0x5ce8('0x35')](_0x59b66b[_0x5ce8('0x33')][_0x5ce8('0x35')]);_0x1fa4eb['where']=qs['filters'](_[_0x5ce8('0x36')](_0x59b66b['query'],_0x289abe[_0x5ce8('0x2f')]),_0x56025e);if(_0x59b66b['query'][_0x5ce8('0x37')]){_0x1fa4eb[_0x5ce8('0x38')]=_[_0x5ce8('0x39')](_0x1fa4eb[_0x5ce8('0x38')],{'$or':_[_0x5ce8('0x2d')](_0x56025e,function(_0x54f65e){if(_0x54f65e[_0x5ce8('0x2a')]!==_0x5ce8('0x3a')){var _0x41574b={};_0x41574b[_0x54f65e[_0x5ce8('0x25')]]={'$like':'%'+_0x59b66b[_0x5ce8('0x33')][_0x5ce8('0x37')]+'%'};return _0x41574b;}})});}_0x1fa4eb=_[_0x5ce8('0x39')]({},_0x1fa4eb,_0x59b66b[_0x5ce8('0x3b')]);var _0x2eeec5={'where':_0x1fa4eb[_0x5ce8('0x38')]};return db[_0x5ce8('0x28')]['count'](_0x2eeec5)[_0x5ce8('0x21')](function(_0x40b933){_0x33ffd0[_0x5ce8('0x1c')]=_0x40b933;if(_0x59b66b[_0x5ce8('0x33')][_0x5ce8('0x3c')]){_0x1fa4eb['include']=[{'all':!![]}];}return db[_0x5ce8('0x28')][_0x5ce8('0x3d')](_0x1fa4eb);})['then'](function(_0x4a0c3b){_0x33ffd0['rows']=_0x4a0c3b;return _0x33ffd0;})[_0x5ce8('0x21')](respondWithFilteredResult(_0x12ed7c,_0x1fa4eb))['catch'](handleError(_0x12ed7c,null));};exports['show']=function(_0x4811e8,_0x44e4d8){var _0x3bf2d8={'raw':!![],'where':{'id':_0x4811e8[_0x5ce8('0x3e')]['id']}},_0x3b149a={};_0x3b149a[_0x5ce8('0x2c')]=_[_0x5ce8('0x2e')](db[_0x5ce8('0x28')]['rawAttributes']);_0x3b149a[_0x5ce8('0x33')]=_['keys'](_0x4811e8[_0x5ce8('0x33')]);_0x3b149a['filters']=_['intersection'](_0x3b149a['model'],_0x3b149a[_0x5ce8('0x33')]);_0x3bf2d8[_0x5ce8('0x30')]=_[_0x5ce8('0x31')](_0x3b149a['model'],qs[_0x5ce8('0x32')](_0x4811e8[_0x5ce8('0x33')][_0x5ce8('0x32')]));_0x3bf2d8['attributes']=_0x3bf2d8[_0x5ce8('0x30')][_0x5ce8('0x3f')]?_0x3bf2d8[_0x5ce8('0x30')]:_0x3b149a[_0x5ce8('0x2c')];if(_0x4811e8[_0x5ce8('0x33')][_0x5ce8('0x3c')]){_0x3bf2d8[_0x5ce8('0x40')]=[{'all':!![]}];}_0x3bf2d8=_['merge']({},_0x3bf2d8,_0x4811e8[_0x5ce8('0x3b')]);return db[_0x5ce8('0x28')]['find'](_0x3bf2d8)[_0x5ce8('0x21')](handleEntityNotFound(_0x44e4d8,null))[_0x5ce8('0x21')](respondWithResult(_0x44e4d8,null))[_0x5ce8('0x41')](handleError(_0x44e4d8,null));};exports[_0x5ce8('0x42')]=function(_0x400fc8,_0x595175){if(_0x400fc8[_0x5ce8('0x43')]['id']){delete _0x400fc8[_0x5ce8('0x43')]['id'];}return db[_0x5ce8('0x28')]['find']({'where':{'id':_0x400fc8[_0x5ce8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x595175,null))[_0x5ce8('0x21')](saveUpdates(_0x400fc8['body'],null))[_0x5ce8('0x21')](respondWithResult(_0x595175,null))[_0x5ce8('0x41')](handleError(_0x595175,null));};exports[_0x5ce8('0x22')]=function(_0x58322b,_0x4dd2b0){return db[_0x5ce8('0x28')]['find']({'where':{'id':_0x58322b[_0x5ce8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4dd2b0,null))[_0x5ce8('0x21')](removeEntity(_0x4dd2b0,null))[_0x5ce8('0x41')](handleError(_0x4dd2b0,null));};exports['describe']=function(_0x511173,_0x4a1199){return db[_0x5ce8('0x28')][_0x5ce8('0x44')]()['then'](respondWithResult(_0x4a1199,null))[_0x5ce8('0x41')](handleError(_0x4a1199,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index f8b35fa..e54f7f7 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 _0x8bb6=['define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes'];(function(_0x10a4e8,_0x5c47aa){var _0x21e006=function(_0x44bbf6){while(--_0x44bbf6){_0x10a4e8['push'](_0x10a4e8['shift']());}};_0x21e006(++_0x5c47aa);}(_0x8bb6,0x1df));var _0x68bb=function(_0x5e91da,_0x13f1ea){_0x5e91da=_0x5e91da-0x0;var _0x584c38=_0x8bb6[_0x5e91da];return _0x584c38;};'use strict';var _=require(_0x68bb('0x0'));var util=require(_0x68bb('0x1'));var logger=require(_0x68bb('0x2'))(_0x68bb('0x3'));var moment=require(_0x68bb('0x4'));var BPromise=require(_0x68bb('0x5'));var rp=require(_0x68bb('0x6'));var fs=require('fs');var path=require(_0x68bb('0x7'));var rimraf=require(_0x68bb('0x8'));var config=require(_0x68bb('0x9'));var attributes=require(_0x68bb('0xa'));module['exports']=function(_0x56cfb8,_0x43a13a){return _0x56cfb8[_0x68bb('0xb')](_0x68bb('0xc'),attributes,{'tableName':_0x68bb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ba0=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black','util'];(function(_0x5dca98,_0x39c153){var _0x502083=function(_0x2ba087){while(--_0x2ba087){_0x5dca98['push'](_0x5dca98['shift']());}};_0x502083(++_0x39c153);}(_0x0ba0,0xa7));var _0x00ba=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x0ba0[_0x38ced4];return _0x547c07;};'use strict';var _=require('lodash');var util=require(_0x00ba('0x0'));var logger=require(_0x00ba('0x1'))(_0x00ba('0x2'));var moment=require('moment');var BPromise=require(_0x00ba('0x3'));var rp=require(_0x00ba('0x4'));var fs=require('fs');var path=require(_0x00ba('0x5'));var rimraf=require(_0x00ba('0x6'));var config=require(_0x00ba('0x7'));var attributes=require(_0x00ba('0x8'));module[_0x00ba('0x9')]=function(_0x2b2256,_0x33a7f1){return _0x2b2256[_0x00ba('0xa')]('CmHopperBlack',attributes,{'tableName':_0x00ba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 89147c7..bdbc479 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 _0xe83e=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CmHopperBlack','options','attributes','limit','include','map','model','GetCmHopperBlack','UpdateCmHopperBlack','update','body','raw','where','DestroyCmHopperBlack','destroy','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe83e,0x1e8));var _0xee83=function(_0x5f053a,_0x32ddc2){_0x5f053a=_0x5f053a-0x0;var _0x49cf42=_0xe83e[_0x5f053a];return _0x49cf42;};'use strict';var _=require('lodash');var util=require(_0xee83('0x0'));var moment=require(_0xee83('0x1'));var BPromise=require(_0xee83('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee83('0x3'));var db=require(_0xee83('0x4'))['db'];var utils=require(_0xee83('0x5'));var logger=require(_0xee83('0x6'))('rpc');var config=require(_0xee83('0x7'));var jayson=require(_0xee83('0x8'));var client=jayson[_0xee83('0x9')][_0xee83('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x572fb6,_0x5495cb,_0x19fd7c){return new BPromise(function(_0x1b9f2c,_0x101b16){return client['request'](_0x572fb6,_0x19fd7c)[_0xee83('0xb')](function(_0x57af73){logger[_0xee83('0xc')](_0xee83('0xd'),_0x5495cb,_0xee83('0xe'));logger[_0xee83('0xf')](_0xee83('0x10'),_0x5495cb,_0xee83('0xe'),JSON[_0xee83('0x11')](_0x57af73));if(_0x57af73['error']){if(_0x57af73['error'][_0xee83('0x12')]===0x1f4){logger[_0xee83('0x13')](_0xee83('0xd'),_0x5495cb,_0x57af73[_0xee83('0x13')][_0xee83('0x14')]);return _0x101b16(_0x57af73['error'][_0xee83('0x14')]);}logger[_0xee83('0x13')](_0xee83('0xd'),_0x5495cb,_0x57af73[_0xee83('0x13')][_0xee83('0x14')]);return _0x1b9f2c(_0x57af73[_0xee83('0x13')]['message']);}else{logger[_0xee83('0xc')](_0xee83('0xd'),_0x5495cb,_0xee83('0xe'));_0x1b9f2c(_0x57af73[_0xee83('0x15')]['message']);}})[_0xee83('0x16')](function(_0x59fa9b){logger[_0xee83('0x13')](_0xee83('0xd'),_0x5495cb,_0x59fa9b);_0x101b16(_0x59fa9b);});});}exports['GetCmHopperBlack']=function(_0x2e2a8f){var _0x4c8255=this;return new Promise(function(_0x308e49,_0x15f933){return db[_0xee83('0x17')]['findAll']({'raw':_0x2e2a8f['options']?_0x2e2a8f[_0xee83('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2e2a8f['options']?_0x2e2a8f[_0xee83('0x18')]['where']||null:null,'attributes':_0x2e2a8f[_0xee83('0x18')]?_0x2e2a8f['options'][_0xee83('0x19')]||null:null,'limit':_0x2e2a8f['options']?_0x2e2a8f[_0xee83('0x18')][_0xee83('0x1a')]||null:null,'include':_0x2e2a8f['options']?_0x2e2a8f[_0xee83('0x18')][_0xee83('0x1b')]?_[_0xee83('0x1c')](_0x2e2a8f[_0xee83('0x18')]['include'],function(_0xb8e899){return{'model':db[_0xb8e899['model']],'as':_0xb8e899['as'],'attributes':_0xb8e899[_0xee83('0x19')],'include':_0xb8e899[_0xee83('0x1b')]?_[_0xee83('0x1c')](_0xb8e899[_0xee83('0x1b')],function(_0x13025f){return{'model':db[_0x13025f[_0xee83('0x1d')]],'as':_0x13025f['as'],'attributes':_0x13025f['attributes'],'include':_0x13025f[_0xee83('0x1b')]?_[_0xee83('0x1c')](_0x13025f[_0xee83('0x1b')],function(_0x1e1f11){return{'model':db[_0x1e1f11[_0xee83('0x1d')]],'as':_0x1e1f11['as'],'attributes':_0x1e1f11[_0xee83('0x19')]};}):[]};}):[]};}):[]:[]})[_0xee83('0xb')](function(_0x466e10){logger['info'](_0xee83('0x1e'),_0x2e2a8f);logger[_0xee83('0xf')](_0xee83('0x1e'),_0x2e2a8f,JSON[_0xee83('0x11')](_0x466e10));_0x308e49(_0x466e10);})['catch'](function(_0xfef605){logger[_0xee83('0x13')](_0xee83('0x1e'),_0xfef605[_0xee83('0x14')],_0x2e2a8f);_0x15f933(_0x4c8255[_0xee83('0x13')](0x1f4,_0xfef605[_0xee83('0x14')]));});});};exports[_0xee83('0x1f')]=function(_0x1b6679){var _0x358485=this;return new Promise(function(_0x19487c,_0x8c5070){return db[_0xee83('0x17')][_0xee83('0x20')](_0x1b6679[_0xee83('0x21')],{'raw':_0x1b6679[_0xee83('0x18')]?_0x1b6679[_0xee83('0x18')][_0xee83('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b6679[_0xee83('0x18')]?_0x1b6679[_0xee83('0x18')][_0xee83('0x23')]||null:null,'attributes':_0x1b6679[_0xee83('0x18')]?_0x1b6679[_0xee83('0x18')]['attributes']||null:null,'limit':_0x1b6679[_0xee83('0x18')]?_0x1b6679[_0xee83('0x18')][_0xee83('0x1a')]||null:null})['then'](function(_0x43d96f){logger['info'](_0xee83('0x1f'),_0x1b6679);logger[_0xee83('0xf')]('UpdateCmHopperBlack',_0x1b6679,JSON[_0xee83('0x11')](_0x43d96f));_0x19487c(_0x43d96f);})['catch'](function(_0x3b3005){logger[_0xee83('0x13')](_0xee83('0x1f'),_0x3b3005['message'],_0x1b6679);_0x8c5070(_0x358485[_0xee83('0x13')](0x1f4,_0x3b3005['message']));});});};exports[_0xee83('0x24')]=function(_0x2dbbbf){var _0x16b6ee=this;return new Promise(function(_0x24db73,_0x157d1c){return db['CmHopperBlack'][_0xee83('0x25')]({'where':_0x2dbbbf['options']?_0x2dbbbf[_0xee83('0x18')][_0xee83('0x23')]||null:null})['then'](function(_0x40082a){logger[_0xee83('0xc')](_0xee83('0x24'),_0x2dbbbf);logger[_0xee83('0xf')]('DestroyCmHopperBlack',_0x2dbbbf,JSON[_0xee83('0x11')](_0x40082a));_0x24db73(_0x40082a);})['catch'](function(_0x25b96b){logger['error'](_0xee83('0x24'),_0x25b96b['message'],_0x2dbbbf);_0x157d1c(_0x16b6ee[_0xee83('0x13')](0x1f4,_0x25b96b[_0xee83('0x14')]));});});}; \ No newline at end of file +var _0xf48a=['client','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','include','map','model','then','UpdateCmHopperBlack','update','body','limit','debug','catch','destroy','DestroyCmHopperBlack','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x59c4e5,_0x59c480){var _0x514dd4=function(_0x59cdf0){while(--_0x59cdf0){_0x59c4e5['push'](_0x59c4e5['shift']());}};_0x514dd4(++_0x59c480);}(_0xf48a,0x101));var _0xaf48=function(_0xa5fdf4,_0x553bc8){_0xa5fdf4=_0xa5fdf4-0x0;var _0x45a73d=_0xf48a[_0xa5fdf4];return _0x45a73d;};'use strict';var _=require(_0xaf48('0x0'));var util=require(_0xaf48('0x1'));var moment=require('moment');var BPromise=require(_0xaf48('0x2'));var rs=require(_0xaf48('0x3'));var fs=require('fs');var Redis=require(_0xaf48('0x4'));var db=require(_0xaf48('0x5'))['db'];var utils=require(_0xaf48('0x6'));var logger=require('../../config/logger')(_0xaf48('0x7'));var config=require('../../config/environment');var jayson=require(_0xaf48('0x8'));var client=jayson[_0xaf48('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30a273,_0xfc15b1,_0x380258){return new BPromise(function(_0xd50895,_0x5bcefa){return client[_0xaf48('0xa')](_0x30a273,_0x380258)['then'](function(_0x3e6eef){logger[_0xaf48('0xb')](_0xaf48('0xc'),_0xfc15b1,_0xaf48('0xd'));logger['debug'](_0xaf48('0xe'),_0xfc15b1,_0xaf48('0xd'),JSON[_0xaf48('0xf')](_0x3e6eef));if(_0x3e6eef[_0xaf48('0x10')]){if(_0x3e6eef['error'][_0xaf48('0x11')]===0x1f4){logger[_0xaf48('0x10')](_0xaf48('0xc'),_0xfc15b1,_0x3e6eef[_0xaf48('0x10')][_0xaf48('0x12')]);return _0x5bcefa(_0x3e6eef[_0xaf48('0x10')][_0xaf48('0x12')]);}logger[_0xaf48('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0xfc15b1,_0x3e6eef['error']['message']);return _0xd50895(_0x3e6eef[_0xaf48('0x10')][_0xaf48('0x12')]);}else{logger[_0xaf48('0xb')](_0xaf48('0xc'),_0xfc15b1,_0xaf48('0xd'));_0xd50895(_0x3e6eef['result'][_0xaf48('0x12')]);}})['catch'](function(_0x4d05af){logger[_0xaf48('0x10')](_0xaf48('0xc'),_0xfc15b1,_0x4d05af);_0x5bcefa(_0x4d05af);});});}exports[_0xaf48('0x13')]=function(_0x45fc57){var _0x2bf82b=this;return new Promise(function(_0x3be4a7,_0x5de880){return db[_0xaf48('0x14')][_0xaf48('0x15')]({'raw':_0x45fc57[_0xaf48('0x16')]?_0x45fc57[_0xaf48('0x16')][_0xaf48('0x17')]===undefined?!![]:![]:!![],'where':_0x45fc57[_0xaf48('0x16')]?_0x45fc57[_0xaf48('0x16')][_0xaf48('0x18')]||null:null,'attributes':_0x45fc57[_0xaf48('0x16')]?_0x45fc57[_0xaf48('0x16')][_0xaf48('0x19')]||null:null,'limit':_0x45fc57[_0xaf48('0x16')]?_0x45fc57[_0xaf48('0x16')]['limit']||null:null,'include':_0x45fc57['options']?_0x45fc57[_0xaf48('0x16')][_0xaf48('0x1a')]?_[_0xaf48('0x1b')](_0x45fc57[_0xaf48('0x16')][_0xaf48('0x1a')],function(_0x2d5a6f){return{'model':db[_0x2d5a6f[_0xaf48('0x1c')]],'as':_0x2d5a6f['as'],'attributes':_0x2d5a6f['attributes'],'include':_0x2d5a6f[_0xaf48('0x1a')]?_[_0xaf48('0x1b')](_0x2d5a6f[_0xaf48('0x1a')],function(_0x2306f4){return{'model':db[_0x2306f4[_0xaf48('0x1c')]],'as':_0x2306f4['as'],'attributes':_0x2306f4[_0xaf48('0x19')],'include':_0x2306f4['include']?_[_0xaf48('0x1b')](_0x2306f4[_0xaf48('0x1a')],function(_0x3737a7){return{'model':db[_0x3737a7[_0xaf48('0x1c')]],'as':_0x3737a7['as'],'attributes':_0x3737a7[_0xaf48('0x19')]};}):[]};}):[]};}):[]:[]})[_0xaf48('0x1d')](function(_0x573230){logger['info']('GetCmHopperBlack',_0x45fc57);logger['debug'](_0xaf48('0x13'),_0x45fc57,JSON[_0xaf48('0xf')](_0x573230));_0x3be4a7(_0x573230);})['catch'](function(_0x11edce){logger[_0xaf48('0x10')](_0xaf48('0x13'),_0x11edce[_0xaf48('0x12')],_0x45fc57);_0x5de880(_0x2bf82b['error'](0x1f4,_0x11edce[_0xaf48('0x12')]));});});};exports[_0xaf48('0x1e')]=function(_0x21a66b){var _0x20f77c=this;return new Promise(function(_0x123efc,_0x2e27ad){return db[_0xaf48('0x14')][_0xaf48('0x1f')](_0x21a66b[_0xaf48('0x20')],{'raw':_0x21a66b['options']?_0x21a66b[_0xaf48('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21a66b[_0xaf48('0x16')]?_0x21a66b['options']['where']||null:null,'attributes':_0x21a66b['options']?_0x21a66b[_0xaf48('0x16')]['attributes']||null:null,'limit':_0x21a66b[_0xaf48('0x16')]?_0x21a66b[_0xaf48('0x16')][_0xaf48('0x21')]||null:null})[_0xaf48('0x1d')](function(_0x7df917){logger[_0xaf48('0xb')](_0xaf48('0x1e'),_0x21a66b);logger[_0xaf48('0x22')]('UpdateCmHopperBlack',_0x21a66b,JSON[_0xaf48('0xf')](_0x7df917));_0x123efc(_0x7df917);})[_0xaf48('0x23')](function(_0x17e5c5){logger['error'](_0xaf48('0x1e'),_0x17e5c5[_0xaf48('0x12')],_0x21a66b);_0x2e27ad(_0x20f77c[_0xaf48('0x10')](0x1f4,_0x17e5c5[_0xaf48('0x12')]));});});};exports['DestroyCmHopperBlack']=function(_0x16a1e0){var _0x189470=this;return new Promise(function(_0x3e6629,_0x370e31){return db[_0xaf48('0x14')][_0xaf48('0x24')]({'where':_0x16a1e0['options']?_0x16a1e0[_0xaf48('0x16')][_0xaf48('0x18')]||null:null})[_0xaf48('0x1d')](function(_0x30a649){logger[_0xaf48('0xb')](_0xaf48('0x25'),_0x16a1e0);logger[_0xaf48('0x22')](_0xaf48('0x25'),_0x16a1e0,JSON[_0xaf48('0xf')](_0x30a649));_0x3e6629(_0x30a649);})[_0xaf48('0x23')](function(_0x23c10c){logger[_0xaf48('0x10')](_0xaf48('0x25'),_0x23c10c[_0xaf48('0x12')],_0x16a1e0);_0x370e31(_0x189470[_0xaf48('0x10')](0x1f4,_0x23c10c[_0xaf48('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index a8f1051..57dfa6b 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 _0x3831=['get','isAuthenticated','describe','/:id','show','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperBlack.controller'];(function(_0xc66375,_0x237157){var _0x323bea=function(_0x4cad36){while(--_0x4cad36){_0xc66375['push'](_0xc66375['shift']());}};_0x323bea(++_0x237157);}(_0x3831,0x14c));var _0x1383=function(_0x41cb50,_0x6015fb){_0x41cb50=_0x41cb50-0x0;var _0x445c4e=_0x3831[_0x41cb50];return _0x445c4e;};'use strict';var multer=require(_0x1383('0x0'));var util=require('util');var path=require(_0x1383('0x1'));var timeout=require(_0x1383('0x2'));var express=require(_0x1383('0x3'));var router=express[_0x1383('0x4')]();var fs_extra=require(_0x1383('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1383('0x6'));var config=require('../../config/environment');var controller=require(_0x1383('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1383('0x8')]('/describe',auth[_0x1383('0x9')](),controller[_0x1383('0xa')]);router[_0x1383('0x8')](_0x1383('0xb'),auth[_0x1383('0x9')](),controller[_0x1383('0xc')]);router[_0x1383('0xd')](_0x1383('0xb'),auth['isAuthenticated'](),controller[_0x1383('0xe')]);router[_0x1383('0xf')](_0x1383('0xb'),auth[_0x1383('0x9')](),controller[_0x1383('0x10')]);module['exports']=router; \ No newline at end of file +var _0xd8fb=['/describe','describe','show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','index'];(function(_0x536990,_0xe35c9){var _0x3c5850=function(_0x3309ef){while(--_0x3309ef){_0x536990['push'](_0x536990['shift']());}};_0x3c5850(++_0xe35c9);}(_0xd8fb,0x99));var _0xbd8f=function(_0x37f8c8,_0x1381e4){_0x37f8c8=_0x37f8c8-0x0;var _0x36b004=_0xd8fb[_0x37f8c8];return _0x36b004;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0x8')]);router['get'](_0xbd8f('0x9'),auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xb')]);router[_0xbd8f('0xc')](_0xbd8f('0xd'),auth['isAuthenticated'](),controller[_0xbd8f('0xe')]);router[_0xbd8f('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0x10')]);module[_0xbd8f('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 2b0f3ea..a9a49f2 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 _0xefb2=['sequelize','moment','INTEGER','DATE','STRING','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN'];(function(_0x277320,_0x4a8e6b){var _0x4869c4=function(_0x285727){while(--_0x285727){_0x277320['push'](_0x277320['shift']());}};_0x4869c4(++_0x4a8e6b);}(_0xefb2,0x8f));var _0x2efb=function(_0x206510,_0x170973){_0x206510=_0x206510-0x0;var _0x87aba=_0xefb2[_0x206510];return _0x87aba;};'use strict';var Sequelize=require(_0x2efb('0x0'));var moment=require(_0x2efb('0x1'));module['exports']={'state':{'type':Sequelize[_0x2efb('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x2efb('0x3')]},'countbusyretry':{'type':Sequelize[_0x2efb('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2efb('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2efb('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2efb('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x2efb('0x4')]},'calleridname':{'type':Sequelize[_0x2efb('0x4')]},'starttime':{'type':Sequelize[_0x2efb('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x2efb('0x3')]},'endtime':{'type':Sequelize[_0x2efb('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2efb('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2efb('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2efb('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2efb('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x2efb('0x4')]},'membername':{'type':Sequelize[_0x2efb('0x4')]},'reason':{'type':Sequelize[_0x2efb('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2efb('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2efb('0x4')]},'dispositionat':{'type':Sequelize[_0x2efb('0x3')],'set':function(_0x203923){var _0x1691ff=this['getDataValue'](_0x2efb('0x5'));if(_0x1691ff&&_0x203923){this[_0x2efb('0x6')](_0x2efb('0x7'),moment(_0x203923)[_0x2efb('0x8')](moment(_0x1691ff),_0x2efb('0x9')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x2efb('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x2efb('0x3')]},'callback':{'type':Sequelize[_0x2efb('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2efb('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2efb('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2efb('0x3')]},'recallme':{'type':Sequelize[_0x2efb('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x2efb('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x2efb('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2efb('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2efb('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2efb('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2efb('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9b39=['BOOLEAN','exports','INTEGER','STRING','DATE','getDataValue','endtime','followuptime','diff','seconds'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x9b39,0xb5));var _0x99b3=function(_0x3b899f,_0x2e8183){_0x3b899f=_0x3b899f-0x0;var _0x497ce2=_0x9b39[_0x3b899f];return _0x497ce2;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x99b3('0x0')]={'state':{'type':Sequelize[_0x99b3('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x99b3('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x99b3('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x99b3('0x2')]},'calleridnum':{'type':Sequelize[_0x99b3('0x2')]},'calleridname':{'type':Sequelize[_0x99b3('0x2')]},'starttime':{'type':Sequelize[_0x99b3('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x99b3('0x3')]},'droptime':{'type':Sequelize[_0x99b3('0x3')]},'endtime':{'type':Sequelize[_0x99b3('0x3')]},'ringtime':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x99b3('0x2')]},'campaign':{'type':Sequelize[_0x99b3('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x99b3('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x99b3('0x2')]},'thirdDisposition':{'type':Sequelize[_0x99b3('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x3d8a04){var _0xa69145=this[_0x99b3('0x4')](_0x99b3('0x5'));if(_0xa69145&&_0x3d8a04){this['setDataValue'](_0x99b3('0x6'),moment(_0x3d8a04)[_0x99b3('0x7')](moment(_0xa69145),_0x99b3('0x8')));}}},'amd':{'type':Sequelize[_0x99b3('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x99b3('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x99b3('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x99b3('0x3')]},'callback':{'type':Sequelize[_0x99b3('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x99b3('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x99b3('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x99b3('0x3')]},'recallme':{'type':Sequelize[_0x99b3('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x99b3('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x99b3('0x1')],'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 1063556..72f69c2 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 _0x5d58=['calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','CmHopperFinal','include','findAll','rows','show','params','rawAttributes','keys','length','includeAll','merge','describe','catch','body','find','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)'];(function(_0x22656e,_0x1163dc){var _0x3e4255=function(_0x200a38){while(--_0x200a38){_0x22656e['push'](_0x22656e['shift']());}};_0x3e4255(++_0x1163dc);}(_0x5d58,0x187));var _0x85d5=function(_0x1c9d57,_0x5f13c3){_0x1c9d57=_0x1c9d57-0x0;var _0x359197=_0x5d58[_0x1c9d57];return _0x359197;};'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(_0x85d5('0x0'));var BPromise=require(_0x85d5('0x1'));var Mustache=require('mustache');var util=require(_0x85d5('0x2'));var path=require(_0x85d5('0x3'));var sox=require('sox');var csv=require(_0x85d5('0x4'));var ejs=require(_0x85d5('0x5'));var fs=require('fs');var fs_extra=require(_0x85d5('0x6'));var _=require(_0x85d5('0x7'));var squel=require('squel');var crypto=require(_0x85d5('0x8'));var jsforce=require(_0x85d5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x85d5('0x4'));var querystring=require('querystring');var Papa=require(_0x85d5('0xa'));var Redis=require(_0x85d5('0xb'));var authService=require(_0x85d5('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85d5('0xd'))(_0x85d5('0xe'));var utils=require(_0x85d5('0xf'));var config=require(_0x85d5('0x10'));var licenseUtil=require(_0x85d5('0x11'));var db=require(_0x85d5('0x12'))['db'];function respondWithStatusCode(_0x31409d,_0x5897af){_0x5897af=_0x5897af||0xcc;return function(_0x4bbf2a){if(_0x4bbf2a){return _0x31409d['sendStatus'](_0x5897af);}return _0x31409d[_0x85d5('0x13')](_0x5897af)[_0x85d5('0x14')]();};}function respondWithResult(_0x339d4f,_0x1704f0){_0x1704f0=_0x1704f0||0xc8;return function(_0x18a20c){if(_0x18a20c){return _0x339d4f[_0x85d5('0x13')](_0x1704f0)[_0x85d5('0x15')](_0x18a20c);}};}function respondWithFilteredResult(_0x586382,_0x18e977){return function(_0x2d7c95){if(_0x2d7c95){var _0x1621ed=typeof _0x18e977[_0x85d5('0x16')]===_0x85d5('0x17')&&typeof _0x18e977[_0x85d5('0x18')]===_0x85d5('0x17');var _0x12bef9=_0x2d7c95[_0x85d5('0x19')];var _0x17acb0=_0x1621ed?0x0:_0x18e977[_0x85d5('0x16')];var _0x432bd6=_0x1621ed?_0x2d7c95[_0x85d5('0x19')]:_0x18e977[_0x85d5('0x16')]+_0x18e977[_0x85d5('0x18')];var _0x26981b;if(_0x432bd6>=_0x12bef9){_0x432bd6=_0x12bef9;_0x26981b=0xc8;}else{_0x26981b=0xce;}_0x586382[_0x85d5('0x13')](_0x26981b);return _0x586382[_0x85d5('0x1a')]('Content-Range',_0x17acb0+'-'+_0x432bd6+'/'+_0x12bef9)[_0x85d5('0x15')](_0x2d7c95);}return null;};}function patchUpdates(_0x133fa9){return function(_0x5f5755){try{jsonpatch[_0x85d5('0x1b')](_0x5f5755,_0x133fa9,!![]);}catch(_0x1264ca){return BPromise['reject'](_0x1264ca);}return _0x5f5755['save']();};}function saveUpdates(_0x347337,_0x5a1b9a){return function(_0x2f2bae){if(_0x2f2bae){return _0x2f2bae['update'](_0x347337)[_0x85d5('0x1c')](function(_0x1f8d27){return _0x1f8d27;});}return null;};}function removeEntity(_0x560b3a,_0x4e11c4){return function(_0x4da71b){if(_0x4da71b){return _0x4da71b['destroy']()[_0x85d5('0x1c')](function(){_0x560b3a[_0x85d5('0x13')](0xcc)[_0x85d5('0x14')]();});}};}function handleEntityNotFound(_0x466bbd,_0x12fea3){return function(_0xef2405){if(!_0xef2405){_0x466bbd['sendStatus'](0x194);}return _0xef2405;};}function handleError(_0x7e9a11,_0x4f8c66){_0x4f8c66=_0x4f8c66||0x1f4;return function(_0x1b3fae){logger[_0x85d5('0x1d')](_0x1b3fae[_0x85d5('0x1e')]);if(_0x1b3fae['name']){delete _0x1b3fae[_0x85d5('0x1f')];}_0x7e9a11[_0x85d5('0x13')](_0x4f8c66)[_0x85d5('0x20')](_0x1b3fae);};}exports[_0x85d5('0x21')]=function(_0x4605c5,_0x56031f){var _0x1cbef1={},_0x476c8b={},_0x330f8a={'count':0x0,'rows':[]};var _0x22a961=_[_0x85d5('0x22')](db['CmHopperFinal']['rawAttributes'],function(_0x2ce7a9){return{'name':_0x2ce7a9[_0x85d5('0x23')],'type':_0x2ce7a9[_0x85d5('0x24')][_0x85d5('0x25')]};});_0x476c8b[_0x85d5('0x26')]=_['map'](_0x22a961,_0x85d5('0x1f'));_0x476c8b[_0x85d5('0x27')]=_['keys'](_0x4605c5['query']);_0x476c8b[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x476c8b['model'],_0x476c8b[_0x85d5('0x27')]);_0x1cbef1['attributes']=_[_0x85d5('0x29')](_0x476c8b[_0x85d5('0x26')],qs['fields'](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x1cbef1[_0x85d5('0x2b')]=_0x1cbef1[_0x85d5('0x2b')]['length']?_0x1cbef1['attributes']:_0x476c8b[_0x85d5('0x26')];if(!_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2c')](_0x85d5('0x2d'))){_0x1cbef1[_0x85d5('0x18')]=qs[_0x85d5('0x18')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x18')]);_0x1cbef1[_0x85d5('0x16')]=qs['offset'](_0x4605c5['query'][_0x85d5('0x16')]);}_0x1cbef1[_0x85d5('0x2e')]=qs[_0x85d5('0x2f')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2f')]);_0x1cbef1[_0x85d5('0x30')]=qs[_0x85d5('0x28')](_[_0x85d5('0x31')](_0x4605c5['query'],_0x476c8b[_0x85d5('0x28')]),_0x22a961);if(_0x4605c5[_0x85d5('0x27')][_0x85d5('0x32')]){_0x1cbef1[_0x85d5('0x30')]=_['merge'](_0x1cbef1[_0x85d5('0x30')],{'$or':_[_0x85d5('0x22')](_0x22a961,function(_0x3282d3){if(_0x3282d3[_0x85d5('0x24')]!=='VIRTUAL'){var _0x34caed={};_0x34caed[_0x3282d3['name']]={'$like':'%'+_0x4605c5['query'][_0x85d5('0x32')]+'%'};return _0x34caed;}})});}_0x1cbef1=_['merge']({},_0x1cbef1,_0x4605c5[_0x85d5('0x33')]);var _0x5ddba7={'where':_0x1cbef1['where']};return db[_0x85d5('0x34')][_0x85d5('0x19')](_0x5ddba7)[_0x85d5('0x1c')](function(_0x1beffc){_0x330f8a[_0x85d5('0x19')]=_0x1beffc;if(_0x4605c5['query']['includeAll']){_0x1cbef1[_0x85d5('0x35')]=[{'all':!![]}];}return db[_0x85d5('0x34')][_0x85d5('0x36')](_0x1cbef1);})[_0x85d5('0x1c')](function(_0xdd8b3e){_0x330f8a[_0x85d5('0x37')]=_0xdd8b3e;return _0x330f8a;})['then'](respondWithFilteredResult(_0x56031f,_0x1cbef1))['catch'](handleError(_0x56031f,null));};exports[_0x85d5('0x38')]=function(_0x52c99b,_0xfbf466){var _0x18e94d={'raw':!![],'where':{'id':_0x52c99b[_0x85d5('0x39')]['id']}},_0x7dd430={};_0x7dd430[_0x85d5('0x26')]=_['keys'](db['CmHopperFinal'][_0x85d5('0x3a')]);_0x7dd430[_0x85d5('0x27')]=_[_0x85d5('0x3b')](_0x52c99b[_0x85d5('0x27')]);_0x7dd430[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],_0x7dd430[_0x85d5('0x27')]);_0x18e94d[_0x85d5('0x2b')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],qs[_0x85d5('0x2a')](_0x52c99b[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x18e94d[_0x85d5('0x2b')]=_0x18e94d[_0x85d5('0x2b')][_0x85d5('0x3c')]?_0x18e94d['attributes']:_0x7dd430['model'];if(_0x52c99b[_0x85d5('0x27')][_0x85d5('0x3d')]){_0x18e94d[_0x85d5('0x35')]=[{'all':!![]}];}_0x18e94d=_[_0x85d5('0x3e')]({},_0x18e94d,_0x52c99b[_0x85d5('0x33')]);return db[_0x85d5('0x34')]['find'](_0x18e94d)[_0x85d5('0x1c')](handleEntityNotFound(_0xfbf466,null))['then'](respondWithResult(_0xfbf466,null))['catch'](handleError(_0xfbf466,null));};exports[_0x85d5('0x3f')]=function(_0x13ab32,_0x12a03){return db[_0x85d5('0x34')][_0x85d5('0x3f')]()['then'](respondWithResult(_0x12a03,null))[_0x85d5('0x40')](handleError(_0x12a03,null));};exports['update']=function(_0x1f2ef9,_0xd8db57){if(_0x1f2ef9[_0x85d5('0x41')]['uniqueid']){delete _0x1f2ef9['body']['uniqueid'];}return db[_0x85d5('0x34')][_0x85d5('0x42')]({'where':{'uniqueid':_0x1f2ef9[_0x85d5('0x39')]['id']}})['then'](handleEntityNotFound(_0xd8db57,null))['then'](saveUpdates(_0x1f2ef9[_0x85d5('0x41')],null))[_0x85d5('0x1c')](respondWithResult(_0xd8db57,null))[_0x85d5('0x40')](handleError(_0xd8db57,null));};exports[_0x85d5('0x43')]=function(_0x4b2dce,_0x3f69ea,_0x29442a){return db[_0x85d5('0x34')][_0x85d5('0x36')]({'raw':![],'where':{'VoiceQueueId':_0x4b2dce[_0x85d5('0x39')]['id']},'attributes':[[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x47')))),_0x85d5('0x48')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x49')))),_0x85d5('0x4a')],[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x4b')))),_0x85d5('0x4c')],[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x85d5('0x4d')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x85d5('0x4e')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x4f')))),_0x85d5('0x50')],[db['sequelize']['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')]('`state`\x20=\x2022,\x201,\x20null'))),_0x85d5('0x51')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x52')))),_0x85d5('0x53')]]})['then'](handleEntityNotFound(_0x3f69ea,null))[_0x85d5('0x1c')](respondWithResult(_0x3f69ea,null))[_0x85d5('0x40')](handleError(_0x3f69ea,null));};exports[_0x85d5('0x54')]=function(_0x561bde,_0x34aa42,_0x1c3e2c){return db['CmHopperFinal'][_0x85d5('0x36')]({'raw':![],'where':{'CampaignId':_0x561bde['params']['id']},'attributes':[[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x47')))),'noSuchContacts'],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x49')))),_0x85d5('0x4a')],[db[_0x85d5('0x44')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x85d5('0x44')]['literal'](_0x85d5('0x4b')))),_0x85d5('0x4c')],[db['sequelize']['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')]('`state`\x20=\x208,\x201,\x20null'))),_0x85d5('0x4d')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize']['literal'](_0x85d5('0x55')))),'dropContacts'],[db['sequelize']['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x85d5('0x50')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db['sequelize']['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x56')))),_0x85d5('0x51')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x85d5('0x53')]]})[_0x85d5('0x1c')](handleEntityNotFound(_0x34aa42,null))[_0x85d5('0x1c')](respondWithResult(_0x34aa42,null))['catch'](handleError(_0x34aa42,null));};exports[_0x85d5('0x57')]=function(_0x1fdefb,_0x496586,_0x2dbd18){return db[_0x85d5('0x58')][_0x85d5('0x42')]({'where':{'id':_0x1fdefb[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x496586,null))['then'](function(_0x35ba15){var _0x1b96eb;if(_0x35ba15){_0x1b96eb=squel[_0x85d5('0x59')]()[_0x85d5('0x5a')](_0x85d5('0x5b'))['fromQuery']([_0x85d5('0x5c'),_0x85d5('0x5d'),_0x85d5('0x5e'),_0x85d5('0x5f'),_0x85d5('0x60'),_0x85d5('0x61'),_0x85d5('0x62')],squel[_0x85d5('0x63')]()[_0x85d5('0x64')](_0x85d5('0x65'),'phone')[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x5d'))[_0x85d5('0x64')](_0x85d5('0x67'),_0x85d5('0x5e'))['field'](_0x85d5('0x68'),'ListId')['field'](_0x85d5('0x69'),_0x85d5('0x60'))[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x61'))[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x62'))[_0x85d5('0x6a')]('cm_hopper_final')[_0x85d5('0x30')](_0x85d5('0x6b'),_0x1fdefb[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6d'),_0x1fdefb[_0x85d5('0x41')][_0x85d5('0x6e')][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6f'))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')]('phone')['from'](_0x85d5('0x5b'))['where'](_0x85d5('0x6b'),_0x1fdefb[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]()))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')](_0x85d5('0x71'))[_0x85d5('0x6a')]('cm_hopper_final')[_0x85d5('0x30')](_0x85d5('0x6b'),_0x1fdefb['params']['id'][_0x85d5('0x6c')]())['where'](_0x85d5('0x72')))[_0x85d5('0x73')](_0x85d5('0x5e')))[_0x85d5('0x6c')]();return db['sequelize'][_0x85d5('0x27')](_0x1b96eb);}return[];})[_0x85d5('0x1c')](respondWithResult(_0x496586,null))['catch'](handleError(_0x496586,null));};exports[_0x85d5('0x74')]=function(_0x14e4e8,_0x57f26b,_0x45b1e2){return db[_0x85d5('0x75')][_0x85d5('0x42')]({'where':{'id':_0x14e4e8['params']['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x57f26b,null))[_0x85d5('0x1c')](function(_0x2dacf7){var _0x387a3b;if(_0x2dacf7){_0x387a3b=squel[_0x85d5('0x59')]()[_0x85d5('0x5a')]('cm_hopper')[_0x85d5('0x76')]([_0x85d5('0x5c'),'scheduledAt',_0x85d5('0x5e'),'ListId',_0x85d5('0x77'),_0x85d5('0x61'),_0x85d5('0x62')],squel['select']()[_0x85d5('0x64')](_0x85d5('0x65'),_0x85d5('0x5c'))[_0x85d5('0x64')](_0x85d5('0x66'),'scheduledAt')[_0x85d5('0x64')](_0x85d5('0x67'),_0x85d5('0x5e'))[_0x85d5('0x64')]('ANY_VALUE(ListId)',_0x85d5('0x5f'))[_0x85d5('0x64')](_0x85d5('0x78'),'CampaignId')[_0x85d5('0x64')]('NOW()',_0x85d5('0x61'))[_0x85d5('0x64')]('NOW()','updatedAt')[_0x85d5('0x6a')](_0x85d5('0x79'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6d'),_0x14e4e8['body'][_0x85d5('0x6e')][_0x85d5('0x6c')]())[_0x85d5('0x30')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x85d5('0x30')](_0x85d5('0x70'),squel['select']()[_0x85d5('0x64')](_0x85d5('0x5c'))[_0x85d5('0x6a')](_0x85d5('0x5b'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id']['toString']()))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')]('calleridnum')[_0x85d5('0x6a')](_0x85d5('0x79'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id']['toString']())['where'](_0x85d5('0x72')))['group'](_0x85d5('0x5e')))[_0x85d5('0x6c')]();return db[_0x85d5('0x44')][_0x85d5('0x27')](_0x387a3b);}return[];})[_0x85d5('0x1c')](respondWithResult(_0x57f26b,null))[_0x85d5('0x40')](handleError(_0x57f26b,null));};exports[_0x85d5('0x7b')]=function(_0x48553d,_0xedb32d,_0x5366bc){return db[_0x85d5('0x7c')][_0x85d5('0x7d')]({'where':{'VoiceQueueId':_0x48553d[_0x85d5('0x41')]['VoiceQueueId'],'CampaignId':_0x48553d[_0x85d5('0x41')][_0x85d5('0x77')],'ContactId':_0x48553d[_0x85d5('0x41')]['ContactId']}})['then'](handleEntityNotFound(_0xedb32d,null))[_0x85d5('0x1c')](function(_0x428fd4){if(_0x428fd4){return _0x428fd4;}return null;})['then'](respondWithResult(_0xedb32d,null))[_0x85d5('0x40')](handleError(_0xedb32d,null));}; \ No newline at end of file +var _0x1623=['reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','phone','scheduledAt','ListId','createdAt','select','ANY_VALUE(calleridnum)','field','NOW()','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','from','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','updatedAt','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','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','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','CmHopperFinal','findAll','rows','catch','show','params','length','find','describe','body','uniqueid','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts'];(function(_0x15ea14,_0x7dbd96){var _0x9875ac=function(_0x5baff0){while(--_0x5baff0){_0x15ea14['push'](_0x15ea14['shift']());}};_0x9875ac(++_0x7dbd96);}(_0x1623,0xab));var _0x3162=function(_0x36485d,_0x29c862){_0x36485d=_0x36485d-0x0;var _0x5a309c=_0x1623[_0x36485d];return _0x5a309c;};'use strict';var emlformat=require(_0x3162('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3162('0x1'));var rp=require(_0x3162('0x2'));var moment=require(_0x3162('0x3'));var BPromise=require(_0x3162('0x4'));var Mustache=require(_0x3162('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3162('0x6'));var csv=require('to-csv');var ejs=require(_0x3162('0x7'));var fs=require('fs');var fs_extra=require(_0x3162('0x8'));var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0xd'));var querystring=require(_0x3162('0xe'));var Papa=require(_0x3162('0xf'));var Redis=require(_0x3162('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x11'));var hardwareService=require(_0x3162('0x12'));var logger=require(_0x3162('0x13'))(_0x3162('0x14'));var utils=require(_0x3162('0x15'));var config=require(_0x3162('0x16'));var licenseUtil=require(_0x3162('0x17'));var db=require(_0x3162('0x18'))['db'];function respondWithStatusCode(_0x157ab8,_0x4c3625){_0x4c3625=_0x4c3625||0xcc;return function(_0x2d11c5){if(_0x2d11c5){return _0x157ab8['sendStatus'](_0x4c3625);}return _0x157ab8[_0x3162('0x19')](_0x4c3625)[_0x3162('0x1a')]();};}function respondWithResult(_0x49d1ad,_0x4a393a){_0x4a393a=_0x4a393a||0xc8;return function(_0x198764){if(_0x198764){return _0x49d1ad[_0x3162('0x19')](_0x4a393a)[_0x3162('0x1b')](_0x198764);}};}function respondWithFilteredResult(_0x4b8a3b,_0x15e348){return function(_0x3d0bea){if(_0x3d0bea){var _0x2705d1=typeof _0x15e348['offset']===_0x3162('0x1c')&&typeof _0x15e348[_0x3162('0x1d')]===_0x3162('0x1c');var _0xc3ee06=_0x3d0bea[_0x3162('0x1e')];var _0x1eed46=_0x2705d1?0x0:_0x15e348[_0x3162('0x1f')];var _0x4b2bf3=_0x2705d1?_0x3d0bea[_0x3162('0x1e')]:_0x15e348[_0x3162('0x1f')]+_0x15e348[_0x3162('0x1d')];var _0x36ca97;if(_0x4b2bf3>=_0xc3ee06){_0x4b2bf3=_0xc3ee06;_0x36ca97=0xc8;}else{_0x36ca97=0xce;}_0x4b8a3b['status'](_0x36ca97);return _0x4b8a3b[_0x3162('0x20')]('Content-Range',_0x1eed46+'-'+_0x4b2bf3+'/'+_0xc3ee06)['json'](_0x3d0bea);}return null;};}function patchUpdates(_0xa5c62b){return function(_0x3e4d23){try{jsonpatch[_0x3162('0x21')](_0x3e4d23,_0xa5c62b,!![]);}catch(_0x523fab){return BPromise['reject'](_0x523fab);}return _0x3e4d23[_0x3162('0x22')]();};}function saveUpdates(_0x396372,_0x32c051){return function(_0x26c90d){if(_0x26c90d){return _0x26c90d[_0x3162('0x23')](_0x396372)[_0x3162('0x24')](function(_0x52ae25){return _0x52ae25;});}return null;};}function removeEntity(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(_0xd283d6){return _0xd283d6[_0x3162('0x25')]()[_0x3162('0x24')](function(){_0x1b2713[_0x3162('0x19')](0xcc)[_0x3162('0x1a')]();});}};}function handleEntityNotFound(_0x3c543e,_0x30552f){return function(_0x5f8f7){if(!_0x5f8f7){_0x3c543e[_0x3162('0x26')](0x194);}return _0x5f8f7;};}function handleError(_0x356c5d,_0x8fa09f){_0x8fa09f=_0x8fa09f||0x1f4;return function(_0x2f62d7){logger[_0x3162('0x27')](_0x2f62d7['stack']);if(_0x2f62d7[_0x3162('0x28')]){delete _0x2f62d7['name'];}_0x356c5d[_0x3162('0x19')](_0x8fa09f)[_0x3162('0x29')](_0x2f62d7);};}exports[_0x3162('0x2a')]=function(_0x57f567,_0x4903e7){var _0xda0389={},_0xaa1f35={},_0x14df16={'count':0x0,'rows':[]};var _0x399148=_[_0x3162('0x2b')](db['CmHopperFinal'][_0x3162('0x2c')],function(_0x4e3cc2){return{'name':_0x4e3cc2[_0x3162('0x2d')],'type':_0x4e3cc2[_0x3162('0x2e')][_0x3162('0x2f')]};});_0xaa1f35[_0x3162('0x30')]=_[_0x3162('0x2b')](_0x399148,_0x3162('0x28'));_0xaa1f35[_0x3162('0x31')]=_[_0x3162('0x32')](_0x57f567['query']);_0xaa1f35[_0x3162('0x33')]=_[_0x3162('0x34')](_0xaa1f35['model'],_0xaa1f35[_0x3162('0x31')]);_0xda0389[_0x3162('0x35')]=_['intersection'](_0xaa1f35['model'],qs[_0x3162('0x36')](_0x57f567['query'][_0x3162('0x36')]));_0xda0389[_0x3162('0x35')]=_0xda0389[_0x3162('0x35')]['length']?_0xda0389['attributes']:_0xaa1f35[_0x3162('0x30')];if(!_0x57f567[_0x3162('0x31')]['hasOwnProperty'](_0x3162('0x37'))){_0xda0389['limit']=qs[_0x3162('0x1d')](_0x57f567[_0x3162('0x31')][_0x3162('0x1d')]);_0xda0389[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x57f567[_0x3162('0x31')][_0x3162('0x1f')]);}_0xda0389[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x57f567[_0x3162('0x31')][_0x3162('0x39')]);_0xda0389['where']=qs[_0x3162('0x33')](_[_0x3162('0x3a')](_0x57f567[_0x3162('0x31')],_0xaa1f35['filters']),_0x399148);if(_0x57f567['query'][_0x3162('0x3b')]){_0xda0389[_0x3162('0x3c')]=_[_0x3162('0x3d')](_0xda0389[_0x3162('0x3c')],{'$or':_['map'](_0x399148,function(_0x4186b6){if(_0x4186b6['type']!=='VIRTUAL'){var _0x5dee49={};_0x5dee49[_0x4186b6[_0x3162('0x28')]]={'$like':'%'+_0x57f567[_0x3162('0x31')][_0x3162('0x3b')]+'%'};return _0x5dee49;}})});}_0xda0389=_['merge']({},_0xda0389,_0x57f567[_0x3162('0x3e')]);var _0x2ce9c6={'where':_0xda0389[_0x3162('0x3c')]};return db[_0x3162('0x3f')][_0x3162('0x1e')](_0x2ce9c6)['then'](function(_0x5447d6){_0x14df16[_0x3162('0x1e')]=_0x5447d6;if(_0x57f567[_0x3162('0x31')]['includeAll']){_0xda0389['include']=[{'all':!![]}];}return db[_0x3162('0x3f')][_0x3162('0x40')](_0xda0389);})[_0x3162('0x24')](function(_0x4883ac){_0x14df16[_0x3162('0x41')]=_0x4883ac;return _0x14df16;})[_0x3162('0x24')](respondWithFilteredResult(_0x4903e7,_0xda0389))[_0x3162('0x42')](handleError(_0x4903e7,null));};exports[_0x3162('0x43')]=function(_0x534708,_0x2617d3){var _0x282e3e={'raw':!![],'where':{'id':_0x534708[_0x3162('0x44')]['id']}},_0x522cce={};_0x522cce[_0x3162('0x30')]=_['keys'](db[_0x3162('0x3f')][_0x3162('0x2c')]);_0x522cce['query']=_[_0x3162('0x32')](_0x534708['query']);_0x522cce[_0x3162('0x33')]=_[_0x3162('0x34')](_0x522cce[_0x3162('0x30')],_0x522cce[_0x3162('0x31')]);_0x282e3e[_0x3162('0x35')]=_[_0x3162('0x34')](_0x522cce['model'],qs[_0x3162('0x36')](_0x534708[_0x3162('0x31')][_0x3162('0x36')]));_0x282e3e['attributes']=_0x282e3e[_0x3162('0x35')][_0x3162('0x45')]?_0x282e3e['attributes']:_0x522cce[_0x3162('0x30')];if(_0x534708['query']['includeAll']){_0x282e3e['include']=[{'all':!![]}];}_0x282e3e=_[_0x3162('0x3d')]({},_0x282e3e,_0x534708[_0x3162('0x3e')]);return db[_0x3162('0x3f')][_0x3162('0x46')](_0x282e3e)[_0x3162('0x24')](handleEntityNotFound(_0x2617d3,null))[_0x3162('0x24')](respondWithResult(_0x2617d3,null))[_0x3162('0x42')](handleError(_0x2617d3,null));};exports[_0x3162('0x47')]=function(_0x3d2958,_0x28865c){return db[_0x3162('0x3f')][_0x3162('0x47')]()[_0x3162('0x24')](respondWithResult(_0x28865c,null))['catch'](handleError(_0x28865c,null));};exports[_0x3162('0x23')]=function(_0x48cb8f,_0x4f1dde){if(_0x48cb8f[_0x3162('0x48')][_0x3162('0x49')]){delete _0x48cb8f[_0x3162('0x48')][_0x3162('0x49')];}return db['CmHopperFinal'][_0x3162('0x46')]({'where':{'uniqueid':_0x48cb8f['params']['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x4f1dde,null))[_0x3162('0x24')](saveUpdates(_0x48cb8f['body'],null))[_0x3162('0x24')](respondWithResult(_0x4f1dde,null))['catch'](handleError(_0x4f1dde,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x13e7c4,_0x22c0a2,_0x160364){return db[_0x3162('0x3f')][_0x3162('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x13e7c4[_0x3162('0x44')]['id']},'attributes':[[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x3162('0x4c')))),_0x3162('0x4d')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0x3162('0x4f')],[db['sequelize']['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x50')))),_0x3162('0x51')],[db['sequelize']['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x52')))),_0x3162('0x53')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db['sequelize'][_0x3162('0x4e')](_0x3162('0x54')))),'dropContacts'],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x55')))),_0x3162('0x56')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x3162('0x57')],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x58')))),_0x3162('0x59')]]})[_0x3162('0x24')](handleEntityNotFound(_0x22c0a2,null))[_0x3162('0x24')](respondWithResult(_0x22c0a2,null))[_0x3162('0x42')](handleError(_0x22c0a2,null));};exports[_0x3162('0x5a')]=function(_0x4b5729,_0x4a42ea,_0x520b1a){return db[_0x3162('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x4b5729[_0x3162('0x44')]['id']},'attributes':[[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x3162('0x4d')],[db[_0x3162('0x4a')]['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x5b')))),_0x3162('0x4f')],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x50')))),'busyContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x52')))),_0x3162('0x53')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x54')))),_0x3162('0x5c')],[db[_0x3162('0x4a')]['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x55')))),'abandonedContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x5d')))),'reCallContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x58')))),'answeringMachine']]})[_0x3162('0x24')](handleEntityNotFound(_0x4a42ea,null))[_0x3162('0x24')](respondWithResult(_0x4a42ea,null))[_0x3162('0x42')](handleError(_0x4a42ea,null));};exports[_0x3162('0x5e')]=function(_0x8a75ca,_0x33c39d,_0xb3d824){return db['VoiceQueue']['find']({'where':{'id':_0x8a75ca['params']['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x33c39d,null))[_0x3162('0x24')](function(_0x59b3f7){var _0x129005;if(_0x59b3f7){_0x129005=squel[_0x3162('0x5f')]()[_0x3162('0x60')](_0x3162('0x61'))['fromQuery']([_0x3162('0x62'),_0x3162('0x63'),'ContactId',_0x3162('0x64'),'VoiceQueueId',_0x3162('0x65'),'updatedAt'],squel[_0x3162('0x66')]()['field'](_0x3162('0x67'),_0x3162('0x62'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x63'))[_0x3162('0x68')]('ANY_VALUE(ContactId)',_0x3162('0x6a'))[_0x3162('0x68')](_0x3162('0x6b'),'ListId')[_0x3162('0x68')](_0x3162('0x6c'),_0x3162('0x6d'))[_0x3162('0x68')](_0x3162('0x69'),'createdAt')[_0x3162('0x68')](_0x3162('0x69'),'updatedAt')['from'](_0x3162('0x6e'))[_0x3162('0x3c')]('VoiceQueueId\x20=\x20?',_0x8a75ca[_0x3162('0x44')]['id'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x70'),_0x8a75ca[_0x3162('0x48')][_0x3162('0x71')][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x72'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x3162('0x66')]()[_0x3162('0x68')]('phone')[_0x3162('0x73')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x8a75ca[_0x3162('0x44')]['id']['toString']()))[_0x3162('0x3c')](_0x3162('0x74'),squel[_0x3162('0x66')]()[_0x3162('0x68')](_0x3162('0x75'))[_0x3162('0x73')](_0x3162('0x6e'))[_0x3162('0x3c')](_0x3162('0x76'),_0x8a75ca[_0x3162('0x44')]['id'][_0x3162('0x6f')]())['where'](_0x3162('0x77')))[_0x3162('0x78')](_0x3162('0x6a')))[_0x3162('0x6f')]();return db[_0x3162('0x4a')][_0x3162('0x31')](_0x129005);}return[];})[_0x3162('0x24')](respondWithResult(_0x33c39d,null))[_0x3162('0x42')](handleError(_0x33c39d,null));};exports[_0x3162('0x79')]=function(_0x3f37fa,_0x1d242f,_0x190f91){return db['Campaign'][_0x3162('0x46')]({'where':{'id':_0x3f37fa[_0x3162('0x44')]['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x1d242f,null))['then'](function(_0x3d7bd1){var _0x5cdbb0;if(_0x3d7bd1){_0x5cdbb0=squel[_0x3162('0x5f')]()[_0x3162('0x60')]('cm_hopper')['fromQuery']([_0x3162('0x62'),_0x3162('0x63'),'ContactId',_0x3162('0x64'),'CampaignId',_0x3162('0x65'),_0x3162('0x7a')],squel[_0x3162('0x66')]()[_0x3162('0x68')](_0x3162('0x67'),_0x3162('0x62'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x63'))['field'](_0x3162('0x7b'),'ContactId')[_0x3162('0x68')](_0x3162('0x6b'),'ListId')[_0x3162('0x68')](_0x3162('0x7c'),_0x3162('0x7d'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x65'))[_0x3162('0x68')]('NOW()',_0x3162('0x7a'))[_0x3162('0x73')](_0x3162('0x6e'))['where'](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x70'),_0x3f37fa[_0x3162('0x48')]['state'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x72'))[_0x3162('0x3c')](_0x3162('0x74'),squel['select']()[_0x3162('0x68')]('phone')[_0x3162('0x73')](_0x3162('0x61'))['where'](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]()))['where'](_0x3162('0x74'),squel['select']()['field'](_0x3162('0x75'))[_0x3162('0x73')](_0x3162('0x6e'))[_0x3162('0x3c')](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]())['where']('state\x20=\x204'))['group'](_0x3162('0x6a')))[_0x3162('0x6f')]();return db['sequelize']['query'](_0x5cdbb0);}return[];})[_0x3162('0x24')](respondWithResult(_0x1d242f,null))['catch'](handleError(_0x1d242f,null));};exports[_0x3162('0x7f')]=function(_0x35d9f0,_0x4408db,_0x377edb){return db['CmHopper'][_0x3162('0x80')]({'where':{'VoiceQueueId':_0x35d9f0[_0x3162('0x48')][_0x3162('0x6d')],'CampaignId':_0x35d9f0['body'][_0x3162('0x7d')],'ContactId':_0x35d9f0['body'][_0x3162('0x6a')]}})['then'](handleEntityNotFound(_0x4408db,null))[_0x3162('0x24')](function(_0x3d414f){if(_0x3d414f){return _0x3d414f;}return null;})[_0x3162('0x24')](respondWithResult(_0x4408db,null))['catch'](handleError(_0x4408db,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index de0df5c..765923a 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 _0x4591=['./cmHopperFinal.attributes','exports','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x54b784,_0x365237){var _0x2aa04d=function(_0x27a2ad){while(--_0x27a2ad){_0x54b784['push'](_0x54b784['shift']());}};_0x2aa04d(++_0x365237);}(_0x4591,0xa1));var _0x1459=function(_0x128b33,_0x46dec1){_0x128b33=_0x128b33-0x0;var _0x2d02c0=_0x4591[_0x128b33];return _0x2d02c0;};'use strict';var _=require(_0x1459('0x0'));var util=require(_0x1459('0x1'));var logger=require(_0x1459('0x2'))(_0x1459('0x3'));var moment=require('moment');var BPromise=require(_0x1459('0x4'));var rp=require(_0x1459('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1459('0x6'));var config=require(_0x1459('0x7'));var attributes=require(_0x1459('0x8'));module[_0x1459('0x9')]=function(_0x123d98,_0x732544){return _0x123d98['define']('CmHopperFinal',attributes,{'tableName':_0x1459('0xa'),'paranoid':![],'indexes':[{'name':_0x1459('0xb'),'fields':[_0x1459('0xb')]},{'name':_0x1459('0xc'),'fields':[_0x1459('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3911=['uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','CmHopperFinal','cm_hopper_final','calleridnum'];(function(_0x349775,_0x168e55){var _0x240b82=function(_0x1131d5){while(--_0x1131d5){_0x349775['push'](_0x349775['shift']());}};_0x240b82(++_0x168e55);}(_0x3911,0x112));var _0x1391=function(_0x38a040,_0x1cb9c3){_0x38a040=_0x38a040-0x0;var _0x50e92f=_0x3911[_0x38a040];return _0x50e92f;};'use strict';var _=require(_0x1391('0x0'));var util=require('util');var logger=require(_0x1391('0x1'))(_0x1391('0x2'));var moment=require(_0x1391('0x3'));var BPromise=require('bluebird');var rp=require(_0x1391('0x4'));var fs=require('fs');var path=require(_0x1391('0x5'));var rimraf=require(_0x1391('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0x1391('0x7')]=function(_0x221d03,_0x43983b){return _0x221d03[_0x1391('0x8')](_0x1391('0x9'),attributes,{'tableName':_0x1391('0xa'),'paranoid':![],'indexes':[{'name':_0x1391('0xb'),'fields':[_0x1391('0xb')]},{'name':_0x1391('0xc'),'fields':[_0x1391('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 72d5991..bbe924a 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x14b70f,_0x2a2f7a){var _0x1d8574=function(_0x1a75a7){while(--_0x1a75a7){_0x14b70f['push'](_0x14b70f['shift']());}};_0x1d8574(++_0x2a2f7a);}(_0x7a54,0x106));var _0x47a5=function(_0x4ca66d,_0x427ec2){_0x4ca66d=_0x4ca66d-0x0;var _0xaed7ea=_0x7a54[_0x4ca66d];return _0xaed7ea;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x63af60,_0x52f241){var _0x5ca6c3=function(_0x1ecaa3){while(--_0x1ecaa3){_0x63af60['push'](_0x63af60['shift']());}};_0x5ca6c3(++_0x52f241);}(_0xb10b,0x12a));var _0xbb10=function(_0x3634d8,_0xbfa70b){_0x3634d8=_0x3634d8-0x0;var _0x2c1369=_0xb10b[_0x3634d8];return _0x2c1369;};'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 3fe7c31..02295dc 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 _0x85e9=['/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal'];(function(_0x3e6b25,_0xe4bd09){var _0x41e86c=function(_0x12f95d){while(--_0x12f95d){_0x3e6b25['push'](_0x3e6b25['shift']());}};_0x41e86c(++_0xe4bd09);}(_0x85e9,0xeb));var _0x985e=function(_0x1636f0,_0x56920a){_0x1636f0=_0x1636f0-0x0;var _0x40f69d=_0x85e9[_0x1636f0];return _0x40f69d;};'use strict';var multer=require('multer');var util=require(_0x985e('0x0'));var path=require(_0x985e('0x1'));var timeout=require('connect-timeout');var express=require(_0x985e('0x2'));var router=express[_0x985e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x985e('0x4'));var interaction=require(_0x985e('0x5'));var config=require(_0x985e('0x6'));var controller=require(_0x985e('0x7'));router[_0x985e('0x8')]('/',auth[_0x985e('0x9')](),controller[_0x985e('0xa')]);router[_0x985e('0x8')](_0x985e('0xb'),auth[_0x985e('0x9')](),controller[_0x985e('0xc')]);router['get'](_0x985e('0xd'),auth['isAuthenticated'](),controller[_0x985e('0xe')]);router[_0x985e('0x8')](_0x985e('0xf'),auth[_0x985e('0x9')](),controller[_0x985e('0x10')]);router[_0x985e('0x8')](_0x985e('0x11'),auth[_0x985e('0x9')](),controller[_0x985e('0x12')]);router['post'](_0x985e('0x13'),auth[_0x985e('0x9')](),controller[_0x985e('0x14')]);router[_0x985e('0x15')](_0x985e('0x16'),auth[_0x985e('0x9')](),controller[_0x985e('0x17')]);router[_0x985e('0x15')](_0x985e('0x18'),auth[_0x985e('0x9')](),controller[_0x985e('0x19')]);router[_0x985e('0x1a')](_0x985e('0xd'),auth[_0x985e('0x9')](),controller['update']);module[_0x985e('0x1b')]=router; \ No newline at end of file +var _0x7181=['./cmHopperFinal.controller','get','isAuthenticated','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','put','update','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x53afa6,_0x59e786){var _0x51f86a=function(_0x368385){while(--_0x368385){_0x53afa6['push'](_0x53afa6['shift']());}};_0x51f86a(++_0x59e786);}(_0x7181,0xb1));var _0x1718=function(_0x512738,_0x52ef6b){_0x512738=_0x512738-0x0;var _0x1bdb2b=_0x7181[_0x512738];return _0x1bdb2b;};'use strict';var multer=require('multer');var util=require(_0x1718('0x0'));var path=require('path');var timeout=require(_0x1718('0x1'));var express=require(_0x1718('0x2'));var router=express[_0x1718('0x3')]();var fs_extra=require(_0x1718('0x4'));var auth=require(_0x1718('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1718('0x6'));var controller=require(_0x1718('0x7'));router[_0x1718('0x8')]('/',auth[_0x1718('0x9')](),controller['index']);router[_0x1718('0x8')](_0x1718('0xa'),auth[_0x1718('0x9')](),controller['describe']);router[_0x1718('0x8')](_0x1718('0xb'),auth[_0x1718('0x9')](),controller[_0x1718('0xc')]);router[_0x1718('0x8')](_0x1718('0xd'),auth[_0x1718('0x9')](),controller[_0x1718('0xe')]);router[_0x1718('0x8')](_0x1718('0xf'),auth[_0x1718('0x9')](),controller[_0x1718('0x10')]);router[_0x1718('0x11')](_0x1718('0x12'),auth[_0x1718('0x9')](),controller[_0x1718('0x13')]);router[_0x1718('0x11')]('/voice/campaign/moveContacts/:id',auth[_0x1718('0x9')](),controller[_0x1718('0x14')]);router[_0x1718('0x11')]('/checkContactHopper',auth['isAuthenticated'](),controller['checkContactHopper']);router[_0x1718('0x15')](_0x1718('0xb'),auth['isAuthenticated'](),controller[_0x1718('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 7804ea5..675decf 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 _0x4d15=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x54af43,_0x298125){var _0x42c0be=function(_0xe4b476){while(--_0xe4b476){_0x54af43['push'](_0x54af43['shift']());}};_0x42c0be(++_0x298125);}(_0x4d15,0x156));var _0x54d1=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4d15[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0x54d1('0x0'));module[_0x54d1('0x1')]={'state':{'type':Sequelize[_0x54d1('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x54d1('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x54d1('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x54d1('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x54d1('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x54d1('0x3')]},'originatecalleridname':{'type':Sequelize[_0x54d1('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x54d1('0x4')]},'responsetime':{'type':Sequelize[_0x54d1('0x4')]},'answertime':{'type':Sequelize[_0x54d1('0x4')]},'droptime':{'type':Sequelize[_0x54d1('0x4')]},'endtime':{'type':Sequelize[_0x54d1('0x4')]},'ringtime':{'type':Sequelize[_0x54d1('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x54d1('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x54d1('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x54d1('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x54d1('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x54d1('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x54d1('0x4')]},'recallme':{'type':Sequelize[_0x54d1('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x54d1('0x4')]},'edited':{'type':Sequelize[_0x54d1('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x54d1('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x54d1('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x54d1('0x3')]}}; \ No newline at end of file +var _0x1bb0=['BOOLEAN','sequelize','INTEGER','STRING','DATE'];(function(_0x459f83,_0x1821d6){var _0x16b8ed=function(_0xe884f8){while(--_0xe884f8){_0x459f83['push'](_0x459f83['shift']());}};_0x16b8ed(++_0x1821d6);}(_0x1bb0,0xc9));var _0x01bb=function(_0x189c6a,_0x1e985b){_0x189c6a=_0x189c6a-0x0;var _0x482d1a=_0x1bb0[_0x189c6a];return _0x482d1a;};'use strict';var Sequelize=require(_0x01bb('0x0'));module['exports']={'state':{'type':Sequelize[_0x01bb('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x01bb('0x2')]},'scheduledat':{'type':Sequelize[_0x01bb('0x3')]},'countbusyretry':{'type':Sequelize[_0x01bb('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x01bb('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x01bb('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x01bb('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x01bb('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x01bb('0x2')]},'calleridname':{'type':Sequelize[_0x01bb('0x2')]},'starttime':{'type':Sequelize[_0x01bb('0x3')]},'responsetime':{'type':Sequelize[_0x01bb('0x3')]},'answertime':{'type':Sequelize[_0x01bb('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x01bb('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x01bb('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x01bb('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x01bb('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x01bb('0x2')]},'membername':{'type':Sequelize[_0x01bb('0x2')]},'reason':{'type':Sequelize[_0x01bb('0x2')]},'amd':{'type':Sequelize[_0x01bb('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x01bb('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x01bb('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x01bb('0x3')]},'recallme':{'type':Sequelize[_0x01bb('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x01bb('0x3')]},'edited':{'type':Sequelize[_0x01bb('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x01bb('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x01bb('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x01bb('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x01bb('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x01bb('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x01bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 33b6ab5..9f3c8ef 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 _0x5ae9=['sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','send','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','CmHopperHistory','then','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','uniqueid','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xfe9bbe,_0x27b8b4){var _0x20b9e8=function(_0xbac2fc){while(--_0xbac2fc){_0xfe9bbe['push'](_0xfe9bbe['shift']());}};_0x20b9e8(++_0x27b8b4);}(_0x5ae9,0xbf));var _0x95ae=function(_0x1b6c0c,_0x51ef20){_0x1b6c0c=_0x1b6c0c-0x0;var _0x178991=_0x5ae9[_0x1b6c0c];return _0x178991;};'use strict';var emlformat=require(_0x95ae('0x0'));var rimraf=require(_0x95ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95ae('0x2'));var rp=require(_0x95ae('0x3'));var moment=require(_0x95ae('0x4'));var BPromise=require(_0x95ae('0x5'));var Mustache=require(_0x95ae('0x6'));var util=require(_0x95ae('0x7'));var path=require('path');var sox=require(_0x95ae('0x8'));var csv=require(_0x95ae('0x9'));var ejs=require(_0x95ae('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95ae('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x95ae('0x9'));var querystring=require(_0x95ae('0xc'));var Papa=require(_0x95ae('0xd'));var Redis=require(_0x95ae('0xe'));var authService=require(_0x95ae('0xf'));var qs=require(_0x95ae('0x10'));var as=require(_0x95ae('0x11'));var hardwareService=require(_0x95ae('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x95ae('0x13'));var config=require(_0x95ae('0x14'));var licenseUtil=require(_0x95ae('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29fb06,_0x4ea599){_0x4ea599=_0x4ea599||0xcc;return function(_0x25d51d){if(_0x25d51d){return _0x29fb06[_0x95ae('0x16')](_0x4ea599);}return _0x29fb06[_0x95ae('0x17')](_0x4ea599)[_0x95ae('0x18')]();};}function respondWithResult(_0x47bcad,_0x1adb7e){_0x1adb7e=_0x1adb7e||0xc8;return function(_0x213ecc){if(_0x213ecc){return _0x47bcad[_0x95ae('0x17')](_0x1adb7e)[_0x95ae('0x19')](_0x213ecc);}};}function respondWithFilteredResult(_0x3f1263,_0x2fd40a){return function(_0xc59054){if(_0xc59054){var _0x42c488=typeof _0x2fd40a[_0x95ae('0x1a')]===_0x95ae('0x1b')&&typeof _0x2fd40a['limit']===_0x95ae('0x1b');var _0x2a381e=_0xc59054[_0x95ae('0x1c')];var _0x574d50=_0x42c488?0x0:_0x2fd40a['offset'];var _0x5ce8af=_0x42c488?_0xc59054[_0x95ae('0x1c')]:_0x2fd40a[_0x95ae('0x1a')]+_0x2fd40a[_0x95ae('0x1d')];var _0x2120a5;if(_0x5ce8af>=_0x2a381e){_0x5ce8af=_0x2a381e;_0x2120a5=0xc8;}else{_0x2120a5=0xce;}_0x3f1263[_0x95ae('0x17')](_0x2120a5);return _0x3f1263['set'](_0x95ae('0x1e'),_0x574d50+'-'+_0x5ce8af+'/'+_0x2a381e)[_0x95ae('0x19')](_0xc59054);}return null;};}function patchUpdates(_0x4b0221){return function(_0xd65d5f){try{jsonpatch[_0x95ae('0x1f')](_0xd65d5f,_0x4b0221,!![]);}catch(_0x13f035){return BPromise[_0x95ae('0x20')](_0x13f035);}return _0xd65d5f[_0x95ae('0x21')]();};}function saveUpdates(_0x7f4447,_0x55dba8){return function(_0x5efa7e){if(_0x5efa7e){return _0x5efa7e[_0x95ae('0x22')](_0x7f4447)['then'](function(_0x1136cb){return _0x1136cb;});}return null;};}function removeEntity(_0x33d6dc,_0x3585ba){return function(_0x3283f1){if(_0x3283f1){return _0x3283f1[_0x95ae('0x23')]()['then'](function(){_0x33d6dc['status'](0xcc)[_0x95ae('0x18')]();});}};}function handleEntityNotFound(_0x1543f2,_0x3bb22f){return function(_0x50ca22){if(!_0x50ca22){_0x1543f2[_0x95ae('0x16')](0x194);}return _0x50ca22;};}function handleError(_0x4ba4a2,_0x3afe10){_0x3afe10=_0x3afe10||0x1f4;return function(_0x4ee001){logger['error'](_0x4ee001['stack']);if(_0x4ee001['name']){delete _0x4ee001['name'];}_0x4ba4a2[_0x95ae('0x17')](_0x3afe10)[_0x95ae('0x24')](_0x4ee001);};}exports['index']=function(_0x334e04,_0x5a82e5){var _0x3ae780={},_0x3d80b2={},_0x2a964a={'count':0x0,'rows':[]};var _0x3f62fa=_[_0x95ae('0x25')](db['CmHopperHistory'][_0x95ae('0x26')],function(_0x537ef6){return{'name':_0x537ef6[_0x95ae('0x27')],'type':_0x537ef6[_0x95ae('0x28')][_0x95ae('0x29')]};});_0x3d80b2[_0x95ae('0x2a')]=_[_0x95ae('0x25')](_0x3f62fa,_0x95ae('0x2b'));_0x3d80b2[_0x95ae('0x2c')]=_[_0x95ae('0x2d')](_0x334e04[_0x95ae('0x2c')]);_0x3d80b2[_0x95ae('0x2e')]=_['intersection'](_0x3d80b2[_0x95ae('0x2a')],_0x3d80b2[_0x95ae('0x2c')]);_0x3ae780[_0x95ae('0x2f')]=_[_0x95ae('0x30')](_0x3d80b2[_0x95ae('0x2a')],qs['fields'](_0x334e04[_0x95ae('0x2c')][_0x95ae('0x31')]));_0x3ae780['attributes']=_0x3ae780[_0x95ae('0x2f')][_0x95ae('0x32')]?_0x3ae780[_0x95ae('0x2f')]:_0x3d80b2[_0x95ae('0x2a')];if(!_0x334e04[_0x95ae('0x2c')][_0x95ae('0x33')](_0x95ae('0x34'))){_0x3ae780['limit']=qs[_0x95ae('0x1d')](_0x334e04[_0x95ae('0x2c')][_0x95ae('0x1d')]);_0x3ae780[_0x95ae('0x1a')]=qs['offset'](_0x334e04[_0x95ae('0x2c')]['offset']);}_0x3ae780['order']=qs['sort'](_0x334e04[_0x95ae('0x2c')]['sort']);_0x3ae780[_0x95ae('0x35')]=qs['filters'](_[_0x95ae('0x36')](_0x334e04[_0x95ae('0x2c')],_0x3d80b2['filters']),_0x3f62fa);if(_0x334e04[_0x95ae('0x2c')][_0x95ae('0x37')]){_0x3ae780[_0x95ae('0x35')]=_[_0x95ae('0x38')](_0x3ae780[_0x95ae('0x35')],{'$or':_[_0x95ae('0x25')](_0x3f62fa,function(_0x585269){if(_0x585269[_0x95ae('0x28')]!=='VIRTUAL'){var _0x1c077a={};_0x1c077a[_0x585269[_0x95ae('0x2b')]]={'$like':'%'+_0x334e04[_0x95ae('0x2c')][_0x95ae('0x37')]+'%'};return _0x1c077a;}})});}_0x3ae780=_[_0x95ae('0x38')]({},_0x3ae780,_0x334e04['options']);var _0x5c5f42={'where':_0x3ae780[_0x95ae('0x35')]};return db[_0x95ae('0x39')][_0x95ae('0x1c')](_0x5c5f42)[_0x95ae('0x3a')](function(_0x408066){_0x2a964a[_0x95ae('0x1c')]=_0x408066;if(_0x334e04[_0x95ae('0x2c')][_0x95ae('0x3b')]){_0x3ae780[_0x95ae('0x3c')]=[{'all':!![]}];}return db[_0x95ae('0x39')][_0x95ae('0x3d')](_0x3ae780);})[_0x95ae('0x3a')](function(_0x225e76){_0x2a964a[_0x95ae('0x3e')]=_0x225e76;return _0x2a964a;})['then'](respondWithFilteredResult(_0x5a82e5,_0x3ae780))['catch'](handleError(_0x5a82e5,null));};exports[_0x95ae('0x3f')]=function(_0x2a4127,_0x55abf6){var _0x593026={'raw':!![],'where':{'id':_0x2a4127[_0x95ae('0x40')]['id']}},_0x5c2b6c={};_0x5c2b6c[_0x95ae('0x2a')]=_[_0x95ae('0x2d')](db['CmHopperHistory'][_0x95ae('0x26')]);_0x5c2b6c[_0x95ae('0x2c')]=_[_0x95ae('0x2d')](_0x2a4127[_0x95ae('0x2c')]);_0x5c2b6c[_0x95ae('0x2e')]=_[_0x95ae('0x30')](_0x5c2b6c['model'],_0x5c2b6c[_0x95ae('0x2c')]);_0x593026[_0x95ae('0x2f')]=_[_0x95ae('0x30')](_0x5c2b6c['model'],qs['fields'](_0x2a4127[_0x95ae('0x2c')][_0x95ae('0x31')]));_0x593026[_0x95ae('0x2f')]=_0x593026['attributes'][_0x95ae('0x32')]?_0x593026[_0x95ae('0x2f')]:_0x5c2b6c['model'];if(_0x2a4127[_0x95ae('0x2c')][_0x95ae('0x3b')]){_0x593026[_0x95ae('0x3c')]=[{'all':!![]}];}_0x593026=_[_0x95ae('0x38')]({},_0x593026,_0x2a4127['options']);return db[_0x95ae('0x39')][_0x95ae('0x41')](_0x593026)['then'](handleEntityNotFound(_0x55abf6,null))[_0x95ae('0x3a')](respondWithResult(_0x55abf6,null))[_0x95ae('0x42')](handleError(_0x55abf6,null));};exports[_0x95ae('0x43')]=function(_0x27c3d3,_0x4c493a){return db[_0x95ae('0x39')][_0x95ae('0x43')](_0x27c3d3[_0x95ae('0x44')],{})[_0x95ae('0x3a')](respondWithResult(_0x4c493a,0xc9))[_0x95ae('0x42')](handleError(_0x4c493a,null));};exports[_0x95ae('0x45')]=function(_0xb26940,_0x45f161){return db[_0x95ae('0x39')]['describe']()[_0x95ae('0x3a')](respondWithResult(_0x45f161,null))[_0x95ae('0x42')](handleError(_0x45f161,null));};exports[_0x95ae('0x22')]=function(_0x25dcb8,_0x4e8403){if(_0x25dcb8[_0x95ae('0x44')][_0x95ae('0x46')]){delete _0x25dcb8[_0x95ae('0x44')][_0x95ae('0x46')];}return db[_0x95ae('0x39')][_0x95ae('0x41')]({'where':{'uniqueid':_0x25dcb8[_0x95ae('0x40')]['id']}})['then'](handleEntityNotFound(_0x4e8403,null))['then'](saveUpdates(_0x25dcb8[_0x95ae('0x44')],null))[_0x95ae('0x3a')](respondWithResult(_0x4e8403,null))[_0x95ae('0x42')](handleError(_0x4e8403,null));}; \ No newline at end of file +var _0xdace=['nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','CmHopperHistory','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length'];(function(_0x45a2c5,_0x22e07c){var _0x10157b=function(_0x432f22){while(--_0x432f22){_0x45a2c5['push'](_0x45a2c5['shift']());}};_0x10157b(++_0x22e07c);}(_0xdace,0xad));var _0xedac=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xdace[_0x5834bc];return _0x3e183a;};'use strict';var emlformat=require(_0xedac('0x0'));var rimraf=require(_0xedac('0x1'));var zipdir=require(_0xedac('0x2'));var jsonpatch=require(_0xedac('0x3'));var rp=require(_0xedac('0x4'));var moment=require(_0xedac('0x5'));var BPromise=require(_0xedac('0x6'));var Mustache=require(_0xedac('0x7'));var util=require(_0xedac('0x8'));var path=require(_0xedac('0x9'));var sox=require(_0xedac('0xa'));var csv=require(_0xedac('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedac('0xc'));var _=require(_0xedac('0xd'));var squel=require(_0xedac('0xe'));var crypto=require('crypto');var jsforce=require(_0xedac('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xedac('0xb'));var querystring=require('querystring');var Papa=require(_0xedac('0x10'));var Redis=require(_0xedac('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xedac('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedac('0x13'));var logger=require(_0xedac('0x14'))(_0xedac('0x15'));var utils=require('../../config/utils');var config=require(_0xedac('0x16'));var licenseUtil=require(_0xedac('0x17'));var db=require(_0xedac('0x18'))['db'];function respondWithStatusCode(_0x45a7cf,_0x46b346){_0x46b346=_0x46b346||0xcc;return function(_0x2b2884){if(_0x2b2884){return _0x45a7cf[_0xedac('0x19')](_0x46b346);}return _0x45a7cf[_0xedac('0x1a')](_0x46b346)[_0xedac('0x1b')]();};}function respondWithResult(_0x58d84d,_0x5b3051){_0x5b3051=_0x5b3051||0xc8;return function(_0x210b75){if(_0x210b75){return _0x58d84d[_0xedac('0x1a')](_0x5b3051)['json'](_0x210b75);}};}function respondWithFilteredResult(_0xff800b,_0x1873a3){return function(_0x515e16){if(_0x515e16){var _0x4234fa=typeof _0x1873a3[_0xedac('0x1c')]===_0xedac('0x1d')&&typeof _0x1873a3[_0xedac('0x1e')]===_0xedac('0x1d');var _0x2b651e=_0x515e16['count'];var _0x2060d6=_0x4234fa?0x0:_0x1873a3[_0xedac('0x1c')];var _0x3908ba=_0x4234fa?_0x515e16[_0xedac('0x1f')]:_0x1873a3[_0xedac('0x1c')]+_0x1873a3[_0xedac('0x1e')];var _0x57017e;if(_0x3908ba>=_0x2b651e){_0x3908ba=_0x2b651e;_0x57017e=0xc8;}else{_0x57017e=0xce;}_0xff800b[_0xedac('0x1a')](_0x57017e);return _0xff800b[_0xedac('0x20')](_0xedac('0x21'),_0x2060d6+'-'+_0x3908ba+'/'+_0x2b651e)['json'](_0x515e16);}return null;};}function patchUpdates(_0x517d4b){return function(_0x3d50f3){try{jsonpatch['apply'](_0x3d50f3,_0x517d4b,!![]);}catch(_0x4dc953){return BPromise[_0xedac('0x22')](_0x4dc953);}return _0x3d50f3[_0xedac('0x23')]();};}function saveUpdates(_0xfa9748,_0x2a0ac7){return function(_0xf74567){if(_0xf74567){return _0xf74567[_0xedac('0x24')](_0xfa9748)[_0xedac('0x25')](function(_0x48a0fb){return _0x48a0fb;});}return null;};}function removeEntity(_0xda3297,_0xe73c){return function(_0xb57b6d){if(_0xb57b6d){return _0xb57b6d['destroy']()[_0xedac('0x25')](function(){_0xda3297['status'](0xcc)[_0xedac('0x1b')]();});}};}function handleEntityNotFound(_0x45f90b,_0x45d152){return function(_0x29552a){if(!_0x29552a){_0x45f90b[_0xedac('0x19')](0x194);}return _0x29552a;};}function handleError(_0x12f2b0,_0x47f210){_0x47f210=_0x47f210||0x1f4;return function(_0x2ceddf){logger[_0xedac('0x26')](_0x2ceddf[_0xedac('0x27')]);if(_0x2ceddf[_0xedac('0x28')]){delete _0x2ceddf[_0xedac('0x28')];}_0x12f2b0['status'](_0x47f210)[_0xedac('0x29')](_0x2ceddf);};}exports[_0xedac('0x2a')]=function(_0x1c4a39,_0x142e3b){var _0x138fde={},_0x46f227={},_0x39a8e9={'count':0x0,'rows':[]};var _0x34c4c4=_['map'](db[_0xedac('0x2b')]['rawAttributes'],function(_0x3587ba){return{'name':_0x3587ba[_0xedac('0x2c')],'type':_0x3587ba[_0xedac('0x2d')]['key']};});_0x46f227[_0xedac('0x2e')]=_[_0xedac('0x2f')](_0x34c4c4,_0xedac('0x28'));_0x46f227['query']=_[_0xedac('0x30')](_0x1c4a39[_0xedac('0x31')]);_0x46f227[_0xedac('0x32')]=_[_0xedac('0x33')](_0x46f227[_0xedac('0x2e')],_0x46f227[_0xedac('0x31')]);_0x138fde[_0xedac('0x34')]=_['intersection'](_0x46f227[_0xedac('0x2e')],qs[_0xedac('0x35')](_0x1c4a39[_0xedac('0x31')]['fields']));_0x138fde['attributes']=_0x138fde[_0xedac('0x34')][_0xedac('0x36')]?_0x138fde[_0xedac('0x34')]:_0x46f227[_0xedac('0x2e')];if(!_0x1c4a39['query']['hasOwnProperty'](_0xedac('0x37'))){_0x138fde[_0xedac('0x1e')]=qs[_0xedac('0x1e')](_0x1c4a39['query']['limit']);_0x138fde[_0xedac('0x1c')]=qs[_0xedac('0x1c')](_0x1c4a39['query'][_0xedac('0x1c')]);}_0x138fde[_0xedac('0x38')]=qs['sort'](_0x1c4a39[_0xedac('0x31')][_0xedac('0x39')]);_0x138fde[_0xedac('0x3a')]=qs['filters'](_[_0xedac('0x3b')](_0x1c4a39[_0xedac('0x31')],_0x46f227[_0xedac('0x32')]),_0x34c4c4);if(_0x1c4a39[_0xedac('0x31')][_0xedac('0x3c')]){_0x138fde[_0xedac('0x3a')]=_[_0xedac('0x3d')](_0x138fde['where'],{'$or':_[_0xedac('0x2f')](_0x34c4c4,function(_0x2c0ecb){if(_0x2c0ecb[_0xedac('0x2d')]!=='VIRTUAL'){var _0x4a982d={};_0x4a982d[_0x2c0ecb['name']]={'$like':'%'+_0x1c4a39[_0xedac('0x31')]['filter']+'%'};return _0x4a982d;}})});}_0x138fde=_[_0xedac('0x3d')]({},_0x138fde,_0x1c4a39[_0xedac('0x3e')]);var _0x479abc={'where':_0x138fde[_0xedac('0x3a')]};return db['CmHopperHistory'][_0xedac('0x1f')](_0x479abc)[_0xedac('0x25')](function(_0x165f84){_0x39a8e9[_0xedac('0x1f')]=_0x165f84;if(_0x1c4a39[_0xedac('0x31')]['includeAll']){_0x138fde[_0xedac('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xedac('0x40')](_0x138fde);})[_0xedac('0x25')](function(_0x52ee44){_0x39a8e9[_0xedac('0x41')]=_0x52ee44;return _0x39a8e9;})[_0xedac('0x25')](respondWithFilteredResult(_0x142e3b,_0x138fde))[_0xedac('0x42')](handleError(_0x142e3b,null));};exports[_0xedac('0x43')]=function(_0x29e75a,_0x4e46b0){var _0x3eaca8={'raw':!![],'where':{'id':_0x29e75a[_0xedac('0x44')]['id']}},_0x328104={};_0x328104[_0xedac('0x2e')]=_[_0xedac('0x30')](db[_0xedac('0x2b')][_0xedac('0x45')]);_0x328104['query']=_[_0xedac('0x30')](_0x29e75a[_0xedac('0x31')]);_0x328104['filters']=_[_0xedac('0x33')](_0x328104[_0xedac('0x2e')],_0x328104[_0xedac('0x31')]);_0x3eaca8[_0xedac('0x34')]=_['intersection'](_0x328104[_0xedac('0x2e')],qs['fields'](_0x29e75a['query'][_0xedac('0x35')]));_0x3eaca8[_0xedac('0x34')]=_0x3eaca8[_0xedac('0x34')][_0xedac('0x36')]?_0x3eaca8['attributes']:_0x328104[_0xedac('0x2e')];if(_0x29e75a['query'][_0xedac('0x46')]){_0x3eaca8[_0xedac('0x3f')]=[{'all':!![]}];}_0x3eaca8=_[_0xedac('0x3d')]({},_0x3eaca8,_0x29e75a['options']);return db[_0xedac('0x2b')][_0xedac('0x47')](_0x3eaca8)[_0xedac('0x25')](handleEntityNotFound(_0x4e46b0,null))[_0xedac('0x25')](respondWithResult(_0x4e46b0,null))[_0xedac('0x42')](handleError(_0x4e46b0,null));};exports['create']=function(_0x44d20c,_0x142009){return db[_0xedac('0x2b')][_0xedac('0x48')](_0x44d20c[_0xedac('0x49')],{})['then'](respondWithResult(_0x142009,0xc9))['catch'](handleError(_0x142009,null));};exports['describe']=function(_0x51ec9a,_0x4ba196){return db[_0xedac('0x2b')][_0xedac('0x4a')]()[_0xedac('0x25')](respondWithResult(_0x4ba196,null))[_0xedac('0x42')](handleError(_0x4ba196,null));};exports[_0xedac('0x24')]=function(_0x46be02,_0x314e41){if(_0x46be02[_0xedac('0x49')][_0xedac('0x4b')]){delete _0x46be02[_0xedac('0x49')][_0xedac('0x4b')];}return db['CmHopperHistory'][_0xedac('0x47')]({'where':{'uniqueid':_0x46be02[_0xedac('0x44')]['id']}})[_0xedac('0x25')](handleEntityNotFound(_0x314e41,null))[_0xedac('0x25')](saveUpdates(_0x46be02['body'],null))['then'](respondWithResult(_0x314e41,null))[_0xedac('0x42')](handleError(_0x314e41,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 0bb94bc..70032d0 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 _0xdcdb=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util'];(function(_0x4a379b,_0x334e8b){var _0x2e2509=function(_0x82c3b3){while(--_0x82c3b3){_0x4a379b['push'](_0x4a379b['shift']());}};_0x2e2509(++_0x334e8b);}(_0xdcdb,0x64));var _0xbdcd=function(_0x160a7f,_0x42ada7){_0x160a7f=_0x160a7f-0x0;var _0x241a29=_0xdcdb[_0x160a7f];return _0x241a29;};'use strict';var _=require(_0xbdcd('0x0'));var util=require(_0xbdcd('0x1'));var logger=require(_0xbdcd('0x2'))(_0xbdcd('0x3'));var moment=require(_0xbdcd('0x4'));var BPromise=require(_0xbdcd('0x5'));var rp=require(_0xbdcd('0x6'));var fs=require('fs');var path=require(_0xbdcd('0x7'));var rimraf=require(_0xbdcd('0x8'));var config=require(_0xbdcd('0x9'));var attributes=require(_0xbdcd('0xa'));module[_0xbdcd('0xb')]=function(_0x3a8b0d,_0x471f46){return _0x3a8b0d[_0xbdcd('0xc')](_0xbdcd('0xd'),attributes,{'tableName':_0xbdcd('0xe'),'paranoid':![],'indexes':[{'name':_0xbdcd('0xf'),'fields':[_0xbdcd('0xf')]},{'name':_0xbdcd('0x10'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x04fa=['./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x04fa,0x119));var _0xa04f=function(_0x1c8053,_0xa93951){_0x1c8053=_0x1c8053-0x0;var _0x2d7984=_0x04fa[_0x1c8053];return _0x2d7984;};'use strict';var _=require('lodash');var util=require(_0xa04f('0x0'));var logger=require(_0xa04f('0x1'))(_0xa04f('0x2'));var moment=require(_0xa04f('0x3'));var BPromise=require(_0xa04f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa04f('0x5'));var rimraf=require('rimraf');var config=require(_0xa04f('0x6'));var attributes=require(_0xa04f('0x7'));module[_0xa04f('0x8')]=function(_0x5a5214,_0x26a874){return _0x5a5214[_0xa04f('0x9')](_0xa04f('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xa04f('0xb'),'fields':['endtime']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 5966f68..e775e31 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 _0x4b6c=['`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','literal','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','catch','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','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','options','raw','debug','stringify','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout'];(function(_0x56ab0a,_0x91a28a){var _0x289534=function(_0x52952c){while(--_0x52952c){_0x56ab0a['push'](_0x56ab0a['shift']());}};_0x289534(++_0x91a28a);}(_0x4b6c,0x14a));var _0xc4b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b6c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc4b6('0x0'));var util=require(_0xc4b6('0x1'));var moment=require('moment');var BPromise=require(_0xc4b6('0x2'));var rs=require(_0xc4b6('0x3'));var fs=require('fs');var Redis=require(_0xc4b6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc4b6('0x5'));var logger=require(_0xc4b6('0x6'))(_0xc4b6('0x7'));var config=require('../../config/environment');var jayson=require(_0xc4b6('0x8'));var client=jayson[_0xc4b6('0x9')][_0xc4b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2948c6,_0x5829a9,_0x443998){return new BPromise(function(_0x4b935f,_0x4b723a){return client[_0xc4b6('0xb')](_0x2948c6,_0x443998)[_0xc4b6('0xc')](function(_0x433435){logger[_0xc4b6('0xd')](_0xc4b6('0xe'),_0x5829a9,_0xc4b6('0xf'));logger['debug'](_0xc4b6('0x10'),_0x5829a9,_0xc4b6('0xf'),JSON['stringify'](_0x433435));if(_0x433435[_0xc4b6('0x11')]){if(_0x433435[_0xc4b6('0x11')][_0xc4b6('0x12')]===0x1f4){logger[_0xc4b6('0x11')](_0xc4b6('0xe'),_0x5829a9,_0x433435[_0xc4b6('0x11')][_0xc4b6('0x13')]);return _0x4b723a(_0x433435[_0xc4b6('0x11')][_0xc4b6('0x13')]);}logger['error'](_0xc4b6('0xe'),_0x5829a9,_0x433435[_0xc4b6('0x11')]['message']);return _0x4b935f(_0x433435[_0xc4b6('0x11')]['message']);}else{logger[_0xc4b6('0xd')](_0xc4b6('0xe'),_0x5829a9,_0xc4b6('0xf'));_0x4b935f(_0x433435[_0xc4b6('0x14')]['message']);}})['catch'](function(_0x3e5527){logger[_0xc4b6('0x11')](_0xc4b6('0xe'),_0x5829a9,_0x3e5527);_0x4b723a(_0x3e5527);});});}exports[_0xc4b6('0x15')]=function(_0x220dfd){var _0x326600=this;return new Promise(function(_0x471bf8,_0x784d54){return db[_0xc4b6('0x16')][_0xc4b6('0x17')](_0x220dfd[_0xc4b6('0x18')],{'raw':_0x220dfd[_0xc4b6('0x19')]?_0x220dfd['options'][_0xc4b6('0x1a')]===undefined?!![]:![]:!![]})[_0xc4b6('0xc')](function(_0x44618b){logger[_0xc4b6('0xd')](_0xc4b6('0x15'),_0x220dfd);logger[_0xc4b6('0x1b')](_0xc4b6('0x15'),_0x220dfd,JSON[_0xc4b6('0x1c')](_0x44618b));_0x471bf8(_0x44618b);})['catch'](function(_0x8fcdde){logger[_0xc4b6('0x11')](_0xc4b6('0x15'),_0x8fcdde[_0xc4b6('0x13')],_0x220dfd);_0x784d54(_0x326600[_0xc4b6('0x11')](0x1f4,_0x8fcdde[_0xc4b6('0x13')]));});});};exports[_0xc4b6('0x1d')]=function(_0x81b146){var _0x187dac=this;return new Promise(function(_0x534e6d,_0x5a6eff){return db['CmHopperHistory'][_0xc4b6('0x1e')]({'raw':_0x81b146[_0xc4b6('0x19')]?_0x81b146['options'][_0xc4b6('0x1a')]===undefined?!![]:![]:!![],'where':_0x81b146[_0xc4b6('0x19')]?_0x81b146['options'][_0xc4b6('0x1f')]||null:null,'attributes':[[db[_0xc4b6('0x20')]['fn'](_0xc4b6('0x21'),db[_0xc4b6('0x20')][_0xc4b6('0x22')]('id')),_0xc4b6('0x23')],[db[_0xc4b6('0x20')]['fn'](_0xc4b6('0x21'),db[_0xc4b6('0x20')]['fn']('IF',db[_0xc4b6('0x20')]['literal'](_0xc4b6('0x24')))),_0xc4b6('0x25')],[db[_0xc4b6('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xc4b6('0x20')]['literal'](_0xc4b6('0x26')))),_0xc4b6('0x27')],[db[_0xc4b6('0x20')]['fn']('COUNT',db[_0xc4b6('0x20')]['fn']('IF',db[_0xc4b6('0x20')]['literal'](_0xc4b6('0x28')))),_0xc4b6('0x29')],[db[_0xc4b6('0x20')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0xc4b6('0x20')][_0xc4b6('0x2a')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xc4b6('0x2b')],[db['sequelize']['fn'](_0xc4b6('0x2c'),db[_0xc4b6('0x20')]['fn']('IF',db[_0xc4b6('0x20')][_0xc4b6('0x2a')](_0xc4b6('0x2d')))),_0xc4b6('0x2e')]]})[_0xc4b6('0xc')](function(_0x53d82d){logger['info']('AvgHandleTime',_0x81b146);logger[_0xc4b6('0x1b')](_0xc4b6('0x1d'),_0x81b146,JSON[_0xc4b6('0x1c')](_0x53d82d));_0x534e6d(_0x53d82d);})[_0xc4b6('0x2f')](function(_0x511e85){logger['error'](_0xc4b6('0x1d'),_0x511e85[_0xc4b6('0x13')],_0x81b146);_0x5a6eff(_0x187dac[_0xc4b6('0x11')](0x1f4,_0x511e85[_0xc4b6('0x13')]));});});};exports[_0xc4b6('0x30')]=function(_0x9addf7){var _0x23bd4f=this;return new Promise(function(_0x5aadb1,_0x16e925){return db[_0xc4b6('0x16')]['findAll']({'raw':_0x9addf7[_0xc4b6('0x19')]?_0x9addf7[_0xc4b6('0x19')][_0xc4b6('0x1a')]===undefined?!![]:![]:!![],'where':_0x9addf7[_0xc4b6('0x19')]?_0x9addf7[_0xc4b6('0x19')][_0xc4b6('0x1f')]||null:null,'attributes':[[_0xc4b6('0x31'),_0xc4b6('0x32')],[db[_0xc4b6('0x20')]['fn']('COUNT',db[_0xc4b6('0x20')]['fn']('IF',db['sequelize'][_0xc4b6('0x2a')](_0xc4b6('0x33')))),_0xc4b6('0x34')],[db['sequelize']['fn'](_0xc4b6('0x21'),db[_0xc4b6('0x20')]['fn']('IF',db[_0xc4b6('0x20')][_0xc4b6('0x2a')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0xc4b6('0x20')]['fn'](_0xc4b6('0x21'),db[_0xc4b6('0x20')]['fn']('IF',db[_0xc4b6('0x20')][_0xc4b6('0x2a')]('`state`\x20=\x204,\x201,\x20null'))),_0xc4b6('0x35')],[db['sequelize']['fn']('COUNT',db[_0xc4b6('0x20')]['fn']('IF',db['sequelize'][_0xc4b6('0x2a')](_0xc4b6('0x36')))),_0xc4b6('0x37')],[db['sequelize']['fn'](_0xc4b6('0x21'),db[_0xc4b6('0x20')]['fn']('IF',db[_0xc4b6('0x20')][_0xc4b6('0x2a')](_0xc4b6('0x38')))),_0xc4b6('0x39')],[db['sequelize']['fn']('COUNT',db[_0xc4b6('0x20')]['fn']('IF',db[_0xc4b6('0x20')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),'outboundDropCallsDayTimeout'],[db[_0xc4b6('0x20')]['fn'](_0xc4b6('0x21'),db[_0xc4b6('0x20')]['fn']('IF',db[_0xc4b6('0x20')][_0xc4b6('0x2a')](_0xc4b6('0x3a')))),_0xc4b6('0x3b')],[db['sequelize']['fn'](_0xc4b6('0x21'),db[_0xc4b6('0x20')]['fn']('IF',db[_0xc4b6('0x20')][_0xc4b6('0x2a')](_0xc4b6('0x3c')))),_0xc4b6('0x3d')],[db[_0xc4b6('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xc4b6('0x20')][_0xc4b6('0x2a')](_0xc4b6('0x3e')))),_0xc4b6('0x3f')],[db['sequelize']['fn'](_0xc4b6('0x21'),db[_0xc4b6('0x20')]['fn']('IF',db[_0xc4b6('0x20')][_0xc4b6('0x2a')]('`state`\x20=\x2014,\x201,\x20null'))),_0xc4b6('0x40')],[db['sequelize']['fn'](_0xc4b6('0x21'),db[_0xc4b6('0x20')]['fn']('IF',db['sequelize'][_0xc4b6('0x2a')]('`state`\x20=\x2018,\x201,\x20null'))),_0xc4b6('0x41')],[db[_0xc4b6('0x20')]['fn'](_0xc4b6('0x21'),db[_0xc4b6('0x20')]['fn']('IF',db[_0xc4b6('0x20')]['literal'](_0xc4b6('0x42')))),_0xc4b6('0x43')],[db[_0xc4b6('0x20')]['fn'](_0xc4b6('0x21'),db[_0xc4b6('0x20')]['fn']('IF',db[_0xc4b6('0x20')][_0xc4b6('0x2a')](_0xc4b6('0x44')))),_0xc4b6('0x41')],[db['sequelize']['fn'](_0xc4b6('0x21'),db[_0xc4b6('0x20')]['fn']('IF',db[_0xc4b6('0x20')][_0xc4b6('0x2a')](_0xc4b6('0x45')))),_0xc4b6('0x46')]],'group':[_0xc4b6('0x31')]})[_0xc4b6('0xc')](function(_0x56d6d7){logger['info'](_0xc4b6('0x30'),_0x9addf7);logger[_0xc4b6('0x1b')]('GetVoiceQueueHopperHistory',_0x9addf7,JSON[_0xc4b6('0x1c')](_0x56d6d7));_0x5aadb1(_0x56d6d7);})[_0xc4b6('0x2f')](function(_0xed498b){logger[_0xc4b6('0x11')](_0xc4b6('0x30'),_0xed498b['message'],_0x9addf7);_0x16e925(_0x23bd4f[_0xc4b6('0x11')](0x1f4,_0xed498b[_0xc4b6('0x13')]));});});};exports['GetCampaignHopperHistory']=function(_0x17a796){var _0x3325b1=this;return new Promise(function(_0x48442b,_0x505fdd){return db[_0xc4b6('0x16')]['findAll']({'raw':_0x17a796['options']?_0x17a796[_0xc4b6('0x19')][_0xc4b6('0x1a')]===undefined?!![]:![]:!![],'where':_0x17a796['options']?_0x17a796[_0xc4b6('0x19')][_0xc4b6('0x1f')]||null:null,'attributes':[['campaign',_0xc4b6('0x32')],[db[_0xc4b6('0x20')]['fn'](_0xc4b6('0x21'),db[_0xc4b6('0x20')]['col']('id')),_0xc4b6('0x47')],[db[_0xc4b6('0x20')]['fn'](_0xc4b6('0x21'),db[_0xc4b6('0x20')]['fn']('IF',db[_0xc4b6('0x20')][_0xc4b6('0x2a')](_0xc4b6('0x24')))),_0xc4b6('0x48')]],'group':[_0xc4b6('0x31')]})[_0xc4b6('0xc')](function(_0x1ade6d){logger[_0xc4b6('0xd')](_0xc4b6('0x49'),_0x17a796);logger[_0xc4b6('0x1b')](_0xc4b6('0x49'),_0x17a796,JSON[_0xc4b6('0x1c')](_0x1ade6d));_0x48442b(_0x1ade6d);})['catch'](function(_0x2ca511){logger[_0xc4b6('0x11')]('GetCampaignHopperHistory',_0x2ca511[_0xc4b6('0x13')],_0x17a796);_0x505fdd(_0x3325b1[_0xc4b6('0x11')](0x1f4,_0x2ca511[_0xc4b6('0x13')]));});});}; \ No newline at end of file +var _0xf197=['result','catch','CreateCmHopperHistory','create','body','options','stringify','AvgHandleTime','CmHopperHistory','raw','where','sequelize','col','`state`\x20=\x204,\x201,\x20null','COUNT','literal','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','name','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','findAll','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','ioredis','rpc','client','http','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','CmHopperHistory,\x20%s,\x20%s','message'];(function(_0x34f701,_0x37e407){var _0x3e2429=function(_0x20c0c3){while(--_0x20c0c3){_0x34f701['push'](_0x34f701['shift']());}};_0x3e2429(++_0x37e407);}(_0xf197,0x130));var _0x7f19=function(_0x557556,_0x287b52){_0x557556=_0x557556-0x0;var _0x284785=_0xf197[_0x557556];return _0x284785;};'use strict';var _=require(_0x7f19('0x0'));var util=require(_0x7f19('0x1'));var moment=require(_0x7f19('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f19('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7f19('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7f19('0x5')][_0x7f19('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x39b5b1,_0x1851e3,_0x39c494){return new BPromise(function(_0x2ebbfb,_0x3c349c){return client['request'](_0x39b5b1,_0x39c494)[_0x7f19('0x7')](function(_0x116b95){logger[_0x7f19('0x8')]('CmHopperHistory,\x20%s,\x20%s',_0x1851e3,_0x7f19('0x9'));logger[_0x7f19('0xa')](_0x7f19('0xb'),_0x1851e3,_0x7f19('0x9'),JSON['stringify'](_0x116b95));if(_0x116b95[_0x7f19('0xc')]){if(_0x116b95['error'][_0x7f19('0xd')]===0x1f4){logger[_0x7f19('0xc')](_0x7f19('0xe'),_0x1851e3,_0x116b95['error']['message']);return _0x3c349c(_0x116b95[_0x7f19('0xc')][_0x7f19('0xf')]);}logger[_0x7f19('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x1851e3,_0x116b95[_0x7f19('0xc')][_0x7f19('0xf')]);return _0x2ebbfb(_0x116b95['error'][_0x7f19('0xf')]);}else{logger[_0x7f19('0x8')](_0x7f19('0xe'),_0x1851e3,'request\x20sent');_0x2ebbfb(_0x116b95[_0x7f19('0x10')]['message']);}})[_0x7f19('0x11')](function(_0x2cc098){logger[_0x7f19('0xc')](_0x7f19('0xe'),_0x1851e3,_0x2cc098);_0x3c349c(_0x2cc098);});});}exports[_0x7f19('0x12')]=function(_0x5c56a1){var _0x27634b=this;return new Promise(function(_0x3b38d7,_0x122a9f){return db['CmHopperHistory'][_0x7f19('0x13')](_0x5c56a1[_0x7f19('0x14')],{'raw':_0x5c56a1[_0x7f19('0x15')]?_0x5c56a1[_0x7f19('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x7f19('0x7')](function(_0xb8a760){logger[_0x7f19('0x8')](_0x7f19('0x12'),_0x5c56a1);logger['debug'](_0x7f19('0x12'),_0x5c56a1,JSON[_0x7f19('0x16')](_0xb8a760));_0x3b38d7(_0xb8a760);})[_0x7f19('0x11')](function(_0x5168be){logger[_0x7f19('0xc')]('CreateCmHopperHistory',_0x5168be[_0x7f19('0xf')],_0x5c56a1);_0x122a9f(_0x27634b[_0x7f19('0xc')](0x1f4,_0x5168be[_0x7f19('0xf')]));});});};exports[_0x7f19('0x17')]=function(_0x1f0ea6){var _0x500ee3=this;return new Promise(function(_0x57cc2e,_0x3d852b){return db[_0x7f19('0x18')]['findAll']({'raw':_0x1f0ea6[_0x7f19('0x15')]?_0x1f0ea6[_0x7f19('0x15')][_0x7f19('0x19')]===undefined?!![]:![]:!![],'where':_0x1f0ea6[_0x7f19('0x15')]?_0x1f0ea6[_0x7f19('0x15')][_0x7f19('0x1a')]||null:null,'attributes':[[db[_0x7f19('0x1b')]['fn']('COUNT',db[_0x7f19('0x1b')][_0x7f19('0x1c')]('id')),'predictiveIntervalTotalCalls'],[db[_0x7f19('0x1b')]['fn']('COUNT',db[_0x7f19('0x1b')]['fn']('IF',db['sequelize']['literal'](_0x7f19('0x1d')))),'predictiveIntervalAnsweredCalls'],[db[_0x7f19('0x1b')]['fn'](_0x7f19('0x1e'),db[_0x7f19('0x1b')]['fn']('IF',db['sequelize'][_0x7f19('0x1f')]('`state`\x20=\x2010,\x201,\x20null'))),_0x7f19('0x20')],[db['sequelize']['fn'](_0x7f19('0x1e'),db[_0x7f19('0x1b')]['fn']('IF',db[_0x7f19('0x1b')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0x7f19('0x21')],[db[_0x7f19('0x1b')]['fn'](_0x7f19('0x22'),db[_0x7f19('0x1b')]['fn']('IF',db[_0x7f19('0x1b')]['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0x7f19('0x1b')]['fn'](_0x7f19('0x22'),db['sequelize']['fn']('IF',db[_0x7f19('0x1b')][_0x7f19('0x1f')](_0x7f19('0x23')))),_0x7f19('0x24')]]})[_0x7f19('0x7')](function(_0x14238f){logger[_0x7f19('0x8')](_0x7f19('0x17'),_0x1f0ea6);logger['debug']('AvgHandleTime',_0x1f0ea6,JSON[_0x7f19('0x16')](_0x14238f));_0x57cc2e(_0x14238f);})[_0x7f19('0x11')](function(_0x923020){logger[_0x7f19('0xc')](_0x7f19('0x17'),_0x923020[_0x7f19('0xf')],_0x1f0ea6);_0x3d852b(_0x500ee3[_0x7f19('0xc')](0x1f4,_0x923020[_0x7f19('0xf')]));});});};exports[_0x7f19('0x25')]=function(_0x4b13e2){var _0x3dd6c0=this;return new Promise(function(_0x10c9e3,_0x1ddf30){return db[_0x7f19('0x18')]['findAll']({'raw':_0x4b13e2[_0x7f19('0x15')]?_0x4b13e2[_0x7f19('0x15')][_0x7f19('0x19')]===undefined?!![]:![]:!![],'where':_0x4b13e2[_0x7f19('0x15')]?_0x4b13e2['options'][_0x7f19('0x1a')]||null:null,'attributes':[['campaign',_0x7f19('0x26')],[db[_0x7f19('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x7f19('0x1b')][_0x7f19('0x1f')]('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x7f19('0x1f')](_0x7f19('0x27')))),_0x7f19('0x28')],[db['sequelize']['fn'](_0x7f19('0x1e'),db[_0x7f19('0x1b')]['fn']('IF',db[_0x7f19('0x1b')][_0x7f19('0x1f')](_0x7f19('0x1d')))),_0x7f19('0x29')],[db['sequelize']['fn'](_0x7f19('0x1e'),db['sequelize']['fn']('IF',db[_0x7f19('0x1b')][_0x7f19('0x1f')](_0x7f19('0x2a')))),'outboundBusyCallsDay'],[db[_0x7f19('0x1b')]['fn'](_0x7f19('0x1e'),db[_0x7f19('0x1b')]['fn']('IF',db[_0x7f19('0x1b')][_0x7f19('0x1f')](_0x7f19('0x2b')))),_0x7f19('0x2c')],[db['sequelize']['fn'](_0x7f19('0x1e'),db['sequelize']['fn']('IF',db[_0x7f19('0x1b')][_0x7f19('0x1f')](_0x7f19('0x2d')))),_0x7f19('0x2e')],[db[_0x7f19('0x1b')]['fn'](_0x7f19('0x1e'),db[_0x7f19('0x1b')]['fn']('IF',db[_0x7f19('0x1b')][_0x7f19('0x1f')](_0x7f19('0x2f')))),'outboundDropCallsDayCallersExit'],[db[_0x7f19('0x1b')]['fn'](_0x7f19('0x1e'),db['sequelize']['fn']('IF',db[_0x7f19('0x1b')][_0x7f19('0x1f')](_0x7f19('0x30')))),_0x7f19('0x31')],[db[_0x7f19('0x1b')]['fn'](_0x7f19('0x1e'),db[_0x7f19('0x1b')]['fn']('IF',db[_0x7f19('0x1b')][_0x7f19('0x1f')](_0x7f19('0x32')))),_0x7f19('0x33')],[db[_0x7f19('0x1b')]['fn'](_0x7f19('0x1e'),db[_0x7f19('0x1b')]['fn']('IF',db[_0x7f19('0x1b')][_0x7f19('0x1f')](_0x7f19('0x34')))),_0x7f19('0x35')],[db[_0x7f19('0x1b')]['fn']('COUNT',db[_0x7f19('0x1b')]['fn']('IF',db[_0x7f19('0x1b')][_0x7f19('0x1f')](_0x7f19('0x36')))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0x7f19('0x1e'),db[_0x7f19('0x1b')]['fn']('IF',db['sequelize']['literal'](_0x7f19('0x37')))),_0x7f19('0x38')],[db['sequelize']['fn'](_0x7f19('0x1e'),db[_0x7f19('0x1b')]['fn']('IF',db[_0x7f19('0x1b')][_0x7f19('0x1f')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x7f19('0x1b')]['fn'](_0x7f19('0x1e'),db[_0x7f19('0x1b')]['fn']('IF',db[_0x7f19('0x1b')][_0x7f19('0x1f')](_0x7f19('0x39')))),_0x7f19('0x3a')]],'group':[_0x7f19('0x3b')]})[_0x7f19('0x7')](function(_0x2689fc){logger[_0x7f19('0x8')]('GetVoiceQueueHopperHistory',_0x4b13e2);logger[_0x7f19('0xa')]('GetVoiceQueueHopperHistory',_0x4b13e2,JSON[_0x7f19('0x16')](_0x2689fc));_0x10c9e3(_0x2689fc);})[_0x7f19('0x11')](function(_0xf5f09e){logger[_0x7f19('0xc')](_0x7f19('0x25'),_0xf5f09e['message'],_0x4b13e2);_0x1ddf30(_0x3dd6c0[_0x7f19('0xc')](0x1f4,_0xf5f09e['message']));});});};exports['GetCampaignHopperHistory']=function(_0x1df885){var _0x11db5f=this;return new Promise(function(_0x33021d,_0x1cd7f6){return db[_0x7f19('0x18')][_0x7f19('0x3c')]({'raw':_0x1df885[_0x7f19('0x15')]?_0x1df885[_0x7f19('0x15')][_0x7f19('0x19')]===undefined?!![]:![]:!![],'where':_0x1df885[_0x7f19('0x15')]?_0x1df885[_0x7f19('0x15')][_0x7f19('0x1a')]||null:null,'attributes':[[_0x7f19('0x3b'),_0x7f19('0x26')],[db['sequelize']['fn'](_0x7f19('0x1e'),db['sequelize'][_0x7f19('0x1c')]('id')),_0x7f19('0x3d')],[db[_0x7f19('0x1b')]['fn'](_0x7f19('0x1e'),db['sequelize']['fn']('IF',db[_0x7f19('0x1b')][_0x7f19('0x1f')](_0x7f19('0x1d')))),_0x7f19('0x3e')]],'group':[_0x7f19('0x3b')]})['then'](function(_0x1b1d20){logger[_0x7f19('0x8')](_0x7f19('0x3f'),_0x1df885);logger[_0x7f19('0xa')]('GetCampaignHopperHistory',_0x1df885,JSON['stringify'](_0x1b1d20));_0x33021d(_0x1b1d20);})[_0x7f19('0x11')](function(_0x1a73b7){logger['error'](_0x7f19('0x3f'),_0x1a73b7['message'],_0x1df885);_0x1cd7f6(_0x11db5f['error'](0x1f4,_0x1a73b7[_0x7f19('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 5042e7c..a63f21f 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 _0x31ca=['get','index','/describe','describe','isAuthenticated','show','create','put','/:id','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller'];(function(_0x5b8b97,_0x6b4dfa){var _0x1fdf84=function(_0x2ced4c){while(--_0x2ced4c){_0x5b8b97['push'](_0x5b8b97['shift']());}};_0x1fdf84(++_0x6b4dfa);}(_0x31ca,0xd3));var _0xa31c=function(_0x3a2e66,_0x596f35){_0x3a2e66=_0x3a2e66-0x0;var _0x299a13=_0x31ca[_0x3a2e66];return _0x299a13;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa31c('0x0'));var timeout=require(_0xa31c('0x1'));var express=require(_0xa31c('0x2'));var router=express[_0xa31c('0x3')]();var fs_extra=require(_0xa31c('0x4'));var auth=require(_0xa31c('0x5'));var interaction=require(_0xa31c('0x6'));var config=require(_0xa31c('0x7'));var controller=require(_0xa31c('0x8'));router[_0xa31c('0x9')]('/',auth['isAuthenticated'](),controller[_0xa31c('0xa')]);router[_0xa31c('0x9')](_0xa31c('0xb'),auth['isAuthenticated'](),controller[_0xa31c('0xc')]);router[_0xa31c('0x9')]('/:id',auth[_0xa31c('0xd')](),controller[_0xa31c('0xe')]);router['post']('/',auth[_0xa31c('0xd')](),controller[_0xa31c('0xf')]);router[_0xa31c('0x10')](_0xa31c('0x11'),auth[_0xa31c('0xd')](),controller[_0xa31c('0x12')]);module[_0xa31c('0x13')]=router; \ No newline at end of file +var _0xd8fd=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','show','post','create','put','/:id','update'];(function(_0xbe048b,_0x2f8970){var _0x1d9099=function(_0x4920e){while(--_0x4920e){_0xbe048b['push'](_0xbe048b['shift']());}};_0x1d9099(++_0x2f8970);}(_0xd8fd,0x10e));var _0xdd8f=function(_0x5e7f24,_0x7b595){_0x5e7f24=_0x5e7f24-0x0;var _0x11d440=_0xd8fd[_0x5e7f24];return _0x11d440;};'use strict';var multer=require(_0xdd8f('0x0'));var util=require('util');var path=require(_0xdd8f('0x1'));var timeout=require(_0xdd8f('0x2'));var express=require(_0xdd8f('0x3'));var router=express[_0xdd8f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdd8f('0x5'));var interaction=require(_0xdd8f('0x6'));var config=require(_0xdd8f('0x7'));var controller=require('./cmHopperHistory.controller');router[_0xdd8f('0x8')]('/',auth['isAuthenticated'](),controller[_0xdd8f('0x9')]);router[_0xdd8f('0x8')]('/describe',auth[_0xdd8f('0xa')](),controller[_0xdd8f('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdd8f('0xc')]);router[_0xdd8f('0xd')]('/',auth[_0xdd8f('0xa')](),controller[_0xdd8f('0xe')]);router[_0xdd8f('0xf')](_0xdd8f('0x10'),auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 5f2e7d5..93a0d48 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 _0xb2ff=['sequelize','exports','name'];(function(_0x234e1a,_0x500d79){var _0x55aad2=function(_0x272396){while(--_0x272396){_0x234e1a['push'](_0x234e1a['shift']());}};_0x55aad2(++_0x500d79);}(_0xb2ff,0x123));var _0xfb2f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb2ff[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xfb2f('0x0'));module[_0xfb2f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xfb2f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7f3f=['sequelize','exports','name','STRING'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0x7f3f,0x1c8));var _0xf7f3=function(_0x1a13b1,_0x4d1d25){_0x1a13b1=_0x1a13b1-0x0;var _0x395e05=_0x7f3f[_0x1a13b1];return _0x395e05;};'use strict';var Sequelize=require(_0xf7f3('0x0'));module[_0xf7f3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf7f3('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf7f3('0x3')]},'dialPrefix':{'type':Sequelize[_0xf7f3('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index c96c99b..09ff582 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 _0x9a15=['rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','name','filter','merge','includeAll','findAll','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Lists','UserProfileSection','userProfileId','autoAssociation','update','describe','addDisposition','Disposition','getDispositions','findOne','ListId','options','include','rows','removeDispositions','ids','CmContact','tags','isArray','join','push','each','omit','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','raw','ContactItemType','alias','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','customField_','from','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','select','description','description_additionalPhone_','toString','isEmpty','writeFileSync','setHeader','Content-disposition','list_%d_%s.csv','text/csv','/tmp/list_%d_%s.csv','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','switch','BOOLEAN','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','get','UserProfileResource','error','stack','send','index','map','CmList'];(function(_0x3d7257,_0x33d9c8){var _0x503739=function(_0x457f2a){while(--_0x457f2a){_0x3d7257['push'](_0x3d7257['shift']());}};_0x503739(++_0x33d9c8);}(_0x9a15,0x10d));var _0x59a1=function(_0x221736,_0x325ef0){_0x221736=_0x221736-0x0;var _0xfcaca2=_0x9a15[_0x221736];return _0xfcaca2;};'use strict';var emlformat=require(_0x59a1('0x0'));var rimraf=require(_0x59a1('0x1'));var zipdir=require(_0x59a1('0x2'));var jsonpatch=require(_0x59a1('0x3'));var rp=require(_0x59a1('0x4'));var moment=require(_0x59a1('0x5'));var BPromise=require(_0x59a1('0x6'));var Mustache=require(_0x59a1('0x7'));var util=require('util');var path=require(_0x59a1('0x8'));var sox=require(_0x59a1('0x9'));var csv=require(_0x59a1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x59a1('0xb'));var _=require(_0x59a1('0xc'));var squel=require(_0x59a1('0xd'));var crypto=require('crypto');var jsforce=require(_0x59a1('0xe'));var deskjs=require(_0x59a1('0xf'));var toCsv=require('to-csv');var querystring=require(_0x59a1('0x10'));var Papa=require(_0x59a1('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x59a1('0x12'));var as=require(_0x59a1('0x13'));var hardwareService=require(_0x59a1('0x14'));var logger=require(_0x59a1('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x59a1('0x16'));var licenseUtil=require(_0x59a1('0x17'));var db=require(_0x59a1('0x18'))['db'];var csv_results;config[_0x59a1('0x19')]=_[_0x59a1('0x1a')](config[_0x59a1('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x59a1('0x1b'))(new Redis(config['redis']));require(_0x59a1('0x1c'))[_0x59a1('0x1d')](socket);function respondWithStatusCode(_0x438e64,_0x549824){_0x549824=_0x549824||0xcc;return function(_0x58e93f){if(_0x58e93f){return _0x438e64[_0x59a1('0x1e')](_0x549824);}return _0x438e64[_0x59a1('0x1f')](_0x549824)[_0x59a1('0x20')]();};}function respondWithResult(_0x2f6816,_0xdb6bf6){_0xdb6bf6=_0xdb6bf6||0xc8;return function(_0x3782e6){if(_0x3782e6){return _0x2f6816[_0x59a1('0x1f')](_0xdb6bf6)[_0x59a1('0x21')](_0x3782e6);}};}function respondWithFilteredResult(_0xd6413a,_0xa970){return function(_0x25cd3b){if(_0x25cd3b){var _0x5072dd=typeof _0xa970[_0x59a1('0x22')]===_0x59a1('0x23')&&typeof _0xa970[_0x59a1('0x24')]==='undefined';var _0x2afd7d=_0x25cd3b[_0x59a1('0x25')];var _0x2a25cb=_0x5072dd?0x0:_0xa970[_0x59a1('0x22')];var _0x3d8351=_0x5072dd?_0x25cd3b['count']:_0xa970['offset']+_0xa970['limit'];var _0x200ce3;if(_0x3d8351>=_0x2afd7d){_0x3d8351=_0x2afd7d;_0x200ce3=0xc8;}else{_0x200ce3=0xce;}_0xd6413a[_0x59a1('0x1f')](_0x200ce3);return _0xd6413a[_0x59a1('0x26')](_0x59a1('0x27'),_0x2a25cb+'-'+_0x3d8351+'/'+_0x2afd7d)[_0x59a1('0x21')](_0x25cd3b);}return null;};}function patchUpdates(_0x11bbb1){return function(_0x1b4d03){try{jsonpatch['apply'](_0x1b4d03,_0x11bbb1,!![]);}catch(_0x2fc3e2){return BPromise[_0x59a1('0x28')](_0x2fc3e2);}return _0x1b4d03['save']();};}function saveUpdates(_0x15d571,_0x1c3540){return function(_0x25b3ac){if(_0x25b3ac){return _0x25b3ac['update'](_0x15d571)[_0x59a1('0x29')](function(_0x21cd30){return _0x21cd30;});}return null;};}function removeEntity(_0x34e98d,_0x182374){return function(_0x48c976){if(_0x48c976){return _0x48c976[_0x59a1('0x2a')]()[_0x59a1('0x29')](function(){var _0x21d6e9=_0x48c976[_0x59a1('0x2b')]({'plain':!![]});var _0x3c1c29='Lists';return db[_0x59a1('0x2c')][_0x59a1('0x2a')]({'where':{'type':_0x3c1c29,'resourceId':_0x21d6e9['id']}})[_0x59a1('0x29')](function(){return _0x48c976;});})[_0x59a1('0x29')](function(){_0x34e98d['status'](0xcc)[_0x59a1('0x20')]();});}};}function handleEntityNotFound(_0x5e3d8e,_0x1e98aa){return function(_0x4fb8fd){if(!_0x4fb8fd){_0x5e3d8e[_0x59a1('0x1e')](0x194);}return _0x4fb8fd;};}function handleError(_0x5bb8f1,_0x5a879d){_0x5a879d=_0x5a879d||0x1f4;return function(_0x3b7495){logger[_0x59a1('0x2d')](_0x3b7495[_0x59a1('0x2e')]);if(_0x3b7495['name']){delete _0x3b7495['name'];}_0x5bb8f1[_0x59a1('0x1f')](_0x5a879d)[_0x59a1('0x2f')](_0x3b7495);};}exports[_0x59a1('0x30')]=function(_0x38362a,_0xadbd52){var _0x4eef89={},_0x8a81be={},_0x3ae815={'count':0x0,'rows':[]};var _0x248bb8=_[_0x59a1('0x31')](db[_0x59a1('0x32')][_0x59a1('0x33')],function(_0x5fd7a1){return{'name':_0x5fd7a1[_0x59a1('0x34')],'type':_0x5fd7a1[_0x59a1('0x35')][_0x59a1('0x36')]};});_0x8a81be[_0x59a1('0x37')]=_[_0x59a1('0x31')](_0x248bb8,'name');_0x8a81be[_0x59a1('0x38')]=_['keys'](_0x38362a[_0x59a1('0x38')]);_0x8a81be[_0x59a1('0x39')]=_[_0x59a1('0x3a')](_0x8a81be[_0x59a1('0x37')],_0x8a81be[_0x59a1('0x38')]);_0x4eef89[_0x59a1('0x3b')]=_[_0x59a1('0x3a')](_0x8a81be[_0x59a1('0x37')],qs['fields'](_0x38362a[_0x59a1('0x38')][_0x59a1('0x3c')]));_0x4eef89[_0x59a1('0x3b')]=_0x4eef89['attributes'][_0x59a1('0x3d')]?_0x4eef89[_0x59a1('0x3b')]:_0x8a81be[_0x59a1('0x37')];if(!_0x38362a[_0x59a1('0x38')][_0x59a1('0x3e')](_0x59a1('0x3f'))){_0x4eef89[_0x59a1('0x24')]=qs[_0x59a1('0x24')](_0x38362a[_0x59a1('0x38')][_0x59a1('0x24')]);_0x4eef89['offset']=qs[_0x59a1('0x22')](_0x38362a['query'][_0x59a1('0x22')]);}_0x4eef89[_0x59a1('0x40')]=qs[_0x59a1('0x41')](_0x38362a[_0x59a1('0x38')]['sort']);_0x4eef89[_0x59a1('0x42')]=qs[_0x59a1('0x39')](_[_0x59a1('0x43')](_0x38362a[_0x59a1('0x38')],_0x8a81be[_0x59a1('0x39')]),_0x248bb8);if(_0x38362a[_0x59a1('0x38')]['filter']){_0x4eef89[_0x59a1('0x42')]=_['merge'](_0x4eef89['where'],{'$or':_[_0x59a1('0x31')](_0x248bb8,function(_0x43982e){if(_0x43982e[_0x59a1('0x35')]!=='VIRTUAL'){var _0x3aee65={};_0x3aee65[_0x43982e[_0x59a1('0x44')]]={'$like':'%'+_0x38362a['query'][_0x59a1('0x45')]+'%'};return _0x3aee65;}})});}_0x4eef89=_[_0x59a1('0x46')]({},_0x4eef89,_0x38362a['options']);var _0x2d4afd={'where':_0x4eef89['where']};return db['CmList'][_0x59a1('0x25')](_0x2d4afd)[_0x59a1('0x29')](function(_0x524ad5){_0x3ae815[_0x59a1('0x25')]=_0x524ad5;if(_0x38362a[_0x59a1('0x38')][_0x59a1('0x47')]){_0x4eef89['include']=[{'all':!![]}];}return db['CmList'][_0x59a1('0x48')](_0x4eef89);})[_0x59a1('0x29')](function(_0x20521d){_0x3ae815['rows']=_0x20521d;return _0x3ae815;})[_0x59a1('0x29')](respondWithFilteredResult(_0xadbd52,_0x4eef89))[_0x59a1('0x49')](handleError(_0xadbd52,null));};exports[_0x59a1('0x4a')]=function(_0x1c0b63,_0x4e22f9){var _0x3713f6={'raw':![],'where':{'id':_0x1c0b63[_0x59a1('0x4b')]['id']}},_0x2d06a2={};_0x2d06a2[_0x59a1('0x37')]=_['keys'](db['CmList'][_0x59a1('0x33')]);_0x2d06a2['query']=_[_0x59a1('0x4c')](_0x1c0b63[_0x59a1('0x38')]);_0x2d06a2[_0x59a1('0x39')]=_[_0x59a1('0x3a')](_0x2d06a2[_0x59a1('0x37')],_0x2d06a2['query']);_0x3713f6[_0x59a1('0x3b')]=_[_0x59a1('0x3a')](_0x2d06a2['model'],qs[_0x59a1('0x3c')](_0x1c0b63[_0x59a1('0x38')][_0x59a1('0x3c')]));_0x3713f6[_0x59a1('0x3b')]=_0x3713f6[_0x59a1('0x3b')][_0x59a1('0x3d')]?_0x3713f6[_0x59a1('0x3b')]:_0x2d06a2['model'];if(_0x1c0b63[_0x59a1('0x38')][_0x59a1('0x47')]){_0x3713f6['include']=[{'all':!![]}];}_0x3713f6=_[_0x59a1('0x46')]({},_0x3713f6,_0x1c0b63['options']);return db[_0x59a1('0x32')][_0x59a1('0x4d')](_0x3713f6)[_0x59a1('0x29')](handleEntityNotFound(_0x4e22f9,null))[_0x59a1('0x29')](respondWithResult(_0x4e22f9,null))[_0x59a1('0x49')](handleError(_0x4e22f9,null));};exports[_0x59a1('0x4e')]=function(_0x503885,_0xec9ffa){return db['CmList'][_0x59a1('0x4e')](_0x503885[_0x59a1('0x4f')],{})[_0x59a1('0x29')](function(_0x4c1d56){var _0x1c76a2=_0x503885['user']['get']({'plain':!![]});if(!_0x1c76a2)throw new Error(_0x59a1('0x50'));if(_0x1c76a2[_0x59a1('0x51')]===_0x59a1('0x52')){var _0x128662=_0x4c1d56[_0x59a1('0x2b')]({'plain':!![]});var _0x161761=_0x59a1('0x53');return db[_0x59a1('0x54')][_0x59a1('0x4d')]({'where':{'name':_0x161761,'userProfileId':_0x1c76a2[_0x59a1('0x55')]},'raw':!![]})[_0x59a1('0x29')](function(_0x398f1d){if(_0x398f1d&&_0x398f1d[_0x59a1('0x56')]===0x0){return db[_0x59a1('0x2c')][_0x59a1('0x4e')]({'name':_0x128662[_0x59a1('0x44')],'resourceId':_0x128662['id'],'type':_0x398f1d[_0x59a1('0x44')],'sectionId':_0x398f1d['id']},{})[_0x59a1('0x29')](function(){return _0x4c1d56;});}else{return _0x4c1d56;}})['catch'](function(_0x2c4c48){logger[_0x59a1('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c4c48);throw _0x2c4c48;});}return _0x4c1d56;})['then'](respondWithResult(_0xec9ffa,0xc9))['catch'](handleError(_0xec9ffa,null));};exports[_0x59a1('0x57')]=function(_0x80427e,_0x403c7f){if(_0x80427e[_0x59a1('0x4f')]['id']){delete _0x80427e[_0x59a1('0x4f')]['id'];}return db['CmList'][_0x59a1('0x4d')]({'where':{'id':_0x80427e[_0x59a1('0x4b')]['id']}})[_0x59a1('0x29')](handleEntityNotFound(_0x403c7f,null))[_0x59a1('0x29')](saveUpdates(_0x80427e[_0x59a1('0x4f')],null))['then'](respondWithResult(_0x403c7f,null))[_0x59a1('0x49')](handleError(_0x403c7f,null));};exports['destroy']=function(_0x295b05,_0x3055ca){return db[_0x59a1('0x32')][_0x59a1('0x4d')]({'where':{'id':_0x295b05[_0x59a1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3055ca,null))[_0x59a1('0x29')](removeEntity(_0x3055ca,null))['catch'](handleError(_0x3055ca,null));};exports['describe']=function(_0x5f0f57,_0x205915){return db[_0x59a1('0x32')][_0x59a1('0x58')]()[_0x59a1('0x29')](respondWithResult(_0x205915,null))[_0x59a1('0x49')](handleError(_0x205915,null));};exports[_0x59a1('0x59')]=function(_0x463d76,_0x41e35a,_0x5c0937){if(_0x463d76[_0x59a1('0x4f')]['id']){delete _0x463d76[_0x59a1('0x4f')]['id'];}return db[_0x59a1('0x32')]['find']({'where':{'id':_0x463d76[_0x59a1('0x4b')]['id']}})[_0x59a1('0x29')](handleEntityNotFound(_0x41e35a,null))[_0x59a1('0x29')](function(_0x3d3602){if(_0x3d3602){_0x463d76[_0x59a1('0x4f')]['ListId']=_0x3d3602['id'];return db[_0x59a1('0x5a')][_0x59a1('0x4e')](_0x463d76[_0x59a1('0x4f')]);}})['then'](respondWithResult(_0x41e35a,null))[_0x59a1('0x49')](handleError(_0x41e35a,null));};exports[_0x59a1('0x5b')]=function(_0x4383ed,_0x480b9c,_0x4717f9){var _0x4cfc46={'raw':![],'where':{}};var _0x44d257={};var _0x208e90={'count':0x0,'rows':[]};return db['CmList'][_0x59a1('0x5c')]({'where':{'id':_0x4383ed[_0x59a1('0x4b')]['id']}})[_0x59a1('0x29')](handleEntityNotFound(_0x480b9c,null))['then'](function(_0x299454){if(_0x299454){_0x44d257['model']=_[_0x59a1('0x4c')](db[_0x59a1('0x5a')][_0x59a1('0x33')]);_0x44d257[_0x59a1('0x38')]=_['keys'](_0x4383ed[_0x59a1('0x38')]);_0x44d257[_0x59a1('0x39')]=_['intersection'](_0x44d257[_0x59a1('0x37')],_0x44d257[_0x59a1('0x38')]);_0x4cfc46[_0x59a1('0x3b')]=_[_0x59a1('0x3a')](_0x44d257[_0x59a1('0x37')],qs[_0x59a1('0x3c')](_0x4383ed[_0x59a1('0x38')][_0x59a1('0x3c')]));_0x4cfc46[_0x59a1('0x3b')]=_0x4cfc46[_0x59a1('0x3b')][_0x59a1('0x3d')]?_0x4cfc46[_0x59a1('0x3b')]:_0x44d257['model'];if(!_0x4383ed['query']['hasOwnProperty'](_0x59a1('0x3f'))){_0x4cfc46['limit']=qs[_0x59a1('0x24')](_0x4383ed[_0x59a1('0x38')][_0x59a1('0x24')]);_0x4cfc46['offset']=qs[_0x59a1('0x22')](_0x4383ed[_0x59a1('0x38')][_0x59a1('0x22')]);}_0x4cfc46[_0x59a1('0x40')]=qs[_0x59a1('0x41')](_0x4383ed[_0x59a1('0x38')][_0x59a1('0x41')]);_0x4cfc46[_0x59a1('0x42')]=qs[_0x59a1('0x39')](_[_0x59a1('0x43')](_0x4383ed[_0x59a1('0x38')],_0x44d257[_0x59a1('0x39')]));_0x4cfc46[_0x59a1('0x42')][_0x59a1('0x5d')]=_0x299454['id'];if(_0x4383ed['query'][_0x59a1('0x45')]){_0x4cfc46[_0x59a1('0x42')]=_[_0x59a1('0x46')](_0x4cfc46[_0x59a1('0x42')],{'$or':_[_0x59a1('0x31')](_0x4cfc46[_0x59a1('0x3b')],function(_0x25176a){var _0x5a5359={};_0x5a5359[_0x25176a]={'$like':'%'+_0x4383ed[_0x59a1('0x38')]['filter']+'%'};return _0x5a5359;})});}_0x4cfc46=_[_0x59a1('0x46')]({},_0x4cfc46,_0x4383ed[_0x59a1('0x5e')]);return db[_0x59a1('0x5a')][_0x59a1('0x25')]({'where':_0x4cfc46['where']})[_0x59a1('0x29')](function(_0x3a43f8){_0x208e90[_0x59a1('0x25')]=_0x3a43f8;if(_0x4383ed[_0x59a1('0x38')][_0x59a1('0x47')]){_0x4cfc46[_0x59a1('0x5f')]=[{'all':!![]}];}return db['Disposition'][_0x59a1('0x48')](_0x4cfc46);})[_0x59a1('0x29')](function(_0x4a74b0){_0x208e90[_0x59a1('0x60')]=_0x4a74b0;return _0x208e90;});}})[_0x59a1('0x29')](respondWithFilteredResult(_0x480b9c,_0x4cfc46))['catch'](handleError(_0x480b9c,null));};exports[_0x59a1('0x61')]=function(_0x350465,_0x254856,_0x54fece){return db[_0x59a1('0x32')][_0x59a1('0x4d')]({'where':{'id':_0x350465['params']['id']}})[_0x59a1('0x29')](handleEntityNotFound(_0x254856,null))['then'](function(_0x47844b){if(_0x47844b){return _0x47844b[_0x59a1('0x61')](_0x350465[_0x59a1('0x38')][_0x59a1('0x62')]);}})[_0x59a1('0x29')](respondWithStatusCode(_0x254856,null))['catch'](handleError(_0x254856,null));};exports['addContacts']=function(_0x4fe7f7,_0x5c2100,_0x505e99){return db['CmList'][_0x59a1('0x4d')]({'where':{'id':_0x4fe7f7['params']['id']}})[_0x59a1('0x29')](handleEntityNotFound(_0x5c2100,null))[_0x59a1('0x29')](function(_0x193fc5){if(_0x193fc5){var _0x414804=[];var _0x30486a={'success':[],'errors':[]};return db[_0x59a1('0x63')]['describe']()[_0x59a1('0x29')](function(_0x3da82a){if(_0x4fe7f7[_0x59a1('0x4f')][_0x59a1('0x64')]&&_[_0x59a1('0x65')](_0x4fe7f7[_0x59a1('0x4f')][_0x59a1('0x64')])){if(_0x4fe7f7[_0x59a1('0x4f')][_0x59a1('0x64')][_0x59a1('0x3d')]){_0x4fe7f7[_0x59a1('0x4f')][_0x59a1('0x64')]=_0x4fe7f7[_0x59a1('0x4f')]['tags'][_0x59a1('0x66')](';')+';';}else{_0x4fe7f7[_0x59a1('0x4f')]['tags']=null;}}else{_0x4fe7f7[_0x59a1('0x4f')][_0x59a1('0x64')]=null;}if(_0x4fe7f7[_0x59a1('0x4f')]&&_[_0x59a1('0x65')](_0x4fe7f7['body'])){for(var _0x3acf57=0x0;_0x3acf57<_0x4fe7f7[_0x59a1('0x4f')][_0x59a1('0x3d')];_0x3acf57+=0x1){_0x4fe7f7[_0x59a1('0x4f')][_0x3acf57][_0x59a1('0x5d')]=_0x4fe7f7['params']['id'];_0x414804[_0x59a1('0x67')](_0x4fe7f7['body'][_0x3acf57]);}return BPromise[_0x59a1('0x68')](_0x414804,function(_0x4b95ef){return db[_0x59a1('0x63')][_0x59a1('0x4e')](_[_0x59a1('0x69')](_0x4b95ef,[_0x59a1('0x62'),'id'])||{},{'fields':_[_0x59a1('0x4c')](_0x3da82a),'raw':!![]})[_0x59a1('0x29')](function(_0x323e03){_0x30486a['success'][_0x59a1('0x67')](_0x323e03[_0x59a1('0x6a')]);})[_0x59a1('0x49')](function(_0x5a1f8e){_0x30486a[_0x59a1('0x6b')][_0x59a1('0x67')]({'data':_0x4b95ef,'error':_0x5a1f8e[_0x59a1('0x6c')]});});})['then'](function(_0xf29865){return _0x30486a;})[_0x59a1('0x49')](function(_0x442d55){return _0x442d55;});}else{_0x5c2100[_0x59a1('0x1f')](0x190)[_0x59a1('0x21')]({'message':_0x59a1('0x6d')});}});}})[_0x59a1('0x29')](respondWithResult(_0x5c2100,null))['catch'](handleError(_0x5c2100,null));};exports[_0x59a1('0x6e')]=function(_0x28cf5e,_0x25da3d,_0x33817f){var _0x3a8513;return db[_0x59a1('0x32')][_0x59a1('0x4d')]({'where':{'id':_0x28cf5e[_0x59a1('0x4b')]['id']},'include':[{'model':db[_0x59a1('0x6f')],'as':_0x59a1('0x70')}]})['then'](handleEntityNotFound(_0x25da3d,null))[_0x59a1('0x29')](function(_0x2a0f22){if(_0x2a0f22){_0x3a8513=_0x2a0f22;return db[_0x59a1('0x63')][_0x59a1('0x33')];}})[_0x59a1('0x29')](function(_0x383450){if(_0x383450){var _0x255c8f={};var _0x1aefca={};_0x1aefca['model']=_[_0x59a1('0x71')](_['keys'](_0x383450),_['map'](_0x3a8513[_0x59a1('0x70')],function(_0x4ba053){return util[_0x59a1('0x72')]('cf_%d',_0x4ba053['id']);}));_0x1aefca[_0x59a1('0x38')]=_[_0x59a1('0x4c')](_0x28cf5e[_0x59a1('0x38')]);_0x1aefca[_0x59a1('0x39')]=_[_0x59a1('0x3a')](_0x1aefca[_0x59a1('0x37')],_0x1aefca[_0x59a1('0x38')]);_0x255c8f[_0x59a1('0x3b')]=_['intersection'](_0x1aefca['model'],qs[_0x59a1('0x3c')](_0x28cf5e[_0x59a1('0x38')][_0x59a1('0x3c')]));_0x255c8f[_0x59a1('0x3b')]=_0x255c8f[_0x59a1('0x3b')][_0x59a1('0x3d')]?_0x255c8f[_0x59a1('0x3b')]:_0x1aefca[_0x59a1('0x37')];if(!_0x28cf5e[_0x59a1('0x38')][_0x59a1('0x3e')](_0x59a1('0x3f'))){_0x255c8f['limit']=qs[_0x59a1('0x24')](_0x28cf5e[_0x59a1('0x38')]['limit']);_0x255c8f[_0x59a1('0x22')]=qs[_0x59a1('0x22')](_0x28cf5e[_0x59a1('0x38')][_0x59a1('0x22')]);}_0x255c8f['order']=qs[_0x59a1('0x41')](_0x28cf5e[_0x59a1('0x38')][_0x59a1('0x41')]);_0x255c8f[_0x59a1('0x42')]=qs['filters'](_[_0x59a1('0x43')](_0x28cf5e[_0x59a1('0x38')],_0x1aefca[_0x59a1('0x39')]));_0x255c8f[_0x59a1('0x73')]=!![];if(_0x28cf5e['query'][_0x59a1('0x45')]){_0x255c8f[_0x59a1('0x42')]=_[_0x59a1('0x46')](_0x255c8f['where'],{'$or':_['map'](_0x255c8f['attributes'],function(_0x5cd808){var _0x27fd95={};_0x27fd95[_0x5cd808]={'$like':'%'+_0x28cf5e[_0x59a1('0x38')][_0x59a1('0x45')]+'%'};return _0x27fd95;})});}_0x255c8f=_[_0x59a1('0x46')]({},_0x255c8f,_0x28cf5e[_0x59a1('0x5e')]);return _0x3a8513[_0x59a1('0x6e')](_0x255c8f);}})['then'](respondWithResult(_0x25da3d,null))[_0x59a1('0x49')](handleError(_0x25da3d,null));};exports['getContactsCsv']=function(_0x231a59,_0x3df60c,_0x4be956){var _0x5ab831;var _0x5a4217;var _0x535691;var _0x452fd6=_0x231a59[_0x59a1('0x4b')]['id'];csv_results=[];return db[_0x59a1('0x74')]['findAll']({'attributes':['id',_0x59a1('0x44')],'raw':!![],'order':['OrderBy']})[_0x59a1('0x29')](function(_0x103501){_0x5ab831=_0x103501;var _0x31e541=_[_0x59a1('0x4c')](db['CmContact']['rawAttributes']);return db[_0x59a1('0x6f')][_0x59a1('0x48')]({'raw':!![],'attributes':['id',_0x59a1('0x75')]})[_0x59a1('0x29')](function(_0x573f4c){_0x5a4217=_0x573f4c;var _0x37547b=squel['select']()['fields'](_0x31e541)['from'](_0x59a1('0x76'),'c')['where'](_0x59a1('0x77'),_0x452fd6)[_0x59a1('0x42')]('c.deletedAt\x20is\x20null')[_0x59a1('0x78')]();for(var _0x40868e=0x0;_0x40868e<_0x5a4217[_0x59a1('0x3d')];_0x40868e++){_0x37547b[_0x59a1('0x79')](_0x59a1('0x7a')+_0x5a4217[_0x40868e]['id'],_0x59a1('0x7b')+_0x5a4217[_0x40868e][_0x59a1('0x75')]);}for(var _0x40868e=0x0;_0x40868e<_0x5ab831[_0x59a1('0x3d')];_0x40868e++){_0x37547b[_0x59a1('0x79')](squel['select']()[_0x59a1('0x79')]('item')[_0x59a1('0x7c')](_0x59a1('0x7d'))[_0x59a1('0x42')](_0x59a1('0x7e'),_0x5ab831[_0x40868e]['id'])['where'](_0x59a1('0x7f')),'additionalPhone_'+_0x5ab831[_0x40868e][_0x59a1('0x44')]);_0x37547b['field'](squel[_0x59a1('0x80')]()['field'](_0x59a1('0x81'))[_0x59a1('0x7c')]('cm_contact_has_items')[_0x59a1('0x42')](_0x59a1('0x7e'),_0x5ab831[_0x40868e]['id'])[_0x59a1('0x42')](_0x59a1('0x7f')),_0x59a1('0x82')+_0x5ab831[_0x40868e][_0x59a1('0x44')]);}var _0x13919b=[];_0x13919b['push'](_0x37547b[_0x59a1('0x83')]());BPromise[_0x59a1('0x68')](_0x13919b,handleQuery)[_0x59a1('0x29')](function(_0x5d81a3){handleQuery(_0x37547b['toString']());var _0x1a0d14=csv_results[0x0];if(!_[_0x59a1('0x84')](_0x1a0d14)){var _0x6eb184=toCsv(_0x1a0d14);var _0x14e4cd=Date['now']();fs[_0x59a1('0x85')](util[_0x59a1('0x72')]('/tmp/list_%d_%s.csv',_0x452fd6,_0x14e4cd),_0x6eb184);_0x3df60c[_0x59a1('0x86')](_0x59a1('0x87'),'attachment;\x20filename='+util['format'](_0x59a1('0x88'),_0x452fd6,_0x14e4cd));_0x3df60c[_0x59a1('0x86')]('Content-type',_0x59a1('0x89'));return _0x3df60c['download'](util['format'](_0x59a1('0x8a'),_0x452fd6,_0x14e4cd));}else{return _0x3df60c['sendStatus'](0xcc);}});});});};exports['addCustomField']=function(_0x2e05d0,_0x448784,_0x41fe6b){var _0x15fc3b;delete _0x2e05d0[_0x59a1('0x4f')]['id'];return db['CmList']['findOne']({'where':{'id':_0x2e05d0[_0x59a1('0x4b')]['id']}})[_0x59a1('0x29')](handleEntityNotFound(_0x448784,null))['then'](function(_0x1acbba){if(_0x1acbba){return db[_0x59a1('0x8b')][_0x59a1('0x8c')](function(_0x436a2d){return db['CmCustomField']['create'](_0x2e05d0['body'],{'transaction':_0x436a2d})[_0x59a1('0x29')](function(_0x54d8e7){_0x15fc3b=_0x54d8e7;return _0x1acbba[_0x59a1('0x8d')](_0x54d8e7,{'transaction':_0x436a2d});})['then'](function(){var _0xd2359e={'type':db['Sequelize'][_0x59a1('0x8e')],'transaction':_0x436a2d};switch(_0x2e05d0[_0x59a1('0x4f')]['type']){case _0x59a1('0x8f'):_0xd2359e[_0x59a1('0x35')]=db[_0x59a1('0x90')][_0x59a1('0x8e')];break;case _0x59a1('0x91'):_0xd2359e[_0x59a1('0x35')]=db[_0x59a1('0x90')]['INTEGER'];break;case _0x59a1('0x92'):_0xd2359e[_0x59a1('0x35')]=db[_0x59a1('0x90')][_0x59a1('0x93')];_0xd2359e['defaultValue']=![];break;default:}return db[_0x59a1('0x8b')]['queryInterface'][_0x59a1('0x94')]('cm_contacts',util[_0x59a1('0x72')](_0x59a1('0x95'),_0x15fc3b['id']),_0xd2359e);})['then'](function(){return _0x15fc3b;});});}})['then'](respondWithResult(_0x448784,null))['catch'](handleError(_0x448784,null));};exports[_0x59a1('0x96')]=function(_0x1060a5,_0xe2997d,_0x5c22bf){var _0x48ccf6={};var _0x3f3863={};var _0x13b088;var _0x59a735;return db[_0x59a1('0x32')]['findOne']({'where':{'id':_0x1060a5['params']['id']}})[_0x59a1('0x29')](handleEntityNotFound(_0xe2997d,null))[_0x59a1('0x29')](function(_0x4c682a){if(_0x4c682a){_0x13b088=_0x4c682a;_0x3f3863[_0x59a1('0x37')]=_[_0x59a1('0x4c')](db[_0x59a1('0x6f')]['rawAttributes']);_0x3f3863[_0x59a1('0x38')]=_['keys'](_0x1060a5[_0x59a1('0x38')]);_0x3f3863[_0x59a1('0x39')]=_[_0x59a1('0x3a')](_0x3f3863[_0x59a1('0x37')],_0x3f3863[_0x59a1('0x38')]);_0x48ccf6[_0x59a1('0x3b')]=_[_0x59a1('0x3a')](_0x3f3863['model'],qs[_0x59a1('0x3c')](_0x1060a5['query']['fields']));_0x48ccf6[_0x59a1('0x3b')]=_0x48ccf6[_0x59a1('0x3b')][_0x59a1('0x3d')]?_0x48ccf6['attributes']:_0x3f3863[_0x59a1('0x37')];_0x48ccf6[_0x59a1('0x40')]=qs[_0x59a1('0x41')](_0x1060a5[_0x59a1('0x38')][_0x59a1('0x41')]);_0x48ccf6[_0x59a1('0x42')]=qs[_0x59a1('0x39')](_[_0x59a1('0x43')](_0x1060a5[_0x59a1('0x38')],_0x3f3863[_0x59a1('0x39')]));_0x48ccf6[_0x59a1('0x42')]=_[_0x59a1('0x46')](_0x48ccf6[_0x59a1('0x42')],{'$or':[{'ListId':_0x4c682a['id']},{'ListId':null}]});if(_0x1060a5['query'][_0x59a1('0x45')]){_0x48ccf6['where']=_['merge'](_0x48ccf6[_0x59a1('0x42')],{'$or':_['map'](_0x48ccf6[_0x59a1('0x3b')],function(_0x2aa0fd){var _0x24c844={};_0x24c844[_0x2aa0fd]={'$like':'%'+_0x1060a5['query']['filter']+'%'};return _0x24c844;})});}_0x48ccf6=_[_0x59a1('0x46')]({},_0x48ccf6,_0x1060a5[_0x59a1('0x5e')]);return db[_0x59a1('0x6f')][_0x59a1('0x97')](_0x48ccf6);}})[_0x59a1('0x29')](respondWithResult(_0xe2997d,null))[_0x59a1('0x49')](handleError(_0xe2997d,null));};exports['getGlobalCustomFields']=function(_0x1c6876,_0x434a49){return db['CmCustomField'][_0x59a1('0x97')]({'where':{'ListId':null}})[_0x59a1('0x29')](handleEntityNotFound(_0x434a49,null))[_0x59a1('0x29')](function(_0x1bc558){return _0x1bc558;})['then'](respondWithResult(_0x434a49,null))[_0x59a1('0x49')](handleError(_0x434a49,null));};exports[_0x59a1('0x98')]=function(_0x49e7b8,_0x35a379,_0x1d8dfa){return db[_0x59a1('0x32')][_0x59a1('0x4d')]({'where':{'id':_0x49e7b8['params']['id']}})['then'](handleEntityNotFound(_0x35a379,null))[_0x59a1('0x29')](function(_0x166105){if(_0x166105){return _0x166105['addAgents'](_0x49e7b8['body'][_0x59a1('0x62')],_[_0x59a1('0x69')](_0x49e7b8['body'],[_0x59a1('0x62'),'id'])||{})['spread'](function(_0x28207f){for(var _0x5edf91=0x0;_0x5edf91<_0x49e7b8[_0x59a1('0x4f')][_0x59a1('0x62')][_0x59a1('0x3d')];_0x5edf91+=0x1){socket[_0x59a1('0x99')](_0x59a1('0x9a'),{'UserId':Number(_0x49e7b8['body']['ids'][_0x5edf91]),'CmListId':Number(_0x49e7b8[_0x59a1('0x4b')]['id'])});}return _0x28207f;});}})[_0x59a1('0x29')](respondWithResult(_0x35a379,null))[_0x59a1('0x49')](handleError(_0x35a379,null));};exports[_0x59a1('0x9b')]=function(_0xdf865b,_0xb5db56,_0x494f79){return db[_0x59a1('0x32')]['find']({'where':{'id':_0xdf865b[_0x59a1('0x4b')]['id']}})[_0x59a1('0x29')](handleEntityNotFound(_0xb5db56,null))[_0x59a1('0x29')](function(_0x55c8f5){if(_0x55c8f5){return _0x55c8f5[_0x59a1('0x9b')](_0xdf865b[_0x59a1('0x38')]['ids'])[_0x59a1('0x29')](function(){if(_[_0x59a1('0x65')](_0xdf865b['query'][_0x59a1('0x62')])){for(var _0x4b1c72=0x0;_0x4b1c72<_0xdf865b[_0x59a1('0x38')][_0x59a1('0x62')][_0x59a1('0x3d')];_0x4b1c72+=0x1){socket['emit'](_0x59a1('0x9c'),{'UserId':Number(_0xdf865b[_0x59a1('0x38')][_0x59a1('0x62')][_0x4b1c72]),'CmListId':Number(_0xdf865b[_0x59a1('0x4b')]['id'])});}}else{socket[_0x59a1('0x99')](_0x59a1('0x9c'),{'UserId':Number(_0xdf865b[_0x59a1('0x38')]['ids']),'CmListId':Number(_0xdf865b[_0x59a1('0x4b')]['id'])});}});}})[_0x59a1('0x29')](respondWithStatusCode(_0xb5db56,null))['catch'](handleError(_0xb5db56,null));};exports[_0x59a1('0x9d')]=function(_0x29127b,_0x153c45,_0x169f83){var _0x38ed2c={};var _0x2afd3={};var _0x246db8;var _0x317dca;return db[_0x59a1('0x32')][_0x59a1('0x5c')]({'where':{'id':_0x29127b[_0x59a1('0x4b')]['id']}})[_0x59a1('0x29')](handleEntityNotFound(_0x153c45,null))['then'](function(_0x140722){if(_0x140722){_0x246db8=_0x140722;_0x2afd3[_0x59a1('0x37')]=_[_0x59a1('0x4c')](db[_0x59a1('0x9e')][_0x59a1('0x33')]);_0x2afd3[_0x59a1('0x38')]=_[_0x59a1('0x4c')](_0x29127b[_0x59a1('0x38')]);_0x2afd3[_0x59a1('0x39')]=_['intersection'](_0x2afd3[_0x59a1('0x37')],_0x2afd3[_0x59a1('0x38')]);_0x38ed2c['attributes']=_[_0x59a1('0x3a')](_0x2afd3[_0x59a1('0x37')],qs['fields'](_0x29127b[_0x59a1('0x38')][_0x59a1('0x3c')]));_0x38ed2c[_0x59a1('0x3b')]=_0x38ed2c[_0x59a1('0x3b')]['length']?_0x38ed2c[_0x59a1('0x3b')]:_0x2afd3['model'];_0x38ed2c[_0x59a1('0x40')]=qs[_0x59a1('0x41')](_0x29127b[_0x59a1('0x38')][_0x59a1('0x41')]);_0x38ed2c[_0x59a1('0x42')]=qs[_0x59a1('0x39')](_[_0x59a1('0x43')](_0x29127b['query'],_0x2afd3[_0x59a1('0x39')]));if(_0x29127b[_0x59a1('0x38')][_0x59a1('0x45')]){_0x38ed2c[_0x59a1('0x42')]=_['merge'](_0x38ed2c['where'],{'$or':_['map'](_0x38ed2c[_0x59a1('0x3b')],function(_0x39b078){var _0x473d13={};_0x473d13[_0x39b078]={'$like':'%'+_0x29127b[_0x59a1('0x38')][_0x59a1('0x45')]+'%'};return _0x473d13;})});}_0x38ed2c=_[_0x59a1('0x46')]({},_0x38ed2c,_0x29127b[_0x59a1('0x5e')]);return _0x246db8['getAgents'](_0x38ed2c);}})[_0x59a1('0x29')](function(_0x12a556){if(_0x12a556){_0x317dca=_0x12a556[_0x59a1('0x3d')];if(!_0x29127b[_0x59a1('0x38')][_0x59a1('0x3e')]('nolimit')){_0x38ed2c[_0x59a1('0x24')]=qs[_0x59a1('0x24')](_0x29127b[_0x59a1('0x38')][_0x59a1('0x24')]);_0x38ed2c['offset']=qs[_0x59a1('0x22')](_0x29127b[_0x59a1('0x38')][_0x59a1('0x22')]);}return _0x246db8[_0x59a1('0x9d')](_0x38ed2c);}})[_0x59a1('0x29')](function(_0x4a1b5d){if(_0x4a1b5d){return _0x4a1b5d?{'count':_0x317dca,'rows':_0x4a1b5d}:null;}})['then'](respondWithResult(_0x153c45,null))['catch'](handleError(_0x153c45,null));};function handleQuery(_0x1129f5){logger[_0x59a1('0x9f')](_0x1129f5);return db['sequelize'][_0x59a1('0x38')](_0x1129f5)['spread'](function(_0x45cf44){csv_results[_0x59a1('0x67')](_0x45cf44);})['catch'](function(_0x78df12){logger[_0x59a1('0x2d')](_0x78df12[_0x59a1('0x6c')]);});} \ No newline at end of file +var _0x1332=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','CmList','includeAll','include','findAll','rows','catch','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','getDispositions','findOne','Disposition','ListId','options','removeDispositions','CmContact','tags','isArray','push','dataValues','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','raw','getContactsCsv','ContactItemType','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','isEmpty','now','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','download','addCustomField','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','ids','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','message','eml-format','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','register','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Lists','stack','name','index','map','rawAttributes','fieldName','model','keys','filters','intersection','query'];(function(_0x2c0dc2,_0x184844){var _0x592355=function(_0xd65a05){while(--_0xd65a05){_0x2c0dc2['push'](_0x2c0dc2['shift']());}};_0x592355(++_0x184844);}(_0x1332,0x1ab));var _0x2133=function(_0x260615,_0x1732a3){_0x260615=_0x260615-0x0;var _0x57a018=_0x1332[_0x260615];return _0x57a018;};'use strict';var emlformat=require(_0x2133('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2133('0x1'));var rp=require(_0x2133('0x2'));var moment=require('moment');var BPromise=require(_0x2133('0x3'));var Mustache=require('mustache');var util=require(_0x2133('0x4'));var path=require(_0x2133('0x5'));var sox=require('sox');var csv=require(_0x2133('0x6'));var ejs=require(_0x2133('0x7'));var fs=require('fs');var fs_extra=require(_0x2133('0x8'));var _=require(_0x2133('0x9'));var squel=require(_0x2133('0xa'));var crypto=require(_0x2133('0xb'));var jsforce=require(_0x2133('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2133('0x6'));var querystring=require(_0x2133('0xd'));var Papa=require(_0x2133('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2133('0xf'));var as=require(_0x2133('0x10'));var hardwareService=require(_0x2133('0x11'));var logger=require(_0x2133('0x12'))(_0x2133('0x13'));var utils=require(_0x2133('0x14'));var config=require(_0x2133('0x15'));var licenseUtil=require(_0x2133('0x16'));var db=require(_0x2133('0x17'))['db'];var csv_results;config['redis']=_[_0x2133('0x18')](config[_0x2133('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2133('0x19')]));require('./cmList.socket')[_0x2133('0x1a')](socket);function respondWithStatusCode(_0x538aea,_0x2bdff3){_0x2bdff3=_0x2bdff3||0xcc;return function(_0x229422){if(_0x229422){return _0x538aea[_0x2133('0x1b')](_0x2bdff3);}return _0x538aea[_0x2133('0x1c')](_0x2bdff3)[_0x2133('0x1d')]();};}function respondWithResult(_0x535d4d,_0x2f75a4){_0x2f75a4=_0x2f75a4||0xc8;return function(_0x223b5b){if(_0x223b5b){return _0x535d4d[_0x2133('0x1c')](_0x2f75a4)[_0x2133('0x1e')](_0x223b5b);}};}function respondWithFilteredResult(_0x2d9328,_0x87ca2c){return function(_0x581522){if(_0x581522){var _0x107831=typeof _0x87ca2c['offset']===_0x2133('0x1f')&&typeof _0x87ca2c[_0x2133('0x20')]===_0x2133('0x1f');var _0xf86eb9=_0x581522['count'];var _0x5b5c48=_0x107831?0x0:_0x87ca2c[_0x2133('0x21')];var _0x1b0d42=_0x107831?_0x581522[_0x2133('0x22')]:_0x87ca2c[_0x2133('0x21')]+_0x87ca2c[_0x2133('0x20')];var _0x49503f;if(_0x1b0d42>=_0xf86eb9){_0x1b0d42=_0xf86eb9;_0x49503f=0xc8;}else{_0x49503f=0xce;}_0x2d9328[_0x2133('0x1c')](_0x49503f);return _0x2d9328[_0x2133('0x23')](_0x2133('0x24'),_0x5b5c48+'-'+_0x1b0d42+'/'+_0xf86eb9)[_0x2133('0x1e')](_0x581522);}return null;};}function patchUpdates(_0x350ac2){return function(_0x3795d4){try{jsonpatch[_0x2133('0x25')](_0x3795d4,_0x350ac2,!![]);}catch(_0x5e8993){return BPromise[_0x2133('0x26')](_0x5e8993);}return _0x3795d4[_0x2133('0x27')]();};}function saveUpdates(_0x53d905,_0x1ea2aa){return function(_0x2e1cd8){if(_0x2e1cd8){return _0x2e1cd8[_0x2133('0x28')](_0x53d905)[_0x2133('0x29')](function(_0x5aa04b){return _0x5aa04b;});}return null;};}function removeEntity(_0x47caad,_0x3115c1){return function(_0x11fa05){if(_0x11fa05){return _0x11fa05[_0x2133('0x2a')]()[_0x2133('0x29')](function(){var _0x5f006f=_0x11fa05[_0x2133('0x2b')]({'plain':!![]});var _0x5ca8d8=_0x2133('0x2c');return db['UserProfileResource'][_0x2133('0x2a')]({'where':{'type':_0x5ca8d8,'resourceId':_0x5f006f['id']}})[_0x2133('0x29')](function(){return _0x11fa05;});})[_0x2133('0x29')](function(){_0x47caad[_0x2133('0x1c')](0xcc)[_0x2133('0x1d')]();});}};}function handleEntityNotFound(_0x5e3b9b,_0x4b6433){return function(_0x11a700){if(!_0x11a700){_0x5e3b9b['sendStatus'](0x194);}return _0x11a700;};}function handleError(_0x3dec1e,_0x182a05){_0x182a05=_0x182a05||0x1f4;return function(_0x1348c4){logger['error'](_0x1348c4[_0x2133('0x2d')]);if(_0x1348c4[_0x2133('0x2e')]){delete _0x1348c4[_0x2133('0x2e')];}_0x3dec1e[_0x2133('0x1c')](_0x182a05)['send'](_0x1348c4);};}exports[_0x2133('0x2f')]=function(_0x2077d5,_0x57f8ca){var _0x5a0716={},_0x352d4f={},_0x5e2824={'count':0x0,'rows':[]};var _0x3ab319=_[_0x2133('0x30')](db['CmList'][_0x2133('0x31')],function(_0x4d25a6){return{'name':_0x4d25a6[_0x2133('0x32')],'type':_0x4d25a6['type']['key']};});_0x352d4f[_0x2133('0x33')]=_[_0x2133('0x30')](_0x3ab319,'name');_0x352d4f['query']=_[_0x2133('0x34')](_0x2077d5['query']);_0x352d4f[_0x2133('0x35')]=_[_0x2133('0x36')](_0x352d4f[_0x2133('0x33')],_0x352d4f[_0x2133('0x37')]);_0x5a0716[_0x2133('0x38')]=_[_0x2133('0x36')](_0x352d4f[_0x2133('0x33')],qs['fields'](_0x2077d5[_0x2133('0x37')][_0x2133('0x39')]));_0x5a0716[_0x2133('0x38')]=_0x5a0716[_0x2133('0x38')]['length']?_0x5a0716[_0x2133('0x38')]:_0x352d4f[_0x2133('0x33')];if(!_0x2077d5['query'][_0x2133('0x3a')](_0x2133('0x3b'))){_0x5a0716['limit']=qs['limit'](_0x2077d5[_0x2133('0x37')]['limit']);_0x5a0716['offset']=qs[_0x2133('0x21')](_0x2077d5[_0x2133('0x37')][_0x2133('0x21')]);}_0x5a0716[_0x2133('0x3c')]=qs['sort'](_0x2077d5[_0x2133('0x37')][_0x2133('0x3d')]);_0x5a0716[_0x2133('0x3e')]=qs[_0x2133('0x35')](_[_0x2133('0x3f')](_0x2077d5[_0x2133('0x37')],_0x352d4f[_0x2133('0x35')]),_0x3ab319);if(_0x2077d5[_0x2133('0x37')]['filter']){_0x5a0716[_0x2133('0x3e')]=_['merge'](_0x5a0716['where'],{'$or':_[_0x2133('0x30')](_0x3ab319,function(_0x24f6f4){if(_0x24f6f4[_0x2133('0x40')]!==_0x2133('0x41')){var _0x37810e={};_0x37810e[_0x24f6f4[_0x2133('0x2e')]]={'$like':'%'+_0x2077d5[_0x2133('0x37')][_0x2133('0x42')]+'%'};return _0x37810e;}})});}_0x5a0716=_[_0x2133('0x43')]({},_0x5a0716,_0x2077d5['options']);var _0xf868a1={'where':_0x5a0716[_0x2133('0x3e')]};return db[_0x2133('0x44')][_0x2133('0x22')](_0xf868a1)[_0x2133('0x29')](function(_0x25c65c){_0x5e2824['count']=_0x25c65c;if(_0x2077d5[_0x2133('0x37')][_0x2133('0x45')]){_0x5a0716[_0x2133('0x46')]=[{'all':!![]}];}return db[_0x2133('0x44')][_0x2133('0x47')](_0x5a0716);})[_0x2133('0x29')](function(_0xdf85bc){_0x5e2824[_0x2133('0x48')]=_0xdf85bc;return _0x5e2824;})[_0x2133('0x29')](respondWithFilteredResult(_0x57f8ca,_0x5a0716))[_0x2133('0x49')](handleError(_0x57f8ca,null));};exports['show']=function(_0x39bebf,_0x3ecd51){var _0x2de841={'raw':![],'where':{'id':_0x39bebf['params']['id']}},_0x40c1de={};_0x40c1de['model']=_[_0x2133('0x34')](db['CmList'][_0x2133('0x31')]);_0x40c1de['query']=_[_0x2133('0x34')](_0x39bebf[_0x2133('0x37')]);_0x40c1de[_0x2133('0x35')]=_['intersection'](_0x40c1de['model'],_0x40c1de[_0x2133('0x37')]);_0x2de841[_0x2133('0x38')]=_[_0x2133('0x36')](_0x40c1de['model'],qs[_0x2133('0x39')](_0x39bebf['query'][_0x2133('0x39')]));_0x2de841['attributes']=_0x2de841[_0x2133('0x38')][_0x2133('0x4a')]?_0x2de841[_0x2133('0x38')]:_0x40c1de[_0x2133('0x33')];if(_0x39bebf[_0x2133('0x37')][_0x2133('0x45')]){_0x2de841[_0x2133('0x46')]=[{'all':!![]}];}_0x2de841=_[_0x2133('0x43')]({},_0x2de841,_0x39bebf['options']);return db[_0x2133('0x44')][_0x2133('0x4b')](_0x2de841)['then'](handleEntityNotFound(_0x3ecd51,null))[_0x2133('0x29')](respondWithResult(_0x3ecd51,null))[_0x2133('0x49')](handleError(_0x3ecd51,null));};exports[_0x2133('0x4c')]=function(_0x367150,_0x5c7be3){return db['CmList'][_0x2133('0x4c')](_0x367150[_0x2133('0x4d')],{})['then'](function(_0x573367){var _0x48473c=_0x367150[_0x2133('0x4e')][_0x2133('0x2b')]({'plain':!![]});if(!_0x48473c)throw new Error(_0x2133('0x4f'));if(_0x48473c['role']===_0x2133('0x4e')){var _0x5114c0=_0x573367[_0x2133('0x2b')]({'plain':!![]});var _0x58b998='Lists';return db[_0x2133('0x50')][_0x2133('0x4b')]({'where':{'name':_0x58b998,'userProfileId':_0x48473c[_0x2133('0x51')]},'raw':!![]})[_0x2133('0x29')](function(_0x4c299d){if(_0x4c299d&&_0x4c299d[_0x2133('0x52')]===0x0){return db[_0x2133('0x53')]['create']({'name':_0x5114c0['name'],'resourceId':_0x5114c0['id'],'type':_0x4c299d['name'],'sectionId':_0x4c299d['id']},{})[_0x2133('0x29')](function(){return _0x573367;});}else{return _0x573367;}})[_0x2133('0x49')](function(_0x5aaab6){logger[_0x2133('0x54')](_0x2133('0x55'),_0x5aaab6);throw _0x5aaab6;});}return _0x573367;})[_0x2133('0x29')](respondWithResult(_0x5c7be3,0xc9))[_0x2133('0x49')](handleError(_0x5c7be3,null));};exports[_0x2133('0x28')]=function(_0x50e6f8,_0x2eedab){if(_0x50e6f8[_0x2133('0x4d')]['id']){delete _0x50e6f8['body']['id'];}return db[_0x2133('0x44')][_0x2133('0x4b')]({'where':{'id':_0x50e6f8[_0x2133('0x56')]['id']}})[_0x2133('0x29')](handleEntityNotFound(_0x2eedab,null))['then'](saveUpdates(_0x50e6f8['body'],null))[_0x2133('0x29')](respondWithResult(_0x2eedab,null))[_0x2133('0x49')](handleError(_0x2eedab,null));};exports[_0x2133('0x2a')]=function(_0x220c54,_0x1276f0){return db[_0x2133('0x44')][_0x2133('0x4b')]({'where':{'id':_0x220c54['params']['id']}})[_0x2133('0x29')](handleEntityNotFound(_0x1276f0,null))[_0x2133('0x29')](removeEntity(_0x1276f0,null))[_0x2133('0x49')](handleError(_0x1276f0,null));};exports[_0x2133('0x57')]=function(_0x130ae3,_0x3c0adc){return db[_0x2133('0x44')]['describe']()[_0x2133('0x29')](respondWithResult(_0x3c0adc,null))[_0x2133('0x49')](handleError(_0x3c0adc,null));};exports[_0x2133('0x58')]=function(_0x437cb5,_0x5999c2,_0x22409){if(_0x437cb5[_0x2133('0x4d')]['id']){delete _0x437cb5[_0x2133('0x4d')]['id'];}return db[_0x2133('0x44')][_0x2133('0x4b')]({'where':{'id':_0x437cb5[_0x2133('0x56')]['id']}})['then'](handleEntityNotFound(_0x5999c2,null))['then'](function(_0x512677){if(_0x512677){_0x437cb5['body']['ListId']=_0x512677['id'];return db['Disposition'][_0x2133('0x4c')](_0x437cb5[_0x2133('0x4d')]);}})[_0x2133('0x29')](respondWithResult(_0x5999c2,null))['catch'](handleError(_0x5999c2,null));};exports[_0x2133('0x59')]=function(_0x1c7e50,_0x2f049c,_0x1a5b72){var _0x41a358={'raw':![],'where':{}};var _0xc2490={};var _0x546ce0={'count':0x0,'rows':[]};return db['CmList'][_0x2133('0x5a')]({'where':{'id':_0x1c7e50['params']['id']}})[_0x2133('0x29')](handleEntityNotFound(_0x2f049c,null))[_0x2133('0x29')](function(_0xa166f8){if(_0xa166f8){_0xc2490[_0x2133('0x33')]=_[_0x2133('0x34')](db[_0x2133('0x5b')][_0x2133('0x31')]);_0xc2490[_0x2133('0x37')]=_[_0x2133('0x34')](_0x1c7e50[_0x2133('0x37')]);_0xc2490['filters']=_[_0x2133('0x36')](_0xc2490[_0x2133('0x33')],_0xc2490[_0x2133('0x37')]);_0x41a358['attributes']=_[_0x2133('0x36')](_0xc2490[_0x2133('0x33')],qs[_0x2133('0x39')](_0x1c7e50[_0x2133('0x37')]['fields']));_0x41a358[_0x2133('0x38')]=_0x41a358['attributes'][_0x2133('0x4a')]?_0x41a358[_0x2133('0x38')]:_0xc2490[_0x2133('0x33')];if(!_0x1c7e50[_0x2133('0x37')][_0x2133('0x3a')](_0x2133('0x3b'))){_0x41a358[_0x2133('0x20')]=qs[_0x2133('0x20')](_0x1c7e50['query'][_0x2133('0x20')]);_0x41a358[_0x2133('0x21')]=qs[_0x2133('0x21')](_0x1c7e50[_0x2133('0x37')][_0x2133('0x21')]);}_0x41a358[_0x2133('0x3c')]=qs[_0x2133('0x3d')](_0x1c7e50[_0x2133('0x37')]['sort']);_0x41a358['where']=qs[_0x2133('0x35')](_[_0x2133('0x3f')](_0x1c7e50[_0x2133('0x37')],_0xc2490[_0x2133('0x35')]));_0x41a358['where'][_0x2133('0x5c')]=_0xa166f8['id'];if(_0x1c7e50[_0x2133('0x37')]['filter']){_0x41a358['where']=_[_0x2133('0x43')](_0x41a358[_0x2133('0x3e')],{'$or':_[_0x2133('0x30')](_0x41a358[_0x2133('0x38')],function(_0x3933b9){var _0x3cf006={};_0x3cf006[_0x3933b9]={'$like':'%'+_0x1c7e50['query'][_0x2133('0x42')]+'%'};return _0x3cf006;})});}_0x41a358=_[_0x2133('0x43')]({},_0x41a358,_0x1c7e50[_0x2133('0x5d')]);return db['Disposition'][_0x2133('0x22')]({'where':_0x41a358[_0x2133('0x3e')]})['then'](function(_0x34bef6){_0x546ce0['count']=_0x34bef6;if(_0x1c7e50[_0x2133('0x37')][_0x2133('0x45')]){_0x41a358[_0x2133('0x46')]=[{'all':!![]}];}return db['Disposition'][_0x2133('0x47')](_0x41a358);})[_0x2133('0x29')](function(_0x35ee04){_0x546ce0['rows']=_0x35ee04;return _0x546ce0;});}})[_0x2133('0x29')](respondWithFilteredResult(_0x2f049c,_0x41a358))[_0x2133('0x49')](handleError(_0x2f049c,null));};exports[_0x2133('0x5e')]=function(_0x1673d7,_0x4bd9d3,_0x17c88c){return db[_0x2133('0x44')]['find']({'where':{'id':_0x1673d7[_0x2133('0x56')]['id']}})[_0x2133('0x29')](handleEntityNotFound(_0x4bd9d3,null))[_0x2133('0x29')](function(_0x3c562b){if(_0x3c562b){return _0x3c562b[_0x2133('0x5e')](_0x1673d7['query']['ids']);}})[_0x2133('0x29')](respondWithStatusCode(_0x4bd9d3,null))[_0x2133('0x49')](handleError(_0x4bd9d3,null));};exports['addContacts']=function(_0x50e330,_0x17427e,_0x4d545d){return db[_0x2133('0x44')]['find']({'where':{'id':_0x50e330['params']['id']}})['then'](handleEntityNotFound(_0x17427e,null))[_0x2133('0x29')](function(_0x72a4c1){if(_0x72a4c1){var _0x19c630=[];var _0x246090={'success':[],'errors':[]};return db[_0x2133('0x5f')][_0x2133('0x57')]()[_0x2133('0x29')](function(_0x3cbae1){if(_0x50e330['body'][_0x2133('0x60')]&&_[_0x2133('0x61')](_0x50e330[_0x2133('0x4d')]['tags'])){if(_0x50e330['body'][_0x2133('0x60')]['length']){_0x50e330[_0x2133('0x4d')][_0x2133('0x60')]=_0x50e330[_0x2133('0x4d')][_0x2133('0x60')]['join'](';')+';';}else{_0x50e330['body'][_0x2133('0x60')]=null;}}else{_0x50e330[_0x2133('0x4d')][_0x2133('0x60')]=null;}if(_0x50e330[_0x2133('0x4d')]&&_[_0x2133('0x61')](_0x50e330[_0x2133('0x4d')])){for(var _0x5d8854=0x0;_0x5d8854<_0x50e330['body'][_0x2133('0x4a')];_0x5d8854+=0x1){_0x50e330[_0x2133('0x4d')][_0x5d8854][_0x2133('0x5c')]=_0x50e330[_0x2133('0x56')]['id'];_0x19c630[_0x2133('0x62')](_0x50e330['body'][_0x5d8854]);}return BPromise['each'](_0x19c630,function(_0x1d3738){return db[_0x2133('0x5f')][_0x2133('0x4c')](_['omit'](_0x1d3738,['ids','id'])||{},{'fields':_[_0x2133('0x34')](_0x3cbae1),'raw':!![]})[_0x2133('0x29')](function(_0x2b82ee){_0x246090['success'][_0x2133('0x62')](_0x2b82ee[_0x2133('0x63')]);})['catch'](function(_0x2da685){_0x246090['errors']['push']({'data':_0x1d3738,'error':_0x2da685['message']});});})[_0x2133('0x29')](function(_0xaae620){return _0x246090;})[_0x2133('0x49')](function(_0xfc029){return _0xfc029;});}else{_0x17427e['status'](0x190)[_0x2133('0x1e')]({'message':_0x2133('0x64')});}});}})[_0x2133('0x29')](respondWithResult(_0x17427e,null))[_0x2133('0x49')](handleError(_0x17427e,null));};exports[_0x2133('0x65')]=function(_0xe3af8f,_0x37638c,_0x1e0038){var _0x427cbd;return db[_0x2133('0x44')][_0x2133('0x4b')]({'where':{'id':_0xe3af8f[_0x2133('0x56')]['id']},'include':[{'model':db[_0x2133('0x66')],'as':_0x2133('0x67')}]})[_0x2133('0x29')](handleEntityNotFound(_0x37638c,null))['then'](function(_0x3dc50d){if(_0x3dc50d){_0x427cbd=_0x3dc50d;return db[_0x2133('0x5f')]['rawAttributes'];}})['then'](function(_0x1804ec){if(_0x1804ec){var _0x482927={};var _0x34c787={};_0x34c787['model']=_[_0x2133('0x68')](_[_0x2133('0x34')](_0x1804ec),_['map'](_0x427cbd[_0x2133('0x67')],function(_0x524ad7){return util[_0x2133('0x69')]('cf_%d',_0x524ad7['id']);}));_0x34c787[_0x2133('0x37')]=_['keys'](_0xe3af8f[_0x2133('0x37')]);_0x34c787[_0x2133('0x35')]=_[_0x2133('0x36')](_0x34c787['model'],_0x34c787['query']);_0x482927['attributes']=_[_0x2133('0x36')](_0x34c787[_0x2133('0x33')],qs[_0x2133('0x39')](_0xe3af8f[_0x2133('0x37')][_0x2133('0x39')]));_0x482927['attributes']=_0x482927['attributes'][_0x2133('0x4a')]?_0x482927[_0x2133('0x38')]:_0x34c787['model'];if(!_0xe3af8f[_0x2133('0x37')]['hasOwnProperty'](_0x2133('0x3b'))){_0x482927[_0x2133('0x20')]=qs[_0x2133('0x20')](_0xe3af8f['query'][_0x2133('0x20')]);_0x482927[_0x2133('0x21')]=qs['offset'](_0xe3af8f[_0x2133('0x37')]['offset']);}_0x482927[_0x2133('0x3c')]=qs[_0x2133('0x3d')](_0xe3af8f[_0x2133('0x37')]['sort']);_0x482927[_0x2133('0x3e')]=qs[_0x2133('0x35')](_[_0x2133('0x3f')](_0xe3af8f[_0x2133('0x37')],_0x34c787['filters']));_0x482927[_0x2133('0x6a')]=!![];if(_0xe3af8f['query']['filter']){_0x482927[_0x2133('0x3e')]=_[_0x2133('0x43')](_0x482927['where'],{'$or':_['map'](_0x482927[_0x2133('0x38')],function(_0x1f6600){var _0x498e72={};_0x498e72[_0x1f6600]={'$like':'%'+_0xe3af8f[_0x2133('0x37')][_0x2133('0x42')]+'%'};return _0x498e72;})});}_0x482927=_[_0x2133('0x43')]({},_0x482927,_0xe3af8f[_0x2133('0x5d')]);return _0x427cbd[_0x2133('0x65')](_0x482927);}})[_0x2133('0x29')](respondWithResult(_0x37638c,null))['catch'](handleError(_0x37638c,null));};exports[_0x2133('0x6b')]=function(_0x286bd5,_0x10717d,_0x174faa){var _0x496c23;var _0x52f92b;var _0x4d5802;var _0x53ff15=_0x286bd5[_0x2133('0x56')]['id'];csv_results=[];return db[_0x2133('0x6c')]['findAll']({'attributes':['id',_0x2133('0x2e')],'raw':!![],'order':['OrderBy']})['then'](function(_0x1a6a1d){_0x496c23=_0x1a6a1d;var _0x1b6471=_[_0x2133('0x34')](db[_0x2133('0x5f')][_0x2133('0x31')]);return db[_0x2133('0x66')][_0x2133('0x47')]({'raw':!![],'attributes':['id','alias']})[_0x2133('0x29')](function(_0x220aa3){_0x52f92b=_0x220aa3;var _0x1c89c0=squel[_0x2133('0x6d')]()[_0x2133('0x39')](_0x1b6471)[_0x2133('0x6e')](_0x2133('0x6f'),'c')[_0x2133('0x3e')](_0x2133('0x70'),_0x53ff15)['where'](_0x2133('0x71'))[_0x2133('0x72')]();for(var _0x39acd8=0x0;_0x39acd8<_0x52f92b[_0x2133('0x4a')];_0x39acd8++){_0x1c89c0[_0x2133('0x73')](_0x2133('0x74')+_0x52f92b[_0x39acd8]['id'],'customField_'+_0x52f92b[_0x39acd8]['alias']);}for(var _0x39acd8=0x0;_0x39acd8<_0x496c23['length'];_0x39acd8++){_0x1c89c0[_0x2133('0x73')](squel[_0x2133('0x6d')]()[_0x2133('0x73')](_0x2133('0x75'))[_0x2133('0x6e')](_0x2133('0x76'))[_0x2133('0x3e')](_0x2133('0x77'),_0x496c23[_0x39acd8]['id'])[_0x2133('0x3e')]('CmContactId\x20=\x20c.id'),_0x2133('0x78')+_0x496c23[_0x39acd8][_0x2133('0x2e')]);_0x1c89c0[_0x2133('0x73')](squel['select']()[_0x2133('0x73')](_0x2133('0x79'))[_0x2133('0x6e')](_0x2133('0x76'))['where'](_0x2133('0x77'),_0x496c23[_0x39acd8]['id'])[_0x2133('0x3e')](_0x2133('0x7a')),_0x2133('0x7b')+_0x496c23[_0x39acd8][_0x2133('0x2e')]);}var _0x3ce0c8=[];_0x3ce0c8[_0x2133('0x62')](_0x1c89c0[_0x2133('0x7c')]());BPromise['each'](_0x3ce0c8,handleQuery)['then'](function(_0x211595){handleQuery(_0x1c89c0[_0x2133('0x7c')]());var _0x33a471=csv_results[0x0];if(!_[_0x2133('0x7d')](_0x33a471)){var _0x7f7506=toCsv(_0x33a471);var _0x2585ad=Date[_0x2133('0x7e')]();fs['writeFileSync'](util[_0x2133('0x69')](_0x2133('0x7f'),_0x53ff15,_0x2585ad),_0x7f7506);_0x10717d['setHeader'](_0x2133('0x80'),_0x2133('0x81')+util[_0x2133('0x69')](_0x2133('0x82'),_0x53ff15,_0x2585ad));_0x10717d[_0x2133('0x83')](_0x2133('0x84'),'text/csv');return _0x10717d[_0x2133('0x85')](util['format']('/tmp/list_%d_%s.csv',_0x53ff15,_0x2585ad));}else{return _0x10717d[_0x2133('0x1b')](0xcc);}});});});};exports[_0x2133('0x86')]=function(_0x100c42,_0x313a5e,_0x18264f){var _0xa0be51;delete _0x100c42[_0x2133('0x4d')]['id'];return db[_0x2133('0x44')][_0x2133('0x5a')]({'where':{'id':_0x100c42['params']['id']}})['then'](handleEntityNotFound(_0x313a5e,null))[_0x2133('0x29')](function(_0x161f4d){if(_0x161f4d){return db['sequelize']['transaction'](function(_0x21e5ac){return db[_0x2133('0x66')][_0x2133('0x4c')](_0x100c42[_0x2133('0x4d')],{'transaction':_0x21e5ac})[_0x2133('0x29')](function(_0xf31082){_0xa0be51=_0xf31082;return _0x161f4d[_0x2133('0x87')](_0xf31082,{'transaction':_0x21e5ac});})[_0x2133('0x29')](function(){var _0x3d6ee6={'type':db[_0x2133('0x88')][_0x2133('0x89')],'transaction':_0x21e5ac};switch(_0x100c42[_0x2133('0x4d')][_0x2133('0x40')]){case'text':_0x3d6ee6[_0x2133('0x40')]=db['Sequelize'][_0x2133('0x89')];break;case _0x2133('0x8a'):_0x3d6ee6[_0x2133('0x40')]=db[_0x2133('0x88')][_0x2133('0x8b')];break;case _0x2133('0x8c'):_0x3d6ee6[_0x2133('0x40')]=db[_0x2133('0x88')][_0x2133('0x8d')];_0x3d6ee6[_0x2133('0x8e')]=![];break;default:}return db[_0x2133('0x8f')][_0x2133('0x90')]['addColumn'](_0x2133('0x6f'),util[_0x2133('0x69')](_0x2133('0x91'),_0xa0be51['id']),_0x3d6ee6);})['then'](function(){return _0xa0be51;});});}})[_0x2133('0x29')](respondWithResult(_0x313a5e,null))[_0x2133('0x49')](handleError(_0x313a5e,null));};exports[_0x2133('0x92')]=function(_0x298aeb,_0x243c1d,_0x27fd7d){var _0x3d26a7={};var _0xa1eae3={};var _0x59cf25;var _0x41d8b9;return db[_0x2133('0x44')]['findOne']({'where':{'id':_0x298aeb[_0x2133('0x56')]['id']}})[_0x2133('0x29')](handleEntityNotFound(_0x243c1d,null))['then'](function(_0x32998f){if(_0x32998f){_0x59cf25=_0x32998f;_0xa1eae3[_0x2133('0x33')]=_['keys'](db[_0x2133('0x66')][_0x2133('0x31')]);_0xa1eae3[_0x2133('0x37')]=_[_0x2133('0x34')](_0x298aeb['query']);_0xa1eae3[_0x2133('0x35')]=_[_0x2133('0x36')](_0xa1eae3[_0x2133('0x33')],_0xa1eae3['query']);_0x3d26a7[_0x2133('0x38')]=_[_0x2133('0x36')](_0xa1eae3[_0x2133('0x33')],qs['fields'](_0x298aeb[_0x2133('0x37')][_0x2133('0x39')]));_0x3d26a7[_0x2133('0x38')]=_0x3d26a7[_0x2133('0x38')][_0x2133('0x4a')]?_0x3d26a7[_0x2133('0x38')]:_0xa1eae3[_0x2133('0x33')];_0x3d26a7[_0x2133('0x3c')]=qs[_0x2133('0x3d')](_0x298aeb['query'][_0x2133('0x3d')]);_0x3d26a7['where']=qs[_0x2133('0x35')](_[_0x2133('0x3f')](_0x298aeb[_0x2133('0x37')],_0xa1eae3[_0x2133('0x35')]));_0x3d26a7[_0x2133('0x3e')]=_[_0x2133('0x43')](_0x3d26a7[_0x2133('0x3e')],{'$or':[{'ListId':_0x32998f['id']},{'ListId':null}]});if(_0x298aeb[_0x2133('0x37')][_0x2133('0x42')]){_0x3d26a7[_0x2133('0x3e')]=_[_0x2133('0x43')](_0x3d26a7[_0x2133('0x3e')],{'$or':_[_0x2133('0x30')](_0x3d26a7[_0x2133('0x38')],function(_0x2c351e){var _0x2349eb={};_0x2349eb[_0x2c351e]={'$like':'%'+_0x298aeb[_0x2133('0x37')][_0x2133('0x42')]+'%'};return _0x2349eb;})});}_0x3d26a7=_[_0x2133('0x43')]({},_0x3d26a7,_0x298aeb[_0x2133('0x5d')]);return db[_0x2133('0x66')][_0x2133('0x93')](_0x3d26a7);}})[_0x2133('0x29')](respondWithResult(_0x243c1d,null))['catch'](handleError(_0x243c1d,null));};exports[_0x2133('0x94')]=function(_0x40aaa0,_0x1f1122){return db[_0x2133('0x66')]['findAndCountAll']({'where':{'ListId':null}})[_0x2133('0x29')](handleEntityNotFound(_0x1f1122,null))[_0x2133('0x29')](function(_0x15f215){return _0x15f215;})[_0x2133('0x29')](respondWithResult(_0x1f1122,null))[_0x2133('0x49')](handleError(_0x1f1122,null));};exports[_0x2133('0x95')]=function(_0x5dde5b,_0x1df0e9,_0x3c8745){return db[_0x2133('0x44')][_0x2133('0x4b')]({'where':{'id':_0x5dde5b[_0x2133('0x56')]['id']}})[_0x2133('0x29')](handleEntityNotFound(_0x1df0e9,null))[_0x2133('0x29')](function(_0x5aba52){if(_0x5aba52){return _0x5aba52[_0x2133('0x95')](_0x5dde5b[_0x2133('0x4d')][_0x2133('0x96')],_[_0x2133('0x97')](_0x5dde5b[_0x2133('0x4d')],['ids','id'])||{})[_0x2133('0x98')](function(_0xcb7bf1){for(var _0xeb1f62=0x0;_0xeb1f62<_0x5dde5b[_0x2133('0x4d')][_0x2133('0x96')]['length'];_0xeb1f62+=0x1){socket[_0x2133('0x99')](_0x2133('0x9a'),{'UserId':Number(_0x5dde5b[_0x2133('0x4d')][_0x2133('0x96')][_0xeb1f62]),'CmListId':Number(_0x5dde5b['params']['id'])});}return _0xcb7bf1;});}})[_0x2133('0x29')](respondWithResult(_0x1df0e9,null))[_0x2133('0x49')](handleError(_0x1df0e9,null));};exports[_0x2133('0x9b')]=function(_0x1691d2,_0x461150,_0x179fa4){return db[_0x2133('0x44')][_0x2133('0x4b')]({'where':{'id':_0x1691d2[_0x2133('0x56')]['id']}})[_0x2133('0x29')](handleEntityNotFound(_0x461150,null))[_0x2133('0x29')](function(_0x2814c1){if(_0x2814c1){return _0x2814c1['removeAgents'](_0x1691d2['query'][_0x2133('0x96')])[_0x2133('0x29')](function(){if(_[_0x2133('0x61')](_0x1691d2[_0x2133('0x37')][_0x2133('0x96')])){for(var _0x32f7a8=0x0;_0x32f7a8<_0x1691d2[_0x2133('0x37')][_0x2133('0x96')]['length'];_0x32f7a8+=0x1){socket['emit'](_0x2133('0x9c'),{'UserId':Number(_0x1691d2['query'][_0x2133('0x96')][_0x32f7a8]),'CmListId':Number(_0x1691d2['params']['id'])});}}else{socket[_0x2133('0x99')]('userCmList:remove',{'UserId':Number(_0x1691d2[_0x2133('0x37')][_0x2133('0x96')]),'CmListId':Number(_0x1691d2[_0x2133('0x56')]['id'])});}});}})[_0x2133('0x29')](respondWithStatusCode(_0x461150,null))['catch'](handleError(_0x461150,null));};exports[_0x2133('0x9d')]=function(_0x36e09c,_0x129dfe,_0x2e5408){var _0x2af82b={};var _0x40b8fb={};var _0x47714b;var _0x1a7140;return db[_0x2133('0x44')]['findOne']({'where':{'id':_0x36e09c[_0x2133('0x56')]['id']}})['then'](handleEntityNotFound(_0x129dfe,null))[_0x2133('0x29')](function(_0x26cd37){if(_0x26cd37){_0x47714b=_0x26cd37;_0x40b8fb[_0x2133('0x33')]=_['keys'](db[_0x2133('0x9e')][_0x2133('0x31')]);_0x40b8fb[_0x2133('0x37')]=_[_0x2133('0x34')](_0x36e09c[_0x2133('0x37')]);_0x40b8fb[_0x2133('0x35')]=_[_0x2133('0x36')](_0x40b8fb['model'],_0x40b8fb[_0x2133('0x37')]);_0x2af82b['attributes']=_[_0x2133('0x36')](_0x40b8fb['model'],qs[_0x2133('0x39')](_0x36e09c[_0x2133('0x37')]['fields']));_0x2af82b[_0x2133('0x38')]=_0x2af82b[_0x2133('0x38')]['length']?_0x2af82b[_0x2133('0x38')]:_0x40b8fb['model'];_0x2af82b[_0x2133('0x3c')]=qs[_0x2133('0x3d')](_0x36e09c[_0x2133('0x37')]['sort']);_0x2af82b[_0x2133('0x3e')]=qs[_0x2133('0x35')](_['pick'](_0x36e09c['query'],_0x40b8fb[_0x2133('0x35')]));if(_0x36e09c[_0x2133('0x37')][_0x2133('0x42')]){_0x2af82b[_0x2133('0x3e')]=_[_0x2133('0x43')](_0x2af82b[_0x2133('0x3e')],{'$or':_[_0x2133('0x30')](_0x2af82b[_0x2133('0x38')],function(_0x37aed2){var _0x28a607={};_0x28a607[_0x37aed2]={'$like':'%'+_0x36e09c[_0x2133('0x37')]['filter']+'%'};return _0x28a607;})});}_0x2af82b=_[_0x2133('0x43')]({},_0x2af82b,_0x36e09c['options']);return _0x47714b[_0x2133('0x9d')](_0x2af82b);}})[_0x2133('0x29')](function(_0x55457e){if(_0x55457e){_0x1a7140=_0x55457e[_0x2133('0x4a')];if(!_0x36e09c[_0x2133('0x37')]['hasOwnProperty'](_0x2133('0x3b'))){_0x2af82b[_0x2133('0x20')]=qs[_0x2133('0x20')](_0x36e09c[_0x2133('0x37')]['limit']);_0x2af82b[_0x2133('0x21')]=qs[_0x2133('0x21')](_0x36e09c[_0x2133('0x37')][_0x2133('0x21')]);}return _0x47714b[_0x2133('0x9d')](_0x2af82b);}})['then'](function(_0xea2fe){if(_0xea2fe){return _0xea2fe?{'count':_0x1a7140,'rows':_0xea2fe}:null;}})[_0x2133('0x29')](respondWithResult(_0x129dfe,null))[_0x2133('0x49')](handleError(_0x129dfe,null));};function handleQuery(_0x3ca9a0){logger[_0x2133('0x9f')](_0x3ca9a0);return db['sequelize'][_0x2133('0x37')](_0x3ca9a0)[_0x2133('0x98')](function(_0x29bfa4){csv_results[_0x2133('0x62')](_0x29bfa4);})[_0x2133('0x49')](function(_0x47d6be){logger['error'](_0x47d6be[_0x2133('0xa0')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 71a6be1..0e08c75 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(_0x28e0d3,_0xf962a1){var _0x548f3f=function(_0x14e3e9){while(--_0x14e3e9){_0x28e0d3['push'](_0x28e0d3['shift']());}};_0x548f3f(++_0xf962a1);}(_0x814b,0x1a2));var _0xb814=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x814b[_0x4017b0];return _0x5ed4f7;};'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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x9b8695,_0x410e1b){var _0x2ed628=function(_0x5015a3){while(--_0x5015a3){_0x9b8695['push'](_0x9b8695['shift']());}};_0x2ed628(++_0x410e1b);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index b2d60cb..a76ac2b 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 _0x5ff3=['cm_lists','util','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports','define'];(function(_0x15277d,_0x37f420){var _0x1010bb=function(_0x4280e7){while(--_0x4280e7){_0x15277d['push'](_0x15277d['shift']());}};_0x1010bb(++_0x37f420);}(_0x5ff3,0x17d));var _0x35ff=function(_0x119c50,_0x380492){_0x119c50=_0x119c50-0x0;var _0x1b468b=_0x5ff3[_0x119c50];return _0x1b468b;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('CmList',attributes,{'tableName':_0x35ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x750a=['path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','util','moment','bluebird','request-promise'];(function(_0x39114e,_0x35a0c9){var _0x5cba30=function(_0xa354d){while(--_0xa354d){_0x39114e['push'](_0x39114e['shift']());}};_0x5cba30(++_0x35a0c9);}(_0x750a,0x140));var _0xa750=function(_0x538c35,_0x35ade3){_0x538c35=_0x538c35-0x0;var _0x3432d2=_0x750a[_0x538c35];return _0x3432d2;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa750('0x1'));var BPromise=require(_0xa750('0x2'));var rp=require(_0xa750('0x3'));var fs=require('fs');var path=require(_0xa750('0x4'));var rimraf=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var attributes=require(_0xa750('0x7'));module[_0xa750('0x8')]=function(_0x10b4d9,_0x2497df){return _0x10b4d9[_0xa750('0x9')](_0xa750('0xa'),attributes,{'tableName':_0xa750('0xb'),'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 c8eff38..3a29be0 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 _0xbbd9=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x55d408,_0x25416e){var _0x46fec2=function(_0x287b60){while(--_0x287b60){_0x55d408['push'](_0x55d408['shift']());}};_0x46fec2(++_0x25416e);}(_0xbbd9,0x16b));var _0x9bbd=function(_0x2f7270,_0x307af1){_0x2f7270=_0x2f7270-0x0;var _0xe1d89a=_0xbbd9[_0x2f7270];return _0xe1d89a;};'use strict';var _=require(_0x9bbd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9bbd('0x1'));var rs=require(_0x9bbd('0x2'));var fs=require('fs');var Redis=require(_0x9bbd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9bbd('0x4'));var logger=require(_0x9bbd('0x5'))(_0x9bbd('0x6'));var config=require(_0x9bbd('0x7'));var jayson=require(_0x9bbd('0x8'));var client=jayson[_0x9bbd('0x9')][_0x9bbd('0xa')]({'port':0x232a});config[_0x9bbd('0xb')]=_['defaults'](config[_0x9bbd('0xb')],{'host':_0x9bbd('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmList.socket')[_0x9bbd('0xd')](socket);function respondWithRpcPromise(_0x49440f,_0x721afe,_0xf47b9a){return new BPromise(function(_0x5cefdd,_0x12c700){return client[_0x9bbd('0xe')](_0x49440f,_0xf47b9a)[_0x9bbd('0xf')](function(_0x1a5757){logger['info'](_0x9bbd('0x10'),_0x721afe,_0x9bbd('0x11'));logger['debug'](_0x9bbd('0x12'),_0x721afe,_0x9bbd('0x11'),JSON[_0x9bbd('0x13')](_0x1a5757));if(_0x1a5757[_0x9bbd('0x14')]){if(_0x1a5757[_0x9bbd('0x14')][_0x9bbd('0x15')]===0x1f4){logger[_0x9bbd('0x14')](_0x9bbd('0x10'),_0x721afe,_0x1a5757[_0x9bbd('0x14')][_0x9bbd('0x16')]);return _0x12c700(_0x1a5757[_0x9bbd('0x14')]['message']);}logger[_0x9bbd('0x14')](_0x9bbd('0x10'),_0x721afe,_0x1a5757[_0x9bbd('0x14')][_0x9bbd('0x16')]);return _0x5cefdd(_0x1a5757[_0x9bbd('0x14')][_0x9bbd('0x16')]);}else{logger[_0x9bbd('0x17')](_0x9bbd('0x10'),_0x721afe,_0x9bbd('0x11'));_0x5cefdd(_0x1a5757[_0x9bbd('0x18')][_0x9bbd('0x16')]);}})[_0x9bbd('0x19')](function(_0x55d58d){logger['error'](_0x9bbd('0x10'),_0x721afe,_0x55d58d);_0x12c700(_0x55d58d);});});} \ No newline at end of file +var _0xafa1=['catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x49859e,_0x1d6b41){var _0x247ffc=function(_0x5a7b72){while(--_0x5a7b72){_0x49859e['push'](_0x49859e['shift']());}};_0x247ffc(++_0x1d6b41);}(_0xafa1,0xa3));var _0x1afa=function(_0x160e1b,_0xd246a){_0x160e1b=_0x160e1b-0x0;var _0x3e8455=_0xafa1[_0x160e1b];return _0x3e8455;};'use strict';var _=require(_0x1afa('0x0'));var util=require(_0x1afa('0x1'));var moment=require(_0x1afa('0x2'));var BPromise=require(_0x1afa('0x3'));var rs=require(_0x1afa('0x4'));var fs=require('fs');var Redis=require(_0x1afa('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1afa('0x6'));var config=require(_0x1afa('0x7'));var jayson=require(_0x1afa('0x8'));var client=jayson[_0x1afa('0x9')][_0x1afa('0xa')]({'port':0x232a});config[_0x1afa('0xb')]=_['defaults'](config['redis'],{'host':_0x1afa('0xc'),'port':0x18eb});var socket=require(_0x1afa('0xd'))(new Redis(config[_0x1afa('0xb')]));require(_0x1afa('0xe'))[_0x1afa('0xf')](socket);function respondWithRpcPromise(_0xb7582b,_0x1fe47c,_0x427895){return new BPromise(function(_0x3fe650,_0x4229ab){return client['request'](_0xb7582b,_0x427895)['then'](function(_0x1c4235){logger[_0x1afa('0x10')](_0x1afa('0x11'),_0x1fe47c,_0x1afa('0x12'));logger[_0x1afa('0x13')](_0x1afa('0x14'),_0x1fe47c,'request\x20sent',JSON[_0x1afa('0x15')](_0x1c4235));if(_0x1c4235[_0x1afa('0x16')]){if(_0x1c4235['error'][_0x1afa('0x17')]===0x1f4){logger[_0x1afa('0x16')]('CmList,\x20%s,\x20%s',_0x1fe47c,_0x1c4235['error'][_0x1afa('0x18')]);return _0x4229ab(_0x1c4235[_0x1afa('0x16')][_0x1afa('0x18')]);}logger[_0x1afa('0x16')](_0x1afa('0x11'),_0x1fe47c,_0x1c4235[_0x1afa('0x16')][_0x1afa('0x18')]);return _0x3fe650(_0x1c4235[_0x1afa('0x16')][_0x1afa('0x18')]);}else{logger[_0x1afa('0x10')]('CmList,\x20%s,\x20%s',_0x1fe47c,'request\x20sent');_0x3fe650(_0x1c4235[_0x1afa('0x19')][_0x1afa('0x18')]);}})[_0x1afa('0x1a')](function(_0x4e1c69){logger[_0x1afa('0x16')](_0x1afa('0x11'),_0x1fe47c,_0x4e1c69);_0x4229ab(_0x4e1c69);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index f3a8d2c..6d2ccac 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 _0x2167=['update','removeListener','cmList:','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2167,0x117));var _0x7216=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x2167[_0x47a7d0];return _0xb9bd08;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x7216('0x0'),'remove',_0x7216('0x1')];function createListener(_0x54737f,_0x3fc875){return function(_0x5e9c7c){_0x3fc875['emit'](_0x54737f,_0x5e9c7c);};}function removeListener(_0x5549b2,_0x2fddb0){return function(){CmListEvents[_0x7216('0x2')](_0x5549b2,_0x2fddb0);};}exports['register']=function(_0x1e77e0){for(var _0x9c95a2=0x0,_0x3ceb9c=events['length'];_0x9c95a2<_0x3ceb9c;_0x9c95a2++){var _0x2e3951=events[_0x9c95a2];var _0x5676b3=createListener(_0x7216('0x3')+_0x2e3951,_0x1e77e0);CmListEvents['on'](_0x2e3951,_0x5676b3);}}; \ No newline at end of file +var _0x82e4=['save','update','removeListener','length','cmList:','./cmList.events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x82e4,0xd1));var _0x482e=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0x82e4[_0x374ccf];return _0x443cde;};'use strict';var CmListEvents=require(_0x482e('0x0'));var events=[_0x482e('0x1'),'remove',_0x482e('0x2')];function createListener(_0x103706,_0x50d8ab){return function(_0x4a8bab){_0x50d8ab['emit'](_0x103706,_0x4a8bab);};}function removeListener(_0x3b4208,_0x4e706b){return function(){CmListEvents[_0x482e('0x3')](_0x3b4208,_0x4e706b);};}exports['register']=function(_0x449649){for(var _0x47f01f=0x0,_0xefb1e5=events[_0x482e('0x4')];_0x47f01f<_0xefb1e5;_0x47f01f++){var _0x5ed955=events[_0x47f01f];var _0x53206d=createListener(_0x482e('0x5')+_0x5ed955,_0x449649);CmListEvents['on'](_0x5ed955,_0x53206d);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index e44cfa3..75082ac 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 _0x49df=['addDisposition','/:id/contacts','addCustomField','addAgents','update','delete','destroy','removeDispositions','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','index','get','/describe','isAuthenticated','describe','/global_fields','getGlobalCustomFields','/:id','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions'];(function(_0x407fb2,_0x4b6813){var _0xfde875=function(_0x131120){while(--_0x131120){_0x407fb2['push'](_0x407fb2['shift']());}};_0xfde875(++_0x4b6813);}(_0x49df,0x156));var _0xf49d=function(_0xc527f5,_0x1f7c5c){_0xc527f5=_0xc527f5-0x0;var _0x41f85c=_0x49df[_0xc527f5];return _0x41f85c;};'use strict';var multer=require('multer');var util=require(_0xf49d('0x0'));var path=require('path');var timeout=require(_0xf49d('0x1'));var express=require(_0xf49d('0x2'));var router=express[_0xf49d('0x3')]();var fs_extra=require(_0xf49d('0x4'));var auth=require(_0xf49d('0x5'));var interaction=require(_0xf49d('0x6'));var config=require(_0xf49d('0x7'));var controller=require(_0xf49d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xf49d('0x9')]);router[_0xf49d('0xa')](_0xf49d('0xb'),auth[_0xf49d('0xc')](),controller[_0xf49d('0xd')]);router['get'](_0xf49d('0xe'),auth[_0xf49d('0xc')](),controller[_0xf49d('0xf')]);router[_0xf49d('0xa')](_0xf49d('0x10'),auth['isAuthenticated'](),controller['show']);router[_0xf49d('0xa')]('/:id/dispositions',auth[_0xf49d('0xc')](),controller[_0xf49d('0x11')]);router[_0xf49d('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xf49d('0x12')]);router[_0xf49d('0xa')](_0xf49d('0x13'),auth[_0xf49d('0xc')](),controller[_0xf49d('0x14')]);router[_0xf49d('0xa')](_0xf49d('0x15'),auth[_0xf49d('0xc')](),controller[_0xf49d('0x16')]);router[_0xf49d('0xa')](_0xf49d('0x17'),auth[_0xf49d('0xc')](),controller[_0xf49d('0x18')]);router[_0xf49d('0x19')]('/',auth[_0xf49d('0xc')](),controller[_0xf49d('0x1a')]);router[_0xf49d('0x19')](_0xf49d('0x1b'),auth[_0xf49d('0xc')](),controller[_0xf49d('0x1c')]);router[_0xf49d('0x19')](_0xf49d('0x1d'),auth[_0xf49d('0xc')](),controller['addContacts']);router[_0xf49d('0x19')]('/:id/fields',auth['isAuthenticated'](),controller[_0xf49d('0x1e')]);router[_0xf49d('0x19')](_0xf49d('0x17'),auth[_0xf49d('0xc')](),controller[_0xf49d('0x1f')]);router['put'](_0xf49d('0x10'),auth['isAuthenticated'](),controller[_0xf49d('0x20')]);router[_0xf49d('0x21')](_0xf49d('0x10'),auth['isAuthenticated'](),controller[_0xf49d('0x22')]);router[_0xf49d('0x21')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf49d('0x23')]);router[_0xf49d('0x21')](_0xf49d('0x17'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xf49d('0x24')]=router; \ No newline at end of file +var _0xa234=['path','connect-timeout','express','fs-extra','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','create','post','addDisposition','addContacts','addAgents','put','destroy','delete','removeDispositions','/:id/users','removeAgents','exports','multer','util'];(function(_0x3ead90,_0x36f2a2){var _0x285223=function(_0x219160){while(--_0x219160){_0x3ead90['push'](_0x3ead90['shift']());}};_0x285223(++_0x36f2a2);}(_0xa234,0x142));var _0x4a23=function(_0x21c9f3,_0x4e8414){_0x21c9f3=_0x21c9f3-0x0;var _0x5cf59c=_0xa234[_0x21c9f3];return _0x5cf59c;};'use strict';var multer=require(_0x4a23('0x0'));var util=require(_0x4a23('0x1'));var path=require(_0x4a23('0x2'));var timeout=require(_0x4a23('0x3'));var express=require(_0x4a23('0x4'));var router=express['Router']();var fs_extra=require(_0x4a23('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4a23('0x6'));var config=require('../../config/environment');var controller=require(_0x4a23('0x7'));router[_0x4a23('0x8')]('/',auth[_0x4a23('0x9')](),controller[_0x4a23('0xa')]);router[_0x4a23('0x8')](_0x4a23('0xb'),auth['isAuthenticated'](),controller[_0x4a23('0xc')]);router[_0x4a23('0x8')](_0x4a23('0xd'),auth[_0x4a23('0x9')](),controller[_0x4a23('0xe')]);router[_0x4a23('0x8')](_0x4a23('0xf'),auth[_0x4a23('0x9')](),controller[_0x4a23('0x10')]);router[_0x4a23('0x8')](_0x4a23('0x11'),auth['isAuthenticated'](),controller[_0x4a23('0x12')]);router[_0x4a23('0x8')](_0x4a23('0x13'),auth['isAuthenticated'](),controller[_0x4a23('0x14')]);router[_0x4a23('0x8')](_0x4a23('0x15'),auth[_0x4a23('0x9')](),controller['getContactsCsv']);router[_0x4a23('0x8')](_0x4a23('0x16'),auth[_0x4a23('0x9')](),controller[_0x4a23('0x17')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x4a23('0x9')](),controller[_0x4a23('0x18')]);router[_0x4a23('0x19')](_0x4a23('0x11'),auth['isAuthenticated'](),controller[_0x4a23('0x1a')]);router['post'](_0x4a23('0x13'),auth[_0x4a23('0x9')](),controller[_0x4a23('0x1b')]);router[_0x4a23('0x19')](_0x4a23('0x16'),auth[_0x4a23('0x9')](),controller['addCustomField']);router[_0x4a23('0x19')]('/:id/users',auth[_0x4a23('0x9')](),controller[_0x4a23('0x1c')]);router[_0x4a23('0x1d')](_0x4a23('0xf'),auth[_0x4a23('0x9')](),controller['update']);router['delete'](_0x4a23('0xf'),auth[_0x4a23('0x9')](),controller[_0x4a23('0x1e')]);router[_0x4a23('0x1f')](_0x4a23('0x11'),auth[_0x4a23('0x9')](),controller[_0x4a23('0x20')]);router[_0x4a23('0x1f')](_0x4a23('0x21'),auth[_0x4a23('0x9')](),controller[_0x4a23('0x22')]);module[_0x4a23('0x23')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 1bd41a1..4686e19 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 _0x506d=['STRING','sequelize','exports','VIRTUAL','getDataValue','field'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x506d,0x157));var _0xd506=function(_0x388ecc,_0x1e6317){_0x388ecc=_0x388ecc-0x0;var _0x58629f=_0x506d[_0x388ecc];return _0x58629f;};'use strict';var Sequelize=require(_0xd506('0x0'));module[_0xd506('0x1')]={'name':{'type':Sequelize[_0xd506('0x2')],'get':function(_0xd4a186){return this[_0xd506('0x3')](_0xd506('0x4'));}},'field':{'type':Sequelize[_0xd506('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x8846=['field','STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x4ac08b,_0x400ac4){var _0x4aebc8=function(_0x4d1942){while(--_0x4d1942){_0x4ac08b['push'](_0x4ac08b['shift']());}};_0x4aebc8(++_0x400ac4);}(_0x8846,0x11c));var _0x6884=function(_0x5c6ecb,_0xca6ee5){_0x5c6ecb=_0x5c6ecb-0x0;var _0x2960a2=_0x8846[_0x5c6ecb];return _0x2960a2;};'use strict';var Sequelize=require(_0x6884('0x0'));module[_0x6884('0x1')]={'name':{'type':Sequelize[_0x6884('0x2')],'get':function(_0x269ca9){return this[_0x6884('0x3')](_0x6884('0x4'));}},'field':{'type':Sequelize[_0x6884('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x6884('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 5294165..d212033 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(_0x23b382,_0x65f835){var _0x55b0f6=function(_0x2fb93d){while(--_0x2fb93d){_0x23b382['push'](_0x23b382['shift']());}};_0x55b0f6(++_0x65f835);}(_0x7a54,0x106));var _0x47a5=function(_0x38d4ca,_0x27da83){_0x38d4ca=_0x38d4ca-0x0;var _0x13ffae=_0x7a54[_0x38d4ca];return _0x13ffae;};'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(_0x10d1ec,_0x2f70be){var _0x4df16b=function(_0x884cfc){while(--_0x884cfc){_0x10d1ec['push'](_0x10d1ec['shift']());}};_0x4df16b(++_0x2f70be);}(_0x7a54,0x106));var _0x47a5=function(_0x766b36,_0x1c44b4){_0x766b36=_0x766b36-0x0;var _0x563b62=_0x7a54[_0x766b36];return _0x563b62;};'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 26b6a4b..e48fb99 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 _0xfbd0=['exports','define','Condition','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes'];(function(_0x240eaa,_0x49e72b){var _0x899fa7=function(_0x4de75f){while(--_0x4de75f){_0x240eaa['push'](_0x240eaa['shift']());}};_0x899fa7(++_0x49e72b);}(_0xfbd0,0x1a3));var _0x0fbd=function(_0x16af15,_0x55bc76){_0x16af15=_0x16af15-0x0;var _0xfeda8a=_0xfbd0[_0x16af15];return _0xfeda8a;};'use strict';var _=require(_0x0fbd('0x0'));var util=require(_0x0fbd('0x1'));var logger=require('../../config/logger')(_0x0fbd('0x2'));var moment=require(_0x0fbd('0x3'));var BPromise=require(_0x0fbd('0x4'));var rp=require(_0x0fbd('0x5'));var fs=require('fs');var path=require(_0x0fbd('0x6'));var rimraf=require(_0x0fbd('0x7'));var config=require(_0x0fbd('0x8'));var attributes=require(_0x0fbd('0x9'));module[_0x0fbd('0xa')]=function(_0x5e5153,_0x5a38f7){return _0x5e5153[_0x0fbd('0xb')](_0x0fbd('0xc'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x881a=['util','bluebird','request-promise','path','rimraf','./condition.attributes','exports','define','Condition','tools_conditions'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x881a,0x82));var _0xa881=function(_0x415302,_0x595773){_0x415302=_0x415302-0x0;var _0x810824=_0x881a[_0x415302];return _0x810824;};'use strict';var _=require('lodash');var util=require(_0xa881('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa881('0x1'));var rp=require(_0xa881('0x2'));var fs=require('fs');var path=require(_0xa881('0x3'));var rimraf=require(_0xa881('0x4'));var config=require('../../config/environment');var attributes=require(_0xa881('0x5'));module[_0xa881('0x6')]=function(_0x41c0ea,_0x131e04){return _0x41c0ea[_0xa881('0x7')](_0xa881('0x8'),attributes,{'tableName':_0xa881('0x9'),'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 24e31e9..3076f17 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 _0xa83b=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x486e6f,_0x395450){var _0x104212=function(_0x368754){while(--_0x368754){_0x486e6f['push'](_0x486e6f['shift']());}};_0x104212(++_0x395450);}(_0xa83b,0x19d));var _0xba83=function(_0x1af34c,_0x3f717e){_0x1af34c=_0x1af34c-0x0;var _0x29015c=_0xa83b[_0x1af34c];return _0x29015c;};'use strict';var _=require(_0xba83('0x0'));var util=require(_0xba83('0x1'));var moment=require('moment');var BPromise=require(_0xba83('0x2'));var rs=require(_0xba83('0x3'));var fs=require('fs');var Redis=require(_0xba83('0x4'));var db=require(_0xba83('0x5'))['db'];var utils=require(_0xba83('0x6'));var logger=require(_0xba83('0x7'))(_0xba83('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xba83('0x9')][_0xba83('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d31e6,_0x469bb6,_0x11acb8){return new BPromise(function(_0xe1c312,_0x233f95){return client[_0xba83('0xb')](_0x1d31e6,_0x11acb8)['then'](function(_0x2b7395){logger[_0xba83('0xc')](_0xba83('0xd'),_0x469bb6,_0xba83('0xe'));logger[_0xba83('0xf')](_0xba83('0x10'),_0x469bb6,_0xba83('0xe'),JSON['stringify'](_0x2b7395));if(_0x2b7395[_0xba83('0x11')]){if(_0x2b7395[_0xba83('0x11')][_0xba83('0x12')]===0x1f4){logger[_0xba83('0x11')](_0xba83('0xd'),_0x469bb6,_0x2b7395['error']['message']);return _0x233f95(_0x2b7395['error'][_0xba83('0x13')]);}logger[_0xba83('0x11')]('Condition,\x20%s,\x20%s',_0x469bb6,_0x2b7395['error'][_0xba83('0x13')]);return _0xe1c312(_0x2b7395['error']['message']);}else{logger[_0xba83('0xc')](_0xba83('0xd'),_0x469bb6,_0xba83('0xe'));_0xe1c312(_0x2b7395[_0xba83('0x14')][_0xba83('0x13')]);}})[_0xba83('0x15')](function(_0x11b774){logger[_0xba83('0x11')](_0xba83('0xd'),_0x469bb6,_0x11b774);_0x233f95(_0x11b774);});});} \ No newline at end of file +var _0x4de9=['../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x11a6bc,_0xca3849){var _0x52ed78=function(_0x2a1dcc){while(--_0x2a1dcc){_0x11a6bc['push'](_0x11a6bc['shift']());}};_0x52ed78(++_0xca3849);}(_0x4de9,0xeb));var _0x94de=function(_0x4629ed,_0x59ef85){_0x4629ed=_0x4629ed-0x0;var _0x52ca04=_0x4de9[_0x4629ed];return _0x52ca04;};'use strict';var _=require('lodash');var util=require(_0x94de('0x0'));var moment=require(_0x94de('0x1'));var BPromise=require('bluebird');var rs=require(_0x94de('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94de('0x3'))['db'];var utils=require(_0x94de('0x4'));var logger=require(_0x94de('0x5'))(_0x94de('0x6'));var config=require(_0x94de('0x7'));var jayson=require(_0x94de('0x8'));var client=jayson[_0x94de('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x185d0a,_0x44d16c,_0x5af5a9){return new BPromise(function(_0x4a3123,_0x8f67ad){return client['request'](_0x185d0a,_0x5af5a9)['then'](function(_0x2b9eac){logger[_0x94de('0xa')](_0x94de('0xb'),_0x44d16c,_0x94de('0xc'));logger[_0x94de('0xd')](_0x94de('0xe'),_0x44d16c,_0x94de('0xc'),JSON[_0x94de('0xf')](_0x2b9eac));if(_0x2b9eac[_0x94de('0x10')]){if(_0x2b9eac[_0x94de('0x10')][_0x94de('0x11')]===0x1f4){logger['error'](_0x94de('0xb'),_0x44d16c,_0x2b9eac[_0x94de('0x10')][_0x94de('0x12')]);return _0x8f67ad(_0x2b9eac['error']['message']);}logger[_0x94de('0x10')](_0x94de('0xb'),_0x44d16c,_0x2b9eac[_0x94de('0x10')][_0x94de('0x12')]);return _0x4a3123(_0x2b9eac[_0x94de('0x10')][_0x94de('0x12')]);}else{logger['info'](_0x94de('0xb'),_0x44d16c,_0x94de('0xc'));_0x4a3123(_0x2b9eac['result'][_0x94de('0x12')]);}})[_0x94de('0x13')](function(_0x26844b){logger[_0x94de('0x10')]('Condition,\x20%s,\x20%s',_0x44d16c,_0x26844b);_0x8f67ad(_0x26844b);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 4a37f29..08729fc 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 _0x2bdf=['../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4b9cf0,_0x5153b4){var _0x179c85=function(_0x502876){while(--_0x502876){_0x4b9cf0['push'](_0x4b9cf0['shift']());}};_0x179c85(++_0x5153b4);}(_0x2bdf,0xda));var _0xf2bd=function(_0x30f384,_0x2b128e){_0x30f384=_0x30f384-0x0;var _0x1c5eb0=_0x2bdf[_0x30f384];return _0x1c5eb0;};'use strict';var multer=require('multer');var util=require(_0xf2bd('0x0'));var path=require(_0xf2bd('0x1'));var timeout=require(_0xf2bd('0x2'));var express=require(_0xf2bd('0x3'));var router=express[_0xf2bd('0x4')]();var fs_extra=require(_0xf2bd('0x5'));var auth=require(_0xf2bd('0x6'));var interaction=require(_0xf2bd('0x7'));var config=require(_0xf2bd('0x8'));var controller=require(_0xf2bd('0x9'));router[_0xf2bd('0xa')](_0xf2bd('0xb'),auth[_0xf2bd('0xc')](),controller[_0xf2bd('0xd')]);router[_0xf2bd('0xe')]('/:id',auth[_0xf2bd('0xc')](),controller[_0xf2bd('0xf')]);module['exports']=router; \ No newline at end of file +var _0xd2a3=['../../config/environment','./condition.controller','isAuthenticated','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2bfb01,_0x27b4d9){var _0x3fe45f=function(_0x342624){while(--_0x342624){_0x2bfb01['push'](_0x2bfb01['shift']());}};_0x3fe45f(++_0x27b4d9);}(_0xd2a3,0x17f));var _0x3d2a=function(_0x5b2d30,_0x45d3d2){_0x5b2d30=_0x5b2d30-0x0;var _0x4ba6cb=_0xd2a3[_0x5b2d30];return _0x4ba6cb;};'use strict';var multer=require(_0x3d2a('0x0'));var util=require(_0x3d2a('0x1'));var path=require('path');var timeout=require(_0x3d2a('0x2'));var express=require(_0x3d2a('0x3'));var router=express[_0x3d2a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3d2a('0x5'));var interaction=require(_0x3d2a('0x6'));var config=require(_0x3d2a('0x7'));var controller=require(_0x3d2a('0x8'));router['put']('/:id',auth[_0x3d2a('0x9')](),controller['update']);router[_0x3d2a('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3d2a('0xb')]);module[_0x3d2a('0xc')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 9539664..e510acd 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 _0xa150=['STRING','sequelize','name','INTEGER'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xa150,0x1ad));var _0x0a15=function(_0x1eb14e,_0x1a0f55){_0x1eb14e=_0x1eb14e-0x0;var _0x501189=_0xa150[_0x1eb14e];return _0x501189;};'use strict';var Sequelize=require(_0x0a15('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a15('0x1')},'OrderBy':{'type':Sequelize[_0x0a15('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x0a15('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0xd1dd=['name','STRING','sequelize','exports'];(function(_0x9d9412,_0x255072){var _0x1824d7=function(_0x51c4e4){while(--_0x51c4e4){_0x9d9412['push'](_0x9d9412['shift']());}};_0x1824d7(++_0x255072);}(_0xd1dd,0x11e));var _0xdd1d=function(_0x509ef6,_0x258c7a){_0x509ef6=_0x509ef6-0x0;var _0x32e1a1=_0xd1dd[_0x509ef6];return _0x32e1a1;};'use strict';var Sequelize=require(_0xdd1d('0x0'));module[_0xdd1d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdd1d('0x2')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xdd1d('0x3')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 418f4fe..2ff2c74 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 _0xd824=['query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContactHasItem','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','stack','index','ContactItemType','rawAttributes','fieldName','key','map','name'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xd824,0xc2));var _0x4d82=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd824[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x4d82('0x0'));var rimraf=require(_0x4d82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4d82('0x2'));var moment=require(_0x4d82('0x3'));var BPromise=require(_0x4d82('0x4'));var Mustache=require(_0x4d82('0x5'));var util=require(_0x4d82('0x6'));var path=require(_0x4d82('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4d82('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4d82('0x9'));var crypto=require(_0x4d82('0xa'));var jsforce=require(_0x4d82('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4d82('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d82('0xd'));var authService=require(_0x4d82('0xe'));var qs=require(_0x4d82('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d82('0x10'));var logger=require('../../config/logger')(_0x4d82('0x11'));var utils=require(_0x4d82('0x12'));var config=require(_0x4d82('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x346394,_0x248eed){_0x248eed=_0x248eed||0xcc;return function(_0x319ba8){if(_0x319ba8){return _0x346394[_0x4d82('0x14')](_0x248eed);}return _0x346394['status'](_0x248eed)[_0x4d82('0x15')]();};}function respondWithResult(_0x2094bc,_0x41f5b2){_0x41f5b2=_0x41f5b2||0xc8;return function(_0x486152){if(_0x486152){return _0x2094bc[_0x4d82('0x16')](_0x41f5b2)['json'](_0x486152);}};}function respondWithFilteredResult(_0x3382c4,_0x5012db){return function(_0x469e09){if(_0x469e09){var _0x496f3b=typeof _0x5012db[_0x4d82('0x17')]===_0x4d82('0x18')&&typeof _0x5012db[_0x4d82('0x19')]===_0x4d82('0x18');var _0x2648a8=_0x469e09[_0x4d82('0x1a')];var _0x258c59=_0x496f3b?0x0:_0x5012db[_0x4d82('0x17')];var _0x2f2127=_0x496f3b?_0x469e09['count']:_0x5012db[_0x4d82('0x17')]+_0x5012db[_0x4d82('0x19')];var _0x1b1e39;if(_0x2f2127>=_0x2648a8){_0x2f2127=_0x2648a8;_0x1b1e39=0xc8;}else{_0x1b1e39=0xce;}_0x3382c4[_0x4d82('0x16')](_0x1b1e39);return _0x3382c4[_0x4d82('0x1b')](_0x4d82('0x1c'),_0x258c59+'-'+_0x2f2127+'/'+_0x2648a8)[_0x4d82('0x1d')](_0x469e09);}return null;};}function patchUpdates(_0x64669c){return function(_0x19832f){try{jsonpatch[_0x4d82('0x1e')](_0x19832f,_0x64669c,!![]);}catch(_0xf2f5a5){return BPromise['reject'](_0xf2f5a5);}return _0x19832f[_0x4d82('0x1f')]();};}function saveUpdates(_0x748ee7,_0x5e5bdf){return function(_0x1a419f){if(_0x1a419f){return _0x1a419f[_0x4d82('0x20')](_0x748ee7)[_0x4d82('0x21')](function(_0x14a2d4){return _0x14a2d4;});}return null;};}function removeEntity(_0xe17d70,_0x15f5d1){return function(_0x11c043){if(_0x11c043){return _0x11c043[_0x4d82('0x22')]()[_0x4d82('0x21')](function(){var _0x2df104=_0x11c043[_0x4d82('0x23')]({'plain':!![]});var _0x395efc=_0x4d82('0x24');return db[_0x4d82('0x25')][_0x4d82('0x22')]({'where':{'type':_0x395efc,'resourceId':_0x2df104['id']}})['then'](function(){return _0x11c043;});})['then'](function(){_0xe17d70[_0x4d82('0x16')](0xcc)[_0x4d82('0x15')]();});}};}function handleEntityNotFound(_0x2a0572,_0x3348d9){return function(_0x5cbd7e){if(!_0x5cbd7e){_0x2a0572[_0x4d82('0x14')](0x194);}return _0x5cbd7e;};}function handleError(_0x33cb5a,_0x128817){_0x128817=_0x128817||0x1f4;return function(_0x11d022){logger['error'](_0x11d022[_0x4d82('0x26')]);if(_0x11d022['name']){delete _0x11d022['name'];}_0x33cb5a['status'](_0x128817)['send'](_0x11d022);};}exports[_0x4d82('0x27')]=function(_0x8cfbf1,_0x88318c){var _0x52e320={},_0x713c56={},_0x37cdc4={'count':0x0,'rows':[]};var _0x5cf3e6=_['map'](db[_0x4d82('0x28')][_0x4d82('0x29')],function(_0x16d30a){return{'name':_0x16d30a[_0x4d82('0x2a')],'type':_0x16d30a['type'][_0x4d82('0x2b')]};});_0x713c56['model']=_[_0x4d82('0x2c')](_0x5cf3e6,_0x4d82('0x2d'));_0x713c56['query']=_['keys'](_0x8cfbf1[_0x4d82('0x2e')]);_0x713c56[_0x4d82('0x2f')]=_[_0x4d82('0x30')](_0x713c56[_0x4d82('0x31')],_0x713c56[_0x4d82('0x2e')]);_0x52e320[_0x4d82('0x32')]=_[_0x4d82('0x30')](_0x713c56[_0x4d82('0x31')],qs[_0x4d82('0x33')](_0x8cfbf1[_0x4d82('0x2e')]['fields']));_0x52e320[_0x4d82('0x32')]=_0x52e320[_0x4d82('0x32')][_0x4d82('0x34')]?_0x52e320['attributes']:_0x713c56[_0x4d82('0x31')];if(!_0x8cfbf1[_0x4d82('0x2e')]['hasOwnProperty'](_0x4d82('0x35'))){_0x52e320[_0x4d82('0x19')]=qs[_0x4d82('0x19')](_0x8cfbf1['query'][_0x4d82('0x19')]);_0x52e320[_0x4d82('0x17')]=qs['offset'](_0x8cfbf1[_0x4d82('0x2e')]['offset']);}_0x52e320[_0x4d82('0x36')]=qs[_0x4d82('0x37')](_0x8cfbf1['query'][_0x4d82('0x37')]);_0x52e320['where']=qs[_0x4d82('0x2f')](_['pick'](_0x8cfbf1['query'],_0x713c56[_0x4d82('0x2f')]),_0x5cf3e6);if(_0x8cfbf1['query'][_0x4d82('0x38')]){_0x52e320['where']=_[_0x4d82('0x39')](_0x52e320[_0x4d82('0x3a')],{'$or':_['map'](_0x5cf3e6,function(_0x28f826){if(_0x28f826['type']!==_0x4d82('0x3b')){var _0xc541b5={};_0xc541b5[_0x28f826['name']]={'$like':'%'+_0x8cfbf1[_0x4d82('0x2e')]['filter']+'%'};return _0xc541b5;}})});}_0x52e320=_[_0x4d82('0x39')]({},_0x52e320,_0x8cfbf1[_0x4d82('0x3c')]);var _0x25b5e2={'where':_0x52e320[_0x4d82('0x3a')]};return db[_0x4d82('0x28')][_0x4d82('0x1a')](_0x25b5e2)['then'](function(_0x222b35){_0x37cdc4[_0x4d82('0x1a')]=_0x222b35;if(_0x8cfbf1[_0x4d82('0x2e')][_0x4d82('0x3d')]){_0x52e320[_0x4d82('0x3e')]=[{'all':!![]}];}return db[_0x4d82('0x28')][_0x4d82('0x3f')](_0x52e320);})['then'](function(_0x3c80d6){_0x37cdc4[_0x4d82('0x40')]=_0x3c80d6;return _0x37cdc4;})[_0x4d82('0x21')](respondWithFilteredResult(_0x88318c,_0x52e320))[_0x4d82('0x41')](handleError(_0x88318c,null));};exports[_0x4d82('0x42')]=function(_0x5b9cd8,_0x6e68d2){var _0x1592fe={'raw':!![],'where':{'id':_0x5b9cd8[_0x4d82('0x43')]['id']}},_0x3f0a9f={};_0x3f0a9f[_0x4d82('0x31')]=_[_0x4d82('0x44')](db[_0x4d82('0x28')]['rawAttributes']);_0x3f0a9f[_0x4d82('0x2e')]=_[_0x4d82('0x44')](_0x5b9cd8['query']);_0x3f0a9f[_0x4d82('0x2f')]=_['intersection'](_0x3f0a9f[_0x4d82('0x31')],_0x3f0a9f[_0x4d82('0x2e')]);_0x1592fe['attributes']=_[_0x4d82('0x30')](_0x3f0a9f[_0x4d82('0x31')],qs['fields'](_0x5b9cd8[_0x4d82('0x2e')][_0x4d82('0x33')]));_0x1592fe[_0x4d82('0x32')]=_0x1592fe['attributes'][_0x4d82('0x34')]?_0x1592fe[_0x4d82('0x32')]:_0x3f0a9f['model'];if(_0x5b9cd8['query'][_0x4d82('0x3d')]){_0x1592fe[_0x4d82('0x3e')]=[{'all':!![]}];}_0x1592fe=_[_0x4d82('0x39')]({},_0x1592fe,_0x5b9cd8[_0x4d82('0x3c')]);return db[_0x4d82('0x28')][_0x4d82('0x45')](_0x1592fe)[_0x4d82('0x21')](handleEntityNotFound(_0x6e68d2,null))['then'](respondWithResult(_0x6e68d2,null))[_0x4d82('0x41')](handleError(_0x6e68d2,null));};exports[_0x4d82('0x46')]=function(_0x2e4083,_0x234ce3){return db['ContactItemType']['create'](_0x2e4083['body'],{})[_0x4d82('0x21')](function(_0xcd5941){var _0x21bbdb=_0x2e4083[_0x4d82('0x47')][_0x4d82('0x23')]({'plain':!![]});if(!_0x21bbdb)throw new Error(_0x4d82('0x48'));if(_0x21bbdb['role']===_0x4d82('0x47')){var _0x1c022d=_0xcd5941[_0x4d82('0x23')]({'plain':!![]});var _0x34be19=_0x4d82('0x24');return db[_0x4d82('0x49')][_0x4d82('0x45')]({'where':{'name':_0x34be19,'userProfileId':_0x21bbdb[_0x4d82('0x4a')]},'raw':!![]})[_0x4d82('0x21')](function(_0x4ca465){if(_0x4ca465&&_0x4ca465[_0x4d82('0x4b')]===0x0){return db[_0x4d82('0x25')][_0x4d82('0x46')]({'name':_0x1c022d[_0x4d82('0x2d')],'resourceId':_0x1c022d['id'],'type':_0x4ca465[_0x4d82('0x2d')],'sectionId':_0x4ca465['id']},{})[_0x4d82('0x21')](function(){return _0xcd5941;});}else{return _0xcd5941;}})['catch'](function(_0x5cf138){logger[_0x4d82('0x4c')](_0x4d82('0x4d'),_0x5cf138);throw _0x5cf138;});}return _0xcd5941;})[_0x4d82('0x21')](respondWithResult(_0x234ce3,0xc9))[_0x4d82('0x41')](handleError(_0x234ce3,null));};exports[_0x4d82('0x20')]=function(_0x24629a,_0x200958){if(_0x24629a[_0x4d82('0x4e')]['id']){delete _0x24629a[_0x4d82('0x4e')]['id'];}return db[_0x4d82('0x28')][_0x4d82('0x45')]({'where':{'id':_0x24629a[_0x4d82('0x43')]['id']}})['then'](handleEntityNotFound(_0x200958,null))[_0x4d82('0x21')](saveUpdates(_0x24629a['body'],null))['then'](respondWithResult(_0x200958,null))[_0x4d82('0x41')](handleError(_0x200958,null));};exports[_0x4d82('0x22')]=function(_0x257dc4,_0x4fad01){return db[_0x4d82('0x28')][_0x4d82('0x45')]({'where':{'id':_0x257dc4[_0x4d82('0x43')]['id']}})[_0x4d82('0x21')](handleEntityNotFound(_0x4fad01,null))['then'](db[_0x4d82('0x4f')][_0x4d82('0x20')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x257dc4[_0x4d82('0x43')]['id']}}))[_0x4d82('0x21')](removeEntity(_0x4fad01,null))[_0x4d82('0x41')](handleError(_0x4fad01,null));}; \ No newline at end of file +var _0x3d04=['nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','merge','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','ContactItemTypes','end','error','stack','name','send','map','ContactItemType','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x18e2ae,_0x2751d0){var _0x133cd5=function(_0x4affb8){while(--_0x4affb8){_0x18e2ae['push'](_0x18e2ae['shift']());}};_0x133cd5(++_0x2751d0);}(_0x3d04,0xbe));var _0x43d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d04[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x43d0('0x0'));var rimraf=require(_0x43d0('0x1'));var zipdir=require(_0x43d0('0x2'));var jsonpatch=require(_0x43d0('0x3'));var rp=require(_0x43d0('0x4'));var moment=require(_0x43d0('0x5'));var BPromise=require(_0x43d0('0x6'));var Mustache=require(_0x43d0('0x7'));var util=require('util');var path=require(_0x43d0('0x8'));var sox=require(_0x43d0('0x9'));var csv=require(_0x43d0('0xa'));var ejs=require(_0x43d0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x43d0('0xc'));var deskjs=require(_0x43d0('0xd'));var toCsv=require(_0x43d0('0xa'));var querystring=require(_0x43d0('0xe'));var Papa=require(_0x43d0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43d0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x43d0('0x11'))(_0x43d0('0x12'));var utils=require(_0x43d0('0x13'));var config=require(_0x43d0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x43d0('0x15'))['db'];function respondWithStatusCode(_0x23daaa,_0x546b23){_0x546b23=_0x546b23||0xcc;return function(_0x29773b){if(_0x29773b){return _0x23daaa[_0x43d0('0x16')](_0x546b23);}return _0x23daaa[_0x43d0('0x17')](_0x546b23)['end']();};}function respondWithResult(_0xd262a8,_0x2454fa){_0x2454fa=_0x2454fa||0xc8;return function(_0x436130){if(_0x436130){return _0xd262a8['status'](_0x2454fa)[_0x43d0('0x18')](_0x436130);}};}function respondWithFilteredResult(_0x357f87,_0x44e6ec){return function(_0x1218b5){if(_0x1218b5){var _0x91b4a1=typeof _0x44e6ec['offset']==='undefined'&&typeof _0x44e6ec[_0x43d0('0x19')]===_0x43d0('0x1a');var _0x35decf=_0x1218b5['count'];var _0x2c641e=_0x91b4a1?0x0:_0x44e6ec['offset'];var _0x2c9d06=_0x91b4a1?_0x1218b5[_0x43d0('0x1b')]:_0x44e6ec[_0x43d0('0x1c')]+_0x44e6ec['limit'];var _0x3d7dcc;if(_0x2c9d06>=_0x35decf){_0x2c9d06=_0x35decf;_0x3d7dcc=0xc8;}else{_0x3d7dcc=0xce;}_0x357f87[_0x43d0('0x17')](_0x3d7dcc);return _0x357f87['set'](_0x43d0('0x1d'),_0x2c641e+'-'+_0x2c9d06+'/'+_0x35decf)[_0x43d0('0x18')](_0x1218b5);}return null;};}function patchUpdates(_0x348429){return function(_0x248622){try{jsonpatch[_0x43d0('0x1e')](_0x248622,_0x348429,!![]);}catch(_0x28381b){return BPromise[_0x43d0('0x1f')](_0x28381b);}return _0x248622[_0x43d0('0x20')]();};}function saveUpdates(_0x30febc,_0xc8a644){return function(_0xec5f07){if(_0xec5f07){return _0xec5f07[_0x43d0('0x21')](_0x30febc)[_0x43d0('0x22')](function(_0xbc72e6){return _0xbc72e6;});}return null;};}function removeEntity(_0x2efd77,_0x48aa18){return function(_0x2c7b24){if(_0x2c7b24){return _0x2c7b24[_0x43d0('0x23')]()['then'](function(){var _0x1fe708=_0x2c7b24['get']({'plain':!![]});var _0x29c111=_0x43d0('0x24');return db['UserProfileResource'][_0x43d0('0x23')]({'where':{'type':_0x29c111,'resourceId':_0x1fe708['id']}})[_0x43d0('0x22')](function(){return _0x2c7b24;});})['then'](function(){_0x2efd77[_0x43d0('0x17')](0xcc)[_0x43d0('0x25')]();});}};}function handleEntityNotFound(_0x22ae3c,_0x5f16ac){return function(_0x447725){if(!_0x447725){_0x22ae3c[_0x43d0('0x16')](0x194);}return _0x447725;};}function handleError(_0x2c4f3f,_0x1eb771){_0x1eb771=_0x1eb771||0x1f4;return function(_0x37d78f){logger[_0x43d0('0x26')](_0x37d78f[_0x43d0('0x27')]);if(_0x37d78f['name']){delete _0x37d78f[_0x43d0('0x28')];}_0x2c4f3f[_0x43d0('0x17')](_0x1eb771)[_0x43d0('0x29')](_0x37d78f);};}exports['index']=function(_0x4bfce9,_0x52c37b){var _0x3c1ea3={},_0x2db9dc={},_0x10086b={'count':0x0,'rows':[]};var _0x13e3c9=_[_0x43d0('0x2a')](db[_0x43d0('0x2b')]['rawAttributes'],function(_0x77654d){return{'name':_0x77654d[_0x43d0('0x2c')],'type':_0x77654d[_0x43d0('0x2d')][_0x43d0('0x2e')]};});_0x2db9dc[_0x43d0('0x2f')]=_[_0x43d0('0x2a')](_0x13e3c9,_0x43d0('0x28'));_0x2db9dc[_0x43d0('0x30')]=_[_0x43d0('0x31')](_0x4bfce9[_0x43d0('0x30')]);_0x2db9dc[_0x43d0('0x32')]=_['intersection'](_0x2db9dc[_0x43d0('0x2f')],_0x2db9dc[_0x43d0('0x30')]);_0x3c1ea3[_0x43d0('0x33')]=_[_0x43d0('0x34')](_0x2db9dc['model'],qs[_0x43d0('0x35')](_0x4bfce9['query'][_0x43d0('0x35')]));_0x3c1ea3[_0x43d0('0x33')]=_0x3c1ea3['attributes'][_0x43d0('0x36')]?_0x3c1ea3[_0x43d0('0x33')]:_0x2db9dc[_0x43d0('0x2f')];if(!_0x4bfce9[_0x43d0('0x30')][_0x43d0('0x37')](_0x43d0('0x38'))){_0x3c1ea3[_0x43d0('0x19')]=qs[_0x43d0('0x19')](_0x4bfce9[_0x43d0('0x30')][_0x43d0('0x19')]);_0x3c1ea3[_0x43d0('0x1c')]=qs['offset'](_0x4bfce9[_0x43d0('0x30')][_0x43d0('0x1c')]);}_0x3c1ea3[_0x43d0('0x39')]=qs[_0x43d0('0x3a')](_0x4bfce9[_0x43d0('0x30')][_0x43d0('0x3a')]);_0x3c1ea3[_0x43d0('0x3b')]=qs[_0x43d0('0x32')](_[_0x43d0('0x3c')](_0x4bfce9[_0x43d0('0x30')],_0x2db9dc[_0x43d0('0x32')]),_0x13e3c9);if(_0x4bfce9[_0x43d0('0x30')][_0x43d0('0x3d')]){_0x3c1ea3[_0x43d0('0x3b')]=_['merge'](_0x3c1ea3[_0x43d0('0x3b')],{'$or':_[_0x43d0('0x2a')](_0x13e3c9,function(_0x38f330){if(_0x38f330[_0x43d0('0x2d')]!==_0x43d0('0x3e')){var _0x1e6c8b={};_0x1e6c8b[_0x38f330[_0x43d0('0x28')]]={'$like':'%'+_0x4bfce9[_0x43d0('0x30')]['filter']+'%'};return _0x1e6c8b;}})});}_0x3c1ea3=_['merge']({},_0x3c1ea3,_0x4bfce9[_0x43d0('0x3f')]);var _0x5ad2d0={'where':_0x3c1ea3['where']};return db[_0x43d0('0x2b')]['count'](_0x5ad2d0)[_0x43d0('0x22')](function(_0x5027d0){_0x10086b[_0x43d0('0x1b')]=_0x5027d0;if(_0x4bfce9['query'][_0x43d0('0x40')]){_0x3c1ea3[_0x43d0('0x41')]=[{'all':!![]}];}return db[_0x43d0('0x2b')]['findAll'](_0x3c1ea3);})[_0x43d0('0x22')](function(_0x520406){_0x10086b[_0x43d0('0x42')]=_0x520406;return _0x10086b;})['then'](respondWithFilteredResult(_0x52c37b,_0x3c1ea3))['catch'](handleError(_0x52c37b,null));};exports[_0x43d0('0x43')]=function(_0xcb5a02,_0x4d539f){var _0x2f2ac9={'raw':!![],'where':{'id':_0xcb5a02[_0x43d0('0x44')]['id']}},_0x1c87bc={};_0x1c87bc[_0x43d0('0x2f')]=_[_0x43d0('0x31')](db['ContactItemType'][_0x43d0('0x45')]);_0x1c87bc[_0x43d0('0x30')]=_[_0x43d0('0x31')](_0xcb5a02[_0x43d0('0x30')]);_0x1c87bc['filters']=_[_0x43d0('0x34')](_0x1c87bc[_0x43d0('0x2f')],_0x1c87bc[_0x43d0('0x30')]);_0x2f2ac9[_0x43d0('0x33')]=_[_0x43d0('0x34')](_0x1c87bc['model'],qs[_0x43d0('0x35')](_0xcb5a02[_0x43d0('0x30')]['fields']));_0x2f2ac9[_0x43d0('0x33')]=_0x2f2ac9[_0x43d0('0x33')][_0x43d0('0x36')]?_0x2f2ac9['attributes']:_0x1c87bc[_0x43d0('0x2f')];if(_0xcb5a02['query'][_0x43d0('0x40')]){_0x2f2ac9['include']=[{'all':!![]}];}_0x2f2ac9=_[_0x43d0('0x46')]({},_0x2f2ac9,_0xcb5a02[_0x43d0('0x3f')]);return db[_0x43d0('0x2b')][_0x43d0('0x47')](_0x2f2ac9)[_0x43d0('0x22')](handleEntityNotFound(_0x4d539f,null))['then'](respondWithResult(_0x4d539f,null))[_0x43d0('0x48')](handleError(_0x4d539f,null));};exports['create']=function(_0x5a6364,_0x3e7392){return db[_0x43d0('0x2b')][_0x43d0('0x49')](_0x5a6364[_0x43d0('0x4a')],{})[_0x43d0('0x22')](function(_0x3685cf){var _0x36c9d0=_0x5a6364[_0x43d0('0x4b')][_0x43d0('0x4c')]({'plain':!![]});if(!_0x36c9d0)throw new Error(_0x43d0('0x4d'));if(_0x36c9d0[_0x43d0('0x4e')]==='user'){var _0x338203=_0x3685cf[_0x43d0('0x4c')]({'plain':!![]});var _0x1503bc='ContactItemTypes';return db[_0x43d0('0x4f')]['find']({'where':{'name':_0x1503bc,'userProfileId':_0x36c9d0['userProfileId']},'raw':!![]})[_0x43d0('0x22')](function(_0x29a14a){if(_0x29a14a&&_0x29a14a[_0x43d0('0x50')]===0x0){return db[_0x43d0('0x51')][_0x43d0('0x49')]({'name':_0x338203['name'],'resourceId':_0x338203['id'],'type':_0x29a14a['name'],'sectionId':_0x29a14a['id']},{})[_0x43d0('0x22')](function(){return _0x3685cf;});}else{return _0x3685cf;}})['catch'](function(_0x32aab0){logger[_0x43d0('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32aab0);throw _0x32aab0;});}return _0x3685cf;})['then'](respondWithResult(_0x3e7392,0xc9))['catch'](handleError(_0x3e7392,null));};exports[_0x43d0('0x21')]=function(_0x126863,_0x3d89d4){if(_0x126863[_0x43d0('0x4a')]['id']){delete _0x126863[_0x43d0('0x4a')]['id'];}return db[_0x43d0('0x2b')][_0x43d0('0x47')]({'where':{'id':_0x126863[_0x43d0('0x44')]['id']}})[_0x43d0('0x22')](handleEntityNotFound(_0x3d89d4,null))['then'](saveUpdates(_0x126863[_0x43d0('0x4a')],null))[_0x43d0('0x22')](respondWithResult(_0x3d89d4,null))[_0x43d0('0x48')](handleError(_0x3d89d4,null));};exports[_0x43d0('0x23')]=function(_0x44feea,_0x5e341f){return db[_0x43d0('0x2b')][_0x43d0('0x47')]({'where':{'id':_0x44feea[_0x43d0('0x44')]['id']}})[_0x43d0('0x22')](handleEntityNotFound(_0x5e341f,null))['then'](db['CmContactHasItem'][_0x43d0('0x21')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x44feea[_0x43d0('0x44')]['id']}}))[_0x43d0('0x22')](removeEntity(_0x5e341f,null))[_0x43d0('0x48')](handleError(_0x5e341f,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 10cd0fd..fb2ded6 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 _0xa3fa=['path','rimraf','./contactItemType.attributes','exports','define','tools_contact_item_types','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x509c83,_0x511882){var _0x534626=function(_0x9d21cf){while(--_0x9d21cf){_0x509c83['push'](_0x509c83['shift']());}};_0x534626(++_0x511882);}(_0xa3fa,0x1e6));var _0xaa3f=function(_0x4de5d8,_0x17fbc5){_0x4de5d8=_0x4de5d8-0x0;var _0x299c30=_0xa3fa[_0x4de5d8];return _0x299c30;};'use strict';var _=require(_0xaa3f('0x0'));var util=require('util');var logger=require(_0xaa3f('0x1'))(_0xaa3f('0x2'));var moment=require(_0xaa3f('0x3'));var BPromise=require(_0xaa3f('0x4'));var rp=require(_0xaa3f('0x5'));var fs=require('fs');var path=require(_0xaa3f('0x6'));var rimraf=require(_0xaa3f('0x7'));var config=require('../../config/environment');var attributes=require(_0xaa3f('0x8'));module[_0xaa3f('0x9')]=function(_0x38ce87,_0x3b465a){return _0x38ce87[_0xaa3f('0xa')]('ContactItemType',attributes,{'tableName':_0xaa3f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x752d=['moment','path','rimraf','./contactItemType.attributes','define','tools_contact_item_types','lodash','../../config/logger','api'];(function(_0x479e75,_0x3b0c68){var _0x1819ff=function(_0x9e3601){while(--_0x9e3601){_0x479e75['push'](_0x479e75['shift']());}};_0x1819ff(++_0x3b0c68);}(_0x752d,0xc3));var _0xd752=function(_0x36012d,_0x21dc02){_0x36012d=_0x36012d-0x0;var _0x20ad35=_0x752d[_0x36012d];return _0x20ad35;};'use strict';var _=require(_0xd752('0x0'));var util=require('util');var logger=require(_0xd752('0x1'))(_0xd752('0x2'));var moment=require(_0xd752('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd752('0x4'));var rimraf=require(_0xd752('0x5'));var config=require('../../config/environment');var attributes=require(_0xd752('0x6'));module['exports']=function(_0x5de5e3,_0x485567){return _0x5de5e3[_0xd752('0x7')]('ContactItemType',attributes,{'tableName':_0xd752('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 9c7dfb1..d5c6342 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 _0x4784=['client','http','request','then','info','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3e9d2f,_0x4284bc){var _0x2bc18b=function(_0x5045c1){while(--_0x5045c1){_0x3e9d2f['push'](_0x3e9d2f['shift']());}};_0x2bc18b(++_0x4284bc);}(_0x4784,0x1ee));var _0x4478=function(_0xa6182f,_0x5a638a){_0xa6182f=_0xa6182f-0x0;var _0x311db3=_0x4784[_0xa6182f];return _0x311db3;};'use strict';var _=require(_0x4478('0x0'));var util=require(_0x4478('0x1'));var moment=require(_0x4478('0x2'));var BPromise=require(_0x4478('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4478('0x4'));var db=require(_0x4478('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4478('0x6'))(_0x4478('0x7'));var config=require(_0x4478('0x8'));var jayson=require(_0x4478('0x9'));var client=jayson[_0x4478('0xa')][_0x4478('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x886c69,_0x2b5fde,_0x1f889e){return new BPromise(function(_0x3851fd,_0x13150e){return client[_0x4478('0xc')](_0x886c69,_0x1f889e)[_0x4478('0xd')](function(_0x38a678){logger[_0x4478('0xe')](_0x4478('0xf'),_0x2b5fde,'request\x20sent');logger[_0x4478('0x10')](_0x4478('0x11'),_0x2b5fde,'request\x20sent',JSON[_0x4478('0x12')](_0x38a678));if(_0x38a678[_0x4478('0x13')]){if(_0x38a678[_0x4478('0x13')][_0x4478('0x14')]===0x1f4){logger[_0x4478('0x13')]('ContactItemType,\x20%s,\x20%s',_0x2b5fde,_0x38a678[_0x4478('0x13')][_0x4478('0x15')]);return _0x13150e(_0x38a678[_0x4478('0x13')][_0x4478('0x15')]);}logger[_0x4478('0x13')](_0x4478('0xf'),_0x2b5fde,_0x38a678[_0x4478('0x13')][_0x4478('0x15')]);return _0x3851fd(_0x38a678[_0x4478('0x13')]['message']);}else{logger[_0x4478('0xe')](_0x4478('0xf'),_0x2b5fde,'request\x20sent');_0x3851fd(_0x38a678[_0x4478('0x16')]['message']);}})[_0x4478('0x17')](function(_0xa88981){logger[_0x4478('0x13')]('ContactItemType,\x20%s,\x20%s',_0x2b5fde,_0xa88981);_0x13150e(_0xa88981);});});} \ No newline at end of file +var _0x59d8=['ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','lodash','bluebird','randomstring'];(function(_0x4bfade,_0xb26c0e){var _0x272465=function(_0x3b38cb){while(--_0x3b38cb){_0x4bfade['push'](_0x4bfade['shift']());}};_0x272465(++_0xb26c0e);}(_0x59d8,0x95));var _0x859d=function(_0x102977,_0x3a99a6){_0x102977=_0x102977-0x0;var _0x15c466=_0x59d8[_0x102977];return _0x15c466;};'use strict';var _=require(_0x859d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x859d('0x1'));var rs=require(_0x859d('0x2'));var fs=require('fs');var Redis=require(_0x859d('0x3'));var db=require(_0x859d('0x4'))['db'];var utils=require(_0x859d('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x859d('0x6'));var client=jayson[_0x859d('0x7')][_0x859d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3107df,_0x230653,_0x3113a0){return new BPromise(function(_0x403f55,_0x536134){return client['request'](_0x3107df,_0x3113a0)[_0x859d('0x9')](function(_0x574445){logger['info'](_0x859d('0xa'),_0x230653,'request\x20sent');logger[_0x859d('0xb')](_0x859d('0xc'),_0x230653,_0x859d('0xd'),JSON['stringify'](_0x574445));if(_0x574445['error']){if(_0x574445[_0x859d('0xe')]['code']===0x1f4){logger['error'](_0x859d('0xa'),_0x230653,_0x574445['error']['message']);return _0x536134(_0x574445[_0x859d('0xe')][_0x859d('0xf')]);}logger['error']('ContactItemType,\x20%s,\x20%s',_0x230653,_0x574445['error'][_0x859d('0xf')]);return _0x403f55(_0x574445[_0x859d('0xe')][_0x859d('0xf')]);}else{logger[_0x859d('0x10')](_0x859d('0xa'),_0x230653,_0x859d('0xd'));_0x403f55(_0x574445[_0x859d('0x11')]['message']);}})[_0x859d('0x12')](function(_0x1ed9dc){logger[_0x859d('0xe')](_0x859d('0xa'),_0x230653,_0x1ed9dc);_0x536134(_0x1ed9dc);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 4a9660b..731f4e3 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 _0x4ee2=['get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment','./contactItemType.controller'];(function(_0x3060e0,_0x4c9a85){var _0x4d6504=function(_0x50d214){while(--_0x50d214){_0x3060e0['push'](_0x3060e0['shift']());}};_0x4d6504(++_0x4c9a85);}(_0x4ee2,0x1bb));var _0x24ee=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4ee2[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x24ee('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x24ee('0x1'));var express=require(_0x24ee('0x2'));var router=express[_0x24ee('0x3')]();var fs_extra=require(_0x24ee('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x24ee('0x5'));var controller=require(_0x24ee('0x6'));router[_0x24ee('0x7')]('/',auth[_0x24ee('0x8')](),controller[_0x24ee('0x9')]);router['get'](_0x24ee('0xa'),auth[_0x24ee('0x8')](),controller[_0x24ee('0xb')]);router[_0x24ee('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x24ee('0xd')](_0x24ee('0xa'),auth[_0x24ee('0x8')](),controller[_0x24ee('0xe')]);router[_0x24ee('0xf')](_0x24ee('0xa'),auth['isAuthenticated'](),controller[_0x24ee('0x10')]);module[_0x24ee('0x11')]=router; \ No newline at end of file +var _0x1e02=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','/:id','delete'];(function(_0x58efa6,_0x2c00bd){var _0x5d643c=function(_0x1d1ef2){while(--_0x1d1ef2){_0x58efa6['push'](_0x58efa6['shift']());}};_0x5d643c(++_0x2c00bd);}(_0x1e02,0xf1));var _0x21e0=function(_0x2aea93,_0x2f0b91){_0x2aea93=_0x2aea93-0x0;var _0x4c3349=_0x1e02[_0x2aea93];return _0x4c3349;};'use strict';var multer=require(_0x21e0('0x0'));var util=require(_0x21e0('0x1'));var path=require(_0x21e0('0x2'));var timeout=require(_0x21e0('0x3'));var express=require(_0x21e0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x21e0('0x5'));var config=require(_0x21e0('0x6'));var controller=require('./contactItemType.controller');router[_0x21e0('0x7')]('/',auth[_0x21e0('0x8')](),controller[_0x21e0('0x9')]);router[_0x21e0('0x7')]('/:id',auth[_0x21e0('0x8')](),controller[_0x21e0('0xa')]);router[_0x21e0('0xb')]('/',auth[_0x21e0('0x8')](),controller[_0x21e0('0xc')]);router['put'](_0x21e0('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x21e0('0xe')](_0x21e0('0xd'),auth[_0x21e0('0x8')](),controller['destroy']);module[_0x21e0('0xf')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 20d2422..b78c8e1 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 _0x757a=['exports','STRING'];(function(_0x178474,_0x37d82d){var _0x35cc54=function(_0x10aebe){while(--_0x10aebe){_0x178474['push'](_0x178474['shift']());}};_0x35cc54(++_0x37d82d);}(_0x757a,0xde));var _0xa757=function(_0x1f5c06,_0x4d30d9){_0x1f5c06=_0x1f5c06-0x0;var _0x3c4ad0=_0x757a[_0x1f5c06];return _0x3c4ad0;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0xa690f0,_0x378b64){var _0xcc0d5c=function(_0x2e170d){while(--_0x2e170d){_0xa690f0['push'](_0xa690f0['shift']());}};_0xcc0d5c(++_0x378b64);}(_0x757a,0xde));var _0xa757=function(_0x49178c,_0x92e5ad){_0x49178c=_0x49178c-0x0;var _0x261280=_0x757a[_0x49178c];return _0x261280;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index a1dc398..535cc8f 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 _0xf956=['attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','filter','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./dashboard.socket','register','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','Dashboard','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','total'];(function(_0x3b9a54,_0x5673c4){var _0x55d939=function(_0x38b24d){while(--_0x38b24d){_0x3b9a54['push'](_0x3b9a54['shift']());}};_0x55d939(++_0x5673c4);}(_0xf956,0x8e));var _0x6f95=function(_0xf1917,_0x59ac5e){_0xf1917=_0xf1917-0x0;var _0xb4b449=_0xf956[_0xf1917];return _0xb4b449;};'use strict';var emlformat=require(_0x6f95('0x0'));var rimraf=require(_0x6f95('0x1'));var zipdir=require(_0x6f95('0x2'));var jsonpatch=require(_0x6f95('0x3'));var rp=require('request-promise');var moment=require(_0x6f95('0x4'));var BPromise=require(_0x6f95('0x5'));var Mustache=require('mustache');var util=require(_0x6f95('0x6'));var path=require(_0x6f95('0x7'));var sox=require(_0x6f95('0x8'));var csv=require(_0x6f95('0x9'));var ejs=require(_0x6f95('0xa'));var fs=require('fs');var fs_extra=require(_0x6f95('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6f95('0xc'));var jsforce=require(_0x6f95('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6f95('0x9'));var querystring=require('querystring');var Papa=require(_0x6f95('0xe'));var Redis=require(_0x6f95('0xf'));var authService=require(_0x6f95('0x10'));var qs=require(_0x6f95('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f95('0x12'))(_0x6f95('0x13'));var utils=require(_0x6f95('0x14'));var config=require(_0x6f95('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f95('0x16'))['db'];config[_0x6f95('0x17')]=_['defaults'](config[_0x6f95('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6f95('0x18'))[_0x6f95('0x19')](socket);function respondWithStatusCode(_0x12d3ea,_0xfc412c){_0xfc412c=_0xfc412c||0xcc;return function(_0x446406){if(_0x446406){return _0x12d3ea['sendStatus'](_0xfc412c);}return _0x12d3ea[_0x6f95('0x1a')](_0xfc412c)['end']();};}function respondWithResult(_0xa63976,_0x2d63cc){_0x2d63cc=_0x2d63cc||0xc8;return function(_0x167736){if(_0x167736){return _0xa63976[_0x6f95('0x1a')](_0x2d63cc)['json'](_0x167736);}};}function respondWithFilteredResult(_0x32dc55,_0x24708b){return function(_0x329b9c){if(_0x329b9c){var _0x21e953=typeof _0x24708b[_0x6f95('0x1b')]===_0x6f95('0x1c')&&typeof _0x24708b[_0x6f95('0x1d')]===_0x6f95('0x1c');var _0x1d79d6=_0x329b9c[_0x6f95('0x1e')];var _0x34ed23=_0x21e953?0x0:_0x24708b[_0x6f95('0x1b')];var _0x204c73=_0x21e953?_0x329b9c[_0x6f95('0x1e')]:_0x24708b[_0x6f95('0x1b')]+_0x24708b[_0x6f95('0x1d')];var _0x47028f;if(_0x204c73>=_0x1d79d6){_0x204c73=_0x1d79d6;_0x47028f=0xc8;}else{_0x47028f=0xce;}_0x32dc55[_0x6f95('0x1a')](_0x47028f);return _0x32dc55[_0x6f95('0x1f')]('Content-Range',_0x34ed23+'-'+_0x204c73+'/'+_0x1d79d6)[_0x6f95('0x20')](_0x329b9c);}return null;};}function patchUpdates(_0x3ca388){return function(_0x47941f){try{jsonpatch[_0x6f95('0x21')](_0x47941f,_0x3ca388,!![]);}catch(_0x13abd4){return BPromise[_0x6f95('0x22')](_0x13abd4);}return _0x47941f[_0x6f95('0x23')]();};}function saveUpdates(_0x4b2ba5,_0x4581f4){return function(_0xc9cfc){if(_0xc9cfc){return _0xc9cfc[_0x6f95('0x24')](_0x4b2ba5)[_0x6f95('0x25')](function(_0x231ca1){return _0x231ca1;});}return null;};}function removeEntity(_0x52137f,_0x37decc){return function(_0xfcf9bc){if(_0xfcf9bc){return _0xfcf9bc[_0x6f95('0x26')]()[_0x6f95('0x25')](function(){var _0x598c3e=_0xfcf9bc[_0x6f95('0x27')]({'plain':!![]});var _0x30544f='CustomDashboards';return db[_0x6f95('0x28')][_0x6f95('0x26')]({'where':{'type':_0x30544f,'resourceId':_0x598c3e['id']}})[_0x6f95('0x25')](function(){return _0xfcf9bc;});})[_0x6f95('0x25')](function(){_0x52137f[_0x6f95('0x1a')](0xcc)[_0x6f95('0x29')]();});}};}function handleEntityNotFound(_0x41d4a8,_0x27d64e){return function(_0x43f61d){if(!_0x43f61d){_0x41d4a8[_0x6f95('0x2a')](0x194);}return _0x43f61d;};}function handleError(_0x252e71,_0x4b671e){_0x4b671e=_0x4b671e||0x1f4;return function(_0x25f488){logger[_0x6f95('0x2b')](_0x25f488[_0x6f95('0x2c')]);if(_0x25f488[_0x6f95('0x2d')]){delete _0x25f488[_0x6f95('0x2d')];}_0x252e71['status'](_0x4b671e)[_0x6f95('0x2e')](_0x25f488);};}exports[_0x6f95('0x2f')]=function(_0x307890,_0x270dca){var _0x25cea6={},_0xabdf1c={},_0x2d2f0c={'count':0x0,'rows':[]};var _0x4fdcc7=_[_0x6f95('0x30')](db['Dashboard'][_0x6f95('0x31')],function(_0x4e1512){return{'name':_0x4e1512[_0x6f95('0x32')],'type':_0x4e1512[_0x6f95('0x33')][_0x6f95('0x34')]};});_0xabdf1c['model']=_[_0x6f95('0x30')](_0x4fdcc7,_0x6f95('0x2d'));_0xabdf1c[_0x6f95('0x35')]=_['keys'](_0x307890['query']);_0xabdf1c[_0x6f95('0x36')]=_[_0x6f95('0x37')](_0xabdf1c[_0x6f95('0x38')],_0xabdf1c[_0x6f95('0x35')]);_0x25cea6['attributes']=_[_0x6f95('0x37')](_0xabdf1c['model'],qs[_0x6f95('0x39')](_0x307890[_0x6f95('0x35')]['fields']));_0x25cea6['attributes']=_0x25cea6[_0x6f95('0x3a')][_0x6f95('0x3b')]?_0x25cea6[_0x6f95('0x3a')]:_0xabdf1c[_0x6f95('0x38')];if(!_0x307890[_0x6f95('0x35')][_0x6f95('0x3c')](_0x6f95('0x3d'))){_0x25cea6[_0x6f95('0x1d')]=qs[_0x6f95('0x1d')](_0x307890[_0x6f95('0x35')][_0x6f95('0x1d')]);_0x25cea6[_0x6f95('0x1b')]=qs['offset'](_0x307890[_0x6f95('0x35')][_0x6f95('0x1b')]);}_0x25cea6['order']=qs[_0x6f95('0x3e')](_0x307890[_0x6f95('0x35')][_0x6f95('0x3e')]);_0x25cea6[_0x6f95('0x3f')]=qs[_0x6f95('0x36')](_[_0x6f95('0x40')](_0x307890[_0x6f95('0x35')],_0xabdf1c[_0x6f95('0x36')]),_0x4fdcc7);if(_0x307890[_0x6f95('0x35')]['filter']){_0x25cea6[_0x6f95('0x3f')]=_[_0x6f95('0x41')](_0x25cea6['where'],{'$or':_[_0x6f95('0x30')](_0x4fdcc7,function(_0x3407cd){if(_0x3407cd[_0x6f95('0x33')]!==_0x6f95('0x42')){var _0x310cd1={};_0x310cd1[_0x3407cd['name']]={'$like':'%'+_0x307890[_0x6f95('0x35')]['filter']+'%'};return _0x310cd1;}})});}_0x25cea6=_['merge']({},_0x25cea6,_0x307890[_0x6f95('0x43')]);var _0x42e7d3={'where':_0x25cea6['where']};return db[_0x6f95('0x44')]['count'](_0x42e7d3)[_0x6f95('0x25')](function(_0x4af5aa){_0x2d2f0c[_0x6f95('0x1e')]=_0x4af5aa;if(_0x307890[_0x6f95('0x35')][_0x6f95('0x45')]){_0x25cea6[_0x6f95('0x46')]=[{'all':!![]}];}return db[_0x6f95('0x44')][_0x6f95('0x47')](_0x25cea6);})['then'](function(_0x12c2a5){_0x2d2f0c[_0x6f95('0x48')]=_0x12c2a5;return _0x2d2f0c;})[_0x6f95('0x25')](respondWithFilteredResult(_0x270dca,_0x25cea6))[_0x6f95('0x49')](handleError(_0x270dca,null));};exports[_0x6f95('0x4a')]=function(_0x2897f8,_0x2fdb8f){var _0x522184={'raw':![],'where':{'id':_0x2897f8[_0x6f95('0x4b')]['id']}},_0x559bb4={};_0x559bb4[_0x6f95('0x38')]=_[_0x6f95('0x4c')](db[_0x6f95('0x44')][_0x6f95('0x31')]);_0x559bb4[_0x6f95('0x35')]=_['keys'](_0x2897f8[_0x6f95('0x35')]);_0x559bb4[_0x6f95('0x36')]=_[_0x6f95('0x37')](_0x559bb4[_0x6f95('0x38')],_0x559bb4[_0x6f95('0x35')]);_0x522184[_0x6f95('0x3a')]=_[_0x6f95('0x37')](_0x559bb4['model'],qs[_0x6f95('0x39')](_0x2897f8['query'][_0x6f95('0x39')]));_0x522184[_0x6f95('0x3a')]=_0x522184[_0x6f95('0x3a')][_0x6f95('0x3b')]?_0x522184[_0x6f95('0x3a')]:_0x559bb4[_0x6f95('0x38')];if(_0x2897f8['query']['includeAll']){_0x522184['include']=[{'all':!![]}];}_0x522184=_['merge']({},_0x522184,_0x2897f8[_0x6f95('0x43')]);return db['Dashboard'][_0x6f95('0x4d')](_0x522184)['then'](handleEntityNotFound(_0x2fdb8f,null))[_0x6f95('0x25')](respondWithResult(_0x2fdb8f,null))['catch'](handleError(_0x2fdb8f,null));};exports[_0x6f95('0x4e')]=function(_0x4ce602,_0x5ef890){return db['Dashboard'][_0x6f95('0x4e')](_0x4ce602[_0x6f95('0x4f')],{})[_0x6f95('0x25')](function(_0x238981){var _0xf7c6c9=_0x4ce602[_0x6f95('0x50')][_0x6f95('0x27')]({'plain':!![]});if(!_0xf7c6c9)throw new Error(_0x6f95('0x51'));if(_0xf7c6c9[_0x6f95('0x52')]===_0x6f95('0x50')){var _0x275ef9=_0x238981[_0x6f95('0x27')]({'plain':!![]});var _0x5f2b45=_0x6f95('0x53');return db[_0x6f95('0x54')][_0x6f95('0x4d')]({'where':{'name':_0x5f2b45,'userProfileId':_0xf7c6c9[_0x6f95('0x55')]},'raw':!![]})[_0x6f95('0x25')](function(_0x2bdd2e){if(_0x2bdd2e&&_0x2bdd2e[_0x6f95('0x56')]===0x0){return db[_0x6f95('0x28')]['create']({'name':_0x275ef9[_0x6f95('0x2d')],'resourceId':_0x275ef9['id'],'type':_0x2bdd2e[_0x6f95('0x2d')],'sectionId':_0x2bdd2e['id']},{})[_0x6f95('0x25')](function(){return _0x238981;});}else{return _0x238981;}})[_0x6f95('0x49')](function(_0x1e2294){logger[_0x6f95('0x2b')](_0x6f95('0x57'),_0x1e2294);throw _0x1e2294;});}return _0x238981;})[_0x6f95('0x25')](respondWithResult(_0x5ef890,0xc9))[_0x6f95('0x49')](handleError(_0x5ef890,null));};exports[_0x6f95('0x58')]=function(_0x179a6a,_0x1b7bdf){var _0x53ff66={'where':{'id':_0x179a6a['params']['id']}},_0x5120f2={};_0x5120f2[_0x6f95('0x38')]=_[_0x6f95('0x4c')](db[_0x6f95('0x44')][_0x6f95('0x31')]);_0x53ff66[_0x6f95('0x3a')]=_[_0x6f95('0x37')](_0x5120f2[_0x6f95('0x38')],qs[_0x6f95('0x39')](_0x179a6a[_0x6f95('0x35')][_0x6f95('0x39')]));_0x53ff66[_0x6f95('0x3a')]=_0x53ff66[_0x6f95('0x3a')]['length']?_0x53ff66[_0x6f95('0x3a')]:_0x5120f2[_0x6f95('0x38')];if(_0x179a6a[_0x6f95('0x35')][_0x6f95('0x45')]){_0x53ff66[_0x6f95('0x46')]=[{'all':!![]}];}_0x53ff66=_[_0x6f95('0x41')]({},_0x53ff66,_0x179a6a[_0x6f95('0x43')]);return db[_0x6f95('0x44')]['find'](_0x53ff66)[_0x6f95('0x25')](handleEntityNotFound(_0x1b7bdf,null))[_0x6f95('0x25')](function(_0x3c9f58){if(_0x3c9f58){var _0x26efe9=_0x3c9f58[_0x6f95('0x27')]({'plain':!![]});_0x26efe9=qs[_0x6f95('0x59')](_0x26efe9,['id','createdAt',_0x6f95('0x5a')]);_0x179a6a['body']=_[_0x6f95('0x59')](_0x179a6a[_0x6f95('0x4f')],['id',_0x6f95('0x5b'),'updatedAt']);return db[_0x6f95('0x44')]['create'](_[_0x6f95('0x41')](_0x26efe9,_0x179a6a[_0x6f95('0x4f')]),{'include':_0x179a6a[_0x6f95('0x35')][_0x6f95('0x45')]?[{'all':!![]}]:undefined})['then'](function(_0x3b7a0a){var _0x34df37=_0x179a6a[_0x6f95('0x50')][_0x6f95('0x27')]({'plain':!![]});if(!_0x34df37)throw new Error(_0x6f95('0x51'));if(_0x34df37[_0x6f95('0x52')]===_0x6f95('0x50')){var _0x168d1b=_0x3b7a0a[_0x6f95('0x27')]({'plain':!![]});var _0x4e6075=_0x6f95('0x53');return db['UserProfileSection'][_0x6f95('0x4d')]({'where':{'name':_0x4e6075,'userProfileId':_0x34df37[_0x6f95('0x55')]},'raw':!![]})[_0x6f95('0x25')](function(_0x384da1){if(_0x384da1&&_0x384da1[_0x6f95('0x56')]===0x0){return db['UserProfileResource'][_0x6f95('0x4e')]({'name':_0x168d1b[_0x6f95('0x2d')],'resourceId':_0x168d1b['id'],'type':_0x384da1[_0x6f95('0x2d')],'sectionId':_0x384da1['id']},{})[_0x6f95('0x25')](function(){return _0x3b7a0a;});}else{return _0x3b7a0a;}})[_0x6f95('0x49')](function(_0x50094c){logger[_0x6f95('0x2b')](_0x6f95('0x57'),_0x50094c);throw _0x50094c;});}return _0x3b7a0a;});}})[_0x6f95('0x25')](respondWithResult(_0x1b7bdf,0xc9))[_0x6f95('0x49')](handleError(_0x1b7bdf,null));};exports[_0x6f95('0x24')]=function(_0x2c2cec,_0x3d1ac9){if(_0x2c2cec[_0x6f95('0x4f')]['id']){delete _0x2c2cec[_0x6f95('0x4f')]['id'];}return db['Dashboard'][_0x6f95('0x4d')]({'where':{'id':_0x2c2cec[_0x6f95('0x4b')]['id']}})[_0x6f95('0x25')](handleEntityNotFound(_0x3d1ac9,null))[_0x6f95('0x25')](saveUpdates(_0x2c2cec['body'],null))[_0x6f95('0x25')](respondWithResult(_0x3d1ac9,null))[_0x6f95('0x49')](handleError(_0x3d1ac9,null));};exports[_0x6f95('0x26')]=function(_0x2b4777,_0x4d1f42){return db[_0x6f95('0x44')][_0x6f95('0x4d')]({'where':{'id':_0x2b4777['params']['id']}})[_0x6f95('0x25')](handleEntityNotFound(_0x4d1f42,null))[_0x6f95('0x25')](removeEntity(_0x4d1f42,null))['catch'](handleError(_0x4d1f42,null));};function widgetAttributes(_0x3b4935){try{switch(_0x3b4935['type']){case'iframe':return[{'name':_0x6f95('0x5c'),'value':_0x3b4935[_0x6f95('0x5c')]||(_0x3b4935['attrs']&&_0x3b4935['attrs'][0x0]?_0x3b4935[_0x6f95('0x5d')][0x0]['value']:undefined)||_0x6f95('0x5e')}];case _0x6f95('0x5f'):return[{'name':'attrPath','value':_0x3b4935[_0x6f95('0x60')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935['attrs'][0x0]?_0x3b4935['attrs'][0x0][_0x6f95('0x61')]:undefined)||''}];case _0x6f95('0x62'):return[{'name':'attrHourFormat','value':_0x3b4935[_0x6f95('0x63')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x0]?_0x3b4935[_0x6f95('0x5d')][0x0]['value']:undefined)||_0x6f95('0x64')},{'name':'attrTimezone','value':_0x3b4935[_0x6f95('0x65')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x1]?_0x3b4935[_0x6f95('0x5d')][0x1][_0x6f95('0x61')]:undefined)||'0.00'},{'name':_0x6f95('0x66'),'value':_0x3b4935[_0x6f95('0x66')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x2]?_0x3b4935['attrs'][0x2][_0x6f95('0x61')]:undefined)||0xc}];case _0x6f95('0x67'):return[{'name':'attrMetric','value':_0x3b4935[_0x6f95('0x68')]||(_0x3b4935['attrs']&&_0x3b4935[_0x6f95('0x5d')][0x0]?_0x3b4935[_0x6f95('0x5d')][0x0][_0x6f95('0x61')]:undefined)||'total'},{'name':_0x6f95('0x69'),'value':_0x3b4935[_0x6f95('0x69')]||(_0x3b4935['attrs']&&_0x3b4935[_0x6f95('0x5d')][0x1]?_0x3b4935[_0x6f95('0x5d')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x3b4935[_0x6f95('0x66')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x2]?_0x3b4935[_0x6f95('0x5d')][0x2][_0x6f95('0x61')]:undefined)||0x14},{'name':_0x6f95('0x6a'),'value':_0x3b4935[_0x6f95('0x6a')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x3]?_0x3b4935[_0x6f95('0x5d')][0x3][_0x6f95('0x61')]:undefined)||_0x6f95('0x6b')},{'name':_0x6f95('0x6c'),'value':_0x3b4935[_0x6f95('0x6c')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935['attrs'][0x4]?_0x3b4935[_0x6f95('0x5d')][0x4][_0x6f95('0x61')]:undefined)||''},{'name':_0x6f95('0x6d'),'value':_0x3b4935['attrFaxAccounts']||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x5]?_0x3b4935['attrs'][0x5]['value']:undefined)||''},{'name':_0x6f95('0x6e'),'value':_0x3b4935[_0x6f95('0x6e')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935['attrs'][0x6]?_0x3b4935[_0x6f95('0x5d')][0x6][_0x6f95('0x61')]:undefined)||''},{'name':_0x6f95('0x6f'),'value':_0x3b4935[_0x6f95('0x6f')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x7]?_0x3b4935['attrs'][0x7][_0x6f95('0x61')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3b4935[_0x6f95('0x70')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x8]?_0x3b4935[_0x6f95('0x5d')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x3b4935[_0x6f95('0x71')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x9]?_0x3b4935[_0x6f95('0x5d')][0x9][_0x6f95('0x61')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':'attrSerie1','value':_0x3b4935[_0x6f95('0x72')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x0]?_0x3b4935[_0x6f95('0x5d')][0x0][_0x6f95('0x61')]:undefined)||_0x6f95('0x73')},{'name':_0x6f95('0x74'),'value':_0x3b4935[_0x6f95('0x74')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x1]?_0x3b4935[_0x6f95('0x5d')][0x1][_0x6f95('0x61')]:undefined)||null},{'name':_0x6f95('0x75'),'value':_0x3b4935['attrSerie3']||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x2]?_0x3b4935[_0x6f95('0x5d')][0x2][_0x6f95('0x61')]:undefined)||null},{'name':_0x6f95('0x69'),'value':_0x3b4935[_0x6f95('0x69')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x3]?_0x3b4935['attrs'][0x3][_0x6f95('0x61')]:undefined)||[]},{'name':_0x6f95('0x6a'),'value':_0x3b4935['attrChannel']||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x4]?_0x3b4935[_0x6f95('0x5d')][0x4][_0x6f95('0x61')]:undefined)||'voice'},{'name':_0x6f95('0x6c'),'value':_0x3b4935[_0x6f95('0x6c')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x5]?_0x3b4935['attrs'][0x5]['value']:undefined)||''},{'name':_0x6f95('0x6d'),'value':_0x3b4935[_0x6f95('0x6d')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935['attrs'][0x6]?_0x3b4935[_0x6f95('0x5d')][0x6][_0x6f95('0x61')]:undefined)||''},{'name':_0x6f95('0x6e'),'value':_0x3b4935[_0x6f95('0x6e')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x7]?_0x3b4935[_0x6f95('0x5d')][0x7][_0x6f95('0x61')]:undefined)||''},{'name':_0x6f95('0x6f'),'value':_0x3b4935[_0x6f95('0x6f')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935['attrs'][0x8]?_0x3b4935['attrs'][0x8][_0x6f95('0x61')]:undefined)||''},{'name':_0x6f95('0x70'),'value':_0x3b4935[_0x6f95('0x70')]||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935[_0x6f95('0x5d')][0x9]?_0x3b4935[_0x6f95('0x5d')][0x9][_0x6f95('0x61')]:undefined)||''},{'name':_0x6f95('0x71'),'value':_0x3b4935['attrChatWebsites']||(_0x3b4935[_0x6f95('0x5d')]&&_0x3b4935['attrs'][0xa]?_0x3b4935['attrs'][0xa][_0x6f95('0x61')]:undefined)||''}];case _0x6f95('0x76'):return[{'name':_0x6f95('0x77'),'type':_0x3b4935[_0x6f95('0x78')]||(_0x3b4935['attrs']&&_0x3b4935['attrs'][0x0]?_0x3b4935[_0x6f95('0x5d')][0x0][_0x6f95('0x33')]:undefined)||null,'value':_0x3b4935[_0x6f95('0x77')]||(_0x3b4935['attrs']&&_0x3b4935['attrs'][0x0]?_0x3b4935[_0x6f95('0x5d')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x3b4935[_0x6f95('0x79')]||(_0x3b4935['attrs']&&_0x3b4935[_0x6f95('0x5d')][0x1]?_0x3b4935[_0x6f95('0x5d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x599331){logger[_0x6f95('0x2b')]('widgetAttributes:\x20%s',JSON[_0x6f95('0x7a')](_0x599331));return[];}}exports[_0x6f95('0x7b')]=function(_0xf2d72,_0x37927e,_0x2f3ebc){if(_0xf2d72['body']['id']){delete _0xf2d72[_0x6f95('0x4f')]['id'];}return db['Dashboard']['find']({'where':{'id':_0xf2d72[_0x6f95('0x4b')]['id']}})[_0x6f95('0x25')](handleEntityNotFound(_0x37927e,null))[_0x6f95('0x25')](function(_0xf6287c){if(_0xf6287c){_0xf2d72[_0x6f95('0x4f')][_0x6f95('0x7c')]=_0xf6287c['id'];_0xf2d72['body'][_0x6f95('0x5d')]=widgetAttributes(_0xf2d72['body']);return db[_0x6f95('0x7d')][_0x6f95('0x4e')](_0xf2d72[_0x6f95('0x4f')]);}})[_0x6f95('0x25')](respondWithResult(_0x37927e,null))[_0x6f95('0x49')](handleError(_0x37927e,null));};exports[_0x6f95('0x7e')]=function(_0x1e1d1b,_0x205998,_0x481e78){var _0x123cd6={};var _0x3dc6f2={};var _0x52a8e6;var _0x677a5a;return db[_0x6f95('0x44')][_0x6f95('0x7f')]({'where':{'id':_0x1e1d1b[_0x6f95('0x4b')]['id']}})[_0x6f95('0x25')](handleEntityNotFound(_0x205998,null))['then'](function(_0x971487){if(_0x971487){_0x52a8e6=_0x971487;_0x3dc6f2['model']=_[_0x6f95('0x4c')](db['DashboardItem'][_0x6f95('0x31')]);_0x3dc6f2[_0x6f95('0x35')]=_['keys'](_0x1e1d1b[_0x6f95('0x35')]);_0x3dc6f2[_0x6f95('0x36')]=_[_0x6f95('0x37')](_0x3dc6f2[_0x6f95('0x38')],_0x3dc6f2[_0x6f95('0x35')]);_0x123cd6[_0x6f95('0x3a')]=_[_0x6f95('0x37')](_0x3dc6f2['model'],qs['fields'](_0x1e1d1b[_0x6f95('0x35')][_0x6f95('0x39')]));_0x123cd6[_0x6f95('0x3a')]=_0x123cd6[_0x6f95('0x3a')][_0x6f95('0x3b')]?_0x123cd6[_0x6f95('0x3a')]:_0x3dc6f2[_0x6f95('0x38')];_0x123cd6['order']=qs['sort'](_0x1e1d1b[_0x6f95('0x35')][_0x6f95('0x3e')]);_0x123cd6[_0x6f95('0x3f')]=qs['filters'](_[_0x6f95('0x40')](_0x1e1d1b[_0x6f95('0x35')],_0x3dc6f2[_0x6f95('0x36')]));if(_0x1e1d1b[_0x6f95('0x35')]['filter']){_0x123cd6[_0x6f95('0x3f')]=_[_0x6f95('0x41')](_0x123cd6[_0x6f95('0x3f')],{'$or':_[_0x6f95('0x30')](_0x123cd6[_0x6f95('0x3a')],function(_0x9653c7){var _0x25fd70={};_0x25fd70[_0x9653c7]={'$like':'%'+_0x1e1d1b[_0x6f95('0x35')][_0x6f95('0x80')]+'%'};return _0x25fd70;})});}_0x123cd6=_[_0x6f95('0x41')]({},_0x123cd6,_0x1e1d1b[_0x6f95('0x43')]);return _0x52a8e6[_0x6f95('0x7e')](_0x123cd6);}})[_0x6f95('0x25')](function(_0x51d34c){if(_0x51d34c){_0x677a5a=_0x51d34c[_0x6f95('0x3b')];if(!_0x1e1d1b[_0x6f95('0x35')]['hasOwnProperty']('nolimit')){_0x123cd6['limit']=qs[_0x6f95('0x1d')](_0x1e1d1b['query']['limit']);_0x123cd6[_0x6f95('0x1b')]=qs[_0x6f95('0x1b')](_0x1e1d1b[_0x6f95('0x35')][_0x6f95('0x1b')]);}return _0x52a8e6[_0x6f95('0x7e')](_0x123cd6);}})['then'](function(_0x1e881e){if(_0x1e881e){return _0x1e881e?{'count':_0x677a5a,'rows':_0x1e881e}:null;}})[_0x6f95('0x25')](respondWithResult(_0x205998,null))[_0x6f95('0x49')](handleError(_0x205998,null));}; \ No newline at end of file +var _0xba2b=['attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','get','CustomDashboards','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Dashboard','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','omit','createdAt','updatedAt','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrEmailAccounts','web-report','attrReport','reportType'];(function(_0x2b39a7,_0x4e711c){var _0x4122e0=function(_0x54c615){while(--_0x54c615){_0x2b39a7['push'](_0x2b39a7['shift']());}};_0x4122e0(++_0x4e711c);}(_0xba2b,0x190));var _0xbba2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba2b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbba2('0x0'));var zipdir=require(_0xbba2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbba2('0x2'));var moment=require(_0xbba2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbba2('0x4'));var util=require('util');var path=require(_0xbba2('0x5'));var sox=require(_0xbba2('0x6'));var csv=require(_0xbba2('0x7'));var ejs=require(_0xbba2('0x8'));var fs=require('fs');var fs_extra=require(_0xbba2('0x9'));var _=require(_0xbba2('0xa'));var squel=require(_0xbba2('0xb'));var crypto=require(_0xbba2('0xc'));var jsforce=require(_0xbba2('0xd'));var deskjs=require(_0xbba2('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbba2('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbba2('0x10'));var as=require(_0xbba2('0x11'));var hardwareService=require(_0xbba2('0x12'));var logger=require('../../config/logger')(_0xbba2('0x13'));var utils=require(_0xbba2('0x14'));var config=require(_0xbba2('0x15'));var licenseUtil=require(_0xbba2('0x16'));var db=require(_0xbba2('0x17'))['db'];config[_0xbba2('0x18')]=_[_0xbba2('0x19')](config[_0xbba2('0x18')],{'host':_0xbba2('0x1a'),'port':0x18eb});var socket=require(_0xbba2('0x1b'))(new Redis(config[_0xbba2('0x18')]));require(_0xbba2('0x1c'))[_0xbba2('0x1d')](socket);function respondWithStatusCode(_0x2061e1,_0x3d5d93){_0x3d5d93=_0x3d5d93||0xcc;return function(_0xb89af0){if(_0xb89af0){return _0x2061e1[_0xbba2('0x1e')](_0x3d5d93);}return _0x2061e1[_0xbba2('0x1f')](_0x3d5d93)[_0xbba2('0x20')]();};}function respondWithResult(_0x1b85c0,_0x54f144){_0x54f144=_0x54f144||0xc8;return function(_0x8019c0){if(_0x8019c0){return _0x1b85c0[_0xbba2('0x1f')](_0x54f144)[_0xbba2('0x21')](_0x8019c0);}};}function respondWithFilteredResult(_0x94c8de,_0x5d519b){return function(_0x5684af){if(_0x5684af){var _0x2cfaa2=typeof _0x5d519b[_0xbba2('0x22')]===_0xbba2('0x23')&&typeof _0x5d519b['limit']==='undefined';var _0x14cedb=_0x5684af['count'];var _0x3fe6ae=_0x2cfaa2?0x0:_0x5d519b['offset'];var _0x4ebb5f=_0x2cfaa2?_0x5684af[_0xbba2('0x24')]:_0x5d519b[_0xbba2('0x22')]+_0x5d519b[_0xbba2('0x25')];var _0x3a799b;if(_0x4ebb5f>=_0x14cedb){_0x4ebb5f=_0x14cedb;_0x3a799b=0xc8;}else{_0x3a799b=0xce;}_0x94c8de[_0xbba2('0x1f')](_0x3a799b);return _0x94c8de[_0xbba2('0x26')]('Content-Range',_0x3fe6ae+'-'+_0x4ebb5f+'/'+_0x14cedb)[_0xbba2('0x21')](_0x5684af);}return null;};}function patchUpdates(_0x44778a){return function(_0x57bd40){try{jsonpatch[_0xbba2('0x27')](_0x57bd40,_0x44778a,!![]);}catch(_0x15e90a){return BPromise['reject'](_0x15e90a);}return _0x57bd40[_0xbba2('0x28')]();};}function saveUpdates(_0x3af55f,_0x2c9d50){return function(_0x2f56d5){if(_0x2f56d5){return _0x2f56d5[_0xbba2('0x29')](_0x3af55f)[_0xbba2('0x2a')](function(_0x22cce3){return _0x22cce3;});}return null;};}function removeEntity(_0x43d2f1,_0x73297e){return function(_0x3206b0){if(_0x3206b0){return _0x3206b0[_0xbba2('0x2b')]()['then'](function(){var _0x3572c3=_0x3206b0[_0xbba2('0x2c')]({'plain':!![]});var _0x31c052=_0xbba2('0x2d');return db['UserProfileResource'][_0xbba2('0x2b')]({'where':{'type':_0x31c052,'resourceId':_0x3572c3['id']}})['then'](function(){return _0x3206b0;});})[_0xbba2('0x2a')](function(){_0x43d2f1['status'](0xcc)[_0xbba2('0x20')]();});}};}function handleEntityNotFound(_0x4cfe34,_0x7512fd){return function(_0x4c7037){if(!_0x4c7037){_0x4cfe34[_0xbba2('0x1e')](0x194);}return _0x4c7037;};}function handleError(_0x2f7290,_0x411db1){_0x411db1=_0x411db1||0x1f4;return function(_0x34d78e){logger[_0xbba2('0x2e')](_0x34d78e[_0xbba2('0x2f')]);if(_0x34d78e[_0xbba2('0x30')]){delete _0x34d78e['name'];}_0x2f7290[_0xbba2('0x1f')](_0x411db1)[_0xbba2('0x31')](_0x34d78e);};}exports[_0xbba2('0x32')]=function(_0xe9b307,_0x26a7a4){var _0x196654={},_0x54fc59={},_0x1cab56={'count':0x0,'rows':[]};var _0x39d405=_[_0xbba2('0x33')](db['Dashboard'][_0xbba2('0x34')],function(_0x400d0c){return{'name':_0x400d0c[_0xbba2('0x35')],'type':_0x400d0c[_0xbba2('0x36')][_0xbba2('0x37')]};});_0x54fc59[_0xbba2('0x38')]=_[_0xbba2('0x33')](_0x39d405,_0xbba2('0x30'));_0x54fc59[_0xbba2('0x39')]=_[_0xbba2('0x3a')](_0xe9b307['query']);_0x54fc59[_0xbba2('0x3b')]=_[_0xbba2('0x3c')](_0x54fc59[_0xbba2('0x38')],_0x54fc59[_0xbba2('0x39')]);_0x196654[_0xbba2('0x3d')]=_[_0xbba2('0x3c')](_0x54fc59[_0xbba2('0x38')],qs['fields'](_0xe9b307[_0xbba2('0x39')][_0xbba2('0x3e')]));_0x196654[_0xbba2('0x3d')]=_0x196654[_0xbba2('0x3d')][_0xbba2('0x3f')]?_0x196654['attributes']:_0x54fc59[_0xbba2('0x38')];if(!_0xe9b307[_0xbba2('0x39')][_0xbba2('0x40')](_0xbba2('0x41'))){_0x196654[_0xbba2('0x25')]=qs['limit'](_0xe9b307[_0xbba2('0x39')]['limit']);_0x196654[_0xbba2('0x22')]=qs['offset'](_0xe9b307[_0xbba2('0x39')][_0xbba2('0x22')]);}_0x196654['order']=qs[_0xbba2('0x42')](_0xe9b307[_0xbba2('0x39')][_0xbba2('0x42')]);_0x196654[_0xbba2('0x43')]=qs[_0xbba2('0x3b')](_[_0xbba2('0x44')](_0xe9b307[_0xbba2('0x39')],_0x54fc59[_0xbba2('0x3b')]),_0x39d405);if(_0xe9b307['query'][_0xbba2('0x45')]){_0x196654[_0xbba2('0x43')]=_[_0xbba2('0x46')](_0x196654[_0xbba2('0x43')],{'$or':_[_0xbba2('0x33')](_0x39d405,function(_0x5b3c93){if(_0x5b3c93[_0xbba2('0x36')]!==_0xbba2('0x47')){var _0x1ac1b8={};_0x1ac1b8[_0x5b3c93[_0xbba2('0x30')]]={'$like':'%'+_0xe9b307[_0xbba2('0x39')][_0xbba2('0x45')]+'%'};return _0x1ac1b8;}})});}_0x196654=_['merge']({},_0x196654,_0xe9b307[_0xbba2('0x48')]);var _0x32a9dd={'where':_0x196654[_0xbba2('0x43')]};return db['Dashboard'][_0xbba2('0x24')](_0x32a9dd)[_0xbba2('0x2a')](function(_0x4056df){_0x1cab56[_0xbba2('0x24')]=_0x4056df;if(_0xe9b307['query'][_0xbba2('0x49')]){_0x196654[_0xbba2('0x4a')]=[{'all':!![]}];}return db[_0xbba2('0x4b')]['findAll'](_0x196654);})[_0xbba2('0x2a')](function(_0x5d2182){_0x1cab56[_0xbba2('0x4c')]=_0x5d2182;return _0x1cab56;})[_0xbba2('0x2a')](respondWithFilteredResult(_0x26a7a4,_0x196654))[_0xbba2('0x4d')](handleError(_0x26a7a4,null));};exports[_0xbba2('0x4e')]=function(_0x3623a2,_0x6ee15f){var _0x224316={'raw':![],'where':{'id':_0x3623a2['params']['id']}},_0x5658c7={};_0x5658c7['model']=_[_0xbba2('0x3a')](db[_0xbba2('0x4b')][_0xbba2('0x34')]);_0x5658c7['query']=_[_0xbba2('0x3a')](_0x3623a2['query']);_0x5658c7['filters']=_[_0xbba2('0x3c')](_0x5658c7[_0xbba2('0x38')],_0x5658c7[_0xbba2('0x39')]);_0x224316[_0xbba2('0x3d')]=_[_0xbba2('0x3c')](_0x5658c7[_0xbba2('0x38')],qs[_0xbba2('0x3e')](_0x3623a2[_0xbba2('0x39')]['fields']));_0x224316['attributes']=_0x224316[_0xbba2('0x3d')][_0xbba2('0x3f')]?_0x224316[_0xbba2('0x3d')]:_0x5658c7['model'];if(_0x3623a2[_0xbba2('0x39')][_0xbba2('0x49')]){_0x224316['include']=[{'all':!![]}];}_0x224316=_[_0xbba2('0x46')]({},_0x224316,_0x3623a2[_0xbba2('0x48')]);return db[_0xbba2('0x4b')][_0xbba2('0x4f')](_0x224316)['then'](handleEntityNotFound(_0x6ee15f,null))[_0xbba2('0x2a')](respondWithResult(_0x6ee15f,null))[_0xbba2('0x4d')](handleError(_0x6ee15f,null));};exports[_0xbba2('0x50')]=function(_0x1e134f,_0x28be90){return db[_0xbba2('0x4b')][_0xbba2('0x50')](_0x1e134f[_0xbba2('0x51')],{})[_0xbba2('0x2a')](function(_0x4df5e3){var _0x1caa28=_0x1e134f['user']['get']({'plain':!![]});if(!_0x1caa28)throw new Error(_0xbba2('0x52'));if(_0x1caa28[_0xbba2('0x53')]==='user'){var _0x28e93d=_0x4df5e3[_0xbba2('0x2c')]({'plain':!![]});var _0x43cb0a=_0xbba2('0x2d');return db[_0xbba2('0x54')][_0xbba2('0x4f')]({'where':{'name':_0x43cb0a,'userProfileId':_0x1caa28[_0xbba2('0x55')]},'raw':!![]})[_0xbba2('0x2a')](function(_0x26376d){if(_0x26376d&&_0x26376d[_0xbba2('0x56')]===0x0){return db[_0xbba2('0x57')][_0xbba2('0x50')]({'name':_0x28e93d[_0xbba2('0x30')],'resourceId':_0x28e93d['id'],'type':_0x26376d[_0xbba2('0x30')],'sectionId':_0x26376d['id']},{})[_0xbba2('0x2a')](function(){return _0x4df5e3;});}else{return _0x4df5e3;}})['catch'](function(_0x1e5b14){logger[_0xbba2('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e5b14);throw _0x1e5b14;});}return _0x4df5e3;})[_0xbba2('0x2a')](respondWithResult(_0x28be90,0xc9))[_0xbba2('0x4d')](handleError(_0x28be90,null));};exports['clone']=function(_0x206e5e,_0x586620){var _0x3e6597={'where':{'id':_0x206e5e[_0xbba2('0x58')]['id']}},_0x45fe2e={};_0x45fe2e[_0xbba2('0x38')]=_[_0xbba2('0x3a')](db[_0xbba2('0x4b')][_0xbba2('0x34')]);_0x3e6597['attributes']=_[_0xbba2('0x3c')](_0x45fe2e[_0xbba2('0x38')],qs[_0xbba2('0x3e')](_0x206e5e[_0xbba2('0x39')][_0xbba2('0x3e')]));_0x3e6597[_0xbba2('0x3d')]=_0x3e6597[_0xbba2('0x3d')][_0xbba2('0x3f')]?_0x3e6597[_0xbba2('0x3d')]:_0x45fe2e[_0xbba2('0x38')];if(_0x206e5e[_0xbba2('0x39')][_0xbba2('0x49')]){_0x3e6597['include']=[{'all':!![]}];}_0x3e6597=_[_0xbba2('0x46')]({},_0x3e6597,_0x206e5e[_0xbba2('0x48')]);return db[_0xbba2('0x4b')][_0xbba2('0x4f')](_0x3e6597)['then'](handleEntityNotFound(_0x586620,null))[_0xbba2('0x2a')](function(_0x28ed3b){if(_0x28ed3b){var _0x2b35aa=_0x28ed3b[_0xbba2('0x2c')]({'plain':!![]});_0x2b35aa=qs[_0xbba2('0x59')](_0x2b35aa,['id',_0xbba2('0x5a'),'updatedAt']);_0x206e5e['body']=_['omit'](_0x206e5e[_0xbba2('0x51')],['id','createdAt',_0xbba2('0x5b')]);return db[_0xbba2('0x4b')]['create'](_[_0xbba2('0x46')](_0x2b35aa,_0x206e5e['body']),{'include':_0x206e5e['query']['includeAll']?[{'all':!![]}]:undefined})[_0xbba2('0x2a')](function(_0x427c19){var _0x18a0cd=_0x206e5e['user']['get']({'plain':!![]});if(!_0x18a0cd)throw new Error(_0xbba2('0x52'));if(_0x18a0cd[_0xbba2('0x53')]===_0xbba2('0x5c')){var _0x1345fe=_0x427c19[_0xbba2('0x2c')]({'plain':!![]});var _0x420dbe=_0xbba2('0x2d');return db[_0xbba2('0x54')][_0xbba2('0x4f')]({'where':{'name':_0x420dbe,'userProfileId':_0x18a0cd[_0xbba2('0x55')]},'raw':!![]})['then'](function(_0xd3e4c1){if(_0xd3e4c1&&_0xd3e4c1[_0xbba2('0x56')]===0x0){return db[_0xbba2('0x57')][_0xbba2('0x50')]({'name':_0x1345fe[_0xbba2('0x30')],'resourceId':_0x1345fe['id'],'type':_0xd3e4c1[_0xbba2('0x30')],'sectionId':_0xd3e4c1['id']},{})[_0xbba2('0x2a')](function(){return _0x427c19;});}else{return _0x427c19;}})[_0xbba2('0x4d')](function(_0x3b62d6){logger['error'](_0xbba2('0x5d'),_0x3b62d6);throw _0x3b62d6;});}return _0x427c19;});}})['then'](respondWithResult(_0x586620,0xc9))['catch'](handleError(_0x586620,null));};exports[_0xbba2('0x29')]=function(_0x4d5219,_0x2440da){if(_0x4d5219[_0xbba2('0x51')]['id']){delete _0x4d5219[_0xbba2('0x51')]['id'];}return db[_0xbba2('0x4b')][_0xbba2('0x4f')]({'where':{'id':_0x4d5219[_0xbba2('0x58')]['id']}})[_0xbba2('0x2a')](handleEntityNotFound(_0x2440da,null))[_0xbba2('0x2a')](saveUpdates(_0x4d5219['body'],null))[_0xbba2('0x2a')](respondWithResult(_0x2440da,null))[_0xbba2('0x4d')](handleError(_0x2440da,null));};exports[_0xbba2('0x2b')]=function(_0x1de6b6,_0x481200){return db[_0xbba2('0x4b')][_0xbba2('0x4f')]({'where':{'id':_0x1de6b6[_0xbba2('0x58')]['id']}})[_0xbba2('0x2a')](handleEntityNotFound(_0x481200,null))[_0xbba2('0x2a')](removeEntity(_0x481200,null))[_0xbba2('0x4d')](handleError(_0x481200,null));};function widgetAttributes(_0x364d4a){try{switch(_0x364d4a[_0xbba2('0x36')]){case _0xbba2('0x5e'):return[{'name':'attrUrl','value':_0x364d4a[_0xbba2('0x5f')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x0]?_0x364d4a[_0xbba2('0x60')][0x0][_0xbba2('0x61')]:undefined)||'https://'}];case _0xbba2('0x62'):return[{'name':_0xbba2('0x63'),'value':_0x364d4a[_0xbba2('0x63')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x0]?_0x364d4a[_0xbba2('0x60')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0xbba2('0x64'),'value':_0x364d4a[_0xbba2('0x64')]||(_0x364d4a['attrs']&&_0x364d4a['attrs'][0x0]?_0x364d4a[_0xbba2('0x60')][0x0][_0xbba2('0x61')]:undefined)||_0xbba2('0x65')},{'name':_0xbba2('0x66'),'value':_0x364d4a['attrTimezone']||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x1]?_0x364d4a[_0xbba2('0x60')][0x1][_0xbba2('0x61')]:undefined)||_0xbba2('0x67')},{'name':'attrFontSize','value':_0x364d4a[_0xbba2('0x68')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x2]?_0x364d4a[_0xbba2('0x60')][0x2][_0xbba2('0x61')]:undefined)||0xc}];case'counter':return[{'name':_0xbba2('0x69'),'value':_0x364d4a['attrMetric']||(_0x364d4a['attrs']&&_0x364d4a[_0xbba2('0x60')][0x0]?_0x364d4a['attrs'][0x0]['value']:undefined)||'total'},{'name':_0xbba2('0x6a'),'value':_0x364d4a[_0xbba2('0x6a')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x1]?_0x364d4a[_0xbba2('0x60')][0x1][_0xbba2('0x61')]:undefined)||[]},{'name':'attrFontSize','value':_0x364d4a[_0xbba2('0x68')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x2]?_0x364d4a[_0xbba2('0x60')][0x2][_0xbba2('0x61')]:undefined)||0x14},{'name':_0xbba2('0x6b'),'value':_0x364d4a[_0xbba2('0x6b')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x3]?_0x364d4a[_0xbba2('0x60')][0x3][_0xbba2('0x61')]:undefined)||_0xbba2('0x6c')},{'name':'attrEmailAccounts','value':_0x364d4a['attrEmailAccounts']||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x4]?_0x364d4a[_0xbba2('0x60')][0x4][_0xbba2('0x61')]:undefined)||''},{'name':_0xbba2('0x6d'),'value':_0x364d4a['attrFaxAccounts']||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x5]?_0x364d4a[_0xbba2('0x60')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x364d4a[_0xbba2('0x6e')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x6]?_0x364d4a[_0xbba2('0x60')][0x6][_0xbba2('0x61')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x364d4a[_0xbba2('0x6f')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x7]?_0x364d4a[_0xbba2('0x60')][0x7][_0xbba2('0x61')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x364d4a[_0xbba2('0x70')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x8]?_0x364d4a['attrs'][0x8][_0xbba2('0x61')]:undefined)||''},{'name':_0xbba2('0x71'),'value':_0x364d4a[_0xbba2('0x71')]||(_0x364d4a['attrs']&&_0x364d4a[_0xbba2('0x60')][0x9]?_0x364d4a[_0xbba2('0x60')][0x9][_0xbba2('0x61')]:undefined)||''}];case _0xbba2('0x72'):case _0xbba2('0x73'):return[{'name':_0xbba2('0x74'),'value':_0x364d4a[_0xbba2('0x74')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a['attrs'][0x0]?_0x364d4a['attrs'][0x0][_0xbba2('0x61')]:undefined)||_0xbba2('0x75')},{'name':_0xbba2('0x76'),'value':_0x364d4a[_0xbba2('0x76')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x1]?_0x364d4a[_0xbba2('0x60')][0x1][_0xbba2('0x61')]:undefined)||null},{'name':_0xbba2('0x77'),'value':_0x364d4a[_0xbba2('0x77')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x2]?_0x364d4a[_0xbba2('0x60')][0x2]['value']:undefined)||null},{'name':_0xbba2('0x6a'),'value':_0x364d4a[_0xbba2('0x6a')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x3]?_0x364d4a[_0xbba2('0x60')][0x3][_0xbba2('0x61')]:undefined)||[]},{'name':_0xbba2('0x6b'),'value':_0x364d4a[_0xbba2('0x6b')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x4]?_0x364d4a[_0xbba2('0x60')][0x4]['value']:undefined)||_0xbba2('0x6c')},{'name':_0xbba2('0x78'),'value':_0x364d4a[_0xbba2('0x78')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x5]?_0x364d4a['attrs'][0x5]['value']:undefined)||''},{'name':_0xbba2('0x6d'),'value':_0x364d4a[_0xbba2('0x6d')]||(_0x364d4a['attrs']&&_0x364d4a[_0xbba2('0x60')][0x6]?_0x364d4a[_0xbba2('0x60')][0x6][_0xbba2('0x61')]:undefined)||''},{'name':_0xbba2('0x6e'),'value':_0x364d4a[_0xbba2('0x6e')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x7]?_0x364d4a['attrs'][0x7][_0xbba2('0x61')]:undefined)||''},{'name':_0xbba2('0x6f'),'value':_0x364d4a[_0xbba2('0x6f')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x8]?_0x364d4a[_0xbba2('0x60')][0x8][_0xbba2('0x61')]:undefined)||''},{'name':_0xbba2('0x70'),'value':_0x364d4a[_0xbba2('0x70')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a['attrs'][0x9]?_0x364d4a[_0xbba2('0x60')][0x9]['value']:undefined)||''},{'name':_0xbba2('0x71'),'value':_0x364d4a[_0xbba2('0x71')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0xa]?_0x364d4a['attrs'][0xa]['value']:undefined)||''}];case _0xbba2('0x79'):return[{'name':_0xbba2('0x7a'),'type':_0x364d4a[_0xbba2('0x7b')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x0]?_0x364d4a[_0xbba2('0x60')][0x0][_0xbba2('0x36')]:undefined)||null,'value':_0x364d4a['attrReport']||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a[_0xbba2('0x60')][0x0]?_0x364d4a['attrs'][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x364d4a[_0xbba2('0x7c')]||(_0x364d4a[_0xbba2('0x60')]&&_0x364d4a['attrs'][0x1]?_0x364d4a['attrs'][0x1][_0xbba2('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x2b2aad){logger['error'](_0xbba2('0x7d'),JSON[_0xbba2('0x7e')](_0x2b2aad));return[];}}exports[_0xbba2('0x7f')]=function(_0x45d752,_0x1b7724,_0xc42c91){if(_0x45d752[_0xbba2('0x51')]['id']){delete _0x45d752[_0xbba2('0x51')]['id'];}return db[_0xbba2('0x4b')][_0xbba2('0x4f')]({'where':{'id':_0x45d752[_0xbba2('0x58')]['id']}})['then'](handleEntityNotFound(_0x1b7724,null))[_0xbba2('0x2a')](function(_0x223683){if(_0x223683){_0x45d752[_0xbba2('0x51')]['DashboardId']=_0x223683['id'];_0x45d752['body']['attrs']=widgetAttributes(_0x45d752['body']);return db[_0xbba2('0x80')][_0xbba2('0x50')](_0x45d752[_0xbba2('0x51')]);}})['then'](respondWithResult(_0x1b7724,null))['catch'](handleError(_0x1b7724,null));};exports[_0xbba2('0x81')]=function(_0x430ff3,_0x11d8bd,_0x33e7d0){var _0x2bb143={};var _0x104f22={};var _0x2f5b48;var _0x116be2;return db[_0xbba2('0x4b')][_0xbba2('0x82')]({'where':{'id':_0x430ff3[_0xbba2('0x58')]['id']}})[_0xbba2('0x2a')](handleEntityNotFound(_0x11d8bd,null))[_0xbba2('0x2a')](function(_0x2a3889){if(_0x2a3889){_0x2f5b48=_0x2a3889;_0x104f22[_0xbba2('0x38')]=_[_0xbba2('0x3a')](db[_0xbba2('0x80')]['rawAttributes']);_0x104f22[_0xbba2('0x39')]=_[_0xbba2('0x3a')](_0x430ff3['query']);_0x104f22[_0xbba2('0x3b')]=_[_0xbba2('0x3c')](_0x104f22[_0xbba2('0x38')],_0x104f22[_0xbba2('0x39')]);_0x2bb143[_0xbba2('0x3d')]=_['intersection'](_0x104f22[_0xbba2('0x38')],qs[_0xbba2('0x3e')](_0x430ff3[_0xbba2('0x39')][_0xbba2('0x3e')]));_0x2bb143[_0xbba2('0x3d')]=_0x2bb143[_0xbba2('0x3d')][_0xbba2('0x3f')]?_0x2bb143['attributes']:_0x104f22[_0xbba2('0x38')];_0x2bb143['order']=qs[_0xbba2('0x42')](_0x430ff3[_0xbba2('0x39')][_0xbba2('0x42')]);_0x2bb143[_0xbba2('0x43')]=qs['filters'](_['pick'](_0x430ff3['query'],_0x104f22[_0xbba2('0x3b')]));if(_0x430ff3[_0xbba2('0x39')][_0xbba2('0x45')]){_0x2bb143[_0xbba2('0x43')]=_[_0xbba2('0x46')](_0x2bb143[_0xbba2('0x43')],{'$or':_[_0xbba2('0x33')](_0x2bb143[_0xbba2('0x3d')],function(_0x216eea){var _0x40fd4d={};_0x40fd4d[_0x216eea]={'$like':'%'+_0x430ff3[_0xbba2('0x39')][_0xbba2('0x45')]+'%'};return _0x40fd4d;})});}_0x2bb143=_['merge']({},_0x2bb143,_0x430ff3[_0xbba2('0x48')]);return _0x2f5b48[_0xbba2('0x81')](_0x2bb143);}})[_0xbba2('0x2a')](function(_0x20e3f4){if(_0x20e3f4){_0x116be2=_0x20e3f4['length'];if(!_0x430ff3[_0xbba2('0x39')][_0xbba2('0x40')]('nolimit')){_0x2bb143[_0xbba2('0x25')]=qs['limit'](_0x430ff3['query'][_0xbba2('0x25')]);_0x2bb143[_0xbba2('0x22')]=qs['offset'](_0x430ff3[_0xbba2('0x39')][_0xbba2('0x22')]);}return _0x2f5b48[_0xbba2('0x81')](_0x2bb143);}})[_0xbba2('0x2a')](function(_0x59f6fc){if(_0x59f6fc){return _0x59f6fc?{'count':_0x116be2,'rows':_0x59f6fc}:null;}})['then'](respondWithResult(_0x11d8bd,null))[_0xbba2('0x4d')](handleError(_0x11d8bd,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 64196a3..292d80f 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 _0x38b8=['remove','emit','hook','exports','../../mysqldb','save','update'];(function(_0x1465c1,_0xa8fd77){var _0x104621=function(_0x2bd254){while(--_0x2bd254){_0x1465c1['push'](_0x1465c1['shift']());}};_0x104621(++_0xa8fd77);}(_0x38b8,0x7b));var _0x838b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x38b8[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x838b('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x838b('0x1'),'afterUpdate':_0x838b('0x2'),'afterDestroy':_0x838b('0x3')};function emitEvent(_0x2d7e3d){return function(_0x262916,_0x3f1f73,_0x4c6b93){DashboardEvents[_0x838b('0x4')](_0x2d7e3d+':'+_0x262916['id'],_0x262916);DashboardEvents[_0x838b('0x4')](_0x2d7e3d,_0x262916);_0x4c6b93(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x838b('0x5')](e,emitEvent(event));}}module[_0x838b('0x6')]=DashboardEvents; \ No newline at end of file +var _0x8185=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x8185,0x127));var _0x5818=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8185[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0x5818('0x0'));var Dashboard=require(_0x5818('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5818('0x2')](0x0);var events={'afterCreate':_0x5818('0x3'),'afterUpdate':_0x5818('0x4'),'afterDestroy':'remove'};function emitEvent(_0x59270a){return function(_0x2def2f,_0x45fa9d,_0x3b34d7){DashboardEvents[_0x5818('0x5')](_0x59270a+':'+_0x2def2f['id'],_0x2def2f);DashboardEvents[_0x5818('0x5')](_0x59270a,_0x2def2f);_0x3b34d7(null);};}for(var e in events){if(events[_0x5818('0x6')](e)){var event=events[e];Dashboard[_0x5818('0x7')](e,emitEvent(event));}}module[_0x5818('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 5758760..1e3da11 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 _0x640b=['dashboards','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./dashboard.attributes','Dashboard'];(function(_0x360037,_0xd91df4){var _0x2a0887=function(_0xe5753){while(--_0xe5753){_0x360037['push'](_0x360037['shift']());}};_0x2a0887(++_0xd91df4);}(_0x640b,0x1af));var _0xb640=function(_0xe74558,_0x5273d5){_0xe74558=_0xe74558-0x0;var _0x50e228=_0x640b[_0xe74558];return _0x50e228;};'use strict';var _=require(_0xb640('0x0'));var util=require(_0xb640('0x1'));var logger=require('../../config/logger')(_0xb640('0x2'));var moment=require('moment');var BPromise=require(_0xb640('0x3'));var rp=require(_0xb640('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb640('0x5'));var config=require(_0xb640('0x6'));var attributes=require(_0xb640('0x7'));module['exports']=function(_0x4799c5,_0x516677){return _0x4799c5['define'](_0xb640('0x8'),attributes,{'tableName':_0xb640('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4e3=['exports','define','Dashboard','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes'];(function(_0x26f0a5,_0x532bb5){var _0x43557b=function(_0x6e72d3){while(--_0x6e72d3){_0x26f0a5['push'](_0x26f0a5['shift']());}};_0x43557b(++_0x532bb5);}(_0xa4e3,0x17c));var _0x3a4e=function(_0x1bc423,_0x37d4ea){_0x1bc423=_0x1bc423-0x0;var _0x4faff0=_0xa4e3[_0x1bc423];return _0x4faff0;};'use strict';var _=require(_0x3a4e('0x0'));var util=require(_0x3a4e('0x1'));var logger=require('../../config/logger')(_0x3a4e('0x2'));var moment=require(_0x3a4e('0x3'));var BPromise=require(_0x3a4e('0x4'));var rp=require(_0x3a4e('0x5'));var fs=require('fs');var path=require(_0x3a4e('0x6'));var rimraf=require(_0x3a4e('0x7'));var config=require(_0x3a4e('0x8'));var attributes=require(_0x3a4e('0x9'));module[_0x3a4e('0xa')]=function(_0xfbe0e5,_0x1f26be){return _0xfbe0e5[_0x3a4e('0xb')](_0x3a4e('0xc'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 4fb020a..6e2fe8d 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 _0xfdd9=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xe53dd6,_0x29f48d){var _0x20cdd6=function(_0x12f1d5){while(--_0x12f1d5){_0xe53dd6['push'](_0xe53dd6['shift']());}};_0x20cdd6(++_0x29f48d);}(_0xfdd9,0x19f));var _0x9fdd=function(_0x5e9edd,_0x1e3944){_0x5e9edd=_0x5e9edd-0x0;var _0x8dcbd1=_0xfdd9[_0x5e9edd];return _0x8dcbd1;};'use strict';var _=require(_0x9fdd('0x0'));var util=require(_0x9fdd('0x1'));var moment=require(_0x9fdd('0x2'));var BPromise=require(_0x9fdd('0x3'));var rs=require(_0x9fdd('0x4'));var fs=require('fs');var Redis=require(_0x9fdd('0x5'));var db=require(_0x9fdd('0x6'))['db'];var utils=require(_0x9fdd('0x7'));var logger=require(_0x9fdd('0x8'))(_0x9fdd('0x9'));var config=require(_0x9fdd('0xa'));var jayson=require(_0x9fdd('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0x9fdd('0xc')]=_[_0x9fdd('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9fdd('0xe'))(new Redis(config['redis']));require('./dashboard.socket')[_0x9fdd('0xf')](socket);function respondWithRpcPromise(_0x17331f,_0x294065,_0x9a513f){return new BPromise(function(_0x57ea03,_0x19c6be){return client[_0x9fdd('0x10')](_0x17331f,_0x9a513f)[_0x9fdd('0x11')](function(_0x342c09){logger[_0x9fdd('0x12')](_0x9fdd('0x13'),_0x294065,_0x9fdd('0x14'));logger['debug'](_0x9fdd('0x15'),_0x294065,'request\x20sent',JSON[_0x9fdd('0x16')](_0x342c09));if(_0x342c09[_0x9fdd('0x17')]){if(_0x342c09['error'][_0x9fdd('0x18')]===0x1f4){logger['error'](_0x9fdd('0x13'),_0x294065,_0x342c09[_0x9fdd('0x17')][_0x9fdd('0x19')]);return _0x19c6be(_0x342c09['error']['message']);}logger[_0x9fdd('0x17')]('Dashboard,\x20%s,\x20%s',_0x294065,_0x342c09[_0x9fdd('0x17')][_0x9fdd('0x19')]);return _0x57ea03(_0x342c09[_0x9fdd('0x17')][_0x9fdd('0x19')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x294065,_0x9fdd('0x14'));_0x57ea03(_0x342c09[_0x9fdd('0x1a')][_0x9fdd('0x19')]);}})[_0x9fdd('0x1b')](function(_0x3da5cb){logger[_0x9fdd('0x17')](_0x9fdd('0x13'),_0x294065,_0x3da5cb);_0x19c6be(_0x3da5cb);});});} \ No newline at end of file +var _0x595f=['code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','Dashboard,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x2cf397,_0x510f02){var _0x3e90dd=function(_0x1c94e4){while(--_0x1c94e4){_0x2cf397['push'](_0x2cf397['shift']());}};_0x3e90dd(++_0x510f02);}(_0x595f,0x101));var _0xf595=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x595f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf595('0x0'));var util=require(_0xf595('0x1'));var moment=require(_0xf595('0x2'));var BPromise=require(_0xf595('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf595('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf595('0x5'));var logger=require(_0xf595('0x6'))('rpc');var config=require(_0xf595('0x7'));var jayson=require(_0xf595('0x8'));var client=jayson[_0xf595('0x9')][_0xf595('0xa')]({'port':0x232a});config[_0xf595('0xb')]=_[_0xf595('0xc')](config['redis'],{'host':_0xf595('0xd'),'port':0x18eb});var socket=require(_0xf595('0xe'))(new Redis(config[_0xf595('0xb')]));require(_0xf595('0xf'))[_0xf595('0x10')](socket);function respondWithRpcPromise(_0x30ac1b,_0x54c0db,_0x36e715){return new BPromise(function(_0x428fb0,_0x3d7b78){return client[_0xf595('0x11')](_0x30ac1b,_0x36e715)['then'](function(_0x42c380){logger['info'](_0xf595('0x12'),_0x54c0db,'request\x20sent');logger[_0xf595('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x54c0db,_0xf595('0x14'),JSON[_0xf595('0x15')](_0x42c380));if(_0x42c380[_0xf595('0x16')]){if(_0x42c380['error'][_0xf595('0x17')]===0x1f4){logger[_0xf595('0x16')](_0xf595('0x12'),_0x54c0db,_0x42c380[_0xf595('0x16')][_0xf595('0x18')]);return _0x3d7b78(_0x42c380[_0xf595('0x16')][_0xf595('0x18')]);}logger[_0xf595('0x16')](_0xf595('0x12'),_0x54c0db,_0x42c380[_0xf595('0x16')]['message']);return _0x428fb0(_0x42c380['error'][_0xf595('0x18')]);}else{logger[_0xf595('0x19')](_0xf595('0x12'),_0x54c0db,_0xf595('0x14'));_0x428fb0(_0x42c380[_0xf595('0x1a')][_0xf595('0x18')]);}})[_0xf595('0x1b')](function(_0x3a6f31){logger['error'](_0xf595('0x12'),_0x54c0db,_0x3a6f31);_0x3d7b78(_0x3a6f31);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 16faefa..dec6f18 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 _0x7ca2=['./dashboard.events','save','remove','update','emit','removeListener','register','length','dashboard:'];(function(_0xb983c4,_0x679e53){var _0x4d4570=function(_0x55a876){while(--_0x55a876){_0xb983c4['push'](_0xb983c4['shift']());}};_0x4d4570(++_0x679e53);}(_0x7ca2,0x6c));var _0x27ca=function(_0x3b8069,_0x2514eb){_0x3b8069=_0x3b8069-0x0;var _0x107de3=_0x7ca2[_0x3b8069];return _0x107de3;};'use strict';var DashboardEvents=require(_0x27ca('0x0'));var events=[_0x27ca('0x1'),_0x27ca('0x2'),_0x27ca('0x3')];function createListener(_0x2b37ac,_0x26a2e5){return function(_0x57939a){_0x26a2e5[_0x27ca('0x4')](_0x2b37ac,_0x57939a);};}function removeListener(_0x2373eb,_0x20d532){return function(){DashboardEvents[_0x27ca('0x5')](_0x2373eb,_0x20d532);};}exports[_0x27ca('0x6')]=function(_0x6c565d){for(var _0x4b363e=0x0,_0x47fcf5=events[_0x27ca('0x7')];_0x4b363e<_0x47fcf5;_0x4b363e++){var _0x1504f7=events[_0x4b363e];var _0x55b05e=createListener(_0x27ca('0x8')+_0x1504f7,_0x6c565d);DashboardEvents['on'](_0x1504f7,_0x55b05e);}}; \ No newline at end of file +var _0x02ce=['removeListener','length','dashboard:','./dashboard.events','save','update'];(function(_0x2aaed0,_0x40c604){var _0x3a45db=function(_0x37b6c2){while(--_0x37b6c2){_0x2aaed0['push'](_0x2aaed0['shift']());}};_0x3a45db(++_0x40c604);}(_0x02ce,0x8d));var _0xe02c=function(_0x1fd473,_0x19826b){_0x1fd473=_0x1fd473-0x0;var _0x2c97c0=_0x02ce[_0x1fd473];return _0x2c97c0;};'use strict';var DashboardEvents=require(_0xe02c('0x0'));var events=[_0xe02c('0x1'),'remove',_0xe02c('0x2')];function createListener(_0x5da21a,_0x55c7e6){return function(_0x224a16){_0x55c7e6['emit'](_0x5da21a,_0x224a16);};}function removeListener(_0x3a9580,_0xb87319){return function(){DashboardEvents[_0xe02c('0x3')](_0x3a9580,_0xb87319);};}exports['register']=function(_0x5e2bed){for(var _0x37f705=0x0,_0x458a0c=events[_0xe02c('0x4')];_0x37f705<_0x458a0c;_0x37f705++){var _0x3a35a0=events[_0x37f705];var _0x1e25c4=createListener(_0xe02c('0x5')+_0x3a35a0,_0x5e2bed);DashboardEvents['on'](_0x3a35a0,_0x1e25c4);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index b073735..be8945f 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 _0xd27e=['destroy','exports','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','show','get','/:id/items','getItems','post','/:id/clone','clone','addItem','put','update','/:id'];(function(_0x88a19b,_0x4b09dd){var _0x3827d0=function(_0x59368f){while(--_0x59368f){_0x88a19b['push'](_0x88a19b['shift']());}};_0x3827d0(++_0x4b09dd);}(_0xd27e,0x1a6));var _0xed27=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd27e[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xed27('0x0'));var express=require(_0xed27('0x1'));var router=express[_0xed27('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xed27('0x3'));var config=require(_0xed27('0x4'));var controller=require(_0xed27('0x5'));router['get']('/',auth[_0xed27('0x6')](),controller[_0xed27('0x7')]);router['get']('/:id',auth[_0xed27('0x6')](),controller[_0xed27('0x8')]);router[_0xed27('0x9')](_0xed27('0xa'),auth[_0xed27('0x6')](),controller[_0xed27('0xb')]);router[_0xed27('0xc')]('/',auth[_0xed27('0x6')](),controller['create']);router['post'](_0xed27('0xd'),auth[_0xed27('0x6')](),controller[_0xed27('0xe')]);router[_0xed27('0xc')]('/:id/items',auth[_0xed27('0x6')](),controller[_0xed27('0xf')]);router[_0xed27('0x10')]('/:id',auth[_0xed27('0x6')](),controller[_0xed27('0x11')]);router['delete'](_0xed27('0x12'),auth[_0xed27('0x6')](),controller[_0xed27('0x13')]);module[_0xed27('0x14')]=router; \ No newline at end of file +var _0x1d3c=['create','/:id/clone','clone','addItem','put','update','delete','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated','show','/:id/items','getItems','post'];(function(_0x12bccf,_0x305dad){var _0x327ed0=function(_0x2b1c9){while(--_0x2b1c9){_0x12bccf['push'](_0x12bccf['shift']());}};_0x327ed0(++_0x305dad);}(_0x1d3c,0x188));var _0xc1d3=function(_0x4b6507,_0x5518b5){_0x4b6507=_0x4b6507-0x0;var _0x2001ec=_0x1d3c[_0x4b6507];return _0x2001ec;};'use strict';var multer=require(_0xc1d3('0x0'));var util=require(_0xc1d3('0x1'));var path=require('path');var timeout=require(_0xc1d3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc1d3('0x3'));var auth=require(_0xc1d3('0x4'));var interaction=require(_0xc1d3('0x5'));var config=require(_0xc1d3('0x6'));var controller=require(_0xc1d3('0x7'));router[_0xc1d3('0x8')]('/',auth['isAuthenticated'](),controller[_0xc1d3('0x9')]);router[_0xc1d3('0x8')](_0xc1d3('0xa'),auth[_0xc1d3('0xb')](),controller[_0xc1d3('0xc')]);router[_0xc1d3('0x8')](_0xc1d3('0xd'),auth[_0xc1d3('0xb')](),controller[_0xc1d3('0xe')]);router[_0xc1d3('0xf')]('/',auth[_0xc1d3('0xb')](),controller[_0xc1d3('0x10')]);router[_0xc1d3('0xf')](_0xc1d3('0x11'),auth[_0xc1d3('0xb')](),controller[_0xc1d3('0x12')]);router[_0xc1d3('0xf')](_0xc1d3('0xd'),auth[_0xc1d3('0xb')](),controller[_0xc1d3('0x13')]);router[_0xc1d3('0x14')](_0xc1d3('0xa'),auth[_0xc1d3('0xb')](),controller[_0xc1d3('0x15')]);router[_0xc1d3('0x16')](_0xc1d3('0xa'),auth[_0xc1d3('0xb')](),controller['destroy']);module[_0xc1d3('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 239e30b..e432454 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 _0xc1c6=['long','parse','setDataValue','stringify','attrs','INTEGER','#ffffff','sequelize','squel','lodash','STRING','TEXT'];(function(_0x1610eb,_0x10dbe4){var _0x123faa=function(_0x3de867){while(--_0x3de867){_0x1610eb['push'](_0x1610eb['shift']());}};_0x123faa(++_0x10dbe4);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x469596,_0x284423){_0x469596=_0x469596-0x0;var _0xbfef64=_0xc1c6[_0x469596];return _0xbfef64;};'use strict';var Sequelize=require(_0x6c1c('0x0'));var squel=require(_0x6c1c('0x1'));var _=require(_0x6c1c('0x2'));module['exports']={'title':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6c1c('0x4')](_0x6c1c('0x5')),'get':function(){try{return JSON[_0x6c1c('0x6')](this['getDataValue']('attrs'));}catch(_0x32af84){return[];}},'set':function(_0x524a6b){try{this[_0x6c1c('0x7')]('attrs',JSON[_0x6c1c('0x8')](_0x524a6b));}catch(_0x2eb1ba){this[_0x6c1c('0x7')](_0x6c1c('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x6c1c('0xa')]},'background':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':_0x6c1c('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6c1c('0x3')]},'titleFontSize':{'type':Sequelize[_0x6c1c('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xeff8=['sequelize','squel','exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x952a2f,_0x26024c){var _0x3c6c08=function(_0x32ba1f){while(--_0x32ba1f){_0x952a2f['push'](_0x952a2f['shift']());}};_0x3c6c08(++_0x26024c);}(_0xeff8,0x186));var _0x8eff=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xeff8[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0x8eff('0x0'));var squel=require(_0x8eff('0x1'));var _=require('lodash');module[_0x8eff('0x2')]={'title':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8eff('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x8eff('0x4')),'get':function(){try{return JSON[_0x8eff('0x5')](this[_0x8eff('0x6')](_0x8eff('0x7')));}catch(_0x4ac51c){return[];}},'set':function(_0x469641){try{this[_0x8eff('0x8')](_0x8eff('0x7'),JSON[_0x8eff('0x9')](_0x469641));}catch(_0x491f01){this[_0x8eff('0x8')](_0x8eff('0x7'),JSON[_0x8eff('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x8eff('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x8eff('0xa')]},'background':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![],'defaultValue':_0x8eff('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8eff('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8eff('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index a86c539..157e25e 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 _0x4cc7=['attrMetric','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrEmailAccounts','attrReport','reportType','attrRefresh','error','create','body','eml-format','rimraf','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','../../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','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','name','send','show','params','model','DashboardItem','rawAttributes','query','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize'];(function(_0x41c310,_0x137605){var _0x2c5a69=function(_0x5a1a6a){while(--_0x5a1a6a){_0x41c310['push'](_0x41c310['shift']());}};_0x2c5a69(++_0x137605);}(_0x4cc7,0x1b6));var _0x74cc=function(_0x12e7d4,_0x44ed1e){_0x12e7d4=_0x12e7d4-0x0;var _0xa8f92a=_0x4cc7[_0x12e7d4];return _0xa8f92a;};'use strict';var emlformat=require(_0x74cc('0x0'));var rimraf=require(_0x74cc('0x1'));var zipdir=require(_0x74cc('0x2'));var jsonpatch=require(_0x74cc('0x3'));var rp=require(_0x74cc('0x4'));var moment=require(_0x74cc('0x5'));var BPromise=require(_0x74cc('0x6'));var Mustache=require(_0x74cc('0x7'));var util=require('util');var path=require(_0x74cc('0x8'));var sox=require(_0x74cc('0x9'));var csv=require(_0x74cc('0xa'));var ejs=require(_0x74cc('0xb'));var fs=require('fs');var fs_extra=require(_0x74cc('0xc'));var _=require(_0x74cc('0xd'));var squel=require(_0x74cc('0xe'));var crypto=require(_0x74cc('0xf'));var jsforce=require(_0x74cc('0x10'));var deskjs=require(_0x74cc('0x11'));var toCsv=require(_0x74cc('0xa'));var querystring=require(_0x74cc('0x12'));var Papa=require(_0x74cc('0x13'));var Redis=require('ioredis');var authService=require(_0x74cc('0x14'));var qs=require(_0x74cc('0x15'));var as=require(_0x74cc('0x16'));var hardwareService=require(_0x74cc('0x17'));var logger=require(_0x74cc('0x18'))(_0x74cc('0x19'));var utils=require(_0x74cc('0x1a'));var config=require(_0x74cc('0x1b'));var licenseUtil=require(_0x74cc('0x1c'));var db=require(_0x74cc('0x1d'))['db'];config[_0x74cc('0x1e')]=_[_0x74cc('0x1f')](config['redis'],{'host':_0x74cc('0x20'),'port':0x18eb});var socket=require(_0x74cc('0x21'))(new Redis(config[_0x74cc('0x1e')]));require('./dashboardItem.socket')[_0x74cc('0x22')](socket);function respondWithStatusCode(_0x1a2b8b,_0x300fda){_0x300fda=_0x300fda||0xcc;return function(_0x1d248c){if(_0x1d248c){return _0x1a2b8b[_0x74cc('0x23')](_0x300fda);}return _0x1a2b8b[_0x74cc('0x24')](_0x300fda)[_0x74cc('0x25')]();};}function respondWithResult(_0x47e76b,_0x363163){_0x363163=_0x363163||0xc8;return function(_0x5d8c7b){if(_0x5d8c7b){return _0x47e76b['status'](_0x363163)[_0x74cc('0x26')](_0x5d8c7b);}};}function respondWithFilteredResult(_0x388de9,_0x2339fe){return function(_0x1fb365){if(_0x1fb365){var _0x321995=typeof _0x2339fe['offset']===_0x74cc('0x27')&&typeof _0x2339fe[_0x74cc('0x28')]===_0x74cc('0x27');var _0x15bf31=_0x1fb365[_0x74cc('0x29')];var _0x744ea2=_0x321995?0x0:_0x2339fe[_0x74cc('0x2a')];var _0x261bf7=_0x321995?_0x1fb365[_0x74cc('0x29')]:_0x2339fe[_0x74cc('0x2a')]+_0x2339fe['limit'];var _0x44812d;if(_0x261bf7>=_0x15bf31){_0x261bf7=_0x15bf31;_0x44812d=0xc8;}else{_0x44812d=0xce;}_0x388de9[_0x74cc('0x24')](_0x44812d);return _0x388de9[_0x74cc('0x2b')](_0x74cc('0x2c'),_0x744ea2+'-'+_0x261bf7+'/'+_0x15bf31)[_0x74cc('0x26')](_0x1fb365);}return null;};}function patchUpdates(_0x18183c){return function(_0x2cc96f){try{jsonpatch[_0x74cc('0x2d')](_0x2cc96f,_0x18183c,!![]);}catch(_0x3d5f3c){return BPromise['reject'](_0x3d5f3c);}return _0x2cc96f[_0x74cc('0x2e')]();};}function saveUpdates(_0x3c327d,_0x5912ea){return function(_0x44c079){if(_0x44c079){return _0x44c079[_0x74cc('0x2f')](_0x3c327d)[_0x74cc('0x30')](function(_0x26aa57){return _0x26aa57;});}return null;};}function removeEntity(_0x21b42b,_0x4a14ad){return function(_0x33fc24){if(_0x33fc24){return _0x33fc24[_0x74cc('0x31')]()['then'](function(){_0x21b42b[_0x74cc('0x24')](0xcc)[_0x74cc('0x25')]();});}};}function handleEntityNotFound(_0x2843f6,_0x1a7739){return function(_0x31daaa){if(!_0x31daaa){_0x2843f6[_0x74cc('0x23')](0x194);}return _0x31daaa;};}function handleError(_0x581872,_0x2c671c){_0x2c671c=_0x2c671c||0x1f4;return function(_0x42a856){logger['error'](_0x42a856['stack']);if(_0x42a856[_0x74cc('0x32')]){delete _0x42a856[_0x74cc('0x32')];}_0x581872[_0x74cc('0x24')](_0x2c671c)[_0x74cc('0x33')](_0x42a856);};}exports[_0x74cc('0x34')]=function(_0x312053,_0x28923e){var _0x4ddc7e={'raw':![],'where':{'id':_0x312053[_0x74cc('0x35')]['id']}},_0x3ffe94={};_0x3ffe94[_0x74cc('0x36')]=_['keys'](db[_0x74cc('0x37')][_0x74cc('0x38')]);_0x3ffe94[_0x74cc('0x39')]=_[_0x74cc('0x3a')](_0x312053[_0x74cc('0x39')]);_0x3ffe94[_0x74cc('0x3b')]=_[_0x74cc('0x3c')](_0x3ffe94[_0x74cc('0x36')],_0x3ffe94[_0x74cc('0x39')]);_0x4ddc7e[_0x74cc('0x3d')]=_[_0x74cc('0x3c')](_0x3ffe94[_0x74cc('0x36')],qs[_0x74cc('0x3e')](_0x312053[_0x74cc('0x39')][_0x74cc('0x3e')]));_0x4ddc7e[_0x74cc('0x3d')]=_0x4ddc7e[_0x74cc('0x3d')]['length']?_0x4ddc7e['attributes']:_0x3ffe94[_0x74cc('0x36')];if(_0x312053[_0x74cc('0x39')][_0x74cc('0x3f')]){_0x4ddc7e[_0x74cc('0x40')]=[{'all':!![]}];}_0x4ddc7e=_[_0x74cc('0x41')]({},_0x4ddc7e,_0x312053[_0x74cc('0x42')]);return db[_0x74cc('0x37')][_0x74cc('0x43')](_0x4ddc7e)[_0x74cc('0x30')](handleEntityNotFound(_0x28923e,null))[_0x74cc('0x30')](respondWithResult(_0x28923e,null))[_0x74cc('0x44')](handleError(_0x28923e,null));};exports[_0x74cc('0x31')]=function(_0x597c1f,_0x573353){return db[_0x74cc('0x37')][_0x74cc('0x43')]({'where':{'id':_0x597c1f[_0x74cc('0x35')]['id']}})[_0x74cc('0x30')](handleEntityNotFound(_0x573353,null))[_0x74cc('0x30')](removeEntity(_0x573353,null))[_0x74cc('0x44')](handleError(_0x573353,null));};function widgetAttributes(_0x38d4e2){try{switch(_0x38d4e2[_0x74cc('0x45')]){case _0x74cc('0x46'):return[{'name':_0x74cc('0x47'),'value':_0x38d4e2[_0x74cc('0x47')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x0]?_0x38d4e2[_0x74cc('0x48')][0x0][_0x74cc('0x49')]:undefined)||_0x74cc('0x4a')}];case _0x74cc('0x4b'):return[{'name':_0x74cc('0x4c'),'value':_0x38d4e2[_0x74cc('0x4c')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2['attrs'][0x0]?_0x38d4e2[_0x74cc('0x48')][0x0][_0x74cc('0x49')]:undefined)||''}];case _0x74cc('0x4d'):return[{'name':_0x74cc('0x4e'),'value':_0x38d4e2['attrHourFormat']||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x0]?_0x38d4e2[_0x74cc('0x48')][0x0][_0x74cc('0x49')]:undefined)||'HH:mm:ss'},{'name':_0x74cc('0x4f'),'value':_0x38d4e2['attrTimezone']||(_0x38d4e2['attrs']&&_0x38d4e2['attrs'][0x1]?_0x38d4e2[_0x74cc('0x48')][0x1][_0x74cc('0x49')]:undefined)||_0x74cc('0x50')},{'name':_0x74cc('0x51'),'value':_0x38d4e2[_0x74cc('0x51')]||(_0x38d4e2['attrs']&&_0x38d4e2['attrs'][0x2]?_0x38d4e2[_0x74cc('0x48')][0x2][_0x74cc('0x49')]:undefined)||0xc}];case'counter':return[{'name':_0x74cc('0x52'),'value':_0x38d4e2[_0x74cc('0x52')]||(_0x38d4e2['attrs']&&_0x38d4e2[_0x74cc('0x48')][0x0]?_0x38d4e2['attrs'][0x0]['value']:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x38d4e2[_0x74cc('0x53')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2['attrs'][0x1]?_0x38d4e2['attrs'][0x1]['value']:undefined)||[]},{'name':_0x74cc('0x51'),'value':_0x38d4e2['attrFontSize']||(_0x38d4e2['attrs']&&_0x38d4e2[_0x74cc('0x48')][0x2]?_0x38d4e2['attrs'][0x2][_0x74cc('0x49')]:undefined)||0x14},{'name':_0x74cc('0x54'),'value':_0x38d4e2[_0x74cc('0x54')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x3]?_0x38d4e2[_0x74cc('0x48')][0x3][_0x74cc('0x49')]:undefined)||_0x74cc('0x55')},{'name':'attrEmailAccounts','value':_0x38d4e2['attrEmailAccounts']||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x4]?_0x38d4e2['attrs'][0x4][_0x74cc('0x49')]:undefined)||''},{'name':_0x74cc('0x56'),'value':_0x38d4e2[_0x74cc('0x56')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x5]?_0x38d4e2[_0x74cc('0x48')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x38d4e2[_0x74cc('0x57')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x6]?_0x38d4e2['attrs'][0x6]['value']:undefined)||''},{'name':_0x74cc('0x58'),'value':_0x38d4e2[_0x74cc('0x58')]||(_0x38d4e2['attrs']&&_0x38d4e2[_0x74cc('0x48')][0x7]?_0x38d4e2[_0x74cc('0x48')][0x7][_0x74cc('0x49')]:undefined)||''},{'name':_0x74cc('0x59'),'value':_0x38d4e2['attrWhatsappAccounts']||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2['attrs'][0x8]?_0x38d4e2['attrs'][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x38d4e2[_0x74cc('0x5a')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x9]?_0x38d4e2[_0x74cc('0x48')][0x9][_0x74cc('0x49')]:undefined)||''}];case _0x74cc('0x5b'):case _0x74cc('0x5c'):return[{'name':_0x74cc('0x5d'),'value':_0x38d4e2['attrSerie1']||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x0]?_0x38d4e2[_0x74cc('0x48')][0x0][_0x74cc('0x49')]:undefined)||_0x74cc('0x5e')},{'name':_0x74cc('0x5f'),'value':_0x38d4e2[_0x74cc('0x5f')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2['attrs'][0x1]?_0x38d4e2['attrs'][0x1][_0x74cc('0x49')]:undefined)||null},{'name':_0x74cc('0x60'),'value':_0x38d4e2[_0x74cc('0x60')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x2]?_0x38d4e2[_0x74cc('0x48')][0x2][_0x74cc('0x49')]:undefined)||null},{'name':_0x74cc('0x53'),'value':_0x38d4e2[_0x74cc('0x53')]||(_0x38d4e2['attrs']&&_0x38d4e2[_0x74cc('0x48')][0x3]?_0x38d4e2[_0x74cc('0x48')][0x3][_0x74cc('0x49')]:undefined)||[]},{'name':_0x74cc('0x54'),'value':_0x38d4e2[_0x74cc('0x54')]||(_0x38d4e2['attrs']&&_0x38d4e2[_0x74cc('0x48')][0x4]?_0x38d4e2['attrs'][0x4][_0x74cc('0x49')]:undefined)||'voice'},{'name':_0x74cc('0x61'),'value':_0x38d4e2[_0x74cc('0x61')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x5]?_0x38d4e2[_0x74cc('0x48')][0x5][_0x74cc('0x49')]:undefined)||''},{'name':_0x74cc('0x56'),'value':_0x38d4e2['attrFaxAccounts']||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x6]?_0x38d4e2[_0x74cc('0x48')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x38d4e2[_0x74cc('0x57')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x7]?_0x38d4e2[_0x74cc('0x48')][0x7][_0x74cc('0x49')]:undefined)||''},{'name':_0x74cc('0x58'),'value':_0x38d4e2[_0x74cc('0x58')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2['attrs'][0x8]?_0x38d4e2[_0x74cc('0x48')][0x8][_0x74cc('0x49')]:undefined)||''},{'name':_0x74cc('0x59'),'value':_0x38d4e2[_0x74cc('0x59')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2['attrs'][0x9]?_0x38d4e2['attrs'][0x9][_0x74cc('0x49')]:undefined)||''},{'name':_0x74cc('0x5a'),'value':_0x38d4e2[_0x74cc('0x5a')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2['attrs'][0xa]?_0x38d4e2['attrs'][0xa][_0x74cc('0x49')]:undefined)||''}];case'web-report':return[{'name':_0x74cc('0x62'),'type':_0x38d4e2[_0x74cc('0x63')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x0]?_0x38d4e2[_0x74cc('0x48')][0x0][_0x74cc('0x45')]:undefined)||null,'value':_0x38d4e2['attrReport']||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x0]?_0x38d4e2[_0x74cc('0x48')][0x0][_0x74cc('0x49')]:undefined)||null},{'name':'attrRefresh','value':_0x38d4e2[_0x74cc('0x64')]||(_0x38d4e2[_0x74cc('0x48')]&&_0x38d4e2[_0x74cc('0x48')][0x1]?_0x38d4e2[_0x74cc('0x48')][0x1][_0x74cc('0x49')]:undefined)||0x0}];default:return[];}}catch(_0xf592e8){logger[_0x74cc('0x65')]('widgetAttributes:\x20%s',JSON['stringify'](_0xf592e8));return[];}}exports[_0x74cc('0x66')]=function(_0x2f4bc4,_0x3cdf35){if(_0x2f4bc4['body']){_0x2f4bc4[_0x74cc('0x67')]['attrs']=widgetAttributes(_0x2f4bc4['body']);}return db[_0x74cc('0x37')]['create'](_0x2f4bc4['body'],{})[_0x74cc('0x30')](respondWithResult(_0x3cdf35,0xc9))[_0x74cc('0x44')](handleError(_0x3cdf35,null));};exports[_0x74cc('0x2f')]=function(_0x42561d,_0x4af75f){if(_0x42561d[_0x74cc('0x67')]['id']){delete _0x42561d[_0x74cc('0x67')]['id'];}_0x42561d['body'][_0x74cc('0x48')]=widgetAttributes(_0x42561d[_0x74cc('0x67')]);return db[_0x74cc('0x37')]['find']({'where':{'id':_0x42561d[_0x74cc('0x35')]['id']}})[_0x74cc('0x30')](handleEntityNotFound(_0x4af75f,null))['then'](saveUpdates(_0x42561d[_0x74cc('0x67')],null))[_0x74cc('0x30')](respondWithResult(_0x4af75f,null))[_0x74cc('0x44')](handleError(_0x4af75f,null));}; \ No newline at end of file +var _0x2af8=['params','DashboardItem','keys','query','model','attributes','intersection','fields','includeAll','include','merge','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrEmailAccounts','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','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/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','name','send','show'];(function(_0x378c1d,_0x1f4d34){var _0x531358=function(_0x34e854){while(--_0x34e854){_0x378c1d['push'](_0x378c1d['shift']());}};_0x531358(++_0x1f4d34);}(_0x2af8,0xf6));var _0x82af=function(_0x25327e,_0xb2a66d){_0x25327e=_0x25327e-0x0;var _0xdc22cb=_0x2af8[_0x25327e];return _0xdc22cb;};'use strict';var emlformat=require(_0x82af('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x82af('0x1'));var jsonpatch=require(_0x82af('0x2'));var rp=require('request-promise');var moment=require(_0x82af('0x3'));var BPromise=require(_0x82af('0x4'));var Mustache=require('mustache');var util=require(_0x82af('0x5'));var path=require('path');var sox=require(_0x82af('0x6'));var csv=require(_0x82af('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x82af('0x8'));var _=require(_0x82af('0x9'));var squel=require('squel');var crypto=require(_0x82af('0xa'));var jsforce=require(_0x82af('0xb'));var deskjs=require(_0x82af('0xc'));var toCsv=require(_0x82af('0x7'));var querystring=require(_0x82af('0xd'));var Papa=require(_0x82af('0xe'));var Redis=require(_0x82af('0xf'));var authService=require(_0x82af('0x10'));var qs=require(_0x82af('0x11'));var as=require(_0x82af('0x12'));var hardwareService=require(_0x82af('0x13'));var logger=require(_0x82af('0x14'))(_0x82af('0x15'));var utils=require(_0x82af('0x16'));var config=require(_0x82af('0x17'));var licenseUtil=require(_0x82af('0x18'));var db=require(_0x82af('0x19'))['db'];config[_0x82af('0x1a')]=_['defaults'](config['redis'],{'host':_0x82af('0x1b'),'port':0x18eb});var socket=require(_0x82af('0x1c'))(new Redis(config[_0x82af('0x1a')]));require('./dashboardItem.socket')[_0x82af('0x1d')](socket);function respondWithStatusCode(_0x18332f,_0x195bd2){_0x195bd2=_0x195bd2||0xcc;return function(_0x2b7ce8){if(_0x2b7ce8){return _0x18332f['sendStatus'](_0x195bd2);}return _0x18332f[_0x82af('0x1e')](_0x195bd2)[_0x82af('0x1f')]();};}function respondWithResult(_0x25b822,_0x23e035){_0x23e035=_0x23e035||0xc8;return function(_0x216527){if(_0x216527){return _0x25b822[_0x82af('0x1e')](_0x23e035)[_0x82af('0x20')](_0x216527);}};}function respondWithFilteredResult(_0x42f7f2,_0x2b5fef){return function(_0x225b68){if(_0x225b68){var _0x3e6bd5=typeof _0x2b5fef[_0x82af('0x21')]===_0x82af('0x22')&&typeof _0x2b5fef['limit']===_0x82af('0x22');var _0x2139f8=_0x225b68[_0x82af('0x23')];var _0x20cc9e=_0x3e6bd5?0x0:_0x2b5fef['offset'];var _0x5be0d8=_0x3e6bd5?_0x225b68[_0x82af('0x23')]:_0x2b5fef['offset']+_0x2b5fef[_0x82af('0x24')];var _0x17a58a;if(_0x5be0d8>=_0x2139f8){_0x5be0d8=_0x2139f8;_0x17a58a=0xc8;}else{_0x17a58a=0xce;}_0x42f7f2[_0x82af('0x1e')](_0x17a58a);return _0x42f7f2[_0x82af('0x25')](_0x82af('0x26'),_0x20cc9e+'-'+_0x5be0d8+'/'+_0x2139f8)[_0x82af('0x20')](_0x225b68);}return null;};}function patchUpdates(_0x6e416b){return function(_0x4f6d08){try{jsonpatch[_0x82af('0x27')](_0x4f6d08,_0x6e416b,!![]);}catch(_0x4e8b45){return BPromise[_0x82af('0x28')](_0x4e8b45);}return _0x4f6d08['save']();};}function saveUpdates(_0x5ed461,_0x74853c){return function(_0x582800){if(_0x582800){return _0x582800[_0x82af('0x29')](_0x5ed461)[_0x82af('0x2a')](function(_0x158a9a){return _0x158a9a;});}return null;};}function removeEntity(_0xad287e,_0x436d07){return function(_0x21123d){if(_0x21123d){return _0x21123d[_0x82af('0x2b')]()[_0x82af('0x2a')](function(){_0xad287e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x122825,_0x37cf2b){return function(_0x5c0a33){if(!_0x5c0a33){_0x122825[_0x82af('0x2c')](0x194);}return _0x5c0a33;};}function handleError(_0x2e6753,_0x428c5e){_0x428c5e=_0x428c5e||0x1f4;return function(_0x1561f7){logger['error'](_0x1561f7['stack']);if(_0x1561f7[_0x82af('0x2d')]){delete _0x1561f7[_0x82af('0x2d')];}_0x2e6753[_0x82af('0x1e')](_0x428c5e)[_0x82af('0x2e')](_0x1561f7);};}exports[_0x82af('0x2f')]=function(_0x1fb8e6,_0x389452){var _0x9cdb3a={'raw':![],'where':{'id':_0x1fb8e6[_0x82af('0x30')]['id']}},_0x2c7aa6={};_0x2c7aa6['model']=_['keys'](db[_0x82af('0x31')]['rawAttributes']);_0x2c7aa6['query']=_[_0x82af('0x32')](_0x1fb8e6[_0x82af('0x33')]);_0x2c7aa6['filters']=_['intersection'](_0x2c7aa6[_0x82af('0x34')],_0x2c7aa6[_0x82af('0x33')]);_0x9cdb3a[_0x82af('0x35')]=_[_0x82af('0x36')](_0x2c7aa6['model'],qs[_0x82af('0x37')](_0x1fb8e6[_0x82af('0x33')][_0x82af('0x37')]));_0x9cdb3a[_0x82af('0x35')]=_0x9cdb3a[_0x82af('0x35')]['length']?_0x9cdb3a[_0x82af('0x35')]:_0x2c7aa6[_0x82af('0x34')];if(_0x1fb8e6[_0x82af('0x33')][_0x82af('0x38')]){_0x9cdb3a[_0x82af('0x39')]=[{'all':!![]}];}_0x9cdb3a=_[_0x82af('0x3a')]({},_0x9cdb3a,_0x1fb8e6['options']);return db[_0x82af('0x31')][_0x82af('0x3b')](_0x9cdb3a)[_0x82af('0x2a')](handleEntityNotFound(_0x389452,null))[_0x82af('0x2a')](respondWithResult(_0x389452,null))[_0x82af('0x3c')](handleError(_0x389452,null));};exports[_0x82af('0x2b')]=function(_0x537a1d,_0x18e212){return db[_0x82af('0x31')][_0x82af('0x3b')]({'where':{'id':_0x537a1d[_0x82af('0x30')]['id']}})[_0x82af('0x2a')](handleEntityNotFound(_0x18e212,null))[_0x82af('0x2a')](removeEntity(_0x18e212,null))['catch'](handleError(_0x18e212,null));};function widgetAttributes(_0x45c006){try{switch(_0x45c006[_0x82af('0x3d')]){case _0x82af('0x3e'):return[{'name':_0x82af('0x3f'),'value':_0x45c006['attrUrl']||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x0]?_0x45c006['attrs'][0x0][_0x82af('0x41')]:undefined)||_0x82af('0x42')}];case _0x82af('0x43'):return[{'name':_0x82af('0x44'),'value':_0x45c006[_0x82af('0x44')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006['attrs'][0x0]?_0x45c006[_0x82af('0x40')][0x0]['value']:undefined)||''}];case _0x82af('0x45'):return[{'name':_0x82af('0x46'),'value':_0x45c006[_0x82af('0x46')]||(_0x45c006['attrs']&&_0x45c006[_0x82af('0x40')][0x0]?_0x45c006[_0x82af('0x40')][0x0][_0x82af('0x41')]:undefined)||_0x82af('0x47')},{'name':_0x82af('0x48'),'value':_0x45c006[_0x82af('0x48')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x1]?_0x45c006[_0x82af('0x40')][0x1]['value']:undefined)||_0x82af('0x49')},{'name':'attrFontSize','value':_0x45c006[_0x82af('0x4a')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x2]?_0x45c006['attrs'][0x2][_0x82af('0x41')]:undefined)||0xc}];case _0x82af('0x4b'):return[{'name':_0x82af('0x4c'),'value':_0x45c006[_0x82af('0x4c')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006['attrs'][0x0]?_0x45c006[_0x82af('0x40')][0x0][_0x82af('0x41')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x45c006[_0x82af('0x4d')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x1]?_0x45c006['attrs'][0x1][_0x82af('0x41')]:undefined)||[]},{'name':_0x82af('0x4a'),'value':_0x45c006[_0x82af('0x4a')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006['attrs'][0x2]?_0x45c006[_0x82af('0x40')][0x2][_0x82af('0x41')]:undefined)||0x14},{'name':_0x82af('0x4e'),'value':_0x45c006[_0x82af('0x4e')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x3]?_0x45c006['attrs'][0x3]['value']:undefined)||_0x82af('0x4f')},{'name':'attrEmailAccounts','value':_0x45c006['attrEmailAccounts']||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x4]?_0x45c006[_0x82af('0x40')][0x4][_0x82af('0x41')]:undefined)||''},{'name':_0x82af('0x50'),'value':_0x45c006['attrFaxAccounts']||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x5]?_0x45c006['attrs'][0x5][_0x82af('0x41')]:undefined)||''},{'name':_0x82af('0x51'),'value':_0x45c006[_0x82af('0x51')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x6]?_0x45c006[_0x82af('0x40')][0x6][_0x82af('0x41')]:undefined)||''},{'name':_0x82af('0x52'),'value':_0x45c006['attrOpenchannelAccounts']||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x7]?_0x45c006['attrs'][0x7][_0x82af('0x41')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x45c006[_0x82af('0x53')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x8]?_0x45c006[_0x82af('0x40')][0x8][_0x82af('0x41')]:undefined)||''},{'name':_0x82af('0x54'),'value':_0x45c006[_0x82af('0x54')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x9]?_0x45c006[_0x82af('0x40')][0x9]['value']:undefined)||''}];case _0x82af('0x55'):case _0x82af('0x56'):return[{'name':_0x82af('0x57'),'value':_0x45c006[_0x82af('0x57')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x0]?_0x45c006[_0x82af('0x40')][0x0]['value']:undefined)||'total'},{'name':_0x82af('0x58'),'value':_0x45c006['attrSerie2']||(_0x45c006[_0x82af('0x40')]&&_0x45c006['attrs'][0x1]?_0x45c006[_0x82af('0x40')][0x1][_0x82af('0x41')]:undefined)||null},{'name':_0x82af('0x59'),'value':_0x45c006[_0x82af('0x59')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x2]?_0x45c006['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x45c006[_0x82af('0x4d')]||(_0x45c006['attrs']&&_0x45c006[_0x82af('0x40')][0x3]?_0x45c006[_0x82af('0x40')][0x3]['value']:undefined)||[]},{'name':_0x82af('0x4e'),'value':_0x45c006['attrChannel']||(_0x45c006['attrs']&&_0x45c006[_0x82af('0x40')][0x4]?_0x45c006[_0x82af('0x40')][0x4][_0x82af('0x41')]:undefined)||_0x82af('0x4f')},{'name':'attrEmailAccounts','value':_0x45c006[_0x82af('0x5a')]||(_0x45c006['attrs']&&_0x45c006[_0x82af('0x40')][0x5]?_0x45c006[_0x82af('0x40')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x45c006[_0x82af('0x50')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x6]?_0x45c006['attrs'][0x6][_0x82af('0x41')]:undefined)||''},{'name':_0x82af('0x51'),'value':_0x45c006[_0x82af('0x51')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x7]?_0x45c006['attrs'][0x7][_0x82af('0x41')]:undefined)||''},{'name':_0x82af('0x52'),'value':_0x45c006['attrOpenchannelAccounts']||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x8]?_0x45c006[_0x82af('0x40')][0x8][_0x82af('0x41')]:undefined)||''},{'name':_0x82af('0x53'),'value':_0x45c006[_0x82af('0x53')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006['attrs'][0x9]?_0x45c006[_0x82af('0x40')][0x9][_0x82af('0x41')]:undefined)||''},{'name':_0x82af('0x54'),'value':_0x45c006['attrChatWebsites']||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0xa]?_0x45c006['attrs'][0xa][_0x82af('0x41')]:undefined)||''}];case _0x82af('0x5b'):return[{'name':'attrReport','type':_0x45c006[_0x82af('0x5c')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006[_0x82af('0x40')][0x0]?_0x45c006['attrs'][0x0][_0x82af('0x3d')]:undefined)||null,'value':_0x45c006[_0x82af('0x5d')]||(_0x45c006[_0x82af('0x40')]&&_0x45c006['attrs'][0x0]?_0x45c006[_0x82af('0x40')][0x0][_0x82af('0x41')]:undefined)||null},{'name':_0x82af('0x5e'),'value':_0x45c006[_0x82af('0x5e')]||(_0x45c006['attrs']&&_0x45c006[_0x82af('0x40')][0x1]?_0x45c006[_0x82af('0x40')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5f378f){logger['error'](_0x82af('0x5f'),JSON['stringify'](_0x5f378f));return[];}}exports[_0x82af('0x60')]=function(_0x36011b,_0x5ef008){if(_0x36011b[_0x82af('0x61')]){_0x36011b[_0x82af('0x61')][_0x82af('0x40')]=widgetAttributes(_0x36011b[_0x82af('0x61')]);}return db[_0x82af('0x31')]['create'](_0x36011b[_0x82af('0x61')],{})[_0x82af('0x2a')](respondWithResult(_0x5ef008,0xc9))[_0x82af('0x3c')](handleError(_0x5ef008,null));};exports['update']=function(_0x3ebee2,_0x126d50){if(_0x3ebee2[_0x82af('0x61')]['id']){delete _0x3ebee2[_0x82af('0x61')]['id'];}_0x3ebee2[_0x82af('0x61')]['attrs']=widgetAttributes(_0x3ebee2[_0x82af('0x61')]);return db[_0x82af('0x31')][_0x82af('0x3b')]({'where':{'id':_0x3ebee2['params']['id']}})[_0x82af('0x2a')](handleEntityNotFound(_0x126d50,null))[_0x82af('0x2a')](saveUpdates(_0x3ebee2[_0x82af('0x61')],null))['then'](respondWithResult(_0x126d50,null))[_0x82af('0x3c')](handleError(_0x126d50,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 68cfc9c..c0593c7 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 _0x7e98=['exports','events','DashboardItem','update','emit','hasOwnProperty','hook'];(function(_0x490e1a,_0x1ebe91){var _0x4c480c=function(_0x1554b4){while(--_0x1554b4){_0x490e1a['push'](_0x490e1a['shift']());}};_0x4c480c(++_0x1ebe91);}(_0x7e98,0x1ba));var _0x87e9=function(_0x5c3c01,_0x161284){_0x5c3c01=_0x5c3c01-0x0;var _0x3bc041=_0x7e98[_0x5c3c01];return _0x3bc041;};'use strict';var EventEmitter=require(_0x87e9('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x87e9('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x87e9('0x2'),'afterDestroy':'remove'};function emitEvent(_0x37f767){return function(_0x458fa2,_0x374984,_0x222414){DashboardItemEvents[_0x87e9('0x3')](_0x37f767+':'+_0x458fa2['id'],_0x458fa2);DashboardItemEvents[_0x87e9('0x3')](_0x37f767,_0x458fa2);_0x222414(null);};}for(var e in events){if(events[_0x87e9('0x4')](e)){var event=events[e];DashboardItem[_0x87e9('0x5')](e,emitEvent(event));}}module[_0x87e9('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0xc9b8=['../../mysqldb','DashboardItem','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x16b37a,_0x5d02cd){var _0x8251ce=function(_0x37474a){while(--_0x37474a){_0x16b37a['push'](_0x16b37a['shift']());}};_0x8251ce(++_0x5d02cd);}(_0xc9b8,0x1e3));var _0x8c9b=function(_0x50a6fa,_0x32d2aa){_0x50a6fa=_0x50a6fa-0x0;var _0xcd1b83=_0xc9b8[_0x50a6fa];return _0xcd1b83;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x8c9b('0x0'))['db'][_0x8c9b('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x8c9b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8c9b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2d4b47){return function(_0x22b5bf,_0x211764,_0xa28785){DashboardItemEvents[_0x8c9b('0x4')](_0x2d4b47+':'+_0x22b5bf['id'],_0x22b5bf);DashboardItemEvents['emit'](_0x2d4b47,_0x22b5bf);_0xa28785(null);};}for(var e in events){if(events[_0x8c9b('0x5')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x8c9b('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index b83bcb9..f2137db 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 _0x9bae=['exports','define','DashboardItem','dashboard_items','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x430986,_0x22fc68){var _0x42b0c5=function(_0x3a0d44){while(--_0x3a0d44){_0x430986['push'](_0x430986['shift']());}};_0x42b0c5(++_0x22fc68);}(_0x9bae,0x7c));var _0xe9ba=function(_0x319808,_0x1d7968){_0x319808=_0x319808-0x0;var _0x47442f=_0x9bae[_0x319808];return _0x47442f;};'use strict';var _=require(_0xe9ba('0x0'));var util=require(_0xe9ba('0x1'));var logger=require('../../config/logger')(_0xe9ba('0x2'));var moment=require(_0xe9ba('0x3'));var BPromise=require(_0xe9ba('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9ba('0x5'));var rimraf=require(_0xe9ba('0x6'));var config=require(_0xe9ba('0x7'));var attributes=require('./dashboardItem.attributes');module[_0xe9ba('0x8')]=function(_0xa2ea31,_0x19bc82){return _0xa2ea31[_0xe9ba('0x9')](_0xe9ba('0xa'),attributes,{'tableName':_0xe9ba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x938a=['../../config/logger','api','request-promise','path','rimraf','./dashboardItem.attributes','exports','define','lodash','util'];(function(_0x2f9468,_0x1e2421){var _0x3d1f02=function(_0xaba3cd){while(--_0xaba3cd){_0x2f9468['push'](_0x2f9468['shift']());}};_0x3d1f02(++_0x1e2421);}(_0x938a,0x1f2));var _0xa938=function(_0x27f36e,_0x571247){_0x27f36e=_0x27f36e-0x0;var _0x4a61e7=_0x938a[_0x27f36e];return _0x4a61e7;};'use strict';var _=require(_0xa938('0x0'));var util=require(_0xa938('0x1'));var logger=require(_0xa938('0x2'))(_0xa938('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa938('0x4'));var fs=require('fs');var path=require(_0xa938('0x5'));var rimraf=require(_0xa938('0x6'));var config=require('../../config/environment');var attributes=require(_0xa938('0x7'));module[_0xa938('0x8')]=function(_0x4ac3a2,_0x27efe9){return _0x4ac3a2[_0xa938('0x9')]('DashboardItem',attributes,{'tableName':'dashboard_items','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 e8d439e..98483f3 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 _0xfc05=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x16e8ad,_0x5f4726){var _0xbd3740=function(_0x52efdb){while(--_0x52efdb){_0x16e8ad['push'](_0x16e8ad['shift']());}};_0xbd3740(++_0x5f4726);}(_0xfc05,0xd9));var _0x5fc0=function(_0x3180e0,_0x544b42){_0x3180e0=_0x3180e0-0x0;var _0x234982=_0xfc05[_0x3180e0];return _0x234982;};'use strict';var _=require(_0x5fc0('0x0'));var util=require(_0x5fc0('0x1'));var moment=require(_0x5fc0('0x2'));var BPromise=require('bluebird');var rs=require(_0x5fc0('0x3'));var fs=require('fs');var Redis=require(_0x5fc0('0x4'));var db=require(_0x5fc0('0x5'))['db'];var utils=require(_0x5fc0('0x6'));var logger=require(_0x5fc0('0x7'))(_0x5fc0('0x8'));var config=require(_0x5fc0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5fc0('0xa')][_0x5fc0('0xb')]({'port':0x232a});config[_0x5fc0('0xc')]=_[_0x5fc0('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5fc0('0xe'))(new Redis(config[_0x5fc0('0xc')]));require(_0x5fc0('0xf'))[_0x5fc0('0x10')](socket);function respondWithRpcPromise(_0x336048,_0x5a265d,_0x461fac){return new BPromise(function(_0x1a021b,_0x28f5d6){return client[_0x5fc0('0x11')](_0x336048,_0x461fac)['then'](function(_0x5106ca){logger[_0x5fc0('0x12')](_0x5fc0('0x13'),_0x5a265d,_0x5fc0('0x14'));logger[_0x5fc0('0x15')](_0x5fc0('0x16'),_0x5a265d,_0x5fc0('0x14'),JSON['stringify'](_0x5106ca));if(_0x5106ca[_0x5fc0('0x17')]){if(_0x5106ca['error'][_0x5fc0('0x18')]===0x1f4){logger[_0x5fc0('0x17')](_0x5fc0('0x13'),_0x5a265d,_0x5106ca[_0x5fc0('0x17')][_0x5fc0('0x19')]);return _0x28f5d6(_0x5106ca[_0x5fc0('0x17')][_0x5fc0('0x19')]);}logger[_0x5fc0('0x17')](_0x5fc0('0x13'),_0x5a265d,_0x5106ca[_0x5fc0('0x17')]['message']);return _0x1a021b(_0x5106ca['error'][_0x5fc0('0x19')]);}else{logger['info'](_0x5fc0('0x13'),_0x5a265d,_0x5fc0('0x14'));_0x1a021b(_0x5106ca[_0x5fc0('0x1a')]['message']);}})[_0x5fc0('0x1b')](function(_0x54cbac){logger['error']('DashboardItem,\x20%s,\x20%s',_0x5a265d,_0x54cbac);_0x28f5d6(_0x54cbac);});});} \ No newline at end of file +var _0x41f6=['DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','info'];(function(_0x8c7519,_0x4a4ec1){var _0x265427=function(_0x2473a6){while(--_0x2473a6){_0x8c7519['push'](_0x8c7519['shift']());}};_0x265427(++_0x4a4ec1);}(_0x41f6,0x1b2));var _0x641f=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x41f6[_0x2ed8f3];return _0x525a55;};'use strict';var _=require(_0x641f('0x0'));var util=require('util');var moment=require(_0x641f('0x1'));var BPromise=require(_0x641f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x641f('0x3'));var db=require(_0x641f('0x4'))['db'];var utils=require(_0x641f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x641f('0x6'));var jayson=require(_0x641f('0x7'));var client=jayson[_0x641f('0x8')][_0x641f('0x9')]({'port':0x232a});config[_0x641f('0xa')]=_[_0x641f('0xb')](config[_0x641f('0xa')],{'host':_0x641f('0xc'),'port':0x18eb});var socket=require(_0x641f('0xd'))(new Redis(config[_0x641f('0xa')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x4b2907,_0x5a7533,_0x3959ab){return new BPromise(function(_0x28995e,_0x163162){return client[_0x641f('0xe')](_0x4b2907,_0x3959ab)['then'](function(_0x36834c){logger[_0x641f('0xf')](_0x641f('0x10'),_0x5a7533,_0x641f('0x11'));logger[_0x641f('0x12')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x5a7533,'request\x20sent',JSON[_0x641f('0x13')](_0x36834c));if(_0x36834c['error']){if(_0x36834c['error'][_0x641f('0x14')]===0x1f4){logger[_0x641f('0x15')](_0x641f('0x10'),_0x5a7533,_0x36834c[_0x641f('0x15')]['message']);return _0x163162(_0x36834c[_0x641f('0x15')][_0x641f('0x16')]);}logger[_0x641f('0x15')](_0x641f('0x10'),_0x5a7533,_0x36834c[_0x641f('0x15')][_0x641f('0x16')]);return _0x28995e(_0x36834c[_0x641f('0x15')][_0x641f('0x16')]);}else{logger['info'](_0x641f('0x10'),_0x5a7533,_0x641f('0x11'));_0x28995e(_0x36834c[_0x641f('0x17')]['message']);}})[_0x641f('0x18')](function(_0x5881d7){logger[_0x641f('0x15')](_0x641f('0x10'),_0x5a7533,_0x5881d7);_0x163162(_0x5881d7);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 17021b7..a1caee5 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 _0xd4c7=['length','./dashboardItem.events','emit','register'];(function(_0x2d7f87,_0x4bdcf3){var _0x8f69f0=function(_0x1e66a4){while(--_0x1e66a4){_0x2d7f87['push'](_0x2d7f87['shift']());}};_0x8f69f0(++_0x4bdcf3);}(_0xd4c7,0x9d));var _0x7d4c=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xd4c7[_0x2f5ac5];return _0x37c9a8;};'use strict';var DashboardItemEvents=require(_0x7d4c('0x0'));var events=['save','remove','update'];function createListener(_0x28e184,_0x5a646c){return function(_0x2a267c){_0x5a646c[_0x7d4c('0x1')](_0x28e184,_0x2a267c);};}function removeListener(_0x138781,_0x12e7b6){return function(){DashboardItemEvents['removeListener'](_0x138781,_0x12e7b6);};}exports[_0x7d4c('0x2')]=function(_0x5ef908){for(var _0x164269=0x0,_0xad07f3=events[_0x7d4c('0x3')];_0x164269<_0xad07f3;_0x164269++){var _0x2bea30=events[_0x164269];var _0x510c79=createListener('dashboardItem:'+_0x2bea30,_0x5ef908);DashboardItemEvents['on'](_0x2bea30,_0x510c79);}}; \ No newline at end of file +var _0xbb69=['save','remove','update','emit','removeListener','register','dashboardItem:','./dashboardItem.events'];(function(_0x366776,_0x48f0bf){var _0x34e2ad=function(_0xb7dfb0){while(--_0xb7dfb0){_0x366776['push'](_0x366776['shift']());}};_0x34e2ad(++_0x48f0bf);}(_0xbb69,0xc7));var _0x9bb6=function(_0x960b56,_0x133f73){_0x960b56=_0x960b56-0x0;var _0x173e7b=_0xbb69[_0x960b56];return _0x173e7b;};'use strict';var DashboardItemEvents=require(_0x9bb6('0x0'));var events=[_0x9bb6('0x1'),_0x9bb6('0x2'),_0x9bb6('0x3')];function createListener(_0xb588a5,_0x3f7410){return function(_0x595a87){_0x3f7410[_0x9bb6('0x4')](_0xb588a5,_0x595a87);};}function removeListener(_0x4391b1,_0x20ecb2){return function(){DashboardItemEvents[_0x9bb6('0x5')](_0x4391b1,_0x20ecb2);};}exports[_0x9bb6('0x6')]=function(_0x3c2f58){for(var _0x1a478b=0x0,_0x31488a=events['length'];_0x1a478b<_0x31488a;_0x1a478b++){var _0xbab4e8=events[_0x1a478b];var _0x5de92c=createListener(_0x9bb6('0x7')+_0xbab4e8,_0x3c2f58);DashboardItemEvents['on'](_0xbab4e8,_0x5de92c);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index e1abf0a..d9f1e02 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 _0x0b12=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0b12,0x97));var _0x20b1=function(_0x4193f0,_0x28e152){_0x4193f0=_0x4193f0-0x0;var _0x5b3050=_0x0b12[_0x4193f0];return _0x5b3050;};'use strict';var multer=require(_0x20b1('0x0'));var util=require(_0x20b1('0x1'));var path=require(_0x20b1('0x2'));var timeout=require(_0x20b1('0x3'));var express=require(_0x20b1('0x4'));var router=express[_0x20b1('0x5')]();var fs_extra=require(_0x20b1('0x6'));var auth=require(_0x20b1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x20b1('0x8'));var controller=require(_0x20b1('0x9'));router['get']('/:id',auth[_0x20b1('0xa')](),controller[_0x20b1('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x20b1('0xc')]);router[_0x20b1('0xd')](_0x20b1('0xe'),auth[_0x20b1('0xa')](),controller[_0x20b1('0xf')]);router[_0x20b1('0x10')](_0x20b1('0xe'),auth[_0x20b1('0xa')](),controller[_0x20b1('0x11')]);module[_0x20b1('0x12')]=router; \ No newline at end of file +var _0xc630=['./dashboardItem.controller','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4804e8,_0x276458){var _0x2a2551=function(_0x44e8bb){while(--_0x44e8bb){_0x4804e8['push'](_0x4804e8['shift']());}};_0x2a2551(++_0x276458);}(_0xc630,0x1c4));var _0x0c63=function(_0x4804cc,_0x472e9e){_0x4804cc=_0x4804cc-0x0;var _0x29b550=_0xc630[_0x4804cc];return _0x29b550;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0c63('0x0'));var timeout=require(_0x0c63('0x1'));var express=require(_0x0c63('0x2'));var router=express[_0x0c63('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0c63('0x4'));var interaction=require(_0x0c63('0x5'));var config=require(_0x0c63('0x6'));var controller=require(_0x0c63('0x7'));router[_0x0c63('0x8')](_0x0c63('0x9'),auth[_0x0c63('0xa')](),controller['show']);router[_0x0c63('0xb')]('/',auth[_0x0c63('0xa')](),controller[_0x0c63('0xc')]);router[_0x0c63('0xd')](_0x0c63('0x9'),auth['isAuthenticated'](),controller[_0x0c63('0xe')]);router[_0x0c63('0xf')](_0x0c63('0x9'),auth[_0x0c63('0xa')](),controller[_0x0c63('0x10')]);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 ffb9b1e..6b36ac9 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 _0x5baf=['ENUM','first','exports','STRING'];(function(_0x74dd7f,_0x3347dc){var _0x428a1d=function(_0x7a9c6){while(--_0x7a9c6){_0x74dd7f['push'](_0x74dd7f['shift']());}};_0x428a1d(++_0x3347dc);}(_0x5baf,0xea));var _0xf5ba=function(_0x4ef995,_0xe3a5d1){_0x4ef995=_0x4ef995-0x0;var _0x469ede=_0x5baf[_0x4ef995];return _0x469ede;};'use strict';var Sequelize=require('sequelize');module[_0xf5ba('0x0')]={'name':{'type':Sequelize[_0xf5ba('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xf5ba('0x2')](_0xf5ba('0x3'),'second','third'),'allowNull':![],'defaultValue':_0xf5ba('0x3')},'description':{'type':Sequelize[_0xf5ba('0x1')]}}; \ No newline at end of file +var _0xe739=['exports','STRING','second','first'];(function(_0x28718c,_0x59fcf4){var _0x436c05=function(_0x3353a8){while(--_0x3353a8){_0x28718c['push'](_0x28718c['shift']());}};_0x436c05(++_0x59fcf4);}(_0xe739,0x84));var _0x9e73=function(_0x35a541,_0xeee947){_0x35a541=_0x35a541-0x0;var _0xc0668c=_0xe739[_0x35a541];return _0xc0668c;};'use strict';var Sequelize=require('sequelize');module[_0x9e73('0x0')]={'name':{'type':Sequelize[_0x9e73('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0x9e73('0x2'),'third'),'allowNull':![],'defaultValue':_0x9e73('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index e6cdea1..2b7458a 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 _0x7c55=['util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','then','destroy','Dispositions','UserProfileResource','sendStatus','name','send','map','Disposition','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x77c356,_0x50152b){var _0x1e6d7a=function(_0x27f503){while(--_0x27f503){_0x77c356['push'](_0x77c356['shift']());}};_0x1e6d7a(++_0x50152b);}(_0x7c55,0x180));var _0x57c5=function(_0x24c3d0,_0x7f5ce5){_0x24c3d0=_0x24c3d0-0x0;var _0x3f6319=_0x7c55[_0x24c3d0];return _0x3f6319;};'use strict';var emlformat=require(_0x57c5('0x0'));var rimraf=require(_0x57c5('0x1'));var zipdir=require(_0x57c5('0x2'));var jsonpatch=require(_0x57c5('0x3'));var rp=require(_0x57c5('0x4'));var moment=require('moment');var BPromise=require(_0x57c5('0x5'));var Mustache=require('mustache');var util=require(_0x57c5('0x6'));var path=require(_0x57c5('0x7'));var sox=require(_0x57c5('0x8'));var csv=require(_0x57c5('0x9'));var ejs=require(_0x57c5('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(_0x57c5('0xb'));var deskjs=require(_0x57c5('0xc'));var toCsv=require(_0x57c5('0x9'));var querystring=require(_0x57c5('0xd'));var Papa=require(_0x57c5('0xe'));var Redis=require('ioredis');var authService=require(_0x57c5('0xf'));var qs=require(_0x57c5('0x10'));var as=require(_0x57c5('0x11'));var hardwareService=require(_0x57c5('0x12'));var logger=require('../../config/logger')(_0x57c5('0x13'));var utils=require('../../config/utils');var config=require(_0x57c5('0x14'));var licenseUtil=require(_0x57c5('0x15'));var db=require(_0x57c5('0x16'))['db'];function respondWithStatusCode(_0x4d3a99,_0x29d313){_0x29d313=_0x29d313||0xcc;return function(_0x40e002){if(_0x40e002){return _0x4d3a99['sendStatus'](_0x29d313);}return _0x4d3a99[_0x57c5('0x17')](_0x29d313)[_0x57c5('0x18')]();};}function respondWithResult(_0xdc2558,_0x41abfc){_0x41abfc=_0x41abfc||0xc8;return function(_0x7e565b){if(_0x7e565b){return _0xdc2558[_0x57c5('0x17')](_0x41abfc)[_0x57c5('0x19')](_0x7e565b);}};}function respondWithFilteredResult(_0x408874,_0x45f9c3){return function(_0x3e7798){if(_0x3e7798){var _0x5ef878=typeof _0x45f9c3[_0x57c5('0x1a')]==='undefined'&&typeof _0x45f9c3[_0x57c5('0x1b')]==='undefined';var _0x29a5b8=_0x3e7798[_0x57c5('0x1c')];var _0x24a7d2=_0x5ef878?0x0:_0x45f9c3['offset'];var _0x57e1d6=_0x5ef878?_0x3e7798['count']:_0x45f9c3['offset']+_0x45f9c3[_0x57c5('0x1b')];var _0x477c7a;if(_0x57e1d6>=_0x29a5b8){_0x57e1d6=_0x29a5b8;_0x477c7a=0xc8;}else{_0x477c7a=0xce;}_0x408874['status'](_0x477c7a);return _0x408874[_0x57c5('0x1d')](_0x57c5('0x1e'),_0x24a7d2+'-'+_0x57e1d6+'/'+_0x29a5b8)[_0x57c5('0x19')](_0x3e7798);}return null;};}function patchUpdates(_0x58cc9f){return function(_0x35943d){try{jsonpatch[_0x57c5('0x1f')](_0x35943d,_0x58cc9f,!![]);}catch(_0x59ad6c){return BPromise['reject'](_0x59ad6c);}return _0x35943d['save']();};}function saveUpdates(_0x2a5415,_0x172a4b){return function(_0x2eb413){if(_0x2eb413){return _0x2eb413['update'](_0x2a5415)[_0x57c5('0x20')](function(_0x11562b){return _0x11562b;});}return null;};}function removeEntity(_0x423d1d,_0x5bb917){return function(_0x1c45f1){if(_0x1c45f1){return _0x1c45f1[_0x57c5('0x21')]()[_0x57c5('0x20')](function(){var _0x5ec1a1=_0x1c45f1['get']({'plain':!![]});var _0x1ba80e=_0x57c5('0x22');return db[_0x57c5('0x23')][_0x57c5('0x21')]({'where':{'type':_0x1ba80e,'resourceId':_0x5ec1a1['id']}})[_0x57c5('0x20')](function(){return _0x1c45f1;});})['then'](function(){_0x423d1d[_0x57c5('0x17')](0xcc)[_0x57c5('0x18')]();});}};}function handleEntityNotFound(_0x5cbbe9,_0x57e998){return function(_0x3d121a){if(!_0x3d121a){_0x5cbbe9[_0x57c5('0x24')](0x194);}return _0x3d121a;};}function handleError(_0x5224a3,_0x44192c){_0x44192c=_0x44192c||0x1f4;return function(_0x50f538){logger['error'](_0x50f538['stack']);if(_0x50f538[_0x57c5('0x25')]){delete _0x50f538[_0x57c5('0x25')];}_0x5224a3[_0x57c5('0x17')](_0x44192c)[_0x57c5('0x26')](_0x50f538);};}exports['index']=function(_0x474019,_0x134092){var _0x1b0d0b={},_0x1caf77={},_0x9ba9a9={'count':0x0,'rows':[]};var _0x3bc76d=_[_0x57c5('0x27')](db[_0x57c5('0x28')][_0x57c5('0x29')],function(_0x32e894){return{'name':_0x32e894['fieldName'],'type':_0x32e894[_0x57c5('0x2a')][_0x57c5('0x2b')]};});_0x1caf77['model']=_['map'](_0x3bc76d,_0x57c5('0x25'));_0x1caf77[_0x57c5('0x2c')]=_[_0x57c5('0x2d')](_0x474019[_0x57c5('0x2c')]);_0x1caf77[_0x57c5('0x2e')]=_['intersection'](_0x1caf77[_0x57c5('0x2f')],_0x1caf77[_0x57c5('0x2c')]);_0x1b0d0b[_0x57c5('0x30')]=_[_0x57c5('0x31')](_0x1caf77['model'],qs[_0x57c5('0x32')](_0x474019[_0x57c5('0x2c')][_0x57c5('0x32')]));_0x1b0d0b[_0x57c5('0x30')]=_0x1b0d0b[_0x57c5('0x30')]['length']?_0x1b0d0b[_0x57c5('0x30')]:_0x1caf77['model'];if(!_0x474019[_0x57c5('0x2c')][_0x57c5('0x33')]('nolimit')){_0x1b0d0b['limit']=qs['limit'](_0x474019[_0x57c5('0x2c')][_0x57c5('0x1b')]);_0x1b0d0b[_0x57c5('0x1a')]=qs[_0x57c5('0x1a')](_0x474019[_0x57c5('0x2c')][_0x57c5('0x1a')]);}_0x1b0d0b['order']=qs[_0x57c5('0x34')](_0x474019['query'][_0x57c5('0x34')]);_0x1b0d0b[_0x57c5('0x35')]=qs[_0x57c5('0x2e')](_[_0x57c5('0x36')](_0x474019[_0x57c5('0x2c')],_0x1caf77['filters']),_0x3bc76d);if(_0x474019[_0x57c5('0x2c')][_0x57c5('0x37')]){_0x1b0d0b[_0x57c5('0x35')]=_[_0x57c5('0x38')](_0x1b0d0b[_0x57c5('0x35')],{'$or':_[_0x57c5('0x27')](_0x3bc76d,function(_0x2d0ad4){if(_0x2d0ad4['type']!==_0x57c5('0x39')){var _0x12a743={};_0x12a743[_0x2d0ad4[_0x57c5('0x25')]]={'$like':'%'+_0x474019[_0x57c5('0x2c')]['filter']+'%'};return _0x12a743;}})});}_0x1b0d0b=_[_0x57c5('0x38')]({},_0x1b0d0b,_0x474019[_0x57c5('0x3a')]);var _0x4143cc={'where':_0x1b0d0b[_0x57c5('0x35')]};return db[_0x57c5('0x28')]['count'](_0x4143cc)[_0x57c5('0x20')](function(_0x2fbff0){_0x9ba9a9[_0x57c5('0x1c')]=_0x2fbff0;if(_0x474019[_0x57c5('0x2c')][_0x57c5('0x3b')]){_0x1b0d0b[_0x57c5('0x3c')]=[{'all':!![]}];}return db['Disposition'][_0x57c5('0x3d')](_0x1b0d0b);})[_0x57c5('0x20')](function(_0x134869){_0x9ba9a9[_0x57c5('0x3e')]=_0x134869;return _0x9ba9a9;})['then'](respondWithFilteredResult(_0x134092,_0x1b0d0b))[_0x57c5('0x3f')](handleError(_0x134092,null));};exports[_0x57c5('0x40')]=function(_0xeb2a29,_0x45e643){var _0x5c49ad={'raw':!![],'where':{'id':_0xeb2a29[_0x57c5('0x41')]['id']}},_0x3defe6={};_0x3defe6[_0x57c5('0x2f')]=_[_0x57c5('0x2d')](db[_0x57c5('0x28')][_0x57c5('0x29')]);_0x3defe6[_0x57c5('0x2c')]=_[_0x57c5('0x2d')](_0xeb2a29['query']);_0x3defe6[_0x57c5('0x2e')]=_[_0x57c5('0x31')](_0x3defe6[_0x57c5('0x2f')],_0x3defe6[_0x57c5('0x2c')]);_0x5c49ad[_0x57c5('0x30')]=_['intersection'](_0x3defe6[_0x57c5('0x2f')],qs['fields'](_0xeb2a29[_0x57c5('0x2c')][_0x57c5('0x32')]));_0x5c49ad['attributes']=_0x5c49ad['attributes'][_0x57c5('0x42')]?_0x5c49ad[_0x57c5('0x30')]:_0x3defe6[_0x57c5('0x2f')];if(_0xeb2a29[_0x57c5('0x2c')][_0x57c5('0x3b')]){_0x5c49ad[_0x57c5('0x3c')]=[{'all':!![]}];}_0x5c49ad=_[_0x57c5('0x38')]({},_0x5c49ad,_0xeb2a29[_0x57c5('0x3a')]);return db[_0x57c5('0x28')][_0x57c5('0x43')](_0x5c49ad)[_0x57c5('0x20')](handleEntityNotFound(_0x45e643,null))['then'](respondWithResult(_0x45e643,null))[_0x57c5('0x3f')](handleError(_0x45e643,null));};exports['create']=function(_0x13da7f,_0x23f24c){return db[_0x57c5('0x28')][_0x57c5('0x44')](_0x13da7f[_0x57c5('0x45')],{})[_0x57c5('0x20')](function(_0xcafe75){var _0x32ab0a=_0x13da7f[_0x57c5('0x46')][_0x57c5('0x47')]({'plain':!![]});if(!_0x32ab0a)throw new Error(_0x57c5('0x48'));if(_0x32ab0a[_0x57c5('0x49')]===_0x57c5('0x46')){var _0x5673f1=_0xcafe75[_0x57c5('0x47')]({'plain':!![]});var _0xf3bb6e='Dispositions';return db[_0x57c5('0x4a')][_0x57c5('0x43')]({'where':{'name':_0xf3bb6e,'userProfileId':_0x32ab0a['userProfileId']},'raw':!![]})['then'](function(_0x493175){if(_0x493175&&_0x493175['autoAssociation']===0x0){return db[_0x57c5('0x23')]['create']({'name':_0x5673f1[_0x57c5('0x25')],'resourceId':_0x5673f1['id'],'type':_0x493175[_0x57c5('0x25')],'sectionId':_0x493175['id']},{})['then'](function(){return _0xcafe75;});}else{return _0xcafe75;}})[_0x57c5('0x3f')](function(_0x2a1866){logger[_0x57c5('0x4b')](_0x57c5('0x4c'),_0x2a1866);throw _0x2a1866;});}return _0xcafe75;})[_0x57c5('0x20')](respondWithResult(_0x23f24c,0xc9))[_0x57c5('0x3f')](handleError(_0x23f24c,null));};exports[_0x57c5('0x4d')]=function(_0xef6bab,_0x4e5183){if(_0xef6bab[_0x57c5('0x45')]['id']){delete _0xef6bab[_0x57c5('0x45')]['id'];}return db[_0x57c5('0x28')][_0x57c5('0x43')]({'where':{'id':_0xef6bab['params']['id']}})['then'](handleEntityNotFound(_0x4e5183,null))[_0x57c5('0x20')](saveUpdates(_0xef6bab['body'],null))[_0x57c5('0x20')](respondWithResult(_0x4e5183,null))[_0x57c5('0x3f')](handleError(_0x4e5183,null));};exports[_0x57c5('0x21')]=function(_0x478c38,_0x4b8b2f){return db[_0x57c5('0x28')][_0x57c5('0x43')]({'where':{'id':_0x478c38[_0x57c5('0x41')]['id']}})['then'](handleEntityNotFound(_0x4b8b2f,null))['then'](removeEntity(_0x4b8b2f,null))[_0x57c5('0x3f')](handleError(_0x4b8b2f,null));}; \ No newline at end of file +var _0xa65a=['fields','nolimit','sort','where','VIRTUAL','filter','options','include','findAll','show','params','length','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','Dispositions','UserProfileResource','error','name','send','Disposition','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes'];(function(_0x5b8a3f,_0x398a3c){var _0x599ab2=function(_0x13f847){while(--_0x13f847){_0x5b8a3f['push'](_0x5b8a3f['shift']());}};_0x599ab2(++_0x398a3c);}(_0xa65a,0x10e));var _0xaa65=function(_0x59556f,_0x5f10e1){_0x59556f=_0x59556f-0x0;var _0x57ba9e=_0xa65a[_0x59556f];return _0x57ba9e;};'use strict';var emlformat=require(_0xaa65('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaa65('0x1'));var jsonpatch=require(_0xaa65('0x2'));var rp=require(_0xaa65('0x3'));var moment=require(_0xaa65('0x4'));var BPromise=require(_0xaa65('0x5'));var Mustache=require(_0xaa65('0x6'));var util=require(_0xaa65('0x7'));var path=require(_0xaa65('0x8'));var sox=require(_0xaa65('0x9'));var csv=require(_0xaa65('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa65('0xb'));var _=require(_0xaa65('0xc'));var squel=require(_0xaa65('0xd'));var crypto=require(_0xaa65('0xe'));var jsforce=require(_0xaa65('0xf'));var deskjs=require(_0xaa65('0x10'));var toCsv=require(_0xaa65('0xa'));var querystring=require(_0xaa65('0x11'));var Papa=require('papaparse');var Redis=require(_0xaa65('0x12'));var authService=require(_0xaa65('0x13'));var qs=require(_0xaa65('0x14'));var as=require(_0xaa65('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa65('0x16'))(_0xaa65('0x17'));var utils=require(_0xaa65('0x18'));var config=require(_0xaa65('0x19'));var licenseUtil=require(_0xaa65('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x410cdd,_0x1b282a){_0x1b282a=_0x1b282a||0xcc;return function(_0x1316e9){if(_0x1316e9){return _0x410cdd[_0xaa65('0x1b')](_0x1b282a);}return _0x410cdd[_0xaa65('0x1c')](_0x1b282a)[_0xaa65('0x1d')]();};}function respondWithResult(_0x2d839e,_0x594c37){_0x594c37=_0x594c37||0xc8;return function(_0x1c4547){if(_0x1c4547){return _0x2d839e[_0xaa65('0x1c')](_0x594c37)['json'](_0x1c4547);}};}function respondWithFilteredResult(_0x2c95cb,_0x562170){return function(_0x133e7b){if(_0x133e7b){var _0x5b6a11=typeof _0x562170[_0xaa65('0x1e')]==='undefined'&&typeof _0x562170[_0xaa65('0x1f')]===_0xaa65('0x20');var _0x9b91c5=_0x133e7b[_0xaa65('0x21')];var _0x8a9558=_0x5b6a11?0x0:_0x562170[_0xaa65('0x1e')];var _0x3e955d=_0x5b6a11?_0x133e7b['count']:_0x562170[_0xaa65('0x1e')]+_0x562170[_0xaa65('0x1f')];var _0x3d500d;if(_0x3e955d>=_0x9b91c5){_0x3e955d=_0x9b91c5;_0x3d500d=0xc8;}else{_0x3d500d=0xce;}_0x2c95cb[_0xaa65('0x1c')](_0x3d500d);return _0x2c95cb[_0xaa65('0x22')](_0xaa65('0x23'),_0x8a9558+'-'+_0x3e955d+'/'+_0x9b91c5)['json'](_0x133e7b);}return null;};}function patchUpdates(_0x1fd0cf){return function(_0x19cdeb){try{jsonpatch[_0xaa65('0x24')](_0x19cdeb,_0x1fd0cf,!![]);}catch(_0x4c9548){return BPromise[_0xaa65('0x25')](_0x4c9548);}return _0x19cdeb[_0xaa65('0x26')]();};}function saveUpdates(_0x3f0913,_0x44a78d){return function(_0xf367e6){if(_0xf367e6){return _0xf367e6[_0xaa65('0x27')](_0x3f0913)['then'](function(_0x5810c8){return _0x5810c8;});}return null;};}function removeEntity(_0x156b4e,_0x17fa91){return function(_0x55050d){if(_0x55050d){return _0x55050d[_0xaa65('0x28')]()[_0xaa65('0x29')](function(){var _0x38a03e=_0x55050d['get']({'plain':!![]});var _0x3d49ca=_0xaa65('0x2a');return db[_0xaa65('0x2b')]['destroy']({'where':{'type':_0x3d49ca,'resourceId':_0x38a03e['id']}})[_0xaa65('0x29')](function(){return _0x55050d;});})[_0xaa65('0x29')](function(){_0x156b4e[_0xaa65('0x1c')](0xcc)[_0xaa65('0x1d')]();});}};}function handleEntityNotFound(_0x55f4a6,_0x3684b4){return function(_0x5af7ae){if(!_0x5af7ae){_0x55f4a6[_0xaa65('0x1b')](0x194);}return _0x5af7ae;};}function handleError(_0x5c8acb,_0x113b57){_0x113b57=_0x113b57||0x1f4;return function(_0x520872){logger[_0xaa65('0x2c')](_0x520872['stack']);if(_0x520872[_0xaa65('0x2d')]){delete _0x520872[_0xaa65('0x2d')];}_0x5c8acb[_0xaa65('0x1c')](_0x113b57)[_0xaa65('0x2e')](_0x520872);};}exports['index']=function(_0x4623fa,_0x1e6387){var _0x387816={},_0x1256e4={},_0x7f66e2={'count':0x0,'rows':[]};var _0x1f5f56=_['map'](db[_0xaa65('0x2f')][_0xaa65('0x30')],function(_0x34e7f8){return{'name':_0x34e7f8['fieldName'],'type':_0x34e7f8[_0xaa65('0x31')][_0xaa65('0x32')]};});_0x1256e4[_0xaa65('0x33')]=_[_0xaa65('0x34')](_0x1f5f56,_0xaa65('0x2d'));_0x1256e4[_0xaa65('0x35')]=_[_0xaa65('0x36')](_0x4623fa[_0xaa65('0x35')]);_0x1256e4[_0xaa65('0x37')]=_[_0xaa65('0x38')](_0x1256e4['model'],_0x1256e4[_0xaa65('0x35')]);_0x387816[_0xaa65('0x39')]=_[_0xaa65('0x38')](_0x1256e4[_0xaa65('0x33')],qs[_0xaa65('0x3a')](_0x4623fa[_0xaa65('0x35')][_0xaa65('0x3a')]));_0x387816[_0xaa65('0x39')]=_0x387816[_0xaa65('0x39')]['length']?_0x387816[_0xaa65('0x39')]:_0x1256e4[_0xaa65('0x33')];if(!_0x4623fa[_0xaa65('0x35')]['hasOwnProperty'](_0xaa65('0x3b'))){_0x387816['limit']=qs[_0xaa65('0x1f')](_0x4623fa[_0xaa65('0x35')][_0xaa65('0x1f')]);_0x387816['offset']=qs[_0xaa65('0x1e')](_0x4623fa['query'][_0xaa65('0x1e')]);}_0x387816['order']=qs[_0xaa65('0x3c')](_0x4623fa['query'][_0xaa65('0x3c')]);_0x387816[_0xaa65('0x3d')]=qs[_0xaa65('0x37')](_['pick'](_0x4623fa[_0xaa65('0x35')],_0x1256e4[_0xaa65('0x37')]),_0x1f5f56);if(_0x4623fa[_0xaa65('0x35')]['filter']){_0x387816['where']=_['merge'](_0x387816[_0xaa65('0x3d')],{'$or':_[_0xaa65('0x34')](_0x1f5f56,function(_0x168d0a){if(_0x168d0a[_0xaa65('0x31')]!==_0xaa65('0x3e')){var _0x56b052={};_0x56b052[_0x168d0a[_0xaa65('0x2d')]]={'$like':'%'+_0x4623fa[_0xaa65('0x35')][_0xaa65('0x3f')]+'%'};return _0x56b052;}})});}_0x387816=_['merge']({},_0x387816,_0x4623fa[_0xaa65('0x40')]);var _0x5855cf={'where':_0x387816['where']};return db['Disposition'][_0xaa65('0x21')](_0x5855cf)[_0xaa65('0x29')](function(_0x50dd32){_0x7f66e2['count']=_0x50dd32;if(_0x4623fa['query']['includeAll']){_0x387816[_0xaa65('0x41')]=[{'all':!![]}];}return db[_0xaa65('0x2f')][_0xaa65('0x42')](_0x387816);})[_0xaa65('0x29')](function(_0x5e8c4e){_0x7f66e2['rows']=_0x5e8c4e;return _0x7f66e2;})[_0xaa65('0x29')](respondWithFilteredResult(_0x1e6387,_0x387816))['catch'](handleError(_0x1e6387,null));};exports[_0xaa65('0x43')]=function(_0xe10e49,_0x205a04){var _0x2308d8={'raw':!![],'where':{'id':_0xe10e49[_0xaa65('0x44')]['id']}},_0x42ee74={};_0x42ee74[_0xaa65('0x33')]=_[_0xaa65('0x36')](db['Disposition'][_0xaa65('0x30')]);_0x42ee74['query']=_['keys'](_0xe10e49[_0xaa65('0x35')]);_0x42ee74['filters']=_[_0xaa65('0x38')](_0x42ee74[_0xaa65('0x33')],_0x42ee74[_0xaa65('0x35')]);_0x2308d8['attributes']=_['intersection'](_0x42ee74['model'],qs[_0xaa65('0x3a')](_0xe10e49['query']['fields']));_0x2308d8[_0xaa65('0x39')]=_0x2308d8['attributes'][_0xaa65('0x45')]?_0x2308d8[_0xaa65('0x39')]:_0x42ee74['model'];if(_0xe10e49['query']['includeAll']){_0x2308d8[_0xaa65('0x41')]=[{'all':!![]}];}_0x2308d8=_[_0xaa65('0x46')]({},_0x2308d8,_0xe10e49['options']);return db[_0xaa65('0x2f')][_0xaa65('0x47')](_0x2308d8)['then'](handleEntityNotFound(_0x205a04,null))[_0xaa65('0x29')](respondWithResult(_0x205a04,null))['catch'](handleError(_0x205a04,null));};exports[_0xaa65('0x48')]=function(_0x2adb55,_0x5f4318){return db['Disposition'][_0xaa65('0x48')](_0x2adb55[_0xaa65('0x49')],{})[_0xaa65('0x29')](function(_0x19dc91){var _0x2537ea=_0x2adb55[_0xaa65('0x4a')][_0xaa65('0x4b')]({'plain':!![]});if(!_0x2537ea)throw new Error(_0xaa65('0x4c'));if(_0x2537ea[_0xaa65('0x4d')]===_0xaa65('0x4a')){var _0x32ac05=_0x19dc91[_0xaa65('0x4b')]({'plain':!![]});var _0x38f4e1='Dispositions';return db[_0xaa65('0x4e')][_0xaa65('0x47')]({'where':{'name':_0x38f4e1,'userProfileId':_0x2537ea['userProfileId']},'raw':!![]})['then'](function(_0x6fa1b0){if(_0x6fa1b0&&_0x6fa1b0[_0xaa65('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x32ac05[_0xaa65('0x2d')],'resourceId':_0x32ac05['id'],'type':_0x6fa1b0[_0xaa65('0x2d')],'sectionId':_0x6fa1b0['id']},{})['then'](function(){return _0x19dc91;});}else{return _0x19dc91;}})['catch'](function(_0x511009){logger['error'](_0xaa65('0x50'),_0x511009);throw _0x511009;});}return _0x19dc91;})[_0xaa65('0x29')](respondWithResult(_0x5f4318,0xc9))[_0xaa65('0x51')](handleError(_0x5f4318,null));};exports[_0xaa65('0x27')]=function(_0x257edc,_0x37c046){if(_0x257edc['body']['id']){delete _0x257edc[_0xaa65('0x49')]['id'];}return db[_0xaa65('0x2f')][_0xaa65('0x47')]({'where':{'id':_0x257edc[_0xaa65('0x44')]['id']}})['then'](handleEntityNotFound(_0x37c046,null))[_0xaa65('0x29')](saveUpdates(_0x257edc['body'],null))[_0xaa65('0x29')](respondWithResult(_0x37c046,null))['catch'](handleError(_0x37c046,null));};exports[_0xaa65('0x28')]=function(_0x51c26b,_0x440fe3){return db[_0xaa65('0x2f')][_0xaa65('0x47')]({'where':{'id':_0x51c26b[_0xaa65('0x44')]['id']}})[_0xaa65('0x29')](handleEntityNotFound(_0x440fe3,null))[_0xaa65('0x29')](removeEntity(_0x440fe3,null))[_0xaa65('0x51')](handleError(_0x440fe3,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 6423e98..8c69dab 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 _0x3714=['FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','tools_dispositions','name_voice','name','ListId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax'];(function(_0x23c73d,_0x357b21){var _0x36ba47=function(_0x317b8e){while(--_0x317b8e){_0x23c73d['push'](_0x23c73d['shift']());}};_0x36ba47(++_0x357b21);}(_0x3714,0x95));var _0x4371=function(_0x8f3937,_0x11af7b){_0x8f3937=_0x8f3937-0x0;var _0x576365=_0x3714[_0x8f3937];return _0x576365;};'use strict';var _=require(_0x4371('0x0'));var util=require(_0x4371('0x1'));var logger=require('../../config/logger')(_0x4371('0x2'));var moment=require(_0x4371('0x3'));var BPromise=require(_0x4371('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4371('0x5'));var rimraf=require(_0x4371('0x6'));var config=require(_0x4371('0x7'));var attributes=require('./disposition.attributes');module[_0x4371('0x8')]=function(_0x5650a7,_0x349031){return _0x5650a7[_0x4371('0x9')]('Disposition',attributes,{'tableName':_0x4371('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x4371('0xb'),'fields':[_0x4371('0xc'),_0x4371('0xd')]},{'unique':!![],'name':'name_chat','fields':[_0x4371('0xc'),'ChatWebsiteId']},{'unique':!![],'name':_0x4371('0xe'),'fields':[_0x4371('0xc'),_0x4371('0xf')]},{'unique':!![],'name':_0x4371('0x10'),'fields':['name',_0x4371('0x11')]},{'unique':!![],'name':_0x4371('0x12'),'fields':['name',_0x4371('0x13')]},{'unique':!![],'name':_0x4371('0x14'),'fields':[_0x4371('0xc'),_0x4371('0x15')]},{'unique':!![],'name':_0x4371('0x16'),'fields':[_0x4371('0xc'),_0x4371('0x17')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0821=['name_chat','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name'];(function(_0x3b83c1,_0x3365fe){var _0x111cea=function(_0x3743eb){while(--_0x3743eb){_0x3b83c1['push'](_0x3b83c1['shift']());}};_0x111cea(++_0x3365fe);}(_0x0821,0xc1));var _0x1082=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x0821[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0x1082('0x0'));var util=require(_0x1082('0x1'));var logger=require(_0x1082('0x2'))(_0x1082('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1082('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1082('0x5'));var config=require(_0x1082('0x6'));var attributes=require(_0x1082('0x7'));module[_0x1082('0x8')]=function(_0xf2f62b,_0x2c4fdd){return _0xf2f62b[_0x1082('0x9')](_0x1082('0xa'),attributes,{'tableName':_0x1082('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x1082('0xc'),'fields':[_0x1082('0xd'),'ListId']},{'unique':!![],'name':_0x1082('0xe'),'fields':['name',_0x1082('0xf')]},{'unique':!![],'name':'name_mail','fields':['name',_0x1082('0x10')]},{'unique':!![],'name':_0x1082('0x11'),'fields':[_0x1082('0xd'),_0x1082('0x12')]},{'unique':!![],'name':_0x1082('0x13'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0x1082('0x14'),'fields':[_0x1082('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':_0x1082('0x15'),'fields':['name',_0x1082('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 74a3ed2..5031b16 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(_0x10c291,_0x16cc71){var _0x4b9e4a=function(_0x3f7b89){while(--_0x3f7b89){_0x10c291['push'](_0x10c291['shift']());}};_0x4b9e4a(++_0x16cc71);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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(_0x4d3a3d,_0x2b2c55){var _0x4481d2=function(_0x30ff99){while(--_0x30ff99){_0x4d3a3d['push'](_0x4d3a3d['shift']());}};_0x4481d2(++_0x2b2c55);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 d4b20a2..ba3453a 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 _0xf42a=['fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','exports','path','connect-timeout','Router'];(function(_0x2336af,_0x5bd014){var _0x3573bf=function(_0x26a4d1){while(--_0x26a4d1){_0x2336af['push'](_0x2336af['shift']());}};_0x3573bf(++_0x5bd014);}(_0xf42a,0x69));var _0xaf42=function(_0x4373b7,_0x33a6b6){_0x4373b7=_0x4373b7-0x0;var _0x22bd7e=_0xf42a[_0x4373b7];return _0x22bd7e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaf42('0x0'));var timeout=require(_0xaf42('0x1'));var express=require('express');var router=express[_0xaf42('0x2')]();var fs_extra=require(_0xaf42('0x3'));var auth=require(_0xaf42('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xaf42('0x5'));var controller=require(_0xaf42('0x6'));router['get']('/',auth[_0xaf42('0x7')](),controller[_0xaf42('0x8')]);router[_0xaf42('0x9')](_0xaf42('0xa'),auth[_0xaf42('0x7')](),controller[_0xaf42('0xb')]);router[_0xaf42('0xc')]('/',auth[_0xaf42('0x7')](),controller['create']);router[_0xaf42('0xd')](_0xaf42('0xa'),auth[_0xaf42('0x7')](),controller[_0xaf42('0xe')]);router[_0xaf42('0xf')](_0xaf42('0xa'),auth['isAuthenticated'](),controller[_0xaf42('0x10')]);module[_0xaf42('0x11')]=router; \ No newline at end of file +var _0x4c54=['../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x34e198,_0x42c602){var _0x22f4d6=function(_0x2adfc2){while(--_0x2adfc2){_0x34e198['push'](_0x34e198['shift']());}};_0x22f4d6(++_0x42c602);}(_0x4c54,0x12a));var _0x44c5=function(_0x3e1c59,_0x4eff25){_0x3e1c59=_0x3e1c59-0x0;var _0x42e558=_0x4c54[_0x3e1c59];return _0x42e558;};'use strict';var multer=require(_0x44c5('0x0'));var util=require(_0x44c5('0x1'));var path=require(_0x44c5('0x2'));var timeout=require(_0x44c5('0x3'));var express=require('express');var router=express[_0x44c5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x44c5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x44c5('0x6'));var controller=require(_0x44c5('0x7'));router[_0x44c5('0x8')]('/',auth[_0x44c5('0x9')](),controller[_0x44c5('0xa')]);router[_0x44c5('0x8')](_0x44c5('0xb'),auth['isAuthenticated'](),controller[_0x44c5('0xc')]);router[_0x44c5('0xd')]('/',auth[_0x44c5('0x9')](),controller[_0x44c5('0xe')]);router[_0x44c5('0xf')](_0x44c5('0xb'),auth[_0x44c5('0x9')](),controller['update']);router[_0x44c5('0x10')]('/:id',auth[_0x44c5('0x9')](),controller[_0x44c5('0x11')]);module[_0x44c5('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 070ee2a..4980da3 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 _0x07e8=['yes','localstationid','4800','7200','9600','12000','14400','2400','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM'];(function(_0x57da30,_0x579f57){var _0x579e17=function(_0x3d6168){while(--_0x3d6168){_0x57da30['push'](_0x57da30['shift']());}};_0x579e17(++_0x579f57);}(_0x07e8,0x10f));var _0x807e=function(_0x40eb78,_0x2fc844){_0x40eb78=_0x40eb78-0x0;var _0x1ddf08=_0x07e8[_0x40eb78];return _0x1ddf08;};'use strict';var Sequelize=require(_0x807e('0x0'));module[_0x807e('0x1')]={'name':{'type':Sequelize[_0x807e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x807e('0x3')]('yes','no'),'defaultValue':_0x807e('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x807e('0x2')],'unique':_0x807e('0x5')},'minrate':{'type':Sequelize[_0x807e('0x3')]('2400',_0x807e('0x6'),_0x807e('0x7'),_0x807e('0x8'),_0x807e('0x9'),_0x807e('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x807e('0x3')](_0x807e('0xb'),_0x807e('0x6'),_0x807e('0x7'),_0x807e('0x8'),_0x807e('0x9'),_0x807e('0xa')),'defaultValue':_0x807e('0xa')},'modem':{'type':Sequelize[_0x807e('0x2')],'defaultValue':_0x807e('0xc')},'gateway':{'type':Sequelize[_0x807e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x807e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x807e('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x807e('0x3')]('SIP',_0x807e('0xe'),_0x807e('0xf'),_0x807e('0x10')),'defaultValue':_0x807e('0x11')},'key':{'type':Sequelize[_0x807e('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x807e('0x12')],'defaultValue':function(){return _0x807e('0x13');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x807e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x807e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x807e('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x807e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x807e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x807e('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x807e('0x15')},'mandatoryDisposition':{'type':Sequelize[_0x807e('0x14')],'defaultValue':![],'comment':_0x807e('0x16'),'set':function(_0x454bd3){if(!_0x454bd3)this['setDataValue'](_0x807e('0x17'),null);this['setDataValue'](_0x807e('0x18'),_0x454bd3);}}}; \ No newline at end of file +var _0xc359=['INTEGER','IAX','DADHI','KHOMP','SIP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING','ENUM','yes','12000','14400','4800','2400','9600','v17,v27,v29'];(function(_0x18c9e1,_0x112249){var _0x3cee5a=function(_0xd95137){while(--_0xd95137){_0x18c9e1['push'](_0x18c9e1['shift']());}};_0x3cee5a(++_0x112249);}(_0xc359,0x1d9));var _0x9c35=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xc359[_0x53abe5];return _0xc1c37e;};'use strict';var Sequelize=require('sequelize');module[_0x9c35('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9c35('0x1')]},'ecm':{'type':Sequelize[_0x9c35('0x2')](_0x9c35('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x9c35('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x9c35('0x1')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x9c35('0x2')]('2400','4800','7200','9600',_0x9c35('0x4'),_0x9c35('0x5')),'defaultValue':_0x9c35('0x6')},'maxrate':{'type':Sequelize[_0x9c35('0x2')](_0x9c35('0x7'),_0x9c35('0x6'),'7200',_0x9c35('0x8'),_0x9c35('0x4'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x9c35('0x9')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9c35('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x9c35('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x9c35('0x2')]('SIP',_0x9c35('0xb'),_0x9c35('0xc'),_0x9c35('0xd')),'defaultValue':_0x9c35('0xe')},'key':{'type':Sequelize[_0x9c35('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9c35('0xf');}},'notificationSound':{'type':Sequelize[_0x9c35('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9c35('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9c35('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x9c35('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9c35('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9c35('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9c35('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9c35('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9c35('0xa')],'allowNull':!![],'defaultValue':null,'comment':_0x9c35('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x9c35('0x10')],'defaultValue':![],'comment':_0x9c35('0x12'),'set':function(_0x911bba){if(!_0x911bba)this[_0x9c35('0x13')]('mandatoryDispositionPauseId',null);this[_0x9c35('0x13')](_0x9c35('0x14'),_0x911bba);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 387c3d7..d4138be 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 _0xc433=['removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','from-voip-provider','app','system','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','localstationid','gateway','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','tech','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','send','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','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','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','FaxAccounts','UserProfileResource','then','end','stack','name','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','length'];(function(_0x20c0a2,_0x43dbcf){var _0x2a533c=function(_0x5c5a94){while(--_0x5c5a94){_0x20c0a2['push'](_0x20c0a2['shift']());}};_0x2a533c(++_0x43dbcf);}(_0xc433,0x11f));var _0x3c43=function(_0x22d045,_0x13fd64){_0x22d045=_0x22d045-0x0;var _0x2460b1=_0xc433[_0x22d045];return _0x2460b1;};'use strict';var emlformat=require(_0x3c43('0x0'));var rimraf=require(_0x3c43('0x1'));var zipdir=require(_0x3c43('0x2'));var jsonpatch=require(_0x3c43('0x3'));var rp=require(_0x3c43('0x4'));var moment=require(_0x3c43('0x5'));var BPromise=require(_0x3c43('0x6'));var Mustache=require(_0x3c43('0x7'));var util=require('util');var path=require(_0x3c43('0x8'));var sox=require(_0x3c43('0x9'));var csv=require(_0x3c43('0xa'));var ejs=require(_0x3c43('0xb'));var fs=require('fs');var fs_extra=require(_0x3c43('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3c43('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3c43('0xa'));var querystring=require(_0x3c43('0xe'));var Papa=require(_0x3c43('0xf'));var Redis=require(_0x3c43('0x10'));var authService=require(_0x3c43('0x11'));var qs=require(_0x3c43('0x12'));var as=require(_0x3c43('0x13'));var hardwareService=require(_0x3c43('0x14'));var logger=require(_0x3c43('0x15'))(_0x3c43('0x16'));var utils=require(_0x3c43('0x17'));var config=require(_0x3c43('0x18'));var licenseUtil=require(_0x3c43('0x19'));var db=require('../../mysqldb')['db'];config[_0x3c43('0x1a')]=_[_0x3c43('0x1b')](config[_0x3c43('0x1a')],{'host':_0x3c43('0x1c'),'port':0x18eb});var socket=require(_0x3c43('0x1d'))(new Redis(config[_0x3c43('0x1a')]));require(_0x3c43('0x1e'))[_0x3c43('0x1f')](socket);var jayson=require(_0x3c43('0x20'));var client=jayson['client'][_0x3c43('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x3c43('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1a7fe3,_0x4c6b00,_0x324d77,_0x1ff9a2){return new BPromise(function(_0x5dc801,_0x53259d){var _0x16e09f=_0x1ff9a2||client;return _0x16e09f[_0x3c43('0x22')](_0x1a7fe3,_0x324d77)['then'](function(_0x45d689){logger[_0x3c43('0x23')](_0x3c43('0x24'),_0x4c6b00,_0x3c43('0x25'));logger[_0x3c43('0x26')](_0x3c43('0x27'),_0x4c6b00,_0x3c43('0x25'),JSON[_0x3c43('0x28')](_0x45d689));if(_0x45d689[_0x3c43('0x29')]){if(_0x45d689[_0x3c43('0x29')][_0x3c43('0x2a')]===0x1f4){logger[_0x3c43('0x29')](_0x3c43('0x24'),_0x4c6b00,_0x45d689['error'][_0x3c43('0x2b')]);return _0x53259d(_0x45d689[_0x3c43('0x29')]['message']);}logger[_0x3c43('0x29')]('FaxAccount,\x20%s,\x20%s',_0x4c6b00,_0x45d689[_0x3c43('0x29')][_0x3c43('0x2b')]);return _0x5dc801(_0x45d689[_0x3c43('0x29')][_0x3c43('0x2b')]);}else{logger[_0x3c43('0x23')]('FaxAccount,\x20%s,\x20%s',_0x4c6b00,'request\x20sent');_0x5dc801(_0x45d689[_0x3c43('0x2c')][_0x3c43('0x2b')]);}})[_0x3c43('0x2d')](function(_0x4cc754){logger[_0x3c43('0x29')]('FaxAccount,\x20%s,\x20%s',_0x4c6b00,_0x4cc754);_0x53259d(_0x4cc754);});});}function respondWithStatusCode(_0x1ad738,_0x4074e0){_0x4074e0=_0x4074e0||0xcc;return function(_0x1fce17){if(_0x1fce17){return _0x1ad738[_0x3c43('0x2e')](_0x4074e0);}return _0x1ad738[_0x3c43('0x2f')](_0x4074e0)['end']();};}function respondWithResult(_0x3773da,_0x14afdf){_0x14afdf=_0x14afdf||0xc8;return function(_0x19b82b){if(_0x19b82b){return _0x3773da['status'](_0x14afdf)[_0x3c43('0x30')](_0x19b82b);}};}function respondWithFilteredResult(_0x1e6c14,_0x55e84a){return function(_0xb6e492){if(_0xb6e492){var _0x437104=typeof _0x55e84a[_0x3c43('0x31')]===_0x3c43('0x32')&&typeof _0x55e84a[_0x3c43('0x33')]===_0x3c43('0x32');var _0x5f3226=_0xb6e492[_0x3c43('0x34')];var _0x46d76d=_0x437104?0x0:_0x55e84a[_0x3c43('0x31')];var _0x556d70=_0x437104?_0xb6e492['count']:_0x55e84a['offset']+_0x55e84a[_0x3c43('0x33')];var _0x36c6ae;if(_0x556d70>=_0x5f3226){_0x556d70=_0x5f3226;_0x36c6ae=0xc8;}else{_0x36c6ae=0xce;}_0x1e6c14['status'](_0x36c6ae);return _0x1e6c14['set'](_0x3c43('0x35'),_0x46d76d+'-'+_0x556d70+'/'+_0x5f3226)['json'](_0xb6e492);}return null;};}function patchUpdates(_0x10bcc7){return function(_0x1a7490){try{jsonpatch[_0x3c43('0x36')](_0x1a7490,_0x10bcc7,!![]);}catch(_0x145334){return BPromise['reject'](_0x145334);}return _0x1a7490['save']();};}function saveUpdates(_0x428df9,_0x12c5a1){return function(_0x13046f){if(_0x13046f){return _0x13046f[_0x3c43('0x37')](_0x428df9)['then'](function(_0x4ebdae){return _0x4ebdae;});}return null;};}function removeEntity(_0x477814,_0x1f7f7c){return function(_0x3d08f9){if(_0x3d08f9){return _0x3d08f9[_0x3c43('0x38')]()['then'](function(){var _0x138f7b=_0x3d08f9['get']({'plain':!![]});var _0x3b0986=_0x3c43('0x39');return db[_0x3c43('0x3a')]['destroy']({'where':{'type':_0x3b0986,'resourceId':_0x138f7b['id']}})[_0x3c43('0x3b')](function(){return _0x3d08f9;});})[_0x3c43('0x3b')](function(){_0x477814[_0x3c43('0x2f')](0xcc)[_0x3c43('0x3c')]();});}};}function handleEntityNotFound(_0x15685c,_0x4b265a){return function(_0x24335e){if(!_0x24335e){_0x15685c[_0x3c43('0x2e')](0x194);}return _0x24335e;};}function handleError(_0x5cad6a,_0x534d23){_0x534d23=_0x534d23||0x1f4;return function(_0x308a3a){logger[_0x3c43('0x29')](_0x308a3a[_0x3c43('0x3d')]);if(_0x308a3a[_0x3c43('0x3e')]){delete _0x308a3a[_0x3c43('0x3e')];}_0x5cad6a[_0x3c43('0x2f')](_0x534d23)['send'](_0x308a3a);};}exports['index']=function(_0x14b1ab,_0x13066f){var _0x2902b3={'include':[{'model':db[_0x3c43('0x3f')],'as':'mandatoryDispositionPause'}]},_0x32d592={},_0x5a6d80={'count':0x0,'rows':[]};var _0x4b862a=_[_0x3c43('0x40')](db[_0x3c43('0x41')][_0x3c43('0x42')],function(_0x4f5c37){return{'name':_0x4f5c37[_0x3c43('0x43')],'type':_0x4f5c37[_0x3c43('0x44')][_0x3c43('0x45')]};});_0x32d592[_0x3c43('0x46')]=_[_0x3c43('0x40')](_0x4b862a,_0x3c43('0x3e'));_0x32d592['query']=_[_0x3c43('0x47')](_0x14b1ab[_0x3c43('0x48')]);_0x32d592['filters']=_[_0x3c43('0x49')](_0x32d592['model'],_0x32d592[_0x3c43('0x48')]);_0x2902b3[_0x3c43('0x4a')]=_[_0x3c43('0x49')](_0x32d592[_0x3c43('0x46')],qs[_0x3c43('0x4b')](_0x14b1ab['query']['fields']));_0x2902b3[_0x3c43('0x4a')]=_0x2902b3[_0x3c43('0x4a')]['length']?_0x2902b3['attributes']:_0x32d592[_0x3c43('0x46')];if(!_0x14b1ab[_0x3c43('0x48')]['hasOwnProperty']('nolimit')){_0x2902b3[_0x3c43('0x33')]=qs[_0x3c43('0x33')](_0x14b1ab['query']['limit']);_0x2902b3[_0x3c43('0x31')]=qs[_0x3c43('0x31')](_0x14b1ab[_0x3c43('0x48')][_0x3c43('0x31')]);}_0x2902b3[_0x3c43('0x4c')]=qs[_0x3c43('0x4d')](_0x14b1ab['query'][_0x3c43('0x4d')]);_0x2902b3[_0x3c43('0x4e')]=qs['filters'](_[_0x3c43('0x4f')](_0x14b1ab[_0x3c43('0x48')],_0x32d592[_0x3c43('0x50')]),_0x4b862a);if(_0x14b1ab['query']['filter']){_0x2902b3['where']=_[_0x3c43('0x51')](_0x2902b3[_0x3c43('0x4e')],{'$or':_['map'](_0x4b862a,function(_0x271554){if(_0x271554['type']!==_0x3c43('0x52')){var _0x271053={};_0x271053[_0x271554['name']]={'$like':'%'+_0x14b1ab['query'][_0x3c43('0x53')]+'%'};return _0x271053;}})});}_0x2902b3=_[_0x3c43('0x51')]({},_0x2902b3,_0x14b1ab[_0x3c43('0x54')]);var _0x386fa0={'where':_0x2902b3[_0x3c43('0x4e')]};return db[_0x3c43('0x41')]['count'](_0x386fa0)[_0x3c43('0x3b')](function(_0x50ab2c){_0x5a6d80[_0x3c43('0x34')]=_0x50ab2c;if(_0x14b1ab[_0x3c43('0x48')][_0x3c43('0x55')]){_0x2902b3[_0x3c43('0x56')]=[{'all':!![]}];}return db['FaxAccount'][_0x3c43('0x57')](_0x2902b3);})[_0x3c43('0x3b')](function(_0x24d9e3){_0x5a6d80[_0x3c43('0x58')]=_0x24d9e3;return _0x5a6d80;})[_0x3c43('0x3b')](respondWithFilteredResult(_0x13066f,_0x2902b3))[_0x3c43('0x2d')](handleError(_0x13066f,null));};exports['show']=function(_0x43c49b,_0x341649){var _0x22ff11={'raw':![],'where':{'id':_0x43c49b[_0x3c43('0x59')]['id']},'include':[{'model':db[_0x3c43('0x3f')],'as':'mandatoryDispositionPause'}]},_0x9ae683={};_0x9ae683[_0x3c43('0x46')]=_['keys'](db[_0x3c43('0x41')][_0x3c43('0x42')]);_0x9ae683[_0x3c43('0x48')]=_[_0x3c43('0x47')](_0x43c49b['query']);_0x9ae683['filters']=_[_0x3c43('0x49')](_0x9ae683[_0x3c43('0x46')],_0x9ae683[_0x3c43('0x48')]);_0x22ff11['attributes']=_['intersection'](_0x9ae683[_0x3c43('0x46')],qs['fields'](_0x43c49b['query'][_0x3c43('0x4b')]));_0x22ff11['attributes']=_0x22ff11[_0x3c43('0x4a')]['length']?_0x22ff11[_0x3c43('0x4a')]:_0x9ae683[_0x3c43('0x46')];if(_0x43c49b[_0x3c43('0x48')][_0x3c43('0x55')]){_0x22ff11[_0x3c43('0x56')]=[{'all':!![]}];}_0x22ff11=_[_0x3c43('0x51')]({},_0x22ff11,_0x43c49b[_0x3c43('0x54')]);return db[_0x3c43('0x41')][_0x3c43('0x5a')](_0x22ff11)['then'](handleEntityNotFound(_0x341649,null))[_0x3c43('0x3b')](respondWithResult(_0x341649,null))[_0x3c43('0x2d')](handleError(_0x341649,null));};exports[_0x3c43('0x5b')]=function(_0x1a828a,_0x4c0586){return db[_0x3c43('0x41')]['create'](_0x1a828a[_0x3c43('0x5c')],{})[_0x3c43('0x3b')](function(_0x362e7d){var _0x3e522e=_0x1a828a[_0x3c43('0x5d')]['get']({'plain':!![]});if(!_0x3e522e)throw new Error(_0x3c43('0x5e'));if(_0x3e522e[_0x3c43('0x5f')]===_0x3c43('0x5d')){var _0xb96953=_0x362e7d[_0x3c43('0x60')]({'plain':!![]});var _0x8577b6=_0x3c43('0x39');return db['UserProfileSection'][_0x3c43('0x5a')]({'where':{'name':_0x8577b6,'userProfileId':_0x3e522e[_0x3c43('0x61')]},'raw':!![]})['then'](function(_0x14d75d){if(_0x14d75d&&_0x14d75d[_0x3c43('0x62')]===0x0){return db[_0x3c43('0x3a')][_0x3c43('0x5b')]({'name':_0xb96953[_0x3c43('0x3e')],'resourceId':_0xb96953['id'],'type':_0x14d75d['name'],'sectionId':_0x14d75d['id']},{})['then'](function(){return _0x362e7d;});}else{return _0x362e7d;}})[_0x3c43('0x2d')](function(_0x4f70f8){logger[_0x3c43('0x29')](_0x3c43('0x63'),_0x4f70f8);throw _0x4f70f8;});}return _0x362e7d;})['then'](respondWithResult(_0x4c0586,0xc9))[_0x3c43('0x2d')](handleError(_0x4c0586,null));};exports['update']=function(_0x4e11ea,_0x3b9878){if(_0x4e11ea[_0x3c43('0x5c')]['id']){delete _0x4e11ea[_0x3c43('0x5c')]['id'];}return db[_0x3c43('0x41')]['find']({'where':{'id':_0x4e11ea[_0x3c43('0x59')]['id']},'include':[{'model':db[_0x3c43('0x3f')],'as':_0x3c43('0x64')}]})[_0x3c43('0x3b')](handleEntityNotFound(_0x3b9878,null))[_0x3c43('0x3b')](saveUpdates(_0x4e11ea[_0x3c43('0x5c')],null))[_0x3c43('0x3b')](respondWithResult(_0x3b9878,null))[_0x3c43('0x2d')](handleError(_0x3b9878,null));};exports[_0x3c43('0x38')]=function(_0x3400b3,_0x161a22){return db['FaxAccount']['find']({'where':{'id':_0x3400b3[_0x3c43('0x59')]['id']}})[_0x3c43('0x3b')](handleEntityNotFound(_0x161a22,null))['then'](removeEntity(_0x161a22,null))[_0x3c43('0x2d')](handleError(_0x161a22,null));};exports[_0x3c43('0x65')]=function(_0x31d9af,_0x5b0f3d){return db[_0x3c43('0x41')][_0x3c43('0x65')]()[_0x3c43('0x3b')](respondWithResult(_0x5b0f3d,null))['catch'](handleError(_0x5b0f3d,null));};exports[_0x3c43('0x66')]=function(_0x48f44d,_0x46e236,_0x4afe58){if(_0x48f44d[_0x3c43('0x5c')]['id']){delete _0x48f44d[_0x3c43('0x5c')]['id'];}return db[_0x3c43('0x41')]['find']({'where':{'id':_0x48f44d[_0x3c43('0x59')]['id']}})[_0x3c43('0x3b')](handleEntityNotFound(_0x46e236,null))[_0x3c43('0x3b')](function(_0x4de37c){if(_0x4de37c){_0x48f44d['body'][_0x3c43('0x67')]=_0x4de37c['id'];return db[_0x3c43('0x68')][_0x3c43('0x5b')](_0x48f44d[_0x3c43('0x5c')]);}})[_0x3c43('0x3b')](respondWithResult(_0x46e236,null))[_0x3c43('0x2d')](handleError(_0x46e236,null));};exports[_0x3c43('0x69')]=function(_0x4edb47,_0x3630c8,_0x2d9da2){var _0x3c86dd={'raw':![],'where':{}};var _0x85cd2c={};var _0x3a13ad={'count':0x0,'rows':[]};return db[_0x3c43('0x41')][_0x3c43('0x6a')]({'where':{'id':_0x4edb47['params']['id']}})['then'](handleEntityNotFound(_0x3630c8,null))[_0x3c43('0x3b')](function(_0x3b65de){if(_0x3b65de){_0x85cd2c[_0x3c43('0x46')]=_[_0x3c43('0x47')](db[_0x3c43('0x68')][_0x3c43('0x42')]);_0x85cd2c[_0x3c43('0x48')]=_['keys'](_0x4edb47[_0x3c43('0x48')]);_0x85cd2c[_0x3c43('0x50')]=_[_0x3c43('0x49')](_0x85cd2c['model'],_0x85cd2c[_0x3c43('0x48')]);_0x3c86dd['attributes']=_[_0x3c43('0x49')](_0x85cd2c[_0x3c43('0x46')],qs[_0x3c43('0x4b')](_0x4edb47[_0x3c43('0x48')]['fields']));_0x3c86dd[_0x3c43('0x4a')]=_0x3c86dd['attributes']['length']?_0x3c86dd[_0x3c43('0x4a')]:_0x85cd2c[_0x3c43('0x46')];if(!_0x4edb47[_0x3c43('0x48')][_0x3c43('0x6b')](_0x3c43('0x6c'))){_0x3c86dd[_0x3c43('0x33')]=qs[_0x3c43('0x33')](_0x4edb47[_0x3c43('0x48')][_0x3c43('0x33')]);_0x3c86dd[_0x3c43('0x31')]=qs['offset'](_0x4edb47['query']['offset']);}_0x3c86dd[_0x3c43('0x4c')]=qs[_0x3c43('0x4d')](_0x4edb47[_0x3c43('0x48')][_0x3c43('0x4d')]);_0x3c86dd[_0x3c43('0x4e')]=qs[_0x3c43('0x50')](_[_0x3c43('0x4f')](_0x4edb47[_0x3c43('0x48')],_0x85cd2c[_0x3c43('0x50')]));_0x3c86dd[_0x3c43('0x4e')][_0x3c43('0x67')]=_0x3b65de['id'];if(_0x4edb47[_0x3c43('0x48')][_0x3c43('0x53')]){_0x3c86dd[_0x3c43('0x4e')]=_['merge'](_0x3c86dd[_0x3c43('0x4e')],{'$or':_[_0x3c43('0x40')](_0x3c86dd[_0x3c43('0x4a')],function(_0x35d917){var _0x461598={};_0x461598[_0x35d917]={'$like':'%'+_0x4edb47[_0x3c43('0x48')][_0x3c43('0x53')]+'%'};return _0x461598;})});}_0x3c86dd=_[_0x3c43('0x51')]({},_0x3c86dd,_0x4edb47[_0x3c43('0x54')]);return db[_0x3c43('0x68')]['count']({'where':_0x3c86dd[_0x3c43('0x4e')]})[_0x3c43('0x3b')](function(_0x307cc0){_0x3a13ad[_0x3c43('0x34')]=_0x307cc0;if(_0x4edb47[_0x3c43('0x48')][_0x3c43('0x55')]){_0x3c86dd[_0x3c43('0x56')]=[{'all':!![]}];}return db[_0x3c43('0x68')][_0x3c43('0x57')](_0x3c86dd);})[_0x3c43('0x3b')](function(_0x489239){_0x3a13ad['rows']=_0x489239;return _0x3a13ad;});}})[_0x3c43('0x3b')](respondWithFilteredResult(_0x3630c8,_0x3c86dd))[_0x3c43('0x2d')](handleError(_0x3630c8,null));};exports[_0x3c43('0x6d')]=function(_0x1a80d7,_0x572dd1,_0x1ac806){return db[_0x3c43('0x41')][_0x3c43('0x5a')]({'where':{'id':_0x1a80d7[_0x3c43('0x59')]['id']}})[_0x3c43('0x3b')](handleEntityNotFound(_0x572dd1,null))[_0x3c43('0x3b')](function(_0x33f1a2){if(_0x33f1a2){return _0x33f1a2[_0x3c43('0x6d')](_0x1a80d7[_0x3c43('0x48')][_0x3c43('0x6e')]);}})['then'](respondWithStatusCode(_0x572dd1,null))[_0x3c43('0x2d')](handleError(_0x572dd1,null));};exports[_0x3c43('0x6f')]=function(_0x39e72f,_0x48e17c,_0x2ac42e){if(_0x39e72f[_0x3c43('0x5c')]['id']){delete _0x39e72f['body']['id'];}return db[_0x3c43('0x41')][_0x3c43('0x5a')]({'where':{'id':_0x39e72f[_0x3c43('0x59')]['id']}})[_0x3c43('0x3b')](handleEntityNotFound(_0x48e17c,null))[_0x3c43('0x3b')](function(_0x5adfe0){if(_0x5adfe0){_0x39e72f[_0x3c43('0x5c')][_0x3c43('0x67')]=_0x5adfe0['id'];return db[_0x3c43('0x70')][_0x3c43('0x5b')](_0x39e72f[_0x3c43('0x5c')]);}})[_0x3c43('0x3b')](respondWithResult(_0x48e17c,null))[_0x3c43('0x2d')](handleError(_0x48e17c,null));};exports[_0x3c43('0x71')]=function(_0x2510b2,_0x571344,_0x30d069){var _0x1c4ab4={'raw':![],'where':{}};var _0x1530e5={};var _0x228c95={'count':0x0,'rows':[]};return db['FaxAccount'][_0x3c43('0x6a')]({'where':{'id':_0x2510b2[_0x3c43('0x59')]['id']}})[_0x3c43('0x3b')](handleEntityNotFound(_0x571344,null))[_0x3c43('0x3b')](function(_0x496518){if(_0x496518){_0x1530e5[_0x3c43('0x46')]=_[_0x3c43('0x47')](db[_0x3c43('0x70')][_0x3c43('0x42')]);_0x1530e5[_0x3c43('0x48')]=_[_0x3c43('0x47')](_0x2510b2['query']);_0x1530e5['filters']=_['intersection'](_0x1530e5[_0x3c43('0x46')],_0x1530e5[_0x3c43('0x48')]);_0x1c4ab4['attributes']=_['intersection'](_0x1530e5[_0x3c43('0x46')],qs['fields'](_0x2510b2['query'][_0x3c43('0x4b')]));_0x1c4ab4[_0x3c43('0x4a')]=_0x1c4ab4[_0x3c43('0x4a')][_0x3c43('0x72')]?_0x1c4ab4['attributes']:_0x1530e5[_0x3c43('0x46')];if(!_0x2510b2[_0x3c43('0x48')][_0x3c43('0x6b')](_0x3c43('0x6c'))){_0x1c4ab4[_0x3c43('0x33')]=qs[_0x3c43('0x33')](_0x2510b2[_0x3c43('0x48')][_0x3c43('0x33')]);_0x1c4ab4[_0x3c43('0x31')]=qs[_0x3c43('0x31')](_0x2510b2[_0x3c43('0x48')][_0x3c43('0x31')]);}_0x1c4ab4[_0x3c43('0x4c')]=qs['sort'](_0x2510b2[_0x3c43('0x48')][_0x3c43('0x4d')]);_0x1c4ab4['where']=qs['filters'](_[_0x3c43('0x4f')](_0x2510b2['query'],_0x1530e5[_0x3c43('0x50')]));_0x1c4ab4[_0x3c43('0x4e')]['FaxAccountId']=_0x496518['id'];if(_0x2510b2[_0x3c43('0x48')]['filter']){_0x1c4ab4[_0x3c43('0x4e')]=_[_0x3c43('0x51')](_0x1c4ab4[_0x3c43('0x4e')],{'$or':_[_0x3c43('0x40')](_0x1c4ab4[_0x3c43('0x4a')],function(_0x559797){var _0x19c8ac={};_0x19c8ac[_0x559797]={'$like':'%'+_0x2510b2['query'][_0x3c43('0x53')]+'%'};return _0x19c8ac;})});}_0x1c4ab4=_[_0x3c43('0x51')]({},_0x1c4ab4,_0x2510b2[_0x3c43('0x54')]);return db[_0x3c43('0x70')][_0x3c43('0x34')]({'where':_0x1c4ab4[_0x3c43('0x4e')]})[_0x3c43('0x3b')](function(_0x36dc67){_0x228c95[_0x3c43('0x34')]=_0x36dc67;if(_0x2510b2[_0x3c43('0x48')]['includeAll']){_0x1c4ab4[_0x3c43('0x56')]=[{'all':!![]}];}return db[_0x3c43('0x70')]['findAll'](_0x1c4ab4);})[_0x3c43('0x3b')](function(_0x4bc210){_0x228c95[_0x3c43('0x58')]=_0x4bc210;return _0x228c95;});}})['then'](respondWithFilteredResult(_0x571344,_0x1c4ab4))['catch'](handleError(_0x571344,null));};exports[_0x3c43('0x73')]=function(_0x6ee791,_0x113f4c,_0x18a08f){return db[_0x3c43('0x41')][_0x3c43('0x5a')]({'where':{'id':_0x6ee791[_0x3c43('0x59')]['id']}})['then'](handleEntityNotFound(_0x113f4c,null))['then'](function(_0x40378e){if(_0x40378e){return _0x40378e[_0x3c43('0x73')](_0x6ee791['query']['ids']);}})[_0x3c43('0x3b')](respondWithStatusCode(_0x113f4c,null))[_0x3c43('0x2d')](handleError(_0x113f4c,null));};exports[_0x3c43('0x74')]=function(_0x193566,_0x59814e,_0x22bdd6){return db[_0x3c43('0x75')]['find']({'where':{'id':_0x193566['params']['id']}})['then'](handleEntityNotFound(_0x59814e,null))[_0x3c43('0x3b')](function(_0x423b10){if(_0x423b10){return _0x423b10[_0x3c43('0x74')](_0x193566[_0x3c43('0x5c')][_0x3c43('0x6e')],_[_0x3c43('0x76')](_0x193566[_0x3c43('0x5c')],[_0x3c43('0x6e'),'id'])||{});}})[_0x3c43('0x3b')](respondWithResult(_0x59814e,null))[_0x3c43('0x2d')](handleError(_0x59814e,null));};exports[_0x3c43('0x77')]=function(_0xc1d3c6,_0x24a4c7,_0x433201){var _0x44a166={'raw':![],'where':{}};var _0x2f2c0e={};var _0x1382fa={'count':0x0,'rows':[]};return db[_0x3c43('0x41')]['findOne']({'where':{'id':_0xc1d3c6[_0x3c43('0x59')]['id']}})[_0x3c43('0x3b')](handleEntityNotFound(_0x24a4c7,null))[_0x3c43('0x3b')](function(_0x285fd7){if(_0x285fd7){_0x2f2c0e[_0x3c43('0x46')]=_[_0x3c43('0x47')](db[_0x3c43('0x75')][_0x3c43('0x42')]);_0x2f2c0e[_0x3c43('0x48')]=_[_0x3c43('0x47')](_0xc1d3c6[_0x3c43('0x48')]);_0x2f2c0e['filters']=_[_0x3c43('0x49')](_0x2f2c0e[_0x3c43('0x46')],_0x2f2c0e['query']);_0x44a166['attributes']=_[_0x3c43('0x49')](_0x2f2c0e[_0x3c43('0x46')],qs[_0x3c43('0x4b')](_0xc1d3c6['query'][_0x3c43('0x4b')]));_0x44a166[_0x3c43('0x4a')]=_0x44a166['attributes'][_0x3c43('0x72')]?_0x44a166['attributes']:_0x2f2c0e[_0x3c43('0x46')];if(!_0xc1d3c6[_0x3c43('0x48')][_0x3c43('0x6b')]('nolimit')){_0x44a166[_0x3c43('0x33')]=qs['limit'](_0xc1d3c6[_0x3c43('0x48')]['limit']);_0x44a166[_0x3c43('0x31')]=qs[_0x3c43('0x31')](_0xc1d3c6[_0x3c43('0x48')][_0x3c43('0x31')]);}_0x44a166[_0x3c43('0x4c')]=qs[_0x3c43('0x4d')](_0xc1d3c6[_0x3c43('0x48')][_0x3c43('0x4d')]);_0x44a166[_0x3c43('0x4e')]=qs['filters'](_[_0x3c43('0x4f')](_0xc1d3c6['query'],_0x2f2c0e['filters']));_0x44a166[_0x3c43('0x4e')][_0x3c43('0x67')]=_0x285fd7['id'];if(_0xc1d3c6['query']['filter']){_0x44a166['where']=_[_0x3c43('0x51')](_0x44a166[_0x3c43('0x4e')],{'$or':_[_0x3c43('0x40')](_0x44a166[_0x3c43('0x4a')],function(_0x201cf3){var _0x585aff={};_0x585aff[_0x201cf3]={'$like':'%'+_0xc1d3c6['query'][_0x3c43('0x53')]+'%'};return _0x585aff;})});}_0x44a166=_[_0x3c43('0x51')]({},_0x44a166,_0xc1d3c6[_0x3c43('0x54')]);return db[_0x3c43('0x75')][_0x3c43('0x34')]({'where':_0x44a166[_0x3c43('0x4e')]})['then'](function(_0x47370d){_0x1382fa['count']=_0x47370d;if(_0xc1d3c6[_0x3c43('0x48')][_0x3c43('0x55')]){_0x44a166[_0x3c43('0x56')]=[{'model':db[_0x3c43('0x78')],'as':_0x3c43('0x79'),'required':![]},{'model':db[_0x3c43('0x7a')],'as':_0x3c43('0x7b'),'attributes':[_0x3c43('0x3e'),_0x3c43('0x7c'),_0x3c43('0x7d')],'required':![]},{'model':db[_0x3c43('0x7e')],'as':'Tags','attributes':['id','name',_0x3c43('0x7f')],'where':_0xc1d3c6[_0x3c43('0x48')]['tag']?{'id':_0xc1d3c6['query'][_0x3c43('0x80')]}:undefined,'required':_0xc1d3c6[_0x3c43('0x48')]['tag']?!![]:![]}];}return db[_0x3c43('0x75')][_0x3c43('0x57')](_0x44a166);})[_0x3c43('0x3b')](function(_0x3c4190){_0x1382fa[_0x3c43('0x58')]=_0x3c4190;return _0x1382fa;});}})[_0x3c43('0x3b')](respondWithFilteredResult(_0x24a4c7,_0x44a166))[_0x3c43('0x2d')](handleError(_0x24a4c7,null));};exports[_0x3c43('0x81')]=function(_0x2f4c84,_0x4b9bfa){var _0x3325a2=_0x2f4c84[_0x3c43('0x59')]['id'];var _0xeca78=_0x2f4c84[_0x3c43('0x5c')];var _0x2e2d89=0xc8;var _0x35b00a=null;return db[_0x3c43('0x82')][_0x3c43('0x83')]({'isolationLevel':db[_0x3c43('0x82')][_0x3c43('0x84')][_0x3c43('0x85')][_0x3c43('0x86')]},function(_0x159fce){return db[_0x3c43('0x41')][_0x3c43('0x6a')]({'where':{'id':_0x3325a2},'transaction':_0x159fce})[_0x3c43('0x3b')](function(_0x1fbc2f){if(_0x1fbc2f){return db[_0x3c43('0x87')][_0x3c43('0x38')]({'where':{'FaxAccountId':_0x3325a2},'transaction':_0x159fce})[_0x3c43('0x3b')](function(){var _0x24cd9f=_[_0x3c43('0x40')](_0xeca78,function(_0x405414){_0x405414[_0x3c43('0x67')]=_0x3325a2;return _0x405414;});return db[_0x3c43('0x87')][_0x3c43('0x88')](_0x24cd9f,{'transaction':_0x159fce});});}else{_0x2e2d89=0x194;_0x35b00a=[];}});})[_0x3c43('0x3b')](function(){if(_0x2e2d89!==0x194){return db[_0x3c43('0x87')][_0x3c43('0x89')]({'where':{'FaxAccountId':_0x3325a2},'order':_0x3c43('0x8a')})[_0x3c43('0x3b')](function(_0x4030ab){_0x35b00a=_0x4030ab;});}})[_0x3c43('0x2d')](function(_0x3b5df8){_0x2e2d89=0x1f4;logger['error'](_0x3b5df8[_0x3c43('0x3d')]);if(_0x3b5df8[_0x3c43('0x3e')]){delete _0x3b5df8[_0x3c43('0x3e')];}_0x35b00a=_0x3b5df8;})[_0x3c43('0x8b')](function(){if(_0x35b00a===null){_0x4b9bfa[_0x3c43('0x2e')](_0x2e2d89);}else{if(_0x2e2d89===0x1f4){_0x4b9bfa[_0x3c43('0x2f')](_0x2e2d89)['send'](_0x35b00a);}else{_0x4b9bfa['status'](_0x2e2d89)[_0x3c43('0x30')](_0x35b00a);}}});};exports[_0x3c43('0x8c')]=function(_0x3200fa,_0x1af211,_0x695b8c){var _0x4b4a5a={};var _0x527c82={};var _0x467ec9;var _0x242dcb;return db[_0x3c43('0x41')]['findOne']({'where':{'id':_0x3200fa[_0x3c43('0x59')]['id']}})[_0x3c43('0x3b')](handleEntityNotFound(_0x1af211,null))[_0x3c43('0x3b')](function(_0x20f0de){if(_0x20f0de){_0x467ec9=_0x20f0de;_0x527c82['model']=_[_0x3c43('0x47')](db[_0x3c43('0x87')][_0x3c43('0x42')]);_0x527c82[_0x3c43('0x48')]=_['keys'](_0x3200fa[_0x3c43('0x48')]);_0x527c82[_0x3c43('0x50')]=_['intersection'](_0x527c82[_0x3c43('0x46')],_0x527c82[_0x3c43('0x48')]);_0x4b4a5a[_0x3c43('0x4a')]=_[_0x3c43('0x49')](_0x527c82[_0x3c43('0x46')],qs[_0x3c43('0x4b')](_0x3200fa[_0x3c43('0x48')]['fields']));_0x4b4a5a[_0x3c43('0x4a')]=_0x4b4a5a[_0x3c43('0x4a')][_0x3c43('0x72')]?_0x4b4a5a[_0x3c43('0x4a')]:_0x527c82[_0x3c43('0x46')];_0x4b4a5a[_0x3c43('0x4c')]=qs['sort'](_0x3200fa[_0x3c43('0x48')]['sort']);_0x4b4a5a['where']=qs[_0x3c43('0x50')](_[_0x3c43('0x4f')](_0x3200fa[_0x3c43('0x48')],_0x527c82[_0x3c43('0x50')]));if(_0x3200fa[_0x3c43('0x48')][_0x3c43('0x53')]){_0x4b4a5a[_0x3c43('0x4e')]=_['merge'](_0x4b4a5a[_0x3c43('0x4e')],{'$or':_[_0x3c43('0x40')](_0x4b4a5a[_0x3c43('0x4a')],function(_0x583731){var _0x4a5cdf={};_0x4a5cdf[_0x583731]={'$like':'%'+_0x3200fa[_0x3c43('0x48')][_0x3c43('0x53')]+'%'};return _0x4a5cdf;})});}_0x4b4a5a=_[_0x3c43('0x51')]({},_0x4b4a5a,_0x3200fa[_0x3c43('0x54')]);return _0x467ec9[_0x3c43('0x8c')](_0x4b4a5a);}})['then'](function(_0x407d48){if(_0x407d48){_0x242dcb=_0x407d48[_0x3c43('0x72')];if(!_0x3200fa['query'][_0x3c43('0x6b')](_0x3c43('0x6c'))){_0x4b4a5a[_0x3c43('0x33')]=qs[_0x3c43('0x33')](_0x3200fa[_0x3c43('0x48')][_0x3c43('0x33')]);_0x4b4a5a[_0x3c43('0x31')]=qs[_0x3c43('0x31')](_0x3200fa[_0x3c43('0x48')][_0x3c43('0x31')]);}return _0x467ec9[_0x3c43('0x8c')](_0x4b4a5a);}})['then'](function(_0x5a2b1e){if(_0x5a2b1e){return _0x5a2b1e?{'count':_0x242dcb,'rows':_0x5a2b1e}:null;}})[_0x3c43('0x3b')](respondWithResult(_0x1af211,null))[_0x3c43('0x2d')](handleError(_0x1af211,null));};function Extension(_0xf1a69a,_0xbb7f63,_0x5415d2,_0x397546){this['context']=_0x3c43('0x8d');this['exten']=_0xf1a69a['localstationid'];this[_0x3c43('0x8e')]=_0x397546;this['type']=_0x3c43('0x8f');this[_0x3c43('0x90')]=_0x3c43('0x91');this[_0x3c43('0x67')]=_0xf1a69a['id'];this[_0x3c43('0x8a')]=_0xbb7f63;this['appdata']=_0x5415d2;}function createExtensionsReciveFax(_0x4b3102){var _0x6067d7=0x1;var _0x3ec1c3=[];_0x3ec1c3[_0x3c43('0x92')](new Extension(_0x4b3102,_0x6067d7,'',_0x3c43('0x93')));_0x6067d7+=0x1;_0x3ec1c3[_0x3c43('0x92')](new Extension(_0x4b3102,_0x6067d7,_0x3c43('0x94'),_0x3c43('0x95')));_0x6067d7+=0x1;for(var _0x5810db in _0x4b3102){if(_0x4b3102['hasOwnProperty'](_0x5810db)&&(_0x5810db==='ecm'||_0x5810db===_0x3c43('0x96')||_0x5810db===_0x3c43('0x97')||_0x5810db==='faxdetect'||_0x5810db===_0x3c43('0x98')||_0x5810db===_0x3c43('0x99')||_0x5810db===_0x3c43('0x9a')||_0x5810db==='modem'||_0x5810db===_0x3c43('0x9b'))){_0x3ec1c3[_0x3c43('0x92')](new Extension(_0x4b3102,_0x6067d7,_0x3c43('0x9c')+_0x5810db+')='+_0x4b3102[_0x5810db],_0x3c43('0x95')));_0x6067d7+=0x1;}}_0x3ec1c3['push'](new Extension(_0x4b3102,_0x6067d7,'6',_0x3c43('0x9d')));_0x6067d7+=0x1;_0x3ec1c3[_0x3c43('0x92')](new Extension(_0x4b3102,_0x6067d7,_0x3c43('0x9e'),_0x3c43('0x9f')));_0x6067d7=0x0;return _0x3ec1c3;}exports[_0x3c43('0xa0')]=function(_0x7be4c1,_0x3226ac,_0xf6bac3){var _0x1971cd;return db[_0x3c43('0x82')][_0x3c43('0x83')](function(_0x49b38f){return db['FaxAccount']['create'](_0x7be4c1[_0x3c43('0x5c')],{'transaction':_0x49b38f})[_0x3c43('0x3b')](function(_0x598370){_0x1971cd=_0x598370[_0x3c43('0x60')]({'plain':!![]});return db[_0x3c43('0xa1')]['bulkCreate'](createExtensionsReciveFax(_0x1971cd),{'transaction':_0x49b38f});});})[_0x3c43('0x3b')](function(){return _0x1971cd;})['then'](respondWithResult(_0x3226ac,null))[_0x3c43('0x2d')](handleError(_0x3226ac,null));};exports['updateAccountApplications']=function(_0x3b8e45,_0x1f461c,_0x33f94e){var _0x3de824;return db[_0x3c43('0x82')][_0x3c43('0x83')](function(_0x4b75d1){return db[_0x3c43('0x41')][_0x3c43('0x37')](_0x3b8e45[_0x3c43('0x5c')],{'where':{'id':_0x3b8e45['body']['id']},'transaction':_0x4b75d1})[_0x3c43('0x3b')](function(_0x284d77){return db[_0x3c43('0xa1')][_0x3c43('0x38')]({'where':{'FaxAccountId':_0x3b8e45[_0x3c43('0x5c')]['id']},'transaction':_0x4b75d1})['then'](function(_0x364533){return db[_0x3c43('0xa1')]['bulkCreate'](createExtensionsReciveFax(_[_0x3c43('0x76')](_0x3b8e45['body'],[_0x3c43('0xa2'),'key','createdAt',_0x3c43('0xa3'),_0x3c43('0xa4'),_0x3c43('0xa5')])),{'transaction':_0x4b75d1});});});})['then'](function(){return db[_0x3c43('0x41')][_0x3c43('0xa6')](_0x3b8e45['body']['id']);})[_0x3c43('0x3b')](respondWithResult(_0x1f461c,null))['catch'](handleError(_0x1f461c,null));};exports[_0x3c43('0xa7')]=function(_0x301e3c,_0x34d938,_0x4ce075){var _0x588648={'raw':!![],'where':{}};var _0x346eef={};var _0x264eaa={'count':0x0,'rows':[]};return db['FaxAccount'][_0x3c43('0x6a')]({'where':{'id':_0x301e3c[_0x3c43('0x59')]['id']}})[_0x3c43('0x3b')](handleEntityNotFound(_0x34d938,null))[_0x3c43('0x3b')](function(_0x50f030){if(_0x50f030){_0x346eef[_0x3c43('0x46')]=_[_0x3c43('0x47')](db[_0x3c43('0xa8')][_0x3c43('0x42')]);_0x346eef[_0x3c43('0x48')]=_[_0x3c43('0x47')](_0x301e3c[_0x3c43('0x48')]);_0x346eef['filters']=_[_0x3c43('0x49')](_0x346eef[_0x3c43('0x46')],_0x346eef[_0x3c43('0x48')]);_0x588648[_0x3c43('0x4a')]=_['intersection'](_0x346eef[_0x3c43('0x46')],qs[_0x3c43('0x4b')](_0x301e3c[_0x3c43('0x48')][_0x3c43('0x4b')]));_0x588648[_0x3c43('0x4a')]=_0x588648['attributes'][_0x3c43('0x72')]?_0x588648[_0x3c43('0x4a')]:_0x346eef[_0x3c43('0x46')];if(!_0x301e3c[_0x3c43('0x48')][_0x3c43('0x6b')]('nolimit')){_0x588648[_0x3c43('0x33')]=qs[_0x3c43('0x33')](_0x301e3c[_0x3c43('0x48')][_0x3c43('0x33')]);_0x588648['offset']=qs[_0x3c43('0x31')](_0x301e3c[_0x3c43('0x48')][_0x3c43('0x31')]);}_0x588648['order']=qs[_0x3c43('0x4d')](_0x301e3c[_0x3c43('0x48')][_0x3c43('0x4d')]);_0x588648['where']=qs['filters'](_[_0x3c43('0x4f')](_0x301e3c[_0x3c43('0x48')],_0x346eef[_0x3c43('0x50')]));_0x588648[_0x3c43('0x4e')][_0x3c43('0x67')]=_0x50f030['id'];if(_0x301e3c[_0x3c43('0x48')][_0x3c43('0x53')]){_0x588648[_0x3c43('0x4e')]=_[_0x3c43('0x51')](_0x588648['where'],{'$or':_[_0x3c43('0x40')](_0x588648[_0x3c43('0x4a')],function(_0x52d646){var _0x5b4259={};_0x5b4259[_0x52d646]={'$like':'%'+_0x301e3c['query'][_0x3c43('0x53')]+'%'};return _0x5b4259;})});}if(_0x301e3c[_0x3c43('0x48')][_0x3c43('0xa9')]){var _0x3bec42=_0x301e3c[_0x3c43('0x48')][_0x3c43('0xa9')][_0x3c43('0xaa')](',');var _0x24e8ee={};_0x24e8ee[_0x3bec42[0x0]]={'$gte':moment(_0x3bec42[0x1])['format'](_0x3c43('0xab'))};_0x588648[_0x3c43('0x4e')]=_[_0x3c43('0x51')](_0x588648['where'],_0x24e8ee);}_0x588648=_[_0x3c43('0x51')]({},_0x588648,_0x301e3c[_0x3c43('0x54')]);return db[_0x3c43('0xa8')][_0x3c43('0x34')]({'where':_0x588648['where']})[_0x3c43('0x3b')](function(_0x5d674a){_0x264eaa[_0x3c43('0x34')]=_0x5d674a;if(_0x301e3c[_0x3c43('0x48')][_0x3c43('0x55')]){_0x588648['include']=[{'all':!![]}];}return db['FaxMessage'][_0x3c43('0x57')](_0x588648);})['then'](function(_0x5ba2b5){_0x264eaa['rows']=_0x5ba2b5;return _0x264eaa;});}})[_0x3c43('0x3b')](respondWithFilteredResult(_0x34d938,_0x588648))[_0x3c43('0x2d')](handleError(_0x34d938,null));};exports[_0x3c43('0xac')]=function(_0x36a599,_0x39c306,_0x53bb3a){var _0x4afb4f,_0x59e907={},_0x6834c6;if(_0x36a599[_0x3c43('0x5c')]['to']){_0x6834c6=_0x36a599['body']['to'][0x0];}return db[_0x3c43('0x41')][_0x3c43('0x5a')]({'where':{'id':_0x36a599['params']['id']},'include':[{'model':db['CmList'],'as':_0x3c43('0xad'),'include':[{'model':db['CmContact'],'as':_0x3c43('0xae'),'where':{'fax':_0x6834c6},'limit':0x1,'order':[[_0x3c43('0xa3'),_0x3c43('0xaf')]]}]}]})['then'](handleEntityNotFound(_0x39c306,null))['then'](function(_0x53c704){_0x4afb4f=_0x53c704;if(_0x36a599[_0x3c43('0x5c')]['attachments']&&_0x36a599['body'][_0x3c43('0xb0')][_0x3c43('0x72')]){for(var _0x390c4d=0x0;_0x390c4d<_0x36a599[_0x3c43('0x5c')]['attachments'][_0x3c43('0x72')];_0x390c4d+=0x1){_0x36a599[_0x3c43('0x5c')]['attachments'][_0x390c4d]={'filename':_0x36a599[_0x3c43('0x5c')][_0x3c43('0xb0')][_0x390c4d][_0x3c43('0x3e')],'id':_0x36a599[_0x3c43('0x5c')][_0x3c43('0xb0')][_0x390c4d]['id'],'path':path[_0x3c43('0xb1')](config[_0x3c43('0xb2')],_0x3c43('0xb3'),_0x36a599[_0x3c43('0x5c')]['attachments'][_0x390c4d][_0x3c43('0xb4')])};}}return respondWithRpcPromise(_0x3c43('0xb5'),'CheckAfterSend',{'FaxAccountId':_[_0x3c43('0xb6')](_0x36a599[_0x3c43('0x59')]['id'])?undefined:_0x36a599[_0x3c43('0x59')]['id'],'path':_[_0x3c43('0xb6')](_0x36a599['body'][_0x3c43('0xb0')][0x0][_0x3c43('0x8')])?undefined:_0x36a599[_0x3c43('0x5c')][_0x3c43('0xb0')][0x0]['path'],'fax':_['isNil'](_0x36a599[_0x3c43('0x5c')]['to'][0x0])?undefined:_0x36a599[_0x3c43('0x5c')]['to'][0x0]},client9002);})[_0x3c43('0x3b')](function(){if(_0x4afb4f){if(_[_0x3c43('0xb6')](_0x36a599[_0x3c43('0x5c')][_0x3c43('0xb7')])){_0x36a599[_0x3c43('0x5c')][_0x3c43('0xb7')]=util[_0x3c43('0xb8')](_0x3c43('0xb9'),_0x4afb4f[_0x3c43('0x3e')],_0x4afb4f['fax']);}if(_0x4afb4f[_0x3c43('0xad')]){if(_0x4afb4f['List']['Contacts'][_0x3c43('0x72')]){return _0x4afb4f[_0x3c43('0xad')][_0x3c43('0xae')][0x0];}else{return db[_0x3c43('0x78')]['create'](_[_0x3c43('0x1b')](_0x36a599[_0x3c43('0x5c')],{'firstName':_0x36a599[_0x3c43('0x5c')]['to'][0x0],'phone':_0x36a599[_0x3c43('0x5c')]['to'][0x0],'fax':_0x36a599[_0x3c43('0x5c')]['to'][0x0],'ListId':_0x4afb4f['ListId']}));}}else{throw new Error(_0x3c43('0xba'));}}else{throw new Error(_0x3c43('0xbb'));}})['then'](function(_0x527bb7){if(_0x527bb7){return db[_0x3c43('0x75')][_0x3c43('0x5a')]({'where':{'ContactId':_0x527bb7['id'],'closed':![],'FaxAccountId':_0x4afb4f['id']}})[_0x3c43('0x3b')](function(_0x401c83){if(_0x401c83){return[_0x401c83,![]];}return db[_0x3c43('0x75')]['create']({'UserId':_0x36a599[_0x3c43('0x5d')]['id'],'ContactId':_0x527bb7['id'],'FaxAccountId':_0x4afb4f['id'],'fax':_0x36a599[_0x3c43('0x5c')]['to'][0x0],'firstMsgDirection':_0x3c43('0xbc'),'Messages':[_[_0x3c43('0x51')](_0x36a599['body'],{'read':![],'body':_0x36a599[_0x3c43('0x5c')][_0x3c43('0xb0')][0x0][_0x3c43('0xbd')],'FaxAccountId':_0x4afb4f['id'],'UserId':_0x36a599[_0x3c43('0x5d')]['id'],'ContactId':_0x527bb7['id'],'AttachmentId':_0x36a599['body'][_0x3c43('0xb0')][0x0]['id']})]},{'include':[{'model':db[_0x3c43('0xa8')],'as':_0x3c43('0xbe')}]})[_0x3c43('0x3b')](function(_0x14ae1b){return[_0x14ae1b,!![]];});});}else{throw new Error(_0x3c43('0xbf'));}})[_0x3c43('0xc0')](function(_0x5c06ab,_0x2fd1e0){if(_0x2fd1e0){return _0x5c06ab;}return db[_0x3c43('0xa8')][_0x3c43('0x5b')]({'direction':_0x3c43('0xbc'),'read':![],'body':_0x36a599[_0x3c43('0x5c')][_0x3c43('0xb0')][0x0][_0x3c43('0xbd')],'FaxAccountId':_0x4afb4f['id'],'FaxInteractionId':_0x5c06ab['id'],'UserId':_0x36a599['user']['id'],'ContactId':_0x5c06ab['ContactId'],'AttachmentId':_0x36a599[_0x3c43('0x5c')][_0x3c43('0xb0')][0x0]['id']})[_0x3c43('0x3b')](function(_0x54c179){_0x5c06ab['dataValues']['Messages']=[];_0x5c06ab[_0x3c43('0xc1')][_0x3c43('0xbe')][_0x3c43('0x92')](_0x54c179[_0x3c43('0xc1')]);return _0x5c06ab;});})['then'](function(_0x25bd2f){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_['isNil'](_0x36a599[_0x3c43('0x59')]['id'])?undefined:_0x36a599[_0x3c43('0x59')]['id'],'path':_['isNil'](_0x36a599[_0x3c43('0x5c')][_0x3c43('0xb0')][0x0][_0x3c43('0x8')])?undefined:_0x36a599[_0x3c43('0x5c')][_0x3c43('0xb0')][0x0][_0x3c43('0x8')],'fax':_[_0x3c43('0xb6')](_0x36a599[_0x3c43('0x5c')]['to'][0x0])?undefined:_0x36a599[_0x3c43('0x5c')]['to'][0x0],'AttachmentId':_0x36a599[_0x3c43('0x5c')][_0x3c43('0xb0')][0x0]['id']},client9002)[_0x3c43('0x3b')](function(_0x5201fd){logger['info'](_0x3c43('0xc2'),_0x5201fd);})[_0x3c43('0x2d')](function(_0x502a01){logger['info'](_0x3c43('0xc2'),_0x502a01);});return _0x25bd2f;})[_0x3c43('0x3b')](respondWithResult(_0x39c306,null))[_0x3c43('0x2d')](handleError(_0x39c306,null));};exports['addAgents']=function(_0x1cb380,_0x243d5a,_0x115455){return db[_0x3c43('0x41')][_0x3c43('0x5a')]({'where':{'id':_0x1cb380[_0x3c43('0x59')]['id']}})['then'](handleEntityNotFound(_0x243d5a,null))[_0x3c43('0x3b')](function(_0x1206a6){if(_0x1206a6){return _0x1206a6[_0x3c43('0xc3')](_0x1cb380[_0x3c43('0x5c')][_0x3c43('0x6e')],_[_0x3c43('0x76')](_0x1cb380[_0x3c43('0x5c')],[_0x3c43('0x6e'),'id'])||{})[_0x3c43('0xc0')](function(_0x4659ab){for(var _0x5f56f1=0x0;_0x5f56f1<_0x1cb380[_0x3c43('0x5c')][_0x3c43('0x6e')][_0x3c43('0x72')];_0x5f56f1+=0x1){socket[_0x3c43('0xc4')](_0x3c43('0xc5'),{'UserId':Number(_0x1cb380[_0x3c43('0x5c')][_0x3c43('0x6e')][_0x5f56f1]),'FaxAccountId':Number(_0x1cb380[_0x3c43('0x59')]['id'])});}return _0x4659ab;});}})[_0x3c43('0x3b')](respondWithResult(_0x243d5a,null))[_0x3c43('0x2d')](handleError(_0x243d5a,null));};exports['removeAgents']=function(_0x528820,_0x1fead8,_0x15ad19){return db[_0x3c43('0x41')][_0x3c43('0x5a')]({'where':{'id':_0x528820[_0x3c43('0x59')]['id']}})['then'](handleEntityNotFound(_0x1fead8,null))[_0x3c43('0x3b')](function(_0x375572){if(_0x375572){return _0x375572[_0x3c43('0xc6')](_0x528820[_0x3c43('0x48')]['ids'])[_0x3c43('0x3b')](function(){if(_['isArray'](_0x528820[_0x3c43('0x48')][_0x3c43('0x6e')])){for(var _0xa80470=0x0;_0xa80470<_0x528820[_0x3c43('0x48')][_0x3c43('0x6e')]['length'];_0xa80470+=0x1){socket[_0x3c43('0xc4')](_0x3c43('0xc7'),{'UserId':Number(_0x528820['query']['ids'][_0xa80470]),'FaxAccountId':Number(_0x528820[_0x3c43('0x59')]['id'])});}}else{socket['emit'](_0x3c43('0xc7'),{'UserId':Number(_0x528820[_0x3c43('0x48')][_0x3c43('0x6e')]),'FaxAccountId':Number(_0x528820['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1fead8,null))[_0x3c43('0x2d')](handleError(_0x1fead8,null));};exports['getAgents']=function(_0x1948ea,_0xaa6755,_0x224595){var _0x2ee0d6={};var _0x360bc9={};var _0x591e68;var _0x11ba4f;return db[_0x3c43('0x41')][_0x3c43('0x6a')]({'where':{'id':_0x1948ea[_0x3c43('0x59')]['id']}})[_0x3c43('0x3b')](handleEntityNotFound(_0xaa6755,null))[_0x3c43('0x3b')](function(_0x3d571c){if(_0x3d571c){_0x591e68=_0x3d571c;_0x360bc9['model']=_[_0x3c43('0x47')](db['User'][_0x3c43('0x42')]);_0x360bc9[_0x3c43('0x48')]=_['keys'](_0x1948ea[_0x3c43('0x48')]);_0x360bc9[_0x3c43('0x50')]=_[_0x3c43('0x49')](_0x360bc9[_0x3c43('0x46')],_0x360bc9[_0x3c43('0x48')]);_0x2ee0d6['attributes']=_[_0x3c43('0x49')](_0x360bc9[_0x3c43('0x46')],qs['fields'](_0x1948ea['query'][_0x3c43('0x4b')]));_0x2ee0d6[_0x3c43('0x4a')]=_0x2ee0d6[_0x3c43('0x4a')]['length']?_0x2ee0d6['attributes']:_0x360bc9[_0x3c43('0x46')];_0x2ee0d6[_0x3c43('0x4c')]=qs[_0x3c43('0x4d')](_0x1948ea[_0x3c43('0x48')][_0x3c43('0x4d')]);_0x2ee0d6['where']=qs[_0x3c43('0x50')](_['pick'](_0x1948ea['query'],_0x360bc9['filters']));if(_0x1948ea[_0x3c43('0x48')][_0x3c43('0x53')]){_0x2ee0d6[_0x3c43('0x4e')]=_[_0x3c43('0x51')](_0x2ee0d6[_0x3c43('0x4e')],{'$or':_['map'](_0x2ee0d6['attributes'],function(_0x78c65b){var _0x511d9f={};_0x511d9f[_0x78c65b]={'$like':'%'+_0x1948ea['query'][_0x3c43('0x53')]+'%'};return _0x511d9f;})});}_0x2ee0d6=_['merge']({},_0x2ee0d6,_0x1948ea['options']);return _0x591e68[_0x3c43('0xc8')](_0x2ee0d6);}})[_0x3c43('0x3b')](function(_0x3b8f15){if(_0x3b8f15){_0x11ba4f=_0x3b8f15['length'];if(!_0x1948ea[_0x3c43('0x48')]['hasOwnProperty'](_0x3c43('0x6c'))){_0x2ee0d6[_0x3c43('0x33')]=qs[_0x3c43('0x33')](_0x1948ea['query'][_0x3c43('0x33')]);_0x2ee0d6[_0x3c43('0x31')]=qs[_0x3c43('0x31')](_0x1948ea[_0x3c43('0x48')]['offset']);}return _0x591e68[_0x3c43('0xc8')](_0x2ee0d6);}})[_0x3c43('0x3b')](function(_0x3bf9f8){if(_0x3bf9f8){return _0x3bf9f8?{'count':_0x11ba4f,'rows':_0x3bf9f8}:null;}})[_0x3c43('0x3b')](respondWithResult(_0xaa6755,null))[_0x3c43('0x2d')](handleError(_0xaa6755,null));}; \ No newline at end of file +var _0xd04e=['from-voip-provider','app','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','bulkCreate','updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','format','CmList','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','info','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','FaxAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','map','FaxAccount','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','include','findAll','rows','params','mandatoryDispositionPause','keys','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','FaxAccountId','Disposition','getDispositions','findOne','options','removeDispositions','ids','addAnswer','CannedAnswer','filter','removeAnswers','FaxInteraction','addInteraction','omit','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','finally','getApplications','context'];(function(_0x1697e7,_0x544804){var _0x3172ec=function(_0x4b3695){while(--_0x4b3695){_0x1697e7['push'](_0x1697e7['shift']());}};_0x3172ec(++_0x544804);}(_0xd04e,0x100));var _0xed04=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xd04e[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed04('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed04('0x1'));var rp=require(_0xed04('0x2'));var moment=require(_0xed04('0x3'));var BPromise=require(_0xed04('0x4'));var Mustache=require(_0xed04('0x5'));var util=require('util');var path=require(_0xed04('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed04('0x7'));var _=require(_0xed04('0x8'));var squel=require(_0xed04('0x9'));var crypto=require('crypto');var jsforce=require(_0xed04('0xa'));var deskjs=require(_0xed04('0xb'));var toCsv=require(_0xed04('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xed04('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xed04('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed04('0xf'))(_0xed04('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xed04('0x11'));var db=require(_0xed04('0x12'))['db'];config['redis']=_[_0xed04('0x13')](config[_0xed04('0x14')],{'host':_0xed04('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed04('0x14')]));require(_0xed04('0x16'))[_0xed04('0x17')](socket);var jayson=require(_0xed04('0x18'));var client=jayson[_0xed04('0x19')][_0xed04('0x1a')]({'port':0x232c});var client9002=jayson[_0xed04('0x19')][_0xed04('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xcc6ac6,_0x1809c2,_0x26087f,_0x425d65){return new BPromise(function(_0x323200,_0x8a0dff){var _0x2abd2f=_0x425d65||client;return _0x2abd2f[_0xed04('0x1b')](_0xcc6ac6,_0x26087f)[_0xed04('0x1c')](function(_0x5356a3){logger['info'](_0xed04('0x1d'),_0x1809c2,'request\x20sent');logger['debug'](_0xed04('0x1e'),_0x1809c2,_0xed04('0x1f'),JSON[_0xed04('0x20')](_0x5356a3));if(_0x5356a3[_0xed04('0x21')]){if(_0x5356a3['error'][_0xed04('0x22')]===0x1f4){logger[_0xed04('0x21')](_0xed04('0x1d'),_0x1809c2,_0x5356a3[_0xed04('0x21')][_0xed04('0x23')]);return _0x8a0dff(_0x5356a3[_0xed04('0x21')]['message']);}logger[_0xed04('0x21')](_0xed04('0x1d'),_0x1809c2,_0x5356a3['error'][_0xed04('0x23')]);return _0x323200(_0x5356a3[_0xed04('0x21')][_0xed04('0x23')]);}else{logger['info'](_0xed04('0x1d'),_0x1809c2,_0xed04('0x1f'));_0x323200(_0x5356a3[_0xed04('0x24')][_0xed04('0x23')]);}})[_0xed04('0x25')](function(_0x5da742){logger[_0xed04('0x21')](_0xed04('0x1d'),_0x1809c2,_0x5da742);_0x8a0dff(_0x5da742);});});}function respondWithStatusCode(_0x2f8314,_0x40b307){_0x40b307=_0x40b307||0xcc;return function(_0x59dcee){if(_0x59dcee){return _0x2f8314[_0xed04('0x26')](_0x40b307);}return _0x2f8314[_0xed04('0x27')](_0x40b307)[_0xed04('0x28')]();};}function respondWithResult(_0xcda3f0,_0x406128){_0x406128=_0x406128||0xc8;return function(_0x285dc0){if(_0x285dc0){return _0xcda3f0[_0xed04('0x27')](_0x406128)[_0xed04('0x29')](_0x285dc0);}};}function respondWithFilteredResult(_0x3d2e7a,_0x5c1c80){return function(_0x7ad40d){if(_0x7ad40d){var _0x298271=typeof _0x5c1c80[_0xed04('0x2a')]===_0xed04('0x2b')&&typeof _0x5c1c80[_0xed04('0x2c')]===_0xed04('0x2b');var _0x123a8b=_0x7ad40d[_0xed04('0x2d')];var _0x53c79b=_0x298271?0x0:_0x5c1c80[_0xed04('0x2a')];var _0x14d192=_0x298271?_0x7ad40d[_0xed04('0x2d')]:_0x5c1c80['offset']+_0x5c1c80[_0xed04('0x2c')];var _0x44bc5e;if(_0x14d192>=_0x123a8b){_0x14d192=_0x123a8b;_0x44bc5e=0xc8;}else{_0x44bc5e=0xce;}_0x3d2e7a[_0xed04('0x27')](_0x44bc5e);return _0x3d2e7a[_0xed04('0x2e')](_0xed04('0x2f'),_0x53c79b+'-'+_0x14d192+'/'+_0x123a8b)[_0xed04('0x29')](_0x7ad40d);}return null;};}function patchUpdates(_0x2a77cc){return function(_0x338a94){try{jsonpatch[_0xed04('0x30')](_0x338a94,_0x2a77cc,!![]);}catch(_0x2bed0e){return BPromise[_0xed04('0x31')](_0x2bed0e);}return _0x338a94[_0xed04('0x32')]();};}function saveUpdates(_0x5a8c99,_0x4ac405){return function(_0x11fa1c){if(_0x11fa1c){return _0x11fa1c[_0xed04('0x33')](_0x5a8c99)[_0xed04('0x1c')](function(_0xd7024c){return _0xd7024c;});}return null;};}function removeEntity(_0x3a3f5c,_0x54960e){return function(_0x1bc417){if(_0x1bc417){return _0x1bc417['destroy']()[_0xed04('0x1c')](function(){var _0x43657f=_0x1bc417[_0xed04('0x34')]({'plain':!![]});var _0xd78b9d=_0xed04('0x35');return db[_0xed04('0x36')][_0xed04('0x37')]({'where':{'type':_0xd78b9d,'resourceId':_0x43657f['id']}})[_0xed04('0x1c')](function(){return _0x1bc417;});})[_0xed04('0x1c')](function(){_0x3a3f5c[_0xed04('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe809ce,_0x575f0c){return function(_0x4e50a9){if(!_0x4e50a9){_0xe809ce[_0xed04('0x26')](0x194);}return _0x4e50a9;};}function handleError(_0x5570a2,_0x16233d){_0x16233d=_0x16233d||0x1f4;return function(_0x5c3ea9){logger['error'](_0x5c3ea9[_0xed04('0x38')]);if(_0x5c3ea9[_0xed04('0x39')]){delete _0x5c3ea9[_0xed04('0x39')];}_0x5570a2[_0xed04('0x27')](_0x16233d)[_0xed04('0x3a')](_0x5c3ea9);};}exports[_0xed04('0x3b')]=function(_0xa45a20,_0x48bf40){var _0x174c3a={'include':[{'model':db[_0xed04('0x3c')],'as':'mandatoryDispositionPause'}]},_0x1960d2={},_0x331080={'count':0x0,'rows':[]};var _0x2fd792=_[_0xed04('0x3d')](db[_0xed04('0x3e')][_0xed04('0x3f')],function(_0x242b1d){return{'name':_0x242b1d['fieldName'],'type':_0x242b1d[_0xed04('0x40')][_0xed04('0x41')]};});_0x1960d2['model']=_[_0xed04('0x3d')](_0x2fd792,_0xed04('0x39'));_0x1960d2['query']=_['keys'](_0xa45a20[_0xed04('0x42')]);_0x1960d2[_0xed04('0x43')]=_[_0xed04('0x44')](_0x1960d2[_0xed04('0x45')],_0x1960d2['query']);_0x174c3a['attributes']=_[_0xed04('0x44')](_0x1960d2[_0xed04('0x45')],qs[_0xed04('0x46')](_0xa45a20[_0xed04('0x42')]['fields']));_0x174c3a[_0xed04('0x47')]=_0x174c3a[_0xed04('0x47')]['length']?_0x174c3a[_0xed04('0x47')]:_0x1960d2['model'];if(!_0xa45a20[_0xed04('0x42')][_0xed04('0x48')](_0xed04('0x49'))){_0x174c3a[_0xed04('0x2c')]=qs['limit'](_0xa45a20[_0xed04('0x42')][_0xed04('0x2c')]);_0x174c3a[_0xed04('0x2a')]=qs[_0xed04('0x2a')](_0xa45a20[_0xed04('0x42')]['offset']);}_0x174c3a[_0xed04('0x4a')]=qs[_0xed04('0x4b')](_0xa45a20['query'][_0xed04('0x4b')]);_0x174c3a[_0xed04('0x4c')]=qs[_0xed04('0x43')](_[_0xed04('0x4d')](_0xa45a20[_0xed04('0x42')],_0x1960d2[_0xed04('0x43')]),_0x2fd792);if(_0xa45a20[_0xed04('0x42')]['filter']){_0x174c3a['where']=_[_0xed04('0x4e')](_0x174c3a[_0xed04('0x4c')],{'$or':_[_0xed04('0x3d')](_0x2fd792,function(_0x384542){if(_0x384542['type']!==_0xed04('0x4f')){var _0x2d6fa7={};_0x2d6fa7[_0x384542[_0xed04('0x39')]]={'$like':'%'+_0xa45a20[_0xed04('0x42')]['filter']+'%'};return _0x2d6fa7;}})});}_0x174c3a=_[_0xed04('0x4e')]({},_0x174c3a,_0xa45a20['options']);var _0x5799ab={'where':_0x174c3a[_0xed04('0x4c')]};return db['FaxAccount'][_0xed04('0x2d')](_0x5799ab)[_0xed04('0x1c')](function(_0x5300ce){_0x331080[_0xed04('0x2d')]=_0x5300ce;if(_0xa45a20[_0xed04('0x42')]['includeAll']){_0x174c3a[_0xed04('0x50')]=[{'all':!![]}];}return db[_0xed04('0x3e')][_0xed04('0x51')](_0x174c3a);})['then'](function(_0x3d4ddd){_0x331080[_0xed04('0x52')]=_0x3d4ddd;return _0x331080;})[_0xed04('0x1c')](respondWithFilteredResult(_0x48bf40,_0x174c3a))[_0xed04('0x25')](handleError(_0x48bf40,null));};exports['show']=function(_0x5b343a,_0x8606bb){var _0x4f104f={'raw':![],'where':{'id':_0x5b343a[_0xed04('0x53')]['id']},'include':[{'model':db[_0xed04('0x3c')],'as':_0xed04('0x54')}]},_0x19effb={};_0x19effb[_0xed04('0x45')]=_[_0xed04('0x55')](db[_0xed04('0x3e')][_0xed04('0x3f')]);_0x19effb['query']=_[_0xed04('0x55')](_0x5b343a[_0xed04('0x42')]);_0x19effb[_0xed04('0x43')]=_[_0xed04('0x44')](_0x19effb[_0xed04('0x45')],_0x19effb['query']);_0x4f104f[_0xed04('0x47')]=_[_0xed04('0x44')](_0x19effb['model'],qs[_0xed04('0x46')](_0x5b343a[_0xed04('0x42')][_0xed04('0x46')]));_0x4f104f[_0xed04('0x47')]=_0x4f104f[_0xed04('0x47')][_0xed04('0x56')]?_0x4f104f[_0xed04('0x47')]:_0x19effb[_0xed04('0x45')];if(_0x5b343a[_0xed04('0x42')][_0xed04('0x57')]){_0x4f104f[_0xed04('0x50')]=[{'all':!![]}];}_0x4f104f=_['merge']({},_0x4f104f,_0x5b343a['options']);return db['FaxAccount'][_0xed04('0x58')](_0x4f104f)[_0xed04('0x1c')](handleEntityNotFound(_0x8606bb,null))[_0xed04('0x1c')](respondWithResult(_0x8606bb,null))[_0xed04('0x25')](handleError(_0x8606bb,null));};exports[_0xed04('0x59')]=function(_0x3b3436,_0xf46a53){return db[_0xed04('0x3e')]['create'](_0x3b3436[_0xed04('0x5a')],{})[_0xed04('0x1c')](function(_0x142fba){var _0x464936=_0x3b3436[_0xed04('0x5b')][_0xed04('0x34')]({'plain':!![]});if(!_0x464936)throw new Error(_0xed04('0x5c'));if(_0x464936['role']==='user'){var _0xa3e727=_0x142fba[_0xed04('0x34')]({'plain':!![]});var _0x29f87f='FaxAccounts';return db[_0xed04('0x5d')]['find']({'where':{'name':_0x29f87f,'userProfileId':_0x464936['userProfileId']},'raw':!![]})[_0xed04('0x1c')](function(_0x548fb3){if(_0x548fb3&&_0x548fb3[_0xed04('0x5e')]===0x0){return db[_0xed04('0x36')][_0xed04('0x59')]({'name':_0xa3e727[_0xed04('0x39')],'resourceId':_0xa3e727['id'],'type':_0x548fb3[_0xed04('0x39')],'sectionId':_0x548fb3['id']},{})[_0xed04('0x1c')](function(){return _0x142fba;});}else{return _0x142fba;}})[_0xed04('0x25')](function(_0x58f2f3){logger[_0xed04('0x21')](_0xed04('0x5f'),_0x58f2f3);throw _0x58f2f3;});}return _0x142fba;})['then'](respondWithResult(_0xf46a53,0xc9))[_0xed04('0x25')](handleError(_0xf46a53,null));};exports[_0xed04('0x33')]=function(_0xcf269d,_0x1b7d7d){if(_0xcf269d[_0xed04('0x5a')]['id']){delete _0xcf269d[_0xed04('0x5a')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0xcf269d['params']['id']},'include':[{'model':db[_0xed04('0x3c')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x1b7d7d,null))['then'](saveUpdates(_0xcf269d['body'],null))[_0xed04('0x1c')](respondWithResult(_0x1b7d7d,null))[_0xed04('0x25')](handleError(_0x1b7d7d,null));};exports[_0xed04('0x37')]=function(_0x116666,_0x198eee){return db['FaxAccount']['find']({'where':{'id':_0x116666[_0xed04('0x53')]['id']}})[_0xed04('0x1c')](handleEntityNotFound(_0x198eee,null))[_0xed04('0x1c')](removeEntity(_0x198eee,null))['catch'](handleError(_0x198eee,null));};exports['describe']=function(_0x48f545,_0x57e7b8){return db[_0xed04('0x3e')][_0xed04('0x60')]()[_0xed04('0x1c')](respondWithResult(_0x57e7b8,null))[_0xed04('0x25')](handleError(_0x57e7b8,null));};exports['addDisposition']=function(_0x273f94,_0x262e9e,_0x2583a5){if(_0x273f94[_0xed04('0x5a')]['id']){delete _0x273f94[_0xed04('0x5a')]['id'];}return db[_0xed04('0x3e')][_0xed04('0x58')]({'where':{'id':_0x273f94[_0xed04('0x53')]['id']}})[_0xed04('0x1c')](handleEntityNotFound(_0x262e9e,null))[_0xed04('0x1c')](function(_0x4122bf){if(_0x4122bf){_0x273f94[_0xed04('0x5a')][_0xed04('0x61')]=_0x4122bf['id'];return db[_0xed04('0x62')][_0xed04('0x59')](_0x273f94[_0xed04('0x5a')]);}})['then'](respondWithResult(_0x262e9e,null))[_0xed04('0x25')](handleError(_0x262e9e,null));};exports[_0xed04('0x63')]=function(_0x16e958,_0x20e4a9,_0x20c590){var _0x47fa7d={'raw':![],'where':{}};var _0x4a10d0={};var _0x28cd7b={'count':0x0,'rows':[]};return db[_0xed04('0x3e')][_0xed04('0x64')]({'where':{'id':_0x16e958['params']['id']}})[_0xed04('0x1c')](handleEntityNotFound(_0x20e4a9,null))[_0xed04('0x1c')](function(_0x412795){if(_0x412795){_0x4a10d0['model']=_[_0xed04('0x55')](db['Disposition'][_0xed04('0x3f')]);_0x4a10d0[_0xed04('0x42')]=_[_0xed04('0x55')](_0x16e958['query']);_0x4a10d0[_0xed04('0x43')]=_[_0xed04('0x44')](_0x4a10d0[_0xed04('0x45')],_0x4a10d0[_0xed04('0x42')]);_0x47fa7d[_0xed04('0x47')]=_['intersection'](_0x4a10d0[_0xed04('0x45')],qs[_0xed04('0x46')](_0x16e958[_0xed04('0x42')][_0xed04('0x46')]));_0x47fa7d['attributes']=_0x47fa7d['attributes'][_0xed04('0x56')]?_0x47fa7d[_0xed04('0x47')]:_0x4a10d0[_0xed04('0x45')];if(!_0x16e958[_0xed04('0x42')][_0xed04('0x48')]('nolimit')){_0x47fa7d['limit']=qs[_0xed04('0x2c')](_0x16e958[_0xed04('0x42')][_0xed04('0x2c')]);_0x47fa7d[_0xed04('0x2a')]=qs[_0xed04('0x2a')](_0x16e958[_0xed04('0x42')][_0xed04('0x2a')]);}_0x47fa7d['order']=qs[_0xed04('0x4b')](_0x16e958[_0xed04('0x42')][_0xed04('0x4b')]);_0x47fa7d[_0xed04('0x4c')]=qs['filters'](_['pick'](_0x16e958[_0xed04('0x42')],_0x4a10d0[_0xed04('0x43')]));_0x47fa7d['where']['FaxAccountId']=_0x412795['id'];if(_0x16e958[_0xed04('0x42')]['filter']){_0x47fa7d['where']=_[_0xed04('0x4e')](_0x47fa7d[_0xed04('0x4c')],{'$or':_[_0xed04('0x3d')](_0x47fa7d['attributes'],function(_0xcecadf){var _0x4523df={};_0x4523df[_0xcecadf]={'$like':'%'+_0x16e958[_0xed04('0x42')]['filter']+'%'};return _0x4523df;})});}_0x47fa7d=_[_0xed04('0x4e')]({},_0x47fa7d,_0x16e958[_0xed04('0x65')]);return db[_0xed04('0x62')]['count']({'where':_0x47fa7d[_0xed04('0x4c')]})[_0xed04('0x1c')](function(_0x542a4f){_0x28cd7b[_0xed04('0x2d')]=_0x542a4f;if(_0x16e958[_0xed04('0x42')][_0xed04('0x57')]){_0x47fa7d[_0xed04('0x50')]=[{'all':!![]}];}return db['Disposition'][_0xed04('0x51')](_0x47fa7d);})[_0xed04('0x1c')](function(_0x53661b){_0x28cd7b[_0xed04('0x52')]=_0x53661b;return _0x28cd7b;});}})[_0xed04('0x1c')](respondWithFilteredResult(_0x20e4a9,_0x47fa7d))[_0xed04('0x25')](handleError(_0x20e4a9,null));};exports['removeDispositions']=function(_0x28a0cc,_0x345e8e,_0x4a0669){return db[_0xed04('0x3e')]['find']({'where':{'id':_0x28a0cc[_0xed04('0x53')]['id']}})[_0xed04('0x1c')](handleEntityNotFound(_0x345e8e,null))['then'](function(_0x4dab5e){if(_0x4dab5e){return _0x4dab5e[_0xed04('0x66')](_0x28a0cc[_0xed04('0x42')][_0xed04('0x67')]);}})[_0xed04('0x1c')](respondWithStatusCode(_0x345e8e,null))[_0xed04('0x25')](handleError(_0x345e8e,null));};exports[_0xed04('0x68')]=function(_0x2883db,_0x175014,_0x420af4){if(_0x2883db['body']['id']){delete _0x2883db[_0xed04('0x5a')]['id'];}return db[_0xed04('0x3e')][_0xed04('0x58')]({'where':{'id':_0x2883db[_0xed04('0x53')]['id']}})[_0xed04('0x1c')](handleEntityNotFound(_0x175014,null))[_0xed04('0x1c')](function(_0x328a46){if(_0x328a46){_0x2883db[_0xed04('0x5a')][_0xed04('0x61')]=_0x328a46['id'];return db['CannedAnswer'][_0xed04('0x59')](_0x2883db[_0xed04('0x5a')]);}})[_0xed04('0x1c')](respondWithResult(_0x175014,null))[_0xed04('0x25')](handleError(_0x175014,null));};exports['getAnswers']=function(_0x130235,_0x1274f4,_0x2efb8e){var _0x544e20={'raw':![],'where':{}};var _0xe61069={};var _0x33b959={'count':0x0,'rows':[]};return db[_0xed04('0x3e')]['findOne']({'where':{'id':_0x130235['params']['id']}})[_0xed04('0x1c')](handleEntityNotFound(_0x1274f4,null))[_0xed04('0x1c')](function(_0x495604){if(_0x495604){_0xe61069[_0xed04('0x45')]=_[_0xed04('0x55')](db[_0xed04('0x69')][_0xed04('0x3f')]);_0xe61069[_0xed04('0x42')]=_['keys'](_0x130235['query']);_0xe61069[_0xed04('0x43')]=_[_0xed04('0x44')](_0xe61069[_0xed04('0x45')],_0xe61069[_0xed04('0x42')]);_0x544e20['attributes']=_[_0xed04('0x44')](_0xe61069[_0xed04('0x45')],qs[_0xed04('0x46')](_0x130235[_0xed04('0x42')][_0xed04('0x46')]));_0x544e20['attributes']=_0x544e20[_0xed04('0x47')][_0xed04('0x56')]?_0x544e20[_0xed04('0x47')]:_0xe61069[_0xed04('0x45')];if(!_0x130235[_0xed04('0x42')][_0xed04('0x48')](_0xed04('0x49'))){_0x544e20[_0xed04('0x2c')]=qs[_0xed04('0x2c')](_0x130235['query'][_0xed04('0x2c')]);_0x544e20[_0xed04('0x2a')]=qs[_0xed04('0x2a')](_0x130235['query'][_0xed04('0x2a')]);}_0x544e20[_0xed04('0x4a')]=qs[_0xed04('0x4b')](_0x130235[_0xed04('0x42')][_0xed04('0x4b')]);_0x544e20[_0xed04('0x4c')]=qs[_0xed04('0x43')](_[_0xed04('0x4d')](_0x130235['query'],_0xe61069[_0xed04('0x43')]));_0x544e20[_0xed04('0x4c')][_0xed04('0x61')]=_0x495604['id'];if(_0x130235[_0xed04('0x42')]['filter']){_0x544e20[_0xed04('0x4c')]=_[_0xed04('0x4e')](_0x544e20['where'],{'$or':_[_0xed04('0x3d')](_0x544e20[_0xed04('0x47')],function(_0x5668bb){var _0x44a775={};_0x44a775[_0x5668bb]={'$like':'%'+_0x130235[_0xed04('0x42')][_0xed04('0x6a')]+'%'};return _0x44a775;})});}_0x544e20=_[_0xed04('0x4e')]({},_0x544e20,_0x130235[_0xed04('0x65')]);return db[_0xed04('0x69')][_0xed04('0x2d')]({'where':_0x544e20['where']})[_0xed04('0x1c')](function(_0x28dfa7){_0x33b959[_0xed04('0x2d')]=_0x28dfa7;if(_0x130235[_0xed04('0x42')][_0xed04('0x57')]){_0x544e20[_0xed04('0x50')]=[{'all':!![]}];}return db['CannedAnswer'][_0xed04('0x51')](_0x544e20);})['then'](function(_0xc6dcf){_0x33b959[_0xed04('0x52')]=_0xc6dcf;return _0x33b959;});}})['then'](respondWithFilteredResult(_0x1274f4,_0x544e20))[_0xed04('0x25')](handleError(_0x1274f4,null));};exports[_0xed04('0x6b')]=function(_0x55e7d6,_0x3d7cc3,_0xd5c250){return db[_0xed04('0x3e')]['find']({'where':{'id':_0x55e7d6[_0xed04('0x53')]['id']}})[_0xed04('0x1c')](handleEntityNotFound(_0x3d7cc3,null))[_0xed04('0x1c')](function(_0x306a23){if(_0x306a23){return _0x306a23[_0xed04('0x6b')](_0x55e7d6[_0xed04('0x42')][_0xed04('0x67')]);}})['then'](respondWithStatusCode(_0x3d7cc3,null))[_0xed04('0x25')](handleError(_0x3d7cc3,null));};exports['addInteraction']=function(_0x1ab38a,_0x5f6494,_0x29cce4){return db[_0xed04('0x6c')][_0xed04('0x58')]({'where':{'id':_0x1ab38a[_0xed04('0x53')]['id']}})[_0xed04('0x1c')](handleEntityNotFound(_0x5f6494,null))[_0xed04('0x1c')](function(_0x2c1c3b){if(_0x2c1c3b){return _0x2c1c3b[_0xed04('0x6d')](_0x1ab38a[_0xed04('0x5a')]['ids'],_[_0xed04('0x6e')](_0x1ab38a[_0xed04('0x5a')],[_0xed04('0x67'),'id'])||{});}})['then'](respondWithResult(_0x5f6494,null))[_0xed04('0x25')](handleError(_0x5f6494,null));};exports['getInteractions']=function(_0x1ba49a,_0x1fd563,_0x520dfa){var _0x35fd57={'raw':![],'where':{}};var _0x466aa9={};var _0x59e2ef={'count':0x0,'rows':[]};return db['FaxAccount'][_0xed04('0x64')]({'where':{'id':_0x1ba49a[_0xed04('0x53')]['id']}})[_0xed04('0x1c')](handleEntityNotFound(_0x1fd563,null))['then'](function(_0x151052){if(_0x151052){_0x466aa9[_0xed04('0x45')]=_[_0xed04('0x55')](db[_0xed04('0x6c')][_0xed04('0x3f')]);_0x466aa9[_0xed04('0x42')]=_[_0xed04('0x55')](_0x1ba49a[_0xed04('0x42')]);_0x466aa9[_0xed04('0x43')]=_[_0xed04('0x44')](_0x466aa9[_0xed04('0x45')],_0x466aa9[_0xed04('0x42')]);_0x35fd57[_0xed04('0x47')]=_[_0xed04('0x44')](_0x466aa9[_0xed04('0x45')],qs[_0xed04('0x46')](_0x1ba49a[_0xed04('0x42')][_0xed04('0x46')]));_0x35fd57[_0xed04('0x47')]=_0x35fd57[_0xed04('0x47')][_0xed04('0x56')]?_0x35fd57[_0xed04('0x47')]:_0x466aa9[_0xed04('0x45')];if(!_0x1ba49a[_0xed04('0x42')][_0xed04('0x48')]('nolimit')){_0x35fd57[_0xed04('0x2c')]=qs[_0xed04('0x2c')](_0x1ba49a[_0xed04('0x42')][_0xed04('0x2c')]);_0x35fd57[_0xed04('0x2a')]=qs[_0xed04('0x2a')](_0x1ba49a[_0xed04('0x42')][_0xed04('0x2a')]);}_0x35fd57[_0xed04('0x4a')]=qs[_0xed04('0x4b')](_0x1ba49a[_0xed04('0x42')]['sort']);_0x35fd57[_0xed04('0x4c')]=qs['filters'](_[_0xed04('0x4d')](_0x1ba49a['query'],_0x466aa9[_0xed04('0x43')]));_0x35fd57[_0xed04('0x4c')][_0xed04('0x61')]=_0x151052['id'];if(_0x1ba49a[_0xed04('0x42')][_0xed04('0x6a')]){_0x35fd57[_0xed04('0x4c')]=_[_0xed04('0x4e')](_0x35fd57[_0xed04('0x4c')],{'$or':_[_0xed04('0x3d')](_0x35fd57['attributes'],function(_0x3ebf7f){var _0x6fcdc={};_0x6fcdc[_0x3ebf7f]={'$like':'%'+_0x1ba49a[_0xed04('0x42')]['filter']+'%'};return _0x6fcdc;})});}_0x35fd57=_[_0xed04('0x4e')]({},_0x35fd57,_0x1ba49a[_0xed04('0x65')]);return db[_0xed04('0x6c')][_0xed04('0x2d')]({'where':_0x35fd57[_0xed04('0x4c')]})[_0xed04('0x1c')](function(_0x467b9b){_0x59e2ef[_0xed04('0x2d')]=_0x467b9b;if(_0x1ba49a['query'][_0xed04('0x57')]){_0x35fd57[_0xed04('0x50')]=[{'model':db[_0xed04('0x6f')],'as':_0xed04('0x70'),'required':![]},{'model':db[_0xed04('0x71')],'as':_0xed04('0x72'),'attributes':[_0xed04('0x39'),_0xed04('0x73'),_0xed04('0x74')],'required':![]},{'model':db[_0xed04('0x75')],'as':_0xed04('0x76'),'attributes':['id',_0xed04('0x39'),'color'],'where':_0x1ba49a['query'][_0xed04('0x77')]?{'id':_0x1ba49a[_0xed04('0x42')][_0xed04('0x77')]}:undefined,'required':_0x1ba49a[_0xed04('0x42')]['tag']?!![]:![]}];}return db[_0xed04('0x6c')][_0xed04('0x51')](_0x35fd57);})[_0xed04('0x1c')](function(_0x270ed7){_0x59e2ef[_0xed04('0x52')]=_0x270ed7;return _0x59e2ef;});}})[_0xed04('0x1c')](respondWithFilteredResult(_0x1fd563,_0x35fd57))['catch'](handleError(_0x1fd563,null));};exports[_0xed04('0x78')]=function(_0x2b9676,_0x3a30f3){var _0x102e4e=_0x2b9676['params']['id'];var _0x1dd3f2=_0x2b9676[_0xed04('0x5a')];var _0x2981da=0xc8;var _0x57e9c4=null;return db[_0xed04('0x79')][_0xed04('0x7a')]({'isolationLevel':db[_0xed04('0x79')][_0xed04('0x7b')][_0xed04('0x7c')][_0xed04('0x7d')]},function(_0x4a6e3b){return db[_0xed04('0x3e')][_0xed04('0x64')]({'where':{'id':_0x102e4e},'transaction':_0x4a6e3b})[_0xed04('0x1c')](function(_0x2b4696){if(_0x2b4696){return db['FaxApplication'][_0xed04('0x37')]({'where':{'FaxAccountId':_0x102e4e},'transaction':_0x4a6e3b})[_0xed04('0x1c')](function(){var _0x29cdab=_[_0xed04('0x3d')](_0x1dd3f2,function(_0x138eb2){_0x138eb2[_0xed04('0x61')]=_0x102e4e;return _0x138eb2;});return db[_0xed04('0x7e')]['bulkCreate'](_0x29cdab,{'transaction':_0x4a6e3b});});}else{_0x2981da=0x194;_0x57e9c4=[];}});})[_0xed04('0x1c')](function(){if(_0x2981da!==0x194){return db['FaxApplication'][_0xed04('0x7f')]({'where':{'FaxAccountId':_0x102e4e},'order':_0xed04('0x80')})[_0xed04('0x1c')](function(_0x401469){_0x57e9c4=_0x401469;});}})[_0xed04('0x25')](function(_0x193c00){_0x2981da=0x1f4;logger['error'](_0x193c00[_0xed04('0x38')]);if(_0x193c00[_0xed04('0x39')]){delete _0x193c00['name'];}_0x57e9c4=_0x193c00;})[_0xed04('0x81')](function(){if(_0x57e9c4===null){_0x3a30f3['sendStatus'](_0x2981da);}else{if(_0x2981da===0x1f4){_0x3a30f3[_0xed04('0x27')](_0x2981da)[_0xed04('0x3a')](_0x57e9c4);}else{_0x3a30f3['status'](_0x2981da)[_0xed04('0x29')](_0x57e9c4);}}});};exports['getApplications']=function(_0x2767ad,_0x1e0810,_0x42043a){var _0xc12596={};var _0x1d4d01={};var _0x23ebde;var _0x1a2324;return db[_0xed04('0x3e')][_0xed04('0x64')]({'where':{'id':_0x2767ad[_0xed04('0x53')]['id']}})[_0xed04('0x1c')](handleEntityNotFound(_0x1e0810,null))['then'](function(_0x1c504d){if(_0x1c504d){_0x23ebde=_0x1c504d;_0x1d4d01['model']=_['keys'](db[_0xed04('0x7e')][_0xed04('0x3f')]);_0x1d4d01[_0xed04('0x42')]=_[_0xed04('0x55')](_0x2767ad[_0xed04('0x42')]);_0x1d4d01[_0xed04('0x43')]=_[_0xed04('0x44')](_0x1d4d01[_0xed04('0x45')],_0x1d4d01[_0xed04('0x42')]);_0xc12596[_0xed04('0x47')]=_['intersection'](_0x1d4d01[_0xed04('0x45')],qs[_0xed04('0x46')](_0x2767ad[_0xed04('0x42')][_0xed04('0x46')]));_0xc12596['attributes']=_0xc12596[_0xed04('0x47')][_0xed04('0x56')]?_0xc12596[_0xed04('0x47')]:_0x1d4d01[_0xed04('0x45')];_0xc12596['order']=qs[_0xed04('0x4b')](_0x2767ad[_0xed04('0x42')][_0xed04('0x4b')]);_0xc12596[_0xed04('0x4c')]=qs[_0xed04('0x43')](_[_0xed04('0x4d')](_0x2767ad[_0xed04('0x42')],_0x1d4d01[_0xed04('0x43')]));if(_0x2767ad[_0xed04('0x42')][_0xed04('0x6a')]){_0xc12596[_0xed04('0x4c')]=_[_0xed04('0x4e')](_0xc12596['where'],{'$or':_[_0xed04('0x3d')](_0xc12596[_0xed04('0x47')],function(_0x129391){var _0x17b763={};_0x17b763[_0x129391]={'$like':'%'+_0x2767ad[_0xed04('0x42')][_0xed04('0x6a')]+'%'};return _0x17b763;})});}_0xc12596=_[_0xed04('0x4e')]({},_0xc12596,_0x2767ad[_0xed04('0x65')]);return _0x23ebde[_0xed04('0x82')](_0xc12596);}})[_0xed04('0x1c')](function(_0x38333f){if(_0x38333f){_0x1a2324=_0x38333f[_0xed04('0x56')];if(!_0x2767ad[_0xed04('0x42')][_0xed04('0x48')](_0xed04('0x49'))){_0xc12596[_0xed04('0x2c')]=qs[_0xed04('0x2c')](_0x2767ad[_0xed04('0x42')][_0xed04('0x2c')]);_0xc12596[_0xed04('0x2a')]=qs[_0xed04('0x2a')](_0x2767ad['query'][_0xed04('0x2a')]);}return _0x23ebde[_0xed04('0x82')](_0xc12596);}})[_0xed04('0x1c')](function(_0x19c866){if(_0x19c866){return _0x19c866?{'count':_0x1a2324,'rows':_0x19c866}:null;}})[_0xed04('0x1c')](respondWithResult(_0x1e0810,null))[_0xed04('0x25')](handleError(_0x1e0810,null));};function Extension(_0x509cba,_0x3c8760,_0x355078,_0x8f1fc8){this[_0xed04('0x83')]=_0xed04('0x84');this['exten']=_0x509cba['localstationid'];this[_0xed04('0x85')]=_0x8f1fc8;this[_0xed04('0x40')]='system';this[_0xed04('0x86')]=_0xed04('0x87');this[_0xed04('0x61')]=_0x509cba['id'];this[_0xed04('0x80')]=_0x3c8760;this['appdata']=_0x355078;}function createExtensionsReciveFax(_0x17a534){var _0x288d58=0x1;var _0x3f7a2d=[];_0x3f7a2d[_0xed04('0x88')](new Extension(_0x17a534,_0x288d58,'',_0xed04('0x89')));_0x288d58+=0x1;_0x3f7a2d[_0xed04('0x88')](new Extension(_0x17a534,_0x288d58,_0xed04('0x8a'),_0xed04('0x8b')));_0x288d58+=0x1;for(var _0x6c5a68 in _0x17a534){if(_0x17a534[_0xed04('0x48')](_0x6c5a68)&&(_0x6c5a68===_0xed04('0x8c')||_0x6c5a68===_0xed04('0x8d')||_0x6c5a68===_0xed04('0x8e')||_0x6c5a68==='faxdetect'||_0x6c5a68===_0xed04('0x8f')||_0x6c5a68===_0xed04('0x90')||_0x6c5a68===_0xed04('0x91')||_0x6c5a68==='modem'||_0x6c5a68===_0xed04('0x92'))){_0x3f7a2d[_0xed04('0x88')](new Extension(_0x17a534,_0x288d58,_0xed04('0x93')+_0x6c5a68+')='+_0x17a534[_0x6c5a68],'Set'));_0x288d58+=0x1;}}_0x3f7a2d['push'](new Extension(_0x17a534,_0x288d58,'6',_0xed04('0x94')));_0x288d58+=0x1;_0x3f7a2d[_0xed04('0x88')](new Extension(_0x17a534,_0x288d58,_0xed04('0x95'),'ReceiveFax'));_0x288d58=0x0;return _0x3f7a2d;}exports[_0xed04('0x96')]=function(_0x5a1e33,_0x805a90,_0x27a6d1){var _0x51ca3e;return db['sequelize'][_0xed04('0x7a')](function(_0x362ca1){return db['FaxAccount'][_0xed04('0x59')](_0x5a1e33['body'],{'transaction':_0x362ca1})[_0xed04('0x1c')](function(_0x4c010e){_0x51ca3e=_0x4c010e['get']({'plain':!![]});return db['VoiceExtension'][_0xed04('0x97')](createExtensionsReciveFax(_0x51ca3e),{'transaction':_0x362ca1});});})[_0xed04('0x1c')](function(){return _0x51ca3e;})[_0xed04('0x1c')](respondWithResult(_0x805a90,null))[_0xed04('0x25')](handleError(_0x805a90,null));};exports[_0xed04('0x98')]=function(_0x1d849d,_0x3974b7,_0x30cc74){var _0x38e598;return db[_0xed04('0x79')]['transaction'](function(_0x5763e3){return db[_0xed04('0x3e')][_0xed04('0x33')](_0x1d849d[_0xed04('0x5a')],{'where':{'id':_0x1d849d[_0xed04('0x5a')]['id']},'transaction':_0x5763e3})[_0xed04('0x1c')](function(_0x3e0a09){return db['VoiceExtension'][_0xed04('0x37')]({'where':{'FaxAccountId':_0x1d849d['body']['id']},'transaction':_0x5763e3})['then'](function(_0x4e6996){return db[_0xed04('0x99')][_0xed04('0x97')](createExtensionsReciveFax(_[_0xed04('0x6e')](_0x1d849d['body'],[_0xed04('0x9a'),_0xed04('0x41'),_0xed04('0x9b'),_0xed04('0x9c'),_0xed04('0x9d'),_0xed04('0x9e')])),{'transaction':_0x5763e3});});});})['then'](function(){return db[_0xed04('0x3e')][_0xed04('0x9f')](_0x1d849d[_0xed04('0x5a')]['id']);})[_0xed04('0x1c')](respondWithResult(_0x3974b7,null))[_0xed04('0x25')](handleError(_0x3974b7,null));};exports[_0xed04('0xa0')]=function(_0x360fb6,_0x1b981b,_0x5eaaf6){var _0x4b5fa9={'raw':!![],'where':{}};var _0x4342b9={};var _0x427db9={'count':0x0,'rows':[]};return db['FaxAccount'][_0xed04('0x64')]({'where':{'id':_0x360fb6[_0xed04('0x53')]['id']}})['then'](handleEntityNotFound(_0x1b981b,null))[_0xed04('0x1c')](function(_0x34d535){if(_0x34d535){_0x4342b9['model']=_[_0xed04('0x55')](db[_0xed04('0xa1')]['rawAttributes']);_0x4342b9[_0xed04('0x42')]=_['keys'](_0x360fb6[_0xed04('0x42')]);_0x4342b9[_0xed04('0x43')]=_[_0xed04('0x44')](_0x4342b9[_0xed04('0x45')],_0x4342b9[_0xed04('0x42')]);_0x4b5fa9[_0xed04('0x47')]=_['intersection'](_0x4342b9[_0xed04('0x45')],qs[_0xed04('0x46')](_0x360fb6[_0xed04('0x42')][_0xed04('0x46')]));_0x4b5fa9[_0xed04('0x47')]=_0x4b5fa9['attributes']['length']?_0x4b5fa9[_0xed04('0x47')]:_0x4342b9[_0xed04('0x45')];if(!_0x360fb6['query'][_0xed04('0x48')]('nolimit')){_0x4b5fa9['limit']=qs[_0xed04('0x2c')](_0x360fb6[_0xed04('0x42')][_0xed04('0x2c')]);_0x4b5fa9['offset']=qs[_0xed04('0x2a')](_0x360fb6[_0xed04('0x42')][_0xed04('0x2a')]);}_0x4b5fa9[_0xed04('0x4a')]=qs[_0xed04('0x4b')](_0x360fb6[_0xed04('0x42')][_0xed04('0x4b')]);_0x4b5fa9['where']=qs['filters'](_[_0xed04('0x4d')](_0x360fb6[_0xed04('0x42')],_0x4342b9[_0xed04('0x43')]));_0x4b5fa9[_0xed04('0x4c')]['FaxAccountId']=_0x34d535['id'];if(_0x360fb6[_0xed04('0x42')][_0xed04('0x6a')]){_0x4b5fa9[_0xed04('0x4c')]=_['merge'](_0x4b5fa9[_0xed04('0x4c')],{'$or':_[_0xed04('0x3d')](_0x4b5fa9[_0xed04('0x47')],function(_0x4c3dc2){var _0x5925ad={};_0x5925ad[_0x4c3dc2]={'$like':'%'+_0x360fb6['query'][_0xed04('0x6a')]+'%'};return _0x5925ad;})});}if(_0x360fb6[_0xed04('0x42')][_0xed04('0xa2')]){var _0x75f434=_0x360fb6['query'][_0xed04('0xa2')]['split'](',');var _0x4a85be={};_0x4a85be[_0x75f434[0x0]]={'$gte':moment(_0x75f434[0x1])[_0xed04('0xa3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4b5fa9[_0xed04('0x4c')]=_[_0xed04('0x4e')](_0x4b5fa9[_0xed04('0x4c')],_0x4a85be);}_0x4b5fa9=_[_0xed04('0x4e')]({},_0x4b5fa9,_0x360fb6[_0xed04('0x65')]);return db[_0xed04('0xa1')][_0xed04('0x2d')]({'where':_0x4b5fa9[_0xed04('0x4c')]})[_0xed04('0x1c')](function(_0x2cbdbe){_0x427db9[_0xed04('0x2d')]=_0x2cbdbe;if(_0x360fb6[_0xed04('0x42')][_0xed04('0x57')]){_0x4b5fa9[_0xed04('0x50')]=[{'all':!![]}];}return db[_0xed04('0xa1')]['findAll'](_0x4b5fa9);})[_0xed04('0x1c')](function(_0x4eec8f){_0x427db9[_0xed04('0x52')]=_0x4eec8f;return _0x427db9;});}})['then'](respondWithFilteredResult(_0x1b981b,_0x4b5fa9))['catch'](handleError(_0x1b981b,null));};exports[_0xed04('0x3a')]=function(_0x152fb6,_0xe22d49,_0x2c682c){var _0x5ece1f,_0x35d436={},_0x14cd0d;if(_0x152fb6[_0xed04('0x5a')]['to']){_0x14cd0d=_0x152fb6[_0xed04('0x5a')]['to'][0x0];}return db[_0xed04('0x3e')]['find']({'where':{'id':_0x152fb6[_0xed04('0x53')]['id']},'include':[{'model':db[_0xed04('0xa4')],'as':'List','include':[{'model':db[_0xed04('0x6f')],'as':_0xed04('0xa5'),'where':{'fax':_0x14cd0d},'limit':0x1,'order':[[_0xed04('0x9c'),_0xed04('0xa6')]]}]}]})[_0xed04('0x1c')](handleEntityNotFound(_0xe22d49,null))['then'](function(_0x5c790c){_0x5ece1f=_0x5c790c;if(_0x152fb6[_0xed04('0x5a')][_0xed04('0xa7')]&&_0x152fb6['body']['attachments'][_0xed04('0x56')]){for(var _0x50acb7=0x0;_0x50acb7<_0x152fb6['body'][_0xed04('0xa7')][_0xed04('0x56')];_0x50acb7+=0x1){_0x152fb6[_0xed04('0x5a')][_0xed04('0xa7')][_0x50acb7]={'filename':_0x152fb6['body'][_0xed04('0xa7')][_0x50acb7][_0xed04('0x39')],'id':_0x152fb6[_0xed04('0x5a')][_0xed04('0xa7')][_0x50acb7]['id'],'path':path[_0xed04('0xa8')](config[_0xed04('0xa9')],_0xed04('0xaa'),_0x152fb6[_0xed04('0x5a')][_0xed04('0xa7')][_0x50acb7][_0xed04('0xab')])};}}return respondWithRpcPromise(_0xed04('0xac'),_0xed04('0xac'),{'FaxAccountId':_[_0xed04('0xad')](_0x152fb6[_0xed04('0x53')]['id'])?undefined:_0x152fb6[_0xed04('0x53')]['id'],'path':_[_0xed04('0xad')](_0x152fb6[_0xed04('0x5a')][_0xed04('0xa7')][0x0]['path'])?undefined:_0x152fb6[_0xed04('0x5a')][_0xed04('0xa7')][0x0][_0xed04('0x6')],'fax':_[_0xed04('0xad')](_0x152fb6[_0xed04('0x5a')]['to'][0x0])?undefined:_0x152fb6[_0xed04('0x5a')]['to'][0x0]},client9002);})[_0xed04('0x1c')](function(){if(_0x5ece1f){if(_['isNil'](_0x152fb6[_0xed04('0x5a')][_0xed04('0xae')])){_0x152fb6[_0xed04('0x5a')]['from']=util[_0xed04('0xa3')](_0xed04('0xaf'),_0x5ece1f[_0xed04('0x39')],_0x5ece1f['fax']);}if(_0x5ece1f[_0xed04('0xb0')]){if(_0x5ece1f[_0xed04('0xb0')]['Contacts']['length']){return _0x5ece1f['List'][_0xed04('0xa5')][0x0];}else{return db['CmContact']['create'](_[_0xed04('0x13')](_0x152fb6[_0xed04('0x5a')],{'firstName':_0x152fb6[_0xed04('0x5a')]['to'][0x0],'phone':_0x152fb6[_0xed04('0x5a')]['to'][0x0],'fax':_0x152fb6['body']['to'][0x0],'ListId':_0x5ece1f['ListId']}));}}else{throw new Error(_0xed04('0xb1'));}}else{throw new Error(_0xed04('0xb2'));}})[_0xed04('0x1c')](function(_0x3b9127){if(_0x3b9127){return db[_0xed04('0x6c')]['find']({'where':{'ContactId':_0x3b9127['id'],'closed':![],'FaxAccountId':_0x5ece1f['id']}})[_0xed04('0x1c')](function(_0x5684aa){if(_0x5684aa){return[_0x5684aa,![]];}return db[_0xed04('0x6c')][_0xed04('0x59')]({'UserId':_0x152fb6[_0xed04('0x5b')]['id'],'ContactId':_0x3b9127['id'],'FaxAccountId':_0x5ece1f['id'],'fax':_0x152fb6[_0xed04('0x5a')]['to'][0x0],'firstMsgDirection':_0xed04('0xb3'),'Messages':[_[_0xed04('0x4e')](_0x152fb6[_0xed04('0x5a')],{'read':![],'body':_0x152fb6[_0xed04('0x5a')][_0xed04('0xa7')][0x0][_0xed04('0xb4')],'FaxAccountId':_0x5ece1f['id'],'UserId':_0x152fb6[_0xed04('0x5b')]['id'],'ContactId':_0x3b9127['id'],'AttachmentId':_0x152fb6[_0xed04('0x5a')][_0xed04('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0xed04('0xa1')],'as':_0xed04('0xb5')}]})[_0xed04('0x1c')](function(_0x43be65){return[_0x43be65,!![]];});});}else{throw new Error(_0xed04('0xb6'));}})[_0xed04('0xb7')](function(_0x3495e6,_0x2e9a80){if(_0x2e9a80){return _0x3495e6;}return db[_0xed04('0xa1')]['create']({'direction':'out','read':![],'body':_0x152fb6[_0xed04('0x5a')][_0xed04('0xa7')][0x0][_0xed04('0xb4')],'FaxAccountId':_0x5ece1f['id'],'FaxInteractionId':_0x3495e6['id'],'UserId':_0x152fb6[_0xed04('0x5b')]['id'],'ContactId':_0x3495e6[_0xed04('0xb8')],'AttachmentId':_0x152fb6[_0xed04('0x5a')][_0xed04('0xa7')][0x0]['id']})[_0xed04('0x1c')](function(_0x18f179){_0x3495e6[_0xed04('0xb9')][_0xed04('0xb5')]=[];_0x3495e6['dataValues']['Messages']['push'](_0x18f179['dataValues']);return _0x3495e6;});})[_0xed04('0x1c')](function(_0x1c8499){respondWithRpcPromise(_0xed04('0xba'),'SendFax',{'FaxAccountId':_[_0xed04('0xad')](_0x152fb6[_0xed04('0x53')]['id'])?undefined:_0x152fb6['params']['id'],'path':_['isNil'](_0x152fb6['body'][_0xed04('0xa7')][0x0]['path'])?undefined:_0x152fb6[_0xed04('0x5a')][_0xed04('0xa7')][0x0][_0xed04('0x6')],'fax':_[_0xed04('0xad')](_0x152fb6[_0xed04('0x5a')]['to'][0x0])?undefined:_0x152fb6[_0xed04('0x5a')]['to'][0x0],'AttachmentId':_0x152fb6['body']['attachments'][0x0]['id']},client9002)['then'](function(_0x186705){logger[_0xed04('0xbb')]('SendFaxRpc,\x20%s',_0x186705);})[_0xed04('0x25')](function(_0x28a87e){logger[_0xed04('0xbb')]('SendFaxRpc,\x20%s',_0x28a87e);});return _0x1c8499;})['then'](respondWithResult(_0xe22d49,null))[_0xed04('0x25')](handleError(_0xe22d49,null));};exports['addAgents']=function(_0x59a06e,_0x4ace1b,_0x268c7a){return db['FaxAccount'][_0xed04('0x58')]({'where':{'id':_0x59a06e['params']['id']}})['then'](handleEntityNotFound(_0x4ace1b,null))[_0xed04('0x1c')](function(_0x530a8a){if(_0x530a8a){return _0x530a8a[_0xed04('0xbc')](_0x59a06e['body'][_0xed04('0x67')],_[_0xed04('0x6e')](_0x59a06e[_0xed04('0x5a')],[_0xed04('0x67'),'id'])||{})['spread'](function(_0x4325f4){for(var _0x4abca8=0x0;_0x4abca8<_0x59a06e[_0xed04('0x5a')][_0xed04('0x67')]['length'];_0x4abca8+=0x1){socket[_0xed04('0xbd')]('userFaxAccount:save',{'UserId':Number(_0x59a06e[_0xed04('0x5a')]['ids'][_0x4abca8]),'FaxAccountId':Number(_0x59a06e[_0xed04('0x53')]['id'])});}return _0x4325f4;});}})[_0xed04('0x1c')](respondWithResult(_0x4ace1b,null))[_0xed04('0x25')](handleError(_0x4ace1b,null));};exports[_0xed04('0xbe')]=function(_0x4ab608,_0xc1aee9,_0x5b7f84){return db[_0xed04('0x3e')][_0xed04('0x58')]({'where':{'id':_0x4ab608['params']['id']}})['then'](handleEntityNotFound(_0xc1aee9,null))[_0xed04('0x1c')](function(_0x12aa3b){if(_0x12aa3b){return _0x12aa3b[_0xed04('0xbe')](_0x4ab608[_0xed04('0x42')][_0xed04('0x67')])[_0xed04('0x1c')](function(){if(_[_0xed04('0xbf')](_0x4ab608[_0xed04('0x42')]['ids'])){for(var _0x2b50ca=0x0;_0x2b50ca<_0x4ab608[_0xed04('0x42')][_0xed04('0x67')][_0xed04('0x56')];_0x2b50ca+=0x1){socket[_0xed04('0xbd')](_0xed04('0xc0'),{'UserId':Number(_0x4ab608['query']['ids'][_0x2b50ca]),'FaxAccountId':Number(_0x4ab608['params']['id'])});}}else{socket[_0xed04('0xbd')](_0xed04('0xc0'),{'UserId':Number(_0x4ab608[_0xed04('0x42')][_0xed04('0x67')]),'FaxAccountId':Number(_0x4ab608[_0xed04('0x53')]['id'])});}});}})[_0xed04('0x1c')](respondWithStatusCode(_0xc1aee9,null))[_0xed04('0x25')](handleError(_0xc1aee9,null));};exports['getAgents']=function(_0x35bd8c,_0x481667,_0x277a58){var _0x13c160={};var _0x1c0769={};var _0x4f337f;var _0x1f2837;return db[_0xed04('0x3e')]['findOne']({'where':{'id':_0x35bd8c['params']['id']}})[_0xed04('0x1c')](handleEntityNotFound(_0x481667,null))[_0xed04('0x1c')](function(_0x279e9c){if(_0x279e9c){_0x4f337f=_0x279e9c;_0x1c0769[_0xed04('0x45')]=_[_0xed04('0x55')](db[_0xed04('0x71')][_0xed04('0x3f')]);_0x1c0769[_0xed04('0x42')]=_[_0xed04('0x55')](_0x35bd8c[_0xed04('0x42')]);_0x1c0769[_0xed04('0x43')]=_['intersection'](_0x1c0769[_0xed04('0x45')],_0x1c0769[_0xed04('0x42')]);_0x13c160[_0xed04('0x47')]=_[_0xed04('0x44')](_0x1c0769[_0xed04('0x45')],qs[_0xed04('0x46')](_0x35bd8c[_0xed04('0x42')][_0xed04('0x46')]));_0x13c160[_0xed04('0x47')]=_0x13c160[_0xed04('0x47')][_0xed04('0x56')]?_0x13c160[_0xed04('0x47')]:_0x1c0769[_0xed04('0x45')];_0x13c160['order']=qs[_0xed04('0x4b')](_0x35bd8c[_0xed04('0x42')][_0xed04('0x4b')]);_0x13c160[_0xed04('0x4c')]=qs['filters'](_['pick'](_0x35bd8c[_0xed04('0x42')],_0x1c0769['filters']));if(_0x35bd8c[_0xed04('0x42')][_0xed04('0x6a')]){_0x13c160[_0xed04('0x4c')]=_[_0xed04('0x4e')](_0x13c160['where'],{'$or':_[_0xed04('0x3d')](_0x13c160[_0xed04('0x47')],function(_0x1bf53c){var _0x2a6276={};_0x2a6276[_0x1bf53c]={'$like':'%'+_0x35bd8c['query'][_0xed04('0x6a')]+'%'};return _0x2a6276;})});}_0x13c160=_[_0xed04('0x4e')]({},_0x13c160,_0x35bd8c[_0xed04('0x65')]);return _0x4f337f[_0xed04('0xc1')](_0x13c160);}})[_0xed04('0x1c')](function(_0x1ec945){if(_0x1ec945){_0x1f2837=_0x1ec945[_0xed04('0x56')];if(!_0x35bd8c['query']['hasOwnProperty'](_0xed04('0x49'))){_0x13c160[_0xed04('0x2c')]=qs['limit'](_0x35bd8c[_0xed04('0x42')]['limit']);_0x13c160[_0xed04('0x2a')]=qs['offset'](_0x35bd8c[_0xed04('0x42')][_0xed04('0x2a')]);}return _0x4f337f[_0xed04('0xc1')](_0x13c160);}})[_0xed04('0x1c')](function(_0x32ecfe){if(_0x32ecfe){return _0x32ecfe?{'count':_0x1f2837,'rows':_0x32ecfe}:null;}})['then'](respondWithResult(_0x481667,null))[_0xed04('0x25')](handleError(_0x481667,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 6fd8210..839df87 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 _0xf5ee=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxAccount'];(function(_0x4d57e6,_0x38f253){var _0xb789ae=function(_0x50eee5){while(--_0x50eee5){_0x4d57e6['push'](_0x4d57e6['shift']());}};_0xb789ae(++_0x38f253);}(_0xf5ee,0xd5));var _0xef5e=function(_0x4853a6,_0x33f9e7){_0x4853a6=_0x4853a6-0x0;var _0x22425d=_0xf5ee[_0x4853a6];return _0x22425d;};'use strict';var EventEmitter=require(_0xef5e('0x0'));var FaxAccount=require(_0xef5e('0x1'))['db'][_0xef5e('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xef5e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xef5e('0x4'),'afterDestroy':_0xef5e('0x5')};function emitEvent(_0x25e9f4){return function(_0x3b7422,_0x5dc6fb,_0x187843){FaxAccountEvents[_0xef5e('0x6')](_0x25e9f4+':'+_0x3b7422['id'],_0x3b7422);FaxAccountEvents[_0xef5e('0x6')](_0x25e9f4,_0x3b7422);_0x187843(null);};}for(var e in events){if(events[_0xef5e('0x7')](e)){var event=events[e];FaxAccount[_0xef5e('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x5158=['remove','emit','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0x4bc397,_0x5759e9){var _0xd3aa0a=function(_0x408c27){while(--_0x408c27){_0x4bc397['push'](_0x4bc397['shift']());}};_0xd3aa0a(++_0x5759e9);}(_0x5158,0x1d7));var _0x8515=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x5158[_0x344a3f];return _0x264712;};'use strict';var EventEmitter=require(_0x8515('0x0'));var FaxAccount=require(_0x8515('0x1'))['db'][_0x8515('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x8515('0x3')](0x0);var events={'afterCreate':_0x8515('0x4'),'afterUpdate':_0x8515('0x5'),'afterDestroy':_0x8515('0x6')};function emitEvent(_0x4f803a){return function(_0x36415e,_0x46ff26,_0x16d8b6){FaxAccountEvents[_0x8515('0x7')](_0x4f803a+':'+_0x36415e['id'],_0x36415e);FaxAccountEvents[_0x8515('0x7')](_0x4f803a,_0x36415e);_0x16d8b6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x8515('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 013237f..b91e4db 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 _0x4183=['./faxAccount.attributes','exports','define','fax_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5a89e4,_0x460ad1){var _0x15c583=function(_0x3022a3){while(--_0x3022a3){_0x5a89e4['push'](_0x5a89e4['shift']());}};_0x15c583(++_0x460ad1);}(_0x4183,0x130));var _0x3418=function(_0x5225d1,_0x1fef96){_0x5225d1=_0x5225d1-0x0;var _0x27370e=_0x4183[_0x5225d1];return _0x27370e;};'use strict';var _=require(_0x3418('0x0'));var util=require(_0x3418('0x1'));var logger=require(_0x3418('0x2'))(_0x3418('0x3'));var moment=require('moment');var BPromise=require(_0x3418('0x4'));var rp=require(_0x3418('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3418('0x6'));var config=require(_0x3418('0x7'));var attributes=require(_0x3418('0x8'));module[_0x3418('0x9')]=function(_0x5d1122,_0x4de0e7){return _0x5d1122[_0x3418('0xa')]('FaxAccount',attributes,{'tableName':_0x3418('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf684=['exports','define','FaxAccount','lodash','util','../../config/logger','moment','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf684,0x173));var _0x4f68=function(_0x5326d5,_0x3f5f35){_0x5326d5=_0x5326d5-0x0;var _0x664c24=_0xf684[_0x5326d5];return _0x664c24;};'use strict';var _=require(_0x4f68('0x0'));var util=require(_0x4f68('0x1'));var logger=require(_0x4f68('0x2'))('api');var moment=require(_0x4f68('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f68('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0x4f68('0x5')]=function(_0x37d9b7,_0x555f47){return _0x37d9b7[_0x4f68('0x6')](_0x4f68('0x7'),attributes,{'tableName':'fax_accounts','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 0948081..080abf9 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 _0xd2e3=['applications','orderBy','asc','Applications','length','create','contact','FaxInteraction','find','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','unshift','agent','*,*,*,*','queueId','queue','waitForTheAssignedQueue','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','redis','defaults','localhost','socket.io-emitter','register','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','NotifyFaxAccount','body','fax','CmContact','describe','then','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','account','Contacts','FaxApplication','List','get'];(function(_0x5c54d3,_0x2ca3d3){var _0x165624=function(_0x460b7f){while(--_0x460b7f){_0x5c54d3['push'](_0x5c54d3['shift']());}};_0x165624(++_0x2ca3d3);}(_0xd2e3,0x1e9));var _0x3d2e=function(_0x2bce53,_0x6cb750){_0x2bce53=_0x2bce53-0x0;var _0x793667=_0xd2e3[_0x2bce53];return _0x793667;};'use strict';var _=require(_0x3d2e('0x0'));var util=require('util');var moment=require(_0x3d2e('0x1'));var BPromise=require(_0x3d2e('0x2'));var rs=require(_0x3d2e('0x3'));var fs=require('fs');var Redis=require(_0x3d2e('0x4'));var db=require(_0x3d2e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3d2e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d2e('0x7')][_0x3d2e('0x8')]({'port':0x232c});config[_0x3d2e('0x9')]=_[_0x3d2e('0xa')](config['redis'],{'host':_0x3d2e('0xb'),'port':0x18eb});var socket=require(_0x3d2e('0xc'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x3d2e('0xd')](socket);function respondWithRpcPromise(_0x3a1e60,_0x3b0452,_0x3dd53c){return new BPromise(function(_0x3cda84,_0x436ea8){return client['request'](_0x3a1e60,_0x3dd53c)['then'](function(_0x46ad33){logger[_0x3d2e('0xe')]('FaxAccount,\x20%s,\x20%s',_0x3b0452,_0x3d2e('0xf'));logger[_0x3d2e('0x10')](_0x3d2e('0x11'),_0x3b0452,_0x3d2e('0xf'),JSON[_0x3d2e('0x12')](_0x46ad33));if(_0x46ad33['error']){if(_0x46ad33[_0x3d2e('0x13')][_0x3d2e('0x14')]===0x1f4){logger[_0x3d2e('0x13')](_0x3d2e('0x15'),_0x3b0452,_0x46ad33[_0x3d2e('0x13')][_0x3d2e('0x16')]);return _0x436ea8(_0x46ad33[_0x3d2e('0x13')]['message']);}logger['error'](_0x3d2e('0x15'),_0x3b0452,_0x46ad33[_0x3d2e('0x13')]['message']);return _0x3cda84(_0x46ad33[_0x3d2e('0x13')][_0x3d2e('0x16')]);}else{logger[_0x3d2e('0xe')]('FaxAccount,\x20%s,\x20%s',_0x3b0452,_0x3d2e('0xf'));_0x3cda84(_0x46ad33[_0x3d2e('0x17')]['message']);}})[_0x3d2e('0x18')](function(_0x408808){logger[_0x3d2e('0x13')](_0x3d2e('0x15'),_0x3b0452,_0x408808);_0x436ea8(_0x408808);});});}exports[_0x3d2e('0x19')]=function(_0x2a5659){var _0x5b6ad9=this;return new Promise(function(_0x3d0284,_0x3b7f8a){return db['FaxAccount'][_0x3d2e('0x1a')]({'raw':_0x2a5659['options']?_0x2a5659[_0x3d2e('0x1b')][_0x3d2e('0x1c')]===undefined?!![]:![]:!![],'where':_0x2a5659[_0x3d2e('0x1b')]?_0x2a5659[_0x3d2e('0x1b')][_0x3d2e('0x1d')]||null:null,'attributes':_0x2a5659[_0x3d2e('0x1b')]?_0x2a5659['options'][_0x3d2e('0x1e')]||null:null,'limit':_0x2a5659[_0x3d2e('0x1b')]?_0x2a5659['options'][_0x3d2e('0x1f')]||null:null,'include':_0x2a5659[_0x3d2e('0x1b')]?_0x2a5659[_0x3d2e('0x1b')][_0x3d2e('0x20')]?_[_0x3d2e('0x21')](_0x2a5659[_0x3d2e('0x1b')][_0x3d2e('0x20')],function(_0xdf8b0f){return{'model':db[_0xdf8b0f[_0x3d2e('0x22')]],'as':_0xdf8b0f['as'],'attributes':_0xdf8b0f[_0x3d2e('0x1e')],'include':_0xdf8b0f[_0x3d2e('0x20')]?_[_0x3d2e('0x21')](_0xdf8b0f[_0x3d2e('0x20')],function(_0x9c0dd0){return{'model':db[_0x9c0dd0['model']],'as':_0x9c0dd0['as'],'attributes':_0x9c0dd0['attributes'],'include':_0x9c0dd0[_0x3d2e('0x20')]?_[_0x3d2e('0x21')](_0x9c0dd0[_0x3d2e('0x20')],function(_0x3427ca){return{'model':db[_0x3427ca[_0x3d2e('0x22')]],'as':_0x3427ca['as'],'attributes':_0x3427ca[_0x3d2e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47eba4){logger[_0x3d2e('0xe')](_0x3d2e('0x19'),_0x2a5659);logger[_0x3d2e('0x10')](_0x3d2e('0x19'),_0x2a5659,JSON['stringify'](_0x47eba4));_0x3d0284(_0x47eba4);})[_0x3d2e('0x18')](function(_0x431bc4){logger[_0x3d2e('0x13')](_0x3d2e('0x19'),_0x431bc4['message'],_0x2a5659);_0x3b7f8a(_0x5b6ad9[_0x3d2e('0x13')](0x1f4,_0x431bc4[_0x3d2e('0x16')]));});});};exports[_0x3d2e('0x23')]=function(_0x4731e9,_0x2647c2,_0x2e86d2){var _0x4bb0e6=this;return new Promise(function(_0x7058b1,_0x95e488){var _0x26bc2d={'body':_0x4731e9[_0x3d2e('0x24')],'channel':_0x3d2e('0x25')};var _0x1da77d=[];var _0x2e57b9=[];var _0x25e81e={};return db[_0x3d2e('0x26')][_0x3d2e('0x27')]()[_0x3d2e('0x28')](function(_0x29ba86){if(!_0x29ba86){throw new db[(_0x3d2e('0x29'))][(_0x3d2e('0x2a'))](_0x3d2e('0x2b'));}_0x1da77d=_[_0x3d2e('0x2c')](_[_0x3d2e('0x2d')](_0x29ba86),['createdAt',_0x3d2e('0x2e')]);_0x2e57b9=_[_0x3d2e('0x2c')](_[_0x3d2e('0x2d')](_0x29ba86),['createdAt',_0x3d2e('0x2e'),_0x3d2e('0x2f'),_0x3d2e('0x30')]);if(_0x4731e9[_0x3d2e('0x24')]['id']){delete _0x4731e9[_0x3d2e('0x24')]['id'];}if(_[_0x3d2e('0x31')](_0x4731e9[_0x3d2e('0x24')][_0x3d2e('0x32')])){throw new db[(_0x3d2e('0x29'))][(_0x3d2e('0x2a'))](_0x3d2e('0x33'));}if(_[_0x3d2e('0x31')](_0x4731e9[_0x3d2e('0x24')]['body'])||_0x4731e9[_0x3d2e('0x24')][_0x3d2e('0x24')]===''){throw new db[(_0x3d2e('0x29'))]['ValidationError'](_0x3d2e('0x34'));}if(_['isNil'](_0x4731e9[_0x3d2e('0x24')][_0x3d2e('0x35')])){throw new db['Sequelize'][(_0x3d2e('0x2a'))](_0x3d2e('0x36')+_0x2e57b9);}if(!_[_0x3d2e('0x37')](_0x2e57b9,_0x4731e9[_0x3d2e('0x24')][_0x3d2e('0x35')])){throw new db['Sequelize']['ValidationError'](_0x3d2e('0x38')+_0x2e57b9);}_0x25e81e[_0x4731e9[_0x3d2e('0x24')][_0x3d2e('0x35')]]=_0x4731e9[_0x3d2e('0x24')][_0x3d2e('0x32')];})['then'](function(){return db[_0x3d2e('0x39')]['find']({'where':{'id':_0x4731e9[_0x3d2e('0x3a')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x3d2e('0x26')],'as':_0x3d2e('0x3b'),'where':_0x25e81e,'limit':0x1,'order':[[_0x3d2e('0x2e'),'DESC']]}]},{'model':db[_0x3d2e('0x3c')],'as':'Applications'}]});})[_0x3d2e('0x28')](function(_0x27cddc){if(_0x27cddc&&_0x27cddc[_0x3d2e('0x3d')]){var _0x205952=_0x27cddc[_0x3d2e('0x3e')]({'plain':!![]});_0x26bc2d[_0x3d2e('0x3a')]=_0x205952;_0x26bc2d['applications']=_0x205952['Applications'];_0x26bc2d['list']=_0x205952['List'];_0x26bc2d[_0x3d2e('0x3f')]=_[_0x3d2e('0x40')](_0x26bc2d[_0x3d2e('0x3f')],['priority'],[_0x3d2e('0x41')]);if(_0x26bc2d[_0x3d2e('0x3a')]['Applications']){delete _0x26bc2d[_0x3d2e('0x3a')][_0x3d2e('0x42')];}if(_0x26bc2d['account'][_0x3d2e('0x3d')]&&_0x26bc2d[_0x3d2e('0x3a')]['List'][_0x3d2e('0x3b')][_0x3d2e('0x43')]){return _0x26bc2d[_0x3d2e('0x3a')][_0x3d2e('0x3d')][_0x3d2e('0x3b')][0x0];}var _0x19dea2=_[_0x3d2e('0xa')](_0x4731e9[_0x3d2e('0x24')],{'firstName':_0x4731e9[_0x3d2e('0x24')]['from'],'ListId':_0x205952[_0x3d2e('0x30')]});_0x19dea2[_0x4731e9[_0x3d2e('0x24')][_0x3d2e('0x35')]]=_0x4731e9[_0x3d2e('0x24')]['from'];return db[_0x3d2e('0x26')][_0x3d2e('0x44')](_0x19dea2,{'fields':_0x1da77d,'raw':!![]});}})['then'](function(_0x120cc7){_0x26bc2d[_0x3d2e('0x45')]=_0x120cc7;if(_0x120cc7){var _0x152fbd={'ContactId':_0x120cc7['id'],'FaxAccountId':_0x4731e9['account']['id'],'fax':_0x120cc7[_0x3d2e('0x25')]};return db[_0x3d2e('0x46')][_0x3d2e('0x47')]({'where':{'ContactId':_0x120cc7['id'],'closed':![],'FaxAccountId':_0x4731e9['account']['id']}})[_0x3d2e('0x28')](function(_0xa481d){if(_0xa481d){return[_0xa481d,![]];}return db[_0x3d2e('0x46')]['create'](_0x152fbd)['then'](function(_0xe60ac0){return[_0xe60ac0,!![]];});});}else{throw new Error(_0x3d2e('0x48'));}})[_0x3d2e('0x49')](function(_0x17c03a,_0x1159ed){var _0x3c0865=_0x17c03a[_0x3d2e('0x3e')]({'plain':!![]});if(_0x1159ed){if(_0x26bc2d[_0x3d2e('0x3a')][_0x3d2e('0x4a')]){_0x26bc2d[_0x3d2e('0x3f')][_0x3d2e('0x4b')]({'id':0x0,'priority':_0x26bc2d[_0x3d2e('0x3f')][_0x3d2e('0x43')]+0x1,'app':_0x3d2e('0x4c'),'appdata':_0x3d2e('0x4d'),'interval':'*,*,*,*'});}_0x3c0865['created']=!![];}else{_0x3c0865[_0x3d2e('0x4e')]=![];}_0x26bc2d[_0x3d2e('0x4f')]=_0x3c0865;return db[_0x3d2e('0x50')][_0x3d2e('0x44')]({'body':_0x4731e9['body'][_0x3d2e('0x24')],'FaxAccountId':_0x4731e9[_0x3d2e('0x3a')]['id'],'FaxInteractionId':_0x17c03a['id'],'direction':'in','ContactId':_0x17c03a[_0x3d2e('0x51')],'AttachmentId':_0x4731e9[_0x3d2e('0x24')][_0x3d2e('0x52')]});})[_0x3d2e('0x28')](function(_0x51936b){_0x26bc2d[_0x3d2e('0x16')]=_0x51936b;if(!_0x26bc2d[_0x3d2e('0x4f')][_0x3d2e('0x53')])return;return db['User'][_0x3d2e('0x47')]({'attributes':['id',_0x3d2e('0x54')],'where':{'id':_0x26bc2d[_0x3d2e('0x4f')][_0x3d2e('0x53')]}});})['then'](function(_0xb8ffee){if(_0xb8ffee){_0x26bc2d[_0x3d2e('0x3f')][_0x3d2e('0x55')]({'id':0x0,'priority':0x0,'app':_0x3d2e('0x56'),'appdata':_0xb8ffee[_0x3d2e('0x54')]+','+(_0x26bc2d['account']['waitForTheAssignedAgent']||0xa),'interval':_0x3d2e('0x57')});}if(!_0x26bc2d[_0x3d2e('0x4f')][_0x3d2e('0x58')])return;return db['FaxQueue'][_0x3d2e('0x47')]({'attributes':['id','name'],'where':{'id':_0x26bc2d[_0x3d2e('0x4f')][_0x3d2e('0x58')]}});})[_0x3d2e('0x28')](function(_0x4907f3){if(_0x4907f3){_0x26bc2d[_0x3d2e('0x3f')][_0x3d2e('0x55')]({'id':0x0,'priority':0x1,'app':_0x3d2e('0x59'),'appdata':_0x4907f3['name']+','+(_0x26bc2d['account'][_0x3d2e('0x5a')]||0x12c),'interval':_0x3d2e('0x57')});}return respondWithRpcPromise('Start',_0x3d2e('0x5b'),_0x26bc2d);})[_0x3d2e('0x28')](function(_0x3c06ca){_0x7058b1(_0x3c06ca);})[_0x3d2e('0x18')](function(_0x1246be){_0x95e488(_0x4bb0e6[_0x3d2e('0x13')](0x1f4,_0x1246be[_0x3d2e('0x16')]));});});}; \ No newline at end of file +var _0xa5e7=['FaxApplication','Applications','get','applications','list','orderBy','priority','asc','ListId','mapKey','FaxInteraction','find','create','Contact\x20not\x20found','autoclose','close','created','FaxMessage','AttachmentId','interaction','UserId','User','name','unshift','queueId','queue','waitForTheAssignedQueue','*,*,*,*','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','map','model','catch','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','DESC'];(function(_0x3c2407,_0x3c9a47){var _0x5d2eac=function(_0xb33bf8){while(--_0xb33bf8){_0x3c2407['push'](_0x3c2407['shift']());}};_0x5d2eac(++_0x3c9a47);}(_0xa5e7,0x1e9));var _0x7a5e=function(_0x3a8ecd,_0x40870b){_0x3a8ecd=_0x3a8ecd-0x0;var _0x2be886=_0xa5e7[_0x3a8ecd];return _0x2be886;};'use strict';var _=require(_0x7a5e('0x0'));var util=require(_0x7a5e('0x1'));var moment=require('moment');var BPromise=require(_0x7a5e('0x2'));var rs=require(_0x7a5e('0x3'));var fs=require('fs');var Redis=require(_0x7a5e('0x4'));var db=require(_0x7a5e('0x5'))['db'];var utils=require(_0x7a5e('0x6'));var logger=require('../../config/logger')(_0x7a5e('0x7'));var config=require(_0x7a5e('0x8'));var jayson=require(_0x7a5e('0x9'));var client=jayson[_0x7a5e('0xa')][_0x7a5e('0xb')]({'port':0x232c});config[_0x7a5e('0xc')]=_[_0x7a5e('0xd')](config[_0x7a5e('0xc')],{'host':_0x7a5e('0xe'),'port':0x18eb});var socket=require(_0x7a5e('0xf'))(new Redis(config['redis']));require(_0x7a5e('0x10'))[_0x7a5e('0x11')](socket);function respondWithRpcPromise(_0x148b64,_0x4a0521,_0x33ec62){return new BPromise(function(_0x1e1da0,_0x3ccdae){return client[_0x7a5e('0x12')](_0x148b64,_0x33ec62)[_0x7a5e('0x13')](function(_0x1669b9){logger[_0x7a5e('0x14')](_0x7a5e('0x15'),_0x4a0521,_0x7a5e('0x16'));logger[_0x7a5e('0x17')](_0x7a5e('0x18'),_0x4a0521,_0x7a5e('0x16'),JSON[_0x7a5e('0x19')](_0x1669b9));if(_0x1669b9[_0x7a5e('0x1a')]){if(_0x1669b9['error'][_0x7a5e('0x1b')]===0x1f4){logger[_0x7a5e('0x1a')](_0x7a5e('0x15'),_0x4a0521,_0x1669b9['error'][_0x7a5e('0x1c')]);return _0x3ccdae(_0x1669b9[_0x7a5e('0x1a')][_0x7a5e('0x1c')]);}logger['error'](_0x7a5e('0x15'),_0x4a0521,_0x1669b9['error']['message']);return _0x1e1da0(_0x1669b9[_0x7a5e('0x1a')][_0x7a5e('0x1c')]);}else{logger['info'](_0x7a5e('0x15'),_0x4a0521,'request\x20sent');_0x1e1da0(_0x1669b9[_0x7a5e('0x1d')][_0x7a5e('0x1c')]);}})['catch'](function(_0x31f086){logger[_0x7a5e('0x1a')](_0x7a5e('0x15'),_0x4a0521,_0x31f086);_0x3ccdae(_0x31f086);});});}exports[_0x7a5e('0x1e')]=function(_0x2512cf){var _0x25f950=this;return new Promise(function(_0x4f3586,_0xd6cf29){return db[_0x7a5e('0x1f')]['findAll']({'raw':_0x2512cf[_0x7a5e('0x20')]?_0x2512cf['options'][_0x7a5e('0x21')]===undefined?!![]:![]:!![],'where':_0x2512cf[_0x7a5e('0x20')]?_0x2512cf[_0x7a5e('0x20')][_0x7a5e('0x22')]||null:null,'attributes':_0x2512cf[_0x7a5e('0x20')]?_0x2512cf[_0x7a5e('0x20')][_0x7a5e('0x23')]||null:null,'limit':_0x2512cf[_0x7a5e('0x20')]?_0x2512cf[_0x7a5e('0x20')][_0x7a5e('0x24')]||null:null,'include':_0x2512cf[_0x7a5e('0x20')]?_0x2512cf['options'][_0x7a5e('0x25')]?_[_0x7a5e('0x26')](_0x2512cf[_0x7a5e('0x20')]['include'],function(_0x586690){return{'model':db[_0x586690['model']],'as':_0x586690['as'],'attributes':_0x586690[_0x7a5e('0x23')],'include':_0x586690[_0x7a5e('0x25')]?_[_0x7a5e('0x26')](_0x586690[_0x7a5e('0x25')],function(_0x26e57c){return{'model':db[_0x26e57c[_0x7a5e('0x27')]],'as':_0x26e57c['as'],'attributes':_0x26e57c[_0x7a5e('0x23')],'include':_0x26e57c[_0x7a5e('0x25')]?_[_0x7a5e('0x26')](_0x26e57c[_0x7a5e('0x25')],function(_0x18b2f0){return{'model':db[_0x18b2f0[_0x7a5e('0x27')]],'as':_0x18b2f0['as'],'attributes':_0x18b2f0['attributes']};}):[]};}):[]};}):[]:[]})[_0x7a5e('0x13')](function(_0x3e674d){logger[_0x7a5e('0x14')](_0x7a5e('0x1e'),_0x2512cf);logger['debug'](_0x7a5e('0x1e'),_0x2512cf,JSON['stringify'](_0x3e674d));_0x4f3586(_0x3e674d);})[_0x7a5e('0x28')](function(_0x18af5b){logger[_0x7a5e('0x1a')](_0x7a5e('0x1e'),_0x18af5b['message'],_0x2512cf);_0xd6cf29(_0x25f950[_0x7a5e('0x1a')](0x1f4,_0x18af5b[_0x7a5e('0x1c')]));});});};exports[_0x7a5e('0x29')]=function(_0x52da7f,_0x4518e8,_0x356bba){var _0x581068=this;return new Promise(function(_0x36a168,_0x7b3bff){var _0x1d3840={'body':_0x52da7f[_0x7a5e('0x2a')],'channel':_0x7a5e('0x2b')};var _0x5c84b2=[];var _0x2c6b77=[];var _0x2d00d1={};return db[_0x7a5e('0x2c')][_0x7a5e('0x2d')]()[_0x7a5e('0x13')](function(_0x4f12d6){if(!_0x4f12d6){throw new db[(_0x7a5e('0x2e'))][(_0x7a5e('0x2f'))](_0x7a5e('0x30'));}_0x5c84b2=_[_0x7a5e('0x31')](_['keys'](_0x4f12d6),[_0x7a5e('0x32'),'updatedAt']);_0x2c6b77=_[_0x7a5e('0x31')](_['keys'](_0x4f12d6),[_0x7a5e('0x32'),_0x7a5e('0x33'),_0x7a5e('0x34'),'ListId']);if(_0x52da7f[_0x7a5e('0x2a')]['id']){delete _0x52da7f['body']['id'];}if(_['isNil'](_0x52da7f[_0x7a5e('0x2a')][_0x7a5e('0x35')])){throw new db[(_0x7a5e('0x2e'))][(_0x7a5e('0x2f'))]('from\x20is\x20mandatory');}if(_[_0x7a5e('0x36')](_0x52da7f[_0x7a5e('0x2a')][_0x7a5e('0x2a')])||_0x52da7f['body']['body']===''){throw new db['Sequelize'][(_0x7a5e('0x2f'))](_0x7a5e('0x37'));}if(_[_0x7a5e('0x36')](_0x52da7f[_0x7a5e('0x2a')]['mapKey'])){throw new db[(_0x7a5e('0x2e'))]['ValidationError'](_0x7a5e('0x38')+_0x2c6b77);}if(!_[_0x7a5e('0x39')](_0x2c6b77,_0x52da7f[_0x7a5e('0x2a')]['mapKey'])){throw new db['Sequelize'][(_0x7a5e('0x2f'))](_0x7a5e('0x3a')+_0x2c6b77);}_0x2d00d1[_0x52da7f[_0x7a5e('0x2a')]['mapKey']]=_0x52da7f['body'][_0x7a5e('0x35')];})['then'](function(){return db[_0x7a5e('0x1f')]['find']({'where':{'id':_0x52da7f[_0x7a5e('0x3b')]['id']},'include':[{'model':db['CmList'],'as':_0x7a5e('0x3c'),'include':[{'model':db['CmContact'],'as':_0x7a5e('0x3d'),'where':_0x2d00d1,'limit':0x1,'order':[[_0x7a5e('0x33'),_0x7a5e('0x3e')]]}]},{'model':db[_0x7a5e('0x3f')],'as':_0x7a5e('0x40')}]});})[_0x7a5e('0x13')](function(_0x9ddf2c){if(_0x9ddf2c&&_0x9ddf2c['List']){var _0x56176f=_0x9ddf2c[_0x7a5e('0x41')]({'plain':!![]});_0x1d3840['account']=_0x56176f;_0x1d3840[_0x7a5e('0x42')]=_0x56176f[_0x7a5e('0x40')];_0x1d3840[_0x7a5e('0x43')]=_0x56176f[_0x7a5e('0x3c')];_0x1d3840['applications']=_[_0x7a5e('0x44')](_0x1d3840[_0x7a5e('0x42')],[_0x7a5e('0x45')],[_0x7a5e('0x46')]);if(_0x1d3840[_0x7a5e('0x3b')][_0x7a5e('0x40')]){delete _0x1d3840[_0x7a5e('0x3b')][_0x7a5e('0x40')];}if(_0x1d3840[_0x7a5e('0x3b')][_0x7a5e('0x3c')]&&_0x1d3840[_0x7a5e('0x3b')]['List'][_0x7a5e('0x3d')]['length']){return _0x1d3840[_0x7a5e('0x3b')][_0x7a5e('0x3c')][_0x7a5e('0x3d')][0x0];}var _0x18cfd8=_[_0x7a5e('0xd')](_0x52da7f[_0x7a5e('0x2a')],{'firstName':_0x52da7f[_0x7a5e('0x2a')][_0x7a5e('0x35')],'ListId':_0x56176f[_0x7a5e('0x47')]});_0x18cfd8[_0x52da7f[_0x7a5e('0x2a')][_0x7a5e('0x48')]]=_0x52da7f[_0x7a5e('0x2a')][_0x7a5e('0x35')];return db[_0x7a5e('0x2c')]['create'](_0x18cfd8,{'fields':_0x5c84b2,'raw':!![]});}})[_0x7a5e('0x13')](function(_0x13eac2){_0x1d3840['contact']=_0x13eac2;if(_0x13eac2){var _0x437284={'ContactId':_0x13eac2['id'],'FaxAccountId':_0x52da7f[_0x7a5e('0x3b')]['id'],'fax':_0x13eac2[_0x7a5e('0x2b')]};return db[_0x7a5e('0x49')][_0x7a5e('0x4a')]({'where':{'ContactId':_0x13eac2['id'],'closed':![],'FaxAccountId':_0x52da7f['account']['id']}})[_0x7a5e('0x13')](function(_0x1594f2){if(_0x1594f2){return[_0x1594f2,![]];}return db[_0x7a5e('0x49')][_0x7a5e('0x4b')](_0x437284)[_0x7a5e('0x13')](function(_0x379f30){return[_0x379f30,!![]];});});}else{throw new Error(_0x7a5e('0x4c'));}})['spread'](function(_0xd8fd44,_0x3342e7){var _0x16d0ab=_0xd8fd44[_0x7a5e('0x41')]({'plain':!![]});if(_0x3342e7){if(_0x1d3840[_0x7a5e('0x3b')][_0x7a5e('0x4d')]){_0x1d3840['applications']['push']({'id':0x0,'priority':_0x1d3840[_0x7a5e('0x42')]['length']+0x1,'app':_0x7a5e('0x4e'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x16d0ab[_0x7a5e('0x4f')]=!![];}else{_0x16d0ab[_0x7a5e('0x4f')]=![];}_0x1d3840['interaction']=_0x16d0ab;return db[_0x7a5e('0x50')][_0x7a5e('0x4b')]({'body':_0x52da7f['body']['body'],'FaxAccountId':_0x52da7f[_0x7a5e('0x3b')]['id'],'FaxInteractionId':_0xd8fd44['id'],'direction':'in','ContactId':_0xd8fd44['ContactId'],'AttachmentId':_0x52da7f[_0x7a5e('0x2a')][_0x7a5e('0x51')]});})[_0x7a5e('0x13')](function(_0x48642e){_0x1d3840[_0x7a5e('0x1c')]=_0x48642e;if(!_0x1d3840[_0x7a5e('0x52')][_0x7a5e('0x53')])return;return db[_0x7a5e('0x54')]['find']({'attributes':['id',_0x7a5e('0x55')],'where':{'id':_0x1d3840[_0x7a5e('0x52')]['UserId']}});})['then'](function(_0xd11f56){if(_0xd11f56){_0x1d3840[_0x7a5e('0x42')][_0x7a5e('0x56')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xd11f56[_0x7a5e('0x55')]+','+(_0x1d3840[_0x7a5e('0x3b')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0x1d3840[_0x7a5e('0x52')][_0x7a5e('0x57')])return;return db['FaxQueue'][_0x7a5e('0x4a')]({'attributes':['id','name'],'where':{'id':_0x1d3840[_0x7a5e('0x52')][_0x7a5e('0x57')]}});})['then'](function(_0x51eb78){if(_0x51eb78){_0x1d3840['applications'][_0x7a5e('0x56')]({'id':0x0,'priority':0x1,'app':_0x7a5e('0x58'),'appdata':_0x51eb78[_0x7a5e('0x55')]+','+(_0x1d3840[_0x7a5e('0x3b')][_0x7a5e('0x59')]||0x12c),'interval':_0x7a5e('0x5a')});}return respondWithRpcPromise('Start',_0x7a5e('0x5b'),_0x1d3840);})[_0x7a5e('0x13')](function(_0x2eaff7){_0x36a168(_0x2eaff7);})['catch'](function(_0x8a71f8){_0x7b3bff(_0x581068[_0x7a5e('0x1a')](0x1f4,_0x8a71f8[_0x7a5e('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 529bfc9..16c0db9 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 _0xea4f=['removeListener','length','faxAccount:','./faxAccount.events','update','emit'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xea4f,0x195));var _0xfea4=function(_0xe67dad,_0x8536d7){_0xe67dad=_0xe67dad-0x0;var _0x4895e0=_0xea4f[_0xe67dad];return _0x4895e0;};'use strict';var FaxAccountEvents=require(_0xfea4('0x0'));var events=['save','remove',_0xfea4('0x1')];function createListener(_0x3cdd08,_0x56ac65){return function(_0x864921){_0x56ac65[_0xfea4('0x2')](_0x3cdd08,_0x864921);};}function removeListener(_0x4473c1,_0x1f21ca){return function(){FaxAccountEvents[_0xfea4('0x3')](_0x4473c1,_0x1f21ca);};}exports['register']=function(_0x39f623){for(var _0x2d63bf=0x0,_0x3d8bcb=events[_0xfea4('0x4')];_0x2d63bf<_0x3d8bcb;_0x2d63bf++){var _0x4454e7=events[_0x2d63bf];var _0x43579c=createListener(_0xfea4('0x5')+_0x4454e7,_0x39f623);FaxAccountEvents['on'](_0x4454e7,_0x43579c);}}; \ No newline at end of file +var _0x5b61=['length','faxAccount:','save','remove','update','removeListener','register'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0x5b61,0x1d7));var _0x15b6=function(_0x375325,_0x57a850){_0x375325=_0x375325-0x0;var _0x228f57=_0x5b61[_0x375325];return _0x228f57;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x15b6('0x0'),_0x15b6('0x1'),_0x15b6('0x2')];function createListener(_0xda2ad9,_0x22a22d){return function(_0x44d001){_0x22a22d['emit'](_0xda2ad9,_0x44d001);};}function removeListener(_0x803f1f,_0x5b2191){return function(){FaxAccountEvents[_0x15b6('0x3')](_0x803f1f,_0x5b2191);};}exports[_0x15b6('0x4')]=function(_0x127ff6){for(var _0x4cf15d=0x0,_0x37b4d7=events[_0x15b6('0x5')];_0x4cf15d<_0x37b4d7;_0x4cf15d++){var _0xe1f6eb=events[_0x4cf15d];var _0x19fce1=createListener(_0x15b6('0x6')+_0xe1f6eb,_0x127ff6);FaxAccountEvents['on'](_0xe1f6eb,_0x19fce1);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index a0625c0..4f99e59 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 _0x810f=['/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/interactions','getInteractions'];(function(_0xadc32b,_0x5a7ade){var _0x3ea2d0=function(_0x28fd69){while(--_0x28fd69){_0xadc32b['push'](_0xadc32b['shift']());}};_0x3ea2d0(++_0x5a7ade);}(_0x810f,0x114));var _0xf810=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x810f[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require(_0xf810('0x0'));var util=require(_0xf810('0x1'));var path=require(_0xf810('0x2'));var timeout=require('connect-timeout');var express=require(_0xf810('0x3'));var router=express[_0xf810('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf810('0x5'));var interaction=require(_0xf810('0x6'));var config=require(_0xf810('0x7'));var controller=require('./faxAccount.controller');router[_0xf810('0x8')]('/',auth[_0xf810('0x9')](),controller[_0xf810('0xa')]);router['get'](_0xf810('0xb'),auth[_0xf810('0x9')](),controller['describe']);router[_0xf810('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf810('0xc')]);router[_0xf810('0x8')](_0xf810('0xd'),auth['isAuthenticated'](),controller[_0xf810('0xe')]);router[_0xf810('0x8')](_0xf810('0xf'),auth[_0xf810('0x9')](),controller['getAnswers']);router[_0xf810('0x8')](_0xf810('0x10'),auth[_0xf810('0x9')](),controller[_0xf810('0x11')]);router[_0xf810('0x8')](_0xf810('0x12'),auth['isAuthenticated'](),controller[_0xf810('0x13')]);router[_0xf810('0x8')](_0xf810('0x14'),auth[_0xf810('0x9')](),controller[_0xf810('0x15')]);router['get'](_0xf810('0x16'),auth[_0xf810('0x9')](),controller[_0xf810('0x17')]);router[_0xf810('0x18')]('/',auth[_0xf810('0x9')](),controller[_0xf810('0x19')]);router[_0xf810('0x18')](_0xf810('0xd'),auth[_0xf810('0x9')](),controller[_0xf810('0x1a')]);router[_0xf810('0x18')](_0xf810('0xf'),auth[_0xf810('0x9')](),controller[_0xf810('0x1b')]);router[_0xf810('0x18')](_0xf810('0x10'),auth[_0xf810('0x9')](),controller[_0xf810('0x1c')]);router[_0xf810('0x18')](_0xf810('0x12'),auth[_0xf810('0x9')](),controller[_0xf810('0x1d')]);router[_0xf810('0x18')]('/addaccountapplications',auth[_0xf810('0x9')](),controller[_0xf810('0x1e')]);router['post'](_0xf810('0x1f'),auth[_0xf810('0x9')](),controller[_0xf810('0x20')]);router[_0xf810('0x18')](_0xf810('0x21'),auth['isAuthenticated'](),controller[_0xf810('0x22')]);router[_0xf810('0x18')](_0xf810('0x16'),auth[_0xf810('0x9')](),controller['addAgents']);router['put'](_0xf810('0x23'),auth[_0xf810('0x9')](),controller[_0xf810('0x24')]);router[_0xf810('0x25')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xf810('0x25')]('/:id/dispositions',auth[_0xf810('0x9')](),controller[_0xf810('0x26')]);router[_0xf810('0x25')](_0xf810('0xf'),auth[_0xf810('0x9')](),controller[_0xf810('0x27')]);router[_0xf810('0x25')]('/:id/users',auth[_0xf810('0x9')](),controller[_0xf810('0x28')]);module[_0xf810('0x29')]=router; \ No newline at end of file +var _0xe36a=['destroy','removeAnswers','removeAgents','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','create','post','addDisposition','addInteraction','addApplications','/addaccountapplications','updateAccountApplications','addAgents','put','delete'];(function(_0x170436,_0x3ea5f2){var _0x4bda4b=function(_0x3e3f10){while(--_0x3e3f10){_0x170436['push'](_0x170436['shift']());}};_0x4bda4b(++_0x3ea5f2);}(_0xe36a,0xc1));var _0xae36=function(_0x590ef7,_0x175f08){_0x590ef7=_0x590ef7-0x0;var _0x4c2634=_0xe36a[_0x590ef7];return _0x4c2634;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xae36('0x0'));var express=require(_0xae36('0x1'));var router=express[_0xae36('0x2')]();var fs_extra=require(_0xae36('0x3'));var auth=require(_0xae36('0x4'));var interaction=require(_0xae36('0x5'));var config=require(_0xae36('0x6'));var controller=require(_0xae36('0x7'));router[_0xae36('0x8')]('/',auth[_0xae36('0x9')](),controller[_0xae36('0xa')]);router['get'](_0xae36('0xb'),auth['isAuthenticated'](),controller[_0xae36('0xc')]);router[_0xae36('0x8')](_0xae36('0xd'),auth['isAuthenticated'](),controller[_0xae36('0xe')]);router[_0xae36('0x8')](_0xae36('0xf'),auth[_0xae36('0x9')](),controller['getDispositions']);router[_0xae36('0x8')](_0xae36('0x10'),auth['isAuthenticated'](),controller[_0xae36('0x11')]);router['get'](_0xae36('0x12'),auth[_0xae36('0x9')](),controller['getInteractions']);router[_0xae36('0x8')](_0xae36('0x13'),auth[_0xae36('0x9')](),controller[_0xae36('0x14')]);router[_0xae36('0x8')](_0xae36('0x15'),auth[_0xae36('0x9')](),controller[_0xae36('0x16')]);router[_0xae36('0x8')](_0xae36('0x17'),auth[_0xae36('0x9')](),controller[_0xae36('0x18')]);router['post']('/',auth[_0xae36('0x9')](),controller[_0xae36('0x19')]);router[_0xae36('0x1a')](_0xae36('0xf'),auth[_0xae36('0x9')](),controller[_0xae36('0x1b')]);router[_0xae36('0x1a')](_0xae36('0x10'),auth[_0xae36('0x9')](),controller['addAnswer']);router[_0xae36('0x1a')](_0xae36('0x12'),auth[_0xae36('0x9')](),controller[_0xae36('0x1c')]);router['post']('/:id/applications',auth[_0xae36('0x9')](),controller[_0xae36('0x1d')]);router['post'](_0xae36('0x1e'),auth['isAuthenticated'](),controller['addAccountApplications']);router['post']('/updateaccountapplications',auth[_0xae36('0x9')](),controller[_0xae36('0x1f')]);router[_0xae36('0x1a')]('/:id/send',auth['isAuthenticated'](),controller['send']);router['post'](_0xae36('0x17'),auth[_0xae36('0x9')](),controller[_0xae36('0x20')]);router[_0xae36('0x21')](_0xae36('0xd'),auth[_0xae36('0x9')](),controller['update']);router[_0xae36('0x22')](_0xae36('0xd'),auth[_0xae36('0x9')](),controller[_0xae36('0x23')]);router[_0xae36('0x22')](_0xae36('0xf'),auth[_0xae36('0x9')](),controller['removeDispositions']);router[_0xae36('0x22')](_0xae36('0x10'),auth[_0xae36('0x9')](),controller[_0xae36('0x24')]);router['delete']('/:id/users',auth[_0xae36('0x9')](),controller[_0xae36('0x25')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index a30ad6b..5e1aa11 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 _0x5eaa=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x5bff0b,_0xdecf64){var _0x28cd39=function(_0x2af511){while(--_0x2af511){_0x5bff0b['push'](_0x5bff0b['shift']());}};_0x28cd39(++_0xdecf64);}(_0x5eaa,0x15d));var _0xa5ea=function(_0x57a8e7,_0x1e576d){_0x57a8e7=_0x57a8e7-0x0;var _0x4ee93a=_0x5eaa[_0x57a8e7];return _0x4ee93a;};'use strict';var Sequelize=require(_0xa5ea('0x0'));module[_0xa5ea('0x1')]={'priority':{'type':Sequelize[_0xa5ea('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa5ea('0x3')],'allowNull':![],'defaultValue':_0xa5ea('0x4')},'appdata':{'type':Sequelize[_0xa5ea('0x5')]()},'description':{'type':Sequelize[_0xa5ea('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa5ea('0x6')}}; \ No newline at end of file +var _0xf2fc=['INTEGER','TEXT','STRING','*,*,*,*'];(function(_0x10566a,_0x2c1069){var _0x3262ec=function(_0x4c3c2c){while(--_0x4c3c2c){_0x10566a['push'](_0x10566a['shift']());}};_0x3262ec(++_0x2c1069);}(_0xf2fc,0x120));var _0xcf2f=function(_0x1067a6,_0x17369c){_0x1067a6=_0x1067a6-0x0;var _0x41be1e=_0xf2fc[_0x1067a6];return _0x41be1e;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xcf2f('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xcf2f('0x1')]()},'description':{'type':Sequelize[_0xcf2f('0x2')]},'interval':{'type':Sequelize[_0xcf2f('0x2')],'defaultValue':_0xcf2f('0x3')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index c75afcd..1955d30 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 _0x01cd=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','then','destroy','stack','send','index','map','FaxApplication','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','merge','VIRTUAL','name','filter','options','includeAll','include','rows','catch','params','keys','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox'];(function(_0x5e9b53,_0x4b8fdc){var _0x12df57=function(_0x579744){while(--_0x579744){_0x5e9b53['push'](_0x5e9b53['shift']());}};_0x12df57(++_0x4b8fdc);}(_0x01cd,0x82));var _0xd01c=function(_0x1acaf3,_0xa59a20){_0x1acaf3=_0x1acaf3-0x0;var _0x19db37=_0x01cd[_0x1acaf3];return _0x19db37;};'use strict';var emlformat=require(_0xd01c('0x0'));var rimraf=require(_0xd01c('0x1'));var zipdir=require(_0xd01c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd01c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd01c('0x4'));var util=require(_0xd01c('0x5'));var path=require(_0xd01c('0x6'));var sox=require(_0xd01c('0x7'));var csv=require(_0xd01c('0x8'));var ejs=require(_0xd01c('0x9'));var fs=require('fs');var fs_extra=require(_0xd01c('0xa'));var _=require(_0xd01c('0xb'));var squel=require(_0xd01c('0xc'));var crypto=require('crypto');var jsforce=require(_0xd01c('0xd'));var deskjs=require(_0xd01c('0xe'));var toCsv=require(_0xd01c('0x8'));var querystring=require(_0xd01c('0xf'));var Papa=require(_0xd01c('0x10'));var Redis=require('ioredis');var authService=require(_0xd01c('0x11'));var qs=require(_0xd01c('0x12'));var as=require(_0xd01c('0x13'));var hardwareService=require(_0xd01c('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd01c('0x15'));var licenseUtil=require(_0xd01c('0x16'));var db=require(_0xd01c('0x17'))['db'];function respondWithStatusCode(_0x185ea8,_0x22bc15){_0x22bc15=_0x22bc15||0xcc;return function(_0x504ad6){if(_0x504ad6){return _0x185ea8[_0xd01c('0x18')](_0x22bc15);}return _0x185ea8[_0xd01c('0x19')](_0x22bc15)['end']();};}function respondWithResult(_0x18a09e,_0x28e467){_0x28e467=_0x28e467||0xc8;return function(_0x1054b5){if(_0x1054b5){return _0x18a09e[_0xd01c('0x19')](_0x28e467)[_0xd01c('0x1a')](_0x1054b5);}};}function respondWithFilteredResult(_0x128ac9,_0x496762){return function(_0x497e09){if(_0x497e09){var _0x2c9346=typeof _0x496762[_0xd01c('0x1b')]==='undefined'&&typeof _0x496762[_0xd01c('0x1c')]==='undefined';var _0xca6ed=_0x497e09[_0xd01c('0x1d')];var _0x22c69f=_0x2c9346?0x0:_0x496762[_0xd01c('0x1b')];var _0x17313e=_0x2c9346?_0x497e09[_0xd01c('0x1d')]:_0x496762['offset']+_0x496762[_0xd01c('0x1c')];var _0x2936c2;if(_0x17313e>=_0xca6ed){_0x17313e=_0xca6ed;_0x2936c2=0xc8;}else{_0x2936c2=0xce;}_0x128ac9[_0xd01c('0x19')](_0x2936c2);return _0x128ac9['set'](_0xd01c('0x1e'),_0x22c69f+'-'+_0x17313e+'/'+_0xca6ed)[_0xd01c('0x1a')](_0x497e09);}return null;};}function patchUpdates(_0x573890){return function(_0x3855a5){try{jsonpatch[_0xd01c('0x1f')](_0x3855a5,_0x573890,!![]);}catch(_0x3f7554){return BPromise[_0xd01c('0x20')](_0x3f7554);}return _0x3855a5[_0xd01c('0x21')]();};}function saveUpdates(_0x5a400f,_0x22638d){return function(_0x2dda04){if(_0x2dda04){return _0x2dda04['update'](_0x5a400f)[_0xd01c('0x22')](function(_0x1e6b88){return _0x1e6b88;});}return null;};}function removeEntity(_0x1e016f,_0x4fdd13){return function(_0xed1277){if(_0xed1277){return _0xed1277[_0xd01c('0x23')]()[_0xd01c('0x22')](function(){_0x1e016f[_0xd01c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c9833,_0x9b80f){return function(_0x572e1d){if(!_0x572e1d){_0x4c9833[_0xd01c('0x18')](0x194);}return _0x572e1d;};}function handleError(_0x2493bb,_0xfb8c5c){_0xfb8c5c=_0xfb8c5c||0x1f4;return function(_0x52aa14){logger['error'](_0x52aa14[_0xd01c('0x24')]);if(_0x52aa14['name']){delete _0x52aa14['name'];}_0x2493bb[_0xd01c('0x19')](_0xfb8c5c)[_0xd01c('0x25')](_0x52aa14);};}exports[_0xd01c('0x26')]=function(_0x14aa2b,_0x5ef73d){var _0x376bdd={},_0x6fb453={},_0x11a482={'count':0x0,'rows':[]};var _0x11297c=_[_0xd01c('0x27')](db[_0xd01c('0x28')][_0xd01c('0x29')],function(_0x26dc68){return{'name':_0x26dc68[_0xd01c('0x2a')],'type':_0x26dc68['type']['key']};});_0x6fb453[_0xd01c('0x2b')]=_[_0xd01c('0x27')](_0x11297c,'name');_0x6fb453[_0xd01c('0x2c')]=_['keys'](_0x14aa2b['query']);_0x6fb453['filters']=_[_0xd01c('0x2d')](_0x6fb453['model'],_0x6fb453['query']);_0x376bdd[_0xd01c('0x2e')]=_['intersection'](_0x6fb453[_0xd01c('0x2b')],qs['fields'](_0x14aa2b[_0xd01c('0x2c')][_0xd01c('0x2f')]));_0x376bdd[_0xd01c('0x2e')]=_0x376bdd['attributes'][_0xd01c('0x30')]?_0x376bdd[_0xd01c('0x2e')]:_0x6fb453[_0xd01c('0x2b')];if(!_0x14aa2b[_0xd01c('0x2c')]['hasOwnProperty'](_0xd01c('0x31'))){_0x376bdd[_0xd01c('0x1c')]=qs[_0xd01c('0x1c')](_0x14aa2b[_0xd01c('0x2c')][_0xd01c('0x1c')]);_0x376bdd[_0xd01c('0x1b')]=qs[_0xd01c('0x1b')](_0x14aa2b[_0xd01c('0x2c')][_0xd01c('0x1b')]);}_0x376bdd['order']=qs[_0xd01c('0x32')](_0x14aa2b[_0xd01c('0x2c')][_0xd01c('0x32')]);_0x376bdd[_0xd01c('0x33')]=qs[_0xd01c('0x34')](_[_0xd01c('0x35')](_0x14aa2b['query'],_0x6fb453[_0xd01c('0x34')]),_0x11297c);if(_0x14aa2b[_0xd01c('0x2c')]['filter']){_0x376bdd[_0xd01c('0x33')]=_[_0xd01c('0x36')](_0x376bdd[_0xd01c('0x33')],{'$or':_[_0xd01c('0x27')](_0x11297c,function(_0x32ca23){if(_0x32ca23['type']!==_0xd01c('0x37')){var _0x108295={};_0x108295[_0x32ca23[_0xd01c('0x38')]]={'$like':'%'+_0x14aa2b['query'][_0xd01c('0x39')]+'%'};return _0x108295;}})});}_0x376bdd=_[_0xd01c('0x36')]({},_0x376bdd,_0x14aa2b[_0xd01c('0x3a')]);var _0x172636={'where':_0x376bdd[_0xd01c('0x33')]};return db[_0xd01c('0x28')]['count'](_0x172636)['then'](function(_0x327a22){_0x11a482[_0xd01c('0x1d')]=_0x327a22;if(_0x14aa2b[_0xd01c('0x2c')][_0xd01c('0x3b')]){_0x376bdd[_0xd01c('0x3c')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x376bdd);})[_0xd01c('0x22')](function(_0x2522e6){_0x11a482[_0xd01c('0x3d')]=_0x2522e6;return _0x11a482;})[_0xd01c('0x22')](respondWithFilteredResult(_0x5ef73d,_0x376bdd))[_0xd01c('0x3e')](handleError(_0x5ef73d,null));};exports['show']=function(_0x41da31,_0x19a79d){var _0xfb320f={'raw':!![],'where':{'id':_0x41da31[_0xd01c('0x3f')]['id']}},_0x4b3303={};_0x4b3303[_0xd01c('0x2b')]=_[_0xd01c('0x40')](db[_0xd01c('0x28')][_0xd01c('0x29')]);_0x4b3303[_0xd01c('0x2c')]=_[_0xd01c('0x40')](_0x41da31[_0xd01c('0x2c')]);_0x4b3303[_0xd01c('0x34')]=_['intersection'](_0x4b3303[_0xd01c('0x2b')],_0x4b3303['query']);_0xfb320f[_0xd01c('0x2e')]=_[_0xd01c('0x2d')](_0x4b3303[_0xd01c('0x2b')],qs['fields'](_0x41da31[_0xd01c('0x2c')][_0xd01c('0x2f')]));_0xfb320f[_0xd01c('0x2e')]=_0xfb320f[_0xd01c('0x2e')][_0xd01c('0x30')]?_0xfb320f[_0xd01c('0x2e')]:_0x4b3303['model'];if(_0x41da31[_0xd01c('0x2c')]['includeAll']){_0xfb320f[_0xd01c('0x3c')]=[{'all':!![]}];}_0xfb320f=_[_0xd01c('0x36')]({},_0xfb320f,_0x41da31[_0xd01c('0x3a')]);return db[_0xd01c('0x28')][_0xd01c('0x41')](_0xfb320f)[_0xd01c('0x22')](handleEntityNotFound(_0x19a79d,null))['then'](respondWithResult(_0x19a79d,null))[_0xd01c('0x3e')](handleError(_0x19a79d,null));};exports[_0xd01c('0x42')]=function(_0xc9c511,_0x1310f9){return db['FaxApplication'][_0xd01c('0x42')](_0xc9c511[_0xd01c('0x43')],{})[_0xd01c('0x22')](respondWithResult(_0x1310f9,0xc9))[_0xd01c('0x3e')](handleError(_0x1310f9,null));};exports[_0xd01c('0x44')]=function(_0x6ffa87,_0x5537e9){if(_0x6ffa87[_0xd01c('0x43')]['id']){delete _0x6ffa87['body']['id'];}return db[_0xd01c('0x28')][_0xd01c('0x41')]({'where':{'id':_0x6ffa87[_0xd01c('0x3f')]['id']}})[_0xd01c('0x22')](handleEntityNotFound(_0x5537e9,null))[_0xd01c('0x22')](saveUpdates(_0x6ffa87[_0xd01c('0x43')],null))[_0xd01c('0x22')](respondWithResult(_0x5537e9,null))[_0xd01c('0x3e')](handleError(_0x5537e9,null));};exports[_0xd01c('0x23')]=function(_0x337aae,_0x2fc009){return db['FaxApplication']['find']({'where':{'id':_0x337aae['params']['id']}})[_0xd01c('0x22')](handleEntityNotFound(_0x2fc009,null))[_0xd01c('0x22')](removeEntity(_0x2fc009,null))['catch'](handleError(_0x2fc009,null));}; \ No newline at end of file +var _0x19b0=['find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','destroy','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','then','includeAll','findAll','rows','show','params','intersection','include'];(function(_0x46117d,_0x518853){var _0x19fcbf=function(_0x2d9531){while(--_0x2d9531){_0x46117d['push'](_0x46117d['shift']());}};_0x19fcbf(++_0x518853);}(_0x19b0,0x13c));var _0x019b=function(_0x10a75b,_0x964db0){_0x10a75b=_0x10a75b-0x0;var _0x11b369=_0x19b0[_0x10a75b];return _0x11b369;};'use strict';var emlformat=require(_0x019b('0x0'));var rimraf=require(_0x019b('0x1'));var zipdir=require(_0x019b('0x2'));var jsonpatch=require(_0x019b('0x3'));var rp=require(_0x019b('0x4'));var moment=require(_0x019b('0x5'));var BPromise=require(_0x019b('0x6'));var Mustache=require(_0x019b('0x7'));var util=require(_0x019b('0x8'));var path=require(_0x019b('0x9'));var sox=require(_0x019b('0xa'));var csv=require(_0x019b('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x019b('0xc'));var _=require(_0x019b('0xd'));var squel=require('squel');var crypto=require(_0x019b('0xe'));var jsforce=require(_0x019b('0xf'));var deskjs=require(_0x019b('0x10'));var toCsv=require(_0x019b('0xb'));var querystring=require('querystring');var Papa=require(_0x019b('0x11'));var Redis=require(_0x019b('0x12'));var authService=require(_0x019b('0x13'));var qs=require(_0x019b('0x14'));var as=require(_0x019b('0x15'));var hardwareService=require(_0x019b('0x16'));var logger=require(_0x019b('0x17'))('api');var utils=require(_0x019b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x019b('0x19'));var db=require(_0x019b('0x1a'))['db'];function respondWithStatusCode(_0xbb025e,_0x4ac2d4){_0x4ac2d4=_0x4ac2d4||0xcc;return function(_0x4891cd){if(_0x4891cd){return _0xbb025e[_0x019b('0x1b')](_0x4ac2d4);}return _0xbb025e['status'](_0x4ac2d4)[_0x019b('0x1c')]();};}function respondWithResult(_0x2b6cc3,_0x43378d){_0x43378d=_0x43378d||0xc8;return function(_0x22b240){if(_0x22b240){return _0x2b6cc3[_0x019b('0x1d')](_0x43378d)['json'](_0x22b240);}};}function respondWithFilteredResult(_0x2ac1f2,_0x520547){return function(_0x170b9f){if(_0x170b9f){var _0x4c043a=typeof _0x520547[_0x019b('0x1e')]==='undefined'&&typeof _0x520547[_0x019b('0x1f')]===_0x019b('0x20');var _0x2a0e5e=_0x170b9f[_0x019b('0x21')];var _0x497daa=_0x4c043a?0x0:_0x520547[_0x019b('0x1e')];var _0x43ebb0=_0x4c043a?_0x170b9f['count']:_0x520547['offset']+_0x520547[_0x019b('0x1f')];var _0x2980c7;if(_0x43ebb0>=_0x2a0e5e){_0x43ebb0=_0x2a0e5e;_0x2980c7=0xc8;}else{_0x2980c7=0xce;}_0x2ac1f2[_0x019b('0x1d')](_0x2980c7);return _0x2ac1f2[_0x019b('0x22')](_0x019b('0x23'),_0x497daa+'-'+_0x43ebb0+'/'+_0x2a0e5e)[_0x019b('0x24')](_0x170b9f);}return null;};}function patchUpdates(_0x68e158){return function(_0x3d6ec3){try{jsonpatch[_0x019b('0x25')](_0x3d6ec3,_0x68e158,!![]);}catch(_0x37a246){return BPromise[_0x019b('0x26')](_0x37a246);}return _0x3d6ec3['save']();};}function saveUpdates(_0xe043a9,_0x7ac094){return function(_0x24f0bf){if(_0x24f0bf){return _0x24f0bf[_0x019b('0x27')](_0xe043a9)['then'](function(_0x49b060){return _0x49b060;});}return null;};}function removeEntity(_0x22f1d2,_0x2fe5d1){return function(_0x310a42){if(_0x310a42){return _0x310a42[_0x019b('0x28')]()['then'](function(){_0x22f1d2[_0x019b('0x1d')](0xcc)[_0x019b('0x1c')]();});}};}function handleEntityNotFound(_0x62aa3a,_0x1b209e){return function(_0x27c165){if(!_0x27c165){_0x62aa3a[_0x019b('0x1b')](0x194);}return _0x27c165;};}function handleError(_0x9cf213,_0x5c4325){_0x5c4325=_0x5c4325||0x1f4;return function(_0x2d4c8c){logger['error'](_0x2d4c8c[_0x019b('0x29')]);if(_0x2d4c8c[_0x019b('0x2a')]){delete _0x2d4c8c[_0x019b('0x2a')];}_0x9cf213[_0x019b('0x1d')](_0x5c4325)[_0x019b('0x2b')](_0x2d4c8c);};}exports[_0x019b('0x2c')]=function(_0x461afa,_0x130b38){var _0x40e1d6={},_0xe87599={},_0x4cab43={'count':0x0,'rows':[]};var _0x3727a2=_[_0x019b('0x2d')](db[_0x019b('0x2e')][_0x019b('0x2f')],function(_0x5e47a7){return{'name':_0x5e47a7[_0x019b('0x30')],'type':_0x5e47a7[_0x019b('0x31')][_0x019b('0x32')]};});_0xe87599[_0x019b('0x33')]=_[_0x019b('0x2d')](_0x3727a2,_0x019b('0x2a'));_0xe87599[_0x019b('0x34')]=_[_0x019b('0x35')](_0x461afa[_0x019b('0x34')]);_0xe87599[_0x019b('0x36')]=_['intersection'](_0xe87599[_0x019b('0x33')],_0xe87599[_0x019b('0x34')]);_0x40e1d6[_0x019b('0x37')]=_['intersection'](_0xe87599[_0x019b('0x33')],qs[_0x019b('0x38')](_0x461afa['query'][_0x019b('0x38')]));_0x40e1d6[_0x019b('0x37')]=_0x40e1d6[_0x019b('0x37')][_0x019b('0x39')]?_0x40e1d6[_0x019b('0x37')]:_0xe87599['model'];if(!_0x461afa[_0x019b('0x34')]['hasOwnProperty'](_0x019b('0x3a'))){_0x40e1d6[_0x019b('0x1f')]=qs[_0x019b('0x1f')](_0x461afa['query'][_0x019b('0x1f')]);_0x40e1d6[_0x019b('0x1e')]=qs[_0x019b('0x1e')](_0x461afa[_0x019b('0x34')][_0x019b('0x1e')]);}_0x40e1d6[_0x019b('0x3b')]=qs[_0x019b('0x3c')](_0x461afa[_0x019b('0x34')][_0x019b('0x3c')]);_0x40e1d6[_0x019b('0x3d')]=qs[_0x019b('0x36')](_[_0x019b('0x3e')](_0x461afa[_0x019b('0x34')],_0xe87599[_0x019b('0x36')]),_0x3727a2);if(_0x461afa[_0x019b('0x34')]['filter']){_0x40e1d6['where']=_[_0x019b('0x3f')](_0x40e1d6[_0x019b('0x3d')],{'$or':_[_0x019b('0x2d')](_0x3727a2,function(_0x2a4463){if(_0x2a4463['type']!==_0x019b('0x40')){var _0x3b9b9a={};_0x3b9b9a[_0x2a4463[_0x019b('0x2a')]]={'$like':'%'+_0x461afa[_0x019b('0x34')]['filter']+'%'};return _0x3b9b9a;}})});}_0x40e1d6=_[_0x019b('0x3f')]({},_0x40e1d6,_0x461afa[_0x019b('0x41')]);var _0x3f3f5a={'where':_0x40e1d6[_0x019b('0x3d')]};return db[_0x019b('0x2e')][_0x019b('0x21')](_0x3f3f5a)[_0x019b('0x42')](function(_0x31a344){_0x4cab43[_0x019b('0x21')]=_0x31a344;if(_0x461afa[_0x019b('0x34')][_0x019b('0x43')]){_0x40e1d6['include']=[{'all':!![]}];}return db['FaxApplication'][_0x019b('0x44')](_0x40e1d6);})['then'](function(_0x48d702){_0x4cab43[_0x019b('0x45')]=_0x48d702;return _0x4cab43;})[_0x019b('0x42')](respondWithFilteredResult(_0x130b38,_0x40e1d6))['catch'](handleError(_0x130b38,null));};exports[_0x019b('0x46')]=function(_0x24c498,_0x30cf9f){var _0xcff8c4={'raw':!![],'where':{'id':_0x24c498[_0x019b('0x47')]['id']}},_0x5519cc={};_0x5519cc['model']=_[_0x019b('0x35')](db[_0x019b('0x2e')]['rawAttributes']);_0x5519cc[_0x019b('0x34')]=_[_0x019b('0x35')](_0x24c498[_0x019b('0x34')]);_0x5519cc[_0x019b('0x36')]=_[_0x019b('0x48')](_0x5519cc['model'],_0x5519cc[_0x019b('0x34')]);_0xcff8c4[_0x019b('0x37')]=_[_0x019b('0x48')](_0x5519cc[_0x019b('0x33')],qs['fields'](_0x24c498[_0x019b('0x34')][_0x019b('0x38')]));_0xcff8c4[_0x019b('0x37')]=_0xcff8c4[_0x019b('0x37')][_0x019b('0x39')]?_0xcff8c4[_0x019b('0x37')]:_0x5519cc[_0x019b('0x33')];if(_0x24c498[_0x019b('0x34')][_0x019b('0x43')]){_0xcff8c4[_0x019b('0x49')]=[{'all':!![]}];}_0xcff8c4=_['merge']({},_0xcff8c4,_0x24c498[_0x019b('0x41')]);return db[_0x019b('0x2e')][_0x019b('0x4a')](_0xcff8c4)['then'](handleEntityNotFound(_0x30cf9f,null))[_0x019b('0x42')](respondWithResult(_0x30cf9f,null))['catch'](handleError(_0x30cf9f,null));};exports[_0x019b('0x4b')]=function(_0x4a016a,_0x566d02){return db[_0x019b('0x2e')]['create'](_0x4a016a[_0x019b('0x4c')],{})[_0x019b('0x42')](respondWithResult(_0x566d02,0xc9))[_0x019b('0x4d')](handleError(_0x566d02,null));};exports[_0x019b('0x27')]=function(_0x428e78,_0x14a646){if(_0x428e78['body']['id']){delete _0x428e78[_0x019b('0x4c')]['id'];}return db[_0x019b('0x2e')][_0x019b('0x4a')]({'where':{'id':_0x428e78['params']['id']}})[_0x019b('0x42')](handleEntityNotFound(_0x14a646,null))[_0x019b('0x42')](saveUpdates(_0x428e78[_0x019b('0x4c')],null))[_0x019b('0x42')](respondWithResult(_0x14a646,null))[_0x019b('0x4d')](handleError(_0x14a646,null));};exports[_0x019b('0x28')]=function(_0x2e458f,_0x4e1775){return db[_0x019b('0x2e')][_0x019b('0x4a')]({'where':{'id':_0x2e458f[_0x019b('0x47')]['id']}})[_0x019b('0x42')](handleEntityNotFound(_0x4e1775,null))[_0x019b('0x42')](removeEntity(_0x4e1775,null))[_0x019b('0x4d')](handleError(_0x4e1775,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 7e7d34c..facfd6e 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 _0x3f00=['fax_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./faxApplication.attributes','exports','FaxApplication'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x3f00,0x1a2));var _0x03f0=function(_0x17371c,_0x1a1e9c){_0x17371c=_0x17371c-0x0;var _0x422265=_0x3f00[_0x17371c];return _0x422265;};'use strict';var _=require(_0x03f0('0x0'));var util=require(_0x03f0('0x1'));var logger=require(_0x03f0('0x2'))(_0x03f0('0x3'));var moment=require(_0x03f0('0x4'));var BPromise=require(_0x03f0('0x5'));var rp=require(_0x03f0('0x6'));var fs=require('fs');var path=require(_0x03f0('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x03f0('0x8'));module[_0x03f0('0x9')]=function(_0x394dca,_0x473d86){return _0x394dca['define'](_0x03f0('0xa'),attributes,{'tableName':_0x03f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x03f0('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xffb3=['util','../../config/logger','api','moment','bluebird','request-promise','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4','lodash'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xffb3,0x1d3));var _0x3ffb=function(_0x1ee950,_0x3cf36e){_0x1ee950=_0x1ee950-0x0;var _0x3b046b=_0xffb3[_0x1ee950];return _0x3b046b;};'use strict';var _=require(_0x3ffb('0x0'));var util=require(_0x3ffb('0x1'));var logger=require(_0x3ffb('0x2'))(_0x3ffb('0x3'));var moment=require(_0x3ffb('0x4'));var BPromise=require(_0x3ffb('0x5'));var rp=require(_0x3ffb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3ffb('0x7'));module[_0x3ffb('0x8')]=function(_0x3b1b7f,_0x553898){return _0x3b1b7f['define'](_0x3ffb('0x9'),attributes,{'tableName':_0x3ffb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3ffb('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index aa20c61..cfa9f87 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 _0x28fa=['jayson/promise','client','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxApplication','update','options','raw','where','attributes','limit','UpdateFaxApplication','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0xfc444f,_0x5281c7){var _0x126d39=function(_0x271ea5){while(--_0x271ea5){_0xfc444f['push'](_0xfc444f['shift']());}};_0x126d39(++_0x5281c7);}(_0x28fa,0x12e));var _0xa28f=function(_0x51c832,_0x25aebc){_0x51c832=_0x51c832-0x0;var _0x57608d=_0x28fa[_0x51c832];return _0x57608d;};'use strict';var _=require(_0xa28f('0x0'));var util=require(_0xa28f('0x1'));var moment=require('moment');var BPromise=require(_0xa28f('0x2'));var rs=require(_0xa28f('0x3'));var fs=require('fs');var Redis=require(_0xa28f('0x4'));var db=require(_0xa28f('0x5'))['db'];var utils=require(_0xa28f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa28f('0x7'));var jayson=require(_0xa28f('0x8'));var client=jayson[_0xa28f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cd24a,_0x49730c,_0x40dbc7){return new BPromise(function(_0x1e2189,_0x2290a2){return client[_0xa28f('0xa')](_0x2cd24a,_0x40dbc7)[_0xa28f('0xb')](function(_0x433e3f){logger[_0xa28f('0xc')](_0xa28f('0xd'),_0x49730c,_0xa28f('0xe'));logger[_0xa28f('0xf')](_0xa28f('0x10'),_0x49730c,_0xa28f('0xe'),JSON[_0xa28f('0x11')](_0x433e3f));if(_0x433e3f[_0xa28f('0x12')]){if(_0x433e3f['error'][_0xa28f('0x13')]===0x1f4){logger[_0xa28f('0x12')](_0xa28f('0xd'),_0x49730c,_0x433e3f['error'][_0xa28f('0x14')]);return _0x2290a2(_0x433e3f[_0xa28f('0x12')][_0xa28f('0x14')]);}logger[_0xa28f('0x12')](_0xa28f('0xd'),_0x49730c,_0x433e3f[_0xa28f('0x12')][_0xa28f('0x14')]);return _0x1e2189(_0x433e3f[_0xa28f('0x12')]['message']);}else{logger[_0xa28f('0xc')](_0xa28f('0xd'),_0x49730c,_0xa28f('0xe'));_0x1e2189(_0x433e3f[_0xa28f('0x15')][_0xa28f('0x14')]);}})[_0xa28f('0x16')](function(_0x36ba66){logger[_0xa28f('0x12')]('FaxApplication,\x20%s,\x20%s',_0x49730c,_0x36ba66);_0x2290a2(_0x36ba66);});});}exports['UpdateFaxApplication']=function(_0x3bf5fd){var _0x4c6cf9=this;return new Promise(function(_0x1fac00,_0x2ff087){return db[_0xa28f('0x17')][_0xa28f('0x18')](_0x3bf5fd['body'],{'raw':_0x3bf5fd[_0xa28f('0x19')]?_0x3bf5fd['options'][_0xa28f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bf5fd[_0xa28f('0x19')]?_0x3bf5fd['options'][_0xa28f('0x1b')]||null:null,'attributes':_0x3bf5fd['options']?_0x3bf5fd[_0xa28f('0x19')][_0xa28f('0x1c')]||null:null,'limit':_0x3bf5fd[_0xa28f('0x19')]?_0x3bf5fd[_0xa28f('0x19')][_0xa28f('0x1d')]||null:null})[_0xa28f('0xb')](function(_0x516037){logger[_0xa28f('0xc')](_0xa28f('0x1e'),_0x3bf5fd);logger[_0xa28f('0xf')](_0xa28f('0x1e'),_0x3bf5fd,JSON[_0xa28f('0x11')](_0x516037));_0x1fac00(_0x516037);})['catch'](function(_0x5ecd86){logger['error'](_0xa28f('0x1e'),_0x5ecd86[_0xa28f('0x14')],_0x3bf5fd);_0x2ff087(_0x4c6cf9[_0xa28f('0x12')](0x1f4,_0x5ecd86[_0xa28f('0x14')]));});});}; \ No newline at end of file +var _0xd671=['client','http','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','attributes','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xd671,0x172));var _0x1d67=function(_0x1e5b8b,_0x4937be){_0x1e5b8b=_0x1e5b8b-0x0;var _0x59393f=_0xd671[_0x1e5b8b];return _0x59393f;};'use strict';var _=require(_0x1d67('0x0'));var util=require(_0x1d67('0x1'));var moment=require(_0x1d67('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d67('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d67('0x4'));var logger=require(_0x1d67('0x5'))(_0x1d67('0x6'));var config=require('../../config/environment');var jayson=require(_0x1d67('0x7'));var client=jayson[_0x1d67('0x8')][_0x1d67('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3568e6,_0x2b7229,_0x525169){return new BPromise(function(_0x3f5f95,_0x34512d){return client['request'](_0x3568e6,_0x525169)['then'](function(_0x9281eb){logger[_0x1d67('0xa')](_0x1d67('0xb'),_0x2b7229,_0x1d67('0xc'));logger[_0x1d67('0xd')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x2b7229,_0x1d67('0xc'),JSON[_0x1d67('0xe')](_0x9281eb));if(_0x9281eb[_0x1d67('0xf')]){if(_0x9281eb['error'][_0x1d67('0x10')]===0x1f4){logger[_0x1d67('0xf')](_0x1d67('0xb'),_0x2b7229,_0x9281eb[_0x1d67('0xf')][_0x1d67('0x11')]);return _0x34512d(_0x9281eb[_0x1d67('0xf')][_0x1d67('0x11')]);}logger[_0x1d67('0xf')]('FaxApplication,\x20%s,\x20%s',_0x2b7229,_0x9281eb[_0x1d67('0xf')]['message']);return _0x3f5f95(_0x9281eb[_0x1d67('0xf')][_0x1d67('0x11')]);}else{logger['info'](_0x1d67('0xb'),_0x2b7229,_0x1d67('0xc'));_0x3f5f95(_0x9281eb[_0x1d67('0x12')][_0x1d67('0x11')]);}})[_0x1d67('0x13')](function(_0x5035b1){logger[_0x1d67('0xf')](_0x1d67('0xb'),_0x2b7229,_0x5035b1);_0x34512d(_0x5035b1);});});}exports[_0x1d67('0x14')]=function(_0x20d5d9){var _0x321f5b=this;return new Promise(function(_0x1fcd9f,_0x295306){return db[_0x1d67('0x15')][_0x1d67('0x16')](_0x20d5d9[_0x1d67('0x17')],{'raw':_0x20d5d9[_0x1d67('0x18')]?_0x20d5d9[_0x1d67('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20d5d9[_0x1d67('0x18')]?_0x20d5d9['options']['where']||null:null,'attributes':_0x20d5d9['options']?_0x20d5d9[_0x1d67('0x18')][_0x1d67('0x19')]||null:null,'limit':_0x20d5d9[_0x1d67('0x18')]?_0x20d5d9['options']['limit']||null:null})[_0x1d67('0x1a')](function(_0xed967b){logger[_0x1d67('0xa')](_0x1d67('0x14'),_0x20d5d9);logger[_0x1d67('0xd')](_0x1d67('0x14'),_0x20d5d9,JSON[_0x1d67('0xe')](_0xed967b));_0x1fcd9f(_0xed967b);})[_0x1d67('0x13')](function(_0x1b3d3f){logger[_0x1d67('0xf')](_0x1d67('0x14'),_0x1b3d3f[_0x1d67('0x11')],_0x20d5d9);_0x295306(_0x321f5b[_0x1d67('0xf')](0x1f4,_0x1b3d3f[_0x1d67('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 39fc341..d3cb5ad 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 _0xefda=['post','create','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xefda,0x96));var _0xaefd=function(_0x4bc5d2,_0x32286c){_0x4bc5d2=_0x4bc5d2-0x0;var _0x322e78=_0xefda[_0x4bc5d2];return _0x322e78;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['show']);router[_0xaefd('0xc')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaefd('0xe')]);router[_0xaefd('0xf')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x10')]);module[_0xaefd('0x11')]=router; \ No newline at end of file +var _0xb688=['show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xb688,0xcf));var _0x8b68=function(_0x5131e3,_0x42afa0){_0x5131e3=_0x5131e3-0x0;var _0x4cb7ce=_0xb688[_0x5131e3];return _0x4cb7ce;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0xe')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x10')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 9422678..ab8ad8e 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 _0x4325=['sequelize','exports','DATE','STRING','ENUM','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4325,0x1da));var _0x5432=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4325[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x5432('0x0'));module[_0x5432('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5432('0x2')]},'disposition':{'type':Sequelize[_0x5432('0x3')]},'secondDisposition':{'type':Sequelize[_0x5432('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x5432('0x2')]},'fax':{'type':Sequelize[_0x5432('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x5432('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5432('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x5432('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x5432('0x5')]}}; \ No newline at end of file +var _0x3a6d=['exports','DATE','STRING','ENUM','out','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a6d,0x143));var _0xd3a6=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x3a6d[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0xd3a6('0x0'));module[_0xd3a6('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd3a6('0x2')]},'disposition':{'type':Sequelize[_0xd3a6('0x3')]},'secondDisposition':{'type':Sequelize[_0xd3a6('0x3')]},'thirdDisposition':{'type':Sequelize[_0xd3a6('0x3')]},'note':{'type':Sequelize[_0xd3a6('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xd3a6('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xd3a6('0x4')]('in',_0xd3a6('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd3a6('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xd3a6('0x4')]('in',_0xd3a6('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index d90bd16..bb9b3f2 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 _0x43e9=['model','query','keys','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','create','body','describe','addMessage','FaxMessage','ids','omit','findOne','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','color','emit','faxInteractionTags:save','download','unix','join','root','server','tmp','attachments','push','Attachment','Messages','createdAt','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','undefined','count','offset','Content-Range','update','then','destroy','error','name','send','index','map','FaxInteraction','rawAttributes','type','key','findAll','user','show','params'];(function(_0xd1a252,_0x16396f){var _0x560ee1=function(_0x35dd90){while(--_0x35dd90){_0xd1a252['push'](_0xd1a252['shift']());}};_0x560ee1(++_0x16396f);}(_0x43e9,0x165));var _0x943e=function(_0x35b2a3,_0x29552e){_0x35b2a3=_0x35b2a3-0x0;var _0xa9094c=_0x43e9[_0x35b2a3];return _0xa9094c;};'use strict';var rimraf=require(_0x943e('0x0'));var zipdir=require(_0x943e('0x1'));var moment=require(_0x943e('0x2'));var BPromise=require(_0x943e('0x3'));var util=require(_0x943e('0x4'));var path=require(_0x943e('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x943e('0x6'));var logger=require(_0x943e('0x7'))(_0x943e('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x943e('0x9')]=_[_0x943e('0xa')](config[_0x943e('0x9')],{'host':_0x943e('0xb'),'port':0x18eb});var socket=require(_0x943e('0xc'))(new Redis(config['redis']));require(_0x943e('0xd'))[_0x943e('0xe')](socket);function respondWithStatusCode(_0x3474b0,_0x104b2c){_0x104b2c=_0x104b2c||0xcc;return function(_0xe1904){if(_0xe1904){return _0x3474b0[_0x943e('0xf')](_0x104b2c);}return _0x3474b0[_0x943e('0x10')](_0x104b2c)[_0x943e('0x11')]();};}function respondWithResult(_0x323470,_0x1cc622){_0x1cc622=_0x1cc622||0xc8;return function(_0x3a5fdb){if(_0x3a5fdb){return _0x323470['status'](_0x1cc622)[_0x943e('0x12')](_0x3a5fdb);}};}function respondWithFilteredResult(_0x4361aa,_0x133ac4){return function(_0x244abb){if(_0x244abb){var _0x56d7db=typeof _0x133ac4['offset']===_0x943e('0x13')&&typeof _0x133ac4['limit']==='undefined';var _0x29ffba=_0x244abb[_0x943e('0x14')];var _0x4615a9=_0x56d7db?0x0:_0x133ac4['offset'];var _0xeac261=_0x56d7db?_0x244abb[_0x943e('0x14')]:_0x133ac4[_0x943e('0x15')]+_0x133ac4['limit'];var _0x5c9ddb;if(_0xeac261>=_0x29ffba){_0xeac261=_0x29ffba;_0x5c9ddb=0xc8;}else{_0x5c9ddb=0xce;}_0x4361aa[_0x943e('0x10')](_0x5c9ddb);return _0x4361aa['set'](_0x943e('0x16'),_0x4615a9+'-'+_0xeac261+'/'+_0x29ffba)[_0x943e('0x12')](_0x244abb);}return null;};}function saveUpdates(_0x5d2d10){return function(_0x51ce28){if(_0x51ce28){return _0x51ce28[_0x943e('0x17')](_0x5d2d10)[_0x943e('0x18')](function(_0x1e2478){return _0x1e2478;});}return null;};}function removeEntity(_0x2440b6){return function(_0x5d64dd){if(_0x5d64dd){return _0x5d64dd[_0x943e('0x19')]()[_0x943e('0x18')](function(){_0x2440b6[_0x943e('0x10')](0xcc)[_0x943e('0x11')]();});}};}function handleEntityNotFound(_0x14948c){return function(_0x393857){if(!_0x393857){_0x14948c[_0x943e('0xf')](0x194);}return _0x393857;};}function handleError(_0x5ebd54,_0x4a442f){_0x4a442f=_0x4a442f||0x1f4;return function(_0xf273f1){logger[_0x943e('0x1a')](_0xf273f1['stack']);if(_0xf273f1[_0x943e('0x1b')]){delete _0xf273f1[_0x943e('0x1b')];}_0x5ebd54['status'](_0x4a442f)[_0x943e('0x1c')](_0xf273f1);};}exports[_0x943e('0x1d')]=function(_0x1f62bc,_0x10e8e9){var _0x186901={};var _0x2831a1=_[_0x943e('0x1e')](db[_0x943e('0x1f')][_0x943e('0x20')],function(_0x9dd8a6){return{'name':_0x9dd8a6['fieldName'],'type':_0x9dd8a6[_0x943e('0x21')][_0x943e('0x22')]};});_0x186901=qs['getOptions'](_0x2831a1,_0x1f62bc);return interaction[_0x943e('0x23')]('fax',_0x1f62bc['query'],_0x1f62bc[_0x943e('0x24')],_0x186901,_0x2831a1)[_0x943e('0x18')](respondWithFilteredResult(_0x10e8e9,_0x186901))['catch'](handleError(_0x10e8e9,null));};exports[_0x943e('0x25')]=function(_0x3fcd76,_0x1cae1d){var _0x471fe6={'raw':![],'where':{'id':_0x3fcd76[_0x943e('0x26')]['id']}},_0xa2b205={};_0xa2b205[_0x943e('0x27')]=_['keys'](db[_0x943e('0x1f')][_0x943e('0x20')]);_0xa2b205[_0x943e('0x28')]=_[_0x943e('0x29')](_0x3fcd76[_0x943e('0x28')]);_0xa2b205['filters']=_[_0x943e('0x2a')](_0xa2b205[_0x943e('0x27')],_0xa2b205[_0x943e('0x28')]);_0x471fe6['attributes']=_[_0x943e('0x2a')](_0xa2b205[_0x943e('0x27')],qs[_0x943e('0x2b')](_0x3fcd76[_0x943e('0x28')][_0x943e('0x2b')]));_0x471fe6[_0x943e('0x2c')]=_0x471fe6['attributes'][_0x943e('0x2d')]?_0x471fe6[_0x943e('0x2c')]:_0xa2b205[_0x943e('0x27')];if(_0x3fcd76[_0x943e('0x28')][_0x943e('0x2e')]){_0x471fe6[_0x943e('0x2f')]=[{'all':!![]}];}_0x471fe6=_[_0x943e('0x30')]({},_0x471fe6,_0x3fcd76[_0x943e('0x31')]);return db[_0x943e('0x1f')][_0x943e('0x32')](_0x471fe6)[_0x943e('0x18')](handleEntityNotFound(_0x1cae1d,null))[_0x943e('0x18')](respondWithResult(_0x1cae1d,null))[_0x943e('0x33')](handleError(_0x1cae1d,null));};exports[_0x943e('0x34')]=function(_0x2ca90b,_0x5e0211){return db[_0x943e('0x1f')][_0x943e('0x34')](_0x2ca90b[_0x943e('0x35')],{})[_0x943e('0x18')](respondWithResult(_0x5e0211,0xc9))[_0x943e('0x33')](handleError(_0x5e0211,null));};exports['update']=function(_0x46688a,_0x540b12){if(_0x46688a[_0x943e('0x35')]['id']){delete _0x46688a['body']['id'];}return db[_0x943e('0x1f')][_0x943e('0x32')]({'where':{'id':_0x46688a[_0x943e('0x26')]['id']}})[_0x943e('0x18')](handleEntityNotFound(_0x540b12,null))[_0x943e('0x18')](saveUpdates(_0x46688a[_0x943e('0x35')],null))[_0x943e('0x18')](respondWithResult(_0x540b12,null))[_0x943e('0x33')](handleError(_0x540b12,null));};exports['destroy']=function(_0x358777,_0x471660){return db['FaxInteraction']['find']({'where':{'id':_0x358777['params']['id']}})[_0x943e('0x18')](handleEntityNotFound(_0x471660,null))[_0x943e('0x18')](removeEntity(_0x471660,null))[_0x943e('0x33')](handleError(_0x471660,null));};exports[_0x943e('0x36')]=function(_0x412ef1,_0x3069c4){return db[_0x943e('0x1f')][_0x943e('0x36')]()[_0x943e('0x18')](respondWithResult(_0x3069c4,null))['catch'](handleError(_0x3069c4,null));};exports[_0x943e('0x37')]=function(_0x512b0f,_0x4327b6){return db[_0x943e('0x38')][_0x943e('0x32')]({'where':{'id':_0x512b0f[_0x943e('0x26')]['id']}})[_0x943e('0x18')](handleEntityNotFound(_0x4327b6,null))['then'](function(_0x8689ba){if(_0x8689ba){return _0x8689ba[_0x943e('0x37')](_0x512b0f[_0x943e('0x35')][_0x943e('0x39')],_[_0x943e('0x3a')](_0x512b0f['body'],[_0x943e('0x39'),'id'])||{});}})[_0x943e('0x18')](respondWithResult(_0x4327b6,null))['catch'](handleError(_0x4327b6,null));};exports['getMessages']=function(_0x245f30,_0x156a12){var _0x4115c3={'raw':![],'where':{}};var _0x4af0dc={};var _0x1d4d91={'count':0x0,'rows':[]};return db[_0x943e('0x1f')][_0x943e('0x3b')]({'where':{'id':_0x245f30[_0x943e('0x26')]['id']}})[_0x943e('0x18')](handleEntityNotFound(_0x156a12,null))[_0x943e('0x18')](function(_0x4f0281){if(_0x4f0281){_0x4af0dc[_0x943e('0x27')]=_[_0x943e('0x29')](db[_0x943e('0x38')][_0x943e('0x20')]);_0x4af0dc[_0x943e('0x28')]=_[_0x943e('0x29')](_0x245f30[_0x943e('0x28')]);_0x4af0dc['filters']=_['intersection'](_0x4af0dc['model'],_0x4af0dc[_0x943e('0x28')]);_0x4115c3[_0x943e('0x2c')]=_[_0x943e('0x2a')](_0x4af0dc[_0x943e('0x27')],qs[_0x943e('0x2b')](_0x245f30[_0x943e('0x28')][_0x943e('0x2b')]));_0x4115c3[_0x943e('0x2c')]=_0x4115c3[_0x943e('0x2c')]['length']?_0x4115c3[_0x943e('0x2c')]:_0x4af0dc[_0x943e('0x27')];if(!_0x245f30[_0x943e('0x28')][_0x943e('0x3c')](_0x943e('0x3d'))){_0x4115c3[_0x943e('0x3e')]=qs[_0x943e('0x3e')](_0x245f30['query'][_0x943e('0x3e')]);_0x4115c3[_0x943e('0x15')]=qs[_0x943e('0x15')](_0x245f30[_0x943e('0x28')]['offset']);}_0x4115c3[_0x943e('0x3f')]=qs[_0x943e('0x40')](_0x245f30[_0x943e('0x28')][_0x943e('0x40')]);_0x4115c3[_0x943e('0x41')]=qs[_0x943e('0x42')](_[_0x943e('0x43')](_0x245f30[_0x943e('0x28')],_0x4af0dc[_0x943e('0x42')]));_0x4115c3['where']['FaxInteractionId']=_0x4f0281['id'];if(_0x245f30[_0x943e('0x28')]['filter']){_0x4115c3[_0x943e('0x41')]=_[_0x943e('0x30')](_0x4115c3[_0x943e('0x41')],{'$or':_['map'](_0x4115c3[_0x943e('0x2c')],function(_0x59b22e){var _0x46c1af={};_0x46c1af[_0x59b22e]={'$like':'%'+_0x245f30[_0x943e('0x28')][_0x943e('0x44')]+'%'};return _0x46c1af;})});}if(_0x245f30[_0x943e('0x28')]['$gte']){var _0x59a7d6=_0x245f30[_0x943e('0x28')][_0x943e('0x45')]['split'](',');var _0x3e3a44={};_0x3e3a44[_0x59a7d6[0x0]]={'$gte':moment(_0x59a7d6[0x1])[_0x943e('0x46')](_0x943e('0x47'))};_0x4115c3[_0x943e('0x41')]=_[_0x943e('0x30')](_0x4115c3[_0x943e('0x41')],_0x3e3a44);}_0x4115c3=_[_0x943e('0x30')]({},_0x4115c3,_0x245f30[_0x943e('0x31')]);return db[_0x943e('0x38')]['count']({'where':_0x4115c3[_0x943e('0x41')]})[_0x943e('0x18')](function(_0x22fe5e){_0x1d4d91[_0x943e('0x14')]=_0x22fe5e;if(_0x245f30['query'][_0x943e('0x2e')]){_0x4115c3[_0x943e('0x2f')]=[{'all':!![]}];}return db[_0x943e('0x38')][_0x943e('0x23')](_0x4115c3);})[_0x943e('0x18')](function(_0x2f1fff){_0x1d4d91[_0x943e('0x48')]=_0x2f1fff;return _0x1d4d91;});}})[_0x943e('0x18')](respondWithFilteredResult(_0x156a12,_0x4115c3))['catch'](handleError(_0x156a12,null));};exports[_0x943e('0x49')]=function(_0x4f297a,_0x4ec63c){return db[_0x943e('0x1f')][_0x943e('0x32')]({'where':{'id':_0x4f297a['params']['id']}})[_0x943e('0x18')](handleEntityNotFound(_0x4ec63c,null))[_0x943e('0x18')](function(_0x12f213){if(_0x12f213){return _0x12f213[_0x943e('0x4a')](_0x4f297a['body']['ids'],_[_0x943e('0x3a')](_0x4f297a[_0x943e('0x35')],['ids','id'])||{})['spread'](function(){return db['Tag'][_0x943e('0x23')]({'attributes':['id',_0x943e('0x1b'),_0x943e('0x4b')],'where':{'id':_0x4f297a[_0x943e('0x35')]['ids']}});})[_0x943e('0x18')](function(_0x5f1be8){socket[_0x943e('0x4c')](_0x943e('0x4d'),{'id':Number(_0x4f297a[_0x943e('0x26')]['id']),'tags':_0x5f1be8||[]});return{'id':Number(_0x4f297a[_0x943e('0x26')]['id']),'tags':_0x5f1be8||[]};});}})['then'](respondWithResult(_0x4ec63c,null))[_0x943e('0x33')](handleError(_0x4ec63c,null));};exports['removeTags']=function(_0x340fe8,_0x183698){return db[_0x943e('0x1f')][_0x943e('0x32')]({'where':{'id':_0x340fe8['params']['id']}})['then'](handleEntityNotFound(_0x183698,null))[_0x943e('0x18')](function(_0x5d0873){if(_0x5d0873){return _0x5d0873['removeTags'](_0x340fe8[_0x943e('0x28')][_0x943e('0x39')]);}})[_0x943e('0x18')](respondWithStatusCode(_0x183698,null))[_0x943e('0x33')](handleError(_0x183698,null));};exports[_0x943e('0x4e')]=function(_0x599682,_0x467de2){var _0x15092d=moment()[_0x943e('0x4f')]()['toString']();var _0x141d51=path[_0x943e('0x50')](config[_0x943e('0x51')],_0x943e('0x52'),'files',_0x943e('0x53'));var _0x2bb181=path[_0x943e('0x50')](config['root'],'server','files',_0x943e('0x54'));var _0xbf6ae5=path[_0x943e('0x50')](_0x141d51,_0x15092d);var _0x5aed7f=util[_0x943e('0x46')]('transcript-%d-%s.zip',_0x599682['params']['id'],_0x15092d);var _0x443e4d=path[_0x943e('0x50')](_0x141d51,_0x5aed7f);var _0x1eedc8=[];_0x1eedc8[_0x943e('0x55')]({'model':db[_0x943e('0x56')],'as':_0x943e('0x56'),'raw':!![]});var _0x122529=[{'model':db[_0x943e('0x38')],'as':_0x943e('0x57'),'attributes':['id',_0x943e('0x35'),_0x943e('0x58')],'include':_0x1eedc8}];return db[_0x943e('0x1f')][_0x943e('0x32')]({'where':{'id':_0x599682[_0x943e('0x26')]['id']},'include':_0x122529})[_0x943e('0x18')](handleEntityNotFound(_0x467de2,null))[_0x943e('0x18')](function(_0x3ec0b9){if(_0x3ec0b9&&_0x3ec0b9['Messages']){var _0x434fc7=_0x3ec0b9['get']({'plain':!![]});fs[_0x943e('0x59')](_0xbf6ae5);for(var _0x21e725=0x0;_0x21e725<_0x434fc7[_0x943e('0x57')][_0x943e('0x2d')];_0x21e725++){var _0x43760d=_0x434fc7[_0x943e('0x57')][_0x21e725][_0x943e('0x56')];if(_0x43760d){var _0x175e54=path[_0x943e('0x50')](_0x2bb181,_0x43760d[_0x943e('0x5a')]);if(fs[_0x943e('0x5b')](_0x175e54)){fs[_0x943e('0x5c')](_0x175e54)[_0x943e('0x5d')](fs[_0x943e('0x5e')](path['join'](_0xbf6ae5,_0x43760d[_0x943e('0x5a')])));}}}return BPromise[_0x943e('0x5f')]()['then'](function(){return new BPromise(function(_0x70f290,_0x242abf){zipdir(_0xbf6ae5,{'saveTo':_0x443e4d},function(_0x4feeb2,_0x2ef5a5){if(_0x4feeb2)return _0x242abf(_0x4feeb2);return _0x70f290(_0x2ef5a5);});})[_0x943e('0x18')](function(){return new BPromise(function(_0x659171,_0x5e85c2){rimraf(_0xbf6ae5,function(_0x226805){if(_0x226805)_0x5e85c2(_0x226805);return _0x659171();});});})['then'](function(){return _0x467de2['download'](_0x443e4d,_0x5aed7f,function(_0x339bcf){if(_0x339bcf){console[_0x943e('0x60')](_0x943e('0x61'),_0x339bcf);}else{fs[_0x943e('0x62')](_0x443e4d);}});});});}else{return _0x467de2[_0x943e('0xf')](0xc8);}})[_0x943e('0x33')](handleError(_0x467de2,null));}; \ No newline at end of file +var _0x6664=['register','end','json','offset','undefined','limit','count','status','update','then','destroy','error','name','index','map','FaxInteraction','rawAttributes','fieldName','key','getOptions','findAll','fax','user','catch','show','params','model','keys','query','intersection','fields','attributes','includeAll','include','options','find','create','body','describe','FaxMessage','addMessage','ids','omit','getMessages','findOne','filters','length','hasOwnProperty','order','sort','pick','where','FaxInteractionId','filter','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','Tag','color','removeTags','download','unix','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push','Attachment','createdAt','get','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','sendStatus','rimraf','moment','bluebird','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket'];(function(_0x3c55f2,_0x47f857){var _0x43fea0=function(_0x2d61f4){while(--_0x2d61f4){_0x3c55f2['push'](_0x3c55f2['shift']());}};_0x43fea0(++_0x47f857);}(_0x6664,0x1ee));var _0x4666=function(_0x411483,_0x31f734){_0x411483=_0x411483-0x0;var _0x1d769a=_0x6664[_0x411483];return _0x1d769a;};'use strict';var rimraf=require(_0x4666('0x0'));var zipdir=require('zip-dir');var moment=require(_0x4666('0x1'));var BPromise=require(_0x4666('0x2'));var util=require(_0x4666('0x3'));var path=require(_0x4666('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x4666('0x5'));var interaction=require(_0x4666('0x6'));var qs=require(_0x4666('0x7'));var logger=require(_0x4666('0x8'))(_0x4666('0x9'));var config=require(_0x4666('0xa'));var db=require(_0x4666('0xb'))['db'];config[_0x4666('0xc')]=_[_0x4666('0xd')](config[_0x4666('0xc')],{'host':_0x4666('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4666('0xf'))[_0x4666('0x10')](socket);function respondWithStatusCode(_0xcc7c31,_0x2e36f9){_0x2e36f9=_0x2e36f9||0xcc;return function(_0x5b8513){if(_0x5b8513){return _0xcc7c31['sendStatus'](_0x2e36f9);}return _0xcc7c31['status'](_0x2e36f9)[_0x4666('0x11')]();};}function respondWithResult(_0x2c1cf4,_0x2c835a){_0x2c835a=_0x2c835a||0xc8;return function(_0x5cdc7d){if(_0x5cdc7d){return _0x2c1cf4['status'](_0x2c835a)[_0x4666('0x12')](_0x5cdc7d);}};}function respondWithFilteredResult(_0xebe4b,_0x3481e6){return function(_0x419d65){if(_0x419d65){var _0x22bd20=typeof _0x3481e6[_0x4666('0x13')]===_0x4666('0x14')&&typeof _0x3481e6[_0x4666('0x15')]===_0x4666('0x14');var _0x498aa4=_0x419d65[_0x4666('0x16')];var _0x2e8530=_0x22bd20?0x0:_0x3481e6[_0x4666('0x13')];var _0x5997e0=_0x22bd20?_0x419d65['count']:_0x3481e6[_0x4666('0x13')]+_0x3481e6[_0x4666('0x15')];var _0x1131a3;if(_0x5997e0>=_0x498aa4){_0x5997e0=_0x498aa4;_0x1131a3=0xc8;}else{_0x1131a3=0xce;}_0xebe4b[_0x4666('0x17')](_0x1131a3);return _0xebe4b['set']('Content-Range',_0x2e8530+'-'+_0x5997e0+'/'+_0x498aa4)['json'](_0x419d65);}return null;};}function saveUpdates(_0x728d66){return function(_0x3ae963){if(_0x3ae963){return _0x3ae963[_0x4666('0x18')](_0x728d66)[_0x4666('0x19')](function(_0x1ec5db){return _0x1ec5db;});}return null;};}function removeEntity(_0x441f32){return function(_0x3cfed8){if(_0x3cfed8){return _0x3cfed8[_0x4666('0x1a')]()[_0x4666('0x19')](function(){_0x441f32['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dbe9f){return function(_0x465e21){if(!_0x465e21){_0x1dbe9f['sendStatus'](0x194);}return _0x465e21;};}function handleError(_0x4fb2a9,_0x20fd58){_0x20fd58=_0x20fd58||0x1f4;return function(_0x166bb2){logger[_0x4666('0x1b')](_0x166bb2['stack']);if(_0x166bb2[_0x4666('0x1c')]){delete _0x166bb2[_0x4666('0x1c')];}_0x4fb2a9[_0x4666('0x17')](_0x20fd58)['send'](_0x166bb2);};}exports[_0x4666('0x1d')]=function(_0x448282,_0x36dc0f){var _0x43fdda={};var _0x4fb134=_[_0x4666('0x1e')](db[_0x4666('0x1f')][_0x4666('0x20')],function(_0x42df11){return{'name':_0x42df11[_0x4666('0x21')],'type':_0x42df11['type'][_0x4666('0x22')]};});_0x43fdda=qs[_0x4666('0x23')](_0x4fb134,_0x448282);return interaction[_0x4666('0x24')](_0x4666('0x25'),_0x448282['query'],_0x448282[_0x4666('0x26')],_0x43fdda,_0x4fb134)[_0x4666('0x19')](respondWithFilteredResult(_0x36dc0f,_0x43fdda))[_0x4666('0x27')](handleError(_0x36dc0f,null));};exports[_0x4666('0x28')]=function(_0x5c5f0d,_0x20b823){var _0x478a9d={'raw':![],'where':{'id':_0x5c5f0d[_0x4666('0x29')]['id']}},_0x5c8080={};_0x5c8080[_0x4666('0x2a')]=_[_0x4666('0x2b')](db[_0x4666('0x1f')]['rawAttributes']);_0x5c8080[_0x4666('0x2c')]=_['keys'](_0x5c5f0d[_0x4666('0x2c')]);_0x5c8080['filters']=_[_0x4666('0x2d')](_0x5c8080[_0x4666('0x2a')],_0x5c8080[_0x4666('0x2c')]);_0x478a9d['attributes']=_[_0x4666('0x2d')](_0x5c8080[_0x4666('0x2a')],qs[_0x4666('0x2e')](_0x5c5f0d[_0x4666('0x2c')][_0x4666('0x2e')]));_0x478a9d[_0x4666('0x2f')]=_0x478a9d[_0x4666('0x2f')]['length']?_0x478a9d['attributes']:_0x5c8080[_0x4666('0x2a')];if(_0x5c5f0d[_0x4666('0x2c')][_0x4666('0x30')]){_0x478a9d[_0x4666('0x31')]=[{'all':!![]}];}_0x478a9d=_['merge']({},_0x478a9d,_0x5c5f0d[_0x4666('0x32')]);return db[_0x4666('0x1f')][_0x4666('0x33')](_0x478a9d)[_0x4666('0x19')](handleEntityNotFound(_0x20b823,null))[_0x4666('0x19')](respondWithResult(_0x20b823,null))[_0x4666('0x27')](handleError(_0x20b823,null));};exports[_0x4666('0x34')]=function(_0x44efc8,_0x36c053){return db['FaxInteraction'][_0x4666('0x34')](_0x44efc8['body'],{})[_0x4666('0x19')](respondWithResult(_0x36c053,0xc9))[_0x4666('0x27')](handleError(_0x36c053,null));};exports[_0x4666('0x18')]=function(_0x226d30,_0x209220){if(_0x226d30[_0x4666('0x35')]['id']){delete _0x226d30[_0x4666('0x35')]['id'];}return db['FaxInteraction'][_0x4666('0x33')]({'where':{'id':_0x226d30['params']['id']}})[_0x4666('0x19')](handleEntityNotFound(_0x209220,null))[_0x4666('0x19')](saveUpdates(_0x226d30[_0x4666('0x35')],null))[_0x4666('0x19')](respondWithResult(_0x209220,null))[_0x4666('0x27')](handleError(_0x209220,null));};exports[_0x4666('0x1a')]=function(_0x2b72d8,_0x1b6666){return db[_0x4666('0x1f')]['find']({'where':{'id':_0x2b72d8['params']['id']}})[_0x4666('0x19')](handleEntityNotFound(_0x1b6666,null))[_0x4666('0x19')](removeEntity(_0x1b6666,null))[_0x4666('0x27')](handleError(_0x1b6666,null));};exports[_0x4666('0x36')]=function(_0x1650e1,_0x43285f){return db['FaxInteraction'][_0x4666('0x36')]()[_0x4666('0x19')](respondWithResult(_0x43285f,null))[_0x4666('0x27')](handleError(_0x43285f,null));};exports['addMessage']=function(_0x16e711,_0x262ef){return db[_0x4666('0x37')]['find']({'where':{'id':_0x16e711[_0x4666('0x29')]['id']}})[_0x4666('0x19')](handleEntityNotFound(_0x262ef,null))['then'](function(_0x3c4b4e){if(_0x3c4b4e){return _0x3c4b4e[_0x4666('0x38')](_0x16e711['body'][_0x4666('0x39')],_[_0x4666('0x3a')](_0x16e711[_0x4666('0x35')],[_0x4666('0x39'),'id'])||{});}})[_0x4666('0x19')](respondWithResult(_0x262ef,null))['catch'](handleError(_0x262ef,null));};exports[_0x4666('0x3b')]=function(_0x12d563,_0x2551df){var _0xd7ac9b={'raw':![],'where':{}};var _0x20bc12={};var _0x552daa={'count':0x0,'rows':[]};return db[_0x4666('0x1f')][_0x4666('0x3c')]({'where':{'id':_0x12d563[_0x4666('0x29')]['id']}})[_0x4666('0x19')](handleEntityNotFound(_0x2551df,null))[_0x4666('0x19')](function(_0x45d40b){if(_0x45d40b){_0x20bc12[_0x4666('0x2a')]=_[_0x4666('0x2b')](db[_0x4666('0x37')][_0x4666('0x20')]);_0x20bc12[_0x4666('0x2c')]=_[_0x4666('0x2b')](_0x12d563[_0x4666('0x2c')]);_0x20bc12[_0x4666('0x3d')]=_[_0x4666('0x2d')](_0x20bc12[_0x4666('0x2a')],_0x20bc12[_0x4666('0x2c')]);_0xd7ac9b[_0x4666('0x2f')]=_[_0x4666('0x2d')](_0x20bc12[_0x4666('0x2a')],qs[_0x4666('0x2e')](_0x12d563['query'][_0x4666('0x2e')]));_0xd7ac9b[_0x4666('0x2f')]=_0xd7ac9b['attributes'][_0x4666('0x3e')]?_0xd7ac9b[_0x4666('0x2f')]:_0x20bc12[_0x4666('0x2a')];if(!_0x12d563[_0x4666('0x2c')][_0x4666('0x3f')]('nolimit')){_0xd7ac9b['limit']=qs[_0x4666('0x15')](_0x12d563[_0x4666('0x2c')]['limit']);_0xd7ac9b['offset']=qs[_0x4666('0x13')](_0x12d563['query'][_0x4666('0x13')]);}_0xd7ac9b[_0x4666('0x40')]=qs[_0x4666('0x41')](_0x12d563[_0x4666('0x2c')][_0x4666('0x41')]);_0xd7ac9b['where']=qs[_0x4666('0x3d')](_[_0x4666('0x42')](_0x12d563[_0x4666('0x2c')],_0x20bc12[_0x4666('0x3d')]));_0xd7ac9b[_0x4666('0x43')][_0x4666('0x44')]=_0x45d40b['id'];if(_0x12d563[_0x4666('0x2c')][_0x4666('0x45')]){_0xd7ac9b['where']=_[_0x4666('0x46')](_0xd7ac9b[_0x4666('0x43')],{'$or':_[_0x4666('0x1e')](_0xd7ac9b[_0x4666('0x2f')],function(_0x205e82){var _0x15fd9f={};_0x15fd9f[_0x205e82]={'$like':'%'+_0x12d563[_0x4666('0x2c')]['filter']+'%'};return _0x15fd9f;})});}if(_0x12d563['query'][_0x4666('0x47')]){var _0x35d4be=_0x12d563[_0x4666('0x2c')][_0x4666('0x47')]['split'](',');var _0x323b4a={};_0x323b4a[_0x35d4be[0x0]]={'$gte':moment(_0x35d4be[0x1])[_0x4666('0x48')](_0x4666('0x49'))};_0xd7ac9b['where']=_['merge'](_0xd7ac9b[_0x4666('0x43')],_0x323b4a);}_0xd7ac9b=_[_0x4666('0x46')]({},_0xd7ac9b,_0x12d563['options']);return db[_0x4666('0x37')][_0x4666('0x16')]({'where':_0xd7ac9b['where']})[_0x4666('0x19')](function(_0x5b90e0){_0x552daa['count']=_0x5b90e0;if(_0x12d563[_0x4666('0x2c')][_0x4666('0x30')]){_0xd7ac9b[_0x4666('0x31')]=[{'all':!![]}];}return db[_0x4666('0x37')][_0x4666('0x24')](_0xd7ac9b);})[_0x4666('0x19')](function(_0x2c6d21){_0x552daa[_0x4666('0x4a')]=_0x2c6d21;return _0x552daa;});}})['then'](respondWithFilteredResult(_0x2551df,_0xd7ac9b))[_0x4666('0x27')](handleError(_0x2551df,null));};exports[_0x4666('0x4b')]=function(_0x5cf7e7,_0x4490df){return db[_0x4666('0x1f')][_0x4666('0x33')]({'where':{'id':_0x5cf7e7['params']['id']}})[_0x4666('0x19')](handleEntityNotFound(_0x4490df,null))[_0x4666('0x19')](function(_0x3f9c5a){if(_0x3f9c5a){return _0x3f9c5a[_0x4666('0x4c')](_0x5cf7e7[_0x4666('0x35')][_0x4666('0x39')],_[_0x4666('0x3a')](_0x5cf7e7[_0x4666('0x35')],[_0x4666('0x39'),'id'])||{})['spread'](function(){return db[_0x4666('0x4d')][_0x4666('0x24')]({'attributes':['id',_0x4666('0x1c'),_0x4666('0x4e')],'where':{'id':_0x5cf7e7[_0x4666('0x35')][_0x4666('0x39')]}});})[_0x4666('0x19')](function(_0x231fef){socket['emit']('faxInteractionTags:save',{'id':Number(_0x5cf7e7[_0x4666('0x29')]['id']),'tags':_0x231fef||[]});return{'id':Number(_0x5cf7e7[_0x4666('0x29')]['id']),'tags':_0x231fef||[]};});}})[_0x4666('0x19')](respondWithResult(_0x4490df,null))[_0x4666('0x27')](handleError(_0x4490df,null));};exports['removeTags']=function(_0x134a30,_0x13b9b0){return db[_0x4666('0x1f')][_0x4666('0x33')]({'where':{'id':_0x134a30[_0x4666('0x29')]['id']}})[_0x4666('0x19')](handleEntityNotFound(_0x13b9b0,null))[_0x4666('0x19')](function(_0x4efb08){if(_0x4efb08){return _0x4efb08[_0x4666('0x4f')](_0x134a30[_0x4666('0x2c')][_0x4666('0x39')]);}})[_0x4666('0x19')](respondWithStatusCode(_0x13b9b0,null))['catch'](handleError(_0x13b9b0,null));};exports[_0x4666('0x50')]=function(_0x4a1383,_0x15fc3a){var _0x3ec9aa=moment()[_0x4666('0x51')]()['toString']();var _0x32bfb8=path[_0x4666('0x52')](config[_0x4666('0x53')],'server',_0x4666('0x54'),_0x4666('0x55'));var _0x5b6a92=path[_0x4666('0x52')](config['root'],_0x4666('0x56'),_0x4666('0x54'),_0x4666('0x57'));var _0x573b04=path[_0x4666('0x52')](_0x32bfb8,_0x3ec9aa);var _0x583e5e=util[_0x4666('0x48')](_0x4666('0x58'),_0x4a1383['params']['id'],_0x3ec9aa);var _0x26f6cc=path[_0x4666('0x52')](_0x32bfb8,_0x583e5e);var _0x52fae0=[];_0x52fae0[_0x4666('0x59')]({'model':db[_0x4666('0x5a')],'as':'Attachment','raw':!![]});var _0xfcf423=[{'model':db[_0x4666('0x37')],'as':'Messages','attributes':['id',_0x4666('0x35'),_0x4666('0x5b')],'include':_0x52fae0}];return db['FaxInteraction'][_0x4666('0x33')]({'where':{'id':_0x4a1383[_0x4666('0x29')]['id']},'include':_0xfcf423})[_0x4666('0x19')](handleEntityNotFound(_0x15fc3a,null))[_0x4666('0x19')](function(_0xe4f2a0){if(_0xe4f2a0&&_0xe4f2a0['Messages']){var _0x20e794=_0xe4f2a0[_0x4666('0x5c')]({'plain':!![]});fs['mkdirSync'](_0x573b04);for(var _0x2b3c9c=0x0;_0x2b3c9c<_0x20e794[_0x4666('0x5d')][_0x4666('0x3e')];_0x2b3c9c++){var _0x5b125f=_0x20e794[_0x4666('0x5d')][_0x2b3c9c]['Attachment'];if(_0x5b125f){var _0x4d777f=path[_0x4666('0x52')](_0x5b6a92,_0x5b125f[_0x4666('0x5e')]);if(fs[_0x4666('0x5f')](_0x4d777f)){fs[_0x4666('0x60')](_0x4d777f)[_0x4666('0x61')](fs[_0x4666('0x62')](path['join'](_0x573b04,_0x5b125f[_0x4666('0x5e')])));}}}return BPromise['resolve']()[_0x4666('0x19')](function(){return new BPromise(function(_0x43b7a8,_0x58389f){zipdir(_0x573b04,{'saveTo':_0x26f6cc},function(_0x272aa5,_0xaa476b){if(_0x272aa5)return _0x58389f(_0x272aa5);return _0x43b7a8(_0xaa476b);});})[_0x4666('0x19')](function(){return new BPromise(function(_0x165294,_0x3e289e){rimraf(_0x573b04,function(_0x29494a){if(_0x29494a)_0x3e289e(_0x29494a);return _0x165294();});});})[_0x4666('0x19')](function(){return _0x15fc3a[_0x4666('0x50')](_0x26f6cc,_0x583e5e,function(_0x35d552){if(_0x35d552){console[_0x4666('0x63')](_0x4666('0x64'),_0x35d552);}else{fs['unlinkSync'](_0x26f6cc);}});});});}else{return _0x15fc3a[_0x4666('0x65')](0xc8);}})['catch'](handleError(_0x15fc3a,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 4d67943..e4d7eba 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 _0x652e=['unreadMessages','length','emit','events','../../mysqldb','FaxInteraction','FaxMessage','save','update','remove','getUsers','then','setDataValue','Users','map','findAll'];(function(_0xee4c5f,_0x1bf72d){var _0x5accbc=function(_0x5ca2aa){while(--_0x5ca2aa){_0xee4c5f['push'](_0xee4c5f['shift']());}};_0x5accbc(++_0x1bf72d);}(_0x652e,0x103));var _0xe652=function(_0x535bf6,_0xd88307){_0x535bf6=_0x535bf6-0x0;var _0x410371=_0x652e[_0x535bf6];return _0x410371;};'use strict';var EventEmitter=require(_0xe652('0x0'));var FaxInteraction=require(_0xe652('0x1'))['db'][_0xe652('0x2')];var FaxMessage=require(_0xe652('0x1'))['db'][_0xe652('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe652('0x4'),'afterUpdate':_0xe652('0x5'),'afterDestroy':_0xe652('0x6')};function emitEvent(_0x27d1cc){return function(_0x4f4b16,_0x110d87,_0x2211f5){_0x4f4b16[_0xe652('0x7')]({'attributes':['id'],'raw':!![]})[_0xe652('0x8')](function(_0x53dc49){_0x4f4b16[_0xe652('0x9')](_0xe652('0xa'),_0x53dc49[_0xe652('0xb')](function(_0x21256f){return{'id':_0x21256f['id']};}));return FaxMessage[_0xe652('0xc')]({'where':{'FaxInteractionId':_0x4f4b16['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe652('0x8')](function(_0x5e6158){_0x4f4b16['setDataValue'](_0xe652('0xd'),_0x5e6158[_0xe652('0xe')]);FaxInteractionEvents['emit'](_0x27d1cc+':'+_0x4f4b16['id'],_0x4f4b16);FaxInteractionEvents[_0xe652('0xf')](_0x27d1cc,_0x4f4b16);_0x2211f5(null);})['catch'](_0x2211f5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0xd14f=['events','../../mysqldb','FaxInteraction','FaxMessage','save','update','remove','getUsers','then','Users','findAll','setDataValue','unreadMessages','length','catch','hasOwnProperty','exports'];(function(_0x45cc2a,_0x137b7c){var _0x519892=function(_0x378ae9){while(--_0x378ae9){_0x45cc2a['push'](_0x45cc2a['shift']());}};_0x519892(++_0x137b7c);}(_0xd14f,0x1dc));var _0xfd14=function(_0x581c3d,_0xfbe7b3){_0x581c3d=_0x581c3d-0x0;var _0x15f535=_0xd14f[_0x581c3d];return _0x15f535;};'use strict';var EventEmitter=require(_0xfd14('0x0'));var FaxInteraction=require(_0xfd14('0x1'))['db'][_0xfd14('0x2')];var FaxMessage=require(_0xfd14('0x1'))['db'][_0xfd14('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfd14('0x4'),'afterUpdate':_0xfd14('0x5'),'afterDestroy':_0xfd14('0x6')};function emitEvent(_0xd7d308){return function(_0x3fca00,_0x221a02,_0x51f28a){_0x3fca00[_0xfd14('0x7')]({'attributes':['id'],'raw':!![]})[_0xfd14('0x8')](function(_0x1e8d3c){_0x3fca00['setDataValue'](_0xfd14('0x9'),_0x1e8d3c['map'](function(_0x1cf932){return{'id':_0x1cf932['id']};}));return FaxMessage[_0xfd14('0xa')]({'where':{'FaxInteractionId':_0x3fca00['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfd14('0x8')](function(_0x29e64e){_0x3fca00[_0xfd14('0xb')](_0xfd14('0xc'),_0x29e64e[_0xfd14('0xd')]);FaxInteractionEvents['emit'](_0xd7d308+':'+_0x3fca00['id'],_0x3fca00);FaxInteractionEvents['emit'](_0xd7d308,_0x3fca00);_0x51f28a(null);})[_0xfd14('0xe')](_0x51f28a(null));};}for(var e in events){if(events[_0xfd14('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xfd14('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 2d0c1fc..f51d2a8 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 _0x6eac=['define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports'];(function(_0x315245,_0x2c5539){var _0x255c14=function(_0x24c4d3){while(--_0x24c4d3){_0x315245['push'](_0x315245['shift']());}};_0x255c14(++_0x2c5539);}(_0x6eac,0x197));var _0xc6ea=function(_0x3d6edc,_0x308776){_0x3d6edc=_0x3d6edc-0x0;var _0x37a338=_0x6eac[_0x3d6edc];return _0x37a338;};'use strict';var _=require(_0xc6ea('0x0'));var util=require(_0xc6ea('0x1'));var logger=require(_0xc6ea('0x2'))(_0xc6ea('0x3'));var moment=require(_0xc6ea('0x4'));var BPromise=require('bluebird');var rp=require(_0xc6ea('0x5'));var fs=require('fs');var path=require(_0xc6ea('0x6'));var rimraf=require(_0xc6ea('0x7'));var config=require(_0xc6ea('0x8'));var attributes=require(_0xc6ea('0x9'));module[_0xc6ea('0xa')]=function(_0x4eb6c5,_0x109ee8){return _0x4eb6c5[_0xc6ea('0xb')](_0xc6ea('0xc'),attributes,{'tableName':_0xc6ea('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x219144,_0x4553a0,_0x5dc87a){if(_0x219144[_0xc6ea('0xe')](_0xc6ea('0xf'))){_0x219144[_0xc6ea('0x10')]=moment()[_0xc6ea('0x11')](_0xc6ea('0x12'));}_0x5dc87a(null,_0x219144);}}});}; \ No newline at end of file +var _0x8411=['../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','request-promise','path','rimraf'];(function(_0x2e8bac,_0x349f7d){var _0x1572d0=function(_0x462052){while(--_0x462052){_0x2e8bac['push'](_0x2e8bac['shift']());}};_0x1572d0(++_0x349f7d);}(_0x8411,0x118));var _0x1841=function(_0x108ca6,_0x542c12){_0x108ca6=_0x108ca6-0x0;var _0x4ab7bc=_0x8411[_0x108ca6];return _0x4ab7bc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1841('0x0'))(_0x1841('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1841('0x2'));var fs=require('fs');var path=require(_0x1841('0x3'));var rimraf=require(_0x1841('0x4'));var config=require(_0x1841('0x5'));var attributes=require(_0x1841('0x6'));module['exports']=function(_0x3432f2,_0x54a581){return _0x3432f2[_0x1841('0x7')](_0x1841('0x8'),attributes,{'tableName':_0x1841('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xa774c1,_0x31f16d,_0x2726a0){if(_0xa774c1[_0x1841('0xa')](_0x1841('0xb'))){_0xa774c1[_0x1841('0xc')]=moment()[_0x1841('0xd')](_0x1841('0xe'));}_0x2726a0(null,_0xa774c1);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 7e25ca3..4053393 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 _0xfb59=['where','limit','AddTagsToFaxInteraction','find','addTags','ids','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw'];(function(_0x5c1117,_0x34c1a9){var _0xc9caa6=function(_0x156e33){while(--_0x156e33){_0x5c1117['push'](_0x5c1117['shift']());}};_0xc9caa6(++_0x34c1a9);}(_0xfb59,0x1f4));var _0x9fb5=function(_0x28b617,_0x235d72){_0x28b617=_0x28b617-0x0;var _0xb812c6=_0xfb59[_0x28b617];return _0xb812c6;};'use strict';var _=require(_0x9fb5('0x0'));var util=require('util');var moment=require(_0x9fb5('0x1'));var BPromise=require('bluebird');var rs=require(_0x9fb5('0x2'));var fs=require('fs');var Redis=require(_0x9fb5('0x3'));var db=require(_0x9fb5('0x4'))['db'];var utils=require(_0x9fb5('0x5'));var logger=require(_0x9fb5('0x6'))(_0x9fb5('0x7'));var config=require(_0x9fb5('0x8'));var jayson=require(_0x9fb5('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x9fb5('0xa')](config[_0x9fb5('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9fb5('0xc'))(new Redis(config['redis']));require(_0x9fb5('0xd'))[_0x9fb5('0xe')](socket);function respondWithRpcPromise(_0x2357e9,_0xe5b222,_0x597c4f){return new BPromise(function(_0x579d08,_0x4c45ff){return client[_0x9fb5('0xf')](_0x2357e9,_0x597c4f)[_0x9fb5('0x10')](function(_0x40b95c){logger[_0x9fb5('0x11')](_0x9fb5('0x12'),_0xe5b222,'request\x20sent');logger[_0x9fb5('0x13')](_0x9fb5('0x14'),_0xe5b222,'request\x20sent',JSON[_0x9fb5('0x15')](_0x40b95c));if(_0x40b95c[_0x9fb5('0x16')]){if(_0x40b95c[_0x9fb5('0x16')][_0x9fb5('0x17')]===0x1f4){logger[_0x9fb5('0x16')](_0x9fb5('0x12'),_0xe5b222,_0x40b95c[_0x9fb5('0x16')][_0x9fb5('0x18')]);return _0x4c45ff(_0x40b95c[_0x9fb5('0x16')][_0x9fb5('0x18')]);}logger[_0x9fb5('0x16')](_0x9fb5('0x12'),_0xe5b222,_0x40b95c[_0x9fb5('0x16')][_0x9fb5('0x18')]);return _0x579d08(_0x40b95c[_0x9fb5('0x16')][_0x9fb5('0x18')]);}else{logger[_0x9fb5('0x11')]('FaxInteraction,\x20%s,\x20%s',_0xe5b222,_0x9fb5('0x19'));_0x579d08(_0x40b95c[_0x9fb5('0x1a')][_0x9fb5('0x18')]);}})['catch'](function(_0x158571){logger[_0x9fb5('0x16')](_0x9fb5('0x12'),_0xe5b222,_0x158571);_0x4c45ff(_0x158571);});});}exports[_0x9fb5('0x1b')]=function(_0x280437){var _0x16602d=this;return new Promise(function(_0x4ba9d4,_0x56c058){return db[_0x9fb5('0x1c')][_0x9fb5('0x1d')](_0x280437[_0x9fb5('0x1e')],{'raw':_0x280437['options']?_0x280437[_0x9fb5('0x1f')][_0x9fb5('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x280437[_0x9fb5('0x1f')]?_0x280437['options'][_0x9fb5('0x21')]||null:null,'attributes':_0x280437[_0x9fb5('0x1f')]?_0x280437[_0x9fb5('0x1f')]['attributes']||null:null,'limit':_0x280437[_0x9fb5('0x1f')]?_0x280437[_0x9fb5('0x1f')][_0x9fb5('0x22')]||null:null})[_0x9fb5('0x10')](function(_0x214d0e){logger[_0x9fb5('0x11')](_0x9fb5('0x1b'),_0x280437);logger[_0x9fb5('0x13')](_0x9fb5('0x1b'),_0x280437,JSON['stringify'](_0x214d0e));_0x4ba9d4(_0x214d0e);})['catch'](function(_0x2e30fb){logger[_0x9fb5('0x16')](_0x9fb5('0x1b'),_0x2e30fb['message'],_0x280437);_0x56c058(_0x16602d[_0x9fb5('0x16')](0x1f4,_0x2e30fb[_0x9fb5('0x18')]));});});};exports[_0x9fb5('0x23')]=function(_0x15042f){return new Promise(function(_0x17da28,_0x14feb7){return db[_0x9fb5('0x1c')][_0x9fb5('0x24')]({'where':_0x15042f['options']?_0x15042f[_0x9fb5('0x1f')]['where']||null:null})[_0x9fb5('0x10')](function(_0xde257d){if(_0xde257d){return _0xde257d[_0x9fb5('0x25')](_0x15042f[_0x9fb5('0x1e')][_0x9fb5('0x26')],_['omit'](_0x15042f[_0x9fb5('0x1e')],[_0x9fb5('0x26'),'id'])||{});}})[_0x9fb5('0x27')](function(_0x213ebd){logger[_0x9fb5('0x11')](_0x9fb5('0x28'),_0x15042f);logger[_0x9fb5('0x13')]('AddTags',_0x15042f,JSON[_0x9fb5('0x15')](_0x213ebd));_0x17da28(_0x213ebd);})['catch'](function(_0x35e0f5){logger[_0x9fb5('0x16')](_0x9fb5('0x28'),_0x35e0f5['message'],_0x15042f);_0x14feb7(_this[_0x9fb5('0x16')](0x1f4,_0x35e0f5[_0x9fb5('0x18')]));});});}; \ No newline at end of file +var _0x10f6=['./faxInteraction.socket','register','request','then','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','info','result','catch','FaxInteraction','update','body','options','raw','where','attributes','limit','UpdateFaxInteraction','debug','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x10f6,0x1d5));var _0x610f=function(_0x27273c,_0x1d0985){_0x27273c=_0x27273c-0x0;var _0x594eab=_0x10f6[_0x27273c];return _0x594eab;};'use strict';var _=require(_0x610f('0x0'));var util=require(_0x610f('0x1'));var moment=require(_0x610f('0x2'));var BPromise=require(_0x610f('0x3'));var rs=require(_0x610f('0x4'));var fs=require('fs');var Redis=require(_0x610f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x610f('0x6'))(_0x610f('0x7'));var config=require(_0x610f('0x8'));var jayson=require(_0x610f('0x9'));var client=jayson[_0x610f('0xa')][_0x610f('0xb')]({'port':0x232a});config['redis']=_[_0x610f('0xc')](config[_0x610f('0xd')],{'host':_0x610f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x610f('0xd')]));require(_0x610f('0xf'))[_0x610f('0x10')](socket);function respondWithRpcPromise(_0x51b83f,_0x29ef44,_0x31192c){return new BPromise(function(_0x2fba55,_0x1196a5){return client[_0x610f('0x11')](_0x51b83f,_0x31192c)[_0x610f('0x12')](function(_0x53b862){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x29ef44,_0x610f('0x13'));logger['debug'](_0x610f('0x14'),_0x29ef44,_0x610f('0x13'),JSON[_0x610f('0x15')](_0x53b862));if(_0x53b862['error']){if(_0x53b862[_0x610f('0x16')][_0x610f('0x17')]===0x1f4){logger[_0x610f('0x16')](_0x610f('0x18'),_0x29ef44,_0x53b862[_0x610f('0x16')]['message']);return _0x1196a5(_0x53b862['error'][_0x610f('0x19')]);}logger[_0x610f('0x16')](_0x610f('0x18'),_0x29ef44,_0x53b862[_0x610f('0x16')][_0x610f('0x19')]);return _0x2fba55(_0x53b862[_0x610f('0x16')][_0x610f('0x19')]);}else{logger[_0x610f('0x1a')](_0x610f('0x18'),_0x29ef44,'request\x20sent');_0x2fba55(_0x53b862[_0x610f('0x1b')]['message']);}})[_0x610f('0x1c')](function(_0x17f525){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x29ef44,_0x17f525);_0x1196a5(_0x17f525);});});}exports['UpdateFaxInteraction']=function(_0x552cfc){var _0xc1d323=this;return new Promise(function(_0x49e6a6,_0x3d0cef){return db[_0x610f('0x1d')][_0x610f('0x1e')](_0x552cfc[_0x610f('0x1f')],{'raw':_0x552cfc['options']?_0x552cfc[_0x610f('0x20')][_0x610f('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x552cfc[_0x610f('0x20')]?_0x552cfc[_0x610f('0x20')][_0x610f('0x22')]||null:null,'attributes':_0x552cfc[_0x610f('0x20')]?_0x552cfc['options'][_0x610f('0x23')]||null:null,'limit':_0x552cfc[_0x610f('0x20')]?_0x552cfc[_0x610f('0x20')][_0x610f('0x24')]||null:null})['then'](function(_0x5d2b1c){logger[_0x610f('0x1a')](_0x610f('0x25'),_0x552cfc);logger[_0x610f('0x26')](_0x610f('0x25'),_0x552cfc,JSON[_0x610f('0x15')](_0x5d2b1c));_0x49e6a6(_0x5d2b1c);})[_0x610f('0x1c')](function(_0x8f711d){logger[_0x610f('0x16')](_0x610f('0x25'),_0x8f711d['message'],_0x552cfc);_0x3d0cef(_0xc1d323[_0x610f('0x16')](0x1f4,_0x8f711d[_0x610f('0x19')]));});});};exports['AddTagsToFaxInteraction']=function(_0xe20135){return new Promise(function(_0x31ca06,_0x500a28){return db['FaxInteraction']['find']({'where':_0xe20135['options']?_0xe20135[_0x610f('0x20')][_0x610f('0x22')]||null:null})[_0x610f('0x12')](function(_0x4b5aa7){if(_0x4b5aa7){return _0x4b5aa7[_0x610f('0x27')](_0xe20135[_0x610f('0x1f')][_0x610f('0x28')],_[_0x610f('0x29')](_0xe20135[_0x610f('0x1f')],[_0x610f('0x28'),'id'])||{});}})[_0x610f('0x2a')](function(_0x467255){logger[_0x610f('0x1a')](_0x610f('0x2b'),_0xe20135);logger[_0x610f('0x26')]('AddTags',_0xe20135,JSON[_0x610f('0x15')](_0x467255));_0x31ca06(_0x467255);})[_0x610f('0x1c')](function(_0x534276){logger[_0x610f('0x16')](_0x610f('0x2b'),_0x534276['message'],_0xe20135);_0x500a28(_this[_0x610f('0x16')](0x1f4,_0x534276[_0x610f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 65dba10..b0e091f 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 _0xdc25=['length','faxInteraction:','./faxInteraction.events','save','remove','update','emit','removeListener'];(function(_0x132ea3,_0x40b0a3){var _0x4400bf=function(_0x526c36){while(--_0x526c36){_0x132ea3['push'](_0x132ea3['shift']());}};_0x4400bf(++_0x40b0a3);}(_0xdc25,0x16a));var _0x5dc2=function(_0x459cf0,_0x2c72c1){_0x459cf0=_0x459cf0-0x0;var _0x20cc22=_0xdc25[_0x459cf0];return _0x20cc22;};'use strict';var FaxInteractionEvents=require(_0x5dc2('0x0'));var events=[_0x5dc2('0x1'),_0x5dc2('0x2'),_0x5dc2('0x3')];function createListener(_0x24290a,_0x269a25){return function(_0x544061){_0x269a25[_0x5dc2('0x4')](_0x24290a,_0x544061);};}function removeListener(_0x3ce50f,_0x4cba41){return function(){FaxInteractionEvents[_0x5dc2('0x5')](_0x3ce50f,_0x4cba41);};}exports['register']=function(_0x23562b){for(var _0x23478f=0x0,_0x2ee331=events[_0x5dc2('0x6')];_0x23478f<_0x2ee331;_0x23478f++){var _0x374257=events[_0x23478f];var _0x483643=createListener(_0x5dc2('0x7')+_0x374257,_0x23562b);FaxInteractionEvents['on'](_0x374257,_0x483643);}}; \ No newline at end of file +var _0x3917=['removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove','update','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3917,0x109));var _0x7391=function(_0x2f6233,_0x90172){_0x2f6233=_0x2f6233-0x0;var _0x1c9c36=_0x3917[_0x2f6233];return _0x1c9c36;};'use strict';var FaxInteractionEvents=require(_0x7391('0x0'));var events=[_0x7391('0x1'),_0x7391('0x2'),_0x7391('0x3')];function createListener(_0x2cf7f9,_0x2536b6){return function(_0x4afdb6){_0x2536b6[_0x7391('0x4')](_0x2cf7f9,_0x4afdb6);};}function removeListener(_0x473aa2,_0x52fab9){return function(){FaxInteractionEvents[_0x7391('0x5')](_0x473aa2,_0x52fab9);};}exports[_0x7391('0x6')]=function(_0x22d1a5){for(var _0x1da3d8=0x0,_0x2cb678=events[_0x7391('0x7')];_0x1da3d8<_0x2cb678;_0x1da3d8++){var _0xc03715=events[_0x1da3d8];var _0x2f8e4f=createListener(_0x7391('0x8')+_0xc03715,_0x22d1a5);FaxInteractionEvents['on'](_0xc03715,_0x2f8e4f);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 44b1fcc..b32d137 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 _0x9069=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','/:id/download','post','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express'];(function(_0x2b49a4,_0x24a905){var _0x2fb4b5=function(_0x6183ac){while(--_0x6183ac){_0x2b49a4['push'](_0x2b49a4['shift']());}};_0x2fb4b5(++_0x24a905);}(_0x9069,0x103));var _0x9906=function(_0x18ac3f,_0x386630){_0x18ac3f=_0x18ac3f-0x0;var _0x4c6563=_0x9069[_0x18ac3f];return _0x4c6563;};'use strict';var multer=require(_0x9906('0x0'));var util=require(_0x9906('0x1'));var path=require(_0x9906('0x2'));var timeout=require(_0x9906('0x3'));var express=require(_0x9906('0x4'));var router=express[_0x9906('0x5')]();var fs_extra=require(_0x9906('0x6'));var auth=require(_0x9906('0x7'));var interaction=require(_0x9906('0x8'));var config=require(_0x9906('0x9'));var controller=require(_0x9906('0xa'));router[_0x9906('0xb')]('/',auth[_0x9906('0xc')](),controller[_0x9906('0xd')]);router[_0x9906('0xb')]('/describe',auth[_0x9906('0xc')](),controller[_0x9906('0xe')]);router[_0x9906('0xb')](_0x9906('0xf'),auth[_0x9906('0xc')](),controller[_0x9906('0x10')]);router[_0x9906('0xb')](_0x9906('0x11'),auth[_0x9906('0xc')](),controller['getMessages']);router[_0x9906('0xb')](_0x9906('0x12'),auth[_0x9906('0xc')](),controller['download']);router['post']('/',auth[_0x9906('0xc')](),controller['create']);router[_0x9906('0x13')](_0x9906('0x11'),auth['isAuthenticated'](),controller[_0x9906('0x14')]);router['post'](_0x9906('0x15'),auth['isAuthenticated'](),interaction[_0x9906('0x16')]('fax',_0x9906('0x17')),controller[_0x9906('0x18')]);router[_0x9906('0x19')]('/:id',auth[_0x9906('0xc')](),interaction[_0x9906('0x16')](_0x9906('0x1a'),_0x9906('0x1b')),controller['update']);router[_0x9906('0x1c')](_0x9906('0xf'),auth[_0x9906('0xc')](),interaction[_0x9906('0x16')](_0x9906('0x1a'),_0x9906('0x1d')),controller[_0x9906('0x1e')]);router[_0x9906('0x1c')](_0x9906('0x15'),auth[_0x9906('0xc')](),controller[_0x9906('0x1f')]);module[_0x9906('0x20')]=router; \ No newline at end of file +var _0x5c10=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','fax','addTags','put','tracked','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express'];(function(_0x283023,_0x3cf4dc){var _0x1a1e78=function(_0x267af3){while(--_0x267af3){_0x283023['push'](_0x283023['shift']());}};_0x1a1e78(++_0x3cf4dc);}(_0x5c10,0x124));var _0x05c1=function(_0x5ab759,_0x20bf46){_0x5ab759=_0x5ab759-0x0;var _0x4151fa=_0x5c10[_0x5ab759];return _0x4151fa;};'use strict';var multer=require(_0x05c1('0x0'));var util=require(_0x05c1('0x1'));var path=require(_0x05c1('0x2'));var timeout=require(_0x05c1('0x3'));var express=require(_0x05c1('0x4'));var router=express[_0x05c1('0x5')]();var fs_extra=require(_0x05c1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x05c1('0x7'));var config=require(_0x05c1('0x8'));var controller=require('./faxInteraction.controller');router[_0x05c1('0x9')]('/',auth[_0x05c1('0xa')](),controller[_0x05c1('0xb')]);router['get'](_0x05c1('0xc'),auth[_0x05c1('0xa')](),controller[_0x05c1('0xd')]);router[_0x05c1('0x9')](_0x05c1('0xe'),auth[_0x05c1('0xa')](),controller['show']);router[_0x05c1('0x9')](_0x05c1('0xf'),auth[_0x05c1('0xa')](),controller[_0x05c1('0x10')]);router[_0x05c1('0x9')](_0x05c1('0x11'),auth[_0x05c1('0xa')](),controller[_0x05c1('0x12')]);router[_0x05c1('0x13')]('/',auth[_0x05c1('0xa')](),controller[_0x05c1('0x14')]);router['post'](_0x05c1('0xf'),auth[_0x05c1('0xa')](),controller[_0x05c1('0x15')]);router[_0x05c1('0x13')]('/:id/tags',auth[_0x05c1('0xa')](),interaction['tracked'](_0x05c1('0x16'),'faxinteraction:addtags'),controller[_0x05c1('0x17')]);router[_0x05c1('0x18')]('/:id',auth[_0x05c1('0xa')](),interaction[_0x05c1('0x19')](_0x05c1('0x16'),_0x05c1('0x1a')),controller[_0x05c1('0x1b')]);router[_0x05c1('0x1c')](_0x05c1('0xe'),auth[_0x05c1('0xa')](),interaction[_0x05c1('0x19')]('fax',_0x05c1('0x1d')),controller[_0x05c1('0x1e')]);router[_0x05c1('0x1c')](_0x05c1('0x1f'),auth['isAuthenticated'](),controller[_0x05c1('0x20')]);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 6e0a3e5..c92f08d 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 _0xa4fb=['out','sequelize','exports','TEXT','medium'];(function(_0xb4b24a,_0x57c095){var _0x2c95cd=function(_0x3424b5){while(--_0x3424b5){_0xb4b24a['push'](_0xb4b24a['shift']());}};_0x2c95cd(++_0x57c095);}(_0xa4fb,0x150));var _0xba4f=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xa4fb[_0x1c8c28];return _0x1f59b4;};'use strict';var Sequelize=require(_0xba4f('0x0'));module[_0xba4f('0x1')]={'body':{'type':Sequelize[_0xba4f('0x2')](_0xba4f('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xba4f('0x4')),'defaultValue':_0xba4f('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xba4f('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x61df=['DATE','medium','BOOLEAN','out'];(function(_0x3e6409,_0x1257cd){var _0x2e6d56=function(_0x35b13e){while(--_0x35b13e){_0x3e6409['push'](_0x3e6409['shift']());}};_0x2e6d56(++_0x1257cd);}(_0x61df,0xbd));var _0xf61d=function(_0x27a905,_0x23b88e){_0x27a905=_0x27a905-0x0;var _0x5ca59e=_0x61df[_0x27a905];return _0x5ca59e;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xf61d('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0xf61d('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf61d('0x2')),'defaultValue':_0xf61d('0x2'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xf61d('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 6c694d3..106eefd 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 _0xa070=['where','map','options','count','includeAll','include','findAll','rows','keys','rawAttributes','find','body','params','describe','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','fullname','internal','agent','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','fax','RejectMessage','Sequelize','QueryTypes','email','event','rejectmessage','create','findOne','SendFax','FaxAccountId','AttachmentId','download','join','root','server','Attachment','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','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','catch','sendStatus','status','end','json','undefined','limit','offset','set','save','update','destroy','name','send','index','FaxMessage','fieldName','type','key','model','query','filters','attributes','fields','length','nolimit','order','sort','pick','filter','merge'];(function(_0x47b05d,_0x519b85){var _0x3a9d13=function(_0x4f57ef){while(--_0x4f57ef){_0x47b05d['push'](_0x47b05d['shift']());}};_0x3a9d13(++_0x519b85);}(_0xa070,0x1e4));var _0x0a07=function(_0x2caf2f,_0x25d088){_0x2caf2f=_0x2caf2f-0x0;var _0x43ecf9=_0xa070[_0x2caf2f];return _0x43ecf9;};'use strict';var emlformat=require(_0x0a07('0x0'));var rimraf=require(_0x0a07('0x1'));var zipdir=require(_0x0a07('0x2'));var jsonpatch=require(_0x0a07('0x3'));var rp=require(_0x0a07('0x4'));var moment=require(_0x0a07('0x5'));var BPromise=require(_0x0a07('0x6'));var Mustache=require('mustache');var util=require(_0x0a07('0x7'));var path=require('path');var sox=require(_0x0a07('0x8'));var csv=require(_0x0a07('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a07('0xa'));var _=require(_0x0a07('0xb'));var squel=require('squel');var crypto=require(_0x0a07('0xc'));var jsforce=require(_0x0a07('0xd'));var deskjs=require(_0x0a07('0xe'));var toCsv=require(_0x0a07('0x9'));var querystring=require(_0x0a07('0xf'));var Papa=require(_0x0a07('0x10'));var Redis=require('ioredis');var authService=require(_0x0a07('0x11'));var qs=require(_0x0a07('0x12'));var as=require(_0x0a07('0x13'));var hardwareService=require(_0x0a07('0x14'));var logger=require(_0x0a07('0x15'))(_0x0a07('0x16'));var utils=require(_0x0a07('0x17'));var config=require(_0x0a07('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a07('0x19'))['db'];config[_0x0a07('0x1a')]=_[_0x0a07('0x1b')](config['redis'],{'host':_0x0a07('0x1c'),'port':0x18eb});var socket=require(_0x0a07('0x1d'))(new Redis(config[_0x0a07('0x1a')]));require(_0x0a07('0x1e'))[_0x0a07('0x1f')](socket);var jayson=require(_0x0a07('0x20'));var client=jayson[_0x0a07('0x21')][_0x0a07('0x22')]({'port':0x232c});var client9002=jayson[_0x0a07('0x21')][_0x0a07('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x1b0c8b,_0x1e44f1,_0x34b06e,_0x27e989){return new BPromise(function(_0x14e1a2,_0x4f3352){var _0x12ff27=_0x27e989||client;return _0x12ff27['request'](_0x1b0c8b,_0x34b06e)[_0x0a07('0x23')](function(_0x108f51){logger['info'](_0x0a07('0x24'),_0x1e44f1,_0x0a07('0x25'));logger[_0x0a07('0x26')](_0x0a07('0x27'),_0x1e44f1,_0x0a07('0x25'),JSON[_0x0a07('0x28')](_0x108f51));if(_0x108f51[_0x0a07('0x29')]){if(_0x108f51[_0x0a07('0x29')][_0x0a07('0x2a')]===0x1f4){logger[_0x0a07('0x29')](_0x0a07('0x24'),_0x1e44f1,_0x108f51[_0x0a07('0x29')][_0x0a07('0x2b')]);return _0x4f3352(_0x108f51['error'][_0x0a07('0x2b')]);}logger[_0x0a07('0x29')]('FaxMessage,\x20%s,\x20%s',_0x1e44f1,_0x108f51[_0x0a07('0x29')][_0x0a07('0x2b')]);return _0x14e1a2(_0x108f51['error'][_0x0a07('0x2b')]);}else{logger[_0x0a07('0x2c')](_0x0a07('0x24'),_0x1e44f1,_0x0a07('0x25'));_0x14e1a2(_0x108f51['result']['message']);}})[_0x0a07('0x2d')](function(_0x37277d){logger[_0x0a07('0x29')](_0x0a07('0x24'),_0x1e44f1,_0x37277d);_0x4f3352(_0x37277d);});});}function respondWithStatusCode(_0x13f82c,_0x4a32f2){_0x4a32f2=_0x4a32f2||0xcc;return function(_0x53a309){if(_0x53a309){return _0x13f82c[_0x0a07('0x2e')](_0x4a32f2);}return _0x13f82c[_0x0a07('0x2f')](_0x4a32f2)[_0x0a07('0x30')]();};}function respondWithResult(_0x52dc4b,_0x1b6d37){_0x1b6d37=_0x1b6d37||0xc8;return function(_0x233f7d){if(_0x233f7d){return _0x52dc4b[_0x0a07('0x2f')](_0x1b6d37)[_0x0a07('0x31')](_0x233f7d);}};}function respondWithFilteredResult(_0x41436c,_0x17f372){return function(_0x3fefb8){if(_0x3fefb8){var _0x1c57ca=typeof _0x17f372['offset']===_0x0a07('0x32')&&typeof _0x17f372[_0x0a07('0x33')]==='undefined';var _0x135392=_0x3fefb8['count'];var _0x9e553d=_0x1c57ca?0x0:_0x17f372['offset'];var _0x4dcda8=_0x1c57ca?_0x3fefb8['count']:_0x17f372[_0x0a07('0x34')]+_0x17f372[_0x0a07('0x33')];var _0x3298b9;if(_0x4dcda8>=_0x135392){_0x4dcda8=_0x135392;_0x3298b9=0xc8;}else{_0x3298b9=0xce;}_0x41436c[_0x0a07('0x2f')](_0x3298b9);return _0x41436c[_0x0a07('0x35')]('Content-Range',_0x9e553d+'-'+_0x4dcda8+'/'+_0x135392)[_0x0a07('0x31')](_0x3fefb8);}return null;};}function patchUpdates(_0x182017){return function(_0x587443){try{jsonpatch['apply'](_0x587443,_0x182017,!![]);}catch(_0x57292b){return BPromise['reject'](_0x57292b);}return _0x587443[_0x0a07('0x36')]();};}function saveUpdates(_0x1532bc,_0x31a55f){return function(_0x4d8570){if(_0x4d8570){return _0x4d8570[_0x0a07('0x37')](_0x1532bc)['then'](function(_0x59c4db){return _0x59c4db;});}return null;};}function removeEntity(_0x42607f,_0x4a0ccb){return function(_0x122225){if(_0x122225){return _0x122225[_0x0a07('0x38')]()[_0x0a07('0x23')](function(){_0x42607f[_0x0a07('0x2f')](0xcc)[_0x0a07('0x30')]();});}};}function handleEntityNotFound(_0x2c16bc,_0x29063f){return function(_0x354a75){if(!_0x354a75){_0x2c16bc['sendStatus'](0x194);}return _0x354a75;};}function handleError(_0x4b4258,_0x5b3a28){_0x5b3a28=_0x5b3a28||0x1f4;return function(_0x4a4e4b){logger['error'](_0x4a4e4b['stack']);if(_0x4a4e4b['name']){delete _0x4a4e4b[_0x0a07('0x39')];}_0x4b4258['status'](_0x5b3a28)[_0x0a07('0x3a')](_0x4a4e4b);};}exports[_0x0a07('0x3b')]=function(_0x4def83,_0x1c87fc){var _0x228cf5={},_0x308067={},_0xb290df={'count':0x0,'rows':[]};var _0x159356=_['map'](db[_0x0a07('0x3c')]['rawAttributes'],function(_0x2b69b1){return{'name':_0x2b69b1[_0x0a07('0x3d')],'type':_0x2b69b1[_0x0a07('0x3e')][_0x0a07('0x3f')]};});_0x308067[_0x0a07('0x40')]=_['map'](_0x159356,'name');_0x308067[_0x0a07('0x41')]=_['keys'](_0x4def83[_0x0a07('0x41')]);_0x308067[_0x0a07('0x42')]=_['intersection'](_0x308067[_0x0a07('0x40')],_0x308067['query']);_0x228cf5[_0x0a07('0x43')]=_['intersection'](_0x308067['model'],qs[_0x0a07('0x44')](_0x4def83['query'][_0x0a07('0x44')]));_0x228cf5['attributes']=_0x228cf5[_0x0a07('0x43')][_0x0a07('0x45')]?_0x228cf5[_0x0a07('0x43')]:_0x308067[_0x0a07('0x40')];if(!_0x4def83[_0x0a07('0x41')]['hasOwnProperty'](_0x0a07('0x46'))){_0x228cf5['limit']=qs['limit'](_0x4def83['query'][_0x0a07('0x33')]);_0x228cf5[_0x0a07('0x34')]=qs[_0x0a07('0x34')](_0x4def83[_0x0a07('0x41')][_0x0a07('0x34')]);}_0x228cf5[_0x0a07('0x47')]=qs[_0x0a07('0x48')](_0x4def83[_0x0a07('0x41')][_0x0a07('0x48')]);_0x228cf5['where']=qs['filters'](_[_0x0a07('0x49')](_0x4def83[_0x0a07('0x41')],_0x308067[_0x0a07('0x42')]),_0x159356);if(_0x4def83[_0x0a07('0x41')][_0x0a07('0x4a')]){_0x228cf5['where']=_[_0x0a07('0x4b')](_0x228cf5[_0x0a07('0x4c')],{'$or':_[_0x0a07('0x4d')](_0x159356,function(_0x11b5b6){if(_0x11b5b6[_0x0a07('0x3e')]!=='VIRTUAL'){var _0x1bf80f={};_0x1bf80f[_0x11b5b6[_0x0a07('0x39')]]={'$like':'%'+_0x4def83[_0x0a07('0x41')]['filter']+'%'};return _0x1bf80f;}})});}_0x228cf5=_[_0x0a07('0x4b')]({},_0x228cf5,_0x4def83[_0x0a07('0x4e')]);var _0x5b198e={'where':_0x228cf5['where']};return db['FaxMessage'][_0x0a07('0x4f')](_0x5b198e)[_0x0a07('0x23')](function(_0x5e1e4d){_0xb290df[_0x0a07('0x4f')]=_0x5e1e4d;if(_0x4def83[_0x0a07('0x41')][_0x0a07('0x50')]){_0x228cf5[_0x0a07('0x51')]=[{'all':!![]}];}return db[_0x0a07('0x3c')][_0x0a07('0x52')](_0x228cf5);})[_0x0a07('0x23')](function(_0xa3e1b3){_0xb290df[_0x0a07('0x53')]=_0xa3e1b3;return _0xb290df;})[_0x0a07('0x23')](respondWithFilteredResult(_0x1c87fc,_0x228cf5))[_0x0a07('0x2d')](handleError(_0x1c87fc,null));};exports['show']=function(_0xa48343,_0xb030e7){var _0x4cdd4f={'raw':!![],'where':{'id':_0xa48343['params']['id']}},_0x566fc0={};_0x566fc0['model']=_[_0x0a07('0x54')](db[_0x0a07('0x3c')][_0x0a07('0x55')]);_0x566fc0['query']=_[_0x0a07('0x54')](_0xa48343[_0x0a07('0x41')]);_0x566fc0['filters']=_['intersection'](_0x566fc0[_0x0a07('0x40')],_0x566fc0[_0x0a07('0x41')]);_0x4cdd4f[_0x0a07('0x43')]=_['intersection'](_0x566fc0[_0x0a07('0x40')],qs['fields'](_0xa48343[_0x0a07('0x41')][_0x0a07('0x44')]));_0x4cdd4f[_0x0a07('0x43')]=_0x4cdd4f['attributes'][_0x0a07('0x45')]?_0x4cdd4f[_0x0a07('0x43')]:_0x566fc0[_0x0a07('0x40')];if(_0xa48343[_0x0a07('0x41')][_0x0a07('0x50')]){_0x4cdd4f[_0x0a07('0x51')]=[{'all':!![]}];}_0x4cdd4f=_['merge']({},_0x4cdd4f,_0xa48343[_0x0a07('0x4e')]);return db[_0x0a07('0x3c')][_0x0a07('0x56')](_0x4cdd4f)[_0x0a07('0x23')](handleEntityNotFound(_0xb030e7,null))['then'](respondWithResult(_0xb030e7,null))[_0x0a07('0x2d')](handleError(_0xb030e7,null));};exports[_0x0a07('0x37')]=function(_0x468ba6,_0x41770a){if(_0x468ba6[_0x0a07('0x57')]['id']){delete _0x468ba6[_0x0a07('0x57')]['id'];}return db['FaxMessage'][_0x0a07('0x56')]({'where':{'id':_0x468ba6[_0x0a07('0x58')]['id']}})[_0x0a07('0x23')](handleEntityNotFound(_0x41770a,null))[_0x0a07('0x23')](saveUpdates(_0x468ba6[_0x0a07('0x57')],null))[_0x0a07('0x23')](respondWithResult(_0x41770a,null))['catch'](handleError(_0x41770a,null));};exports[_0x0a07('0x38')]=function(_0x32d066,_0x3d4941){return db['FaxMessage'][_0x0a07('0x56')]({'where':{'id':_0x32d066[_0x0a07('0x58')]['id']}})[_0x0a07('0x23')](handleEntityNotFound(_0x3d4941,null))[_0x0a07('0x23')](removeEntity(_0x3d4941,null))[_0x0a07('0x2d')](handleError(_0x3d4941,null));};exports[_0x0a07('0x59')]=function(_0x740002,_0x35ffeb){return db['FaxMessage'][_0x0a07('0x59')]()['then'](respondWithResult(_0x35ffeb,null))['catch'](handleError(_0x35ffeb,null));};var interaction_log=require(_0x0a07('0x15'))('fax-interactions');exports[_0x0a07('0x5a')]=function(_0x18f888,_0x27df74,_0x190879){var _0x1a5114={'agent':{},'channel':'fax'};if(_0x18f888['body']['id']){delete _0x18f888['body']['id'];}_0x18f888[_0x0a07('0x57')]['read']=!![];_0x18f888['body'][_0x0a07('0x5b')]=moment()['format'](_0x0a07('0x5c'));_0x18f888[_0x0a07('0x57')][_0x0a07('0x5d')]=_0x18f888[_0x0a07('0x57')][_0x0a07('0x5d')]||_0x18f888[_0x0a07('0x5e')]['id'];_0x1a5114['agent']['id']=_0x18f888[_0x0a07('0x57')][_0x0a07('0x5d')];return db[_0x0a07('0x3c')][_0x0a07('0x56')]({'where':{'id':_0x18f888['params']['id'],'UserId':null}})[_0x0a07('0x23')](handleEntityNotFound(_0x27df74,null))['then'](saveUpdates(_0x18f888[_0x0a07('0x57')],null))['then'](function(_0x6e7f03){if(_0x6e7f03){_0x1a5114[_0x0a07('0x2b')]=_0x6e7f03[_0x0a07('0x5f')]({'plain':!![]});return db[_0x0a07('0x60')][_0x0a07('0x56')]({'where':{'id':_0x6e7f03[_0x0a07('0x61')]}});}return null;})[_0x0a07('0x23')](handleEntityNotFound(_0x27df74,null))['then'](function(_0x5655fd){if(_0x5655fd){return _0x5655fd[_0x0a07('0x37')]({'UserId':_0x18f888['body']['UserId'],'read1stAt':_[_0x0a07('0x62')](_0x5655fd[_0x0a07('0x63')])?moment()[_0x0a07('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a07('0x23')](function(_0x380fb2){if(_0x380fb2){_0x1a5114[_0x0a07('0x65')]=_0x380fb2[_0x0a07('0x5f')]({'plain':!![]});interaction_log[_0x0a07('0x2c')](_0x0a07('0x66'),_0x18f888[_0x0a07('0x5e')]['id'],_0x18f888['user'][_0x0a07('0x39')],_0x18f888[_0x0a07('0x5e')][_0x0a07('0x67')],_0x1a5114[_0x0a07('0x65')]['id'],_0x18f888[_0x0a07('0x57')]?JSON[_0x0a07('0x28')](_0x18f888['body']):_0x0a07('0x68'));return respondWithRpcPromise(_0x0a07('0x69'),'acceptMessage',_0x1a5114);}return null;})[_0x0a07('0x23')](function(_0x16f946){var _0x322b12=_0x0a07('0x6a')+_0x16f946[_0x0a07('0x2b')][_0x0a07('0x6b')];return db[_0x0a07('0x6c')][_0x0a07('0x41')](_0x322b12,{'type':db['Sequelize']['QueryTypes'][_0x0a07('0x6d')],'raw':!![]})['then'](function(_0x329d8b){return _0x329d8b;});})['then'](function(_0x19b502){if(_0x19b502){_0x1a5114[_0x0a07('0x2b')][_0x0a07('0x6e')]=_0x19b502[0x0];if(!_0x18f888[_0x0a07('0x57')]['UserId'])return;return db[_0x0a07('0x6f')]['find']({'where':{'id':_0x18f888['body'][_0x0a07('0x5d')],'role':'agent'},'attributes':['id','name',_0x0a07('0x70'),'email',_0x0a07('0x71')],'raw':!![]});}return null;})[_0x0a07('0x23')](function(_0x1201c4){if(!_0x1201c4)return null;_0x1a5114[_0x0a07('0x2b')][_0x0a07('0x72')]=_0x1201c4;return _0x1a5114;})[_0x0a07('0x23')](function(_0xe5e11f){if(_0xe5e11f){if(_0x18f888[_0x0a07('0x57')][_0x0a07('0x73')]){_0x1a5114[_0x0a07('0x2b')][_0x0a07('0x74')]=util[_0x0a07('0x64')](_0x0a07('0x75'),_0x18f888[_0x0a07('0x5e')][_0x0a07('0x39')]);_0x1a5114[_0x0a07('0x2b')][_0x0a07('0x76')]=_0x1a5114[_0x0a07('0x76')];_0x1a5114[_0x0a07('0x2b')][_0x0a07('0x77')]=_0x1a5114['channel'];_0x1a5114[_0x0a07('0x2b')]['event']=_0x0a07('0x5a');return respondWithRpcPromise(_0x0a07('0x78'),_0x0a07('0x78'),{'event':_0x0a07('0x79'),'message':_0x1a5114[_0x0a07('0x2b')]},client9002)[_0x0a07('0x23')](function(){return _0x1a5114;});}return _0x1a5114;}return null;})[_0x0a07('0x23')](respondWithResult(_0x27df74,null))[_0x0a07('0x2d')](handleError(_0x27df74,null));};var interaction_log=require(_0x0a07('0x15'))('fax-interactions');exports[_0x0a07('0x7a')]=function(_0x5e1e8d,_0x32f7f9,_0xc48aee){var _0xd25d99={'agent':{},'channel':_0x0a07('0x7b')};if(_0x5e1e8d['body']['id']){delete _0x5e1e8d['body']['id'];}_0x5e1e8d['body'][_0x0a07('0x5d')]=_0x5e1e8d['body'][_0x0a07('0x5d')]||_0x5e1e8d[_0x0a07('0x5e')]['id'];_0xd25d99[_0x0a07('0x72')]['id']=_0x5e1e8d[_0x0a07('0x57')][_0x0a07('0x5d')];return db[_0x0a07('0x3c')]['find']({'where':{'id':_0x5e1e8d[_0x0a07('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x32f7f9,null))[_0x0a07('0x23')](function(_0xf8f8b5){if(_0xf8f8b5){_0xd25d99[_0x0a07('0x2b')]=_0xf8f8b5['get']({'plain':!![]});return db[_0x0a07('0x60')][_0x0a07('0x56')]({'where':{'id':_0xf8f8b5[_0x0a07('0x61')]}});}return null;})[_0x0a07('0x23')](handleEntityNotFound(_0x32f7f9,null))[_0x0a07('0x23')](function(_0x369bb8){if(_0x369bb8){_0xd25d99[_0x0a07('0x65')]=_0x369bb8[_0x0a07('0x5f')]({'plain':!![]});interaction_log[_0x0a07('0x2c')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5e1e8d['user']['id'],_0x5e1e8d[_0x0a07('0x5e')]['name'],_0x5e1e8d['user']['role'],_0xd25d99['interaction']['id'],_0x5e1e8d[_0x0a07('0x57')]?JSON[_0x0a07('0x28')](_0x5e1e8d[_0x0a07('0x57')]):_0x0a07('0x68'));return respondWithRpcPromise(_0x0a07('0x7c'),'rejectMessage',_0xd25d99);}return null;})[_0x0a07('0x23')](function(_0x2d7b65){var _0x11a1d9=_0x0a07('0x6a')+_0x2d7b65[_0x0a07('0x2b')]['ContactId'];return db[_0x0a07('0x6c')][_0x0a07('0x41')](_0x11a1d9,{'type':db[_0x0a07('0x7d')][_0x0a07('0x7e')][_0x0a07('0x6d')],'raw':!![]})[_0x0a07('0x23')](function(_0x263a86){return _0x263a86;});})['then'](function(_0x11b147){if(_0x11b147){_0xd25d99[_0x0a07('0x2b')][_0x0a07('0x6e')]=_0x11b147[0x0];if(!_0x5e1e8d[_0x0a07('0x57')][_0x0a07('0x5d')])return;return db[_0x0a07('0x6f')][_0x0a07('0x56')]({'where':{'id':_0x5e1e8d['body'][_0x0a07('0x5d')],'role':_0x0a07('0x72')},'attributes':['id',_0x0a07('0x39'),_0x0a07('0x70'),_0x0a07('0x7f'),_0x0a07('0x71')],'raw':!![]});}return null;})[_0x0a07('0x23')](function(_0xf639ab){if(!_0xf639ab)return null;_0xd25d99['message'][_0x0a07('0x72')]=_0xf639ab;return _0xd25d99;})[_0x0a07('0x23')](function(_0xd6d53b){if(_0xd6d53b){_0xd6d53b[_0x0a07('0x2b')][_0x0a07('0x74')]=util[_0x0a07('0x64')](_0x0a07('0x75'),_0x5e1e8d[_0x0a07('0x5e')][_0x0a07('0x39')]);_0xd6d53b[_0x0a07('0x2b')][_0x0a07('0x76')]=_0xd25d99[_0x0a07('0x76')];_0xd6d53b[_0x0a07('0x2b')][_0x0a07('0x77')]=_0xd25d99['channel'];_0xd6d53b[_0x0a07('0x2b')][_0x0a07('0x80')]='reject';respondWithRpcPromise(_0x0a07('0x78'),'EventManager',{'event':_0x0a07('0x81'),'message':_0xd6d53b[_0x0a07('0x2b')]},client9002);return _0xd25d99;}return null;})[_0x0a07('0x23')](respondWithResult(_0x32f7f9,null))['catch'](handleError(_0x32f7f9,null));};exports[_0x0a07('0x82')]=function(_0x5354ca,_0x1e2098){var _0x2d86f1;return db['FaxMessage']['create'](_0x5354ca[_0x0a07('0x57')],{})[_0x0a07('0x23')](function(_0x508b04){_0x2d86f1=_0x508b04;return db['CmContact'][_0x0a07('0x83')]({'where':{'id':_0x2d86f1[_0x0a07('0x6b')]}});})[_0x0a07('0x23')](function(_0x151999){if(_[_0x0a07('0x62')](_0x151999)){return;}else{_0x2d86f1[_0x0a07('0x7b')]=_0x151999[_0x0a07('0x7b')];return db['Attachment'][_0x0a07('0x83')]({'where':{'id':_0x2d86f1['AttachmentId']}});}})['then'](function(_0x454d7b){return respondWithRpcPromise(_0x0a07('0x84'),_0x0a07('0x84'),{'FaxAccountId':_['isNil'](_0x5354ca[_0x0a07('0x57')])?undefined:_0x5354ca['body'][_0x0a07('0x85')],'path':_[_0x0a07('0x62')](_0x454d7b)?undefined:util[_0x0a07('0x64')]('/var/opt/motion2/server/files/attachments/%s',_0x454d7b['basename']),'fax':_['isNil'](_0x2d86f1['fax'])?undefined:_0x2d86f1[_0x0a07('0x7b')],'AttachmentId':_0x2d86f1[_0x0a07('0x86')]},client9002);})['then'](respondWithResult(_0x1e2098,0xc9))[_0x0a07('0x2d')](handleError(_0x1e2098,null));};exports[_0x0a07('0x87')]=function(_0x3bc0be,_0x426955){var _0x4bb62c=path[_0x0a07('0x88')](config[_0x0a07('0x89')],_0x0a07('0x8a'),'files','attachments');return db[_0x0a07('0x3c')][_0x0a07('0x56')]({'where':{'id':_0x3bc0be[_0x0a07('0x58')]['id']},'include':[{'model':db['Attachment'],'as':_0x0a07('0x8b')}]})['then'](handleEntityNotFound(_0x426955,null))['then'](function(_0x3e3de4){if(_0x3e3de4){return _0x426955['download'](path['join'](_0x4bb62c,_0x3e3de4[_0x0a07('0x8b')]['basename']));}})[_0x0a07('0x2d')](handleError(_0x426955,null));}; \ No newline at end of file +var _0xd099=['sendStatus','status','end','offset','limit','set','Content-Range','json','reject','save','update','stack','name','map','FaxMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','find','body','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','FaxInteractionId','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','agent','fullname','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','SELECT','email','interface','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','isNil','FaxAccountId','basename','download','files','attachments','eml-format','request-promise','moment','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x285156,_0x2908a8){var _0x1de60e=function(_0x79a760){while(--_0x79a760){_0x285156['push'](_0x285156['shift']());}};_0x1de60e(++_0x2908a8);}(_0xd099,0xf0));var _0x9d09=function(_0x30f395,_0x3629b5){_0x30f395=_0x30f395-0x0;var _0x2ea0ee=_0xd099[_0x30f395];return _0x2ea0ee;};'use strict';var emlformat=require(_0x9d09('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9d09('0x1'));var moment=require(_0x9d09('0x2'));var BPromise=require(_0x9d09('0x3'));var Mustache=require(_0x9d09('0x4'));var util=require(_0x9d09('0x5'));var path=require(_0x9d09('0x6'));var sox=require('sox');var csv=require(_0x9d09('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9d09('0x8'));var _=require(_0x9d09('0x9'));var squel=require(_0x9d09('0xa'));var crypto=require(_0x9d09('0xb'));var jsforce=require(_0x9d09('0xc'));var deskjs=require(_0x9d09('0xd'));var toCsv=require(_0x9d09('0x7'));var querystring=require(_0x9d09('0xe'));var Papa=require(_0x9d09('0xf'));var Redis=require(_0x9d09('0x10'));var authService=require(_0x9d09('0x11'));var qs=require(_0x9d09('0x12'));var as=require(_0x9d09('0x13'));var hardwareService=require(_0x9d09('0x14'));var logger=require(_0x9d09('0x15'))(_0x9d09('0x16'));var utils=require(_0x9d09('0x17'));var config=require(_0x9d09('0x18'));var licenseUtil=require(_0x9d09('0x19'));var db=require(_0x9d09('0x1a'))['db'];config['redis']=_[_0x9d09('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9d09('0x1c'))[_0x9d09('0x1d')](socket);var jayson=require(_0x9d09('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x9d09('0x1f')][_0x9d09('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5b88f7,_0x14c1b5,_0x152aa1,_0x5825b9){return new BPromise(function(_0x3db62b,_0x17504d){var _0x187aaf=_0x5825b9||client;return _0x187aaf[_0x9d09('0x21')](_0x5b88f7,_0x152aa1)[_0x9d09('0x22')](function(_0x489c29){logger[_0x9d09('0x23')](_0x9d09('0x24'),_0x14c1b5,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x14c1b5,_0x9d09('0x25'),JSON[_0x9d09('0x26')](_0x489c29));if(_0x489c29[_0x9d09('0x27')]){if(_0x489c29['error'][_0x9d09('0x28')]===0x1f4){logger[_0x9d09('0x27')](_0x9d09('0x24'),_0x14c1b5,_0x489c29[_0x9d09('0x27')][_0x9d09('0x29')]);return _0x17504d(_0x489c29['error'][_0x9d09('0x29')]);}logger[_0x9d09('0x27')](_0x9d09('0x24'),_0x14c1b5,_0x489c29[_0x9d09('0x27')][_0x9d09('0x29')]);return _0x3db62b(_0x489c29[_0x9d09('0x27')][_0x9d09('0x29')]);}else{logger[_0x9d09('0x23')]('FaxMessage,\x20%s,\x20%s',_0x14c1b5,_0x9d09('0x25'));_0x3db62b(_0x489c29[_0x9d09('0x2a')][_0x9d09('0x29')]);}})[_0x9d09('0x2b')](function(_0x311704){logger[_0x9d09('0x27')](_0x9d09('0x24'),_0x14c1b5,_0x311704);_0x17504d(_0x311704);});});}function respondWithStatusCode(_0x1c1c37,_0x54ec1a){_0x54ec1a=_0x54ec1a||0xcc;return function(_0x3d0c09){if(_0x3d0c09){return _0x1c1c37[_0x9d09('0x2c')](_0x54ec1a);}return _0x1c1c37[_0x9d09('0x2d')](_0x54ec1a)[_0x9d09('0x2e')]();};}function respondWithResult(_0x2964c6,_0x27923c){_0x27923c=_0x27923c||0xc8;return function(_0x4edb3d){if(_0x4edb3d){return _0x2964c6[_0x9d09('0x2d')](_0x27923c)['json'](_0x4edb3d);}};}function respondWithFilteredResult(_0x3bfccf,_0x138d9f){return function(_0x54718d){if(_0x54718d){var _0x575751=typeof _0x138d9f[_0x9d09('0x2f')]==='undefined'&&typeof _0x138d9f[_0x9d09('0x30')]==='undefined';var _0x3b8408=_0x54718d['count'];var _0x350d54=_0x575751?0x0:_0x138d9f[_0x9d09('0x2f')];var _0x12e25e=_0x575751?_0x54718d['count']:_0x138d9f['offset']+_0x138d9f[_0x9d09('0x30')];var _0x4ff66d;if(_0x12e25e>=_0x3b8408){_0x12e25e=_0x3b8408;_0x4ff66d=0xc8;}else{_0x4ff66d=0xce;}_0x3bfccf[_0x9d09('0x2d')](_0x4ff66d);return _0x3bfccf[_0x9d09('0x31')](_0x9d09('0x32'),_0x350d54+'-'+_0x12e25e+'/'+_0x3b8408)[_0x9d09('0x33')](_0x54718d);}return null;};}function patchUpdates(_0x189143){return function(_0x4573a1){try{jsonpatch['apply'](_0x4573a1,_0x189143,!![]);}catch(_0x502c26){return BPromise[_0x9d09('0x34')](_0x502c26);}return _0x4573a1[_0x9d09('0x35')]();};}function saveUpdates(_0x5637ba,_0x164d32){return function(_0x52243d){if(_0x52243d){return _0x52243d[_0x9d09('0x36')](_0x5637ba)[_0x9d09('0x22')](function(_0x4d5eae){return _0x4d5eae;});}return null;};}function removeEntity(_0x4acea1,_0x4e167f){return function(_0xa1b18c){if(_0xa1b18c){return _0xa1b18c['destroy']()[_0x9d09('0x22')](function(){_0x4acea1['status'](0xcc)[_0x9d09('0x2e')]();});}};}function handleEntityNotFound(_0x594594,_0x5b1db1){return function(_0x256e51){if(!_0x256e51){_0x594594[_0x9d09('0x2c')](0x194);}return _0x256e51;};}function handleError(_0x4269a3,_0x5905c9){_0x5905c9=_0x5905c9||0x1f4;return function(_0x584e64){logger['error'](_0x584e64[_0x9d09('0x37')]);if(_0x584e64[_0x9d09('0x38')]){delete _0x584e64[_0x9d09('0x38')];}_0x4269a3['status'](_0x5905c9)['send'](_0x584e64);};}exports['index']=function(_0x2d7f8e,_0x5e3464){var _0x1d5476={},_0x1fc79a={},_0x3f26df={'count':0x0,'rows':[]};var _0x5403fc=_[_0x9d09('0x39')](db[_0x9d09('0x3a')][_0x9d09('0x3b')],function(_0x5c7963){return{'name':_0x5c7963[_0x9d09('0x3c')],'type':_0x5c7963[_0x9d09('0x3d')]['key']};});_0x1fc79a[_0x9d09('0x3e')]=_['map'](_0x5403fc,_0x9d09('0x38'));_0x1fc79a[_0x9d09('0x3f')]=_[_0x9d09('0x40')](_0x2d7f8e[_0x9d09('0x3f')]);_0x1fc79a[_0x9d09('0x41')]=_[_0x9d09('0x42')](_0x1fc79a[_0x9d09('0x3e')],_0x1fc79a['query']);_0x1d5476[_0x9d09('0x43')]=_['intersection'](_0x1fc79a['model'],qs[_0x9d09('0x44')](_0x2d7f8e[_0x9d09('0x3f')][_0x9d09('0x44')]));_0x1d5476[_0x9d09('0x43')]=_0x1d5476[_0x9d09('0x43')][_0x9d09('0x45')]?_0x1d5476[_0x9d09('0x43')]:_0x1fc79a[_0x9d09('0x3e')];if(!_0x2d7f8e[_0x9d09('0x3f')][_0x9d09('0x46')](_0x9d09('0x47'))){_0x1d5476[_0x9d09('0x30')]=qs[_0x9d09('0x30')](_0x2d7f8e[_0x9d09('0x3f')][_0x9d09('0x30')]);_0x1d5476[_0x9d09('0x2f')]=qs[_0x9d09('0x2f')](_0x2d7f8e[_0x9d09('0x3f')]['offset']);}_0x1d5476[_0x9d09('0x48')]=qs['sort'](_0x2d7f8e[_0x9d09('0x3f')][_0x9d09('0x49')]);_0x1d5476[_0x9d09('0x4a')]=qs['filters'](_[_0x9d09('0x4b')](_0x2d7f8e[_0x9d09('0x3f')],_0x1fc79a[_0x9d09('0x41')]),_0x5403fc);if(_0x2d7f8e[_0x9d09('0x3f')][_0x9d09('0x4c')]){_0x1d5476[_0x9d09('0x4a')]=_[_0x9d09('0x4d')](_0x1d5476['where'],{'$or':_['map'](_0x5403fc,function(_0x46eed5){if(_0x46eed5[_0x9d09('0x3d')]!==_0x9d09('0x4e')){var _0x57d0d5={};_0x57d0d5[_0x46eed5[_0x9d09('0x38')]]={'$like':'%'+_0x2d7f8e[_0x9d09('0x3f')][_0x9d09('0x4c')]+'%'};return _0x57d0d5;}})});}_0x1d5476=_['merge']({},_0x1d5476,_0x2d7f8e[_0x9d09('0x4f')]);var _0x3be8e1={'where':_0x1d5476[_0x9d09('0x4a')]};return db['FaxMessage'][_0x9d09('0x50')](_0x3be8e1)['then'](function(_0x18db1f){_0x3f26df[_0x9d09('0x50')]=_0x18db1f;if(_0x2d7f8e[_0x9d09('0x3f')][_0x9d09('0x51')]){_0x1d5476[_0x9d09('0x52')]=[{'all':!![]}];}return db[_0x9d09('0x3a')]['findAll'](_0x1d5476);})['then'](function(_0x370d47){_0x3f26df[_0x9d09('0x53')]=_0x370d47;return _0x3f26df;})[_0x9d09('0x22')](respondWithFilteredResult(_0x5e3464,_0x1d5476))[_0x9d09('0x2b')](handleError(_0x5e3464,null));};exports[_0x9d09('0x54')]=function(_0xa3bdb9,_0x26ec97){var _0x6cfe89={'raw':!![],'where':{'id':_0xa3bdb9[_0x9d09('0x55')]['id']}},_0x977e16={};_0x977e16[_0x9d09('0x3e')]=_[_0x9d09('0x40')](db[_0x9d09('0x3a')][_0x9d09('0x3b')]);_0x977e16[_0x9d09('0x3f')]=_[_0x9d09('0x40')](_0xa3bdb9[_0x9d09('0x3f')]);_0x977e16[_0x9d09('0x41')]=_['intersection'](_0x977e16[_0x9d09('0x3e')],_0x977e16[_0x9d09('0x3f')]);_0x6cfe89[_0x9d09('0x43')]=_[_0x9d09('0x42')](_0x977e16[_0x9d09('0x3e')],qs[_0x9d09('0x44')](_0xa3bdb9['query'][_0x9d09('0x44')]));_0x6cfe89[_0x9d09('0x43')]=_0x6cfe89[_0x9d09('0x43')][_0x9d09('0x45')]?_0x6cfe89[_0x9d09('0x43')]:_0x977e16[_0x9d09('0x3e')];if(_0xa3bdb9[_0x9d09('0x3f')][_0x9d09('0x51')]){_0x6cfe89['include']=[{'all':!![]}];}_0x6cfe89=_[_0x9d09('0x4d')]({},_0x6cfe89,_0xa3bdb9['options']);return db['FaxMessage'][_0x9d09('0x56')](_0x6cfe89)[_0x9d09('0x22')](handleEntityNotFound(_0x26ec97,null))[_0x9d09('0x22')](respondWithResult(_0x26ec97,null))[_0x9d09('0x2b')](handleError(_0x26ec97,null));};exports['update']=function(_0x2c891f,_0x507014){if(_0x2c891f[_0x9d09('0x57')]['id']){delete _0x2c891f[_0x9d09('0x57')]['id'];}return db[_0x9d09('0x3a')]['find']({'where':{'id':_0x2c891f[_0x9d09('0x55')]['id']}})[_0x9d09('0x22')](handleEntityNotFound(_0x507014,null))[_0x9d09('0x22')](saveUpdates(_0x2c891f[_0x9d09('0x57')],null))[_0x9d09('0x22')](respondWithResult(_0x507014,null))[_0x9d09('0x2b')](handleError(_0x507014,null));};exports['destroy']=function(_0x5e62f6,_0x127eee){return db[_0x9d09('0x3a')][_0x9d09('0x56')]({'where':{'id':_0x5e62f6['params']['id']}})[_0x9d09('0x22')](handleEntityNotFound(_0x127eee,null))[_0x9d09('0x22')](removeEntity(_0x127eee,null))[_0x9d09('0x2b')](handleError(_0x127eee,null));};exports[_0x9d09('0x58')]=function(_0x57a916,_0x29681f){return db[_0x9d09('0x3a')][_0x9d09('0x58')]()['then'](respondWithResult(_0x29681f,null))[_0x9d09('0x2b')](handleError(_0x29681f,null));};var interaction_log=require(_0x9d09('0x15'))(_0x9d09('0x59'));exports[_0x9d09('0x5a')]=function(_0x470261,_0x1bdee1,_0x29e04f){var _0x202d1c={'agent':{},'channel':_0x9d09('0x5b')};if(_0x470261[_0x9d09('0x57')]['id']){delete _0x470261['body']['id'];}_0x470261[_0x9d09('0x57')][_0x9d09('0x5c')]=!![];_0x470261[_0x9d09('0x57')][_0x9d09('0x5d')]=moment()[_0x9d09('0x5e')](_0x9d09('0x5f'));_0x470261['body'][_0x9d09('0x60')]=_0x470261[_0x9d09('0x57')][_0x9d09('0x60')]||_0x470261['user']['id'];_0x202d1c['agent']['id']=_0x470261['body']['UserId'];return db['FaxMessage']['find']({'where':{'id':_0x470261[_0x9d09('0x55')]['id'],'UserId':null}})[_0x9d09('0x22')](handleEntityNotFound(_0x1bdee1,null))[_0x9d09('0x22')](saveUpdates(_0x470261['body'],null))[_0x9d09('0x22')](function(_0xe92eb9){if(_0xe92eb9){_0x202d1c[_0x9d09('0x29')]=_0xe92eb9[_0x9d09('0x61')]({'plain':!![]});return db[_0x9d09('0x62')]['find']({'where':{'id':_0xe92eb9[_0x9d09('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x1bdee1,null))[_0x9d09('0x22')](function(_0x3af4f0){if(_0x3af4f0){return _0x3af4f0[_0x9d09('0x36')]({'UserId':_0x470261[_0x9d09('0x57')]['UserId'],'read1stAt':_['isNil'](_0x3af4f0[_0x9d09('0x64')])?moment()[_0x9d09('0x5e')](_0x9d09('0x5f')):undefined});}return null;})['then'](function(_0x293fb8){if(_0x293fb8){_0x202d1c[_0x9d09('0x65')]=_0x293fb8[_0x9d09('0x61')]({'plain':!![]});interaction_log['info'](_0x9d09('0x66'),_0x470261['user']['id'],_0x470261[_0x9d09('0x67')]['name'],_0x470261['user'][_0x9d09('0x68')],_0x202d1c[_0x9d09('0x65')]['id'],_0x470261[_0x9d09('0x57')]?JSON[_0x9d09('0x26')](_0x470261['body']):_0x9d09('0x69'));return respondWithRpcPromise('AcceptMessage',_0x9d09('0x6a'),_0x202d1c);}return null;})['then'](function(_0x21e67f){var _0x3a52c3=_0x9d09('0x6b')+_0x21e67f[_0x9d09('0x29')][_0x9d09('0x6c')];return db[_0x9d09('0x6d')]['query'](_0x3a52c3,{'type':db[_0x9d09('0x6e')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x200eb1){return _0x200eb1;});})[_0x9d09('0x22')](function(_0x1cece7){if(_0x1cece7){_0x202d1c[_0x9d09('0x29')][_0x9d09('0x6f')]=_0x1cece7[0x0];if(!_0x470261[_0x9d09('0x57')][_0x9d09('0x60')])return;return db[_0x9d09('0x70')][_0x9d09('0x56')]({'where':{'id':_0x470261[_0x9d09('0x57')]['UserId'],'role':_0x9d09('0x71')},'attributes':['id',_0x9d09('0x38'),_0x9d09('0x72'),'email',_0x9d09('0x73')],'raw':!![]});}return null;})[_0x9d09('0x22')](function(_0x163b39){if(!_0x163b39)return null;_0x202d1c['message'][_0x9d09('0x71')]=_0x163b39;return _0x202d1c;})[_0x9d09('0x22')](function(_0x2da831){if(_0x2da831){if(_0x470261[_0x9d09('0x57')]['manual']){_0x202d1c[_0x9d09('0x29')]['interface']=util[_0x9d09('0x5e')](_0x9d09('0x74'),_0x470261[_0x9d09('0x67')][_0x9d09('0x38')]);_0x202d1c[_0x9d09('0x29')][_0x9d09('0x75')]=_0x202d1c[_0x9d09('0x75')];_0x202d1c['message'][_0x9d09('0x76')]=_0x202d1c[_0x9d09('0x75')];_0x202d1c[_0x9d09('0x29')][_0x9d09('0x77')]=_0x9d09('0x5a');return respondWithRpcPromise(_0x9d09('0x78'),_0x9d09('0x78'),{'event':_0x9d09('0x79'),'message':_0x202d1c[_0x9d09('0x29')]},client9002)[_0x9d09('0x22')](function(){return _0x202d1c;});}return _0x202d1c;}return null;})[_0x9d09('0x22')](respondWithResult(_0x1bdee1,null))['catch'](handleError(_0x1bdee1,null));};var interaction_log=require(_0x9d09('0x15'))(_0x9d09('0x59'));exports[_0x9d09('0x34')]=function(_0x221ba0,_0x24cc03,_0x111de5){var _0x2b7a78={'agent':{},'channel':'fax'};if(_0x221ba0[_0x9d09('0x57')]['id']){delete _0x221ba0['body']['id'];}_0x221ba0['body'][_0x9d09('0x60')]=_0x221ba0[_0x9d09('0x57')][_0x9d09('0x60')]||_0x221ba0['user']['id'];_0x2b7a78[_0x9d09('0x71')]['id']=_0x221ba0[_0x9d09('0x57')]['UserId'];return db['FaxMessage'][_0x9d09('0x56')]({'where':{'id':_0x221ba0[_0x9d09('0x55')]['id'],'UserId':null}})[_0x9d09('0x22')](handleEntityNotFound(_0x24cc03,null))[_0x9d09('0x22')](function(_0x20ca4a){if(_0x20ca4a){_0x2b7a78[_0x9d09('0x29')]=_0x20ca4a[_0x9d09('0x61')]({'plain':!![]});return db[_0x9d09('0x62')][_0x9d09('0x56')]({'where':{'id':_0x20ca4a[_0x9d09('0x63')]}});}return null;})[_0x9d09('0x22')](handleEntityNotFound(_0x24cc03,null))[_0x9d09('0x22')](function(_0x447e8d){if(_0x447e8d){_0x2b7a78['interaction']=_0x447e8d[_0x9d09('0x61')]({'plain':!![]});interaction_log[_0x9d09('0x23')](_0x9d09('0x7a'),_0x221ba0[_0x9d09('0x67')]['id'],_0x221ba0[_0x9d09('0x67')][_0x9d09('0x38')],_0x221ba0[_0x9d09('0x67')]['role'],_0x2b7a78[_0x9d09('0x65')]['id'],_0x221ba0[_0x9d09('0x57')]?JSON[_0x9d09('0x26')](_0x221ba0['body']):_0x9d09('0x69'));return respondWithRpcPromise(_0x9d09('0x7b'),_0x9d09('0x7c'),_0x2b7a78);}return null;})[_0x9d09('0x22')](function(_0x798f87){var _0x2d78a9=_0x9d09('0x6b')+_0x798f87[_0x9d09('0x29')][_0x9d09('0x6c')];return db[_0x9d09('0x6d')][_0x9d09('0x3f')](_0x2d78a9,{'type':db[_0x9d09('0x6e')][_0x9d09('0x7d')][_0x9d09('0x7e')],'raw':!![]})[_0x9d09('0x22')](function(_0x439c11){return _0x439c11;});})[_0x9d09('0x22')](function(_0x2523cf){if(_0x2523cf){_0x2b7a78[_0x9d09('0x29')][_0x9d09('0x6f')]=_0x2523cf[0x0];if(!_0x221ba0[_0x9d09('0x57')]['UserId'])return;return db['User']['find']({'where':{'id':_0x221ba0[_0x9d09('0x57')][_0x9d09('0x60')],'role':_0x9d09('0x71')},'attributes':['id',_0x9d09('0x38'),_0x9d09('0x72'),_0x9d09('0x7f'),_0x9d09('0x73')],'raw':!![]});}return null;})['then'](function(_0x4e7b72){if(!_0x4e7b72)return null;_0x2b7a78[_0x9d09('0x29')][_0x9d09('0x71')]=_0x4e7b72;return _0x2b7a78;})[_0x9d09('0x22')](function(_0x2fcad9){if(_0x2fcad9){_0x2fcad9[_0x9d09('0x29')][_0x9d09('0x80')]=util[_0x9d09('0x5e')](_0x9d09('0x74'),_0x221ba0[_0x9d09('0x67')][_0x9d09('0x38')]);_0x2fcad9[_0x9d09('0x29')][_0x9d09('0x75')]=_0x2b7a78['channel'];_0x2fcad9[_0x9d09('0x29')]['motionChannel']=_0x2b7a78[_0x9d09('0x75')];_0x2fcad9[_0x9d09('0x29')][_0x9d09('0x77')]=_0x9d09('0x34');respondWithRpcPromise(_0x9d09('0x78'),_0x9d09('0x78'),{'event':_0x9d09('0x81'),'message':_0x2fcad9[_0x9d09('0x29')]},client9002);return _0x2b7a78;}return null;})[_0x9d09('0x22')](respondWithResult(_0x24cc03,null))[_0x9d09('0x2b')](handleError(_0x24cc03,null));};exports['create']=function(_0x13c432,_0xf417d1){var _0x3ca0b2;return db[_0x9d09('0x3a')][_0x9d09('0x82')](_0x13c432[_0x9d09('0x57')],{})[_0x9d09('0x22')](function(_0x322d70){_0x3ca0b2=_0x322d70;return db[_0x9d09('0x83')][_0x9d09('0x84')]({'where':{'id':_0x3ca0b2[_0x9d09('0x6c')]}});})[_0x9d09('0x22')](function(_0x1c9a93){if(_['isNil'](_0x1c9a93)){return;}else{_0x3ca0b2['fax']=_0x1c9a93[_0x9d09('0x5b')];return db[_0x9d09('0x85')]['findOne']({'where':{'id':_0x3ca0b2[_0x9d09('0x86')]}});}})[_0x9d09('0x22')](function(_0x4e18a8){return respondWithRpcPromise(_0x9d09('0x87'),_0x9d09('0x87'),{'FaxAccountId':_[_0x9d09('0x88')](_0x13c432[_0x9d09('0x57')])?undefined:_0x13c432[_0x9d09('0x57')][_0x9d09('0x89')],'path':_[_0x9d09('0x88')](_0x4e18a8)?undefined:util[_0x9d09('0x5e')]('/var/opt/motion2/server/files/attachments/%s',_0x4e18a8[_0x9d09('0x8a')]),'fax':_['isNil'](_0x3ca0b2[_0x9d09('0x5b')])?undefined:_0x3ca0b2[_0x9d09('0x5b')],'AttachmentId':_0x3ca0b2[_0x9d09('0x86')]},client9002);})[_0x9d09('0x22')](respondWithResult(_0xf417d1,0xc9))[_0x9d09('0x2b')](handleError(_0xf417d1,null));};exports[_0x9d09('0x8b')]=function(_0x931471,_0x312305){var _0x4a73c6=path['join'](config['root'],'server',_0x9d09('0x8c'),_0x9d09('0x8d'));return db[_0x9d09('0x3a')][_0x9d09('0x56')]({'where':{'id':_0x931471[_0x9d09('0x55')]['id']},'include':[{'model':db[_0x9d09('0x85')],'as':_0x9d09('0x85')}]})[_0x9d09('0x22')](handleEntityNotFound(_0x312305,null))[_0x9d09('0x22')](function(_0x45961d){if(_0x45961d){return _0x312305[_0x9d09('0x8b')](path['join'](_0x4a73c6,_0x45961d[_0x9d09('0x85')][_0x9d09('0x8a')]));}})[_0x9d09('0x2b')](handleError(_0x312305,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 0e08467..29e828b 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 _0xc4aa=['../../mysqldb','FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xc4aa[_0x3511d3];return _0x5d6321;};'use strict';var EventEmitter=require(_0xac4a('0x0'));var FaxMessage=require(_0xac4a('0x1'))['db'][_0xac4a('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xac4a('0x3')](0x0);var events={'afterCreate':_0xac4a('0x4'),'afterUpdate':_0xac4a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5cda73){return function(_0x47d4f6,_0x2f48ed,_0x15b967){FaxMessageEvents[_0xac4a('0x6')](_0x5cda73+':'+_0x47d4f6['id'],_0x47d4f6);FaxMessageEvents[_0xac4a('0x6')](_0x5cda73,_0x47d4f6);_0x15b967(null);};}for(var e in events){if(events[_0xac4a('0x7')](e)){var event=events[e];FaxMessage[_0xac4a('0x8')](e,emitEvent(event));}}module[_0xac4a('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x0a93=['hasOwnProperty','hook','events','../../mysqldb','FaxMessage','save','update','remove'];(function(_0x48ab51,_0x29158b){var _0x44d99e=function(_0x511608){while(--_0x511608){_0x48ab51['push'](_0x48ab51['shift']());}};_0x44d99e(++_0x29158b);}(_0x0a93,0x6a));var _0x30a9=function(_0x4dc117,_0x4abc27){_0x4dc117=_0x4dc117-0x0;var _0x21b849=_0x0a93[_0x4dc117];return _0x21b849;};'use strict';var EventEmitter=require(_0x30a9('0x0'));var FaxMessage=require(_0x30a9('0x1'))['db'][_0x30a9('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x30a9('0x3'),'afterUpdate':_0x30a9('0x4'),'afterDestroy':_0x30a9('0x5')};function emitEvent(_0x2bdf19){return function(_0x556c5e,_0x53e03b,_0x54321d){FaxMessageEvents['emit'](_0x2bdf19+':'+_0x556c5e['id'],_0x556c5e);FaxMessageEvents['emit'](_0x2bdf19,_0x556c5e);_0x54321d(null);};}for(var e in events){if(events[_0x30a9('0x6')](e)){var event=events[e];FaxMessage[_0x30a9('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index c19ff72..931f6d9 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 _0xdb8a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x3c84e7,_0x1326a1){var _0x414796=function(_0x21ad90){while(--_0x21ad90){_0x3c84e7['push'](_0x3c84e7['shift']());}};_0x414796(++_0x1326a1);}(_0xdb8a,0x97));var _0xadb8=function(_0x147e9f,_0x57b3cb){_0x147e9f=_0x147e9f-0x0;var _0x321585=_0xdb8a[_0x147e9f];return _0x321585;};'use strict';var _=require(_0xadb8('0x0'));var util=require(_0xadb8('0x1'));var logger=require(_0xadb8('0x2'))(_0xadb8('0x3'));var moment=require(_0xadb8('0x4'));var BPromise=require(_0xadb8('0x5'));var rp=require(_0xadb8('0x6'));var fs=require('fs');var path=require(_0xadb8('0x7'));var rimraf=require(_0xadb8('0x8'));var config=require(_0xadb8('0x9'));var attributes=require(_0xadb8('0xa'));module[_0xadb8('0xb')]=function(_0x302407,_0x34c919){return _0x302407[_0xadb8('0xc')](_0xadb8('0xd'),attributes,{'tableName':_0xadb8('0xe'),'paranoid':![],'indexes':[{'name':_0xadb8('0xf'),'fields':[_0xadb8('0x10')],'type':_0xadb8('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c1500,_0x320db9,_0x2e2d8c){var _0x281783=_0x302407[_0xadb8('0x12')];var _0x541213=_0x1c1500[_0xadb8('0x13')]({'plain':!![]});if(_0x541213['direction']['toLowerCase']()==='in'||_0x541213[_0xadb8('0x14')][_0xadb8('0x15')]()==='out'&&!_0x541213[_0xadb8('0x16')]&&!_[_0xadb8('0x17')](_0x541213[_0xadb8('0x18')])){_0x281783[_0xadb8('0x19')]['findOne']({'where':{'id':_0x541213[_0xadb8('0x1a')]}})[_0xadb8('0x1b')](function(_0x241d2a){if(_0x241d2a){_0x241d2a['update']({'lastMsgAt':_0x541213['createdAt'],'lastMsgDirection':_0x541213[_0xadb8('0x14')][_0xadb8('0x15')]()});}})[_0xadb8('0x1c')](function(_0x5edb05){console['error'](_0x5edb05);});}_0x2e2d8c();}},'charset':_0xadb8('0x1d'),'collate':_0xadb8('0x1e')});}; \ No newline at end of file +var _0x30a1=['get','toLowerCase','direction','out','secret','UserId','findOne','FaxInteractionId','then','update','catch','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','rimraf','./faxMessage.attributes','exports','body','FULLTEXT'];(function(_0xf24f30,_0x77205b){var _0x364bea=function(_0x562a10){while(--_0x562a10){_0xf24f30['push'](_0xf24f30['shift']());}};_0x364bea(++_0x77205b);}(_0x30a1,0xde));var _0x130a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x30a1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x130a('0x0'));var util=require(_0x130a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x130a('0x2'));var rp=require(_0x130a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x130a('0x4'));var config=require('../../config/environment');var attributes=require(_0x130a('0x5'));module[_0x130a('0x6')]=function(_0x56a91c,_0xfb4896){return _0x56a91c['define']('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x130a('0x7')],'type':_0x130a('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e70dc,_0x4a5778,_0x4513ea){var _0x4c9a1e=_0x56a91c['models'];var _0x1115a4=_0x1e70dc[_0x130a('0x9')]({'plain':!![]});if(_0x1115a4['direction'][_0x130a('0xa')]()==='in'||_0x1115a4[_0x130a('0xb')]['toLowerCase']()===_0x130a('0xc')&&!_0x1115a4[_0x130a('0xd')]&&!_['isNil'](_0x1115a4[_0x130a('0xe')])){_0x4c9a1e['FaxInteraction'][_0x130a('0xf')]({'where':{'id':_0x1115a4[_0x130a('0x10')]}})[_0x130a('0x11')](function(_0x435687){if(_0x435687){_0x435687[_0x130a('0x12')]({'lastMsgAt':_0x1115a4['createdAt'],'lastMsgDirection':_0x1115a4['direction'][_0x130a('0xa')]()});}})[_0x130a('0x13')](function(_0x4962c2){console['error'](_0x4962c2);});}_0x4513ea();}},'charset':'utf8mb4','collate':_0x130a('0x14')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 8e207d0..8d8cd1c 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 _0xedd9=['create','body','raw','CreateFaxMessage','catch','FaxMessage','update','options','where','attributes','limit','UpdateFaxMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x248487,_0x253501){var _0x380ccd=function(_0x553aeb){while(--_0x553aeb){_0x248487['push'](_0x248487['shift']());}};_0x380ccd(++_0x253501);}(_0xedd9,0xfc));var _0x9edd=function(_0x3db43a,_0x380b7f){_0x3db43a=_0x3db43a-0x0;var _0x11e9e7=_0xedd9[_0x3db43a];return _0x11e9e7;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});config['redis']=_[_0x9edd('0xc')](config['redis'],{'host':_0x9edd('0xd'),'port':0x18eb});var socket=require(_0x9edd('0xe'))(new Redis(config[_0x9edd('0xf')]));require(_0x9edd('0x10'))['register'](socket);function respondWithRpcPromise(_0x494a24,_0x5d2f90,_0x2076fc){return new BPromise(function(_0x138767,_0x523026){return client[_0x9edd('0x11')](_0x494a24,_0x2076fc)[_0x9edd('0x12')](function(_0x5b6c00){logger[_0x9edd('0x13')](_0x9edd('0x14'),_0x5d2f90,_0x9edd('0x15'));logger[_0x9edd('0x16')](_0x9edd('0x17'),_0x5d2f90,_0x9edd('0x15'),JSON[_0x9edd('0x18')](_0x5b6c00));if(_0x5b6c00[_0x9edd('0x19')]){if(_0x5b6c00['error'][_0x9edd('0x1a')]===0x1f4){logger[_0x9edd('0x19')](_0x9edd('0x14'),_0x5d2f90,_0x5b6c00[_0x9edd('0x19')][_0x9edd('0x1b')]);return _0x523026(_0x5b6c00[_0x9edd('0x19')][_0x9edd('0x1b')]);}logger[_0x9edd('0x19')]('FaxMessage,\x20%s,\x20%s',_0x5d2f90,_0x5b6c00[_0x9edd('0x19')][_0x9edd('0x1b')]);return _0x138767(_0x5b6c00[_0x9edd('0x19')]['message']);}else{logger[_0x9edd('0x13')](_0x9edd('0x14'),_0x5d2f90,_0x9edd('0x15'));_0x138767(_0x5b6c00['result'][_0x9edd('0x1b')]);}})['catch'](function(_0x2cdcef){logger[_0x9edd('0x19')]('FaxMessage,\x20%s,\x20%s',_0x5d2f90,_0x2cdcef);_0x523026(_0x2cdcef);});});}exports['CreateFaxMessage']=function(_0x45c3ab){var _0x50338f=this;return new Promise(function(_0x27a95a,_0x54a03f){return db['FaxMessage'][_0x9edd('0x1c')](_0x45c3ab[_0x9edd('0x1d')],{'raw':_0x45c3ab['options']?_0x45c3ab['options'][_0x9edd('0x1e')]===undefined?!![]:![]:!![]})[_0x9edd('0x12')](function(_0x477878){logger['info'](_0x9edd('0x1f'),_0x45c3ab);logger[_0x9edd('0x16')](_0x9edd('0x1f'),_0x45c3ab,JSON[_0x9edd('0x18')](_0x477878));_0x27a95a(_0x477878);})[_0x9edd('0x20')](function(_0x4c75d2){logger[_0x9edd('0x19')](_0x9edd('0x1f'),_0x4c75d2[_0x9edd('0x1b')],_0x45c3ab);_0x54a03f(_0x50338f[_0x9edd('0x19')](0x1f4,_0x4c75d2[_0x9edd('0x1b')]));});});};exports['UpdateFaxMessage']=function(_0x4b3d1b){var _0x3276ee=this;return new Promise(function(_0xfeca7b,_0x8d67aa){return db[_0x9edd('0x21')][_0x9edd('0x22')](_0x4b3d1b['body'],{'raw':_0x4b3d1b['options']?_0x4b3d1b[_0x9edd('0x23')][_0x9edd('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b3d1b[_0x9edd('0x23')]?_0x4b3d1b['options'][_0x9edd('0x24')]||null:null,'attributes':_0x4b3d1b[_0x9edd('0x23')]?_0x4b3d1b[_0x9edd('0x23')][_0x9edd('0x25')]||null:null,'limit':_0x4b3d1b['options']?_0x4b3d1b[_0x9edd('0x23')][_0x9edd('0x26')]||null:null})[_0x9edd('0x12')](function(_0x12c1bc){logger[_0x9edd('0x13')](_0x9edd('0x27'),_0x4b3d1b);logger[_0x9edd('0x16')](_0x9edd('0x27'),_0x4b3d1b,JSON[_0x9edd('0x18')](_0x12c1bc));_0xfeca7b(_0x12c1bc);})[_0x9edd('0x20')](function(_0x4fd03f){logger[_0x9edd('0x19')](_0x9edd('0x27'),_0x4fd03f[_0x9edd('0x1b')],_0x4b3d1b);_0x8d67aa(_0x3276ee[_0x9edd('0x19')](0x1f4,_0x4fd03f['message']));});});}; \ No newline at end of file +var _0x3e74=['result','catch','FaxMessage,\x20%s,\x20%s','CreateFaxMessage','create','body','options','raw','then','attributes','limit','UpdateFaxMessage','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x282424,_0x16d72a){var _0x10543b=function(_0x4449af){while(--_0x4449af){_0x282424['push'](_0x282424['shift']());}};_0x10543b(++_0x16d72a);}(_0x3e74,0x175));var _0x43e7=function(_0x3b2241,_0xfc7391){_0x3b2241=_0x3b2241-0x0;var _0x4f0cc2=_0x3e74[_0x3b2241];return _0x4f0cc2;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});config['redis']=_[_0x43e7('0xa')](config[_0x43e7('0xb')],{'host':_0x43e7('0xc'),'port':0x18eb});var socket=require(_0x43e7('0xd'))(new Redis(config[_0x43e7('0xb')]));require('./faxMessage.socket')[_0x43e7('0xe')](socket);function respondWithRpcPromise(_0x554d44,_0x54948c,_0x39c8bd){return new BPromise(function(_0x4139c9,_0x5c34f4){return client[_0x43e7('0xf')](_0x554d44,_0x39c8bd)['then'](function(_0xf7c520){logger[_0x43e7('0x10')]('FaxMessage,\x20%s,\x20%s',_0x54948c,_0x43e7('0x11'));logger[_0x43e7('0x12')](_0x43e7('0x13'),_0x54948c,_0x43e7('0x11'),JSON['stringify'](_0xf7c520));if(_0xf7c520['error']){if(_0xf7c520[_0x43e7('0x14')][_0x43e7('0x15')]===0x1f4){logger[_0x43e7('0x14')]('FaxMessage,\x20%s,\x20%s',_0x54948c,_0xf7c520['error'][_0x43e7('0x16')]);return _0x5c34f4(_0xf7c520[_0x43e7('0x14')][_0x43e7('0x16')]);}logger[_0x43e7('0x14')]('FaxMessage,\x20%s,\x20%s',_0x54948c,_0xf7c520['error'][_0x43e7('0x16')]);return _0x4139c9(_0xf7c520[_0x43e7('0x14')][_0x43e7('0x16')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x54948c,_0x43e7('0x11'));_0x4139c9(_0xf7c520[_0x43e7('0x17')][_0x43e7('0x16')]);}})[_0x43e7('0x18')](function(_0x3776f5){logger[_0x43e7('0x14')](_0x43e7('0x19'),_0x54948c,_0x3776f5);_0x5c34f4(_0x3776f5);});});}exports[_0x43e7('0x1a')]=function(_0x2377a3){var _0xab63cf=this;return new Promise(function(_0x191dd5,_0x177ee1){return db['FaxMessage'][_0x43e7('0x1b')](_0x2377a3[_0x43e7('0x1c')],{'raw':_0x2377a3['options']?_0x2377a3[_0x43e7('0x1d')][_0x43e7('0x1e')]===undefined?!![]:![]:!![]})[_0x43e7('0x1f')](function(_0x28aacc){logger[_0x43e7('0x10')](_0x43e7('0x1a'),_0x2377a3);logger['debug'](_0x43e7('0x1a'),_0x2377a3,JSON['stringify'](_0x28aacc));_0x191dd5(_0x28aacc);})['catch'](function(_0x47204e){logger[_0x43e7('0x14')]('CreateFaxMessage',_0x47204e[_0x43e7('0x16')],_0x2377a3);_0x177ee1(_0xab63cf['error'](0x1f4,_0x47204e[_0x43e7('0x16')]));});});};exports['UpdateFaxMessage']=function(_0x1af208){var _0x1b5f50=this;return new Promise(function(_0x20888b,_0x405f85){return db['FaxMessage']['update'](_0x1af208[_0x43e7('0x1c')],{'raw':_0x1af208['options']?_0x1af208[_0x43e7('0x1d')][_0x43e7('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1af208[_0x43e7('0x1d')]?_0x1af208[_0x43e7('0x1d')]['where']||null:null,'attributes':_0x1af208[_0x43e7('0x1d')]?_0x1af208[_0x43e7('0x1d')][_0x43e7('0x20')]||null:null,'limit':_0x1af208[_0x43e7('0x1d')]?_0x1af208[_0x43e7('0x1d')][_0x43e7('0x21')]||null:null})[_0x43e7('0x1f')](function(_0x31b2a6){logger[_0x43e7('0x10')](_0x43e7('0x22'),_0x1af208);logger[_0x43e7('0x12')](_0x43e7('0x22'),_0x1af208,JSON[_0x43e7('0x23')](_0x31b2a6));_0x20888b(_0x31b2a6);})[_0x43e7('0x18')](function(_0x4bdb17){logger[_0x43e7('0x14')](_0x43e7('0x22'),_0x4bdb17[_0x43e7('0x16')],_0x1af208);_0x405f85(_0x1b5f50[_0x43e7('0x14')](0x1f4,_0x4bdb17[_0x43e7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index cead109..91a5db9 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 _0x1453=['remove','update','emit','removeListener','register','length','save'];(function(_0x1b07ca,_0x27943d){var _0x524114=function(_0x2178bc){while(--_0x2178bc){_0x1b07ca['push'](_0x1b07ca['shift']());}};_0x524114(++_0x27943d);}(_0x1453,0x13a));var _0x3145=function(_0x31c817,_0x25d113){_0x31c817=_0x31c817-0x0;var _0x228c58=_0x1453[_0x31c817];return _0x228c58;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x3145('0x0'),_0x3145('0x1'),_0x3145('0x2')];function createListener(_0x75f38e,_0x50be91){return function(_0x550b1f){_0x50be91[_0x3145('0x3')](_0x75f38e,_0x550b1f);};}function removeListener(_0xc1d34d,_0x383081){return function(){FaxMessageEvents[_0x3145('0x4')](_0xc1d34d,_0x383081);};}exports[_0x3145('0x5')]=function(_0x2eb70a){for(var _0x4ed358=0x0,_0x54504b=events[_0x3145('0x6')];_0x4ed358<_0x54504b;_0x4ed358++){var _0x472779=events[_0x4ed358];var _0x254696=createListener('faxMessage:'+_0x472779,_0x2eb70a);FaxMessageEvents['on'](_0x472779,_0x254696);}}; \ No newline at end of file +var _0x5d33=['register','./faxMessage.events','save','emit','removeListener'];(function(_0xb39efc,_0x33728e){var _0x5805dd=function(_0x40a366){while(--_0x40a366){_0xb39efc['push'](_0xb39efc['shift']());}};_0x5805dd(++_0x33728e);}(_0x5d33,0x1af));var _0x35d3=function(_0x471260,_0x220c65){_0x471260=_0x471260-0x0;var _0x1f6930=_0x5d33[_0x471260];return _0x1f6930;};'use strict';var FaxMessageEvents=require(_0x35d3('0x0'));var events=[_0x35d3('0x1'),'remove','update'];function createListener(_0xc59537,_0x159a1b){return function(_0x2d04c8){_0x159a1b[_0x35d3('0x2')](_0xc59537,_0x2d04c8);};}function removeListener(_0x4643f7,_0x361898){return function(){FaxMessageEvents[_0x35d3('0x3')](_0x4643f7,_0x361898);};}exports[_0x35d3('0x4')]=function(_0x401b76){for(var _0x5d9948=0x0,_0x3a1b97=events['length'];_0x5d9948<_0x3a1b97;_0x5d9948++){var _0x54c1c0=events[_0x5d9948];var _0x2d03ea=createListener('faxMessage:'+_0x54c1c0,_0x401b76);FaxMessageEvents['on'](_0x54c1c0,_0x2d03ea);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index dbf9715..3cc9d29 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 _0xf45e=['get','isAuthenticated','index','/describe','describe','/:id','show','download','post','tracked','fax','create','put','update','/:id/reject','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller'];(function(_0x38f665,_0x5ef777){var _0x35e895=function(_0x5828bd){while(--_0x5828bd){_0x38f665['push'](_0x38f665['shift']());}};_0x35e895(++_0x5ef777);}(_0xf45e,0x115));var _0xef45=function(_0x49e4d5,_0xae45ec){_0x49e4d5=_0x49e4d5-0x0;var _0x412cbc=_0xf45e[_0x49e4d5];return _0x412cbc;};'use strict';var multer=require(_0xef45('0x0'));var util=require('util');var path=require(_0xef45('0x1'));var timeout=require('connect-timeout');var express=require(_0xef45('0x2'));var router=express[_0xef45('0x3')]();var fs_extra=require(_0xef45('0x4'));var auth=require(_0xef45('0x5'));var interaction=require(_0xef45('0x6'));var config=require(_0xef45('0x7'));var controller=require(_0xef45('0x8'));router[_0xef45('0x9')]('/',auth[_0xef45('0xa')](),controller[_0xef45('0xb')]);router[_0xef45('0x9')](_0xef45('0xc'),auth[_0xef45('0xa')](),controller[_0xef45('0xd')]);router[_0xef45('0x9')](_0xef45('0xe'),auth[_0xef45('0xa')](),controller[_0xef45('0xf')]);router[_0xef45('0x9')]('/:id/download',auth[_0xef45('0xa')](),controller[_0xef45('0x10')]);router[_0xef45('0x11')]('/',auth[_0xef45('0xa')](),interaction[_0xef45('0x12')](_0xef45('0x13'),'faxmessage:create'),controller[_0xef45('0x14')]);router[_0xef45('0x15')](_0xef45('0xe'),auth[_0xef45('0xa')](),controller[_0xef45('0x16')]);router['put']('/:id/accept',auth[_0xef45('0xa')](),controller['accept']);router[_0xef45('0x15')](_0xef45('0x17'),auth[_0xef45('0xa')](),controller['reject']);router['delete'](_0xef45('0xe'),auth['isAuthenticated'](),controller[_0xef45('0x18')]);module[_0xef45('0x19')]=router; \ No newline at end of file +var _0x0565=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/download','post','tracked','create','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer'];(function(_0x4200e3,_0xb34e23){var _0x26ac37=function(_0x5b09e5){while(--_0x5b09e5){_0x4200e3['push'](_0x4200e3['shift']());}};_0x26ac37(++_0xb34e23);}(_0x0565,0xf2));var _0x5056=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x0565[_0x1b7368];return _0x25d54c;};'use strict';var multer=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var path=require(_0x5056('0x2'));var timeout=require(_0x5056('0x3'));var express=require(_0x5056('0x4'));var router=express[_0x5056('0x5')]();var fs_extra=require(_0x5056('0x6'));var auth=require(_0x5056('0x7'));var interaction=require(_0x5056('0x8'));var config=require(_0x5056('0x9'));var controller=require('./faxMessage.controller');router[_0x5056('0xa')]('/',auth[_0x5056('0xb')](),controller[_0x5056('0xc')]);router[_0x5056('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x5056('0xd')]);router[_0x5056('0xa')](_0x5056('0xe'),auth[_0x5056('0xb')](),controller[_0x5056('0xf')]);router[_0x5056('0xa')](_0x5056('0x10'),auth[_0x5056('0xb')](),controller['download']);router[_0x5056('0x11')]('/',auth[_0x5056('0xb')](),interaction[_0x5056('0x12')]('fax','faxmessage:create'),controller[_0x5056('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5056('0x14')]);router['put'](_0x5056('0x15'),auth[_0x5056('0xb')](),controller[_0x5056('0x16')]);router['put'](_0x5056('0x17'),auth[_0x5056('0xb')](),controller[_0x5056('0x18')]);router[_0x5056('0x19')](_0x5056('0xe'),auth[_0x5056('0xb')](),controller['destroy']);module[_0x5056('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index fd5c4f6..8cc0930 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 _0x6a80=['STRING','INTEGER','ENUM','rrmemory','sequelize','exports','name'];(function(_0x433c29,_0x4e15b6){var _0x909acf=function(_0x1e176d){while(--_0x1e176d){_0x433c29['push'](_0x433c29['shift']());}};_0x909acf(++_0x4e15b6);}(_0x6a80,0x1e7));var _0x06a8=function(_0x5d9528,_0x347967){_0x5d9528=_0x5d9528-0x0;var _0x1ca873=_0x6a80[_0x5d9528];return _0x1ca873;};'use strict';var Sequelize=require(_0x06a8('0x0'));module[_0x06a8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x06a8('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x06a8('0x3')]},'timeout':{'type':Sequelize[_0x06a8('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x06a8('0x5')](_0x06a8('0x6'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x06a8('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8738=['STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0x8738,0x1aa));var _0x8873=function(_0x154f6a,_0x4c617b){_0x154f6a=_0x154f6a-0x0;var _0x833e6e=_0x8738[_0x154f6a];return _0x833e6e;};'use strict';var Sequelize=require(_0x8873('0x0'));module['exports']={'name':{'type':Sequelize[_0x8873('0x1')],'unique':_0x8873('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8873('0x1')]},'timeout':{'type':Sequelize[_0x8873('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8873('0x4')](_0x8873('0x5'),'beepall',_0x8873('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index df7e628..daee366 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 _0x4f0d=['register','sendStatus','end','status','json','offset','undefined','count','limit','set','update','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','model','keys','intersection','attributes','fields','length','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserFaxQueue','filters','hasOwnProperty','nolimit','sort','pick','FaxQueueId','User','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','SIP','faxPause','order','filter','getTeams','ids','online','voicePause','flatMap','Agents','sequelize','transaction','each','forEach','emit','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','all','union','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','userFaxQueue:save','getAgents','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','socket.io-emitter'];(function(_0x34f938,_0x2e0940){var _0x49afc7=function(_0x537810){while(--_0x537810){_0x34f938['push'](_0x34f938['shift']());}};_0x49afc7(++_0x2e0940);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0xb6c029,_0x289717){_0xb6c029=_0xb6c029-0x0;var _0x369954=_0x4f0d[_0xb6c029];return _0x369954;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var squel=require('squel');var Redis=require('ioredis');var qs=require(_0xd4f0('0x0'));var logger=require(_0xd4f0('0x1'))(_0xd4f0('0x2'));var config=require('../../config/environment');var db=require(_0xd4f0('0x3'))['db'];config['redis']=_['defaults'](config[_0xd4f0('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0xd4f0('0x5'))(new Redis(config[_0xd4f0('0x4')]));require('./faxQueue.socket')[_0xd4f0('0x6')](socket);function respondWithStatusCode(_0x69309d,_0x259322){_0x259322=_0x259322||0xcc;return function(_0x4352ac){if(_0x4352ac){return _0x69309d[_0xd4f0('0x7')](_0x259322);}return _0x69309d['status'](_0x259322)[_0xd4f0('0x8')]();};}function respondWithResult(_0x40ed12,_0x560374){_0x560374=_0x560374||0xc8;return function(_0x5225c7){if(_0x5225c7){return _0x40ed12[_0xd4f0('0x9')](_0x560374)[_0xd4f0('0xa')](_0x5225c7);}};}function respondWithFilteredResult(_0x47ea6a,_0x386856){return function(_0x10d46c){if(_0x10d46c){var _0x20c407=typeof _0x386856[_0xd4f0('0xb')]===_0xd4f0('0xc')&&typeof _0x386856['limit']===_0xd4f0('0xc');var _0x2c3e99=_0x10d46c[_0xd4f0('0xd')];var _0x46b4de=_0x20c407?0x0:_0x386856[_0xd4f0('0xb')];var _0x544936=_0x20c407?_0x10d46c[_0xd4f0('0xd')]:_0x386856[_0xd4f0('0xb')]+_0x386856[_0xd4f0('0xe')];var _0x21eb54;if(_0x544936>=_0x2c3e99){_0x544936=_0x2c3e99;_0x21eb54=0xc8;}else{_0x21eb54=0xce;}_0x47ea6a[_0xd4f0('0x9')](_0x21eb54);return _0x47ea6a[_0xd4f0('0xf')]('Content-Range',_0x46b4de+'-'+_0x544936+'/'+_0x2c3e99)['json'](_0x10d46c);}return null;};}function saveUpdates(_0x169443){return function(_0x1dfc5b){if(_0x1dfc5b){return _0x1dfc5b[_0xd4f0('0x10')](_0x169443)[_0xd4f0('0x11')](function(_0x4d0dcc){return _0x4d0dcc;});}return null;};}function removeEntity(_0x5bf265){return function(_0x122d27){if(_0x122d27){return _0x122d27[_0xd4f0('0x12')]()[_0xd4f0('0x11')](function(){var _0x2e4351=_0x122d27[_0xd4f0('0x13')]({'plain':!![]});var _0x410a93=_0xd4f0('0x14');return db[_0xd4f0('0x15')][_0xd4f0('0x12')]({'where':{'type':_0x410a93,'resourceId':_0x2e4351['id']}})[_0xd4f0('0x11')](function(){return _0x122d27;});})['then'](function(){_0x5bf265[_0xd4f0('0x9')](0xcc)[_0xd4f0('0x8')]();});}};}function handleEntityNotFound(_0xa16111){return function(_0x49be54){if(!_0x49be54){_0xa16111[_0xd4f0('0x7')](0x194);}return _0x49be54;};}function handleError(_0x31c7a0,_0x655480){_0x655480=_0x655480||0x1f4;return function(_0x5b94bb){logger[_0xd4f0('0x16')](_0x5b94bb[_0xd4f0('0x17')]);if(_0x5b94bb[_0xd4f0('0x18')]){delete _0x5b94bb[_0xd4f0('0x18')];}_0x31c7a0['status'](_0x655480)[_0xd4f0('0x19')](_0x5b94bb);};}exports[_0xd4f0('0x1a')]=function(_0x9a1fe6,_0x4315be){var _0x5f4858={};var _0x37e8a1={'count':0x0,'rows':[]};var _0x49b94b=_[_0xd4f0('0x1b')](db[_0xd4f0('0x1c')][_0xd4f0('0x1d')],function(_0x22d385){return{'name':_0x22d385[_0xd4f0('0x1e')],'type':_0x22d385[_0xd4f0('0x1f')][_0xd4f0('0x20')]};});_0x5f4858=qs[_0xd4f0('0x21')](_0x49b94b,_0x9a1fe6);var _0x396db4={'where':_0x5f4858[_0xd4f0('0x22')]};return db[_0xd4f0('0x1c')]['count'](_0x396db4)[_0xd4f0('0x11')](function(_0xa77559){_0x37e8a1[_0xd4f0('0xd')]=_0xa77559;_0x5f4858[_0xd4f0('0x23')]=qs['include'](_0x9a1fe6[_0xd4f0('0x24')]);return db[_0xd4f0('0x1c')][_0xd4f0('0x25')](_0x5f4858);})[_0xd4f0('0x11')](function(_0x4b8244){_0x37e8a1[_0xd4f0('0x26')]=_0x4b8244;return _0x37e8a1;})[_0xd4f0('0x11')](respondWithFilteredResult(_0x4315be,_0x5f4858))[_0xd4f0('0x27')](handleError(_0x4315be,null));};exports[_0xd4f0('0x28')]=function(_0x5a560c,_0x8af72e){var _0x2cb68f={'raw':!![],'where':{'id':_0x5a560c[_0xd4f0('0x29')]['id']}},_0x39153a={};_0x39153a[_0xd4f0('0x2a')]=_[_0xd4f0('0x2b')](db[_0xd4f0('0x1c')][_0xd4f0('0x1d')]);_0x39153a[_0xd4f0('0x24')]=_[_0xd4f0('0x2b')](_0x5a560c[_0xd4f0('0x24')]);_0x39153a['filters']=_[_0xd4f0('0x2c')](_0x39153a[_0xd4f0('0x2a')],_0x39153a[_0xd4f0('0x24')]);_0x2cb68f[_0xd4f0('0x2d')]=_[_0xd4f0('0x2c')](_0x39153a['model'],qs[_0xd4f0('0x2e')](_0x5a560c[_0xd4f0('0x24')]['fields']));_0x2cb68f[_0xd4f0('0x2d')]=_0x2cb68f[_0xd4f0('0x2d')][_0xd4f0('0x2f')]?_0x2cb68f['attributes']:_0x39153a[_0xd4f0('0x2a')];if(_0x5a560c['query']['includeAll']){_0x2cb68f['include']=[{'all':!![]}];}_0x2cb68f=_[_0xd4f0('0x30')]({},_0x2cb68f,_0x5a560c[_0xd4f0('0x31')]);return db[_0xd4f0('0x1c')][_0xd4f0('0x32')](_0x2cb68f)[_0xd4f0('0x11')](handleEntityNotFound(_0x8af72e,null))['then'](respondWithResult(_0x8af72e,null))['catch'](handleError(_0x8af72e,null));};exports[_0xd4f0('0x33')]=function(_0x14a35e,_0x386ec3){return db['FaxQueue'][_0xd4f0('0x33')](_0x14a35e[_0xd4f0('0x34')],{})[_0xd4f0('0x11')](function(_0x50b560){var _0x42d518=_0x14a35e['user'][_0xd4f0('0x13')]({'plain':!![]});if(!_0x42d518)throw new Error(_0xd4f0('0x35'));if(_0x42d518[_0xd4f0('0x36')]===_0xd4f0('0x37')){var _0x1c61d3=_0x50b560[_0xd4f0('0x13')]({'plain':!![]});var _0x50904e='FaxQueues';return db[_0xd4f0('0x38')][_0xd4f0('0x32')]({'where':{'name':_0x50904e,'userProfileId':_0x42d518['userProfileId']},'raw':!![]})[_0xd4f0('0x11')](function(_0x24dacc){if(_0x24dacc&&_0x24dacc[_0xd4f0('0x39')]===0x0){return db[_0xd4f0('0x15')][_0xd4f0('0x33')]({'name':_0x1c61d3[_0xd4f0('0x18')],'resourceId':_0x1c61d3['id'],'type':_0x24dacc['name'],'sectionId':_0x24dacc['id']},{})[_0xd4f0('0x11')](function(){return _0x50b560;});}else{return _0x50b560;}})[_0xd4f0('0x27')](function(_0x2e59e4){logger[_0xd4f0('0x16')](_0xd4f0('0x3a'),_0x2e59e4);throw _0x2e59e4;});}return _0x50b560;})[_0xd4f0('0x11')](respondWithResult(_0x386ec3,0xc9))['catch'](handleError(_0x386ec3,null));};exports[_0xd4f0('0x10')]=function(_0x16f52a,_0x4c323d){if(_0x16f52a['body']['id']){delete _0x16f52a[_0xd4f0('0x34')]['id'];}return db[_0xd4f0('0x1c')][_0xd4f0('0x32')]({'where':{'id':_0x16f52a['params']['id']}})['then'](handleEntityNotFound(_0x4c323d,null))[_0xd4f0('0x11')](saveUpdates(_0x16f52a[_0xd4f0('0x34')],null))[_0xd4f0('0x11')](respondWithResult(_0x4c323d,null))[_0xd4f0('0x27')](handleError(_0x4c323d,null));};exports[_0xd4f0('0x12')]=function(_0x128e50,_0x358d84){return db[_0xd4f0('0x1c')][_0xd4f0('0x32')]({'where':{'id':_0x128e50[_0xd4f0('0x29')]['id']}})[_0xd4f0('0x11')](handleEntityNotFound(_0x358d84,null))[_0xd4f0('0x11')](removeEntity(_0x358d84,null))[_0xd4f0('0x27')](handleError(_0x358d84,null));};exports['describe']=function(_0x1b88b0,_0x5b2987){return db[_0xd4f0('0x1c')]['describe']()[_0xd4f0('0x11')](respondWithResult(_0x5b2987,null))[_0xd4f0('0x27')](handleError(_0x5b2987,null));};exports[_0xd4f0('0x3b')]=function(_0x4d07c1,_0x109307){var _0x2cf57a={'raw':!![],'where':{}},_0x59a7ea={},_0x3e6a62;return db['FaxQueue'][_0xd4f0('0x3c')]({'where':{'id':_0x4d07c1[_0xd4f0('0x29')]['id']}})['then'](handleEntityNotFound(_0x109307,null))[_0xd4f0('0x11')](function(_0x373762){if(_0x373762){_0x3e6a62=_0x373762[_0xd4f0('0x13')]({'plain':!![]});_0x59a7ea[_0xd4f0('0x2a')]=_[_0xd4f0('0x2b')](db[_0xd4f0('0x3d')][_0xd4f0('0x1d')]);_0x59a7ea[_0xd4f0('0x24')]=_[_0xd4f0('0x2b')](_0x4d07c1[_0xd4f0('0x24')]);_0x59a7ea[_0xd4f0('0x3e')]=_[_0xd4f0('0x2c')](_0x59a7ea['model'],_0x59a7ea[_0xd4f0('0x24')]);_0x2cf57a[_0xd4f0('0x2d')]=_[_0xd4f0('0x2c')](_0x59a7ea[_0xd4f0('0x2a')],qs[_0xd4f0('0x2e')](_0x4d07c1['query'][_0xd4f0('0x2e')]));_0x2cf57a[_0xd4f0('0x2d')]=_0x2cf57a[_0xd4f0('0x2d')][_0xd4f0('0x2f')]?_0x2cf57a[_0xd4f0('0x2d')]:_0x59a7ea[_0xd4f0('0x2a')];if(!_0x4d07c1[_0xd4f0('0x24')][_0xd4f0('0x3f')](_0xd4f0('0x40'))){_0x2cf57a[_0xd4f0('0xe')]=qs[_0xd4f0('0xe')](_0x4d07c1[_0xd4f0('0x24')][_0xd4f0('0xe')]);_0x2cf57a[_0xd4f0('0xb')]=qs[_0xd4f0('0xb')](_0x4d07c1['query'][_0xd4f0('0xb')]);}_0x2cf57a['order']=qs[_0xd4f0('0x41')](_0x4d07c1[_0xd4f0('0x24')][_0xd4f0('0x41')]);_0x2cf57a['where']=qs[_0xd4f0('0x3e')](_[_0xd4f0('0x42')](_0x4d07c1['query'],_0x59a7ea[_0xd4f0('0x3e')]));_0x2cf57a[_0xd4f0('0x22')][_0xd4f0('0x43')]=_0x373762['id'];if(_0x4d07c1[_0xd4f0('0x24')]['filter']){_0x2cf57a[_0xd4f0('0x22')]=_['merge'](_0x2cf57a[_0xd4f0('0x22')],{'$or':_[_0xd4f0('0x1b')](_0x2cf57a[_0xd4f0('0x2d')],function(_0x2b2266){var _0x2c9478={};_0x2c9478[_0x2b2266]={'$like':'%'+_0x4d07c1['query']['filter']+'%'};return _0x2c9478;})});}_0x2cf57a=_[_0xd4f0('0x30')]({},_0x2cf57a,_0x4d07c1[_0xd4f0('0x31')]);return db[_0xd4f0('0x3d')][_0xd4f0('0x25')](_0x2cf57a);}})[_0xd4f0('0x11')](function(_0x8cd222){if(_0x8cd222){return db[_0xd4f0('0x44')][_0xd4f0('0x45')]({'where':{'id':_[_0xd4f0('0x1b')](_0x8cd222,'UserId'),'role':_0xd4f0('0x46')},'attributes':['id',_0xd4f0('0x18'),'faxPause',_0xd4f0('0x47'),_0xd4f0('0x48')]});}})[_0xd4f0('0x11')](function(_0x1a0ca9){if(_0x1a0ca9){return{'count':_0x1a0ca9['count'],'rows':_['map'](_0x1a0ca9[_0xd4f0('0x26')],function(_0x116e0c){return{'membername':_0x116e0c['name'],'UserId':_0x116e0c['id'],'queue_name':_0x3e6a62['name'],'FaxQueueId':_0x3e6a62['id'],'interface':util[_0xd4f0('0x49')](_0xd4f0('0x4a'),_0xd4f0('0x4b'),_0x116e0c['name']),'penalty':0x0,'paused':_0x116e0c[_0xd4f0('0x4c')],'createdAt':_0x116e0c[_0xd4f0('0x48')],'updatedAt':_0x116e0c[_0xd4f0('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd4f0('0x11')](respondWithFilteredResult(_0x109307,_0x2cf57a))['catch'](handleError(_0x109307,null));};exports['getTeams']=function(_0x2b38a8,_0x4cc423){var _0x680ba9={};var _0x59698a={};var _0x8ea10b;var _0x1f1548;return db['FaxQueue'][_0xd4f0('0x3c')]({'where':{'id':_0x2b38a8[_0xd4f0('0x29')]['id']}})[_0xd4f0('0x11')](handleEntityNotFound(_0x4cc423,null))[_0xd4f0('0x11')](function(_0x2b8a34){if(_0x2b8a34){_0x8ea10b=_0x2b8a34;_0x59698a[_0xd4f0('0x2a')]=_[_0xd4f0('0x2b')](db['Team']['rawAttributes']);_0x59698a[_0xd4f0('0x24')]=_[_0xd4f0('0x2b')](_0x2b38a8['query']);_0x59698a[_0xd4f0('0x3e')]=_['intersection'](_0x59698a[_0xd4f0('0x2a')],_0x59698a[_0xd4f0('0x24')]);_0x680ba9[_0xd4f0('0x2d')]=_[_0xd4f0('0x2c')](_0x59698a[_0xd4f0('0x2a')],qs[_0xd4f0('0x2e')](_0x2b38a8[_0xd4f0('0x24')]['fields']));_0x680ba9[_0xd4f0('0x2d')]=_0x680ba9['attributes'][_0xd4f0('0x2f')]?_0x680ba9[_0xd4f0('0x2d')]:_0x59698a[_0xd4f0('0x2a')];_0x680ba9[_0xd4f0('0x4d')]=qs[_0xd4f0('0x41')](_0x2b38a8['query'][_0xd4f0('0x41')]);_0x680ba9['where']=qs[_0xd4f0('0x3e')](_[_0xd4f0('0x42')](_0x2b38a8['query'],_0x59698a[_0xd4f0('0x3e')]));if(_0x2b38a8[_0xd4f0('0x24')]['filter']){_0x680ba9[_0xd4f0('0x22')]=_[_0xd4f0('0x30')](_0x680ba9[_0xd4f0('0x22')],{'$or':_[_0xd4f0('0x1b')](_0x680ba9[_0xd4f0('0x2d')],function(_0x407c3b){var _0x4e6981={};_0x4e6981[_0x407c3b]={'$like':'%'+_0x2b38a8[_0xd4f0('0x24')][_0xd4f0('0x4e')]+'%'};return _0x4e6981;})});}_0x680ba9=_[_0xd4f0('0x30')]({},_0x680ba9,_0x2b38a8['options']);return _0x8ea10b[_0xd4f0('0x4f')](_0x680ba9);}})[_0xd4f0('0x11')](function(_0x2827b7){if(_0x2827b7){_0x1f1548=_0x2827b7[_0xd4f0('0x2f')];if(!_0x2b38a8['query']['hasOwnProperty'](_0xd4f0('0x40'))){_0x680ba9['limit']=qs[_0xd4f0('0xe')](_0x2b38a8['query'][_0xd4f0('0xe')]);_0x680ba9[_0xd4f0('0xb')]=qs[_0xd4f0('0xb')](_0x2b38a8[_0xd4f0('0x24')][_0xd4f0('0xb')]);}return _0x8ea10b[_0xd4f0('0x4f')](_0x680ba9);}})[_0xd4f0('0x11')](function(_0x21be36){if(_0x21be36){return _0x21be36?{'count':_0x1f1548,'rows':_0x21be36}:null;}})[_0xd4f0('0x11')](respondWithResult(_0x4cc423,null))[_0xd4f0('0x27')](handleError(_0x4cc423,null));};exports['addTeams']=function(_0x5c46a4,_0xee610d){var _0x1386e1=_0x5c46a4[_0xd4f0('0x34')][_0xd4f0('0x50')];return db['Team'][_0xd4f0('0x25')]({'where':{'id':_0x1386e1},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0xd4f0('0x51'),_0xd4f0('0x52'),'interface'],'raw':!![]}]})[_0xd4f0('0x11')](function(_0x3e14e7){if(_0x3e14e7){var _0x187718=_[_0xd4f0('0x53')](_0x3e14e7,function(_0x2e94f9){var _0x93f797=_0x2e94f9[_0xd4f0('0x13')]({'plain':!![]});return _0x93f797[_0xd4f0('0x54')];});return db[_0xd4f0('0x1c')]['find']({'where':{'id':_0x5c46a4[_0xd4f0('0x29')]['id']}})[_0xd4f0('0x11')](function(_0x5810ca){return db[_0xd4f0('0x55')][_0xd4f0('0x56')](function(_0x100185){return _0x5810ca['addTeams'](_0x1386e1,{'transaction':_0x100185})[_0xd4f0('0x11')](function(){return BPromise[_0xd4f0('0x57')](_0x187718,function(_0x201323){return db[_0xd4f0('0x3d')]['findOrCreate']({'where':{'UserId':_0x201323['id'],'FaxQueueId':_0x5c46a4[_0xd4f0('0x29')]['id']},'transaction':_0x100185});});})[_0xd4f0('0x11')](function(){_0x187718[_0xd4f0('0x58')](function(_0x283a97){socket[_0xd4f0('0x59')]('userFaxQueue:save',{'UserId':_0x283a97['id'],'FaxQueueId':_0x5810ca['id']});});});});});}})['then'](respondWithStatusCode(_0xee610d,null))[_0xd4f0('0x27')](handleError(_0xee610d,null));};exports[_0xd4f0('0x5a')]=function(_0x212e4e,_0x22f85e){return db['Team'][_0xd4f0('0x25')]({'where':{'id':_0x212e4e[_0xd4f0('0x24')][_0xd4f0('0x50')]},'attributes':['id'],'include':[{'model':db[_0xd4f0('0x44')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xd4f0('0x11')](handleEntityNotFound(_0x22f85e,null))['then'](function(_0x34c967){var _0x1461dd=_[_0xd4f0('0x1b')](_0x34c967,'id');var _0x40a0a6=[];var _0x5568c2=[];var _0x394f65=squel[_0xd4f0('0x5b')]();_0x394f65[_0xd4f0('0x5c')](_0xd4f0('0x5d'))[_0xd4f0('0x5e')]('team_has_fax_queues','tq')[_0xd4f0('0x5f')](_0xd4f0('0x60'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd4f0('0x22')](_0xd4f0('0x61'),_0x212e4e[_0xd4f0('0x29')]['id']);for(var _0x1d1e73=0x0;_0x1d1e73<_0x34c967[_0xd4f0('0x2f')];_0x1d1e73+=0x1){let _0x4c83ca=_0x34c967[_0x1d1e73];for(var _0x3cc8ab=0x0;_0x3cc8ab<_0x4c83ca[_0xd4f0('0x54')][_0xd4f0('0x2f')];_0x3cc8ab+=0x1){let _0x399897=_0x4c83ca[_0xd4f0('0x54')][_0x3cc8ab];var _0x36e3a0=_0x394f65[_0xd4f0('0x62')]();_0x36e3a0['where'](_0xd4f0('0x63'),_0x399897['id']);_0x5568c2[_0xd4f0('0x64')](db[_0xd4f0('0x55')][_0xd4f0('0x24')](_0x36e3a0[_0xd4f0('0x65')](),{'type':db[_0xd4f0('0x55')]['QueryTypes']['SELECT']})[_0xd4f0('0x11')](function(_0x4514b9){if(_0x4514b9[_0xd4f0('0x2f')]===0x1){return _0x399897['id'];}else{var _0x110936=_[_0xd4f0('0x66')](_[_0xd4f0('0x1b')](_0x4514b9,_0xd4f0('0x67')),function(_0x331b5c){return _['includes'](_0x1461dd,_0x331b5c);});if(_0x110936){return _0x399897['id'];}}}));}}return BPromise[_0xd4f0('0x68')](_0x5568c2)[_0xd4f0('0x11')](function(_0x4fa782){_0x40a0a6=_(_0x40a0a6)[_0xd4f0('0x69')](_0x4fa782)['compact']()[_0xd4f0('0x6a')]();return db['FaxQueue'][_0xd4f0('0x32')]({'where':{'id':_0x212e4e[_0xd4f0('0x29')]['id']}})['then'](function(_0x5e61a4){return db[_0xd4f0('0x55')]['transaction'](function(_0x2f1db6){return _0x5e61a4['removeTeams'](_0x212e4e[_0xd4f0('0x24')][_0xd4f0('0x50')],{'transaction':_0x2f1db6})['then'](function(){if(!_[_0xd4f0('0x6b')](_0x40a0a6)){return _0x5e61a4[_0xd4f0('0x6c')](_0x40a0a6,{'transaction':_0x2f1db6});}})[_0xd4f0('0x11')](function(){_0x40a0a6[_0xd4f0('0x58')](function(_0x280714){socket[_0xd4f0('0x59')](_0xd4f0('0x6d'),{'UserId':_0x280714,'FaxQueueId':_0x5e61a4['id']});});});});});});})[_0xd4f0('0x11')](respondWithStatusCode(_0x22f85e,null))[_0xd4f0('0x27')](handleError(_0x22f85e,null));};exports[_0xd4f0('0x6e')]=function(_0x26ec08,_0x4fc2f4){return db[_0xd4f0('0x1c')]['find']({'where':{'id':_0x26ec08['params']['id']}})[_0xd4f0('0x11')](handleEntityNotFound(_0x4fc2f4,null))[_0xd4f0('0x11')](function(_0x31cd0d){if(_0x31cd0d){return _0x31cd0d[_0xd4f0('0x6e')](_0x26ec08[_0xd4f0('0x34')][_0xd4f0('0x50')],_[_0xd4f0('0x6f')](_0x26ec08[_0xd4f0('0x34')],[_0xd4f0('0x50'),'id'])||{})['spread'](function(_0x3cc058){for(var _0x33ab79=0x0;_0x33ab79<_0x26ec08[_0xd4f0('0x34')][_0xd4f0('0x50')]['length'];_0x33ab79+=0x1){socket[_0xd4f0('0x59')](_0xd4f0('0x70'),{'UserId':Number(_0x26ec08['body'][_0xd4f0('0x50')][_0x33ab79]),'FaxQueueId':Number(_0x26ec08[_0xd4f0('0x29')]['id'])});}return _0x3cc058;});}})[_0xd4f0('0x11')](respondWithResult(_0x4fc2f4,null))[_0xd4f0('0x27')](handleError(_0x4fc2f4,null));};exports[_0xd4f0('0x6c')]=function(_0x2f16b9,_0x3dcde4){return db['FaxQueue'][_0xd4f0('0x32')]({'where':{'id':_0x2f16b9[_0xd4f0('0x29')]['id']}})[_0xd4f0('0x11')](handleEntityNotFound(_0x3dcde4,null))['then'](function(_0x25cec6){if(_0x25cec6){return _0x25cec6['removeAgents'](_0x2f16b9[_0xd4f0('0x24')]['ids'])[_0xd4f0('0x11')](function(){if(_['isArray'](_0x2f16b9[_0xd4f0('0x24')][_0xd4f0('0x50')])){for(var _0x527393=0x0;_0x527393<_0x2f16b9[_0xd4f0('0x24')][_0xd4f0('0x50')][_0xd4f0('0x2f')];_0x527393+=0x1){socket[_0xd4f0('0x59')](_0xd4f0('0x6d'),{'UserId':Number(_0x2f16b9['query'][_0xd4f0('0x50')][_0x527393]),'FaxQueueId':Number(_0x2f16b9[_0xd4f0('0x29')]['id'])});}}else{socket[_0xd4f0('0x59')]('userFaxQueue:remove',{'UserId':Number(_0x2f16b9[_0xd4f0('0x24')][_0xd4f0('0x50')]),'FaxQueueId':Number(_0x2f16b9['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3dcde4,null))[_0xd4f0('0x27')](handleError(_0x3dcde4,null));};exports[_0xd4f0('0x71')]=function(_0xdc707a,_0x188653){var _0x597600={};var _0xb8219={};var _0x33aa55;var _0x1d78fe;return db[_0xd4f0('0x1c')]['findOne']({'where':{'id':_0xdc707a[_0xd4f0('0x29')]['id']}})[_0xd4f0('0x11')](handleEntityNotFound(_0x188653,null))[_0xd4f0('0x11')](function(_0x5cfff7){if(_0x5cfff7){_0x33aa55=_0x5cfff7;_0xb8219[_0xd4f0('0x2a')]=_['keys'](db[_0xd4f0('0x44')][_0xd4f0('0x1d')]);_0xb8219[_0xd4f0('0x24')]=_[_0xd4f0('0x2b')](_0xdc707a[_0xd4f0('0x24')]);_0xb8219[_0xd4f0('0x3e')]=_[_0xd4f0('0x2c')](_0xb8219[_0xd4f0('0x2a')],_0xb8219[_0xd4f0('0x24')]);_0x597600[_0xd4f0('0x2d')]=_[_0xd4f0('0x2c')](_0xb8219[_0xd4f0('0x2a')],qs[_0xd4f0('0x2e')](_0xdc707a[_0xd4f0('0x24')][_0xd4f0('0x2e')]));_0x597600[_0xd4f0('0x2d')]=_0x597600['attributes'][_0xd4f0('0x2f')]?_0x597600[_0xd4f0('0x2d')]:_0xb8219[_0xd4f0('0x2a')];_0x597600['order']=qs['sort'](_0xdc707a[_0xd4f0('0x24')]['sort']);_0x597600[_0xd4f0('0x22')]=qs[_0xd4f0('0x3e')](_[_0xd4f0('0x42')](_0xdc707a['query'],_0xb8219[_0xd4f0('0x3e')]));if(_0xdc707a[_0xd4f0('0x24')][_0xd4f0('0x4e')]){_0x597600[_0xd4f0('0x22')]=_[_0xd4f0('0x30')](_0x597600[_0xd4f0('0x22')],{'$or':_[_0xd4f0('0x1b')](_0x597600[_0xd4f0('0x2d')],function(_0x348d05){var _0x1586c9={};_0x1586c9[_0x348d05]={'$like':'%'+_0xdc707a[_0xd4f0('0x24')][_0xd4f0('0x4e')]+'%'};return _0x1586c9;})});}_0x597600=_['merge']({},_0x597600,_0xdc707a[_0xd4f0('0x31')]);return _0x33aa55['getAgents'](_0x597600);}})[_0xd4f0('0x11')](function(_0x46f790){if(_0x46f790){_0x1d78fe=_0x46f790['length'];if(!_0xdc707a[_0xd4f0('0x24')][_0xd4f0('0x3f')](_0xd4f0('0x40'))){_0x597600[_0xd4f0('0xe')]=qs['limit'](_0xdc707a[_0xd4f0('0x24')][_0xd4f0('0xe')]);_0x597600[_0xd4f0('0xb')]=qs[_0xd4f0('0xb')](_0xdc707a[_0xd4f0('0x24')][_0xd4f0('0xb')]);}return _0x33aa55[_0xd4f0('0x71')](_0x597600);}})['then'](function(_0x9ef706){if(_0x9ef706){return _0x9ef706?{'count':_0x1d78fe,'rows':_0x9ef706}:null;}})[_0xd4f0('0x11')](respondWithResult(_0x188653,null))[_0xd4f0('0x27')](handleError(_0x188653,null));}; \ No newline at end of file +var _0xcd2f=['userFaxQueue:remove','omit','spread','userFaxQueue:save','isArray','getAgents','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','then','get','FaxQueues','UserProfileResource','end','error','name','send','FaxQueue','rawAttributes','fieldName','key','where','include','query','rows','show','params','model','keys','filters','intersection','attributes','fields','includeAll','options','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','length','hasOwnProperty','nolimit','order','sort','filter','merge','map','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','faxPause','getTeams','findOne','Team','pick','addTeams','ids','findAll','User','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','from','team_has_fax_queues','join','user_has_teams','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','includes','all','union','compact','value','isEmpty','removeAgents'];(function(_0x254bc4,_0x95004f){var _0x2f89d6=function(_0x33100a){while(--_0x33100a){_0x254bc4['push'](_0x254bc4['shift']());}};_0x2f89d6(++_0x95004f);}(_0xcd2f,0xf8));var _0xfcd2=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xcd2f[_0x487b0c];return _0x1adbdc;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var squel=require(_0xfcd2('0x0'));var Redis=require(_0xfcd2('0x1'));var qs=require(_0xfcd2('0x2'));var logger=require(_0xfcd2('0x3'))(_0xfcd2('0x4'));var config=require(_0xfcd2('0x5'));var db=require(_0xfcd2('0x6'))['db'];config[_0xfcd2('0x7')]=_['defaults'](config[_0xfcd2('0x7')],{'host':_0xfcd2('0x8'),'port':0x18eb});var socket=require(_0xfcd2('0x9'))(new Redis(config[_0xfcd2('0x7')]));require(_0xfcd2('0xa'))[_0xfcd2('0xb')](socket);function respondWithStatusCode(_0xae2219,_0x46c99b){_0x46c99b=_0x46c99b||0xcc;return function(_0x178eb1){if(_0x178eb1){return _0xae2219[_0xfcd2('0xc')](_0x46c99b);}return _0xae2219[_0xfcd2('0xd')](_0x46c99b)['end']();};}function respondWithResult(_0x5994cf,_0x18fa4d){_0x18fa4d=_0x18fa4d||0xc8;return function(_0x24cd5d){if(_0x24cd5d){return _0x5994cf[_0xfcd2('0xd')](_0x18fa4d)[_0xfcd2('0xe')](_0x24cd5d);}};}function respondWithFilteredResult(_0x53777e,_0x4fb319){return function(_0x4791e9){if(_0x4791e9){var _0x5c4994=typeof _0x4fb319['offset']===_0xfcd2('0xf')&&typeof _0x4fb319[_0xfcd2('0x10')]==='undefined';var _0x12a537=_0x4791e9[_0xfcd2('0x11')];var _0x5ad180=_0x5c4994?0x0:_0x4fb319['offset'];var _0x2825df=_0x5c4994?_0x4791e9[_0xfcd2('0x11')]:_0x4fb319[_0xfcd2('0x12')]+_0x4fb319[_0xfcd2('0x10')];var _0x428cf3;if(_0x2825df>=_0x12a537){_0x2825df=_0x12a537;_0x428cf3=0xc8;}else{_0x428cf3=0xce;}_0x53777e['status'](_0x428cf3);return _0x53777e[_0xfcd2('0x13')](_0xfcd2('0x14'),_0x5ad180+'-'+_0x2825df+'/'+_0x12a537)[_0xfcd2('0xe')](_0x4791e9);}return null;};}function saveUpdates(_0x34aa38){return function(_0x38a776){if(_0x38a776){return _0x38a776[_0xfcd2('0x15')](_0x34aa38)['then'](function(_0xba3186){return _0xba3186;});}return null;};}function removeEntity(_0x268e00){return function(_0x32607c){if(_0x32607c){return _0x32607c[_0xfcd2('0x16')]()[_0xfcd2('0x17')](function(){var _0x17edd6=_0x32607c[_0xfcd2('0x18')]({'plain':!![]});var _0x25371f=_0xfcd2('0x19');return db[_0xfcd2('0x1a')][_0xfcd2('0x16')]({'where':{'type':_0x25371f,'resourceId':_0x17edd6['id']}})[_0xfcd2('0x17')](function(){return _0x32607c;});})['then'](function(){_0x268e00[_0xfcd2('0xd')](0xcc)[_0xfcd2('0x1b')]();});}};}function handleEntityNotFound(_0x25e801){return function(_0x457099){if(!_0x457099){_0x25e801[_0xfcd2('0xc')](0x194);}return _0x457099;};}function handleError(_0x37dafa,_0x19ea4a){_0x19ea4a=_0x19ea4a||0x1f4;return function(_0x40ae55){logger[_0xfcd2('0x1c')](_0x40ae55['stack']);if(_0x40ae55[_0xfcd2('0x1d')]){delete _0x40ae55['name'];}_0x37dafa[_0xfcd2('0xd')](_0x19ea4a)[_0xfcd2('0x1e')](_0x40ae55);};}exports['index']=function(_0x567436,_0x187ae5){var _0xe7fde9={};var _0x193dc3={'count':0x0,'rows':[]};var _0x2b0364=_['map'](db[_0xfcd2('0x1f')][_0xfcd2('0x20')],function(_0x13e447){return{'name':_0x13e447[_0xfcd2('0x21')],'type':_0x13e447['type'][_0xfcd2('0x22')]};});_0xe7fde9=qs['getOptions'](_0x2b0364,_0x567436);var _0x9cf49a={'where':_0xe7fde9[_0xfcd2('0x23')]};return db['FaxQueue'][_0xfcd2('0x11')](_0x9cf49a)[_0xfcd2('0x17')](function(_0x41ecc9){_0x193dc3['count']=_0x41ecc9;_0xe7fde9[_0xfcd2('0x24')]=qs[_0xfcd2('0x24')](_0x567436[_0xfcd2('0x25')]);return db['FaxQueue']['findAll'](_0xe7fde9);})['then'](function(_0xfe01e3){_0x193dc3[_0xfcd2('0x26')]=_0xfe01e3;return _0x193dc3;})[_0xfcd2('0x17')](respondWithFilteredResult(_0x187ae5,_0xe7fde9))['catch'](handleError(_0x187ae5,null));};exports[_0xfcd2('0x27')]=function(_0x3d1273,_0x2934b1){var _0x3e9768={'raw':!![],'where':{'id':_0x3d1273[_0xfcd2('0x28')]['id']}},_0xc5d81e={};_0xc5d81e[_0xfcd2('0x29')]=_['keys'](db['FaxQueue'][_0xfcd2('0x20')]);_0xc5d81e['query']=_[_0xfcd2('0x2a')](_0x3d1273[_0xfcd2('0x25')]);_0xc5d81e[_0xfcd2('0x2b')]=_[_0xfcd2('0x2c')](_0xc5d81e[_0xfcd2('0x29')],_0xc5d81e[_0xfcd2('0x25')]);_0x3e9768[_0xfcd2('0x2d')]=_[_0xfcd2('0x2c')](_0xc5d81e[_0xfcd2('0x29')],qs['fields'](_0x3d1273[_0xfcd2('0x25')][_0xfcd2('0x2e')]));_0x3e9768[_0xfcd2('0x2d')]=_0x3e9768[_0xfcd2('0x2d')]['length']?_0x3e9768['attributes']:_0xc5d81e[_0xfcd2('0x29')];if(_0x3d1273[_0xfcd2('0x25')][_0xfcd2('0x2f')]){_0x3e9768[_0xfcd2('0x24')]=[{'all':!![]}];}_0x3e9768=_['merge']({},_0x3e9768,_0x3d1273[_0xfcd2('0x30')]);return db[_0xfcd2('0x1f')]['find'](_0x3e9768)[_0xfcd2('0x17')](handleEntityNotFound(_0x2934b1,null))['then'](respondWithResult(_0x2934b1,null))[_0xfcd2('0x31')](handleError(_0x2934b1,null));};exports['create']=function(_0x45c9a3,_0x3a7d19){return db[_0xfcd2('0x1f')]['create'](_0x45c9a3[_0xfcd2('0x32')],{})[_0xfcd2('0x17')](function(_0x31f0c0){var _0x89e532=_0x45c9a3[_0xfcd2('0x33')][_0xfcd2('0x18')]({'plain':!![]});if(!_0x89e532)throw new Error(_0xfcd2('0x34'));if(_0x89e532[_0xfcd2('0x35')]===_0xfcd2('0x33')){var _0x293db3=_0x31f0c0[_0xfcd2('0x18')]({'plain':!![]});var _0x180e52=_0xfcd2('0x19');return db[_0xfcd2('0x36')][_0xfcd2('0x37')]({'where':{'name':_0x180e52,'userProfileId':_0x89e532[_0xfcd2('0x38')]},'raw':!![]})[_0xfcd2('0x17')](function(_0x47d6b6){if(_0x47d6b6&&_0x47d6b6[_0xfcd2('0x39')]===0x0){return db['UserProfileResource'][_0xfcd2('0x3a')]({'name':_0x293db3[_0xfcd2('0x1d')],'resourceId':_0x293db3['id'],'type':_0x47d6b6[_0xfcd2('0x1d')],'sectionId':_0x47d6b6['id']},{})[_0xfcd2('0x17')](function(){return _0x31f0c0;});}else{return _0x31f0c0;}})['catch'](function(_0x20f985){logger[_0xfcd2('0x1c')](_0xfcd2('0x3b'),_0x20f985);throw _0x20f985;});}return _0x31f0c0;})[_0xfcd2('0x17')](respondWithResult(_0x3a7d19,0xc9))[_0xfcd2('0x31')](handleError(_0x3a7d19,null));};exports[_0xfcd2('0x15')]=function(_0x20c15b,_0x34ffd6){if(_0x20c15b['body']['id']){delete _0x20c15b[_0xfcd2('0x32')]['id'];}return db[_0xfcd2('0x1f')][_0xfcd2('0x37')]({'where':{'id':_0x20c15b[_0xfcd2('0x28')]['id']}})[_0xfcd2('0x17')](handleEntityNotFound(_0x34ffd6,null))['then'](saveUpdates(_0x20c15b[_0xfcd2('0x32')],null))[_0xfcd2('0x17')](respondWithResult(_0x34ffd6,null))[_0xfcd2('0x31')](handleError(_0x34ffd6,null));};exports[_0xfcd2('0x16')]=function(_0x5ae388,_0x318fce){return db[_0xfcd2('0x1f')][_0xfcd2('0x37')]({'where':{'id':_0x5ae388[_0xfcd2('0x28')]['id']}})[_0xfcd2('0x17')](handleEntityNotFound(_0x318fce,null))[_0xfcd2('0x17')](removeEntity(_0x318fce,null))[_0xfcd2('0x31')](handleError(_0x318fce,null));};exports[_0xfcd2('0x3c')]=function(_0x391f54,_0x5895c7){return db['FaxQueue']['describe']()[_0xfcd2('0x17')](respondWithResult(_0x5895c7,null))[_0xfcd2('0x31')](handleError(_0x5895c7,null));};exports[_0xfcd2('0x3d')]=function(_0x3b4b1c,_0x4e6647){var _0x401ce1={'raw':!![],'where':{}},_0x2d78b9={},_0x11e68a;return db[_0xfcd2('0x1f')]['findOne']({'where':{'id':_0x3b4b1c[_0xfcd2('0x28')]['id']}})[_0xfcd2('0x17')](handleEntityNotFound(_0x4e6647,null))[_0xfcd2('0x17')](function(_0x5b7954){if(_0x5b7954){_0x11e68a=_0x5b7954[_0xfcd2('0x18')]({'plain':!![]});_0x2d78b9[_0xfcd2('0x29')]=_['keys'](db[_0xfcd2('0x3e')]['rawAttributes']);_0x2d78b9['query']=_[_0xfcd2('0x2a')](_0x3b4b1c[_0xfcd2('0x25')]);_0x2d78b9[_0xfcd2('0x2b')]=_[_0xfcd2('0x2c')](_0x2d78b9['model'],_0x2d78b9[_0xfcd2('0x25')]);_0x401ce1[_0xfcd2('0x2d')]=_[_0xfcd2('0x2c')](_0x2d78b9['model'],qs[_0xfcd2('0x2e')](_0x3b4b1c[_0xfcd2('0x25')][_0xfcd2('0x2e')]));_0x401ce1[_0xfcd2('0x2d')]=_0x401ce1[_0xfcd2('0x2d')][_0xfcd2('0x3f')]?_0x401ce1[_0xfcd2('0x2d')]:_0x2d78b9[_0xfcd2('0x29')];if(!_0x3b4b1c[_0xfcd2('0x25')][_0xfcd2('0x40')](_0xfcd2('0x41'))){_0x401ce1[_0xfcd2('0x10')]=qs[_0xfcd2('0x10')](_0x3b4b1c[_0xfcd2('0x25')][_0xfcd2('0x10')]);_0x401ce1[_0xfcd2('0x12')]=qs['offset'](_0x3b4b1c[_0xfcd2('0x25')][_0xfcd2('0x12')]);}_0x401ce1[_0xfcd2('0x42')]=qs[_0xfcd2('0x43')](_0x3b4b1c['query'][_0xfcd2('0x43')]);_0x401ce1[_0xfcd2('0x23')]=qs['filters'](_['pick'](_0x3b4b1c[_0xfcd2('0x25')],_0x2d78b9[_0xfcd2('0x2b')]));_0x401ce1[_0xfcd2('0x23')]['FaxQueueId']=_0x5b7954['id'];if(_0x3b4b1c[_0xfcd2('0x25')][_0xfcd2('0x44')]){_0x401ce1[_0xfcd2('0x23')]=_[_0xfcd2('0x45')](_0x401ce1['where'],{'$or':_[_0xfcd2('0x46')](_0x401ce1[_0xfcd2('0x2d')],function(_0xbd4c3f){var _0x4371e1={};_0x4371e1[_0xbd4c3f]={'$like':'%'+_0x3b4b1c[_0xfcd2('0x25')][_0xfcd2('0x44')]+'%'};return _0x4371e1;})});}_0x401ce1=_[_0xfcd2('0x45')]({},_0x401ce1,_0x3b4b1c[_0xfcd2('0x30')]);return db[_0xfcd2('0x3e')]['findAll'](_0x401ce1);}})['then'](function(_0x3e22fb){if(_0x3e22fb){return db['User'][_0xfcd2('0x47')]({'where':{'id':_['map'](_0x3e22fb,_0xfcd2('0x48')),'role':'agent'},'attributes':['id',_0xfcd2('0x1d'),'faxPause',_0xfcd2('0x49'),_0xfcd2('0x4a')]});}})[_0xfcd2('0x17')](function(_0x1455c0){if(_0x1455c0){return{'count':_0x1455c0[_0xfcd2('0x11')],'rows':_[_0xfcd2('0x46')](_0x1455c0['rows'],function(_0x1a71c1){return{'membername':_0x1a71c1[_0xfcd2('0x1d')],'UserId':_0x1a71c1['id'],'queue_name':_0x11e68a[_0xfcd2('0x1d')],'FaxQueueId':_0x11e68a['id'],'interface':util[_0xfcd2('0x4b')](_0xfcd2('0x4c'),_0xfcd2('0x4d'),_0x1a71c1['name']),'penalty':0x0,'paused':_0x1a71c1[_0xfcd2('0x4e')],'createdAt':_0x1a71c1[_0xfcd2('0x4a')],'updatedAt':_0x1a71c1[_0xfcd2('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4e6647,_0x401ce1))[_0xfcd2('0x31')](handleError(_0x4e6647,null));};exports[_0xfcd2('0x4f')]=function(_0x187bcd,_0x46a051){var _0x4bb16e={};var _0x478f15={};var _0x574885;var _0x1aeb13;return db[_0xfcd2('0x1f')][_0xfcd2('0x50')]({'where':{'id':_0x187bcd['params']['id']}})[_0xfcd2('0x17')](handleEntityNotFound(_0x46a051,null))[_0xfcd2('0x17')](function(_0x3b69cb){if(_0x3b69cb){_0x574885=_0x3b69cb;_0x478f15[_0xfcd2('0x29')]=_[_0xfcd2('0x2a')](db[_0xfcd2('0x51')][_0xfcd2('0x20')]);_0x478f15['query']=_[_0xfcd2('0x2a')](_0x187bcd[_0xfcd2('0x25')]);_0x478f15[_0xfcd2('0x2b')]=_[_0xfcd2('0x2c')](_0x478f15[_0xfcd2('0x29')],_0x478f15[_0xfcd2('0x25')]);_0x4bb16e['attributes']=_[_0xfcd2('0x2c')](_0x478f15['model'],qs[_0xfcd2('0x2e')](_0x187bcd[_0xfcd2('0x25')]['fields']));_0x4bb16e[_0xfcd2('0x2d')]=_0x4bb16e[_0xfcd2('0x2d')][_0xfcd2('0x3f')]?_0x4bb16e['attributes']:_0x478f15['model'];_0x4bb16e[_0xfcd2('0x42')]=qs[_0xfcd2('0x43')](_0x187bcd['query']['sort']);_0x4bb16e['where']=qs['filters'](_[_0xfcd2('0x52')](_0x187bcd[_0xfcd2('0x25')],_0x478f15[_0xfcd2('0x2b')]));if(_0x187bcd[_0xfcd2('0x25')][_0xfcd2('0x44')]){_0x4bb16e['where']=_[_0xfcd2('0x45')](_0x4bb16e['where'],{'$or':_[_0xfcd2('0x46')](_0x4bb16e['attributes'],function(_0x48a240){var _0x2fe735={};_0x2fe735[_0x48a240]={'$like':'%'+_0x187bcd[_0xfcd2('0x25')]['filter']+'%'};return _0x2fe735;})});}_0x4bb16e=_['merge']({},_0x4bb16e,_0x187bcd[_0xfcd2('0x30')]);return _0x574885['getTeams'](_0x4bb16e);}})[_0xfcd2('0x17')](function(_0x4fb2a9){if(_0x4fb2a9){_0x1aeb13=_0x4fb2a9[_0xfcd2('0x3f')];if(!_0x187bcd[_0xfcd2('0x25')][_0xfcd2('0x40')]('nolimit')){_0x4bb16e[_0xfcd2('0x10')]=qs[_0xfcd2('0x10')](_0x187bcd['query'][_0xfcd2('0x10')]);_0x4bb16e['offset']=qs['offset'](_0x187bcd[_0xfcd2('0x25')][_0xfcd2('0x12')]);}return _0x574885['getTeams'](_0x4bb16e);}})[_0xfcd2('0x17')](function(_0x5d8278){if(_0x5d8278){return _0x5d8278?{'count':_0x1aeb13,'rows':_0x5d8278}:null;}})[_0xfcd2('0x17')](respondWithResult(_0x46a051,null))[_0xfcd2('0x31')](handleError(_0x46a051,null));};exports[_0xfcd2('0x53')]=function(_0x11b664,_0x317072){var _0x1051f7=_0x11b664[_0xfcd2('0x32')][_0xfcd2('0x54')];return db[_0xfcd2('0x51')][_0xfcd2('0x55')]({'where':{'id':_0x1051f7},'attributes':['id'],'include':[{'model':db[_0xfcd2('0x56')],'as':'Agents','attributes':['id',_0xfcd2('0x1d'),_0xfcd2('0x57'),_0xfcd2('0x58'),'interface'],'raw':!![]}]})[_0xfcd2('0x17')](function(_0x3952b4){if(_0x3952b4){var _0x3a3e95=_[_0xfcd2('0x59')](_0x3952b4,function(_0x2bbb4){var _0x586316=_0x2bbb4[_0xfcd2('0x18')]({'plain':!![]});return _0x586316[_0xfcd2('0x5a')];});return db['FaxQueue'][_0xfcd2('0x37')]({'where':{'id':_0x11b664[_0xfcd2('0x28')]['id']}})[_0xfcd2('0x17')](function(_0x55c929){return db[_0xfcd2('0x5b')][_0xfcd2('0x5c')](function(_0x476add){return _0x55c929[_0xfcd2('0x53')](_0x1051f7,{'transaction':_0x476add})[_0xfcd2('0x17')](function(){return BPromise[_0xfcd2('0x5d')](_0x3a3e95,function(_0x25495d){return db[_0xfcd2('0x3e')][_0xfcd2('0x5e')]({'where':{'UserId':_0x25495d['id'],'FaxQueueId':_0x11b664[_0xfcd2('0x28')]['id']},'transaction':_0x476add});});})['then'](function(){_0x3a3e95[_0xfcd2('0x5f')](function(_0x4bc6c7){socket[_0xfcd2('0x60')]('userFaxQueue:save',{'UserId':_0x4bc6c7['id'],'FaxQueueId':_0x55c929['id']});});});});});}})[_0xfcd2('0x17')](respondWithStatusCode(_0x317072,null))[_0xfcd2('0x31')](handleError(_0x317072,null));};exports[_0xfcd2('0x61')]=function(_0x470636,_0x1055bd){return db[_0xfcd2('0x51')]['findAll']({'where':{'id':_0x470636[_0xfcd2('0x25')][_0xfcd2('0x54')]},'attributes':['id'],'include':[{'model':db[_0xfcd2('0x56')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xfcd2('0x17')](handleEntityNotFound(_0x1055bd,null))[_0xfcd2('0x17')](function(_0x593323){var _0x3550ad=_[_0xfcd2('0x46')](_0x593323,'id');var _0x1c0c28=[];var _0x126037=[];var _0x2603fe=squel[_0xfcd2('0x62')]();_0x2603fe[_0xfcd2('0x63')]('tq.TeamId')[_0xfcd2('0x64')](_0xfcd2('0x65'),'tq')[_0xfcd2('0x66')](_0xfcd2('0x67'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xfcd2('0x23')]('FaxQueueId\x20=\x20?',_0x470636[_0xfcd2('0x28')]['id']);for(var _0x517017=0x0;_0x517017<_0x593323[_0xfcd2('0x3f')];_0x517017+=0x1){let _0x398f38=_0x593323[_0x517017];for(var _0x233f00=0x0;_0x233f00<_0x398f38[_0xfcd2('0x5a')][_0xfcd2('0x3f')];_0x233f00+=0x1){let _0x11428c=_0x398f38[_0xfcd2('0x5a')][_0x233f00];var _0x5211b3=_0x2603fe['clone']();_0x5211b3[_0xfcd2('0x23')](_0xfcd2('0x68'),_0x11428c['id']);_0x126037['push'](db[_0xfcd2('0x5b')][_0xfcd2('0x25')](_0x5211b3[_0xfcd2('0x69')](),{'type':db['sequelize'][_0xfcd2('0x6a')]['SELECT']})[_0xfcd2('0x17')](function(_0x5a8ffc){if(_0x5a8ffc[_0xfcd2('0x3f')]===0x1){return _0x11428c['id'];}else{var _0x7e5368=_['every'](_[_0xfcd2('0x46')](_0x5a8ffc,_0xfcd2('0x6b')),function(_0x752a93){return _[_0xfcd2('0x6c')](_0x3550ad,_0x752a93);});if(_0x7e5368){return _0x11428c['id'];}}}));}}return BPromise[_0xfcd2('0x6d')](_0x126037)[_0xfcd2('0x17')](function(_0x5cdc84){_0x1c0c28=_(_0x1c0c28)[_0xfcd2('0x6e')](_0x5cdc84)[_0xfcd2('0x6f')]()[_0xfcd2('0x70')]();return db['FaxQueue'][_0xfcd2('0x37')]({'where':{'id':_0x470636[_0xfcd2('0x28')]['id']}})[_0xfcd2('0x17')](function(_0xdf68b5){return db['sequelize'][_0xfcd2('0x5c')](function(_0x9e5deb){return _0xdf68b5[_0xfcd2('0x61')](_0x470636[_0xfcd2('0x25')][_0xfcd2('0x54')],{'transaction':_0x9e5deb})[_0xfcd2('0x17')](function(){if(!_[_0xfcd2('0x71')](_0x1c0c28)){return _0xdf68b5[_0xfcd2('0x72')](_0x1c0c28,{'transaction':_0x9e5deb});}})[_0xfcd2('0x17')](function(){_0x1c0c28['forEach'](function(_0x3b93bb){socket['emit'](_0xfcd2('0x73'),{'UserId':_0x3b93bb,'FaxQueueId':_0xdf68b5['id']});});});});});});})['then'](respondWithStatusCode(_0x1055bd,null))[_0xfcd2('0x31')](handleError(_0x1055bd,null));};exports['addAgents']=function(_0x181274,_0x555f7a){return db[_0xfcd2('0x1f')][_0xfcd2('0x37')]({'where':{'id':_0x181274[_0xfcd2('0x28')]['id']}})['then'](handleEntityNotFound(_0x555f7a,null))[_0xfcd2('0x17')](function(_0x5d4f34){if(_0x5d4f34){return _0x5d4f34['addAgents'](_0x181274[_0xfcd2('0x32')][_0xfcd2('0x54')],_[_0xfcd2('0x74')](_0x181274[_0xfcd2('0x32')],['ids','id'])||{})[_0xfcd2('0x75')](function(_0x553c83){for(var _0x4af5ee=0x0;_0x4af5ee<_0x181274[_0xfcd2('0x32')][_0xfcd2('0x54')][_0xfcd2('0x3f')];_0x4af5ee+=0x1){socket[_0xfcd2('0x60')](_0xfcd2('0x76'),{'UserId':Number(_0x181274[_0xfcd2('0x32')][_0xfcd2('0x54')][_0x4af5ee]),'FaxQueueId':Number(_0x181274[_0xfcd2('0x28')]['id'])});}return _0x553c83;});}})[_0xfcd2('0x17')](respondWithResult(_0x555f7a,null))['catch'](handleError(_0x555f7a,null));};exports[_0xfcd2('0x72')]=function(_0x3c4c35,_0x355b29){return db[_0xfcd2('0x1f')][_0xfcd2('0x37')]({'where':{'id':_0x3c4c35[_0xfcd2('0x28')]['id']}})[_0xfcd2('0x17')](handleEntityNotFound(_0x355b29,null))['then'](function(_0x40a5b3){if(_0x40a5b3){return _0x40a5b3['removeAgents'](_0x3c4c35[_0xfcd2('0x25')][_0xfcd2('0x54')])[_0xfcd2('0x17')](function(){if(_[_0xfcd2('0x77')](_0x3c4c35[_0xfcd2('0x25')][_0xfcd2('0x54')])){for(var _0x11a268=0x0;_0x11a268<_0x3c4c35[_0xfcd2('0x25')][_0xfcd2('0x54')][_0xfcd2('0x3f')];_0x11a268+=0x1){socket[_0xfcd2('0x60')](_0xfcd2('0x73'),{'UserId':Number(_0x3c4c35[_0xfcd2('0x25')][_0xfcd2('0x54')][_0x11a268]),'FaxQueueId':Number(_0x3c4c35['params']['id'])});}}else{socket[_0xfcd2('0x60')]('userFaxQueue:remove',{'UserId':Number(_0x3c4c35[_0xfcd2('0x25')][_0xfcd2('0x54')]),'FaxQueueId':Number(_0x3c4c35['params']['id'])});}});}})[_0xfcd2('0x17')](respondWithStatusCode(_0x355b29,null))[_0xfcd2('0x31')](handleError(_0x355b29,null));};exports[_0xfcd2('0x78')]=function(_0x16b341,_0x23a74d){var _0x37ddef={};var _0x4d7374={};var _0x26c9a4;var _0x482e92;return db['FaxQueue'][_0xfcd2('0x50')]({'where':{'id':_0x16b341[_0xfcd2('0x28')]['id']}})[_0xfcd2('0x17')](handleEntityNotFound(_0x23a74d,null))[_0xfcd2('0x17')](function(_0x3c7aa2){if(_0x3c7aa2){_0x26c9a4=_0x3c7aa2;_0x4d7374[_0xfcd2('0x29')]=_[_0xfcd2('0x2a')](db['User'][_0xfcd2('0x20')]);_0x4d7374[_0xfcd2('0x25')]=_[_0xfcd2('0x2a')](_0x16b341['query']);_0x4d7374['filters']=_[_0xfcd2('0x2c')](_0x4d7374[_0xfcd2('0x29')],_0x4d7374[_0xfcd2('0x25')]);_0x37ddef[_0xfcd2('0x2d')]=_[_0xfcd2('0x2c')](_0x4d7374[_0xfcd2('0x29')],qs[_0xfcd2('0x2e')](_0x16b341[_0xfcd2('0x25')][_0xfcd2('0x2e')]));_0x37ddef[_0xfcd2('0x2d')]=_0x37ddef['attributes'][_0xfcd2('0x3f')]?_0x37ddef[_0xfcd2('0x2d')]:_0x4d7374[_0xfcd2('0x29')];_0x37ddef[_0xfcd2('0x42')]=qs[_0xfcd2('0x43')](_0x16b341[_0xfcd2('0x25')][_0xfcd2('0x43')]);_0x37ddef[_0xfcd2('0x23')]=qs[_0xfcd2('0x2b')](_[_0xfcd2('0x52')](_0x16b341['query'],_0x4d7374[_0xfcd2('0x2b')]));if(_0x16b341[_0xfcd2('0x25')]['filter']){_0x37ddef[_0xfcd2('0x23')]=_[_0xfcd2('0x45')](_0x37ddef[_0xfcd2('0x23')],{'$or':_[_0xfcd2('0x46')](_0x37ddef['attributes'],function(_0x234c88){var _0x37bc07={};_0x37bc07[_0x234c88]={'$like':'%'+_0x16b341[_0xfcd2('0x25')]['filter']+'%'};return _0x37bc07;})});}_0x37ddef=_[_0xfcd2('0x45')]({},_0x37ddef,_0x16b341[_0xfcd2('0x30')]);return _0x26c9a4[_0xfcd2('0x78')](_0x37ddef);}})[_0xfcd2('0x17')](function(_0x16a822){if(_0x16a822){_0x482e92=_0x16a822['length'];if(!_0x16b341[_0xfcd2('0x25')][_0xfcd2('0x40')]('nolimit')){_0x37ddef[_0xfcd2('0x10')]=qs['limit'](_0x16b341[_0xfcd2('0x25')]['limit']);_0x37ddef[_0xfcd2('0x12')]=qs[_0xfcd2('0x12')](_0x16b341[_0xfcd2('0x25')][_0xfcd2('0x12')]);}return _0x26c9a4['getAgents'](_0x37ddef);}})['then'](function(_0x4298b8){if(_0x4298b8){return _0x4298b8?{'count':_0x482e92,'rows':_0x4298b8}:null;}})[_0xfcd2('0x17')](respondWithResult(_0x23a74d,null))['catch'](handleError(_0x23a74d,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index cad566e..c3306a1 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 _0x4f2f=['FaxQueue','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x35e24b,_0x6eb583){var _0x193ca0=function(_0x32cb90){while(--_0x32cb90){_0x35e24b['push'](_0x35e24b['shift']());}};_0x193ca0(++_0x6eb583);}(_0x4f2f,0x74));var _0xf4f2=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x4f2f[_0xac151d];return _0x111dba;};'use strict';var EventEmitter=require(_0xf4f2('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xf4f2('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xf4f2('0x2')](0x0);var events={'afterCreate':_0xf4f2('0x3'),'afterUpdate':_0xf4f2('0x4'),'afterDestroy':_0xf4f2('0x5')};function emitEvent(_0x55a7f4){return function(_0x921484,_0x2502b8,_0x1249c8){FaxQueueEvents[_0xf4f2('0x6')](_0x55a7f4+':'+_0x921484['id'],_0x921484);FaxQueueEvents[_0xf4f2('0x6')](_0x55a7f4,_0x921484);_0x1249c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xf4f2('0x7')](e,emitEvent(event));}}module[_0xf4f2('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x27e3=['emit','exports','events','../../mysqldb','save'];(function(_0x4b4ad0,_0x4a875b){var _0x2339ea=function(_0x3a33f6){while(--_0x3a33f6){_0x4b4ad0['push'](_0x4b4ad0['shift']());}};_0x2339ea(++_0x4a875b);}(_0x27e3,0x160));var _0x327e=function(_0xf8e5fe,_0x49e319){_0xf8e5fe=_0xf8e5fe-0x0;var _0x4d322f=_0x27e3[_0xf8e5fe];return _0x4d322f;};'use strict';var EventEmitter=require(_0x327e('0x0'));var FaxQueue=require(_0x327e('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x327e('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2f071c){return function(_0x3a5838,_0x56e7be,_0x11eb62){FaxQueueEvents[_0x327e('0x3')](_0x2f071c+':'+_0x3a5838['id'],_0x3a5838);FaxQueueEvents['emit'](_0x2f071c,_0x3a5838);_0x11eb62(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x327e('0x4')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 2661a31..5f334ea 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 _0x238d=['bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','define','lodash','util'];(function(_0x461886,_0x4fc171){var _0x295e0a=function(_0x451524){while(--_0x451524){_0x461886['push'](_0x461886['shift']());}};_0x295e0a(++_0x4fc171);}(_0x238d,0x97));var _0xd238=function(_0x19ff41,_0x5abfaa){_0x19ff41=_0x19ff41-0x0;var _0x4b72a2=_0x238d[_0x19ff41];return _0x4b72a2;};'use strict';var _=require(_0xd238('0x0'));var util=require(_0xd238('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd238('0x2'));var rp=require(_0xd238('0x3'));var fs=require('fs');var path=require(_0xd238('0x4'));var rimraf=require(_0xd238('0x5'));var config=require(_0xd238('0x6'));var attributes=require(_0xd238('0x7'));module['exports']=function(_0x1bf3ea,_0x5a8fbc){return _0x1bf3ea[_0xd238('0x8')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa941=['FaxQueue','fax_queues','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0xa941,0x1db));var _0x1a94=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xa941[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1a94('0x0'));var BPromise=require(_0x1a94('0x1'));var rp=require(_0x1a94('0x2'));var fs=require('fs');var path=require(_0x1a94('0x3'));var rimraf=require(_0x1a94('0x4'));var config=require(_0x1a94('0x5'));var attributes=require(_0x1a94('0x6'));module[_0x1a94('0x7')]=function(_0x282bc3,_0x29169e){return _0x282bc3[_0x1a94('0x8')](_0x1a94('0x9'),attributes,{'tableName':_0x1a94('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 7475fc3..c309b6d 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 _0xf994=['find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','./faxQueue.socket','register','request','then','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','FaxQueue,\x20%s,\x20%s','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowFaxQueue'];(function(_0xfbdf56,_0x3e2e22){var _0x2e3349=function(_0x3d7799){while(--_0x3d7799){_0xfbdf56['push'](_0xfbdf56['shift']());}};_0x2e3349(++_0x3e2e22);}(_0xf994,0x119));var _0x4f99=function(_0x369ca6,_0x51f257){_0x369ca6=_0x369ca6-0x0;var _0x5356a3=_0xf994[_0x369ca6];return _0x5356a3;};'use strict';var _=require(_0x4f99('0x0'));var util=require(_0x4f99('0x1'));var moment=require('moment');var BPromise=require(_0x4f99('0x2'));var rs=require(_0x4f99('0x3'));var fs=require('fs');var Redis=require(_0x4f99('0x4'));var db=require(_0x4f99('0x5'))['db'];var utils=require(_0x4f99('0x6'));var logger=require('../../config/logger')(_0x4f99('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f99('0x8'));var client=jayson[_0x4f99('0x9')][_0x4f99('0xa')]({'port':0x232a});config[_0x4f99('0xb')]=_['defaults'](config[_0x4f99('0xb')],{'host':_0x4f99('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4f99('0xd'))[_0x4f99('0xe')](socket);function respondWithRpcPromise(_0x1a9087,_0x13d8d9,_0x175f4e){return new BPromise(function(_0x1d7d6c,_0x305229){return client[_0x4f99('0xf')](_0x1a9087,_0x175f4e)[_0x4f99('0x10')](function(_0xd5a84){logger['info']('FaxQueue,\x20%s,\x20%s',_0x13d8d9,_0x4f99('0x11'));logger[_0x4f99('0x12')](_0x4f99('0x13'),_0x13d8d9,_0x4f99('0x11'),JSON[_0x4f99('0x14')](_0xd5a84));if(_0xd5a84[_0x4f99('0x15')]){if(_0xd5a84[_0x4f99('0x15')]['code']===0x1f4){logger['error'](_0x4f99('0x16'),_0x13d8d9,_0xd5a84['error'][_0x4f99('0x17')]);return _0x305229(_0xd5a84[_0x4f99('0x15')]['message']);}logger[_0x4f99('0x15')]('FaxQueue,\x20%s,\x20%s',_0x13d8d9,_0xd5a84[_0x4f99('0x15')][_0x4f99('0x17')]);return _0x1d7d6c(_0xd5a84['error'][_0x4f99('0x17')]);}else{logger[_0x4f99('0x18')]('FaxQueue,\x20%s,\x20%s',_0x13d8d9,_0x4f99('0x11'));_0x1d7d6c(_0xd5a84[_0x4f99('0x19')][_0x4f99('0x17')]);}})[_0x4f99('0x1a')](function(_0x431919){logger[_0x4f99('0x15')](_0x4f99('0x16'),_0x13d8d9,_0x431919);_0x305229(_0x431919);});});}exports[_0x4f99('0x1b')]=function(_0xa863f9){var _0x53116c=this;return new Promise(function(_0xcdd7e4,_0x2fcfc8){return db[_0x4f99('0x1c')][_0x4f99('0x1d')]({'raw':_0xa863f9[_0x4f99('0x1e')]?_0xa863f9['options'][_0x4f99('0x1f')]===undefined?!![]:![]:!![],'where':_0xa863f9[_0x4f99('0x1e')]?_0xa863f9['options'][_0x4f99('0x20')]||null:null,'attributes':_0xa863f9[_0x4f99('0x1e')]?_0xa863f9[_0x4f99('0x1e')]['attributes']||null:null,'limit':_0xa863f9[_0x4f99('0x1e')]?_0xa863f9[_0x4f99('0x1e')][_0x4f99('0x21')]||null:null,'include':_0xa863f9[_0x4f99('0x1e')]?_0xa863f9[_0x4f99('0x1e')][_0x4f99('0x22')]?_[_0x4f99('0x23')](_0xa863f9[_0x4f99('0x1e')][_0x4f99('0x22')],function(_0x860229){return{'model':db[_0x860229[_0x4f99('0x24')]],'as':_0x860229['as'],'attributes':_0x860229[_0x4f99('0x25')],'include':_0x860229[_0x4f99('0x22')]?_[_0x4f99('0x23')](_0x860229[_0x4f99('0x22')],function(_0x36e5c4){return{'model':db[_0x36e5c4[_0x4f99('0x24')]],'as':_0x36e5c4['as'],'attributes':_0x36e5c4[_0x4f99('0x25')],'include':_0x36e5c4[_0x4f99('0x22')]?_[_0x4f99('0x23')](_0x36e5c4[_0x4f99('0x22')],function(_0xe29244){return{'model':db[_0xe29244[_0x4f99('0x24')]],'as':_0xe29244['as'],'attributes':_0xe29244['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f99('0x10')](function(_0x480106){logger[_0x4f99('0x18')](_0x4f99('0x1b'),_0xa863f9);logger[_0x4f99('0x12')](_0x4f99('0x1b'),_0xa863f9,JSON[_0x4f99('0x14')](_0x480106));_0xcdd7e4(_0x480106);})[_0x4f99('0x1a')](function(_0x3323e){logger['error']('GetFaxQueue',_0x3323e[_0x4f99('0x17')],_0xa863f9);_0x2fcfc8(_0x53116c[_0x4f99('0x15')](0x1f4,_0x3323e['message']));});});};exports[_0x4f99('0x26')]=function(_0x44e30c){var _0x1f1b4a=this;return new Promise(function(_0x5ea9f2,_0x499926){return db[_0x4f99('0x1c')][_0x4f99('0x27')]({'raw':_0x44e30c[_0x4f99('0x1e')]?_0x44e30c['options'][_0x4f99('0x1f')]===undefined?!![]:![]:!![],'where':_0x44e30c[_0x4f99('0x1e')]?_0x44e30c['options'][_0x4f99('0x20')]||null:null,'attributes':_0x44e30c[_0x4f99('0x1e')]?_0x44e30c[_0x4f99('0x1e')]['attributes']||null:null,'include':_0x44e30c['options']?_0x44e30c[_0x4f99('0x1e')][_0x4f99('0x22')]?_[_0x4f99('0x23')](_0x44e30c['options']['include'],function(_0x1f07a0){return{'model':db[_0x1f07a0[_0x4f99('0x24')]],'as':_0x1f07a0['as'],'attributes':_0x1f07a0[_0x4f99('0x25')],'include':_0x1f07a0['include']?_[_0x4f99('0x23')](_0x1f07a0[_0x4f99('0x22')],function(_0x77958a){return{'model':db[_0x77958a['model']],'as':_0x77958a['as'],'attributes':_0x77958a[_0x4f99('0x25')],'include':_0x77958a[_0x4f99('0x22')]?_[_0x4f99('0x23')](_0x77958a[_0x4f99('0x22')],function(_0x209411){return{'model':db[_0x209411[_0x4f99('0x24')]],'as':_0x209411['as'],'attributes':_0x209411[_0x4f99('0x25')]};}):[]};}):[]};}):[]:[]})[_0x4f99('0x10')](function(_0x4711ca){logger[_0x4f99('0x18')]('ShowFaxQueue',_0x44e30c);logger['debug'](_0x4f99('0x26'),_0x44e30c,JSON[_0x4f99('0x14')](_0x4711ca));_0x5ea9f2(_0x4711ca);})[_0x4f99('0x1a')](function(_0x348b22){logger[_0x4f99('0x15')]('ShowFaxQueue',_0x348b22[_0x4f99('0x17')],_0x44e30c);_0x499926(_0x1f1b4a[_0x4f99('0x15')](0x1f4,_0x348b22[_0x4f99('0x17')]));});});}; \ No newline at end of file +var _0x2708=['GetFaxQueue','debug','catch','ShowFaxQueue','find','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./faxQueue.socket','then','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','FaxQueue','options','raw','limit','include','map','model','attributes'];(function(_0x5f4b82,_0x2437ba){var _0x310976=function(_0x587d19){while(--_0x587d19){_0x5f4b82['push'](_0x5f4b82['shift']());}};_0x310976(++_0x2437ba);}(_0x2708,0x1f4));var _0x8270=function(_0x13087d,_0x2c1f90){_0x13087d=_0x13087d-0x0;var _0x480d4e=_0x2708[_0x13087d];return _0x480d4e;};'use strict';var _=require(_0x8270('0x0'));var util=require(_0x8270('0x1'));var moment=require(_0x8270('0x2'));var BPromise=require('bluebird');var rs=require(_0x8270('0x3'));var fs=require('fs');var Redis=require(_0x8270('0x4'));var db=require(_0x8270('0x5'))['db'];var utils=require(_0x8270('0x6'));var logger=require('../../config/logger')(_0x8270('0x7'));var config=require(_0x8270('0x8'));var jayson=require(_0x8270('0x9'));var client=jayson[_0x8270('0xa')][_0x8270('0xb')]({'port':0x232a});config[_0x8270('0xc')]=_[_0x8270('0xd')](config[_0x8270('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8270('0xc')]));require(_0x8270('0xe'))['register'](socket);function respondWithRpcPromise(_0x5d47ca,_0x96dd29,_0x431abd){return new BPromise(function(_0x553881,_0x4ceeee){return client['request'](_0x5d47ca,_0x431abd)[_0x8270('0xf')](function(_0x10d749){logger['info'](_0x8270('0x10'),_0x96dd29,_0x8270('0x11'));logger['debug'](_0x8270('0x12'),_0x96dd29,_0x8270('0x11'),JSON[_0x8270('0x13')](_0x10d749));if(_0x10d749[_0x8270('0x14')]){if(_0x10d749[_0x8270('0x14')][_0x8270('0x15')]===0x1f4){logger[_0x8270('0x14')](_0x8270('0x10'),_0x96dd29,_0x10d749[_0x8270('0x14')][_0x8270('0x16')]);return _0x4ceeee(_0x10d749[_0x8270('0x14')][_0x8270('0x16')]);}logger[_0x8270('0x14')]('FaxQueue,\x20%s,\x20%s',_0x96dd29,_0x10d749[_0x8270('0x14')][_0x8270('0x16')]);return _0x553881(_0x10d749[_0x8270('0x14')][_0x8270('0x16')]);}else{logger[_0x8270('0x17')](_0x8270('0x10'),_0x96dd29,_0x8270('0x11'));_0x553881(_0x10d749['result']['message']);}})['catch'](function(_0x5d97a3){logger[_0x8270('0x14')](_0x8270('0x10'),_0x96dd29,_0x5d97a3);_0x4ceeee(_0x5d97a3);});});}exports['GetFaxQueue']=function(_0x18c4c4){var _0xdc129d=this;return new Promise(function(_0x8decac,_0x4e79e7){return db[_0x8270('0x18')]['findAll']({'raw':_0x18c4c4[_0x8270('0x19')]?_0x18c4c4[_0x8270('0x19')][_0x8270('0x1a')]===undefined?!![]:![]:!![],'where':_0x18c4c4['options']?_0x18c4c4[_0x8270('0x19')]['where']||null:null,'attributes':_0x18c4c4[_0x8270('0x19')]?_0x18c4c4[_0x8270('0x19')]['attributes']||null:null,'limit':_0x18c4c4['options']?_0x18c4c4['options'][_0x8270('0x1b')]||null:null,'include':_0x18c4c4[_0x8270('0x19')]?_0x18c4c4[_0x8270('0x19')][_0x8270('0x1c')]?_[_0x8270('0x1d')](_0x18c4c4[_0x8270('0x19')]['include'],function(_0x15bb61){return{'model':db[_0x15bb61[_0x8270('0x1e')]],'as':_0x15bb61['as'],'attributes':_0x15bb61[_0x8270('0x1f')],'include':_0x15bb61[_0x8270('0x1c')]?_[_0x8270('0x1d')](_0x15bb61[_0x8270('0x1c')],function(_0x9dd9a3){return{'model':db[_0x9dd9a3[_0x8270('0x1e')]],'as':_0x9dd9a3['as'],'attributes':_0x9dd9a3[_0x8270('0x1f')],'include':_0x9dd9a3[_0x8270('0x1c')]?_[_0x8270('0x1d')](_0x9dd9a3[_0x8270('0x1c')],function(_0x3d8ecb){return{'model':db[_0x3d8ecb[_0x8270('0x1e')]],'as':_0x3d8ecb['as'],'attributes':_0x3d8ecb[_0x8270('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8270('0xf')](function(_0x215b07){logger['info'](_0x8270('0x20'),_0x18c4c4);logger[_0x8270('0x21')](_0x8270('0x20'),_0x18c4c4,JSON[_0x8270('0x13')](_0x215b07));_0x8decac(_0x215b07);})[_0x8270('0x22')](function(_0x492278){logger['error'](_0x8270('0x20'),_0x492278[_0x8270('0x16')],_0x18c4c4);_0x4e79e7(_0xdc129d['error'](0x1f4,_0x492278[_0x8270('0x16')]));});});};exports[_0x8270('0x23')]=function(_0x1095bb){var _0x117fd5=this;return new Promise(function(_0x5f19a8,_0x266873){return db['FaxQueue'][_0x8270('0x24')]({'raw':_0x1095bb[_0x8270('0x19')]?_0x1095bb[_0x8270('0x19')][_0x8270('0x1a')]===undefined?!![]:![]:!![],'where':_0x1095bb[_0x8270('0x19')]?_0x1095bb['options'][_0x8270('0x25')]||null:null,'attributes':_0x1095bb[_0x8270('0x19')]?_0x1095bb[_0x8270('0x19')][_0x8270('0x1f')]||null:null,'include':_0x1095bb[_0x8270('0x19')]?_0x1095bb[_0x8270('0x19')][_0x8270('0x1c')]?_['map'](_0x1095bb[_0x8270('0x19')][_0x8270('0x1c')],function(_0x26e93f){return{'model':db[_0x26e93f[_0x8270('0x1e')]],'as':_0x26e93f['as'],'attributes':_0x26e93f[_0x8270('0x1f')],'include':_0x26e93f['include']?_[_0x8270('0x1d')](_0x26e93f['include'],function(_0x31812f){return{'model':db[_0x31812f[_0x8270('0x1e')]],'as':_0x31812f['as'],'attributes':_0x31812f[_0x8270('0x1f')],'include':_0x31812f['include']?_[_0x8270('0x1d')](_0x31812f[_0x8270('0x1c')],function(_0x35b413){return{'model':db[_0x35b413[_0x8270('0x1e')]],'as':_0x35b413['as'],'attributes':_0x35b413[_0x8270('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8270('0xf')](function(_0x199e1b){logger[_0x8270('0x17')](_0x8270('0x23'),_0x1095bb);logger[_0x8270('0x21')](_0x8270('0x23'),_0x1095bb,JSON[_0x8270('0x13')](_0x199e1b));_0x5f19a8(_0x199e1b);})['catch'](function(_0x490e47){logger['error'](_0x8270('0x23'),_0x490e47[_0x8270('0x16')],_0x1095bb);_0x266873(_0x117fd5[_0x8270('0x14')](0x1f4,_0x490e47[_0x8270('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 0f93519..56930b2 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 _0xbc8d=['emit','register','length','faxQueue:','./faxQueue.events','remove','update'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xbc8d,0x15b));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require(_0xdbc8('0x0'));var events=['save',_0xdbc8('0x1'),_0xdbc8('0x2')];function createListener(_0x47835e,_0xd1b1fd){return function(_0x547cf2){_0xd1b1fd[_0xdbc8('0x3')](_0x47835e,_0x547cf2);};}function removeListener(_0x172112,_0x2dd539){return function(){FaxQueueEvents['removeListener'](_0x172112,_0x2dd539);};}exports[_0xdbc8('0x4')]=function(_0x10ede0){for(var _0x3ee39d=0x0,_0x47f72b=events[_0xdbc8('0x5')];_0x3ee39d<_0x47f72b;_0x3ee39d++){var _0x4e67e5=events[_0x3ee39d];var _0x26da2c=createListener(_0xdbc8('0x6')+_0x4e67e5,_0x10ede0);FaxQueueEvents['on'](_0x4e67e5,_0x26da2c);}}; \ No newline at end of file +var _0x3efe=['remove','update','removeListener','faxQueue:','./faxQueue.events','save'];(function(_0xaedd1f,_0x2fe932){var _0x51c048=function(_0x3841a6){while(--_0x3841a6){_0xaedd1f['push'](_0xaedd1f['shift']());}};_0x51c048(++_0x2fe932);}(_0x3efe,0x136));var _0xe3ef=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x3efe[_0x167cc1];return _0x10bc4b;};'use strict';var FaxQueueEvents=require(_0xe3ef('0x0'));var events=[_0xe3ef('0x1'),_0xe3ef('0x2'),_0xe3ef('0x3')];function createListener(_0xbe47e4,_0x58a262){return function(_0x3b4877){_0x58a262['emit'](_0xbe47e4,_0x3b4877);};}function removeListener(_0x20f0b3,_0x4df361){return function(){FaxQueueEvents[_0xe3ef('0x4')](_0x20f0b3,_0x4df361);};}exports['register']=function(_0xedbab6){for(var _0x37bf01=0x0,_0x25a996=events['length'];_0x37bf01<_0x25a996;_0x37bf01++){var _0x28431f=events[_0x37bf01];var _0xb1ad21=createListener(_0xe3ef('0x5')+_0x28431f,_0xedbab6);FaxQueueEvents['on'](_0x28431f,_0xb1ad21);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index af18cf2..2af0204 100644 --- a/server/api/faxQueue/index.js +++ b/server/api/faxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x444e=['addAgents','put','update','delete','destroy','/:id/users','removeAgents','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getAgents','post'];(function(_0x4306cd,_0x25f65c){var _0x2326f0=function(_0x339bcd){while(--_0x339bcd){_0x4306cd['push'](_0x4306cd['shift']());}};_0x2326f0(++_0x25f65c);}(_0x444e,0xe8));var _0xe444=function(_0x2b609b,_0x2019b1){_0x2b609b=_0x2b609b-0x0;var _0x19dc30=_0x444e[_0x2b609b];return _0x19dc30;};'use strict';var multer=require(_0xe444('0x0'));var util=require('util');var path=require(_0xe444('0x1'));var timeout=require('connect-timeout');var express=require(_0xe444('0x2'));var router=express['Router']();var fs_extra=require(_0xe444('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe444('0x4'));var config=require(_0xe444('0x5'));var controller=require(_0xe444('0x6'));router[_0xe444('0x7')]('/',auth[_0xe444('0x8')](),controller[_0xe444('0x9')]);router['get'](_0xe444('0xa'),auth['isAuthenticated'](),controller[_0xe444('0xb')]);router['get'](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0xd')]);router['get']('/:id/members',auth[_0xe444('0x8')](),controller[_0xe444('0xe')]);router['get'](_0xe444('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0xe444('0x7')]('/:id/users',auth[_0xe444('0x8')](),controller[_0xe444('0x10')]);router['post']('/',auth[_0xe444('0x8')](),controller['create']);router['post'](_0xe444('0xf'),auth[_0xe444('0x8')](),controller['addTeams']);router[_0xe444('0x11')]('/:id/users',auth[_0xe444('0x8')](),controller[_0xe444('0x12')]);router[_0xe444('0x13')](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0x14')]);router[_0xe444('0x15')](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0x16')]);router[_0xe444('0x15')](_0xe444('0xf'),auth[_0xe444('0x8')](),controller['removeTeams']);router[_0xe444('0x15')](_0xe444('0x17'),auth[_0xe444('0x8')](),controller[_0xe444('0x18')]);module['exports']=router; \ No newline at end of file +var _0x01d9=['post','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create'];(function(_0x535eec,_0x478786){var _0xd937a4=function(_0x2394f7){while(--_0x2394f7){_0x535eec['push'](_0x535eec['shift']());}};_0xd937a4(++_0x478786);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var fs_extra=require(_0x901d('0x5'));var auth=require(_0x901d('0x6'));var interaction=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var controller=require(_0x901d('0x9'));router[_0x901d('0xa')]('/',auth['isAuthenticated'](),controller[_0x901d('0xb')]);router[_0x901d('0xa')](_0x901d('0xc'),auth[_0x901d('0xd')](),controller[_0x901d('0xe')]);router[_0x901d('0xa')](_0x901d('0xf'),auth[_0x901d('0xd')](),controller[_0x901d('0x10')]);router[_0x901d('0xa')](_0x901d('0x11'),auth[_0x901d('0xd')](),controller[_0x901d('0x12')]);router['get'](_0x901d('0x13'),auth['isAuthenticated'](),controller[_0x901d('0x14')]);router[_0x901d('0xa')](_0x901d('0x15'),auth[_0x901d('0xd')](),controller[_0x901d('0x16')]);router['post']('/',auth[_0x901d('0xd')](),controller[_0x901d('0x17')]);router[_0x901d('0x18')](_0x901d('0x13'),auth[_0x901d('0xd')](),controller[_0x901d('0x19')]);router['post'](_0x901d('0x15'),auth[_0x901d('0xd')](),controller[_0x901d('0x1a')]);router[_0x901d('0x1b')](_0x901d('0xf'),auth[_0x901d('0xd')](),controller[_0x901d('0x1c')]);router[_0x901d('0x1d')](_0x901d('0xf'),auth[_0x901d('0xd')](),controller[_0x901d('0x1e')]);router[_0x901d('0x1d')](_0x901d('0x13'),auth[_0x901d('0xd')](),controller[_0x901d('0x1f')]);router[_0x901d('0x1d')](_0x901d('0x15'),auth[_0x901d('0xd')](),controller['removeAgents']);module[_0x901d('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index f481bbd..e44059d 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 _0x990b=['exports','STRING','DATE','sequelize'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x990b,0x1df));var _0xb990=function(_0x271249,_0x5cd02f){_0x271249=_0x271249-0x0;var _0x1f71f8=_0x990b[_0x271249];return _0x1f71f8;};'use strict';var moment=require('moment');var Sequelize=require(_0xb990('0x0'));module[_0xb990('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb990('0x2')]},'joinAt':{'type':Sequelize[_0xb990('0x3')]},'leaveAt':{'type':Sequelize[_0xb990('0x3')]},'acceptAt':{'type':Sequelize[_0xb990('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb990('0x2')]}}; \ No newline at end of file +var _0xb10e=['moment','exports','STRING','DATE'];(function(_0x109b08,_0xf8e44c){var _0x317ae1=function(_0x84b7){while(--_0x84b7){_0x109b08['push'](_0x109b08['shift']());}};_0x317ae1(++_0xf8e44c);}(_0xb10e,0x88));var _0xeb10=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xb10e[_0x4e676e];return _0x336a3c;};'use strict';var moment=require(_0xeb10('0x0'));var Sequelize=require('sequelize');module[_0xeb10('0x1')]={'uniqueid':{'type':Sequelize[_0xeb10('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xeb10('0x2')]},'joinAt':{'type':Sequelize[_0xeb10('0x3')]},'leaveAt':{'type':Sequelize[_0xeb10('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xeb10('0x3')]},'reason':{'type':Sequelize[_0xeb10('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 5b091e5..a971f48 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 _0x4522=['../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','where','type','merge','options','FaxQueueReport','includeAll','include','findAll','rows','show','params','length','find','create','body','catch','destroy','describe','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','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x4522,0x1a0));var _0x2452=function(_0x16877b,_0x4e339b){_0x16877b=_0x16877b-0x0;var _0x11f53e=_0x4522[_0x16877b];return _0x11f53e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2452('0x0'));var jsonpatch=require(_0x2452('0x1'));var rp=require(_0x2452('0x2'));var moment=require('moment');var BPromise=require(_0x2452('0x3'));var Mustache=require(_0x2452('0x4'));var util=require(_0x2452('0x5'));var path=require(_0x2452('0x6'));var sox=require(_0x2452('0x7'));var csv=require(_0x2452('0x8'));var ejs=require(_0x2452('0x9'));var fs=require('fs');var fs_extra=require(_0x2452('0xa'));var _=require(_0x2452('0xb'));var squel=require(_0x2452('0xc'));var crypto=require(_0x2452('0xd'));var jsforce=require(_0x2452('0xe'));var deskjs=require(_0x2452('0xf'));var toCsv=require(_0x2452('0x8'));var querystring=require(_0x2452('0x10'));var Papa=require(_0x2452('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2452('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2452('0x13'))(_0x2452('0x14'));var utils=require(_0x2452('0x15'));var config=require(_0x2452('0x16'));var licenseUtil=require(_0x2452('0x17'));var db=require(_0x2452('0x18'))['db'];function respondWithStatusCode(_0x2c1e0f,_0x2377b9){_0x2377b9=_0x2377b9||0xcc;return function(_0x4968e8){if(_0x4968e8){return _0x2c1e0f['sendStatus'](_0x2377b9);}return _0x2c1e0f['status'](_0x2377b9)[_0x2452('0x19')]();};}function respondWithResult(_0x4fafa0,_0x33e592){_0x33e592=_0x33e592||0xc8;return function(_0x506cd4){if(_0x506cd4){return _0x4fafa0[_0x2452('0x1a')](_0x33e592)[_0x2452('0x1b')](_0x506cd4);}};}function respondWithFilteredResult(_0x5d0438,_0x1dbadf){return function(_0x47930c){if(_0x47930c){var _0x3dd8cc=typeof _0x1dbadf[_0x2452('0x1c')]===_0x2452('0x1d')&&typeof _0x1dbadf[_0x2452('0x1e')]==='undefined';var _0x2108e4=_0x47930c[_0x2452('0x1f')];var _0x59d89a=_0x3dd8cc?0x0:_0x1dbadf['offset'];var _0x1bfb44=_0x3dd8cc?_0x47930c[_0x2452('0x1f')]:_0x1dbadf[_0x2452('0x1c')]+_0x1dbadf['limit'];var _0x914d2b;if(_0x1bfb44>=_0x2108e4){_0x1bfb44=_0x2108e4;_0x914d2b=0xc8;}else{_0x914d2b=0xce;}_0x5d0438[_0x2452('0x1a')](_0x914d2b);return _0x5d0438[_0x2452('0x20')](_0x2452('0x21'),_0x59d89a+'-'+_0x1bfb44+'/'+_0x2108e4)[_0x2452('0x1b')](_0x47930c);}return null;};}function patchUpdates(_0x1c70cb){return function(_0x3f48c2){try{jsonpatch[_0x2452('0x22')](_0x3f48c2,_0x1c70cb,!![]);}catch(_0x5e921d){return BPromise['reject'](_0x5e921d);}return _0x3f48c2[_0x2452('0x23')]();};}function saveUpdates(_0x32dfe7,_0x4bb3ff){return function(_0x17d0a0){if(_0x17d0a0){return _0x17d0a0[_0x2452('0x24')](_0x32dfe7)[_0x2452('0x25')](function(_0x617ba7){return _0x617ba7;});}return null;};}function removeEntity(_0x285281,_0x397f21){return function(_0x155caa){if(_0x155caa){return _0x155caa['destroy']()[_0x2452('0x25')](function(){_0x285281[_0x2452('0x1a')](0xcc)[_0x2452('0x19')]();});}};}function handleEntityNotFound(_0x231410,_0x3a4326){return function(_0x516fcf){if(!_0x516fcf){_0x231410['sendStatus'](0x194);}return _0x516fcf;};}function handleError(_0x295be0,_0x159ba1){_0x159ba1=_0x159ba1||0x1f4;return function(_0x46fcbb){logger[_0x2452('0x26')](_0x46fcbb[_0x2452('0x27')]);if(_0x46fcbb['name']){delete _0x46fcbb[_0x2452('0x28')];}_0x295be0[_0x2452('0x1a')](_0x159ba1)['send'](_0x46fcbb);};}exports['index']=function(_0x332878,_0xe8d39b){var _0x36cb6c={},_0x28e6ea={},_0x43fde0={'count':0x0,'rows':[]};var _0x258fa6=_['map'](db['FaxQueueReport'][_0x2452('0x29')],function(_0x454e0a){return{'name':_0x454e0a[_0x2452('0x2a')],'type':_0x454e0a['type'][_0x2452('0x2b')]};});_0x28e6ea[_0x2452('0x2c')]=_['map'](_0x258fa6,_0x2452('0x28'));_0x28e6ea[_0x2452('0x2d')]=_[_0x2452('0x2e')](_0x332878[_0x2452('0x2d')]);_0x28e6ea[_0x2452('0x2f')]=_[_0x2452('0x30')](_0x28e6ea[_0x2452('0x2c')],_0x28e6ea[_0x2452('0x2d')]);_0x36cb6c[_0x2452('0x31')]=_[_0x2452('0x30')](_0x28e6ea[_0x2452('0x2c')],qs[_0x2452('0x32')](_0x332878[_0x2452('0x2d')]['fields']));_0x36cb6c[_0x2452('0x31')]=_0x36cb6c[_0x2452('0x31')]['length']?_0x36cb6c[_0x2452('0x31')]:_0x28e6ea['model'];if(!_0x332878[_0x2452('0x2d')][_0x2452('0x33')]('nolimit')){_0x36cb6c[_0x2452('0x1e')]=qs[_0x2452('0x1e')](_0x332878[_0x2452('0x2d')]['limit']);_0x36cb6c[_0x2452('0x1c')]=qs[_0x2452('0x1c')](_0x332878['query'][_0x2452('0x1c')]);}_0x36cb6c[_0x2452('0x34')]=qs[_0x2452('0x35')](_0x332878[_0x2452('0x2d')][_0x2452('0x35')]);_0x36cb6c['where']=qs['filters'](_['pick'](_0x332878[_0x2452('0x2d')],_0x28e6ea[_0x2452('0x2f')]),_0x258fa6);if(_0x332878[_0x2452('0x2d')][_0x2452('0x36')]){_0x36cb6c[_0x2452('0x37')]=_['merge'](_0x36cb6c[_0x2452('0x37')],{'$or':_['map'](_0x258fa6,function(_0x5be9b4){if(_0x5be9b4[_0x2452('0x38')]!=='VIRTUAL'){var _0x44ef50={};_0x44ef50[_0x5be9b4[_0x2452('0x28')]]={'$like':'%'+_0x332878['query'][_0x2452('0x36')]+'%'};return _0x44ef50;}})});}_0x36cb6c=_[_0x2452('0x39')]({},_0x36cb6c,_0x332878[_0x2452('0x3a')]);var _0x34d7f9={'where':_0x36cb6c[_0x2452('0x37')]};return db[_0x2452('0x3b')][_0x2452('0x1f')](_0x34d7f9)[_0x2452('0x25')](function(_0x5b864e){_0x43fde0[_0x2452('0x1f')]=_0x5b864e;if(_0x332878['query'][_0x2452('0x3c')]){_0x36cb6c[_0x2452('0x3d')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x2452('0x3e')](_0x36cb6c);})[_0x2452('0x25')](function(_0xb4e3f5){_0x43fde0[_0x2452('0x3f')]=_0xb4e3f5;return _0x43fde0;})[_0x2452('0x25')](respondWithFilteredResult(_0xe8d39b,_0x36cb6c))['catch'](handleError(_0xe8d39b,null));};exports[_0x2452('0x40')]=function(_0x29910e,_0x5379a9){var _0xfabbd8={'raw':!![],'where':{'id':_0x29910e[_0x2452('0x41')]['id']}},_0x449b89={};_0x449b89[_0x2452('0x2c')]=_['keys'](db[_0x2452('0x3b')][_0x2452('0x29')]);_0x449b89[_0x2452('0x2d')]=_[_0x2452('0x2e')](_0x29910e[_0x2452('0x2d')]);_0x449b89[_0x2452('0x2f')]=_['intersection'](_0x449b89[_0x2452('0x2c')],_0x449b89['query']);_0xfabbd8[_0x2452('0x31')]=_[_0x2452('0x30')](_0x449b89['model'],qs['fields'](_0x29910e['query']['fields']));_0xfabbd8[_0x2452('0x31')]=_0xfabbd8['attributes'][_0x2452('0x42')]?_0xfabbd8['attributes']:_0x449b89[_0x2452('0x2c')];if(_0x29910e[_0x2452('0x2d')]['includeAll']){_0xfabbd8['include']=[{'all':!![]}];}_0xfabbd8=_[_0x2452('0x39')]({},_0xfabbd8,_0x29910e['options']);return db[_0x2452('0x3b')][_0x2452('0x43')](_0xfabbd8)[_0x2452('0x25')](handleEntityNotFound(_0x5379a9,null))[_0x2452('0x25')](respondWithResult(_0x5379a9,null))['catch'](handleError(_0x5379a9,null));};exports['create']=function(_0x3e4a8b,_0x38615e){return db[_0x2452('0x3b')][_0x2452('0x44')](_0x3e4a8b[_0x2452('0x45')],{})['then'](respondWithResult(_0x38615e,0xc9))[_0x2452('0x46')](handleError(_0x38615e,null));};exports['update']=function(_0x3634f7,_0x53fd05){if(_0x3634f7[_0x2452('0x45')]['id']){delete _0x3634f7[_0x2452('0x45')]['id'];}return db['FaxQueueReport'][_0x2452('0x43')]({'where':{'id':_0x3634f7['params']['id']}})[_0x2452('0x25')](handleEntityNotFound(_0x53fd05,null))['then'](saveUpdates(_0x3634f7['body'],null))['then'](respondWithResult(_0x53fd05,null))[_0x2452('0x46')](handleError(_0x53fd05,null));};exports[_0x2452('0x47')]=function(_0x36ebcb,_0x4b705f){return db[_0x2452('0x3b')][_0x2452('0x43')]({'where':{'id':_0x36ebcb[_0x2452('0x41')]['id']}})[_0x2452('0x25')](handleEntityNotFound(_0x4b705f,null))[_0x2452('0x25')](removeEntity(_0x4b705f,null))['catch'](handleError(_0x4b705f,null));};exports[_0x2452('0x48')]=function(_0x52d286,_0x163510){return db[_0x2452('0x3b')][_0x2452('0x48')]()[_0x2452('0x25')](respondWithResult(_0x163510,null))[_0x2452('0x46')](handleError(_0x163510,null));}; \ No newline at end of file +var _0x6f0d=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','reject','update','destroy','then','error','stack','name','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','body','describe','rimraf'];(function(_0x12ebb0,_0x5a9989){var _0x3f623e=function(_0x19633c){while(--_0x19633c){_0x12ebb0['push'](_0x12ebb0['shift']());}};_0x3f623e(++_0x5a9989);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x25b827,_0x47b91e){_0x25b827=_0x25b827-0x0;var _0x1573fe=_0x6f0d[_0x25b827];return _0x1573fe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6f0('0x0'));var zipdir=require(_0xd6f0('0x1'));var jsonpatch=require(_0xd6f0('0x2'));var rp=require(_0xd6f0('0x3'));var moment=require('moment');var BPromise=require(_0xd6f0('0x4'));var Mustache=require(_0xd6f0('0x5'));var util=require(_0xd6f0('0x6'));var path=require(_0xd6f0('0x7'));var sox=require(_0xd6f0('0x8'));var csv=require('to-csv');var ejs=require(_0xd6f0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd6f0('0xa'));var squel=require(_0xd6f0('0xb'));var crypto=require(_0xd6f0('0xc'));var jsforce=require(_0xd6f0('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd6f0('0xe'));var Papa=require(_0xd6f0('0xf'));var Redis=require(_0xd6f0('0x10'));var authService=require(_0xd6f0('0x11'));var qs=require(_0xd6f0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6f0('0x13'));var logger=require(_0xd6f0('0x14'))(_0xd6f0('0x15'));var utils=require(_0xd6f0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd6f0('0x17'));var db=require(_0xd6f0('0x18'))['db'];function respondWithStatusCode(_0x306aad,_0x45973d){_0x45973d=_0x45973d||0xcc;return function(_0x109655){if(_0x109655){return _0x306aad[_0xd6f0('0x19')](_0x45973d);}return _0x306aad[_0xd6f0('0x1a')](_0x45973d)[_0xd6f0('0x1b')]();};}function respondWithResult(_0x246dad,_0x4ab979){_0x4ab979=_0x4ab979||0xc8;return function(_0x2b3f32){if(_0x2b3f32){return _0x246dad[_0xd6f0('0x1a')](_0x4ab979)['json'](_0x2b3f32);}};}function respondWithFilteredResult(_0x419b7e,_0x593abe){return function(_0x3f4851){if(_0x3f4851){var _0x154e3e=typeof _0x593abe[_0xd6f0('0x1c')]===_0xd6f0('0x1d')&&typeof _0x593abe[_0xd6f0('0x1e')]===_0xd6f0('0x1d');var _0x25da0c=_0x3f4851[_0xd6f0('0x1f')];var _0x2e71bd=_0x154e3e?0x0:_0x593abe[_0xd6f0('0x1c')];var _0x23ab6c=_0x154e3e?_0x3f4851[_0xd6f0('0x1f')]:_0x593abe[_0xd6f0('0x1c')]+_0x593abe[_0xd6f0('0x1e')];var _0x1f43d7;if(_0x23ab6c>=_0x25da0c){_0x23ab6c=_0x25da0c;_0x1f43d7=0xc8;}else{_0x1f43d7=0xce;}_0x419b7e[_0xd6f0('0x1a')](_0x1f43d7);return _0x419b7e['set']('Content-Range',_0x2e71bd+'-'+_0x23ab6c+'/'+_0x25da0c)[_0xd6f0('0x20')](_0x3f4851);}return null;};}function patchUpdates(_0x264104){return function(_0x1158dc){try{jsonpatch['apply'](_0x1158dc,_0x264104,!![]);}catch(_0x67afa7){return BPromise[_0xd6f0('0x21')](_0x67afa7);}return _0x1158dc['save']();};}function saveUpdates(_0x86dde0,_0x515687){return function(_0x1ee584){if(_0x1ee584){return _0x1ee584[_0xd6f0('0x22')](_0x86dde0)['then'](function(_0xb9e820){return _0xb9e820;});}return null;};}function removeEntity(_0x45e99c,_0x5ea2dd){return function(_0x3dbdc3){if(_0x3dbdc3){return _0x3dbdc3[_0xd6f0('0x23')]()[_0xd6f0('0x24')](function(){_0x45e99c['status'](0xcc)[_0xd6f0('0x1b')]();});}};}function handleEntityNotFound(_0x3dc166,_0x5ecb16){return function(_0xcea0ae){if(!_0xcea0ae){_0x3dc166['sendStatus'](0x194);}return _0xcea0ae;};}function handleError(_0x2042d5,_0x3fb5c3){_0x3fb5c3=_0x3fb5c3||0x1f4;return function(_0x1630dc){logger[_0xd6f0('0x25')](_0x1630dc[_0xd6f0('0x26')]);if(_0x1630dc[_0xd6f0('0x27')]){delete _0x1630dc[_0xd6f0('0x27')];}_0x2042d5[_0xd6f0('0x1a')](_0x3fb5c3)['send'](_0x1630dc);};}exports[_0xd6f0('0x28')]=function(_0x1982d3,_0x55656c){var _0x38a3e9={},_0x385947={},_0x27db5e={'count':0x0,'rows':[]};var _0xb61222=_[_0xd6f0('0x29')](db[_0xd6f0('0x2a')][_0xd6f0('0x2b')],function(_0x3151f8){return{'name':_0x3151f8[_0xd6f0('0x2c')],'type':_0x3151f8[_0xd6f0('0x2d')][_0xd6f0('0x2e')]};});_0x385947[_0xd6f0('0x2f')]=_[_0xd6f0('0x29')](_0xb61222,_0xd6f0('0x27'));_0x385947[_0xd6f0('0x30')]=_[_0xd6f0('0x31')](_0x1982d3[_0xd6f0('0x30')]);_0x385947[_0xd6f0('0x32')]=_[_0xd6f0('0x33')](_0x385947[_0xd6f0('0x2f')],_0x385947[_0xd6f0('0x30')]);_0x38a3e9[_0xd6f0('0x34')]=_['intersection'](_0x385947[_0xd6f0('0x2f')],qs['fields'](_0x1982d3['query'][_0xd6f0('0x35')]));_0x38a3e9[_0xd6f0('0x34')]=_0x38a3e9[_0xd6f0('0x34')][_0xd6f0('0x36')]?_0x38a3e9[_0xd6f0('0x34')]:_0x385947['model'];if(!_0x1982d3[_0xd6f0('0x30')]['hasOwnProperty'](_0xd6f0('0x37'))){_0x38a3e9[_0xd6f0('0x1e')]=qs[_0xd6f0('0x1e')](_0x1982d3[_0xd6f0('0x30')][_0xd6f0('0x1e')]);_0x38a3e9['offset']=qs['offset'](_0x1982d3[_0xd6f0('0x30')][_0xd6f0('0x1c')]);}_0x38a3e9['order']=qs[_0xd6f0('0x38')](_0x1982d3['query'][_0xd6f0('0x38')]);_0x38a3e9[_0xd6f0('0x39')]=qs[_0xd6f0('0x32')](_[_0xd6f0('0x3a')](_0x1982d3[_0xd6f0('0x30')],_0x385947[_0xd6f0('0x32')]),_0xb61222);if(_0x1982d3[_0xd6f0('0x30')]['filter']){_0x38a3e9['where']=_[_0xd6f0('0x3b')](_0x38a3e9[_0xd6f0('0x39')],{'$or':_[_0xd6f0('0x29')](_0xb61222,function(_0x5c2d9a){if(_0x5c2d9a['type']!==_0xd6f0('0x3c')){var _0x2def01={};_0x2def01[_0x5c2d9a[_0xd6f0('0x27')]]={'$like':'%'+_0x1982d3[_0xd6f0('0x30')][_0xd6f0('0x3d')]+'%'};return _0x2def01;}})});}_0x38a3e9=_[_0xd6f0('0x3b')]({},_0x38a3e9,_0x1982d3[_0xd6f0('0x3e')]);var _0x64359c={'where':_0x38a3e9['where']};return db[_0xd6f0('0x2a')][_0xd6f0('0x1f')](_0x64359c)[_0xd6f0('0x24')](function(_0x3964e6){_0x27db5e['count']=_0x3964e6;if(_0x1982d3[_0xd6f0('0x30')][_0xd6f0('0x3f')]){_0x38a3e9[_0xd6f0('0x40')]=[{'all':!![]}];}return db[_0xd6f0('0x2a')][_0xd6f0('0x41')](_0x38a3e9);})['then'](function(_0x332809){_0x27db5e[_0xd6f0('0x42')]=_0x332809;return _0x27db5e;})[_0xd6f0('0x24')](respondWithFilteredResult(_0x55656c,_0x38a3e9))['catch'](handleError(_0x55656c,null));};exports[_0xd6f0('0x43')]=function(_0x1ddc40,_0x4b8cc7){var _0x516ffd={'raw':!![],'where':{'id':_0x1ddc40[_0xd6f0('0x44')]['id']}},_0x9cffd4={};_0x9cffd4[_0xd6f0('0x2f')]=_['keys'](db[_0xd6f0('0x2a')][_0xd6f0('0x2b')]);_0x9cffd4['query']=_[_0xd6f0('0x31')](_0x1ddc40[_0xd6f0('0x30')]);_0x9cffd4[_0xd6f0('0x32')]=_[_0xd6f0('0x33')](_0x9cffd4['model'],_0x9cffd4[_0xd6f0('0x30')]);_0x516ffd[_0xd6f0('0x34')]=_[_0xd6f0('0x33')](_0x9cffd4[_0xd6f0('0x2f')],qs[_0xd6f0('0x35')](_0x1ddc40[_0xd6f0('0x30')][_0xd6f0('0x35')]));_0x516ffd[_0xd6f0('0x34')]=_0x516ffd['attributes'][_0xd6f0('0x36')]?_0x516ffd[_0xd6f0('0x34')]:_0x9cffd4['model'];if(_0x1ddc40[_0xd6f0('0x30')][_0xd6f0('0x3f')]){_0x516ffd[_0xd6f0('0x40')]=[{'all':!![]}];}_0x516ffd=_[_0xd6f0('0x3b')]({},_0x516ffd,_0x1ddc40['options']);return db[_0xd6f0('0x2a')][_0xd6f0('0x45')](_0x516ffd)['then'](handleEntityNotFound(_0x4b8cc7,null))['then'](respondWithResult(_0x4b8cc7,null))[_0xd6f0('0x46')](handleError(_0x4b8cc7,null));};exports['create']=function(_0x35a8f5,_0x61b354){return db[_0xd6f0('0x2a')]['create'](_0x35a8f5[_0xd6f0('0x47')],{})[_0xd6f0('0x24')](respondWithResult(_0x61b354,0xc9))[_0xd6f0('0x46')](handleError(_0x61b354,null));};exports[_0xd6f0('0x22')]=function(_0xc4147e,_0x4c42ce){if(_0xc4147e[_0xd6f0('0x47')]['id']){delete _0xc4147e['body']['id'];}return db[_0xd6f0('0x2a')][_0xd6f0('0x45')]({'where':{'id':_0xc4147e[_0xd6f0('0x44')]['id']}})[_0xd6f0('0x24')](handleEntityNotFound(_0x4c42ce,null))['then'](saveUpdates(_0xc4147e['body'],null))[_0xd6f0('0x24')](respondWithResult(_0x4c42ce,null))[_0xd6f0('0x46')](handleError(_0x4c42ce,null));};exports['destroy']=function(_0xa68b18,_0x56c448){return db[_0xd6f0('0x2a')][_0xd6f0('0x45')]({'where':{'id':_0xa68b18[_0xd6f0('0x44')]['id']}})[_0xd6f0('0x24')](handleEntityNotFound(_0x56c448,null))[_0xd6f0('0x24')](removeEntity(_0x56c448,null))['catch'](handleError(_0x56c448,null));};exports[_0xd6f0('0x48')]=function(_0x335383,_0x3f9d29){return db[_0xd6f0('0x2a')][_0xd6f0('0x48')]()[_0xd6f0('0x24')](respondWithResult(_0x3f9d29,null))[_0xd6f0('0x46')](handleError(_0x3f9d29,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index a37438b..cc1df2a 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash'];(function(_0x1cb3a4,_0x4f0765){var _0x1bdac8=function(_0x1a57d8){while(--_0x1a57d8){_0x1cb3a4['push'](_0x1cb3a4['shift']());}};_0x1bdac8(++_0x4f0765);}(_0x5fc3,0xa8));var _0x35fc=function(_0x282a1f,_0x49a6ef){_0x282a1f=_0x282a1f-0x0;var _0x296ea7=_0x5fc3[_0x282a1f];return _0x296ea7;};'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')]('FaxQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x4c1f9c,_0x49d2fc){var _0x2d3c4e=function(_0x1943fa){while(--_0x1943fa){_0x4c1f9c['push'](_0x4c1f9c['shift']());}};_0x2d3c4e(++_0x49d2fc);}(_0xabce,0x103));var _0xeabc=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xabce[_0x28d18d];return _0x470640;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index ce73720..04dd6ba 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 _0x1e00=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateFaxQueueReport','create','body','raw','UpdateFaxQueueReport','FaxQueueReport','update','options','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1b33b2,_0x4bd1dd){var _0x59ed24=function(_0x42b6de){while(--_0x42b6de){_0x1b33b2['push'](_0x1b33b2['shift']());}};_0x59ed24(++_0x4bd1dd);}(_0x1e00,0x144));var _0x01e0=function(_0x742c03,_0x45108c){_0x742c03=_0x742c03-0x0;var _0x25d604=_0x1e00[_0x742c03];return _0x25d604;};'use strict';var _=require(_0x01e0('0x0'));var util=require('util');var moment=require(_0x01e0('0x1'));var BPromise=require('bluebird');var rs=require(_0x01e0('0x2'));var fs=require('fs');var Redis=require(_0x01e0('0x3'));var db=require(_0x01e0('0x4'))['db'];var utils=require(_0x01e0('0x5'));var logger=require(_0x01e0('0x6'))(_0x01e0('0x7'));var config=require(_0x01e0('0x8'));var jayson=require(_0x01e0('0x9'));var client=jayson[_0x01e0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x293359,_0x1662bf,_0x8b46d7){return new BPromise(function(_0x62b1f5,_0x47425c){return client[_0x01e0('0xb')](_0x293359,_0x8b46d7)['then'](function(_0xcc91b0){logger[_0x01e0('0xc')](_0x01e0('0xd'),_0x1662bf,_0x01e0('0xe'));logger[_0x01e0('0xf')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x1662bf,_0x01e0('0xe'),JSON[_0x01e0('0x10')](_0xcc91b0));if(_0xcc91b0[_0x01e0('0x11')]){if(_0xcc91b0[_0x01e0('0x11')][_0x01e0('0x12')]===0x1f4){logger[_0x01e0('0x11')](_0x01e0('0xd'),_0x1662bf,_0xcc91b0['error'][_0x01e0('0x13')]);return _0x47425c(_0xcc91b0[_0x01e0('0x11')][_0x01e0('0x13')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x1662bf,_0xcc91b0['error']['message']);return _0x62b1f5(_0xcc91b0[_0x01e0('0x11')]['message']);}else{logger[_0x01e0('0xc')](_0x01e0('0xd'),_0x1662bf,'request\x20sent');_0x62b1f5(_0xcc91b0[_0x01e0('0x14')][_0x01e0('0x13')]);}})[_0x01e0('0x15')](function(_0x45f729){logger[_0x01e0('0x11')](_0x01e0('0xd'),_0x1662bf,_0x45f729);_0x47425c(_0x45f729);});});}exports[_0x01e0('0x16')]=function(_0x519052){var _0x3e7d19=this;return new Promise(function(_0x401cdf,_0x4cb4a8){return db['FaxQueueReport'][_0x01e0('0x17')](_0x519052[_0x01e0('0x18')],{'raw':_0x519052['options']?_0x519052['options'][_0x01e0('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x23a61a){logger['info']('CreateFaxQueueReport',_0x519052);logger[_0x01e0('0xf')](_0x01e0('0x16'),_0x519052,JSON[_0x01e0('0x10')](_0x23a61a));_0x401cdf(_0x23a61a);})['catch'](function(_0x450f74){logger['error'](_0x01e0('0x16'),_0x450f74[_0x01e0('0x13')],_0x519052);_0x4cb4a8(_0x3e7d19['error'](0x1f4,_0x450f74[_0x01e0('0x13')]));});});};exports[_0x01e0('0x1a')]=function(_0x577160){var _0x220e2b=this;return new Promise(function(_0x380396,_0x56dac0){return db[_0x01e0('0x1b')][_0x01e0('0x1c')](_0x577160[_0x01e0('0x18')],{'raw':_0x577160[_0x01e0('0x1d')]?_0x577160[_0x01e0('0x1d')][_0x01e0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x577160['options']?_0x577160[_0x01e0('0x1d')][_0x01e0('0x1e')]||null:null,'attributes':_0x577160[_0x01e0('0x1d')]?_0x577160[_0x01e0('0x1d')][_0x01e0('0x1f')]||null:null,'limit':_0x577160['options']?_0x577160[_0x01e0('0x1d')][_0x01e0('0x20')]||null:null})['then'](function(_0x1c2483){logger[_0x01e0('0xc')](_0x01e0('0x1a'),_0x577160);logger[_0x01e0('0xf')]('UpdateFaxQueueReport',_0x577160,JSON['stringify'](_0x1c2483));_0x380396(_0x1c2483);})[_0x01e0('0x15')](function(_0x413561){logger['error'](_0x01e0('0x1a'),_0x413561['message'],_0x577160);_0x56dac0(_0x220e2b[_0x01e0('0x11')](0x1f4,_0x413561[_0x01e0('0x13')]));});});}; \ No newline at end of file +var _0x8bc6=['debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','stringify','UpdateFaxQueueReport','raw','where','attributes','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','client','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8bc6,0xcd));var _0x68bc=function(_0x5ee211,_0x3f31a3){_0x5ee211=_0x5ee211-0x0;var _0x46fc90=_0x8bc6[_0x5ee211];return _0x46fc90;};'use strict';var _=require(_0x68bc('0x0'));var util=require(_0x68bc('0x1'));var moment=require(_0x68bc('0x2'));var BPromise=require('bluebird');var rs=require(_0x68bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x68bc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x68bc('0x5'))(_0x68bc('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x68bc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c416d,_0xa7e80d,_0x545dda){return new BPromise(function(_0x1fa1a1,_0x213a47){return client[_0x68bc('0x8')](_0x4c416d,_0x545dda)[_0x68bc('0x9')](function(_0x25da1b){logger['info'](_0x68bc('0xa'),_0xa7e80d,_0x68bc('0xb'));logger[_0x68bc('0xc')](_0x68bc('0xd'),_0xa7e80d,_0x68bc('0xb'),JSON['stringify'](_0x25da1b));if(_0x25da1b[_0x68bc('0xe')]){if(_0x25da1b[_0x68bc('0xe')][_0x68bc('0xf')]===0x1f4){logger[_0x68bc('0xe')](_0x68bc('0xa'),_0xa7e80d,_0x25da1b[_0x68bc('0xe')][_0x68bc('0x10')]);return _0x213a47(_0x25da1b[_0x68bc('0xe')]['message']);}logger[_0x68bc('0xe')](_0x68bc('0xa'),_0xa7e80d,_0x25da1b[_0x68bc('0xe')][_0x68bc('0x10')]);return _0x1fa1a1(_0x25da1b[_0x68bc('0xe')][_0x68bc('0x10')]);}else{logger[_0x68bc('0x11')](_0x68bc('0xa'),_0xa7e80d,_0x68bc('0xb'));_0x1fa1a1(_0x25da1b[_0x68bc('0x12')][_0x68bc('0x10')]);}})[_0x68bc('0x13')](function(_0x1a9859){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0xa7e80d,_0x1a9859);_0x213a47(_0x1a9859);});});}exports[_0x68bc('0x14')]=function(_0x144545){var _0x27a1f2=this;return new Promise(function(_0x2b502a,_0x5973c2){return db[_0x68bc('0x15')][_0x68bc('0x16')](_0x144545[_0x68bc('0x17')],{'raw':_0x144545[_0x68bc('0x18')]?_0x144545[_0x68bc('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x68bc('0x9')](function(_0xfb050){logger['info'](_0x68bc('0x14'),_0x144545);logger[_0x68bc('0xc')](_0x68bc('0x14'),_0x144545,JSON[_0x68bc('0x19')](_0xfb050));_0x2b502a(_0xfb050);})['catch'](function(_0x33214b){logger['error'](_0x68bc('0x14'),_0x33214b[_0x68bc('0x10')],_0x144545);_0x5973c2(_0x27a1f2['error'](0x1f4,_0x33214b[_0x68bc('0x10')]));});});};exports[_0x68bc('0x1a')]=function(_0x1cb9fb){var _0x266b7f=this;return new Promise(function(_0x253f94,_0x22bd5f){return db['FaxQueueReport']['update'](_0x1cb9fb['body'],{'raw':_0x1cb9fb[_0x68bc('0x18')]?_0x1cb9fb[_0x68bc('0x18')][_0x68bc('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cb9fb['options']?_0x1cb9fb[_0x68bc('0x18')][_0x68bc('0x1c')]||null:null,'attributes':_0x1cb9fb[_0x68bc('0x18')]?_0x1cb9fb[_0x68bc('0x18')][_0x68bc('0x1d')]||null:null,'limit':_0x1cb9fb[_0x68bc('0x18')]?_0x1cb9fb[_0x68bc('0x18')][_0x68bc('0x1e')]||null:null})[_0x68bc('0x9')](function(_0x2be949){logger[_0x68bc('0x11')](_0x68bc('0x1a'),_0x1cb9fb);logger[_0x68bc('0xc')](_0x68bc('0x1a'),_0x1cb9fb,JSON[_0x68bc('0x19')](_0x2be949));_0x253f94(_0x2be949);})[_0x68bc('0x13')](function(_0x4bed5a){logger['error'](_0x68bc('0x1a'),_0x4bed5a[_0x68bc('0x10')],_0x1cb9fb);_0x22bd5f(_0x266b7f[_0x68bc('0xe')](0x1f4,_0x4bed5a[_0x68bc('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 657823d..8b6bc2c 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 _0x19c2=['create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','describe','show','post'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x19c2,0xc4));var _0x219c=function(_0x29e91f,_0x19746f){_0x29e91f=_0x29e91f-0x0;var _0x96024=_0x19c2[_0x29e91f];return _0x96024;};'use strict';var multer=require(_0x219c('0x0'));var util=require(_0x219c('0x1'));var path=require(_0x219c('0x2'));var timeout=require(_0x219c('0x3'));var express=require(_0x219c('0x4'));var router=express['Router']();var fs_extra=require(_0x219c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x219c('0x6'));var config=require('../../config/environment');var controller=require(_0x219c('0x7'));router[_0x219c('0x8')]('/',auth[_0x219c('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x219c('0xa')]);router[_0x219c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x219c('0xb')]);router[_0x219c('0xc')]('/',auth[_0x219c('0x9')](),controller[_0x219c('0xd')]);router[_0x219c('0xe')](_0x219c('0xf'),auth[_0x219c('0x9')](),controller[_0x219c('0x10')]);router[_0x219c('0x11')](_0x219c('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x219c('0x12')]=router; \ No newline at end of file +var _0xd632=['put','/:id','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','index','/describe','isAuthenticated','describe','post','create'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xd632,0x1a6));var _0x2d63=function(_0x8dd419,_0x58acff){_0x8dd419=_0x8dd419-0x0;var _0x4fadf8=_0xd632[_0x8dd419];return _0x4fadf8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2d63('0x0'));var timeout=require(_0x2d63('0x1'));var express=require(_0x2d63('0x2'));var router=express[_0x2d63('0x3')]();var fs_extra=require(_0x2d63('0x4'));var auth=require(_0x2d63('0x5'));var interaction=require(_0x2d63('0x6'));var config=require('../../config/environment');var controller=require(_0x2d63('0x7'));router[_0x2d63('0x8')]('/',auth['isAuthenticated'](),controller[_0x2d63('0x9')]);router[_0x2d63('0x8')](_0x2d63('0xa'),auth[_0x2d63('0xb')](),controller[_0x2d63('0xc')]);router[_0x2d63('0x8')]('/:id',auth[_0x2d63('0xb')](),controller['show']);router[_0x2d63('0xd')]('/',auth[_0x2d63('0xb')](),controller[_0x2d63('0xe')]);router[_0x2d63('0xf')](_0x2d63('0x10'),auth['isAuthenticated'](),controller[_0x2d63('0x11')]);router['delete'](_0x2d63('0x10'),auth[_0x2d63('0xb')](),controller['destroy']);module[_0x2d63('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index ff84d43..6f7be2c 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x57a174,_0x8379f4){var _0x5090c0=function(_0x45d0d6){while(--_0x45d0d6){_0x57a174['push'](_0x57a174['shift']());}};_0x5090c0(++_0x8379f4);}(_0xaa88,0x137));var _0x8aa8=function(_0x28b0a4,_0x2ea758){_0x28b0a4=_0x28b0a4-0x0;var _0x105ce6=_0xaa88[_0x28b0a4];return _0x105ce6;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x307df8,_0x5c687c){var _0x2c5855=function(_0x3b9922){while(--_0x3b9922){_0x307df8['push'](_0x307df8['shift']());}};_0x2c5855(++_0x5c687c);}(_0x008c,0x188));var _0xc008=function(_0x2abffd,_0x760487){_0x2abffd=_0x2abffd-0x0;var _0xe147d4=_0x008c[_0x2abffd];return _0xe147d4;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 6dac5b1..9d2d216 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 _0xcafc=['intersection','model','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','FaxTransferReport','include','findAll','rows','catch','params','rawAttributes','create','body','find','destroy','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','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','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','fieldName','type','keys','query','filters'];(function(_0x320234,_0x3427b1){var _0x4b4966=function(_0x11bc98){while(--_0x11bc98){_0x320234['push'](_0x320234['shift']());}};_0x4b4966(++_0x3427b1);}(_0xcafc,0x65));var _0xccaf=function(_0x2b94da,_0x14ae3b){_0x2b94da=_0x2b94da-0x0;var _0x254463=_0xcafc[_0x2b94da];return _0x254463;};'use strict';var emlformat=require(_0xccaf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xccaf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xccaf('0x2'));var moment=require('moment');var BPromise=require(_0xccaf('0x3'));var Mustache=require(_0xccaf('0x4'));var util=require(_0xccaf('0x5'));var path=require(_0xccaf('0x6'));var sox=require(_0xccaf('0x7'));var csv=require(_0xccaf('0x8'));var ejs=require(_0xccaf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xccaf('0xa'));var crypto=require(_0xccaf('0xb'));var jsforce=require(_0xccaf('0xc'));var deskjs=require(_0xccaf('0xd'));var toCsv=require('to-csv');var querystring=require(_0xccaf('0xe'));var Papa=require(_0xccaf('0xf'));var Redis=require(_0xccaf('0x10'));var authService=require(_0xccaf('0x11'));var qs=require(_0xccaf('0x12'));var as=require(_0xccaf('0x13'));var hardwareService=require(_0xccaf('0x14'));var logger=require(_0xccaf('0x15'))('api');var utils=require(_0xccaf('0x16'));var config=require(_0xccaf('0x17'));var licenseUtil=require(_0xccaf('0x18'));var db=require(_0xccaf('0x19'))['db'];function respondWithStatusCode(_0x285cf3,_0x58266c){_0x58266c=_0x58266c||0xcc;return function(_0x20a418){if(_0x20a418){return _0x285cf3[_0xccaf('0x1a')](_0x58266c);}return _0x285cf3['status'](_0x58266c)[_0xccaf('0x1b')]();};}function respondWithResult(_0x2429dc,_0xc042f0){_0xc042f0=_0xc042f0||0xc8;return function(_0x825229){if(_0x825229){return _0x2429dc['status'](_0xc042f0)[_0xccaf('0x1c')](_0x825229);}};}function respondWithFilteredResult(_0x240056,_0x4c7e8c){return function(_0x7695fb){if(_0x7695fb){var _0x506a94=typeof _0x4c7e8c[_0xccaf('0x1d')]===_0xccaf('0x1e')&&typeof _0x4c7e8c[_0xccaf('0x1f')]===_0xccaf('0x1e');var _0x1e442b=_0x7695fb['count'];var _0x2e5bdd=_0x506a94?0x0:_0x4c7e8c[_0xccaf('0x1d')];var _0x2812a6=_0x506a94?_0x7695fb[_0xccaf('0x20')]:_0x4c7e8c[_0xccaf('0x1d')]+_0x4c7e8c[_0xccaf('0x1f')];var _0x43d27b;if(_0x2812a6>=_0x1e442b){_0x2812a6=_0x1e442b;_0x43d27b=0xc8;}else{_0x43d27b=0xce;}_0x240056[_0xccaf('0x21')](_0x43d27b);return _0x240056[_0xccaf('0x22')](_0xccaf('0x23'),_0x2e5bdd+'-'+_0x2812a6+'/'+_0x1e442b)[_0xccaf('0x1c')](_0x7695fb);}return null;};}function patchUpdates(_0x3ec58a){return function(_0x381c10){try{jsonpatch[_0xccaf('0x24')](_0x381c10,_0x3ec58a,!![]);}catch(_0x13be78){return BPromise[_0xccaf('0x25')](_0x13be78);}return _0x381c10['save']();};}function saveUpdates(_0x5bb6d6,_0x13d45b){return function(_0x38d8ab){if(_0x38d8ab){return _0x38d8ab[_0xccaf('0x26')](_0x5bb6d6)[_0xccaf('0x27')](function(_0x16180d){return _0x16180d;});}return null;};}function removeEntity(_0x18564b,_0x4b7e02){return function(_0x13dd01){if(_0x13dd01){return _0x13dd01['destroy']()[_0xccaf('0x27')](function(){_0x18564b[_0xccaf('0x21')](0xcc)[_0xccaf('0x1b')]();});}};}function handleEntityNotFound(_0x36483b,_0x5b9f88){return function(_0x53d5ae){if(!_0x53d5ae){_0x36483b['sendStatus'](0x194);}return _0x53d5ae;};}function handleError(_0x5d9408,_0x28ce5a){_0x28ce5a=_0x28ce5a||0x1f4;return function(_0x2c3688){logger[_0xccaf('0x28')](_0x2c3688[_0xccaf('0x29')]);if(_0x2c3688['name']){delete _0x2c3688[_0xccaf('0x2a')];}_0x5d9408[_0xccaf('0x21')](_0x28ce5a)[_0xccaf('0x2b')](_0x2c3688);};}exports[_0xccaf('0x2c')]=function(_0x3bc1f8,_0x510eab){var _0x1ab001={},_0x5d8bcb={},_0x2bd3ea={'count':0x0,'rows':[]};var _0x2f7f8d=_[_0xccaf('0x2d')](db['FaxTransferReport']['rawAttributes'],function(_0x221e5d){return{'name':_0x221e5d[_0xccaf('0x2e')],'type':_0x221e5d[_0xccaf('0x2f')]['key']};});_0x5d8bcb['model']=_[_0xccaf('0x2d')](_0x2f7f8d,_0xccaf('0x2a'));_0x5d8bcb['query']=_[_0xccaf('0x30')](_0x3bc1f8[_0xccaf('0x31')]);_0x5d8bcb[_0xccaf('0x32')]=_[_0xccaf('0x33')](_0x5d8bcb[_0xccaf('0x34')],_0x5d8bcb[_0xccaf('0x31')]);_0x1ab001['attributes']=_[_0xccaf('0x33')](_0x5d8bcb[_0xccaf('0x34')],qs[_0xccaf('0x35')](_0x3bc1f8[_0xccaf('0x31')][_0xccaf('0x35')]));_0x1ab001['attributes']=_0x1ab001[_0xccaf('0x36')][_0xccaf('0x37')]?_0x1ab001[_0xccaf('0x36')]:_0x5d8bcb[_0xccaf('0x34')];if(!_0x3bc1f8[_0xccaf('0x31')][_0xccaf('0x38')]('nolimit')){_0x1ab001[_0xccaf('0x1f')]=qs[_0xccaf('0x1f')](_0x3bc1f8['query']['limit']);_0x1ab001[_0xccaf('0x1d')]=qs[_0xccaf('0x1d')](_0x3bc1f8[_0xccaf('0x31')][_0xccaf('0x1d')]);}_0x1ab001['order']=qs[_0xccaf('0x39')](_0x3bc1f8[_0xccaf('0x31')][_0xccaf('0x39')]);_0x1ab001['where']=qs[_0xccaf('0x32')](_[_0xccaf('0x3a')](_0x3bc1f8[_0xccaf('0x31')],_0x5d8bcb['filters']),_0x2f7f8d);if(_0x3bc1f8[_0xccaf('0x31')][_0xccaf('0x3b')]){_0x1ab001[_0xccaf('0x3c')]=_[_0xccaf('0x3d')](_0x1ab001[_0xccaf('0x3c')],{'$or':_[_0xccaf('0x2d')](_0x2f7f8d,function(_0x52250d){if(_0x52250d[_0xccaf('0x2f')]!==_0xccaf('0x3e')){var _0x45b81d={};_0x45b81d[_0x52250d[_0xccaf('0x2a')]]={'$like':'%'+_0x3bc1f8[_0xccaf('0x31')][_0xccaf('0x3b')]+'%'};return _0x45b81d;}})});}_0x1ab001=_[_0xccaf('0x3d')]({},_0x1ab001,_0x3bc1f8[_0xccaf('0x3f')]);var _0x124228={'where':_0x1ab001[_0xccaf('0x3c')]};return db[_0xccaf('0x40')]['count'](_0x124228)[_0xccaf('0x27')](function(_0x178e68){_0x2bd3ea[_0xccaf('0x20')]=_0x178e68;if(_0x3bc1f8[_0xccaf('0x31')]['includeAll']){_0x1ab001[_0xccaf('0x41')]=[{'all':!![]}];}return db[_0xccaf('0x40')][_0xccaf('0x42')](_0x1ab001);})[_0xccaf('0x27')](function(_0x31e3ae){_0x2bd3ea[_0xccaf('0x43')]=_0x31e3ae;return _0x2bd3ea;})[_0xccaf('0x27')](respondWithFilteredResult(_0x510eab,_0x1ab001))[_0xccaf('0x44')](handleError(_0x510eab,null));};exports['show']=function(_0x3b257c,_0x259aa1){var _0x230b0d={'raw':!![],'where':{'id':_0x3b257c[_0xccaf('0x45')]['id']}},_0xbc545={};_0xbc545[_0xccaf('0x34')]=_[_0xccaf('0x30')](db[_0xccaf('0x40')][_0xccaf('0x46')]);_0xbc545['query']=_[_0xccaf('0x30')](_0x3b257c['query']);_0xbc545[_0xccaf('0x32')]=_[_0xccaf('0x33')](_0xbc545['model'],_0xbc545['query']);_0x230b0d['attributes']=_[_0xccaf('0x33')](_0xbc545['model'],qs[_0xccaf('0x35')](_0x3b257c[_0xccaf('0x31')][_0xccaf('0x35')]));_0x230b0d['attributes']=_0x230b0d['attributes'][_0xccaf('0x37')]?_0x230b0d[_0xccaf('0x36')]:_0xbc545[_0xccaf('0x34')];if(_0x3b257c[_0xccaf('0x31')]['includeAll']){_0x230b0d['include']=[{'all':!![]}];}_0x230b0d=_[_0xccaf('0x3d')]({},_0x230b0d,_0x3b257c[_0xccaf('0x3f')]);return db['FaxTransferReport']['find'](_0x230b0d)[_0xccaf('0x27')](handleEntityNotFound(_0x259aa1,null))[_0xccaf('0x27')](respondWithResult(_0x259aa1,null))[_0xccaf('0x44')](handleError(_0x259aa1,null));};exports[_0xccaf('0x47')]=function(_0x4090e7,_0x3a7dab){return db[_0xccaf('0x40')]['create'](_0x4090e7[_0xccaf('0x48')],{})[_0xccaf('0x27')](respondWithResult(_0x3a7dab,0xc9))[_0xccaf('0x44')](handleError(_0x3a7dab,null));};exports[_0xccaf('0x26')]=function(_0x5192bd,_0x1bf5ac){if(_0x5192bd['body']['id']){delete _0x5192bd['body']['id'];}return db[_0xccaf('0x40')][_0xccaf('0x49')]({'where':{'id':_0x5192bd[_0xccaf('0x45')]['id']}})[_0xccaf('0x27')](handleEntityNotFound(_0x1bf5ac,null))[_0xccaf('0x27')](saveUpdates(_0x5192bd[_0xccaf('0x48')],null))[_0xccaf('0x27')](respondWithResult(_0x1bf5ac,null))[_0xccaf('0x44')](handleError(_0x1bf5ac,null));};exports[_0xccaf('0x4a')]=function(_0x41cd84,_0x428e53){return db[_0xccaf('0x40')][_0xccaf('0x49')]({'where':{'id':_0x41cd84[_0xccaf('0x45')]['id']}})[_0xccaf('0x27')](handleEntityNotFound(_0x428e53,null))[_0xccaf('0x27')](removeEntity(_0x428e53,null))['catch'](handleError(_0x428e53,null));};exports[_0xccaf('0x4b')]=function(_0x57e88b,_0x2f76df){return db[_0xccaf('0x40')][_0xccaf('0x4b')]()[_0xccaf('0x27')](respondWithResult(_0x2f76df,null))[_0xccaf('0x44')](handleError(_0x2f76df,null));}; \ No newline at end of file +var _0x1761=['rows','show','params','length','find','create','body','update','catch','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','sendStatus','end','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','then','error','name','send','index','FaxTransferReport','rawAttributes','key','model','map','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','type','merge','options','includeAll','findAll'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x1761,0x182));var _0x1176=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1761[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1176('0x0'));var zipdir=require(_0x1176('0x1'));var jsonpatch=require(_0x1176('0x2'));var rp=require(_0x1176('0x3'));var moment=require(_0x1176('0x4'));var BPromise=require(_0x1176('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1176('0x6'));var sox=require(_0x1176('0x7'));var csv=require(_0x1176('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1176('0x9'));var _=require(_0x1176('0xa'));var squel=require(_0x1176('0xb'));var crypto=require(_0x1176('0xc'));var jsforce=require(_0x1176('0xd'));var deskjs=require(_0x1176('0xe'));var toCsv=require(_0x1176('0x8'));var querystring=require(_0x1176('0xf'));var Papa=require(_0x1176('0x10'));var Redis=require(_0x1176('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1176('0x12'));var as=require(_0x1176('0x13'));var hardwareService=require(_0x1176('0x14'));var logger=require(_0x1176('0x15'))(_0x1176('0x16'));var utils=require(_0x1176('0x17'));var config=require(_0x1176('0x18'));var licenseUtil=require(_0x1176('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa3c138,_0x40b204){_0x40b204=_0x40b204||0xcc;return function(_0x5343c3){if(_0x5343c3){return _0xa3c138[_0x1176('0x1a')](_0x40b204);}return _0xa3c138['status'](_0x40b204)[_0x1176('0x1b')]();};}function respondWithResult(_0x3df165,_0x1347e1){_0x1347e1=_0x1347e1||0xc8;return function(_0x1b3d4a){if(_0x1b3d4a){return _0x3df165[_0x1176('0x1c')](_0x1347e1)[_0x1176('0x1d')](_0x1b3d4a);}};}function respondWithFilteredResult(_0xc3aa66,_0x56c235){return function(_0x3360f5){if(_0x3360f5){var _0x259713=typeof _0x56c235['offset']===_0x1176('0x1e')&&typeof _0x56c235['limit']===_0x1176('0x1e');var _0x1c94bd=_0x3360f5['count'];var _0x1a838b=_0x259713?0x0:_0x56c235[_0x1176('0x1f')];var _0x5692db=_0x259713?_0x3360f5[_0x1176('0x20')]:_0x56c235['offset']+_0x56c235[_0x1176('0x21')];var _0x469286;if(_0x5692db>=_0x1c94bd){_0x5692db=_0x1c94bd;_0x469286=0xc8;}else{_0x469286=0xce;}_0xc3aa66['status'](_0x469286);return _0xc3aa66[_0x1176('0x22')](_0x1176('0x23'),_0x1a838b+'-'+_0x5692db+'/'+_0x1c94bd)[_0x1176('0x1d')](_0x3360f5);}return null;};}function patchUpdates(_0x483667){return function(_0x56d0af){try{jsonpatch[_0x1176('0x24')](_0x56d0af,_0x483667,!![]);}catch(_0x49ef0a){return BPromise[_0x1176('0x25')](_0x49ef0a);}return _0x56d0af['save']();};}function saveUpdates(_0x3df5ac,_0x4e8d35){return function(_0x1ff447){if(_0x1ff447){return _0x1ff447['update'](_0x3df5ac)['then'](function(_0x3bda78){return _0x3bda78;});}return null;};}function removeEntity(_0x4168eb,_0x5aa147){return function(_0x2c0213){if(_0x2c0213){return _0x2c0213['destroy']()[_0x1176('0x26')](function(){_0x4168eb[_0x1176('0x1c')](0xcc)[_0x1176('0x1b')]();});}};}function handleEntityNotFound(_0x254243,_0x23bce0){return function(_0x2b9e13){if(!_0x2b9e13){_0x254243['sendStatus'](0x194);}return _0x2b9e13;};}function handleError(_0x5abac2,_0x28ee46){_0x28ee46=_0x28ee46||0x1f4;return function(_0x20a6cf){logger[_0x1176('0x27')](_0x20a6cf['stack']);if(_0x20a6cf[_0x1176('0x28')]){delete _0x20a6cf['name'];}_0x5abac2[_0x1176('0x1c')](_0x28ee46)[_0x1176('0x29')](_0x20a6cf);};}exports[_0x1176('0x2a')]=function(_0x2b0204,_0x16ab86){var _0x1ef0d6={},_0x470a1b={},_0x5f5a77={'count':0x0,'rows':[]};var _0x1862ec=_['map'](db[_0x1176('0x2b')][_0x1176('0x2c')],function(_0x360c35){return{'name':_0x360c35['fieldName'],'type':_0x360c35['type'][_0x1176('0x2d')]};});_0x470a1b[_0x1176('0x2e')]=_[_0x1176('0x2f')](_0x1862ec,'name');_0x470a1b['query']=_[_0x1176('0x30')](_0x2b0204[_0x1176('0x31')]);_0x470a1b[_0x1176('0x32')]=_[_0x1176('0x33')](_0x470a1b[_0x1176('0x2e')],_0x470a1b[_0x1176('0x31')]);_0x1ef0d6['attributes']=_['intersection'](_0x470a1b[_0x1176('0x2e')],qs['fields'](_0x2b0204['query'][_0x1176('0x34')]));_0x1ef0d6[_0x1176('0x35')]=_0x1ef0d6[_0x1176('0x35')]['length']?_0x1ef0d6['attributes']:_0x470a1b[_0x1176('0x2e')];if(!_0x2b0204[_0x1176('0x31')]['hasOwnProperty'](_0x1176('0x36'))){_0x1ef0d6['limit']=qs[_0x1176('0x21')](_0x2b0204[_0x1176('0x31')]['limit']);_0x1ef0d6[_0x1176('0x1f')]=qs['offset'](_0x2b0204[_0x1176('0x31')][_0x1176('0x1f')]);}_0x1ef0d6[_0x1176('0x37')]=qs[_0x1176('0x38')](_0x2b0204[_0x1176('0x31')][_0x1176('0x38')]);_0x1ef0d6[_0x1176('0x39')]=qs[_0x1176('0x32')](_['pick'](_0x2b0204[_0x1176('0x31')],_0x470a1b[_0x1176('0x32')]),_0x1862ec);if(_0x2b0204['query'][_0x1176('0x3a')]){_0x1ef0d6[_0x1176('0x39')]=_['merge'](_0x1ef0d6[_0x1176('0x39')],{'$or':_['map'](_0x1862ec,function(_0x450bd1){if(_0x450bd1[_0x1176('0x3b')]!=='VIRTUAL'){var _0xf87f63={};_0xf87f63[_0x450bd1[_0x1176('0x28')]]={'$like':'%'+_0x2b0204['query'][_0x1176('0x3a')]+'%'};return _0xf87f63;}})});}_0x1ef0d6=_[_0x1176('0x3c')]({},_0x1ef0d6,_0x2b0204[_0x1176('0x3d')]);var _0x308558={'where':_0x1ef0d6['where']};return db['FaxTransferReport'][_0x1176('0x20')](_0x308558)[_0x1176('0x26')](function(_0x2d31eb){_0x5f5a77[_0x1176('0x20')]=_0x2d31eb;if(_0x2b0204[_0x1176('0x31')][_0x1176('0x3e')]){_0x1ef0d6['include']=[{'all':!![]}];}return db[_0x1176('0x2b')][_0x1176('0x3f')](_0x1ef0d6);})[_0x1176('0x26')](function(_0x1de8fe){_0x5f5a77[_0x1176('0x40')]=_0x1de8fe;return _0x5f5a77;})[_0x1176('0x26')](respondWithFilteredResult(_0x16ab86,_0x1ef0d6))['catch'](handleError(_0x16ab86,null));};exports[_0x1176('0x41')]=function(_0x3b2760,_0x48df91){var _0x4d93eb={'raw':!![],'where':{'id':_0x3b2760[_0x1176('0x42')]['id']}},_0x28dad8={};_0x28dad8[_0x1176('0x2e')]=_['keys'](db[_0x1176('0x2b')][_0x1176('0x2c')]);_0x28dad8[_0x1176('0x31')]=_[_0x1176('0x30')](_0x3b2760[_0x1176('0x31')]);_0x28dad8[_0x1176('0x32')]=_[_0x1176('0x33')](_0x28dad8['model'],_0x28dad8[_0x1176('0x31')]);_0x4d93eb[_0x1176('0x35')]=_['intersection'](_0x28dad8[_0x1176('0x2e')],qs['fields'](_0x3b2760[_0x1176('0x31')][_0x1176('0x34')]));_0x4d93eb['attributes']=_0x4d93eb['attributes'][_0x1176('0x43')]?_0x4d93eb[_0x1176('0x35')]:_0x28dad8['model'];if(_0x3b2760[_0x1176('0x31')]['includeAll']){_0x4d93eb['include']=[{'all':!![]}];}_0x4d93eb=_[_0x1176('0x3c')]({},_0x4d93eb,_0x3b2760[_0x1176('0x3d')]);return db[_0x1176('0x2b')][_0x1176('0x44')](_0x4d93eb)[_0x1176('0x26')](handleEntityNotFound(_0x48df91,null))[_0x1176('0x26')](respondWithResult(_0x48df91,null))['catch'](handleError(_0x48df91,null));};exports[_0x1176('0x45')]=function(_0x1d696e,_0x11d9a7){return db[_0x1176('0x2b')][_0x1176('0x45')](_0x1d696e[_0x1176('0x46')],{})[_0x1176('0x26')](respondWithResult(_0x11d9a7,0xc9))['catch'](handleError(_0x11d9a7,null));};exports[_0x1176('0x47')]=function(_0x4cf523,_0x5ef0da){if(_0x4cf523[_0x1176('0x46')]['id']){delete _0x4cf523[_0x1176('0x46')]['id'];}return db['FaxTransferReport'][_0x1176('0x44')]({'where':{'id':_0x4cf523['params']['id']}})[_0x1176('0x26')](handleEntityNotFound(_0x5ef0da,null))['then'](saveUpdates(_0x4cf523['body'],null))[_0x1176('0x26')](respondWithResult(_0x5ef0da,null))[_0x1176('0x48')](handleError(_0x5ef0da,null));};exports[_0x1176('0x49')]=function(_0x39d708,_0x155358){return db[_0x1176('0x2b')][_0x1176('0x44')]({'where':{'id':_0x39d708['params']['id']}})[_0x1176('0x26')](handleEntityNotFound(_0x155358,null))[_0x1176('0x26')](removeEntity(_0x155358,null))['catch'](handleError(_0x155358,null));};exports['describe']=function(_0xd12b72,_0x540cd5){return db['FaxTransferReport'][_0x1176('0x4a')]()['then'](respondWithResult(_0x540cd5,null))[_0x1176('0x48')](handleError(_0x540cd5,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index b738469..39cf84c 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 _0x108f=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','rimraf','./faxTransferReport.attributes','exports'];(function(_0x4054fe,_0x18f33e){var _0x4f9bee=function(_0x3c304d){while(--_0x3c304d){_0x4054fe['push'](_0x4054fe['shift']());}};_0x4f9bee(++_0x18f33e);}(_0x108f,0xbe));var _0xf108=function(_0x5e2e0f,_0x17c864){_0x5e2e0f=_0x5e2e0f-0x0;var _0x4ed375=_0x108f[_0x5e2e0f];return _0x4ed375;};'use strict';var _=require(_0xf108('0x0'));var util=require(_0xf108('0x1'));var logger=require(_0xf108('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf108('0x3'));var rp=require(_0xf108('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf108('0x5'));var config=require('../../config/environment');var attributes=require(_0xf108('0x6'));module[_0xf108('0x7')]=function(_0x980986,_0x28821){return _0x980986['define'](_0xf108('0x8'),attributes,{'tableName':_0xf108('0x9'),'paranoid':![],'indexes':[{'name':_0xf108('0xa'),'fields':[_0xf108('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9173=['moment','request-promise','path','../../config/environment','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x9173,0x7e));var _0x3917=function(_0x53d8df,_0x514c07){_0x53d8df=_0x53d8df-0x0;var _0x2a714e=_0x9173[_0x53d8df];return _0x2a714e;};'use strict';var _=require(_0x3917('0x0'));var util=require(_0x3917('0x1'));var logger=require(_0x3917('0x2'))(_0x3917('0x3'));var moment=require(_0x3917('0x4'));var BPromise=require('bluebird');var rp=require(_0x3917('0x5'));var fs=require('fs');var path=require(_0x3917('0x6'));var rimraf=require('rimraf');var config=require(_0x3917('0x7'));var attributes=require('./faxTransferReport.attributes');module[_0x3917('0x8')]=function(_0x4a3c34,_0x32535a){return _0x4a3c34[_0x3917('0x9')](_0x3917('0xa'),attributes,{'tableName':_0x3917('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3917('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index c575a38..1bfc328 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 _0x7ebb=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxTransferReport,\x20%s,\x20%s','message','info','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ebb,0x150));var _0xb7eb=function(_0xb80ee3,_0x4d9bc3){_0xb80ee3=_0xb80ee3-0x0;var _0x34720a=_0x7ebb[_0xb80ee3];return _0x34720a;};'use strict';var _=require(_0xb7eb('0x0'));var util=require(_0xb7eb('0x1'));var moment=require(_0xb7eb('0x2'));var BPromise=require(_0xb7eb('0x3'));var rs=require(_0xb7eb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7eb('0x5'))['db'];var utils=require(_0xb7eb('0x6'));var logger=require(_0xb7eb('0x7'))('rpc');var config=require(_0xb7eb('0x8'));var jayson=require(_0xb7eb('0x9'));var client=jayson[_0xb7eb('0xa')][_0xb7eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25d3ce,_0x168aff,_0x1e8f7f){return new BPromise(function(_0x36de9a,_0x4cb1df){return client[_0xb7eb('0xc')](_0x25d3ce,_0x1e8f7f)[_0xb7eb('0xd')](function(_0x31c3c4){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x168aff,'request\x20sent');logger[_0xb7eb('0xe')](_0xb7eb('0xf'),_0x168aff,_0xb7eb('0x10'),JSON['stringify'](_0x31c3c4));if(_0x31c3c4[_0xb7eb('0x11')]){if(_0x31c3c4[_0xb7eb('0x11')][_0xb7eb('0x12')]===0x1f4){logger[_0xb7eb('0x11')](_0xb7eb('0x13'),_0x168aff,_0x31c3c4[_0xb7eb('0x11')][_0xb7eb('0x14')]);return _0x4cb1df(_0x31c3c4[_0xb7eb('0x11')][_0xb7eb('0x14')]);}logger[_0xb7eb('0x11')](_0xb7eb('0x13'),_0x168aff,_0x31c3c4['error']['message']);return _0x36de9a(_0x31c3c4[_0xb7eb('0x11')]['message']);}else{logger[_0xb7eb('0x15')]('FaxTransferReport,\x20%s,\x20%s',_0x168aff,_0xb7eb('0x10'));_0x36de9a(_0x31c3c4[_0xb7eb('0x16')][_0xb7eb('0x14')]);}})[_0xb7eb('0x17')](function(_0x2cbfed){logger[_0xb7eb('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x168aff,_0x2cbfed);_0x4cb1df(_0x2cbfed);});});} \ No newline at end of file +var _0xb83f=['error','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x266f5f,_0x49d855){var _0x41d69f=function(_0x4387b6){while(--_0x4387b6){_0x266f5f['push'](_0x266f5f['shift']());}};_0x41d69f(++_0x49d855);}(_0xb83f,0xab));var _0xfb83=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xb83f[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xfb83('0x0'));var util=require(_0xfb83('0x1'));var moment=require(_0xfb83('0x2'));var BPromise=require(_0xfb83('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb83('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb83('0x5'));var logger=require(_0xfb83('0x6'))(_0xfb83('0x7'));var config=require(_0xfb83('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfb83('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4172f2,_0xba2b1e,_0x465bf7){return new BPromise(function(_0x3b964b,_0x381a48){return client[_0xfb83('0xa')](_0x4172f2,_0x465bf7)[_0xfb83('0xb')](function(_0x28feb5){logger[_0xfb83('0xc')](_0xfb83('0xd'),_0xba2b1e,_0xfb83('0xe'));logger[_0xfb83('0xf')](_0xfb83('0x10'),_0xba2b1e,_0xfb83('0xe'),JSON[_0xfb83('0x11')](_0x28feb5));if(_0x28feb5[_0xfb83('0x12')]){if(_0x28feb5[_0xfb83('0x12')]['code']===0x1f4){logger[_0xfb83('0x12')](_0xfb83('0xd'),_0xba2b1e,_0x28feb5[_0xfb83('0x12')]['message']);return _0x381a48(_0x28feb5[_0xfb83('0x12')]['message']);}logger[_0xfb83('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0xba2b1e,_0x28feb5['error'][_0xfb83('0x13')]);return _0x3b964b(_0x28feb5[_0xfb83('0x12')][_0xfb83('0x13')]);}else{logger[_0xfb83('0xc')](_0xfb83('0xd'),_0xba2b1e,_0xfb83('0xe'));_0x3b964b(_0x28feb5['result'][_0xfb83('0x13')]);}})[_0xfb83('0x14')](function(_0x461f79){logger[_0xfb83('0x12')](_0xfb83('0xd'),_0xba2b1e,_0x461f79);_0x381a48(_0x461f79);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 5cf0305..018223a 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 _0x5728=['post','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5728,0x16e));var _0x8572=function(_0x86f8a7,_0x4de00e){_0x86f8a7=_0x86f8a7-0x0;var _0x491a2d=_0x5728[_0x86f8a7];return _0x491a2d;};'use strict';var multer=require(_0x8572('0x0'));var util=require(_0x8572('0x1'));var path=require(_0x8572('0x2'));var timeout=require(_0x8572('0x3'));var express=require(_0x8572('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8572('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8572('0x6'));var controller=require(_0x8572('0x7'));router[_0x8572('0x8')]('/',auth[_0x8572('0x9')](),controller[_0x8572('0xa')]);router['get']('/describe',auth[_0x8572('0x9')](),controller[_0x8572('0xb')]);router[_0x8572('0x8')](_0x8572('0xc'),auth['isAuthenticated'](),controller[_0x8572('0xd')]);router[_0x8572('0xe')]('/',auth[_0x8572('0x9')](),controller['create']);router[_0x8572('0xf')](_0x8572('0xc'),auth[_0x8572('0x9')](),controller[_0x8572('0x10')]);router[_0x8572('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8572('0x12')]=router; \ No newline at end of file +var _0xe4fd=['fs-extra','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','index','/describe','isAuthenticated','post','create','update','/:id','destroy','multer','util','path','express','Router'];(function(_0x160be1,_0x5deaa9){var _0x46df83=function(_0x122192){while(--_0x122192){_0x160be1['push'](_0x160be1['shift']());}};_0x46df83(++_0x5deaa9);}(_0xe4fd,0x12d));var _0xde4f=function(_0x2bd9c7,_0x1e8db0){_0x2bd9c7=_0x2bd9c7-0x0;var _0x427278=_0xe4fd[_0x2bd9c7];return _0x427278;};'use strict';var multer=require(_0xde4f('0x0'));var util=require(_0xde4f('0x1'));var path=require(_0xde4f('0x2'));var timeout=require('connect-timeout');var express=require(_0xde4f('0x3'));var router=express[_0xde4f('0x4')]();var fs_extra=require(_0xde4f('0x5'));var auth=require(_0xde4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xde4f('0x7'));var controller=require(_0xde4f('0x8'));router[_0xde4f('0x9')]('/',auth['isAuthenticated'](),controller[_0xde4f('0xa')]);router[_0xde4f('0x9')](_0xde4f('0xb'),auth[_0xde4f('0xc')](),controller['describe']);router[_0xde4f('0x9')]('/:id',auth[_0xde4f('0xc')](),controller['show']);router[_0xde4f('0xd')]('/',auth[_0xde4f('0xc')](),controller[_0xde4f('0xe')]);router['put']('/:id',auth[_0xde4f('0xc')](),controller[_0xde4f('0xf')]);router['delete'](_0xde4f('0x10'),auth[_0xde4f('0xc')](),controller[_0xde4f('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index f62797a..be0e764 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 _0x668c=['isAuthenticated','index','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','update','delete','/:id','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get'];(function(_0xe67e22,_0x547e07){var _0x39ff12=function(_0x4496d2){while(--_0x4496d2){_0xe67e22['push'](_0xe67e22['shift']());}};_0x39ff12(++_0x547e07);}(_0x668c,0x147));var _0xc668=function(_0x22de84,_0x56142b){_0x22de84=_0x22de84-0x0;var _0x54fc49=_0x668c[_0x22de84];return _0x54fc49;};'use strict';var multer=require('multer');var util=require(_0xc668('0x0'));var path=require(_0xc668('0x1'));var timeout=require('connect-timeout');var express=require(_0xc668('0x2'));var router=express['Router']();var fs_extra=require(_0xc668('0x3'));var auth=require(_0xc668('0x4'));var interaction=require(_0xc668('0x5'));var config=require(_0xc668('0x6'));var controller=require(_0xc668('0x7'));router[_0xc668('0x8')]('/',auth[_0xc668('0x9')](),controller[_0xc668('0xa')]);router[_0xc668('0x8')]('/:id',auth[_0xc668('0x9')](),controller['show']);router[_0xc668('0x8')]('/:id/configurations',auth[_0xc668('0x9')](),controller[_0xc668('0xb')]);router[_0xc668('0x8')](_0xc668('0xc'),auth[_0xc668('0x9')](),controller[_0xc668('0xd')]);router['post']('/',auth[_0xc668('0x9')](),controller[_0xc668('0xe')]);router[_0xc668('0xf')](_0xc668('0x10'),auth[_0xc668('0x9')](),controller['addConfiguration']);router['put']('/:id',auth[_0xc668('0x9')](),controller[_0xc668('0x11')]);router[_0xc668('0x12')](_0xc668('0x13'),auth['isAuthenticated'](),controller[_0xc668('0x14')]);module['exports']=router; \ No newline at end of file +var _0x19e5=['addConfiguration','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','index','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x19e5,0x126));var _0x519e=function(_0x323116,_0x5ced14){_0x323116=_0x323116-0x0;var _0x14b3ea=_0x19e5[_0x323116];return _0x14b3ea;};'use strict';var multer=require('multer');var util=require(_0x519e('0x0'));var path=require(_0x519e('0x1'));var timeout=require(_0x519e('0x2'));var express=require(_0x519e('0x3'));var router=express[_0x519e('0x4')]();var fs_extra=require(_0x519e('0x5'));var auth=require(_0x519e('0x6'));var interaction=require(_0x519e('0x7'));var config=require('../../config/environment');var controller=require(_0x519e('0x8'));router[_0x519e('0x9')]('/',auth['isAuthenticated'](),controller[_0x519e('0xa')]);router[_0x519e('0x9')]('/:id',auth[_0x519e('0xb')](),controller['show']);router[_0x519e('0x9')](_0x519e('0xc'),auth[_0x519e('0xb')](),controller[_0x519e('0xd')]);router[_0x519e('0x9')](_0x519e('0xe'),auth[_0x519e('0xb')](),controller[_0x519e('0xf')]);router[_0x519e('0x10')]('/',auth['isAuthenticated'](),controller[_0x519e('0x11')]);router[_0x519e('0x10')](_0x519e('0xc'),auth[_0x519e('0xb')](),controller[_0x519e('0x12')]);router[_0x519e('0x13')](_0x519e('0x14'),auth['isAuthenticated'](),controller[_0x519e('0x15')]);router[_0x519e('0x16')](_0x519e('0x14'),auth[_0x519e('0xb')](),controller[_0x519e('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 94f5453..b53b21b 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 _0xecf0=['basic','newTab','STRING','ENUM'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0xecf0,0x1a2));var _0x0ecf=function(_0x43b44d,_0x4c619a){_0x43b44d=_0x43b44d-0x0;var _0x4dca98=_0xecf0[_0x43b44d];return _0x4dca98;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0ecf('0x0')]},'description':{'type':Sequelize[_0x0ecf('0x0')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x0ecf('0x1')](_0x0ecf('0x2')),'defaultValue':_0x0ecf('0x2')},'password':{'type':Sequelize[_0x0ecf('0x0')]},'consumerKey':{'type':Sequelize[_0x0ecf('0x0')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x0ecf('0x0')]},'tokenSecret':{'type':Sequelize[_0x0ecf('0x0')]},'serverUrl':{'type':Sequelize[_0x0ecf('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x0ecf('0x1')]('integrationTab',_0x0ecf('0x3')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xe50a=['sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x48ac37,_0x3eaa66){var _0x312cd2=function(_0x4beea2){while(--_0x4beea2){_0x48ac37['push'](_0x48ac37['shift']());}};_0x312cd2(++_0x3eaa66);}(_0xe50a,0xf0));var _0xae50=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0xe50a[_0x470bfb];return _0x2f5d97;};'use strict';var Sequelize=require(_0xae50('0x0'));module[_0xae50('0x1')]={'name':{'type':Sequelize[_0xae50('0x2')]},'description':{'type':Sequelize[_0xae50('0x2')]},'username':{'type':Sequelize[_0xae50('0x2')]},'remoteUri':{'type':Sequelize[_0xae50('0x2')]},'authType':{'type':Sequelize[_0xae50('0x3')](_0xae50('0x4')),'defaultValue':_0xae50('0x4')},'password':{'type':Sequelize[_0xae50('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xae50('0x2')]},'tokenSecret':{'type':Sequelize[_0xae50('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xae50('0x5'),'newTab'),'defaultValue':_0xae50('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 68c2c6c..37c786e 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 _0xcd46=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','name','index','DeskAccount','rawAttributes','type','key','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','merge','options','include','rows','catch','show','params','includeAll','find','create','body','update','findOne','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','DeskField','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','toString','base64','entries','active','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0xcd46,0xe2));var _0x6cd4=function(_0x2509c0,_0x1fbe12){_0x2509c0=_0x2509c0-0x0;var _0x515d46=_0xcd46[_0x2509c0];return _0x515d46;};'use strict';var emlformat=require(_0x6cd4('0x0'));var rimraf=require(_0x6cd4('0x1'));var zipdir=require(_0x6cd4('0x2'));var jsonpatch=require(_0x6cd4('0x3'));var rp=require(_0x6cd4('0x4'));var moment=require('moment');var BPromise=require(_0x6cd4('0x5'));var Mustache=require(_0x6cd4('0x6'));var util=require(_0x6cd4('0x7'));var path=require(_0x6cd4('0x8'));var sox=require(_0x6cd4('0x9'));var csv=require(_0x6cd4('0xa'));var ejs=require(_0x6cd4('0xb'));var fs=require('fs');var fs_extra=require(_0x6cd4('0xc'));var _=require(_0x6cd4('0xd'));var squel=require(_0x6cd4('0xe'));var crypto=require(_0x6cd4('0xf'));var jsforce=require(_0x6cd4('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x6cd4('0xa'));var querystring=require('querystring');var Papa=require(_0x6cd4('0x11'));var Redis=require(_0x6cd4('0x12'));var authService=require(_0x6cd4('0x13'));var qs=require(_0x6cd4('0x14'));var as=require(_0x6cd4('0x15'));var hardwareService=require(_0x6cd4('0x16'));var logger=require('../../config/logger')(_0x6cd4('0x17'));var utils=require(_0x6cd4('0x18'));var config=require(_0x6cd4('0x19'));var licenseUtil=require(_0x6cd4('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x49b188,_0x28cbec){_0x28cbec=_0x28cbec||0xcc;return function(_0x1bc48e){if(_0x1bc48e){return _0x49b188[_0x6cd4('0x1b')](_0x28cbec);}return _0x49b188[_0x6cd4('0x1c')](_0x28cbec)[_0x6cd4('0x1d')]();};}function respondWithResult(_0x397dd8,_0x1856a8){_0x1856a8=_0x1856a8||0xc8;return function(_0x2dd014){if(_0x2dd014){return _0x397dd8['status'](_0x1856a8)[_0x6cd4('0x1e')](_0x2dd014);}};}function respondWithFilteredResult(_0x32574b,_0x57512c){return function(_0xbc8d7c){if(_0xbc8d7c){var _0x1ec3ed=typeof _0x57512c[_0x6cd4('0x1f')]===_0x6cd4('0x20')&&typeof _0x57512c[_0x6cd4('0x21')]==='undefined';var _0x688abb=_0xbc8d7c['count'];var _0x1a045e=_0x1ec3ed?0x0:_0x57512c[_0x6cd4('0x1f')];var _0x18e197=_0x1ec3ed?_0xbc8d7c[_0x6cd4('0x22')]:_0x57512c[_0x6cd4('0x1f')]+_0x57512c[_0x6cd4('0x21')];var _0x11a962;if(_0x18e197>=_0x688abb){_0x18e197=_0x688abb;_0x11a962=0xc8;}else{_0x11a962=0xce;}_0x32574b['status'](_0x11a962);return _0x32574b[_0x6cd4('0x23')]('Content-Range',_0x1a045e+'-'+_0x18e197+'/'+_0x688abb)[_0x6cd4('0x1e')](_0xbc8d7c);}return null;};}function patchUpdates(_0x44c146){return function(_0x371fcb){try{jsonpatch[_0x6cd4('0x24')](_0x371fcb,_0x44c146,!![]);}catch(_0xbf3a53){return BPromise[_0x6cd4('0x25')](_0xbf3a53);}return _0x371fcb['save']();};}function saveUpdates(_0x120977,_0x3c1f9c){return function(_0x2f1413){if(_0x2f1413){return _0x2f1413['update'](_0x120977)[_0x6cd4('0x26')](function(_0x33d955){return _0x33d955;});}return null;};}function removeEntity(_0x36be4a,_0x4bd869){return function(_0x479985){if(_0x479985){return _0x479985[_0x6cd4('0x27')]()[_0x6cd4('0x26')](function(){_0x36be4a[_0x6cd4('0x1c')](0xcc)[_0x6cd4('0x1d')]();});}};}function handleEntityNotFound(_0x11f9ce,_0x29c747){return function(_0x14bb0d){if(!_0x14bb0d){_0x11f9ce[_0x6cd4('0x1b')](0x194);}return _0x14bb0d;};}function handleError(_0x5d8eec,_0x1a9e27){_0x1a9e27=_0x1a9e27||0x1f4;return function(_0x44d3c2){logger['error'](_0x44d3c2['stack']);if(_0x44d3c2[_0x6cd4('0x28')]){delete _0x44d3c2[_0x6cd4('0x28')];}_0x5d8eec[_0x6cd4('0x1c')](_0x1a9e27)['send'](_0x44d3c2);};}exports[_0x6cd4('0x29')]=function(_0x54684a,_0x2fe51a){var _0x43c833={},_0x53af46={},_0xfaf726={'count':0x0,'rows':[]};var _0x436c12=_['map'](db[_0x6cd4('0x2a')][_0x6cd4('0x2b')],function(_0x561be9){return{'name':_0x561be9['fieldName'],'type':_0x561be9[_0x6cd4('0x2c')][_0x6cd4('0x2d')]};});_0x53af46[_0x6cd4('0x2e')]=_[_0x6cd4('0x2f')](_0x436c12,_0x6cd4('0x28'));_0x53af46['query']=_[_0x6cd4('0x30')](_0x54684a[_0x6cd4('0x31')]);_0x53af46['filters']=_['intersection'](_0x53af46[_0x6cd4('0x2e')],_0x53af46[_0x6cd4('0x31')]);_0x43c833[_0x6cd4('0x32')]=_[_0x6cd4('0x33')](_0x53af46[_0x6cd4('0x2e')],qs[_0x6cd4('0x34')](_0x54684a['query'][_0x6cd4('0x34')]));_0x43c833[_0x6cd4('0x32')]=_0x43c833[_0x6cd4('0x32')][_0x6cd4('0x35')]?_0x43c833[_0x6cd4('0x32')]:_0x53af46[_0x6cd4('0x2e')];if(!_0x54684a[_0x6cd4('0x31')][_0x6cd4('0x36')]('nolimit')){_0x43c833[_0x6cd4('0x21')]=qs['limit'](_0x54684a[_0x6cd4('0x31')][_0x6cd4('0x21')]);_0x43c833[_0x6cd4('0x1f')]=qs[_0x6cd4('0x1f')](_0x54684a[_0x6cd4('0x31')]['offset']);}_0x43c833[_0x6cd4('0x37')]=qs['sort'](_0x54684a['query'][_0x6cd4('0x38')]);_0x43c833[_0x6cd4('0x39')]=qs[_0x6cd4('0x3a')](_['pick'](_0x54684a['query'],_0x53af46['filters']),_0x436c12);if(_0x54684a[_0x6cd4('0x31')][_0x6cd4('0x3b')]){_0x43c833[_0x6cd4('0x39')]=_['merge'](_0x43c833[_0x6cd4('0x39')],{'$or':_[_0x6cd4('0x2f')](_0x436c12,function(_0x32e740){if(_0x32e740[_0x6cd4('0x2c')]!==_0x6cd4('0x3c')){var _0x4d5316={};_0x4d5316[_0x32e740[_0x6cd4('0x28')]]={'$like':'%'+_0x54684a[_0x6cd4('0x31')][_0x6cd4('0x3b')]+'%'};return _0x4d5316;}})});}_0x43c833=_[_0x6cd4('0x3d')]({},_0x43c833,_0x54684a[_0x6cd4('0x3e')]);var _0x37c1e5={'where':_0x43c833['where']};return db['DeskAccount'][_0x6cd4('0x22')](_0x37c1e5)['then'](function(_0x412d2b){_0xfaf726['count']=_0x412d2b;if(_0x54684a[_0x6cd4('0x31')]['includeAll']){_0x43c833[_0x6cd4('0x3f')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x43c833);})['then'](function(_0x3dbafd){_0xfaf726[_0x6cd4('0x40')]=_0x3dbafd;return _0xfaf726;})[_0x6cd4('0x26')](respondWithFilteredResult(_0x2fe51a,_0x43c833))[_0x6cd4('0x41')](handleError(_0x2fe51a,null));};exports[_0x6cd4('0x42')]=function(_0x5c96e7,_0x276abc){var _0x4a2112={'raw':![],'where':{'id':_0x5c96e7[_0x6cd4('0x43')]['id']}},_0x237740={};_0x237740[_0x6cd4('0x2e')]=_[_0x6cd4('0x30')](db[_0x6cd4('0x2a')][_0x6cd4('0x2b')]);_0x237740[_0x6cd4('0x31')]=_[_0x6cd4('0x30')](_0x5c96e7[_0x6cd4('0x31')]);_0x237740[_0x6cd4('0x3a')]=_[_0x6cd4('0x33')](_0x237740[_0x6cd4('0x2e')],_0x237740[_0x6cd4('0x31')]);_0x4a2112[_0x6cd4('0x32')]=_[_0x6cd4('0x33')](_0x237740['model'],qs[_0x6cd4('0x34')](_0x5c96e7['query'][_0x6cd4('0x34')]));_0x4a2112[_0x6cd4('0x32')]=_0x4a2112['attributes'][_0x6cd4('0x35')]?_0x4a2112[_0x6cd4('0x32')]:_0x237740[_0x6cd4('0x2e')];if(_0x5c96e7['query'][_0x6cd4('0x44')]){_0x4a2112[_0x6cd4('0x3f')]=[{'all':!![]}];}_0x4a2112=_['merge']({},_0x4a2112,_0x5c96e7[_0x6cd4('0x3e')]);return db[_0x6cd4('0x2a')][_0x6cd4('0x45')](_0x4a2112)[_0x6cd4('0x26')](handleEntityNotFound(_0x276abc,null))[_0x6cd4('0x26')](respondWithResult(_0x276abc,null))[_0x6cd4('0x41')](handleError(_0x276abc,null));};exports[_0x6cd4('0x46')]=function(_0x3eeda0,_0x3508e9){return db[_0x6cd4('0x2a')][_0x6cd4('0x46')](_0x3eeda0[_0x6cd4('0x47')],{})[_0x6cd4('0x26')](respondWithResult(_0x3508e9,0xc9))[_0x6cd4('0x41')](handleError(_0x3508e9,null));};exports[_0x6cd4('0x48')]=function(_0x2cb365,_0x534b68){if(_0x2cb365[_0x6cd4('0x47')]['id']){delete _0x2cb365[_0x6cd4('0x47')]['id'];}return db['DeskAccount'][_0x6cd4('0x45')]({'where':{'id':_0x2cb365['params']['id']}})[_0x6cd4('0x26')](handleEntityNotFound(_0x534b68,null))[_0x6cd4('0x26')](saveUpdates(_0x2cb365[_0x6cd4('0x47')],null))[_0x6cd4('0x26')](respondWithResult(_0x534b68,null))[_0x6cd4('0x41')](handleError(_0x534b68,null));};exports[_0x6cd4('0x27')]=function(_0xd108ab,_0x31fdbb){return db['DeskAccount'][_0x6cd4('0x45')]({'where':{'id':_0xd108ab['params']['id']}})[_0x6cd4('0x26')](handleEntityNotFound(_0x31fdbb,null))[_0x6cd4('0x26')](removeEntity(_0x31fdbb,null))[_0x6cd4('0x41')](handleError(_0x31fdbb,null));};exports['getConfigurations']=function(_0x4efc55,_0x215954,_0x1abb9f){var _0x46a40e={};var _0x21d34e={};var _0x3709a2;var _0x3f0a05;return db[_0x6cd4('0x2a')][_0x6cd4('0x49')]({'where':{'id':_0x4efc55[_0x6cd4('0x43')]['id']}})['then'](handleEntityNotFound(_0x215954,null))[_0x6cd4('0x26')](function(_0x2b47c2){if(_0x2b47c2){_0x3709a2=_0x2b47c2;_0x21d34e[_0x6cd4('0x2e')]=_['keys'](db['DeskConfiguration']['rawAttributes']);_0x21d34e['query']=_[_0x6cd4('0x30')](_0x4efc55['query']);_0x21d34e[_0x6cd4('0x3a')]=_[_0x6cd4('0x33')](_0x21d34e[_0x6cd4('0x2e')],_0x21d34e[_0x6cd4('0x31')]);_0x46a40e['attributes']=_[_0x6cd4('0x33')](_0x21d34e[_0x6cd4('0x2e')],qs[_0x6cd4('0x34')](_0x4efc55['query'][_0x6cd4('0x34')]));_0x46a40e[_0x6cd4('0x32')]=_0x46a40e[_0x6cd4('0x32')][_0x6cd4('0x35')]?_0x46a40e['attributes']:_0x21d34e[_0x6cd4('0x2e')];_0x46a40e[_0x6cd4('0x37')]=qs[_0x6cd4('0x38')](_0x4efc55[_0x6cd4('0x31')]['sort']);_0x46a40e[_0x6cd4('0x39')]=qs[_0x6cd4('0x3a')](_['pick'](_0x4efc55[_0x6cd4('0x31')],_0x21d34e[_0x6cd4('0x3a')]));if(_0x4efc55[_0x6cd4('0x31')][_0x6cd4('0x3b')]){_0x46a40e[_0x6cd4('0x39')]=_[_0x6cd4('0x3d')](_0x46a40e[_0x6cd4('0x39')],{'$or':_[_0x6cd4('0x2f')](_0x46a40e[_0x6cd4('0x32')],function(_0x1259a5){var _0x4a68b9={};_0x4a68b9[_0x1259a5]={'$like':'%'+_0x4efc55[_0x6cd4('0x31')][_0x6cd4('0x3b')]+'%'};return _0x4a68b9;})});}_0x46a40e=_['merge']({},_0x46a40e,_0x4efc55[_0x6cd4('0x3e')]);return _0x3709a2[_0x6cd4('0x4a')](_0x46a40e);}})[_0x6cd4('0x26')](function(_0x2c3f9e){if(_0x2c3f9e){_0x3f0a05=_0x2c3f9e[_0x6cd4('0x35')];if(!_0x4efc55['query']['hasOwnProperty'](_0x6cd4('0x4b'))){_0x46a40e[_0x6cd4('0x21')]=qs[_0x6cd4('0x21')](_0x4efc55[_0x6cd4('0x31')]['limit']);_0x46a40e['offset']=qs['offset'](_0x4efc55[_0x6cd4('0x31')][_0x6cd4('0x1f')]);}return _0x3709a2['getConfigurations'](_0x46a40e);}})[_0x6cd4('0x26')](function(_0x2d01de){if(_0x2d01de){return _0x2d01de?{'count':_0x3f0a05,'rows':_0x2d01de}:null;}})['then'](respondWithResult(_0x215954,null))[_0x6cd4('0x41')](handleError(_0x215954,null));};exports[_0x6cd4('0x4c')]=function(_0x1b73a3,_0x23ce4d,_0x546c5a){if(_0x1b73a3['body']['id']){delete _0x1b73a3[_0x6cd4('0x47')]['id'];}return db[_0x6cd4('0x2a')]['findOne']({'where':{'id':_0x1b73a3[_0x6cd4('0x43')]['id']}})[_0x6cd4('0x26')](handleEntityNotFound(_0x23ce4d,null))[_0x6cd4('0x26')](function(_0x6c2705){if(_0x6c2705){_0x1b73a3['body'][_0x6cd4('0x4d')]=_0x6c2705['id'];_0x1b73a3[_0x6cd4('0x47')][_0x6cd4('0x4e')]=integrations[_0x6cd4('0x4f')](_0x1b73a3[_0x6cd4('0x47')][_0x6cd4('0x50')],_0x1b73a3[_0x6cd4('0x47')][_0x6cd4('0x2c')]);_0x1b73a3['body'][_0x6cd4('0x51')]=integrations[_0x6cd4('0x52')](_0x1b73a3['body']['channel'],_0x1b73a3[_0x6cd4('0x47')][_0x6cd4('0x2c')]);return db[_0x6cd4('0x53')][_0x6cd4('0x46')](_0x1b73a3[_0x6cd4('0x47')],{'include':[{'model':db[_0x6cd4('0x54')],'as':_0x6cd4('0x4e')},{'model':db[_0x6cd4('0x54')],'as':_0x6cd4('0x51')}]});}return null;})[_0x6cd4('0x26')](respondWithResult(_0x23ce4d,null))[_0x6cd4('0x41')](handleError(_0x23ce4d,null));};exports[_0x6cd4('0x55')]=function(_0x18e506,_0xf0468f,_0xf49e9a){var _0x5703a4=[{'name':_0x6cd4('0x56'),'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 _0x5139a1='';return db[_0x6cd4('0x2a')][_0x6cd4('0x49')]({'where':{'id':_0x18e506[_0x6cd4('0x43')]['id']},'attributes':['id',_0x6cd4('0x57'),'authType',_0x6cd4('0x58'),_0x6cd4('0x59'),_0x6cd4('0x5a'),_0x6cd4('0x5b'),'token','tokenSecret']})['then'](handleEntityNotFound(_0xf0468f,null))['then'](function(_0x2dd4fa){if(_0x2dd4fa){_0x5139a1=_0x2dd4fa['remoteUri'];var _0x86c70e=_0x5139a1[_0x6cd4('0x5c')](-0x1);if(_0x86c70e==='/'){_0x5139a1=_0x5139a1[_0x6cd4('0x5d')](0x0,_0x5139a1[_0x6cd4('0x5e')](_0x86c70e));}var _0x312617={'method':'GET','uri':util[_0x6cd4('0x5f')](_0x6cd4('0x60'),_0x5139a1),'headers':{'Content-Type':'application/json','Accept':_0x6cd4('0x61')},'json':!![]};if(_0x2dd4fa['authType']===_0x6cd4('0x62')){_0x312617[_0x6cd4('0x63')][_0x6cd4('0x64')]=util[_0x6cd4('0x5f')]('Basic\x20%s',new Buffer(util['format'](_0x6cd4('0x65'),_0x2dd4fa[_0x6cd4('0x58')],_0x2dd4fa[_0x6cd4('0x59')]))[_0x6cd4('0x66')](_0x6cd4('0x67')));}return rp(_0x312617)['then'](function(_0x58cd19){return _0x5703a4['concat'](_[_0x6cd4('0x2f')](_0x58cd19['_embedded'][_0x6cd4('0x68')],function(_0x1585de){return{'id':_0x1585de[_0x6cd4('0x28')],'name':_0x1585de[_0x6cd4('0x28')],'type':_0x1585de[_0x6cd4('0x2c')],'active':_0x1585de[_0x6cd4('0x69')],'label':_0x1585de['label'],'custom':!![]};}));});}})[_0x6cd4('0x26')](function(_0x4ceeba){return{'count':_0x4ceeba[_0x6cd4('0x35')],'rows':_0x4ceeba};})[_0x6cd4('0x26')](respondWithResult(_0xf0468f,null))['catch'](function(_0x18db4d){var _0x504b96=_0x18e506[_0x6cd4('0x31')][_0x6cd4('0x6a')]?0x1f4:_0x18db4d[_0x6cd4('0x6b')]||0x1f4;logger[_0x6cd4('0x6c')](_0x6cd4('0x6d'),_0x6cd4('0x55'),_0x504b96,JSON[_0x6cd4('0x6e')](_0x18db4d));delete _0x18db4d[_0x6cd4('0x28')];if(_0x504b96===0x191){_0x504b96=0x190;}_0xf0468f[_0x6cd4('0x1c')](_0x504b96)[_0x6cd4('0x6f')](_0x18e506[_0x6cd4('0x31')][_0x6cd4('0x6a')]?{'message':_0x6cd4('0x70'),'statusCode':_0x18db4d['statusCode']}:_0x18db4d);});}; \ No newline at end of file +var _0x8a44=['slice','lastIndexOf','%s/custom_fields','application/json','basic','headers','Authorization','format','Basic\x20%s','%s:%s','base64','entries','active','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','sendStatus','error','stack','send','index','map','DeskAccount','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','params','getConfigurations','findOne','DeskConfiguration','AccountId','Subjects','getSubjects','channel','DeskField','Descriptions','getFields','priority','authType','username','password','consumerKey','consumerSecret','token'];(function(_0x2c1979,_0x377d5c){var _0x2adc25=function(_0x457a6a){while(--_0x457a6a){_0x2c1979['push'](_0x2c1979['shift']());}};_0x2adc25(++_0x377d5c);}(_0x8a44,0x1c9));var _0x48a4=function(_0x3ba884,_0x3962c3){_0x3ba884=_0x3ba884-0x0;var _0x9ce539=_0x8a44[_0x3ba884];return _0x9ce539;};'use strict';var emlformat=require(_0x48a4('0x0'));var rimraf=require(_0x48a4('0x1'));var zipdir=require(_0x48a4('0x2'));var jsonpatch=require(_0x48a4('0x3'));var rp=require('request-promise');var moment=require(_0x48a4('0x4'));var BPromise=require(_0x48a4('0x5'));var Mustache=require(_0x48a4('0x6'));var util=require(_0x48a4('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x48a4('0x8'));var fs=require('fs');var fs_extra=require(_0x48a4('0x9'));var _=require(_0x48a4('0xa'));var squel=require(_0x48a4('0xb'));var crypto=require(_0x48a4('0xc'));var jsforce=require(_0x48a4('0xd'));var deskjs=require(_0x48a4('0xe'));var toCsv=require(_0x48a4('0xf'));var querystring=require(_0x48a4('0x10'));var Papa=require('papaparse');var Redis=require(_0x48a4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x48a4('0x12'));var as=require(_0x48a4('0x13'));var hardwareService=require(_0x48a4('0x14'));var logger=require('../../config/logger')(_0x48a4('0x15'));var utils=require(_0x48a4('0x16'));var config=require(_0x48a4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x48a4('0x18'))['db'];var integrations=require(_0x48a4('0x19'));function respondWithStatusCode(_0x5a926f,_0x2a24e3){_0x2a24e3=_0x2a24e3||0xcc;return function(_0x3a2ead){if(_0x3a2ead){return _0x5a926f['sendStatus'](_0x2a24e3);}return _0x5a926f[_0x48a4('0x1a')](_0x2a24e3)[_0x48a4('0x1b')]();};}function respondWithResult(_0x3b153c,_0x48c461){_0x48c461=_0x48c461||0xc8;return function(_0x35ff82){if(_0x35ff82){return _0x3b153c['status'](_0x48c461)[_0x48a4('0x1c')](_0x35ff82);}};}function respondWithFilteredResult(_0x215391,_0xe23ac1){return function(_0x47f47e){if(_0x47f47e){var _0x98602f=typeof _0xe23ac1[_0x48a4('0x1d')]===_0x48a4('0x1e')&&typeof _0xe23ac1[_0x48a4('0x1f')]===_0x48a4('0x1e');var _0x136f70=_0x47f47e[_0x48a4('0x20')];var _0x2a0326=_0x98602f?0x0:_0xe23ac1[_0x48a4('0x1d')];var _0xfb01d7=_0x98602f?_0x47f47e[_0x48a4('0x20')]:_0xe23ac1[_0x48a4('0x1d')]+_0xe23ac1[_0x48a4('0x1f')];var _0x3e9d19;if(_0xfb01d7>=_0x136f70){_0xfb01d7=_0x136f70;_0x3e9d19=0xc8;}else{_0x3e9d19=0xce;}_0x215391['status'](_0x3e9d19);return _0x215391[_0x48a4('0x21')]('Content-Range',_0x2a0326+'-'+_0xfb01d7+'/'+_0x136f70)['json'](_0x47f47e);}return null;};}function patchUpdates(_0x2aa4a2){return function(_0xd92ce5){try{jsonpatch[_0x48a4('0x22')](_0xd92ce5,_0x2aa4a2,!![]);}catch(_0x5015ae){return BPromise['reject'](_0x5015ae);}return _0xd92ce5['save']();};}function saveUpdates(_0x5ba3eb,_0x283ad2){return function(_0x4ffde9){if(_0x4ffde9){return _0x4ffde9[_0x48a4('0x23')](_0x5ba3eb)[_0x48a4('0x24')](function(_0x57f2c9){return _0x57f2c9;});}return null;};}function removeEntity(_0x453e78,_0x4f638c){return function(_0x3ecc9f){if(_0x3ecc9f){return _0x3ecc9f[_0x48a4('0x25')]()[_0x48a4('0x24')](function(){_0x453e78[_0x48a4('0x1a')](0xcc)[_0x48a4('0x1b')]();});}};}function handleEntityNotFound(_0xbc9237,_0x1d2ab7){return function(_0x1069ed){if(!_0x1069ed){_0xbc9237[_0x48a4('0x26')](0x194);}return _0x1069ed;};}function handleError(_0x1dbb30,_0x218c2b){_0x218c2b=_0x218c2b||0x1f4;return function(_0xf49c00){logger[_0x48a4('0x27')](_0xf49c00[_0x48a4('0x28')]);if(_0xf49c00['name']){delete _0xf49c00['name'];}_0x1dbb30['status'](_0x218c2b)[_0x48a4('0x29')](_0xf49c00);};}exports[_0x48a4('0x2a')]=function(_0x47a707,_0x18fc52){var _0x77b41={},_0x340024={},_0x1d0be1={'count':0x0,'rows':[]};var _0x9ff469=_[_0x48a4('0x2b')](db[_0x48a4('0x2c')]['rawAttributes'],function(_0x1e9950){return{'name':_0x1e9950[_0x48a4('0x2d')],'type':_0x1e9950[_0x48a4('0x2e')]['key']};});_0x340024['model']=_[_0x48a4('0x2b')](_0x9ff469,_0x48a4('0x2f'));_0x340024[_0x48a4('0x30')]=_[_0x48a4('0x31')](_0x47a707[_0x48a4('0x30')]);_0x340024[_0x48a4('0x32')]=_[_0x48a4('0x33')](_0x340024[_0x48a4('0x34')],_0x340024[_0x48a4('0x30')]);_0x77b41[_0x48a4('0x35')]=_[_0x48a4('0x33')](_0x340024[_0x48a4('0x34')],qs[_0x48a4('0x36')](_0x47a707[_0x48a4('0x30')]['fields']));_0x77b41[_0x48a4('0x35')]=_0x77b41[_0x48a4('0x35')][_0x48a4('0x37')]?_0x77b41[_0x48a4('0x35')]:_0x340024[_0x48a4('0x34')];if(!_0x47a707[_0x48a4('0x30')][_0x48a4('0x38')](_0x48a4('0x39'))){_0x77b41[_0x48a4('0x1f')]=qs[_0x48a4('0x1f')](_0x47a707['query'][_0x48a4('0x1f')]);_0x77b41[_0x48a4('0x1d')]=qs[_0x48a4('0x1d')](_0x47a707['query'][_0x48a4('0x1d')]);}_0x77b41[_0x48a4('0x3a')]=qs['sort'](_0x47a707[_0x48a4('0x30')][_0x48a4('0x3b')]);_0x77b41['where']=qs[_0x48a4('0x32')](_[_0x48a4('0x3c')](_0x47a707[_0x48a4('0x30')],_0x340024['filters']),_0x9ff469);if(_0x47a707[_0x48a4('0x30')][_0x48a4('0x3d')]){_0x77b41[_0x48a4('0x3e')]=_[_0x48a4('0x3f')](_0x77b41['where'],{'$or':_[_0x48a4('0x2b')](_0x9ff469,function(_0x4491e5){if(_0x4491e5[_0x48a4('0x2e')]!==_0x48a4('0x40')){var _0x68d6ef={};_0x68d6ef[_0x4491e5[_0x48a4('0x2f')]]={'$like':'%'+_0x47a707[_0x48a4('0x30')][_0x48a4('0x3d')]+'%'};return _0x68d6ef;}})});}_0x77b41=_[_0x48a4('0x3f')]({},_0x77b41,_0x47a707[_0x48a4('0x41')]);var _0x26926d={'where':_0x77b41[_0x48a4('0x3e')]};return db[_0x48a4('0x2c')]['count'](_0x26926d)[_0x48a4('0x24')](function(_0x57c982){_0x1d0be1[_0x48a4('0x20')]=_0x57c982;if(_0x47a707['query'][_0x48a4('0x42')]){_0x77b41[_0x48a4('0x43')]=[{'all':!![]}];}return db['DeskAccount'][_0x48a4('0x44')](_0x77b41);})[_0x48a4('0x24')](function(_0x18ee14){_0x1d0be1['rows']=_0x18ee14;return _0x1d0be1;})[_0x48a4('0x24')](respondWithFilteredResult(_0x18fc52,_0x77b41))[_0x48a4('0x45')](handleError(_0x18fc52,null));};exports[_0x48a4('0x46')]=function(_0x385be2,_0x408faf){var _0x329ef6={'raw':![],'where':{'id':_0x385be2['params']['id']}},_0x189de0={};_0x189de0[_0x48a4('0x34')]=_[_0x48a4('0x31')](db[_0x48a4('0x2c')][_0x48a4('0x47')]);_0x189de0[_0x48a4('0x30')]=_[_0x48a4('0x31')](_0x385be2[_0x48a4('0x30')]);_0x189de0[_0x48a4('0x32')]=_[_0x48a4('0x33')](_0x189de0['model'],_0x189de0[_0x48a4('0x30')]);_0x329ef6['attributes']=_[_0x48a4('0x33')](_0x189de0[_0x48a4('0x34')],qs[_0x48a4('0x36')](_0x385be2[_0x48a4('0x30')][_0x48a4('0x36')]));_0x329ef6['attributes']=_0x329ef6[_0x48a4('0x35')]['length']?_0x329ef6[_0x48a4('0x35')]:_0x189de0[_0x48a4('0x34')];if(_0x385be2[_0x48a4('0x30')]['includeAll']){_0x329ef6[_0x48a4('0x43')]=[{'all':!![]}];}_0x329ef6=_[_0x48a4('0x3f')]({},_0x329ef6,_0x385be2['options']);return db['DeskAccount'][_0x48a4('0x48')](_0x329ef6)[_0x48a4('0x24')](handleEntityNotFound(_0x408faf,null))[_0x48a4('0x24')](respondWithResult(_0x408faf,null))[_0x48a4('0x45')](handleError(_0x408faf,null));};exports['create']=function(_0x11e47e,_0x171670){return db[_0x48a4('0x2c')][_0x48a4('0x49')](_0x11e47e[_0x48a4('0x4a')],{})[_0x48a4('0x24')](respondWithResult(_0x171670,0xc9))['catch'](handleError(_0x171670,null));};exports[_0x48a4('0x23')]=function(_0x2a86b1,_0x47556f){if(_0x2a86b1[_0x48a4('0x4a')]['id']){delete _0x2a86b1[_0x48a4('0x4a')]['id'];}return db['DeskAccount'][_0x48a4('0x48')]({'where':{'id':_0x2a86b1[_0x48a4('0x4b')]['id']}})[_0x48a4('0x24')](handleEntityNotFound(_0x47556f,null))[_0x48a4('0x24')](saveUpdates(_0x2a86b1[_0x48a4('0x4a')],null))[_0x48a4('0x24')](respondWithResult(_0x47556f,null))[_0x48a4('0x45')](handleError(_0x47556f,null));};exports[_0x48a4('0x25')]=function(_0x55ae0b,_0x3a18db){return db['DeskAccount']['find']({'where':{'id':_0x55ae0b[_0x48a4('0x4b')]['id']}})[_0x48a4('0x24')](handleEntityNotFound(_0x3a18db,null))[_0x48a4('0x24')](removeEntity(_0x3a18db,null))[_0x48a4('0x45')](handleError(_0x3a18db,null));};exports[_0x48a4('0x4c')]=function(_0x588d0c,_0x13f7cf,_0x3dd9f1){var _0x1c46d2={};var _0x58eef6={};var _0x4bd4b3;var _0x1c6a80;return db[_0x48a4('0x2c')][_0x48a4('0x4d')]({'where':{'id':_0x588d0c[_0x48a4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x13f7cf,null))[_0x48a4('0x24')](function(_0x41931c){if(_0x41931c){_0x4bd4b3=_0x41931c;_0x58eef6['model']=_[_0x48a4('0x31')](db[_0x48a4('0x4e')][_0x48a4('0x47')]);_0x58eef6[_0x48a4('0x30')]=_[_0x48a4('0x31')](_0x588d0c[_0x48a4('0x30')]);_0x58eef6['filters']=_[_0x48a4('0x33')](_0x58eef6['model'],_0x58eef6[_0x48a4('0x30')]);_0x1c46d2['attributes']=_[_0x48a4('0x33')](_0x58eef6[_0x48a4('0x34')],qs[_0x48a4('0x36')](_0x588d0c[_0x48a4('0x30')][_0x48a4('0x36')]));_0x1c46d2[_0x48a4('0x35')]=_0x1c46d2[_0x48a4('0x35')]['length']?_0x1c46d2[_0x48a4('0x35')]:_0x58eef6['model'];_0x1c46d2[_0x48a4('0x3a')]=qs['sort'](_0x588d0c[_0x48a4('0x30')]['sort']);_0x1c46d2['where']=qs[_0x48a4('0x32')](_['pick'](_0x588d0c[_0x48a4('0x30')],_0x58eef6['filters']));if(_0x588d0c['query'][_0x48a4('0x3d')]){_0x1c46d2[_0x48a4('0x3e')]=_['merge'](_0x1c46d2['where'],{'$or':_[_0x48a4('0x2b')](_0x1c46d2['attributes'],function(_0x62a010){var _0x19eb96={};_0x19eb96[_0x62a010]={'$like':'%'+_0x588d0c[_0x48a4('0x30')][_0x48a4('0x3d')]+'%'};return _0x19eb96;})});}_0x1c46d2=_[_0x48a4('0x3f')]({},_0x1c46d2,_0x588d0c['options']);return _0x4bd4b3[_0x48a4('0x4c')](_0x1c46d2);}})[_0x48a4('0x24')](function(_0x579b11){if(_0x579b11){_0x1c6a80=_0x579b11[_0x48a4('0x37')];if(!_0x588d0c[_0x48a4('0x30')][_0x48a4('0x38')](_0x48a4('0x39'))){_0x1c46d2[_0x48a4('0x1f')]=qs[_0x48a4('0x1f')](_0x588d0c[_0x48a4('0x30')][_0x48a4('0x1f')]);_0x1c46d2[_0x48a4('0x1d')]=qs['offset'](_0x588d0c[_0x48a4('0x30')][_0x48a4('0x1d')]);}return _0x4bd4b3[_0x48a4('0x4c')](_0x1c46d2);}})[_0x48a4('0x24')](function(_0x56a898){if(_0x56a898){return _0x56a898?{'count':_0x1c6a80,'rows':_0x56a898}:null;}})[_0x48a4('0x24')](respondWithResult(_0x13f7cf,null))[_0x48a4('0x45')](handleError(_0x13f7cf,null));};exports['addConfiguration']=function(_0xb2e1d1,_0x4e2975,_0x2e35bd){if(_0xb2e1d1['body']['id']){delete _0xb2e1d1[_0x48a4('0x4a')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0xb2e1d1[_0x48a4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4e2975,null))[_0x48a4('0x24')](function(_0x34f95f){if(_0x34f95f){_0xb2e1d1[_0x48a4('0x4a')][_0x48a4('0x4f')]=_0x34f95f['id'];_0xb2e1d1[_0x48a4('0x4a')][_0x48a4('0x50')]=integrations[_0x48a4('0x51')](_0xb2e1d1[_0x48a4('0x4a')][_0x48a4('0x52')],_0xb2e1d1['body']['type']);_0xb2e1d1[_0x48a4('0x4a')]['Descriptions']=integrations['getDescriptions'](_0xb2e1d1[_0x48a4('0x4a')][_0x48a4('0x52')],_0xb2e1d1['body'][_0x48a4('0x2e')]);return db[_0x48a4('0x4e')]['create'](_0xb2e1d1[_0x48a4('0x4a')],{'include':[{'model':db[_0x48a4('0x53')],'as':_0x48a4('0x50')},{'model':db[_0x48a4('0x53')],'as':_0x48a4('0x54')}]});}return null;})[_0x48a4('0x24')](respondWithResult(_0x4e2975,null))[_0x48a4('0x45')](handleError(_0x4e2975,null));};exports[_0x48a4('0x55')]=function(_0x4a8c74,_0x564f1c,_0x262226){var _0x2befa0=[{'name':'priority','label':_0x48a4('0x56'),'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 _0x58e981='';return db['DeskAccount']['findOne']({'where':{'id':_0x4a8c74['params']['id']},'attributes':['id','remoteUri',_0x48a4('0x57'),_0x48a4('0x58'),_0x48a4('0x59'),_0x48a4('0x5a'),_0x48a4('0x5b'),_0x48a4('0x5c'),'tokenSecret']})['then'](handleEntityNotFound(_0x564f1c,null))[_0x48a4('0x24')](function(_0x494574){if(_0x494574){_0x58e981=_0x494574['remoteUri'];var _0x40b489=_0x58e981[_0x48a4('0x5d')](-0x1);if(_0x40b489==='/'){_0x58e981=_0x58e981['substring'](0x0,_0x58e981[_0x48a4('0x5e')](_0x40b489));}var _0x11f3e4={'method':'GET','uri':util['format'](_0x48a4('0x5f'),_0x58e981),'headers':{'Content-Type':_0x48a4('0x60'),'Accept':_0x48a4('0x60')},'json':!![]};if(_0x494574[_0x48a4('0x57')]===_0x48a4('0x61')){_0x11f3e4[_0x48a4('0x62')][_0x48a4('0x63')]=util[_0x48a4('0x64')](_0x48a4('0x65'),new Buffer(util[_0x48a4('0x64')](_0x48a4('0x66'),_0x494574[_0x48a4('0x58')],_0x494574[_0x48a4('0x59')]))['toString'](_0x48a4('0x67')));}return rp(_0x11f3e4)[_0x48a4('0x24')](function(_0x33ac84){return _0x2befa0['concat'](_['map'](_0x33ac84['_embedded'][_0x48a4('0x68')],function(_0x5df1bf){return{'id':_0x5df1bf[_0x48a4('0x2f')],'name':_0x5df1bf[_0x48a4('0x2f')],'type':_0x5df1bf[_0x48a4('0x2e')],'active':_0x5df1bf[_0x48a4('0x69')],'label':_0x5df1bf['label'],'custom':!![]};}));});}})[_0x48a4('0x24')](function(_0x3344b0){return{'count':_0x3344b0['length'],'rows':_0x3344b0};})[_0x48a4('0x24')](respondWithResult(_0x564f1c,null))[_0x48a4('0x45')](function(_0xf3eb88){var _0x50c5b3=_0x4a8c74[_0x48a4('0x30')]['test']?0x1f4:_0xf3eb88['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x48a4('0x55'),_0x50c5b3,JSON[_0x48a4('0x6a')](_0xf3eb88));delete _0xf3eb88[_0x48a4('0x2f')];if(_0x50c5b3===0x191){_0x50c5b3=0x190;}_0x564f1c[_0x48a4('0x1a')](_0x50c5b3)[_0x48a4('0x29')](_0x4a8c74[_0x48a4('0x30')][_0x48a4('0x6b')]?{'message':_0x48a4('0x6c'),'statusCode':_0xf3eb88[_0x48a4('0x6d')]}:_0xf3eb88);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 3187593..f19052a 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 _0x195f=['rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','int_desk_accounts','lodash','util','api','bluebird','request-promise','path'];(function(_0x1e97a5,_0x37a2e9){var _0x42915d=function(_0x63f93b){while(--_0x63f93b){_0x1e97a5['push'](_0x1e97a5['shift']());}};_0x42915d(++_0x37a2e9);}(_0x195f,0x14a));var _0xf195=function(_0xf58718,_0x33541a){_0xf58718=_0xf58718-0x0;var _0x5aea10=_0x195f[_0xf58718];return _0x5aea10;};'use strict';var _=require(_0xf195('0x0'));var util=require(_0xf195('0x1'));var logger=require('../../config/logger')(_0xf195('0x2'));var moment=require('moment');var BPromise=require(_0xf195('0x3'));var rp=require(_0xf195('0x4'));var fs=require('fs');var path=require(_0xf195('0x5'));var rimraf=require(_0xf195('0x6'));var config=require(_0xf195('0x7'));var attributes=require(_0xf195('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xf195('0x9')]=function(_0x3170c8,_0x644f31){return _0x3170c8[_0xf195('0xa')]('DeskAccount',attributes,{'tableName':_0xf195('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe02=['moment','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','util','../../config/logger'];(function(_0x2452a5,_0x8208fa){var _0x21871e=function(_0x52d272){while(--_0x52d272){_0x2452a5['push'](_0x2452a5['shift']());}};_0x21871e(++_0x8208fa);}(_0xfe02,0xda));var _0x2fe0=function(_0x26042e,_0x4338d7){_0x26042e=_0x26042e-0x0;var _0x16e92f=_0xfe02[_0x26042e];return _0x16e92f;};'use strict';var _=require('lodash');var util=require(_0x2fe0('0x0'));var logger=require(_0x2fe0('0x1'))('api');var moment=require(_0x2fe0('0x2'));var BPromise=require('bluebird');var rp=require(_0x2fe0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2fe0('0x4'));var config=require(_0x2fe0('0x5'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x2fe0('0x6'));module['exports']=function(_0x569d23,_0x4ae672){return _0x569d23[_0x2fe0('0x7')](_0x2fe0('0x8'),attributes,{'tableName':_0x2fe0('0x9'),'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 100d659..fc64d22 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 _0xd834=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetDeskAccount','options','where','limit','include','map','model','then','ShowDeskAccount','DeskAccount','find','raw','attributes','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2c4eb4,_0x40bdaf){var _0x32772a=function(_0x2b1b60){while(--_0x2b1b60){_0x2c4eb4['push'](_0x2c4eb4['shift']());}};_0x32772a(++_0x40bdaf);}(_0xd834,0x12a));var _0x4d83=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xd834[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x4d83('0x0'));var util=require(_0x4d83('0x1'));var moment=require(_0x4d83('0x2'));var BPromise=require(_0x4d83('0x3'));var rs=require(_0x4d83('0x4'));var fs=require('fs');var Redis=require(_0x4d83('0x5'));var db=require(_0x4d83('0x6'))['db'];var utils=require(_0x4d83('0x7'));var logger=require(_0x4d83('0x8'))(_0x4d83('0x9'));var config=require(_0x4d83('0xa'));var jayson=require(_0x4d83('0xb'));var client=jayson[_0x4d83('0xc')][_0x4d83('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x11a0c3,_0x24912c,_0x1613fd){return new BPromise(function(_0x39d227,_0x2b34d9){return client[_0x4d83('0xe')](_0x11a0c3,_0x1613fd)['then'](function(_0x359abe){logger[_0x4d83('0xf')](_0x4d83('0x10'),_0x24912c,_0x4d83('0x11'));logger[_0x4d83('0x12')](_0x4d83('0x13'),_0x24912c,'request\x20sent',JSON[_0x4d83('0x14')](_0x359abe));if(_0x359abe['error']){if(_0x359abe[_0x4d83('0x15')][_0x4d83('0x16')]===0x1f4){logger[_0x4d83('0x15')]('DeskAccount,\x20%s,\x20%s',_0x24912c,_0x359abe[_0x4d83('0x15')]['message']);return _0x2b34d9(_0x359abe['error'][_0x4d83('0x17')]);}logger[_0x4d83('0x15')](_0x4d83('0x10'),_0x24912c,_0x359abe[_0x4d83('0x15')][_0x4d83('0x17')]);return _0x39d227(_0x359abe[_0x4d83('0x15')][_0x4d83('0x17')]);}else{logger[_0x4d83('0xf')](_0x4d83('0x10'),_0x24912c,_0x4d83('0x11'));_0x39d227(_0x359abe[_0x4d83('0x18')][_0x4d83('0x17')]);}})['catch'](function(_0x328131){logger['error'](_0x4d83('0x10'),_0x24912c,_0x328131);_0x2b34d9(_0x328131);});});}exports[_0x4d83('0x19')]=function(_0x3a1e34){var _0x342f07=this;return new Promise(function(_0x42d714,_0x55d6c1){return db['DeskAccount']['findAll']({'raw':_0x3a1e34[_0x4d83('0x1a')]?_0x3a1e34[_0x4d83('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3a1e34[_0x4d83('0x1a')]?_0x3a1e34[_0x4d83('0x1a')][_0x4d83('0x1b')]||null:null,'attributes':_0x3a1e34[_0x4d83('0x1a')]?_0x3a1e34[_0x4d83('0x1a')]['attributes']||null:null,'limit':_0x3a1e34['options']?_0x3a1e34[_0x4d83('0x1a')][_0x4d83('0x1c')]||null:null,'include':_0x3a1e34[_0x4d83('0x1a')]?_0x3a1e34['options'][_0x4d83('0x1d')]?_[_0x4d83('0x1e')](_0x3a1e34[_0x4d83('0x1a')]['include'],function(_0xae1175){return{'model':db[_0xae1175[_0x4d83('0x1f')]],'as':_0xae1175['as'],'attributes':_0xae1175['attributes'],'include':_0xae1175[_0x4d83('0x1d')]?_['map'](_0xae1175['include'],function(_0x7eeb92){return{'model':db[_0x7eeb92[_0x4d83('0x1f')]],'as':_0x7eeb92['as'],'attributes':_0x7eeb92['attributes'],'include':_0x7eeb92['include']?_[_0x4d83('0x1e')](_0x7eeb92['include'],function(_0x34ae87){return{'model':db[_0x34ae87[_0x4d83('0x1f')]],'as':_0x34ae87['as'],'attributes':_0x34ae87['attributes']};}):[]};}):[]};}):[]:[]})[_0x4d83('0x20')](function(_0x3ba0f0){logger[_0x4d83('0xf')](_0x4d83('0x19'),_0x3a1e34);logger['debug'](_0x4d83('0x19'),_0x3a1e34,JSON['stringify'](_0x3ba0f0));_0x42d714(_0x3ba0f0);})['catch'](function(_0x57fc36){logger[_0x4d83('0x15')](_0x4d83('0x19'),_0x57fc36['message'],_0x3a1e34);_0x55d6c1(_0x342f07[_0x4d83('0x15')](0x1f4,_0x57fc36[_0x4d83('0x17')]));});});};exports[_0x4d83('0x21')]=function(_0x2fbd00){var _0x21a0eb=this;return new Promise(function(_0x402a2f,_0x32c467){return db[_0x4d83('0x22')][_0x4d83('0x23')]({'raw':_0x2fbd00[_0x4d83('0x1a')]?_0x2fbd00[_0x4d83('0x1a')][_0x4d83('0x24')]===undefined?!![]:![]:!![],'where':_0x2fbd00['options']?_0x2fbd00[_0x4d83('0x1a')][_0x4d83('0x1b')]||null:null,'attributes':_0x2fbd00[_0x4d83('0x1a')]?_0x2fbd00[_0x4d83('0x1a')][_0x4d83('0x25')]||null:null,'include':_0x2fbd00['options']?_0x2fbd00[_0x4d83('0x1a')][_0x4d83('0x1d')]?_[_0x4d83('0x1e')](_0x2fbd00[_0x4d83('0x1a')][_0x4d83('0x1d')],function(_0x408335){return{'model':db[_0x408335['model']],'as':_0x408335['as'],'attributes':_0x408335[_0x4d83('0x25')],'include':_0x408335[_0x4d83('0x1d')]?_['map'](_0x408335[_0x4d83('0x1d')],function(_0x235fd3){return{'model':db[_0x235fd3[_0x4d83('0x1f')]],'as':_0x235fd3['as'],'attributes':_0x235fd3[_0x4d83('0x25')],'include':_0x235fd3[_0x4d83('0x1d')]?_[_0x4d83('0x1e')](_0x235fd3[_0x4d83('0x1d')],function(_0x404048){return{'model':db[_0x404048['model']],'as':_0x404048['as'],'attributes':_0x404048['attributes']};}):[]};}):[]};}):[]:[]})[_0x4d83('0x20')](function(_0x26ebad){logger['info'](_0x4d83('0x21'),_0x2fbd00);logger[_0x4d83('0x12')](_0x4d83('0x21'),_0x2fbd00,JSON['stringify'](_0x26ebad));_0x402a2f(_0x26ebad);})['catch'](function(_0x1bf014){logger[_0x4d83('0x15')](_0x4d83('0x21'),_0x1bf014[_0x4d83('0x17')],_0x2fbd00);_0x32c467(_0x21a0eb[_0x4d83('0x15')](0x1f4,_0x1bf014[_0x4d83('0x17')]));});});}; \ No newline at end of file +var _0x0118=['map','model','ShowDeskAccount','DeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetDeskAccount','options','raw','where','attributes','limit','include'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x0118,0x107));var _0x8011=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0118[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8011('0x0'));var util=require(_0x8011('0x1'));var moment=require('moment');var BPromise=require(_0x8011('0x2'));var rs=require(_0x8011('0x3'));var fs=require('fs');var Redis=require(_0x8011('0x4'));var db=require(_0x8011('0x5'))['db'];var utils=require(_0x8011('0x6'));var logger=require(_0x8011('0x7'))(_0x8011('0x8'));var config=require(_0x8011('0x9'));var jayson=require(_0x8011('0xa'));var client=jayson[_0x8011('0xb')][_0x8011('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x265ea7,_0x486552,_0x50cccb){return new BPromise(function(_0x698115,_0x121187){return client[_0x8011('0xd')](_0x265ea7,_0x50cccb)[_0x8011('0xe')](function(_0x34a8de){logger['info'](_0x8011('0xf'),_0x486552,_0x8011('0x10'));logger[_0x8011('0x11')](_0x8011('0x12'),_0x486552,'request\x20sent',JSON[_0x8011('0x13')](_0x34a8de));if(_0x34a8de[_0x8011('0x14')]){if(_0x34a8de[_0x8011('0x14')][_0x8011('0x15')]===0x1f4){logger[_0x8011('0x14')](_0x8011('0xf'),_0x486552,_0x34a8de['error'][_0x8011('0x16')]);return _0x121187(_0x34a8de[_0x8011('0x14')][_0x8011('0x16')]);}logger[_0x8011('0x14')](_0x8011('0xf'),_0x486552,_0x34a8de[_0x8011('0x14')][_0x8011('0x16')]);return _0x698115(_0x34a8de[_0x8011('0x14')][_0x8011('0x16')]);}else{logger[_0x8011('0x17')](_0x8011('0xf'),_0x486552,'request\x20sent');_0x698115(_0x34a8de[_0x8011('0x18')][_0x8011('0x16')]);}})[_0x8011('0x19')](function(_0x357bb1){logger['error'](_0x8011('0xf'),_0x486552,_0x357bb1);_0x121187(_0x357bb1);});});}exports[_0x8011('0x1a')]=function(_0x599afb){var _0x167562=this;return new Promise(function(_0x59cb97,_0x73644e){return db['DeskAccount']['findAll']({'raw':_0x599afb[_0x8011('0x1b')]?_0x599afb[_0x8011('0x1b')][_0x8011('0x1c')]===undefined?!![]:![]:!![],'where':_0x599afb['options']?_0x599afb[_0x8011('0x1b')][_0x8011('0x1d')]||null:null,'attributes':_0x599afb[_0x8011('0x1b')]?_0x599afb[_0x8011('0x1b')][_0x8011('0x1e')]||null:null,'limit':_0x599afb[_0x8011('0x1b')]?_0x599afb[_0x8011('0x1b')][_0x8011('0x1f')]||null:null,'include':_0x599afb[_0x8011('0x1b')]?_0x599afb[_0x8011('0x1b')][_0x8011('0x20')]?_[_0x8011('0x21')](_0x599afb['options'][_0x8011('0x20')],function(_0x2a11a6){return{'model':db[_0x2a11a6[_0x8011('0x22')]],'as':_0x2a11a6['as'],'attributes':_0x2a11a6[_0x8011('0x1e')],'include':_0x2a11a6[_0x8011('0x20')]?_[_0x8011('0x21')](_0x2a11a6[_0x8011('0x20')],function(_0x565509){return{'model':db[_0x565509[_0x8011('0x22')]],'as':_0x565509['as'],'attributes':_0x565509['attributes'],'include':_0x565509[_0x8011('0x20')]?_[_0x8011('0x21')](_0x565509['include'],function(_0x36fbac){return{'model':db[_0x36fbac[_0x8011('0x22')]],'as':_0x36fbac['as'],'attributes':_0x36fbac[_0x8011('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8011('0xe')](function(_0x5d054b){logger[_0x8011('0x17')](_0x8011('0x1a'),_0x599afb);logger[_0x8011('0x11')]('GetDeskAccount',_0x599afb,JSON['stringify'](_0x5d054b));_0x59cb97(_0x5d054b);})[_0x8011('0x19')](function(_0x5b344c){logger[_0x8011('0x14')](_0x8011('0x1a'),_0x5b344c[_0x8011('0x16')],_0x599afb);_0x73644e(_0x167562[_0x8011('0x14')](0x1f4,_0x5b344c[_0x8011('0x16')]));});});};exports[_0x8011('0x23')]=function(_0x5d3d8d){var _0x3f4835=this;return new Promise(function(_0x5d2ee5,_0x5f18cc){return db[_0x8011('0x24')]['find']({'raw':_0x5d3d8d['options']?_0x5d3d8d[_0x8011('0x1b')][_0x8011('0x1c')]===undefined?!![]:![]:!![],'where':_0x5d3d8d[_0x8011('0x1b')]?_0x5d3d8d[_0x8011('0x1b')][_0x8011('0x1d')]||null:null,'attributes':_0x5d3d8d[_0x8011('0x1b')]?_0x5d3d8d[_0x8011('0x1b')][_0x8011('0x1e')]||null:null,'include':_0x5d3d8d[_0x8011('0x1b')]?_0x5d3d8d[_0x8011('0x1b')]['include']?_['map'](_0x5d3d8d[_0x8011('0x1b')][_0x8011('0x20')],function(_0x4385ae){return{'model':db[_0x4385ae[_0x8011('0x22')]],'as':_0x4385ae['as'],'attributes':_0x4385ae[_0x8011('0x1e')],'include':_0x4385ae[_0x8011('0x20')]?_[_0x8011('0x21')](_0x4385ae[_0x8011('0x20')],function(_0x59b167){return{'model':db[_0x59b167[_0x8011('0x22')]],'as':_0x59b167['as'],'attributes':_0x59b167[_0x8011('0x1e')],'include':_0x59b167[_0x8011('0x20')]?_['map'](_0x59b167['include'],function(_0x1ed588){return{'model':db[_0x1ed588[_0x8011('0x22')]],'as':_0x1ed588['as'],'attributes':_0x1ed588['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3344b4){logger[_0x8011('0x17')]('ShowDeskAccount',_0x5d3d8d);logger[_0x8011('0x11')]('ShowDeskAccount',_0x5d3d8d,JSON[_0x8011('0x13')](_0x3344b4));_0x5d2ee5(_0x3344b4);})[_0x8011('0x19')](function(_0x803cb0){logger[_0x8011('0x14')]('ShowDeskAccount',_0x803cb0['message'],_0x5d3d8d);_0x5f18cc(_0x3f4835['error'](0x1f4,_0x803cb0[_0x8011('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 043a185..d0ecfb0 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 _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(_0x5e07ac,_0x35b19f){var _0x5ab4e5=function(_0x2c20fc){while(--_0x2c20fc){_0x5e07ac['push'](_0x5e07ac['shift']());}};_0x5ab4e5(++_0x35b19f);}(_0xedd9,0xfc));var _0x9edd=function(_0x4c9472,_0x2a6a24){_0x4c9472=_0x4c9472-0x0;var _0x29e182=_0xedd9[_0x4c9472];return _0x29e182;};'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 +var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0xfc56,_0x4edee9){var _0x23065b=function(_0x5c860a){while(--_0x5c860a){_0xfc56['push'](_0xfc56['shift']());}};_0x23065b(++_0x4edee9);}(_0x3e74,0x175));var _0x43e7=function(_0x2f01a1,_0x1a9530){_0x2f01a1=_0x2f01a1-0x0;var _0x271858=_0x3e74[_0x2f01a1];return _0x271858;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index faae822..42f4fe2 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 _0x07e0=['STRING','sequelize','exports'];(function(_0x4df17c,_0x2d2b61){var _0x4e79b5=function(_0x2134a5){while(--_0x2134a5){_0x4df17c['push'](_0x4df17c['shift']());}};_0x4e79b5(++_0x2d2b61);}(_0x07e0,0x112));var _0x007e=function(_0x18f27e,_0x4cee11){_0x18f27e=_0x18f27e-0x0;var _0x59a719=_0x07e0[_0x18f27e];return _0x59a719;};'use strict';var Sequelize=require(_0x007e('0x0'));module[_0x007e('0x1')]={'name':{'type':Sequelize[_0x007e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x03fa=['exports','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x03fa,0xe2));var _0xa03f=function(_0x5b3d5b,_0xde6e2b){_0x5b3d5b=_0x5b3d5b-0x0;var _0x2366d6=_0x03fa[_0x5b3d5b];return _0x2366d6;};'use strict';var Sequelize=require('sequelize');module[_0xa03f('0x0')]={'name':{'type':Sequelize[_0xa03f('0x1')]},'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 0ae8e5b..d8c887d 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 _0xc6b6=['options','then','include','findAll','catch','show','keys','fields','includeAll','find','body','update','params','findOne','DeskField','getFields','getSubjects','getDescriptions','hasOwnProperty','getTags','Tag','setTags','ids','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','save','destroy','sendStatus','error','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x52d5e2,_0x4e79a6){var _0x429b76=function(_0x490c66){while(--_0x490c66){_0x52d5e2['push'](_0x52d5e2['shift']());}};_0x429b76(++_0x4e79a6);}(_0xc6b6,0xbd));var _0x6c6b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc6b6[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x6c6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6c6b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c6b('0x2'));var moment=require(_0x6c6b('0x3'));var BPromise=require(_0x6c6b('0x4'));var Mustache=require(_0x6c6b('0x5'));var util=require('util');var path=require(_0x6c6b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c6b('0x7'));var _=require(_0x6c6b('0x8'));var squel=require(_0x6c6b('0x9'));var crypto=require('crypto');var jsforce=require(_0x6c6b('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6c6b('0xb'));var querystring=require(_0x6c6b('0xc'));var Papa=require(_0x6c6b('0xd'));var Redis=require(_0x6c6b('0xe'));var authService=require(_0x6c6b('0xf'));var qs=require(_0x6c6b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6c6b('0x11'))(_0x6c6b('0x12'));var utils=require(_0x6c6b('0x13'));var config=require(_0x6c6b('0x14'));var licenseUtil=require(_0x6c6b('0x15'));var db=require(_0x6c6b('0x16'))['db'];function respondWithStatusCode(_0x71812a,_0x2b2831){_0x2b2831=_0x2b2831||0xcc;return function(_0x1e9b24){if(_0x1e9b24){return _0x71812a['sendStatus'](_0x2b2831);}return _0x71812a[_0x6c6b('0x17')](_0x2b2831)[_0x6c6b('0x18')]();};}function respondWithResult(_0x2aedfd,_0x13d451){_0x13d451=_0x13d451||0xc8;return function(_0x274207){if(_0x274207){return _0x2aedfd[_0x6c6b('0x17')](_0x13d451)['json'](_0x274207);}};}function respondWithFilteredResult(_0x2e77b2,_0x370e2c){return function(_0x2eb6fc){if(_0x2eb6fc){var _0x4c8072=typeof _0x370e2c[_0x6c6b('0x19')]===_0x6c6b('0x1a')&&typeof _0x370e2c['limit']==='undefined';var _0x2f6dc8=_0x2eb6fc[_0x6c6b('0x1b')];var _0x3d98cd=_0x4c8072?0x0:_0x370e2c[_0x6c6b('0x19')];var _0x12dc31=_0x4c8072?_0x2eb6fc[_0x6c6b('0x1b')]:_0x370e2c[_0x6c6b('0x19')]+_0x370e2c[_0x6c6b('0x1c')];var _0x31fe35;if(_0x12dc31>=_0x2f6dc8){_0x12dc31=_0x2f6dc8;_0x31fe35=0xc8;}else{_0x31fe35=0xce;}_0x2e77b2[_0x6c6b('0x17')](_0x31fe35);return _0x2e77b2[_0x6c6b('0x1d')]('Content-Range',_0x3d98cd+'-'+_0x12dc31+'/'+_0x2f6dc8)[_0x6c6b('0x1e')](_0x2eb6fc);}return null;};}function patchUpdates(_0x59cf04){return function(_0x5e1a14){try{jsonpatch[_0x6c6b('0x1f')](_0x5e1a14,_0x59cf04,!![]);}catch(_0x18ee4b){return BPromise[_0x6c6b('0x20')](_0x18ee4b);}return _0x5e1a14[_0x6c6b('0x21')]();};}function saveUpdates(_0x527d88,_0x2854fe){return function(_0x2a121e){if(_0x2a121e){return _0x2a121e['update'](_0x527d88)['then'](function(_0x33e89b){return _0x33e89b;});}return null;};}function removeEntity(_0x657291,_0x2ef949){return function(_0xcd04c){if(_0xcd04c){return _0xcd04c[_0x6c6b('0x22')]()['then'](function(){_0x657291['status'](0xcc)[_0x6c6b('0x18')]();});}};}function handleEntityNotFound(_0x4680ed,_0x9c31fe){return function(_0x5b1b3a){if(!_0x5b1b3a){_0x4680ed[_0x6c6b('0x23')](0x194);}return _0x5b1b3a;};}function handleError(_0x336f4d,_0x2debe1){_0x2debe1=_0x2debe1||0x1f4;return function(_0x4bf65c){logger[_0x6c6b('0x24')](_0x4bf65c[_0x6c6b('0x25')]);if(_0x4bf65c[_0x6c6b('0x26')]){delete _0x4bf65c[_0x6c6b('0x26')];}_0x336f4d[_0x6c6b('0x17')](_0x2debe1)['send'](_0x4bf65c);};}exports[_0x6c6b('0x27')]=function(_0x46d1cb,_0x2c831a){var _0x5bfd9b={},_0x5fcce5={},_0x17fbd3={'count':0x0,'rows':[]};var _0x2d02df=_[_0x6c6b('0x28')](db[_0x6c6b('0x29')][_0x6c6b('0x2a')],function(_0x499fd3){return{'name':_0x499fd3[_0x6c6b('0x2b')],'type':_0x499fd3[_0x6c6b('0x2c')][_0x6c6b('0x2d')]};});_0x5fcce5[_0x6c6b('0x2e')]=_['map'](_0x2d02df,_0x6c6b('0x26'));_0x5fcce5[_0x6c6b('0x2f')]=_['keys'](_0x46d1cb[_0x6c6b('0x2f')]);_0x5fcce5[_0x6c6b('0x30')]=_[_0x6c6b('0x31')](_0x5fcce5[_0x6c6b('0x2e')],_0x5fcce5[_0x6c6b('0x2f')]);_0x5bfd9b[_0x6c6b('0x32')]=_[_0x6c6b('0x31')](_0x5fcce5['model'],qs['fields'](_0x46d1cb['query']['fields']));_0x5bfd9b['attributes']=_0x5bfd9b[_0x6c6b('0x32')][_0x6c6b('0x33')]?_0x5bfd9b[_0x6c6b('0x32')]:_0x5fcce5[_0x6c6b('0x2e')];if(!_0x46d1cb[_0x6c6b('0x2f')]['hasOwnProperty'](_0x6c6b('0x34'))){_0x5bfd9b['limit']=qs[_0x6c6b('0x1c')](_0x46d1cb[_0x6c6b('0x2f')][_0x6c6b('0x1c')]);_0x5bfd9b[_0x6c6b('0x19')]=qs[_0x6c6b('0x19')](_0x46d1cb[_0x6c6b('0x2f')]['offset']);}_0x5bfd9b[_0x6c6b('0x35')]=qs[_0x6c6b('0x36')](_0x46d1cb[_0x6c6b('0x2f')][_0x6c6b('0x36')]);_0x5bfd9b[_0x6c6b('0x37')]=qs[_0x6c6b('0x30')](_[_0x6c6b('0x38')](_0x46d1cb[_0x6c6b('0x2f')],_0x5fcce5['filters']),_0x2d02df);if(_0x46d1cb[_0x6c6b('0x2f')][_0x6c6b('0x39')]){_0x5bfd9b['where']=_['merge'](_0x5bfd9b['where'],{'$or':_['map'](_0x2d02df,function(_0x77d781){if(_0x77d781['type']!==_0x6c6b('0x3a')){var _0x46ced8={};_0x46ced8[_0x77d781[_0x6c6b('0x26')]]={'$like':'%'+_0x46d1cb[_0x6c6b('0x2f')][_0x6c6b('0x39')]+'%'};return _0x46ced8;}})});}_0x5bfd9b=_[_0x6c6b('0x3b')]({},_0x5bfd9b,_0x46d1cb[_0x6c6b('0x3c')]);var _0x3145b3={'where':_0x5bfd9b[_0x6c6b('0x37')]};return db[_0x6c6b('0x29')][_0x6c6b('0x1b')](_0x3145b3)[_0x6c6b('0x3d')](function(_0x44cb9e){_0x17fbd3[_0x6c6b('0x1b')]=_0x44cb9e;if(_0x46d1cb[_0x6c6b('0x2f')]['includeAll']){_0x5bfd9b[_0x6c6b('0x3e')]=[{'all':!![]}];}return db[_0x6c6b('0x29')][_0x6c6b('0x3f')](_0x5bfd9b);})['then'](function(_0x3bba8a){_0x17fbd3['rows']=_0x3bba8a;return _0x17fbd3;})[_0x6c6b('0x3d')](respondWithFilteredResult(_0x2c831a,_0x5bfd9b))[_0x6c6b('0x40')](handleError(_0x2c831a,null));};exports[_0x6c6b('0x41')]=function(_0x335eaa,_0x15546d){var _0x267c39={'raw':![],'where':{'id':_0x335eaa['params']['id']}},_0x598039={};_0x598039['model']=_[_0x6c6b('0x42')](db[_0x6c6b('0x29')][_0x6c6b('0x2a')]);_0x598039[_0x6c6b('0x2f')]=_[_0x6c6b('0x42')](_0x335eaa[_0x6c6b('0x2f')]);_0x598039[_0x6c6b('0x30')]=_[_0x6c6b('0x31')](_0x598039[_0x6c6b('0x2e')],_0x598039[_0x6c6b('0x2f')]);_0x267c39[_0x6c6b('0x32')]=_[_0x6c6b('0x31')](_0x598039[_0x6c6b('0x2e')],qs[_0x6c6b('0x43')](_0x335eaa['query'][_0x6c6b('0x43')]));_0x267c39[_0x6c6b('0x32')]=_0x267c39['attributes'][_0x6c6b('0x33')]?_0x267c39[_0x6c6b('0x32')]:_0x598039['model'];if(_0x335eaa[_0x6c6b('0x2f')][_0x6c6b('0x44')]){_0x267c39[_0x6c6b('0x3e')]=[{'all':!![]}];}_0x267c39=_[_0x6c6b('0x3b')]({},_0x267c39,_0x335eaa['options']);return db['DeskConfiguration'][_0x6c6b('0x45')](_0x267c39)[_0x6c6b('0x3d')](handleEntityNotFound(_0x15546d,null))[_0x6c6b('0x3d')](respondWithResult(_0x15546d,null))[_0x6c6b('0x40')](handleError(_0x15546d,null));};exports['create']=function(_0x3ec8c9,_0x184007){return db['DeskConfiguration']['create'](_0x3ec8c9[_0x6c6b('0x46')],{})[_0x6c6b('0x3d')](respondWithResult(_0x184007,0xc9))[_0x6c6b('0x40')](handleError(_0x184007,null));};exports[_0x6c6b('0x47')]=function(_0x2f6abf,_0x139a14){if(_0x2f6abf['body']['id']){delete _0x2f6abf[_0x6c6b('0x46')]['id'];}return db[_0x6c6b('0x29')][_0x6c6b('0x45')]({'where':{'id':_0x2f6abf[_0x6c6b('0x48')]['id']}})['then'](handleEntityNotFound(_0x139a14,null))[_0x6c6b('0x3d')](saveUpdates(_0x2f6abf[_0x6c6b('0x46')],null))[_0x6c6b('0x3d')](respondWithResult(_0x139a14,null))['catch'](handleError(_0x139a14,null));};exports[_0x6c6b('0x22')]=function(_0x41e0cc,_0x324375){return db['DeskConfiguration'][_0x6c6b('0x45')]({'where':{'id':_0x41e0cc['params']['id']}})[_0x6c6b('0x3d')](handleEntityNotFound(_0x324375,null))[_0x6c6b('0x3d')](removeEntity(_0x324375,null))[_0x6c6b('0x40')](handleError(_0x324375,null));};exports['getFields']=function(_0x31bef2,_0x4fc45d,_0x54efdb){var _0x2d75d9={};var _0x109a55={};var _0x3d7306;var _0x35fa0b;return db[_0x6c6b('0x29')][_0x6c6b('0x49')]({'where':{'id':_0x31bef2[_0x6c6b('0x48')]['id']}})['then'](handleEntityNotFound(_0x4fc45d,null))['then'](function(_0x2a2636){if(_0x2a2636){_0x3d7306=_0x2a2636;_0x109a55[_0x6c6b('0x2e')]=_[_0x6c6b('0x42')](db[_0x6c6b('0x4a')][_0x6c6b('0x2a')]);_0x109a55[_0x6c6b('0x2f')]=_[_0x6c6b('0x42')](_0x31bef2[_0x6c6b('0x2f')]);_0x109a55[_0x6c6b('0x30')]=_['intersection'](_0x109a55[_0x6c6b('0x2e')],_0x109a55[_0x6c6b('0x2f')]);_0x2d75d9['attributes']=_[_0x6c6b('0x31')](_0x109a55[_0x6c6b('0x2e')],qs['fields'](_0x31bef2[_0x6c6b('0x2f')][_0x6c6b('0x43')]));_0x2d75d9[_0x6c6b('0x32')]=_0x2d75d9[_0x6c6b('0x32')][_0x6c6b('0x33')]?_0x2d75d9['attributes']:_0x109a55[_0x6c6b('0x2e')];_0x2d75d9[_0x6c6b('0x35')]=qs[_0x6c6b('0x36')](_0x31bef2[_0x6c6b('0x2f')][_0x6c6b('0x36')]);_0x2d75d9[_0x6c6b('0x37')]=qs[_0x6c6b('0x30')](_[_0x6c6b('0x38')](_0x31bef2[_0x6c6b('0x2f')],_0x109a55[_0x6c6b('0x30')]));if(_0x31bef2[_0x6c6b('0x2f')]['filter']){_0x2d75d9[_0x6c6b('0x37')]=_[_0x6c6b('0x3b')](_0x2d75d9['where'],{'$or':_['map'](_0x2d75d9['attributes'],function(_0x5035f5){var _0x401e6f={};_0x401e6f[_0x5035f5]={'$like':'%'+_0x31bef2[_0x6c6b('0x2f')]['filter']+'%'};return _0x401e6f;})});}_0x2d75d9=_[_0x6c6b('0x3b')]({},_0x2d75d9,_0x31bef2['options']);return _0x3d7306[_0x6c6b('0x4b')](_0x2d75d9);}})['then'](function(_0x4af1e4){if(_0x4af1e4){_0x35fa0b=_0x4af1e4['length'];if(!_0x31bef2[_0x6c6b('0x2f')]['hasOwnProperty'](_0x6c6b('0x34'))){_0x2d75d9[_0x6c6b('0x1c')]=qs[_0x6c6b('0x1c')](_0x31bef2[_0x6c6b('0x2f')][_0x6c6b('0x1c')]);_0x2d75d9[_0x6c6b('0x19')]=qs[_0x6c6b('0x19')](_0x31bef2[_0x6c6b('0x2f')][_0x6c6b('0x19')]);}return _0x3d7306[_0x6c6b('0x4b')](_0x2d75d9);}})['then'](function(_0x42399d){if(_0x42399d){return _0x42399d?{'count':_0x35fa0b,'rows':_0x42399d}:null;}})[_0x6c6b('0x3d')](respondWithResult(_0x4fc45d,null))[_0x6c6b('0x40')](handleError(_0x4fc45d,null));};exports[_0x6c6b('0x4c')]=function(_0x1bee4b,_0x77a310,_0x4675ec){var _0x7e119e={};var _0x373f84={};var _0xc18f60;var _0x4fb040;return db[_0x6c6b('0x29')]['findOne']({'where':{'id':_0x1bee4b[_0x6c6b('0x48')]['id']}})[_0x6c6b('0x3d')](handleEntityNotFound(_0x77a310,null))[_0x6c6b('0x3d')](function(_0x134fac){if(_0x134fac){_0xc18f60=_0x134fac;_0x373f84[_0x6c6b('0x2e')]=_[_0x6c6b('0x42')](db[_0x6c6b('0x4a')][_0x6c6b('0x2a')]);_0x373f84[_0x6c6b('0x2f')]=_[_0x6c6b('0x42')](_0x1bee4b['query']);_0x373f84['filters']=_['intersection'](_0x373f84[_0x6c6b('0x2e')],_0x373f84[_0x6c6b('0x2f')]);_0x7e119e['attributes']=_[_0x6c6b('0x31')](_0x373f84[_0x6c6b('0x2e')],qs[_0x6c6b('0x43')](_0x1bee4b[_0x6c6b('0x2f')][_0x6c6b('0x43')]));_0x7e119e[_0x6c6b('0x32')]=_0x7e119e['attributes']['length']?_0x7e119e[_0x6c6b('0x32')]:_0x373f84[_0x6c6b('0x2e')];_0x7e119e[_0x6c6b('0x35')]=qs[_0x6c6b('0x36')](_0x1bee4b[_0x6c6b('0x2f')][_0x6c6b('0x36')]);_0x7e119e[_0x6c6b('0x37')]=qs[_0x6c6b('0x30')](_[_0x6c6b('0x38')](_0x1bee4b[_0x6c6b('0x2f')],_0x373f84[_0x6c6b('0x30')]));if(_0x1bee4b[_0x6c6b('0x2f')]['filter']){_0x7e119e[_0x6c6b('0x37')]=_['merge'](_0x7e119e[_0x6c6b('0x37')],{'$or':_[_0x6c6b('0x28')](_0x7e119e['attributes'],function(_0x3c3a33){var _0x32992f={};_0x32992f[_0x3c3a33]={'$like':'%'+_0x1bee4b[_0x6c6b('0x2f')][_0x6c6b('0x39')]+'%'};return _0x32992f;})});}_0x7e119e=_[_0x6c6b('0x3b')]({},_0x7e119e,_0x1bee4b['options']);return _0xc18f60[_0x6c6b('0x4c')](_0x7e119e);}})[_0x6c6b('0x3d')](function(_0x3bddf0){if(_0x3bddf0){_0x4fb040=_0x3bddf0[_0x6c6b('0x33')];if(!_0x1bee4b[_0x6c6b('0x2f')]['hasOwnProperty'](_0x6c6b('0x34'))){_0x7e119e['limit']=qs[_0x6c6b('0x1c')](_0x1bee4b[_0x6c6b('0x2f')]['limit']);_0x7e119e['offset']=qs['offset'](_0x1bee4b[_0x6c6b('0x2f')][_0x6c6b('0x19')]);}return _0xc18f60['getSubjects'](_0x7e119e);}})[_0x6c6b('0x3d')](function(_0x55c019){if(_0x55c019){return _0x55c019?{'count':_0x4fb040,'rows':_0x55c019}:null;}})[_0x6c6b('0x3d')](respondWithResult(_0x77a310,null))[_0x6c6b('0x40')](handleError(_0x77a310,null));};exports['getDescriptions']=function(_0x233201,_0x162130,_0x4b2e68){var _0x2ce051={};var _0x108d88={};var _0x196fbe;var _0x34e8ff;return db[_0x6c6b('0x29')][_0x6c6b('0x49')]({'where':{'id':_0x233201['params']['id']}})[_0x6c6b('0x3d')](handleEntityNotFound(_0x162130,null))['then'](function(_0x580640){if(_0x580640){_0x196fbe=_0x580640;_0x108d88[_0x6c6b('0x2e')]=_['keys'](db[_0x6c6b('0x4a')]['rawAttributes']);_0x108d88[_0x6c6b('0x2f')]=_['keys'](_0x233201[_0x6c6b('0x2f')]);_0x108d88[_0x6c6b('0x30')]=_[_0x6c6b('0x31')](_0x108d88[_0x6c6b('0x2e')],_0x108d88['query']);_0x2ce051[_0x6c6b('0x32')]=_['intersection'](_0x108d88[_0x6c6b('0x2e')],qs[_0x6c6b('0x43')](_0x233201[_0x6c6b('0x2f')][_0x6c6b('0x43')]));_0x2ce051[_0x6c6b('0x32')]=_0x2ce051['attributes'][_0x6c6b('0x33')]?_0x2ce051[_0x6c6b('0x32')]:_0x108d88[_0x6c6b('0x2e')];_0x2ce051['order']=qs[_0x6c6b('0x36')](_0x233201[_0x6c6b('0x2f')][_0x6c6b('0x36')]);_0x2ce051[_0x6c6b('0x37')]=qs['filters'](_[_0x6c6b('0x38')](_0x233201[_0x6c6b('0x2f')],_0x108d88[_0x6c6b('0x30')]));if(_0x233201[_0x6c6b('0x2f')][_0x6c6b('0x39')]){_0x2ce051['where']=_[_0x6c6b('0x3b')](_0x2ce051[_0x6c6b('0x37')],{'$or':_['map'](_0x2ce051[_0x6c6b('0x32')],function(_0x21414a){var _0x28a93c={};_0x28a93c[_0x21414a]={'$like':'%'+_0x233201[_0x6c6b('0x2f')][_0x6c6b('0x39')]+'%'};return _0x28a93c;})});}_0x2ce051=_[_0x6c6b('0x3b')]({},_0x2ce051,_0x233201[_0x6c6b('0x3c')]);return _0x196fbe[_0x6c6b('0x4d')](_0x2ce051);}})['then'](function(_0x45cca7){if(_0x45cca7){_0x34e8ff=_0x45cca7['length'];if(!_0x233201[_0x6c6b('0x2f')][_0x6c6b('0x4e')](_0x6c6b('0x34'))){_0x2ce051[_0x6c6b('0x1c')]=qs['limit'](_0x233201[_0x6c6b('0x2f')]['limit']);_0x2ce051[_0x6c6b('0x19')]=qs[_0x6c6b('0x19')](_0x233201[_0x6c6b('0x2f')][_0x6c6b('0x19')]);}return _0x196fbe[_0x6c6b('0x4d')](_0x2ce051);}})[_0x6c6b('0x3d')](function(_0x5ca630){if(_0x5ca630){return _0x5ca630?{'count':_0x34e8ff,'rows':_0x5ca630}:null;}})['then'](respondWithResult(_0x162130,null))[_0x6c6b('0x40')](handleError(_0x162130,null));};exports[_0x6c6b('0x4f')]=function(_0x183dc6,_0x56842f,_0x3de488){var _0x218767={};var _0x539951={};var _0x5c3bc6;var _0xf527;return db[_0x6c6b('0x29')][_0x6c6b('0x49')]({'where':{'id':_0x183dc6[_0x6c6b('0x48')]['id']}})[_0x6c6b('0x3d')](handleEntityNotFound(_0x56842f,null))[_0x6c6b('0x3d')](function(_0xacaf62){if(_0xacaf62){_0x5c3bc6=_0xacaf62;_0x539951[_0x6c6b('0x2e')]=_[_0x6c6b('0x42')](db[_0x6c6b('0x50')][_0x6c6b('0x2a')]);_0x539951['query']=_[_0x6c6b('0x42')](_0x183dc6[_0x6c6b('0x2f')]);_0x539951[_0x6c6b('0x30')]=_[_0x6c6b('0x31')](_0x539951[_0x6c6b('0x2e')],_0x539951[_0x6c6b('0x2f')]);_0x218767[_0x6c6b('0x32')]=_['intersection'](_0x539951['model'],qs[_0x6c6b('0x43')](_0x183dc6[_0x6c6b('0x2f')][_0x6c6b('0x43')]));_0x218767[_0x6c6b('0x32')]=_0x218767[_0x6c6b('0x32')]['length']?_0x218767['attributes']:_0x539951[_0x6c6b('0x2e')];_0x218767[_0x6c6b('0x35')]=qs[_0x6c6b('0x36')](_0x183dc6['query'][_0x6c6b('0x36')]);_0x218767[_0x6c6b('0x37')]=qs[_0x6c6b('0x30')](_[_0x6c6b('0x38')](_0x183dc6[_0x6c6b('0x2f')],_0x539951[_0x6c6b('0x30')]));if(_0x183dc6[_0x6c6b('0x2f')][_0x6c6b('0x39')]){_0x218767[_0x6c6b('0x37')]=_[_0x6c6b('0x3b')](_0x218767[_0x6c6b('0x37')],{'$or':_[_0x6c6b('0x28')](_0x218767[_0x6c6b('0x32')],function(_0x2b769d){var _0x5ec188={};_0x5ec188[_0x2b769d]={'$like':'%'+_0x183dc6[_0x6c6b('0x2f')][_0x6c6b('0x39')]+'%'};return _0x5ec188;})});}_0x218767=_[_0x6c6b('0x3b')]({},_0x218767,_0x183dc6['options']);return _0x5c3bc6[_0x6c6b('0x4f')](_0x218767);}})[_0x6c6b('0x3d')](function(_0x454491){if(_0x454491){_0xf527=_0x454491[_0x6c6b('0x33')];if(!_0x183dc6[_0x6c6b('0x2f')][_0x6c6b('0x4e')](_0x6c6b('0x34'))){_0x218767['limit']=qs['limit'](_0x183dc6['query']['limit']);_0x218767[_0x6c6b('0x19')]=qs[_0x6c6b('0x19')](_0x183dc6[_0x6c6b('0x2f')][_0x6c6b('0x19')]);}return _0x5c3bc6[_0x6c6b('0x4f')](_0x218767);}})[_0x6c6b('0x3d')](function(_0x3f6516){if(_0x3f6516){return _0x3f6516?{'count':_0xf527,'rows':_0x3f6516}:null;}})[_0x6c6b('0x3d')](respondWithResult(_0x56842f,null))[_0x6c6b('0x40')](handleError(_0x56842f,null));};exports[_0x6c6b('0x51')]=function(_0x530e2d,_0x94037a,_0x1fc96e){if(_0x530e2d[_0x6c6b('0x46')]['id']){delete _0x530e2d['body']['id'];}return db[_0x6c6b('0x29')][_0x6c6b('0x49')]({'where':{'id':_0x530e2d[_0x6c6b('0x48')]['id']}})[_0x6c6b('0x3d')](handleEntityNotFound(_0x94037a,null))[_0x6c6b('0x3d')](function(_0x53bdd3){if(_0x53bdd3){return _0x53bdd3[_0x6c6b('0x51')](_0x530e2d[_0x6c6b('0x46')][_0x6c6b('0x52')]||[]);}return null;})['then'](respondWithResult(_0x94037a,null))[_0x6c6b('0x40')](handleError(_0x94037a,null));}; \ No newline at end of file +var _0xcec9=['update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','DeskConfiguration','includeAll','include','rows','catch','show','params','find','create','body','findOne','DeskField','getFields','getSubjects','hasOwnProperty','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save'];(function(_0x10ba2a,_0x238609){var _0x243dfb=function(_0x4fa180){while(--_0x4fa180){_0x10ba2a['push'](_0x10ba2a['shift']());}};_0x243dfb(++_0x238609);}(_0xcec9,0x1d0));var _0x9cec=function(_0x5e66b0,_0x5bef62){_0x5e66b0=_0x5e66b0-0x0;var _0x9a3372=_0xcec9[_0x5e66b0];return _0x9a3372;};'use strict';var emlformat=require(_0x9cec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9cec('0x1'));var jsonpatch=require(_0x9cec('0x2'));var rp=require(_0x9cec('0x3'));var moment=require(_0x9cec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9cec('0x5'));var util=require(_0x9cec('0x6'));var path=require('path');var sox=require(_0x9cec('0x7'));var csv=require('to-csv');var ejs=require(_0x9cec('0x8'));var fs=require('fs');var fs_extra=require(_0x9cec('0x9'));var _=require(_0x9cec('0xa'));var squel=require('squel');var crypto=require(_0x9cec('0xb'));var jsforce=require(_0x9cec('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9cec('0xd'));var Papa=require(_0x9cec('0xe'));var Redis=require('ioredis');var authService=require(_0x9cec('0xf'));var qs=require(_0x9cec('0x10'));var as=require(_0x9cec('0x11'));var hardwareService=require(_0x9cec('0x12'));var logger=require(_0x9cec('0x13'))(_0x9cec('0x14'));var utils=require('../../config/utils');var config=require(_0x9cec('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9cec('0x16'))['db'];function respondWithStatusCode(_0x536ae3,_0x2b1ac6){_0x2b1ac6=_0x2b1ac6||0xcc;return function(_0x201b21){if(_0x201b21){return _0x536ae3[_0x9cec('0x17')](_0x2b1ac6);}return _0x536ae3[_0x9cec('0x18')](_0x2b1ac6)[_0x9cec('0x19')]();};}function respondWithResult(_0x243481,_0x4caf98){_0x4caf98=_0x4caf98||0xc8;return function(_0x53fbe5){if(_0x53fbe5){return _0x243481[_0x9cec('0x18')](_0x4caf98)[_0x9cec('0x1a')](_0x53fbe5);}};}function respondWithFilteredResult(_0x2fbc85,_0x28db77){return function(_0x332e5f){if(_0x332e5f){var _0xa6a53b=typeof _0x28db77[_0x9cec('0x1b')]==='undefined'&&typeof _0x28db77[_0x9cec('0x1c')]==='undefined';var _0x2647ba=_0x332e5f[_0x9cec('0x1d')];var _0x3783eb=_0xa6a53b?0x0:_0x28db77[_0x9cec('0x1b')];var _0x2f129d=_0xa6a53b?_0x332e5f[_0x9cec('0x1d')]:_0x28db77[_0x9cec('0x1b')]+_0x28db77[_0x9cec('0x1c')];var _0xd2d364;if(_0x2f129d>=_0x2647ba){_0x2f129d=_0x2647ba;_0xd2d364=0xc8;}else{_0xd2d364=0xce;}_0x2fbc85['status'](_0xd2d364);return _0x2fbc85[_0x9cec('0x1e')]('Content-Range',_0x3783eb+'-'+_0x2f129d+'/'+_0x2647ba)[_0x9cec('0x1a')](_0x332e5f);}return null;};}function patchUpdates(_0x5896f3){return function(_0x563abb){try{jsonpatch[_0x9cec('0x1f')](_0x563abb,_0x5896f3,!![]);}catch(_0x27ddde){return BPromise[_0x9cec('0x20')](_0x27ddde);}return _0x563abb[_0x9cec('0x21')]();};}function saveUpdates(_0x2f70c0,_0x4088f6){return function(_0x388818){if(_0x388818){return _0x388818[_0x9cec('0x22')](_0x2f70c0)[_0x9cec('0x23')](function(_0x5155fa){return _0x5155fa;});}return null;};}function removeEntity(_0x4f510c,_0x3c7a65){return function(_0x43ca25){if(_0x43ca25){return _0x43ca25[_0x9cec('0x24')]()[_0x9cec('0x23')](function(){_0x4f510c[_0x9cec('0x18')](0xcc)[_0x9cec('0x19')]();});}};}function handleEntityNotFound(_0x5c1b10,_0x5776dd){return function(_0x519a01){if(!_0x519a01){_0x5c1b10[_0x9cec('0x17')](0x194);}return _0x519a01;};}function handleError(_0x59a387,_0x6940eb){_0x6940eb=_0x6940eb||0x1f4;return function(_0x5d86db){logger[_0x9cec('0x25')](_0x5d86db[_0x9cec('0x26')]);if(_0x5d86db[_0x9cec('0x27')]){delete _0x5d86db[_0x9cec('0x27')];}_0x59a387['status'](_0x6940eb)[_0x9cec('0x28')](_0x5d86db);};}exports[_0x9cec('0x29')]=function(_0x53c7f2,_0x53cc4e){var _0x2839d8={},_0x5202ab={},_0x4a246c={'count':0x0,'rows':[]};var _0x5704d0=_[_0x9cec('0x2a')](db['DeskConfiguration'][_0x9cec('0x2b')],function(_0x517d75){return{'name':_0x517d75[_0x9cec('0x2c')],'type':_0x517d75[_0x9cec('0x2d')][_0x9cec('0x2e')]};});_0x5202ab['model']=_[_0x9cec('0x2a')](_0x5704d0,_0x9cec('0x27'));_0x5202ab['query']=_[_0x9cec('0x2f')](_0x53c7f2[_0x9cec('0x30')]);_0x5202ab[_0x9cec('0x31')]=_['intersection'](_0x5202ab[_0x9cec('0x32')],_0x5202ab[_0x9cec('0x30')]);_0x2839d8[_0x9cec('0x33')]=_[_0x9cec('0x34')](_0x5202ab[_0x9cec('0x32')],qs[_0x9cec('0x35')](_0x53c7f2['query'][_0x9cec('0x35')]));_0x2839d8['attributes']=_0x2839d8['attributes'][_0x9cec('0x36')]?_0x2839d8[_0x9cec('0x33')]:_0x5202ab['model'];if(!_0x53c7f2[_0x9cec('0x30')]['hasOwnProperty'](_0x9cec('0x37'))){_0x2839d8[_0x9cec('0x1c')]=qs[_0x9cec('0x1c')](_0x53c7f2['query']['limit']);_0x2839d8[_0x9cec('0x1b')]=qs['offset'](_0x53c7f2['query']['offset']);}_0x2839d8[_0x9cec('0x38')]=qs[_0x9cec('0x39')](_0x53c7f2[_0x9cec('0x30')][_0x9cec('0x39')]);_0x2839d8[_0x9cec('0x3a')]=qs[_0x9cec('0x31')](_[_0x9cec('0x3b')](_0x53c7f2['query'],_0x5202ab['filters']),_0x5704d0);if(_0x53c7f2[_0x9cec('0x30')][_0x9cec('0x3c')]){_0x2839d8[_0x9cec('0x3a')]=_[_0x9cec('0x3d')](_0x2839d8[_0x9cec('0x3a')],{'$or':_[_0x9cec('0x2a')](_0x5704d0,function(_0x325bfa){if(_0x325bfa[_0x9cec('0x2d')]!=='VIRTUAL'){var _0x3f211f={};_0x3f211f[_0x325bfa['name']]={'$like':'%'+_0x53c7f2[_0x9cec('0x30')][_0x9cec('0x3c')]+'%'};return _0x3f211f;}})});}_0x2839d8=_[_0x9cec('0x3d')]({},_0x2839d8,_0x53c7f2[_0x9cec('0x3e')]);var _0x236d9b={'where':_0x2839d8[_0x9cec('0x3a')]};return db[_0x9cec('0x3f')]['count'](_0x236d9b)[_0x9cec('0x23')](function(_0x1a0333){_0x4a246c['count']=_0x1a0333;if(_0x53c7f2['query'][_0x9cec('0x40')]){_0x2839d8[_0x9cec('0x41')]=[{'all':!![]}];}return db[_0x9cec('0x3f')]['findAll'](_0x2839d8);})[_0x9cec('0x23')](function(_0x2885e6){_0x4a246c[_0x9cec('0x42')]=_0x2885e6;return _0x4a246c;})[_0x9cec('0x23')](respondWithFilteredResult(_0x53cc4e,_0x2839d8))[_0x9cec('0x43')](handleError(_0x53cc4e,null));};exports[_0x9cec('0x44')]=function(_0x1ffb8f,_0x5d2c22){var _0x19f989={'raw':![],'where':{'id':_0x1ffb8f[_0x9cec('0x45')]['id']}},_0x14af8a={};_0x14af8a[_0x9cec('0x32')]=_[_0x9cec('0x2f')](db['DeskConfiguration']['rawAttributes']);_0x14af8a[_0x9cec('0x30')]=_[_0x9cec('0x2f')](_0x1ffb8f[_0x9cec('0x30')]);_0x14af8a[_0x9cec('0x31')]=_[_0x9cec('0x34')](_0x14af8a[_0x9cec('0x32')],_0x14af8a[_0x9cec('0x30')]);_0x19f989[_0x9cec('0x33')]=_['intersection'](_0x14af8a['model'],qs[_0x9cec('0x35')](_0x1ffb8f[_0x9cec('0x30')][_0x9cec('0x35')]));_0x19f989['attributes']=_0x19f989[_0x9cec('0x33')][_0x9cec('0x36')]?_0x19f989[_0x9cec('0x33')]:_0x14af8a[_0x9cec('0x32')];if(_0x1ffb8f[_0x9cec('0x30')][_0x9cec('0x40')]){_0x19f989['include']=[{'all':!![]}];}_0x19f989=_[_0x9cec('0x3d')]({},_0x19f989,_0x1ffb8f[_0x9cec('0x3e')]);return db[_0x9cec('0x3f')][_0x9cec('0x46')](_0x19f989)[_0x9cec('0x23')](handleEntityNotFound(_0x5d2c22,null))['then'](respondWithResult(_0x5d2c22,null))[_0x9cec('0x43')](handleError(_0x5d2c22,null));};exports[_0x9cec('0x47')]=function(_0x444156,_0x1a4c05){return db[_0x9cec('0x3f')]['create'](_0x444156[_0x9cec('0x48')],{})['then'](respondWithResult(_0x1a4c05,0xc9))[_0x9cec('0x43')](handleError(_0x1a4c05,null));};exports[_0x9cec('0x22')]=function(_0x28931f,_0x218967){if(_0x28931f['body']['id']){delete _0x28931f[_0x9cec('0x48')]['id'];}return db[_0x9cec('0x3f')][_0x9cec('0x46')]({'where':{'id':_0x28931f[_0x9cec('0x45')]['id']}})[_0x9cec('0x23')](handleEntityNotFound(_0x218967,null))[_0x9cec('0x23')](saveUpdates(_0x28931f[_0x9cec('0x48')],null))[_0x9cec('0x23')](respondWithResult(_0x218967,null))['catch'](handleError(_0x218967,null));};exports[_0x9cec('0x24')]=function(_0x41d054,_0x4f80b6){return db[_0x9cec('0x3f')]['find']({'where':{'id':_0x41d054['params']['id']}})[_0x9cec('0x23')](handleEntityNotFound(_0x4f80b6,null))[_0x9cec('0x23')](removeEntity(_0x4f80b6,null))[_0x9cec('0x43')](handleError(_0x4f80b6,null));};exports['getFields']=function(_0x3661ed,_0x43b2ff,_0x4d6cca){var _0x5a58c4={};var _0x7c4efa={};var _0x25233f;var _0x54f503;return db[_0x9cec('0x3f')][_0x9cec('0x49')]({'where':{'id':_0x3661ed[_0x9cec('0x45')]['id']}})[_0x9cec('0x23')](handleEntityNotFound(_0x43b2ff,null))[_0x9cec('0x23')](function(_0xf21718){if(_0xf21718){_0x25233f=_0xf21718;_0x7c4efa['model']=_['keys'](db[_0x9cec('0x4a')][_0x9cec('0x2b')]);_0x7c4efa[_0x9cec('0x30')]=_[_0x9cec('0x2f')](_0x3661ed[_0x9cec('0x30')]);_0x7c4efa[_0x9cec('0x31')]=_[_0x9cec('0x34')](_0x7c4efa[_0x9cec('0x32')],_0x7c4efa[_0x9cec('0x30')]);_0x5a58c4[_0x9cec('0x33')]=_[_0x9cec('0x34')](_0x7c4efa[_0x9cec('0x32')],qs[_0x9cec('0x35')](_0x3661ed[_0x9cec('0x30')]['fields']));_0x5a58c4[_0x9cec('0x33')]=_0x5a58c4['attributes'][_0x9cec('0x36')]?_0x5a58c4['attributes']:_0x7c4efa['model'];_0x5a58c4[_0x9cec('0x38')]=qs[_0x9cec('0x39')](_0x3661ed[_0x9cec('0x30')]['sort']);_0x5a58c4[_0x9cec('0x3a')]=qs[_0x9cec('0x31')](_[_0x9cec('0x3b')](_0x3661ed[_0x9cec('0x30')],_0x7c4efa[_0x9cec('0x31')]));if(_0x3661ed['query'][_0x9cec('0x3c')]){_0x5a58c4[_0x9cec('0x3a')]=_['merge'](_0x5a58c4[_0x9cec('0x3a')],{'$or':_[_0x9cec('0x2a')](_0x5a58c4['attributes'],function(_0x5aa04a){var _0x4ffe5c={};_0x4ffe5c[_0x5aa04a]={'$like':'%'+_0x3661ed[_0x9cec('0x30')][_0x9cec('0x3c')]+'%'};return _0x4ffe5c;})});}_0x5a58c4=_[_0x9cec('0x3d')]({},_0x5a58c4,_0x3661ed[_0x9cec('0x3e')]);return _0x25233f[_0x9cec('0x4b')](_0x5a58c4);}})['then'](function(_0x23c830){if(_0x23c830){_0x54f503=_0x23c830[_0x9cec('0x36')];if(!_0x3661ed[_0x9cec('0x30')]['hasOwnProperty'](_0x9cec('0x37'))){_0x5a58c4['limit']=qs['limit'](_0x3661ed['query']['limit']);_0x5a58c4['offset']=qs[_0x9cec('0x1b')](_0x3661ed[_0x9cec('0x30')][_0x9cec('0x1b')]);}return _0x25233f[_0x9cec('0x4b')](_0x5a58c4);}})[_0x9cec('0x23')](function(_0x5dcb9d){if(_0x5dcb9d){return _0x5dcb9d?{'count':_0x54f503,'rows':_0x5dcb9d}:null;}})[_0x9cec('0x23')](respondWithResult(_0x43b2ff,null))[_0x9cec('0x43')](handleError(_0x43b2ff,null));};exports[_0x9cec('0x4c')]=function(_0x298765,_0x3d3090,_0xbd5cef){var _0x2b47e6={};var _0x596058={};var _0x58ccdd;var _0x3484ca;return db[_0x9cec('0x3f')][_0x9cec('0x49')]({'where':{'id':_0x298765[_0x9cec('0x45')]['id']}})[_0x9cec('0x23')](handleEntityNotFound(_0x3d3090,null))[_0x9cec('0x23')](function(_0x384401){if(_0x384401){_0x58ccdd=_0x384401;_0x596058['model']=_[_0x9cec('0x2f')](db['DeskField'][_0x9cec('0x2b')]);_0x596058[_0x9cec('0x30')]=_[_0x9cec('0x2f')](_0x298765['query']);_0x596058[_0x9cec('0x31')]=_[_0x9cec('0x34')](_0x596058[_0x9cec('0x32')],_0x596058[_0x9cec('0x30')]);_0x2b47e6[_0x9cec('0x33')]=_['intersection'](_0x596058[_0x9cec('0x32')],qs[_0x9cec('0x35')](_0x298765[_0x9cec('0x30')][_0x9cec('0x35')]));_0x2b47e6['attributes']=_0x2b47e6[_0x9cec('0x33')][_0x9cec('0x36')]?_0x2b47e6[_0x9cec('0x33')]:_0x596058[_0x9cec('0x32')];_0x2b47e6['order']=qs[_0x9cec('0x39')](_0x298765['query']['sort']);_0x2b47e6[_0x9cec('0x3a')]=qs[_0x9cec('0x31')](_[_0x9cec('0x3b')](_0x298765[_0x9cec('0x30')],_0x596058[_0x9cec('0x31')]));if(_0x298765[_0x9cec('0x30')][_0x9cec('0x3c')]){_0x2b47e6['where']=_[_0x9cec('0x3d')](_0x2b47e6[_0x9cec('0x3a')],{'$or':_[_0x9cec('0x2a')](_0x2b47e6[_0x9cec('0x33')],function(_0x363f7b){var _0x365656={};_0x365656[_0x363f7b]={'$like':'%'+_0x298765[_0x9cec('0x30')][_0x9cec('0x3c')]+'%'};return _0x365656;})});}_0x2b47e6=_['merge']({},_0x2b47e6,_0x298765[_0x9cec('0x3e')]);return _0x58ccdd[_0x9cec('0x4c')](_0x2b47e6);}})[_0x9cec('0x23')](function(_0x37dc9d){if(_0x37dc9d){_0x3484ca=_0x37dc9d['length'];if(!_0x298765['query'][_0x9cec('0x4d')]('nolimit')){_0x2b47e6['limit']=qs[_0x9cec('0x1c')](_0x298765[_0x9cec('0x30')][_0x9cec('0x1c')]);_0x2b47e6[_0x9cec('0x1b')]=qs[_0x9cec('0x1b')](_0x298765['query'][_0x9cec('0x1b')]);}return _0x58ccdd[_0x9cec('0x4c')](_0x2b47e6);}})[_0x9cec('0x23')](function(_0x2be8ed){if(_0x2be8ed){return _0x2be8ed?{'count':_0x3484ca,'rows':_0x2be8ed}:null;}})[_0x9cec('0x23')](respondWithResult(_0x3d3090,null))[_0x9cec('0x43')](handleError(_0x3d3090,null));};exports[_0x9cec('0x4e')]=function(_0x4a227e,_0x40cad6,_0x21adf1){var _0x5b863b={};var _0x1e408f={};var _0x2192ba;var _0x26e891;return db['DeskConfiguration'][_0x9cec('0x49')]({'where':{'id':_0x4a227e[_0x9cec('0x45')]['id']}})[_0x9cec('0x23')](handleEntityNotFound(_0x40cad6,null))[_0x9cec('0x23')](function(_0x2687bc){if(_0x2687bc){_0x2192ba=_0x2687bc;_0x1e408f[_0x9cec('0x32')]=_[_0x9cec('0x2f')](db[_0x9cec('0x4a')][_0x9cec('0x2b')]);_0x1e408f[_0x9cec('0x30')]=_[_0x9cec('0x2f')](_0x4a227e[_0x9cec('0x30')]);_0x1e408f['filters']=_[_0x9cec('0x34')](_0x1e408f[_0x9cec('0x32')],_0x1e408f['query']);_0x5b863b[_0x9cec('0x33')]=_['intersection'](_0x1e408f['model'],qs[_0x9cec('0x35')](_0x4a227e[_0x9cec('0x30')][_0x9cec('0x35')]));_0x5b863b[_0x9cec('0x33')]=_0x5b863b[_0x9cec('0x33')]['length']?_0x5b863b[_0x9cec('0x33')]:_0x1e408f[_0x9cec('0x32')];_0x5b863b[_0x9cec('0x38')]=qs[_0x9cec('0x39')](_0x4a227e['query']['sort']);_0x5b863b[_0x9cec('0x3a')]=qs[_0x9cec('0x31')](_[_0x9cec('0x3b')](_0x4a227e[_0x9cec('0x30')],_0x1e408f['filters']));if(_0x4a227e[_0x9cec('0x30')][_0x9cec('0x3c')]){_0x5b863b[_0x9cec('0x3a')]=_[_0x9cec('0x3d')](_0x5b863b['where'],{'$or':_[_0x9cec('0x2a')](_0x5b863b['attributes'],function(_0x44540d){var _0x5d7738={};_0x5d7738[_0x44540d]={'$like':'%'+_0x4a227e[_0x9cec('0x30')][_0x9cec('0x3c')]+'%'};return _0x5d7738;})});}_0x5b863b=_[_0x9cec('0x3d')]({},_0x5b863b,_0x4a227e[_0x9cec('0x3e')]);return _0x2192ba['getDescriptions'](_0x5b863b);}})[_0x9cec('0x23')](function(_0x459669){if(_0x459669){_0x26e891=_0x459669['length'];if(!_0x4a227e['query']['hasOwnProperty'](_0x9cec('0x37'))){_0x5b863b['limit']=qs[_0x9cec('0x1c')](_0x4a227e[_0x9cec('0x30')][_0x9cec('0x1c')]);_0x5b863b['offset']=qs[_0x9cec('0x1b')](_0x4a227e['query'][_0x9cec('0x1b')]);}return _0x2192ba[_0x9cec('0x4e')](_0x5b863b);}})[_0x9cec('0x23')](function(_0x39d35b){if(_0x39d35b){return _0x39d35b?{'count':_0x26e891,'rows':_0x39d35b}:null;}})[_0x9cec('0x23')](respondWithResult(_0x40cad6,null))[_0x9cec('0x43')](handleError(_0x40cad6,null));};exports['getTags']=function(_0x4195d1,_0x2df09d,_0xe5a6ad){var _0x24f3e2={};var _0x46148c={};var _0x50d9c2;var _0x1739ec;return db[_0x9cec('0x3f')][_0x9cec('0x49')]({'where':{'id':_0x4195d1[_0x9cec('0x45')]['id']}})['then'](handleEntityNotFound(_0x2df09d,null))[_0x9cec('0x23')](function(_0x33893f){if(_0x33893f){_0x50d9c2=_0x33893f;_0x46148c['model']=_[_0x9cec('0x2f')](db[_0x9cec('0x4f')][_0x9cec('0x2b')]);_0x46148c[_0x9cec('0x30')]=_[_0x9cec('0x2f')](_0x4195d1[_0x9cec('0x30')]);_0x46148c[_0x9cec('0x31')]=_[_0x9cec('0x34')](_0x46148c[_0x9cec('0x32')],_0x46148c[_0x9cec('0x30')]);_0x24f3e2['attributes']=_[_0x9cec('0x34')](_0x46148c[_0x9cec('0x32')],qs['fields'](_0x4195d1[_0x9cec('0x30')][_0x9cec('0x35')]));_0x24f3e2['attributes']=_0x24f3e2[_0x9cec('0x33')][_0x9cec('0x36')]?_0x24f3e2[_0x9cec('0x33')]:_0x46148c[_0x9cec('0x32')];_0x24f3e2['order']=qs[_0x9cec('0x39')](_0x4195d1[_0x9cec('0x30')][_0x9cec('0x39')]);_0x24f3e2[_0x9cec('0x3a')]=qs['filters'](_['pick'](_0x4195d1[_0x9cec('0x30')],_0x46148c[_0x9cec('0x31')]));if(_0x4195d1[_0x9cec('0x30')][_0x9cec('0x3c')]){_0x24f3e2['where']=_[_0x9cec('0x3d')](_0x24f3e2[_0x9cec('0x3a')],{'$or':_[_0x9cec('0x2a')](_0x24f3e2[_0x9cec('0x33')],function(_0x48ac5a){var _0x252feb={};_0x252feb[_0x48ac5a]={'$like':'%'+_0x4195d1[_0x9cec('0x30')][_0x9cec('0x3c')]+'%'};return _0x252feb;})});}_0x24f3e2=_['merge']({},_0x24f3e2,_0x4195d1['options']);return _0x50d9c2['getTags'](_0x24f3e2);}})[_0x9cec('0x23')](function(_0x59a158){if(_0x59a158){_0x1739ec=_0x59a158['length'];if(!_0x4195d1[_0x9cec('0x30')][_0x9cec('0x4d')](_0x9cec('0x37'))){_0x24f3e2['limit']=qs[_0x9cec('0x1c')](_0x4195d1[_0x9cec('0x30')][_0x9cec('0x1c')]);_0x24f3e2[_0x9cec('0x1b')]=qs[_0x9cec('0x1b')](_0x4195d1['query']['offset']);}return _0x50d9c2[_0x9cec('0x50')](_0x24f3e2);}})[_0x9cec('0x23')](function(_0x5e5f1d){if(_0x5e5f1d){return _0x5e5f1d?{'count':_0x1739ec,'rows':_0x5e5f1d}:null;}})['then'](respondWithResult(_0x2df09d,null))[_0x9cec('0x43')](handleError(_0x2df09d,null));};exports[_0x9cec('0x51')]=function(_0x39cb9d,_0x4e5257,_0x54f62c){if(_0x39cb9d[_0x9cec('0x48')]['id']){delete _0x39cb9d[_0x9cec('0x48')]['id'];}return db[_0x9cec('0x3f')][_0x9cec('0x49')]({'where':{'id':_0x39cb9d[_0x9cec('0x45')]['id']}})[_0x9cec('0x23')](handleEntityNotFound(_0x4e5257,null))['then'](function(_0x5176d1){if(_0x5176d1){return _0x5176d1[_0x9cec('0x51')](_0x39cb9d[_0x9cec('0x48')][_0x9cec('0x52')]||[]);}return null;})['then'](respondWithResult(_0x4e5257,null))['catch'](handleError(_0x4e5257,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index fe7ec7e..25892f9 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 _0x2a77=['api','moment','bluebird','request-promise','path','rimraf','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0x2a77,0x1c6));var _0x72a7=function(_0x4b727f,_0x47e390){_0x4b727f=_0x4b727f-0x0;var _0xe51025=_0x2a77[_0x4b727f];return _0xe51025;};'use strict';var _=require(_0x72a7('0x0'));var util=require(_0x72a7('0x1'));var logger=require('../../config/logger')(_0x72a7('0x2'));var moment=require(_0x72a7('0x3'));var BPromise=require(_0x72a7('0x4'));var rp=require(_0x72a7('0x5'));var fs=require('fs');var path=require(_0x72a7('0x6'));var rimraf=require(_0x72a7('0x7'));var config=require('../../config/environment');var attributes=require(_0x72a7('0x8'));module[_0x72a7('0x9')]=function(_0x36a549,_0x3ea85e){return _0x36a549['define'](_0x72a7('0xa'),attributes,{'tableName':_0x72a7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7dfc=['util','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','lodash'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x7dfc,0x197));var _0xc7df=function(_0x3f3175,_0x324faa){_0x3f3175=_0x3f3175-0x0;var _0xdea098=_0x7dfc[_0x3f3175];return _0xdea098;};'use strict';var _=require(_0xc7df('0x0'));var util=require(_0xc7df('0x1'));var logger=require('../../config/logger')(_0xc7df('0x2'));var moment=require(_0xc7df('0x3'));var BPromise=require(_0xc7df('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7df('0x5'));var rimraf=require(_0xc7df('0x6'));var config=require(_0xc7df('0x7'));var attributes=require(_0xc7df('0x8'));module[_0xc7df('0x9')]=function(_0x2e9d7c,_0x3351a8){return _0x2e9d7c[_0xc7df('0xa')](_0xc7df('0xb'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 5d68efb..4d5d71e 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 _0x4d5a=['info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request'];(function(_0x208fbc,_0x3b8232){var _0x4a67a5=function(_0x2fb8ac){while(--_0x2fb8ac){_0x208fbc['push'](_0x208fbc['shift']());}};_0x4a67a5(++_0x3b8232);}(_0x4d5a,0x15e));var _0xa4d5=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x4d5a[_0x2b10c6];return _0x3789d2;};'use strict';var _=require('lodash');var util=require(_0xa4d5('0x0'));var moment=require(_0xa4d5('0x1'));var BPromise=require(_0xa4d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4d5('0x3'));var db=require(_0xa4d5('0x4'))['db'];var utils=require(_0xa4d5('0x5'));var logger=require(_0xa4d5('0x6'))('rpc');var config=require(_0xa4d5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa4d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1856aa,_0x166db3,_0x318315){return new BPromise(function(_0x408db0,_0x3bed6b){return client[_0xa4d5('0x9')](_0x1856aa,_0x318315)['then'](function(_0x5586de){logger[_0xa4d5('0xa')](_0xa4d5('0xb'),_0x166db3,_0xa4d5('0xc'));logger[_0xa4d5('0xd')](_0xa4d5('0xe'),_0x166db3,_0xa4d5('0xc'),JSON[_0xa4d5('0xf')](_0x5586de));if(_0x5586de[_0xa4d5('0x10')]){if(_0x5586de['error']['code']===0x1f4){logger[_0xa4d5('0x10')](_0xa4d5('0xb'),_0x166db3,_0x5586de[_0xa4d5('0x10')][_0xa4d5('0x11')]);return _0x3bed6b(_0x5586de['error']['message']);}logger[_0xa4d5('0x10')](_0xa4d5('0xb'),_0x166db3,_0x5586de[_0xa4d5('0x10')][_0xa4d5('0x11')]);return _0x408db0(_0x5586de[_0xa4d5('0x10')][_0xa4d5('0x11')]);}else{logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x166db3,_0xa4d5('0xc'));_0x408db0(_0x5586de[_0xa4d5('0x12')]['message']);}})[_0xa4d5('0x13')](function(_0x31eed7){logger[_0xa4d5('0x10')](_0xa4d5('0xb'),_0x166db3,_0x31eed7);_0x3bed6b(_0x31eed7);});});} \ No newline at end of file +var _0x01a6=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message'];(function(_0x3fb584,_0x40503c){var _0x2d0b1a=function(_0x751a9b){while(--_0x751a9b){_0x3fb584['push'](_0x3fb584['shift']());}};_0x2d0b1a(++_0x40503c);}(_0x01a6,0x162));var _0x601a=function(_0x168cdd,_0x49636b){_0x168cdd=_0x168cdd-0x0;var _0x8cbcbf=_0x01a6[_0x168cdd];return _0x8cbcbf;};'use strict';var _=require(_0x601a('0x0'));var util=require('util');var moment=require(_0x601a('0x1'));var BPromise=require(_0x601a('0x2'));var rs=require(_0x601a('0x3'));var fs=require('fs');var Redis=require(_0x601a('0x4'));var db=require(_0x601a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x601a('0x6'))('rpc');var config=require(_0x601a('0x7'));var jayson=require(_0x601a('0x8'));var client=jayson[_0x601a('0x9')][_0x601a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x272297,_0x5d94b5,_0x4ec3fe){return new BPromise(function(_0x208472,_0x1b6bf7){return client[_0x601a('0xb')](_0x272297,_0x4ec3fe)['then'](function(_0x6c5aab){logger[_0x601a('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x5d94b5,_0x601a('0xd'));logger[_0x601a('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5d94b5,_0x601a('0xd'),JSON[_0x601a('0xf')](_0x6c5aab));if(_0x6c5aab[_0x601a('0x10')]){if(_0x6c5aab[_0x601a('0x10')][_0x601a('0x11')]===0x1f4){logger[_0x601a('0x10')](_0x601a('0x12'),_0x5d94b5,_0x6c5aab[_0x601a('0x10')][_0x601a('0x13')]);return _0x1b6bf7(_0x6c5aab[_0x601a('0x10')][_0x601a('0x13')]);}logger['error'](_0x601a('0x12'),_0x5d94b5,_0x6c5aab[_0x601a('0x10')][_0x601a('0x13')]);return _0x208472(_0x6c5aab[_0x601a('0x10')][_0x601a('0x13')]);}else{logger[_0x601a('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x5d94b5,_0x601a('0xd'));_0x208472(_0x6c5aab[_0x601a('0x14')][_0x601a('0x13')]);}})[_0x601a('0x15')](function(_0x4e1ebf){logger[_0x601a('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x5d94b5,_0x4e1ebf);_0x1b6bf7(_0x4e1ebf);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index e5789a4..6047a23 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 _0x4f67=['util','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x4260d3,_0xf3ccd0){var _0x1b6df9=function(_0xf25637){while(--_0xf25637){_0x4260d3['push'](_0x4260d3['shift']());}};_0x1b6df9(++_0xf3ccd0);}(_0x4f67,0xba));var _0x74f6=function(_0x2023e1,_0xeca985){_0x2023e1=_0x2023e1-0x0;var _0x1fe133=_0x4f67[_0x2023e1];return _0x1fe133;};'use strict';var multer=require(_0x74f6('0x0'));var util=require(_0x74f6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x74f6('0x2'));var interaction=require(_0x74f6('0x3'));var config=require(_0x74f6('0x4'));var controller=require(_0x74f6('0x5'));router[_0x74f6('0x6')]('/',auth[_0x74f6('0x7')](),controller['index']);router['get'](_0x74f6('0x8'),auth[_0x74f6('0x7')](),controller[_0x74f6('0x9')]);router[_0x74f6('0xa')]('/',auth['isAuthenticated'](),controller[_0x74f6('0xb')]);router[_0x74f6('0xc')](_0x74f6('0x8'),auth[_0x74f6('0x7')](),controller[_0x74f6('0xd')]);router[_0x74f6('0xe')](_0x74f6('0x8'),auth[_0x74f6('0x7')](),controller[_0x74f6('0xf')]);module[_0x74f6('0x10')]=router; \ No newline at end of file +var _0x42a7=['get','isAuthenticated','index','/:id','show','post','create','put','exports','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller'];(function(_0x5e7872,_0x2c2a10){var _0x226ce4=function(_0xe65c5f){while(--_0xe65c5f){_0x5e7872['push'](_0x5e7872['shift']());}};_0x226ce4(++_0x2c2a10);}(_0x42a7,0xae));var _0x742a=function(_0x576a31,_0x51dfd1){_0x576a31=_0x576a31-0x0;var _0x2b6b99=_0x42a7[_0x576a31];return _0x2b6b99;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x742a('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x742a('0x1')]();var fs_extra=require(_0x742a('0x2'));var auth=require(_0x742a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x742a('0x4'));var controller=require(_0x742a('0x5'));router[_0x742a('0x6')]('/',auth[_0x742a('0x7')](),controller[_0x742a('0x8')]);router[_0x742a('0x6')](_0x742a('0x9'),auth['isAuthenticated'](),controller[_0x742a('0xa')]);router[_0x742a('0xb')]('/',auth[_0x742a('0x7')](),controller[_0x742a('0xc')]);router[_0x742a('0xd')](_0x742a('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x742a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x742a('0xe')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 85e1c5f..432f2de 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 _0x643a=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','exports'];(function(_0x4c4f07,_0x4d61c5){var _0x4d99b0=function(_0x584fc8){while(--_0x584fc8){_0x4c4f07['push'](_0x4c4f07['shift']());}};_0x4d99b0(++_0x4d61c5);}(_0x643a,0x116));var _0xa643=function(_0x15029f,_0x58be73){_0x15029f=_0x15029f-0x0;var _0x36688c=_0x643a[_0x15029f];return _0x36688c;};'use strict';var Sequelize=require('sequelize');module[_0xa643('0x0')]={'type':{'type':Sequelize[_0xa643('0x1')]('string',_0xa643('0x2'),_0xa643('0x3'),_0xa643('0x4'),_0xa643('0x5')),'defaultValue':_0xa643('0x6')},'content':{'type':Sequelize[_0xa643('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa643('0x1')](_0xa643('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa643('0x7')]},'nameField':{'type':Sequelize[_0xa643('0x7')]},'customField':{'type':Sequelize[_0xa643('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa643('0x7')]}}; \ No newline at end of file +var _0xc9bd=['customVariable','BOOLEAN','sequelize','exports','ENUM','string','keyValue','STRING'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc9bd,0x15a));var _0xdc9b=function(_0x3c04ef,_0x9d110c){_0x3c04ef=_0x3c04ef-0x0;var _0x6a3a69=_0xc9bd[_0x3c04ef];return _0x6a3a69;};'use strict';var Sequelize=require(_0xdc9b('0x0'));module[_0xdc9b('0x1')]={'type':{'type':Sequelize[_0xdc9b('0x2')](_0xdc9b('0x3'),'variable','customVariable',_0xdc9b('0x4'),'picklist'),'defaultValue':_0xdc9b('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdc9b('0x5')]},'keyType':{'type':Sequelize[_0xdc9b('0x2')](_0xdc9b('0x3'),'variable',_0xdc9b('0x6'))},'keyContent':{'type':Sequelize[_0xdc9b('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xdc9b('0x5')]},'customField':{'type':Sequelize[_0xdc9b('0x7')],'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 06e33a5..edaad10 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 _0xc586=['then','sendStatus','error','stack','name','index','rawAttributes','key','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','DeskField','findAll','rows','catch','show','params','intersection','includeAll','include','find','create','body','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','../../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','reject','save','update'];(function(_0x203b89,_0x4865ad){var _0xb5f6f2=function(_0x5ca6b5){while(--_0x5ca6b5){_0x203b89['push'](_0x203b89['shift']());}};_0xb5f6f2(++_0x4865ad);}(_0xc586,0xbb));var _0x6c58=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xc586[_0x26462c];return _0x509a42;};'use strict';var emlformat=require(_0x6c58('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6c58('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c58('0x2'));var moment=require(_0x6c58('0x3'));var BPromise=require(_0x6c58('0x4'));var Mustache=require(_0x6c58('0x5'));var util=require(_0x6c58('0x6'));var path=require(_0x6c58('0x7'));var sox=require(_0x6c58('0x8'));var csv=require(_0x6c58('0x9'));var ejs=require(_0x6c58('0xa'));var fs=require('fs');var fs_extra=require(_0x6c58('0xb'));var _=require(_0x6c58('0xc'));var squel=require('squel');var crypto=require(_0x6c58('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6c58('0xe'));var toCsv=require(_0x6c58('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6c58('0xf'));var qs=require(_0x6c58('0x10'));var as=require(_0x6c58('0x11'));var hardwareService=require(_0x6c58('0x12'));var logger=require(_0x6c58('0x13'))(_0x6c58('0x14'));var utils=require(_0x6c58('0x15'));var config=require(_0x6c58('0x16'));var licenseUtil=require(_0x6c58('0x17'));var db=require(_0x6c58('0x18'))['db'];function respondWithStatusCode(_0x115cf5,_0x73f83e){_0x73f83e=_0x73f83e||0xcc;return function(_0x418515){if(_0x418515){return _0x115cf5['sendStatus'](_0x73f83e);}return _0x115cf5[_0x6c58('0x19')](_0x73f83e)[_0x6c58('0x1a')]();};}function respondWithResult(_0x42c8a3,_0x52ebab){_0x52ebab=_0x52ebab||0xc8;return function(_0x18b294){if(_0x18b294){return _0x42c8a3[_0x6c58('0x19')](_0x52ebab)[_0x6c58('0x1b')](_0x18b294);}};}function respondWithFilteredResult(_0x534110,_0x13ca9f){return function(_0x55ae73){if(_0x55ae73){var _0x4158d7=typeof _0x13ca9f[_0x6c58('0x1c')]===_0x6c58('0x1d')&&typeof _0x13ca9f[_0x6c58('0x1e')]==='undefined';var _0x26981f=_0x55ae73[_0x6c58('0x1f')];var _0x5be926=_0x4158d7?0x0:_0x13ca9f[_0x6c58('0x1c')];var _0x29cecf=_0x4158d7?_0x55ae73[_0x6c58('0x1f')]:_0x13ca9f[_0x6c58('0x1c')]+_0x13ca9f['limit'];var _0x5c9e80;if(_0x29cecf>=_0x26981f){_0x29cecf=_0x26981f;_0x5c9e80=0xc8;}else{_0x5c9e80=0xce;}_0x534110['status'](_0x5c9e80);return _0x534110[_0x6c58('0x20')](_0x6c58('0x21'),_0x5be926+'-'+_0x29cecf+'/'+_0x26981f)[_0x6c58('0x1b')](_0x55ae73);}return null;};}function patchUpdates(_0x231617){return function(_0xb661c6){try{jsonpatch[_0x6c58('0x22')](_0xb661c6,_0x231617,!![]);}catch(_0x232fe4){return BPromise[_0x6c58('0x23')](_0x232fe4);}return _0xb661c6[_0x6c58('0x24')]();};}function saveUpdates(_0x438d4e,_0x7455cf){return function(_0x44793d){if(_0x44793d){return _0x44793d[_0x6c58('0x25')](_0x438d4e)[_0x6c58('0x26')](function(_0x25e4c3){return _0x25e4c3;});}return null;};}function removeEntity(_0x4d0005,_0x883c4e){return function(_0x3c9316){if(_0x3c9316){return _0x3c9316['destroy']()['then'](function(){_0x4d0005['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cb2f5,_0x14b9cc){return function(_0x57cdc7){if(!_0x57cdc7){_0x5cb2f5[_0x6c58('0x27')](0x194);}return _0x57cdc7;};}function handleError(_0x1139cf,_0x4f1ce4){_0x4f1ce4=_0x4f1ce4||0x1f4;return function(_0x4ee634){logger[_0x6c58('0x28')](_0x4ee634[_0x6c58('0x29')]);if(_0x4ee634[_0x6c58('0x2a')]){delete _0x4ee634[_0x6c58('0x2a')];}_0x1139cf[_0x6c58('0x19')](_0x4f1ce4)['send'](_0x4ee634);};}exports[_0x6c58('0x2b')]=function(_0x5edcdb,_0x2dcb09){var _0x5ab0f7={},_0x36b764={},_0x9cd43b={'count':0x0,'rows':[]};var _0x3e2087=_['map'](db['DeskField'][_0x6c58('0x2c')],function(_0x44b7c8){return{'name':_0x44b7c8['fieldName'],'type':_0x44b7c8['type'][_0x6c58('0x2d')]};});_0x36b764[_0x6c58('0x2e')]=_[_0x6c58('0x2f')](_0x3e2087,_0x6c58('0x2a'));_0x36b764[_0x6c58('0x30')]=_[_0x6c58('0x31')](_0x5edcdb[_0x6c58('0x30')]);_0x36b764[_0x6c58('0x32')]=_['intersection'](_0x36b764[_0x6c58('0x2e')],_0x36b764[_0x6c58('0x30')]);_0x5ab0f7['attributes']=_['intersection'](_0x36b764['model'],qs[_0x6c58('0x33')](_0x5edcdb['query'][_0x6c58('0x33')]));_0x5ab0f7['attributes']=_0x5ab0f7[_0x6c58('0x34')][_0x6c58('0x35')]?_0x5ab0f7['attributes']:_0x36b764[_0x6c58('0x2e')];if(!_0x5edcdb[_0x6c58('0x30')][_0x6c58('0x36')](_0x6c58('0x37'))){_0x5ab0f7['limit']=qs[_0x6c58('0x1e')](_0x5edcdb['query'][_0x6c58('0x1e')]);_0x5ab0f7[_0x6c58('0x1c')]=qs[_0x6c58('0x1c')](_0x5edcdb[_0x6c58('0x30')][_0x6c58('0x1c')]);}_0x5ab0f7['order']=qs[_0x6c58('0x38')](_0x5edcdb[_0x6c58('0x30')]['sort']);_0x5ab0f7[_0x6c58('0x39')]=qs[_0x6c58('0x32')](_[_0x6c58('0x3a')](_0x5edcdb[_0x6c58('0x30')],_0x36b764['filters']),_0x3e2087);if(_0x5edcdb[_0x6c58('0x30')]['filter']){_0x5ab0f7[_0x6c58('0x39')]=_[_0x6c58('0x3b')](_0x5ab0f7[_0x6c58('0x39')],{'$or':_[_0x6c58('0x2f')](_0x3e2087,function(_0xc09f97){if(_0xc09f97['type']!==_0x6c58('0x3c')){var _0x485547={};_0x485547[_0xc09f97[_0x6c58('0x2a')]]={'$like':'%'+_0x5edcdb[_0x6c58('0x30')]['filter']+'%'};return _0x485547;}})});}_0x5ab0f7=_[_0x6c58('0x3b')]({},_0x5ab0f7,_0x5edcdb[_0x6c58('0x3d')]);var _0x990f01={'where':_0x5ab0f7[_0x6c58('0x39')]};return db[_0x6c58('0x3e')][_0x6c58('0x1f')](_0x990f01)[_0x6c58('0x26')](function(_0x1d3643){_0x9cd43b['count']=_0x1d3643;if(_0x5edcdb[_0x6c58('0x30')]['includeAll']){_0x5ab0f7['include']=[{'all':!![]}];}return db[_0x6c58('0x3e')][_0x6c58('0x3f')](_0x5ab0f7);})[_0x6c58('0x26')](function(_0x339d33){_0x9cd43b[_0x6c58('0x40')]=_0x339d33;return _0x9cd43b;})[_0x6c58('0x26')](respondWithFilteredResult(_0x2dcb09,_0x5ab0f7))[_0x6c58('0x41')](handleError(_0x2dcb09,null));};exports[_0x6c58('0x42')]=function(_0x562edf,_0xf44243){var _0x171ed7={'raw':!![],'where':{'id':_0x562edf[_0x6c58('0x43')]['id']}},_0x2ca3f4={};_0x2ca3f4[_0x6c58('0x2e')]=_[_0x6c58('0x31')](db['DeskField']['rawAttributes']);_0x2ca3f4[_0x6c58('0x30')]=_[_0x6c58('0x31')](_0x562edf[_0x6c58('0x30')]);_0x2ca3f4[_0x6c58('0x32')]=_[_0x6c58('0x44')](_0x2ca3f4[_0x6c58('0x2e')],_0x2ca3f4[_0x6c58('0x30')]);_0x171ed7[_0x6c58('0x34')]=_[_0x6c58('0x44')](_0x2ca3f4[_0x6c58('0x2e')],qs[_0x6c58('0x33')](_0x562edf[_0x6c58('0x30')][_0x6c58('0x33')]));_0x171ed7['attributes']=_0x171ed7[_0x6c58('0x34')][_0x6c58('0x35')]?_0x171ed7[_0x6c58('0x34')]:_0x2ca3f4[_0x6c58('0x2e')];if(_0x562edf[_0x6c58('0x30')][_0x6c58('0x45')]){_0x171ed7[_0x6c58('0x46')]=[{'all':!![]}];}_0x171ed7=_[_0x6c58('0x3b')]({},_0x171ed7,_0x562edf[_0x6c58('0x3d')]);return db[_0x6c58('0x3e')][_0x6c58('0x47')](_0x171ed7)[_0x6c58('0x26')](handleEntityNotFound(_0xf44243,null))[_0x6c58('0x26')](respondWithResult(_0xf44243,null))[_0x6c58('0x41')](handleError(_0xf44243,null));};exports[_0x6c58('0x48')]=function(_0x22c014,_0x3d0007){return db['DeskField'][_0x6c58('0x48')](_0x22c014[_0x6c58('0x49')],{})[_0x6c58('0x26')](respondWithResult(_0x3d0007,0xc9))[_0x6c58('0x41')](handleError(_0x3d0007,null));};exports[_0x6c58('0x25')]=function(_0x3bef07,_0xd4caff){if(_0x3bef07[_0x6c58('0x49')]['id']){delete _0x3bef07[_0x6c58('0x49')]['id'];}return db['DeskField'][_0x6c58('0x47')]({'where':{'id':_0x3bef07[_0x6c58('0x43')]['id']}})['then'](handleEntityNotFound(_0xd4caff,null))[_0x6c58('0x26')](saveUpdates(_0x3bef07['body'],null))[_0x6c58('0x26')](respondWithResult(_0xd4caff,null))[_0x6c58('0x41')](handleError(_0xd4caff,null));};exports[_0x6c58('0x4a')]=function(_0x292dc2,_0x225226){return db['DeskField']['find']({'where':{'id':_0x292dc2['params']['id']}})[_0x6c58('0x26')](handleEntityNotFound(_0x225226,null))['then'](removeEntity(_0x225226,null))[_0x6c58('0x41')](handleError(_0x225226,null));}; \ No newline at end of file +var _0x1a0b=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','save','update','then','end','stack','name','send','map','DeskField','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','body','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3f55de,_0x3ae98f){var _0x2698de=function(_0x48f021){while(--_0x48f021){_0x3f55de['push'](_0x3f55de['shift']());}};_0x2698de(++_0x3ae98f);}(_0x1a0b,0x18f));var _0xb1a0=function(_0x4495d6,_0x533f52){_0x4495d6=_0x4495d6-0x0;var _0x4b2880=_0x1a0b[_0x4495d6];return _0x4b2880;};'use strict';var emlformat=require(_0xb1a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb1a0('0x1'));var jsonpatch=require(_0xb1a0('0x2'));var rp=require(_0xb1a0('0x3'));var moment=require(_0xb1a0('0x4'));var BPromise=require(_0xb1a0('0x5'));var Mustache=require(_0xb1a0('0x6'));var util=require(_0xb1a0('0x7'));var path=require(_0xb1a0('0x8'));var sox=require(_0xb1a0('0x9'));var csv=require(_0xb1a0('0xa'));var ejs=require(_0xb1a0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb1a0('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb1a0('0xd'));var toCsv=require(_0xb1a0('0xa'));var querystring=require(_0xb1a0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb1a0('0xf'));var qs=require(_0xb1a0('0x10'));var as=require(_0xb1a0('0x11'));var hardwareService=require(_0xb1a0('0x12'));var logger=require(_0xb1a0('0x13'))(_0xb1a0('0x14'));var utils=require('../../config/utils');var config=require(_0xb1a0('0x15'));var licenseUtil=require(_0xb1a0('0x16'));var db=require(_0xb1a0('0x17'))['db'];function respondWithStatusCode(_0x53968c,_0x424554){_0x424554=_0x424554||0xcc;return function(_0x195593){if(_0x195593){return _0x53968c[_0xb1a0('0x18')](_0x424554);}return _0x53968c[_0xb1a0('0x19')](_0x424554)['end']();};}function respondWithResult(_0x236504,_0x209285){_0x209285=_0x209285||0xc8;return function(_0x171d06){if(_0x171d06){return _0x236504[_0xb1a0('0x19')](_0x209285)[_0xb1a0('0x1a')](_0x171d06);}};}function respondWithFilteredResult(_0x3b9724,_0xd160c6){return function(_0x44c05d){if(_0x44c05d){var _0x393c2e=typeof _0xd160c6[_0xb1a0('0x1b')]===_0xb1a0('0x1c')&&typeof _0xd160c6[_0xb1a0('0x1d')]===_0xb1a0('0x1c');var _0x3e6d71=_0x44c05d[_0xb1a0('0x1e')];var _0x223b14=_0x393c2e?0x0:_0xd160c6[_0xb1a0('0x1b')];var _0x4860a1=_0x393c2e?_0x44c05d['count']:_0xd160c6['offset']+_0xd160c6['limit'];var _0x5152e7;if(_0x4860a1>=_0x3e6d71){_0x4860a1=_0x3e6d71;_0x5152e7=0xc8;}else{_0x5152e7=0xce;}_0x3b9724['status'](_0x5152e7);return _0x3b9724['set']('Content-Range',_0x223b14+'-'+_0x4860a1+'/'+_0x3e6d71)[_0xb1a0('0x1a')](_0x44c05d);}return null;};}function patchUpdates(_0xe0d8ce){return function(_0x3af888){try{jsonpatch['apply'](_0x3af888,_0xe0d8ce,!![]);}catch(_0x5020ac){return BPromise[_0xb1a0('0x1f')](_0x5020ac);}return _0x3af888[_0xb1a0('0x20')]();};}function saveUpdates(_0x5bc299,_0x75c04d){return function(_0x59fa26){if(_0x59fa26){return _0x59fa26[_0xb1a0('0x21')](_0x5bc299)[_0xb1a0('0x22')](function(_0x3b2623){return _0x3b2623;});}return null;};}function removeEntity(_0x1a306d,_0x5b0501){return function(_0x15c01d){if(_0x15c01d){return _0x15c01d['destroy']()[_0xb1a0('0x22')](function(){_0x1a306d[_0xb1a0('0x19')](0xcc)[_0xb1a0('0x23')]();});}};}function handleEntityNotFound(_0x10e675,_0x45a486){return function(_0xadb652){if(!_0xadb652){_0x10e675[_0xb1a0('0x18')](0x194);}return _0xadb652;};}function handleError(_0x282119,_0x2e4630){_0x2e4630=_0x2e4630||0x1f4;return function(_0x48499f){logger['error'](_0x48499f[_0xb1a0('0x24')]);if(_0x48499f[_0xb1a0('0x25')]){delete _0x48499f[_0xb1a0('0x25')];}_0x282119['status'](_0x2e4630)[_0xb1a0('0x26')](_0x48499f);};}exports['index']=function(_0x3fff58,_0x5a809f){var _0x38eab3={},_0x1d5ec7={},_0x42ee38={'count':0x0,'rows':[]};var _0x3a6c03=_[_0xb1a0('0x27')](db[_0xb1a0('0x28')][_0xb1a0('0x29')],function(_0x2d997c){return{'name':_0x2d997c[_0xb1a0('0x2a')],'type':_0x2d997c['type'][_0xb1a0('0x2b')]};});_0x1d5ec7[_0xb1a0('0x2c')]=_[_0xb1a0('0x27')](_0x3a6c03,_0xb1a0('0x25'));_0x1d5ec7[_0xb1a0('0x2d')]=_[_0xb1a0('0x2e')](_0x3fff58[_0xb1a0('0x2d')]);_0x1d5ec7['filters']=_['intersection'](_0x1d5ec7[_0xb1a0('0x2c')],_0x1d5ec7[_0xb1a0('0x2d')]);_0x38eab3['attributes']=_[_0xb1a0('0x2f')](_0x1d5ec7[_0xb1a0('0x2c')],qs[_0xb1a0('0x30')](_0x3fff58[_0xb1a0('0x2d')][_0xb1a0('0x30')]));_0x38eab3[_0xb1a0('0x31')]=_0x38eab3[_0xb1a0('0x31')][_0xb1a0('0x32')]?_0x38eab3[_0xb1a0('0x31')]:_0x1d5ec7[_0xb1a0('0x2c')];if(!_0x3fff58[_0xb1a0('0x2d')][_0xb1a0('0x33')](_0xb1a0('0x34'))){_0x38eab3[_0xb1a0('0x1d')]=qs[_0xb1a0('0x1d')](_0x3fff58['query'][_0xb1a0('0x1d')]);_0x38eab3[_0xb1a0('0x1b')]=qs[_0xb1a0('0x1b')](_0x3fff58[_0xb1a0('0x2d')][_0xb1a0('0x1b')]);}_0x38eab3['order']=qs['sort'](_0x3fff58[_0xb1a0('0x2d')][_0xb1a0('0x35')]);_0x38eab3[_0xb1a0('0x36')]=qs[_0xb1a0('0x37')](_[_0xb1a0('0x38')](_0x3fff58[_0xb1a0('0x2d')],_0x1d5ec7['filters']),_0x3a6c03);if(_0x3fff58[_0xb1a0('0x2d')][_0xb1a0('0x39')]){_0x38eab3['where']=_['merge'](_0x38eab3['where'],{'$or':_['map'](_0x3a6c03,function(_0x2e25c2){if(_0x2e25c2['type']!==_0xb1a0('0x3a')){var _0x33efbd={};_0x33efbd[_0x2e25c2[_0xb1a0('0x25')]]={'$like':'%'+_0x3fff58[_0xb1a0('0x2d')][_0xb1a0('0x39')]+'%'};return _0x33efbd;}})});}_0x38eab3=_[_0xb1a0('0x3b')]({},_0x38eab3,_0x3fff58[_0xb1a0('0x3c')]);var _0x1b7d70={'where':_0x38eab3[_0xb1a0('0x36')]};return db[_0xb1a0('0x28')][_0xb1a0('0x1e')](_0x1b7d70)[_0xb1a0('0x22')](function(_0x14a233){_0x42ee38[_0xb1a0('0x1e')]=_0x14a233;if(_0x3fff58['query']['includeAll']){_0x38eab3[_0xb1a0('0x3d')]=[{'all':!![]}];}return db[_0xb1a0('0x28')][_0xb1a0('0x3e')](_0x38eab3);})['then'](function(_0x5cd1c9){_0x42ee38[_0xb1a0('0x3f')]=_0x5cd1c9;return _0x42ee38;})[_0xb1a0('0x22')](respondWithFilteredResult(_0x5a809f,_0x38eab3))[_0xb1a0('0x40')](handleError(_0x5a809f,null));};exports[_0xb1a0('0x41')]=function(_0x390504,_0x4744c9){var _0x7248be={'raw':!![],'where':{'id':_0x390504['params']['id']}},_0x14bf89={};_0x14bf89[_0xb1a0('0x2c')]=_['keys'](db[_0xb1a0('0x28')]['rawAttributes']);_0x14bf89[_0xb1a0('0x2d')]=_[_0xb1a0('0x2e')](_0x390504[_0xb1a0('0x2d')]);_0x14bf89[_0xb1a0('0x37')]=_['intersection'](_0x14bf89['model'],_0x14bf89['query']);_0x7248be['attributes']=_['intersection'](_0x14bf89[_0xb1a0('0x2c')],qs[_0xb1a0('0x30')](_0x390504[_0xb1a0('0x2d')][_0xb1a0('0x30')]));_0x7248be[_0xb1a0('0x31')]=_0x7248be['attributes'][_0xb1a0('0x32')]?_0x7248be[_0xb1a0('0x31')]:_0x14bf89[_0xb1a0('0x2c')];if(_0x390504[_0xb1a0('0x2d')][_0xb1a0('0x42')]){_0x7248be[_0xb1a0('0x3d')]=[{'all':!![]}];}_0x7248be=_['merge']({},_0x7248be,_0x390504[_0xb1a0('0x3c')]);return db[_0xb1a0('0x28')]['find'](_0x7248be)[_0xb1a0('0x22')](handleEntityNotFound(_0x4744c9,null))[_0xb1a0('0x22')](respondWithResult(_0x4744c9,null))[_0xb1a0('0x40')](handleError(_0x4744c9,null));};exports['create']=function(_0x5edc8b,_0x14c3ea){return db[_0xb1a0('0x28')]['create'](_0x5edc8b[_0xb1a0('0x43')],{})[_0xb1a0('0x22')](respondWithResult(_0x14c3ea,0xc9))[_0xb1a0('0x40')](handleError(_0x14c3ea,null));};exports[_0xb1a0('0x21')]=function(_0x303d91,_0x15678c){if(_0x303d91[_0xb1a0('0x43')]['id']){delete _0x303d91[_0xb1a0('0x43')]['id'];}return db[_0xb1a0('0x28')][_0xb1a0('0x44')]({'where':{'id':_0x303d91[_0xb1a0('0x45')]['id']}})['then'](handleEntityNotFound(_0x15678c,null))[_0xb1a0('0x22')](saveUpdates(_0x303d91['body'],null))[_0xb1a0('0x22')](respondWithResult(_0x15678c,null))[_0xb1a0('0x40')](handleError(_0x15678c,null));};exports['destroy']=function(_0x15012b,_0x1b1d53){return db[_0xb1a0('0x28')][_0xb1a0('0x44')]({'where':{'id':_0x15012b[_0xb1a0('0x45')]['id']}})[_0xb1a0('0x22')](handleEntityNotFound(_0x1b1d53,null))[_0xb1a0('0x22')](removeEntity(_0x1b1d53,null))[_0xb1a0('0x40')](handleError(_0x1b1d53,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index f3db8a0..52ddfdf 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 _0x30a1=['request-promise','rimraf','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xa13e1b,_0x34b798){var _0x16bd70=function(_0x103b3e){while(--_0x103b3e){_0xa13e1b['push'](_0xa13e1b['shift']());}};_0x16bd70(++_0x34b798);}(_0x30a1,0xba));var _0x130a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x30a1[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x130a('0x0'));var util=require(_0x130a('0x1'));var logger=require(_0x130a('0x2'))(_0x130a('0x3'));var moment=require(_0x130a('0x4'));var BPromise=require(_0x130a('0x5'));var rp=require(_0x130a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x130a('0x7'));var config=require('../../config/environment');var attributes=require(_0x130a('0x8'));module[_0x130a('0x9')]=function(_0x4ae81d,_0x52d63e){return _0x4ae81d[_0x130a('0xa')](_0x130a('0xb'),attributes,{'tableName':_0x130a('0xc'),'paranoid':![],'indexes':[{'name':_0x130a('0xd'),'fields':[_0x130a('0xe'),_0x130a('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7445=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','int_desk_fields','desk_unique_index','idField','FieldId'];(function(_0x19f408,_0x233be9){var _0x482680=function(_0x928f77){while(--_0x928f77){_0x19f408['push'](_0x19f408['shift']());}};_0x482680(++_0x233be9);}(_0x7445,0xb4));var _0x5744=function(_0x3011b7,_0x56b4b0){_0x3011b7=_0x3011b7-0x0;var _0x304ca2=_0x7445[_0x3011b7];return _0x304ca2;};'use strict';var _=require(_0x5744('0x0'));var util=require(_0x5744('0x1'));var logger=require(_0x5744('0x2'))(_0x5744('0x3'));var moment=require(_0x5744('0x4'));var BPromise=require(_0x5744('0x5'));var rp=require(_0x5744('0x6'));var fs=require('fs');var path=require(_0x5744('0x7'));var rimraf=require(_0x5744('0x8'));var config=require(_0x5744('0x9'));var attributes=require('./intDeskField.attributes');module['exports']=function(_0x128717,_0x1481a4){return _0x128717[_0x5744('0xa')]('DeskField',attributes,{'tableName':_0x5744('0xb'),'paranoid':![],'indexes':[{'name':_0x5744('0xc'),'fields':[_0x5744('0xd'),_0x5744('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 991d95a..07f8275 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 _0x1fe3=['debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x1761be,_0x1374da){var _0x3b0286=function(_0xdec1ee){while(--_0xdec1ee){_0x1761be['push'](_0x1761be['shift']());}};_0x3b0286(++_0x1374da);}(_0x1fe3,0xb0));var _0x31fe=function(_0x1f07c2,_0x3fb9b6){_0x1f07c2=_0x1f07c2-0x0;var _0x245f1d=_0x1fe3[_0x1f07c2];return _0x245f1d;};'use strict';var _=require(_0x31fe('0x0'));var util=require(_0x31fe('0x1'));var moment=require(_0x31fe('0x2'));var BPromise=require(_0x31fe('0x3'));var rs=require(_0x31fe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31fe('0x5'))['db'];var utils=require(_0x31fe('0x6'));var logger=require(_0x31fe('0x7'))(_0x31fe('0x8'));var config=require('../../config/environment');var jayson=require(_0x31fe('0x9'));var client=jayson[_0x31fe('0xa')][_0x31fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c3370,_0x4275c8,_0x56a192){return new BPromise(function(_0x1370dd,_0x44d0f){return client['request'](_0x1c3370,_0x56a192)[_0x31fe('0xc')](function(_0xe529ce){logger[_0x31fe('0xd')](_0x31fe('0xe'),_0x4275c8,_0x31fe('0xf'));logger[_0x31fe('0x10')](_0x31fe('0x11'),_0x4275c8,_0x31fe('0xf'),JSON[_0x31fe('0x12')](_0xe529ce));if(_0xe529ce[_0x31fe('0x13')]){if(_0xe529ce['error'][_0x31fe('0x14')]===0x1f4){logger[_0x31fe('0x13')]('DeskField,\x20%s,\x20%s',_0x4275c8,_0xe529ce['error'][_0x31fe('0x15')]);return _0x44d0f(_0xe529ce['error'][_0x31fe('0x15')]);}logger[_0x31fe('0x13')](_0x31fe('0xe'),_0x4275c8,_0xe529ce[_0x31fe('0x13')][_0x31fe('0x15')]);return _0x1370dd(_0xe529ce[_0x31fe('0x13')][_0x31fe('0x15')]);}else{logger[_0x31fe('0xd')]('DeskField,\x20%s,\x20%s',_0x4275c8,_0x31fe('0xf'));_0x1370dd(_0xe529ce[_0x31fe('0x16')]['message']);}})[_0x31fe('0x17')](function(_0x368bf2){logger['error'](_0x31fe('0xe'),_0x4275c8,_0x368bf2);_0x44d0f(_0x368bf2);});});} \ No newline at end of file +var _0xac33=['debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0xf5a47b,_0x23c874){var _0x5553b8=function(_0x5728dc){while(--_0x5728dc){_0xf5a47b['push'](_0xf5a47b['shift']());}};_0x5553b8(++_0x23c874);}(_0xac33,0x1a6));var _0x3ac3=function(_0x5c4d5d,_0x46778b){_0x5c4d5d=_0x5c4d5d-0x0;var _0x465cde=_0xac33[_0x5c4d5d];return _0x465cde;};'use strict';var _=require(_0x3ac3('0x0'));var util=require(_0x3ac3('0x1'));var moment=require(_0x3ac3('0x2'));var BPromise=require(_0x3ac3('0x3'));var rs=require(_0x3ac3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3ac3('0x5'));var logger=require('../../config/logger')(_0x3ac3('0x6'));var config=require(_0x3ac3('0x7'));var jayson=require(_0x3ac3('0x8'));var client=jayson[_0x3ac3('0x9')][_0x3ac3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45883c,_0x26210d,_0x3c7bc8){return new BPromise(function(_0x2f5edc,_0x269dae){return client[_0x3ac3('0xb')](_0x45883c,_0x3c7bc8)[_0x3ac3('0xc')](function(_0xd423e0){logger[_0x3ac3('0xd')]('DeskField,\x20%s,\x20%s',_0x26210d,_0x3ac3('0xe'));logger[_0x3ac3('0xf')](_0x3ac3('0x10'),_0x26210d,_0x3ac3('0xe'),JSON[_0x3ac3('0x11')](_0xd423e0));if(_0xd423e0[_0x3ac3('0x12')]){if(_0xd423e0[_0x3ac3('0x12')][_0x3ac3('0x13')]===0x1f4){logger['error'](_0x3ac3('0x14'),_0x26210d,_0xd423e0[_0x3ac3('0x12')][_0x3ac3('0x15')]);return _0x269dae(_0xd423e0[_0x3ac3('0x12')][_0x3ac3('0x15')]);}logger[_0x3ac3('0x12')](_0x3ac3('0x14'),_0x26210d,_0xd423e0[_0x3ac3('0x12')][_0x3ac3('0x15')]);return _0x2f5edc(_0xd423e0[_0x3ac3('0x12')]['message']);}else{logger['info'](_0x3ac3('0x14'),_0x26210d,_0x3ac3('0xe'));_0x2f5edc(_0xd423e0['result'][_0x3ac3('0x15')]);}})[_0x3ac3('0x16')](function(_0x236440){logger[_0x3ac3('0x12')](_0x3ac3('0x14'),_0x26210d,_0x236440);_0x269dae(_0x236440);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index fabf9c0..4ab73eb 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 _0xf974=['../../components/auth/service','../../config/environment','./intDynamics365Account.controller','index','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x2adf18,_0x45a2c9){var _0x1891d=function(_0x4bffb8){while(--_0x4bffb8){_0x2adf18['push'](_0x2adf18['shift']());}};_0x1891d(++_0x45a2c9);}(_0xf974,0x1de));var _0x4f97=function(_0xbc8a91,_0x216caf){_0xbc8a91=_0xbc8a91-0x0;var _0x3d82b6=_0xf974[_0xbc8a91];return _0x3d82b6;};'use strict';var multer=require(_0x4f97('0x0'));var util=require(_0x4f97('0x1'));var path=require('path');var timeout=require(_0x4f97('0x2'));var express=require('express');var router=express[_0x4f97('0x3')]();var fs_extra=require(_0x4f97('0x4'));var auth=require(_0x4f97('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4f97('0x6'));var controller=require(_0x4f97('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x4f97('0x8')]);router[_0x4f97('0x9')](_0x4f97('0xa'),auth[_0x4f97('0xb')](),controller['show']);router[_0x4f97('0x9')](_0x4f97('0xc'),auth[_0x4f97('0xb')](),controller[_0x4f97('0xd')]);router[_0x4f97('0x9')](_0x4f97('0xe'),auth['isAuthenticated'](),controller[_0x4f97('0xf')]);router[_0x4f97('0x10')]('/',auth['isAuthenticated'](),controller[_0x4f97('0x11')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x4f97('0x12')]);router[_0x4f97('0x13')](_0x4f97('0xa'),auth[_0x4f97('0xb')](),controller['update']);router[_0x4f97('0x14')](_0x4f97('0xa'),auth[_0x4f97('0xb')](),controller[_0x4f97('0x15')]);module[_0x4f97('0x16')]=router; \ No newline at end of file +var _0x868a=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','delete','exports','multer'];(function(_0xfe3f61,_0x243862){var _0x15c5ac=function(_0x141698){while(--_0x141698){_0xfe3f61['push'](_0xfe3f61['shift']());}};_0x15c5ac(++_0x243862);}(_0x868a,0x141));var _0xa868=function(_0x1802e3,_0x18bac7){_0x1802e3=_0x1802e3-0x0;var _0x4d067c=_0x868a[_0x1802e3];return _0x4d067c;};'use strict';var multer=require(_0xa868('0x0'));var util=require(_0xa868('0x1'));var path=require('path');var timeout=require(_0xa868('0x2'));var express=require(_0xa868('0x3'));var router=express[_0xa868('0x4')]();var fs_extra=require(_0xa868('0x5'));var auth=require(_0xa868('0x6'));var interaction=require(_0xa868('0x7'));var config=require('../../config/environment');var controller=require(_0xa868('0x8'));router[_0xa868('0x9')]('/',auth[_0xa868('0xa')](),controller[_0xa868('0xb')]);router['get'](_0xa868('0xc'),auth[_0xa868('0xa')](),controller[_0xa868('0xd')]);router[_0xa868('0x9')](_0xa868('0xe'),auth[_0xa868('0xa')](),controller[_0xa868('0xf')]);router[_0xa868('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xa868('0x10')]);router[_0xa868('0x11')]('/',auth['isAuthenticated'](),controller[_0xa868('0x12')]);router[_0xa868('0x11')](_0xa868('0xe'),auth[_0xa868('0xa')](),controller[_0xa868('0x13')]);router[_0xa868('0x14')](_0xa868('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa868('0x15')](_0xa868('0xc'),auth[_0xa868('0xa')](),controller['destroy']);module[_0xa868('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 466fd8d..09a3472 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 _0x1a44=['BOOLEAN','sequelize','STRING'];(function(_0x3a6e4b,_0x118cd9){var _0x36572d=function(_0x2a53cf){while(--_0x2a53cf){_0x3a6e4b['push'](_0x3a6e4b['shift']());}};_0x36572d(++_0x118cd9);}(_0x1a44,0xc4));var _0x41a4=function(_0x3a6cf7,_0x11aabb){_0x3a6cf7=_0x3a6cf7-0x0;var _0x5942e9=_0x1a44[_0x3a6cf7];return _0x5942e9;};'use strict';var Sequelize=require(_0x41a4('0x0'));module['exports']={'name':{'type':Sequelize[_0x41a4('0x1')]},'username':{'type':Sequelize[_0x41a4('0x1')]},'password':{'type':Sequelize[_0x41a4('0x1')]},'remoteUri':{'type':Sequelize[_0x41a4('0x1')]},'tenantId':{'type':Sequelize[_0x41a4('0x1')]},'clientId':{'type':Sequelize[_0x41a4('0x1')]},'clientSecret':{'type':Sequelize[_0x41a4('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x41a4('0x1')]},'modernAuthentication':{'type':Sequelize[_0x41a4('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x04f1=['exports','STRING','sequelize'];(function(_0x31e92f,_0x2c19d1){var _0x448e87=function(_0x224524){while(--_0x224524){_0x31e92f['push'](_0x31e92f['shift']());}};_0x448e87(++_0x2c19d1);}(_0x04f1,0x92));var _0x104f=function(_0x740ca3,_0x197fd3){_0x740ca3=_0x740ca3-0x0;var _0x42d5f2=_0x04f1[_0x740ca3];return _0x42d5f2;};'use strict';var Sequelize=require(_0x104f('0x0'));module[_0x104f('0x1')]={'name':{'type':Sequelize[_0x104f('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x104f('0x2')]},'tenantId':{'type':Sequelize[_0x104f('0x2')]},'clientId':{'type':Sequelize[_0x104f('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'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 3ca81c5..f2f3753 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 _0x8ba2=['rawAttributes','create','body','find','findOne','Dynamics365Configuration','getConfigurations','nolimit','AccountId','getDescriptions','channel','Dynamics365Field','Subjects','Descriptions','slice','lastIndexOf','format','%s/api/data/v9.0/','ticketType','PhoneCall','title','customerid','ownerid','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','sentimentvalue','slainvokedidname','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','clientId','modernAuthentication','CloudProvider','data5','data7','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','stack',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','DisplayName','request-promise','util','lodash','../../config/logger','api','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','then','end','sendStatus','name','send','index','map','Dynamics365Account','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x5d6903,_0x328bba){var _0x4ecf66=function(_0x381c72){while(--_0x381c72){_0x5d6903['push'](_0x5d6903['shift']());}};_0x4ecf66(++_0x328bba);}(_0x8ba2,0x13f));var _0x28ba=function(_0x51d7f4,_0x2c0e45){_0x51d7f4=_0x51d7f4-0x0;var _0x551fa7=_0x8ba2[_0x51d7f4];return _0x551fa7;};'use strict';var rp=require(_0x28ba('0x0'));var util=require(_0x28ba('0x1'));var _=require(_0x28ba('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x28ba('0x3'))(_0x28ba('0x4'));var db=require(_0x28ba('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x468a48,_0x1d7725){_0x1d7725=_0x1d7725||0xc8;return function(_0x10d57d){if(_0x10d57d){return _0x468a48[_0x28ba('0x6')](_0x1d7725)[_0x28ba('0x7')](_0x10d57d);}};}function respondWithFilteredResult(_0x24cbfc,_0x4f2e1f){return function(_0x5aa8bf){if(_0x5aa8bf){var _0x19eb24=typeof _0x4f2e1f[_0x28ba('0x8')]==='undefined'&&typeof _0x4f2e1f[_0x28ba('0x9')]===_0x28ba('0xa');var _0x28b3fd=_0x5aa8bf[_0x28ba('0xb')];var _0x6b7d7=_0x19eb24?0x0:_0x4f2e1f[_0x28ba('0x8')];var _0x10cc2d=_0x19eb24?_0x5aa8bf[_0x28ba('0xb')]:_0x4f2e1f[_0x28ba('0x8')]+_0x4f2e1f[_0x28ba('0x9')];var _0x55a323;if(_0x10cc2d>=_0x28b3fd){_0x10cc2d=_0x28b3fd;_0x55a323=0xc8;}else{_0x55a323=0xce;}_0x24cbfc[_0x28ba('0x6')](_0x55a323);return _0x24cbfc[_0x28ba('0xc')](_0x28ba('0xd'),_0x6b7d7+'-'+_0x10cc2d+'/'+_0x28b3fd)[_0x28ba('0x7')](_0x5aa8bf);}return null;};}function saveUpdates(_0x1204af){return function(_0x3a9644){if(_0x3a9644){return _0x3a9644[_0x28ba('0xe')](_0x1204af)['then'](function(_0x305deb){return _0x305deb;});}return null;};}function removeEntity(_0x3cf923){return function(_0x4ebcd6){if(_0x4ebcd6){return _0x4ebcd6[_0x28ba('0xf')]()[_0x28ba('0x10')](function(){_0x3cf923[_0x28ba('0x6')](0xcc)[_0x28ba('0x11')]();});}};}function handleEntityNotFound(_0x563797){return function(_0x24b3f3){if(!_0x24b3f3){_0x563797[_0x28ba('0x12')](0x194);}return _0x24b3f3;};}function handleError(_0x3ae8c5,_0x179728){_0x179728=_0x179728||0x1f4;return function(_0x25f73c){logger['error'](_0x25f73c['stack']);if(_0x25f73c[_0x28ba('0x13')]){delete _0x25f73c[_0x28ba('0x13')];}_0x3ae8c5[_0x28ba('0x6')](_0x179728)[_0x28ba('0x14')](_0x25f73c);};}exports[_0x28ba('0x15')]=function(_0x24e127,_0xbc7b1a){var _0x31a45b={},_0x3f8b52={},_0x582789={'count':0x0,'rows':[]};var _0x4d0961=_[_0x28ba('0x16')](db[_0x28ba('0x17')]['rawAttributes'],function(_0x5c9567){return{'name':_0x5c9567[_0x28ba('0x18')],'type':_0x5c9567[_0x28ba('0x19')][_0x28ba('0x1a')]};});_0x3f8b52[_0x28ba('0x1b')]=_[_0x28ba('0x16')](_0x4d0961,'name');_0x3f8b52[_0x28ba('0x1c')]=_[_0x28ba('0x1d')](_0x24e127[_0x28ba('0x1c')]);_0x3f8b52[_0x28ba('0x1e')]=_[_0x28ba('0x1f')](_0x3f8b52[_0x28ba('0x1b')],_0x3f8b52['query']);_0x31a45b[_0x28ba('0x20')]=_[_0x28ba('0x1f')](_0x3f8b52[_0x28ba('0x1b')],qs[_0x28ba('0x21')](_0x24e127[_0x28ba('0x1c')][_0x28ba('0x21')]));_0x31a45b['attributes']=_0x31a45b[_0x28ba('0x20')][_0x28ba('0x22')]?_0x31a45b['attributes']:_0x3f8b52['model'];if(!_0x24e127[_0x28ba('0x1c')][_0x28ba('0x23')]('nolimit')){_0x31a45b['limit']=qs[_0x28ba('0x9')](_0x24e127[_0x28ba('0x1c')][_0x28ba('0x9')]);_0x31a45b[_0x28ba('0x8')]=qs[_0x28ba('0x8')](_0x24e127[_0x28ba('0x1c')][_0x28ba('0x8')]);}_0x31a45b[_0x28ba('0x24')]=qs[_0x28ba('0x25')](_0x24e127[_0x28ba('0x1c')][_0x28ba('0x25')]);_0x31a45b[_0x28ba('0x26')]=qs[_0x28ba('0x1e')](_[_0x28ba('0x27')](_0x24e127['query'],_0x3f8b52[_0x28ba('0x1e')]),_0x4d0961);if(_0x24e127[_0x28ba('0x1c')][_0x28ba('0x28')]){_0x31a45b['where']=_[_0x28ba('0x29')](_0x31a45b[_0x28ba('0x26')],{'$or':_[_0x28ba('0x16')](_0x4d0961,function(_0x4b45fe){if(_0x4b45fe[_0x28ba('0x19')]!==_0x28ba('0x2a')){var _0x1d92ae={};_0x1d92ae[_0x4b45fe[_0x28ba('0x13')]]={'$like':'%'+_0x24e127[_0x28ba('0x1c')][_0x28ba('0x28')]+'%'};return _0x1d92ae;}})});}_0x31a45b=_[_0x28ba('0x29')]({},_0x31a45b,_0x24e127[_0x28ba('0x2b')]);var _0x29b2a0={'where':_0x31a45b[_0x28ba('0x26')]};return db['Dynamics365Account'][_0x28ba('0xb')](_0x29b2a0)[_0x28ba('0x10')](function(_0xdb0d5b){_0x582789['count']=_0xdb0d5b;if(_0x24e127[_0x28ba('0x1c')][_0x28ba('0x2c')]){_0x31a45b[_0x28ba('0x2d')]=[{'all':!![]}];}return db[_0x28ba('0x17')][_0x28ba('0x2e')](_0x31a45b);})[_0x28ba('0x10')](function(_0x4033e6){_0x582789[_0x28ba('0x2f')]=_0x4033e6;return _0x582789;})[_0x28ba('0x10')](respondWithFilteredResult(_0xbc7b1a,_0x31a45b))[_0x28ba('0x30')](handleError(_0xbc7b1a,null));};exports[_0x28ba('0x31')]=function(_0x5e2fcf,_0x5b3630){var _0x4c4c4d={'raw':![],'where':{'id':_0x5e2fcf[_0x28ba('0x32')]['id']}},_0x4ef4f0={};_0x4ef4f0[_0x28ba('0x1b')]=_['keys'](db[_0x28ba('0x17')][_0x28ba('0x33')]);_0x4ef4f0['query']=_['keys'](_0x5e2fcf[_0x28ba('0x1c')]);_0x4ef4f0[_0x28ba('0x1e')]=_['intersection'](_0x4ef4f0['model'],_0x4ef4f0[_0x28ba('0x1c')]);_0x4c4c4d[_0x28ba('0x20')]=_[_0x28ba('0x1f')](_0x4ef4f0[_0x28ba('0x1b')],qs[_0x28ba('0x21')](_0x5e2fcf[_0x28ba('0x1c')][_0x28ba('0x21')]));_0x4c4c4d[_0x28ba('0x20')]=_0x4c4c4d[_0x28ba('0x20')]['length']?_0x4c4c4d['attributes']:_0x4ef4f0['model'];if(_0x5e2fcf[_0x28ba('0x1c')][_0x28ba('0x2c')]){_0x4c4c4d[_0x28ba('0x2d')]=[{'all':!![]}];}_0x4c4c4d=_[_0x28ba('0x29')]({},_0x4c4c4d,_0x5e2fcf[_0x28ba('0x2b')]);return db['Dynamics365Account']['find'](_0x4c4c4d)['then'](handleEntityNotFound(_0x5b3630,null))[_0x28ba('0x10')](respondWithResult(_0x5b3630,null))[_0x28ba('0x30')](handleError(_0x5b3630,null));};exports[_0x28ba('0x34')]=function(_0x12c046,_0x4071d0){return db['Dynamics365Account'][_0x28ba('0x34')](_0x12c046[_0x28ba('0x35')],{})[_0x28ba('0x10')](respondWithResult(_0x4071d0,0xc9))[_0x28ba('0x30')](handleError(_0x4071d0,null));};exports[_0x28ba('0xe')]=function(_0x2f8605,_0x1977e7){if(_0x2f8605[_0x28ba('0x35')]['id']){delete _0x2f8605[_0x28ba('0x35')]['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0x2f8605[_0x28ba('0x32')]['id']}})[_0x28ba('0x10')](handleEntityNotFound(_0x1977e7,null))[_0x28ba('0x10')](saveUpdates(_0x2f8605[_0x28ba('0x35')],null))[_0x28ba('0x10')](respondWithResult(_0x1977e7,null))['catch'](handleError(_0x1977e7,null));};exports['destroy']=function(_0x5169d5,_0x4cf329){return db[_0x28ba('0x17')][_0x28ba('0x36')]({'where':{'id':_0x5169d5[_0x28ba('0x32')]['id']}})[_0x28ba('0x10')](handleEntityNotFound(_0x4cf329,null))[_0x28ba('0x10')](removeEntity(_0x4cf329,null))[_0x28ba('0x30')](handleError(_0x4cf329,null));};exports['getConfigurations']=function(_0x79c14,_0x38fac1){var _0x54b2c9={};var _0x57ff78={};var _0x2585f4;var _0x4e31c2;return db[_0x28ba('0x17')][_0x28ba('0x37')]({'where':{'id':_0x79c14['params']['id']}})[_0x28ba('0x10')](handleEntityNotFound(_0x38fac1,null))['then'](function(_0x52b4ed){if(_0x52b4ed){_0x2585f4=_0x52b4ed;_0x57ff78['model']=_[_0x28ba('0x1d')](db[_0x28ba('0x38')][_0x28ba('0x33')]);_0x57ff78[_0x28ba('0x1c')]=_[_0x28ba('0x1d')](_0x79c14[_0x28ba('0x1c')]);_0x57ff78['filters']=_[_0x28ba('0x1f')](_0x57ff78['model'],_0x57ff78['query']);_0x54b2c9[_0x28ba('0x20')]=_[_0x28ba('0x1f')](_0x57ff78[_0x28ba('0x1b')],qs[_0x28ba('0x21')](_0x79c14['query'][_0x28ba('0x21')]));_0x54b2c9['attributes']=_0x54b2c9['attributes'][_0x28ba('0x22')]?_0x54b2c9[_0x28ba('0x20')]:_0x57ff78[_0x28ba('0x1b')];_0x54b2c9[_0x28ba('0x24')]=qs[_0x28ba('0x25')](_0x79c14[_0x28ba('0x1c')][_0x28ba('0x25')]);_0x54b2c9[_0x28ba('0x26')]=qs['filters'](_[_0x28ba('0x27')](_0x79c14[_0x28ba('0x1c')],_0x57ff78[_0x28ba('0x1e')]));if(_0x79c14[_0x28ba('0x1c')][_0x28ba('0x28')]){_0x54b2c9['where']=_[_0x28ba('0x29')](_0x54b2c9[_0x28ba('0x26')],{'$or':_[_0x28ba('0x16')](_0x54b2c9['attributes'],function(_0x177ceb){var _0x8d5f43={};_0x8d5f43[_0x177ceb]={'$like':'%'+_0x79c14[_0x28ba('0x1c')][_0x28ba('0x28')]+'%'};return _0x8d5f43;})});}_0x54b2c9=_[_0x28ba('0x29')]({},_0x54b2c9,_0x79c14['options']);return _0x2585f4[_0x28ba('0x39')](_0x54b2c9);}})[_0x28ba('0x10')](function(_0x4ec37b){if(_0x4ec37b){_0x4e31c2=_0x4ec37b[_0x28ba('0x22')];if(!_0x79c14[_0x28ba('0x1c')][_0x28ba('0x23')](_0x28ba('0x3a'))){_0x54b2c9[_0x28ba('0x9')]=qs[_0x28ba('0x9')](_0x79c14[_0x28ba('0x1c')][_0x28ba('0x9')]);_0x54b2c9[_0x28ba('0x8')]=qs[_0x28ba('0x8')](_0x79c14[_0x28ba('0x1c')]['offset']);}return _0x2585f4[_0x28ba('0x39')](_0x54b2c9);}})[_0x28ba('0x10')](function(_0x329ac5){if(_0x329ac5){return _0x329ac5?{'count':_0x4e31c2,'rows':_0x329ac5}:null;}})[_0x28ba('0x10')](respondWithResult(_0x38fac1,null))[_0x28ba('0x30')](handleError(_0x38fac1,null));};exports['addConfiguration']=function(_0x3efa75,_0x1d83ff){if(_0x3efa75[_0x28ba('0x35')]['id']){delete _0x3efa75[_0x28ba('0x35')]['id'];}return db[_0x28ba('0x17')][_0x28ba('0x37')]({'where':{'id':_0x3efa75[_0x28ba('0x32')]['id']}})['then'](handleEntityNotFound(_0x1d83ff,null))[_0x28ba('0x10')](function(_0x43f985){if(_0x43f985){_0x3efa75['body'][_0x28ba('0x3b')]=_0x43f985['id'];_0x3efa75[_0x28ba('0x35')]['Subjects']=integrations['getSubjects'](_0x3efa75['body']['channel'],_0x3efa75[_0x28ba('0x35')][_0x28ba('0x19')]);_0x3efa75['body']['Descriptions']=integrations[_0x28ba('0x3c')](_0x3efa75[_0x28ba('0x35')][_0x28ba('0x3d')],_0x3efa75['body'][_0x28ba('0x19')]);return db[_0x28ba('0x38')][_0x28ba('0x34')](_0x3efa75[_0x28ba('0x35')],{'include':[{'model':db[_0x28ba('0x3e')],'as':_0x28ba('0x3f')},{'model':db[_0x28ba('0x3e')],'as':_0x28ba('0x40')}]});}return null;})[_0x28ba('0x10')](respondWithResult(_0x1d83ff,null))['catch'](handleError(_0x1d83ff,null));};function sanitizeRemoteUri(_0x193cdd){var _0x4f5917=_0x193cdd[_0x28ba('0x41')](-0x1);if(_0x4f5917==='/')return _0x193cdd['substring'](0x0,_0x193cdd[_0x28ba('0x42')](_0x4f5917));return _0x193cdd;}function getWebApiUrl(_0x5c9f34){return util[_0x28ba('0x43')](_0x28ba('0x44'),_0x5c9f34);}exports['getFields']=function(_0x53e6e4,_0x250957){var _0xd9b819=_0x53e6e4[_0x28ba('0x1c')][_0x28ba('0x45')];var _0x2bd2fc=_0xd9b819==='incident'?'Incident':_0x28ba('0x46');var _0x3a309a='';var _0xd602a4='';var _0x559415='';var _0x5859b1='';var _0xdf984b='';var _0x4d3ab3='';var _0x433f72='';var _0x25b9e9='';var _0x2e0536=[_0x28ba('0x47'),'description',_0x28ba('0x48'),_0x28ba('0x49'),'caseorigincode','subject',_0x28ba('0x4a'),_0x28ba('0x4b'),_0x28ba('0x4c'),_0x28ba('0x4d')];var _0x48e4a2=[_0x28ba('0x4e'),_0x28ba('0x4f'),'actualserviceunits',_0x28ba('0x50'),_0x28ba('0x51'),_0x28ba('0x52'),'contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame',_0x28ba('0x53'),_0x28ba('0x54'),_0x28ba('0x55'),_0x28ba('0x56'),'createdonbehalfbyyominame',_0x28ba('0x57'),_0x28ba('0x58'),_0x28ba('0x59'),'emailaddress',_0x28ba('0x5a'),_0x28ba('0x5b'),'entityimage_url',_0x28ba('0x5c'),_0x28ba('0x5d'),_0x28ba('0x5e'),_0x28ba('0x5f'),_0x28ba('0x60'),'influencescore',_0x28ba('0x61'),'lastonholdtime',_0x28ba('0x62'),_0x28ba('0x63'),_0x28ba('0x64'),_0x28ba('0x65'),_0x28ba('0x66'),_0x28ba('0x67'),_0x28ba('0x68'),_0x28ba('0x69'),_0x28ba('0x6a'),_0x28ba('0x6b'),_0x28ba('0x6c'),'onholdtime',_0x28ba('0x6d'),'owneridname',_0x28ba('0x6e'),_0x28ba('0x6f'),_0x28ba('0x70'),'primarycontactidname',_0x28ba('0x71'),_0x28ba('0x72'),_0x28ba('0x73'),_0x28ba('0x74'),_0x28ba('0x75'),'resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame',_0x28ba('0x76'),_0x28ba('0x77'),'slaname','socialprofileidname','statecode',_0x28ba('0x78'),_0x28ba('0x79'),'ticketnumber',_0x28ba('0x7a'),_0x28ba('0x7b'),_0x28ba('0x7c'),_0x28ba('0x7d'),_0x28ba('0x7e')];var _0x2d1a3a=_0x2e0536[_0x28ba('0x7f')](_0x48e4a2);return db[_0x28ba('0x17')]['findOne']({'where':{'id':_0x53e6e4['params']['id']},'attributes':['id',_0x28ba('0x80'),_0x28ba('0x81'),'remoteUri','tenantId',_0x28ba('0x82'),'clientSecret',_0x28ba('0x83')],'include':[{'model':db['CloudProvider'],'as':_0x28ba('0x84'),'attributes':['id',_0x28ba('0x85'),_0x28ba('0x86')]}]})[_0x28ba('0x10')](handleEntityNotFound(_0x250957,null))[_0x28ba('0x10')](function(_0x49df4f){if(_0x49df4f){if(_0x49df4f[_0x28ba('0x83')]){_0x49df4f['access_token']=_0x49df4f[_0x28ba('0x84')][_0x28ba('0x85')];_0x25b9e9=sanitizeRemoteUri(_0x49df4f[_0x28ba('0x84')][_0x28ba('0x86')]);_0x433f72=getWebApiUrl(_0x25b9e9);return _0x49df4f;}_0x25b9e9=sanitizeRemoteUri(_0x49df4f['remoteUri']);_0x433f72=getWebApiUrl(_0x25b9e9);var _0x30e639={'method':_0x28ba('0x87'),'uri':_0x28ba('0x88')+_0x49df4f[_0x28ba('0x89')]+_0x28ba('0x8a'),'form':{'client_id':_0x49df4f[_0x28ba('0x82')],'resource':_0x25b9e9,'username':_0x49df4f[_0x28ba('0x80')],'password':_0x49df4f[_0x28ba('0x81')],'grant_type':_0x28ba('0x81'),'client_secret':_0x49df4f['clientSecret']},'json':!![]};return rp(_0x30e639);}})[_0x28ba('0x10')](function(_0x30ca5d){_0x4d3ab3=_0x30ca5d[_0x28ba('0x8b')];var _0x4e920f={'method':_0x28ba('0x8c'),'uri':encodeURI(_0x433f72+_0x28ba('0x8d')+_0x2bd2fc+'\x27'),'headers':{'Authorization':_0x28ba('0x8e')+_0x4d3ab3,'If-None-Match':null,'OData-Version':_0x28ba('0x8f')},'json':!![]};return rp(_0x4e920f);})['then'](function(_0xe484f){var _0x2c57ba=_0xe484f['value'][0x0];var _0x3f3f47=_0x2c57ba[_0x28ba('0x90')];var _0x3a93fe={'method':_0x28ba('0x8c'),'uri':_0x433f72+_0x28ba('0x91')+_0x3f3f47+_0x28ba('0x92'),'headers':{'Authorization':_0x28ba('0x8e')+_0x4d3ab3,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3a93fe);})[_0x28ba('0x10')](function(_0x303a75){_0x3a309a=_0x303a75;_0xd602a4=_0x3a309a[_0x28ba('0x93')];_0xd602a4=_[_0x28ba('0x94')](_0xd602a4,function(_0x53cb6f){return!_0x2d1a3a[_0x28ba('0x95')](_0x53cb6f[_0x28ba('0x96')]);});var _0x3e13a6=[];var _0x2b6aea=[];_0xd602a4[_0x28ba('0x97')](function(_0x3d9582){if(_0x3d9582[_0x28ba('0x98')]){var _0x89dd55=_0x3d9582[_0x28ba('0x98')][_0x28ba('0x99')](_0x3d9582[_0x28ba('0x98')][_0x28ba('0x42')]('.')+0x1);if(_0x89dd55===_0x28ba('0x9a')){_0x3e13a6[_0x28ba('0x9b')](getSelectList(_0x433f72,_0xd9b819,_0x2b6aea,_0x3a309a[_0x28ba('0x90')],_0x3d9582[_0x28ba('0x90')],_0x4d3ab3));}}});return Promise[_0x28ba('0x9c')](_0x3e13a6);})[_0x28ba('0x10')](function(_0x2f2bad){_0x559415=_0x2f2bad[0x0];var _0x23989a=[];var _0x1bf246=[];_0xd602a4[_0x28ba('0x97')](function(_0x278538){if(!_[_0x28ba('0x9d')](_0x278538[_0x28ba('0x98')])){var _0x4c4e5b=_0x278538[_0x28ba('0x98')][_0x28ba('0x99')](_0x278538[_0x28ba('0x98')][_0x28ba('0x42')]('.')+0x1);if(_0x4c4e5b==='BooleanAttributeMetadata'){_0x23989a[_0x28ba('0x9b')](getBooleanList(_0x433f72,_0xd9b819,_0x1bf246,_0x3a309a[_0x28ba('0x90')],_0x278538[_0x28ba('0x90')],_0x4d3ab3));}}});return Promise[_0x28ba('0x9c')](_0x23989a);})['then'](function(_0x49316b){_0x5859b1=_0x49316b[0x0];var _0x76c22=[];var _0x438731=[];_0xd602a4[_0x28ba('0x97')](function(_0x1d5942){if(_0x1d5942[_0x28ba('0x98')]){var _0x50ae1b=_0x1d5942[_0x28ba('0x98')][_0x28ba('0x99')](_0x1d5942[_0x28ba('0x98')][_0x28ba('0x42')]('.')+0x1);if(_0x50ae1b===_0x28ba('0x9e')||_0x50ae1b===_0x28ba('0x9f')||_0x50ae1b===_0x28ba('0xa0')||_0x50ae1b===_0x28ba('0xa1')||_0x50ae1b===_0x28ba('0xa2')||_0x50ae1b===_0x28ba('0xa3')||_0x50ae1b==='StatusAttributeMetadata'||_0x50ae1b===_0x28ba('0xa4')||_0x50ae1b===_0x28ba('0xa5')||_0x50ae1b===_0x28ba('0xa6')){_0x76c22[_0x28ba('0x9b')](getInputList(_0x433f72,_0xd9b819,_0x50ae1b,_0x438731,_0x3a309a[_0x28ba('0x90')],_0x1d5942[_0x28ba('0x90')],_0x4d3ab3));}}});return Promise[_0x28ba('0x9c')](_0x76c22);})[_0x28ba('0x10')](function(_0x204fab){_0xdf984b=_0x204fab[0x0];var _0x58791d=_0x559415['concat'](_0x5859b1)['concat'](_0xdf984b);var _0x27635f={'count':_0x58791d['length'],'rows':_0x58791d};return _0x27635f;})[_0x28ba('0x10')](respondWithResult(_0x250957,null))['catch'](function(_0x38e146){var _0xfc6d53=_0x53e6e4[_0x28ba('0x1c')][_0x28ba('0xa7')]?0x1f4:_0x38e146[_0x28ba('0xa8')]||0x1f4;logger['error'](_0x38e146[_0x28ba('0xa9')]);delete _0x38e146[_0x28ba('0x13')];if(_0xfc6d53===0x191){_0xfc6d53=0x190;}_0x250957[_0x28ba('0x6')](_0xfc6d53)['send'](_0x53e6e4[_0x28ba('0x1c')][_0x28ba('0xa7')]?{'message':'Wrong\x20credentials','statusCode':_0x38e146[_0x28ba('0xa8')]}:_0x38e146);});};function getSelectList(_0x1df52c,_0x5e8fde,_0x1b3051,_0x4e5c5b,_0x48484e,_0x3d0f55){var _0x2b0505={'method':_0x28ba('0x8c'),'uri':_0x1df52c+_0x28ba('0x91')+_0x4e5c5b+_0x28ba('0xaa')+_0x48484e+_0x28ba('0xab')+_0x28ba('0xac'),'headers':{'Authorization':_0x28ba('0x8e')+_0x3d0f55,'If-None-Match':null,'OData-Version':_0x28ba('0x8f')},'json':!![]};return rp(_0x2b0505)[_0x28ba('0x10')](function(_0x50b34a){var _0xc3b004=[];var _0xe4ab7d=_0x50b34a[_0x28ba('0xad')][_0x28ba('0xae')];_0xe4ab7d[_0x28ba('0x97')](function(_0x3aae9b){_0xc3b004[_0x28ba('0x9b')]({'name':_0x3aae9b[_0x28ba('0xaf')][_0x28ba('0xb0')][_0x28ba('0xaf')],'value':String(_0x3aae9b[_0x28ba('0xb1')])});});var _0x57260b={'id':_0x5e8fde+'_'+_0x50b34a[_0x28ba('0x96')],'name':_0x50b34a['DisplayName']['UserLocalizedLabel'][_0x28ba('0xaf')],'custom':![],'options':_0xc3b004};_0x1b3051['push'](_0x57260b);return _0x1b3051;});}function getBooleanList(_0x325114,_0x126e19,_0x3e9a56,_0x5f5446,_0x146a11,_0x57f442){var _0x4e4706={'method':_0x28ba('0x8c'),'uri':_0x325114+'EntityDefinitions('+_0x5f5446+')/Attributes('+_0x146a11+_0x28ba('0xb2'),'headers':{'Authorization':_0x28ba('0x8e')+_0x57f442,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4e4706)['then'](function(_0x51a749){var _0x197c35=[];_0x197c35[_0x28ba('0x9b')]({'name':_0x51a749[_0x28ba('0xad')]['TrueOption']['Label'][_0x28ba('0xb0')]['Label'],'value':_0x28ba('0xb3')},{'name':_0x51a749[_0x28ba('0xad')][_0x28ba('0xb4')][_0x28ba('0xaf')][_0x28ba('0xb0')]['Label'],'value':_0x28ba('0xb5')});var _0x706453={'id':_0x126e19+'_'+_0x51a749[_0x28ba('0x96')],'name':_0x51a749['DisplayName'][_0x28ba('0xb0')][_0x28ba('0xaf')],'custom':![],'options':_0x197c35};_0x3e9a56[_0x28ba('0x9b')](_0x706453);return _0x3e9a56;});}function getInputList(_0x1c2b34,_0x2ef590,_0x1a36fe,_0x3aaa5b,_0x398231,_0x32f3e6,_0x363f38){var _0x4693fb={'method':_0x28ba('0x8c'),'uri':_0x1c2b34+_0x28ba('0x91')+_0x398231+')/Attributes('+_0x32f3e6+_0x28ba('0xb6')+_0x1a36fe+_0x28ba('0xb7'),'headers':{'Authorization':_0x28ba('0x8e')+_0x363f38,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4693fb)[_0x28ba('0x10')](function(_0x50dad6){var _0x29772d={'id':_0x2ef590+'_'+_0x50dad6['LogicalName'],'name':_0x50dad6[_0x28ba('0xb8')]['UserLocalizedLabel']?_0x50dad6['DisplayName'][_0x28ba('0xb0')][_0x28ba('0xaf')]:_0x50dad6['LogicalName'],'custom':![],'options':[]};_0x3aaa5b[_0x28ba('0x9b')](_0x29772d);return _0x3aaa5b;});} \ No newline at end of file +var _0xed90=['type','key','model','map','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','getConfigurations','findOne','Dynamics365Configuration','options','addConfiguration','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','slice','substring','lastIndexOf','getFields','ticketType','incident','Incident','title','description','customerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','responseby','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','MetadataId','all','BooleanAttributeMetadata','push','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','test','statusCode','stack',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Value','Label',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','status','offset','undefined','limit','count','Content-Range','json','then','destroy','error','Dynamics365Account','rawAttributes','fieldName'];(function(_0x1b8b95,_0x3ea343){var _0x3657ae=function(_0x3703e1){while(--_0x3703e1){_0x1b8b95['push'](_0x1b8b95['shift']());}};_0x3657ae(++_0x3ea343);}(_0xed90,0x16b));var _0x0ed9=function(_0x1f437f,_0x36edcd){_0x1f437f=_0x1f437f-0x0;var _0x5bc620=_0xed90[_0x1f437f];return _0x5bc620;};'use strict';var rp=require(_0x0ed9('0x0'));var util=require('util');var _=require(_0x0ed9('0x1'));var qs=require(_0x0ed9('0x2'));var logger=require(_0x0ed9('0x3'))(_0x0ed9('0x4'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0ed9('0x5'));function respondWithResult(_0x5c42fa,_0x5d59f8){_0x5d59f8=_0x5d59f8||0xc8;return function(_0x2479e2){if(_0x2479e2){return _0x5c42fa[_0x0ed9('0x6')](_0x5d59f8)['json'](_0x2479e2);}};}function respondWithFilteredResult(_0x32957e,_0x19f3e3){return function(_0x230318){if(_0x230318){var _0x232f24=typeof _0x19f3e3[_0x0ed9('0x7')]===_0x0ed9('0x8')&&typeof _0x19f3e3[_0x0ed9('0x9')]==='undefined';var _0x2fc9ca=_0x230318[_0x0ed9('0xa')];var _0x3c277f=_0x232f24?0x0:_0x19f3e3[_0x0ed9('0x7')];var _0x46916d=_0x232f24?_0x230318[_0x0ed9('0xa')]:_0x19f3e3[_0x0ed9('0x7')]+_0x19f3e3[_0x0ed9('0x9')];var _0x38d407;if(_0x46916d>=_0x2fc9ca){_0x46916d=_0x2fc9ca;_0x38d407=0xc8;}else{_0x38d407=0xce;}_0x32957e[_0x0ed9('0x6')](_0x38d407);return _0x32957e['set'](_0x0ed9('0xb'),_0x3c277f+'-'+_0x46916d+'/'+_0x2fc9ca)[_0x0ed9('0xc')](_0x230318);}return null;};}function saveUpdates(_0x4b5ab3){return function(_0x2b560d){if(_0x2b560d){return _0x2b560d['update'](_0x4b5ab3)[_0x0ed9('0xd')](function(_0x2a94b9){return _0x2a94b9;});}return null;};}function removeEntity(_0x1bd6f4){return function(_0x184ef0){if(_0x184ef0){return _0x184ef0[_0x0ed9('0xe')]()['then'](function(){_0x1bd6f4[_0x0ed9('0x6')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b8fff){return function(_0x3e436d){if(!_0x3e436d){_0x4b8fff['sendStatus'](0x194);}return _0x3e436d;};}function handleError(_0x1e3c5d,_0x352113){_0x352113=_0x352113||0x1f4;return function(_0x268b99){logger[_0x0ed9('0xf')](_0x268b99['stack']);if(_0x268b99['name']){delete _0x268b99['name'];}_0x1e3c5d['status'](_0x352113)['send'](_0x268b99);};}exports['index']=function(_0x3205cb,_0x3aeb4c){var _0x477e95={},_0x54afa9={},_0x13094e={'count':0x0,'rows':[]};var _0x48b06b=_['map'](db[_0x0ed9('0x10')][_0x0ed9('0x11')],function(_0x31cf4e){return{'name':_0x31cf4e[_0x0ed9('0x12')],'type':_0x31cf4e[_0x0ed9('0x13')][_0x0ed9('0x14')]};});_0x54afa9[_0x0ed9('0x15')]=_[_0x0ed9('0x16')](_0x48b06b,_0x0ed9('0x17'));_0x54afa9[_0x0ed9('0x18')]=_[_0x0ed9('0x19')](_0x3205cb[_0x0ed9('0x18')]);_0x54afa9[_0x0ed9('0x1a')]=_['intersection'](_0x54afa9[_0x0ed9('0x15')],_0x54afa9[_0x0ed9('0x18')]);_0x477e95['attributes']=_[_0x0ed9('0x1b')](_0x54afa9[_0x0ed9('0x15')],qs[_0x0ed9('0x1c')](_0x3205cb[_0x0ed9('0x18')][_0x0ed9('0x1c')]));_0x477e95[_0x0ed9('0x1d')]=_0x477e95[_0x0ed9('0x1d')]['length']?_0x477e95[_0x0ed9('0x1d')]:_0x54afa9[_0x0ed9('0x15')];if(!_0x3205cb[_0x0ed9('0x18')][_0x0ed9('0x1e')](_0x0ed9('0x1f'))){_0x477e95[_0x0ed9('0x9')]=qs[_0x0ed9('0x9')](_0x3205cb[_0x0ed9('0x18')][_0x0ed9('0x9')]);_0x477e95[_0x0ed9('0x7')]=qs[_0x0ed9('0x7')](_0x3205cb[_0x0ed9('0x18')][_0x0ed9('0x7')]);}_0x477e95['order']=qs[_0x0ed9('0x20')](_0x3205cb[_0x0ed9('0x18')][_0x0ed9('0x20')]);_0x477e95[_0x0ed9('0x21')]=qs[_0x0ed9('0x1a')](_[_0x0ed9('0x22')](_0x3205cb[_0x0ed9('0x18')],_0x54afa9[_0x0ed9('0x1a')]),_0x48b06b);if(_0x3205cb[_0x0ed9('0x18')]['filter']){_0x477e95[_0x0ed9('0x21')]=_[_0x0ed9('0x23')](_0x477e95[_0x0ed9('0x21')],{'$or':_[_0x0ed9('0x16')](_0x48b06b,function(_0x5b5a5e){if(_0x5b5a5e[_0x0ed9('0x13')]!==_0x0ed9('0x24')){var _0x5d9912={};_0x5d9912[_0x5b5a5e[_0x0ed9('0x17')]]={'$like':'%'+_0x3205cb[_0x0ed9('0x18')][_0x0ed9('0x25')]+'%'};return _0x5d9912;}})});}_0x477e95=_[_0x0ed9('0x23')]({},_0x477e95,_0x3205cb['options']);var _0x4fa1fc={'where':_0x477e95['where']};return db['Dynamics365Account']['count'](_0x4fa1fc)[_0x0ed9('0xd')](function(_0x137820){_0x13094e[_0x0ed9('0xa')]=_0x137820;if(_0x3205cb[_0x0ed9('0x18')][_0x0ed9('0x26')]){_0x477e95[_0x0ed9('0x27')]=[{'all':!![]}];}return db[_0x0ed9('0x10')][_0x0ed9('0x28')](_0x477e95);})[_0x0ed9('0xd')](function(_0x14d99f){_0x13094e[_0x0ed9('0x29')]=_0x14d99f;return _0x13094e;})[_0x0ed9('0xd')](respondWithFilteredResult(_0x3aeb4c,_0x477e95))[_0x0ed9('0x2a')](handleError(_0x3aeb4c,null));};exports[_0x0ed9('0x2b')]=function(_0x3beb72,_0x1d4857){var _0x415c6d={'raw':![],'where':{'id':_0x3beb72[_0x0ed9('0x2c')]['id']}},_0x36442f={};_0x36442f[_0x0ed9('0x15')]=_[_0x0ed9('0x19')](db[_0x0ed9('0x10')][_0x0ed9('0x11')]);_0x36442f[_0x0ed9('0x18')]=_[_0x0ed9('0x19')](_0x3beb72[_0x0ed9('0x18')]);_0x36442f['filters']=_[_0x0ed9('0x1b')](_0x36442f[_0x0ed9('0x15')],_0x36442f[_0x0ed9('0x18')]);_0x415c6d['attributes']=_[_0x0ed9('0x1b')](_0x36442f['model'],qs[_0x0ed9('0x1c')](_0x3beb72[_0x0ed9('0x18')][_0x0ed9('0x1c')]));_0x415c6d[_0x0ed9('0x1d')]=_0x415c6d['attributes'][_0x0ed9('0x2d')]?_0x415c6d[_0x0ed9('0x1d')]:_0x36442f[_0x0ed9('0x15')];if(_0x3beb72[_0x0ed9('0x18')][_0x0ed9('0x26')]){_0x415c6d[_0x0ed9('0x27')]=[{'all':!![]}];}_0x415c6d=_[_0x0ed9('0x23')]({},_0x415c6d,_0x3beb72['options']);return db[_0x0ed9('0x10')][_0x0ed9('0x2e')](_0x415c6d)[_0x0ed9('0xd')](handleEntityNotFound(_0x1d4857,null))[_0x0ed9('0xd')](respondWithResult(_0x1d4857,null))['catch'](handleError(_0x1d4857,null));};exports['create']=function(_0x182a4,_0x344174){return db['Dynamics365Account'][_0x0ed9('0x2f')](_0x182a4[_0x0ed9('0x30')],{})[_0x0ed9('0xd')](respondWithResult(_0x344174,0xc9))['catch'](handleError(_0x344174,null));};exports[_0x0ed9('0x31')]=function(_0x2d0871,_0x550ca9){if(_0x2d0871[_0x0ed9('0x30')]['id']){delete _0x2d0871[_0x0ed9('0x30')]['id'];}return db['Dynamics365Account'][_0x0ed9('0x2e')]({'where':{'id':_0x2d0871['params']['id']}})['then'](handleEntityNotFound(_0x550ca9,null))[_0x0ed9('0xd')](saveUpdates(_0x2d0871[_0x0ed9('0x30')],null))['then'](respondWithResult(_0x550ca9,null))[_0x0ed9('0x2a')](handleError(_0x550ca9,null));};exports[_0x0ed9('0xe')]=function(_0x175950,_0x3702ea){return db[_0x0ed9('0x10')][_0x0ed9('0x2e')]({'where':{'id':_0x175950[_0x0ed9('0x2c')]['id']}})[_0x0ed9('0xd')](handleEntityNotFound(_0x3702ea,null))[_0x0ed9('0xd')](removeEntity(_0x3702ea,null))[_0x0ed9('0x2a')](handleError(_0x3702ea,null));};exports[_0x0ed9('0x32')]=function(_0x1aff5d,_0x282e30){var _0x5099c7={};var _0x3cbef3={};var _0xb015a7;var _0x25f345;return db[_0x0ed9('0x10')][_0x0ed9('0x33')]({'where':{'id':_0x1aff5d[_0x0ed9('0x2c')]['id']}})[_0x0ed9('0xd')](handleEntityNotFound(_0x282e30,null))['then'](function(_0x15e873){if(_0x15e873){_0xb015a7=_0x15e873;_0x3cbef3['model']=_['keys'](db[_0x0ed9('0x34')]['rawAttributes']);_0x3cbef3['query']=_[_0x0ed9('0x19')](_0x1aff5d[_0x0ed9('0x18')]);_0x3cbef3[_0x0ed9('0x1a')]=_[_0x0ed9('0x1b')](_0x3cbef3[_0x0ed9('0x15')],_0x3cbef3[_0x0ed9('0x18')]);_0x5099c7[_0x0ed9('0x1d')]=_[_0x0ed9('0x1b')](_0x3cbef3['model'],qs[_0x0ed9('0x1c')](_0x1aff5d['query'][_0x0ed9('0x1c')]));_0x5099c7[_0x0ed9('0x1d')]=_0x5099c7[_0x0ed9('0x1d')]['length']?_0x5099c7[_0x0ed9('0x1d')]:_0x3cbef3[_0x0ed9('0x15')];_0x5099c7['order']=qs[_0x0ed9('0x20')](_0x1aff5d[_0x0ed9('0x18')][_0x0ed9('0x20')]);_0x5099c7[_0x0ed9('0x21')]=qs[_0x0ed9('0x1a')](_[_0x0ed9('0x22')](_0x1aff5d[_0x0ed9('0x18')],_0x3cbef3['filters']));if(_0x1aff5d[_0x0ed9('0x18')][_0x0ed9('0x25')]){_0x5099c7[_0x0ed9('0x21')]=_['merge'](_0x5099c7['where'],{'$or':_[_0x0ed9('0x16')](_0x5099c7['attributes'],function(_0x2d0b15){var _0x4b2c93={};_0x4b2c93[_0x2d0b15]={'$like':'%'+_0x1aff5d[_0x0ed9('0x18')]['filter']+'%'};return _0x4b2c93;})});}_0x5099c7=_[_0x0ed9('0x23')]({},_0x5099c7,_0x1aff5d[_0x0ed9('0x35')]);return _0xb015a7[_0x0ed9('0x32')](_0x5099c7);}})['then'](function(_0x5859ad){if(_0x5859ad){_0x25f345=_0x5859ad[_0x0ed9('0x2d')];if(!_0x1aff5d[_0x0ed9('0x18')][_0x0ed9('0x1e')](_0x0ed9('0x1f'))){_0x5099c7[_0x0ed9('0x9')]=qs[_0x0ed9('0x9')](_0x1aff5d['query'][_0x0ed9('0x9')]);_0x5099c7[_0x0ed9('0x7')]=qs[_0x0ed9('0x7')](_0x1aff5d[_0x0ed9('0x18')][_0x0ed9('0x7')]);}return _0xb015a7[_0x0ed9('0x32')](_0x5099c7);}})[_0x0ed9('0xd')](function(_0x105232){if(_0x105232){return _0x105232?{'count':_0x25f345,'rows':_0x105232}:null;}})[_0x0ed9('0xd')](respondWithResult(_0x282e30,null))[_0x0ed9('0x2a')](handleError(_0x282e30,null));};exports[_0x0ed9('0x36')]=function(_0x268a42,_0x2cda28){if(_0x268a42[_0x0ed9('0x30')]['id']){delete _0x268a42[_0x0ed9('0x30')]['id'];}return db[_0x0ed9('0x10')][_0x0ed9('0x33')]({'where':{'id':_0x268a42[_0x0ed9('0x2c')]['id']}})[_0x0ed9('0xd')](handleEntityNotFound(_0x2cda28,null))['then'](function(_0xd3b74e){if(_0xd3b74e){_0x268a42[_0x0ed9('0x30')]['AccountId']=_0xd3b74e['id'];_0x268a42['body'][_0x0ed9('0x37')]=integrations[_0x0ed9('0x38')](_0x268a42['body'][_0x0ed9('0x39')],_0x268a42[_0x0ed9('0x30')][_0x0ed9('0x13')]);_0x268a42['body'][_0x0ed9('0x3a')]=integrations['getDescriptions'](_0x268a42[_0x0ed9('0x30')][_0x0ed9('0x39')],_0x268a42[_0x0ed9('0x30')][_0x0ed9('0x13')]);return db['Dynamics365Configuration'][_0x0ed9('0x2f')](_0x268a42[_0x0ed9('0x30')],{'include':[{'model':db['Dynamics365Field'],'as':_0x0ed9('0x37')},{'model':db[_0x0ed9('0x3b')],'as':_0x0ed9('0x3a')}]});}return null;})[_0x0ed9('0xd')](respondWithResult(_0x2cda28,null))['catch'](handleError(_0x2cda28,null));};function sanitizeRemoteUri(_0x5b390d){var _0x5dabe4=_0x5b390d[_0x0ed9('0x3c')](-0x1);if(_0x5dabe4==='/')return _0x5b390d[_0x0ed9('0x3d')](0x0,_0x5b390d[_0x0ed9('0x3e')](_0x5dabe4));return _0x5b390d;}function getWebApiUrl(_0x47d9d1){return util['format']('%s/api/data/v9.0/',_0x47d9d1);}exports[_0x0ed9('0x3f')]=function(_0x4f453a,_0x52fa68){var _0x5939d7=_0x4f453a['query'][_0x0ed9('0x40')];var _0x1a0045=_0x5939d7===_0x0ed9('0x41')?_0x0ed9('0x42'):'PhoneCall';var _0x516375='';var _0x1d6a1b='';var _0x3f17a0='';var _0x2566f1='';var _0x47d546='';var _0x104223='';var _0x58a94f='';var _0xf32b4c='';var _0x290444=[_0x0ed9('0x43'),_0x0ed9('0x44'),_0x0ed9('0x45'),'ownerid',_0x0ed9('0x46'),_0x0ed9('0x47'),'phonenumber',_0x0ed9('0x48'),_0x0ed9('0x49'),_0x0ed9('0x4a')];var _0x38c1a9=[_0x0ed9('0x4b'),_0x0ed9('0x4c'),_0x0ed9('0x4d'),_0x0ed9('0x4e'),_0x0ed9('0x4f'),_0x0ed9('0x50'),_0x0ed9('0x51'),_0x0ed9('0x52'),_0x0ed9('0x53'),'createdbyexternalpartyyominame',_0x0ed9('0x54'),_0x0ed9('0x55'),_0x0ed9('0x56'),_0x0ed9('0x57'),_0x0ed9('0x58'),_0x0ed9('0x59'),'customeridtype',_0x0ed9('0x5a'),_0x0ed9('0x5b'),_0x0ed9('0x5c'),_0x0ed9('0x5d'),_0x0ed9('0x5e'),_0x0ed9('0x5f'),_0x0ed9('0x60'),'firstresponsebykpiidname','followupby',_0x0ed9('0x61'),_0x0ed9('0x62'),_0x0ed9('0x63'),_0x0ed9('0x64'),_0x0ed9('0x65'),_0x0ed9('0x66'),_0x0ed9('0x67'),_0x0ed9('0x68'),_0x0ed9('0x69'),_0x0ed9('0x6a'),_0x0ed9('0x6b'),_0x0ed9('0x6c'),_0x0ed9('0x6d'),_0x0ed9('0x6e'),_0x0ed9('0x6f'),_0x0ed9('0x70'),_0x0ed9('0x71'),_0x0ed9('0x72'),'owneridtype',_0x0ed9('0x73'),_0x0ed9('0x74'),_0x0ed9('0x75'),_0x0ed9('0x76'),_0x0ed9('0x77'),_0x0ed9('0x78'),'productserialnumber','resolveby','resolvebykpiidname',_0x0ed9('0x79'),'responsiblecontactidname',_0x0ed9('0x7a'),_0x0ed9('0x7b'),'slainvokedidname',_0x0ed9('0x7c'),_0x0ed9('0x7d'),_0x0ed9('0x7e'),_0x0ed9('0x7f'),_0x0ed9('0x80'),_0x0ed9('0x81'),_0x0ed9('0x82'),_0x0ed9('0x83'),_0x0ed9('0x84'),_0x0ed9('0x85'),_0x0ed9('0x86')];var _0xc4476a=_0x290444[_0x0ed9('0x87')](_0x38c1a9);return db[_0x0ed9('0x10')]['findOne']({'where':{'id':_0x4f453a[_0x0ed9('0x2c')]['id']},'attributes':['id',_0x0ed9('0x88'),_0x0ed9('0x89'),_0x0ed9('0x8a'),'tenantId',_0x0ed9('0x8b'),'clientSecret',_0x0ed9('0x8c')],'include':[{'model':db[_0x0ed9('0x8d')],'as':_0x0ed9('0x8d'),'attributes':['id',_0x0ed9('0x8e'),_0x0ed9('0x8f')]}]})['then'](handleEntityNotFound(_0x52fa68,null))['then'](function(_0x570c51){if(_0x570c51){if(_0x570c51[_0x0ed9('0x8c')]){_0x570c51[_0x0ed9('0x90')]=_0x570c51[_0x0ed9('0x8d')][_0x0ed9('0x8e')];_0xf32b4c=sanitizeRemoteUri(_0x570c51[_0x0ed9('0x8d')][_0x0ed9('0x8f')]);_0x58a94f=getWebApiUrl(_0xf32b4c);return _0x570c51;}_0xf32b4c=sanitizeRemoteUri(_0x570c51[_0x0ed9('0x8a')]);_0x58a94f=getWebApiUrl(_0xf32b4c);var _0x1df126={'method':_0x0ed9('0x91'),'uri':_0x0ed9('0x92')+_0x570c51['tenantId']+_0x0ed9('0x93'),'form':{'client_id':_0x570c51[_0x0ed9('0x8b')],'resource':_0xf32b4c,'username':_0x570c51[_0x0ed9('0x88')],'password':_0x570c51[_0x0ed9('0x89')],'grant_type':'password','client_secret':_0x570c51[_0x0ed9('0x94')]},'json':!![]};return rp(_0x1df126);}})['then'](function(_0x15c8e6){_0x104223=_0x15c8e6[_0x0ed9('0x90')];var _0x56609b={'method':_0x0ed9('0x95'),'uri':encodeURI(_0x58a94f+_0x0ed9('0x96')+_0x1a0045+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x104223,'If-None-Match':null,'OData-Version':_0x0ed9('0x97')},'json':!![]};return rp(_0x56609b);})[_0x0ed9('0xd')](function(_0x45d5e7){var _0x1d4fdb=_0x45d5e7[_0x0ed9('0x98')][0x0];var _0x40477e=_0x1d4fdb['MetadataId'];var _0x90f215={'method':_0x0ed9('0x95'),'uri':_0x58a94f+_0x0ed9('0x99')+_0x40477e+_0x0ed9('0x9a'),'headers':{'Authorization':_0x0ed9('0x9b')+_0x104223,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x90f215);})[_0x0ed9('0xd')](function(_0xda87e7){_0x516375=_0xda87e7;_0x1d6a1b=_0x516375[_0x0ed9('0x9c')];_0x1d6a1b=_['remove'](_0x1d6a1b,function(_0x3ee280){return!_0xc4476a[_0x0ed9('0x9d')](_0x3ee280[_0x0ed9('0x9e')]);});var _0x200f83=[];var _0x319f65=[];_0x1d6a1b[_0x0ed9('0x9f')](function(_0x1e22dc){if(_0x1e22dc[_0x0ed9('0xa0')]){var _0x11c861=_0x1e22dc[_0x0ed9('0xa0')][_0x0ed9('0x3d')](_0x1e22dc['@odata.type'][_0x0ed9('0x3e')]('.')+0x1);if(_0x11c861===_0x0ed9('0xa1')){_0x200f83['push'](getSelectList(_0x58a94f,_0x5939d7,_0x319f65,_0x516375[_0x0ed9('0xa2')],_0x1e22dc['MetadataId'],_0x104223));}}});return Promise[_0x0ed9('0xa3')](_0x200f83);})['then'](function(_0x327f7c){_0x3f17a0=_0x327f7c[0x0];var _0x4e44be=[];var _0x478d98=[];_0x1d6a1b['forEach'](function(_0x4e9f85){if(!_['isNil'](_0x4e9f85[_0x0ed9('0xa0')])){var _0x3ee224=_0x4e9f85[_0x0ed9('0xa0')][_0x0ed9('0x3d')](_0x4e9f85['@odata.type']['lastIndexOf']('.')+0x1);if(_0x3ee224===_0x0ed9('0xa4')){_0x4e44be[_0x0ed9('0xa5')](getBooleanList(_0x58a94f,_0x5939d7,_0x478d98,_0x516375[_0x0ed9('0xa2')],_0x4e9f85[_0x0ed9('0xa2')],_0x104223));}}});return Promise[_0x0ed9('0xa3')](_0x4e44be);})['then'](function(_0x40d918){_0x2566f1=_0x40d918[0x0];var _0x213b03=[];var _0x431139=[];_0x1d6a1b[_0x0ed9('0x9f')](function(_0x24da00){if(_0x24da00[_0x0ed9('0xa0')]){var _0x44820b=_0x24da00[_0x0ed9('0xa0')]['substring'](_0x24da00[_0x0ed9('0xa0')][_0x0ed9('0x3e')]('.')+0x1);if(_0x44820b==='StringAttributeMetadata'||_0x44820b===_0x0ed9('0xa6')||_0x44820b===_0x0ed9('0xa7')||_0x44820b===_0x0ed9('0xa8')||_0x44820b===_0x0ed9('0xa9')||_0x44820b===_0x0ed9('0xaa')||_0x44820b===_0x0ed9('0xab')||_0x44820b===_0x0ed9('0xac')||_0x44820b==='StateAttributeMetadata'||_0x44820b==='DecimalAttributeMetadata'){_0x213b03[_0x0ed9('0xa5')](getInputList(_0x58a94f,_0x5939d7,_0x44820b,_0x431139,_0x516375[_0x0ed9('0xa2')],_0x24da00['MetadataId'],_0x104223));}}});return Promise[_0x0ed9('0xa3')](_0x213b03);})['then'](function(_0x5d31f9){_0x47d546=_0x5d31f9[0x0];var _0x53f410=_0x3f17a0[_0x0ed9('0x87')](_0x2566f1)[_0x0ed9('0x87')](_0x47d546);var _0x3895b2={'count':_0x53f410[_0x0ed9('0x2d')],'rows':_0x53f410};return _0x3895b2;})['then'](respondWithResult(_0x52fa68,null))[_0x0ed9('0x2a')](function(_0x18bd8c){var _0x2ddc9a=_0x4f453a['query'][_0x0ed9('0xad')]?0x1f4:_0x18bd8c[_0x0ed9('0xae')]||0x1f4;logger['error'](_0x18bd8c[_0x0ed9('0xaf')]);delete _0x18bd8c['name'];if(_0x2ddc9a===0x191){_0x2ddc9a=0x190;}_0x52fa68['status'](_0x2ddc9a)['send'](_0x4f453a[_0x0ed9('0x18')][_0x0ed9('0xad')]?{'message':'Wrong\x20credentials','statusCode':_0x18bd8c[_0x0ed9('0xae')]}:_0x18bd8c);});};function getSelectList(_0xb27892,_0x237c48,_0x1836ba,_0x47f23b,_0x5616ad,_0x13f93e){var _0x3a6040={'method':_0x0ed9('0x95'),'uri':_0xb27892+_0x0ed9('0x99')+_0x47f23b+_0x0ed9('0xb0')+_0x5616ad+_0x0ed9('0xb1')+_0x0ed9('0xb2'),'headers':{'Authorization':_0x0ed9('0x9b')+_0x13f93e,'If-None-Match':null,'OData-Version':_0x0ed9('0x97')},'json':!![]};return rp(_0x3a6040)[_0x0ed9('0xd')](function(_0x302a75){var _0x155925=[];var _0x9dd114=_0x302a75[_0x0ed9('0xb3')][_0x0ed9('0xb4')];_0x9dd114[_0x0ed9('0x9f')](function(_0x18d5c7){_0x155925[_0x0ed9('0xa5')]({'name':_0x18d5c7['Label'][_0x0ed9('0xb5')]['Label'],'value':String(_0x18d5c7[_0x0ed9('0xb6')])});});var _0x5f2004={'id':_0x237c48+'_'+_0x302a75['LogicalName'],'name':_0x302a75['DisplayName'][_0x0ed9('0xb5')][_0x0ed9('0xb7')],'custom':![],'options':_0x155925};_0x1836ba[_0x0ed9('0xa5')](_0x5f2004);return _0x1836ba;});}function getBooleanList(_0x2379b9,_0x355cfc,_0x28adf2,_0x21e1cc,_0x56c663,_0xdd8e1c){var _0xccf569={'method':_0x0ed9('0x95'),'uri':_0x2379b9+_0x0ed9('0x99')+_0x21e1cc+')/Attributes('+_0x56c663+_0x0ed9('0xb8'),'headers':{'Authorization':'Bearer\x20'+_0xdd8e1c,'If-None-Match':null,'OData-Version':_0x0ed9('0x97')},'json':!![]};return rp(_0xccf569)[_0x0ed9('0xd')](function(_0x483c1e){var _0x4d0d8a=[];_0x4d0d8a[_0x0ed9('0xa5')]({'name':_0x483c1e[_0x0ed9('0xb3')][_0x0ed9('0xb9')]['Label'][_0x0ed9('0xb5')][_0x0ed9('0xb7')],'value':_0x0ed9('0xba')},{'name':_0x483c1e[_0x0ed9('0xb3')][_0x0ed9('0xbb')]['Label'][_0x0ed9('0xb5')][_0x0ed9('0xb7')],'value':'false'});var _0x58f8e2={'id':_0x355cfc+'_'+_0x483c1e[_0x0ed9('0x9e')],'name':_0x483c1e[_0x0ed9('0xbc')]['UserLocalizedLabel'][_0x0ed9('0xb7')],'custom':![],'options':_0x4d0d8a};_0x28adf2[_0x0ed9('0xa5')](_0x58f8e2);return _0x28adf2;});}function getInputList(_0xb47bc7,_0x57152a,_0x31f05c,_0x5eb39c,_0x180774,_0xf5798,_0x503264){var _0x534444={'method':'GET','uri':_0xb47bc7+_0x0ed9('0x99')+_0x180774+')/Attributes('+_0xf5798+_0x0ed9('0xbd')+_0x31f05c+_0x0ed9('0xbe'),'headers':{'Authorization':_0x0ed9('0x9b')+_0x503264,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x534444)[_0x0ed9('0xd')](function(_0x379e27){var _0x4f271e={'id':_0x57152a+'_'+_0x379e27[_0x0ed9('0x9e')],'name':_0x379e27[_0x0ed9('0xbc')][_0x0ed9('0xb5')]?_0x379e27[_0x0ed9('0xbc')][_0x0ed9('0xb5')][_0x0ed9('0xb7')]:_0x379e27[_0x0ed9('0x9e')],'custom':![],'options':[]};_0x5eb39c['push'](_0x4f271e);return _0x5eb39c;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index ae4be2a..3fd67ec 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 _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x1a6c3e,_0x918416){var _0x585fe4=function(_0x2bc050){while(--_0x2bc050){_0x1a6c3e['push'](_0x1a6c3e['shift']());}};_0x585fe4(++_0x918416);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x509273,_0x13fc9f){_0x509273=_0x509273-0x0;var _0x38ef40=_0xcb91[_0x509273];return _0x38ef40;};'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'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x12b986,_0x5ae493){var _0x215046=function(_0x30179a){while(--_0x30179a){_0x12b986['push'](_0x12b986['shift']());}};_0x215046(++_0x5ae493);}(_0x757a,0xde));var _0xa757=function(_0x89024e,_0x29f192){_0x89024e=_0x89024e-0x0;var _0x553791=_0x757a[_0x89024e];return _0x553791;};'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 diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index be93b06..3b5d586 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 _0x8a2a=['Dynamics365Account','options','raw','where','limit','map','include','model','attributes','stringify','find','ShowDynamics365Account','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','GetDynamics365Account'];(function(_0x132144,_0x58365d){var _0x2954b0=function(_0x5b48ec){while(--_0x5b48ec){_0x132144['push'](_0x132144['shift']());}};_0x2954b0(++_0x58365d);}(_0x8a2a,0x160));var _0xa8a2=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0x8a2a[_0x23c73d];return _0x36ba47;};'use strict';var _=require(_0xa8a2('0x0'));var util=require(_0xa8a2('0x1'));var moment=require('moment');var BPromise=require(_0xa8a2('0x2'));var rs=require(_0xa8a2('0x3'));var fs=require('fs');var Redis=require(_0xa8a2('0x4'));var db=require(_0xa8a2('0x5'))['db'];var utils=require(_0xa8a2('0x6'));var logger=require(_0xa8a2('0x7'))('rpc');var config=require(_0xa8a2('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa8a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4af11b,_0x8e4b65,_0x2e7799){return new BPromise(function(_0x3cfea4,_0x500b53){return client[_0xa8a2('0xa')](_0x4af11b,_0x2e7799)[_0xa8a2('0xb')](function(_0x5532fe){logger[_0xa8a2('0xc')](_0xa8a2('0xd'),_0x8e4b65,'request\x20sent');logger[_0xa8a2('0xe')](_0xa8a2('0xf'),_0x8e4b65,'request\x20sent',JSON['stringify'](_0x5532fe));if(_0x5532fe[_0xa8a2('0x10')]){if(_0x5532fe[_0xa8a2('0x10')]['code']===0x1f4){logger[_0xa8a2('0x10')](_0xa8a2('0xd'),_0x8e4b65,_0x5532fe[_0xa8a2('0x10')][_0xa8a2('0x11')]);return _0x500b53(_0x5532fe[_0xa8a2('0x10')][_0xa8a2('0x11')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x8e4b65,_0x5532fe[_0xa8a2('0x10')][_0xa8a2('0x11')]);return _0x3cfea4(_0x5532fe[_0xa8a2('0x10')][_0xa8a2('0x11')]);}else{logger[_0xa8a2('0xc')](_0xa8a2('0xd'),_0x8e4b65,_0xa8a2('0x12'));_0x3cfea4(_0x5532fe[_0xa8a2('0x13')]['message']);}})[_0xa8a2('0x14')](function(_0x4b15b1){logger[_0xa8a2('0x10')](_0xa8a2('0xd'),_0x8e4b65,_0x4b15b1);_0x500b53(_0x4b15b1);});});}exports[_0xa8a2('0x15')]=function(_0x13eda5){var _0x3ff956=this;return new Promise(function(_0x4284cd,_0x38246a){return db[_0xa8a2('0x16')]['findAll']({'raw':_0x13eda5[_0xa8a2('0x17')]?_0x13eda5[_0xa8a2('0x17')][_0xa8a2('0x18')]===undefined?!![]:![]:!![],'where':_0x13eda5['options']?_0x13eda5[_0xa8a2('0x17')][_0xa8a2('0x19')]||null:null,'attributes':_0x13eda5[_0xa8a2('0x17')]?_0x13eda5['options']['attributes']||null:null,'limit':_0x13eda5[_0xa8a2('0x17')]?_0x13eda5[_0xa8a2('0x17')][_0xa8a2('0x1a')]||null:null,'include':_0x13eda5[_0xa8a2('0x17')]?_0x13eda5[_0xa8a2('0x17')]['include']?_[_0xa8a2('0x1b')](_0x13eda5[_0xa8a2('0x17')][_0xa8a2('0x1c')],function(_0x1f79ac){return{'model':db[_0x1f79ac[_0xa8a2('0x1d')]],'as':_0x1f79ac['as'],'attributes':_0x1f79ac[_0xa8a2('0x1e')],'include':_0x1f79ac[_0xa8a2('0x1c')]?_[_0xa8a2('0x1b')](_0x1f79ac[_0xa8a2('0x1c')],function(_0x46d97c){return{'model':db[_0x46d97c[_0xa8a2('0x1d')]],'as':_0x46d97c['as'],'attributes':_0x46d97c[_0xa8a2('0x1e')],'include':_0x46d97c[_0xa8a2('0x1c')]?_['map'](_0x46d97c[_0xa8a2('0x1c')],function(_0x12931f){return{'model':db[_0x12931f['model']],'as':_0x12931f['as'],'attributes':_0x12931f[_0xa8a2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa8a2('0xb')](function(_0x176274){logger[_0xa8a2('0xc')]('GetDynamics365Account',_0x13eda5);logger[_0xa8a2('0xe')]('GetDynamics365Account',_0x13eda5,JSON[_0xa8a2('0x1f')](_0x176274));_0x4284cd(_0x176274);})['catch'](function(_0x4d4861){logger['error'](_0xa8a2('0x15'),_0x4d4861[_0xa8a2('0x11')],_0x13eda5);_0x38246a(_0x3ff956['error'](0x1f4,_0x4d4861[_0xa8a2('0x11')]));});});};exports['ShowDynamics365Account']=function(_0x525b60){var _0x60feb3=this;return new Promise(function(_0x5cfe11,_0x5e354f){return db['Dynamics365Account'][_0xa8a2('0x20')]({'raw':_0x525b60[_0xa8a2('0x17')]?_0x525b60[_0xa8a2('0x17')][_0xa8a2('0x18')]===undefined?!![]:![]:!![],'where':_0x525b60[_0xa8a2('0x17')]?_0x525b60[_0xa8a2('0x17')]['where']||null:null,'attributes':_0x525b60[_0xa8a2('0x17')]?_0x525b60[_0xa8a2('0x17')][_0xa8a2('0x1e')]||null:null,'include':_0x525b60[_0xa8a2('0x17')]?_0x525b60['options'][_0xa8a2('0x1c')]?_[_0xa8a2('0x1b')](_0x525b60['options']['include'],function(_0x514781){return{'model':db[_0x514781[_0xa8a2('0x1d')]],'as':_0x514781['as'],'attributes':_0x514781[_0xa8a2('0x1e')],'include':_0x514781[_0xa8a2('0x1c')]?_['map'](_0x514781[_0xa8a2('0x1c')],function(_0x46bd43){return{'model':db[_0x46bd43[_0xa8a2('0x1d')]],'as':_0x46bd43['as'],'attributes':_0x46bd43[_0xa8a2('0x1e')],'include':_0x46bd43[_0xa8a2('0x1c')]?_['map'](_0x46bd43[_0xa8a2('0x1c')],function(_0x407992){return{'model':db[_0x407992[_0xa8a2('0x1d')]],'as':_0x407992['as'],'attributes':_0x407992[_0xa8a2('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fc908){logger[_0xa8a2('0xc')](_0xa8a2('0x21'),_0x525b60);logger['debug'](_0xa8a2('0x21'),_0x525b60,JSON['stringify'](_0x4fc908));_0x5cfe11(_0x4fc908);})[_0xa8a2('0x14')](function(_0x9c768){logger[_0xa8a2('0x10')](_0xa8a2('0x21'),_0x9c768[_0xa8a2('0x11')],_0x525b60);_0x5e354f(_0x60feb3[_0xa8a2('0x10')](0x1f4,_0x9c768[_0xa8a2('0x11')]));});});}; \ No newline at end of file +var _0x5ee6=['../../config/environment','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','findAll','options','attributes','limit','include','map','model','catch','GetDynamics365Account','ShowDynamics365Account','Dynamics365Account','find','raw','where','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x5ee6,0x17d));var _0x65ee=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5ee6[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x65ee('0x0'));var util=require(_0x65ee('0x1'));var moment=require(_0x65ee('0x2'));var BPromise=require(_0x65ee('0x3'));var rs=require(_0x65ee('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65ee('0x5'))['db'];var utils=require(_0x65ee('0x6'));var logger=require(_0x65ee('0x7'))(_0x65ee('0x8'));var config=require(_0x65ee('0x9'));var jayson=require(_0x65ee('0xa'));var client=jayson[_0x65ee('0xb')][_0x65ee('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x573e4c,_0x357fab,_0x223b5b){return new BPromise(function(_0x4ab69c,_0x1cce4d){return client[_0x65ee('0xd')](_0x573e4c,_0x223b5b)['then'](function(_0x341bc7){logger[_0x65ee('0xe')](_0x65ee('0xf'),_0x357fab,'request\x20sent');logger[_0x65ee('0x10')](_0x65ee('0x11'),_0x357fab,_0x65ee('0x12'),JSON[_0x65ee('0x13')](_0x341bc7));if(_0x341bc7['error']){if(_0x341bc7['error'][_0x65ee('0x14')]===0x1f4){logger[_0x65ee('0x15')]('Dynamics365Account,\x20%s,\x20%s',_0x357fab,_0x341bc7[_0x65ee('0x15')]['message']);return _0x1cce4d(_0x341bc7[_0x65ee('0x15')][_0x65ee('0x16')]);}logger['error'](_0x65ee('0xf'),_0x357fab,_0x341bc7[_0x65ee('0x15')][_0x65ee('0x16')]);return _0x4ab69c(_0x341bc7['error'][_0x65ee('0x16')]);}else{logger['info'](_0x65ee('0xf'),_0x357fab,'request\x20sent');_0x4ab69c(_0x341bc7[_0x65ee('0x17')][_0x65ee('0x16')]);}})['catch'](function(_0x2f5c57){logger[_0x65ee('0x15')]('Dynamics365Account,\x20%s,\x20%s',_0x357fab,_0x2f5c57);_0x1cce4d(_0x2f5c57);});});}exports['GetDynamics365Account']=function(_0x14836f){var _0x4a4673=this;return new Promise(function(_0x55e333,_0x4ea605){return db['Dynamics365Account'][_0x65ee('0x18')]({'raw':_0x14836f[_0x65ee('0x19')]?_0x14836f[_0x65ee('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x14836f[_0x65ee('0x19')]?_0x14836f['options']['where']||null:null,'attributes':_0x14836f[_0x65ee('0x19')]?_0x14836f[_0x65ee('0x19')][_0x65ee('0x1a')]||null:null,'limit':_0x14836f[_0x65ee('0x19')]?_0x14836f[_0x65ee('0x19')][_0x65ee('0x1b')]||null:null,'include':_0x14836f[_0x65ee('0x19')]?_0x14836f['options'][_0x65ee('0x1c')]?_[_0x65ee('0x1d')](_0x14836f['options'][_0x65ee('0x1c')],function(_0xb9c2b0){return{'model':db[_0xb9c2b0[_0x65ee('0x1e')]],'as':_0xb9c2b0['as'],'attributes':_0xb9c2b0['attributes'],'include':_0xb9c2b0[_0x65ee('0x1c')]?_[_0x65ee('0x1d')](_0xb9c2b0[_0x65ee('0x1c')],function(_0x2b0615){return{'model':db[_0x2b0615[_0x65ee('0x1e')]],'as':_0x2b0615['as'],'attributes':_0x2b0615[_0x65ee('0x1a')],'include':_0x2b0615[_0x65ee('0x1c')]?_[_0x65ee('0x1d')](_0x2b0615[_0x65ee('0x1c')],function(_0x303523){return{'model':db[_0x303523[_0x65ee('0x1e')]],'as':_0x303523['as'],'attributes':_0x303523[_0x65ee('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d7885){logger['info']('GetDynamics365Account',_0x14836f);logger[_0x65ee('0x10')]('GetDynamics365Account',_0x14836f,JSON['stringify'](_0x3d7885));_0x55e333(_0x3d7885);})[_0x65ee('0x1f')](function(_0x2949c4){logger[_0x65ee('0x15')](_0x65ee('0x20'),_0x2949c4[_0x65ee('0x16')],_0x14836f);_0x4ea605(_0x4a4673[_0x65ee('0x15')](0x1f4,_0x2949c4[_0x65ee('0x16')]));});});};exports[_0x65ee('0x21')]=function(_0x103f7d){var _0x17ec12=this;return new Promise(function(_0x5612f6,_0x3db68f){return db[_0x65ee('0x22')][_0x65ee('0x23')]({'raw':_0x103f7d[_0x65ee('0x19')]?_0x103f7d[_0x65ee('0x19')][_0x65ee('0x24')]===undefined?!![]:![]:!![],'where':_0x103f7d[_0x65ee('0x19')]?_0x103f7d[_0x65ee('0x19')][_0x65ee('0x25')]||null:null,'attributes':_0x103f7d[_0x65ee('0x19')]?_0x103f7d['options'][_0x65ee('0x1a')]||null:null,'include':_0x103f7d['options']?_0x103f7d[_0x65ee('0x19')][_0x65ee('0x1c')]?_[_0x65ee('0x1d')](_0x103f7d[_0x65ee('0x19')][_0x65ee('0x1c')],function(_0x28b4c5){return{'model':db[_0x28b4c5[_0x65ee('0x1e')]],'as':_0x28b4c5['as'],'attributes':_0x28b4c5['attributes'],'include':_0x28b4c5['include']?_[_0x65ee('0x1d')](_0x28b4c5[_0x65ee('0x1c')],function(_0x26198c){return{'model':db[_0x26198c['model']],'as':_0x26198c['as'],'attributes':_0x26198c['attributes'],'include':_0x26198c[_0x65ee('0x1c')]?_[_0x65ee('0x1d')](_0x26198c[_0x65ee('0x1c')],function(_0x364266){return{'model':db[_0x364266['model']],'as':_0x364266['as'],'attributes':_0x364266[_0x65ee('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x65ee('0x26')](function(_0x99a8a4){logger[_0x65ee('0xe')](_0x65ee('0x21'),_0x103f7d);logger['debug']('ShowDynamics365Account',_0x103f7d,JSON[_0x65ee('0x13')](_0x99a8a4));_0x5612f6(_0x99a8a4);})[_0x65ee('0x1f')](function(_0x32d302){logger['error'](_0x65ee('0x21'),_0x32d302[_0x65ee('0x16')],_0x103f7d);_0x3db68f(_0x17ec12['error'](0x1f4,_0x32d302[_0x65ee('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 65f650e..eb385ed 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 _0x45c8=['/:id/descriptions','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Configuration.controller','index','get','/:id','isAuthenticated','/:id/subjects','getSubjects'];(function(_0x4c40fa,_0x1e965d){var _0x447f39=function(_0x3965a4){while(--_0x3965a4){_0x4c40fa['push'](_0x4c40fa['shift']());}};_0x447f39(++_0x1e965d);}(_0x45c8,0x8b));var _0x845c=function(_0x28a71b,_0x7d2d61){_0x28a71b=_0x28a71b-0x0;var _0x50e536=_0x45c8[_0x28a71b];return _0x50e536;};'use strict';var multer=require(_0x845c('0x0'));var util=require(_0x845c('0x1'));var path=require(_0x845c('0x2'));var timeout=require(_0x845c('0x3'));var express=require(_0x845c('0x4'));var router=express[_0x845c('0x5')]();var fs_extra=require(_0x845c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x845c('0x7'));var config=require('../../config/environment');var controller=require(_0x845c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x845c('0x9')]);router[_0x845c('0xa')](_0x845c('0xb'),auth[_0x845c('0xc')](),controller['show']);router[_0x845c('0xa')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x845c('0xa')](_0x845c('0xd'),auth[_0x845c('0xc')](),controller[_0x845c('0xe')]);router[_0x845c('0xa')](_0x845c('0xf'),auth[_0x845c('0xc')](),controller['getDescriptions']);router[_0x845c('0x10')]('/',auth['isAuthenticated'](),controller[_0x845c('0x11')]);router[_0x845c('0x12')]('/:id',auth[_0x845c('0xc')](),controller['update']);router[_0x845c('0x13')](_0x845c('0xb'),auth['isAuthenticated'](),controller[_0x845c('0x14')]);module[_0x845c('0x15')]=router; \ No newline at end of file +var _0x3e9f=['getFields','/:id/descriptions','getDescriptions','post','create','put','update','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x38a098,_0x120c29){var _0x26382a=function(_0x384a9e){while(--_0x384a9e){_0x38a098['push'](_0x38a098['shift']());}};_0x26382a(++_0x120c29);}(_0x3e9f,0x98));var _0xf3e9=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x3e9f[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require(_0xf3e9('0x0'));var util=require(_0xf3e9('0x1'));var path=require(_0xf3e9('0x2'));var timeout=require(_0xf3e9('0x3'));var express=require('express');var router=express[_0xf3e9('0x4')]();var fs_extra=require(_0xf3e9('0x5'));var auth=require(_0xf3e9('0x6'));var interaction=require(_0xf3e9('0x7'));var config=require(_0xf3e9('0x8'));var controller=require(_0xf3e9('0x9'));router[_0xf3e9('0xa')]('/',auth[_0xf3e9('0xb')](),controller[_0xf3e9('0xc')]);router[_0xf3e9('0xa')](_0xf3e9('0xd'),auth[_0xf3e9('0xb')](),controller[_0xf3e9('0xe')]);router[_0xf3e9('0xa')](_0xf3e9('0xf'),auth[_0xf3e9('0xb')](),controller[_0xf3e9('0x10')]);router[_0xf3e9('0xa')]('/:id/subjects',auth[_0xf3e9('0xb')](),controller['getSubjects']);router['get'](_0xf3e9('0x11'),auth[_0xf3e9('0xb')](),controller[_0xf3e9('0x12')]);router[_0xf3e9('0x13')]('/',auth[_0xf3e9('0xb')](),controller[_0xf3e9('0x14')]);router[_0xf3e9('0x15')](_0xf3e9('0xd'),auth[_0xf3e9('0xb')](),controller[_0xf3e9('0x16')]);router['delete']('/:id',auth[_0xf3e9('0xb')](),controller[_0xf3e9('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index cccae86..90c3193 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 _0x5f26=['contact','nothing','BOOLEAN','sequelize','exports','STRING','incident','phonecall','ENUM'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x5f26,0x135));var _0x65f2=function(_0x2a5541,_0x1324c3){_0x2a5541=_0x2a5541-0x0;var _0x54fd9e=_0x5f26[_0x2a5541];return _0x54fd9e;};'use strict';var Sequelize=require(_0x65f2('0x0'));module[_0x65f2('0x1')]={'name':{'type':Sequelize[_0x65f2('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x65f2('0x3'),_0x65f2('0x4')),'defaultValue':_0x65f2('0x3')},'moduleCreate':{'type':Sequelize[_0x65f2('0x5')](_0x65f2('0x6'),_0x65f2('0x7')),'defaultValue':_0x65f2('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x65f2('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x65f2('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x59d3=['BOOLEAN','sequelize','exports','ENUM','incident','contact','STRING'];(function(_0x1ee9a1,_0x5f1434){var _0x21270f=function(_0x303251){while(--_0x303251){_0x1ee9a1['push'](_0x1ee9a1['shift']());}};_0x21270f(++_0x5f1434);}(_0x59d3,0xef));var _0x359d=function(_0x294dbe,_0x4aee46){_0x294dbe=_0x294dbe-0x0;var _0x5728a5=_0x59d3[_0x294dbe];return _0x5728a5;};'use strict';var Sequelize=require(_0x359d('0x0'));module[_0x359d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x359d('0x2')](_0x359d('0x3'),'phonecall'),'defaultValue':_0x359d('0x3')},'moduleCreate':{'type':Sequelize[_0x359d('0x2')](_0x359d('0x4'),'nothing'),'defaultValue':_0x359d('0x4'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x359d('0x5')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x359d('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index d242e6c..f468786 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 _0xf373=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','create','Dynamics365Configuration','body','find','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xf373,0x189));var _0x3f37=function(_0xfd46d7,_0x2c6117){_0xfd46d7=_0xfd46d7-0x0;var _0x49fa4c=_0xf373[_0xfd46d7];return _0x49fa4c;};'use strict';var emlformat=require(_0x3f37('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3f37('0x1'));var rp=require(_0x3f37('0x2'));var moment=require(_0x3f37('0x3'));var BPromise=require(_0x3f37('0x4'));var Mustache=require('mustache');var util=require(_0x3f37('0x5'));var path=require(_0x3f37('0x6'));var sox=require(_0x3f37('0x7'));var csv=require(_0x3f37('0x8'));var ejs=require(_0x3f37('0x9'));var fs=require('fs');var fs_extra=require(_0x3f37('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3f37('0xb'));var jsforce=require(_0x3f37('0xc'));var deskjs=require(_0x3f37('0xd'));var toCsv=require(_0x3f37('0x8'));var querystring=require(_0x3f37('0xe'));var Papa=require(_0x3f37('0xf'));var Redis=require(_0x3f37('0x10'));var authService=require(_0x3f37('0x11'));var qs=require(_0x3f37('0x12'));var as=require(_0x3f37('0x13'));var hardwareService=require(_0x3f37('0x14'));var logger=require('../../config/logger')(_0x3f37('0x15'));var utils=require(_0x3f37('0x16'));var config=require(_0x3f37('0x17'));var licenseUtil=require(_0x3f37('0x18'));var db=require(_0x3f37('0x19'))['db'];function respondWithStatusCode(_0x53170c,_0x360ea2){_0x360ea2=_0x360ea2||0xcc;return function(_0x2cd785){if(_0x2cd785){return _0x53170c[_0x3f37('0x1a')](_0x360ea2);}return _0x53170c[_0x3f37('0x1b')](_0x360ea2)[_0x3f37('0x1c')]();};}function respondWithResult(_0x5656ae,_0x37d6ca){_0x37d6ca=_0x37d6ca||0xc8;return function(_0x388631){if(_0x388631){return _0x5656ae[_0x3f37('0x1b')](_0x37d6ca)[_0x3f37('0x1d')](_0x388631);}};}function respondWithFilteredResult(_0x57108a,_0x508ff0){return function(_0x49d411){if(_0x49d411){var _0x2e4e82=typeof _0x508ff0['offset']===_0x3f37('0x1e')&&typeof _0x508ff0[_0x3f37('0x1f')]===_0x3f37('0x1e');var _0x364cdc=_0x49d411[_0x3f37('0x20')];var _0x56ee09=_0x2e4e82?0x0:_0x508ff0[_0x3f37('0x21')];var _0x32bf96=_0x2e4e82?_0x49d411[_0x3f37('0x20')]:_0x508ff0[_0x3f37('0x21')]+_0x508ff0[_0x3f37('0x1f')];var _0x2d41de;if(_0x32bf96>=_0x364cdc){_0x32bf96=_0x364cdc;_0x2d41de=0xc8;}else{_0x2d41de=0xce;}_0x57108a[_0x3f37('0x1b')](_0x2d41de);return _0x57108a[_0x3f37('0x22')](_0x3f37('0x23'),_0x56ee09+'-'+_0x32bf96+'/'+_0x364cdc)[_0x3f37('0x1d')](_0x49d411);}return null;};}function patchUpdates(_0x22705c){return function(_0x4c63fe){try{jsonpatch[_0x3f37('0x24')](_0x4c63fe,_0x22705c,!![]);}catch(_0x4bc47a){return BPromise[_0x3f37('0x25')](_0x4bc47a);}return _0x4c63fe[_0x3f37('0x26')]();};}function saveUpdates(_0x477b1f,_0x2a520f){return function(_0x46f13e){if(_0x46f13e){return _0x46f13e[_0x3f37('0x27')](_0x477b1f)[_0x3f37('0x28')](function(_0x12df29){return _0x12df29;});}return null;};}function removeEntity(_0x5989b1,_0x8dce05){return function(_0x43dc20){if(_0x43dc20){return _0x43dc20[_0x3f37('0x29')]()['then'](function(){_0x5989b1[_0x3f37('0x1b')](0xcc)[_0x3f37('0x1c')]();});}};}function handleEntityNotFound(_0x15f851,_0x75d9bf){return function(_0x2da65c){if(!_0x2da65c){_0x15f851[_0x3f37('0x1a')](0x194);}return _0x2da65c;};}function handleError(_0x36f7ce,_0xda8b88){_0xda8b88=_0xda8b88||0x1f4;return function(_0x45cea8){logger[_0x3f37('0x2a')](_0x45cea8['stack']);if(_0x45cea8[_0x3f37('0x2b')]){delete _0x45cea8[_0x3f37('0x2b')];}_0x36f7ce[_0x3f37('0x1b')](_0xda8b88)[_0x3f37('0x2c')](_0x45cea8);};}exports['index']=function(_0x4b36f8,_0x139981){var _0x44f723={},_0x41ca67={},_0x4213b9={'count':0x0,'rows':[]};var _0x5dc1cf=_[_0x3f37('0x2d')](db['Dynamics365Configuration'][_0x3f37('0x2e')],function(_0x27ef30){return{'name':_0x27ef30[_0x3f37('0x2f')],'type':_0x27ef30[_0x3f37('0x30')]['key']};});_0x41ca67[_0x3f37('0x31')]=_[_0x3f37('0x2d')](_0x5dc1cf,_0x3f37('0x2b'));_0x41ca67[_0x3f37('0x32')]=_[_0x3f37('0x33')](_0x4b36f8[_0x3f37('0x32')]);_0x41ca67[_0x3f37('0x34')]=_['intersection'](_0x41ca67[_0x3f37('0x31')],_0x41ca67['query']);_0x44f723[_0x3f37('0x35')]=_[_0x3f37('0x36')](_0x41ca67[_0x3f37('0x31')],qs[_0x3f37('0x37')](_0x4b36f8['query'][_0x3f37('0x37')]));_0x44f723[_0x3f37('0x35')]=_0x44f723[_0x3f37('0x35')][_0x3f37('0x38')]?_0x44f723[_0x3f37('0x35')]:_0x41ca67[_0x3f37('0x31')];if(!_0x4b36f8[_0x3f37('0x32')][_0x3f37('0x39')](_0x3f37('0x3a'))){_0x44f723[_0x3f37('0x1f')]=qs['limit'](_0x4b36f8[_0x3f37('0x32')][_0x3f37('0x1f')]);_0x44f723[_0x3f37('0x21')]=qs[_0x3f37('0x21')](_0x4b36f8[_0x3f37('0x32')][_0x3f37('0x21')]);}_0x44f723[_0x3f37('0x3b')]=qs[_0x3f37('0x3c')](_0x4b36f8[_0x3f37('0x32')][_0x3f37('0x3c')]);_0x44f723[_0x3f37('0x3d')]=qs[_0x3f37('0x34')](_[_0x3f37('0x3e')](_0x4b36f8['query'],_0x41ca67['filters']),_0x5dc1cf);if(_0x4b36f8[_0x3f37('0x32')][_0x3f37('0x3f')]){_0x44f723[_0x3f37('0x3d')]=_[_0x3f37('0x40')](_0x44f723['where'],{'$or':_[_0x3f37('0x2d')](_0x5dc1cf,function(_0x455329){if(_0x455329[_0x3f37('0x30')]!==_0x3f37('0x41')){var _0x3f3f37={};_0x3f3f37[_0x455329[_0x3f37('0x2b')]]={'$like':'%'+_0x4b36f8[_0x3f37('0x32')][_0x3f37('0x3f')]+'%'};return _0x3f3f37;}})});}_0x44f723=_[_0x3f37('0x40')]({},_0x44f723,_0x4b36f8[_0x3f37('0x42')]);var _0x54b9b9={'where':_0x44f723['where']};return db['Dynamics365Configuration']['count'](_0x54b9b9)[_0x3f37('0x28')](function(_0x35bb02){_0x4213b9['count']=_0x35bb02;if(_0x4b36f8[_0x3f37('0x32')][_0x3f37('0x43')]){_0x44f723[_0x3f37('0x44')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x3f37('0x45')](_0x44f723);})[_0x3f37('0x28')](function(_0x2e19f1){_0x4213b9['rows']=_0x2e19f1;return _0x4213b9;})['then'](respondWithFilteredResult(_0x139981,_0x44f723))[_0x3f37('0x46')](handleError(_0x139981,null));};exports['show']=function(_0x41463e,_0x534d36){var _0x38bca2={'raw':![],'where':{'id':_0x41463e[_0x3f37('0x47')]['id']}},_0x302f66={};_0x302f66[_0x3f37('0x31')]=_[_0x3f37('0x33')](db['Dynamics365Configuration']['rawAttributes']);_0x302f66[_0x3f37('0x32')]=_[_0x3f37('0x33')](_0x41463e[_0x3f37('0x32')]);_0x302f66[_0x3f37('0x34')]=_[_0x3f37('0x36')](_0x302f66[_0x3f37('0x31')],_0x302f66[_0x3f37('0x32')]);_0x38bca2[_0x3f37('0x35')]=_['intersection'](_0x302f66[_0x3f37('0x31')],qs[_0x3f37('0x37')](_0x41463e[_0x3f37('0x32')][_0x3f37('0x37')]));_0x38bca2['attributes']=_0x38bca2[_0x3f37('0x35')][_0x3f37('0x38')]?_0x38bca2[_0x3f37('0x35')]:_0x302f66[_0x3f37('0x31')];if(_0x41463e[_0x3f37('0x32')][_0x3f37('0x43')]){_0x38bca2[_0x3f37('0x44')]=[{'all':!![]}];}_0x38bca2=_[_0x3f37('0x40')]({},_0x38bca2,_0x41463e['options']);return db['Dynamics365Configuration']['find'](_0x38bca2)[_0x3f37('0x28')](handleEntityNotFound(_0x534d36,null))[_0x3f37('0x28')](respondWithResult(_0x534d36,null))[_0x3f37('0x46')](handleError(_0x534d36,null));};exports[_0x3f37('0x48')]=function(_0x5df56b,_0x1b324f){return db[_0x3f37('0x49')][_0x3f37('0x48')](_0x5df56b['body'],{})[_0x3f37('0x28')](respondWithResult(_0x1b324f,0xc9))[_0x3f37('0x46')](handleError(_0x1b324f,null));};exports[_0x3f37('0x27')]=function(_0x1d16d5,_0xdbc8a2){if(_0x1d16d5[_0x3f37('0x4a')]['id']){delete _0x1d16d5[_0x3f37('0x4a')]['id'];}return db[_0x3f37('0x49')][_0x3f37('0x4b')]({'where':{'id':_0x1d16d5[_0x3f37('0x47')]['id']}})['then'](handleEntityNotFound(_0xdbc8a2,null))['then'](saveUpdates(_0x1d16d5[_0x3f37('0x4a')],null))[_0x3f37('0x28')](respondWithResult(_0xdbc8a2,null))['catch'](handleError(_0xdbc8a2,null));};exports[_0x3f37('0x29')]=function(_0x2d0248,_0x5ed1fe){return db['Dynamics365Configuration']['find']({'where':{'id':_0x2d0248[_0x3f37('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ed1fe,null))[_0x3f37('0x28')](removeEntity(_0x5ed1fe,null))[_0x3f37('0x46')](handleError(_0x5ed1fe,null));};exports[_0x3f37('0x4c')]=function(_0x3fddbb,_0x242e90,_0x2b94d4){var _0x21be6c={};var _0x25fd9a={};var _0x523a1f;var _0x2942fb;return db[_0x3f37('0x49')][_0x3f37('0x4d')]({'where':{'id':_0x3fddbb[_0x3f37('0x47')]['id']}})[_0x3f37('0x28')](handleEntityNotFound(_0x242e90,null))[_0x3f37('0x28')](function(_0x4433e7){if(_0x4433e7){_0x523a1f=_0x4433e7;_0x25fd9a[_0x3f37('0x31')]=_[_0x3f37('0x33')](db[_0x3f37('0x4e')][_0x3f37('0x2e')]);_0x25fd9a[_0x3f37('0x32')]=_[_0x3f37('0x33')](_0x3fddbb[_0x3f37('0x32')]);_0x25fd9a['filters']=_[_0x3f37('0x36')](_0x25fd9a['model'],_0x25fd9a[_0x3f37('0x32')]);_0x21be6c[_0x3f37('0x35')]=_[_0x3f37('0x36')](_0x25fd9a[_0x3f37('0x31')],qs['fields'](_0x3fddbb['query'][_0x3f37('0x37')]));_0x21be6c[_0x3f37('0x35')]=_0x21be6c['attributes'][_0x3f37('0x38')]?_0x21be6c[_0x3f37('0x35')]:_0x25fd9a['model'];_0x21be6c[_0x3f37('0x3b')]=qs['sort'](_0x3fddbb['query'][_0x3f37('0x3c')]);_0x21be6c['where']=qs['filters'](_['pick'](_0x3fddbb[_0x3f37('0x32')],_0x25fd9a[_0x3f37('0x34')]));if(_0x3fddbb[_0x3f37('0x32')][_0x3f37('0x3f')]){_0x21be6c[_0x3f37('0x3d')]=_[_0x3f37('0x40')](_0x21be6c['where'],{'$or':_[_0x3f37('0x2d')](_0x21be6c['attributes'],function(_0x38112e){var _0x1e2b05={};_0x1e2b05[_0x38112e]={'$like':'%'+_0x3fddbb['query'][_0x3f37('0x3f')]+'%'};return _0x1e2b05;})});}_0x21be6c=_[_0x3f37('0x40')]({},_0x21be6c,_0x3fddbb[_0x3f37('0x42')]);return _0x523a1f[_0x3f37('0x4c')](_0x21be6c);}})[_0x3f37('0x28')](function(_0x2a1a7a){if(_0x2a1a7a){_0x2942fb=_0x2a1a7a[_0x3f37('0x38')];if(!_0x3fddbb[_0x3f37('0x32')][_0x3f37('0x39')]('nolimit')){_0x21be6c[_0x3f37('0x1f')]=qs['limit'](_0x3fddbb[_0x3f37('0x32')]['limit']);_0x21be6c['offset']=qs[_0x3f37('0x21')](_0x3fddbb[_0x3f37('0x32')][_0x3f37('0x21')]);}return _0x523a1f[_0x3f37('0x4c')](_0x21be6c);}})[_0x3f37('0x28')](function(_0x2cc5c2){if(_0x2cc5c2){return _0x2cc5c2?{'count':_0x2942fb,'rows':_0x2cc5c2}:null;}})[_0x3f37('0x28')](respondWithResult(_0x242e90,null))[_0x3f37('0x46')](handleError(_0x242e90,null));};exports['getSubjects']=function(_0x1029e3,_0x2e36b4,_0x1a7a6d){var _0xa03ff5={};var _0x2ddcbe={};var _0xa2c9ca;var _0x5008d7;return db[_0x3f37('0x49')]['findOne']({'where':{'id':_0x1029e3[_0x3f37('0x47')]['id']}})[_0x3f37('0x28')](handleEntityNotFound(_0x2e36b4,null))[_0x3f37('0x28')](function(_0x3bcdc7){if(_0x3bcdc7){_0xa2c9ca=_0x3bcdc7;_0x2ddcbe[_0x3f37('0x31')]=_[_0x3f37('0x33')](db['Dynamics365Field'][_0x3f37('0x2e')]);_0x2ddcbe['query']=_[_0x3f37('0x33')](_0x1029e3[_0x3f37('0x32')]);_0x2ddcbe['filters']=_['intersection'](_0x2ddcbe[_0x3f37('0x31')],_0x2ddcbe[_0x3f37('0x32')]);_0xa03ff5[_0x3f37('0x35')]=_['intersection'](_0x2ddcbe[_0x3f37('0x31')],qs['fields'](_0x1029e3[_0x3f37('0x32')][_0x3f37('0x37')]));_0xa03ff5[_0x3f37('0x35')]=_0xa03ff5[_0x3f37('0x35')][_0x3f37('0x38')]?_0xa03ff5[_0x3f37('0x35')]:_0x2ddcbe[_0x3f37('0x31')];_0xa03ff5['order']=qs[_0x3f37('0x3c')](_0x1029e3[_0x3f37('0x32')][_0x3f37('0x3c')]);_0xa03ff5[_0x3f37('0x3d')]=qs[_0x3f37('0x34')](_['pick'](_0x1029e3[_0x3f37('0x32')],_0x2ddcbe[_0x3f37('0x34')]));if(_0x1029e3[_0x3f37('0x32')][_0x3f37('0x3f')]){_0xa03ff5[_0x3f37('0x3d')]=_[_0x3f37('0x40')](_0xa03ff5['where'],{'$or':_[_0x3f37('0x2d')](_0xa03ff5['attributes'],function(_0x1d6d06){var _0x181d4d={};_0x181d4d[_0x1d6d06]={'$like':'%'+_0x1029e3[_0x3f37('0x32')][_0x3f37('0x3f')]+'%'};return _0x181d4d;})});}_0xa03ff5=_[_0x3f37('0x40')]({},_0xa03ff5,_0x1029e3['options']);return _0xa2c9ca[_0x3f37('0x4f')](_0xa03ff5);}})[_0x3f37('0x28')](function(_0x54a57a){if(_0x54a57a){_0x5008d7=_0x54a57a['length'];if(!_0x1029e3['query'][_0x3f37('0x39')](_0x3f37('0x3a'))){_0xa03ff5['limit']=qs[_0x3f37('0x1f')](_0x1029e3[_0x3f37('0x32')][_0x3f37('0x1f')]);_0xa03ff5['offset']=qs['offset'](_0x1029e3['query'][_0x3f37('0x21')]);}return _0xa2c9ca[_0x3f37('0x4f')](_0xa03ff5);}})['then'](function(_0x12c096){if(_0x12c096){return _0x12c096?{'count':_0x5008d7,'rows':_0x12c096}:null;}})[_0x3f37('0x28')](respondWithResult(_0x2e36b4,null))[_0x3f37('0x46')](handleError(_0x2e36b4,null));};exports['getDescriptions']=function(_0x2bf378,_0x4a4800,_0x21bfb6){var _0x376e91={};var _0xc68965={};var _0x23667d;var _0x10e49f;return db['Dynamics365Configuration'][_0x3f37('0x4d')]({'where':{'id':_0x2bf378['params']['id']}})[_0x3f37('0x28')](handleEntityNotFound(_0x4a4800,null))['then'](function(_0xc76b56){if(_0xc76b56){_0x23667d=_0xc76b56;_0xc68965['model']=_[_0x3f37('0x33')](db[_0x3f37('0x4e')][_0x3f37('0x2e')]);_0xc68965[_0x3f37('0x32')]=_['keys'](_0x2bf378[_0x3f37('0x32')]);_0xc68965[_0x3f37('0x34')]=_[_0x3f37('0x36')](_0xc68965[_0x3f37('0x31')],_0xc68965[_0x3f37('0x32')]);_0x376e91[_0x3f37('0x35')]=_[_0x3f37('0x36')](_0xc68965[_0x3f37('0x31')],qs[_0x3f37('0x37')](_0x2bf378[_0x3f37('0x32')]['fields']));_0x376e91['attributes']=_0x376e91[_0x3f37('0x35')][_0x3f37('0x38')]?_0x376e91[_0x3f37('0x35')]:_0xc68965[_0x3f37('0x31')];_0x376e91[_0x3f37('0x3b')]=qs[_0x3f37('0x3c')](_0x2bf378[_0x3f37('0x32')]['sort']);_0x376e91['where']=qs['filters'](_[_0x3f37('0x3e')](_0x2bf378[_0x3f37('0x32')],_0xc68965[_0x3f37('0x34')]));if(_0x2bf378[_0x3f37('0x32')]['filter']){_0x376e91['where']=_[_0x3f37('0x40')](_0x376e91[_0x3f37('0x3d')],{'$or':_['map'](_0x376e91[_0x3f37('0x35')],function(_0x5ddf0f){var _0x33acf7={};_0x33acf7[_0x5ddf0f]={'$like':'%'+_0x2bf378[_0x3f37('0x32')][_0x3f37('0x3f')]+'%'};return _0x33acf7;})});}_0x376e91=_['merge']({},_0x376e91,_0x2bf378[_0x3f37('0x42')]);return _0x23667d[_0x3f37('0x50')](_0x376e91);}})[_0x3f37('0x28')](function(_0x574f37){if(_0x574f37){_0x10e49f=_0x574f37['length'];if(!_0x2bf378[_0x3f37('0x32')]['hasOwnProperty'](_0x3f37('0x3a'))){_0x376e91['limit']=qs['limit'](_0x2bf378['query'][_0x3f37('0x1f')]);_0x376e91[_0x3f37('0x21')]=qs['offset'](_0x2bf378[_0x3f37('0x32')]['offset']);}return _0x23667d[_0x3f37('0x50')](_0x376e91);}})['then'](function(_0x5e8379){if(_0x5e8379){return _0x5e8379?{'count':_0x10e49f,'rows':_0x5e8379}:null;}})[_0x3f37('0x28')](respondWithResult(_0x4a4800,null))[_0x3f37('0x46')](handleError(_0x4a4800,null));}; \ No newline at end of file +var _0x3df9=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','name','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','Dynamics365Configuration','includeAll','include','catch','params','rawAttributes','find','create','body','getFields','findOne','Dynamics365Field','filter','hasOwnProperty','getSubjects','getDescriptions','zip-dir','request-promise','moment'];(function(_0x343090,_0x433a80){var _0x3ff3e8=function(_0x16c811){while(--_0x16c811){_0x343090['push'](_0x343090['shift']());}};_0x3ff3e8(++_0x433a80);}(_0x3df9,0x1d1));var _0x93df=function(_0x2e69a6,_0x80d37f){_0x2e69a6=_0x2e69a6-0x0;var _0x16afb3=_0x3df9[_0x2e69a6];return _0x16afb3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x93df('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x93df('0x1'));var moment=require(_0x93df('0x2'));var BPromise=require(_0x93df('0x3'));var Mustache=require(_0x93df('0x4'));var util=require(_0x93df('0x5'));var path=require(_0x93df('0x6'));var sox=require('sox');var csv=require(_0x93df('0x7'));var ejs=require(_0x93df('0x8'));var fs=require('fs');var fs_extra=require(_0x93df('0x9'));var _=require(_0x93df('0xa'));var squel=require(_0x93df('0xb'));var crypto=require(_0x93df('0xc'));var jsforce=require(_0x93df('0xd'));var deskjs=require(_0x93df('0xe'));var toCsv=require(_0x93df('0x7'));var querystring=require(_0x93df('0xf'));var Papa=require(_0x93df('0x10'));var Redis=require(_0x93df('0x11'));var authService=require(_0x93df('0x12'));var qs=require(_0x93df('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x93df('0x14'))(_0x93df('0x15'));var utils=require(_0x93df('0x16'));var config=require(_0x93df('0x17'));var licenseUtil=require(_0x93df('0x18'));var db=require(_0x93df('0x19'))['db'];function respondWithStatusCode(_0xcd8c51,_0x3f49a3){_0x3f49a3=_0x3f49a3||0xcc;return function(_0x26c9ef){if(_0x26c9ef){return _0xcd8c51[_0x93df('0x1a')](_0x3f49a3);}return _0xcd8c51[_0x93df('0x1b')](_0x3f49a3)[_0x93df('0x1c')]();};}function respondWithResult(_0xe23548,_0x5af5c0){_0x5af5c0=_0x5af5c0||0xc8;return function(_0x518df2){if(_0x518df2){return _0xe23548['status'](_0x5af5c0)[_0x93df('0x1d')](_0x518df2);}};}function respondWithFilteredResult(_0x3669b1,_0x2b99b8){return function(_0x5f89ef){if(_0x5f89ef){var _0x2ee63b=typeof _0x2b99b8[_0x93df('0x1e')]===_0x93df('0x1f')&&typeof _0x2b99b8[_0x93df('0x20')]===_0x93df('0x1f');var _0x80ea74=_0x5f89ef[_0x93df('0x21')];var _0x49fde0=_0x2ee63b?0x0:_0x2b99b8[_0x93df('0x1e')];var _0x245ade=_0x2ee63b?_0x5f89ef[_0x93df('0x21')]:_0x2b99b8[_0x93df('0x1e')]+_0x2b99b8[_0x93df('0x20')];var _0x465c86;if(_0x245ade>=_0x80ea74){_0x245ade=_0x80ea74;_0x465c86=0xc8;}else{_0x465c86=0xce;}_0x3669b1[_0x93df('0x1b')](_0x465c86);return _0x3669b1[_0x93df('0x22')](_0x93df('0x23'),_0x49fde0+'-'+_0x245ade+'/'+_0x80ea74)['json'](_0x5f89ef);}return null;};}function patchUpdates(_0x24fc86){return function(_0x2596f8){try{jsonpatch['apply'](_0x2596f8,_0x24fc86,!![]);}catch(_0x15ef3e){return BPromise[_0x93df('0x24')](_0x15ef3e);}return _0x2596f8['save']();};}function saveUpdates(_0x239003,_0x3b21a7){return function(_0x585233){if(_0x585233){return _0x585233[_0x93df('0x25')](_0x239003)[_0x93df('0x26')](function(_0x3e10d7){return _0x3e10d7;});}return null;};}function removeEntity(_0x668958,_0xf326d1){return function(_0x5095be){if(_0x5095be){return _0x5095be[_0x93df('0x27')]()[_0x93df('0x26')](function(){_0x668958[_0x93df('0x1b')](0xcc)[_0x93df('0x1c')]();});}};}function handleEntityNotFound(_0x4024f3,_0x248d97){return function(_0x480498){if(!_0x480498){_0x4024f3[_0x93df('0x1a')](0x194);}return _0x480498;};}function handleError(_0x23d194,_0x522684){_0x522684=_0x522684||0x1f4;return function(_0x185265){logger[_0x93df('0x28')](_0x185265['stack']);if(_0x185265[_0x93df('0x29')]){delete _0x185265['name'];}_0x23d194[_0x93df('0x1b')](_0x522684)['send'](_0x185265);};}exports['index']=function(_0x16bcb3,_0x4c545b){var _0xaadfa6={},_0x5b2076={},_0x35d98b={'count':0x0,'rows':[]};var _0x518e09=_[_0x93df('0x2a')](db['Dynamics365Configuration']['rawAttributes'],function(_0x4ea7bf){return{'name':_0x4ea7bf[_0x93df('0x2b')],'type':_0x4ea7bf['type'][_0x93df('0x2c')]};});_0x5b2076[_0x93df('0x2d')]=_[_0x93df('0x2a')](_0x518e09,_0x93df('0x29'));_0x5b2076[_0x93df('0x2e')]=_[_0x93df('0x2f')](_0x16bcb3[_0x93df('0x2e')]);_0x5b2076[_0x93df('0x30')]=_[_0x93df('0x31')](_0x5b2076[_0x93df('0x2d')],_0x5b2076[_0x93df('0x2e')]);_0xaadfa6[_0x93df('0x32')]=_['intersection'](_0x5b2076[_0x93df('0x2d')],qs[_0x93df('0x33')](_0x16bcb3['query'][_0x93df('0x33')]));_0xaadfa6[_0x93df('0x32')]=_0xaadfa6[_0x93df('0x32')][_0x93df('0x34')]?_0xaadfa6[_0x93df('0x32')]:_0x5b2076[_0x93df('0x2d')];if(!_0x16bcb3[_0x93df('0x2e')]['hasOwnProperty'](_0x93df('0x35'))){_0xaadfa6[_0x93df('0x20')]=qs[_0x93df('0x20')](_0x16bcb3[_0x93df('0x2e')]['limit']);_0xaadfa6[_0x93df('0x1e')]=qs[_0x93df('0x1e')](_0x16bcb3['query']['offset']);}_0xaadfa6[_0x93df('0x36')]=qs['sort'](_0x16bcb3[_0x93df('0x2e')][_0x93df('0x37')]);_0xaadfa6[_0x93df('0x38')]=qs['filters'](_[_0x93df('0x39')](_0x16bcb3['query'],_0x5b2076[_0x93df('0x30')]),_0x518e09);if(_0x16bcb3[_0x93df('0x2e')]['filter']){_0xaadfa6[_0x93df('0x38')]=_[_0x93df('0x3a')](_0xaadfa6[_0x93df('0x38')],{'$or':_[_0x93df('0x2a')](_0x518e09,function(_0x8a246d){if(_0x8a246d[_0x93df('0x3b')]!==_0x93df('0x3c')){var _0x3f739d={};_0x3f739d[_0x8a246d['name']]={'$like':'%'+_0x16bcb3[_0x93df('0x2e')]['filter']+'%'};return _0x3f739d;}})});}_0xaadfa6=_[_0x93df('0x3a')]({},_0xaadfa6,_0x16bcb3[_0x93df('0x3d')]);var _0x370076={'where':_0xaadfa6[_0x93df('0x38')]};return db[_0x93df('0x3e')]['count'](_0x370076)[_0x93df('0x26')](function(_0xdce346){_0x35d98b[_0x93df('0x21')]=_0xdce346;if(_0x16bcb3[_0x93df('0x2e')][_0x93df('0x3f')]){_0xaadfa6[_0x93df('0x40')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0xaadfa6);})[_0x93df('0x26')](function(_0x4f40aa){_0x35d98b['rows']=_0x4f40aa;return _0x35d98b;})['then'](respondWithFilteredResult(_0x4c545b,_0xaadfa6))[_0x93df('0x41')](handleError(_0x4c545b,null));};exports['show']=function(_0x387e4c,_0x4978da){var _0x5804aa={'raw':![],'where':{'id':_0x387e4c[_0x93df('0x42')]['id']}},_0x54e6cc={};_0x54e6cc[_0x93df('0x2d')]=_[_0x93df('0x2f')](db[_0x93df('0x3e')][_0x93df('0x43')]);_0x54e6cc[_0x93df('0x2e')]=_[_0x93df('0x2f')](_0x387e4c['query']);_0x54e6cc[_0x93df('0x30')]=_[_0x93df('0x31')](_0x54e6cc[_0x93df('0x2d')],_0x54e6cc['query']);_0x5804aa['attributes']=_[_0x93df('0x31')](_0x54e6cc[_0x93df('0x2d')],qs[_0x93df('0x33')](_0x387e4c[_0x93df('0x2e')]['fields']));_0x5804aa['attributes']=_0x5804aa[_0x93df('0x32')]['length']?_0x5804aa[_0x93df('0x32')]:_0x54e6cc[_0x93df('0x2d')];if(_0x387e4c['query'][_0x93df('0x3f')]){_0x5804aa[_0x93df('0x40')]=[{'all':!![]}];}_0x5804aa=_[_0x93df('0x3a')]({},_0x5804aa,_0x387e4c[_0x93df('0x3d')]);return db[_0x93df('0x3e')][_0x93df('0x44')](_0x5804aa)[_0x93df('0x26')](handleEntityNotFound(_0x4978da,null))['then'](respondWithResult(_0x4978da,null))[_0x93df('0x41')](handleError(_0x4978da,null));};exports[_0x93df('0x45')]=function(_0x24521b,_0xe23428){return db[_0x93df('0x3e')][_0x93df('0x45')](_0x24521b[_0x93df('0x46')],{})[_0x93df('0x26')](respondWithResult(_0xe23428,0xc9))['catch'](handleError(_0xe23428,null));};exports['update']=function(_0x2b5618,_0x408723){if(_0x2b5618[_0x93df('0x46')]['id']){delete _0x2b5618['body']['id'];}return db['Dynamics365Configuration'][_0x93df('0x44')]({'where':{'id':_0x2b5618[_0x93df('0x42')]['id']}})[_0x93df('0x26')](handleEntityNotFound(_0x408723,null))[_0x93df('0x26')](saveUpdates(_0x2b5618[_0x93df('0x46')],null))[_0x93df('0x26')](respondWithResult(_0x408723,null))[_0x93df('0x41')](handleError(_0x408723,null));};exports[_0x93df('0x27')]=function(_0x2217a9,_0x1e22f8){return db[_0x93df('0x3e')][_0x93df('0x44')]({'where':{'id':_0x2217a9[_0x93df('0x42')]['id']}})[_0x93df('0x26')](handleEntityNotFound(_0x1e22f8,null))[_0x93df('0x26')](removeEntity(_0x1e22f8,null))[_0x93df('0x41')](handleError(_0x1e22f8,null));};exports[_0x93df('0x47')]=function(_0x347985,_0x3e2418,_0x1094c2){var _0x3f5c0c={};var _0x3d790e={};var _0x195ab8;var _0x3872fe;return db['Dynamics365Configuration'][_0x93df('0x48')]({'where':{'id':_0x347985[_0x93df('0x42')]['id']}})[_0x93df('0x26')](handleEntityNotFound(_0x3e2418,null))[_0x93df('0x26')](function(_0xc2c1ac){if(_0xc2c1ac){_0x195ab8=_0xc2c1ac;_0x3d790e[_0x93df('0x2d')]=_['keys'](db[_0x93df('0x49')][_0x93df('0x43')]);_0x3d790e['query']=_[_0x93df('0x2f')](_0x347985[_0x93df('0x2e')]);_0x3d790e[_0x93df('0x30')]=_[_0x93df('0x31')](_0x3d790e[_0x93df('0x2d')],_0x3d790e[_0x93df('0x2e')]);_0x3f5c0c[_0x93df('0x32')]=_[_0x93df('0x31')](_0x3d790e[_0x93df('0x2d')],qs['fields'](_0x347985[_0x93df('0x2e')][_0x93df('0x33')]));_0x3f5c0c['attributes']=_0x3f5c0c[_0x93df('0x32')]['length']?_0x3f5c0c[_0x93df('0x32')]:_0x3d790e[_0x93df('0x2d')];_0x3f5c0c[_0x93df('0x36')]=qs['sort'](_0x347985[_0x93df('0x2e')][_0x93df('0x37')]);_0x3f5c0c[_0x93df('0x38')]=qs[_0x93df('0x30')](_[_0x93df('0x39')](_0x347985[_0x93df('0x2e')],_0x3d790e[_0x93df('0x30')]));if(_0x347985[_0x93df('0x2e')]['filter']){_0x3f5c0c[_0x93df('0x38')]=_[_0x93df('0x3a')](_0x3f5c0c['where'],{'$or':_['map'](_0x3f5c0c['attributes'],function(_0x5b4211){var _0x53043e={};_0x53043e[_0x5b4211]={'$like':'%'+_0x347985[_0x93df('0x2e')][_0x93df('0x4a')]+'%'};return _0x53043e;})});}_0x3f5c0c=_[_0x93df('0x3a')]({},_0x3f5c0c,_0x347985['options']);return _0x195ab8[_0x93df('0x47')](_0x3f5c0c);}})['then'](function(_0xe96e8){if(_0xe96e8){_0x3872fe=_0xe96e8[_0x93df('0x34')];if(!_0x347985[_0x93df('0x2e')][_0x93df('0x4b')](_0x93df('0x35'))){_0x3f5c0c['limit']=qs[_0x93df('0x20')](_0x347985[_0x93df('0x2e')][_0x93df('0x20')]);_0x3f5c0c[_0x93df('0x1e')]=qs['offset'](_0x347985[_0x93df('0x2e')]['offset']);}return _0x195ab8[_0x93df('0x47')](_0x3f5c0c);}})['then'](function(_0x554c26){if(_0x554c26){return _0x554c26?{'count':_0x3872fe,'rows':_0x554c26}:null;}})[_0x93df('0x26')](respondWithResult(_0x3e2418,null))[_0x93df('0x41')](handleError(_0x3e2418,null));};exports[_0x93df('0x4c')]=function(_0x1f622d,_0x5ea6ff,_0x4a9b4c){var _0x21ddf2={};var _0x2b0659={};var _0xa7f5ae;var _0x9d0fe4;return db[_0x93df('0x3e')][_0x93df('0x48')]({'where':{'id':_0x1f622d[_0x93df('0x42')]['id']}})[_0x93df('0x26')](handleEntityNotFound(_0x5ea6ff,null))[_0x93df('0x26')](function(_0x29e662){if(_0x29e662){_0xa7f5ae=_0x29e662;_0x2b0659[_0x93df('0x2d')]=_[_0x93df('0x2f')](db[_0x93df('0x49')]['rawAttributes']);_0x2b0659[_0x93df('0x2e')]=_['keys'](_0x1f622d[_0x93df('0x2e')]);_0x2b0659[_0x93df('0x30')]=_[_0x93df('0x31')](_0x2b0659['model'],_0x2b0659['query']);_0x21ddf2[_0x93df('0x32')]=_[_0x93df('0x31')](_0x2b0659['model'],qs[_0x93df('0x33')](_0x1f622d['query'][_0x93df('0x33')]));_0x21ddf2[_0x93df('0x32')]=_0x21ddf2['attributes']['length']?_0x21ddf2[_0x93df('0x32')]:_0x2b0659[_0x93df('0x2d')];_0x21ddf2[_0x93df('0x36')]=qs['sort'](_0x1f622d[_0x93df('0x2e')][_0x93df('0x37')]);_0x21ddf2[_0x93df('0x38')]=qs[_0x93df('0x30')](_[_0x93df('0x39')](_0x1f622d['query'],_0x2b0659['filters']));if(_0x1f622d[_0x93df('0x2e')][_0x93df('0x4a')]){_0x21ddf2[_0x93df('0x38')]=_[_0x93df('0x3a')](_0x21ddf2[_0x93df('0x38')],{'$or':_['map'](_0x21ddf2[_0x93df('0x32')],function(_0x56a61c){var _0x5de2f3={};_0x5de2f3[_0x56a61c]={'$like':'%'+_0x1f622d[_0x93df('0x2e')][_0x93df('0x4a')]+'%'};return _0x5de2f3;})});}_0x21ddf2=_[_0x93df('0x3a')]({},_0x21ddf2,_0x1f622d['options']);return _0xa7f5ae['getSubjects'](_0x21ddf2);}})[_0x93df('0x26')](function(_0x5648af){if(_0x5648af){_0x9d0fe4=_0x5648af[_0x93df('0x34')];if(!_0x1f622d[_0x93df('0x2e')]['hasOwnProperty'](_0x93df('0x35'))){_0x21ddf2[_0x93df('0x20')]=qs[_0x93df('0x20')](_0x1f622d[_0x93df('0x2e')][_0x93df('0x20')]);_0x21ddf2['offset']=qs[_0x93df('0x1e')](_0x1f622d['query']['offset']);}return _0xa7f5ae['getSubjects'](_0x21ddf2);}})[_0x93df('0x26')](function(_0x5a5458){if(_0x5a5458){return _0x5a5458?{'count':_0x9d0fe4,'rows':_0x5a5458}:null;}})[_0x93df('0x26')](respondWithResult(_0x5ea6ff,null))[_0x93df('0x41')](handleError(_0x5ea6ff,null));};exports[_0x93df('0x4d')]=function(_0x26391d,_0x1f92a0,_0x34247c){var _0xc62c91={};var _0xb63475={};var _0x4d1916;var _0x431602;return db['Dynamics365Configuration'][_0x93df('0x48')]({'where':{'id':_0x26391d['params']['id']}})[_0x93df('0x26')](handleEntityNotFound(_0x1f92a0,null))[_0x93df('0x26')](function(_0xecdeb4){if(_0xecdeb4){_0x4d1916=_0xecdeb4;_0xb63475[_0x93df('0x2d')]=_[_0x93df('0x2f')](db[_0x93df('0x49')][_0x93df('0x43')]);_0xb63475['query']=_['keys'](_0x26391d['query']);_0xb63475['filters']=_[_0x93df('0x31')](_0xb63475[_0x93df('0x2d')],_0xb63475[_0x93df('0x2e')]);_0xc62c91['attributes']=_[_0x93df('0x31')](_0xb63475[_0x93df('0x2d')],qs[_0x93df('0x33')](_0x26391d[_0x93df('0x2e')][_0x93df('0x33')]));_0xc62c91[_0x93df('0x32')]=_0xc62c91['attributes'][_0x93df('0x34')]?_0xc62c91[_0x93df('0x32')]:_0xb63475[_0x93df('0x2d')];_0xc62c91[_0x93df('0x36')]=qs[_0x93df('0x37')](_0x26391d[_0x93df('0x2e')][_0x93df('0x37')]);_0xc62c91[_0x93df('0x38')]=qs[_0x93df('0x30')](_[_0x93df('0x39')](_0x26391d['query'],_0xb63475[_0x93df('0x30')]));if(_0x26391d['query']['filter']){_0xc62c91[_0x93df('0x38')]=_[_0x93df('0x3a')](_0xc62c91[_0x93df('0x38')],{'$or':_[_0x93df('0x2a')](_0xc62c91[_0x93df('0x32')],function(_0x415963){var _0x1f2f63={};_0x1f2f63[_0x415963]={'$like':'%'+_0x26391d[_0x93df('0x2e')][_0x93df('0x4a')]+'%'};return _0x1f2f63;})});}_0xc62c91=_[_0x93df('0x3a')]({},_0xc62c91,_0x26391d[_0x93df('0x3d')]);return _0x4d1916[_0x93df('0x4d')](_0xc62c91);}})['then'](function(_0x1ad170){if(_0x1ad170){_0x431602=_0x1ad170[_0x93df('0x34')];if(!_0x26391d[_0x93df('0x2e')][_0x93df('0x4b')](_0x93df('0x35'))){_0xc62c91['limit']=qs[_0x93df('0x20')](_0x26391d[_0x93df('0x2e')][_0x93df('0x20')]);_0xc62c91[_0x93df('0x1e')]=qs['offset'](_0x26391d['query'][_0x93df('0x1e')]);}return _0x4d1916[_0x93df('0x4d')](_0xc62c91);}})['then'](function(_0x571abf){if(_0x571abf){return _0x571abf?{'count':_0x431602,'rows':_0x571abf}:null;}})[_0x93df('0x26')](respondWithResult(_0x1f92a0,null))[_0x93df('0x41')](handleError(_0x1f92a0,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index e27ce34..c0ad508 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa41a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','int_dynamics365_configurations','lodash','util','api'];(function(_0x37f4b7,_0x2d19c2){var _0x330efd=function(_0x431dc4){while(--_0x431dc4){_0x37f4b7['push'](_0x37f4b7['shift']());}};_0x330efd(++_0x2d19c2);}(_0xa41a,0x6b));var _0xaa41=function(_0x15b54f,_0x2e6111){_0x15b54f=_0x15b54f-0x0;var _0xff3878=_0xa41a[_0x15b54f];return _0xff3878;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('Dynamics365Configuration',attributes,{'tableName':_0xaa41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5b3=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xe5b3,0x133));var _0x3e5b=function(_0x580684,_0x2ec7e4){_0x580684=_0x580684-0x0;var _0x16da54=_0xe5b3[_0x580684];return _0x16da54;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var logger=require(_0x3e5b('0x1'))(_0x3e5b('0x2'));var moment=require(_0x3e5b('0x3'));var BPromise=require(_0x3e5b('0x4'));var rp=require(_0x3e5b('0x5'));var fs=require('fs');var path=require(_0x3e5b('0x6'));var rimraf=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var attributes=require(_0x3e5b('0x9'));module[_0x3e5b('0xa')]=function(_0x54e1fb,_0x174923){return _0x54e1fb[_0x3e5b('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0x3e5b('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 c6380ef..84f2268 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 _0x32f5=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0xaeed12,_0x309d56){var _0x358db4=function(_0x2c3523){while(--_0x2c3523){_0xaeed12['push'](_0xaeed12['shift']());}};_0x358db4(++_0x309d56);}(_0x32f5,0xb5));var _0x532f=function(_0x28570d,_0x36a2af){_0x28570d=_0x28570d-0x0;var _0x24e74a=_0x32f5[_0x28570d];return _0x24e74a;};'use strict';var _=require(_0x532f('0x0'));var util=require(_0x532f('0x1'));var moment=require(_0x532f('0x2'));var BPromise=require(_0x532f('0x3'));var rs=require(_0x532f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x532f('0x5'))['db'];var utils=require(_0x532f('0x6'));var logger=require(_0x532f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x532f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36fb39,_0xff8e02,_0x221bd5){return new BPromise(function(_0x509210,_0x275b4b){return client[_0x532f('0x9')](_0x36fb39,_0x221bd5)['then'](function(_0x195d21){logger[_0x532f('0xa')](_0x532f('0xb'),_0xff8e02,_0x532f('0xc'));logger[_0x532f('0xd')](_0x532f('0xe'),_0xff8e02,'request\x20sent',JSON[_0x532f('0xf')](_0x195d21));if(_0x195d21[_0x532f('0x10')]){if(_0x195d21[_0x532f('0x10')]['code']===0x1f4){logger[_0x532f('0x10')](_0x532f('0xb'),_0xff8e02,_0x195d21[_0x532f('0x10')][_0x532f('0x11')]);return _0x275b4b(_0x195d21['error'][_0x532f('0x11')]);}logger[_0x532f('0x10')](_0x532f('0xb'),_0xff8e02,_0x195d21[_0x532f('0x10')][_0x532f('0x11')]);return _0x509210(_0x195d21[_0x532f('0x10')][_0x532f('0x11')]);}else{logger[_0x532f('0xa')](_0x532f('0xb'),_0xff8e02,_0x532f('0xc'));_0x509210(_0x195d21[_0x532f('0x12')][_0x532f('0x11')]);}})[_0x532f('0x13')](function(_0x6ac1a1){logger[_0x532f('0x10')](_0x532f('0xb'),_0xff8e02,_0x6ac1a1);_0x275b4b(_0x6ac1a1);});});} \ No newline at end of file +var _0x4f36=['../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x27f685,_0x50a953){var _0x4e4546=function(_0x3dcf38){while(--_0x3dcf38){_0x27f685['push'](_0x27f685['shift']());}};_0x4e4546(++_0x50a953);}(_0x4f36,0xed));var _0x64f3=function(_0x915de9,_0xabf9e5){_0x915de9=_0x915de9-0x0;var _0x274129=_0x4f36[_0x915de9];return _0x274129;};'use strict';var _=require(_0x64f3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x64f3('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x64f3('0x2'))('rpc');var config=require('../../config/environment');var jayson=require(_0x64f3('0x3'));var client=jayson[_0x64f3('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0xaa690b,_0x540bb1,_0x31e18f){return new BPromise(function(_0x3c34e8,_0x21765e){return client[_0x64f3('0x5')](_0xaa690b,_0x31e18f)[_0x64f3('0x6')](function(_0x761735){logger[_0x64f3('0x7')](_0x64f3('0x8'),_0x540bb1,_0x64f3('0x9'));logger[_0x64f3('0xa')](_0x64f3('0xb'),_0x540bb1,_0x64f3('0x9'),JSON[_0x64f3('0xc')](_0x761735));if(_0x761735[_0x64f3('0xd')]){if(_0x761735[_0x64f3('0xd')]['code']===0x1f4){logger[_0x64f3('0xd')](_0x64f3('0x8'),_0x540bb1,_0x761735['error'][_0x64f3('0xe')]);return _0x21765e(_0x761735[_0x64f3('0xd')][_0x64f3('0xe')]);}logger[_0x64f3('0xd')](_0x64f3('0x8'),_0x540bb1,_0x761735[_0x64f3('0xd')][_0x64f3('0xe')]);return _0x3c34e8(_0x761735[_0x64f3('0xd')]['message']);}else{logger[_0x64f3('0x7')]('Dynamics365Configuration,\x20%s,\x20%s',_0x540bb1,_0x64f3('0x9'));_0x3c34e8(_0x761735[_0x64f3('0xf')][_0x64f3('0xe')]);}})[_0x64f3('0x10')](function(_0x88b269){logger[_0x64f3('0xd')](_0x64f3('0x8'),_0x540bb1,_0x88b269);_0x21765e(_0x88b269);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 1c00174..4ea205c 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 _0x9c77=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x7b6b8b,_0x583ee9){var _0x17d882=function(_0x2c5433){while(--_0x2c5433){_0x7b6b8b['push'](_0x7b6b8b['shift']());}};_0x17d882(++_0x583ee9);}(_0x9c77,0x163));var _0x79c7=function(_0x4e1642,_0x4ea92a){_0x4e1642=_0x4e1642-0x0;var _0x314317=_0x9c77[_0x4e1642];return _0x314317;};'use strict';var multer=require(_0x79c7('0x0'));var util=require(_0x79c7('0x1'));var path=require(_0x79c7('0x2'));var timeout=require(_0x79c7('0x3'));var express=require(_0x79c7('0x4'));var router=express[_0x79c7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x79c7('0x6'));var interaction=require(_0x79c7('0x7'));var config=require(_0x79c7('0x8'));var controller=require(_0x79c7('0x9'));router[_0x79c7('0xa')]('/',auth[_0x79c7('0xb')](),controller['index']);router[_0x79c7('0xa')](_0x79c7('0xc'),auth[_0x79c7('0xb')](),controller[_0x79c7('0xd')]);router[_0x79c7('0xe')]('/',auth['isAuthenticated'](),controller[_0x79c7('0xf')]);router[_0x79c7('0x10')](_0x79c7('0xc'),auth[_0x79c7('0xb')](),controller['update']);router[_0x79c7('0x11')](_0x79c7('0xc'),auth[_0x79c7('0xb')](),controller[_0x79c7('0x12')]);module[_0x79c7('0x13')]=router; \ No newline at end of file +var _0xdf87=['./intDynamics365Field.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','multer','util','path','Router','../../components/interaction/service','../../config/environment'];(function(_0x2b0782,_0x7efaf7){var _0x5616b5=function(_0x5c2d7a){while(--_0x5c2d7a){_0x2b0782['push'](_0x2b0782['shift']());}};_0x5616b5(++_0x7efaf7);}(_0xdf87,0xea));var _0x7df8=function(_0x4b1ba6,_0x351a15){_0x4b1ba6=_0x4b1ba6-0x0;var _0x59b5e0=_0xdf87[_0x4b1ba6];return _0x59b5e0;};'use strict';var multer=require(_0x7df8('0x0'));var util=require(_0x7df8('0x1'));var path=require(_0x7df8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7df8('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7df8('0x4'));var config=require(_0x7df8('0x5'));var controller=require(_0x7df8('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7df8('0x7')](_0x7df8('0x8'),auth[_0x7df8('0x9')](),controller[_0x7df8('0xa')]);router[_0x7df8('0xb')]('/',auth[_0x7df8('0x9')](),controller[_0x7df8('0xc')]);router[_0x7df8('0xd')]('/:id',auth[_0x7df8('0x9')](),controller['update']);router[_0x7df8('0xe')](_0x7df8('0x8'),auth[_0x7df8('0x9')](),controller[_0x7df8('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index e73f80d..f3eb248 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 _0x5ee0=['exports','ENUM','string','keyValue','STRING','variable','customVariable','BOOLEAN','sequelize'];(function(_0x527c39,_0x3ea2a6){var _0x3f4dd6=function(_0x1ec265){while(--_0x1ec265){_0x527c39['push'](_0x527c39['shift']());}};_0x3f4dd6(++_0x3ea2a6);}(_0x5ee0,0x155));var _0x05ee=function(_0x148921,_0x1536f5){_0x148921=_0x148921-0x0;var _0x2e3836=_0x5ee0[_0x148921];return _0x2e3836;};'use strict';var Sequelize=require(_0x05ee('0x0'));module[_0x05ee('0x1')]={'type':{'type':Sequelize[_0x05ee('0x2')](_0x05ee('0x3'),'variable','customVariable',_0x05ee('0x4'),'picklist'),'defaultValue':_0x05ee('0x3')},'content':{'type':Sequelize[_0x05ee('0x5')]},'key':{'type':Sequelize[_0x05ee('0x5')]},'keyType':{'type':Sequelize[_0x05ee('0x2')](_0x05ee('0x3'),_0x05ee('0x6'),_0x05ee('0x7'))},'keyContent':{'type':Sequelize[_0x05ee('0x5')]},'idField':{'type':Sequelize[_0x05ee('0x5')]},'nameField':{'type':Sequelize[_0x05ee('0x5')]},'customField':{'type':Sequelize[_0x05ee('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x05ee('0x5')]}}; \ No newline at end of file +var _0xdc5c=['sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN'];(function(_0x375c32,_0x40aa91){var _0x1fd9b6=function(_0x4da5c7){while(--_0x4da5c7){_0x375c32['push'](_0x375c32['shift']());}};_0x1fd9b6(++_0x40aa91);}(_0xdc5c,0xa0));var _0xcdc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc5c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcdc5('0x0'));module[_0xcdc5('0x1')]={'type':{'type':Sequelize['ENUM'](_0xcdc5('0x2'),_0xcdc5('0x3'),_0xcdc5('0x4'),_0xcdc5('0x5'),_0xcdc5('0x6')),'defaultValue':_0xcdc5('0x2')},'content':{'type':Sequelize[_0xcdc5('0x7')]},'key':{'type':Sequelize[_0xcdc5('0x7')]},'keyType':{'type':Sequelize[_0xcdc5('0x8')](_0xcdc5('0x2'),_0xcdc5('0x3'),_0xcdc5('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xcdc5('0x7')]},'nameField':{'type':Sequelize[_0xcdc5('0x7')]},'customField':{'type':Sequelize[_0xcdc5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcdc5('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index fddcfcd..1e7bcf4 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 _0xed14=['undefined','limit','count','set','apply','update','then','destroy','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x1f48e4,_0xaff442){var _0x148bad=function(_0xdd7084){while(--_0xdd7084){_0x1f48e4['push'](_0x1f48e4['shift']());}};_0x148bad(++_0xaff442);}(_0xed14,0x75));var _0x4ed1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xed14[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x4ed1('0x0'));var rimraf=require(_0x4ed1('0x1'));var zipdir=require(_0x4ed1('0x2'));var jsonpatch=require(_0x4ed1('0x3'));var rp=require('request-promise');var moment=require(_0x4ed1('0x4'));var BPromise=require(_0x4ed1('0x5'));var Mustache=require('mustache');var util=require(_0x4ed1('0x6'));var path=require(_0x4ed1('0x7'));var sox=require('sox');var csv=require(_0x4ed1('0x8'));var ejs=require(_0x4ed1('0x9'));var fs=require('fs');var fs_extra=require(_0x4ed1('0xa'));var _=require(_0x4ed1('0xb'));var squel=require(_0x4ed1('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ed1('0xd'));var toCsv=require(_0x4ed1('0x8'));var querystring=require(_0x4ed1('0xe'));var Papa=require(_0x4ed1('0xf'));var Redis=require('ioredis');var authService=require(_0x4ed1('0x10'));var qs=require(_0x4ed1('0x11'));var as=require(_0x4ed1('0x12'));var hardwareService=require(_0x4ed1('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x4ed1('0x14'));var config=require(_0x4ed1('0x15'));var licenseUtil=require(_0x4ed1('0x16'));var db=require(_0x4ed1('0x17'))['db'];function respondWithStatusCode(_0x602188,_0xe907d2){_0xe907d2=_0xe907d2||0xcc;return function(_0x41d719){if(_0x41d719){return _0x602188[_0x4ed1('0x18')](_0xe907d2);}return _0x602188[_0x4ed1('0x19')](_0xe907d2)[_0x4ed1('0x1a')]();};}function respondWithResult(_0xc97e7a,_0x13569a){_0x13569a=_0x13569a||0xc8;return function(_0x21cb7d){if(_0x21cb7d){return _0xc97e7a[_0x4ed1('0x19')](_0x13569a)[_0x4ed1('0x1b')](_0x21cb7d);}};}function respondWithFilteredResult(_0x340fc3,_0x142dd5){return function(_0x4daabd){if(_0x4daabd){var _0x461dad=typeof _0x142dd5[_0x4ed1('0x1c')]===_0x4ed1('0x1d')&&typeof _0x142dd5[_0x4ed1('0x1e')]==='undefined';var _0x621b8a=_0x4daabd[_0x4ed1('0x1f')];var _0x81e2f9=_0x461dad?0x0:_0x142dd5['offset'];var _0x5360f1=_0x461dad?_0x4daabd[_0x4ed1('0x1f')]:_0x142dd5[_0x4ed1('0x1c')]+_0x142dd5[_0x4ed1('0x1e')];var _0x1ddc70;if(_0x5360f1>=_0x621b8a){_0x5360f1=_0x621b8a;_0x1ddc70=0xc8;}else{_0x1ddc70=0xce;}_0x340fc3[_0x4ed1('0x19')](_0x1ddc70);return _0x340fc3[_0x4ed1('0x20')]('Content-Range',_0x81e2f9+'-'+_0x5360f1+'/'+_0x621b8a)[_0x4ed1('0x1b')](_0x4daabd);}return null;};}function patchUpdates(_0x44243e){return function(_0x1f6339){try{jsonpatch[_0x4ed1('0x21')](_0x1f6339,_0x44243e,!![]);}catch(_0x46139a){return BPromise['reject'](_0x46139a);}return _0x1f6339['save']();};}function saveUpdates(_0x5a1668,_0x42c879){return function(_0x57692b){if(_0x57692b){return _0x57692b[_0x4ed1('0x22')](_0x5a1668)[_0x4ed1('0x23')](function(_0x57613a){return _0x57613a;});}return null;};}function removeEntity(_0xdec01e,_0x1e091a){return function(_0x23d29b){if(_0x23d29b){return _0x23d29b[_0x4ed1('0x24')]()[_0x4ed1('0x23')](function(){_0xdec01e[_0x4ed1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x446420,_0x4c25e7){return function(_0x2f846c){if(!_0x2f846c){_0x446420[_0x4ed1('0x18')](0x194);}return _0x2f846c;};}function handleError(_0x368b7c,_0x50fc8b){_0x50fc8b=_0x50fc8b||0x1f4;return function(_0x1c0a7f){logger['error'](_0x1c0a7f[_0x4ed1('0x25')]);if(_0x1c0a7f[_0x4ed1('0x26')]){delete _0x1c0a7f[_0x4ed1('0x26')];}_0x368b7c['status'](_0x50fc8b)[_0x4ed1('0x27')](_0x1c0a7f);};}exports[_0x4ed1('0x28')]=function(_0x2b8688,_0x3a549c){var _0x109948={},_0x6cae2={},_0x75103={'count':0x0,'rows':[]};var _0x20062d=_[_0x4ed1('0x29')](db[_0x4ed1('0x2a')][_0x4ed1('0x2b')],function(_0x1e153c){return{'name':_0x1e153c[_0x4ed1('0x2c')],'type':_0x1e153c[_0x4ed1('0x2d')][_0x4ed1('0x2e')]};});_0x6cae2[_0x4ed1('0x2f')]=_[_0x4ed1('0x29')](_0x20062d,_0x4ed1('0x26'));_0x6cae2[_0x4ed1('0x30')]=_[_0x4ed1('0x31')](_0x2b8688['query']);_0x6cae2['filters']=_[_0x4ed1('0x32')](_0x6cae2[_0x4ed1('0x2f')],_0x6cae2[_0x4ed1('0x30')]);_0x109948[_0x4ed1('0x33')]=_[_0x4ed1('0x32')](_0x6cae2[_0x4ed1('0x2f')],qs[_0x4ed1('0x34')](_0x2b8688[_0x4ed1('0x30')][_0x4ed1('0x34')]));_0x109948[_0x4ed1('0x33')]=_0x109948[_0x4ed1('0x33')][_0x4ed1('0x35')]?_0x109948['attributes']:_0x6cae2['model'];if(!_0x2b8688[_0x4ed1('0x30')][_0x4ed1('0x36')]('nolimit')){_0x109948[_0x4ed1('0x1e')]=qs[_0x4ed1('0x1e')](_0x2b8688[_0x4ed1('0x30')]['limit']);_0x109948[_0x4ed1('0x1c')]=qs[_0x4ed1('0x1c')](_0x2b8688[_0x4ed1('0x30')]['offset']);}_0x109948[_0x4ed1('0x37')]=qs[_0x4ed1('0x38')](_0x2b8688['query'][_0x4ed1('0x38')]);_0x109948[_0x4ed1('0x39')]=qs[_0x4ed1('0x3a')](_['pick'](_0x2b8688[_0x4ed1('0x30')],_0x6cae2[_0x4ed1('0x3a')]),_0x20062d);if(_0x2b8688[_0x4ed1('0x30')][_0x4ed1('0x3b')]){_0x109948[_0x4ed1('0x39')]=_['merge'](_0x109948[_0x4ed1('0x39')],{'$or':_[_0x4ed1('0x29')](_0x20062d,function(_0x3ff340){if(_0x3ff340[_0x4ed1('0x2d')]!==_0x4ed1('0x3c')){var _0x49b6ab={};_0x49b6ab[_0x3ff340['name']]={'$like':'%'+_0x2b8688[_0x4ed1('0x30')]['filter']+'%'};return _0x49b6ab;}})});}_0x109948=_[_0x4ed1('0x3d')]({},_0x109948,_0x2b8688[_0x4ed1('0x3e')]);var _0xd0d0e6={'where':_0x109948[_0x4ed1('0x39')]};return db[_0x4ed1('0x2a')][_0x4ed1('0x1f')](_0xd0d0e6)[_0x4ed1('0x23')](function(_0x56e30c){_0x75103[_0x4ed1('0x1f')]=_0x56e30c;if(_0x2b8688['query'][_0x4ed1('0x3f')]){_0x109948[_0x4ed1('0x40')]=[{'all':!![]}];}return db[_0x4ed1('0x2a')][_0x4ed1('0x41')](_0x109948);})[_0x4ed1('0x23')](function(_0x5338ef){_0x75103[_0x4ed1('0x42')]=_0x5338ef;return _0x75103;})[_0x4ed1('0x23')](respondWithFilteredResult(_0x3a549c,_0x109948))[_0x4ed1('0x43')](handleError(_0x3a549c,null));};exports[_0x4ed1('0x44')]=function(_0x22d3a0,_0x73aa47){var _0x288473={'raw':!![],'where':{'id':_0x22d3a0[_0x4ed1('0x45')]['id']}},_0xc09ec4={};_0xc09ec4[_0x4ed1('0x2f')]=_['keys'](db[_0x4ed1('0x2a')][_0x4ed1('0x2b')]);_0xc09ec4[_0x4ed1('0x30')]=_['keys'](_0x22d3a0[_0x4ed1('0x30')]);_0xc09ec4['filters']=_['intersection'](_0xc09ec4[_0x4ed1('0x2f')],_0xc09ec4[_0x4ed1('0x30')]);_0x288473[_0x4ed1('0x33')]=_['intersection'](_0xc09ec4[_0x4ed1('0x2f')],qs[_0x4ed1('0x34')](_0x22d3a0[_0x4ed1('0x30')][_0x4ed1('0x34')]));_0x288473[_0x4ed1('0x33')]=_0x288473[_0x4ed1('0x33')][_0x4ed1('0x35')]?_0x288473[_0x4ed1('0x33')]:_0xc09ec4[_0x4ed1('0x2f')];if(_0x22d3a0[_0x4ed1('0x30')][_0x4ed1('0x3f')]){_0x288473[_0x4ed1('0x40')]=[{'all':!![]}];}_0x288473=_[_0x4ed1('0x3d')]({},_0x288473,_0x22d3a0['options']);return db[_0x4ed1('0x2a')][_0x4ed1('0x46')](_0x288473)[_0x4ed1('0x23')](handleEntityNotFound(_0x73aa47,null))[_0x4ed1('0x23')](respondWithResult(_0x73aa47,null))[_0x4ed1('0x43')](handleError(_0x73aa47,null));};exports[_0x4ed1('0x47')]=function(_0x424ca5,_0x5e1983){return db[_0x4ed1('0x2a')][_0x4ed1('0x47')](_0x424ca5['body'],{})['then'](respondWithResult(_0x5e1983,0xc9))[_0x4ed1('0x43')](handleError(_0x5e1983,null));};exports[_0x4ed1('0x22')]=function(_0x2e8e60,_0x317e3f){if(_0x2e8e60[_0x4ed1('0x48')]['id']){delete _0x2e8e60[_0x4ed1('0x48')]['id'];}return db[_0x4ed1('0x2a')][_0x4ed1('0x46')]({'where':{'id':_0x2e8e60[_0x4ed1('0x45')]['id']}})['then'](handleEntityNotFound(_0x317e3f,null))[_0x4ed1('0x23')](saveUpdates(_0x2e8e60[_0x4ed1('0x48')],null))['then'](respondWithResult(_0x317e3f,null))[_0x4ed1('0x43')](handleError(_0x317e3f,null));};exports[_0x4ed1('0x24')]=function(_0x1a21ed,_0x2df3ef){return db[_0x4ed1('0x2a')][_0x4ed1('0x46')]({'where':{'id':_0x1a21ed[_0x4ed1('0x45')]['id']}})['then'](handleEntityNotFound(_0x2df3ef,null))[_0x4ed1('0x23')](removeEntity(_0x2df3ef,null))['catch'](handleError(_0x2df3ef,null));}; \ No newline at end of file +var _0xaa81=['update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','Dynamics365Field','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','apply','reject','save'];(function(_0x300e03,_0x35bf0a){var _0xf4711b=function(_0x5ee9ef){while(--_0x5ee9ef){_0x300e03['push'](_0x300e03['shift']());}};_0xf4711b(++_0x35bf0a);}(_0xaa81,0x1ab));var _0x1aa8=function(_0x2a8204,_0x4b8794){_0x2a8204=_0x2a8204-0x0;var _0x1348de=_0xaa81[_0x2a8204];return _0x1348de;};'use strict';var emlformat=require(_0x1aa8('0x0'));var rimraf=require(_0x1aa8('0x1'));var zipdir=require(_0x1aa8('0x2'));var jsonpatch=require(_0x1aa8('0x3'));var rp=require(_0x1aa8('0x4'));var moment=require(_0x1aa8('0x5'));var BPromise=require(_0x1aa8('0x6'));var Mustache=require(_0x1aa8('0x7'));var util=require(_0x1aa8('0x8'));var path=require(_0x1aa8('0x9'));var sox=require(_0x1aa8('0xa'));var csv=require(_0x1aa8('0xb'));var ejs=require(_0x1aa8('0xc'));var fs=require('fs');var fs_extra=require(_0x1aa8('0xd'));var _=require(_0x1aa8('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1aa8('0xf'));var deskjs=require(_0x1aa8('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1aa8('0x11'));var Papa=require(_0x1aa8('0x12'));var Redis=require(_0x1aa8('0x13'));var authService=require(_0x1aa8('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1aa8('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1aa8('0x16'))(_0x1aa8('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1aa8('0x18'))['db'];function respondWithStatusCode(_0x346064,_0x2b7bea){_0x2b7bea=_0x2b7bea||0xcc;return function(_0x8b682b){if(_0x8b682b){return _0x346064['sendStatus'](_0x2b7bea);}return _0x346064[_0x1aa8('0x19')](_0x2b7bea)['end']();};}function respondWithResult(_0x4a9a79,_0x2559c7){_0x2559c7=_0x2559c7||0xc8;return function(_0x7ab662){if(_0x7ab662){return _0x4a9a79['status'](_0x2559c7)[_0x1aa8('0x1a')](_0x7ab662);}};}function respondWithFilteredResult(_0x99b8ca,_0x511bf3){return function(_0x503007){if(_0x503007){var _0x4e2b65=typeof _0x511bf3[_0x1aa8('0x1b')]===_0x1aa8('0x1c')&&typeof _0x511bf3['limit']==='undefined';var _0x5d6be2=_0x503007['count'];var _0x3028f2=_0x4e2b65?0x0:_0x511bf3[_0x1aa8('0x1b')];var _0x1243a8=_0x4e2b65?_0x503007[_0x1aa8('0x1d')]:_0x511bf3['offset']+_0x511bf3['limit'];var _0x2a9474;if(_0x1243a8>=_0x5d6be2){_0x1243a8=_0x5d6be2;_0x2a9474=0xc8;}else{_0x2a9474=0xce;}_0x99b8ca['status'](_0x2a9474);return _0x99b8ca[_0x1aa8('0x1e')](_0x1aa8('0x1f'),_0x3028f2+'-'+_0x1243a8+'/'+_0x5d6be2)[_0x1aa8('0x1a')](_0x503007);}return null;};}function patchUpdates(_0x56f2b1){return function(_0x6d2774){try{jsonpatch[_0x1aa8('0x20')](_0x6d2774,_0x56f2b1,!![]);}catch(_0x37238b){return BPromise[_0x1aa8('0x21')](_0x37238b);}return _0x6d2774[_0x1aa8('0x22')]();};}function saveUpdates(_0x2e7dd4,_0x54a150){return function(_0x27992c){if(_0x27992c){return _0x27992c[_0x1aa8('0x23')](_0x2e7dd4)[_0x1aa8('0x24')](function(_0x461dec){return _0x461dec;});}return null;};}function removeEntity(_0x3e23e3,_0x13c536){return function(_0x53f026){if(_0x53f026){return _0x53f026[_0x1aa8('0x25')]()[_0x1aa8('0x24')](function(){_0x3e23e3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4719a4,_0x521f66){return function(_0x454138){if(!_0x454138){_0x4719a4[_0x1aa8('0x26')](0x194);}return _0x454138;};}function handleError(_0x1aa960,_0x25318b){_0x25318b=_0x25318b||0x1f4;return function(_0x31fec1){logger[_0x1aa8('0x27')](_0x31fec1['stack']);if(_0x31fec1[_0x1aa8('0x28')]){delete _0x31fec1[_0x1aa8('0x28')];}_0x1aa960[_0x1aa8('0x19')](_0x25318b)[_0x1aa8('0x29')](_0x31fec1);};}exports[_0x1aa8('0x2a')]=function(_0x24a8c2,_0x22f034){var _0x3f56f4={},_0x304edc={},_0x47b0cd={'count':0x0,'rows':[]};var _0x1a34d7=_[_0x1aa8('0x2b')](db['Dynamics365Field'][_0x1aa8('0x2c')],function(_0x54a339){return{'name':_0x54a339[_0x1aa8('0x2d')],'type':_0x54a339[_0x1aa8('0x2e')][_0x1aa8('0x2f')]};});_0x304edc['model']=_[_0x1aa8('0x2b')](_0x1a34d7,_0x1aa8('0x28'));_0x304edc[_0x1aa8('0x30')]=_['keys'](_0x24a8c2[_0x1aa8('0x30')]);_0x304edc[_0x1aa8('0x31')]=_[_0x1aa8('0x32')](_0x304edc[_0x1aa8('0x33')],_0x304edc[_0x1aa8('0x30')]);_0x3f56f4[_0x1aa8('0x34')]=_[_0x1aa8('0x32')](_0x304edc[_0x1aa8('0x33')],qs[_0x1aa8('0x35')](_0x24a8c2[_0x1aa8('0x30')]['fields']));_0x3f56f4[_0x1aa8('0x34')]=_0x3f56f4['attributes'][_0x1aa8('0x36')]?_0x3f56f4[_0x1aa8('0x34')]:_0x304edc['model'];if(!_0x24a8c2[_0x1aa8('0x30')][_0x1aa8('0x37')](_0x1aa8('0x38'))){_0x3f56f4[_0x1aa8('0x39')]=qs[_0x1aa8('0x39')](_0x24a8c2['query'][_0x1aa8('0x39')]);_0x3f56f4['offset']=qs[_0x1aa8('0x1b')](_0x24a8c2[_0x1aa8('0x30')][_0x1aa8('0x1b')]);}_0x3f56f4[_0x1aa8('0x3a')]=qs[_0x1aa8('0x3b')](_0x24a8c2[_0x1aa8('0x30')]['sort']);_0x3f56f4['where']=qs['filters'](_[_0x1aa8('0x3c')](_0x24a8c2['query'],_0x304edc[_0x1aa8('0x31')]),_0x1a34d7);if(_0x24a8c2[_0x1aa8('0x30')][_0x1aa8('0x3d')]){_0x3f56f4[_0x1aa8('0x3e')]=_[_0x1aa8('0x3f')](_0x3f56f4[_0x1aa8('0x3e')],{'$or':_[_0x1aa8('0x2b')](_0x1a34d7,function(_0x2d36bb){if(_0x2d36bb[_0x1aa8('0x2e')]!==_0x1aa8('0x40')){var _0x171c47={};_0x171c47[_0x2d36bb[_0x1aa8('0x28')]]={'$like':'%'+_0x24a8c2[_0x1aa8('0x30')][_0x1aa8('0x3d')]+'%'};return _0x171c47;}})});}_0x3f56f4=_['merge']({},_0x3f56f4,_0x24a8c2['options']);var _0x3b5063={'where':_0x3f56f4[_0x1aa8('0x3e')]};return db[_0x1aa8('0x41')][_0x1aa8('0x1d')](_0x3b5063)[_0x1aa8('0x24')](function(_0x3475a0){_0x47b0cd[_0x1aa8('0x1d')]=_0x3475a0;if(_0x24a8c2['query']['includeAll']){_0x3f56f4['include']=[{'all':!![]}];}return db[_0x1aa8('0x41')][_0x1aa8('0x42')](_0x3f56f4);})[_0x1aa8('0x24')](function(_0x1d5d1d){_0x47b0cd[_0x1aa8('0x43')]=_0x1d5d1d;return _0x47b0cd;})[_0x1aa8('0x24')](respondWithFilteredResult(_0x22f034,_0x3f56f4))[_0x1aa8('0x44')](handleError(_0x22f034,null));};exports[_0x1aa8('0x45')]=function(_0x27fc46,_0x4dddc8){var _0x2eeb22={'raw':!![],'where':{'id':_0x27fc46[_0x1aa8('0x46')]['id']}},_0x476bf3={};_0x476bf3[_0x1aa8('0x33')]=_[_0x1aa8('0x47')](db[_0x1aa8('0x41')][_0x1aa8('0x2c')]);_0x476bf3[_0x1aa8('0x30')]=_[_0x1aa8('0x47')](_0x27fc46[_0x1aa8('0x30')]);_0x476bf3[_0x1aa8('0x31')]=_[_0x1aa8('0x32')](_0x476bf3['model'],_0x476bf3[_0x1aa8('0x30')]);_0x2eeb22[_0x1aa8('0x34')]=_[_0x1aa8('0x32')](_0x476bf3[_0x1aa8('0x33')],qs['fields'](_0x27fc46[_0x1aa8('0x30')][_0x1aa8('0x35')]));_0x2eeb22[_0x1aa8('0x34')]=_0x2eeb22['attributes'][_0x1aa8('0x36')]?_0x2eeb22[_0x1aa8('0x34')]:_0x476bf3['model'];if(_0x27fc46[_0x1aa8('0x30')][_0x1aa8('0x48')]){_0x2eeb22[_0x1aa8('0x49')]=[{'all':!![]}];}_0x2eeb22=_[_0x1aa8('0x3f')]({},_0x2eeb22,_0x27fc46['options']);return db[_0x1aa8('0x41')][_0x1aa8('0x4a')](_0x2eeb22)['then'](handleEntityNotFound(_0x4dddc8,null))[_0x1aa8('0x24')](respondWithResult(_0x4dddc8,null))[_0x1aa8('0x44')](handleError(_0x4dddc8,null));};exports[_0x1aa8('0x4b')]=function(_0x1dacf5,_0x43ed72){return db[_0x1aa8('0x41')][_0x1aa8('0x4b')](_0x1dacf5[_0x1aa8('0x4c')],{})['then'](respondWithResult(_0x43ed72,0xc9))[_0x1aa8('0x44')](handleError(_0x43ed72,null));};exports[_0x1aa8('0x23')]=function(_0x557324,_0x3e6646){if(_0x557324[_0x1aa8('0x4c')]['id']){delete _0x557324[_0x1aa8('0x4c')]['id'];}return db[_0x1aa8('0x41')][_0x1aa8('0x4a')]({'where':{'id':_0x557324[_0x1aa8('0x46')]['id']}})[_0x1aa8('0x24')](handleEntityNotFound(_0x3e6646,null))['then'](saveUpdates(_0x557324[_0x1aa8('0x4c')],null))[_0x1aa8('0x24')](respondWithResult(_0x3e6646,null))[_0x1aa8('0x44')](handleError(_0x3e6646,null));};exports[_0x1aa8('0x25')]=function(_0x23f0c3,_0x740bac){return db[_0x1aa8('0x41')][_0x1aa8('0x4a')]({'where':{'id':_0x23f0c3[_0x1aa8('0x46')]['id']}})[_0x1aa8('0x24')](handleEntityNotFound(_0x740bac,null))['then'](removeEntity(_0x740bac,null))[_0x1aa8('0x44')](handleError(_0x740bac,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index b4cb556..3df3009 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 _0x48f7=['int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field'];(function(_0x2b5998,_0x17ff56){var _0x32b628=function(_0x3e6ecf){while(--_0x3e6ecf){_0x2b5998['push'](_0x2b5998['shift']());}};_0x32b628(++_0x17ff56);}(_0x48f7,0x1d3));var _0x748f=function(_0x5464f8,_0x32755f){_0x5464f8=_0x5464f8-0x0;var _0x594c25=_0x48f7[_0x5464f8];return _0x594c25;};'use strict';var _=require(_0x748f('0x0'));var util=require(_0x748f('0x1'));var logger=require(_0x748f('0x2'))(_0x748f('0x3'));var moment=require(_0x748f('0x4'));var BPromise=require(_0x748f('0x5'));var rp=require(_0x748f('0x6'));var fs=require('fs');var path=require(_0x748f('0x7'));var rimraf=require('rimraf');var config=require(_0x748f('0x8'));var attributes=require(_0x748f('0x9'));module[_0x748f('0xa')]=function(_0x5018d0,_0x336d9e){return _0x5018d0[_0x748f('0xb')](_0x748f('0xc'),attributes,{'tableName':_0x748f('0xd'),'paranoid':![],'indexes':[{'name':_0x748f('0xe'),'fields':['idField',_0x748f('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2397=['dynamics365_unique_index','idField','../../config/logger','api','request-promise','path','rimraf','exports','define','int_dynamics365_fields'];(function(_0x5bf0d7,_0x102884){var _0x33ceb5=function(_0x261b30){while(--_0x261b30){_0x5bf0d7['push'](_0x5bf0d7['shift']());}};_0x33ceb5(++_0x102884);}(_0x2397,0xe8));var _0x7239=function(_0x1b316a,_0x28357b){_0x1b316a=_0x1b316a-0x0;var _0x4926f2=_0x2397[_0x1b316a];return _0x4926f2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7239('0x0'))(_0x7239('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7239('0x2'));var fs=require('fs');var path=require(_0x7239('0x3'));var rimraf=require(_0x7239('0x4'));var config=require('../../config/environment');var attributes=require('./intDynamics365Field.attributes');module[_0x7239('0x5')]=function(_0x54019b,_0xce1526){return _0x54019b[_0x7239('0x6')]('Dynamics365Field',attributes,{'tableName':_0x7239('0x7'),'paranoid':![],'indexes':[{'name':_0x7239('0x8'),'fields':[_0x7239('0x9'),'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 da96ae3..6977c09 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 _0xa110=['Dynamics365Field,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error','code'];(function(_0x2aebb2,_0x21f452){var _0x17406c=function(_0x7ae2df){while(--_0x7ae2df){_0x2aebb2['push'](_0x2aebb2['shift']());}};_0x17406c(++_0x21f452);}(_0xa110,0xdf));var _0x0a11=function(_0x2a8cb2,_0x2a3292){_0x2a8cb2=_0x2a8cb2-0x0;var _0x14d36f=_0xa110[_0x2a8cb2];return _0x14d36f;};'use strict';var _=require('lodash');var util=require(_0x0a11('0x0'));var moment=require(_0x0a11('0x1'));var BPromise=require(_0x0a11('0x2'));var rs=require(_0x0a11('0x3'));var fs=require('fs');var Redis=require(_0x0a11('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0a11('0x5'))(_0x0a11('0x6'));var config=require(_0x0a11('0x7'));var jayson=require(_0x0a11('0x8'));var client=jayson[_0x0a11('0x9')][_0x0a11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d042c,_0x4c8e73,_0x2e8d54){return new BPromise(function(_0x283a8a,_0x10bbee){return client[_0x0a11('0xb')](_0x1d042c,_0x2e8d54)[_0x0a11('0xc')](function(_0x285e1b){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x4c8e73,_0x0a11('0xd'));logger[_0x0a11('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x4c8e73,_0x0a11('0xd'),JSON['stringify'](_0x285e1b));if(_0x285e1b[_0x0a11('0xf')]){if(_0x285e1b[_0x0a11('0xf')][_0x0a11('0x10')]===0x1f4){logger[_0x0a11('0xf')](_0x0a11('0x11'),_0x4c8e73,_0x285e1b[_0x0a11('0xf')][_0x0a11('0x12')]);return _0x10bbee(_0x285e1b[_0x0a11('0xf')][_0x0a11('0x12')]);}logger[_0x0a11('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x4c8e73,_0x285e1b['error'][_0x0a11('0x12')]);return _0x283a8a(_0x285e1b[_0x0a11('0xf')][_0x0a11('0x12')]);}else{logger['info'](_0x0a11('0x11'),_0x4c8e73,_0x0a11('0xd'));_0x283a8a(_0x285e1b[_0x0a11('0x13')][_0x0a11('0x12')]);}})['catch'](function(_0xc79a30){logger[_0x0a11('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x4c8e73,_0xc79a30);_0x10bbee(_0xc79a30);});});} \ No newline at end of file +var _0x5e05=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4db40c,_0x5aebda){var _0x572a4b=function(_0x4cb854){while(--_0x4cb854){_0x4db40c['push'](_0x4db40c['shift']());}};_0x572a4b(++_0x5aebda);}(_0x5e05,0xb8));var _0x55e0=function(_0x532f0f,_0x3c8fd4){_0x532f0f=_0x532f0f-0x0;var _0x35e23e=_0x5e05[_0x532f0f];return _0x35e23e;};'use strict';var _=require(_0x55e0('0x0'));var util=require(_0x55e0('0x1'));var moment=require(_0x55e0('0x2'));var BPromise=require('bluebird');var rs=require(_0x55e0('0x3'));var fs=require('fs');var Redis=require(_0x55e0('0x4'));var db=require(_0x55e0('0x5'))['db'];var utils=require(_0x55e0('0x6'));var logger=require(_0x55e0('0x7'))('rpc');var config=require(_0x55e0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x55e0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1991c3,_0x4ed365,_0x3eef50){return new BPromise(function(_0x400041,_0x18f7d6){return client[_0x55e0('0xa')](_0x1991c3,_0x3eef50)[_0x55e0('0xb')](function(_0x2b3fef){logger[_0x55e0('0xc')](_0x55e0('0xd'),_0x4ed365,_0x55e0('0xe'));logger[_0x55e0('0xf')](_0x55e0('0x10'),_0x4ed365,_0x55e0('0xe'),JSON[_0x55e0('0x11')](_0x2b3fef));if(_0x2b3fef['error']){if(_0x2b3fef[_0x55e0('0x12')][_0x55e0('0x13')]===0x1f4){logger[_0x55e0('0x12')](_0x55e0('0xd'),_0x4ed365,_0x2b3fef[_0x55e0('0x12')][_0x55e0('0x14')]);return _0x18f7d6(_0x2b3fef[_0x55e0('0x12')]['message']);}logger[_0x55e0('0x12')](_0x55e0('0xd'),_0x4ed365,_0x2b3fef['error'][_0x55e0('0x14')]);return _0x400041(_0x2b3fef['error'][_0x55e0('0x14')]);}else{logger['info'](_0x55e0('0xd'),_0x4ed365,_0x55e0('0xe'));_0x400041(_0x2b3fef[_0x55e0('0x15')][_0x55e0('0x14')]);}})[_0x55e0('0x16')](function(_0x3459da){logger[_0x55e0('0x12')](_0x55e0('0xd'),_0x4ed365,_0x3459da);_0x18f7d6(_0x3459da);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 9c7a991..11ba68e 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 _0x237a=['/:id','show','get','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','put','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3175e6,_0x126421){var _0x321dc5=function(_0x15ccc1){while(--_0x15ccc1){_0x3175e6['push'](_0x3175e6['shift']());}};_0x321dc5(++_0x126421);}(_0x237a,0x1f0));var _0xa237=function(_0x5e97c4,_0x4b4faf){_0x5e97c4=_0x5e97c4-0x0;var _0x3203bc=_0x237a[_0x5e97c4];return _0x3203bc;};'use strict';var multer=require(_0xa237('0x0'));var util=require(_0xa237('0x1'));var path=require(_0xa237('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa237('0x3')]();var fs_extra=require(_0xa237('0x4'));var auth=require(_0xa237('0x5'));var interaction=require(_0xa237('0x6'));var config=require(_0xa237('0x7'));var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa237('0x8'),auth['isAuthenticated'](),controller[_0xa237('0x9')]);router[_0xa237('0xa')](_0xa237('0xb'),auth[_0xa237('0xc')](),controller[_0xa237('0xd')]);router[_0xa237('0xa')](_0xa237('0xe'),auth[_0xa237('0xc')](),controller[_0xa237('0xf')]);router[_0xa237('0x10')]('/',auth['isAuthenticated'](),controller[_0xa237('0x11')]);router[_0xa237('0x10')](_0xa237('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xa237('0x12')](_0xa237('0x8'),auth[_0xa237('0xc')](),controller['update']);router[_0xa237('0x13')](_0xa237('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xa237('0x14')]=router; \ No newline at end of file +var _0xf296=['isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id'];(function(_0x495b64,_0xb64d7e){var _0x449b78=function(_0x88d9d1){while(--_0x88d9d1){_0x495b64['push'](_0x495b64['shift']());}};_0x449b78(++_0xb64d7e);}(_0xf296,0x175));var _0x6f29=function(_0x3ba537,_0x56b969){_0x3ba537=_0x3ba537-0x0;var _0x585c1a=_0xf296[_0x3ba537];return _0x585c1a;};'use strict';var multer=require(_0x6f29('0x0'));var util=require(_0x6f29('0x1'));var path=require(_0x6f29('0x2'));var timeout=require(_0x6f29('0x3'));var express=require('express');var router=express[_0x6f29('0x4')]();var fs_extra=require(_0x6f29('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6f29('0x6'));var controller=require(_0x6f29('0x7'));router[_0x6f29('0x8')]('/',auth['isAuthenticated'](),controller[_0x6f29('0x9')]);router[_0x6f29('0x8')](_0x6f29('0xa'),auth[_0x6f29('0xb')](),controller[_0x6f29('0xc')]);router[_0x6f29('0x8')](_0x6f29('0xd'),auth[_0x6f29('0xb')](),controller[_0x6f29('0xe')]);router[_0x6f29('0x8')](_0x6f29('0xf'),auth[_0x6f29('0xb')](),controller[_0x6f29('0x10')]);router[_0x6f29('0x11')]('/',auth['isAuthenticated'](),controller[_0x6f29('0x12')]);router[_0x6f29('0x11')]('/:id/configurations',auth[_0x6f29('0xb')](),controller[_0x6f29('0x13')]);router['put'](_0x6f29('0xa'),auth[_0x6f29('0xb')](),controller[_0x6f29('0x14')]);router[_0x6f29('0x15')]('/:id',auth[_0x6f29('0xb')](),controller[_0x6f29('0x16')]);module[_0x6f29('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 339d4e8..714dfd5 100644 --- a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js +++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffd6=['exports','STRING','username','sequelize'];(function(_0x2c34d7,_0x7c3a11){var _0x3c615e=function(_0x197909){while(--_0x197909){_0x2c34d7['push'](_0x2c34d7['shift']());}};_0x3c615e(++_0x7c3a11);}(_0xffd6,0x97));var _0x6ffd=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0xffd6[_0x1b3564];return _0x504069;};'use strict';var Sequelize=require(_0x6ffd('0x0'));module[_0x6ffd('0x1')]={'name':{'type':Sequelize[_0x6ffd('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x6ffd('0x3')},'apiKey':{'type':Sequelize[_0x6ffd('0x2')]},'remoteUri':{'type':Sequelize[_0x6ffd('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6ffd('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xfef3=['sequelize','STRING','username','remoteUri'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xfef3,0x118));var _0x3fef=function(_0x5e3a1f,_0x24c078){_0x5e3a1f=_0x5e3a1f-0x0;var _0x3c27fd=_0xfef3[_0x5e3a1f];return _0x3c27fd;};'use strict';var Sequelize=require(_0x3fef('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fef('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('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 4c5a738..006b38c 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 _0xf12a=['Subjects','getFields','remoteUri','apiKey','slice','substring','GET','%s/%s','api/v2/ticket_fields','format','%s:X','toString','base64','subject','agent','description','priority','group','source','company','includes','default','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','fieldName','type','key','map','keys','filters','intersection','model','query','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskAccount','includeAll','include','findAll','catch','rawAttributes','find','create','body','findOne','params','FreshdeskConfiguration','order','getConfigurations','hasOwnProperty','addConfiguration','getSubjects','channel','getDescriptions','FreshdeskField'];(function(_0x4cdbc8,_0x4d8e1d){var _0x311448=function(_0x3f37b1){while(--_0x3f37b1){_0x4cdbc8['push'](_0x4cdbc8['shift']());}};_0x311448(++_0x4d8e1d);}(_0xf12a,0x8e));var _0xaf12=function(_0x284e85,_0x1bfec9){_0x284e85=_0x284e85-0x0;var _0x59ba3d=_0xf12a[_0x284e85];return _0x59ba3d;};'use strict';var emlformat=require(_0xaf12('0x0'));var rimraf=require(_0xaf12('0x1'));var zipdir=require(_0xaf12('0x2'));var jsonpatch=require(_0xaf12('0x3'));var rp=require(_0xaf12('0x4'));var moment=require(_0xaf12('0x5'));var BPromise=require(_0xaf12('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xaf12('0x7'));var sox=require('sox');var csv=require(_0xaf12('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf12('0x9'));var _=require('lodash');var squel=require(_0xaf12('0xa'));var crypto=require(_0xaf12('0xb'));var jsforce=require(_0xaf12('0xc'));var deskjs=require(_0xaf12('0xd'));var toCsv=require(_0xaf12('0x8'));var querystring=require(_0xaf12('0xe'));var Papa=require(_0xaf12('0xf'));var Redis=require(_0xaf12('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xaf12('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf12('0x12'));var logger=require('../../config/logger')(_0xaf12('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaf12('0x14'));var db=require(_0xaf12('0x15'))['db'];var integrations=require(_0xaf12('0x16'));function respondWithStatusCode(_0x4596c7,_0x400dd1){_0x400dd1=_0x400dd1||0xcc;return function(_0x363996){if(_0x363996){return _0x4596c7[_0xaf12('0x17')](_0x400dd1);}return _0x4596c7[_0xaf12('0x18')](_0x400dd1)[_0xaf12('0x19')]();};}function respondWithResult(_0x3f1476,_0xa41e71){_0xa41e71=_0xa41e71||0xc8;return function(_0x627227){if(_0x627227){return _0x3f1476[_0xaf12('0x18')](_0xa41e71)[_0xaf12('0x1a')](_0x627227);}};}function respondWithFilteredResult(_0xb13b65,_0x3205ae){return function(_0x450cd2){if(_0x450cd2){var _0x5107e7=typeof _0x3205ae[_0xaf12('0x1b')]===_0xaf12('0x1c')&&typeof _0x3205ae['limit']==='undefined';var _0x4c8541=_0x450cd2[_0xaf12('0x1d')];var _0x4cc0a4=_0x5107e7?0x0:_0x3205ae[_0xaf12('0x1b')];var _0x516bad=_0x5107e7?_0x450cd2[_0xaf12('0x1d')]:_0x3205ae[_0xaf12('0x1b')]+_0x3205ae[_0xaf12('0x1e')];var _0x215ff5;if(_0x516bad>=_0x4c8541){_0x516bad=_0x4c8541;_0x215ff5=0xc8;}else{_0x215ff5=0xce;}_0xb13b65['status'](_0x215ff5);return _0xb13b65[_0xaf12('0x1f')](_0xaf12('0x20'),_0x4cc0a4+'-'+_0x516bad+'/'+_0x4c8541)[_0xaf12('0x1a')](_0x450cd2);}return null;};}function patchUpdates(_0x18c4e0){return function(_0x1982c7){try{jsonpatch[_0xaf12('0x21')](_0x1982c7,_0x18c4e0,!![]);}catch(_0x656675){return BPromise[_0xaf12('0x22')](_0x656675);}return _0x1982c7[_0xaf12('0x23')]();};}function saveUpdates(_0x41f9f7,_0x2c3a93){return function(_0x374e3c){if(_0x374e3c){return _0x374e3c[_0xaf12('0x24')](_0x41f9f7)['then'](function(_0x2c9ba3){return _0x2c9ba3;});}return null;};}function removeEntity(_0x566109,_0x576fd4){return function(_0x26e97a){if(_0x26e97a){return _0x26e97a[_0xaf12('0x25')]()[_0xaf12('0x26')](function(){_0x566109['status'](0xcc)[_0xaf12('0x19')]();});}};}function handleEntityNotFound(_0x3dbc35,_0x5c32bf){return function(_0x439409){if(!_0x439409){_0x3dbc35[_0xaf12('0x17')](0x194);}return _0x439409;};}function handleError(_0x478286,_0x2ed53d){_0x2ed53d=_0x2ed53d||0x1f4;return function(_0x22f46f){logger[_0xaf12('0x27')](_0x22f46f[_0xaf12('0x28')]);if(_0x22f46f[_0xaf12('0x29')]){delete _0x22f46f[_0xaf12('0x29')];}_0x478286['status'](_0x2ed53d)[_0xaf12('0x2a')](_0x22f46f);};}exports['index']=function(_0x39b12f,_0x23e4d6){var _0xb975f5={},_0x58a32f={},_0x4f0a8b={'count':0x0,'rows':[]};var _0x51ddae=_['map'](db['FreshdeskAccount']['rawAttributes'],function(_0x64625){return{'name':_0x64625[_0xaf12('0x2b')],'type':_0x64625[_0xaf12('0x2c')][_0xaf12('0x2d')]};});_0x58a32f['model']=_[_0xaf12('0x2e')](_0x51ddae,_0xaf12('0x29'));_0x58a32f['query']=_[_0xaf12('0x2f')](_0x39b12f['query']);_0x58a32f[_0xaf12('0x30')]=_[_0xaf12('0x31')](_0x58a32f[_0xaf12('0x32')],_0x58a32f[_0xaf12('0x33')]);_0xb975f5[_0xaf12('0x34')]=_['intersection'](_0x58a32f[_0xaf12('0x32')],qs[_0xaf12('0x35')](_0x39b12f[_0xaf12('0x33')][_0xaf12('0x35')]));_0xb975f5[_0xaf12('0x34')]=_0xb975f5[_0xaf12('0x34')][_0xaf12('0x36')]?_0xb975f5[_0xaf12('0x34')]:_0x58a32f[_0xaf12('0x32')];if(!_0x39b12f[_0xaf12('0x33')]['hasOwnProperty']('nolimit')){_0xb975f5[_0xaf12('0x1e')]=qs['limit'](_0x39b12f['query']['limit']);_0xb975f5[_0xaf12('0x1b')]=qs['offset'](_0x39b12f['query'][_0xaf12('0x1b')]);}_0xb975f5['order']=qs[_0xaf12('0x37')](_0x39b12f['query'][_0xaf12('0x37')]);_0xb975f5[_0xaf12('0x38')]=qs['filters'](_[_0xaf12('0x39')](_0x39b12f['query'],_0x58a32f['filters']),_0x51ddae);if(_0x39b12f[_0xaf12('0x33')][_0xaf12('0x3a')]){_0xb975f5[_0xaf12('0x38')]=_[_0xaf12('0x3b')](_0xb975f5[_0xaf12('0x38')],{'$or':_[_0xaf12('0x2e')](_0x51ddae,function(_0x344001){if(_0x344001[_0xaf12('0x2c')]!==_0xaf12('0x3c')){var _0x529c74={};_0x529c74[_0x344001['name']]={'$like':'%'+_0x39b12f[_0xaf12('0x33')][_0xaf12('0x3a')]+'%'};return _0x529c74;}})});}_0xb975f5=_[_0xaf12('0x3b')]({},_0xb975f5,_0x39b12f[_0xaf12('0x3d')]);var _0x3017d9={'where':_0xb975f5[_0xaf12('0x38')]};return db[_0xaf12('0x3e')]['count'](_0x3017d9)[_0xaf12('0x26')](function(_0x33795b){_0x4f0a8b[_0xaf12('0x1d')]=_0x33795b;if(_0x39b12f[_0xaf12('0x33')][_0xaf12('0x3f')]){_0xb975f5[_0xaf12('0x40')]=[{'all':!![]}];}return db[_0xaf12('0x3e')][_0xaf12('0x41')](_0xb975f5);})[_0xaf12('0x26')](function(_0x258414){_0x4f0a8b['rows']=_0x258414;return _0x4f0a8b;})[_0xaf12('0x26')](respondWithFilteredResult(_0x23e4d6,_0xb975f5))[_0xaf12('0x42')](handleError(_0x23e4d6,null));};exports['show']=function(_0x51106d,_0x16784c){var _0x387c96={'raw':![],'where':{'id':_0x51106d['params']['id']}},_0x309532={};_0x309532[_0xaf12('0x32')]=_[_0xaf12('0x2f')](db[_0xaf12('0x3e')][_0xaf12('0x43')]);_0x309532[_0xaf12('0x33')]=_[_0xaf12('0x2f')](_0x51106d[_0xaf12('0x33')]);_0x309532['filters']=_[_0xaf12('0x31')](_0x309532[_0xaf12('0x32')],_0x309532[_0xaf12('0x33')]);_0x387c96[_0xaf12('0x34')]=_[_0xaf12('0x31')](_0x309532[_0xaf12('0x32')],qs[_0xaf12('0x35')](_0x51106d['query']['fields']));_0x387c96[_0xaf12('0x34')]=_0x387c96[_0xaf12('0x34')][_0xaf12('0x36')]?_0x387c96[_0xaf12('0x34')]:_0x309532['model'];if(_0x51106d[_0xaf12('0x33')][_0xaf12('0x3f')]){_0x387c96[_0xaf12('0x40')]=[{'all':!![]}];}_0x387c96=_[_0xaf12('0x3b')]({},_0x387c96,_0x51106d['options']);return db[_0xaf12('0x3e')][_0xaf12('0x44')](_0x387c96)[_0xaf12('0x26')](handleEntityNotFound(_0x16784c,null))['then'](respondWithResult(_0x16784c,null))[_0xaf12('0x42')](handleError(_0x16784c,null));};exports[_0xaf12('0x45')]=function(_0x3bc098,_0x427f00){return db['FreshdeskAccount'][_0xaf12('0x45')](_0x3bc098['body'],{})[_0xaf12('0x26')](respondWithResult(_0x427f00,0xc9))[_0xaf12('0x42')](handleError(_0x427f00,null));};exports[_0xaf12('0x24')]=function(_0x271c34,_0x362e2c){if(_0x271c34[_0xaf12('0x46')]['id']){delete _0x271c34[_0xaf12('0x46')]['id'];}return db['FreshdeskAccount'][_0xaf12('0x44')]({'where':{'id':_0x271c34['params']['id']}})['then'](handleEntityNotFound(_0x362e2c,null))[_0xaf12('0x26')](saveUpdates(_0x271c34[_0xaf12('0x46')],null))['then'](respondWithResult(_0x362e2c,null))[_0xaf12('0x42')](handleError(_0x362e2c,null));};exports[_0xaf12('0x25')]=function(_0x2add43,_0x4c8183){return db[_0xaf12('0x3e')][_0xaf12('0x44')]({'where':{'id':_0x2add43['params']['id']}})[_0xaf12('0x26')](handleEntityNotFound(_0x4c8183,null))['then'](removeEntity(_0x4c8183,null))[_0xaf12('0x42')](handleError(_0x4c8183,null));};exports['getConfigurations']=function(_0x2ca730,_0x2b9f9d,_0x4665a4){var _0x27f18d={};var _0xf16633={};var _0x184edd;var _0x20b733;return db[_0xaf12('0x3e')][_0xaf12('0x47')]({'where':{'id':_0x2ca730[_0xaf12('0x48')]['id']}})[_0xaf12('0x26')](handleEntityNotFound(_0x2b9f9d,null))[_0xaf12('0x26')](function(_0x2cf400){if(_0x2cf400){_0x184edd=_0x2cf400;_0xf16633['model']=_['keys'](db[_0xaf12('0x49')][_0xaf12('0x43')]);_0xf16633[_0xaf12('0x33')]=_[_0xaf12('0x2f')](_0x2ca730[_0xaf12('0x33')]);_0xf16633[_0xaf12('0x30')]=_['intersection'](_0xf16633[_0xaf12('0x32')],_0xf16633[_0xaf12('0x33')]);_0x27f18d['attributes']=_[_0xaf12('0x31')](_0xf16633[_0xaf12('0x32')],qs[_0xaf12('0x35')](_0x2ca730[_0xaf12('0x33')][_0xaf12('0x35')]));_0x27f18d[_0xaf12('0x34')]=_0x27f18d['attributes'][_0xaf12('0x36')]?_0x27f18d['attributes']:_0xf16633[_0xaf12('0x32')];_0x27f18d[_0xaf12('0x4a')]=qs[_0xaf12('0x37')](_0x2ca730[_0xaf12('0x33')][_0xaf12('0x37')]);_0x27f18d['where']=qs[_0xaf12('0x30')](_[_0xaf12('0x39')](_0x2ca730[_0xaf12('0x33')],_0xf16633[_0xaf12('0x30')]));if(_0x2ca730['query'][_0xaf12('0x3a')]){_0x27f18d[_0xaf12('0x38')]=_[_0xaf12('0x3b')](_0x27f18d[_0xaf12('0x38')],{'$or':_[_0xaf12('0x2e')](_0x27f18d['attributes'],function(_0xcea1ca){var _0x4b0fb9={};_0x4b0fb9[_0xcea1ca]={'$like':'%'+_0x2ca730[_0xaf12('0x33')][_0xaf12('0x3a')]+'%'};return _0x4b0fb9;})});}_0x27f18d=_['merge']({},_0x27f18d,_0x2ca730['options']);return _0x184edd[_0xaf12('0x4b')](_0x27f18d);}})[_0xaf12('0x26')](function(_0xbac52d){if(_0xbac52d){_0x20b733=_0xbac52d[_0xaf12('0x36')];if(!_0x2ca730[_0xaf12('0x33')][_0xaf12('0x4c')]('nolimit')){_0x27f18d[_0xaf12('0x1e')]=qs['limit'](_0x2ca730['query'][_0xaf12('0x1e')]);_0x27f18d[_0xaf12('0x1b')]=qs[_0xaf12('0x1b')](_0x2ca730[_0xaf12('0x33')][_0xaf12('0x1b')]);}return _0x184edd[_0xaf12('0x4b')](_0x27f18d);}})[_0xaf12('0x26')](function(_0x6c2e0c){if(_0x6c2e0c){return _0x6c2e0c?{'count':_0x20b733,'rows':_0x6c2e0c}:null;}})[_0xaf12('0x26')](respondWithResult(_0x2b9f9d,null))[_0xaf12('0x42')](handleError(_0x2b9f9d,null));};exports[_0xaf12('0x4d')]=function(_0xc2efce,_0x351326,_0x4fcd15){if(_0xc2efce[_0xaf12('0x46')]['id']){delete _0xc2efce[_0xaf12('0x46')]['id'];}return db[_0xaf12('0x3e')][_0xaf12('0x47')]({'where':{'id':_0xc2efce[_0xaf12('0x48')]['id']}})[_0xaf12('0x26')](handleEntityNotFound(_0x351326,null))[_0xaf12('0x26')](function(_0x174709){if(_0x174709){_0xc2efce[_0xaf12('0x46')]['AccountId']=_0x174709['id'];_0xc2efce[_0xaf12('0x46')]['Subjects']=integrations[_0xaf12('0x4e')](_0xc2efce[_0xaf12('0x46')][_0xaf12('0x4f')],_0xc2efce[_0xaf12('0x46')][_0xaf12('0x2c')]);_0xc2efce[_0xaf12('0x46')]['Descriptions']=integrations[_0xaf12('0x50')](_0xc2efce[_0xaf12('0x46')][_0xaf12('0x4f')],_0xc2efce['body'][_0xaf12('0x2c')]);return db[_0xaf12('0x49')][_0xaf12('0x45')](_0xc2efce[_0xaf12('0x46')],{'include':[{'model':db[_0xaf12('0x51')],'as':_0xaf12('0x52')},{'model':db[_0xaf12('0x51')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x351326,null))[_0xaf12('0x42')](handleError(_0x351326,null));};exports[_0xaf12('0x53')]=function(_0x2d5794,_0x24465f,_0x19d8a5){var _0x3975b4='';return db[_0xaf12('0x3e')][_0xaf12('0x47')]({'where':{'id':_0x2d5794[_0xaf12('0x48')]['id']},'attributes':['id',_0xaf12('0x54'),_0xaf12('0x55')]})[_0xaf12('0x26')](handleEntityNotFound(_0x24465f,null))[_0xaf12('0x26')](function(_0x76693e){if(_0x76693e){_0x3975b4=_0x76693e[_0xaf12('0x54')];var _0x5db4a3=_0x3975b4[_0xaf12('0x56')](-0x1);if(_0x5db4a3==='/'){_0x3975b4=_0x3975b4[_0xaf12('0x57')](0x0,_0x3975b4['lastIndexOf'](_0x5db4a3));}return rp({'method':_0xaf12('0x58'),'uri':util['format'](_0xaf12('0x59'),_0x3975b4,_0xaf12('0x5a')),'headers':{'Authorization':util[_0xaf12('0x5b')]('Basic\x20%s',new Buffer(util['format'](_0xaf12('0x5c'),_0x76693e[_0xaf12('0x55')]))[_0xaf12('0x5d')](_0xaf12('0x5e')))},'json':!![]});}})['then'](function(_0x3e1244){if(_0x3e1244){var _0x165e46=['requester',_0xaf12('0x5f'),_0xaf12('0x60'),_0xaf12('0x61'),'status',_0xaf12('0x62'),_0xaf12('0x63'),_0xaf12('0x64'),'ticket_type',_0xaf12('0x63'),_0xaf12('0x65')];_['remove'](_0x3e1244,function(_0x2508cf){return _0x165e46[_0xaf12('0x66')](_0x2508cf['name'])||!_0x2508cf[_0xaf12('0x67')]&&_0x2508cf[_0xaf12('0x2c')]!=='custom_text'&&_0x2508cf[_0xaf12('0x2c')]!==_0xaf12('0x68');});return{'count':_0x3e1244[_0xaf12('0x36')],'rows':_[_0xaf12('0x2e')](_0x3e1244,function(_0x1524c4){return{'id':_0x1524c4[_0xaf12('0x29')],'name':_0x1524c4[_0xaf12('0x69')],'custom':!_0x1524c4[_0xaf12('0x67')],'options':_0x1524c4[_0xaf12('0x6a')]?_['map'](_0x1524c4['choices'],function(_0x1d98ce){return{'name':_[_0xaf12('0x6b')](_0x1d98ce),'value':_0x1d98ce};}):[]};})};}})[_0xaf12('0x26')](respondWithResult(_0x24465f,null))[_0xaf12('0x42')](function(_0x1fb21a){var _0x40de6a=_0x2d5794[_0xaf12('0x33')][_0xaf12('0x6c')]?0x1f4:_0x1fb21a[_0xaf12('0x6d')]||0x1f4;logger[_0xaf12('0x27')](_0xaf12('0x6e'),'getFields',_0x40de6a,JSON[_0xaf12('0x6f')](_0x1fb21a));delete _0x1fb21a[_0xaf12('0x29')];if(_0x40de6a===0x191){_0x40de6a=0x190;}_0x24465f['status'](_0x40de6a)['send'](_0x2d5794['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x1fb21a[_0xaf12('0x6d')]}:_0x1fb21a);});}; \ No newline at end of file +var _0x3013=['priority','group','source','company','includes','default','custom_text','custom_dropdown','choices','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','test','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','json','apply','update','then','send','index','map','FreshdeskAccount','rawAttributes','type','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','length','find','create','body','params','pick','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester'];(function(_0x431d8e,_0x309194){var _0x1d7867=function(_0x285f61){while(--_0x285f61){_0x431d8e['push'](_0x431d8e['shift']());}};_0x1d7867(++_0x309194);}(_0x3013,0xea));var _0x3301=function(_0x19f79e,_0x10a943){_0x19f79e=_0x19f79e-0x0;var _0x28a3dd=_0x3013[_0x19f79e];return _0x28a3dd;};'use strict';var emlformat=require(_0x3301('0x0'));var rimraf=require(_0x3301('0x1'));var zipdir=require(_0x3301('0x2'));var jsonpatch=require(_0x3301('0x3'));var rp=require('request-promise');var moment=require(_0x3301('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3301('0x5'));var util=require(_0x3301('0x6'));var path=require(_0x3301('0x7'));var sox=require(_0x3301('0x8'));var csv=require('to-csv');var ejs=require(_0x3301('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3301('0xa'));var squel=require(_0x3301('0xb'));var crypto=require(_0x3301('0xc'));var jsforce=require(_0x3301('0xd'));var deskjs=require(_0x3301('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3301('0xf'));var Papa=require(_0x3301('0x10'));var Redis=require(_0x3301('0x11'));var authService=require(_0x3301('0x12'));var qs=require(_0x3301('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3301('0x14'));var logger=require(_0x3301('0x15'))(_0x3301('0x16'));var utils=require(_0x3301('0x17'));var config=require(_0x3301('0x18'));var licenseUtil=require(_0x3301('0x19'));var db=require(_0x3301('0x1a'))['db'];var integrations=require(_0x3301('0x1b'));function respondWithStatusCode(_0x427c22,_0x40dad9){_0x40dad9=_0x40dad9||0xcc;return function(_0x16ee9b){if(_0x16ee9b){return _0x427c22[_0x3301('0x1c')](_0x40dad9);}return _0x427c22[_0x3301('0x1d')](_0x40dad9)[_0x3301('0x1e')]();};}function respondWithResult(_0x52a56c,_0x3d182e){_0x3d182e=_0x3d182e||0xc8;return function(_0x2ba805){if(_0x2ba805){return _0x52a56c['status'](_0x3d182e)['json'](_0x2ba805);}};}function respondWithFilteredResult(_0x8f280d,_0x225e94){return function(_0x5e7d09){if(_0x5e7d09){var _0x269d26=typeof _0x225e94[_0x3301('0x1f')]==='undefined'&&typeof _0x225e94[_0x3301('0x20')]===_0x3301('0x21');var _0x194df4=_0x5e7d09['count'];var _0x2e9218=_0x269d26?0x0:_0x225e94[_0x3301('0x1f')];var _0x2a6edb=_0x269d26?_0x5e7d09[_0x3301('0x22')]:_0x225e94[_0x3301('0x1f')]+_0x225e94[_0x3301('0x20')];var _0x4f7f78;if(_0x2a6edb>=_0x194df4){_0x2a6edb=_0x194df4;_0x4f7f78=0xc8;}else{_0x4f7f78=0xce;}_0x8f280d['status'](_0x4f7f78);return _0x8f280d['set']('Content-Range',_0x2e9218+'-'+_0x2a6edb+'/'+_0x194df4)[_0x3301('0x23')](_0x5e7d09);}return null;};}function patchUpdates(_0x2b2005){return function(_0x451367){try{jsonpatch[_0x3301('0x24')](_0x451367,_0x2b2005,!![]);}catch(_0x4b43bb){return BPromise['reject'](_0x4b43bb);}return _0x451367['save']();};}function saveUpdates(_0x3ebe89,_0x54c291){return function(_0x5a6d68){if(_0x5a6d68){return _0x5a6d68[_0x3301('0x25')](_0x3ebe89)[_0x3301('0x26')](function(_0x258d28){return _0x258d28;});}return null;};}function removeEntity(_0xef67c4,_0x1d89b2){return function(_0x461550){if(_0x461550){return _0x461550['destroy']()[_0x3301('0x26')](function(){_0xef67c4[_0x3301('0x1d')](0xcc)[_0x3301('0x1e')]();});}};}function handleEntityNotFound(_0x39d766,_0x54ec21){return function(_0x193252){if(!_0x193252){_0x39d766[_0x3301('0x1c')](0x194);}return _0x193252;};}function handleError(_0x150f73,_0x2febe1){_0x2febe1=_0x2febe1||0x1f4;return function(_0x17c15a){logger['error'](_0x17c15a['stack']);if(_0x17c15a['name']){delete _0x17c15a['name'];}_0x150f73[_0x3301('0x1d')](_0x2febe1)[_0x3301('0x27')](_0x17c15a);};}exports[_0x3301('0x28')]=function(_0x48f661,_0x31d585){var _0x3d1d80={},_0x29cba9={},_0x18281e={'count':0x0,'rows':[]};var _0x17337c=_[_0x3301('0x29')](db[_0x3301('0x2a')][_0x3301('0x2b')],function(_0x529f9d){return{'name':_0x529f9d['fieldName'],'type':_0x529f9d[_0x3301('0x2c')][_0x3301('0x2d')]};});_0x29cba9[_0x3301('0x2e')]=_[_0x3301('0x29')](_0x17337c,_0x3301('0x2f'));_0x29cba9[_0x3301('0x30')]=_[_0x3301('0x31')](_0x48f661['query']);_0x29cba9['filters']=_[_0x3301('0x32')](_0x29cba9[_0x3301('0x2e')],_0x29cba9[_0x3301('0x30')]);_0x3d1d80[_0x3301('0x33')]=_[_0x3301('0x32')](_0x29cba9[_0x3301('0x2e')],qs[_0x3301('0x34')](_0x48f661[_0x3301('0x30')][_0x3301('0x34')]));_0x3d1d80['attributes']=_0x3d1d80[_0x3301('0x33')]['length']?_0x3d1d80['attributes']:_0x29cba9[_0x3301('0x2e')];if(!_0x48f661[_0x3301('0x30')][_0x3301('0x35')](_0x3301('0x36'))){_0x3d1d80[_0x3301('0x20')]=qs[_0x3301('0x20')](_0x48f661[_0x3301('0x30')]['limit']);_0x3d1d80[_0x3301('0x1f')]=qs[_0x3301('0x1f')](_0x48f661[_0x3301('0x30')][_0x3301('0x1f')]);}_0x3d1d80[_0x3301('0x37')]=qs[_0x3301('0x38')](_0x48f661[_0x3301('0x30')]['sort']);_0x3d1d80[_0x3301('0x39')]=qs[_0x3301('0x3a')](_['pick'](_0x48f661['query'],_0x29cba9[_0x3301('0x3a')]),_0x17337c);if(_0x48f661[_0x3301('0x30')]['filter']){_0x3d1d80[_0x3301('0x39')]=_['merge'](_0x3d1d80[_0x3301('0x39')],{'$or':_[_0x3301('0x29')](_0x17337c,function(_0x4293ce){if(_0x4293ce[_0x3301('0x2c')]!==_0x3301('0x3b')){var _0x41c1b3={};_0x41c1b3[_0x4293ce[_0x3301('0x2f')]]={'$like':'%'+_0x48f661[_0x3301('0x30')][_0x3301('0x3c')]+'%'};return _0x41c1b3;}})});}_0x3d1d80=_[_0x3301('0x3d')]({},_0x3d1d80,_0x48f661[_0x3301('0x3e')]);var _0x31be46={'where':_0x3d1d80['where']};return db[_0x3301('0x2a')]['count'](_0x31be46)[_0x3301('0x26')](function(_0x4c7370){_0x18281e['count']=_0x4c7370;if(_0x48f661['query'][_0x3301('0x3f')]){_0x3d1d80['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0x3301('0x40')](_0x3d1d80);})[_0x3301('0x26')](function(_0xd538c4){_0x18281e[_0x3301('0x41')]=_0xd538c4;return _0x18281e;})[_0x3301('0x26')](respondWithFilteredResult(_0x31d585,_0x3d1d80))[_0x3301('0x42')](handleError(_0x31d585,null));};exports[_0x3301('0x43')]=function(_0x35da96,_0x1ac70a){var _0x3ea13b={'raw':![],'where':{'id':_0x35da96['params']['id']}},_0x594e23={};_0x594e23[_0x3301('0x2e')]=_[_0x3301('0x31')](db[_0x3301('0x2a')]['rawAttributes']);_0x594e23[_0x3301('0x30')]=_['keys'](_0x35da96['query']);_0x594e23['filters']=_[_0x3301('0x32')](_0x594e23['model'],_0x594e23['query']);_0x3ea13b[_0x3301('0x33')]=_[_0x3301('0x32')](_0x594e23[_0x3301('0x2e')],qs[_0x3301('0x34')](_0x35da96[_0x3301('0x30')][_0x3301('0x34')]));_0x3ea13b[_0x3301('0x33')]=_0x3ea13b['attributes'][_0x3301('0x44')]?_0x3ea13b[_0x3301('0x33')]:_0x594e23[_0x3301('0x2e')];if(_0x35da96['query']['includeAll']){_0x3ea13b['include']=[{'all':!![]}];}_0x3ea13b=_['merge']({},_0x3ea13b,_0x35da96[_0x3301('0x3e')]);return db['FreshdeskAccount'][_0x3301('0x45')](_0x3ea13b)[_0x3301('0x26')](handleEntityNotFound(_0x1ac70a,null))['then'](respondWithResult(_0x1ac70a,null))[_0x3301('0x42')](handleError(_0x1ac70a,null));};exports[_0x3301('0x46')]=function(_0x26183c,_0x2584cf){return db[_0x3301('0x2a')]['create'](_0x26183c[_0x3301('0x47')],{})[_0x3301('0x26')](respondWithResult(_0x2584cf,0xc9))['catch'](handleError(_0x2584cf,null));};exports[_0x3301('0x25')]=function(_0x1c881d,_0x1c6fda){if(_0x1c881d[_0x3301('0x47')]['id']){delete _0x1c881d[_0x3301('0x47')]['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x1c881d['params']['id']}})[_0x3301('0x26')](handleEntityNotFound(_0x1c6fda,null))[_0x3301('0x26')](saveUpdates(_0x1c881d[_0x3301('0x47')],null))[_0x3301('0x26')](respondWithResult(_0x1c6fda,null))[_0x3301('0x42')](handleError(_0x1c6fda,null));};exports['destroy']=function(_0x16bd4b,_0x4a384d){return db['FreshdeskAccount'][_0x3301('0x45')]({'where':{'id':_0x16bd4b[_0x3301('0x48')]['id']}})[_0x3301('0x26')](handleEntityNotFound(_0x4a384d,null))[_0x3301('0x26')](removeEntity(_0x4a384d,null))[_0x3301('0x42')](handleError(_0x4a384d,null));};exports['getConfigurations']=function(_0xf74723,_0x10c4ec,_0x2a66ac){var _0x39aef9={};var _0x596924={};var _0x2c564a;var _0x3a17d6;return db[_0x3301('0x2a')]['findOne']({'where':{'id':_0xf74723['params']['id']}})[_0x3301('0x26')](handleEntityNotFound(_0x10c4ec,null))[_0x3301('0x26')](function(_0xb1fe9e){if(_0xb1fe9e){_0x2c564a=_0xb1fe9e;_0x596924[_0x3301('0x2e')]=_[_0x3301('0x31')](db['FreshdeskConfiguration'][_0x3301('0x2b')]);_0x596924[_0x3301('0x30')]=_[_0x3301('0x31')](_0xf74723['query']);_0x596924[_0x3301('0x3a')]=_[_0x3301('0x32')](_0x596924[_0x3301('0x2e')],_0x596924[_0x3301('0x30')]);_0x39aef9[_0x3301('0x33')]=_['intersection'](_0x596924[_0x3301('0x2e')],qs[_0x3301('0x34')](_0xf74723[_0x3301('0x30')]['fields']));_0x39aef9[_0x3301('0x33')]=_0x39aef9[_0x3301('0x33')][_0x3301('0x44')]?_0x39aef9[_0x3301('0x33')]:_0x596924[_0x3301('0x2e')];_0x39aef9['order']=qs[_0x3301('0x38')](_0xf74723[_0x3301('0x30')][_0x3301('0x38')]);_0x39aef9[_0x3301('0x39')]=qs[_0x3301('0x3a')](_[_0x3301('0x49')](_0xf74723['query'],_0x596924[_0x3301('0x3a')]));if(_0xf74723[_0x3301('0x30')]['filter']){_0x39aef9['where']=_[_0x3301('0x3d')](_0x39aef9[_0x3301('0x39')],{'$or':_[_0x3301('0x29')](_0x39aef9[_0x3301('0x33')],function(_0x3368da){var _0x128441={};_0x128441[_0x3368da]={'$like':'%'+_0xf74723[_0x3301('0x30')][_0x3301('0x3c')]+'%'};return _0x128441;})});}_0x39aef9=_[_0x3301('0x3d')]({},_0x39aef9,_0xf74723[_0x3301('0x3e')]);return _0x2c564a['getConfigurations'](_0x39aef9);}})['then'](function(_0x358848){if(_0x358848){_0x3a17d6=_0x358848['length'];if(!_0xf74723[_0x3301('0x30')]['hasOwnProperty'](_0x3301('0x36'))){_0x39aef9[_0x3301('0x20')]=qs[_0x3301('0x20')](_0xf74723['query']['limit']);_0x39aef9[_0x3301('0x1f')]=qs[_0x3301('0x1f')](_0xf74723[_0x3301('0x30')]['offset']);}return _0x2c564a[_0x3301('0x4a')](_0x39aef9);}})[_0x3301('0x26')](function(_0x35fa81){if(_0x35fa81){return _0x35fa81?{'count':_0x3a17d6,'rows':_0x35fa81}:null;}})[_0x3301('0x26')](respondWithResult(_0x10c4ec,null))[_0x3301('0x42')](handleError(_0x10c4ec,null));};exports[_0x3301('0x4b')]=function(_0x51ada4,_0x2f2539,_0x5009fa){if(_0x51ada4[_0x3301('0x47')]['id']){delete _0x51ada4['body']['id'];}return db['FreshdeskAccount'][_0x3301('0x4c')]({'where':{'id':_0x51ada4[_0x3301('0x48')]['id']}})[_0x3301('0x26')](handleEntityNotFound(_0x2f2539,null))[_0x3301('0x26')](function(_0xa0dcc1){if(_0xa0dcc1){_0x51ada4['body'][_0x3301('0x4d')]=_0xa0dcc1['id'];_0x51ada4[_0x3301('0x47')][_0x3301('0x4e')]=integrations['getSubjects'](_0x51ada4[_0x3301('0x47')][_0x3301('0x4f')],_0x51ada4[_0x3301('0x47')][_0x3301('0x2c')]);_0x51ada4[_0x3301('0x47')][_0x3301('0x50')]=integrations[_0x3301('0x51')](_0x51ada4[_0x3301('0x47')][_0x3301('0x4f')],_0x51ada4[_0x3301('0x47')][_0x3301('0x2c')]);return db['FreshdeskConfiguration'][_0x3301('0x46')](_0x51ada4['body'],{'include':[{'model':db[_0x3301('0x52')],'as':_0x3301('0x4e')},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x2f2539,null))['catch'](handleError(_0x2f2539,null));};exports['getFields']=function(_0x5c6161,_0x2a45b3,_0x10eabc){var _0x2a126a='';return db[_0x3301('0x2a')][_0x3301('0x4c')]({'where':{'id':_0x5c6161['params']['id']},'attributes':['id',_0x3301('0x53'),_0x3301('0x54')]})[_0x3301('0x26')](handleEntityNotFound(_0x2a45b3,null))[_0x3301('0x26')](function(_0x5d7809){if(_0x5d7809){_0x2a126a=_0x5d7809[_0x3301('0x53')];var _0x667afe=_0x2a126a[_0x3301('0x55')](-0x1);if(_0x667afe==='/'){_0x2a126a=_0x2a126a[_0x3301('0x56')](0x0,_0x2a126a['lastIndexOf'](_0x667afe));}return rp({'method':_0x3301('0x57'),'uri':util[_0x3301('0x58')](_0x3301('0x59'),_0x2a126a,_0x3301('0x5a')),'headers':{'Authorization':util[_0x3301('0x58')](_0x3301('0x5b'),new Buffer(util['format'](_0x3301('0x5c'),_0x5d7809[_0x3301('0x54')]))[_0x3301('0x5d')](_0x3301('0x5e')))},'json':!![]});}})[_0x3301('0x26')](function(_0x5c3fc3){if(_0x5c3fc3){var _0x174426=[_0x3301('0x5f'),'subject','agent','description','status',_0x3301('0x60'),_0x3301('0x61'),_0x3301('0x62'),'ticket_type',_0x3301('0x61'),_0x3301('0x63')];_['remove'](_0x5c3fc3,function(_0x52c65d){return _0x174426[_0x3301('0x64')](_0x52c65d[_0x3301('0x2f')])||!_0x52c65d[_0x3301('0x65')]&&_0x52c65d['type']!==_0x3301('0x66')&&_0x52c65d[_0x3301('0x2c')]!==_0x3301('0x67');});return{'count':_0x5c3fc3[_0x3301('0x44')],'rows':_[_0x3301('0x29')](_0x5c3fc3,function(_0x5f1e87){return{'id':_0x5f1e87['name'],'name':_0x5f1e87['label'],'custom':!_0x5f1e87['default'],'options':_0x5f1e87['choices']?_['map'](_0x5f1e87[_0x3301('0x68')],function(_0x5537a0){return{'name':_['capitalize'](_0x5537a0),'value':_0x5537a0};}):[]};})};}})['then'](respondWithResult(_0x2a45b3,null))['catch'](function(_0x1c4660){var _0x32a070=_0x5c6161[_0x3301('0x30')]['test']?0x1f4:_0x1c4660[_0x3301('0x69')]||0x1f4;logger[_0x3301('0x6a')](_0x3301('0x6b'),_0x3301('0x6c'),_0x32a070,JSON['stringify'](_0x1c4660));delete _0x1c4660[_0x3301('0x2f')];if(_0x32a070===0x191){_0x32a070=0x190;}_0x2a45b3[_0x3301('0x1d')](_0x32a070)[_0x3301('0x27')](_0x5c6161[_0x3301('0x30')][_0x3301('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x1c4660['statusCode']}:_0x1c4660);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 0ce5c66..fb0aeb2 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 _0x5388=['request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','moment','bluebird'];(function(_0x2322ae,_0x4a157d){var _0x1518ad=function(_0x19a922){while(--_0x19a922){_0x2322ae['push'](_0x2322ae['shift']());}};_0x1518ad(++_0x4a157d);}(_0x5388,0x194));var _0x8538=function(_0x354417,_0x36a9c5){_0x354417=_0x354417-0x0;var _0x4a6e62=_0x5388[_0x354417];return _0x4a6e62;};'use strict';var _=require('lodash');var util=require(_0x8538('0x0'));var logger=require(_0x8538('0x1'))('api');var moment=require(_0x8538('0x2'));var BPromise=require(_0x8538('0x3'));var rp=require(_0x8538('0x4'));var fs=require('fs');var path=require(_0x8538('0x5'));var rimraf=require(_0x8538('0x6'));var config=require(_0x8538('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x8538('0x8'));module[_0x8538('0x9')]=function(_0x556878,_0x594412){return _0x556878['define'](_0x8538('0xa'),attributes,{'tableName':_0x8538('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb172=['../../config/environment','exports','define','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','path'];(function(_0x5564e8,_0x128b17){var _0xaebe4b=function(_0x99f596){while(--_0x99f596){_0x5564e8['push'](_0x5564e8['shift']());}};_0xaebe4b(++_0x128b17);}(_0xb172,0x176));var _0x2b17=function(_0x3b0720,_0x5eb300){_0x3b0720=_0x3b0720-0x0;var _0xfef599=_0xb172[_0x3b0720];return _0xfef599;};'use strict';var _=require(_0x2b17('0x0'));var util=require(_0x2b17('0x1'));var logger=require(_0x2b17('0x2'))(_0x2b17('0x3'));var moment=require(_0x2b17('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b17('0x5'));var rimraf=require('rimraf');var config=require(_0x2b17('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x2b17('0x7')]=function(_0x29a9b3,_0x52b6c4){return _0x29a9b3[_0x2b17('0x8')]('FreshdeskAccount',attributes,{'tableName':_0x2b17('0x9'),'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 5a500f7..1326866 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 _0x88f3=['then','ShowFreshdeskAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x396031,_0x442c2b){var _0x139a16=function(_0x204d7c){while(--_0x204d7c){_0x396031['push'](_0x396031['shift']());}};_0x139a16(++_0x442c2b);}(_0x88f3,0x1f1));var _0x388f=function(_0xe95a4,_0x157cf7){_0xe95a4=_0xe95a4-0x0;var _0x4533a0=_0x88f3[_0xe95a4];return _0x4533a0;};'use strict';var _=require('lodash');var util=require(_0x388f('0x0'));var moment=require(_0x388f('0x1'));var BPromise=require(_0x388f('0x2'));var rs=require(_0x388f('0x3'));var fs=require('fs');var Redis=require(_0x388f('0x4'));var db=require(_0x388f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x388f('0x6'))(_0x388f('0x7'));var config=require(_0x388f('0x8'));var jayson=require(_0x388f('0x9'));var client=jayson[_0x388f('0xa')][_0x388f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x214217,_0x328784,_0x2fa863){return new BPromise(function(_0x41ee63,_0x2644b7){return client[_0x388f('0xc')](_0x214217,_0x2fa863)['then'](function(_0x5326bc){logger[_0x388f('0xd')](_0x388f('0xe'),_0x328784,_0x388f('0xf'));logger[_0x388f('0x10')](_0x388f('0x11'),_0x328784,'request\x20sent',JSON[_0x388f('0x12')](_0x5326bc));if(_0x5326bc['error']){if(_0x5326bc[_0x388f('0x13')][_0x388f('0x14')]===0x1f4){logger['error'](_0x388f('0xe'),_0x328784,_0x5326bc[_0x388f('0x13')][_0x388f('0x15')]);return _0x2644b7(_0x5326bc[_0x388f('0x13')]['message']);}logger[_0x388f('0x13')](_0x388f('0xe'),_0x328784,_0x5326bc['error'][_0x388f('0x15')]);return _0x41ee63(_0x5326bc['error']['message']);}else{logger[_0x388f('0xd')](_0x388f('0xe'),_0x328784,'request\x20sent');_0x41ee63(_0x5326bc[_0x388f('0x16')][_0x388f('0x15')]);}})[_0x388f('0x17')](function(_0xa13940){logger[_0x388f('0x13')](_0x388f('0xe'),_0x328784,_0xa13940);_0x2644b7(_0xa13940);});});}exports[_0x388f('0x18')]=function(_0x3ad22e){var _0x30ee26=this;return new Promise(function(_0x49e32a,_0x7c7d5d){return db[_0x388f('0x19')][_0x388f('0x1a')]({'raw':_0x3ad22e[_0x388f('0x1b')]?_0x3ad22e[_0x388f('0x1b')][_0x388f('0x1c')]===undefined?!![]:![]:!![],'where':_0x3ad22e[_0x388f('0x1b')]?_0x3ad22e[_0x388f('0x1b')][_0x388f('0x1d')]||null:null,'attributes':_0x3ad22e[_0x388f('0x1b')]?_0x3ad22e[_0x388f('0x1b')][_0x388f('0x1e')]||null:null,'limit':_0x3ad22e[_0x388f('0x1b')]?_0x3ad22e[_0x388f('0x1b')][_0x388f('0x1f')]||null:null,'include':_0x3ad22e['options']?_0x3ad22e[_0x388f('0x1b')][_0x388f('0x20')]?_['map'](_0x3ad22e[_0x388f('0x1b')]['include'],function(_0x15c7c0){return{'model':db[_0x15c7c0['model']],'as':_0x15c7c0['as'],'attributes':_0x15c7c0[_0x388f('0x1e')],'include':_0x15c7c0[_0x388f('0x20')]?_[_0x388f('0x21')](_0x15c7c0[_0x388f('0x20')],function(_0x1419fe){return{'model':db[_0x1419fe[_0x388f('0x22')]],'as':_0x1419fe['as'],'attributes':_0x1419fe[_0x388f('0x1e')],'include':_0x1419fe['include']?_['map'](_0x1419fe[_0x388f('0x20')],function(_0x46bea9){return{'model':db[_0x46bea9[_0x388f('0x22')]],'as':_0x46bea9['as'],'attributes':_0x46bea9[_0x388f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x388f('0x23')](function(_0x1a3084){logger[_0x388f('0xd')]('GetFreshdeskAccount',_0x3ad22e);logger['debug'](_0x388f('0x18'),_0x3ad22e,JSON[_0x388f('0x12')](_0x1a3084));_0x49e32a(_0x1a3084);})[_0x388f('0x17')](function(_0x564f37){logger[_0x388f('0x13')](_0x388f('0x18'),_0x564f37[_0x388f('0x15')],_0x3ad22e);_0x7c7d5d(_0x30ee26[_0x388f('0x13')](0x1f4,_0x564f37[_0x388f('0x15')]));});});};exports[_0x388f('0x24')]=function(_0x714abc){var _0x36d78d=this;return new Promise(function(_0x44663d,_0x5acee0){return db[_0x388f('0x19')][_0x388f('0x25')]({'raw':_0x714abc[_0x388f('0x1b')]?_0x714abc[_0x388f('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x714abc[_0x388f('0x1b')]?_0x714abc[_0x388f('0x1b')][_0x388f('0x1d')]||null:null,'attributes':_0x714abc[_0x388f('0x1b')]?_0x714abc[_0x388f('0x1b')][_0x388f('0x1e')]||null:null,'include':_0x714abc[_0x388f('0x1b')]?_0x714abc[_0x388f('0x1b')][_0x388f('0x20')]?_[_0x388f('0x21')](_0x714abc['options'][_0x388f('0x20')],function(_0x4c64d0){return{'model':db[_0x4c64d0[_0x388f('0x22')]],'as':_0x4c64d0['as'],'attributes':_0x4c64d0[_0x388f('0x1e')],'include':_0x4c64d0[_0x388f('0x20')]?_[_0x388f('0x21')](_0x4c64d0['include'],function(_0x58411a){return{'model':db[_0x58411a[_0x388f('0x22')]],'as':_0x58411a['as'],'attributes':_0x58411a[_0x388f('0x1e')],'include':_0x58411a['include']?_[_0x388f('0x21')](_0x58411a[_0x388f('0x20')],function(_0x24b885){return{'model':db[_0x24b885['model']],'as':_0x24b885['as'],'attributes':_0x24b885[_0x388f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x388f('0x23')](function(_0x129ace){logger[_0x388f('0xd')]('ShowFreshdeskAccount',_0x714abc);logger['debug'](_0x388f('0x24'),_0x714abc,JSON[_0x388f('0x12')](_0x129ace));_0x44663d(_0x129ace);})[_0x388f('0x17')](function(_0x2889c6){logger[_0x388f('0x13')]('ShowFreshdeskAccount',_0x2889c6['message'],_0x714abc);_0x5acee0(_0x36d78d[_0x388f('0x13')](0x1f4,_0x2889c6['message']));});});}; \ No newline at end of file +var _0x4040=['catch','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskAccount,\x20%s,\x20%s','result','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','limit','include','map','model'];(function(_0x45bed4,_0x14b61b){var _0x1d64c8=function(_0x510e2a){while(--_0x510e2a){_0x45bed4['push'](_0x45bed4['shift']());}};_0x1d64c8(++_0x14b61b);}(_0x4040,0x1bf));var _0x0404=function(_0x880ff2,_0x583318){_0x880ff2=_0x880ff2-0x0;var _0x1589f1=_0x4040[_0x880ff2];return _0x1589f1;};'use strict';var _=require(_0x0404('0x0'));var util=require(_0x0404('0x1'));var moment=require(_0x0404('0x2'));var BPromise=require(_0x0404('0x3'));var rs=require(_0x0404('0x4'));var fs=require('fs');var Redis=require(_0x0404('0x5'));var db=require(_0x0404('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0404('0x7'));var config=require(_0x0404('0x8'));var jayson=require(_0x0404('0x9'));var client=jayson[_0x0404('0xa')][_0x0404('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x70c130,_0x262f3b,_0x1cf5a5){return new BPromise(function(_0x55765f,_0x177e7a){return client[_0x0404('0xc')](_0x70c130,_0x1cf5a5)[_0x0404('0xd')](function(_0x1a2f5a){logger[_0x0404('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x262f3b,_0x0404('0xf'));logger[_0x0404('0x10')](_0x0404('0x11'),_0x262f3b,_0x0404('0xf'),JSON[_0x0404('0x12')](_0x1a2f5a));if(_0x1a2f5a['error']){if(_0x1a2f5a[_0x0404('0x13')][_0x0404('0x14')]===0x1f4){logger[_0x0404('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x262f3b,_0x1a2f5a[_0x0404('0x13')][_0x0404('0x15')]);return _0x177e7a(_0x1a2f5a[_0x0404('0x13')][_0x0404('0x15')]);}logger[_0x0404('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x262f3b,_0x1a2f5a[_0x0404('0x13')][_0x0404('0x15')]);return _0x55765f(_0x1a2f5a[_0x0404('0x13')][_0x0404('0x15')]);}else{logger[_0x0404('0xe')](_0x0404('0x16'),_0x262f3b,'request\x20sent');_0x55765f(_0x1a2f5a[_0x0404('0x17')][_0x0404('0x15')]);}})['catch'](function(_0x5ef143){logger[_0x0404('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x262f3b,_0x5ef143);_0x177e7a(_0x5ef143);});});}exports[_0x0404('0x18')]=function(_0x3b98ac){var _0x536c40=this;return new Promise(function(_0x44dab3,_0x2d2095){return db[_0x0404('0x19')]['findAll']({'raw':_0x3b98ac[_0x0404('0x1a')]?_0x3b98ac[_0x0404('0x1a')][_0x0404('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b98ac['options']?_0x3b98ac[_0x0404('0x1a')][_0x0404('0x1c')]||null:null,'attributes':_0x3b98ac[_0x0404('0x1a')]?_0x3b98ac[_0x0404('0x1a')][_0x0404('0x1d')]||null:null,'limit':_0x3b98ac[_0x0404('0x1a')]?_0x3b98ac[_0x0404('0x1a')][_0x0404('0x1e')]||null:null,'include':_0x3b98ac[_0x0404('0x1a')]?_0x3b98ac[_0x0404('0x1a')][_0x0404('0x1f')]?_[_0x0404('0x20')](_0x3b98ac[_0x0404('0x1a')][_0x0404('0x1f')],function(_0x1a46f2){return{'model':db[_0x1a46f2[_0x0404('0x21')]],'as':_0x1a46f2['as'],'attributes':_0x1a46f2[_0x0404('0x1d')],'include':_0x1a46f2['include']?_[_0x0404('0x20')](_0x1a46f2[_0x0404('0x1f')],function(_0xf4a5e1){return{'model':db[_0xf4a5e1['model']],'as':_0xf4a5e1['as'],'attributes':_0xf4a5e1[_0x0404('0x1d')],'include':_0xf4a5e1['include']?_[_0x0404('0x20')](_0xf4a5e1[_0x0404('0x1f')],function(_0x3e0187){return{'model':db[_0x3e0187['model']],'as':_0x3e0187['as'],'attributes':_0x3e0187[_0x0404('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0404('0xd')](function(_0x2001ac){logger['info'](_0x0404('0x18'),_0x3b98ac);logger[_0x0404('0x10')](_0x0404('0x18'),_0x3b98ac,JSON[_0x0404('0x12')](_0x2001ac));_0x44dab3(_0x2001ac);})[_0x0404('0x22')](function(_0x8a30d2){logger['error']('GetFreshdeskAccount',_0x8a30d2[_0x0404('0x15')],_0x3b98ac);_0x2d2095(_0x536c40['error'](0x1f4,_0x8a30d2[_0x0404('0x15')]));});});};exports[_0x0404('0x23')]=function(_0x627b49){var _0x25c2d6=this;return new Promise(function(_0x13ec00,_0x584afa){return db[_0x0404('0x19')][_0x0404('0x24')]({'raw':_0x627b49[_0x0404('0x1a')]?_0x627b49[_0x0404('0x1a')][_0x0404('0x1b')]===undefined?!![]:![]:!![],'where':_0x627b49[_0x0404('0x1a')]?_0x627b49['options']['where']||null:null,'attributes':_0x627b49[_0x0404('0x1a')]?_0x627b49[_0x0404('0x1a')]['attributes']||null:null,'include':_0x627b49[_0x0404('0x1a')]?_0x627b49['options'][_0x0404('0x1f')]?_['map'](_0x627b49[_0x0404('0x1a')]['include'],function(_0x108961){return{'model':db[_0x108961[_0x0404('0x21')]],'as':_0x108961['as'],'attributes':_0x108961['attributes'],'include':_0x108961['include']?_[_0x0404('0x20')](_0x108961[_0x0404('0x1f')],function(_0x334285){return{'model':db[_0x334285[_0x0404('0x21')]],'as':_0x334285['as'],'attributes':_0x334285['attributes'],'include':_0x334285[_0x0404('0x1f')]?_[_0x0404('0x20')](_0x334285[_0x0404('0x1f')],function(_0x209fe6){return{'model':db[_0x209fe6['model']],'as':_0x209fe6['as'],'attributes':_0x209fe6['attributes']};}):[]};}):[]};}):[]:[]})[_0x0404('0xd')](function(_0xfcbede){logger[_0x0404('0xe')]('ShowFreshdeskAccount',_0x627b49);logger[_0x0404('0x10')](_0x0404('0x23'),_0x627b49,JSON['stringify'](_0xfcbede));_0x13ec00(_0xfcbede);})['catch'](function(_0x5d669d){logger[_0x0404('0x13')](_0x0404('0x23'),_0x5d669d[_0x0404('0x15')],_0x627b49);_0x584afa(_0x25c2d6[_0x0404('0x13')](0x1f4,_0x5d669d['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 5b68c4a..c33a8ef 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 _0xdd5d=['get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','/:id','update','delete','destroy','multer','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','index'];(function(_0x5d849f,_0x3494ab){var _0x17712a=function(_0x56bb98){while(--_0x56bb98){_0x5d849f['push'](_0x5d849f['shift']());}};_0x17712a(++_0x3494ab);}(_0xdd5d,0x118));var _0xddd5=function(_0x1cf3ca,_0x4d4ceb){_0x1cf3ca=_0x1cf3ca-0x0;var _0x2004e5=_0xdd5d[_0x1cf3ca];return _0x2004e5;};'use strict';var multer=require(_0xddd5('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(_0xddd5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0xddd5('0x2'));var config=require(_0xddd5('0x3'));var controller=require(_0xddd5('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xddd5('0x5')]);router[_0xddd5('0x6')]('/:id',auth[_0xddd5('0x7')](),controller[_0xddd5('0x8')]);router[_0xddd5('0x6')](_0xddd5('0x9'),auth[_0xddd5('0x7')](),controller[_0xddd5('0xa')]);router[_0xddd5('0x6')](_0xddd5('0xb'),auth[_0xddd5('0x7')](),controller[_0xddd5('0xc')]);router['get'](_0xddd5('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xddd5('0x6')](_0xddd5('0xe'),auth[_0xddd5('0x7')](),controller[_0xddd5('0xf')]);router[_0xddd5('0x10')]('/',auth[_0xddd5('0x7')](),controller[_0xddd5('0x11')]);router[_0xddd5('0x10')]('/:id/tags',auth[_0xddd5('0x7')](),controller['setTags']);router['put'](_0xddd5('0x12'),auth[_0xddd5('0x7')](),controller[_0xddd5('0x13')]);router[_0xddd5('0x14')](_0xddd5('0x12'),auth[_0xddd5('0x7')](),controller[_0xddd5('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf528=['setTags','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','/:id','show','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post'];(function(_0xd29711,_0x6f2a90){var _0x5b10fe=function(_0x3455cc){while(--_0x3455cc){_0xd29711['push'](_0xd29711['shift']());}};_0x5b10fe(++_0x6f2a90);}(_0xf528,0x1ae));var _0x8f52=function(_0x6a8751,_0x45b358){_0x6a8751=_0x6a8751-0x0;var _0x7722c6=_0xf528[_0x6a8751];return _0x7722c6;};'use strict';var multer=require(_0x8f52('0x0'));var util=require(_0x8f52('0x1'));var path=require('path');var timeout=require(_0x8f52('0x2'));var express=require(_0x8f52('0x3'));var router=express[_0x8f52('0x4')]();var fs_extra=require(_0x8f52('0x5'));var auth=require(_0x8f52('0x6'));var interaction=require(_0x8f52('0x7'));var config=require(_0x8f52('0x8'));var controller=require(_0x8f52('0x9'));router[_0x8f52('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8f52('0xa')](_0x8f52('0xb'),auth['isAuthenticated'](),controller[_0x8f52('0xc')]);router[_0x8f52('0xa')]('/:id/fields',auth[_0x8f52('0xd')](),controller['getFields']);router['get'](_0x8f52('0xe'),auth[_0x8f52('0xd')](),controller[_0x8f52('0xf')]);router[_0x8f52('0xa')](_0x8f52('0x10'),auth[_0x8f52('0xd')](),controller[_0x8f52('0x11')]);router[_0x8f52('0xa')](_0x8f52('0x12'),auth[_0x8f52('0xd')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8f52('0x13')](_0x8f52('0x12'),auth[_0x8f52('0xd')](),controller[_0x8f52('0x14')]);router[_0x8f52('0x15')](_0x8f52('0xb'),auth['isAuthenticated'](),controller[_0x8f52('0x16')]);router['delete'](_0x8f52('0xb'),auth[_0x8f52('0xd')](),controller[_0x8f52('0x17')]);module[_0x8f52('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 633738c..aa4fb9f 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 _0xc137=['STRING','exports'];(function(_0x26ae1f,_0x4483d5){var _0x210bc9=function(_0x3d09ca){while(--_0x3d09ca){_0x26ae1f['push'](_0x26ae1f['shift']());}};_0x210bc9(++_0x4483d5);}(_0xc137,0xf5));var _0x7c13=function(_0x18ebf5,_0x2cd5c6){_0x18ebf5=_0x18ebf5-0x0;var _0x27471a=_0xc137[_0x18ebf5];return _0x27471a;};'use strict';var Sequelize=require('sequelize');module[_0x7c13('0x0')]={'name':{'type':Sequelize[_0x7c13('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc454=['sequelize','STRING'];(function(_0x41eeef,_0x1506e8){var _0x4bdf6d=function(_0x302c34){while(--_0x302c34){_0x41eeef['push'](_0x41eeef['shift']());}};_0x4bdf6d(++_0x1506e8);}(_0xc454,0x118));var _0x4c45=function(_0x27c820,_0x5707c1){_0x27c820=_0x27c820-0x0;var _0x4da263=_0xc454[_0x27c820];return _0x4da263;};'use strict';var Sequelize=require(_0x4c45('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4c45('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index c17b3a4..71437f4 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 _0xa113=['findAll','catch','params','options','find','create','body','destroy','getFields','hasOwnProperty','getSubjects','findOne','FreshdeskField','pick','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','stack','name','map','FreshdeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','then','includeAll','include'];(function(_0x360995,_0x35c271){var _0x2c280c=function(_0x3c1de4){while(--_0x3c1de4){_0x360995['push'](_0x360995['shift']());}};_0x2c280c(++_0x35c271);}(_0xa113,0x1f3));var _0x3a11=function(_0x2c1aa8,_0x3e0609){_0x2c1aa8=_0x2c1aa8-0x0;var _0x4019f5=_0xa113[_0x2c1aa8];return _0x4019f5;};'use strict';var emlformat=require(_0x3a11('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a11('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3a11('0x2'));var BPromise=require(_0x3a11('0x3'));var Mustache=require(_0x3a11('0x4'));var util=require(_0x3a11('0x5'));var path=require(_0x3a11('0x6'));var sox=require(_0x3a11('0x7'));var csv=require(_0x3a11('0x8'));var ejs=require(_0x3a11('0x9'));var fs=require('fs');var fs_extra=require(_0x3a11('0xa'));var _=require(_0x3a11('0xb'));var squel=require(_0x3a11('0xc'));var crypto=require('crypto');var jsforce=require(_0x3a11('0xd'));var deskjs=require(_0x3a11('0xe'));var toCsv=require(_0x3a11('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3a11('0xf'));var authService=require(_0x3a11('0x10'));var qs=require(_0x3a11('0x11'));var as=require(_0x3a11('0x12'));var hardwareService=require(_0x3a11('0x13'));var logger=require(_0x3a11('0x14'))('api');var utils=require(_0x3a11('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3a11('0x16'));var db=require(_0x3a11('0x17'))['db'];function respondWithStatusCode(_0x18fc28,_0x2baece){_0x2baece=_0x2baece||0xcc;return function(_0x481c47){if(_0x481c47){return _0x18fc28[_0x3a11('0x18')](_0x2baece);}return _0x18fc28[_0x3a11('0x19')](_0x2baece)[_0x3a11('0x1a')]();};}function respondWithResult(_0x3bb582,_0x82ec7b){_0x82ec7b=_0x82ec7b||0xc8;return function(_0x54f403){if(_0x54f403){return _0x3bb582[_0x3a11('0x19')](_0x82ec7b)[_0x3a11('0x1b')](_0x54f403);}};}function respondWithFilteredResult(_0x15d4ff,_0x4db2e2){return function(_0x217f3a){if(_0x217f3a){var _0x1f1514=typeof _0x4db2e2['offset']===_0x3a11('0x1c')&&typeof _0x4db2e2[_0x3a11('0x1d')]===_0x3a11('0x1c');var _0x553cf7=_0x217f3a[_0x3a11('0x1e')];var _0x437d26=_0x1f1514?0x0:_0x4db2e2[_0x3a11('0x1f')];var _0x311859=_0x1f1514?_0x217f3a[_0x3a11('0x1e')]:_0x4db2e2[_0x3a11('0x1f')]+_0x4db2e2[_0x3a11('0x1d')];var _0x47d4e3;if(_0x311859>=_0x553cf7){_0x311859=_0x553cf7;_0x47d4e3=0xc8;}else{_0x47d4e3=0xce;}_0x15d4ff[_0x3a11('0x19')](_0x47d4e3);return _0x15d4ff[_0x3a11('0x20')](_0x3a11('0x21'),_0x437d26+'-'+_0x311859+'/'+_0x553cf7)[_0x3a11('0x1b')](_0x217f3a);}return null;};}function patchUpdates(_0x3ea1ac){return function(_0x4258fa){try{jsonpatch[_0x3a11('0x22')](_0x4258fa,_0x3ea1ac,!![]);}catch(_0x204098){return BPromise['reject'](_0x204098);}return _0x4258fa[_0x3a11('0x23')]();};}function saveUpdates(_0x29e47a,_0x50d12c){return function(_0x561122){if(_0x561122){return _0x561122[_0x3a11('0x24')](_0x29e47a)['then'](function(_0x313171){return _0x313171;});}return null;};}function removeEntity(_0x495076,_0x57d115){return function(_0x3b4df5){if(_0x3b4df5){return _0x3b4df5['destroy']()['then'](function(){_0x495076[_0x3a11('0x19')](0xcc)[_0x3a11('0x1a')]();});}};}function handleEntityNotFound(_0x52fa4c,_0x168e45){return function(_0x10ca95){if(!_0x10ca95){_0x52fa4c['sendStatus'](0x194);}return _0x10ca95;};}function handleError(_0x68a73a,_0x3650eb){_0x3650eb=_0x3650eb||0x1f4;return function(_0x55d169){logger['error'](_0x55d169[_0x3a11('0x25')]);if(_0x55d169[_0x3a11('0x26')]){delete _0x55d169[_0x3a11('0x26')];}_0x68a73a[_0x3a11('0x19')](_0x3650eb)['send'](_0x55d169);};}exports['index']=function(_0xb6c574,_0x3fc9c2){var _0x2774eb={},_0x372215={},_0x292cf3={'count':0x0,'rows':[]};var _0x58df07=_[_0x3a11('0x27')](db[_0x3a11('0x28')][_0x3a11('0x29')],function(_0x3c5544){return{'name':_0x3c5544[_0x3a11('0x2a')],'type':_0x3c5544['type'][_0x3a11('0x2b')]};});_0x372215[_0x3a11('0x2c')]=_['map'](_0x58df07,_0x3a11('0x26'));_0x372215[_0x3a11('0x2d')]=_[_0x3a11('0x2e')](_0xb6c574['query']);_0x372215[_0x3a11('0x2f')]=_[_0x3a11('0x30')](_0x372215[_0x3a11('0x2c')],_0x372215[_0x3a11('0x2d')]);_0x2774eb[_0x3a11('0x31')]=_[_0x3a11('0x30')](_0x372215['model'],qs[_0x3a11('0x32')](_0xb6c574[_0x3a11('0x2d')][_0x3a11('0x32')]));_0x2774eb['attributes']=_0x2774eb[_0x3a11('0x31')][_0x3a11('0x33')]?_0x2774eb['attributes']:_0x372215[_0x3a11('0x2c')];if(!_0xb6c574['query']['hasOwnProperty'](_0x3a11('0x34'))){_0x2774eb['limit']=qs[_0x3a11('0x1d')](_0xb6c574[_0x3a11('0x2d')][_0x3a11('0x1d')]);_0x2774eb[_0x3a11('0x1f')]=qs[_0x3a11('0x1f')](_0xb6c574[_0x3a11('0x2d')][_0x3a11('0x1f')]);}_0x2774eb[_0x3a11('0x35')]=qs[_0x3a11('0x36')](_0xb6c574['query']['sort']);_0x2774eb[_0x3a11('0x37')]=qs[_0x3a11('0x2f')](_['pick'](_0xb6c574[_0x3a11('0x2d')],_0x372215[_0x3a11('0x2f')]),_0x58df07);if(_0xb6c574['query'][_0x3a11('0x38')]){_0x2774eb['where']=_['merge'](_0x2774eb[_0x3a11('0x37')],{'$or':_['map'](_0x58df07,function(_0xdebdea){if(_0xdebdea['type']!=='VIRTUAL'){var _0x7c48a0={};_0x7c48a0[_0xdebdea[_0x3a11('0x26')]]={'$like':'%'+_0xb6c574[_0x3a11('0x2d')][_0x3a11('0x38')]+'%'};return _0x7c48a0;}})});}_0x2774eb=_[_0x3a11('0x39')]({},_0x2774eb,_0xb6c574['options']);var _0x3904c8={'where':_0x2774eb[_0x3a11('0x37')]};return db[_0x3a11('0x28')][_0x3a11('0x1e')](_0x3904c8)[_0x3a11('0x3a')](function(_0x3ef83b){_0x292cf3[_0x3a11('0x1e')]=_0x3ef83b;if(_0xb6c574['query'][_0x3a11('0x3b')]){_0x2774eb[_0x3a11('0x3c')]=[{'all':!![]}];}return db[_0x3a11('0x28')][_0x3a11('0x3d')](_0x2774eb);})[_0x3a11('0x3a')](function(_0x870057){_0x292cf3['rows']=_0x870057;return _0x292cf3;})[_0x3a11('0x3a')](respondWithFilteredResult(_0x3fc9c2,_0x2774eb))[_0x3a11('0x3e')](handleError(_0x3fc9c2,null));};exports['show']=function(_0x471af8,_0x285e59){var _0xdeb814={'raw':![],'where':{'id':_0x471af8[_0x3a11('0x3f')]['id']}},_0x5f5293={};_0x5f5293[_0x3a11('0x2c')]=_[_0x3a11('0x2e')](db[_0x3a11('0x28')][_0x3a11('0x29')]);_0x5f5293[_0x3a11('0x2d')]=_[_0x3a11('0x2e')](_0x471af8[_0x3a11('0x2d')]);_0x5f5293[_0x3a11('0x2f')]=_['intersection'](_0x5f5293[_0x3a11('0x2c')],_0x5f5293['query']);_0xdeb814['attributes']=_['intersection'](_0x5f5293['model'],qs[_0x3a11('0x32')](_0x471af8[_0x3a11('0x2d')]['fields']));_0xdeb814[_0x3a11('0x31')]=_0xdeb814[_0x3a11('0x31')]['length']?_0xdeb814[_0x3a11('0x31')]:_0x5f5293[_0x3a11('0x2c')];if(_0x471af8[_0x3a11('0x2d')][_0x3a11('0x3b')]){_0xdeb814[_0x3a11('0x3c')]=[{'all':!![]}];}_0xdeb814=_['merge']({},_0xdeb814,_0x471af8[_0x3a11('0x40')]);return db[_0x3a11('0x28')][_0x3a11('0x41')](_0xdeb814)['then'](handleEntityNotFound(_0x285e59,null))[_0x3a11('0x3a')](respondWithResult(_0x285e59,null))[_0x3a11('0x3e')](handleError(_0x285e59,null));};exports[_0x3a11('0x42')]=function(_0x594780,_0x4a34fc){return db['FreshdeskConfiguration'][_0x3a11('0x42')](_0x594780['body'],{})[_0x3a11('0x3a')](respondWithResult(_0x4a34fc,0xc9))[_0x3a11('0x3e')](handleError(_0x4a34fc,null));};exports[_0x3a11('0x24')]=function(_0x59ea2b,_0x55f3f6){if(_0x59ea2b[_0x3a11('0x43')]['id']){delete _0x59ea2b[_0x3a11('0x43')]['id'];}return db['FreshdeskConfiguration'][_0x3a11('0x41')]({'where':{'id':_0x59ea2b[_0x3a11('0x3f')]['id']}})['then'](handleEntityNotFound(_0x55f3f6,null))[_0x3a11('0x3a')](saveUpdates(_0x59ea2b[_0x3a11('0x43')],null))['then'](respondWithResult(_0x55f3f6,null))[_0x3a11('0x3e')](handleError(_0x55f3f6,null));};exports[_0x3a11('0x44')]=function(_0x4174fc,_0x204a1f){return db[_0x3a11('0x28')]['find']({'where':{'id':_0x4174fc[_0x3a11('0x3f')]['id']}})[_0x3a11('0x3a')](handleEntityNotFound(_0x204a1f,null))[_0x3a11('0x3a')](removeEntity(_0x204a1f,null))[_0x3a11('0x3e')](handleError(_0x204a1f,null));};exports[_0x3a11('0x45')]=function(_0x3795a8,_0x14b66f,_0x365ab2){var _0xa35999={};var _0x55f0ce={};var _0x4d31c7;var _0x270b6d;return db[_0x3a11('0x28')]['findOne']({'where':{'id':_0x3795a8['params']['id']}})[_0x3a11('0x3a')](handleEntityNotFound(_0x14b66f,null))[_0x3a11('0x3a')](function(_0x4ef1b9){if(_0x4ef1b9){_0x4d31c7=_0x4ef1b9;_0x55f0ce[_0x3a11('0x2c')]=_[_0x3a11('0x2e')](db['FreshdeskField']['rawAttributes']);_0x55f0ce[_0x3a11('0x2d')]=_[_0x3a11('0x2e')](_0x3795a8[_0x3a11('0x2d')]);_0x55f0ce[_0x3a11('0x2f')]=_[_0x3a11('0x30')](_0x55f0ce[_0x3a11('0x2c')],_0x55f0ce['query']);_0xa35999[_0x3a11('0x31')]=_['intersection'](_0x55f0ce[_0x3a11('0x2c')],qs[_0x3a11('0x32')](_0x3795a8['query']['fields']));_0xa35999[_0x3a11('0x31')]=_0xa35999[_0x3a11('0x31')][_0x3a11('0x33')]?_0xa35999[_0x3a11('0x31')]:_0x55f0ce['model'];_0xa35999[_0x3a11('0x35')]=qs[_0x3a11('0x36')](_0x3795a8['query'][_0x3a11('0x36')]);_0xa35999[_0x3a11('0x37')]=qs[_0x3a11('0x2f')](_['pick'](_0x3795a8[_0x3a11('0x2d')],_0x55f0ce[_0x3a11('0x2f')]));if(_0x3795a8[_0x3a11('0x2d')][_0x3a11('0x38')]){_0xa35999[_0x3a11('0x37')]=_[_0x3a11('0x39')](_0xa35999['where'],{'$or':_[_0x3a11('0x27')](_0xa35999[_0x3a11('0x31')],function(_0x5b3ca4){var _0x1148c7={};_0x1148c7[_0x5b3ca4]={'$like':'%'+_0x3795a8[_0x3a11('0x2d')][_0x3a11('0x38')]+'%'};return _0x1148c7;})});}_0xa35999=_[_0x3a11('0x39')]({},_0xa35999,_0x3795a8[_0x3a11('0x40')]);return _0x4d31c7[_0x3a11('0x45')](_0xa35999);}})[_0x3a11('0x3a')](function(_0x50e4e1){if(_0x50e4e1){_0x270b6d=_0x50e4e1['length'];if(!_0x3795a8[_0x3a11('0x2d')][_0x3a11('0x46')](_0x3a11('0x34'))){_0xa35999[_0x3a11('0x1d')]=qs[_0x3a11('0x1d')](_0x3795a8[_0x3a11('0x2d')][_0x3a11('0x1d')]);_0xa35999[_0x3a11('0x1f')]=qs[_0x3a11('0x1f')](_0x3795a8[_0x3a11('0x2d')][_0x3a11('0x1f')]);}return _0x4d31c7[_0x3a11('0x45')](_0xa35999);}})[_0x3a11('0x3a')](function(_0x56bdff){if(_0x56bdff){return _0x56bdff?{'count':_0x270b6d,'rows':_0x56bdff}:null;}})[_0x3a11('0x3a')](respondWithResult(_0x14b66f,null))['catch'](handleError(_0x14b66f,null));};exports[_0x3a11('0x47')]=function(_0x542cee,_0x2d4f2b,_0x3fbade){var _0x599b56={};var _0x3c3e3d={};var _0x2b15ca;var _0x3e5ed6;return db[_0x3a11('0x28')][_0x3a11('0x48')]({'where':{'id':_0x542cee[_0x3a11('0x3f')]['id']}})[_0x3a11('0x3a')](handleEntityNotFound(_0x2d4f2b,null))[_0x3a11('0x3a')](function(_0x1eee3c){if(_0x1eee3c){_0x2b15ca=_0x1eee3c;_0x3c3e3d['model']=_[_0x3a11('0x2e')](db[_0x3a11('0x49')][_0x3a11('0x29')]);_0x3c3e3d['query']=_[_0x3a11('0x2e')](_0x542cee[_0x3a11('0x2d')]);_0x3c3e3d[_0x3a11('0x2f')]=_[_0x3a11('0x30')](_0x3c3e3d[_0x3a11('0x2c')],_0x3c3e3d[_0x3a11('0x2d')]);_0x599b56['attributes']=_[_0x3a11('0x30')](_0x3c3e3d[_0x3a11('0x2c')],qs['fields'](_0x542cee[_0x3a11('0x2d')]['fields']));_0x599b56['attributes']=_0x599b56[_0x3a11('0x31')][_0x3a11('0x33')]?_0x599b56[_0x3a11('0x31')]:_0x3c3e3d[_0x3a11('0x2c')];_0x599b56[_0x3a11('0x35')]=qs[_0x3a11('0x36')](_0x542cee['query'][_0x3a11('0x36')]);_0x599b56[_0x3a11('0x37')]=qs[_0x3a11('0x2f')](_[_0x3a11('0x4a')](_0x542cee['query'],_0x3c3e3d[_0x3a11('0x2f')]));if(_0x542cee[_0x3a11('0x2d')][_0x3a11('0x38')]){_0x599b56['where']=_[_0x3a11('0x39')](_0x599b56[_0x3a11('0x37')],{'$or':_[_0x3a11('0x27')](_0x599b56[_0x3a11('0x31')],function(_0x5f42be){var _0x4cd8e8={};_0x4cd8e8[_0x5f42be]={'$like':'%'+_0x542cee[_0x3a11('0x2d')][_0x3a11('0x38')]+'%'};return _0x4cd8e8;})});}_0x599b56=_['merge']({},_0x599b56,_0x542cee[_0x3a11('0x40')]);return _0x2b15ca[_0x3a11('0x47')](_0x599b56);}})[_0x3a11('0x3a')](function(_0x3f472b){if(_0x3f472b){_0x3e5ed6=_0x3f472b[_0x3a11('0x33')];if(!_0x542cee[_0x3a11('0x2d')][_0x3a11('0x46')](_0x3a11('0x34'))){_0x599b56[_0x3a11('0x1d')]=qs['limit'](_0x542cee[_0x3a11('0x2d')][_0x3a11('0x1d')]);_0x599b56['offset']=qs[_0x3a11('0x1f')](_0x542cee[_0x3a11('0x2d')][_0x3a11('0x1f')]);}return _0x2b15ca[_0x3a11('0x47')](_0x599b56);}})[_0x3a11('0x3a')](function(_0x16b544){if(_0x16b544){return _0x16b544?{'count':_0x3e5ed6,'rows':_0x16b544}:null;}})[_0x3a11('0x3a')](respondWithResult(_0x2d4f2b,null))[_0x3a11('0x3e')](handleError(_0x2d4f2b,null));};exports['getDescriptions']=function(_0x455a02,_0x40f9c8,_0x10c149){var _0x3727fc={};var _0x476002={};var _0x18a8d0;var _0x17ba90;return db[_0x3a11('0x28')][_0x3a11('0x48')]({'where':{'id':_0x455a02[_0x3a11('0x3f')]['id']}})['then'](handleEntityNotFound(_0x40f9c8,null))[_0x3a11('0x3a')](function(_0x466ff0){if(_0x466ff0){_0x18a8d0=_0x466ff0;_0x476002['model']=_[_0x3a11('0x2e')](db[_0x3a11('0x49')][_0x3a11('0x29')]);_0x476002[_0x3a11('0x2d')]=_['keys'](_0x455a02[_0x3a11('0x2d')]);_0x476002['filters']=_[_0x3a11('0x30')](_0x476002[_0x3a11('0x2c')],_0x476002[_0x3a11('0x2d')]);_0x3727fc[_0x3a11('0x31')]=_[_0x3a11('0x30')](_0x476002[_0x3a11('0x2c')],qs[_0x3a11('0x32')](_0x455a02['query']['fields']));_0x3727fc[_0x3a11('0x31')]=_0x3727fc[_0x3a11('0x31')][_0x3a11('0x33')]?_0x3727fc[_0x3a11('0x31')]:_0x476002[_0x3a11('0x2c')];_0x3727fc[_0x3a11('0x35')]=qs[_0x3a11('0x36')](_0x455a02[_0x3a11('0x2d')][_0x3a11('0x36')]);_0x3727fc[_0x3a11('0x37')]=qs['filters'](_[_0x3a11('0x4a')](_0x455a02['query'],_0x476002['filters']));if(_0x455a02['query'][_0x3a11('0x38')]){_0x3727fc[_0x3a11('0x37')]=_['merge'](_0x3727fc['where'],{'$or':_[_0x3a11('0x27')](_0x3727fc[_0x3a11('0x31')],function(_0x39ae04){var _0x572e5f={};_0x572e5f[_0x39ae04]={'$like':'%'+_0x455a02[_0x3a11('0x2d')][_0x3a11('0x38')]+'%'};return _0x572e5f;})});}_0x3727fc=_[_0x3a11('0x39')]({},_0x3727fc,_0x455a02[_0x3a11('0x40')]);return _0x18a8d0[_0x3a11('0x4b')](_0x3727fc);}})[_0x3a11('0x3a')](function(_0x171856){if(_0x171856){_0x17ba90=_0x171856['length'];if(!_0x455a02[_0x3a11('0x2d')][_0x3a11('0x46')](_0x3a11('0x34'))){_0x3727fc[_0x3a11('0x1d')]=qs[_0x3a11('0x1d')](_0x455a02[_0x3a11('0x2d')][_0x3a11('0x1d')]);_0x3727fc[_0x3a11('0x1f')]=qs[_0x3a11('0x1f')](_0x455a02[_0x3a11('0x2d')]['offset']);}return _0x18a8d0[_0x3a11('0x4b')](_0x3727fc);}})[_0x3a11('0x3a')](function(_0x5c4af1){if(_0x5c4af1){return _0x5c4af1?{'count':_0x17ba90,'rows':_0x5c4af1}:null;}})[_0x3a11('0x3a')](respondWithResult(_0x40f9c8,null))[_0x3a11('0x3e')](handleError(_0x40f9c8,null));};exports[_0x3a11('0x4c')]=function(_0x5bdbf2,_0x1a1592,_0x30f896){var _0x1b0371={};var _0x15a798={};var _0x1458dd;var _0x409ade;return db[_0x3a11('0x28')][_0x3a11('0x48')]({'where':{'id':_0x5bdbf2[_0x3a11('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1a1592,null))['then'](function(_0x152872){if(_0x152872){_0x1458dd=_0x152872;_0x15a798[_0x3a11('0x2c')]=_['keys'](db[_0x3a11('0x4d')][_0x3a11('0x29')]);_0x15a798['query']=_[_0x3a11('0x2e')](_0x5bdbf2[_0x3a11('0x2d')]);_0x15a798[_0x3a11('0x2f')]=_['intersection'](_0x15a798[_0x3a11('0x2c')],_0x15a798[_0x3a11('0x2d')]);_0x1b0371[_0x3a11('0x31')]=_[_0x3a11('0x30')](_0x15a798[_0x3a11('0x2c')],qs[_0x3a11('0x32')](_0x5bdbf2[_0x3a11('0x2d')]['fields']));_0x1b0371[_0x3a11('0x31')]=_0x1b0371[_0x3a11('0x31')][_0x3a11('0x33')]?_0x1b0371[_0x3a11('0x31')]:_0x15a798[_0x3a11('0x2c')];_0x1b0371[_0x3a11('0x35')]=qs[_0x3a11('0x36')](_0x5bdbf2['query'][_0x3a11('0x36')]);_0x1b0371[_0x3a11('0x37')]=qs[_0x3a11('0x2f')](_[_0x3a11('0x4a')](_0x5bdbf2['query'],_0x15a798[_0x3a11('0x2f')]));if(_0x5bdbf2['query'][_0x3a11('0x38')]){_0x1b0371['where']=_[_0x3a11('0x39')](_0x1b0371[_0x3a11('0x37')],{'$or':_[_0x3a11('0x27')](_0x1b0371[_0x3a11('0x31')],function(_0x3ab37d){var _0x373752={};_0x373752[_0x3ab37d]={'$like':'%'+_0x5bdbf2[_0x3a11('0x2d')][_0x3a11('0x38')]+'%'};return _0x373752;})});}_0x1b0371=_[_0x3a11('0x39')]({},_0x1b0371,_0x5bdbf2[_0x3a11('0x40')]);return _0x1458dd[_0x3a11('0x4c')](_0x1b0371);}})[_0x3a11('0x3a')](function(_0x5456d4){if(_0x5456d4){_0x409ade=_0x5456d4[_0x3a11('0x33')];if(!_0x5bdbf2[_0x3a11('0x2d')][_0x3a11('0x46')](_0x3a11('0x34'))){_0x1b0371[_0x3a11('0x1d')]=qs[_0x3a11('0x1d')](_0x5bdbf2[_0x3a11('0x2d')][_0x3a11('0x1d')]);_0x1b0371['offset']=qs[_0x3a11('0x1f')](_0x5bdbf2['query'][_0x3a11('0x1f')]);}return _0x1458dd[_0x3a11('0x4c')](_0x1b0371);}})['then'](function(_0x3b9569){if(_0x3b9569){return _0x3b9569?{'count':_0x409ade,'rows':_0x3b9569}:null;}})[_0x3a11('0x3a')](respondWithResult(_0x1a1592,null))[_0x3a11('0x3e')](handleError(_0x1a1592,null));};exports[_0x3a11('0x4e')]=function(_0x81940f,_0x41d746,_0x2902af){if(_0x81940f[_0x3a11('0x43')]['id']){delete _0x81940f['body']['id'];}return db[_0x3a11('0x28')][_0x3a11('0x48')]({'where':{'id':_0x81940f[_0x3a11('0x3f')]['id']}})[_0x3a11('0x3a')](handleEntityNotFound(_0x41d746,null))[_0x3a11('0x3a')](function(_0x11cc38){if(_0x11cc38){return _0x11cc38[_0x3a11('0x4e')](_0x81940f[_0x3a11('0x43')][_0x3a11('0x4f')]||[]);}return null;})['then'](respondWithResult(_0x41d746,null))[_0x3a11('0x3e')](handleError(_0x41d746,null));}; \ No newline at end of file +var _0xc2e4=['includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','pick','getSubjects','FreshdeskField','options','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','end','error','stack','name','send','FreshdeskConfiguration','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','filter'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc2e4,0xb4));var _0x4c2e=function(_0x3c28da,_0x5c230c){_0x3c28da=_0x3c28da-0x0;var _0x4476d1=_0xc2e4[_0x3c28da];return _0x4476d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c2e('0x0'));var zipdir=require(_0x4c2e('0x1'));var jsonpatch=require(_0x4c2e('0x2'));var rp=require(_0x4c2e('0x3'));var moment=require('moment');var BPromise=require(_0x4c2e('0x4'));var Mustache=require('mustache');var util=require(_0x4c2e('0x5'));var path=require(_0x4c2e('0x6'));var sox=require('sox');var csv=require(_0x4c2e('0x7'));var ejs=require(_0x4c2e('0x8'));var fs=require('fs');var fs_extra=require(_0x4c2e('0x9'));var _=require(_0x4c2e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4c2e('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4c2e('0xc'));var Papa=require(_0x4c2e('0xd'));var Redis=require('ioredis');var authService=require(_0x4c2e('0xe'));var qs=require(_0x4c2e('0xf'));var as=require(_0x4c2e('0x10'));var hardwareService=require(_0x4c2e('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x4c2e('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4c2e('0x13'))['db'];function respondWithStatusCode(_0x4e0dcf,_0x4d3072){_0x4d3072=_0x4d3072||0xcc;return function(_0x40bb46){if(_0x40bb46){return _0x4e0dcf[_0x4c2e('0x14')](_0x4d3072);}return _0x4e0dcf[_0x4c2e('0x15')](_0x4d3072)['end']();};}function respondWithResult(_0x485dd4,_0x4603bc){_0x4603bc=_0x4603bc||0xc8;return function(_0x47cf1f){if(_0x47cf1f){return _0x485dd4[_0x4c2e('0x15')](_0x4603bc)['json'](_0x47cf1f);}};}function respondWithFilteredResult(_0x1d6fc8,_0x286464){return function(_0x22d18e){if(_0x22d18e){var _0x39e245=typeof _0x286464[_0x4c2e('0x16')]==='undefined'&&typeof _0x286464[_0x4c2e('0x17')]===_0x4c2e('0x18');var _0x28215a=_0x22d18e[_0x4c2e('0x19')];var _0x355b23=_0x39e245?0x0:_0x286464[_0x4c2e('0x16')];var _0x3129d6=_0x39e245?_0x22d18e['count']:_0x286464[_0x4c2e('0x16')]+_0x286464[_0x4c2e('0x17')];var _0x189160;if(_0x3129d6>=_0x28215a){_0x3129d6=_0x28215a;_0x189160=0xc8;}else{_0x189160=0xce;}_0x1d6fc8[_0x4c2e('0x15')](_0x189160);return _0x1d6fc8[_0x4c2e('0x1a')](_0x4c2e('0x1b'),_0x355b23+'-'+_0x3129d6+'/'+_0x28215a)[_0x4c2e('0x1c')](_0x22d18e);}return null;};}function patchUpdates(_0x36e0f2){return function(_0x41683d){try{jsonpatch[_0x4c2e('0x1d')](_0x41683d,_0x36e0f2,!![]);}catch(_0x5438b3){return BPromise[_0x4c2e('0x1e')](_0x5438b3);}return _0x41683d['save']();};}function saveUpdates(_0x5b81ed,_0x31d8b7){return function(_0x251518){if(_0x251518){return _0x251518[_0x4c2e('0x1f')](_0x5b81ed)[_0x4c2e('0x20')](function(_0x48af7e){return _0x48af7e;});}return null;};}function removeEntity(_0x348896,_0xc822dc){return function(_0x18d37d){if(_0x18d37d){return _0x18d37d[_0x4c2e('0x21')]()[_0x4c2e('0x20')](function(){_0x348896[_0x4c2e('0x15')](0xcc)[_0x4c2e('0x22')]();});}};}function handleEntityNotFound(_0x5910d7,_0x43e765){return function(_0x149333){if(!_0x149333){_0x5910d7[_0x4c2e('0x14')](0x194);}return _0x149333;};}function handleError(_0x598953,_0x319199){_0x319199=_0x319199||0x1f4;return function(_0x2e6430){logger[_0x4c2e('0x23')](_0x2e6430[_0x4c2e('0x24')]);if(_0x2e6430[_0x4c2e('0x25')]){delete _0x2e6430['name'];}_0x598953[_0x4c2e('0x15')](_0x319199)[_0x4c2e('0x26')](_0x2e6430);};}exports['index']=function(_0x4e010f,_0x3a5ba0){var _0x122df7={},_0x55d09a={},_0x20e235={'count':0x0,'rows':[]};var _0x578dc4=_['map'](db[_0x4c2e('0x27')][_0x4c2e('0x28')],function(_0x73bfb9){return{'name':_0x73bfb9[_0x4c2e('0x29')],'type':_0x73bfb9[_0x4c2e('0x2a')]['key']};});_0x55d09a[_0x4c2e('0x2b')]=_[_0x4c2e('0x2c')](_0x578dc4,_0x4c2e('0x25'));_0x55d09a['query']=_[_0x4c2e('0x2d')](_0x4e010f[_0x4c2e('0x2e')]);_0x55d09a[_0x4c2e('0x2f')]=_[_0x4c2e('0x30')](_0x55d09a[_0x4c2e('0x2b')],_0x55d09a[_0x4c2e('0x2e')]);_0x122df7[_0x4c2e('0x31')]=_['intersection'](_0x55d09a[_0x4c2e('0x2b')],qs[_0x4c2e('0x32')](_0x4e010f[_0x4c2e('0x2e')][_0x4c2e('0x32')]));_0x122df7['attributes']=_0x122df7[_0x4c2e('0x31')][_0x4c2e('0x33')]?_0x122df7[_0x4c2e('0x31')]:_0x55d09a[_0x4c2e('0x2b')];if(!_0x4e010f['query'][_0x4c2e('0x34')](_0x4c2e('0x35'))){_0x122df7[_0x4c2e('0x17')]=qs['limit'](_0x4e010f[_0x4c2e('0x2e')][_0x4c2e('0x17')]);_0x122df7[_0x4c2e('0x16')]=qs[_0x4c2e('0x16')](_0x4e010f['query'][_0x4c2e('0x16')]);}_0x122df7[_0x4c2e('0x36')]=qs['sort'](_0x4e010f[_0x4c2e('0x2e')][_0x4c2e('0x37')]);_0x122df7['where']=qs['filters'](_['pick'](_0x4e010f[_0x4c2e('0x2e')],_0x55d09a[_0x4c2e('0x2f')]),_0x578dc4);if(_0x4e010f[_0x4c2e('0x2e')]['filter']){_0x122df7['where']=_[_0x4c2e('0x38')](_0x122df7[_0x4c2e('0x39')],{'$or':_[_0x4c2e('0x2c')](_0x578dc4,function(_0x3178ac){if(_0x3178ac[_0x4c2e('0x2a')]!==_0x4c2e('0x3a')){var _0x289d62={};_0x289d62[_0x3178ac[_0x4c2e('0x25')]]={'$like':'%'+_0x4e010f[_0x4c2e('0x2e')][_0x4c2e('0x3b')]+'%'};return _0x289d62;}})});}_0x122df7=_[_0x4c2e('0x38')]({},_0x122df7,_0x4e010f['options']);var _0x63b9e0={'where':_0x122df7[_0x4c2e('0x39')]};return db[_0x4c2e('0x27')][_0x4c2e('0x19')](_0x63b9e0)[_0x4c2e('0x20')](function(_0x22055d){_0x20e235[_0x4c2e('0x19')]=_0x22055d;if(_0x4e010f[_0x4c2e('0x2e')][_0x4c2e('0x3c')]){_0x122df7[_0x4c2e('0x3d')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x4c2e('0x3e')](_0x122df7);})[_0x4c2e('0x20')](function(_0x55b7d0){_0x20e235[_0x4c2e('0x3f')]=_0x55b7d0;return _0x20e235;})[_0x4c2e('0x20')](respondWithFilteredResult(_0x3a5ba0,_0x122df7))[_0x4c2e('0x40')](handleError(_0x3a5ba0,null));};exports[_0x4c2e('0x41')]=function(_0x190255,_0x4f4510){var _0x2686b0={'raw':![],'where':{'id':_0x190255[_0x4c2e('0x42')]['id']}},_0x36adde={};_0x36adde['model']=_[_0x4c2e('0x2d')](db['FreshdeskConfiguration'][_0x4c2e('0x28')]);_0x36adde[_0x4c2e('0x2e')]=_[_0x4c2e('0x2d')](_0x190255['query']);_0x36adde[_0x4c2e('0x2f')]=_[_0x4c2e('0x30')](_0x36adde[_0x4c2e('0x2b')],_0x36adde[_0x4c2e('0x2e')]);_0x2686b0[_0x4c2e('0x31')]=_['intersection'](_0x36adde[_0x4c2e('0x2b')],qs['fields'](_0x190255[_0x4c2e('0x2e')][_0x4c2e('0x32')]));_0x2686b0[_0x4c2e('0x31')]=_0x2686b0[_0x4c2e('0x31')][_0x4c2e('0x33')]?_0x2686b0[_0x4c2e('0x31')]:_0x36adde['model'];if(_0x190255['query'][_0x4c2e('0x3c')]){_0x2686b0[_0x4c2e('0x3d')]=[{'all':!![]}];}_0x2686b0=_[_0x4c2e('0x38')]({},_0x2686b0,_0x190255['options']);return db[_0x4c2e('0x27')][_0x4c2e('0x43')](_0x2686b0)[_0x4c2e('0x20')](handleEntityNotFound(_0x4f4510,null))['then'](respondWithResult(_0x4f4510,null))[_0x4c2e('0x40')](handleError(_0x4f4510,null));};exports[_0x4c2e('0x44')]=function(_0x230a93,_0x17b724){return db[_0x4c2e('0x27')]['create'](_0x230a93[_0x4c2e('0x45')],{})['then'](respondWithResult(_0x17b724,0xc9))[_0x4c2e('0x40')](handleError(_0x17b724,null));};exports['update']=function(_0x3c97d4,_0x1bde74){if(_0x3c97d4[_0x4c2e('0x45')]['id']){delete _0x3c97d4[_0x4c2e('0x45')]['id'];}return db[_0x4c2e('0x27')]['find']({'where':{'id':_0x3c97d4[_0x4c2e('0x42')]['id']}})['then'](handleEntityNotFound(_0x1bde74,null))[_0x4c2e('0x20')](saveUpdates(_0x3c97d4[_0x4c2e('0x45')],null))[_0x4c2e('0x20')](respondWithResult(_0x1bde74,null))[_0x4c2e('0x40')](handleError(_0x1bde74,null));};exports['destroy']=function(_0x592d1b,_0x4d8019){return db['FreshdeskConfiguration'][_0x4c2e('0x43')]({'where':{'id':_0x592d1b[_0x4c2e('0x42')]['id']}})['then'](handleEntityNotFound(_0x4d8019,null))[_0x4c2e('0x20')](removeEntity(_0x4d8019,null))[_0x4c2e('0x40')](handleError(_0x4d8019,null));};exports[_0x4c2e('0x46')]=function(_0xc5c3d9,_0x153400,_0x5ed1e4){var _0x43da68={};var _0x11fcfc={};var _0x3ee2e5;var _0x70430a;return db[_0x4c2e('0x27')][_0x4c2e('0x47')]({'where':{'id':_0xc5c3d9[_0x4c2e('0x42')]['id']}})[_0x4c2e('0x20')](handleEntityNotFound(_0x153400,null))['then'](function(_0x484982){if(_0x484982){_0x3ee2e5=_0x484982;_0x11fcfc[_0x4c2e('0x2b')]=_[_0x4c2e('0x2d')](db['FreshdeskField'][_0x4c2e('0x28')]);_0x11fcfc['query']=_[_0x4c2e('0x2d')](_0xc5c3d9[_0x4c2e('0x2e')]);_0x11fcfc['filters']=_['intersection'](_0x11fcfc['model'],_0x11fcfc[_0x4c2e('0x2e')]);_0x43da68[_0x4c2e('0x31')]=_[_0x4c2e('0x30')](_0x11fcfc[_0x4c2e('0x2b')],qs['fields'](_0xc5c3d9[_0x4c2e('0x2e')]['fields']));_0x43da68['attributes']=_0x43da68[_0x4c2e('0x31')][_0x4c2e('0x33')]?_0x43da68[_0x4c2e('0x31')]:_0x11fcfc['model'];_0x43da68['order']=qs[_0x4c2e('0x37')](_0xc5c3d9[_0x4c2e('0x2e')][_0x4c2e('0x37')]);_0x43da68[_0x4c2e('0x39')]=qs['filters'](_[_0x4c2e('0x48')](_0xc5c3d9[_0x4c2e('0x2e')],_0x11fcfc[_0x4c2e('0x2f')]));if(_0xc5c3d9[_0x4c2e('0x2e')][_0x4c2e('0x3b')]){_0x43da68[_0x4c2e('0x39')]=_[_0x4c2e('0x38')](_0x43da68['where'],{'$or':_['map'](_0x43da68[_0x4c2e('0x31')],function(_0x46e972){var _0xfd37d8={};_0xfd37d8[_0x46e972]={'$like':'%'+_0xc5c3d9[_0x4c2e('0x2e')][_0x4c2e('0x3b')]+'%'};return _0xfd37d8;})});}_0x43da68=_[_0x4c2e('0x38')]({},_0x43da68,_0xc5c3d9['options']);return _0x3ee2e5[_0x4c2e('0x46')](_0x43da68);}})[_0x4c2e('0x20')](function(_0x3d044e){if(_0x3d044e){_0x70430a=_0x3d044e['length'];if(!_0xc5c3d9[_0x4c2e('0x2e')]['hasOwnProperty'](_0x4c2e('0x35'))){_0x43da68[_0x4c2e('0x17')]=qs[_0x4c2e('0x17')](_0xc5c3d9[_0x4c2e('0x2e')][_0x4c2e('0x17')]);_0x43da68[_0x4c2e('0x16')]=qs[_0x4c2e('0x16')](_0xc5c3d9[_0x4c2e('0x2e')]['offset']);}return _0x3ee2e5[_0x4c2e('0x46')](_0x43da68);}})['then'](function(_0x442379){if(_0x442379){return _0x442379?{'count':_0x70430a,'rows':_0x442379}:null;}})[_0x4c2e('0x20')](respondWithResult(_0x153400,null))[_0x4c2e('0x40')](handleError(_0x153400,null));};exports[_0x4c2e('0x49')]=function(_0x17e314,_0x57c628,_0xf7d893){var _0x4447a2={};var _0x2155f8={};var _0x4294ce;var _0x67d16c;return db['FreshdeskConfiguration'][_0x4c2e('0x47')]({'where':{'id':_0x17e314[_0x4c2e('0x42')]['id']}})[_0x4c2e('0x20')](handleEntityNotFound(_0x57c628,null))[_0x4c2e('0x20')](function(_0x38c4c7){if(_0x38c4c7){_0x4294ce=_0x38c4c7;_0x2155f8['model']=_[_0x4c2e('0x2d')](db[_0x4c2e('0x4a')][_0x4c2e('0x28')]);_0x2155f8[_0x4c2e('0x2e')]=_[_0x4c2e('0x2d')](_0x17e314[_0x4c2e('0x2e')]);_0x2155f8['filters']=_['intersection'](_0x2155f8[_0x4c2e('0x2b')],_0x2155f8['query']);_0x4447a2['attributes']=_['intersection'](_0x2155f8[_0x4c2e('0x2b')],qs[_0x4c2e('0x32')](_0x17e314[_0x4c2e('0x2e')]['fields']));_0x4447a2[_0x4c2e('0x31')]=_0x4447a2[_0x4c2e('0x31')][_0x4c2e('0x33')]?_0x4447a2[_0x4c2e('0x31')]:_0x2155f8[_0x4c2e('0x2b')];_0x4447a2[_0x4c2e('0x36')]=qs[_0x4c2e('0x37')](_0x17e314['query'][_0x4c2e('0x37')]);_0x4447a2[_0x4c2e('0x39')]=qs[_0x4c2e('0x2f')](_['pick'](_0x17e314[_0x4c2e('0x2e')],_0x2155f8['filters']));if(_0x17e314[_0x4c2e('0x2e')][_0x4c2e('0x3b')]){_0x4447a2['where']=_[_0x4c2e('0x38')](_0x4447a2[_0x4c2e('0x39')],{'$or':_['map'](_0x4447a2[_0x4c2e('0x31')],function(_0x33b296){var _0x43c721={};_0x43c721[_0x33b296]={'$like':'%'+_0x17e314['query'][_0x4c2e('0x3b')]+'%'};return _0x43c721;})});}_0x4447a2=_[_0x4c2e('0x38')]({},_0x4447a2,_0x17e314[_0x4c2e('0x4b')]);return _0x4294ce[_0x4c2e('0x49')](_0x4447a2);}})[_0x4c2e('0x20')](function(_0x4fee40){if(_0x4fee40){_0x67d16c=_0x4fee40[_0x4c2e('0x33')];if(!_0x17e314[_0x4c2e('0x2e')][_0x4c2e('0x34')](_0x4c2e('0x35'))){_0x4447a2[_0x4c2e('0x17')]=qs[_0x4c2e('0x17')](_0x17e314['query'][_0x4c2e('0x17')]);_0x4447a2['offset']=qs[_0x4c2e('0x16')](_0x17e314[_0x4c2e('0x2e')][_0x4c2e('0x16')]);}return _0x4294ce['getSubjects'](_0x4447a2);}})[_0x4c2e('0x20')](function(_0x232efc){if(_0x232efc){return _0x232efc?{'count':_0x67d16c,'rows':_0x232efc}:null;}})['then'](respondWithResult(_0x57c628,null))['catch'](handleError(_0x57c628,null));};exports[_0x4c2e('0x4c')]=function(_0x19f4e9,_0x474164,_0x2ccc58){var _0x324798={};var _0x413e4d={};var _0x20fb52;var _0x519287;return db[_0x4c2e('0x27')][_0x4c2e('0x47')]({'where':{'id':_0x19f4e9[_0x4c2e('0x42')]['id']}})[_0x4c2e('0x20')](handleEntityNotFound(_0x474164,null))[_0x4c2e('0x20')](function(_0x3841ec){if(_0x3841ec){_0x20fb52=_0x3841ec;_0x413e4d[_0x4c2e('0x2b')]=_['keys'](db[_0x4c2e('0x4a')][_0x4c2e('0x28')]);_0x413e4d['query']=_['keys'](_0x19f4e9[_0x4c2e('0x2e')]);_0x413e4d['filters']=_[_0x4c2e('0x30')](_0x413e4d[_0x4c2e('0x2b')],_0x413e4d[_0x4c2e('0x2e')]);_0x324798[_0x4c2e('0x31')]=_[_0x4c2e('0x30')](_0x413e4d['model'],qs['fields'](_0x19f4e9[_0x4c2e('0x2e')]['fields']));_0x324798[_0x4c2e('0x31')]=_0x324798[_0x4c2e('0x31')][_0x4c2e('0x33')]?_0x324798['attributes']:_0x413e4d[_0x4c2e('0x2b')];_0x324798[_0x4c2e('0x36')]=qs[_0x4c2e('0x37')](_0x19f4e9[_0x4c2e('0x2e')]['sort']);_0x324798[_0x4c2e('0x39')]=qs[_0x4c2e('0x2f')](_[_0x4c2e('0x48')](_0x19f4e9[_0x4c2e('0x2e')],_0x413e4d[_0x4c2e('0x2f')]));if(_0x19f4e9[_0x4c2e('0x2e')][_0x4c2e('0x3b')]){_0x324798[_0x4c2e('0x39')]=_[_0x4c2e('0x38')](_0x324798[_0x4c2e('0x39')],{'$or':_[_0x4c2e('0x2c')](_0x324798[_0x4c2e('0x31')],function(_0x24fd41){var _0x2e432e={};_0x2e432e[_0x24fd41]={'$like':'%'+_0x19f4e9[_0x4c2e('0x2e')][_0x4c2e('0x3b')]+'%'};return _0x2e432e;})});}_0x324798=_[_0x4c2e('0x38')]({},_0x324798,_0x19f4e9[_0x4c2e('0x4b')]);return _0x20fb52[_0x4c2e('0x4c')](_0x324798);}})[_0x4c2e('0x20')](function(_0x4c0cb9){if(_0x4c0cb9){_0x519287=_0x4c0cb9[_0x4c2e('0x33')];if(!_0x19f4e9[_0x4c2e('0x2e')][_0x4c2e('0x34')](_0x4c2e('0x35'))){_0x324798[_0x4c2e('0x17')]=qs[_0x4c2e('0x17')](_0x19f4e9[_0x4c2e('0x2e')][_0x4c2e('0x17')]);_0x324798['offset']=qs[_0x4c2e('0x16')](_0x19f4e9['query'][_0x4c2e('0x16')]);}return _0x20fb52['getDescriptions'](_0x324798);}})[_0x4c2e('0x20')](function(_0x54f249){if(_0x54f249){return _0x54f249?{'count':_0x519287,'rows':_0x54f249}:null;}})[_0x4c2e('0x20')](respondWithResult(_0x474164,null))[_0x4c2e('0x40')](handleError(_0x474164,null));};exports[_0x4c2e('0x4d')]=function(_0x33ed26,_0x7d48b0,_0xa00d46){var _0xcec3ba={};var _0x52718d={};var _0x52fd31;var _0x288f25;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x33ed26[_0x4c2e('0x42')]['id']}})[_0x4c2e('0x20')](handleEntityNotFound(_0x7d48b0,null))[_0x4c2e('0x20')](function(_0x96524e){if(_0x96524e){_0x52fd31=_0x96524e;_0x52718d[_0x4c2e('0x2b')]=_[_0x4c2e('0x2d')](db['Tag'][_0x4c2e('0x28')]);_0x52718d[_0x4c2e('0x2e')]=_[_0x4c2e('0x2d')](_0x33ed26[_0x4c2e('0x2e')]);_0x52718d[_0x4c2e('0x2f')]=_[_0x4c2e('0x30')](_0x52718d[_0x4c2e('0x2b')],_0x52718d[_0x4c2e('0x2e')]);_0xcec3ba[_0x4c2e('0x31')]=_[_0x4c2e('0x30')](_0x52718d[_0x4c2e('0x2b')],qs[_0x4c2e('0x32')](_0x33ed26[_0x4c2e('0x2e')][_0x4c2e('0x32')]));_0xcec3ba['attributes']=_0xcec3ba[_0x4c2e('0x31')][_0x4c2e('0x33')]?_0xcec3ba[_0x4c2e('0x31')]:_0x52718d[_0x4c2e('0x2b')];_0xcec3ba[_0x4c2e('0x36')]=qs[_0x4c2e('0x37')](_0x33ed26['query'][_0x4c2e('0x37')]);_0xcec3ba['where']=qs[_0x4c2e('0x2f')](_[_0x4c2e('0x48')](_0x33ed26['query'],_0x52718d[_0x4c2e('0x2f')]));if(_0x33ed26[_0x4c2e('0x2e')][_0x4c2e('0x3b')]){_0xcec3ba[_0x4c2e('0x39')]=_[_0x4c2e('0x38')](_0xcec3ba[_0x4c2e('0x39')],{'$or':_[_0x4c2e('0x2c')](_0xcec3ba[_0x4c2e('0x31')],function(_0x530a9d){var _0x3e1058={};_0x3e1058[_0x530a9d]={'$like':'%'+_0x33ed26[_0x4c2e('0x2e')][_0x4c2e('0x3b')]+'%'};return _0x3e1058;})});}_0xcec3ba=_[_0x4c2e('0x38')]({},_0xcec3ba,_0x33ed26['options']);return _0x52fd31[_0x4c2e('0x4d')](_0xcec3ba);}})['then'](function(_0x51e490){if(_0x51e490){_0x288f25=_0x51e490['length'];if(!_0x33ed26['query']['hasOwnProperty'](_0x4c2e('0x35'))){_0xcec3ba['limit']=qs['limit'](_0x33ed26['query']['limit']);_0xcec3ba[_0x4c2e('0x16')]=qs['offset'](_0x33ed26[_0x4c2e('0x2e')][_0x4c2e('0x16')]);}return _0x52fd31[_0x4c2e('0x4d')](_0xcec3ba);}})['then'](function(_0xbb74b0){if(_0xbb74b0){return _0xbb74b0?{'count':_0x288f25,'rows':_0xbb74b0}:null;}})[_0x4c2e('0x20')](respondWithResult(_0x7d48b0,null))[_0x4c2e('0x40')](handleError(_0x7d48b0,null));};exports['setTags']=function(_0x214f6a,_0x40f711,_0x36abd1){if(_0x214f6a['body']['id']){delete _0x214f6a['body']['id'];}return db[_0x4c2e('0x27')]['findOne']({'where':{'id':_0x214f6a[_0x4c2e('0x42')]['id']}})[_0x4c2e('0x20')](handleEntityNotFound(_0x40f711,null))[_0x4c2e('0x20')](function(_0x4818c1){if(_0x4818c1){return _0x4818c1[_0x4c2e('0x4e')](_0x214f6a[_0x4c2e('0x45')][_0x4c2e('0x4f')]||[]);}return null;})[_0x4c2e('0x20')](respondWithResult(_0x40f711,null))['catch'](handleError(_0x40f711,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index afaf0bb..c7c49cd 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 _0x1a04=['moment','bluebird','path','rimraf','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','api'];(function(_0x2f2cc3,_0x998148){var _0x23f0d0=function(_0xd5bfb1){while(--_0xd5bfb1){_0x2f2cc3['push'](_0x2f2cc3['shift']());}};_0x23f0d0(++_0x998148);}(_0x1a04,0xa0));var _0x41a0=function(_0x5e7ec1,_0x1ede2e){_0x5e7ec1=_0x5e7ec1-0x0;var _0x4c4a4c=_0x1a04[_0x5e7ec1];return _0x4c4a4c;};'use strict';var _=require(_0x41a0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x41a0('0x1'));var moment=require(_0x41a0('0x2'));var BPromise=require(_0x41a0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x41a0('0x4'));var rimraf=require(_0x41a0('0x5'));var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x167a94,_0x54ec53){return _0x167a94[_0x41a0('0x6')](_0x41a0('0x7'),attributes,{'tableName':_0x41a0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d6d=['../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','moment','bluebird'];(function(_0xca6d0,_0x121ffe){var _0x45febb=function(_0x41f815){while(--_0x41f815){_0xca6d0['push'](_0xca6d0['shift']());}};_0x45febb(++_0x121ffe);}(_0x2d6d,0x196));var _0xd2d6=function(_0x153e7d,_0x10a35f){_0x153e7d=_0x153e7d-0x0;var _0x3c22dd=_0x2d6d[_0x153e7d];return _0x3c22dd;};'use strict';var _=require(_0xd2d6('0x0'));var util=require('util');var logger=require(_0xd2d6('0x1'))('api');var moment=require(_0xd2d6('0x2'));var BPromise=require(_0xd2d6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd2d6('0x4'));var attributes=require(_0xd2d6('0x5'));module[_0xd2d6('0x6')]=function(_0xe4ab23,_0x3e402e){return _0xe4ab23[_0xd2d6('0x7')](_0xd2d6('0x8'),attributes,{'tableName':_0xd2d6('0x9'),'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 b2a0f94..cfede25 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 _0x0911=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring'];(function(_0x5d2a31,_0x4920fb){var _0x577a7e=function(_0x164c39){while(--_0x164c39){_0x5d2a31['push'](_0x5d2a31['shift']());}};_0x577a7e(++_0x4920fb);}(_0x0911,0x1e0));var _0x1091=function(_0x5c6ceb,_0x4ed099){_0x5c6ceb=_0x5c6ceb-0x0;var _0x28821b=_0x0911[_0x5c6ceb];return _0x28821b;};'use strict';var _=require(_0x1091('0x0'));var util=require('util');var moment=require(_0x1091('0x1'));var BPromise=require('bluebird');var rs=require(_0x1091('0x2'));var fs=require('fs');var Redis=require(_0x1091('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1091('0x4'))(_0x1091('0x5'));var config=require(_0x1091('0x6'));var jayson=require(_0x1091('0x7'));var client=jayson[_0x1091('0x8')][_0x1091('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a0315,_0x1f08b3,_0x2d6326){return new BPromise(function(_0xaf813,_0x2818c7){return client[_0x1091('0xa')](_0x3a0315,_0x2d6326)[_0x1091('0xb')](function(_0x200460){logger[_0x1091('0xc')](_0x1091('0xd'),_0x1f08b3,_0x1091('0xe'));logger[_0x1091('0xf')](_0x1091('0x10'),_0x1f08b3,'request\x20sent',JSON[_0x1091('0x11')](_0x200460));if(_0x200460[_0x1091('0x12')]){if(_0x200460[_0x1091('0x12')][_0x1091('0x13')]===0x1f4){logger[_0x1091('0x12')](_0x1091('0xd'),_0x1f08b3,_0x200460[_0x1091('0x12')]['message']);return _0x2818c7(_0x200460[_0x1091('0x12')][_0x1091('0x14')]);}logger[_0x1091('0x12')](_0x1091('0xd'),_0x1f08b3,_0x200460['error'][_0x1091('0x14')]);return _0xaf813(_0x200460[_0x1091('0x12')][_0x1091('0x14')]);}else{logger['info'](_0x1091('0xd'),_0x1f08b3,'request\x20sent');_0xaf813(_0x200460[_0x1091('0x15')]['message']);}})[_0x1091('0x16')](function(_0x3da567){logger[_0x1091('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1f08b3,_0x3da567);_0x2818c7(_0x3da567);});});} \ No newline at end of file +var _0xc7b8=['client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3ea4b1,_0x1c59b4){var _0x4fec31=function(_0x55fc7c){while(--_0x55fc7c){_0x3ea4b1['push'](_0x3ea4b1['shift']());}};_0x4fec31(++_0x1c59b4);}(_0xc7b8,0x86));var _0x8c7b=function(_0x59aecb,_0x1915ee){_0x59aecb=_0x59aecb-0x0;var _0x4eafe1=_0xc7b8[_0x59aecb];return _0x4eafe1;};'use strict';var _=require(_0x8c7b('0x0'));var util=require(_0x8c7b('0x1'));var moment=require(_0x8c7b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c7b('0x3'))['db'];var utils=require(_0x8c7b('0x4'));var logger=require(_0x8c7b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8c7b('0x6')][_0x8c7b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x245461,_0xd0ef18,_0x3bc7f5){return new BPromise(function(_0x598568,_0xd6fb43){return client[_0x8c7b('0x8')](_0x245461,_0x3bc7f5)[_0x8c7b('0x9')](function(_0x50205b){logger[_0x8c7b('0xa')](_0x8c7b('0xb'),_0xd0ef18,_0x8c7b('0xc'));logger[_0x8c7b('0xd')](_0x8c7b('0xe'),_0xd0ef18,'request\x20sent',JSON[_0x8c7b('0xf')](_0x50205b));if(_0x50205b[_0x8c7b('0x10')]){if(_0x50205b[_0x8c7b('0x10')]['code']===0x1f4){logger[_0x8c7b('0x10')](_0x8c7b('0xb'),_0xd0ef18,_0x50205b[_0x8c7b('0x10')][_0x8c7b('0x11')]);return _0xd6fb43(_0x50205b[_0x8c7b('0x10')][_0x8c7b('0x11')]);}logger['error'](_0x8c7b('0xb'),_0xd0ef18,_0x50205b[_0x8c7b('0x10')][_0x8c7b('0x11')]);return _0x598568(_0x50205b['error']['message']);}else{logger[_0x8c7b('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xd0ef18,_0x8c7b('0xc'));_0x598568(_0x50205b[_0x8c7b('0x12')][_0x8c7b('0x11')]);}})[_0x8c7b('0x13')](function(_0x527d75){logger[_0x8c7b('0x10')](_0x8c7b('0xb'),_0xd0ef18,_0x527d75);_0xd6fb43(_0x527d75);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 93fa551..726e459 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 _0x7234=['exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','show','isAuthenticated','create','/:id','update','delete','destroy'];(function(_0x4a1e13,_0x1ffe10){var _0x386490=function(_0x5cb106){while(--_0x5cb106){_0x4a1e13['push'](_0x4a1e13['shift']());}};_0x386490(++_0x1ffe10);}(_0x7234,0x101));var _0x4723=function(_0x29cab7,_0x51a00e){_0x29cab7=_0x29cab7-0x0;var _0x6d17fa=_0x7234[_0x29cab7];return _0x6d17fa;};'use strict';var multer=require(_0x4723('0x0'));var util=require(_0x4723('0x1'));var path=require('path');var timeout=require(_0x4723('0x2'));var express=require(_0x4723('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4723('0x4'));var interaction=require(_0x4723('0x5'));var config=require('../../config/environment');var controller=require(_0x4723('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4723('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4723('0x8')]);router['post']('/',auth[_0x4723('0x9')](),controller[_0x4723('0xa')]);router['put'](_0x4723('0xb'),auth[_0x4723('0x9')](),controller[_0x4723('0xc')]);router[_0x4723('0xd')](_0x4723('0xb'),auth[_0x4723('0x9')](),controller[_0x4723('0xe')]);module[_0x4723('0xf')]=router; \ No newline at end of file +var _0x0777=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util'];(function(_0x4408d4,_0x1be819){var _0x3f8a12=function(_0xdb569d){while(--_0xdb569d){_0x4408d4['push'](_0x4408d4['shift']());}};_0x3f8a12(++_0x1be819);}(_0x0777,0x17b));var _0x7077=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x0777[_0x487b0c];return _0x1adbdc;};'use strict';var multer=require('multer');var util=require(_0x7077('0x0'));var path=require(_0x7077('0x1'));var timeout=require(_0x7077('0x2'));var express=require(_0x7077('0x3'));var router=express['Router']();var fs_extra=require(_0x7077('0x4'));var auth=require(_0x7077('0x5'));var interaction=require(_0x7077('0x6'));var config=require(_0x7077('0x7'));var controller=require(_0x7077('0x8'));router[_0x7077('0x9')]('/',auth[_0x7077('0xa')](),controller[_0x7077('0xb')]);router[_0x7077('0x9')](_0x7077('0xc'),auth['isAuthenticated'](),controller[_0x7077('0xd')]);router[_0x7077('0xe')]('/',auth[_0x7077('0xa')](),controller[_0x7077('0xf')]);router[_0x7077('0x10')]('/:id',auth[_0x7077('0xa')](),controller['update']);router[_0x7077('0x11')](_0x7077('0xc'),auth[_0x7077('0xa')](),controller[_0x7077('0x12')]);module[_0x7077('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index e354974..6ef8fd4 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 _0x9e54=['STRING','string','variable','customVariable','BOOLEAN','ENUM','keyValue'];(function(_0x417620,_0x445ac4){var _0x57d373=function(_0x575994){while(--_0x575994){_0x417620['push'](_0x417620['shift']());}};_0x57d373(++_0x445ac4);}(_0x9e54,0x1b0));var _0x49e5=function(_0x3afff9,_0x14683c){_0x3afff9=_0x3afff9-0x0;var _0x418145=_0x9e54[_0x3afff9];return _0x418145;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x49e5('0x0')]('string','variable','customVariable',_0x49e5('0x1'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x49e5('0x2')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x49e5('0x3'),_0x49e5('0x4'),_0x49e5('0x5'))},'keyContent':{'type':Sequelize[_0x49e5('0x2')]},'idField':{'type':Sequelize[_0x49e5('0x2')]},'nameField':{'type':Sequelize[_0x49e5('0x2')]},'customField':{'type':Sequelize[_0x49e5('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x49e5('0x2')]}}; \ No newline at end of file +var _0x4d71=['customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x4d71,0x1f4));var _0x14d7=function(_0x1a9f2b,_0x34dda6){_0x1a9f2b=_0x1a9f2b-0x0;var _0xa39a95=_0x4d71[_0x1a9f2b];return _0xa39a95;};'use strict';var Sequelize=require('sequelize');module[_0x14d7('0x0')]={'type':{'type':Sequelize[_0x14d7('0x1')](_0x14d7('0x2'),_0x14d7('0x3'),_0x14d7('0x4'),_0x14d7('0x5'),_0x14d7('0x6')),'defaultValue':_0x14d7('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x14d7('0x7')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x14d7('0x4'))},'keyContent':{'type':Sequelize[_0x14d7('0x7')]},'idField':{'type':Sequelize[_0x14d7('0x7')]},'nameField':{'type':Sequelize[_0x14d7('0x7')]},'customField':{'type':Sequelize[_0x14d7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x14d7('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 26415c7..000cf86 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 _0x9c44=['options','then','includeAll','include','findAll','rows','catch','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x2aff43,_0x4d9c3b){var _0x284923=function(_0x5a8387){while(--_0x5a8387){_0x2aff43['push'](_0x2aff43['shift']());}};_0x284923(++_0x4d9c3b);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['FreshdeskField'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['FreshdeskField'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));}; \ No newline at end of file +var _0x9348=['undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','FreshdeskField','count','include','findAll','show','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit'];(function(_0x356f4e,_0x10c867){var _0x482323=function(_0x12e9f0){while(--_0x12e9f0){_0x356f4e['push'](_0x356f4e['shift']());}};_0x482323(++_0x10c867);}(_0x9348,0x10d));var _0x8934=function(_0xa12849,_0x4c938d){_0xa12849=_0xa12849-0x0;var _0x58c237=_0x9348[_0xa12849];return _0x58c237;};'use strict';var emlformat=require(_0x8934('0x0'));var rimraf=require(_0x8934('0x1'));var zipdir=require(_0x8934('0x2'));var jsonpatch=require(_0x8934('0x3'));var rp=require(_0x8934('0x4'));var moment=require('moment');var BPromise=require(_0x8934('0x5'));var Mustache=require(_0x8934('0x6'));var util=require('util');var path=require(_0x8934('0x7'));var sox=require(_0x8934('0x8'));var csv=require(_0x8934('0x9'));var ejs=require(_0x8934('0xa'));var fs=require('fs');var fs_extra=require(_0x8934('0xb'));var _=require(_0x8934('0xc'));var squel=require('squel');var crypto=require(_0x8934('0xd'));var jsforce=require(_0x8934('0xe'));var deskjs=require(_0x8934('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8934('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8934('0x11'));var hardwareService=require(_0x8934('0x12'));var logger=require(_0x8934('0x13'))(_0x8934('0x14'));var utils=require(_0x8934('0x15'));var config=require(_0x8934('0x16'));var licenseUtil=require(_0x8934('0x17'));var db=require(_0x8934('0x18'))['db'];function respondWithStatusCode(_0x4a999c,_0x68427d){_0x68427d=_0x68427d||0xcc;return function(_0x108eab){if(_0x108eab){return _0x4a999c[_0x8934('0x19')](_0x68427d);}return _0x4a999c[_0x8934('0x1a')](_0x68427d)[_0x8934('0x1b')]();};}function respondWithResult(_0xdf59f4,_0x5b560f){_0x5b560f=_0x5b560f||0xc8;return function(_0x254720){if(_0x254720){return _0xdf59f4[_0x8934('0x1a')](_0x5b560f)[_0x8934('0x1c')](_0x254720);}};}function respondWithFilteredResult(_0x94b948,_0x34d4dc){return function(_0x41e6a9){if(_0x41e6a9){var _0x2a5b04=typeof _0x34d4dc[_0x8934('0x1d')]==='undefined'&&typeof _0x34d4dc[_0x8934('0x1e')]===_0x8934('0x1f');var _0x261c78=_0x41e6a9['count'];var _0x47f25e=_0x2a5b04?0x0:_0x34d4dc['offset'];var _0x2ff9ce=_0x2a5b04?_0x41e6a9['count']:_0x34d4dc[_0x8934('0x1d')]+_0x34d4dc[_0x8934('0x1e')];var _0x14b4e4;if(_0x2ff9ce>=_0x261c78){_0x2ff9ce=_0x261c78;_0x14b4e4=0xc8;}else{_0x14b4e4=0xce;}_0x94b948[_0x8934('0x1a')](_0x14b4e4);return _0x94b948[_0x8934('0x20')]('Content-Range',_0x47f25e+'-'+_0x2ff9ce+'/'+_0x261c78)[_0x8934('0x1c')](_0x41e6a9);}return null;};}function patchUpdates(_0x5ae49f){return function(_0x476c6c){try{jsonpatch[_0x8934('0x21')](_0x476c6c,_0x5ae49f,!![]);}catch(_0x1ccbe5){return BPromise[_0x8934('0x22')](_0x1ccbe5);}return _0x476c6c[_0x8934('0x23')]();};}function saveUpdates(_0x331e18,_0x36fe20){return function(_0x4f4a9b){if(_0x4f4a9b){return _0x4f4a9b[_0x8934('0x24')](_0x331e18)[_0x8934('0x25')](function(_0x32020a){return _0x32020a;});}return null;};}function removeEntity(_0x343e09,_0x43b89a){return function(_0x5e593b){if(_0x5e593b){return _0x5e593b[_0x8934('0x26')]()[_0x8934('0x25')](function(){_0x343e09[_0x8934('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16cfc2,_0x561df2){return function(_0x14c5f0){if(!_0x14c5f0){_0x16cfc2[_0x8934('0x19')](0x194);}return _0x14c5f0;};}function handleError(_0x110f7f,_0x5ef0ed){_0x5ef0ed=_0x5ef0ed||0x1f4;return function(_0x1fd5eb){logger[_0x8934('0x27')](_0x1fd5eb[_0x8934('0x28')]);if(_0x1fd5eb[_0x8934('0x29')]){delete _0x1fd5eb['name'];}_0x110f7f[_0x8934('0x1a')](_0x5ef0ed)[_0x8934('0x2a')](_0x1fd5eb);};}exports[_0x8934('0x2b')]=function(_0x3d93c7,_0x44972b){var _0x20d448={},_0x3f328a={},_0x457634={'count':0x0,'rows':[]};var _0x9c6a71=_[_0x8934('0x2c')](db['FreshdeskField'][_0x8934('0x2d')],function(_0x3e973e){return{'name':_0x3e973e['fieldName'],'type':_0x3e973e[_0x8934('0x2e')][_0x8934('0x2f')]};});_0x3f328a[_0x8934('0x30')]=_[_0x8934('0x2c')](_0x9c6a71,'name');_0x3f328a[_0x8934('0x31')]=_[_0x8934('0x32')](_0x3d93c7[_0x8934('0x31')]);_0x3f328a[_0x8934('0x33')]=_[_0x8934('0x34')](_0x3f328a['model'],_0x3f328a[_0x8934('0x31')]);_0x20d448['attributes']=_['intersection'](_0x3f328a[_0x8934('0x30')],qs[_0x8934('0x35')](_0x3d93c7[_0x8934('0x31')][_0x8934('0x35')]));_0x20d448['attributes']=_0x20d448[_0x8934('0x36')][_0x8934('0x37')]?_0x20d448[_0x8934('0x36')]:_0x3f328a[_0x8934('0x30')];if(!_0x3d93c7[_0x8934('0x31')]['hasOwnProperty'](_0x8934('0x38'))){_0x20d448[_0x8934('0x1e')]=qs['limit'](_0x3d93c7['query'][_0x8934('0x1e')]);_0x20d448[_0x8934('0x1d')]=qs['offset'](_0x3d93c7['query'][_0x8934('0x1d')]);}_0x20d448[_0x8934('0x39')]=qs[_0x8934('0x3a')](_0x3d93c7[_0x8934('0x31')][_0x8934('0x3a')]);_0x20d448[_0x8934('0x3b')]=qs[_0x8934('0x33')](_[_0x8934('0x3c')](_0x3d93c7[_0x8934('0x31')],_0x3f328a[_0x8934('0x33')]),_0x9c6a71);if(_0x3d93c7[_0x8934('0x31')]['filter']){_0x20d448[_0x8934('0x3b')]=_[_0x8934('0x3d')](_0x20d448['where'],{'$or':_[_0x8934('0x2c')](_0x9c6a71,function(_0x122ad1){if(_0x122ad1[_0x8934('0x2e')]!==_0x8934('0x3e')){var _0xb189f1={};_0xb189f1[_0x122ad1['name']]={'$like':'%'+_0x3d93c7['query']['filter']+'%'};return _0xb189f1;}})});}_0x20d448=_[_0x8934('0x3d')]({},_0x20d448,_0x3d93c7[_0x8934('0x3f')]);var _0x8814f6={'where':_0x20d448['where']};return db[_0x8934('0x40')]['count'](_0x8814f6)['then'](function(_0x332098){_0x457634[_0x8934('0x41')]=_0x332098;if(_0x3d93c7['query']['includeAll']){_0x20d448[_0x8934('0x42')]=[{'all':!![]}];}return db[_0x8934('0x40')][_0x8934('0x43')](_0x20d448);})['then'](function(_0x46bfe7){_0x457634['rows']=_0x46bfe7;return _0x457634;})[_0x8934('0x25')](respondWithFilteredResult(_0x44972b,_0x20d448))['catch'](handleError(_0x44972b,null));};exports[_0x8934('0x44')]=function(_0x476ed9,_0x83be9e){var _0x566d67={'raw':!![],'where':{'id':_0x476ed9[_0x8934('0x45')]['id']}},_0xefdfab={};_0xefdfab[_0x8934('0x30')]=_[_0x8934('0x32')](db['FreshdeskField'][_0x8934('0x2d')]);_0xefdfab[_0x8934('0x31')]=_[_0x8934('0x32')](_0x476ed9[_0x8934('0x31')]);_0xefdfab[_0x8934('0x33')]=_[_0x8934('0x34')](_0xefdfab[_0x8934('0x30')],_0xefdfab[_0x8934('0x31')]);_0x566d67['attributes']=_['intersection'](_0xefdfab['model'],qs[_0x8934('0x35')](_0x476ed9[_0x8934('0x31')]['fields']));_0x566d67[_0x8934('0x36')]=_0x566d67['attributes'][_0x8934('0x37')]?_0x566d67[_0x8934('0x36')]:_0xefdfab['model'];if(_0x476ed9[_0x8934('0x31')][_0x8934('0x46')]){_0x566d67[_0x8934('0x42')]=[{'all':!![]}];}_0x566d67=_[_0x8934('0x3d')]({},_0x566d67,_0x476ed9['options']);return db[_0x8934('0x40')][_0x8934('0x47')](_0x566d67)['then'](handleEntityNotFound(_0x83be9e,null))[_0x8934('0x25')](respondWithResult(_0x83be9e,null))[_0x8934('0x48')](handleError(_0x83be9e,null));};exports[_0x8934('0x49')]=function(_0x2d5c6a,_0x406d0a){return db[_0x8934('0x40')][_0x8934('0x49')](_0x2d5c6a[_0x8934('0x4a')],{})[_0x8934('0x25')](respondWithResult(_0x406d0a,0xc9))[_0x8934('0x48')](handleError(_0x406d0a,null));};exports[_0x8934('0x24')]=function(_0xe212bc,_0x2c322d){if(_0xe212bc[_0x8934('0x4a')]['id']){delete _0xe212bc[_0x8934('0x4a')]['id'];}return db[_0x8934('0x40')][_0x8934('0x47')]({'where':{'id':_0xe212bc[_0x8934('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c322d,null))[_0x8934('0x25')](saveUpdates(_0xe212bc[_0x8934('0x4a')],null))['then'](respondWithResult(_0x2c322d,null))['catch'](handleError(_0x2c322d,null));};exports['destroy']=function(_0x4bc431,_0x3610a0){return db[_0x8934('0x40')][_0x8934('0x47')]({'where':{'id':_0x4bc431['params']['id']}})['then'](handleEntityNotFound(_0x3610a0,null))[_0x8934('0x25')](removeEntity(_0x3610a0,null))['catch'](handleError(_0x3610a0,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index fa22cb2..b8deb8d 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 _0x2dde=['FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define'];(function(_0x26eead,_0x821bc8){var _0x24e4ac=function(_0x51b4b1){while(--_0x51b4b1){_0x26eead['push'](_0x26eead['shift']());}};_0x24e4ac(++_0x821bc8);}(_0x2dde,0x19a));var _0xe2dd=function(_0x5c3284,_0xd66d50){_0x5c3284=_0x5c3284-0x0;var _0x56792d=_0x2dde[_0x5c3284];return _0x56792d;};'use strict';var _=require(_0xe2dd('0x0'));var util=require(_0xe2dd('0x1'));var logger=require(_0xe2dd('0x2'))(_0xe2dd('0x3'));var moment=require(_0xe2dd('0x4'));var BPromise=require('bluebird');var rp=require(_0xe2dd('0x5'));var fs=require('fs');var path=require(_0xe2dd('0x6'));var rimraf=require('rimraf');var config=require(_0xe2dd('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0xe2dd('0x8')]=function(_0x35a460,_0x1fffc1){return _0x35a460[_0xe2dd('0x9')](_0xe2dd('0xa'),attributes,{'tableName':_0xe2dd('0xb'),'paranoid':![],'indexes':[{'name':_0xe2dd('0xc'),'fields':[_0xe2dd('0xd'),_0xe2dd('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf40=['define','FreshdeskField','freshdesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports'];(function(_0x131d80,_0x120360){var _0x249dc0=function(_0x2f487e){while(--_0x2f487e){_0x131d80['push'](_0x131d80['shift']());}};_0x249dc0(++_0x120360);}(_0xaf40,0x75));var _0x0af4=function(_0xe3c4ca,_0x21585c){_0xe3c4ca=_0xe3c4ca-0x0;var _0x5d18dd=_0xaf40[_0xe3c4ca];return _0x5d18dd;};'use strict';var _=require('lodash');var util=require(_0x0af4('0x0'));var logger=require(_0x0af4('0x1'))(_0x0af4('0x2'));var moment=require(_0x0af4('0x3'));var BPromise=require(_0x0af4('0x4'));var rp=require(_0x0af4('0x5'));var fs=require('fs');var path=require(_0x0af4('0x6'));var rimraf=require(_0x0af4('0x7'));var config=require(_0x0af4('0x8'));var attributes=require(_0x0af4('0x9'));module[_0x0af4('0xa')]=function(_0x1aebbe,_0x244b1b){return _0x1aebbe[_0x0af4('0xb')](_0x0af4('0xc'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x0af4('0xd'),'fields':[_0x0af4('0xe'),_0x0af4('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 11d7feb..8132ef3 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 _0xd397=['info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message'];(function(_0x2e3107,_0x25f970){var _0x833d69=function(_0x420e78){while(--_0x420e78){_0x2e3107['push'](_0x2e3107['shift']());}};_0x833d69(++_0x25f970);}(_0xd397,0x19b));var _0x7d39=function(_0xeeece1,_0xa52f6e){_0xeeece1=_0xeeece1-0x0;var _0x2afdbb=_0xd397[_0xeeece1];return _0x2afdbb;};'use strict';var _=require('lodash');var util=require(_0x7d39('0x0'));var moment=require(_0x7d39('0x1'));var BPromise=require(_0x7d39('0x2'));var rs=require(_0x7d39('0x3'));var fs=require('fs');var Redis=require(_0x7d39('0x4'));var db=require(_0x7d39('0x5'))['db'];var utils=require(_0x7d39('0x6'));var logger=require(_0x7d39('0x7'))(_0x7d39('0x8'));var config=require(_0x7d39('0x9'));var jayson=require(_0x7d39('0xa'));var client=jayson['client'][_0x7d39('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x391527,_0x440850,_0x11979d){return new BPromise(function(_0x183a38,_0xd5e760){return client[_0x7d39('0xc')](_0x391527,_0x11979d)[_0x7d39('0xd')](function(_0x19cc1e){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x440850,_0x7d39('0xe'));logger[_0x7d39('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x440850,_0x7d39('0xe'),JSON[_0x7d39('0x10')](_0x19cc1e));if(_0x19cc1e[_0x7d39('0x11')]){if(_0x19cc1e[_0x7d39('0x11')][_0x7d39('0x12')]===0x1f4){logger[_0x7d39('0x11')](_0x7d39('0x13'),_0x440850,_0x19cc1e[_0x7d39('0x11')]['message']);return _0xd5e760(_0x19cc1e[_0x7d39('0x11')]['message']);}logger[_0x7d39('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x440850,_0x19cc1e['error'][_0x7d39('0x14')]);return _0x183a38(_0x19cc1e[_0x7d39('0x11')][_0x7d39('0x14')]);}else{logger[_0x7d39('0x15')]('FreshdeskField,\x20%s,\x20%s',_0x440850,_0x7d39('0xe'));_0x183a38(_0x19cc1e[_0x7d39('0x16')]['message']);}})[_0x7d39('0x17')](function(_0x5bfb8f){logger[_0x7d39('0x11')](_0x7d39('0x13'),_0x440850,_0x5bfb8f);_0xd5e760(_0x5bfb8f);});});} \ No newline at end of file +var _0xcd27=['code','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5c5be4,_0x463d59){var _0x275b76=function(_0x370b06){while(--_0x370b06){_0x5c5be4['push'](_0x5c5be4['shift']());}};_0x275b76(++_0x463d59);}(_0xcd27,0x9b));var _0x7cd2=function(_0x3a1dd9,_0x3def2f){_0x3a1dd9=_0x3a1dd9-0x0;var _0x621719=_0xcd27[_0x3a1dd9];return _0x621719;};'use strict';var _=require(_0x7cd2('0x0'));var util=require(_0x7cd2('0x1'));var moment=require(_0x7cd2('0x2'));var BPromise=require(_0x7cd2('0x3'));var rs=require(_0x7cd2('0x4'));var fs=require('fs');var Redis=require(_0x7cd2('0x5'));var db=require(_0x7cd2('0x6'))['db'];var utils=require(_0x7cd2('0x7'));var logger=require(_0x7cd2('0x8'))(_0x7cd2('0x9'));var config=require(_0x7cd2('0xa'));var jayson=require(_0x7cd2('0xb'));var client=jayson[_0x7cd2('0xc')][_0x7cd2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x22e15f,_0x378e28,_0x95a82){return new BPromise(function(_0x2563b8,_0x184931){return client[_0x7cd2('0xe')](_0x22e15f,_0x95a82)['then'](function(_0x3d184f){logger[_0x7cd2('0xf')]('FreshdeskField,\x20%s,\x20%s',_0x378e28,'request\x20sent');logger['debug'](_0x7cd2('0x10'),_0x378e28,_0x7cd2('0x11'),JSON[_0x7cd2('0x12')](_0x3d184f));if(_0x3d184f['error']){if(_0x3d184f[_0x7cd2('0x13')][_0x7cd2('0x14')]===0x1f4){logger[_0x7cd2('0x13')](_0x7cd2('0x15'),_0x378e28,_0x3d184f[_0x7cd2('0x13')][_0x7cd2('0x16')]);return _0x184931(_0x3d184f[_0x7cd2('0x13')][_0x7cd2('0x16')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x378e28,_0x3d184f[_0x7cd2('0x13')]['message']);return _0x2563b8(_0x3d184f[_0x7cd2('0x13')][_0x7cd2('0x16')]);}else{logger[_0x7cd2('0xf')](_0x7cd2('0x15'),_0x378e28,_0x7cd2('0x11'));_0x2563b8(_0x3d184f[_0x7cd2('0x17')]['message']);}})[_0x7cd2('0x18')](function(_0x17755e){logger[_0x7cd2('0x13')](_0x7cd2('0x15'),_0x378e28,_0x17755e);_0x184931(_0x17755e);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index bfaec48..2ce3bbb 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 _0x153f=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','update','delete','exports','multer','util','path'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x153f,0x15b));var _0xf153=function(_0xf923b5,_0x46d4c3){_0xf923b5=_0xf923b5-0x0;var _0x2ed53b=_0x153f[_0xf923b5];return _0x2ed53b;};'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['post']('/',auth[_0xf153('0xa')](),controller[_0xf153('0x11')]);router[_0xf153('0x12')]('/:id/configurations',auth[_0xf153('0xa')](),controller[_0xf153('0x13')]);router[_0xf153('0x14')](_0xf153('0x15'),auth[_0xf153('0xa')](),controller[_0xf153('0x16')]);router[_0xf153('0x17')](_0xf153('0x15'),auth[_0xf153('0xa')](),controller['destroy']);module[_0xf153('0x18')]=router; \ No newline at end of file +var _0x9354=['addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x17041a,_0x21f849){var _0x5edf60=function(_0x9b2efa){while(--_0x9b2efa){_0x17041a['push'](_0x17041a['shift']());}};_0x5edf60(++_0x21f849);}(_0x9354,0x96));var _0x4935=function(_0x5ef161,_0x27d16c){_0x5ef161=_0x5ef161-0x0;var _0x1c6e9e=_0x9354[_0x5ef161];return _0x1c6e9e;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['get'](_0x4935('0xd'),auth['isAuthenticated'](),controller[_0x4935('0xe')]);router[_0x4935('0x8')](_0x4935('0xf'),auth[_0x4935('0x9')](),controller[_0x4935('0x10')]);router[_0x4935('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4935('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x4935('0x12')]);router[_0x4935('0x13')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0x14')]);router[_0x4935('0x15')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0x16')]);module[_0x4935('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 01f4019..bad1732 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 _0xfcbb=['exports','STRING','username','remoteUri','sequelize'];(function(_0x401617,_0x1251b3){var _0x5ebfcf=function(_0x598bbd){while(--_0x598bbd){_0x401617['push'](_0x401617['shift']());}};_0x5ebfcf(++_0x1251b3);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x1e5b27,_0xd2ebb8){_0x1e5b27=_0x1e5b27-0x0;var _0x1efef1=_0xfcbb[_0x1e5b27];return _0x1efef1;};'use strict';var Sequelize=require(_0xbfcb('0x0'));module[_0xbfcb('0x1')]={'name':{'type':Sequelize[_0xbfcb('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xbfcb('0x3')},'apiKey':{'type':Sequelize[_0xbfcb('0x2')]},'remoteUri':{'type':Sequelize[_0xbfcb('0x2')],'unique':_0xbfcb('0x4')},'serverUrl':{'type':Sequelize[_0xbfcb('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7880=['exports','STRING','username','remoteUri'];(function(_0x8c659f,_0x99256a){var _0x3c00b4=function(_0x404a5e){while(--_0x404a5e){_0x8c659f['push'](_0x8c659f['shift']());}};_0x3c00b4(++_0x99256a);}(_0x7880,0x1f4));var _0x0788=function(_0xa31cbb,_0x3920ac){_0xa31cbb=_0xa31cbb-0x0;var _0xa34c42=_0x7880[_0xa31cbb];return _0xa34c42;};'use strict';var Sequelize=require('sequelize');module[_0x0788('0x0')]={'name':{'type':Sequelize[_0x0788('0x1')]},'description':{'type':Sequelize[_0x0788('0x1')]},'username':{'type':Sequelize[_0x0788('0x1')],'unique':_0x0788('0x2')},'apiKey':{'type':Sequelize[_0x0788('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0788('0x3')},'serverUrl':{'type':Sequelize[_0x0788('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 0b0ba00..d9fb403 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 _0x88bc=['length','options','create','body','find','getConfigurations','FreshsalesConfiguration','nolimit','addConfiguration','findOne','channel','Descriptions','getDescriptions','FreshsalesField','getFields','remoteUri','apiKey','username','slice','substring','format','/api/selector/owners','email','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','sendStatus','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params'];(function(_0x150c50,_0x4b0deb){var _0x2d3d47=function(_0x1fa3a6){while(--_0x1fa3a6){_0x150c50['push'](_0x150c50['shift']());}};_0x2d3d47(++_0x4b0deb);}(_0x88bc,0x1ad));var _0xc88b=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x88bc[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc88b('0x0'));var zipdir=require(_0xc88b('0x1'));var jsonpatch=require(_0xc88b('0x2'));var rp=require(_0xc88b('0x3'));var moment=require(_0xc88b('0x4'));var BPromise=require(_0xc88b('0x5'));var Mustache=require(_0xc88b('0x6'));var util=require(_0xc88b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc88b('0x8'));var ejs=require(_0xc88b('0x9'));var fs=require('fs');var fs_extra=require(_0xc88b('0xa'));var _=require(_0xc88b('0xb'));var squel=require(_0xc88b('0xc'));var crypto=require(_0xc88b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc88b('0x8'));var querystring=require(_0xc88b('0xe'));var Papa=require(_0xc88b('0xf'));var Redis=require(_0xc88b('0x10'));var authService=require(_0xc88b('0x11'));var qs=require(_0xc88b('0x12'));var as=require(_0xc88b('0x13'));var hardwareService=require(_0xc88b('0x14'));var logger=require(_0xc88b('0x15'))(_0xc88b('0x16'));var utils=require(_0xc88b('0x17'));var config=require(_0xc88b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc88b('0x19'))['db'];var integrations=require(_0xc88b('0x1a'));function respondWithStatusCode(_0x92042c,_0x5e56fb){_0x5e56fb=_0x5e56fb||0xcc;return function(_0x8d862e){if(_0x8d862e){return _0x92042c['sendStatus'](_0x5e56fb);}return _0x92042c[_0xc88b('0x1b')](_0x5e56fb)[_0xc88b('0x1c')]();};}function respondWithResult(_0x563497,_0x216d3c){_0x216d3c=_0x216d3c||0xc8;return function(_0x11ce50){if(_0x11ce50){return _0x563497['status'](_0x216d3c)[_0xc88b('0x1d')](_0x11ce50);}};}function respondWithFilteredResult(_0x128835,_0x535d14){return function(_0x54264d){if(_0x54264d){var _0x32c2d0=typeof _0x535d14['offset']===_0xc88b('0x1e')&&typeof _0x535d14[_0xc88b('0x1f')]===_0xc88b('0x1e');var _0x446532=_0x54264d[_0xc88b('0x20')];var _0x22a722=_0x32c2d0?0x0:_0x535d14[_0xc88b('0x21')];var _0x392a96=_0x32c2d0?_0x54264d[_0xc88b('0x20')]:_0x535d14[_0xc88b('0x21')]+_0x535d14[_0xc88b('0x1f')];var _0x103882;if(_0x392a96>=_0x446532){_0x392a96=_0x446532;_0x103882=0xc8;}else{_0x103882=0xce;}_0x128835[_0xc88b('0x1b')](_0x103882);return _0x128835[_0xc88b('0x22')](_0xc88b('0x23'),_0x22a722+'-'+_0x392a96+'/'+_0x446532)[_0xc88b('0x1d')](_0x54264d);}return null;};}function patchUpdates(_0x6f696e){return function(_0x1ba714){try{jsonpatch['apply'](_0x1ba714,_0x6f696e,!![]);}catch(_0x10b629){return BPromise['reject'](_0x10b629);}return _0x1ba714[_0xc88b('0x24')]();};}function saveUpdates(_0x5d87a0,_0x2298a7){return function(_0x242235){if(_0x242235){return _0x242235[_0xc88b('0x25')](_0x5d87a0)[_0xc88b('0x26')](function(_0x5843db){return _0x5843db;});}return null;};}function removeEntity(_0x15e806,_0x86bdef){return function(_0x45e873){if(_0x45e873){return _0x45e873[_0xc88b('0x27')]()[_0xc88b('0x26')](function(){_0x15e806[_0xc88b('0x1b')](0xcc)[_0xc88b('0x1c')]();});}};}function handleEntityNotFound(_0x214b4e,_0x28c4c2){return function(_0x7fc8b){if(!_0x7fc8b){_0x214b4e[_0xc88b('0x28')](0x194);}return _0x7fc8b;};}function handleError(_0x1660e8,_0x1d8787){_0x1d8787=_0x1d8787||0x1f4;return function(_0x4fb6e9){logger['error'](_0x4fb6e9['stack']);if(_0x4fb6e9[_0xc88b('0x29')]){delete _0x4fb6e9[_0xc88b('0x29')];}_0x1660e8[_0xc88b('0x1b')](_0x1d8787)[_0xc88b('0x2a')](_0x4fb6e9);};}exports[_0xc88b('0x2b')]=function(_0x2bc021,_0x187cf9){var _0x3bfd07={},_0x18af10={},_0x27dd5e={'count':0x0,'rows':[]};var _0x309fb1=_['map'](db[_0xc88b('0x2c')][_0xc88b('0x2d')],function(_0x47dc2f){return{'name':_0x47dc2f[_0xc88b('0x2e')],'type':_0x47dc2f[_0xc88b('0x2f')]['key']};});_0x18af10[_0xc88b('0x30')]=_[_0xc88b('0x31')](_0x309fb1,'name');_0x18af10[_0xc88b('0x32')]=_[_0xc88b('0x33')](_0x2bc021[_0xc88b('0x32')]);_0x18af10[_0xc88b('0x34')]=_[_0xc88b('0x35')](_0x18af10[_0xc88b('0x30')],_0x18af10[_0xc88b('0x32')]);_0x3bfd07[_0xc88b('0x36')]=_[_0xc88b('0x35')](_0x18af10['model'],qs[_0xc88b('0x37')](_0x2bc021['query']['fields']));_0x3bfd07[_0xc88b('0x36')]=_0x3bfd07[_0xc88b('0x36')]['length']?_0x3bfd07['attributes']:_0x18af10[_0xc88b('0x30')];if(!_0x2bc021[_0xc88b('0x32')][_0xc88b('0x38')]('nolimit')){_0x3bfd07['limit']=qs[_0xc88b('0x1f')](_0x2bc021[_0xc88b('0x32')]['limit']);_0x3bfd07[_0xc88b('0x21')]=qs[_0xc88b('0x21')](_0x2bc021[_0xc88b('0x32')]['offset']);}_0x3bfd07[_0xc88b('0x39')]=qs[_0xc88b('0x3a')](_0x2bc021[_0xc88b('0x32')][_0xc88b('0x3a')]);_0x3bfd07[_0xc88b('0x3b')]=qs[_0xc88b('0x34')](_[_0xc88b('0x3c')](_0x2bc021[_0xc88b('0x32')],_0x18af10[_0xc88b('0x34')]),_0x309fb1);if(_0x2bc021[_0xc88b('0x32')]['filter']){_0x3bfd07['where']=_['merge'](_0x3bfd07[_0xc88b('0x3b')],{'$or':_[_0xc88b('0x31')](_0x309fb1,function(_0x431fd4){if(_0x431fd4[_0xc88b('0x2f')]!==_0xc88b('0x3d')){var _0x5d3b7d={};_0x5d3b7d[_0x431fd4[_0xc88b('0x29')]]={'$like':'%'+_0x2bc021[_0xc88b('0x32')][_0xc88b('0x3e')]+'%'};return _0x5d3b7d;}})});}_0x3bfd07=_[_0xc88b('0x3f')]({},_0x3bfd07,_0x2bc021['options']);var _0x558de0={'where':_0x3bfd07[_0xc88b('0x3b')]};return db[_0xc88b('0x2c')][_0xc88b('0x20')](_0x558de0)[_0xc88b('0x26')](function(_0x4a1048){_0x27dd5e[_0xc88b('0x20')]=_0x4a1048;if(_0x2bc021[_0xc88b('0x32')][_0xc88b('0x40')]){_0x3bfd07[_0xc88b('0x41')]=[{'all':!![]}];}return db[_0xc88b('0x2c')][_0xc88b('0x42')](_0x3bfd07);})['then'](function(_0x174031){_0x27dd5e[_0xc88b('0x43')]=_0x174031;return _0x27dd5e;})['then'](respondWithFilteredResult(_0x187cf9,_0x3bfd07))[_0xc88b('0x44')](handleError(_0x187cf9,null));};exports[_0xc88b('0x45')]=function(_0x57077d,_0x1db5a8){var _0x2628ce={'raw':![],'where':{'id':_0x57077d[_0xc88b('0x46')]['id']}},_0x4d2ac4={};_0x4d2ac4[_0xc88b('0x30')]=_[_0xc88b('0x33')](db[_0xc88b('0x2c')]['rawAttributes']);_0x4d2ac4[_0xc88b('0x32')]=_[_0xc88b('0x33')](_0x57077d[_0xc88b('0x32')]);_0x4d2ac4[_0xc88b('0x34')]=_['intersection'](_0x4d2ac4[_0xc88b('0x30')],_0x4d2ac4[_0xc88b('0x32')]);_0x2628ce[_0xc88b('0x36')]=_[_0xc88b('0x35')](_0x4d2ac4[_0xc88b('0x30')],qs[_0xc88b('0x37')](_0x57077d[_0xc88b('0x32')][_0xc88b('0x37')]));_0x2628ce['attributes']=_0x2628ce[_0xc88b('0x36')][_0xc88b('0x47')]?_0x2628ce['attributes']:_0x4d2ac4['model'];if(_0x57077d[_0xc88b('0x32')][_0xc88b('0x40')]){_0x2628ce[_0xc88b('0x41')]=[{'all':!![]}];}_0x2628ce=_[_0xc88b('0x3f')]({},_0x2628ce,_0x57077d[_0xc88b('0x48')]);return db[_0xc88b('0x2c')]['find'](_0x2628ce)['then'](handleEntityNotFound(_0x1db5a8,null))[_0xc88b('0x26')](respondWithResult(_0x1db5a8,null))[_0xc88b('0x44')](handleError(_0x1db5a8,null));};exports['create']=function(_0x1e9709,_0x1dc510){return db[_0xc88b('0x2c')][_0xc88b('0x49')](_0x1e9709[_0xc88b('0x4a')],{})[_0xc88b('0x26')](respondWithResult(_0x1dc510,0xc9))[_0xc88b('0x44')](handleError(_0x1dc510,null));};exports['update']=function(_0x42eadf,_0x30cb0d){if(_0x42eadf['body']['id']){delete _0x42eadf[_0xc88b('0x4a')]['id'];}return db[_0xc88b('0x2c')][_0xc88b('0x4b')]({'where':{'id':_0x42eadf[_0xc88b('0x46')]['id']}})['then'](handleEntityNotFound(_0x30cb0d,null))['then'](saveUpdates(_0x42eadf['body'],null))['then'](respondWithResult(_0x30cb0d,null))[_0xc88b('0x44')](handleError(_0x30cb0d,null));};exports['destroy']=function(_0xc0e203,_0x35ee84){return db[_0xc88b('0x2c')][_0xc88b('0x4b')]({'where':{'id':_0xc0e203[_0xc88b('0x46')]['id']}})[_0xc88b('0x26')](handleEntityNotFound(_0x35ee84,null))[_0xc88b('0x26')](removeEntity(_0x35ee84,null))[_0xc88b('0x44')](handleError(_0x35ee84,null));};exports[_0xc88b('0x4c')]=function(_0x2e0bd0,_0x3173e3,_0x3eaf5a){var _0x1e76e5={};var _0x52b6d4={};var _0x530eab;var _0x468449;return db[_0xc88b('0x2c')]['findOne']({'where':{'id':_0x2e0bd0[_0xc88b('0x46')]['id']}})[_0xc88b('0x26')](handleEntityNotFound(_0x3173e3,null))[_0xc88b('0x26')](function(_0x37bf9f){if(_0x37bf9f){_0x530eab=_0x37bf9f;_0x52b6d4[_0xc88b('0x30')]=_[_0xc88b('0x33')](db[_0xc88b('0x4d')][_0xc88b('0x2d')]);_0x52b6d4[_0xc88b('0x32')]=_[_0xc88b('0x33')](_0x2e0bd0[_0xc88b('0x32')]);_0x52b6d4['filters']=_[_0xc88b('0x35')](_0x52b6d4[_0xc88b('0x30')],_0x52b6d4[_0xc88b('0x32')]);_0x1e76e5[_0xc88b('0x36')]=_[_0xc88b('0x35')](_0x52b6d4[_0xc88b('0x30')],qs[_0xc88b('0x37')](_0x2e0bd0[_0xc88b('0x32')][_0xc88b('0x37')]));_0x1e76e5[_0xc88b('0x36')]=_0x1e76e5['attributes']['length']?_0x1e76e5[_0xc88b('0x36')]:_0x52b6d4[_0xc88b('0x30')];_0x1e76e5[_0xc88b('0x39')]=qs['sort'](_0x2e0bd0[_0xc88b('0x32')]['sort']);_0x1e76e5[_0xc88b('0x3b')]=qs['filters'](_['pick'](_0x2e0bd0[_0xc88b('0x32')],_0x52b6d4['filters']));if(_0x2e0bd0[_0xc88b('0x32')][_0xc88b('0x3e')]){_0x1e76e5[_0xc88b('0x3b')]=_[_0xc88b('0x3f')](_0x1e76e5[_0xc88b('0x3b')],{'$or':_['map'](_0x1e76e5['attributes'],function(_0x4bf6d6){var _0x1e8c80={};_0x1e8c80[_0x4bf6d6]={'$like':'%'+_0x2e0bd0[_0xc88b('0x32')][_0xc88b('0x3e')]+'%'};return _0x1e8c80;})});}_0x1e76e5=_['merge']({},_0x1e76e5,_0x2e0bd0['options']);return _0x530eab[_0xc88b('0x4c')](_0x1e76e5);}})[_0xc88b('0x26')](function(_0x21e1d8){if(_0x21e1d8){_0x468449=_0x21e1d8[_0xc88b('0x47')];if(!_0x2e0bd0[_0xc88b('0x32')][_0xc88b('0x38')](_0xc88b('0x4e'))){_0x1e76e5[_0xc88b('0x1f')]=qs['limit'](_0x2e0bd0['query']['limit']);_0x1e76e5[_0xc88b('0x21')]=qs[_0xc88b('0x21')](_0x2e0bd0['query'][_0xc88b('0x21')]);}return _0x530eab['getConfigurations'](_0x1e76e5);}})[_0xc88b('0x26')](function(_0x4c8a16){if(_0x4c8a16){return _0x4c8a16?{'count':_0x468449,'rows':_0x4c8a16}:null;}})[_0xc88b('0x26')](respondWithResult(_0x3173e3,null))[_0xc88b('0x44')](handleError(_0x3173e3,null));};exports[_0xc88b('0x4f')]=function(_0x252a5e,_0x3f5b3d,_0x2f1995){if(_0x252a5e[_0xc88b('0x4a')]['id']){delete _0x252a5e[_0xc88b('0x4a')]['id'];}return db[_0xc88b('0x2c')][_0xc88b('0x50')]({'where':{'id':_0x252a5e['params']['id']}})[_0xc88b('0x26')](handleEntityNotFound(_0x3f5b3d,null))[_0xc88b('0x26')](function(_0x250b5e){if(_0x250b5e){_0x252a5e[_0xc88b('0x4a')]['AccountId']=_0x250b5e['id'];_0x252a5e[_0xc88b('0x4a')]['Subjects']=integrations['getSubjects'](_0x252a5e[_0xc88b('0x4a')][_0xc88b('0x51')],_0x252a5e['body'][_0xc88b('0x2f')]);_0x252a5e[_0xc88b('0x4a')][_0xc88b('0x52')]=integrations[_0xc88b('0x53')](_0x252a5e[_0xc88b('0x4a')][_0xc88b('0x51')],_0x252a5e[_0xc88b('0x4a')]['type']);return db[_0xc88b('0x4d')][_0xc88b('0x49')](_0x252a5e[_0xc88b('0x4a')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db[_0xc88b('0x54')],'as':_0xc88b('0x52')}]});}return null;})['then'](respondWithResult(_0x3f5b3d,null))[_0xc88b('0x44')](handleError(_0x3f5b3d,null));};exports[_0xc88b('0x55')]=function(_0x346076,_0x3d49ff,_0x2a8104){var _0x3a0949='';var _0x55429f='';return db[_0xc88b('0x2c')][_0xc88b('0x50')]({'where':{'id':_0x346076[_0xc88b('0x46')]['id']},'attributes':['id','username',_0xc88b('0x56'),_0xc88b('0x57')]})[_0xc88b('0x26')](handleEntityNotFound(_0x3d49ff,null))[_0xc88b('0x26')](function(_0x49224d){if(_0x49224d){_0x55429f=_0x49224d[_0xc88b('0x58')];_0x3a0949=_0x49224d[_0xc88b('0x56')];var _0x5dc1ee=_0x49224d[_0xc88b('0x56')][_0xc88b('0x59')](-0x1);if(_0x5dc1ee==='/'){_0x3a0949=_0x3a0949[_0xc88b('0x5a')](0x0,_0x3a0949['lastIndexOf'](_0x5dc1ee));}return rp({'method':'GET','uri':util[_0xc88b('0x5b')]('%s%s',_0x3a0949,_0xc88b('0x5c')),'headers':{'Authorization':'Token\x20token='+_0x49224d['apiKey']},'json':!![]});}})[_0xc88b('0x26')](function(_0x3a714e){if(_0x3a714e){var _0x110264=_0x3a714e['users'];var _0x38c45d=![];var _0x47507d=null;for(_0x47507d=0x0;_0x47507d<_0x110264[_0xc88b('0x47')];_0x47507d++){if(_0x110264[_0x47507d][_0xc88b('0x5d')]===_0x55429f){_0x38c45d=!![];}}if(_0x38c45d){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xc88b('0x26')](respondWithResult(_0x3d49ff,null))[_0xc88b('0x44')](function(_0x1f97c9){var _0x3d517c=_0x346076['query'][_0xc88b('0x5e')]?0x1f4:_0x1f97c9[_0xc88b('0x5f')]||0x1f4;logger[_0xc88b('0x60')](_0xc88b('0x61'),'getFields',_0x3d517c,JSON[_0xc88b('0x62')](_0x1f97c9));delete _0x1f97c9[_0xc88b('0x29')];if(_0x3d517c===0x191){_0x3d517c=0x190;}_0x3d49ff[_0xc88b('0x1b')](_0x3d517c)['send'](_0x346076[_0xc88b('0x32')]['test']?{'message':_0xc88b('0x63'),'statusCode':_0x1f97c9[_0xc88b('0x5f')]}:_0x1f97c9);});}; \ No newline at end of file +var _0x85fd=['stack','name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','offset','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','pick','nolimit','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','path','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus'];(function(_0x3eb2ea,_0x401c21){var _0x516fe4=function(_0x337c89){while(--_0x337c89){_0x3eb2ea['push'](_0x3eb2ea['shift']());}};_0x516fe4(++_0x401c21);}(_0x85fd,0x1cb));var _0xd85f=function(_0x10f955,_0x53b237){_0x10f955=_0x10f955-0x0;var _0x5d745b=_0x85fd[_0x10f955];return _0x5d745b;};'use strict';var emlformat=require(_0xd85f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd85f('0x1'));var rp=require(_0xd85f('0x2'));var moment=require(_0xd85f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd85f('0x4'));var sox=require('sox');var csv=require(_0xd85f('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd85f('0x6'));var _=require(_0xd85f('0x7'));var squel=require(_0xd85f('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd85f('0x9'));var toCsv=require(_0xd85f('0x5'));var querystring=require(_0xd85f('0xa'));var Papa=require(_0xd85f('0xb'));var Redis=require(_0xd85f('0xc'));var authService=require(_0xd85f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xd85f('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd85f('0xf'));var utils=require(_0xd85f('0x10'));var config=require(_0xd85f('0x11'));var licenseUtil=require(_0xd85f('0x12'));var db=require(_0xd85f('0x13'))['db'];var integrations=require(_0xd85f('0x14'));function respondWithStatusCode(_0xb891e1,_0x42a1a8){_0x42a1a8=_0x42a1a8||0xcc;return function(_0x4accd5){if(_0x4accd5){return _0xb891e1['sendStatus'](_0x42a1a8);}return _0xb891e1[_0xd85f('0x15')](_0x42a1a8)[_0xd85f('0x16')]();};}function respondWithResult(_0x237cea,_0x5d8b91){_0x5d8b91=_0x5d8b91||0xc8;return function(_0x3244bf){if(_0x3244bf){return _0x237cea[_0xd85f('0x15')](_0x5d8b91)['json'](_0x3244bf);}};}function respondWithFilteredResult(_0x48c239,_0x52c697){return function(_0x2932b2){if(_0x2932b2){var _0x4d67a8=typeof _0x52c697['offset']===_0xd85f('0x17')&&typeof _0x52c697[_0xd85f('0x18')]===_0xd85f('0x17');var _0x5e03fa=_0x2932b2[_0xd85f('0x19')];var _0x3dcf7c=_0x4d67a8?0x0:_0x52c697['offset'];var _0x52ffd1=_0x4d67a8?_0x2932b2[_0xd85f('0x19')]:_0x52c697['offset']+_0x52c697[_0xd85f('0x18')];var _0x3bfbd5;if(_0x52ffd1>=_0x5e03fa){_0x52ffd1=_0x5e03fa;_0x3bfbd5=0xc8;}else{_0x3bfbd5=0xce;}_0x48c239['status'](_0x3bfbd5);return _0x48c239[_0xd85f('0x1a')](_0xd85f('0x1b'),_0x3dcf7c+'-'+_0x52ffd1+'/'+_0x5e03fa)[_0xd85f('0x1c')](_0x2932b2);}return null;};}function patchUpdates(_0x41e9a5){return function(_0x4120a6){try{jsonpatch[_0xd85f('0x1d')](_0x4120a6,_0x41e9a5,!![]);}catch(_0x4f5529){return BPromise[_0xd85f('0x1e')](_0x4f5529);}return _0x4120a6[_0xd85f('0x1f')]();};}function saveUpdates(_0xcab734,_0x1c44e4){return function(_0x3dc55a){if(_0x3dc55a){return _0x3dc55a[_0xd85f('0x20')](_0xcab734)[_0xd85f('0x21')](function(_0x4a9bf8){return _0x4a9bf8;});}return null;};}function removeEntity(_0x4bd96e,_0x42e2b7){return function(_0x4ec88e){if(_0x4ec88e){return _0x4ec88e[_0xd85f('0x22')]()[_0xd85f('0x21')](function(){_0x4bd96e['status'](0xcc)[_0xd85f('0x16')]();});}};}function handleEntityNotFound(_0x4bbf74,_0xdf2517){return function(_0x3f15d1){if(!_0x3f15d1){_0x4bbf74[_0xd85f('0x23')](0x194);}return _0x3f15d1;};}function handleError(_0x37ed3,_0x46136a){_0x46136a=_0x46136a||0x1f4;return function(_0x268996){logger['error'](_0x268996[_0xd85f('0x24')]);if(_0x268996[_0xd85f('0x25')]){delete _0x268996[_0xd85f('0x25')];}_0x37ed3[_0xd85f('0x15')](_0x46136a)['send'](_0x268996);};}exports[_0xd85f('0x26')]=function(_0x41fcf5,_0x27a282){var _0x5aaeaa={},_0x576f5c={},_0x4fdf65={'count':0x0,'rows':[]};var _0x1efa01=_[_0xd85f('0x27')](db[_0xd85f('0x28')][_0xd85f('0x29')],function(_0x27acad){return{'name':_0x27acad[_0xd85f('0x2a')],'type':_0x27acad[_0xd85f('0x2b')][_0xd85f('0x2c')]};});_0x576f5c[_0xd85f('0x2d')]=_['map'](_0x1efa01,_0xd85f('0x25'));_0x576f5c[_0xd85f('0x2e')]=_['keys'](_0x41fcf5[_0xd85f('0x2e')]);_0x576f5c[_0xd85f('0x2f')]=_['intersection'](_0x576f5c[_0xd85f('0x2d')],_0x576f5c[_0xd85f('0x2e')]);_0x5aaeaa[_0xd85f('0x30')]=_[_0xd85f('0x31')](_0x576f5c[_0xd85f('0x2d')],qs[_0xd85f('0x32')](_0x41fcf5[_0xd85f('0x2e')][_0xd85f('0x32')]));_0x5aaeaa['attributes']=_0x5aaeaa['attributes'][_0xd85f('0x33')]?_0x5aaeaa['attributes']:_0x576f5c[_0xd85f('0x2d')];if(!_0x41fcf5['query'][_0xd85f('0x34')]('nolimit')){_0x5aaeaa[_0xd85f('0x18')]=qs[_0xd85f('0x18')](_0x41fcf5[_0xd85f('0x2e')][_0xd85f('0x18')]);_0x5aaeaa['offset']=qs['offset'](_0x41fcf5[_0xd85f('0x2e')][_0xd85f('0x35')]);}_0x5aaeaa[_0xd85f('0x36')]=qs[_0xd85f('0x37')](_0x41fcf5[_0xd85f('0x2e')]['sort']);_0x5aaeaa[_0xd85f('0x38')]=qs[_0xd85f('0x2f')](_['pick'](_0x41fcf5[_0xd85f('0x2e')],_0x576f5c['filters']),_0x1efa01);if(_0x41fcf5[_0xd85f('0x2e')][_0xd85f('0x39')]){_0x5aaeaa['where']=_[_0xd85f('0x3a')](_0x5aaeaa[_0xd85f('0x38')],{'$or':_[_0xd85f('0x27')](_0x1efa01,function(_0x3da16a){if(_0x3da16a[_0xd85f('0x2b')]!==_0xd85f('0x3b')){var _0x327c1d={};_0x327c1d[_0x3da16a[_0xd85f('0x25')]]={'$like':'%'+_0x41fcf5[_0xd85f('0x2e')]['filter']+'%'};return _0x327c1d;}})});}_0x5aaeaa=_[_0xd85f('0x3a')]({},_0x5aaeaa,_0x41fcf5['options']);var _0x185d41={'where':_0x5aaeaa[_0xd85f('0x38')]};return db[_0xd85f('0x28')]['count'](_0x185d41)['then'](function(_0x1ff7d8){_0x4fdf65[_0xd85f('0x19')]=_0x1ff7d8;if(_0x41fcf5[_0xd85f('0x2e')][_0xd85f('0x3c')]){_0x5aaeaa[_0xd85f('0x3d')]=[{'all':!![]}];}return db[_0xd85f('0x28')][_0xd85f('0x3e')](_0x5aaeaa);})[_0xd85f('0x21')](function(_0x13565d){_0x4fdf65[_0xd85f('0x3f')]=_0x13565d;return _0x4fdf65;})[_0xd85f('0x21')](respondWithFilteredResult(_0x27a282,_0x5aaeaa))[_0xd85f('0x40')](handleError(_0x27a282,null));};exports['show']=function(_0x3d9d00,_0x268509){var _0x68dcf9={'raw':![],'where':{'id':_0x3d9d00[_0xd85f('0x41')]['id']}},_0x2c4752={};_0x2c4752[_0xd85f('0x2d')]=_[_0xd85f('0x42')](db[_0xd85f('0x28')][_0xd85f('0x29')]);_0x2c4752[_0xd85f('0x2e')]=_[_0xd85f('0x42')](_0x3d9d00[_0xd85f('0x2e')]);_0x2c4752[_0xd85f('0x2f')]=_[_0xd85f('0x31')](_0x2c4752[_0xd85f('0x2d')],_0x2c4752[_0xd85f('0x2e')]);_0x68dcf9[_0xd85f('0x30')]=_[_0xd85f('0x31')](_0x2c4752['model'],qs[_0xd85f('0x32')](_0x3d9d00[_0xd85f('0x2e')]['fields']));_0x68dcf9['attributes']=_0x68dcf9[_0xd85f('0x30')][_0xd85f('0x33')]?_0x68dcf9['attributes']:_0x2c4752[_0xd85f('0x2d')];if(_0x3d9d00['query'][_0xd85f('0x3c')]){_0x68dcf9[_0xd85f('0x3d')]=[{'all':!![]}];}_0x68dcf9=_['merge']({},_0x68dcf9,_0x3d9d00[_0xd85f('0x43')]);return db[_0xd85f('0x28')][_0xd85f('0x44')](_0x68dcf9)[_0xd85f('0x21')](handleEntityNotFound(_0x268509,null))[_0xd85f('0x21')](respondWithResult(_0x268509,null))['catch'](handleError(_0x268509,null));};exports[_0xd85f('0x45')]=function(_0x97d0d8,_0x520628){return db[_0xd85f('0x28')][_0xd85f('0x45')](_0x97d0d8[_0xd85f('0x46')],{})[_0xd85f('0x21')](respondWithResult(_0x520628,0xc9))['catch'](handleError(_0x520628,null));};exports[_0xd85f('0x20')]=function(_0x18c1ca,_0x33c81b){if(_0x18c1ca[_0xd85f('0x46')]['id']){delete _0x18c1ca[_0xd85f('0x46')]['id'];}return db[_0xd85f('0x28')][_0xd85f('0x44')]({'where':{'id':_0x18c1ca[_0xd85f('0x41')]['id']}})['then'](handleEntityNotFound(_0x33c81b,null))[_0xd85f('0x21')](saveUpdates(_0x18c1ca[_0xd85f('0x46')],null))[_0xd85f('0x21')](respondWithResult(_0x33c81b,null))['catch'](handleError(_0x33c81b,null));};exports['destroy']=function(_0x12c3c6,_0x1ca467){return db[_0xd85f('0x28')][_0xd85f('0x44')]({'where':{'id':_0x12c3c6[_0xd85f('0x41')]['id']}})[_0xd85f('0x21')](handleEntityNotFound(_0x1ca467,null))['then'](removeEntity(_0x1ca467,null))[_0xd85f('0x40')](handleError(_0x1ca467,null));};exports[_0xd85f('0x47')]=function(_0x4d6e35,_0x45f153,_0x24aa75){var _0x296fd7={};var _0x318c08={};var _0x8b2a8c;var _0xd99fe8;return db['FreshsalesAccount'][_0xd85f('0x48')]({'where':{'id':_0x4d6e35[_0xd85f('0x41')]['id']}})['then'](handleEntityNotFound(_0x45f153,null))[_0xd85f('0x21')](function(_0x31fb6a){if(_0x31fb6a){_0x8b2a8c=_0x31fb6a;_0x318c08[_0xd85f('0x2d')]=_[_0xd85f('0x42')](db[_0xd85f('0x49')][_0xd85f('0x29')]);_0x318c08[_0xd85f('0x2e')]=_[_0xd85f('0x42')](_0x4d6e35[_0xd85f('0x2e')]);_0x318c08['filters']=_[_0xd85f('0x31')](_0x318c08[_0xd85f('0x2d')],_0x318c08['query']);_0x296fd7[_0xd85f('0x30')]=_['intersection'](_0x318c08['model'],qs[_0xd85f('0x32')](_0x4d6e35[_0xd85f('0x2e')][_0xd85f('0x32')]));_0x296fd7[_0xd85f('0x30')]=_0x296fd7[_0xd85f('0x30')][_0xd85f('0x33')]?_0x296fd7[_0xd85f('0x30')]:_0x318c08[_0xd85f('0x2d')];_0x296fd7[_0xd85f('0x36')]=qs[_0xd85f('0x37')](_0x4d6e35[_0xd85f('0x2e')]['sort']);_0x296fd7[_0xd85f('0x38')]=qs[_0xd85f('0x2f')](_[_0xd85f('0x4a')](_0x4d6e35[_0xd85f('0x2e')],_0x318c08[_0xd85f('0x2f')]));if(_0x4d6e35[_0xd85f('0x2e')]['filter']){_0x296fd7[_0xd85f('0x38')]=_[_0xd85f('0x3a')](_0x296fd7[_0xd85f('0x38')],{'$or':_['map'](_0x296fd7[_0xd85f('0x30')],function(_0x599724){var _0x349816={};_0x349816[_0x599724]={'$like':'%'+_0x4d6e35[_0xd85f('0x2e')][_0xd85f('0x39')]+'%'};return _0x349816;})});}_0x296fd7=_['merge']({},_0x296fd7,_0x4d6e35[_0xd85f('0x43')]);return _0x8b2a8c[_0xd85f('0x47')](_0x296fd7);}})[_0xd85f('0x21')](function(_0x3415e1){if(_0x3415e1){_0xd99fe8=_0x3415e1[_0xd85f('0x33')];if(!_0x4d6e35['query'][_0xd85f('0x34')](_0xd85f('0x4b'))){_0x296fd7[_0xd85f('0x18')]=qs['limit'](_0x4d6e35['query'][_0xd85f('0x18')]);_0x296fd7[_0xd85f('0x35')]=qs[_0xd85f('0x35')](_0x4d6e35[_0xd85f('0x2e')][_0xd85f('0x35')]);}return _0x8b2a8c['getConfigurations'](_0x296fd7);}})[_0xd85f('0x21')](function(_0x472df6){if(_0x472df6){return _0x472df6?{'count':_0xd99fe8,'rows':_0x472df6}:null;}})['then'](respondWithResult(_0x45f153,null))[_0xd85f('0x40')](handleError(_0x45f153,null));};exports['addConfiguration']=function(_0x55e210,_0x129e73,_0x76c850){if(_0x55e210['body']['id']){delete _0x55e210['body']['id'];}return db[_0xd85f('0x28')]['findOne']({'where':{'id':_0x55e210['params']['id']}})['then'](handleEntityNotFound(_0x129e73,null))[_0xd85f('0x21')](function(_0x509734){if(_0x509734){_0x55e210[_0xd85f('0x46')]['AccountId']=_0x509734['id'];_0x55e210[_0xd85f('0x46')][_0xd85f('0x4c')]=integrations[_0xd85f('0x4d')](_0x55e210[_0xd85f('0x46')][_0xd85f('0x4e')],_0x55e210['body'][_0xd85f('0x2b')]);_0x55e210['body'][_0xd85f('0x4f')]=integrations[_0xd85f('0x50')](_0x55e210['body'][_0xd85f('0x4e')],_0x55e210[_0xd85f('0x46')][_0xd85f('0x2b')]);return db[_0xd85f('0x49')]['create'](_0x55e210['body'],{'include':[{'model':db[_0xd85f('0x51')],'as':_0xd85f('0x4c')},{'model':db['FreshsalesField'],'as':_0xd85f('0x4f')}]});}return null;})[_0xd85f('0x21')](respondWithResult(_0x129e73,null))[_0xd85f('0x40')](handleError(_0x129e73,null));};exports[_0xd85f('0x52')]=function(_0x2d0aa3,_0x404df3,_0x5d0318){var _0xdf9541='';var _0x1164bb='';return db[_0xd85f('0x28')][_0xd85f('0x48')]({'where':{'id':_0x2d0aa3['params']['id']},'attributes':['id',_0xd85f('0x53'),_0xd85f('0x54'),'apiKey']})[_0xd85f('0x21')](handleEntityNotFound(_0x404df3,null))[_0xd85f('0x21')](function(_0x43ef3a){if(_0x43ef3a){_0x1164bb=_0x43ef3a[_0xd85f('0x53')];_0xdf9541=_0x43ef3a['remoteUri'];var _0x5cdb9f=_0x43ef3a[_0xd85f('0x54')]['slice'](-0x1);if(_0x5cdb9f==='/'){_0xdf9541=_0xdf9541[_0xd85f('0x55')](0x0,_0xdf9541[_0xd85f('0x56')](_0x5cdb9f));}return rp({'method':'GET','uri':util[_0xd85f('0x57')](_0xd85f('0x58'),_0xdf9541,_0xd85f('0x59')),'headers':{'Authorization':_0xd85f('0x5a')+_0x43ef3a[_0xd85f('0x5b')]},'json':!![]});}})['then'](function(_0x5ba44a){if(_0x5ba44a){var _0x2c7f98=_0x5ba44a['users'];var _0x21d751=![];var _0x14cdd8=null;for(_0x14cdd8=0x0;_0x14cdd8<_0x2c7f98[_0xd85f('0x33')];_0x14cdd8++){if(_0x2c7f98[_0x14cdd8][_0xd85f('0x5c')]===_0x1164bb){_0x21d751=!![];}}if(_0x21d751){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xd85f('0x5d')});}}})[_0xd85f('0x21')](respondWithResult(_0x404df3,null))['catch'](function(_0x5bcc7a){var _0x290ae8=_0x2d0aa3['query'][_0xd85f('0x5e')]?0x1f4:_0x5bcc7a[_0xd85f('0x5f')]||0x1f4;logger[_0xd85f('0x60')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x290ae8,JSON[_0xd85f('0x61')](_0x5bcc7a));delete _0x5bcc7a['name'];if(_0x290ae8===0x191){_0x290ae8=0x190;}_0x404df3['status'](_0x290ae8)['send'](_0x2d0aa3[_0xd85f('0x2e')][_0xd85f('0x5e')]?{'message':_0xd85f('0x62'),'statusCode':_0x5bcc7a[_0xd85f('0x5f')]}:_0x5bcc7a);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 6ad0afe..1406dc0 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 _0xdf55=['int_freshsales_accounts','lodash','util','api','moment','request-promise','path','rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdf55,0x83));var _0x5df5=function(_0x196f40,_0x417e6e){_0x196f40=_0x196f40-0x0;var _0x544d7b=_0xdf55[_0x196f40];return _0x544d7b;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var logger=require('../../config/logger')(_0x5df5('0x2'));var moment=require(_0x5df5('0x3'));var BPromise=require('bluebird');var rp=require(_0x5df5('0x4'));var fs=require('fs');var path=require(_0x5df5('0x5'));var rimraf=require(_0x5df5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5df5('0x7'));var integrations=require(_0x5df5('0x8'));module[_0x5df5('0x9')]=function(_0x476e21,_0x9b8756){return _0x476e21[_0x5df5('0xa')](_0x5df5('0xb'),attributes,{'tableName':_0x5df5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','FreshsalesAccount','int_freshsales_accounts'];(function(_0x3c6fb8,_0x2bc450){var _0x4c4354=function(_0x5ad36c){while(--_0x5ad36c){_0x3c6fb8['push'](_0x3c6fb8['shift']());}};_0x4c4354(++_0x2bc450);}(_0x1261,0x144));var _0x1126=function(_0x20e79a,_0x322d4e){_0x20e79a=_0x20e79a-0x0;var _0x70801f=_0x1261[_0x20e79a];return _0x70801f;};'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'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x40ba58,_0x907180){return _0x40ba58['define'](_0x1126('0xa'),attributes,{'tableName':_0x1126('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 2b2157d..98db526 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 _0xcaf2=['raw','attributes','limit','include','map','model','GetFreshsalesAccount','stringify','catch','ShowFreshsalesAccount','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','FreshsalesAccount','options'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcaf2,0x8a));var _0x2caf=function(_0x5786f9,_0x59a148){_0x5786f9=_0x5786f9-0x0;var _0x22c3cf=_0xcaf2[_0x5786f9];return _0x22c3cf;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var moment=require(_0x2caf('0x1'));var BPromise=require(_0x2caf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2caf('0x3'));var db=require(_0x2caf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2caf('0x5'))('rpc');var config=require(_0x2caf('0x6'));var jayson=require(_0x2caf('0x7'));var client=jayson[_0x2caf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc44e4e,_0x314486,_0x4667c6){return new BPromise(function(_0x34e792,_0x5611aa){return client[_0x2caf('0x9')](_0xc44e4e,_0x4667c6)[_0x2caf('0xa')](function(_0x45e520){logger[_0x2caf('0xb')](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));logger[_0x2caf('0xe')](_0x2caf('0xf'),_0x314486,_0x2caf('0xd'),JSON['stringify'](_0x45e520));if(_0x45e520[_0x2caf('0x10')]){if(_0x45e520[_0x2caf('0x10')][_0x2caf('0x11')]===0x1f4){logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520[_0x2caf('0x10')][_0x2caf('0x12')]);return _0x5611aa(_0x45e520[_0x2caf('0x10')]['message']);}logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520['error']['message']);return _0x34e792(_0x45e520['error'][_0x2caf('0x12')]);}else{logger['info'](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));_0x34e792(_0x45e520[_0x2caf('0x13')][_0x2caf('0x12')]);}})['catch'](function(_0x184355){logger['error'](_0x2caf('0xc'),_0x314486,_0x184355);_0x5611aa(_0x184355);});});}exports['GetFreshsalesAccount']=function(_0x4a33fc){var _0x3e975f=this;return new Promise(function(_0x58047b,_0xe72440){return db[_0x2caf('0x14')]['findAll']({'raw':_0x4a33fc[_0x2caf('0x15')]?_0x4a33fc[_0x2caf('0x15')][_0x2caf('0x16')]===undefined?!![]:![]:!![],'where':_0x4a33fc[_0x2caf('0x15')]?_0x4a33fc[_0x2caf('0x15')]['where']||null:null,'attributes':_0x4a33fc[_0x2caf('0x15')]?_0x4a33fc[_0x2caf('0x15')][_0x2caf('0x17')]||null:null,'limit':_0x4a33fc[_0x2caf('0x15')]?_0x4a33fc[_0x2caf('0x15')][_0x2caf('0x18')]||null:null,'include':_0x4a33fc[_0x2caf('0x15')]?_0x4a33fc[_0x2caf('0x15')][_0x2caf('0x19')]?_[_0x2caf('0x1a')](_0x4a33fc[_0x2caf('0x15')]['include'],function(_0x296305){return{'model':db[_0x296305[_0x2caf('0x1b')]],'as':_0x296305['as'],'attributes':_0x296305[_0x2caf('0x17')],'include':_0x296305[_0x2caf('0x19')]?_[_0x2caf('0x1a')](_0x296305[_0x2caf('0x19')],function(_0x392196){return{'model':db[_0x392196[_0x2caf('0x1b')]],'as':_0x392196['as'],'attributes':_0x392196[_0x2caf('0x17')],'include':_0x392196[_0x2caf('0x19')]?_['map'](_0x392196[_0x2caf('0x19')],function(_0x325eda){return{'model':db[_0x325eda[_0x2caf('0x1b')]],'as':_0x325eda['as'],'attributes':_0x325eda[_0x2caf('0x17')]};}):[]};}):[]};}):[]:[]})[_0x2caf('0xa')](function(_0x17d3c6){logger[_0x2caf('0xb')](_0x2caf('0x1c'),_0x4a33fc);logger[_0x2caf('0xe')](_0x2caf('0x1c'),_0x4a33fc,JSON[_0x2caf('0x1d')](_0x17d3c6));_0x58047b(_0x17d3c6);})[_0x2caf('0x1e')](function(_0x158d60){logger['error'](_0x2caf('0x1c'),_0x158d60[_0x2caf('0x12')],_0x4a33fc);_0xe72440(_0x3e975f[_0x2caf('0x10')](0x1f4,_0x158d60[_0x2caf('0x12')]));});});};exports[_0x2caf('0x1f')]=function(_0x1f52bf){var _0x3812cd=this;return new Promise(function(_0x524e0c,_0x21b3c4){return db[_0x2caf('0x14')]['find']({'raw':_0x1f52bf[_0x2caf('0x15')]?_0x1f52bf[_0x2caf('0x15')][_0x2caf('0x16')]===undefined?!![]:![]:!![],'where':_0x1f52bf['options']?_0x1f52bf[_0x2caf('0x15')]['where']||null:null,'attributes':_0x1f52bf['options']?_0x1f52bf[_0x2caf('0x15')][_0x2caf('0x17')]||null:null,'include':_0x1f52bf[_0x2caf('0x15')]?_0x1f52bf[_0x2caf('0x15')][_0x2caf('0x19')]?_[_0x2caf('0x1a')](_0x1f52bf[_0x2caf('0x15')][_0x2caf('0x19')],function(_0x20818e){return{'model':db[_0x20818e['model']],'as':_0x20818e['as'],'attributes':_0x20818e[_0x2caf('0x17')],'include':_0x20818e[_0x2caf('0x19')]?_[_0x2caf('0x1a')](_0x20818e[_0x2caf('0x19')],function(_0x17c1b4){return{'model':db[_0x17c1b4[_0x2caf('0x1b')]],'as':_0x17c1b4['as'],'attributes':_0x17c1b4[_0x2caf('0x17')],'include':_0x17c1b4[_0x2caf('0x19')]?_[_0x2caf('0x1a')](_0x17c1b4[_0x2caf('0x19')],function(_0x105ec7){return{'model':db[_0x105ec7[_0x2caf('0x1b')]],'as':_0x105ec7['as'],'attributes':_0x105ec7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x410020){logger[_0x2caf('0xb')](_0x2caf('0x1f'),_0x1f52bf);logger[_0x2caf('0xe')]('ShowFreshsalesAccount',_0x1f52bf,JSON[_0x2caf('0x1d')](_0x410020));_0x524e0c(_0x410020);})[_0x2caf('0x1e')](function(_0x4568f9){logger[_0x2caf('0x10')](_0x2caf('0x1f'),_0x4568f9[_0x2caf('0x12')],_0x1f52bf);_0x21b3c4(_0x3812cd[_0x2caf('0x10')](0x1f4,_0x4568f9[_0x2caf('0x12')]));});});}; \ No newline at end of file +var _0x160f=['../../config/environment','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','limit','include','map','model','attributes','find','ShowFreshsalesAccount','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));var BPromise=require(_0xf160('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf160('0x4'));var db=require(_0xf160('0x5'))['db'];var utils=require(_0xf160('0x6'));var logger=require(_0xf160('0x7'))(_0xf160('0x8'));var config=require(_0xf160('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf160('0xa')][_0xf160('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49fe49,_0x59440e,_0x41e909){return new BPromise(function(_0x5b76c8,_0x4bf890){return client['request'](_0x49fe49,_0x41e909)[_0xf160('0xc')](function(_0x90608){logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,'request\x20sent');logger['debug'](_0xf160('0xf'),_0x59440e,_0xf160('0x10'),JSON[_0xf160('0x11')](_0x90608));if(_0x90608['error']){if(_0x90608[_0xf160('0x12')][_0xf160('0x13')]===0x1f4){logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')]['message']);return _0x4bf890(_0x90608[_0xf160('0x12')]['message']);}logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')][_0xf160('0x14')]);return _0x5b76c8(_0x90608[_0xf160('0x12')][_0xf160('0x14')]);}else{logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,_0xf160('0x10'));_0x5b76c8(_0x90608['result'][_0xf160('0x14')]);}})[_0xf160('0x15')](function(_0x8699a0){logger[_0xf160('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x59440e,_0x8699a0);_0x4bf890(_0x8699a0);});});}exports[_0xf160('0x16')]=function(_0x4b8185){var _0x5388c7=this;return new Promise(function(_0x1cf6ba,_0x1e0c78){return db[_0xf160('0x17')][_0xf160('0x18')]({'raw':_0x4b8185[_0xf160('0x19')]?_0x4b8185[_0xf160('0x19')][_0xf160('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b8185[_0xf160('0x19')]?_0x4b8185['options'][_0xf160('0x1b')]||null:null,'attributes':_0x4b8185[_0xf160('0x19')]?_0x4b8185[_0xf160('0x19')]['attributes']||null:null,'limit':_0x4b8185[_0xf160('0x19')]?_0x4b8185[_0xf160('0x19')][_0xf160('0x1c')]||null:null,'include':_0x4b8185[_0xf160('0x19')]?_0x4b8185[_0xf160('0x19')][_0xf160('0x1d')]?_[_0xf160('0x1e')](_0x4b8185['options'][_0xf160('0x1d')],function(_0x28bf27){return{'model':db[_0x28bf27[_0xf160('0x1f')]],'as':_0x28bf27['as'],'attributes':_0x28bf27[_0xf160('0x20')],'include':_0x28bf27['include']?_[_0xf160('0x1e')](_0x28bf27[_0xf160('0x1d')],function(_0x4a8003){return{'model':db[_0x4a8003['model']],'as':_0x4a8003['as'],'attributes':_0x4a8003[_0xf160('0x20')],'include':_0x4a8003[_0xf160('0x1d')]?_[_0xf160('0x1e')](_0x4a8003['include'],function(_0xcfa9bd){return{'model':db[_0xcfa9bd[_0xf160('0x1f')]],'as':_0xcfa9bd['as'],'attributes':_0xcfa9bd[_0xf160('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf160('0xc')](function(_0x135e0f){logger[_0xf160('0xd')]('GetFreshsalesAccount',_0x4b8185);logger['debug']('GetFreshsalesAccount',_0x4b8185,JSON[_0xf160('0x11')](_0x135e0f));_0x1cf6ba(_0x135e0f);})[_0xf160('0x15')](function(_0xcaab39){logger[_0xf160('0x12')](_0xf160('0x16'),_0xcaab39['message'],_0x4b8185);_0x1e0c78(_0x5388c7['error'](0x1f4,_0xcaab39[_0xf160('0x14')]));});});};exports['ShowFreshsalesAccount']=function(_0x4ce478){var _0x22c2e3=this;return new Promise(function(_0x3a35b3,_0x5497f6){return db[_0xf160('0x17')][_0xf160('0x21')]({'raw':_0x4ce478['options']?_0x4ce478['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ce478['options']?_0x4ce478[_0xf160('0x19')][_0xf160('0x1b')]||null:null,'attributes':_0x4ce478[_0xf160('0x19')]?_0x4ce478[_0xf160('0x19')][_0xf160('0x20')]||null:null,'include':_0x4ce478[_0xf160('0x19')]?_0x4ce478['options']['include']?_['map'](_0x4ce478[_0xf160('0x19')]['include'],function(_0x5c65d2){return{'model':db[_0x5c65d2[_0xf160('0x1f')]],'as':_0x5c65d2['as'],'attributes':_0x5c65d2[_0xf160('0x20')],'include':_0x5c65d2['include']?_[_0xf160('0x1e')](_0x5c65d2[_0xf160('0x1d')],function(_0x272efe){return{'model':db[_0x272efe[_0xf160('0x1f')]],'as':_0x272efe['as'],'attributes':_0x272efe[_0xf160('0x20')],'include':_0x272efe['include']?_[_0xf160('0x1e')](_0x272efe[_0xf160('0x1d')],function(_0x15070a){return{'model':db[_0x15070a['model']],'as':_0x15070a['as'],'attributes':_0x15070a[_0xf160('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf160('0xc')](function(_0x1e4bd6){logger[_0xf160('0xd')](_0xf160('0x22'),_0x4ce478);logger[_0xf160('0x23')]('ShowFreshsalesAccount',_0x4ce478,JSON['stringify'](_0x1e4bd6));_0x3a35b3(_0x1e4bd6);})[_0xf160('0x15')](function(_0x21c248){logger[_0xf160('0x12')](_0xf160('0x22'),_0x21c248[_0xf160('0x14')],_0x4ce478);_0x5497f6(_0x22c2e3[_0xf160('0x12')](0x1f4,_0x21c248[_0xf160('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 4759929..283d9bd 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 _0x21fa=['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','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','create'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x21fa,0x13d));var _0xa21f=function(_0x67075b,_0x599290){_0x67075b=_0x67075b-0x0;var _0xccc997=_0x21fa[_0x67075b];return _0xccc997;};'use strict';var multer=require(_0xa21f('0x0'));var util=require(_0xa21f('0x1'));var path=require(_0xa21f('0x2'));var timeout=require(_0xa21f('0x3'));var express=require('express');var router=express[_0xa21f('0x4')]();var fs_extra=require(_0xa21f('0x5'));var auth=require(_0xa21f('0x6'));var interaction=require(_0xa21f('0x7'));var config=require(_0xa21f('0x8'));var controller=require(_0xa21f('0x9'));router[_0xa21f('0xa')]('/',auth[_0xa21f('0xb')](),controller[_0xa21f('0xc')]);router[_0xa21f('0xa')](_0xa21f('0xd'),auth[_0xa21f('0xb')](),controller['show']);router['get'](_0xa21f('0xe'),auth['isAuthenticated'](),controller[_0xa21f('0xf')]);router[_0xa21f('0xa')](_0xa21f('0x10'),auth[_0xa21f('0xb')](),controller[_0xa21f('0x11')]);router['get'](_0xa21f('0x12'),auth[_0xa21f('0xb')](),controller[_0xa21f('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa21f('0x14')]);router[_0xa21f('0x15')]('/:id',auth[_0xa21f('0xb')](),controller[_0xa21f('0x16')]);router[_0xa21f('0x17')](_0xa21f('0xd'),auth[_0xa21f('0xb')](),controller[_0xa21f('0x18')]);module[_0xa21f('0x19')]=router; \ No newline at end of file +var _0xe30f=['./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id','show','getSubjects','/:id/fields','getFields','post','create','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4d5371,_0x4ff8ff){var _0x4a3140=function(_0x276f3a){while(--_0x276f3a){_0x4d5371['push'](_0x4d5371['shift']());}};_0x4a3140(++_0x4ff8ff);}(_0xe30f,0x1dc));var _0xfe30=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xe30f[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0xfe30('0x0'));var util=require(_0xfe30('0x1'));var path=require('path');var timeout=require(_0xfe30('0x2'));var express=require(_0xfe30('0x3'));var router=express[_0xfe30('0x4')]();var fs_extra=require(_0xfe30('0x5'));var auth=require(_0xfe30('0x6'));var interaction=require(_0xfe30('0x7'));var config=require('../../config/environment');var controller=require(_0xfe30('0x8'));router['get']('/',auth[_0xfe30('0x9')](),controller[_0xfe30('0xa')]);router[_0xfe30('0xb')](_0xfe30('0xc'),auth[_0xfe30('0x9')](),controller[_0xfe30('0xd')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xfe30('0xe')]);router[_0xfe30('0xb')]('/:id/descriptions',auth[_0xfe30('0x9')](),controller['getDescriptions']);router[_0xfe30('0xb')](_0xfe30('0xf'),auth[_0xfe30('0x9')](),controller[_0xfe30('0x10')]);router[_0xfe30('0x11')]('/',auth[_0xfe30('0x9')](),controller[_0xfe30('0x12')]);router['put']('/:id',auth[_0xfe30('0x9')](),controller[_0xfe30('0x13')]);router[_0xfe30('0x14')](_0xfe30('0xc'),auth[_0xfe30('0x9')](),controller['destroy']);module[_0xfe30('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 76b828f..46e7960 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 _0x45fb=['STRING','sequelize'];(function(_0xefb4e,_0xe56689){var _0x36c78c=function(_0x158fe3){while(--_0x158fe3){_0xefb4e['push'](_0xefb4e['shift']());}};_0x36c78c(++_0xe56689);}(_0x45fb,0x1db));var _0xb45f=function(_0x2c40ab,_0xeaf544){_0x2c40ab=_0x2c40ab-0x0;var _0xc66491=_0x45fb[_0x2c40ab];return _0xc66491;};'use strict';var Sequelize=require(_0xb45f('0x0'));module['exports']={'name':{'type':Sequelize[_0xb45f('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x31ca=['exports','STRING'];(function(_0x4094c5,_0x4b16ce){var _0x38e6bb=function(_0x4cec23){while(--_0x4cec23){_0x4094c5['push'](_0x4094c5['shift']());}};_0x38e6bb(++_0x4b16ce);}(_0x31ca,0x82));var _0xa31c=function(_0x5ee5f7,_0x48b1df){_0x5ee5f7=_0x5ee5f7-0x0;var _0x399ac0=_0x31ca[_0x5ee5f7];return _0x399ac0;};'use strict';var Sequelize=require('sequelize');module[_0xa31c('0x0')]={'name':{'type':Sequelize[_0xa31c('0x1')]},'description':{'type':Sequelize[_0xa31c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 81c3323..41a46a7 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 _0x69f8=['order','filter','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','set','json','reject','save','then','sendStatus','name','send','map','FreshsalesConfiguration','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','merge','type','includeAll','include','findAll','rows','catch','show','options','create','body','update','find','destroy','params','getSubjects','FreshsalesField'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x69f8,0xf1));var _0x869f=function(_0x4855f3,_0xfc0b55){_0x4855f3=_0x4855f3-0x0;var _0x3884e4=_0x69f8[_0x4855f3];return _0x3884e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x869f('0x0'));var zipdir=require(_0x869f('0x1'));var jsonpatch=require(_0x869f('0x2'));var rp=require('request-promise');var moment=require(_0x869f('0x3'));var BPromise=require(_0x869f('0x4'));var Mustache=require(_0x869f('0x5'));var util=require(_0x869f('0x6'));var path=require(_0x869f('0x7'));var sox=require(_0x869f('0x8'));var csv=require('to-csv');var ejs=require(_0x869f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x869f('0xa'));var squel=require(_0x869f('0xb'));var crypto=require(_0x869f('0xc'));var jsforce=require(_0x869f('0xd'));var deskjs=require(_0x869f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x869f('0xf'));var Papa=require(_0x869f('0x10'));var Redis=require(_0x869f('0x11'));var authService=require(_0x869f('0x12'));var qs=require(_0x869f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x869f('0x14'));var logger=require(_0x869f('0x15'))(_0x869f('0x16'));var utils=require(_0x869f('0x17'));var config=require(_0x869f('0x18'));var licenseUtil=require(_0x869f('0x19'));var db=require(_0x869f('0x1a'))['db'];function respondWithStatusCode(_0x586dc9,_0x419c30){_0x419c30=_0x419c30||0xcc;return function(_0x438cf8){if(_0x438cf8){return _0x586dc9['sendStatus'](_0x419c30);}return _0x586dc9[_0x869f('0x1b')](_0x419c30)[_0x869f('0x1c')]();};}function respondWithResult(_0x45d921,_0x55230b){_0x55230b=_0x55230b||0xc8;return function(_0x3396d3){if(_0x3396d3){return _0x45d921[_0x869f('0x1b')](_0x55230b)['json'](_0x3396d3);}};}function respondWithFilteredResult(_0x1cf3cc,_0x28c5c0){return function(_0x74b50f){if(_0x74b50f){var _0x104989=typeof _0x28c5c0['offset']===_0x869f('0x1d')&&typeof _0x28c5c0[_0x869f('0x1e')]===_0x869f('0x1d');var _0x24c869=_0x74b50f[_0x869f('0x1f')];var _0x114db7=_0x104989?0x0:_0x28c5c0['offset'];var _0x50d37c=_0x104989?_0x74b50f[_0x869f('0x1f')]:_0x28c5c0['offset']+_0x28c5c0[_0x869f('0x1e')];var _0x41cfa5;if(_0x50d37c>=_0x24c869){_0x50d37c=_0x24c869;_0x41cfa5=0xc8;}else{_0x41cfa5=0xce;}_0x1cf3cc[_0x869f('0x1b')](_0x41cfa5);return _0x1cf3cc[_0x869f('0x20')]('Content-Range',_0x114db7+'-'+_0x50d37c+'/'+_0x24c869)[_0x869f('0x21')](_0x74b50f);}return null;};}function patchUpdates(_0x7bee3){return function(_0x1f1109){try{jsonpatch['apply'](_0x1f1109,_0x7bee3,!![]);}catch(_0x359fe5){return BPromise[_0x869f('0x22')](_0x359fe5);}return _0x1f1109[_0x869f('0x23')]();};}function saveUpdates(_0x5255ba,_0x59706a){return function(_0x3cc575){if(_0x3cc575){return _0x3cc575['update'](_0x5255ba)[_0x869f('0x24')](function(_0x1a0395){return _0x1a0395;});}return null;};}function removeEntity(_0x42b05c,_0x734fee){return function(_0x7b0512){if(_0x7b0512){return _0x7b0512['destroy']()['then'](function(){_0x42b05c[_0x869f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x208e3c,_0x53598e){return function(_0x3a70bd){if(!_0x3a70bd){_0x208e3c[_0x869f('0x25')](0x194);}return _0x3a70bd;};}function handleError(_0x1695d2,_0x27597e){_0x27597e=_0x27597e||0x1f4;return function(_0x3f493d){logger['error'](_0x3f493d['stack']);if(_0x3f493d[_0x869f('0x26')]){delete _0x3f493d['name'];}_0x1695d2[_0x869f('0x1b')](_0x27597e)[_0x869f('0x27')](_0x3f493d);};}exports['index']=function(_0x2cab6f,_0x52166){var _0x29771d={},_0x2efda7={},_0x3b4bb9={'count':0x0,'rows':[]};var _0x44741d=_[_0x869f('0x28')](db[_0x869f('0x29')][_0x869f('0x2a')],function(_0x4c0fc4){return{'name':_0x4c0fc4['fieldName'],'type':_0x4c0fc4['type'][_0x869f('0x2b')]};});_0x2efda7['model']=_[_0x869f('0x28')](_0x44741d,_0x869f('0x26'));_0x2efda7[_0x869f('0x2c')]=_[_0x869f('0x2d')](_0x2cab6f['query']);_0x2efda7[_0x869f('0x2e')]=_[_0x869f('0x2f')](_0x2efda7[_0x869f('0x30')],_0x2efda7[_0x869f('0x2c')]);_0x29771d[_0x869f('0x31')]=_[_0x869f('0x2f')](_0x2efda7[_0x869f('0x30')],qs[_0x869f('0x32')](_0x2cab6f[_0x869f('0x2c')][_0x869f('0x32')]));_0x29771d['attributes']=_0x29771d[_0x869f('0x31')][_0x869f('0x33')]?_0x29771d['attributes']:_0x2efda7[_0x869f('0x30')];if(!_0x2cab6f[_0x869f('0x2c')][_0x869f('0x34')](_0x869f('0x35'))){_0x29771d['limit']=qs[_0x869f('0x1e')](_0x2cab6f[_0x869f('0x2c')][_0x869f('0x1e')]);_0x29771d[_0x869f('0x36')]=qs[_0x869f('0x36')](_0x2cab6f['query']['offset']);}_0x29771d['order']=qs[_0x869f('0x37')](_0x2cab6f[_0x869f('0x2c')]['sort']);_0x29771d[_0x869f('0x38')]=qs[_0x869f('0x2e')](_[_0x869f('0x39')](_0x2cab6f[_0x869f('0x2c')],_0x2efda7['filters']),_0x44741d);if(_0x2cab6f[_0x869f('0x2c')]['filter']){_0x29771d['where']=_[_0x869f('0x3a')](_0x29771d[_0x869f('0x38')],{'$or':_['map'](_0x44741d,function(_0x3e30b4){if(_0x3e30b4[_0x869f('0x3b')]!=='VIRTUAL'){var _0x521cf0={};_0x521cf0[_0x3e30b4[_0x869f('0x26')]]={'$like':'%'+_0x2cab6f['query']['filter']+'%'};return _0x521cf0;}})});}_0x29771d=_[_0x869f('0x3a')]({},_0x29771d,_0x2cab6f['options']);var _0x12459a={'where':_0x29771d['where']};return db[_0x869f('0x29')][_0x869f('0x1f')](_0x12459a)['then'](function(_0x58f3b1){_0x3b4bb9[_0x869f('0x1f')]=_0x58f3b1;if(_0x2cab6f['query'][_0x869f('0x3c')]){_0x29771d[_0x869f('0x3d')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x869f('0x3e')](_0x29771d);})['then'](function(_0x364c2e){_0x3b4bb9[_0x869f('0x3f')]=_0x364c2e;return _0x3b4bb9;})[_0x869f('0x24')](respondWithFilteredResult(_0x52166,_0x29771d))[_0x869f('0x40')](handleError(_0x52166,null));};exports[_0x869f('0x41')]=function(_0x46fc6b,_0x18ad5e){var _0x10f8dc={'raw':![],'where':{'id':_0x46fc6b['params']['id']}},_0x2ce6a3={};_0x2ce6a3['model']=_[_0x869f('0x2d')](db[_0x869f('0x29')]['rawAttributes']);_0x2ce6a3['query']=_[_0x869f('0x2d')](_0x46fc6b[_0x869f('0x2c')]);_0x2ce6a3[_0x869f('0x2e')]=_[_0x869f('0x2f')](_0x2ce6a3[_0x869f('0x30')],_0x2ce6a3[_0x869f('0x2c')]);_0x10f8dc['attributes']=_['intersection'](_0x2ce6a3[_0x869f('0x30')],qs[_0x869f('0x32')](_0x46fc6b[_0x869f('0x2c')]['fields']));_0x10f8dc['attributes']=_0x10f8dc[_0x869f('0x31')][_0x869f('0x33')]?_0x10f8dc[_0x869f('0x31')]:_0x2ce6a3[_0x869f('0x30')];if(_0x46fc6b['query']['includeAll']){_0x10f8dc[_0x869f('0x3d')]=[{'all':!![]}];}_0x10f8dc=_[_0x869f('0x3a')]({},_0x10f8dc,_0x46fc6b[_0x869f('0x42')]);return db[_0x869f('0x29')]['find'](_0x10f8dc)[_0x869f('0x24')](handleEntityNotFound(_0x18ad5e,null))['then'](respondWithResult(_0x18ad5e,null))[_0x869f('0x40')](handleError(_0x18ad5e,null));};exports[_0x869f('0x43')]=function(_0x4faeff,_0xbef5aa){return db[_0x869f('0x29')][_0x869f('0x43')](_0x4faeff[_0x869f('0x44')],{})[_0x869f('0x24')](respondWithResult(_0xbef5aa,0xc9))['catch'](handleError(_0xbef5aa,null));};exports[_0x869f('0x45')]=function(_0x389dc6,_0x4fb530){if(_0x389dc6[_0x869f('0x44')]['id']){delete _0x389dc6[_0x869f('0x44')]['id'];}return db[_0x869f('0x29')][_0x869f('0x46')]({'where':{'id':_0x389dc6['params']['id']}})['then'](handleEntityNotFound(_0x4fb530,null))['then'](saveUpdates(_0x389dc6[_0x869f('0x44')],null))[_0x869f('0x24')](respondWithResult(_0x4fb530,null))['catch'](handleError(_0x4fb530,null));};exports[_0x869f('0x47')]=function(_0x1c0acc,_0x38823d){return db[_0x869f('0x29')]['find']({'where':{'id':_0x1c0acc[_0x869f('0x48')]['id']}})[_0x869f('0x24')](handleEntityNotFound(_0x38823d,null))[_0x869f('0x24')](removeEntity(_0x38823d,null))[_0x869f('0x40')](handleError(_0x38823d,null));};exports[_0x869f('0x49')]=function(_0x103f69,_0x596cd7,_0x112fbc){var _0x576172={};var _0x2e1bed={};var _0x55267f;var _0x4dd31b;return db[_0x869f('0x29')]['findOne']({'where':{'id':_0x103f69[_0x869f('0x48')]['id']}})['then'](handleEntityNotFound(_0x596cd7,null))['then'](function(_0x5aa8cf){if(_0x5aa8cf){_0x55267f=_0x5aa8cf;_0x2e1bed['model']=_['keys'](db[_0x869f('0x4a')][_0x869f('0x2a')]);_0x2e1bed[_0x869f('0x2c')]=_[_0x869f('0x2d')](_0x103f69[_0x869f('0x2c')]);_0x2e1bed[_0x869f('0x2e')]=_[_0x869f('0x2f')](_0x2e1bed['model'],_0x2e1bed[_0x869f('0x2c')]);_0x576172[_0x869f('0x31')]=_[_0x869f('0x2f')](_0x2e1bed['model'],qs[_0x869f('0x32')](_0x103f69[_0x869f('0x2c')][_0x869f('0x32')]));_0x576172[_0x869f('0x31')]=_0x576172[_0x869f('0x31')][_0x869f('0x33')]?_0x576172['attributes']:_0x2e1bed['model'];_0x576172[_0x869f('0x4b')]=qs[_0x869f('0x37')](_0x103f69['query'][_0x869f('0x37')]);_0x576172[_0x869f('0x38')]=qs[_0x869f('0x2e')](_[_0x869f('0x39')](_0x103f69[_0x869f('0x2c')],_0x2e1bed[_0x869f('0x2e')]));if(_0x103f69[_0x869f('0x2c')][_0x869f('0x4c')]){_0x576172['where']=_[_0x869f('0x3a')](_0x576172['where'],{'$or':_[_0x869f('0x28')](_0x576172[_0x869f('0x31')],function(_0x20d120){var _0xac55d4={};_0xac55d4[_0x20d120]={'$like':'%'+_0x103f69[_0x869f('0x2c')][_0x869f('0x4c')]+'%'};return _0xac55d4;})});}_0x576172=_[_0x869f('0x3a')]({},_0x576172,_0x103f69[_0x869f('0x42')]);return _0x55267f[_0x869f('0x49')](_0x576172);}})[_0x869f('0x24')](function(_0x4f0915){if(_0x4f0915){_0x4dd31b=_0x4f0915[_0x869f('0x33')];if(!_0x103f69[_0x869f('0x2c')]['hasOwnProperty'](_0x869f('0x35'))){_0x576172[_0x869f('0x1e')]=qs[_0x869f('0x1e')](_0x103f69[_0x869f('0x2c')]['limit']);_0x576172[_0x869f('0x36')]=qs[_0x869f('0x36')](_0x103f69[_0x869f('0x2c')][_0x869f('0x36')]);}return _0x55267f[_0x869f('0x49')](_0x576172);}})[_0x869f('0x24')](function(_0x227bd8){if(_0x227bd8){return _0x227bd8?{'count':_0x4dd31b,'rows':_0x227bd8}:null;}})[_0x869f('0x24')](respondWithResult(_0x596cd7,null))[_0x869f('0x40')](handleError(_0x596cd7,null));};exports['getDescriptions']=function(_0x5129e3,_0x30404e,_0x29b0ae){var _0x549e06={};var _0x154abf={};var _0x5ab1d0;var _0x5a6e74;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x5129e3[_0x869f('0x48')]['id']}})['then'](handleEntityNotFound(_0x30404e,null))[_0x869f('0x24')](function(_0x4c7158){if(_0x4c7158){_0x5ab1d0=_0x4c7158;_0x154abf[_0x869f('0x30')]=_['keys'](db['FreshsalesField'][_0x869f('0x2a')]);_0x154abf['query']=_['keys'](_0x5129e3[_0x869f('0x2c')]);_0x154abf[_0x869f('0x2e')]=_[_0x869f('0x2f')](_0x154abf[_0x869f('0x30')],_0x154abf[_0x869f('0x2c')]);_0x549e06[_0x869f('0x31')]=_[_0x869f('0x2f')](_0x154abf[_0x869f('0x30')],qs['fields'](_0x5129e3[_0x869f('0x2c')][_0x869f('0x32')]));_0x549e06['attributes']=_0x549e06['attributes']['length']?_0x549e06[_0x869f('0x31')]:_0x154abf[_0x869f('0x30')];_0x549e06[_0x869f('0x4b')]=qs['sort'](_0x5129e3[_0x869f('0x2c')][_0x869f('0x37')]);_0x549e06['where']=qs['filters'](_[_0x869f('0x39')](_0x5129e3[_0x869f('0x2c')],_0x154abf[_0x869f('0x2e')]));if(_0x5129e3[_0x869f('0x2c')][_0x869f('0x4c')]){_0x549e06['where']=_['merge'](_0x549e06[_0x869f('0x38')],{'$or':_[_0x869f('0x28')](_0x549e06[_0x869f('0x31')],function(_0x5bf288){var _0x502078={};_0x502078[_0x5bf288]={'$like':'%'+_0x5129e3[_0x869f('0x2c')][_0x869f('0x4c')]+'%'};return _0x502078;})});}_0x549e06=_[_0x869f('0x3a')]({},_0x549e06,_0x5129e3['options']);return _0x5ab1d0['getDescriptions'](_0x549e06);}})[_0x869f('0x24')](function(_0xfa89bd){if(_0xfa89bd){_0x5a6e74=_0xfa89bd[_0x869f('0x33')];if(!_0x5129e3[_0x869f('0x2c')][_0x869f('0x34')](_0x869f('0x35'))){_0x549e06[_0x869f('0x1e')]=qs[_0x869f('0x1e')](_0x5129e3[_0x869f('0x2c')][_0x869f('0x1e')]);_0x549e06['offset']=qs[_0x869f('0x36')](_0x5129e3[_0x869f('0x2c')][_0x869f('0x36')]);}return _0x5ab1d0[_0x869f('0x4d')](_0x549e06);}})['then'](function(_0x5031e6){if(_0x5031e6){return _0x5031e6?{'count':_0x5a6e74,'rows':_0x5031e6}:null;}})[_0x869f('0x24')](respondWithResult(_0x30404e,null))['catch'](handleError(_0x30404e,null));};exports[_0x869f('0x4e')]=function(_0x68b53c,_0x1ec10f,_0x2c4c8b){var _0x43fe7c={};var _0xd677={};var _0x23ae99;var _0x433016;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x68b53c['params']['id']}})[_0x869f('0x24')](handleEntityNotFound(_0x1ec10f,null))['then'](function(_0x117591){if(_0x117591){_0x23ae99=_0x117591;_0xd677[_0x869f('0x30')]=_[_0x869f('0x2d')](db[_0x869f('0x4a')][_0x869f('0x2a')]);_0xd677[_0x869f('0x2c')]=_[_0x869f('0x2d')](_0x68b53c[_0x869f('0x2c')]);_0xd677[_0x869f('0x2e')]=_[_0x869f('0x2f')](_0xd677['model'],_0xd677[_0x869f('0x2c')]);_0x43fe7c[_0x869f('0x31')]=_[_0x869f('0x2f')](_0xd677[_0x869f('0x30')],qs['fields'](_0x68b53c[_0x869f('0x2c')]['fields']));_0x43fe7c[_0x869f('0x31')]=_0x43fe7c[_0x869f('0x31')][_0x869f('0x33')]?_0x43fe7c['attributes']:_0xd677[_0x869f('0x30')];_0x43fe7c[_0x869f('0x4b')]=qs[_0x869f('0x37')](_0x68b53c[_0x869f('0x2c')][_0x869f('0x37')]);_0x43fe7c[_0x869f('0x38')]=qs[_0x869f('0x2e')](_[_0x869f('0x39')](_0x68b53c[_0x869f('0x2c')],_0xd677[_0x869f('0x2e')]));if(_0x68b53c[_0x869f('0x2c')][_0x869f('0x4c')]){_0x43fe7c[_0x869f('0x38')]=_['merge'](_0x43fe7c[_0x869f('0x38')],{'$or':_['map'](_0x43fe7c[_0x869f('0x31')],function(_0x350c78){var _0x5dea6a={};_0x5dea6a[_0x350c78]={'$like':'%'+_0x68b53c[_0x869f('0x2c')][_0x869f('0x4c')]+'%'};return _0x5dea6a;})});}_0x43fe7c=_[_0x869f('0x3a')]({},_0x43fe7c,_0x68b53c['options']);return _0x23ae99[_0x869f('0x4e')](_0x43fe7c);}})['then'](function(_0x514f14){if(_0x514f14){_0x433016=_0x514f14[_0x869f('0x33')];if(!_0x68b53c[_0x869f('0x2c')][_0x869f('0x34')](_0x869f('0x35'))){_0x43fe7c[_0x869f('0x1e')]=qs[_0x869f('0x1e')](_0x68b53c['query'][_0x869f('0x1e')]);_0x43fe7c['offset']=qs[_0x869f('0x36')](_0x68b53c[_0x869f('0x2c')][_0x869f('0x36')]);}return _0x23ae99['getFields'](_0x43fe7c);}})[_0x869f('0x24')](function(_0x30b185){if(_0x30b185){return _0x30b185?{'count':_0x433016,'rows':_0x30b185}:null;}})[_0x869f('0x24')](respondWithResult(_0x1ec10f,null))[_0x869f('0x40')](handleError(_0x1ec10f,null));}; \ No newline at end of file +var _0x44e6=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','getSubjects','findOne','FreshsalesField','nolimit','getDescriptions','map','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x43350b,_0xa7d264){var _0x3b1040=function(_0x158b15){while(--_0x158b15){_0x43350b['push'](_0x43350b['shift']());}};_0x3b1040(++_0xa7d264);}(_0x44e6,0xda));var _0x644e=function(_0x497c20,_0x545240){_0x497c20=_0x497c20-0x0;var _0x2ee140=_0x44e6[_0x497c20];return _0x2ee140;};'use strict';var emlformat=require(_0x644e('0x0'));var rimraf=require(_0x644e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x644e('0x2'));var rp=require(_0x644e('0x3'));var moment=require(_0x644e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x644e('0x5'));var util=require('util');var path=require(_0x644e('0x6'));var sox=require('sox');var csv=require(_0x644e('0x7'));var ejs=require(_0x644e('0x8'));var fs=require('fs');var fs_extra=require(_0x644e('0x9'));var _=require('lodash');var squel=require(_0x644e('0xa'));var crypto=require('crypto');var jsforce=require(_0x644e('0xb'));var deskjs=require(_0x644e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x644e('0xd'));var Papa=require('papaparse');var Redis=require(_0x644e('0xe'));var authService=require(_0x644e('0xf'));var qs=require(_0x644e('0x10'));var as=require(_0x644e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x644e('0x12'));var utils=require(_0x644e('0x13'));var config=require(_0x644e('0x14'));var licenseUtil=require(_0x644e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c6d47,_0x2c19b6){_0x2c19b6=_0x2c19b6||0xcc;return function(_0x42b284){if(_0x42b284){return _0x5c6d47[_0x644e('0x16')](_0x2c19b6);}return _0x5c6d47[_0x644e('0x17')](_0x2c19b6)[_0x644e('0x18')]();};}function respondWithResult(_0x2111be,_0x63f2fe){_0x63f2fe=_0x63f2fe||0xc8;return function(_0x1b9495){if(_0x1b9495){return _0x2111be[_0x644e('0x17')](_0x63f2fe)[_0x644e('0x19')](_0x1b9495);}};}function respondWithFilteredResult(_0xa109f5,_0x23d16f){return function(_0x3a7b68){if(_0x3a7b68){var _0x381532=typeof _0x23d16f[_0x644e('0x1a')]===_0x644e('0x1b')&&typeof _0x23d16f['limit']===_0x644e('0x1b');var _0x4470b9=_0x3a7b68[_0x644e('0x1c')];var _0x5c2373=_0x381532?0x0:_0x23d16f[_0x644e('0x1a')];var _0x37910b=_0x381532?_0x3a7b68['count']:_0x23d16f[_0x644e('0x1a')]+_0x23d16f[_0x644e('0x1d')];var _0x5507e2;if(_0x37910b>=_0x4470b9){_0x37910b=_0x4470b9;_0x5507e2=0xc8;}else{_0x5507e2=0xce;}_0xa109f5['status'](_0x5507e2);return _0xa109f5[_0x644e('0x1e')](_0x644e('0x1f'),_0x5c2373+'-'+_0x37910b+'/'+_0x4470b9)[_0x644e('0x19')](_0x3a7b68);}return null;};}function patchUpdates(_0x42cfd7){return function(_0x4cca91){try{jsonpatch[_0x644e('0x20')](_0x4cca91,_0x42cfd7,!![]);}catch(_0x34d565){return BPromise[_0x644e('0x21')](_0x34d565);}return _0x4cca91[_0x644e('0x22')]();};}function saveUpdates(_0x636e9,_0x8ddfde){return function(_0x18687e){if(_0x18687e){return _0x18687e[_0x644e('0x23')](_0x636e9)[_0x644e('0x24')](function(_0x242693){return _0x242693;});}return null;};}function removeEntity(_0x44b847,_0x1e602b){return function(_0x47413a){if(_0x47413a){return _0x47413a[_0x644e('0x25')]()[_0x644e('0x24')](function(){_0x44b847[_0x644e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf0e1d6,_0x5cfb4e){return function(_0x56172d){if(!_0x56172d){_0xf0e1d6[_0x644e('0x16')](0x194);}return _0x56172d;};}function handleError(_0x40332a,_0x216d12){_0x216d12=_0x216d12||0x1f4;return function(_0x131a77){logger['error'](_0x131a77[_0x644e('0x26')]);if(_0x131a77['name']){delete _0x131a77[_0x644e('0x27')];}_0x40332a[_0x644e('0x17')](_0x216d12)[_0x644e('0x28')](_0x131a77);};}exports[_0x644e('0x29')]=function(_0x24b0a3,_0x29cc68){var _0x3d5c87={},_0xab1dfc={},_0x5e362a={'count':0x0,'rows':[]};var _0x4bd805=_['map'](db[_0x644e('0x2a')][_0x644e('0x2b')],function(_0x26dc29){return{'name':_0x26dc29[_0x644e('0x2c')],'type':_0x26dc29['type'][_0x644e('0x2d')]};});_0xab1dfc[_0x644e('0x2e')]=_['map'](_0x4bd805,_0x644e('0x27'));_0xab1dfc[_0x644e('0x2f')]=_[_0x644e('0x30')](_0x24b0a3[_0x644e('0x2f')]);_0xab1dfc[_0x644e('0x31')]=_[_0x644e('0x32')](_0xab1dfc[_0x644e('0x2e')],_0xab1dfc['query']);_0x3d5c87[_0x644e('0x33')]=_[_0x644e('0x32')](_0xab1dfc[_0x644e('0x2e')],qs[_0x644e('0x34')](_0x24b0a3[_0x644e('0x2f')][_0x644e('0x34')]));_0x3d5c87[_0x644e('0x33')]=_0x3d5c87['attributes'][_0x644e('0x35')]?_0x3d5c87[_0x644e('0x33')]:_0xab1dfc[_0x644e('0x2e')];if(!_0x24b0a3[_0x644e('0x2f')][_0x644e('0x36')]('nolimit')){_0x3d5c87[_0x644e('0x1d')]=qs[_0x644e('0x1d')](_0x24b0a3[_0x644e('0x2f')][_0x644e('0x1d')]);_0x3d5c87['offset']=qs[_0x644e('0x1a')](_0x24b0a3[_0x644e('0x2f')][_0x644e('0x1a')]);}_0x3d5c87[_0x644e('0x37')]=qs[_0x644e('0x38')](_0x24b0a3[_0x644e('0x2f')][_0x644e('0x38')]);_0x3d5c87[_0x644e('0x39')]=qs[_0x644e('0x31')](_[_0x644e('0x3a')](_0x24b0a3[_0x644e('0x2f')],_0xab1dfc[_0x644e('0x31')]),_0x4bd805);if(_0x24b0a3[_0x644e('0x2f')][_0x644e('0x3b')]){_0x3d5c87[_0x644e('0x39')]=_[_0x644e('0x3c')](_0x3d5c87['where'],{'$or':_['map'](_0x4bd805,function(_0x4b063b){if(_0x4b063b[_0x644e('0x3d')]!==_0x644e('0x3e')){var _0xf0ae25={};_0xf0ae25[_0x4b063b['name']]={'$like':'%'+_0x24b0a3['query'][_0x644e('0x3b')]+'%'};return _0xf0ae25;}})});}_0x3d5c87=_[_0x644e('0x3c')]({},_0x3d5c87,_0x24b0a3[_0x644e('0x3f')]);var _0x3328e3={'where':_0x3d5c87[_0x644e('0x39')]};return db[_0x644e('0x2a')][_0x644e('0x1c')](_0x3328e3)[_0x644e('0x24')](function(_0x4aade4){_0x5e362a[_0x644e('0x1c')]=_0x4aade4;if(_0x24b0a3[_0x644e('0x2f')][_0x644e('0x40')]){_0x3d5c87['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x644e('0x41')](_0x3d5c87);})[_0x644e('0x24')](function(_0x5761e4){_0x5e362a[_0x644e('0x42')]=_0x5761e4;return _0x5e362a;})['then'](respondWithFilteredResult(_0x29cc68,_0x3d5c87))[_0x644e('0x43')](handleError(_0x29cc68,null));};exports[_0x644e('0x44')]=function(_0xe4018d,_0x28cbaf){var _0x2f156b={'raw':![],'where':{'id':_0xe4018d[_0x644e('0x45')]['id']}},_0x46a46e={};_0x46a46e[_0x644e('0x2e')]=_[_0x644e('0x30')](db[_0x644e('0x2a')][_0x644e('0x2b')]);_0x46a46e[_0x644e('0x2f')]=_[_0x644e('0x30')](_0xe4018d[_0x644e('0x2f')]);_0x46a46e[_0x644e('0x31')]=_['intersection'](_0x46a46e[_0x644e('0x2e')],_0x46a46e['query']);_0x2f156b[_0x644e('0x33')]=_[_0x644e('0x32')](_0x46a46e['model'],qs[_0x644e('0x34')](_0xe4018d[_0x644e('0x2f')][_0x644e('0x34')]));_0x2f156b[_0x644e('0x33')]=_0x2f156b[_0x644e('0x33')][_0x644e('0x35')]?_0x2f156b['attributes']:_0x46a46e[_0x644e('0x2e')];if(_0xe4018d[_0x644e('0x2f')][_0x644e('0x40')]){_0x2f156b[_0x644e('0x46')]=[{'all':!![]}];}_0x2f156b=_[_0x644e('0x3c')]({},_0x2f156b,_0xe4018d[_0x644e('0x3f')]);return db[_0x644e('0x2a')][_0x644e('0x47')](_0x2f156b)[_0x644e('0x24')](handleEntityNotFound(_0x28cbaf,null))[_0x644e('0x24')](respondWithResult(_0x28cbaf,null))[_0x644e('0x43')](handleError(_0x28cbaf,null));};exports[_0x644e('0x48')]=function(_0x2ccfcc,_0x27e1dd){return db[_0x644e('0x2a')][_0x644e('0x48')](_0x2ccfcc[_0x644e('0x49')],{})[_0x644e('0x24')](respondWithResult(_0x27e1dd,0xc9))[_0x644e('0x43')](handleError(_0x27e1dd,null));};exports[_0x644e('0x23')]=function(_0x44133e,_0x2188d3){if(_0x44133e[_0x644e('0x49')]['id']){delete _0x44133e[_0x644e('0x49')]['id'];}return db[_0x644e('0x2a')][_0x644e('0x47')]({'where':{'id':_0x44133e['params']['id']}})[_0x644e('0x24')](handleEntityNotFound(_0x2188d3,null))[_0x644e('0x24')](saveUpdates(_0x44133e[_0x644e('0x49')],null))[_0x644e('0x24')](respondWithResult(_0x2188d3,null))['catch'](handleError(_0x2188d3,null));};exports[_0x644e('0x25')]=function(_0x321005,_0x25ac67){return db[_0x644e('0x2a')]['find']({'where':{'id':_0x321005[_0x644e('0x45')]['id']}})[_0x644e('0x24')](handleEntityNotFound(_0x25ac67,null))[_0x644e('0x24')](removeEntity(_0x25ac67,null))[_0x644e('0x43')](handleError(_0x25ac67,null));};exports[_0x644e('0x4a')]=function(_0xe88617,_0x3fc4cc,_0x12f1d9){var _0x44f2af={};var _0x2cb842={};var _0x187cb6;var _0x16c2ff;return db[_0x644e('0x2a')][_0x644e('0x4b')]({'where':{'id':_0xe88617[_0x644e('0x45')]['id']}})[_0x644e('0x24')](handleEntityNotFound(_0x3fc4cc,null))['then'](function(_0x16910f){if(_0x16910f){_0x187cb6=_0x16910f;_0x2cb842[_0x644e('0x2e')]=_['keys'](db[_0x644e('0x4c')]['rawAttributes']);_0x2cb842[_0x644e('0x2f')]=_[_0x644e('0x30')](_0xe88617[_0x644e('0x2f')]);_0x2cb842[_0x644e('0x31')]=_[_0x644e('0x32')](_0x2cb842[_0x644e('0x2e')],_0x2cb842[_0x644e('0x2f')]);_0x44f2af['attributes']=_['intersection'](_0x2cb842['model'],qs[_0x644e('0x34')](_0xe88617[_0x644e('0x2f')][_0x644e('0x34')]));_0x44f2af[_0x644e('0x33')]=_0x44f2af[_0x644e('0x33')]['length']?_0x44f2af[_0x644e('0x33')]:_0x2cb842[_0x644e('0x2e')];_0x44f2af[_0x644e('0x37')]=qs[_0x644e('0x38')](_0xe88617[_0x644e('0x2f')][_0x644e('0x38')]);_0x44f2af[_0x644e('0x39')]=qs[_0x644e('0x31')](_[_0x644e('0x3a')](_0xe88617[_0x644e('0x2f')],_0x2cb842[_0x644e('0x31')]));if(_0xe88617['query'][_0x644e('0x3b')]){_0x44f2af[_0x644e('0x39')]=_[_0x644e('0x3c')](_0x44f2af[_0x644e('0x39')],{'$or':_['map'](_0x44f2af[_0x644e('0x33')],function(_0x1a10a3){var _0x37c1c5={};_0x37c1c5[_0x1a10a3]={'$like':'%'+_0xe88617[_0x644e('0x2f')][_0x644e('0x3b')]+'%'};return _0x37c1c5;})});}_0x44f2af=_[_0x644e('0x3c')]({},_0x44f2af,_0xe88617[_0x644e('0x3f')]);return _0x187cb6[_0x644e('0x4a')](_0x44f2af);}})['then'](function(_0x52747b){if(_0x52747b){_0x16c2ff=_0x52747b[_0x644e('0x35')];if(!_0xe88617[_0x644e('0x2f')][_0x644e('0x36')](_0x644e('0x4d'))){_0x44f2af[_0x644e('0x1d')]=qs[_0x644e('0x1d')](_0xe88617[_0x644e('0x2f')][_0x644e('0x1d')]);_0x44f2af[_0x644e('0x1a')]=qs[_0x644e('0x1a')](_0xe88617[_0x644e('0x2f')][_0x644e('0x1a')]);}return _0x187cb6[_0x644e('0x4a')](_0x44f2af);}})[_0x644e('0x24')](function(_0x2ff73f){if(_0x2ff73f){return _0x2ff73f?{'count':_0x16c2ff,'rows':_0x2ff73f}:null;}})[_0x644e('0x24')](respondWithResult(_0x3fc4cc,null))[_0x644e('0x43')](handleError(_0x3fc4cc,null));};exports[_0x644e('0x4e')]=function(_0x7453a,_0x277c8d,_0x52d6bb){var _0x3561f4={};var _0x875ca9={};var _0x4f1149;var _0x15b137;return db['FreshsalesConfiguration'][_0x644e('0x4b')]({'where':{'id':_0x7453a[_0x644e('0x45')]['id']}})[_0x644e('0x24')](handleEntityNotFound(_0x277c8d,null))['then'](function(_0x4c19e9){if(_0x4c19e9){_0x4f1149=_0x4c19e9;_0x875ca9[_0x644e('0x2e')]=_[_0x644e('0x30')](db[_0x644e('0x4c')][_0x644e('0x2b')]);_0x875ca9[_0x644e('0x2f')]=_[_0x644e('0x30')](_0x7453a['query']);_0x875ca9[_0x644e('0x31')]=_[_0x644e('0x32')](_0x875ca9[_0x644e('0x2e')],_0x875ca9[_0x644e('0x2f')]);_0x3561f4['attributes']=_['intersection'](_0x875ca9[_0x644e('0x2e')],qs['fields'](_0x7453a[_0x644e('0x2f')]['fields']));_0x3561f4[_0x644e('0x33')]=_0x3561f4['attributes'][_0x644e('0x35')]?_0x3561f4['attributes']:_0x875ca9[_0x644e('0x2e')];_0x3561f4[_0x644e('0x37')]=qs[_0x644e('0x38')](_0x7453a[_0x644e('0x2f')][_0x644e('0x38')]);_0x3561f4[_0x644e('0x39')]=qs[_0x644e('0x31')](_[_0x644e('0x3a')](_0x7453a[_0x644e('0x2f')],_0x875ca9[_0x644e('0x31')]));if(_0x7453a['query'][_0x644e('0x3b')]){_0x3561f4[_0x644e('0x39')]=_[_0x644e('0x3c')](_0x3561f4[_0x644e('0x39')],{'$or':_[_0x644e('0x4f')](_0x3561f4[_0x644e('0x33')],function(_0x416b3a){var _0x15b3c6={};_0x15b3c6[_0x416b3a]={'$like':'%'+_0x7453a[_0x644e('0x2f')][_0x644e('0x3b')]+'%'};return _0x15b3c6;})});}_0x3561f4=_[_0x644e('0x3c')]({},_0x3561f4,_0x7453a['options']);return _0x4f1149[_0x644e('0x4e')](_0x3561f4);}})[_0x644e('0x24')](function(_0x59ef62){if(_0x59ef62){_0x15b137=_0x59ef62[_0x644e('0x35')];if(!_0x7453a['query'][_0x644e('0x36')]('nolimit')){_0x3561f4[_0x644e('0x1d')]=qs[_0x644e('0x1d')](_0x7453a['query'][_0x644e('0x1d')]);_0x3561f4[_0x644e('0x1a')]=qs[_0x644e('0x1a')](_0x7453a[_0x644e('0x2f')][_0x644e('0x1a')]);}return _0x4f1149[_0x644e('0x4e')](_0x3561f4);}})[_0x644e('0x24')](function(_0x2a5b19){if(_0x2a5b19){return _0x2a5b19?{'count':_0x15b137,'rows':_0x2a5b19}:null;}})[_0x644e('0x24')](respondWithResult(_0x277c8d,null))[_0x644e('0x43')](handleError(_0x277c8d,null));};exports[_0x644e('0x50')]=function(_0x124025,_0x77ff87,_0x5eb7c8){var _0x489687={};var _0x467308={};var _0x3835b6;var _0x490190;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x124025['params']['id']}})[_0x644e('0x24')](handleEntityNotFound(_0x77ff87,null))['then'](function(_0x5452ca){if(_0x5452ca){_0x3835b6=_0x5452ca;_0x467308[_0x644e('0x2e')]=_[_0x644e('0x30')](db[_0x644e('0x4c')][_0x644e('0x2b')]);_0x467308[_0x644e('0x2f')]=_[_0x644e('0x30')](_0x124025['query']);_0x467308[_0x644e('0x31')]=_['intersection'](_0x467308[_0x644e('0x2e')],_0x467308[_0x644e('0x2f')]);_0x489687[_0x644e('0x33')]=_['intersection'](_0x467308[_0x644e('0x2e')],qs[_0x644e('0x34')](_0x124025[_0x644e('0x2f')][_0x644e('0x34')]));_0x489687[_0x644e('0x33')]=_0x489687[_0x644e('0x33')][_0x644e('0x35')]?_0x489687['attributes']:_0x467308[_0x644e('0x2e')];_0x489687[_0x644e('0x37')]=qs[_0x644e('0x38')](_0x124025['query'][_0x644e('0x38')]);_0x489687[_0x644e('0x39')]=qs[_0x644e('0x31')](_[_0x644e('0x3a')](_0x124025[_0x644e('0x2f')],_0x467308[_0x644e('0x31')]));if(_0x124025[_0x644e('0x2f')][_0x644e('0x3b')]){_0x489687['where']=_[_0x644e('0x3c')](_0x489687[_0x644e('0x39')],{'$or':_[_0x644e('0x4f')](_0x489687[_0x644e('0x33')],function(_0x4e314e){var _0x876e53={};_0x876e53[_0x4e314e]={'$like':'%'+_0x124025[_0x644e('0x2f')][_0x644e('0x3b')]+'%'};return _0x876e53;})});}_0x489687=_[_0x644e('0x3c')]({},_0x489687,_0x124025['options']);return _0x3835b6['getFields'](_0x489687);}})[_0x644e('0x24')](function(_0x4aad15){if(_0x4aad15){_0x490190=_0x4aad15[_0x644e('0x35')];if(!_0x124025[_0x644e('0x2f')]['hasOwnProperty'](_0x644e('0x4d'))){_0x489687[_0x644e('0x1d')]=qs[_0x644e('0x1d')](_0x124025[_0x644e('0x2f')]['limit']);_0x489687[_0x644e('0x1a')]=qs[_0x644e('0x1a')](_0x124025[_0x644e('0x2f')][_0x644e('0x1a')]);}return _0x3835b6[_0x644e('0x50')](_0x489687);}})['then'](function(_0x1bce3f){if(_0x1bce3f){return _0x1bce3f?{'count':_0x490190,'rows':_0x1bce3f}:null;}})[_0x644e('0x24')](respondWithResult(_0x77ff87,null))[_0x644e('0x43')](handleError(_0x77ff87,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index f373590..f3c0f9e 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 _0x3ddb=['util','../../config/logger','api','bluebird','request-promise','rimraf','exports','define','lodash'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3ddb,0x86));var _0xb3dd=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x3ddb[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0xb3dd('0x0'));var util=require(_0xb3dd('0x1'));var logger=require(_0xb3dd('0x2'))(_0xb3dd('0x3'));var moment=require('moment');var BPromise=require(_0xb3dd('0x4'));var rp=require(_0xb3dd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb3dd('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xb3dd('0x7')]=function(_0x25f327,_0x1a8b8e){return _0x25f327[_0xb3dd('0x8')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9fe4=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash'];(function(_0x12101b,_0x17f01a){var _0x35ca50=function(_0x450100){while(--_0x450100){_0x12101b['push'](_0x12101b['shift']());}};_0x35ca50(++_0x17f01a);}(_0x9fe4,0xd7));var _0x49fe=function(_0x4bfbe5,_0x52cc85){_0x4bfbe5=_0x4bfbe5-0x0;var _0x4aee01=_0x9fe4[_0x4bfbe5];return _0x4aee01;};'use strict';var _=require(_0x49fe('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x49fe('0x1'));var moment=require(_0x49fe('0x2'));var BPromise=require(_0x49fe('0x3'));var rp=require(_0x49fe('0x4'));var fs=require('fs');var path=require(_0x49fe('0x5'));var rimraf=require(_0x49fe('0x6'));var config=require(_0x49fe('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x49fe('0x8')]=function(_0x315c6b,_0x5de262){return _0x315c6b[_0x49fe('0x9')](_0x49fe('0xa'),attributes,{'tableName':_0x49fe('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 880e3b6..82c4e3c 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 _0x3891=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x11b373,_0x1d4cb0){var _0x1b5abb=function(_0x5904d7){while(--_0x5904d7){_0x11b373['push'](_0x11b373['shift']());}};_0x1b5abb(++_0x1d4cb0);}(_0x3891,0xea));var _0x1389=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x3891[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x1389('0x0'));var util=require(_0x1389('0x1'));var moment=require(_0x1389('0x2'));var BPromise=require(_0x1389('0x3'));var rs=require(_0x1389('0x4'));var fs=require('fs');var Redis=require(_0x1389('0x5'));var db=require(_0x1389('0x6'))['db'];var utils=require(_0x1389('0x7'));var logger=require(_0x1389('0x8'))('rpc');var config=require(_0x1389('0x9'));var jayson=require(_0x1389('0xa'));var client=jayson[_0x1389('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52d3a4,_0x5d321f,_0x1f3c74){return new BPromise(function(_0x480a92,_0x17c089){return client[_0x1389('0xc')](_0x52d3a4,_0x1f3c74)['then'](function(_0x366c6d){logger[_0x1389('0xd')](_0x1389('0xe'),_0x5d321f,_0x1389('0xf'));logger[_0x1389('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x5d321f,_0x1389('0xf'),JSON[_0x1389('0x11')](_0x366c6d));if(_0x366c6d['error']){if(_0x366c6d[_0x1389('0x12')][_0x1389('0x13')]===0x1f4){logger[_0x1389('0x12')](_0x1389('0xe'),_0x5d321f,_0x366c6d['error'][_0x1389('0x14')]);return _0x17c089(_0x366c6d[_0x1389('0x12')][_0x1389('0x14')]);}logger[_0x1389('0x12')](_0x1389('0xe'),_0x5d321f,_0x366c6d[_0x1389('0x12')][_0x1389('0x14')]);return _0x480a92(_0x366c6d[_0x1389('0x12')][_0x1389('0x14')]);}else{logger[_0x1389('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5d321f,'request\x20sent');_0x480a92(_0x366c6d[_0x1389('0x15')][_0x1389('0x14')]);}})[_0x1389('0x16')](function(_0xe5290d){logger[_0x1389('0x12')](_0x1389('0xe'),_0x5d321f,_0xe5290d);_0x17c089(_0xe5290d);});});} \ No newline at end of file +var _0x7457=['http','request','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','util','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client'];(function(_0x1724cc,_0x523d12){var _0x19518a=function(_0x432dd3){while(--_0x432dd3){_0x1724cc['push'](_0x1724cc['shift']());}};_0x19518a(++_0x523d12);}(_0x7457,0x102));var _0x7745=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x7457[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x7745('0x0'));var util=require(_0x7745('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7745('0x2'));var fs=require('fs');var Redis=require(_0x7745('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7745('0x4'));var config=require(_0x7745('0x5'));var jayson=require(_0x7745('0x6'));var client=jayson[_0x7745('0x7')][_0x7745('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x555d2f,_0x193977,_0x1edd8a){return new BPromise(function(_0x11a1ab,_0x8f9667){return client[_0x7745('0x9')](_0x555d2f,_0x1edd8a)['then'](function(_0x4c14df){logger['info'](_0x7745('0xa'),_0x193977,'request\x20sent');logger[_0x7745('0xb')](_0x7745('0xc'),_0x193977,_0x7745('0xd'),JSON[_0x7745('0xe')](_0x4c14df));if(_0x4c14df['error']){if(_0x4c14df[_0x7745('0xf')][_0x7745('0x10')]===0x1f4){logger[_0x7745('0xf')](_0x7745('0xa'),_0x193977,_0x4c14df['error'][_0x7745('0x11')]);return _0x8f9667(_0x4c14df[_0x7745('0xf')][_0x7745('0x11')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x193977,_0x4c14df[_0x7745('0xf')]['message']);return _0x11a1ab(_0x4c14df[_0x7745('0xf')]['message']);}else{logger[_0x7745('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x193977,'request\x20sent');_0x11a1ab(_0x4c14df['result'][_0x7745('0x11')]);}})['catch'](function(_0x2965ee){logger[_0x7745('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x193977,_0x2965ee);_0x8f9667(_0x2965ee);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index fe8816c..06d8a0d 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 _0x581a=['fs-extra','../../components/auth/service','./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x40a587,_0x1378ff){var _0x1a6e38=function(_0x7a9cdb){while(--_0x7a9cdb){_0x40a587['push'](_0x40a587['shift']());}};_0x1a6e38(++_0x1378ff);}(_0x581a,0x127));var _0xa581=function(_0x1ddd17,_0x5a31ac){_0x1ddd17=_0x1ddd17-0x0;var _0x55122d=_0x581a[_0x1ddd17];return _0x55122d;};'use strict';var multer=require(_0xa581('0x0'));var util=require(_0xa581('0x1'));var path=require('path');var timeout=require(_0xa581('0x2'));var express=require(_0xa581('0x3'));var router=express[_0xa581('0x4')]();var fs_extra=require(_0xa581('0x5'));var auth=require(_0xa581('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa581('0x7'));router['get']('/',auth[_0xa581('0x8')](),controller[_0xa581('0x9')]);router[_0xa581('0xa')](_0xa581('0xb'),auth[_0xa581('0x8')](),controller[_0xa581('0xc')]);router[_0xa581('0xd')]('/',auth[_0xa581('0x8')](),controller[_0xa581('0xe')]);router[_0xa581('0xf')](_0xa581('0xb'),auth['isAuthenticated'](),controller[_0xa581('0x10')]);router[_0xa581('0x11')](_0xa581('0xb'),auth[_0xa581('0x8')](),controller[_0xa581('0x12')]);module[_0xa581('0x13')]=router; \ No newline at end of file +var _0x2242=['create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post'];(function(_0xf6167b,_0x546192){var _0x776ac9=function(_0x34c905){while(--_0x34c905){_0xf6167b['push'](_0xf6167b['shift']());}};_0x776ac9(++_0x546192);}(_0x2242,0x1a3));var _0x2224=function(_0x59e19a,_0x3a3280){_0x59e19a=_0x59e19a-0x0;var _0x76020e=_0x2242[_0x59e19a];return _0x76020e;};'use strict';var multer=require(_0x2224('0x0'));var util=require(_0x2224('0x1'));var path=require(_0x2224('0x2'));var timeout=require('connect-timeout');var express=require(_0x2224('0x3'));var router=express[_0x2224('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2224('0x5'));var interaction=require(_0x2224('0x6'));var config=require('../../config/environment');var controller=require(_0x2224('0x7'));router[_0x2224('0x8')]('/',auth[_0x2224('0x9')](),controller['index']);router[_0x2224('0x8')](_0x2224('0xa'),auth[_0x2224('0x9')](),controller[_0x2224('0xb')]);router[_0x2224('0xc')]('/',auth[_0x2224('0x9')](),controller[_0x2224('0xd')]);router[_0x2224('0xe')](_0x2224('0xa'),auth[_0x2224('0x9')](),controller[_0x2224('0xf')]);router[_0x2224('0x10')](_0x2224('0xa'),auth[_0x2224('0x9')](),controller[_0x2224('0x11')]);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 1f9ac42..e1e3564 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 _0xfa91=['BOOLEAN','exports','ENUM','string','variable','keyValue','STRING','customVariable'];(function(_0x350ba9,_0x47b173){var _0x45fd53=function(_0x41eab1){while(--_0x41eab1){_0x350ba9['push'](_0x350ba9['shift']());}};_0x45fd53(++_0x47b173);}(_0xfa91,0x1a9));var _0x1fa9=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xfa91[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require('sequelize');module[_0x1fa9('0x0')]={'type':{'type':Sequelize[_0x1fa9('0x1')](_0x1fa9('0x2'),_0x1fa9('0x3'),'customVariable',_0x1fa9('0x4'),'picklist'),'defaultValue':_0x1fa9('0x2')},'content':{'type':Sequelize[_0x1fa9('0x5')]},'key':{'type':Sequelize[_0x1fa9('0x5')]},'keyType':{'type':Sequelize[_0x1fa9('0x1')](_0x1fa9('0x2'),_0x1fa9('0x3'),_0x1fa9('0x6'))},'keyContent':{'type':Sequelize[_0x1fa9('0x5')]},'idField':{'type':Sequelize[_0x1fa9('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1fa9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1fa9('0x5')]}}; \ No newline at end of file +var _0x7554=['customVariable','keyValue','STRING','variable','BOOLEAN','sequelize','ENUM','string'];(function(_0x39fd11,_0x5d7883){var _0x302799=function(_0x4a0615){while(--_0x4a0615){_0x39fd11['push'](_0x39fd11['shift']());}};_0x302799(++_0x5d7883);}(_0x7554,0x85));var _0x4755=function(_0x19c336,_0x479dac){_0x19c336=_0x19c336-0x0;var _0x26ab38=_0x7554[_0x19c336];return _0x26ab38;};'use strict';var Sequelize=require(_0x4755('0x0'));module['exports']={'type':{'type':Sequelize[_0x4755('0x1')](_0x4755('0x2'),'variable',_0x4755('0x3'),_0x4755('0x4'),'picklist'),'defaultValue':_0x4755('0x2')},'content':{'type':Sequelize[_0x4755('0x5')]},'key':{'type':Sequelize[_0x4755('0x5')]},'keyType':{'type':Sequelize[_0x4755('0x1')](_0x4755('0x2'),_0x4755('0x6'),_0x4755('0x3'))},'keyContent':{'type':Sequelize[_0x4755('0x5')]},'idField':{'type':Sequelize[_0x4755('0x5')]},'nameField':{'type':Sequelize[_0x4755('0x5')]},'customField':{'type':Sequelize[_0x4755('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 54bae95..6734e22 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 _0xb0f6=['fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','catch','create','body','update','params','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','limit','undefined','count','apply','reject','then','destroy','sendStatus','error','name','map','FreshsalesField','rawAttributes','type','key','model','query','keys','filters','attributes','intersection'];(function(_0x58976c,_0x3c5433){var _0x178a16=function(_0x379ca4){while(--_0x379ca4){_0x58976c['push'](_0x58976c['shift']());}};_0x178a16(++_0x3c5433);}(_0xb0f6,0xa6));var _0x6b0f=function(_0x4dd05c,_0x3880da){_0x4dd05c=_0x4dd05c-0x0;var _0x57089a=_0xb0f6[_0x4dd05c];return _0x57089a;};'use strict';var emlformat=require(_0x6b0f('0x0'));var rimraf=require(_0x6b0f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6b0f('0x2'));var rp=require(_0x6b0f('0x3'));var moment=require(_0x6b0f('0x4'));var BPromise=require(_0x6b0f('0x5'));var Mustache=require(_0x6b0f('0x6'));var util=require(_0x6b0f('0x7'));var path=require(_0x6b0f('0x8'));var sox=require(_0x6b0f('0x9'));var csv=require('to-csv');var ejs=require(_0x6b0f('0xa'));var fs=require('fs');var fs_extra=require(_0x6b0f('0xb'));var _=require(_0x6b0f('0xc'));var squel=require(_0x6b0f('0xd'));var crypto=require(_0x6b0f('0xe'));var jsforce=require(_0x6b0f('0xf'));var deskjs=require(_0x6b0f('0x10'));var toCsv=require(_0x6b0f('0x11'));var querystring=require('querystring');var Papa=require(_0x6b0f('0x12'));var Redis=require(_0x6b0f('0x13'));var authService=require(_0x6b0f('0x14'));var qs=require(_0x6b0f('0x15'));var as=require(_0x6b0f('0x16'));var hardwareService=require(_0x6b0f('0x17'));var logger=require(_0x6b0f('0x18'))(_0x6b0f('0x19'));var utils=require(_0x6b0f('0x1a'));var config=require(_0x6b0f('0x1b'));var licenseUtil=require(_0x6b0f('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x437f34,_0x196222){_0x196222=_0x196222||0xcc;return function(_0x541c18){if(_0x541c18){return _0x437f34['sendStatus'](_0x196222);}return _0x437f34[_0x6b0f('0x1d')](_0x196222)[_0x6b0f('0x1e')]();};}function respondWithResult(_0x49c3e4,_0x541182){_0x541182=_0x541182||0xc8;return function(_0x5cd300){if(_0x5cd300){return _0x49c3e4[_0x6b0f('0x1d')](_0x541182)['json'](_0x5cd300);}};}function respondWithFilteredResult(_0x2cca09,_0x545ed9){return function(_0x4f993f){if(_0x4f993f){var _0xa39fac=typeof _0x545ed9[_0x6b0f('0x1f')]==='undefined'&&typeof _0x545ed9[_0x6b0f('0x20')]===_0x6b0f('0x21');var _0x24d94a=_0x4f993f[_0x6b0f('0x22')];var _0x51f11f=_0xa39fac?0x0:_0x545ed9[_0x6b0f('0x1f')];var _0x4c7e39=_0xa39fac?_0x4f993f[_0x6b0f('0x22')]:_0x545ed9[_0x6b0f('0x1f')]+_0x545ed9[_0x6b0f('0x20')];var _0x58fde7;if(_0x4c7e39>=_0x24d94a){_0x4c7e39=_0x24d94a;_0x58fde7=0xc8;}else{_0x58fde7=0xce;}_0x2cca09[_0x6b0f('0x1d')](_0x58fde7);return _0x2cca09['set']('Content-Range',_0x51f11f+'-'+_0x4c7e39+'/'+_0x24d94a)['json'](_0x4f993f);}return null;};}function patchUpdates(_0x4449f9){return function(_0x52b24e){try{jsonpatch[_0x6b0f('0x23')](_0x52b24e,_0x4449f9,!![]);}catch(_0x5ba9a0){return BPromise[_0x6b0f('0x24')](_0x5ba9a0);}return _0x52b24e['save']();};}function saveUpdates(_0x13685c,_0x5a9954){return function(_0x3e7077){if(_0x3e7077){return _0x3e7077['update'](_0x13685c)[_0x6b0f('0x25')](function(_0x1be238){return _0x1be238;});}return null;};}function removeEntity(_0x3842eb,_0x784467){return function(_0x47a8f5){if(_0x47a8f5){return _0x47a8f5[_0x6b0f('0x26')]()[_0x6b0f('0x25')](function(){_0x3842eb[_0x6b0f('0x1d')](0xcc)[_0x6b0f('0x1e')]();});}};}function handleEntityNotFound(_0x2dcfcd,_0x5dcc38){return function(_0x22b68c){if(!_0x22b68c){_0x2dcfcd[_0x6b0f('0x27')](0x194);}return _0x22b68c;};}function handleError(_0x4bf2f6,_0x35d174){_0x35d174=_0x35d174||0x1f4;return function(_0x57106d){logger[_0x6b0f('0x28')](_0x57106d['stack']);if(_0x57106d[_0x6b0f('0x29')]){delete _0x57106d[_0x6b0f('0x29')];}_0x4bf2f6[_0x6b0f('0x1d')](_0x35d174)['send'](_0x57106d);};}exports['index']=function(_0x9d251e,_0x7873cb){var _0x16b556={},_0x1d2f6f={},_0x221dc2={'count':0x0,'rows':[]};var _0xb7026a=_[_0x6b0f('0x2a')](db[_0x6b0f('0x2b')][_0x6b0f('0x2c')],function(_0x5307ab){return{'name':_0x5307ab['fieldName'],'type':_0x5307ab[_0x6b0f('0x2d')][_0x6b0f('0x2e')]};});_0x1d2f6f[_0x6b0f('0x2f')]=_['map'](_0xb7026a,_0x6b0f('0x29'));_0x1d2f6f[_0x6b0f('0x30')]=_[_0x6b0f('0x31')](_0x9d251e[_0x6b0f('0x30')]);_0x1d2f6f[_0x6b0f('0x32')]=_['intersection'](_0x1d2f6f[_0x6b0f('0x2f')],_0x1d2f6f[_0x6b0f('0x30')]);_0x16b556[_0x6b0f('0x33')]=_[_0x6b0f('0x34')](_0x1d2f6f[_0x6b0f('0x2f')],qs[_0x6b0f('0x35')](_0x9d251e[_0x6b0f('0x30')]['fields']));_0x16b556[_0x6b0f('0x33')]=_0x16b556['attributes'][_0x6b0f('0x36')]?_0x16b556[_0x6b0f('0x33')]:_0x1d2f6f[_0x6b0f('0x2f')];if(!_0x9d251e[_0x6b0f('0x30')][_0x6b0f('0x37')]('nolimit')){_0x16b556[_0x6b0f('0x20')]=qs[_0x6b0f('0x20')](_0x9d251e[_0x6b0f('0x30')]['limit']);_0x16b556[_0x6b0f('0x1f')]=qs['offset'](_0x9d251e[_0x6b0f('0x30')][_0x6b0f('0x1f')]);}_0x16b556[_0x6b0f('0x38')]=qs['sort'](_0x9d251e[_0x6b0f('0x30')]['sort']);_0x16b556[_0x6b0f('0x39')]=qs[_0x6b0f('0x32')](_[_0x6b0f('0x3a')](_0x9d251e['query'],_0x1d2f6f[_0x6b0f('0x32')]),_0xb7026a);if(_0x9d251e[_0x6b0f('0x30')]['filter']){_0x16b556['where']=_[_0x6b0f('0x3b')](_0x16b556['where'],{'$or':_[_0x6b0f('0x2a')](_0xb7026a,function(_0x16b5c7){if(_0x16b5c7[_0x6b0f('0x2d')]!==_0x6b0f('0x3c')){var _0x144f3d={};_0x144f3d[_0x16b5c7[_0x6b0f('0x29')]]={'$like':'%'+_0x9d251e[_0x6b0f('0x30')][_0x6b0f('0x3d')]+'%'};return _0x144f3d;}})});}_0x16b556=_['merge']({},_0x16b556,_0x9d251e[_0x6b0f('0x3e')]);var _0x5821a0={'where':_0x16b556[_0x6b0f('0x39')]};return db[_0x6b0f('0x2b')][_0x6b0f('0x22')](_0x5821a0)[_0x6b0f('0x25')](function(_0xab093e){_0x221dc2['count']=_0xab093e;if(_0x9d251e[_0x6b0f('0x30')][_0x6b0f('0x3f')]){_0x16b556[_0x6b0f('0x40')]=[{'all':!![]}];}return db[_0x6b0f('0x2b')]['findAll'](_0x16b556);})[_0x6b0f('0x25')](function(_0x31ffdd){_0x221dc2[_0x6b0f('0x41')]=_0x31ffdd;return _0x221dc2;})['then'](respondWithFilteredResult(_0x7873cb,_0x16b556))['catch'](handleError(_0x7873cb,null));};exports[_0x6b0f('0x42')]=function(_0x498089,_0x58d206){var _0x3f790f={'raw':!![],'where':{'id':_0x498089['params']['id']}},_0x4bc334={};_0x4bc334[_0x6b0f('0x2f')]=_[_0x6b0f('0x31')](db[_0x6b0f('0x2b')][_0x6b0f('0x2c')]);_0x4bc334[_0x6b0f('0x30')]=_['keys'](_0x498089[_0x6b0f('0x30')]);_0x4bc334[_0x6b0f('0x32')]=_[_0x6b0f('0x34')](_0x4bc334[_0x6b0f('0x2f')],_0x4bc334[_0x6b0f('0x30')]);_0x3f790f['attributes']=_[_0x6b0f('0x34')](_0x4bc334[_0x6b0f('0x2f')],qs['fields'](_0x498089[_0x6b0f('0x30')][_0x6b0f('0x35')]));_0x3f790f[_0x6b0f('0x33')]=_0x3f790f[_0x6b0f('0x33')][_0x6b0f('0x36')]?_0x3f790f['attributes']:_0x4bc334[_0x6b0f('0x2f')];if(_0x498089['query']['includeAll']){_0x3f790f[_0x6b0f('0x40')]=[{'all':!![]}];}_0x3f790f=_[_0x6b0f('0x3b')]({},_0x3f790f,_0x498089[_0x6b0f('0x3e')]);return db[_0x6b0f('0x2b')]['find'](_0x3f790f)[_0x6b0f('0x25')](handleEntityNotFound(_0x58d206,null))['then'](respondWithResult(_0x58d206,null))[_0x6b0f('0x43')](handleError(_0x58d206,null));};exports[_0x6b0f('0x44')]=function(_0xa182b1,_0x1aaef3){return db[_0x6b0f('0x2b')][_0x6b0f('0x44')](_0xa182b1[_0x6b0f('0x45')],{})['then'](respondWithResult(_0x1aaef3,0xc9))[_0x6b0f('0x43')](handleError(_0x1aaef3,null));};exports[_0x6b0f('0x46')]=function(_0x38cb8d,_0x4c5fec){if(_0x38cb8d[_0x6b0f('0x45')]['id']){delete _0x38cb8d[_0x6b0f('0x45')]['id'];}return db[_0x6b0f('0x2b')]['find']({'where':{'id':_0x38cb8d[_0x6b0f('0x47')]['id']}})[_0x6b0f('0x25')](handleEntityNotFound(_0x4c5fec,null))['then'](saveUpdates(_0x38cb8d[_0x6b0f('0x45')],null))['then'](respondWithResult(_0x4c5fec,null))[_0x6b0f('0x43')](handleError(_0x4c5fec,null));};exports[_0x6b0f('0x26')]=function(_0x2492f8,_0x437692){return db[_0x6b0f('0x2b')][_0x6b0f('0x48')]({'where':{'id':_0x2492f8[_0x6b0f('0x47')]['id']}})[_0x6b0f('0x25')](handleEntityNotFound(_0x437692,null))[_0x6b0f('0x25')](removeEntity(_0x437692,null))[_0x6b0f('0x43')](handleError(_0x437692,null));}; \ No newline at end of file +var _0x9330=['FreshsalesField','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','includeAll','find','create','params','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','name','send','index','map'];(function(_0x37db9f,_0x4c93ed){var _0x48fb29=function(_0x5d27a4){while(--_0x5d27a4){_0x37db9f['push'](_0x37db9f['shift']());}};_0x48fb29(++_0x4c93ed);}(_0x9330,0x185));var _0x0933=function(_0x3729bf,_0x2378ee){_0x3729bf=_0x3729bf-0x0;var _0x4c0c43=_0x9330[_0x3729bf];return _0x4c0c43;};'use strict';var emlformat=require(_0x0933('0x0'));var rimraf=require(_0x0933('0x1'));var zipdir=require(_0x0933('0x2'));var jsonpatch=require(_0x0933('0x3'));var rp=require(_0x0933('0x4'));var moment=require(_0x0933('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0933('0x6'));var util=require(_0x0933('0x7'));var path=require(_0x0933('0x8'));var sox=require(_0x0933('0x9'));var csv=require(_0x0933('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0933('0xb'));var squel=require(_0x0933('0xc'));var crypto=require('crypto');var jsforce=require(_0x0933('0xd'));var deskjs=require(_0x0933('0xe'));var toCsv=require(_0x0933('0xa'));var querystring=require(_0x0933('0xf'));var Papa=require(_0x0933('0x10'));var Redis=require(_0x0933('0x11'));var authService=require(_0x0933('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0933('0x13'));var hardwareService=require(_0x0933('0x14'));var logger=require(_0x0933('0x15'))(_0x0933('0x16'));var utils=require(_0x0933('0x17'));var config=require(_0x0933('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x598bd3,_0x5bc3f3){_0x5bc3f3=_0x5bc3f3||0xcc;return function(_0x368802){if(_0x368802){return _0x598bd3[_0x0933('0x19')](_0x5bc3f3);}return _0x598bd3['status'](_0x5bc3f3)[_0x0933('0x1a')]();};}function respondWithResult(_0x220e69,_0x308955){_0x308955=_0x308955||0xc8;return function(_0x2c77f9){if(_0x2c77f9){return _0x220e69[_0x0933('0x1b')](_0x308955)[_0x0933('0x1c')](_0x2c77f9);}};}function respondWithFilteredResult(_0x14ba02,_0x345b59){return function(_0x38a79c){if(_0x38a79c){var _0x12e9c7=typeof _0x345b59[_0x0933('0x1d')]===_0x0933('0x1e')&&typeof _0x345b59[_0x0933('0x1f')]===_0x0933('0x1e');var _0x54be73=_0x38a79c['count'];var _0x19be8a=_0x12e9c7?0x0:_0x345b59[_0x0933('0x1d')];var _0x33b605=_0x12e9c7?_0x38a79c[_0x0933('0x20')]:_0x345b59[_0x0933('0x1d')]+_0x345b59[_0x0933('0x1f')];var _0x3ac62a;if(_0x33b605>=_0x54be73){_0x33b605=_0x54be73;_0x3ac62a=0xc8;}else{_0x3ac62a=0xce;}_0x14ba02[_0x0933('0x1b')](_0x3ac62a);return _0x14ba02[_0x0933('0x21')](_0x0933('0x22'),_0x19be8a+'-'+_0x33b605+'/'+_0x54be73)['json'](_0x38a79c);}return null;};}function patchUpdates(_0xa04e31){return function(_0x1802b5){try{jsonpatch[_0x0933('0x23')](_0x1802b5,_0xa04e31,!![]);}catch(_0x3797aa){return BPromise[_0x0933('0x24')](_0x3797aa);}return _0x1802b5['save']();};}function saveUpdates(_0x8846bb,_0x54f9b7){return function(_0x5eb64c){if(_0x5eb64c){return _0x5eb64c['update'](_0x8846bb)['then'](function(_0x2f0f14){return _0x2f0f14;});}return null;};}function removeEntity(_0x399b18,_0x388607){return function(_0x4af0d8){if(_0x4af0d8){return _0x4af0d8['destroy']()[_0x0933('0x25')](function(){_0x399b18['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x11a6bc,_0x549730){return function(_0x26960c){if(!_0x26960c){_0x11a6bc[_0x0933('0x19')](0x194);}return _0x26960c;};}function handleError(_0x434c29,_0x3bfe04){_0x3bfe04=_0x3bfe04||0x1f4;return function(_0x231c53){logger[_0x0933('0x26')](_0x231c53['stack']);if(_0x231c53[_0x0933('0x27')]){delete _0x231c53[_0x0933('0x27')];}_0x434c29[_0x0933('0x1b')](_0x3bfe04)[_0x0933('0x28')](_0x231c53);};}exports[_0x0933('0x29')]=function(_0x581b85,_0x367ab8){var _0x2336b3={},_0x1724a5={},_0x1193e7={'count':0x0,'rows':[]};var _0x4f0229=_[_0x0933('0x2a')](db[_0x0933('0x2b')][_0x0933('0x2c')],function(_0x2e164b){return{'name':_0x2e164b[_0x0933('0x2d')],'type':_0x2e164b['type']['key']};});_0x1724a5[_0x0933('0x2e')]=_['map'](_0x4f0229,_0x0933('0x27'));_0x1724a5[_0x0933('0x2f')]=_[_0x0933('0x30')](_0x581b85['query']);_0x1724a5[_0x0933('0x31')]=_[_0x0933('0x32')](_0x1724a5[_0x0933('0x2e')],_0x1724a5['query']);_0x2336b3[_0x0933('0x33')]=_[_0x0933('0x32')](_0x1724a5[_0x0933('0x2e')],qs[_0x0933('0x34')](_0x581b85['query'][_0x0933('0x34')]));_0x2336b3[_0x0933('0x33')]=_0x2336b3[_0x0933('0x33')]['length']?_0x2336b3[_0x0933('0x33')]:_0x1724a5[_0x0933('0x2e')];if(!_0x581b85[_0x0933('0x2f')][_0x0933('0x35')]('nolimit')){_0x2336b3[_0x0933('0x1f')]=qs[_0x0933('0x1f')](_0x581b85[_0x0933('0x2f')]['limit']);_0x2336b3[_0x0933('0x1d')]=qs['offset'](_0x581b85[_0x0933('0x2f')][_0x0933('0x1d')]);}_0x2336b3[_0x0933('0x36')]=qs[_0x0933('0x37')](_0x581b85[_0x0933('0x2f')][_0x0933('0x37')]);_0x2336b3[_0x0933('0x38')]=qs[_0x0933('0x31')](_[_0x0933('0x39')](_0x581b85[_0x0933('0x2f')],_0x1724a5['filters']),_0x4f0229);if(_0x581b85[_0x0933('0x2f')][_0x0933('0x3a')]){_0x2336b3[_0x0933('0x38')]=_[_0x0933('0x3b')](_0x2336b3[_0x0933('0x38')],{'$or':_[_0x0933('0x2a')](_0x4f0229,function(_0x59b9d7){if(_0x59b9d7['type']!==_0x0933('0x3c')){var _0x4d58cb={};_0x4d58cb[_0x59b9d7[_0x0933('0x27')]]={'$like':'%'+_0x581b85['query']['filter']+'%'};return _0x4d58cb;}})});}_0x2336b3=_[_0x0933('0x3b')]({},_0x2336b3,_0x581b85[_0x0933('0x3d')]);var _0x558d17={'where':_0x2336b3[_0x0933('0x38')]};return db[_0x0933('0x2b')][_0x0933('0x20')](_0x558d17)[_0x0933('0x25')](function(_0x44be3f){_0x1193e7[_0x0933('0x20')]=_0x44be3f;if(_0x581b85[_0x0933('0x2f')]['includeAll']){_0x2336b3['include']=[{'all':!![]}];}return db[_0x0933('0x2b')][_0x0933('0x3e')](_0x2336b3);})[_0x0933('0x25')](function(_0x28c702){_0x1193e7[_0x0933('0x3f')]=_0x28c702;return _0x1193e7;})[_0x0933('0x25')](respondWithFilteredResult(_0x367ab8,_0x2336b3))[_0x0933('0x40')](handleError(_0x367ab8,null));};exports[_0x0933('0x41')]=function(_0x486d00,_0x1c4a44){var _0x14ec9f={'raw':!![],'where':{'id':_0x486d00['params']['id']}},_0x1ecb7d={};_0x1ecb7d[_0x0933('0x2e')]=_[_0x0933('0x30')](db[_0x0933('0x2b')][_0x0933('0x2c')]);_0x1ecb7d[_0x0933('0x2f')]=_['keys'](_0x486d00[_0x0933('0x2f')]);_0x1ecb7d[_0x0933('0x31')]=_[_0x0933('0x32')](_0x1ecb7d[_0x0933('0x2e')],_0x1ecb7d[_0x0933('0x2f')]);_0x14ec9f['attributes']=_['intersection'](_0x1ecb7d[_0x0933('0x2e')],qs[_0x0933('0x34')](_0x486d00[_0x0933('0x2f')][_0x0933('0x34')]));_0x14ec9f[_0x0933('0x33')]=_0x14ec9f['attributes']['length']?_0x14ec9f[_0x0933('0x33')]:_0x1ecb7d[_0x0933('0x2e')];if(_0x486d00[_0x0933('0x2f')][_0x0933('0x42')]){_0x14ec9f['include']=[{'all':!![]}];}_0x14ec9f=_[_0x0933('0x3b')]({},_0x14ec9f,_0x486d00['options']);return db[_0x0933('0x2b')][_0x0933('0x43')](_0x14ec9f)[_0x0933('0x25')](handleEntityNotFound(_0x1c4a44,null))[_0x0933('0x25')](respondWithResult(_0x1c4a44,null))[_0x0933('0x40')](handleError(_0x1c4a44,null));};exports[_0x0933('0x44')]=function(_0xefb710,_0x5f2d98){return db[_0x0933('0x2b')][_0x0933('0x44')](_0xefb710['body'],{})[_0x0933('0x25')](respondWithResult(_0x5f2d98,0xc9))[_0x0933('0x40')](handleError(_0x5f2d98,null));};exports['update']=function(_0x426272,_0x5c4e1a){if(_0x426272['body']['id']){delete _0x426272['body']['id'];}return db[_0x0933('0x2b')]['find']({'where':{'id':_0x426272[_0x0933('0x45')]['id']}})['then'](handleEntityNotFound(_0x5c4e1a,null))['then'](saveUpdates(_0x426272[_0x0933('0x46')],null))[_0x0933('0x25')](respondWithResult(_0x5c4e1a,null))[_0x0933('0x40')](handleError(_0x5c4e1a,null));};exports[_0x0933('0x47')]=function(_0x1905f0,_0x1e4921){return db['FreshsalesField'][_0x0933('0x43')]({'where':{'id':_0x1905f0[_0x0933('0x45')]['id']}})[_0x0933('0x25')](handleEntityNotFound(_0x1e4921,null))[_0x0933('0x25')](removeEntity(_0x1e4921,null))[_0x0933('0x40')](handleError(_0x1e4921,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 355c7b3..76eb78f 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 _0xf108=['define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','../../config/logger','api','moment','rimraf','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xf108,0x1d9));var _0x8f10=function(_0x220df5,_0x383a7c){_0x220df5=_0x220df5-0x0;var _0x274da3=_0xf108[_0x220df5];return _0x274da3;};'use strict';var _=require(_0x8f10('0x0'));var util=require('util');var logger=require(_0x8f10('0x1'))(_0x8f10('0x2'));var moment=require(_0x8f10('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8f10('0x4'));var config=require(_0x8f10('0x5'));var attributes=require(_0x8f10('0x6'));module[_0x8f10('0x7')]=function(_0x2e3419,_0x235737){return _0x2e3419[_0x8f10('0x8')](_0x8f10('0x9'),attributes,{'tableName':_0x8f10('0xa'),'paranoid':![],'indexes':[{'name':_0x8f10('0xb'),'fields':[_0x8f10('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6947=['./intFreshsalesField.attributes','exports','define','int_freshsales_fields','idField','FieldId','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x388b47,_0x5cdac5){var _0x4859df=function(_0x466a16){while(--_0x466a16){_0x388b47['push'](_0x388b47['shift']());}};_0x4859df(++_0x5cdac5);}(_0x6947,0x72));var _0x7694=function(_0x1fdd7f,_0x5e46ab){_0x1fdd7f=_0x1fdd7f-0x0;var _0x5edacb=_0x6947[_0x1fdd7f];return _0x5edacb;};'use strict';var _=require('lodash');var util=require(_0x7694('0x0'));var logger=require('../../config/logger')(_0x7694('0x1'));var moment=require(_0x7694('0x2'));var BPromise=require(_0x7694('0x3'));var rp=require(_0x7694('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7694('0x5'));var attributes=require(_0x7694('0x6'));module[_0x7694('0x7')]=function(_0x5730,_0x36776b){return _0x5730[_0x7694('0x8')]('FreshsalesField',attributes,{'tableName':_0x7694('0x9'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x7694('0xa'),_0x7694('0xb')],'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 883c1c9..5a9d694 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 _0xd117=['request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','debug','stringify','code','error','message'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xd117,0x182));var _0x7d11=function(_0x383627,_0x5be16e){_0x383627=_0x383627-0x0;var _0x2c16a0=_0xd117[_0x383627];return _0x2c16a0;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var moment=require(_0x7d11('0x2'));var BPromise=require(_0x7d11('0x3'));var rs=require(_0x7d11('0x4'));var fs=require('fs');var Redis=require(_0x7d11('0x5'));var db=require(_0x7d11('0x6'))['db'];var utils=require(_0x7d11('0x7'));var logger=require(_0x7d11('0x8'))(_0x7d11('0x9'));var config=require(_0x7d11('0xa'));var jayson=require(_0x7d11('0xb'));var client=jayson[_0x7d11('0xc')][_0x7d11('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x345602,_0x3c8d66,_0x47b5e6){return new BPromise(function(_0x3803b5,_0xffd020){return client[_0x7d11('0xe')](_0x345602,_0x47b5e6)['then'](function(_0x305eef){logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,'request\x20sent');logger[_0x7d11('0x11')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x3c8d66,'request\x20sent',JSON[_0x7d11('0x12')](_0x305eef));if(_0x305eef['error']){if(_0x305eef['error'][_0x7d11('0x13')]===0x1f4){logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')]['message']);return _0xffd020(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);return _0x3803b5(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}else{logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,_0x7d11('0x16'));_0x3803b5(_0x305eef['result'][_0x7d11('0x15')]);}})[_0x7d11('0x17')](function(_0x169733){logger[_0x7d11('0x14')](_0x7d11('0x10'),_0x3c8d66,_0x169733);_0xffd020(_0x169733);});});} \ No newline at end of file +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(_0x3abe58,_0x184dd9){var _0x457389=function(_0x59f517){while(--_0x59f517){_0x3abe58['push'](_0x3abe58['shift']());}};_0x457389(++_0x184dd9);}(_0xd8fb,0x99));var _0xbd8f=function(_0x5ac300,_0x479606){_0x5ac300=_0x5ac300-0x0;var _0x22a419=_0xd8fb[_0x5ac300];return _0x22a419;};'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 diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 0e07c4e..3ce17e4 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(_0x3e5164,_0x2a6717){var _0x2c903d=function(_0x18260f){while(--_0x18260f){_0x3e5164['push'](_0x3e5164['shift']());}};_0x2c903d(++_0x2a6717);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x67c718,_0x39194e){var _0x31b2ae=function(_0x32e7cf){while(--_0x32e7cf){_0x67c718['push'](_0x67c718['shift']());}};_0x31b2ae(++_0x39194e);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index e5d836f..8762a28 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 _0xaf5a=['username','ENUM','integrationTab','exports','STRING'];(function(_0x420d8d,_0x78b67f){var _0x4865d7=function(_0x2965df){while(--_0x2965df){_0x420d8d['push'](_0x420d8d['shift']());}};_0x4865d7(++_0x78b67f);}(_0xaf5a,0x116));var _0xaaf5=function(_0x1d734a,_0xf7cfec){_0x1d734a=_0x1d734a-0x0;var _0x3eef41=_0xaf5a[_0x1d734a];return _0x3eef41;};'use strict';var Sequelize=require('sequelize');module[_0xaaf5('0x0')]={'name':{'type':Sequelize[_0xaaf5('0x1')]},'description':{'type':Sequelize[_0xaaf5('0x1')]},'username':{'type':Sequelize[_0xaaf5('0x1')],'unique':_0xaaf5('0x2')},'remoteUri':{'type':Sequelize[_0xaaf5('0x1')]},'password':{'type':Sequelize[_0xaaf5('0x1')]},'clientId':{'type':Sequelize[_0xaaf5('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xaaf5('0x1')]},'serverUrl':{'type':Sequelize[_0xaaf5('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xaaf5('0x3')](_0xaaf5('0x4'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xb8cb=['sequelize','exports','STRING','username','ENUM','integrationTab','newTab'];(function(_0x53cdda,_0x4191bc){var _0x2debc5=function(_0x600909){while(--_0x600909){_0x53cdda['push'](_0x53cdda['shift']());}};_0x2debc5(++_0x4191bc);}(_0xb8cb,0xd9));var _0xbb8c=function(_0x467742,_0x190b2b){_0x467742=_0x467742-0x0;var _0x2202f4=_0xb8cb[_0x467742];return _0x2202f4;};'use strict';var Sequelize=require(_0xbb8c('0x0'));module[_0xbb8c('0x1')]={'name':{'type':Sequelize[_0xbb8c('0x2')]},'description':{'type':Sequelize[_0xbb8c('0x2')]},'username':{'type':Sequelize[_0xbb8c('0x2')],'unique':_0xbb8c('0x3')},'remoteUri':{'type':Sequelize[_0xbb8c('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xbb8c('0x2')]},'clientSecret':{'type':Sequelize[_0xbb8c('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xbb8c('0x4')](_0xbb8c('0x5'),_0xbb8c('0x6')),'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 9a2a36e..cacf331 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 _0x24ef=['includes','label','picklistValues','value','True','true','False','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','request-promise','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','fieldName','type','model','query','filters','intersection','attributes','fields','length','sort','where','pick','VIRTUAL','filter','merge','options','SalesforceAccount','includeAll','include','rawAttributes','keys','catch','create','update','body','params','destroy','find','getConfigurations','order','nolimit','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','getFields','Task','findOne','remoteUri','clientSecret','password','securityToken','slice','substring','clientId','login','username','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Description','string','int','picklist','boolean','textarea','phone','remove'];(function(_0x5c5d87,_0x3ebc46){var _0x138b37=function(_0x2a1889){while(--_0x2a1889){_0x5c5d87['push'](_0x5c5d87['shift']());}};_0x138b37(++_0x3ebc46);}(_0x24ef,0xf2));var _0xf24e=function(_0x5d9250,_0x74819){_0x5d9250=_0x5d9250-0x0;var _0x4567e1=_0x24ef[_0x5d9250];return _0x4567e1;};'use strict';var emlformat=require(_0xf24e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf24e('0x1'));var moment=require('moment');var BPromise=require(_0xf24e('0x2'));var Mustache=require('mustache');var util=require(_0xf24e('0x3'));var path=require(_0xf24e('0x4'));var sox=require(_0xf24e('0x5'));var csv=require('to-csv');var ejs=require(_0xf24e('0x6'));var fs=require('fs');var fs_extra=require(_0xf24e('0x7'));var _=require('lodash');var squel=require(_0xf24e('0x8'));var crypto=require(_0xf24e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xf24e('0xa'));var toCsv=require(_0xf24e('0xb'));var querystring=require('querystring');var Papa=require(_0xf24e('0xc'));var Redis=require(_0xf24e('0xd'));var authService=require(_0xf24e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf24e('0xf'));var hardwareService=require(_0xf24e('0x10'));var logger=require(_0xf24e('0x11'))(_0xf24e('0x12'));var utils=require(_0xf24e('0x13'));var config=require(_0xf24e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf24e('0x15'))['db'];var integrations=require(_0xf24e('0x16'));function respondWithStatusCode(_0xefd218,_0x4ff481){_0x4ff481=_0x4ff481||0xcc;return function(_0x35ec8b){if(_0x35ec8b){return _0xefd218['sendStatus'](_0x4ff481);}return _0xefd218[_0xf24e('0x17')](_0x4ff481)[_0xf24e('0x18')]();};}function respondWithResult(_0x408403,_0x533e55){_0x533e55=_0x533e55||0xc8;return function(_0x25dc1c){if(_0x25dc1c){return _0x408403[_0xf24e('0x17')](_0x533e55)[_0xf24e('0x19')](_0x25dc1c);}};}function respondWithFilteredResult(_0x58e85f,_0x1ad5b1){return function(_0x4676e7){if(_0x4676e7){var _0x49a1d6=typeof _0x1ad5b1[_0xf24e('0x1a')]===_0xf24e('0x1b')&&typeof _0x1ad5b1[_0xf24e('0x1c')]===_0xf24e('0x1b');var _0x10cdae=_0x4676e7[_0xf24e('0x1d')];var _0x1e101a=_0x49a1d6?0x0:_0x1ad5b1[_0xf24e('0x1a')];var _0x1f0472=_0x49a1d6?_0x4676e7[_0xf24e('0x1d')]:_0x1ad5b1[_0xf24e('0x1a')]+_0x1ad5b1[_0xf24e('0x1c')];var _0x164634;if(_0x1f0472>=_0x10cdae){_0x1f0472=_0x10cdae;_0x164634=0xc8;}else{_0x164634=0xce;}_0x58e85f[_0xf24e('0x17')](_0x164634);return _0x58e85f[_0xf24e('0x1e')](_0xf24e('0x1f'),_0x1e101a+'-'+_0x1f0472+'/'+_0x10cdae)['json'](_0x4676e7);}return null;};}function patchUpdates(_0x3e7adc){return function(_0x4887ff){try{jsonpatch[_0xf24e('0x20')](_0x4887ff,_0x3e7adc,!![]);}catch(_0x414442){return BPromise[_0xf24e('0x21')](_0x414442);}return _0x4887ff[_0xf24e('0x22')]();};}function saveUpdates(_0x560a5f,_0x44e6c4){return function(_0x50ee17){if(_0x50ee17){return _0x50ee17['update'](_0x560a5f)[_0xf24e('0x23')](function(_0x477b3f){return _0x477b3f;});}return null;};}function removeEntity(_0xbff2dd,_0x513150){return function(_0x12df86){if(_0x12df86){return _0x12df86['destroy']()[_0xf24e('0x23')](function(){_0xbff2dd[_0xf24e('0x17')](0xcc)[_0xf24e('0x18')]();});}};}function handleEntityNotFound(_0x42e782,_0x7e2c73){return function(_0x3802a9){if(!_0x3802a9){_0x42e782['sendStatus'](0x194);}return _0x3802a9;};}function handleError(_0x5233d9,_0x14e8f4){_0x14e8f4=_0x14e8f4||0x1f4;return function(_0x470940){logger[_0xf24e('0x24')](_0x470940[_0xf24e('0x25')]);if(_0x470940['name']){delete _0x470940[_0xf24e('0x26')];}_0x5233d9['status'](_0x14e8f4)[_0xf24e('0x27')](_0x470940);};}exports[_0xf24e('0x28')]=function(_0x22213c,_0x5d8652){var _0x16785b={},_0x268f12={},_0x67f308={'count':0x0,'rows':[]};var _0x5131ed=_[_0xf24e('0x29')](db['SalesforceAccount']['rawAttributes'],function(_0x46887e){return{'name':_0x46887e[_0xf24e('0x2a')],'type':_0x46887e[_0xf24e('0x2b')]['key']};});_0x268f12[_0xf24e('0x2c')]=_[_0xf24e('0x29')](_0x5131ed,'name');_0x268f12[_0xf24e('0x2d')]=_['keys'](_0x22213c['query']);_0x268f12[_0xf24e('0x2e')]=_[_0xf24e('0x2f')](_0x268f12[_0xf24e('0x2c')],_0x268f12['query']);_0x16785b[_0xf24e('0x30')]=_[_0xf24e('0x2f')](_0x268f12[_0xf24e('0x2c')],qs[_0xf24e('0x31')](_0x22213c[_0xf24e('0x2d')][_0xf24e('0x31')]));_0x16785b['attributes']=_0x16785b[_0xf24e('0x30')][_0xf24e('0x32')]?_0x16785b['attributes']:_0x268f12[_0xf24e('0x2c')];if(!_0x22213c[_0xf24e('0x2d')]['hasOwnProperty']('nolimit')){_0x16785b[_0xf24e('0x1c')]=qs[_0xf24e('0x1c')](_0x22213c[_0xf24e('0x2d')]['limit']);_0x16785b[_0xf24e('0x1a')]=qs[_0xf24e('0x1a')](_0x22213c[_0xf24e('0x2d')][_0xf24e('0x1a')]);}_0x16785b['order']=qs[_0xf24e('0x33')](_0x22213c[_0xf24e('0x2d')]['sort']);_0x16785b[_0xf24e('0x34')]=qs['filters'](_[_0xf24e('0x35')](_0x22213c['query'],_0x268f12[_0xf24e('0x2e')]),_0x5131ed);if(_0x22213c[_0xf24e('0x2d')]['filter']){_0x16785b['where']=_['merge'](_0x16785b['where'],{'$or':_['map'](_0x5131ed,function(_0x4c24ea){if(_0x4c24ea[_0xf24e('0x2b')]!==_0xf24e('0x36')){var _0x2cc33c={};_0x2cc33c[_0x4c24ea[_0xf24e('0x26')]]={'$like':'%'+_0x22213c[_0xf24e('0x2d')][_0xf24e('0x37')]+'%'};return _0x2cc33c;}})});}_0x16785b=_[_0xf24e('0x38')]({},_0x16785b,_0x22213c[_0xf24e('0x39')]);var _0x459bcc={'where':_0x16785b[_0xf24e('0x34')]};return db[_0xf24e('0x3a')]['count'](_0x459bcc)[_0xf24e('0x23')](function(_0x35c30b){_0x67f308[_0xf24e('0x1d')]=_0x35c30b;if(_0x22213c[_0xf24e('0x2d')][_0xf24e('0x3b')]){_0x16785b[_0xf24e('0x3c')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x16785b);})[_0xf24e('0x23')](function(_0x4fc572){_0x67f308['rows']=_0x4fc572;return _0x67f308;})['then'](respondWithFilteredResult(_0x5d8652,_0x16785b))['catch'](handleError(_0x5d8652,null));};exports['show']=function(_0x4e7641,_0x24de51){var _0x2560f6={'raw':![],'where':{'id':_0x4e7641['params']['id']}},_0x46ab1f={};_0x46ab1f[_0xf24e('0x2c')]=_['keys'](db[_0xf24e('0x3a')][_0xf24e('0x3d')]);_0x46ab1f[_0xf24e('0x2d')]=_[_0xf24e('0x3e')](_0x4e7641[_0xf24e('0x2d')]);_0x46ab1f[_0xf24e('0x2e')]=_[_0xf24e('0x2f')](_0x46ab1f['model'],_0x46ab1f['query']);_0x2560f6[_0xf24e('0x30')]=_[_0xf24e('0x2f')](_0x46ab1f[_0xf24e('0x2c')],qs[_0xf24e('0x31')](_0x4e7641['query']['fields']));_0x2560f6[_0xf24e('0x30')]=_0x2560f6[_0xf24e('0x30')][_0xf24e('0x32')]?_0x2560f6[_0xf24e('0x30')]:_0x46ab1f['model'];if(_0x4e7641['query'][_0xf24e('0x3b')]){_0x2560f6[_0xf24e('0x3c')]=[{'all':!![]}];}_0x2560f6=_[_0xf24e('0x38')]({},_0x2560f6,_0x4e7641[_0xf24e('0x39')]);return db['SalesforceAccount']['find'](_0x2560f6)['then'](handleEntityNotFound(_0x24de51,null))[_0xf24e('0x23')](respondWithResult(_0x24de51,null))[_0xf24e('0x3f')](handleError(_0x24de51,null));};exports[_0xf24e('0x40')]=function(_0x575bfa,_0x50b933){return db[_0xf24e('0x3a')][_0xf24e('0x40')](_0x575bfa['body'],{})[_0xf24e('0x23')](respondWithResult(_0x50b933,0xc9))[_0xf24e('0x3f')](handleError(_0x50b933,null));};exports[_0xf24e('0x41')]=function(_0x58c451,_0x1d77ce){if(_0x58c451[_0xf24e('0x42')]['id']){delete _0x58c451['body']['id'];}return db[_0xf24e('0x3a')]['find']({'where':{'id':_0x58c451[_0xf24e('0x43')]['id']}})[_0xf24e('0x23')](handleEntityNotFound(_0x1d77ce,null))[_0xf24e('0x23')](saveUpdates(_0x58c451[_0xf24e('0x42')],null))[_0xf24e('0x23')](respondWithResult(_0x1d77ce,null))[_0xf24e('0x3f')](handleError(_0x1d77ce,null));};exports[_0xf24e('0x44')]=function(_0x57ef2b,_0x5663fc){return db[_0xf24e('0x3a')][_0xf24e('0x45')]({'where':{'id':_0x57ef2b[_0xf24e('0x43')]['id']}})[_0xf24e('0x23')](handleEntityNotFound(_0x5663fc,null))['then'](removeEntity(_0x5663fc,null))[_0xf24e('0x3f')](handleError(_0x5663fc,null));};exports[_0xf24e('0x46')]=function(_0x5ea345,_0x1a9cb3,_0x25b45e){var _0x53ab21={};var _0x49546f={};var _0x34e2ac;var _0x115516;return db[_0xf24e('0x3a')]['findOne']({'where':{'id':_0x5ea345[_0xf24e('0x43')]['id']}})[_0xf24e('0x23')](handleEntityNotFound(_0x1a9cb3,null))[_0xf24e('0x23')](function(_0x9128d7){if(_0x9128d7){_0x34e2ac=_0x9128d7;_0x49546f[_0xf24e('0x2c')]=_[_0xf24e('0x3e')](db['SalesforceConfiguration'][_0xf24e('0x3d')]);_0x49546f[_0xf24e('0x2d')]=_[_0xf24e('0x3e')](_0x5ea345[_0xf24e('0x2d')]);_0x49546f[_0xf24e('0x2e')]=_[_0xf24e('0x2f')](_0x49546f[_0xf24e('0x2c')],_0x49546f[_0xf24e('0x2d')]);_0x53ab21['attributes']=_[_0xf24e('0x2f')](_0x49546f['model'],qs[_0xf24e('0x31')](_0x5ea345[_0xf24e('0x2d')]['fields']));_0x53ab21['attributes']=_0x53ab21['attributes'][_0xf24e('0x32')]?_0x53ab21['attributes']:_0x49546f['model'];_0x53ab21[_0xf24e('0x47')]=qs[_0xf24e('0x33')](_0x5ea345[_0xf24e('0x2d')][_0xf24e('0x33')]);_0x53ab21[_0xf24e('0x34')]=qs['filters'](_[_0xf24e('0x35')](_0x5ea345[_0xf24e('0x2d')],_0x49546f[_0xf24e('0x2e')]));if(_0x5ea345['query'][_0xf24e('0x37')]){_0x53ab21[_0xf24e('0x34')]=_['merge'](_0x53ab21[_0xf24e('0x34')],{'$or':_[_0xf24e('0x29')](_0x53ab21['attributes'],function(_0x23ded9){var _0x50b2bb={};_0x50b2bb[_0x23ded9]={'$like':'%'+_0x5ea345['query'][_0xf24e('0x37')]+'%'};return _0x50b2bb;})});}_0x53ab21=_[_0xf24e('0x38')]({},_0x53ab21,_0x5ea345[_0xf24e('0x39')]);return _0x34e2ac[_0xf24e('0x46')](_0x53ab21);}})['then'](function(_0x204cb4){if(_0x204cb4){_0x115516=_0x204cb4['length'];if(!_0x5ea345[_0xf24e('0x2d')]['hasOwnProperty'](_0xf24e('0x48'))){_0x53ab21['limit']=qs[_0xf24e('0x1c')](_0x5ea345[_0xf24e('0x2d')]['limit']);_0x53ab21['offset']=qs[_0xf24e('0x1a')](_0x5ea345[_0xf24e('0x2d')][_0xf24e('0x1a')]);}return _0x34e2ac[_0xf24e('0x46')](_0x53ab21);}})['then'](function(_0x1bafda){if(_0x1bafda){return _0x1bafda?{'count':_0x115516,'rows':_0x1bafda}:null;}})[_0xf24e('0x23')](respondWithResult(_0x1a9cb3,null))[_0xf24e('0x3f')](handleError(_0x1a9cb3,null));};exports[_0xf24e('0x49')]=function(_0x437630,_0x267fe7,_0x16c1fa){if(_0x437630[_0xf24e('0x42')]['id']){delete _0x437630['body']['id'];}return db[_0xf24e('0x3a')]['findOne']({'where':{'id':_0x437630['params']['id']}})[_0xf24e('0x23')](handleEntityNotFound(_0x267fe7,null))[_0xf24e('0x23')](function(_0x1d81bd){if(_0x1d81bd){_0x437630[_0xf24e('0x42')]['AccountId']=_0x1d81bd['id'];_0x437630[_0xf24e('0x42')][_0xf24e('0x4a')]=integrations[_0xf24e('0x4b')](_0x437630[_0xf24e('0x42')]['channel'],_0x437630[_0xf24e('0x42')][_0xf24e('0x2b')]);_0x437630[_0xf24e('0x42')][_0xf24e('0x4c')]=integrations[_0xf24e('0x4d')](_0x437630['body'][_0xf24e('0x4e')],_0x437630[_0xf24e('0x42')]['type']);return db['SalesforceConfiguration']['create'](_0x437630[_0xf24e('0x42')],{'include':[{'model':db['SalesforceField'],'as':_0xf24e('0x4a')},{'model':db[_0xf24e('0x4f')],'as':_0xf24e('0x4c')}]});}return null;})['then'](respondWithResult(_0x267fe7,null))[_0xf24e('0x3f')](handleError(_0x267fe7,null));};exports[_0xf24e('0x50')]=function(_0x293416,_0x5a07d1,_0xc7fd69){var _0x6e10c4;var _0x413c0f='';var _0xd1a489=_0xf24e('0x51');return db[_0xf24e('0x3a')][_0xf24e('0x52')]({'where':{'id':_0x293416[_0xf24e('0x43')]['id']},'attributes':['id',_0xf24e('0x53'),'clientId',_0xf24e('0x54'),'username',_0xf24e('0x55'),_0xf24e('0x56')]})[_0xf24e('0x23')](handleEntityNotFound(_0x5a07d1,null))[_0xf24e('0x23')](function(_0x55e889){if(_0x55e889){_0x413c0f=_0x55e889['remoteUri'];var _0x3cfdf2=_0x413c0f[_0xf24e('0x57')](-0x1);if(_0x3cfdf2==='/'){_0x413c0f=_0x413c0f[_0xf24e('0x58')](0x0,_0x413c0f['lastIndexOf'](_0x3cfdf2));}_0x6e10c4=new jsforce['Connection']({'oauth2':{'loginUrl':_0x413c0f,'clientId':_0x55e889[_0xf24e('0x59')],'clientSecret':_0x55e889[_0xf24e('0x54')]}});return _0x6e10c4[_0xf24e('0x5a')](_0x55e889[_0xf24e('0x5b')],_0x55e889[_0xf24e('0x55')]['concat'](_0x55e889[_0xf24e('0x56')]));}})[_0xf24e('0x23')](function(_0x3a92d2){if(_0x3a92d2){if(!_['isNil'](_0x293416[_0xf24e('0x2d')]['ticketType'])){_0xd1a489=_0x293416[_0xf24e('0x2d')][_0xf24e('0x5c')];}return _0x6e10c4[_0xf24e('0x5d')](_0xd1a489)[_0xf24e('0x5e')]();}})[_0xf24e('0x23')](function(_0x35d008){var _0x1be922=[_0xf24e('0x5f'),_0xf24e('0x60'),'IsReminderSet',_0xf24e('0x61'),'Subject',_0xf24e('0x62')];var _0x52f0a1=[_0xf24e('0x63'),_0xf24e('0x64'),_0xf24e('0x65'),_0xf24e('0x66'),'email',_0xf24e('0x67'),_0xf24e('0x68')];if(_0x35d008){_[_0xf24e('0x69')](_0x35d008['fields'],function(_0x16842b){return _0x1be922[_0xf24e('0x6a')](_0x16842b['name'])||!_0x52f0a1[_0xf24e('0x6a')](_0x16842b[_0xf24e('0x2b')]);});return{'count':_0x35d008['fields']['length'],'rows':_[_0xf24e('0x29')](_0x35d008[_0xf24e('0x31')],function(_0x1a7782){return{'id':_0x1a7782[_0xf24e('0x26')],'name':_0x1a7782[_0xf24e('0x6b')],'custom':_0x1a7782['custom'],'options':_0x1a7782[_0xf24e('0x6c')][_0xf24e('0x32')]>0x0?_[_0xf24e('0x29')](_0x1a7782[_0xf24e('0x6c')],function(_0x47ed23){return{'name':_0x47ed23[_0xf24e('0x6b')],'value':_0x47ed23[_0xf24e('0x6d')]};}):_0x1a7782[_0xf24e('0x2b')]==_0xf24e('0x66')?[{'name':_0xf24e('0x6e'),'value':_0xf24e('0x6f')},{'name':_0xf24e('0x70'),'value':'false'}]:[]};})};}})[_0xf24e('0x23')](respondWithResult(_0x5a07d1,null))[_0xf24e('0x3f')](function(_0x3b7e9b){var _0x391054=_0x293416[_0xf24e('0x2d')][_0xf24e('0x71')]?0x1f4:_0x3b7e9b['statusCode']||0x1f4;logger[_0xf24e('0x24')](_0xf24e('0x72'),_0xf24e('0x50'),_0x391054,JSON['stringify'](_0x3b7e9b));delete _0x3b7e9b[_0xf24e('0x26')];if(_0x391054===0x191){_0x391054=0x190;}_0x5a07d1[_0xf24e('0x17')](_0x391054)[_0xf24e('0x27')](_0x293416[_0xf24e('0x2d')][_0xf24e('0x71')]?{'message':_0xf24e('0x73'),'statusCode':_0x3b7e9b['statusCode']}:_0x3b7e9b);});}; \ No newline at end of file +var _0xb267=['statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','then','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','getConfigurations','findOne','length','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','Task','username','securityToken','remoteUri','lastIndexOf','Connection','clientId','clientSecret','password','concat','isNil','sobject','OwnerId','IsReminderSet','IsRecurrence','Subject','Description','picklist','boolean','email','textarea','includes','label','custom','picklistValues','value','True','False','test'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0xb267,0x7b));var _0x7b26=function(_0x595aed,_0x51dd3d){_0x595aed=_0x595aed-0x0;var _0x4fc06a=_0xb267[_0x595aed];return _0x4fc06a;};'use strict';var emlformat=require(_0x7b26('0x0'));var rimraf=require(_0x7b26('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7b26('0x2'));var Mustache=require(_0x7b26('0x3'));var util=require('util');var path=require(_0x7b26('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b26('0x5'));var fs=require('fs');var fs_extra=require(_0x7b26('0x6'));var _=require(_0x7b26('0x7'));var squel=require(_0x7b26('0x8'));var crypto=require(_0x7b26('0x9'));var jsforce=require(_0x7b26('0xa'));var deskjs=require(_0x7b26('0xb'));var toCsv=require(_0x7b26('0xc'));var querystring=require(_0x7b26('0xd'));var Papa=require('papaparse');var Redis=require(_0x7b26('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7b26('0xf'));var as=require(_0x7b26('0x10'));var hardwareService=require(_0x7b26('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x7b26('0x12'));var config=require(_0x7b26('0x13'));var licenseUtil=require(_0x7b26('0x14'));var db=require(_0x7b26('0x15'))['db'];var integrations=require(_0x7b26('0x16'));function respondWithStatusCode(_0x34171f,_0x2e5d23){_0x2e5d23=_0x2e5d23||0xcc;return function(_0x1bc365){if(_0x1bc365){return _0x34171f[_0x7b26('0x17')](_0x2e5d23);}return _0x34171f[_0x7b26('0x18')](_0x2e5d23)[_0x7b26('0x19')]();};}function respondWithResult(_0x433236,_0x131252){_0x131252=_0x131252||0xc8;return function(_0x21836e){if(_0x21836e){return _0x433236[_0x7b26('0x18')](_0x131252)[_0x7b26('0x1a')](_0x21836e);}};}function respondWithFilteredResult(_0x33453f,_0x4e4d18){return function(_0x5ea4cf){if(_0x5ea4cf){var _0x44548a=typeof _0x4e4d18[_0x7b26('0x1b')]===_0x7b26('0x1c')&&typeof _0x4e4d18[_0x7b26('0x1d')]===_0x7b26('0x1c');var _0x1dcd95=_0x5ea4cf['count'];var _0x27c79c=_0x44548a?0x0:_0x4e4d18['offset'];var _0x55c920=_0x44548a?_0x5ea4cf[_0x7b26('0x1e')]:_0x4e4d18['offset']+_0x4e4d18[_0x7b26('0x1d')];var _0x38d881;if(_0x55c920>=_0x1dcd95){_0x55c920=_0x1dcd95;_0x38d881=0xc8;}else{_0x38d881=0xce;}_0x33453f['status'](_0x38d881);return _0x33453f[_0x7b26('0x1f')](_0x7b26('0x20'),_0x27c79c+'-'+_0x55c920+'/'+_0x1dcd95)['json'](_0x5ea4cf);}return null;};}function patchUpdates(_0x435958){return function(_0x1afcd0){try{jsonpatch['apply'](_0x1afcd0,_0x435958,!![]);}catch(_0x359abd){return BPromise[_0x7b26('0x21')](_0x359abd);}return _0x1afcd0['save']();};}function saveUpdates(_0x174c9f,_0x4b83bb){return function(_0x253e48){if(_0x253e48){return _0x253e48['update'](_0x174c9f)['then'](function(_0x3a29d5){return _0x3a29d5;});}return null;};}function removeEntity(_0x398205,_0x5dd662){return function(_0x49ffd4){if(_0x49ffd4){return _0x49ffd4[_0x7b26('0x22')]()[_0x7b26('0x23')](function(){_0x398205[_0x7b26('0x18')](0xcc)[_0x7b26('0x19')]();});}};}function handleEntityNotFound(_0x47bc8c,_0xa02242){return function(_0x58bd7a){if(!_0x58bd7a){_0x47bc8c[_0x7b26('0x17')](0x194);}return _0x58bd7a;};}function handleError(_0x109df2,_0x20ef56){_0x20ef56=_0x20ef56||0x1f4;return function(_0x3abe81){logger[_0x7b26('0x24')](_0x3abe81[_0x7b26('0x25')]);if(_0x3abe81[_0x7b26('0x26')]){delete _0x3abe81['name'];}_0x109df2[_0x7b26('0x18')](_0x20ef56)[_0x7b26('0x27')](_0x3abe81);};}exports[_0x7b26('0x28')]=function(_0x55b1ec,_0x3bdeba){var _0x2110b8={},_0x7c757c={},_0x46eee1={'count':0x0,'rows':[]};var _0x744914=_[_0x7b26('0x29')](db[_0x7b26('0x2a')][_0x7b26('0x2b')],function(_0x4c7909){return{'name':_0x4c7909[_0x7b26('0x2c')],'type':_0x4c7909[_0x7b26('0x2d')][_0x7b26('0x2e')]};});_0x7c757c['model']=_[_0x7b26('0x29')](_0x744914,_0x7b26('0x26'));_0x7c757c['query']=_[_0x7b26('0x2f')](_0x55b1ec[_0x7b26('0x30')]);_0x7c757c['filters']=_[_0x7b26('0x31')](_0x7c757c[_0x7b26('0x32')],_0x7c757c[_0x7b26('0x30')]);_0x2110b8['attributes']=_['intersection'](_0x7c757c[_0x7b26('0x32')],qs[_0x7b26('0x33')](_0x55b1ec[_0x7b26('0x30')]['fields']));_0x2110b8[_0x7b26('0x34')]=_0x2110b8[_0x7b26('0x34')]['length']?_0x2110b8['attributes']:_0x7c757c['model'];if(!_0x55b1ec[_0x7b26('0x30')][_0x7b26('0x35')](_0x7b26('0x36'))){_0x2110b8[_0x7b26('0x1d')]=qs[_0x7b26('0x1d')](_0x55b1ec[_0x7b26('0x30')]['limit']);_0x2110b8[_0x7b26('0x1b')]=qs[_0x7b26('0x1b')](_0x55b1ec[_0x7b26('0x30')][_0x7b26('0x1b')]);}_0x2110b8['order']=qs[_0x7b26('0x37')](_0x55b1ec['query']['sort']);_0x2110b8[_0x7b26('0x38')]=qs[_0x7b26('0x39')](_[_0x7b26('0x3a')](_0x55b1ec[_0x7b26('0x30')],_0x7c757c[_0x7b26('0x39')]),_0x744914);if(_0x55b1ec[_0x7b26('0x30')][_0x7b26('0x3b')]){_0x2110b8[_0x7b26('0x38')]=_[_0x7b26('0x3c')](_0x2110b8[_0x7b26('0x38')],{'$or':_['map'](_0x744914,function(_0x1feca8){if(_0x1feca8[_0x7b26('0x2d')]!=='VIRTUAL'){var _0x1df433={};_0x1df433[_0x1feca8[_0x7b26('0x26')]]={'$like':'%'+_0x55b1ec[_0x7b26('0x30')]['filter']+'%'};return _0x1df433;}})});}_0x2110b8=_[_0x7b26('0x3c')]({},_0x2110b8,_0x55b1ec[_0x7b26('0x3d')]);var _0x28aa81={'where':_0x2110b8['where']};return db[_0x7b26('0x2a')][_0x7b26('0x1e')](_0x28aa81)[_0x7b26('0x23')](function(_0x58b501){_0x46eee1['count']=_0x58b501;if(_0x55b1ec[_0x7b26('0x30')][_0x7b26('0x3e')]){_0x2110b8[_0x7b26('0x3f')]=[{'all':!![]}];}return db[_0x7b26('0x2a')][_0x7b26('0x40')](_0x2110b8);})[_0x7b26('0x23')](function(_0xb2f28d){_0x46eee1[_0x7b26('0x41')]=_0xb2f28d;return _0x46eee1;})['then'](respondWithFilteredResult(_0x3bdeba,_0x2110b8))[_0x7b26('0x42')](handleError(_0x3bdeba,null));};exports[_0x7b26('0x43')]=function(_0x1f3c7b,_0x84882a){var _0x39bbc7={'raw':![],'where':{'id':_0x1f3c7b[_0x7b26('0x44')]['id']}},_0x50b586={};_0x50b586['model']=_[_0x7b26('0x2f')](db[_0x7b26('0x2a')][_0x7b26('0x2b')]);_0x50b586[_0x7b26('0x30')]=_[_0x7b26('0x2f')](_0x1f3c7b[_0x7b26('0x30')]);_0x50b586[_0x7b26('0x39')]=_[_0x7b26('0x31')](_0x50b586[_0x7b26('0x32')],_0x50b586[_0x7b26('0x30')]);_0x39bbc7[_0x7b26('0x34')]=_['intersection'](_0x50b586[_0x7b26('0x32')],qs[_0x7b26('0x33')](_0x1f3c7b[_0x7b26('0x30')][_0x7b26('0x33')]));_0x39bbc7[_0x7b26('0x34')]=_0x39bbc7[_0x7b26('0x34')]['length']?_0x39bbc7['attributes']:_0x50b586[_0x7b26('0x32')];if(_0x1f3c7b[_0x7b26('0x30')]['includeAll']){_0x39bbc7[_0x7b26('0x3f')]=[{'all':!![]}];}_0x39bbc7=_[_0x7b26('0x3c')]({},_0x39bbc7,_0x1f3c7b['options']);return db[_0x7b26('0x2a')]['find'](_0x39bbc7)['then'](handleEntityNotFound(_0x84882a,null))['then'](respondWithResult(_0x84882a,null))[_0x7b26('0x42')](handleError(_0x84882a,null));};exports[_0x7b26('0x45')]=function(_0x435d48,_0x3d3e48){return db['SalesforceAccount'][_0x7b26('0x45')](_0x435d48[_0x7b26('0x46')],{})[_0x7b26('0x23')](respondWithResult(_0x3d3e48,0xc9))['catch'](handleError(_0x3d3e48,null));};exports[_0x7b26('0x47')]=function(_0xb9b90c,_0x7869f6){if(_0xb9b90c['body']['id']){delete _0xb9b90c[_0x7b26('0x46')]['id'];}return db['SalesforceAccount'][_0x7b26('0x48')]({'where':{'id':_0xb9b90c[_0x7b26('0x44')]['id']}})[_0x7b26('0x23')](handleEntityNotFound(_0x7869f6,null))[_0x7b26('0x23')](saveUpdates(_0xb9b90c[_0x7b26('0x46')],null))['then'](respondWithResult(_0x7869f6,null))[_0x7b26('0x42')](handleError(_0x7869f6,null));};exports[_0x7b26('0x22')]=function(_0x5c1ecb,_0x4bfa84){return db[_0x7b26('0x2a')]['find']({'where':{'id':_0x5c1ecb[_0x7b26('0x44')]['id']}})[_0x7b26('0x23')](handleEntityNotFound(_0x4bfa84,null))['then'](removeEntity(_0x4bfa84,null))[_0x7b26('0x42')](handleError(_0x4bfa84,null));};exports[_0x7b26('0x49')]=function(_0x58bc10,_0x3b9328,_0x17f8d6){var _0x177318={};var _0x528a53={};var _0x27bd4d;var _0x1b6d20;return db[_0x7b26('0x2a')][_0x7b26('0x4a')]({'where':{'id':_0x58bc10[_0x7b26('0x44')]['id']}})[_0x7b26('0x23')](handleEntityNotFound(_0x3b9328,null))[_0x7b26('0x23')](function(_0x1edea6){if(_0x1edea6){_0x27bd4d=_0x1edea6;_0x528a53[_0x7b26('0x32')]=_[_0x7b26('0x2f')](db['SalesforceConfiguration'][_0x7b26('0x2b')]);_0x528a53[_0x7b26('0x30')]=_[_0x7b26('0x2f')](_0x58bc10[_0x7b26('0x30')]);_0x528a53['filters']=_[_0x7b26('0x31')](_0x528a53[_0x7b26('0x32')],_0x528a53[_0x7b26('0x30')]);_0x177318['attributes']=_[_0x7b26('0x31')](_0x528a53['model'],qs['fields'](_0x58bc10['query'][_0x7b26('0x33')]));_0x177318[_0x7b26('0x34')]=_0x177318[_0x7b26('0x34')][_0x7b26('0x4b')]?_0x177318[_0x7b26('0x34')]:_0x528a53[_0x7b26('0x32')];_0x177318[_0x7b26('0x4c')]=qs[_0x7b26('0x37')](_0x58bc10['query'][_0x7b26('0x37')]);_0x177318[_0x7b26('0x38')]=qs[_0x7b26('0x39')](_[_0x7b26('0x3a')](_0x58bc10[_0x7b26('0x30')],_0x528a53[_0x7b26('0x39')]));if(_0x58bc10[_0x7b26('0x30')][_0x7b26('0x3b')]){_0x177318[_0x7b26('0x38')]=_[_0x7b26('0x3c')](_0x177318[_0x7b26('0x38')],{'$or':_[_0x7b26('0x29')](_0x177318[_0x7b26('0x34')],function(_0x247ef){var _0x8eff20={};_0x8eff20[_0x247ef]={'$like':'%'+_0x58bc10[_0x7b26('0x30')][_0x7b26('0x3b')]+'%'};return _0x8eff20;})});}_0x177318=_[_0x7b26('0x3c')]({},_0x177318,_0x58bc10[_0x7b26('0x3d')]);return _0x27bd4d[_0x7b26('0x49')](_0x177318);}})[_0x7b26('0x23')](function(_0x3b5fe4){if(_0x3b5fe4){_0x1b6d20=_0x3b5fe4['length'];if(!_0x58bc10[_0x7b26('0x30')][_0x7b26('0x35')]('nolimit')){_0x177318[_0x7b26('0x1d')]=qs[_0x7b26('0x1d')](_0x58bc10[_0x7b26('0x30')][_0x7b26('0x1d')]);_0x177318[_0x7b26('0x1b')]=qs[_0x7b26('0x1b')](_0x58bc10[_0x7b26('0x30')][_0x7b26('0x1b')]);}return _0x27bd4d['getConfigurations'](_0x177318);}})[_0x7b26('0x23')](function(_0x42822a){if(_0x42822a){return _0x42822a?{'count':_0x1b6d20,'rows':_0x42822a}:null;}})['then'](respondWithResult(_0x3b9328,null))[_0x7b26('0x42')](handleError(_0x3b9328,null));};exports[_0x7b26('0x4d')]=function(_0x2a5c5b,_0x350479,_0x467d35){if(_0x2a5c5b['body']['id']){delete _0x2a5c5b[_0x7b26('0x46')]['id'];}return db[_0x7b26('0x2a')][_0x7b26('0x4a')]({'where':{'id':_0x2a5c5b[_0x7b26('0x44')]['id']}})['then'](handleEntityNotFound(_0x350479,null))[_0x7b26('0x23')](function(_0x5b4b9a){if(_0x5b4b9a){_0x2a5c5b[_0x7b26('0x46')][_0x7b26('0x4e')]=_0x5b4b9a['id'];_0x2a5c5b['body'][_0x7b26('0x4f')]=integrations[_0x7b26('0x50')](_0x2a5c5b[_0x7b26('0x46')][_0x7b26('0x51')],_0x2a5c5b[_0x7b26('0x46')][_0x7b26('0x2d')]);_0x2a5c5b[_0x7b26('0x46')][_0x7b26('0x52')]=integrations[_0x7b26('0x53')](_0x2a5c5b['body']['channel'],_0x2a5c5b[_0x7b26('0x46')][_0x7b26('0x2d')]);return db[_0x7b26('0x54')][_0x7b26('0x45')](_0x2a5c5b[_0x7b26('0x46')],{'include':[{'model':db[_0x7b26('0x55')],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0x7b26('0x52')}]});}return null;})[_0x7b26('0x23')](respondWithResult(_0x350479,null))['catch'](handleError(_0x350479,null));};exports['getFields']=function(_0x64609e,_0xdfb2c6,_0x2e481f){var _0x535b8c;var _0x4e60f2='';var _0x9b42ec=_0x7b26('0x56');return db[_0x7b26('0x2a')][_0x7b26('0x4a')]({'where':{'id':_0x64609e['params']['id']},'attributes':['id','remoteUri','clientId','clientSecret',_0x7b26('0x57'),'password',_0x7b26('0x58')]})[_0x7b26('0x23')](handleEntityNotFound(_0xdfb2c6,null))[_0x7b26('0x23')](function(_0x2800a2){if(_0x2800a2){_0x4e60f2=_0x2800a2[_0x7b26('0x59')];var _0x488a71=_0x4e60f2['slice'](-0x1);if(_0x488a71==='/'){_0x4e60f2=_0x4e60f2['substring'](0x0,_0x4e60f2[_0x7b26('0x5a')](_0x488a71));}_0x535b8c=new jsforce[(_0x7b26('0x5b'))]({'oauth2':{'loginUrl':_0x4e60f2,'clientId':_0x2800a2[_0x7b26('0x5c')],'clientSecret':_0x2800a2[_0x7b26('0x5d')]}});return _0x535b8c['login'](_0x2800a2['username'],_0x2800a2[_0x7b26('0x5e')][_0x7b26('0x5f')](_0x2800a2[_0x7b26('0x58')]));}})['then'](function(_0x4bf638){if(_0x4bf638){if(!_[_0x7b26('0x60')](_0x64609e[_0x7b26('0x30')]['ticketType'])){_0x9b42ec=_0x64609e[_0x7b26('0x30')]['ticketType'];}return _0x535b8c[_0x7b26('0x61')](_0x9b42ec)['describe']();}})[_0x7b26('0x23')](function(_0x555bbd){var _0x2e4af1=[_0x7b26('0x62'),'ActivityDate',_0x7b26('0x63'),_0x7b26('0x64'),_0x7b26('0x65'),_0x7b26('0x66')];var _0x145722=['string','int',_0x7b26('0x67'),_0x7b26('0x68'),_0x7b26('0x69'),_0x7b26('0x6a'),'phone'];if(_0x555bbd){_['remove'](_0x555bbd[_0x7b26('0x33')],function(_0x14c778){return _0x2e4af1[_0x7b26('0x6b')](_0x14c778[_0x7b26('0x26')])||!_0x145722[_0x7b26('0x6b')](_0x14c778['type']);});return{'count':_0x555bbd[_0x7b26('0x33')][_0x7b26('0x4b')],'rows':_[_0x7b26('0x29')](_0x555bbd[_0x7b26('0x33')],function(_0x3c8e97){return{'id':_0x3c8e97[_0x7b26('0x26')],'name':_0x3c8e97[_0x7b26('0x6c')],'custom':_0x3c8e97[_0x7b26('0x6d')],'options':_0x3c8e97['picklistValues'][_0x7b26('0x4b')]>0x0?_[_0x7b26('0x29')](_0x3c8e97[_0x7b26('0x6e')],function(_0x412312){return{'name':_0x412312['label'],'value':_0x412312[_0x7b26('0x6f')]};}):_0x3c8e97[_0x7b26('0x2d')]==_0x7b26('0x68')?[{'name':_0x7b26('0x70'),'value':'true'},{'name':_0x7b26('0x71'),'value':'false'}]:[]};})};}})[_0x7b26('0x23')](respondWithResult(_0xdfb2c6,null))[_0x7b26('0x42')](function(_0xf0dcd6){var _0x47b439=_0x64609e['query'][_0x7b26('0x72')]?0x1f4:_0xf0dcd6[_0x7b26('0x73')]||0x1f4;logger[_0x7b26('0x24')](_0x7b26('0x74'),'getFields',_0x47b439,JSON[_0x7b26('0x75')](_0xf0dcd6));delete _0xf0dcd6['name'];if(_0x47b439===0x191){_0x47b439=0x190;}_0xdfb2c6[_0x7b26('0x18')](_0x47b439)['send'](_0x64609e[_0x7b26('0x30')]['test']?{'message':_0x7b26('0x76'),'statusCode':_0xf0dcd6[_0x7b26('0x73')]}:_0xf0dcd6);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 29f0bb0..12fd211 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 _0xc622=['SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xc622,0xb2));var _0x2c62=function(_0x23f8d2,_0x301fec){_0x23f8d2=_0x23f8d2-0x0;var _0x5d174b=_0xc622[_0x23f8d2];return _0x5d174b;};'use strict';var _=require(_0x2c62('0x0'));var util=require('util');var logger=require(_0x2c62('0x1'))(_0x2c62('0x2'));var moment=require(_0x2c62('0x3'));var BPromise=require('bluebird');var rp=require(_0x2c62('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2c62('0x5'));var config=require(_0x2c62('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x2c62('0x7'));module[_0x2c62('0x8')]=function(_0x19ee18,_0x584607){return _0x19ee18['define'](_0x2c62('0x9'),attributes,{'tableName':_0x2c62('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf14=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x13b637,_0x8eef0){var _0x3040f6=function(_0xb06ff){while(--_0xb06ff){_0x13b637['push'](_0x13b637['shift']());}};_0x3040f6(++_0x8eef0);}(_0xcf14,0xa1));var _0x4cf1=function(_0x4541a4,_0x54d692){_0x4541a4=_0x4541a4-0x0;var _0x253ada=_0xcf14[_0x4541a4];return _0x253ada;};'use strict';var _=require(_0x4cf1('0x0'));var util=require('util');var logger=require(_0x4cf1('0x1'))(_0x4cf1('0x2'));var moment=require('moment');var BPromise=require(_0x4cf1('0x3'));var rp=require(_0x4cf1('0x4'));var fs=require('fs');var path=require(_0x4cf1('0x5'));var rimraf=require(_0x4cf1('0x6'));var config=require('../../config/environment');var attributes=require(_0x4cf1('0x7'));var integrations=require(_0x4cf1('0x8'));module[_0x4cf1('0x9')]=function(_0x12076f,_0x32ad8c){return _0x12076f[_0x4cf1('0xa')](_0x4cf1('0xb'),attributes,{'tableName':'int_salesforce_accounts','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 5d21985..3b0d929 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 _0x36d4=['error','code','message','result','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetSalesforceAccount','catch','ShowSalesforceAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x40effe,_0x4aff71){var _0x19a79a=function(_0x2d7a7d){while(--_0x2d7a7d){_0x40effe['push'](_0x40effe['shift']());}};_0x19a79a(++_0x4aff71);}(_0x36d4,0x1b4));var _0x436d=function(_0x11ba06,_0x41d28d){_0x11ba06=_0x11ba06-0x0;var _0x3053d8=_0x36d4[_0x11ba06];return _0x3053d8;};'use strict';var _=require(_0x436d('0x0'));var util=require(_0x436d('0x1'));var moment=require(_0x436d('0x2'));var BPromise=require('bluebird');var rs=require(_0x436d('0x3'));var fs=require('fs');var Redis=require(_0x436d('0x4'));var db=require(_0x436d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x436d('0x6'))(_0x436d('0x7'));var config=require(_0x436d('0x8'));var jayson=require(_0x436d('0x9'));var client=jayson[_0x436d('0xa')][_0x436d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33143a,_0x3efa48,_0x2412c4){return new BPromise(function(_0x37af45,_0xdd06fd){return client[_0x436d('0xc')](_0x33143a,_0x2412c4)[_0x436d('0xd')](function(_0x3c8287){logger[_0x436d('0xe')](_0x436d('0xf'),_0x3efa48,_0x436d('0x10'));logger[_0x436d('0x11')](_0x436d('0x12'),_0x3efa48,_0x436d('0x10'),JSON[_0x436d('0x13')](_0x3c8287));if(_0x3c8287[_0x436d('0x14')]){if(_0x3c8287['error'][_0x436d('0x15')]===0x1f4){logger['error'](_0x436d('0xf'),_0x3efa48,_0x3c8287[_0x436d('0x14')][_0x436d('0x16')]);return _0xdd06fd(_0x3c8287[_0x436d('0x14')][_0x436d('0x16')]);}logger[_0x436d('0x14')]('SalesforceAccount,\x20%s,\x20%s',_0x3efa48,_0x3c8287[_0x436d('0x14')]['message']);return _0x37af45(_0x3c8287[_0x436d('0x14')][_0x436d('0x16')]);}else{logger[_0x436d('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x3efa48,_0x436d('0x10'));_0x37af45(_0x3c8287[_0x436d('0x17')][_0x436d('0x16')]);}})['catch'](function(_0x57b15b){logger[_0x436d('0x14')](_0x436d('0xf'),_0x3efa48,_0x57b15b);_0xdd06fd(_0x57b15b);});});}exports['GetSalesforceAccount']=function(_0x4b0af5){var _0x16080a=this;return new Promise(function(_0x326e32,_0x20628e){return db[_0x436d('0x18')][_0x436d('0x19')]({'raw':_0x4b0af5[_0x436d('0x1a')]?_0x4b0af5[_0x436d('0x1a')][_0x436d('0x1b')]===undefined?!![]:![]:!![],'where':_0x4b0af5[_0x436d('0x1a')]?_0x4b0af5[_0x436d('0x1a')][_0x436d('0x1c')]||null:null,'attributes':_0x4b0af5[_0x436d('0x1a')]?_0x4b0af5[_0x436d('0x1a')][_0x436d('0x1d')]||null:null,'limit':_0x4b0af5[_0x436d('0x1a')]?_0x4b0af5['options'][_0x436d('0x1e')]||null:null,'include':_0x4b0af5['options']?_0x4b0af5['options'][_0x436d('0x1f')]?_['map'](_0x4b0af5[_0x436d('0x1a')][_0x436d('0x1f')],function(_0x14627a){return{'model':db[_0x14627a['model']],'as':_0x14627a['as'],'attributes':_0x14627a[_0x436d('0x1d')],'include':_0x14627a['include']?_[_0x436d('0x20')](_0x14627a['include'],function(_0x4d4e86){return{'model':db[_0x4d4e86[_0x436d('0x21')]],'as':_0x4d4e86['as'],'attributes':_0x4d4e86[_0x436d('0x1d')],'include':_0x4d4e86['include']?_[_0x436d('0x20')](_0x4d4e86[_0x436d('0x1f')],function(_0x126bab){return{'model':db[_0x126bab[_0x436d('0x21')]],'as':_0x126bab['as'],'attributes':_0x126bab[_0x436d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x436d('0xd')](function(_0x11eb12){logger['info'](_0x436d('0x22'),_0x4b0af5);logger[_0x436d('0x11')](_0x436d('0x22'),_0x4b0af5,JSON[_0x436d('0x13')](_0x11eb12));_0x326e32(_0x11eb12);})[_0x436d('0x23')](function(_0x3c9372){logger['error']('GetSalesforceAccount',_0x3c9372[_0x436d('0x16')],_0x4b0af5);_0x20628e(_0x16080a['error'](0x1f4,_0x3c9372['message']));});});};exports[_0x436d('0x24')]=function(_0x598f2b){var _0x2435d0=this;return new Promise(function(_0x751251,_0x274d6d){return db[_0x436d('0x18')][_0x436d('0x25')]({'raw':_0x598f2b[_0x436d('0x1a')]?_0x598f2b[_0x436d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x598f2b[_0x436d('0x1a')]?_0x598f2b['options']['where']||null:null,'attributes':_0x598f2b['options']?_0x598f2b[_0x436d('0x1a')]['attributes']||null:null,'include':_0x598f2b['options']?_0x598f2b[_0x436d('0x1a')][_0x436d('0x1f')]?_['map'](_0x598f2b[_0x436d('0x1a')][_0x436d('0x1f')],function(_0x8afef0){return{'model':db[_0x8afef0['model']],'as':_0x8afef0['as'],'attributes':_0x8afef0['attributes'],'include':_0x8afef0[_0x436d('0x1f')]?_['map'](_0x8afef0[_0x436d('0x1f')],function(_0x2e424c){return{'model':db[_0x2e424c[_0x436d('0x21')]],'as':_0x2e424c['as'],'attributes':_0x2e424c[_0x436d('0x1d')],'include':_0x2e424c[_0x436d('0x1f')]?_[_0x436d('0x20')](_0x2e424c[_0x436d('0x1f')],function(_0x326475){return{'model':db[_0x326475['model']],'as':_0x326475['as'],'attributes':_0x326475[_0x436d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x436d('0xd')](function(_0x10ddad){logger[_0x436d('0xe')](_0x436d('0x24'),_0x598f2b);logger['debug'](_0x436d('0x24'),_0x598f2b,JSON['stringify'](_0x10ddad));_0x751251(_0x10ddad);})[_0x436d('0x23')](function(_0xa5f747){logger[_0x436d('0x14')]('ShowSalesforceAccount',_0xa5f747[_0x436d('0x16')],_0x598f2b);_0x274d6d(_0x2435d0[_0x436d('0x14')](0x1f4,_0xa5f747[_0x436d('0x16')]));});});}; \ No newline at end of file +var _0xfb6e=['result','catch','GetSalesforceAccount','SalesforceAccount','options','attributes','limit','include','model','map','ShowSalesforceAccount','find','raw','where','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x46d87a,_0x5183db){var _0x115296=function(_0x880a1c){while(--_0x880a1c){_0x46d87a['push'](_0x46d87a['shift']());}};_0x115296(++_0x5183db);}(_0xfb6e,0x177));var _0xefb6=function(_0x15a645,_0x28aec4){_0x15a645=_0x15a645-0x0;var _0x411fb4=_0xfb6e[_0x15a645];return _0x411fb4;};'use strict';var _=require('lodash');var util=require(_0xefb6('0x0'));var moment=require(_0xefb6('0x1'));var BPromise=require(_0xefb6('0x2'));var rs=require(_0xefb6('0x3'));var fs=require('fs');var Redis=require(_0xefb6('0x4'));var db=require(_0xefb6('0x5'))['db'];var utils=require(_0xefb6('0x6'));var logger=require(_0xefb6('0x7'))('rpc');var config=require(_0xefb6('0x8'));var jayson=require(_0xefb6('0x9'));var client=jayson[_0xefb6('0xa')][_0xefb6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c5ea6,_0x5cc4f1,_0x249cd5){return new BPromise(function(_0x5cc394,_0x5d9239){return client['request'](_0x4c5ea6,_0x249cd5)['then'](function(_0x21138b){logger[_0xefb6('0xc')](_0xefb6('0xd'),_0x5cc4f1,_0xefb6('0xe'));logger[_0xefb6('0xf')](_0xefb6('0x10'),_0x5cc4f1,_0xefb6('0xe'),JSON[_0xefb6('0x11')](_0x21138b));if(_0x21138b[_0xefb6('0x12')]){if(_0x21138b[_0xefb6('0x12')][_0xefb6('0x13')]===0x1f4){logger['error'](_0xefb6('0xd'),_0x5cc4f1,_0x21138b[_0xefb6('0x12')]['message']);return _0x5d9239(_0x21138b[_0xefb6('0x12')]['message']);}logger['error'](_0xefb6('0xd'),_0x5cc4f1,_0x21138b['error'][_0xefb6('0x14')]);return _0x5cc394(_0x21138b[_0xefb6('0x12')][_0xefb6('0x14')]);}else{logger[_0xefb6('0xc')](_0xefb6('0xd'),_0x5cc4f1,_0xefb6('0xe'));_0x5cc394(_0x21138b[_0xefb6('0x15')][_0xefb6('0x14')]);}})[_0xefb6('0x16')](function(_0x558965){logger[_0xefb6('0x12')](_0xefb6('0xd'),_0x5cc4f1,_0x558965);_0x5d9239(_0x558965);});});}exports[_0xefb6('0x17')]=function(_0xeb9ece){var _0x5ea9a1=this;return new Promise(function(_0x1eab8b,_0x1d5f6c){return db[_0xefb6('0x18')]['findAll']({'raw':_0xeb9ece[_0xefb6('0x19')]?_0xeb9ece[_0xefb6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xeb9ece[_0xefb6('0x19')]?_0xeb9ece['options']['where']||null:null,'attributes':_0xeb9ece[_0xefb6('0x19')]?_0xeb9ece[_0xefb6('0x19')][_0xefb6('0x1a')]||null:null,'limit':_0xeb9ece[_0xefb6('0x19')]?_0xeb9ece['options'][_0xefb6('0x1b')]||null:null,'include':_0xeb9ece[_0xefb6('0x19')]?_0xeb9ece['options'][_0xefb6('0x1c')]?_['map'](_0xeb9ece[_0xefb6('0x19')][_0xefb6('0x1c')],function(_0x3da8ae){return{'model':db[_0x3da8ae[_0xefb6('0x1d')]],'as':_0x3da8ae['as'],'attributes':_0x3da8ae['attributes'],'include':_0x3da8ae[_0xefb6('0x1c')]?_[_0xefb6('0x1e')](_0x3da8ae[_0xefb6('0x1c')],function(_0xe339df){return{'model':db[_0xe339df['model']],'as':_0xe339df['as'],'attributes':_0xe339df[_0xefb6('0x1a')],'include':_0xe339df['include']?_[_0xefb6('0x1e')](_0xe339df['include'],function(_0x9c2753){return{'model':db[_0x9c2753[_0xefb6('0x1d')]],'as':_0x9c2753['as'],'attributes':_0x9c2753[_0xefb6('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8d3ede){logger[_0xefb6('0xc')](_0xefb6('0x17'),_0xeb9ece);logger[_0xefb6('0xf')](_0xefb6('0x17'),_0xeb9ece,JSON[_0xefb6('0x11')](_0x8d3ede));_0x1eab8b(_0x8d3ede);})['catch'](function(_0x194707){logger[_0xefb6('0x12')](_0xefb6('0x17'),_0x194707[_0xefb6('0x14')],_0xeb9ece);_0x1d5f6c(_0x5ea9a1[_0xefb6('0x12')](0x1f4,_0x194707['message']));});});};exports[_0xefb6('0x1f')]=function(_0x5cece4){var _0x116a1c=this;return new Promise(function(_0x4f3d86,_0x5d2d45){return db[_0xefb6('0x18')][_0xefb6('0x20')]({'raw':_0x5cece4['options']?_0x5cece4[_0xefb6('0x19')][_0xefb6('0x21')]===undefined?!![]:![]:!![],'where':_0x5cece4[_0xefb6('0x19')]?_0x5cece4[_0xefb6('0x19')][_0xefb6('0x22')]||null:null,'attributes':_0x5cece4['options']?_0x5cece4[_0xefb6('0x19')]['attributes']||null:null,'include':_0x5cece4['options']?_0x5cece4[_0xefb6('0x19')]['include']?_['map'](_0x5cece4[_0xefb6('0x19')][_0xefb6('0x1c')],function(_0x185568){return{'model':db[_0x185568[_0xefb6('0x1d')]],'as':_0x185568['as'],'attributes':_0x185568[_0xefb6('0x1a')],'include':_0x185568[_0xefb6('0x1c')]?_[_0xefb6('0x1e')](_0x185568['include'],function(_0x323010){return{'model':db[_0x323010[_0xefb6('0x1d')]],'as':_0x323010['as'],'attributes':_0x323010[_0xefb6('0x1a')],'include':_0x323010['include']?_[_0xefb6('0x1e')](_0x323010[_0xefb6('0x1c')],function(_0x1ee211){return{'model':db[_0x1ee211[_0xefb6('0x1d')]],'as':_0x1ee211['as'],'attributes':_0x1ee211['attributes']};}):[]};}):[]};}):[]:[]})[_0xefb6('0x23')](function(_0x3e8513){logger[_0xefb6('0xc')](_0xefb6('0x1f'),_0x5cece4);logger[_0xefb6('0xf')](_0xefb6('0x1f'),_0x5cece4,JSON[_0xefb6('0x11')](_0x3e8513));_0x4f3d86(_0x3e8513);})[_0xefb6('0x16')](function(_0x3ffd45){logger[_0xefb6('0x12')]('ShowSalesforceAccount',_0x3ffd45[_0xefb6('0x14')],_0x5cece4);_0x5d2d45(_0x116a1c['error'](0x1f4,_0x3ffd45['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index f1416ae..d85385d 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 _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x588e9c,_0x1b11d4){var _0x2263ca=function(_0x118718){while(--_0x118718){_0x588e9c['push'](_0x588e9c['shift']());}};_0x2263ca(++_0x1b11d4);}(_0x7a54,0x106));var _0x47a5=function(_0x4a4951,_0x1ef730){_0x4a4951=_0x4a4951-0x0;var _0x40fca6=_0x7a54[_0x4a4951];return _0x40fca6;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file +var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x1e4f2f,_0x35edfa){var _0xccea89=function(_0x164386){while(--_0x164386){_0x1e4f2f['push'](_0x1e4f2f['shift']());}};_0xccea89(++_0x35edfa);}(_0x0b0e,0x187));var _0xe0b0=function(_0x11fc8b,_0x4ee51d){_0x11fc8b=_0x11fc8b-0x0;var _0x4ea86e=_0x0b0e[_0x11fc8b];return _0x4ea86e;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index f1ad61d..268c126 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 _0xfcb5=['nothing','sequelize','STRING','ENUM','Task','contact','lead','account_contact_lead','account','contact_lead'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xfcb5,0xab));var _0x5fcb=function(_0x4370ac,_0x563152){_0x4370ac=_0x4370ac-0x0;var _0x41e4be=_0xfcb5[_0x4370ac];return _0x41e4be;};'use strict';var Sequelize=require(_0x5fcb('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5fcb('0x1')]},'ticketType':{'type':Sequelize[_0x5fcb('0x2')](_0x5fcb('0x3'),'Case'),'defaultValue':_0x5fcb('0x3')},'moduleSearch':{'type':Sequelize[_0x5fcb('0x2')]('contact_lead',_0x5fcb('0x4'),_0x5fcb('0x5'),_0x5fcb('0x6'),_0x5fcb('0x7')),'defaultValue':_0x5fcb('0x8')},'moduleCreate':{'type':Sequelize[_0x5fcb('0x2')](_0x5fcb('0x9'),_0x5fcb('0x4'),_0x5fcb('0x5'),_0x5fcb('0x7')),'defaultValue':'lead'},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x5fcb('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x5fcb('0x1')]}}; \ No newline at end of file +var _0x8144=['lead','account_contact_lead','account','sequelize','exports','STRING','ENUM','Case','Task','contact_lead','contact'];(function(_0xae14ae,_0x185d8a){var _0x21c843=function(_0x12a887){while(--_0x12a887){_0xae14ae['push'](_0xae14ae['shift']());}};_0x21c843(++_0x185d8a);}(_0x8144,0xf5));var _0x4814=function(_0x2a5c50,_0x25029b){_0x2a5c50=_0x2a5c50-0x0;var _0x235703=_0x8144[_0x2a5c50];return _0x235703;};'use strict';var Sequelize=require(_0x4814('0x0'));module[_0x4814('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4814('0x2')]},'ticketType':{'type':Sequelize[_0x4814('0x3')]('Task',_0x4814('0x4')),'defaultValue':_0x4814('0x5')},'moduleSearch':{'type':Sequelize[_0x4814('0x3')](_0x4814('0x6'),_0x4814('0x7'),_0x4814('0x8'),_0x4814('0x9'),'account'),'defaultValue':_0x4814('0x6')},'moduleCreate':{'type':Sequelize[_0x4814('0x3')]('nothing',_0x4814('0x7'),'lead',_0x4814('0xa')),'defaultValue':_0x4814('0x8')},'leadId':{'type':Sequelize[_0x4814('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x4814('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x4814('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x4814('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index e639b30..08c9eb9 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 _0x9ec0=['then','destroy','error','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','SalesforceConfiguration','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','getFields','order','getSubjects','SalesforceField','hasOwnProperty','getDescriptions','fast-json-patch','moment','mustache','path','sox','to-csv','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save'];(function(_0x2f3b14,_0x554f94){var _0x20e924=function(_0x3f4c1c){while(--_0x3f4c1c){_0x2f3b14['push'](_0x2f3b14['shift']());}};_0x20e924(++_0x554f94);}(_0x9ec0,0x71));var _0x09ec=function(_0x43ff6d,_0x1e6695){_0x43ff6d=_0x43ff6d-0x0;var _0x7fd481=_0x9ec0[_0x43ff6d];return _0x7fd481;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x09ec('0x0'));var rp=require('request-promise');var moment=require(_0x09ec('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x09ec('0x2'));var util=require('util');var path=require(_0x09ec('0x3'));var sox=require(_0x09ec('0x4'));var csv=require(_0x09ec('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x09ec('0x6'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x09ec('0x5'));var querystring=require(_0x09ec('0x7'));var Papa=require(_0x09ec('0x8'));var Redis=require(_0x09ec('0x9'));var authService=require(_0x09ec('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0x09ec('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x09ec('0xc'))('api');var utils=require('../../config/utils');var config=require(_0x09ec('0xd'));var licenseUtil=require('../../config/license/util');var db=require(_0x09ec('0xe'))['db'];function respondWithStatusCode(_0x146d49,_0x211f85){_0x211f85=_0x211f85||0xcc;return function(_0x1c8b83){if(_0x1c8b83){return _0x146d49[_0x09ec('0xf')](_0x211f85);}return _0x146d49[_0x09ec('0x10')](_0x211f85)[_0x09ec('0x11')]();};}function respondWithResult(_0x448acf,_0x219cd5){_0x219cd5=_0x219cd5||0xc8;return function(_0xda518a){if(_0xda518a){return _0x448acf[_0x09ec('0x10')](_0x219cd5)[_0x09ec('0x12')](_0xda518a);}};}function respondWithFilteredResult(_0x4301c5,_0x26e3d4){return function(_0x40150b){if(_0x40150b){var _0x14cb7d=typeof _0x26e3d4[_0x09ec('0x13')]==='undefined'&&typeof _0x26e3d4[_0x09ec('0x14')]===_0x09ec('0x15');var _0x3a71ec=_0x40150b[_0x09ec('0x16')];var _0x241dac=_0x14cb7d?0x0:_0x26e3d4[_0x09ec('0x13')];var _0x26409b=_0x14cb7d?_0x40150b[_0x09ec('0x16')]:_0x26e3d4[_0x09ec('0x13')]+_0x26e3d4[_0x09ec('0x14')];var _0x4d610a;if(_0x26409b>=_0x3a71ec){_0x26409b=_0x3a71ec;_0x4d610a=0xc8;}else{_0x4d610a=0xce;}_0x4301c5['status'](_0x4d610a);return _0x4301c5['set'](_0x09ec('0x17'),_0x241dac+'-'+_0x26409b+'/'+_0x3a71ec)[_0x09ec('0x12')](_0x40150b);}return null;};}function patchUpdates(_0x59e72d){return function(_0x37f2ae){try{jsonpatch[_0x09ec('0x18')](_0x37f2ae,_0x59e72d,!![]);}catch(_0xccc13){return BPromise[_0x09ec('0x19')](_0xccc13);}return _0x37f2ae[_0x09ec('0x1a')]();};}function saveUpdates(_0x5ebc12,_0x434d28){return function(_0x69cfda){if(_0x69cfda){return _0x69cfda['update'](_0x5ebc12)[_0x09ec('0x1b')](function(_0x8e9a52){return _0x8e9a52;});}return null;};}function removeEntity(_0x377181,_0xe1ef3e){return function(_0x156b92){if(_0x156b92){return _0x156b92[_0x09ec('0x1c')]()[_0x09ec('0x1b')](function(){_0x377181[_0x09ec('0x10')](0xcc)[_0x09ec('0x11')]();});}};}function handleEntityNotFound(_0x2bee32,_0x1ee389){return function(_0xfe36aa){if(!_0xfe36aa){_0x2bee32['sendStatus'](0x194);}return _0xfe36aa;};}function handleError(_0x4ad98b,_0x1eb3c3){_0x1eb3c3=_0x1eb3c3||0x1f4;return function(_0x39ebfd){logger[_0x09ec('0x1d')](_0x39ebfd['stack']);if(_0x39ebfd[_0x09ec('0x1e')]){delete _0x39ebfd[_0x09ec('0x1e')];}_0x4ad98b[_0x09ec('0x10')](_0x1eb3c3)['send'](_0x39ebfd);};}exports['index']=function(_0x2fe744,_0x172d8d){var _0x3dc03e={},_0x265ad1={},_0x32aaef={'count':0x0,'rows':[]};var _0x4fa44f=_[_0x09ec('0x1f')](db['SalesforceConfiguration'][_0x09ec('0x20')],function(_0x33427e){return{'name':_0x33427e[_0x09ec('0x21')],'type':_0x33427e[_0x09ec('0x22')][_0x09ec('0x23')]};});_0x265ad1[_0x09ec('0x24')]=_[_0x09ec('0x1f')](_0x4fa44f,_0x09ec('0x1e'));_0x265ad1[_0x09ec('0x25')]=_[_0x09ec('0x26')](_0x2fe744['query']);_0x265ad1[_0x09ec('0x27')]=_[_0x09ec('0x28')](_0x265ad1[_0x09ec('0x24')],_0x265ad1[_0x09ec('0x25')]);_0x3dc03e[_0x09ec('0x29')]=_[_0x09ec('0x28')](_0x265ad1[_0x09ec('0x24')],qs[_0x09ec('0x2a')](_0x2fe744[_0x09ec('0x25')]['fields']));_0x3dc03e['attributes']=_0x3dc03e[_0x09ec('0x29')][_0x09ec('0x2b')]?_0x3dc03e['attributes']:_0x265ad1[_0x09ec('0x24')];if(!_0x2fe744['query']['hasOwnProperty'](_0x09ec('0x2c'))){_0x3dc03e[_0x09ec('0x14')]=qs[_0x09ec('0x14')](_0x2fe744[_0x09ec('0x25')]['limit']);_0x3dc03e['offset']=qs[_0x09ec('0x13')](_0x2fe744['query'][_0x09ec('0x13')]);}_0x3dc03e['order']=qs[_0x09ec('0x2d')](_0x2fe744[_0x09ec('0x25')]['sort']);_0x3dc03e[_0x09ec('0x2e')]=qs[_0x09ec('0x27')](_[_0x09ec('0x2f')](_0x2fe744[_0x09ec('0x25')],_0x265ad1['filters']),_0x4fa44f);if(_0x2fe744[_0x09ec('0x25')][_0x09ec('0x30')]){_0x3dc03e[_0x09ec('0x2e')]=_[_0x09ec('0x31')](_0x3dc03e[_0x09ec('0x2e')],{'$or':_[_0x09ec('0x1f')](_0x4fa44f,function(_0x211af8){if(_0x211af8[_0x09ec('0x22')]!==_0x09ec('0x32')){var _0x3538f0={};_0x3538f0[_0x211af8[_0x09ec('0x1e')]]={'$like':'%'+_0x2fe744[_0x09ec('0x25')][_0x09ec('0x30')]+'%'};return _0x3538f0;}})});}_0x3dc03e=_['merge']({},_0x3dc03e,_0x2fe744['options']);var _0x5cbe5d={'where':_0x3dc03e['where']};return db[_0x09ec('0x33')][_0x09ec('0x16')](_0x5cbe5d)[_0x09ec('0x1b')](function(_0xab5d01){_0x32aaef['count']=_0xab5d01;if(_0x2fe744[_0x09ec('0x25')][_0x09ec('0x34')]){_0x3dc03e[_0x09ec('0x35')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x09ec('0x36')](_0x3dc03e);})[_0x09ec('0x1b')](function(_0x2d7447){_0x32aaef[_0x09ec('0x37')]=_0x2d7447;return _0x32aaef;})[_0x09ec('0x1b')](respondWithFilteredResult(_0x172d8d,_0x3dc03e))[_0x09ec('0x38')](handleError(_0x172d8d,null));};exports[_0x09ec('0x39')]=function(_0x4114ed,_0x160e1f){var _0x4af08b={'raw':![],'where':{'id':_0x4114ed[_0x09ec('0x3a')]['id']}},_0x4f1c55={};_0x4f1c55[_0x09ec('0x24')]=_[_0x09ec('0x26')](db[_0x09ec('0x33')][_0x09ec('0x20')]);_0x4f1c55[_0x09ec('0x25')]=_['keys'](_0x4114ed[_0x09ec('0x25')]);_0x4f1c55[_0x09ec('0x27')]=_['intersection'](_0x4f1c55[_0x09ec('0x24')],_0x4f1c55[_0x09ec('0x25')]);_0x4af08b[_0x09ec('0x29')]=_['intersection'](_0x4f1c55[_0x09ec('0x24')],qs[_0x09ec('0x2a')](_0x4114ed[_0x09ec('0x25')][_0x09ec('0x2a')]));_0x4af08b['attributes']=_0x4af08b[_0x09ec('0x29')][_0x09ec('0x2b')]?_0x4af08b['attributes']:_0x4f1c55[_0x09ec('0x24')];if(_0x4114ed['query'][_0x09ec('0x34')]){_0x4af08b['include']=[{'all':!![]}];}_0x4af08b=_[_0x09ec('0x31')]({},_0x4af08b,_0x4114ed[_0x09ec('0x3b')]);return db[_0x09ec('0x33')][_0x09ec('0x3c')](_0x4af08b)['then'](handleEntityNotFound(_0x160e1f,null))[_0x09ec('0x1b')](respondWithResult(_0x160e1f,null))[_0x09ec('0x38')](handleError(_0x160e1f,null));};exports[_0x09ec('0x3d')]=function(_0x37ea20,_0x3cbb55){return db[_0x09ec('0x33')]['create'](_0x37ea20[_0x09ec('0x3e')],{})[_0x09ec('0x1b')](respondWithResult(_0x3cbb55,0xc9))[_0x09ec('0x38')](handleError(_0x3cbb55,null));};exports[_0x09ec('0x3f')]=function(_0x1becb2,_0x217853){if(_0x1becb2[_0x09ec('0x3e')]['id']){delete _0x1becb2[_0x09ec('0x3e')]['id'];}return db[_0x09ec('0x33')]['find']({'where':{'id':_0x1becb2[_0x09ec('0x3a')]['id']}})[_0x09ec('0x1b')](handleEntityNotFound(_0x217853,null))[_0x09ec('0x1b')](saveUpdates(_0x1becb2[_0x09ec('0x3e')],null))[_0x09ec('0x1b')](respondWithResult(_0x217853,null))[_0x09ec('0x38')](handleError(_0x217853,null));};exports['destroy']=function(_0x13ea3d,_0x42bdab){return db[_0x09ec('0x33')][_0x09ec('0x3c')]({'where':{'id':_0x13ea3d[_0x09ec('0x3a')]['id']}})[_0x09ec('0x1b')](handleEntityNotFound(_0x42bdab,null))[_0x09ec('0x1b')](removeEntity(_0x42bdab,null))['catch'](handleError(_0x42bdab,null));};exports[_0x09ec('0x40')]=function(_0x131550,_0x501da1,_0x162731){var _0x59b633={};var _0x566f18={};var _0x18c120;var _0x3ba45a;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x131550['params']['id']}})[_0x09ec('0x1b')](handleEntityNotFound(_0x501da1,null))[_0x09ec('0x1b')](function(_0x1b78fc){if(_0x1b78fc){_0x18c120=_0x1b78fc;_0x566f18[_0x09ec('0x24')]=_['keys'](db['SalesforceField'][_0x09ec('0x20')]);_0x566f18['query']=_['keys'](_0x131550[_0x09ec('0x25')]);_0x566f18[_0x09ec('0x27')]=_[_0x09ec('0x28')](_0x566f18[_0x09ec('0x24')],_0x566f18[_0x09ec('0x25')]);_0x59b633[_0x09ec('0x29')]=_['intersection'](_0x566f18[_0x09ec('0x24')],qs[_0x09ec('0x2a')](_0x131550[_0x09ec('0x25')]['fields']));_0x59b633['attributes']=_0x59b633[_0x09ec('0x29')][_0x09ec('0x2b')]?_0x59b633[_0x09ec('0x29')]:_0x566f18[_0x09ec('0x24')];_0x59b633[_0x09ec('0x41')]=qs[_0x09ec('0x2d')](_0x131550['query'][_0x09ec('0x2d')]);_0x59b633[_0x09ec('0x2e')]=qs['filters'](_[_0x09ec('0x2f')](_0x131550['query'],_0x566f18[_0x09ec('0x27')]));if(_0x131550['query'][_0x09ec('0x30')]){_0x59b633[_0x09ec('0x2e')]=_[_0x09ec('0x31')](_0x59b633[_0x09ec('0x2e')],{'$or':_[_0x09ec('0x1f')](_0x59b633[_0x09ec('0x29')],function(_0x8df636){var _0x50b57f={};_0x50b57f[_0x8df636]={'$like':'%'+_0x131550['query'][_0x09ec('0x30')]+'%'};return _0x50b57f;})});}_0x59b633=_[_0x09ec('0x31')]({},_0x59b633,_0x131550[_0x09ec('0x3b')]);return _0x18c120[_0x09ec('0x40')](_0x59b633);}})[_0x09ec('0x1b')](function(_0x5e662a){if(_0x5e662a){_0x3ba45a=_0x5e662a[_0x09ec('0x2b')];if(!_0x131550[_0x09ec('0x25')]['hasOwnProperty']('nolimit')){_0x59b633[_0x09ec('0x14')]=qs[_0x09ec('0x14')](_0x131550['query'][_0x09ec('0x14')]);_0x59b633[_0x09ec('0x13')]=qs[_0x09ec('0x13')](_0x131550[_0x09ec('0x25')][_0x09ec('0x13')]);}return _0x18c120[_0x09ec('0x40')](_0x59b633);}})[_0x09ec('0x1b')](function(_0x320d5b){if(_0x320d5b){return _0x320d5b?{'count':_0x3ba45a,'rows':_0x320d5b}:null;}})[_0x09ec('0x1b')](respondWithResult(_0x501da1,null))[_0x09ec('0x38')](handleError(_0x501da1,null));};exports[_0x09ec('0x42')]=function(_0x467dca,_0x5efc0e,_0x1471d0){var _0x13856e={};var _0xce9ec0={};var _0x28f4cb;var _0x2b18ca;return db[_0x09ec('0x33')]['findOne']({'where':{'id':_0x467dca[_0x09ec('0x3a')]['id']}})[_0x09ec('0x1b')](handleEntityNotFound(_0x5efc0e,null))[_0x09ec('0x1b')](function(_0x22cef6){if(_0x22cef6){_0x28f4cb=_0x22cef6;_0xce9ec0[_0x09ec('0x24')]=_[_0x09ec('0x26')](db[_0x09ec('0x43')][_0x09ec('0x20')]);_0xce9ec0[_0x09ec('0x25')]=_[_0x09ec('0x26')](_0x467dca[_0x09ec('0x25')]);_0xce9ec0[_0x09ec('0x27')]=_[_0x09ec('0x28')](_0xce9ec0[_0x09ec('0x24')],_0xce9ec0[_0x09ec('0x25')]);_0x13856e[_0x09ec('0x29')]=_[_0x09ec('0x28')](_0xce9ec0[_0x09ec('0x24')],qs['fields'](_0x467dca['query'][_0x09ec('0x2a')]));_0x13856e[_0x09ec('0x29')]=_0x13856e[_0x09ec('0x29')]['length']?_0x13856e['attributes']:_0xce9ec0['model'];_0x13856e[_0x09ec('0x41')]=qs[_0x09ec('0x2d')](_0x467dca['query']['sort']);_0x13856e[_0x09ec('0x2e')]=qs['filters'](_[_0x09ec('0x2f')](_0x467dca['query'],_0xce9ec0[_0x09ec('0x27')]));if(_0x467dca[_0x09ec('0x25')][_0x09ec('0x30')]){_0x13856e['where']=_['merge'](_0x13856e[_0x09ec('0x2e')],{'$or':_[_0x09ec('0x1f')](_0x13856e[_0x09ec('0x29')],function(_0x37d05a){var _0x2c4959={};_0x2c4959[_0x37d05a]={'$like':'%'+_0x467dca['query'][_0x09ec('0x30')]+'%'};return _0x2c4959;})});}_0x13856e=_[_0x09ec('0x31')]({},_0x13856e,_0x467dca[_0x09ec('0x3b')]);return _0x28f4cb[_0x09ec('0x42')](_0x13856e);}})['then'](function(_0x160fe1){if(_0x160fe1){_0x2b18ca=_0x160fe1[_0x09ec('0x2b')];if(!_0x467dca['query'][_0x09ec('0x44')](_0x09ec('0x2c'))){_0x13856e[_0x09ec('0x14')]=qs[_0x09ec('0x14')](_0x467dca[_0x09ec('0x25')][_0x09ec('0x14')]);_0x13856e['offset']=qs[_0x09ec('0x13')](_0x467dca['query'][_0x09ec('0x13')]);}return _0x28f4cb[_0x09ec('0x42')](_0x13856e);}})[_0x09ec('0x1b')](function(_0x21c85f){if(_0x21c85f){return _0x21c85f?{'count':_0x2b18ca,'rows':_0x21c85f}:null;}})['then'](respondWithResult(_0x5efc0e,null))[_0x09ec('0x38')](handleError(_0x5efc0e,null));};exports['getDescriptions']=function(_0x2af08d,_0x2e5b62,_0x4f21fc){var _0xdc3825={};var _0x51b536={};var _0x36550c;var _0x5e6123;return db[_0x09ec('0x33')]['findOne']({'where':{'id':_0x2af08d['params']['id']}})[_0x09ec('0x1b')](handleEntityNotFound(_0x2e5b62,null))['then'](function(_0x2fef8a){if(_0x2fef8a){_0x36550c=_0x2fef8a;_0x51b536['model']=_[_0x09ec('0x26')](db[_0x09ec('0x43')][_0x09ec('0x20')]);_0x51b536[_0x09ec('0x25')]=_[_0x09ec('0x26')](_0x2af08d[_0x09ec('0x25')]);_0x51b536[_0x09ec('0x27')]=_[_0x09ec('0x28')](_0x51b536[_0x09ec('0x24')],_0x51b536[_0x09ec('0x25')]);_0xdc3825[_0x09ec('0x29')]=_[_0x09ec('0x28')](_0x51b536['model'],qs[_0x09ec('0x2a')](_0x2af08d[_0x09ec('0x25')]['fields']));_0xdc3825[_0x09ec('0x29')]=_0xdc3825[_0x09ec('0x29')][_0x09ec('0x2b')]?_0xdc3825[_0x09ec('0x29')]:_0x51b536[_0x09ec('0x24')];_0xdc3825['order']=qs['sort'](_0x2af08d[_0x09ec('0x25')]['sort']);_0xdc3825[_0x09ec('0x2e')]=qs[_0x09ec('0x27')](_[_0x09ec('0x2f')](_0x2af08d[_0x09ec('0x25')],_0x51b536[_0x09ec('0x27')]));if(_0x2af08d[_0x09ec('0x25')][_0x09ec('0x30')]){_0xdc3825[_0x09ec('0x2e')]=_[_0x09ec('0x31')](_0xdc3825['where'],{'$or':_['map'](_0xdc3825[_0x09ec('0x29')],function(_0x416f5e){var _0x3dba1b={};_0x3dba1b[_0x416f5e]={'$like':'%'+_0x2af08d[_0x09ec('0x25')][_0x09ec('0x30')]+'%'};return _0x3dba1b;})});}_0xdc3825=_[_0x09ec('0x31')]({},_0xdc3825,_0x2af08d['options']);return _0x36550c[_0x09ec('0x45')](_0xdc3825);}})[_0x09ec('0x1b')](function(_0x46e452){if(_0x46e452){_0x5e6123=_0x46e452[_0x09ec('0x2b')];if(!_0x2af08d[_0x09ec('0x25')][_0x09ec('0x44')](_0x09ec('0x2c'))){_0xdc3825[_0x09ec('0x14')]=qs['limit'](_0x2af08d['query'][_0x09ec('0x14')]);_0xdc3825[_0x09ec('0x13')]=qs[_0x09ec('0x13')](_0x2af08d[_0x09ec('0x25')]['offset']);}return _0x36550c[_0x09ec('0x45')](_0xdc3825);}})[_0x09ec('0x1b')](function(_0x7dd954){if(_0x7dd954){return _0x7dd954?{'count':_0x5e6123,'rows':_0x7dd954}:null;}})['then'](respondWithResult(_0x2e5b62,null))[_0x09ec('0x38')](handleError(_0x2e5b62,null));}; \ No newline at end of file +var _0x433a=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','SalesforceField','order','getFields','hasOwnProperty','getSubjects','findOne','getDescriptions'];(function(_0x25e3d3,_0x1d2882){var _0x42ad83=function(_0x5f3010){while(--_0x5f3010){_0x25e3d3['push'](_0x25e3d3['shift']());}};_0x42ad83(++_0x1d2882);}(_0x433a,0x14c));var _0xa433=function(_0x47ae1a,_0x2f181b){_0x47ae1a=_0x47ae1a-0x0;var _0xbdf23a=_0x433a[_0x47ae1a];return _0xbdf23a;};'use strict';var emlformat=require(_0xa433('0x0'));var rimraf=require(_0xa433('0x1'));var zipdir=require(_0xa433('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa433('0x3'));var moment=require(_0xa433('0x4'));var BPromise=require(_0xa433('0x5'));var Mustache=require(_0xa433('0x6'));var util=require('util');var path=require(_0xa433('0x7'));var sox=require(_0xa433('0x8'));var csv=require('to-csv');var ejs=require(_0xa433('0x9'));var fs=require('fs');var fs_extra=require(_0xa433('0xa'));var _=require(_0xa433('0xb'));var squel=require(_0xa433('0xc'));var crypto=require(_0xa433('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa433('0xe'));var toCsv=require(_0xa433('0xf'));var querystring=require('querystring');var Papa=require(_0xa433('0x10'));var Redis=require(_0xa433('0x11'));var authService=require(_0xa433('0x12'));var qs=require(_0xa433('0x13'));var as=require(_0xa433('0x14'));var hardwareService=require(_0xa433('0x15'));var logger=require(_0xa433('0x16'))(_0xa433('0x17'));var utils=require(_0xa433('0x18'));var config=require(_0xa433('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa433('0x1a'))['db'];function respondWithStatusCode(_0x2faac1,_0x3e08de){_0x3e08de=_0x3e08de||0xcc;return function(_0x3640f3){if(_0x3640f3){return _0x2faac1['sendStatus'](_0x3e08de);}return _0x2faac1[_0xa433('0x1b')](_0x3e08de)[_0xa433('0x1c')]();};}function respondWithResult(_0x1d4755,_0x202e57){_0x202e57=_0x202e57||0xc8;return function(_0x2c8f21){if(_0x2c8f21){return _0x1d4755[_0xa433('0x1b')](_0x202e57)[_0xa433('0x1d')](_0x2c8f21);}};}function respondWithFilteredResult(_0x224a3a,_0x4dd1d3){return function(_0x3b1d87){if(_0x3b1d87){var _0x4f469a=typeof _0x4dd1d3[_0xa433('0x1e')]===_0xa433('0x1f')&&typeof _0x4dd1d3[_0xa433('0x20')]===_0xa433('0x1f');var _0x3c5db6=_0x3b1d87[_0xa433('0x21')];var _0x4608eb=_0x4f469a?0x0:_0x4dd1d3[_0xa433('0x1e')];var _0x2cf11a=_0x4f469a?_0x3b1d87[_0xa433('0x21')]:_0x4dd1d3[_0xa433('0x1e')]+_0x4dd1d3[_0xa433('0x20')];var _0x74f26e;if(_0x2cf11a>=_0x3c5db6){_0x2cf11a=_0x3c5db6;_0x74f26e=0xc8;}else{_0x74f26e=0xce;}_0x224a3a[_0xa433('0x1b')](_0x74f26e);return _0x224a3a['set']('Content-Range',_0x4608eb+'-'+_0x2cf11a+'/'+_0x3c5db6)[_0xa433('0x1d')](_0x3b1d87);}return null;};}function patchUpdates(_0x43cce8){return function(_0x15c707){try{jsonpatch[_0xa433('0x22')](_0x15c707,_0x43cce8,!![]);}catch(_0x2ad2fe){return BPromise[_0xa433('0x23')](_0x2ad2fe);}return _0x15c707[_0xa433('0x24')]();};}function saveUpdates(_0x372ae7,_0x110a0c){return function(_0x507bfe){if(_0x507bfe){return _0x507bfe[_0xa433('0x25')](_0x372ae7)[_0xa433('0x26')](function(_0x2d3d47){return _0x2d3d47;});}return null;};}function removeEntity(_0x76204b,_0x17ad51){return function(_0xe7ecc5){if(_0xe7ecc5){return _0xe7ecc5[_0xa433('0x27')]()[_0xa433('0x26')](function(){_0x76204b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc733a,_0x344c9e){return function(_0x1da4f8){if(!_0x1da4f8){_0xc733a['sendStatus'](0x194);}return _0x1da4f8;};}function handleError(_0x2d0e4d,_0x1b451c){_0x1b451c=_0x1b451c||0x1f4;return function(_0x318b60){logger[_0xa433('0x28')](_0x318b60[_0xa433('0x29')]);if(_0x318b60[_0xa433('0x2a')]){delete _0x318b60[_0xa433('0x2a')];}_0x2d0e4d[_0xa433('0x1b')](_0x1b451c)[_0xa433('0x2b')](_0x318b60);};}exports[_0xa433('0x2c')]=function(_0x304836,_0x36ce46){var _0x123a83={},_0xea450a={},_0x40cf80={'count':0x0,'rows':[]};var _0x3cc2c2=_[_0xa433('0x2d')](db[_0xa433('0x2e')][_0xa433('0x2f')],function(_0x52b9c1){return{'name':_0x52b9c1[_0xa433('0x30')],'type':_0x52b9c1[_0xa433('0x31')]['key']};});_0xea450a[_0xa433('0x32')]=_[_0xa433('0x2d')](_0x3cc2c2,_0xa433('0x2a'));_0xea450a['query']=_[_0xa433('0x33')](_0x304836[_0xa433('0x34')]);_0xea450a[_0xa433('0x35')]=_[_0xa433('0x36')](_0xea450a[_0xa433('0x32')],_0xea450a[_0xa433('0x34')]);_0x123a83[_0xa433('0x37')]=_[_0xa433('0x36')](_0xea450a['model'],qs[_0xa433('0x38')](_0x304836['query'][_0xa433('0x38')]));_0x123a83[_0xa433('0x37')]=_0x123a83[_0xa433('0x37')][_0xa433('0x39')]?_0x123a83[_0xa433('0x37')]:_0xea450a[_0xa433('0x32')];if(!_0x304836['query']['hasOwnProperty'](_0xa433('0x3a'))){_0x123a83['limit']=qs[_0xa433('0x20')](_0x304836[_0xa433('0x34')][_0xa433('0x20')]);_0x123a83[_0xa433('0x1e')]=qs[_0xa433('0x1e')](_0x304836['query'][_0xa433('0x1e')]);}_0x123a83['order']=qs[_0xa433('0x3b')](_0x304836['query'][_0xa433('0x3b')]);_0x123a83[_0xa433('0x3c')]=qs[_0xa433('0x35')](_[_0xa433('0x3d')](_0x304836[_0xa433('0x34')],_0xea450a['filters']),_0x3cc2c2);if(_0x304836[_0xa433('0x34')][_0xa433('0x3e')]){_0x123a83['where']=_['merge'](_0x123a83[_0xa433('0x3c')],{'$or':_[_0xa433('0x2d')](_0x3cc2c2,function(_0x4bd228){if(_0x4bd228[_0xa433('0x31')]!==_0xa433('0x3f')){var _0x59308b={};_0x59308b[_0x4bd228[_0xa433('0x2a')]]={'$like':'%'+_0x304836[_0xa433('0x34')]['filter']+'%'};return _0x59308b;}})});}_0x123a83=_[_0xa433('0x40')]({},_0x123a83,_0x304836['options']);var _0x20e908={'where':_0x123a83[_0xa433('0x3c')]};return db[_0xa433('0x2e')][_0xa433('0x21')](_0x20e908)[_0xa433('0x26')](function(_0x34530b){_0x40cf80[_0xa433('0x21')]=_0x34530b;if(_0x304836[_0xa433('0x34')][_0xa433('0x41')]){_0x123a83[_0xa433('0x42')]=[{'all':!![]}];}return db[_0xa433('0x2e')][_0xa433('0x43')](_0x123a83);})[_0xa433('0x26')](function(_0x1df320){_0x40cf80[_0xa433('0x44')]=_0x1df320;return _0x40cf80;})['then'](respondWithFilteredResult(_0x36ce46,_0x123a83))[_0xa433('0x45')](handleError(_0x36ce46,null));};exports[_0xa433('0x46')]=function(_0x309e5d,_0xc8d776){var _0x5ed624={'raw':![],'where':{'id':_0x309e5d[_0xa433('0x47')]['id']}},_0x473e63={};_0x473e63[_0xa433('0x32')]=_[_0xa433('0x33')](db[_0xa433('0x2e')][_0xa433('0x2f')]);_0x473e63[_0xa433('0x34')]=_['keys'](_0x309e5d[_0xa433('0x34')]);_0x473e63[_0xa433('0x35')]=_[_0xa433('0x36')](_0x473e63['model'],_0x473e63[_0xa433('0x34')]);_0x5ed624[_0xa433('0x37')]=_[_0xa433('0x36')](_0x473e63[_0xa433('0x32')],qs[_0xa433('0x38')](_0x309e5d['query'][_0xa433('0x38')]));_0x5ed624[_0xa433('0x37')]=_0x5ed624[_0xa433('0x37')]['length']?_0x5ed624['attributes']:_0x473e63[_0xa433('0x32')];if(_0x309e5d[_0xa433('0x34')][_0xa433('0x41')]){_0x5ed624['include']=[{'all':!![]}];}_0x5ed624=_['merge']({},_0x5ed624,_0x309e5d[_0xa433('0x48')]);return db[_0xa433('0x2e')][_0xa433('0x49')](_0x5ed624)['then'](handleEntityNotFound(_0xc8d776,null))[_0xa433('0x26')](respondWithResult(_0xc8d776,null))['catch'](handleError(_0xc8d776,null));};exports[_0xa433('0x4a')]=function(_0x3958c6,_0x2b7c34){return db[_0xa433('0x2e')][_0xa433('0x4a')](_0x3958c6[_0xa433('0x4b')],{})['then'](respondWithResult(_0x2b7c34,0xc9))[_0xa433('0x45')](handleError(_0x2b7c34,null));};exports['update']=function(_0x1a25fc,_0x6bae8a){if(_0x1a25fc[_0xa433('0x4b')]['id']){delete _0x1a25fc[_0xa433('0x4b')]['id'];}return db[_0xa433('0x2e')]['find']({'where':{'id':_0x1a25fc['params']['id']}})[_0xa433('0x26')](handleEntityNotFound(_0x6bae8a,null))[_0xa433('0x26')](saveUpdates(_0x1a25fc[_0xa433('0x4b')],null))[_0xa433('0x26')](respondWithResult(_0x6bae8a,null))[_0xa433('0x45')](handleError(_0x6bae8a,null));};exports[_0xa433('0x27')]=function(_0x361c8d,_0xc9051b){return db[_0xa433('0x2e')][_0xa433('0x49')]({'where':{'id':_0x361c8d[_0xa433('0x47')]['id']}})[_0xa433('0x26')](handleEntityNotFound(_0xc9051b,null))['then'](removeEntity(_0xc9051b,null))[_0xa433('0x45')](handleError(_0xc9051b,null));};exports['getFields']=function(_0x43fae3,_0x5e24c9,_0x196c04){var _0x5b9933={};var _0x2ebb2b={};var _0x3741f9;var _0x39eac6;return db[_0xa433('0x2e')]['findOne']({'where':{'id':_0x43fae3[_0xa433('0x47')]['id']}})[_0xa433('0x26')](handleEntityNotFound(_0x5e24c9,null))[_0xa433('0x26')](function(_0x170934){if(_0x170934){_0x3741f9=_0x170934;_0x2ebb2b[_0xa433('0x32')]=_[_0xa433('0x33')](db[_0xa433('0x4c')][_0xa433('0x2f')]);_0x2ebb2b[_0xa433('0x34')]=_[_0xa433('0x33')](_0x43fae3['query']);_0x2ebb2b[_0xa433('0x35')]=_['intersection'](_0x2ebb2b['model'],_0x2ebb2b['query']);_0x5b9933[_0xa433('0x37')]=_[_0xa433('0x36')](_0x2ebb2b[_0xa433('0x32')],qs[_0xa433('0x38')](_0x43fae3[_0xa433('0x34')][_0xa433('0x38')]));_0x5b9933[_0xa433('0x37')]=_0x5b9933['attributes'][_0xa433('0x39')]?_0x5b9933[_0xa433('0x37')]:_0x2ebb2b['model'];_0x5b9933[_0xa433('0x4d')]=qs['sort'](_0x43fae3[_0xa433('0x34')][_0xa433('0x3b')]);_0x5b9933[_0xa433('0x3c')]=qs[_0xa433('0x35')](_[_0xa433('0x3d')](_0x43fae3[_0xa433('0x34')],_0x2ebb2b[_0xa433('0x35')]));if(_0x43fae3['query'][_0xa433('0x3e')]){_0x5b9933[_0xa433('0x3c')]=_[_0xa433('0x40')](_0x5b9933['where'],{'$or':_['map'](_0x5b9933[_0xa433('0x37')],function(_0x3cbcdb){var _0x4e3c39={};_0x4e3c39[_0x3cbcdb]={'$like':'%'+_0x43fae3[_0xa433('0x34')]['filter']+'%'};return _0x4e3c39;})});}_0x5b9933=_[_0xa433('0x40')]({},_0x5b9933,_0x43fae3[_0xa433('0x48')]);return _0x3741f9[_0xa433('0x4e')](_0x5b9933);}})[_0xa433('0x26')](function(_0x1c3ebd){if(_0x1c3ebd){_0x39eac6=_0x1c3ebd[_0xa433('0x39')];if(!_0x43fae3[_0xa433('0x34')][_0xa433('0x4f')](_0xa433('0x3a'))){_0x5b9933['limit']=qs[_0xa433('0x20')](_0x43fae3[_0xa433('0x34')][_0xa433('0x20')]);_0x5b9933[_0xa433('0x1e')]=qs[_0xa433('0x1e')](_0x43fae3[_0xa433('0x34')][_0xa433('0x1e')]);}return _0x3741f9[_0xa433('0x4e')](_0x5b9933);}})[_0xa433('0x26')](function(_0x3c08d7){if(_0x3c08d7){return _0x3c08d7?{'count':_0x39eac6,'rows':_0x3c08d7}:null;}})[_0xa433('0x26')](respondWithResult(_0x5e24c9,null))['catch'](handleError(_0x5e24c9,null));};exports[_0xa433('0x50')]=function(_0x2d8568,_0x454407,_0x24c9b5){var _0xaeb340={};var _0xb42883={};var _0xaabafd;var _0x27f74a;return db[_0xa433('0x2e')][_0xa433('0x51')]({'where':{'id':_0x2d8568['params']['id']}})[_0xa433('0x26')](handleEntityNotFound(_0x454407,null))[_0xa433('0x26')](function(_0x4d4da3){if(_0x4d4da3){_0xaabafd=_0x4d4da3;_0xb42883[_0xa433('0x32')]=_[_0xa433('0x33')](db[_0xa433('0x4c')][_0xa433('0x2f')]);_0xb42883[_0xa433('0x34')]=_[_0xa433('0x33')](_0x2d8568[_0xa433('0x34')]);_0xb42883[_0xa433('0x35')]=_[_0xa433('0x36')](_0xb42883[_0xa433('0x32')],_0xb42883[_0xa433('0x34')]);_0xaeb340[_0xa433('0x37')]=_['intersection'](_0xb42883[_0xa433('0x32')],qs[_0xa433('0x38')](_0x2d8568[_0xa433('0x34')]['fields']));_0xaeb340[_0xa433('0x37')]=_0xaeb340['attributes'][_0xa433('0x39')]?_0xaeb340[_0xa433('0x37')]:_0xb42883[_0xa433('0x32')];_0xaeb340[_0xa433('0x4d')]=qs[_0xa433('0x3b')](_0x2d8568[_0xa433('0x34')][_0xa433('0x3b')]);_0xaeb340[_0xa433('0x3c')]=qs[_0xa433('0x35')](_['pick'](_0x2d8568[_0xa433('0x34')],_0xb42883[_0xa433('0x35')]));if(_0x2d8568['query']['filter']){_0xaeb340[_0xa433('0x3c')]=_[_0xa433('0x40')](_0xaeb340[_0xa433('0x3c')],{'$or':_[_0xa433('0x2d')](_0xaeb340[_0xa433('0x37')],function(_0x2fe712){var _0x67be3a={};_0x67be3a[_0x2fe712]={'$like':'%'+_0x2d8568[_0xa433('0x34')][_0xa433('0x3e')]+'%'};return _0x67be3a;})});}_0xaeb340=_[_0xa433('0x40')]({},_0xaeb340,_0x2d8568['options']);return _0xaabafd[_0xa433('0x50')](_0xaeb340);}})[_0xa433('0x26')](function(_0xb4f95e){if(_0xb4f95e){_0x27f74a=_0xb4f95e[_0xa433('0x39')];if(!_0x2d8568[_0xa433('0x34')][_0xa433('0x4f')]('nolimit')){_0xaeb340[_0xa433('0x20')]=qs[_0xa433('0x20')](_0x2d8568['query'][_0xa433('0x20')]);_0xaeb340[_0xa433('0x1e')]=qs['offset'](_0x2d8568['query']['offset']);}return _0xaabafd['getSubjects'](_0xaeb340);}})[_0xa433('0x26')](function(_0x3c4003){if(_0x3c4003){return _0x3c4003?{'count':_0x27f74a,'rows':_0x3c4003}:null;}})[_0xa433('0x26')](respondWithResult(_0x454407,null))[_0xa433('0x45')](handleError(_0x454407,null));};exports['getDescriptions']=function(_0x203437,_0x5a9ba9,_0x4a96e9){var _0x10b3f9={};var _0x3cc1b2={};var _0x256be4;var _0x284ef6;return db[_0xa433('0x2e')]['findOne']({'where':{'id':_0x203437[_0xa433('0x47')]['id']}})[_0xa433('0x26')](handleEntityNotFound(_0x5a9ba9,null))[_0xa433('0x26')](function(_0x224bfd){if(_0x224bfd){_0x256be4=_0x224bfd;_0x3cc1b2['model']=_[_0xa433('0x33')](db[_0xa433('0x4c')]['rawAttributes']);_0x3cc1b2[_0xa433('0x34')]=_[_0xa433('0x33')](_0x203437[_0xa433('0x34')]);_0x3cc1b2[_0xa433('0x35')]=_['intersection'](_0x3cc1b2[_0xa433('0x32')],_0x3cc1b2[_0xa433('0x34')]);_0x10b3f9['attributes']=_[_0xa433('0x36')](_0x3cc1b2[_0xa433('0x32')],qs['fields'](_0x203437['query'][_0xa433('0x38')]));_0x10b3f9[_0xa433('0x37')]=_0x10b3f9[_0xa433('0x37')][_0xa433('0x39')]?_0x10b3f9[_0xa433('0x37')]:_0x3cc1b2[_0xa433('0x32')];_0x10b3f9[_0xa433('0x4d')]=qs[_0xa433('0x3b')](_0x203437['query']['sort']);_0x10b3f9[_0xa433('0x3c')]=qs[_0xa433('0x35')](_['pick'](_0x203437[_0xa433('0x34')],_0x3cc1b2[_0xa433('0x35')]));if(_0x203437[_0xa433('0x34')][_0xa433('0x3e')]){_0x10b3f9[_0xa433('0x3c')]=_[_0xa433('0x40')](_0x10b3f9[_0xa433('0x3c')],{'$or':_[_0xa433('0x2d')](_0x10b3f9[_0xa433('0x37')],function(_0x2e46dd){var _0x145246={};_0x145246[_0x2e46dd]={'$like':'%'+_0x203437[_0xa433('0x34')][_0xa433('0x3e')]+'%'};return _0x145246;})});}_0x10b3f9=_[_0xa433('0x40')]({},_0x10b3f9,_0x203437[_0xa433('0x48')]);return _0x256be4[_0xa433('0x52')](_0x10b3f9);}})[_0xa433('0x26')](function(_0x24342a){if(_0x24342a){_0x284ef6=_0x24342a[_0xa433('0x39')];if(!_0x203437[_0xa433('0x34')][_0xa433('0x4f')]('nolimit')){_0x10b3f9['limit']=qs[_0xa433('0x20')](_0x203437[_0xa433('0x34')]['limit']);_0x10b3f9[_0xa433('0x1e')]=qs[_0xa433('0x1e')](_0x203437['query'][_0xa433('0x1e')]);}return _0x256be4[_0xa433('0x52')](_0x10b3f9);}})[_0xa433('0x26')](function(_0xc84e96){if(_0xc84e96){return _0xc84e96?{'count':_0x284ef6,'rows':_0xc84e96}:null;}})[_0xa433('0x26')](respondWithResult(_0x5a9ba9,null))[_0xa433('0x45')](handleError(_0x5a9ba9,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 1352dff..dd5cf9b 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 _0x4291=['bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x1b9d5d,_0x2cc276){var _0x43caa9=function(_0x45a0a8){while(--_0x45a0a8){_0x1b9d5d['push'](_0x1b9d5d['shift']());}};_0x43caa9(++_0x2cc276);}(_0x4291,0xaf));var _0x1429=function(_0x908983,_0x369163){_0x908983=_0x908983-0x0;var _0x5dd60c=_0x4291[_0x908983];return _0x5dd60c;};'use strict';var _=require(_0x1429('0x0'));var util=require(_0x1429('0x1'));var logger=require(_0x1429('0x2'))(_0x1429('0x3'));var moment=require(_0x1429('0x4'));var BPromise=require(_0x1429('0x5'));var rp=require(_0x1429('0x6'));var fs=require('fs');var path=require(_0x1429('0x7'));var rimraf=require(_0x1429('0x8'));var config=require(_0x1429('0x9'));var attributes=require(_0x1429('0xa'));module[_0x1429('0xb')]=function(_0x2debce,_0x54b981){return _0x2debce[_0x1429('0xc')](_0x1429('0xd'),attributes,{'tableName':_0x1429('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc367=['./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1a1f53,_0x44bd0d){var _0x418d2e=function(_0xa33304){while(--_0xa33304){_0x1a1f53['push'](_0x1a1f53['shift']());}};_0x418d2e(++_0x44bd0d);}(_0xc367,0x12f));var _0x7c36=function(_0x3b1aa3,_0x1da6df){_0x3b1aa3=_0x3b1aa3-0x0;var _0xa5550d=_0xc367[_0x3b1aa3];return _0xa5550d;};'use strict';var _=require(_0x7c36('0x0'));var util=require(_0x7c36('0x1'));var logger=require(_0x7c36('0x2'))(_0x7c36('0x3'));var moment=require(_0x7c36('0x4'));var BPromise=require('bluebird');var rp=require(_0x7c36('0x5'));var fs=require('fs');var path=require(_0x7c36('0x6'));var rimraf=require(_0x7c36('0x7'));var config=require(_0x7c36('0x8'));var attributes=require(_0x7c36('0x9'));module['exports']=function(_0x3cff10,_0x2b402f){return _0x3cff10[_0x7c36('0xa')](_0x7c36('0xb'),attributes,{'tableName':_0x7c36('0xc'),'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 5305f61..d281e84 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 _0x3812=['code','message','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x46a3ff,_0x470b9a){var _0x404bc2=function(_0x20f25f){while(--_0x20f25f){_0x46a3ff['push'](_0x46a3ff['shift']());}};_0x404bc2(++_0x470b9a);}(_0x3812,0xff));var _0x2381=function(_0xe77f44,_0x54c61c){_0xe77f44=_0xe77f44-0x0;var _0x51c970=_0x3812[_0xe77f44];return _0x51c970;};'use strict';var _=require(_0x2381('0x0'));var util=require(_0x2381('0x1'));var moment=require('moment');var BPromise=require(_0x2381('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2381('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2381('0x4'));var logger=require(_0x2381('0x5'))('rpc');var config=require(_0x2381('0x6'));var jayson=require(_0x2381('0x7'));var client=jayson[_0x2381('0x8')][_0x2381('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42d36e,_0x100dbe,_0x4231e1){return new BPromise(function(_0x29d674,_0x4c92ae){return client[_0x2381('0xa')](_0x42d36e,_0x4231e1)['then'](function(_0x45faf9){logger[_0x2381('0xb')](_0x2381('0xc'),_0x100dbe,_0x2381('0xd'));logger[_0x2381('0xe')](_0x2381('0xf'),_0x100dbe,'request\x20sent',JSON[_0x2381('0x10')](_0x45faf9));if(_0x45faf9['error']){if(_0x45faf9[_0x2381('0x11')][_0x2381('0x12')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x100dbe,_0x45faf9[_0x2381('0x11')]['message']);return _0x4c92ae(_0x45faf9['error']['message']);}logger[_0x2381('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x100dbe,_0x45faf9[_0x2381('0x11')][_0x2381('0x13')]);return _0x29d674(_0x45faf9[_0x2381('0x11')][_0x2381('0x13')]);}else{logger[_0x2381('0xb')](_0x2381('0xc'),_0x100dbe,'request\x20sent');_0x29d674(_0x45faf9[_0x2381('0x14')][_0x2381('0x13')]);}})['catch'](function(_0xd74263){logger[_0x2381('0x11')](_0x2381('0xc'),_0x100dbe,_0xd74263);_0x4c92ae(_0xd74263);});});} \ No newline at end of file +var _0x19d2=['error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x24e28d,_0x8329a2){var _0x3991b5=function(_0x120ce0){while(--_0x120ce0){_0x24e28d['push'](_0x24e28d['shift']());}};_0x3991b5(++_0x8329a2);}(_0x19d2,0xb9));var _0x219d=function(_0x671b9f,_0x56ee29){_0x671b9f=_0x671b9f-0x0;var _0x152ea5=_0x19d2[_0x671b9f];return _0x152ea5;};'use strict';var _=require('lodash');var util=require(_0x219d('0x0'));var moment=require(_0x219d('0x1'));var BPromise=require(_0x219d('0x2'));var rs=require(_0x219d('0x3'));var fs=require('fs');var Redis=require(_0x219d('0x4'));var db=require(_0x219d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x219d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x219d('0x7')][_0x219d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x551127,_0x1b0e4d,_0x4622d9){return new BPromise(function(_0x6dea63,_0x106d9c){return client[_0x219d('0x9')](_0x551127,_0x4622d9)[_0x219d('0xa')](function(_0x8f5db9){logger['info'](_0x219d('0xb'),_0x1b0e4d,_0x219d('0xc'));logger[_0x219d('0xd')](_0x219d('0xe'),_0x1b0e4d,'request\x20sent',JSON['stringify'](_0x8f5db9));if(_0x8f5db9[_0x219d('0xf')]){if(_0x8f5db9[_0x219d('0xf')]['code']===0x1f4){logger[_0x219d('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1b0e4d,_0x8f5db9[_0x219d('0xf')]['message']);return _0x106d9c(_0x8f5db9['error']['message']);}logger[_0x219d('0xf')](_0x219d('0xb'),_0x1b0e4d,_0x8f5db9[_0x219d('0xf')][_0x219d('0x10')]);return _0x6dea63(_0x8f5db9[_0x219d('0xf')]['message']);}else{logger[_0x219d('0x11')](_0x219d('0xb'),_0x1b0e4d,_0x219d('0xc'));_0x6dea63(_0x8f5db9[_0x219d('0x12')]['message']);}})[_0x219d('0x13')](function(_0x38fbf5){logger[_0x219d('0xf')](_0x219d('0xb'),_0x1b0e4d,_0x38fbf5);_0x106d9c(_0x38fbf5);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index b6a424a..046fe47 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 _0x332a=['post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show'];(function(_0x4ccb85,_0x447e98){var _0x1f078b=function(_0x15ad20){while(--_0x15ad20){_0x4ccb85['push'](_0x4ccb85['shift']());}};_0x1f078b(++_0x447e98);}(_0x332a,0x70));var _0xa332=function(_0x1a3e2b,_0xa75584){_0x1a3e2b=_0x1a3e2b-0x0;var _0x23969f=_0x332a[_0x1a3e2b];return _0x23969f;};'use strict';var multer=require('multer');var util=require(_0xa332('0x0'));var path=require(_0xa332('0x1'));var timeout=require(_0xa332('0x2'));var express=require(_0xa332('0x3'));var router=express[_0xa332('0x4')]();var fs_extra=require(_0xa332('0x5'));var auth=require(_0xa332('0x6'));var interaction=require(_0xa332('0x7'));var config=require(_0xa332('0x8'));var controller=require(_0xa332('0x9'));router[_0xa332('0xa')]('/',auth[_0xa332('0xb')](),controller[_0xa332('0xc')]);router[_0xa332('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xa332('0xd')]);router[_0xa332('0xe')]('/',auth[_0xa332('0xb')](),controller[_0xa332('0xf')]);router[_0xa332('0x10')](_0xa332('0x11'),auth[_0xa332('0xb')](),controller[_0xa332('0x12')]);router[_0xa332('0x13')](_0xa332('0x11'),auth[_0xa332('0xb')](),controller['destroy']);module[_0xa332('0x14')]=router; \ No newline at end of file +var _0x027a=['create','put','update','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show'];(function(_0x572650,_0x482c57){var _0x3827a1=function(_0x24cfa3){while(--_0x24cfa3){_0x572650['push'](_0x572650['shift']());}};_0x3827a1(++_0x482c57);}(_0x027a,0x1c7));var _0xa027=function(_0x552a7c,_0x208c6d){_0x552a7c=_0x552a7c-0x0;var _0x291adf=_0x027a[_0x552a7c];return _0x291adf;};'use strict';var multer=require('multer');var util=require(_0xa027('0x0'));var path=require(_0xa027('0x1'));var timeout=require('connect-timeout');var express=require(_0xa027('0x2'));var router=express[_0xa027('0x3')]();var fs_extra=require(_0xa027('0x4'));var auth=require(_0xa027('0x5'));var interaction=require(_0xa027('0x6'));var config=require(_0xa027('0x7'));var controller=require(_0xa027('0x8'));router[_0xa027('0x9')]('/',auth[_0xa027('0xa')](),controller[_0xa027('0xb')]);router['get']('/:id',auth[_0xa027('0xa')](),controller[_0xa027('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa027('0xd')]);router[_0xa027('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xa027('0xf')]);router['delete'](_0xa027('0x10'),auth[_0xa027('0xa')](),controller['destroy']);module[_0xa027('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 176b10e..a61bb13 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 _0x76ab=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x5b0d5a,_0x30a682){var _0x1b4ba3=function(_0x254619){while(--_0x254619){_0x5b0d5a['push'](_0x5b0d5a['shift']());}};_0x1b4ba3(++_0x30a682);}(_0x76ab,0x1d0));var _0xb76a=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x76ab[_0x5a95fa];return _0x1a61b8;};'use strict';var Sequelize=require(_0xb76a('0x0'));module[_0xb76a('0x1')]={'type':{'type':Sequelize[_0xb76a('0x2')](_0xb76a('0x3'),_0xb76a('0x4'),_0xb76a('0x5'),_0xb76a('0x6'),'picklist'),'defaultValue':_0xb76a('0x3')},'content':{'type':Sequelize[_0xb76a('0x7')]},'key':{'type':Sequelize[_0xb76a('0x7')]},'keyType':{'type':Sequelize[_0xb76a('0x2')](_0xb76a('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xb76a('0x7')]},'idField':{'type':Sequelize[_0xb76a('0x7')]},'variableName':{'type':Sequelize[_0xb76a('0x7')]}}; \ No newline at end of file +var _0x4202=['keyValue','picklist','STRING','ENUM','string','variable','customVariable'];(function(_0x1aaa00,_0x245138){var _0x4be822=function(_0x249c61){while(--_0x249c61){_0x1aaa00['push'](_0x1aaa00['shift']());}};_0x4be822(++_0x245138);}(_0x4202,0x73));var _0x2420=function(_0x5ea2f9,_0x320917){_0x5ea2f9=_0x5ea2f9-0x0;var _0x36e586=_0x4202[_0x5ea2f9];return _0x36e586;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2420('0x0')](_0x2420('0x1'),_0x2420('0x2'),_0x2420('0x3'),_0x2420('0x4'),_0x2420('0x5')),'defaultValue':_0x2420('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2420('0x6')]},'keyType':{'type':Sequelize[_0x2420('0x0')](_0x2420('0x1'),_0x2420('0x2'),_0x2420('0x3'))},'keyContent':{'type':Sequelize[_0x2420('0x6')]},'idField':{'type':Sequelize[_0x2420('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index eec9af4..ca27859 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 _0xad95=['../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SalesforceField','includeAll','include','findAll','rows','catch','params','keys','find','create','body','eml-format','zip-dir','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x3a7db0,_0xe93c50){var _0x17cbba=function(_0x577f4c){while(--_0x577f4c){_0x3a7db0['push'](_0x3a7db0['shift']());}};_0x17cbba(++_0xe93c50);}(_0xad95,0x1b1));var _0x5ad9=function(_0x4a7ced,_0x3087c4){_0x4a7ced=_0x4a7ced-0x0;var _0x1d6e9c=_0xad95[_0x4a7ced];return _0x1d6e9c;};'use strict';var emlformat=require(_0x5ad9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5ad9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5ad9('0x2'));var Mustache=require(_0x5ad9('0x3'));var util=require(_0x5ad9('0x4'));var path=require(_0x5ad9('0x5'));var sox=require(_0x5ad9('0x6'));var csv=require('to-csv');var ejs=require(_0x5ad9('0x7'));var fs=require('fs');var fs_extra=require(_0x5ad9('0x8'));var _=require(_0x5ad9('0x9'));var squel=require(_0x5ad9('0xa'));var crypto=require(_0x5ad9('0xb'));var jsforce=require(_0x5ad9('0xc'));var deskjs=require(_0x5ad9('0xd'));var toCsv=require(_0x5ad9('0xe'));var querystring=require('querystring');var Papa=require(_0x5ad9('0xf'));var Redis=require('ioredis');var authService=require(_0x5ad9('0x10'));var qs=require(_0x5ad9('0x11'));var as=require(_0x5ad9('0x12'));var hardwareService=require(_0x5ad9('0x13'));var logger=require(_0x5ad9('0x14'))(_0x5ad9('0x15'));var utils=require('../../config/utils');var config=require(_0x5ad9('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5ad9('0x17'))['db'];function respondWithStatusCode(_0x427ab7,_0x43cb85){_0x43cb85=_0x43cb85||0xcc;return function(_0x49b8ef){if(_0x49b8ef){return _0x427ab7['sendStatus'](_0x43cb85);}return _0x427ab7[_0x5ad9('0x18')](_0x43cb85)[_0x5ad9('0x19')]();};}function respondWithResult(_0x746b8e,_0x3cc3cf){_0x3cc3cf=_0x3cc3cf||0xc8;return function(_0x4ade7f){if(_0x4ade7f){return _0x746b8e[_0x5ad9('0x18')](_0x3cc3cf)[_0x5ad9('0x1a')](_0x4ade7f);}};}function respondWithFilteredResult(_0x145e5a,_0x50c269){return function(_0x4500ef){if(_0x4500ef){var _0x219490=typeof _0x50c269['offset']===_0x5ad9('0x1b')&&typeof _0x50c269[_0x5ad9('0x1c')]==='undefined';var _0x410830=_0x4500ef[_0x5ad9('0x1d')];var _0x2693b1=_0x219490?0x0:_0x50c269[_0x5ad9('0x1e')];var _0x403120=_0x219490?_0x4500ef['count']:_0x50c269[_0x5ad9('0x1e')]+_0x50c269[_0x5ad9('0x1c')];var _0x5efa03;if(_0x403120>=_0x410830){_0x403120=_0x410830;_0x5efa03=0xc8;}else{_0x5efa03=0xce;}_0x145e5a[_0x5ad9('0x18')](_0x5efa03);return _0x145e5a['set'](_0x5ad9('0x1f'),_0x2693b1+'-'+_0x403120+'/'+_0x410830)['json'](_0x4500ef);}return null;};}function patchUpdates(_0x45c501){return function(_0x21361b){try{jsonpatch[_0x5ad9('0x20')](_0x21361b,_0x45c501,!![]);}catch(_0x624a6){return BPromise[_0x5ad9('0x21')](_0x624a6);}return _0x21361b[_0x5ad9('0x22')]();};}function saveUpdates(_0x3b29d1,_0x24a65e){return function(_0x449971){if(_0x449971){return _0x449971[_0x5ad9('0x23')](_0x3b29d1)[_0x5ad9('0x24')](function(_0x1a4e55){return _0x1a4e55;});}return null;};}function removeEntity(_0x55bbc5,_0x4cbbe2){return function(_0x361ee1){if(_0x361ee1){return _0x361ee1[_0x5ad9('0x25')]()[_0x5ad9('0x24')](function(){_0x55bbc5[_0x5ad9('0x18')](0xcc)[_0x5ad9('0x19')]();});}};}function handleEntityNotFound(_0x483081,_0x2e1a55){return function(_0x36ba95){if(!_0x36ba95){_0x483081[_0x5ad9('0x26')](0x194);}return _0x36ba95;};}function handleError(_0x100a07,_0x5cddcf){_0x5cddcf=_0x5cddcf||0x1f4;return function(_0x264be8){logger[_0x5ad9('0x27')](_0x264be8[_0x5ad9('0x28')]);if(_0x264be8[_0x5ad9('0x29')]){delete _0x264be8['name'];}_0x100a07[_0x5ad9('0x18')](_0x5cddcf)[_0x5ad9('0x2a')](_0x264be8);};}exports[_0x5ad9('0x2b')]=function(_0x11c854,_0x41dd6b){var _0x32f79b={},_0x4688f8={},_0x3417e5={'count':0x0,'rows':[]};var _0x4dbdcb=_[_0x5ad9('0x2c')](db['SalesforceField'][_0x5ad9('0x2d')],function(_0x583a67){return{'name':_0x583a67[_0x5ad9('0x2e')],'type':_0x583a67[_0x5ad9('0x2f')]['key']};});_0x4688f8['model']=_[_0x5ad9('0x2c')](_0x4dbdcb,_0x5ad9('0x29'));_0x4688f8[_0x5ad9('0x30')]=_['keys'](_0x11c854[_0x5ad9('0x30')]);_0x4688f8[_0x5ad9('0x31')]=_[_0x5ad9('0x32')](_0x4688f8['model'],_0x4688f8[_0x5ad9('0x30')]);_0x32f79b[_0x5ad9('0x33')]=_[_0x5ad9('0x32')](_0x4688f8[_0x5ad9('0x34')],qs[_0x5ad9('0x35')](_0x11c854[_0x5ad9('0x30')][_0x5ad9('0x35')]));_0x32f79b[_0x5ad9('0x33')]=_0x32f79b[_0x5ad9('0x33')][_0x5ad9('0x36')]?_0x32f79b['attributes']:_0x4688f8[_0x5ad9('0x34')];if(!_0x11c854['query'][_0x5ad9('0x37')](_0x5ad9('0x38'))){_0x32f79b[_0x5ad9('0x1c')]=qs[_0x5ad9('0x1c')](_0x11c854[_0x5ad9('0x30')][_0x5ad9('0x1c')]);_0x32f79b[_0x5ad9('0x1e')]=qs['offset'](_0x11c854[_0x5ad9('0x30')]['offset']);}_0x32f79b[_0x5ad9('0x39')]=qs['sort'](_0x11c854[_0x5ad9('0x30')][_0x5ad9('0x3a')]);_0x32f79b[_0x5ad9('0x3b')]=qs['filters'](_[_0x5ad9('0x3c')](_0x11c854[_0x5ad9('0x30')],_0x4688f8[_0x5ad9('0x31')]),_0x4dbdcb);if(_0x11c854[_0x5ad9('0x30')][_0x5ad9('0x3d')]){_0x32f79b[_0x5ad9('0x3b')]=_[_0x5ad9('0x3e')](_0x32f79b[_0x5ad9('0x3b')],{'$or':_['map'](_0x4dbdcb,function(_0x47d11e){if(_0x47d11e['type']!==_0x5ad9('0x3f')){var _0x300aef={};_0x300aef[_0x47d11e['name']]={'$like':'%'+_0x11c854[_0x5ad9('0x30')][_0x5ad9('0x3d')]+'%'};return _0x300aef;}})});}_0x32f79b=_[_0x5ad9('0x3e')]({},_0x32f79b,_0x11c854[_0x5ad9('0x40')]);var _0x5ad45c={'where':_0x32f79b[_0x5ad9('0x3b')]};return db[_0x5ad9('0x41')][_0x5ad9('0x1d')](_0x5ad45c)['then'](function(_0x44b122){_0x3417e5[_0x5ad9('0x1d')]=_0x44b122;if(_0x11c854[_0x5ad9('0x30')][_0x5ad9('0x42')]){_0x32f79b[_0x5ad9('0x43')]=[{'all':!![]}];}return db[_0x5ad9('0x41')][_0x5ad9('0x44')](_0x32f79b);})[_0x5ad9('0x24')](function(_0x9a55a3){_0x3417e5[_0x5ad9('0x45')]=_0x9a55a3;return _0x3417e5;})[_0x5ad9('0x24')](respondWithFilteredResult(_0x41dd6b,_0x32f79b))[_0x5ad9('0x46')](handleError(_0x41dd6b,null));};exports['show']=function(_0x5e1e7b,_0x127ab3){var _0x20d5d8={'raw':!![],'where':{'id':_0x5e1e7b[_0x5ad9('0x47')]['id']}},_0x2ab120={};_0x2ab120[_0x5ad9('0x34')]=_[_0x5ad9('0x48')](db[_0x5ad9('0x41')]['rawAttributes']);_0x2ab120[_0x5ad9('0x30')]=_[_0x5ad9('0x48')](_0x5e1e7b[_0x5ad9('0x30')]);_0x2ab120[_0x5ad9('0x31')]=_['intersection'](_0x2ab120[_0x5ad9('0x34')],_0x2ab120[_0x5ad9('0x30')]);_0x20d5d8['attributes']=_[_0x5ad9('0x32')](_0x2ab120[_0x5ad9('0x34')],qs[_0x5ad9('0x35')](_0x5e1e7b['query']['fields']));_0x20d5d8[_0x5ad9('0x33')]=_0x20d5d8[_0x5ad9('0x33')][_0x5ad9('0x36')]?_0x20d5d8[_0x5ad9('0x33')]:_0x2ab120[_0x5ad9('0x34')];if(_0x5e1e7b[_0x5ad9('0x30')]['includeAll']){_0x20d5d8[_0x5ad9('0x43')]=[{'all':!![]}];}_0x20d5d8=_[_0x5ad9('0x3e')]({},_0x20d5d8,_0x5e1e7b[_0x5ad9('0x40')]);return db[_0x5ad9('0x41')][_0x5ad9('0x49')](_0x20d5d8)[_0x5ad9('0x24')](handleEntityNotFound(_0x127ab3,null))[_0x5ad9('0x24')](respondWithResult(_0x127ab3,null))[_0x5ad9('0x46')](handleError(_0x127ab3,null));};exports['create']=function(_0x2cb33a,_0x1692b4){return db[_0x5ad9('0x41')][_0x5ad9('0x4a')](_0x2cb33a[_0x5ad9('0x4b')],{})[_0x5ad9('0x24')](respondWithResult(_0x1692b4,0xc9))[_0x5ad9('0x46')](handleError(_0x1692b4,null));};exports[_0x5ad9('0x23')]=function(_0x13e71b,_0x36ce0c){if(_0x13e71b[_0x5ad9('0x4b')]['id']){delete _0x13e71b['body']['id'];}return db['SalesforceField']['find']({'where':{'id':_0x13e71b[_0x5ad9('0x47')]['id']}})['then'](handleEntityNotFound(_0x36ce0c,null))[_0x5ad9('0x24')](saveUpdates(_0x13e71b[_0x5ad9('0x4b')],null))[_0x5ad9('0x24')](respondWithResult(_0x36ce0c,null))['catch'](handleError(_0x36ce0c,null));};exports['destroy']=function(_0x17d639,_0x548557){return db[_0x5ad9('0x41')][_0x5ad9('0x49')]({'where':{'id':_0x17d639[_0x5ad9('0x47')]['id']}})[_0x5ad9('0x24')](handleEntityNotFound(_0x548557,null))['then'](removeEntity(_0x548557,null))[_0x5ad9('0x46')](handleError(_0x548557,null));}; \ No newline at end of file +var _0x9b72=['where','merge','options','includeAll','include','SalesforceField','findAll','rows','params','find','create','body','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','update','destroy','then','error','name','send','index','map','rawAttributes','type','key','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter'];(function(_0x3a0a70,_0x586139){var _0x3501b8=function(_0x32a123){while(--_0x32a123){_0x3a0a70['push'](_0x3a0a70['shift']());}};_0x3501b8(++_0x586139);}(_0x9b72,0x1cf));var _0x29b7=function(_0x3863cf,_0x236ea9){_0x3863cf=_0x3863cf-0x0;var _0x448bd2=_0x9b72[_0x3863cf];return _0x448bd2;};'use strict';var emlformat=require(_0x29b7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x29b7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29b7('0x2'));var moment=require(_0x29b7('0x3'));var BPromise=require(_0x29b7('0x4'));var Mustache=require(_0x29b7('0x5'));var util=require(_0x29b7('0x6'));var path=require(_0x29b7('0x7'));var sox=require(_0x29b7('0x8'));var csv=require(_0x29b7('0x9'));var ejs=require(_0x29b7('0xa'));var fs=require('fs');var fs_extra=require(_0x29b7('0xb'));var _=require(_0x29b7('0xc'));var squel=require(_0x29b7('0xd'));var crypto=require(_0x29b7('0xe'));var jsforce=require(_0x29b7('0xf'));var deskjs=require(_0x29b7('0x10'));var toCsv=require(_0x29b7('0x9'));var querystring=require(_0x29b7('0x11'));var Papa=require(_0x29b7('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x29b7('0x13'));var as=require(_0x29b7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x29b7('0x15'))(_0x29b7('0x16'));var utils=require(_0x29b7('0x17'));var config=require(_0x29b7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x29b7('0x19'))['db'];function respondWithStatusCode(_0x378ed0,_0x45332e){_0x45332e=_0x45332e||0xcc;return function(_0x2171cf){if(_0x2171cf){return _0x378ed0[_0x29b7('0x1a')](_0x45332e);}return _0x378ed0[_0x29b7('0x1b')](_0x45332e)[_0x29b7('0x1c')]();};}function respondWithResult(_0xc8f30a,_0x1e423e){_0x1e423e=_0x1e423e||0xc8;return function(_0x215ec7){if(_0x215ec7){return _0xc8f30a['status'](_0x1e423e)[_0x29b7('0x1d')](_0x215ec7);}};}function respondWithFilteredResult(_0x4d7b37,_0x44177b){return function(_0x29eb91){if(_0x29eb91){var _0x833e3b=typeof _0x44177b[_0x29b7('0x1e')]===_0x29b7('0x1f')&&typeof _0x44177b['limit']===_0x29b7('0x1f');var _0x5a4cae=_0x29eb91[_0x29b7('0x20')];var _0xe97405=_0x833e3b?0x0:_0x44177b['offset'];var _0x5a6146=_0x833e3b?_0x29eb91[_0x29b7('0x20')]:_0x44177b[_0x29b7('0x1e')]+_0x44177b['limit'];var _0x11b94a;if(_0x5a6146>=_0x5a4cae){_0x5a6146=_0x5a4cae;_0x11b94a=0xc8;}else{_0x11b94a=0xce;}_0x4d7b37[_0x29b7('0x1b')](_0x11b94a);return _0x4d7b37[_0x29b7('0x21')]('Content-Range',_0xe97405+'-'+_0x5a6146+'/'+_0x5a4cae)[_0x29b7('0x1d')](_0x29eb91);}return null;};}function patchUpdates(_0xf94911){return function(_0x1ec65c){try{jsonpatch[_0x29b7('0x22')](_0x1ec65c,_0xf94911,!![]);}catch(_0x474e12){return BPromise[_0x29b7('0x23')](_0x474e12);}return _0x1ec65c['save']();};}function saveUpdates(_0x40229d,_0x177e23){return function(_0x4cf7aa){if(_0x4cf7aa){return _0x4cf7aa[_0x29b7('0x24')](_0x40229d)['then'](function(_0x22df22){return _0x22df22;});}return null;};}function removeEntity(_0xf2e31e,_0x59ec30){return function(_0x26a127){if(_0x26a127){return _0x26a127[_0x29b7('0x25')]()[_0x29b7('0x26')](function(){_0xf2e31e['status'](0xcc)[_0x29b7('0x1c')]();});}};}function handleEntityNotFound(_0x5ef9d5,_0x2b18af){return function(_0x3a814d){if(!_0x3a814d){_0x5ef9d5[_0x29b7('0x1a')](0x194);}return _0x3a814d;};}function handleError(_0x132423,_0x1dee60){_0x1dee60=_0x1dee60||0x1f4;return function(_0x4683f6){logger[_0x29b7('0x27')](_0x4683f6['stack']);if(_0x4683f6[_0x29b7('0x28')]){delete _0x4683f6[_0x29b7('0x28')];}_0x132423[_0x29b7('0x1b')](_0x1dee60)[_0x29b7('0x29')](_0x4683f6);};}exports[_0x29b7('0x2a')]=function(_0x3b2a41,_0x570cb4){var _0x5a0786={},_0x5ccedd={},_0x43017a={'count':0x0,'rows':[]};var _0x3954bf=_[_0x29b7('0x2b')](db['SalesforceField'][_0x29b7('0x2c')],function(_0x56d64e){return{'name':_0x56d64e['fieldName'],'type':_0x56d64e[_0x29b7('0x2d')][_0x29b7('0x2e')]};});_0x5ccedd['model']=_[_0x29b7('0x2b')](_0x3954bf,_0x29b7('0x28'));_0x5ccedd['query']=_[_0x29b7('0x2f')](_0x3b2a41['query']);_0x5ccedd[_0x29b7('0x30')]=_[_0x29b7('0x31')](_0x5ccedd[_0x29b7('0x32')],_0x5ccedd['query']);_0x5a0786[_0x29b7('0x33')]=_[_0x29b7('0x31')](_0x5ccedd[_0x29b7('0x32')],qs[_0x29b7('0x34')](_0x3b2a41[_0x29b7('0x35')][_0x29b7('0x34')]));_0x5a0786['attributes']=_0x5a0786[_0x29b7('0x33')][_0x29b7('0x36')]?_0x5a0786['attributes']:_0x5ccedd[_0x29b7('0x32')];if(!_0x3b2a41[_0x29b7('0x35')][_0x29b7('0x37')](_0x29b7('0x38'))){_0x5a0786[_0x29b7('0x39')]=qs['limit'](_0x3b2a41[_0x29b7('0x35')]['limit']);_0x5a0786[_0x29b7('0x1e')]=qs[_0x29b7('0x1e')](_0x3b2a41[_0x29b7('0x35')][_0x29b7('0x1e')]);}_0x5a0786[_0x29b7('0x3a')]=qs[_0x29b7('0x3b')](_0x3b2a41[_0x29b7('0x35')][_0x29b7('0x3b')]);_0x5a0786['where']=qs[_0x29b7('0x30')](_[_0x29b7('0x3c')](_0x3b2a41[_0x29b7('0x35')],_0x5ccedd[_0x29b7('0x30')]),_0x3954bf);if(_0x3b2a41[_0x29b7('0x35')][_0x29b7('0x3d')]){_0x5a0786[_0x29b7('0x3e')]=_[_0x29b7('0x3f')](_0x5a0786[_0x29b7('0x3e')],{'$or':_[_0x29b7('0x2b')](_0x3954bf,function(_0x2e7df0){if(_0x2e7df0[_0x29b7('0x2d')]!=='VIRTUAL'){var _0x1a8d17={};_0x1a8d17[_0x2e7df0[_0x29b7('0x28')]]={'$like':'%'+_0x3b2a41['query'][_0x29b7('0x3d')]+'%'};return _0x1a8d17;}})});}_0x5a0786=_[_0x29b7('0x3f')]({},_0x5a0786,_0x3b2a41[_0x29b7('0x40')]);var _0x1cf8c4={'where':_0x5a0786[_0x29b7('0x3e')]};return db['SalesforceField'][_0x29b7('0x20')](_0x1cf8c4)[_0x29b7('0x26')](function(_0x3771ee){_0x43017a['count']=_0x3771ee;if(_0x3b2a41[_0x29b7('0x35')][_0x29b7('0x41')]){_0x5a0786[_0x29b7('0x42')]=[{'all':!![]}];}return db[_0x29b7('0x43')][_0x29b7('0x44')](_0x5a0786);})['then'](function(_0x3292c0){_0x43017a[_0x29b7('0x45')]=_0x3292c0;return _0x43017a;})[_0x29b7('0x26')](respondWithFilteredResult(_0x570cb4,_0x5a0786))['catch'](handleError(_0x570cb4,null));};exports['show']=function(_0x4a56fb,_0x3c42b1){var _0x335317={'raw':!![],'where':{'id':_0x4a56fb[_0x29b7('0x46')]['id']}},_0x4c7e34={};_0x4c7e34[_0x29b7('0x32')]=_['keys'](db[_0x29b7('0x43')][_0x29b7('0x2c')]);_0x4c7e34[_0x29b7('0x35')]=_[_0x29b7('0x2f')](_0x4a56fb[_0x29b7('0x35')]);_0x4c7e34[_0x29b7('0x30')]=_[_0x29b7('0x31')](_0x4c7e34[_0x29b7('0x32')],_0x4c7e34['query']);_0x335317[_0x29b7('0x33')]=_[_0x29b7('0x31')](_0x4c7e34[_0x29b7('0x32')],qs['fields'](_0x4a56fb[_0x29b7('0x35')]['fields']));_0x335317[_0x29b7('0x33')]=_0x335317[_0x29b7('0x33')][_0x29b7('0x36')]?_0x335317[_0x29b7('0x33')]:_0x4c7e34[_0x29b7('0x32')];if(_0x4a56fb[_0x29b7('0x35')][_0x29b7('0x41')]){_0x335317[_0x29b7('0x42')]=[{'all':!![]}];}_0x335317=_[_0x29b7('0x3f')]({},_0x335317,_0x4a56fb[_0x29b7('0x40')]);return db[_0x29b7('0x43')][_0x29b7('0x47')](_0x335317)[_0x29b7('0x26')](handleEntityNotFound(_0x3c42b1,null))[_0x29b7('0x26')](respondWithResult(_0x3c42b1,null))['catch'](handleError(_0x3c42b1,null));};exports[_0x29b7('0x48')]=function(_0x51cc7e,_0x2db693){return db['SalesforceField']['create'](_0x51cc7e[_0x29b7('0x49')],{})[_0x29b7('0x26')](respondWithResult(_0x2db693,0xc9))[_0x29b7('0x4a')](handleError(_0x2db693,null));};exports[_0x29b7('0x24')]=function(_0x558364,_0x2d5b48){if(_0x558364[_0x29b7('0x49')]['id']){delete _0x558364[_0x29b7('0x49')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x558364[_0x29b7('0x46')]['id']}})[_0x29b7('0x26')](handleEntityNotFound(_0x2d5b48,null))[_0x29b7('0x26')](saveUpdates(_0x558364[_0x29b7('0x49')],null))[_0x29b7('0x26')](respondWithResult(_0x2d5b48,null))['catch'](handleError(_0x2d5b48,null));};exports[_0x29b7('0x25')]=function(_0x214154,_0x30d2d7){return db[_0x29b7('0x43')]['find']({'where':{'id':_0x214154[_0x29b7('0x46')]['id']}})[_0x29b7('0x26')](handleEntityNotFound(_0x30d2d7,null))['then'](removeEntity(_0x30d2d7,null))[_0x29b7('0x4a')](handleError(_0x30d2d7,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 40ba3ab..87f7836 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 _0x4ff9=['path','rimraf','../../config/environment','exports','define','int_salesforce_fields','salesforce_unique_index','idField','util','../../config/logger','api','bluebird','request-promise'];(function(_0x57c68c,_0x39493c){var _0x2650fa=function(_0x2c420a){while(--_0x2c420a){_0x57c68c['push'](_0x57c68c['shift']());}};_0x2650fa(++_0x39493c);}(_0x4ff9,0xf2));var _0x94ff=function(_0xbfbcb,_0x474dc4){_0xbfbcb=_0xbfbcb-0x0;var _0x384fc3=_0x4ff9[_0xbfbcb];return _0x384fc3;};'use strict';var _=require('lodash');var util=require(_0x94ff('0x0'));var logger=require(_0x94ff('0x1'))(_0x94ff('0x2'));var moment=require('moment');var BPromise=require(_0x94ff('0x3'));var rp=require(_0x94ff('0x4'));var fs=require('fs');var path=require(_0x94ff('0x5'));var rimraf=require(_0x94ff('0x6'));var config=require(_0x94ff('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0x94ff('0x8')]=function(_0x1bf8aa,_0x287c83){return _0x1bf8aa[_0x94ff('0x9')]('SalesforceField',attributes,{'tableName':_0x94ff('0xa'),'paranoid':![],'indexes':[{'name':_0x94ff('0xb'),'fields':[_0x94ff('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8c83=['request-promise','rimraf','../../config/environment','exports','define','SalesforceField','int_salesforce_fields','FieldId','util','../../config/logger','api','moment'];(function(_0x497acf,_0x48e3c9){var _0x2e0cb1=function(_0x294386){while(--_0x294386){_0x497acf['push'](_0x497acf['shift']());}};_0x2e0cb1(++_0x48e3c9);}(_0x8c83,0x17c));var _0x38c8=function(_0x460d24,_0x1f55bf){_0x460d24=_0x460d24-0x0;var _0x24a8d6=_0x8c83[_0x460d24];return _0x24a8d6;};'use strict';var _=require('lodash');var util=require(_0x38c8('0x0'));var logger=require(_0x38c8('0x1'))(_0x38c8('0x2'));var moment=require(_0x38c8('0x3'));var BPromise=require('bluebird');var rp=require(_0x38c8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x38c8('0x5'));var config=require(_0x38c8('0x6'));var attributes=require('./intSalesforceField.attributes');module[_0x38c8('0x7')]=function(_0x12260,_0x24374c){return _0x12260[_0x38c8('0x8')](_0x38c8('0x9'),attributes,{'tableName':_0x38c8('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0x38c8('0xb')],'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 b451557..663c47f 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 _0x15a8=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','http','request','then','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','util'];(function(_0x568eca,_0x549174){var _0x767192=function(_0x4bc377){while(--_0x4bc377){_0x568eca['push'](_0x568eca['shift']());}};_0x767192(++_0x549174);}(_0x15a8,0x8f));var _0x815a=function(_0x35a85d,_0x464bca){_0x35a85d=_0x35a85d-0x0;var _0x3257d3=_0x15a8[_0x35a85d];return _0x3257d3;};'use strict';var _=require('lodash');var util=require(_0x815a('0x0'));var moment=require(_0x815a('0x1'));var BPromise=require(_0x815a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x815a('0x3'));var db=require(_0x815a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x815a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x815a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3c5a8f,_0xa29d4b,_0x5d3c0a){return new BPromise(function(_0x268768,_0x37c22a){return client[_0x815a('0x7')](_0x3c5a8f,_0x5d3c0a)[_0x815a('0x8')](function(_0x49f186){logger[_0x815a('0x9')](_0x815a('0xa'),_0xa29d4b,'request\x20sent');logger[_0x815a('0xb')](_0x815a('0xc'),_0xa29d4b,_0x815a('0xd'),JSON[_0x815a('0xe')](_0x49f186));if(_0x49f186['error']){if(_0x49f186[_0x815a('0xf')][_0x815a('0x10')]===0x1f4){logger[_0x815a('0xf')](_0x815a('0xa'),_0xa29d4b,_0x49f186['error'][_0x815a('0x11')]);return _0x37c22a(_0x49f186[_0x815a('0xf')][_0x815a('0x11')]);}logger[_0x815a('0xf')](_0x815a('0xa'),_0xa29d4b,_0x49f186[_0x815a('0xf')][_0x815a('0x11')]);return _0x268768(_0x49f186[_0x815a('0xf')][_0x815a('0x11')]);}else{logger['info'](_0x815a('0xa'),_0xa29d4b,_0x815a('0xd'));_0x268768(_0x49f186['result'][_0x815a('0x11')]);}})['catch'](function(_0x236752){logger[_0x815a('0xf')](_0x815a('0xa'),_0xa29d4b,_0x236752);_0x37c22a(_0x236752);});});} \ No newline at end of file +var _0x9d4f=['debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','SalesforceField,\x20%s,\x20%s'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x9d4f,0xc6));var _0xf9d4=function(_0x511a35,_0x3ebff0){_0x511a35=_0x511a35-0x0;var _0x5db2a3=_0x9d4f[_0x511a35];return _0x5db2a3;};'use strict';var _=require(_0xf9d4('0x0'));var util=require('util');var moment=require(_0xf9d4('0x1'));var BPromise=require(_0xf9d4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9d4('0x3'));var db=require(_0xf9d4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9d4('0x5'))(_0xf9d4('0x6'));var config=require(_0xf9d4('0x7'));var jayson=require(_0xf9d4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x513a59,_0x28593e,_0x41f178){return new BPromise(function(_0xd58367,_0x2c8dd6){return client[_0xf9d4('0x9')](_0x513a59,_0x41f178)['then'](function(_0x114b43){logger['info'](_0xf9d4('0xa'),_0x28593e,'request\x20sent');logger[_0xf9d4('0xb')](_0xf9d4('0xc'),_0x28593e,'request\x20sent',JSON[_0xf9d4('0xd')](_0x114b43));if(_0x114b43[_0xf9d4('0xe')]){if(_0x114b43[_0xf9d4('0xe')]['code']===0x1f4){logger[_0xf9d4('0xe')](_0xf9d4('0xa'),_0x28593e,_0x114b43['error'][_0xf9d4('0xf')]);return _0x2c8dd6(_0x114b43['error'][_0xf9d4('0xf')]);}logger[_0xf9d4('0xe')](_0xf9d4('0xa'),_0x28593e,_0x114b43[_0xf9d4('0xe')][_0xf9d4('0xf')]);return _0xd58367(_0x114b43['error']['message']);}else{logger[_0xf9d4('0x10')](_0xf9d4('0xa'),_0x28593e,_0xf9d4('0x11'));_0xd58367(_0x114b43['result'][_0xf9d4('0xf')]);}})[_0xf9d4('0x12')](function(_0xecd572){logger['error'](_0xf9d4('0xa'),_0x28593e,_0xecd572);_0x2c8dd6(_0xecd572);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 7442ea8..f1fa1f0 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 _0x55ea=['../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','/:id','isAuthenticated','show','get','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x44c79f,_0x21f727){var _0x4089ef=function(_0x5a237a){while(--_0x5a237a){_0x44c79f['push'](_0x44c79f['shift']());}};_0x4089ef(++_0x21f727);}(_0x55ea,0xc9));var _0xa55e=function(_0x3644b5,_0x5eed09){_0x3644b5=_0x3644b5-0x0;var _0x55e2ba=_0x55ea[_0x3644b5];return _0x55e2ba;};'use strict';var multer=require(_0xa55e('0x0'));var util=require(_0xa55e('0x1'));var path=require(_0xa55e('0x2'));var timeout=require('connect-timeout');var express=require(_0xa55e('0x3'));var router=express[_0xa55e('0x4')]();var fs_extra=require(_0xa55e('0x5'));var auth=require(_0xa55e('0x6'));var interaction=require(_0xa55e('0x7'));var config=require('../../config/environment');var controller=require(_0xa55e('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa55e('0x9'),auth[_0xa55e('0xa')](),controller[_0xa55e('0xb')]);router[_0xa55e('0xc')](_0xa55e('0xd'),auth[_0xa55e('0xa')](),controller[_0xa55e('0xe')]);router[_0xa55e('0xc')](_0xa55e('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xa55e('0x10')]('/',auth[_0xa55e('0xa')](),controller[_0xa55e('0x11')]);router[_0xa55e('0x10')](_0xa55e('0xd'),auth['isAuthenticated'](),controller[_0xa55e('0x12')]);router['put'](_0xa55e('0x9'),auth[_0xa55e('0xa')](),controller[_0xa55e('0x13')]);router[_0xa55e('0x14')](_0xa55e('0x9'),auth[_0xa55e('0xa')](),controller[_0xa55e('0x15')]);module[_0xa55e('0x16')]=router; \ No newline at end of file +var _0xf958=['destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','put','/:id','delete'];(function(_0x990423,_0x3a4a44){var _0x2dc282=function(_0x5afcb3){while(--_0x5afcb3){_0x990423['push'](_0x990423['shift']());}};_0x2dc282(++_0x3a4a44);}(_0xf958,0xe6));var _0x8f95=function(_0x1addfc,_0x139df1){_0x1addfc=_0x1addfc-0x0;var _0x1db919=_0xf958[_0x1addfc];return _0x1db919;};'use strict';var multer=require(_0x8f95('0x0'));var util=require('util');var path=require(_0x8f95('0x1'));var timeout=require('connect-timeout');var express=require(_0x8f95('0x2'));var router=express['Router']();var fs_extra=require(_0x8f95('0x3'));var auth=require(_0x8f95('0x4'));var interaction=require(_0x8f95('0x5'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router[_0x8f95('0x6')]('/',auth[_0x8f95('0x7')](),controller[_0x8f95('0x8')]);router[_0x8f95('0x6')]('/:id',auth[_0x8f95('0x7')](),controller[_0x8f95('0x9')]);router[_0x8f95('0x6')](_0x8f95('0xa'),auth[_0x8f95('0x7')](),controller['getConfigurations']);router[_0x8f95('0x6')](_0x8f95('0xb'),auth['isAuthenticated'](),controller[_0x8f95('0xc')]);router[_0x8f95('0xd')]('/',auth[_0x8f95('0x7')](),controller['create']);router[_0x8f95('0xd')](_0x8f95('0xa'),auth[_0x8f95('0x7')](),controller['addConfiguration']);router[_0x8f95('0xe')](_0x8f95('0xf'),auth[_0x8f95('0x7')](),controller['update']);router[_0x8f95('0x10')](_0x8f95('0xf'),auth[_0x8f95('0x7')](),controller[_0x8f95('0x11')]);module[_0x8f95('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index a68b653..30d9643 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 _0x2302=['STRING','exports'];(function(_0x299f0a,_0x121b49){var _0x1be537=function(_0xc20612){while(--_0xc20612){_0x299f0a['push'](_0x299f0a['shift']());}};_0x1be537(++_0x121b49);}(_0x2302,0x11d));var _0x2230=function(_0x174a72,_0x46034c){_0x174a72=_0x174a72-0x0;var _0x32cecd=_0x2302[_0x174a72];return _0x32cecd;};'use strict';var Sequelize=require('sequelize');module[_0x2230('0x0')]={'name':{'type':Sequelize[_0x2230('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x2230('0x1')]},'remoteUri':{'type':Sequelize[_0x2230('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x2230('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xd73e=['STRING'];(function(_0x4ad5f8,_0x547a6e){var _0x3b4fef=function(_0x2ae9f8){while(--_0x2ae9f8){_0x4ad5f8['push'](_0x4ad5f8['shift']());}};_0x3b4fef(++_0x547a6e);}(_0xd73e,0x13f));var _0xed73=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd73e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xed73('0x0')],'unique':'username'},'password':{'type':Sequelize[_0xed73('0x0')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xed73('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index aceb165..765ae8f 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 _0xb7e4=['parent','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_created_on','sys_domain','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','work_notes','short_description','close_code','correlation_display','delivery_task','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','closed_by','contact_type','incident_state','urgency','company','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','category','username','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','assign','includes','label','push','all','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','internalType','concat','test','statusCode','Wrong\x20credentials','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','count','offset','limit','set','apply','update','then','end','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','nolimit','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','hold_reason','knowledge','subcategory','notify','severity'];(function(_0x28fe94,_0x120b9b){var _0x3560da=function(_0x4d4e25){while(--_0x4d4e25){_0x28fe94['push'](_0x28fe94['shift']());}};_0x3560da(++_0x120b9b);}(_0xb7e4,0x1bf));var _0x4b7e=function(_0x1bfaf3,_0x4e5340){_0x1bfaf3=_0x1bfaf3-0x0;var _0x1ef76e=_0xb7e4[_0x1bfaf3];return _0x1ef76e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4b7e('0x0'));var zipdir=require(_0x4b7e('0x1'));var jsonpatch=require(_0x4b7e('0x2'));var rp=require(_0x4b7e('0x3'));var moment=require(_0x4b7e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4b7e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x4b7e('0x6'));var csv=require(_0x4b7e('0x7'));var ejs=require(_0x4b7e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x4b7e('0xa'));var deskjs=require(_0x4b7e('0xb'));var toCsv=require('to-csv');var querystring=require(_0x4b7e('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4b7e('0xd'));var qs=require(_0x4b7e('0xe'));var as=require(_0x4b7e('0xf'));var hardwareService=require(_0x4b7e('0x10'));var logger=require(_0x4b7e('0x11'))('api');var utils=require(_0x4b7e('0x12'));var config=require(_0x4b7e('0x13'));var licenseUtil=require(_0x4b7e('0x14'));var db=require(_0x4b7e('0x15'))['db'];var integrations=require(_0x4b7e('0x16'));function respondWithStatusCode(_0x59eafd,_0x3a43e8){_0x3a43e8=_0x3a43e8||0xcc;return function(_0xfc7a43){if(_0xfc7a43){return _0x59eafd[_0x4b7e('0x17')](_0x3a43e8);}return _0x59eafd[_0x4b7e('0x18')](_0x3a43e8)['end']();};}function respondWithResult(_0x3d25c9,_0x40239e){_0x40239e=_0x40239e||0xc8;return function(_0x7470ff){if(_0x7470ff){return _0x3d25c9[_0x4b7e('0x18')](_0x40239e)[_0x4b7e('0x19')](_0x7470ff);}};}function respondWithFilteredResult(_0x35d193,_0x15cdbd){return function(_0x5ab332){if(_0x5ab332){var _0x11c2a3=typeof _0x15cdbd['offset']===_0x4b7e('0x1a')&&typeof _0x15cdbd['limit']===_0x4b7e('0x1a');var _0x3ceaca=_0x5ab332[_0x4b7e('0x1b')];var _0x3fa146=_0x11c2a3?0x0:_0x15cdbd[_0x4b7e('0x1c')];var _0x4a4b3a=_0x11c2a3?_0x5ab332['count']:_0x15cdbd[_0x4b7e('0x1c')]+_0x15cdbd[_0x4b7e('0x1d')];var _0x2ee927;if(_0x4a4b3a>=_0x3ceaca){_0x4a4b3a=_0x3ceaca;_0x2ee927=0xc8;}else{_0x2ee927=0xce;}_0x35d193['status'](_0x2ee927);return _0x35d193[_0x4b7e('0x1e')]('Content-Range',_0x3fa146+'-'+_0x4a4b3a+'/'+_0x3ceaca)[_0x4b7e('0x19')](_0x5ab332);}return null;};}function patchUpdates(_0x126250){return function(_0x23d8fd){try{jsonpatch[_0x4b7e('0x1f')](_0x23d8fd,_0x126250,!![]);}catch(_0x4b0f6f){return BPromise['reject'](_0x4b0f6f);}return _0x23d8fd['save']();};}function saveUpdates(_0x5282d9,_0xe3b3a6){return function(_0x2a11c5){if(_0x2a11c5){return _0x2a11c5[_0x4b7e('0x20')](_0x5282d9)[_0x4b7e('0x21')](function(_0x5caede){return _0x5caede;});}return null;};}function removeEntity(_0x3ffbd0,_0x47e431){return function(_0x4949d5){if(_0x4949d5){return _0x4949d5['destroy']()[_0x4b7e('0x21')](function(){_0x3ffbd0['status'](0xcc)[_0x4b7e('0x22')]();});}};}function handleEntityNotFound(_0x12632e,_0x224292){return function(_0x651840){if(!_0x651840){_0x12632e[_0x4b7e('0x17')](0x194);}return _0x651840;};}function handleError(_0x4a7856,_0x119388){_0x119388=_0x119388||0x1f4;return function(_0x1a13b7){logger[_0x4b7e('0x23')](_0x1a13b7[_0x4b7e('0x24')]);if(_0x1a13b7[_0x4b7e('0x25')]){delete _0x1a13b7['name'];}_0x4a7856[_0x4b7e('0x18')](_0x119388)[_0x4b7e('0x26')](_0x1a13b7);};}exports[_0x4b7e('0x27')]=function(_0x1db10f,_0x331508){var _0x2c0095={},_0x12ef1c={},_0x33a072={'count':0x0,'rows':[]};var _0x2b2c55=_[_0x4b7e('0x28')](db[_0x4b7e('0x29')][_0x4b7e('0x2a')],function(_0x4fbbe4){return{'name':_0x4fbbe4['fieldName'],'type':_0x4fbbe4[_0x4b7e('0x2b')][_0x4b7e('0x2c')]};});_0x12ef1c[_0x4b7e('0x2d')]=_[_0x4b7e('0x28')](_0x2b2c55,_0x4b7e('0x25'));_0x12ef1c[_0x4b7e('0x2e')]=_[_0x4b7e('0x2f')](_0x1db10f['query']);_0x12ef1c['filters']=_[_0x4b7e('0x30')](_0x12ef1c[_0x4b7e('0x2d')],_0x12ef1c['query']);_0x2c0095[_0x4b7e('0x31')]=_[_0x4b7e('0x30')](_0x12ef1c[_0x4b7e('0x2d')],qs['fields'](_0x1db10f['query'][_0x4b7e('0x32')]));_0x2c0095[_0x4b7e('0x31')]=_0x2c0095[_0x4b7e('0x31')]['length']?_0x2c0095[_0x4b7e('0x31')]:_0x12ef1c['model'];if(!_0x1db10f[_0x4b7e('0x2e')][_0x4b7e('0x33')]('nolimit')){_0x2c0095[_0x4b7e('0x1d')]=qs['limit'](_0x1db10f[_0x4b7e('0x2e')][_0x4b7e('0x1d')]);_0x2c0095[_0x4b7e('0x1c')]=qs['offset'](_0x1db10f[_0x4b7e('0x2e')][_0x4b7e('0x1c')]);}_0x2c0095[_0x4b7e('0x34')]=qs[_0x4b7e('0x35')](_0x1db10f[_0x4b7e('0x2e')][_0x4b7e('0x35')]);_0x2c0095['where']=qs[_0x4b7e('0x36')](_[_0x4b7e('0x37')](_0x1db10f[_0x4b7e('0x2e')],_0x12ef1c[_0x4b7e('0x36')]),_0x2b2c55);if(_0x1db10f['query'][_0x4b7e('0x38')]){_0x2c0095['where']=_[_0x4b7e('0x39')](_0x2c0095[_0x4b7e('0x3a')],{'$or':_[_0x4b7e('0x28')](_0x2b2c55,function(_0x541728){if(_0x541728[_0x4b7e('0x2b')]!==_0x4b7e('0x3b')){var _0x202bd6={};_0x202bd6[_0x541728[_0x4b7e('0x25')]]={'$like':'%'+_0x1db10f[_0x4b7e('0x2e')][_0x4b7e('0x38')]+'%'};return _0x202bd6;}})});}_0x2c0095=_[_0x4b7e('0x39')]({},_0x2c0095,_0x1db10f[_0x4b7e('0x3c')]);var _0x153ed8={'where':_0x2c0095['where']};return db[_0x4b7e('0x29')][_0x4b7e('0x1b')](_0x153ed8)[_0x4b7e('0x21')](function(_0x37f3d0){_0x33a072[_0x4b7e('0x1b')]=_0x37f3d0;if(_0x1db10f[_0x4b7e('0x2e')][_0x4b7e('0x3d')]){_0x2c0095[_0x4b7e('0x3e')]=[{'all':!![]}];}return db[_0x4b7e('0x29')][_0x4b7e('0x3f')](_0x2c0095);})[_0x4b7e('0x21')](function(_0x471f70){_0x33a072[_0x4b7e('0x40')]=_0x471f70;return _0x33a072;})[_0x4b7e('0x21')](respondWithFilteredResult(_0x331508,_0x2c0095))[_0x4b7e('0x41')](handleError(_0x331508,null));};exports[_0x4b7e('0x42')]=function(_0x1d068d,_0x5d21dd){var _0xee86fb={'raw':![],'where':{'id':_0x1d068d['params']['id']}},_0x52b826={};_0x52b826[_0x4b7e('0x2d')]=_[_0x4b7e('0x2f')](db[_0x4b7e('0x29')]['rawAttributes']);_0x52b826[_0x4b7e('0x2e')]=_[_0x4b7e('0x2f')](_0x1d068d['query']);_0x52b826[_0x4b7e('0x36')]=_['intersection'](_0x52b826[_0x4b7e('0x2d')],_0x52b826[_0x4b7e('0x2e')]);_0xee86fb[_0x4b7e('0x31')]=_[_0x4b7e('0x30')](_0x52b826[_0x4b7e('0x2d')],qs[_0x4b7e('0x32')](_0x1d068d[_0x4b7e('0x2e')]['fields']));_0xee86fb[_0x4b7e('0x31')]=_0xee86fb[_0x4b7e('0x31')][_0x4b7e('0x43')]?_0xee86fb[_0x4b7e('0x31')]:_0x52b826[_0x4b7e('0x2d')];if(_0x1d068d[_0x4b7e('0x2e')][_0x4b7e('0x3d')]){_0xee86fb[_0x4b7e('0x3e')]=[{'all':!![]}];}_0xee86fb=_[_0x4b7e('0x39')]({},_0xee86fb,_0x1d068d[_0x4b7e('0x3c')]);return db[_0x4b7e('0x29')][_0x4b7e('0x44')](_0xee86fb)[_0x4b7e('0x21')](handleEntityNotFound(_0x5d21dd,null))['then'](respondWithResult(_0x5d21dd,null))['catch'](handleError(_0x5d21dd,null));};exports[_0x4b7e('0x45')]=function(_0xc70741,_0x1b3a8d){return db[_0x4b7e('0x29')][_0x4b7e('0x45')](_0xc70741[_0x4b7e('0x46')],{})[_0x4b7e('0x21')](respondWithResult(_0x1b3a8d,0xc9))[_0x4b7e('0x41')](handleError(_0x1b3a8d,null));};exports[_0x4b7e('0x20')]=function(_0x9c4d3,_0x5903c3){if(_0x9c4d3['body']['id']){delete _0x9c4d3[_0x4b7e('0x46')]['id'];}return db[_0x4b7e('0x29')]['find']({'where':{'id':_0x9c4d3['params']['id']}})['then'](handleEntityNotFound(_0x5903c3,null))[_0x4b7e('0x21')](saveUpdates(_0x9c4d3[_0x4b7e('0x46')],null))['then'](respondWithResult(_0x5903c3,null))[_0x4b7e('0x41')](handleError(_0x5903c3,null));};exports['destroy']=function(_0x1eb722,_0x19128f){return db['ServicenowAccount']['find']({'where':{'id':_0x1eb722[_0x4b7e('0x47')]['id']}})[_0x4b7e('0x21')](handleEntityNotFound(_0x19128f,null))[_0x4b7e('0x21')](removeEntity(_0x19128f,null))[_0x4b7e('0x41')](handleError(_0x19128f,null));};exports[_0x4b7e('0x48')]=function(_0x3cde91,_0x26e94f,_0x58cac4){var _0x291334={};var _0x346aa8={};var _0x69a378;var _0xd7ef81;return db[_0x4b7e('0x29')][_0x4b7e('0x49')]({'where':{'id':_0x3cde91['params']['id']}})[_0x4b7e('0x21')](handleEntityNotFound(_0x26e94f,null))[_0x4b7e('0x21')](function(_0x24e845){if(_0x24e845){_0x69a378=_0x24e845;_0x346aa8[_0x4b7e('0x2d')]=_[_0x4b7e('0x2f')](db[_0x4b7e('0x4a')][_0x4b7e('0x2a')]);_0x346aa8['query']=_[_0x4b7e('0x2f')](_0x3cde91['query']);_0x346aa8[_0x4b7e('0x36')]=_[_0x4b7e('0x30')](_0x346aa8['model'],_0x346aa8[_0x4b7e('0x2e')]);_0x291334[_0x4b7e('0x31')]=_['intersection'](_0x346aa8[_0x4b7e('0x2d')],qs[_0x4b7e('0x32')](_0x3cde91[_0x4b7e('0x2e')][_0x4b7e('0x32')]));_0x291334['attributes']=_0x291334[_0x4b7e('0x31')][_0x4b7e('0x43')]?_0x291334[_0x4b7e('0x31')]:_0x346aa8[_0x4b7e('0x2d')];_0x291334['order']=qs[_0x4b7e('0x35')](_0x3cde91['query'][_0x4b7e('0x35')]);_0x291334[_0x4b7e('0x3a')]=qs[_0x4b7e('0x36')](_['pick'](_0x3cde91[_0x4b7e('0x2e')],_0x346aa8['filters']));if(_0x3cde91[_0x4b7e('0x2e')]['filter']){_0x291334[_0x4b7e('0x3a')]=_[_0x4b7e('0x39')](_0x291334['where'],{'$or':_[_0x4b7e('0x28')](_0x291334[_0x4b7e('0x31')],function(_0x417d88){var _0x4b023c={};_0x4b023c[_0x417d88]={'$like':'%'+_0x3cde91['query'][_0x4b7e('0x38')]+'%'};return _0x4b023c;})});}_0x291334=_[_0x4b7e('0x39')]({},_0x291334,_0x3cde91[_0x4b7e('0x3c')]);return _0x69a378[_0x4b7e('0x48')](_0x291334);}})[_0x4b7e('0x21')](function(_0x9133f2){if(_0x9133f2){_0xd7ef81=_0x9133f2[_0x4b7e('0x43')];if(!_0x3cde91[_0x4b7e('0x2e')][_0x4b7e('0x33')](_0x4b7e('0x4b'))){_0x291334['limit']=qs[_0x4b7e('0x1d')](_0x3cde91[_0x4b7e('0x2e')][_0x4b7e('0x1d')]);_0x291334[_0x4b7e('0x1c')]=qs[_0x4b7e('0x1c')](_0x3cde91[_0x4b7e('0x2e')][_0x4b7e('0x1c')]);}return _0x69a378[_0x4b7e('0x48')](_0x291334);}})[_0x4b7e('0x21')](function(_0x437933){if(_0x437933){return _0x437933?{'count':_0xd7ef81,'rows':_0x437933}:null;}})['then'](respondWithResult(_0x26e94f,null))[_0x4b7e('0x41')](handleError(_0x26e94f,null));};exports['addConfiguration']=function(_0x549976,_0x200a3d,_0x1d225a){if(_0x549976[_0x4b7e('0x46')]['id']){delete _0x549976[_0x4b7e('0x46')]['id'];}return db[_0x4b7e('0x29')]['findOne']({'where':{'id':_0x549976[_0x4b7e('0x47')]['id']}})[_0x4b7e('0x21')](handleEntityNotFound(_0x200a3d,null))['then'](function(_0x146b7e){if(_0x146b7e){_0x549976[_0x4b7e('0x46')][_0x4b7e('0x4c')]=_0x146b7e['id'];_0x549976[_0x4b7e('0x46')][_0x4b7e('0x4d')]=integrations[_0x4b7e('0x4e')](_0x549976['body'][_0x4b7e('0x4f')],_0x549976[_0x4b7e('0x46')]['type']);_0x549976[_0x4b7e('0x46')]['Descriptions']=integrations[_0x4b7e('0x50')](_0x549976['body'][_0x4b7e('0x4f')],_0x549976[_0x4b7e('0x46')][_0x4b7e('0x2b')]);return db[_0x4b7e('0x4a')][_0x4b7e('0x45')](_0x549976[_0x4b7e('0x46')],{'include':[{'model':db[_0x4b7e('0x51')],'as':_0x4b7e('0x4d')},{'model':db[_0x4b7e('0x51')],'as':_0x4b7e('0x52')}]});}return null;})[_0x4b7e('0x21')](respondWithResult(_0x200a3d,null))[_0x4b7e('0x41')](handleError(_0x200a3d,null));};exports[_0x4b7e('0x53')]=function(_0x568771,_0x4774f0,_0x3a3fbb){var _0x49395f=[_0x4b7e('0x54'),_0x4b7e('0x55'),_0x4b7e('0x56'),_0x4b7e('0x57'),'close_code',_0x4b7e('0x58'),'incident_state',_0x4b7e('0x59'),'category'];var _0x35e52a=[_0x4b7e('0x5a'),_0x4b7e('0x54'),'caused_by',_0x4b7e('0x5b'),_0x4b7e('0x5c'),_0x4b7e('0x5d'),_0x4b7e('0x5e'),_0x4b7e('0x55'),_0x4b7e('0x5f'),_0x4b7e('0x60'),_0x4b7e('0x61'),'sys_updated_by','opened_by','user_input',_0x4b7e('0x62'),_0x4b7e('0x63'),_0x4b7e('0x64'),_0x4b7e('0x65'),_0x4b7e('0x56'),_0x4b7e('0x34'),'calendar_stc',_0x4b7e('0x66'),_0x4b7e('0x67'),_0x4b7e('0x68'),'impact',_0x4b7e('0x69'),_0x4b7e('0x6a'),_0x4b7e('0x6b'),_0x4b7e('0x6c'),_0x4b7e('0x6d'),_0x4b7e('0x6e'),_0x4b7e('0x6f'),'expected_start',_0x4b7e('0x70'),_0x4b7e('0x71'),_0x4b7e('0x72'),_0x4b7e('0x73'),'reopened_time',_0x4b7e('0x74'),_0x4b7e('0x75'),'approval_set',_0x4b7e('0x57'),_0x4b7e('0x76'),_0x4b7e('0x77'),_0x4b7e('0x78'),_0x4b7e('0x79'),_0x4b7e('0x7a'),'work_start',_0x4b7e('0x7b'),_0x4b7e('0x7c'),_0x4b7e('0x7d'),'description',_0x4b7e('0x7e'),_0x4b7e('0x58'),_0x4b7e('0x7f'),'close_notes',_0x4b7e('0x80'),'follow_up','parent_incident','sys_id',_0x4b7e('0x81'),'reopened_by',_0x4b7e('0x82'),_0x4b7e('0x83'),'problem_id',_0x4b7e('0x84'),_0x4b7e('0x85'),_0x4b7e('0x86'),'assigned_to',_0x4b7e('0x59'),_0x4b7e('0x87'),_0x4b7e('0x88'),_0x4b7e('0x89'),_0x4b7e('0x8a'),_0x4b7e('0x8b'),_0x4b7e('0x8c'),_0x4b7e('0x8d'),_0x4b7e('0x8e'),'escalation',_0x4b7e('0x8f'),_0x4b7e('0x90'),_0x4b7e('0x91'),_0x4b7e('0x92')];var _0x2e72b0='';var _0x134444='';var _0xfcb96f=[];var _0x1aaacc='';var _0x4dfdff='';var _0x11c6a2=[];var _0x2a2414='';var _0x4a57bf='';var _0x523ff7={};var _0xf54e02='';return db[_0x4b7e('0x29')][_0x4b7e('0x49')]({'where':{'id':_0x568771[_0x4b7e('0x47')]['id']},'attributes':['id',_0x4b7e('0x93'),'password','email',_0x4b7e('0x94'),_0x4b7e('0x95')]})[_0x4b7e('0x21')](handleEntityNotFound(_0x4774f0,null))[_0x4b7e('0x21')](function(_0x270b4a){if(_0x270b4a){_0xf54e02=_0x270b4a['remoteUri'];var _0x3a1b83=_0xf54e02[_0x4b7e('0x96')](-0x1);if(_0x3a1b83==='/'){_0xf54e02=_0xf54e02[_0x4b7e('0x97')](0x0,_0xf54e02[_0x4b7e('0x98')](_0x3a1b83));}_0x4a57bf=util[_0x4b7e('0x99')]('%s/api/now/doc/table/schema/',_0xf54e02);_0x2a2414=util[_0x4b7e('0x99')](_0x4b7e('0x9a'),_0xf54e02);_0x523ff7={'user':_0x270b4a[_0x4b7e('0x93')],'pass':_0x270b4a[_0x4b7e('0x9b')]};var _0x5a7374={'method':_0x4b7e('0x9c'),'uri':_0x4a57bf+_0x4b7e('0x9d'),'auth':_0x523ff7,'json':!![]};return rp(_0x5a7374);}})[_0x4b7e('0x21')](function(_0x3ea9ff){if(_0x3ea9ff[_0x4b7e('0x9e')]['length']>0x0){_0x2e72b0=_0x3ea9ff['result'];}console[_0x4b7e('0x9f')]('incident\x20table\x20objects',_0x2e72b0);_0x11c6a2=[];_0x134444=Object[_0x4b7e('0xa0')]([],_0x2e72b0);_['remove'](_0x134444,function(_0x537ce0){return!_0x49395f[_0x4b7e('0xa1')](_0x537ce0[_0x4b7e('0x25')]);});_0x134444['forEach'](function(_0xa51fa3){var _0x114e41=createFieldObject(_0x2a2414,_0x523ff7,_0xa51fa3['internalType'],_0xa51fa3[_0x4b7e('0x25')],_0xa51fa3[_0x4b7e('0xa2')],![]);_0x11c6a2[_0x4b7e('0xa3')](_0x114e41);});return Promise[_0x4b7e('0xa4')](_0x11c6a2);})[_0x4b7e('0x21')](function(_0x8f30d0){_0xfcb96f=_0x8f30d0;_0x1aaacc=Object[_0x4b7e('0xa0')]([],_0x2e72b0);console['log'](_0x4b7e('0xa5'),_0x2e72b0);_[_0x4b7e('0xa6')](_0x1aaacc,function(_0x389d1f){return _0x35e52a[_0x4b7e('0xa1')](_0x389d1f[_0x4b7e('0x25')]);});console[_0x4b7e('0x9f')](_0x4b7e('0xa7'),_0x1aaacc);_0x11c6a2=[];_0x1aaacc[_0x4b7e('0xa8')](function(_0x5dde3c){var _0x4a6a35=createFieldObject(_0x2a2414,_0x523ff7,_0x5dde3c[_0x4b7e('0xa9')],_0x5dde3c[_0x4b7e('0x25')],_0x5dde3c[_0x4b7e('0xa2')],!![]);_0x11c6a2[_0x4b7e('0xa3')](_0x4a6a35);});return Promise[_0x4b7e('0xa4')](_0x11c6a2);})[_0x4b7e('0x21')](function(_0x22de2c){_0x4dfdff=_0x22de2c;var _0x2a5fbd=_0xfcb96f[_0x4b7e('0xaa')](_0x4dfdff);return{'count':_0x2a5fbd[_0x4b7e('0x43')],'rows':_0x2a5fbd};})[_0x4b7e('0x21')](respondWithResult(_0x4774f0,null))[_0x4b7e('0x41')](function(_0x5a0a98){console['log']('ServiceNow\x20error:\x20'+_0x5a0a98);var _0x3dcda6=_0x568771[_0x4b7e('0x2e')][_0x4b7e('0xab')]?0x1f4:_0x5a0a98[_0x4b7e('0xac')]||0x1f4;logger['error'](_0x5a0a98[_0x4b7e('0x24')]);delete _0x5a0a98[_0x4b7e('0x25')];if(_0x3dcda6===0x191){_0x3dcda6=0x190;}_0x4774f0['status'](_0x3dcda6)['send'](_0x568771[_0x4b7e('0x2e')][_0x4b7e('0xab')]?{'message':_0x4b7e('0xad'),'statusCode':_0x5a0a98['statusCode']}:_0x5a0a98);});};function createFieldObject(_0x3878d3,_0x3cc90c,_0x12b68c,_0x1b7520,_0x5a84de,_0x184574){return new Promise(function(_0x3d44fb,_0x49f0c6){var _0x384836={'id':_0x1b7520,'name':_0x5a84de,'custom':_0x184574};if(_0x12b68c===_0x4b7e('0xae')){_0x384836[_0x4b7e('0x3c')]=[{'name':_0x4b7e('0xaf'),'value':'true'},{'name':_0x4b7e('0xb0'),'value':_0x4b7e('0xb1')}];_0x3d44fb(_0x384836);}else{var _0x486e43={'method':_0x4b7e('0x9c'),'uri':_0x3878d3+_0x4b7e('0xb2')+_0x1b7520,'auth':_0x3cc90c,'json':!![]};return rp(_0x486e43)[_0x4b7e('0x21')](function(_0x5d8fde){var _0x42ee4c=[];if(_0x5d8fde[_0x4b7e('0x9e')][_0x4b7e('0x43')]>0x0){_0x5d8fde[_0x4b7e('0x9e')]['forEach'](function(_0x33b626){if(_0x33b626['inactive']==='false'){var _0x4fbb05={'name':_0x33b626['label'],'value':_0x33b626['value']};_0x42ee4c[_0x4b7e('0xa3')](_0x4fbb05);}});}_0x384836[_0x4b7e('0x3c')]=_0x42ee4c;if(_0x384836[_0x4b7e('0x3c')][_0x4b7e('0x43')]>0x0){_0x3d44fb(_0x384836);}else{if(_0x184574==![]){_0x3d44fb();}else{_0x3d44fb(_0x384836);}}});}});} \ No newline at end of file +var _0xd2e9=['type','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','rawAttributes','pick','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','hold_reason','knowledge','notify','severity','category','parent','watch_list','approval_history','number','resolved_by','sys_updated_by','sys_created_on','sys_domain','state','calendar_stc','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','close_code','correlation_display','delivery_task','assignment_group','description','calendar_duration','sys_class_name','closed_by','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','location','password','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','result','log','incident\x20table\x20objects','remove','forEach','internalType','label','push','all','assign','TCL:\x20_object','includes','concat','test','statusCode','Wrong\x20credentials','boolean','False','false','GET','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','name','send','index','ServicenowAccount','fieldName','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x2298c2,_0x764772){var _0x11c63b=function(_0x38749c){while(--_0x38749c){_0x2298c2['push'](_0x2298c2['shift']());}};_0x11c63b(++_0x764772);}(_0xd2e9,0x1e6));var _0x9d2e=function(_0xd34e20,_0x5c5a63){_0xd34e20=_0xd34e20-0x0;var _0x1adecf=_0xd2e9[_0xd34e20];return _0x1adecf;};'use strict';var emlformat=require(_0x9d2e('0x0'));var rimraf=require(_0x9d2e('0x1'));var zipdir=require(_0x9d2e('0x2'));var jsonpatch=require(_0x9d2e('0x3'));var rp=require(_0x9d2e('0x4'));var moment=require(_0x9d2e('0x5'));var BPromise=require(_0x9d2e('0x6'));var Mustache=require(_0x9d2e('0x7'));var util=require('util');var path=require(_0x9d2e('0x8'));var sox=require(_0x9d2e('0x9'));var csv=require(_0x9d2e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9d2e('0xb'));var _=require(_0x9d2e('0xc'));var squel=require(_0x9d2e('0xd'));var crypto=require(_0x9d2e('0xe'));var jsforce=require(_0x9d2e('0xf'));var deskjs=require(_0x9d2e('0x10'));var toCsv=require(_0x9d2e('0xa'));var querystring=require('querystring');var Papa=require(_0x9d2e('0x11'));var Redis=require(_0x9d2e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9d2e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d2e('0x14'))(_0x9d2e('0x15'));var utils=require(_0x9d2e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9d2e('0x17'));var db=require(_0x9d2e('0x18'))['db'];var integrations=require(_0x9d2e('0x19'));function respondWithStatusCode(_0x4b789b,_0x2628f0){_0x2628f0=_0x2628f0||0xcc;return function(_0xc523ca){if(_0xc523ca){return _0x4b789b[_0x9d2e('0x1a')](_0x2628f0);}return _0x4b789b[_0x9d2e('0x1b')](_0x2628f0)[_0x9d2e('0x1c')]();};}function respondWithResult(_0x14130d,_0x5539d5){_0x5539d5=_0x5539d5||0xc8;return function(_0x4f14d5){if(_0x4f14d5){return _0x14130d[_0x9d2e('0x1b')](_0x5539d5)['json'](_0x4f14d5);}};}function respondWithFilteredResult(_0x95531b,_0x4cbeb0){return function(_0x3d197c){if(_0x3d197c){var _0x3fb580=typeof _0x4cbeb0[_0x9d2e('0x1d')]===_0x9d2e('0x1e')&&typeof _0x4cbeb0[_0x9d2e('0x1f')]===_0x9d2e('0x1e');var _0x5f5c7b=_0x3d197c[_0x9d2e('0x20')];var _0x263d81=_0x3fb580?0x0:_0x4cbeb0[_0x9d2e('0x1d')];var _0x5cfdcb=_0x3fb580?_0x3d197c[_0x9d2e('0x20')]:_0x4cbeb0[_0x9d2e('0x1d')]+_0x4cbeb0['limit'];var _0x32e4a1;if(_0x5cfdcb>=_0x5f5c7b){_0x5cfdcb=_0x5f5c7b;_0x32e4a1=0xc8;}else{_0x32e4a1=0xce;}_0x95531b[_0x9d2e('0x1b')](_0x32e4a1);return _0x95531b[_0x9d2e('0x21')](_0x9d2e('0x22'),_0x263d81+'-'+_0x5cfdcb+'/'+_0x5f5c7b)['json'](_0x3d197c);}return null;};}function patchUpdates(_0x551fc5){return function(_0x31a794){try{jsonpatch['apply'](_0x31a794,_0x551fc5,!![]);}catch(_0x4dae93){return BPromise[_0x9d2e('0x23')](_0x4dae93);}return _0x31a794['save']();};}function saveUpdates(_0x2ecddf,_0x2ce447){return function(_0x6128b8){if(_0x6128b8){return _0x6128b8[_0x9d2e('0x24')](_0x2ecddf)[_0x9d2e('0x25')](function(_0x16ed10){return _0x16ed10;});}return null;};}function removeEntity(_0x521ef2,_0x261410){return function(_0x46ef33){if(_0x46ef33){return _0x46ef33[_0x9d2e('0x26')]()[_0x9d2e('0x25')](function(){_0x521ef2[_0x9d2e('0x1b')](0xcc)[_0x9d2e('0x1c')]();});}};}function handleEntityNotFound(_0xb94bdf,_0x57127e){return function(_0x4ce8f1){if(!_0x4ce8f1){_0xb94bdf[_0x9d2e('0x1a')](0x194);}return _0x4ce8f1;};}function handleError(_0x4f79cf,_0x445005){_0x445005=_0x445005||0x1f4;return function(_0x33e23f){logger[_0x9d2e('0x27')](_0x33e23f['stack']);if(_0x33e23f[_0x9d2e('0x28')]){delete _0x33e23f[_0x9d2e('0x28')];}_0x4f79cf[_0x9d2e('0x1b')](_0x445005)[_0x9d2e('0x29')](_0x33e23f);};}exports[_0x9d2e('0x2a')]=function(_0x3951bc,_0x219e75){var _0x8649c7={},_0x65cd22={},_0x31abbd={'count':0x0,'rows':[]};var _0xb8ad82=_['map'](db[_0x9d2e('0x2b')]['rawAttributes'],function(_0x166fb7){return{'name':_0x166fb7[_0x9d2e('0x2c')],'type':_0x166fb7['type']['key']};});_0x65cd22[_0x9d2e('0x2d')]=_[_0x9d2e('0x2e')](_0xb8ad82,_0x9d2e('0x28'));_0x65cd22['query']=_[_0x9d2e('0x2f')](_0x3951bc[_0x9d2e('0x30')]);_0x65cd22[_0x9d2e('0x31')]=_[_0x9d2e('0x32')](_0x65cd22['model'],_0x65cd22[_0x9d2e('0x30')]);_0x8649c7[_0x9d2e('0x33')]=_[_0x9d2e('0x32')](_0x65cd22[_0x9d2e('0x2d')],qs[_0x9d2e('0x34')](_0x3951bc[_0x9d2e('0x30')][_0x9d2e('0x34')]));_0x8649c7[_0x9d2e('0x33')]=_0x8649c7['attributes']['length']?_0x8649c7['attributes']:_0x65cd22['model'];if(!_0x3951bc[_0x9d2e('0x30')][_0x9d2e('0x35')](_0x9d2e('0x36'))){_0x8649c7[_0x9d2e('0x1f')]=qs['limit'](_0x3951bc[_0x9d2e('0x30')][_0x9d2e('0x1f')]);_0x8649c7[_0x9d2e('0x1d')]=qs['offset'](_0x3951bc[_0x9d2e('0x30')][_0x9d2e('0x1d')]);}_0x8649c7[_0x9d2e('0x37')]=qs[_0x9d2e('0x38')](_0x3951bc[_0x9d2e('0x30')][_0x9d2e('0x38')]);_0x8649c7[_0x9d2e('0x39')]=qs['filters'](_['pick'](_0x3951bc['query'],_0x65cd22[_0x9d2e('0x31')]),_0xb8ad82);if(_0x3951bc[_0x9d2e('0x30')][_0x9d2e('0x3a')]){_0x8649c7[_0x9d2e('0x39')]=_[_0x9d2e('0x3b')](_0x8649c7[_0x9d2e('0x39')],{'$or':_[_0x9d2e('0x2e')](_0xb8ad82,function(_0x16cc54){if(_0x16cc54[_0x9d2e('0x3c')]!==_0x9d2e('0x3d')){var _0x2443a5={};_0x2443a5[_0x16cc54['name']]={'$like':'%'+_0x3951bc['query'][_0x9d2e('0x3a')]+'%'};return _0x2443a5;}})});}_0x8649c7=_[_0x9d2e('0x3b')]({},_0x8649c7,_0x3951bc[_0x9d2e('0x3e')]);var _0x4c2090={'where':_0x8649c7['where']};return db[_0x9d2e('0x2b')][_0x9d2e('0x20')](_0x4c2090)['then'](function(_0x4dc9dd){_0x31abbd[_0x9d2e('0x20')]=_0x4dc9dd;if(_0x3951bc[_0x9d2e('0x30')][_0x9d2e('0x3f')]){_0x8649c7['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0x9d2e('0x40')](_0x8649c7);})[_0x9d2e('0x25')](function(_0x45a31c){_0x31abbd[_0x9d2e('0x41')]=_0x45a31c;return _0x31abbd;})[_0x9d2e('0x25')](respondWithFilteredResult(_0x219e75,_0x8649c7))[_0x9d2e('0x42')](handleError(_0x219e75,null));};exports[_0x9d2e('0x43')]=function(_0x27bfcf,_0xd84adf){var _0x8bfdc7={'raw':![],'where':{'id':_0x27bfcf['params']['id']}},_0x3058c0={};_0x3058c0[_0x9d2e('0x2d')]=_[_0x9d2e('0x2f')](db[_0x9d2e('0x2b')]['rawAttributes']);_0x3058c0['query']=_[_0x9d2e('0x2f')](_0x27bfcf[_0x9d2e('0x30')]);_0x3058c0[_0x9d2e('0x31')]=_[_0x9d2e('0x32')](_0x3058c0[_0x9d2e('0x2d')],_0x3058c0[_0x9d2e('0x30')]);_0x8bfdc7[_0x9d2e('0x33')]=_[_0x9d2e('0x32')](_0x3058c0['model'],qs['fields'](_0x27bfcf[_0x9d2e('0x30')][_0x9d2e('0x34')]));_0x8bfdc7[_0x9d2e('0x33')]=_0x8bfdc7[_0x9d2e('0x33')][_0x9d2e('0x44')]?_0x8bfdc7[_0x9d2e('0x33')]:_0x3058c0[_0x9d2e('0x2d')];if(_0x27bfcf[_0x9d2e('0x30')][_0x9d2e('0x3f')]){_0x8bfdc7['include']=[{'all':!![]}];}_0x8bfdc7=_[_0x9d2e('0x3b')]({},_0x8bfdc7,_0x27bfcf[_0x9d2e('0x3e')]);return db[_0x9d2e('0x2b')][_0x9d2e('0x45')](_0x8bfdc7)[_0x9d2e('0x25')](handleEntityNotFound(_0xd84adf,null))[_0x9d2e('0x25')](respondWithResult(_0xd84adf,null))['catch'](handleError(_0xd84adf,null));};exports[_0x9d2e('0x46')]=function(_0x3a2f92,_0xb4fb26){return db[_0x9d2e('0x2b')][_0x9d2e('0x46')](_0x3a2f92[_0x9d2e('0x47')],{})[_0x9d2e('0x25')](respondWithResult(_0xb4fb26,0xc9))[_0x9d2e('0x42')](handleError(_0xb4fb26,null));};exports[_0x9d2e('0x24')]=function(_0x59ae38,_0x58efb8){if(_0x59ae38[_0x9d2e('0x47')]['id']){delete _0x59ae38[_0x9d2e('0x47')]['id'];}return db['ServicenowAccount'][_0x9d2e('0x45')]({'where':{'id':_0x59ae38['params']['id']}})[_0x9d2e('0x25')](handleEntityNotFound(_0x58efb8,null))[_0x9d2e('0x25')](saveUpdates(_0x59ae38[_0x9d2e('0x47')],null))[_0x9d2e('0x25')](respondWithResult(_0x58efb8,null))[_0x9d2e('0x42')](handleError(_0x58efb8,null));};exports[_0x9d2e('0x26')]=function(_0x20c601,_0x3eb3c7){return db[_0x9d2e('0x2b')]['find']({'where':{'id':_0x20c601[_0x9d2e('0x48')]['id']}})['then'](handleEntityNotFound(_0x3eb3c7,null))[_0x9d2e('0x25')](removeEntity(_0x3eb3c7,null))[_0x9d2e('0x42')](handleError(_0x3eb3c7,null));};exports[_0x9d2e('0x49')]=function(_0x2b4f6a,_0x1458e1,_0x165bbd){var _0x2a3d28={};var _0x573fbc={};var _0x568694;var _0x54ca72;return db[_0x9d2e('0x2b')][_0x9d2e('0x4a')]({'where':{'id':_0x2b4f6a['params']['id']}})[_0x9d2e('0x25')](handleEntityNotFound(_0x1458e1,null))[_0x9d2e('0x25')](function(_0x3b6431){if(_0x3b6431){_0x568694=_0x3b6431;_0x573fbc[_0x9d2e('0x2d')]=_[_0x9d2e('0x2f')](db[_0x9d2e('0x4b')][_0x9d2e('0x4c')]);_0x573fbc['query']=_[_0x9d2e('0x2f')](_0x2b4f6a[_0x9d2e('0x30')]);_0x573fbc[_0x9d2e('0x31')]=_['intersection'](_0x573fbc['model'],_0x573fbc[_0x9d2e('0x30')]);_0x2a3d28[_0x9d2e('0x33')]=_['intersection'](_0x573fbc[_0x9d2e('0x2d')],qs['fields'](_0x2b4f6a[_0x9d2e('0x30')][_0x9d2e('0x34')]));_0x2a3d28[_0x9d2e('0x33')]=_0x2a3d28[_0x9d2e('0x33')][_0x9d2e('0x44')]?_0x2a3d28[_0x9d2e('0x33')]:_0x573fbc[_0x9d2e('0x2d')];_0x2a3d28[_0x9d2e('0x37')]=qs[_0x9d2e('0x38')](_0x2b4f6a[_0x9d2e('0x30')][_0x9d2e('0x38')]);_0x2a3d28['where']=qs[_0x9d2e('0x31')](_[_0x9d2e('0x4d')](_0x2b4f6a[_0x9d2e('0x30')],_0x573fbc[_0x9d2e('0x31')]));if(_0x2b4f6a[_0x9d2e('0x30')]['filter']){_0x2a3d28[_0x9d2e('0x39')]=_[_0x9d2e('0x3b')](_0x2a3d28[_0x9d2e('0x39')],{'$or':_[_0x9d2e('0x2e')](_0x2a3d28['attributes'],function(_0xbc9aca){var _0x377c38={};_0x377c38[_0xbc9aca]={'$like':'%'+_0x2b4f6a['query'][_0x9d2e('0x3a')]+'%'};return _0x377c38;})});}_0x2a3d28=_[_0x9d2e('0x3b')]({},_0x2a3d28,_0x2b4f6a['options']);return _0x568694['getConfigurations'](_0x2a3d28);}})[_0x9d2e('0x25')](function(_0x4b42bb){if(_0x4b42bb){_0x54ca72=_0x4b42bb['length'];if(!_0x2b4f6a['query'][_0x9d2e('0x35')]('nolimit')){_0x2a3d28[_0x9d2e('0x1f')]=qs['limit'](_0x2b4f6a[_0x9d2e('0x30')]['limit']);_0x2a3d28['offset']=qs[_0x9d2e('0x1d')](_0x2b4f6a[_0x9d2e('0x30')][_0x9d2e('0x1d')]);}return _0x568694[_0x9d2e('0x49')](_0x2a3d28);}})[_0x9d2e('0x25')](function(_0x58bed3){if(_0x58bed3){return _0x58bed3?{'count':_0x54ca72,'rows':_0x58bed3}:null;}})[_0x9d2e('0x25')](respondWithResult(_0x1458e1,null))['catch'](handleError(_0x1458e1,null));};exports[_0x9d2e('0x4e')]=function(_0x51e9c7,_0x29c3b9,_0x5cb7a0){if(_0x51e9c7[_0x9d2e('0x47')]['id']){delete _0x51e9c7[_0x9d2e('0x47')]['id'];}return db[_0x9d2e('0x2b')]['findOne']({'where':{'id':_0x51e9c7[_0x9d2e('0x48')]['id']}})[_0x9d2e('0x25')](handleEntityNotFound(_0x29c3b9,null))[_0x9d2e('0x25')](function(_0x3340ee){if(_0x3340ee){_0x51e9c7[_0x9d2e('0x47')][_0x9d2e('0x4f')]=_0x3340ee['id'];_0x51e9c7[_0x9d2e('0x47')][_0x9d2e('0x50')]=integrations['getSubjects'](_0x51e9c7[_0x9d2e('0x47')][_0x9d2e('0x51')],_0x51e9c7[_0x9d2e('0x47')]['type']);_0x51e9c7['body'][_0x9d2e('0x52')]=integrations[_0x9d2e('0x53')](_0x51e9c7[_0x9d2e('0x47')][_0x9d2e('0x51')],_0x51e9c7[_0x9d2e('0x47')][_0x9d2e('0x3c')]);return db['ServicenowConfiguration']['create'](_0x51e9c7[_0x9d2e('0x47')],{'include':[{'model':db[_0x9d2e('0x54')],'as':'Subjects'},{'model':db[_0x9d2e('0x54')],'as':_0x9d2e('0x52')}]});}return null;})[_0x9d2e('0x25')](respondWithResult(_0x29c3b9,null))[_0x9d2e('0x42')](handleError(_0x29c3b9,null));};exports[_0x9d2e('0x55')]=function(_0x314040,_0x352b45,_0x3128f7){var _0x219176=['made_sla',_0x9d2e('0x56'),_0x9d2e('0x57'),'subcategory','close_code',_0x9d2e('0x58'),'incident_state',_0x9d2e('0x59'),_0x9d2e('0x5a')];var _0x2fbd55=[_0x9d2e('0x5b'),'made_sla','caused_by',_0x9d2e('0x5c'),'upon_reject','sys_updated_on','child_incidents',_0x9d2e('0x56'),_0x9d2e('0x5d'),_0x9d2e('0x5e'),_0x9d2e('0x5f'),_0x9d2e('0x60'),'opened_by','user_input',_0x9d2e('0x61'),_0x9d2e('0x62'),_0x9d2e('0x63'),'sys_created_by',_0x9d2e('0x57'),_0x9d2e('0x37'),_0x9d2e('0x64'),'closed_at',_0x9d2e('0x65'),_0x9d2e('0x66'),_0x9d2e('0x67'),_0x9d2e('0x68'),_0x9d2e('0x69'),_0x9d2e('0x6a'),_0x9d2e('0x6b'),_0x9d2e('0x6c'),_0x9d2e('0x6d'),'time_worked',_0x9d2e('0x6e'),'opened_at',_0x9d2e('0x6f'),_0x9d2e('0x70'),_0x9d2e('0x71'),_0x9d2e('0x72'),_0x9d2e('0x73'),_0x9d2e('0x74'),_0x9d2e('0x75'),_0x9d2e('0x76'),_0x9d2e('0x77'),_0x9d2e('0x78'),_0x9d2e('0x79'),_0x9d2e('0x7a'),_0x9d2e('0x7b'),'work_start',_0x9d2e('0x7c'),'business_stc','additional_assignee_list',_0x9d2e('0x7d'),_0x9d2e('0x7e'),_0x9d2e('0x58'),_0x9d2e('0x7f'),'close_notes',_0x9d2e('0x80'),'follow_up',_0x9d2e('0x81'),_0x9d2e('0x82'),_0x9d2e('0x83'),_0x9d2e('0x84'),_0x9d2e('0x85'),_0x9d2e('0x86'),'problem_id',_0x9d2e('0x87'),_0x9d2e('0x88'),_0x9d2e('0x89'),_0x9d2e('0x8a'),_0x9d2e('0x59'),_0x9d2e('0x8b'),_0x9d2e('0x8c'),_0x9d2e('0x8d'),_0x9d2e('0x8e'),_0x9d2e('0x8f'),_0x9d2e('0x90'),_0x9d2e('0x91'),_0x9d2e('0x92'),_0x9d2e('0x93'),_0x9d2e('0x94'),'correlation_id',_0x9d2e('0x95'),_0x9d2e('0x5a')];var _0x526be4='';var _0x1a03b9='';var _0x4ab843=[];var _0x1d8fdf='';var _0x43c73b='';var _0x17ce52=[];var _0x38a86e='';var _0x4105b3='';var _0xace7f1={};var _0x3fce16='';return db[_0x9d2e('0x2b')][_0x9d2e('0x4a')]({'where':{'id':_0x314040[_0x9d2e('0x48')]['id']},'attributes':['id','username',_0x9d2e('0x96'),_0x9d2e('0x97'),_0x9d2e('0x98'),'serverUrl']})[_0x9d2e('0x25')](handleEntityNotFound(_0x352b45,null))[_0x9d2e('0x25')](function(_0x5c8402){if(_0x5c8402){_0x3fce16=_0x5c8402[_0x9d2e('0x98')];var _0x314285=_0x3fce16[_0x9d2e('0x99')](-0x1);if(_0x314285==='/'){_0x3fce16=_0x3fce16[_0x9d2e('0x9a')](0x0,_0x3fce16[_0x9d2e('0x9b')](_0x314285));}_0x4105b3=util[_0x9d2e('0x9c')](_0x9d2e('0x9d'),_0x3fce16);_0x38a86e=util[_0x9d2e('0x9c')](_0x9d2e('0x9e'),_0x3fce16);_0xace7f1={'user':_0x5c8402[_0x9d2e('0x9f')],'pass':_0x5c8402['password']};var _0x4e3de3={'method':'GET','uri':_0x4105b3+'incident?sysparm_display_value=all','auth':_0xace7f1,'json':!![]};return rp(_0x4e3de3);}})[_0x9d2e('0x25')](function(_0x4f9a81){if(_0x4f9a81[_0x9d2e('0xa0')][_0x9d2e('0x44')]>0x0){_0x526be4=_0x4f9a81[_0x9d2e('0xa0')];}console[_0x9d2e('0xa1')](_0x9d2e('0xa2'),_0x526be4);_0x17ce52=[];_0x1a03b9=Object['assign']([],_0x526be4);_[_0x9d2e('0xa3')](_0x1a03b9,function(_0xc4aded){return!_0x219176['includes'](_0xc4aded['name']);});_0x1a03b9[_0x9d2e('0xa4')](function(_0x2c7b6c){var _0x497727=createFieldObject(_0x38a86e,_0xace7f1,_0x2c7b6c[_0x9d2e('0xa5')],_0x2c7b6c[_0x9d2e('0x28')],_0x2c7b6c[_0x9d2e('0xa6')],![]);_0x17ce52[_0x9d2e('0xa7')](_0x497727);});return Promise[_0x9d2e('0xa8')](_0x17ce52);})[_0x9d2e('0x25')](function(_0x4ad194){_0x4ab843=_0x4ad194;_0x1d8fdf=Object[_0x9d2e('0xa9')]([],_0x526be4);console[_0x9d2e('0xa1')](_0x9d2e('0xaa'),_0x526be4);_[_0x9d2e('0xa3')](_0x1d8fdf,function(_0x5cc70b){return _0x2fbd55[_0x9d2e('0xab')](_0x5cc70b[_0x9d2e('0x28')]);});console[_0x9d2e('0xa1')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x1d8fdf);_0x17ce52=[];_0x1d8fdf[_0x9d2e('0xa4')](function(_0x309da6){var _0x2008d5=createFieldObject(_0x38a86e,_0xace7f1,_0x309da6[_0x9d2e('0xa5')],_0x309da6[_0x9d2e('0x28')],_0x309da6['label'],!![]);_0x17ce52[_0x9d2e('0xa7')](_0x2008d5);});return Promise[_0x9d2e('0xa8')](_0x17ce52);})['then'](function(_0x2f8b27){_0x43c73b=_0x2f8b27;var _0x496720=_0x4ab843[_0x9d2e('0xac')](_0x43c73b);return{'count':_0x496720[_0x9d2e('0x44')],'rows':_0x496720};})[_0x9d2e('0x25')](respondWithResult(_0x352b45,null))[_0x9d2e('0x42')](function(_0x139e2f){console['log']('ServiceNow\x20error:\x20'+_0x139e2f);var _0x29dffc=_0x314040[_0x9d2e('0x30')][_0x9d2e('0xad')]?0x1f4:_0x139e2f[_0x9d2e('0xae')]||0x1f4;logger['error'](_0x139e2f['stack']);delete _0x139e2f[_0x9d2e('0x28')];if(_0x29dffc===0x191){_0x29dffc=0x190;}_0x352b45['status'](_0x29dffc)[_0x9d2e('0x29')](_0x314040[_0x9d2e('0x30')][_0x9d2e('0xad')]?{'message':_0x9d2e('0xaf'),'statusCode':_0x139e2f[_0x9d2e('0xae')]}:_0x139e2f);});};function createFieldObject(_0x391a62,_0x168db9,_0x8f8713,_0x4bb33c,_0x39480f,_0x10e6bb){return new Promise(function(_0xd0952b,_0x328227){var _0x35d484={'id':_0x4bb33c,'name':_0x39480f,'custom':_0x10e6bb};if(_0x8f8713===_0x9d2e('0xb0')){_0x35d484[_0x9d2e('0x3e')]=[{'name':'True','value':'true'},{'name':_0x9d2e('0xb1'),'value':_0x9d2e('0xb2')}];_0xd0952b(_0x35d484);}else{var _0x148905={'method':_0x9d2e('0xb3'),'uri':_0x391a62+'sys_choice?sysparm_query=name=incident^element='+_0x4bb33c,'auth':_0x168db9,'json':!![]};return rp(_0x148905)['then'](function(_0x256799){var _0x3373f6=[];if(_0x256799[_0x9d2e('0xa0')]['length']>0x0){_0x256799[_0x9d2e('0xa0')][_0x9d2e('0xa4')](function(_0x4daab9){if(_0x4daab9[_0x9d2e('0xb4')]==='false'){var _0x3f004b={'name':_0x4daab9[_0x9d2e('0xa6')],'value':_0x4daab9[_0x9d2e('0xb5')]};_0x3373f6[_0x9d2e('0xa7')](_0x3f004b);}});}_0x35d484[_0x9d2e('0x3e')]=_0x3373f6;if(_0x35d484[_0x9d2e('0x3e')][_0x9d2e('0x44')]>0x0){_0xd0952b(_0x35d484);}else{if(_0x10e6bb==![]){_0xd0952b();}else{_0xd0952b(_0x35d484);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index c3c74c6..ce93d9d 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 _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','int_servicenow_accounts','lodash'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xf494,0x1c6));var _0x4f49=function(_0x10fa4b,_0x15d598){_0x10fa4b=_0x10fa4b-0x0;var _0x29f8cd=_0xf494[_0x10fa4b];return _0x29f8cd;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));var integrations=require(_0x4f49('0xa'));module[_0x4f49('0xb')]=function(_0x413530,_0x42b0e8){return _0x413530['define']('ServicenowAccount',attributes,{'tableName':_0x4f49('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','../../config/logger','api'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xcb785d,_0x29e22d){_0xcb785d=_0xcb785d-0x0;var _0x6e8faf=_0x7fbe[_0xcb785d];return _0x6e8faf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));var integrations=require(_0xe7fb('0x9'));module[_0xe7fb('0xa')]=function(_0x12d1b0,_0x24cd67){return _0x12d1b0[_0xe7fb('0xb')]('ServicenowAccount',attributes,{'tableName':_0xe7fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 6322f0c..b118890 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 _0x0a93=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ServicenowAccount','raw','options','where','limit','include','attributes','map','model','info','GetServicenowAccount','ShowServicenowAccount','find','util','moment','bluebird','../../mysqldb'];(function(_0x461cd0,_0x1099b0){var _0x1cdbb4=function(_0x1dabc9){while(--_0x1dabc9){_0x461cd0['push'](_0x461cd0['shift']());}};_0x1cdbb4(++_0x1099b0);}(_0x0a93,0x194));var _0x30a9=function(_0x2d4301,_0x1749e0){_0x2d4301=_0x2d4301-0x0;var _0x2c783a=_0x0a93[_0x2d4301];return _0x2c783a;};'use strict';var _=require('lodash');var util=require(_0x30a9('0x0'));var moment=require(_0x30a9('0x1'));var BPromise=require(_0x30a9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x30a9('0x3'))['db'];var utils=require(_0x30a9('0x4'));var logger=require(_0x30a9('0x5'))(_0x30a9('0x6'));var config=require(_0x30a9('0x7'));var jayson=require(_0x30a9('0x8'));var client=jayson[_0x30a9('0x9')][_0x30a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e9328,_0x3753a3,_0x5ec5e9){return new BPromise(function(_0x140685,_0x19d24e){return client['request'](_0x1e9328,_0x5ec5e9)[_0x30a9('0xb')](function(_0x1ee438){logger['info'](_0x30a9('0xc'),_0x3753a3,_0x30a9('0xd'));logger[_0x30a9('0xe')](_0x30a9('0xf'),_0x3753a3,_0x30a9('0xd'),JSON[_0x30a9('0x10')](_0x1ee438));if(_0x1ee438['error']){if(_0x1ee438[_0x30a9('0x11')][_0x30a9('0x12')]===0x1f4){logger[_0x30a9('0x11')](_0x30a9('0xc'),_0x3753a3,_0x1ee438[_0x30a9('0x11')][_0x30a9('0x13')]);return _0x19d24e(_0x1ee438[_0x30a9('0x11')][_0x30a9('0x13')]);}logger[_0x30a9('0x11')](_0x30a9('0xc'),_0x3753a3,_0x1ee438[_0x30a9('0x11')][_0x30a9('0x13')]);return _0x140685(_0x1ee438['error'][_0x30a9('0x13')]);}else{logger['info'](_0x30a9('0xc'),_0x3753a3,_0x30a9('0xd'));_0x140685(_0x1ee438['result'][_0x30a9('0x13')]);}})[_0x30a9('0x14')](function(_0x19cec4){logger['error'](_0x30a9('0xc'),_0x3753a3,_0x19cec4);_0x19d24e(_0x19cec4);});});}exports['GetServicenowAccount']=function(_0x5a3de8){var _0x53426a=this;return new Promise(function(_0x40cd10,_0x1d78f8){return db[_0x30a9('0x15')]['findAll']({'raw':_0x5a3de8['options']?_0x5a3de8['options'][_0x30a9('0x16')]===undefined?!![]:![]:!![],'where':_0x5a3de8[_0x30a9('0x17')]?_0x5a3de8['options'][_0x30a9('0x18')]||null:null,'attributes':_0x5a3de8[_0x30a9('0x17')]?_0x5a3de8[_0x30a9('0x17')]['attributes']||null:null,'limit':_0x5a3de8[_0x30a9('0x17')]?_0x5a3de8['options'][_0x30a9('0x19')]||null:null,'include':_0x5a3de8['options']?_0x5a3de8[_0x30a9('0x17')][_0x30a9('0x1a')]?_['map'](_0x5a3de8[_0x30a9('0x17')][_0x30a9('0x1a')],function(_0x4b6b39){return{'model':db[_0x4b6b39['model']],'as':_0x4b6b39['as'],'attributes':_0x4b6b39[_0x30a9('0x1b')],'include':_0x4b6b39['include']?_['map'](_0x4b6b39[_0x30a9('0x1a')],function(_0x13062e){return{'model':db[_0x13062e['model']],'as':_0x13062e['as'],'attributes':_0x13062e[_0x30a9('0x1b')],'include':_0x13062e[_0x30a9('0x1a')]?_[_0x30a9('0x1c')](_0x13062e[_0x30a9('0x1a')],function(_0x50c0fd){return{'model':db[_0x50c0fd[_0x30a9('0x1d')]],'as':_0x50c0fd['as'],'attributes':_0x50c0fd[_0x30a9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x30a9('0xb')](function(_0x13b0fc){logger[_0x30a9('0x1e')](_0x30a9('0x1f'),_0x5a3de8);logger['debug'](_0x30a9('0x1f'),_0x5a3de8,JSON[_0x30a9('0x10')](_0x13b0fc));_0x40cd10(_0x13b0fc);})[_0x30a9('0x14')](function(_0x5af53b){logger[_0x30a9('0x11')](_0x30a9('0x1f'),_0x5af53b[_0x30a9('0x13')],_0x5a3de8);_0x1d78f8(_0x53426a[_0x30a9('0x11')](0x1f4,_0x5af53b[_0x30a9('0x13')]));});});};exports[_0x30a9('0x20')]=function(_0x546490){var _0x2ea9bc=this;return new Promise(function(_0x4a854e,_0x9b2321){return db[_0x30a9('0x15')][_0x30a9('0x21')]({'raw':_0x546490[_0x30a9('0x17')]?_0x546490[_0x30a9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x546490[_0x30a9('0x17')]?_0x546490[_0x30a9('0x17')]['where']||null:null,'attributes':_0x546490['options']?_0x546490[_0x30a9('0x17')][_0x30a9('0x1b')]||null:null,'include':_0x546490[_0x30a9('0x17')]?_0x546490['options']['include']?_['map'](_0x546490[_0x30a9('0x17')][_0x30a9('0x1a')],function(_0x22c75b){return{'model':db[_0x22c75b[_0x30a9('0x1d')]],'as':_0x22c75b['as'],'attributes':_0x22c75b[_0x30a9('0x1b')],'include':_0x22c75b['include']?_[_0x30a9('0x1c')](_0x22c75b[_0x30a9('0x1a')],function(_0x5941ca){return{'model':db[_0x5941ca[_0x30a9('0x1d')]],'as':_0x5941ca['as'],'attributes':_0x5941ca[_0x30a9('0x1b')],'include':_0x5941ca[_0x30a9('0x1a')]?_[_0x30a9('0x1c')](_0x5941ca[_0x30a9('0x1a')],function(_0x61f355){return{'model':db[_0x61f355[_0x30a9('0x1d')]],'as':_0x61f355['as'],'attributes':_0x61f355[_0x30a9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x30a9('0xb')](function(_0xa29cd0){logger[_0x30a9('0x1e')]('ShowServicenowAccount',_0x546490);logger[_0x30a9('0xe')]('ShowServicenowAccount',_0x546490,JSON[_0x30a9('0x10')](_0xa29cd0));_0x4a854e(_0xa29cd0);})['catch'](function(_0x3916ed){logger['error']('ShowServicenowAccount',_0x3916ed['message'],_0x546490);_0x9b2321(_0x2ea9bc[_0x30a9('0x11')](0x1f4,_0x3916ed['message']));});});}; \ No newline at end of file +var _0x8f05=['findAll','options','raw','where','attributes','limit','map','model','include','GetServicenowAccount','catch','ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ServicenowAccount'];(function(_0x923ab6,_0x200ec5){var _0x484752=function(_0x266328){while(--_0x266328){_0x923ab6['push'](_0x923ab6['shift']());}};_0x484752(++_0x200ec5);}(_0x8f05,0xa9));var _0x58f0=function(_0x4cf968,_0x273118){_0x4cf968=_0x4cf968-0x0;var _0x5b5183=_0x8f05[_0x4cf968];return _0x5b5183;};'use strict';var _=require(_0x58f0('0x0'));var util=require(_0x58f0('0x1'));var moment=require(_0x58f0('0x2'));var BPromise=require(_0x58f0('0x3'));var rs=require(_0x58f0('0x4'));var fs=require('fs');var Redis=require(_0x58f0('0x5'));var db=require(_0x58f0('0x6'))['db'];var utils=require(_0x58f0('0x7'));var logger=require(_0x58f0('0x8'))(_0x58f0('0x9'));var config=require(_0x58f0('0xa'));var jayson=require(_0x58f0('0xb'));var client=jayson[_0x58f0('0xc')][_0x58f0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x42b76f,_0x493cf1,_0x81e276){return new BPromise(function(_0x3c7f9c,_0x4b7f0e){return client['request'](_0x42b76f,_0x81e276)[_0x58f0('0xe')](function(_0x583e04){logger['info'](_0x58f0('0xf'),_0x493cf1,_0x58f0('0x10'));logger[_0x58f0('0x11')](_0x58f0('0x12'),_0x493cf1,'request\x20sent',JSON[_0x58f0('0x13')](_0x583e04));if(_0x583e04[_0x58f0('0x14')]){if(_0x583e04['error'][_0x58f0('0x15')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x493cf1,_0x583e04['error']['message']);return _0x4b7f0e(_0x583e04[_0x58f0('0x14')][_0x58f0('0x16')]);}logger[_0x58f0('0x14')](_0x58f0('0xf'),_0x493cf1,_0x583e04[_0x58f0('0x14')][_0x58f0('0x16')]);return _0x3c7f9c(_0x583e04['error'][_0x58f0('0x16')]);}else{logger[_0x58f0('0x17')](_0x58f0('0xf'),_0x493cf1,_0x58f0('0x10'));_0x3c7f9c(_0x583e04[_0x58f0('0x18')][_0x58f0('0x16')]);}})['catch'](function(_0xbc14b0){logger[_0x58f0('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x493cf1,_0xbc14b0);_0x4b7f0e(_0xbc14b0);});});}exports['GetServicenowAccount']=function(_0x5e4b41){var _0x30c173=this;return new Promise(function(_0x34ee6e,_0x3edbf7){return db[_0x58f0('0x19')][_0x58f0('0x1a')]({'raw':_0x5e4b41[_0x58f0('0x1b')]?_0x5e4b41[_0x58f0('0x1b')][_0x58f0('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e4b41[_0x58f0('0x1b')]?_0x5e4b41['options'][_0x58f0('0x1d')]||null:null,'attributes':_0x5e4b41['options']?_0x5e4b41[_0x58f0('0x1b')][_0x58f0('0x1e')]||null:null,'limit':_0x5e4b41[_0x58f0('0x1b')]?_0x5e4b41[_0x58f0('0x1b')][_0x58f0('0x1f')]||null:null,'include':_0x5e4b41[_0x58f0('0x1b')]?_0x5e4b41['options']['include']?_[_0x58f0('0x20')](_0x5e4b41['options']['include'],function(_0x39759c){return{'model':db[_0x39759c[_0x58f0('0x21')]],'as':_0x39759c['as'],'attributes':_0x39759c[_0x58f0('0x1e')],'include':_0x39759c[_0x58f0('0x22')]?_[_0x58f0('0x20')](_0x39759c['include'],function(_0x2bf3cc){return{'model':db[_0x2bf3cc[_0x58f0('0x21')]],'as':_0x2bf3cc['as'],'attributes':_0x2bf3cc[_0x58f0('0x1e')],'include':_0x2bf3cc[_0x58f0('0x22')]?_['map'](_0x2bf3cc[_0x58f0('0x22')],function(_0x2f6d73){return{'model':db[_0x2f6d73['model']],'as':_0x2f6d73['as'],'attributes':_0x2f6d73[_0x58f0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x58f0('0xe')](function(_0x7063d7){logger[_0x58f0('0x17')](_0x58f0('0x23'),_0x5e4b41);logger[_0x58f0('0x11')](_0x58f0('0x23'),_0x5e4b41,JSON[_0x58f0('0x13')](_0x7063d7));_0x34ee6e(_0x7063d7);})[_0x58f0('0x24')](function(_0x3817c6){logger[_0x58f0('0x14')](_0x58f0('0x23'),_0x3817c6[_0x58f0('0x16')],_0x5e4b41);_0x3edbf7(_0x30c173[_0x58f0('0x14')](0x1f4,_0x3817c6['message']));});});};exports[_0x58f0('0x25')]=function(_0x36d05b){var _0x57ab3f=this;return new Promise(function(_0x7b2f8c,_0x125864){return db['ServicenowAccount'][_0x58f0('0x26')]({'raw':_0x36d05b[_0x58f0('0x1b')]?_0x36d05b[_0x58f0('0x1b')][_0x58f0('0x1c')]===undefined?!![]:![]:!![],'where':_0x36d05b['options']?_0x36d05b[_0x58f0('0x1b')][_0x58f0('0x1d')]||null:null,'attributes':_0x36d05b['options']?_0x36d05b[_0x58f0('0x1b')][_0x58f0('0x1e')]||null:null,'include':_0x36d05b[_0x58f0('0x1b')]?_0x36d05b['options'][_0x58f0('0x22')]?_['map'](_0x36d05b[_0x58f0('0x1b')]['include'],function(_0x4dcb6f){return{'model':db[_0x4dcb6f[_0x58f0('0x21')]],'as':_0x4dcb6f['as'],'attributes':_0x4dcb6f['attributes'],'include':_0x4dcb6f[_0x58f0('0x22')]?_[_0x58f0('0x20')](_0x4dcb6f[_0x58f0('0x22')],function(_0x376813){return{'model':db[_0x376813['model']],'as':_0x376813['as'],'attributes':_0x376813[_0x58f0('0x1e')],'include':_0x376813[_0x58f0('0x22')]?_[_0x58f0('0x20')](_0x376813[_0x58f0('0x22')],function(_0x13de2d){return{'model':db[_0x13de2d[_0x58f0('0x21')]],'as':_0x13de2d['as'],'attributes':_0x13de2d['attributes']};}):[]};}):[]};}):[]:[]})[_0x58f0('0xe')](function(_0x1a0f34){logger[_0x58f0('0x17')](_0x58f0('0x25'),_0x36d05b);logger[_0x58f0('0x11')]('ShowServicenowAccount',_0x36d05b,JSON[_0x58f0('0x13')](_0x1a0f34));_0x7b2f8c(_0x1a0f34);})[_0x58f0('0x24')](function(_0x1a87b4){logger[_0x58f0('0x14')](_0x58f0('0x25'),_0x1a87b4['message'],_0x36d05b);_0x125864(_0x57ab3f[_0x58f0('0x14')](0x1f4,_0x1a87b4[_0x58f0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 1881457..94c6c3b 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 _0x7924=['get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','create','update','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x9b2ed0,_0x39b963){var _0x310329=function(_0x58fb15){while(--_0x58fb15){_0x9b2ed0['push'](_0x9b2ed0['shift']());}};_0x310329(++_0x39b963);}(_0x7924,0x138));var _0x4792=function(_0x4084eb,_0x30c6ad){_0x4084eb=_0x4084eb-0x0;var _0x4c1f1c=_0x7924[_0x4084eb];return _0x4c1f1c;};'use strict';var multer=require(_0x4792('0x0'));var util=require(_0x4792('0x1'));var path=require('path');var timeout=require(_0x4792('0x2'));var express=require(_0x4792('0x3'));var router=express[_0x4792('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4792('0x5'));var config=require(_0x4792('0x6'));var controller=require(_0x4792('0x7'));router[_0x4792('0x8')]('/',auth[_0x4792('0x9')](),controller[_0x4792('0xa')]);router[_0x4792('0x8')](_0x4792('0xb'),auth[_0x4792('0x9')](),controller[_0x4792('0xc')]);router[_0x4792('0x8')](_0x4792('0xd'),auth[_0x4792('0x9')](),controller['getFields']);router['get'](_0x4792('0xe'),auth['isAuthenticated'](),controller[_0x4792('0xf')]);router[_0x4792('0x8')](_0x4792('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0x4792('0x9')](),controller[_0x4792('0x11')]);router['put'](_0x4792('0xb'),auth[_0x4792('0x9')](),controller[_0x4792('0x12')]);router['delete'](_0x4792('0xb'),auth[_0x4792('0x9')](),controller[_0x4792('0x13')]);module['exports']=router; \ No newline at end of file +var _0x6bcf=['Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','delete','exports','multer','util','path','express'];(function(_0x5050a0,_0x280fbd){var _0x2a2904=function(_0x97c693){while(--_0x97c693){_0x5050a0['push'](_0x5050a0['shift']());}};_0x2a2904(++_0x280fbd);}(_0x6bcf,0x146));var _0xf6bc=function(_0x5bdfba,_0x432b43){_0x5bdfba=_0x5bdfba-0x0;var _0x5d323e=_0x6bcf[_0x5bdfba];return _0x5d323e;};'use strict';var multer=require(_0xf6bc('0x0'));var util=require(_0xf6bc('0x1'));var path=require(_0xf6bc('0x2'));var timeout=require('connect-timeout');var express=require(_0xf6bc('0x3'));var router=express[_0xf6bc('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf6bc('0x5'));var config=require(_0xf6bc('0x6'));var controller=require(_0xf6bc('0x7'));router[_0xf6bc('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf6bc('0x8')](_0xf6bc('0x9'),auth[_0xf6bc('0xa')](),controller[_0xf6bc('0xb')]);router[_0xf6bc('0x8')](_0xf6bc('0xc'),auth[_0xf6bc('0xa')](),controller[_0xf6bc('0xd')]);router['get'](_0xf6bc('0xe'),auth[_0xf6bc('0xa')](),controller[_0xf6bc('0xf')]);router[_0xf6bc('0x8')](_0xf6bc('0x10'),auth[_0xf6bc('0xa')](),controller[_0xf6bc('0x11')]);router[_0xf6bc('0x12')]('/',auth[_0xf6bc('0xa')](),controller[_0xf6bc('0x13')]);router['put'](_0xf6bc('0x9'),auth[_0xf6bc('0xa')](),controller['update']);router[_0xf6bc('0x14')]('/:id',auth[_0xf6bc('0xa')](),controller['destroy']);module[_0xf6bc('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 0a20a77..fa6ea15 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 _0xf236=['STRING'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0xf236,0x1d8));var _0x6f23=function(_0xfb0cfd,_0x500179){_0xfb0cfd=_0xfb0cfd-0x0;var _0x2fd8aa=_0xf236[_0xfb0cfd];return _0x2fd8aa;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6f23('0x0')]},'description':{'type':Sequelize[_0x6f23('0x0')]}}; \ No newline at end of file +var _0x640f=['STRING','sequelize','exports'];(function(_0x59526a,_0x2dcc67){var _0xa2e3d0=function(_0x3e8af7){while(--_0x3e8af7){_0x59526a['push'](_0x59526a['shift']());}};_0xa2e3d0(++_0x2dcc67);}(_0x640f,0x1c3));var _0xf640=function(_0x540e7c,_0x8e9bc6){_0x540e7c=_0x540e7c-0x0;var _0xa63278=_0x640f[_0x540e7c];return _0xa63278;};'use strict';var Sequelize=require(_0xf640('0x0'));module[_0xf640('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf640('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 48b0c9b..95240a1 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 _0xcb32=['../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','update','then','end','error','stack','name','send','map','ServicenowConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','getFields','findOne','ServicenowField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4a0fca,_0xba7712){var _0x332687=function(_0x5bdb33){while(--_0x5bdb33){_0x4a0fca['push'](_0x4a0fca['shift']());}};_0x332687(++_0xba7712);}(_0xcb32,0x175));var _0x2cb3=function(_0x16087e,_0x13af55){_0x16087e=_0x16087e-0x0;var _0xc98afa=_0xcb32[_0x16087e];return _0xc98afa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2cb3('0x0'));var zipdir=require(_0x2cb3('0x1'));var jsonpatch=require(_0x2cb3('0x2'));var rp=require(_0x2cb3('0x3'));var moment=require(_0x2cb3('0x4'));var BPromise=require(_0x2cb3('0x5'));var Mustache=require(_0x2cb3('0x6'));var util=require(_0x2cb3('0x7'));var path=require(_0x2cb3('0x8'));var sox=require(_0x2cb3('0x9'));var csv=require(_0x2cb3('0xa'));var ejs=require(_0x2cb3('0xb'));var fs=require('fs');var fs_extra=require(_0x2cb3('0xc'));var _=require('lodash');var squel=require(_0x2cb3('0xd'));var crypto=require('crypto');var jsforce=require(_0x2cb3('0xe'));var deskjs=require(_0x2cb3('0xf'));var toCsv=require(_0x2cb3('0xa'));var querystring=require(_0x2cb3('0x10'));var Papa=require(_0x2cb3('0x11'));var Redis=require(_0x2cb3('0x12'));var authService=require(_0x2cb3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2cb3('0x14'));var hardwareService=require(_0x2cb3('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2cb3('0x16'));var licenseUtil=require(_0x2cb3('0x17'));var db=require(_0x2cb3('0x18'))['db'];function respondWithStatusCode(_0x1a719b,_0x1d9918){_0x1d9918=_0x1d9918||0xcc;return function(_0x422af4){if(_0x422af4){return _0x1a719b['sendStatus'](_0x1d9918);}return _0x1a719b[_0x2cb3('0x19')](_0x1d9918)['end']();};}function respondWithResult(_0x2db5c2,_0x454feb){_0x454feb=_0x454feb||0xc8;return function(_0x51804b){if(_0x51804b){return _0x2db5c2[_0x2cb3('0x19')](_0x454feb)[_0x2cb3('0x1a')](_0x51804b);}};}function respondWithFilteredResult(_0x4d85d7,_0x436124){return function(_0x306661){if(_0x306661){var _0x5ab61f=typeof _0x436124[_0x2cb3('0x1b')]==='undefined'&&typeof _0x436124['limit']===_0x2cb3('0x1c');var _0x16b7b5=_0x306661[_0x2cb3('0x1d')];var _0x297549=_0x5ab61f?0x0:_0x436124[_0x2cb3('0x1b')];var _0x32a892=_0x5ab61f?_0x306661[_0x2cb3('0x1d')]:_0x436124['offset']+_0x436124[_0x2cb3('0x1e')];var _0x5010e6;if(_0x32a892>=_0x16b7b5){_0x32a892=_0x16b7b5;_0x5010e6=0xc8;}else{_0x5010e6=0xce;}_0x4d85d7[_0x2cb3('0x19')](_0x5010e6);return _0x4d85d7[_0x2cb3('0x1f')]('Content-Range',_0x297549+'-'+_0x32a892+'/'+_0x16b7b5)[_0x2cb3('0x1a')](_0x306661);}return null;};}function patchUpdates(_0x194be6){return function(_0x1a81e1){try{jsonpatch[_0x2cb3('0x20')](_0x1a81e1,_0x194be6,!![]);}catch(_0x3e97b1){return BPromise[_0x2cb3('0x21')](_0x3e97b1);}return _0x1a81e1['save']();};}function saveUpdates(_0x485aab,_0x5259ff){return function(_0x56b5d7){if(_0x56b5d7){return _0x56b5d7[_0x2cb3('0x22')](_0x485aab)['then'](function(_0x55ac87){return _0x55ac87;});}return null;};}function removeEntity(_0x3060a0,_0x5385cd){return function(_0x53a65d){if(_0x53a65d){return _0x53a65d['destroy']()[_0x2cb3('0x23')](function(){_0x3060a0[_0x2cb3('0x19')](0xcc)[_0x2cb3('0x24')]();});}};}function handleEntityNotFound(_0x2a3c76,_0x4d5914){return function(_0x55ab49){if(!_0x55ab49){_0x2a3c76['sendStatus'](0x194);}return _0x55ab49;};}function handleError(_0x3115f8,_0x114f15){_0x114f15=_0x114f15||0x1f4;return function(_0x236df7){logger[_0x2cb3('0x25')](_0x236df7[_0x2cb3('0x26')]);if(_0x236df7[_0x2cb3('0x27')]){delete _0x236df7[_0x2cb3('0x27')];}_0x3115f8[_0x2cb3('0x19')](_0x114f15)[_0x2cb3('0x28')](_0x236df7);};}exports['index']=function(_0x4b5c46,_0x7a5167){var _0xdc3c80={},_0x396336={},_0x54d68d={'count':0x0,'rows':[]};var _0x542ce1=_[_0x2cb3('0x29')](db[_0x2cb3('0x2a')][_0x2cb3('0x2b')],function(_0x9a065e){return{'name':_0x9a065e['fieldName'],'type':_0x9a065e[_0x2cb3('0x2c')][_0x2cb3('0x2d')]};});_0x396336[_0x2cb3('0x2e')]=_[_0x2cb3('0x29')](_0x542ce1,_0x2cb3('0x27'));_0x396336[_0x2cb3('0x2f')]=_[_0x2cb3('0x30')](_0x4b5c46[_0x2cb3('0x2f')]);_0x396336['filters']=_[_0x2cb3('0x31')](_0x396336[_0x2cb3('0x2e')],_0x396336['query']);_0xdc3c80[_0x2cb3('0x32')]=_[_0x2cb3('0x31')](_0x396336[_0x2cb3('0x2e')],qs['fields'](_0x4b5c46['query'][_0x2cb3('0x33')]));_0xdc3c80['attributes']=_0xdc3c80[_0x2cb3('0x32')][_0x2cb3('0x34')]?_0xdc3c80[_0x2cb3('0x32')]:_0x396336[_0x2cb3('0x2e')];if(!_0x4b5c46[_0x2cb3('0x2f')][_0x2cb3('0x35')](_0x2cb3('0x36'))){_0xdc3c80['limit']=qs[_0x2cb3('0x1e')](_0x4b5c46[_0x2cb3('0x2f')][_0x2cb3('0x1e')]);_0xdc3c80[_0x2cb3('0x1b')]=qs[_0x2cb3('0x1b')](_0x4b5c46[_0x2cb3('0x2f')]['offset']);}_0xdc3c80[_0x2cb3('0x37')]=qs[_0x2cb3('0x38')](_0x4b5c46[_0x2cb3('0x2f')][_0x2cb3('0x38')]);_0xdc3c80[_0x2cb3('0x39')]=qs['filters'](_[_0x2cb3('0x3a')](_0x4b5c46['query'],_0x396336[_0x2cb3('0x3b')]),_0x542ce1);if(_0x4b5c46[_0x2cb3('0x2f')][_0x2cb3('0x3c')]){_0xdc3c80[_0x2cb3('0x39')]=_[_0x2cb3('0x3d')](_0xdc3c80['where'],{'$or':_[_0x2cb3('0x29')](_0x542ce1,function(_0x13c8d8){if(_0x13c8d8[_0x2cb3('0x2c')]!=='VIRTUAL'){var _0xa6f096={};_0xa6f096[_0x13c8d8['name']]={'$like':'%'+_0x4b5c46['query'][_0x2cb3('0x3c')]+'%'};return _0xa6f096;}})});}_0xdc3c80=_[_0x2cb3('0x3d')]({},_0xdc3c80,_0x4b5c46[_0x2cb3('0x3e')]);var _0x24eb5d={'where':_0xdc3c80[_0x2cb3('0x39')]};return db[_0x2cb3('0x2a')][_0x2cb3('0x1d')](_0x24eb5d)[_0x2cb3('0x23')](function(_0x418836){_0x54d68d[_0x2cb3('0x1d')]=_0x418836;if(_0x4b5c46[_0x2cb3('0x2f')][_0x2cb3('0x3f')]){_0xdc3c80[_0x2cb3('0x40')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x2cb3('0x41')](_0xdc3c80);})[_0x2cb3('0x23')](function(_0x416a4e){_0x54d68d[_0x2cb3('0x42')]=_0x416a4e;return _0x54d68d;})[_0x2cb3('0x23')](respondWithFilteredResult(_0x7a5167,_0xdc3c80))[_0x2cb3('0x43')](handleError(_0x7a5167,null));};exports[_0x2cb3('0x44')]=function(_0x2f52cb,_0x5e86fd){var _0x4856c4={'raw':![],'where':{'id':_0x2f52cb[_0x2cb3('0x45')]['id']}},_0x330e6f={};_0x330e6f[_0x2cb3('0x2e')]=_[_0x2cb3('0x30')](db[_0x2cb3('0x2a')][_0x2cb3('0x2b')]);_0x330e6f[_0x2cb3('0x2f')]=_['keys'](_0x2f52cb['query']);_0x330e6f[_0x2cb3('0x3b')]=_[_0x2cb3('0x31')](_0x330e6f[_0x2cb3('0x2e')],_0x330e6f[_0x2cb3('0x2f')]);_0x4856c4[_0x2cb3('0x32')]=_[_0x2cb3('0x31')](_0x330e6f[_0x2cb3('0x2e')],qs['fields'](_0x2f52cb[_0x2cb3('0x2f')][_0x2cb3('0x33')]));_0x4856c4[_0x2cb3('0x32')]=_0x4856c4[_0x2cb3('0x32')][_0x2cb3('0x34')]?_0x4856c4[_0x2cb3('0x32')]:_0x330e6f[_0x2cb3('0x2e')];if(_0x2f52cb[_0x2cb3('0x2f')]['includeAll']){_0x4856c4[_0x2cb3('0x40')]=[{'all':!![]}];}_0x4856c4=_[_0x2cb3('0x3d')]({},_0x4856c4,_0x2f52cb[_0x2cb3('0x3e')]);return db[_0x2cb3('0x2a')][_0x2cb3('0x46')](_0x4856c4)[_0x2cb3('0x23')](handleEntityNotFound(_0x5e86fd,null))[_0x2cb3('0x23')](respondWithResult(_0x5e86fd,null))[_0x2cb3('0x43')](handleError(_0x5e86fd,null));};exports['create']=function(_0x567a73,_0x228a68){return db['ServicenowConfiguration'][_0x2cb3('0x47')](_0x567a73[_0x2cb3('0x48')],{})[_0x2cb3('0x23')](respondWithResult(_0x228a68,0xc9))[_0x2cb3('0x43')](handleError(_0x228a68,null));};exports[_0x2cb3('0x22')]=function(_0x21c8df,_0x4a0872){if(_0x21c8df[_0x2cb3('0x48')]['id']){delete _0x21c8df['body']['id'];}return db['ServicenowConfiguration'][_0x2cb3('0x46')]({'where':{'id':_0x21c8df[_0x2cb3('0x45')]['id']}})[_0x2cb3('0x23')](handleEntityNotFound(_0x4a0872,null))['then'](saveUpdates(_0x21c8df[_0x2cb3('0x48')],null))['then'](respondWithResult(_0x4a0872,null))[_0x2cb3('0x43')](handleError(_0x4a0872,null));};exports[_0x2cb3('0x49')]=function(_0x3d8009,_0x471576){return db[_0x2cb3('0x2a')]['find']({'where':{'id':_0x3d8009[_0x2cb3('0x45')]['id']}})[_0x2cb3('0x23')](handleEntityNotFound(_0x471576,null))[_0x2cb3('0x23')](removeEntity(_0x471576,null))[_0x2cb3('0x43')](handleError(_0x471576,null));};exports[_0x2cb3('0x4a')]=function(_0x1e5d7b,_0x22de24,_0x5555be){var _0x248bdd={};var _0x2fd8b1={};var _0x1e606a;var _0x543217;return db[_0x2cb3('0x2a')][_0x2cb3('0x4b')]({'where':{'id':_0x1e5d7b[_0x2cb3('0x45')]['id']}})[_0x2cb3('0x23')](handleEntityNotFound(_0x22de24,null))[_0x2cb3('0x23')](function(_0xf94883){if(_0xf94883){_0x1e606a=_0xf94883;_0x2fd8b1[_0x2cb3('0x2e')]=_[_0x2cb3('0x30')](db[_0x2cb3('0x4c')][_0x2cb3('0x2b')]);_0x2fd8b1[_0x2cb3('0x2f')]=_[_0x2cb3('0x30')](_0x1e5d7b[_0x2cb3('0x2f')]);_0x2fd8b1[_0x2cb3('0x3b')]=_[_0x2cb3('0x31')](_0x2fd8b1[_0x2cb3('0x2e')],_0x2fd8b1['query']);_0x248bdd[_0x2cb3('0x32')]=_[_0x2cb3('0x31')](_0x2fd8b1[_0x2cb3('0x2e')],qs[_0x2cb3('0x33')](_0x1e5d7b[_0x2cb3('0x2f')][_0x2cb3('0x33')]));_0x248bdd[_0x2cb3('0x32')]=_0x248bdd[_0x2cb3('0x32')][_0x2cb3('0x34')]?_0x248bdd[_0x2cb3('0x32')]:_0x2fd8b1[_0x2cb3('0x2e')];_0x248bdd[_0x2cb3('0x37')]=qs[_0x2cb3('0x38')](_0x1e5d7b[_0x2cb3('0x2f')][_0x2cb3('0x38')]);_0x248bdd[_0x2cb3('0x39')]=qs['filters'](_[_0x2cb3('0x3a')](_0x1e5d7b[_0x2cb3('0x2f')],_0x2fd8b1[_0x2cb3('0x3b')]));if(_0x1e5d7b[_0x2cb3('0x2f')][_0x2cb3('0x3c')]){_0x248bdd['where']=_['merge'](_0x248bdd[_0x2cb3('0x39')],{'$or':_['map'](_0x248bdd[_0x2cb3('0x32')],function(_0x5817f0){var _0x13139e={};_0x13139e[_0x5817f0]={'$like':'%'+_0x1e5d7b[_0x2cb3('0x2f')][_0x2cb3('0x3c')]+'%'};return _0x13139e;})});}_0x248bdd=_[_0x2cb3('0x3d')]({},_0x248bdd,_0x1e5d7b['options']);return _0x1e606a[_0x2cb3('0x4a')](_0x248bdd);}})['then'](function(_0x240f37){if(_0x240f37){_0x543217=_0x240f37[_0x2cb3('0x34')];if(!_0x1e5d7b[_0x2cb3('0x2f')]['hasOwnProperty'](_0x2cb3('0x36'))){_0x248bdd[_0x2cb3('0x1e')]=qs[_0x2cb3('0x1e')](_0x1e5d7b[_0x2cb3('0x2f')][_0x2cb3('0x1e')]);_0x248bdd[_0x2cb3('0x1b')]=qs[_0x2cb3('0x1b')](_0x1e5d7b[_0x2cb3('0x2f')][_0x2cb3('0x1b')]);}return _0x1e606a[_0x2cb3('0x4a')](_0x248bdd);}})['then'](function(_0x4a05a5){if(_0x4a05a5){return _0x4a05a5?{'count':_0x543217,'rows':_0x4a05a5}:null;}})[_0x2cb3('0x23')](respondWithResult(_0x22de24,null))['catch'](handleError(_0x22de24,null));};exports['getSubjects']=function(_0x24b572,_0x3d916f,_0x2fb758){var _0x4f14aa={};var _0x23b96e={};var _0x49d7e9;var _0x34e77d;return db[_0x2cb3('0x2a')][_0x2cb3('0x4b')]({'where':{'id':_0x24b572['params']['id']}})[_0x2cb3('0x23')](handleEntityNotFound(_0x3d916f,null))[_0x2cb3('0x23')](function(_0xea602c){if(_0xea602c){_0x49d7e9=_0xea602c;_0x23b96e[_0x2cb3('0x2e')]=_['keys'](db['ServicenowField'][_0x2cb3('0x2b')]);_0x23b96e[_0x2cb3('0x2f')]=_[_0x2cb3('0x30')](_0x24b572[_0x2cb3('0x2f')]);_0x23b96e[_0x2cb3('0x3b')]=_[_0x2cb3('0x31')](_0x23b96e[_0x2cb3('0x2e')],_0x23b96e[_0x2cb3('0x2f')]);_0x4f14aa['attributes']=_[_0x2cb3('0x31')](_0x23b96e['model'],qs[_0x2cb3('0x33')](_0x24b572[_0x2cb3('0x2f')]['fields']));_0x4f14aa[_0x2cb3('0x32')]=_0x4f14aa[_0x2cb3('0x32')][_0x2cb3('0x34')]?_0x4f14aa[_0x2cb3('0x32')]:_0x23b96e[_0x2cb3('0x2e')];_0x4f14aa[_0x2cb3('0x37')]=qs[_0x2cb3('0x38')](_0x24b572[_0x2cb3('0x2f')][_0x2cb3('0x38')]);_0x4f14aa[_0x2cb3('0x39')]=qs[_0x2cb3('0x3b')](_['pick'](_0x24b572[_0x2cb3('0x2f')],_0x23b96e['filters']));if(_0x24b572['query'][_0x2cb3('0x3c')]){_0x4f14aa[_0x2cb3('0x39')]=_[_0x2cb3('0x3d')](_0x4f14aa[_0x2cb3('0x39')],{'$or':_[_0x2cb3('0x29')](_0x4f14aa[_0x2cb3('0x32')],function(_0x384ce7){var _0x14af4d={};_0x14af4d[_0x384ce7]={'$like':'%'+_0x24b572[_0x2cb3('0x2f')][_0x2cb3('0x3c')]+'%'};return _0x14af4d;})});}_0x4f14aa=_[_0x2cb3('0x3d')]({},_0x4f14aa,_0x24b572[_0x2cb3('0x3e')]);return _0x49d7e9['getSubjects'](_0x4f14aa);}})['then'](function(_0x3c0bd6){if(_0x3c0bd6){_0x34e77d=_0x3c0bd6[_0x2cb3('0x34')];if(!_0x24b572[_0x2cb3('0x2f')]['hasOwnProperty'](_0x2cb3('0x36'))){_0x4f14aa[_0x2cb3('0x1e')]=qs[_0x2cb3('0x1e')](_0x24b572['query'][_0x2cb3('0x1e')]);_0x4f14aa[_0x2cb3('0x1b')]=qs[_0x2cb3('0x1b')](_0x24b572['query'][_0x2cb3('0x1b')]);}return _0x49d7e9[_0x2cb3('0x4d')](_0x4f14aa);}})[_0x2cb3('0x23')](function(_0x157dbe){if(_0x157dbe){return _0x157dbe?{'count':_0x34e77d,'rows':_0x157dbe}:null;}})[_0x2cb3('0x23')](respondWithResult(_0x3d916f,null))[_0x2cb3('0x43')](handleError(_0x3d916f,null));};exports[_0x2cb3('0x4e')]=function(_0x234304,_0x3dd83a,_0x35e0e0){var _0x1a7f58={};var _0x3c94ad={};var _0x5985de;var _0x454c0e;return db[_0x2cb3('0x2a')][_0x2cb3('0x4b')]({'where':{'id':_0x234304['params']['id']}})['then'](handleEntityNotFound(_0x3dd83a,null))['then'](function(_0x4e9f07){if(_0x4e9f07){_0x5985de=_0x4e9f07;_0x3c94ad['model']=_[_0x2cb3('0x30')](db[_0x2cb3('0x4c')]['rawAttributes']);_0x3c94ad[_0x2cb3('0x2f')]=_['keys'](_0x234304[_0x2cb3('0x2f')]);_0x3c94ad[_0x2cb3('0x3b')]=_[_0x2cb3('0x31')](_0x3c94ad['model'],_0x3c94ad[_0x2cb3('0x2f')]);_0x1a7f58['attributes']=_[_0x2cb3('0x31')](_0x3c94ad[_0x2cb3('0x2e')],qs[_0x2cb3('0x33')](_0x234304[_0x2cb3('0x2f')][_0x2cb3('0x33')]));_0x1a7f58[_0x2cb3('0x32')]=_0x1a7f58[_0x2cb3('0x32')]['length']?_0x1a7f58[_0x2cb3('0x32')]:_0x3c94ad[_0x2cb3('0x2e')];_0x1a7f58[_0x2cb3('0x37')]=qs[_0x2cb3('0x38')](_0x234304[_0x2cb3('0x2f')][_0x2cb3('0x38')]);_0x1a7f58[_0x2cb3('0x39')]=qs[_0x2cb3('0x3b')](_[_0x2cb3('0x3a')](_0x234304['query'],_0x3c94ad['filters']));if(_0x234304['query']['filter']){_0x1a7f58[_0x2cb3('0x39')]=_[_0x2cb3('0x3d')](_0x1a7f58[_0x2cb3('0x39')],{'$or':_[_0x2cb3('0x29')](_0x1a7f58[_0x2cb3('0x32')],function(_0x560bbd){var _0x238350={};_0x238350[_0x560bbd]={'$like':'%'+_0x234304[_0x2cb3('0x2f')][_0x2cb3('0x3c')]+'%'};return _0x238350;})});}_0x1a7f58=_[_0x2cb3('0x3d')]({},_0x1a7f58,_0x234304['options']);return _0x5985de[_0x2cb3('0x4e')](_0x1a7f58);}})[_0x2cb3('0x23')](function(_0x51f45f){if(_0x51f45f){_0x454c0e=_0x51f45f[_0x2cb3('0x34')];if(!_0x234304[_0x2cb3('0x2f')][_0x2cb3('0x35')](_0x2cb3('0x36'))){_0x1a7f58[_0x2cb3('0x1e')]=qs[_0x2cb3('0x1e')](_0x234304[_0x2cb3('0x2f')][_0x2cb3('0x1e')]);_0x1a7f58[_0x2cb3('0x1b')]=qs['offset'](_0x234304[_0x2cb3('0x2f')][_0x2cb3('0x1b')]);}return _0x5985de[_0x2cb3('0x4e')](_0x1a7f58);}})['then'](function(_0x598e39){if(_0x598e39){return _0x598e39?{'count':_0x454c0e,'rows':_0x598e39}:null;}})[_0x2cb3('0x23')](respondWithResult(_0x3dd83a,null))[_0x2cb3('0x43')](handleError(_0x3dd83a,null));}; \ No newline at end of file +var _0xe073=['offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','ServicenowConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','length','includeAll','find','create','body','update','params','getFields','findOne','ServicenowField','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','mustache','util','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','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json'];(function(_0x2ce823,_0x3263b0){var _0x3ccc6c=function(_0x2dd36c){while(--_0x2dd36c){_0x2ce823['push'](_0x2ce823['shift']());}};_0x3ccc6c(++_0x3263b0);}(_0xe073,0x121));var _0x3e07=function(_0xdd3f9a,_0x4d9fbc){_0xdd3f9a=_0xdd3f9a-0x0;var _0x4186f3=_0xe073[_0xdd3f9a];return _0x4186f3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3e07('0x0'));var jsonpatch=require(_0x3e07('0x1'));var rp=require(_0x3e07('0x2'));var moment=require(_0x3e07('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3e07('0x4'));var util=require(_0x3e07('0x5'));var path=require('path');var sox=require(_0x3e07('0x6'));var csv=require(_0x3e07('0x7'));var ejs=require(_0x3e07('0x8'));var fs=require('fs');var fs_extra=require(_0x3e07('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3e07('0xa'));var deskjs=require(_0x3e07('0xb'));var toCsv=require(_0x3e07('0x7'));var querystring=require(_0x3e07('0xc'));var Papa=require('papaparse');var Redis=require(_0x3e07('0xd'));var authService=require(_0x3e07('0xe'));var qs=require(_0x3e07('0xf'));var as=require(_0x3e07('0x10'));var hardwareService=require(_0x3e07('0x11'));var logger=require(_0x3e07('0x12'))(_0x3e07('0x13'));var utils=require(_0x3e07('0x14'));var config=require(_0x3e07('0x15'));var licenseUtil=require(_0x3e07('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x214af4,_0x46c61e){_0x46c61e=_0x46c61e||0xcc;return function(_0x4edd74){if(_0x4edd74){return _0x214af4[_0x3e07('0x17')](_0x46c61e);}return _0x214af4[_0x3e07('0x18')](_0x46c61e)[_0x3e07('0x19')]();};}function respondWithResult(_0x3dbf19,_0x33af45){_0x33af45=_0x33af45||0xc8;return function(_0x186522){if(_0x186522){return _0x3dbf19[_0x3e07('0x18')](_0x33af45)[_0x3e07('0x1a')](_0x186522);}};}function respondWithFilteredResult(_0x3217f6,_0x3f7bfc){return function(_0x2e5ff4){if(_0x2e5ff4){var _0x2f1e6e=typeof _0x3f7bfc[_0x3e07('0x1b')]===_0x3e07('0x1c')&&typeof _0x3f7bfc[_0x3e07('0x1d')]===_0x3e07('0x1c');var _0xe5eb3c=_0x2e5ff4[_0x3e07('0x1e')];var _0x60a984=_0x2f1e6e?0x0:_0x3f7bfc[_0x3e07('0x1b')];var _0x21b83e=_0x2f1e6e?_0x2e5ff4['count']:_0x3f7bfc[_0x3e07('0x1b')]+_0x3f7bfc[_0x3e07('0x1d')];var _0x33048a;if(_0x21b83e>=_0xe5eb3c){_0x21b83e=_0xe5eb3c;_0x33048a=0xc8;}else{_0x33048a=0xce;}_0x3217f6['status'](_0x33048a);return _0x3217f6[_0x3e07('0x1f')](_0x3e07('0x20'),_0x60a984+'-'+_0x21b83e+'/'+_0xe5eb3c)['json'](_0x2e5ff4);}return null;};}function patchUpdates(_0x5723a5){return function(_0x235bc8){try{jsonpatch[_0x3e07('0x21')](_0x235bc8,_0x5723a5,!![]);}catch(_0x49db6d){return BPromise['reject'](_0x49db6d);}return _0x235bc8[_0x3e07('0x22')]();};}function saveUpdates(_0x37266a,_0x5eb579){return function(_0x186962){if(_0x186962){return _0x186962['update'](_0x37266a)[_0x3e07('0x23')](function(_0x366e04){return _0x366e04;});}return null;};}function removeEntity(_0x3270ef,_0x320e5a){return function(_0xe6c112){if(_0xe6c112){return _0xe6c112[_0x3e07('0x24')]()[_0x3e07('0x23')](function(){_0x3270ef[_0x3e07('0x18')](0xcc)[_0x3e07('0x19')]();});}};}function handleEntityNotFound(_0x4b6294,_0xe24977){return function(_0x2e5472){if(!_0x2e5472){_0x4b6294['sendStatus'](0x194);}return _0x2e5472;};}function handleError(_0x59c199,_0x486b98){_0x486b98=_0x486b98||0x1f4;return function(_0x526182){logger[_0x3e07('0x25')](_0x526182[_0x3e07('0x26')]);if(_0x526182[_0x3e07('0x27')]){delete _0x526182[_0x3e07('0x27')];}_0x59c199['status'](_0x486b98)['send'](_0x526182);};}exports['index']=function(_0x77a246,_0x2da56d){var _0x2ea1d0={},_0x5a4b15={},_0x2f6899={'count':0x0,'rows':[]};var _0x500d92=_['map'](db[_0x3e07('0x28')][_0x3e07('0x29')],function(_0x1326a9){return{'name':_0x1326a9[_0x3e07('0x2a')],'type':_0x1326a9[_0x3e07('0x2b')]['key']};});_0x5a4b15[_0x3e07('0x2c')]=_[_0x3e07('0x2d')](_0x500d92,'name');_0x5a4b15[_0x3e07('0x2e')]=_[_0x3e07('0x2f')](_0x77a246[_0x3e07('0x2e')]);_0x5a4b15[_0x3e07('0x30')]=_[_0x3e07('0x31')](_0x5a4b15[_0x3e07('0x2c')],_0x5a4b15[_0x3e07('0x2e')]);_0x2ea1d0[_0x3e07('0x32')]=_[_0x3e07('0x31')](_0x5a4b15[_0x3e07('0x2c')],qs[_0x3e07('0x33')](_0x77a246[_0x3e07('0x2e')][_0x3e07('0x33')]));_0x2ea1d0[_0x3e07('0x32')]=_0x2ea1d0[_0x3e07('0x32')]['length']?_0x2ea1d0[_0x3e07('0x32')]:_0x5a4b15[_0x3e07('0x2c')];if(!_0x77a246[_0x3e07('0x2e')][_0x3e07('0x34')](_0x3e07('0x35'))){_0x2ea1d0[_0x3e07('0x1d')]=qs[_0x3e07('0x1d')](_0x77a246[_0x3e07('0x2e')][_0x3e07('0x1d')]);_0x2ea1d0['offset']=qs[_0x3e07('0x1b')](_0x77a246[_0x3e07('0x2e')][_0x3e07('0x1b')]);}_0x2ea1d0[_0x3e07('0x36')]=qs[_0x3e07('0x37')](_0x77a246[_0x3e07('0x2e')][_0x3e07('0x37')]);_0x2ea1d0[_0x3e07('0x38')]=qs['filters'](_[_0x3e07('0x39')](_0x77a246[_0x3e07('0x2e')],_0x5a4b15[_0x3e07('0x30')]),_0x500d92);if(_0x77a246['query'][_0x3e07('0x3a')]){_0x2ea1d0[_0x3e07('0x38')]=_[_0x3e07('0x3b')](_0x2ea1d0[_0x3e07('0x38')],{'$or':_['map'](_0x500d92,function(_0x2c1f8f){if(_0x2c1f8f[_0x3e07('0x2b')]!==_0x3e07('0x3c')){var _0x3b51d0={};_0x3b51d0[_0x2c1f8f[_0x3e07('0x27')]]={'$like':'%'+_0x77a246['query'][_0x3e07('0x3a')]+'%'};return _0x3b51d0;}})});}_0x2ea1d0=_[_0x3e07('0x3b')]({},_0x2ea1d0,_0x77a246[_0x3e07('0x3d')]);var _0x4fa62f={'where':_0x2ea1d0[_0x3e07('0x38')]};return db[_0x3e07('0x28')][_0x3e07('0x1e')](_0x4fa62f)[_0x3e07('0x23')](function(_0x62d120){_0x2f6899[_0x3e07('0x1e')]=_0x62d120;if(_0x77a246['query']['includeAll']){_0x2ea1d0[_0x3e07('0x3e')]=[{'all':!![]}];}return db[_0x3e07('0x28')][_0x3e07('0x3f')](_0x2ea1d0);})[_0x3e07('0x23')](function(_0x4ae0b7){_0x2f6899[_0x3e07('0x40')]=_0x4ae0b7;return _0x2f6899;})['then'](respondWithFilteredResult(_0x2da56d,_0x2ea1d0))[_0x3e07('0x41')](handleError(_0x2da56d,null));};exports[_0x3e07('0x42')]=function(_0x41e788,_0x45d1af){var _0x13b434={'raw':![],'where':{'id':_0x41e788['params']['id']}},_0x24c71b={};_0x24c71b[_0x3e07('0x2c')]=_['keys'](db['ServicenowConfiguration'][_0x3e07('0x29')]);_0x24c71b[_0x3e07('0x2e')]=_[_0x3e07('0x2f')](_0x41e788[_0x3e07('0x2e')]);_0x24c71b[_0x3e07('0x30')]=_[_0x3e07('0x31')](_0x24c71b[_0x3e07('0x2c')],_0x24c71b[_0x3e07('0x2e')]);_0x13b434[_0x3e07('0x32')]=_['intersection'](_0x24c71b[_0x3e07('0x2c')],qs['fields'](_0x41e788['query']['fields']));_0x13b434[_0x3e07('0x32')]=_0x13b434[_0x3e07('0x32')][_0x3e07('0x43')]?_0x13b434['attributes']:_0x24c71b[_0x3e07('0x2c')];if(_0x41e788['query'][_0x3e07('0x44')]){_0x13b434[_0x3e07('0x3e')]=[{'all':!![]}];}_0x13b434=_[_0x3e07('0x3b')]({},_0x13b434,_0x41e788['options']);return db[_0x3e07('0x28')][_0x3e07('0x45')](_0x13b434)[_0x3e07('0x23')](handleEntityNotFound(_0x45d1af,null))[_0x3e07('0x23')](respondWithResult(_0x45d1af,null))[_0x3e07('0x41')](handleError(_0x45d1af,null));};exports[_0x3e07('0x46')]=function(_0xace4f0,_0x537281){return db[_0x3e07('0x28')][_0x3e07('0x46')](_0xace4f0[_0x3e07('0x47')],{})[_0x3e07('0x23')](respondWithResult(_0x537281,0xc9))['catch'](handleError(_0x537281,null));};exports[_0x3e07('0x48')]=function(_0x24f31e,_0x2884ff){if(_0x24f31e[_0x3e07('0x47')]['id']){delete _0x24f31e['body']['id'];}return db[_0x3e07('0x28')]['find']({'where':{'id':_0x24f31e[_0x3e07('0x49')]['id']}})[_0x3e07('0x23')](handleEntityNotFound(_0x2884ff,null))['then'](saveUpdates(_0x24f31e[_0x3e07('0x47')],null))[_0x3e07('0x23')](respondWithResult(_0x2884ff,null))[_0x3e07('0x41')](handleError(_0x2884ff,null));};exports[_0x3e07('0x24')]=function(_0x4ec782,_0x501eed){return db['ServicenowConfiguration'][_0x3e07('0x45')]({'where':{'id':_0x4ec782[_0x3e07('0x49')]['id']}})[_0x3e07('0x23')](handleEntityNotFound(_0x501eed,null))[_0x3e07('0x23')](removeEntity(_0x501eed,null))['catch'](handleError(_0x501eed,null));};exports[_0x3e07('0x4a')]=function(_0x3441bb,_0x387879,_0x5efa4c){var _0x298979={};var _0xaa9f38={};var _0x585add;var _0x32f9cb;return db[_0x3e07('0x28')][_0x3e07('0x4b')]({'where':{'id':_0x3441bb[_0x3e07('0x49')]['id']}})[_0x3e07('0x23')](handleEntityNotFound(_0x387879,null))[_0x3e07('0x23')](function(_0x3f48c0){if(_0x3f48c0){_0x585add=_0x3f48c0;_0xaa9f38['model']=_[_0x3e07('0x2f')](db[_0x3e07('0x4c')][_0x3e07('0x29')]);_0xaa9f38[_0x3e07('0x2e')]=_[_0x3e07('0x2f')](_0x3441bb[_0x3e07('0x2e')]);_0xaa9f38[_0x3e07('0x30')]=_[_0x3e07('0x31')](_0xaa9f38[_0x3e07('0x2c')],_0xaa9f38[_0x3e07('0x2e')]);_0x298979[_0x3e07('0x32')]=_[_0x3e07('0x31')](_0xaa9f38['model'],qs['fields'](_0x3441bb[_0x3e07('0x2e')][_0x3e07('0x33')]));_0x298979['attributes']=_0x298979['attributes'][_0x3e07('0x43')]?_0x298979[_0x3e07('0x32')]:_0xaa9f38[_0x3e07('0x2c')];_0x298979[_0x3e07('0x36')]=qs[_0x3e07('0x37')](_0x3441bb['query']['sort']);_0x298979[_0x3e07('0x38')]=qs[_0x3e07('0x30')](_[_0x3e07('0x39')](_0x3441bb[_0x3e07('0x2e')],_0xaa9f38['filters']));if(_0x3441bb[_0x3e07('0x2e')][_0x3e07('0x3a')]){_0x298979['where']=_['merge'](_0x298979[_0x3e07('0x38')],{'$or':_[_0x3e07('0x2d')](_0x298979[_0x3e07('0x32')],function(_0x2267a2){var _0x44efbb={};_0x44efbb[_0x2267a2]={'$like':'%'+_0x3441bb[_0x3e07('0x2e')][_0x3e07('0x3a')]+'%'};return _0x44efbb;})});}_0x298979=_[_0x3e07('0x3b')]({},_0x298979,_0x3441bb[_0x3e07('0x3d')]);return _0x585add[_0x3e07('0x4a')](_0x298979);}})[_0x3e07('0x23')](function(_0x13a086){if(_0x13a086){_0x32f9cb=_0x13a086[_0x3e07('0x43')];if(!_0x3441bb[_0x3e07('0x2e')][_0x3e07('0x34')](_0x3e07('0x35'))){_0x298979['limit']=qs[_0x3e07('0x1d')](_0x3441bb[_0x3e07('0x2e')][_0x3e07('0x1d')]);_0x298979[_0x3e07('0x1b')]=qs[_0x3e07('0x1b')](_0x3441bb[_0x3e07('0x2e')]['offset']);}return _0x585add[_0x3e07('0x4a')](_0x298979);}})[_0x3e07('0x23')](function(_0x2d2909){if(_0x2d2909){return _0x2d2909?{'count':_0x32f9cb,'rows':_0x2d2909}:null;}})['then'](respondWithResult(_0x387879,null))[_0x3e07('0x41')](handleError(_0x387879,null));};exports['getSubjects']=function(_0x527114,_0x55bbaf,_0x4b63c9){var _0x322b9f={};var _0x2b081c={};var _0x5e05ad;var _0x4c350d;return db[_0x3e07('0x28')][_0x3e07('0x4b')]({'where':{'id':_0x527114['params']['id']}})[_0x3e07('0x23')](handleEntityNotFound(_0x55bbaf,null))[_0x3e07('0x23')](function(_0x49d0e8){if(_0x49d0e8){_0x5e05ad=_0x49d0e8;_0x2b081c[_0x3e07('0x2c')]=_[_0x3e07('0x2f')](db[_0x3e07('0x4c')][_0x3e07('0x29')]);_0x2b081c[_0x3e07('0x2e')]=_[_0x3e07('0x2f')](_0x527114[_0x3e07('0x2e')]);_0x2b081c[_0x3e07('0x30')]=_[_0x3e07('0x31')](_0x2b081c['model'],_0x2b081c[_0x3e07('0x2e')]);_0x322b9f[_0x3e07('0x32')]=_[_0x3e07('0x31')](_0x2b081c[_0x3e07('0x2c')],qs[_0x3e07('0x33')](_0x527114[_0x3e07('0x2e')][_0x3e07('0x33')]));_0x322b9f[_0x3e07('0x32')]=_0x322b9f[_0x3e07('0x32')][_0x3e07('0x43')]?_0x322b9f[_0x3e07('0x32')]:_0x2b081c[_0x3e07('0x2c')];_0x322b9f['order']=qs[_0x3e07('0x37')](_0x527114[_0x3e07('0x2e')]['sort']);_0x322b9f[_0x3e07('0x38')]=qs[_0x3e07('0x30')](_[_0x3e07('0x39')](_0x527114[_0x3e07('0x2e')],_0x2b081c['filters']));if(_0x527114[_0x3e07('0x2e')][_0x3e07('0x3a')]){_0x322b9f['where']=_[_0x3e07('0x3b')](_0x322b9f[_0x3e07('0x38')],{'$or':_[_0x3e07('0x2d')](_0x322b9f[_0x3e07('0x32')],function(_0x19fbc7){var _0x5614f9={};_0x5614f9[_0x19fbc7]={'$like':'%'+_0x527114['query'][_0x3e07('0x3a')]+'%'};return _0x5614f9;})});}_0x322b9f=_['merge']({},_0x322b9f,_0x527114['options']);return _0x5e05ad['getSubjects'](_0x322b9f);}})[_0x3e07('0x23')](function(_0x3b817e){if(_0x3b817e){_0x4c350d=_0x3b817e[_0x3e07('0x43')];if(!_0x527114[_0x3e07('0x2e')][_0x3e07('0x34')](_0x3e07('0x35'))){_0x322b9f[_0x3e07('0x1d')]=qs[_0x3e07('0x1d')](_0x527114['query'][_0x3e07('0x1d')]);_0x322b9f['offset']=qs[_0x3e07('0x1b')](_0x527114[_0x3e07('0x2e')][_0x3e07('0x1b')]);}return _0x5e05ad[_0x3e07('0x4d')](_0x322b9f);}})[_0x3e07('0x23')](function(_0x1d3e6a){if(_0x1d3e6a){return _0x1d3e6a?{'count':_0x4c350d,'rows':_0x1d3e6a}:null;}})[_0x3e07('0x23')](respondWithResult(_0x55bbaf,null))[_0x3e07('0x41')](handleError(_0x55bbaf,null));};exports[_0x3e07('0x4e')]=function(_0x10d123,_0x435cf7,_0x1e111b){var _0x927f3a={};var _0x5b1c47={};var _0x4fea5e;var _0x8f4c77;return db[_0x3e07('0x28')][_0x3e07('0x4b')]({'where':{'id':_0x10d123[_0x3e07('0x49')]['id']}})['then'](handleEntityNotFound(_0x435cf7,null))['then'](function(_0x5d1d20){if(_0x5d1d20){_0x4fea5e=_0x5d1d20;_0x5b1c47['model']=_['keys'](db[_0x3e07('0x4c')][_0x3e07('0x29')]);_0x5b1c47[_0x3e07('0x2e')]=_[_0x3e07('0x2f')](_0x10d123[_0x3e07('0x2e')]);_0x5b1c47[_0x3e07('0x30')]=_[_0x3e07('0x31')](_0x5b1c47[_0x3e07('0x2c')],_0x5b1c47[_0x3e07('0x2e')]);_0x927f3a['attributes']=_[_0x3e07('0x31')](_0x5b1c47[_0x3e07('0x2c')],qs[_0x3e07('0x33')](_0x10d123['query'][_0x3e07('0x33')]));_0x927f3a[_0x3e07('0x32')]=_0x927f3a[_0x3e07('0x32')][_0x3e07('0x43')]?_0x927f3a[_0x3e07('0x32')]:_0x5b1c47[_0x3e07('0x2c')];_0x927f3a[_0x3e07('0x36')]=qs[_0x3e07('0x37')](_0x10d123[_0x3e07('0x2e')][_0x3e07('0x37')]);_0x927f3a[_0x3e07('0x38')]=qs[_0x3e07('0x30')](_[_0x3e07('0x39')](_0x10d123[_0x3e07('0x2e')],_0x5b1c47[_0x3e07('0x30')]));if(_0x10d123[_0x3e07('0x2e')][_0x3e07('0x3a')]){_0x927f3a[_0x3e07('0x38')]=_[_0x3e07('0x3b')](_0x927f3a[_0x3e07('0x38')],{'$or':_[_0x3e07('0x2d')](_0x927f3a['attributes'],function(_0x5144a2){var _0x68f92a={};_0x68f92a[_0x5144a2]={'$like':'%'+_0x10d123['query']['filter']+'%'};return _0x68f92a;})});}_0x927f3a=_[_0x3e07('0x3b')]({},_0x927f3a,_0x10d123[_0x3e07('0x3d')]);return _0x4fea5e[_0x3e07('0x4e')](_0x927f3a);}})[_0x3e07('0x23')](function(_0x204755){if(_0x204755){_0x8f4c77=_0x204755[_0x3e07('0x43')];if(!_0x10d123[_0x3e07('0x2e')][_0x3e07('0x34')](_0x3e07('0x35'))){_0x927f3a[_0x3e07('0x1d')]=qs['limit'](_0x10d123[_0x3e07('0x2e')][_0x3e07('0x1d')]);_0x927f3a[_0x3e07('0x1b')]=qs[_0x3e07('0x1b')](_0x10d123[_0x3e07('0x2e')][_0x3e07('0x1b')]);}return _0x4fea5e['getDescriptions'](_0x927f3a);}})[_0x3e07('0x23')](function(_0x25618e){if(_0x25618e){return _0x25618e?{'count':_0x8f4c77,'rows':_0x25618e}:null;}})[_0x3e07('0x23')](respondWithResult(_0x435cf7,null))[_0x3e07('0x41')](handleError(_0x435cf7,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 7407678..b5429cb 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 _0x9861=['ServicenowConfiguration','int_servicenow_configurations','lodash','api','moment','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports','define'];(function(_0x5c92a4,_0x819c46){var _0x2007e7=function(_0x4235f6){while(--_0x4235f6){_0x5c92a4['push'](_0x5c92a4['shift']());}};_0x2007e7(++_0x819c46);}(_0x9861,0x176));var _0x1986=function(_0x3a529d,_0x4ec119){_0x3a529d=_0x3a529d-0x0;var _0x20930=_0x9861[_0x3a529d];return _0x20930;};'use strict';var _=require(_0x1986('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1986('0x1'));var moment=require(_0x1986('0x2'));var BPromise=require(_0x1986('0x3'));var rp=require(_0x1986('0x4'));var fs=require('fs');var path=require(_0x1986('0x5'));var rimraf=require(_0x1986('0x6'));var config=require('../../config/environment');var attributes=require(_0x1986('0x7'));module[_0x1986('0x8')]=function(_0x1b56d6,_0x17ccbf){return _0x1b56d6[_0x1986('0x9')](_0x1986('0xa'),attributes,{'tableName':_0x1986('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4227=['./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','api','bluebird','request-promise','path','../../config/environment'];(function(_0x553967,_0x3d3b28){var _0x274346=function(_0xf3124f){while(--_0xf3124f){_0x553967['push'](_0x553967['shift']());}};_0x274346(++_0x3d3b28);}(_0x4227,0x89));var _0x7422=function(_0x49dd50,_0x5d80cc){_0x49dd50=_0x49dd50-0x0;var _0x5a2d8e=_0x4227[_0x49dd50];return _0x5a2d8e;};'use strict';var _=require(_0x7422('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7422('0x1'));var moment=require('moment');var BPromise=require(_0x7422('0x2'));var rp=require(_0x7422('0x3'));var fs=require('fs');var path=require(_0x7422('0x4'));var rimraf=require('rimraf');var config=require(_0x7422('0x5'));var attributes=require(_0x7422('0x6'));module[_0x7422('0x7')]=function(_0x36ddba,_0x4432d6){return _0x36ddba[_0x7422('0x8')](_0x7422('0x9'),attributes,{'tableName':_0x7422('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 73ce101..c1f7799 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 _0x06cc=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x06cc,0x18e));var _0xc06c=function(_0x5e8701,_0x167b31){_0x5e8701=_0x5e8701-0x0;var _0x369911=_0x06cc[_0x5e8701];return _0x369911;};'use strict';var _=require(_0xc06c('0x0'));var util=require(_0xc06c('0x1'));var moment=require(_0xc06c('0x2'));var BPromise=require(_0xc06c('0x3'));var rs=require(_0xc06c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc06c('0x5'))['db'];var utils=require(_0xc06c('0x6'));var logger=require(_0xc06c('0x7'))(_0xc06c('0x8'));var config=require('../../config/environment');var jayson=require(_0xc06c('0x9'));var client=jayson[_0xc06c('0xa')][_0xc06c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x708d4d,_0x461520,_0x32650d){return new BPromise(function(_0x2e290c,_0x2390bf){return client[_0xc06c('0xc')](_0x708d4d,_0x32650d)[_0xc06c('0xd')](function(_0x4ca4ec){logger[_0xc06c('0xe')](_0xc06c('0xf'),_0x461520,'request\x20sent');logger['debug'](_0xc06c('0x10'),_0x461520,_0xc06c('0x11'),JSON['stringify'](_0x4ca4ec));if(_0x4ca4ec[_0xc06c('0x12')]){if(_0x4ca4ec['error'][_0xc06c('0x13')]===0x1f4){logger[_0xc06c('0x12')](_0xc06c('0xf'),_0x461520,_0x4ca4ec['error'][_0xc06c('0x14')]);return _0x2390bf(_0x4ca4ec[_0xc06c('0x12')][_0xc06c('0x14')]);}logger[_0xc06c('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x461520,_0x4ca4ec[_0xc06c('0x12')][_0xc06c('0x14')]);return _0x2e290c(_0x4ca4ec[_0xc06c('0x12')][_0xc06c('0x14')]);}else{logger['info'](_0xc06c('0xf'),_0x461520,_0xc06c('0x11'));_0x2e290c(_0x4ca4ec['result'][_0xc06c('0x14')]);}})['catch'](function(_0x5a48f3){logger[_0xc06c('0x12')](_0xc06c('0xf'),_0x461520,_0x5a48f3);_0x2390bf(_0x5a48f3);});});} \ No newline at end of file +var _0x8f05=['info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request'];(function(_0x44f435,_0x27146f){var _0x28c643=function(_0x46f25c){while(--_0x46f25c){_0x44f435['push'](_0x44f435['shift']());}};_0x28c643(++_0x27146f);}(_0x8f05,0x1cb));var _0x58f0=function(_0x394a85,_0xd2106e){_0x394a85=_0x394a85-0x0;var _0x3cb48f=_0x8f05[_0x394a85];return _0x3cb48f;};'use strict';var _=require(_0x58f0('0x0'));var util=require(_0x58f0('0x1'));var moment=require(_0x58f0('0x2'));var BPromise=require('bluebird');var rs=require(_0x58f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58f0('0x4'))['db'];var utils=require(_0x58f0('0x5'));var logger=require('../../config/logger')(_0x58f0('0x6'));var config=require(_0x58f0('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x430b86,_0x114ec6,_0x264693){return new BPromise(function(_0x4a95e2,_0x148bf1){return client[_0x58f0('0x8')](_0x430b86,_0x264693)['then'](function(_0x5bea04){logger[_0x58f0('0x9')](_0x58f0('0xa'),_0x114ec6,_0x58f0('0xb'));logger[_0x58f0('0xc')](_0x58f0('0xd'),_0x114ec6,_0x58f0('0xb'),JSON['stringify'](_0x5bea04));if(_0x5bea04[_0x58f0('0xe')]){if(_0x5bea04[_0x58f0('0xe')][_0x58f0('0xf')]===0x1f4){logger[_0x58f0('0xe')](_0x58f0('0xa'),_0x114ec6,_0x5bea04['error'][_0x58f0('0x10')]);return _0x148bf1(_0x5bea04['error'][_0x58f0('0x10')]);}logger[_0x58f0('0xe')](_0x58f0('0xa'),_0x114ec6,_0x5bea04[_0x58f0('0xe')][_0x58f0('0x10')]);return _0x4a95e2(_0x5bea04[_0x58f0('0xe')]['message']);}else{logger[_0x58f0('0x9')](_0x58f0('0xa'),_0x114ec6,_0x58f0('0xb'));_0x4a95e2(_0x5bea04[_0x58f0('0x11')][_0x58f0('0x10')]);}})['catch'](function(_0x3b40a8){logger['error'](_0x58f0('0xa'),_0x114ec6,_0x3b40a8);_0x148bf1(_0x3b40a8);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 0216e5b..55a499d 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 _0xf83d=['put','update','/:id','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','post','create'];(function(_0x390c78,_0x15b1c9){var _0x36693a=function(_0x480bee){while(--_0x480bee){_0x390c78['push'](_0x390c78['shift']());}};_0x36693a(++_0x15b1c9);}(_0xf83d,0x154));var _0xdf83=function(_0x32751e,_0x3a0924){_0x32751e=_0x32751e-0x0;var _0x33f3fd=_0xf83d[_0x32751e];return _0x33f3fd;};'use strict';var multer=require('multer');var util=require(_0xdf83('0x0'));var path=require(_0xdf83('0x1'));var timeout=require(_0xdf83('0x2'));var express=require(_0xdf83('0x3'));var router=express[_0xdf83('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdf83('0x5'));var interaction=require(_0xdf83('0x6'));var config=require(_0xdf83('0x7'));var controller=require('./intServicenowField.controller');router[_0xdf83('0x8')]('/',auth[_0xdf83('0x9')](),controller['index']);router['get']('/:id',auth[_0xdf83('0x9')](),controller['show']);router[_0xdf83('0xa')]('/',auth[_0xdf83('0x9')](),controller[_0xdf83('0xb')]);router[_0xdf83('0xc')]('/:id',auth[_0xdf83('0x9')](),controller[_0xdf83('0xd')]);router['delete'](_0xdf83('0xe'),auth['isAuthenticated'](),controller[_0xdf83('0xf')]);module['exports']=router; \ No newline at end of file +var _0x4f6c=['isAuthenticated','index','/:id','show','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get'];(function(_0x5be2aa,_0xf184af){var _0x3e8b06=function(_0x156d87){while(--_0x156d87){_0x5be2aa['push'](_0x5be2aa['shift']());}};_0x3e8b06(++_0xf184af);}(_0x4f6c,0x14a));var _0xc4f6=function(_0x54f9bb,_0x427975){_0x54f9bb=_0x54f9bb-0x0;var _0x1dba3f=_0x4f6c[_0x54f9bb];return _0x1dba3f;};'use strict';var multer=require(_0xc4f6('0x0'));var util=require(_0xc4f6('0x1'));var path=require(_0xc4f6('0x2'));var timeout=require(_0xc4f6('0x3'));var express=require(_0xc4f6('0x4'));var router=express['Router']();var fs_extra=require(_0xc4f6('0x5'));var auth=require(_0xc4f6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc4f6('0x7'));var controller=require(_0xc4f6('0x8'));router[_0xc4f6('0x9')]('/',auth[_0xc4f6('0xa')](),controller[_0xc4f6('0xb')]);router[_0xc4f6('0x9')](_0xc4f6('0xc'),auth[_0xc4f6('0xa')](),controller[_0xc4f6('0xd')]);router['post']('/',auth[_0xc4f6('0xa')](),controller['create']);router[_0xc4f6('0xe')](_0xc4f6('0xc'),auth[_0xc4f6('0xa')](),controller[_0xc4f6('0xf')]);router['delete'](_0xc4f6('0xc'),auth[_0xc4f6('0xa')](),controller[_0xc4f6('0x10')]);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 981cd28..1527d65 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 _0x8d77=['STRING','BOOLEAN','exports','string','variable','customVariable','keyValue','picklist'];(function(_0x4d777a,_0xf1ec76){var _0x104589=function(_0x29e692){while(--_0x29e692){_0x4d777a['push'](_0x4d777a['shift']());}};_0x104589(++_0xf1ec76);}(_0x8d77,0x92));var _0x78d7=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x8d77[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require('sequelize');module[_0x78d7('0x0')]={'type':{'type':Sequelize['ENUM'](_0x78d7('0x1'),_0x78d7('0x2'),_0x78d7('0x3'),_0x78d7('0x4'),_0x78d7('0x5')),'defaultValue':_0x78d7('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x78d7('0x1'),_0x78d7('0x2'),_0x78d7('0x3'))},'keyContent':{'type':Sequelize[_0x78d7('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x78d7('0x6')]},'customField':{'type':Sequelize[_0x78d7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x78d7('0x6')]}}; \ No newline at end of file +var _0x9fda=['picklist','STRING','exports','ENUM','string','variable','customVariable'];(function(_0x54b582,_0x4bf77c){var _0x46eeee=function(_0x345a33){while(--_0x345a33){_0x54b582['push'](_0x54b582['shift']());}};_0x46eeee(++_0x4bf77c);}(_0x9fda,0xf7));var _0xa9fd=function(_0x13d682,_0x4a7706){_0x13d682=_0x13d682-0x0;var _0x5123cd=_0x9fda[_0x13d682];return _0x5123cd;};'use strict';var Sequelize=require('sequelize');module[_0xa9fd('0x0')]={'type':{'type':Sequelize[_0xa9fd('0x1')](_0xa9fd('0x2'),_0xa9fd('0x3'),_0xa9fd('0x4'),'keyValue',_0xa9fd('0x5')),'defaultValue':_0xa9fd('0x2')},'content':{'type':Sequelize[_0xa9fd('0x6')]},'key':{'type':Sequelize[_0xa9fd('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xa9fd('0x2'),_0xa9fd('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xa9fd('0x6')]},'idField':{'type':Sequelize[_0xa9fd('0x6')]},'nameField':{'type':Sequelize[_0xa9fd('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa9fd('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index e507bb1..fbb68e9 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 _0x479d=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','include','create','body','params','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','ServicenowField','type'];(function(_0x23d007,_0x538e72){var _0x2a0146=function(_0x39f9e3){while(--_0x39f9e3){_0x23d007['push'](_0x23d007['shift']());}};_0x2a0146(++_0x538e72);}(_0x479d,0x134));var _0xd479=function(_0x7d6286,_0x26b5e1){_0x7d6286=_0x7d6286-0x0;var _0x29f3bf=_0x479d[_0x7d6286];return _0x29f3bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd479('0x0'));var zipdir=require(_0xd479('0x1'));var jsonpatch=require(_0xd479('0x2'));var rp=require(_0xd479('0x3'));var moment=require(_0xd479('0x4'));var BPromise=require(_0xd479('0x5'));var Mustache=require('mustache');var util=require(_0xd479('0x6'));var path=require('path');var sox=require(_0xd479('0x7'));var csv=require('to-csv');var ejs=require(_0xd479('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(_0xd479('0x9'));var deskjs=require(_0xd479('0xa'));var toCsv=require(_0xd479('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd479('0xc'));var authService=require(_0xd479('0xd'));var qs=require(_0xd479('0xe'));var as=require(_0xd479('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd479('0x10'));var utils=require(_0xd479('0x11'));var config=require(_0xd479('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xd479('0x13'))['db'];function respondWithStatusCode(_0x1e7cc2,_0x5cb1df){_0x5cb1df=_0x5cb1df||0xcc;return function(_0x5e203a){if(_0x5e203a){return _0x1e7cc2[_0xd479('0x14')](_0x5cb1df);}return _0x1e7cc2[_0xd479('0x15')](_0x5cb1df)[_0xd479('0x16')]();};}function respondWithResult(_0x3c3cce,_0x84def8){_0x84def8=_0x84def8||0xc8;return function(_0x5817c9){if(_0x5817c9){return _0x3c3cce[_0xd479('0x15')](_0x84def8)[_0xd479('0x17')](_0x5817c9);}};}function respondWithFilteredResult(_0x5d83ed,_0x5e86e6){return function(_0x3d3fd4){if(_0x3d3fd4){var _0x1e90a9=typeof _0x5e86e6[_0xd479('0x18')]==='undefined'&&typeof _0x5e86e6[_0xd479('0x19')]===_0xd479('0x1a');var _0xd9b9c0=_0x3d3fd4[_0xd479('0x1b')];var _0x58cbeb=_0x1e90a9?0x0:_0x5e86e6[_0xd479('0x18')];var _0x24af7f=_0x1e90a9?_0x3d3fd4[_0xd479('0x1b')]:_0x5e86e6[_0xd479('0x18')]+_0x5e86e6[_0xd479('0x19')];var _0xf57952;if(_0x24af7f>=_0xd9b9c0){_0x24af7f=_0xd9b9c0;_0xf57952=0xc8;}else{_0xf57952=0xce;}_0x5d83ed[_0xd479('0x15')](_0xf57952);return _0x5d83ed[_0xd479('0x1c')]('Content-Range',_0x58cbeb+'-'+_0x24af7f+'/'+_0xd9b9c0)[_0xd479('0x17')](_0x3d3fd4);}return null;};}function patchUpdates(_0x4e0d6b){return function(_0x44fbfc){try{jsonpatch[_0xd479('0x1d')](_0x44fbfc,_0x4e0d6b,!![]);}catch(_0x5c4098){return BPromise[_0xd479('0x1e')](_0x5c4098);}return _0x44fbfc[_0xd479('0x1f')]();};}function saveUpdates(_0x564ffc,_0x2276da){return function(_0x4849dc){if(_0x4849dc){return _0x4849dc[_0xd479('0x20')](_0x564ffc)[_0xd479('0x21')](function(_0x9f90af){return _0x9f90af;});}return null;};}function removeEntity(_0x3b79ab,_0x3010b0){return function(_0x4b97a5){if(_0x4b97a5){return _0x4b97a5[_0xd479('0x22')]()[_0xd479('0x21')](function(){_0x3b79ab[_0xd479('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x455e9e,_0x5902a7){return function(_0x2ddb56){if(!_0x2ddb56){_0x455e9e['sendStatus'](0x194);}return _0x2ddb56;};}function handleError(_0x496f3f,_0x570f7a){_0x570f7a=_0x570f7a||0x1f4;return function(_0x5b021b){logger['error'](_0x5b021b[_0xd479('0x23')]);if(_0x5b021b['name']){delete _0x5b021b[_0xd479('0x24')];}_0x496f3f[_0xd479('0x15')](_0x570f7a)[_0xd479('0x25')](_0x5b021b);};}exports[_0xd479('0x26')]=function(_0x3d38ff,_0x33d52d){var _0x5efb7a={},_0x5024f8={},_0x2494f4={'count':0x0,'rows':[]};var _0x3abb29=_[_0xd479('0x27')](db[_0xd479('0x28')]['rawAttributes'],function(_0x1d2d9b){return{'name':_0x1d2d9b['fieldName'],'type':_0x1d2d9b[_0xd479('0x29')][_0xd479('0x2a')]};});_0x5024f8[_0xd479('0x2b')]=_['map'](_0x3abb29,'name');_0x5024f8[_0xd479('0x2c')]=_[_0xd479('0x2d')](_0x3d38ff[_0xd479('0x2c')]);_0x5024f8[_0xd479('0x2e')]=_[_0xd479('0x2f')](_0x5024f8[_0xd479('0x2b')],_0x5024f8['query']);_0x5efb7a[_0xd479('0x30')]=_[_0xd479('0x2f')](_0x5024f8['model'],qs['fields'](_0x3d38ff['query'][_0xd479('0x31')]));_0x5efb7a[_0xd479('0x30')]=_0x5efb7a[_0xd479('0x30')][_0xd479('0x32')]?_0x5efb7a[_0xd479('0x30')]:_0x5024f8[_0xd479('0x2b')];if(!_0x3d38ff[_0xd479('0x2c')][_0xd479('0x33')]('nolimit')){_0x5efb7a[_0xd479('0x19')]=qs[_0xd479('0x19')](_0x3d38ff[_0xd479('0x2c')]['limit']);_0x5efb7a[_0xd479('0x18')]=qs[_0xd479('0x18')](_0x3d38ff[_0xd479('0x2c')][_0xd479('0x18')]);}_0x5efb7a[_0xd479('0x34')]=qs[_0xd479('0x35')](_0x3d38ff['query'][_0xd479('0x35')]);_0x5efb7a['where']=qs[_0xd479('0x2e')](_[_0xd479('0x36')](_0x3d38ff['query'],_0x5024f8[_0xd479('0x2e')]),_0x3abb29);if(_0x3d38ff[_0xd479('0x2c')][_0xd479('0x37')]){_0x5efb7a[_0xd479('0x38')]=_[_0xd479('0x39')](_0x5efb7a[_0xd479('0x38')],{'$or':_[_0xd479('0x27')](_0x3abb29,function(_0x48cf8e){if(_0x48cf8e[_0xd479('0x29')]!=='VIRTUAL'){var _0x525941={};_0x525941[_0x48cf8e[_0xd479('0x24')]]={'$like':'%'+_0x3d38ff['query'][_0xd479('0x37')]+'%'};return _0x525941;}})});}_0x5efb7a=_[_0xd479('0x39')]({},_0x5efb7a,_0x3d38ff[_0xd479('0x3a')]);var _0x5d19a6={'where':_0x5efb7a['where']};return db[_0xd479('0x28')][_0xd479('0x1b')](_0x5d19a6)[_0xd479('0x21')](function(_0x54eeec){_0x2494f4[_0xd479('0x1b')]=_0x54eeec;if(_0x3d38ff[_0xd479('0x2c')][_0xd479('0x3b')]){_0x5efb7a['include']=[{'all':!![]}];}return db['ServicenowField'][_0xd479('0x3c')](_0x5efb7a);})['then'](function(_0x2967ed){_0x2494f4[_0xd479('0x3d')]=_0x2967ed;return _0x2494f4;})[_0xd479('0x21')](respondWithFilteredResult(_0x33d52d,_0x5efb7a))[_0xd479('0x3e')](handleError(_0x33d52d,null));};exports[_0xd479('0x3f')]=function(_0x4a6871,_0x3ba948){var _0x2443d9={'raw':!![],'where':{'id':_0x4a6871['params']['id']}},_0x1f9fce={};_0x1f9fce['model']=_[_0xd479('0x2d')](db[_0xd479('0x28')][_0xd479('0x40')]);_0x1f9fce['query']=_[_0xd479('0x2d')](_0x4a6871[_0xd479('0x2c')]);_0x1f9fce['filters']=_[_0xd479('0x2f')](_0x1f9fce[_0xd479('0x2b')],_0x1f9fce[_0xd479('0x2c')]);_0x2443d9[_0xd479('0x30')]=_[_0xd479('0x2f')](_0x1f9fce[_0xd479('0x2b')],qs[_0xd479('0x31')](_0x4a6871[_0xd479('0x2c')][_0xd479('0x31')]));_0x2443d9['attributes']=_0x2443d9[_0xd479('0x30')][_0xd479('0x32')]?_0x2443d9[_0xd479('0x30')]:_0x1f9fce['model'];if(_0x4a6871[_0xd479('0x2c')][_0xd479('0x3b')]){_0x2443d9[_0xd479('0x41')]=[{'all':!![]}];}_0x2443d9=_[_0xd479('0x39')]({},_0x2443d9,_0x4a6871[_0xd479('0x3a')]);return db[_0xd479('0x28')]['find'](_0x2443d9)['then'](handleEntityNotFound(_0x3ba948,null))[_0xd479('0x21')](respondWithResult(_0x3ba948,null))['catch'](handleError(_0x3ba948,null));};exports[_0xd479('0x42')]=function(_0x4f28fa,_0x1b8aff){return db['ServicenowField'][_0xd479('0x42')](_0x4f28fa['body'],{})[_0xd479('0x21')](respondWithResult(_0x1b8aff,0xc9))[_0xd479('0x3e')](handleError(_0x1b8aff,null));};exports['update']=function(_0x410471,_0x447b39){if(_0x410471[_0xd479('0x43')]['id']){delete _0x410471[_0xd479('0x43')]['id'];}return db[_0xd479('0x28')]['find']({'where':{'id':_0x410471[_0xd479('0x44')]['id']}})[_0xd479('0x21')](handleEntityNotFound(_0x447b39,null))[_0xd479('0x21')](saveUpdates(_0x410471[_0xd479('0x43')],null))[_0xd479('0x21')](respondWithResult(_0x447b39,null))[_0xd479('0x3e')](handleError(_0x447b39,null));};exports['destroy']=function(_0x5d3894,_0x5a6af9){return db['ServicenowField'][_0xd479('0x45')]({'where':{'id':_0x5d3894[_0xd479('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a6af9,null))[_0xd479('0x21')](removeEntity(_0x5a6af9,null))[_0xd479('0x3e')](handleError(_0x5a6af9,null));}; \ No newline at end of file +var _0x6986=['util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','ServicenowField','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','rows','catch','show','includeAll','options','create','body','params','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x5bd993,_0x2f77ee){var _0x4eae10=function(_0xfa3f79){while(--_0xfa3f79){_0x5bd993['push'](_0x5bd993['shift']());}};_0x4eae10(++_0x2f77ee);}(_0x6986,0x11d));var _0x6698=function(_0x39872b,_0x343e6b){_0x39872b=_0x39872b-0x0;var _0x55fa18=_0x6986[_0x39872b];return _0x55fa18;};'use strict';var emlformat=require(_0x6698('0x0'));var rimraf=require(_0x6698('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6698('0x2'));var rp=require(_0x6698('0x3'));var moment=require(_0x6698('0x4'));var BPromise=require(_0x6698('0x5'));var Mustache=require(_0x6698('0x6'));var util=require(_0x6698('0x7'));var path=require(_0x6698('0x8'));var sox=require(_0x6698('0x9'));var csv=require(_0x6698('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6698('0xb'));var _=require('lodash');var squel=require(_0x6698('0xc'));var crypto=require(_0x6698('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6698('0xe'));var toCsv=require(_0x6698('0xa'));var querystring=require(_0x6698('0xf'));var Papa=require(_0x6698('0x10'));var Redis=require('ioredis');var authService=require(_0x6698('0x11'));var qs=require(_0x6698('0x12'));var as=require(_0x6698('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6698('0x14'))(_0x6698('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6698('0x16'))['db'];function respondWithStatusCode(_0x24c26d,_0x5c3f62){_0x5c3f62=_0x5c3f62||0xcc;return function(_0x19299c){if(_0x19299c){return _0x24c26d['sendStatus'](_0x5c3f62);}return _0x24c26d[_0x6698('0x17')](_0x5c3f62)[_0x6698('0x18')]();};}function respondWithResult(_0x1859ec,_0x16be8e){_0x16be8e=_0x16be8e||0xc8;return function(_0x2e6982){if(_0x2e6982){return _0x1859ec['status'](_0x16be8e)[_0x6698('0x19')](_0x2e6982);}};}function respondWithFilteredResult(_0x4d6623,_0x1595a5){return function(_0x3bf761){if(_0x3bf761){var _0x327ea5=typeof _0x1595a5[_0x6698('0x1a')]===_0x6698('0x1b')&&typeof _0x1595a5['limit']===_0x6698('0x1b');var _0x28eefd=_0x3bf761[_0x6698('0x1c')];var _0xfd3ddc=_0x327ea5?0x0:_0x1595a5[_0x6698('0x1a')];var _0x29206c=_0x327ea5?_0x3bf761[_0x6698('0x1c')]:_0x1595a5[_0x6698('0x1a')]+_0x1595a5[_0x6698('0x1d')];var _0x1e2af7;if(_0x29206c>=_0x28eefd){_0x29206c=_0x28eefd;_0x1e2af7=0xc8;}else{_0x1e2af7=0xce;}_0x4d6623[_0x6698('0x17')](_0x1e2af7);return _0x4d6623[_0x6698('0x1e')](_0x6698('0x1f'),_0xfd3ddc+'-'+_0x29206c+'/'+_0x28eefd)['json'](_0x3bf761);}return null;};}function patchUpdates(_0x23d190){return function(_0x35cac2){try{jsonpatch[_0x6698('0x20')](_0x35cac2,_0x23d190,!![]);}catch(_0x2d5126){return BPromise[_0x6698('0x21')](_0x2d5126);}return _0x35cac2[_0x6698('0x22')]();};}function saveUpdates(_0x4ece18,_0x30eb6b){return function(_0x6582d7){if(_0x6582d7){return _0x6582d7[_0x6698('0x23')](_0x4ece18)[_0x6698('0x24')](function(_0x505743){return _0x505743;});}return null;};}function removeEntity(_0x22f055,_0x72b46f){return function(_0x2b8a44){if(_0x2b8a44){return _0x2b8a44[_0x6698('0x25')]()[_0x6698('0x24')](function(){_0x22f055['status'](0xcc)[_0x6698('0x18')]();});}};}function handleEntityNotFound(_0x58936a,_0x8ededc){return function(_0x5b546f){if(!_0x5b546f){_0x58936a[_0x6698('0x26')](0x194);}return _0x5b546f;};}function handleError(_0x4b9be3,_0x4fb48b){_0x4fb48b=_0x4fb48b||0x1f4;return function(_0x1e040d){logger[_0x6698('0x27')](_0x1e040d['stack']);if(_0x1e040d[_0x6698('0x28')]){delete _0x1e040d['name'];}_0x4b9be3[_0x6698('0x17')](_0x4fb48b)[_0x6698('0x29')](_0x1e040d);};}exports['index']=function(_0x3ca443,_0x25dd86){var _0x9fed95={},_0x4be08f={},_0x32e783={'count':0x0,'rows':[]};var _0x5446f7=_['map'](db[_0x6698('0x2a')][_0x6698('0x2b')],function(_0x22c4b9){return{'name':_0x22c4b9[_0x6698('0x2c')],'type':_0x22c4b9['type'][_0x6698('0x2d')]};});_0x4be08f[_0x6698('0x2e')]=_[_0x6698('0x2f')](_0x5446f7,_0x6698('0x28'));_0x4be08f['query']=_[_0x6698('0x30')](_0x3ca443[_0x6698('0x31')]);_0x4be08f[_0x6698('0x32')]=_[_0x6698('0x33')](_0x4be08f['model'],_0x4be08f[_0x6698('0x31')]);_0x9fed95[_0x6698('0x34')]=_[_0x6698('0x33')](_0x4be08f[_0x6698('0x2e')],qs[_0x6698('0x35')](_0x3ca443[_0x6698('0x31')]['fields']));_0x9fed95[_0x6698('0x34')]=_0x9fed95[_0x6698('0x34')][_0x6698('0x36')]?_0x9fed95[_0x6698('0x34')]:_0x4be08f[_0x6698('0x2e')];if(!_0x3ca443[_0x6698('0x31')]['hasOwnProperty'](_0x6698('0x37'))){_0x9fed95[_0x6698('0x1d')]=qs[_0x6698('0x1d')](_0x3ca443[_0x6698('0x31')][_0x6698('0x1d')]);_0x9fed95[_0x6698('0x1a')]=qs['offset'](_0x3ca443[_0x6698('0x31')][_0x6698('0x1a')]);}_0x9fed95[_0x6698('0x38')]=qs[_0x6698('0x39')](_0x3ca443[_0x6698('0x31')][_0x6698('0x39')]);_0x9fed95['where']=qs[_0x6698('0x32')](_[_0x6698('0x3a')](_0x3ca443[_0x6698('0x31')],_0x4be08f[_0x6698('0x32')]),_0x5446f7);if(_0x3ca443[_0x6698('0x31')][_0x6698('0x3b')]){_0x9fed95[_0x6698('0x3c')]=_[_0x6698('0x3d')](_0x9fed95['where'],{'$or':_['map'](_0x5446f7,function(_0x21ba01){if(_0x21ba01['type']!==_0x6698('0x3e')){var _0x1f4484={};_0x1f4484[_0x21ba01[_0x6698('0x28')]]={'$like':'%'+_0x3ca443[_0x6698('0x31')]['filter']+'%'};return _0x1f4484;}})});}_0x9fed95=_[_0x6698('0x3d')]({},_0x9fed95,_0x3ca443['options']);var _0x5229d5={'where':_0x9fed95[_0x6698('0x3c')]};return db[_0x6698('0x2a')][_0x6698('0x1c')](_0x5229d5)[_0x6698('0x24')](function(_0x3f1589){_0x32e783[_0x6698('0x1c')]=_0x3f1589;if(_0x3ca443[_0x6698('0x31')]['includeAll']){_0x9fed95[_0x6698('0x3f')]=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x9fed95);})[_0x6698('0x24')](function(_0x47446f){_0x32e783[_0x6698('0x40')]=_0x47446f;return _0x32e783;})['then'](respondWithFilteredResult(_0x25dd86,_0x9fed95))[_0x6698('0x41')](handleError(_0x25dd86,null));};exports[_0x6698('0x42')]=function(_0x1457b2,_0x1825b5){var _0x340958={'raw':!![],'where':{'id':_0x1457b2['params']['id']}},_0x7c0cf8={};_0x7c0cf8['model']=_[_0x6698('0x30')](db[_0x6698('0x2a')][_0x6698('0x2b')]);_0x7c0cf8[_0x6698('0x31')]=_[_0x6698('0x30')](_0x1457b2[_0x6698('0x31')]);_0x7c0cf8[_0x6698('0x32')]=_[_0x6698('0x33')](_0x7c0cf8['model'],_0x7c0cf8[_0x6698('0x31')]);_0x340958['attributes']=_['intersection'](_0x7c0cf8[_0x6698('0x2e')],qs[_0x6698('0x35')](_0x1457b2[_0x6698('0x31')][_0x6698('0x35')]));_0x340958['attributes']=_0x340958[_0x6698('0x34')][_0x6698('0x36')]?_0x340958['attributes']:_0x7c0cf8[_0x6698('0x2e')];if(_0x1457b2[_0x6698('0x31')][_0x6698('0x43')]){_0x340958[_0x6698('0x3f')]=[{'all':!![]}];}_0x340958=_[_0x6698('0x3d')]({},_0x340958,_0x1457b2[_0x6698('0x44')]);return db[_0x6698('0x2a')]['find'](_0x340958)[_0x6698('0x24')](handleEntityNotFound(_0x1825b5,null))[_0x6698('0x24')](respondWithResult(_0x1825b5,null))[_0x6698('0x41')](handleError(_0x1825b5,null));};exports[_0x6698('0x45')]=function(_0x38b0a2,_0x103330){return db[_0x6698('0x2a')][_0x6698('0x45')](_0x38b0a2['body'],{})[_0x6698('0x24')](respondWithResult(_0x103330,0xc9))[_0x6698('0x41')](handleError(_0x103330,null));};exports[_0x6698('0x23')]=function(_0x2858e8,_0x43e98c){if(_0x2858e8['body']['id']){delete _0x2858e8[_0x6698('0x46')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x2858e8[_0x6698('0x47')]['id']}})[_0x6698('0x24')](handleEntityNotFound(_0x43e98c,null))[_0x6698('0x24')](saveUpdates(_0x2858e8[_0x6698('0x46')],null))[_0x6698('0x24')](respondWithResult(_0x43e98c,null))['catch'](handleError(_0x43e98c,null));};exports['destroy']=function(_0x35f645,_0x5b35a0){return db['ServicenowField'][_0x6698('0x48')]({'where':{'id':_0x35f645[_0x6698('0x47')]['id']}})[_0x6698('0x24')](handleEntityNotFound(_0x5b35a0,null))[_0x6698('0x24')](removeEntity(_0x5b35a0,null))['catch'](handleError(_0x5b35a0,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 3d30f38..94c7247 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 _0x6134=['rimraf','./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index','idField','FieldId','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1af5b7,_0x54c88b){var _0x110a4c=function(_0x74e3f1){while(--_0x74e3f1){_0x1af5b7['push'](_0x1af5b7['shift']());}};_0x110a4c(++_0x54c88b);}(_0x6134,0xa2));var _0x4613=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x6134[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x4613('0x0'));var util=require('util');var logger=require(_0x4613('0x1'))(_0x4613('0x2'));var moment=require('moment');var BPromise=require(_0x4613('0x3'));var rp=require(_0x4613('0x4'));var fs=require('fs');var path=require(_0x4613('0x5'));var rimraf=require(_0x4613('0x6'));var config=require('../../config/environment');var attributes=require(_0x4613('0x7'));module[_0x4613('0x8')]=function(_0x6e78f9,_0x5fec86){return _0x6e78f9[_0x4613('0x9')](_0x4613('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x4613('0xb'),'fields':[_0x4613('0xc'),_0x4613('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8dca=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index'];(function(_0x389437,_0x30521e){var _0x144900=function(_0x40e793){while(--_0x40e793){_0x389437['push'](_0x389437['shift']());}};_0x144900(++_0x30521e);}(_0x8dca,0x16a));var _0xa8dc=function(_0x41d160,_0x45a515){_0x41d160=_0x41d160-0x0;var _0x12c4c1=_0x8dca[_0x41d160];return _0x12c4c1;};'use strict';var _=require(_0xa8dc('0x0'));var util=require(_0xa8dc('0x1'));var logger=require(_0xa8dc('0x2'))(_0xa8dc('0x3'));var moment=require(_0xa8dc('0x4'));var BPromise=require(_0xa8dc('0x5'));var rp=require(_0xa8dc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8dc('0x7'));var config=require(_0xa8dc('0x8'));var attributes=require('./intServicenowField.attributes');module[_0xa8dc('0x9')]=function(_0x44066d,_0x26c692){return _0x44066d['define'](_0xa8dc('0xa'),attributes,{'tableName':_0xa8dc('0xb'),'paranoid':![],'indexes':[{'name':_0xa8dc('0xc'),'fields':[_0xa8dc('0xd'),_0xa8dc('0xe')],'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 a7719b2..fb7e2be 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 _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5a66b7,_0x517636){var _0x5f56e3=function(_0x1c602d){while(--_0x1c602d){_0x5a66b7['push'](_0x5a66b7['shift']());}};_0x5f56e3(++_0x517636);}(_0xf4eb,0xec));var _0xbf4e=function(_0x13c1fe,_0xbc8c31){_0x13c1fe=_0x13c1fe-0x0;var _0x3e061e=_0xf4eb[_0x13c1fe];return _0x3e061e;};'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')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xbaf0=['client','http','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 4cb8bcd..489c51c 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x7b3666,_0x1ebe34){var _0x4a3bea=function(_0x2dd69f){while(--_0x2dd69f){_0x7b3666['push'](_0x7b3666['shift']());}};_0x4a3bea(++_0x1ebe34);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5528fb,_0x594963){var _0x422ac9=function(_0x109ab8){while(--_0x109ab8){_0x5528fb['push'](_0x5528fb['shift']());}};_0x422ac9(++_0x594963);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index d92d9c4..6da06bf 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(_0x33b9ac,_0x479eb7){var _0x2f7d01=function(_0x9b5e0){while(--_0x9b5e0){_0x33b9ac['push'](_0x33b9ac['shift']());}};_0x2f7d01(++_0x479eb7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x3d29d5,_0x200c53){var _0x5758f2=function(_0x195869){while(--_0x195869){_0x3d29d5['push'](_0x3d29d5['shift']());}};_0x5758f2(++_0x200c53);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 15a655d..4694501 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 _0x0628=['moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','sendStatus','error','stack','name','index','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','filters','filter','where','merge','map','VIRTUAL','includeAll','include','SugarcrmAccount','findAll','then','rows','catch','show','params','find','create','body','destroy','getConfigurations','findOne','rawAttributes','sort','pick','options','hasOwnProperty','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','created_by','description','duration_hours','duration_minutes','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','Invalid\x20Login','Password\x20Expired','values','module_fields','remove','includes','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','send','eml-format','rimraf','zip-dir','request-promise'];(function(_0x14471e,_0x2d0df5){var _0x472f40=function(_0x2c5e6d){while(--_0x2c5e6d){_0x14471e['push'](_0x14471e['shift']());}};_0x472f40(++_0x2d0df5);}(_0x0628,0x173));var _0x8062=function(_0x27dcc1,_0x1d3a8f){_0x27dcc1=_0x27dcc1-0x0;var _0x16bbdb=_0x0628[_0x27dcc1];return _0x16bbdb;};'use strict';var emlformat=require(_0x8062('0x0'));var rimraf=require(_0x8062('0x1'));var zipdir=require(_0x8062('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8062('0x3'));var moment=require(_0x8062('0x4'));var BPromise=require(_0x8062('0x5'));var Mustache=require(_0x8062('0x6'));var util=require(_0x8062('0x7'));var path=require(_0x8062('0x8'));var sox=require(_0x8062('0x9'));var csv=require(_0x8062('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8062('0xb'));var _=require(_0x8062('0xc'));var squel=require(_0x8062('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8062('0xe'));var toCsv=require(_0x8062('0xa'));var querystring=require(_0x8062('0xf'));var Papa=require(_0x8062('0x10'));var Redis=require(_0x8062('0x11'));var authService=require(_0x8062('0x12'));var qs=require(_0x8062('0x13'));var as=require(_0x8062('0x14'));var hardwareService=require(_0x8062('0x15'));var logger=require(_0x8062('0x16'))(_0x8062('0x17'));var utils=require(_0x8062('0x18'));var config=require(_0x8062('0x19'));var licenseUtil=require(_0x8062('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8062('0x1b'));function respondWithStatusCode(_0x45d2ed,_0x119cf7){_0x119cf7=_0x119cf7||0xcc;return function(_0x2d9301){if(_0x2d9301){return _0x45d2ed['sendStatus'](_0x119cf7);}return _0x45d2ed[_0x8062('0x1c')](_0x119cf7)[_0x8062('0x1d')]();};}function respondWithResult(_0x3d851b,_0x17e7e7){_0x17e7e7=_0x17e7e7||0xc8;return function(_0x5149cd){if(_0x5149cd){return _0x3d851b['status'](_0x17e7e7)[_0x8062('0x1e')](_0x5149cd);}};}function respondWithFilteredResult(_0xecdf8,_0x587129){return function(_0x8ff8d2){if(_0x8ff8d2){var _0x85307d=typeof _0x587129['offset']==='undefined'&&typeof _0x587129['limit']==='undefined';var _0x149c49=_0x8ff8d2[_0x8062('0x1f')];var _0x412998=_0x85307d?0x0:_0x587129[_0x8062('0x20')];var _0x120f92=_0x85307d?_0x8ff8d2[_0x8062('0x1f')]:_0x587129[_0x8062('0x20')]+_0x587129[_0x8062('0x21')];var _0xf1bd1b;if(_0x120f92>=_0x149c49){_0x120f92=_0x149c49;_0xf1bd1b=0xc8;}else{_0xf1bd1b=0xce;}_0xecdf8[_0x8062('0x1c')](_0xf1bd1b);return _0xecdf8[_0x8062('0x22')](_0x8062('0x23'),_0x412998+'-'+_0x120f92+'/'+_0x149c49)[_0x8062('0x1e')](_0x8ff8d2);}return null;};}function patchUpdates(_0x7b301c){return function(_0x509460){try{jsonpatch[_0x8062('0x24')](_0x509460,_0x7b301c,!![]);}catch(_0x8b0b9f){return BPromise[_0x8062('0x25')](_0x8b0b9f);}return _0x509460[_0x8062('0x26')]();};}function saveUpdates(_0x7a355c,_0x476618){return function(_0x15680c){if(_0x15680c){return _0x15680c['update'](_0x7a355c)['then'](function(_0xc78367){return _0xc78367;});}return null;};}function removeEntity(_0x119a3d,_0x3455ac){return function(_0x26e7b0){if(_0x26e7b0){return _0x26e7b0['destroy']()['then'](function(){_0x119a3d[_0x8062('0x1c')](0xcc)[_0x8062('0x1d')]();});}};}function handleEntityNotFound(_0x849a2b,_0x2c6740){return function(_0x4cfac3){if(!_0x4cfac3){_0x849a2b[_0x8062('0x27')](0x194);}return _0x4cfac3;};}function handleError(_0x1ee095,_0x1f78e5){_0x1f78e5=_0x1f78e5||0x1f4;return function(_0x26fa62){logger[_0x8062('0x28')](_0x26fa62[_0x8062('0x29')]);if(_0x26fa62[_0x8062('0x2a')]){delete _0x26fa62[_0x8062('0x2a')];}_0x1ee095[_0x8062('0x1c')](_0x1f78e5)['send'](_0x26fa62);};}exports[_0x8062('0x2b')]=function(_0x556a2c,_0x405320){var _0xaa47a={},_0x2f69f4={},_0x845272={'count':0x0,'rows':[]};var _0x44f742=_['map'](db['SugarcrmAccount']['rawAttributes'],function(_0x377cf7){return{'name':_0x377cf7[_0x8062('0x2c')],'type':_0x377cf7[_0x8062('0x2d')][_0x8062('0x2e')]};});_0x2f69f4[_0x8062('0x2f')]=_['map'](_0x44f742,_0x8062('0x2a'));_0x2f69f4[_0x8062('0x30')]=_[_0x8062('0x31')](_0x556a2c[_0x8062('0x30')]);_0x2f69f4['filters']=_[_0x8062('0x32')](_0x2f69f4[_0x8062('0x2f')],_0x2f69f4[_0x8062('0x30')]);_0xaa47a[_0x8062('0x33')]=_['intersection'](_0x2f69f4[_0x8062('0x2f')],qs[_0x8062('0x34')](_0x556a2c[_0x8062('0x30')][_0x8062('0x34')]));_0xaa47a['attributes']=_0xaa47a[_0x8062('0x33')][_0x8062('0x35')]?_0xaa47a[_0x8062('0x33')]:_0x2f69f4[_0x8062('0x2f')];if(!_0x556a2c['query']['hasOwnProperty'](_0x8062('0x36'))){_0xaa47a[_0x8062('0x21')]=qs[_0x8062('0x21')](_0x556a2c[_0x8062('0x30')]['limit']);_0xaa47a[_0x8062('0x20')]=qs[_0x8062('0x20')](_0x556a2c[_0x8062('0x30')][_0x8062('0x20')]);}_0xaa47a['order']=qs['sort'](_0x556a2c[_0x8062('0x30')]['sort']);_0xaa47a['where']=qs[_0x8062('0x37')](_['pick'](_0x556a2c[_0x8062('0x30')],_0x2f69f4['filters']),_0x44f742);if(_0x556a2c[_0x8062('0x30')][_0x8062('0x38')]){_0xaa47a[_0x8062('0x39')]=_[_0x8062('0x3a')](_0xaa47a[_0x8062('0x39')],{'$or':_[_0x8062('0x3b')](_0x44f742,function(_0x5d7d4f){if(_0x5d7d4f[_0x8062('0x2d')]!==_0x8062('0x3c')){var _0x362dec={};_0x362dec[_0x5d7d4f['name']]={'$like':'%'+_0x556a2c[_0x8062('0x30')][_0x8062('0x38')]+'%'};return _0x362dec;}})});}_0xaa47a=_[_0x8062('0x3a')]({},_0xaa47a,_0x556a2c['options']);var _0x26aba0={'where':_0xaa47a[_0x8062('0x39')]};return db['SugarcrmAccount']['count'](_0x26aba0)['then'](function(_0x50c811){_0x845272[_0x8062('0x1f')]=_0x50c811;if(_0x556a2c[_0x8062('0x30')][_0x8062('0x3d')]){_0xaa47a[_0x8062('0x3e')]=[{'all':!![]}];}return db[_0x8062('0x3f')][_0x8062('0x40')](_0xaa47a);})[_0x8062('0x41')](function(_0x115df9){_0x845272[_0x8062('0x42')]=_0x115df9;return _0x845272;})['then'](respondWithFilteredResult(_0x405320,_0xaa47a))[_0x8062('0x43')](handleError(_0x405320,null));};exports[_0x8062('0x44')]=function(_0x1343d8,_0x5fe56b){var _0x16ee18={'raw':![],'where':{'id':_0x1343d8[_0x8062('0x45')]['id']}},_0x17fea5={};_0x17fea5['model']=_[_0x8062('0x31')](db[_0x8062('0x3f')]['rawAttributes']);_0x17fea5[_0x8062('0x30')]=_['keys'](_0x1343d8[_0x8062('0x30')]);_0x17fea5[_0x8062('0x37')]=_['intersection'](_0x17fea5[_0x8062('0x2f')],_0x17fea5[_0x8062('0x30')]);_0x16ee18[_0x8062('0x33')]=_[_0x8062('0x32')](_0x17fea5[_0x8062('0x2f')],qs[_0x8062('0x34')](_0x1343d8[_0x8062('0x30')][_0x8062('0x34')]));_0x16ee18[_0x8062('0x33')]=_0x16ee18[_0x8062('0x33')][_0x8062('0x35')]?_0x16ee18[_0x8062('0x33')]:_0x17fea5['model'];if(_0x1343d8[_0x8062('0x30')]['includeAll']){_0x16ee18['include']=[{'all':!![]}];}_0x16ee18=_[_0x8062('0x3a')]({},_0x16ee18,_0x1343d8['options']);return db[_0x8062('0x3f')][_0x8062('0x46')](_0x16ee18)[_0x8062('0x41')](handleEntityNotFound(_0x5fe56b,null))[_0x8062('0x41')](respondWithResult(_0x5fe56b,null))['catch'](handleError(_0x5fe56b,null));};exports[_0x8062('0x47')]=function(_0x565cdb,_0x382d59){return db[_0x8062('0x3f')][_0x8062('0x47')](_0x565cdb[_0x8062('0x48')],{})['then'](respondWithResult(_0x382d59,0xc9))[_0x8062('0x43')](handleError(_0x382d59,null));};exports['update']=function(_0x40a8aa,_0x156a85){if(_0x40a8aa[_0x8062('0x48')]['id']){delete _0x40a8aa[_0x8062('0x48')]['id'];}return db['SugarcrmAccount'][_0x8062('0x46')]({'where':{'id':_0x40a8aa[_0x8062('0x45')]['id']}})[_0x8062('0x41')](handleEntityNotFound(_0x156a85,null))[_0x8062('0x41')](saveUpdates(_0x40a8aa[_0x8062('0x48')],null))[_0x8062('0x41')](respondWithResult(_0x156a85,null))[_0x8062('0x43')](handleError(_0x156a85,null));};exports[_0x8062('0x49')]=function(_0x191793,_0x480da6){return db['SugarcrmAccount'][_0x8062('0x46')]({'where':{'id':_0x191793[_0x8062('0x45')]['id']}})[_0x8062('0x41')](handleEntityNotFound(_0x480da6,null))[_0x8062('0x41')](removeEntity(_0x480da6,null))[_0x8062('0x43')](handleError(_0x480da6,null));};exports[_0x8062('0x4a')]=function(_0xbeafb8,_0x259e40,_0x2a4373){var _0x430bbd={};var _0x14be30={};var _0x4c2dc2;var _0x179c92;return db[_0x8062('0x3f')][_0x8062('0x4b')]({'where':{'id':_0xbeafb8['params']['id']}})[_0x8062('0x41')](handleEntityNotFound(_0x259e40,null))[_0x8062('0x41')](function(_0x579e9d){if(_0x579e9d){_0x4c2dc2=_0x579e9d;_0x14be30[_0x8062('0x2f')]=_[_0x8062('0x31')](db['SugarcrmConfiguration'][_0x8062('0x4c')]);_0x14be30[_0x8062('0x30')]=_['keys'](_0xbeafb8['query']);_0x14be30['filters']=_[_0x8062('0x32')](_0x14be30[_0x8062('0x2f')],_0x14be30[_0x8062('0x30')]);_0x430bbd[_0x8062('0x33')]=_[_0x8062('0x32')](_0x14be30[_0x8062('0x2f')],qs['fields'](_0xbeafb8['query'][_0x8062('0x34')]));_0x430bbd[_0x8062('0x33')]=_0x430bbd['attributes'][_0x8062('0x35')]?_0x430bbd['attributes']:_0x14be30[_0x8062('0x2f')];_0x430bbd['order']=qs[_0x8062('0x4d')](_0xbeafb8['query'][_0x8062('0x4d')]);_0x430bbd[_0x8062('0x39')]=qs[_0x8062('0x37')](_[_0x8062('0x4e')](_0xbeafb8['query'],_0x14be30[_0x8062('0x37')]));if(_0xbeafb8[_0x8062('0x30')]['filter']){_0x430bbd['where']=_[_0x8062('0x3a')](_0x430bbd['where'],{'$or':_['map'](_0x430bbd[_0x8062('0x33')],function(_0x4dfc77){var _0x35172e={};_0x35172e[_0x4dfc77]={'$like':'%'+_0xbeafb8[_0x8062('0x30')][_0x8062('0x38')]+'%'};return _0x35172e;})});}_0x430bbd=_['merge']({},_0x430bbd,_0xbeafb8[_0x8062('0x4f')]);return _0x4c2dc2[_0x8062('0x4a')](_0x430bbd);}})[_0x8062('0x41')](function(_0x363f19){if(_0x363f19){_0x179c92=_0x363f19[_0x8062('0x35')];if(!_0xbeafb8['query'][_0x8062('0x50')](_0x8062('0x36'))){_0x430bbd[_0x8062('0x21')]=qs['limit'](_0xbeafb8[_0x8062('0x30')][_0x8062('0x21')]);_0x430bbd[_0x8062('0x20')]=qs['offset'](_0xbeafb8['query'][_0x8062('0x20')]);}return _0x4c2dc2['getConfigurations'](_0x430bbd);}})['then'](function(_0x93367e){if(_0x93367e){return _0x93367e?{'count':_0x179c92,'rows':_0x93367e}:null;}})[_0x8062('0x41')](respondWithResult(_0x259e40,null))[_0x8062('0x43')](handleError(_0x259e40,null));};exports[_0x8062('0x51')]=function(_0x1f8560,_0x5752aa,_0x510b27){if(_0x1f8560[_0x8062('0x48')]['id']){delete _0x1f8560[_0x8062('0x48')]['id'];}return db[_0x8062('0x3f')][_0x8062('0x4b')]({'where':{'id':_0x1f8560[_0x8062('0x45')]['id']}})['then'](handleEntityNotFound(_0x5752aa,null))['then'](function(_0x548d14){if(_0x548d14){_0x1f8560[_0x8062('0x48')]['AccountId']=_0x548d14['id'];_0x1f8560['body'][_0x8062('0x52')]=integrations[_0x8062('0x53')](_0x1f8560['body']['channel'],_0x1f8560[_0x8062('0x48')]['type']);_0x1f8560[_0x8062('0x48')][_0x8062('0x54')]=integrations[_0x8062('0x55')](_0x1f8560['body'][_0x8062('0x56')],_0x1f8560[_0x8062('0x48')][_0x8062('0x2d')]);return db[_0x8062('0x57')][_0x8062('0x47')](_0x1f8560['body'],{'include':[{'model':db[_0x8062('0x58')],'as':'Subjects'},{'model':db[_0x8062('0x58')],'as':_0x8062('0x54')}]});}return null;})[_0x8062('0x41')](respondWithResult(_0x5752aa,null))[_0x8062('0x43')](handleError(_0x5752aa,null));};exports[_0x8062('0x59')]=function(_0x4a8243,_0x284db5,_0x9a30a3){var _0x27ca55='';var _0x4f6936=['id',_0x8062('0x2a'),_0x8062('0x5a'),_0x8062('0x5b'),_0x8062('0x5c'),'date_start',_0x8062('0x5d'),_0x8062('0x5e'),_0x8062('0x5f'),'parent_type',_0x8062('0x60'),_0x8062('0x61')];return db['SugarcrmAccount'][_0x8062('0x4b')]({'where':{'id':_0x4a8243[_0x8062('0x45')]['id']},'attributes':['id',_0x8062('0x62'),_0x8062('0x63'),_0x8062('0x64')]})[_0x8062('0x41')](handleEntityNotFound(_0x284db5,null))[_0x8062('0x41')](function(_0x2c5dbf){if(_0x2c5dbf){_0x27ca55=_0x2c5dbf[_0x8062('0x64')];var _0x4be4c2=_0x27ca55[_0x8062('0x65')](-0x1);if(_0x4be4c2==='/'){_0x27ca55=_0x27ca55[_0x8062('0x66')](0x0,_0x27ca55[_0x8062('0x67')](_0x4be4c2));}return rp({'method':_0x8062('0x68'),'uri':util[_0x8062('0x69')](_0x8062('0x6a'),_0x27ca55,_0x8062('0x6b')),'json':!![],'form':{'method':_0x8062('0x6c'),'input_type':_0x8062('0x6d'),'response_type':_0x8062('0x6d'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2c5dbf[_0x8062('0x62')],'password':_0x2c5dbf[_0x8062('0x63')],'encryption':_0x8062('0x6e')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x8062('0x41')](function(_0x41203f){if(_0x41203f&&_0x41203f[_0x8062('0x2a')]!==_0x8062('0x6f')&&_0x41203f['name']!==_0x8062('0x70')){return rp({'method':_0x8062('0x68'),'uri':util[_0x8062('0x69')](_0x8062('0x6a'),_0x27ca55,_0x8062('0x6b')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x8062('0x6d'),'response_type':_0x8062('0x6d'),'rest_data':JSON['stringify']({'session':_0x41203f['id'],'module_name':'Calls'})}})[_0x8062('0x41')](function(_0x342757){if(_0x342757){var _0x3da130=_[_0x8062('0x71')](_0x342757[_0x8062('0x72')]);_[_0x8062('0x73')](_0x3da130,function(_0x3b3c2e){return _0x4f6936[_0x8062('0x74')](_0x3b3c2e['name']);});return{'count':_0x3da130[_0x8062('0x35')],'rows':_[_0x8062('0x3b')](_0x3da130,function(_0x2c2e8f){return{'id':_0x2c2e8f['name'],'name':_0x2c2e8f[_0x8062('0x75')],'custom':_['endsWith'](_0x2c2e8f[_0x8062('0x2a')],'_c')?!![]:![],'options':_0x2c2e8f['options']?_[_0x8062('0x3b')](_[_0x8062('0x71')](_0x2c2e8f[_0x8062('0x4f')]),function(_0x5d9636){return{'name':_0x5d9636[_0x8062('0x76')],'value':_0x5d9636[_0x8062('0x2a')]};}):[]};})};}})[_0x8062('0x41')](respondWithResult(_0x284db5,null))[_0x8062('0x43')](function(_0x224c8b){var _0x20605f=_0x4a8243[_0x8062('0x30')][_0x8062('0x77')]?0x1f4:_0x224c8b[_0x8062('0x78')]||0x1f4;logger[_0x8062('0x28')](_0x8062('0x79'),_0x8062('0x59'),_0x20605f,JSON[_0x8062('0x7a')](_0x224c8b));delete _0x224c8b[_0x8062('0x2a')];if(_0x20605f===0x191){_0x20605f=0x190;}_0x284db5['status'](_0x20605f)['send'](_0x4a8243[_0x8062('0x30')][_0x8062('0x77')]?{'message':_0x8062('0x7b'),'statusCode':_0x224c8b[_0x8062('0x78')]}:_0x224c8b);});}else{var _0x439338=0x1f4;_0x284db5[_0x8062('0x1c')](_0x439338)[_0x8062('0x7c')]({'message':_0x8062('0x7b'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x8039=['undefined','limit','count','set','apply','reject','save','update','destroy','then','end','error','name','send','index','map','SugarcrmAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','includeAll','findAll','rows','catch','params','options','find','create','body','findOne','SugarcrmConfiguration','pick','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_type','parent_name','direction','password','remoteUri','substring','POST','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','%s%s','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove','includes','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset'];(function(_0x1707eb,_0x520e7e){var _0x31172f=function(_0x5297a6){while(--_0x5297a6){_0x1707eb['push'](_0x1707eb['shift']());}};_0x31172f(++_0x520e7e);}(_0x8039,0x150));var _0x9803=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x8039[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x9803('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9803('0x1'));var jsonpatch=require(_0x9803('0x2'));var rp=require('request-promise');var moment=require(_0x9803('0x3'));var BPromise=require(_0x9803('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9803('0x5'));var sox=require(_0x9803('0x6'));var csv=require(_0x9803('0x7'));var ejs=require(_0x9803('0x8'));var fs=require('fs');var fs_extra=require(_0x9803('0x9'));var _=require(_0x9803('0xa'));var squel=require(_0x9803('0xb'));var crypto=require(_0x9803('0xc'));var jsforce=require(_0x9803('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9803('0x7'));var querystring=require(_0x9803('0xe'));var Papa=require('papaparse');var Redis=require(_0x9803('0xf'));var authService=require(_0x9803('0x10'));var qs=require(_0x9803('0x11'));var as=require(_0x9803('0x12'));var hardwareService=require(_0x9803('0x13'));var logger=require('../../config/logger')(_0x9803('0x14'));var utils=require(_0x9803('0x15'));var config=require(_0x9803('0x16'));var licenseUtil=require(_0x9803('0x17'));var db=require(_0x9803('0x18'))['db'];var integrations=require(_0x9803('0x19'));function respondWithStatusCode(_0x1241b5,_0x39faac){_0x39faac=_0x39faac||0xcc;return function(_0x4c3681){if(_0x4c3681){return _0x1241b5[_0x9803('0x1a')](_0x39faac);}return _0x1241b5[_0x9803('0x1b')](_0x39faac)['end']();};}function respondWithResult(_0x34446b,_0x9b4fd2){_0x9b4fd2=_0x9b4fd2||0xc8;return function(_0x1b96e4){if(_0x1b96e4){return _0x34446b[_0x9803('0x1b')](_0x9b4fd2)[_0x9803('0x1c')](_0x1b96e4);}};}function respondWithFilteredResult(_0x5050d6,_0x2df616){return function(_0xa42ef5){if(_0xa42ef5){var _0xb3942b=typeof _0x2df616[_0x9803('0x1d')]===_0x9803('0x1e')&&typeof _0x2df616[_0x9803('0x1f')]===_0x9803('0x1e');var _0x1315aa=_0xa42ef5[_0x9803('0x20')];var _0x338d79=_0xb3942b?0x0:_0x2df616[_0x9803('0x1d')];var _0x5df6b1=_0xb3942b?_0xa42ef5[_0x9803('0x20')]:_0x2df616['offset']+_0x2df616['limit'];var _0x12db21;if(_0x5df6b1>=_0x1315aa){_0x5df6b1=_0x1315aa;_0x12db21=0xc8;}else{_0x12db21=0xce;}_0x5050d6[_0x9803('0x1b')](_0x12db21);return _0x5050d6[_0x9803('0x21')]('Content-Range',_0x338d79+'-'+_0x5df6b1+'/'+_0x1315aa)[_0x9803('0x1c')](_0xa42ef5);}return null;};}function patchUpdates(_0x56db6e){return function(_0x22eb78){try{jsonpatch[_0x9803('0x22')](_0x22eb78,_0x56db6e,!![]);}catch(_0x1ae4ea){return BPromise[_0x9803('0x23')](_0x1ae4ea);}return _0x22eb78[_0x9803('0x24')]();};}function saveUpdates(_0x2b7bfa,_0x33abc8){return function(_0x10d3b7){if(_0x10d3b7){return _0x10d3b7[_0x9803('0x25')](_0x2b7bfa)['then'](function(_0x54e7e7){return _0x54e7e7;});}return null;};}function removeEntity(_0x4d3128,_0x582ff6){return function(_0x3df708){if(_0x3df708){return _0x3df708[_0x9803('0x26')]()[_0x9803('0x27')](function(){_0x4d3128[_0x9803('0x1b')](0xcc)[_0x9803('0x28')]();});}};}function handleEntityNotFound(_0x5bf030,_0xa2fe3d){return function(_0x4d57a9){if(!_0x4d57a9){_0x5bf030[_0x9803('0x1a')](0x194);}return _0x4d57a9;};}function handleError(_0x4e1cdd,_0x4ae5b5){_0x4ae5b5=_0x4ae5b5||0x1f4;return function(_0x31003a){logger[_0x9803('0x29')](_0x31003a['stack']);if(_0x31003a['name']){delete _0x31003a[_0x9803('0x2a')];}_0x4e1cdd[_0x9803('0x1b')](_0x4ae5b5)[_0x9803('0x2b')](_0x31003a);};}exports[_0x9803('0x2c')]=function(_0x588f7f,_0x4606fb){var _0x3e7231={},_0x22fb8a={},_0x4c598d={'count':0x0,'rows':[]};var _0x138f1d=_[_0x9803('0x2d')](db[_0x9803('0x2e')][_0x9803('0x2f')],function(_0x8af5a2){return{'name':_0x8af5a2['fieldName'],'type':_0x8af5a2[_0x9803('0x30')][_0x9803('0x31')]};});_0x22fb8a[_0x9803('0x32')]=_[_0x9803('0x2d')](_0x138f1d,_0x9803('0x2a'));_0x22fb8a[_0x9803('0x33')]=_[_0x9803('0x34')](_0x588f7f[_0x9803('0x33')]);_0x22fb8a[_0x9803('0x35')]=_['intersection'](_0x22fb8a[_0x9803('0x32')],_0x22fb8a[_0x9803('0x33')]);_0x3e7231['attributes']=_[_0x9803('0x36')](_0x22fb8a['model'],qs[_0x9803('0x37')](_0x588f7f['query'][_0x9803('0x37')]));_0x3e7231['attributes']=_0x3e7231['attributes'][_0x9803('0x38')]?_0x3e7231[_0x9803('0x39')]:_0x22fb8a[_0x9803('0x32')];if(!_0x588f7f['query'][_0x9803('0x3a')](_0x9803('0x3b'))){_0x3e7231['limit']=qs[_0x9803('0x1f')](_0x588f7f['query'][_0x9803('0x1f')]);_0x3e7231[_0x9803('0x1d')]=qs['offset'](_0x588f7f['query'][_0x9803('0x1d')]);}_0x3e7231[_0x9803('0x3c')]=qs['sort'](_0x588f7f['query'][_0x9803('0x3d')]);_0x3e7231['where']=qs[_0x9803('0x35')](_['pick'](_0x588f7f[_0x9803('0x33')],_0x22fb8a['filters']),_0x138f1d);if(_0x588f7f[_0x9803('0x33')][_0x9803('0x3e')]){_0x3e7231['where']=_['merge'](_0x3e7231[_0x9803('0x3f')],{'$or':_[_0x9803('0x2d')](_0x138f1d,function(_0x2931ad){if(_0x2931ad[_0x9803('0x30')]!==_0x9803('0x40')){var _0x560111={};_0x560111[_0x2931ad[_0x9803('0x2a')]]={'$like':'%'+_0x588f7f[_0x9803('0x33')][_0x9803('0x3e')]+'%'};return _0x560111;}})});}_0x3e7231=_[_0x9803('0x41')]({},_0x3e7231,_0x588f7f['options']);var _0x3dd68f={'where':_0x3e7231[_0x9803('0x3f')]};return db[_0x9803('0x2e')]['count'](_0x3dd68f)[_0x9803('0x27')](function(_0x532362){_0x4c598d[_0x9803('0x20')]=_0x532362;if(_0x588f7f[_0x9803('0x33')][_0x9803('0x42')]){_0x3e7231['include']=[{'all':!![]}];}return db[_0x9803('0x2e')][_0x9803('0x43')](_0x3e7231);})[_0x9803('0x27')](function(_0x33966b){_0x4c598d[_0x9803('0x44')]=_0x33966b;return _0x4c598d;})[_0x9803('0x27')](respondWithFilteredResult(_0x4606fb,_0x3e7231))[_0x9803('0x45')](handleError(_0x4606fb,null));};exports['show']=function(_0x35a168,_0x319bb9){var _0x330444={'raw':![],'where':{'id':_0x35a168[_0x9803('0x46')]['id']}},_0x42cccd={};_0x42cccd['model']=_[_0x9803('0x34')](db[_0x9803('0x2e')]['rawAttributes']);_0x42cccd[_0x9803('0x33')]=_[_0x9803('0x34')](_0x35a168['query']);_0x42cccd[_0x9803('0x35')]=_[_0x9803('0x36')](_0x42cccd[_0x9803('0x32')],_0x42cccd['query']);_0x330444[_0x9803('0x39')]=_[_0x9803('0x36')](_0x42cccd[_0x9803('0x32')],qs[_0x9803('0x37')](_0x35a168['query'][_0x9803('0x37')]));_0x330444['attributes']=_0x330444[_0x9803('0x39')][_0x9803('0x38')]?_0x330444[_0x9803('0x39')]:_0x42cccd[_0x9803('0x32')];if(_0x35a168[_0x9803('0x33')][_0x9803('0x42')]){_0x330444['include']=[{'all':!![]}];}_0x330444=_[_0x9803('0x41')]({},_0x330444,_0x35a168[_0x9803('0x47')]);return db['SugarcrmAccount'][_0x9803('0x48')](_0x330444)[_0x9803('0x27')](handleEntityNotFound(_0x319bb9,null))[_0x9803('0x27')](respondWithResult(_0x319bb9,null))['catch'](handleError(_0x319bb9,null));};exports[_0x9803('0x49')]=function(_0x1d39b6,_0x5bd939){return db[_0x9803('0x2e')][_0x9803('0x49')](_0x1d39b6['body'],{})['then'](respondWithResult(_0x5bd939,0xc9))[_0x9803('0x45')](handleError(_0x5bd939,null));};exports[_0x9803('0x25')]=function(_0x2524c1,_0x5a95bc){if(_0x2524c1[_0x9803('0x4a')]['id']){delete _0x2524c1[_0x9803('0x4a')]['id'];}return db['SugarcrmAccount'][_0x9803('0x48')]({'where':{'id':_0x2524c1['params']['id']}})[_0x9803('0x27')](handleEntityNotFound(_0x5a95bc,null))[_0x9803('0x27')](saveUpdates(_0x2524c1[_0x9803('0x4a')],null))[_0x9803('0x27')](respondWithResult(_0x5a95bc,null))[_0x9803('0x45')](handleError(_0x5a95bc,null));};exports[_0x9803('0x26')]=function(_0x3886e4,_0x181f29){return db['SugarcrmAccount'][_0x9803('0x48')]({'where':{'id':_0x3886e4[_0x9803('0x46')]['id']}})[_0x9803('0x27')](handleEntityNotFound(_0x181f29,null))['then'](removeEntity(_0x181f29,null))[_0x9803('0x45')](handleError(_0x181f29,null));};exports['getConfigurations']=function(_0x3089a6,_0x23f294,_0x446334){var _0x5066b4={};var _0x2dffe0={};var _0x103d43;var _0x5b4479;return db['SugarcrmAccount'][_0x9803('0x4b')]({'where':{'id':_0x3089a6[_0x9803('0x46')]['id']}})['then'](handleEntityNotFound(_0x23f294,null))[_0x9803('0x27')](function(_0x28b0a2){if(_0x28b0a2){_0x103d43=_0x28b0a2;_0x2dffe0[_0x9803('0x32')]=_[_0x9803('0x34')](db[_0x9803('0x4c')]['rawAttributes']);_0x2dffe0[_0x9803('0x33')]=_[_0x9803('0x34')](_0x3089a6[_0x9803('0x33')]);_0x2dffe0[_0x9803('0x35')]=_[_0x9803('0x36')](_0x2dffe0['model'],_0x2dffe0['query']);_0x5066b4[_0x9803('0x39')]=_['intersection'](_0x2dffe0[_0x9803('0x32')],qs[_0x9803('0x37')](_0x3089a6[_0x9803('0x33')][_0x9803('0x37')]));_0x5066b4['attributes']=_0x5066b4[_0x9803('0x39')][_0x9803('0x38')]?_0x5066b4['attributes']:_0x2dffe0[_0x9803('0x32')];_0x5066b4[_0x9803('0x3c')]=qs[_0x9803('0x3d')](_0x3089a6['query'][_0x9803('0x3d')]);_0x5066b4[_0x9803('0x3f')]=qs['filters'](_[_0x9803('0x4d')](_0x3089a6[_0x9803('0x33')],_0x2dffe0[_0x9803('0x35')]));if(_0x3089a6[_0x9803('0x33')][_0x9803('0x3e')]){_0x5066b4[_0x9803('0x3f')]=_[_0x9803('0x41')](_0x5066b4[_0x9803('0x3f')],{'$or':_['map'](_0x5066b4[_0x9803('0x39')],function(_0x211b36){var _0x528821={};_0x528821[_0x211b36]={'$like':'%'+_0x3089a6[_0x9803('0x33')][_0x9803('0x3e')]+'%'};return _0x528821;})});}_0x5066b4=_[_0x9803('0x41')]({},_0x5066b4,_0x3089a6['options']);return _0x103d43['getConfigurations'](_0x5066b4);}})[_0x9803('0x27')](function(_0x49b7e1){if(_0x49b7e1){_0x5b4479=_0x49b7e1[_0x9803('0x38')];if(!_0x3089a6[_0x9803('0x33')][_0x9803('0x3a')]('nolimit')){_0x5066b4[_0x9803('0x1f')]=qs[_0x9803('0x1f')](_0x3089a6['query'][_0x9803('0x1f')]);_0x5066b4[_0x9803('0x1d')]=qs[_0x9803('0x1d')](_0x3089a6['query']['offset']);}return _0x103d43[_0x9803('0x4e')](_0x5066b4);}})[_0x9803('0x27')](function(_0x56e63b){if(_0x56e63b){return _0x56e63b?{'count':_0x5b4479,'rows':_0x56e63b}:null;}})[_0x9803('0x27')](respondWithResult(_0x23f294,null))[_0x9803('0x45')](handleError(_0x23f294,null));};exports[_0x9803('0x4f')]=function(_0x3f5ccf,_0x189ee9,_0x3c5d99){if(_0x3f5ccf[_0x9803('0x4a')]['id']){delete _0x3f5ccf['body']['id'];}return db[_0x9803('0x2e')]['findOne']({'where':{'id':_0x3f5ccf[_0x9803('0x46')]['id']}})[_0x9803('0x27')](handleEntityNotFound(_0x189ee9,null))['then'](function(_0x264414){if(_0x264414){_0x3f5ccf[_0x9803('0x4a')][_0x9803('0x50')]=_0x264414['id'];_0x3f5ccf[_0x9803('0x4a')][_0x9803('0x51')]=integrations['getSubjects'](_0x3f5ccf[_0x9803('0x4a')][_0x9803('0x52')],_0x3f5ccf[_0x9803('0x4a')][_0x9803('0x30')]);_0x3f5ccf[_0x9803('0x4a')][_0x9803('0x53')]=integrations[_0x9803('0x54')](_0x3f5ccf[_0x9803('0x4a')][_0x9803('0x52')],_0x3f5ccf[_0x9803('0x4a')][_0x9803('0x30')]);return db[_0x9803('0x4c')][_0x9803('0x49')](_0x3f5ccf[_0x9803('0x4a')],{'include':[{'model':db[_0x9803('0x55')],'as':_0x9803('0x51')},{'model':db[_0x9803('0x55')],'as':'Descriptions'}]});}return null;})[_0x9803('0x27')](respondWithResult(_0x189ee9,null))[_0x9803('0x45')](handleError(_0x189ee9,null));};exports[_0x9803('0x56')]=function(_0xef1d9,_0x3d2bab,_0x4f1f93){var _0xca6a4a='';var _0x2b7ae2=['id','name',_0x9803('0x57'),_0x9803('0x58'),_0x9803('0x59'),_0x9803('0x5a'),_0x9803('0x5b'),_0x9803('0x5c'),'parent_id',_0x9803('0x5d'),_0x9803('0x5e'),_0x9803('0x5f')];return db[_0x9803('0x2e')]['findOne']({'where':{'id':_0xef1d9[_0x9803('0x46')]['id']},'attributes':['id','username',_0x9803('0x60'),_0x9803('0x61')]})['then'](handleEntityNotFound(_0x3d2bab,null))[_0x9803('0x27')](function(_0x4eca4d){if(_0x4eca4d){_0xca6a4a=_0x4eca4d[_0x9803('0x61')];var _0x227003=_0xca6a4a['slice'](-0x1);if(_0x227003==='/'){_0xca6a4a=_0xca6a4a[_0x9803('0x62')](0x0,_0xca6a4a['lastIndexOf'](_0x227003));}return rp({'method':_0x9803('0x63'),'uri':util['format']('%s%s',_0xca6a4a,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0x9803('0x64'),'response_type':_0x9803('0x64'),'rest_data':JSON[_0x9803('0x65')]({'user_auth':{'user_name':_0x4eca4d[_0x9803('0x66')],'password':_0x4eca4d[_0x9803('0x60')],'encryption':_0x9803('0x67')},'application':_0x9803('0x68')})}});}})['then'](function(_0x485270){if(_0x485270&&_0x485270[_0x9803('0x2a')]!==_0x9803('0x69')&&_0x485270[_0x9803('0x2a')]!==_0x9803('0x6a')){return rp({'method':'POST','uri':util[_0x9803('0x6b')](_0x9803('0x6c'),_0xca6a4a,_0x9803('0x6d')),'json':!![],'form':{'method':_0x9803('0x6e'),'input_type':_0x9803('0x64'),'response_type':'JSON','rest_data':JSON[_0x9803('0x65')]({'session':_0x485270['id'],'module_name':_0x9803('0x6f')})}})[_0x9803('0x27')](function(_0x3ab0f){if(_0x3ab0f){var _0xadb333=_[_0x9803('0x70')](_0x3ab0f[_0x9803('0x71')]);_[_0x9803('0x72')](_0xadb333,function(_0x183e04){return _0x2b7ae2[_0x9803('0x73')](_0x183e04['name']);});return{'count':_0xadb333['length'],'rows':_[_0x9803('0x2d')](_0xadb333,function(_0x1f5e5b){return{'id':_0x1f5e5b[_0x9803('0x2a')],'name':_0x1f5e5b[_0x9803('0x74')],'custom':_['endsWith'](_0x1f5e5b['name'],'_c')?!![]:![],'options':_0x1f5e5b[_0x9803('0x47')]?_[_0x9803('0x2d')](_['values'](_0x1f5e5b[_0x9803('0x47')]),function(_0x36ffec){return{'name':_0x36ffec[_0x9803('0x75')],'value':_0x36ffec[_0x9803('0x2a')]};}):[]};})};}})[_0x9803('0x27')](respondWithResult(_0x3d2bab,null))[_0x9803('0x45')](function(_0x1c9d5a){var _0x291fb2=_0xef1d9[_0x9803('0x33')][_0x9803('0x76')]?0x1f4:_0x1c9d5a[_0x9803('0x77')]||0x1f4;logger['error'](_0x9803('0x78'),_0x9803('0x56'),_0x291fb2,JSON[_0x9803('0x65')](_0x1c9d5a));delete _0x1c9d5a[_0x9803('0x2a')];if(_0x291fb2===0x191){_0x291fb2=0x190;}_0x3d2bab['status'](_0x291fb2)['send'](_0xef1d9['query'][_0x9803('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x1c9d5a[_0x9803('0x77')]}:_0x1c9d5a);});}else{var _0x9e86f4=0x1f4;_0x3d2bab[_0x9803('0x1b')](_0x9e86f4)[_0x9803('0x2b')]({'message':_0x9803('0x79'),'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 66f4ac8..a187d41 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 _0x167a=['../../config/logger','api','moment','bluebird','path','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util'];(function(_0x474438,_0x2a570d){var _0x4026a8=function(_0x5184b4){while(--_0x5184b4){_0x474438['push'](_0x474438['shift']());}};_0x4026a8(++_0x2a570d);}(_0x167a,0xfa));var _0xa167=function(_0x4bbdb5,_0x1aad87){_0x4bbdb5=_0x4bbdb5-0x0;var _0x450bb5=_0x167a[_0x4bbdb5];return _0x450bb5;};'use strict';var _=require(_0xa167('0x0'));var util=require(_0xa167('0x1'));var logger=require(_0xa167('0x2'))(_0xa167('0x3'));var moment=require(_0xa167('0x4'));var BPromise=require(_0xa167('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa167('0x6'));var rimraf=require(_0xa167('0x7'));var config=require('../../config/environment');var attributes=require(_0xa167('0x8'));var integrations=require(_0xa167('0x9'));module[_0xa167('0xa')]=function(_0x56b41d,_0x3fe1ab){return _0x56b41d[_0xa167('0xb')](_0xa167('0xc'),attributes,{'tableName':_0xa167('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3625=['../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes'];(function(_0x4738dc,_0x57e1e1){var _0x225bef=function(_0x925c99){while(--_0x925c99){_0x4738dc['push'](_0x4738dc['shift']());}};_0x225bef(++_0x57e1e1);}(_0x3625,0x18d));var _0x5362=function(_0x12c37f,_0x2f6f35){_0x12c37f=_0x12c37f-0x0;var _0x2c4925=_0x3625[_0x12c37f];return _0x2c4925;};'use strict';var _=require(_0x5362('0x0'));var util=require(_0x5362('0x1'));var logger=require('../../config/logger')(_0x5362('0x2'));var moment=require(_0x5362('0x3'));var BPromise=require(_0x5362('0x4'));var rp=require(_0x5362('0x5'));var fs=require('fs');var path=require(_0x5362('0x6'));var rimraf=require('rimraf');var config=require(_0x5362('0x7'));var attributes=require(_0x5362('0x8'));var integrations=require(_0x5362('0x9'));module[_0x5362('0xa')]=function(_0x125030,_0x24ca16){return _0x125030[_0x5362('0xb')](_0x5362('0xc'),attributes,{'tableName':_0x5362('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 0ee6f60..1a94f72 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 _0x69fc=['http','request','then','info','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','catch','SugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','util','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x7b87bc,_0x545a90){var _0x57c991=function(_0x8401bb){while(--_0x8401bb){_0x7b87bc['push'](_0x7b87bc['shift']());}};_0x57c991(++_0x545a90);}(_0x69fc,0x1e9));var _0xc69f=function(_0x307060,_0x26dc3d){_0x307060=_0x307060-0x0;var _0x3a2587=_0x69fc[_0x307060];return _0x3a2587;};'use strict';var _=require('lodash');var util=require(_0xc69f('0x0'));var moment=require('moment');var BPromise=require(_0xc69f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc69f('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xc69f('0x3'))('rpc');var config=require(_0xc69f('0x4'));var jayson=require(_0xc69f('0x5'));var client=jayson[_0xc69f('0x6')][_0xc69f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xc25199,_0x5719b3,_0x4f99f3){return new BPromise(function(_0x19ad48,_0x3cbadc){return client[_0xc69f('0x8')](_0xc25199,_0x4f99f3)[_0xc69f('0x9')](function(_0x4b68c9){logger[_0xc69f('0xa')]('SugarcrmAccount,\x20%s,\x20%s',_0x5719b3,'request\x20sent');logger[_0xc69f('0xb')](_0xc69f('0xc'),_0x5719b3,_0xc69f('0xd'),JSON[_0xc69f('0xe')](_0x4b68c9));if(_0x4b68c9[_0xc69f('0xf')]){if(_0x4b68c9[_0xc69f('0xf')][_0xc69f('0x10')]===0x1f4){logger[_0xc69f('0xf')](_0xc69f('0x11'),_0x5719b3,_0x4b68c9['error'][_0xc69f('0x12')]);return _0x3cbadc(_0x4b68c9['error'][_0xc69f('0x12')]);}logger[_0xc69f('0xf')](_0xc69f('0x11'),_0x5719b3,_0x4b68c9[_0xc69f('0xf')]['message']);return _0x19ad48(_0x4b68c9[_0xc69f('0xf')][_0xc69f('0x12')]);}else{logger[_0xc69f('0xa')](_0xc69f('0x11'),_0x5719b3,_0xc69f('0xd'));_0x19ad48(_0x4b68c9['result'][_0xc69f('0x12')]);}})[_0xc69f('0x13')](function(_0x5dfb86){logger[_0xc69f('0xf')](_0xc69f('0x11'),_0x5719b3,_0x5dfb86);_0x3cbadc(_0x5dfb86);});});}exports['GetSugarcrmAccount']=function(_0x1a5eca){var _0x19a217=this;return new Promise(function(_0x4ade10,_0x4731c5){return db[_0xc69f('0x14')][_0xc69f('0x15')]({'raw':_0x1a5eca[_0xc69f('0x16')]?_0x1a5eca[_0xc69f('0x16')][_0xc69f('0x17')]===undefined?!![]:![]:!![],'where':_0x1a5eca[_0xc69f('0x16')]?_0x1a5eca[_0xc69f('0x16')][_0xc69f('0x18')]||null:null,'attributes':_0x1a5eca['options']?_0x1a5eca[_0xc69f('0x16')][_0xc69f('0x19')]||null:null,'limit':_0x1a5eca[_0xc69f('0x16')]?_0x1a5eca[_0xc69f('0x16')]['limit']||null:null,'include':_0x1a5eca[_0xc69f('0x16')]?_0x1a5eca[_0xc69f('0x16')][_0xc69f('0x1a')]?_[_0xc69f('0x1b')](_0x1a5eca[_0xc69f('0x16')][_0xc69f('0x1a')],function(_0x5a1dbf){return{'model':db[_0x5a1dbf[_0xc69f('0x1c')]],'as':_0x5a1dbf['as'],'attributes':_0x5a1dbf[_0xc69f('0x19')],'include':_0x5a1dbf[_0xc69f('0x1a')]?_[_0xc69f('0x1b')](_0x5a1dbf[_0xc69f('0x1a')],function(_0x51e886){return{'model':db[_0x51e886[_0xc69f('0x1c')]],'as':_0x51e886['as'],'attributes':_0x51e886[_0xc69f('0x19')],'include':_0x51e886[_0xc69f('0x1a')]?_['map'](_0x51e886[_0xc69f('0x1a')],function(_0x2da74d){return{'model':db[_0x2da74d['model']],'as':_0x2da74d['as'],'attributes':_0x2da74d[_0xc69f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc69f('0x9')](function(_0x2dbe51){logger[_0xc69f('0xa')]('GetSugarcrmAccount',_0x1a5eca);logger[_0xc69f('0xb')](_0xc69f('0x1d'),_0x1a5eca,JSON['stringify'](_0x2dbe51));_0x4ade10(_0x2dbe51);})['catch'](function(_0x155ed0){logger['error']('GetSugarcrmAccount',_0x155ed0[_0xc69f('0x12')],_0x1a5eca);_0x4731c5(_0x19a217[_0xc69f('0xf')](0x1f4,_0x155ed0[_0xc69f('0x12')]));});});};exports[_0xc69f('0x1e')]=function(_0x5bbed5){var _0x4ff374=this;return new Promise(function(_0x143beb,_0x196c4e){return db[_0xc69f('0x14')]['find']({'raw':_0x5bbed5['options']?_0x5bbed5[_0xc69f('0x16')][_0xc69f('0x17')]===undefined?!![]:![]:!![],'where':_0x5bbed5[_0xc69f('0x16')]?_0x5bbed5['options'][_0xc69f('0x18')]||null:null,'attributes':_0x5bbed5[_0xc69f('0x16')]?_0x5bbed5[_0xc69f('0x16')][_0xc69f('0x19')]||null:null,'include':_0x5bbed5[_0xc69f('0x16')]?_0x5bbed5[_0xc69f('0x16')]['include']?_[_0xc69f('0x1b')](_0x5bbed5[_0xc69f('0x16')][_0xc69f('0x1a')],function(_0x2fbebc){return{'model':db[_0x2fbebc[_0xc69f('0x1c')]],'as':_0x2fbebc['as'],'attributes':_0x2fbebc[_0xc69f('0x19')],'include':_0x2fbebc[_0xc69f('0x1a')]?_[_0xc69f('0x1b')](_0x2fbebc[_0xc69f('0x1a')],function(_0x44d666){return{'model':db[_0x44d666[_0xc69f('0x1c')]],'as':_0x44d666['as'],'attributes':_0x44d666['attributes'],'include':_0x44d666[_0xc69f('0x1a')]?_[_0xc69f('0x1b')](_0x44d666[_0xc69f('0x1a')],function(_0x3ea449){return{'model':db[_0x3ea449[_0xc69f('0x1c')]],'as':_0x3ea449['as'],'attributes':_0x3ea449[_0xc69f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc69f('0x9')](function(_0xedf0b3){logger[_0xc69f('0xa')](_0xc69f('0x1e'),_0x5bbed5);logger[_0xc69f('0xb')](_0xc69f('0x1e'),_0x5bbed5,JSON['stringify'](_0xedf0b3));_0x143beb(_0xedf0b3);})[_0xc69f('0x13')](function(_0x2365b0){logger[_0xc69f('0xf')](_0xc69f('0x1e'),_0x2365b0[_0xc69f('0x12')],_0x5bbed5);_0x196c4e(_0x4ff374[_0xc69f('0xf')](0x1f4,_0x2365b0['message']));});});}; \ No newline at end of file +var _0xfc31=['include','map','model','stringify','ShowSugarcrmAccount','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','limit'];(function(_0x24b45a,_0x1a922a){var _0x24005a=function(_0x38a2b2){while(--_0x38a2b2){_0x24b45a['push'](_0x24b45a['shift']());}};_0x24005a(++_0x1a922a);}(_0xfc31,0xa7));var _0x1fc3=function(_0x5895ae,_0x388cb1){_0x5895ae=_0x5895ae-0x0;var _0x42ffe5=_0xfc31[_0x5895ae];return _0x42ffe5;};'use strict';var _=require(_0x1fc3('0x0'));var util=require('util');var moment=require(_0x1fc3('0x1'));var BPromise=require(_0x1fc3('0x2'));var rs=require(_0x1fc3('0x3'));var fs=require('fs');var Redis=require(_0x1fc3('0x4'));var db=require(_0x1fc3('0x5'))['db'];var utils=require(_0x1fc3('0x6'));var logger=require('../../config/logger')(_0x1fc3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1fc3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x579d4e,_0x21fd9e,_0xefcfc8){return new BPromise(function(_0x393e99,_0x9b511d){return client['request'](_0x579d4e,_0xefcfc8)[_0x1fc3('0x9')](function(_0x337e16){logger[_0x1fc3('0xa')](_0x1fc3('0xb'),_0x21fd9e,_0x1fc3('0xc'));logger[_0x1fc3('0xd')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x21fd9e,_0x1fc3('0xc'),JSON['stringify'](_0x337e16));if(_0x337e16[_0x1fc3('0xe')]){if(_0x337e16['error']['code']===0x1f4){logger[_0x1fc3('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x21fd9e,_0x337e16[_0x1fc3('0xe')][_0x1fc3('0xf')]);return _0x9b511d(_0x337e16['error'][_0x1fc3('0xf')]);}logger[_0x1fc3('0xe')](_0x1fc3('0xb'),_0x21fd9e,_0x337e16['error']['message']);return _0x393e99(_0x337e16[_0x1fc3('0xe')][_0x1fc3('0xf')]);}else{logger[_0x1fc3('0xa')](_0x1fc3('0xb'),_0x21fd9e,_0x1fc3('0xc'));_0x393e99(_0x337e16[_0x1fc3('0x10')]['message']);}})[_0x1fc3('0x11')](function(_0x2e9ff4){logger[_0x1fc3('0xe')](_0x1fc3('0xb'),_0x21fd9e,_0x2e9ff4);_0x9b511d(_0x2e9ff4);});});}exports[_0x1fc3('0x12')]=function(_0x4e2b30){var _0x1c9529=this;return new Promise(function(_0x4ccdde,_0x435aed){return db[_0x1fc3('0x13')][_0x1fc3('0x14')]({'raw':_0x4e2b30['options']?_0x4e2b30[_0x1fc3('0x15')][_0x1fc3('0x16')]===undefined?!![]:![]:!![],'where':_0x4e2b30['options']?_0x4e2b30['options']['where']||null:null,'attributes':_0x4e2b30[_0x1fc3('0x15')]?_0x4e2b30[_0x1fc3('0x15')][_0x1fc3('0x17')]||null:null,'limit':_0x4e2b30[_0x1fc3('0x15')]?_0x4e2b30[_0x1fc3('0x15')][_0x1fc3('0x18')]||null:null,'include':_0x4e2b30[_0x1fc3('0x15')]?_0x4e2b30[_0x1fc3('0x15')][_0x1fc3('0x19')]?_[_0x1fc3('0x1a')](_0x4e2b30[_0x1fc3('0x15')][_0x1fc3('0x19')],function(_0x5ea525){return{'model':db[_0x5ea525[_0x1fc3('0x1b')]],'as':_0x5ea525['as'],'attributes':_0x5ea525[_0x1fc3('0x17')],'include':_0x5ea525[_0x1fc3('0x19')]?_[_0x1fc3('0x1a')](_0x5ea525[_0x1fc3('0x19')],function(_0x575b57){return{'model':db[_0x575b57[_0x1fc3('0x1b')]],'as':_0x575b57['as'],'attributes':_0x575b57[_0x1fc3('0x17')],'include':_0x575b57[_0x1fc3('0x19')]?_[_0x1fc3('0x1a')](_0x575b57[_0x1fc3('0x19')],function(_0x2920c0){return{'model':db[_0x2920c0[_0x1fc3('0x1b')]],'as':_0x2920c0['as'],'attributes':_0x2920c0[_0x1fc3('0x17')]};}):[]};}):[]};}):[]:[]})[_0x1fc3('0x9')](function(_0x1aa04f){logger[_0x1fc3('0xa')](_0x1fc3('0x12'),_0x4e2b30);logger[_0x1fc3('0xd')](_0x1fc3('0x12'),_0x4e2b30,JSON[_0x1fc3('0x1c')](_0x1aa04f));_0x4ccdde(_0x1aa04f);})[_0x1fc3('0x11')](function(_0x427282){logger[_0x1fc3('0xe')](_0x1fc3('0x12'),_0x427282['message'],_0x4e2b30);_0x435aed(_0x1c9529[_0x1fc3('0xe')](0x1f4,_0x427282[_0x1fc3('0xf')]));});});};exports[_0x1fc3('0x1d')]=function(_0x541ca4){var _0x2b9ab2=this;return new Promise(function(_0x7e28c0,_0x509f8f){return db[_0x1fc3('0x13')][_0x1fc3('0x1e')]({'raw':_0x541ca4[_0x1fc3('0x15')]?_0x541ca4[_0x1fc3('0x15')][_0x1fc3('0x16')]===undefined?!![]:![]:!![],'where':_0x541ca4[_0x1fc3('0x15')]?_0x541ca4[_0x1fc3('0x15')][_0x1fc3('0x1f')]||null:null,'attributes':_0x541ca4[_0x1fc3('0x15')]?_0x541ca4[_0x1fc3('0x15')]['attributes']||null:null,'include':_0x541ca4['options']?_0x541ca4[_0x1fc3('0x15')][_0x1fc3('0x19')]?_['map'](_0x541ca4[_0x1fc3('0x15')][_0x1fc3('0x19')],function(_0x56d7b3){return{'model':db[_0x56d7b3['model']],'as':_0x56d7b3['as'],'attributes':_0x56d7b3[_0x1fc3('0x17')],'include':_0x56d7b3['include']?_[_0x1fc3('0x1a')](_0x56d7b3[_0x1fc3('0x19')],function(_0x226f6d){return{'model':db[_0x226f6d[_0x1fc3('0x1b')]],'as':_0x226f6d['as'],'attributes':_0x226f6d['attributes'],'include':_0x226f6d[_0x1fc3('0x19')]?_[_0x1fc3('0x1a')](_0x226f6d[_0x1fc3('0x19')],function(_0x5b8834){return{'model':db[_0x5b8834[_0x1fc3('0x1b')]],'as':_0x5b8834['as'],'attributes':_0x5b8834[_0x1fc3('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a9045){logger['info'](_0x1fc3('0x1d'),_0x541ca4);logger[_0x1fc3('0xd')](_0x1fc3('0x1d'),_0x541ca4,JSON[_0x1fc3('0x1c')](_0x4a9045));_0x7e28c0(_0x4a9045);})[_0x1fc3('0x11')](function(_0x5a68b2){logger['error']('ShowSugarcrmAccount',_0x5a68b2[_0x1fc3('0xf')],_0x541ca4);_0x509f8f(_0x2b9ab2[_0x1fc3('0xe')](0x1f4,_0x5a68b2[_0x1fc3('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 340d8a0..061761a 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 _0xb1c4=['getDescriptions','post','create','put','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x5bddd1,_0x4e1cf3){var _0x314a08=function(_0x4e1ef8){while(--_0x4e1ef8){_0x5bddd1['push'](_0x5bddd1['shift']());}};_0x314a08(++_0x4e1cf3);}(_0xb1c4,0xdd));var _0x4b1c=function(_0x2bf266,_0x3af9ca){_0x2bf266=_0x2bf266-0x0;var _0x343f23=_0xb1c4[_0x2bf266];return _0x343f23;};'use strict';var multer=require(_0x4b1c('0x0'));var util=require(_0x4b1c('0x1'));var path=require(_0x4b1c('0x2'));var timeout=require(_0x4b1c('0x3'));var express=require(_0x4b1c('0x4'));var router=express[_0x4b1c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4b1c('0x6'));var interaction=require(_0x4b1c('0x7'));var config=require(_0x4b1c('0x8'));var controller=require(_0x4b1c('0x9'));router['get']('/',auth[_0x4b1c('0xa')](),controller[_0x4b1c('0xb')]);router[_0x4b1c('0xc')](_0x4b1c('0xd'),auth[_0x4b1c('0xa')](),controller[_0x4b1c('0xe')]);router[_0x4b1c('0xc')](_0x4b1c('0xf'),auth[_0x4b1c('0xa')](),controller['getFields']);router[_0x4b1c('0xc')](_0x4b1c('0x10'),auth[_0x4b1c('0xa')](),controller[_0x4b1c('0x11')]);router[_0x4b1c('0xc')](_0x4b1c('0x12'),auth[_0x4b1c('0xa')](),controller[_0x4b1c('0x13')]);router[_0x4b1c('0x14')]('/',auth[_0x4b1c('0xa')](),controller[_0x4b1c('0x15')]);router[_0x4b1c('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x4b1c('0xa')](),controller['destroy']);module[_0x4b1c('0x17')]=router; \ No newline at end of file +var _0x1d3a=['getDescriptions','post','create','put','update','delete','destroy','exports','util','path','Router','fs-extra','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x27237f,_0x5bc532){var _0xfec0f=function(_0x48f65b){while(--_0x48f65b){_0x27237f['push'](_0x27237f['shift']());}};_0xfec0f(++_0x5bc532);}(_0x1d3a,0x105));var _0xa1d3=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x1d3a[_0x39c734];return _0xb2a2f9;};'use strict';var multer=require('multer');var util=require(_0xa1d3('0x0'));var path=require(_0xa1d3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa1d3('0x2')]();var fs_extra=require(_0xa1d3('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa1d3('0x4'));var controller=require(_0xa1d3('0x5'));router['get']('/',auth[_0xa1d3('0x6')](),controller[_0xa1d3('0x7')]);router[_0xa1d3('0x8')](_0xa1d3('0x9'),auth[_0xa1d3('0x6')](),controller[_0xa1d3('0xa')]);router[_0xa1d3('0x8')](_0xa1d3('0xb'),auth[_0xa1d3('0x6')](),controller[_0xa1d3('0xc')]);router[_0xa1d3('0x8')](_0xa1d3('0xd'),auth[_0xa1d3('0x6')](),controller[_0xa1d3('0xe')]);router[_0xa1d3('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xa1d3('0xf')]);router[_0xa1d3('0x10')]('/',auth[_0xa1d3('0x6')](),controller[_0xa1d3('0x11')]);router[_0xa1d3('0x12')](_0xa1d3('0x9'),auth[_0xa1d3('0x6')](),controller[_0xa1d3('0x13')]);router[_0xa1d3('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xa1d3('0x15')]);module[_0xa1d3('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index e0870a4..021e981 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 _0x4df3=['sequelize','exports','STRING'];(function(_0xd9f102,_0x5a0d28){var _0x2652e4=function(_0x5021a1){while(--_0x5021a1){_0xd9f102['push'](_0xd9f102['shift']());}};_0x2652e4(++_0x5a0d28);}(_0x4df3,0x11a));var _0x34df=function(_0x2caaef,_0x3c19ed){_0x2caaef=_0x2caaef-0x0;var _0xd011f8=_0x4df3[_0x2caaef];return _0xd011f8;};'use strict';var Sequelize=require(_0x34df('0x0'));module[_0x34df('0x1')]={'name':{'type':Sequelize[_0x34df('0x2')]},'description':{'type':Sequelize[_0x34df('0x2')]}}; \ No newline at end of file +var _0xc2c3=['STRING','sequelize'];(function(_0x1c85f5,_0x426f70){var _0x349877=function(_0x215b73){while(--_0x215b73){_0x1c85f5['push'](_0x1c85f5['shift']());}};_0x349877(++_0x426f70);}(_0xc2c3,0x17b));var _0x3c2c=function(_0x227dbd,_0x151c21){_0x227dbd=_0x227dbd-0x0;var _0x675f7c=_0xc2c3[_0x227dbd];return _0x675f7c;};'use strict';var Sequelize=require(_0x3c2c('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3c2c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 7b37ee3..40a85e8 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 _0xedb9=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','reject','save','then','destroy','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','update','body','findOne','SugarcrmField','pick','getFields','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x156a0d,_0x3946ce){var _0x98a9ba=function(_0x46c1b2){while(--_0x46c1b2){_0x156a0d['push'](_0x156a0d['shift']());}};_0x98a9ba(++_0x3946ce);}(_0xedb9,0x95));var _0x9edb=function(_0xeaf672,_0x10ec4e){_0xeaf672=_0xeaf672-0x0;var _0x528874=_0xedb9[_0xeaf672];return _0x528874;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edb('0x0'));var zipdir=require(_0x9edb('0x1'));var jsonpatch=require(_0x9edb('0x2'));var rp=require('request-promise');var moment=require(_0x9edb('0x3'));var BPromise=require(_0x9edb('0x4'));var Mustache=require('mustache');var util=require(_0x9edb('0x5'));var path=require(_0x9edb('0x6'));var sox=require(_0x9edb('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9edb('0x8'));var squel=require(_0x9edb('0x9'));var crypto=require(_0x9edb('0xa'));var jsforce=require(_0x9edb('0xb'));var deskjs=require(_0x9edb('0xc'));var toCsv=require(_0x9edb('0xd'));var querystring=require(_0x9edb('0xe'));var Papa=require('papaparse');var Redis=require(_0x9edb('0xf'));var authService=require(_0x9edb('0x10'));var qs=require(_0x9edb('0x11'));var as=require(_0x9edb('0x12'));var hardwareService=require(_0x9edb('0x13'));var logger=require(_0x9edb('0x14'))(_0x9edb('0x15'));var utils=require(_0x9edb('0x16'));var config=require(_0x9edb('0x17'));var licenseUtil=require(_0x9edb('0x18'));var db=require(_0x9edb('0x19'))['db'];function respondWithStatusCode(_0x47e85c,_0x9a4ecc){_0x9a4ecc=_0x9a4ecc||0xcc;return function(_0x160dc8){if(_0x160dc8){return _0x47e85c[_0x9edb('0x1a')](_0x9a4ecc);}return _0x47e85c[_0x9edb('0x1b')](_0x9a4ecc)['end']();};}function respondWithResult(_0x1d7a7f,_0x14fab8){_0x14fab8=_0x14fab8||0xc8;return function(_0x4bcbf1){if(_0x4bcbf1){return _0x1d7a7f[_0x9edb('0x1b')](_0x14fab8)[_0x9edb('0x1c')](_0x4bcbf1);}};}function respondWithFilteredResult(_0x4ba888,_0x3a43bc){return function(_0x4e543d){if(_0x4e543d){var _0x320447=typeof _0x3a43bc[_0x9edb('0x1d')]===_0x9edb('0x1e')&&typeof _0x3a43bc['limit']===_0x9edb('0x1e');var _0x39a74b=_0x4e543d[_0x9edb('0x1f')];var _0x2d001b=_0x320447?0x0:_0x3a43bc[_0x9edb('0x1d')];var _0x32427f=_0x320447?_0x4e543d[_0x9edb('0x1f')]:_0x3a43bc['offset']+_0x3a43bc[_0x9edb('0x20')];var _0x1d094e;if(_0x32427f>=_0x39a74b){_0x32427f=_0x39a74b;_0x1d094e=0xc8;}else{_0x1d094e=0xce;}_0x4ba888[_0x9edb('0x1b')](_0x1d094e);return _0x4ba888[_0x9edb('0x21')]('Content-Range',_0x2d001b+'-'+_0x32427f+'/'+_0x39a74b)[_0x9edb('0x1c')](_0x4e543d);}return null;};}function patchUpdates(_0x81ee69){return function(_0x4bb952){try{jsonpatch['apply'](_0x4bb952,_0x81ee69,!![]);}catch(_0x304fe4){return BPromise[_0x9edb('0x22')](_0x304fe4);}return _0x4bb952[_0x9edb('0x23')]();};}function saveUpdates(_0x4b6da6,_0x3fa574){return function(_0x3b6182){if(_0x3b6182){return _0x3b6182['update'](_0x4b6da6)[_0x9edb('0x24')](function(_0x3f4e0b){return _0x3f4e0b;});}return null;};}function removeEntity(_0x430eba,_0x618fd8){return function(_0x322730){if(_0x322730){return _0x322730[_0x9edb('0x25')]()[_0x9edb('0x24')](function(){_0x430eba[_0x9edb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x184df2,_0x148b16){return function(_0x25355b){if(!_0x25355b){_0x184df2['sendStatus'](0x194);}return _0x25355b;};}function handleError(_0x53283d,_0x56e7e0){_0x56e7e0=_0x56e7e0||0x1f4;return function(_0xb5224b){logger[_0x9edb('0x26')](_0xb5224b[_0x9edb('0x27')]);if(_0xb5224b[_0x9edb('0x28')]){delete _0xb5224b[_0x9edb('0x28')];}_0x53283d['status'](_0x56e7e0)[_0x9edb('0x29')](_0xb5224b);};}exports[_0x9edb('0x2a')]=function(_0xd023c4,_0x1fbeb9){var _0x4ece72={},_0x22ca78={},_0x2ea5ab={'count':0x0,'rows':[]};var _0x5b1b53=_[_0x9edb('0x2b')](db[_0x9edb('0x2c')][_0x9edb('0x2d')],function(_0x55233d){return{'name':_0x55233d[_0x9edb('0x2e')],'type':_0x55233d[_0x9edb('0x2f')][_0x9edb('0x30')]};});_0x22ca78[_0x9edb('0x31')]=_['map'](_0x5b1b53,_0x9edb('0x28'));_0x22ca78[_0x9edb('0x32')]=_[_0x9edb('0x33')](_0xd023c4[_0x9edb('0x32')]);_0x22ca78[_0x9edb('0x34')]=_[_0x9edb('0x35')](_0x22ca78['model'],_0x22ca78['query']);_0x4ece72[_0x9edb('0x36')]=_[_0x9edb('0x35')](_0x22ca78['model'],qs[_0x9edb('0x37')](_0xd023c4[_0x9edb('0x32')]['fields']));_0x4ece72[_0x9edb('0x36')]=_0x4ece72[_0x9edb('0x36')][_0x9edb('0x38')]?_0x4ece72['attributes']:_0x22ca78[_0x9edb('0x31')];if(!_0xd023c4['query'][_0x9edb('0x39')]('nolimit')){_0x4ece72[_0x9edb('0x20')]=qs[_0x9edb('0x20')](_0xd023c4['query'][_0x9edb('0x20')]);_0x4ece72[_0x9edb('0x1d')]=qs[_0x9edb('0x1d')](_0xd023c4[_0x9edb('0x32')][_0x9edb('0x1d')]);}_0x4ece72[_0x9edb('0x3a')]=qs[_0x9edb('0x3b')](_0xd023c4[_0x9edb('0x32')]['sort']);_0x4ece72[_0x9edb('0x3c')]=qs[_0x9edb('0x34')](_['pick'](_0xd023c4[_0x9edb('0x32')],_0x22ca78[_0x9edb('0x34')]),_0x5b1b53);if(_0xd023c4['query'][_0x9edb('0x3d')]){_0x4ece72['where']=_[_0x9edb('0x3e')](_0x4ece72[_0x9edb('0x3c')],{'$or':_[_0x9edb('0x2b')](_0x5b1b53,function(_0x420ccb){if(_0x420ccb[_0x9edb('0x2f')]!==_0x9edb('0x3f')){var _0x53225e={};_0x53225e[_0x420ccb[_0x9edb('0x28')]]={'$like':'%'+_0xd023c4[_0x9edb('0x32')][_0x9edb('0x3d')]+'%'};return _0x53225e;}})});}_0x4ece72=_[_0x9edb('0x3e')]({},_0x4ece72,_0xd023c4[_0x9edb('0x40')]);var _0x2ed1f1={'where':_0x4ece72[_0x9edb('0x3c')]};return db[_0x9edb('0x2c')][_0x9edb('0x1f')](_0x2ed1f1)[_0x9edb('0x24')](function(_0x110e11){_0x2ea5ab['count']=_0x110e11;if(_0xd023c4[_0x9edb('0x32')]['includeAll']){_0x4ece72[_0x9edb('0x41')]=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x4ece72);})[_0x9edb('0x24')](function(_0xf9500){_0x2ea5ab[_0x9edb('0x42')]=_0xf9500;return _0x2ea5ab;})[_0x9edb('0x24')](respondWithFilteredResult(_0x1fbeb9,_0x4ece72))[_0x9edb('0x43')](handleError(_0x1fbeb9,null));};exports[_0x9edb('0x44')]=function(_0x2073f0,_0x44ad60){var _0x438c13={'raw':![],'where':{'id':_0x2073f0[_0x9edb('0x45')]['id']}},_0x1dee63={};_0x1dee63[_0x9edb('0x31')]=_[_0x9edb('0x33')](db['SugarcrmConfiguration'][_0x9edb('0x2d')]);_0x1dee63['query']=_[_0x9edb('0x33')](_0x2073f0[_0x9edb('0x32')]);_0x1dee63[_0x9edb('0x34')]=_[_0x9edb('0x35')](_0x1dee63['model'],_0x1dee63[_0x9edb('0x32')]);_0x438c13[_0x9edb('0x36')]=_[_0x9edb('0x35')](_0x1dee63[_0x9edb('0x31')],qs[_0x9edb('0x37')](_0x2073f0[_0x9edb('0x32')]['fields']));_0x438c13['attributes']=_0x438c13[_0x9edb('0x36')][_0x9edb('0x38')]?_0x438c13[_0x9edb('0x36')]:_0x1dee63[_0x9edb('0x31')];if(_0x2073f0[_0x9edb('0x32')][_0x9edb('0x46')]){_0x438c13['include']=[{'all':!![]}];}_0x438c13=_[_0x9edb('0x3e')]({},_0x438c13,_0x2073f0['options']);return db[_0x9edb('0x2c')][_0x9edb('0x47')](_0x438c13)['then'](handleEntityNotFound(_0x44ad60,null))['then'](respondWithResult(_0x44ad60,null))['catch'](handleError(_0x44ad60,null));};exports['create']=function(_0x2fde8f,_0x5fdf3d){return db[_0x9edb('0x2c')][_0x9edb('0x48')](_0x2fde8f['body'],{})[_0x9edb('0x24')](respondWithResult(_0x5fdf3d,0xc9))[_0x9edb('0x43')](handleError(_0x5fdf3d,null));};exports[_0x9edb('0x49')]=function(_0x412309,_0x343d1d){if(_0x412309[_0x9edb('0x4a')]['id']){delete _0x412309['body']['id'];}return db[_0x9edb('0x2c')][_0x9edb('0x47')]({'where':{'id':_0x412309[_0x9edb('0x45')]['id']}})['then'](handleEntityNotFound(_0x343d1d,null))['then'](saveUpdates(_0x412309['body'],null))[_0x9edb('0x24')](respondWithResult(_0x343d1d,null))[_0x9edb('0x43')](handleError(_0x343d1d,null));};exports[_0x9edb('0x25')]=function(_0x5bf28f,_0x2975c2){return db['SugarcrmConfiguration'][_0x9edb('0x47')]({'where':{'id':_0x5bf28f[_0x9edb('0x45')]['id']}})[_0x9edb('0x24')](handleEntityNotFound(_0x2975c2,null))[_0x9edb('0x24')](removeEntity(_0x2975c2,null))['catch'](handleError(_0x2975c2,null));};exports['getFields']=function(_0x3a9a51,_0x379a9b,_0x3bc2d5){var _0xcd8e74={};var _0xe0d560={};var _0x59d26c;var _0x2d78be;return db[_0x9edb('0x2c')][_0x9edb('0x4b')]({'where':{'id':_0x3a9a51['params']['id']}})[_0x9edb('0x24')](handleEntityNotFound(_0x379a9b,null))[_0x9edb('0x24')](function(_0xc084f1){if(_0xc084f1){_0x59d26c=_0xc084f1;_0xe0d560[_0x9edb('0x31')]=_['keys'](db[_0x9edb('0x4c')]['rawAttributes']);_0xe0d560[_0x9edb('0x32')]=_[_0x9edb('0x33')](_0x3a9a51['query']);_0xe0d560['filters']=_['intersection'](_0xe0d560['model'],_0xe0d560['query']);_0xcd8e74[_0x9edb('0x36')]=_[_0x9edb('0x35')](_0xe0d560[_0x9edb('0x31')],qs['fields'](_0x3a9a51[_0x9edb('0x32')][_0x9edb('0x37')]));_0xcd8e74['attributes']=_0xcd8e74[_0x9edb('0x36')]['length']?_0xcd8e74[_0x9edb('0x36')]:_0xe0d560[_0x9edb('0x31')];_0xcd8e74[_0x9edb('0x3a')]=qs[_0x9edb('0x3b')](_0x3a9a51[_0x9edb('0x32')][_0x9edb('0x3b')]);_0xcd8e74[_0x9edb('0x3c')]=qs[_0x9edb('0x34')](_[_0x9edb('0x4d')](_0x3a9a51[_0x9edb('0x32')],_0xe0d560[_0x9edb('0x34')]));if(_0x3a9a51[_0x9edb('0x32')][_0x9edb('0x3d')]){_0xcd8e74[_0x9edb('0x3c')]=_['merge'](_0xcd8e74['where'],{'$or':_[_0x9edb('0x2b')](_0xcd8e74[_0x9edb('0x36')],function(_0xefee54){var _0x1e045c={};_0x1e045c[_0xefee54]={'$like':'%'+_0x3a9a51[_0x9edb('0x32')][_0x9edb('0x3d')]+'%'};return _0x1e045c;})});}_0xcd8e74=_[_0x9edb('0x3e')]({},_0xcd8e74,_0x3a9a51[_0x9edb('0x40')]);return _0x59d26c[_0x9edb('0x4e')](_0xcd8e74);}})[_0x9edb('0x24')](function(_0x353fbc){if(_0x353fbc){_0x2d78be=_0x353fbc[_0x9edb('0x38')];if(!_0x3a9a51[_0x9edb('0x32')][_0x9edb('0x39')](_0x9edb('0x4f'))){_0xcd8e74[_0x9edb('0x20')]=qs[_0x9edb('0x20')](_0x3a9a51['query'][_0x9edb('0x20')]);_0xcd8e74[_0x9edb('0x1d')]=qs[_0x9edb('0x1d')](_0x3a9a51['query'][_0x9edb('0x1d')]);}return _0x59d26c[_0x9edb('0x4e')](_0xcd8e74);}})['then'](function(_0x36f2ca){if(_0x36f2ca){return _0x36f2ca?{'count':_0x2d78be,'rows':_0x36f2ca}:null;}})['then'](respondWithResult(_0x379a9b,null))[_0x9edb('0x43')](handleError(_0x379a9b,null));};exports['getSubjects']=function(_0x1e9d0e,_0x31e2bb,_0x20a677){var _0x2c38b8={};var _0x2c24dc={};var _0x59ec1b;var _0x300878;return db[_0x9edb('0x2c')][_0x9edb('0x4b')]({'where':{'id':_0x1e9d0e[_0x9edb('0x45')]['id']}})[_0x9edb('0x24')](handleEntityNotFound(_0x31e2bb,null))[_0x9edb('0x24')](function(_0x8ca2ae){if(_0x8ca2ae){_0x59ec1b=_0x8ca2ae;_0x2c24dc[_0x9edb('0x31')]=_[_0x9edb('0x33')](db['SugarcrmField'][_0x9edb('0x2d')]);_0x2c24dc['query']=_[_0x9edb('0x33')](_0x1e9d0e[_0x9edb('0x32')]);_0x2c24dc['filters']=_['intersection'](_0x2c24dc[_0x9edb('0x31')],_0x2c24dc[_0x9edb('0x32')]);_0x2c38b8[_0x9edb('0x36')]=_[_0x9edb('0x35')](_0x2c24dc[_0x9edb('0x31')],qs[_0x9edb('0x37')](_0x1e9d0e[_0x9edb('0x32')][_0x9edb('0x37')]));_0x2c38b8[_0x9edb('0x36')]=_0x2c38b8['attributes'][_0x9edb('0x38')]?_0x2c38b8[_0x9edb('0x36')]:_0x2c24dc[_0x9edb('0x31')];_0x2c38b8['order']=qs['sort'](_0x1e9d0e[_0x9edb('0x32')]['sort']);_0x2c38b8[_0x9edb('0x3c')]=qs[_0x9edb('0x34')](_[_0x9edb('0x4d')](_0x1e9d0e['query'],_0x2c24dc[_0x9edb('0x34')]));if(_0x1e9d0e[_0x9edb('0x32')][_0x9edb('0x3d')]){_0x2c38b8['where']=_[_0x9edb('0x3e')](_0x2c38b8[_0x9edb('0x3c')],{'$or':_[_0x9edb('0x2b')](_0x2c38b8['attributes'],function(_0x3f7a50){var _0x52d4c7={};_0x52d4c7[_0x3f7a50]={'$like':'%'+_0x1e9d0e[_0x9edb('0x32')][_0x9edb('0x3d')]+'%'};return _0x52d4c7;})});}_0x2c38b8=_['merge']({},_0x2c38b8,_0x1e9d0e['options']);return _0x59ec1b[_0x9edb('0x50')](_0x2c38b8);}})['then'](function(_0x8d7c42){if(_0x8d7c42){_0x300878=_0x8d7c42[_0x9edb('0x38')];if(!_0x1e9d0e[_0x9edb('0x32')][_0x9edb('0x39')](_0x9edb('0x4f'))){_0x2c38b8[_0x9edb('0x20')]=qs['limit'](_0x1e9d0e[_0x9edb('0x32')]['limit']);_0x2c38b8[_0x9edb('0x1d')]=qs[_0x9edb('0x1d')](_0x1e9d0e['query']['offset']);}return _0x59ec1b['getSubjects'](_0x2c38b8);}})[_0x9edb('0x24')](function(_0x2ffd30){if(_0x2ffd30){return _0x2ffd30?{'count':_0x300878,'rows':_0x2ffd30}:null;}})[_0x9edb('0x24')](respondWithResult(_0x31e2bb,null))[_0x9edb('0x43')](handleError(_0x31e2bb,null));};exports[_0x9edb('0x51')]=function(_0x4fbdfb,_0x12adca,_0x4b4aa2){var _0x41842d={};var _0x45fa37={};var _0x3c4a51;var _0x319d0d;return db[_0x9edb('0x2c')][_0x9edb('0x4b')]({'where':{'id':_0x4fbdfb[_0x9edb('0x45')]['id']}})['then'](handleEntityNotFound(_0x12adca,null))[_0x9edb('0x24')](function(_0x5bc9c2){if(_0x5bc9c2){_0x3c4a51=_0x5bc9c2;_0x45fa37[_0x9edb('0x31')]=_[_0x9edb('0x33')](db['SugarcrmField'][_0x9edb('0x2d')]);_0x45fa37[_0x9edb('0x32')]=_[_0x9edb('0x33')](_0x4fbdfb[_0x9edb('0x32')]);_0x45fa37[_0x9edb('0x34')]=_['intersection'](_0x45fa37[_0x9edb('0x31')],_0x45fa37[_0x9edb('0x32')]);_0x41842d[_0x9edb('0x36')]=_[_0x9edb('0x35')](_0x45fa37[_0x9edb('0x31')],qs[_0x9edb('0x37')](_0x4fbdfb['query'][_0x9edb('0x37')]));_0x41842d[_0x9edb('0x36')]=_0x41842d[_0x9edb('0x36')][_0x9edb('0x38')]?_0x41842d[_0x9edb('0x36')]:_0x45fa37['model'];_0x41842d[_0x9edb('0x3a')]=qs['sort'](_0x4fbdfb[_0x9edb('0x32')]['sort']);_0x41842d['where']=qs[_0x9edb('0x34')](_[_0x9edb('0x4d')](_0x4fbdfb[_0x9edb('0x32')],_0x45fa37['filters']));if(_0x4fbdfb['query'][_0x9edb('0x3d')]){_0x41842d[_0x9edb('0x3c')]=_[_0x9edb('0x3e')](_0x41842d[_0x9edb('0x3c')],{'$or':_[_0x9edb('0x2b')](_0x41842d[_0x9edb('0x36')],function(_0x4e0a61){var _0x40d380={};_0x40d380[_0x4e0a61]={'$like':'%'+_0x4fbdfb[_0x9edb('0x32')]['filter']+'%'};return _0x40d380;})});}_0x41842d=_['merge']({},_0x41842d,_0x4fbdfb['options']);return _0x3c4a51[_0x9edb('0x51')](_0x41842d);}})[_0x9edb('0x24')](function(_0x260fde){if(_0x260fde){_0x319d0d=_0x260fde[_0x9edb('0x38')];if(!_0x4fbdfb['query']['hasOwnProperty'](_0x9edb('0x4f'))){_0x41842d['limit']=qs[_0x9edb('0x20')](_0x4fbdfb['query'][_0x9edb('0x20')]);_0x41842d[_0x9edb('0x1d')]=qs[_0x9edb('0x1d')](_0x4fbdfb[_0x9edb('0x32')]['offset']);}return _0x3c4a51[_0x9edb('0x51')](_0x41842d);}})['then'](function(_0x10bf84){if(_0x10bf84){return _0x10bf84?{'count':_0x319d0d,'rows':_0x10bf84}:null;}})[_0x9edb('0x24')](respondWithResult(_0x12adca,null))[_0x9edb('0x43')](handleError(_0x12adca,null));}; \ No newline at end of file +var _0xb846=['offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','type','options','SugarcrmConfiguration','includeAll','findAll','rows','catch','show','params','include','find','create','body','getFields','findOne','keys','SugarcrmField','hasOwnProperty','getSubjects','order','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x1d3812,_0x3765f7){var _0x2f615f=function(_0x4e8621){while(--_0x4e8621){_0x1d3812['push'](_0x1d3812['shift']());}};_0x2f615f(++_0x3765f7);}(_0xb846,0xd7));var _0x6b84=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb846[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x6b84('0x0'));var rimraf=require(_0x6b84('0x1'));var zipdir=require(_0x6b84('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b84('0x3'));var moment=require(_0x6b84('0x4'));var BPromise=require(_0x6b84('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6b84('0x6'));var sox=require('sox');var csv=require(_0x6b84('0x7'));var ejs=require(_0x6b84('0x8'));var fs=require('fs');var fs_extra=require(_0x6b84('0x9'));var _=require(_0x6b84('0xa'));var squel=require(_0x6b84('0xb'));var crypto=require(_0x6b84('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6b84('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6b84('0xe'));var Papa=require(_0x6b84('0xf'));var Redis=require('ioredis');var authService=require(_0x6b84('0x10'));var qs=require(_0x6b84('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6b84('0x12'));var logger=require(_0x6b84('0x13'))(_0x6b84('0x14'));var utils=require(_0x6b84('0x15'));var config=require(_0x6b84('0x16'));var licenseUtil=require(_0x6b84('0x17'));var db=require(_0x6b84('0x18'))['db'];function respondWithStatusCode(_0x29940e,_0x4d54ba){_0x4d54ba=_0x4d54ba||0xcc;return function(_0x1f91e8){if(_0x1f91e8){return _0x29940e[_0x6b84('0x19')](_0x4d54ba);}return _0x29940e[_0x6b84('0x1a')](_0x4d54ba)['end']();};}function respondWithResult(_0x3975bb,_0x359f1e){_0x359f1e=_0x359f1e||0xc8;return function(_0x2dec6c){if(_0x2dec6c){return _0x3975bb[_0x6b84('0x1a')](_0x359f1e)[_0x6b84('0x1b')](_0x2dec6c);}};}function respondWithFilteredResult(_0x1d5586,_0x4425e5){return function(_0x9a789c){if(_0x9a789c){var _0x444e80=typeof _0x4425e5[_0x6b84('0x1c')]===_0x6b84('0x1d')&&typeof _0x4425e5[_0x6b84('0x1e')]===_0x6b84('0x1d');var _0x54f863=_0x9a789c[_0x6b84('0x1f')];var _0x5dffdd=_0x444e80?0x0:_0x4425e5[_0x6b84('0x1c')];var _0x108d05=_0x444e80?_0x9a789c['count']:_0x4425e5[_0x6b84('0x1c')]+_0x4425e5['limit'];var _0x34c2b9;if(_0x108d05>=_0x54f863){_0x108d05=_0x54f863;_0x34c2b9=0xc8;}else{_0x34c2b9=0xce;}_0x1d5586['status'](_0x34c2b9);return _0x1d5586['set'](_0x6b84('0x20'),_0x5dffdd+'-'+_0x108d05+'/'+_0x54f863)[_0x6b84('0x1b')](_0x9a789c);}return null;};}function patchUpdates(_0x37caae){return function(_0x59ff7c){try{jsonpatch[_0x6b84('0x21')](_0x59ff7c,_0x37caae,!![]);}catch(_0x469308){return BPromise['reject'](_0x469308);}return _0x59ff7c[_0x6b84('0x22')]();};}function saveUpdates(_0x5c8475,_0x3d4437){return function(_0x52be41){if(_0x52be41){return _0x52be41[_0x6b84('0x23')](_0x5c8475)['then'](function(_0x5696c9){return _0x5696c9;});}return null;};}function removeEntity(_0x20d23d,_0x3e5584){return function(_0x2f09ad){if(_0x2f09ad){return _0x2f09ad[_0x6b84('0x24')]()[_0x6b84('0x25')](function(){_0x20d23d[_0x6b84('0x1a')](0xcc)[_0x6b84('0x26')]();});}};}function handleEntityNotFound(_0x14c652,_0x1a69fd){return function(_0xb5f110){if(!_0xb5f110){_0x14c652[_0x6b84('0x19')](0x194);}return _0xb5f110;};}function handleError(_0xaf8fb9,_0x40962c){_0x40962c=_0x40962c||0x1f4;return function(_0x1c3230){logger[_0x6b84('0x27')](_0x1c3230[_0x6b84('0x28')]);if(_0x1c3230[_0x6b84('0x29')]){delete _0x1c3230['name'];}_0xaf8fb9[_0x6b84('0x1a')](_0x40962c)[_0x6b84('0x2a')](_0x1c3230);};}exports[_0x6b84('0x2b')]=function(_0x254cc9,_0x31aff5){var _0x4efab2={},_0x557a2f={},_0x53fde2={'count':0x0,'rows':[]};var _0x65f89d=_[_0x6b84('0x2c')](db['SugarcrmConfiguration'][_0x6b84('0x2d')],function(_0x3427ea){return{'name':_0x3427ea[_0x6b84('0x2e')],'type':_0x3427ea['type']['key']};});_0x557a2f[_0x6b84('0x2f')]=_[_0x6b84('0x2c')](_0x65f89d,_0x6b84('0x29'));_0x557a2f[_0x6b84('0x30')]=_['keys'](_0x254cc9[_0x6b84('0x30')]);_0x557a2f[_0x6b84('0x31')]=_[_0x6b84('0x32')](_0x557a2f[_0x6b84('0x2f')],_0x557a2f[_0x6b84('0x30')]);_0x4efab2[_0x6b84('0x33')]=_[_0x6b84('0x32')](_0x557a2f[_0x6b84('0x2f')],qs[_0x6b84('0x34')](_0x254cc9[_0x6b84('0x30')]['fields']));_0x4efab2[_0x6b84('0x33')]=_0x4efab2[_0x6b84('0x33')][_0x6b84('0x35')]?_0x4efab2['attributes']:_0x557a2f[_0x6b84('0x2f')];if(!_0x254cc9[_0x6b84('0x30')]['hasOwnProperty'](_0x6b84('0x36'))){_0x4efab2[_0x6b84('0x1e')]=qs[_0x6b84('0x1e')](_0x254cc9[_0x6b84('0x30')][_0x6b84('0x1e')]);_0x4efab2[_0x6b84('0x1c')]=qs[_0x6b84('0x1c')](_0x254cc9['query'][_0x6b84('0x1c')]);}_0x4efab2['order']=qs[_0x6b84('0x37')](_0x254cc9[_0x6b84('0x30')][_0x6b84('0x37')]);_0x4efab2['where']=qs[_0x6b84('0x31')](_[_0x6b84('0x38')](_0x254cc9['query'],_0x557a2f[_0x6b84('0x31')]),_0x65f89d);if(_0x254cc9[_0x6b84('0x30')][_0x6b84('0x39')]){_0x4efab2[_0x6b84('0x3a')]=_[_0x6b84('0x3b')](_0x4efab2[_0x6b84('0x3a')],{'$or':_[_0x6b84('0x2c')](_0x65f89d,function(_0x3302c0){if(_0x3302c0[_0x6b84('0x3c')]!=='VIRTUAL'){var _0x26d6df={};_0x26d6df[_0x3302c0[_0x6b84('0x29')]]={'$like':'%'+_0x254cc9[_0x6b84('0x30')][_0x6b84('0x39')]+'%'};return _0x26d6df;}})});}_0x4efab2=_[_0x6b84('0x3b')]({},_0x4efab2,_0x254cc9[_0x6b84('0x3d')]);var _0x56466f={'where':_0x4efab2['where']};return db[_0x6b84('0x3e')][_0x6b84('0x1f')](_0x56466f)[_0x6b84('0x25')](function(_0x3b0efa){_0x53fde2[_0x6b84('0x1f')]=_0x3b0efa;if(_0x254cc9[_0x6b84('0x30')][_0x6b84('0x3f')]){_0x4efab2['include']=[{'all':!![]}];}return db[_0x6b84('0x3e')][_0x6b84('0x40')](_0x4efab2);})[_0x6b84('0x25')](function(_0x228ff9){_0x53fde2[_0x6b84('0x41')]=_0x228ff9;return _0x53fde2;})[_0x6b84('0x25')](respondWithFilteredResult(_0x31aff5,_0x4efab2))[_0x6b84('0x42')](handleError(_0x31aff5,null));};exports[_0x6b84('0x43')]=function(_0x3e162e,_0x33a752){var _0x3f5c6a={'raw':![],'where':{'id':_0x3e162e[_0x6b84('0x44')]['id']}},_0x125f40={};_0x125f40[_0x6b84('0x2f')]=_['keys'](db['SugarcrmConfiguration'][_0x6b84('0x2d')]);_0x125f40[_0x6b84('0x30')]=_['keys'](_0x3e162e[_0x6b84('0x30')]);_0x125f40[_0x6b84('0x31')]=_[_0x6b84('0x32')](_0x125f40[_0x6b84('0x2f')],_0x125f40[_0x6b84('0x30')]);_0x3f5c6a[_0x6b84('0x33')]=_[_0x6b84('0x32')](_0x125f40[_0x6b84('0x2f')],qs[_0x6b84('0x34')](_0x3e162e[_0x6b84('0x30')]['fields']));_0x3f5c6a[_0x6b84('0x33')]=_0x3f5c6a[_0x6b84('0x33')][_0x6b84('0x35')]?_0x3f5c6a['attributes']:_0x125f40[_0x6b84('0x2f')];if(_0x3e162e[_0x6b84('0x30')][_0x6b84('0x3f')]){_0x3f5c6a[_0x6b84('0x45')]=[{'all':!![]}];}_0x3f5c6a=_[_0x6b84('0x3b')]({},_0x3f5c6a,_0x3e162e[_0x6b84('0x3d')]);return db[_0x6b84('0x3e')][_0x6b84('0x46')](_0x3f5c6a)[_0x6b84('0x25')](handleEntityNotFound(_0x33a752,null))[_0x6b84('0x25')](respondWithResult(_0x33a752,null))[_0x6b84('0x42')](handleError(_0x33a752,null));};exports[_0x6b84('0x47')]=function(_0x5a448f,_0x5262b1){return db[_0x6b84('0x3e')][_0x6b84('0x47')](_0x5a448f[_0x6b84('0x48')],{})[_0x6b84('0x25')](respondWithResult(_0x5262b1,0xc9))['catch'](handleError(_0x5262b1,null));};exports[_0x6b84('0x23')]=function(_0x1ffbba,_0x3c957d){if(_0x1ffbba[_0x6b84('0x48')]['id']){delete _0x1ffbba['body']['id'];}return db[_0x6b84('0x3e')][_0x6b84('0x46')]({'where':{'id':_0x1ffbba[_0x6b84('0x44')]['id']}})[_0x6b84('0x25')](handleEntityNotFound(_0x3c957d,null))['then'](saveUpdates(_0x1ffbba[_0x6b84('0x48')],null))['then'](respondWithResult(_0x3c957d,null))[_0x6b84('0x42')](handleError(_0x3c957d,null));};exports['destroy']=function(_0x392950,_0xcb9ca1){return db[_0x6b84('0x3e')][_0x6b84('0x46')]({'where':{'id':_0x392950[_0x6b84('0x44')]['id']}})['then'](handleEntityNotFound(_0xcb9ca1,null))['then'](removeEntity(_0xcb9ca1,null))[_0x6b84('0x42')](handleError(_0xcb9ca1,null));};exports[_0x6b84('0x49')]=function(_0x5562b5,_0x34deb6,_0x58bd45){var _0x5c5998={};var _0xc25e7a={};var _0x28cc20;var _0x1d8617;return db[_0x6b84('0x3e')][_0x6b84('0x4a')]({'where':{'id':_0x5562b5[_0x6b84('0x44')]['id']}})[_0x6b84('0x25')](handleEntityNotFound(_0x34deb6,null))[_0x6b84('0x25')](function(_0x118113){if(_0x118113){_0x28cc20=_0x118113;_0xc25e7a[_0x6b84('0x2f')]=_[_0x6b84('0x4b')](db[_0x6b84('0x4c')][_0x6b84('0x2d')]);_0xc25e7a[_0x6b84('0x30')]=_[_0x6b84('0x4b')](_0x5562b5[_0x6b84('0x30')]);_0xc25e7a[_0x6b84('0x31')]=_[_0x6b84('0x32')](_0xc25e7a['model'],_0xc25e7a[_0x6b84('0x30')]);_0x5c5998[_0x6b84('0x33')]=_[_0x6b84('0x32')](_0xc25e7a[_0x6b84('0x2f')],qs[_0x6b84('0x34')](_0x5562b5[_0x6b84('0x30')][_0x6b84('0x34')]));_0x5c5998[_0x6b84('0x33')]=_0x5c5998[_0x6b84('0x33')][_0x6b84('0x35')]?_0x5c5998['attributes']:_0xc25e7a[_0x6b84('0x2f')];_0x5c5998['order']=qs['sort'](_0x5562b5[_0x6b84('0x30')][_0x6b84('0x37')]);_0x5c5998[_0x6b84('0x3a')]=qs[_0x6b84('0x31')](_[_0x6b84('0x38')](_0x5562b5['query'],_0xc25e7a[_0x6b84('0x31')]));if(_0x5562b5[_0x6b84('0x30')]['filter']){_0x5c5998[_0x6b84('0x3a')]=_[_0x6b84('0x3b')](_0x5c5998[_0x6b84('0x3a')],{'$or':_[_0x6b84('0x2c')](_0x5c5998[_0x6b84('0x33')],function(_0x704c3){var _0x362cb4={};_0x362cb4[_0x704c3]={'$like':'%'+_0x5562b5[_0x6b84('0x30')][_0x6b84('0x39')]+'%'};return _0x362cb4;})});}_0x5c5998=_[_0x6b84('0x3b')]({},_0x5c5998,_0x5562b5['options']);return _0x28cc20['getFields'](_0x5c5998);}})['then'](function(_0x7fff70){if(_0x7fff70){_0x1d8617=_0x7fff70[_0x6b84('0x35')];if(!_0x5562b5['query'][_0x6b84('0x4d')]('nolimit')){_0x5c5998['limit']=qs['limit'](_0x5562b5[_0x6b84('0x30')][_0x6b84('0x1e')]);_0x5c5998[_0x6b84('0x1c')]=qs[_0x6b84('0x1c')](_0x5562b5['query'][_0x6b84('0x1c')]);}return _0x28cc20[_0x6b84('0x49')](_0x5c5998);}})[_0x6b84('0x25')](function(_0x156b49){if(_0x156b49){return _0x156b49?{'count':_0x1d8617,'rows':_0x156b49}:null;}})[_0x6b84('0x25')](respondWithResult(_0x34deb6,null))[_0x6b84('0x42')](handleError(_0x34deb6,null));};exports[_0x6b84('0x4e')]=function(_0x2c8bbf,_0x28b227,_0x295124){var _0x4b9947={};var _0x1dd79c={};var _0xadcbe5;var _0xf33831;return db['SugarcrmConfiguration'][_0x6b84('0x4a')]({'where':{'id':_0x2c8bbf[_0x6b84('0x44')]['id']}})[_0x6b84('0x25')](handleEntityNotFound(_0x28b227,null))[_0x6b84('0x25')](function(_0x517f8c){if(_0x517f8c){_0xadcbe5=_0x517f8c;_0x1dd79c[_0x6b84('0x2f')]=_['keys'](db[_0x6b84('0x4c')]['rawAttributes']);_0x1dd79c[_0x6b84('0x30')]=_[_0x6b84('0x4b')](_0x2c8bbf[_0x6b84('0x30')]);_0x1dd79c[_0x6b84('0x31')]=_[_0x6b84('0x32')](_0x1dd79c[_0x6b84('0x2f')],_0x1dd79c[_0x6b84('0x30')]);_0x4b9947['attributes']=_[_0x6b84('0x32')](_0x1dd79c[_0x6b84('0x2f')],qs[_0x6b84('0x34')](_0x2c8bbf['query']['fields']));_0x4b9947['attributes']=_0x4b9947['attributes']['length']?_0x4b9947[_0x6b84('0x33')]:_0x1dd79c[_0x6b84('0x2f')];_0x4b9947[_0x6b84('0x4f')]=qs[_0x6b84('0x37')](_0x2c8bbf[_0x6b84('0x30')][_0x6b84('0x37')]);_0x4b9947['where']=qs[_0x6b84('0x31')](_[_0x6b84('0x38')](_0x2c8bbf[_0x6b84('0x30')],_0x1dd79c['filters']));if(_0x2c8bbf['query']['filter']){_0x4b9947[_0x6b84('0x3a')]=_[_0x6b84('0x3b')](_0x4b9947['where'],{'$or':_[_0x6b84('0x2c')](_0x4b9947[_0x6b84('0x33')],function(_0x11ae52){var _0x3fda65={};_0x3fda65[_0x11ae52]={'$like':'%'+_0x2c8bbf[_0x6b84('0x30')][_0x6b84('0x39')]+'%'};return _0x3fda65;})});}_0x4b9947=_[_0x6b84('0x3b')]({},_0x4b9947,_0x2c8bbf[_0x6b84('0x3d')]);return _0xadcbe5['getSubjects'](_0x4b9947);}})[_0x6b84('0x25')](function(_0x5339cc){if(_0x5339cc){_0xf33831=_0x5339cc[_0x6b84('0x35')];if(!_0x2c8bbf[_0x6b84('0x30')][_0x6b84('0x4d')](_0x6b84('0x36'))){_0x4b9947[_0x6b84('0x1e')]=qs['limit'](_0x2c8bbf[_0x6b84('0x30')]['limit']);_0x4b9947[_0x6b84('0x1c')]=qs[_0x6b84('0x1c')](_0x2c8bbf[_0x6b84('0x30')]['offset']);}return _0xadcbe5[_0x6b84('0x4e')](_0x4b9947);}})[_0x6b84('0x25')](function(_0x43c6cf){if(_0x43c6cf){return _0x43c6cf?{'count':_0xf33831,'rows':_0x43c6cf}:null;}})[_0x6b84('0x25')](respondWithResult(_0x28b227,null))[_0x6b84('0x42')](handleError(_0x28b227,null));};exports[_0x6b84('0x50')]=function(_0x1c0527,_0x1edbef,_0x26e8a0){var _0x1815ec={};var _0x400a72={};var _0x3326c2;var _0x500e07;return db[_0x6b84('0x3e')][_0x6b84('0x4a')]({'where':{'id':_0x1c0527[_0x6b84('0x44')]['id']}})[_0x6b84('0x25')](handleEntityNotFound(_0x1edbef,null))[_0x6b84('0x25')](function(_0x5a964d){if(_0x5a964d){_0x3326c2=_0x5a964d;_0x400a72[_0x6b84('0x2f')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x400a72['query']=_['keys'](_0x1c0527['query']);_0x400a72[_0x6b84('0x31')]=_['intersection'](_0x400a72[_0x6b84('0x2f')],_0x400a72[_0x6b84('0x30')]);_0x1815ec[_0x6b84('0x33')]=_[_0x6b84('0x32')](_0x400a72[_0x6b84('0x2f')],qs[_0x6b84('0x34')](_0x1c0527[_0x6b84('0x30')]['fields']));_0x1815ec['attributes']=_0x1815ec[_0x6b84('0x33')][_0x6b84('0x35')]?_0x1815ec[_0x6b84('0x33')]:_0x400a72[_0x6b84('0x2f')];_0x1815ec[_0x6b84('0x4f')]=qs[_0x6b84('0x37')](_0x1c0527[_0x6b84('0x30')]['sort']);_0x1815ec['where']=qs[_0x6b84('0x31')](_[_0x6b84('0x38')](_0x1c0527[_0x6b84('0x30')],_0x400a72[_0x6b84('0x31')]));if(_0x1c0527[_0x6b84('0x30')][_0x6b84('0x39')]){_0x1815ec[_0x6b84('0x3a')]=_[_0x6b84('0x3b')](_0x1815ec['where'],{'$or':_['map'](_0x1815ec[_0x6b84('0x33')],function(_0x26bcb2){var _0x2e1d16={};_0x2e1d16[_0x26bcb2]={'$like':'%'+_0x1c0527[_0x6b84('0x30')][_0x6b84('0x39')]+'%'};return _0x2e1d16;})});}_0x1815ec=_[_0x6b84('0x3b')]({},_0x1815ec,_0x1c0527[_0x6b84('0x3d')]);return _0x3326c2[_0x6b84('0x50')](_0x1815ec);}})[_0x6b84('0x25')](function(_0x4ca81c){if(_0x4ca81c){_0x500e07=_0x4ca81c['length'];if(!_0x1c0527[_0x6b84('0x30')][_0x6b84('0x4d')](_0x6b84('0x36'))){_0x1815ec[_0x6b84('0x1e')]=qs[_0x6b84('0x1e')](_0x1c0527[_0x6b84('0x30')][_0x6b84('0x1e')]);_0x1815ec[_0x6b84('0x1c')]=qs[_0x6b84('0x1c')](_0x1c0527[_0x6b84('0x30')][_0x6b84('0x1c')]);}return _0x3326c2[_0x6b84('0x50')](_0x1815ec);}})[_0x6b84('0x25')](function(_0x54d832){if(_0x54d832){return _0x54d832?{'count':_0x500e07,'rows':_0x54d832}:null;}})[_0x6b84('0x25')](respondWithResult(_0x1edbef,null))[_0x6b84('0x42')](handleError(_0x1edbef,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index b196e2c..4e319e5 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 _0x92b3=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash'];(function(_0xd37e3d,_0x5c9573){var _0xff1ac0=function(_0x32edb7){while(--_0x32edb7){_0xd37e3d['push'](_0xd37e3d['shift']());}};_0xff1ac0(++_0x5c9573);}(_0x92b3,0x8e));var _0x392b=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x92b3[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x392b('0x0'));var util=require(_0x392b('0x1'));var logger=require('../../config/logger')(_0x392b('0x2'));var moment=require(_0x392b('0x3'));var BPromise=require(_0x392b('0x4'));var rp=require(_0x392b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x392b('0x6'));var config=require(_0x392b('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x5643ca,_0x53e376){return _0x5643ca[_0x392b('0x8')](_0x392b('0x9'),attributes,{'tableName':_0x392b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x812d=['exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x812d,0x184));var _0xd812=function(_0x55f320,_0x3a894c){_0x55f320=_0x55f320-0x0;var _0x429838=_0x812d[_0x55f320];return _0x429838;};'use strict';var _=require(_0xd812('0x0'));var util=require(_0xd812('0x1'));var logger=require(_0xd812('0x2'))('api');var moment=require(_0xd812('0x3'));var BPromise=require('bluebird');var rp=require(_0xd812('0x4'));var fs=require('fs');var path=require(_0xd812('0x5'));var rimraf=require(_0xd812('0x6'));var config=require('../../config/environment');var attributes=require(_0xd812('0x7'));module[_0xd812('0x8')]=function(_0x5d38a6,_0x29e83c){return _0x5d38a6['define'](_0xd812('0x9'),attributes,{'tableName':_0xd812('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index ceaa508..c110b05 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 _0x3bdf=['client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x35097a,_0x224314){var _0x3f6d33=function(_0x507d8d){while(--_0x507d8d){_0x35097a['push'](_0x35097a['shift']());}};_0x3f6d33(++_0x224314);}(_0x3bdf,0x123));var _0xf3bd=function(_0x3670d3,_0xf2a0be){_0x3670d3=_0x3670d3-0x0;var _0x210058=_0x3bdf[_0x3670d3];return _0x210058;};'use strict';var _=require(_0xf3bd('0x0'));var util=require('util');var moment=require(_0xf3bd('0x1'));var BPromise=require(_0xf3bd('0x2'));var rs=require(_0xf3bd('0x3'));var fs=require('fs');var Redis=require(_0xf3bd('0x4'));var db=require(_0xf3bd('0x5'))['db'];var utils=require(_0xf3bd('0x6'));var logger=require('../../config/logger')(_0xf3bd('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf3bd('0x8')][_0xf3bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53eb7e,_0x21d6c8,_0x4e560c){return new BPromise(function(_0x5af459,_0x37eada){return client[_0xf3bd('0xa')](_0x53eb7e,_0x4e560c)[_0xf3bd('0xb')](function(_0x33ad6c){logger[_0xf3bd('0xc')](_0xf3bd('0xd'),_0x21d6c8,_0xf3bd('0xe'));logger[_0xf3bd('0xf')](_0xf3bd('0x10'),_0x21d6c8,_0xf3bd('0xe'),JSON[_0xf3bd('0x11')](_0x33ad6c));if(_0x33ad6c[_0xf3bd('0x12')]){if(_0x33ad6c[_0xf3bd('0x12')][_0xf3bd('0x13')]===0x1f4){logger['error'](_0xf3bd('0xd'),_0x21d6c8,_0x33ad6c[_0xf3bd('0x12')][_0xf3bd('0x14')]);return _0x37eada(_0x33ad6c['error'][_0xf3bd('0x14')]);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x21d6c8,_0x33ad6c[_0xf3bd('0x12')][_0xf3bd('0x14')]);return _0x5af459(_0x33ad6c['error'][_0xf3bd('0x14')]);}else{logger[_0xf3bd('0xc')](_0xf3bd('0xd'),_0x21d6c8,_0xf3bd('0xe'));_0x5af459(_0x33ad6c[_0xf3bd('0x15')][_0xf3bd('0x14')]);}})[_0xf3bd('0x16')](function(_0x924b1d){logger['error'](_0xf3bd('0xd'),_0x21d6c8,_0x924b1d);_0x37eada(_0x924b1d);});});} \ No newline at end of file +var _0x0e82=['bluebird','randomstring','ioredis','../../config/logger','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment'];(function(_0x5d097a,_0x545b87){var _0x518a9c=function(_0x380b58){while(--_0x380b58){_0x5d097a['push'](_0x5d097a['shift']());}};_0x518a9c(++_0x545b87);}(_0x0e82,0xc5));var _0x20e8=function(_0x450ae4,_0x55d461){_0x450ae4=_0x450ae4-0x0;var _0x231956=_0x0e82[_0x450ae4];return _0x231956;};'use strict';var _=require(_0x20e8('0x0'));var util=require(_0x20e8('0x1'));var moment=require(_0x20e8('0x2'));var BPromise=require(_0x20e8('0x3'));var rs=require(_0x20e8('0x4'));var fs=require('fs');var Redis=require(_0x20e8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x20e8('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x20e8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a6b89,_0x337dce,_0x5a5bf7){return new BPromise(function(_0x291b1d,_0x241f3c){return client[_0x20e8('0x8')](_0x3a6b89,_0x5a5bf7)[_0x20e8('0x9')](function(_0x4b3795){logger[_0x20e8('0xa')](_0x20e8('0xb'),_0x337dce,'request\x20sent');logger[_0x20e8('0xc')](_0x20e8('0xd'),_0x337dce,'request\x20sent',JSON[_0x20e8('0xe')](_0x4b3795));if(_0x4b3795[_0x20e8('0xf')]){if(_0x4b3795['error'][_0x20e8('0x10')]===0x1f4){logger[_0x20e8('0xf')](_0x20e8('0xb'),_0x337dce,_0x4b3795['error'][_0x20e8('0x11')]);return _0x241f3c(_0x4b3795['error'][_0x20e8('0x11')]);}logger[_0x20e8('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x337dce,_0x4b3795[_0x20e8('0xf')]['message']);return _0x291b1d(_0x4b3795[_0x20e8('0xf')][_0x20e8('0x11')]);}else{logger[_0x20e8('0xa')](_0x20e8('0xb'),_0x337dce,_0x20e8('0x12'));_0x291b1d(_0x4b3795['result'][_0x20e8('0x11')]);}})[_0x20e8('0x13')](function(_0xabc2f6){logger[_0x20e8('0xf')](_0x20e8('0xb'),_0x337dce,_0xabc2f6);_0x241f3c(_0xabc2f6);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index a08346d..c802f74 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 _0xbb07=['put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id'];(function(_0x326d0d,_0x568038){var _0x397247=function(_0x433f2f){while(--_0x433f2f){_0x326d0d['push'](_0x326d0d['shift']());}};_0x397247(++_0x568038);}(_0xbb07,0x112));var _0x7bb0=function(_0x4cffd8,_0x3db38e){_0x4cffd8=_0x4cffd8-0x0;var _0x3caec7=_0xbb07[_0x4cffd8];return _0x3caec7;};'use strict';var multer=require(_0x7bb0('0x0'));var util=require(_0x7bb0('0x1'));var path=require('path');var timeout=require(_0x7bb0('0x2'));var express=require(_0x7bb0('0x3'));var router=express[_0x7bb0('0x4')]();var fs_extra=require(_0x7bb0('0x5'));var auth=require(_0x7bb0('0x6'));var interaction=require(_0x7bb0('0x7'));var config=require(_0x7bb0('0x8'));var controller=require(_0x7bb0('0x9'));router[_0x7bb0('0xa')]('/',auth[_0x7bb0('0xb')](),controller[_0x7bb0('0xc')]);router[_0x7bb0('0xa')](_0x7bb0('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7bb0('0xe')](_0x7bb0('0xd'),auth[_0x7bb0('0xb')](),controller[_0x7bb0('0xf')]);router[_0x7bb0('0x10')](_0x7bb0('0xd'),auth[_0x7bb0('0xb')](),controller[_0x7bb0('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb474=['post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated'];(function(_0xb1c200,_0x5ef416){var _0x352ca6=function(_0x18b16e){while(--_0x18b16e){_0xb1c200['push'](_0xb1c200['shift']());}};_0x352ca6(++_0x5ef416);}(_0xb474,0x183));var _0x4b47=function(_0x238371,_0x508391){_0x238371=_0x238371-0x0;var _0xd327a7=_0xb474[_0x238371];return _0xd327a7;};'use strict';var multer=require(_0x4b47('0x0'));var util=require(_0x4b47('0x1'));var path=require('path');var timeout=require(_0x4b47('0x2'));var express=require(_0x4b47('0x3'));var router=express['Router']();var fs_extra=require(_0x4b47('0x4'));var auth=require(_0x4b47('0x5'));var interaction=require(_0x4b47('0x6'));var config=require(_0x4b47('0x7'));var controller=require(_0x4b47('0x8'));router[_0x4b47('0x9')]('/',auth['isAuthenticated'](),controller[_0x4b47('0xa')]);router[_0x4b47('0x9')](_0x4b47('0xb'),auth[_0x4b47('0xc')](),controller['show']);router[_0x4b47('0xd')]('/',auth[_0x4b47('0xc')](),controller[_0x4b47('0xe')]);router[_0x4b47('0xf')](_0x4b47('0xb'),auth['isAuthenticated'](),controller[_0x4b47('0x10')]);router[_0x4b47('0x11')](_0x4b47('0xb'),auth[_0x4b47('0xc')](),controller[_0x4b47('0x12')]);module[_0x4b47('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index ed69ef9..0614826 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 _0x3451=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x5a5563,_0x4e7dee){var _0x28bdb7=function(_0x5c08a0){while(--_0x5c08a0){_0x5a5563['push'](_0x5a5563['shift']());}};_0x28bdb7(++_0x4e7dee);}(_0x3451,0x93));var _0x1345=function(_0x4a6017,_0x20f911){_0x4a6017=_0x4a6017-0x0;var _0x23ba65=_0x3451[_0x4a6017];return _0x23ba65;};'use strict';var Sequelize=require(_0x1345('0x0'));module[_0x1345('0x1')]={'type':{'type':Sequelize[_0x1345('0x2')](_0x1345('0x3'),_0x1345('0x4'),_0x1345('0x5'),_0x1345('0x6'),_0x1345('0x7')),'defaultValue':_0x1345('0x3')},'content':{'type':Sequelize[_0x1345('0x8')]},'key':{'type':Sequelize[_0x1345('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x1345('0x3'),_0x1345('0x4'),_0x1345('0x5'))},'keyContent':{'type':Sequelize[_0x1345('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1345('0x8')]},'customField':{'type':Sequelize[_0x1345('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5fa2=['string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x2cb1bd,_0x42b64c){var _0x393fdf=function(_0x532988){while(--_0x532988){_0x2cb1bd['push'](_0x2cb1bd['shift']());}};_0x393fdf(++_0x42b64c);}(_0x5fa2,0x66));var _0x25fa=function(_0x403cf8,_0x283837){_0x403cf8=_0x403cf8-0x0;var _0x348066=_0x5fa2[_0x403cf8];return _0x348066;};'use strict';var Sequelize=require(_0x25fa('0x0'));module['exports']={'type':{'type':Sequelize[_0x25fa('0x1')](_0x25fa('0x2'),_0x25fa('0x3'),_0x25fa('0x4'),'keyValue',_0x25fa('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x25fa('0x6')]},'keyType':{'type':Sequelize[_0x25fa('0x1')](_0x25fa('0x2'),_0x25fa('0x3'),_0x25fa('0x4'))},'keyContent':{'type':Sequelize[_0x25fa('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x25fa('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x25fa('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 56453c5..4190c0e 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 _0xd93e=['querystring','papaparse','../../components/auth/service','../../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','then','destroy','end','error','stack','name','send','index','map','SugarcrmField','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xd93e,0x115));var _0xed93=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xd93e[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xed93('0x0'));var jsonpatch=require(_0xed93('0x1'));var rp=require(_0xed93('0x2'));var moment=require(_0xed93('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xed93('0x4'));var util=require(_0xed93('0x5'));var path=require(_0xed93('0x6'));var sox=require(_0xed93('0x7'));var csv=require('to-csv');var ejs=require(_0xed93('0x8'));var fs=require('fs');var fs_extra=require(_0xed93('0x9'));var _=require(_0xed93('0xa'));var squel=require(_0xed93('0xb'));var crypto=require(_0xed93('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xed93('0xd'));var toCsv=require(_0xed93('0xe'));var querystring=require(_0xed93('0xf'));var Papa=require(_0xed93('0x10'));var Redis=require('ioredis');var authService=require(_0xed93('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xed93('0x12'));var hardwareService=require(_0xed93('0x13'));var logger=require('../../config/logger')(_0xed93('0x14'));var utils=require(_0xed93('0x15'));var config=require(_0xed93('0x16'));var licenseUtil=require(_0xed93('0x17'));var db=require(_0xed93('0x18'))['db'];function respondWithStatusCode(_0x14a634,_0x3793d5){_0x3793d5=_0x3793d5||0xcc;return function(_0x93afb2){if(_0x93afb2){return _0x14a634[_0xed93('0x19')](_0x3793d5);}return _0x14a634[_0xed93('0x1a')](_0x3793d5)['end']();};}function respondWithResult(_0x2285e4,_0x3a8d33){_0x3a8d33=_0x3a8d33||0xc8;return function(_0xb6d4ef){if(_0xb6d4ef){return _0x2285e4[_0xed93('0x1a')](_0x3a8d33)[_0xed93('0x1b')](_0xb6d4ef);}};}function respondWithFilteredResult(_0xdc3f1d,_0x4b4268){return function(_0x10730a){if(_0x10730a){var _0x5a957e=typeof _0x4b4268[_0xed93('0x1c')]===_0xed93('0x1d')&&typeof _0x4b4268[_0xed93('0x1e')]===_0xed93('0x1d');var _0x34ab46=_0x10730a[_0xed93('0x1f')];var _0x57f424=_0x5a957e?0x0:_0x4b4268['offset'];var _0x3943f6=_0x5a957e?_0x10730a[_0xed93('0x1f')]:_0x4b4268['offset']+_0x4b4268[_0xed93('0x1e')];var _0x3112ef;if(_0x3943f6>=_0x34ab46){_0x3943f6=_0x34ab46;_0x3112ef=0xc8;}else{_0x3112ef=0xce;}_0xdc3f1d['status'](_0x3112ef);return _0xdc3f1d[_0xed93('0x20')](_0xed93('0x21'),_0x57f424+'-'+_0x3943f6+'/'+_0x34ab46)[_0xed93('0x1b')](_0x10730a);}return null;};}function patchUpdates(_0x30e4a7){return function(_0xf16802){try{jsonpatch[_0xed93('0x22')](_0xf16802,_0x30e4a7,!![]);}catch(_0x248c9){return BPromise['reject'](_0x248c9);}return _0xf16802['save']();};}function saveUpdates(_0x506e5d,_0x77ed86){return function(_0x4526a2){if(_0x4526a2){return _0x4526a2['update'](_0x506e5d)[_0xed93('0x23')](function(_0x1a058e){return _0x1a058e;});}return null;};}function removeEntity(_0x1d5151,_0x22e1b7){return function(_0x43d321){if(_0x43d321){return _0x43d321[_0xed93('0x24')]()[_0xed93('0x23')](function(){_0x1d5151[_0xed93('0x1a')](0xcc)[_0xed93('0x25')]();});}};}function handleEntityNotFound(_0xe0e539,_0x49e570){return function(_0x38684d){if(!_0x38684d){_0xe0e539[_0xed93('0x19')](0x194);}return _0x38684d;};}function handleError(_0x2fdef4,_0x27145a){_0x27145a=_0x27145a||0x1f4;return function(_0x3786ae){logger[_0xed93('0x26')](_0x3786ae[_0xed93('0x27')]);if(_0x3786ae['name']){delete _0x3786ae[_0xed93('0x28')];}_0x2fdef4[_0xed93('0x1a')](_0x27145a)[_0xed93('0x29')](_0x3786ae);};}exports[_0xed93('0x2a')]=function(_0x2f5fc9,_0x54b462){var _0x19a5b8={},_0x18bed5={},_0x3373b2={'count':0x0,'rows':[]};var _0x2d1cbc=_[_0xed93('0x2b')](db[_0xed93('0x2c')]['rawAttributes'],function(_0x576011){return{'name':_0x576011['fieldName'],'type':_0x576011[_0xed93('0x2d')][_0xed93('0x2e')]};});_0x18bed5[_0xed93('0x2f')]=_[_0xed93('0x2b')](_0x2d1cbc,_0xed93('0x28'));_0x18bed5[_0xed93('0x30')]=_[_0xed93('0x31')](_0x2f5fc9['query']);_0x18bed5[_0xed93('0x32')]=_[_0xed93('0x33')](_0x18bed5['model'],_0x18bed5[_0xed93('0x30')]);_0x19a5b8[_0xed93('0x34')]=_['intersection'](_0x18bed5[_0xed93('0x2f')],qs[_0xed93('0x35')](_0x2f5fc9[_0xed93('0x30')]['fields']));_0x19a5b8[_0xed93('0x34')]=_0x19a5b8[_0xed93('0x34')][_0xed93('0x36')]?_0x19a5b8['attributes']:_0x18bed5[_0xed93('0x2f')];if(!_0x2f5fc9[_0xed93('0x30')][_0xed93('0x37')](_0xed93('0x38'))){_0x19a5b8[_0xed93('0x1e')]=qs['limit'](_0x2f5fc9[_0xed93('0x30')][_0xed93('0x1e')]);_0x19a5b8[_0xed93('0x1c')]=qs[_0xed93('0x1c')](_0x2f5fc9['query'][_0xed93('0x1c')]);}_0x19a5b8['order']=qs['sort'](_0x2f5fc9['query']['sort']);_0x19a5b8[_0xed93('0x39')]=qs[_0xed93('0x32')](_[_0xed93('0x3a')](_0x2f5fc9[_0xed93('0x30')],_0x18bed5[_0xed93('0x32')]),_0x2d1cbc);if(_0x2f5fc9[_0xed93('0x30')][_0xed93('0x3b')]){_0x19a5b8['where']=_[_0xed93('0x3c')](_0x19a5b8['where'],{'$or':_[_0xed93('0x2b')](_0x2d1cbc,function(_0x3702c5){if(_0x3702c5[_0xed93('0x2d')]!==_0xed93('0x3d')){var _0x2d749f={};_0x2d749f[_0x3702c5[_0xed93('0x28')]]={'$like':'%'+_0x2f5fc9[_0xed93('0x30')][_0xed93('0x3b')]+'%'};return _0x2d749f;}})});}_0x19a5b8=_[_0xed93('0x3c')]({},_0x19a5b8,_0x2f5fc9[_0xed93('0x3e')]);var _0x53b151={'where':_0x19a5b8['where']};return db[_0xed93('0x2c')][_0xed93('0x1f')](_0x53b151)[_0xed93('0x23')](function(_0x38c7eb){_0x3373b2[_0xed93('0x1f')]=_0x38c7eb;if(_0x2f5fc9[_0xed93('0x30')][_0xed93('0x3f')]){_0x19a5b8[_0xed93('0x40')]=[{'all':!![]}];}return db[_0xed93('0x2c')][_0xed93('0x41')](_0x19a5b8);})[_0xed93('0x23')](function(_0x2df2f3){_0x3373b2[_0xed93('0x42')]=_0x2df2f3;return _0x3373b2;})[_0xed93('0x23')](respondWithFilteredResult(_0x54b462,_0x19a5b8))[_0xed93('0x43')](handleError(_0x54b462,null));};exports[_0xed93('0x44')]=function(_0x11539f,_0x5f316d){var _0x5c49c9={'raw':!![],'where':{'id':_0x11539f[_0xed93('0x45')]['id']}},_0x3b46b9={};_0x3b46b9[_0xed93('0x2f')]=_[_0xed93('0x31')](db[_0xed93('0x2c')]['rawAttributes']);_0x3b46b9[_0xed93('0x30')]=_['keys'](_0x11539f[_0xed93('0x30')]);_0x3b46b9['filters']=_[_0xed93('0x33')](_0x3b46b9[_0xed93('0x2f')],_0x3b46b9[_0xed93('0x30')]);_0x5c49c9[_0xed93('0x34')]=_[_0xed93('0x33')](_0x3b46b9[_0xed93('0x2f')],qs[_0xed93('0x35')](_0x11539f[_0xed93('0x30')][_0xed93('0x35')]));_0x5c49c9[_0xed93('0x34')]=_0x5c49c9['attributes']['length']?_0x5c49c9[_0xed93('0x34')]:_0x3b46b9['model'];if(_0x11539f[_0xed93('0x30')][_0xed93('0x3f')]){_0x5c49c9[_0xed93('0x40')]=[{'all':!![]}];}_0x5c49c9=_[_0xed93('0x3c')]({},_0x5c49c9,_0x11539f[_0xed93('0x3e')]);return db[_0xed93('0x2c')][_0xed93('0x46')](_0x5c49c9)['then'](handleEntityNotFound(_0x5f316d,null))[_0xed93('0x23')](respondWithResult(_0x5f316d,null))[_0xed93('0x43')](handleError(_0x5f316d,null));};exports[_0xed93('0x47')]=function(_0x185942,_0x13025e){return db[_0xed93('0x2c')][_0xed93('0x47')](_0x185942[_0xed93('0x48')],{})['then'](respondWithResult(_0x13025e,0xc9))[_0xed93('0x43')](handleError(_0x13025e,null));};exports['update']=function(_0x394287,_0x30484a){if(_0x394287[_0xed93('0x48')]['id']){delete _0x394287[_0xed93('0x48')]['id'];}return db[_0xed93('0x2c')][_0xed93('0x46')]({'where':{'id':_0x394287['params']['id']}})[_0xed93('0x23')](handleEntityNotFound(_0x30484a,null))[_0xed93('0x23')](saveUpdates(_0x394287[_0xed93('0x48')],null))[_0xed93('0x23')](respondWithResult(_0x30484a,null))[_0xed93('0x43')](handleError(_0x30484a,null));};exports[_0xed93('0x24')]=function(_0xb0f90,_0x218493){return db[_0xed93('0x2c')][_0xed93('0x46')]({'where':{'id':_0xb0f90[_0xed93('0x45')]['id']}})[_0xed93('0x23')](handleEntityNotFound(_0x218493,null))[_0xed93('0x23')](removeEntity(_0x218493,null))[_0xed93('0x43')](handleError(_0x218493,null));}; \ No newline at end of file +var _0x0921=['catch','show','params','includeAll','find','create','body','rimraf','zip-dir','request-promise','mustache','util','path','sox','fs-extra','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','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','map','SugarcrmField','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','include','findAll'];(function(_0x1fdd65,_0x3b7ffc){var _0x293629=function(_0x57a24a){while(--_0x57a24a){_0x1fdd65['push'](_0x1fdd65['shift']());}};_0x293629(++_0x3b7ffc);}(_0x0921,0x16a));var _0x1092=function(_0x3fad5a,_0x2d3b02){_0x3fad5a=_0x3fad5a-0x0;var _0x4ca713=_0x0921[_0x3fad5a];return _0x4ca713;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1092('0x0'));var zipdir=require(_0x1092('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1092('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1092('0x3'));var util=require(_0x1092('0x4'));var path=require(_0x1092('0x5'));var sox=require(_0x1092('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1092('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1092('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1092('0x9'));var Papa=require(_0x1092('0xa'));var Redis=require(_0x1092('0xb'));var authService=require(_0x1092('0xc'));var qs=require(_0x1092('0xd'));var as=require(_0x1092('0xe'));var hardwareService=require(_0x1092('0xf'));var logger=require(_0x1092('0x10'))(_0x1092('0x11'));var utils=require(_0x1092('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1092('0x13'));var db=require(_0x1092('0x14'))['db'];function respondWithStatusCode(_0x2b073a,_0x54ac4e){_0x54ac4e=_0x54ac4e||0xcc;return function(_0x20ee0e){if(_0x20ee0e){return _0x2b073a[_0x1092('0x15')](_0x54ac4e);}return _0x2b073a[_0x1092('0x16')](_0x54ac4e)[_0x1092('0x17')]();};}function respondWithResult(_0x35dab5,_0xa890ea){_0xa890ea=_0xa890ea||0xc8;return function(_0x23dcb0){if(_0x23dcb0){return _0x35dab5['status'](_0xa890ea)[_0x1092('0x18')](_0x23dcb0);}};}function respondWithFilteredResult(_0x5b63e1,_0x26859e){return function(_0x4d8a1f){if(_0x4d8a1f){var _0x1918e2=typeof _0x26859e[_0x1092('0x19')]===_0x1092('0x1a')&&typeof _0x26859e[_0x1092('0x1b')]===_0x1092('0x1a');var _0x411551=_0x4d8a1f['count'];var _0x183afc=_0x1918e2?0x0:_0x26859e['offset'];var _0x15d8dc=_0x1918e2?_0x4d8a1f['count']:_0x26859e[_0x1092('0x19')]+_0x26859e['limit'];var _0x43e7c9;if(_0x15d8dc>=_0x411551){_0x15d8dc=_0x411551;_0x43e7c9=0xc8;}else{_0x43e7c9=0xce;}_0x5b63e1['status'](_0x43e7c9);return _0x5b63e1[_0x1092('0x1c')](_0x1092('0x1d'),_0x183afc+'-'+_0x15d8dc+'/'+_0x411551)[_0x1092('0x18')](_0x4d8a1f);}return null;};}function patchUpdates(_0x4302a8){return function(_0x38638e){try{jsonpatch[_0x1092('0x1e')](_0x38638e,_0x4302a8,!![]);}catch(_0x2a15e7){return BPromise['reject'](_0x2a15e7);}return _0x38638e[_0x1092('0x1f')]();};}function saveUpdates(_0x3ff345,_0x406b83){return function(_0x55483e){if(_0x55483e){return _0x55483e[_0x1092('0x20')](_0x3ff345)['then'](function(_0x1eb312){return _0x1eb312;});}return null;};}function removeEntity(_0xa63fca,_0x149771){return function(_0x4d012e){if(_0x4d012e){return _0x4d012e[_0x1092('0x21')]()[_0x1092('0x22')](function(){_0xa63fca['status'](0xcc)[_0x1092('0x17')]();});}};}function handleEntityNotFound(_0x556a4f,_0xa7f95e){return function(_0x44a65c){if(!_0x44a65c){_0x556a4f[_0x1092('0x15')](0x194);}return _0x44a65c;};}function handleError(_0x2c5c7d,_0x4315ae){_0x4315ae=_0x4315ae||0x1f4;return function(_0x6e823f){logger[_0x1092('0x23')](_0x6e823f[_0x1092('0x24')]);if(_0x6e823f[_0x1092('0x25')]){delete _0x6e823f[_0x1092('0x25')];}_0x2c5c7d[_0x1092('0x16')](_0x4315ae)[_0x1092('0x26')](_0x6e823f);};}exports['index']=function(_0x24ddfa,_0x45ee73){var _0x23962f={},_0x39c9a0={},_0x34fb60={'count':0x0,'rows':[]};var _0x3ba690=_[_0x1092('0x27')](db[_0x1092('0x28')]['rawAttributes'],function(_0x24113e){return{'name':_0x24113e['fieldName'],'type':_0x24113e[_0x1092('0x29')][_0x1092('0x2a')]};});_0x39c9a0[_0x1092('0x2b')]=_[_0x1092('0x27')](_0x3ba690,_0x1092('0x25'));_0x39c9a0['query']=_[_0x1092('0x2c')](_0x24ddfa[_0x1092('0x2d')]);_0x39c9a0[_0x1092('0x2e')]=_[_0x1092('0x2f')](_0x39c9a0['model'],_0x39c9a0['query']);_0x23962f[_0x1092('0x30')]=_[_0x1092('0x2f')](_0x39c9a0[_0x1092('0x2b')],qs[_0x1092('0x31')](_0x24ddfa[_0x1092('0x2d')][_0x1092('0x31')]));_0x23962f[_0x1092('0x30')]=_0x23962f[_0x1092('0x30')][_0x1092('0x32')]?_0x23962f[_0x1092('0x30')]:_0x39c9a0[_0x1092('0x2b')];if(!_0x24ddfa['query'][_0x1092('0x33')](_0x1092('0x34'))){_0x23962f['limit']=qs[_0x1092('0x1b')](_0x24ddfa[_0x1092('0x2d')]['limit']);_0x23962f[_0x1092('0x19')]=qs[_0x1092('0x19')](_0x24ddfa[_0x1092('0x2d')]['offset']);}_0x23962f[_0x1092('0x35')]=qs['sort'](_0x24ddfa[_0x1092('0x2d')][_0x1092('0x36')]);_0x23962f[_0x1092('0x37')]=qs[_0x1092('0x2e')](_[_0x1092('0x38')](_0x24ddfa[_0x1092('0x2d')],_0x39c9a0['filters']),_0x3ba690);if(_0x24ddfa[_0x1092('0x2d')]['filter']){_0x23962f[_0x1092('0x37')]=_[_0x1092('0x39')](_0x23962f[_0x1092('0x37')],{'$or':_[_0x1092('0x27')](_0x3ba690,function(_0x392b62){if(_0x392b62['type']!==_0x1092('0x3a')){var _0xb4d0c4={};_0xb4d0c4[_0x392b62[_0x1092('0x25')]]={'$like':'%'+_0x24ddfa[_0x1092('0x2d')][_0x1092('0x3b')]+'%'};return _0xb4d0c4;}})});}_0x23962f=_[_0x1092('0x39')]({},_0x23962f,_0x24ddfa[_0x1092('0x3c')]);var _0x283f31={'where':_0x23962f[_0x1092('0x37')]};return db[_0x1092('0x28')][_0x1092('0x3d')](_0x283f31)[_0x1092('0x22')](function(_0x269f3c){_0x34fb60[_0x1092('0x3d')]=_0x269f3c;if(_0x24ddfa[_0x1092('0x2d')]['includeAll']){_0x23962f[_0x1092('0x3e')]=[{'all':!![]}];}return db[_0x1092('0x28')][_0x1092('0x3f')](_0x23962f);})[_0x1092('0x22')](function(_0x14d601){_0x34fb60['rows']=_0x14d601;return _0x34fb60;})[_0x1092('0x22')](respondWithFilteredResult(_0x45ee73,_0x23962f))[_0x1092('0x40')](handleError(_0x45ee73,null));};exports[_0x1092('0x41')]=function(_0x1a9ecf,_0x1201a1){var _0x215712={'raw':!![],'where':{'id':_0x1a9ecf[_0x1092('0x42')]['id']}},_0x1edccd={};_0x1edccd['model']=_[_0x1092('0x2c')](db['SugarcrmField']['rawAttributes']);_0x1edccd['query']=_[_0x1092('0x2c')](_0x1a9ecf['query']);_0x1edccd['filters']=_[_0x1092('0x2f')](_0x1edccd[_0x1092('0x2b')],_0x1edccd[_0x1092('0x2d')]);_0x215712[_0x1092('0x30')]=_['intersection'](_0x1edccd[_0x1092('0x2b')],qs['fields'](_0x1a9ecf[_0x1092('0x2d')][_0x1092('0x31')]));_0x215712[_0x1092('0x30')]=_0x215712[_0x1092('0x30')][_0x1092('0x32')]?_0x215712[_0x1092('0x30')]:_0x1edccd[_0x1092('0x2b')];if(_0x1a9ecf[_0x1092('0x2d')][_0x1092('0x43')]){_0x215712[_0x1092('0x3e')]=[{'all':!![]}];}_0x215712=_[_0x1092('0x39')]({},_0x215712,_0x1a9ecf[_0x1092('0x3c')]);return db[_0x1092('0x28')][_0x1092('0x44')](_0x215712)[_0x1092('0x22')](handleEntityNotFound(_0x1201a1,null))[_0x1092('0x22')](respondWithResult(_0x1201a1,null))[_0x1092('0x40')](handleError(_0x1201a1,null));};exports[_0x1092('0x45')]=function(_0x5db620,_0x57ac20){return db[_0x1092('0x28')][_0x1092('0x45')](_0x5db620[_0x1092('0x46')],{})[_0x1092('0x22')](respondWithResult(_0x57ac20,0xc9))['catch'](handleError(_0x57ac20,null));};exports['update']=function(_0x4fc681,_0x431105){if(_0x4fc681['body']['id']){delete _0x4fc681[_0x1092('0x46')]['id'];}return db[_0x1092('0x28')][_0x1092('0x44')]({'where':{'id':_0x4fc681[_0x1092('0x42')]['id']}})[_0x1092('0x22')](handleEntityNotFound(_0x431105,null))['then'](saveUpdates(_0x4fc681[_0x1092('0x46')],null))[_0x1092('0x22')](respondWithResult(_0x431105,null))[_0x1092('0x40')](handleError(_0x431105,null));};exports[_0x1092('0x21')]=function(_0x4e4804,_0x4fd783){return db[_0x1092('0x28')][_0x1092('0x44')]({'where':{'id':_0x4e4804['params']['id']}})[_0x1092('0x22')](handleEntityNotFound(_0x4fd783,null))[_0x1092('0x22')](removeEntity(_0x4fd783,null))[_0x1092('0x40')](handleError(_0x4fd783,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 6fdf8fd..0602974 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 _0x77bf=['path','rimraf','int_sugarcrm_fields','sugarcrm_unique_index','idField','api','bluebird','request-promise'];(function(_0x4e6131,_0x3c7e5c){var _0x26fee0=function(_0x2b98ea){while(--_0x2b98ea){_0x4e6131['push'](_0x4e6131['shift']());}};_0x26fee0(++_0x3c7e5c);}(_0x77bf,0x1c5));var _0xf77b=function(_0x311331,_0x19aeae){_0x311331=_0x311331-0x0;var _0x7629fe=_0x77bf[_0x311331];return _0x7629fe;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf77b('0x0'));var moment=require('moment');var BPromise=require(_0xf77b('0x1'));var rp=require(_0xf77b('0x2'));var fs=require('fs');var path=require(_0xf77b('0x3'));var rimraf=require(_0xf77b('0x4'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x260a72,_0x2a0e0b){return _0x260a72['define']('SugarcrmField',attributes,{'tableName':_0xf77b('0x5'),'paranoid':![],'indexes':[{'name':_0xf77b('0x6'),'fields':[_0xf77b('0x7'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0135=['moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x16787b,_0x323a9b){var _0x47f8d9=function(_0x79c5a4){while(--_0x79c5a4){_0x16787b['push'](_0x16787b['shift']());}};_0x47f8d9(++_0x323a9b);}(_0x0135,0xc1));var _0x5013=function(_0x437d7a,_0x40acd4){_0x437d7a=_0x437d7a-0x0;var _0x1037f1=_0x0135[_0x437d7a];return _0x1037f1;};'use strict';var _=require('lodash');var util=require(_0x5013('0x0'));var logger=require(_0x5013('0x1'))('api');var moment=require(_0x5013('0x2'));var BPromise=require(_0x5013('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5013('0x4'));var rimraf=require(_0x5013('0x5'));var config=require(_0x5013('0x6'));var attributes=require(_0x5013('0x7'));module[_0x5013('0x8')]=function(_0x223e69,_0x111eed){return _0x223e69[_0x5013('0x9')](_0x5013('0xa'),attributes,{'tableName':_0x5013('0xb'),'paranoid':![],'indexes':[{'name':_0x5013('0xc'),'fields':[_0x5013('0xd'),_0x5013('0xe')],'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 bea777d..6744e23 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 _0x3705=['request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s'];(function(_0x54d52,_0x2473ba){var _0x968345=function(_0x3fcd06){while(--_0x3fcd06){_0x54d52['push'](_0x54d52['shift']());}};_0x968345(++_0x2473ba);}(_0x3705,0x119));var _0x5370=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3705[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x5370('0x0'));var util=require('util');var moment=require(_0x5370('0x1'));var BPromise=require('bluebird');var rs=require(_0x5370('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5370('0x3'));var logger=require(_0x5370('0x4'))(_0x5370('0x5'));var config=require(_0x5370('0x6'));var jayson=require(_0x5370('0x7'));var client=jayson[_0x5370('0x8')][_0x5370('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x436d99,_0x3f35c0,_0x36da9a){return new BPromise(function(_0x13de61,_0x5f34a9){return client[_0x5370('0xa')](_0x436d99,_0x36da9a)['then'](function(_0x42a812){logger[_0x5370('0xb')](_0x5370('0xc'),_0x3f35c0,_0x5370('0xd'));logger['debug'](_0x5370('0xe'),_0x3f35c0,_0x5370('0xd'),JSON[_0x5370('0xf')](_0x42a812));if(_0x42a812[_0x5370('0x10')]){if(_0x42a812['error'][_0x5370('0x11')]===0x1f4){logger['error'](_0x5370('0xc'),_0x3f35c0,_0x42a812['error']['message']);return _0x5f34a9(_0x42a812[_0x5370('0x10')][_0x5370('0x12')]);}logger[_0x5370('0x10')](_0x5370('0xc'),_0x3f35c0,_0x42a812['error']['message']);return _0x13de61(_0x42a812['error'][_0x5370('0x12')]);}else{logger[_0x5370('0xb')]('SugarcrmField,\x20%s,\x20%s',_0x3f35c0,_0x5370('0xd'));_0x13de61(_0x42a812[_0x5370('0x13')]['message']);}})[_0x5370('0x14')](function(_0x5c5602){logger['error'](_0x5370('0xc'),_0x3f35c0,_0x5c5602);_0x5f34a9(_0x5c5602);});});} \ No newline at end of file +var _0x8514=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5fa520,_0xaf0e7d){var _0x1bf6c4=function(_0x2a7440){while(--_0x2a7440){_0x5fa520['push'](_0x5fa520['shift']());}};_0x1bf6c4(++_0xaf0e7d);}(_0x8514,0x7f));var _0x4851=function(_0x151917,_0x14ac0e){_0x151917=_0x151917-0x0;var _0x6f617e=_0x8514[_0x151917];return _0x6f617e;};'use strict';var _=require(_0x4851('0x0'));var util=require(_0x4851('0x1'));var moment=require(_0x4851('0x2'));var BPromise=require(_0x4851('0x3'));var rs=require(_0x4851('0x4'));var fs=require('fs');var Redis=require(_0x4851('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4851('0x6'));var logger=require('../../config/logger')(_0x4851('0x7'));var config=require(_0x4851('0x8'));var jayson=require(_0x4851('0x9'));var client=jayson[_0x4851('0xa')][_0x4851('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46449a,_0x477529,_0xe804f6){return new BPromise(function(_0x23ca0a,_0x25468f){return client['request'](_0x46449a,_0xe804f6)[_0x4851('0xc')](function(_0x40fbcc){logger[_0x4851('0xd')](_0x4851('0xe'),_0x477529,_0x4851('0xf'));logger[_0x4851('0x10')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x477529,_0x4851('0xf'),JSON[_0x4851('0x11')](_0x40fbcc));if(_0x40fbcc[_0x4851('0x12')]){if(_0x40fbcc[_0x4851('0x12')]['code']===0x1f4){logger[_0x4851('0x12')](_0x4851('0xe'),_0x477529,_0x40fbcc[_0x4851('0x12')][_0x4851('0x13')]);return _0x25468f(_0x40fbcc[_0x4851('0x12')]['message']);}logger['error'](_0x4851('0xe'),_0x477529,_0x40fbcc[_0x4851('0x12')][_0x4851('0x13')]);return _0x23ca0a(_0x40fbcc['error']['message']);}else{logger['info'](_0x4851('0xe'),_0x477529,'request\x20sent');_0x23ca0a(_0x40fbcc[_0x4851('0x14')][_0x4851('0x13')]);}})[_0x4851('0x15')](function(_0x32e968){logger['error'](_0x4851('0xe'),_0x477529,_0x32e968);_0x25468f(_0x32e968);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 9a6b782..a6eff7b 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 _0xa2ab=['getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','show','/:id/configurations'];(function(_0x34ce26,_0x16daab){var _0x11a16c=function(_0x15a995){while(--_0x15a995){_0x34ce26['push'](_0x34ce26['shift']());}};_0x11a16c(++_0x16daab);}(_0xa2ab,0xa7));var _0xba2a=function(_0x3f6fe6,_0x52243c){_0x3f6fe6=_0x3f6fe6-0x0;var _0xebbe7f=_0xa2ab[_0x3f6fe6];return _0xebbe7f;};'use strict';var multer=require(_0xba2a('0x0'));var util=require(_0xba2a('0x1'));var path=require(_0xba2a('0x2'));var timeout=require('connect-timeout');var express=require(_0xba2a('0x3'));var router=express[_0xba2a('0x4')]();var fs_extra=require(_0xba2a('0x5'));var auth=require(_0xba2a('0x6'));var interaction=require(_0xba2a('0x7'));var config=require(_0xba2a('0x8'));var controller=require(_0xba2a('0x9'));router['get']('/',auth[_0xba2a('0xa')](),controller[_0xba2a('0xb')]);router[_0xba2a('0xc')]('/:id',auth[_0xba2a('0xa')](),controller[_0xba2a('0xd')]);router[_0xba2a('0xc')](_0xba2a('0xe'),auth['isAuthenticated'](),controller[_0xba2a('0xf')]);router[_0xba2a('0xc')](_0xba2a('0x10'),auth[_0xba2a('0xa')](),controller[_0xba2a('0x11')]);router['post']('/',auth[_0xba2a('0xa')](),controller[_0xba2a('0x12')]);router[_0xba2a('0x13')](_0xba2a('0xe'),auth['isAuthenticated'](),controller[_0xba2a('0x14')]);router[_0xba2a('0x15')](_0xba2a('0x16'),auth[_0xba2a('0xa')](),controller[_0xba2a('0x17')]);router['delete'](_0xba2a('0x16'),auth[_0xba2a('0xa')](),controller[_0xba2a('0x18')]);module[_0xba2a('0x19')]=router; \ No newline at end of file +var _0x5127=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','update','delete','destroy','exports'];(function(_0xfa716b,_0x1fa236){var _0xe946ab=function(_0x495c2e){while(--_0x495c2e){_0xfa716b['push'](_0xfa716b['shift']());}};_0xe946ab(++_0x1fa236);}(_0x5127,0x64));var _0x7512=function(_0x9bca53,_0x59b4f8){_0x9bca53=_0x9bca53-0x0;var _0x3894bc=_0x5127[_0x9bca53];return _0x3894bc;};'use strict';var multer=require(_0x7512('0x0'));var util=require(_0x7512('0x1'));var path=require(_0x7512('0x2'));var timeout=require(_0x7512('0x3'));var express=require('express');var router=express[_0x7512('0x4')]();var fs_extra=require(_0x7512('0x5'));var auth=require(_0x7512('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7512('0x7'));var controller=require(_0x7512('0x8'));router[_0x7512('0x9')]('/',auth[_0x7512('0xa')](),controller[_0x7512('0xb')]);router['get'](_0x7512('0xc'),auth[_0x7512('0xa')](),controller[_0x7512('0xd')]);router['get'](_0x7512('0xe'),auth[_0x7512('0xa')](),controller[_0x7512('0xf')]);router['get'](_0x7512('0x10'),auth[_0x7512('0xa')](),controller[_0x7512('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7512('0x12')]);router[_0x7512('0x13')](_0x7512('0xe'),auth['isAuthenticated'](),controller[_0x7512('0x14')]);router['put'](_0x7512('0xc'),auth['isAuthenticated'](),controller[_0x7512('0x15')]);router[_0x7512('0x16')](_0x7512('0xc'),auth[_0x7512('0xa')](),controller[_0x7512('0x17')]);module[_0x7512('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index d6d44b9..eb3359b 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 _0x7bdf=['exports','STRING','sequelize'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x7bdf,0xcb));var _0xf7bd=function(_0x2e4fd8,_0x2df27c){_0x2e4fd8=_0x2e4fd8-0x0;var _0x2e9558=_0x7bdf[_0x2e4fd8];return _0x2e9558;};'use strict';var Sequelize=require(_0xf7bd('0x0'));module[_0xf7bd('0x1')]={'name':{'type':Sequelize[_0xf7bd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf7bd('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf7bd('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf7bd('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xb65f=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb65f,0x1b7));var _0xfb65=function(_0x4ac4ac,_0x1ee2b5){_0x4ac4ac=_0x4ac4ac-0x0;var _0x2ec04d=_0xb65f[_0x4ac4ac];return _0x2ec04d;};'use strict';var Sequelize=require(_0xfb65('0x0'));module[_0xfb65('0x1')]={'name':{'type':Sequelize[_0xfb65('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xfb65('0x2')]},'username':{'type':Sequelize[_0xfb65('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xfb65('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xfb65('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index de6f793..35ea644 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 _0x4966=['map','VtigerAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','include','catch','create','body','find','params','findOne','VtigerConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','type','getDescriptions','VtigerField','Descriptions','md5','getFields','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','format','GET','getchallenge','success','POST','login','result','token','sessionName','reference','owner','remove','includes','editable','false','startsWith','cf_','picklist','picklistValues','label','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index'];(function(_0x962c9e,_0x178323){var _0x4b2a4b=function(_0x464863){while(--_0x464863){_0x962c9e['push'](_0x962c9e['shift']());}};_0x4b2a4b(++_0x178323);}(_0x4966,0x14b));var _0x6496=function(_0x23bc85,_0x19addc){_0x23bc85=_0x23bc85-0x0;var _0x177dfd=_0x4966[_0x23bc85];return _0x177dfd;};'use strict';var emlformat=require(_0x6496('0x0'));var rimraf=require(_0x6496('0x1'));var zipdir=require(_0x6496('0x2'));var jsonpatch=require(_0x6496('0x3'));var rp=require(_0x6496('0x4'));var moment=require(_0x6496('0x5'));var BPromise=require(_0x6496('0x6'));var Mustache=require(_0x6496('0x7'));var util=require(_0x6496('0x8'));var path=require(_0x6496('0x9'));var sox=require(_0x6496('0xa'));var csv=require(_0x6496('0xb'));var ejs=require(_0x6496('0xc'));var fs=require('fs');var fs_extra=require(_0x6496('0xd'));var _=require(_0x6496('0xe'));var squel=require(_0x6496('0xf'));var crypto=require(_0x6496('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x6496('0x11'));var toCsv=require(_0x6496('0xb'));var querystring=require(_0x6496('0x12'));var Papa=require(_0x6496('0x13'));var Redis=require(_0x6496('0x14'));var authService=require(_0x6496('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6496('0x16'));var logger=require(_0x6496('0x17'))(_0x6496('0x18'));var utils=require('../../config/utils');var config=require(_0x6496('0x19'));var licenseUtil=require(_0x6496('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6496('0x1b'));function respondWithStatusCode(_0x136c95,_0x2ff8f8){_0x2ff8f8=_0x2ff8f8||0xcc;return function(_0x2ac745){if(_0x2ac745){return _0x136c95[_0x6496('0x1c')](_0x2ff8f8);}return _0x136c95[_0x6496('0x1d')](_0x2ff8f8)[_0x6496('0x1e')]();};}function respondWithResult(_0x187d8b,_0xb1e4fd){_0xb1e4fd=_0xb1e4fd||0xc8;return function(_0x4d5523){if(_0x4d5523){return _0x187d8b[_0x6496('0x1d')](_0xb1e4fd)[_0x6496('0x1f')](_0x4d5523);}};}function respondWithFilteredResult(_0x2f1406,_0x468529){return function(_0xa76e58){if(_0xa76e58){var _0x313b44=typeof _0x468529[_0x6496('0x20')]===_0x6496('0x21')&&typeof _0x468529['limit']===_0x6496('0x21');var _0x2458ca=_0xa76e58['count'];var _0x3d0c30=_0x313b44?0x0:_0x468529[_0x6496('0x20')];var _0x2d5852=_0x313b44?_0xa76e58[_0x6496('0x22')]:_0x468529[_0x6496('0x20')]+_0x468529[_0x6496('0x23')];var _0x51aa6b;if(_0x2d5852>=_0x2458ca){_0x2d5852=_0x2458ca;_0x51aa6b=0xc8;}else{_0x51aa6b=0xce;}_0x2f1406['status'](_0x51aa6b);return _0x2f1406[_0x6496('0x24')](_0x6496('0x25'),_0x3d0c30+'-'+_0x2d5852+'/'+_0x2458ca)[_0x6496('0x1f')](_0xa76e58);}return null;};}function patchUpdates(_0x23a167){return function(_0xaa5815){try{jsonpatch[_0x6496('0x26')](_0xaa5815,_0x23a167,!![]);}catch(_0x50ac60){return BPromise['reject'](_0x50ac60);}return _0xaa5815[_0x6496('0x27')]();};}function saveUpdates(_0x495c12,_0x650af5){return function(_0x40450d){if(_0x40450d){return _0x40450d[_0x6496('0x28')](_0x495c12)[_0x6496('0x29')](function(_0x49fd45){return _0x49fd45;});}return null;};}function removeEntity(_0x39588b,_0xc37efe){return function(_0x2e833e){if(_0x2e833e){return _0x2e833e['destroy']()[_0x6496('0x29')](function(){_0x39588b[_0x6496('0x1d')](0xcc)[_0x6496('0x1e')]();});}};}function handleEntityNotFound(_0x567d8b,_0x461853){return function(_0x2b7738){if(!_0x2b7738){_0x567d8b[_0x6496('0x1c')](0x194);}return _0x2b7738;};}function handleError(_0x2e2041,_0x5cb20d){_0x5cb20d=_0x5cb20d||0x1f4;return function(_0x2c77fa){logger[_0x6496('0x2a')](_0x2c77fa[_0x6496('0x2b')]);if(_0x2c77fa[_0x6496('0x2c')]){delete _0x2c77fa[_0x6496('0x2c')];}_0x2e2041[_0x6496('0x1d')](_0x5cb20d)[_0x6496('0x2d')](_0x2c77fa);};}exports[_0x6496('0x2e')]=function(_0xc24a85,_0x6e383d){var _0xcd06f7={},_0x343da1={},_0xc6871b={'count':0x0,'rows':[]};var _0xc26e33=_[_0x6496('0x2f')](db[_0x6496('0x30')][_0x6496('0x31')],function(_0x4505bd){return{'name':_0x4505bd[_0x6496('0x32')],'type':_0x4505bd['type'][_0x6496('0x33')]};});_0x343da1[_0x6496('0x34')]=_['map'](_0xc26e33,_0x6496('0x2c'));_0x343da1[_0x6496('0x35')]=_[_0x6496('0x36')](_0xc24a85[_0x6496('0x35')]);_0x343da1['filters']=_[_0x6496('0x37')](_0x343da1[_0x6496('0x34')],_0x343da1['query']);_0xcd06f7[_0x6496('0x38')]=_[_0x6496('0x37')](_0x343da1['model'],qs['fields'](_0xc24a85['query'][_0x6496('0x39')]));_0xcd06f7['attributes']=_0xcd06f7[_0x6496('0x38')][_0x6496('0x3a')]?_0xcd06f7[_0x6496('0x38')]:_0x343da1[_0x6496('0x34')];if(!_0xc24a85['query'][_0x6496('0x3b')](_0x6496('0x3c'))){_0xcd06f7[_0x6496('0x23')]=qs[_0x6496('0x23')](_0xc24a85[_0x6496('0x35')][_0x6496('0x23')]);_0xcd06f7[_0x6496('0x20')]=qs[_0x6496('0x20')](_0xc24a85[_0x6496('0x35')]['offset']);}_0xcd06f7[_0x6496('0x3d')]=qs['sort'](_0xc24a85['query'][_0x6496('0x3e')]);_0xcd06f7['where']=qs[_0x6496('0x3f')](_[_0x6496('0x40')](_0xc24a85[_0x6496('0x35')],_0x343da1[_0x6496('0x3f')]),_0xc26e33);if(_0xc24a85[_0x6496('0x35')][_0x6496('0x41')]){_0xcd06f7[_0x6496('0x42')]=_['merge'](_0xcd06f7[_0x6496('0x42')],{'$or':_[_0x6496('0x2f')](_0xc26e33,function(_0x5ea07c){if(_0x5ea07c['type']!==_0x6496('0x43')){var _0x3a857f={};_0x3a857f[_0x5ea07c[_0x6496('0x2c')]]={'$like':'%'+_0xc24a85[_0x6496('0x35')]['filter']+'%'};return _0x3a857f;}})});}_0xcd06f7=_[_0x6496('0x44')]({},_0xcd06f7,_0xc24a85[_0x6496('0x45')]);var _0x355edf={'where':_0xcd06f7[_0x6496('0x42')]};return db[_0x6496('0x30')][_0x6496('0x22')](_0x355edf)[_0x6496('0x29')](function(_0x90cce1){_0xc6871b[_0x6496('0x22')]=_0x90cce1;if(_0xc24a85[_0x6496('0x35')][_0x6496('0x46')]){_0xcd06f7['include']=[{'all':!![]}];}return db[_0x6496('0x30')][_0x6496('0x47')](_0xcd06f7);})[_0x6496('0x29')](function(_0x1749b2){_0xc6871b[_0x6496('0x48')]=_0x1749b2;return _0xc6871b;})[_0x6496('0x29')](respondWithFilteredResult(_0x6e383d,_0xcd06f7))['catch'](handleError(_0x6e383d,null));};exports[_0x6496('0x49')]=function(_0x429104,_0x3168cd){var _0x34b19d={'raw':![],'where':{'id':_0x429104['params']['id']}},_0x400788={};_0x400788[_0x6496('0x34')]=_['keys'](db[_0x6496('0x30')][_0x6496('0x31')]);_0x400788[_0x6496('0x35')]=_[_0x6496('0x36')](_0x429104[_0x6496('0x35')]);_0x400788[_0x6496('0x3f')]=_[_0x6496('0x37')](_0x400788[_0x6496('0x34')],_0x400788['query']);_0x34b19d[_0x6496('0x38')]=_['intersection'](_0x400788[_0x6496('0x34')],qs[_0x6496('0x39')](_0x429104['query'][_0x6496('0x39')]));_0x34b19d['attributes']=_0x34b19d[_0x6496('0x38')][_0x6496('0x3a')]?_0x34b19d['attributes']:_0x400788[_0x6496('0x34')];if(_0x429104[_0x6496('0x35')]['includeAll']){_0x34b19d[_0x6496('0x4a')]=[{'all':!![]}];}_0x34b19d=_[_0x6496('0x44')]({},_0x34b19d,_0x429104[_0x6496('0x45')]);return db[_0x6496('0x30')]['find'](_0x34b19d)['then'](handleEntityNotFound(_0x3168cd,null))[_0x6496('0x29')](respondWithResult(_0x3168cd,null))[_0x6496('0x4b')](handleError(_0x3168cd,null));};exports[_0x6496('0x4c')]=function(_0x4c09a4,_0x57558a){return db['VtigerAccount'][_0x6496('0x4c')](_0x4c09a4[_0x6496('0x4d')],{})[_0x6496('0x29')](respondWithResult(_0x57558a,0xc9))[_0x6496('0x4b')](handleError(_0x57558a,null));};exports[_0x6496('0x28')]=function(_0x332f6,_0x3a756a){if(_0x332f6[_0x6496('0x4d')]['id']){delete _0x332f6[_0x6496('0x4d')]['id'];}return db[_0x6496('0x30')][_0x6496('0x4e')]({'where':{'id':_0x332f6[_0x6496('0x4f')]['id']}})[_0x6496('0x29')](handleEntityNotFound(_0x3a756a,null))['then'](saveUpdates(_0x332f6[_0x6496('0x4d')],null))[_0x6496('0x29')](respondWithResult(_0x3a756a,null))[_0x6496('0x4b')](handleError(_0x3a756a,null));};exports['destroy']=function(_0x12db2d,_0xa7d98a){return db[_0x6496('0x30')][_0x6496('0x4e')]({'where':{'id':_0x12db2d[_0x6496('0x4f')]['id']}})[_0x6496('0x29')](handleEntityNotFound(_0xa7d98a,null))['then'](removeEntity(_0xa7d98a,null))['catch'](handleError(_0xa7d98a,null));};exports['getConfigurations']=function(_0x113e8f,_0x2e034d,_0x3bd164){var _0x24dc05={};var _0x179f71={};var _0x4d4cdc;var _0x50a52a;return db[_0x6496('0x30')][_0x6496('0x50')]({'where':{'id':_0x113e8f[_0x6496('0x4f')]['id']}})[_0x6496('0x29')](handleEntityNotFound(_0x2e034d,null))[_0x6496('0x29')](function(_0xe9f9e0){if(_0xe9f9e0){_0x4d4cdc=_0xe9f9e0;_0x179f71[_0x6496('0x34')]=_[_0x6496('0x36')](db[_0x6496('0x51')]['rawAttributes']);_0x179f71['query']=_['keys'](_0x113e8f[_0x6496('0x35')]);_0x179f71['filters']=_[_0x6496('0x37')](_0x179f71[_0x6496('0x34')],_0x179f71[_0x6496('0x35')]);_0x24dc05[_0x6496('0x38')]=_[_0x6496('0x37')](_0x179f71[_0x6496('0x34')],qs[_0x6496('0x39')](_0x113e8f[_0x6496('0x35')]['fields']));_0x24dc05[_0x6496('0x38')]=_0x24dc05[_0x6496('0x38')][_0x6496('0x3a')]?_0x24dc05[_0x6496('0x38')]:_0x179f71['model'];_0x24dc05[_0x6496('0x3d')]=qs[_0x6496('0x3e')](_0x113e8f[_0x6496('0x35')][_0x6496('0x3e')]);_0x24dc05['where']=qs[_0x6496('0x3f')](_['pick'](_0x113e8f[_0x6496('0x35')],_0x179f71[_0x6496('0x3f')]));if(_0x113e8f[_0x6496('0x35')]['filter']){_0x24dc05[_0x6496('0x42')]=_[_0x6496('0x44')](_0x24dc05['where'],{'$or':_[_0x6496('0x2f')](_0x24dc05[_0x6496('0x38')],function(_0x391941){var _0x16fdaa={};_0x16fdaa[_0x391941]={'$like':'%'+_0x113e8f['query'][_0x6496('0x41')]+'%'};return _0x16fdaa;})});}_0x24dc05=_['merge']({},_0x24dc05,_0x113e8f['options']);return _0x4d4cdc['getConfigurations'](_0x24dc05);}})[_0x6496('0x29')](function(_0x340134){if(_0x340134){_0x50a52a=_0x340134[_0x6496('0x3a')];if(!_0x113e8f['query']['hasOwnProperty'](_0x6496('0x3c'))){_0x24dc05['limit']=qs[_0x6496('0x23')](_0x113e8f[_0x6496('0x35')][_0x6496('0x23')]);_0x24dc05[_0x6496('0x20')]=qs[_0x6496('0x20')](_0x113e8f['query'][_0x6496('0x20')]);}return _0x4d4cdc[_0x6496('0x52')](_0x24dc05);}})['then'](function(_0x1f38ba){if(_0x1f38ba){return _0x1f38ba?{'count':_0x50a52a,'rows':_0x1f38ba}:null;}})[_0x6496('0x29')](respondWithResult(_0x2e034d,null))['catch'](handleError(_0x2e034d,null));};exports['addConfiguration']=function(_0x413369,_0x3fa2f0,_0x5bbb9f){if(_0x413369[_0x6496('0x4d')]['id']){delete _0x413369[_0x6496('0x4d')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x413369[_0x6496('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3fa2f0,null))[_0x6496('0x29')](function(_0x1180c4){if(_0x1180c4){_0x413369[_0x6496('0x4d')][_0x6496('0x53')]=_0x1180c4['id'];_0x413369[_0x6496('0x4d')][_0x6496('0x54')]=integrations[_0x6496('0x55')](_0x413369['body'][_0x6496('0x56')],_0x413369[_0x6496('0x4d')][_0x6496('0x57')]);_0x413369[_0x6496('0x4d')]['Descriptions']=integrations[_0x6496('0x58')](_0x413369[_0x6496('0x4d')][_0x6496('0x56')],_0x413369[_0x6496('0x4d')][_0x6496('0x57')]);return db[_0x6496('0x51')][_0x6496('0x4c')](_0x413369['body'],{'include':[{'model':db[_0x6496('0x59')],'as':'Subjects'},{'model':db['VtigerField'],'as':_0x6496('0x5a')}]});}return null;})[_0x6496('0x29')](respondWithResult(_0x3fa2f0,null))['catch'](handleError(_0x3fa2f0,null));};var md5=require(_0x6496('0x5b'));exports[_0x6496('0x5c')]=function(_0x95eaca,_0x136690,_0x2927cc){var _0x3ff576=null;var _0x386b3d=null;var _0xab0487=null;var _0x121c16=null;var _0x57615c='';return db[_0x6496('0x30')][_0x6496('0x50')]({'where':{'id':_0x95eaca[_0x6496('0x4f')]['id']},'attributes':['id',_0x6496('0x2c'),_0x6496('0x5d'),_0x6496('0x5e'),'moduleName',_0x6496('0x5f'),_0x6496('0x60'),_0x6496('0x61')]})['then'](handleEntityNotFound(_0x136690,null))[_0x6496('0x29')](function(_0x357efa){if(_0x357efa){_0x3ff576=_0x357efa[_0x6496('0x5d')];_0x386b3d=_0x357efa[_0x6496('0x61')];_0xab0487=_0x357efa[_0x6496('0x62')];_0x57615c=_0x357efa[_0x6496('0x5f')];var _0x5899ff=_0x57615c[_0x6496('0x63')](-0x1);if(_0x5899ff==='/'){_0x57615c=_0x57615c['substring'](0x0,_0x57615c['lastIndexOf'](_0x5899ff));}_0x121c16=util[_0x6496('0x64')]('%s/webservice.php',_0x57615c);var _0x145be0={'method':_0x6496('0x65'),'uri':_0x121c16,'qs':{'operation':_0x6496('0x66'),'username':_0x357efa[_0x6496('0x5d')]},'json':!![]};return rp(_0x145be0);}})[_0x6496('0x29')](function(_0x4453cc){if(_0x4453cc[_0x6496('0x67')]){var _0x1297cc={'method':_0x6496('0x68'),'uri':_0x121c16,'form':{'operation':_0x6496('0x69'),'username':_0x3ff576,'accessKey':md5(_0x4453cc[_0x6496('0x6a')][_0x6496('0x6b')]+_0x386b3d)},'json':!![]};return rp(_0x1297cc);}})[_0x6496('0x29')](function(_0x36d467){if(_0x36d467[_0x6496('0x67')]){var _0x15fac5={'method':'GET','uri':_0x121c16,'qs':{'operation':'describe','username':_0x3ff576,'sessionName':_0x36d467[_0x6496('0x6a')][_0x6496('0x6c')],'elementType':_0xab0487},'json':!![]};return rp(_0x15fac5);}})[_0x6496('0x29')](function(_0x6c36a9){if(_0x6c36a9['success']){var _0x182eaf=['autogenerated',_0x6496('0x6d'),_0x6496('0x6e')];_[_0x6496('0x6f')](_0x6c36a9[_0x6496('0x6a')][_0x6496('0x39')],function(_0x1b3739){return _0x182eaf[_0x6496('0x70')](_0x1b3739[_0x6496('0x57')][_0x6496('0x2c')]);});_['remove'](_0x6c36a9[_0x6496('0x6a')][_0x6496('0x39')],function(_0x2ea4ba){return _0x2ea4ba[_0x6496('0x71')]===_0x6496('0x72');});return{'count':_0x6c36a9[_0x6496('0x6a')][_0x6496('0x39')][_0x6496('0x3a')],'rows':_['map'](_0x6c36a9[_0x6496('0x6a')][_0x6496('0x39')],function(_0x477d50){return{'id':_0x477d50['name'],'name':_0x477d50['label'],'custom':_[_0x6496('0x73')](_0x477d50['name'],_0x6496('0x74'))?!![]:![],'options':_0x477d50[_0x6496('0x57')][_0x6496('0x2c')]===_0x6496('0x75')&&_0x477d50[_0x6496('0x57')]['picklistValues'][_0x6496('0x3a')]>0x0?_[_0x6496('0x2f')](_0x477d50[_0x6496('0x57')][_0x6496('0x76')],function(_0x33fa19){return{'name':_0x33fa19[_0x6496('0x77')],'value':_0x33fa19['value']};}):[]};})};}})[_0x6496('0x29')](respondWithResult(_0x136690,null))[_0x6496('0x4b')](function(_0xbd0fcf){console[_0x6496('0x78')](_0x6496('0x79')+_0xbd0fcf);var _0x507dcc=_0x95eaca[_0x6496('0x35')][_0x6496('0x7a')]?0x1f4:_0xbd0fcf[_0x6496('0x7b')]||0x1f4;logger[_0x6496('0x2a')](_0x6496('0x7c'),_0x6496('0x5c'),_0x507dcc,JSON['stringify'](_0xbd0fcf));delete _0xbd0fcf[_0x6496('0x2c')];if(_0x507dcc===0x191){_0x507dcc=0x190;}_0x136690[_0x6496('0x1d')](_0x507dcc)[_0x6496('0x2d')](_0x95eaca[_0x6496('0x35')][_0x6496('0x7a')]?{'message':_0x6496('0x7d'),'statusCode':_0xbd0fcf[_0x6496('0x7b')]}:_0xbd0fcf);});}; \ No newline at end of file +var _0x09c9=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','destroy','then','stack','name','send','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','update','body','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','format','GET','getchallenge','POST','login','result','token','success','describe','sessionName','reference','owner','remove','editable','false','label','startsWith','picklist','picklistValues','value','vTiger\x20error:\x20','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x09c9,0xe6));var _0x909c=function(_0x5b7c76,_0x1e23a9){_0x5b7c76=_0x5b7c76-0x0;var _0x392bca=_0x09c9[_0x5b7c76];return _0x392bca;};'use strict';var emlformat=require(_0x909c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x909c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x909c('0x2'));var moment=require(_0x909c('0x3'));var BPromise=require(_0x909c('0x4'));var Mustache=require(_0x909c('0x5'));var util=require(_0x909c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x909c('0x7'));var ejs=require(_0x909c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x909c('0x9'));var squel=require(_0x909c('0xa'));var crypto=require(_0x909c('0xb'));var jsforce=require(_0x909c('0xc'));var deskjs=require(_0x909c('0xd'));var toCsv=require(_0x909c('0x7'));var querystring=require(_0x909c('0xe'));var Papa=require(_0x909c('0xf'));var Redis=require('ioredis');var authService=require(_0x909c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x909c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x909c('0x12'))(_0x909c('0x13'));var utils=require(_0x909c('0x14'));var config=require(_0x909c('0x15'));var licenseUtil=require(_0x909c('0x16'));var db=require(_0x909c('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1d078c,_0x9f49ee){_0x9f49ee=_0x9f49ee||0xcc;return function(_0x2e0fc1){if(_0x2e0fc1){return _0x1d078c[_0x909c('0x18')](_0x9f49ee);}return _0x1d078c['status'](_0x9f49ee)[_0x909c('0x19')]();};}function respondWithResult(_0x5bd9b5,_0x4b8dfb){_0x4b8dfb=_0x4b8dfb||0xc8;return function(_0x185011){if(_0x185011){return _0x5bd9b5[_0x909c('0x1a')](_0x4b8dfb)[_0x909c('0x1b')](_0x185011);}};}function respondWithFilteredResult(_0x318d07,_0x3ffe18){return function(_0x422b66){if(_0x422b66){var _0xec9bd=typeof _0x3ffe18['offset']===_0x909c('0x1c')&&typeof _0x3ffe18[_0x909c('0x1d')]===_0x909c('0x1c');var _0x5365ee=_0x422b66['count'];var _0x315879=_0xec9bd?0x0:_0x3ffe18[_0x909c('0x1e')];var _0x3abb90=_0xec9bd?_0x422b66[_0x909c('0x1f')]:_0x3ffe18[_0x909c('0x1e')]+_0x3ffe18['limit'];var _0x4179bb;if(_0x3abb90>=_0x5365ee){_0x3abb90=_0x5365ee;_0x4179bb=0xc8;}else{_0x4179bb=0xce;}_0x318d07[_0x909c('0x1a')](_0x4179bb);return _0x318d07[_0x909c('0x20')](_0x909c('0x21'),_0x315879+'-'+_0x3abb90+'/'+_0x5365ee)[_0x909c('0x1b')](_0x422b66);}return null;};}function patchUpdates(_0x536ba1){return function(_0x4d7d77){try{jsonpatch[_0x909c('0x22')](_0x4d7d77,_0x536ba1,!![]);}catch(_0x37b706){return BPromise['reject'](_0x37b706);}return _0x4d7d77[_0x909c('0x23')]();};}function saveUpdates(_0x199e07,_0x991bda){return function(_0x5c441e){if(_0x5c441e){return _0x5c441e['update'](_0x199e07)['then'](function(_0x1cb1fb){return _0x1cb1fb;});}return null;};}function removeEntity(_0x20439f,_0x148d19){return function(_0x3e5ebd){if(_0x3e5ebd){return _0x3e5ebd[_0x909c('0x24')]()[_0x909c('0x25')](function(){_0x20439f[_0x909c('0x1a')](0xcc)[_0x909c('0x19')]();});}};}function handleEntityNotFound(_0x21687a,_0x138dac){return function(_0x4d65f6){if(!_0x4d65f6){_0x21687a[_0x909c('0x18')](0x194);}return _0x4d65f6;};}function handleError(_0x1669f9,_0x856c55){_0x856c55=_0x856c55||0x1f4;return function(_0x878cca){logger['error'](_0x878cca[_0x909c('0x26')]);if(_0x878cca[_0x909c('0x27')]){delete _0x878cca[_0x909c('0x27')];}_0x1669f9[_0x909c('0x1a')](_0x856c55)[_0x909c('0x28')](_0x878cca);};}exports['index']=function(_0x8d67da,_0x2377b8){var _0x4128ef={},_0x5a2d1d={},_0x41468c={'count':0x0,'rows':[]};var _0x4bd12e=_[_0x909c('0x29')](db[_0x909c('0x2a')][_0x909c('0x2b')],function(_0x4b3474){return{'name':_0x4b3474[_0x909c('0x2c')],'type':_0x4b3474[_0x909c('0x2d')][_0x909c('0x2e')]};});_0x5a2d1d[_0x909c('0x2f')]=_['map'](_0x4bd12e,_0x909c('0x27'));_0x5a2d1d[_0x909c('0x30')]=_[_0x909c('0x31')](_0x8d67da[_0x909c('0x30')]);_0x5a2d1d[_0x909c('0x32')]=_['intersection'](_0x5a2d1d[_0x909c('0x2f')],_0x5a2d1d[_0x909c('0x30')]);_0x4128ef[_0x909c('0x33')]=_['intersection'](_0x5a2d1d['model'],qs[_0x909c('0x34')](_0x8d67da[_0x909c('0x30')][_0x909c('0x34')]));_0x4128ef['attributes']=_0x4128ef[_0x909c('0x33')][_0x909c('0x35')]?_0x4128ef[_0x909c('0x33')]:_0x5a2d1d[_0x909c('0x2f')];if(!_0x8d67da[_0x909c('0x30')]['hasOwnProperty'](_0x909c('0x36'))){_0x4128ef['limit']=qs[_0x909c('0x1d')](_0x8d67da[_0x909c('0x30')][_0x909c('0x1d')]);_0x4128ef[_0x909c('0x1e')]=qs[_0x909c('0x1e')](_0x8d67da[_0x909c('0x30')]['offset']);}_0x4128ef[_0x909c('0x37')]=qs['sort'](_0x8d67da['query'][_0x909c('0x38')]);_0x4128ef[_0x909c('0x39')]=qs[_0x909c('0x32')](_['pick'](_0x8d67da[_0x909c('0x30')],_0x5a2d1d['filters']),_0x4bd12e);if(_0x8d67da[_0x909c('0x30')][_0x909c('0x3a')]){_0x4128ef['where']=_['merge'](_0x4128ef[_0x909c('0x39')],{'$or':_[_0x909c('0x29')](_0x4bd12e,function(_0x5148b3){if(_0x5148b3[_0x909c('0x2d')]!=='VIRTUAL'){var _0x51a80d={};_0x51a80d[_0x5148b3[_0x909c('0x27')]]={'$like':'%'+_0x8d67da['query'][_0x909c('0x3a')]+'%'};return _0x51a80d;}})});}_0x4128ef=_[_0x909c('0x3b')]({},_0x4128ef,_0x8d67da[_0x909c('0x3c')]);var _0x4a0f5d={'where':_0x4128ef[_0x909c('0x39')]};return db[_0x909c('0x2a')][_0x909c('0x1f')](_0x4a0f5d)['then'](function(_0x87af9a){_0x41468c['count']=_0x87af9a;if(_0x8d67da[_0x909c('0x30')][_0x909c('0x3d')]){_0x4128ef[_0x909c('0x3e')]=[{'all':!![]}];}return db[_0x909c('0x2a')][_0x909c('0x3f')](_0x4128ef);})[_0x909c('0x25')](function(_0x24ad8d){_0x41468c[_0x909c('0x40')]=_0x24ad8d;return _0x41468c;})[_0x909c('0x25')](respondWithFilteredResult(_0x2377b8,_0x4128ef))[_0x909c('0x41')](handleError(_0x2377b8,null));};exports['show']=function(_0x1232f5,_0x5024a6){var _0x8273de={'raw':![],'where':{'id':_0x1232f5[_0x909c('0x42')]['id']}},_0x21f793={};_0x21f793[_0x909c('0x2f')]=_['keys'](db[_0x909c('0x2a')][_0x909c('0x2b')]);_0x21f793[_0x909c('0x30')]=_[_0x909c('0x31')](_0x1232f5[_0x909c('0x30')]);_0x21f793[_0x909c('0x32')]=_[_0x909c('0x43')](_0x21f793[_0x909c('0x2f')],_0x21f793[_0x909c('0x30')]);_0x8273de[_0x909c('0x33')]=_[_0x909c('0x43')](_0x21f793['model'],qs[_0x909c('0x34')](_0x1232f5[_0x909c('0x30')][_0x909c('0x34')]));_0x8273de[_0x909c('0x33')]=_0x8273de[_0x909c('0x33')]['length']?_0x8273de[_0x909c('0x33')]:_0x21f793['model'];if(_0x1232f5[_0x909c('0x30')]['includeAll']){_0x8273de['include']=[{'all':!![]}];}_0x8273de=_[_0x909c('0x3b')]({},_0x8273de,_0x1232f5['options']);return db['VtigerAccount'][_0x909c('0x44')](_0x8273de)[_0x909c('0x25')](handleEntityNotFound(_0x5024a6,null))[_0x909c('0x25')](respondWithResult(_0x5024a6,null))[_0x909c('0x41')](handleError(_0x5024a6,null));};exports[_0x909c('0x45')]=function(_0x39e7d9,_0x39bcec){return db[_0x909c('0x2a')][_0x909c('0x45')](_0x39e7d9['body'],{})['then'](respondWithResult(_0x39bcec,0xc9))[_0x909c('0x41')](handleError(_0x39bcec,null));};exports[_0x909c('0x46')]=function(_0x2fda6c,_0x3af14f){if(_0x2fda6c[_0x909c('0x47')]['id']){delete _0x2fda6c['body']['id'];}return db[_0x909c('0x2a')][_0x909c('0x44')]({'where':{'id':_0x2fda6c[_0x909c('0x42')]['id']}})[_0x909c('0x25')](handleEntityNotFound(_0x3af14f,null))[_0x909c('0x25')](saveUpdates(_0x2fda6c[_0x909c('0x47')],null))[_0x909c('0x25')](respondWithResult(_0x3af14f,null))[_0x909c('0x41')](handleError(_0x3af14f,null));};exports[_0x909c('0x24')]=function(_0x3bd342,_0xc63bb7){return db['VtigerAccount'][_0x909c('0x44')]({'where':{'id':_0x3bd342[_0x909c('0x42')]['id']}})[_0x909c('0x25')](handleEntityNotFound(_0xc63bb7,null))[_0x909c('0x25')](removeEntity(_0xc63bb7,null))[_0x909c('0x41')](handleError(_0xc63bb7,null));};exports[_0x909c('0x48')]=function(_0x15c14c,_0x1cc605,_0x412cff){var _0x117644={};var _0x104c00={};var _0x2482d9;var _0x4e5880;return db[_0x909c('0x2a')][_0x909c('0x49')]({'where':{'id':_0x15c14c[_0x909c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1cc605,null))[_0x909c('0x25')](function(_0x934f6b){if(_0x934f6b){_0x2482d9=_0x934f6b;_0x104c00['model']=_['keys'](db['VtigerConfiguration'][_0x909c('0x2b')]);_0x104c00[_0x909c('0x30')]=_[_0x909c('0x31')](_0x15c14c[_0x909c('0x30')]);_0x104c00['filters']=_['intersection'](_0x104c00['model'],_0x104c00['query']);_0x117644[_0x909c('0x33')]=_[_0x909c('0x43')](_0x104c00[_0x909c('0x2f')],qs[_0x909c('0x34')](_0x15c14c[_0x909c('0x30')][_0x909c('0x34')]));_0x117644[_0x909c('0x33')]=_0x117644['attributes'][_0x909c('0x35')]?_0x117644['attributes']:_0x104c00[_0x909c('0x2f')];_0x117644[_0x909c('0x37')]=qs[_0x909c('0x38')](_0x15c14c[_0x909c('0x30')][_0x909c('0x38')]);_0x117644[_0x909c('0x39')]=qs['filters'](_[_0x909c('0x4a')](_0x15c14c['query'],_0x104c00[_0x909c('0x32')]));if(_0x15c14c[_0x909c('0x30')][_0x909c('0x3a')]){_0x117644[_0x909c('0x39')]=_['merge'](_0x117644[_0x909c('0x39')],{'$or':_[_0x909c('0x29')](_0x117644[_0x909c('0x33')],function(_0x21d6ca){var _0x709acf={};_0x709acf[_0x21d6ca]={'$like':'%'+_0x15c14c[_0x909c('0x30')]['filter']+'%'};return _0x709acf;})});}_0x117644=_[_0x909c('0x3b')]({},_0x117644,_0x15c14c['options']);return _0x2482d9['getConfigurations'](_0x117644);}})[_0x909c('0x25')](function(_0x1297cc){if(_0x1297cc){_0x4e5880=_0x1297cc['length'];if(!_0x15c14c[_0x909c('0x30')]['hasOwnProperty'](_0x909c('0x36'))){_0x117644[_0x909c('0x1d')]=qs[_0x909c('0x1d')](_0x15c14c['query']['limit']);_0x117644[_0x909c('0x1e')]=qs[_0x909c('0x1e')](_0x15c14c[_0x909c('0x30')][_0x909c('0x1e')]);}return _0x2482d9['getConfigurations'](_0x117644);}})[_0x909c('0x25')](function(_0x305852){if(_0x305852){return _0x305852?{'count':_0x4e5880,'rows':_0x305852}:null;}})[_0x909c('0x25')](respondWithResult(_0x1cc605,null))[_0x909c('0x41')](handleError(_0x1cc605,null));};exports[_0x909c('0x4b')]=function(_0x160348,_0x5a0eaf,_0x21640b){if(_0x160348['body']['id']){delete _0x160348[_0x909c('0x47')]['id'];}return db['VtigerAccount'][_0x909c('0x49')]({'where':{'id':_0x160348[_0x909c('0x42')]['id']}})[_0x909c('0x25')](handleEntityNotFound(_0x5a0eaf,null))[_0x909c('0x25')](function(_0x2f0808){if(_0x2f0808){_0x160348[_0x909c('0x47')][_0x909c('0x4c')]=_0x2f0808['id'];_0x160348[_0x909c('0x47')][_0x909c('0x4d')]=integrations[_0x909c('0x4e')](_0x160348[_0x909c('0x47')][_0x909c('0x4f')],_0x160348[_0x909c('0x47')]['type']);_0x160348[_0x909c('0x47')][_0x909c('0x50')]=integrations[_0x909c('0x51')](_0x160348[_0x909c('0x47')][_0x909c('0x4f')],_0x160348[_0x909c('0x47')][_0x909c('0x2d')]);return db[_0x909c('0x52')][_0x909c('0x45')](_0x160348[_0x909c('0x47')],{'include':[{'model':db[_0x909c('0x53')],'as':_0x909c('0x4d')},{'model':db[_0x909c('0x53')],'as':_0x909c('0x50')}]});}return null;})[_0x909c('0x25')](respondWithResult(_0x5a0eaf,null))[_0x909c('0x41')](handleError(_0x5a0eaf,null));};var md5=require(_0x909c('0x54'));exports[_0x909c('0x55')]=function(_0x13d113,_0x1b06c2,_0x516670){var _0x557e5c=null;var _0x39c453=null;var _0x56fb76=null;var _0x1396a6=null;var _0x5079a1='';return db[_0x909c('0x2a')][_0x909c('0x49')]({'where':{'id':_0x13d113[_0x909c('0x42')]['id']},'attributes':['id',_0x909c('0x27'),_0x909c('0x56'),_0x909c('0x57'),_0x909c('0x58'),_0x909c('0x59'),_0x909c('0x5a'),'accessKey']})[_0x909c('0x25')](handleEntityNotFound(_0x1b06c2,null))[_0x909c('0x25')](function(_0x48edce){if(_0x48edce){_0x557e5c=_0x48edce[_0x909c('0x56')];_0x39c453=_0x48edce[_0x909c('0x5b')];_0x56fb76=_0x48edce[_0x909c('0x58')];_0x5079a1=_0x48edce[_0x909c('0x59')];var _0x43eff8=_0x5079a1[_0x909c('0x5c')](-0x1);if(_0x43eff8==='/'){_0x5079a1=_0x5079a1['substring'](0x0,_0x5079a1[_0x909c('0x5d')](_0x43eff8));}_0x1396a6=util[_0x909c('0x5e')]('%s/webservice.php',_0x5079a1);var _0x4336f7={'method':_0x909c('0x5f'),'uri':_0x1396a6,'qs':{'operation':_0x909c('0x60'),'username':_0x48edce[_0x909c('0x56')]},'json':!![]};return rp(_0x4336f7);}})[_0x909c('0x25')](function(_0x3bbe8f){if(_0x3bbe8f['success']){var _0x3fb343={'method':_0x909c('0x61'),'uri':_0x1396a6,'form':{'operation':_0x909c('0x62'),'username':_0x557e5c,'accessKey':md5(_0x3bbe8f[_0x909c('0x63')][_0x909c('0x64')]+_0x39c453)},'json':!![]};return rp(_0x3fb343);}})[_0x909c('0x25')](function(_0x550cca){if(_0x550cca[_0x909c('0x65')]){var _0x2270a2={'method':_0x909c('0x5f'),'uri':_0x1396a6,'qs':{'operation':_0x909c('0x66'),'username':_0x557e5c,'sessionName':_0x550cca[_0x909c('0x63')][_0x909c('0x67')],'elementType':_0x56fb76},'json':!![]};return rp(_0x2270a2);}})['then'](function(_0x302152){if(_0x302152[_0x909c('0x65')]){var _0x15e1fd=['autogenerated',_0x909c('0x68'),_0x909c('0x69')];_[_0x909c('0x6a')](_0x302152[_0x909c('0x63')][_0x909c('0x34')],function(_0x485561){return _0x15e1fd['includes'](_0x485561[_0x909c('0x2d')][_0x909c('0x27')]);});_[_0x909c('0x6a')](_0x302152[_0x909c('0x63')][_0x909c('0x34')],function(_0x15edef){return _0x15edef[_0x909c('0x6b')]===_0x909c('0x6c');});return{'count':_0x302152[_0x909c('0x63')][_0x909c('0x34')][_0x909c('0x35')],'rows':_[_0x909c('0x29')](_0x302152[_0x909c('0x63')]['fields'],function(_0xba3771){return{'id':_0xba3771['name'],'name':_0xba3771[_0x909c('0x6d')],'custom':_[_0x909c('0x6e')](_0xba3771[_0x909c('0x27')],'cf_')?!![]:![],'options':_0xba3771[_0x909c('0x2d')][_0x909c('0x27')]===_0x909c('0x6f')&&_0xba3771[_0x909c('0x2d')][_0x909c('0x70')][_0x909c('0x35')]>0x0?_[_0x909c('0x29')](_0xba3771[_0x909c('0x2d')][_0x909c('0x70')],function(_0x34d72e){return{'name':_0x34d72e[_0x909c('0x6d')],'value':_0x34d72e[_0x909c('0x71')]};}):[]};})};}})[_0x909c('0x25')](respondWithResult(_0x1b06c2,null))[_0x909c('0x41')](function(_0x4b5ecf){console['log'](_0x909c('0x72')+_0x4b5ecf);var _0x28367f=_0x13d113[_0x909c('0x30')][_0x909c('0x73')]?0x1f4:_0x4b5ecf['statusCode']||0x1f4;logger[_0x909c('0x74')](_0x909c('0x75'),_0x909c('0x55'),_0x28367f,JSON[_0x909c('0x76')](_0x4b5ecf));delete _0x4b5ecf[_0x909c('0x27')];if(_0x28367f===0x191){_0x28367f=0x190;}_0x1b06c2['status'](_0x28367f)['send'](_0x13d113[_0x909c('0x30')][_0x909c('0x73')]?{'message':_0x909c('0x77'),'statusCode':_0x4b5ecf[_0x909c('0x78')]}:_0x4b5ecf);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index a9b18e0..9e34bf1 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 _0x4c85=['path','../../config/environment','./intVtigerAccount.attributes','VtigerAccount','int_vtiger_accounts','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3f9227,_0x2103a9){var _0x41a2e8=function(_0x36d241){while(--_0x36d241){_0x3f9227['push'](_0x3f9227['shift']());}};_0x41a2e8(++_0x2103a9);}(_0x4c85,0xec));var _0x54c8=function(_0x3fc360,_0x4ce4bd){_0x3fc360=_0x3fc360-0x0;var _0x3dc5e8=_0x4c85[_0x3fc360];return _0x3dc5e8;};'use strict';var _=require(_0x54c8('0x0'));var util=require(_0x54c8('0x1'));var logger=require('../../config/logger')(_0x54c8('0x2'));var moment=require(_0x54c8('0x3'));var BPromise=require(_0x54c8('0x4'));var rp=require(_0x54c8('0x5'));var fs=require('fs');var path=require(_0x54c8('0x6'));var rimraf=require('rimraf');var config=require(_0x54c8('0x7'));var attributes=require(_0x54c8('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x73fc8a,_0x415547){return _0x73fc8a['define'](_0x54c8('0x9'),attributes,{'tableName':_0x54c8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03e9=['moment','bluebird','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','api'];(function(_0x380602,_0x412490){var _0x38a0b6=function(_0x74880c){while(--_0x74880c){_0x380602['push'](_0x380602['shift']());}};_0x38a0b6(++_0x412490);}(_0x03e9,0x13f));var _0x903e=function(_0x55fa4f,_0x25147d){_0x55fa4f=_0x55fa4f-0x0;var _0x46c540=_0x03e9[_0x55fa4f];return _0x46c540;};'use strict';var _=require(_0x903e('0x0'));var util=require(_0x903e('0x1'));var logger=require('../../config/logger')(_0x903e('0x2'));var moment=require(_0x903e('0x3'));var BPromise=require(_0x903e('0x4'));var rp=require(_0x903e('0x5'));var fs=require('fs');var path=require(_0x903e('0x6'));var rimraf=require(_0x903e('0x7'));var config=require('../../config/environment');var attributes=require(_0x903e('0x8'));var integrations=require(_0x903e('0x9'));module[_0x903e('0xa')]=function(_0x2431ce,_0x36e697){return _0x2431ce[_0x903e('0xb')](_0x903e('0xc'),attributes,{'tableName':_0x903e('0xd'),'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 b1bf027..376330f 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 _0x0bb5=['VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','options','raw','where','limit','map','include','model','attributes','GetVtigerAccount','ShowVtigerAccount','VtigerAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info'];(function(_0x15bb39,_0x42bd41){var _0x88fadc=function(_0x177f6c){while(--_0x177f6c){_0x15bb39['push'](_0x15bb39['shift']());}};_0x88fadc(++_0x42bd41);}(_0x0bb5,0x148));var _0x50bb=function(_0x1ebc83,_0xb22e3){_0x1ebc83=_0x1ebc83-0x0;var _0x21a9b2=_0x0bb5[_0x1ebc83];return _0x21a9b2;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50bb('0x2'));var fs=require('fs');var Redis=require(_0x50bb('0x3'));var db=require(_0x50bb('0x4'))['db'];var utils=require(_0x50bb('0x5'));var logger=require(_0x50bb('0x6'))(_0x50bb('0x7'));var config=require(_0x50bb('0x8'));var jayson=require(_0x50bb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfd7aeb,_0x35de5d,_0x2e5463){return new BPromise(function(_0x33ff54,_0x4f9172){return client['request'](_0xfd7aeb,_0x2e5463)[_0x50bb('0xa')](function(_0x1c2174){logger[_0x50bb('0xb')](_0x50bb('0xc'),_0x35de5d,'request\x20sent');logger[_0x50bb('0xd')](_0x50bb('0xe'),_0x35de5d,_0x50bb('0xf'),JSON[_0x50bb('0x10')](_0x1c2174));if(_0x1c2174[_0x50bb('0x11')]){if(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x12')]===0x1f4){logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174['error'][_0x50bb('0x13')]);return _0x4f9172(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);}logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);return _0x33ff54(_0x1c2174['error'][_0x50bb('0x13')]);}else{logger['info'](_0x50bb('0xc'),_0x35de5d,_0x50bb('0xf'));_0x33ff54(_0x1c2174[_0x50bb('0x14')][_0x50bb('0x13')]);}})[_0x50bb('0x15')](function(_0x4f2897){logger[_0x50bb('0x11')](_0x50bb('0xc'),_0x35de5d,_0x4f2897);_0x4f9172(_0x4f2897);});});}exports['GetVtigerAccount']=function(_0x24ba19){var _0x4796ec=this;return new Promise(function(_0x301f61,_0x431ed4){return db['VtigerAccount']['findAll']({'raw':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')][_0x50bb('0x17')]===undefined?!![]:![]:!![],'where':_0x24ba19[_0x50bb('0x16')]?_0x24ba19['options'][_0x50bb('0x18')]||null:null,'attributes':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')]['attributes']||null:null,'limit':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')][_0x50bb('0x19')]||null:null,'include':_0x24ba19['options']?_0x24ba19[_0x50bb('0x16')]['include']?_[_0x50bb('0x1a')](_0x24ba19[_0x50bb('0x16')][_0x50bb('0x1b')],function(_0x2ee87a){return{'model':db[_0x2ee87a[_0x50bb('0x1c')]],'as':_0x2ee87a['as'],'attributes':_0x2ee87a[_0x50bb('0x1d')],'include':_0x2ee87a['include']?_[_0x50bb('0x1a')](_0x2ee87a[_0x50bb('0x1b')],function(_0x284a76){return{'model':db[_0x284a76[_0x50bb('0x1c')]],'as':_0x284a76['as'],'attributes':_0x284a76['attributes'],'include':_0x284a76[_0x50bb('0x1b')]?_['map'](_0x284a76['include'],function(_0x2befd9){return{'model':db[_0x2befd9['model']],'as':_0x2befd9['as'],'attributes':_0x2befd9['attributes']};}):[]};}):[]};}):[]:[]})[_0x50bb('0xa')](function(_0x12ee2c){logger[_0x50bb('0xb')](_0x50bb('0x1e'),_0x24ba19);logger[_0x50bb('0xd')](_0x50bb('0x1e'),_0x24ba19,JSON[_0x50bb('0x10')](_0x12ee2c));_0x301f61(_0x12ee2c);})[_0x50bb('0x15')](function(_0x4f7514){logger[_0x50bb('0x11')](_0x50bb('0x1e'),_0x4f7514[_0x50bb('0x13')],_0x24ba19);_0x431ed4(_0x4796ec[_0x50bb('0x11')](0x1f4,_0x4f7514['message']));});});};exports[_0x50bb('0x1f')]=function(_0x1a62fb){var _0xc38da5=this;return new Promise(function(_0xb3c3ba,_0x3fd5f6){return db[_0x50bb('0x20')][_0x50bb('0x21')]({'raw':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x17')]===undefined?!![]:![]:!![],'where':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')]['where']||null:null,'attributes':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1d')]||null:null,'include':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1b')]?_[_0x50bb('0x1a')](_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1b')],function(_0x1cc4e2){return{'model':db[_0x1cc4e2[_0x50bb('0x1c')]],'as':_0x1cc4e2['as'],'attributes':_0x1cc4e2['attributes'],'include':_0x1cc4e2[_0x50bb('0x1b')]?_[_0x50bb('0x1a')](_0x1cc4e2[_0x50bb('0x1b')],function(_0x2bfb54){return{'model':db[_0x2bfb54[_0x50bb('0x1c')]],'as':_0x2bfb54['as'],'attributes':_0x2bfb54[_0x50bb('0x1d')],'include':_0x2bfb54['include']?_['map'](_0x2bfb54[_0x50bb('0x1b')],function(_0x5ed0b4){return{'model':db[_0x5ed0b4[_0x50bb('0x1c')]],'as':_0x5ed0b4['as'],'attributes':_0x5ed0b4[_0x50bb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x50bb('0xa')](function(_0x171c6b){logger[_0x50bb('0xb')]('ShowVtigerAccount',_0x1a62fb);logger[_0x50bb('0xd')]('ShowVtigerAccount',_0x1a62fb,JSON[_0x50bb('0x10')](_0x171c6b));_0xb3c3ba(_0x171c6b);})[_0x50bb('0x15')](function(_0x280e5a){logger['error']('ShowVtigerAccount',_0x280e5a[_0x50bb('0x13')],_0x1a62fb);_0x3fd5f6(_0xc38da5[_0x50bb('0x11')](0x1f4,_0x280e5a[_0x50bb('0x13')]));});});}; \ No newline at end of file +var _0x63a5=['then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','raw','options','where','attributes','limit','include','map','model','GetVtigerAccount','ShowVtigerAccount','VtigerAccount','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request'];(function(_0x4a4bc9,_0xd8cbdb){var _0x3589ca=function(_0x11e401){while(--_0x11e401){_0x4a4bc9['push'](_0x4a4bc9['shift']());}};_0x3589ca(++_0xd8cbdb);}(_0x63a5,0x18e));var _0x563a=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x63a5[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var moment=require(_0x563a('0x2'));var BPromise=require('bluebird');var rs=require(_0x563a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x563a('0x4'))['db'];var utils=require(_0x563a('0x5'));var logger=require(_0x563a('0x6'))(_0x563a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x563a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2662f7,_0x4f89b4,_0x4d71a0){return new BPromise(function(_0x543920,_0xff1f59){return client[_0x563a('0x9')](_0x2662f7,_0x4d71a0)[_0x563a('0xa')](function(_0x606235){logger[_0x563a('0xb')](_0x563a('0xc'),_0x4f89b4,_0x563a('0xd'));logger[_0x563a('0xe')](_0x563a('0xf'),_0x4f89b4,_0x563a('0xd'),JSON[_0x563a('0x10')](_0x606235));if(_0x606235[_0x563a('0x11')]){if(_0x606235[_0x563a('0x11')][_0x563a('0x12')]===0x1f4){logger['error'](_0x563a('0xc'),_0x4f89b4,_0x606235[_0x563a('0x11')][_0x563a('0x13')]);return _0xff1f59(_0x606235[_0x563a('0x11')][_0x563a('0x13')]);}logger[_0x563a('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x4f89b4,_0x606235[_0x563a('0x11')][_0x563a('0x13')]);return _0x543920(_0x606235[_0x563a('0x11')][_0x563a('0x13')]);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x4f89b4,_0x563a('0xd'));_0x543920(_0x606235[_0x563a('0x14')]['message']);}})[_0x563a('0x15')](function(_0x43fb16){logger[_0x563a('0x11')](_0x563a('0xc'),_0x4f89b4,_0x43fb16);_0xff1f59(_0x43fb16);});});}exports['GetVtigerAccount']=function(_0x598693){var _0xe3d2bd=this;return new Promise(function(_0x422aaf,_0x54a3b4){return db['VtigerAccount']['findAll']({'raw':_0x598693['options']?_0x598693['options'][_0x563a('0x16')]===undefined?!![]:![]:!![],'where':_0x598693[_0x563a('0x17')]?_0x598693[_0x563a('0x17')][_0x563a('0x18')]||null:null,'attributes':_0x598693['options']?_0x598693['options'][_0x563a('0x19')]||null:null,'limit':_0x598693[_0x563a('0x17')]?_0x598693[_0x563a('0x17')][_0x563a('0x1a')]||null:null,'include':_0x598693[_0x563a('0x17')]?_0x598693[_0x563a('0x17')][_0x563a('0x1b')]?_[_0x563a('0x1c')](_0x598693['options'][_0x563a('0x1b')],function(_0x5422f6){return{'model':db[_0x5422f6[_0x563a('0x1d')]],'as':_0x5422f6['as'],'attributes':_0x5422f6[_0x563a('0x19')],'include':_0x5422f6[_0x563a('0x1b')]?_[_0x563a('0x1c')](_0x5422f6[_0x563a('0x1b')],function(_0x1682ee){return{'model':db[_0x1682ee[_0x563a('0x1d')]],'as':_0x1682ee['as'],'attributes':_0x1682ee[_0x563a('0x19')],'include':_0x1682ee['include']?_[_0x563a('0x1c')](_0x1682ee[_0x563a('0x1b')],function(_0x2311f2){return{'model':db[_0x2311f2[_0x563a('0x1d')]],'as':_0x2311f2['as'],'attributes':_0x2311f2[_0x563a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x563a('0xa')](function(_0x1afdff){logger[_0x563a('0xb')](_0x563a('0x1e'),_0x598693);logger[_0x563a('0xe')](_0x563a('0x1e'),_0x598693,JSON[_0x563a('0x10')](_0x1afdff));_0x422aaf(_0x1afdff);})[_0x563a('0x15')](function(_0x7696c2){logger['error'](_0x563a('0x1e'),_0x7696c2[_0x563a('0x13')],_0x598693);_0x54a3b4(_0xe3d2bd[_0x563a('0x11')](0x1f4,_0x7696c2['message']));});});};exports[_0x563a('0x1f')]=function(_0x2e5c4b){var _0x3a59cb=this;return new Promise(function(_0x28a8f6,_0x166f89){return db[_0x563a('0x20')][_0x563a('0x21')]({'raw':_0x2e5c4b['options']?_0x2e5c4b[_0x563a('0x17')][_0x563a('0x16')]===undefined?!![]:![]:!![],'where':_0x2e5c4b[_0x563a('0x17')]?_0x2e5c4b[_0x563a('0x17')][_0x563a('0x18')]||null:null,'attributes':_0x2e5c4b['options']?_0x2e5c4b['options']['attributes']||null:null,'include':_0x2e5c4b['options']?_0x2e5c4b[_0x563a('0x17')][_0x563a('0x1b')]?_[_0x563a('0x1c')](_0x2e5c4b[_0x563a('0x17')][_0x563a('0x1b')],function(_0x3dc83a){return{'model':db[_0x3dc83a['model']],'as':_0x3dc83a['as'],'attributes':_0x3dc83a['attributes'],'include':_0x3dc83a[_0x563a('0x1b')]?_[_0x563a('0x1c')](_0x3dc83a[_0x563a('0x1b')],function(_0x3a3423){return{'model':db[_0x3a3423[_0x563a('0x1d')]],'as':_0x3a3423['as'],'attributes':_0x3a3423[_0x563a('0x19')],'include':_0x3a3423[_0x563a('0x1b')]?_[_0x563a('0x1c')](_0x3a3423[_0x563a('0x1b')],function(_0x4d98be){return{'model':db[_0x4d98be[_0x563a('0x1d')]],'as':_0x4d98be['as'],'attributes':_0x4d98be[_0x563a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x563a('0xa')](function(_0xa334b7){logger[_0x563a('0xb')](_0x563a('0x1f'),_0x2e5c4b);logger['debug'](_0x563a('0x1f'),_0x2e5c4b,JSON[_0x563a('0x10')](_0xa334b7));_0x28a8f6(_0xa334b7);})[_0x563a('0x15')](function(_0x5abfe4){logger[_0x563a('0x11')]('ShowVtigerAccount',_0x5abfe4[_0x563a('0x13')],_0x2e5c4b);_0x166f89(_0x3a59cb[_0x563a('0x11')](0x1f4,_0x5abfe4['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 068b171..a7808a4 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 _0xff08=['getDescriptions','post','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0xf2ee1d,_0x21796d){var _0x250b14=function(_0x40a4fb){while(--_0x40a4fb){_0xf2ee1d['push'](_0xf2ee1d['shift']());}};_0x250b14(++_0x21796d);}(_0xff08,0xb6));var _0x8ff0=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xff08[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8ff0('0x0'));var timeout=require(_0x8ff0('0x1'));var express=require(_0x8ff0('0x2'));var router=express[_0x8ff0('0x3')]();var fs_extra=require(_0x8ff0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8ff0('0x5'));var config=require(_0x8ff0('0x6'));var controller=require('./intVtigerConfiguration.controller');router[_0x8ff0('0x7')]('/',auth[_0x8ff0('0x8')](),controller[_0x8ff0('0x9')]);router[_0x8ff0('0x7')](_0x8ff0('0xa'),auth[_0x8ff0('0x8')](),controller[_0x8ff0('0xb')]);router[_0x8ff0('0x7')]('/:id/fields',auth[_0x8ff0('0x8')](),controller[_0x8ff0('0xc')]);router[_0x8ff0('0x7')](_0x8ff0('0xd'),auth[_0x8ff0('0x8')](),controller[_0x8ff0('0xe')]);router[_0x8ff0('0x7')](_0x8ff0('0xf'),auth['isAuthenticated'](),controller[_0x8ff0('0x10')]);router[_0x8ff0('0x11')]('/',auth[_0x8ff0('0x8')](),controller['create']);router['put'](_0x8ff0('0xa'),auth[_0x8ff0('0x8')](),controller[_0x8ff0('0x12')]);router[_0x8ff0('0x13')](_0x8ff0('0xa'),auth['isAuthenticated'](),controller[_0x8ff0('0x14')]);module[_0x8ff0('0x15')]=router; \ No newline at end of file +var _0x2a1b=['/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x3b79da,_0x5e8135){var _0x46ec86=function(_0x36e7b3){while(--_0x36e7b3){_0x3b79da['push'](_0x3b79da['shift']());}};_0x46ec86(++_0x5e8135);}(_0x2a1b,0x16c));var _0xb2a1=function(_0x47107b,_0xd9f931){_0x47107b=_0x47107b-0x0;var _0x22c078=_0x2a1b[_0x47107b];return _0x22c078;};'use strict';var multer=require(_0xb2a1('0x0'));var util=require('util');var path=require(_0xb2a1('0x1'));var timeout=require(_0xb2a1('0x2'));var express=require(_0xb2a1('0x3'));var router=express[_0xb2a1('0x4')]();var fs_extra=require(_0xb2a1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb2a1('0x6'));var config=require(_0xb2a1('0x7'));var controller=require('./intVtigerConfiguration.controller');router['get']('/',auth[_0xb2a1('0x8')](),controller['index']);router['get']('/:id',auth[_0xb2a1('0x8')](),controller['show']);router[_0xb2a1('0x9')](_0xb2a1('0xa'),auth[_0xb2a1('0x8')](),controller[_0xb2a1('0xb')]);router[_0xb2a1('0x9')]('/:id/subjects',auth[_0xb2a1('0x8')](),controller[_0xb2a1('0xc')]);router['get'](_0xb2a1('0xd'),auth['isAuthenticated'](),controller[_0xb2a1('0xe')]);router[_0xb2a1('0xf')]('/',auth[_0xb2a1('0x8')](),controller[_0xb2a1('0x10')]);router[_0xb2a1('0x11')](_0xb2a1('0x12'),auth[_0xb2a1('0x8')](),controller[_0xb2a1('0x13')]);router[_0xb2a1('0x14')](_0xb2a1('0x12'),auth[_0xb2a1('0x8')](),controller['destroy']);module[_0xb2a1('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 617eb8c..475c88c 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 _0xa633=['sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa633,0x10c));var _0x3a63=function(_0x1f1a54,_0x7db8c0){_0x1f1a54=_0x1f1a54-0x0;var _0x10cb3c=_0xa633[_0x1f1a54];return _0x10cb3c;};'use strict';var Sequelize=require(_0x3a63('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3a63('0x1')]}}; \ No newline at end of file +var _0xabf9=['STRING','sequelize'];(function(_0x1796bc,_0x1d8a78){var _0x3a381f=function(_0x3a8e5d){while(--_0x3a8e5d){_0x1796bc['push'](_0x1796bc['shift']());}};_0x3a381f(++_0x1d8a78);}(_0xabf9,0x165));var _0x9abf=function(_0x5085c6,_0x4608f8){_0x5085c6=_0x5085c6-0x0;var _0x3654a5=_0xabf9[_0x5085c6];return _0x3654a5;};'use strict';var Sequelize=require(_0x9abf('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9abf('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 0ede6de..e1257f2 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 _0xfa09=['set','Content-Range','apply','update','then','destroy','sendStatus','name','index','map','VtigerConfiguration','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','create','body','find','getFields','VtigerField','sort','getSubjects','nolimit','getDescriptions','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','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','count','offset','limit'];(function(_0x1fa5c8,_0x5530cb){var _0x28548a=function(_0x57019e){while(--_0x57019e){_0x1fa5c8['push'](_0x1fa5c8['shift']());}};_0x28548a(++_0x5530cb);}(_0xfa09,0x7f));var _0x9fa0=function(_0x360f84,_0x1140be){_0x360f84=_0x360f84-0x0;var _0xc74a90=_0xfa09[_0x360f84];return _0xc74a90;};'use strict';var emlformat=require(_0x9fa0('0x0'));var rimraf=require(_0x9fa0('0x1'));var zipdir=require(_0x9fa0('0x2'));var jsonpatch=require(_0x9fa0('0x3'));var rp=require(_0x9fa0('0x4'));var moment=require(_0x9fa0('0x5'));var BPromise=require(_0x9fa0('0x6'));var Mustache=require(_0x9fa0('0x7'));var util=require(_0x9fa0('0x8'));var path=require(_0x9fa0('0x9'));var sox=require(_0x9fa0('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9fa0('0xb'));var _=require(_0x9fa0('0xc'));var squel=require(_0x9fa0('0xd'));var crypto=require(_0x9fa0('0xe'));var jsforce=require(_0x9fa0('0xf'));var deskjs=require(_0x9fa0('0x10'));var toCsv=require(_0x9fa0('0x11'));var querystring=require(_0x9fa0('0x12'));var Papa=require(_0x9fa0('0x13'));var Redis=require('ioredis');var authService=require(_0x9fa0('0x14'));var qs=require(_0x9fa0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9fa0('0x16'));var logger=require(_0x9fa0('0x17'))(_0x9fa0('0x18'));var utils=require(_0x9fa0('0x19'));var config=require(_0x9fa0('0x1a'));var licenseUtil=require(_0x9fa0('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c666e,_0xea4a02){_0xea4a02=_0xea4a02||0xcc;return function(_0x3c1d96){if(_0x3c1d96){return _0x3c666e['sendStatus'](_0xea4a02);}return _0x3c666e[_0x9fa0('0x1c')](_0xea4a02)[_0x9fa0('0x1d')]();};}function respondWithResult(_0x91eed8,_0x246673){_0x246673=_0x246673||0xc8;return function(_0x282d37){if(_0x282d37){return _0x91eed8[_0x9fa0('0x1c')](_0x246673)[_0x9fa0('0x1e')](_0x282d37);}};}function respondWithFilteredResult(_0x412799,_0x531e92){return function(_0x42e230){if(_0x42e230){var _0x2a2282=typeof _0x531e92['offset']===_0x9fa0('0x1f')&&typeof _0x531e92['limit']===_0x9fa0('0x1f');var _0x295829=_0x42e230[_0x9fa0('0x20')];var _0x59ddd6=_0x2a2282?0x0:_0x531e92['offset'];var _0x5e1ada=_0x2a2282?_0x42e230[_0x9fa0('0x20')]:_0x531e92[_0x9fa0('0x21')]+_0x531e92[_0x9fa0('0x22')];var _0x4c0952;if(_0x5e1ada>=_0x295829){_0x5e1ada=_0x295829;_0x4c0952=0xc8;}else{_0x4c0952=0xce;}_0x412799['status'](_0x4c0952);return _0x412799[_0x9fa0('0x23')](_0x9fa0('0x24'),_0x59ddd6+'-'+_0x5e1ada+'/'+_0x295829)[_0x9fa0('0x1e')](_0x42e230);}return null;};}function patchUpdates(_0x48dad7){return function(_0xc74cc){try{jsonpatch[_0x9fa0('0x25')](_0xc74cc,_0x48dad7,!![]);}catch(_0x49fccb){return BPromise['reject'](_0x49fccb);}return _0xc74cc['save']();};}function saveUpdates(_0x529a46,_0x12b020){return function(_0x16c250){if(_0x16c250){return _0x16c250[_0x9fa0('0x26')](_0x529a46)[_0x9fa0('0x27')](function(_0x492bb2){return _0x492bb2;});}return null;};}function removeEntity(_0x377722,_0x706965){return function(_0x1c7e38){if(_0x1c7e38){return _0x1c7e38[_0x9fa0('0x28')]()[_0x9fa0('0x27')](function(){_0x377722[_0x9fa0('0x1c')](0xcc)[_0x9fa0('0x1d')]();});}};}function handleEntityNotFound(_0x1d9b73,_0x5be2b6){return function(_0x3929bf){if(!_0x3929bf){_0x1d9b73[_0x9fa0('0x29')](0x194);}return _0x3929bf;};}function handleError(_0x3f0ec1,_0xe02983){_0xe02983=_0xe02983||0x1f4;return function(_0x5278c3){logger['error'](_0x5278c3['stack']);if(_0x5278c3[_0x9fa0('0x2a')]){delete _0x5278c3[_0x9fa0('0x2a')];}_0x3f0ec1[_0x9fa0('0x1c')](_0xe02983)['send'](_0x5278c3);};}exports[_0x9fa0('0x2b')]=function(_0x51ab00,_0x1378f0){var _0x3e34d3={},_0x4786b6={},_0x2fdc30={'count':0x0,'rows':[]};var _0x67143f=_[_0x9fa0('0x2c')](db[_0x9fa0('0x2d')]['rawAttributes'],function(_0x1ea245){return{'name':_0x1ea245[_0x9fa0('0x2e')],'type':_0x1ea245[_0x9fa0('0x2f')]['key']};});_0x4786b6[_0x9fa0('0x30')]=_[_0x9fa0('0x2c')](_0x67143f,_0x9fa0('0x2a'));_0x4786b6[_0x9fa0('0x31')]=_[_0x9fa0('0x32')](_0x51ab00[_0x9fa0('0x31')]);_0x4786b6[_0x9fa0('0x33')]=_[_0x9fa0('0x34')](_0x4786b6[_0x9fa0('0x30')],_0x4786b6[_0x9fa0('0x31')]);_0x3e34d3[_0x9fa0('0x35')]=_[_0x9fa0('0x34')](_0x4786b6[_0x9fa0('0x30')],qs['fields'](_0x51ab00['query']['fields']));_0x3e34d3['attributes']=_0x3e34d3[_0x9fa0('0x35')][_0x9fa0('0x36')]?_0x3e34d3[_0x9fa0('0x35')]:_0x4786b6['model'];if(!_0x51ab00[_0x9fa0('0x31')][_0x9fa0('0x37')]('nolimit')){_0x3e34d3[_0x9fa0('0x22')]=qs[_0x9fa0('0x22')](_0x51ab00['query'][_0x9fa0('0x22')]);_0x3e34d3['offset']=qs[_0x9fa0('0x21')](_0x51ab00[_0x9fa0('0x31')][_0x9fa0('0x21')]);}_0x3e34d3[_0x9fa0('0x38')]=qs['sort'](_0x51ab00[_0x9fa0('0x31')]['sort']);_0x3e34d3[_0x9fa0('0x39')]=qs['filters'](_[_0x9fa0('0x3a')](_0x51ab00[_0x9fa0('0x31')],_0x4786b6[_0x9fa0('0x33')]),_0x67143f);if(_0x51ab00[_0x9fa0('0x31')][_0x9fa0('0x3b')]){_0x3e34d3[_0x9fa0('0x39')]=_['merge'](_0x3e34d3[_0x9fa0('0x39')],{'$or':_['map'](_0x67143f,function(_0x1114fc){if(_0x1114fc[_0x9fa0('0x2f')]!==_0x9fa0('0x3c')){var _0x475b16={};_0x475b16[_0x1114fc[_0x9fa0('0x2a')]]={'$like':'%'+_0x51ab00[_0x9fa0('0x31')][_0x9fa0('0x3b')]+'%'};return _0x475b16;}})});}_0x3e34d3=_[_0x9fa0('0x3d')]({},_0x3e34d3,_0x51ab00[_0x9fa0('0x3e')]);var _0x56bad1={'where':_0x3e34d3['where']};return db[_0x9fa0('0x2d')][_0x9fa0('0x20')](_0x56bad1)[_0x9fa0('0x27')](function(_0x3cbbc9){_0x2fdc30[_0x9fa0('0x20')]=_0x3cbbc9;if(_0x51ab00[_0x9fa0('0x31')][_0x9fa0('0x3f')]){_0x3e34d3[_0x9fa0('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x9fa0('0x41')](_0x3e34d3);})[_0x9fa0('0x27')](function(_0x1dee91){_0x2fdc30[_0x9fa0('0x42')]=_0x1dee91;return _0x2fdc30;})[_0x9fa0('0x27')](respondWithFilteredResult(_0x1378f0,_0x3e34d3))[_0x9fa0('0x43')](handleError(_0x1378f0,null));};exports[_0x9fa0('0x44')]=function(_0x5a6f64,_0x86d4ca){var _0xe8f2b5={'raw':![],'where':{'id':_0x5a6f64[_0x9fa0('0x45')]['id']}},_0x145714={};_0x145714[_0x9fa0('0x30')]=_['keys'](db[_0x9fa0('0x2d')][_0x9fa0('0x46')]);_0x145714['query']=_[_0x9fa0('0x32')](_0x5a6f64[_0x9fa0('0x31')]);_0x145714[_0x9fa0('0x33')]=_['intersection'](_0x145714[_0x9fa0('0x30')],_0x145714['query']);_0xe8f2b5[_0x9fa0('0x35')]=_[_0x9fa0('0x34')](_0x145714[_0x9fa0('0x30')],qs['fields'](_0x5a6f64['query'][_0x9fa0('0x47')]));_0xe8f2b5[_0x9fa0('0x35')]=_0xe8f2b5[_0x9fa0('0x35')]['length']?_0xe8f2b5[_0x9fa0('0x35')]:_0x145714[_0x9fa0('0x30')];if(_0x5a6f64[_0x9fa0('0x31')]['includeAll']){_0xe8f2b5[_0x9fa0('0x40')]=[{'all':!![]}];}_0xe8f2b5=_[_0x9fa0('0x3d')]({},_0xe8f2b5,_0x5a6f64['options']);return db[_0x9fa0('0x2d')]['find'](_0xe8f2b5)[_0x9fa0('0x27')](handleEntityNotFound(_0x86d4ca,null))[_0x9fa0('0x27')](respondWithResult(_0x86d4ca,null))['catch'](handleError(_0x86d4ca,null));};exports[_0x9fa0('0x48')]=function(_0x1bb2d9,_0x4fb0eb){return db['VtigerConfiguration'][_0x9fa0('0x48')](_0x1bb2d9[_0x9fa0('0x49')],{})[_0x9fa0('0x27')](respondWithResult(_0x4fb0eb,0xc9))[_0x9fa0('0x43')](handleError(_0x4fb0eb,null));};exports[_0x9fa0('0x26')]=function(_0x2c1f28,_0x5e3a50){if(_0x2c1f28['body']['id']){delete _0x2c1f28[_0x9fa0('0x49')]['id'];}return db[_0x9fa0('0x2d')][_0x9fa0('0x4a')]({'where':{'id':_0x2c1f28[_0x9fa0('0x45')]['id']}})[_0x9fa0('0x27')](handleEntityNotFound(_0x5e3a50,null))[_0x9fa0('0x27')](saveUpdates(_0x2c1f28[_0x9fa0('0x49')],null))[_0x9fa0('0x27')](respondWithResult(_0x5e3a50,null))['catch'](handleError(_0x5e3a50,null));};exports[_0x9fa0('0x28')]=function(_0x32cd4d,_0x5bbd5e){return db[_0x9fa0('0x2d')][_0x9fa0('0x4a')]({'where':{'id':_0x32cd4d[_0x9fa0('0x45')]['id']}})['then'](handleEntityNotFound(_0x5bbd5e,null))[_0x9fa0('0x27')](removeEntity(_0x5bbd5e,null))[_0x9fa0('0x43')](handleError(_0x5bbd5e,null));};exports[_0x9fa0('0x4b')]=function(_0x55c3d4,_0x1d6230,_0x4f5b5e){var _0x124c8a={};var _0x2b0229={};var _0x338123;var _0x310aaa;return db[_0x9fa0('0x2d')]['findOne']({'where':{'id':_0x55c3d4[_0x9fa0('0x45')]['id']}})[_0x9fa0('0x27')](handleEntityNotFound(_0x1d6230,null))[_0x9fa0('0x27')](function(_0x16cb9c){if(_0x16cb9c){_0x338123=_0x16cb9c;_0x2b0229[_0x9fa0('0x30')]=_[_0x9fa0('0x32')](db[_0x9fa0('0x4c')][_0x9fa0('0x46')]);_0x2b0229[_0x9fa0('0x31')]=_[_0x9fa0('0x32')](_0x55c3d4[_0x9fa0('0x31')]);_0x2b0229['filters']=_[_0x9fa0('0x34')](_0x2b0229[_0x9fa0('0x30')],_0x2b0229[_0x9fa0('0x31')]);_0x124c8a[_0x9fa0('0x35')]=_[_0x9fa0('0x34')](_0x2b0229[_0x9fa0('0x30')],qs[_0x9fa0('0x47')](_0x55c3d4[_0x9fa0('0x31')][_0x9fa0('0x47')]));_0x124c8a['attributes']=_0x124c8a[_0x9fa0('0x35')][_0x9fa0('0x36')]?_0x124c8a[_0x9fa0('0x35')]:_0x2b0229['model'];_0x124c8a[_0x9fa0('0x38')]=qs[_0x9fa0('0x4d')](_0x55c3d4[_0x9fa0('0x31')][_0x9fa0('0x4d')]);_0x124c8a[_0x9fa0('0x39')]=qs['filters'](_[_0x9fa0('0x3a')](_0x55c3d4['query'],_0x2b0229[_0x9fa0('0x33')]));if(_0x55c3d4[_0x9fa0('0x31')][_0x9fa0('0x3b')]){_0x124c8a[_0x9fa0('0x39')]=_[_0x9fa0('0x3d')](_0x124c8a['where'],{'$or':_[_0x9fa0('0x2c')](_0x124c8a[_0x9fa0('0x35')],function(_0x6614b3){var _0x44a609={};_0x44a609[_0x6614b3]={'$like':'%'+_0x55c3d4[_0x9fa0('0x31')][_0x9fa0('0x3b')]+'%'};return _0x44a609;})});}_0x124c8a=_[_0x9fa0('0x3d')]({},_0x124c8a,_0x55c3d4[_0x9fa0('0x3e')]);return _0x338123['getFields'](_0x124c8a);}})['then'](function(_0x2ed43e){if(_0x2ed43e){_0x310aaa=_0x2ed43e[_0x9fa0('0x36')];if(!_0x55c3d4[_0x9fa0('0x31')][_0x9fa0('0x37')]('nolimit')){_0x124c8a[_0x9fa0('0x22')]=qs[_0x9fa0('0x22')](_0x55c3d4['query'][_0x9fa0('0x22')]);_0x124c8a[_0x9fa0('0x21')]=qs[_0x9fa0('0x21')](_0x55c3d4['query']['offset']);}return _0x338123[_0x9fa0('0x4b')](_0x124c8a);}})['then'](function(_0x34fa7e){if(_0x34fa7e){return _0x34fa7e?{'count':_0x310aaa,'rows':_0x34fa7e}:null;}})['then'](respondWithResult(_0x1d6230,null))[_0x9fa0('0x43')](handleError(_0x1d6230,null));};exports[_0x9fa0('0x4e')]=function(_0x396b7e,_0x464ba1,_0x582923){var _0x9a621e={};var _0x132f72={};var _0x2e11f8;var _0x2f5812;return db[_0x9fa0('0x2d')]['findOne']({'where':{'id':_0x396b7e['params']['id']}})[_0x9fa0('0x27')](handleEntityNotFound(_0x464ba1,null))[_0x9fa0('0x27')](function(_0x12ae2c){if(_0x12ae2c){_0x2e11f8=_0x12ae2c;_0x132f72[_0x9fa0('0x30')]=_[_0x9fa0('0x32')](db['VtigerField'][_0x9fa0('0x46')]);_0x132f72[_0x9fa0('0x31')]=_['keys'](_0x396b7e[_0x9fa0('0x31')]);_0x132f72[_0x9fa0('0x33')]=_[_0x9fa0('0x34')](_0x132f72['model'],_0x132f72['query']);_0x9a621e[_0x9fa0('0x35')]=_[_0x9fa0('0x34')](_0x132f72['model'],qs[_0x9fa0('0x47')](_0x396b7e['query'][_0x9fa0('0x47')]));_0x9a621e['attributes']=_0x9a621e['attributes'][_0x9fa0('0x36')]?_0x9a621e[_0x9fa0('0x35')]:_0x132f72[_0x9fa0('0x30')];_0x9a621e['order']=qs[_0x9fa0('0x4d')](_0x396b7e[_0x9fa0('0x31')][_0x9fa0('0x4d')]);_0x9a621e[_0x9fa0('0x39')]=qs[_0x9fa0('0x33')](_[_0x9fa0('0x3a')](_0x396b7e[_0x9fa0('0x31')],_0x132f72[_0x9fa0('0x33')]));if(_0x396b7e['query'][_0x9fa0('0x3b')]){_0x9a621e[_0x9fa0('0x39')]=_['merge'](_0x9a621e[_0x9fa0('0x39')],{'$or':_[_0x9fa0('0x2c')](_0x9a621e[_0x9fa0('0x35')],function(_0x3caa66){var _0xedee8e={};_0xedee8e[_0x3caa66]={'$like':'%'+_0x396b7e[_0x9fa0('0x31')][_0x9fa0('0x3b')]+'%'};return _0xedee8e;})});}_0x9a621e=_[_0x9fa0('0x3d')]({},_0x9a621e,_0x396b7e[_0x9fa0('0x3e')]);return _0x2e11f8['getSubjects'](_0x9a621e);}})[_0x9fa0('0x27')](function(_0x34d387){if(_0x34d387){_0x2f5812=_0x34d387[_0x9fa0('0x36')];if(!_0x396b7e[_0x9fa0('0x31')][_0x9fa0('0x37')](_0x9fa0('0x4f'))){_0x9a621e[_0x9fa0('0x22')]=qs[_0x9fa0('0x22')](_0x396b7e[_0x9fa0('0x31')][_0x9fa0('0x22')]);_0x9a621e['offset']=qs[_0x9fa0('0x21')](_0x396b7e[_0x9fa0('0x31')][_0x9fa0('0x21')]);}return _0x2e11f8[_0x9fa0('0x4e')](_0x9a621e);}})[_0x9fa0('0x27')](function(_0xa31707){if(_0xa31707){return _0xa31707?{'count':_0x2f5812,'rows':_0xa31707}:null;}})[_0x9fa0('0x27')](respondWithResult(_0x464ba1,null))[_0x9fa0('0x43')](handleError(_0x464ba1,null));};exports[_0x9fa0('0x50')]=function(_0x31877a,_0x5dffd8,_0x2b5ea4){var _0xa248b4={};var _0x4902c4={};var _0x588f12;var _0x1495ed;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x31877a['params']['id']}})[_0x9fa0('0x27')](handleEntityNotFound(_0x5dffd8,null))[_0x9fa0('0x27')](function(_0x53d73c){if(_0x53d73c){_0x588f12=_0x53d73c;_0x4902c4['model']=_[_0x9fa0('0x32')](db[_0x9fa0('0x4c')][_0x9fa0('0x46')]);_0x4902c4[_0x9fa0('0x31')]=_['keys'](_0x31877a[_0x9fa0('0x31')]);_0x4902c4['filters']=_[_0x9fa0('0x34')](_0x4902c4['model'],_0x4902c4['query']);_0xa248b4[_0x9fa0('0x35')]=_['intersection'](_0x4902c4['model'],qs[_0x9fa0('0x47')](_0x31877a[_0x9fa0('0x31')][_0x9fa0('0x47')]));_0xa248b4[_0x9fa0('0x35')]=_0xa248b4[_0x9fa0('0x35')][_0x9fa0('0x36')]?_0xa248b4[_0x9fa0('0x35')]:_0x4902c4['model'];_0xa248b4[_0x9fa0('0x38')]=qs[_0x9fa0('0x4d')](_0x31877a[_0x9fa0('0x31')]['sort']);_0xa248b4['where']=qs[_0x9fa0('0x33')](_[_0x9fa0('0x3a')](_0x31877a[_0x9fa0('0x31')],_0x4902c4['filters']));if(_0x31877a['query'][_0x9fa0('0x3b')]){_0xa248b4[_0x9fa0('0x39')]=_['merge'](_0xa248b4[_0x9fa0('0x39')],{'$or':_[_0x9fa0('0x2c')](_0xa248b4[_0x9fa0('0x35')],function(_0x24c4e6){var _0x1dcac8={};_0x1dcac8[_0x24c4e6]={'$like':'%'+_0x31877a[_0x9fa0('0x31')][_0x9fa0('0x3b')]+'%'};return _0x1dcac8;})});}_0xa248b4=_[_0x9fa0('0x3d')]({},_0xa248b4,_0x31877a[_0x9fa0('0x3e')]);return _0x588f12[_0x9fa0('0x50')](_0xa248b4);}})[_0x9fa0('0x27')](function(_0x9808ec){if(_0x9808ec){_0x1495ed=_0x9808ec[_0x9fa0('0x36')];if(!_0x31877a[_0x9fa0('0x31')]['hasOwnProperty'](_0x9fa0('0x4f'))){_0xa248b4['limit']=qs[_0x9fa0('0x22')](_0x31877a['query']['limit']);_0xa248b4[_0x9fa0('0x21')]=qs['offset'](_0x31877a[_0x9fa0('0x31')]['offset']);}return _0x588f12[_0x9fa0('0x50')](_0xa248b4);}})[_0x9fa0('0x27')](function(_0x154e41){if(_0x154e41){return _0x154e41?{'count':_0x1495ed,'rows':_0x154e41}:null;}})['then'](respondWithResult(_0x5dffd8,null))[_0x9fa0('0x43')](handleError(_0x5dffd8,null));}; \ No newline at end of file +var _0x265e=['keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','fields','includeAll','find','catch','create','body','getFields','findOne','hasOwnProperty','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','error','stack','name','send','map','VtigerConfiguration','fieldName','type','model'];(function(_0x58dcbf,_0x28ef6f){var _0x271f8e=function(_0x168b4d){while(--_0x168b4d){_0x58dcbf['push'](_0x58dcbf['shift']());}};_0x271f8e(++_0x28ef6f);}(_0x265e,0xc7));var _0xe265=function(_0x41c3ea,_0x43bdf1){_0x41c3ea=_0x41c3ea-0x0;var _0x268150=_0x265e[_0x41c3ea];return _0x268150;};'use strict';var emlformat=require(_0xe265('0x0'));var rimraf=require(_0xe265('0x1'));var zipdir=require(_0xe265('0x2'));var jsonpatch=require(_0xe265('0x3'));var rp=require(_0xe265('0x4'));var moment=require(_0xe265('0x5'));var BPromise=require(_0xe265('0x6'));var Mustache=require(_0xe265('0x7'));var util=require(_0xe265('0x8'));var path=require(_0xe265('0x9'));var sox=require(_0xe265('0xa'));var csv=require(_0xe265('0xb'));var ejs=require(_0xe265('0xc'));var fs=require('fs');var fs_extra=require(_0xe265('0xd'));var _=require(_0xe265('0xe'));var squel=require(_0xe265('0xf'));var crypto=require('crypto');var jsforce=require(_0xe265('0x10'));var deskjs=require(_0xe265('0x11'));var toCsv=require(_0xe265('0xb'));var querystring=require('querystring');var Papa=require(_0xe265('0x12'));var Redis=require(_0xe265('0x13'));var authService=require(_0xe265('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe265('0x15'));var logger=require(_0xe265('0x16'))(_0xe265('0x17'));var utils=require('../../config/utils');var config=require(_0xe265('0x18'));var licenseUtil=require(_0xe265('0x19'));var db=require(_0xe265('0x1a'))['db'];function respondWithStatusCode(_0x1f96f1,_0x329bd4){_0x329bd4=_0x329bd4||0xcc;return function(_0x4921ff){if(_0x4921ff){return _0x1f96f1[_0xe265('0x1b')](_0x329bd4);}return _0x1f96f1['status'](_0x329bd4)[_0xe265('0x1c')]();};}function respondWithResult(_0x396276,_0x40d7bb){_0x40d7bb=_0x40d7bb||0xc8;return function(_0x2ae05b){if(_0x2ae05b){return _0x396276[_0xe265('0x1d')](_0x40d7bb)[_0xe265('0x1e')](_0x2ae05b);}};}function respondWithFilteredResult(_0x14b215,_0x237463){return function(_0x5c341b){if(_0x5c341b){var _0xeab637=typeof _0x237463['offset']===_0xe265('0x1f')&&typeof _0x237463[_0xe265('0x20')]===_0xe265('0x1f');var _0x3688c7=_0x5c341b[_0xe265('0x21')];var _0x1e5db3=_0xeab637?0x0:_0x237463[_0xe265('0x22')];var _0x58b6d0=_0xeab637?_0x5c341b[_0xe265('0x21')]:_0x237463[_0xe265('0x22')]+_0x237463[_0xe265('0x20')];var _0x5e6226;if(_0x58b6d0>=_0x3688c7){_0x58b6d0=_0x3688c7;_0x5e6226=0xc8;}else{_0x5e6226=0xce;}_0x14b215[_0xe265('0x1d')](_0x5e6226);return _0x14b215[_0xe265('0x23')](_0xe265('0x24'),_0x1e5db3+'-'+_0x58b6d0+'/'+_0x3688c7)['json'](_0x5c341b);}return null;};}function patchUpdates(_0x501fd7){return function(_0x55f077){try{jsonpatch['apply'](_0x55f077,_0x501fd7,!![]);}catch(_0x23bc96){return BPromise[_0xe265('0x25')](_0x23bc96);}return _0x55f077[_0xe265('0x26')]();};}function saveUpdates(_0x496475,_0x2dcc78){return function(_0x8c51d8){if(_0x8c51d8){return _0x8c51d8[_0xe265('0x27')](_0x496475)[_0xe265('0x28')](function(_0x2bed31){return _0x2bed31;});}return null;};}function removeEntity(_0x1897f7,_0x2e65aa){return function(_0x4e0967){if(_0x4e0967){return _0x4e0967['destroy']()[_0xe265('0x28')](function(){_0x1897f7['status'](0xcc)[_0xe265('0x1c')]();});}};}function handleEntityNotFound(_0x55d3d4,_0x48b6f1){return function(_0x47e478){if(!_0x47e478){_0x55d3d4[_0xe265('0x1b')](0x194);}return _0x47e478;};}function handleError(_0x4f88cb,_0x247ef7){_0x247ef7=_0x247ef7||0x1f4;return function(_0x3775be){logger[_0xe265('0x29')](_0x3775be[_0xe265('0x2a')]);if(_0x3775be[_0xe265('0x2b')]){delete _0x3775be[_0xe265('0x2b')];}_0x4f88cb[_0xe265('0x1d')](_0x247ef7)[_0xe265('0x2c')](_0x3775be);};}exports['index']=function(_0x157553,_0x1675b7){var _0x375b41={},_0x1452fc={},_0x5249a0={'count':0x0,'rows':[]};var _0xb2f98f=_[_0xe265('0x2d')](db[_0xe265('0x2e')]['rawAttributes'],function(_0x4e6b87){return{'name':_0x4e6b87[_0xe265('0x2f')],'type':_0x4e6b87[_0xe265('0x30')]['key']};});_0x1452fc[_0xe265('0x31')]=_[_0xe265('0x2d')](_0xb2f98f,_0xe265('0x2b'));_0x1452fc['query']=_[_0xe265('0x32')](_0x157553[_0xe265('0x33')]);_0x1452fc[_0xe265('0x34')]=_[_0xe265('0x35')](_0x1452fc[_0xe265('0x31')],_0x1452fc[_0xe265('0x33')]);_0x375b41[_0xe265('0x36')]=_['intersection'](_0x1452fc['model'],qs['fields'](_0x157553[_0xe265('0x33')]['fields']));_0x375b41['attributes']=_0x375b41['attributes'][_0xe265('0x37')]?_0x375b41['attributes']:_0x1452fc['model'];if(!_0x157553[_0xe265('0x33')]['hasOwnProperty'](_0xe265('0x38'))){_0x375b41['limit']=qs['limit'](_0x157553['query'][_0xe265('0x20')]);_0x375b41['offset']=qs[_0xe265('0x22')](_0x157553[_0xe265('0x33')][_0xe265('0x22')]);}_0x375b41[_0xe265('0x39')]=qs[_0xe265('0x3a')](_0x157553[_0xe265('0x33')]['sort']);_0x375b41[_0xe265('0x3b')]=qs['filters'](_[_0xe265('0x3c')](_0x157553[_0xe265('0x33')],_0x1452fc[_0xe265('0x34')]),_0xb2f98f);if(_0x157553[_0xe265('0x33')][_0xe265('0x3d')]){_0x375b41[_0xe265('0x3b')]=_[_0xe265('0x3e')](_0x375b41[_0xe265('0x3b')],{'$or':_[_0xe265('0x2d')](_0xb2f98f,function(_0x1de6c2){if(_0x1de6c2[_0xe265('0x30')]!==_0xe265('0x3f')){var _0x4b50fb={};_0x4b50fb[_0x1de6c2[_0xe265('0x2b')]]={'$like':'%'+_0x157553[_0xe265('0x33')]['filter']+'%'};return _0x4b50fb;}})});}_0x375b41=_[_0xe265('0x3e')]({},_0x375b41,_0x157553[_0xe265('0x40')]);var _0xc39a85={'where':_0x375b41[_0xe265('0x3b')]};return db[_0xe265('0x2e')][_0xe265('0x21')](_0xc39a85)[_0xe265('0x28')](function(_0x164f9a){_0x5249a0[_0xe265('0x21')]=_0x164f9a;if(_0x157553[_0xe265('0x33')]['includeAll']){_0x375b41[_0xe265('0x41')]=[{'all':!![]}];}return db[_0xe265('0x2e')][_0xe265('0x42')](_0x375b41);})[_0xe265('0x28')](function(_0x53f594){_0x5249a0[_0xe265('0x43')]=_0x53f594;return _0x5249a0;})[_0xe265('0x28')](respondWithFilteredResult(_0x1675b7,_0x375b41))['catch'](handleError(_0x1675b7,null));};exports[_0xe265('0x44')]=function(_0x5bab3a,_0x6756eb){var _0x2ccb38={'raw':![],'where':{'id':_0x5bab3a[_0xe265('0x45')]['id']}},_0x3077d2={};_0x3077d2[_0xe265('0x31')]=_[_0xe265('0x32')](db[_0xe265('0x2e')][_0xe265('0x46')]);_0x3077d2[_0xe265('0x33')]=_['keys'](_0x5bab3a[_0xe265('0x33')]);_0x3077d2[_0xe265('0x34')]=_[_0xe265('0x35')](_0x3077d2[_0xe265('0x31')],_0x3077d2[_0xe265('0x33')]);_0x2ccb38[_0xe265('0x36')]=_[_0xe265('0x35')](_0x3077d2[_0xe265('0x31')],qs[_0xe265('0x47')](_0x5bab3a[_0xe265('0x33')][_0xe265('0x47')]));_0x2ccb38['attributes']=_0x2ccb38[_0xe265('0x36')][_0xe265('0x37')]?_0x2ccb38['attributes']:_0x3077d2[_0xe265('0x31')];if(_0x5bab3a[_0xe265('0x33')][_0xe265('0x48')]){_0x2ccb38['include']=[{'all':!![]}];}_0x2ccb38=_[_0xe265('0x3e')]({},_0x2ccb38,_0x5bab3a[_0xe265('0x40')]);return db[_0xe265('0x2e')][_0xe265('0x49')](_0x2ccb38)[_0xe265('0x28')](handleEntityNotFound(_0x6756eb,null))['then'](respondWithResult(_0x6756eb,null))[_0xe265('0x4a')](handleError(_0x6756eb,null));};exports[_0xe265('0x4b')]=function(_0x350ddc,_0x173507){return db[_0xe265('0x2e')]['create'](_0x350ddc[_0xe265('0x4c')],{})[_0xe265('0x28')](respondWithResult(_0x173507,0xc9))[_0xe265('0x4a')](handleError(_0x173507,null));};exports[_0xe265('0x27')]=function(_0x384e98,_0x40b4a0){if(_0x384e98[_0xe265('0x4c')]['id']){delete _0x384e98[_0xe265('0x4c')]['id'];}return db['VtigerConfiguration'][_0xe265('0x49')]({'where':{'id':_0x384e98[_0xe265('0x45')]['id']}})[_0xe265('0x28')](handleEntityNotFound(_0x40b4a0,null))[_0xe265('0x28')](saveUpdates(_0x384e98[_0xe265('0x4c')],null))['then'](respondWithResult(_0x40b4a0,null))[_0xe265('0x4a')](handleError(_0x40b4a0,null));};exports['destroy']=function(_0xc9895,_0x2b6bbb){return db['VtigerConfiguration'][_0xe265('0x49')]({'where':{'id':_0xc9895[_0xe265('0x45')]['id']}})[_0xe265('0x28')](handleEntityNotFound(_0x2b6bbb,null))['then'](removeEntity(_0x2b6bbb,null))[_0xe265('0x4a')](handleError(_0x2b6bbb,null));};exports[_0xe265('0x4d')]=function(_0x187ea9,_0x42ac9d,_0x28c810){var _0xba68bd={};var _0x35b70c={};var _0x543d1f;var _0x4fb369;return db['VtigerConfiguration'][_0xe265('0x4e')]({'where':{'id':_0x187ea9['params']['id']}})['then'](handleEntityNotFound(_0x42ac9d,null))['then'](function(_0x224c48){if(_0x224c48){_0x543d1f=_0x224c48;_0x35b70c[_0xe265('0x31')]=_[_0xe265('0x32')](db['VtigerField'][_0xe265('0x46')]);_0x35b70c[_0xe265('0x33')]=_['keys'](_0x187ea9[_0xe265('0x33')]);_0x35b70c['filters']=_[_0xe265('0x35')](_0x35b70c[_0xe265('0x31')],_0x35b70c['query']);_0xba68bd[_0xe265('0x36')]=_[_0xe265('0x35')](_0x35b70c['model'],qs[_0xe265('0x47')](_0x187ea9[_0xe265('0x33')][_0xe265('0x47')]));_0xba68bd[_0xe265('0x36')]=_0xba68bd[_0xe265('0x36')]['length']?_0xba68bd[_0xe265('0x36')]:_0x35b70c['model'];_0xba68bd['order']=qs[_0xe265('0x3a')](_0x187ea9[_0xe265('0x33')][_0xe265('0x3a')]);_0xba68bd[_0xe265('0x3b')]=qs[_0xe265('0x34')](_[_0xe265('0x3c')](_0x187ea9[_0xe265('0x33')],_0x35b70c[_0xe265('0x34')]));if(_0x187ea9[_0xe265('0x33')][_0xe265('0x3d')]){_0xba68bd['where']=_[_0xe265('0x3e')](_0xba68bd[_0xe265('0x3b')],{'$or':_['map'](_0xba68bd[_0xe265('0x36')],function(_0x248d54){var _0x322068={};_0x322068[_0x248d54]={'$like':'%'+_0x187ea9['query'][_0xe265('0x3d')]+'%'};return _0x322068;})});}_0xba68bd=_['merge']({},_0xba68bd,_0x187ea9[_0xe265('0x40')]);return _0x543d1f['getFields'](_0xba68bd);}})[_0xe265('0x28')](function(_0x310e2d){if(_0x310e2d){_0x4fb369=_0x310e2d[_0xe265('0x37')];if(!_0x187ea9[_0xe265('0x33')][_0xe265('0x4f')](_0xe265('0x38'))){_0xba68bd[_0xe265('0x20')]=qs[_0xe265('0x20')](_0x187ea9['query']['limit']);_0xba68bd[_0xe265('0x22')]=qs['offset'](_0x187ea9[_0xe265('0x33')][_0xe265('0x22')]);}return _0x543d1f[_0xe265('0x4d')](_0xba68bd);}})[_0xe265('0x28')](function(_0xcdf1b7){if(_0xcdf1b7){return _0xcdf1b7?{'count':_0x4fb369,'rows':_0xcdf1b7}:null;}})[_0xe265('0x28')](respondWithResult(_0x42ac9d,null))[_0xe265('0x4a')](handleError(_0x42ac9d,null));};exports['getSubjects']=function(_0x420a7a,_0x5454e6,_0x357c4c){var _0x432c7d={};var _0x2ca672={};var _0x49aa78;var _0x56eedc;return db[_0xe265('0x2e')][_0xe265('0x4e')]({'where':{'id':_0x420a7a[_0xe265('0x45')]['id']}})[_0xe265('0x28')](handleEntityNotFound(_0x5454e6,null))[_0xe265('0x28')](function(_0x5bc3dc){if(_0x5bc3dc){_0x49aa78=_0x5bc3dc;_0x2ca672[_0xe265('0x31')]=_[_0xe265('0x32')](db[_0xe265('0x50')][_0xe265('0x46')]);_0x2ca672['query']=_[_0xe265('0x32')](_0x420a7a['query']);_0x2ca672['filters']=_[_0xe265('0x35')](_0x2ca672[_0xe265('0x31')],_0x2ca672[_0xe265('0x33')]);_0x432c7d[_0xe265('0x36')]=_[_0xe265('0x35')](_0x2ca672[_0xe265('0x31')],qs['fields'](_0x420a7a[_0xe265('0x33')]['fields']));_0x432c7d['attributes']=_0x432c7d[_0xe265('0x36')][_0xe265('0x37')]?_0x432c7d[_0xe265('0x36')]:_0x2ca672[_0xe265('0x31')];_0x432c7d[_0xe265('0x39')]=qs[_0xe265('0x3a')](_0x420a7a[_0xe265('0x33')][_0xe265('0x3a')]);_0x432c7d['where']=qs[_0xe265('0x34')](_[_0xe265('0x3c')](_0x420a7a[_0xe265('0x33')],_0x2ca672['filters']));if(_0x420a7a['query'][_0xe265('0x3d')]){_0x432c7d[_0xe265('0x3b')]=_[_0xe265('0x3e')](_0x432c7d[_0xe265('0x3b')],{'$or':_[_0xe265('0x2d')](_0x432c7d['attributes'],function(_0x1a0864){var _0x5d8a80={};_0x5d8a80[_0x1a0864]={'$like':'%'+_0x420a7a[_0xe265('0x33')][_0xe265('0x3d')]+'%'};return _0x5d8a80;})});}_0x432c7d=_[_0xe265('0x3e')]({},_0x432c7d,_0x420a7a[_0xe265('0x40')]);return _0x49aa78['getSubjects'](_0x432c7d);}})[_0xe265('0x28')](function(_0x58aa85){if(_0x58aa85){_0x56eedc=_0x58aa85[_0xe265('0x37')];if(!_0x420a7a[_0xe265('0x33')][_0xe265('0x4f')](_0xe265('0x38'))){_0x432c7d[_0xe265('0x20')]=qs[_0xe265('0x20')](_0x420a7a[_0xe265('0x33')][_0xe265('0x20')]);_0x432c7d[_0xe265('0x22')]=qs[_0xe265('0x22')](_0x420a7a[_0xe265('0x33')]['offset']);}return _0x49aa78[_0xe265('0x51')](_0x432c7d);}})[_0xe265('0x28')](function(_0x11a361){if(_0x11a361){return _0x11a361?{'count':_0x56eedc,'rows':_0x11a361}:null;}})[_0xe265('0x28')](respondWithResult(_0x5454e6,null))[_0xe265('0x4a')](handleError(_0x5454e6,null));};exports[_0xe265('0x52')]=function(_0x23d24a,_0x3a258a,_0x2ae42b){var _0x21e947={};var _0x4c9394={};var _0xc71a32;var _0x22e941;return db[_0xe265('0x2e')]['findOne']({'where':{'id':_0x23d24a[_0xe265('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a258a,null))['then'](function(_0x30113b){if(_0x30113b){_0xc71a32=_0x30113b;_0x4c9394[_0xe265('0x31')]=_['keys'](db[_0xe265('0x50')][_0xe265('0x46')]);_0x4c9394[_0xe265('0x33')]=_[_0xe265('0x32')](_0x23d24a['query']);_0x4c9394[_0xe265('0x34')]=_[_0xe265('0x35')](_0x4c9394[_0xe265('0x31')],_0x4c9394['query']);_0x21e947[_0xe265('0x36')]=_[_0xe265('0x35')](_0x4c9394[_0xe265('0x31')],qs[_0xe265('0x47')](_0x23d24a[_0xe265('0x33')][_0xe265('0x47')]));_0x21e947[_0xe265('0x36')]=_0x21e947[_0xe265('0x36')][_0xe265('0x37')]?_0x21e947[_0xe265('0x36')]:_0x4c9394[_0xe265('0x31')];_0x21e947[_0xe265('0x39')]=qs[_0xe265('0x3a')](_0x23d24a[_0xe265('0x33')][_0xe265('0x3a')]);_0x21e947[_0xe265('0x3b')]=qs[_0xe265('0x34')](_['pick'](_0x23d24a['query'],_0x4c9394['filters']));if(_0x23d24a[_0xe265('0x33')][_0xe265('0x3d')]){_0x21e947[_0xe265('0x3b')]=_[_0xe265('0x3e')](_0x21e947[_0xe265('0x3b')],{'$or':_[_0xe265('0x2d')](_0x21e947['attributes'],function(_0x578d32){var _0x2b2d0c={};_0x2b2d0c[_0x578d32]={'$like':'%'+_0x23d24a['query'][_0xe265('0x3d')]+'%'};return _0x2b2d0c;})});}_0x21e947=_[_0xe265('0x3e')]({},_0x21e947,_0x23d24a[_0xe265('0x40')]);return _0xc71a32[_0xe265('0x52')](_0x21e947);}})[_0xe265('0x28')](function(_0x4a4f7e){if(_0x4a4f7e){_0x22e941=_0x4a4f7e['length'];if(!_0x23d24a['query'][_0xe265('0x4f')]('nolimit')){_0x21e947['limit']=qs[_0xe265('0x20')](_0x23d24a[_0xe265('0x33')][_0xe265('0x20')]);_0x21e947[_0xe265('0x22')]=qs['offset'](_0x23d24a['query'][_0xe265('0x22')]);}return _0xc71a32[_0xe265('0x52')](_0x21e947);}})[_0xe265('0x28')](function(_0x112da1){if(_0x112da1){return _0x112da1?{'count':_0x22e941,'rows':_0x112da1}:null;}})['then'](respondWithResult(_0x3a258a,null))[_0xe265('0x4a')](handleError(_0x3a258a,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 482ee5d..ab3a4b4 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 _0x9e01=['./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x45d56b,_0x3b99e4){var _0xd62e37=function(_0x12f150){while(--_0x12f150){_0x45d56b['push'](_0x45d56b['shift']());}};_0xd62e37(++_0x3b99e4);}(_0x9e01,0x123));var _0x19e0=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9e01[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x19e0('0x0'));var util=require(_0x19e0('0x1'));var logger=require(_0x19e0('0x2'))(_0x19e0('0x3'));var moment=require('moment');var BPromise=require(_0x19e0('0x4'));var rp=require(_0x19e0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x19e0('0x6'));var config=require(_0x19e0('0x7'));var attributes=require(_0x19e0('0x8'));module[_0x19e0('0x9')]=function(_0x50a297,_0x1dd27b){return _0x50a297[_0x19e0('0xa')](_0x19e0('0xb'),attributes,{'tableName':_0x19e0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd857=['moment','bluebird','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','util','api'];(function(_0x3db334,_0x4c0141){var _0x29fa20=function(_0x42c10c){while(--_0x42c10c){_0x3db334['push'](_0x3db334['shift']());}};_0x29fa20(++_0x4c0141);}(_0xd857,0x174));var _0x7d85=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xd857[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x7d85('0x0'));var logger=require('../../config/logger')(_0x7d85('0x1'));var moment=require(_0x7d85('0x2'));var BPromise=require(_0x7d85('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d85('0x4'));var rimraf=require(_0x7d85('0x5'));var config=require(_0x7d85('0x6'));var attributes=require(_0x7d85('0x7'));module[_0x7d85('0x8')]=function(_0x9a79b9,_0xd96acd){return _0x9a79b9[_0x7d85('0x9')](_0x7d85('0xa'),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 cb85900..0337fa1 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 _0xab75=['result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x4066fb,_0x3dfa03){var _0x436207=function(_0x21c35e){while(--_0x21c35e){_0x4066fb['push'](_0x4066fb['shift']());}};_0x436207(++_0x3dfa03);}(_0xab75,0x1ce));var _0x5ab7=function(_0x2711f8,_0x19e07a){_0x2711f8=_0x2711f8-0x0;var _0x594061=_0xab75[_0x2711f8];return _0x594061;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5ab7('0x0'));var rs=require(_0x5ab7('0x1'));var fs=require('fs');var Redis=require(_0x5ab7('0x2'));var db=require(_0x5ab7('0x3'))['db'];var utils=require(_0x5ab7('0x4'));var logger=require(_0x5ab7('0x5'))(_0x5ab7('0x6'));var config=require(_0x5ab7('0x7'));var jayson=require(_0x5ab7('0x8'));var client=jayson[_0x5ab7('0x9')][_0x5ab7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x117321,_0x5a9c31,_0x5b55cf){return new BPromise(function(_0x290492,_0x350730){return client['request'](_0x117321,_0x5b55cf)[_0x5ab7('0xb')](function(_0x5bddaa){logger[_0x5ab7('0xc')](_0x5ab7('0xd'),_0x5a9c31,_0x5ab7('0xe'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x5a9c31,'request\x20sent',JSON[_0x5ab7('0xf')](_0x5bddaa));if(_0x5bddaa[_0x5ab7('0x10')]){if(_0x5bddaa[_0x5ab7('0x10')]['code']===0x1f4){logger[_0x5ab7('0x10')](_0x5ab7('0xd'),_0x5a9c31,_0x5bddaa['error'][_0x5ab7('0x11')]);return _0x350730(_0x5bddaa[_0x5ab7('0x10')]['message']);}logger['error'](_0x5ab7('0xd'),_0x5a9c31,_0x5bddaa['error']['message']);return _0x290492(_0x5bddaa[_0x5ab7('0x10')][_0x5ab7('0x11')]);}else{logger[_0x5ab7('0xc')](_0x5ab7('0xd'),_0x5a9c31,_0x5ab7('0xe'));_0x290492(_0x5bddaa[_0x5ab7('0x12')][_0x5ab7('0x11')]);}})[_0x5ab7('0x13')](function(_0x317e0d){logger[_0x5ab7('0x10')](_0x5ab7('0xd'),_0x5a9c31,_0x317e0d);_0x350730(_0x317e0d);});});} \ No newline at end of file +var _0xde02=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','../../mysqldb'];(function(_0x1e4876,_0x150171){var _0x432054=function(_0x1f098b){while(--_0x1f098b){_0x1e4876['push'](_0x1e4876['shift']());}};_0x432054(++_0x150171);}(_0xde02,0x90));var _0x2de0=function(_0x350b4b,_0x41df89){_0x350b4b=_0x350b4b-0x0;var _0x59e997=_0xde02[_0x350b4b];return _0x59e997;};'use strict';var _=require('lodash');var util=require(_0x2de0('0x0'));var moment=require('moment');var BPromise=require(_0x2de0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2de0('0x2'))['db'];var utils=require(_0x2de0('0x3'));var logger=require(_0x2de0('0x4'))(_0x2de0('0x5'));var config=require(_0x2de0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2de0('0x7')][_0x2de0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e1d6f,_0x1d85cb,_0x342a27){return new BPromise(function(_0x75ed39,_0x5aae0a){return client[_0x2de0('0x9')](_0x4e1d6f,_0x342a27)[_0x2de0('0xa')](function(_0x14fca6){logger[_0x2de0('0xb')](_0x2de0('0xc'),_0x1d85cb,_0x2de0('0xd'));logger['debug'](_0x2de0('0xe'),_0x1d85cb,_0x2de0('0xd'),JSON[_0x2de0('0xf')](_0x14fca6));if(_0x14fca6[_0x2de0('0x10')]){if(_0x14fca6[_0x2de0('0x10')][_0x2de0('0x11')]===0x1f4){logger[_0x2de0('0x10')](_0x2de0('0xc'),_0x1d85cb,_0x14fca6[_0x2de0('0x10')][_0x2de0('0x12')]);return _0x5aae0a(_0x14fca6[_0x2de0('0x10')][_0x2de0('0x12')]);}logger[_0x2de0('0x10')](_0x2de0('0xc'),_0x1d85cb,_0x14fca6[_0x2de0('0x10')][_0x2de0('0x12')]);return _0x75ed39(_0x14fca6['error']['message']);}else{logger[_0x2de0('0xb')](_0x2de0('0xc'),_0x1d85cb,'request\x20sent');_0x75ed39(_0x14fca6[_0x2de0('0x13')][_0x2de0('0x12')]);}})[_0x2de0('0x14')](function(_0x330d8c){logger[_0x2de0('0x10')](_0x2de0('0xc'),_0x1d85cb,_0x330d8c);_0x5aae0a(_0x330d8c);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 2abcfd0..ee6a210 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 _0xaa67=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x3f948c,_0x40fd18){var _0x23a160=function(_0x5a7fb7){while(--_0x5a7fb7){_0x3f948c['push'](_0x3f948c['shift']());}};_0x23a160(++_0x40fd18);}(_0xaa67,0xb4));var _0x7aa6=function(_0x29da80,_0x3f6b02){_0x29da80=_0x29da80-0x0;var _0x1732ee=_0xaa67[_0x29da80];return _0x1732ee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7aa6('0x0'));var timeout=require(_0x7aa6('0x1'));var express=require(_0x7aa6('0x2'));var router=express[_0x7aa6('0x3')]();var fs_extra=require(_0x7aa6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7aa6('0x5'));var config=require(_0x7aa6('0x6'));var controller=require('./intVtigerField.controller');router[_0x7aa6('0x7')]('/',auth[_0x7aa6('0x8')](),controller[_0x7aa6('0x9')]);router[_0x7aa6('0x7')](_0x7aa6('0xa'),auth[_0x7aa6('0x8')](),controller['show']);router[_0x7aa6('0xb')]('/',auth[_0x7aa6('0x8')](),controller[_0x7aa6('0xc')]);router[_0x7aa6('0xd')](_0x7aa6('0xa'),auth[_0x7aa6('0x8')](),controller[_0x7aa6('0xe')]);router[_0x7aa6('0xf')](_0x7aa6('0xa'),auth[_0x7aa6('0x8')](),controller[_0x7aa6('0x10')]);module[_0x7aa6('0x11')]=router; \ No newline at end of file +var _0xc526=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','put','update','destroy','multer'];(function(_0x36afc9,_0x330ac6){var _0x3c5d2b=function(_0x397133){while(--_0x397133){_0x36afc9['push'](_0x36afc9['shift']());}};_0x3c5d2b(++_0x330ac6);}(_0xc526,0x158));var _0x6c52=function(_0x4f178a,_0x16cf81){_0x4f178a=_0x4f178a-0x0;var _0x5ca479=_0xc526[_0x4f178a];return _0x5ca479;};'use strict';var multer=require(_0x6c52('0x0'));var util=require('util');var path=require(_0x6c52('0x1'));var timeout=require(_0x6c52('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6c52('0x3'));var auth=require(_0x6c52('0x4'));var interaction=require(_0x6c52('0x5'));var config=require(_0x6c52('0x6'));var controller=require('./intVtigerField.controller');router[_0x6c52('0x7')]('/',auth[_0x6c52('0x8')](),controller[_0x6c52('0x9')]);router[_0x6c52('0x7')](_0x6c52('0xa'),auth['isAuthenticated'](),controller[_0x6c52('0xb')]);router['post']('/',auth[_0x6c52('0x8')](),controller['create']);router[_0x6c52('0xc')](_0x6c52('0xa'),auth['isAuthenticated'](),controller[_0x6c52('0xd')]);router['delete'](_0x6c52('0xa'),auth[_0x6c52('0x8')](),controller[_0x6c52('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 8911756..a81eb15 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 _0x0355=['BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x1e922a,_0x2980dc){var _0x190f3e=function(_0x473d4f){while(--_0x473d4f){_0x1e922a['push'](_0x1e922a['shift']());}};_0x190f3e(++_0x2980dc);}(_0x0355,0x184));var _0x5035=function(_0x32d21e,_0x2c451f){_0x32d21e=_0x32d21e-0x0;var _0x14dd81=_0x0355[_0x32d21e];return _0x14dd81;};'use strict';var Sequelize=require('sequelize');module[_0x5035('0x0')]={'type':{'type':Sequelize[_0x5035('0x1')](_0x5035('0x2'),_0x5035('0x3'),_0x5035('0x4'),_0x5035('0x5'),_0x5035('0x6')),'defaultValue':_0x5035('0x2')},'content':{'type':Sequelize[_0x5035('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5035('0x1')](_0x5035('0x2'),_0x5035('0x3'),_0x5035('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5035('0x7')]},'nameField':{'type':Sequelize[_0x5035('0x7')]},'customField':{'type':Sequelize[_0x5035('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5035('0x7')]}}; \ No newline at end of file +var _0x8fa3=['customVariable','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x4fc348,_0x35d4f9){var _0x433c43=function(_0x5db994){while(--_0x5db994){_0x4fc348['push'](_0x4fc348['shift']());}};_0x433c43(++_0x35d4f9);}(_0x8fa3,0x137));var _0x38fa=function(_0x5a27e8,_0x492a2f){_0x5a27e8=_0x5a27e8-0x0;var _0x4e38f7=_0x8fa3[_0x5a27e8];return _0x4e38f7;};'use strict';var Sequelize=require('sequelize');module[_0x38fa('0x0')]={'type':{'type':Sequelize[_0x38fa('0x1')](_0x38fa('0x2'),_0x38fa('0x3'),_0x38fa('0x4'),'keyValue','picklist'),'defaultValue':_0x38fa('0x2')},'content':{'type':Sequelize[_0x38fa('0x5')]},'key':{'type':Sequelize[_0x38fa('0x5')]},'keyType':{'type':Sequelize[_0x38fa('0x1')](_0x38fa('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x38fa('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x38fa('0x5')]},'customField':{'type':Sequelize[_0x38fa('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x38fa('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 96fceed..a286db3 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 _0x8b4e=['util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','catch','show','params','model','include','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x8b4e,0x158));var _0xe8b4=function(_0x7594a4,_0x116489){_0x7594a4=_0x7594a4-0x0;var _0x38ddcc=_0x8b4e[_0x7594a4];return _0x38ddcc;};'use strict';var emlformat=require(_0xe8b4('0x0'));var rimraf=require(_0xe8b4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe8b4('0x2'));var rp=require(_0xe8b4('0x3'));var moment=require(_0xe8b4('0x4'));var BPromise=require(_0xe8b4('0x5'));var Mustache=require('mustache');var util=require(_0xe8b4('0x6'));var path=require(_0xe8b4('0x7'));var sox=require(_0xe8b4('0x8'));var csv=require(_0xe8b4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe8b4('0xa'));var squel=require(_0xe8b4('0xb'));var crypto=require(_0xe8b4('0xc'));var jsforce=require(_0xe8b4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe8b4('0x9'));var querystring=require(_0xe8b4('0xe'));var Papa=require(_0xe8b4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe8b4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8b4('0x11'))('api');var utils=require(_0xe8b4('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f3b31,_0xd9b705){_0xd9b705=_0xd9b705||0xcc;return function(_0x13330a){if(_0x13330a){return _0x4f3b31[_0xe8b4('0x13')](_0xd9b705);}return _0x4f3b31[_0xe8b4('0x14')](_0xd9b705)['end']();};}function respondWithResult(_0x25801b,_0x48f670){_0x48f670=_0x48f670||0xc8;return function(_0x747efc){if(_0x747efc){return _0x25801b[_0xe8b4('0x14')](_0x48f670)[_0xe8b4('0x15')](_0x747efc);}};}function respondWithFilteredResult(_0x21f9fa,_0x245f3e){return function(_0x4d8606){if(_0x4d8606){var _0x29b14b=typeof _0x245f3e[_0xe8b4('0x16')]==='undefined'&&typeof _0x245f3e['limit']===_0xe8b4('0x17');var _0x5d85f7=_0x4d8606[_0xe8b4('0x18')];var _0x48c148=_0x29b14b?0x0:_0x245f3e[_0xe8b4('0x16')];var _0x2d0129=_0x29b14b?_0x4d8606[_0xe8b4('0x18')]:_0x245f3e[_0xe8b4('0x16')]+_0x245f3e[_0xe8b4('0x19')];var _0x4d4aba;if(_0x2d0129>=_0x5d85f7){_0x2d0129=_0x5d85f7;_0x4d4aba=0xc8;}else{_0x4d4aba=0xce;}_0x21f9fa[_0xe8b4('0x14')](_0x4d4aba);return _0x21f9fa[_0xe8b4('0x1a')](_0xe8b4('0x1b'),_0x48c148+'-'+_0x2d0129+'/'+_0x5d85f7)[_0xe8b4('0x15')](_0x4d8606);}return null;};}function patchUpdates(_0x32be75){return function(_0xccfb52){try{jsonpatch[_0xe8b4('0x1c')](_0xccfb52,_0x32be75,!![]);}catch(_0x3be0fa){return BPromise[_0xe8b4('0x1d')](_0x3be0fa);}return _0xccfb52[_0xe8b4('0x1e')]();};}function saveUpdates(_0x47daaf,_0x112e04){return function(_0x3eb619){if(_0x3eb619){return _0x3eb619[_0xe8b4('0x1f')](_0x47daaf)[_0xe8b4('0x20')](function(_0x3834f6){return _0x3834f6;});}return null;};}function removeEntity(_0x120363,_0x480446){return function(_0x4af7da){if(_0x4af7da){return _0x4af7da['destroy']()[_0xe8b4('0x20')](function(){_0x120363[_0xe8b4('0x14')](0xcc)[_0xe8b4('0x21')]();});}};}function handleEntityNotFound(_0x216316,_0x13f6d6){return function(_0x9454bc){if(!_0x9454bc){_0x216316[_0xe8b4('0x13')](0x194);}return _0x9454bc;};}function handleError(_0xca8dc7,_0x5de5b4){_0x5de5b4=_0x5de5b4||0x1f4;return function(_0x5073c2){logger[_0xe8b4('0x22')](_0x5073c2['stack']);if(_0x5073c2[_0xe8b4('0x23')]){delete _0x5073c2['name'];}_0xca8dc7[_0xe8b4('0x14')](_0x5de5b4)[_0xe8b4('0x24')](_0x5073c2);};}exports[_0xe8b4('0x25')]=function(_0x47e308,_0x396e8b){var _0x439761={},_0x5234a7={},_0x37e335={'count':0x0,'rows':[]};var _0x501ff7=_[_0xe8b4('0x26')](db[_0xe8b4('0x27')][_0xe8b4('0x28')],function(_0x3345c2){return{'name':_0x3345c2[_0xe8b4('0x29')],'type':_0x3345c2[_0xe8b4('0x2a')][_0xe8b4('0x2b')]};});_0x5234a7['model']=_[_0xe8b4('0x26')](_0x501ff7,_0xe8b4('0x23'));_0x5234a7[_0xe8b4('0x2c')]=_[_0xe8b4('0x2d')](_0x47e308[_0xe8b4('0x2c')]);_0x5234a7[_0xe8b4('0x2e')]=_['intersection'](_0x5234a7['model'],_0x5234a7[_0xe8b4('0x2c')]);_0x439761[_0xe8b4('0x2f')]=_[_0xe8b4('0x30')](_0x5234a7['model'],qs['fields'](_0x47e308[_0xe8b4('0x2c')][_0xe8b4('0x31')]));_0x439761[_0xe8b4('0x2f')]=_0x439761[_0xe8b4('0x2f')][_0xe8b4('0x32')]?_0x439761['attributes']:_0x5234a7['model'];if(!_0x47e308[_0xe8b4('0x2c')][_0xe8b4('0x33')](_0xe8b4('0x34'))){_0x439761['limit']=qs[_0xe8b4('0x19')](_0x47e308['query']['limit']);_0x439761['offset']=qs['offset'](_0x47e308[_0xe8b4('0x2c')]['offset']);}_0x439761['order']=qs['sort'](_0x47e308[_0xe8b4('0x2c')][_0xe8b4('0x35')]);_0x439761[_0xe8b4('0x36')]=qs['filters'](_[_0xe8b4('0x37')](_0x47e308[_0xe8b4('0x2c')],_0x5234a7['filters']),_0x501ff7);if(_0x47e308[_0xe8b4('0x2c')][_0xe8b4('0x38')]){_0x439761[_0xe8b4('0x36')]=_['merge'](_0x439761[_0xe8b4('0x36')],{'$or':_['map'](_0x501ff7,function(_0x32aefe){if(_0x32aefe[_0xe8b4('0x2a')]!==_0xe8b4('0x39')){var _0x12b442={};_0x12b442[_0x32aefe[_0xe8b4('0x23')]]={'$like':'%'+_0x47e308['query'][_0xe8b4('0x38')]+'%'};return _0x12b442;}})});}_0x439761=_[_0xe8b4('0x3a')]({},_0x439761,_0x47e308['options']);var _0xcce4b={'where':_0x439761['where']};return db['VtigerField'][_0xe8b4('0x18')](_0xcce4b)[_0xe8b4('0x20')](function(_0x4ccb8e){_0x37e335[_0xe8b4('0x18')]=_0x4ccb8e;if(_0x47e308[_0xe8b4('0x2c')][_0xe8b4('0x3b')]){_0x439761['include']=[{'all':!![]}];}return db[_0xe8b4('0x27')][_0xe8b4('0x3c')](_0x439761);})[_0xe8b4('0x20')](function(_0x5a2fdf){_0x37e335['rows']=_0x5a2fdf;return _0x37e335;})[_0xe8b4('0x20')](respondWithFilteredResult(_0x396e8b,_0x439761))[_0xe8b4('0x3d')](handleError(_0x396e8b,null));};exports[_0xe8b4('0x3e')]=function(_0x319ded,_0x2d1448){var _0x1ca8cd={'raw':!![],'where':{'id':_0x319ded[_0xe8b4('0x3f')]['id']}},_0x4a365d={};_0x4a365d[_0xe8b4('0x40')]=_[_0xe8b4('0x2d')](db['VtigerField']['rawAttributes']);_0x4a365d[_0xe8b4('0x2c')]=_['keys'](_0x319ded[_0xe8b4('0x2c')]);_0x4a365d[_0xe8b4('0x2e')]=_[_0xe8b4('0x30')](_0x4a365d[_0xe8b4('0x40')],_0x4a365d['query']);_0x1ca8cd[_0xe8b4('0x2f')]=_[_0xe8b4('0x30')](_0x4a365d[_0xe8b4('0x40')],qs[_0xe8b4('0x31')](_0x319ded[_0xe8b4('0x2c')]['fields']));_0x1ca8cd[_0xe8b4('0x2f')]=_0x1ca8cd[_0xe8b4('0x2f')][_0xe8b4('0x32')]?_0x1ca8cd[_0xe8b4('0x2f')]:_0x4a365d['model'];if(_0x319ded[_0xe8b4('0x2c')][_0xe8b4('0x3b')]){_0x1ca8cd[_0xe8b4('0x41')]=[{'all':!![]}];}_0x1ca8cd=_[_0xe8b4('0x3a')]({},_0x1ca8cd,_0x319ded[_0xe8b4('0x42')]);return db[_0xe8b4('0x27')][_0xe8b4('0x43')](_0x1ca8cd)['then'](handleEntityNotFound(_0x2d1448,null))['then'](respondWithResult(_0x2d1448,null))[_0xe8b4('0x3d')](handleError(_0x2d1448,null));};exports[_0xe8b4('0x44')]=function(_0x51932e,_0x7478){return db[_0xe8b4('0x27')][_0xe8b4('0x44')](_0x51932e[_0xe8b4('0x45')],{})[_0xe8b4('0x20')](respondWithResult(_0x7478,0xc9))[_0xe8b4('0x3d')](handleError(_0x7478,null));};exports['update']=function(_0x4e0024,_0x274f7d){if(_0x4e0024[_0xe8b4('0x45')]['id']){delete _0x4e0024[_0xe8b4('0x45')]['id'];}return db[_0xe8b4('0x27')][_0xe8b4('0x43')]({'where':{'id':_0x4e0024[_0xe8b4('0x3f')]['id']}})[_0xe8b4('0x20')](handleEntityNotFound(_0x274f7d,null))[_0xe8b4('0x20')](saveUpdates(_0x4e0024[_0xe8b4('0x45')],null))['then'](respondWithResult(_0x274f7d,null))['catch'](handleError(_0x274f7d,null));};exports['destroy']=function(_0x50829c,_0x1d039a){return db[_0xe8b4('0x27')][_0xe8b4('0x43')]({'where':{'id':_0x50829c['params']['id']}})[_0xe8b4('0x20')](handleEntityNotFound(_0x1d039a,null))[_0xe8b4('0x20')](removeEntity(_0x1d039a,null))['catch'](handleError(_0x1d039a,null));}; \ No newline at end of file +var _0x8674=['body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','VtigerField','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','length','includeAll','find','create'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x8674,0x131));var _0x4867=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x8674[_0x35885a];return _0xe86249;};'use strict';var emlformat=require(_0x4867('0x0'));var rimraf=require(_0x4867('0x1'));var zipdir=require(_0x4867('0x2'));var jsonpatch=require(_0x4867('0x3'));var rp=require(_0x4867('0x4'));var moment=require(_0x4867('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4867('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4867('0x7'));var csv=require(_0x4867('0x8'));var ejs=require(_0x4867('0x9'));var fs=require('fs');var fs_extra=require(_0x4867('0xa'));var _=require(_0x4867('0xb'));var squel=require(_0x4867('0xc'));var crypto=require(_0x4867('0xd'));var jsforce=require(_0x4867('0xe'));var deskjs=require(_0x4867('0xf'));var toCsv=require(_0x4867('0x8'));var querystring=require(_0x4867('0x10'));var Papa=require(_0x4867('0x11'));var Redis=require(_0x4867('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4867('0x13'));var as=require(_0x4867('0x14'));var hardwareService=require(_0x4867('0x15'));var logger=require(_0x4867('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x4867('0x17'));var licenseUtil=require(_0x4867('0x18'));var db=require(_0x4867('0x19'))['db'];function respondWithStatusCode(_0x1d125b,_0x47d399){_0x47d399=_0x47d399||0xcc;return function(_0x2463f9){if(_0x2463f9){return _0x1d125b[_0x4867('0x1a')](_0x47d399);}return _0x1d125b[_0x4867('0x1b')](_0x47d399)[_0x4867('0x1c')]();};}function respondWithResult(_0x45c3c8,_0x448b7e){_0x448b7e=_0x448b7e||0xc8;return function(_0x506769){if(_0x506769){return _0x45c3c8[_0x4867('0x1b')](_0x448b7e)[_0x4867('0x1d')](_0x506769);}};}function respondWithFilteredResult(_0x169640,_0x5151e0){return function(_0x38c99d){if(_0x38c99d){var _0x54fac6=typeof _0x5151e0[_0x4867('0x1e')]===_0x4867('0x1f')&&typeof _0x5151e0[_0x4867('0x20')]===_0x4867('0x1f');var _0x34480e=_0x38c99d['count'];var _0x2b095=_0x54fac6?0x0:_0x5151e0[_0x4867('0x1e')];var _0x55714d=_0x54fac6?_0x38c99d[_0x4867('0x21')]:_0x5151e0[_0x4867('0x1e')]+_0x5151e0['limit'];var _0x42a413;if(_0x55714d>=_0x34480e){_0x55714d=_0x34480e;_0x42a413=0xc8;}else{_0x42a413=0xce;}_0x169640[_0x4867('0x1b')](_0x42a413);return _0x169640[_0x4867('0x22')](_0x4867('0x23'),_0x2b095+'-'+_0x55714d+'/'+_0x34480e)[_0x4867('0x1d')](_0x38c99d);}return null;};}function patchUpdates(_0x4ce04b){return function(_0x4dfdc4){try{jsonpatch[_0x4867('0x24')](_0x4dfdc4,_0x4ce04b,!![]);}catch(_0x5be851){return BPromise[_0x4867('0x25')](_0x5be851);}return _0x4dfdc4[_0x4867('0x26')]();};}function saveUpdates(_0x5e59cf,_0x356878){return function(_0x56428d){if(_0x56428d){return _0x56428d[_0x4867('0x27')](_0x5e59cf)[_0x4867('0x28')](function(_0x1b604a){return _0x1b604a;});}return null;};}function removeEntity(_0x223982,_0xf742b4){return function(_0x2b0472){if(_0x2b0472){return _0x2b0472[_0x4867('0x29')]()[_0x4867('0x28')](function(){_0x223982[_0x4867('0x1b')](0xcc)[_0x4867('0x1c')]();});}};}function handleEntityNotFound(_0x448040,_0x438342){return function(_0x3b3980){if(!_0x3b3980){_0x448040[_0x4867('0x1a')](0x194);}return _0x3b3980;};}function handleError(_0x1ab1b7,_0x4bb22a){_0x4bb22a=_0x4bb22a||0x1f4;return function(_0x7babea){logger[_0x4867('0x2a')](_0x7babea[_0x4867('0x2b')]);if(_0x7babea['name']){delete _0x7babea[_0x4867('0x2c')];}_0x1ab1b7[_0x4867('0x1b')](_0x4bb22a)['send'](_0x7babea);};}exports[_0x4867('0x2d')]=function(_0x561834,_0xd1ce6b){var _0x7dae11={},_0x49b6b1={},_0x567a21={'count':0x0,'rows':[]};var _0x11ea62=_['map'](db[_0x4867('0x2e')][_0x4867('0x2f')],function(_0x500b3f){return{'name':_0x500b3f['fieldName'],'type':_0x500b3f[_0x4867('0x30')][_0x4867('0x31')]};});_0x49b6b1[_0x4867('0x32')]=_[_0x4867('0x33')](_0x11ea62,_0x4867('0x2c'));_0x49b6b1[_0x4867('0x34')]=_[_0x4867('0x35')](_0x561834[_0x4867('0x34')]);_0x49b6b1[_0x4867('0x36')]=_['intersection'](_0x49b6b1['model'],_0x49b6b1['query']);_0x7dae11[_0x4867('0x37')]=_[_0x4867('0x38')](_0x49b6b1[_0x4867('0x32')],qs[_0x4867('0x39')](_0x561834[_0x4867('0x34')][_0x4867('0x39')]));_0x7dae11[_0x4867('0x37')]=_0x7dae11[_0x4867('0x37')]['length']?_0x7dae11[_0x4867('0x37')]:_0x49b6b1[_0x4867('0x32')];if(!_0x561834[_0x4867('0x34')][_0x4867('0x3a')](_0x4867('0x3b'))){_0x7dae11['limit']=qs[_0x4867('0x20')](_0x561834['query'][_0x4867('0x20')]);_0x7dae11['offset']=qs[_0x4867('0x1e')](_0x561834['query'][_0x4867('0x1e')]);}_0x7dae11['order']=qs[_0x4867('0x3c')](_0x561834['query'][_0x4867('0x3c')]);_0x7dae11[_0x4867('0x3d')]=qs[_0x4867('0x36')](_[_0x4867('0x3e')](_0x561834[_0x4867('0x34')],_0x49b6b1[_0x4867('0x36')]),_0x11ea62);if(_0x561834[_0x4867('0x34')][_0x4867('0x3f')]){_0x7dae11[_0x4867('0x3d')]=_[_0x4867('0x40')](_0x7dae11[_0x4867('0x3d')],{'$or':_[_0x4867('0x33')](_0x11ea62,function(_0x3e2c17){if(_0x3e2c17['type']!==_0x4867('0x41')){var _0x1c317f={};_0x1c317f[_0x3e2c17['name']]={'$like':'%'+_0x561834['query'][_0x4867('0x3f')]+'%'};return _0x1c317f;}})});}_0x7dae11=_[_0x4867('0x40')]({},_0x7dae11,_0x561834[_0x4867('0x42')]);var _0x446548={'where':_0x7dae11[_0x4867('0x3d')]};return db[_0x4867('0x2e')][_0x4867('0x21')](_0x446548)[_0x4867('0x28')](function(_0x459877){_0x567a21[_0x4867('0x21')]=_0x459877;if(_0x561834[_0x4867('0x34')]['includeAll']){_0x7dae11[_0x4867('0x43')]=[{'all':!![]}];}return db[_0x4867('0x2e')][_0x4867('0x44')](_0x7dae11);})[_0x4867('0x28')](function(_0x153a1a){_0x567a21[_0x4867('0x45')]=_0x153a1a;return _0x567a21;})[_0x4867('0x28')](respondWithFilteredResult(_0xd1ce6b,_0x7dae11))[_0x4867('0x46')](handleError(_0xd1ce6b,null));};exports['show']=function(_0x2c563c,_0x144f4d){var _0xfef635={'raw':!![],'where':{'id':_0x2c563c['params']['id']}},_0x11c864={};_0x11c864[_0x4867('0x32')]=_['keys'](db[_0x4867('0x2e')]['rawAttributes']);_0x11c864[_0x4867('0x34')]=_[_0x4867('0x35')](_0x2c563c[_0x4867('0x34')]);_0x11c864[_0x4867('0x36')]=_['intersection'](_0x11c864[_0x4867('0x32')],_0x11c864[_0x4867('0x34')]);_0xfef635[_0x4867('0x37')]=_['intersection'](_0x11c864['model'],qs['fields'](_0x2c563c[_0x4867('0x34')]['fields']));_0xfef635[_0x4867('0x37')]=_0xfef635[_0x4867('0x37')][_0x4867('0x47')]?_0xfef635[_0x4867('0x37')]:_0x11c864[_0x4867('0x32')];if(_0x2c563c[_0x4867('0x34')][_0x4867('0x48')]){_0xfef635[_0x4867('0x43')]=[{'all':!![]}];}_0xfef635=_[_0x4867('0x40')]({},_0xfef635,_0x2c563c[_0x4867('0x42')]);return db['VtigerField'][_0x4867('0x49')](_0xfef635)[_0x4867('0x28')](handleEntityNotFound(_0x144f4d,null))[_0x4867('0x28')](respondWithResult(_0x144f4d,null))[_0x4867('0x46')](handleError(_0x144f4d,null));};exports[_0x4867('0x4a')]=function(_0x1d3c32,_0x3abd5d){return db[_0x4867('0x2e')][_0x4867('0x4a')](_0x1d3c32[_0x4867('0x4b')],{})[_0x4867('0x28')](respondWithResult(_0x3abd5d,0xc9))[_0x4867('0x46')](handleError(_0x3abd5d,null));};exports[_0x4867('0x27')]=function(_0x1f69d7,_0x4485b6){if(_0x1f69d7['body']['id']){delete _0x1f69d7[_0x4867('0x4b')]['id'];}return db[_0x4867('0x2e')]['find']({'where':{'id':_0x1f69d7['params']['id']}})[_0x4867('0x28')](handleEntityNotFound(_0x4485b6,null))['then'](saveUpdates(_0x1f69d7[_0x4867('0x4b')],null))['then'](respondWithResult(_0x4485b6,null))[_0x4867('0x46')](handleError(_0x4485b6,null));};exports[_0x4867('0x29')]=function(_0x5c027b,_0x2c29ba){return db[_0x4867('0x2e')]['find']({'where':{'id':_0x5c027b['params']['id']}})[_0x4867('0x28')](handleEntityNotFound(_0x2c29ba,null))[_0x4867('0x28')](removeEntity(_0x2c29ba,null))[_0x4867('0x46')](handleError(_0x2c29ba,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index bf1d9e2..a9e33eb 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 _0x28f4=['moment','request-promise','path','../../config/environment','exports','VtigerField','vtiger_unique_index','FieldId','lodash','util','../../config/logger'];(function(_0x2d4b78,_0xa41467){var _0x14da49=function(_0x415b80){while(--_0x415b80){_0x2d4b78['push'](_0x2d4b78['shift']());}};_0x14da49(++_0xa41467);}(_0x28f4,0x189));var _0x428f=function(_0x571780,_0x5b0af8){_0x571780=_0x571780-0x0;var _0x1983af=_0x28f4[_0x571780];return _0x1983af;};'use strict';var _=require(_0x428f('0x0'));var util=require(_0x428f('0x1'));var logger=require(_0x428f('0x2'))('api');var moment=require(_0x428f('0x3'));var BPromise=require('bluebird');var rp=require(_0x428f('0x4'));var fs=require('fs');var path=require(_0x428f('0x5'));var rimraf=require('rimraf');var config=require(_0x428f('0x6'));var attributes=require('./intVtigerField.attributes');module[_0x428f('0x7')]=function(_0x4fb67c,_0x386780){return _0x4fb67c['define'](_0x428f('0x8'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x428f('0x9'),'fields':['idField',_0x428f('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa22b=['exports','VtigerField','vtiger_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes'];(function(_0x37d0bc,_0x109b96){var _0x170e60=function(_0xae2ad){while(--_0xae2ad){_0x37d0bc['push'](_0x37d0bc['shift']());}};_0x170e60(++_0x109b96);}(_0xa22b,0x1b6));var _0xba22=function(_0x3e15c8,_0x9452fc){_0x3e15c8=_0x3e15c8-0x0;var _0x3bbe61=_0xa22b[_0x3e15c8];return _0x3bbe61;};'use strict';var _=require(_0xba22('0x0'));var util=require('util');var logger=require(_0xba22('0x1'))(_0xba22('0x2'));var moment=require(_0xba22('0x3'));var BPromise=require(_0xba22('0x4'));var rp=require(_0xba22('0x5'));var fs=require('fs');var path=require(_0xba22('0x6'));var rimraf=require(_0xba22('0x7'));var config=require(_0xba22('0x8'));var attributes=require(_0xba22('0x9'));module[_0xba22('0xa')]=function(_0x5827f6,_0x1c00f1){return _0x5827f6['define'](_0xba22('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xba22('0xc'),'fields':['idField',_0xba22('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 9b77f44..5662663 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 _0xd2d7=['info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x2f62da,_0xc525d0){var _0x1b4808=function(_0x50f616){while(--_0x50f616){_0x2f62da['push'](_0x2f62da['shift']());}};_0x1b4808(++_0xc525d0);}(_0xd2d7,0x1dc));var _0x7d2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2d7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7d2d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7d2d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d2d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7d2d('0x3'));var logger=require(_0x7d2d('0x4'))(_0x7d2d('0x5'));var config=require(_0x7d2d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7d2d('0x7')][_0x7d2d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe2e05f,_0x537eb4,_0x2715d4){return new BPromise(function(_0x40b958,_0x480b32){return client[_0x7d2d('0x9')](_0xe2e05f,_0x2715d4)['then'](function(_0x165675){logger[_0x7d2d('0xa')](_0x7d2d('0xb'),_0x537eb4,_0x7d2d('0xc'));logger[_0x7d2d('0xd')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x537eb4,'request\x20sent',JSON['stringify'](_0x165675));if(_0x165675[_0x7d2d('0xe')]){if(_0x165675['error'][_0x7d2d('0xf')]===0x1f4){logger[_0x7d2d('0xe')]('VtigerField,\x20%s,\x20%s',_0x537eb4,_0x165675[_0x7d2d('0xe')]['message']);return _0x480b32(_0x165675['error'][_0x7d2d('0x10')]);}logger[_0x7d2d('0xe')](_0x7d2d('0xb'),_0x537eb4,_0x165675[_0x7d2d('0xe')]['message']);return _0x40b958(_0x165675[_0x7d2d('0xe')][_0x7d2d('0x10')]);}else{logger['info'](_0x7d2d('0xb'),_0x537eb4,_0x7d2d('0xc'));_0x40b958(_0x165675[_0x7d2d('0x11')]['message']);}})['catch'](function(_0xbc0036){logger[_0x7d2d('0xe')](_0x7d2d('0xb'),_0x537eb4,_0xbc0036);_0x480b32(_0xbc0036);});});} \ No newline at end of file +var _0xd4be=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xd4be,0xc2));var _0xed4b=function(_0x57007,_0x199688){_0x57007=_0x57007-0x0;var _0x48a386=_0xd4be[_0x57007];return _0x48a386;};'use strict';var _=require(_0xed4b('0x0'));var util=require('util');var moment=require(_0xed4b('0x1'));var BPromise=require(_0xed4b('0x2'));var rs=require(_0xed4b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed4b('0x4'))['db'];var utils=require(_0xed4b('0x5'));var logger=require(_0xed4b('0x6'))(_0xed4b('0x7'));var config=require(_0xed4b('0x8'));var jayson=require(_0xed4b('0x9'));var client=jayson[_0xed4b('0xa')][_0xed4b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x496e3a,_0x9d399b,_0x550f81){return new BPromise(function(_0x49e043,_0x73f56e){return client[_0xed4b('0xc')](_0x496e3a,_0x550f81)[_0xed4b('0xd')](function(_0x461cb2){logger[_0xed4b('0xe')](_0xed4b('0xf'),_0x9d399b,_0xed4b('0x10'));logger[_0xed4b('0x11')](_0xed4b('0x12'),_0x9d399b,_0xed4b('0x10'),JSON[_0xed4b('0x13')](_0x461cb2));if(_0x461cb2[_0xed4b('0x14')]){if(_0x461cb2[_0xed4b('0x14')][_0xed4b('0x15')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x9d399b,_0x461cb2['error'][_0xed4b('0x16')]);return _0x73f56e(_0x461cb2[_0xed4b('0x14')][_0xed4b('0x16')]);}logger[_0xed4b('0x14')]('VtigerField,\x20%s,\x20%s',_0x9d399b,_0x461cb2['error']['message']);return _0x49e043(_0x461cb2[_0xed4b('0x14')][_0xed4b('0x16')]);}else{logger[_0xed4b('0xe')](_0xed4b('0xf'),_0x9d399b,_0xed4b('0x10'));_0x49e043(_0x461cb2[_0xed4b('0x17')][_0xed4b('0x16')]);}})[_0xed4b('0x18')](function(_0x1897d4){logger['error']('VtigerField,\x20%s,\x20%s',_0x9d399b,_0x1897d4);_0x73f56e(_0x1897d4);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 232b331..b410ada 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 _0x506a=['get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller'];(function(_0x103846,_0x5f13cd){var _0x1ea7e1=function(_0xa87dd3){while(--_0xa87dd3){_0x103846['push'](_0x103846['shift']());}};_0x1ea7e1(++_0x5f13cd);}(_0x506a,0x1c6));var _0xa506=function(_0x4a0349,_0xcaa608){_0x4a0349=_0x4a0349-0x0;var _0x52dcc8=_0x506a[_0x4a0349];return _0x52dcc8;};'use strict';var multer=require(_0xa506('0x0'));var util=require('util');var path=require(_0xa506('0x1'));var timeout=require(_0xa506('0x2'));var express=require(_0xa506('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa506('0x4'));var interaction=require(_0xa506('0x5'));var config=require(_0xa506('0x6'));var controller=require(_0xa506('0x7'));router[_0xa506('0x8')]('/',auth[_0xa506('0x9')](),controller['index']);router[_0xa506('0x8')](_0xa506('0xa'),auth['isAuthenticated'](),controller[_0xa506('0xb')]);router[_0xa506('0x8')](_0xa506('0xc'),auth[_0xa506('0x9')](),controller[_0xa506('0xd')]);router[_0xa506('0x8')](_0xa506('0xe'),auth[_0xa506('0x9')](),controller[_0xa506('0xf')]);router['post']('/',auth[_0xa506('0x9')](),controller[_0xa506('0x10')]);router[_0xa506('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0xa506('0x12')]('/:id',auth[_0xa506('0x9')](),controller[_0xa506('0x13')]);router['delete'](_0xa506('0xa'),auth[_0xa506('0x9')](),controller[_0xa506('0x14')]);module[_0xa506('0x15')]=router; \ No newline at end of file +var _0x6083=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','create','post','addConfiguration','update','delete','destroy','exports','multer','util'];(function(_0x3c6dce,_0x5424dd){var _0x1450e9=function(_0xd51b5c){while(--_0xd51b5c){_0x3c6dce['push'](_0x3c6dce['shift']());}};_0x1450e9(++_0x5424dd);}(_0x6083,0x9f));var _0x3608=function(_0x14a54c,_0x4b97bc){_0x14a54c=_0x14a54c-0x0;var _0xb3d7a2=_0x6083[_0x14a54c];return _0xb3d7a2;};'use strict';var multer=require(_0x3608('0x0'));var util=require(_0x3608('0x1'));var path=require('path');var timeout=require(_0x3608('0x2'));var express=require(_0x3608('0x3'));var router=express[_0x3608('0x4')]();var fs_extra=require(_0x3608('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3608('0x6'));var config=require(_0x3608('0x7'));var controller=require(_0x3608('0x8'));router[_0x3608('0x9')]('/',auth[_0x3608('0xa')](),controller[_0x3608('0xb')]);router['get'](_0x3608('0xc'),auth[_0x3608('0xa')](),controller[_0x3608('0xd')]);router[_0x3608('0x9')]('/:id/configurations',auth[_0x3608('0xa')](),controller[_0x3608('0xe')]);router[_0x3608('0x9')](_0x3608('0xf'),auth[_0x3608('0xa')](),controller['getFields']);router['post']('/',auth[_0x3608('0xa')](),controller[_0x3608('0x10')]);router[_0x3608('0x11')]('/:id/configurations',auth[_0x3608('0xa')](),controller[_0x3608('0x12')]);router['put'](_0x3608('0xc'),auth['isAuthenticated'](),controller[_0x3608('0x13')]);router[_0x3608('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x3608('0x15')]);module[_0x3608('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 2fa0dd0..5d6f569 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 _0x44fe=['STRING','username','remoteUri','ENUM','password','integrationTab','newTab','sequelize','exports'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0x44fe,0x16f));var _0xe44f=function(_0x2b4691,_0x3e1472){_0x2b4691=_0x2b4691-0x0;var _0x47ce10=_0x44fe[_0x2b4691];return _0x47ce10;};'use strict';var Sequelize=require(_0xe44f('0x0'));module[_0xe44f('0x1')]={'name':{'type':Sequelize[_0xe44f('0x2')]},'description':{'type':Sequelize[_0xe44f('0x2')]},'username':{'type':Sequelize[_0xe44f('0x2')],'unique':_0xe44f('0x3')},'password':{'type':Sequelize[_0xe44f('0x2')]},'token':{'type':Sequelize[_0xe44f('0x2')]},'remoteUri':{'type':Sequelize[_0xe44f('0x2')],'unique':_0xe44f('0x4')},'authType':{'type':Sequelize[_0xe44f('0x5')]('password','token'),'defaultValue':_0xe44f('0x6')},'serverUrl':{'type':Sequelize[_0xe44f('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe44f('0x7'),_0xe44f('0x8')),'defaultValue':_0xe44f('0x7')}}; \ No newline at end of file +var _0x9fe7=['newTab','integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM','password'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9fe7,0x1df));var _0x79fe=function(_0x4235df,_0xa5e872){_0x4235df=_0x4235df-0x0;var _0x53811d=_0x9fe7[_0x4235df];return _0x53811d;};'use strict';var Sequelize=require(_0x79fe('0x0'));module[_0x79fe('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x79fe('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x79fe('0x3')},'password':{'type':Sequelize[_0x79fe('0x2')]},'token':{'type':Sequelize[_0x79fe('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x79fe('0x4')},'authType':{'type':Sequelize[_0x79fe('0x5')](_0x79fe('0x6'),'token'),'defaultValue':_0x79fe('0x6')},'serverUrl':{'type':Sequelize[_0x79fe('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x79fe('0x5')]('integrationTab',_0x79fe('0x7')),'defaultValue':_0x79fe('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 574b7c8..5f9db48 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 _0x84a0=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','ZendeskAccount','findAll','rows','show','length','include','find','catch','create','body','update','params','findOne','ZendeskConfiguration','order','getConfigurations','hasOwnProperty','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','username','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','password','headers','Basic\x20%s','%s:%s','toString','%s/token:%s','token','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0x15196c,_0x468778){var _0x5f37ba=function(_0x5627d3){while(--_0x5627d3){_0x15196c['push'](_0x15196c['shift']());}};_0x5f37ba(++_0x468778);}(_0x84a0,0x66));var _0x084a=function(_0x675b80,_0x5a4b91){_0x675b80=_0x675b80-0x0;var _0x3a8aff=_0x84a0[_0x675b80];return _0x3a8aff;};'use strict';var emlformat=require(_0x084a('0x0'));var rimraf=require(_0x084a('0x1'));var zipdir=require(_0x084a('0x2'));var jsonpatch=require(_0x084a('0x3'));var rp=require('request-promise');var moment=require(_0x084a('0x4'));var BPromise=require(_0x084a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x084a('0x6'));var sox=require(_0x084a('0x7'));var csv=require('to-csv');var ejs=require(_0x084a('0x8'));var fs=require('fs');var fs_extra=require(_0x084a('0x9'));var _=require(_0x084a('0xa'));var squel=require(_0x084a('0xb'));var crypto=require(_0x084a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x084a('0xd'));var toCsv=require(_0x084a('0xe'));var querystring=require(_0x084a('0xf'));var Papa=require(_0x084a('0x10'));var Redis=require(_0x084a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x084a('0x12'));var hardwareService=require(_0x084a('0x13'));var logger=require(_0x084a('0x14'))(_0x084a('0x15'));var utils=require(_0x084a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x084a('0x17'))['db'];var integrations=require(_0x084a('0x18'));function respondWithStatusCode(_0xec90a5,_0x9245b1){_0x9245b1=_0x9245b1||0xcc;return function(_0x1bdfb8){if(_0x1bdfb8){return _0xec90a5[_0x084a('0x19')](_0x9245b1);}return _0xec90a5[_0x084a('0x1a')](_0x9245b1)[_0x084a('0x1b')]();};}function respondWithResult(_0x5aef40,_0x4277c9){_0x4277c9=_0x4277c9||0xc8;return function(_0x4b9cc5){if(_0x4b9cc5){return _0x5aef40[_0x084a('0x1a')](_0x4277c9)[_0x084a('0x1c')](_0x4b9cc5);}};}function respondWithFilteredResult(_0x366624,_0x2d35b8){return function(_0xd20527){if(_0xd20527){var _0x4cbd16=typeof _0x2d35b8[_0x084a('0x1d')]==='undefined'&&typeof _0x2d35b8[_0x084a('0x1e')]===_0x084a('0x1f');var _0x4af43e=_0xd20527[_0x084a('0x20')];var _0x32c729=_0x4cbd16?0x0:_0x2d35b8[_0x084a('0x1d')];var _0x14bb19=_0x4cbd16?_0xd20527[_0x084a('0x20')]:_0x2d35b8[_0x084a('0x1d')]+_0x2d35b8[_0x084a('0x1e')];var _0x34e86e;if(_0x14bb19>=_0x4af43e){_0x14bb19=_0x4af43e;_0x34e86e=0xc8;}else{_0x34e86e=0xce;}_0x366624[_0x084a('0x1a')](_0x34e86e);return _0x366624[_0x084a('0x21')](_0x084a('0x22'),_0x32c729+'-'+_0x14bb19+'/'+_0x4af43e)[_0x084a('0x1c')](_0xd20527);}return null;};}function patchUpdates(_0x116328){return function(_0x126efb){try{jsonpatch[_0x084a('0x23')](_0x126efb,_0x116328,!![]);}catch(_0x506f71){return BPromise[_0x084a('0x24')](_0x506f71);}return _0x126efb[_0x084a('0x25')]();};}function saveUpdates(_0x41a90f,_0x2d62bf){return function(_0x1c3f6c){if(_0x1c3f6c){return _0x1c3f6c['update'](_0x41a90f)[_0x084a('0x26')](function(_0x288e9e){return _0x288e9e;});}return null;};}function removeEntity(_0x6346a5,_0x1f2c9f){return function(_0x18b43d){if(_0x18b43d){return _0x18b43d[_0x084a('0x27')]()['then'](function(){_0x6346a5[_0x084a('0x1a')](0xcc)[_0x084a('0x1b')]();});}};}function handleEntityNotFound(_0x54233b,_0x5b1474){return function(_0x8806d5){if(!_0x8806d5){_0x54233b[_0x084a('0x19')](0x194);}return _0x8806d5;};}function handleError(_0xfc9b8c,_0x4c5658){_0x4c5658=_0x4c5658||0x1f4;return function(_0x5596ac){logger['error'](_0x5596ac['stack']);if(_0x5596ac[_0x084a('0x28')]){delete _0x5596ac['name'];}_0xfc9b8c['status'](_0x4c5658)['send'](_0x5596ac);};}exports[_0x084a('0x29')]=function(_0x4651e6,_0x388062){var _0x2c4149={},_0x3be7a6={},_0x25a2a1={'count':0x0,'rows':[]};var _0x378de6=_[_0x084a('0x2a')](db['ZendeskAccount'][_0x084a('0x2b')],function(_0x3b2b38){return{'name':_0x3b2b38['fieldName'],'type':_0x3b2b38[_0x084a('0x2c')][_0x084a('0x2d')]};});_0x3be7a6[_0x084a('0x2e')]=_[_0x084a('0x2a')](_0x378de6,_0x084a('0x28'));_0x3be7a6[_0x084a('0x2f')]=_[_0x084a('0x30')](_0x4651e6[_0x084a('0x2f')]);_0x3be7a6[_0x084a('0x31')]=_[_0x084a('0x32')](_0x3be7a6[_0x084a('0x2e')],_0x3be7a6[_0x084a('0x2f')]);_0x2c4149[_0x084a('0x33')]=_['intersection'](_0x3be7a6['model'],qs[_0x084a('0x34')](_0x4651e6[_0x084a('0x2f')][_0x084a('0x34')]));_0x2c4149[_0x084a('0x33')]=_0x2c4149[_0x084a('0x33')]['length']?_0x2c4149[_0x084a('0x33')]:_0x3be7a6[_0x084a('0x2e')];if(!_0x4651e6[_0x084a('0x2f')]['hasOwnProperty'](_0x084a('0x35'))){_0x2c4149[_0x084a('0x1e')]=qs[_0x084a('0x1e')](_0x4651e6['query']['limit']);_0x2c4149['offset']=qs[_0x084a('0x1d')](_0x4651e6[_0x084a('0x2f')][_0x084a('0x1d')]);}_0x2c4149['order']=qs[_0x084a('0x36')](_0x4651e6[_0x084a('0x2f')][_0x084a('0x36')]);_0x2c4149[_0x084a('0x37')]=qs[_0x084a('0x31')](_[_0x084a('0x38')](_0x4651e6[_0x084a('0x2f')],_0x3be7a6[_0x084a('0x31')]),_0x378de6);if(_0x4651e6[_0x084a('0x2f')][_0x084a('0x39')]){_0x2c4149[_0x084a('0x37')]=_[_0x084a('0x3a')](_0x2c4149[_0x084a('0x37')],{'$or':_[_0x084a('0x2a')](_0x378de6,function(_0x10983f){if(_0x10983f['type']!==_0x084a('0x3b')){var _0x1dada8={};_0x1dada8[_0x10983f[_0x084a('0x28')]]={'$like':'%'+_0x4651e6[_0x084a('0x2f')][_0x084a('0x39')]+'%'};return _0x1dada8;}})});}_0x2c4149=_[_0x084a('0x3a')]({},_0x2c4149,_0x4651e6[_0x084a('0x3c')]);var _0x183e10={'where':_0x2c4149[_0x084a('0x37')]};return db['ZendeskAccount'][_0x084a('0x20')](_0x183e10)[_0x084a('0x26')](function(_0x25a081){_0x25a2a1[_0x084a('0x20')]=_0x25a081;if(_0x4651e6[_0x084a('0x2f')][_0x084a('0x3d')]){_0x2c4149['include']=[{'all':!![]}];}return db[_0x084a('0x3e')][_0x084a('0x3f')](_0x2c4149);})['then'](function(_0x410fdb){_0x25a2a1[_0x084a('0x40')]=_0x410fdb;return _0x25a2a1;})[_0x084a('0x26')](respondWithFilteredResult(_0x388062,_0x2c4149))['catch'](handleError(_0x388062,null));};exports[_0x084a('0x41')]=function(_0xba1081,_0x4fe9c2){var _0x3e2b92={'raw':![],'where':{'id':_0xba1081['params']['id']}},_0xfb565c={};_0xfb565c['model']=_[_0x084a('0x30')](db[_0x084a('0x3e')][_0x084a('0x2b')]);_0xfb565c[_0x084a('0x2f')]=_[_0x084a('0x30')](_0xba1081[_0x084a('0x2f')]);_0xfb565c[_0x084a('0x31')]=_[_0x084a('0x32')](_0xfb565c[_0x084a('0x2e')],_0xfb565c[_0x084a('0x2f')]);_0x3e2b92[_0x084a('0x33')]=_['intersection'](_0xfb565c['model'],qs[_0x084a('0x34')](_0xba1081[_0x084a('0x2f')][_0x084a('0x34')]));_0x3e2b92['attributes']=_0x3e2b92[_0x084a('0x33')][_0x084a('0x42')]?_0x3e2b92[_0x084a('0x33')]:_0xfb565c[_0x084a('0x2e')];if(_0xba1081[_0x084a('0x2f')]['includeAll']){_0x3e2b92[_0x084a('0x43')]=[{'all':!![]}];}_0x3e2b92=_['merge']({},_0x3e2b92,_0xba1081[_0x084a('0x3c')]);return db[_0x084a('0x3e')][_0x084a('0x44')](_0x3e2b92)['then'](handleEntityNotFound(_0x4fe9c2,null))['then'](respondWithResult(_0x4fe9c2,null))[_0x084a('0x45')](handleError(_0x4fe9c2,null));};exports[_0x084a('0x46')]=function(_0x505965,_0x29d8c2){return db[_0x084a('0x3e')][_0x084a('0x46')](_0x505965[_0x084a('0x47')],{})['then'](respondWithResult(_0x29d8c2,0xc9))[_0x084a('0x45')](handleError(_0x29d8c2,null));};exports[_0x084a('0x48')]=function(_0x31677b,_0x10856d){if(_0x31677b['body']['id']){delete _0x31677b[_0x084a('0x47')]['id'];}return db[_0x084a('0x3e')][_0x084a('0x44')]({'where':{'id':_0x31677b[_0x084a('0x49')]['id']}})['then'](handleEntityNotFound(_0x10856d,null))['then'](saveUpdates(_0x31677b[_0x084a('0x47')],null))[_0x084a('0x26')](respondWithResult(_0x10856d,null))[_0x084a('0x45')](handleError(_0x10856d,null));};exports[_0x084a('0x27')]=function(_0xf936e,_0x3b2df4){return db[_0x084a('0x3e')][_0x084a('0x44')]({'where':{'id':_0xf936e[_0x084a('0x49')]['id']}})[_0x084a('0x26')](handleEntityNotFound(_0x3b2df4,null))[_0x084a('0x26')](removeEntity(_0x3b2df4,null))[_0x084a('0x45')](handleError(_0x3b2df4,null));};exports['getConfigurations']=function(_0xcdd5b,_0x37fce4,_0x29fa4b){var _0x39edc1={};var _0x2091b1={};var _0x1c972c;var _0xa5362;return db['ZendeskAccount'][_0x084a('0x4a')]({'where':{'id':_0xcdd5b[_0x084a('0x49')]['id']}})[_0x084a('0x26')](handleEntityNotFound(_0x37fce4,null))['then'](function(_0x54ca1f){if(_0x54ca1f){_0x1c972c=_0x54ca1f;_0x2091b1[_0x084a('0x2e')]=_['keys'](db[_0x084a('0x4b')][_0x084a('0x2b')]);_0x2091b1['query']=_[_0x084a('0x30')](_0xcdd5b['query']);_0x2091b1['filters']=_[_0x084a('0x32')](_0x2091b1[_0x084a('0x2e')],_0x2091b1[_0x084a('0x2f')]);_0x39edc1[_0x084a('0x33')]=_[_0x084a('0x32')](_0x2091b1[_0x084a('0x2e')],qs[_0x084a('0x34')](_0xcdd5b['query'][_0x084a('0x34')]));_0x39edc1[_0x084a('0x33')]=_0x39edc1[_0x084a('0x33')]['length']?_0x39edc1[_0x084a('0x33')]:_0x2091b1[_0x084a('0x2e')];_0x39edc1[_0x084a('0x4c')]=qs[_0x084a('0x36')](_0xcdd5b['query'][_0x084a('0x36')]);_0x39edc1['where']=qs[_0x084a('0x31')](_[_0x084a('0x38')](_0xcdd5b[_0x084a('0x2f')],_0x2091b1['filters']));if(_0xcdd5b['query'][_0x084a('0x39')]){_0x39edc1[_0x084a('0x37')]=_['merge'](_0x39edc1[_0x084a('0x37')],{'$or':_['map'](_0x39edc1['attributes'],function(_0x195ae2){var _0x3f3fd7={};_0x3f3fd7[_0x195ae2]={'$like':'%'+_0xcdd5b[_0x084a('0x2f')][_0x084a('0x39')]+'%'};return _0x3f3fd7;})});}_0x39edc1=_[_0x084a('0x3a')]({},_0x39edc1,_0xcdd5b[_0x084a('0x3c')]);return _0x1c972c[_0x084a('0x4d')](_0x39edc1);}})[_0x084a('0x26')](function(_0x114aa5){if(_0x114aa5){_0xa5362=_0x114aa5['length'];if(!_0xcdd5b[_0x084a('0x2f')][_0x084a('0x4e')](_0x084a('0x35'))){_0x39edc1['limit']=qs[_0x084a('0x1e')](_0xcdd5b[_0x084a('0x2f')]['limit']);_0x39edc1[_0x084a('0x1d')]=qs['offset'](_0xcdd5b['query'][_0x084a('0x1d')]);}return _0x1c972c['getConfigurations'](_0x39edc1);}})['then'](function(_0x2368f5){if(_0x2368f5){return _0x2368f5?{'count':_0xa5362,'rows':_0x2368f5}:null;}})[_0x084a('0x26')](respondWithResult(_0x37fce4,null))[_0x084a('0x45')](handleError(_0x37fce4,null));};exports['addConfiguration']=function(_0xff6c9e,_0xbd063c,_0x2311f5){if(_0xff6c9e[_0x084a('0x47')]['id']){delete _0xff6c9e[_0x084a('0x47')]['id'];}return db[_0x084a('0x3e')][_0x084a('0x4a')]({'where':{'id':_0xff6c9e['params']['id']}})['then'](handleEntityNotFound(_0xbd063c,null))[_0x084a('0x26')](function(_0x36ba24){if(_0x36ba24){_0xff6c9e['body'][_0x084a('0x4f')]=_0x36ba24['id'];_0xff6c9e[_0x084a('0x47')][_0x084a('0x50')]=integrations[_0x084a('0x51')](_0xff6c9e['body'][_0x084a('0x52')],_0xff6c9e[_0x084a('0x47')][_0x084a('0x2c')]);_0xff6c9e['body']['Descriptions']=integrations[_0x084a('0x53')](_0xff6c9e[_0x084a('0x47')][_0x084a('0x52')],_0xff6c9e[_0x084a('0x47')][_0x084a('0x2c')]);return db[_0x084a('0x4b')][_0x084a('0x46')](_0xff6c9e['body'],{'include':[{'model':db[_0x084a('0x54')],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0x084a('0x55')}]});}return null;})[_0x084a('0x26')](respondWithResult(_0xbd063c,null))[_0x084a('0x45')](handleError(_0xbd063c,null));};exports['getFields']=function(_0x163a5d,_0x57729c,_0x1eb7be){var _0x1054ea='';return db[_0x084a('0x3e')][_0x084a('0x4a')]({'where':{'id':_0x163a5d[_0x084a('0x49')]['id']},'attributes':['id',_0x084a('0x56'),'password','token',_0x084a('0x57'),_0x084a('0x58')]})[_0x084a('0x26')](handleEntityNotFound(_0x57729c,null))[_0x084a('0x26')](function(_0x22abf5){if(_0x22abf5){_0x1054ea=_0x22abf5[_0x084a('0x58')];var _0x5c655f=_0x1054ea[_0x084a('0x59')](-0x1);if(_0x5c655f==='/'){_0x1054ea=_0x1054ea[_0x084a('0x5a')](0x0,_0x1054ea[_0x084a('0x5b')](_0x5c655f));}var _0x33c040={'method':_0x084a('0x5c'),'uri':util[_0x084a('0x5d')](_0x084a('0x5e'),_0x1054ea,'ticket_fields'),'json':!![]};switch(_0x22abf5[_0x084a('0x57')]){case _0x084a('0x5f'):_0x33c040[_0x084a('0x60')]={'Authorization':util[_0x084a('0x5d')](_0x084a('0x61'),new Buffer(util[_0x084a('0x5d')](_0x084a('0x62'),_0x22abf5[_0x084a('0x56')],_0x22abf5[_0x084a('0x5f')]))[_0x084a('0x63')]('base64'))};break;case'token':_0x33c040['headers']={'Authorization':util[_0x084a('0x5d')](_0x084a('0x61'),new Buffer(util['format'](_0x084a('0x64'),_0x22abf5[_0x084a('0x56')],_0x22abf5[_0x084a('0x65')]))[_0x084a('0x63')]('base64'))};break;default:throw new db['Sequelize'][(_0x084a('0x66'))](_0x084a('0x67'));}return rp(_0x33c040);}})[_0x084a('0x26')](function(_0x37d05a){if(_0x37d05a){var _0x155450=[_0x084a('0x68'),_0x084a('0x69'),'group',_0x084a('0x6a')];_[_0x084a('0x6b')](_0x37d05a[_0x084a('0x6c')],function(_0x137bba){return _0x155450[_0x084a('0x6d')](_0x137bba[_0x084a('0x2c')]);});return{'count':_0x37d05a[_0x084a('0x6c')]['length'],'rows':_[_0x084a('0x2a')](_0x37d05a[_0x084a('0x6c')],function(_0x26a88c){return{'id':_0x26a88c['id'],'name':_0x26a88c[_0x084a('0x6e')]>0x7?_0x26a88c[_0x084a('0x6f')]:_0x26a88c[_0x084a('0x2c')],'custom':_0x26a88c[_0x084a('0x6e')]>0x7?!![]:![],'options':_0x26a88c[_0x084a('0x70')]?_0x26a88c[_0x084a('0x70')]:_0x26a88c[_0x084a('0x71')]?_0x26a88c[_0x084a('0x71')]:[]};})};}})['then'](respondWithResult(_0x57729c,null))[_0x084a('0x45')](function(_0x29916a){var _0x4b8f1f=_0x163a5d[_0x084a('0x2f')]['test']?0x1f4:_0x29916a['statusCode']||0x1f4;logger[_0x084a('0x72')](_0x084a('0x73'),'getFields',_0x4b8f1f,JSON[_0x084a('0x74')](_0x29916a));delete _0x29916a[_0x084a('0x28')];if(_0x4b8f1f===0x191){_0x4b8f1f=0x190;}_0x57729c[_0x084a('0x1a')](_0x4b8f1f)[_0x084a('0x75')](_0x163a5d[_0x084a('0x2f')][_0x084a('0x76')]?{'message':_0x084a('0x77'),'statusCode':_0x29916a[_0x084a('0x78')]}:_0x29916a);});}; \ No newline at end of file +var _0x1339=['Sequelize','Unknown\x20authentication\x20type','description','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','update','then','name','send','map','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','ZendeskAccount','includeAll','include','rows','catch','show','rawAttributes','intersection','find','create','body','destroy','params','findOne','pick','getConfigurations','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','GET','%s/%s','authType','headers','format','Basic\x20%s','%s:%s','toString','%s/token:%s','base64'];(function(_0x36926a,_0x37ab96){var _0xda5af2=function(_0x2f10dd){while(--_0x2f10dd){_0x36926a['push'](_0x36926a['shift']());}};_0xda5af2(++_0x37ab96);}(_0x1339,0x1ed));var _0x9133=function(_0x3b44a1,_0x31b3e0){_0x3b44a1=_0x3b44a1-0x0;var _0x24fc35=_0x1339[_0x3b44a1];return _0x24fc35;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9133('0x0'));var jsonpatch=require(_0x9133('0x1'));var rp=require(_0x9133('0x2'));var moment=require(_0x9133('0x3'));var BPromise=require(_0x9133('0x4'));var Mustache=require(_0x9133('0x5'));var util=require(_0x9133('0x6'));var path=require(_0x9133('0x7'));var sox=require('sox');var csv=require(_0x9133('0x8'));var ejs=require(_0x9133('0x9'));var fs=require('fs');var fs_extra=require(_0x9133('0xa'));var _=require('lodash');var squel=require(_0x9133('0xb'));var crypto=require(_0x9133('0xc'));var jsforce=require(_0x9133('0xd'));var deskjs=require(_0x9133('0xe'));var toCsv=require(_0x9133('0x8'));var querystring=require(_0x9133('0xf'));var Papa=require(_0x9133('0x10'));var Redis=require(_0x9133('0x11'));var authService=require(_0x9133('0x12'));var qs=require(_0x9133('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9133('0x14'));var logger=require(_0x9133('0x15'))(_0x9133('0x16'));var utils=require(_0x9133('0x17'));var config=require(_0x9133('0x18'));var licenseUtil=require(_0x9133('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9133('0x1a'));function respondWithStatusCode(_0x7cc59e,_0x4bbfdc){_0x4bbfdc=_0x4bbfdc||0xcc;return function(_0x5283a3){if(_0x5283a3){return _0x7cc59e[_0x9133('0x1b')](_0x4bbfdc);}return _0x7cc59e['status'](_0x4bbfdc)[_0x9133('0x1c')]();};}function respondWithResult(_0x439e1a,_0x17dfd1){_0x17dfd1=_0x17dfd1||0xc8;return function(_0x464ec5){if(_0x464ec5){return _0x439e1a[_0x9133('0x1d')](_0x17dfd1)[_0x9133('0x1e')](_0x464ec5);}};}function respondWithFilteredResult(_0x49cc5d,_0x13f8fc){return function(_0x1e23ce){if(_0x1e23ce){var _0x4f4f14=typeof _0x13f8fc[_0x9133('0x1f')]===_0x9133('0x20')&&typeof _0x13f8fc[_0x9133('0x21')]===_0x9133('0x20');var _0x4a2c4f=_0x1e23ce[_0x9133('0x22')];var _0x573998=_0x4f4f14?0x0:_0x13f8fc[_0x9133('0x1f')];var _0x5d4a77=_0x4f4f14?_0x1e23ce[_0x9133('0x22')]:_0x13f8fc[_0x9133('0x1f')]+_0x13f8fc['limit'];var _0x38dd60;if(_0x5d4a77>=_0x4a2c4f){_0x5d4a77=_0x4a2c4f;_0x38dd60=0xc8;}else{_0x38dd60=0xce;}_0x49cc5d['status'](_0x38dd60);return _0x49cc5d[_0x9133('0x23')]('Content-Range',_0x573998+'-'+_0x5d4a77+'/'+_0x4a2c4f)['json'](_0x1e23ce);}return null;};}function patchUpdates(_0x2f7354){return function(_0x577de4){try{jsonpatch[_0x9133('0x24')](_0x577de4,_0x2f7354,!![]);}catch(_0x4c1088){return BPromise['reject'](_0x4c1088);}return _0x577de4['save']();};}function saveUpdates(_0x2e99a1,_0x2dcfb8){return function(_0x4da09c){if(_0x4da09c){return _0x4da09c[_0x9133('0x25')](_0x2e99a1)[_0x9133('0x26')](function(_0xff08d5){return _0xff08d5;});}return null;};}function removeEntity(_0x26190c,_0x4f26e8){return function(_0xdb7a98){if(_0xdb7a98){return _0xdb7a98['destroy']()[_0x9133('0x26')](function(){_0x26190c[_0x9133('0x1d')](0xcc)[_0x9133('0x1c')]();});}};}function handleEntityNotFound(_0x14c1cb,_0x4483ef){return function(_0xe829b){if(!_0xe829b){_0x14c1cb[_0x9133('0x1b')](0x194);}return _0xe829b;};}function handleError(_0x313d43,_0x1b6b3e){_0x1b6b3e=_0x1b6b3e||0x1f4;return function(_0x46050b){logger['error'](_0x46050b['stack']);if(_0x46050b[_0x9133('0x27')]){delete _0x46050b[_0x9133('0x27')];}_0x313d43[_0x9133('0x1d')](_0x1b6b3e)[_0x9133('0x28')](_0x46050b);};}exports['index']=function(_0x4ecd9e,_0x3e2404){var _0x45966d={},_0x188c49={},_0x26d351={'count':0x0,'rows':[]};var _0x390f50=_[_0x9133('0x29')](db['ZendeskAccount']['rawAttributes'],function(_0x5a27c1){return{'name':_0x5a27c1[_0x9133('0x2a')],'type':_0x5a27c1['type'][_0x9133('0x2b')]};});_0x188c49[_0x9133('0x2c')]=_['map'](_0x390f50,_0x9133('0x27'));_0x188c49['query']=_[_0x9133('0x2d')](_0x4ecd9e[_0x9133('0x2e')]);_0x188c49[_0x9133('0x2f')]=_['intersection'](_0x188c49[_0x9133('0x2c')],_0x188c49[_0x9133('0x2e')]);_0x45966d[_0x9133('0x30')]=_['intersection'](_0x188c49[_0x9133('0x2c')],qs[_0x9133('0x31')](_0x4ecd9e[_0x9133('0x2e')]['fields']));_0x45966d[_0x9133('0x30')]=_0x45966d[_0x9133('0x30')][_0x9133('0x32')]?_0x45966d[_0x9133('0x30')]:_0x188c49['model'];if(!_0x4ecd9e[_0x9133('0x2e')][_0x9133('0x33')]('nolimit')){_0x45966d[_0x9133('0x21')]=qs[_0x9133('0x21')](_0x4ecd9e[_0x9133('0x2e')][_0x9133('0x21')]);_0x45966d[_0x9133('0x1f')]=qs[_0x9133('0x1f')](_0x4ecd9e[_0x9133('0x2e')][_0x9133('0x1f')]);}_0x45966d[_0x9133('0x34')]=qs[_0x9133('0x35')](_0x4ecd9e[_0x9133('0x2e')]['sort']);_0x45966d[_0x9133('0x36')]=qs[_0x9133('0x2f')](_['pick'](_0x4ecd9e[_0x9133('0x2e')],_0x188c49[_0x9133('0x2f')]),_0x390f50);if(_0x4ecd9e[_0x9133('0x2e')][_0x9133('0x37')]){_0x45966d[_0x9133('0x36')]=_[_0x9133('0x38')](_0x45966d['where'],{'$or':_['map'](_0x390f50,function(_0x33c05b){if(_0x33c05b[_0x9133('0x39')]!==_0x9133('0x3a')){var _0x112514={};_0x112514[_0x33c05b[_0x9133('0x27')]]={'$like':'%'+_0x4ecd9e[_0x9133('0x2e')][_0x9133('0x37')]+'%'};return _0x112514;}})});}_0x45966d=_[_0x9133('0x38')]({},_0x45966d,_0x4ecd9e[_0x9133('0x3b')]);var _0x5a3f73={'where':_0x45966d[_0x9133('0x36')]};return db[_0x9133('0x3c')][_0x9133('0x22')](_0x5a3f73)[_0x9133('0x26')](function(_0x3df6ca){_0x26d351['count']=_0x3df6ca;if(_0x4ecd9e[_0x9133('0x2e')][_0x9133('0x3d')]){_0x45966d[_0x9133('0x3e')]=[{'all':!![]}];}return db[_0x9133('0x3c')]['findAll'](_0x45966d);})[_0x9133('0x26')](function(_0x1293f1){_0x26d351[_0x9133('0x3f')]=_0x1293f1;return _0x26d351;})[_0x9133('0x26')](respondWithFilteredResult(_0x3e2404,_0x45966d))[_0x9133('0x40')](handleError(_0x3e2404,null));};exports[_0x9133('0x41')]=function(_0x3b2287,_0x4ca1a3){var _0x7f6cd9={'raw':![],'where':{'id':_0x3b2287['params']['id']}},_0x5e0fde={};_0x5e0fde[_0x9133('0x2c')]=_[_0x9133('0x2d')](db[_0x9133('0x3c')][_0x9133('0x42')]);_0x5e0fde[_0x9133('0x2e')]=_[_0x9133('0x2d')](_0x3b2287[_0x9133('0x2e')]);_0x5e0fde[_0x9133('0x2f')]=_[_0x9133('0x43')](_0x5e0fde['model'],_0x5e0fde[_0x9133('0x2e')]);_0x7f6cd9[_0x9133('0x30')]=_[_0x9133('0x43')](_0x5e0fde['model'],qs['fields'](_0x3b2287[_0x9133('0x2e')][_0x9133('0x31')]));_0x7f6cd9['attributes']=_0x7f6cd9[_0x9133('0x30')][_0x9133('0x32')]?_0x7f6cd9[_0x9133('0x30')]:_0x5e0fde[_0x9133('0x2c')];if(_0x3b2287[_0x9133('0x2e')]['includeAll']){_0x7f6cd9[_0x9133('0x3e')]=[{'all':!![]}];}_0x7f6cd9=_[_0x9133('0x38')]({},_0x7f6cd9,_0x3b2287[_0x9133('0x3b')]);return db['ZendeskAccount'][_0x9133('0x44')](_0x7f6cd9)[_0x9133('0x26')](handleEntityNotFound(_0x4ca1a3,null))['then'](respondWithResult(_0x4ca1a3,null))['catch'](handleError(_0x4ca1a3,null));};exports[_0x9133('0x45')]=function(_0x2cd935,_0x4446fe){return db[_0x9133('0x3c')][_0x9133('0x45')](_0x2cd935[_0x9133('0x46')],{})[_0x9133('0x26')](respondWithResult(_0x4446fe,0xc9))[_0x9133('0x40')](handleError(_0x4446fe,null));};exports[_0x9133('0x25')]=function(_0xf07fbb,_0x3d6a49){if(_0xf07fbb[_0x9133('0x46')]['id']){delete _0xf07fbb['body']['id'];}return db['ZendeskAccount'][_0x9133('0x44')]({'where':{'id':_0xf07fbb['params']['id']}})[_0x9133('0x26')](handleEntityNotFound(_0x3d6a49,null))[_0x9133('0x26')](saveUpdates(_0xf07fbb[_0x9133('0x46')],null))[_0x9133('0x26')](respondWithResult(_0x3d6a49,null))['catch'](handleError(_0x3d6a49,null));};exports[_0x9133('0x47')]=function(_0x25750f,_0x799772){return db['ZendeskAccount'][_0x9133('0x44')]({'where':{'id':_0x25750f[_0x9133('0x48')]['id']}})[_0x9133('0x26')](handleEntityNotFound(_0x799772,null))['then'](removeEntity(_0x799772,null))[_0x9133('0x40')](handleError(_0x799772,null));};exports['getConfigurations']=function(_0x2342f4,_0x3c4b67,_0x304673){var _0x9fa963={};var _0x4f58fe={};var _0x4a346c;var _0x2f09f6;return db[_0x9133('0x3c')][_0x9133('0x49')]({'where':{'id':_0x2342f4[_0x9133('0x48')]['id']}})[_0x9133('0x26')](handleEntityNotFound(_0x3c4b67,null))['then'](function(_0x554bb9){if(_0x554bb9){_0x4a346c=_0x554bb9;_0x4f58fe[_0x9133('0x2c')]=_[_0x9133('0x2d')](db['ZendeskConfiguration'][_0x9133('0x42')]);_0x4f58fe[_0x9133('0x2e')]=_['keys'](_0x2342f4['query']);_0x4f58fe['filters']=_[_0x9133('0x43')](_0x4f58fe['model'],_0x4f58fe[_0x9133('0x2e')]);_0x9fa963[_0x9133('0x30')]=_[_0x9133('0x43')](_0x4f58fe[_0x9133('0x2c')],qs['fields'](_0x2342f4[_0x9133('0x2e')]['fields']));_0x9fa963[_0x9133('0x30')]=_0x9fa963[_0x9133('0x30')][_0x9133('0x32')]?_0x9fa963[_0x9133('0x30')]:_0x4f58fe[_0x9133('0x2c')];_0x9fa963[_0x9133('0x34')]=qs['sort'](_0x2342f4['query']['sort']);_0x9fa963[_0x9133('0x36')]=qs[_0x9133('0x2f')](_[_0x9133('0x4a')](_0x2342f4['query'],_0x4f58fe[_0x9133('0x2f')]));if(_0x2342f4[_0x9133('0x2e')][_0x9133('0x37')]){_0x9fa963[_0x9133('0x36')]=_[_0x9133('0x38')](_0x9fa963[_0x9133('0x36')],{'$or':_[_0x9133('0x29')](_0x9fa963[_0x9133('0x30')],function(_0x59bb26){var _0x464954={};_0x464954[_0x59bb26]={'$like':'%'+_0x2342f4['query'][_0x9133('0x37')]+'%'};return _0x464954;})});}_0x9fa963=_['merge']({},_0x9fa963,_0x2342f4[_0x9133('0x3b')]);return _0x4a346c[_0x9133('0x4b')](_0x9fa963);}})['then'](function(_0x540b02){if(_0x540b02){_0x2f09f6=_0x540b02[_0x9133('0x32')];if(!_0x2342f4[_0x9133('0x2e')][_0x9133('0x33')](_0x9133('0x4c'))){_0x9fa963[_0x9133('0x21')]=qs[_0x9133('0x21')](_0x2342f4[_0x9133('0x2e')][_0x9133('0x21')]);_0x9fa963[_0x9133('0x1f')]=qs[_0x9133('0x1f')](_0x2342f4[_0x9133('0x2e')]['offset']);}return _0x4a346c[_0x9133('0x4b')](_0x9fa963);}})['then'](function(_0x23d61f){if(_0x23d61f){return _0x23d61f?{'count':_0x2f09f6,'rows':_0x23d61f}:null;}})[_0x9133('0x26')](respondWithResult(_0x3c4b67,null))[_0x9133('0x40')](handleError(_0x3c4b67,null));};exports[_0x9133('0x4d')]=function(_0xd37001,_0x52d4c8,_0x35bc72){if(_0xd37001[_0x9133('0x46')]['id']){delete _0xd37001[_0x9133('0x46')]['id'];}return db[_0x9133('0x3c')]['findOne']({'where':{'id':_0xd37001[_0x9133('0x48')]['id']}})[_0x9133('0x26')](handleEntityNotFound(_0x52d4c8,null))[_0x9133('0x26')](function(_0x31e978){if(_0x31e978){_0xd37001['body']['AccountId']=_0x31e978['id'];_0xd37001[_0x9133('0x46')][_0x9133('0x4e')]=integrations[_0x9133('0x4f')](_0xd37001[_0x9133('0x46')][_0x9133('0x50')],_0xd37001[_0x9133('0x46')]['type']);_0xd37001[_0x9133('0x46')][_0x9133('0x51')]=integrations[_0x9133('0x52')](_0xd37001[_0x9133('0x46')]['channel'],_0xd37001[_0x9133('0x46')]['type']);return db[_0x9133('0x53')][_0x9133('0x45')](_0xd37001[_0x9133('0x46')],{'include':[{'model':db[_0x9133('0x54')],'as':_0x9133('0x4e')},{'model':db[_0x9133('0x54')],'as':_0x9133('0x51')}]});}return null;})[_0x9133('0x26')](respondWithResult(_0x52d4c8,null))['catch'](handleError(_0x52d4c8,null));};exports[_0x9133('0x55')]=function(_0x1fcd01,_0x10afd7,_0x152283){var _0x406861='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x1fcd01['params']['id']},'attributes':['id',_0x9133('0x56'),_0x9133('0x57'),_0x9133('0x58'),'authType',_0x9133('0x59')]})[_0x9133('0x26')](handleEntityNotFound(_0x10afd7,null))[_0x9133('0x26')](function(_0x3e660c){if(_0x3e660c){_0x406861=_0x3e660c[_0x9133('0x59')];var _0x4cab23=_0x406861[_0x9133('0x5a')](-0x1);if(_0x4cab23==='/'){_0x406861=_0x406861[_0x9133('0x5b')](0x0,_0x406861['lastIndexOf'](_0x4cab23));}var _0x41f924={'method':_0x9133('0x5c'),'uri':util['format'](_0x9133('0x5d'),_0x406861,'ticket_fields'),'json':!![]};switch(_0x3e660c[_0x9133('0x5e')]){case _0x9133('0x57'):_0x41f924[_0x9133('0x5f')]={'Authorization':util[_0x9133('0x60')](_0x9133('0x61'),new Buffer(util['format'](_0x9133('0x62'),_0x3e660c[_0x9133('0x56')],_0x3e660c[_0x9133('0x57')]))[_0x9133('0x63')]('base64'))};break;case _0x9133('0x58'):_0x41f924[_0x9133('0x5f')]={'Authorization':util[_0x9133('0x60')](_0x9133('0x61'),new Buffer(util[_0x9133('0x60')](_0x9133('0x64'),_0x3e660c[_0x9133('0x56')],_0x3e660c[_0x9133('0x58')]))[_0x9133('0x63')](_0x9133('0x65')))};break;default:throw new db[(_0x9133('0x66'))]['ValidationError'](_0x9133('0x67'));}return rp(_0x41f924);}})[_0x9133('0x26')](function(_0x242974){if(_0x242974){var _0x12ae5f=['subject',_0x9133('0x68'),'group',_0x9133('0x69')];_[_0x9133('0x6a')](_0x242974[_0x9133('0x6b')],function(_0x530984){return _0x12ae5f[_0x9133('0x6c')](_0x530984[_0x9133('0x39')]);});return{'count':_0x242974[_0x9133('0x6b')]['length'],'rows':_[_0x9133('0x29')](_0x242974[_0x9133('0x6b')],function(_0x5013f8){return{'id':_0x5013f8['id'],'name':_0x5013f8[_0x9133('0x6d')]>0x7?_0x5013f8[_0x9133('0x6e')]:_0x5013f8[_0x9133('0x39')],'custom':_0x5013f8['position']>0x7?!![]:![],'options':_0x5013f8[_0x9133('0x6f')]?_0x5013f8['system_field_options']:_0x5013f8[_0x9133('0x70')]?_0x5013f8[_0x9133('0x70')]:[]};})};}})[_0x9133('0x26')](respondWithResult(_0x10afd7,null))['catch'](function(_0x2bd590){var _0x54f9ad=_0x1fcd01[_0x9133('0x2e')][_0x9133('0x71')]?0x1f4:_0x2bd590[_0x9133('0x72')]||0x1f4;logger[_0x9133('0x73')](_0x9133('0x74'),_0x9133('0x55'),_0x54f9ad,JSON[_0x9133('0x75')](_0x2bd590));delete _0x2bd590[_0x9133('0x27')];if(_0x54f9ad===0x191){_0x54f9ad=0x190;}_0x10afd7['status'](_0x54f9ad)[_0x9133('0x28')](_0x1fcd01[_0x9133('0x2e')][_0x9133('0x71')]?{'message':_0x9133('0x76'),'statusCode':_0x2bd590[_0x9133('0x72')]}:_0x2bd590);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 477eba0..1a687f0 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 _0xc7a4=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','ZendeskAccount'];(function(_0x33fc69,_0xbf2efb){var _0x28f592=function(_0x20178f){while(--_0x20178f){_0x33fc69['push'](_0x33fc69['shift']());}};_0x28f592(++_0xbf2efb);}(_0xc7a4,0x1e6));var _0x4c7a=function(_0x36d9ac,_0x314606){_0x36d9ac=_0x36d9ac-0x0;var _0x281977=_0xc7a4[_0x36d9ac];return _0x281977;};'use strict';var _=require(_0x4c7a('0x0'));var util=require('util');var logger=require(_0x4c7a('0x1'))(_0x4c7a('0x2'));var moment=require(_0x4c7a('0x3'));var BPromise=require('bluebird');var rp=require(_0x4c7a('0x4'));var fs=require('fs');var path=require(_0x4c7a('0x5'));var rimraf=require(_0x4c7a('0x6'));var config=require(_0x4c7a('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x214f4b,_0x49b6d4){return _0x214f4b['define'](_0x4c7a('0x8'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0ed=['define','int_zendesk_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0xe0ed,0x84));var _0xde0e=function(_0x5480ea,_0x516bb3){_0x5480ea=_0x5480ea-0x0;var _0x5e1d51=_0xe0ed[_0x5480ea];return _0x5e1d51;};'use strict';var _=require(_0xde0e('0x0'));var util=require(_0xde0e('0x1'));var logger=require('../../config/logger')(_0xde0e('0x2'));var moment=require(_0xde0e('0x3'));var BPromise=require(_0xde0e('0x4'));var rp=require(_0xde0e('0x5'));var fs=require('fs');var path=require(_0xde0e('0x6'));var rimraf=require(_0xde0e('0x7'));var config=require(_0xde0e('0x8'));var attributes=require(_0xde0e('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xde0e('0xa')]=function(_0x20c144,_0x192469){return _0x20c144[_0xde0e('0xb')]('ZendeskAccount',attributes,{'tableName':_0xde0e('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 b3c4bcc..1c44900 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 _0x6c2c=['raw','where','attributes','limit','include','map','model','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options'];(function(_0x4861fe,_0x3fd44d){var _0x1f281a=function(_0x59ad56){while(--_0x59ad56){_0x4861fe['push'](_0x4861fe['shift']());}};_0x1f281a(++_0x3fd44d);}(_0x6c2c,0x7b));var _0xc6c2=function(_0x8f9a6d,_0xb23758){_0x8f9a6d=_0x8f9a6d-0x0;var _0x2c1e8f=_0x6c2c[_0x8f9a6d];return _0x2c1e8f;};'use strict';var _=require(_0xc6c2('0x0'));var util=require(_0xc6c2('0x1'));var moment=require(_0xc6c2('0x2'));var BPromise=require(_0xc6c2('0x3'));var rs=require(_0xc6c2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6c2('0x5'))['db'];var utils=require(_0xc6c2('0x6'));var logger=require(_0xc6c2('0x7'))(_0xc6c2('0x8'));var config=require(_0xc6c2('0x9'));var jayson=require(_0xc6c2('0xa'));var client=jayson['client'][_0xc6c2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d617b,_0x4756c1,_0x31b55b){return new BPromise(function(_0x2f37b1,_0x4fb4f1){return client[_0xc6c2('0xc')](_0x4d617b,_0x31b55b)[_0xc6c2('0xd')](function(_0x5bb403){logger[_0xc6c2('0xe')](_0xc6c2('0xf'),_0x4756c1,'request\x20sent');logger[_0xc6c2('0x10')](_0xc6c2('0x11'),_0x4756c1,_0xc6c2('0x12'),JSON[_0xc6c2('0x13')](_0x5bb403));if(_0x5bb403[_0xc6c2('0x14')]){if(_0x5bb403[_0xc6c2('0x14')][_0xc6c2('0x15')]===0x1f4){logger[_0xc6c2('0x14')](_0xc6c2('0xf'),_0x4756c1,_0x5bb403['error']['message']);return _0x4fb4f1(_0x5bb403[_0xc6c2('0x14')]['message']);}logger[_0xc6c2('0x14')](_0xc6c2('0xf'),_0x4756c1,_0x5bb403[_0xc6c2('0x14')][_0xc6c2('0x16')]);return _0x2f37b1(_0x5bb403[_0xc6c2('0x14')]['message']);}else{logger[_0xc6c2('0xe')](_0xc6c2('0xf'),_0x4756c1,_0xc6c2('0x12'));_0x2f37b1(_0x5bb403[_0xc6c2('0x17')][_0xc6c2('0x16')]);}})[_0xc6c2('0x18')](function(_0x308e0b){logger[_0xc6c2('0x14')](_0xc6c2('0xf'),_0x4756c1,_0x308e0b);_0x4fb4f1(_0x308e0b);});});}exports[_0xc6c2('0x19')]=function(_0x37fc05){var _0x3ff8d3=this;return new Promise(function(_0x446955,_0x8bd1f4){return db[_0xc6c2('0x1a')][_0xc6c2('0x1b')]({'raw':_0x37fc05['options']?_0x37fc05[_0xc6c2('0x1c')][_0xc6c2('0x1d')]===undefined?!![]:![]:!![],'where':_0x37fc05['options']?_0x37fc05[_0xc6c2('0x1c')][_0xc6c2('0x1e')]||null:null,'attributes':_0x37fc05[_0xc6c2('0x1c')]?_0x37fc05[_0xc6c2('0x1c')][_0xc6c2('0x1f')]||null:null,'limit':_0x37fc05[_0xc6c2('0x1c')]?_0x37fc05[_0xc6c2('0x1c')][_0xc6c2('0x20')]||null:null,'include':_0x37fc05[_0xc6c2('0x1c')]?_0x37fc05[_0xc6c2('0x1c')][_0xc6c2('0x21')]?_[_0xc6c2('0x22')](_0x37fc05[_0xc6c2('0x1c')][_0xc6c2('0x21')],function(_0x3849a9){return{'model':db[_0x3849a9[_0xc6c2('0x23')]],'as':_0x3849a9['as'],'attributes':_0x3849a9[_0xc6c2('0x1f')],'include':_0x3849a9[_0xc6c2('0x21')]?_[_0xc6c2('0x22')](_0x3849a9[_0xc6c2('0x21')],function(_0x56e2ab){return{'model':db[_0x56e2ab[_0xc6c2('0x23')]],'as':_0x56e2ab['as'],'attributes':_0x56e2ab[_0xc6c2('0x1f')],'include':_0x56e2ab['include']?_['map'](_0x56e2ab['include'],function(_0x3b1ddb){return{'model':db[_0x3b1ddb[_0xc6c2('0x23')]],'as':_0x3b1ddb['as'],'attributes':_0x3b1ddb[_0xc6c2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc6c2('0xd')](function(_0x2a3851){logger[_0xc6c2('0xe')]('GetZendeskAccount',_0x37fc05);logger[_0xc6c2('0x10')](_0xc6c2('0x19'),_0x37fc05,JSON[_0xc6c2('0x13')](_0x2a3851));_0x446955(_0x2a3851);})[_0xc6c2('0x18')](function(_0x3ebf8c){logger[_0xc6c2('0x14')](_0xc6c2('0x19'),_0x3ebf8c[_0xc6c2('0x16')],_0x37fc05);_0x8bd1f4(_0x3ff8d3[_0xc6c2('0x14')](0x1f4,_0x3ebf8c[_0xc6c2('0x16')]));});});};exports[_0xc6c2('0x24')]=function(_0x76e277){var _0x5d377f=this;return new Promise(function(_0x504e30,_0x712df1){return db[_0xc6c2('0x1a')][_0xc6c2('0x25')]({'raw':_0x76e277['options']?_0x76e277[_0xc6c2('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x76e277[_0xc6c2('0x1c')]?_0x76e277[_0xc6c2('0x1c')][_0xc6c2('0x1e')]||null:null,'attributes':_0x76e277[_0xc6c2('0x1c')]?_0x76e277[_0xc6c2('0x1c')][_0xc6c2('0x1f')]||null:null,'include':_0x76e277[_0xc6c2('0x1c')]?_0x76e277[_0xc6c2('0x1c')][_0xc6c2('0x21')]?_[_0xc6c2('0x22')](_0x76e277[_0xc6c2('0x1c')][_0xc6c2('0x21')],function(_0x3e1e6d){return{'model':db[_0x3e1e6d['model']],'as':_0x3e1e6d['as'],'attributes':_0x3e1e6d['attributes'],'include':_0x3e1e6d[_0xc6c2('0x21')]?_[_0xc6c2('0x22')](_0x3e1e6d['include'],function(_0x52bcc5){return{'model':db[_0x52bcc5[_0xc6c2('0x23')]],'as':_0x52bcc5['as'],'attributes':_0x52bcc5[_0xc6c2('0x1f')],'include':_0x52bcc5[_0xc6c2('0x21')]?_[_0xc6c2('0x22')](_0x52bcc5[_0xc6c2('0x21')],function(_0x355da3){return{'model':db[_0x355da3['model']],'as':_0x355da3['as'],'attributes':_0x355da3[_0xc6c2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc6c2('0xd')](function(_0x3c6be5){logger['info'](_0xc6c2('0x24'),_0x76e277);logger[_0xc6c2('0x10')]('ShowZendeskAccount',_0x76e277,JSON['stringify'](_0x3c6be5));_0x504e30(_0x3c6be5);})[_0xc6c2('0x18')](function(_0x13e793){logger[_0xc6c2('0x14')](_0xc6c2('0x24'),_0x13e793[_0xc6c2('0x16')],_0x76e277);_0x712df1(_0x5d377f[_0xc6c2('0x14')](0x1f4,_0x13e793['message']));});});}; \ No newline at end of file +var _0x1fd9=['message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','map','include','model','debug','find','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5d9cb4,_0x5e1444){var _0x404433=function(_0x5dd4b0){while(--_0x5dd4b0){_0x5d9cb4['push'](_0x5d9cb4['shift']());}};_0x404433(++_0x5e1444);}(_0x1fd9,0x19b));var _0x91fd=function(_0x4d1aed,_0x345f65){_0x4d1aed=_0x4d1aed-0x0;var _0x5eb409=_0x1fd9[_0x4d1aed];return _0x5eb409;};'use strict';var _=require(_0x91fd('0x0'));var util=require(_0x91fd('0x1'));var moment=require(_0x91fd('0x2'));var BPromise=require(_0x91fd('0x3'));var rs=require(_0x91fd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x91fd('0x5'));var logger=require(_0x91fd('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x91fd('0x7'));var client=jayson[_0x91fd('0x8')][_0x91fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe0364f,_0x417f6f,_0x38287c){return new BPromise(function(_0x5cc952,_0x342c18){return client['request'](_0xe0364f,_0x38287c)[_0x91fd('0xa')](function(_0x43b2f5){logger[_0x91fd('0xb')](_0x91fd('0xc'),_0x417f6f,'request\x20sent');logger['debug'](_0x91fd('0xd'),_0x417f6f,_0x91fd('0xe'),JSON[_0x91fd('0xf')](_0x43b2f5));if(_0x43b2f5[_0x91fd('0x10')]){if(_0x43b2f5['error'][_0x91fd('0x11')]===0x1f4){logger[_0x91fd('0x10')](_0x91fd('0xc'),_0x417f6f,_0x43b2f5[_0x91fd('0x10')][_0x91fd('0x12')]);return _0x342c18(_0x43b2f5[_0x91fd('0x10')][_0x91fd('0x12')]);}logger['error'](_0x91fd('0xc'),_0x417f6f,_0x43b2f5[_0x91fd('0x10')]['message']);return _0x5cc952(_0x43b2f5[_0x91fd('0x10')]['message']);}else{logger['info'](_0x91fd('0xc'),_0x417f6f,'request\x20sent');_0x5cc952(_0x43b2f5[_0x91fd('0x13')][_0x91fd('0x12')]);}})[_0x91fd('0x14')](function(_0x2446da){logger['error'](_0x91fd('0xc'),_0x417f6f,_0x2446da);_0x342c18(_0x2446da);});});}exports[_0x91fd('0x15')]=function(_0x1892e6){var _0x2a3987=this;return new Promise(function(_0x5aa94e,_0x55fd8c){return db[_0x91fd('0x16')][_0x91fd('0x17')]({'raw':_0x1892e6['options']?_0x1892e6[_0x91fd('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1892e6['options']?_0x1892e6[_0x91fd('0x18')][_0x91fd('0x19')]||null:null,'attributes':_0x1892e6[_0x91fd('0x18')]?_0x1892e6[_0x91fd('0x18')][_0x91fd('0x1a')]||null:null,'limit':_0x1892e6[_0x91fd('0x18')]?_0x1892e6['options']['limit']||null:null,'include':_0x1892e6[_0x91fd('0x18')]?_0x1892e6[_0x91fd('0x18')]['include']?_[_0x91fd('0x1b')](_0x1892e6[_0x91fd('0x18')][_0x91fd('0x1c')],function(_0x4d9f80){return{'model':db[_0x4d9f80['model']],'as':_0x4d9f80['as'],'attributes':_0x4d9f80[_0x91fd('0x1a')],'include':_0x4d9f80['include']?_['map'](_0x4d9f80[_0x91fd('0x1c')],function(_0x18cd99){return{'model':db[_0x18cd99['model']],'as':_0x18cd99['as'],'attributes':_0x18cd99[_0x91fd('0x1a')],'include':_0x18cd99[_0x91fd('0x1c')]?_['map'](_0x18cd99['include'],function(_0x583179){return{'model':db[_0x583179[_0x91fd('0x1d')]],'as':_0x583179['as'],'attributes':_0x583179[_0x91fd('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x91fd('0xa')](function(_0x5bbc07){logger['info'](_0x91fd('0x15'),_0x1892e6);logger[_0x91fd('0x1e')](_0x91fd('0x15'),_0x1892e6,JSON[_0x91fd('0xf')](_0x5bbc07));_0x5aa94e(_0x5bbc07);})[_0x91fd('0x14')](function(_0xdd1249){logger['error'](_0x91fd('0x15'),_0xdd1249['message'],_0x1892e6);_0x55fd8c(_0x2a3987[_0x91fd('0x10')](0x1f4,_0xdd1249[_0x91fd('0x12')]));});});};exports['ShowZendeskAccount']=function(_0x23b083){var _0x239485=this;return new Promise(function(_0x584298,_0x358260){return db['ZendeskAccount'][_0x91fd('0x1f')]({'raw':_0x23b083[_0x91fd('0x18')]?_0x23b083[_0x91fd('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x23b083[_0x91fd('0x18')]?_0x23b083[_0x91fd('0x18')][_0x91fd('0x19')]||null:null,'attributes':_0x23b083[_0x91fd('0x18')]?_0x23b083[_0x91fd('0x18')]['attributes']||null:null,'include':_0x23b083[_0x91fd('0x18')]?_0x23b083['options'][_0x91fd('0x1c')]?_[_0x91fd('0x1b')](_0x23b083[_0x91fd('0x18')][_0x91fd('0x1c')],function(_0x5c4f91){return{'model':db[_0x5c4f91[_0x91fd('0x1d')]],'as':_0x5c4f91['as'],'attributes':_0x5c4f91['attributes'],'include':_0x5c4f91[_0x91fd('0x1c')]?_[_0x91fd('0x1b')](_0x5c4f91[_0x91fd('0x1c')],function(_0xaceaa3){return{'model':db[_0xaceaa3[_0x91fd('0x1d')]],'as':_0xaceaa3['as'],'attributes':_0xaceaa3[_0x91fd('0x1a')],'include':_0xaceaa3[_0x91fd('0x1c')]?_['map'](_0xaceaa3[_0x91fd('0x1c')],function(_0x58227c){return{'model':db[_0x58227c[_0x91fd('0x1d')]],'as':_0x58227c['as'],'attributes':_0x58227c['attributes']};}):[]};}):[]};}):[]:[]})[_0x91fd('0xa')](function(_0x1c75f1){logger['info'](_0x91fd('0x20'),_0x23b083);logger[_0x91fd('0x1e')](_0x91fd('0x20'),_0x23b083,JSON['stringify'](_0x1c75f1));_0x584298(_0x1c75f1);})[_0x91fd('0x14')](function(_0x2c87c7){logger[_0x91fd('0x10')]('ShowZendeskAccount',_0x2c87c7[_0x91fd('0x12')],_0x23b083);_0x358260(_0x239485['error'](0x1f4,_0x2c87c7[_0x91fd('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 6960575..dea3a10 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 _0xb10b=['getFields','/:id/subjects','/:id/descriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields'];(function(_0x3d0e4a,_0x29ba12){var _0x4a7b7f=function(_0x50fd96){while(--_0x50fd96){_0x3d0e4a['push'](_0x3d0e4a['shift']());}};_0x4a7b7f(++_0x29ba12);}(_0xb10b,0x12a));var _0xbb10=function(_0x556634,_0x520958){_0x556634=_0x556634-0x0;var _0x4429fd=_0xb10b[_0x556634];return _0x4429fd;};'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['getSubjects']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getDescriptions']);router[_0xbb10('0x9')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x12')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router[_0xbb10('0x12')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x15')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x18')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x19')]);module['exports']=router; \ No newline at end of file +var _0x5c00=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','/:id/tags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x255dea,_0x5832dd){var _0x5e48c4=function(_0x103199){while(--_0x103199){_0x255dea['push'](_0x255dea['shift']());}};_0x5e48c4(++_0x5832dd);}(_0x5c00,0x17e));var _0x05c0=function(_0x5089ea,_0x3d8378){_0x5089ea=_0x5089ea-0x0;var _0xabe953=_0x5c00[_0x5089ea];return _0xabe953;};'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('./intZendeskConfiguration.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id/fields',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/descriptions',auth[_0x05c0('0x9')](),controller['getDescriptions']);router[_0x05c0('0x8')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller['getTags']);router[_0x05c0('0x10')]('/',auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0x10')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x12')]);router[_0x05c0('0x13')](_0x05c0('0x14'),auth[_0x05c0('0x9')](),controller['update']);router[_0x05c0('0x15')](_0x05c0('0x14'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x16')]);module[_0x05c0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 0809825..b3aaff3 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 _0x5aab=['sequelize','exports','STRING'];(function(_0x514a3c,_0xdb3498){var _0x5aeff2=function(_0x5ca8e6){while(--_0x5ca8e6){_0x514a3c['push'](_0x514a3c['shift']());}};_0x5aeff2(++_0xdb3498);}(_0x5aab,0x7e));var _0xb5aa=function(_0x570d8f,_0x2b773c){_0x570d8f=_0x570d8f-0x0;var _0x4bad82=_0x5aab[_0x570d8f];return _0x4bad82;};'use strict';var Sequelize=require(_0xb5aa('0x0'));module[_0xb5aa('0x1')]={'name':{'type':Sequelize[_0xb5aa('0x2')]},'description':{'type':Sequelize[_0xb5aa('0x2')]}}; \ No newline at end of file +var _0x69e8=['exports','sequelize'];(function(_0x56b0b0,_0x28eecd){var _0x392e29=function(_0x99c496){while(--_0x99c496){_0x56b0b0['push'](_0x56b0b0['shift']());}};_0x392e29(++_0x28eecd);}(_0x69e8,0x139));var _0x869e=function(_0x5e3f0a,_0x539b4d){_0x5e3f0a=_0x5e3f0a-0x0;var _0x2b5920=_0x69e8[_0x5e3f0a];return _0x2b5920;};'use strict';var Sequelize=require(_0x869e('0x0'));module[_0x869e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index a98eaf8..b987baa 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 _0x7922=['offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','keys','include','find','create','body','getFields','ZendeskField','pick','getSubjects','findOne','getDescriptions','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x36f79c,_0x41e72e){var _0x4978a6=function(_0x50b4dd){while(--_0x50b4dd){_0x36f79c['push'](_0x36f79c['shift']());}};_0x4978a6(++_0x41e72e);}(_0x7922,0xe4));var _0x2792=function(_0x18ab80,_0x550bd0){_0x18ab80=_0x18ab80-0x0;var _0x4069ca=_0x7922[_0x18ab80];return _0x4069ca;};'use strict';var emlformat=require(_0x2792('0x0'));var rimraf=require(_0x2792('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2792('0x2'));var rp=require(_0x2792('0x3'));var moment=require(_0x2792('0x4'));var BPromise=require(_0x2792('0x5'));var Mustache=require('mustache');var util=require(_0x2792('0x6'));var path=require(_0x2792('0x7'));var sox=require(_0x2792('0x8'));var csv=require(_0x2792('0x9'));var ejs=require(_0x2792('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2792('0xb'));var squel=require(_0x2792('0xc'));var crypto=require(_0x2792('0xd'));var jsforce=require(_0x2792('0xe'));var deskjs=require(_0x2792('0xf'));var toCsv=require(_0x2792('0x9'));var querystring=require(_0x2792('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2792('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2792('0x12'));var hardwareService=require(_0x2792('0x13'));var logger=require(_0x2792('0x14'))(_0x2792('0x15'));var utils=require(_0x2792('0x16'));var config=require(_0x2792('0x17'));var licenseUtil=require(_0x2792('0x18'));var db=require(_0x2792('0x19'))['db'];function respondWithStatusCode(_0x326d54,_0x281781){_0x281781=_0x281781||0xcc;return function(_0xf97437){if(_0xf97437){return _0x326d54[_0x2792('0x1a')](_0x281781);}return _0x326d54[_0x2792('0x1b')](_0x281781)[_0x2792('0x1c')]();};}function respondWithResult(_0x1f5f38,_0xc38b8d){_0xc38b8d=_0xc38b8d||0xc8;return function(_0x1c3e13){if(_0x1c3e13){return _0x1f5f38['status'](_0xc38b8d)[_0x2792('0x1d')](_0x1c3e13);}};}function respondWithFilteredResult(_0x1507b9,_0x11ca3b){return function(_0x5c37ab){if(_0x5c37ab){var _0x5bd6b1=typeof _0x11ca3b[_0x2792('0x1e')]===_0x2792('0x1f')&&typeof _0x11ca3b[_0x2792('0x20')]===_0x2792('0x1f');var _0x40fb9b=_0x5c37ab[_0x2792('0x21')];var _0x43f67a=_0x5bd6b1?0x0:_0x11ca3b[_0x2792('0x1e')];var _0x48314d=_0x5bd6b1?_0x5c37ab[_0x2792('0x21')]:_0x11ca3b[_0x2792('0x1e')]+_0x11ca3b[_0x2792('0x20')];var _0x4ad48c;if(_0x48314d>=_0x40fb9b){_0x48314d=_0x40fb9b;_0x4ad48c=0xc8;}else{_0x4ad48c=0xce;}_0x1507b9[_0x2792('0x1b')](_0x4ad48c);return _0x1507b9[_0x2792('0x22')](_0x2792('0x23'),_0x43f67a+'-'+_0x48314d+'/'+_0x40fb9b)[_0x2792('0x1d')](_0x5c37ab);}return null;};}function patchUpdates(_0x1fe9d8){return function(_0x1551e5){try{jsonpatch[_0x2792('0x24')](_0x1551e5,_0x1fe9d8,!![]);}catch(_0x507e0e){return BPromise['reject'](_0x507e0e);}return _0x1551e5[_0x2792('0x25')]();};}function saveUpdates(_0x462b12,_0x5a2b43){return function(_0x2afb6a){if(_0x2afb6a){return _0x2afb6a[_0x2792('0x26')](_0x462b12)[_0x2792('0x27')](function(_0x51e337){return _0x51e337;});}return null;};}function removeEntity(_0x14fad2,_0x207e6e){return function(_0x2c0390){if(_0x2c0390){return _0x2c0390[_0x2792('0x28')]()['then'](function(){_0x14fad2[_0x2792('0x1b')](0xcc)[_0x2792('0x1c')]();});}};}function handleEntityNotFound(_0x1fcba5,_0x48bf3f){return function(_0x526548){if(!_0x526548){_0x1fcba5['sendStatus'](0x194);}return _0x526548;};}function handleError(_0x3aaa91,_0x1a73a3){_0x1a73a3=_0x1a73a3||0x1f4;return function(_0x36a98e){logger[_0x2792('0x29')](_0x36a98e[_0x2792('0x2a')]);if(_0x36a98e['name']){delete _0x36a98e[_0x2792('0x2b')];}_0x3aaa91[_0x2792('0x1b')](_0x1a73a3)['send'](_0x36a98e);};}exports[_0x2792('0x2c')]=function(_0x31c940,_0x129121){var _0x5d610e={},_0x30a59e={},_0x411892={'count':0x0,'rows':[]};var _0x40d263=_['map'](db[_0x2792('0x2d')][_0x2792('0x2e')],function(_0x3cc652){return{'name':_0x3cc652[_0x2792('0x2f')],'type':_0x3cc652[_0x2792('0x30')][_0x2792('0x31')]};});_0x30a59e[_0x2792('0x32')]=_[_0x2792('0x33')](_0x40d263,_0x2792('0x2b'));_0x30a59e[_0x2792('0x34')]=_['keys'](_0x31c940[_0x2792('0x34')]);_0x30a59e[_0x2792('0x35')]=_[_0x2792('0x36')](_0x30a59e['model'],_0x30a59e[_0x2792('0x34')]);_0x5d610e[_0x2792('0x37')]=_[_0x2792('0x36')](_0x30a59e[_0x2792('0x32')],qs[_0x2792('0x38')](_0x31c940[_0x2792('0x34')][_0x2792('0x38')]));_0x5d610e[_0x2792('0x37')]=_0x5d610e[_0x2792('0x37')][_0x2792('0x39')]?_0x5d610e[_0x2792('0x37')]:_0x30a59e[_0x2792('0x32')];if(!_0x31c940[_0x2792('0x34')][_0x2792('0x3a')](_0x2792('0x3b'))){_0x5d610e['limit']=qs[_0x2792('0x20')](_0x31c940[_0x2792('0x34')][_0x2792('0x20')]);_0x5d610e['offset']=qs[_0x2792('0x1e')](_0x31c940[_0x2792('0x34')][_0x2792('0x1e')]);}_0x5d610e[_0x2792('0x3c')]=qs[_0x2792('0x3d')](_0x31c940[_0x2792('0x34')][_0x2792('0x3d')]);_0x5d610e[_0x2792('0x3e')]=qs[_0x2792('0x35')](_['pick'](_0x31c940[_0x2792('0x34')],_0x30a59e[_0x2792('0x35')]),_0x40d263);if(_0x31c940[_0x2792('0x34')]['filter']){_0x5d610e[_0x2792('0x3e')]=_[_0x2792('0x3f')](_0x5d610e[_0x2792('0x3e')],{'$or':_['map'](_0x40d263,function(_0x192c23){if(_0x192c23[_0x2792('0x30')]!==_0x2792('0x40')){var _0x1bf8a3={};_0x1bf8a3[_0x192c23[_0x2792('0x2b')]]={'$like':'%'+_0x31c940[_0x2792('0x34')][_0x2792('0x41')]+'%'};return _0x1bf8a3;}})});}_0x5d610e=_[_0x2792('0x3f')]({},_0x5d610e,_0x31c940[_0x2792('0x42')]);var _0x23b43f={'where':_0x5d610e[_0x2792('0x3e')]};return db['ZendeskConfiguration'][_0x2792('0x21')](_0x23b43f)['then'](function(_0x3de777){_0x411892[_0x2792('0x21')]=_0x3de777;if(_0x31c940[_0x2792('0x34')]['includeAll']){_0x5d610e['include']=[{'all':!![]}];}return db[_0x2792('0x2d')][_0x2792('0x43')](_0x5d610e);})[_0x2792('0x27')](function(_0x3eca95){_0x411892[_0x2792('0x44')]=_0x3eca95;return _0x411892;})['then'](respondWithFilteredResult(_0x129121,_0x5d610e))[_0x2792('0x45')](handleError(_0x129121,null));};exports[_0x2792('0x46')]=function(_0x416fbd,_0x3263f5){var _0x4b16b6={'raw':![],'where':{'id':_0x416fbd[_0x2792('0x47')]['id']}},_0x2ce269={};_0x2ce269[_0x2792('0x32')]=_[_0x2792('0x48')](db[_0x2792('0x2d')][_0x2792('0x2e')]);_0x2ce269[_0x2792('0x34')]=_[_0x2792('0x48')](_0x416fbd['query']);_0x2ce269[_0x2792('0x35')]=_[_0x2792('0x36')](_0x2ce269[_0x2792('0x32')],_0x2ce269[_0x2792('0x34')]);_0x4b16b6[_0x2792('0x37')]=_[_0x2792('0x36')](_0x2ce269['model'],qs[_0x2792('0x38')](_0x416fbd[_0x2792('0x34')][_0x2792('0x38')]));_0x4b16b6[_0x2792('0x37')]=_0x4b16b6[_0x2792('0x37')]['length']?_0x4b16b6['attributes']:_0x2ce269[_0x2792('0x32')];if(_0x416fbd[_0x2792('0x34')]['includeAll']){_0x4b16b6[_0x2792('0x49')]=[{'all':!![]}];}_0x4b16b6=_[_0x2792('0x3f')]({},_0x4b16b6,_0x416fbd[_0x2792('0x42')]);return db[_0x2792('0x2d')][_0x2792('0x4a')](_0x4b16b6)[_0x2792('0x27')](handleEntityNotFound(_0x3263f5,null))[_0x2792('0x27')](respondWithResult(_0x3263f5,null))[_0x2792('0x45')](handleError(_0x3263f5,null));};exports[_0x2792('0x4b')]=function(_0x2cdb83,_0x28337c){return db[_0x2792('0x2d')][_0x2792('0x4b')](_0x2cdb83[_0x2792('0x4c')],{})['then'](respondWithResult(_0x28337c,0xc9))[_0x2792('0x45')](handleError(_0x28337c,null));};exports[_0x2792('0x26')]=function(_0x269fff,_0x2ba8b2){if(_0x269fff[_0x2792('0x4c')]['id']){delete _0x269fff[_0x2792('0x4c')]['id'];}return db['ZendeskConfiguration'][_0x2792('0x4a')]({'where':{'id':_0x269fff[_0x2792('0x47')]['id']}})[_0x2792('0x27')](handleEntityNotFound(_0x2ba8b2,null))[_0x2792('0x27')](saveUpdates(_0x269fff[_0x2792('0x4c')],null))['then'](respondWithResult(_0x2ba8b2,null))[_0x2792('0x45')](handleError(_0x2ba8b2,null));};exports['destroy']=function(_0x6ef094,_0x1b3385){return db[_0x2792('0x2d')][_0x2792('0x4a')]({'where':{'id':_0x6ef094[_0x2792('0x47')]['id']}})[_0x2792('0x27')](handleEntityNotFound(_0x1b3385,null))[_0x2792('0x27')](removeEntity(_0x1b3385,null))[_0x2792('0x45')](handleError(_0x1b3385,null));};exports[_0x2792('0x4d')]=function(_0x1b69a4,_0x1c0075,_0x4eef48){var _0x4b239e={};var _0x5121f2={};var _0x2a5819;var _0x4eb5df;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x1b69a4[_0x2792('0x47')]['id']}})[_0x2792('0x27')](handleEntityNotFound(_0x1c0075,null))['then'](function(_0xcdbd7a){if(_0xcdbd7a){_0x2a5819=_0xcdbd7a;_0x5121f2['model']=_[_0x2792('0x48')](db[_0x2792('0x4e')][_0x2792('0x2e')]);_0x5121f2[_0x2792('0x34')]=_[_0x2792('0x48')](_0x1b69a4[_0x2792('0x34')]);_0x5121f2[_0x2792('0x35')]=_['intersection'](_0x5121f2[_0x2792('0x32')],_0x5121f2['query']);_0x4b239e[_0x2792('0x37')]=_[_0x2792('0x36')](_0x5121f2[_0x2792('0x32')],qs[_0x2792('0x38')](_0x1b69a4[_0x2792('0x34')][_0x2792('0x38')]));_0x4b239e[_0x2792('0x37')]=_0x4b239e[_0x2792('0x37')]['length']?_0x4b239e['attributes']:_0x5121f2['model'];_0x4b239e[_0x2792('0x3c')]=qs[_0x2792('0x3d')](_0x1b69a4[_0x2792('0x34')][_0x2792('0x3d')]);_0x4b239e['where']=qs['filters'](_[_0x2792('0x4f')](_0x1b69a4[_0x2792('0x34')],_0x5121f2[_0x2792('0x35')]));if(_0x1b69a4[_0x2792('0x34')]['filter']){_0x4b239e[_0x2792('0x3e')]=_[_0x2792('0x3f')](_0x4b239e[_0x2792('0x3e')],{'$or':_[_0x2792('0x33')](_0x4b239e[_0x2792('0x37')],function(_0x547cb6){var _0x37f558={};_0x37f558[_0x547cb6]={'$like':'%'+_0x1b69a4[_0x2792('0x34')][_0x2792('0x41')]+'%'};return _0x37f558;})});}_0x4b239e=_[_0x2792('0x3f')]({},_0x4b239e,_0x1b69a4[_0x2792('0x42')]);return _0x2a5819['getFields'](_0x4b239e);}})['then'](function(_0x6d2669){if(_0x6d2669){_0x4eb5df=_0x6d2669[_0x2792('0x39')];if(!_0x1b69a4[_0x2792('0x34')]['hasOwnProperty'](_0x2792('0x3b'))){_0x4b239e[_0x2792('0x20')]=qs[_0x2792('0x20')](_0x1b69a4['query']['limit']);_0x4b239e[_0x2792('0x1e')]=qs[_0x2792('0x1e')](_0x1b69a4['query'][_0x2792('0x1e')]);}return _0x2a5819[_0x2792('0x4d')](_0x4b239e);}})[_0x2792('0x27')](function(_0x43654b){if(_0x43654b){return _0x43654b?{'count':_0x4eb5df,'rows':_0x43654b}:null;}})[_0x2792('0x27')](respondWithResult(_0x1c0075,null))[_0x2792('0x45')](handleError(_0x1c0075,null));};exports[_0x2792('0x50')]=function(_0x2f97fa,_0x320383,_0x4e7e3a){var _0x26d350={};var _0xe7a396={};var _0x119333;var _0x44260a;return db[_0x2792('0x2d')][_0x2792('0x51')]({'where':{'id':_0x2f97fa['params']['id']}})[_0x2792('0x27')](handleEntityNotFound(_0x320383,null))[_0x2792('0x27')](function(_0x450104){if(_0x450104){_0x119333=_0x450104;_0xe7a396[_0x2792('0x32')]=_[_0x2792('0x48')](db[_0x2792('0x4e')][_0x2792('0x2e')]);_0xe7a396[_0x2792('0x34')]=_[_0x2792('0x48')](_0x2f97fa[_0x2792('0x34')]);_0xe7a396[_0x2792('0x35')]=_[_0x2792('0x36')](_0xe7a396[_0x2792('0x32')],_0xe7a396['query']);_0x26d350[_0x2792('0x37')]=_[_0x2792('0x36')](_0xe7a396[_0x2792('0x32')],qs[_0x2792('0x38')](_0x2f97fa['query'][_0x2792('0x38')]));_0x26d350['attributes']=_0x26d350['attributes']['length']?_0x26d350['attributes']:_0xe7a396[_0x2792('0x32')];_0x26d350[_0x2792('0x3c')]=qs[_0x2792('0x3d')](_0x2f97fa[_0x2792('0x34')][_0x2792('0x3d')]);_0x26d350[_0x2792('0x3e')]=qs[_0x2792('0x35')](_[_0x2792('0x4f')](_0x2f97fa[_0x2792('0x34')],_0xe7a396[_0x2792('0x35')]));if(_0x2f97fa[_0x2792('0x34')][_0x2792('0x41')]){_0x26d350[_0x2792('0x3e')]=_['merge'](_0x26d350[_0x2792('0x3e')],{'$or':_[_0x2792('0x33')](_0x26d350[_0x2792('0x37')],function(_0x30101b){var _0x129229={};_0x129229[_0x30101b]={'$like':'%'+_0x2f97fa[_0x2792('0x34')][_0x2792('0x41')]+'%'};return _0x129229;})});}_0x26d350=_[_0x2792('0x3f')]({},_0x26d350,_0x2f97fa[_0x2792('0x42')]);return _0x119333[_0x2792('0x50')](_0x26d350);}})[_0x2792('0x27')](function(_0x2271d1){if(_0x2271d1){_0x44260a=_0x2271d1[_0x2792('0x39')];if(!_0x2f97fa[_0x2792('0x34')][_0x2792('0x3a')]('nolimit')){_0x26d350[_0x2792('0x20')]=qs['limit'](_0x2f97fa[_0x2792('0x34')]['limit']);_0x26d350[_0x2792('0x1e')]=qs[_0x2792('0x1e')](_0x2f97fa[_0x2792('0x34')][_0x2792('0x1e')]);}return _0x119333['getSubjects'](_0x26d350);}})['then'](function(_0x347b19){if(_0x347b19){return _0x347b19?{'count':_0x44260a,'rows':_0x347b19}:null;}})[_0x2792('0x27')](respondWithResult(_0x320383,null))[_0x2792('0x45')](handleError(_0x320383,null));};exports['getDescriptions']=function(_0x1f1954,_0x1575ed,_0x823da5){var _0x37a236={};var _0x2c2763={};var _0x3168cd;var _0x1f9078;return db[_0x2792('0x2d')][_0x2792('0x51')]({'where':{'id':_0x1f1954[_0x2792('0x47')]['id']}})[_0x2792('0x27')](handleEntityNotFound(_0x1575ed,null))[_0x2792('0x27')](function(_0x37c842){if(_0x37c842){_0x3168cd=_0x37c842;_0x2c2763['model']=_[_0x2792('0x48')](db[_0x2792('0x4e')][_0x2792('0x2e')]);_0x2c2763[_0x2792('0x34')]=_['keys'](_0x1f1954[_0x2792('0x34')]);_0x2c2763[_0x2792('0x35')]=_['intersection'](_0x2c2763['model'],_0x2c2763[_0x2792('0x34')]);_0x37a236[_0x2792('0x37')]=_['intersection'](_0x2c2763[_0x2792('0x32')],qs[_0x2792('0x38')](_0x1f1954[_0x2792('0x34')]['fields']));_0x37a236[_0x2792('0x37')]=_0x37a236[_0x2792('0x37')][_0x2792('0x39')]?_0x37a236[_0x2792('0x37')]:_0x2c2763['model'];_0x37a236[_0x2792('0x3c')]=qs[_0x2792('0x3d')](_0x1f1954['query'][_0x2792('0x3d')]);_0x37a236[_0x2792('0x3e')]=qs[_0x2792('0x35')](_[_0x2792('0x4f')](_0x1f1954[_0x2792('0x34')],_0x2c2763[_0x2792('0x35')]));if(_0x1f1954['query']['filter']){_0x37a236['where']=_[_0x2792('0x3f')](_0x37a236[_0x2792('0x3e')],{'$or':_['map'](_0x37a236[_0x2792('0x37')],function(_0x20eb9f){var _0x15ee33={};_0x15ee33[_0x20eb9f]={'$like':'%'+_0x1f1954['query'][_0x2792('0x41')]+'%'};return _0x15ee33;})});}_0x37a236=_[_0x2792('0x3f')]({},_0x37a236,_0x1f1954[_0x2792('0x42')]);return _0x3168cd[_0x2792('0x52')](_0x37a236);}})[_0x2792('0x27')](function(_0x450cba){if(_0x450cba){_0x1f9078=_0x450cba[_0x2792('0x39')];if(!_0x1f1954[_0x2792('0x34')][_0x2792('0x3a')]('nolimit')){_0x37a236['limit']=qs['limit'](_0x1f1954[_0x2792('0x34')][_0x2792('0x20')]);_0x37a236[_0x2792('0x1e')]=qs[_0x2792('0x1e')](_0x1f1954[_0x2792('0x34')][_0x2792('0x1e')]);}return _0x3168cd[_0x2792('0x52')](_0x37a236);}})['then'](function(_0x2fdf8b){if(_0x2fdf8b){return _0x2fdf8b?{'count':_0x1f9078,'rows':_0x2fdf8b}:null;}})[_0x2792('0x27')](respondWithResult(_0x1575ed,null))[_0x2792('0x45')](handleError(_0x1575ed,null));};exports[_0x2792('0x53')]=function(_0x42ee30,_0x2a242c,_0x2dd993){var _0x33f758={};var _0x60fca={};var _0x1aa537;var _0x44d6d0;return db[_0x2792('0x2d')][_0x2792('0x51')]({'where':{'id':_0x42ee30[_0x2792('0x47')]['id']}})[_0x2792('0x27')](handleEntityNotFound(_0x2a242c,null))[_0x2792('0x27')](function(_0x5f2150){if(_0x5f2150){_0x1aa537=_0x5f2150;_0x60fca[_0x2792('0x32')]=_[_0x2792('0x48')](db['Tag'][_0x2792('0x2e')]);_0x60fca[_0x2792('0x34')]=_[_0x2792('0x48')](_0x42ee30['query']);_0x60fca[_0x2792('0x35')]=_[_0x2792('0x36')](_0x60fca[_0x2792('0x32')],_0x60fca[_0x2792('0x34')]);_0x33f758['attributes']=_[_0x2792('0x36')](_0x60fca[_0x2792('0x32')],qs[_0x2792('0x38')](_0x42ee30[_0x2792('0x34')][_0x2792('0x38')]));_0x33f758[_0x2792('0x37')]=_0x33f758['attributes'][_0x2792('0x39')]?_0x33f758[_0x2792('0x37')]:_0x60fca[_0x2792('0x32')];_0x33f758['order']=qs['sort'](_0x42ee30[_0x2792('0x34')][_0x2792('0x3d')]);_0x33f758['where']=qs['filters'](_[_0x2792('0x4f')](_0x42ee30[_0x2792('0x34')],_0x60fca[_0x2792('0x35')]));if(_0x42ee30['query'][_0x2792('0x41')]){_0x33f758[_0x2792('0x3e')]=_[_0x2792('0x3f')](_0x33f758[_0x2792('0x3e')],{'$or':_[_0x2792('0x33')](_0x33f758[_0x2792('0x37')],function(_0x448f9c){var _0x4c0812={};_0x4c0812[_0x448f9c]={'$like':'%'+_0x42ee30[_0x2792('0x34')][_0x2792('0x41')]+'%'};return _0x4c0812;})});}_0x33f758=_[_0x2792('0x3f')]({},_0x33f758,_0x42ee30[_0x2792('0x42')]);return _0x1aa537[_0x2792('0x53')](_0x33f758);}})['then'](function(_0x35bb10){if(_0x35bb10){_0x44d6d0=_0x35bb10['length'];if(!_0x42ee30[_0x2792('0x34')][_0x2792('0x3a')](_0x2792('0x3b'))){_0x33f758[_0x2792('0x20')]=qs[_0x2792('0x20')](_0x42ee30['query'][_0x2792('0x20')]);_0x33f758['offset']=qs['offset'](_0x42ee30['query'][_0x2792('0x1e')]);}return _0x1aa537['getTags'](_0x33f758);}})['then'](function(_0x2892f5){if(_0x2892f5){return _0x2892f5?{'count':_0x44d6d0,'rows':_0x2892f5}:null;}})[_0x2792('0x27')](respondWithResult(_0x2a242c,null))[_0x2792('0x45')](handleError(_0x2a242c,null));};exports[_0x2792('0x54')]=function(_0x5775e3,_0x5c4faf,_0x3214d5){if(_0x5775e3[_0x2792('0x4c')]['id']){delete _0x5775e3[_0x2792('0x4c')]['id'];}return db['ZendeskConfiguration'][_0x2792('0x51')]({'where':{'id':_0x5775e3[_0x2792('0x47')]['id']}})[_0x2792('0x27')](handleEntityNotFound(_0x5c4faf,null))['then'](function(_0x5b7b25){if(_0x5b7b25){return _0x5b7b25[_0x2792('0x54')](_0x5775e3[_0x2792('0x4c')][_0x2792('0x55')]||[]);}return null;})['then'](respondWithResult(_0x5c4faf,null))[_0x2792('0x45')](handleError(_0x5c4faf,null));}; \ No newline at end of file +var _0x85ac=['setTags','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','error','stack','name','index','ZendeskConfiguration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','params','destroy','getFields','findOne','sort','getSubjects','ZendeskField','getDescriptions','getTags','Tag'];(function(_0x69a748,_0x7e2ee1){var _0x116db0=function(_0x67e3ab){while(--_0x67e3ab){_0x69a748['push'](_0x69a748['shift']());}};_0x116db0(++_0x7e2ee1);}(_0x85ac,0x14d));var _0xc85a=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x85ac[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc85a('0x0'));var zipdir=require(_0xc85a('0x1'));var jsonpatch=require(_0xc85a('0x2'));var rp=require('request-promise');var moment=require(_0xc85a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc85a('0x4'));var util=require(_0xc85a('0x5'));var path=require(_0xc85a('0x6'));var sox=require(_0xc85a('0x7'));var csv=require(_0xc85a('0x8'));var ejs=require(_0xc85a('0x9'));var fs=require('fs');var fs_extra=require(_0xc85a('0xa'));var _=require(_0xc85a('0xb'));var squel=require(_0xc85a('0xc'));var crypto=require(_0xc85a('0xd'));var jsforce=require(_0xc85a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc85a('0x8'));var querystring=require(_0xc85a('0xf'));var Papa=require(_0xc85a('0x10'));var Redis=require(_0xc85a('0x11'));var authService=require(_0xc85a('0x12'));var qs=require(_0xc85a('0x13'));var as=require(_0xc85a('0x14'));var hardwareService=require(_0xc85a('0x15'));var logger=require(_0xc85a('0x16'))(_0xc85a('0x17'));var utils=require(_0xc85a('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0c6f3,_0x4c6762){_0x4c6762=_0x4c6762||0xcc;return function(_0x5b70a9){if(_0x5b70a9){return _0xb0c6f3['sendStatus'](_0x4c6762);}return _0xb0c6f3[_0xc85a('0x19')](_0x4c6762)[_0xc85a('0x1a')]();};}function respondWithResult(_0x33b8b8,_0x5d59f1){_0x5d59f1=_0x5d59f1||0xc8;return function(_0x47e785){if(_0x47e785){return _0x33b8b8[_0xc85a('0x19')](_0x5d59f1)[_0xc85a('0x1b')](_0x47e785);}};}function respondWithFilteredResult(_0x4f0833,_0x21e942){return function(_0x1f50fa){if(_0x1f50fa){var _0x1f0695=typeof _0x21e942[_0xc85a('0x1c')]==='undefined'&&typeof _0x21e942[_0xc85a('0x1d')]===_0xc85a('0x1e');var _0x13f013=_0x1f50fa[_0xc85a('0x1f')];var _0x55a4d4=_0x1f0695?0x0:_0x21e942[_0xc85a('0x1c')];var _0x40b656=_0x1f0695?_0x1f50fa[_0xc85a('0x1f')]:_0x21e942[_0xc85a('0x1c')]+_0x21e942[_0xc85a('0x1d')];var _0x250628;if(_0x40b656>=_0x13f013){_0x40b656=_0x13f013;_0x250628=0xc8;}else{_0x250628=0xce;}_0x4f0833[_0xc85a('0x19')](_0x250628);return _0x4f0833[_0xc85a('0x20')](_0xc85a('0x21'),_0x55a4d4+'-'+_0x40b656+'/'+_0x13f013)['json'](_0x1f50fa);}return null;};}function patchUpdates(_0x1320aa){return function(_0x17eab7){try{jsonpatch['apply'](_0x17eab7,_0x1320aa,!![]);}catch(_0x17ed49){return BPromise[_0xc85a('0x22')](_0x17ed49);}return _0x17eab7[_0xc85a('0x23')]();};}function saveUpdates(_0x1f783d,_0x162923){return function(_0x4511ad){if(_0x4511ad){return _0x4511ad[_0xc85a('0x24')](_0x1f783d)[_0xc85a('0x25')](function(_0x44474e){return _0x44474e;});}return null;};}function removeEntity(_0x5ec518,_0x38d2f0){return function(_0x7511ac){if(_0x7511ac){return _0x7511ac['destroy']()['then'](function(){_0x5ec518[_0xc85a('0x19')](0xcc)[_0xc85a('0x1a')]();});}};}function handleEntityNotFound(_0x4ef571,_0x30e106){return function(_0x5c78c7){if(!_0x5c78c7){_0x4ef571['sendStatus'](0x194);}return _0x5c78c7;};}function handleError(_0x345a17,_0x4419bc){_0x4419bc=_0x4419bc||0x1f4;return function(_0x1ed6ad){logger[_0xc85a('0x26')](_0x1ed6ad[_0xc85a('0x27')]);if(_0x1ed6ad[_0xc85a('0x28')]){delete _0x1ed6ad[_0xc85a('0x28')];}_0x345a17[_0xc85a('0x19')](_0x4419bc)['send'](_0x1ed6ad);};}exports[_0xc85a('0x29')]=function(_0x519090,_0x1af1ce){var _0x1763fd={},_0x52700a={},_0x3a4762={'count':0x0,'rows':[]};var _0x286afd=_['map'](db[_0xc85a('0x2a')]['rawAttributes'],function(_0x4ec1b1){return{'name':_0x4ec1b1[_0xc85a('0x2b')],'type':_0x4ec1b1['type'][_0xc85a('0x2c')]};});_0x52700a[_0xc85a('0x2d')]=_['map'](_0x286afd,_0xc85a('0x28'));_0x52700a[_0xc85a('0x2e')]=_[_0xc85a('0x2f')](_0x519090[_0xc85a('0x2e')]);_0x52700a[_0xc85a('0x30')]=_[_0xc85a('0x31')](_0x52700a[_0xc85a('0x2d')],_0x52700a[_0xc85a('0x2e')]);_0x1763fd[_0xc85a('0x32')]=_[_0xc85a('0x31')](_0x52700a[_0xc85a('0x2d')],qs[_0xc85a('0x33')](_0x519090[_0xc85a('0x2e')][_0xc85a('0x33')]));_0x1763fd[_0xc85a('0x32')]=_0x1763fd[_0xc85a('0x32')][_0xc85a('0x34')]?_0x1763fd[_0xc85a('0x32')]:_0x52700a['model'];if(!_0x519090[_0xc85a('0x2e')][_0xc85a('0x35')](_0xc85a('0x36'))){_0x1763fd['limit']=qs[_0xc85a('0x1d')](_0x519090[_0xc85a('0x2e')]['limit']);_0x1763fd[_0xc85a('0x1c')]=qs[_0xc85a('0x1c')](_0x519090['query']['offset']);}_0x1763fd[_0xc85a('0x37')]=qs['sort'](_0x519090[_0xc85a('0x2e')]['sort']);_0x1763fd[_0xc85a('0x38')]=qs[_0xc85a('0x30')](_[_0xc85a('0x39')](_0x519090[_0xc85a('0x2e')],_0x52700a[_0xc85a('0x30')]),_0x286afd);if(_0x519090[_0xc85a('0x2e')][_0xc85a('0x3a')]){_0x1763fd[_0xc85a('0x38')]=_[_0xc85a('0x3b')](_0x1763fd[_0xc85a('0x38')],{'$or':_[_0xc85a('0x3c')](_0x286afd,function(_0xf077ef){if(_0xf077ef['type']!==_0xc85a('0x3d')){var _0x17039d={};_0x17039d[_0xf077ef[_0xc85a('0x28')]]={'$like':'%'+_0x519090['query']['filter']+'%'};return _0x17039d;}})});}_0x1763fd=_['merge']({},_0x1763fd,_0x519090[_0xc85a('0x3e')]);var _0x432445={'where':_0x1763fd[_0xc85a('0x38')]};return db[_0xc85a('0x2a')]['count'](_0x432445)['then'](function(_0x230cf6){_0x3a4762[_0xc85a('0x1f')]=_0x230cf6;if(_0x519090[_0xc85a('0x2e')][_0xc85a('0x3f')]){_0x1763fd[_0xc85a('0x40')]=[{'all':!![]}];}return db[_0xc85a('0x2a')][_0xc85a('0x41')](_0x1763fd);})[_0xc85a('0x25')](function(_0x272662){_0x3a4762['rows']=_0x272662;return _0x3a4762;})[_0xc85a('0x25')](respondWithFilteredResult(_0x1af1ce,_0x1763fd))[_0xc85a('0x42')](handleError(_0x1af1ce,null));};exports[_0xc85a('0x43')]=function(_0x4994cc,_0x34177c){var _0x58579={'raw':![],'where':{'id':_0x4994cc['params']['id']}},_0x5429e7={};_0x5429e7[_0xc85a('0x2d')]=_[_0xc85a('0x2f')](db[_0xc85a('0x2a')][_0xc85a('0x44')]);_0x5429e7[_0xc85a('0x2e')]=_['keys'](_0x4994cc[_0xc85a('0x2e')]);_0x5429e7[_0xc85a('0x30')]=_[_0xc85a('0x31')](_0x5429e7[_0xc85a('0x2d')],_0x5429e7[_0xc85a('0x2e')]);_0x58579['attributes']=_[_0xc85a('0x31')](_0x5429e7[_0xc85a('0x2d')],qs[_0xc85a('0x33')](_0x4994cc[_0xc85a('0x2e')][_0xc85a('0x33')]));_0x58579[_0xc85a('0x32')]=_0x58579[_0xc85a('0x32')][_0xc85a('0x34')]?_0x58579[_0xc85a('0x32')]:_0x5429e7['model'];if(_0x4994cc[_0xc85a('0x2e')]['includeAll']){_0x58579[_0xc85a('0x40')]=[{'all':!![]}];}_0x58579=_[_0xc85a('0x3b')]({},_0x58579,_0x4994cc['options']);return db[_0xc85a('0x2a')][_0xc85a('0x45')](_0x58579)[_0xc85a('0x25')](handleEntityNotFound(_0x34177c,null))['then'](respondWithResult(_0x34177c,null))[_0xc85a('0x42')](handleError(_0x34177c,null));};exports['create']=function(_0x40174d,_0x48ef3e){return db[_0xc85a('0x2a')][_0xc85a('0x46')](_0x40174d[_0xc85a('0x47')],{})['then'](respondWithResult(_0x48ef3e,0xc9))['catch'](handleError(_0x48ef3e,null));};exports[_0xc85a('0x24')]=function(_0x184b4c,_0x397435){if(_0x184b4c['body']['id']){delete _0x184b4c[_0xc85a('0x47')]['id'];}return db[_0xc85a('0x2a')][_0xc85a('0x45')]({'where':{'id':_0x184b4c[_0xc85a('0x48')]['id']}})['then'](handleEntityNotFound(_0x397435,null))[_0xc85a('0x25')](saveUpdates(_0x184b4c[_0xc85a('0x47')],null))[_0xc85a('0x25')](respondWithResult(_0x397435,null))[_0xc85a('0x42')](handleError(_0x397435,null));};exports[_0xc85a('0x49')]=function(_0x4e0eee,_0x18cfec){return db['ZendeskConfiguration']['find']({'where':{'id':_0x4e0eee[_0xc85a('0x48')]['id']}})['then'](handleEntityNotFound(_0x18cfec,null))[_0xc85a('0x25')](removeEntity(_0x18cfec,null))[_0xc85a('0x42')](handleError(_0x18cfec,null));};exports[_0xc85a('0x4a')]=function(_0x125aff,_0x21b990,_0xf7d52){var _0x5935b2={};var _0x5b4bf0={};var _0x3d2c9c;var _0x59653e;return db[_0xc85a('0x2a')][_0xc85a('0x4b')]({'where':{'id':_0x125aff[_0xc85a('0x48')]['id']}})[_0xc85a('0x25')](handleEntityNotFound(_0x21b990,null))[_0xc85a('0x25')](function(_0x1f5f8c){if(_0x1f5f8c){_0x3d2c9c=_0x1f5f8c;_0x5b4bf0[_0xc85a('0x2d')]=_['keys'](db['ZendeskField'][_0xc85a('0x44')]);_0x5b4bf0[_0xc85a('0x2e')]=_['keys'](_0x125aff[_0xc85a('0x2e')]);_0x5b4bf0[_0xc85a('0x30')]=_[_0xc85a('0x31')](_0x5b4bf0[_0xc85a('0x2d')],_0x5b4bf0[_0xc85a('0x2e')]);_0x5935b2[_0xc85a('0x32')]=_['intersection'](_0x5b4bf0[_0xc85a('0x2d')],qs[_0xc85a('0x33')](_0x125aff[_0xc85a('0x2e')]['fields']));_0x5935b2['attributes']=_0x5935b2[_0xc85a('0x32')][_0xc85a('0x34')]?_0x5935b2['attributes']:_0x5b4bf0[_0xc85a('0x2d')];_0x5935b2[_0xc85a('0x37')]=qs[_0xc85a('0x4c')](_0x125aff['query'][_0xc85a('0x4c')]);_0x5935b2[_0xc85a('0x38')]=qs[_0xc85a('0x30')](_[_0xc85a('0x39')](_0x125aff[_0xc85a('0x2e')],_0x5b4bf0[_0xc85a('0x30')]));if(_0x125aff[_0xc85a('0x2e')][_0xc85a('0x3a')]){_0x5935b2['where']=_[_0xc85a('0x3b')](_0x5935b2['where'],{'$or':_[_0xc85a('0x3c')](_0x5935b2[_0xc85a('0x32')],function(_0x30a92b){var _0x8f3f06={};_0x8f3f06[_0x30a92b]={'$like':'%'+_0x125aff[_0xc85a('0x2e')][_0xc85a('0x3a')]+'%'};return _0x8f3f06;})});}_0x5935b2=_['merge']({},_0x5935b2,_0x125aff[_0xc85a('0x3e')]);return _0x3d2c9c[_0xc85a('0x4a')](_0x5935b2);}})[_0xc85a('0x25')](function(_0x471252){if(_0x471252){_0x59653e=_0x471252[_0xc85a('0x34')];if(!_0x125aff[_0xc85a('0x2e')][_0xc85a('0x35')](_0xc85a('0x36'))){_0x5935b2[_0xc85a('0x1d')]=qs[_0xc85a('0x1d')](_0x125aff[_0xc85a('0x2e')][_0xc85a('0x1d')]);_0x5935b2[_0xc85a('0x1c')]=qs[_0xc85a('0x1c')](_0x125aff[_0xc85a('0x2e')][_0xc85a('0x1c')]);}return _0x3d2c9c['getFields'](_0x5935b2);}})['then'](function(_0x14288e){if(_0x14288e){return _0x14288e?{'count':_0x59653e,'rows':_0x14288e}:null;}})[_0xc85a('0x25')](respondWithResult(_0x21b990,null))[_0xc85a('0x42')](handleError(_0x21b990,null));};exports[_0xc85a('0x4d')]=function(_0x528ad0,_0x5cf99e,_0x357866){var _0x2dd601={};var _0x20bc1a={};var _0x57e0d2;var _0x524c42;return db[_0xc85a('0x2a')][_0xc85a('0x4b')]({'where':{'id':_0x528ad0[_0xc85a('0x48')]['id']}})[_0xc85a('0x25')](handleEntityNotFound(_0x5cf99e,null))['then'](function(_0x24ff5e){if(_0x24ff5e){_0x57e0d2=_0x24ff5e;_0x20bc1a[_0xc85a('0x2d')]=_[_0xc85a('0x2f')](db[_0xc85a('0x4e')][_0xc85a('0x44')]);_0x20bc1a[_0xc85a('0x2e')]=_[_0xc85a('0x2f')](_0x528ad0[_0xc85a('0x2e')]);_0x20bc1a[_0xc85a('0x30')]=_[_0xc85a('0x31')](_0x20bc1a['model'],_0x20bc1a[_0xc85a('0x2e')]);_0x2dd601['attributes']=_[_0xc85a('0x31')](_0x20bc1a[_0xc85a('0x2d')],qs[_0xc85a('0x33')](_0x528ad0[_0xc85a('0x2e')][_0xc85a('0x33')]));_0x2dd601[_0xc85a('0x32')]=_0x2dd601[_0xc85a('0x32')][_0xc85a('0x34')]?_0x2dd601['attributes']:_0x20bc1a[_0xc85a('0x2d')];_0x2dd601[_0xc85a('0x37')]=qs[_0xc85a('0x4c')](_0x528ad0[_0xc85a('0x2e')][_0xc85a('0x4c')]);_0x2dd601[_0xc85a('0x38')]=qs[_0xc85a('0x30')](_[_0xc85a('0x39')](_0x528ad0[_0xc85a('0x2e')],_0x20bc1a[_0xc85a('0x30')]));if(_0x528ad0['query'][_0xc85a('0x3a')]){_0x2dd601[_0xc85a('0x38')]=_[_0xc85a('0x3b')](_0x2dd601[_0xc85a('0x38')],{'$or':_[_0xc85a('0x3c')](_0x2dd601[_0xc85a('0x32')],function(_0x59566c){var _0x53f06a={};_0x53f06a[_0x59566c]={'$like':'%'+_0x528ad0[_0xc85a('0x2e')][_0xc85a('0x3a')]+'%'};return _0x53f06a;})});}_0x2dd601=_['merge']({},_0x2dd601,_0x528ad0[_0xc85a('0x3e')]);return _0x57e0d2[_0xc85a('0x4d')](_0x2dd601);}})[_0xc85a('0x25')](function(_0x5a85cb){if(_0x5a85cb){_0x524c42=_0x5a85cb[_0xc85a('0x34')];if(!_0x528ad0[_0xc85a('0x2e')][_0xc85a('0x35')](_0xc85a('0x36'))){_0x2dd601['limit']=qs[_0xc85a('0x1d')](_0x528ad0[_0xc85a('0x2e')]['limit']);_0x2dd601[_0xc85a('0x1c')]=qs[_0xc85a('0x1c')](_0x528ad0[_0xc85a('0x2e')][_0xc85a('0x1c')]);}return _0x57e0d2['getSubjects'](_0x2dd601);}})['then'](function(_0x33eb3f){if(_0x33eb3f){return _0x33eb3f?{'count':_0x524c42,'rows':_0x33eb3f}:null;}})[_0xc85a('0x25')](respondWithResult(_0x5cf99e,null))[_0xc85a('0x42')](handleError(_0x5cf99e,null));};exports[_0xc85a('0x4f')]=function(_0x310ec1,_0x4d1f8e,_0x1b4494){var _0x13f66b={};var _0x5aebf6={};var _0x4db1af;var _0x5b03bb;return db[_0xc85a('0x2a')][_0xc85a('0x4b')]({'where':{'id':_0x310ec1[_0xc85a('0x48')]['id']}})['then'](handleEntityNotFound(_0x4d1f8e,null))['then'](function(_0x11a8a2){if(_0x11a8a2){_0x4db1af=_0x11a8a2;_0x5aebf6[_0xc85a('0x2d')]=_[_0xc85a('0x2f')](db[_0xc85a('0x4e')][_0xc85a('0x44')]);_0x5aebf6[_0xc85a('0x2e')]=_[_0xc85a('0x2f')](_0x310ec1[_0xc85a('0x2e')]);_0x5aebf6[_0xc85a('0x30')]=_['intersection'](_0x5aebf6[_0xc85a('0x2d')],_0x5aebf6[_0xc85a('0x2e')]);_0x13f66b[_0xc85a('0x32')]=_[_0xc85a('0x31')](_0x5aebf6[_0xc85a('0x2d')],qs[_0xc85a('0x33')](_0x310ec1[_0xc85a('0x2e')][_0xc85a('0x33')]));_0x13f66b[_0xc85a('0x32')]=_0x13f66b[_0xc85a('0x32')][_0xc85a('0x34')]?_0x13f66b[_0xc85a('0x32')]:_0x5aebf6[_0xc85a('0x2d')];_0x13f66b[_0xc85a('0x37')]=qs[_0xc85a('0x4c')](_0x310ec1['query'][_0xc85a('0x4c')]);_0x13f66b[_0xc85a('0x38')]=qs['filters'](_[_0xc85a('0x39')](_0x310ec1[_0xc85a('0x2e')],_0x5aebf6[_0xc85a('0x30')]));if(_0x310ec1[_0xc85a('0x2e')][_0xc85a('0x3a')]){_0x13f66b[_0xc85a('0x38')]=_[_0xc85a('0x3b')](_0x13f66b['where'],{'$or':_[_0xc85a('0x3c')](_0x13f66b[_0xc85a('0x32')],function(_0x3faae1){var _0x69adb5={};_0x69adb5[_0x3faae1]={'$like':'%'+_0x310ec1[_0xc85a('0x2e')][_0xc85a('0x3a')]+'%'};return _0x69adb5;})});}_0x13f66b=_[_0xc85a('0x3b')]({},_0x13f66b,_0x310ec1[_0xc85a('0x3e')]);return _0x4db1af[_0xc85a('0x4f')](_0x13f66b);}})['then'](function(_0x22966e){if(_0x22966e){_0x5b03bb=_0x22966e['length'];if(!_0x310ec1[_0xc85a('0x2e')][_0xc85a('0x35')](_0xc85a('0x36'))){_0x13f66b[_0xc85a('0x1d')]=qs[_0xc85a('0x1d')](_0x310ec1['query'][_0xc85a('0x1d')]);_0x13f66b[_0xc85a('0x1c')]=qs[_0xc85a('0x1c')](_0x310ec1[_0xc85a('0x2e')][_0xc85a('0x1c')]);}return _0x4db1af[_0xc85a('0x4f')](_0x13f66b);}})['then'](function(_0xdf9609){if(_0xdf9609){return _0xdf9609?{'count':_0x5b03bb,'rows':_0xdf9609}:null;}})['then'](respondWithResult(_0x4d1f8e,null))[_0xc85a('0x42')](handleError(_0x4d1f8e,null));};exports[_0xc85a('0x50')]=function(_0x239aff,_0xc9ab64,_0x3d3b77){var _0x59ed60={};var _0x221d5b={};var _0x30963f;var _0x43624f;return db[_0xc85a('0x2a')][_0xc85a('0x4b')]({'where':{'id':_0x239aff[_0xc85a('0x48')]['id']}})[_0xc85a('0x25')](handleEntityNotFound(_0xc9ab64,null))['then'](function(_0x48bd3a){if(_0x48bd3a){_0x30963f=_0x48bd3a;_0x221d5b[_0xc85a('0x2d')]=_[_0xc85a('0x2f')](db[_0xc85a('0x51')]['rawAttributes']);_0x221d5b[_0xc85a('0x2e')]=_[_0xc85a('0x2f')](_0x239aff[_0xc85a('0x2e')]);_0x221d5b['filters']=_[_0xc85a('0x31')](_0x221d5b['model'],_0x221d5b['query']);_0x59ed60[_0xc85a('0x32')]=_[_0xc85a('0x31')](_0x221d5b['model'],qs[_0xc85a('0x33')](_0x239aff[_0xc85a('0x2e')][_0xc85a('0x33')]));_0x59ed60[_0xc85a('0x32')]=_0x59ed60[_0xc85a('0x32')][_0xc85a('0x34')]?_0x59ed60['attributes']:_0x221d5b[_0xc85a('0x2d')];_0x59ed60['order']=qs['sort'](_0x239aff[_0xc85a('0x2e')][_0xc85a('0x4c')]);_0x59ed60[_0xc85a('0x38')]=qs[_0xc85a('0x30')](_[_0xc85a('0x39')](_0x239aff[_0xc85a('0x2e')],_0x221d5b[_0xc85a('0x30')]));if(_0x239aff['query'][_0xc85a('0x3a')]){_0x59ed60[_0xc85a('0x38')]=_[_0xc85a('0x3b')](_0x59ed60['where'],{'$or':_[_0xc85a('0x3c')](_0x59ed60[_0xc85a('0x32')],function(_0x1ab035){var _0x3fc1d7={};_0x3fc1d7[_0x1ab035]={'$like':'%'+_0x239aff[_0xc85a('0x2e')][_0xc85a('0x3a')]+'%'};return _0x3fc1d7;})});}_0x59ed60=_[_0xc85a('0x3b')]({},_0x59ed60,_0x239aff[_0xc85a('0x3e')]);return _0x30963f[_0xc85a('0x50')](_0x59ed60);}})[_0xc85a('0x25')](function(_0x34c9e0){if(_0x34c9e0){_0x43624f=_0x34c9e0[_0xc85a('0x34')];if(!_0x239aff[_0xc85a('0x2e')][_0xc85a('0x35')]('nolimit')){_0x59ed60[_0xc85a('0x1d')]=qs[_0xc85a('0x1d')](_0x239aff[_0xc85a('0x2e')][_0xc85a('0x1d')]);_0x59ed60[_0xc85a('0x1c')]=qs['offset'](_0x239aff[_0xc85a('0x2e')][_0xc85a('0x1c')]);}return _0x30963f[_0xc85a('0x50')](_0x59ed60);}})[_0xc85a('0x25')](function(_0x845f80){if(_0x845f80){return _0x845f80?{'count':_0x43624f,'rows':_0x845f80}:null;}})['then'](respondWithResult(_0xc9ab64,null))[_0xc85a('0x42')](handleError(_0xc9ab64,null));};exports[_0xc85a('0x52')]=function(_0xa37825,_0x1516f9,_0x3a529c){if(_0xa37825[_0xc85a('0x47')]['id']){delete _0xa37825['body']['id'];}return db['ZendeskConfiguration'][_0xc85a('0x4b')]({'where':{'id':_0xa37825[_0xc85a('0x48')]['id']}})['then'](handleEntityNotFound(_0x1516f9,null))['then'](function(_0x322261){if(_0x322261){return _0x322261[_0xc85a('0x52')](_0xa37825['body']['ids']||[]);}return null;})[_0xc85a('0x25')](respondWithResult(_0x1516f9,null))['catch'](handleError(_0x1516f9,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 995f937..96fffa1 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 _0x84a0=['define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x84a0,0x66));var _0x084a=function(_0x12b1a9,_0x4227ec){_0x12b1a9=_0x12b1a9-0x0;var _0x1e6f0c=_0x84a0[_0x12b1a9];return _0x1e6f0c;};'use strict';var _=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var logger=require(_0x084a('0x2'))(_0x084a('0x3'));var moment=require('moment');var BPromise=require(_0x084a('0x4'));var rp=require(_0x084a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x084a('0x6'));var attributes=require(_0x084a('0x7'));module['exports']=function(_0x16f8a7,_0x4325ce){return _0x16f8a7[_0x084a('0x8')](_0x084a('0x9'),attributes,{'tableName':_0x084a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae60=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x593be5,_0x46c1bd){var _0xe84a2a=function(_0x154664){while(--_0x154664){_0x593be5['push'](_0x593be5['shift']());}};_0xe84a2a(++_0x46c1bd);}(_0xae60,0x1c7));var _0x0ae6=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0xae60[_0x25d386];return _0x857f4a;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var logger=require(_0x0ae6('0x2'))('api');var moment=require(_0x0ae6('0x3'));var BPromise=require(_0x0ae6('0x4'));var rp=require(_0x0ae6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ae6('0x6'));var config=require(_0x0ae6('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x0ae6('0x8')]=function(_0x25ac7c,_0x30e000){return _0x25ac7c[_0x0ae6('0x9')](_0x0ae6('0xa'),attributes,{'tableName':_0x0ae6('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 00fb36a..7eb3f88 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 _0x7a8a=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/environment','http','then','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch'];(function(_0x35e1d9,_0xa1b22b){var _0xc39ff6=function(_0x56caf7){while(--_0x56caf7){_0x35e1d9['push'](_0x35e1d9['shift']());}};_0xc39ff6(++_0xa1b22b);}(_0x7a8a,0x17a));var _0xa7a8=function(_0x5c4ee4,_0x187164){_0x5c4ee4=_0x5c4ee4-0x0;var _0x26f607=_0x7a8a[_0x5c4ee4];return _0x26f607;};'use strict';var _=require(_0xa7a8('0x0'));var util=require('util');var moment=require(_0xa7a8('0x1'));var BPromise=require(_0xa7a8('0x2'));var rs=require(_0xa7a8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa7a8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa7a8('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa7a8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x537a62,_0x27c3d0,_0x3d1bca){return new BPromise(function(_0x3c4b9d,_0x4dfc2f){return client['request'](_0x537a62,_0x3d1bca)[_0xa7a8('0x7')](function(_0x55b3b7){logger['info'](_0xa7a8('0x8'),_0x27c3d0,'request\x20sent');logger[_0xa7a8('0x9')](_0xa7a8('0xa'),_0x27c3d0,_0xa7a8('0xb'),JSON[_0xa7a8('0xc')](_0x55b3b7));if(_0x55b3b7[_0xa7a8('0xd')]){if(_0x55b3b7[_0xa7a8('0xd')]['code']===0x1f4){logger['error'](_0xa7a8('0x8'),_0x27c3d0,_0x55b3b7['error'][_0xa7a8('0xe')]);return _0x4dfc2f(_0x55b3b7['error'][_0xa7a8('0xe')]);}logger[_0xa7a8('0xd')](_0xa7a8('0x8'),_0x27c3d0,_0x55b3b7[_0xa7a8('0xd')][_0xa7a8('0xe')]);return _0x3c4b9d(_0x55b3b7[_0xa7a8('0xd')]['message']);}else{logger[_0xa7a8('0xf')](_0xa7a8('0x8'),_0x27c3d0,_0xa7a8('0xb'));_0x3c4b9d(_0x55b3b7[_0xa7a8('0x10')][_0xa7a8('0xe')]);}})[_0xa7a8('0x11')](function(_0x56ce04){logger[_0xa7a8('0xd')](_0xa7a8('0x8'),_0x27c3d0,_0x56ce04);_0x4dfc2f(_0x56ce04);});});} \ No newline at end of file +var _0x4175=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x4175,0x1e9));var _0x5417=function(_0x146f9c,_0x43fa83){_0x146f9c=_0x146f9c-0x0;var _0x24d6b5=_0x4175[_0x146f9c];return _0x24d6b5;};'use strict';var _=require(_0x5417('0x0'));var util=require(_0x5417('0x1'));var moment=require(_0x5417('0x2'));var BPromise=require(_0x5417('0x3'));var rs=require(_0x5417('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5417('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5417('0x6'))(_0x5417('0x7'));var config=require(_0x5417('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5417('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x311714,_0x4961a3,_0x1312ac){return new BPromise(function(_0x585191,_0x17d42b){return client[_0x5417('0xa')](_0x311714,_0x1312ac)[_0x5417('0xb')](function(_0x1454bc){logger[_0x5417('0xc')](_0x5417('0xd'),_0x4961a3,_0x5417('0xe'));logger[_0x5417('0xf')](_0x5417('0x10'),_0x4961a3,_0x5417('0xe'),JSON[_0x5417('0x11')](_0x1454bc));if(_0x1454bc[_0x5417('0x12')]){if(_0x1454bc[_0x5417('0x12')]['code']===0x1f4){logger[_0x5417('0x12')](_0x5417('0xd'),_0x4961a3,_0x1454bc[_0x5417('0x12')]['message']);return _0x17d42b(_0x1454bc[_0x5417('0x12')][_0x5417('0x13')]);}logger[_0x5417('0x12')](_0x5417('0xd'),_0x4961a3,_0x1454bc[_0x5417('0x12')]['message']);return _0x585191(_0x1454bc[_0x5417('0x12')][_0x5417('0x13')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x4961a3,_0x5417('0xe'));_0x585191(_0x1454bc[_0x5417('0x14')][_0x5417('0x13')]);}})[_0x5417('0x15')](function(_0x22c607){logger[_0x5417('0x12')](_0x5417('0xd'),_0x4961a3,_0x22c607);_0x17d42b(_0x22c607);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index aaf6e47..ee15313 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 _0x4279=['post','create','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','/:id','isAuthenticated','show'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x4279,0x146));var _0x9427=function(_0x1099be,_0xe3f9fc){_0x1099be=_0x1099be-0x0;var _0x2d0fd6=_0x4279[_0x1099be];return _0x2d0fd6;};'use strict';var multer=require(_0x9427('0x0'));var util=require(_0x9427('0x1'));var path=require(_0x9427('0x2'));var timeout=require(_0x9427('0x3'));var express=require(_0x9427('0x4'));var router=express['Router']();var fs_extra=require(_0x9427('0x5'));var auth=require(_0x9427('0x6'));var interaction=require(_0x9427('0x7'));var config=require(_0x9427('0x8'));var controller=require(_0x9427('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9427('0xa')](_0x9427('0xb'),auth[_0x9427('0xc')](),controller[_0x9427('0xd')]);router[_0x9427('0xe')]('/',auth[_0x9427('0xc')](),controller[_0x9427('0xf')]);router['put'](_0x9427('0xb'),auth[_0x9427('0xc')](),controller['update']);router['delete'](_0x9427('0xb'),auth[_0x9427('0xc')](),controller[_0x9427('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6a2c=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','util'];(function(_0x1b545b,_0x254f8b){var _0xdc3484=function(_0x213021){while(--_0x213021){_0x1b545b['push'](_0x1b545b['shift']());}};_0xdc3484(++_0x254f8b);}(_0x6a2c,0x8e));var _0xc6a2=function(_0xb1bf56,_0x1b8fde){_0xb1bf56=_0xb1bf56-0x0;var _0x26e7d6=_0x6a2c[_0xb1bf56];return _0x26e7d6;};'use strict';var multer=require(_0xc6a2('0x0'));var util=require(_0xc6a2('0x1'));var path=require(_0xc6a2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc6a2('0x3')]();var fs_extra=require(_0xc6a2('0x4'));var auth=require(_0xc6a2('0x5'));var interaction=require(_0xc6a2('0x6'));var config=require('../../config/environment');var controller=require(_0xc6a2('0x7'));router[_0xc6a2('0x8')]('/',auth[_0xc6a2('0x9')](),controller[_0xc6a2('0xa')]);router[_0xc6a2('0x8')](_0xc6a2('0xb'),auth['isAuthenticated'](),controller[_0xc6a2('0xc')]);router[_0xc6a2('0xd')]('/',auth[_0xc6a2('0x9')](),controller[_0xc6a2('0xe')]);router['put'](_0xc6a2('0xb'),auth[_0xc6a2('0x9')](),controller[_0xc6a2('0xf')]);router['delete'](_0xc6a2('0xb'),auth[_0xc6a2('0x9')](),controller[_0xc6a2('0x10')]);module[_0xc6a2('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 1544abd..743fa4a 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 _0x4caa=['sequelize','exports','ENUM','customVariable','picklist','string','STRING','variable','BOOLEAN'];(function(_0x2a6e35,_0x2f8fe1){var _0x438616=function(_0x5bca53){while(--_0x5bca53){_0x2a6e35['push'](_0x2a6e35['shift']());}};_0x438616(++_0x2f8fe1);}(_0x4caa,0xb4));var _0xa4ca=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0x4caa[_0x1e393b];return _0x3d0bfe;};'use strict';var Sequelize=require(_0xa4ca('0x0'));module[_0xa4ca('0x1')]={'type':{'type':Sequelize[_0xa4ca('0x2')]('string','variable',_0xa4ca('0x3'),'keyValue',_0xa4ca('0x4')),'defaultValue':_0xa4ca('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa4ca('0x6')]},'keyType':{'type':Sequelize[_0xa4ca('0x2')](_0xa4ca('0x5'),_0xa4ca('0x7'),_0xa4ca('0x3'))},'keyContent':{'type':Sequelize[_0xa4ca('0x6')]},'idField':{'type':Sequelize[_0xa4ca('0x6')]},'nameField':{'type':Sequelize[_0xa4ca('0x6')]},'customField':{'type':Sequelize[_0xa4ca('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa4ca('0x6')]}}; \ No newline at end of file +var _0x39dd=['BOOLEAN','exports','ENUM','string','variable','keyValue','picklist','customVariable','STRING'];(function(_0x4e860a,_0x50d0ff){var _0x11c1da=function(_0x211610){while(--_0x211610){_0x4e860a['push'](_0x4e860a['shift']());}};_0x11c1da(++_0x50d0ff);}(_0x39dd,0x121));var _0xd39d=function(_0x2527c9,_0x27a255){_0x2527c9=_0x2527c9-0x0;var _0x2a6628=_0x39dd[_0x2527c9];return _0x2a6628;};'use strict';var Sequelize=require('sequelize');module[_0xd39d('0x0')]={'type':{'type':Sequelize[_0xd39d('0x1')](_0xd39d('0x2'),_0xd39d('0x3'),'customVariable',_0xd39d('0x4'),_0xd39d('0x5')),'defaultValue':_0xd39d('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd39d('0x1')]('string',_0xd39d('0x3'),_0xd39d('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd39d('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd39d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd39d('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index e29332e..e91c54d 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 _0x1326=['status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','end','error','stack','name','index','map','ZendeskField','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','rows','catch','show','include','options','find','create','body','params','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x32c602,_0x262666){var _0x4951cf=function(_0x1eb162){while(--_0x1eb162){_0x32c602['push'](_0x32c602['shift']());}};_0x4951cf(++_0x262666);}(_0x1326,0x101));var _0x6132=function(_0x501401,_0x2d8737){_0x501401=_0x501401-0x0;var _0xfd0a47=_0x1326[_0x501401];return _0xfd0a47;};'use strict';var emlformat=require(_0x6132('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6132('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6132('0x2'));var moment=require(_0x6132('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6132('0x4'));var util=require('util');var path=require(_0x6132('0x5'));var sox=require(_0x6132('0x6'));var csv=require(_0x6132('0x7'));var ejs=require(_0x6132('0x8'));var fs=require('fs');var fs_extra=require(_0x6132('0x9'));var _=require('lodash');var squel=require(_0x6132('0xa'));var crypto=require(_0x6132('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6132('0xc'));var toCsv=require(_0x6132('0x7'));var querystring=require(_0x6132('0xd'));var Papa=require(_0x6132('0xe'));var Redis=require('ioredis');var authService=require(_0x6132('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6132('0x10'));var logger=require(_0x6132('0x11'))(_0x6132('0x12'));var utils=require('../../config/utils');var config=require(_0x6132('0x13'));var licenseUtil=require(_0x6132('0x14'));var db=require(_0x6132('0x15'))['db'];function respondWithStatusCode(_0x52ef99,_0x5b2667){_0x5b2667=_0x5b2667||0xcc;return function(_0x43df3a){if(_0x43df3a){return _0x52ef99[_0x6132('0x16')](_0x5b2667);}return _0x52ef99[_0x6132('0x17')](_0x5b2667)['end']();};}function respondWithResult(_0x52d09e,_0x58fa67){_0x58fa67=_0x58fa67||0xc8;return function(_0x39aa4b){if(_0x39aa4b){return _0x52d09e['status'](_0x58fa67)[_0x6132('0x18')](_0x39aa4b);}};}function respondWithFilteredResult(_0x7035b1,_0x36f22a){return function(_0xa59285){if(_0xa59285){var _0x2f97e3=typeof _0x36f22a[_0x6132('0x19')]===_0x6132('0x1a')&&typeof _0x36f22a[_0x6132('0x1b')]===_0x6132('0x1a');var _0x76031d=_0xa59285[_0x6132('0x1c')];var _0x3951d8=_0x2f97e3?0x0:_0x36f22a['offset'];var _0x22ff73=_0x2f97e3?_0xa59285[_0x6132('0x1c')]:_0x36f22a[_0x6132('0x19')]+_0x36f22a[_0x6132('0x1b')];var _0x5849ca;if(_0x22ff73>=_0x76031d){_0x22ff73=_0x76031d;_0x5849ca=0xc8;}else{_0x5849ca=0xce;}_0x7035b1[_0x6132('0x17')](_0x5849ca);return _0x7035b1[_0x6132('0x1d')](_0x6132('0x1e'),_0x3951d8+'-'+_0x22ff73+'/'+_0x76031d)[_0x6132('0x18')](_0xa59285);}return null;};}function patchUpdates(_0x375e65){return function(_0x3c21eb){try{jsonpatch[_0x6132('0x1f')](_0x3c21eb,_0x375e65,!![]);}catch(_0x46684a){return BPromise['reject'](_0x46684a);}return _0x3c21eb['save']();};}function saveUpdates(_0x2324e6,_0x57b0df){return function(_0x35a2d5){if(_0x35a2d5){return _0x35a2d5[_0x6132('0x20')](_0x2324e6)[_0x6132('0x21')](function(_0x3246db){return _0x3246db;});}return null;};}function removeEntity(_0xa47a6,_0x10cd4a){return function(_0x18ede6){if(_0x18ede6){return _0x18ede6[_0x6132('0x22')]()[_0x6132('0x21')](function(){_0xa47a6[_0x6132('0x17')](0xcc)[_0x6132('0x23')]();});}};}function handleEntityNotFound(_0x23eb1c,_0x166125){return function(_0x269a7e){if(!_0x269a7e){_0x23eb1c[_0x6132('0x16')](0x194);}return _0x269a7e;};}function handleError(_0x273b37,_0x3b3356){_0x3b3356=_0x3b3356||0x1f4;return function(_0x16442d){logger[_0x6132('0x24')](_0x16442d[_0x6132('0x25')]);if(_0x16442d[_0x6132('0x26')]){delete _0x16442d[_0x6132('0x26')];}_0x273b37[_0x6132('0x17')](_0x3b3356)['send'](_0x16442d);};}exports[_0x6132('0x27')]=function(_0x54ca32,_0x547bcf){var _0x140b40={},_0x256b21={},_0x33568e={'count':0x0,'rows':[]};var _0x216950=_[_0x6132('0x28')](db[_0x6132('0x29')][_0x6132('0x2a')],function(_0x2e6058){return{'name':_0x2e6058['fieldName'],'type':_0x2e6058['type']['key']};});_0x256b21[_0x6132('0x2b')]=_['map'](_0x216950,'name');_0x256b21['query']=_[_0x6132('0x2c')](_0x54ca32[_0x6132('0x2d')]);_0x256b21['filters']=_['intersection'](_0x256b21['model'],_0x256b21[_0x6132('0x2d')]);_0x140b40[_0x6132('0x2e')]=_[_0x6132('0x2f')](_0x256b21[_0x6132('0x2b')],qs[_0x6132('0x30')](_0x54ca32[_0x6132('0x2d')][_0x6132('0x30')]));_0x140b40[_0x6132('0x2e')]=_0x140b40['attributes'][_0x6132('0x31')]?_0x140b40['attributes']:_0x256b21['model'];if(!_0x54ca32[_0x6132('0x2d')][_0x6132('0x32')](_0x6132('0x33'))){_0x140b40[_0x6132('0x1b')]=qs['limit'](_0x54ca32[_0x6132('0x2d')]['limit']);_0x140b40[_0x6132('0x19')]=qs[_0x6132('0x19')](_0x54ca32[_0x6132('0x2d')][_0x6132('0x19')]);}_0x140b40[_0x6132('0x34')]=qs['sort'](_0x54ca32[_0x6132('0x2d')][_0x6132('0x35')]);_0x140b40[_0x6132('0x36')]=qs[_0x6132('0x37')](_[_0x6132('0x38')](_0x54ca32[_0x6132('0x2d')],_0x256b21['filters']),_0x216950);if(_0x54ca32[_0x6132('0x2d')]['filter']){_0x140b40[_0x6132('0x36')]=_[_0x6132('0x39')](_0x140b40[_0x6132('0x36')],{'$or':_[_0x6132('0x28')](_0x216950,function(_0xcbae7c){if(_0xcbae7c['type']!==_0x6132('0x3a')){var _0x1037bc={};_0x1037bc[_0xcbae7c['name']]={'$like':'%'+_0x54ca32['query'][_0x6132('0x3b')]+'%'};return _0x1037bc;}})});}_0x140b40=_[_0x6132('0x39')]({},_0x140b40,_0x54ca32['options']);var _0x445054={'where':_0x140b40[_0x6132('0x36')]};return db[_0x6132('0x29')]['count'](_0x445054)['then'](function(_0x510896){_0x33568e[_0x6132('0x1c')]=_0x510896;if(_0x54ca32[_0x6132('0x2d')][_0x6132('0x3c')]){_0x140b40['include']=[{'all':!![]}];}return db[_0x6132('0x29')]['findAll'](_0x140b40);})['then'](function(_0x4d5bf6){_0x33568e[_0x6132('0x3d')]=_0x4d5bf6;return _0x33568e;})[_0x6132('0x21')](respondWithFilteredResult(_0x547bcf,_0x140b40))[_0x6132('0x3e')](handleError(_0x547bcf,null));};exports[_0x6132('0x3f')]=function(_0x5c9513,_0x55ffe3){var _0x57b47a={'raw':!![],'where':{'id':_0x5c9513['params']['id']}},_0x36cbb7={};_0x36cbb7[_0x6132('0x2b')]=_[_0x6132('0x2c')](db[_0x6132('0x29')]['rawAttributes']);_0x36cbb7[_0x6132('0x2d')]=_['keys'](_0x5c9513[_0x6132('0x2d')]);_0x36cbb7['filters']=_[_0x6132('0x2f')](_0x36cbb7[_0x6132('0x2b')],_0x36cbb7[_0x6132('0x2d')]);_0x57b47a[_0x6132('0x2e')]=_[_0x6132('0x2f')](_0x36cbb7[_0x6132('0x2b')],qs[_0x6132('0x30')](_0x5c9513['query'][_0x6132('0x30')]));_0x57b47a[_0x6132('0x2e')]=_0x57b47a[_0x6132('0x2e')][_0x6132('0x31')]?_0x57b47a[_0x6132('0x2e')]:_0x36cbb7['model'];if(_0x5c9513[_0x6132('0x2d')][_0x6132('0x3c')]){_0x57b47a[_0x6132('0x40')]=[{'all':!![]}];}_0x57b47a=_[_0x6132('0x39')]({},_0x57b47a,_0x5c9513[_0x6132('0x41')]);return db[_0x6132('0x29')][_0x6132('0x42')](_0x57b47a)[_0x6132('0x21')](handleEntityNotFound(_0x55ffe3,null))[_0x6132('0x21')](respondWithResult(_0x55ffe3,null))[_0x6132('0x3e')](handleError(_0x55ffe3,null));};exports[_0x6132('0x43')]=function(_0xcdf12d,_0x353c37){return db[_0x6132('0x29')]['create'](_0xcdf12d['body'],{})['then'](respondWithResult(_0x353c37,0xc9))[_0x6132('0x3e')](handleError(_0x353c37,null));};exports[_0x6132('0x20')]=function(_0x143cf3,_0x294887){if(_0x143cf3['body']['id']){delete _0x143cf3[_0x6132('0x44')]['id'];}return db[_0x6132('0x29')][_0x6132('0x42')]({'where':{'id':_0x143cf3[_0x6132('0x45')]['id']}})[_0x6132('0x21')](handleEntityNotFound(_0x294887,null))['then'](saveUpdates(_0x143cf3['body'],null))['then'](respondWithResult(_0x294887,null))[_0x6132('0x3e')](handleError(_0x294887,null));};exports[_0x6132('0x22')]=function(_0x2196c7,_0x222391){return db[_0x6132('0x29')][_0x6132('0x42')]({'where':{'id':_0x2196c7[_0x6132('0x45')]['id']}})[_0x6132('0x21')](handleEntityNotFound(_0x222391,null))[_0x6132('0x21')](removeEntity(_0x222391,null))[_0x6132('0x3e')](handleError(_0x222391,null));}; \ No newline at end of file +var _0xf335=['json','offset','limit','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','keys','intersection','attributes','fields','query','length','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','params','filters','find','catch','create','body','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xf335,0x1c5));var _0x5f33=function(_0x50aba0,_0x12f94b){_0x50aba0=_0x50aba0-0x0;var _0x5a7dc7=_0xf335[_0x50aba0];return _0x5a7dc7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5f33('0x0'));var rp=require(_0x5f33('0x1'));var moment=require('moment');var BPromise=require(_0x5f33('0x2'));var Mustache=require(_0x5f33('0x3'));var util=require(_0x5f33('0x4'));var path=require(_0x5f33('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5f33('0x6'));var fs=require('fs');var fs_extra=require(_0x5f33('0x7'));var _=require(_0x5f33('0x8'));var squel=require(_0x5f33('0x9'));var crypto=require('crypto');var jsforce=require(_0x5f33('0xa'));var deskjs=require(_0x5f33('0xb'));var toCsv=require(_0x5f33('0xc'));var querystring=require(_0x5f33('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5f33('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f33('0xf'));var logger=require(_0x5f33('0x10'))(_0x5f33('0x11'));var utils=require(_0x5f33('0x12'));var config=require(_0x5f33('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f33('0x14'))['db'];function respondWithStatusCode(_0x3b95b9,_0x36855c){_0x36855c=_0x36855c||0xcc;return function(_0x5ecd55){if(_0x5ecd55){return _0x3b95b9['sendStatus'](_0x36855c);}return _0x3b95b9[_0x5f33('0x15')](_0x36855c)[_0x5f33('0x16')]();};}function respondWithResult(_0x2d7234,_0x35a0cc){_0x35a0cc=_0x35a0cc||0xc8;return function(_0x275f65){if(_0x275f65){return _0x2d7234[_0x5f33('0x15')](_0x35a0cc)[_0x5f33('0x17')](_0x275f65);}};}function respondWithFilteredResult(_0x1a3f85,_0x476b1f){return function(_0x402926){if(_0x402926){var _0x49cea6=typeof _0x476b1f[_0x5f33('0x18')]==='undefined'&&typeof _0x476b1f[_0x5f33('0x19')]==='undefined';var _0x4f5ea7=_0x402926[_0x5f33('0x1a')];var _0x8a0705=_0x49cea6?0x0:_0x476b1f[_0x5f33('0x18')];var _0x2b8d1c=_0x49cea6?_0x402926[_0x5f33('0x1a')]:_0x476b1f[_0x5f33('0x18')]+_0x476b1f['limit'];var _0x5f52f0;if(_0x2b8d1c>=_0x4f5ea7){_0x2b8d1c=_0x4f5ea7;_0x5f52f0=0xc8;}else{_0x5f52f0=0xce;}_0x1a3f85['status'](_0x5f52f0);return _0x1a3f85[_0x5f33('0x1b')](_0x5f33('0x1c'),_0x8a0705+'-'+_0x2b8d1c+'/'+_0x4f5ea7)[_0x5f33('0x17')](_0x402926);}return null;};}function patchUpdates(_0x405286){return function(_0x3350e9){try{jsonpatch[_0x5f33('0x1d')](_0x3350e9,_0x405286,!![]);}catch(_0x28f049){return BPromise['reject'](_0x28f049);}return _0x3350e9[_0x5f33('0x1e')]();};}function saveUpdates(_0x173a6e,_0x1ca437){return function(_0x196bc9){if(_0x196bc9){return _0x196bc9[_0x5f33('0x1f')](_0x173a6e)['then'](function(_0x4ec2ba){return _0x4ec2ba;});}return null;};}function removeEntity(_0x288ba2,_0x544251){return function(_0x5c131d){if(_0x5c131d){return _0x5c131d[_0x5f33('0x20')]()[_0x5f33('0x21')](function(){_0x288ba2[_0x5f33('0x15')](0xcc)[_0x5f33('0x16')]();});}};}function handleEntityNotFound(_0x2105a5,_0x37e905){return function(_0x221f5a){if(!_0x221f5a){_0x2105a5[_0x5f33('0x22')](0x194);}return _0x221f5a;};}function handleError(_0x446039,_0x598b0c){_0x598b0c=_0x598b0c||0x1f4;return function(_0x43126c){logger[_0x5f33('0x23')](_0x43126c[_0x5f33('0x24')]);if(_0x43126c[_0x5f33('0x25')]){delete _0x43126c['name'];}_0x446039['status'](_0x598b0c)['send'](_0x43126c);};}exports[_0x5f33('0x26')]=function(_0x1ad0ec,_0x319a1e){var _0x51247d={},_0x250ed0={},_0x5f1507={'count':0x0,'rows':[]};var _0x16252c=_[_0x5f33('0x27')](db[_0x5f33('0x28')][_0x5f33('0x29')],function(_0x1d4dcc){return{'name':_0x1d4dcc[_0x5f33('0x2a')],'type':_0x1d4dcc[_0x5f33('0x2b')][_0x5f33('0x2c')]};});_0x250ed0[_0x5f33('0x2d')]=_[_0x5f33('0x27')](_0x16252c,_0x5f33('0x25'));_0x250ed0['query']=_[_0x5f33('0x2e')](_0x1ad0ec['query']);_0x250ed0['filters']=_[_0x5f33('0x2f')](_0x250ed0[_0x5f33('0x2d')],_0x250ed0['query']);_0x51247d[_0x5f33('0x30')]=_['intersection'](_0x250ed0[_0x5f33('0x2d')],qs[_0x5f33('0x31')](_0x1ad0ec[_0x5f33('0x32')][_0x5f33('0x31')]));_0x51247d[_0x5f33('0x30')]=_0x51247d['attributes'][_0x5f33('0x33')]?_0x51247d[_0x5f33('0x30')]:_0x250ed0[_0x5f33('0x2d')];if(!_0x1ad0ec[_0x5f33('0x32')]['hasOwnProperty']('nolimit')){_0x51247d[_0x5f33('0x19')]=qs[_0x5f33('0x19')](_0x1ad0ec[_0x5f33('0x32')][_0x5f33('0x19')]);_0x51247d['offset']=qs[_0x5f33('0x18')](_0x1ad0ec[_0x5f33('0x32')][_0x5f33('0x18')]);}_0x51247d[_0x5f33('0x34')]=qs['sort'](_0x1ad0ec[_0x5f33('0x32')]['sort']);_0x51247d[_0x5f33('0x35')]=qs['filters'](_[_0x5f33('0x36')](_0x1ad0ec[_0x5f33('0x32')],_0x250ed0['filters']),_0x16252c);if(_0x1ad0ec[_0x5f33('0x32')]['filter']){_0x51247d[_0x5f33('0x35')]=_[_0x5f33('0x37')](_0x51247d['where'],{'$or':_['map'](_0x16252c,function(_0x256ca1){if(_0x256ca1['type']!==_0x5f33('0x38')){var _0x4dd396={};_0x4dd396[_0x256ca1[_0x5f33('0x25')]]={'$like':'%'+_0x1ad0ec[_0x5f33('0x32')][_0x5f33('0x39')]+'%'};return _0x4dd396;}})});}_0x51247d=_[_0x5f33('0x37')]({},_0x51247d,_0x1ad0ec[_0x5f33('0x3a')]);var _0x113b4f={'where':_0x51247d[_0x5f33('0x35')]};return db[_0x5f33('0x28')][_0x5f33('0x1a')](_0x113b4f)[_0x5f33('0x21')](function(_0x1fd170){_0x5f1507[_0x5f33('0x1a')]=_0x1fd170;if(_0x1ad0ec['query'][_0x5f33('0x3b')]){_0x51247d[_0x5f33('0x3c')]=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x51247d);})[_0x5f33('0x21')](function(_0x319dcf){_0x5f1507[_0x5f33('0x3d')]=_0x319dcf;return _0x5f1507;})[_0x5f33('0x21')](respondWithFilteredResult(_0x319a1e,_0x51247d))['catch'](handleError(_0x319a1e,null));};exports['show']=function(_0x48a44f,_0x3f7dd0){var _0x1241f5={'raw':!![],'where':{'id':_0x48a44f[_0x5f33('0x3e')]['id']}},_0x43cf2a={};_0x43cf2a[_0x5f33('0x2d')]=_[_0x5f33('0x2e')](db[_0x5f33('0x28')][_0x5f33('0x29')]);_0x43cf2a[_0x5f33('0x32')]=_[_0x5f33('0x2e')](_0x48a44f[_0x5f33('0x32')]);_0x43cf2a[_0x5f33('0x3f')]=_['intersection'](_0x43cf2a[_0x5f33('0x2d')],_0x43cf2a[_0x5f33('0x32')]);_0x1241f5[_0x5f33('0x30')]=_[_0x5f33('0x2f')](_0x43cf2a[_0x5f33('0x2d')],qs[_0x5f33('0x31')](_0x48a44f['query'][_0x5f33('0x31')]));_0x1241f5[_0x5f33('0x30')]=_0x1241f5[_0x5f33('0x30')][_0x5f33('0x33')]?_0x1241f5[_0x5f33('0x30')]:_0x43cf2a[_0x5f33('0x2d')];if(_0x48a44f[_0x5f33('0x32')][_0x5f33('0x3b')]){_0x1241f5['include']=[{'all':!![]}];}_0x1241f5=_[_0x5f33('0x37')]({},_0x1241f5,_0x48a44f['options']);return db[_0x5f33('0x28')][_0x5f33('0x40')](_0x1241f5)['then'](handleEntityNotFound(_0x3f7dd0,null))[_0x5f33('0x21')](respondWithResult(_0x3f7dd0,null))[_0x5f33('0x41')](handleError(_0x3f7dd0,null));};exports['create']=function(_0x429a00,_0x51853a){return db[_0x5f33('0x28')][_0x5f33('0x42')](_0x429a00[_0x5f33('0x43')],{})[_0x5f33('0x21')](respondWithResult(_0x51853a,0xc9))['catch'](handleError(_0x51853a,null));};exports[_0x5f33('0x1f')]=function(_0x2cc708,_0x3f74ee){if(_0x2cc708[_0x5f33('0x43')]['id']){delete _0x2cc708[_0x5f33('0x43')]['id'];}return db[_0x5f33('0x28')][_0x5f33('0x40')]({'where':{'id':_0x2cc708[_0x5f33('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3f74ee,null))[_0x5f33('0x21')](saveUpdates(_0x2cc708['body'],null))[_0x5f33('0x21')](respondWithResult(_0x3f74ee,null))[_0x5f33('0x41')](handleError(_0x3f74ee,null));};exports[_0x5f33('0x20')]=function(_0x2c66b1,_0x5a640f){return db['ZendeskField'][_0x5f33('0x40')]({'where':{'id':_0x2c66b1[_0x5f33('0x3e')]['id']}})[_0x5f33('0x21')](handleEntityNotFound(_0x5a640f,null))[_0x5f33('0x21')](removeEntity(_0x5a640f,null))[_0x5f33('0x41')](handleError(_0x5a640f,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 5ffc174..d0813c0 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 _0xea84=['./intZendeskField.attributes','exports','define','int_zendesk_fields','idField','FieldId','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x20049b,_0x369c8b){var _0x35cc83=function(_0x20a1eb){while(--_0x20a1eb){_0x20049b['push'](_0x20049b['shift']());}};_0x35cc83(++_0x369c8b);}(_0xea84,0xae));var _0x4ea8=function(_0x42523c,_0x479d43){_0x42523c=_0x42523c-0x0;var _0x1b849b=_0xea84[_0x42523c];return _0x1b849b;};'use strict';var _=require(_0x4ea8('0x0'));var util=require(_0x4ea8('0x1'));var logger=require('../../config/logger')(_0x4ea8('0x2'));var moment=require(_0x4ea8('0x3'));var BPromise=require('bluebird');var rp=require(_0x4ea8('0x4'));var fs=require('fs');var path=require(_0x4ea8('0x5'));var rimraf=require(_0x4ea8('0x6'));var config=require(_0x4ea8('0x7'));var attributes=require(_0x4ea8('0x8'));module[_0x4ea8('0x9')]=function(_0x3e74b4,_0x3c4e81){return _0x3e74b4[_0x4ea8('0xa')]('ZendeskField',attributes,{'tableName':_0x4ea8('0xb'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x4ea8('0xc'),_0x4ea8('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe227=['request-promise','path','rimraf','exports','define','ZendeskField','lodash','../../config/logger','api','moment','bluebird'];(function(_0x46689d,_0xc0982c){var _0x18e955=function(_0xe9b96e){while(--_0xe9b96e){_0x46689d['push'](_0x46689d['shift']());}};_0x18e955(++_0xc0982c);}(_0xe227,0xf8));var _0x7e22=function(_0x1e081a,_0x482d6b){_0x1e081a=_0x1e081a-0x0;var _0x428209=_0xe227[_0x1e081a];return _0x428209;};'use strict';var _=require(_0x7e22('0x0'));var util=require('util');var logger=require(_0x7e22('0x1'))(_0x7e22('0x2'));var moment=require(_0x7e22('0x3'));var BPromise=require(_0x7e22('0x4'));var rp=require(_0x7e22('0x5'));var fs=require('fs');var path=require(_0x7e22('0x6'));var rimraf=require(_0x7e22('0x7'));var config=require('../../config/environment');var attributes=require('./intZendeskField.attributes');module[_0x7e22('0x8')]=function(_0x1dec6a,_0xc7bc4b){return _0x1dec6a[_0x7e22('0x9')](_0x7e22('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 333417f..1b4aeb3 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 _0x8e78=['result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x8e78,0x116));var _0x88e7=function(_0x49da10,_0x876f32){_0x49da10=_0x49da10-0x0;var _0x38ec18=_0x8e78[_0x49da10];return _0x38ec18;};'use strict';var _=require('lodash');var util=require(_0x88e7('0x0'));var moment=require(_0x88e7('0x1'));var BPromise=require('bluebird');var rs=require(_0x88e7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x88e7('0x3'))['db'];var utils=require(_0x88e7('0x4'));var logger=require(_0x88e7('0x5'))(_0x88e7('0x6'));var config=require(_0x88e7('0x7'));var jayson=require(_0x88e7('0x8'));var client=jayson[_0x88e7('0x9')][_0x88e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x75dad9,_0x29f838,_0x297506){return new BPromise(function(_0x23af71,_0x1315e7){return client[_0x88e7('0xb')](_0x75dad9,_0x297506)[_0x88e7('0xc')](function(_0x41cf14){logger[_0x88e7('0xd')](_0x88e7('0xe'),_0x29f838,'request\x20sent');logger[_0x88e7('0xf')](_0x88e7('0x10'),_0x29f838,_0x88e7('0x11'),JSON[_0x88e7('0x12')](_0x41cf14));if(_0x41cf14[_0x88e7('0x13')]){if(_0x41cf14[_0x88e7('0x13')]['code']===0x1f4){logger[_0x88e7('0x13')]('ZendeskField,\x20%s,\x20%s',_0x29f838,_0x41cf14[_0x88e7('0x13')]['message']);return _0x1315e7(_0x41cf14[_0x88e7('0x13')][_0x88e7('0x14')]);}logger[_0x88e7('0x13')](_0x88e7('0xe'),_0x29f838,_0x41cf14[_0x88e7('0x13')][_0x88e7('0x14')]);return _0x23af71(_0x41cf14[_0x88e7('0x13')]['message']);}else{logger[_0x88e7('0xd')](_0x88e7('0xe'),_0x29f838,'request\x20sent');_0x23af71(_0x41cf14[_0x88e7('0x15')][_0x88e7('0x14')]);}})[_0x88e7('0x16')](function(_0x4079a8){logger[_0x88e7('0x13')](_0x88e7('0xe'),_0x29f838,_0x4079a8);_0x1315e7(_0x4079a8);});});} \ No newline at end of file +var _0xcd25=['error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x45c3a8,_0x2bffeb){var _0x4035a4=function(_0x2077a0){while(--_0x2077a0){_0x45c3a8['push'](_0x45c3a8['shift']());}};_0x4035a4(++_0x2bffeb);}(_0xcd25,0x156));var _0x5cd2=function(_0xa9c5bc,_0x9b773){_0xa9c5bc=_0xa9c5bc-0x0;var _0x59f66d=_0xcd25[_0xa9c5bc];return _0x59f66d;};'use strict';var _=require(_0x5cd2('0x0'));var util=require('util');var moment=require(_0x5cd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x5cd2('0x2'));var fs=require('fs');var Redis=require(_0x5cd2('0x3'));var db=require(_0x5cd2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5cd2('0x5'));var config=require(_0x5cd2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5cd2('0x7')][_0x5cd2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x141128,_0x2c5248,_0x30df67){return new BPromise(function(_0x3e5a7d,_0x23f57b){return client[_0x5cd2('0x9')](_0x141128,_0x30df67)[_0x5cd2('0xa')](function(_0x21d432){logger[_0x5cd2('0xb')]('ZendeskField,\x20%s,\x20%s',_0x2c5248,'request\x20sent');logger['debug'](_0x5cd2('0xc'),_0x2c5248,_0x5cd2('0xd'),JSON[_0x5cd2('0xe')](_0x21d432));if(_0x21d432['error']){if(_0x21d432[_0x5cd2('0xf')][_0x5cd2('0x10')]===0x1f4){logger[_0x5cd2('0xf')](_0x5cd2('0x11'),_0x2c5248,_0x21d432[_0x5cd2('0xf')][_0x5cd2('0x12')]);return _0x23f57b(_0x21d432[_0x5cd2('0xf')][_0x5cd2('0x12')]);}logger[_0x5cd2('0xf')](_0x5cd2('0x11'),_0x2c5248,_0x21d432[_0x5cd2('0xf')][_0x5cd2('0x12')]);return _0x3e5a7d(_0x21d432[_0x5cd2('0xf')][_0x5cd2('0x12')]);}else{logger[_0x5cd2('0xb')]('ZendeskField,\x20%s,\x20%s',_0x2c5248,_0x5cd2('0xd'));_0x3e5a7d(_0x21d432[_0x5cd2('0x13')][_0x5cd2('0x12')]);}})[_0x5cd2('0x14')](function(_0xe8b6c7){logger[_0x5cd2('0xf')]('ZendeskField,\x20%s,\x20%s',_0x2c5248,_0xe8b6c7);_0x23f57b(_0xe8b6c7);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 127eb7b..6b691cc 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 _0x5888=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','multer','util','path'];(function(_0x5a401e,_0x2de782){var _0x2aa2cc=function(_0x1150e7){while(--_0x1150e7){_0x5a401e['push'](_0x5a401e['shift']());}};_0x2aa2cc(++_0x2de782);}(_0x5888,0x15b));var _0x8588=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x5888[_0x3430aa];return _0x2ac5c;};'use strict';var multer=require(_0x8588('0x0'));var util=require(_0x8588('0x1'));var path=require(_0x8588('0x2'));var timeout=require(_0x8588('0x3'));var express=require(_0x8588('0x4'));var router=express[_0x8588('0x5')]();var fs_extra=require(_0x8588('0x6'));var auth=require(_0x8588('0x7'));var interaction=require(_0x8588('0x8'));var config=require('../../config/environment');var controller=require(_0x8588('0x9'));router[_0x8588('0xa')]('/',auth[_0x8588('0xb')](),controller[_0x8588('0xc')]);router[_0x8588('0xa')](_0x8588('0xd'),auth[_0x8588('0xb')](),controller[_0x8588('0xe')]);router[_0x8588('0xa')](_0x8588('0xf'),auth[_0x8588('0xb')](),controller[_0x8588('0x10')]);router[_0x8588('0xa')](_0x8588('0x11'),auth[_0x8588('0xb')](),controller[_0x8588('0x12')]);router[_0x8588('0x13')]('/',auth[_0x8588('0xb')](),controller['create']);router[_0x8588('0x13')]('/:id/configurations',auth[_0x8588('0xb')](),controller[_0x8588('0x14')]);router[_0x8588('0x15')](_0x8588('0xd'),auth[_0x8588('0xb')](),controller[_0x8588('0x16')]);router[_0x8588('0x17')](_0x8588('0xd'),auth[_0x8588('0xb')](),controller[_0x8588('0x18')]);module['exports']=router; \ No newline at end of file +var _0x133b=['getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show'];(function(_0x1058b0,_0x265204){var _0x48198f=function(_0x200b73){while(--_0x200b73){_0x1058b0['push'](_0x1058b0['shift']());}};_0x48198f(++_0x265204);}(_0x133b,0xe6));var _0xb133=function(_0xcbf410,_0x297dff){_0xcbf410=_0xcbf410-0x0;var _0xac51d0=_0x133b[_0xcbf410];return _0xac51d0;};'use strict';var multer=require(_0xb133('0x0'));var util=require(_0xb133('0x1'));var path=require(_0xb133('0x2'));var timeout=require(_0xb133('0x3'));var express=require(_0xb133('0x4'));var router=express[_0xb133('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb133('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0xb133('0x7')]('/',auth[_0xb133('0x8')](),controller[_0xb133('0x9')]);router[_0xb133('0x7')](_0xb133('0xa'),auth['isAuthenticated'](),controller[_0xb133('0xb')]);router[_0xb133('0x7')]('/:id/configurations',auth[_0xb133('0x8')](),controller[_0xb133('0xc')]);router['get'](_0xb133('0xd'),auth[_0xb133('0x8')](),controller[_0xb133('0xe')]);router[_0xb133('0xf')]('/',auth[_0xb133('0x8')](),controller[_0xb133('0x10')]);router[_0xb133('0xf')](_0xb133('0x11'),auth[_0xb133('0x8')](),controller['addConfiguration']);router[_0xb133('0x12')](_0xb133('0xa'),auth['isAuthenticated'](),controller[_0xb133('0x13')]);router[_0xb133('0x14')](_0xb133('0xa'),auth[_0xb133('0x8')](),controller[_0xb133('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index c6bb1ba..4919f78 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 _0xedd9=['exports','STRING'];(function(_0x448c00,_0x5939c4){var _0x2cd1e1=function(_0x28e254){while(--_0x28e254){_0x448c00['push'](_0x448c00['shift']());}};_0x2cd1e1(++_0x5939c4);}(_0xedd9,0xfc));var _0x9edd=function(_0x56e2f4,_0x1b6fd1){_0x56e2f4=_0x56e2f4-0x0;var _0x12d567=_0xedd9[_0x56e2f4];return _0x12d567;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'name':{'type':Sequelize[_0x9edd('0x1')]},'description':{'type':Sequelize[_0x9edd('0x1')]},'host':{'type':Sequelize[_0x9edd('0x1')]},'zone':{'type':Sequelize[_0x9edd('0x1')]},'clientId':{'type':Sequelize[_0x9edd('0x1')]},'clientSecret':{'type':Sequelize[_0x9edd('0x1')]},'serverUrl':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x9edd('0x1')]}}; \ No newline at end of file +var _0xdace=['STRING','sequelize'];(function(_0x3eb402,_0x8b173a){var _0x2fb496=function(_0x4340ee){while(--_0x4340ee){_0x3eb402['push'](_0x3eb402['shift']());}};_0x2fb496(++_0x8b173a);}(_0xdace,0xc5));var _0xedac=function(_0x363b81,_0x81e6ca){_0x363b81=_0x363b81-0x0;var _0x1d92fb=_0xdace[_0x363b81];return _0x1d92fb;};'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 diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 1482a80..1532aae 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 _0xbbdd=['system_mandatory','display_label','custom_field','data_type','pick_list_values','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','ZohoAccount','findAll','rows','show','params','includeAll','find','catch','create','body','getConfigurations','ZohoConfiguration','pick','addConfiguration','findOne','AccountId','Subjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','serverUrl','code','host','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name'];(function(_0x58102c,_0xb1253f){var _0x8e3288=function(_0x3fbeff){while(--_0x3fbeff){_0x58102c['push'](_0x58102c['shift']());}};_0x8e3288(++_0xb1253f);}(_0xbbdd,0x1a2));var _0xdbbd=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xbbdd[_0x1573ea];return _0x51c0e2;};'use strict';var emlformat=require(_0xdbbd('0x0'));var rimraf=require(_0xdbbd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdbbd('0x2'));var moment=require(_0xdbbd('0x3'));var BPromise=require(_0xdbbd('0x4'));var Mustache=require(_0xdbbd('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xdbbd('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdbbd('0x7'));var _=require(_0xdbbd('0x8'));var squel=require(_0xdbbd('0x9'));var crypto=require(_0xdbbd('0xa'));var jsforce=require(_0xdbbd('0xb'));var deskjs=require(_0xdbbd('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdbbd('0xd'));var Redis=require(_0xdbbd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdbbd('0xf'));var as=require(_0xdbbd('0x10'));var hardwareService=require(_0xdbbd('0x11'));var logger=require(_0xdbbd('0x12'))('api');var utils=require(_0xdbbd('0x13'));var config=require(_0xdbbd('0x14'));var licenseUtil=require(_0xdbbd('0x15'));var db=require(_0xdbbd('0x16'))['db'];var integrations=require(_0xdbbd('0x17'));function respondWithStatusCode(_0x177180,_0x52731c){_0x52731c=_0x52731c||0xcc;return function(_0x49d7d4){if(_0x49d7d4){return _0x177180[_0xdbbd('0x18')](_0x52731c);}return _0x177180['status'](_0x52731c)[_0xdbbd('0x19')]();};}function respondWithResult(_0x289897,_0x282e3b){_0x282e3b=_0x282e3b||0xc8;return function(_0x363a14){if(_0x363a14){return _0x289897[_0xdbbd('0x1a')](_0x282e3b)['json'](_0x363a14);}};}function respondWithFilteredResult(_0x5b8f07,_0x421a8b){return function(_0x22c118){if(_0x22c118){var _0x65cff7=typeof _0x421a8b[_0xdbbd('0x1b')]==='undefined'&&typeof _0x421a8b[_0xdbbd('0x1c')]===_0xdbbd('0x1d');var _0x370a1e=_0x22c118[_0xdbbd('0x1e')];var _0x47e109=_0x65cff7?0x0:_0x421a8b[_0xdbbd('0x1b')];var _0x326f90=_0x65cff7?_0x22c118['count']:_0x421a8b[_0xdbbd('0x1b')]+_0x421a8b['limit'];var _0x65ee94;if(_0x326f90>=_0x370a1e){_0x326f90=_0x370a1e;_0x65ee94=0xc8;}else{_0x65ee94=0xce;}_0x5b8f07[_0xdbbd('0x1a')](_0x65ee94);return _0x5b8f07[_0xdbbd('0x1f')](_0xdbbd('0x20'),_0x47e109+'-'+_0x326f90+'/'+_0x370a1e)['json'](_0x22c118);}return null;};}function patchUpdates(_0x14adbc){return function(_0x570d8d){try{jsonpatch[_0xdbbd('0x21')](_0x570d8d,_0x14adbc,!![]);}catch(_0x49b1a9){return BPromise[_0xdbbd('0x22')](_0x49b1a9);}return _0x570d8d[_0xdbbd('0x23')]();};}function saveUpdates(_0x3a074f,_0x5c3783){return function(_0x18c000){if(_0x18c000){return _0x18c000[_0xdbbd('0x24')](_0x3a074f)['then'](function(_0x4132d7){return _0x4132d7;});}return null;};}function removeEntity(_0xa5e82b,_0x38a401){return function(_0x4e7ef8){if(_0x4e7ef8){return _0x4e7ef8[_0xdbbd('0x25')]()[_0xdbbd('0x26')](function(){_0xa5e82b[_0xdbbd('0x1a')](0xcc)[_0xdbbd('0x19')]();});}};}function handleEntityNotFound(_0x4a1575,_0x499ce8){return function(_0x3af4d7){if(!_0x3af4d7){_0x4a1575['sendStatus'](0x194);}return _0x3af4d7;};}function handleError(_0x3495bc,_0x47a8e2){_0x47a8e2=_0x47a8e2||0x1f4;return function(_0x581a62){logger[_0xdbbd('0x27')](_0x581a62[_0xdbbd('0x28')]);if(_0x581a62['name']){delete _0x581a62[_0xdbbd('0x29')];}_0x3495bc['status'](_0x47a8e2)['send'](_0x581a62);};}exports[_0xdbbd('0x2a')]=function(_0x364df4,_0x3be765){var _0x268a89={},_0x43c355={},_0x4bc950={'count':0x0,'rows':[]};var _0x293ea0=_[_0xdbbd('0x2b')](db['ZohoAccount'][_0xdbbd('0x2c')],function(_0x277dee){return{'name':_0x277dee[_0xdbbd('0x2d')],'type':_0x277dee['type'][_0xdbbd('0x2e')]};});_0x43c355[_0xdbbd('0x2f')]=_[_0xdbbd('0x2b')](_0x293ea0,_0xdbbd('0x29'));_0x43c355[_0xdbbd('0x30')]=_[_0xdbbd('0x31')](_0x364df4[_0xdbbd('0x30')]);_0x43c355[_0xdbbd('0x32')]=_[_0xdbbd('0x33')](_0x43c355[_0xdbbd('0x2f')],_0x43c355[_0xdbbd('0x30')]);_0x268a89['attributes']=_[_0xdbbd('0x33')](_0x43c355[_0xdbbd('0x2f')],qs[_0xdbbd('0x34')](_0x364df4[_0xdbbd('0x30')][_0xdbbd('0x34')]));_0x268a89[_0xdbbd('0x35')]=_0x268a89[_0xdbbd('0x35')][_0xdbbd('0x36')]?_0x268a89[_0xdbbd('0x35')]:_0x43c355[_0xdbbd('0x2f')];if(!_0x364df4[_0xdbbd('0x30')][_0xdbbd('0x37')](_0xdbbd('0x38'))){_0x268a89['limit']=qs[_0xdbbd('0x1c')](_0x364df4[_0xdbbd('0x30')][_0xdbbd('0x1c')]);_0x268a89[_0xdbbd('0x1b')]=qs['offset'](_0x364df4[_0xdbbd('0x30')][_0xdbbd('0x1b')]);}_0x268a89[_0xdbbd('0x39')]=qs[_0xdbbd('0x3a')](_0x364df4['query']['sort']);_0x268a89[_0xdbbd('0x3b')]=qs['filters'](_['pick'](_0x364df4[_0xdbbd('0x30')],_0x43c355[_0xdbbd('0x32')]),_0x293ea0);if(_0x364df4['query'][_0xdbbd('0x3c')]){_0x268a89['where']=_[_0xdbbd('0x3d')](_0x268a89[_0xdbbd('0x3b')],{'$or':_[_0xdbbd('0x2b')](_0x293ea0,function(_0x4ec3a2){if(_0x4ec3a2[_0xdbbd('0x3e')]!==_0xdbbd('0x3f')){var _0x42789d={};_0x42789d[_0x4ec3a2[_0xdbbd('0x29')]]={'$like':'%'+_0x364df4[_0xdbbd('0x30')][_0xdbbd('0x3c')]+'%'};return _0x42789d;}})});}_0x268a89=_[_0xdbbd('0x3d')]({},_0x268a89,_0x364df4[_0xdbbd('0x40')]);var _0x49f6f1={'where':_0x268a89[_0xdbbd('0x3b')]};return db['ZohoAccount'][_0xdbbd('0x1e')](_0x49f6f1)[_0xdbbd('0x26')](function(_0x167309){_0x4bc950[_0xdbbd('0x1e')]=_0x167309;if(_0x364df4[_0xdbbd('0x30')]['includeAll']){_0x268a89[_0xdbbd('0x41')]=[{'all':!![]}];}return db[_0xdbbd('0x42')][_0xdbbd('0x43')](_0x268a89);})[_0xdbbd('0x26')](function(_0x46baaf){_0x4bc950[_0xdbbd('0x44')]=_0x46baaf;return _0x4bc950;})[_0xdbbd('0x26')](respondWithFilteredResult(_0x3be765,_0x268a89))['catch'](handleError(_0x3be765,null));};exports[_0xdbbd('0x45')]=function(_0x5153ee,_0x461946){var _0x522f6e={'raw':![],'where':{'id':_0x5153ee[_0xdbbd('0x46')]['id']}},_0x2e4859={};_0x2e4859[_0xdbbd('0x2f')]=_[_0xdbbd('0x31')](db[_0xdbbd('0x42')][_0xdbbd('0x2c')]);_0x2e4859[_0xdbbd('0x30')]=_['keys'](_0x5153ee[_0xdbbd('0x30')]);_0x2e4859[_0xdbbd('0x32')]=_[_0xdbbd('0x33')](_0x2e4859[_0xdbbd('0x2f')],_0x2e4859[_0xdbbd('0x30')]);_0x522f6e['attributes']=_[_0xdbbd('0x33')](_0x2e4859[_0xdbbd('0x2f')],qs[_0xdbbd('0x34')](_0x5153ee['query'][_0xdbbd('0x34')]));_0x522f6e[_0xdbbd('0x35')]=_0x522f6e[_0xdbbd('0x35')][_0xdbbd('0x36')]?_0x522f6e[_0xdbbd('0x35')]:_0x2e4859['model'];if(_0x5153ee['query'][_0xdbbd('0x47')]){_0x522f6e[_0xdbbd('0x41')]=[{'all':!![]}];}_0x522f6e=_['merge']({},_0x522f6e,_0x5153ee['options']);return db['ZohoAccount'][_0xdbbd('0x48')](_0x522f6e)[_0xdbbd('0x26')](handleEntityNotFound(_0x461946,null))[_0xdbbd('0x26')](respondWithResult(_0x461946,null))[_0xdbbd('0x49')](handleError(_0x461946,null));};exports[_0xdbbd('0x4a')]=function(_0x245310,_0x1b2a7a){return db['ZohoAccount'][_0xdbbd('0x4a')](_0x245310[_0xdbbd('0x4b')],{})['then'](respondWithResult(_0x1b2a7a,0xc9))[_0xdbbd('0x49')](handleError(_0x1b2a7a,null));};exports[_0xdbbd('0x24')]=function(_0x21b869,_0x3b51fa){if(_0x21b869[_0xdbbd('0x4b')]['id']){delete _0x21b869['body']['id'];}return db[_0xdbbd('0x42')][_0xdbbd('0x48')]({'where':{'id':_0x21b869[_0xdbbd('0x46')]['id']}})[_0xdbbd('0x26')](handleEntityNotFound(_0x3b51fa,null))[_0xdbbd('0x26')](saveUpdates(_0x21b869['body'],null))[_0xdbbd('0x26')](respondWithResult(_0x3b51fa,null))['catch'](handleError(_0x3b51fa,null));};exports[_0xdbbd('0x25')]=function(_0x5bbcb9,_0x2d8442){return db[_0xdbbd('0x42')][_0xdbbd('0x48')]({'where':{'id':_0x5bbcb9['params']['id']}})[_0xdbbd('0x26')](handleEntityNotFound(_0x2d8442,null))[_0xdbbd('0x26')](removeEntity(_0x2d8442,null))[_0xdbbd('0x49')](handleError(_0x2d8442,null));};exports[_0xdbbd('0x4c')]=function(_0xb4c553,_0x2bdcfe,_0x3a3d8b){var _0x151d02={};var _0x584fc3={};var _0x29e481;var _0x50251a;return db[_0xdbbd('0x42')]['findOne']({'where':{'id':_0xb4c553[_0xdbbd('0x46')]['id']}})['then'](handleEntityNotFound(_0x2bdcfe,null))['then'](function(_0x473276){if(_0x473276){_0x29e481=_0x473276;_0x584fc3[_0xdbbd('0x2f')]=_['keys'](db[_0xdbbd('0x4d')][_0xdbbd('0x2c')]);_0x584fc3[_0xdbbd('0x30')]=_['keys'](_0xb4c553[_0xdbbd('0x30')]);_0x584fc3[_0xdbbd('0x32')]=_[_0xdbbd('0x33')](_0x584fc3['model'],_0x584fc3[_0xdbbd('0x30')]);_0x151d02[_0xdbbd('0x35')]=_['intersection'](_0x584fc3[_0xdbbd('0x2f')],qs[_0xdbbd('0x34')](_0xb4c553[_0xdbbd('0x30')][_0xdbbd('0x34')]));_0x151d02[_0xdbbd('0x35')]=_0x151d02[_0xdbbd('0x35')][_0xdbbd('0x36')]?_0x151d02[_0xdbbd('0x35')]:_0x584fc3[_0xdbbd('0x2f')];_0x151d02['order']=qs['sort'](_0xb4c553[_0xdbbd('0x30')][_0xdbbd('0x3a')]);_0x151d02[_0xdbbd('0x3b')]=qs[_0xdbbd('0x32')](_[_0xdbbd('0x4e')](_0xb4c553[_0xdbbd('0x30')],_0x584fc3['filters']));if(_0xb4c553[_0xdbbd('0x30')][_0xdbbd('0x3c')]){_0x151d02[_0xdbbd('0x3b')]=_[_0xdbbd('0x3d')](_0x151d02['where'],{'$or':_['map'](_0x151d02[_0xdbbd('0x35')],function(_0x35c6c5){var _0x19454d={};_0x19454d[_0x35c6c5]={'$like':'%'+_0xb4c553['query'][_0xdbbd('0x3c')]+'%'};return _0x19454d;})});}_0x151d02=_['merge']({},_0x151d02,_0xb4c553['options']);return _0x29e481[_0xdbbd('0x4c')](_0x151d02);}})['then'](function(_0x8d387a){if(_0x8d387a){_0x50251a=_0x8d387a[_0xdbbd('0x36')];if(!_0xb4c553['query'][_0xdbbd('0x37')]('nolimit')){_0x151d02[_0xdbbd('0x1c')]=qs[_0xdbbd('0x1c')](_0xb4c553[_0xdbbd('0x30')][_0xdbbd('0x1c')]);_0x151d02[_0xdbbd('0x1b')]=qs['offset'](_0xb4c553[_0xdbbd('0x30')][_0xdbbd('0x1b')]);}return _0x29e481[_0xdbbd('0x4c')](_0x151d02);}})['then'](function(_0x229e7c){if(_0x229e7c){return _0x229e7c?{'count':_0x50251a,'rows':_0x229e7c}:null;}})[_0xdbbd('0x26')](respondWithResult(_0x2bdcfe,null))[_0xdbbd('0x49')](handleError(_0x2bdcfe,null));};exports[_0xdbbd('0x4f')]=function(_0x443ebc,_0x32f4f1,_0x4dfe41){if(_0x443ebc[_0xdbbd('0x4b')]['id']){delete _0x443ebc[_0xdbbd('0x4b')]['id'];}return db[_0xdbbd('0x42')][_0xdbbd('0x50')]({'where':{'id':_0x443ebc[_0xdbbd('0x46')]['id']}})['then'](handleEntityNotFound(_0x32f4f1,null))['then'](function(_0x14719a){if(_0x14719a){_0x443ebc[_0xdbbd('0x4b')][_0xdbbd('0x51')]=_0x14719a['id'];_0x443ebc[_0xdbbd('0x4b')][_0xdbbd('0x52')]=integrations['getSubjects'](_0x443ebc[_0xdbbd('0x4b')]['channel'],_0x443ebc['body'][_0xdbbd('0x3e')]);_0x443ebc[_0xdbbd('0x4b')][_0xdbbd('0x53')]=integrations[_0xdbbd('0x54')](_0x443ebc['body'][_0xdbbd('0x55')],_0x443ebc[_0xdbbd('0x4b')][_0xdbbd('0x3e')]);return db['ZohoConfiguration']['create'](_0x443ebc[_0xdbbd('0x4b')],{'include':[{'model':db[_0xdbbd('0x56')],'as':_0xdbbd('0x52')},{'model':db[_0xdbbd('0x56')],'as':_0xdbbd('0x53')}]});}return null;})[_0xdbbd('0x26')](respondWithResult(_0x32f4f1,null))[_0xdbbd('0x49')](handleError(_0x32f4f1,null));};function getAccessToken(_0x35f0be){return new Promise(function(_0xf6a1d0,_0x3b1e4f){var _0x1d94bc;switch(_0x35f0be[_0xdbbd('0x57')]){case'US':_0x1d94bc=_0xdbbd('0x58');break;case'AU':_0x1d94bc=_0xdbbd('0x59');break;case'EU':_0x1d94bc=_0xdbbd('0x5a');break;case'IN':_0x1d94bc=_0xdbbd('0x5b');break;case'CN':_0x1d94bc=_0xdbbd('0x5c');break;default:_0x1d94bc=_0xdbbd('0x5a');break;}var _0x1c55fd={'method':_0xdbbd('0x5d'),'uri':_0x1d94bc+_0xdbbd('0x5e'),'qs':{'refresh_token':_0x35f0be[_0xdbbd('0x5f')],'client_id':_0x35f0be[_0xdbbd('0x60')],'client_secret':_0x35f0be[_0xdbbd('0x61')],'grant_type':_0xdbbd('0x62')},'json':!![]};return rp(_0x1c55fd)['then'](function(_0x75ea5f){if(_0x75ea5f['access_token']){_0xf6a1d0(_0x75ea5f[_0xdbbd('0x63')]);}else{_0x3b1e4f(_0xdbbd('0x64'));}})[_0xdbbd('0x49')](function(_0x342223){_0x3b1e4f(_0x342223);});});}exports[_0xdbbd('0x65')]=function(_0x50e411,_0x45207b,_0x3952c3){var _0x541f92,_0x1f4b9d,_0x5e07da,_0x3516d2,_0x5780f5;return db[_0xdbbd('0x42')]['findOne']({'where':{'id':_0x50e411['params']['id']},'attributes':['id','host',_0xdbbd('0x57'),_0xdbbd('0x60'),_0xdbbd('0x61'),_0xdbbd('0x66'),_0xdbbd('0x67'),_0xdbbd('0x5f')]})[_0xdbbd('0x26')](handleEntityNotFound(_0x45207b,null))[_0xdbbd('0x26')](function(_0x23b6c5){_0x5780f5=_0x23b6c5;_0x541f92=_0x5780f5[_0xdbbd('0x68')];_0x1f4b9d=_0x541f92===_0xdbbd('0x69')?'eu':'com';_0x5e07da=_0x5780f5['serverUrl'];var _0x77aee3=_0x5e07da[_0xdbbd('0x6a')](-0x1);if(_0x77aee3==='/'||_0x77aee3==='\x5c'||_0x77aee3===':'){_0x5e07da=_0x5e07da[_0xdbbd('0x6b')](0x0,_0x5e07da[_0xdbbd('0x6c')](_0x77aee3));}if(!_0x5780f5[_0xdbbd('0x5f')]){throw new Error(_0xdbbd('0x6d'));}return getAccessToken(_0x5780f5);})[_0xdbbd('0x26')](function(_0x56f15f){if(_0x56f15f){return rp({'method':_0xdbbd('0x6e'),'uri':util[_0xdbbd('0x6f')](_0xdbbd('0x70'),_0x1f4b9d),'qs':{'module':'Calls'},'headers':{'Authorization':_0xdbbd('0x71')+_0x56f15f},'json':!![]});}})[_0xdbbd('0x26')](function(_0x10b493){if(_0x10b493){if(_0x10b493[_0xdbbd('0x72')]&&_0x10b493[_0xdbbd('0x72')][_0xdbbd('0x27')]){throw new Error(_0x10b493[_0xdbbd('0x72')]['error'][_0xdbbd('0x73')]);}var _0x124970=[];var _0x87a630=[];var _0x257ff4=[_0xdbbd('0x74'),_0xdbbd('0x75'),_0xdbbd('0x76'),_0xdbbd('0x77'),_0xdbbd('0x78'),_0xdbbd('0x79'),_0xdbbd('0x7a'),_0xdbbd('0x7b')];_0x87a630=_['remove'](_0x10b493[_0xdbbd('0x34')],function(_0x50705e){return _0x257ff4[_0xdbbd('0x7c')](_0x50705e[_0xdbbd('0x7d')]);});for(var _0x531598=0x0;_0x531598<_0x87a630['length'];_0x531598++){if(_0x87a630[_0x531598][_0xdbbd('0x7e')]===![]){_0x124970['push']({'id':_0x87a630[_0x531598]['id'],'name':_0x87a630[_0x531598][_0xdbbd('0x7f')],'custom':_0x87a630[_0x531598][_0xdbbd('0x80')],'options':_0x87a630[_0x531598][_0xdbbd('0x81')]==='picklist'&&_0x87a630[_0x531598][_0xdbbd('0x82')][_0xdbbd('0x36')]>-0x1?_[_0xdbbd('0x2b')](_0x87a630[_0x531598][_0xdbbd('0x82')],function(_0x5d6d74){return{'name':_0x5d6d74,'value':_0x5d6d74};}):[]});}}return{'count':_0x124970[_0xdbbd('0x36')],'rows':_0x124970};}else{return{'count':0x0,'rows':[]};}})[_0xdbbd('0x26')](respondWithResult(_0x45207b,null))[_0xdbbd('0x49')](function(_0xc7f42b){var _0x30d233=_0x50e411[_0xdbbd('0x30')][_0xdbbd('0x83')]?0x1f4:_0xc7f42b[_0xdbbd('0x84')]||0x1f4;logger[_0xdbbd('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xdbbd('0x65'),_0x30d233,JSON[_0xdbbd('0x85')](_0xc7f42b));delete _0xc7f42b[_0xdbbd('0x29')];if(_0x30d233===0x191){_0x30d233=0x190;}_0x45207b[_0xdbbd('0x1a')](_0x30d233)[_0xdbbd('0x86')](_0x50e411[_0xdbbd('0x30')][_0xdbbd('0x83')]?{'message':_0xdbbd('0x87'),'statusCode':_0xc7f42b['statusCode']}:_0xc7f42b);});}; \ No newline at end of file +var _0xa7c9=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','order','getConfigurations','addConfiguration','findOne','AccountId','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','clientId','code','zoho.eu','com','serverUrl','slice','substring','lastIndexOf','format','https://www.zohoapis.%s/crm/v2/settings/fields','response','message','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','test','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x24a42c,_0x269abd){var _0x253606=function(_0x18cc95){while(--_0x18cc95){_0x24a42c['push'](_0x24a42c['shift']());}};_0x253606(++_0x269abd);}(_0xa7c9,0x175));var _0x9a7c=function(_0x1ea944,_0x3cc08d){_0x1ea944=_0x1ea944-0x0;var _0x4357af=_0xa7c9[_0x1ea944];return _0x4357af;};'use strict';var emlformat=require(_0x9a7c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a7c('0x1'));var jsonpatch=require(_0x9a7c('0x2'));var rp=require(_0x9a7c('0x3'));var moment=require(_0x9a7c('0x4'));var BPromise=require(_0x9a7c('0x5'));var Mustache=require(_0x9a7c('0x6'));var util=require(_0x9a7c('0x7'));var path=require(_0x9a7c('0x8'));var sox=require('sox');var csv=require(_0x9a7c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a7c('0xa'));var squel=require('squel');var crypto=require(_0x9a7c('0xb'));var jsforce=require(_0x9a7c('0xc'));var deskjs=require(_0x9a7c('0xd'));var toCsv=require(_0x9a7c('0x9'));var querystring=require(_0x9a7c('0xe'));var Papa=require('papaparse');var Redis=require(_0x9a7c('0xf'));var authService=require(_0x9a7c('0x10'));var qs=require(_0x9a7c('0x11'));var as=require(_0x9a7c('0x12'));var hardwareService=require(_0x9a7c('0x13'));var logger=require('../../config/logger')(_0x9a7c('0x14'));var utils=require(_0x9a7c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9a7c('0x16'));var db=require(_0x9a7c('0x17'))['db'];var integrations=require(_0x9a7c('0x18'));function respondWithStatusCode(_0x3c30b1,_0x2d077d){_0x2d077d=_0x2d077d||0xcc;return function(_0x50f8e5){if(_0x50f8e5){return _0x3c30b1[_0x9a7c('0x19')](_0x2d077d);}return _0x3c30b1[_0x9a7c('0x1a')](_0x2d077d)[_0x9a7c('0x1b')]();};}function respondWithResult(_0xd91d9b,_0x18f7e3){_0x18f7e3=_0x18f7e3||0xc8;return function(_0xc18cc1){if(_0xc18cc1){return _0xd91d9b[_0x9a7c('0x1a')](_0x18f7e3)[_0x9a7c('0x1c')](_0xc18cc1);}};}function respondWithFilteredResult(_0x4adaf0,_0x3884a8){return function(_0x29e388){if(_0x29e388){var _0x8011de=typeof _0x3884a8[_0x9a7c('0x1d')]===_0x9a7c('0x1e')&&typeof _0x3884a8['limit']===_0x9a7c('0x1e');var _0x159867=_0x29e388[_0x9a7c('0x1f')];var _0x2dda55=_0x8011de?0x0:_0x3884a8[_0x9a7c('0x1d')];var _0x39a2b0=_0x8011de?_0x29e388['count']:_0x3884a8['offset']+_0x3884a8[_0x9a7c('0x20')];var _0x4b160;if(_0x39a2b0>=_0x159867){_0x39a2b0=_0x159867;_0x4b160=0xc8;}else{_0x4b160=0xce;}_0x4adaf0['status'](_0x4b160);return _0x4adaf0[_0x9a7c('0x21')](_0x9a7c('0x22'),_0x2dda55+'-'+_0x39a2b0+'/'+_0x159867)[_0x9a7c('0x1c')](_0x29e388);}return null;};}function patchUpdates(_0xe07463){return function(_0x3642bc){try{jsonpatch[_0x9a7c('0x23')](_0x3642bc,_0xe07463,!![]);}catch(_0x218a5a){return BPromise[_0x9a7c('0x24')](_0x218a5a);}return _0x3642bc['save']();};}function saveUpdates(_0x34491a,_0x20bb78){return function(_0x20ef67){if(_0x20ef67){return _0x20ef67[_0x9a7c('0x25')](_0x34491a)[_0x9a7c('0x26')](function(_0x4d8de3){return _0x4d8de3;});}return null;};}function removeEntity(_0x2e1571,_0x154a43){return function(_0x198678){if(_0x198678){return _0x198678[_0x9a7c('0x27')]()[_0x9a7c('0x26')](function(){_0x2e1571[_0x9a7c('0x1a')](0xcc)[_0x9a7c('0x1b')]();});}};}function handleEntityNotFound(_0x277594,_0x24f682){return function(_0x599305){if(!_0x599305){_0x277594['sendStatus'](0x194);}return _0x599305;};}function handleError(_0x4efe0a,_0x58a5b9){_0x58a5b9=_0x58a5b9||0x1f4;return function(_0x5b39a8){logger[_0x9a7c('0x28')](_0x5b39a8[_0x9a7c('0x29')]);if(_0x5b39a8[_0x9a7c('0x2a')]){delete _0x5b39a8[_0x9a7c('0x2a')];}_0x4efe0a[_0x9a7c('0x1a')](_0x58a5b9)[_0x9a7c('0x2b')](_0x5b39a8);};}exports[_0x9a7c('0x2c')]=function(_0x36e17e,_0x55721d){var _0x344585={},_0x5a6bd3={},_0x481c3c={'count':0x0,'rows':[]};var _0x5efbc1=_[_0x9a7c('0x2d')](db[_0x9a7c('0x2e')][_0x9a7c('0x2f')],function(_0xaba7){return{'name':_0xaba7[_0x9a7c('0x30')],'type':_0xaba7[_0x9a7c('0x31')][_0x9a7c('0x32')]};});_0x5a6bd3[_0x9a7c('0x33')]=_[_0x9a7c('0x2d')](_0x5efbc1,_0x9a7c('0x2a'));_0x5a6bd3[_0x9a7c('0x34')]=_[_0x9a7c('0x35')](_0x36e17e[_0x9a7c('0x34')]);_0x5a6bd3[_0x9a7c('0x36')]=_['intersection'](_0x5a6bd3[_0x9a7c('0x33')],_0x5a6bd3[_0x9a7c('0x34')]);_0x344585[_0x9a7c('0x37')]=_[_0x9a7c('0x38')](_0x5a6bd3[_0x9a7c('0x33')],qs[_0x9a7c('0x39')](_0x36e17e[_0x9a7c('0x34')][_0x9a7c('0x39')]));_0x344585['attributes']=_0x344585['attributes'][_0x9a7c('0x3a')]?_0x344585[_0x9a7c('0x37')]:_0x5a6bd3[_0x9a7c('0x33')];if(!_0x36e17e[_0x9a7c('0x34')][_0x9a7c('0x3b')](_0x9a7c('0x3c'))){_0x344585[_0x9a7c('0x20')]=qs[_0x9a7c('0x20')](_0x36e17e['query'][_0x9a7c('0x20')]);_0x344585[_0x9a7c('0x1d')]=qs[_0x9a7c('0x1d')](_0x36e17e[_0x9a7c('0x34')][_0x9a7c('0x1d')]);}_0x344585['order']=qs[_0x9a7c('0x3d')](_0x36e17e[_0x9a7c('0x34')]['sort']);_0x344585['where']=qs[_0x9a7c('0x36')](_[_0x9a7c('0x3e')](_0x36e17e[_0x9a7c('0x34')],_0x5a6bd3['filters']),_0x5efbc1);if(_0x36e17e[_0x9a7c('0x34')][_0x9a7c('0x3f')]){_0x344585[_0x9a7c('0x40')]=_[_0x9a7c('0x41')](_0x344585[_0x9a7c('0x40')],{'$or':_[_0x9a7c('0x2d')](_0x5efbc1,function(_0x23dd82){if(_0x23dd82[_0x9a7c('0x31')]!=='VIRTUAL'){var _0x4334f9={};_0x4334f9[_0x23dd82[_0x9a7c('0x2a')]]={'$like':'%'+_0x36e17e[_0x9a7c('0x34')][_0x9a7c('0x3f')]+'%'};return _0x4334f9;}})});}_0x344585=_[_0x9a7c('0x41')]({},_0x344585,_0x36e17e['options']);var _0x367971={'where':_0x344585[_0x9a7c('0x40')]};return db[_0x9a7c('0x2e')][_0x9a7c('0x1f')](_0x367971)['then'](function(_0x1aa336){_0x481c3c[_0x9a7c('0x1f')]=_0x1aa336;if(_0x36e17e[_0x9a7c('0x34')][_0x9a7c('0x42')]){_0x344585[_0x9a7c('0x43')]=[{'all':!![]}];}return db['ZohoAccount'][_0x9a7c('0x44')](_0x344585);})[_0x9a7c('0x26')](function(_0x50eeb1){_0x481c3c[_0x9a7c('0x45')]=_0x50eeb1;return _0x481c3c;})[_0x9a7c('0x26')](respondWithFilteredResult(_0x55721d,_0x344585))[_0x9a7c('0x46')](handleError(_0x55721d,null));};exports[_0x9a7c('0x47')]=function(_0x2cb982,_0x36bc21){var _0x24e48a={'raw':![],'where':{'id':_0x2cb982['params']['id']}},_0x1af714={};_0x1af714[_0x9a7c('0x33')]=_['keys'](db[_0x9a7c('0x2e')][_0x9a7c('0x2f')]);_0x1af714[_0x9a7c('0x34')]=_[_0x9a7c('0x35')](_0x2cb982[_0x9a7c('0x34')]);_0x1af714['filters']=_[_0x9a7c('0x38')](_0x1af714[_0x9a7c('0x33')],_0x1af714[_0x9a7c('0x34')]);_0x24e48a[_0x9a7c('0x37')]=_[_0x9a7c('0x38')](_0x1af714[_0x9a7c('0x33')],qs[_0x9a7c('0x39')](_0x2cb982['query'][_0x9a7c('0x39')]));_0x24e48a[_0x9a7c('0x37')]=_0x24e48a['attributes']['length']?_0x24e48a[_0x9a7c('0x37')]:_0x1af714[_0x9a7c('0x33')];if(_0x2cb982['query']['includeAll']){_0x24e48a[_0x9a7c('0x43')]=[{'all':!![]}];}_0x24e48a=_[_0x9a7c('0x41')]({},_0x24e48a,_0x2cb982[_0x9a7c('0x48')]);return db['ZohoAccount'][_0x9a7c('0x49')](_0x24e48a)['then'](handleEntityNotFound(_0x36bc21,null))[_0x9a7c('0x26')](respondWithResult(_0x36bc21,null))[_0x9a7c('0x46')](handleError(_0x36bc21,null));};exports[_0x9a7c('0x4a')]=function(_0x1b4137,_0x41e712){return db[_0x9a7c('0x2e')]['create'](_0x1b4137[_0x9a7c('0x4b')],{})[_0x9a7c('0x26')](respondWithResult(_0x41e712,0xc9))[_0x9a7c('0x46')](handleError(_0x41e712,null));};exports[_0x9a7c('0x25')]=function(_0x44ae3f,_0x11182f){if(_0x44ae3f[_0x9a7c('0x4b')]['id']){delete _0x44ae3f[_0x9a7c('0x4b')]['id'];}return db[_0x9a7c('0x2e')][_0x9a7c('0x49')]({'where':{'id':_0x44ae3f['params']['id']}})[_0x9a7c('0x26')](handleEntityNotFound(_0x11182f,null))[_0x9a7c('0x26')](saveUpdates(_0x44ae3f['body'],null))[_0x9a7c('0x26')](respondWithResult(_0x11182f,null))[_0x9a7c('0x46')](handleError(_0x11182f,null));};exports[_0x9a7c('0x27')]=function(_0x183400,_0x56c2f5){return db[_0x9a7c('0x2e')][_0x9a7c('0x49')]({'where':{'id':_0x183400[_0x9a7c('0x4c')]['id']}})[_0x9a7c('0x26')](handleEntityNotFound(_0x56c2f5,null))[_0x9a7c('0x26')](removeEntity(_0x56c2f5,null))[_0x9a7c('0x46')](handleError(_0x56c2f5,null));};exports['getConfigurations']=function(_0x184363,_0x29067f,_0x4c3fea){var _0x36dcf3={};var _0x1f17a2={};var _0x4058ef;var _0x591f81;return db[_0x9a7c('0x2e')]['findOne']({'where':{'id':_0x184363[_0x9a7c('0x4c')]['id']}})[_0x9a7c('0x26')](handleEntityNotFound(_0x29067f,null))[_0x9a7c('0x26')](function(_0x341a71){if(_0x341a71){_0x4058ef=_0x341a71;_0x1f17a2[_0x9a7c('0x33')]=_[_0x9a7c('0x35')](db['ZohoConfiguration'][_0x9a7c('0x2f')]);_0x1f17a2[_0x9a7c('0x34')]=_['keys'](_0x184363['query']);_0x1f17a2[_0x9a7c('0x36')]=_[_0x9a7c('0x38')](_0x1f17a2[_0x9a7c('0x33')],_0x1f17a2[_0x9a7c('0x34')]);_0x36dcf3[_0x9a7c('0x37')]=_[_0x9a7c('0x38')](_0x1f17a2[_0x9a7c('0x33')],qs[_0x9a7c('0x39')](_0x184363[_0x9a7c('0x34')][_0x9a7c('0x39')]));_0x36dcf3[_0x9a7c('0x37')]=_0x36dcf3[_0x9a7c('0x37')][_0x9a7c('0x3a')]?_0x36dcf3[_0x9a7c('0x37')]:_0x1f17a2[_0x9a7c('0x33')];_0x36dcf3[_0x9a7c('0x4d')]=qs[_0x9a7c('0x3d')](_0x184363[_0x9a7c('0x34')][_0x9a7c('0x3d')]);_0x36dcf3[_0x9a7c('0x40')]=qs[_0x9a7c('0x36')](_[_0x9a7c('0x3e')](_0x184363['query'],_0x1f17a2[_0x9a7c('0x36')]));if(_0x184363[_0x9a7c('0x34')][_0x9a7c('0x3f')]){_0x36dcf3[_0x9a7c('0x40')]=_[_0x9a7c('0x41')](_0x36dcf3[_0x9a7c('0x40')],{'$or':_[_0x9a7c('0x2d')](_0x36dcf3[_0x9a7c('0x37')],function(_0x5e4503){var _0x543268={};_0x543268[_0x5e4503]={'$like':'%'+_0x184363[_0x9a7c('0x34')]['filter']+'%'};return _0x543268;})});}_0x36dcf3=_[_0x9a7c('0x41')]({},_0x36dcf3,_0x184363[_0x9a7c('0x48')]);return _0x4058ef[_0x9a7c('0x4e')](_0x36dcf3);}})[_0x9a7c('0x26')](function(_0x574018){if(_0x574018){_0x591f81=_0x574018[_0x9a7c('0x3a')];if(!_0x184363['query'][_0x9a7c('0x3b')](_0x9a7c('0x3c'))){_0x36dcf3[_0x9a7c('0x20')]=qs[_0x9a7c('0x20')](_0x184363['query'][_0x9a7c('0x20')]);_0x36dcf3['offset']=qs['offset'](_0x184363[_0x9a7c('0x34')][_0x9a7c('0x1d')]);}return _0x4058ef[_0x9a7c('0x4e')](_0x36dcf3);}})[_0x9a7c('0x26')](function(_0x46a36a){if(_0x46a36a){return _0x46a36a?{'count':_0x591f81,'rows':_0x46a36a}:null;}})[_0x9a7c('0x26')](respondWithResult(_0x29067f,null))['catch'](handleError(_0x29067f,null));};exports[_0x9a7c('0x4f')]=function(_0x296e6d,_0x4d7a04,_0x1affee){if(_0x296e6d[_0x9a7c('0x4b')]['id']){delete _0x296e6d[_0x9a7c('0x4b')]['id'];}return db[_0x9a7c('0x2e')][_0x9a7c('0x50')]({'where':{'id':_0x296e6d[_0x9a7c('0x4c')]['id']}})[_0x9a7c('0x26')](handleEntityNotFound(_0x4d7a04,null))[_0x9a7c('0x26')](function(_0x41b07b){if(_0x41b07b){_0x296e6d['body'][_0x9a7c('0x51')]=_0x41b07b['id'];_0x296e6d[_0x9a7c('0x4b')]['Subjects']=integrations['getSubjects'](_0x296e6d[_0x9a7c('0x4b')][_0x9a7c('0x52')],_0x296e6d['body'][_0x9a7c('0x31')]);_0x296e6d[_0x9a7c('0x4b')][_0x9a7c('0x53')]=integrations[_0x9a7c('0x54')](_0x296e6d['body'][_0x9a7c('0x52')],_0x296e6d['body'][_0x9a7c('0x31')]);return db[_0x9a7c('0x55')]['create'](_0x296e6d[_0x9a7c('0x4b')],{'include':[{'model':db[_0x9a7c('0x56')],'as':'Subjects'},{'model':db[_0x9a7c('0x56')],'as':_0x9a7c('0x53')}]});}return null;})[_0x9a7c('0x26')](respondWithResult(_0x4d7a04,null))[_0x9a7c('0x46')](handleError(_0x4d7a04,null));};function getAccessToken(_0x688a80){return new Promise(function(_0x5c5dfd,_0x5509cc){var _0x10c16b;switch(_0x688a80['zone']){case'US':_0x10c16b='https://accounts.zoho.com';break;case'AU':_0x10c16b='https://accounts.zoho.com.au';break;case'EU':_0x10c16b=_0x9a7c('0x57');break;case'IN':_0x10c16b=_0x9a7c('0x58');break;case'CN':_0x10c16b='https://accounts.zoho.com.cn';break;default:_0x10c16b=_0x9a7c('0x57');break;}var _0x2cd289={'method':_0x9a7c('0x59'),'uri':_0x10c16b+_0x9a7c('0x5a'),'qs':{'refresh_token':_0x688a80[_0x9a7c('0x5b')],'client_id':_0x688a80['clientId'],'client_secret':_0x688a80[_0x9a7c('0x5c')],'grant_type':_0x9a7c('0x5d')},'json':!![]};return rp(_0x2cd289)[_0x9a7c('0x26')](function(_0x116b47){if(_0x116b47[_0x9a7c('0x5e')]){_0x5c5dfd(_0x116b47[_0x9a7c('0x5e')]);}else{_0x5509cc(_0x9a7c('0x5f'));}})[_0x9a7c('0x46')](function(_0x24846f){_0x5509cc(_0x24846f);});});}exports[_0x9a7c('0x60')]=function(_0x4c774b,_0x5025ba,_0x44a275){var _0x1f192f,_0x365328,_0x313e9c,_0x711c6d,_0x4acff3;return db[_0x9a7c('0x2e')][_0x9a7c('0x50')]({'where':{'id':_0x4c774b[_0x9a7c('0x4c')]['id']},'attributes':['id',_0x9a7c('0x61'),_0x9a7c('0x62'),_0x9a7c('0x63'),_0x9a7c('0x5c'),'serverUrl',_0x9a7c('0x64'),'refreshToken']})['then'](handleEntityNotFound(_0x5025ba,null))[_0x9a7c('0x26')](function(_0xf6970e){_0x4acff3=_0xf6970e;_0x1f192f=_0x4acff3[_0x9a7c('0x61')];_0x365328=_0x1f192f===_0x9a7c('0x65')?'eu':_0x9a7c('0x66');_0x313e9c=_0x4acff3[_0x9a7c('0x67')];var _0xe7cc9d=_0x313e9c[_0x9a7c('0x68')](-0x1);if(_0xe7cc9d==='/'||_0xe7cc9d==='\x5c'||_0xe7cc9d===':'){_0x313e9c=_0x313e9c[_0x9a7c('0x69')](0x0,_0x313e9c[_0x9a7c('0x6a')](_0xe7cc9d));}if(!_0x4acff3[_0x9a7c('0x5b')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x4acff3);})[_0x9a7c('0x26')](function(_0x321cb6){if(_0x321cb6){return rp({'method':'GET','uri':util[_0x9a7c('0x6b')](_0x9a7c('0x6c'),_0x365328),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x321cb6},'json':!![]});}})[_0x9a7c('0x26')](function(_0xf6b564){if(_0xf6b564){if(_0xf6b564[_0x9a7c('0x6d')]&&_0xf6b564['response'][_0x9a7c('0x28')]){throw new Error(_0xf6b564[_0x9a7c('0x6d')][_0x9a7c('0x28')][_0x9a7c('0x6e')]);}var _0x218057=[];var _0x40b31d=[];var _0x48da06=['Owner',_0x9a7c('0x6f'),_0x9a7c('0x70'),_0x9a7c('0x71'),_0x9a7c('0x72'),_0x9a7c('0x73'),_0x9a7c('0x74'),_0x9a7c('0x75')];_0x40b31d=_[_0x9a7c('0x76')](_0xf6b564[_0x9a7c('0x39')],function(_0x37c505){return _0x48da06[_0x9a7c('0x77')](_0x37c505[_0x9a7c('0x78')]);});for(var _0x241e54=0x0;_0x241e54<_0x40b31d[_0x9a7c('0x3a')];_0x241e54++){if(_0x40b31d[_0x241e54]['system_mandatory']===![]){_0x218057[_0x9a7c('0x79')]({'id':_0x40b31d[_0x241e54]['id'],'name':_0x40b31d[_0x241e54][_0x9a7c('0x7a')],'custom':_0x40b31d[_0x241e54][_0x9a7c('0x7b')],'options':_0x40b31d[_0x241e54][_0x9a7c('0x7c')]===_0x9a7c('0x7d')&&_0x40b31d[_0x241e54][_0x9a7c('0x7e')][_0x9a7c('0x3a')]>-0x1?_[_0x9a7c('0x2d')](_0x40b31d[_0x241e54][_0x9a7c('0x7e')],function(_0x25aa21){return{'name':_0x25aa21,'value':_0x25aa21};}):[]});}}return{'count':_0x218057[_0x9a7c('0x3a')],'rows':_0x218057};}else{return{'count':0x0,'rows':[]};}})[_0x9a7c('0x26')](respondWithResult(_0x5025ba,null))[_0x9a7c('0x46')](function(_0x54827b){var _0x6426b7=_0x4c774b[_0x9a7c('0x34')][_0x9a7c('0x7f')]?0x1f4:_0x54827b['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x9a7c('0x60'),_0x6426b7,JSON[_0x9a7c('0x80')](_0x54827b));delete _0x54827b[_0x9a7c('0x2a')];if(_0x6426b7===0x191){_0x6426b7=0x190;}_0x5025ba[_0x9a7c('0x1a')](_0x6426b7)[_0x9a7c('0x2b')](_0x4c774b[_0x9a7c('0x34')]['test']?{'message':_0x9a7c('0x81'),'statusCode':_0x54827b['statusCode']}:_0x54827b);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 18b42c8..2582e59 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 _0xdb88=['clientId','clientSecret','code','application/x-www-form-urlencoded','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','slice','https://accounts.zoho.in','POST','then','parse','refresh_token','refreshToken','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code'];(function(_0x34fdba,_0x50b2c4){var _0x2d225f=function(_0xe3ba65){while(--_0xe3ba65){_0x34fdba['push'](_0x34fdba['shift']());}};_0x2d225f(++_0x50b2c4);}(_0xdb88,0x97));var _0x8db8=function(_0x836bb4,_0x565f4b){_0x836bb4=_0x836bb4-0x0;var _0x4f5a56=_0xdb88[_0x836bb4];return _0x4f5a56;};'use strict';var _=require('lodash');var util=require(_0x8db8('0x0'));var logger=require('../../config/logger')(_0x8db8('0x1'));var moment=require(_0x8db8('0x2'));var BPromise=require(_0x8db8('0x3'));var rp=require(_0x8db8('0x4'));var fs=require('fs');var path=require(_0x8db8('0x5'));var rimraf=require(_0x8db8('0x6'));var config=require(_0x8db8('0x7'));var attributes=require(_0x8db8('0x8'));var integrations=require(_0x8db8('0x9'));module['exports']=function(_0x53ded3,_0x1ffba5){return _0x53ded3[_0x8db8('0xa')](_0x8db8('0xb'),attributes,{'tableName':_0x8db8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x23a908,_0x248549,_0x38b469){if(_0x23a908[_0x8db8('0xd')](_0x8db8('0xe'))||_0x23a908[_0x8db8('0xd')](_0x8db8('0xf'))||_0x23a908[_0x8db8('0xd')]('clientId')||_0x23a908['changed']('clientSecret')||_0x23a908['changed']('code')||_0x23a908[_0x8db8('0xd')](_0x8db8('0x10'))){var _0x280245,_0x466076;_0x280245=_0x23a908[_0x8db8('0xf')];var _0x26b69f=_0x280245['slice'](-0x1);if(_0x26b69f==='/'||_0x26b69f==='\x5c'||_0x26b69f===':'){_0x280245=_0x280245[_0x8db8('0x11')](0x0,_0x280245[_0x8db8('0x12')](_0x26b69f));}switch(_0x23a908[_0x8db8('0xe')]){case'US':_0x466076=_0x8db8('0x13');break;case'AU':_0x466076=_0x8db8('0x14');break;case'IN':_0x466076='https://accounts.zoho.in';break;case'CN':_0x466076=_0x8db8('0x15');break;default:_0x466076=_0x8db8('0x16');break;}var _0xdc2ea2={'method':'POST','uri':_0x466076+_0x8db8('0x17'),'form':{'grant_type':_0x8db8('0x18'),'client_id':_0x23a908[_0x8db8('0x19')],'client_secret':_0x23a908[_0x8db8('0x1a')],'redirect_uri':_0x23a908[_0x8db8('0xf')],'code':_0x23a908[_0x8db8('0x1b')]},'headers':{'Content-Type':_0x8db8('0x1c')}};return rp(_0xdc2ea2)['then'](function(_0x11010f){var _0x955b2=JSON['parse'](_0x11010f);if(_0x955b2['refresh_token']){_0x23a908['refreshToken']=_0x955b2['refresh_token'];logger[_0x8db8('0x1d')](util['format'](_0x8db8('0x1e'),_0x23a908['name'],_0x23a908['id']));}else{logger[_0x8db8('0x1f')](util[_0x8db8('0x20')](_0x8db8('0x21'),_0x23a908[_0x8db8('0x22')],_0x23a908['id']),util[_0x8db8('0x23')](_0x955b2,{'showHidden':![],'depth':null}));}return _0x38b469(null,_0x248549);})[_0x8db8('0x24')](function(_0x230557){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x23a908[_0x8db8('0x22')],_0x23a908['id']),util[_0x8db8('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x38b469(_0x230557);});}else{return _0x38b469(null,_0x248549);}},'beforeUpdate':function(_0x341490,_0x13e0ad,_0x56e2de){if(_0x341490[_0x8db8('0xd')](_0x8db8('0xe'))||_0x341490[_0x8db8('0xd')](_0x8db8('0xf'))||_0x341490[_0x8db8('0xd')](_0x8db8('0x19'))||_0x341490[_0x8db8('0xd')](_0x8db8('0x1a'))||_0x341490['changed']('code')||_0x341490[_0x8db8('0xd')](_0x8db8('0x10'))){var _0x327246,_0x10bda0;_0x327246=_0x341490[_0x8db8('0xf')];var _0x3e8633=_0x327246[_0x8db8('0x25')](-0x1);if(_0x3e8633==='/'||_0x3e8633==='\x5c'||_0x3e8633===':'){_0x327246=_0x327246[_0x8db8('0x11')](0x0,_0x327246[_0x8db8('0x12')](_0x3e8633));}switch(_0x341490[_0x8db8('0xe')]){case'US':_0x10bda0=_0x8db8('0x13');break;case'AU':_0x10bda0=_0x8db8('0x14');break;case'IN':_0x10bda0=_0x8db8('0x26');break;case'CN':_0x10bda0=_0x8db8('0x15');break;default:_0x10bda0=_0x8db8('0x16');break;}var _0x4917f6={'method':_0x8db8('0x27'),'uri':_0x10bda0+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x341490[_0x8db8('0x19')],'client_secret':_0x341490[_0x8db8('0x1a')],'redirect_uri':_0x341490[_0x8db8('0xf')],'code':_0x341490[_0x8db8('0x1b')]},'headers':{'Content-Type':_0x8db8('0x1c')}};return rp(_0x4917f6)[_0x8db8('0x28')](function(_0x3d66d0){var _0x14697f=JSON[_0x8db8('0x29')](_0x3d66d0);if(_0x14697f[_0x8db8('0x2a')]){_0x341490[_0x8db8('0x2b')]=_0x14697f[_0x8db8('0x2a')];logger[_0x8db8('0x1d')](util[_0x8db8('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x341490[_0x8db8('0x22')],_0x341490['id']));}else{logger[_0x8db8('0x1f')](util[_0x8db8('0x20')](_0x8db8('0x21'),_0x341490[_0x8db8('0x22')],_0x341490['id']),util[_0x8db8('0x23')](_0x14697f,{'showHidden':![],'depth':null}));}return _0x56e2de(null,_0x13e0ad);})['catch'](function(_0x2edd90){logger['error'](util['format'](_0x8db8('0x21'),_0x341490[_0x8db8('0x22')],_0x341490['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x56e2de(_0x2edd90);});}else{return _0x56e2de(null,_0x13e0ad);}}}});}; \ No newline at end of file +var _0x8445=['name','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','lastIndexOf','then','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','int_zoho_accounts','zone','changed','serverUrl','clientId','clientSecret','code','host','slice','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error'];(function(_0x1c841c,_0xde4652){var _0x242af7=function(_0x2ff8d9){while(--_0x2ff8d9){_0x1c841c['push'](_0x1c841c['shift']());}};_0x242af7(++_0xde4652);}(_0x8445,0x166));var _0x5844=function(_0x36257b,_0x53ebf9){_0x36257b=_0x36257b-0x0;var _0x3f949f=_0x8445[_0x36257b];return _0x3f949f;};'use strict';var _=require(_0x5844('0x0'));var util=require(_0x5844('0x1'));var logger=require(_0x5844('0x2'))(_0x5844('0x3'));var moment=require(_0x5844('0x4'));var BPromise=require(_0x5844('0x5'));var rp=require(_0x5844('0x6'));var fs=require('fs');var path=require(_0x5844('0x7'));var rimraf=require(_0x5844('0x8'));var config=require(_0x5844('0x9'));var attributes=require(_0x5844('0xa'));var integrations=require(_0x5844('0xb'));module[_0x5844('0xc')]=function(_0x2212ce,_0xc0ad7c){return _0x2212ce['define']('ZohoAccount',attributes,{'tableName':_0x5844('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x540c97,_0x5e45ba,_0x83efe2){if(_0x540c97['changed'](_0x5844('0xe'))||_0x540c97[_0x5844('0xf')](_0x5844('0x10'))||_0x540c97[_0x5844('0xf')](_0x5844('0x11'))||_0x540c97[_0x5844('0xf')](_0x5844('0x12'))||_0x540c97[_0x5844('0xf')](_0x5844('0x13'))||_0x540c97[_0x5844('0xf')](_0x5844('0x14'))){var _0x46e263,_0x49c415;_0x46e263=_0x540c97[_0x5844('0x10')];var _0x33338c=_0x46e263[_0x5844('0x15')](-0x1);if(_0x33338c==='/'||_0x33338c==='\x5c'||_0x33338c===':'){_0x46e263=_0x46e263[_0x5844('0x16')](0x0,_0x46e263['lastIndexOf'](_0x33338c));}switch(_0x540c97['zone']){case'US':_0x49c415=_0x5844('0x17');break;case'AU':_0x49c415=_0x5844('0x18');break;case'IN':_0x49c415=_0x5844('0x19');break;case'CN':_0x49c415='https://accounts.zoho.com.cn';break;default:_0x49c415=_0x5844('0x1a');break;}var _0x33b0fd={'method':_0x5844('0x1b'),'uri':_0x49c415+_0x5844('0x1c'),'form':{'grant_type':_0x5844('0x1d'),'client_id':_0x540c97['clientId'],'client_secret':_0x540c97[_0x5844('0x12')],'redirect_uri':_0x540c97[_0x5844('0x10')],'code':_0x540c97['code']},'headers':{'Content-Type':_0x5844('0x1e')}};return rp(_0x33b0fd)['then'](function(_0x50f010){var _0x193026=JSON[_0x5844('0x1f')](_0x50f010);if(_0x193026[_0x5844('0x20')]){_0x540c97[_0x5844('0x21')]=_0x193026[_0x5844('0x20')];logger[_0x5844('0x22')](util[_0x5844('0x23')](_0x5844('0x24'),_0x540c97['name'],_0x540c97['id']));}else{logger[_0x5844('0x25')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x540c97[_0x5844('0x26')],_0x540c97['id']),util['inspect'](_0x193026,{'showHidden':![],'depth':null}));}return _0x83efe2(null,_0x5e45ba);})[_0x5844('0x27')](function(_0x961ea2){logger[_0x5844('0x25')](util[_0x5844('0x23')](_0x5844('0x28'),_0x540c97['name'],_0x540c97['id']),util[_0x5844('0x29')](parsedResult,{'showHidden':![],'depth':null}));return _0x83efe2(_0x961ea2);});}else{return _0x83efe2(null,_0x5e45ba);}},'beforeUpdate':function(_0x12054,_0x22b2ae,_0x96fabd){if(_0x12054[_0x5844('0xf')](_0x5844('0xe'))||_0x12054[_0x5844('0xf')]('serverUrl')||_0x12054['changed']('clientId')||_0x12054[_0x5844('0xf')]('clientSecret')||_0x12054[_0x5844('0xf')]('code')||_0x12054[_0x5844('0xf')]('host')){var _0x178da9,_0x221256;_0x178da9=_0x12054[_0x5844('0x10')];var _0x25836b=_0x178da9['slice'](-0x1);if(_0x25836b==='/'||_0x25836b==='\x5c'||_0x25836b===':'){_0x178da9=_0x178da9[_0x5844('0x16')](0x0,_0x178da9[_0x5844('0x2a')](_0x25836b));}switch(_0x12054[_0x5844('0xe')]){case'US':_0x221256=_0x5844('0x17');break;case'AU':_0x221256=_0x5844('0x18');break;case'IN':_0x221256=_0x5844('0x19');break;case'CN':_0x221256='https://accounts.zoho.com.cn';break;default:_0x221256=_0x5844('0x1a');break;}var _0x48505a={'method':_0x5844('0x1b'),'uri':_0x221256+'/oauth/v2/token','form':{'grant_type':_0x5844('0x1d'),'client_id':_0x12054[_0x5844('0x11')],'client_secret':_0x12054['clientSecret'],'redirect_uri':_0x12054[_0x5844('0x10')],'code':_0x12054[_0x5844('0x13')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x48505a)[_0x5844('0x2b')](function(_0x15f753){var _0x43f39d=JSON[_0x5844('0x1f')](_0x15f753);if(_0x43f39d[_0x5844('0x20')]){_0x12054[_0x5844('0x21')]=_0x43f39d[_0x5844('0x20')];logger[_0x5844('0x22')](util[_0x5844('0x23')](_0x5844('0x24'),_0x12054[_0x5844('0x26')],_0x12054['id']));}else{logger[_0x5844('0x25')](util[_0x5844('0x23')](_0x5844('0x28'),_0x12054[_0x5844('0x26')],_0x12054['id']),util['inspect'](_0x43f39d,{'showHidden':![],'depth':null}));}return _0x96fabd(null,_0x22b2ae);})['catch'](function(_0x1d988d){logger[_0x5844('0x25')](util['format'](_0x5844('0x28'),_0x12054[_0x5844('0x26')],_0x12054['id']),util[_0x5844('0x29')](parsedResult,{'showHidden':![],'depth':null}));return _0x96fabd(_0x1d988d);});}else{return _0x96fabd(null,_0x22b2ae);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index dc9f122..b029d9b 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 _0x1267=['error','code','message','catch','GetZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x2c6810,_0x23c079){var _0x213881=function(_0x528021){while(--_0x528021){_0x2c6810['push'](_0x2c6810['shift']());}};_0x213881(++_0x23c079);}(_0x1267,0xb5));var _0x7126=function(_0x26e297,_0x59170f){_0x26e297=_0x26e297-0x0;var _0x2214bc=_0x1267[_0x26e297];return _0x2214bc;};'use strict';var _=require(_0x7126('0x0'));var util=require(_0x7126('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7126('0x2'));var fs=require('fs');var Redis=require(_0x7126('0x3'));var db=require(_0x7126('0x4'))['db'];var utils=require(_0x7126('0x5'));var logger=require(_0x7126('0x6'))(_0x7126('0x7'));var config=require(_0x7126('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7126('0x9')][_0x7126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5175bf,_0x3c6f51,_0x4f4607){return new BPromise(function(_0x1605ba,_0x4f1e7f){return client[_0x7126('0xb')](_0x5175bf,_0x4f4607)['then'](function(_0x26f0fa){logger[_0x7126('0xc')](_0x7126('0xd'),_0x3c6f51,_0x7126('0xe'));logger[_0x7126('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x3c6f51,'request\x20sent',JSON[_0x7126('0x10')](_0x26f0fa));if(_0x26f0fa[_0x7126('0x11')]){if(_0x26f0fa[_0x7126('0x11')][_0x7126('0x12')]===0x1f4){logger[_0x7126('0x11')](_0x7126('0xd'),_0x3c6f51,_0x26f0fa['error']['message']);return _0x4f1e7f(_0x26f0fa[_0x7126('0x11')][_0x7126('0x13')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x3c6f51,_0x26f0fa[_0x7126('0x11')][_0x7126('0x13')]);return _0x1605ba(_0x26f0fa['error'][_0x7126('0x13')]);}else{logger['info'](_0x7126('0xd'),_0x3c6f51,_0x7126('0xe'));_0x1605ba(_0x26f0fa['result']['message']);}})[_0x7126('0x14')](function(_0x4bd126){logger[_0x7126('0x11')](_0x7126('0xd'),_0x3c6f51,_0x4bd126);_0x4f1e7f(_0x4bd126);});});}exports[_0x7126('0x15')]=function(_0x2795e0){var _0xd98d0c=this;return new Promise(function(_0x68dbf2,_0x21f020){return db['ZohoAccount'][_0x7126('0x16')]({'raw':_0x2795e0[_0x7126('0x17')]?_0x2795e0['options'][_0x7126('0x18')]===undefined?!![]:![]:!![],'where':_0x2795e0[_0x7126('0x17')]?_0x2795e0['options'][_0x7126('0x19')]||null:null,'attributes':_0x2795e0['options']?_0x2795e0['options'][_0x7126('0x1a')]||null:null,'limit':_0x2795e0[_0x7126('0x17')]?_0x2795e0[_0x7126('0x17')][_0x7126('0x1b')]||null:null,'include':_0x2795e0[_0x7126('0x17')]?_0x2795e0['options'][_0x7126('0x1c')]?_[_0x7126('0x1d')](_0x2795e0[_0x7126('0x17')][_0x7126('0x1c')],function(_0x39a51c){return{'model':db[_0x39a51c[_0x7126('0x1e')]],'as':_0x39a51c['as'],'attributes':_0x39a51c[_0x7126('0x1a')],'include':_0x39a51c[_0x7126('0x1c')]?_['map'](_0x39a51c['include'],function(_0x5d718d){return{'model':db[_0x5d718d[_0x7126('0x1e')]],'as':_0x5d718d['as'],'attributes':_0x5d718d[_0x7126('0x1a')],'include':_0x5d718d[_0x7126('0x1c')]?_[_0x7126('0x1d')](_0x5d718d[_0x7126('0x1c')],function(_0x9b43b4){return{'model':db[_0x9b43b4['model']],'as':_0x9b43b4['as'],'attributes':_0x9b43b4[_0x7126('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4426c0){logger['info'](_0x7126('0x15'),_0x2795e0);logger[_0x7126('0xf')](_0x7126('0x15'),_0x2795e0,JSON['stringify'](_0x4426c0));_0x68dbf2(_0x4426c0);})['catch'](function(_0x5c56eb){logger[_0x7126('0x11')](_0x7126('0x15'),_0x5c56eb['message'],_0x2795e0);_0x21f020(_0xd98d0c[_0x7126('0x11')](0x1f4,_0x5c56eb[_0x7126('0x13')]));});});};exports[_0x7126('0x1f')]=function(_0xef1f31){var _0x70da80=this;return new Promise(function(_0x17be15,_0x2c0666){return db['ZohoAccount'][_0x7126('0x20')]({'raw':_0xef1f31['options']?_0xef1f31['options'][_0x7126('0x18')]===undefined?!![]:![]:!![],'where':_0xef1f31[_0x7126('0x17')]?_0xef1f31[_0x7126('0x17')][_0x7126('0x19')]||null:null,'attributes':_0xef1f31['options']?_0xef1f31[_0x7126('0x17')][_0x7126('0x1a')]||null:null,'include':_0xef1f31[_0x7126('0x17')]?_0xef1f31['options']['include']?_[_0x7126('0x1d')](_0xef1f31[_0x7126('0x17')][_0x7126('0x1c')],function(_0x5031e9){return{'model':db[_0x5031e9[_0x7126('0x1e')]],'as':_0x5031e9['as'],'attributes':_0x5031e9['attributes'],'include':_0x5031e9[_0x7126('0x1c')]?_[_0x7126('0x1d')](_0x5031e9[_0x7126('0x1c')],function(_0x15fe77){return{'model':db[_0x15fe77[_0x7126('0x1e')]],'as':_0x15fe77['as'],'attributes':_0x15fe77['attributes'],'include':_0x15fe77['include']?_[_0x7126('0x1d')](_0x15fe77[_0x7126('0x1c')],function(_0x139d4a){return{'model':db[_0x139d4a[_0x7126('0x1e')]],'as':_0x139d4a['as'],'attributes':_0x139d4a[_0x7126('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f8f9b){logger['info'](_0x7126('0x1f'),_0xef1f31);logger[_0x7126('0xf')]('ShowZohoAccount',_0xef1f31,JSON[_0x7126('0x10')](_0x3f8f9b));_0x17be15(_0x3f8f9b);})[_0x7126('0x14')](function(_0x1e0cd9){logger['error'](_0x7126('0x1f'),_0x1e0cd9[_0x7126('0x13')],_0xef1f31);_0x2c0666(_0x70da80['error'](0x1f4,_0x1e0cd9[_0x7126('0x13')]));});});}; \ No newline at end of file +var _0xcb22=['attributes','limit','map','include','model','then','stringify','ShowZohoAccount','ZohoAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetZohoAccount','findAll','options','raw','where'];(function(_0x5d9f4e,_0x37f43a){var _0x446fa8=function(_0x23df45){while(--_0x23df45){_0x5d9f4e['push'](_0x5d9f4e['shift']());}};_0x446fa8(++_0x37f43a);}(_0xcb22,0xc8));var _0x2cb2=function(_0x1970f7,_0x4e2426){_0x1970f7=_0x1970f7-0x0;var _0x283fa5=_0xcb22[_0x1970f7];return _0x283fa5;};'use strict';var _=require(_0x2cb2('0x0'));var util=require(_0x2cb2('0x1'));var moment=require(_0x2cb2('0x2'));var BPromise=require(_0x2cb2('0x3'));var rs=require(_0x2cb2('0x4'));var fs=require('fs');var Redis=require(_0x2cb2('0x5'));var db=require(_0x2cb2('0x6'))['db'];var utils=require(_0x2cb2('0x7'));var logger=require(_0x2cb2('0x8'))(_0x2cb2('0x9'));var config=require(_0x2cb2('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x2cb2('0xb')][_0x2cb2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31bf9f,_0x16b1a1,_0x460984){return new BPromise(function(_0x587c3e,_0x46ec04){return client[_0x2cb2('0xd')](_0x31bf9f,_0x460984)['then'](function(_0x16b59d){logger[_0x2cb2('0xe')](_0x2cb2('0xf'),_0x16b1a1,_0x2cb2('0x10'));logger[_0x2cb2('0x11')](_0x2cb2('0x12'),_0x16b1a1,'request\x20sent',JSON['stringify'](_0x16b59d));if(_0x16b59d[_0x2cb2('0x13')]){if(_0x16b59d[_0x2cb2('0x13')]['code']===0x1f4){logger['error'](_0x2cb2('0xf'),_0x16b1a1,_0x16b59d['error'][_0x2cb2('0x14')]);return _0x46ec04(_0x16b59d['error'][_0x2cb2('0x14')]);}logger[_0x2cb2('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x16b1a1,_0x16b59d[_0x2cb2('0x13')][_0x2cb2('0x14')]);return _0x587c3e(_0x16b59d[_0x2cb2('0x13')]['message']);}else{logger[_0x2cb2('0xe')](_0x2cb2('0xf'),_0x16b1a1,'request\x20sent');_0x587c3e(_0x16b59d[_0x2cb2('0x15')]['message']);}})[_0x2cb2('0x16')](function(_0x26045d){logger[_0x2cb2('0x13')](_0x2cb2('0xf'),_0x16b1a1,_0x26045d);_0x46ec04(_0x26045d);});});}exports[_0x2cb2('0x17')]=function(_0x163802){var _0x5d306d=this;return new Promise(function(_0x52cd17,_0x5add6c){return db['ZohoAccount'][_0x2cb2('0x18')]({'raw':_0x163802[_0x2cb2('0x19')]?_0x163802[_0x2cb2('0x19')][_0x2cb2('0x1a')]===undefined?!![]:![]:!![],'where':_0x163802['options']?_0x163802[_0x2cb2('0x19')][_0x2cb2('0x1b')]||null:null,'attributes':_0x163802[_0x2cb2('0x19')]?_0x163802['options'][_0x2cb2('0x1c')]||null:null,'limit':_0x163802[_0x2cb2('0x19')]?_0x163802[_0x2cb2('0x19')][_0x2cb2('0x1d')]||null:null,'include':_0x163802[_0x2cb2('0x19')]?_0x163802[_0x2cb2('0x19')]['include']?_[_0x2cb2('0x1e')](_0x163802[_0x2cb2('0x19')][_0x2cb2('0x1f')],function(_0x3f43bd){return{'model':db[_0x3f43bd[_0x2cb2('0x20')]],'as':_0x3f43bd['as'],'attributes':_0x3f43bd[_0x2cb2('0x1c')],'include':_0x3f43bd[_0x2cb2('0x1f')]?_[_0x2cb2('0x1e')](_0x3f43bd['include'],function(_0x1c217c){return{'model':db[_0x1c217c[_0x2cb2('0x20')]],'as':_0x1c217c['as'],'attributes':_0x1c217c[_0x2cb2('0x1c')],'include':_0x1c217c[_0x2cb2('0x1f')]?_[_0x2cb2('0x1e')](_0x1c217c[_0x2cb2('0x1f')],function(_0x18b507){return{'model':db[_0x18b507[_0x2cb2('0x20')]],'as':_0x18b507['as'],'attributes':_0x18b507[_0x2cb2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2cb2('0x21')](function(_0x46db09){logger['info'](_0x2cb2('0x17'),_0x163802);logger[_0x2cb2('0x11')](_0x2cb2('0x17'),_0x163802,JSON[_0x2cb2('0x22')](_0x46db09));_0x52cd17(_0x46db09);})[_0x2cb2('0x16')](function(_0x200067){logger[_0x2cb2('0x13')](_0x2cb2('0x17'),_0x200067[_0x2cb2('0x14')],_0x163802);_0x5add6c(_0x5d306d['error'](0x1f4,_0x200067['message']));});});};exports[_0x2cb2('0x23')]=function(_0x4b2cd9){var _0xcb5dc9=this;return new Promise(function(_0x479039,_0x57f28f){return db[_0x2cb2('0x24')][_0x2cb2('0x25')]({'raw':_0x4b2cd9[_0x2cb2('0x19')]?_0x4b2cd9[_0x2cb2('0x19')][_0x2cb2('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b2cd9[_0x2cb2('0x19')]?_0x4b2cd9[_0x2cb2('0x19')][_0x2cb2('0x1b')]||null:null,'attributes':_0x4b2cd9[_0x2cb2('0x19')]?_0x4b2cd9['options'][_0x2cb2('0x1c')]||null:null,'include':_0x4b2cd9[_0x2cb2('0x19')]?_0x4b2cd9['options'][_0x2cb2('0x1f')]?_[_0x2cb2('0x1e')](_0x4b2cd9[_0x2cb2('0x19')]['include'],function(_0x504e4c){return{'model':db[_0x504e4c[_0x2cb2('0x20')]],'as':_0x504e4c['as'],'attributes':_0x504e4c[_0x2cb2('0x1c')],'include':_0x504e4c[_0x2cb2('0x1f')]?_['map'](_0x504e4c[_0x2cb2('0x1f')],function(_0x17c4da){return{'model':db[_0x17c4da['model']],'as':_0x17c4da['as'],'attributes':_0x17c4da['attributes'],'include':_0x17c4da[_0x2cb2('0x1f')]?_[_0x2cb2('0x1e')](_0x17c4da[_0x2cb2('0x1f')],function(_0x5557d3){return{'model':db[_0x5557d3['model']],'as':_0x5557d3['as'],'attributes':_0x5557d3[_0x2cb2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2cb2('0x21')](function(_0x3ddd5d){logger[_0x2cb2('0xe')](_0x2cb2('0x23'),_0x4b2cd9);logger['debug'](_0x2cb2('0x23'),_0x4b2cd9,JSON[_0x2cb2('0x22')](_0x3ddd5d));_0x479039(_0x3ddd5d);})[_0x2cb2('0x16')](function(_0x4af179){logger['error'](_0x2cb2('0x23'),_0x4af179[_0x2cb2('0x14')],_0x4b2cd9);_0x57f28f(_0xcb5dc9[_0x2cb2('0x13')](0x1f4,_0x4af179[_0x2cb2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 7df74e9..edb20fe 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 _0x674e=['/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','index','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects'];(function(_0x11917c,_0x4c6502){var _0xdfb6d3=function(_0x361775){while(--_0x361775){_0x11917c['push'](_0x11917c['shift']());}};_0xdfb6d3(++_0x4c6502);}(_0x674e,0xbe));var _0xe674=function(_0x54241b,_0x9571fa){_0x54241b=_0x54241b-0x0;var _0x15224e=_0x674e[_0x54241b];return _0x15224e;};'use strict';var multer=require(_0xe674('0x0'));var util=require(_0xe674('0x1'));var path=require('path');var timeout=require(_0xe674('0x2'));var express=require(_0xe674('0x3'));var router=express[_0xe674('0x4')]();var fs_extra=require(_0xe674('0x5'));var auth=require(_0xe674('0x6'));var interaction=require(_0xe674('0x7'));var config=require('../../config/environment');var controller=require(_0xe674('0x8'));router[_0xe674('0x9')]('/',auth['isAuthenticated'](),controller[_0xe674('0xa')]);router['get'](_0xe674('0xb'),auth['isAuthenticated'](),controller[_0xe674('0xc')]);router['get'](_0xe674('0xd'),auth[_0xe674('0xe')](),controller[_0xe674('0xf')]);router[_0xe674('0x9')](_0xe674('0x10'),auth[_0xe674('0xe')](),controller[_0xe674('0x11')]);router[_0xe674('0x9')](_0xe674('0x12'),auth[_0xe674('0xe')](),controller[_0xe674('0x13')]);router[_0xe674('0x14')]('/',auth[_0xe674('0xe')](),controller[_0xe674('0x15')]);router[_0xe674('0x16')](_0xe674('0xb'),auth[_0xe674('0xe')](),controller[_0xe674('0x17')]);router[_0xe674('0x18')](_0xe674('0xb'),auth['isAuthenticated'](),controller[_0xe674('0x19')]);module['exports']=router; \ No newline at end of file +var _0x54be=['get','getFields','getSubjects','getDescriptions','create','put','/:id','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index'];(function(_0x38d3e5,_0x38499c){var _0x286f1e=function(_0x53ba43){while(--_0x53ba43){_0x38d3e5['push'](_0x38d3e5['shift']());}};_0x286f1e(++_0x38499c);}(_0x54be,0xc7));var _0xe54b=function(_0x2b8607,_0xdea92a){_0x2b8607=_0x2b8607-0x0;var _0x1fddf9=_0x54be[_0x2b8607];return _0x1fddf9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe54b('0x0'));var timeout=require(_0xe54b('0x1'));var express=require(_0xe54b('0x2'));var router=express[_0xe54b('0x3')]();var fs_extra=require(_0xe54b('0x4'));var auth=require(_0xe54b('0x5'));var interaction=require(_0xe54b('0x6'));var config=require(_0xe54b('0x7'));var controller=require(_0xe54b('0x8'));router['get']('/',auth[_0xe54b('0x9')](),controller[_0xe54b('0xa')]);router[_0xe54b('0xb')]('/:id',auth[_0xe54b('0x9')](),controller['show']);router[_0xe54b('0xb')]('/:id/fields',auth[_0xe54b('0x9')](),controller[_0xe54b('0xc')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xe54b('0xd')]);router[_0xe54b('0xb')]('/:id/descriptions',auth[_0xe54b('0x9')](),controller[_0xe54b('0xe')]);router['post']('/',auth[_0xe54b('0x9')](),controller[_0xe54b('0xf')]);router[_0xe54b('0x10')](_0xe54b('0x11'),auth[_0xe54b('0x9')](),controller[_0xe54b('0x12')]);router[_0xe54b('0x13')](_0xe54b('0x11'),auth[_0xe54b('0x9')](),controller['destroy']);module[_0xe54b('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index db3ff18..82ead1d 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 _0x8c63=['sequelize','exports','STRING','ENUM','contact_lead','contact','lead'];(function(_0x4904af,_0x4418bc){var _0x2a2f45=function(_0x282c43){while(--_0x282c43){_0x4904af['push'](_0x4904af['shift']());}};_0x2a2f45(++_0x4418bc);}(_0x8c63,0x77));var _0x38c6=function(_0x500127,_0xd48fa){_0x500127=_0x500127-0x0;var _0x19a116=_0x8c63[_0x500127];return _0x19a116;};'use strict';var Sequelize=require(_0x38c6('0x0'));module[_0x38c6('0x1')]={'name':{'type':Sequelize[_0x38c6('0x2')]},'moduleCreate':{'type':Sequelize[_0x38c6('0x3')]('lead','contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM'](_0x38c6('0x4'),_0x38c6('0x5'),_0x38c6('0x6')),'defaultValue':_0x38c6('0x4')},'description':{'type':Sequelize[_0x38c6('0x2')]}}; \ No newline at end of file +var _0x022e=['nothing','lead','contact_lead','contact','sequelize','STRING'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x022e,0xc4));var _0xe022=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x022e[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xe022('0x0'));module['exports']={'name':{'type':Sequelize[_0xe022('0x1')]},'moduleCreate':{'type':Sequelize['ENUM']('lead','contact',_0xe022('0x2')),'defaultValue':_0xe022('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0xe022('0x4'),_0xe022('0x5'),_0xe022('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 8a75437..d4e7496 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 _0x8538=['update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','ZohoConfiguration','findAll','rows','catch','show','params','length','includeAll','find','create','body','findOne','options','nolimit','getFields','ZohoField','pick','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save'];(function(_0x2cce63,_0x1c95e8){var _0x4ee094=function(_0x3200e6){while(--_0x3200e6){_0x2cce63['push'](_0x2cce63['shift']());}};_0x4ee094(++_0x1c95e8);}(_0x8538,0x174));var _0x8853=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8538[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8853('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8853('0x1'));var jsonpatch=require(_0x8853('0x2'));var rp=require(_0x8853('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8853('0x4'));var util=require(_0x8853('0x5'));var path=require(_0x8853('0x6'));var sox=require(_0x8853('0x7'));var csv=require(_0x8853('0x8'));var ejs=require(_0x8853('0x9'));var fs=require('fs');var fs_extra=require(_0x8853('0xa'));var _=require(_0x8853('0xb'));var squel=require('squel');var crypto=require(_0x8853('0xc'));var jsforce=require(_0x8853('0xd'));var deskjs=require(_0x8853('0xe'));var toCsv=require(_0x8853('0x8'));var querystring=require(_0x8853('0xf'));var Papa=require('papaparse');var Redis=require(_0x8853('0x10'));var authService=require(_0x8853('0x11'));var qs=require(_0x8853('0x12'));var as=require(_0x8853('0x13'));var hardwareService=require(_0x8853('0x14'));var logger=require(_0x8853('0x15'))(_0x8853('0x16'));var utils=require(_0x8853('0x17'));var config=require(_0x8853('0x18'));var licenseUtil=require(_0x8853('0x19'));var db=require(_0x8853('0x1a'))['db'];function respondWithStatusCode(_0x432b80,_0x456cbf){_0x456cbf=_0x456cbf||0xcc;return function(_0x5004e9){if(_0x5004e9){return _0x432b80[_0x8853('0x1b')](_0x456cbf);}return _0x432b80[_0x8853('0x1c')](_0x456cbf)[_0x8853('0x1d')]();};}function respondWithResult(_0x522bdd,_0x19e17c){_0x19e17c=_0x19e17c||0xc8;return function(_0x486180){if(_0x486180){return _0x522bdd[_0x8853('0x1c')](_0x19e17c)['json'](_0x486180);}};}function respondWithFilteredResult(_0x3feebc,_0x4de5a6){return function(_0x1aa5df){if(_0x1aa5df){var _0x2d522c=typeof _0x4de5a6[_0x8853('0x1e')]===_0x8853('0x1f')&&typeof _0x4de5a6[_0x8853('0x20')]==='undefined';var _0xce7799=_0x1aa5df['count'];var _0x3eb945=_0x2d522c?0x0:_0x4de5a6[_0x8853('0x1e')];var _0x5e6531=_0x2d522c?_0x1aa5df[_0x8853('0x21')]:_0x4de5a6[_0x8853('0x1e')]+_0x4de5a6[_0x8853('0x20')];var _0x1c87bb;if(_0x5e6531>=_0xce7799){_0x5e6531=_0xce7799;_0x1c87bb=0xc8;}else{_0x1c87bb=0xce;}_0x3feebc[_0x8853('0x1c')](_0x1c87bb);return _0x3feebc[_0x8853('0x22')]('Content-Range',_0x3eb945+'-'+_0x5e6531+'/'+_0xce7799)[_0x8853('0x23')](_0x1aa5df);}return null;};}function patchUpdates(_0x59d0c9){return function(_0x436768){try{jsonpatch[_0x8853('0x24')](_0x436768,_0x59d0c9,!![]);}catch(_0x2fb842){return BPromise['reject'](_0x2fb842);}return _0x436768[_0x8853('0x25')]();};}function saveUpdates(_0x14c766,_0x2a1b36){return function(_0x103dcd){if(_0x103dcd){return _0x103dcd[_0x8853('0x26')](_0x14c766)[_0x8853('0x27')](function(_0x2cea6e){return _0x2cea6e;});}return null;};}function removeEntity(_0x142271,_0x1abb9d){return function(_0x5b06a1){if(_0x5b06a1){return _0x5b06a1['destroy']()[_0x8853('0x27')](function(){_0x142271[_0x8853('0x1c')](0xcc)[_0x8853('0x1d')]();});}};}function handleEntityNotFound(_0x4b09d2,_0x515c3e){return function(_0x3209ad){if(!_0x3209ad){_0x4b09d2[_0x8853('0x1b')](0x194);}return _0x3209ad;};}function handleError(_0x26f266,_0xa89f71){_0xa89f71=_0xa89f71||0x1f4;return function(_0x1f11ba){logger[_0x8853('0x28')](_0x1f11ba[_0x8853('0x29')]);if(_0x1f11ba[_0x8853('0x2a')]){delete _0x1f11ba[_0x8853('0x2a')];}_0x26f266[_0x8853('0x1c')](_0xa89f71)[_0x8853('0x2b')](_0x1f11ba);};}exports[_0x8853('0x2c')]=function(_0x565239,_0x369e0b){var _0x24f983={},_0x167862={},_0x865d6={'count':0x0,'rows':[]};var _0x464d37=_[_0x8853('0x2d')](db['ZohoConfiguration'][_0x8853('0x2e')],function(_0x63d9ca){return{'name':_0x63d9ca[_0x8853('0x2f')],'type':_0x63d9ca[_0x8853('0x30')]['key']};});_0x167862[_0x8853('0x31')]=_[_0x8853('0x2d')](_0x464d37,'name');_0x167862[_0x8853('0x32')]=_[_0x8853('0x33')](_0x565239[_0x8853('0x32')]);_0x167862[_0x8853('0x34')]=_[_0x8853('0x35')](_0x167862[_0x8853('0x31')],_0x167862['query']);_0x24f983[_0x8853('0x36')]=_[_0x8853('0x35')](_0x167862[_0x8853('0x31')],qs['fields'](_0x565239['query'][_0x8853('0x37')]));_0x24f983['attributes']=_0x24f983[_0x8853('0x36')]['length']?_0x24f983[_0x8853('0x36')]:_0x167862[_0x8853('0x31')];if(!_0x565239[_0x8853('0x32')][_0x8853('0x38')]('nolimit')){_0x24f983['limit']=qs['limit'](_0x565239[_0x8853('0x32')][_0x8853('0x20')]);_0x24f983[_0x8853('0x1e')]=qs[_0x8853('0x1e')](_0x565239['query'][_0x8853('0x1e')]);}_0x24f983[_0x8853('0x39')]=qs[_0x8853('0x3a')](_0x565239['query'][_0x8853('0x3a')]);_0x24f983['where']=qs[_0x8853('0x34')](_['pick'](_0x565239['query'],_0x167862[_0x8853('0x34')]),_0x464d37);if(_0x565239[_0x8853('0x32')][_0x8853('0x3b')]){_0x24f983['where']=_[_0x8853('0x3c')](_0x24f983[_0x8853('0x3d')],{'$or':_[_0x8853('0x2d')](_0x464d37,function(_0x380f98){if(_0x380f98['type']!==_0x8853('0x3e')){var _0xcf426={};_0xcf426[_0x380f98['name']]={'$like':'%'+_0x565239[_0x8853('0x32')][_0x8853('0x3b')]+'%'};return _0xcf426;}})});}_0x24f983=_[_0x8853('0x3c')]({},_0x24f983,_0x565239['options']);var _0x13d75c={'where':_0x24f983['where']};return db[_0x8853('0x3f')][_0x8853('0x21')](_0x13d75c)[_0x8853('0x27')](function(_0x2d8859){_0x865d6[_0x8853('0x21')]=_0x2d8859;if(_0x565239[_0x8853('0x32')]['includeAll']){_0x24f983['include']=[{'all':!![]}];}return db[_0x8853('0x3f')][_0x8853('0x40')](_0x24f983);})['then'](function(_0x3fe3f2){_0x865d6[_0x8853('0x41')]=_0x3fe3f2;return _0x865d6;})[_0x8853('0x27')](respondWithFilteredResult(_0x369e0b,_0x24f983))[_0x8853('0x42')](handleError(_0x369e0b,null));};exports[_0x8853('0x43')]=function(_0x216a4b,_0xe7aacd){var _0x3a7f77={'raw':![],'where':{'id':_0x216a4b[_0x8853('0x44')]['id']}},_0x1b2709={};_0x1b2709[_0x8853('0x31')]=_['keys'](db[_0x8853('0x3f')][_0x8853('0x2e')]);_0x1b2709[_0x8853('0x32')]=_[_0x8853('0x33')](_0x216a4b[_0x8853('0x32')]);_0x1b2709[_0x8853('0x34')]=_[_0x8853('0x35')](_0x1b2709[_0x8853('0x31')],_0x1b2709[_0x8853('0x32')]);_0x3a7f77[_0x8853('0x36')]=_['intersection'](_0x1b2709['model'],qs[_0x8853('0x37')](_0x216a4b[_0x8853('0x32')][_0x8853('0x37')]));_0x3a7f77[_0x8853('0x36')]=_0x3a7f77['attributes'][_0x8853('0x45')]?_0x3a7f77[_0x8853('0x36')]:_0x1b2709[_0x8853('0x31')];if(_0x216a4b[_0x8853('0x32')][_0x8853('0x46')]){_0x3a7f77['include']=[{'all':!![]}];}_0x3a7f77=_[_0x8853('0x3c')]({},_0x3a7f77,_0x216a4b['options']);return db['ZohoConfiguration'][_0x8853('0x47')](_0x3a7f77)[_0x8853('0x27')](handleEntityNotFound(_0xe7aacd,null))[_0x8853('0x27')](respondWithResult(_0xe7aacd,null))[_0x8853('0x42')](handleError(_0xe7aacd,null));};exports['create']=function(_0x9d85af,_0x5a903c){return db[_0x8853('0x3f')][_0x8853('0x48')](_0x9d85af[_0x8853('0x49')],{})[_0x8853('0x27')](respondWithResult(_0x5a903c,0xc9))[_0x8853('0x42')](handleError(_0x5a903c,null));};exports[_0x8853('0x26')]=function(_0x2de80d,_0x185654){if(_0x2de80d[_0x8853('0x49')]['id']){delete _0x2de80d[_0x8853('0x49')]['id'];}return db['ZohoConfiguration'][_0x8853('0x47')]({'where':{'id':_0x2de80d['params']['id']}})[_0x8853('0x27')](handleEntityNotFound(_0x185654,null))['then'](saveUpdates(_0x2de80d[_0x8853('0x49')],null))[_0x8853('0x27')](respondWithResult(_0x185654,null))['catch'](handleError(_0x185654,null));};exports['destroy']=function(_0x16c65a,_0x26d77b){return db[_0x8853('0x3f')][_0x8853('0x47')]({'where':{'id':_0x16c65a['params']['id']}})[_0x8853('0x27')](handleEntityNotFound(_0x26d77b,null))['then'](removeEntity(_0x26d77b,null))[_0x8853('0x42')](handleError(_0x26d77b,null));};exports['getFields']=function(_0x15bb89,_0x4b036d,_0x299c15){var _0x32ce08={};var _0x3e8cd2={};var _0x532e1d;var _0x3e3639;return db[_0x8853('0x3f')][_0x8853('0x4a')]({'where':{'id':_0x15bb89[_0x8853('0x44')]['id']}})['then'](handleEntityNotFound(_0x4b036d,null))[_0x8853('0x27')](function(_0x13deb2){if(_0x13deb2){_0x532e1d=_0x13deb2;_0x3e8cd2[_0x8853('0x31')]=_[_0x8853('0x33')](db['ZohoField']['rawAttributes']);_0x3e8cd2[_0x8853('0x32')]=_[_0x8853('0x33')](_0x15bb89[_0x8853('0x32')]);_0x3e8cd2['filters']=_[_0x8853('0x35')](_0x3e8cd2[_0x8853('0x31')],_0x3e8cd2[_0x8853('0x32')]);_0x32ce08[_0x8853('0x36')]=_[_0x8853('0x35')](_0x3e8cd2[_0x8853('0x31')],qs['fields'](_0x15bb89[_0x8853('0x32')][_0x8853('0x37')]));_0x32ce08[_0x8853('0x36')]=_0x32ce08[_0x8853('0x36')][_0x8853('0x45')]?_0x32ce08['attributes']:_0x3e8cd2[_0x8853('0x31')];_0x32ce08['order']=qs[_0x8853('0x3a')](_0x15bb89[_0x8853('0x32')]['sort']);_0x32ce08['where']=qs[_0x8853('0x34')](_['pick'](_0x15bb89['query'],_0x3e8cd2['filters']));if(_0x15bb89['query'][_0x8853('0x3b')]){_0x32ce08[_0x8853('0x3d')]=_[_0x8853('0x3c')](_0x32ce08[_0x8853('0x3d')],{'$or':_['map'](_0x32ce08[_0x8853('0x36')],function(_0x3855b9){var _0x1c93f5={};_0x1c93f5[_0x3855b9]={'$like':'%'+_0x15bb89['query']['filter']+'%'};return _0x1c93f5;})});}_0x32ce08=_[_0x8853('0x3c')]({},_0x32ce08,_0x15bb89[_0x8853('0x4b')]);return _0x532e1d['getFields'](_0x32ce08);}})[_0x8853('0x27')](function(_0xb31203){if(_0xb31203){_0x3e3639=_0xb31203['length'];if(!_0x15bb89['query'][_0x8853('0x38')](_0x8853('0x4c'))){_0x32ce08[_0x8853('0x20')]=qs['limit'](_0x15bb89[_0x8853('0x32')]['limit']);_0x32ce08[_0x8853('0x1e')]=qs[_0x8853('0x1e')](_0x15bb89[_0x8853('0x32')][_0x8853('0x1e')]);}return _0x532e1d[_0x8853('0x4d')](_0x32ce08);}})[_0x8853('0x27')](function(_0x47f7c4){if(_0x47f7c4){return _0x47f7c4?{'count':_0x3e3639,'rows':_0x47f7c4}:null;}})[_0x8853('0x27')](respondWithResult(_0x4b036d,null))[_0x8853('0x42')](handleError(_0x4b036d,null));};exports['getSubjects']=function(_0x4398ff,_0x441ff0,_0xec8198){var _0x5aa41d={};var _0x23758f={};var _0x846ca0;var _0x8dfd65;return db[_0x8853('0x3f')]['findOne']({'where':{'id':_0x4398ff[_0x8853('0x44')]['id']}})[_0x8853('0x27')](handleEntityNotFound(_0x441ff0,null))[_0x8853('0x27')](function(_0x5e0108){if(_0x5e0108){_0x846ca0=_0x5e0108;_0x23758f[_0x8853('0x31')]=_[_0x8853('0x33')](db[_0x8853('0x4e')][_0x8853('0x2e')]);_0x23758f[_0x8853('0x32')]=_['keys'](_0x4398ff[_0x8853('0x32')]);_0x23758f['filters']=_['intersection'](_0x23758f[_0x8853('0x31')],_0x23758f[_0x8853('0x32')]);_0x5aa41d[_0x8853('0x36')]=_['intersection'](_0x23758f[_0x8853('0x31')],qs[_0x8853('0x37')](_0x4398ff['query'][_0x8853('0x37')]));_0x5aa41d[_0x8853('0x36')]=_0x5aa41d[_0x8853('0x36')][_0x8853('0x45')]?_0x5aa41d[_0x8853('0x36')]:_0x23758f[_0x8853('0x31')];_0x5aa41d[_0x8853('0x39')]=qs[_0x8853('0x3a')](_0x4398ff['query']['sort']);_0x5aa41d['where']=qs[_0x8853('0x34')](_[_0x8853('0x4f')](_0x4398ff[_0x8853('0x32')],_0x23758f[_0x8853('0x34')]));if(_0x4398ff[_0x8853('0x32')]['filter']){_0x5aa41d[_0x8853('0x3d')]=_[_0x8853('0x3c')](_0x5aa41d[_0x8853('0x3d')],{'$or':_[_0x8853('0x2d')](_0x5aa41d[_0x8853('0x36')],function(_0x2b48e2){var _0x23e20f={};_0x23e20f[_0x2b48e2]={'$like':'%'+_0x4398ff[_0x8853('0x32')]['filter']+'%'};return _0x23e20f;})});}_0x5aa41d=_['merge']({},_0x5aa41d,_0x4398ff[_0x8853('0x4b')]);return _0x846ca0[_0x8853('0x50')](_0x5aa41d);}})['then'](function(_0x4a9e3c){if(_0x4a9e3c){_0x8dfd65=_0x4a9e3c[_0x8853('0x45')];if(!_0x4398ff[_0x8853('0x32')]['hasOwnProperty'](_0x8853('0x4c'))){_0x5aa41d['limit']=qs['limit'](_0x4398ff[_0x8853('0x32')][_0x8853('0x20')]);_0x5aa41d[_0x8853('0x1e')]=qs['offset'](_0x4398ff[_0x8853('0x32')][_0x8853('0x1e')]);}return _0x846ca0[_0x8853('0x50')](_0x5aa41d);}})[_0x8853('0x27')](function(_0x4d2ca9){if(_0x4d2ca9){return _0x4d2ca9?{'count':_0x8dfd65,'rows':_0x4d2ca9}:null;}})[_0x8853('0x27')](respondWithResult(_0x441ff0,null))[_0x8853('0x42')](handleError(_0x441ff0,null));};exports[_0x8853('0x51')]=function(_0x203050,_0x283252,_0x1220c7){var _0x1af5d8={};var _0x2c3ef7={};var _0x554bf7;var _0x4ad464;return db[_0x8853('0x3f')]['findOne']({'where':{'id':_0x203050[_0x8853('0x44')]['id']}})[_0x8853('0x27')](handleEntityNotFound(_0x283252,null))[_0x8853('0x27')](function(_0x33c7ed){if(_0x33c7ed){_0x554bf7=_0x33c7ed;_0x2c3ef7[_0x8853('0x31')]=_['keys'](db[_0x8853('0x4e')][_0x8853('0x2e')]);_0x2c3ef7[_0x8853('0x32')]=_[_0x8853('0x33')](_0x203050[_0x8853('0x32')]);_0x2c3ef7[_0x8853('0x34')]=_[_0x8853('0x35')](_0x2c3ef7[_0x8853('0x31')],_0x2c3ef7['query']);_0x1af5d8[_0x8853('0x36')]=_['intersection'](_0x2c3ef7[_0x8853('0x31')],qs[_0x8853('0x37')](_0x203050[_0x8853('0x32')]['fields']));_0x1af5d8[_0x8853('0x36')]=_0x1af5d8['attributes'][_0x8853('0x45')]?_0x1af5d8[_0x8853('0x36')]:_0x2c3ef7[_0x8853('0x31')];_0x1af5d8[_0x8853('0x39')]=qs['sort'](_0x203050['query'][_0x8853('0x3a')]);_0x1af5d8[_0x8853('0x3d')]=qs[_0x8853('0x34')](_[_0x8853('0x4f')](_0x203050['query'],_0x2c3ef7['filters']));if(_0x203050[_0x8853('0x32')][_0x8853('0x3b')]){_0x1af5d8[_0x8853('0x3d')]=_['merge'](_0x1af5d8[_0x8853('0x3d')],{'$or':_['map'](_0x1af5d8['attributes'],function(_0x1c2d6c){var _0x36ef44={};_0x36ef44[_0x1c2d6c]={'$like':'%'+_0x203050[_0x8853('0x32')][_0x8853('0x3b')]+'%'};return _0x36ef44;})});}_0x1af5d8=_['merge']({},_0x1af5d8,_0x203050[_0x8853('0x4b')]);return _0x554bf7[_0x8853('0x51')](_0x1af5d8);}})[_0x8853('0x27')](function(_0x2b2fb6){if(_0x2b2fb6){_0x4ad464=_0x2b2fb6['length'];if(!_0x203050[_0x8853('0x32')][_0x8853('0x38')](_0x8853('0x4c'))){_0x1af5d8[_0x8853('0x20')]=qs[_0x8853('0x20')](_0x203050[_0x8853('0x32')]['limit']);_0x1af5d8[_0x8853('0x1e')]=qs['offset'](_0x203050['query'][_0x8853('0x1e')]);}return _0x554bf7[_0x8853('0x51')](_0x1af5d8);}})[_0x8853('0x27')](function(_0x291f7c){if(_0x291f7c){return _0x291f7c?{'count':_0x4ad464,'rows':_0x291f7c}:null;}})[_0x8853('0x27')](respondWithResult(_0x283252,null))['catch'](handleError(_0x283252,null));}; \ No newline at end of file +var _0xd08a=['VIRTUAL','options','include','findAll','params','includeAll','find','catch','create','body','getFields','findOne','ZohoField','hasOwnProperty','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','ZohoConfiguration','rawAttributes','fieldName','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type'];(function(_0x27b56c,_0x3b4fd6){var _0xb4e0d3=function(_0x4a13ff){while(--_0x4a13ff){_0x27b56c['push'](_0x27b56c['shift']());}};_0xb4e0d3(++_0x3b4fd6);}(_0xd08a,0xaa));var _0xad08=function(_0x4f0353,_0x32cdba){_0x4f0353=_0x4f0353-0x0;var _0x400586=_0xd08a[_0x4f0353];return _0x400586;};'use strict';var emlformat=require(_0xad08('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xad08('0x1'));var rp=require(_0xad08('0x2'));var moment=require(_0xad08('0x3'));var BPromise=require(_0xad08('0x4'));var Mustache=require('mustache');var util=require(_0xad08('0x5'));var path=require(_0xad08('0x6'));var sox=require(_0xad08('0x7'));var csv=require('to-csv');var ejs=require(_0xad08('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xad08('0x9'));var crypto=require('crypto');var jsforce=require(_0xad08('0xa'));var deskjs=require(_0xad08('0xb'));var toCsv=require(_0xad08('0xc'));var querystring=require(_0xad08('0xd'));var Papa=require(_0xad08('0xe'));var Redis=require(_0xad08('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xad08('0x10'));var as=require(_0xad08('0x11'));var hardwareService=require(_0xad08('0x12'));var logger=require(_0xad08('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xad08('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42d236,_0x170a58){_0x170a58=_0x170a58||0xcc;return function(_0xe507c5){if(_0xe507c5){return _0x42d236[_0xad08('0x15')](_0x170a58);}return _0x42d236[_0xad08('0x16')](_0x170a58)[_0xad08('0x17')]();};}function respondWithResult(_0x5a48f1,_0x1fe130){_0x1fe130=_0x1fe130||0xc8;return function(_0x303511){if(_0x303511){return _0x5a48f1['status'](_0x1fe130)['json'](_0x303511);}};}function respondWithFilteredResult(_0x3f75dc,_0x53d8e6){return function(_0x22345e){if(_0x22345e){var _0x100ad1=typeof _0x53d8e6['offset']===_0xad08('0x18')&&typeof _0x53d8e6['limit']===_0xad08('0x18');var _0x2d8336=_0x22345e[_0xad08('0x19')];var _0xf2382b=_0x100ad1?0x0:_0x53d8e6[_0xad08('0x1a')];var _0x6adc86=_0x100ad1?_0x22345e[_0xad08('0x19')]:_0x53d8e6[_0xad08('0x1a')]+_0x53d8e6[_0xad08('0x1b')];var _0x1bebc3;if(_0x6adc86>=_0x2d8336){_0x6adc86=_0x2d8336;_0x1bebc3=0xc8;}else{_0x1bebc3=0xce;}_0x3f75dc['status'](_0x1bebc3);return _0x3f75dc[_0xad08('0x1c')](_0xad08('0x1d'),_0xf2382b+'-'+_0x6adc86+'/'+_0x2d8336)['json'](_0x22345e);}return null;};}function patchUpdates(_0x5942c6){return function(_0x30c374){try{jsonpatch[_0xad08('0x1e')](_0x30c374,_0x5942c6,!![]);}catch(_0x5c2451){return BPromise[_0xad08('0x1f')](_0x5c2451);}return _0x30c374[_0xad08('0x20')]();};}function saveUpdates(_0x14eb33,_0x4c6355){return function(_0x218ca5){if(_0x218ca5){return _0x218ca5[_0xad08('0x21')](_0x14eb33)['then'](function(_0x5df72a){return _0x5df72a;});}return null;};}function removeEntity(_0x27a647,_0x5bceab){return function(_0x87b19){if(_0x87b19){return _0x87b19[_0xad08('0x22')]()[_0xad08('0x23')](function(){_0x27a647[_0xad08('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2aa388,_0x42e61c){return function(_0x2d1e2f){if(!_0x2d1e2f){_0x2aa388[_0xad08('0x15')](0x194);}return _0x2d1e2f;};}function handleError(_0x4b209a,_0x3707ad){_0x3707ad=_0x3707ad||0x1f4;return function(_0x265669){logger[_0xad08('0x24')](_0x265669[_0xad08('0x25')]);if(_0x265669[_0xad08('0x26')]){delete _0x265669[_0xad08('0x26')];}_0x4b209a[_0xad08('0x16')](_0x3707ad)[_0xad08('0x27')](_0x265669);};}exports[_0xad08('0x28')]=function(_0x1f11ac,_0x4ee365){var _0x4bc84b={},_0x1a0c85={},_0x155170={'count':0x0,'rows':[]};var _0x505d0a=_['map'](db[_0xad08('0x29')][_0xad08('0x2a')],function(_0x5ce505){return{'name':_0x5ce505[_0xad08('0x2b')],'type':_0x5ce505['type']['key']};});_0x1a0c85[_0xad08('0x2c')]=_[_0xad08('0x2d')](_0x505d0a,'name');_0x1a0c85[_0xad08('0x2e')]=_[_0xad08('0x2f')](_0x1f11ac[_0xad08('0x2e')]);_0x1a0c85[_0xad08('0x30')]=_[_0xad08('0x31')](_0x1a0c85[_0xad08('0x2c')],_0x1a0c85[_0xad08('0x2e')]);_0x4bc84b['attributes']=_[_0xad08('0x31')](_0x1a0c85['model'],qs[_0xad08('0x32')](_0x1f11ac['query']['fields']));_0x4bc84b[_0xad08('0x33')]=_0x4bc84b[_0xad08('0x33')][_0xad08('0x34')]?_0x4bc84b[_0xad08('0x33')]:_0x1a0c85[_0xad08('0x2c')];if(!_0x1f11ac[_0xad08('0x2e')]['hasOwnProperty'](_0xad08('0x35'))){_0x4bc84b['limit']=qs[_0xad08('0x1b')](_0x1f11ac[_0xad08('0x2e')][_0xad08('0x1b')]);_0x4bc84b[_0xad08('0x1a')]=qs[_0xad08('0x1a')](_0x1f11ac[_0xad08('0x2e')]['offset']);}_0x4bc84b[_0xad08('0x36')]=qs[_0xad08('0x37')](_0x1f11ac['query']['sort']);_0x4bc84b[_0xad08('0x38')]=qs['filters'](_[_0xad08('0x39')](_0x1f11ac[_0xad08('0x2e')],_0x1a0c85[_0xad08('0x30')]),_0x505d0a);if(_0x1f11ac['query'][_0xad08('0x3a')]){_0x4bc84b['where']=_[_0xad08('0x3b')](_0x4bc84b[_0xad08('0x38')],{'$or':_[_0xad08('0x2d')](_0x505d0a,function(_0x221f03){if(_0x221f03[_0xad08('0x3c')]!==_0xad08('0x3d')){var _0x5490f4={};_0x5490f4[_0x221f03[_0xad08('0x26')]]={'$like':'%'+_0x1f11ac[_0xad08('0x2e')][_0xad08('0x3a')]+'%'};return _0x5490f4;}})});}_0x4bc84b=_[_0xad08('0x3b')]({},_0x4bc84b,_0x1f11ac[_0xad08('0x3e')]);var _0x2c0d5e={'where':_0x4bc84b['where']};return db[_0xad08('0x29')][_0xad08('0x19')](_0x2c0d5e)[_0xad08('0x23')](function(_0xe7a16){_0x155170['count']=_0xe7a16;if(_0x1f11ac['query']['includeAll']){_0x4bc84b[_0xad08('0x3f')]=[{'all':!![]}];}return db[_0xad08('0x29')][_0xad08('0x40')](_0x4bc84b);})[_0xad08('0x23')](function(_0x20a8ab){_0x155170['rows']=_0x20a8ab;return _0x155170;})['then'](respondWithFilteredResult(_0x4ee365,_0x4bc84b))['catch'](handleError(_0x4ee365,null));};exports['show']=function(_0x297dc2,_0x39e536){var _0xec3620={'raw':![],'where':{'id':_0x297dc2[_0xad08('0x41')]['id']}},_0x59d761={};_0x59d761[_0xad08('0x2c')]=_[_0xad08('0x2f')](db[_0xad08('0x29')][_0xad08('0x2a')]);_0x59d761[_0xad08('0x2e')]=_[_0xad08('0x2f')](_0x297dc2['query']);_0x59d761['filters']=_['intersection'](_0x59d761[_0xad08('0x2c')],_0x59d761[_0xad08('0x2e')]);_0xec3620['attributes']=_[_0xad08('0x31')](_0x59d761['model'],qs[_0xad08('0x32')](_0x297dc2['query'][_0xad08('0x32')]));_0xec3620[_0xad08('0x33')]=_0xec3620['attributes']['length']?_0xec3620['attributes']:_0x59d761[_0xad08('0x2c')];if(_0x297dc2['query'][_0xad08('0x42')]){_0xec3620[_0xad08('0x3f')]=[{'all':!![]}];}_0xec3620=_['merge']({},_0xec3620,_0x297dc2['options']);return db['ZohoConfiguration'][_0xad08('0x43')](_0xec3620)[_0xad08('0x23')](handleEntityNotFound(_0x39e536,null))['then'](respondWithResult(_0x39e536,null))[_0xad08('0x44')](handleError(_0x39e536,null));};exports[_0xad08('0x45')]=function(_0x56e08d,_0x233c46){return db[_0xad08('0x29')][_0xad08('0x45')](_0x56e08d['body'],{})['then'](respondWithResult(_0x233c46,0xc9))['catch'](handleError(_0x233c46,null));};exports[_0xad08('0x21')]=function(_0x42896f,_0x4d8c1c){if(_0x42896f[_0xad08('0x46')]['id']){delete _0x42896f[_0xad08('0x46')]['id'];}return db['ZohoConfiguration'][_0xad08('0x43')]({'where':{'id':_0x42896f[_0xad08('0x41')]['id']}})[_0xad08('0x23')](handleEntityNotFound(_0x4d8c1c,null))[_0xad08('0x23')](saveUpdates(_0x42896f[_0xad08('0x46')],null))[_0xad08('0x23')](respondWithResult(_0x4d8c1c,null))[_0xad08('0x44')](handleError(_0x4d8c1c,null));};exports[_0xad08('0x22')]=function(_0x449847,_0x319aa6){return db[_0xad08('0x29')][_0xad08('0x43')]({'where':{'id':_0x449847['params']['id']}})['then'](handleEntityNotFound(_0x319aa6,null))[_0xad08('0x23')](removeEntity(_0x319aa6,null))[_0xad08('0x44')](handleError(_0x319aa6,null));};exports[_0xad08('0x47')]=function(_0x22a46d,_0x21d26d,_0x20ece3){var _0x3f8d13={};var _0x47faec={};var _0x259b16;var _0x266ec0;return db[_0xad08('0x29')][_0xad08('0x48')]({'where':{'id':_0x22a46d['params']['id']}})[_0xad08('0x23')](handleEntityNotFound(_0x21d26d,null))[_0xad08('0x23')](function(_0x5c4798){if(_0x5c4798){_0x259b16=_0x5c4798;_0x47faec[_0xad08('0x2c')]=_[_0xad08('0x2f')](db[_0xad08('0x49')]['rawAttributes']);_0x47faec['query']=_[_0xad08('0x2f')](_0x22a46d[_0xad08('0x2e')]);_0x47faec[_0xad08('0x30')]=_[_0xad08('0x31')](_0x47faec[_0xad08('0x2c')],_0x47faec[_0xad08('0x2e')]);_0x3f8d13[_0xad08('0x33')]=_[_0xad08('0x31')](_0x47faec[_0xad08('0x2c')],qs[_0xad08('0x32')](_0x22a46d[_0xad08('0x2e')]['fields']));_0x3f8d13[_0xad08('0x33')]=_0x3f8d13[_0xad08('0x33')][_0xad08('0x34')]?_0x3f8d13[_0xad08('0x33')]:_0x47faec[_0xad08('0x2c')];_0x3f8d13[_0xad08('0x36')]=qs[_0xad08('0x37')](_0x22a46d[_0xad08('0x2e')][_0xad08('0x37')]);_0x3f8d13[_0xad08('0x38')]=qs['filters'](_[_0xad08('0x39')](_0x22a46d[_0xad08('0x2e')],_0x47faec[_0xad08('0x30')]));if(_0x22a46d[_0xad08('0x2e')]['filter']){_0x3f8d13[_0xad08('0x38')]=_[_0xad08('0x3b')](_0x3f8d13['where'],{'$or':_[_0xad08('0x2d')](_0x3f8d13['attributes'],function(_0x356668){var _0x2e70ea={};_0x2e70ea[_0x356668]={'$like':'%'+_0x22a46d[_0xad08('0x2e')]['filter']+'%'};return _0x2e70ea;})});}_0x3f8d13=_[_0xad08('0x3b')]({},_0x3f8d13,_0x22a46d[_0xad08('0x3e')]);return _0x259b16['getFields'](_0x3f8d13);}})[_0xad08('0x23')](function(_0x65e075){if(_0x65e075){_0x266ec0=_0x65e075[_0xad08('0x34')];if(!_0x22a46d[_0xad08('0x2e')][_0xad08('0x4a')](_0xad08('0x35'))){_0x3f8d13['limit']=qs[_0xad08('0x1b')](_0x22a46d[_0xad08('0x2e')]['limit']);_0x3f8d13[_0xad08('0x1a')]=qs[_0xad08('0x1a')](_0x22a46d[_0xad08('0x2e')]['offset']);}return _0x259b16[_0xad08('0x47')](_0x3f8d13);}})[_0xad08('0x23')](function(_0x1e6613){if(_0x1e6613){return _0x1e6613?{'count':_0x266ec0,'rows':_0x1e6613}:null;}})['then'](respondWithResult(_0x21d26d,null))[_0xad08('0x44')](handleError(_0x21d26d,null));};exports[_0xad08('0x4b')]=function(_0x15730d,_0x451294,_0x4f2bdd){var _0x2b44de={};var _0x45f0a6={};var _0x4a5588;var _0x2c8b93;return db[_0xad08('0x29')][_0xad08('0x48')]({'where':{'id':_0x15730d['params']['id']}})[_0xad08('0x23')](handleEntityNotFound(_0x451294,null))[_0xad08('0x23')](function(_0x12f296){if(_0x12f296){_0x4a5588=_0x12f296;_0x45f0a6['model']=_[_0xad08('0x2f')](db['ZohoField']['rawAttributes']);_0x45f0a6[_0xad08('0x2e')]=_[_0xad08('0x2f')](_0x15730d[_0xad08('0x2e')]);_0x45f0a6[_0xad08('0x30')]=_['intersection'](_0x45f0a6[_0xad08('0x2c')],_0x45f0a6[_0xad08('0x2e')]);_0x2b44de['attributes']=_['intersection'](_0x45f0a6[_0xad08('0x2c')],qs[_0xad08('0x32')](_0x15730d[_0xad08('0x2e')][_0xad08('0x32')]));_0x2b44de['attributes']=_0x2b44de[_0xad08('0x33')][_0xad08('0x34')]?_0x2b44de[_0xad08('0x33')]:_0x45f0a6[_0xad08('0x2c')];_0x2b44de[_0xad08('0x36')]=qs[_0xad08('0x37')](_0x15730d[_0xad08('0x2e')]['sort']);_0x2b44de[_0xad08('0x38')]=qs[_0xad08('0x30')](_[_0xad08('0x39')](_0x15730d[_0xad08('0x2e')],_0x45f0a6[_0xad08('0x30')]));if(_0x15730d[_0xad08('0x2e')][_0xad08('0x3a')]){_0x2b44de['where']=_['merge'](_0x2b44de[_0xad08('0x38')],{'$or':_[_0xad08('0x2d')](_0x2b44de[_0xad08('0x33')],function(_0x13c2f9){var _0x3a0483={};_0x3a0483[_0x13c2f9]={'$like':'%'+_0x15730d['query'][_0xad08('0x3a')]+'%'};return _0x3a0483;})});}_0x2b44de=_[_0xad08('0x3b')]({},_0x2b44de,_0x15730d[_0xad08('0x3e')]);return _0x4a5588[_0xad08('0x4b')](_0x2b44de);}})[_0xad08('0x23')](function(_0x137bdf){if(_0x137bdf){_0x2c8b93=_0x137bdf[_0xad08('0x34')];if(!_0x15730d[_0xad08('0x2e')][_0xad08('0x4a')](_0xad08('0x35'))){_0x2b44de[_0xad08('0x1b')]=qs['limit'](_0x15730d[_0xad08('0x2e')]['limit']);_0x2b44de['offset']=qs[_0xad08('0x1a')](_0x15730d[_0xad08('0x2e')][_0xad08('0x1a')]);}return _0x4a5588[_0xad08('0x4b')](_0x2b44de);}})[_0xad08('0x23')](function(_0x51ca43){if(_0x51ca43){return _0x51ca43?{'count':_0x2c8b93,'rows':_0x51ca43}:null;}})[_0xad08('0x23')](respondWithResult(_0x451294,null))[_0xad08('0x44')](handleError(_0x451294,null));};exports[_0xad08('0x4c')]=function(_0x4a3acb,_0x5f0204,_0x536692){var _0x1fc498={};var _0x21011a={};var _0x33b244;var _0x125b7e;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x4a3acb['params']['id']}})['then'](handleEntityNotFound(_0x5f0204,null))[_0xad08('0x23')](function(_0x3deffa){if(_0x3deffa){_0x33b244=_0x3deffa;_0x21011a['model']=_[_0xad08('0x2f')](db[_0xad08('0x49')][_0xad08('0x2a')]);_0x21011a[_0xad08('0x2e')]=_[_0xad08('0x2f')](_0x4a3acb[_0xad08('0x2e')]);_0x21011a[_0xad08('0x30')]=_[_0xad08('0x31')](_0x21011a[_0xad08('0x2c')],_0x21011a[_0xad08('0x2e')]);_0x1fc498[_0xad08('0x33')]=_[_0xad08('0x31')](_0x21011a[_0xad08('0x2c')],qs[_0xad08('0x32')](_0x4a3acb['query']['fields']));_0x1fc498[_0xad08('0x33')]=_0x1fc498[_0xad08('0x33')][_0xad08('0x34')]?_0x1fc498[_0xad08('0x33')]:_0x21011a['model'];_0x1fc498['order']=qs[_0xad08('0x37')](_0x4a3acb[_0xad08('0x2e')]['sort']);_0x1fc498[_0xad08('0x38')]=qs[_0xad08('0x30')](_[_0xad08('0x39')](_0x4a3acb['query'],_0x21011a[_0xad08('0x30')]));if(_0x4a3acb[_0xad08('0x2e')][_0xad08('0x3a')]){_0x1fc498['where']=_[_0xad08('0x3b')](_0x1fc498[_0xad08('0x38')],{'$or':_[_0xad08('0x2d')](_0x1fc498[_0xad08('0x33')],function(_0x43e55b){var _0x34f804={};_0x34f804[_0x43e55b]={'$like':'%'+_0x4a3acb['query']['filter']+'%'};return _0x34f804;})});}_0x1fc498=_[_0xad08('0x3b')]({},_0x1fc498,_0x4a3acb[_0xad08('0x3e')]);return _0x33b244[_0xad08('0x4c')](_0x1fc498);}})['then'](function(_0x1c51ed){if(_0x1c51ed){_0x125b7e=_0x1c51ed[_0xad08('0x34')];if(!_0x4a3acb[_0xad08('0x2e')]['hasOwnProperty'](_0xad08('0x35'))){_0x1fc498['limit']=qs['limit'](_0x4a3acb[_0xad08('0x2e')][_0xad08('0x1b')]);_0x1fc498['offset']=qs[_0xad08('0x1a')](_0x4a3acb['query'][_0xad08('0x1a')]);}return _0x33b244[_0xad08('0x4c')](_0x1fc498);}})['then'](function(_0x27fe5a){if(_0x27fe5a){return _0x27fe5a?{'count':_0x125b7e,'rows':_0x27fe5a}:null;}})['then'](respondWithResult(_0x5f0204,null))[_0xad08('0x44')](handleError(_0x5f0204,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 270ef7d..c4fd66b 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 _0x623b=['bluebird','request-promise','path','../../config/environment','define','ZohoConfiguration','lodash','util','../../config/logger','api'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x623b,0x1f0));var _0xb623=function(_0x5773e7,_0x435e69){_0x5773e7=_0x5773e7-0x0;var _0x5e6621=_0x623b[_0x5773e7];return _0x5e6621;};'use strict';var _=require(_0xb623('0x0'));var util=require(_0xb623('0x1'));var logger=require(_0xb623('0x2'))(_0xb623('0x3'));var moment=require('moment');var BPromise=require(_0xb623('0x4'));var rp=require(_0xb623('0x5'));var fs=require('fs');var path=require(_0xb623('0x6'));var rimraf=require('rimraf');var config=require(_0xb623('0x7'));var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x49606f,_0xffad92){return _0x49606f[_0xb623('0x8')](_0xb623('0x9'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74a0=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x41d684,_0x52f976){var _0x83b011=function(_0x1060f5){while(--_0x1060f5){_0x41d684['push'](_0x41d684['shift']());}};_0x83b011(++_0x52f976);}(_0x74a0,0x16c));var _0x074a=function(_0x18b565,_0x2d5768){_0x18b565=_0x18b565-0x0;var _0x21ed0b=_0x74a0[_0x18b565];return _0x21ed0b;};'use strict';var _=require(_0x074a('0x0'));var util=require(_0x074a('0x1'));var logger=require('../../config/logger')(_0x074a('0x2'));var moment=require(_0x074a('0x3'));var BPromise=require(_0x074a('0x4'));var rp=require(_0x074a('0x5'));var fs=require('fs');var path=require(_0x074a('0x6'));var rimraf=require(_0x074a('0x7'));var config=require(_0x074a('0x8'));var attributes=require(_0x074a('0x9'));module[_0x074a('0xa')]=function(_0x203001,_0x140ffa){return _0x203001[_0x074a('0xb')](_0x074a('0xc'),attributes,{'tableName':_0x074a('0xd'),'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 2ae4c33..bb25930 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 _0xfc5b=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xfc5b,0xf5));var _0xbfc5=function(_0x5e8206,_0x5cd036){_0x5e8206=_0x5e8206-0x0;var _0x2c48d8=_0xfc5b[_0x5e8206];return _0x2c48d8;};'use strict';var _=require(_0xbfc5('0x0'));var util=require(_0xbfc5('0x1'));var moment=require(_0xbfc5('0x2'));var BPromise=require(_0xbfc5('0x3'));var rs=require(_0xbfc5('0x4'));var fs=require('fs');var Redis=require(_0xbfc5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbfc5('0x6'));var logger=require(_0xbfc5('0x7'))(_0xbfc5('0x8'));var config=require(_0xbfc5('0x9'));var jayson=require(_0xbfc5('0xa'));var client=jayson[_0xbfc5('0xb')][_0xbfc5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3680a4,_0x25c269,_0x361fac){return new BPromise(function(_0x2d6e63,_0x183a98){return client['request'](_0x3680a4,_0x361fac)[_0xbfc5('0xd')](function(_0x268796){logger[_0xbfc5('0xe')](_0xbfc5('0xf'),_0x25c269,_0xbfc5('0x10'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x25c269,_0xbfc5('0x10'),JSON[_0xbfc5('0x11')](_0x268796));if(_0x268796[_0xbfc5('0x12')]){if(_0x268796['error'][_0xbfc5('0x13')]===0x1f4){logger[_0xbfc5('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x25c269,_0x268796[_0xbfc5('0x12')][_0xbfc5('0x14')]);return _0x183a98(_0x268796['error'][_0xbfc5('0x14')]);}logger[_0xbfc5('0x12')](_0xbfc5('0xf'),_0x25c269,_0x268796[_0xbfc5('0x12')][_0xbfc5('0x14')]);return _0x2d6e63(_0x268796[_0xbfc5('0x12')][_0xbfc5('0x14')]);}else{logger[_0xbfc5('0xe')](_0xbfc5('0xf'),_0x25c269,_0xbfc5('0x10'));_0x2d6e63(_0x268796['result'][_0xbfc5('0x14')]);}})[_0xbfc5('0x15')](function(_0x1cbfe0){logger[_0xbfc5('0x12')](_0xbfc5('0xf'),_0x25c269,_0x1cbfe0);_0x183a98(_0x1cbfe0);});});} \ No newline at end of file +var _0xfc63=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x365b1e,_0x57f33b){var _0x34b833=function(_0x5b4679){while(--_0x5b4679){_0x365b1e['push'](_0x365b1e['shift']());}};_0x34b833(++_0x57f33b);}(_0xfc63,0x118));var _0x3fc6=function(_0x4fb789,_0x1ab7cc){_0x4fb789=_0x4fb789-0x0;var _0x5c4512=_0xfc63[_0x4fb789];return _0x5c4512;};'use strict';var _=require(_0x3fc6('0x0'));var util=require(_0x3fc6('0x1'));var moment=require(_0x3fc6('0x2'));var BPromise=require(_0x3fc6('0x3'));var rs=require(_0x3fc6('0x4'));var fs=require('fs');var Redis=require(_0x3fc6('0x5'));var db=require(_0x3fc6('0x6'))['db'];var utils=require(_0x3fc6('0x7'));var logger=require(_0x3fc6('0x8'))(_0x3fc6('0x9'));var config=require(_0x3fc6('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3fc6('0xb')][_0x3fc6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x551698,_0x40173,_0x28145a){return new BPromise(function(_0x36fa81,_0x15537a){return client[_0x3fc6('0xd')](_0x551698,_0x28145a)[_0x3fc6('0xe')](function(_0x2089d8){logger[_0x3fc6('0xf')](_0x3fc6('0x10'),_0x40173,_0x3fc6('0x11'));logger[_0x3fc6('0x12')](_0x3fc6('0x13'),_0x40173,_0x3fc6('0x11'),JSON['stringify'](_0x2089d8));if(_0x2089d8[_0x3fc6('0x14')]){if(_0x2089d8[_0x3fc6('0x14')][_0x3fc6('0x15')]===0x1f4){logger[_0x3fc6('0x14')](_0x3fc6('0x10'),_0x40173,_0x2089d8[_0x3fc6('0x14')][_0x3fc6('0x16')]);return _0x15537a(_0x2089d8[_0x3fc6('0x14')]['message']);}logger[_0x3fc6('0x14')](_0x3fc6('0x10'),_0x40173,_0x2089d8['error'][_0x3fc6('0x16')]);return _0x36fa81(_0x2089d8[_0x3fc6('0x14')]['message']);}else{logger[_0x3fc6('0xf')](_0x3fc6('0x10'),_0x40173,_0x3fc6('0x11'));_0x36fa81(_0x2089d8[_0x3fc6('0x17')]['message']);}})[_0x3fc6('0x18')](function(_0x1c3203){logger[_0x3fc6('0x14')](_0x3fc6('0x10'),_0x40173,_0x1c3203);_0x15537a(_0x1c3203);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index f666577..f3b197d 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 _0xaf97=['exports','multer','util','connect-timeout','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy'];(function(_0x2a094b,_0x29ee85){var _0x2110c6=function(_0x4d0164){while(--_0x4d0164){_0x2a094b['push'](_0x2a094b['shift']());}};_0x2110c6(++_0x29ee85);}(_0xaf97,0x122));var _0x7af9=function(_0x24bad5,_0x4966f6){_0x24bad5=_0x24bad5-0x0;var _0x581f9f=_0xaf97[_0x24bad5];return _0x581f9f;};'use strict';var multer=require(_0x7af9('0x0'));var util=require(_0x7af9('0x1'));var path=require('path');var timeout=require(_0x7af9('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7af9('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7af9('0x4'));var controller=require(_0x7af9('0x5'));router[_0x7af9('0x6')]('/',auth[_0x7af9('0x7')](),controller[_0x7af9('0x8')]);router[_0x7af9('0x6')](_0x7af9('0x9'),auth[_0x7af9('0x7')](),controller[_0x7af9('0xa')]);router[_0x7af9('0xb')]('/',auth[_0x7af9('0x7')](),controller[_0x7af9('0xc')]);router[_0x7af9('0xd')](_0x7af9('0x9'),auth[_0x7af9('0x7')](),controller['update']);router[_0x7af9('0xe')](_0x7af9('0x9'),auth[_0x7af9('0x7')](),controller[_0x7af9('0xf')]);module[_0x7af9('0x10')]=router; \ No newline at end of file +var _0x4710=['../../components/interaction/service','../../config/environment','./intZohoField.controller','index','get','/:id','isAuthenticated','show','post','create','put','delete','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x1b2103,_0x3501d4){var _0x183d3f=function(_0x432422){while(--_0x432422){_0x1b2103['push'](_0x1b2103['shift']());}};_0x183d3f(++_0x3501d4);}(_0x4710,0x189));var _0x0471=function(_0x207d4c,_0x243595){_0x207d4c=_0x207d4c-0x0;var _0x501314=_0x4710[_0x207d4c];return _0x501314;};'use strict';var multer=require(_0x0471('0x0'));var util=require(_0x0471('0x1'));var path=require(_0x0471('0x2'));var timeout=require('connect-timeout');var express=require(_0x0471('0x3'));var router=express[_0x0471('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0471('0x5'));var interaction=require(_0x0471('0x6'));var config=require(_0x0471('0x7'));var controller=require(_0x0471('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0471('0x9')]);router[_0x0471('0xa')](_0x0471('0xb'),auth[_0x0471('0xc')](),controller[_0x0471('0xd')]);router[_0x0471('0xe')]('/',auth[_0x0471('0xc')](),controller[_0x0471('0xf')]);router[_0x0471('0x10')](_0x0471('0xb'),auth[_0x0471('0xc')](),controller['update']);router[_0x0471('0x11')](_0x0471('0xb'),auth[_0x0471('0xc')](),controller['destroy']);module[_0x0471('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 3177656..6125b38 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 _0xd81a=['picklist','STRING','ENUM','sequelize','exports','string','variable','customVariable'];(function(_0x2f5a22,_0x5e9f03){var _0x326b70=function(_0x1b7bf9){while(--_0x1b7bf9){_0x2f5a22['push'](_0x2f5a22['shift']());}};_0x326b70(++_0x5e9f03);}(_0xd81a,0x12b));var _0xad81=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xd81a[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0xad81('0x0'));module[_0xad81('0x1')]={'type':{'type':Sequelize['ENUM'](_0xad81('0x2'),_0xad81('0x3'),_0xad81('0x4'),'keyValue',_0xad81('0x5')),'defaultValue':_0xad81('0x2')},'content':{'type':Sequelize[_0xad81('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xad81('0x7')](_0xad81('0x2'),_0xad81('0x3'),_0xad81('0x4'))},'keyContent':{'type':Sequelize[_0xad81('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xad81('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xad81('0x6')]}}; \ No newline at end of file +var _0xa41d=['keyValue','string','STRING','sequelize','ENUM','variable','customVariable'];(function(_0x128597,_0x65cb7c){var _0x35a4d9=function(_0x253c3d){while(--_0x253c3d){_0x128597['push'](_0x128597['shift']());}};_0x35a4d9(++_0x65cb7c);}(_0xa41d,0x73));var _0xda41=function(_0x13696c,_0x54374c){_0x13696c=_0x13696c-0x0;var _0x1fd50f=_0xa41d[_0x13696c];return _0x1fd50f;};'use strict';var Sequelize=require(_0xda41('0x0'));module['exports']={'type':{'type':Sequelize[_0xda41('0x1')]('string',_0xda41('0x2'),_0xda41('0x3'),_0xda41('0x4'),'picklist'),'defaultValue':_0xda41('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xda41('0x6')]},'keyType':{'type':Sequelize[_0xda41('0x1')]('string',_0xda41('0x2'),_0xda41('0x3'))},'keyContent':{'type':Sequelize[_0xda41('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xda41('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 2627c94..204c6e1 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 _0x5d6f=['order','sort','pick','filter','where','merge','VIRTUAL','options','ZohoField','then','includeAll','include','findAll','rows','catch','params','keys','intersection','model','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','attributes','fields','hasOwnProperty'];(function(_0x478ea6,_0x40b9fa){var _0x567a0f=function(_0x1f7cf6){while(--_0x1f7cf6){_0x478ea6['push'](_0x478ea6['shift']());}};_0x567a0f(++_0x40b9fa);}(_0x5d6f,0x1d8));var _0xf5d6=function(_0x53dfa7,_0x4ff39d){_0x53dfa7=_0x53dfa7-0x0;var _0xa901d3=_0x5d6f[_0x53dfa7];return _0xa901d3;};'use strict';var emlformat=require(_0xf5d6('0x0'));var rimraf=require(_0xf5d6('0x1'));var zipdir=require(_0xf5d6('0x2'));var jsonpatch=require(_0xf5d6('0x3'));var rp=require(_0xf5d6('0x4'));var moment=require(_0xf5d6('0x5'));var BPromise=require(_0xf5d6('0x6'));var Mustache=require(_0xf5d6('0x7'));var util=require(_0xf5d6('0x8'));var path=require(_0xf5d6('0x9'));var sox=require(_0xf5d6('0xa'));var csv=require(_0xf5d6('0xb'));var ejs=require(_0xf5d6('0xc'));var fs=require('fs');var fs_extra=require(_0xf5d6('0xd'));var _=require(_0xf5d6('0xe'));var squel=require(_0xf5d6('0xf'));var crypto=require('crypto');var jsforce=require(_0xf5d6('0x10'));var deskjs=require(_0xf5d6('0x11'));var toCsv=require('to-csv');var querystring=require(_0xf5d6('0x12'));var Papa=require(_0xf5d6('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf5d6('0x14'));var as=require(_0xf5d6('0x15'));var hardwareService=require(_0xf5d6('0x16'));var logger=require(_0xf5d6('0x17'))(_0xf5d6('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf5d6('0x19'))['db'];function respondWithStatusCode(_0x11ced4,_0x2214f9){_0x2214f9=_0x2214f9||0xcc;return function(_0x26ef95){if(_0x26ef95){return _0x11ced4[_0xf5d6('0x1a')](_0x2214f9);}return _0x11ced4[_0xf5d6('0x1b')](_0x2214f9)[_0xf5d6('0x1c')]();};}function respondWithResult(_0x5e0c54,_0x219ff3){_0x219ff3=_0x219ff3||0xc8;return function(_0x514591){if(_0x514591){return _0x5e0c54[_0xf5d6('0x1b')](_0x219ff3)[_0xf5d6('0x1d')](_0x514591);}};}function respondWithFilteredResult(_0x18811b,_0x1f51de){return function(_0x2a81f3){if(_0x2a81f3){var _0x2984fd=typeof _0x1f51de[_0xf5d6('0x1e')]===_0xf5d6('0x1f')&&typeof _0x1f51de[_0xf5d6('0x20')]===_0xf5d6('0x1f');var _0x1495c5=_0x2a81f3[_0xf5d6('0x21')];var _0x4fb44a=_0x2984fd?0x0:_0x1f51de[_0xf5d6('0x1e')];var _0x466f3d=_0x2984fd?_0x2a81f3['count']:_0x1f51de['offset']+_0x1f51de[_0xf5d6('0x20')];var _0x3e560a;if(_0x466f3d>=_0x1495c5){_0x466f3d=_0x1495c5;_0x3e560a=0xc8;}else{_0x3e560a=0xce;}_0x18811b[_0xf5d6('0x1b')](_0x3e560a);return _0x18811b[_0xf5d6('0x22')](_0xf5d6('0x23'),_0x4fb44a+'-'+_0x466f3d+'/'+_0x1495c5)[_0xf5d6('0x1d')](_0x2a81f3);}return null;};}function patchUpdates(_0x10dfb0){return function(_0x1f7adc){try{jsonpatch[_0xf5d6('0x24')](_0x1f7adc,_0x10dfb0,!![]);}catch(_0x4aa778){return BPromise[_0xf5d6('0x25')](_0x4aa778);}return _0x1f7adc['save']();};}function saveUpdates(_0x43848a,_0xdb9eaf){return function(_0x216dd5){if(_0x216dd5){return _0x216dd5[_0xf5d6('0x26')](_0x43848a)['then'](function(_0x52500c){return _0x52500c;});}return null;};}function removeEntity(_0x43c2d9,_0x55d5f1){return function(_0x44426b){if(_0x44426b){return _0x44426b['destroy']()['then'](function(){_0x43c2d9[_0xf5d6('0x1b')](0xcc)[_0xf5d6('0x1c')]();});}};}function handleEntityNotFound(_0x1d0543,_0x360d27){return function(_0x406349){if(!_0x406349){_0x1d0543[_0xf5d6('0x1a')](0x194);}return _0x406349;};}function handleError(_0x4e7dca,_0x4f826b){_0x4f826b=_0x4f826b||0x1f4;return function(_0x3b0e77){logger[_0xf5d6('0x27')](_0x3b0e77[_0xf5d6('0x28')]);if(_0x3b0e77[_0xf5d6('0x29')]){delete _0x3b0e77[_0xf5d6('0x29')];}_0x4e7dca['status'](_0x4f826b)[_0xf5d6('0x2a')](_0x3b0e77);};}exports[_0xf5d6('0x2b')]=function(_0x2ee147,_0x623867){var _0xba0ff={},_0x27acd3={},_0x44c337={'count':0x0,'rows':[]};var _0x21e152=_[_0xf5d6('0x2c')](db['ZohoField'][_0xf5d6('0x2d')],function(_0x40525f){return{'name':_0x40525f[_0xf5d6('0x2e')],'type':_0x40525f[_0xf5d6('0x2f')]['key']};});_0x27acd3['model']=_[_0xf5d6('0x2c')](_0x21e152,_0xf5d6('0x29'));_0x27acd3[_0xf5d6('0x30')]=_['keys'](_0x2ee147[_0xf5d6('0x30')]);_0x27acd3[_0xf5d6('0x31')]=_['intersection'](_0x27acd3['model'],_0x27acd3[_0xf5d6('0x30')]);_0xba0ff[_0xf5d6('0x32')]=_['intersection'](_0x27acd3['model'],qs[_0xf5d6('0x33')](_0x2ee147['query'][_0xf5d6('0x33')]));_0xba0ff['attributes']=_0xba0ff[_0xf5d6('0x32')]['length']?_0xba0ff[_0xf5d6('0x32')]:_0x27acd3['model'];if(!_0x2ee147['query'][_0xf5d6('0x34')]('nolimit')){_0xba0ff[_0xf5d6('0x20')]=qs[_0xf5d6('0x20')](_0x2ee147[_0xf5d6('0x30')][_0xf5d6('0x20')]);_0xba0ff[_0xf5d6('0x1e')]=qs[_0xf5d6('0x1e')](_0x2ee147[_0xf5d6('0x30')][_0xf5d6('0x1e')]);}_0xba0ff[_0xf5d6('0x35')]=qs[_0xf5d6('0x36')](_0x2ee147[_0xf5d6('0x30')][_0xf5d6('0x36')]);_0xba0ff['where']=qs[_0xf5d6('0x31')](_[_0xf5d6('0x37')](_0x2ee147[_0xf5d6('0x30')],_0x27acd3[_0xf5d6('0x31')]),_0x21e152);if(_0x2ee147[_0xf5d6('0x30')][_0xf5d6('0x38')]){_0xba0ff[_0xf5d6('0x39')]=_[_0xf5d6('0x3a')](_0xba0ff['where'],{'$or':_[_0xf5d6('0x2c')](_0x21e152,function(_0x37e67b){if(_0x37e67b[_0xf5d6('0x2f')]!==_0xf5d6('0x3b')){var _0x3567c8={};_0x3567c8[_0x37e67b[_0xf5d6('0x29')]]={'$like':'%'+_0x2ee147[_0xf5d6('0x30')][_0xf5d6('0x38')]+'%'};return _0x3567c8;}})});}_0xba0ff=_[_0xf5d6('0x3a')]({},_0xba0ff,_0x2ee147[_0xf5d6('0x3c')]);var _0x3f6fa4={'where':_0xba0ff[_0xf5d6('0x39')]};return db[_0xf5d6('0x3d')][_0xf5d6('0x21')](_0x3f6fa4)[_0xf5d6('0x3e')](function(_0x49fa32){_0x44c337[_0xf5d6('0x21')]=_0x49fa32;if(_0x2ee147[_0xf5d6('0x30')][_0xf5d6('0x3f')]){_0xba0ff[_0xf5d6('0x40')]=[{'all':!![]}];}return db[_0xf5d6('0x3d')][_0xf5d6('0x41')](_0xba0ff);})[_0xf5d6('0x3e')](function(_0x392c0d){_0x44c337[_0xf5d6('0x42')]=_0x392c0d;return _0x44c337;})['then'](respondWithFilteredResult(_0x623867,_0xba0ff))[_0xf5d6('0x43')](handleError(_0x623867,null));};exports['show']=function(_0xf20bdf,_0x256f86){var _0x58c235={'raw':!![],'where':{'id':_0xf20bdf[_0xf5d6('0x44')]['id']}},_0xfe0dd0={};_0xfe0dd0['model']=_[_0xf5d6('0x45')](db['ZohoField'][_0xf5d6('0x2d')]);_0xfe0dd0[_0xf5d6('0x30')]=_[_0xf5d6('0x45')](_0xf20bdf[_0xf5d6('0x30')]);_0xfe0dd0[_0xf5d6('0x31')]=_[_0xf5d6('0x46')](_0xfe0dd0['model'],_0xfe0dd0[_0xf5d6('0x30')]);_0x58c235[_0xf5d6('0x32')]=_['intersection'](_0xfe0dd0[_0xf5d6('0x47')],qs['fields'](_0xf20bdf[_0xf5d6('0x30')][_0xf5d6('0x33')]));_0x58c235[_0xf5d6('0x32')]=_0x58c235['attributes']['length']?_0x58c235[_0xf5d6('0x32')]:_0xfe0dd0[_0xf5d6('0x47')];if(_0xf20bdf[_0xf5d6('0x30')][_0xf5d6('0x3f')]){_0x58c235['include']=[{'all':!![]}];}_0x58c235=_[_0xf5d6('0x3a')]({},_0x58c235,_0xf20bdf[_0xf5d6('0x3c')]);return db[_0xf5d6('0x3d')][_0xf5d6('0x48')](_0x58c235)[_0xf5d6('0x3e')](handleEntityNotFound(_0x256f86,null))[_0xf5d6('0x3e')](respondWithResult(_0x256f86,null))['catch'](handleError(_0x256f86,null));};exports[_0xf5d6('0x49')]=function(_0x139176,_0x3aa938){return db['ZohoField']['create'](_0x139176[_0xf5d6('0x4a')],{})[_0xf5d6('0x3e')](respondWithResult(_0x3aa938,0xc9))[_0xf5d6('0x43')](handleError(_0x3aa938,null));};exports[_0xf5d6('0x26')]=function(_0x3d6494,_0x12953f){if(_0x3d6494[_0xf5d6('0x4a')]['id']){delete _0x3d6494[_0xf5d6('0x4a')]['id'];}return db[_0xf5d6('0x3d')]['find']({'where':{'id':_0x3d6494[_0xf5d6('0x44')]['id']}})[_0xf5d6('0x3e')](handleEntityNotFound(_0x12953f,null))[_0xf5d6('0x3e')](saveUpdates(_0x3d6494[_0xf5d6('0x4a')],null))[_0xf5d6('0x3e')](respondWithResult(_0x12953f,null))['catch'](handleError(_0x12953f,null));};exports['destroy']=function(_0x9c1f72,_0x474f94){return db[_0xf5d6('0x3d')][_0xf5d6('0x48')]({'where':{'id':_0x9c1f72[_0xf5d6('0x44')]['id']}})[_0xf5d6('0x3e')](handleEntityNotFound(_0x474f94,null))['then'](removeEntity(_0x474f94,null))[_0xf5d6('0x43')](handleError(_0x474f94,null));}; \ No newline at end of file +var _0x5d40=['hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','map','ZohoField','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','length'];(function(_0x3632fa,_0x30c819){var _0x35c4cf=function(_0x3e8b94){while(--_0x3e8b94){_0x3632fa['push'](_0x3632fa['shift']());}};_0x35c4cf(++_0x30c819);}(_0x5d40,0x145));var _0x05d4=function(_0x5cd039,_0x1b280b){_0x5cd039=_0x5cd039-0x0;var _0x34261e=_0x5d40[_0x5cd039];return _0x34261e;};'use strict';var emlformat=require(_0x05d4('0x0'));var rimraf=require(_0x05d4('0x1'));var zipdir=require(_0x05d4('0x2'));var jsonpatch=require(_0x05d4('0x3'));var rp=require('request-promise');var moment=require(_0x05d4('0x4'));var BPromise=require(_0x05d4('0x5'));var Mustache=require(_0x05d4('0x6'));var util=require('util');var path=require(_0x05d4('0x7'));var sox=require(_0x05d4('0x8'));var csv=require(_0x05d4('0x9'));var ejs=require(_0x05d4('0xa'));var fs=require('fs');var fs_extra=require(_0x05d4('0xb'));var _=require(_0x05d4('0xc'));var squel=require('squel');var crypto=require(_0x05d4('0xd'));var jsforce=require(_0x05d4('0xe'));var deskjs=require(_0x05d4('0xf'));var toCsv=require(_0x05d4('0x9'));var querystring=require(_0x05d4('0x10'));var Papa=require('papaparse');var Redis=require(_0x05d4('0x11'));var authService=require(_0x05d4('0x12'));var qs=require(_0x05d4('0x13'));var as=require(_0x05d4('0x14'));var hardwareService=require(_0x05d4('0x15'));var logger=require(_0x05d4('0x16'))('api');var utils=require(_0x05d4('0x17'));var config=require(_0x05d4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x05d4('0x19'))['db'];function respondWithStatusCode(_0xe63326,_0x434fdb){_0x434fdb=_0x434fdb||0xcc;return function(_0x5133ee){if(_0x5133ee){return _0xe63326['sendStatus'](_0x434fdb);}return _0xe63326[_0x05d4('0x1a')](_0x434fdb)['end']();};}function respondWithResult(_0x304e67,_0x105b95){_0x105b95=_0x105b95||0xc8;return function(_0x1243e7){if(_0x1243e7){return _0x304e67[_0x05d4('0x1a')](_0x105b95)[_0x05d4('0x1b')](_0x1243e7);}};}function respondWithFilteredResult(_0x444287,_0x358c57){return function(_0x5bcc95){if(_0x5bcc95){var _0x5528bd=typeof _0x358c57[_0x05d4('0x1c')]===_0x05d4('0x1d')&&typeof _0x358c57[_0x05d4('0x1e')]===_0x05d4('0x1d');var _0x2ef03f=_0x5bcc95['count'];var _0x28c55b=_0x5528bd?0x0:_0x358c57[_0x05d4('0x1c')];var _0x1c706a=_0x5528bd?_0x5bcc95['count']:_0x358c57[_0x05d4('0x1c')]+_0x358c57[_0x05d4('0x1e')];var _0x27c774;if(_0x1c706a>=_0x2ef03f){_0x1c706a=_0x2ef03f;_0x27c774=0xc8;}else{_0x27c774=0xce;}_0x444287['status'](_0x27c774);return _0x444287[_0x05d4('0x1f')](_0x05d4('0x20'),_0x28c55b+'-'+_0x1c706a+'/'+_0x2ef03f)[_0x05d4('0x1b')](_0x5bcc95);}return null;};}function patchUpdates(_0x2b1386){return function(_0x2ab2fa){try{jsonpatch[_0x05d4('0x21')](_0x2ab2fa,_0x2b1386,!![]);}catch(_0x1fc457){return BPromise[_0x05d4('0x22')](_0x1fc457);}return _0x2ab2fa['save']();};}function saveUpdates(_0x12da07,_0x27d3ce){return function(_0x39653f){if(_0x39653f){return _0x39653f[_0x05d4('0x23')](_0x12da07)[_0x05d4('0x24')](function(_0x3b2068){return _0x3b2068;});}return null;};}function removeEntity(_0x1ee7af,_0xceb6b2){return function(_0x549890){if(_0x549890){return _0x549890[_0x05d4('0x25')]()[_0x05d4('0x24')](function(){_0x1ee7af['status'](0xcc)[_0x05d4('0x26')]();});}};}function handleEntityNotFound(_0x3af03e,_0x1b957d){return function(_0x344722){if(!_0x344722){_0x3af03e['sendStatus'](0x194);}return _0x344722;};}function handleError(_0x76e356,_0x4ec565){_0x4ec565=_0x4ec565||0x1f4;return function(_0x2f393c){logger[_0x05d4('0x27')](_0x2f393c[_0x05d4('0x28')]);if(_0x2f393c[_0x05d4('0x29')]){delete _0x2f393c['name'];}_0x76e356['status'](_0x4ec565)[_0x05d4('0x2a')](_0x2f393c);};}exports['index']=function(_0x37a6d7,_0xef2ea2){var _0x592a88={},_0x1a4541={},_0x838b2a={'count':0x0,'rows':[]};var _0x4fe657=_[_0x05d4('0x2b')](db[_0x05d4('0x2c')][_0x05d4('0x2d')],function(_0x357b9b){return{'name':_0x357b9b[_0x05d4('0x2e')],'type':_0x357b9b[_0x05d4('0x2f')]['key']};});_0x1a4541['model']=_[_0x05d4('0x2b')](_0x4fe657,_0x05d4('0x29'));_0x1a4541['query']=_[_0x05d4('0x30')](_0x37a6d7[_0x05d4('0x31')]);_0x1a4541['filters']=_[_0x05d4('0x32')](_0x1a4541[_0x05d4('0x33')],_0x1a4541[_0x05d4('0x31')]);_0x592a88[_0x05d4('0x34')]=_[_0x05d4('0x32')](_0x1a4541['model'],qs['fields'](_0x37a6d7[_0x05d4('0x31')][_0x05d4('0x35')]));_0x592a88[_0x05d4('0x34')]=_0x592a88[_0x05d4('0x34')][_0x05d4('0x36')]?_0x592a88['attributes']:_0x1a4541[_0x05d4('0x33')];if(!_0x37a6d7[_0x05d4('0x31')][_0x05d4('0x37')](_0x05d4('0x38'))){_0x592a88[_0x05d4('0x1e')]=qs['limit'](_0x37a6d7['query'][_0x05d4('0x1e')]);_0x592a88['offset']=qs['offset'](_0x37a6d7[_0x05d4('0x31')][_0x05d4('0x1c')]);}_0x592a88[_0x05d4('0x39')]=qs[_0x05d4('0x3a')](_0x37a6d7[_0x05d4('0x31')]['sort']);_0x592a88[_0x05d4('0x3b')]=qs[_0x05d4('0x3c')](_['pick'](_0x37a6d7[_0x05d4('0x31')],_0x1a4541[_0x05d4('0x3c')]),_0x4fe657);if(_0x37a6d7['query']['filter']){_0x592a88[_0x05d4('0x3b')]=_[_0x05d4('0x3d')](_0x592a88[_0x05d4('0x3b')],{'$or':_[_0x05d4('0x2b')](_0x4fe657,function(_0x5a3f48){if(_0x5a3f48[_0x05d4('0x2f')]!==_0x05d4('0x3e')){var _0x1cf801={};_0x1cf801[_0x5a3f48[_0x05d4('0x29')]]={'$like':'%'+_0x37a6d7[_0x05d4('0x31')][_0x05d4('0x3f')]+'%'};return _0x1cf801;}})});}_0x592a88=_['merge']({},_0x592a88,_0x37a6d7['options']);var _0x3ea08f={'where':_0x592a88[_0x05d4('0x3b')]};return db[_0x05d4('0x2c')]['count'](_0x3ea08f)[_0x05d4('0x24')](function(_0x5d8f0d){_0x838b2a[_0x05d4('0x40')]=_0x5d8f0d;if(_0x37a6d7[_0x05d4('0x31')][_0x05d4('0x41')]){_0x592a88[_0x05d4('0x42')]=[{'all':!![]}];}return db['ZohoField'][_0x05d4('0x43')](_0x592a88);})[_0x05d4('0x24')](function(_0x9f11c3){_0x838b2a[_0x05d4('0x44')]=_0x9f11c3;return _0x838b2a;})['then'](respondWithFilteredResult(_0xef2ea2,_0x592a88))[_0x05d4('0x45')](handleError(_0xef2ea2,null));};exports[_0x05d4('0x46')]=function(_0x47ce8f,_0x3d7379){var _0x20db7b={'raw':!![],'where':{'id':_0x47ce8f[_0x05d4('0x47')]['id']}},_0x2f3ebd={};_0x2f3ebd[_0x05d4('0x33')]=_[_0x05d4('0x30')](db[_0x05d4('0x2c')][_0x05d4('0x2d')]);_0x2f3ebd[_0x05d4('0x31')]=_[_0x05d4('0x30')](_0x47ce8f[_0x05d4('0x31')]);_0x2f3ebd[_0x05d4('0x3c')]=_[_0x05d4('0x32')](_0x2f3ebd[_0x05d4('0x33')],_0x2f3ebd['query']);_0x20db7b[_0x05d4('0x34')]=_[_0x05d4('0x32')](_0x2f3ebd[_0x05d4('0x33')],qs['fields'](_0x47ce8f['query'][_0x05d4('0x35')]));_0x20db7b['attributes']=_0x20db7b[_0x05d4('0x34')][_0x05d4('0x36')]?_0x20db7b['attributes']:_0x2f3ebd[_0x05d4('0x33')];if(_0x47ce8f[_0x05d4('0x31')]['includeAll']){_0x20db7b[_0x05d4('0x42')]=[{'all':!![]}];}_0x20db7b=_['merge']({},_0x20db7b,_0x47ce8f[_0x05d4('0x48')]);return db[_0x05d4('0x2c')][_0x05d4('0x49')](_0x20db7b)[_0x05d4('0x24')](handleEntityNotFound(_0x3d7379,null))[_0x05d4('0x24')](respondWithResult(_0x3d7379,null))[_0x05d4('0x45')](handleError(_0x3d7379,null));};exports[_0x05d4('0x4a')]=function(_0x56590e,_0xd736e1){return db[_0x05d4('0x2c')][_0x05d4('0x4a')](_0x56590e['body'],{})[_0x05d4('0x24')](respondWithResult(_0xd736e1,0xc9))[_0x05d4('0x45')](handleError(_0xd736e1,null));};exports[_0x05d4('0x23')]=function(_0x169818,_0x169f22){if(_0x169818['body']['id']){delete _0x169818[_0x05d4('0x4b')]['id'];}return db[_0x05d4('0x2c')]['find']({'where':{'id':_0x169818[_0x05d4('0x47')]['id']}})[_0x05d4('0x24')](handleEntityNotFound(_0x169f22,null))[_0x05d4('0x24')](saveUpdates(_0x169818[_0x05d4('0x4b')],null))[_0x05d4('0x24')](respondWithResult(_0x169f22,null))['catch'](handleError(_0x169f22,null));};exports[_0x05d4('0x25')]=function(_0x307d47,_0x5aa74c){return db[_0x05d4('0x2c')][_0x05d4('0x49')]({'where':{'id':_0x307d47[_0x05d4('0x47')]['id']}})[_0x05d4('0x24')](handleEntityNotFound(_0x5aa74c,null))[_0x05d4('0x24')](removeEntity(_0x5aa74c,null))[_0x05d4('0x45')](handleError(_0x5aa74c,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index b977ca3..df7f7b8 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 _0x4745=['../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x6f8972,_0x343da7){var _0x5677d9=function(_0x5eb51f){while(--_0x5eb51f){_0x6f8972['push'](_0x6f8972['shift']());}};_0x5677d9(++_0x343da7);}(_0x4745,0x1e7));var _0x5474=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x4745[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var logger=require(_0x5474('0x2'))(_0x5474('0x3'));var moment=require(_0x5474('0x4'));var BPromise=require(_0x5474('0x5'));var rp=require(_0x5474('0x6'));var fs=require('fs');var path=require(_0x5474('0x7'));var rimraf=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var attributes=require(_0x5474('0xa'));module[_0x5474('0xb')]=function(_0x4e7ce7,_0x3d1e1){return _0x4e7ce7[_0x5474('0xc')]('ZohoField',attributes,{'tableName':_0x5474('0xd'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x5474('0xe'),_0x5474('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash'];(function(_0x1895e5,_0x1c8c08){var _0x5745f6=function(_0x1d1a2c){while(--_0x1d1a2c){_0x1895e5['push'](_0x1895e5['shift']());}};_0x5745f6(++_0x1c8c08);}(_0x4975,0x86));var _0x5497=function(_0x58d738,_0x4b5707){_0x58d738=_0x58d738-0x0;var _0x4fdd35=_0x4975[_0x58d738];return _0x4fdd35;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['idField',_0x5497('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index a4dd44e..e2c8c4a 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 _0xe778=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xbb9b14,_0x2258eb){var _0x31c49e=function(_0x35d15c){while(--_0x35d15c){_0xbb9b14['push'](_0xbb9b14['shift']());}};_0x31c49e(++_0x2258eb);}(_0xe778,0xe7));var _0x8e77=function(_0x3511c9,_0xe0983e){_0x3511c9=_0x3511c9-0x0;var _0x226bc3=_0xe778[_0x3511c9];return _0x226bc3;};'use strict';var _=require(_0x8e77('0x0'));var util=require(_0x8e77('0x1'));var moment=require('moment');var BPromise=require(_0x8e77('0x2'));var rs=require(_0x8e77('0x3'));var fs=require('fs');var Redis=require(_0x8e77('0x4'));var db=require(_0x8e77('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e77('0x6'))(_0x8e77('0x7'));var config=require(_0x8e77('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8e77('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f15af,_0xcfec6e,_0xf0b32a){return new BPromise(function(_0x1a13ef,_0x20fb2c){return client['request'](_0x5f15af,_0xf0b32a)['then'](function(_0xa44695){logger['info'](_0x8e77('0xa'),_0xcfec6e,_0x8e77('0xb'));logger[_0x8e77('0xc')](_0x8e77('0xd'),_0xcfec6e,'request\x20sent',JSON[_0x8e77('0xe')](_0xa44695));if(_0xa44695[_0x8e77('0xf')]){if(_0xa44695[_0x8e77('0xf')]['code']===0x1f4){logger[_0x8e77('0xf')]('ZohoField,\x20%s,\x20%s',_0xcfec6e,_0xa44695[_0x8e77('0xf')][_0x8e77('0x10')]);return _0x20fb2c(_0xa44695['error'][_0x8e77('0x10')]);}logger[_0x8e77('0xf')](_0x8e77('0xa'),_0xcfec6e,_0xa44695[_0x8e77('0xf')]['message']);return _0x1a13ef(_0xa44695[_0x8e77('0xf')]['message']);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0xcfec6e,'request\x20sent');_0x1a13ef(_0xa44695[_0x8e77('0x11')][_0x8e77('0x10')]);}})[_0x8e77('0x12')](function(_0x51160d){logger[_0x8e77('0xf')]('ZohoField,\x20%s,\x20%s',_0xcfec6e,_0x51160d);_0x20fb2c(_0x51160d);});});} \ No newline at end of file +var _0x7ba7=['ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x4adfa4,_0x121c5a){var _0x14cec1=function(_0x4fd975){while(--_0x4fd975){_0x4adfa4['push'](_0x4adfa4['shift']());}};_0x14cec1(++_0x121c5a);}(_0x7ba7,0x1ca));var _0x77ba=function(_0xd8b89f,_0x6312f4){_0xd8b89f=_0xd8b89f-0x0;var _0x3c6e90=_0x7ba7[_0xd8b89f];return _0x3c6e90;};'use strict';var _=require('lodash');var util=require(_0x77ba('0x0'));var moment=require(_0x77ba('0x1'));var BPromise=require(_0x77ba('0x2'));var rs=require(_0x77ba('0x3'));var fs=require('fs');var Redis=require(_0x77ba('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x77ba('0x5'));var logger=require('../../config/logger')(_0x77ba('0x6'));var config=require('../../config/environment');var jayson=require(_0x77ba('0x7'));var client=jayson['client'][_0x77ba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52e2bc,_0x869a1a,_0x83d95){return new BPromise(function(_0x1ffb26,_0x3dd500){return client[_0x77ba('0x9')](_0x52e2bc,_0x83d95)[_0x77ba('0xa')](function(_0x42ae45){logger[_0x77ba('0xb')]('ZohoField,\x20%s,\x20%s',_0x869a1a,_0x77ba('0xc'));logger[_0x77ba('0xd')](_0x77ba('0xe'),_0x869a1a,_0x77ba('0xc'),JSON[_0x77ba('0xf')](_0x42ae45));if(_0x42ae45[_0x77ba('0x10')]){if(_0x42ae45[_0x77ba('0x10')][_0x77ba('0x11')]===0x1f4){logger[_0x77ba('0x10')](_0x77ba('0x12'),_0x869a1a,_0x42ae45[_0x77ba('0x10')][_0x77ba('0x13')]);return _0x3dd500(_0x42ae45[_0x77ba('0x10')][_0x77ba('0x13')]);}logger[_0x77ba('0x10')](_0x77ba('0x12'),_0x869a1a,_0x42ae45[_0x77ba('0x10')]['message']);return _0x1ffb26(_0x42ae45[_0x77ba('0x10')][_0x77ba('0x13')]);}else{logger[_0x77ba('0xb')](_0x77ba('0x12'),_0x869a1a,_0x77ba('0xc'));_0x1ffb26(_0x42ae45[_0x77ba('0x14')][_0x77ba('0x13')]);}})[_0x77ba('0x15')](function(_0x33ff79){logger[_0x77ba('0x10')]('ZohoField,\x20%s,\x20%s',_0x869a1a,_0x33ff79);_0x3dd500(_0x33ff79);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 1380cef..3ff6c91 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x35e898,_0x465f8c){var _0xb82ba=function(_0x35ef0e){while(--_0x35ef0e){_0x35e898['push'](_0x35e898['shift']());}};_0xb82ba(++_0x465f8c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x36bf88,_0x15c459){_0x36bf88=_0x36bf88-0x0;var _0x332914=_0xcb91[_0x36bf88];return _0x332914;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x23b1c2,_0x4e40ea){var _0x254a78=function(_0x6a8bb1){while(--_0x6a8bb1){_0x23b1c2['push'](_0x23b1c2['shift']());}};_0x254a78(++_0x4e40ea);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index f2504f0..d29d7a6 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 _0xe0f5=['BOOLEAN','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x3005d5,_0xf588c7){var _0x547c7e=function(_0x4514dc){while(--_0x4514dc){_0x3005d5['push'](_0x3005d5['shift']());}};_0x547c7e(++_0xf588c7);}(_0xe0f5,0xfd));var _0x5e0f=function(_0x4ccfa1,_0x7148e2){_0x4ccfa1=_0x4ccfa1-0x0;var _0x27e494=_0xe0f5[_0x4ccfa1];return _0x27e494;};'use strict';var Sequelize=require(_0x5e0f('0x0'));module[_0x5e0f('0x1')]={'name':{'type':Sequelize[_0x5e0f('0x2')],'allowNull':![],'unique':_0x5e0f('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5e0f('0x3')},'main':{'type':Sequelize[_0x5e0f('0x2')],'defaultValue':_0x5e0f('0x4')},'filename':{'type':Sequelize[_0x5e0f('0x2')]},'path':{'type':Sequelize[_0x5e0f('0x2')]},'type':{'type':Sequelize[_0x5e0f('0x2')]},'size':{'type':Sequelize[_0x5e0f('0x5')]},'active':{'type':Sequelize[_0x5e0f('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x5e0f('0x2')],'unique':'state'},'description':{'type':Sequelize[_0x5e0f('0x2')]},'title':{'type':Sequelize[_0x5e0f('0x2')]},'remoteUri':{'type':Sequelize[_0x5e0f('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0xac9b=['BOOLEAN','exports','STRING','unique_name_and_version','app.js'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0xac9b,0x8d));var _0xbac9=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xac9b[_0x1eda20];return _0x31b953;};'use strict';var Sequelize=require('sequelize');module[_0xbac9('0x0')]={'name':{'type':Sequelize[_0xbac9('0x1')],'allowNull':![],'unique':_0xbac9('0x2')},'version':{'type':Sequelize[_0xbac9('0x1')],'allowNull':![],'unique':_0xbac9('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xbac9('0x3')},'filename':{'type':Sequelize[_0xbac9('0x1')]},'path':{'type':Sequelize[_0xbac9('0x1')]},'type':{'type':Sequelize[_0xbac9('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xbac9('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0xbac9('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xbac9('0x1')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbac9('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index a3957a0..7e9c428 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 _0x5496=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','Integration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','fields','include','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x5496,0x175));var _0x6549=function(_0x5de20d,_0x20323d){_0x5de20d=_0x5de20d-0x0;var _0x4a55f6=_0x5496[_0x5de20d];return _0x4a55f6;};'use strict';var emlformat=require(_0x6549('0x0'));var rimraf=require(_0x6549('0x1'));var zipdir=require(_0x6549('0x2'));var jsonpatch=require(_0x6549('0x3'));var rp=require(_0x6549('0x4'));var moment=require('moment');var BPromise=require(_0x6549('0x5'));var Mustache=require('mustache');var util=require(_0x6549('0x6'));var path=require(_0x6549('0x7'));var sox=require(_0x6549('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6549('0x9'));var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var as=require(_0x6549('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6549('0x14'));var utils=require(_0x6549('0x15'));var config=require(_0x6549('0x16'));var licenseUtil=require(_0x6549('0x17'));var db=require(_0x6549('0x18'))['db'];function respondWithStatusCode(_0x5bc018,_0x4dfb06){_0x4dfb06=_0x4dfb06||0xcc;return function(_0x3f844f){if(_0x3f844f){return _0x5bc018[_0x6549('0x19')](_0x4dfb06);}return _0x5bc018['status'](_0x4dfb06)[_0x6549('0x1a')]();};}function respondWithResult(_0x150fc8,_0x195d25){_0x195d25=_0x195d25||0xc8;return function(_0x12b068){if(_0x12b068){return _0x150fc8[_0x6549('0x1b')](_0x195d25)[_0x6549('0x1c')](_0x12b068);}};}function respondWithFilteredResult(_0x55c112,_0x5db86d){return function(_0x384f75){if(_0x384f75){var _0x25da29=typeof _0x5db86d['offset']===_0x6549('0x1d')&&typeof _0x5db86d[_0x6549('0x1e')]===_0x6549('0x1d');var _0x387e60=_0x384f75[_0x6549('0x1f')];var _0x53b12b=_0x25da29?0x0:_0x5db86d['offset'];var _0x26a212=_0x25da29?_0x384f75['count']:_0x5db86d['offset']+_0x5db86d[_0x6549('0x1e')];var _0x1e5079;if(_0x26a212>=_0x387e60){_0x26a212=_0x387e60;_0x1e5079=0xc8;}else{_0x1e5079=0xce;}_0x55c112[_0x6549('0x1b')](_0x1e5079);return _0x55c112[_0x6549('0x20')](_0x6549('0x21'),_0x53b12b+'-'+_0x26a212+'/'+_0x387e60)['json'](_0x384f75);}return null;};}function patchUpdates(_0x228117){return function(_0x4b40c1){try{jsonpatch[_0x6549('0x22')](_0x4b40c1,_0x228117,!![]);}catch(_0x72322b){return BPromise[_0x6549('0x23')](_0x72322b);}return _0x4b40c1[_0x6549('0x24')]();};}function saveUpdates(_0x22bcf8,_0x12d547){return function(_0x427b47){if(_0x427b47){return _0x427b47[_0x6549('0x25')](_0x22bcf8)[_0x6549('0x26')](function(_0x6ae00c){return _0x6ae00c;});}return null;};}function removeEntity(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(_0x23c0ba){return _0x23c0ba['destroy']()[_0x6549('0x26')](function(){_0x40d3f9[_0x6549('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126967,_0x29f89e){return function(_0x3768cb){if(!_0x3768cb){_0x126967['sendStatus'](0x194);}return _0x3768cb;};}function handleError(_0x31a95,_0xfb51a1){_0xfb51a1=_0xfb51a1||0x1f4;return function(_0x14de1f){logger[_0x6549('0x27')](_0x14de1f[_0x6549('0x28')]);if(_0x14de1f[_0x6549('0x29')]){delete _0x14de1f[_0x6549('0x29')];}_0x31a95[_0x6549('0x1b')](_0xfb51a1)['send'](_0x14de1f);};}exports[_0x6549('0x2a')]=function(_0x136518,_0x17fdfb){var _0x4c605c={},_0x3f1502={},_0x4acaf5={'count':0x0,'rows':[]};var _0x4f0ad1=_['map'](db[_0x6549('0x2b')][_0x6549('0x2c')],function(_0x4f3069){return{'name':_0x4f3069[_0x6549('0x2d')],'type':_0x4f3069[_0x6549('0x2e')][_0x6549('0x2f')]};});_0x3f1502[_0x6549('0x30')]=_[_0x6549('0x31')](_0x4f0ad1,_0x6549('0x29'));_0x3f1502[_0x6549('0x32')]=_['keys'](_0x136518[_0x6549('0x32')]);_0x3f1502[_0x6549('0x33')]=_[_0x6549('0x34')](_0x3f1502[_0x6549('0x30')],_0x3f1502[_0x6549('0x32')]);_0x4c605c[_0x6549('0x35')]=_['intersection'](_0x3f1502[_0x6549('0x30')],qs['fields'](_0x136518[_0x6549('0x32')]['fields']));_0x4c605c[_0x6549('0x35')]=_0x4c605c[_0x6549('0x35')][_0x6549('0x36')]?_0x4c605c['attributes']:_0x3f1502[_0x6549('0x30')];if(!_0x136518[_0x6549('0x32')][_0x6549('0x37')](_0x6549('0x38'))){_0x4c605c['limit']=qs['limit'](_0x136518['query'][_0x6549('0x1e')]);_0x4c605c[_0x6549('0x39')]=qs['offset'](_0x136518[_0x6549('0x32')][_0x6549('0x39')]);}_0x4c605c[_0x6549('0x3a')]=qs[_0x6549('0x3b')](_0x136518[_0x6549('0x32')]['sort']);_0x4c605c['where']=qs[_0x6549('0x33')](_[_0x6549('0x3c')](_0x136518[_0x6549('0x32')],_0x3f1502[_0x6549('0x33')]),_0x4f0ad1);if(_0x136518[_0x6549('0x32')][_0x6549('0x3d')]){_0x4c605c[_0x6549('0x3e')]=_[_0x6549('0x3f')](_0x4c605c[_0x6549('0x3e')],{'$or':_[_0x6549('0x31')](_0x4f0ad1,function(_0x525f82){if(_0x525f82[_0x6549('0x2e')]!==_0x6549('0x40')){var _0x2ea977={};_0x2ea977[_0x525f82[_0x6549('0x29')]]={'$like':'%'+_0x136518[_0x6549('0x32')]['filter']+'%'};return _0x2ea977;}})});}_0x4c605c=_['merge']({},_0x4c605c,_0x136518['options']);var _0x22b919={'where':_0x4c605c[_0x6549('0x3e')]};return db[_0x6549('0x2b')][_0x6549('0x1f')](_0x22b919)['then'](function(_0x56ce9f){_0x4acaf5[_0x6549('0x1f')]=_0x56ce9f;if(_0x136518[_0x6549('0x32')][_0x6549('0x41')]){_0x4c605c['include']=[{'all':!![]}];}return db[_0x6549('0x2b')]['findAll'](_0x4c605c);})[_0x6549('0x26')](function(_0x2ec614){_0x4acaf5[_0x6549('0x42')]=_0x2ec614;return _0x4acaf5;})[_0x6549('0x26')](respondWithFilteredResult(_0x17fdfb,_0x4c605c))[_0x6549('0x43')](handleError(_0x17fdfb,null));};exports[_0x6549('0x44')]=function(_0xbbfdc9,_0x4deaab){var _0x132625={'raw':![],'where':{'id':_0xbbfdc9[_0x6549('0x45')]['id']}},_0x309f45={};_0x309f45[_0x6549('0x30')]=_[_0x6549('0x46')](db[_0x6549('0x2b')][_0x6549('0x2c')]);_0x309f45[_0x6549('0x32')]=_[_0x6549('0x46')](_0xbbfdc9[_0x6549('0x32')]);_0x309f45[_0x6549('0x33')]=_[_0x6549('0x34')](_0x309f45[_0x6549('0x30')],_0x309f45[_0x6549('0x32')]);_0x132625[_0x6549('0x35')]=_[_0x6549('0x34')](_0x309f45['model'],qs[_0x6549('0x47')](_0xbbfdc9[_0x6549('0x32')][_0x6549('0x47')]));_0x132625[_0x6549('0x35')]=_0x132625['attributes'][_0x6549('0x36')]?_0x132625['attributes']:_0x309f45[_0x6549('0x30')];if(_0xbbfdc9[_0x6549('0x32')]['includeAll']){_0x132625[_0x6549('0x48')]=[{'all':!![]}];}_0x132625=_[_0x6549('0x3f')]({},_0x132625,_0xbbfdc9[_0x6549('0x49')]);return db[_0x6549('0x2b')][_0x6549('0x4a')](_0x132625)['then'](handleEntityNotFound(_0x4deaab,null))['then'](respondWithResult(_0x4deaab,null))[_0x6549('0x43')](handleError(_0x4deaab,null));};exports[_0x6549('0x4b')]=function(_0x41d675,_0x1712f3){return db[_0x6549('0x2b')]['create'](_0x41d675[_0x6549('0x4c')],{})[_0x6549('0x26')](respondWithResult(_0x1712f3,0xc9))[_0x6549('0x43')](handleError(_0x1712f3,null));};exports[_0x6549('0x25')]=function(_0xa4c650,_0x25a6ee){if(_0xa4c650[_0x6549('0x4c')]['id']){delete _0xa4c650[_0x6549('0x4c')]['id'];}return db['Integration'][_0x6549('0x4a')]({'where':{'id':_0xa4c650['params']['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x25a6ee,null))[_0x6549('0x26')](saveUpdates(_0xa4c650[_0x6549('0x4c')],null))['then'](respondWithResult(_0x25a6ee,null))[_0x6549('0x43')](handleError(_0x25a6ee,null));};exports[_0x6549('0x4d')]=function(_0x2ef4d2,_0x5300c8){return db[_0x6549('0x2b')][_0x6549('0x4a')]({'where':{'id':_0x2ef4d2[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x5300c8,null))[_0x6549('0x26')](removeEntity(_0x5300c8,null))[_0x6549('0x43')](handleError(_0x5300c8,null));}; \ No newline at end of file +var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','Integration','fieldName','type','key'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xadb5,0xad));var _0x5adb=function(_0x213830,_0x597d5f){_0x213830=_0x213830-0x0;var _0x394095=_0xadb5[_0x213830];return _0x394095;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['Integration']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 07728ef..e088d65 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 _0x5326=['integrations','api','moment','bluebird','rimraf','./integration.attributes','exports','define','Integration'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x5326,0x1ba));var _0x6532=function(_0x4a9148,_0x4a699e){_0x4a9148=_0x4a9148-0x0;var _0x27057a=_0x5326[_0x4a9148];return _0x27057a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x6532('0x0'));var moment=require(_0x6532('0x1'));var BPromise=require(_0x6532('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6532('0x3'));var config=require('../../config/environment');var attributes=require(_0x6532('0x4'));module[_0x6532('0x5')]=function(_0x349719,_0x267b8d){return _0x349719[_0x6532('0x6')](_0x6532('0x7'),attributes,{'tableName':_0x6532('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a65=['moment','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','api'];(function(_0x413cc7,_0xb1003e){var _0x3fa9b4=function(_0x31b756){while(--_0x31b756){_0x413cc7['push'](_0x413cc7['shift']());}};_0x3fa9b4(++_0xb1003e);}(_0x0a65,0x158));var _0x50a6=function(_0x1ad325,_0x4389c6){_0x1ad325=_0x1ad325-0x0;var _0x5d0386=_0x0a65[_0x1ad325];return _0x5d0386;};'use strict';var _=require(_0x50a6('0x0'));var util=require(_0x50a6('0x1'));var logger=require(_0x50a6('0x2'))(_0x50a6('0x3'));var moment=require(_0x50a6('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x50a6('0x5'));var config=require(_0x50a6('0x6'));var attributes=require(_0x50a6('0x7'));module[_0x50a6('0x8')]=function(_0x472ffd,_0x1b0c14){return _0x472ffd[_0x50a6('0x9')](_0x50a6('0xa'),attributes,{'tableName':_0x50a6('0xb'),'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 4ae4e92..29efb5a 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 _0x0295=['client','http','then','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','Integration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x8330a2,_0x177ecc){var _0x5243c6=function(_0x55998f){while(--_0x55998f){_0x8330a2['push'](_0x8330a2['shift']());}};_0x5243c6(++_0x177ecc);}(_0x0295,0x1f0));var _0x5029=function(_0x913b85,_0x213182){_0x913b85=_0x913b85-0x0;var _0x1ce434=_0x0295[_0x913b85];return _0x1ce434;};'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')]('Integration,\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);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x4975,0x86));var _0x5497=function(_0x167adb,_0x5517c3){_0x167adb=_0x167adb-0x0;var _0x102753=_0x4975[_0x167adb];return _0x102753;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Integration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 000548c..91d2517 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 _0x66fa=['index','get','/describe','post','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x5cf99f,_0x450e05){var _0xeedf3a=function(_0x21f600){while(--_0x21f600){_0x5cf99f['push'](_0x5cf99f['shift']());}};_0xeedf3a(++_0x450e05);}(_0x66fa,0x117));var _0xa66f=function(_0x46ef1d,_0x24926){_0x46ef1d=_0x46ef1d-0x0;var _0x49ce69=_0x66fa[_0x46ef1d];return _0x49ce69;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xe'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xf')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0x10')]=router; \ No newline at end of file +var _0x187d=['/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x1c3517,_0x29132c){var _0x414567=function(_0x31ad0b){while(--_0x31ad0b){_0x1c3517['push'](_0x1c3517['shift']());}};_0x414567(++_0x29132c);}(_0x187d,0x93));var _0xd187=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x187d[_0x40bffc];return _0x3007e9;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0x10')]('/',auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0x12')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0x13')]);router[_0xd187('0x14')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0x15')]);module[_0xd187('0x16')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index f7ac2dd..20aff38 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 _0xc593=['ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xc593,0x1d9));var _0x3c59=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xc593[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x3c59('0x0'));module[_0x3c59('0x1')]={'integration':{'type':Sequelize[_0x3c59('0x2')]},'eventChannel':{'type':Sequelize[_0x3c59('0x2')]},'exitStatus':{'type':Sequelize[_0x3c59('0x2')]},'ticketId':{'type':Sequelize[_0x3c59('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x3c59('0x2')]},'uniqueid':{'type':Sequelize[_0x3c59('0x2')]},'calleridnum':{'type':Sequelize[_0x3c59('0x2')]},'calleridname':{'type':Sequelize[_0x3c59('0x2')]},'queue':{'type':Sequelize[_0x3c59('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x3c59('0x2')]},'agentcalledAt':{'type':Sequelize[_0x3c59('0x3')]},'agentconnectAt':{'type':Sequelize[_0x3c59('0x3')]},'holdtime':{'type':Sequelize[_0x3c59('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x3c59('0x3')]},'talktime':{'type':Sequelize[_0x3c59('0x4')]},'agentacw':{'type':Sequelize[_0x3c59('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x3c59('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x3c59('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x3c59('0x3')]},'agentdump':{'type':Sequelize[_0x3c59('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x3c59('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3c59('0x2')]},'channelstate':{'type':Sequelize[_0x3c59('0x4')]},'channelstatedesc':{'type':Sequelize[_0x3c59('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3c59('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x3c59('0x2')]},'exten':{'type':Sequelize[_0x3c59('0x2')]},'priority':{'type':Sequelize[_0x3c59('0x2')]},'destchannel':{'type':Sequelize[_0x3c59('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x3c59('0x2')]},'destcalleridnum':{'type':Sequelize[_0x3c59('0x2')]},'destcalleridname':{'type':Sequelize[_0x3c59('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x3c59('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x3c59('0x2')]},'destlanguage':{'type':Sequelize[_0x3c59('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x3c59('0x2')]},'destexten':{'type':Sequelize[_0x3c59('0x2')]},'destpriority':{'type':Sequelize[_0x3c59('0x2')]},'destuniqueid':{'type':Sequelize[_0x3c59('0x2')]},'messageId':{'type':Sequelize[_0x3c59('0x2')]},'inReplyTo':{'type':Sequelize[_0x3c59('0x2')]},'subject':{'type':Sequelize[_0x3c59('0x2')]},'from':{'type':Sequelize[_0x3c59('0x2')]},'to':{'type':Sequelize[_0x3c59('0x2')]},'cc':{'type':Sequelize[_0x3c59('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x3c59('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x3c59('0x7')](_0x3c59('0x8'),_0x3c59('0x9'),_0x3c59('0xa'),_0x3c59('0xb'))},'url':{'type':Sequelize[_0x3c59('0x2')]},'app':{'type':Sequelize[_0x3c59('0x2')]},'appdata':{'type':Sequelize[_0x3c59('0x2')]},'projectId':{'type':Sequelize[_0x3c59('0x4')]}}; \ No newline at end of file +var _0xc627=['TEXT','ENUM','SENT','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x1bede7,_0x518f32){var _0x914a90=function(_0x59b998){while(--_0x59b998){_0x1bede7['push'](_0x1bede7['shift']());}};_0x914a90(++_0x518f32);}(_0xc627,0x1de));var _0x7c62=function(_0x28c759,_0x2d978f){_0x28c759=_0x28c759-0x0;var _0x5b206c=_0xc627[_0x28c759];return _0x5b206c;};'use strict';var Sequelize=require(_0x7c62('0x0'));module[_0x7c62('0x1')]={'integration':{'type':Sequelize[_0x7c62('0x2')]},'eventChannel':{'type':Sequelize[_0x7c62('0x2')]},'exitStatus':{'type':Sequelize[_0x7c62('0x2')]},'ticketId':{'type':Sequelize[_0x7c62('0x2')]},'integrationId':{'type':Sequelize[_0x7c62('0x3')]},'contacts':{'type':Sequelize[_0x7c62('0x2')]},'uniqueid':{'type':Sequelize[_0x7c62('0x2')]},'calleridnum':{'type':Sequelize[_0x7c62('0x2')]},'calleridname':{'type':Sequelize[_0x7c62('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x7c62('0x2')]},'membername':{'type':Sequelize[_0x7c62('0x2')]},'agentcalledAt':{'type':Sequelize[_0x7c62('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x7c62('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x7c62('0x4')]},'talktime':{'type':Sequelize[_0x7c62('0x3')]},'agentacw':{'type':Sequelize[_0x7c62('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x7c62('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x7c62('0x4')]},'agentdump':{'type':Sequelize[_0x7c62('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x7c62('0x2')]},'channel':{'type':Sequelize[_0x7c62('0x2')]},'channelstate':{'type':Sequelize[_0x7c62('0x3')]},'channelstatedesc':{'type':Sequelize[_0x7c62('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7c62('0x2')]},'connectedlinename':{'type':Sequelize[_0x7c62('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7c62('0x2')]},'context':{'type':Sequelize[_0x7c62('0x2')]},'exten':{'type':Sequelize[_0x7c62('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7c62('0x2')]},'destchannelstate':{'type':Sequelize[_0x7c62('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x7c62('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7c62('0x2')]},'destcalleridname':{'type':Sequelize[_0x7c62('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7c62('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x7c62('0x2')]},'destaccountcode':{'type':Sequelize[_0x7c62('0x2')]},'destcontext':{'type':Sequelize[_0x7c62('0x2')]},'destexten':{'type':Sequelize[_0x7c62('0x2')]},'destpriority':{'type':Sequelize[_0x7c62('0x2')]},'destuniqueid':{'type':Sequelize[_0x7c62('0x2')]},'messageId':{'type':Sequelize[_0x7c62('0x2')]},'inReplyTo':{'type':Sequelize[_0x7c62('0x2')]},'subject':{'type':Sequelize[_0x7c62('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x7c62('0x2')]},'cc':{'type':Sequelize[_0x7c62('0x2')]},'attachment':{'type':Sequelize[_0x7c62('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x7c62('0x7')](_0x7c62('0x8'),'SENDING',_0x7c62('0x9'),_0x7c62('0xa'))},'url':{'type':Sequelize[_0x7c62('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x7c62('0x2')]},'projectId':{'type':Sequelize[_0x7c62('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index ce70f86..f8d3a31 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 _0x6b92=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','then','destroy','error','stack','name','send','index','IntegrationReport','type','key','model','map','keys','intersection','fields','query','attributes','length','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','find','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x571f36,_0x58551e){var _0x12724f=function(_0x6e7d5f){while(--_0x6e7d5f){_0x571f36['push'](_0x571f36['shift']());}};_0x12724f(++_0x58551e);}(_0x6b92,0x80));var _0x26b9=function(_0x2db3d3,_0x5dc096){_0x2db3d3=_0x2db3d3-0x0;var _0xf00dbd=_0x6b92[_0x2db3d3];return _0xf00dbd;};'use strict';var emlformat=require(_0x26b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26b9('0x1'));var jsonpatch=require(_0x26b9('0x2'));var rp=require('request-promise');var moment=require(_0x26b9('0x3'));var BPromise=require(_0x26b9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x26b9('0x5'));var sox=require(_0x26b9('0x6'));var csv=require(_0x26b9('0x7'));var ejs=require(_0x26b9('0x8'));var fs=require('fs');var fs_extra=require(_0x26b9('0x9'));var _=require(_0x26b9('0xa'));var squel=require(_0x26b9('0xb'));var crypto=require(_0x26b9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x26b9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x26b9('0xe'));var Papa=require(_0x26b9('0xf'));var Redis=require(_0x26b9('0x10'));var authService=require(_0x26b9('0x11'));var qs=require(_0x26b9('0x12'));var as=require(_0x26b9('0x13'));var hardwareService=require(_0x26b9('0x14'));var logger=require(_0x26b9('0x15'))(_0x26b9('0x16'));var utils=require(_0x26b9('0x17'));var config=require(_0x26b9('0x18'));var licenseUtil=require(_0x26b9('0x19'));var db=require(_0x26b9('0x1a'))['db'];function respondWithStatusCode(_0x208f36,_0x5c0ace){_0x5c0ace=_0x5c0ace||0xcc;return function(_0x472624){if(_0x472624){return _0x208f36[_0x26b9('0x1b')](_0x5c0ace);}return _0x208f36[_0x26b9('0x1c')](_0x5c0ace)[_0x26b9('0x1d')]();};}function respondWithResult(_0x650705,_0x349ca0){_0x349ca0=_0x349ca0||0xc8;return function(_0x2b5725){if(_0x2b5725){return _0x650705[_0x26b9('0x1c')](_0x349ca0)[_0x26b9('0x1e')](_0x2b5725);}};}function respondWithFilteredResult(_0x12554b,_0x5e77dc){return function(_0x571c75){if(_0x571c75){var _0x4b20f3=typeof _0x5e77dc['offset']===_0x26b9('0x1f')&&typeof _0x5e77dc[_0x26b9('0x20')]===_0x26b9('0x1f');var _0x773f61=_0x571c75[_0x26b9('0x21')];var _0xa139d3=_0x4b20f3?0x0:_0x5e77dc[_0x26b9('0x22')];var _0x4837e5=_0x4b20f3?_0x571c75[_0x26b9('0x21')]:_0x5e77dc[_0x26b9('0x22')]+_0x5e77dc['limit'];var _0xe71aaa;if(_0x4837e5>=_0x773f61){_0x4837e5=_0x773f61;_0xe71aaa=0xc8;}else{_0xe71aaa=0xce;}_0x12554b[_0x26b9('0x1c')](_0xe71aaa);return _0x12554b['set'](_0x26b9('0x23'),_0xa139d3+'-'+_0x4837e5+'/'+_0x773f61)['json'](_0x571c75);}return null;};}function patchUpdates(_0x1982a7){return function(_0x229dfe){try{jsonpatch['apply'](_0x229dfe,_0x1982a7,!![]);}catch(_0x47c465){return BPromise[_0x26b9('0x24')](_0x47c465);}return _0x229dfe[_0x26b9('0x25')]();};}function saveUpdates(_0x35cc2c,_0xf9b15){return function(_0xbab2db){if(_0xbab2db){return _0xbab2db['update'](_0x35cc2c)[_0x26b9('0x26')](function(_0x21bba5){return _0x21bba5;});}return null;};}function removeEntity(_0xd41352,_0x4eb130){return function(_0x1233c8){if(_0x1233c8){return _0x1233c8[_0x26b9('0x27')]()[_0x26b9('0x26')](function(){_0xd41352[_0x26b9('0x1c')](0xcc)[_0x26b9('0x1d')]();});}};}function handleEntityNotFound(_0x3bff6a,_0x40f5fe){return function(_0x4bb0d3){if(!_0x4bb0d3){_0x3bff6a[_0x26b9('0x1b')](0x194);}return _0x4bb0d3;};}function handleError(_0x49b7da,_0xb1ae95){_0xb1ae95=_0xb1ae95||0x1f4;return function(_0x45a28b){logger[_0x26b9('0x28')](_0x45a28b[_0x26b9('0x29')]);if(_0x45a28b[_0x26b9('0x2a')]){delete _0x45a28b[_0x26b9('0x2a')];}_0x49b7da[_0x26b9('0x1c')](_0xb1ae95)[_0x26b9('0x2b')](_0x45a28b);};}exports[_0x26b9('0x2c')]=function(_0x544fe6,_0x1beb3b){var _0x17228a={},_0x34fc28={},_0x4babd8={'count':0x0,'rows':[]};var _0xbc1d77=_['map'](db[_0x26b9('0x2d')]['rawAttributes'],function(_0x44bf90){return{'name':_0x44bf90['fieldName'],'type':_0x44bf90[_0x26b9('0x2e')][_0x26b9('0x2f')]};});_0x34fc28[_0x26b9('0x30')]=_[_0x26b9('0x31')](_0xbc1d77,'name');_0x34fc28['query']=_[_0x26b9('0x32')](_0x544fe6['query']);_0x34fc28['filters']=_[_0x26b9('0x33')](_0x34fc28[_0x26b9('0x30')],_0x34fc28['query']);_0x17228a['attributes']=_[_0x26b9('0x33')](_0x34fc28[_0x26b9('0x30')],qs[_0x26b9('0x34')](_0x544fe6[_0x26b9('0x35')][_0x26b9('0x34')]));_0x17228a[_0x26b9('0x36')]=_0x17228a[_0x26b9('0x36')][_0x26b9('0x37')]?_0x17228a[_0x26b9('0x36')]:_0x34fc28[_0x26b9('0x30')];if(!_0x544fe6['query']['hasOwnProperty'](_0x26b9('0x38'))){_0x17228a['limit']=qs['limit'](_0x544fe6[_0x26b9('0x35')][_0x26b9('0x20')]);_0x17228a[_0x26b9('0x22')]=qs[_0x26b9('0x22')](_0x544fe6[_0x26b9('0x35')][_0x26b9('0x22')]);}_0x17228a[_0x26b9('0x39')]=qs[_0x26b9('0x3a')](_0x544fe6[_0x26b9('0x35')][_0x26b9('0x3a')]);_0x17228a[_0x26b9('0x3b')]=qs[_0x26b9('0x3c')](_[_0x26b9('0x3d')](_0x544fe6[_0x26b9('0x35')],_0x34fc28[_0x26b9('0x3c')]),_0xbc1d77);if(_0x544fe6[_0x26b9('0x35')]['filter']){_0x17228a[_0x26b9('0x3b')]=_[_0x26b9('0x3e')](_0x17228a[_0x26b9('0x3b')],{'$or':_['map'](_0xbc1d77,function(_0x31e573){if(_0x31e573[_0x26b9('0x2e')]!=='VIRTUAL'){var _0x286052={};_0x286052[_0x31e573[_0x26b9('0x2a')]]={'$like':'%'+_0x544fe6[_0x26b9('0x35')][_0x26b9('0x3f')]+'%'};return _0x286052;}})});}_0x17228a=_[_0x26b9('0x3e')]({},_0x17228a,_0x544fe6[_0x26b9('0x40')]);var _0x38deff={'where':_0x17228a[_0x26b9('0x3b')]};return db[_0x26b9('0x2d')][_0x26b9('0x21')](_0x38deff)['then'](function(_0x473097){_0x4babd8['count']=_0x473097;if(_0x544fe6[_0x26b9('0x35')][_0x26b9('0x41')]){_0x17228a[_0x26b9('0x42')]=[{'all':!![]}];}return db[_0x26b9('0x2d')][_0x26b9('0x43')](_0x17228a);})[_0x26b9('0x26')](function(_0x52c236){_0x4babd8[_0x26b9('0x44')]=_0x52c236;return _0x4babd8;})[_0x26b9('0x26')](respondWithFilteredResult(_0x1beb3b,_0x17228a))[_0x26b9('0x45')](handleError(_0x1beb3b,null));};exports['show']=function(_0x582a81,_0x49f8a0){var _0x1db117={'raw':![],'where':{'id':_0x582a81[_0x26b9('0x46')]['id']}},_0x36b053={};_0x36b053['model']=_[_0x26b9('0x32')](db[_0x26b9('0x2d')][_0x26b9('0x47')]);_0x36b053[_0x26b9('0x35')]=_[_0x26b9('0x32')](_0x582a81[_0x26b9('0x35')]);_0x36b053['filters']=_[_0x26b9('0x33')](_0x36b053[_0x26b9('0x30')],_0x36b053[_0x26b9('0x35')]);_0x1db117[_0x26b9('0x36')]=_['intersection'](_0x36b053['model'],qs[_0x26b9('0x34')](_0x582a81[_0x26b9('0x35')][_0x26b9('0x34')]));_0x1db117[_0x26b9('0x36')]=_0x1db117[_0x26b9('0x36')][_0x26b9('0x37')]?_0x1db117[_0x26b9('0x36')]:_0x36b053[_0x26b9('0x30')];if(_0x582a81[_0x26b9('0x35')][_0x26b9('0x41')]){_0x1db117['include']=[{'all':!![]}];}_0x1db117=_['merge']({},_0x1db117,_0x582a81[_0x26b9('0x40')]);return db[_0x26b9('0x2d')]['find'](_0x1db117)[_0x26b9('0x26')](handleEntityNotFound(_0x49f8a0,null))[_0x26b9('0x26')](respondWithResult(_0x49f8a0,null))[_0x26b9('0x45')](handleError(_0x49f8a0,null));};exports[_0x26b9('0x48')]=function(_0x5a425f,_0x4c6b79){return db[_0x26b9('0x2d')]['create'](_0x5a425f[_0x26b9('0x49')],{})[_0x26b9('0x26')](respondWithResult(_0x4c6b79,0xc9))[_0x26b9('0x45')](handleError(_0x4c6b79,null));};exports['update']=function(_0x6c903a,_0x538eb7){if(_0x6c903a[_0x26b9('0x49')]['id']){delete _0x6c903a[_0x26b9('0x49')]['id'];}return db[_0x26b9('0x2d')][_0x26b9('0x4a')]({'where':{'id':_0x6c903a['params']['id']}})[_0x26b9('0x26')](handleEntityNotFound(_0x538eb7,null))[_0x26b9('0x26')](saveUpdates(_0x6c903a[_0x26b9('0x49')],null))[_0x26b9('0x26')](respondWithResult(_0x538eb7,null))[_0x26b9('0x45')](handleError(_0x538eb7,null));};exports[_0x26b9('0x27')]=function(_0x500458,_0x4b3395){return db[_0x26b9('0x2d')][_0x26b9('0x4a')]({'where':{'id':_0x500458[_0x26b9('0x46')]['id']}})[_0x26b9('0x26')](handleEntityNotFound(_0x4b3395,null))[_0x26b9('0x26')](removeEntity(_0x4b3395,null))['catch'](handleError(_0x4b3395,null));};exports[_0x26b9('0x4b')]=function(_0x41a2d7,_0x5dd3c1){return db[_0x26b9('0x2d')]['describe']()[_0x26b9('0x26')](respondWithResult(_0x5dd3c1,null))[_0x26b9('0x45')](handleError(_0x5dd3c1,null));}; \ No newline at end of file +var _0x8531=['limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','map','options','IntegrationReport','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x47e7dd,_0x51b041){var _0x38501f=function(_0x5ba66d){while(--_0x5ba66d){_0x47e7dd['push'](_0x47e7dd['shift']());}};_0x38501f(++_0x51b041);}(_0x8531,0x78));var _0x1853=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0x8531[_0x576d8a];return _0x3dc3ef;};'use strict';var emlformat=require(_0x1853('0x0'));var rimraf=require(_0x1853('0x1'));var zipdir=require(_0x1853('0x2'));var jsonpatch=require(_0x1853('0x3'));var rp=require(_0x1853('0x4'));var moment=require(_0x1853('0x5'));var BPromise=require(_0x1853('0x6'));var Mustache=require(_0x1853('0x7'));var util=require('util');var path=require('path');var sox=require(_0x1853('0x8'));var csv=require(_0x1853('0x9'));var ejs=require(_0x1853('0xa'));var fs=require('fs');var fs_extra=require(_0x1853('0xb'));var _=require(_0x1853('0xc'));var squel=require(_0x1853('0xd'));var crypto=require('crypto');var jsforce=require(_0x1853('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1853('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1853('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1853('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1853('0x11'));var logger=require('../../config/logger')(_0x1853('0x12'));var utils=require(_0x1853('0x13'));var config=require(_0x1853('0x14'));var licenseUtil=require(_0x1853('0x15'));var db=require(_0x1853('0x16'))['db'];function respondWithStatusCode(_0x573a6a,_0x35aeb3){_0x35aeb3=_0x35aeb3||0xcc;return function(_0x1de9c7){if(_0x1de9c7){return _0x573a6a[_0x1853('0x17')](_0x35aeb3);}return _0x573a6a[_0x1853('0x18')](_0x35aeb3)[_0x1853('0x19')]();};}function respondWithResult(_0x7c3edb,_0x175619){_0x175619=_0x175619||0xc8;return function(_0x2fa74e){if(_0x2fa74e){return _0x7c3edb[_0x1853('0x18')](_0x175619)['json'](_0x2fa74e);}};}function respondWithFilteredResult(_0x567cf7,_0x267fb1){return function(_0x2b7694){if(_0x2b7694){var _0x1259e6=typeof _0x267fb1[_0x1853('0x1a')]===_0x1853('0x1b')&&typeof _0x267fb1[_0x1853('0x1c')]===_0x1853('0x1b');var _0x32302c=_0x2b7694[_0x1853('0x1d')];var _0x23a03a=_0x1259e6?0x0:_0x267fb1['offset'];var _0xf9fd74=_0x1259e6?_0x2b7694[_0x1853('0x1d')]:_0x267fb1['offset']+_0x267fb1[_0x1853('0x1c')];var _0x55b875;if(_0xf9fd74>=_0x32302c){_0xf9fd74=_0x32302c;_0x55b875=0xc8;}else{_0x55b875=0xce;}_0x567cf7[_0x1853('0x18')](_0x55b875);return _0x567cf7[_0x1853('0x1e')](_0x1853('0x1f'),_0x23a03a+'-'+_0xf9fd74+'/'+_0x32302c)[_0x1853('0x20')](_0x2b7694);}return null;};}function patchUpdates(_0x4fb68e){return function(_0x33a04f){try{jsonpatch[_0x1853('0x21')](_0x33a04f,_0x4fb68e,!![]);}catch(_0x569452){return BPromise[_0x1853('0x22')](_0x569452);}return _0x33a04f[_0x1853('0x23')]();};}function saveUpdates(_0x530230,_0x393874){return function(_0xed3113){if(_0xed3113){return _0xed3113[_0x1853('0x24')](_0x530230)['then'](function(_0x438f29){return _0x438f29;});}return null;};}function removeEntity(_0x5754b9,_0x35026c){return function(_0x2a609a){if(_0x2a609a){return _0x2a609a[_0x1853('0x25')]()[_0x1853('0x26')](function(){_0x5754b9['status'](0xcc)[_0x1853('0x19')]();});}};}function handleEntityNotFound(_0x3fd5a1,_0x509fa1){return function(_0x216e44){if(!_0x216e44){_0x3fd5a1['sendStatus'](0x194);}return _0x216e44;};}function handleError(_0x4aa945,_0x25cbd1){_0x25cbd1=_0x25cbd1||0x1f4;return function(_0xe93c69){logger[_0x1853('0x27')](_0xe93c69[_0x1853('0x28')]);if(_0xe93c69[_0x1853('0x29')]){delete _0xe93c69[_0x1853('0x29')];}_0x4aa945[_0x1853('0x18')](_0x25cbd1)[_0x1853('0x2a')](_0xe93c69);};}exports[_0x1853('0x2b')]=function(_0x5232e5,_0x1eb931){var _0x2e94b2={},_0x5bfb8c={},_0x2939b5={'count':0x0,'rows':[]};var _0x53cbf1=_['map'](db['IntegrationReport']['rawAttributes'],function(_0x17ad93){return{'name':_0x17ad93[_0x1853('0x2c')],'type':_0x17ad93[_0x1853('0x2d')][_0x1853('0x2e')]};});_0x5bfb8c[_0x1853('0x2f')]=_['map'](_0x53cbf1,_0x1853('0x29'));_0x5bfb8c[_0x1853('0x30')]=_[_0x1853('0x31')](_0x5232e5[_0x1853('0x30')]);_0x5bfb8c[_0x1853('0x32')]=_[_0x1853('0x33')](_0x5bfb8c[_0x1853('0x2f')],_0x5bfb8c['query']);_0x2e94b2[_0x1853('0x34')]=_['intersection'](_0x5bfb8c[_0x1853('0x2f')],qs['fields'](_0x5232e5[_0x1853('0x30')][_0x1853('0x35')]));_0x2e94b2[_0x1853('0x34')]=_0x2e94b2[_0x1853('0x34')][_0x1853('0x36')]?_0x2e94b2[_0x1853('0x34')]:_0x5bfb8c[_0x1853('0x2f')];if(!_0x5232e5[_0x1853('0x30')][_0x1853('0x37')](_0x1853('0x38'))){_0x2e94b2[_0x1853('0x1c')]=qs[_0x1853('0x1c')](_0x5232e5[_0x1853('0x30')][_0x1853('0x1c')]);_0x2e94b2[_0x1853('0x1a')]=qs['offset'](_0x5232e5[_0x1853('0x30')][_0x1853('0x1a')]);}_0x2e94b2[_0x1853('0x39')]=qs['sort'](_0x5232e5['query']['sort']);_0x2e94b2[_0x1853('0x3a')]=qs['filters'](_['pick'](_0x5232e5['query'],_0x5bfb8c[_0x1853('0x32')]),_0x53cbf1);if(_0x5232e5[_0x1853('0x30')][_0x1853('0x3b')]){_0x2e94b2['where']=_[_0x1853('0x3c')](_0x2e94b2['where'],{'$or':_[_0x1853('0x3d')](_0x53cbf1,function(_0x3c2e7d){if(_0x3c2e7d[_0x1853('0x2d')]!=='VIRTUAL'){var _0x2356fd={};_0x2356fd[_0x3c2e7d[_0x1853('0x29')]]={'$like':'%'+_0x5232e5[_0x1853('0x30')][_0x1853('0x3b')]+'%'};return _0x2356fd;}})});}_0x2e94b2=_[_0x1853('0x3c')]({},_0x2e94b2,_0x5232e5[_0x1853('0x3e')]);var _0x4a74cd={'where':_0x2e94b2[_0x1853('0x3a')]};return db[_0x1853('0x3f')][_0x1853('0x1d')](_0x4a74cd)[_0x1853('0x26')](function(_0x1f63a0){_0x2939b5['count']=_0x1f63a0;if(_0x5232e5['query']['includeAll']){_0x2e94b2['include']=[{'all':!![]}];}return db[_0x1853('0x3f')][_0x1853('0x40')](_0x2e94b2);})['then'](function(_0x34b58f){_0x2939b5['rows']=_0x34b58f;return _0x2939b5;})[_0x1853('0x26')](respondWithFilteredResult(_0x1eb931,_0x2e94b2))[_0x1853('0x41')](handleError(_0x1eb931,null));};exports[_0x1853('0x42')]=function(_0x2567b2,_0x37354a){var _0x4eca1d={'raw':![],'where':{'id':_0x2567b2[_0x1853('0x43')]['id']}},_0x16626d={};_0x16626d[_0x1853('0x2f')]=_[_0x1853('0x31')](db[_0x1853('0x3f')][_0x1853('0x44')]);_0x16626d[_0x1853('0x30')]=_[_0x1853('0x31')](_0x2567b2[_0x1853('0x30')]);_0x16626d['filters']=_[_0x1853('0x33')](_0x16626d['model'],_0x16626d[_0x1853('0x30')]);_0x4eca1d[_0x1853('0x34')]=_[_0x1853('0x33')](_0x16626d[_0x1853('0x2f')],qs['fields'](_0x2567b2[_0x1853('0x30')][_0x1853('0x35')]));_0x4eca1d[_0x1853('0x34')]=_0x4eca1d[_0x1853('0x34')][_0x1853('0x36')]?_0x4eca1d[_0x1853('0x34')]:_0x16626d[_0x1853('0x2f')];if(_0x2567b2[_0x1853('0x30')][_0x1853('0x45')]){_0x4eca1d['include']=[{'all':!![]}];}_0x4eca1d=_['merge']({},_0x4eca1d,_0x2567b2['options']);return db[_0x1853('0x3f')][_0x1853('0x46')](_0x4eca1d)[_0x1853('0x26')](handleEntityNotFound(_0x37354a,null))[_0x1853('0x26')](respondWithResult(_0x37354a,null))[_0x1853('0x41')](handleError(_0x37354a,null));};exports[_0x1853('0x47')]=function(_0x2cf839,_0x51546d){return db['IntegrationReport']['create'](_0x2cf839[_0x1853('0x48')],{})[_0x1853('0x26')](respondWithResult(_0x51546d,0xc9))[_0x1853('0x41')](handleError(_0x51546d,null));};exports[_0x1853('0x24')]=function(_0x4d76e7,_0x552817){if(_0x4d76e7[_0x1853('0x48')]['id']){delete _0x4d76e7[_0x1853('0x48')]['id'];}return db[_0x1853('0x3f')][_0x1853('0x46')]({'where':{'id':_0x4d76e7['params']['id']}})[_0x1853('0x26')](handleEntityNotFound(_0x552817,null))[_0x1853('0x26')](saveUpdates(_0x4d76e7[_0x1853('0x48')],null))[_0x1853('0x26')](respondWithResult(_0x552817,null))[_0x1853('0x41')](handleError(_0x552817,null));};exports[_0x1853('0x25')]=function(_0x218a24,_0x5863fd){return db[_0x1853('0x3f')][_0x1853('0x46')]({'where':{'id':_0x218a24[_0x1853('0x43')]['id']}})['then'](handleEntityNotFound(_0x5863fd,null))['then'](removeEntity(_0x5863fd,null))[_0x1853('0x41')](handleError(_0x5863fd,null));};exports[_0x1853('0x49')]=function(_0x258261,_0x39455c){return db[_0x1853('0x3f')]['describe']()[_0x1853('0x26')](respondWithResult(_0x39455c,null))[_0x1853('0x41')](handleError(_0x39455c,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 23ca0e2..4d55308 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 _0xa77e=['moment','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','report_integration','lodash','api'];(function(_0x30a4cb,_0x5215b2){var _0x1c8788=function(_0x2ba89d){while(--_0x2ba89d){_0x30a4cb['push'](_0x30a4cb['shift']());}};_0x1c8788(++_0x5215b2);}(_0xa77e,0x1e4));var _0xea77=function(_0x23f8b6,_0x2273f0){_0x23f8b6=_0x23f8b6-0x0;var _0x530e15=_0xa77e[_0x23f8b6];return _0x530e15;};'use strict';var _=require(_0xea77('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xea77('0x1'));var moment=require(_0xea77('0x2'));var BPromise=require('bluebird');var rp=require(_0xea77('0x3'));var fs=require('fs');var path=require(_0xea77('0x4'));var rimraf=require(_0xea77('0x5'));var config=require(_0xea77('0x6'));var attributes=require(_0xea77('0x7'));module['exports']=function(_0x349054,_0x218d92){return _0x349054['define']('IntegrationReport',attributes,{'tableName':_0xea77('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3cb=['api','moment','request-promise','rimraf','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger'];(function(_0x254d9f,_0x54ddb5){var _0x1eedb9=function(_0x2d05f1){while(--_0x2d05f1){_0x254d9f['push'](_0x254d9f['shift']());}};_0x1eedb9(++_0x54ddb5);}(_0xc3cb,0x1c5));var _0xbc3c=function(_0x317351,_0x1648f2){_0x317351=_0x317351-0x0;var _0x50d10a=_0xc3cb[_0x317351];return _0x50d10a;};'use strict';var _=require(_0xbc3c('0x0'));var util=require(_0xbc3c('0x1'));var logger=require(_0xbc3c('0x2'))(_0xbc3c('0x3'));var moment=require(_0xbc3c('0x4'));var BPromise=require('bluebird');var rp=require(_0xbc3c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbc3c('0x6'));var config=require('../../config/environment');var attributes=require(_0xbc3c('0x7'));module[_0xbc3c('0x8')]=function(_0x478d25,_0x52a7f8){return _0x478d25[_0xbc3c('0x9')](_0xbc3c('0xa'),attributes,{'tableName':_0xbc3c('0xb'),'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 f387100..23b17ca 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 _0x326f=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x38d896,_0x4c2541){var _0x9e15dd=function(_0x22dd38){while(--_0x22dd38){_0x38d896['push'](_0x38d896['shift']());}};_0x9e15dd(++_0x4c2541);}(_0x326f,0xd1));var _0xf326=function(_0x31758,_0xcdf4f1){_0x31758=_0x31758-0x0;var _0x2d165a=_0x326f[_0x31758];return _0x2d165a;};'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')]('IntegrationReport,\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')]('IntegrationReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x1d4d57,_0x38f8ca){var _0x197b31=function(_0x3dd4a9){while(--_0x3dd4a9){_0x1d4d57['push'](_0x1d4d57['shift']());}};_0x197b31(++_0x38f8ca);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xc4aa[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index d5dc8ae..7b62c46 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 _0x00b7=['post','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','get','getIntervals'];(function(_0xaaf4a5,_0x1f360a){var _0x3ca48c=function(_0x3ec077){while(--_0x3ec077){_0xaaf4a5['push'](_0xaaf4a5['shift']());}};_0x3ca48c(++_0x1f360a);}(_0x00b7,0x13c));var _0x700b=function(_0x249b3d,_0x21f381){_0x249b3d=_0x249b3d-0x0;var _0x48ae98=_0x00b7[_0x249b3d];return _0x48ae98;};'use strict';var multer=require(_0x700b('0x0'));var util=require('util');var path=require(_0x700b('0x1'));var timeout=require(_0x700b('0x2'));var express=require(_0x700b('0x3'));var router=express[_0x700b('0x4')]();var fs_extra=require(_0x700b('0x5'));var auth=require(_0x700b('0x6'));var interaction=require(_0x700b('0x7'));var config=require(_0x700b('0x8'));var controller=require('./interval.controller');router['get']('/',auth[_0x700b('0x9')](),controller['index']);router['get'](_0x700b('0xa'),auth[_0x700b('0x9')](),controller[_0x700b('0xb')]);router[_0x700b('0xc')]('/:id/sub_intervals',auth[_0x700b('0x9')](),controller[_0x700b('0xd')]);router[_0x700b('0xe')]('/',auth[_0x700b('0x9')](),controller['create']);router[_0x700b('0xe')](_0x700b('0xf'),auth[_0x700b('0x9')](),controller[_0x700b('0x10')]);router[_0x700b('0xe')](_0x700b('0x11'),auth[_0x700b('0x9')](),controller[_0x700b('0x12')]);router[_0x700b('0x13')]('/:id',auth[_0x700b('0x9')](),controller['update']);router[_0x700b('0x14')]('/:id',auth[_0x700b('0x9')](),controller[_0x700b('0x15')]);module['exports']=router; \ No newline at end of file +var _0xc13c=['post','addInterval','/:id/sub_intervals/create_many','addIntervals','delete','destroy','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/sub_intervals','getIntervals'];(function(_0x35036f,_0x5dc350){var _0x1d4fb1=function(_0x4eb96d){while(--_0x4eb96d){_0x35036f['push'](_0x35036f['shift']());}};_0x1d4fb1(++_0x5dc350);}(_0xc13c,0x15c));var _0xcc13=function(_0x2036a3,_0x10ce5a){_0x2036a3=_0x2036a3-0x0;var _0xf7f65e=_0xc13c[_0x2036a3];return _0xf7f65e;};'use strict';var multer=require('multer');var util=require(_0xcc13('0x0'));var path=require(_0xcc13('0x1'));var timeout=require('connect-timeout');var express=require(_0xcc13('0x2'));var router=express['Router']();var fs_extra=require(_0xcc13('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xcc13('0x4'));var config=require(_0xcc13('0x5'));var controller=require('./interval.controller');router[_0xcc13('0x6')]('/',auth[_0xcc13('0x7')](),controller['index']);router[_0xcc13('0x6')](_0xcc13('0x8'),auth['isAuthenticated'](),controller[_0xcc13('0x9')]);router[_0xcc13('0x6')](_0xcc13('0xa'),auth['isAuthenticated'](),controller[_0xcc13('0xb')]);router[_0xcc13('0xc')]('/',auth[_0xcc13('0x7')](),controller['create']);router[_0xcc13('0xc')](_0xcc13('0xa'),auth[_0xcc13('0x7')](),controller[_0xcc13('0xd')]);router[_0xcc13('0xc')](_0xcc13('0xe'),auth[_0xcc13('0x7')](),controller[_0xcc13('0xf')]);router['put'](_0xcc13('0x8'),auth[_0xcc13('0x7')](),controller['update']);router[_0xcc13('0x10')](_0xcc13('0x8'),auth[_0xcc13('0x7')](),controller[_0xcc13('0x11')]);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 1d13997..c6d1b2b 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 _0xbeab=['STRING','exports'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0xbeab,0x16f));var _0xbbea=function(_0x15db7b,_0x25cdc9){_0x15db7b=_0x15db7b-0x0;var _0x3713a1=_0xbeab[_0x15db7b];return _0x3713a1;};'use strict';var Sequelize=require('sequelize');module[_0xbbea('0x0')]={'name':{'type':Sequelize[_0xbbea('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbbea('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xaa2d=['STRING','sequelize','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xaa2d,0x17e));var _0xdaa2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa2d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xdaa2('0x0'));module[_0xdaa2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdaa2('0x2')]},'interval':{'type':Sequelize[_0xdaa2('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 f58c9c7..b6a215a 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 _0x33b6=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','end','name','index','map','Interval','rawAttributes','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','show','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','IntervalId','getIntervals','hasOwnProperty','addIntervals','findOne','sequelize','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x33b6,0x100));var _0x633b=function(_0x3d8243,_0x431106){_0x3d8243=_0x3d8243-0x0;var _0x140fb4=_0x33b6[_0x3d8243];return _0x140fb4;};'use strict';var emlformat=require(_0x633b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x633b('0x1'));var jsonpatch=require(_0x633b('0x2'));var rp=require(_0x633b('0x3'));var moment=require('moment');var BPromise=require(_0x633b('0x4'));var Mustache=require(_0x633b('0x5'));var util=require(_0x633b('0x6'));var path=require(_0x633b('0x7'));var sox=require(_0x633b('0x8'));var csv=require(_0x633b('0x9'));var ejs=require(_0x633b('0xa'));var fs=require('fs');var fs_extra=require(_0x633b('0xb'));var _=require('lodash');var squel=require(_0x633b('0xc'));var crypto=require(_0x633b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x633b('0x9'));var querystring=require('querystring');var Papa=require(_0x633b('0xe'));var Redis=require('ioredis');var authService=require(_0x633b('0xf'));var qs=require(_0x633b('0x10'));var as=require(_0x633b('0x11'));var hardwareService=require(_0x633b('0x12'));var logger=require(_0x633b('0x13'))(_0x633b('0x14'));var utils=require(_0x633b('0x15'));var config=require(_0x633b('0x16'));var licenseUtil=require(_0x633b('0x17'));var db=require(_0x633b('0x18'))['db'];var extensions=require(_0x633b('0x19'));function respondWithStatusCode(_0x257d69,_0x42f20b){_0x42f20b=_0x42f20b||0xcc;return function(_0x27fdea){if(_0x27fdea){return _0x257d69[_0x633b('0x1a')](_0x42f20b);}return _0x257d69[_0x633b('0x1b')](_0x42f20b)['end']();};}function respondWithResult(_0x141e69,_0x5a3ca5){_0x5a3ca5=_0x5a3ca5||0xc8;return function(_0x192e53){if(_0x192e53){return _0x141e69['status'](_0x5a3ca5)['json'](_0x192e53);}};}function respondWithFilteredResult(_0x5553b0,_0x255129){return function(_0x27ae0a){if(_0x27ae0a){var _0x2a8eca=typeof _0x255129[_0x633b('0x1c')]===_0x633b('0x1d')&&typeof _0x255129[_0x633b('0x1e')]===_0x633b('0x1d');var _0x275f7d=_0x27ae0a[_0x633b('0x1f')];var _0xb63af9=_0x2a8eca?0x0:_0x255129['offset'];var _0x5605c0=_0x2a8eca?_0x27ae0a['count']:_0x255129[_0x633b('0x1c')]+_0x255129[_0x633b('0x1e')];var _0x5c4b61;if(_0x5605c0>=_0x275f7d){_0x5605c0=_0x275f7d;_0x5c4b61=0xc8;}else{_0x5c4b61=0xce;}_0x5553b0['status'](_0x5c4b61);return _0x5553b0['set'](_0x633b('0x20'),_0xb63af9+'-'+_0x5605c0+'/'+_0x275f7d)[_0x633b('0x21')](_0x27ae0a);}return null;};}function patchUpdates(_0x48cfd2){return function(_0x114ea2){try{jsonpatch[_0x633b('0x22')](_0x114ea2,_0x48cfd2,!![]);}catch(_0x2f74c3){return BPromise[_0x633b('0x23')](_0x2f74c3);}return _0x114ea2[_0x633b('0x24')]();};}function saveUpdates(_0x3ba2b6,_0x32cc47){return function(_0x1d5cde){if(_0x1d5cde){return _0x1d5cde[_0x633b('0x25')](_0x3ba2b6)[_0x633b('0x26')](function(_0x4d4724){return _0x4d4724;});}return null;};}function removeEntity(_0x27b41b,_0x18fc12){return function(_0x1aefbd){if(_0x1aefbd){return _0x1aefbd[_0x633b('0x27')]()[_0x633b('0x26')](function(){var _0x1fa113=_0x1aefbd[_0x633b('0x28')]({'plain':!![]});var _0xa23209=_0x633b('0x29');return db[_0x633b('0x2a')][_0x633b('0x27')]({'where':{'type':_0xa23209,'resourceId':_0x1fa113['id']}})[_0x633b('0x26')](function(){return _0x1aefbd;});})[_0x633b('0x26')](function(){_0x27b41b['status'](0xcc)[_0x633b('0x2b')]();});}};}function handleEntityNotFound(_0x182521,_0x5d0601){return function(_0x508c10){if(!_0x508c10){_0x182521[_0x633b('0x1a')](0x194);}return _0x508c10;};}function handleError(_0x25b7bd,_0x4b8b8d){_0x4b8b8d=_0x4b8b8d||0x1f4;return function(_0x3e7d7a){logger['error'](_0x3e7d7a['stack']);if(_0x3e7d7a[_0x633b('0x2c')]){delete _0x3e7d7a['name'];}_0x25b7bd[_0x633b('0x1b')](_0x4b8b8d)['send'](_0x3e7d7a);};}exports[_0x633b('0x2d')]=function(_0x3f07e3,_0x135e22){var _0x4ee855={},_0x3f6209={},_0x441c71={'count':0x0,'rows':[]};var _0x5d9b8b=_[_0x633b('0x2e')](db[_0x633b('0x2f')][_0x633b('0x30')],function(_0x342c0e){return{'name':_0x342c0e['fieldName'],'type':_0x342c0e['type']['key']};});_0x3f6209['model']=_[_0x633b('0x2e')](_0x5d9b8b,'name');_0x3f6209[_0x633b('0x31')]=_[_0x633b('0x32')](_0x3f07e3['query']);_0x3f6209['filters']=_[_0x633b('0x33')](_0x3f6209[_0x633b('0x34')],_0x3f6209[_0x633b('0x31')]);_0x4ee855[_0x633b('0x35')]=_[_0x633b('0x33')](_0x3f6209[_0x633b('0x34')],qs[_0x633b('0x36')](_0x3f07e3[_0x633b('0x31')][_0x633b('0x36')]));_0x4ee855[_0x633b('0x35')]=_0x4ee855[_0x633b('0x35')][_0x633b('0x37')]?_0x4ee855[_0x633b('0x35')]:_0x3f6209[_0x633b('0x34')];if(!_0x3f07e3[_0x633b('0x31')]['hasOwnProperty'](_0x633b('0x38'))){_0x4ee855[_0x633b('0x1e')]=qs[_0x633b('0x1e')](_0x3f07e3['query'][_0x633b('0x1e')]);_0x4ee855['offset']=qs[_0x633b('0x1c')](_0x3f07e3['query']['offset']);}_0x4ee855[_0x633b('0x39')]=qs[_0x633b('0x3a')](_0x3f07e3[_0x633b('0x31')][_0x633b('0x3a')]);_0x4ee855[_0x633b('0x3b')]=qs[_0x633b('0x3c')](_[_0x633b('0x3d')](_0x3f07e3['query'],_0x3f6209[_0x633b('0x3c')]),_0x5d9b8b);if(_0x3f07e3[_0x633b('0x31')]['filter']){_0x4ee855['where']=_[_0x633b('0x3e')](_0x4ee855[_0x633b('0x3b')],{'$or':_['map'](_0x5d9b8b,function(_0x2627c6){if(_0x2627c6[_0x633b('0x3f')]!==_0x633b('0x40')){var _0x4ad287={};_0x4ad287[_0x2627c6[_0x633b('0x2c')]]={'$like':'%'+_0x3f07e3['query'][_0x633b('0x41')]+'%'};return _0x4ad287;}})});}_0x4ee855=_[_0x633b('0x3e')]({},_0x4ee855,_0x3f07e3[_0x633b('0x42')]);var _0x4055b4={'where':_0x4ee855[_0x633b('0x3b')]};return db[_0x633b('0x2f')][_0x633b('0x1f')](_0x4055b4)[_0x633b('0x26')](function(_0x5c7b1b){_0x441c71[_0x633b('0x1f')]=_0x5c7b1b;if(_0x3f07e3[_0x633b('0x31')][_0x633b('0x43')]){_0x4ee855[_0x633b('0x44')]=[{'all':!![]}];}return db[_0x633b('0x2f')]['findAll'](_0x4ee855);})['then'](function(_0x465bd3){_0x441c71[_0x633b('0x45')]=_0x465bd3;return _0x441c71;})[_0x633b('0x26')](respondWithFilteredResult(_0x135e22,_0x4ee855))['catch'](handleError(_0x135e22,null));};exports[_0x633b('0x46')]=function(_0xbca08a,_0x1d20e1){var _0x35af9d={'raw':!![],'where':{'id':_0xbca08a['params']['id']}},_0x31e89c={};_0x31e89c['model']=_['keys'](db['Interval'][_0x633b('0x30')]);_0x31e89c[_0x633b('0x31')]=_['keys'](_0xbca08a['query']);_0x31e89c['filters']=_['intersection'](_0x31e89c['model'],_0x31e89c[_0x633b('0x31')]);_0x35af9d['attributes']=_[_0x633b('0x33')](_0x31e89c['model'],qs['fields'](_0xbca08a['query'][_0x633b('0x36')]));_0x35af9d[_0x633b('0x35')]=_0x35af9d['attributes'][_0x633b('0x37')]?_0x35af9d[_0x633b('0x35')]:_0x31e89c[_0x633b('0x34')];if(_0xbca08a[_0x633b('0x31')][_0x633b('0x43')]){_0x35af9d['include']=[{'all':!![]}];}_0x35af9d=_['merge']({},_0x35af9d,_0xbca08a['options']);return db['Interval'][_0x633b('0x47')](_0x35af9d)[_0x633b('0x26')](handleEntityNotFound(_0x1d20e1,null))[_0x633b('0x26')](respondWithResult(_0x1d20e1,null))[_0x633b('0x48')](handleError(_0x1d20e1,null));};exports[_0x633b('0x49')]=function(_0x1e2a7b,_0x55cb26){return db[_0x633b('0x2f')][_0x633b('0x49')](_0x1e2a7b[_0x633b('0x4a')],{})[_0x633b('0x26')](function(_0x1bacdb){var _0x2150c3=_0x1e2a7b[_0x633b('0x4b')][_0x633b('0x28')]({'plain':!![]});if(!_0x2150c3)throw new Error(_0x633b('0x4c'));if(_0x2150c3['role']===_0x633b('0x4b')){var _0x2c13a9=_0x1bacdb[_0x633b('0x28')]({'plain':!![]});var _0x462326=_0x633b('0x29');return db[_0x633b('0x4d')][_0x633b('0x47')]({'where':{'name':_0x462326,'userProfileId':_0x2150c3[_0x633b('0x4e')]},'raw':!![]})[_0x633b('0x26')](function(_0x4e876a){if(_0x4e876a&&_0x4e876a['autoAssociation']===0x0){return db['UserProfileResource'][_0x633b('0x49')]({'name':_0x2c13a9[_0x633b('0x2c')],'resourceId':_0x2c13a9['id'],'type':_0x4e876a['name'],'sectionId':_0x4e876a['id']},{})['then'](function(){return _0x1bacdb;});}else{return _0x1bacdb;}})[_0x633b('0x48')](function(_0xf40271){logger[_0x633b('0x4f')](_0x633b('0x50'),_0xf40271);throw _0xf40271;});}return _0x1bacdb;})[_0x633b('0x26')](respondWithResult(_0x55cb26,0xc9))[_0x633b('0x48')](handleError(_0x55cb26,null));};exports['update']=function(_0x479c6e,_0x48f23e){if(_0x479c6e['body']['id']){delete _0x479c6e[_0x633b('0x4a')]['id'];}return db[_0x633b('0x2f')][_0x633b('0x47')]({'where':{'id':_0x479c6e[_0x633b('0x51')]['id']}})[_0x633b('0x26')](handleEntityNotFound(_0x48f23e,null))['then'](saveUpdates(_0x479c6e['body'],null))['then'](respondWithResult(_0x48f23e,null))[_0x633b('0x48')](handleError(_0x48f23e,null));};exports[_0x633b('0x27')]=function(_0x453394,_0x23c4ac){return db[_0x633b('0x2f')][_0x633b('0x47')]({'where':{'id':_0x453394[_0x633b('0x51')]['id']}})[_0x633b('0x26')](handleEntityNotFound(_0x23c4ac,null))[_0x633b('0x26')](removeEntity(_0x23c4ac,null))[_0x633b('0x48')](handleError(_0x23c4ac,null));};exports[_0x633b('0x52')]=function(_0x2f6b04,_0xfd034b,_0x314ac2){if(_0x2f6b04[_0x633b('0x4a')]['id']){delete _0x2f6b04[_0x633b('0x4a')]['id'];}return db[_0x633b('0x2f')][_0x633b('0x47')]({'where':{'id':_0x2f6b04[_0x633b('0x51')]['id']}})[_0x633b('0x26')](handleEntityNotFound(_0xfd034b,null))[_0x633b('0x26')](function(_0x1284e5){if(_0x1284e5){_0x2f6b04['body'][_0x633b('0x53')]=_0x1284e5['id'];return db['Interval'][_0x633b('0x49')](_0x2f6b04[_0x633b('0x4a')]);}})[_0x633b('0x26')](respondWithResult(_0xfd034b,null))[_0x633b('0x48')](handleError(_0xfd034b,null));};exports['getIntervals']=function(_0x30b61e,_0x222ca2,_0x25fd06){var _0x105eec={};var _0x4a9917={};var _0x31fb66;var _0x4c44f3;return db['Interval']['findOne']({'where':{'id':_0x30b61e[_0x633b('0x51')]['id']}})[_0x633b('0x26')](handleEntityNotFound(_0x222ca2,null))[_0x633b('0x26')](function(_0x24c0ad){if(_0x24c0ad){_0x31fb66=_0x24c0ad;_0x4a9917[_0x633b('0x34')]=_[_0x633b('0x32')](db[_0x633b('0x2f')][_0x633b('0x30')]);_0x4a9917[_0x633b('0x31')]=_['keys'](_0x30b61e[_0x633b('0x31')]);_0x4a9917[_0x633b('0x3c')]=_[_0x633b('0x33')](_0x4a9917['model'],_0x4a9917[_0x633b('0x31')]);_0x105eec[_0x633b('0x35')]=_[_0x633b('0x33')](_0x4a9917[_0x633b('0x34')],qs[_0x633b('0x36')](_0x30b61e['query']['fields']));_0x105eec[_0x633b('0x35')]=_0x105eec[_0x633b('0x35')][_0x633b('0x37')]?_0x105eec[_0x633b('0x35')]:_0x4a9917[_0x633b('0x34')];_0x105eec['order']=qs['sort'](_0x30b61e['query'][_0x633b('0x3a')]);_0x105eec['where']=qs[_0x633b('0x3c')](_[_0x633b('0x3d')](_0x30b61e[_0x633b('0x31')],_0x4a9917[_0x633b('0x3c')]));if(_0x30b61e[_0x633b('0x31')][_0x633b('0x41')]){_0x105eec['where']=_[_0x633b('0x3e')](_0x105eec[_0x633b('0x3b')],{'$or':_[_0x633b('0x2e')](_0x105eec['attributes'],function(_0xac6007){var _0x3cace0={};_0x3cace0[_0xac6007]={'$like':'%'+_0x30b61e[_0x633b('0x31')]['filter']+'%'};return _0x3cace0;})});}_0x105eec=_[_0x633b('0x3e')]({},_0x105eec,_0x30b61e[_0x633b('0x42')]);return _0x31fb66[_0x633b('0x54')](_0x105eec);}})[_0x633b('0x26')](function(_0x1acaf6){if(_0x1acaf6){_0x4c44f3=_0x1acaf6['length'];if(!_0x30b61e['query'][_0x633b('0x55')](_0x633b('0x38'))){_0x105eec[_0x633b('0x1e')]=qs[_0x633b('0x1e')](_0x30b61e[_0x633b('0x31')][_0x633b('0x1e')]);_0x105eec[_0x633b('0x1c')]=qs[_0x633b('0x1c')](_0x30b61e['query'][_0x633b('0x1c')]);}return _0x31fb66[_0x633b('0x54')](_0x105eec);}})[_0x633b('0x26')](function(_0x6e42a7){if(_0x6e42a7){return _0x6e42a7?{'count':_0x4c44f3,'rows':_0x6e42a7}:null;}})[_0x633b('0x26')](respondWithResult(_0x222ca2,null))[_0x633b('0x48')](handleError(_0x222ca2,null));};exports[_0x633b('0x56')]=function(_0xb3b2b8,_0x4684f4,_0x2091e0){return db[_0x633b('0x2f')][_0x633b('0x57')]({'where':{'id':_0xb3b2b8['params']['id']}})[_0x633b('0x26')](handleEntityNotFound(_0x4684f4,null))['then'](function(_0x583f8e){if(_0x583f8e){return db[_0x633b('0x58')][_0x633b('0x59')](function(_0x156168){return db[_0x633b('0x2f')][_0x633b('0x27')]({'where':{'IntervalId':_0xb3b2b8['params']['id']},'transaction':_0x156168})[_0x633b('0x26')](function(_0x1ca845){var _0x21727=_['map'](_0xb3b2b8[_0x633b('0x4a')],function(_0x2b8c19){delete _0x2b8c19['id'];_0x2b8c19[_0x633b('0x53')]=_0xb3b2b8[_0x633b('0x51')]['id'];return _0x2b8c19;});return db['Interval'][_0x633b('0x5a')](_0x21727,{'transaction':_0x156168});});})[_0x633b('0x26')](function(){return db[_0x633b('0x2f')]['findAll']({'where':{'IntervalId':_0xb3b2b8[_0x633b('0x51')]['id']}});});}})[_0x633b('0x26')](respondWithResult(_0x4684f4,null))['catch'](handleError(_0x4684f4,null));}; \ No newline at end of file +var _0x1503=['fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','Interval','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','update','addInterval','IntervalId','findOne','merge','getIntervals','addIntervals','bulkCreate','eml-format','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/license/util','../../mysqldb','status','end','json','offset','count','limit','reject','save','then','destroy','Intervals','UserProfileResource','sendStatus','stack','name','map','rawAttributes','type','key','model','query','keys','intersection','attributes'];(function(_0x24e7b0,_0x23104f){var _0x1b09a1=function(_0xf17972){while(--_0xf17972){_0x24e7b0['push'](_0x24e7b0['shift']());}};_0x1b09a1(++_0x23104f);}(_0x1503,0x1e2));var _0x3150=function(_0x3d9d47,_0x2e2659){_0x3d9d47=_0x3d9d47-0x0;var _0x1d7932=_0x1503[_0x3d9d47];return _0x1d7932;};'use strict';var emlformat=require(_0x3150('0x0'));var rimraf=require(_0x3150('0x1'));var zipdir=require(_0x3150('0x2'));var jsonpatch=require(_0x3150('0x3'));var rp=require(_0x3150('0x4'));var moment=require(_0x3150('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3150('0x6'));var util=require(_0x3150('0x7'));var path=require(_0x3150('0x8'));var sox=require(_0x3150('0x9'));var csv=require(_0x3150('0xa'));var ejs=require(_0x3150('0xb'));var fs=require('fs');var fs_extra=require(_0x3150('0xc'));var _=require('lodash');var squel=require(_0x3150('0xd'));var crypto=require('crypto');var jsforce=require(_0x3150('0xe'));var deskjs=require(_0x3150('0xf'));var toCsv=require(_0x3150('0xa'));var querystring=require(_0x3150('0x10'));var Papa=require(_0x3150('0x11'));var Redis=require(_0x3150('0x12'));var authService=require(_0x3150('0x13'));var qs=require(_0x3150('0x14'));var as=require(_0x3150('0x15'));var hardwareService=require(_0x3150('0x16'));var logger=require(_0x3150('0x17'))(_0x3150('0x18'));var utils=require(_0x3150('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x3150('0x1a'));var db=require(_0x3150('0x1b'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x4aec58,_0x384180){_0x384180=_0x384180||0xcc;return function(_0xa463b6){if(_0xa463b6){return _0x4aec58['sendStatus'](_0x384180);}return _0x4aec58[_0x3150('0x1c')](_0x384180)[_0x3150('0x1d')]();};}function respondWithResult(_0x26a026,_0x14800a){_0x14800a=_0x14800a||0xc8;return function(_0xa2a88f){if(_0xa2a88f){return _0x26a026['status'](_0x14800a)[_0x3150('0x1e')](_0xa2a88f);}};}function respondWithFilteredResult(_0x16ef73,_0x546e86){return function(_0x1c6ec8){if(_0x1c6ec8){var _0x2a4d03=typeof _0x546e86[_0x3150('0x1f')]==='undefined'&&typeof _0x546e86['limit']==='undefined';var _0x59740b=_0x1c6ec8[_0x3150('0x20')];var _0x58bd66=_0x2a4d03?0x0:_0x546e86[_0x3150('0x1f')];var _0x2df702=_0x2a4d03?_0x1c6ec8[_0x3150('0x20')]:_0x546e86['offset']+_0x546e86[_0x3150('0x21')];var _0x8b78e6;if(_0x2df702>=_0x59740b){_0x2df702=_0x59740b;_0x8b78e6=0xc8;}else{_0x8b78e6=0xce;}_0x16ef73[_0x3150('0x1c')](_0x8b78e6);return _0x16ef73['set']('Content-Range',_0x58bd66+'-'+_0x2df702+'/'+_0x59740b)[_0x3150('0x1e')](_0x1c6ec8);}return null;};}function patchUpdates(_0x35e3fc){return function(_0x598293){try{jsonpatch['apply'](_0x598293,_0x35e3fc,!![]);}catch(_0x40e169){return BPromise[_0x3150('0x22')](_0x40e169);}return _0x598293[_0x3150('0x23')]();};}function saveUpdates(_0x3b0262,_0xcbca8e){return function(_0x72911b){if(_0x72911b){return _0x72911b['update'](_0x3b0262)[_0x3150('0x24')](function(_0x57f809){return _0x57f809;});}return null;};}function removeEntity(_0x16ab14,_0xb74937){return function(_0x5b114f){if(_0x5b114f){return _0x5b114f[_0x3150('0x25')]()[_0x3150('0x24')](function(){var _0x22a32b=_0x5b114f['get']({'plain':!![]});var _0x1af9c0=_0x3150('0x26');return db[_0x3150('0x27')][_0x3150('0x25')]({'where':{'type':_0x1af9c0,'resourceId':_0x22a32b['id']}})[_0x3150('0x24')](function(){return _0x5b114f;});})['then'](function(){_0x16ab14[_0x3150('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x482ca3,_0x29465d){return function(_0x2ba533){if(!_0x2ba533){_0x482ca3[_0x3150('0x28')](0x194);}return _0x2ba533;};}function handleError(_0x3af00b,_0x4f4daf){_0x4f4daf=_0x4f4daf||0x1f4;return function(_0x286382){logger['error'](_0x286382[_0x3150('0x29')]);if(_0x286382[_0x3150('0x2a')]){delete _0x286382[_0x3150('0x2a')];}_0x3af00b[_0x3150('0x1c')](_0x4f4daf)['send'](_0x286382);};}exports['index']=function(_0x33096b,_0x31e37a){var _0x5dc7aa={},_0x786c68={},_0x3ec89c={'count':0x0,'rows':[]};var _0x4ad92a=_[_0x3150('0x2b')](db['Interval'][_0x3150('0x2c')],function(_0x2a3fb3){return{'name':_0x2a3fb3['fieldName'],'type':_0x2a3fb3[_0x3150('0x2d')][_0x3150('0x2e')]};});_0x786c68[_0x3150('0x2f')]=_[_0x3150('0x2b')](_0x4ad92a,'name');_0x786c68[_0x3150('0x30')]=_[_0x3150('0x31')](_0x33096b[_0x3150('0x30')]);_0x786c68['filters']=_[_0x3150('0x32')](_0x786c68['model'],_0x786c68[_0x3150('0x30')]);_0x5dc7aa[_0x3150('0x33')]=_['intersection'](_0x786c68[_0x3150('0x2f')],qs[_0x3150('0x34')](_0x33096b[_0x3150('0x30')][_0x3150('0x34')]));_0x5dc7aa[_0x3150('0x33')]=_0x5dc7aa[_0x3150('0x33')][_0x3150('0x35')]?_0x5dc7aa['attributes']:_0x786c68[_0x3150('0x2f')];if(!_0x33096b[_0x3150('0x30')][_0x3150('0x36')](_0x3150('0x37'))){_0x5dc7aa[_0x3150('0x21')]=qs[_0x3150('0x21')](_0x33096b[_0x3150('0x30')]['limit']);_0x5dc7aa[_0x3150('0x1f')]=qs['offset'](_0x33096b[_0x3150('0x30')][_0x3150('0x1f')]);}_0x5dc7aa[_0x3150('0x38')]=qs[_0x3150('0x39')](_0x33096b['query'][_0x3150('0x39')]);_0x5dc7aa[_0x3150('0x3a')]=qs[_0x3150('0x3b')](_[_0x3150('0x3c')](_0x33096b[_0x3150('0x30')],_0x786c68[_0x3150('0x3b')]),_0x4ad92a);if(_0x33096b[_0x3150('0x30')][_0x3150('0x3d')]){_0x5dc7aa[_0x3150('0x3a')]=_['merge'](_0x5dc7aa[_0x3150('0x3a')],{'$or':_[_0x3150('0x2b')](_0x4ad92a,function(_0x156bf8){if(_0x156bf8['type']!==_0x3150('0x3e')){var _0x2a8088={};_0x2a8088[_0x156bf8[_0x3150('0x2a')]]={'$like':'%'+_0x33096b[_0x3150('0x30')]['filter']+'%'};return _0x2a8088;}})});}_0x5dc7aa=_['merge']({},_0x5dc7aa,_0x33096b[_0x3150('0x3f')]);var _0x564d53={'where':_0x5dc7aa[_0x3150('0x3a')]};return db[_0x3150('0x40')][_0x3150('0x20')](_0x564d53)[_0x3150('0x24')](function(_0x20bd7d){_0x3ec89c[_0x3150('0x20')]=_0x20bd7d;if(_0x33096b[_0x3150('0x30')][_0x3150('0x41')]){_0x5dc7aa[_0x3150('0x42')]=[{'all':!![]}];}return db[_0x3150('0x40')][_0x3150('0x43')](_0x5dc7aa);})[_0x3150('0x24')](function(_0x5444c0){_0x3ec89c[_0x3150('0x44')]=_0x5444c0;return _0x3ec89c;})[_0x3150('0x24')](respondWithFilteredResult(_0x31e37a,_0x5dc7aa))[_0x3150('0x45')](handleError(_0x31e37a,null));};exports[_0x3150('0x46')]=function(_0x49c260,_0x45856e){var _0x2000f6={'raw':!![],'where':{'id':_0x49c260[_0x3150('0x47')]['id']}},_0x24c169={};_0x24c169['model']=_[_0x3150('0x31')](db['Interval']['rawAttributes']);_0x24c169[_0x3150('0x30')]=_[_0x3150('0x31')](_0x49c260['query']);_0x24c169['filters']=_['intersection'](_0x24c169[_0x3150('0x2f')],_0x24c169[_0x3150('0x30')]);_0x2000f6[_0x3150('0x33')]=_[_0x3150('0x32')](_0x24c169[_0x3150('0x2f')],qs['fields'](_0x49c260[_0x3150('0x30')][_0x3150('0x34')]));_0x2000f6[_0x3150('0x33')]=_0x2000f6[_0x3150('0x33')][_0x3150('0x35')]?_0x2000f6[_0x3150('0x33')]:_0x24c169[_0x3150('0x2f')];if(_0x49c260[_0x3150('0x30')][_0x3150('0x41')]){_0x2000f6[_0x3150('0x42')]=[{'all':!![]}];}_0x2000f6=_['merge']({},_0x2000f6,_0x49c260[_0x3150('0x3f')]);return db[_0x3150('0x40')][_0x3150('0x48')](_0x2000f6)[_0x3150('0x24')](handleEntityNotFound(_0x45856e,null))[_0x3150('0x24')](respondWithResult(_0x45856e,null))['catch'](handleError(_0x45856e,null));};exports[_0x3150('0x49')]=function(_0x5a8e54,_0x480e85){return db[_0x3150('0x40')][_0x3150('0x49')](_0x5a8e54[_0x3150('0x4a')],{})[_0x3150('0x24')](function(_0x49ebe3){var _0x96cfd4=_0x5a8e54[_0x3150('0x4b')][_0x3150('0x4c')]({'plain':!![]});if(!_0x96cfd4)throw new Error(_0x3150('0x4d'));if(_0x96cfd4[_0x3150('0x4e')]===_0x3150('0x4b')){var _0x554344=_0x49ebe3['get']({'plain':!![]});var _0x47808a='Intervals';return db['UserProfileSection'][_0x3150('0x48')]({'where':{'name':_0x47808a,'userProfileId':_0x96cfd4[_0x3150('0x4f')]},'raw':!![]})[_0x3150('0x24')](function(_0x1038a3){if(_0x1038a3&&_0x1038a3['autoAssociation']===0x0){return db[_0x3150('0x27')][_0x3150('0x49')]({'name':_0x554344[_0x3150('0x2a')],'resourceId':_0x554344['id'],'type':_0x1038a3[_0x3150('0x2a')],'sectionId':_0x1038a3['id']},{})['then'](function(){return _0x49ebe3;});}else{return _0x49ebe3;}})[_0x3150('0x45')](function(_0x1ceb09){logger[_0x3150('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ceb09);throw _0x1ceb09;});}return _0x49ebe3;})['then'](respondWithResult(_0x480e85,0xc9))[_0x3150('0x45')](handleError(_0x480e85,null));};exports[_0x3150('0x51')]=function(_0x261706,_0x913a6c){if(_0x261706[_0x3150('0x4a')]['id']){delete _0x261706[_0x3150('0x4a')]['id'];}return db[_0x3150('0x40')][_0x3150('0x48')]({'where':{'id':_0x261706[_0x3150('0x47')]['id']}})['then'](handleEntityNotFound(_0x913a6c,null))[_0x3150('0x24')](saveUpdates(_0x261706['body'],null))[_0x3150('0x24')](respondWithResult(_0x913a6c,null))[_0x3150('0x45')](handleError(_0x913a6c,null));};exports[_0x3150('0x25')]=function(_0x3aaf03,_0x3c028e){return db['Interval'][_0x3150('0x48')]({'where':{'id':_0x3aaf03[_0x3150('0x47')]['id']}})[_0x3150('0x24')](handleEntityNotFound(_0x3c028e,null))['then'](removeEntity(_0x3c028e,null))['catch'](handleError(_0x3c028e,null));};exports[_0x3150('0x52')]=function(_0x37766a,_0x133cc0,_0x1270bf){if(_0x37766a[_0x3150('0x4a')]['id']){delete _0x37766a[_0x3150('0x4a')]['id'];}return db[_0x3150('0x40')]['find']({'where':{'id':_0x37766a[_0x3150('0x47')]['id']}})[_0x3150('0x24')](handleEntityNotFound(_0x133cc0,null))[_0x3150('0x24')](function(_0x1e6a30){if(_0x1e6a30){_0x37766a[_0x3150('0x4a')][_0x3150('0x53')]=_0x1e6a30['id'];return db['Interval'][_0x3150('0x49')](_0x37766a[_0x3150('0x4a')]);}})[_0x3150('0x24')](respondWithResult(_0x133cc0,null))[_0x3150('0x45')](handleError(_0x133cc0,null));};exports['getIntervals']=function(_0x3ed496,_0x3271c5,_0x42f39c){var _0x2c7597={};var _0xa278f2={};var _0xc2c88c;var _0x243780;return db[_0x3150('0x40')][_0x3150('0x54')]({'where':{'id':_0x3ed496[_0x3150('0x47')]['id']}})['then'](handleEntityNotFound(_0x3271c5,null))[_0x3150('0x24')](function(_0x4835ba){if(_0x4835ba){_0xc2c88c=_0x4835ba;_0xa278f2['model']=_[_0x3150('0x31')](db[_0x3150('0x40')]['rawAttributes']);_0xa278f2['query']=_[_0x3150('0x31')](_0x3ed496['query']);_0xa278f2[_0x3150('0x3b')]=_[_0x3150('0x32')](_0xa278f2[_0x3150('0x2f')],_0xa278f2[_0x3150('0x30')]);_0x2c7597[_0x3150('0x33')]=_['intersection'](_0xa278f2[_0x3150('0x2f')],qs[_0x3150('0x34')](_0x3ed496['query'][_0x3150('0x34')]));_0x2c7597['attributes']=_0x2c7597[_0x3150('0x33')][_0x3150('0x35')]?_0x2c7597[_0x3150('0x33')]:_0xa278f2['model'];_0x2c7597[_0x3150('0x38')]=qs[_0x3150('0x39')](_0x3ed496[_0x3150('0x30')][_0x3150('0x39')]);_0x2c7597[_0x3150('0x3a')]=qs['filters'](_[_0x3150('0x3c')](_0x3ed496['query'],_0xa278f2['filters']));if(_0x3ed496[_0x3150('0x30')][_0x3150('0x3d')]){_0x2c7597[_0x3150('0x3a')]=_[_0x3150('0x55')](_0x2c7597[_0x3150('0x3a')],{'$or':_[_0x3150('0x2b')](_0x2c7597[_0x3150('0x33')],function(_0x2b7441){var _0xed0324={};_0xed0324[_0x2b7441]={'$like':'%'+_0x3ed496[_0x3150('0x30')][_0x3150('0x3d')]+'%'};return _0xed0324;})});}_0x2c7597=_[_0x3150('0x55')]({},_0x2c7597,_0x3ed496[_0x3150('0x3f')]);return _0xc2c88c[_0x3150('0x56')](_0x2c7597);}})[_0x3150('0x24')](function(_0x302b8a){if(_0x302b8a){_0x243780=_0x302b8a[_0x3150('0x35')];if(!_0x3ed496[_0x3150('0x30')][_0x3150('0x36')]('nolimit')){_0x2c7597[_0x3150('0x21')]=qs[_0x3150('0x21')](_0x3ed496[_0x3150('0x30')][_0x3150('0x21')]);_0x2c7597['offset']=qs['offset'](_0x3ed496[_0x3150('0x30')][_0x3150('0x1f')]);}return _0xc2c88c[_0x3150('0x56')](_0x2c7597);}})['then'](function(_0x5ecb03){if(_0x5ecb03){return _0x5ecb03?{'count':_0x243780,'rows':_0x5ecb03}:null;}})[_0x3150('0x24')](respondWithResult(_0x3271c5,null))[_0x3150('0x45')](handleError(_0x3271c5,null));};exports[_0x3150('0x57')]=function(_0x40ca76,_0x5ece39,_0x570e8d){return db['Interval'][_0x3150('0x54')]({'where':{'id':_0x40ca76[_0x3150('0x47')]['id']}})[_0x3150('0x24')](handleEntityNotFound(_0x5ece39,null))[_0x3150('0x24')](function(_0x338ff2){if(_0x338ff2){return db['sequelize']['transaction'](function(_0x41e5d6){return db['Interval'][_0x3150('0x25')]({'where':{'IntervalId':_0x40ca76[_0x3150('0x47')]['id']},'transaction':_0x41e5d6})['then'](function(_0x11374b){var _0x1c9c43=_[_0x3150('0x2b')](_0x40ca76[_0x3150('0x4a')],function(_0x3edf2b){delete _0x3edf2b['id'];_0x3edf2b[_0x3150('0x53')]=_0x40ca76[_0x3150('0x47')]['id'];return _0x3edf2b;});return db[_0x3150('0x40')][_0x3150('0x58')](_0x1c9c43,{'transaction':_0x41e5d6});});})[_0x3150('0x24')](function(){return db[_0x3150('0x40')][_0x3150('0x43')]({'where':{'IntervalId':_0x40ca76[_0x3150('0x47')]['id']}});});}})[_0x3150('0x24')](respondWithResult(_0x5ece39,null))['catch'](handleError(_0x5ece39,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 8a23c16..ca85344 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 _0x97fd=['rewrite','string','getIntervals','ifTime','then','reduce','./interval.attributes','../../components/extensions/rewrite','iftime','exports','define','tools_intervals'];(function(_0xb24cf0,_0x460fb1){var _0x180fc1=function(_0x404eff){while(--_0x404eff){_0xb24cf0['push'](_0xb24cf0['shift']());}};_0x180fc1(++_0x460fb1);}(_0x97fd,0xae));var _0xd97f=function(_0x1a11b2,_0x4b42d2){_0x1a11b2=_0x1a11b2-0x0;var _0x23bc5e=_0x97fd[_0x1a11b2];return _0x23bc5e;};'use strict';var attributes=require(_0xd97f('0x0'));var extensions=require(_0xd97f('0x1'));var iftime=require('../../utils/iftime')[_0xd97f('0x2')];module[_0xd97f('0x3')]=function(_0x27a659){return _0x27a659[_0xd97f('0x4')]('Interval',attributes,{'tableName':_0xd97f('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x402df3){extensions[_0xd97f('0x6')](_0x27a659,_0x402df3);},'afterBulkCreate':function(_0x417faa,_0x41f0aa,_0x36fda4){_0x36fda4();extensions['rewrite'](_0x27a659,_0x417faa[0x0]);},'afterUpdate':function(_0x3abd0e){extensions[_0xd97f('0x6')](_0x27a659,_0x3abd0e);},'afterDestroy':function(_0x24f1b4){extensions[_0xd97f('0x6')](_0x27a659,_0x24f1b4);}},'instanceMethods':{'ifTime':function(_0x3176f1=undefined,_0x2778b6=new Date()){if(typeof this['interval']===_0xd97f('0x7')){return iftime(this['interval'],_0x3176f1,_0x2778b6);}else{return this[_0xd97f('0x8')]()['then'](function(_0x1cd5c1){return Promise['all'](_0x1cd5c1['map'](function(_0x4700a3){return _0x4700a3[_0xd97f('0x9')](_0x3176f1,_0x2778b6);}));})[_0xd97f('0xa')](function(_0x2f2933){return _0x2f2933[_0xd97f('0xb')](function(_0x518a02,_0x9cb48f){return _0x518a02||_0x9cb48f;},![]);});}}}});}; \ No newline at end of file +var _0xc0b5=['./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','define','tools_intervals','rewrite','interval','getIntervals','then','all','map','reduce'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0xc0b5,0x144));var _0x5c0b=function(_0x1b39db,_0x217eff){_0x1b39db=_0x1b39db-0x0;var _0x3b42a8=_0xc0b5[_0x1b39db];return _0x3b42a8;};'use strict';var attributes=require(_0x5c0b('0x0'));var extensions=require(_0x5c0b('0x1'));var iftime=require(_0x5c0b('0x2'))['iftime'];module['exports']=function(_0x5ab726){return _0x5ab726[_0x5c0b('0x3')]('Interval',attributes,{'tableName':_0x5c0b('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x21e879){extensions['rewrite'](_0x5ab726,_0x21e879);},'afterBulkCreate':function(_0x5c941b,_0x26acb,_0x19bd3e){_0x19bd3e();extensions[_0x5c0b('0x5')](_0x5ab726,_0x5c941b[0x0]);},'afterUpdate':function(_0x4b4782){extensions[_0x5c0b('0x5')](_0x5ab726,_0x4b4782);},'afterDestroy':function(_0x126795){extensions['rewrite'](_0x5ab726,_0x126795);}},'instanceMethods':{'ifTime':function(_0x53ad0e=undefined,_0x3a2a0e=new Date()){if(typeof this['interval']==='string'){return iftime(this[_0x5c0b('0x6')],_0x53ad0e,_0x3a2a0e);}else{return this[_0x5c0b('0x7')]()[_0x5c0b('0x8')](function(_0x485644){return Promise[_0x5c0b('0x9')](_0x485644[_0x5c0b('0xa')](function(_0x4d96a8){return _0x4d96a8['ifTime'](_0x53ad0e,_0x3a2a0e);}));})[_0x5c0b('0x8')](function(_0x421835){return _0x421835[_0x5c0b('0xb')](function(_0x808f56,_0x2d46d0){return _0x808f56||_0x2d46d0;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 21fbdfa..7a58f5a 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 _0xb808=['message','error','ShowInterval','Interval','find','catch','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','resolve','isArray','lodash','util','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify'];(function(_0xe60935,_0x2b28f9){var _0x140b09=function(_0x5e1e34){while(--_0x5e1e34){_0xe60935['push'](_0xe60935['shift']());}};_0x140b09(++_0x2b28f9);}(_0xb808,0x9c));var _0x8b80=function(_0x1e5e1d,_0x39c151){_0x1e5e1d=_0x1e5e1d-0x0;var _0x2990c8=_0xb808[_0x1e5e1d];return _0x2990c8;};'use strict';var _=require(_0x8b80('0x0'));var util=require(_0x8b80('0x1'));var db=require('../../mysqldb')['db'];var iftime=require(_0x8b80('0x2'))[_0x8b80('0x3')];var logger=require(_0x8b80('0x4'))(_0x8b80('0x5'));exports[_0x8b80('0x6')]=function(_0x1b3e39){var _0x1f5dd5=this;return new Promise(function(_0x83f8e9,_0x5c9f83){return db['Interval'][_0x8b80('0x7')]({'raw':_0x1b3e39['options']?_0x1b3e39[_0x8b80('0x8')][_0x8b80('0x9')]===undefined?!![]:![]:!![],'where':_0x1b3e39[_0x8b80('0x8')]?_0x1b3e39['options'][_0x8b80('0xa')]||null:null,'attributes':_0x1b3e39[_0x8b80('0x8')]?_0x1b3e39['options'][_0x8b80('0xb')]||null:null,'limit':_0x1b3e39['options']?_0x1b3e39['options'][_0x8b80('0xc')]||null:null,'include':_0x1b3e39[_0x8b80('0x8')]?_0x1b3e39[_0x8b80('0x8')][_0x8b80('0xd')]?_['map'](_0x1b3e39['options'][_0x8b80('0xd')],function(_0x1e9769){return{'model':db[_0x1e9769['model']],'as':_0x1e9769['as'],'attributes':_0x1e9769[_0x8b80('0xb')],'include':_0x1e9769['include']?_[_0x8b80('0xe')](_0x1e9769[_0x8b80('0xd')],function(_0x5e96c5){return{'model':db[_0x5e96c5[_0x8b80('0xf')]],'as':_0x5e96c5['as'],'attributes':_0x5e96c5['attributes'],'include':_0x5e96c5['include']?_[_0x8b80('0xe')](_0x5e96c5['include'],function(_0x4e918f){return{'model':db[_0x4e918f[_0x8b80('0xf')]],'as':_0x4e918f['as'],'attributes':_0x4e918f[_0x8b80('0xb')]};}):[]};}):[]};}):[]:[]})[_0x8b80('0x10')](function(_0x326787){logger[_0x8b80('0x11')](_0x8b80('0x6'),_0x1b3e39);logger[_0x8b80('0x12')]('GetInterval',_0x1b3e39,JSON[_0x8b80('0x13')](_0x326787));_0x83f8e9(_0x326787);})['catch'](function(_0x170776){logger['error'](_0x8b80('0x6'),_0x170776[_0x8b80('0x14')],_0x1b3e39);_0x5c9f83(_0x1f5dd5[_0x8b80('0x15')](0x1f4,_0x170776[_0x8b80('0x14')]));});});};exports[_0x8b80('0x16')]=function(_0x4197d1){var _0x5e611b=this;return new Promise(function(_0x1e43f5,_0xc823fc){return db[_0x8b80('0x17')][_0x8b80('0x18')]({'raw':_0x4197d1[_0x8b80('0x8')]?_0x4197d1[_0x8b80('0x8')][_0x8b80('0x9')]===undefined?!![]:![]:!![],'where':_0x4197d1[_0x8b80('0x8')]?_0x4197d1[_0x8b80('0x8')][_0x8b80('0xa')]||null:null,'attributes':_0x4197d1[_0x8b80('0x8')]?_0x4197d1['options'][_0x8b80('0xb')]||null:null,'include':_0x4197d1[_0x8b80('0x8')]?_0x4197d1[_0x8b80('0x8')]['include']?_[_0x8b80('0xe')](_0x4197d1[_0x8b80('0x8')]['include'],function(_0xf0556c){return{'model':db[_0xf0556c[_0x8b80('0xf')]],'as':_0xf0556c['as'],'attributes':_0xf0556c[_0x8b80('0xb')],'include':_0xf0556c[_0x8b80('0xd')]?_[_0x8b80('0xe')](_0xf0556c[_0x8b80('0xd')],function(_0x5cc8c){return{'model':db[_0x5cc8c['model']],'as':_0x5cc8c['as'],'attributes':_0x5cc8c[_0x8b80('0xb')],'include':_0x5cc8c['include']?_[_0x8b80('0xe')](_0x5cc8c[_0x8b80('0xd')],function(_0x4be106){return{'model':db[_0x4be106[_0x8b80('0xf')]],'as':_0x4be106['as'],'attributes':_0x4be106[_0x8b80('0xb')]};}):[]};}):[]};}):[]:[]})[_0x8b80('0x10')](function(_0x450ccc){logger[_0x8b80('0x11')](_0x8b80('0x16'),_0x4197d1);logger['debug']('ShowInterval',_0x4197d1,JSON[_0x8b80('0x13')](_0x450ccc));_0x1e43f5(_0x450ccc);})[_0x8b80('0x19')](function(_0xd5086a){logger[_0x8b80('0x15')](_0x8b80('0x16'),_0xd5086a[_0x8b80('0x14')],_0x4197d1);_0xc823fc(_0x5e611b[_0x8b80('0x15')](0x1f4,_0xd5086a[_0x8b80('0x14')]));});});};function checkArrayOfIntervals(_0x5dae23,_0x139eea){var _0x49df58=[];return db[_0x8b80('0x17')]['findAll']({'where':{'id':_0x5dae23}})[_0x8b80('0x10')](function(_0xd87e70){_0x49df58=_0xd87e70;return Promise[_0x8b80('0x1a')](_0x49df58[_0x8b80('0xe')](function(_0x304658){return _0x304658[_0x8b80('0x1b')](_0x139eea);}));})[_0x8b80('0x10')](function(_0x27258c){var _0x79fa69=_0x27258c[_0x8b80('0x1c')](function(_0x223f0f,_0x3ba5aa){return _0x223f0f||_0x3ba5aa;},![]);logger[_0x8b80('0x11')](util[_0x8b80('0x1d')](_0x8b80('0x1e'),_0x49df58[_0x8b80('0xe')](function(_0x417da6){return _0x417da6[_0x8b80('0x1f')];})[_0x8b80('0x20')](',\x20'),_0x49df58[_0x8b80('0xe')](function(_0x9763d1){return _0x9763d1['id'];})[_0x8b80('0x20')](',\x20')));return _0x79fa69;});}function checkSingleInterval(_0x42a84e,_0x1c66f5){return db['Interval'][_0x8b80('0x21')](_0x42a84e)[_0x8b80('0x10')](function(_0x336921){if(_0x336921){logger[_0x8b80('0x11')](util[_0x8b80('0x1d')](_0x8b80('0x22'),_0x336921['name'],_0x336921['id']));return _0x336921[_0x8b80('0x1b')](_0x1c66f5);}});}exports[_0x8b80('0x23')]=function(_0x3edf88){var _0x2f7111=_0x3edf88['intervalIds'];var _0x5b6f3c=Array['isArray'](_0x3edf88[_0x8b80('0x24')])?_0x3edf88[_0x8b80('0x24')]:typeof _0x3edf88[_0x8b80('0x24')]===_0x8b80('0x25')?[_0x3edf88[_0x8b80('0x24')]]:[];var _0x2957ce=_0x3edf88[_0x8b80('0x26')]||undefined;var _0x35e9e7=![];if(_0x5b6f3c[_0x8b80('0x27')]){logger['info'](util['format'](_0x8b80('0x28'),_0x5b6f3c[_0x8b80('0x20')](';\x20')));}if(_0x2957ce){logger[_0x8b80('0x11')](util[_0x8b80('0x1d')](_0x8b80('0x29'),_0x2957ce));}logger[_0x8b80('0x12')]('Iftime',_0x35e9e7);logger['silly']('IntervalIftime',_0x3edf88);return Promise[_0x8b80('0x2a')]()[_0x8b80('0x10')](function(){if(Array[_0x8b80('0x2b')](_0x2f7111)){return checkArrayOfIntervals(_0x2f7111,_0x2957ce);}else if(_0x2f7111){return checkSingleInterval(_0x2f7111,_0x2957ce);}})[_0x8b80('0x10')](function(_0x54e112){var _0x2adc41=_0x5b6f3c[_0x8b80('0x1c')](function(_0x1ca0e8,_0xbb228d){return _0x1ca0e8||iftime(_0xbb228d,_0x2957ce);},![]);_0x35e9e7=_0x54e112||_0x2adc41;return _0x35e9e7;})[_0x8b80('0x19')](function(_0xfd5083){logger[_0x8b80('0x15')]('IntervalIftime',_0x3edf88,_0xfd5083);throw this[_0x8b80('0x15')](0x1f4,_0xfd5083['message']);});}; \ No newline at end of file +var _0x59f3=['rpc','findAll','options','raw','attributes','limit','include','map','model','then','info','debug','GetInterval','stringify','error','message','ShowInterval','Interval','find','catch','all','reduce','format','name','join','intervalIds','isArray','intervals','string','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','silly','resolve','lodash','../../mysqldb','../../utils/iftime','iftime'];(function(_0x113cf4,_0xae0788){var _0xe0efbf=function(_0x14b990){while(--_0x14b990){_0x113cf4['push'](_0x113cf4['shift']());}};_0xe0efbf(++_0xae0788);}(_0x59f3,0x12c));var _0x359f=function(_0x5bc75a,_0x38ce5c){_0x5bc75a=_0x5bc75a-0x0;var _0x51abb3=_0x59f3[_0x5bc75a];return _0x51abb3;};'use strict';var _=require(_0x359f('0x0'));var util=require('util');var db=require(_0x359f('0x1'))['db'];var iftime=require(_0x359f('0x2'))[_0x359f('0x3')];var logger=require('../../config/logger')(_0x359f('0x4'));exports['GetInterval']=function(_0x54352b){var _0x5a78b2=this;return new Promise(function(_0x28daab,_0x5b65dc){return db['Interval'][_0x359f('0x5')]({'raw':_0x54352b[_0x359f('0x6')]?_0x54352b['options'][_0x359f('0x7')]===undefined?!![]:![]:!![],'where':_0x54352b[_0x359f('0x6')]?_0x54352b[_0x359f('0x6')]['where']||null:null,'attributes':_0x54352b[_0x359f('0x6')]?_0x54352b[_0x359f('0x6')][_0x359f('0x8')]||null:null,'limit':_0x54352b[_0x359f('0x6')]?_0x54352b[_0x359f('0x6')][_0x359f('0x9')]||null:null,'include':_0x54352b[_0x359f('0x6')]?_0x54352b[_0x359f('0x6')][_0x359f('0xa')]?_[_0x359f('0xb')](_0x54352b[_0x359f('0x6')][_0x359f('0xa')],function(_0x2c38bb){return{'model':db[_0x2c38bb[_0x359f('0xc')]],'as':_0x2c38bb['as'],'attributes':_0x2c38bb[_0x359f('0x8')],'include':_0x2c38bb[_0x359f('0xa')]?_[_0x359f('0xb')](_0x2c38bb[_0x359f('0xa')],function(_0x47d78f){return{'model':db[_0x47d78f[_0x359f('0xc')]],'as':_0x47d78f['as'],'attributes':_0x47d78f[_0x359f('0x8')],'include':_0x47d78f[_0x359f('0xa')]?_['map'](_0x47d78f[_0x359f('0xa')],function(_0x409b23){return{'model':db[_0x409b23[_0x359f('0xc')]],'as':_0x409b23['as'],'attributes':_0x409b23[_0x359f('0x8')]};}):[]};}):[]};}):[]:[]})[_0x359f('0xd')](function(_0x260dca){logger[_0x359f('0xe')]('GetInterval',_0x54352b);logger[_0x359f('0xf')](_0x359f('0x10'),_0x54352b,JSON[_0x359f('0x11')](_0x260dca));_0x28daab(_0x260dca);})['catch'](function(_0x2f64fd){logger[_0x359f('0x12')]('GetInterval',_0x2f64fd[_0x359f('0x13')],_0x54352b);_0x5b65dc(_0x5a78b2[_0x359f('0x12')](0x1f4,_0x2f64fd[_0x359f('0x13')]));});});};exports[_0x359f('0x14')]=function(_0x4ba480){var _0x1b49e9=this;return new Promise(function(_0x5ef724,_0x334a79){return db[_0x359f('0x15')][_0x359f('0x16')]({'raw':_0x4ba480[_0x359f('0x6')]?_0x4ba480[_0x359f('0x6')][_0x359f('0x7')]===undefined?!![]:![]:!![],'where':_0x4ba480['options']?_0x4ba480['options']['where']||null:null,'attributes':_0x4ba480[_0x359f('0x6')]?_0x4ba480[_0x359f('0x6')][_0x359f('0x8')]||null:null,'include':_0x4ba480[_0x359f('0x6')]?_0x4ba480['options'][_0x359f('0xa')]?_[_0x359f('0xb')](_0x4ba480[_0x359f('0x6')][_0x359f('0xa')],function(_0x1f4f64){return{'model':db[_0x1f4f64[_0x359f('0xc')]],'as':_0x1f4f64['as'],'attributes':_0x1f4f64[_0x359f('0x8')],'include':_0x1f4f64[_0x359f('0xa')]?_[_0x359f('0xb')](_0x1f4f64[_0x359f('0xa')],function(_0x1b0352){return{'model':db[_0x1b0352['model']],'as':_0x1b0352['as'],'attributes':_0x1b0352[_0x359f('0x8')],'include':_0x1b0352[_0x359f('0xa')]?_['map'](_0x1b0352[_0x359f('0xa')],function(_0x464662){return{'model':db[_0x464662[_0x359f('0xc')]],'as':_0x464662['as'],'attributes':_0x464662[_0x359f('0x8')]};}):[]};}):[]};}):[]:[]})[_0x359f('0xd')](function(_0x50bbf7){logger[_0x359f('0xe')](_0x359f('0x14'),_0x4ba480);logger[_0x359f('0xf')](_0x359f('0x14'),_0x4ba480,JSON[_0x359f('0x11')](_0x50bbf7));_0x5ef724(_0x50bbf7);})[_0x359f('0x17')](function(_0x31fc11){logger['error'](_0x359f('0x14'),_0x31fc11[_0x359f('0x13')],_0x4ba480);_0x334a79(_0x1b49e9[_0x359f('0x12')](0x1f4,_0x31fc11[_0x359f('0x13')]));});});};function checkArrayOfIntervals(_0x331980,_0x4f6992){var _0x55eb6c=[];return db[_0x359f('0x15')]['findAll']({'where':{'id':_0x331980}})[_0x359f('0xd')](function(_0x201184){_0x55eb6c=_0x201184;return Promise[_0x359f('0x18')](_0x55eb6c[_0x359f('0xb')](function(_0x276cd1){return _0x276cd1['ifTime'](_0x4f6992);}));})[_0x359f('0xd')](function(_0x4e62db){var _0x1fc978=_0x4e62db[_0x359f('0x19')](function(_0x5a6253,_0x29628f){return _0x5a6253||_0x29628f;},![]);logger[_0x359f('0xe')](util[_0x359f('0x1a')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x55eb6c[_0x359f('0xb')](function(_0x217125){return _0x217125[_0x359f('0x1b')];})[_0x359f('0x1c')](',\x20'),_0x55eb6c[_0x359f('0xb')](function(_0x229e2c){return _0x229e2c['id'];})['join'](',\x20')));return _0x1fc978;});}function checkSingleInterval(_0x50a9a3,_0x310ed5){return db[_0x359f('0x15')]['findById'](_0x50a9a3)[_0x359f('0xd')](function(_0x3b739f){if(_0x3b739f){logger[_0x359f('0xe')](util[_0x359f('0x1a')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x3b739f[_0x359f('0x1b')],_0x3b739f['id']));return _0x3b739f['ifTime'](_0x310ed5);}});}exports['IntervalIftime']=function(_0x318391){var _0x1165af=_0x318391[_0x359f('0x1d')];var _0x1d51e4=Array[_0x359f('0x1e')](_0x318391['intervals'])?_0x318391[_0x359f('0x1f')]:typeof _0x318391[_0x359f('0x1f')]===_0x359f('0x20')?[_0x318391[_0x359f('0x1f')]]:[];var _0x11c2b2=_0x318391['timezone']||undefined;var _0xbf39a4=![];if(_0x1d51e4[_0x359f('0x21')]){logger[_0x359f('0xe')](util[_0x359f('0x1a')](_0x359f('0x22'),_0x1d51e4[_0x359f('0x1c')](';\x20')));}if(_0x11c2b2){logger[_0x359f('0xe')](util[_0x359f('0x1a')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x11c2b2));}logger[_0x359f('0xf')](_0x359f('0x23'),_0xbf39a4);logger[_0x359f('0x24')]('IntervalIftime',_0x318391);return Promise[_0x359f('0x25')]()[_0x359f('0xd')](function(){if(Array[_0x359f('0x1e')](_0x1165af)){return checkArrayOfIntervals(_0x1165af,_0x11c2b2);}else if(_0x1165af){return checkSingleInterval(_0x1165af,_0x11c2b2);}})['then'](function(_0x27f3c2){var _0x4c9f33=_0x1d51e4['reduce'](function(_0x50243c,_0x119c4a){return _0x50243c||iftime(_0x119c4a,_0x11c2b2);},![]);_0xbf39a4=_0x27f3c2||_0x4c9f33;return _0xbf39a4;})[_0x359f('0x17')](function(_0x4ea7c9){logger[_0x359f('0x12')]('IntervalIftime',_0x318391,_0x4ea7c9);throw this[_0x359f('0x12')](0x1f4,_0x4ea7c9[_0x359f('0x13')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 5325f6f..885c4ff 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 _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x22ea9e,_0x59e62f){var _0x3dc3e2=function(_0x5c111c){while(--_0x5c111c){_0x22ea9e['push'](_0x22ea9e['shift']());}};_0x3dc3e2(++_0x59e62f);}(_0x2ef3,0xba));var _0x32ef=function(_0x15ac09,_0x3aeb24){_0x15ac09=_0x15ac09-0x0;var _0x2102ba=_0x2ef3[_0x15ac09];return _0x2102ba;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x3ca3bc,_0x5c2089){var _0x38d3b4=function(_0x55a394){while(--_0x55a394){_0x3ca3bc['push'](_0x3ca3bc['shift']());}};_0x38d3b4(++_0x5c2089);}(_0xadb5,0xad));var _0x5adb=function(_0x50916f,_0x9008ce){_0x50916f=_0x50916f-0x0;var _0x377ec6=_0xadb5[_0x50916f];return _0x377ec6;};'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 63d9791..dd42256 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 _0x49d4=['headers','x-forwarded-for','connection','remoteAddress','socket','../../config/logger','api','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','customfield_11501','oldToken','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','application/json','toString','request','end','statusCode','json','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','send','body'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0x49d4,0x7a));var _0x449d=function(_0x1d8e06,_0x2c206f){_0x1d8e06=_0x1d8e06-0x0;var _0x397704=_0x49d4[_0x1d8e06];return _0x397704;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x449d('0x0'))(_0x449d('0x1'));var USERNAME=_0x449d('0x2');var PASSWORD=_0x449d('0x3');function openIssue(_0x3760d2,_0x28a02a){var _0x422ef4={'fields':{'project':{'key':_0x3760d2[_0x449d('0x4')]||'MOTGUI'},'summary':(_0x3760d2[_0x449d('0x5')]||_0x449d('0x6'))+_0x449d('0x7')+_0x3760d2['ip'],'description':_0x3760d2[_0x449d('0x8')]||JSON[_0x449d('0x9')](_0x3760d2),'issuetype':{'name':_0x3760d2[_0x449d('0xa')]||_0x449d('0xb')}}};_0x422ef4[_0x449d('0xc')][_0x449d('0xd')]=_0x3760d2['email'];_0x422ef4[_0x449d('0xc')][_0x449d('0xe')]=_0x3760d2[_0x449d('0xf')];_0x422ef4[_0x449d('0xc')][_0x449d('0x10')]=_0x3760d2[_0x449d('0x11')];_0x422ef4[_0x449d('0xc')]['customfield_11503']=_0x3760d2[_0x449d('0x12')];_0x422ef4[_0x449d('0xc')][_0x449d('0x13')]=_0x3760d2[_0x449d('0x14')];_0x422ef4[_0x449d('0xc')][_0x449d('0x15')]=_0x3760d2['ip'];var _0x40316b={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x449d('0x16'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x449d('0x17'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x449d('0x18')]('base64')}};var _0x3c410b=JSON['stringify'](_0x422ef4);var _0x57cd18=https[_0x449d('0x19')](_0x40316b,function(_0x5a17a7){_0x5a17a7['setEncoding']('utf8');var _0x368607='';_0x5a17a7['on']('data',function(_0x577af3){_0x368607+=_0x577af3;});_0x5a17a7['on'](_0x449d('0x1a'),function(){if(_0x28a02a){return _0x28a02a['status'](_0x5a17a7[_0x449d('0x1b')])[_0x449d('0x1c')](JSON['parse'](_0x368607));}});});_0x57cd18['on']('error',function(_0x4c766d){if(_0x28a02a){return _0x28a02a[_0x449d('0x1d')](0x1f4)[_0x449d('0x1c')]({'errors':[{'message':_0x449d('0x1e'),'type':_0x449d('0x1f')}]});}});_0x57cd18['write'](_0x3c410b);_0x57cd18[_0x449d('0x1a')]();}exports['openIssue']=openIssue;exports[_0x449d('0x20')]=function(_0x32ea45,_0xae518d){_0x32ea45[_0x449d('0x21')]['ip']=_0x32ea45[_0x449d('0x22')][_0x449d('0x23')]||_0x32ea45[_0x449d('0x24')][_0x449d('0x25')]||_0x32ea45[_0x449d('0x26')][_0x449d('0x25')]||_0x32ea45[_0x449d('0x24')][_0x449d('0x26')][_0x449d('0x25')];return openIssue(_0x32ea45['body'],_0xae518d);}; \ No newline at end of file +var _0x47f1=['../../config/logger','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','json','parse','error','api.jira','write','openIssue','send','headers','x-forwarded-for','socket','connection','remoteAddress','body','bluebird','https'];(function(_0x19a631,_0x2bcdbe){var _0x590361=function(_0x268428){while(--_0x268428){_0x19a631['push'](_0x19a631['shift']());}};_0x590361(++_0x2bcdbe);}(_0x47f1,0x12a));var _0x147f=function(_0x123a51,_0x5d3741){_0x123a51=_0x123a51-0x0;var _0x33581e=_0x47f1[_0x123a51];return _0x33581e;};'use strict';var BPromise=require(_0x147f('0x0'));var https=require(_0x147f('0x1'));var logger=require(_0x147f('0x2'))('api');var USERNAME=_0x147f('0x3');var PASSWORD=_0x147f('0x4');function openIssue(_0x10df1d,_0x58de48){var _0x5bb81c={'fields':{'project':{'key':_0x10df1d[_0x147f('0x5')]||_0x147f('0x6')},'summary':(_0x10df1d['summary']||_0x147f('0x7'))+_0x147f('0x8')+_0x10df1d['ip'],'description':_0x10df1d[_0x147f('0x9')]||JSON[_0x147f('0xa')](_0x10df1d),'issuetype':{'name':_0x10df1d[_0x147f('0xb')]||_0x147f('0xc')}}};_0x5bb81c[_0x147f('0xd')][_0x147f('0xe')]=_0x10df1d[_0x147f('0xf')];_0x5bb81c['fields'][_0x147f('0x10')]=_0x10df1d[_0x147f('0x11')];_0x5bb81c['fields'][_0x147f('0x12')]=_0x10df1d[_0x147f('0x13')];_0x5bb81c[_0x147f('0xd')][_0x147f('0x14')]=_0x10df1d[_0x147f('0x15')];_0x5bb81c[_0x147f('0xd')][_0x147f('0x16')]=_0x10df1d[_0x147f('0x17')];_0x5bb81c[_0x147f('0xd')][_0x147f('0x18')]=_0x10df1d['ip'];var _0x59e628={'host':_0x147f('0x19'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x147f('0x1a'),'timeout':0x4e20,'headers':{'Content-Type':_0x147f('0x1b'),'Authorization':_0x147f('0x1c')+new Buffer(USERNAME+':'+PASSWORD)[_0x147f('0x1d')](_0x147f('0x1e'))}};var _0x2fcc26=JSON['stringify'](_0x5bb81c);var _0xa4cb9b=https[_0x147f('0x1f')](_0x59e628,function(_0x5fcb62){_0x5fcb62[_0x147f('0x20')](_0x147f('0x21'));var _0x241749='';_0x5fcb62['on'](_0x147f('0x22'),function(_0x55b569){_0x241749+=_0x55b569;});_0x5fcb62['on'](_0x147f('0x23'),function(){if(_0x58de48){return _0x58de48[_0x147f('0x24')](_0x5fcb62['statusCode'])[_0x147f('0x25')](JSON[_0x147f('0x26')](_0x241749));}});});_0xa4cb9b['on'](_0x147f('0x27'),function(_0x11c1eb){if(_0x58de48){return _0x58de48['status'](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x147f('0x28')}]});}});_0xa4cb9b[_0x147f('0x29')](_0x2fcc26);_0xa4cb9b['end']();}exports[_0x147f('0x2a')]=openIssue;exports[_0x147f('0x2b')]=function(_0x216a99,_0x494d28){_0x216a99['body']['ip']=_0x216a99[_0x147f('0x2c')][_0x147f('0x2d')]||_0x216a99['connection']['remoteAddress']||_0x216a99[_0x147f('0x2e')]['remoteAddress']||_0x216a99[_0x147f('0x2f')][_0x147f('0x2e')][_0x147f('0x30')];return openIssue(_0x216a99[_0x147f('0x31')],_0x494d28);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 604dd9a..36fea8d 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 _0x0a9a=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','update','destroy','util','connect-timeout','express'];(function(_0x49f30e,_0xf28439){var _0x2cafd5=function(_0x581d4c){while(--_0x581d4c){_0x49f30e['push'](_0x49f30e['shift']());}};_0x2cafd5(++_0xf28439);}(_0x0a9a,0x183));var _0xa0a9=function(_0x58c54b,_0x59b395){_0x58c54b=_0x58c54b-0x0;var _0xc7d1b9=_0x0a9a[_0x58c54b];return _0xc7d1b9;};'use strict';var multer=require('multer');var util=require(_0xa0a9('0x0'));var path=require('path');var timeout=require(_0xa0a9('0x1'));var express=require(_0xa0a9('0x2'));var router=express[_0xa0a9('0x3')]();var fs_extra=require(_0xa0a9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa0a9('0x5'));var config=require(_0xa0a9('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0xa0a9('0x7')]('/',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0x9')]);router[_0xa0a9('0x7')]('/describe',auth[_0xa0a9('0x8')](),controller['describe']);router[_0xa0a9('0x7')](_0xa0a9('0xa'),auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xb')]);router['post']('/',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xc')]);router['put']('/:id',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xd')]);router['delete'](_0xa0a9('0xa'),auth['isAuthenticated'](),controller[_0xa0a9('0xe')]);module['exports']=router; \ No newline at end of file +var _0x70e0=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','isAuthenticated','describe','get','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x20fed4,_0x433052){var _0x103886=function(_0x4300e6){while(--_0x4300e6){_0x20fed4['push'](_0x20fed4['shift']());}};_0x103886(++_0x433052);}(_0x70e0,0x17b));var _0x070e=function(_0x3c8a77,_0x16ded7){_0x3c8a77=_0x3c8a77-0x0;var _0x26b344=_0x70e0[_0x3c8a77];return _0x26b344;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x070e('0xe')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xf')]);router[_0x070e('0x10')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x11')]);module[_0x070e('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 16bf39b..ff12468 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(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7a54,0x106));var _0x47a5=function(_0x42c532,_0x38e79a){_0x42c532=_0x42c532-0x0;var _0x453469=_0x7a54[_0x42c532];return _0x453469;};'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(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7a54,0x106));var _0x47a5=function(_0x52fd71,_0x13270e){_0x52fd71=_0x52fd71-0x0;var _0x308095=_0x7a54[_0x52fd71];return _0x308095;};'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 e437ff0..9e8296e 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 _0x7d9f=['util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','update','then','error','stack','name','index','map','JscriptyAnswerReport','rawAttributes','model','keys','attributes','intersection','fields','query','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0x7d9f,0x15c));var _0xf7d9=function(_0xba4220,_0x5217a7){_0xba4220=_0xba4220-0x0;var _0x4cdb9d=_0x7d9f[_0xba4220];return _0x4cdb9d;};'use strict';var emlformat=require(_0xf7d9('0x0'));var rimraf=require(_0xf7d9('0x1'));var zipdir=require(_0xf7d9('0x2'));var jsonpatch=require(_0xf7d9('0x3'));var rp=require(_0xf7d9('0x4'));var moment=require('moment');var BPromise=require(_0xf7d9('0x5'));var Mustache=require(_0xf7d9('0x6'));var util=require(_0xf7d9('0x7'));var path=require(_0xf7d9('0x8'));var sox=require(_0xf7d9('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7d9('0xa'));var _=require(_0xf7d9('0xb'));var squel=require('squel');var crypto=require(_0xf7d9('0xc'));var jsforce=require(_0xf7d9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf7d9('0xe'));var querystring=require('querystring');var Papa=require(_0xf7d9('0xf'));var Redis=require(_0xf7d9('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf7d9('0x11'));var hardwareService=require(_0xf7d9('0x12'));var logger=require(_0xf7d9('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf7d9('0x14'));var licenseUtil=require(_0xf7d9('0x15'));var db=require(_0xf7d9('0x16'))['db'];function respondWithStatusCode(_0x35e156,_0x594dfe){_0x594dfe=_0x594dfe||0xcc;return function(_0x16e680){if(_0x16e680){return _0x35e156[_0xf7d9('0x17')](_0x594dfe);}return _0x35e156[_0xf7d9('0x18')](_0x594dfe)[_0xf7d9('0x19')]();};}function respondWithResult(_0x49f766,_0x189c82){_0x189c82=_0x189c82||0xc8;return function(_0x359843){if(_0x359843){return _0x49f766[_0xf7d9('0x18')](_0x189c82)[_0xf7d9('0x1a')](_0x359843);}};}function respondWithFilteredResult(_0x5d3029,_0x405ed4){return function(_0x22ed4a){if(_0x22ed4a){var _0x341e27=typeof _0x405ed4['offset']==='undefined'&&typeof _0x405ed4[_0xf7d9('0x1b')]===_0xf7d9('0x1c');var _0xe29103=_0x22ed4a['count'];var _0x44ebd3=_0x341e27?0x0:_0x405ed4[_0xf7d9('0x1d')];var _0x5eb7c9=_0x341e27?_0x22ed4a[_0xf7d9('0x1e')]:_0x405ed4['offset']+_0x405ed4[_0xf7d9('0x1b')];var _0x1bbc77;if(_0x5eb7c9>=_0xe29103){_0x5eb7c9=_0xe29103;_0x1bbc77=0xc8;}else{_0x1bbc77=0xce;}_0x5d3029['status'](_0x1bbc77);return _0x5d3029[_0xf7d9('0x1f')](_0xf7d9('0x20'),_0x44ebd3+'-'+_0x5eb7c9+'/'+_0xe29103)[_0xf7d9('0x1a')](_0x22ed4a);}return null;};}function patchUpdates(_0x316d54){return function(_0x165160){try{jsonpatch[_0xf7d9('0x21')](_0x165160,_0x316d54,!![]);}catch(_0xd04b9d){return BPromise[_0xf7d9('0x22')](_0xd04b9d);}return _0x165160['save']();};}function saveUpdates(_0x5e96df,_0x36b974){return function(_0x4cfe93){if(_0x4cfe93){return _0x4cfe93[_0xf7d9('0x23')](_0x5e96df)[_0xf7d9('0x24')](function(_0x574b12){return _0x574b12;});}return null;};}function removeEntity(_0x8d8e48,_0x27ba8c){return function(_0x514ffa){if(_0x514ffa){return _0x514ffa['destroy']()[_0xf7d9('0x24')](function(){_0x8d8e48[_0xf7d9('0x18')](0xcc)[_0xf7d9('0x19')]();});}};}function handleEntityNotFound(_0x595556,_0x3c0b91){return function(_0x496ab7){if(!_0x496ab7){_0x595556[_0xf7d9('0x17')](0x194);}return _0x496ab7;};}function handleError(_0x3b3ea5,_0x144ae2){_0x144ae2=_0x144ae2||0x1f4;return function(_0x5b1ea5){logger[_0xf7d9('0x25')](_0x5b1ea5[_0xf7d9('0x26')]);if(_0x5b1ea5[_0xf7d9('0x27')]){delete _0x5b1ea5[_0xf7d9('0x27')];}_0x3b3ea5[_0xf7d9('0x18')](_0x144ae2)['send'](_0x5b1ea5);};}exports[_0xf7d9('0x28')]=function(_0x3847ff,_0x2b5f17){var _0x2c04c3={},_0x508b00={},_0x20315e={'count':0x0,'rows':[]};var _0x193add=_[_0xf7d9('0x29')](db[_0xf7d9('0x2a')][_0xf7d9('0x2b')],function(_0x16318f){return{'name':_0x16318f['fieldName'],'type':_0x16318f['type']['key']};});_0x508b00[_0xf7d9('0x2c')]=_['map'](_0x193add,_0xf7d9('0x27'));_0x508b00['query']=_[_0xf7d9('0x2d')](_0x3847ff['query']);_0x508b00['filters']=_['intersection'](_0x508b00[_0xf7d9('0x2c')],_0x508b00['query']);_0x2c04c3[_0xf7d9('0x2e')]=_[_0xf7d9('0x2f')](_0x508b00[_0xf7d9('0x2c')],qs[_0xf7d9('0x30')](_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x30')]));_0x2c04c3[_0xf7d9('0x2e')]=_0x2c04c3[_0xf7d9('0x2e')]['length']?_0x2c04c3[_0xf7d9('0x2e')]:_0x508b00[_0xf7d9('0x2c')];if(!_0x3847ff['query']['hasOwnProperty'](_0xf7d9('0x32'))){_0x2c04c3[_0xf7d9('0x1b')]=qs[_0xf7d9('0x1b')](_0x3847ff['query'][_0xf7d9('0x1b')]);_0x2c04c3[_0xf7d9('0x1d')]=qs[_0xf7d9('0x1d')](_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x1d')]);}_0x2c04c3[_0xf7d9('0x33')]=qs[_0xf7d9('0x34')](_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x34')]);_0x2c04c3[_0xf7d9('0x35')]=qs[_0xf7d9('0x36')](_['pick'](_0x3847ff[_0xf7d9('0x31')],_0x508b00['filters']),_0x193add);if(_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x37')]){_0x2c04c3[_0xf7d9('0x35')]=_[_0xf7d9('0x38')](_0x2c04c3['where'],{'$or':_['map'](_0x193add,function(_0x2173e2){if(_0x2173e2['type']!==_0xf7d9('0x39')){var _0xb3723c={};_0xb3723c[_0x2173e2[_0xf7d9('0x27')]]={'$like':'%'+_0x3847ff[_0xf7d9('0x31')]['filter']+'%'};return _0xb3723c;}})});}_0x2c04c3=_['merge']({},_0x2c04c3,_0x3847ff[_0xf7d9('0x3a')]);var _0x410c72={'where':_0x2c04c3[_0xf7d9('0x35')]};return db[_0xf7d9('0x2a')]['count'](_0x410c72)[_0xf7d9('0x24')](function(_0xd6d84f){_0x20315e[_0xf7d9('0x1e')]=_0xd6d84f;if(_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x3b')]){_0x2c04c3['include']=[{'all':!![]}];}return db[_0xf7d9('0x2a')][_0xf7d9('0x3c')](_0x2c04c3);})[_0xf7d9('0x24')](function(_0x3db665){_0x20315e[_0xf7d9('0x3d')]=_0x3db665;return _0x20315e;})[_0xf7d9('0x24')](respondWithFilteredResult(_0x2b5f17,_0x2c04c3))[_0xf7d9('0x3e')](handleError(_0x2b5f17,null));};exports[_0xf7d9('0x3f')]=function(_0x40d026,_0x3d056f){var _0x2a349b={'raw':!![],'where':{'id':_0x40d026['params']['id']}},_0x46b7d4={};_0x46b7d4[_0xf7d9('0x2c')]=_[_0xf7d9('0x2d')](db['JscriptyAnswerReport']['rawAttributes']);_0x46b7d4['query']=_[_0xf7d9('0x2d')](_0x40d026['query']);_0x46b7d4[_0xf7d9('0x36')]=_[_0xf7d9('0x2f')](_0x46b7d4[_0xf7d9('0x2c')],_0x46b7d4[_0xf7d9('0x31')]);_0x2a349b[_0xf7d9('0x2e')]=_['intersection'](_0x46b7d4[_0xf7d9('0x2c')],qs[_0xf7d9('0x30')](_0x40d026[_0xf7d9('0x31')][_0xf7d9('0x30')]));_0x2a349b[_0xf7d9('0x2e')]=_0x2a349b['attributes']['length']?_0x2a349b[_0xf7d9('0x2e')]:_0x46b7d4[_0xf7d9('0x2c')];if(_0x40d026[_0xf7d9('0x31')][_0xf7d9('0x3b')]){_0x2a349b[_0xf7d9('0x40')]=[{'all':!![]}];}_0x2a349b=_['merge']({},_0x2a349b,_0x40d026[_0xf7d9('0x3a')]);return db['JscriptyAnswerReport'][_0xf7d9('0x41')](_0x2a349b)[_0xf7d9('0x24')](handleEntityNotFound(_0x3d056f,null))[_0xf7d9('0x24')](respondWithResult(_0x3d056f,null))[_0xf7d9('0x3e')](handleError(_0x3d056f,null));};exports[_0xf7d9('0x42')]=function(_0x1e3a53,_0x4003e9){return db[_0xf7d9('0x2a')][_0xf7d9('0x42')](_0x1e3a53[_0xf7d9('0x43')],{})[_0xf7d9('0x24')](respondWithResult(_0x4003e9,0xc9))[_0xf7d9('0x3e')](handleError(_0x4003e9,null));};exports[_0xf7d9('0x23')]=function(_0x3cdeb5,_0x50731a){if(_0x3cdeb5[_0xf7d9('0x43')]['id']){delete _0x3cdeb5[_0xf7d9('0x43')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x3cdeb5[_0xf7d9('0x44')]['id']}})['then'](handleEntityNotFound(_0x50731a,null))['then'](saveUpdates(_0x3cdeb5[_0xf7d9('0x43')],null))[_0xf7d9('0x24')](respondWithResult(_0x50731a,null))[_0xf7d9('0x3e')](handleError(_0x50731a,null));};exports[_0xf7d9('0x45')]=function(_0xf923e0,_0x9c3719){return db[_0xf7d9('0x2a')][_0xf7d9('0x41')]({'where':{'id':_0xf923e0[_0xf7d9('0x44')]['id']}})[_0xf7d9('0x24')](handleEntityNotFound(_0x9c3719,null))[_0xf7d9('0x24')](removeEntity(_0x9c3719,null))[_0xf7d9('0x3e')](handleError(_0x9c3719,null));};exports['describe']=function(_0x48076b,_0x42da01){return db[_0xf7d9('0x2a')][_0xf7d9('0x46')]()[_0xf7d9('0x24')](respondWithResult(_0x42da01,null))['catch'](handleError(_0x42da01,null));}; \ No newline at end of file +var _0x165d=['attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','fields','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','offset','undefined','count','limit','status','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model'];(function(_0x254abd,_0x1ab7f0){var _0x31bf1b=function(_0x447fd8){while(--_0x447fd8){_0x254abd['push'](_0x254abd['shift']());}};_0x31bf1b(++_0x1ab7f0);}(_0x165d,0x14a));var _0xd165=function(_0x3f842c,_0x140ba5){_0x3f842c=_0x3f842c-0x0;var _0x25d1c0=_0x165d[_0x3f842c];return _0x25d1c0;};'use strict';var emlformat=require(_0xd165('0x0'));var rimraf=require(_0xd165('0x1'));var zipdir=require(_0xd165('0x2'));var jsonpatch=require(_0xd165('0x3'));var rp=require(_0xd165('0x4'));var moment=require(_0xd165('0x5'));var BPromise=require(_0xd165('0x6'));var Mustache=require('mustache');var util=require(_0xd165('0x7'));var path=require(_0xd165('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd165('0x9'));var _=require(_0xd165('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd165('0xb'));var deskjs=require(_0xd165('0xc'));var toCsv=require(_0xd165('0xd'));var querystring=require(_0xd165('0xe'));var Papa=require(_0xd165('0xf'));var Redis=require(_0xd165('0x10'));var authService=require(_0xd165('0x11'));var qs=require(_0xd165('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd165('0x13'));var logger=require(_0xd165('0x14'))(_0xd165('0x15'));var utils=require('../../config/utils');var config=require(_0xd165('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd165('0x17'))['db'];function respondWithStatusCode(_0x267f62,_0x2eee5c){_0x2eee5c=_0x2eee5c||0xcc;return function(_0x430499){if(_0x430499){return _0x267f62['sendStatus'](_0x2eee5c);}return _0x267f62['status'](_0x2eee5c)[_0xd165('0x18')]();};}function respondWithResult(_0x17521a,_0x3e586a){_0x3e586a=_0x3e586a||0xc8;return function(_0x51fa95){if(_0x51fa95){return _0x17521a['status'](_0x3e586a)['json'](_0x51fa95);}};}function respondWithFilteredResult(_0x693c9b,_0x3e6032){return function(_0x4c86c6){if(_0x4c86c6){var _0x170839=typeof _0x3e6032[_0xd165('0x19')]==='undefined'&&typeof _0x3e6032['limit']===_0xd165('0x1a');var _0x30378f=_0x4c86c6['count'];var _0x551561=_0x170839?0x0:_0x3e6032['offset'];var _0x529cc9=_0x170839?_0x4c86c6[_0xd165('0x1b')]:_0x3e6032[_0xd165('0x19')]+_0x3e6032[_0xd165('0x1c')];var _0x7ed688;if(_0x529cc9>=_0x30378f){_0x529cc9=_0x30378f;_0x7ed688=0xc8;}else{_0x7ed688=0xce;}_0x693c9b[_0xd165('0x1d')](_0x7ed688);return _0x693c9b[_0xd165('0x1e')](_0xd165('0x1f'),_0x551561+'-'+_0x529cc9+'/'+_0x30378f)[_0xd165('0x20')](_0x4c86c6);}return null;};}function patchUpdates(_0x332b0a){return function(_0x4ec084){try{jsonpatch[_0xd165('0x21')](_0x4ec084,_0x332b0a,!![]);}catch(_0x492257){return BPromise[_0xd165('0x22')](_0x492257);}return _0x4ec084[_0xd165('0x23')]();};}function saveUpdates(_0x5e9d0a,_0x46a462){return function(_0x3a3b5a){if(_0x3a3b5a){return _0x3a3b5a['update'](_0x5e9d0a)[_0xd165('0x24')](function(_0x33754b){return _0x33754b;});}return null;};}function removeEntity(_0x26ae3b,_0x5a86a2){return function(_0x36838b){if(_0x36838b){return _0x36838b[_0xd165('0x25')]()[_0xd165('0x24')](function(){_0x26ae3b[_0xd165('0x1d')](0xcc)[_0xd165('0x18')]();});}};}function handleEntityNotFound(_0x21a42e,_0x528ea8){return function(_0x43946e){if(!_0x43946e){_0x21a42e[_0xd165('0x26')](0x194);}return _0x43946e;};}function handleError(_0x3c80b7,_0x11167c){_0x11167c=_0x11167c||0x1f4;return function(_0x45183b){logger[_0xd165('0x27')](_0x45183b[_0xd165('0x28')]);if(_0x45183b['name']){delete _0x45183b[_0xd165('0x29')];}_0x3c80b7['status'](_0x11167c)[_0xd165('0x2a')](_0x45183b);};}exports[_0xd165('0x2b')]=function(_0xeefe8,_0x4c503a){var _0x2e71e3={},_0x33ef5f={},_0x1db50b={'count':0x0,'rows':[]};var _0x38f4d3=_['map'](db[_0xd165('0x2c')][_0xd165('0x2d')],function(_0x11a46c){return{'name':_0x11a46c[_0xd165('0x2e')],'type':_0x11a46c[_0xd165('0x2f')][_0xd165('0x30')]};});_0x33ef5f['model']=_[_0xd165('0x31')](_0x38f4d3,_0xd165('0x29'));_0x33ef5f['query']=_[_0xd165('0x32')](_0xeefe8[_0xd165('0x33')]);_0x33ef5f[_0xd165('0x34')]=_[_0xd165('0x35')](_0x33ef5f[_0xd165('0x36')],_0x33ef5f[_0xd165('0x33')]);_0x2e71e3['attributes']=_['intersection'](_0x33ef5f[_0xd165('0x36')],qs['fields'](_0xeefe8[_0xd165('0x33')]['fields']));_0x2e71e3[_0xd165('0x37')]=_0x2e71e3['attributes'][_0xd165('0x38')]?_0x2e71e3[_0xd165('0x37')]:_0x33ef5f[_0xd165('0x36')];if(!_0xeefe8[_0xd165('0x33')][_0xd165('0x39')](_0xd165('0x3a'))){_0x2e71e3[_0xd165('0x1c')]=qs[_0xd165('0x1c')](_0xeefe8[_0xd165('0x33')][_0xd165('0x1c')]);_0x2e71e3[_0xd165('0x19')]=qs[_0xd165('0x19')](_0xeefe8[_0xd165('0x33')][_0xd165('0x19')]);}_0x2e71e3['order']=qs[_0xd165('0x3b')](_0xeefe8[_0xd165('0x33')][_0xd165('0x3b')]);_0x2e71e3[_0xd165('0x3c')]=qs[_0xd165('0x34')](_['pick'](_0xeefe8['query'],_0x33ef5f['filters']),_0x38f4d3);if(_0xeefe8[_0xd165('0x33')][_0xd165('0x3d')]){_0x2e71e3[_0xd165('0x3c')]=_[_0xd165('0x3e')](_0x2e71e3[_0xd165('0x3c')],{'$or':_[_0xd165('0x31')](_0x38f4d3,function(_0x250200){if(_0x250200[_0xd165('0x2f')]!==_0xd165('0x3f')){var _0x1a2e19={};_0x1a2e19[_0x250200[_0xd165('0x29')]]={'$like':'%'+_0xeefe8['query'][_0xd165('0x3d')]+'%'};return _0x1a2e19;}})});}_0x2e71e3=_[_0xd165('0x3e')]({},_0x2e71e3,_0xeefe8[_0xd165('0x40')]);var _0xcafb72={'where':_0x2e71e3[_0xd165('0x3c')]};return db['JscriptyAnswerReport'][_0xd165('0x1b')](_0xcafb72)[_0xd165('0x24')](function(_0x5e3708){_0x1db50b[_0xd165('0x1b')]=_0x5e3708;if(_0xeefe8[_0xd165('0x33')][_0xd165('0x41')]){_0x2e71e3[_0xd165('0x42')]=[{'all':!![]}];}return db[_0xd165('0x2c')][_0xd165('0x43')](_0x2e71e3);})['then'](function(_0x4a5b12){_0x1db50b[_0xd165('0x44')]=_0x4a5b12;return _0x1db50b;})[_0xd165('0x24')](respondWithFilteredResult(_0x4c503a,_0x2e71e3))[_0xd165('0x45')](handleError(_0x4c503a,null));};exports[_0xd165('0x46')]=function(_0x36202f,_0x363290){var _0x290384={'raw':!![],'where':{'id':_0x36202f['params']['id']}},_0xb446f8={};_0xb446f8[_0xd165('0x36')]=_['keys'](db[_0xd165('0x2c')][_0xd165('0x2d')]);_0xb446f8[_0xd165('0x33')]=_[_0xd165('0x32')](_0x36202f[_0xd165('0x33')]);_0xb446f8[_0xd165('0x34')]=_['intersection'](_0xb446f8[_0xd165('0x36')],_0xb446f8[_0xd165('0x33')]);_0x290384[_0xd165('0x37')]=_['intersection'](_0xb446f8[_0xd165('0x36')],qs['fields'](_0x36202f[_0xd165('0x33')][_0xd165('0x47')]));_0x290384[_0xd165('0x37')]=_0x290384[_0xd165('0x37')][_0xd165('0x38')]?_0x290384[_0xd165('0x37')]:_0xb446f8[_0xd165('0x36')];if(_0x36202f['query']['includeAll']){_0x290384['include']=[{'all':!![]}];}_0x290384=_['merge']({},_0x290384,_0x36202f['options']);return db[_0xd165('0x2c')][_0xd165('0x48')](_0x290384)[_0xd165('0x24')](handleEntityNotFound(_0x363290,null))[_0xd165('0x24')](respondWithResult(_0x363290,null))[_0xd165('0x45')](handleError(_0x363290,null));};exports[_0xd165('0x49')]=function(_0x5e73e5,_0x4c729d){return db[_0xd165('0x2c')][_0xd165('0x49')](_0x5e73e5[_0xd165('0x4a')],{})[_0xd165('0x24')](respondWithResult(_0x4c729d,0xc9))[_0xd165('0x45')](handleError(_0x4c729d,null));};exports['update']=function(_0x54f064,_0xd0e787){if(_0x54f064[_0xd165('0x4a')]['id']){delete _0x54f064['body']['id'];}return db[_0xd165('0x2c')][_0xd165('0x48')]({'where':{'id':_0x54f064[_0xd165('0x4b')]['id']}})[_0xd165('0x24')](handleEntityNotFound(_0xd0e787,null))[_0xd165('0x24')](saveUpdates(_0x54f064[_0xd165('0x4a')],null))[_0xd165('0x24')](respondWithResult(_0xd0e787,null))[_0xd165('0x45')](handleError(_0xd0e787,null));};exports[_0xd165('0x25')]=function(_0x1dc329,_0x18f83d){return db['JscriptyAnswerReport'][_0xd165('0x48')]({'where':{'id':_0x1dc329[_0xd165('0x4b')]['id']}})['then'](handleEntityNotFound(_0x18f83d,null))['then'](removeEntity(_0x18f83d,null))[_0xd165('0x45')](handleError(_0x18f83d,null));};exports[_0xd165('0x4c')]=function(_0x4480ac,_0x2d06cb){return db['JscriptyAnswerReport'][_0xd165('0x4c')]()[_0xd165('0x24')](respondWithResult(_0x2d06cb,null))[_0xd165('0x45')](handleError(_0x2d06cb,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index c430eb4..dd8e810 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 _0x8e04=['api','bluebird','request-promise','rimraf','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','../../config/logger'];(function(_0x330414,_0x4f3207){var _0x99dbff=function(_0x166f85){while(--_0x166f85){_0x330414['push'](_0x330414['shift']());}};_0x99dbff(++_0x4f3207);}(_0x8e04,0x1ca));var _0x48e0=function(_0x26797a,_0x104240){_0x26797a=_0x26797a-0x0;var _0xeb5295=_0x8e04[_0x26797a];return _0xeb5295;};'use strict';var _=require(_0x48e0('0x0'));var util=require('util');var logger=require(_0x48e0('0x1'))(_0x48e0('0x2'));var moment=require('moment');var BPromise=require(_0x48e0('0x3'));var rp=require(_0x48e0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48e0('0x5'));var config=require('../../config/environment');var attributes=require(_0x48e0('0x6'));module[_0x48e0('0x7')]=function(_0x2c2b61,_0x24fe54){return _0x2c2b61[_0x48e0('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0x48e0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5bfe=['../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x5bfe,0x10d));var _0xe5bf=function(_0xae3068,_0x720ed){_0xae3068=_0xae3068-0x0;var _0x57c003=_0x5bfe[_0xae3068];return _0x57c003;};'use strict';var _=require(_0xe5bf('0x0'));var util=require('util');var logger=require(_0xe5bf('0x1'))(_0xe5bf('0x2'));var moment=require(_0xe5bf('0x3'));var BPromise=require(_0xe5bf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5bf('0x5'));var rimraf=require(_0xe5bf('0x6'));var config=require(_0xe5bf('0x7'));var attributes=require(_0xe5bf('0x8'));module[_0xe5bf('0x9')]=function(_0x4c4f0e,_0x287ef1){return _0x4c4f0e[_0xe5bf('0xa')](_0xe5bf('0xb'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index c3574a4..13b4164 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 _0x82c8=['info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','then'];(function(_0x1f650d,_0x12fe33){var _0x2d3375=function(_0x168ee3){while(--_0x168ee3){_0x1f650d['push'](_0x1f650d['shift']());}};_0x2d3375(++_0x12fe33);}(_0x82c8,0x123));var _0x882c=function(_0x10718d,_0x567872){_0x10718d=_0x10718d-0x0;var _0x4716e5=_0x82c8[_0x10718d];return _0x4716e5;};'use strict';var _=require(_0x882c('0x0'));var util=require('util');var moment=require(_0x882c('0x1'));var BPromise=require(_0x882c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x882c('0x3'));var db=require(_0x882c('0x4'))['db'];var utils=require(_0x882c('0x5'));var logger=require(_0x882c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x882c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4058f2,_0x154aad,_0x13df52){return new BPromise(function(_0x39255e,_0x2ab01a){return client['request'](_0x4058f2,_0x13df52)[_0x882c('0x8')](function(_0x500f2c){logger[_0x882c('0x9')](_0x882c('0xa'),_0x154aad,'request\x20sent');logger[_0x882c('0xb')](_0x882c('0xc'),_0x154aad,_0x882c('0xd'),JSON[_0x882c('0xe')](_0x500f2c));if(_0x500f2c[_0x882c('0xf')]){if(_0x500f2c[_0x882c('0xf')][_0x882c('0x10')]===0x1f4){logger[_0x882c('0xf')](_0x882c('0xa'),_0x154aad,_0x500f2c['error']['message']);return _0x2ab01a(_0x500f2c['error'][_0x882c('0x11')]);}logger[_0x882c('0xf')](_0x882c('0xa'),_0x154aad,_0x500f2c['error'][_0x882c('0x11')]);return _0x39255e(_0x500f2c[_0x882c('0xf')]['message']);}else{logger[_0x882c('0x9')](_0x882c('0xa'),_0x154aad,_0x882c('0xd'));_0x39255e(_0x500f2c[_0x882c('0x12')][_0x882c('0x11')]);}})[_0x882c('0x13')](function(_0x584290){logger[_0x882c('0xf')](_0x882c('0xa'),_0x154aad,_0x584290);_0x2ab01a(_0x584290);});});} \ No newline at end of file +var _0xf42c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','error','JscriptyAnswerReport,\x20%s,\x20%s','message','catch'];(function(_0x56f6fb,_0x28bd5e){var _0x2a40d6=function(_0x8ace6f){while(--_0x8ace6f){_0x56f6fb['push'](_0x56f6fb['shift']());}};_0x2a40d6(++_0x28bd5e);}(_0xf42c,0x66));var _0xcf42=function(_0x1e0c0e,_0x5ccb80){_0x1e0c0e=_0x1e0c0e-0x0;var _0x53fecc=_0xf42c[_0x1e0c0e];return _0x53fecc;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xcf42('0x0'));var rs=require(_0xcf42('0x1'));var fs=require('fs');var Redis=require(_0xcf42('0x2'));var db=require(_0xcf42('0x3'))['db'];var utils=require(_0xcf42('0x4'));var logger=require('../../config/logger')(_0xcf42('0x5'));var config=require(_0xcf42('0x6'));var jayson=require(_0xcf42('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11f195,_0x20abb9,_0x2cfdde){return new BPromise(function(_0x3506cc,_0x310171){return client[_0xcf42('0x8')](_0x11f195,_0x2cfdde)[_0xcf42('0x9')](function(_0xda46ba){logger[_0xcf42('0xa')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x20abb9,_0xcf42('0xb'));logger[_0xcf42('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x20abb9,'request\x20sent',JSON['stringify'](_0xda46ba));if(_0xda46ba[_0xcf42('0xd')]){if(_0xda46ba[_0xcf42('0xd')]['code']===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x20abb9,_0xda46ba[_0xcf42('0xd')]['message']);return _0x310171(_0xda46ba[_0xcf42('0xd')]['message']);}logger[_0xcf42('0xd')](_0xcf42('0xe'),_0x20abb9,_0xda46ba[_0xcf42('0xd')][_0xcf42('0xf')]);return _0x3506cc(_0xda46ba[_0xcf42('0xd')][_0xcf42('0xf')]);}else{logger[_0xcf42('0xa')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x20abb9,_0xcf42('0xb'));_0x3506cc(_0xda46ba['result']['message']);}})[_0xcf42('0x10')](function(_0x4b0fc0){logger[_0xcf42('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x20abb9,_0x4b0fc0);_0x310171(_0x4b0fc0);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index f8e6d3f..26a810a 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 _0xc4ff=['util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','clone','put','update','delete','exports','multer'];(function(_0x2c0bf1,_0xbc25d5){var _0xd9185=function(_0x5497ba){while(--_0x5497ba){_0x2c0bf1['push'](_0x2c0bf1['shift']());}};_0xd9185(++_0xbc25d5);}(_0xc4ff,0x1a1));var _0xfc4f=function(_0x20561e,_0x31a5e3){_0x20561e=_0x20561e-0x0;var _0x20201d=_0xc4ff[_0x20561e];return _0x20201d;};'use strict';var multer=require(_0xfc4f('0x0'));var util=require(_0xfc4f('0x1'));var path=require(_0xfc4f('0x2'));var timeout=require('connect-timeout');var express=require(_0xfc4f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfc4f('0x4'));var interaction=require(_0xfc4f('0x5'));var config=require(_0xfc4f('0x6'));var controller=require(_0xfc4f('0x7'));router[_0xfc4f('0x8')]('/',auth[_0xfc4f('0x9')](),controller['index']);router[_0xfc4f('0x8')](_0xfc4f('0xa'),auth[_0xfc4f('0x9')](),controller['show']);router[_0xfc4f('0x8')]('/:id/sessions',auth[_0xfc4f('0x9')](),controller['getSessions']);router[_0xfc4f('0x8')]('/:id/answers',auth[_0xfc4f('0x9')](),controller[_0xfc4f('0xb')]);router[_0xfc4f('0x8')](_0xfc4f('0xc'),auth['isAuthenticated'](),timeout(_0xfc4f('0xd')),controller[_0xfc4f('0xe')]);router['post']('/',auth[_0xfc4f('0x9')](),controller['create']);router[_0xfc4f('0xf')](_0xfc4f('0x10'),auth['isAuthenticated'](),controller[_0xfc4f('0x11')]);router[_0xfc4f('0x12')](_0xfc4f('0xa'),auth[_0xfc4f('0x9')](),controller[_0xfc4f('0x13')]);router[_0xfc4f('0x14')](_0xfc4f('0xa'),auth[_0xfc4f('0x9')](),controller['destroy']);module[_0xfc4f('0x15')]=router; \ No newline at end of file +var _0x7b9d=['get','/:id','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','30s','getSummary','post','/:id/clone','clone','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../config/environment','./jscriptyProject.controller','index'];(function(_0x508036,_0x2d97d9){var _0x1f5862=function(_0x5538b3){while(--_0x5538b3){_0x508036['push'](_0x508036['shift']());}};_0x1f5862(++_0x2d97d9);}(_0x7b9d,0xde));var _0xd7b9=function(_0x708cfa,_0x413d56){_0x708cfa=_0x708cfa-0x0;var _0x2418ca=_0x7b9d[_0x708cfa];return _0x2418ca;};'use strict';var multer=require(_0xd7b9('0x0'));var util=require('util');var path=require(_0xd7b9('0x1'));var timeout=require(_0xd7b9('0x2'));var express=require(_0xd7b9('0x3'));var router=express[_0xd7b9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd7b9('0x5'));var controller=require(_0xd7b9('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xd7b9('0x7')]);router[_0xd7b9('0x8')](_0xd7b9('0x9'),auth[_0xd7b9('0xa')](),controller[_0xd7b9('0xb')]);router[_0xd7b9('0x8')](_0xd7b9('0xc'),auth['isAuthenticated'](),controller[_0xd7b9('0xd')]);router[_0xd7b9('0x8')](_0xd7b9('0xe'),auth[_0xd7b9('0xa')](),controller['getAnswers']);router[_0xd7b9('0x8')]('/:id/summary',auth['isAuthenticated'](),timeout(_0xd7b9('0xf')),controller[_0xd7b9('0x10')]);router['post']('/',auth[_0xd7b9('0xa')](),controller['create']);router[_0xd7b9('0x11')](_0xd7b9('0x12'),auth['isAuthenticated'](),controller[_0xd7b9('0x13')]);router['put']('/:id',auth[_0xd7b9('0xa')](),controller['update']);router[_0xd7b9('0x14')](_0xd7b9('0x9'),auth[_0xd7b9('0xa')](),controller[_0xd7b9('0x15')]);module[_0xd7b9('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 5ea3775..f23d9ed 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 _0x8f6a=['STRING','name','TEXT','isObjectLike','formData','setDataValue','format','getDataValue','description','BOOLEAN','lodash'];(function(_0x2b9cf5,_0x2a7804){var _0xd0cf15=function(_0x92a896){while(--_0x92a896){_0x2b9cf5['push'](_0x2b9cf5['shift']());}};_0xd0cf15(++_0x2a7804);}(_0x8f6a,0x1ac));var _0xa8f6=function(_0x484c28,_0x587f1c){_0x484c28=_0x484c28-0x0;var _0x11ff92=_0x8f6a[_0x484c28];return _0x11ff92;};'use strict';var Sequelize=require('sequelize');var _=require(_0xa8f6('0x0'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0xa8f6('0x1')],'unique':_0xa8f6('0x2')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xa8f6('0x3')]('long'),'set':function(_0x52b409){if(_[_0xa8f6('0x4')](_0x52b409)){this['setDataValue'](_0xa8f6('0x5'),JSON['stringify'](_0x52b409));}else if(_['isString'](_0x52b409)){this[_0xa8f6('0x6')]('formData',_0x52b409);}else{this[_0xa8f6('0x6')](_0xa8f6('0x5'),util[_0xa8f6('0x7')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xa8f6('0x8')]('name')||'',this[_0xa8f6('0x8')](_0xa8f6('0x9'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xa8f6('0xa')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xa8f6('0xa')],'defaultValue':![]}}; \ No newline at end of file +var _0xd3c0=['BOOLEAN','sequelize','lodash','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','format','getDataValue','description'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3c0,0x91));var _0x0d3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3c0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0d3c('0x0'));var _=require(_0x0d3c('0x1'));var util=require('util');module[_0x0d3c('0x2')]={'name':{'type':Sequelize[_0x0d3c('0x3')],'unique':_0x0d3c('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x0d3c('0x5')](_0x0d3c('0x6')),'set':function(_0x2f16df){if(_[_0x0d3c('0x7')](_0x2f16df)){this[_0x0d3c('0x8')]('formData',JSON[_0x0d3c('0x9')](_0x2f16df));}else if(_[_0x0d3c('0xa')](_0x2f16df)){this[_0x0d3c('0x8')](_0x0d3c('0xb'),_0x2f16df);}else{this['setDataValue']('formData',util[_0x0d3c('0xc')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x0d3c('0xd')](_0x0d3c('0x4'))||'',this[_0x0d3c('0xd')](_0x0d3c('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x0d3c('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 8d828c7..aa81831 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 _0x4d11=['JscriptySessionReport','order','pick','getAnswers','JscriptyAnswerReport','ProjectId','rows','number','fromCharCode','toString','indexOf','replace','starttime','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','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','limit','count','Content-Range','apply','reject','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','JscriptyProject','includeAll','findAll','catch','show','params','keys','fields','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','role','update','findOne'];(function(_0x2c6af5,_0x573104){var _0x10b2e7=function(_0x48faf4){while(--_0x48faf4){_0x2c6af5['push'](_0x2c6af5['shift']());}};_0x10b2e7(++_0x573104);}(_0x4d11,0x10f));var _0x14d1=function(_0x2d1d37,_0x1048d8){_0x2d1d37=_0x2d1d37-0x0;var _0x3e9649=_0x4d11[_0x2d1d37];return _0x3e9649;};'use strict';var emlformat=require(_0x14d1('0x0'));var rimraf=require(_0x14d1('0x1'));var zipdir=require(_0x14d1('0x2'));var jsonpatch=require(_0x14d1('0x3'));var rp=require('request-promise');var moment=require(_0x14d1('0x4'));var BPromise=require(_0x14d1('0x5'));var Mustache=require(_0x14d1('0x6'));var util=require(_0x14d1('0x7'));var path=require(_0x14d1('0x8'));var sox=require('sox');var csv=require(_0x14d1('0x9'));var ejs=require(_0x14d1('0xa'));var fs=require('fs');var fs_extra=require(_0x14d1('0xb'));var _=require(_0x14d1('0xc'));var squel=require(_0x14d1('0xd'));var crypto=require('crypto');var jsforce=require(_0x14d1('0xe'));var deskjs=require(_0x14d1('0xf'));var toCsv=require('to-csv');var querystring=require(_0x14d1('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x14d1('0x11'));var qs=require(_0x14d1('0x12'));var as=require(_0x14d1('0x13'));var hardwareService=require(_0x14d1('0x14'));var logger=require(_0x14d1('0x15'))(_0x14d1('0x16'));var utils=require(_0x14d1('0x17'));var config=require(_0x14d1('0x18'));var licenseUtil=require(_0x14d1('0x19'));var db=require(_0x14d1('0x1a'))['db'];function respondWithStatusCode(_0x5b92f9,_0x53fe13){_0x53fe13=_0x53fe13||0xcc;return function(_0x21421a){if(_0x21421a){return _0x5b92f9[_0x14d1('0x1b')](_0x53fe13);}return _0x5b92f9[_0x14d1('0x1c')](_0x53fe13)[_0x14d1('0x1d')]();};}function respondWithResult(_0x3e3316,_0x836358){_0x836358=_0x836358||0xc8;return function(_0x853226){if(_0x853226){return _0x3e3316[_0x14d1('0x1c')](_0x836358)[_0x14d1('0x1e')](_0x853226);}};}function respondWithFilteredResult(_0x3513f3,_0x168635){return function(_0xe851f9){if(_0xe851f9){var _0x1ddc8d=typeof _0x168635[_0x14d1('0x1f')]==='undefined'&&typeof _0x168635[_0x14d1('0x20')]==='undefined';var _0x37260d=_0xe851f9[_0x14d1('0x21')];var _0x5de993=_0x1ddc8d?0x0:_0x168635['offset'];var _0x281de0=_0x1ddc8d?_0xe851f9[_0x14d1('0x21')]:_0x168635[_0x14d1('0x1f')]+_0x168635[_0x14d1('0x20')];var _0x5239cc;if(_0x281de0>=_0x37260d){_0x281de0=_0x37260d;_0x5239cc=0xc8;}else{_0x5239cc=0xce;}_0x3513f3[_0x14d1('0x1c')](_0x5239cc);return _0x3513f3['set'](_0x14d1('0x22'),_0x5de993+'-'+_0x281de0+'/'+_0x37260d)[_0x14d1('0x1e')](_0xe851f9);}return null;};}function patchUpdates(_0x5859f5){return function(_0x412408){try{jsonpatch[_0x14d1('0x23')](_0x412408,_0x5859f5,!![]);}catch(_0x12ae7e){return BPromise[_0x14d1('0x24')](_0x12ae7e);}return _0x412408['save']();};}function saveUpdates(_0x3cc8e3,_0x5a2d7e){return function(_0x35c14e){if(_0x35c14e){return _0x35c14e['update'](_0x3cc8e3)[_0x14d1('0x25')](function(_0xbdeea4){return _0xbdeea4;});}return null;};}function removeEntity(_0x282bc5,_0x30814e){return function(_0x41e0f1){if(_0x41e0f1){return _0x41e0f1[_0x14d1('0x26')]()[_0x14d1('0x25')](function(){var _0x4df744=_0x41e0f1[_0x14d1('0x27')]({'plain':!![]});var _0x136988=_0x14d1('0x28');return db[_0x14d1('0x29')][_0x14d1('0x26')]({'where':{'type':_0x136988,'resourceId':_0x4df744['id']}})[_0x14d1('0x25')](function(){return _0x41e0f1;});})['then'](function(){_0x282bc5[_0x14d1('0x1c')](0xcc)[_0x14d1('0x1d')]();});}};}function handleEntityNotFound(_0x18e46b,_0x3b7279){return function(_0x104687){if(!_0x104687){_0x18e46b[_0x14d1('0x1b')](0x194);}return _0x104687;};}function handleError(_0x5628ab,_0x2401b3){_0x2401b3=_0x2401b3||0x1f4;return function(_0x1f56ee){logger[_0x14d1('0x2a')](_0x1f56ee[_0x14d1('0x2b')]);if(_0x1f56ee[_0x14d1('0x2c')]){delete _0x1f56ee[_0x14d1('0x2c')];}_0x5628ab[_0x14d1('0x1c')](_0x2401b3)[_0x14d1('0x2d')](_0x1f56ee);};}exports[_0x14d1('0x2e')]=function(_0x49fb73,_0x39982b){var _0x139775={},_0x24711b={},_0x114618={'count':0x0,'rows':[]};var _0x5e674b=_[_0x14d1('0x2f')](db['JscriptyProject'][_0x14d1('0x30')],function(_0x4b8182){return{'name':_0x4b8182['fieldName'],'type':_0x4b8182['type'][_0x14d1('0x31')]};});_0x24711b[_0x14d1('0x32')]=_[_0x14d1('0x2f')](_0x5e674b,_0x14d1('0x2c'));_0x24711b[_0x14d1('0x33')]=_['keys'](_0x49fb73[_0x14d1('0x33')]);_0x24711b[_0x14d1('0x34')]=_[_0x14d1('0x35')](_0x24711b['model'],_0x24711b[_0x14d1('0x33')]);_0x139775['attributes']=_['intersection'](_0x24711b[_0x14d1('0x32')],qs['fields'](_0x49fb73['query']['fields']));_0x139775['attributes']=_0x139775[_0x14d1('0x36')][_0x14d1('0x37')]?_0x139775[_0x14d1('0x36')]:_0x24711b['model'];if(!_0x49fb73[_0x14d1('0x33')][_0x14d1('0x38')](_0x14d1('0x39'))){_0x139775[_0x14d1('0x20')]=qs[_0x14d1('0x20')](_0x49fb73[_0x14d1('0x33')]['limit']);_0x139775[_0x14d1('0x1f')]=qs[_0x14d1('0x1f')](_0x49fb73['query'][_0x14d1('0x1f')]);}_0x139775['order']=qs[_0x14d1('0x3a')](_0x49fb73['query'][_0x14d1('0x3a')]);_0x139775[_0x14d1('0x3b')]=qs[_0x14d1('0x34')](_['pick'](_0x49fb73[_0x14d1('0x33')],_0x24711b[_0x14d1('0x34')]),_0x5e674b);if(_0x49fb73[_0x14d1('0x33')][_0x14d1('0x3c')]){_0x139775[_0x14d1('0x3b')]=_[_0x14d1('0x3d')](_0x139775[_0x14d1('0x3b')],{'$or':_[_0x14d1('0x2f')](_0x5e674b,function(_0x3d2043){if(_0x3d2043[_0x14d1('0x3e')]!==_0x14d1('0x3f')){var _0xb0c710={};_0xb0c710[_0x3d2043[_0x14d1('0x2c')]]={'$like':'%'+_0x49fb73[_0x14d1('0x33')][_0x14d1('0x3c')]+'%'};return _0xb0c710;}})});}_0x139775=_[_0x14d1('0x3d')]({},_0x139775,_0x49fb73[_0x14d1('0x40')]);var _0x40bf88={'where':_0x139775[_0x14d1('0x3b')]};return db[_0x14d1('0x41')][_0x14d1('0x21')](_0x40bf88)['then'](function(_0x1d5bff){_0x114618['count']=_0x1d5bff;if(_0x49fb73[_0x14d1('0x33')][_0x14d1('0x42')]){_0x139775['include']=[{'all':!![]}];}return db[_0x14d1('0x41')][_0x14d1('0x43')](_0x139775);})['then'](function(_0x23afb0){_0x114618['rows']=_0x23afb0;return _0x114618;})['then'](respondWithFilteredResult(_0x39982b,_0x139775))[_0x14d1('0x44')](handleError(_0x39982b,null));};exports[_0x14d1('0x45')]=function(_0x246526,_0x1529a0){var _0x5903a8={'raw':![],'where':{'id':_0x246526[_0x14d1('0x46')]['id']}},_0x1a935f={};_0x1a935f[_0x14d1('0x32')]=_[_0x14d1('0x47')](db[_0x14d1('0x41')][_0x14d1('0x30')]);_0x1a935f[_0x14d1('0x33')]=_[_0x14d1('0x47')](_0x246526['query']);_0x1a935f[_0x14d1('0x34')]=_['intersection'](_0x1a935f[_0x14d1('0x32')],_0x1a935f[_0x14d1('0x33')]);_0x5903a8[_0x14d1('0x36')]=_[_0x14d1('0x35')](_0x1a935f[_0x14d1('0x32')],qs[_0x14d1('0x48')](_0x246526[_0x14d1('0x33')][_0x14d1('0x48')]));_0x5903a8[_0x14d1('0x36')]=_0x5903a8['attributes'][_0x14d1('0x37')]?_0x5903a8['attributes']:_0x1a935f[_0x14d1('0x32')];if(_0x246526[_0x14d1('0x33')][_0x14d1('0x42')]){_0x5903a8[_0x14d1('0x49')]=[{'all':!![]}];}_0x5903a8=_[_0x14d1('0x3d')]({},_0x5903a8,_0x246526[_0x14d1('0x40')]);return db['JscriptyProject']['find'](_0x5903a8)[_0x14d1('0x25')](handleEntityNotFound(_0x1529a0,null))[_0x14d1('0x25')](respondWithResult(_0x1529a0,null))['catch'](handleError(_0x1529a0,null));};exports['create']=function(_0x130cb5,_0x180e05){return db[_0x14d1('0x41')][_0x14d1('0x4a')](_0x130cb5[_0x14d1('0x4b')],{})[_0x14d1('0x25')](function(_0x514370){var _0x57d541=_0x130cb5['user'][_0x14d1('0x27')]({'plain':!![]});if(!_0x57d541)throw new Error(_0x14d1('0x4c'));if(_0x57d541['role']===_0x14d1('0x4d')){var _0x54a875=_0x514370[_0x14d1('0x27')]({'plain':!![]});var _0x13af3b='Projects';return db[_0x14d1('0x4e')][_0x14d1('0x4f')]({'where':{'name':_0x13af3b,'userProfileId':_0x57d541[_0x14d1('0x50')]},'raw':!![]})[_0x14d1('0x25')](function(_0x2f64b0){if(_0x2f64b0&&_0x2f64b0[_0x14d1('0x51')]===0x0){return db[_0x14d1('0x29')]['create']({'name':_0x54a875['name'],'resourceId':_0x54a875['id'],'type':_0x2f64b0[_0x14d1('0x2c')],'sectionId':_0x2f64b0['id']},{})[_0x14d1('0x25')](function(){return _0x514370;});}else{return _0x514370;}})[_0x14d1('0x44')](function(_0x154239){logger[_0x14d1('0x2a')](_0x14d1('0x52'),_0x154239);throw _0x154239;});}return _0x514370;})[_0x14d1('0x25')](respondWithResult(_0x180e05,0xc9))[_0x14d1('0x44')](handleError(_0x180e05,null));};exports[_0x14d1('0x53')]=function(_0x2fd37f,_0x24cecf){var _0x10512f={'where':{'id':_0x2fd37f['params']['id']}},_0x3f7052={};_0x3f7052[_0x14d1('0x32')]=_[_0x14d1('0x47')](db[_0x14d1('0x41')][_0x14d1('0x30')]);_0x10512f[_0x14d1('0x36')]=_['intersection'](_0x3f7052['model'],qs[_0x14d1('0x48')](_0x2fd37f[_0x14d1('0x33')][_0x14d1('0x48')]));_0x10512f[_0x14d1('0x36')]=_0x10512f['attributes'][_0x14d1('0x37')]?_0x10512f[_0x14d1('0x36')]:_0x3f7052[_0x14d1('0x32')];if(_0x2fd37f['query'][_0x14d1('0x42')]){_0x10512f[_0x14d1('0x49')]=[{'all':!![]}];}_0x10512f=_['merge']({},_0x10512f,_0x2fd37f['options']);return db['JscriptyProject'][_0x14d1('0x4f')](_0x10512f)[_0x14d1('0x25')](handleEntityNotFound(_0x24cecf,null))['then'](function(_0x5091bf){if(_0x5091bf){var _0x2d9b18=_0x5091bf[_0x14d1('0x27')]({'plain':!![]});_0x2d9b18=qs['omit'](_0x2d9b18,['id',_0x14d1('0x54'),_0x14d1('0x55')]);_0x2fd37f[_0x14d1('0x4b')]=_['omit'](_0x2fd37f[_0x14d1('0x4b')],['id',_0x14d1('0x54'),_0x14d1('0x55')]);return db[_0x14d1('0x41')][_0x14d1('0x4a')](_[_0x14d1('0x3d')](_0x2d9b18,_0x2fd37f[_0x14d1('0x4b')]),{'include':_0x2fd37f[_0x14d1('0x33')][_0x14d1('0x42')]?[{'all':!![]}]:undefined})[_0x14d1('0x25')](function(_0x2bbdd8){var _0x580077=_0x2fd37f[_0x14d1('0x4d')][_0x14d1('0x27')]({'plain':!![]});if(!_0x580077)throw new Error(_0x14d1('0x4c'));if(_0x580077[_0x14d1('0x56')]===_0x14d1('0x4d')){var _0x147043=_0x2bbdd8[_0x14d1('0x27')]({'plain':!![]});var _0x28c431=_0x14d1('0x28');return db[_0x14d1('0x4e')]['find']({'where':{'name':_0x28c431,'userProfileId':_0x580077['userProfileId']},'raw':!![]})[_0x14d1('0x25')](function(_0x3ad98a){if(_0x3ad98a&&_0x3ad98a[_0x14d1('0x51')]===0x0){return db['UserProfileResource'][_0x14d1('0x4a')]({'name':_0x147043['name'],'resourceId':_0x147043['id'],'type':_0x3ad98a['name'],'sectionId':_0x3ad98a['id']},{})[_0x14d1('0x25')](function(){return _0x2bbdd8;});}else{return _0x2bbdd8;}})['catch'](function(_0x39b5f4){logger[_0x14d1('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39b5f4);throw _0x39b5f4;});}return _0x2bbdd8;});}})['then'](respondWithResult(_0x24cecf,0xc9))['catch'](handleError(_0x24cecf,null));};exports[_0x14d1('0x57')]=function(_0x4830f8,_0x1379ff){if(_0x4830f8[_0x14d1('0x4b')]['id']){delete _0x4830f8[_0x14d1('0x4b')]['id'];}return db['JscriptyProject'][_0x14d1('0x4f')]({'where':{'id':_0x4830f8['params']['id']}})[_0x14d1('0x25')](handleEntityNotFound(_0x1379ff,null))[_0x14d1('0x25')](saveUpdates(_0x4830f8['body'],null))[_0x14d1('0x25')](respondWithResult(_0x1379ff,null))[_0x14d1('0x44')](handleError(_0x1379ff,null));};exports['destroy']=function(_0x50be02,_0x56db29){return db[_0x14d1('0x41')]['find']({'where':{'id':_0x50be02['params']['id']}})['then'](handleEntityNotFound(_0x56db29,null))['then'](removeEntity(_0x56db29,null))[_0x14d1('0x44')](handleError(_0x56db29,null));};exports['getSessions']=function(_0x5002d4,_0x504ebb,_0x4d7b92){var _0x3271a1={'raw':!![],'where':{}};var _0x52c263={};var _0x5e057b={'count':0x0,'rows':[]};return db[_0x14d1('0x41')][_0x14d1('0x58')]({'where':{'id':_0x5002d4[_0x14d1('0x46')]['id']}})[_0x14d1('0x25')](handleEntityNotFound(_0x504ebb,null))['then'](function(_0xe67d5){if(_0xe67d5){_0x52c263[_0x14d1('0x32')]=_['keys'](db[_0x14d1('0x59')][_0x14d1('0x30')]);_0x52c263['query']=_[_0x14d1('0x47')](_0x5002d4[_0x14d1('0x33')]);_0x52c263[_0x14d1('0x34')]=_[_0x14d1('0x35')](_0x52c263[_0x14d1('0x32')],_0x52c263[_0x14d1('0x33')]);_0x3271a1[_0x14d1('0x36')]=_['intersection'](_0x52c263['model'],qs[_0x14d1('0x48')](_0x5002d4[_0x14d1('0x33')][_0x14d1('0x48')]));_0x3271a1['attributes']=_0x3271a1[_0x14d1('0x36')][_0x14d1('0x37')]?_0x3271a1[_0x14d1('0x36')]:_0x52c263[_0x14d1('0x32')];if(!_0x5002d4['query'][_0x14d1('0x38')](_0x14d1('0x39'))){_0x3271a1[_0x14d1('0x20')]=qs[_0x14d1('0x20')](_0x5002d4['query'][_0x14d1('0x20')]);_0x3271a1['offset']=qs[_0x14d1('0x1f')](_0x5002d4[_0x14d1('0x33')][_0x14d1('0x1f')]);}_0x3271a1[_0x14d1('0x5a')]=qs[_0x14d1('0x3a')](_0x5002d4[_0x14d1('0x33')][_0x14d1('0x3a')]);_0x3271a1['where']=qs[_0x14d1('0x34')](_[_0x14d1('0x5b')](_0x5002d4['query'],_0x52c263[_0x14d1('0x34')]));_0x3271a1[_0x14d1('0x3b')]['ProjectId']=_0xe67d5['id'];if(_0x5002d4[_0x14d1('0x33')][_0x14d1('0x3c')]){_0x3271a1[_0x14d1('0x3b')]=_[_0x14d1('0x3d')](_0x3271a1[_0x14d1('0x3b')],{'$or':_[_0x14d1('0x2f')](_0x3271a1['attributes'],function(_0x2cd988){var _0x8a322a={};_0x8a322a[_0x2cd988]={'$like':'%'+_0x5002d4[_0x14d1('0x33')][_0x14d1('0x3c')]+'%'};return _0x8a322a;})});}_0x3271a1=_[_0x14d1('0x3d')]({},_0x3271a1,_0x5002d4[_0x14d1('0x40')]);return db[_0x14d1('0x59')][_0x14d1('0x21')]({'where':_0x3271a1[_0x14d1('0x3b')]})[_0x14d1('0x25')](function(_0x2e0874){_0x5e057b[_0x14d1('0x21')]=_0x2e0874;if(_0x5002d4[_0x14d1('0x33')][_0x14d1('0x42')]){_0x3271a1[_0x14d1('0x49')]=[{'all':!![]}];}return db[_0x14d1('0x59')][_0x14d1('0x43')](_0x3271a1);})[_0x14d1('0x25')](function(_0x42b2ff){_0x5e057b['rows']=_0x42b2ff;return _0x5e057b;});}})[_0x14d1('0x25')](respondWithFilteredResult(_0x504ebb,_0x3271a1))[_0x14d1('0x44')](handleError(_0x504ebb,null));};exports[_0x14d1('0x5c')]=function(_0x215d8c,_0x4fb2d3,_0x548a25){var _0x30f2e4={'raw':!![],'where':{}};var _0x992b5b={};var _0x10e7c1={'count':0x0,'rows':[]};return db[_0x14d1('0x41')][_0x14d1('0x58')]({'where':{'id':_0x215d8c[_0x14d1('0x46')]['id']}})[_0x14d1('0x25')](handleEntityNotFound(_0x4fb2d3,null))[_0x14d1('0x25')](function(_0x44ba47){if(_0x44ba47){_0x992b5b['model']=_[_0x14d1('0x47')](db[_0x14d1('0x5d')][_0x14d1('0x30')]);_0x992b5b[_0x14d1('0x33')]=_[_0x14d1('0x47')](_0x215d8c[_0x14d1('0x33')]);_0x992b5b[_0x14d1('0x34')]=_[_0x14d1('0x35')](_0x992b5b['model'],_0x992b5b['query']);_0x30f2e4['attributes']=_[_0x14d1('0x35')](_0x992b5b['model'],qs['fields'](_0x215d8c['query'][_0x14d1('0x48')]));_0x30f2e4[_0x14d1('0x36')]=_0x30f2e4[_0x14d1('0x36')][_0x14d1('0x37')]?_0x30f2e4['attributes']:_0x992b5b[_0x14d1('0x32')];if(!_0x215d8c[_0x14d1('0x33')][_0x14d1('0x38')]('nolimit')){_0x30f2e4[_0x14d1('0x20')]=qs[_0x14d1('0x20')](_0x215d8c[_0x14d1('0x33')][_0x14d1('0x20')]);_0x30f2e4[_0x14d1('0x1f')]=qs[_0x14d1('0x1f')](_0x215d8c[_0x14d1('0x33')][_0x14d1('0x1f')]);}_0x30f2e4[_0x14d1('0x5a')]=qs['sort'](_0x215d8c[_0x14d1('0x33')]['sort']);_0x30f2e4[_0x14d1('0x3b')]=qs[_0x14d1('0x34')](_[_0x14d1('0x5b')](_0x215d8c[_0x14d1('0x33')],_0x992b5b[_0x14d1('0x34')]));_0x30f2e4[_0x14d1('0x3b')][_0x14d1('0x5e')]=_0x44ba47['id'];if(_0x215d8c['query']['filter']){_0x30f2e4[_0x14d1('0x3b')]=_[_0x14d1('0x3d')](_0x30f2e4[_0x14d1('0x3b')],{'$or':_[_0x14d1('0x2f')](_0x30f2e4[_0x14d1('0x36')],function(_0x3572ea){var _0x32b786={};_0x32b786[_0x3572ea]={'$like':'%'+_0x215d8c['query'][_0x14d1('0x3c')]+'%'};return _0x32b786;})});}_0x30f2e4=_[_0x14d1('0x3d')]({},_0x30f2e4,_0x215d8c[_0x14d1('0x40')]);return db[_0x14d1('0x5d')]['count']({'where':_0x30f2e4[_0x14d1('0x3b')]})[_0x14d1('0x25')](function(_0x2fc12a){_0x10e7c1['count']=_0x2fc12a;if(_0x215d8c[_0x14d1('0x33')]['includeAll']){_0x30f2e4[_0x14d1('0x49')]=[{'all':!![]}];}return db[_0x14d1('0x5d')][_0x14d1('0x43')](_0x30f2e4);})[_0x14d1('0x25')](function(_0x1f6f6a){_0x10e7c1[_0x14d1('0x5f')]=_0x1f6f6a;return _0x10e7c1;});}})[_0x14d1('0x25')](respondWithFilteredResult(_0x4fb2d3,_0x30f2e4))['catch'](handleError(_0x4fb2d3,null));};function char(_0x107a5f){return _0x14d1('0x60')===typeof _0x107a5f?String[_0x14d1('0x61')]['apply'](null,arguments):_0x107a5f;}function needsEncapsulation(_0xe2b66e){return!!_0xe2b66e&&(_0xe2b66e[_0x14d1('0x62')]()['indexOf'](char(0xd))>=0x0||_0xe2b66e[_0x14d1('0x62')]()[_0x14d1('0x63')](char(0xa))>=0x0||_0xe2b66e[_0x14d1('0x62')]()[_0x14d1('0x63')](char(0x2c))>=0x0||_0xe2b66e[_0x14d1('0x62')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x4de764){var _0x35ae77=char(0x22),_0x4a65a9='\x5c'+char(0x22),_0x4c5f68=_0x4de764['toString']()[_0x14d1('0x64')](new RegExp(_0x35ae77,'g'),_0x4a65a9);return _0x35ae77+_0x4c5f68+_0x35ae77;}exports['getSummary']=function(_0x508d3f,_0x29fc57,_0x82f237){var _0x127646,_0x383f99;var _0x3934a9={'where':{'ProjectId':_0x508d3f[_0x14d1('0x46')]['id']}};if(_0x508d3f['query']['startTime']){_0x3934a9[_0x14d1('0x3b')][_0x14d1('0x65')]=JSON['parse'](_0x508d3f[_0x14d1('0x33')][_0x14d1('0x66')]);}return db[_0x14d1('0x59')][_0x14d1('0x43')](_0x3934a9)[_0x14d1('0x25')](handleEntityNotFound(_0x29fc57,null))[_0x14d1('0x25')](function(_0x546d1a){if(_0x546d1a){_0x127646=_0x546d1a;return db[_0x14d1('0x67')][_0x14d1('0x43')]({'where':{'SessionId':{'$in':_[_0x14d1('0x2f')](_0x127646,'id')},'ProjectId':_0x508d3f[_0x14d1('0x46')]['id']},'order':_0x14d1('0x68')});}})[_0x14d1('0x25')](handleEntityNotFound(_0x29fc57,null))[_0x14d1('0x25')](function(_0x4af1b0){if(_0x4af1b0){_0x383f99=_0x4af1b0;var _0x10e976={};for(var _0x54754e=0x0,_0x5f0ec5=_0x383f99[_0x14d1('0x37')];_0x54754e<_0x5f0ec5;_0x54754e++){if(!_0x10e976['hasOwnProperty'](_0x383f99[_0x54754e][_0x14d1('0x69')])){_0x10e976[_0x383f99[_0x54754e][_0x14d1('0x69')]]=needsEncapsulation(_0x383f99[_0x54754e][_0x14d1('0x6a')])?encapsulate(_0x383f99[_0x54754e][_0x14d1('0x6a')]):_0x383f99[_0x54754e]['question'];}}var _0x5d0f8d=[],_0x5a8e9b={};for(var _0x22d581=0x0,_0x3dceb6=_0x127646[_0x14d1('0x37')];_0x22d581<_0x3dceb6;_0x22d581++){_0x5a8e9b={'ProjectId':_0x508d3f[_0x14d1('0x46')]['id'],'SessionId':_0x127646[_0x22d581]['id'],'StartTime':moment(_0x127646[_0x22d581]['starttime'])[_0x14d1('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x28cf3e=0x0,_0x216e39=_0x383f99[_0x14d1('0x37')];_0x28cf3e<_0x216e39;_0x28cf3e++){if(_0x383f99[_0x28cf3e]['SessionId']==_0x127646[_0x22d581]['id']&&_0x10e976[_0x14d1('0x38')](_0x383f99[_0x28cf3e][_0x14d1('0x69')])){_0x5a8e9b[_0x10e976[_0x383f99[_0x28cf3e][_0x14d1('0x69')]]]=_0x383f99[_0x28cf3e][_0x14d1('0x6c')];}}for(var _0x1b4902 in _0x10e976){if(!_0x5a8e9b[_0x14d1('0x38')](_0x10e976[_0x1b4902])){_0x5a8e9b[_0x10e976[_0x1b4902]]=null;}}_0x5d0f8d[_0x14d1('0x6d')](_0x5a8e9b);}return _0x5d0f8d;}})[_0x14d1('0x25')](function(_0x5b29cf){if(!_[_0x14d1('0x6e')](_0x5b29cf)){var _0x139efd=toCsv(_0x5b29cf);var _0x57e763=Date[_0x14d1('0x6f')]();fs[_0x14d1('0x70')](util[_0x14d1('0x6b')](_0x14d1('0x71'),_0x508d3f['params']['id'],_0x57e763),_0x139efd);_0x29fc57[_0x14d1('0x72')](_0x14d1('0x73'),_0x14d1('0x74')+util[_0x14d1('0x6b')](_0x14d1('0x75'),_0x508d3f[_0x14d1('0x46')]['id'],_0x57e763));_0x29fc57[_0x14d1('0x72')](_0x14d1('0x76'),'text/csv');return _0x29fc57[_0x14d1('0x77')](util[_0x14d1('0x6b')](_0x14d1('0x71'),_0x508d3f[_0x14d1('0x46')]['id'],_0x57e763));}else{return _0x29fc57[_0x14d1('0x1b')](0xcc);}})[_0x14d1('0x44')](handleError(_0x29fc57,null));}; \ No newline at end of file +var _0xa282=['starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','JscriptyProject','include','findAll','rows','catch','params','keys','fields','includeAll','find','create','body','user','role','UserProfileSection','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','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','questionId','question'];(function(_0x1cd577,_0x180f2a){var _0x790837=function(_0x2cace5){while(--_0x2cace5){_0x1cd577['push'](_0x1cd577['shift']());}};_0x790837(++_0x180f2a);}(_0xa282,0x189));var _0x2a28=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xa282[_0x11005e];return _0x29338f;};'use strict';var emlformat=require(_0x2a28('0x0'));var rimraf=require(_0x2a28('0x1'));var zipdir=require(_0x2a28('0x2'));var jsonpatch=require(_0x2a28('0x3'));var rp=require(_0x2a28('0x4'));var moment=require(_0x2a28('0x5'));var BPromise=require(_0x2a28('0x6'));var Mustache=require(_0x2a28('0x7'));var util=require(_0x2a28('0x8'));var path=require(_0x2a28('0x9'));var sox=require(_0x2a28('0xa'));var csv=require(_0x2a28('0xb'));var ejs=require(_0x2a28('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2a28('0xd'));var crypto=require(_0x2a28('0xe'));var jsforce=require(_0x2a28('0xf'));var deskjs=require(_0x2a28('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2a28('0x11'));var Papa=require(_0x2a28('0x12'));var Redis=require(_0x2a28('0x13'));var authService=require(_0x2a28('0x14'));var qs=require(_0x2a28('0x15'));var as=require(_0x2a28('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a28('0x17'))('api');var utils=require(_0x2a28('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2a28('0x19'));var db=require(_0x2a28('0x1a'))['db'];function respondWithStatusCode(_0x1e7640,_0x15d6a2){_0x15d6a2=_0x15d6a2||0xcc;return function(_0x7b5ca){if(_0x7b5ca){return _0x1e7640[_0x2a28('0x1b')](_0x15d6a2);}return _0x1e7640[_0x2a28('0x1c')](_0x15d6a2)['end']();};}function respondWithResult(_0x387ddc,_0x7ffb41){_0x7ffb41=_0x7ffb41||0xc8;return function(_0x328e83){if(_0x328e83){return _0x387ddc[_0x2a28('0x1c')](_0x7ffb41)[_0x2a28('0x1d')](_0x328e83);}};}function respondWithFilteredResult(_0x48ed07,_0x388753){return function(_0x18cb8e){if(_0x18cb8e){var _0x5e6294=typeof _0x388753[_0x2a28('0x1e')]===_0x2a28('0x1f')&&typeof _0x388753[_0x2a28('0x20')]==='undefined';var _0x23eed5=_0x18cb8e[_0x2a28('0x21')];var _0x2c27f9=_0x5e6294?0x0:_0x388753[_0x2a28('0x1e')];var _0x1ee433=_0x5e6294?_0x18cb8e[_0x2a28('0x21')]:_0x388753[_0x2a28('0x1e')]+_0x388753[_0x2a28('0x20')];var _0x1d1559;if(_0x1ee433>=_0x23eed5){_0x1ee433=_0x23eed5;_0x1d1559=0xc8;}else{_0x1d1559=0xce;}_0x48ed07[_0x2a28('0x1c')](_0x1d1559);return _0x48ed07[_0x2a28('0x22')](_0x2a28('0x23'),_0x2c27f9+'-'+_0x1ee433+'/'+_0x23eed5)[_0x2a28('0x1d')](_0x18cb8e);}return null;};}function patchUpdates(_0x38f256){return function(_0x5916a1){try{jsonpatch[_0x2a28('0x24')](_0x5916a1,_0x38f256,!![]);}catch(_0x2f1344){return BPromise[_0x2a28('0x25')](_0x2f1344);}return _0x5916a1[_0x2a28('0x26')]();};}function saveUpdates(_0x598c44,_0x2055f6){return function(_0xa9610e){if(_0xa9610e){return _0xa9610e[_0x2a28('0x27')](_0x598c44)[_0x2a28('0x28')](function(_0xae2ae1){return _0xae2ae1;});}return null;};}function removeEntity(_0x3c8eba,_0x20ca1c){return function(_0x251f8d){if(_0x251f8d){return _0x251f8d[_0x2a28('0x29')]()[_0x2a28('0x28')](function(){var _0x259ad5=_0x251f8d[_0x2a28('0x2a')]({'plain':!![]});var _0x7e7d99=_0x2a28('0x2b');return db[_0x2a28('0x2c')][_0x2a28('0x29')]({'where':{'type':_0x7e7d99,'resourceId':_0x259ad5['id']}})['then'](function(){return _0x251f8d;});})[_0x2a28('0x28')](function(){_0x3c8eba[_0x2a28('0x1c')](0xcc)[_0x2a28('0x2d')]();});}};}function handleEntityNotFound(_0x4ed138,_0x4ac77d){return function(_0xfb2848){if(!_0xfb2848){_0x4ed138[_0x2a28('0x1b')](0x194);}return _0xfb2848;};}function handleError(_0x3e4f52,_0x472b30){_0x472b30=_0x472b30||0x1f4;return function(_0x406d3e){logger['error'](_0x406d3e[_0x2a28('0x2e')]);if(_0x406d3e[_0x2a28('0x2f')]){delete _0x406d3e[_0x2a28('0x2f')];}_0x3e4f52[_0x2a28('0x1c')](_0x472b30)[_0x2a28('0x30')](_0x406d3e);};}exports[_0x2a28('0x31')]=function(_0x2c51e0,_0x5124a8){var _0x3358e2={},_0x2e2ada={},_0x173f3f={'count':0x0,'rows':[]};var _0x5ed633=_[_0x2a28('0x32')](db['JscriptyProject'][_0x2a28('0x33')],function(_0x20d3b8){return{'name':_0x20d3b8[_0x2a28('0x34')],'type':_0x20d3b8[_0x2a28('0x35')][_0x2a28('0x36')]};});_0x2e2ada[_0x2a28('0x37')]=_[_0x2a28('0x32')](_0x5ed633,_0x2a28('0x2f'));_0x2e2ada['query']=_['keys'](_0x2c51e0[_0x2a28('0x38')]);_0x2e2ada['filters']=_[_0x2a28('0x39')](_0x2e2ada['model'],_0x2e2ada[_0x2a28('0x38')]);_0x3358e2[_0x2a28('0x3a')]=_[_0x2a28('0x39')](_0x2e2ada[_0x2a28('0x37')],qs['fields'](_0x2c51e0[_0x2a28('0x38')]['fields']));_0x3358e2[_0x2a28('0x3a')]=_0x3358e2[_0x2a28('0x3a')][_0x2a28('0x3b')]?_0x3358e2['attributes']:_0x2e2ada[_0x2a28('0x37')];if(!_0x2c51e0[_0x2a28('0x38')][_0x2a28('0x3c')](_0x2a28('0x3d'))){_0x3358e2[_0x2a28('0x20')]=qs[_0x2a28('0x20')](_0x2c51e0[_0x2a28('0x38')][_0x2a28('0x20')]);_0x3358e2[_0x2a28('0x1e')]=qs[_0x2a28('0x1e')](_0x2c51e0['query'][_0x2a28('0x1e')]);}_0x3358e2[_0x2a28('0x3e')]=qs[_0x2a28('0x3f')](_0x2c51e0[_0x2a28('0x38')][_0x2a28('0x3f')]);_0x3358e2[_0x2a28('0x40')]=qs[_0x2a28('0x41')](_[_0x2a28('0x42')](_0x2c51e0['query'],_0x2e2ada[_0x2a28('0x41')]),_0x5ed633);if(_0x2c51e0[_0x2a28('0x38')][_0x2a28('0x43')]){_0x3358e2['where']=_[_0x2a28('0x44')](_0x3358e2[_0x2a28('0x40')],{'$or':_['map'](_0x5ed633,function(_0x536c07){if(_0x536c07['type']!=='VIRTUAL'){var _0x15ac19={};_0x15ac19[_0x536c07[_0x2a28('0x2f')]]={'$like':'%'+_0x2c51e0[_0x2a28('0x38')][_0x2a28('0x43')]+'%'};return _0x15ac19;}})});}_0x3358e2=_[_0x2a28('0x44')]({},_0x3358e2,_0x2c51e0[_0x2a28('0x45')]);var _0x5c9150={'where':_0x3358e2[_0x2a28('0x40')]};return db[_0x2a28('0x46')][_0x2a28('0x21')](_0x5c9150)[_0x2a28('0x28')](function(_0x4f7dc6){_0x173f3f[_0x2a28('0x21')]=_0x4f7dc6;if(_0x2c51e0[_0x2a28('0x38')]['includeAll']){_0x3358e2[_0x2a28('0x47')]=[{'all':!![]}];}return db['JscriptyProject'][_0x2a28('0x48')](_0x3358e2);})[_0x2a28('0x28')](function(_0x26f594){_0x173f3f[_0x2a28('0x49')]=_0x26f594;return _0x173f3f;})[_0x2a28('0x28')](respondWithFilteredResult(_0x5124a8,_0x3358e2))[_0x2a28('0x4a')](handleError(_0x5124a8,null));};exports['show']=function(_0x59df92,_0x26e03d){var _0x450a37={'raw':![],'where':{'id':_0x59df92[_0x2a28('0x4b')]['id']}},_0x59fafd={};_0x59fafd[_0x2a28('0x37')]=_[_0x2a28('0x4c')](db['JscriptyProject'][_0x2a28('0x33')]);_0x59fafd[_0x2a28('0x38')]=_[_0x2a28('0x4c')](_0x59df92['query']);_0x59fafd[_0x2a28('0x41')]=_[_0x2a28('0x39')](_0x59fafd[_0x2a28('0x37')],_0x59fafd[_0x2a28('0x38')]);_0x450a37[_0x2a28('0x3a')]=_[_0x2a28('0x39')](_0x59fafd[_0x2a28('0x37')],qs[_0x2a28('0x4d')](_0x59df92[_0x2a28('0x38')][_0x2a28('0x4d')]));_0x450a37[_0x2a28('0x3a')]=_0x450a37['attributes'][_0x2a28('0x3b')]?_0x450a37[_0x2a28('0x3a')]:_0x59fafd[_0x2a28('0x37')];if(_0x59df92[_0x2a28('0x38')][_0x2a28('0x4e')]){_0x450a37['include']=[{'all':!![]}];}_0x450a37=_[_0x2a28('0x44')]({},_0x450a37,_0x59df92[_0x2a28('0x45')]);return db[_0x2a28('0x46')][_0x2a28('0x4f')](_0x450a37)[_0x2a28('0x28')](handleEntityNotFound(_0x26e03d,null))['then'](respondWithResult(_0x26e03d,null))[_0x2a28('0x4a')](handleError(_0x26e03d,null));};exports['create']=function(_0x5e9588,_0x5e4f97){return db[_0x2a28('0x46')][_0x2a28('0x50')](_0x5e9588[_0x2a28('0x51')],{})[_0x2a28('0x28')](function(_0xab37d1){var _0x91ff51=_0x5e9588[_0x2a28('0x52')][_0x2a28('0x2a')]({'plain':!![]});if(!_0x91ff51)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x91ff51[_0x2a28('0x53')]===_0x2a28('0x52')){var _0x2b15e7=_0xab37d1[_0x2a28('0x2a')]({'plain':!![]});var _0x53459b='Projects';return db[_0x2a28('0x54')]['find']({'where':{'name':_0x53459b,'userProfileId':_0x91ff51['userProfileId']},'raw':!![]})[_0x2a28('0x28')](function(_0x3ba2dd){if(_0x3ba2dd&&_0x3ba2dd[_0x2a28('0x55')]===0x0){return db['UserProfileResource'][_0x2a28('0x50')]({'name':_0x2b15e7[_0x2a28('0x2f')],'resourceId':_0x2b15e7['id'],'type':_0x3ba2dd['name'],'sectionId':_0x3ba2dd['id']},{})[_0x2a28('0x28')](function(){return _0xab37d1;});}else{return _0xab37d1;}})[_0x2a28('0x4a')](function(_0x2ca731){logger[_0x2a28('0x56')](_0x2a28('0x57'),_0x2ca731);throw _0x2ca731;});}return _0xab37d1;})['then'](respondWithResult(_0x5e4f97,0xc9))[_0x2a28('0x4a')](handleError(_0x5e4f97,null));};exports[_0x2a28('0x58')]=function(_0x5ecd54,_0x3b52cb){var _0x2f0714={'where':{'id':_0x5ecd54['params']['id']}},_0x4bad86={};_0x4bad86[_0x2a28('0x37')]=_[_0x2a28('0x4c')](db[_0x2a28('0x46')][_0x2a28('0x33')]);_0x2f0714[_0x2a28('0x3a')]=_[_0x2a28('0x39')](_0x4bad86[_0x2a28('0x37')],qs[_0x2a28('0x4d')](_0x5ecd54[_0x2a28('0x38')][_0x2a28('0x4d')]));_0x2f0714[_0x2a28('0x3a')]=_0x2f0714[_0x2a28('0x3a')][_0x2a28('0x3b')]?_0x2f0714[_0x2a28('0x3a')]:_0x4bad86['model'];if(_0x5ecd54['query'][_0x2a28('0x4e')]){_0x2f0714[_0x2a28('0x47')]=[{'all':!![]}];}_0x2f0714=_[_0x2a28('0x44')]({},_0x2f0714,_0x5ecd54[_0x2a28('0x45')]);return db[_0x2a28('0x46')][_0x2a28('0x4f')](_0x2f0714)['then'](handleEntityNotFound(_0x3b52cb,null))['then'](function(_0x3e834f){if(_0x3e834f){var _0x1083d1=_0x3e834f[_0x2a28('0x2a')]({'plain':!![]});_0x1083d1=qs[_0x2a28('0x59')](_0x1083d1,['id',_0x2a28('0x5a'),_0x2a28('0x5b')]);_0x5ecd54[_0x2a28('0x51')]=_[_0x2a28('0x59')](_0x5ecd54[_0x2a28('0x51')],['id','createdAt',_0x2a28('0x5b')]);return db[_0x2a28('0x46')]['create'](_['merge'](_0x1083d1,_0x5ecd54['body']),{'include':_0x5ecd54[_0x2a28('0x38')]['includeAll']?[{'all':!![]}]:undefined})[_0x2a28('0x28')](function(_0x163fca){var _0x4d8078=_0x5ecd54[_0x2a28('0x52')][_0x2a28('0x2a')]({'plain':!![]});if(!_0x4d8078)throw new Error(_0x2a28('0x5c'));if(_0x4d8078[_0x2a28('0x53')]===_0x2a28('0x52')){var _0x220879=_0x163fca[_0x2a28('0x2a')]({'plain':!![]});var _0x2036a1='Projects';return db['UserProfileSection'][_0x2a28('0x4f')]({'where':{'name':_0x2036a1,'userProfileId':_0x4d8078[_0x2a28('0x5d')]},'raw':!![]})[_0x2a28('0x28')](function(_0xec0b62){if(_0xec0b62&&_0xec0b62['autoAssociation']===0x0){return db[_0x2a28('0x2c')][_0x2a28('0x50')]({'name':_0x220879[_0x2a28('0x2f')],'resourceId':_0x220879['id'],'type':_0xec0b62[_0x2a28('0x2f')],'sectionId':_0xec0b62['id']},{})[_0x2a28('0x28')](function(){return _0x163fca;});}else{return _0x163fca;}})[_0x2a28('0x4a')](function(_0x2499bc){logger[_0x2a28('0x56')](_0x2a28('0x57'),_0x2499bc);throw _0x2499bc;});}return _0x163fca;});}})[_0x2a28('0x28')](respondWithResult(_0x3b52cb,0xc9))[_0x2a28('0x4a')](handleError(_0x3b52cb,null));};exports[_0x2a28('0x27')]=function(_0x543592,_0x17a32a){if(_0x543592[_0x2a28('0x51')]['id']){delete _0x543592[_0x2a28('0x51')]['id'];}return db[_0x2a28('0x46')][_0x2a28('0x4f')]({'where':{'id':_0x543592[_0x2a28('0x4b')]['id']}})[_0x2a28('0x28')](handleEntityNotFound(_0x17a32a,null))[_0x2a28('0x28')](saveUpdates(_0x543592[_0x2a28('0x51')],null))[_0x2a28('0x28')](respondWithResult(_0x17a32a,null))['catch'](handleError(_0x17a32a,null));};exports[_0x2a28('0x29')]=function(_0x1dd2fb,_0x25626d){return db['JscriptyProject']['find']({'where':{'id':_0x1dd2fb[_0x2a28('0x4b')]['id']}})[_0x2a28('0x28')](handleEntityNotFound(_0x25626d,null))[_0x2a28('0x28')](removeEntity(_0x25626d,null))[_0x2a28('0x4a')](handleError(_0x25626d,null));};exports[_0x2a28('0x5e')]=function(_0x2c020a,_0x5ad7cc,_0x2b9a13){var _0x94ba25={'raw':!![],'where':{}};var _0x376a30={};var _0x20efbd={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x2a28('0x5f')]({'where':{'id':_0x2c020a[_0x2a28('0x4b')]['id']}})[_0x2a28('0x28')](handleEntityNotFound(_0x5ad7cc,null))[_0x2a28('0x28')](function(_0x3b7952){if(_0x3b7952){_0x376a30[_0x2a28('0x37')]=_[_0x2a28('0x4c')](db['JscriptySessionReport'][_0x2a28('0x33')]);_0x376a30[_0x2a28('0x38')]=_[_0x2a28('0x4c')](_0x2c020a[_0x2a28('0x38')]);_0x376a30['filters']=_[_0x2a28('0x39')](_0x376a30[_0x2a28('0x37')],_0x376a30[_0x2a28('0x38')]);_0x94ba25[_0x2a28('0x3a')]=_[_0x2a28('0x39')](_0x376a30['model'],qs[_0x2a28('0x4d')](_0x2c020a[_0x2a28('0x38')][_0x2a28('0x4d')]));_0x94ba25[_0x2a28('0x3a')]=_0x94ba25['attributes']['length']?_0x94ba25['attributes']:_0x376a30[_0x2a28('0x37')];if(!_0x2c020a[_0x2a28('0x38')][_0x2a28('0x3c')](_0x2a28('0x3d'))){_0x94ba25['limit']=qs['limit'](_0x2c020a[_0x2a28('0x38')][_0x2a28('0x20')]);_0x94ba25[_0x2a28('0x1e')]=qs[_0x2a28('0x1e')](_0x2c020a[_0x2a28('0x38')]['offset']);}_0x94ba25[_0x2a28('0x3e')]=qs[_0x2a28('0x3f')](_0x2c020a['query']['sort']);_0x94ba25[_0x2a28('0x40')]=qs['filters'](_[_0x2a28('0x42')](_0x2c020a[_0x2a28('0x38')],_0x376a30['filters']));_0x94ba25['where'][_0x2a28('0x60')]=_0x3b7952['id'];if(_0x2c020a[_0x2a28('0x38')][_0x2a28('0x43')]){_0x94ba25['where']=_['merge'](_0x94ba25['where'],{'$or':_['map'](_0x94ba25[_0x2a28('0x3a')],function(_0x590de6){var _0x4ae77a={};_0x4ae77a[_0x590de6]={'$like':'%'+_0x2c020a[_0x2a28('0x38')][_0x2a28('0x43')]+'%'};return _0x4ae77a;})});}_0x94ba25=_[_0x2a28('0x44')]({},_0x94ba25,_0x2c020a[_0x2a28('0x45')]);return db['JscriptySessionReport'][_0x2a28('0x21')]({'where':_0x94ba25[_0x2a28('0x40')]})[_0x2a28('0x28')](function(_0x182677){_0x20efbd[_0x2a28('0x21')]=_0x182677;if(_0x2c020a[_0x2a28('0x38')]['includeAll']){_0x94ba25['include']=[{'all':!![]}];}return db[_0x2a28('0x61')]['findAll'](_0x94ba25);})['then'](function(_0x4523aa){_0x20efbd['rows']=_0x4523aa;return _0x20efbd;});}})[_0x2a28('0x28')](respondWithFilteredResult(_0x5ad7cc,_0x94ba25))[_0x2a28('0x4a')](handleError(_0x5ad7cc,null));};exports[_0x2a28('0x62')]=function(_0x2178f6,_0xaa4a5f,_0x32c9ac){var _0x52dba0={'raw':!![],'where':{}};var _0x413ed5={};var _0x3ebf72={'count':0x0,'rows':[]};return db[_0x2a28('0x46')][_0x2a28('0x5f')]({'where':{'id':_0x2178f6[_0x2a28('0x4b')]['id']}})['then'](handleEntityNotFound(_0xaa4a5f,null))[_0x2a28('0x28')](function(_0x4d2a56){if(_0x4d2a56){_0x413ed5[_0x2a28('0x37')]=_['keys'](db[_0x2a28('0x63')]['rawAttributes']);_0x413ed5['query']=_[_0x2a28('0x4c')](_0x2178f6['query']);_0x413ed5[_0x2a28('0x41')]=_[_0x2a28('0x39')](_0x413ed5[_0x2a28('0x37')],_0x413ed5['query']);_0x52dba0[_0x2a28('0x3a')]=_[_0x2a28('0x39')](_0x413ed5[_0x2a28('0x37')],qs[_0x2a28('0x4d')](_0x2178f6[_0x2a28('0x38')][_0x2a28('0x4d')]));_0x52dba0[_0x2a28('0x3a')]=_0x52dba0[_0x2a28('0x3a')][_0x2a28('0x3b')]?_0x52dba0[_0x2a28('0x3a')]:_0x413ed5[_0x2a28('0x37')];if(!_0x2178f6[_0x2a28('0x38')]['hasOwnProperty']('nolimit')){_0x52dba0[_0x2a28('0x20')]=qs[_0x2a28('0x20')](_0x2178f6[_0x2a28('0x38')][_0x2a28('0x20')]);_0x52dba0[_0x2a28('0x1e')]=qs[_0x2a28('0x1e')](_0x2178f6['query'][_0x2a28('0x1e')]);}_0x52dba0[_0x2a28('0x3e')]=qs['sort'](_0x2178f6[_0x2a28('0x38')][_0x2a28('0x3f')]);_0x52dba0[_0x2a28('0x40')]=qs['filters'](_[_0x2a28('0x42')](_0x2178f6[_0x2a28('0x38')],_0x413ed5[_0x2a28('0x41')]));_0x52dba0['where'][_0x2a28('0x60')]=_0x4d2a56['id'];if(_0x2178f6['query'][_0x2a28('0x43')]){_0x52dba0[_0x2a28('0x40')]=_[_0x2a28('0x44')](_0x52dba0[_0x2a28('0x40')],{'$or':_[_0x2a28('0x32')](_0x52dba0['attributes'],function(_0x278bcf){var _0x3fa352={};_0x3fa352[_0x278bcf]={'$like':'%'+_0x2178f6[_0x2a28('0x38')][_0x2a28('0x43')]+'%'};return _0x3fa352;})});}_0x52dba0=_[_0x2a28('0x44')]({},_0x52dba0,_0x2178f6[_0x2a28('0x45')]);return db[_0x2a28('0x63')][_0x2a28('0x21')]({'where':_0x52dba0[_0x2a28('0x40')]})[_0x2a28('0x28')](function(_0x3660d6){_0x3ebf72[_0x2a28('0x21')]=_0x3660d6;if(_0x2178f6['query']['includeAll']){_0x52dba0[_0x2a28('0x47')]=[{'all':!![]}];}return db[_0x2a28('0x63')][_0x2a28('0x48')](_0x52dba0);})[_0x2a28('0x28')](function(_0x15f493){_0x3ebf72[_0x2a28('0x49')]=_0x15f493;return _0x3ebf72;});}})[_0x2a28('0x28')](respondWithFilteredResult(_0xaa4a5f,_0x52dba0))[_0x2a28('0x4a')](handleError(_0xaa4a5f,null));};function char(_0x458d5c){return _0x2a28('0x64')===typeof _0x458d5c?String[_0x2a28('0x65')][_0x2a28('0x24')](null,arguments):_0x458d5c;}function needsEncapsulation(_0x4c83fe){return!!_0x4c83fe&&(_0x4c83fe[_0x2a28('0x66')]()[_0x2a28('0x67')](char(0xd))>=0x0||_0x4c83fe[_0x2a28('0x66')]()['indexOf'](char(0xa))>=0x0||_0x4c83fe['toString']()[_0x2a28('0x67')](char(0x2c))>=0x0||_0x4c83fe[_0x2a28('0x66')]()[_0x2a28('0x67')](char(0x22))>=0x0);}function encapsulate(_0x7d021a){var _0x352a21=char(0x22),_0xa3e6ae='\x5c'+char(0x22),_0x5aa884=_0x7d021a[_0x2a28('0x66')]()[_0x2a28('0x68')](new RegExp(_0x352a21,'g'),_0xa3e6ae);return _0x352a21+_0x5aa884+_0x352a21;}exports[_0x2a28('0x69')]=function(_0x40098c,_0xaa9567,_0x59ba10){var _0x2baa13,_0x45b06d;var _0x5ef217={'where':{'ProjectId':_0x40098c[_0x2a28('0x4b')]['id']}};if(_0x40098c[_0x2a28('0x38')][_0x2a28('0x6a')]){_0x5ef217[_0x2a28('0x40')]['starttime']=JSON[_0x2a28('0x6b')](_0x40098c[_0x2a28('0x38')][_0x2a28('0x6a')]);}return db[_0x2a28('0x61')]['findAll'](_0x5ef217)['then'](handleEntityNotFound(_0xaa9567,null))[_0x2a28('0x28')](function(_0x327a1e){if(_0x327a1e){_0x2baa13=_0x327a1e;return db[_0x2a28('0x6c')][_0x2a28('0x48')]({'where':{'SessionId':{'$in':_[_0x2a28('0x32')](_0x2baa13,'id')},'ProjectId':_0x40098c[_0x2a28('0x4b')]['id']},'order':'-createdAt'});}})[_0x2a28('0x28')](handleEntityNotFound(_0xaa9567,null))[_0x2a28('0x28')](function(_0x4021be){if(_0x4021be){_0x45b06d=_0x4021be;var _0x52ab09={};for(var _0x1c46a9=0x0,_0x56c688=_0x45b06d['length'];_0x1c46a9<_0x56c688;_0x1c46a9++){if(!_0x52ab09[_0x2a28('0x3c')](_0x45b06d[_0x1c46a9][_0x2a28('0x6d')])){_0x52ab09[_0x45b06d[_0x1c46a9][_0x2a28('0x6d')]]=needsEncapsulation(_0x45b06d[_0x1c46a9]['question'])?encapsulate(_0x45b06d[_0x1c46a9][_0x2a28('0x6e')]):_0x45b06d[_0x1c46a9][_0x2a28('0x6e')];}}var _0x1c636b=[],_0x456d70={};for(var _0x621afd=0x0,_0x1e3159=_0x2baa13[_0x2a28('0x3b')];_0x621afd<_0x1e3159;_0x621afd++){_0x456d70={'ProjectId':_0x40098c[_0x2a28('0x4b')]['id'],'SessionId':_0x2baa13[_0x621afd]['id'],'StartTime':moment(_0x2baa13[_0x621afd][_0x2a28('0x6f')])[_0x2a28('0x70')](_0x2a28('0x71'))};for(var _0x262c69=0x0,_0x199577=_0x45b06d[_0x2a28('0x3b')];_0x262c69<_0x199577;_0x262c69++){if(_0x45b06d[_0x262c69][_0x2a28('0x72')]==_0x2baa13[_0x621afd]['id']&&_0x52ab09[_0x2a28('0x3c')](_0x45b06d[_0x262c69][_0x2a28('0x6d')])){_0x456d70[_0x52ab09[_0x45b06d[_0x262c69][_0x2a28('0x6d')]]]=_0x45b06d[_0x262c69][_0x2a28('0x73')];}}for(var _0x87ab93 in _0x52ab09){if(!_0x456d70['hasOwnProperty'](_0x52ab09[_0x87ab93])){_0x456d70[_0x52ab09[_0x87ab93]]=null;}}_0x1c636b[_0x2a28('0x74')](_0x456d70);}return _0x1c636b;}})[_0x2a28('0x28')](function(_0x19df98){if(!_['isEmpty'](_0x19df98)){var _0x185079=toCsv(_0x19df98);var _0x3b21b8=Date[_0x2a28('0x75')]();fs[_0x2a28('0x76')](util[_0x2a28('0x70')](_0x2a28('0x77'),_0x40098c[_0x2a28('0x4b')]['id'],_0x3b21b8),_0x185079);_0xaa9567['setHeader'](_0x2a28('0x78'),_0x2a28('0x79')+util[_0x2a28('0x70')](_0x2a28('0x7a'),_0x40098c['params']['id'],_0x3b21b8));_0xaa9567['setHeader'](_0x2a28('0x7b'),_0x2a28('0x7c'));return _0xaa9567[_0x2a28('0x7d')](util['format'](_0x2a28('0x77'),_0x40098c[_0x2a28('0x4b')]['id'],_0x3b21b8));}else{return _0xaa9567[_0x2a28('0x1b')](0xcc);}})[_0x2a28('0x4a')](handleError(_0xaa9567,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 4bbc8fd..e7161e8 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 _0xa7e6=['exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyProject.attributes'];(function(_0x35b332,_0x35573a){var _0x55d31b=function(_0x376882){while(--_0x376882){_0x35b332['push'](_0x35b332['shift']());}};_0x55d31b(++_0x35573a);}(_0xa7e6,0x74));var _0x6a7e=function(_0x3c498f,_0x1a9eef){_0x3c498f=_0x3c498f-0x0;var _0x2104b8=_0xa7e6[_0x3c498f];return _0x2104b8;};'use strict';var _=require(_0x6a7e('0x0'));var util=require(_0x6a7e('0x1'));var logger=require(_0x6a7e('0x2'))(_0x6a7e('0x3'));var moment=require(_0x6a7e('0x4'));var BPromise=require(_0x6a7e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a7e('0x6'));var rimraf=require(_0x6a7e('0x7'));var config=require(_0x6a7e('0x8'));var attributes=require(_0x6a7e('0x9'));module[_0x6a7e('0xa')]=function(_0x599006,_0x79df6f){return _0x599006[_0x6a7e('0xb')](_0x6a7e('0xc'),attributes,{'tableName':_0x6a7e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc627=['./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1be5a6,_0x50dff7){var _0x1c3173=function(_0x3091e5){while(--_0x3091e5){_0x1be5a6['push'](_0x1be5a6['shift']());}};_0x1c3173(++_0x50dff7);}(_0xc627,0x14a));var _0x7c62=function(_0xd02716,_0x286314){_0xd02716=_0xd02716-0x0;var _0x3a5d5b=_0xc627[_0xd02716];return _0x3a5d5b;};'use strict';var _=require('lodash');var util=require(_0x7c62('0x0'));var logger=require(_0x7c62('0x1'))(_0x7c62('0x2'));var moment=require('moment');var BPromise=require(_0x7c62('0x3'));var rp=require(_0x7c62('0x4'));var fs=require('fs');var path=require(_0x7c62('0x5'));var rimraf=require(_0x7c62('0x6'));var config=require(_0x7c62('0x7'));var attributes=require(_0x7c62('0x8'));module[_0x7c62('0x9')]=function(_0x448f4b,_0x25a5c8){return _0x448f4b[_0x7c62('0xa')](_0x7c62('0xb'),attributes,{'tableName':_0x7c62('0xc'),'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 0ca5ea9..f176c42 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0xa31058,_0x37cca1){var _0x335d3e=function(_0x4a5513){while(--_0x4a5513){_0xa31058['push'](_0xa31058['shift']());}};_0x335d3e(++_0x37cca1);}(_0xb43b,0x1b2));var _0xbb43=function(_0x39464b,_0x5b2127){_0x39464b=_0x39464b-0x0;var _0x135a47=_0xb43b[_0x39464b];return _0x135a47;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x2c0fe5,_0x5ca8d1){var _0x3cea69=function(_0x5e5aea){while(--_0x5e5aea){_0x2c0fe5['push'](_0x2c0fe5['shift']());}};_0x3cea69(++_0x5ca8d1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x10c51f,_0x11270f){_0x10c51f=_0x10c51f-0x0;var _0x56a0cd=_0xcb91[_0x10c51f];return _0x56a0cd;};'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')]('JscriptyProject,\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 diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 04bfaa7..384d561 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 _0xf79e=['/:id','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','show','post','create'];(function(_0x487e1f,_0x414b10){var _0x2a9f9e=function(_0x4f7035){while(--_0x4f7035){_0x487e1f['push'](_0x487e1f['shift']());}};_0x2a9f9e(++_0x414b10);}(_0xf79e,0x1bc));var _0xef79=function(_0x59f7e4,_0x2bf748){_0x59f7e4=_0x59f7e4-0x0;var _0x16af8d=_0xf79e[_0x59f7e4];return _0x16af8d;};'use strict';var multer=require(_0xef79('0x0'));var util=require('util');var path=require(_0xef79('0x1'));var timeout=require(_0xef79('0x2'));var express=require(_0xef79('0x3'));var router=express['Router']();var fs_extra=require(_0xef79('0x4'));var auth=require(_0xef79('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xef79('0x6'));var controller=require(_0xef79('0x7'));router[_0xef79('0x8')]('/',auth[_0xef79('0x9')](),controller[_0xef79('0xa')]);router[_0xef79('0x8')]('/describe',auth[_0xef79('0x9')](),controller[_0xef79('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xef79('0xc')]);router[_0xef79('0xd')]('/',auth[_0xef79('0x9')](),controller[_0xef79('0xe')]);router['put'](_0xef79('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xef79('0xf'),auth[_0xef79('0x9')](),controller['destroy']);module[_0xef79('0x10')]=router; \ No newline at end of file +var _0xff6a=['index','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xff6a,0x184));var _0xaff6=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xff6a[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require(_0xaff6('0x0'));var util=require(_0xaff6('0x1'));var path=require(_0xaff6('0x2'));var timeout=require(_0xaff6('0x3'));var express=require(_0xaff6('0x4'));var router=express[_0xaff6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xaff6('0x6'));var interaction=require(_0xaff6('0x7'));var config=require(_0xaff6('0x8'));var controller=require(_0xaff6('0x9'));router[_0xaff6('0xa')]('/',auth[_0xaff6('0xb')](),controller[_0xaff6('0xc')]);router[_0xaff6('0xa')]('/describe',auth[_0xaff6('0xb')](),controller['describe']);router[_0xaff6('0xa')](_0xaff6('0xd'),auth[_0xaff6('0xb')](),controller[_0xaff6('0xe')]);router[_0xaff6('0xf')]('/',auth[_0xaff6('0xb')](),controller['create']);router[_0xaff6('0x10')]('/:id',auth[_0xaff6('0xb')](),controller['update']);router[_0xaff6('0x11')](_0xaff6('0xd'),auth[_0xaff6('0xb')](),controller[_0xaff6('0x12')]);module[_0xaff6('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index efedf13..e7d5cb0 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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x7a54,0x106));var _0x47a5=function(_0x5ab66a,_0x22a4c2){_0x5ab66a=_0x5ab66a-0x0;var _0x7f3028=_0x7a54[_0x5ab66a];return _0x7f3028;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x2b529f,_0x31f315){_0x2b529f=_0x2b529f-0x0;var _0x14b754=_0x7a54[_0x2b529f];return _0x14b754;};'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 87ddeea..4c590a0 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 _0x2f04=['api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5e8460,_0x2003b5){var _0x3d50fd=function(_0x4c499f){while(--_0x4c499f){_0x5e8460['push'](_0x5e8460['shift']());}};_0x3d50fd(++_0x2003b5);}(_0x2f04,0x80));var _0x42f0=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x2f04[_0x599f41];return _0x2e4d58;};'use strict';var emlformat=require(_0x42f0('0x0'));var rimraf=require(_0x42f0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x42f0('0x2'));var rp=require(_0x42f0('0x3'));var moment=require(_0x42f0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x42f0('0x5'));var util=require(_0x42f0('0x6'));var path=require(_0x42f0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x42f0('0x8'));var squel=require(_0x42f0('0x9'));var crypto=require(_0x42f0('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x42f0('0xb'));var toCsv=require(_0x42f0('0xc'));var querystring=require(_0x42f0('0xd'));var Papa=require(_0x42f0('0xe'));var Redis=require('ioredis');var authService=require(_0x42f0('0xf'));var qs=require(_0x42f0('0x10'));var as=require(_0x42f0('0x11'));var hardwareService=require(_0x42f0('0x12'));var logger=require(_0x42f0('0x13'))(_0x42f0('0x14'));var utils=require(_0x42f0('0x15'));var config=require(_0x42f0('0x16'));var licenseUtil=require(_0x42f0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x379ac9,_0xea5fd5){_0xea5fd5=_0xea5fd5||0xcc;return function(_0x1a740c){if(_0x1a740c){return _0x379ac9['sendStatus'](_0xea5fd5);}return _0x379ac9['status'](_0xea5fd5)[_0x42f0('0x18')]();};}function respondWithResult(_0x5ef0e2,_0x89c9bd){_0x89c9bd=_0x89c9bd||0xc8;return function(_0x4a1dda){if(_0x4a1dda){return _0x5ef0e2[_0x42f0('0x19')](_0x89c9bd)[_0x42f0('0x1a')](_0x4a1dda);}};}function respondWithFilteredResult(_0x19e8f7,_0x59280d){return function(_0x43fc9d){if(_0x43fc9d){var _0x26db05=typeof _0x59280d[_0x42f0('0x1b')]===_0x42f0('0x1c')&&typeof _0x59280d[_0x42f0('0x1d')]===_0x42f0('0x1c');var _0x42d29d=_0x43fc9d[_0x42f0('0x1e')];var _0x39ce37=_0x26db05?0x0:_0x59280d[_0x42f0('0x1b')];var _0x1cf5ac=_0x26db05?_0x43fc9d['count']:_0x59280d[_0x42f0('0x1b')]+_0x59280d['limit'];var _0x1dbde1;if(_0x1cf5ac>=_0x42d29d){_0x1cf5ac=_0x42d29d;_0x1dbde1=0xc8;}else{_0x1dbde1=0xce;}_0x19e8f7[_0x42f0('0x19')](_0x1dbde1);return _0x19e8f7[_0x42f0('0x1f')](_0x42f0('0x20'),_0x39ce37+'-'+_0x1cf5ac+'/'+_0x42d29d)[_0x42f0('0x1a')](_0x43fc9d);}return null;};}function patchUpdates(_0x2aa603){return function(_0x9f4b36){try{jsonpatch[_0x42f0('0x21')](_0x9f4b36,_0x2aa603,!![]);}catch(_0x39f689){return BPromise[_0x42f0('0x22')](_0x39f689);}return _0x9f4b36[_0x42f0('0x23')]();};}function saveUpdates(_0x2061b7,_0x434511){return function(_0x39772d){if(_0x39772d){return _0x39772d['update'](_0x2061b7)[_0x42f0('0x24')](function(_0x312497){return _0x312497;});}return null;};}function removeEntity(_0x4fbf94,_0x1a3b2d){return function(_0x58f027){if(_0x58f027){return _0x58f027[_0x42f0('0x25')]()[_0x42f0('0x24')](function(){_0x4fbf94[_0x42f0('0x19')](0xcc)[_0x42f0('0x18')]();});}};}function handleEntityNotFound(_0x5d4b93,_0x14da49){return function(_0x27bbf3){if(!_0x27bbf3){_0x5d4b93[_0x42f0('0x26')](0x194);}return _0x27bbf3;};}function handleError(_0x5a14b2,_0x43ea8a){_0x43ea8a=_0x43ea8a||0x1f4;return function(_0x3076b9){logger['error'](_0x3076b9[_0x42f0('0x27')]);if(_0x3076b9[_0x42f0('0x28')]){delete _0x3076b9[_0x42f0('0x28')];}_0x5a14b2[_0x42f0('0x19')](_0x43ea8a)[_0x42f0('0x29')](_0x3076b9);};}exports['index']=function(_0x57b44a,_0x1b547f){var _0x473271={},_0x3b0b25={},_0x15f7c7={'count':0x0,'rows':[]};var _0x5e9556=_[_0x42f0('0x2a')](db[_0x42f0('0x2b')][_0x42f0('0x2c')],function(_0x9ce801){return{'name':_0x9ce801[_0x42f0('0x2d')],'type':_0x9ce801[_0x42f0('0x2e')][_0x42f0('0x2f')]};});_0x3b0b25[_0x42f0('0x30')]=_['map'](_0x5e9556,'name');_0x3b0b25[_0x42f0('0x31')]=_[_0x42f0('0x32')](_0x57b44a[_0x42f0('0x31')]);_0x3b0b25[_0x42f0('0x33')]=_['intersection'](_0x3b0b25[_0x42f0('0x30')],_0x3b0b25[_0x42f0('0x31')]);_0x473271[_0x42f0('0x34')]=_['intersection'](_0x3b0b25[_0x42f0('0x30')],qs[_0x42f0('0x35')](_0x57b44a['query']['fields']));_0x473271['attributes']=_0x473271[_0x42f0('0x34')][_0x42f0('0x36')]?_0x473271[_0x42f0('0x34')]:_0x3b0b25['model'];if(!_0x57b44a[_0x42f0('0x31')][_0x42f0('0x37')](_0x42f0('0x38'))){_0x473271[_0x42f0('0x1d')]=qs[_0x42f0('0x1d')](_0x57b44a[_0x42f0('0x31')][_0x42f0('0x1d')]);_0x473271[_0x42f0('0x1b')]=qs['offset'](_0x57b44a['query']['offset']);}_0x473271[_0x42f0('0x39')]=qs[_0x42f0('0x3a')](_0x57b44a[_0x42f0('0x31')][_0x42f0('0x3a')]);_0x473271[_0x42f0('0x3b')]=qs[_0x42f0('0x33')](_[_0x42f0('0x3c')](_0x57b44a[_0x42f0('0x31')],_0x3b0b25[_0x42f0('0x33')]),_0x5e9556);if(_0x57b44a[_0x42f0('0x31')][_0x42f0('0x3d')]){_0x473271[_0x42f0('0x3b')]=_[_0x42f0('0x3e')](_0x473271['where'],{'$or':_[_0x42f0('0x2a')](_0x5e9556,function(_0x793b3b){if(_0x793b3b['type']!=='VIRTUAL'){var _0x51fe2b={};_0x51fe2b[_0x793b3b[_0x42f0('0x28')]]={'$like':'%'+_0x57b44a['query'][_0x42f0('0x3d')]+'%'};return _0x51fe2b;}})});}_0x473271=_[_0x42f0('0x3e')]({},_0x473271,_0x57b44a[_0x42f0('0x3f')]);var _0x533e8e={'where':_0x473271[_0x42f0('0x3b')]};return db[_0x42f0('0x2b')][_0x42f0('0x1e')](_0x533e8e)['then'](function(_0x463565){_0x15f7c7[_0x42f0('0x1e')]=_0x463565;if(_0x57b44a[_0x42f0('0x31')]['includeAll']){_0x473271[_0x42f0('0x40')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x42f0('0x41')](_0x473271);})['then'](function(_0x29b5fa){_0x15f7c7['rows']=_0x29b5fa;return _0x15f7c7;})[_0x42f0('0x24')](respondWithFilteredResult(_0x1b547f,_0x473271))[_0x42f0('0x42')](handleError(_0x1b547f,null));};exports[_0x42f0('0x43')]=function(_0x57c0a8,_0x19276c){var _0x2934d6={'raw':!![],'where':{'id':_0x57c0a8[_0x42f0('0x44')]['id']}},_0x3923d8={};_0x3923d8[_0x42f0('0x30')]=_[_0x42f0('0x32')](db[_0x42f0('0x2b')][_0x42f0('0x2c')]);_0x3923d8[_0x42f0('0x31')]=_[_0x42f0('0x32')](_0x57c0a8[_0x42f0('0x31')]);_0x3923d8[_0x42f0('0x33')]=_['intersection'](_0x3923d8[_0x42f0('0x30')],_0x3923d8[_0x42f0('0x31')]);_0x2934d6['attributes']=_['intersection'](_0x3923d8[_0x42f0('0x30')],qs[_0x42f0('0x35')](_0x57c0a8['query'][_0x42f0('0x35')]));_0x2934d6[_0x42f0('0x34')]=_0x2934d6[_0x42f0('0x34')][_0x42f0('0x36')]?_0x2934d6['attributes']:_0x3923d8[_0x42f0('0x30')];if(_0x57c0a8[_0x42f0('0x31')][_0x42f0('0x45')]){_0x2934d6[_0x42f0('0x40')]=[{'all':!![]}];}_0x2934d6=_['merge']({},_0x2934d6,_0x57c0a8[_0x42f0('0x3f')]);return db[_0x42f0('0x2b')][_0x42f0('0x46')](_0x2934d6)[_0x42f0('0x24')](handleEntityNotFound(_0x19276c,null))[_0x42f0('0x24')](respondWithResult(_0x19276c,null))[_0x42f0('0x42')](handleError(_0x19276c,null));};exports[_0x42f0('0x47')]=function(_0x1e7b07,_0x829572){return db[_0x42f0('0x2b')][_0x42f0('0x47')](_0x1e7b07[_0x42f0('0x48')],{})[_0x42f0('0x24')](respondWithResult(_0x829572,0xc9))[_0x42f0('0x42')](handleError(_0x829572,null));};exports['update']=function(_0x2aac28,_0x50fa15){if(_0x2aac28[_0x42f0('0x48')]['id']){delete _0x2aac28[_0x42f0('0x48')]['id'];}return db['JscriptyQuestionReport'][_0x42f0('0x46')]({'where':{'id':_0x2aac28[_0x42f0('0x44')]['id']}})[_0x42f0('0x24')](handleEntityNotFound(_0x50fa15,null))[_0x42f0('0x24')](saveUpdates(_0x2aac28[_0x42f0('0x48')],null))['then'](respondWithResult(_0x50fa15,null))[_0x42f0('0x42')](handleError(_0x50fa15,null));};exports[_0x42f0('0x25')]=function(_0x4a6949,_0x87ddd3){return db[_0x42f0('0x2b')][_0x42f0('0x46')]({'where':{'id':_0x4a6949[_0x42f0('0x44')]['id']}})[_0x42f0('0x24')](handleEntityNotFound(_0x87ddd3,null))[_0x42f0('0x24')](removeEntity(_0x87ddd3,null))[_0x42f0('0x42')](handleError(_0x87ddd3,null));};exports[_0x42f0('0x49')]=function(_0x3a5b7a,_0x3cab8d){return db[_0x42f0('0x2b')][_0x42f0('0x49')]()[_0x42f0('0x24')](respondWithResult(_0x3cab8d,null))['catch'](handleError(_0x3cab8d,null));}; \ No newline at end of file +var _0xdecd=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','show','params','fields','includeAll','find','create','body','catch','destroy','describe','eml-format','rimraf','request-promise','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x3bb9e3,_0x1fb1c4){var _0x381aa0=function(_0xb56b49){while(--_0xb56b49){_0x3bb9e3['push'](_0x3bb9e3['shift']());}};_0x381aa0(++_0x1fb1c4);}(_0xdecd,0xc9));var _0xddec=function(_0x3b09a0,_0x149ed2){_0x3b09a0=_0x3b09a0-0x0;var _0x4a0a4c=_0xdecd[_0x3b09a0];return _0x4a0a4c;};'use strict';var emlformat=require(_0xddec('0x0'));var rimraf=require(_0xddec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xddec('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xddec('0x3'));var util=require(_0xddec('0x4'));var path=require(_0xddec('0x5'));var sox=require(_0xddec('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xddec('0x7'));var squel=require(_0xddec('0x8'));var crypto=require(_0xddec('0x9'));var jsforce=require(_0xddec('0xa'));var deskjs=require(_0xddec('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xddec('0xc'));var Redis=require('ioredis');var authService=require(_0xddec('0xd'));var qs=require(_0xddec('0xe'));var as=require(_0xddec('0xf'));var hardwareService=require(_0xddec('0x10'));var logger=require('../../config/logger')(_0xddec('0x11'));var utils=require(_0xddec('0x12'));var config=require(_0xddec('0x13'));var licenseUtil=require(_0xddec('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4858eb,_0x294103){_0x294103=_0x294103||0xcc;return function(_0x2d3379){if(_0x2d3379){return _0x4858eb[_0xddec('0x15')](_0x294103);}return _0x4858eb['status'](_0x294103)[_0xddec('0x16')]();};}function respondWithResult(_0x401e88,_0x24c155){_0x24c155=_0x24c155||0xc8;return function(_0x2d5e58){if(_0x2d5e58){return _0x401e88[_0xddec('0x17')](_0x24c155)[_0xddec('0x18')](_0x2d5e58);}};}function respondWithFilteredResult(_0x286f6c,_0x3ea9ab){return function(_0x28dc79){if(_0x28dc79){var _0x173640=typeof _0x3ea9ab[_0xddec('0x19')]===_0xddec('0x1a')&&typeof _0x3ea9ab[_0xddec('0x1b')]===_0xddec('0x1a');var _0x4db9c5=_0x28dc79[_0xddec('0x1c')];var _0x1bd604=_0x173640?0x0:_0x3ea9ab[_0xddec('0x19')];var _0x476bbc=_0x173640?_0x28dc79[_0xddec('0x1c')]:_0x3ea9ab[_0xddec('0x19')]+_0x3ea9ab['limit'];var _0x1207db;if(_0x476bbc>=_0x4db9c5){_0x476bbc=_0x4db9c5;_0x1207db=0xc8;}else{_0x1207db=0xce;}_0x286f6c[_0xddec('0x17')](_0x1207db);return _0x286f6c[_0xddec('0x1d')]('Content-Range',_0x1bd604+'-'+_0x476bbc+'/'+_0x4db9c5)[_0xddec('0x18')](_0x28dc79);}return null;};}function patchUpdates(_0x47c6a2){return function(_0x19f4f5){try{jsonpatch[_0xddec('0x1e')](_0x19f4f5,_0x47c6a2,!![]);}catch(_0x3fe255){return BPromise[_0xddec('0x1f')](_0x3fe255);}return _0x19f4f5[_0xddec('0x20')]();};}function saveUpdates(_0x8043a1,_0x363de7){return function(_0x312f30){if(_0x312f30){return _0x312f30[_0xddec('0x21')](_0x8043a1)[_0xddec('0x22')](function(_0x451ab0){return _0x451ab0;});}return null;};}function removeEntity(_0x4479ab,_0x3995d3){return function(_0x7ab327){if(_0x7ab327){return _0x7ab327['destroy']()['then'](function(){_0x4479ab[_0xddec('0x17')](0xcc)[_0xddec('0x16')]();});}};}function handleEntityNotFound(_0x5814e7,_0x1aa3cb){return function(_0x55355c){if(!_0x55355c){_0x5814e7[_0xddec('0x15')](0x194);}return _0x55355c;};}function handleError(_0x1a4040,_0x48e971){_0x48e971=_0x48e971||0x1f4;return function(_0x3add18){logger[_0xddec('0x23')](_0x3add18[_0xddec('0x24')]);if(_0x3add18[_0xddec('0x25')]){delete _0x3add18[_0xddec('0x25')];}_0x1a4040['status'](_0x48e971)[_0xddec('0x26')](_0x3add18);};}exports['index']=function(_0x47ac59,_0xd63988){var _0x1548ce={},_0x473b87={},_0x596270={'count':0x0,'rows':[]};var _0x48b3b2=_[_0xddec('0x27')](db[_0xddec('0x28')][_0xddec('0x29')],function(_0x3add6f){return{'name':_0x3add6f[_0xddec('0x2a')],'type':_0x3add6f[_0xddec('0x2b')][_0xddec('0x2c')]};});_0x473b87[_0xddec('0x2d')]=_['map'](_0x48b3b2,_0xddec('0x25'));_0x473b87[_0xddec('0x2e')]=_[_0xddec('0x2f')](_0x47ac59[_0xddec('0x2e')]);_0x473b87['filters']=_[_0xddec('0x30')](_0x473b87[_0xddec('0x2d')],_0x473b87['query']);_0x1548ce[_0xddec('0x31')]=_['intersection'](_0x473b87[_0xddec('0x2d')],qs['fields'](_0x47ac59['query']['fields']));_0x1548ce[_0xddec('0x31')]=_0x1548ce['attributes'][_0xddec('0x32')]?_0x1548ce[_0xddec('0x31')]:_0x473b87[_0xddec('0x2d')];if(!_0x47ac59[_0xddec('0x2e')][_0xddec('0x33')]('nolimit')){_0x1548ce[_0xddec('0x1b')]=qs[_0xddec('0x1b')](_0x47ac59['query'][_0xddec('0x1b')]);_0x1548ce[_0xddec('0x19')]=qs['offset'](_0x47ac59[_0xddec('0x2e')]['offset']);}_0x1548ce[_0xddec('0x34')]=qs[_0xddec('0x35')](_0x47ac59[_0xddec('0x2e')][_0xddec('0x35')]);_0x1548ce[_0xddec('0x36')]=qs[_0xddec('0x37')](_[_0xddec('0x38')](_0x47ac59[_0xddec('0x2e')],_0x473b87[_0xddec('0x37')]),_0x48b3b2);if(_0x47ac59['query'][_0xddec('0x39')]){_0x1548ce['where']=_[_0xddec('0x3a')](_0x1548ce[_0xddec('0x36')],{'$or':_[_0xddec('0x27')](_0x48b3b2,function(_0x52b045){if(_0x52b045[_0xddec('0x2b')]!==_0xddec('0x3b')){var _0x35e304={};_0x35e304[_0x52b045[_0xddec('0x25')]]={'$like':'%'+_0x47ac59[_0xddec('0x2e')][_0xddec('0x39')]+'%'};return _0x35e304;}})});}_0x1548ce=_[_0xddec('0x3a')]({},_0x1548ce,_0x47ac59[_0xddec('0x3c')]);var _0x4a9d81={'where':_0x1548ce[_0xddec('0x36')]};return db[_0xddec('0x28')][_0xddec('0x1c')](_0x4a9d81)[_0xddec('0x22')](function(_0x4d9501){_0x596270[_0xddec('0x1c')]=_0x4d9501;if(_0x47ac59[_0xddec('0x2e')]['includeAll']){_0x1548ce[_0xddec('0x3d')]=[{'all':!![]}];}return db[_0xddec('0x28')]['findAll'](_0x1548ce);})['then'](function(_0x54acaf){_0x596270[_0xddec('0x3e')]=_0x54acaf;return _0x596270;})[_0xddec('0x22')](respondWithFilteredResult(_0xd63988,_0x1548ce))['catch'](handleError(_0xd63988,null));};exports[_0xddec('0x3f')]=function(_0x44a1ee,_0x332e3b){var _0x264454={'raw':!![],'where':{'id':_0x44a1ee[_0xddec('0x40')]['id']}},_0x5c0cbc={};_0x5c0cbc['model']=_[_0xddec('0x2f')](db[_0xddec('0x28')][_0xddec('0x29')]);_0x5c0cbc[_0xddec('0x2e')]=_[_0xddec('0x2f')](_0x44a1ee[_0xddec('0x2e')]);_0x5c0cbc[_0xddec('0x37')]=_[_0xddec('0x30')](_0x5c0cbc[_0xddec('0x2d')],_0x5c0cbc['query']);_0x264454[_0xddec('0x31')]=_[_0xddec('0x30')](_0x5c0cbc['model'],qs[_0xddec('0x41')](_0x44a1ee['query'][_0xddec('0x41')]));_0x264454[_0xddec('0x31')]=_0x264454[_0xddec('0x31')][_0xddec('0x32')]?_0x264454['attributes']:_0x5c0cbc[_0xddec('0x2d')];if(_0x44a1ee['query'][_0xddec('0x42')]){_0x264454[_0xddec('0x3d')]=[{'all':!![]}];}_0x264454=_[_0xddec('0x3a')]({},_0x264454,_0x44a1ee[_0xddec('0x3c')]);return db[_0xddec('0x28')][_0xddec('0x43')](_0x264454)[_0xddec('0x22')](handleEntityNotFound(_0x332e3b,null))['then'](respondWithResult(_0x332e3b,null))['catch'](handleError(_0x332e3b,null));};exports[_0xddec('0x44')]=function(_0x25004e,_0x5ab6e3){return db[_0xddec('0x28')][_0xddec('0x44')](_0x25004e[_0xddec('0x45')],{})[_0xddec('0x22')](respondWithResult(_0x5ab6e3,0xc9))[_0xddec('0x46')](handleError(_0x5ab6e3,null));};exports[_0xddec('0x21')]=function(_0x4ce9da,_0x9ec28d){if(_0x4ce9da[_0xddec('0x45')]['id']){delete _0x4ce9da['body']['id'];}return db['JscriptyQuestionReport'][_0xddec('0x43')]({'where':{'id':_0x4ce9da[_0xddec('0x40')]['id']}})[_0xddec('0x22')](handleEntityNotFound(_0x9ec28d,null))[_0xddec('0x22')](saveUpdates(_0x4ce9da[_0xddec('0x45')],null))[_0xddec('0x22')](respondWithResult(_0x9ec28d,null))['catch'](handleError(_0x9ec28d,null));};exports[_0xddec('0x47')]=function(_0x51891,_0x44120f){return db[_0xddec('0x28')][_0xddec('0x43')]({'where':{'id':_0x51891['params']['id']}})[_0xddec('0x22')](handleEntityNotFound(_0x44120f,null))[_0xddec('0x22')](removeEntity(_0x44120f,null))['catch'](handleError(_0x44120f,null));};exports[_0xddec('0x48')]=function(_0x9d41d8,_0x162a4a){return db['JscriptyQuestionReport']['describe']()[_0xddec('0x22')](respondWithResult(_0x162a4a,null))[_0xddec('0x46')](handleError(_0x162a4a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 9edb717..13a8689 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 _0x7c4f=['exports','define','report_jscripty_questions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x37cac4,_0x73dd2e){var _0x5d9ac3=function(_0x2d40ac){while(--_0x2d40ac){_0x37cac4['push'](_0x37cac4['shift']());}};_0x5d9ac3(++_0x73dd2e);}(_0x7c4f,0xb7));var _0xf7c4=function(_0x3904fa,_0x211057){_0x3904fa=_0x3904fa-0x0;var _0x1a9886=_0x7c4f[_0x3904fa];return _0x1a9886;};'use strict';var _=require('lodash');var util=require(_0xf7c4('0x0'));var logger=require(_0xf7c4('0x1'))(_0xf7c4('0x2'));var moment=require(_0xf7c4('0x3'));var BPromise=require(_0xf7c4('0x4'));var rp=require(_0xf7c4('0x5'));var fs=require('fs');var path=require(_0xf7c4('0x6'));var rimraf=require(_0xf7c4('0x7'));var config=require(_0xf7c4('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xf7c4('0x9')]=function(_0x28e649,_0x1c5bc0){return _0x28e649[_0xf7c4('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0xf7c4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a53=['path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1fd108,_0x4ac328){var _0x40652a=function(_0x5654fc){while(--_0x5654fc){_0x1fd108['push'](_0x1fd108['shift']());}};_0x40652a(++_0x4ac328);}(_0x7a53,0x8a));var _0x37a5=function(_0x2c6ae5,_0x40c846){_0x2c6ae5=_0x2c6ae5-0x0;var _0xac47c2=_0x7a53[_0x2c6ae5];return _0xac47c2;};'use strict';var _=require(_0x37a5('0x0'));var util=require(_0x37a5('0x1'));var logger=require(_0x37a5('0x2'))(_0x37a5('0x3'));var moment=require(_0x37a5('0x4'));var BPromise=require(_0x37a5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37a5('0x6'));var rimraf=require(_0x37a5('0x7'));var config=require(_0x37a5('0x8'));var attributes=require(_0x37a5('0x9'));module[_0x37a5('0xa')]=function(_0x2cd007,_0x54f914){return _0x2cd007[_0x37a5('0xb')]('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index e59bce6..ffc1925 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 _0xdabe=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','info','result','catch','moment','bluebird','randomstring'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xdabe,0x90));var _0xedab=function(_0x43cc2d,_0x48255d){_0x43cc2d=_0x43cc2d-0x0;var _0x28a701=_0xdabe[_0x43cc2d];return _0x28a701;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xedab('0x0'));var BPromise=require(_0xedab('0x1'));var rs=require(_0xedab('0x2'));var fs=require('fs');var Redis=require(_0xedab('0x3'));var db=require(_0xedab('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xedab('0x5'))(_0xedab('0x6'));var config=require(_0xedab('0x7'));var jayson=require(_0xedab('0x8'));var client=jayson[_0xedab('0x9')][_0xedab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b3e43,_0x108777,_0x1e54c1){return new BPromise(function(_0xa78a4a,_0x4ac058){return client[_0xedab('0xb')](_0x1b3e43,_0x1e54c1)['then'](function(_0x108ee4){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x108777,_0xedab('0xc'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x108777,_0xedab('0xc'),JSON[_0xedab('0xd')](_0x108ee4));if(_0x108ee4[_0xedab('0xe')]){if(_0x108ee4[_0xedab('0xe')][_0xedab('0xf')]===0x1f4){logger[_0xedab('0xe')](_0xedab('0x10'),_0x108777,_0x108ee4['error']['message']);return _0x4ac058(_0x108ee4[_0xedab('0xe')][_0xedab('0x11')]);}logger[_0xedab('0xe')](_0xedab('0x10'),_0x108777,_0x108ee4[_0xedab('0xe')][_0xedab('0x11')]);return _0xa78a4a(_0x108ee4[_0xedab('0xe')][_0xedab('0x11')]);}else{logger[_0xedab('0x12')](_0xedab('0x10'),_0x108777,_0xedab('0xc'));_0xa78a4a(_0x108ee4[_0xedab('0x13')]['message']);}})[_0xedab('0x14')](function(_0x12ef69){logger[_0xedab('0xe')](_0xedab('0x10'),_0x108777,_0x12ef69);_0x4ac058(_0x12ef69);});});} \ No newline at end of file +var _0xa3ec=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird'];(function(_0x29abdd,_0x28e718){var _0x3d1460=function(_0x5924eb){while(--_0x5924eb){_0x29abdd['push'](_0x29abdd['shift']());}};_0x3d1460(++_0x28e718);}(_0xa3ec,0x19e));var _0xca3e=function(_0x3429f3,_0x4f6cc6){_0x3429f3=_0x3429f3-0x0;var _0x48ff57=_0xa3ec[_0x3429f3];return _0x48ff57;};'use strict';var _=require(_0xca3e('0x0'));var util=require(_0xca3e('0x1'));var moment=require(_0xca3e('0x2'));var BPromise=require(_0xca3e('0x3'));var rs=require(_0xca3e('0x4'));var fs=require('fs');var Redis=require(_0xca3e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xca3e('0x6'));var logger=require('../../config/logger')(_0xca3e('0x7'));var config=require(_0xca3e('0x8'));var jayson=require(_0xca3e('0x9'));var client=jayson[_0xca3e('0xa')][_0xca3e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b23d3,_0x332d3e,_0x2edec5){return new BPromise(function(_0x491894,_0x319bfc){return client[_0xca3e('0xc')](_0x2b23d3,_0x2edec5)[_0xca3e('0xd')](function(_0x1c142e){logger[_0xca3e('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x332d3e,_0xca3e('0xf'));logger['debug'](_0xca3e('0x10'),_0x332d3e,_0xca3e('0xf'),JSON['stringify'](_0x1c142e));if(_0x1c142e[_0xca3e('0x11')]){if(_0x1c142e[_0xca3e('0x11')][_0xca3e('0x12')]===0x1f4){logger[_0xca3e('0x11')](_0xca3e('0x13'),_0x332d3e,_0x1c142e[_0xca3e('0x11')][_0xca3e('0x14')]);return _0x319bfc(_0x1c142e[_0xca3e('0x11')]['message']);}logger[_0xca3e('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x332d3e,_0x1c142e[_0xca3e('0x11')][_0xca3e('0x14')]);return _0x491894(_0x1c142e[_0xca3e('0x11')][_0xca3e('0x14')]);}else{logger[_0xca3e('0xe')](_0xca3e('0x13'),_0x332d3e,_0xca3e('0xf'));_0x491894(_0x1c142e[_0xca3e('0x15')][_0xca3e('0x14')]);}})['catch'](function(_0x51ab9c){logger[_0xca3e('0x11')](_0xca3e('0x13'),_0x332d3e,_0x51ab9c);_0x319bfc(_0x51ab9c);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 865f946..d4d5671 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 _0x8e11=['show','/:id/questions','getQuestions','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','/:id','isAuthenticated'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x8e11,0x93));var _0x18e1=function(_0xa111db,_0x8a8f5b){_0xa111db=_0xa111db-0x0;var _0x5d402c=_0x8e11[_0xa111db];return _0x5d402c;};'use strict';var multer=require(_0x18e1('0x0'));var util=require(_0x18e1('0x1'));var path=require('path');var timeout=require(_0x18e1('0x2'));var express=require(_0x18e1('0x3'));var router=express[_0x18e1('0x4')]();var fs_extra=require(_0x18e1('0x5'));var auth=require(_0x18e1('0x6'));var interaction=require(_0x18e1('0x7'));var config=require(_0x18e1('0x8'));var controller=require('./jscriptySessionReport.controller');router[_0x18e1('0x9')]('/',auth['isAuthenticated'](),controller[_0x18e1('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x18e1('0xb')]);router[_0x18e1('0x9')](_0x18e1('0xc'),auth[_0x18e1('0xd')](),controller[_0x18e1('0xe')]);router[_0x18e1('0x9')](_0x18e1('0xf'),auth[_0x18e1('0xd')](),controller[_0x18e1('0x10')]);router[_0x18e1('0x11')]('/',auth[_0x18e1('0xd')](),controller[_0x18e1('0x12')]);router['put'](_0x18e1('0xc'),auth['isAuthenticated'](),controller[_0x18e1('0x13')]);router[_0x18e1('0x14')](_0x18e1('0xc'),auth[_0x18e1('0xd')](),controller[_0x18e1('0x15')]);module[_0x18e1('0x16')]=router; \ No newline at end of file +var _0xbfbe=['util','path','express','Router','fs-extra','../../components/auth/service','./jscriptySessionReport.controller','get','/describe','/:id','show','/:id/questions','getQuestions','post','put','update','delete','isAuthenticated','exports'];(function(_0x42fb06,_0xc8e815){var _0x5580ad=function(_0x4345ff){while(--_0x4345ff){_0x42fb06['push'](_0x42fb06['shift']());}};_0x5580ad(++_0xc8e815);}(_0xbfbe,0x11d));var _0xebfb=function(_0x36a3d1,_0x4a32cd){_0x36a3d1=_0x36a3d1-0x0;var _0x821ef4=_0xbfbe[_0x36a3d1];return _0x821ef4;};'use strict';var multer=require('multer');var util=require(_0xebfb('0x0'));var path=require(_0xebfb('0x1'));var timeout=require('connect-timeout');var express=require(_0xebfb('0x2'));var router=express[_0xebfb('0x3')]();var fs_extra=require(_0xebfb('0x4'));var auth=require(_0xebfb('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xebfb('0x6'));router[_0xebfb('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xebfb('0x7')](_0xebfb('0x8'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xebfb('0x9'),auth['isAuthenticated'](),controller[_0xebfb('0xa')]);router['get'](_0xebfb('0xb'),auth['isAuthenticated'](),controller[_0xebfb('0xc')]);router[_0xebfb('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xebfb('0xe')](_0xebfb('0x9'),auth['isAuthenticated'](),controller[_0xebfb('0xf')]);router[_0xebfb('0x10')](_0xebfb('0x9'),auth[_0xebfb('0x11')](),controller['destroy']);module[_0xebfb('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 069365c..86cc033 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 _0xdb10=['DATE','STRING','BOOLEAN','moment','sequelize','exports','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0xdb10,0x18f));var _0x0db1=function(_0x7538c5,_0xa5d8ac){_0x7538c5=_0x7538c5-0x0;var _0x8b56be=_0xdb10[_0x7538c5];return _0x8b56be;};'use strict';var moment=require(_0x0db1('0x0'));var Sequelize=require(_0x0db1('0x1'));module[_0x0db1('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x13651c){this[_0x0db1('0x3')](_0x0db1('0x4'),_0x13651c);this[_0x0db1('0x3')](_0x0db1('0x5'),moment()[_0x0db1('0x6')](_0x0db1('0x7')));}},'endtime':{'type':Sequelize[_0x0db1('0x8')]},'membername':{'type':Sequelize[_0x0db1('0x9')]},'projectname':{'type':Sequelize[_0x0db1('0x9')]},'queue':{'type':Sequelize[_0x0db1('0x9')]},'uniqueid':{'type':Sequelize[_0x0db1('0x9')]},'calleridname':{'type':Sequelize[_0x0db1('0x9')]},'calleridnum':{'type':Sequelize[_0x0db1('0x9')]},'completed':{'type':Sequelize[_0x0db1('0xa')],'defaultValue':![]}}; \ No newline at end of file +var _0x28ad=['sequelize','DATE','setDataValue','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0x28ad,0x99));var _0xd28a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x28ad[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xd28a('0x0'));var Sequelize=require(_0xd28a('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xd28a('0x2')],'set':function(_0x5ca1ec){this[_0xd28a('0x3')]('starttime',_0x5ca1ec);this[_0xd28a('0x3')]('endtime',moment()[_0xd28a('0x4')](_0xd28a('0x5')));}},'endtime':{'type':Sequelize[_0xd28a('0x2')]},'membername':{'type':Sequelize[_0xd28a('0x6')]},'projectname':{'type':Sequelize[_0xd28a('0x6')]},'queue':{'type':Sequelize[_0xd28a('0x6')]},'uniqueid':{'type':Sequelize[_0xd28a('0x6')]},'calleridname':{'type':Sequelize[_0xd28a('0x6')]},'calleridnum':{'type':Sequelize[_0xd28a('0x6')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index c70a2ff..593d3af 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 _0xd247=['querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','end','stack','name','send','index','map','JscriptySessionReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','pick','where','merge','VIRTUAL','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','describe','getQuestions','findOne','order','SessionId','filter','JscriptyQuestionReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js'];(function(_0x373441,_0x589268){var _0x1faff7=function(_0x59a932){while(--_0x59a932){_0x373441['push'](_0x373441['shift']());}};_0x1faff7(++_0x589268);}(_0xd247,0x1b9));var _0x7d24=function(_0x59625f,_0x3b2c76){_0x59625f=_0x59625f-0x0;var _0x498e1e=_0xd247[_0x59625f];return _0x498e1e;};'use strict';var emlformat=require(_0x7d24('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7d24('0x1'));var jsonpatch=require(_0x7d24('0x2'));var rp=require(_0x7d24('0x3'));var moment=require(_0x7d24('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7d24('0x5'));var util=require(_0x7d24('0x6'));var path=require(_0x7d24('0x7'));var sox=require(_0x7d24('0x8'));var csv=require(_0x7d24('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d24('0xa'));var squel=require(_0x7d24('0xb'));var crypto=require(_0x7d24('0xc'));var jsforce=require(_0x7d24('0xd'));var deskjs=require(_0x7d24('0xe'));var toCsv=require(_0x7d24('0x9'));var querystring=require(_0x7d24('0xf'));var Papa=require(_0x7d24('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7d24('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d24('0x12'));var logger=require(_0x7d24('0x13'))(_0x7d24('0x14'));var utils=require(_0x7d24('0x15'));var config=require(_0x7d24('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34270a,_0x27a6cb){_0x27a6cb=_0x27a6cb||0xcc;return function(_0x47cf93){if(_0x47cf93){return _0x34270a[_0x7d24('0x17')](_0x27a6cb);}return _0x34270a[_0x7d24('0x18')](_0x27a6cb)['end']();};}function respondWithResult(_0x5e1f7e,_0x3f25ca){_0x3f25ca=_0x3f25ca||0xc8;return function(_0x5611cf){if(_0x5611cf){return _0x5e1f7e['status'](_0x3f25ca)[_0x7d24('0x19')](_0x5611cf);}};}function respondWithFilteredResult(_0x3695ea,_0x44d2c0){return function(_0x403579){if(_0x403579){var _0x29fb6b=typeof _0x44d2c0[_0x7d24('0x1a')]===_0x7d24('0x1b')&&typeof _0x44d2c0['limit']===_0x7d24('0x1b');var _0x34ec25=_0x403579[_0x7d24('0x1c')];var _0xbcb4bb=_0x29fb6b?0x0:_0x44d2c0[_0x7d24('0x1a')];var _0x2a5779=_0x29fb6b?_0x403579[_0x7d24('0x1c')]:_0x44d2c0[_0x7d24('0x1a')]+_0x44d2c0[_0x7d24('0x1d')];var _0xa0aa28;if(_0x2a5779>=_0x34ec25){_0x2a5779=_0x34ec25;_0xa0aa28=0xc8;}else{_0xa0aa28=0xce;}_0x3695ea[_0x7d24('0x18')](_0xa0aa28);return _0x3695ea['set'](_0x7d24('0x1e'),_0xbcb4bb+'-'+_0x2a5779+'/'+_0x34ec25)[_0x7d24('0x19')](_0x403579);}return null;};}function patchUpdates(_0x565da1){return function(_0x39abb1){try{jsonpatch[_0x7d24('0x1f')](_0x39abb1,_0x565da1,!![]);}catch(_0x1cc4ec){return BPromise['reject'](_0x1cc4ec);}return _0x39abb1[_0x7d24('0x20')]();};}function saveUpdates(_0x5a13bf,_0x1c86c4){return function(_0x44ad08){if(_0x44ad08){return _0x44ad08[_0x7d24('0x21')](_0x5a13bf)['then'](function(_0x3cf47e){return _0x3cf47e;});}return null;};}function removeEntity(_0x2389fb,_0x40059d){return function(_0x1c375c){if(_0x1c375c){return _0x1c375c['destroy']()[_0x7d24('0x22')](function(){_0x2389fb[_0x7d24('0x18')](0xcc)[_0x7d24('0x23')]();});}};}function handleEntityNotFound(_0x4020a3,_0x20df01){return function(_0x2a394d){if(!_0x2a394d){_0x4020a3[_0x7d24('0x17')](0x194);}return _0x2a394d;};}function handleError(_0x2f2d1e,_0xaef3ad){_0xaef3ad=_0xaef3ad||0x1f4;return function(_0x2229bf){logger['error'](_0x2229bf[_0x7d24('0x24')]);if(_0x2229bf['name']){delete _0x2229bf[_0x7d24('0x25')];}_0x2f2d1e[_0x7d24('0x18')](_0xaef3ad)[_0x7d24('0x26')](_0x2229bf);};}exports[_0x7d24('0x27')]=function(_0xa88d9a,_0x2de08f){var _0x46d611={},_0x24b24c={},_0x117c4e={'count':0x0,'rows':[]};var _0x47a765=_[_0x7d24('0x28')](db[_0x7d24('0x29')][_0x7d24('0x2a')],function(_0x243306){return{'name':_0x243306['fieldName'],'type':_0x243306[_0x7d24('0x2b')][_0x7d24('0x2c')]};});_0x24b24c[_0x7d24('0x2d')]=_['map'](_0x47a765,_0x7d24('0x25'));_0x24b24c[_0x7d24('0x2e')]=_[_0x7d24('0x2f')](_0xa88d9a[_0x7d24('0x2e')]);_0x24b24c[_0x7d24('0x30')]=_['intersection'](_0x24b24c[_0x7d24('0x2d')],_0x24b24c[_0x7d24('0x2e')]);_0x46d611[_0x7d24('0x31')]=_[_0x7d24('0x32')](_0x24b24c[_0x7d24('0x2d')],qs[_0x7d24('0x33')](_0xa88d9a[_0x7d24('0x2e')]['fields']));_0x46d611[_0x7d24('0x31')]=_0x46d611[_0x7d24('0x31')]['length']?_0x46d611['attributes']:_0x24b24c['model'];if(!_0xa88d9a[_0x7d24('0x2e')]['hasOwnProperty'](_0x7d24('0x34'))){_0x46d611[_0x7d24('0x1d')]=qs['limit'](_0xa88d9a[_0x7d24('0x2e')]['limit']);_0x46d611['offset']=qs[_0x7d24('0x1a')](_0xa88d9a[_0x7d24('0x2e')][_0x7d24('0x1a')]);}_0x46d611['order']=qs[_0x7d24('0x35')](_0xa88d9a[_0x7d24('0x2e')][_0x7d24('0x35')]);_0x46d611['where']=qs[_0x7d24('0x30')](_[_0x7d24('0x36')](_0xa88d9a[_0x7d24('0x2e')],_0x24b24c['filters']),_0x47a765);if(_0xa88d9a[_0x7d24('0x2e')]['filter']){_0x46d611[_0x7d24('0x37')]=_[_0x7d24('0x38')](_0x46d611[_0x7d24('0x37')],{'$or':_['map'](_0x47a765,function(_0x16fbef){if(_0x16fbef[_0x7d24('0x2b')]!==_0x7d24('0x39')){var _0x532a27={};_0x532a27[_0x16fbef[_0x7d24('0x25')]]={'$like':'%'+_0xa88d9a[_0x7d24('0x2e')]['filter']+'%'};return _0x532a27;}})});}_0x46d611=_['merge']({},_0x46d611,_0xa88d9a['options']);var _0x179484={'where':_0x46d611[_0x7d24('0x37')]};return db['JscriptySessionReport'][_0x7d24('0x1c')](_0x179484)[_0x7d24('0x22')](function(_0x472f76){_0x117c4e[_0x7d24('0x1c')]=_0x472f76;if(_0xa88d9a[_0x7d24('0x2e')]['includeAll']){_0x46d611['include']=[{'all':!![]}];}return db[_0x7d24('0x29')][_0x7d24('0x3a')](_0x46d611);})[_0x7d24('0x22')](function(_0x5d383b){_0x117c4e[_0x7d24('0x3b')]=_0x5d383b;return _0x117c4e;})['then'](respondWithFilteredResult(_0x2de08f,_0x46d611))[_0x7d24('0x3c')](handleError(_0x2de08f,null));};exports[_0x7d24('0x3d')]=function(_0x5a6366,_0x4b9ebb){var _0x9562ed={'raw':!![],'where':{'id':_0x5a6366[_0x7d24('0x3e')]['id']}},_0x5ee41c={};_0x5ee41c[_0x7d24('0x2d')]=_[_0x7d24('0x2f')](db[_0x7d24('0x29')]['rawAttributes']);_0x5ee41c['query']=_[_0x7d24('0x2f')](_0x5a6366[_0x7d24('0x2e')]);_0x5ee41c['filters']=_[_0x7d24('0x32')](_0x5ee41c[_0x7d24('0x2d')],_0x5ee41c[_0x7d24('0x2e')]);_0x9562ed[_0x7d24('0x31')]=_[_0x7d24('0x32')](_0x5ee41c[_0x7d24('0x2d')],qs[_0x7d24('0x33')](_0x5a6366['query'][_0x7d24('0x33')]));_0x9562ed[_0x7d24('0x31')]=_0x9562ed['attributes'][_0x7d24('0x3f')]?_0x9562ed[_0x7d24('0x31')]:_0x5ee41c[_0x7d24('0x2d')];if(_0x5a6366[_0x7d24('0x2e')][_0x7d24('0x40')]){_0x9562ed['include']=[{'all':!![]}];}_0x9562ed=_[_0x7d24('0x38')]({},_0x9562ed,_0x5a6366[_0x7d24('0x41')]);return db[_0x7d24('0x29')][_0x7d24('0x42')](_0x9562ed)['then'](handleEntityNotFound(_0x4b9ebb,null))[_0x7d24('0x22')](respondWithResult(_0x4b9ebb,null))[_0x7d24('0x3c')](handleError(_0x4b9ebb,null));};exports[_0x7d24('0x43')]=function(_0x45eeb3,_0x5e4d23){return db['JscriptySessionReport'][_0x7d24('0x43')](_0x45eeb3[_0x7d24('0x44')],{})[_0x7d24('0x22')](respondWithResult(_0x5e4d23,0xc9))[_0x7d24('0x3c')](handleError(_0x5e4d23,null));};exports['update']=function(_0x4be542,_0x213e8c){if(_0x4be542[_0x7d24('0x44')]['id']){delete _0x4be542[_0x7d24('0x44')]['id'];}return db[_0x7d24('0x29')]['find']({'where':{'id':_0x4be542[_0x7d24('0x3e')]['id']}})[_0x7d24('0x22')](handleEntityNotFound(_0x213e8c,null))[_0x7d24('0x22')](saveUpdates(_0x4be542[_0x7d24('0x44')],null))[_0x7d24('0x22')](respondWithResult(_0x213e8c,null))[_0x7d24('0x3c')](handleError(_0x213e8c,null));};exports['destroy']=function(_0xc6f2eb,_0x179766){return db[_0x7d24('0x29')][_0x7d24('0x42')]({'where':{'id':_0xc6f2eb[_0x7d24('0x3e')]['id']}})[_0x7d24('0x22')](handleEntityNotFound(_0x179766,null))[_0x7d24('0x22')](removeEntity(_0x179766,null))['catch'](handleError(_0x179766,null));};exports[_0x7d24('0x45')]=function(_0x1dbf44,_0x413e2f){return db[_0x7d24('0x29')][_0x7d24('0x45')]()[_0x7d24('0x22')](respondWithResult(_0x413e2f,null))[_0x7d24('0x3c')](handleError(_0x413e2f,null));};exports[_0x7d24('0x46')]=function(_0xe81ff5,_0xa74f15,_0x3cad97){var _0x53a358={'raw':!![],'where':{}};var _0x39e1c5={};var _0x57f994={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x7d24('0x47')]({'where':{'id':_0xe81ff5[_0x7d24('0x3e')]['id']}})['then'](handleEntityNotFound(_0xa74f15,null))['then'](function(_0x277ffc){if(_0x277ffc){_0x39e1c5[_0x7d24('0x2d')]=_['keys'](db['JscriptyQuestionReport'][_0x7d24('0x2a')]);_0x39e1c5[_0x7d24('0x2e')]=_[_0x7d24('0x2f')](_0xe81ff5[_0x7d24('0x2e')]);_0x39e1c5[_0x7d24('0x30')]=_['intersection'](_0x39e1c5[_0x7d24('0x2d')],_0x39e1c5[_0x7d24('0x2e')]);_0x53a358[_0x7d24('0x31')]=_[_0x7d24('0x32')](_0x39e1c5[_0x7d24('0x2d')],qs[_0x7d24('0x33')](_0xe81ff5['query']['fields']));_0x53a358[_0x7d24('0x31')]=_0x53a358[_0x7d24('0x31')]['length']?_0x53a358['attributes']:_0x39e1c5[_0x7d24('0x2d')];if(!_0xe81ff5[_0x7d24('0x2e')]['hasOwnProperty'](_0x7d24('0x34'))){_0x53a358[_0x7d24('0x1d')]=qs[_0x7d24('0x1d')](_0xe81ff5[_0x7d24('0x2e')][_0x7d24('0x1d')]);_0x53a358[_0x7d24('0x1a')]=qs['offset'](_0xe81ff5[_0x7d24('0x2e')][_0x7d24('0x1a')]);}_0x53a358[_0x7d24('0x48')]=qs[_0x7d24('0x35')](_0xe81ff5[_0x7d24('0x2e')][_0x7d24('0x35')]);_0x53a358[_0x7d24('0x37')]=qs[_0x7d24('0x30')](_[_0x7d24('0x36')](_0xe81ff5[_0x7d24('0x2e')],_0x39e1c5[_0x7d24('0x30')]));_0x53a358[_0x7d24('0x37')][_0x7d24('0x49')]=_0x277ffc['id'];if(_0xe81ff5['query'][_0x7d24('0x4a')]){_0x53a358['where']=_['merge'](_0x53a358[_0x7d24('0x37')],{'$or':_[_0x7d24('0x28')](_0x53a358[_0x7d24('0x31')],function(_0x4c8316){var _0x1a5b8d={};_0x1a5b8d[_0x4c8316]={'$like':'%'+_0xe81ff5[_0x7d24('0x2e')][_0x7d24('0x4a')]+'%'};return _0x1a5b8d;})});}_0x53a358=_[_0x7d24('0x38')]({},_0x53a358,_0xe81ff5[_0x7d24('0x41')]);return db[_0x7d24('0x4b')][_0x7d24('0x1c')]({'where':_0x53a358[_0x7d24('0x37')]})[_0x7d24('0x22')](function(_0x1286f1){_0x57f994[_0x7d24('0x1c')]=_0x1286f1;if(_0xe81ff5[_0x7d24('0x2e')][_0x7d24('0x40')]){_0x53a358['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x53a358);})[_0x7d24('0x22')](function(_0x2df07d){_0x57f994['rows']=_0x2df07d;return _0x57f994;});}})['then'](respondWithFilteredResult(_0xa74f15,_0x53a358))[_0x7d24('0x3c')](handleError(_0xa74f15,null));}; \ No newline at end of file +var _0x95f5=['apply','reject','save','update','then','destroy','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','include','find','catch','create','params','describe','findOne','JscriptyQuestionReport','order','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x160f41,_0x25a003){var _0x19cffd=function(_0x43e279){while(--_0x43e279){_0x160f41['push'](_0x160f41['shift']());}};_0x19cffd(++_0x25a003);}(_0x95f5,0xc8));var _0x595f=function(_0x70b483,_0x22496a){_0x70b483=_0x70b483-0x0;var _0x34bfbb=_0x95f5[_0x70b483];return _0x34bfbb;};'use strict';var emlformat=require(_0x595f('0x0'));var rimraf=require(_0x595f('0x1'));var zipdir=require(_0x595f('0x2'));var jsonpatch=require(_0x595f('0x3'));var rp=require('request-promise');var moment=require(_0x595f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x595f('0x5'));var util=require(_0x595f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x595f('0x7'));var ejs=require(_0x595f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x595f('0x9'));var squel=require(_0x595f('0xa'));var crypto=require('crypto');var jsforce=require(_0x595f('0xb'));var deskjs=require(_0x595f('0xc'));var toCsv=require(_0x595f('0x7'));var querystring=require(_0x595f('0xd'));var Papa=require('papaparse');var Redis=require(_0x595f('0xe'));var authService=require(_0x595f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x595f('0x10'));var hardwareService=require(_0x595f('0x11'));var logger=require(_0x595f('0x12'))(_0x595f('0x13'));var utils=require(_0x595f('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e065a,_0x9d1f71){_0x9d1f71=_0x9d1f71||0xcc;return function(_0x1167e8){if(_0x1167e8){return _0x2e065a[_0x595f('0x15')](_0x9d1f71);}return _0x2e065a[_0x595f('0x16')](_0x9d1f71)[_0x595f('0x17')]();};}function respondWithResult(_0x742265,_0x10f573){_0x10f573=_0x10f573||0xc8;return function(_0x226e9a){if(_0x226e9a){return _0x742265[_0x595f('0x16')](_0x10f573)[_0x595f('0x18')](_0x226e9a);}};}function respondWithFilteredResult(_0x4d07a3,_0x1943f9){return function(_0x1365f0){if(_0x1365f0){var _0x5313d8=typeof _0x1943f9[_0x595f('0x19')]===_0x595f('0x1a')&&typeof _0x1943f9[_0x595f('0x1b')]==='undefined';var _0x201889=_0x1365f0[_0x595f('0x1c')];var _0x4ae274=_0x5313d8?0x0:_0x1943f9[_0x595f('0x19')];var _0x3b5e7d=_0x5313d8?_0x1365f0[_0x595f('0x1c')]:_0x1943f9['offset']+_0x1943f9[_0x595f('0x1b')];var _0x3c3827;if(_0x3b5e7d>=_0x201889){_0x3b5e7d=_0x201889;_0x3c3827=0xc8;}else{_0x3c3827=0xce;}_0x4d07a3[_0x595f('0x16')](_0x3c3827);return _0x4d07a3[_0x595f('0x1d')](_0x595f('0x1e'),_0x4ae274+'-'+_0x3b5e7d+'/'+_0x201889)['json'](_0x1365f0);}return null;};}function patchUpdates(_0x54ca18){return function(_0x54767d){try{jsonpatch[_0x595f('0x1f')](_0x54767d,_0x54ca18,!![]);}catch(_0x2f104a){return BPromise[_0x595f('0x20')](_0x2f104a);}return _0x54767d[_0x595f('0x21')]();};}function saveUpdates(_0x791782,_0xe6236c){return function(_0x5ad6c9){if(_0x5ad6c9){return _0x5ad6c9[_0x595f('0x22')](_0x791782)[_0x595f('0x23')](function(_0x4873ce){return _0x4873ce;});}return null;};}function removeEntity(_0x3919b6,_0x406778){return function(_0x4e3357){if(_0x4e3357){return _0x4e3357[_0x595f('0x24')]()['then'](function(){_0x3919b6[_0x595f('0x16')](0xcc)[_0x595f('0x17')]();});}};}function handleEntityNotFound(_0x1c6319,_0x29284c){return function(_0x527271){if(!_0x527271){_0x1c6319[_0x595f('0x15')](0x194);}return _0x527271;};}function handleError(_0x34b015,_0x572963){_0x572963=_0x572963||0x1f4;return function(_0x3a4c34){logger[_0x595f('0x25')](_0x3a4c34['stack']);if(_0x3a4c34[_0x595f('0x26')]){delete _0x3a4c34['name'];}_0x34b015[_0x595f('0x16')](_0x572963)[_0x595f('0x27')](_0x3a4c34);};}exports[_0x595f('0x28')]=function(_0x405bdc,_0x4650d3){var _0x26569d={},_0x2cde06={},_0x4e7d21={'count':0x0,'rows':[]};var _0x49e94b=_[_0x595f('0x29')](db[_0x595f('0x2a')][_0x595f('0x2b')],function(_0x4103eb){return{'name':_0x4103eb[_0x595f('0x2c')],'type':_0x4103eb['type'][_0x595f('0x2d')]};});_0x2cde06[_0x595f('0x2e')]=_[_0x595f('0x29')](_0x49e94b,_0x595f('0x26'));_0x2cde06[_0x595f('0x2f')]=_[_0x595f('0x30')](_0x405bdc[_0x595f('0x2f')]);_0x2cde06[_0x595f('0x31')]=_[_0x595f('0x32')](_0x2cde06[_0x595f('0x2e')],_0x2cde06['query']);_0x26569d[_0x595f('0x33')]=_[_0x595f('0x32')](_0x2cde06[_0x595f('0x2e')],qs[_0x595f('0x34')](_0x405bdc[_0x595f('0x2f')][_0x595f('0x34')]));_0x26569d['attributes']=_0x26569d[_0x595f('0x33')][_0x595f('0x35')]?_0x26569d[_0x595f('0x33')]:_0x2cde06[_0x595f('0x2e')];if(!_0x405bdc[_0x595f('0x2f')][_0x595f('0x36')](_0x595f('0x37'))){_0x26569d[_0x595f('0x1b')]=qs[_0x595f('0x1b')](_0x405bdc[_0x595f('0x2f')][_0x595f('0x1b')]);_0x26569d[_0x595f('0x19')]=qs[_0x595f('0x19')](_0x405bdc[_0x595f('0x2f')][_0x595f('0x19')]);}_0x26569d['order']=qs[_0x595f('0x38')](_0x405bdc['query'][_0x595f('0x38')]);_0x26569d[_0x595f('0x39')]=qs[_0x595f('0x31')](_[_0x595f('0x3a')](_0x405bdc[_0x595f('0x2f')],_0x2cde06[_0x595f('0x31')]),_0x49e94b);if(_0x405bdc[_0x595f('0x2f')][_0x595f('0x3b')]){_0x26569d['where']=_[_0x595f('0x3c')](_0x26569d[_0x595f('0x39')],{'$or':_[_0x595f('0x29')](_0x49e94b,function(_0x3909ed){if(_0x3909ed[_0x595f('0x3d')]!==_0x595f('0x3e')){var _0x2e07af={};_0x2e07af[_0x3909ed[_0x595f('0x26')]]={'$like':'%'+_0x405bdc[_0x595f('0x2f')][_0x595f('0x3b')]+'%'};return _0x2e07af;}})});}_0x26569d=_[_0x595f('0x3c')]({},_0x26569d,_0x405bdc[_0x595f('0x3f')]);var _0x477f1c={'where':_0x26569d[_0x595f('0x39')]};return db['JscriptySessionReport'][_0x595f('0x1c')](_0x477f1c)[_0x595f('0x23')](function(_0x2c7694){_0x4e7d21[_0x595f('0x1c')]=_0x2c7694;if(_0x405bdc[_0x595f('0x2f')][_0x595f('0x40')]){_0x26569d['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x595f('0x41')](_0x26569d);})[_0x595f('0x23')](function(_0x51a367){_0x4e7d21[_0x595f('0x42')]=_0x51a367;return _0x4e7d21;})[_0x595f('0x23')](respondWithFilteredResult(_0x4650d3,_0x26569d))['catch'](handleError(_0x4650d3,null));};exports['show']=function(_0x354ef7,_0x258ab1){var _0x2eb134={'raw':!![],'where':{'id':_0x354ef7['params']['id']}},_0x4f4801={};_0x4f4801[_0x595f('0x2e')]=_[_0x595f('0x30')](db[_0x595f('0x2a')]['rawAttributes']);_0x4f4801[_0x595f('0x2f')]=_[_0x595f('0x30')](_0x354ef7['query']);_0x4f4801[_0x595f('0x31')]=_[_0x595f('0x32')](_0x4f4801[_0x595f('0x2e')],_0x4f4801['query']);_0x2eb134[_0x595f('0x33')]=_[_0x595f('0x32')](_0x4f4801[_0x595f('0x2e')],qs['fields'](_0x354ef7[_0x595f('0x2f')][_0x595f('0x34')]));_0x2eb134[_0x595f('0x33')]=_0x2eb134[_0x595f('0x33')][_0x595f('0x35')]?_0x2eb134['attributes']:_0x4f4801['model'];if(_0x354ef7[_0x595f('0x2f')]['includeAll']){_0x2eb134[_0x595f('0x43')]=[{'all':!![]}];}_0x2eb134=_[_0x595f('0x3c')]({},_0x2eb134,_0x354ef7[_0x595f('0x3f')]);return db[_0x595f('0x2a')][_0x595f('0x44')](_0x2eb134)[_0x595f('0x23')](handleEntityNotFound(_0x258ab1,null))[_0x595f('0x23')](respondWithResult(_0x258ab1,null))[_0x595f('0x45')](handleError(_0x258ab1,null));};exports[_0x595f('0x46')]=function(_0x4985b9,_0x1e51da){return db[_0x595f('0x2a')][_0x595f('0x46')](_0x4985b9['body'],{})[_0x595f('0x23')](respondWithResult(_0x1e51da,0xc9))[_0x595f('0x45')](handleError(_0x1e51da,null));};exports[_0x595f('0x22')]=function(_0x493532,_0x3b0cd6){if(_0x493532['body']['id']){delete _0x493532['body']['id'];}return db[_0x595f('0x2a')][_0x595f('0x44')]({'where':{'id':_0x493532[_0x595f('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b0cd6,null))[_0x595f('0x23')](saveUpdates(_0x493532['body'],null))['then'](respondWithResult(_0x3b0cd6,null))[_0x595f('0x45')](handleError(_0x3b0cd6,null));};exports[_0x595f('0x24')]=function(_0x1602c,_0x50f318){return db['JscriptySessionReport'][_0x595f('0x44')]({'where':{'id':_0x1602c[_0x595f('0x47')]['id']}})[_0x595f('0x23')](handleEntityNotFound(_0x50f318,null))[_0x595f('0x23')](removeEntity(_0x50f318,null))[_0x595f('0x45')](handleError(_0x50f318,null));};exports['describe']=function(_0x4f280f,_0x193f68){return db[_0x595f('0x2a')][_0x595f('0x48')]()[_0x595f('0x23')](respondWithResult(_0x193f68,null))[_0x595f('0x45')](handleError(_0x193f68,null));};exports['getQuestions']=function(_0x58b3b5,_0x39079a,_0x5e41be){var _0x36c958={'raw':!![],'where':{}};var _0x340d89={};var _0x9da0fa={'count':0x0,'rows':[]};return db[_0x595f('0x2a')][_0x595f('0x49')]({'where':{'id':_0x58b3b5[_0x595f('0x47')]['id']}})[_0x595f('0x23')](handleEntityNotFound(_0x39079a,null))[_0x595f('0x23')](function(_0x5af4ff){if(_0x5af4ff){_0x340d89[_0x595f('0x2e')]=_[_0x595f('0x30')](db[_0x595f('0x4a')][_0x595f('0x2b')]);_0x340d89['query']=_[_0x595f('0x30')](_0x58b3b5[_0x595f('0x2f')]);_0x340d89['filters']=_[_0x595f('0x32')](_0x340d89[_0x595f('0x2e')],_0x340d89[_0x595f('0x2f')]);_0x36c958['attributes']=_['intersection'](_0x340d89[_0x595f('0x2e')],qs[_0x595f('0x34')](_0x58b3b5[_0x595f('0x2f')][_0x595f('0x34')]));_0x36c958[_0x595f('0x33')]=_0x36c958[_0x595f('0x33')][_0x595f('0x35')]?_0x36c958[_0x595f('0x33')]:_0x340d89['model'];if(!_0x58b3b5[_0x595f('0x2f')]['hasOwnProperty'](_0x595f('0x37'))){_0x36c958['limit']=qs[_0x595f('0x1b')](_0x58b3b5[_0x595f('0x2f')][_0x595f('0x1b')]);_0x36c958['offset']=qs['offset'](_0x58b3b5[_0x595f('0x2f')][_0x595f('0x19')]);}_0x36c958[_0x595f('0x4b')]=qs[_0x595f('0x38')](_0x58b3b5[_0x595f('0x2f')][_0x595f('0x38')]);_0x36c958['where']=qs[_0x595f('0x31')](_[_0x595f('0x3a')](_0x58b3b5['query'],_0x340d89['filters']));_0x36c958[_0x595f('0x39')][_0x595f('0x4c')]=_0x5af4ff['id'];if(_0x58b3b5['query'][_0x595f('0x3b')]){_0x36c958[_0x595f('0x39')]=_[_0x595f('0x3c')](_0x36c958[_0x595f('0x39')],{'$or':_[_0x595f('0x29')](_0x36c958[_0x595f('0x33')],function(_0x12ffca){var _0xc9fef6={};_0xc9fef6[_0x12ffca]={'$like':'%'+_0x58b3b5[_0x595f('0x2f')][_0x595f('0x3b')]+'%'};return _0xc9fef6;})});}_0x36c958=_[_0x595f('0x3c')]({},_0x36c958,_0x58b3b5[_0x595f('0x3f')]);return db['JscriptyQuestionReport'][_0x595f('0x1c')]({'where':_0x36c958[_0x595f('0x39')]})[_0x595f('0x23')](function(_0x496d37){_0x9da0fa['count']=_0x496d37;if(_0x58b3b5[_0x595f('0x2f')][_0x595f('0x40')]){_0x36c958['include']=[{'all':!![]}];}return db[_0x595f('0x4a')][_0x595f('0x41')](_0x36c958);})[_0x595f('0x23')](function(_0x18027e){_0x9da0fa[_0x595f('0x42')]=_0x18027e;return _0x9da0fa;});}})[_0x595f('0x23')](respondWithFilteredResult(_0x39079a,_0x36c958))[_0x595f('0x45')](handleError(_0x39079a,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 595d45b..de3722b 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 _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions'];(function(_0xbc4f83,_0x3dd7a5){var _0x45b2b9=function(_0x153736){while(--_0x153736){_0xbc4f83['push'](_0xbc4f83['shift']());}};_0x45b2b9(++_0x3dd7a5);}(_0x1261,0x144));var _0x1126=function(_0x49e66,_0x43f4b9){_0x49e66=_0x49e66-0x0;var _0x545549=_0x1261[_0x49e66];return _0x545549;};'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')]('JscriptySessionReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c6c=['rimraf','../../config/environment','exports','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x37aa5e,_0x496b85){_0x37aa5e=_0x37aa5e-0x0;var _0x516b9b=_0x3c6c[_0x37aa5e];return _0x516b9b;};'use strict';var _=require(_0xc3c6('0x0'));var util=require('util');var logger=require(_0xc3c6('0x1'))(_0xc3c6('0x2'));var moment=require(_0xc3c6('0x3'));var BPromise=require(_0xc3c6('0x4'));var rp=require(_0xc3c6('0x5'));var fs=require('fs');var path=require(_0xc3c6('0x6'));var rimraf=require(_0xc3c6('0x7'));var config=require(_0xc3c6('0x8'));var attributes=require('./jscriptySessionReport.attributes');module[_0xc3c6('0x9')]=function(_0x4a2ca1,_0xe7731e){return _0x4a2ca1['define']('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 5bf3f41..15ddbc1 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 _0x57ca=['client','http','request','info','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x53b1ff,_0x67e441){var _0x35e8d6=function(_0x55b32e){while(--_0x55b32e){_0x53b1ff['push'](_0x53b1ff['shift']());}};_0x35e8d6(++_0x67e441);}(_0x57ca,0x108));var _0xa57c=function(_0x35d670,_0x488073){_0x35d670=_0x35d670-0x0;var _0x1d7c70=_0x57ca[_0x35d670];return _0x1d7c70;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file +var _0x0295=['client','http','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3e4251,_0x866cc5){var _0x19d93c=function(_0x158385){while(--_0x158385){_0x3e4251['push'](_0x3e4251['shift']());}};_0x19d93c(++_0x866cc5);}(_0x0295,0x1f0));var _0x5029=function(_0x4eb517,_0x385479){_0x4eb517=_0x4eb517-0x0;var _0x30e9ed=_0x0295[_0x4eb517];return _0x30e9ed;};'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')]('JscriptySessionReport,\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);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index bd07100..0c4f05b 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 _0x2966=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','put','/:id','isAuthenticated','update','get','/download_log_file','exports','multer','util','path'];(function(_0x1c3201,_0x1d9096){var _0x48c535=function(_0x12511b){while(--_0x12511b){_0x1c3201['push'](_0x1c3201['shift']());}};_0x48c535(++_0x1d9096);}(_0x2966,0x151));var _0x6296=function(_0x95c81b,_0x538cd2){_0x95c81b=_0x95c81b-0x0;var _0x5dd811=_0x2966[_0x95c81b];return _0x5dd811;};'use strict';var multer=require(_0x6296('0x0'));var util=require(_0x6296('0x1'));var path=require(_0x6296('0x2'));var timeout=require(_0x6296('0x3'));var express=require(_0x6296('0x4'));var router=express['Router']();var fs_extra=require(_0x6296('0x5'));var auth=require(_0x6296('0x6'));var interaction=require(_0x6296('0x7'));var config=require(_0x6296('0x8'));var controller=require(_0x6296('0x9'));router['get']('/',controller['index']);router[_0x6296('0xa')](_0x6296('0xb'),auth[_0x6296('0xc')](),controller[_0x6296('0xd')]);router[_0x6296('0xe')](_0x6296('0xf'),auth[_0x6296('0xc')](),controller['downloadLogFile']);module[_0x6296('0x10')]=router; \ No newline at end of file +var _0xc4f4=['../../components/interaction/service','./license.controller','get','index','put','/:id','/download_log_file','isAuthenticated','downloadLogFile','util','express','fs-extra','../../components/auth/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc4f4,0x127));var _0x4c4f=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xc4f4[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0x4c4f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4c4f('0x1'));var router=express['Router']();var fs_extra=require(_0x4c4f('0x2'));var auth=require(_0x4c4f('0x3'));var interaction=require(_0x4c4f('0x4'));var config=require('../../config/environment');var controller=require(_0x4c4f('0x5'));router[_0x4c4f('0x6')]('/',controller[_0x4c4f('0x7')]);router[_0x4c4f('0x8')](_0x4c4f('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x4c4f('0x6')](_0x4c4f('0xa'),auth[_0x4c4f('0xb')](),controller[_0x4c4f('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 6f9e1cf..b79f9eb 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 _0x872d=['INTEGER','sequelize','STRING'];(function(_0x556e0f,_0x3d950c){var _0x5540c1=function(_0x34269e){while(--_0x34269e){_0x556e0f['push'](_0x556e0f['shift']());}};_0x5540c1(++_0x3d950c);}(_0x872d,0xe8));var _0xd872=function(_0x3b6927,_0x2d15e2){_0x3b6927=_0x3b6927-0x0;var _0x3d83a3=_0x872d[_0x3b6927];return _0x3d83a3;};'use strict';var Sequelize=require(_0xd872('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xd872('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xd872('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x372b=['TEXT','STRING','INTEGER','exports'];(function(_0x581ac9,_0x2ba02a){var _0x19601c=function(_0x2f0d0c){while(--_0x2f0d0c){_0x581ac9['push'](_0x581ac9['shift']());}};_0x19601c(++_0x2ba02a);}(_0x372b,0x77));var _0xb372=function(_0x53277d,_0x13dc5d){_0x53277d=_0x53277d-0x0;var _0x555cd0=_0x372b[_0x53277d];return _0x555cd0;};'use strict';var Sequelize=require('sequelize');module[_0xb372('0x0')]={'license':{'type':Sequelize[_0xb372('0x1')]},'data1':{'type':Sequelize[_0xb372('0x2')]},'data2':{'type':Sequelize[_0xb372('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xb372('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index e75b06d..206e53d 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 _0x449c=['save','update','destroy','then','end','error','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','attributes','fields','length','options','getLicense','find','params','get','body','key','demo','downloadLogFile','license-info.log','join','/var','xcally','Content-disposition','attachment;\x20filename=','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x449c,0x171));var _0xc449=function(_0x396dd0,_0x72023c){_0x396dd0=_0x396dd0-0x0;var _0x288f63=_0x449c[_0x396dd0];return _0x288f63;};'use strict';var emlformat=require(_0xc449('0x0'));var rimraf=require(_0xc449('0x1'));var zipdir=require(_0xc449('0x2'));var jsonpatch=require(_0xc449('0x3'));var rp=require(_0xc449('0x4'));var moment=require(_0xc449('0x5'));var BPromise=require(_0xc449('0x6'));var Mustache=require('mustache');var util=require(_0xc449('0x7'));var path=require(_0xc449('0x8'));var sox=require('sox');var csv=require(_0xc449('0x9'));var ejs=require(_0xc449('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc449('0xb'));var crypto=require(_0xc449('0xc'));var jsforce=require(_0xc449('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc449('0x9'));var querystring=require(_0xc449('0xe'));var Papa=require(_0xc449('0xf'));var Redis=require(_0xc449('0x10'));var authService=require(_0xc449('0x11'));var qs=require(_0xc449('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc449('0x13'));var logger=require(_0xc449('0x14'))(_0xc449('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d2f1e,_0x2f1942){_0x2f1942=_0x2f1942||0xcc;return function(_0x19f549){if(_0x19f549){return _0x3d2f1e[_0xc449('0x16')](_0x2f1942);}return _0x3d2f1e['status'](_0x2f1942)['end']();};}function respondWithResult(_0x1a96a5,_0x3a574c){_0x3a574c=_0x3a574c||0xc8;return function(_0x5c4ab9){if(_0x5c4ab9){return _0x1a96a5[_0xc449('0x17')](_0x3a574c)[_0xc449('0x18')](_0x5c4ab9);}};}function respondWithFilteredResult(_0x4a8fcc,_0x204ba9){return function(_0x27b130){if(_0x27b130){var _0x13087a=typeof _0x204ba9[_0xc449('0x19')]===_0xc449('0x1a')&&typeof _0x204ba9[_0xc449('0x1b')]===_0xc449('0x1a');var _0x47ac67=_0x27b130[_0xc449('0x1c')];var _0x380044=_0x13087a?0x0:_0x204ba9['offset'];var _0x82ef42=_0x13087a?_0x27b130[_0xc449('0x1c')]:_0x204ba9[_0xc449('0x19')]+_0x204ba9[_0xc449('0x1b')];var _0x5dac84;if(_0x82ef42>=_0x47ac67){_0x82ef42=_0x47ac67;_0x5dac84=0xc8;}else{_0x5dac84=0xce;}_0x4a8fcc[_0xc449('0x17')](_0x5dac84);return _0x4a8fcc[_0xc449('0x1d')](_0xc449('0x1e'),_0x380044+'-'+_0x82ef42+'/'+_0x47ac67)[_0xc449('0x18')](_0x27b130);}return null;};}function patchUpdates(_0x402726){return function(_0x37c4d3){try{jsonpatch[_0xc449('0x1f')](_0x37c4d3,_0x402726,!![]);}catch(_0x3c36ac){return BPromise[_0xc449('0x20')](_0x3c36ac);}return _0x37c4d3[_0xc449('0x21')]();};}function saveUpdates(_0xfdd103,_0x581455){return function(_0x252fae){if(_0x252fae){return _0x252fae[_0xc449('0x22')](_0xfdd103)['then'](function(_0x5d225b){return _0x5d225b;});}return null;};}function removeEntity(_0x346230,_0x2ab50e){return function(_0xa9e9c7){if(_0xa9e9c7){return _0xa9e9c7[_0xc449('0x23')]()[_0xc449('0x24')](function(){_0x346230[_0xc449('0x17')](0xcc)[_0xc449('0x25')]();});}};}function handleEntityNotFound(_0x17fca2,_0x4018af){return function(_0x56cd24){if(!_0x56cd24){_0x17fca2[_0xc449('0x16')](0x194);}return _0x56cd24;};}function handleError(_0x20e239,_0xc1121a){_0xc1121a=_0xc1121a||0x1f4;return function(_0xd762c8){logger[_0xc449('0x26')](_0xd762c8['stack']);if(_0xd762c8[_0xc449('0x27')]){delete _0xd762c8[_0xc449('0x27')];}_0x20e239['status'](_0xc1121a)[_0xc449('0x28')](_0xd762c8);};}var utilLicense=require(_0xc449('0x29'));exports[_0xc449('0x2a')]=function(_0x2cffb0,_0x3dcb1c){var _0xe3f427={'raw':!![],'where':{'id':0x1}},_0x3fcc41={};_0x3fcc41[_0xc449('0x2b')]=_[_0xc449('0x2c')](db[_0xc449('0x2d')][_0xc449('0x2e')]);_0x3fcc41['query']=_[_0xc449('0x2c')](_0x2cffb0[_0xc449('0x2f')]);_0x3fcc41[_0xc449('0x30')]=_['intersection'](_0x3fcc41[_0xc449('0x2b')],_0x3fcc41[_0xc449('0x2f')]);_0xe3f427[_0xc449('0x31')]=_['intersection'](_0x3fcc41[_0xc449('0x2b')],qs[_0xc449('0x32')](_0x2cffb0[_0xc449('0x2f')][_0xc449('0x32')]));_0xe3f427['attributes']=_0xe3f427[_0xc449('0x31')][_0xc449('0x33')]?_0xe3f427[_0xc449('0x31')]:_0x3fcc41[_0xc449('0x2b')];_0xe3f427=_['merge']({},_0xe3f427,_0x2cffb0[_0xc449('0x34')]);return utilLicense[_0xc449('0x35')](_0xe3f427)[_0xc449('0x24')](respondWithResult(_0x3dcb1c,null))['catch'](handleError(_0x3dcb1c,null));};exports[_0xc449('0x22')]=function(_0x4a4d62,_0x5841f0){if(_0x4a4d62['body']['id']){delete _0x4a4d62['body']['id'];}return db[_0xc449('0x2d')][_0xc449('0x36')]({'where':{'id':_0x4a4d62[_0xc449('0x37')]['id']}})[_0xc449('0x24')](handleEntityNotFound(_0x5841f0,null))[_0xc449('0x24')](function(_0x36b126){var _0x38d344=_0x36b126[_0xc449('0x38')]({'plain':!![]});return utilLicense['checkLicense'](_0x38d344,_0x4a4d62[_0xc449('0x39')][_0xc449('0x3a')]);})['then'](function(_0x2a02d5){if(!_0x2a02d5[_0xc449('0x3b')]){return saveUpdates(_0x4a4d62['body'],null);}return _0x2a02d5;})[_0xc449('0x24')](respondWithResult(_0x5841f0,null))['catch'](handleError(_0x5841f0,null));};exports[_0xc449('0x3c')]=function(_0x2a928c,_0x4cdb66){var _0x5225c0=_0xc449('0x3d');var _0x5d95ea=path[_0xc449('0x3e')](_0xc449('0x3f'),'log',_0xc449('0x40'),_0x5225c0);_0x4cdb66['setHeader'](_0xc449('0x41'),_0xc449('0x42')+_0x5225c0);_0x4cdb66['set']('Content-Type','text/plain');_0x4cdb66['download'](_0x5d95ea);}; \ No newline at end of file +var _0x393f=['Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','error','stack','name','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','body','params','checkLicense','key','demo','catch','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader'];(function(_0x4081f1,_0x3a6c9b){var _0xc6848b=function(_0x3a0723){while(--_0x3a0723){_0x4081f1['push'](_0x4081f1['shift']());}};_0xc6848b(++_0x3a6c9b);}(_0x393f,0x95));var _0xf393=function(_0x2ea472,_0x2d6324){_0x2ea472=_0x2ea472-0x0;var _0x257c66=_0x393f[_0x2ea472];return _0x257c66;};'use strict';var emlformat=require(_0xf393('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf393('0x1'));var jsonpatch=require(_0xf393('0x2'));var rp=require(_0xf393('0x3'));var moment=require(_0xf393('0x4'));var BPromise=require(_0xf393('0x5'));var Mustache=require(_0xf393('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf393('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf393('0x8'));var _=require(_0xf393('0x9'));var squel=require(_0xf393('0xa'));var crypto=require(_0xf393('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf393('0xc'));var toCsv=require(_0xf393('0xd'));var querystring=require(_0xf393('0xe'));var Papa=require(_0xf393('0xf'));var Redis=require(_0xf393('0x10'));var authService=require(_0xf393('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf393('0x12'));var hardwareService=require(_0xf393('0x13'));var logger=require(_0xf393('0x14'))(_0xf393('0x15'));var utils=require('../../config/utils');var config=require(_0xf393('0x16'));var licenseUtil=require(_0xf393('0x17'));var db=require(_0xf393('0x18'))['db'];function respondWithStatusCode(_0x3b7b8a,_0x321847){_0x321847=_0x321847||0xcc;return function(_0x257f73){if(_0x257f73){return _0x3b7b8a[_0xf393('0x19')](_0x321847);}return _0x3b7b8a[_0xf393('0x1a')](_0x321847)[_0xf393('0x1b')]();};}function respondWithResult(_0x853229,_0x28c564){_0x28c564=_0x28c564||0xc8;return function(_0x13761b){if(_0x13761b){return _0x853229[_0xf393('0x1a')](_0x28c564)[_0xf393('0x1c')](_0x13761b);}};}function respondWithFilteredResult(_0x45a4eb,_0x1996f1){return function(_0x50f962){if(_0x50f962){var _0x59104a=typeof _0x1996f1[_0xf393('0x1d')]===_0xf393('0x1e')&&typeof _0x1996f1[_0xf393('0x1f')]===_0xf393('0x1e');var _0x1ea67b=_0x50f962[_0xf393('0x20')];var _0x23f663=_0x59104a?0x0:_0x1996f1[_0xf393('0x1d')];var _0xc7dafb=_0x59104a?_0x50f962['count']:_0x1996f1[_0xf393('0x1d')]+_0x1996f1[_0xf393('0x1f')];var _0x224c43;if(_0xc7dafb>=_0x1ea67b){_0xc7dafb=_0x1ea67b;_0x224c43=0xc8;}else{_0x224c43=0xce;}_0x45a4eb['status'](_0x224c43);return _0x45a4eb[_0xf393('0x21')]('Content-Range',_0x23f663+'-'+_0xc7dafb+'/'+_0x1ea67b)[_0xf393('0x1c')](_0x50f962);}return null;};}function patchUpdates(_0x522314){return function(_0x3f7161){try{jsonpatch[_0xf393('0x22')](_0x3f7161,_0x522314,!![]);}catch(_0x21cf66){return BPromise[_0xf393('0x23')](_0x21cf66);}return _0x3f7161['save']();};}function saveUpdates(_0x24736b,_0x218384){return function(_0x98612b){if(_0x98612b){return _0x98612b[_0xf393('0x24')](_0x24736b)['then'](function(_0x19e320){return _0x19e320;});}return null;};}function removeEntity(_0x435a08,_0x3dd56b){return function(_0x394a11){if(_0x394a11){return _0x394a11[_0xf393('0x25')]()[_0xf393('0x26')](function(){_0x435a08['status'](0xcc)[_0xf393('0x1b')]();});}};}function handleEntityNotFound(_0x29b762,_0x5c9ee3){return function(_0x405f33){if(!_0x405f33){_0x29b762[_0xf393('0x19')](0x194);}return _0x405f33;};}function handleError(_0x275e69,_0x2fabfa){_0x2fabfa=_0x2fabfa||0x1f4;return function(_0x446d9b){logger[_0xf393('0x27')](_0x446d9b[_0xf393('0x28')]);if(_0x446d9b[_0xf393('0x29')]){delete _0x446d9b[_0xf393('0x29')];}_0x275e69['status'](_0x2fabfa)['send'](_0x446d9b);};}var utilLicense=require(_0xf393('0x17'));exports[_0xf393('0x2a')]=function(_0x1bab8a,_0x21702b){var _0x32aef5={'raw':!![],'where':{'id':0x1}},_0x4ecf47={};_0x4ecf47[_0xf393('0x2b')]=_[_0xf393('0x2c')](db['License'][_0xf393('0x2d')]);_0x4ecf47['query']=_[_0xf393('0x2c')](_0x1bab8a[_0xf393('0x2e')]);_0x4ecf47[_0xf393('0x2f')]=_[_0xf393('0x30')](_0x4ecf47[_0xf393('0x2b')],_0x4ecf47['query']);_0x32aef5[_0xf393('0x31')]=_[_0xf393('0x30')](_0x4ecf47[_0xf393('0x2b')],qs[_0xf393('0x32')](_0x1bab8a[_0xf393('0x2e')][_0xf393('0x32')]));_0x32aef5[_0xf393('0x31')]=_0x32aef5[_0xf393('0x31')][_0xf393('0x33')]?_0x32aef5[_0xf393('0x31')]:_0x4ecf47[_0xf393('0x2b')];_0x32aef5=_[_0xf393('0x34')]({},_0x32aef5,_0x1bab8a[_0xf393('0x35')]);return utilLicense['getLicense'](_0x32aef5)[_0xf393('0x26')](respondWithResult(_0x21702b,null))['catch'](handleError(_0x21702b,null));};exports[_0xf393('0x24')]=function(_0x3ff00b,_0x479846){if(_0x3ff00b[_0xf393('0x36')]['id']){delete _0x3ff00b[_0xf393('0x36')]['id'];}return db['License']['find']({'where':{'id':_0x3ff00b[_0xf393('0x37')]['id']}})[_0xf393('0x26')](handleEntityNotFound(_0x479846,null))[_0xf393('0x26')](function(_0x569e66){var _0x2fce91=_0x569e66['get']({'plain':!![]});return utilLicense[_0xf393('0x38')](_0x2fce91,_0x3ff00b['body'][_0xf393('0x39')]);})[_0xf393('0x26')](function(_0x2f68b3){if(!_0x2f68b3[_0xf393('0x3a')]){return saveUpdates(_0x3ff00b[_0xf393('0x36')],null);}return _0x2f68b3;})[_0xf393('0x26')](respondWithResult(_0x479846,null))[_0xf393('0x3b')](handleError(_0x479846,null));};exports[_0xf393('0x3c')]=function(_0x464c89,_0x31433b){var _0x5d7341=_0xf393('0x3d');var _0x542192=path[_0xf393('0x3e')](_0xf393('0x3f'),_0xf393('0x40'),_0xf393('0x41'),_0x5d7341);_0x31433b[_0xf393('0x42')](_0xf393('0x43'),_0xf393('0x44')+_0x5d7341);_0x31433b['set'](_0xf393('0x45'),_0xf393('0x46'));_0x31433b[_0xf393('0x47')](_0x542192);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 1aab879..3c423e1 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 _0x37fa=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','License','util'];(function(_0x4f3242,_0x391954){var _0x49844f=function(_0x5ee033){while(--_0x5ee033){_0x4f3242['push'](_0x4f3242['shift']());}};_0x49844f(++_0x391954);}(_0x37fa,0x77));var _0xa37f=function(_0x1cc961,_0x2c42ee){_0x1cc961=_0x1cc961-0x0;var _0x471d86=_0x37fa[_0x1cc961];return _0x471d86;};'use strict';var _=require('lodash');var util=require(_0xa37f('0x0'));var logger=require(_0xa37f('0x1'))(_0xa37f('0x2'));var moment=require('moment');var BPromise=require(_0xa37f('0x3'));var rp=require(_0xa37f('0x4'));var fs=require('fs');var path=require(_0xa37f('0x5'));var rimraf=require(_0xa37f('0x6'));var config=require(_0xa37f('0x7'));var attributes=require(_0xa37f('0x8'));module['exports']=function(_0x150fa8,_0x21443c){return _0x150fa8['define'](_0xa37f('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda5b=['../../config/environment','./license.attributes','exports','define','License','license','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x11e000,_0x12a8e5){var _0x110c27=function(_0x10d468){while(--_0x10d468){_0x11e000['push'](_0x11e000['shift']());}};_0x110c27(++_0x12a8e5);}(_0xda5b,0x1d4));var _0xbda5=function(_0x3f9602,_0x115411){_0x3f9602=_0x3f9602-0x0;var _0xb22e48=_0xda5b[_0x3f9602];return _0xb22e48;};'use strict';var _=require(_0xbda5('0x0'));var util=require(_0xbda5('0x1'));var logger=require(_0xbda5('0x2'))(_0xbda5('0x3'));var moment=require(_0xbda5('0x4'));var BPromise=require('bluebird');var rp=require(_0xbda5('0x5'));var fs=require('fs');var path=require(_0xbda5('0x6'));var rimraf=require(_0xbda5('0x7'));var config=require(_0xbda5('0x8'));var attributes=require(_0xbda5('0x9'));module[_0xbda5('0xa')]=function(_0x2ffdd5,_0x43f93c){return _0x2ffdd5[_0xbda5('0xb')](_0xbda5('0xc'),attributes,{'tableName':_0xbda5('0xd'),'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 c4d68c3..5beffc7 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 _0x4db8=['stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x299b8f,_0x2b58ea){var _0x3394f9=function(_0x53c4be){while(--_0x53c4be){_0x299b8f['push'](_0x299b8f['shift']());}};_0x3394f9(++_0x2b58ea);}(_0x4db8,0xa7));var _0x84db=function(_0x31593e,_0x50145a){_0x31593e=_0x31593e-0x0;var _0x3eab06=_0x4db8[_0x31593e];return _0x3eab06;};'use strict';var _=require(_0x84db('0x0'));var util=require(_0x84db('0x1'));var moment=require(_0x84db('0x2'));var BPromise=require('bluebird');var rs=require(_0x84db('0x3'));var fs=require('fs');var Redis=require(_0x84db('0x4'));var db=require(_0x84db('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x84db('0x6'))(_0x84db('0x7'));var config=require(_0x84db('0x8'));var jayson=require(_0x84db('0x9'));var client=jayson['client'][_0x84db('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e740,_0x293c71,_0x58fce5){return new BPromise(function(_0x5edcce,_0x52f599){return client[_0x84db('0xb')](_0x45e740,_0x58fce5)[_0x84db('0xc')](function(_0xe9b9de){logger[_0x84db('0xd')](_0x84db('0xe'),_0x293c71,'request\x20sent');logger[_0x84db('0xf')]('License,\x20%s,\x20%s,\x20%s',_0x293c71,_0x84db('0x10'),JSON[_0x84db('0x11')](_0xe9b9de));if(_0xe9b9de[_0x84db('0x12')]){if(_0xe9b9de[_0x84db('0x12')][_0x84db('0x13')]===0x1f4){logger['error'](_0x84db('0xe'),_0x293c71,_0xe9b9de[_0x84db('0x12')][_0x84db('0x14')]);return _0x52f599(_0xe9b9de[_0x84db('0x12')][_0x84db('0x14')]);}logger[_0x84db('0x12')](_0x84db('0xe'),_0x293c71,_0xe9b9de[_0x84db('0x12')]['message']);return _0x5edcce(_0xe9b9de[_0x84db('0x12')]['message']);}else{logger['info'](_0x84db('0xe'),_0x293c71,_0x84db('0x10'));_0x5edcce(_0xe9b9de[_0x84db('0x15')][_0x84db('0x14')]);}})[_0x84db('0x16')](function(_0x87e028){logger[_0x84db('0x12')](_0x84db('0xe'),_0x293c71,_0x87e028);_0x52f599(_0x87e028);});});} \ No newline at end of file +var _0xce5b=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2b37a4,_0x1fb0f9){var _0x52d915=function(_0x18be7d){while(--_0x18be7d){_0x2b37a4['push'](_0x2b37a4['shift']());}};_0x52d915(++_0x1fb0f9);}(_0xce5b,0xf0));var _0xbce5=function(_0x58ec0e,_0x4f996b){_0x58ec0e=_0x58ec0e-0x0;var _0x31818c=_0xce5b[_0x58ec0e];return _0x31818c;};'use strict';var _=require(_0xbce5('0x0'));var util=require(_0xbce5('0x1'));var moment=require('moment');var BPromise=require(_0xbce5('0x2'));var rs=require(_0xbce5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbce5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbce5('0x5'))(_0xbce5('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbce5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb00248,_0x4954bd,_0x5ad03d){return new BPromise(function(_0x302bd5,_0x52b5e9){return client[_0xbce5('0x8')](_0xb00248,_0x5ad03d)[_0xbce5('0x9')](function(_0x310d6f){logger[_0xbce5('0xa')](_0xbce5('0xb'),_0x4954bd,_0xbce5('0xc'));logger[_0xbce5('0xd')](_0xbce5('0xe'),_0x4954bd,_0xbce5('0xc'),JSON[_0xbce5('0xf')](_0x310d6f));if(_0x310d6f[_0xbce5('0x10')]){if(_0x310d6f['error'][_0xbce5('0x11')]===0x1f4){logger[_0xbce5('0x10')](_0xbce5('0xb'),_0x4954bd,_0x310d6f[_0xbce5('0x10')][_0xbce5('0x12')]);return _0x52b5e9(_0x310d6f[_0xbce5('0x10')][_0xbce5('0x12')]);}logger[_0xbce5('0x10')](_0xbce5('0xb'),_0x4954bd,_0x310d6f['error'][_0xbce5('0x12')]);return _0x302bd5(_0x310d6f[_0xbce5('0x10')]['message']);}else{logger[_0xbce5('0xa')]('License,\x20%s,\x20%s',_0x4954bd,_0xbce5('0xc'));_0x302bd5(_0x310d6f[_0xbce5('0x13')][_0xbce5('0x12')]);}})['catch'](function(_0x565d69){logger['error']('License,\x20%s,\x20%s',_0x4954bd,_0x565d69);_0x52b5e9(_0x565d69);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 4f97ce6..97a2bdf 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 _0x93c2=['post','addDisposition','addAnswer','create','/:id/in_servers','addImap','addInteraction','addApplications','/:id/send','/:id/users','addAgents','put','update','removeDispositions','delete','removeSmtp','removeAgents','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','/:id/messages','/:id/verify','verifySmtp','getAgents'];(function(_0x1216d2,_0x50dda4){var _0xf213e2=function(_0x10a974){while(--_0x10a974){_0x1216d2['push'](_0x1216d2['shift']());}};_0xf213e2(++_0x50dda4);}(_0x93c2,0x182));var _0x293c=function(_0x516185,_0x129824){_0x516185=_0x516185-0x0;var _0x23f956=_0x93c2[_0x516185];return _0x23f956;};'use strict';var multer=require(_0x293c('0x0'));var util=require(_0x293c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x293c('0x2'));var router=express['Router']();var fs_extra=require(_0x293c('0x3'));var auth=require(_0x293c('0x4'));var interaction=require(_0x293c('0x5'));var config=require(_0x293c('0x6'));var controller=require(_0x293c('0x7'));router[_0x293c('0x8')]('/',auth[_0x293c('0x9')](),controller[_0x293c('0xa')]);router['get'](_0x293c('0xb'),auth['isAuthenticated'](),controller[_0x293c('0xc')]);router['get'](_0x293c('0xd'),auth[_0x293c('0x9')](),controller[_0x293c('0xe')]);router[_0x293c('0x8')](_0x293c('0xf'),auth['isAuthenticated'](),controller[_0x293c('0x10')]);router[_0x293c('0x8')](_0x293c('0x11'),auth[_0x293c('0x9')](),controller[_0x293c('0x12')]);router['get']('/:id/in_servers',auth[_0x293c('0x9')](),controller[_0x293c('0x13')]);router[_0x293c('0x8')](_0x293c('0x14'),auth[_0x293c('0x9')](),controller[_0x293c('0x15')]);router[_0x293c('0x8')](_0x293c('0x16'),auth[_0x293c('0x9')](),controller['getInteractions']);router[_0x293c('0x8')](_0x293c('0x17'),auth[_0x293c('0x9')](),controller['getApplications']);router[_0x293c('0x8')](_0x293c('0x18'),auth[_0x293c('0x9')](),controller['getMessages']);router[_0x293c('0x8')](_0x293c('0x19'),auth['isAuthenticated'](),controller[_0x293c('0x1a')]);router[_0x293c('0x8')]('/:id/users',auth[_0x293c('0x9')](),controller[_0x293c('0x1b')]);router[_0x293c('0x1c')]('/:id/dispositions',auth[_0x293c('0x9')](),controller[_0x293c('0x1d')]);router[_0x293c('0x1c')](_0x293c('0x11'),auth[_0x293c('0x9')](),controller[_0x293c('0x1e')]);router[_0x293c('0x1c')]('/',auth['isAuthenticated'](),controller[_0x293c('0x1f')]);router[_0x293c('0x1c')](_0x293c('0x20'),auth[_0x293c('0x9')](),controller[_0x293c('0x21')]);router[_0x293c('0x1c')](_0x293c('0x14'),auth[_0x293c('0x9')](),controller['addSmtp']);router['post'](_0x293c('0x16'),auth['isAuthenticated'](),controller[_0x293c('0x22')]);router['post'](_0x293c('0x17'),auth[_0x293c('0x9')](),controller[_0x293c('0x23')]);router[_0x293c('0x1c')](_0x293c('0x24'),auth[_0x293c('0x9')](),controller['send']);router[_0x293c('0x1c')](_0x293c('0x25'),auth[_0x293c('0x9')](),controller[_0x293c('0x26')]);router[_0x293c('0x27')]('/:id',auth['isAuthenticated'](),controller[_0x293c('0x28')]);router['delete'](_0x293c('0xf'),auth['isAuthenticated'](),controller[_0x293c('0x29')]);router[_0x293c('0x2a')](_0x293c('0x11'),auth[_0x293c('0x9')](),controller['removeAnswers']);router['delete'](_0x293c('0x20'),auth[_0x293c('0x9')](),controller['removeImap']);router[_0x293c('0x2a')](_0x293c('0x14'),auth[_0x293c('0x9')](),controller[_0x293c('0x2b')]);router[_0x293c('0x2a')](_0x293c('0xd'),auth[_0x293c('0x9')](),controller['destroy']);router[_0x293c('0x2a')](_0x293c('0x25'),auth[_0x293c('0x9')](),controller[_0x293c('0x2c')]);module[_0x293c('0x2d')]=router; \ No newline at end of file +var _0x8537=['getInteractions','/:id/applications','getApplications','verifySmtp','/:id/users','getAgents','addDisposition','addAnswer','post','addImap','addSmtp','addInteraction','addApplications','send','addAgents','put','update','delete','removeAnswers','removeImap','removeSmtp','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','/:id/interactions'];(function(_0x13ac95,_0x52c26e){var _0x59676a=function(_0x3416c7){while(--_0x3416c7){_0x13ac95['push'](_0x13ac95['shift']());}};_0x59676a(++_0x52c26e);}(_0x8537,0x1c5));var _0x7853=function(_0x392cc2,_0x15ac7e){_0x392cc2=_0x392cc2-0x0;var _0x175778=_0x8537[_0x392cc2];return _0x175778;};'use strict';var multer=require(_0x7853('0x0'));var util=require(_0x7853('0x1'));var path=require(_0x7853('0x2'));var timeout=require(_0x7853('0x3'));var express=require(_0x7853('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7853('0x5'));var config=require(_0x7853('0x6'));var controller=require(_0x7853('0x7'));router[_0x7853('0x8')]('/',auth[_0x7853('0x9')](),controller[_0x7853('0xa')]);router[_0x7853('0x8')]('/describe',auth[_0x7853('0x9')](),controller[_0x7853('0xb')]);router[_0x7853('0x8')](_0x7853('0xc'),auth['isAuthenticated'](),controller[_0x7853('0xd')]);router[_0x7853('0x8')](_0x7853('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x7853('0x8')](_0x7853('0xf'),auth['isAuthenticated'](),controller[_0x7853('0x10')]);router[_0x7853('0x8')](_0x7853('0x11'),auth['isAuthenticated'](),controller['getImap']);router[_0x7853('0x8')](_0x7853('0x12'),auth[_0x7853('0x9')](),controller['getSmtp']);router[_0x7853('0x8')](_0x7853('0x13'),auth[_0x7853('0x9')](),controller[_0x7853('0x14')]);router[_0x7853('0x8')](_0x7853('0x15'),auth['isAuthenticated'](),controller[_0x7853('0x16')]);router[_0x7853('0x8')]('/:id/messages',auth[_0x7853('0x9')](),controller['getMessages']);router['get']('/:id/verify',auth[_0x7853('0x9')](),controller[_0x7853('0x17')]);router[_0x7853('0x8')](_0x7853('0x18'),auth[_0x7853('0x9')](),controller[_0x7853('0x19')]);router['post'](_0x7853('0xe'),auth[_0x7853('0x9')](),controller[_0x7853('0x1a')]);router['post'](_0x7853('0xf'),auth['isAuthenticated'](),controller[_0x7853('0x1b')]);router[_0x7853('0x1c')]('/',auth[_0x7853('0x9')](),controller['create']);router[_0x7853('0x1c')](_0x7853('0x11'),auth['isAuthenticated'](),controller[_0x7853('0x1d')]);router[_0x7853('0x1c')](_0x7853('0x12'),auth[_0x7853('0x9')](),controller[_0x7853('0x1e')]);router[_0x7853('0x1c')]('/:id/interactions',auth[_0x7853('0x9')](),controller[_0x7853('0x1f')]);router['post'](_0x7853('0x15'),auth[_0x7853('0x9')](),controller[_0x7853('0x20')]);router[_0x7853('0x1c')]('/:id/send',auth['isAuthenticated'](),controller[_0x7853('0x21')]);router[_0x7853('0x1c')](_0x7853('0x18'),auth['isAuthenticated'](),controller[_0x7853('0x22')]);router[_0x7853('0x23')]('/:id',auth['isAuthenticated'](),controller[_0x7853('0x24')]);router[_0x7853('0x25')](_0x7853('0xe'),auth[_0x7853('0x9')](),controller['removeDispositions']);router[_0x7853('0x25')]('/:id/canned_answers',auth[_0x7853('0x9')](),controller[_0x7853('0x26')]);router[_0x7853('0x25')](_0x7853('0x11'),auth['isAuthenticated'](),controller[_0x7853('0x27')]);router[_0x7853('0x25')](_0x7853('0x12'),auth[_0x7853('0x9')](),controller[_0x7853('0x28')]);router[_0x7853('0x25')](_0x7853('0xc'),auth[_0x7853('0x9')](),controller['destroy']);router[_0x7853('0x25')](_0x7853('0x18'),auth[_0x7853('0x9')](),controller[_0x7853('0x29')]);module[_0x7853('0x2a')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 8ef0b5d..4dc860d 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 _0x1f12=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','outlook365','provider','custom','getDataValue','sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x1f12,0xd2));var _0x21f1=function(_0x17b9ae,_0x35cb0f){_0x17b9ae=_0x17b9ae-0x0;var _0x25b497=_0x1f12[_0x17b9ae];return _0x25b497;};'use strict';var Sequelize=require(_0x21f1('0x0'));module[_0x21f1('0x1')]={'description':{'type':Sequelize[_0x21f1('0x2')]},'name':{'type':Sequelize[_0x21f1('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x21f1('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x21f1('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x21f1('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x21f1('0x2')],'allowNull':![],'defaultValue':_0x21f1('0x4')},'fontSize':{'type':Sequelize[_0x21f1('0x5')](0x2)[_0x21f1('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x21f1('0x7')],'defaultValue':function(){return _0x21f1('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x21f1('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x21f1('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x21f1('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x21f1('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x21f1('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x21f1('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x21f1('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x21f1('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x21f1('0x3')],'defaultValue':![],'comment':_0x21f1('0x9'),'set':function(_0x3db626){if(!_0x3db626)this[_0x21f1('0xa')](_0x21f1('0xb'),null);this[_0x21f1('0xa')](_0x21f1('0xc'),_0x3db626);}},'provider':{'type':Sequelize[_0x21f1('0xd')](_0x21f1('0xe'),_0x21f1('0xf'),'yahoo',_0x21f1('0x10')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x21f1('0x11')))return _0x21f1('0x12');return this[_0x21f1('0x13')](_0x21f1('0x11'));},'set':function(_0xc07dfb){if(_0xc07dfb===_0x21f1('0x12'))_0xc07dfb=null;return this[_0x21f1('0xa')]('provider',_0xc07dfb);}}}; \ No newline at end of file +var _0x8608=['hotmail','outlook365','getDataValue','provider','custom','setDataValue','sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','ENUM','gmail'];(function(_0x2e5988,_0x482943){var _0x35080f=function(_0x56f09b){while(--_0x56f09b){_0x2e5988['push'](_0x2e5988['shift']());}};_0x35080f(++_0x482943);}(_0x8608,0xde));var _0x8860=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8608[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8860('0x0'));module[_0x8860('0x1')]={'description':{'type':Sequelize[_0x8860('0x2')]},'name':{'type':Sequelize[_0x8860('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x8860('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x8860('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x8860('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x8860('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x8860('0x2')],'allowNull':![],'defaultValue':_0x8860('0x4')},'fontSize':{'type':Sequelize[_0x8860('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8860('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8860('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8860('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8860('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8860('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8860('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8860('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x8860('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x8860('0x3')],'defaultValue':![],'comment':_0x8860('0x8'),'set':function(_0x51f087){if(!_0x51f087)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0x8860('0x9'),_0x51f087);}},'provider':{'type':Sequelize[_0x8860('0xa')](_0x8860('0xb'),_0x8860('0xc'),'yahoo',_0x8860('0xd')),'defaultValue':null,'get':function(){if(!this[_0x8860('0xe')](_0x8860('0xf')))return _0x8860('0x10');return this[_0x8860('0xe')](_0x8860('0xf'));},'set':function(_0x481c3a){if(_0x481c3a===_0x8860('0x10'))_0x481c3a=null;return this[_0x8860('0x11')](_0x8860('0xf'),_0x481c3a);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 6df48d3..1f1fe4e 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 _0x4d80=['email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','getImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','getInteractions','MailInteraction','Contact','User','Owner','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','split','format','inlineCss','CmList','CmContact','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','getSmtpOptions','SendMail','sendMail','List','List\x20not\x20found','defaults','messageId','subject','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','CloudProvider','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','util','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','request','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','get','MailAccounts','UserProfileResource','end','stack','name','gmail','yahoo','imap.mail.yahoo.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','hotmail','smtp-mail.outlook.com','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','Imap','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','map','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','MailAccount','includeAll','include','findAll','rows','params','MailServerIn','rawAttributes','find','body','custom','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','provider'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x4d80,0x110));var _0x04d8=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x4d80[_0x465a0c];return _0x1e202e;};'use strict';var moment=require(_0x04d8('0x0'));var BPromise=require('bluebird');var util=require(_0x04d8('0x1'));var path=require('path');var _=require('lodash');var juice=require(_0x04d8('0x2'));var Redis=require(_0x04d8('0x3'));var qs=require(_0x04d8('0x4'));var logger=require(_0x04d8('0x5'))(_0x04d8('0x6'));var config=require(_0x04d8('0x7'));var db=require(_0x04d8('0x8'))['db'];config[_0x04d8('0x9')]=_['defaults'](config['redis'],{'host':_0x04d8('0xa'),'port':0x18eb});var socket=require(_0x04d8('0xb'))(new Redis(config['redis']));require(_0x04d8('0xc'))[_0x04d8('0xd')](socket);var jayson=require(_0x04d8('0xe'));var client=jayson['client'][_0x04d8('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x3bb031,_0x192d65,_0x546c68,_0x21b330){return new BPromise(function(_0x208534,_0xa460e1){var _0x24bef6=_0x21b330||client;return _0x24bef6[_0x04d8('0x10')](_0x3bb031,_0x546c68)['then'](function(_0xfc4ee8){logger['info'](_0x04d8('0x11'),_0x192d65,_0x04d8('0x12'));logger[_0x04d8('0x13')](_0x04d8('0x14'),_0x192d65,_0x04d8('0x12'),JSON[_0x04d8('0x15')](_0xfc4ee8));if(_0xfc4ee8['error']){if(_0xfc4ee8['error'][_0x04d8('0x16')]===0x1f4){logger['error'](_0x04d8('0x11'),_0x192d65,_0xfc4ee8[_0x04d8('0x17')]['message']);return _0xa460e1(_0xfc4ee8[_0x04d8('0x17')][_0x04d8('0x18')]);}logger[_0x04d8('0x17')](_0x04d8('0x11'),_0x192d65,_0xfc4ee8[_0x04d8('0x17')]['message']);return _0x208534(_0xfc4ee8[_0x04d8('0x17')]['message']);}else{logger['info'](_0x04d8('0x11'),_0x192d65,_0x04d8('0x12'));_0x208534(_0xfc4ee8[_0x04d8('0x19')][_0x04d8('0x18')]);}})[_0x04d8('0x1a')](function(_0x4bedc8){logger['error']('MailAccount,\x20%s,\x20%s',_0x192d65,_0x4bedc8);_0xa460e1(_0x4bedc8);});});}function respondWithStatusCode(_0x21d49d,_0x4e8d72){_0x4e8d72=_0x4e8d72||0xcc;return function(_0x475ed0){if(_0x475ed0){return _0x21d49d[_0x04d8('0x1b')](_0x4e8d72);}return _0x21d49d[_0x04d8('0x1c')](_0x4e8d72)['end']();};}function respondWithResult(_0x18d399,_0x1b5c1b){_0x1b5c1b=_0x1b5c1b||0xc8;return function(_0x162bbd){if(_0x162bbd){return _0x18d399[_0x04d8('0x1c')](_0x1b5c1b)[_0x04d8('0x1d')](_0x162bbd);}};}function respondWithFilteredResult(_0xce378e,_0x560dbb){return function(_0x5d4671){if(_0x5d4671){var _0x24aa46=typeof _0x560dbb['offset']===_0x04d8('0x1e')&&typeof _0x560dbb[_0x04d8('0x1f')]===_0x04d8('0x1e');var _0x29c201=_0x5d4671[_0x04d8('0x20')];var _0x4e0d3b=_0x24aa46?0x0:_0x560dbb[_0x04d8('0x21')];var _0x5d0fff=_0x24aa46?_0x5d4671[_0x04d8('0x20')]:_0x560dbb[_0x04d8('0x21')]+_0x560dbb[_0x04d8('0x1f')];var _0x49aaa2;if(_0x5d0fff>=_0x29c201){_0x5d0fff=_0x29c201;_0x49aaa2=0xc8;}else{_0x49aaa2=0xce;}_0xce378e[_0x04d8('0x1c')](_0x49aaa2);return _0xce378e[_0x04d8('0x22')](_0x04d8('0x23'),_0x4e0d3b+'-'+_0x5d0fff+'/'+_0x29c201)['json'](_0x5d4671);}return null;};}function saveUpdates(_0x50fc72){return function(_0x38eace){if(_0x38eace){return _0x38eace[_0x04d8('0x24')](_0x50fc72)[_0x04d8('0x25')](function(_0x2c757f){return _0x2c757f;});}return null;};}function removeEntity(_0x576757){return function(_0x133f95){if(_0x133f95){return _0x133f95[_0x04d8('0x26')]()[_0x04d8('0x25')](function(){var _0x3337b6=_0x133f95[_0x04d8('0x27')]({'plain':!![]});var _0x428d1b=_0x04d8('0x28');return db[_0x04d8('0x29')][_0x04d8('0x26')]({'where':{'type':_0x428d1b,'resourceId':_0x3337b6['id']}})[_0x04d8('0x25')](function(){return _0x133f95;});})[_0x04d8('0x25')](function(){_0x576757[_0x04d8('0x1c')](0xcc)[_0x04d8('0x2a')]();});}};}function handleEntityNotFound(_0x4d91a4){return function(_0x1d7a90){if(!_0x1d7a90){_0x4d91a4[_0x04d8('0x1b')](0x194);}return _0x1d7a90;};}function handleError(_0x2d19d8,_0x42c17c){_0x42c17c=_0x42c17c||0x1f4;return function(_0x4a8602){logger[_0x04d8('0x17')](_0x4a8602[_0x04d8('0x2b')]);if(_0x4a8602[_0x04d8('0x2c')]){delete _0x4a8602['name'];}_0x2d19d8[_0x04d8('0x1c')](_0x42c17c)['send'](_0x4a8602);};}function getImapHost(_0x5b25bc){switch(_0x5b25bc){case _0x04d8('0x2d'):return'imap.gmail.com';case _0x04d8('0x2e'):return _0x04d8('0x2f');case'hotmail':return'imap-mail.outlook.com';case _0x04d8('0x30'):return _0x04d8('0x31');}throw new Error(_0x04d8('0x32'),_0x5b25bc);}function getSmtpHost(_0x1c75dd){switch(_0x1c75dd){case'gmail':return'smtp.gmail.com';case _0x04d8('0x2e'):return _0x04d8('0x33');case _0x04d8('0x34'):return _0x04d8('0x35');case _0x04d8('0x30'):return _0x04d8('0x36');}throw new Error('Unknown\x20email\x20service\x20provider',_0x1c75dd);}function getAuthenticationOptions(_0x27482d,_0x29ebb6){var _0x2fe569={};var _0x9c0bfd={};if(_0x27482d){_0x2fe569['user']=_0x9c0bfd[_0x04d8('0x37')]=_0x29ebb6[_0x04d8('0x38')];_0x2fe569[_0x04d8('0x39')]=_0x9c0bfd['pass']=_0x29ebb6[_0x04d8('0x39')];if(_0x29ebb6[_0x04d8('0x3a')]){_0x2fe569[_0x04d8('0x3a')]=_0x9c0bfd[_0x04d8('0x3a')]=!![];_0x2fe569[_0x04d8('0x3b')]=_0x9c0bfd[_0x04d8('0x3b')]=_0x29ebb6[_0x04d8('0x3b')];_0x2fe569[_0x04d8('0x39')]=_0x9c0bfd[_0x04d8('0x3c')]=null;}else{_0x2fe569[_0x04d8('0x3b')]=_0x9c0bfd[_0x04d8('0x3b')]=null;}_0x2fe569[_0x04d8('0x3d')]=getImapHost(_0x27482d);_0x2fe569[_0x04d8('0x3e')]=0x3e1;_0x9c0bfd[_0x04d8('0x3d')]=getSmtpHost(_0x27482d);_0x9c0bfd[_0x04d8('0x3e')]=0x24b;_0x9c0bfd[_0x04d8('0x3f')]=![];_0x2fe569['service']=_0x9c0bfd[_0x04d8('0x40')]=null;}else{if(_0x29ebb6[_0x04d8('0x41')]){_0x2fe569[_0x04d8('0x37')]=_0x9c0bfd[_0x04d8('0x37')]=_0x29ebb6[_0x04d8('0x38')];_0x2fe569[_0x04d8('0x39')]=_0x9c0bfd[_0x04d8('0x3c')]=_0x29ebb6[_0x04d8('0x39')];}else{_0x2fe569[_0x04d8('0x41')]=_0x9c0bfd[_0x04d8('0x41')]=![];_0x2fe569[_0x04d8('0x37')]=_0x9c0bfd[_0x04d8('0x37')]=null;_0x2fe569[_0x04d8('0x39')]=_0x9c0bfd[_0x04d8('0x3c')]=null;}_0x2fe569[_0x04d8('0x3d')]=_0x29ebb6[_0x04d8('0x42')][_0x04d8('0x3d')];_0x2fe569[_0x04d8('0x3e')]=_0x29ebb6[_0x04d8('0x42')][_0x04d8('0x3e')];_0x9c0bfd['host']=_0x29ebb6['Smtp']['host'];_0x9c0bfd[_0x04d8('0x3e')]=_0x29ebb6[_0x04d8('0x43')]['port'];}return{'Imap':_0x2fe569,'Smtp':_0x9c0bfd};}exports[_0x04d8('0x44')]=function(_0x584aac,_0x339908){var _0x3ffeef={'include':[{'model':db['MailServerIn'],'as':_0x04d8('0x42')},{'model':db[_0x04d8('0x45')],'as':_0x04d8('0x43')},{'model':db[_0x04d8('0x46')],'as':_0x04d8('0x47')}]},_0x1ef21e={},_0xf1a900={'count':0x0,'rows':[]};var _0xe46e6d=_[_0x04d8('0x48')](db['MailAccount']['rawAttributes'],function(_0x5ba173){return{'name':_0x5ba173[_0x04d8('0x49')],'type':_0x5ba173[_0x04d8('0x4a')]['key']};});_0x1ef21e[_0x04d8('0x4b')]=_[_0x04d8('0x48')](_0xe46e6d,'name');_0x1ef21e['query']=_[_0x04d8('0x4c')](_0x584aac['query']);_0x1ef21e[_0x04d8('0x4d')]=_[_0x04d8('0x4e')](_0x1ef21e[_0x04d8('0x4b')],_0x1ef21e[_0x04d8('0x4f')]);_0x3ffeef[_0x04d8('0x50')]=_[_0x04d8('0x4e')](_0x1ef21e[_0x04d8('0x4b')],qs[_0x04d8('0x51')](_0x584aac[_0x04d8('0x4f')][_0x04d8('0x51')]));_0x3ffeef[_0x04d8('0x50')]=_0x3ffeef[_0x04d8('0x50')][_0x04d8('0x52')]?_0x3ffeef[_0x04d8('0x50')]:_0x1ef21e['model'];if(!_0x584aac[_0x04d8('0x4f')][_0x04d8('0x53')](_0x04d8('0x54'))){_0x3ffeef[_0x04d8('0x1f')]=qs['limit'](_0x584aac[_0x04d8('0x4f')][_0x04d8('0x1f')]);_0x3ffeef[_0x04d8('0x21')]=qs[_0x04d8('0x21')](_0x584aac['query'][_0x04d8('0x21')]);}_0x3ffeef[_0x04d8('0x55')]=qs[_0x04d8('0x56')](_0x584aac[_0x04d8('0x4f')][_0x04d8('0x56')]);_0x3ffeef[_0x04d8('0x57')]=qs[_0x04d8('0x4d')](_[_0x04d8('0x58')](_0x584aac['query'],_0x1ef21e[_0x04d8('0x4d')]),_0xe46e6d);if(_0x584aac['query']['filter']){_0x3ffeef[_0x04d8('0x57')]=_['merge'](_0x3ffeef[_0x04d8('0x57')],{'$or':_[_0x04d8('0x48')](_0xe46e6d,function(_0xd90e8a){if(_0xd90e8a[_0x04d8('0x4a')]!==_0x04d8('0x59')){var _0x550d60={};_0x550d60[_0xd90e8a[_0x04d8('0x2c')]]={'$like':'%'+_0x584aac[_0x04d8('0x4f')][_0x04d8('0x5a')]+'%'};return _0x550d60;}})});}_0x3ffeef=_[_0x04d8('0x5b')]({},_0x3ffeef,_0x584aac[_0x04d8('0x5c')]);var _0xc92617={'where':_0x3ffeef['where']};return db[_0x04d8('0x5d')][_0x04d8('0x20')](_0xc92617)[_0x04d8('0x25')](function(_0x2a2449){_0xf1a900[_0x04d8('0x20')]=_0x2a2449;if(_0x584aac[_0x04d8('0x4f')][_0x04d8('0x5e')]){_0x3ffeef[_0x04d8('0x5f')]=[{'all':!![]}];}return db[_0x04d8('0x5d')][_0x04d8('0x60')](_0x3ffeef);})[_0x04d8('0x25')](function(_0x477c1d){_0xf1a900[_0x04d8('0x61')]=_0x477c1d;return _0xf1a900;})['then'](respondWithFilteredResult(_0x339908,_0x3ffeef))[_0x04d8('0x1a')](handleError(_0x339908,null));};exports['show']=function(_0xc93860,_0x4a7222){var _0x4b8f9a={'raw':![],'where':{'id':_0xc93860[_0x04d8('0x62')]['id']},'include':[{'model':db[_0x04d8('0x63')],'as':_0x04d8('0x42')},{'model':db[_0x04d8('0x45')],'as':'Smtp'},{'model':db['Pause'],'as':_0x04d8('0x47')}]},_0x2f5a76={};_0x2f5a76[_0x04d8('0x4b')]=_[_0x04d8('0x4c')](db[_0x04d8('0x5d')][_0x04d8('0x64')]);_0x2f5a76[_0x04d8('0x4f')]=_[_0x04d8('0x4c')](_0xc93860[_0x04d8('0x4f')]);_0x2f5a76[_0x04d8('0x4d')]=_['intersection'](_0x2f5a76[_0x04d8('0x4b')],_0x2f5a76[_0x04d8('0x4f')]);_0x4b8f9a[_0x04d8('0x50')]=_[_0x04d8('0x4e')](_0x2f5a76[_0x04d8('0x4b')],qs[_0x04d8('0x51')](_0xc93860[_0x04d8('0x4f')][_0x04d8('0x51')]));_0x4b8f9a[_0x04d8('0x50')]=_0x4b8f9a[_0x04d8('0x50')][_0x04d8('0x52')]?_0x4b8f9a[_0x04d8('0x50')]:_0x2f5a76[_0x04d8('0x4b')];if(_0xc93860[_0x04d8('0x4f')][_0x04d8('0x5e')]){_0x4b8f9a['include']=[{'all':!![]}];}_0x4b8f9a=_['merge']({},_0x4b8f9a,_0xc93860['options']);return db[_0x04d8('0x5d')][_0x04d8('0x65')](_0x4b8f9a)[_0x04d8('0x25')](handleEntityNotFound(_0x4a7222,null))[_0x04d8('0x25')](respondWithResult(_0x4a7222,null))['catch'](handleError(_0x4a7222,null));};exports[_0x04d8('0x24')]=function(_0x298af7,_0x56138d){if(_0x298af7[_0x04d8('0x66')]['id']){delete _0x298af7[_0x04d8('0x66')]['id'];}var _0x25b746=_0x298af7[_0x04d8('0x66')]['provider']===_0x04d8('0x67')?null:_0x298af7['body']['provider'];var _0x40149e=_0x298af7[_0x04d8('0x66')][_0x04d8('0x42')]||{};var _0x42c625=_0x298af7[_0x04d8('0x66')][_0x04d8('0x43')]||{};if(_0x25b746){_0x40149e[_0x04d8('0x3d')]=getImapHost(_0x25b746);_0x40149e['port']=0x3e1;_0x42c625[_0x04d8('0x3d')]=getSmtpHost(_0x25b746);_0x42c625['port']=0x24b;_0x42c625['secure']=![];}if(_0x42c625['modernAuthentication']){_0x42c625['secure']=![];}else{_0x42c625[_0x04d8('0x3b')]=null;}if(!_0x40149e[_0x04d8('0x3a')])_0x40149e[_0x04d8('0x3b')]=null;_0x298af7[_0x04d8('0x66')][_0x04d8('0x42')]=_0x40149e;_0x298af7[_0x04d8('0x66')][_0x04d8('0x43')]=_0x42c625;return db['MailAccount'][_0x04d8('0x65')]({'where':{'id':_0x298af7[_0x04d8('0x62')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x04d8('0x42')},{'model':db[_0x04d8('0x45')],'as':_0x04d8('0x43')},{'model':db[_0x04d8('0x46')],'as':_0x04d8('0x47')}]})[_0x04d8('0x25')](handleEntityNotFound(_0x56138d,null))[_0x04d8('0x25')](function(_0x196eae){if(!_0x196eae)throw new Error('Mail\x20Account\x20not\x20found');if(_0x196eae[_0x04d8('0x40')])delete _0x298af7[_0x04d8('0x66')][_0x04d8('0x42')];return _0x196eae;})['then'](saveUpdates(_0x298af7[_0x04d8('0x66')],null))[_0x04d8('0x25')](function(_0x356574){if(!_0x298af7[_0x04d8('0x66')][_0x04d8('0x42')])return _0x356574;return db['MailServerIn']['update'](_0x298af7['body']['Imap'],{'where':{'MailAccountId':_0x356574['id']}})[_0x04d8('0x25')](function(){return _0x356574;});})['then'](function(_0x305751){if(!_0x298af7[_0x04d8('0x66')]['Smtp'])return _0x305751;return db[_0x04d8('0x45')][_0x04d8('0x24')](_0x298af7[_0x04d8('0x66')][_0x04d8('0x43')],{'where':{'MailAccountId':_0x305751['id']}})[_0x04d8('0x25')](function(){return _0x305751;});})[_0x04d8('0x25')](respondWithResult(_0x56138d,null))['catch'](handleError(_0x56138d,null));};exports[_0x04d8('0x68')]=function(_0x81b64b,_0x8a03b4){return db[_0x04d8('0x5d')][_0x04d8('0x68')]()[_0x04d8('0x25')](respondWithResult(_0x8a03b4,null))[_0x04d8('0x1a')](handleError(_0x8a03b4,null));};exports[_0x04d8('0x69')]=function(_0x564d78,_0x2cf158){if(_0x564d78[_0x04d8('0x66')]['id']){delete _0x564d78[_0x04d8('0x66')]['id'];}return db[_0x04d8('0x5d')][_0x04d8('0x65')]({'where':{'id':_0x564d78[_0x04d8('0x62')]['id']}})['then'](handleEntityNotFound(_0x2cf158,null))[_0x04d8('0x25')](function(_0x4f219b){if(_0x4f219b){_0x564d78[_0x04d8('0x66')][_0x04d8('0x6a')]=_0x4f219b['id'];return db[_0x04d8('0x6b')][_0x04d8('0x6c')](_0x564d78[_0x04d8('0x66')]);}})['then'](respondWithResult(_0x2cf158,null))[_0x04d8('0x1a')](handleError(_0x2cf158,null));};exports[_0x04d8('0x6d')]=function(_0x4ee4be,_0x18b75c){var _0x4425b7={'raw':![],'where':{}};var _0x3efd9c={};var _0x3c5809={'count':0x0,'rows':[]};return db[_0x04d8('0x5d')][_0x04d8('0x6e')]({'where':{'id':_0x4ee4be[_0x04d8('0x62')]['id']}})[_0x04d8('0x25')](handleEntityNotFound(_0x18b75c,null))[_0x04d8('0x25')](function(_0x522e88){if(_0x522e88){_0x3efd9c['model']=_['keys'](db[_0x04d8('0x6b')][_0x04d8('0x64')]);_0x3efd9c[_0x04d8('0x4f')]=_[_0x04d8('0x4c')](_0x4ee4be[_0x04d8('0x4f')]);_0x3efd9c[_0x04d8('0x4d')]=_[_0x04d8('0x4e')](_0x3efd9c[_0x04d8('0x4b')],_0x3efd9c[_0x04d8('0x4f')]);_0x4425b7['attributes']=_[_0x04d8('0x4e')](_0x3efd9c[_0x04d8('0x4b')],qs['fields'](_0x4ee4be[_0x04d8('0x4f')]['fields']));_0x4425b7[_0x04d8('0x50')]=_0x4425b7['attributes'][_0x04d8('0x52')]?_0x4425b7[_0x04d8('0x50')]:_0x3efd9c[_0x04d8('0x4b')];if(!_0x4ee4be['query']['hasOwnProperty'](_0x04d8('0x54'))){_0x4425b7[_0x04d8('0x1f')]=qs['limit'](_0x4ee4be[_0x04d8('0x4f')]['limit']);_0x4425b7['offset']=qs[_0x04d8('0x21')](_0x4ee4be[_0x04d8('0x4f')]['offset']);}_0x4425b7['order']=qs[_0x04d8('0x56')](_0x4ee4be[_0x04d8('0x4f')][_0x04d8('0x56')]);_0x4425b7['where']=qs[_0x04d8('0x4d')](_[_0x04d8('0x58')](_0x4ee4be[_0x04d8('0x4f')],_0x3efd9c['filters']));_0x4425b7[_0x04d8('0x57')][_0x04d8('0x6a')]=_0x522e88['id'];if(_0x4ee4be[_0x04d8('0x4f')][_0x04d8('0x5a')]){_0x4425b7[_0x04d8('0x57')]=_['merge'](_0x4425b7['where'],{'$or':_[_0x04d8('0x48')](_0x4425b7[_0x04d8('0x50')],function(_0x158486){var _0x11e19a={};_0x11e19a[_0x158486]={'$like':'%'+_0x4ee4be[_0x04d8('0x4f')]['filter']+'%'};return _0x11e19a;})});}_0x4425b7=_[_0x04d8('0x5b')]({},_0x4425b7,_0x4ee4be[_0x04d8('0x5c')]);return db[_0x04d8('0x6b')]['count']({'where':_0x4425b7['where']})['then'](function(_0x9684f0){_0x3c5809[_0x04d8('0x20')]=_0x9684f0;if(_0x4ee4be[_0x04d8('0x4f')]['includeAll']){_0x4425b7[_0x04d8('0x5f')]=[{'all':!![]}];}return db['Disposition'][_0x04d8('0x60')](_0x4425b7);})[_0x04d8('0x25')](function(_0x9f55ea){_0x3c5809[_0x04d8('0x61')]=_0x9f55ea;return _0x3c5809;});}})[_0x04d8('0x25')](respondWithFilteredResult(_0x18b75c,_0x4425b7))[_0x04d8('0x1a')](handleError(_0x18b75c,null));};exports['removeDispositions']=function(_0x3015b1,_0x57db35){return db[_0x04d8('0x5d')][_0x04d8('0x65')]({'where':{'id':_0x3015b1[_0x04d8('0x62')]['id']}})['then'](handleEntityNotFound(_0x57db35,null))[_0x04d8('0x25')](function(_0x3fee8c){if(_0x3fee8c){return _0x3fee8c[_0x04d8('0x6f')](_0x3015b1['query'][_0x04d8('0x70')]);}})[_0x04d8('0x25')](respondWithStatusCode(_0x57db35,null))[_0x04d8('0x1a')](handleError(_0x57db35,null));};exports[_0x04d8('0x71')]=function(_0x4f1e3b,_0x1bae62){if(_0x4f1e3b[_0x04d8('0x66')]['id']){delete _0x4f1e3b[_0x04d8('0x66')]['id'];}return db['MailAccount'][_0x04d8('0x65')]({'where':{'id':_0x4f1e3b[_0x04d8('0x62')]['id']}})[_0x04d8('0x25')](handleEntityNotFound(_0x1bae62,null))[_0x04d8('0x25')](function(_0x41ae6e){if(_0x41ae6e){_0x4f1e3b[_0x04d8('0x66')][_0x04d8('0x6a')]=_0x41ae6e['id'];return db[_0x04d8('0x72')][_0x04d8('0x6c')](_0x4f1e3b[_0x04d8('0x66')]);}})[_0x04d8('0x25')](respondWithResult(_0x1bae62,null))[_0x04d8('0x1a')](handleError(_0x1bae62,null));};exports[_0x04d8('0x73')]=function(_0x588169,_0x487af8){var _0x361b7c={'raw':![],'where':{}};var _0x2a66e6={};var _0x4e2875={'count':0x0,'rows':[]};return db[_0x04d8('0x5d')][_0x04d8('0x6e')]({'where':{'id':_0x588169[_0x04d8('0x62')]['id']}})[_0x04d8('0x25')](handleEntityNotFound(_0x487af8,null))[_0x04d8('0x25')](function(_0x49b409){if(_0x49b409){_0x2a66e6[_0x04d8('0x4b')]=_[_0x04d8('0x4c')](db['CannedAnswer'][_0x04d8('0x64')]);_0x2a66e6[_0x04d8('0x4f')]=_[_0x04d8('0x4c')](_0x588169[_0x04d8('0x4f')]);_0x2a66e6[_0x04d8('0x4d')]=_[_0x04d8('0x4e')](_0x2a66e6[_0x04d8('0x4b')],_0x2a66e6[_0x04d8('0x4f')]);_0x361b7c[_0x04d8('0x50')]=_[_0x04d8('0x4e')](_0x2a66e6[_0x04d8('0x4b')],qs[_0x04d8('0x51')](_0x588169[_0x04d8('0x4f')][_0x04d8('0x51')]));_0x361b7c[_0x04d8('0x50')]=_0x361b7c['attributes'][_0x04d8('0x52')]?_0x361b7c['attributes']:_0x2a66e6[_0x04d8('0x4b')];if(!_0x588169[_0x04d8('0x4f')][_0x04d8('0x53')]('nolimit')){_0x361b7c[_0x04d8('0x1f')]=qs[_0x04d8('0x1f')](_0x588169[_0x04d8('0x4f')][_0x04d8('0x1f')]);_0x361b7c[_0x04d8('0x21')]=qs[_0x04d8('0x21')](_0x588169['query']['offset']);}_0x361b7c[_0x04d8('0x55')]=qs[_0x04d8('0x56')](_0x588169[_0x04d8('0x4f')][_0x04d8('0x56')]);_0x361b7c[_0x04d8('0x57')]=qs[_0x04d8('0x4d')](_[_0x04d8('0x58')](_0x588169[_0x04d8('0x4f')],_0x2a66e6[_0x04d8('0x4d')]));_0x361b7c['where'][_0x04d8('0x6a')]=_0x49b409['id'];if(_0x588169[_0x04d8('0x4f')]['filter']){_0x361b7c[_0x04d8('0x57')]=_[_0x04d8('0x5b')](_0x361b7c['where'],{'$or':_[_0x04d8('0x48')](_0x361b7c[_0x04d8('0x50')],function(_0x1d9724){var _0x45205c={};_0x45205c[_0x1d9724]={'$like':'%'+_0x588169[_0x04d8('0x4f')][_0x04d8('0x5a')]+'%'};return _0x45205c;})});}_0x361b7c=_[_0x04d8('0x5b')]({},_0x361b7c,_0x588169[_0x04d8('0x5c')]);return db[_0x04d8('0x72')][_0x04d8('0x20')]({'where':_0x361b7c[_0x04d8('0x57')]})[_0x04d8('0x25')](function(_0x28b4b1){_0x4e2875[_0x04d8('0x20')]=_0x28b4b1;if(_0x588169[_0x04d8('0x4f')][_0x04d8('0x5e')]){_0x361b7c[_0x04d8('0x5f')]=[{'all':!![]}];}return db[_0x04d8('0x72')]['findAll'](_0x361b7c);})[_0x04d8('0x25')](function(_0x34a4ab){_0x4e2875[_0x04d8('0x61')]=_0x34a4ab;return _0x4e2875;});}})[_0x04d8('0x25')](respondWithFilteredResult(_0x487af8,_0x361b7c))[_0x04d8('0x1a')](handleError(_0x487af8,null));};exports['removeAnswers']=function(_0x437953,_0x550e50){return db[_0x04d8('0x5d')]['find']({'where':{'id':_0x437953[_0x04d8('0x62')]['id']}})[_0x04d8('0x25')](handleEntityNotFound(_0x550e50,null))['then'](function(_0x133abf){if(_0x133abf){return _0x133abf[_0x04d8('0x74')](_0x437953['query'][_0x04d8('0x70')]);}})[_0x04d8('0x25')](respondWithStatusCode(_0x550e50,null))[_0x04d8('0x1a')](handleError(_0x550e50,null));};exports['create']=function(_0x39cc54,_0x4241bb){var _0x96fa38={'name':_0x39cc54[_0x04d8('0x66')][_0x04d8('0x2c')],'key':_0x39cc54[_0x04d8('0x66')]['key'],'provider':_0x39cc54[_0x04d8('0x66')][_0x04d8('0x75')]===_0x04d8('0x67')?null:_0x39cc54[_0x04d8('0x66')][_0x04d8('0x75')],'email':_0x39cc54[_0x04d8('0x66')][_0x04d8('0x76')],'ListId':_0x39cc54['body'][_0x04d8('0x77')],'active':!_[_0x04d8('0x78')](_0x39cc54[_0x04d8('0x66')][_0x04d8('0x79')])?_0x39cc54['body']['active']:!![],'description':_0x39cc54[_0x04d8('0x66')][_0x04d8('0x7a')]||null};var _0x26c8cb=getAuthenticationOptions(_0x96fa38[_0x04d8('0x75')],_0x39cc54[_0x04d8('0x66')]);_0x96fa38[_0x04d8('0x42')]=_0x26c8cb[_0x04d8('0x42')];_0x96fa38[_0x04d8('0x43')]=_0x26c8cb[_0x04d8('0x43')];return db[_0x04d8('0x5d')][_0x04d8('0x6c')](_0x96fa38,{'include':[{'model':db[_0x04d8('0x45')],'as':'Smtp'},{'model':db[_0x04d8('0x63')],'as':'Imap'}]})['then'](function(_0x2644de){var _0x25a068=_0x39cc54[_0x04d8('0x37')][_0x04d8('0x27')]({'plain':!![]});if(!_0x25a068)throw new Error(_0x04d8('0x7b'));if(_0x25a068[_0x04d8('0x7c')]==='user'){var _0x32d574=_0x2644de[_0x04d8('0x27')]({'plain':!![]});return db[_0x04d8('0x7d')][_0x04d8('0x65')]({'where':{'name':_0x04d8('0x28'),'userProfileId':_0x25a068[_0x04d8('0x7e')]},'raw':!![]})[_0x04d8('0x25')](function(_0x2a7413){if(_0x2a7413&&_0x2a7413[_0x04d8('0x7f')]===0x0){return db[_0x04d8('0x29')]['create']({'name':_0x32d574[_0x04d8('0x2c')],'resourceId':_0x32d574['id'],'type':_0x2a7413[_0x04d8('0x2c')],'sectionId':_0x2a7413['id']},{})[_0x04d8('0x25')](function(){return _0x2644de;});}else{return _0x2644de;}})[_0x04d8('0x1a')](function(_0x2c047b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c047b);throw _0x2c047b;});}return _0x2644de;})[_0x04d8('0x25')](respondWithResult(_0x4241bb,0xc9))['catch'](handleError(_0x4241bb,null));};exports[_0x04d8('0x80')]=function(_0x2fb161,_0xfc780d){return db['MailAccount'][_0x04d8('0x6e')]({'where':{'id':_0x2fb161[_0x04d8('0x62')]['id']}})[_0x04d8('0x25')](handleEntityNotFound(_0xfc780d,null))[_0x04d8('0x25')](function(_0x3c942c){if(_0x3c942c){return _0x3c942c[_0x04d8('0x80')]();}return null;})[_0x04d8('0x25')](respondWithResult(_0xfc780d,null))['catch'](handleError(_0xfc780d,null));};exports['addImap']=function(_0x32fc2e,_0x117a05){if(_0x32fc2e[_0x04d8('0x66')]['id']){delete _0x32fc2e[_0x04d8('0x66')]['id'];}return db['MailAccount'][_0x04d8('0x65')]({'where':{'id':_0x32fc2e['params']['id']}})[_0x04d8('0x25')](handleEntityNotFound(_0x117a05,null))['then'](function(_0x12020c){if(_0x12020c){_0x32fc2e[_0x04d8('0x66')]['MailAccountId']=_0x12020c['id'];return db['MailServerIn']['create'](_0x32fc2e[_0x04d8('0x66')]);}})[_0x04d8('0x25')](respondWithResult(_0x117a05,null))[_0x04d8('0x1a')](handleError(_0x117a05,null));};exports[_0x04d8('0x81')]=function(_0xd07db8,_0x5362b5){return db[_0x04d8('0x5d')][_0x04d8('0x6e')]({'where':{'id':_0xd07db8[_0x04d8('0x62')]['id']}})[_0x04d8('0x25')](handleEntityNotFound(_0x5362b5,null))['then'](function(_0x484092){if(_0x484092){return _0x484092[_0x04d8('0x82')](null);}return null;})[_0x04d8('0x25')](respondWithStatusCode(_0x5362b5,null))[_0x04d8('0x1a')](handleError(_0x5362b5,null));};exports[_0x04d8('0x83')]=function(_0x4fa8cc,_0x58dbb5){return db['MailAccount'][_0x04d8('0x6e')]({'where':{'id':_0x4fa8cc[_0x04d8('0x62')]['id']}})[_0x04d8('0x25')](handleEntityNotFound(_0x58dbb5,null))[_0x04d8('0x25')](function(_0x482beb){if(_0x482beb){return _0x482beb[_0x04d8('0x83')]();}return null;})['then'](respondWithResult(_0x58dbb5,null))['catch'](handleError(_0x58dbb5,null));};exports['addSmtp']=function(_0x20aab0,_0xef73ae){if(_0x20aab0[_0x04d8('0x66')]['id']){delete _0x20aab0['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x20aab0['params']['id']}})[_0x04d8('0x25')](handleEntityNotFound(_0xef73ae,null))[_0x04d8('0x25')](function(_0x201561){if(_0x201561){_0x20aab0[_0x04d8('0x66')]['MailAccountId']=_0x201561['id'];return db[_0x04d8('0x45')][_0x04d8('0x6c')](_0x20aab0[_0x04d8('0x66')]);}})['then'](respondWithResult(_0xef73ae,null))['catch'](handleError(_0xef73ae,null));};exports[_0x04d8('0x84')]=function(_0x2b6d16,_0x2fdfc4){return db['MailAccount'][_0x04d8('0x6e')]({'where':{'id':_0x2b6d16[_0x04d8('0x62')]['id']}})[_0x04d8('0x25')](handleEntityNotFound(_0x2fdfc4,null))[_0x04d8('0x25')](function(_0x49a8a2){if(_0x49a8a2){return _0x49a8a2[_0x04d8('0x85')](null);}return null;})[_0x04d8('0x25')](respondWithStatusCode(_0x2fdfc4,null))[_0x04d8('0x1a')](handleError(_0x2fdfc4,null));};exports[_0x04d8('0x86')]=function(_0x1776a8,_0x2ef2eb){return db['MailInteraction']['find']({'where':{'id':_0x1776a8['params']['id']}})[_0x04d8('0x25')](handleEntityNotFound(_0x2ef2eb,null))[_0x04d8('0x25')](function(_0x4b8363){if(_0x4b8363){return _0x4b8363[_0x04d8('0x86')](_0x1776a8[_0x04d8('0x66')][_0x04d8('0x70')],_['omit'](_0x1776a8[_0x04d8('0x66')],[_0x04d8('0x70'),'id'])||{});}})['then'](respondWithResult(_0x2ef2eb,null))[_0x04d8('0x1a')](handleError(_0x2ef2eb,null));};exports[_0x04d8('0x87')]=function(_0x3886d0,_0x536555){var _0x2fbeec={'raw':![],'where':{}};var _0x41f877={};var _0x2ab534={'count':0x0,'rows':[]};return db[_0x04d8('0x5d')][_0x04d8('0x6e')]({'where':{'id':_0x3886d0[_0x04d8('0x62')]['id']}})[_0x04d8('0x25')](handleEntityNotFound(_0x536555,null))[_0x04d8('0x25')](function(_0x551e6c){if(_0x551e6c){_0x41f877[_0x04d8('0x4b')]=_[_0x04d8('0x4c')](db['MailInteraction'][_0x04d8('0x64')]);_0x41f877[_0x04d8('0x4f')]=_['keys'](_0x3886d0[_0x04d8('0x4f')]);_0x41f877[_0x04d8('0x4d')]=_[_0x04d8('0x4e')](_0x41f877[_0x04d8('0x4b')],_0x41f877[_0x04d8('0x4f')]);_0x2fbeec[_0x04d8('0x50')]=_[_0x04d8('0x4e')](_0x41f877[_0x04d8('0x4b')],qs[_0x04d8('0x51')](_0x3886d0['query'][_0x04d8('0x51')]));_0x2fbeec[_0x04d8('0x50')]=_0x2fbeec['attributes'][_0x04d8('0x52')]?_0x2fbeec[_0x04d8('0x50')]:_0x41f877[_0x04d8('0x4b')];if(!_0x3886d0[_0x04d8('0x4f')][_0x04d8('0x53')](_0x04d8('0x54'))){_0x2fbeec[_0x04d8('0x1f')]=qs['limit'](_0x3886d0['query']['limit']);_0x2fbeec[_0x04d8('0x21')]=qs[_0x04d8('0x21')](_0x3886d0[_0x04d8('0x4f')][_0x04d8('0x21')]);}_0x2fbeec[_0x04d8('0x55')]=qs[_0x04d8('0x56')](_0x3886d0[_0x04d8('0x4f')]['sort']);_0x2fbeec[_0x04d8('0x57')]=qs[_0x04d8('0x4d')](_['pick'](_0x3886d0['query'],_0x41f877[_0x04d8('0x4d')]));_0x2fbeec[_0x04d8('0x57')]['MailAccountId']=_0x551e6c['id'];if(_0x3886d0[_0x04d8('0x4f')][_0x04d8('0x5a')]){_0x2fbeec[_0x04d8('0x57')]=_[_0x04d8('0x5b')](_0x2fbeec[_0x04d8('0x57')],{'$or':_['map'](_0x2fbeec['attributes'],function(_0x4bd8fe){var _0x2f4e42={};_0x2f4e42[_0x4bd8fe]={'$like':'%'+_0x3886d0['query'][_0x04d8('0x5a')]+'%'};return _0x2f4e42;})});}_0x2fbeec=_['merge']({},_0x2fbeec,_0x3886d0[_0x04d8('0x5c')]);return db[_0x04d8('0x88')][_0x04d8('0x20')]({'where':_0x2fbeec[_0x04d8('0x57')]})[_0x04d8('0x25')](function(_0x2c5510){_0x2ab534[_0x04d8('0x20')]=_0x2c5510;if(_0x3886d0['query'][_0x04d8('0x5e')]){_0x2fbeec[_0x04d8('0x5f')]=[{'model':db['CmContact'],'as':_0x04d8('0x89'),'required':![]},{'model':db[_0x04d8('0x8a')],'as':_0x04d8('0x8b'),'attributes':['name','fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0x04d8('0x8c'),'attributes':['id','name',_0x04d8('0x8d')],'where':_0x3886d0[_0x04d8('0x4f')][_0x04d8('0x8e')]?{'id':_0x3886d0[_0x04d8('0x4f')][_0x04d8('0x8e')]}:undefined,'required':_0x3886d0['query']['tag']?!![]:![]}];}return db['MailInteraction']['findAll'](_0x2fbeec);})[_0x04d8('0x25')](function(_0x265fbe){_0x2ab534['rows']=_0x265fbe;return _0x2ab534;});}})[_0x04d8('0x25')](respondWithFilteredResult(_0x536555,_0x2fbeec))['catch'](handleError(_0x536555,null));};exports[_0x04d8('0x8f')]=function addApplications(_0x2c2db2,_0x31d234){var _0x3d4329=_0x2c2db2[_0x04d8('0x62')]['id'];var _0x3fedd2=_0x2c2db2[_0x04d8('0x66')];var _0x514566=0xc8;var _0x5868e7=null;return db[_0x04d8('0x90')][_0x04d8('0x91')]({'isolationLevel':db['sequelize'][_0x04d8('0x92')][_0x04d8('0x93')][_0x04d8('0x94')]},function(_0x986ed4){return db[_0x04d8('0x5d')][_0x04d8('0x6e')]({'where':{'id':_0x3d4329},'transaction':_0x986ed4})[_0x04d8('0x25')](function(_0x24b964){if(_0x24b964){return db[_0x04d8('0x95')]['destroy']({'where':{'MailAccountId':_0x3d4329},'transaction':_0x986ed4})[_0x04d8('0x25')](function(){var _0x5ac964=_['map'](_0x3fedd2,function(_0x361b75){_0x361b75[_0x04d8('0x6a')]=_0x3d4329;return _0x361b75;});return db[_0x04d8('0x95')][_0x04d8('0x96')](_0x5ac964,{'transaction':_0x986ed4});});}else{_0x514566=0x194;_0x5868e7=[];}});})[_0x04d8('0x25')](function(){if(_0x514566!==0x194){return db[_0x04d8('0x95')][_0x04d8('0x97')]({'where':{'MailAccountId':_0x3d4329},'order':_0x04d8('0x98')})['then'](function(_0x12693e){_0x5868e7=_0x12693e;});}})['catch'](function(_0x3f6005){_0x514566=0x1f4;logger['error'](_0x3f6005[_0x04d8('0x2b')]);if(_0x3f6005[_0x04d8('0x2c')]){delete _0x3f6005[_0x04d8('0x2c')];}_0x5868e7=_0x3f6005;})[_0x04d8('0x99')](function(){if(_0x5868e7===null){_0x31d234['sendStatus'](_0x514566);}else{if(_0x514566===0x1f4){_0x31d234['status'](_0x514566)['send'](_0x5868e7);}else{_0x31d234[_0x04d8('0x1c')](_0x514566)['json'](_0x5868e7);}}});};exports[_0x04d8('0x9a')]=function(_0x1e1c47,_0x6f1ffd){var _0xcae325={};var _0x241375={};var _0x1191c6;var _0x252fe4;return db['MailAccount'][_0x04d8('0x6e')]({'where':{'id':_0x1e1c47[_0x04d8('0x62')]['id']}})['then'](handleEntityNotFound(_0x6f1ffd,null))['then'](function(_0x545e05){if(_0x545e05){_0x1191c6=_0x545e05;_0x241375[_0x04d8('0x4b')]=_[_0x04d8('0x4c')](db[_0x04d8('0x95')][_0x04d8('0x64')]);_0x241375[_0x04d8('0x4f')]=_[_0x04d8('0x4c')](_0x1e1c47['query']);_0x241375[_0x04d8('0x4d')]=_[_0x04d8('0x4e')](_0x241375['model'],_0x241375[_0x04d8('0x4f')]);_0xcae325[_0x04d8('0x50')]=_[_0x04d8('0x4e')](_0x241375[_0x04d8('0x4b')],qs['fields'](_0x1e1c47[_0x04d8('0x4f')][_0x04d8('0x51')]));_0xcae325[_0x04d8('0x50')]=_0xcae325[_0x04d8('0x50')][_0x04d8('0x52')]?_0xcae325['attributes']:_0x241375[_0x04d8('0x4b')];_0xcae325[_0x04d8('0x55')]=qs[_0x04d8('0x56')](_0x1e1c47[_0x04d8('0x4f')][_0x04d8('0x56')]);_0xcae325['where']=qs[_0x04d8('0x4d')](_['pick'](_0x1e1c47[_0x04d8('0x4f')],_0x241375[_0x04d8('0x4d')]));if(_0x1e1c47[_0x04d8('0x4f')][_0x04d8('0x5a')]){_0xcae325[_0x04d8('0x57')]=_['merge'](_0xcae325[_0x04d8('0x57')],{'$or':_[_0x04d8('0x48')](_0xcae325[_0x04d8('0x50')],function(_0x410319){var _0x52e912={};_0x52e912[_0x410319]={'$like':'%'+_0x1e1c47[_0x04d8('0x4f')][_0x04d8('0x5a')]+'%'};return _0x52e912;})});}_0xcae325=_[_0x04d8('0x5b')]({},_0xcae325,_0x1e1c47[_0x04d8('0x5c')]);return _0x1191c6[_0x04d8('0x9a')](_0xcae325);}})[_0x04d8('0x25')](function(_0x1ba33e){if(_0x1ba33e){_0x252fe4=_0x1ba33e['length'];if(!_0x1e1c47[_0x04d8('0x4f')][_0x04d8('0x53')](_0x04d8('0x54'))){_0xcae325['limit']=qs['limit'](_0x1e1c47[_0x04d8('0x4f')][_0x04d8('0x1f')]);_0xcae325['offset']=qs[_0x04d8('0x21')](_0x1e1c47[_0x04d8('0x4f')][_0x04d8('0x21')]);}return _0x1191c6['getApplications'](_0xcae325);}})[_0x04d8('0x25')](function(_0x39cc7f){if(_0x39cc7f){return _0x39cc7f?{'count':_0x252fe4,'rows':_0x39cc7f}:null;}})[_0x04d8('0x25')](respondWithResult(_0x6f1ffd,null))['catch'](handleError(_0x6f1ffd,null));};exports['getMessages']=function(_0x3b9c01,_0x1abbe4){var _0x5d571c={'raw':!![],'where':{}};var _0x29ac36={};var _0x152736={'count':0x0,'rows':[]};return db[_0x04d8('0x5d')]['findOne']({'where':{'id':_0x3b9c01[_0x04d8('0x62')]['id']}})['then'](handleEntityNotFound(_0x1abbe4,null))[_0x04d8('0x25')](function(_0xcabb42){if(_0xcabb42){_0x29ac36['model']=_[_0x04d8('0x4c')](db[_0x04d8('0x9b')][_0x04d8('0x64')]);_0x29ac36[_0x04d8('0x4f')]=_[_0x04d8('0x4c')](_0x3b9c01[_0x04d8('0x4f')]);_0x29ac36['filters']=_[_0x04d8('0x4e')](_0x29ac36[_0x04d8('0x4b')],_0x29ac36[_0x04d8('0x4f')]);_0x5d571c[_0x04d8('0x50')]=_[_0x04d8('0x4e')](_0x29ac36[_0x04d8('0x4b')],qs[_0x04d8('0x51')](_0x3b9c01[_0x04d8('0x4f')][_0x04d8('0x51')]));_0x5d571c[_0x04d8('0x50')]=_0x5d571c[_0x04d8('0x50')]['length']?_0x5d571c[_0x04d8('0x50')]:_0x29ac36[_0x04d8('0x4b')];if(!_0x3b9c01[_0x04d8('0x4f')][_0x04d8('0x53')]('nolimit')){_0x5d571c[_0x04d8('0x1f')]=qs[_0x04d8('0x1f')](_0x3b9c01[_0x04d8('0x4f')]['limit']);_0x5d571c['offset']=qs[_0x04d8('0x21')](_0x3b9c01[_0x04d8('0x4f')][_0x04d8('0x21')]);}_0x5d571c['order']=qs[_0x04d8('0x56')](_0x3b9c01['query'][_0x04d8('0x56')]);_0x5d571c[_0x04d8('0x57')]=qs[_0x04d8('0x4d')](_[_0x04d8('0x58')](_0x3b9c01['query'],_0x29ac36['filters']));_0x5d571c['where']['MailAccountId']=_0xcabb42['id'];if(_0x3b9c01[_0x04d8('0x4f')][_0x04d8('0x5a')]){_0x5d571c[_0x04d8('0x57')]=_[_0x04d8('0x5b')](_0x5d571c[_0x04d8('0x57')],{'$or':_[_0x04d8('0x48')](_0x5d571c[_0x04d8('0x50')],function(_0x1ca2e8){var _0x280916={};_0x280916[_0x1ca2e8]={'$like':'%'+_0x3b9c01[_0x04d8('0x4f')][_0x04d8('0x5a')]+'%'};return _0x280916;})});}if(_0x3b9c01['query']['$gte']){var _0x5d9cdf=_0x3b9c01['query'][_0x04d8('0x9c')][_0x04d8('0x9d')](',');var _0x48b49c={};_0x48b49c[_0x5d9cdf[0x0]]={'$gte':moment(_0x5d9cdf[0x1])[_0x04d8('0x9e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5d571c[_0x04d8('0x57')]=_['merge'](_0x5d571c[_0x04d8('0x57')],_0x48b49c);}_0x5d571c=_[_0x04d8('0x5b')]({},_0x5d571c,_0x3b9c01[_0x04d8('0x5c')]);return db[_0x04d8('0x9b')]['count']({'where':_0x5d571c['where']})['then'](function(_0x1c92b6){_0x152736[_0x04d8('0x20')]=_0x1c92b6;if(_0x3b9c01['query'][_0x04d8('0x5e')]){_0x5d571c[_0x04d8('0x5f')]=[{'all':!![]}];}return db['MailMessage'][_0x04d8('0x60')](_0x5d571c);})['then'](function(_0x4648ff){if(_0x3b9c01[_0x04d8('0x4f')][_0x04d8('0x9f')]==='true'){for(var _0x532ee9=0x0;_0x532ee9<_0x4648ff['length'];_0x532ee9++){_0x4648ff[_0x532ee9][_0x04d8('0x66')]=juice(_0x4648ff[_0x532ee9][_0x04d8('0x66')]);}}_0x152736[_0x04d8('0x61')]=_0x4648ff;return _0x152736;});}})[_0x04d8('0x25')](respondWithFilteredResult(_0x1abbe4,_0x5d571c))[_0x04d8('0x1a')](handleError(_0x1abbe4,null));};exports['send']=function(_0x1e1037,_0x3c03fc){var _0x129dc2,_0x253124={},_0x2e2ab4;if(_0x1e1037[_0x04d8('0x66')]['to']){_0x2e2ab4=_0x1e1037['body']['to'][_0x04d8('0x9d')](',')[0x0];}return db[_0x04d8('0x5d')][_0x04d8('0x65')]({'where':{'id':_0x1e1037[_0x04d8('0x62')]['id']},'include':[{'model':db[_0x04d8('0xa0')],'as':'List','include':[{'model':db[_0x04d8('0xa1')],'as':_0x04d8('0xa2'),'where':{'email':_0x2e2ab4},'limit':0x1,'order':[[_0x04d8('0xa3'),_0x04d8('0xa4')]]}]},{'model':db['MailServerOut'],'as':_0x04d8('0x43'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x04d8('0x25')](handleEntityNotFound(_0x3c03fc,null))['then'](function(_0xbc71da){if(!_0xbc71da)return;_0x129dc2=_0xbc71da;if(!_0xbc71da[_0x04d8('0x43')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x04d8('0x78')](_0x1e1037[_0x04d8('0x66')][_0x04d8('0xa5')])){_0x1e1037[_0x04d8('0x66')]['from']=util[_0x04d8('0x9e')](_0x04d8('0xa6'),_0xbc71da[_0x04d8('0x2c')],_0xbc71da['email']||_0xbc71da[_0x04d8('0x43')][_0x04d8('0x37')]);}if(_0x1e1037[_0x04d8('0x66')][_0x04d8('0xa7')]&&_0x1e1037[_0x04d8('0x66')]['attachments'][_0x04d8('0x52')]){for(var _0x3b97a1=0x0;_0x3b97a1<_0x1e1037[_0x04d8('0x66')][_0x04d8('0xa7')][_0x04d8('0x52')];_0x3b97a1+=0x1){_0x1e1037[_0x04d8('0x66')][_0x04d8('0xa7')][_0x3b97a1]={'filename':_0x1e1037[_0x04d8('0x66')][_0x04d8('0xa7')][_0x3b97a1][_0x04d8('0x2c')],'path':path[_0x04d8('0xa8')](config[_0x04d8('0xa9')],_0x04d8('0xaa'),_0x1e1037[_0x04d8('0x66')][_0x04d8('0xa7')][_0x3b97a1]['basename'])};}}var _0x85b726=_0xbc71da[_0x04d8('0xab')]();return respondWithRpcPromise(_0x04d8('0xac'),_0x04d8('0xad'),{'account':_0x85b726,'message':_0x1e1037[_0x04d8('0x66')]});})[_0x04d8('0x25')](function(_0x2c7068){if(!_0x2c7068)return;_0x253124=_0x2c7068;if(!_0x129dc2[_0x04d8('0xae')])throw new Error(_0x04d8('0xaf'));if(_0x129dc2['List'][_0x04d8('0xa2')]['length'])return _0x129dc2[_0x04d8('0xae')][_0x04d8('0xa2')][0x0];return db[_0x04d8('0xa1')]['create'](_[_0x04d8('0xb0')](_0x1e1037[_0x04d8('0x66')],{'firstName':_0x1e1037['body']['to'],'email':_0x1e1037[_0x04d8('0x66')]['to'],'phone':_0x1e1037[_0x04d8('0x66')]['to'],'ListId':_0x129dc2[_0x04d8('0x77')]}));})[_0x04d8('0x25')](function(_0x2ecd76){if(!_0x2ecd76)return;var _0x363d4d={'UserId':_0x1e1037[_0x04d8('0x37')]['id'],'ContactId':_0x2ecd76['id'],'MailAccountId':_0x129dc2['id'],'inReplyTo':_0x253124[_0x04d8('0xb1')],'to':_0x1e1037[_0x04d8('0x66')][_0x04d8('0xa5')],'cc':_0x1e1037['body']['cc'],'subject':_0x1e1037[_0x04d8('0x66')][_0x04d8('0xb2')],'attach':_0x1e1037[_0x04d8('0x66')]['attach'],'firstMsgDirection':_0x04d8('0xb3'),'lastMsgAt':moment()['format'](_0x04d8('0xb4')),'lastMsgDirection':'out','Messages':[_['merge'](_0x1e1037[_0x04d8('0x66')],{'messageId':_0x253124[_0x04d8('0xb1')],'sentAt':moment()[_0x04d8('0x9e')](_0x04d8('0xb4')),'read':!![],'MailAccountId':_0x129dc2['id'],'UserId':_0x1e1037[_0x04d8('0x37')]['id'],'ContactId':_0x2ecd76['id']})]};if(_0x1e1037[_0x04d8('0x66')][_0x04d8('0xb5')]){_0x363d4d=_[_0x04d8('0x5b')](_0x363d4d,_0x1e1037[_0x04d8('0x66')][_0x04d8('0xb5')]);}return db['MailInteraction'][_0x04d8('0x6c')](_0x363d4d,{'include':[{'model':db['MailMessage'],'as':_0x04d8('0xb6')}]});})[_0x04d8('0x25')](respondWithResult(_0x3c03fc,null))['catch'](handleError(_0x3c03fc,null));};exports[_0x04d8('0xb7')]=function(_0x3ec5f6,_0x5964a9){return db[_0x04d8('0x5d')][_0x04d8('0x65')]({'where':{'id':_0x3ec5f6['params']['id']},'include':[{'model':db[_0x04d8('0x45')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x04d8('0xb8')],'as':'CloudProvider','raw':!![]}]}]})[_0x04d8('0x25')](handleEntityNotFound(_0x5964a9,null))[_0x04d8('0x25')](function(_0x1d3871){if(!_0x1d3871[_0x04d8('0x43')])return;var _0x4ac793=_0x1d3871['getSmtpOptions']();return respondWithRpcPromise(_0x04d8('0xb9'),'verifySmtp',{'account':_0x4ac793});})[_0x04d8('0x25')](respondWithResult(_0x5964a9,null))[_0x04d8('0x1a')](handleError(_0x5964a9,null));};exports[_0x04d8('0x26')]=function(_0x10ca3e,_0x58b9ed){return db[_0x04d8('0x5d')][_0x04d8('0x65')]({'where':{'id':_0x10ca3e['params']['id']}})[_0x04d8('0x25')](handleEntityNotFound(_0x58b9ed,null))[_0x04d8('0x25')](function(_0x3d7106){if(_0x3d7106&&_0x3d7106['service']){throw new db[(_0x04d8('0xba'))]['ValidationError'](_0x04d8('0xbb'));}return _0x3d7106;})[_0x04d8('0x25')](removeEntity(_0x58b9ed,null))[_0x04d8('0x1a')](handleError(_0x58b9ed,null));};exports[_0x04d8('0xbc')]=function(_0x3c9fb1,_0x4d13a6){return db[_0x04d8('0x5d')][_0x04d8('0x65')]({'where':{'id':_0x3c9fb1[_0x04d8('0x62')]['id']}})[_0x04d8('0x25')](handleEntityNotFound(_0x4d13a6,null))[_0x04d8('0x25')](function(_0x1cda28){if(_0x1cda28){return _0x1cda28[_0x04d8('0xbc')](_0x3c9fb1[_0x04d8('0x66')][_0x04d8('0x70')],_[_0x04d8('0xbd')](_0x3c9fb1[_0x04d8('0x66')],['ids','id'])||{})['spread'](function(_0x25c213){for(var _0x3ae1af=0x0;_0x3ae1af<_0x3c9fb1[_0x04d8('0x66')]['ids'][_0x04d8('0x52')];_0x3ae1af+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x3c9fb1[_0x04d8('0x66')][_0x04d8('0x70')][_0x3ae1af]),'MailAccountId':Number(_0x3c9fb1[_0x04d8('0x62')]['id'])});}return _0x25c213;});}})[_0x04d8('0x25')](respondWithResult(_0x4d13a6,null))[_0x04d8('0x1a')](handleError(_0x4d13a6,null));};exports['removeAgents']=function(_0x5ed50b,_0x1da510){return db[_0x04d8('0x5d')][_0x04d8('0x65')]({'where':{'id':_0x5ed50b[_0x04d8('0x62')]['id']}})[_0x04d8('0x25')](handleEntityNotFound(_0x1da510,null))[_0x04d8('0x25')](function(_0x335a3f){if(_0x335a3f){return _0x335a3f[_0x04d8('0xbe')](_0x5ed50b[_0x04d8('0x4f')][_0x04d8('0x70')])['then'](function(){if(_[_0x04d8('0xbf')](_0x5ed50b[_0x04d8('0x4f')]['ids'])){for(var _0x341427=0x0;_0x341427<_0x5ed50b[_0x04d8('0x4f')][_0x04d8('0x70')]['length'];_0x341427+=0x1){socket[_0x04d8('0xc0')](_0x04d8('0xc1'),{'UserId':Number(_0x5ed50b[_0x04d8('0x4f')][_0x04d8('0x70')][_0x341427]),'MailAccountId':Number(_0x5ed50b[_0x04d8('0x62')]['id'])});}}else{socket[_0x04d8('0xc0')](_0x04d8('0xc1'),{'UserId':Number(_0x5ed50b['query']['ids']),'MailAccountId':Number(_0x5ed50b['params']['id'])});}});}})[_0x04d8('0x25')](respondWithStatusCode(_0x1da510,null))[_0x04d8('0x1a')](handleError(_0x1da510,null));};exports[_0x04d8('0xc2')]=function(_0x3b6a48,_0x5cd4fe){var _0x3eb7e1={};var _0x5e98ee={};var _0x36424a;var _0x40ea75;return db[_0x04d8('0x5d')][_0x04d8('0x6e')]({'where':{'id':_0x3b6a48[_0x04d8('0x62')]['id']}})[_0x04d8('0x25')](handleEntityNotFound(_0x5cd4fe,null))[_0x04d8('0x25')](function(_0x30fa10){if(_0x30fa10){_0x36424a=_0x30fa10;_0x5e98ee[_0x04d8('0x4b')]=_['keys'](db[_0x04d8('0x8a')]['rawAttributes']);_0x5e98ee['query']=_[_0x04d8('0x4c')](_0x3b6a48[_0x04d8('0x4f')]);_0x5e98ee['filters']=_[_0x04d8('0x4e')](_0x5e98ee['model'],_0x5e98ee[_0x04d8('0x4f')]);_0x3eb7e1[_0x04d8('0x50')]=_[_0x04d8('0x4e')](_0x5e98ee[_0x04d8('0x4b')],qs[_0x04d8('0x51')](_0x3b6a48[_0x04d8('0x4f')]['fields']));_0x3eb7e1[_0x04d8('0x50')]=_0x3eb7e1[_0x04d8('0x50')][_0x04d8('0x52')]?_0x3eb7e1['attributes']:_0x5e98ee[_0x04d8('0x4b')];_0x3eb7e1[_0x04d8('0x55')]=qs['sort'](_0x3b6a48[_0x04d8('0x4f')][_0x04d8('0x56')]);_0x3eb7e1[_0x04d8('0x57')]=qs[_0x04d8('0x4d')](_[_0x04d8('0x58')](_0x3b6a48[_0x04d8('0x4f')],_0x5e98ee[_0x04d8('0x4d')]));if(_0x3b6a48[_0x04d8('0x4f')][_0x04d8('0x5a')]){_0x3eb7e1[_0x04d8('0x57')]=_['merge'](_0x3eb7e1[_0x04d8('0x57')],{'$or':_[_0x04d8('0x48')](_0x3eb7e1['attributes'],function(_0x1a60de){var _0x3013d3={};_0x3013d3[_0x1a60de]={'$like':'%'+_0x3b6a48[_0x04d8('0x4f')]['filter']+'%'};return _0x3013d3;})});}_0x3eb7e1=_[_0x04d8('0x5b')]({},_0x3eb7e1,_0x3b6a48[_0x04d8('0x5c')]);return _0x36424a[_0x04d8('0xc2')](_0x3eb7e1);}})['then'](function(_0x2cde15){if(_0x2cde15){_0x40ea75=_0x2cde15['length'];if(!_0x3b6a48['query'][_0x04d8('0x53')]('nolimit')){_0x3eb7e1['limit']=qs[_0x04d8('0x1f')](_0x3b6a48['query']['limit']);_0x3eb7e1['offset']=qs[_0x04d8('0x21')](_0x3b6a48['query'][_0x04d8('0x21')]);}return _0x36424a[_0x04d8('0xc2')](_0x3eb7e1);}})[_0x04d8('0x25')](function(_0x503187){if(_0x503187){return _0x503187?{'count':_0x40ea75,'rows':_0x503187}:null;}})[_0x04d8('0x25')](respondWithResult(_0x5cd4fe,null))[_0x04d8('0x1a')](handleError(_0x5cd4fe,null));}; \ No newline at end of file +var _0x5999=['addInteraction','ids','getInteractions','MailInteraction','CmContact','Owner','fullname','internal','Tags','color','tag','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','stack','getApplications','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','CmList','List','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','Contacts','messageId','subject','attach','out','Interaction','verifySmtp','VerifySmtp','Sequelize','addAgents','omit','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','destroy','get','MailAccounts','UserProfileResource','end','name','send','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','smtp.office365.com','user','username','pass','password','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','where','type','VIRTUAL','filter','merge','options','includeAll','findAll','show','params','MailServerOut','include','find','update','body','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','Disposition','create','getDispositions','findOne','hasOwnProperty','nolimit','rows','removeDispositions','MailAccountId','getAnswers','CannedAnswer','removeAnswers','provider','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp'];(function(_0x52cd28,_0x59fe04){var _0x3c0339=function(_0x2ff9c){while(--_0x2ff9c){_0x52cd28['push'](_0x52cd28['shift']());}};_0x3c0339(++_0x59fe04);}(_0x5999,0x103));var _0x9599=function(_0x1828c1,_0x363eb1){_0x1828c1=_0x1828c1-0x0;var _0x5d2ef2=_0x5999[_0x1828c1];return _0x5d2ef2;};'use strict';var moment=require(_0x9599('0x0'));var BPromise=require(_0x9599('0x1'));var util=require(_0x9599('0x2'));var path=require(_0x9599('0x3'));var _=require(_0x9599('0x4'));var juice=require('juice');var Redis=require(_0x9599('0x5'));var qs=require(_0x9599('0x6'));var logger=require(_0x9599('0x7'))(_0x9599('0x8'));var config=require('../../config/environment');var db=require(_0x9599('0x9'))['db'];config[_0x9599('0xa')]=_[_0x9599('0xb')](config[_0x9599('0xa')],{'host':_0x9599('0xc'),'port':0x18eb});var socket=require(_0x9599('0xd'))(new Redis(config['redis']));require(_0x9599('0xe'))['register'](socket);var jayson=require(_0x9599('0xf'));var client=jayson[_0x9599('0x10')][_0x9599('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x34eaea,_0x542646,_0x567394,_0x23d3f1){return new BPromise(function(_0x23d0cf,_0x10b474){var _0x285405=_0x23d3f1||client;return _0x285405[_0x9599('0x12')](_0x34eaea,_0x567394)[_0x9599('0x13')](function(_0x1230b7){logger[_0x9599('0x14')](_0x9599('0x15'),_0x542646,_0x9599('0x16'));logger[_0x9599('0x17')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x542646,_0x9599('0x16'),JSON[_0x9599('0x18')](_0x1230b7));if(_0x1230b7[_0x9599('0x19')]){if(_0x1230b7[_0x9599('0x19')][_0x9599('0x1a')]===0x1f4){logger['error'](_0x9599('0x15'),_0x542646,_0x1230b7['error'][_0x9599('0x1b')]);return _0x10b474(_0x1230b7[_0x9599('0x19')][_0x9599('0x1b')]);}logger[_0x9599('0x19')]('MailAccount,\x20%s,\x20%s',_0x542646,_0x1230b7[_0x9599('0x19')][_0x9599('0x1b')]);return _0x23d0cf(_0x1230b7[_0x9599('0x19')][_0x9599('0x1b')]);}else{logger['info'](_0x9599('0x15'),_0x542646,_0x9599('0x16'));_0x23d0cf(_0x1230b7[_0x9599('0x1c')]['message']);}})[_0x9599('0x1d')](function(_0x5beb22){logger[_0x9599('0x19')](_0x9599('0x15'),_0x542646,_0x5beb22);_0x10b474(_0x5beb22);});});}function respondWithStatusCode(_0x2befc3,_0x58fefc){_0x58fefc=_0x58fefc||0xcc;return function(_0x57e344){if(_0x57e344){return _0x2befc3[_0x9599('0x1e')](_0x58fefc);}return _0x2befc3[_0x9599('0x1f')](_0x58fefc)['end']();};}function respondWithResult(_0x167fbf,_0x4f7c9b){_0x4f7c9b=_0x4f7c9b||0xc8;return function(_0x48a22b){if(_0x48a22b){return _0x167fbf['status'](_0x4f7c9b)[_0x9599('0x20')](_0x48a22b);}};}function respondWithFilteredResult(_0x43bee7,_0x3cff16){return function(_0x10366a){if(_0x10366a){var _0x46546c=typeof _0x3cff16[_0x9599('0x21')]==='undefined'&&typeof _0x3cff16[_0x9599('0x22')]===_0x9599('0x23');var _0x48722f=_0x10366a[_0x9599('0x24')];var _0x30a46d=_0x46546c?0x0:_0x3cff16[_0x9599('0x21')];var _0x2ce0f9=_0x46546c?_0x10366a[_0x9599('0x24')]:_0x3cff16['offset']+_0x3cff16[_0x9599('0x22')];var _0x11db9b;if(_0x2ce0f9>=_0x48722f){_0x2ce0f9=_0x48722f;_0x11db9b=0xc8;}else{_0x11db9b=0xce;}_0x43bee7[_0x9599('0x1f')](_0x11db9b);return _0x43bee7[_0x9599('0x25')]('Content-Range',_0x30a46d+'-'+_0x2ce0f9+'/'+_0x48722f)[_0x9599('0x20')](_0x10366a);}return null;};}function saveUpdates(_0x2ad93c){return function(_0x20fd04){if(_0x20fd04){return _0x20fd04['update'](_0x2ad93c)[_0x9599('0x13')](function(_0x54c6cb){return _0x54c6cb;});}return null;};}function removeEntity(_0x1ab112){return function(_0x1dbbaf){if(_0x1dbbaf){return _0x1dbbaf[_0x9599('0x26')]()['then'](function(){var _0x105ab3=_0x1dbbaf[_0x9599('0x27')]({'plain':!![]});var _0x37ea7b=_0x9599('0x28');return db[_0x9599('0x29')][_0x9599('0x26')]({'where':{'type':_0x37ea7b,'resourceId':_0x105ab3['id']}})[_0x9599('0x13')](function(){return _0x1dbbaf;});})[_0x9599('0x13')](function(){_0x1ab112['status'](0xcc)[_0x9599('0x2a')]();});}};}function handleEntityNotFound(_0x2a8c24){return function(_0x3df687){if(!_0x3df687){_0x2a8c24[_0x9599('0x1e')](0x194);}return _0x3df687;};}function handleError(_0x493489,_0x4e2afe){_0x4e2afe=_0x4e2afe||0x1f4;return function(_0x350b12){logger[_0x9599('0x19')](_0x350b12['stack']);if(_0x350b12[_0x9599('0x2b')]){delete _0x350b12[_0x9599('0x2b')];}_0x493489[_0x9599('0x1f')](_0x4e2afe)[_0x9599('0x2c')](_0x350b12);};}function getImapHost(_0x53e9b2){switch(_0x53e9b2){case _0x9599('0x2d'):return _0x9599('0x2e');case'yahoo':return _0x9599('0x2f');case _0x9599('0x30'):return'imap-mail.outlook.com';case _0x9599('0x31'):return _0x9599('0x32');}throw new Error(_0x9599('0x33'),_0x53e9b2);}function getSmtpHost(_0x3ab19d){switch(_0x3ab19d){case _0x9599('0x2d'):return _0x9599('0x34');case _0x9599('0x35'):return _0x9599('0x36');case _0x9599('0x30'):return'smtp-mail.outlook.com';case _0x9599('0x31'):return _0x9599('0x37');}throw new Error('Unknown\x20email\x20service\x20provider',_0x3ab19d);}function getAuthenticationOptions(_0x226af6,_0x2267b9){var _0x1e3234={};var _0x1fa997={};if(_0x226af6){_0x1e3234[_0x9599('0x38')]=_0x1fa997[_0x9599('0x38')]=_0x2267b9[_0x9599('0x39')];_0x1e3234['password']=_0x1fa997[_0x9599('0x3a')]=_0x2267b9[_0x9599('0x3b')];if(_0x2267b9[_0x9599('0x3c')]){_0x1e3234['modernAuthentication']=_0x1fa997[_0x9599('0x3c')]=!![];_0x1e3234['CloudProviderId']=_0x1fa997[_0x9599('0x3d')]=_0x2267b9[_0x9599('0x3d')];_0x1e3234['password']=_0x1fa997['pass']=null;}else{_0x1e3234[_0x9599('0x3d')]=_0x1fa997[_0x9599('0x3d')]=null;}_0x1e3234[_0x9599('0x3e')]=getImapHost(_0x226af6);_0x1e3234['port']=0x3e1;_0x1fa997[_0x9599('0x3e')]=getSmtpHost(_0x226af6);_0x1fa997[_0x9599('0x3f')]=0x24b;_0x1fa997[_0x9599('0x40')]=![];_0x1e3234[_0x9599('0x41')]=_0x1fa997[_0x9599('0x41')]=null;}else{if(_0x2267b9[_0x9599('0x42')]){_0x1e3234['user']=_0x1fa997[_0x9599('0x38')]=_0x2267b9[_0x9599('0x39')];_0x1e3234[_0x9599('0x3b')]=_0x1fa997[_0x9599('0x3a')]=_0x2267b9['password'];}else{_0x1e3234['authentication']=_0x1fa997[_0x9599('0x42')]=![];_0x1e3234[_0x9599('0x38')]=_0x1fa997[_0x9599('0x38')]=null;_0x1e3234[_0x9599('0x3b')]=_0x1fa997[_0x9599('0x3a')]=null;}_0x1e3234[_0x9599('0x3e')]=_0x2267b9[_0x9599('0x43')][_0x9599('0x3e')];_0x1e3234[_0x9599('0x3f')]=_0x2267b9['Imap'][_0x9599('0x3f')];_0x1fa997[_0x9599('0x3e')]=_0x2267b9[_0x9599('0x44')][_0x9599('0x3e')];_0x1fa997['port']=_0x2267b9['Smtp']['port'];}return{'Imap':_0x1e3234,'Smtp':_0x1fa997};}exports[_0x9599('0x45')]=function(_0x20af13,_0x3d53aa){var _0x3321e9={'include':[{'model':db[_0x9599('0x46')],'as':_0x9599('0x43')},{'model':db['MailServerOut'],'as':_0x9599('0x44')},{'model':db[_0x9599('0x47')],'as':_0x9599('0x48')}]},_0x374c34={},_0x1ccd45={'count':0x0,'rows':[]};var _0x3d291d=_[_0x9599('0x49')](db[_0x9599('0x4a')][_0x9599('0x4b')],function(_0x2bee0b){return{'name':_0x2bee0b[_0x9599('0x4c')],'type':_0x2bee0b['type'][_0x9599('0x4d')]};});_0x374c34[_0x9599('0x4e')]=_[_0x9599('0x49')](_0x3d291d,'name');_0x374c34[_0x9599('0x4f')]=_[_0x9599('0x50')](_0x20af13['query']);_0x374c34[_0x9599('0x51')]=_[_0x9599('0x52')](_0x374c34[_0x9599('0x4e')],_0x374c34[_0x9599('0x4f')]);_0x3321e9[_0x9599('0x53')]=_[_0x9599('0x52')](_0x374c34['model'],qs[_0x9599('0x54')](_0x20af13['query'][_0x9599('0x54')]));_0x3321e9[_0x9599('0x53')]=_0x3321e9[_0x9599('0x53')][_0x9599('0x55')]?_0x3321e9['attributes']:_0x374c34[_0x9599('0x4e')];if(!_0x20af13[_0x9599('0x4f')]['hasOwnProperty']('nolimit')){_0x3321e9['limit']=qs['limit'](_0x20af13[_0x9599('0x4f')][_0x9599('0x22')]);_0x3321e9[_0x9599('0x21')]=qs[_0x9599('0x21')](_0x20af13['query']['offset']);}_0x3321e9[_0x9599('0x56')]=qs[_0x9599('0x57')](_0x20af13[_0x9599('0x4f')][_0x9599('0x57')]);_0x3321e9['where']=qs[_0x9599('0x51')](_[_0x9599('0x58')](_0x20af13[_0x9599('0x4f')],_0x374c34['filters']),_0x3d291d);if(_0x20af13[_0x9599('0x4f')]['filter']){_0x3321e9[_0x9599('0x59')]=_['merge'](_0x3321e9[_0x9599('0x59')],{'$or':_[_0x9599('0x49')](_0x3d291d,function(_0x1e96ee){if(_0x1e96ee[_0x9599('0x5a')]!==_0x9599('0x5b')){var _0x4f67a4={};_0x4f67a4[_0x1e96ee[_0x9599('0x2b')]]={'$like':'%'+_0x20af13[_0x9599('0x4f')][_0x9599('0x5c')]+'%'};return _0x4f67a4;}})});}_0x3321e9=_[_0x9599('0x5d')]({},_0x3321e9,_0x20af13[_0x9599('0x5e')]);var _0x3f4443={'where':_0x3321e9['where']};return db['MailAccount'][_0x9599('0x24')](_0x3f4443)[_0x9599('0x13')](function(_0x21d912){_0x1ccd45[_0x9599('0x24')]=_0x21d912;if(_0x20af13[_0x9599('0x4f')][_0x9599('0x5f')]){_0x3321e9['include']=[{'all':!![]}];}return db[_0x9599('0x4a')][_0x9599('0x60')](_0x3321e9);})[_0x9599('0x13')](function(_0x56ffa7){_0x1ccd45['rows']=_0x56ffa7;return _0x1ccd45;})[_0x9599('0x13')](respondWithFilteredResult(_0x3d53aa,_0x3321e9))[_0x9599('0x1d')](handleError(_0x3d53aa,null));};exports[_0x9599('0x61')]=function(_0x5af466,_0x23e3e1){var _0x16a0f3={'raw':![],'where':{'id':_0x5af466[_0x9599('0x62')]['id']},'include':[{'model':db[_0x9599('0x46')],'as':'Imap'},{'model':db[_0x9599('0x63')],'as':_0x9599('0x44')},{'model':db[_0x9599('0x47')],'as':_0x9599('0x48')}]},_0x50d454={};_0x50d454[_0x9599('0x4e')]=_[_0x9599('0x50')](db[_0x9599('0x4a')][_0x9599('0x4b')]);_0x50d454[_0x9599('0x4f')]=_['keys'](_0x5af466[_0x9599('0x4f')]);_0x50d454[_0x9599('0x51')]=_[_0x9599('0x52')](_0x50d454['model'],_0x50d454['query']);_0x16a0f3[_0x9599('0x53')]=_[_0x9599('0x52')](_0x50d454['model'],qs[_0x9599('0x54')](_0x5af466[_0x9599('0x4f')][_0x9599('0x54')]));_0x16a0f3[_0x9599('0x53')]=_0x16a0f3['attributes'][_0x9599('0x55')]?_0x16a0f3['attributes']:_0x50d454[_0x9599('0x4e')];if(_0x5af466['query']['includeAll']){_0x16a0f3[_0x9599('0x64')]=[{'all':!![]}];}_0x16a0f3=_[_0x9599('0x5d')]({},_0x16a0f3,_0x5af466[_0x9599('0x5e')]);return db['MailAccount'][_0x9599('0x65')](_0x16a0f3)[_0x9599('0x13')](handleEntityNotFound(_0x23e3e1,null))['then'](respondWithResult(_0x23e3e1,null))[_0x9599('0x1d')](handleError(_0x23e3e1,null));};exports[_0x9599('0x66')]=function(_0x4de247,_0x1876b9){if(_0x4de247[_0x9599('0x67')]['id']){delete _0x4de247['body']['id'];}var _0x8f8db2=_0x4de247[_0x9599('0x67')]['provider']===_0x9599('0x68')?null:_0x4de247[_0x9599('0x67')]['provider'];var _0x214beb=_0x4de247[_0x9599('0x67')][_0x9599('0x43')]||{};var _0x5cc0e9=_0x4de247[_0x9599('0x67')][_0x9599('0x44')]||{};if(_0x8f8db2){_0x214beb[_0x9599('0x3e')]=getImapHost(_0x8f8db2);_0x214beb['port']=0x3e1;_0x5cc0e9[_0x9599('0x3e')]=getSmtpHost(_0x8f8db2);_0x5cc0e9['port']=0x24b;_0x5cc0e9[_0x9599('0x40')]=![];}if(_0x5cc0e9[_0x9599('0x3c')]){_0x5cc0e9[_0x9599('0x40')]=![];}else{_0x5cc0e9['CloudProviderId']=null;}if(!_0x214beb[_0x9599('0x3c')])_0x214beb[_0x9599('0x3d')]=null;_0x4de247['body'][_0x9599('0x43')]=_0x214beb;_0x4de247[_0x9599('0x67')][_0x9599('0x44')]=_0x5cc0e9;return db[_0x9599('0x4a')][_0x9599('0x65')]({'where':{'id':_0x4de247['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x9599('0x43')},{'model':db[_0x9599('0x63')],'as':_0x9599('0x44')},{'model':db['Pause'],'as':_0x9599('0x48')}]})['then'](handleEntityNotFound(_0x1876b9,null))[_0x9599('0x13')](function(_0x182da8){if(!_0x182da8)throw new Error(_0x9599('0x69'));if(_0x182da8[_0x9599('0x41')])delete _0x4de247[_0x9599('0x67')][_0x9599('0x43')];return _0x182da8;})[_0x9599('0x13')](saveUpdates(_0x4de247[_0x9599('0x67')],null))[_0x9599('0x13')](function(_0x2a4357){if(!_0x4de247['body'][_0x9599('0x43')])return _0x2a4357;return db[_0x9599('0x46')][_0x9599('0x66')](_0x4de247['body'][_0x9599('0x43')],{'where':{'MailAccountId':_0x2a4357['id']}})[_0x9599('0x13')](function(){return _0x2a4357;});})[_0x9599('0x13')](function(_0xaa2559){if(!_0x4de247[_0x9599('0x67')]['Smtp'])return _0xaa2559;return db[_0x9599('0x63')][_0x9599('0x66')](_0x4de247[_0x9599('0x67')][_0x9599('0x44')],{'where':{'MailAccountId':_0xaa2559['id']}})[_0x9599('0x13')](function(){return _0xaa2559;});})[_0x9599('0x13')](respondWithResult(_0x1876b9,null))[_0x9599('0x1d')](handleError(_0x1876b9,null));};exports[_0x9599('0x6a')]=function(_0x2757cd,_0x33d846){return db[_0x9599('0x4a')]['describe']()['then'](respondWithResult(_0x33d846,null))[_0x9599('0x1d')](handleError(_0x33d846,null));};exports[_0x9599('0x6b')]=function(_0xd5f12b,_0x725d5f){if(_0xd5f12b[_0x9599('0x67')]['id']){delete _0xd5f12b['body']['id'];}return db[_0x9599('0x4a')][_0x9599('0x65')]({'where':{'id':_0xd5f12b['params']['id']}})[_0x9599('0x13')](handleEntityNotFound(_0x725d5f,null))[_0x9599('0x13')](function(_0x1e579f){if(_0x1e579f){_0xd5f12b[_0x9599('0x67')]['MailAccountId']=_0x1e579f['id'];return db[_0x9599('0x6c')][_0x9599('0x6d')](_0xd5f12b['body']);}})[_0x9599('0x13')](respondWithResult(_0x725d5f,null))[_0x9599('0x1d')](handleError(_0x725d5f,null));};exports[_0x9599('0x6e')]=function(_0x145913,_0x402769){var _0x19ca52={'raw':![],'where':{}};var _0x37997a={};var _0x4d88cb={'count':0x0,'rows':[]};return db[_0x9599('0x4a')][_0x9599('0x6f')]({'where':{'id':_0x145913[_0x9599('0x62')]['id']}})[_0x9599('0x13')](handleEntityNotFound(_0x402769,null))[_0x9599('0x13')](function(_0x24c486){if(_0x24c486){_0x37997a['model']=_[_0x9599('0x50')](db['Disposition'][_0x9599('0x4b')]);_0x37997a[_0x9599('0x4f')]=_['keys'](_0x145913[_0x9599('0x4f')]);_0x37997a[_0x9599('0x51')]=_[_0x9599('0x52')](_0x37997a[_0x9599('0x4e')],_0x37997a['query']);_0x19ca52['attributes']=_[_0x9599('0x52')](_0x37997a[_0x9599('0x4e')],qs[_0x9599('0x54')](_0x145913['query'][_0x9599('0x54')]));_0x19ca52[_0x9599('0x53')]=_0x19ca52['attributes'][_0x9599('0x55')]?_0x19ca52[_0x9599('0x53')]:_0x37997a[_0x9599('0x4e')];if(!_0x145913[_0x9599('0x4f')][_0x9599('0x70')](_0x9599('0x71'))){_0x19ca52[_0x9599('0x22')]=qs[_0x9599('0x22')](_0x145913[_0x9599('0x4f')][_0x9599('0x22')]);_0x19ca52[_0x9599('0x21')]=qs['offset'](_0x145913[_0x9599('0x4f')][_0x9599('0x21')]);}_0x19ca52[_0x9599('0x56')]=qs[_0x9599('0x57')](_0x145913[_0x9599('0x4f')][_0x9599('0x57')]);_0x19ca52['where']=qs[_0x9599('0x51')](_[_0x9599('0x58')](_0x145913[_0x9599('0x4f')],_0x37997a[_0x9599('0x51')]));_0x19ca52[_0x9599('0x59')]['MailAccountId']=_0x24c486['id'];if(_0x145913['query'][_0x9599('0x5c')]){_0x19ca52[_0x9599('0x59')]=_[_0x9599('0x5d')](_0x19ca52[_0x9599('0x59')],{'$or':_[_0x9599('0x49')](_0x19ca52[_0x9599('0x53')],function(_0x5e3733){var _0x331fca={};_0x331fca[_0x5e3733]={'$like':'%'+_0x145913['query'][_0x9599('0x5c')]+'%'};return _0x331fca;})});}_0x19ca52=_['merge']({},_0x19ca52,_0x145913[_0x9599('0x5e')]);return db['Disposition'][_0x9599('0x24')]({'where':_0x19ca52[_0x9599('0x59')]})['then'](function(_0x2455d5){_0x4d88cb[_0x9599('0x24')]=_0x2455d5;if(_0x145913[_0x9599('0x4f')][_0x9599('0x5f')]){_0x19ca52['include']=[{'all':!![]}];}return db['Disposition'][_0x9599('0x60')](_0x19ca52);})[_0x9599('0x13')](function(_0x49a5df){_0x4d88cb[_0x9599('0x72')]=_0x49a5df;return _0x4d88cb;});}})[_0x9599('0x13')](respondWithFilteredResult(_0x402769,_0x19ca52))[_0x9599('0x1d')](handleError(_0x402769,null));};exports['removeDispositions']=function(_0xc5b8f8,_0x58fa38){return db[_0x9599('0x4a')][_0x9599('0x65')]({'where':{'id':_0xc5b8f8[_0x9599('0x62')]['id']}})[_0x9599('0x13')](handleEntityNotFound(_0x58fa38,null))[_0x9599('0x13')](function(_0x415c84){if(_0x415c84){return _0x415c84[_0x9599('0x73')](_0xc5b8f8[_0x9599('0x4f')]['ids']);}})[_0x9599('0x13')](respondWithStatusCode(_0x58fa38,null))[_0x9599('0x1d')](handleError(_0x58fa38,null));};exports['addAnswer']=function(_0x53e5be,_0x3f314f){if(_0x53e5be[_0x9599('0x67')]['id']){delete _0x53e5be['body']['id'];}return db[_0x9599('0x4a')][_0x9599('0x65')]({'where':{'id':_0x53e5be[_0x9599('0x62')]['id']}})[_0x9599('0x13')](handleEntityNotFound(_0x3f314f,null))[_0x9599('0x13')](function(_0x402572){if(_0x402572){_0x53e5be[_0x9599('0x67')][_0x9599('0x74')]=_0x402572['id'];return db['CannedAnswer'][_0x9599('0x6d')](_0x53e5be[_0x9599('0x67')]);}})['then'](respondWithResult(_0x3f314f,null))[_0x9599('0x1d')](handleError(_0x3f314f,null));};exports[_0x9599('0x75')]=function(_0xb2d452,_0x151ab2){var _0x369a62={'raw':![],'where':{}};var _0x4ad7b3={};var _0x4ec0ea={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0xb2d452[_0x9599('0x62')]['id']}})[_0x9599('0x13')](handleEntityNotFound(_0x151ab2,null))[_0x9599('0x13')](function(_0xcafb1f){if(_0xcafb1f){_0x4ad7b3[_0x9599('0x4e')]=_[_0x9599('0x50')](db[_0x9599('0x76')][_0x9599('0x4b')]);_0x4ad7b3[_0x9599('0x4f')]=_[_0x9599('0x50')](_0xb2d452[_0x9599('0x4f')]);_0x4ad7b3[_0x9599('0x51')]=_[_0x9599('0x52')](_0x4ad7b3['model'],_0x4ad7b3[_0x9599('0x4f')]);_0x369a62[_0x9599('0x53')]=_[_0x9599('0x52')](_0x4ad7b3[_0x9599('0x4e')],qs[_0x9599('0x54')](_0xb2d452['query'][_0x9599('0x54')]));_0x369a62[_0x9599('0x53')]=_0x369a62[_0x9599('0x53')][_0x9599('0x55')]?_0x369a62[_0x9599('0x53')]:_0x4ad7b3[_0x9599('0x4e')];if(!_0xb2d452[_0x9599('0x4f')]['hasOwnProperty'](_0x9599('0x71'))){_0x369a62['limit']=qs[_0x9599('0x22')](_0xb2d452['query'][_0x9599('0x22')]);_0x369a62[_0x9599('0x21')]=qs[_0x9599('0x21')](_0xb2d452[_0x9599('0x4f')]['offset']);}_0x369a62['order']=qs[_0x9599('0x57')](_0xb2d452[_0x9599('0x4f')][_0x9599('0x57')]);_0x369a62[_0x9599('0x59')]=qs[_0x9599('0x51')](_['pick'](_0xb2d452['query'],_0x4ad7b3[_0x9599('0x51')]));_0x369a62['where'][_0x9599('0x74')]=_0xcafb1f['id'];if(_0xb2d452[_0x9599('0x4f')][_0x9599('0x5c')]){_0x369a62[_0x9599('0x59')]=_[_0x9599('0x5d')](_0x369a62['where'],{'$or':_[_0x9599('0x49')](_0x369a62[_0x9599('0x53')],function(_0x113cb0){var _0x57bdc2={};_0x57bdc2[_0x113cb0]={'$like':'%'+_0xb2d452[_0x9599('0x4f')]['filter']+'%'};return _0x57bdc2;})});}_0x369a62=_['merge']({},_0x369a62,_0xb2d452[_0x9599('0x5e')]);return db[_0x9599('0x76')][_0x9599('0x24')]({'where':_0x369a62[_0x9599('0x59')]})[_0x9599('0x13')](function(_0x1d1734){_0x4ec0ea[_0x9599('0x24')]=_0x1d1734;if(_0xb2d452[_0x9599('0x4f')][_0x9599('0x5f')]){_0x369a62['include']=[{'all':!![]}];}return db[_0x9599('0x76')][_0x9599('0x60')](_0x369a62);})['then'](function(_0x3f779e){_0x4ec0ea[_0x9599('0x72')]=_0x3f779e;return _0x4ec0ea;});}})['then'](respondWithFilteredResult(_0x151ab2,_0x369a62))[_0x9599('0x1d')](handleError(_0x151ab2,null));};exports[_0x9599('0x77')]=function(_0x2fc0ad,_0x35f6ed){return db[_0x9599('0x4a')][_0x9599('0x65')]({'where':{'id':_0x2fc0ad[_0x9599('0x62')]['id']}})[_0x9599('0x13')](handleEntityNotFound(_0x35f6ed,null))[_0x9599('0x13')](function(_0x51c258){if(_0x51c258){return _0x51c258[_0x9599('0x77')](_0x2fc0ad['query']['ids']);}})[_0x9599('0x13')](respondWithStatusCode(_0x35f6ed,null))[_0x9599('0x1d')](handleError(_0x35f6ed,null));};exports[_0x9599('0x6d')]=function(_0x40c5a1,_0x5b9356){var _0x3ed493={'name':_0x40c5a1[_0x9599('0x67')][_0x9599('0x2b')],'key':_0x40c5a1['body'][_0x9599('0x4d')],'provider':_0x40c5a1[_0x9599('0x67')][_0x9599('0x78')]==='custom'?null:_0x40c5a1[_0x9599('0x67')]['provider'],'email':_0x40c5a1[_0x9599('0x67')][_0x9599('0x79')],'ListId':_0x40c5a1[_0x9599('0x67')][_0x9599('0x7a')],'active':!_[_0x9599('0x7b')](_0x40c5a1[_0x9599('0x67')]['active'])?_0x40c5a1[_0x9599('0x67')][_0x9599('0x7c')]:!![],'description':_0x40c5a1['body'][_0x9599('0x7d')]||null};var _0x25ff6a=getAuthenticationOptions(_0x3ed493['provider'],_0x40c5a1[_0x9599('0x67')]);_0x3ed493['Imap']=_0x25ff6a['Imap'];_0x3ed493[_0x9599('0x44')]=_0x25ff6a[_0x9599('0x44')];return db[_0x9599('0x4a')][_0x9599('0x6d')](_0x3ed493,{'include':[{'model':db[_0x9599('0x63')],'as':_0x9599('0x44')},{'model':db['MailServerIn'],'as':_0x9599('0x43')}]})[_0x9599('0x13')](function(_0x1b610c){var _0x5d885b=_0x40c5a1[_0x9599('0x38')]['get']({'plain':!![]});if(!_0x5d885b)throw new Error(_0x9599('0x7e'));if(_0x5d885b[_0x9599('0x7f')]===_0x9599('0x38')){var _0x195dc1=_0x1b610c[_0x9599('0x27')]({'plain':!![]});return db[_0x9599('0x80')][_0x9599('0x65')]({'where':{'name':_0x9599('0x28'),'userProfileId':_0x5d885b[_0x9599('0x81')]},'raw':!![]})[_0x9599('0x13')](function(_0xea7637){if(_0xea7637&&_0xea7637['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x195dc1['name'],'resourceId':_0x195dc1['id'],'type':_0xea7637[_0x9599('0x2b')],'sectionId':_0xea7637['id']},{})[_0x9599('0x13')](function(){return _0x1b610c;});}else{return _0x1b610c;}})[_0x9599('0x1d')](function(_0x108c5d){logger[_0x9599('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x108c5d);throw _0x108c5d;});}return _0x1b610c;})[_0x9599('0x13')](respondWithResult(_0x5b9356,0xc9))['catch'](handleError(_0x5b9356,null));};exports['getImap']=function(_0x4adab1,_0x3ee1e7){return db[_0x9599('0x4a')][_0x9599('0x6f')]({'where':{'id':_0x4adab1['params']['id']}})[_0x9599('0x13')](handleEntityNotFound(_0x3ee1e7,null))[_0x9599('0x13')](function(_0x5e9a33){if(_0x5e9a33){return _0x5e9a33[_0x9599('0x82')]();}return null;})['then'](respondWithResult(_0x3ee1e7,null))[_0x9599('0x1d')](handleError(_0x3ee1e7,null));};exports['addImap']=function(_0x2b21f9,_0x5f21cf){if(_0x2b21f9[_0x9599('0x67')]['id']){delete _0x2b21f9[_0x9599('0x67')]['id'];}return db[_0x9599('0x4a')][_0x9599('0x65')]({'where':{'id':_0x2b21f9[_0x9599('0x62')]['id']}})['then'](handleEntityNotFound(_0x5f21cf,null))['then'](function(_0x4947ab){if(_0x4947ab){_0x2b21f9[_0x9599('0x67')]['MailAccountId']=_0x4947ab['id'];return db[_0x9599('0x46')][_0x9599('0x6d')](_0x2b21f9[_0x9599('0x67')]);}})[_0x9599('0x13')](respondWithResult(_0x5f21cf,null))['catch'](handleError(_0x5f21cf,null));};exports[_0x9599('0x83')]=function(_0x341128,_0x650b35){return db[_0x9599('0x4a')][_0x9599('0x6f')]({'where':{'id':_0x341128[_0x9599('0x62')]['id']}})[_0x9599('0x13')](handleEntityNotFound(_0x650b35,null))[_0x9599('0x13')](function(_0x162a18){if(_0x162a18){return _0x162a18[_0x9599('0x84')](null);}return null;})[_0x9599('0x13')](respondWithStatusCode(_0x650b35,null))[_0x9599('0x1d')](handleError(_0x650b35,null));};exports[_0x9599('0x85')]=function(_0x1af074,_0x209b02){return db[_0x9599('0x4a')][_0x9599('0x6f')]({'where':{'id':_0x1af074['params']['id']}})['then'](handleEntityNotFound(_0x209b02,null))[_0x9599('0x13')](function(_0x497791){if(_0x497791){return _0x497791[_0x9599('0x85')]();}return null;})[_0x9599('0x13')](respondWithResult(_0x209b02,null))[_0x9599('0x1d')](handleError(_0x209b02,null));};exports[_0x9599('0x86')]=function(_0x2c62bb,_0xe16c6c){if(_0x2c62bb[_0x9599('0x67')]['id']){delete _0x2c62bb[_0x9599('0x67')]['id'];}return db[_0x9599('0x4a')][_0x9599('0x65')]({'where':{'id':_0x2c62bb[_0x9599('0x62')]['id']}})[_0x9599('0x13')](handleEntityNotFound(_0xe16c6c,null))[_0x9599('0x13')](function(_0x557344){if(_0x557344){_0x2c62bb[_0x9599('0x67')][_0x9599('0x74')]=_0x557344['id'];return db['MailServerOut'][_0x9599('0x6d')](_0x2c62bb[_0x9599('0x67')]);}})[_0x9599('0x13')](respondWithResult(_0xe16c6c,null))['catch'](handleError(_0xe16c6c,null));};exports[_0x9599('0x87')]=function(_0x549c9f,_0x391268){return db[_0x9599('0x4a')]['findOne']({'where':{'id':_0x549c9f[_0x9599('0x62')]['id']}})[_0x9599('0x13')](handleEntityNotFound(_0x391268,null))[_0x9599('0x13')](function(_0x273cf1){if(_0x273cf1){return _0x273cf1[_0x9599('0x88')](null);}return null;})[_0x9599('0x13')](respondWithStatusCode(_0x391268,null))[_0x9599('0x1d')](handleError(_0x391268,null));};exports[_0x9599('0x89')]=function(_0x58c9f0,_0x3ed846){return db['MailInteraction'][_0x9599('0x65')]({'where':{'id':_0x58c9f0[_0x9599('0x62')]['id']}})['then'](handleEntityNotFound(_0x3ed846,null))['then'](function(_0x5ba581){if(_0x5ba581){return _0x5ba581[_0x9599('0x89')](_0x58c9f0[_0x9599('0x67')][_0x9599('0x8a')],_['omit'](_0x58c9f0['body'],[_0x9599('0x8a'),'id'])||{});}})[_0x9599('0x13')](respondWithResult(_0x3ed846,null))[_0x9599('0x1d')](handleError(_0x3ed846,null));};exports[_0x9599('0x8b')]=function(_0x3b505b,_0x26546e){var _0x34b563={'raw':![],'where':{}};var _0x259792={};var _0xc3e96a={'count':0x0,'rows':[]};return db[_0x9599('0x4a')]['findOne']({'where':{'id':_0x3b505b[_0x9599('0x62')]['id']}})[_0x9599('0x13')](handleEntityNotFound(_0x26546e,null))[_0x9599('0x13')](function(_0x356a7){if(_0x356a7){_0x259792[_0x9599('0x4e')]=_[_0x9599('0x50')](db[_0x9599('0x8c')][_0x9599('0x4b')]);_0x259792[_0x9599('0x4f')]=_[_0x9599('0x50')](_0x3b505b[_0x9599('0x4f')]);_0x259792[_0x9599('0x51')]=_[_0x9599('0x52')](_0x259792['model'],_0x259792[_0x9599('0x4f')]);_0x34b563[_0x9599('0x53')]=_[_0x9599('0x52')](_0x259792[_0x9599('0x4e')],qs[_0x9599('0x54')](_0x3b505b[_0x9599('0x4f')][_0x9599('0x54')]));_0x34b563[_0x9599('0x53')]=_0x34b563['attributes'][_0x9599('0x55')]?_0x34b563['attributes']:_0x259792['model'];if(!_0x3b505b['query']['hasOwnProperty'](_0x9599('0x71'))){_0x34b563[_0x9599('0x22')]=qs['limit'](_0x3b505b[_0x9599('0x4f')][_0x9599('0x22')]);_0x34b563[_0x9599('0x21')]=qs[_0x9599('0x21')](_0x3b505b[_0x9599('0x4f')][_0x9599('0x21')]);}_0x34b563[_0x9599('0x56')]=qs[_0x9599('0x57')](_0x3b505b[_0x9599('0x4f')][_0x9599('0x57')]);_0x34b563[_0x9599('0x59')]=qs[_0x9599('0x51')](_[_0x9599('0x58')](_0x3b505b[_0x9599('0x4f')],_0x259792[_0x9599('0x51')]));_0x34b563[_0x9599('0x59')][_0x9599('0x74')]=_0x356a7['id'];if(_0x3b505b[_0x9599('0x4f')][_0x9599('0x5c')]){_0x34b563[_0x9599('0x59')]=_[_0x9599('0x5d')](_0x34b563[_0x9599('0x59')],{'$or':_[_0x9599('0x49')](_0x34b563[_0x9599('0x53')],function(_0xcdb77b){var _0x1ef4ac={};_0x1ef4ac[_0xcdb77b]={'$like':'%'+_0x3b505b['query']['filter']+'%'};return _0x1ef4ac;})});}_0x34b563=_['merge']({},_0x34b563,_0x3b505b[_0x9599('0x5e')]);return db[_0x9599('0x8c')][_0x9599('0x24')]({'where':_0x34b563['where']})[_0x9599('0x13')](function(_0x4af79b){_0xc3e96a[_0x9599('0x24')]=_0x4af79b;if(_0x3b505b[_0x9599('0x4f')]['includeAll']){_0x34b563[_0x9599('0x64')]=[{'model':db[_0x9599('0x8d')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x9599('0x8e'),'attributes':[_0x9599('0x2b'),_0x9599('0x8f'),_0x9599('0x90')],'required':![]},{'model':db['Tag'],'as':_0x9599('0x91'),'attributes':['id','name',_0x9599('0x92')],'where':_0x3b505b[_0x9599('0x4f')][_0x9599('0x93')]?{'id':_0x3b505b[_0x9599('0x4f')][_0x9599('0x93')]}:undefined,'required':_0x3b505b[_0x9599('0x4f')][_0x9599('0x93')]?!![]:![]}];}return db['MailInteraction'][_0x9599('0x60')](_0x34b563);})[_0x9599('0x13')](function(_0x1e141a){_0xc3e96a['rows']=_0x1e141a;return _0xc3e96a;});}})['then'](respondWithFilteredResult(_0x26546e,_0x34b563))[_0x9599('0x1d')](handleError(_0x26546e,null));};exports['addApplications']=function addApplications(_0x50fb57,_0x11cd01){var _0x43c6b5=_0x50fb57[_0x9599('0x62')]['id'];var _0x3b2603=_0x50fb57[_0x9599('0x67')];var _0x448848=0xc8;var _0x31a1db=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x9599('0x94')][_0x9599('0x95')][_0x9599('0x96')][_0x9599('0x97')]},function(_0x500ae3){return db['MailAccount'][_0x9599('0x6f')]({'where':{'id':_0x43c6b5},'transaction':_0x500ae3})['then'](function(_0x2cce59){if(_0x2cce59){return db['MailApplication'][_0x9599('0x26')]({'where':{'MailAccountId':_0x43c6b5},'transaction':_0x500ae3})[_0x9599('0x13')](function(){var _0x3054c5=_[_0x9599('0x49')](_0x3b2603,function(_0x42acdb){_0x42acdb[_0x9599('0x74')]=_0x43c6b5;return _0x42acdb;});return db['MailApplication']['bulkCreate'](_0x3054c5,{'transaction':_0x500ae3});});}else{_0x448848=0x194;_0x31a1db=[];}});})[_0x9599('0x13')](function(){if(_0x448848!==0x194){return db[_0x9599('0x98')][_0x9599('0x99')]({'where':{'MailAccountId':_0x43c6b5},'order':_0x9599('0x9a')})[_0x9599('0x13')](function(_0x3d3e5c){_0x31a1db=_0x3d3e5c;});}})[_0x9599('0x1d')](function(_0x13eec6){_0x448848=0x1f4;logger['error'](_0x13eec6[_0x9599('0x9b')]);if(_0x13eec6['name']){delete _0x13eec6[_0x9599('0x2b')];}_0x31a1db=_0x13eec6;})['finally'](function(){if(_0x31a1db===null){_0x11cd01[_0x9599('0x1e')](_0x448848);}else{if(_0x448848===0x1f4){_0x11cd01[_0x9599('0x1f')](_0x448848)[_0x9599('0x2c')](_0x31a1db);}else{_0x11cd01[_0x9599('0x1f')](_0x448848)[_0x9599('0x20')](_0x31a1db);}}});};exports[_0x9599('0x9c')]=function(_0x1eb79a,_0x37677f){var _0x48fadb={};var _0x4f4316={};var _0x7907f;var _0x20b934;return db[_0x9599('0x4a')][_0x9599('0x6f')]({'where':{'id':_0x1eb79a[_0x9599('0x62')]['id']}})['then'](handleEntityNotFound(_0x37677f,null))[_0x9599('0x13')](function(_0x58a3a5){if(_0x58a3a5){_0x7907f=_0x58a3a5;_0x4f4316[_0x9599('0x4e')]=_[_0x9599('0x50')](db[_0x9599('0x98')][_0x9599('0x4b')]);_0x4f4316[_0x9599('0x4f')]=_[_0x9599('0x50')](_0x1eb79a[_0x9599('0x4f')]);_0x4f4316[_0x9599('0x51')]=_[_0x9599('0x52')](_0x4f4316[_0x9599('0x4e')],_0x4f4316['query']);_0x48fadb[_0x9599('0x53')]=_[_0x9599('0x52')](_0x4f4316[_0x9599('0x4e')],qs[_0x9599('0x54')](_0x1eb79a[_0x9599('0x4f')]['fields']));_0x48fadb[_0x9599('0x53')]=_0x48fadb[_0x9599('0x53')][_0x9599('0x55')]?_0x48fadb[_0x9599('0x53')]:_0x4f4316[_0x9599('0x4e')];_0x48fadb[_0x9599('0x56')]=qs[_0x9599('0x57')](_0x1eb79a[_0x9599('0x4f')][_0x9599('0x57')]);_0x48fadb[_0x9599('0x59')]=qs[_0x9599('0x51')](_[_0x9599('0x58')](_0x1eb79a['query'],_0x4f4316['filters']));if(_0x1eb79a['query'][_0x9599('0x5c')]){_0x48fadb[_0x9599('0x59')]=_['merge'](_0x48fadb[_0x9599('0x59')],{'$or':_[_0x9599('0x49')](_0x48fadb[_0x9599('0x53')],function(_0x56000a){var _0x146fd2={};_0x146fd2[_0x56000a]={'$like':'%'+_0x1eb79a[_0x9599('0x4f')][_0x9599('0x5c')]+'%'};return _0x146fd2;})});}_0x48fadb=_[_0x9599('0x5d')]({},_0x48fadb,_0x1eb79a[_0x9599('0x5e')]);return _0x7907f[_0x9599('0x9c')](_0x48fadb);}})['then'](function(_0x1a3edc){if(_0x1a3edc){_0x20b934=_0x1a3edc[_0x9599('0x55')];if(!_0x1eb79a[_0x9599('0x4f')][_0x9599('0x70')]('nolimit')){_0x48fadb[_0x9599('0x22')]=qs[_0x9599('0x22')](_0x1eb79a[_0x9599('0x4f')][_0x9599('0x22')]);_0x48fadb[_0x9599('0x21')]=qs['offset'](_0x1eb79a[_0x9599('0x4f')]['offset']);}return _0x7907f['getApplications'](_0x48fadb);}})[_0x9599('0x13')](function(_0x52ee29){if(_0x52ee29){return _0x52ee29?{'count':_0x20b934,'rows':_0x52ee29}:null;}})[_0x9599('0x13')](respondWithResult(_0x37677f,null))['catch'](handleError(_0x37677f,null));};exports[_0x9599('0x9d')]=function(_0x2e3423,_0x16acce){var _0x2546b9={'raw':!![],'where':{}};var _0x4ccad8={};var _0x1fb3de={'count':0x0,'rows':[]};return db['MailAccount'][_0x9599('0x6f')]({'where':{'id':_0x2e3423[_0x9599('0x62')]['id']}})[_0x9599('0x13')](handleEntityNotFound(_0x16acce,null))[_0x9599('0x13')](function(_0x4eb4ad){if(_0x4eb4ad){_0x4ccad8[_0x9599('0x4e')]=_['keys'](db['MailMessage']['rawAttributes']);_0x4ccad8[_0x9599('0x4f')]=_[_0x9599('0x50')](_0x2e3423[_0x9599('0x4f')]);_0x4ccad8['filters']=_[_0x9599('0x52')](_0x4ccad8[_0x9599('0x4e')],_0x4ccad8[_0x9599('0x4f')]);_0x2546b9['attributes']=_[_0x9599('0x52')](_0x4ccad8[_0x9599('0x4e')],qs[_0x9599('0x54')](_0x2e3423[_0x9599('0x4f')]['fields']));_0x2546b9['attributes']=_0x2546b9['attributes']['length']?_0x2546b9['attributes']:_0x4ccad8['model'];if(!_0x2e3423[_0x9599('0x4f')][_0x9599('0x70')]('nolimit')){_0x2546b9[_0x9599('0x22')]=qs[_0x9599('0x22')](_0x2e3423[_0x9599('0x4f')][_0x9599('0x22')]);_0x2546b9['offset']=qs[_0x9599('0x21')](_0x2e3423[_0x9599('0x4f')][_0x9599('0x21')]);}_0x2546b9[_0x9599('0x56')]=qs[_0x9599('0x57')](_0x2e3423[_0x9599('0x4f')][_0x9599('0x57')]);_0x2546b9['where']=qs[_0x9599('0x51')](_[_0x9599('0x58')](_0x2e3423[_0x9599('0x4f')],_0x4ccad8[_0x9599('0x51')]));_0x2546b9[_0x9599('0x59')][_0x9599('0x74')]=_0x4eb4ad['id'];if(_0x2e3423[_0x9599('0x4f')][_0x9599('0x5c')]){_0x2546b9[_0x9599('0x59')]=_[_0x9599('0x5d')](_0x2546b9['where'],{'$or':_[_0x9599('0x49')](_0x2546b9[_0x9599('0x53')],function(_0x2078e9){var _0x36924d={};_0x36924d[_0x2078e9]={'$like':'%'+_0x2e3423[_0x9599('0x4f')][_0x9599('0x5c')]+'%'};return _0x36924d;})});}if(_0x2e3423[_0x9599('0x4f')]['$gte']){var _0x16101f=_0x2e3423[_0x9599('0x4f')][_0x9599('0x9e')]['split'](',');var _0x5bd749={};_0x5bd749[_0x16101f[0x0]]={'$gte':moment(_0x16101f[0x1])['format'](_0x9599('0x9f'))};_0x2546b9[_0x9599('0x59')]=_[_0x9599('0x5d')](_0x2546b9['where'],_0x5bd749);}_0x2546b9=_[_0x9599('0x5d')]({},_0x2546b9,_0x2e3423[_0x9599('0x5e')]);return db[_0x9599('0xa0')]['count']({'where':_0x2546b9[_0x9599('0x59')]})[_0x9599('0x13')](function(_0x4da3e6){_0x1fb3de[_0x9599('0x24')]=_0x4da3e6;if(_0x2e3423[_0x9599('0x4f')]['includeAll']){_0x2546b9['include']=[{'all':!![]}];}return db[_0x9599('0xa0')][_0x9599('0x60')](_0x2546b9);})['then'](function(_0x29ee79){if(_0x2e3423[_0x9599('0x4f')][_0x9599('0xa1')]===_0x9599('0xa2')){for(var _0x2dd766=0x0;_0x2dd766<_0x29ee79[_0x9599('0x55')];_0x2dd766++){_0x29ee79[_0x2dd766][_0x9599('0x67')]=juice(_0x29ee79[_0x2dd766][_0x9599('0x67')]);}}_0x1fb3de[_0x9599('0x72')]=_0x29ee79;return _0x1fb3de;});}})[_0x9599('0x13')](respondWithFilteredResult(_0x16acce,_0x2546b9))[_0x9599('0x1d')](handleError(_0x16acce,null));};exports[_0x9599('0x2c')]=function(_0x2dda8b,_0xedce43){var _0xae06cf,_0x310be7={},_0x53f8aa;if(_0x2dda8b[_0x9599('0x67')]['to']){_0x53f8aa=_0x2dda8b[_0x9599('0x67')]['to']['split'](',')[0x0];}return db['MailAccount'][_0x9599('0x65')]({'where':{'id':_0x2dda8b[_0x9599('0x62')]['id']},'include':[{'model':db[_0x9599('0xa3')],'as':_0x9599('0xa4'),'include':[{'model':db[_0x9599('0x8d')],'as':'Contacts','where':{'email':_0x53f8aa},'limit':0x1,'order':[[_0x9599('0xa5'),_0x9599('0xa6')]]}]},{'model':db[_0x9599('0x63')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x9599('0xa7')],'as':_0x9599('0xa7'),'raw':!![]}]}]})[_0x9599('0x13')](handleEntityNotFound(_0xedce43,null))['then'](function(_0x38da9e){if(!_0x38da9e)return;_0xae06cf=_0x38da9e;if(!_0x38da9e['Smtp'])throw new Error(_0x9599('0xa8'));if(_[_0x9599('0x7b')](_0x2dda8b[_0x9599('0x67')][_0x9599('0xa9')])){_0x2dda8b['body']['from']=util[_0x9599('0xaa')]('%s\x20<%s>',_0x38da9e[_0x9599('0x2b')],_0x38da9e[_0x9599('0x79')]||_0x38da9e[_0x9599('0x44')][_0x9599('0x38')]);}if(_0x2dda8b[_0x9599('0x67')][_0x9599('0xab')]&&_0x2dda8b['body'][_0x9599('0xab')][_0x9599('0x55')]){for(var _0x2f89af=0x0;_0x2f89af<_0x2dda8b[_0x9599('0x67')][_0x9599('0xab')][_0x9599('0x55')];_0x2f89af+=0x1){_0x2dda8b[_0x9599('0x67')][_0x9599('0xab')][_0x2f89af]={'filename':_0x2dda8b[_0x9599('0x67')][_0x9599('0xab')][_0x2f89af][_0x9599('0x2b')],'path':path[_0x9599('0xac')](config[_0x9599('0xad')],_0x9599('0xae'),_0x2dda8b[_0x9599('0x67')][_0x9599('0xab')][_0x2f89af][_0x9599('0xaf')])};}}var _0x4081cf=_0x38da9e[_0x9599('0xb0')]();return respondWithRpcPromise(_0x9599('0xb1'),_0x9599('0xb2'),{'account':_0x4081cf,'message':_0x2dda8b[_0x9599('0x67')]});})[_0x9599('0x13')](function(_0x4ae54f){if(!_0x4ae54f)return;_0x310be7=_0x4ae54f;if(!_0xae06cf['List'])throw new Error(_0x9599('0xb3'));if(_0xae06cf['List'][_0x9599('0xb4')]['length'])return _0xae06cf[_0x9599('0xa4')][_0x9599('0xb4')][0x0];return db[_0x9599('0x8d')][_0x9599('0x6d')](_[_0x9599('0xb')](_0x2dda8b[_0x9599('0x67')],{'firstName':_0x2dda8b[_0x9599('0x67')]['to'],'email':_0x2dda8b[_0x9599('0x67')]['to'],'phone':_0x2dda8b[_0x9599('0x67')]['to'],'ListId':_0xae06cf[_0x9599('0x7a')]}));})[_0x9599('0x13')](function(_0x16d1bc){if(!_0x16d1bc)return;var _0x43a59b={'UserId':_0x2dda8b['user']['id'],'ContactId':_0x16d1bc['id'],'MailAccountId':_0xae06cf['id'],'inReplyTo':_0x310be7[_0x9599('0xb5')],'to':_0x2dda8b[_0x9599('0x67')][_0x9599('0xa9')],'cc':_0x2dda8b['body']['cc'],'subject':_0x2dda8b['body'][_0x9599('0xb6')],'attach':_0x2dda8b[_0x9599('0x67')][_0x9599('0xb7')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x9599('0xaa')](_0x9599('0x9f')),'lastMsgDirection':_0x9599('0xb8'),'Messages':[_[_0x9599('0x5d')](_0x2dda8b[_0x9599('0x67')],{'messageId':_0x310be7[_0x9599('0xb5')],'sentAt':moment()[_0x9599('0xaa')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0xae06cf['id'],'UserId':_0x2dda8b['user']['id'],'ContactId':_0x16d1bc['id']})]};if(_0x2dda8b[_0x9599('0x67')][_0x9599('0xb9')]){_0x43a59b=_[_0x9599('0x5d')](_0x43a59b,_0x2dda8b[_0x9599('0x67')][_0x9599('0xb9')]);}return db[_0x9599('0x8c')]['create'](_0x43a59b,{'include':[{'model':db[_0x9599('0xa0')],'as':'Messages'}]});})['then'](respondWithResult(_0xedce43,null))[_0x9599('0x1d')](handleError(_0xedce43,null));};exports[_0x9599('0xba')]=function(_0x5e0169,_0x313559){return db[_0x9599('0x4a')][_0x9599('0x65')]({'where':{'id':_0x5e0169['params']['id']},'include':[{'model':db[_0x9599('0x63')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x9599('0xa7')],'as':_0x9599('0xa7'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x313559,null))['then'](function(_0x246bdf){if(!_0x246bdf['Smtp'])return;var _0x7855d1=_0x246bdf['getSmtpOptions']();return respondWithRpcPromise(_0x9599('0xbb'),'verifySmtp',{'account':_0x7855d1});})[_0x9599('0x13')](respondWithResult(_0x313559,null))[_0x9599('0x1d')](handleError(_0x313559,null));};exports['destroy']=function(_0x8f2938,_0x40d0f6){return db[_0x9599('0x4a')][_0x9599('0x65')]({'where':{'id':_0x8f2938[_0x9599('0x62')]['id']}})['then'](handleEntityNotFound(_0x40d0f6,null))[_0x9599('0x13')](function(_0x3a1c3b){if(_0x3a1c3b&&_0x3a1c3b[_0x9599('0x41')]){throw new db[(_0x9599('0xbc'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x3a1c3b;})[_0x9599('0x13')](removeEntity(_0x40d0f6,null))[_0x9599('0x1d')](handleError(_0x40d0f6,null));};exports[_0x9599('0xbd')]=function(_0x599c14,_0x2eacdd){return db[_0x9599('0x4a')][_0x9599('0x65')]({'where':{'id':_0x599c14['params']['id']}})[_0x9599('0x13')](handleEntityNotFound(_0x2eacdd,null))[_0x9599('0x13')](function(_0x547008){if(_0x547008){return _0x547008['addAgents'](_0x599c14['body'][_0x9599('0x8a')],_[_0x9599('0xbe')](_0x599c14[_0x9599('0x67')],[_0x9599('0x8a'),'id'])||{})['spread'](function(_0x6339ca){for(var _0x3dab56=0x0;_0x3dab56<_0x599c14[_0x9599('0x67')][_0x9599('0x8a')]['length'];_0x3dab56+=0x1){socket[_0x9599('0xbf')](_0x9599('0xc0'),{'UserId':Number(_0x599c14[_0x9599('0x67')][_0x9599('0x8a')][_0x3dab56]),'MailAccountId':Number(_0x599c14[_0x9599('0x62')]['id'])});}return _0x6339ca;});}})[_0x9599('0x13')](respondWithResult(_0x2eacdd,null))[_0x9599('0x1d')](handleError(_0x2eacdd,null));};exports[_0x9599('0xc1')]=function(_0x2b2817,_0x57020a){return db[_0x9599('0x4a')][_0x9599('0x65')]({'where':{'id':_0x2b2817['params']['id']}})[_0x9599('0x13')](handleEntityNotFound(_0x57020a,null))['then'](function(_0x111b2e){if(_0x111b2e){return _0x111b2e[_0x9599('0xc1')](_0x2b2817['query'][_0x9599('0x8a')])[_0x9599('0x13')](function(){if(_[_0x9599('0xc2')](_0x2b2817[_0x9599('0x4f')][_0x9599('0x8a')])){for(var _0x3ef65b=0x0;_0x3ef65b<_0x2b2817[_0x9599('0x4f')][_0x9599('0x8a')][_0x9599('0x55')];_0x3ef65b+=0x1){socket[_0x9599('0xbf')](_0x9599('0xc3'),{'UserId':Number(_0x2b2817[_0x9599('0x4f')][_0x9599('0x8a')][_0x3ef65b]),'MailAccountId':Number(_0x2b2817[_0x9599('0x62')]['id'])});}}else{socket[_0x9599('0xbf')]('userMailAccount:remove',{'UserId':Number(_0x2b2817[_0x9599('0x4f')][_0x9599('0x8a')]),'MailAccountId':Number(_0x2b2817['params']['id'])});}});}})['then'](respondWithStatusCode(_0x57020a,null))[_0x9599('0x1d')](handleError(_0x57020a,null));};exports[_0x9599('0xc4')]=function(_0x27d46d,_0x22e9be){var _0x211ae2={};var _0x3d6be5={};var _0x5d7dab;var _0x55a036;return db[_0x9599('0x4a')][_0x9599('0x6f')]({'where':{'id':_0x27d46d[_0x9599('0x62')]['id']}})[_0x9599('0x13')](handleEntityNotFound(_0x22e9be,null))[_0x9599('0x13')](function(_0x28c2f3){if(_0x28c2f3){_0x5d7dab=_0x28c2f3;_0x3d6be5[_0x9599('0x4e')]=_['keys'](db[_0x9599('0xc5')]['rawAttributes']);_0x3d6be5['query']=_[_0x9599('0x50')](_0x27d46d[_0x9599('0x4f')]);_0x3d6be5['filters']=_[_0x9599('0x52')](_0x3d6be5[_0x9599('0x4e')],_0x3d6be5['query']);_0x211ae2[_0x9599('0x53')]=_[_0x9599('0x52')](_0x3d6be5[_0x9599('0x4e')],qs[_0x9599('0x54')](_0x27d46d[_0x9599('0x4f')][_0x9599('0x54')]));_0x211ae2[_0x9599('0x53')]=_0x211ae2[_0x9599('0x53')][_0x9599('0x55')]?_0x211ae2[_0x9599('0x53')]:_0x3d6be5[_0x9599('0x4e')];_0x211ae2[_0x9599('0x56')]=qs[_0x9599('0x57')](_0x27d46d[_0x9599('0x4f')][_0x9599('0x57')]);_0x211ae2['where']=qs[_0x9599('0x51')](_['pick'](_0x27d46d['query'],_0x3d6be5[_0x9599('0x51')]));if(_0x27d46d['query'][_0x9599('0x5c')]){_0x211ae2[_0x9599('0x59')]=_[_0x9599('0x5d')](_0x211ae2[_0x9599('0x59')],{'$or':_[_0x9599('0x49')](_0x211ae2[_0x9599('0x53')],function(_0x4b432b){var _0x3ec8cd={};_0x3ec8cd[_0x4b432b]={'$like':'%'+_0x27d46d[_0x9599('0x4f')][_0x9599('0x5c')]+'%'};return _0x3ec8cd;})});}_0x211ae2=_[_0x9599('0x5d')]({},_0x211ae2,_0x27d46d['options']);return _0x5d7dab['getAgents'](_0x211ae2);}})[_0x9599('0x13')](function(_0x594af6){if(_0x594af6){_0x55a036=_0x594af6[_0x9599('0x55')];if(!_0x27d46d[_0x9599('0x4f')]['hasOwnProperty']('nolimit')){_0x211ae2[_0x9599('0x22')]=qs[_0x9599('0x22')](_0x27d46d[_0x9599('0x4f')][_0x9599('0x22')]);_0x211ae2[_0x9599('0x21')]=qs['offset'](_0x27d46d[_0x9599('0x4f')][_0x9599('0x21')]);}return _0x5d7dab[_0x9599('0xc4')](_0x211ae2);}})[_0x9599('0x13')](function(_0x1869a9){if(_0x1869a9){return _0x1869a9?{'count':_0x55a036,'rows':_0x1869a9}:null;}})[_0x9599('0x13')](respondWithResult(_0x22e9be,null))[_0x9599('0x1d')](handleError(_0x22e9be,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 0843775..e6a91c9 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 _0xbd0e=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xbd0e,0x187));var _0xebd0=function(_0x5dbc86,_0xcdbb86){_0x5dbc86=_0x5dbc86-0x0;var _0x1f80e3=_0xbd0e[_0x5dbc86];return _0x1f80e3;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xebd0('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xebd0('0x1')](0x0);var events={'afterCreate':_0xebd0('0x2'),'afterUpdate':_0xebd0('0x3'),'afterDestroy':_0xebd0('0x4')};function emitEvent(_0x1f7733){return function(_0x811ddd,_0x4df56d,_0x54075a){MailAccountEvents[_0xebd0('0x5')](_0x1f7733+':'+_0x811ddd['id'],_0x811ddd);MailAccountEvents[_0xebd0('0x5')](_0x1f7733,_0x811ddd);_0x54075a(null);};}for(var e in events){if(events[_0xebd0('0x6')](e)){var event=events[e];MailAccount[_0xebd0('0x7')](e,emitEvent(event));}}module[_0xebd0('0x8')]=MailAccountEvents; \ No newline at end of file +var _0xfd1b=['exports','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x5f20d3,_0x3c01aa){var _0x32f490=function(_0x573de8){while(--_0x573de8){_0x5f20d3['push'](_0x5f20d3['shift']());}};_0x32f490(++_0x3c01aa);}(_0xfd1b,0x1b1));var _0xbfd1=function(_0x59a83b,_0x20efda){_0x59a83b=_0x59a83b-0x0;var _0x4b9607=_0xfd1b[_0x59a83b];return _0x4b9607;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0xbfd1('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xbfd1('0x1')](0x0);var events={'afterCreate':_0xbfd1('0x2'),'afterUpdate':_0xbfd1('0x3'),'afterDestroy':_0xbfd1('0x4')};function emitEvent(_0x5cc4e8){return function(_0x2adfea,_0x40f31b,_0x2236c4){MailAccountEvents['emit'](_0x5cc4e8+':'+_0x2adfea['id'],_0x2adfea);MailAccountEvents[_0xbfd1('0x5')](_0x5cc4e8,_0x2adfea);_0x2236c4(null);};}for(var e in events){if(events[_0xbfd1('0x6')](e)){var event=events[e];MailAccount[_0xbfd1('0x7')](e,emitEvent(event));}}module[_0xbfd1('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 2549cf9..caf31d3 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 _0x6be8=['authentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','CloudProvider','data5','pass','./mailAccount.attributes','exports','define','MailAccount','provider','custom','service','host','secure','Smtp'];(function(_0x3ec679,_0x4b7fe6){var _0x5c61b0=function(_0x13155d){while(--_0x13155d){_0x3ec679['push'](_0x3ec679['shift']());}};_0x5c61b0(++_0x4b7fe6);}(_0x6be8,0x13a));var _0x86be=function(_0x3083da,_0x135b65){_0x3083da=_0x3083da-0x0;var _0x1a7753=_0x6be8[_0x3083da];return _0x1a7753;};'use strict';var attributes=require(_0x86be('0x0'));module[_0x86be('0x1')]=function(_0x257e25){return _0x257e25[_0x86be('0x2')](_0x86be('0x3'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x26f47b=this;var _0x1e413a={'id':_0x26f47b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x26f47b[_0x86be('0x4')]!==_0x86be('0x5')){_0x1e413a[_0x86be('0x6')]=_0x26f47b['provider'];}else{_0x1e413a[_0x86be('0x7')]=_0x26f47b['Smtp']['host'];_0x1e413a['port']=_0x26f47b['Smtp']['port'];_0x1e413a[_0x86be('0x8')]=_0x26f47b[_0x86be('0x9')][_0x86be('0x8')];}if(_0x26f47b[_0x86be('0x9')][_0x86be('0xa')]){if(_0x26f47b['Smtp']['modernAuthentication']){if(!_0x26f47b[_0x86be('0x9')]['CloudProvider'])throw new Error(_0x86be('0xb'));_0x1e413a[_0x86be('0xc')]={'type':_0x86be('0xd'),'user':_0x26f47b[_0x86be('0x9')][_0x86be('0xe')],'accessToken':_0x26f47b['Smtp'][_0x86be('0xf')][_0x86be('0x10')]};}else{_0x1e413a[_0x86be('0xc')]={'user':_0x26f47b[_0x86be('0x9')]['user'],'pass':_0x26f47b[_0x86be('0x9')][_0x86be('0x11')]};}}return _0x1e413a;}}});}; \ No newline at end of file +var _0xeae0=['custom','service','host','Smtp','port','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','CloudProvider','pass','./mailAccount.attributes','exports','MailAccount','mail_accounts','provider'];(function(_0x10bca9,_0x10c2c3){var _0x1b9da8=function(_0x358170){while(--_0x358170){_0x10bca9['push'](_0x10bca9['shift']());}};_0x1b9da8(++_0x10c2c3);}(_0xeae0,0x163));var _0x0eae=function(_0x1b4bef,_0x5bb6be){_0x1b4bef=_0x1b4bef-0x0;var _0xf377eb=_0xeae0[_0x1b4bef];return _0xf377eb;};'use strict';var attributes=require(_0x0eae('0x0'));module[_0x0eae('0x1')]=function(_0x3bd131){return _0x3bd131['define'](_0x0eae('0x2'),attributes,{'tableName':_0x0eae('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x314e5e=this;var _0x319c27={'id':_0x314e5e['id'],'tls':{'rejectUnauthorized':![]}};if(_0x314e5e[_0x0eae('0x4')]!==_0x0eae('0x5')){_0x319c27[_0x0eae('0x6')]=_0x314e5e[_0x0eae('0x4')];}else{_0x319c27[_0x0eae('0x7')]=_0x314e5e[_0x0eae('0x8')][_0x0eae('0x7')];_0x319c27[_0x0eae('0x9')]=_0x314e5e[_0x0eae('0x8')][_0x0eae('0x9')];_0x319c27[_0x0eae('0xa')]=_0x314e5e[_0x0eae('0x8')]['secure'];}if(_0x314e5e['Smtp'][_0x0eae('0xb')]){if(_0x314e5e[_0x0eae('0x8')][_0x0eae('0xc')]){if(!_0x314e5e[_0x0eae('0x8')]['CloudProvider'])throw new Error(_0x0eae('0xd'));_0x319c27[_0x0eae('0xe')]={'type':'OAuth2','user':_0x314e5e['Smtp'][_0x0eae('0xf')],'accessToken':_0x314e5e[_0x0eae('0x8')][_0x0eae('0x10')]['data5']};}else{_0x319c27[_0x0eae('0xe')]={'user':_0x314e5e['Smtp'][_0x0eae('0xf')],'pass':_0x314e5e[_0x0eae('0x8')][_0x0eae('0x11')]};}}return _0x319c27;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 2a10a1a..1b7f267 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 _0x1b65=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','debug','stringify','error','MailAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','MailAccount','findAll','options','raw','attributes','limit','map','include','model','GetMailAccount','smtp','setDataValue','smtpOptions','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','CmContact','Contacts','DESC','MailApplication','MailServerOut','CloudProvider','get','omit','Applications','applications','list','priority','asc','autoclose','push','length','close','*,*,*,*','create','messageId','generate','format','MailInteraction','find','update','attach','YYYY-MM-DD\x20HH:mm:ss','interaction','created','contact','subject','attachments','originTo','bcc','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','User','UserId','unshift','agent','name','waitForTheAssignedAgent','MailQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','lodash','moment','bluebird','randomstring'];(function(_0x15f304,_0xe9deb4){var _0x8824c6=function(_0x160efc){while(--_0x160efc){_0x15f304['push'](_0x15f304['shift']());}};_0x8824c6(++_0xe9deb4);}(_0x1b65,0x1b4));var _0x51b6=function(_0x1b0e66,_0x552dce){_0x1b0e66=_0x1b0e66-0x0;var _0x43f2a8=_0x1b65[_0x1b0e66];return _0x43f2a8;};'use strict';var _=require(_0x51b6('0x0'));var moment=require(_0x51b6('0x1'));var BPromise=require(_0x51b6('0x2'));var rs=require(_0x51b6('0x3'));var Redis=require('ioredis');var db=require(_0x51b6('0x4'))['db'];var logger=require(_0x51b6('0x5'))(_0x51b6('0x6'));var config=require(_0x51b6('0x7'));var jayson=require(_0x51b6('0x8'));var client=jayson[_0x51b6('0x9')][_0x51b6('0xa')]({'port':0x232c});config['redis']=_[_0x51b6('0xb')](config[_0x51b6('0xc')],{'host':_0x51b6('0xd'),'port':0x18eb});var socket=require(_0x51b6('0xe'))(new Redis(config['redis']));require(_0x51b6('0xf'))[_0x51b6('0x10')](socket);function respondWithRpcPromise(_0x4967ed,_0xcba3ee,_0x5a84a2){return new BPromise(function(_0x5e688b,_0x1cf35d){return client[_0x51b6('0x11')](_0x4967ed,_0x5a84a2)[_0x51b6('0x12')](function(_0x38f752){logger[_0x51b6('0x13')]('MailAccount,\x20%s,\x20%s',_0xcba3ee,'request\x20sent');logger[_0x51b6('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0xcba3ee,'request\x20sent',JSON[_0x51b6('0x15')](_0x38f752));if(_0x38f752['error']){if(_0x38f752[_0x51b6('0x16')]['code']===0x1f4){logger[_0x51b6('0x16')](_0x51b6('0x17'),_0xcba3ee,_0x38f752[_0x51b6('0x16')][_0x51b6('0x18')]);return _0x1cf35d(_0x38f752[_0x51b6('0x16')][_0x51b6('0x18')]);}logger['error'](_0x51b6('0x17'),_0xcba3ee,_0x38f752[_0x51b6('0x16')][_0x51b6('0x18')]);return _0x5e688b(_0x38f752['error'][_0x51b6('0x18')]);}else{logger['info'](_0x51b6('0x17'),_0xcba3ee,_0x51b6('0x19'));_0x5e688b(_0x38f752[_0x51b6('0x1a')][_0x51b6('0x18')]);}})[_0x51b6('0x1b')](function(_0x22c6da){logger['error'](_0x51b6('0x17'),_0xcba3ee,_0x22c6da);_0x1cf35d(_0x22c6da);});});}exports['GetMailAccount']=function(_0x2974f0){var _0x444da9=this;return new Promise(function(_0x506367,_0x3e2d90){return db[_0x51b6('0x1c')][_0x51b6('0x1d')]({'raw':_0x2974f0[_0x51b6('0x1e')]?_0x2974f0[_0x51b6('0x1e')][_0x51b6('0x1f')]===undefined?!![]:![]:!![],'where':_0x2974f0[_0x51b6('0x1e')]?_0x2974f0[_0x51b6('0x1e')]['where']||null:null,'attributes':_0x2974f0[_0x51b6('0x1e')]?_0x2974f0[_0x51b6('0x1e')][_0x51b6('0x20')]||null:null,'limit':_0x2974f0[_0x51b6('0x1e')]?_0x2974f0['options'][_0x51b6('0x21')]||null:null,'include':_0x2974f0[_0x51b6('0x1e')]?_0x2974f0[_0x51b6('0x1e')]['include']?_[_0x51b6('0x22')](_0x2974f0[_0x51b6('0x1e')][_0x51b6('0x23')],function(_0x59193e){return{'model':db[_0x59193e['model']],'as':_0x59193e['as'],'attributes':_0x59193e[_0x51b6('0x20')],'include':_0x59193e[_0x51b6('0x23')]?_[_0x51b6('0x22')](_0x59193e['include'],function(_0x2842b2){return{'model':db[_0x2842b2[_0x51b6('0x24')]],'as':_0x2842b2['as'],'attributes':_0x2842b2[_0x51b6('0x20')],'include':_0x2842b2[_0x51b6('0x23')]?_[_0x51b6('0x22')](_0x2842b2[_0x51b6('0x23')],function(_0x9da72a){return{'model':db[_0x9da72a[_0x51b6('0x24')]],'as':_0x9da72a['as'],'attributes':_0x9da72a['attributes']};}):[]};}):[]};}):[]:[]})[_0x51b6('0x12')](function(_0x226018){logger[_0x51b6('0x13')]('GetMailAccount',_0x2974f0);logger[_0x51b6('0x14')](_0x51b6('0x25'),_0x2974f0,JSON[_0x51b6('0x15')](_0x226018));_0x506367(_0x226018);})[_0x51b6('0x1b')](function(_0x5c7c35){logger[_0x51b6('0x16')]('GetMailAccount',_0x5c7c35[_0x51b6('0x18')],_0x2974f0);_0x3e2d90(_0x444da9[_0x51b6('0x16')](0x1f4,_0x5c7c35['message']));});});};exports['ShowMailAccount']=function(_0x560381){var _0x41e0ba=this;return new Promise(function(_0x57b603,_0x7ef5ca){return db[_0x51b6('0x1c')]['find']({'raw':_0x560381[_0x51b6('0x1e')]?_0x560381[_0x51b6('0x1e')][_0x51b6('0x1f')]===undefined?!![]:![]:!![],'where':_0x560381['options']?_0x560381[_0x51b6('0x1e')]['where']||null:null,'attributes':_0x560381[_0x51b6('0x1e')]?_0x560381[_0x51b6('0x1e')][_0x51b6('0x20')]||null:null,'include':_0x560381[_0x51b6('0x1e')]?_0x560381[_0x51b6('0x1e')][_0x51b6('0x23')]?_[_0x51b6('0x22')](_0x560381[_0x51b6('0x1e')]['include'],function(_0x19b854){return{'model':db[_0x19b854[_0x51b6('0x24')]],'as':_0x19b854['as'],'attributes':_0x19b854['attributes'],'include':_0x19b854[_0x51b6('0x23')]?_['map'](_0x19b854[_0x51b6('0x23')],function(_0xeaf57c){return{'model':db[_0xeaf57c[_0x51b6('0x24')]],'as':_0xeaf57c['as'],'attributes':_0xeaf57c['attributes'],'include':_0xeaf57c[_0x51b6('0x23')]?_[_0x51b6('0x22')](_0xeaf57c['include'],function(_0x3b5964){return{'model':db[_0x3b5964[_0x51b6('0x24')]],'as':_0x3b5964['as'],'attributes':_0x3b5964[_0x51b6('0x20')]};}):[]};}):[]};}):[]:[]})[_0x51b6('0x12')](function(_0x3b2e38){if(_0x560381[_0x51b6('0x1e')][_0x51b6('0x26')]===!![])_0x3b2e38[_0x51b6('0x27')](_0x51b6('0x28'),_0x3b2e38[_0x51b6('0x29')]());logger[_0x51b6('0x13')](_0x51b6('0x2a'),_0x560381);logger[_0x51b6('0x14')](_0x51b6('0x2a'),_0x560381,JSON[_0x51b6('0x15')](_0x3b2e38));_0x57b603(_0x3b2e38);})[_0x51b6('0x1b')](function(_0x54ac9c){logger[_0x51b6('0x16')]('ShowMailAccount',_0x54ac9c[_0x51b6('0x18')],_0x560381);_0x7ef5ca(_0x41e0ba['error'](0x1f4,_0x54ac9c[_0x51b6('0x18')]));});});};exports[_0x51b6('0x2b')]=function(_0x5b2a27){var _0x383a1b=this;return new Promise(function(_0x2b6dd6,_0x496803){var _0x2e2ab2={'body':_0x5b2a27[_0x51b6('0x2c')],'channel':_0x51b6('0x2d')};var _0x2f5200=_[_0x51b6('0x2e')](_['keys'](db['CmContact']['rawAttributes']),[_0x51b6('0x2f'),_0x51b6('0x30'),_0x51b6('0x31'),_0x51b6('0x32')]);var _0x2c3f6e=![];if(_0x5b2a27['body']['id']){delete _0x5b2a27['body']['id'];}if(_[_0x51b6('0x33')](_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x34')])){return _0x496803(_0x383a1b['error'](0x1f4,_0x51b6('0x35')));}if(_['isNil'](_0x5b2a27[_0x51b6('0x2c')]['body'])||_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x2c')]===''){return _0x496803(_0x383a1b[_0x51b6('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x51b6('0x33')](_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x36')])){return _0x496803(_0x383a1b[_0x51b6('0x16')](0x1f4,_0x51b6('0x37')+_0x2f5200));}if(!_['includes'](_0x2f5200,_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x36')])){return _0x496803(_0x383a1b['error'](0x1f4,_0x51b6('0x38')+_0x2f5200));}var _0x1fe475={};_0x1fe475[_0x5b2a27['body']['mapKey']]=_0x5b2a27['body']['from'];return db['MailAccount']['find']({'where':{'id':_0x5b2a27[_0x51b6('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0x51b6('0x3a'),'include':[{'model':db[_0x51b6('0x3b')],'as':_0x51b6('0x3c'),'where':_0x1fe475,'limit':0x1,'order':[[_0x51b6('0x30'),_0x51b6('0x3d')]]}]},{'model':db[_0x51b6('0x3e')],'as':'Applications'},{'model':db[_0x51b6('0x3f')],'as':'Smtp','include':[{'model':db[_0x51b6('0x40')],'as':_0x51b6('0x40')}]}]})['then'](function(_0x44f9d4){if(_0x44f9d4&&_0x44f9d4[_0x51b6('0x3a')]){var _0x2cfe07=_0x44f9d4[_0x51b6('0x41')]({'plain':!![]});_0x2e2ab2['account']=_[_0x51b6('0x42')](_0x2cfe07,[_0x51b6('0x43'),_0x51b6('0x3a')]);_0x2e2ab2[_0x51b6('0x39')][_0x51b6('0x28')]=_0x44f9d4[_0x51b6('0x29')]();_0x2e2ab2[_0x51b6('0x44')]=_0x2cfe07[_0x51b6('0x43')];_0x2e2ab2[_0x51b6('0x45')]=_0x2cfe07[_0x51b6('0x3a')];_0x2e2ab2[_0x51b6('0x44')]=_['orderBy'](_0x2e2ab2[_0x51b6('0x44')],[_0x51b6('0x46')],[_0x51b6('0x47')]);if(_0x2e2ab2[_0x51b6('0x39')]&&_0x2e2ab2[_0x51b6('0x39')][_0x51b6('0x48')]){_0x2e2ab2[_0x51b6('0x44')][_0x51b6('0x49')]({'id':0x0,'priority':_0x2e2ab2[_0x51b6('0x44')][_0x51b6('0x4a')]+0x1,'app':_0x51b6('0x4b'),'appdata':'autoclose','interval':_0x51b6('0x4c')});}if(_0x2e2ab2['account'][_0x51b6('0x43')]){delete _0x2e2ab2[_0x51b6('0x39')]['Applications'];}if(_0x2e2ab2['account'][_0x51b6('0x3a')]){delete _0x2e2ab2['account'][_0x51b6('0x3a')];}if(_0x2cfe07[_0x51b6('0x3a')][_0x51b6('0x3c')][_0x51b6('0x4a')]){return _0x2cfe07['List'][_0x51b6('0x3c')][0x0];}var _0xff4676=_[_0x51b6('0xb')](_0x5b2a27['body'],{'firstName':_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x34')],'ListId':_0x2cfe07[_0x51b6('0x32')]});_0xff4676[_0x5b2a27[_0x51b6('0x2c')]['mapKey']]=_0x5b2a27['body'][_0x51b6('0x34')];return db[_0x51b6('0x3b')][_0x51b6('0x4d')](_0xff4676);}else{throw new Error('List\x20not\x20found');}})[_0x51b6('0x12')](function(_0x36b9c1){_0x2e2ab2['contact']=_0x36b9c1;if(_0x36b9c1){if(!_0x5b2a27[_0x51b6('0x2c')]['message'][_0x51b6('0x4e')]){_0x5b2a27['body'][_0x51b6('0x18')][_0x51b6('0x4e')]=rs[_0x51b6('0x4f')]()+'\x20'+_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x18')]['from'];}var _0x292297={'ContactId':_0x36b9c1['id'],'MailAccountId':_0x5b2a27[_0x51b6('0x39')]['id'],'inReplyTo':_0x5b2a27[_0x51b6('0x2c')]['message']['messageId'],'to':_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x18')][_0x51b6('0x34')],'cc':_0x5b2a27['body'][_0x51b6('0x18')]['cc'],'subject':_0x5b2a27['body'][_0x51b6('0x18')]['subject'],'attach':_0x5b2a27[_0x51b6('0x2c')]['message']['attach'],'lastMsgAt':moment()[_0x51b6('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x51b6('0x51')][_0x51b6('0x52')]({'where':{'closed':![],'MailAccountId':_0x5b2a27[_0x51b6('0x39')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x18')]['inReplyTo']}}]})[_0x51b6('0x12')](function(_0x540139){if(_0x540139){return[_0x540139,![]];}return db[_0x51b6('0x51')][_0x51b6('0x4d')](_0x292297)[_0x51b6('0x12')](function(_0x3cff21){return[_0x3cff21,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x5e9f3e,_0x14b560){if(_0x5e9f3e){_0x2c3f6e=_0x14b560;if(!_0x14b560){return _0x5e9f3e[_0x51b6('0x53')]({'inReplyTo':_0x5b2a27[_0x51b6('0x2c')]['message'][_0x51b6('0x4e')],'to':_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x18')]['from'],'cc':_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x18')]['cc'],'subject':_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x18')]['subject'],'attach':_0x5e9f3e[_0x51b6('0x54')]?_0x5e9f3e[_0x51b6('0x54')]:_0x5b2a27['body']['message'][_0x51b6('0x54')],'substatus':null,'substatusAt':moment()[_0x51b6('0x50')](_0x51b6('0x55')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x5e9f3e;}}})[_0x51b6('0x12')](function(_0x2aa8a9){_0x2e2ab2[_0x51b6('0x56')]=_0x2aa8a9['get']({'plain':!![]});_0x2e2ab2[_0x51b6('0x56')][_0x51b6('0x57')]=_0x2c3f6e;return db['MailMessage'][_0x51b6('0x4d')]({'body':_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x2c')],'MailAccountId':_0x5b2a27[_0x51b6('0x39')]['id'],'MailInteractionId':_0x2aa8a9['id'],'direction':'in','ContactId':_0x2e2ab2[_0x51b6('0x58')]['id'],'messageId':_0x5b2a27[_0x51b6('0x2c')]['message'][_0x51b6('0x4e')],'from':_0x5b2a27[_0x51b6('0x2c')]['message'][_0x51b6('0x34')],'to':_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x18')]['to'],'cc':_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x18')]['cc'],'subject':_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x18')][_0x51b6('0x59')],'attach':_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x18')][_0x51b6('0x54')],'Attachments':_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x18')][_0x51b6('0x5a')],'originTo':_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x18')][_0x51b6('0x5b')],'originCc':_0x5b2a27[_0x51b6('0x2c')]['message']['originCc'],'bcc':_0x5b2a27['body'][_0x51b6('0x18')][_0x51b6('0x5c')],'ChatWebsiteId':_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x18')]['ChatWebsiteId']||null,'originChannel':_0x5b2a27[_0x51b6('0x2c')][_0x51b6('0x18')][_0x51b6('0x5d')]||_0x51b6('0x5e'),'ChatOfflineMessageId':_0x5b2a27[_0x51b6('0x2c')]['message'][_0x51b6('0x5f')]||null},{'include':[{'model':db[_0x51b6('0x60')],'as':_0x51b6('0x61')}]});})[_0x51b6('0x12')](function(_0x34e598){_0x2e2ab2[_0x51b6('0x18')]=_0x34e598;if(!_0x2e2ab2['interaction']['UserId']){return;}return db[_0x51b6('0x62')][_0x51b6('0x52')]({'attributes':['id','name'],'where':{'id':_0x2e2ab2['interaction'][_0x51b6('0x63')]}});})[_0x51b6('0x12')](function(_0x498f59){if(_0x498f59){_0x2e2ab2['applications'][_0x51b6('0x64')]({'id':0x0,'priority':0x0,'app':_0x51b6('0x65'),'appdata':_0x498f59[_0x51b6('0x66')]+','+(_0x2e2ab2[_0x51b6('0x39')][_0x51b6('0x67')]||0xa),'interval':_0x51b6('0x4c')});}if(!_0x2e2ab2[_0x51b6('0x56')]['queueId']){return;}return db[_0x51b6('0x68')][_0x51b6('0x52')]({'attributes':['id',_0x51b6('0x66')],'where':{'id':_0x2e2ab2[_0x51b6('0x56')][_0x51b6('0x69')]}});})['then'](function(_0x3a45eb){if(_0x3a45eb){_0x2e2ab2['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0x51b6('0x6a'),'appdata':_0x3a45eb[_0x51b6('0x66')]+','+(_0x2e2ab2[_0x51b6('0x39')][_0x51b6('0x6b')]||0x12c),'interval':_0x51b6('0x4c')});}return respondWithRpcPromise(_0x51b6('0x6c'),_0x51b6('0x6d'),_0x2e2ab2);})['then'](function(_0x2463c5){_0x2b6dd6(_0x2463c5);})[_0x51b6('0x1b')](function(_0xf9533d){_0x496803(_0x383a1b[_0x51b6('0x16')](0x1f4,_0xf9533d[_0x51b6('0x18')]));});});}; \ No newline at end of file +var _0x8085=['unshift','agent','MailQueue','queueId','queue','waitForTheAssignedQueue','startRouting','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','MailAccount','findAll','raw','options','where','attributes','include','model','map','GetMailAccount','find','smtp','setDataValue','smtpOptions','ShowMailAccount','body','mail','difference','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','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','List','updatedAt','DESC','MailApplication','MailServerOut','CloudProvider','get','account','Applications','getSmtpOptions','applications','list','orderBy','asc','autoclose','push','length','*,*,*,*','Contacts','create','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','MailInteraction','Contact\x20not\x20found','spread','update','attach','interaction','created','contact','attachments','originTo','originChannel','Email','Attachment','Attachments','User','name'];(function(_0x30e218,_0x31d2a2){var _0x5b0f2c=function(_0x51ebad){while(--_0x51ebad){_0x30e218['push'](_0x30e218['shift']());}};_0x5b0f2c(++_0x31d2a2);}(_0x8085,0x71));var _0x5808=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x8085[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x5808('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5808('0x1'));var Redis=require(_0x5808('0x2'));var db=require(_0x5808('0x3'))['db'];var logger=require(_0x5808('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5808('0x5'));var client=jayson[_0x5808('0x6')]['http']({'port':0x232c});config[_0x5808('0x7')]=_[_0x5808('0x8')](config[_0x5808('0x7')],{'host':_0x5808('0x9'),'port':0x18eb});var socket=require(_0x5808('0xa'))(new Redis(config[_0x5808('0x7')]));require(_0x5808('0xb'))[_0x5808('0xc')](socket);function respondWithRpcPromise(_0x456130,_0x447811,_0x54ab63){return new BPromise(function(_0x422c41,_0x42099d){return client[_0x5808('0xd')](_0x456130,_0x54ab63)[_0x5808('0xe')](function(_0x5ca1e0){logger['info'](_0x5808('0xf'),_0x447811,_0x5808('0x10'));logger[_0x5808('0x11')](_0x5808('0x12'),_0x447811,_0x5808('0x10'),JSON[_0x5808('0x13')](_0x5ca1e0));if(_0x5ca1e0[_0x5808('0x14')]){if(_0x5ca1e0['error']['code']===0x1f4){logger[_0x5808('0x14')](_0x5808('0xf'),_0x447811,_0x5ca1e0[_0x5808('0x14')][_0x5808('0x15')]);return _0x42099d(_0x5ca1e0[_0x5808('0x14')][_0x5808('0x15')]);}logger[_0x5808('0x14')](_0x5808('0xf'),_0x447811,_0x5ca1e0[_0x5808('0x14')][_0x5808('0x15')]);return _0x422c41(_0x5ca1e0[_0x5808('0x14')]['message']);}else{logger[_0x5808('0x16')]('MailAccount,\x20%s,\x20%s',_0x447811,_0x5808('0x10'));_0x422c41(_0x5ca1e0[_0x5808('0x17')][_0x5808('0x15')]);}})['catch'](function(_0x9e58d4){logger[_0x5808('0x14')]('MailAccount,\x20%s,\x20%s',_0x447811,_0x9e58d4);_0x42099d(_0x9e58d4);});});}exports['GetMailAccount']=function(_0x3c7c02){var _0x4a8e49=this;return new Promise(function(_0x40cfbd,_0x3c0937){return db[_0x5808('0x18')][_0x5808('0x19')]({'raw':_0x3c7c02['options']?_0x3c7c02['options'][_0x5808('0x1a')]===undefined?!![]:![]:!![],'where':_0x3c7c02[_0x5808('0x1b')]?_0x3c7c02[_0x5808('0x1b')][_0x5808('0x1c')]||null:null,'attributes':_0x3c7c02[_0x5808('0x1b')]?_0x3c7c02[_0x5808('0x1b')][_0x5808('0x1d')]||null:null,'limit':_0x3c7c02[_0x5808('0x1b')]?_0x3c7c02[_0x5808('0x1b')]['limit']||null:null,'include':_0x3c7c02['options']?_0x3c7c02[_0x5808('0x1b')][_0x5808('0x1e')]?_['map'](_0x3c7c02['options'][_0x5808('0x1e')],function(_0x467500){return{'model':db[_0x467500[_0x5808('0x1f')]],'as':_0x467500['as'],'attributes':_0x467500['attributes'],'include':_0x467500['include']?_[_0x5808('0x20')](_0x467500[_0x5808('0x1e')],function(_0x27c991){return{'model':db[_0x27c991[_0x5808('0x1f')]],'as':_0x27c991['as'],'attributes':_0x27c991[_0x5808('0x1d')],'include':_0x27c991['include']?_[_0x5808('0x20')](_0x27c991[_0x5808('0x1e')],function(_0x8c6742){return{'model':db[_0x8c6742[_0x5808('0x1f')]],'as':_0x8c6742['as'],'attributes':_0x8c6742[_0x5808('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5808('0xe')](function(_0x1117ac){logger['info']('GetMailAccount',_0x3c7c02);logger[_0x5808('0x11')](_0x5808('0x21'),_0x3c7c02,JSON[_0x5808('0x13')](_0x1117ac));_0x40cfbd(_0x1117ac);})['catch'](function(_0x3faa07){logger[_0x5808('0x14')](_0x5808('0x21'),_0x3faa07[_0x5808('0x15')],_0x3c7c02);_0x3c0937(_0x4a8e49[_0x5808('0x14')](0x1f4,_0x3faa07[_0x5808('0x15')]));});});};exports['ShowMailAccount']=function(_0x33a42a){var _0x5da6a4=this;return new Promise(function(_0x43c847,_0x4f7a9d){return db['MailAccount'][_0x5808('0x22')]({'raw':_0x33a42a['options']?_0x33a42a[_0x5808('0x1b')][_0x5808('0x1a')]===undefined?!![]:![]:!![],'where':_0x33a42a['options']?_0x33a42a[_0x5808('0x1b')][_0x5808('0x1c')]||null:null,'attributes':_0x33a42a['options']?_0x33a42a['options'][_0x5808('0x1d')]||null:null,'include':_0x33a42a['options']?_0x33a42a[_0x5808('0x1b')]['include']?_[_0x5808('0x20')](_0x33a42a[_0x5808('0x1b')][_0x5808('0x1e')],function(_0x5e0696){return{'model':db[_0x5e0696[_0x5808('0x1f')]],'as':_0x5e0696['as'],'attributes':_0x5e0696['attributes'],'include':_0x5e0696[_0x5808('0x1e')]?_['map'](_0x5e0696['include'],function(_0x12268a){return{'model':db[_0x12268a[_0x5808('0x1f')]],'as':_0x12268a['as'],'attributes':_0x12268a[_0x5808('0x1d')],'include':_0x12268a['include']?_['map'](_0x12268a[_0x5808('0x1e')],function(_0x2aa211){return{'model':db[_0x2aa211['model']],'as':_0x2aa211['as'],'attributes':_0x2aa211[_0x5808('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5808('0xe')](function(_0x375458){if(_0x33a42a['options'][_0x5808('0x23')]===!![])_0x375458[_0x5808('0x24')](_0x5808('0x25'),_0x375458['getSmtpOptions']());logger[_0x5808('0x16')](_0x5808('0x26'),_0x33a42a);logger['debug']('ShowMailAccount',_0x33a42a,JSON[_0x5808('0x13')](_0x375458));_0x43c847(_0x375458);})['catch'](function(_0x2f1d52){logger[_0x5808('0x14')](_0x5808('0x26'),_0x2f1d52[_0x5808('0x15')],_0x33a42a);_0x4f7a9d(_0x5da6a4[_0x5808('0x14')](0x1f4,_0x2f1d52['message']));});});};exports['NotifyMailAccount']=function(_0xa9d887){var _0x241559=this;return new Promise(function(_0x402b4e,_0x5062fd){var _0xfd3b1d={'body':_0xa9d887[_0x5808('0x27')],'channel':_0x5808('0x28')};var _0x2b82ca=_[_0x5808('0x29')](_['keys'](db[_0x5808('0x2a')][_0x5808('0x2b')]),[_0x5808('0x2c'),'updatedAt',_0x5808('0x2d'),_0x5808('0x2e')]);var _0xc62608=![];if(_0xa9d887['body']['id']){delete _0xa9d887['body']['id'];}if(_[_0x5808('0x2f')](_0xa9d887[_0x5808('0x27')][_0x5808('0x30')])){return _0x5062fd(_0x241559[_0x5808('0x14')](0x1f4,_0x5808('0x31')));}if(_[_0x5808('0x2f')](_0xa9d887[_0x5808('0x27')][_0x5808('0x27')])||_0xa9d887[_0x5808('0x27')][_0x5808('0x27')]===''){return _0x5062fd(_0x241559[_0x5808('0x14')](0x1f4,_0x5808('0x32')));}if(_[_0x5808('0x2f')](_0xa9d887['body']['mapKey'])){return _0x5062fd(_0x241559[_0x5808('0x14')](0x1f4,_0x5808('0x33')+_0x2b82ca));}if(!_[_0x5808('0x34')](_0x2b82ca,_0xa9d887[_0x5808('0x27')][_0x5808('0x35')])){return _0x5062fd(_0x241559[_0x5808('0x14')](0x1f4,_0x5808('0x36')+_0x2b82ca));}var _0x545713={};_0x545713[_0xa9d887[_0x5808('0x27')]['mapKey']]=_0xa9d887[_0x5808('0x27')]['from'];return db[_0x5808('0x18')]['find']({'where':{'id':_0xa9d887['account']['id']},'include':[{'model':db['CmList'],'as':_0x5808('0x37'),'include':[{'model':db[_0x5808('0x2a')],'as':'Contacts','where':_0x545713,'limit':0x1,'order':[[_0x5808('0x38'),_0x5808('0x39')]]}]},{'model':db[_0x5808('0x3a')],'as':'Applications'},{'model':db[_0x5808('0x3b')],'as':'Smtp','include':[{'model':db[_0x5808('0x3c')],'as':_0x5808('0x3c')}]}]})[_0x5808('0xe')](function(_0x5cc977){if(_0x5cc977&&_0x5cc977[_0x5808('0x37')]){var _0x1f3d28=_0x5cc977[_0x5808('0x3d')]({'plain':!![]});_0xfd3b1d[_0x5808('0x3e')]=_['omit'](_0x1f3d28,[_0x5808('0x3f'),_0x5808('0x37')]);_0xfd3b1d[_0x5808('0x3e')][_0x5808('0x25')]=_0x5cc977[_0x5808('0x40')]();_0xfd3b1d[_0x5808('0x41')]=_0x1f3d28['Applications'];_0xfd3b1d[_0x5808('0x42')]=_0x1f3d28[_0x5808('0x37')];_0xfd3b1d[_0x5808('0x41')]=_[_0x5808('0x43')](_0xfd3b1d[_0x5808('0x41')],['priority'],[_0x5808('0x44')]);if(_0xfd3b1d[_0x5808('0x3e')]&&_0xfd3b1d[_0x5808('0x3e')][_0x5808('0x45')]){_0xfd3b1d[_0x5808('0x41')][_0x5808('0x46')]({'id':0x0,'priority':_0xfd3b1d['applications'][_0x5808('0x47')]+0x1,'app':'close','appdata':_0x5808('0x45'),'interval':_0x5808('0x48')});}if(_0xfd3b1d['account'][_0x5808('0x3f')]){delete _0xfd3b1d[_0x5808('0x3e')][_0x5808('0x3f')];}if(_0xfd3b1d['account'][_0x5808('0x37')]){delete _0xfd3b1d[_0x5808('0x3e')]['List'];}if(_0x1f3d28[_0x5808('0x37')][_0x5808('0x49')]['length']){return _0x1f3d28['List'][_0x5808('0x49')][0x0];}var _0x58ecc0=_[_0x5808('0x8')](_0xa9d887['body'],{'firstName':_0xa9d887['body'][_0x5808('0x30')],'ListId':_0x1f3d28[_0x5808('0x2e')]});_0x58ecc0[_0xa9d887[_0x5808('0x27')][_0x5808('0x35')]]=_0xa9d887[_0x5808('0x27')][_0x5808('0x30')];return db[_0x5808('0x2a')][_0x5808('0x4a')](_0x58ecc0);}else{throw new Error(_0x5808('0x4b'));}})[_0x5808('0xe')](function(_0x4ff1b4){_0xfd3b1d['contact']=_0x4ff1b4;if(_0x4ff1b4){if(!_0xa9d887['body'][_0x5808('0x15')][_0x5808('0x4c')]){_0xa9d887['body'][_0x5808('0x15')]['messageId']=rs[_0x5808('0x4d')]()+'\x20'+_0xa9d887[_0x5808('0x27')][_0x5808('0x15')][_0x5808('0x30')];}var _0x199644={'ContactId':_0x4ff1b4['id'],'MailAccountId':_0xa9d887[_0x5808('0x3e')]['id'],'inReplyTo':_0xa9d887[_0x5808('0x27')][_0x5808('0x15')][_0x5808('0x4c')],'to':_0xa9d887[_0x5808('0x27')]['message'][_0x5808('0x30')],'cc':_0xa9d887[_0x5808('0x27')][_0x5808('0x15')]['cc'],'subject':_0xa9d887[_0x5808('0x27')][_0x5808('0x15')][_0x5808('0x4e')],'attach':_0xa9d887['body']['message']['attach'],'lastMsgAt':moment()[_0x5808('0x4f')](_0x5808('0x50')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x5808('0x22')]({'where':{'closed':![],'MailAccountId':_0xa9d887[_0x5808('0x3e')]['id']},'include':[{'model':db[_0x5808('0x51')],'as':_0x5808('0x52'),'attributes':[_0x5808('0x4c')],'where':{'messageId':_0xa9d887[_0x5808('0x27')]['message']['inReplyTo']}}]})[_0x5808('0xe')](function(_0x1a4bc3){if(_0x1a4bc3){return[_0x1a4bc3,![]];}return db[_0x5808('0x53')][_0x5808('0x4a')](_0x199644)[_0x5808('0xe')](function(_0x56a8c9){return[_0x56a8c9,!![]];});});}else{throw new Error(_0x5808('0x54'));}})[_0x5808('0x55')](function(_0x3cc7f7,_0xe73ec9){if(_0x3cc7f7){_0xc62608=_0xe73ec9;if(!_0xe73ec9){return _0x3cc7f7[_0x5808('0x56')]({'inReplyTo':_0xa9d887['body'][_0x5808('0x15')][_0x5808('0x4c')],'to':_0xa9d887[_0x5808('0x27')][_0x5808('0x15')][_0x5808('0x30')],'cc':_0xa9d887[_0x5808('0x27')][_0x5808('0x15')]['cc'],'subject':_0xa9d887[_0x5808('0x27')][_0x5808('0x15')][_0x5808('0x4e')],'attach':_0x3cc7f7[_0x5808('0x57')]?_0x3cc7f7['attach']:_0xa9d887['body'][_0x5808('0x15')][_0x5808('0x57')],'substatus':null,'substatusAt':moment()[_0x5808('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x5808('0x4f')](_0x5808('0x50')),'lastMsgDirection':'in'});}else{return _0x3cc7f7;}}})['then'](function(_0x199b5f){_0xfd3b1d[_0x5808('0x58')]=_0x199b5f['get']({'plain':!![]});_0xfd3b1d[_0x5808('0x58')][_0x5808('0x59')]=_0xc62608;return db[_0x5808('0x51')][_0x5808('0x4a')]({'body':_0xa9d887['body']['body'],'MailAccountId':_0xa9d887[_0x5808('0x3e')]['id'],'MailInteractionId':_0x199b5f['id'],'direction':'in','ContactId':_0xfd3b1d[_0x5808('0x5a')]['id'],'messageId':_0xa9d887[_0x5808('0x27')][_0x5808('0x15')][_0x5808('0x4c')],'from':_0xa9d887['body']['message'][_0x5808('0x30')],'to':_0xa9d887['body'][_0x5808('0x15')]['to'],'cc':_0xa9d887['body'][_0x5808('0x15')]['cc'],'subject':_0xa9d887[_0x5808('0x27')]['message'][_0x5808('0x4e')],'attach':_0xa9d887[_0x5808('0x27')][_0x5808('0x15')][_0x5808('0x57')],'Attachments':_0xa9d887[_0x5808('0x27')][_0x5808('0x15')][_0x5808('0x5b')],'originTo':_0xa9d887['body']['message'][_0x5808('0x5c')],'originCc':_0xa9d887[_0x5808('0x27')][_0x5808('0x15')]['originCc'],'bcc':_0xa9d887[_0x5808('0x27')]['message']['bcc'],'ChatWebsiteId':_0xa9d887['body'][_0x5808('0x15')]['ChatWebsiteId']||null,'originChannel':_0xa9d887[_0x5808('0x27')][_0x5808('0x15')][_0x5808('0x5d')]||_0x5808('0x5e'),'ChatOfflineMessageId':_0xa9d887[_0x5808('0x27')][_0x5808('0x15')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x5808('0x5f')],'as':_0x5808('0x60')}]});})[_0x5808('0xe')](function(_0x239ee5){_0xfd3b1d['message']=_0x239ee5;if(!_0xfd3b1d[_0x5808('0x58')]['UserId']){return;}return db[_0x5808('0x61')]['find']({'attributes':['id',_0x5808('0x62')],'where':{'id':_0xfd3b1d[_0x5808('0x58')]['UserId']}});})[_0x5808('0xe')](function(_0x32e24a){if(_0x32e24a){_0xfd3b1d[_0x5808('0x41')][_0x5808('0x63')]({'id':0x0,'priority':0x0,'app':_0x5808('0x64'),'appdata':_0x32e24a[_0x5808('0x62')]+','+(_0xfd3b1d[_0x5808('0x3e')]['waitForTheAssignedAgent']||0xa),'interval':_0x5808('0x48')});}if(!_0xfd3b1d[_0x5808('0x58')]['queueId']){return;}return db[_0x5808('0x65')][_0x5808('0x22')]({'attributes':['id',_0x5808('0x62')],'where':{'id':_0xfd3b1d['interaction'][_0x5808('0x66')]}});})[_0x5808('0xe')](function(_0xfb5a6c){if(_0xfb5a6c){_0xfd3b1d[_0x5808('0x41')][_0x5808('0x63')]({'id':0x0,'priority':0x1,'app':_0x5808('0x67'),'appdata':_0xfb5a6c[_0x5808('0x62')]+','+(_0xfd3b1d[_0x5808('0x3e')][_0x5808('0x68')]||0x12c),'interval':_0x5808('0x48')});}return respondWithRpcPromise('Start',_0x5808('0x69'),_0xfd3b1d);})[_0x5808('0xe')](function(_0x2c7ce3){_0x402b4e(_0x2c7ce3);})['catch'](function(_0x38b6bb){_0x5062fd(_0x241559['error'](0x1f4,_0x38b6bb[_0x5808('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 12677ef..137960a 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 _0x5c21=['emit','removeListener','register','length','save','remove','update'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x5c21,0x90));var _0x15c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c21[_0x3dd15e];return _0x231fd0;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x15c2('0x0'),_0x15c2('0x1'),_0x15c2('0x2')];function createListener(_0x1dac53,_0x56c03b){return function(_0xe44c2e){_0x56c03b[_0x15c2('0x3')](_0x1dac53,_0xe44c2e);};}function removeListener(_0x42629e,_0x17a2a7){return function(){MailAccountEvents[_0x15c2('0x4')](_0x42629e,_0x17a2a7);};}exports[_0x15c2('0x5')]=function(_0x49e1be){for(var _0x223eee=0x0,_0x5e1e25=events[_0x15c2('0x6')];_0x223eee<_0x5e1e25;_0x223eee++){var _0x1a78e6=events[_0x223eee];var _0x3fc8ac=createListener('mailAccount:'+_0x1a78e6,_0x49e1be);MailAccountEvents['on'](_0x1a78e6,_0x3fc8ac);}}; \ No newline at end of file +var _0x2059=['./mailAccount.events','remove','update','removeListener','register','mailAccount:'];(function(_0x678dda,_0x4bd7a9){var _0x430464=function(_0x1da5b1){while(--_0x1da5b1){_0x678dda['push'](_0x678dda['shift']());}};_0x430464(++_0x4bd7a9);}(_0x2059,0xf6));var _0x9205=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x2059[_0x20589d];return _0x422de9;};'use strict';var MailAccountEvents=require(_0x9205('0x0'));var events=['save',_0x9205('0x1'),_0x9205('0x2')];function createListener(_0x171fec,_0x3a67d3){return function(_0x110aba){_0x3a67d3['emit'](_0x171fec,_0x110aba);};}function removeListener(_0x46ef8d,_0x3609c1){return function(){MailAccountEvents[_0x9205('0x3')](_0x46ef8d,_0x3609c1);};}exports[_0x9205('0x4')]=function(_0x121045){for(var _0x441bd9=0x0,_0x5a1503=events['length'];_0x441bd9<_0x5a1503;_0x441bd9++){var _0x1b78e3=events[_0x441bd9];var _0x3c31cd=createListener(_0x9205('0x5')+_0x1b78e3,_0x121045);MailAccountEvents['on'](_0x1b78e3,_0x3c31cd);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index e789bd4..44736f7 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 _0xc658=['get','isAuthenticated','update','delete','/:id','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller'];(function(_0x10a212,_0x579d85){var _0x23c82b=function(_0x412ea9){while(--_0x412ea9){_0x10a212['push'](_0x10a212['shift']());}};_0x23c82b(++_0x579d85);}(_0xc658,0xe6));var _0x8c65=function(_0x1e8843,_0xeb2ee6){_0x1e8843=_0x1e8843-0x0;var _0x52ce9b=_0xc658[_0x1e8843];return _0x52ce9b;};'use strict';var multer=require(_0x8c65('0x0'));var util=require(_0x8c65('0x1'));var path=require('path');var timeout=require(_0x8c65('0x2'));var express=require(_0x8c65('0x3'));var router=express[_0x8c65('0x4')]();var fs_extra=require(_0x8c65('0x5'));var auth=require(_0x8c65('0x6'));var interaction=require(_0x8c65('0x7'));var config=require(_0x8c65('0x8'));var controller=require(_0x8c65('0x9'));router[_0x8c65('0xa')]('/:id',auth[_0x8c65('0xb')](),controller['show']);router['put']('/:id',auth[_0x8c65('0xb')](),controller[_0x8c65('0xc')]);router[_0x8c65('0xd')](_0x8c65('0xe'),auth['isAuthenticated'](),controller[_0x8c65('0xf')]);module['exports']=router; \ No newline at end of file +var _0xb5cf=['Router','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','put','update','delete','destroy','exports','multer','path','express'];(function(_0xad6109,_0x17511c){var _0x1c8b9e=function(_0x2b41a4){while(--_0x2b41a4){_0xad6109['push'](_0xad6109['shift']());}};_0x1c8b9e(++_0x17511c);}(_0xb5cf,0x10b));var _0xfb5c=function(_0x5253dc,_0x401a73){_0x5253dc=_0x5253dc-0x0;var _0x57b3a7=_0xb5cf[_0x5253dc];return _0x57b3a7;};'use strict';var multer=require(_0xfb5c('0x0'));var util=require('util');var path=require(_0xfb5c('0x1'));var timeout=require('connect-timeout');var express=require(_0xfb5c('0x2'));var router=express[_0xfb5c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfb5c('0x4'));var interaction=require(_0xfb5c('0x5'));var config=require('../../config/environment');var controller=require(_0xfb5c('0x6'));router[_0xfb5c('0x7')](_0xfb5c('0x8'),auth[_0xfb5c('0x9')](),controller['show']);router[_0xfb5c('0xa')](_0xfb5c('0x8'),auth[_0xfb5c('0x9')](),controller[_0xfb5c('0xb')]);router[_0xfb5c('0xc')](_0xfb5c('0x8'),auth[_0xfb5c('0x9')](),controller[_0xfb5c('0xd')]);module[_0xfb5c('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index a764983..591cb3c 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 _0x8736=['noop','TEXT','exports','STRING'];(function(_0x5d79de,_0x2263b7){var _0x51e9c7=function(_0x447aa5){while(--_0x447aa5){_0x5d79de['push'](_0x5d79de['shift']());}};_0x51e9c7(++_0x2263b7);}(_0x8736,0xf2));var _0x6873=function(_0x45e6cd,_0x29242a){_0x45e6cd=_0x45e6cd-0x0;var _0x36c489=_0x8736[_0x45e6cd];return _0x36c489;};'use strict';var Sequelize=require('sequelize');module[_0x6873('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6873('0x1')],'allowNull':![],'defaultValue':_0x6873('0x2')},'appdata':{'type':Sequelize[_0x6873('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6873('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x3173=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x21aaa5,_0x3367ee){var _0x2415a8=function(_0x21306f){while(--_0x21306f){_0x21aaa5['push'](_0x21aaa5['shift']());}};_0x2415a8(++_0x3367ee);}(_0x3173,0x176));var _0x3317=function(_0x5b58ba,_0x16159f){_0x5b58ba=_0x5b58ba-0x0;var _0xc67099=_0x3173[_0x5b58ba];return _0xc67099;};'use strict';var Sequelize=require(_0x3317('0x0'));module[_0x3317('0x1')]={'priority':{'type':Sequelize[_0x3317('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3317('0x3')],'allowNull':![],'defaultValue':_0x3317('0x4')},'appdata':{'type':Sequelize[_0x3317('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3317('0x3')],'defaultValue':_0x3317('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index c6d6133..703447f 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 _0xa9e0=['includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x217d8c,_0x587031){var _0x1a3323=function(_0x33e91d){while(--_0x33e91d){_0x217d8c['push'](_0x217d8c['shift']());}};_0x1a3323(++_0x587031);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file +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(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xedd9,0xfc));var _0x9edd=function(_0xd525a1,_0x4f53ce){_0xd525a1=_0xd525a1-0x0;var _0x3f97ef=_0xedd9[_0xd525a1];return _0x3f97ef;};'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 diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 7367d93..cc546a1 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 _0xa096=['utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','mail_applications','utf8mb4'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa096,0x119));var _0x6a09=function(_0x46a563,_0x586712){_0x46a563=_0x46a563-0x0;var _0x10aa22=_0xa096[_0x46a563];return _0x10aa22;};'use strict';var _=require(_0x6a09('0x0'));var util=require('util');var logger=require(_0x6a09('0x1'))('api');var moment=require(_0x6a09('0x2'));var BPromise=require(_0x6a09('0x3'));var rp=require(_0x6a09('0x4'));var fs=require('fs');var path=require(_0x6a09('0x5'));var rimraf=require(_0x6a09('0x6'));var config=require(_0x6a09('0x7'));var attributes=require(_0x6a09('0x8'));module[_0x6a09('0x9')]=function(_0x46a0f4,_0x4ca9a2){return _0x46a0f4[_0x6a09('0xa')]('MailApplication',attributes,{'tableName':_0x6a09('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6a09('0xc'),'collate':_0x6a09('0xd')});}; \ No newline at end of file +var _0xc879=['bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','mail_applications','utf8mb4','lodash','util','api'];(function(_0x2af276,_0xb15ec5){var _0x4c586e=function(_0x681843){while(--_0x681843){_0x2af276['push'](_0x2af276['shift']());}};_0x4c586e(++_0xb15ec5);}(_0xc879,0x1eb));var _0x9c87=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc879[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x9c87('0x0'));var util=require(_0x9c87('0x1'));var logger=require('../../config/logger')(_0x9c87('0x2'));var moment=require('moment');var BPromise=require(_0x9c87('0x3'));var rp=require(_0x9c87('0x4'));var fs=require('fs');var path=require(_0x9c87('0x5'));var rimraf=require(_0x9c87('0x6'));var config=require(_0x9c87('0x7'));var attributes=require(_0x9c87('0x8'));module[_0x9c87('0x9')]=function(_0x3f6a0d,_0x348f93){return _0x3f6a0d[_0x9c87('0xa')]('MailApplication',attributes,{'tableName':_0x9c87('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9c87('0xc'),'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 d54ba36..8d3430d 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 _0x505d=['request','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','update','body','options','raw','where','limit','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x322efb,_0x539552){var _0x4245ca=function(_0x456790){while(--_0x456790){_0x322efb['push'](_0x322efb['shift']());}};_0x4245ca(++_0x539552);}(_0x505d,0xb9));var _0xd505=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x505d[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0xd505('0x0'));var util=require(_0xd505('0x1'));var moment=require('moment');var BPromise=require(_0xd505('0x2'));var rs=require(_0xd505('0x3'));var fs=require('fs');var Redis=require(_0xd505('0x4'));var db=require(_0xd505('0x5'))['db'];var utils=require(_0xd505('0x6'));var logger=require(_0xd505('0x7'))(_0xd505('0x8'));var config=require(_0xd505('0x9'));var jayson=require(_0xd505('0xa'));var client=jayson[_0xd505('0xb')][_0xd505('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xec6587,_0x33b9e6,_0x27e2c7){return new BPromise(function(_0x447a97,_0x4d336c){return client[_0xd505('0xd')](_0xec6587,_0x27e2c7)[_0xd505('0xe')](function(_0x3d879a){logger[_0xd505('0xf')]('MailApplication,\x20%s,\x20%s',_0x33b9e6,_0xd505('0x10'));logger[_0xd505('0x11')](_0xd505('0x12'),_0x33b9e6,_0xd505('0x10'),JSON['stringify'](_0x3d879a));if(_0x3d879a[_0xd505('0x13')]){if(_0x3d879a['error'][_0xd505('0x14')]===0x1f4){logger[_0xd505('0x13')](_0xd505('0x15'),_0x33b9e6,_0x3d879a['error'][_0xd505('0x16')]);return _0x4d336c(_0x3d879a['error'][_0xd505('0x16')]);}logger[_0xd505('0x13')](_0xd505('0x15'),_0x33b9e6,_0x3d879a[_0xd505('0x13')]['message']);return _0x447a97(_0x3d879a[_0xd505('0x13')]['message']);}else{logger[_0xd505('0xf')](_0xd505('0x15'),_0x33b9e6,_0xd505('0x10'));_0x447a97(_0x3d879a[_0xd505('0x17')]['message']);}})[_0xd505('0x18')](function(_0x896102){logger[_0xd505('0x13')]('MailApplication,\x20%s,\x20%s',_0x33b9e6,_0x896102);_0x4d336c(_0x896102);});});}exports[_0xd505('0x19')]=function(_0x4111f1){var _0x1b558a=this;return new Promise(function(_0x190c39,_0x203aea){return db['MailApplication'][_0xd505('0x1a')](_0x4111f1[_0xd505('0x1b')],{'raw':_0x4111f1['options']?_0x4111f1[_0xd505('0x1c')][_0xd505('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4111f1['options']?_0x4111f1[_0xd505('0x1c')][_0xd505('0x1e')]||null:null,'attributes':_0x4111f1[_0xd505('0x1c')]?_0x4111f1[_0xd505('0x1c')]['attributes']||null:null,'limit':_0x4111f1[_0xd505('0x1c')]?_0x4111f1[_0xd505('0x1c')][_0xd505('0x1f')]||null:null})[_0xd505('0xe')](function(_0x5997e6){logger[_0xd505('0xf')](_0xd505('0x19'),_0x4111f1);logger[_0xd505('0x11')](_0xd505('0x19'),_0x4111f1,JSON[_0xd505('0x20')](_0x5997e6));_0x190c39(_0x5997e6);})['catch'](function(_0x4bc762){logger[_0xd505('0x13')]('UpdateMailApplication',_0x4bc762[_0xd505('0x16')],_0x4111f1);_0x203aea(_0x1b558a[_0xd505('0x13')](0x1f4,_0x4bc762[_0xd505('0x16')]));});});}; \ No newline at end of file +var _0xeda6=['debug','stringify','lodash','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit'];(function(_0x17dfbd,_0x2b5bd1){var _0x54f724=function(_0x1d7dcb){while(--_0x1d7dcb){_0x17dfbd['push'](_0x17dfbd['shift']());}};_0x54f724(++_0x2b5bd1);}(_0xeda6,0x136));var _0x6eda=function(_0x23d8f9,_0x56a182){_0x23d8f9=_0x23d8f9-0x0;var _0x3f45b0=_0xeda6[_0x23d8f9];return _0x3f45b0;};'use strict';var _=require(_0x6eda('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6eda('0x1'));var fs=require('fs');var Redis=require(_0x6eda('0x2'));var db=require(_0x6eda('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6eda('0x4'));var config=require('../../config/environment');var jayson=require(_0x6eda('0x5'));var client=jayson[_0x6eda('0x6')][_0x6eda('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1e7b08,_0x229dc4,_0x23d63e){return new BPromise(function(_0x3fcf8,_0xd26e4d){return client['request'](_0x1e7b08,_0x23d63e)[_0x6eda('0x8')](function(_0x15fa52){logger[_0x6eda('0x9')](_0x6eda('0xa'),_0x229dc4,_0x6eda('0xb'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x229dc4,_0x6eda('0xb'),JSON['stringify'](_0x15fa52));if(_0x15fa52['error']){if(_0x15fa52[_0x6eda('0xc')][_0x6eda('0xd')]===0x1f4){logger[_0x6eda('0xc')](_0x6eda('0xa'),_0x229dc4,_0x15fa52[_0x6eda('0xc')][_0x6eda('0xe')]);return _0xd26e4d(_0x15fa52['error']['message']);}logger[_0x6eda('0xc')](_0x6eda('0xa'),_0x229dc4,_0x15fa52[_0x6eda('0xc')][_0x6eda('0xe')]);return _0x3fcf8(_0x15fa52[_0x6eda('0xc')][_0x6eda('0xe')]);}else{logger[_0x6eda('0x9')](_0x6eda('0xa'),_0x229dc4,_0x6eda('0xb'));_0x3fcf8(_0x15fa52[_0x6eda('0xf')][_0x6eda('0xe')]);}})[_0x6eda('0x10')](function(_0xc913c5){logger[_0x6eda('0xc')](_0x6eda('0xa'),_0x229dc4,_0xc913c5);_0xd26e4d(_0xc913c5);});});}exports[_0x6eda('0x11')]=function(_0x4d7524){var _0x5dc42a=this;return new Promise(function(_0x4e10d2,_0x226595){return db[_0x6eda('0x12')][_0x6eda('0x13')](_0x4d7524[_0x6eda('0x14')],{'raw':_0x4d7524['options']?_0x4d7524[_0x6eda('0x15')][_0x6eda('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d7524[_0x6eda('0x15')]?_0x4d7524[_0x6eda('0x15')][_0x6eda('0x17')]||null:null,'attributes':_0x4d7524[_0x6eda('0x15')]?_0x4d7524[_0x6eda('0x15')][_0x6eda('0x18')]||null:null,'limit':_0x4d7524[_0x6eda('0x15')]?_0x4d7524[_0x6eda('0x15')][_0x6eda('0x19')]||null:null})[_0x6eda('0x8')](function(_0x36128a){logger[_0x6eda('0x9')](_0x6eda('0x11'),_0x4d7524);logger[_0x6eda('0x1a')](_0x6eda('0x11'),_0x4d7524,JSON[_0x6eda('0x1b')](_0x36128a));_0x4e10d2(_0x36128a);})[_0x6eda('0x10')](function(_0x8a94e){logger[_0x6eda('0xc')](_0x6eda('0x11'),_0x8a94e[_0x6eda('0xe')],_0x4d7524);_0x226595(_0x5dc42a[_0x6eda('0xc')](0x1f4,_0x8a94e[_0x6eda('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 5f513a2..5390a61 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 _0xc385=['destroy','delete','removeTags','exports','express','Router','../../components/interaction/service','get','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','tracked','mailinteraction:update','update','mailinteraction:destroy'];(function(_0x57a0cb,_0x54657d){var _0xaeb676=function(_0x44e7a1){while(--_0x44e7a1){_0x57a0cb['push'](_0x57a0cb['shift']());}};_0xaeb676(++_0x54657d);}(_0xc385,0xa0));var _0x5c38=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xc385[_0x20a558];return _0x53d3f7;};'use strict';var express=require(_0x5c38('0x0'));var router=express[_0x5c38('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x5c38('0x2'));var controller=require('./mailInteraction.controller');router[_0x5c38('0x3')]('/',auth[_0x5c38('0x4')](),controller['index']);router[_0x5c38('0x3')]('/describe',auth[_0x5c38('0x4')](),controller[_0x5c38('0x5')]);router[_0x5c38('0x3')](_0x5c38('0x6'),auth[_0x5c38('0x4')](),controller['show']);router[_0x5c38('0x3')](_0x5c38('0x7'),auth[_0x5c38('0x4')](),controller[_0x5c38('0x8')]);router[_0x5c38('0x3')](_0x5c38('0x9'),auth[_0x5c38('0x4')](),controller[_0x5c38('0xa')]);router[_0x5c38('0xb')]('/',auth[_0x5c38('0x4')](),controller[_0x5c38('0xc')]);router[_0x5c38('0xb')](_0x5c38('0x7'),auth['isAuthenticated'](),controller[_0x5c38('0xd')]);router[_0x5c38('0xb')](_0x5c38('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0x5c38('0xf'),_0x5c38('0x10')),controller[_0x5c38('0x11')]);router['put'](_0x5c38('0x6'),auth['isAuthenticated'](),interaction[_0x5c38('0x12')](_0x5c38('0xf'),_0x5c38('0x13')),controller[_0x5c38('0x14')]);router['delete'](_0x5c38('0x6'),auth[_0x5c38('0x4')](),interaction[_0x5c38('0x12')](_0x5c38('0xf'),_0x5c38('0x15')),controller[_0x5c38('0x16')]);router[_0x5c38('0x17')]('/:id/tags',auth[_0x5c38('0x4')](),controller[_0x5c38('0x18')]);module[_0x5c38('0x19')]=router; \ No newline at end of file +var _0xb58b=['show','/:id/messages','getMessages','/:id/download','isAuthenticated','download','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','destroy','delete','removeTags','exports','express','../../components/auth/service','../../components/interaction/service','get','index','describe','/:id'];(function(_0x54d73b,_0x3d8ca0){var _0x478f12=function(_0x321c1d){while(--_0x321c1d){_0x54d73b['push'](_0x54d73b['shift']());}};_0x478f12(++_0x3d8ca0);}(_0xb58b,0x13d));var _0xbb58=function(_0x2dd429,_0x1e5d4e){_0x2dd429=_0x2dd429-0x0;var _0x386787=_0xb58b[_0x2dd429];return _0x386787;};'use strict';var express=require(_0xbb58('0x0'));var router=express['Router']();var auth=require(_0xbb58('0x1'));var interaction=require(_0xbb58('0x2'));var controller=require('./mailInteraction.controller');router[_0xbb58('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb58('0x4')]);router[_0xbb58('0x3')]('/describe',auth['isAuthenticated'](),controller[_0xbb58('0x5')]);router['get'](_0xbb58('0x6'),auth['isAuthenticated'](),controller[_0xbb58('0x7')]);router[_0xbb58('0x3')](_0xbb58('0x8'),auth['isAuthenticated'](),controller[_0xbb58('0x9')]);router['get'](_0xbb58('0xa'),auth[_0xbb58('0xb')](),controller[_0xbb58('0xc')]);router[_0xbb58('0xd')]('/',auth[_0xbb58('0xb')](),controller['create']);router[_0xbb58('0xd')](_0xbb58('0x8'),auth[_0xbb58('0xb')](),controller[_0xbb58('0xe')]);router[_0xbb58('0xd')](_0xbb58('0xf'),auth[_0xbb58('0xb')](),interaction[_0xbb58('0x10')](_0xbb58('0x11'),_0xbb58('0x12')),controller[_0xbb58('0x13')]);router[_0xbb58('0x14')]('/:id',auth[_0xbb58('0xb')](),interaction[_0xbb58('0x10')](_0xbb58('0x11'),_0xbb58('0x15')),controller[_0xbb58('0x16')]);router['delete'](_0xbb58('0x6'),auth[_0xbb58('0xb')](),interaction['tracked'](_0xbb58('0x11'),'mailinteraction:destroy'),controller[_0xbb58('0x17')]);router[_0xbb58('0x18')]('/:id/tags',auth[_0xbb58('0xb')](),controller[_0xbb58('0x19')]);module[_0xbb58('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 20cc48b..c51897d 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 _0x513b=['STRING','TEXT','out','ENUM','BOOLEAN','INTEGER','sequelize','iconv','exports','DATE'];(function(_0x485c12,_0x63ee16){var _0x5c87ad=function(_0x5bb3cf){while(--_0x5bb3cf){_0x485c12['push'](_0x485c12['shift']());}};_0x5c87ad(++_0x63ee16);}(_0x513b,0x1be));var _0xb513=function(_0x28a4fa,_0x1ee1e6){_0x28a4fa=_0x28a4fa-0x0;var _0x2972d8=_0x513b[_0x28a4fa];return _0x2972d8;};'use strict';var Sequelize=require(_0xb513('0x0'));var iconv=require(_0xb513('0x1'));module[_0xb513('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb513('0x3')]},'disposition':{'type':Sequelize[_0xb513('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb513('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xb513('0x4')](0x1fe)},'to':{'type':Sequelize[_0xb513('0x4')]},'cc':{'type':Sequelize[_0xb513('0x5')]('long')},'subject':{'type':Sequelize[_0xb513('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xb513('0x3')]},'substatus':{'type':Sequelize[_0xb513('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xb513('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xb513('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb513('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb513('0x7')]('in',_0xb513('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb513('0x8')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xb513('0x9')]}}; \ No newline at end of file +var _0x4470=['INTEGER','exports','DATE','STRING','TEXT','long','BOOLEAN','ENUM','out'];(function(_0x4e0965,_0x2b7362){var _0x3db40a=function(_0x1017ee){while(--_0x1017ee){_0x4e0965['push'](_0x4e0965['shift']());}};_0x3db40a(++_0x2b7362);}(_0x4470,0x1c3));var _0x0447=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0x4470[_0x44cb92];return _0x56b9e6;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module[_0x0447('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0447('0x1')]},'disposition':{'type':Sequelize[_0x0447('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0447('0x2')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x0447('0x2')](0x1fe)},'to':{'type':Sequelize[_0x0447('0x2')]},'cc':{'type':Sequelize[_0x0447('0x3')](_0x0447('0x4'))},'subject':{'type':Sequelize[_0x0447('0x3')]()},'attach':{'type':Sequelize[_0x0447('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0447('0x1')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x0447('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x0447('0x6')]('in',_0x0447('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0447('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0447('0x5')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x0447('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index b93f1c7..b742b4a 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 _0x41bb=['Attachments','from','bcc','subject','createdAt','get','mkdirSync','each','Messages','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','util','path','lodash','juice','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','html-entities','redis','socket.io-emitter','./mailInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','name','send','index','MailInteraction','rawAttributes','type','key','getOptions','findAll','mail','query','user','catch','show','params','model','keys','filters','intersection','attributes','length','includeAll','include','merge','options','create','body','find','describe','addMessage','MailMessage','ids','getMessages','fields','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','addTags','omit','spread','Tag','color','emit','removeTags','download','unix','join','root','server','files','attachments','format'];(function(_0x4ded65,_0xc8d7c1){var _0x5864fb=function(_0x40df9d){while(--_0x40df9d){_0x4ded65['push'](_0x4ded65['shift']());}};_0x5864fb(++_0xc8d7c1);}(_0x41bb,0x15d));var _0xb41b=function(_0x3c2919,_0x2353f5){_0x3c2919=_0x3c2919-0x0;var _0x51e59e=_0x41bb[_0x3c2919];return _0x51e59e;};'use strict';var emlformat=require(_0xb41b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb41b('0x1'));var moment=require(_0xb41b('0x2'));var BPromise=require(_0xb41b('0x3'));var util=require(_0xb41b('0x4'));var path=require(_0xb41b('0x5'));var fs=require('fs');var _=require(_0xb41b('0x6'));var juice=require(_0xb41b('0x7'));var Redis=require('ioredis');var interaction=require(_0xb41b('0x8'));var qs=require(_0xb41b('0x9'));var logger=require(_0xb41b('0xa'))(_0xb41b('0xb'));var config=require('../../config/environment');var db=require(_0xb41b('0xc'))['db'];var htmlEntities=require(_0xb41b('0xd'));config[_0xb41b('0xe')]=_['defaults'](config[_0xb41b('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xb41b('0xf'))(new Redis(config[_0xb41b('0xe')]));require(_0xb41b('0x10'))['register'](socket);function respondWithStatusCode(_0x4bc43c,_0x4a2d9a){_0x4a2d9a=_0x4a2d9a||0xcc;return function(_0x21378b){if(_0x21378b){return _0x4bc43c[_0xb41b('0x11')](_0x4a2d9a);}return _0x4bc43c['status'](_0x4a2d9a)['end']();};}function respondWithResult(_0x3dfae6,_0x4cdb94){_0x4cdb94=_0x4cdb94||0xc8;return function(_0x2d0dd9){if(_0x2d0dd9){return _0x3dfae6[_0xb41b('0x12')](_0x4cdb94)[_0xb41b('0x13')](_0x2d0dd9);}};}function respondWithFilteredResult(_0x20537a,_0x1db653){return function(_0x349d58){if(_0x349d58){var _0x371791=typeof _0x1db653[_0xb41b('0x14')]===_0xb41b('0x15')&&typeof _0x1db653[_0xb41b('0x16')]===_0xb41b('0x15');var _0x116afa=_0x349d58[_0xb41b('0x17')];var _0x14b021=_0x371791?0x0:_0x1db653['offset'];var _0x264da9=_0x371791?_0x349d58[_0xb41b('0x17')]:_0x1db653['offset']+_0x1db653[_0xb41b('0x16')];var _0x250bef;if(_0x264da9>=_0x116afa){_0x264da9=_0x116afa;_0x250bef=0xc8;}else{_0x250bef=0xce;}_0x20537a['status'](_0x250bef);return _0x20537a[_0xb41b('0x18')](_0xb41b('0x19'),_0x14b021+'-'+_0x264da9+'/'+_0x116afa)[_0xb41b('0x13')](_0x349d58);}return null;};}function saveUpdates(_0x1e6a4d){return function(_0x140d34){if(_0x140d34){return _0x140d34[_0xb41b('0x1a')](_0x1e6a4d)[_0xb41b('0x1b')](function(_0x41abf5){return _0x41abf5;});}return null;};}function removeEntity(_0x3211b3){return function(_0x1e84d3){if(_0x1e84d3){return _0x1e84d3[_0xb41b('0x1c')]()[_0xb41b('0x1b')](function(){_0x3211b3[_0xb41b('0x12')](0xcc)[_0xb41b('0x1d')]();});}};}function handleEntityNotFound(_0x3fec2c){return function(_0x37543a){if(!_0x37543a){_0x3fec2c[_0xb41b('0x11')](0x194);}return _0x37543a;};}function handleError(_0x59376f,_0x4d4109){_0x4d4109=_0x4d4109||0x1f4;return function(_0x1800d0){logger[_0xb41b('0x1e')](_0x1800d0['stack']);if(_0x1800d0[_0xb41b('0x1f')]){delete _0x1800d0[_0xb41b('0x1f')];}_0x59376f[_0xb41b('0x12')](_0x4d4109)[_0xb41b('0x20')](_0x1800d0);};}exports[_0xb41b('0x21')]=function(_0x2f6df7,_0xb1f069){var _0x15ee00={};var _0x54e63f=_['map'](db[_0xb41b('0x22')][_0xb41b('0x23')],function(_0xc0d73c){return{'name':_0xc0d73c['fieldName'],'type':_0xc0d73c[_0xb41b('0x24')][_0xb41b('0x25')]};});_0x15ee00=qs[_0xb41b('0x26')](_0x54e63f,_0x2f6df7);return interaction[_0xb41b('0x27')](_0xb41b('0x28'),_0x2f6df7[_0xb41b('0x29')],_0x2f6df7[_0xb41b('0x2a')],_0x15ee00,_0x54e63f)[_0xb41b('0x1b')](respondWithFilteredResult(_0xb1f069,_0x15ee00))[_0xb41b('0x2b')](handleError(_0xb1f069,null));};exports[_0xb41b('0x2c')]=function(_0x14c839,_0x95afc9){var _0x3aa62d={'raw':![],'where':{'id':_0x14c839[_0xb41b('0x2d')]['id']}},_0x3c9701={};_0x3c9701[_0xb41b('0x2e')]=_[_0xb41b('0x2f')](db[_0xb41b('0x22')]['rawAttributes']);_0x3c9701[_0xb41b('0x29')]=_[_0xb41b('0x2f')](_0x14c839['query']);_0x3c9701[_0xb41b('0x30')]=_[_0xb41b('0x31')](_0x3c9701['model'],_0x3c9701[_0xb41b('0x29')]);_0x3aa62d['attributes']=_[_0xb41b('0x31')](_0x3c9701[_0xb41b('0x2e')],qs['fields'](_0x14c839[_0xb41b('0x29')]['fields']));_0x3aa62d[_0xb41b('0x32')]=_0x3aa62d[_0xb41b('0x32')][_0xb41b('0x33')]?_0x3aa62d[_0xb41b('0x32')]:_0x3c9701[_0xb41b('0x2e')];if(_0x14c839['query'][_0xb41b('0x34')]){_0x3aa62d[_0xb41b('0x35')]=[{'all':!![]}];}_0x3aa62d=_[_0xb41b('0x36')]({},_0x3aa62d,_0x14c839[_0xb41b('0x37')]);return db['MailInteraction']['find'](_0x3aa62d)['then'](handleEntityNotFound(_0x95afc9,null))[_0xb41b('0x1b')](respondWithResult(_0x95afc9,null))[_0xb41b('0x2b')](handleError(_0x95afc9,null));};exports[_0xb41b('0x38')]=function(_0x91a712,_0x406784){return db[_0xb41b('0x22')][_0xb41b('0x38')](_0x91a712[_0xb41b('0x39')],{})['then'](respondWithResult(_0x406784,0xc9))[_0xb41b('0x2b')](handleError(_0x406784,null));};exports[_0xb41b('0x1a')]=function(_0x58073,_0x15e982){if(_0x58073['body']['id']){delete _0x58073[_0xb41b('0x39')]['id'];}return db[_0xb41b('0x22')][_0xb41b('0x3a')]({'where':{'id':_0x58073[_0xb41b('0x2d')]['id']}})[_0xb41b('0x1b')](handleEntityNotFound(_0x15e982,null))[_0xb41b('0x1b')](saveUpdates(_0x58073[_0xb41b('0x39')],null))[_0xb41b('0x1b')](respondWithResult(_0x15e982,null))[_0xb41b('0x2b')](handleError(_0x15e982,null));};exports[_0xb41b('0x1c')]=function(_0x3f6f6c,_0x189cd0){return db[_0xb41b('0x22')]['find']({'where':{'id':_0x3f6f6c['params']['id']}})[_0xb41b('0x1b')](handleEntityNotFound(_0x189cd0,null))[_0xb41b('0x1b')](removeEntity(_0x189cd0,null))[_0xb41b('0x2b')](handleError(_0x189cd0,null));};exports[_0xb41b('0x3b')]=function(_0x1c8581,_0x367ba7){return db[_0xb41b('0x22')][_0xb41b('0x3b')]()[_0xb41b('0x1b')](respondWithResult(_0x367ba7,null))[_0xb41b('0x2b')](handleError(_0x367ba7,null));};exports[_0xb41b('0x3c')]=function(_0x1a962a,_0x10affb){return db[_0xb41b('0x3d')]['find']({'where':{'id':_0x1a962a['params']['id']}})['then'](handleEntityNotFound(_0x10affb,null))[_0xb41b('0x1b')](function(_0x1bf11d){if(_0x1bf11d){return _0x1bf11d[_0xb41b('0x3c')](_0x1a962a[_0xb41b('0x39')][_0xb41b('0x3e')],_['omit'](_0x1a962a[_0xb41b('0x39')],[_0xb41b('0x3e'),'id'])||{});}})[_0xb41b('0x1b')](respondWithResult(_0x10affb,null))['catch'](handleError(_0x10affb,null));};exports[_0xb41b('0x3f')]=function(_0x1819d6,_0x40ae1b){var _0x24a66d={'raw':![],'where':{}};var _0x870c7b={};var _0x5a7f57={'count':0x0,'rows':[]};return db[_0xb41b('0x22')]['findOne']({'where':{'id':_0x1819d6[_0xb41b('0x2d')]['id']}})[_0xb41b('0x1b')](handleEntityNotFound(_0x40ae1b,null))[_0xb41b('0x1b')](function(_0x5edd89){if(_0x5edd89){_0x870c7b['model']=_['keys'](db['MailMessage'][_0xb41b('0x23')]);_0x870c7b[_0xb41b('0x29')]=_[_0xb41b('0x2f')](_0x1819d6[_0xb41b('0x29')]);_0x870c7b[_0xb41b('0x30')]=_[_0xb41b('0x31')](_0x870c7b[_0xb41b('0x2e')],_0x870c7b[_0xb41b('0x29')]);_0x24a66d[_0xb41b('0x32')]=_[_0xb41b('0x31')](_0x870c7b[_0xb41b('0x2e')],qs[_0xb41b('0x40')](_0x1819d6[_0xb41b('0x29')][_0xb41b('0x40')]));_0x24a66d['attributes']=_0x24a66d['attributes'][_0xb41b('0x33')]?_0x24a66d[_0xb41b('0x32')]:_0x870c7b[_0xb41b('0x2e')];if(!_0x1819d6[_0xb41b('0x29')][_0xb41b('0x41')](_0xb41b('0x42'))){_0x24a66d[_0xb41b('0x16')]=qs[_0xb41b('0x16')](_0x1819d6['query'][_0xb41b('0x16')]);_0x24a66d[_0xb41b('0x14')]=qs[_0xb41b('0x14')](_0x1819d6[_0xb41b('0x29')][_0xb41b('0x14')]);}_0x24a66d[_0xb41b('0x43')]=qs[_0xb41b('0x44')](_0x1819d6['query'][_0xb41b('0x44')]);_0x24a66d[_0xb41b('0x45')]=qs[_0xb41b('0x30')](_[_0xb41b('0x46')](_0x1819d6[_0xb41b('0x29')],_0x870c7b[_0xb41b('0x30')]));_0x24a66d[_0xb41b('0x45')][_0xb41b('0x47')]=_0x5edd89['id'];if(_0x1819d6[_0xb41b('0x29')][_0xb41b('0x48')]){_0x24a66d['where']=_[_0xb41b('0x36')](_0x24a66d[_0xb41b('0x45')],{'$or':_['map'](_0x24a66d['attributes'],function(_0x48dd70){var _0x1e6d6b={};_0x1e6d6b[_0x48dd70]={'$like':'%'+_0x1819d6[_0xb41b('0x29')]['filter']+'%'};return _0x1e6d6b;})});}if(_0x1819d6['query']['$gte']){var _0x22f674=_0x1819d6[_0xb41b('0x29')]['$gte'][_0xb41b('0x49')](',');var _0x5f18ff={};_0x5f18ff[_0x22f674[0x0]]={'$gte':moment(_0x22f674[0x1])['format'](_0xb41b('0x4a'))};_0x24a66d[_0xb41b('0x45')]=_[_0xb41b('0x36')](_0x24a66d[_0xb41b('0x45')],_0x5f18ff);}_0x24a66d=_[_0xb41b('0x36')]({},_0x24a66d,_0x1819d6[_0xb41b('0x37')]);return db[_0xb41b('0x3d')]['count']({'where':_0x24a66d[_0xb41b('0x45')]})['then'](function(_0x564ac1){_0x5a7f57[_0xb41b('0x17')]=_0x564ac1;if(_0x1819d6['query']['includeAll']){_0x24a66d['include']=[{'all':!![]}];}return db[_0xb41b('0x3d')][_0xb41b('0x27')](_0x24a66d);})['then'](function(_0xe4862d){if(_0x1819d6[_0xb41b('0x29')][_0xb41b('0x4b')]==='true'){for(var _0x2c24d4=0x0;_0x2c24d4<_0xe4862d[_0xb41b('0x33')];_0x2c24d4++){_0xe4862d[_0x2c24d4][_0xb41b('0x39')]=juice(_0xe4862d[_0x2c24d4]['body']);}}_0x5a7f57['rows']=_0xe4862d;return _0x5a7f57;});}})[_0xb41b('0x1b')](respondWithFilteredResult(_0x40ae1b,_0x24a66d))[_0xb41b('0x2b')](handleError(_0x40ae1b,null));};exports[_0xb41b('0x4c')]=function(_0x5deb21,_0x4507b4){return db['MailInteraction'][_0xb41b('0x3a')]({'where':{'id':_0x5deb21[_0xb41b('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4507b4,null))['then'](function(_0x5d3add){if(_0x5d3add){return _0x5d3add['setTags'](_0x5deb21[_0xb41b('0x39')][_0xb41b('0x3e')],_[_0xb41b('0x4d')](_0x5deb21[_0xb41b('0x39')],[_0xb41b('0x3e'),'id'])||{})[_0xb41b('0x4e')](function(){return db[_0xb41b('0x4f')][_0xb41b('0x27')]({'attributes':['id',_0xb41b('0x1f'),_0xb41b('0x50')],'where':{'id':_0x5deb21[_0xb41b('0x39')][_0xb41b('0x3e')]}});})['then'](function(_0x111bd8){socket[_0xb41b('0x51')]('mailInteractionTags:save',{'id':Number(_0x5deb21[_0xb41b('0x2d')]['id']),'tags':_0x111bd8||[]});return{'id':Number(_0x5deb21[_0xb41b('0x2d')]['id']),'tags':_0x111bd8||[]};});}})[_0xb41b('0x1b')](respondWithResult(_0x4507b4,null))['catch'](handleError(_0x4507b4,null));};exports[_0xb41b('0x52')]=function(_0x376411,_0x100bd0){return db[_0xb41b('0x22')]['find']({'where':{'id':_0x376411[_0xb41b('0x2d')]['id']}})[_0xb41b('0x1b')](handleEntityNotFound(_0x100bd0,null))[_0xb41b('0x1b')](function(_0x47d078){if(_0x47d078){return _0x47d078['removeTags'](_0x376411[_0xb41b('0x29')]['ids']);}})[_0xb41b('0x1b')](respondWithStatusCode(_0x100bd0,null))['catch'](handleError(_0x100bd0,null));};exports[_0xb41b('0x53')]=function(_0x148c1f,_0x532078){var _0x194e14=moment()[_0xb41b('0x54')]()['toString']();var _0x7a080f=path[_0xb41b('0x55')](config[_0xb41b('0x56')],_0xb41b('0x57'),_0xb41b('0x58'),'tmp');var _0x6659a9=path[_0xb41b('0x55')](config[_0xb41b('0x56')],'server','files',_0xb41b('0x59'));var _0x3c10ab=path['join'](_0x7a080f,_0x194e14);var _0x58137a=util[_0xb41b('0x5a')]('transcript-%d-%s.zip',_0x148c1f[_0xb41b('0x2d')]['id'],_0x194e14);var _0x2fdd80=path['join'](_0x7a080f,_0x58137a);var _0x6d866b=[];if(_0x148c1f[_0xb41b('0x29')][_0xb41b('0x59')]){_0x6d866b['push']({'model':db['Attachment'],'as':_0xb41b('0x5b'),'raw':!![]});}var _0x4d4636=[{'model':db[_0xb41b('0x3d')],'as':'Messages','attributes':['id',_0xb41b('0x39'),_0xb41b('0x5c'),'to','cc',_0xb41b('0x5d'),_0xb41b('0x5e'),_0xb41b('0x5f')],'where':{'secret':![]},'order':qs[_0xb41b('0x44')]('id'),'include':_0x6d866b}];return db['MailInteraction'][_0xb41b('0x3a')]({'where':{'id':_0x148c1f[_0xb41b('0x2d')]['id']},'include':_0x4d4636})[_0xb41b('0x1b')](handleEntityNotFound(_0x532078,null))[_0xb41b('0x1b')](function(_0x1b791c){if(_0x1b791c&&_0x1b791c['Messages']){var _0x5b46b9=_0x1b791c[_0xb41b('0x60')]({'plain':!![]});fs[_0xb41b('0x61')](_0x3c10ab);return BPromise[_0xb41b('0x62')](_0x5b46b9[_0xb41b('0x63')],function(_0x12870b,_0x502813){var _0x5f0b09={'from':_0x12870b[_0xb41b('0x5c')],'to':_0x12870b['to']||_0xb41b('0x64'),'subject':_0x12870b[_0xb41b('0x5e')],'html':htmlEntities[_0xb41b('0x65')](_0x12870b[_0xb41b('0x39')]),'headers':{'Date':moment(_0x12870b[_0xb41b('0x5f')])[_0xb41b('0x5a')](_0xb41b('0x66'))},'attachments':[]};if(_0x12870b['cc']){_0x5f0b09[_0xb41b('0x67')]['Cc']=_0x12870b['cc'];}if(_0x12870b['bcc']){_0x5f0b09['headers']['Bcc']=_0x12870b[_0xb41b('0x5d')];}return new BPromise(function(_0x4dc3d4,_0x48eda5){if(_0x12870b[_0xb41b('0x5b')]){for(var _0x2a3b1d=0x0;_0x2a3b1d<_0x12870b['Attachments'][_0xb41b('0x33')];_0x2a3b1d++){var _0x2f3bdf=_0x12870b[_0xb41b('0x5b')][_0x2a3b1d];var _0x4ff1d8=path['join'](_0x6659a9,_0x2f3bdf[_0xb41b('0x68')]);if(fs[_0xb41b('0x69')](_0x4ff1d8)){_0x5f0b09['attachments']['push']({'name':_0x2f3bdf[_0xb41b('0x1f')],'contentType':_0x2f3bdf[_0xb41b('0x24')],'data':fs[_0xb41b('0x6a')](_0x4ff1d8)});}}}emlformat['build'](_0x5f0b09,function(_0x4b46f5,_0x45787c){if(_0x4b46f5)return _0x48eda5(_0x4b46f5);fs[_0xb41b('0x6b')](path[_0xb41b('0x55')](_0x3c10ab,util[_0xb41b('0x5a')](_0xb41b('0x6c'),_0x502813)),_0x45787c);return _0x4dc3d4(_0x45787c);});});})[_0xb41b('0x1b')](function(){return new BPromise(function(_0x5105e4,_0x44626e){zipdir(_0x3c10ab,{'saveTo':_0x2fdd80},function(_0x5b69c6,_0x5589f7){if(_0x5b69c6)return _0x44626e(_0x5b69c6);return _0x5105e4(_0x5589f7);});})[_0xb41b('0x1b')](function(){return new BPromise(function(_0x4ea8d1,_0x58683d){rimraf(_0x3c10ab,function(_0x4c99b4){if(_0x4c99b4)_0x58683d(_0x4c99b4);return _0x4ea8d1();});});})['then'](function(){return _0x532078['download'](_0x2fdd80,_0x58137a,function(_0x40d2e2){if(!_0x40d2e2)fs[_0xb41b('0x6d')](_0x2fdd80);});});});}else{return _0x532078[_0xb41b('0x11')](0xc8);}})['catch'](handleError(_0x532078,null));}; \ No newline at end of file +var _0x44b2=['message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','ioredis','api','../../config/environment','../../mysqldb','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','then','error','name','send','index','map','MailInteraction','key','getOptions','findAll','query','user','catch','show','model','keys','rawAttributes','filters','intersection','fields','attributes','includeAll','find','create','body','params','destroy','describe','MailMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','limit','order','sort','where','MailInteractionId','merge','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','inlineCss','length','addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','toString','join','server','files','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','get','each','missing.recipient@your.company.com','decode','headers','Bcc','basename','existsSync','type','readFileSync','build','writeFileSync'];(function(_0x39bea2,_0xc388cb){var _0x4e5118=function(_0x26766d){while(--_0x26766d){_0x39bea2['push'](_0x39bea2['shift']());}};_0x4e5118(++_0xc388cb);}(_0x44b2,0x155));var _0x244b=function(_0x5d4a21,_0x3c715d){_0x5d4a21=_0x5d4a21-0x0;var _0x4336a4=_0x44b2[_0x5d4a21];return _0x4336a4;};'use strict';var emlformat=require(_0x244b('0x0'));var rimraf=require(_0x244b('0x1'));var zipdir=require(_0x244b('0x2'));var moment=require(_0x244b('0x3'));var BPromise=require(_0x244b('0x4'));var util=require(_0x244b('0x5'));var path=require('path');var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require(_0x244b('0x6'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x244b('0x7'));var config=require(_0x244b('0x8'));var db=require(_0x244b('0x9'))['db'];var htmlEntities=require(_0x244b('0xa'));config[_0x244b('0xb')]=_['defaults'](config[_0x244b('0xb')],{'host':_0x244b('0xc'),'port':0x18eb});var socket=require(_0x244b('0xd'))(new Redis(config[_0x244b('0xb')]));require(_0x244b('0xe'))[_0x244b('0xf')](socket);function respondWithStatusCode(_0x21430b,_0x47325a){_0x47325a=_0x47325a||0xcc;return function(_0x596422){if(_0x596422){return _0x21430b[_0x244b('0x10')](_0x47325a);}return _0x21430b[_0x244b('0x11')](_0x47325a)[_0x244b('0x12')]();};}function respondWithResult(_0x333719,_0x11f071){_0x11f071=_0x11f071||0xc8;return function(_0x1fc06f){if(_0x1fc06f){return _0x333719[_0x244b('0x11')](_0x11f071)[_0x244b('0x13')](_0x1fc06f);}};}function respondWithFilteredResult(_0x340714,_0x3053b5){return function(_0x1d31e6){if(_0x1d31e6){var _0x3fe523=typeof _0x3053b5[_0x244b('0x14')]===_0x244b('0x15')&&typeof _0x3053b5['limit']==='undefined';var _0x125f44=_0x1d31e6[_0x244b('0x16')];var _0x37ac1b=_0x3fe523?0x0:_0x3053b5['offset'];var _0x343c4f=_0x3fe523?_0x1d31e6[_0x244b('0x16')]:_0x3053b5[_0x244b('0x14')]+_0x3053b5['limit'];var _0x2f0256;if(_0x343c4f>=_0x125f44){_0x343c4f=_0x125f44;_0x2f0256=0xc8;}else{_0x2f0256=0xce;}_0x340714[_0x244b('0x11')](_0x2f0256);return _0x340714[_0x244b('0x17')](_0x244b('0x18'),_0x37ac1b+'-'+_0x343c4f+'/'+_0x125f44)[_0x244b('0x13')](_0x1d31e6);}return null;};}function saveUpdates(_0x587f31){return function(_0x5df423){if(_0x5df423){return _0x5df423[_0x244b('0x19')](_0x587f31)[_0x244b('0x1a')](function(_0x250c10){return _0x250c10;});}return null;};}function removeEntity(_0x35d15a){return function(_0x25ed18){if(_0x25ed18){return _0x25ed18['destroy']()['then'](function(){_0x35d15a[_0x244b('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dbc56){return function(_0x2412ba){if(!_0x2412ba){_0x3dbc56[_0x244b('0x10')](0x194);}return _0x2412ba;};}function handleError(_0x58334f,_0x4c5e24){_0x4c5e24=_0x4c5e24||0x1f4;return function(_0x3aff55){logger[_0x244b('0x1b')](_0x3aff55['stack']);if(_0x3aff55[_0x244b('0x1c')]){delete _0x3aff55[_0x244b('0x1c')];}_0x58334f[_0x244b('0x11')](_0x4c5e24)[_0x244b('0x1d')](_0x3aff55);};}exports[_0x244b('0x1e')]=function(_0x36789f,_0x49b1f4){var _0x3b38d9={};var _0x54263a=_[_0x244b('0x1f')](db[_0x244b('0x20')]['rawAttributes'],function(_0x39eb01){return{'name':_0x39eb01['fieldName'],'type':_0x39eb01['type'][_0x244b('0x21')]};});_0x3b38d9=qs[_0x244b('0x22')](_0x54263a,_0x36789f);return interaction[_0x244b('0x23')]('mail',_0x36789f[_0x244b('0x24')],_0x36789f[_0x244b('0x25')],_0x3b38d9,_0x54263a)['then'](respondWithFilteredResult(_0x49b1f4,_0x3b38d9))[_0x244b('0x26')](handleError(_0x49b1f4,null));};exports[_0x244b('0x27')]=function(_0x4e593f,_0x2ac85e){var _0x760b64={'raw':![],'where':{'id':_0x4e593f['params']['id']}},_0x576873={};_0x576873[_0x244b('0x28')]=_[_0x244b('0x29')](db['MailInteraction'][_0x244b('0x2a')]);_0x576873[_0x244b('0x24')]=_[_0x244b('0x29')](_0x4e593f[_0x244b('0x24')]);_0x576873[_0x244b('0x2b')]=_[_0x244b('0x2c')](_0x576873[_0x244b('0x28')],_0x576873['query']);_0x760b64['attributes']=_[_0x244b('0x2c')](_0x576873[_0x244b('0x28')],qs[_0x244b('0x2d')](_0x4e593f[_0x244b('0x24')]['fields']));_0x760b64[_0x244b('0x2e')]=_0x760b64[_0x244b('0x2e')]['length']?_0x760b64['attributes']:_0x576873['model'];if(_0x4e593f[_0x244b('0x24')][_0x244b('0x2f')]){_0x760b64['include']=[{'all':!![]}];}_0x760b64=_['merge']({},_0x760b64,_0x4e593f['options']);return db[_0x244b('0x20')][_0x244b('0x30')](_0x760b64)[_0x244b('0x1a')](handleEntityNotFound(_0x2ac85e,null))['then'](respondWithResult(_0x2ac85e,null))[_0x244b('0x26')](handleError(_0x2ac85e,null));};exports[_0x244b('0x31')]=function(_0x149dc0,_0xf91c62){return db[_0x244b('0x20')][_0x244b('0x31')](_0x149dc0[_0x244b('0x32')],{})['then'](respondWithResult(_0xf91c62,0xc9))[_0x244b('0x26')](handleError(_0xf91c62,null));};exports[_0x244b('0x19')]=function(_0x206030,_0x5ce6b8){if(_0x206030['body']['id']){delete _0x206030[_0x244b('0x32')]['id'];}return db[_0x244b('0x20')][_0x244b('0x30')]({'where':{'id':_0x206030[_0x244b('0x33')]['id']}})[_0x244b('0x1a')](handleEntityNotFound(_0x5ce6b8,null))[_0x244b('0x1a')](saveUpdates(_0x206030[_0x244b('0x32')],null))['then'](respondWithResult(_0x5ce6b8,null))['catch'](handleError(_0x5ce6b8,null));};exports[_0x244b('0x34')]=function(_0x17a039,_0x50df8e){return db[_0x244b('0x20')][_0x244b('0x30')]({'where':{'id':_0x17a039[_0x244b('0x33')]['id']}})[_0x244b('0x1a')](handleEntityNotFound(_0x50df8e,null))[_0x244b('0x1a')](removeEntity(_0x50df8e,null))['catch'](handleError(_0x50df8e,null));};exports[_0x244b('0x35')]=function(_0x2d77f0,_0x2ea282){return db[_0x244b('0x20')][_0x244b('0x35')]()['then'](respondWithResult(_0x2ea282,null))[_0x244b('0x26')](handleError(_0x2ea282,null));};exports['addMessage']=function(_0x3f184a,_0x3ed641){return db[_0x244b('0x36')][_0x244b('0x30')]({'where':{'id':_0x3f184a[_0x244b('0x33')]['id']}})[_0x244b('0x1a')](handleEntityNotFound(_0x3ed641,null))[_0x244b('0x1a')](function(_0x30ebe7){if(_0x30ebe7){return _0x30ebe7[_0x244b('0x37')](_0x3f184a['body'][_0x244b('0x38')],_[_0x244b('0x39')](_0x3f184a[_0x244b('0x32')],[_0x244b('0x38'),'id'])||{});}})[_0x244b('0x1a')](respondWithResult(_0x3ed641,null))[_0x244b('0x26')](handleError(_0x3ed641,null));};exports[_0x244b('0x3a')]=function(_0x5043fd,_0x402cf4){var _0x5f5919={'raw':![],'where':{}};var _0x65c58e={};var _0x5a98d6={'count':0x0,'rows':[]};return db[_0x244b('0x20')][_0x244b('0x3b')]({'where':{'id':_0x5043fd['params']['id']}})[_0x244b('0x1a')](handleEntityNotFound(_0x402cf4,null))[_0x244b('0x1a')](function(_0x54062b){if(_0x54062b){_0x65c58e[_0x244b('0x28')]=_['keys'](db['MailMessage'][_0x244b('0x2a')]);_0x65c58e[_0x244b('0x24')]=_[_0x244b('0x29')](_0x5043fd[_0x244b('0x24')]);_0x65c58e[_0x244b('0x2b')]=_[_0x244b('0x2c')](_0x65c58e[_0x244b('0x28')],_0x65c58e[_0x244b('0x24')]);_0x5f5919['attributes']=_[_0x244b('0x2c')](_0x65c58e[_0x244b('0x28')],qs[_0x244b('0x2d')](_0x5043fd['query'][_0x244b('0x2d')]));_0x5f5919['attributes']=_0x5f5919[_0x244b('0x2e')]['length']?_0x5f5919[_0x244b('0x2e')]:_0x65c58e[_0x244b('0x28')];if(!_0x5043fd[_0x244b('0x24')][_0x244b('0x3c')](_0x244b('0x3d'))){_0x5f5919[_0x244b('0x3e')]=qs[_0x244b('0x3e')](_0x5043fd[_0x244b('0x24')]['limit']);_0x5f5919['offset']=qs['offset'](_0x5043fd[_0x244b('0x24')]['offset']);}_0x5f5919[_0x244b('0x3f')]=qs[_0x244b('0x40')](_0x5043fd['query'][_0x244b('0x40')]);_0x5f5919['where']=qs[_0x244b('0x2b')](_['pick'](_0x5043fd[_0x244b('0x24')],_0x65c58e[_0x244b('0x2b')]));_0x5f5919[_0x244b('0x41')][_0x244b('0x42')]=_0x54062b['id'];if(_0x5043fd[_0x244b('0x24')]['filter']){_0x5f5919[_0x244b('0x41')]=_[_0x244b('0x43')](_0x5f5919[_0x244b('0x41')],{'$or':_[_0x244b('0x1f')](_0x5f5919['attributes'],function(_0x462b28){var _0x598c9a={};_0x598c9a[_0x462b28]={'$like':'%'+_0x5043fd['query'][_0x244b('0x44')]+'%'};return _0x598c9a;})});}if(_0x5043fd[_0x244b('0x24')][_0x244b('0x45')]){var _0x337fd4=_0x5043fd[_0x244b('0x24')][_0x244b('0x45')][_0x244b('0x46')](',');var _0x319d55={};_0x319d55[_0x337fd4[0x0]]={'$gte':moment(_0x337fd4[0x1])[_0x244b('0x47')](_0x244b('0x48'))};_0x5f5919[_0x244b('0x41')]=_[_0x244b('0x43')](_0x5f5919[_0x244b('0x41')],_0x319d55);}_0x5f5919=_[_0x244b('0x43')]({},_0x5f5919,_0x5043fd[_0x244b('0x49')]);return db['MailMessage'][_0x244b('0x16')]({'where':_0x5f5919[_0x244b('0x41')]})['then'](function(_0x5b9176){_0x5a98d6[_0x244b('0x16')]=_0x5b9176;if(_0x5043fd[_0x244b('0x24')][_0x244b('0x2f')]){_0x5f5919['include']=[{'all':!![]}];}return db[_0x244b('0x36')][_0x244b('0x23')](_0x5f5919);})['then'](function(_0xdf1c99){if(_0x5043fd[_0x244b('0x24')][_0x244b('0x4a')]==='true'){for(var _0x6cca9d=0x0;_0x6cca9d<_0xdf1c99[_0x244b('0x4b')];_0x6cca9d++){_0xdf1c99[_0x6cca9d]['body']=juice(_0xdf1c99[_0x6cca9d][_0x244b('0x32')]);}}_0x5a98d6['rows']=_0xdf1c99;return _0x5a98d6;});}})[_0x244b('0x1a')](respondWithFilteredResult(_0x402cf4,_0x5f5919))[_0x244b('0x26')](handleError(_0x402cf4,null));};exports[_0x244b('0x4c')]=function(_0x440b70,_0x3ec240){return db[_0x244b('0x20')][_0x244b('0x30')]({'where':{'id':_0x440b70['params']['id']}})[_0x244b('0x1a')](handleEntityNotFound(_0x3ec240,null))[_0x244b('0x1a')](function(_0x3d6e03){if(_0x3d6e03){return _0x3d6e03[_0x244b('0x4d')](_0x440b70[_0x244b('0x32')]['ids'],_[_0x244b('0x39')](_0x440b70[_0x244b('0x32')],[_0x244b('0x38'),'id'])||{})[_0x244b('0x4e')](function(){return db[_0x244b('0x4f')]['findAll']({'attributes':['id',_0x244b('0x1c'),_0x244b('0x50')],'where':{'id':_0x440b70[_0x244b('0x32')][_0x244b('0x38')]}});})[_0x244b('0x1a')](function(_0x2a7504){socket[_0x244b('0x51')](_0x244b('0x52'),{'id':Number(_0x440b70['params']['id']),'tags':_0x2a7504||[]});return{'id':Number(_0x440b70[_0x244b('0x33')]['id']),'tags':_0x2a7504||[]};});}})['then'](respondWithResult(_0x3ec240,null))[_0x244b('0x26')](handleError(_0x3ec240,null));};exports['removeTags']=function(_0x22ea13,_0xd39065){return db[_0x244b('0x20')]['find']({'where':{'id':_0x22ea13[_0x244b('0x33')]['id']}})[_0x244b('0x1a')](handleEntityNotFound(_0xd39065,null))['then'](function(_0x1756e7){if(_0x1756e7){return _0x1756e7[_0x244b('0x53')](_0x22ea13[_0x244b('0x24')][_0x244b('0x38')]);}})[_0x244b('0x1a')](respondWithStatusCode(_0xd39065,null))[_0x244b('0x26')](handleError(_0xd39065,null));};exports[_0x244b('0x54')]=function(_0x4818cd,_0x10d440){var _0x34934a=moment()['unix']()[_0x244b('0x55')]();var _0x1b556b=path[_0x244b('0x56')](config['root'],_0x244b('0x57'),_0x244b('0x58'),'tmp');var _0x5cac67=path[_0x244b('0x56')](config['root'],'server',_0x244b('0x58'),_0x244b('0x59'));var _0x29c33d=path['join'](_0x1b556b,_0x34934a);var _0x5b0523=util[_0x244b('0x47')](_0x244b('0x5a'),_0x4818cd[_0x244b('0x33')]['id'],_0x34934a);var _0x16bb46=path[_0x244b('0x56')](_0x1b556b,_0x5b0523);var _0x50b239=[];if(_0x4818cd[_0x244b('0x24')][_0x244b('0x59')]){_0x50b239[_0x244b('0x5b')]({'model':db[_0x244b('0x5c')],'as':_0x244b('0x5d'),'raw':!![]});}var _0xec16e8=[{'model':db[_0x244b('0x36')],'as':_0x244b('0x5e'),'attributes':['id',_0x244b('0x32'),_0x244b('0x5f'),'to','cc',_0x244b('0x60'),_0x244b('0x61'),_0x244b('0x62')],'where':{'secret':![]},'order':qs[_0x244b('0x40')]('id'),'include':_0x50b239}];return db[_0x244b('0x20')][_0x244b('0x30')]({'where':{'id':_0x4818cd['params']['id']},'include':_0xec16e8})[_0x244b('0x1a')](handleEntityNotFound(_0x10d440,null))[_0x244b('0x1a')](function(_0xac7eba){if(_0xac7eba&&_0xac7eba['Messages']){var _0x47b11a=_0xac7eba[_0x244b('0x63')]({'plain':!![]});fs['mkdirSync'](_0x29c33d);return BPromise[_0x244b('0x64')](_0x47b11a[_0x244b('0x5e')],function(_0x3b29e8,_0x2dd544){var _0x40ae03={'from':_0x3b29e8['from'],'to':_0x3b29e8['to']||_0x244b('0x65'),'subject':_0x3b29e8['subject'],'html':htmlEntities[_0x244b('0x66')](_0x3b29e8[_0x244b('0x32')]),'headers':{'Date':moment(_0x3b29e8[_0x244b('0x62')])[_0x244b('0x47')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x3b29e8['cc']){_0x40ae03[_0x244b('0x67')]['Cc']=_0x3b29e8['cc'];}if(_0x3b29e8[_0x244b('0x60')]){_0x40ae03[_0x244b('0x67')][_0x244b('0x68')]=_0x3b29e8[_0x244b('0x60')];}return new BPromise(function(_0x519312,_0x309194){if(_0x3b29e8['Attachments']){for(var _0x2bbaf3=0x0;_0x2bbaf3<_0x3b29e8[_0x244b('0x5d')][_0x244b('0x4b')];_0x2bbaf3++){var _0x3e0f51=_0x3b29e8[_0x244b('0x5d')][_0x2bbaf3];var _0x4fb3c3=path[_0x244b('0x56')](_0x5cac67,_0x3e0f51[_0x244b('0x69')]);if(fs[_0x244b('0x6a')](_0x4fb3c3)){_0x40ae03[_0x244b('0x59')][_0x244b('0x5b')]({'name':_0x3e0f51[_0x244b('0x1c')],'contentType':_0x3e0f51[_0x244b('0x6b')],'data':fs[_0x244b('0x6c')](_0x4fb3c3)});}}}emlformat[_0x244b('0x6d')](_0x40ae03,function(_0xa23af5,_0x3be3b7){if(_0xa23af5)return _0x309194(_0xa23af5);fs[_0x244b('0x6e')](path[_0x244b('0x56')](_0x29c33d,util[_0x244b('0x47')](_0x244b('0x6f'),_0x2dd544)),_0x3be3b7);return _0x519312(_0x3be3b7);});});})['then'](function(){return new BPromise(function(_0x488283,_0x4c5fad){zipdir(_0x29c33d,{'saveTo':_0x16bb46},function(_0x1654e4,_0x29b258){if(_0x1654e4)return _0x4c5fad(_0x1654e4);return _0x488283(_0x29b258);});})[_0x244b('0x1a')](function(){return new BPromise(function(_0x2d606d,_0x444eb5){rimraf(_0x29c33d,function(_0x1d58d1){if(_0x1d58d1)_0x444eb5(_0x1d58d1);return _0x2d606d();});});})[_0x244b('0x1a')](function(){return _0x10d440['download'](_0x16bb46,_0x5b0523,function(_0x34c4d9){if(!_0x34c4d9)fs[_0x244b('0x70')](_0x16bb46);});});});}else{return _0x10d440[_0x244b('0x10')](0xc8);}})['catch'](handleError(_0x10d440,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index af7c648..2cfb8fd 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 _0xd363=['unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xd363,0xd6));var _0x3d36=function(_0x404991,_0x5a9865){_0x404991=_0x404991-0x0;var _0x429b45=_0xd363[_0x404991];return _0x429b45;};'use strict';var EventEmitter=require(_0x3d36('0x0'));var MailInteraction=require(_0x3d36('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x3d36('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x3d36('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d36('0x3'),'afterDestroy':_0x3d36('0x4')};function emitEvent(_0x504b6f){return function(_0x403ea6,_0x334926,_0x479414){_0x403ea6[_0x3d36('0x5')]({'attributes':['id'],'raw':!![]})[_0x3d36('0x6')](function(_0x2f436c){_0x403ea6[_0x3d36('0x7')](_0x3d36('0x8'),_0x2f436c[_0x3d36('0x9')](function(_0x1451b5){return{'id':_0x1451b5['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x403ea6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3d36('0x6')](function(_0x4a994c){_0x403ea6[_0x3d36('0x7')](_0x3d36('0xa'),_0x4a994c[_0x3d36('0xb')]);MailInteractionEvents['emit'](_0x504b6f+':'+_0x403ea6['id'],_0x403ea6);MailInteractionEvents[_0x3d36('0xc')](_0x504b6f,_0x403ea6);_0x479414(null);})[_0x3d36('0xd')](_0x479414(null));};}for(var e in events){if(events[_0x3d36('0xe')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x3d36('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0x5c11=['remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','catch','hook','exports','events','../../mysqldb','MailInteraction','setMaxListeners','save','update'];(function(_0x4c9f6a,_0xcb2cb2){var _0x5df5b9=function(_0x303cf2){while(--_0x303cf2){_0x4c9f6a['push'](_0x4c9f6a['shift']());}};_0x5df5b9(++_0xcb2cb2);}(_0x5c11,0xa4));var _0x15c1=function(_0x1a37df,_0x3ed536){_0x1a37df=_0x1a37df-0x0;var _0x5a7d5f=_0x5c11[_0x1a37df];return _0x5a7d5f;};'use strict';var EventEmitter=require(_0x15c1('0x0'));var MailInteraction=require(_0x15c1('0x1'))['db'][_0x15c1('0x2')];var MailMessage=require(_0x15c1('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x15c1('0x3')](0x0);var events={'afterCreate':_0x15c1('0x4'),'afterUpdate':_0x15c1('0x5'),'afterDestroy':_0x15c1('0x6')};function emitEvent(_0x2f0022){return function(_0x38d46b,_0x2fdbb4,_0x5f0e26){_0x38d46b[_0x15c1('0x7')]({'attributes':['id'],'raw':!![]})[_0x15c1('0x8')](function(_0x4447db){_0x38d46b[_0x15c1('0x9')](_0x15c1('0xa'),_0x4447db[_0x15c1('0xb')](function(_0x43ad27){return{'id':_0x43ad27['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x38d46b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x381ef1){_0x38d46b[_0x15c1('0x9')](_0x15c1('0xc'),_0x381ef1[_0x15c1('0xd')]);MailInteractionEvents['emit'](_0x2f0022+':'+_0x38d46b['id'],_0x38d46b);MailInteractionEvents['emit'](_0x2f0022,_0x38d46b);_0x5f0e26(null);})[_0x15c1('0xe')](_0x5f0e26(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x15c1('0xf')](e,emitEvent(event));}}module[_0x15c1('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index b1d2cd6..be3fcad 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 _0xc3a7=['get','MailMessage','update','catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','fti_mail_interactions','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models'];(function(_0x3bdb09,_0x2f1fb7){var _0x5f3ec7=function(_0x2fe58f){while(--_0x2fe58f){_0x3bdb09['push'](_0x3bdb09['shift']());}};_0x5f3ec7(++_0x2f1fb7);}(_0xc3a7,0x9b));var _0x7c3a=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xc3a7[_0x231e16];return _0x570a7c;};'use strict';var _=require(_0x7c3a('0x0'));var util=require(_0x7c3a('0x1'));var logger=require(_0x7c3a('0x2'))(_0x7c3a('0x3'));var moment=require(_0x7c3a('0x4'));var BPromise=require(_0x7c3a('0x5'));var rp=require(_0x7c3a('0x6'));var fs=require('fs');var path=require(_0x7c3a('0x7'));var rimraf=require(_0x7c3a('0x8'));var config=require(_0x7c3a('0x9'));var attributes=require(_0x7c3a('0xa'));module['exports']=function(_0x35d1db,_0x4562a5){return _0x35d1db['define']('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x7c3a('0xb'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3558aa,_0x297a7b,_0x36cc5b){if(_0x3558aa[_0x7c3a('0xc')]){_0x3558aa[_0x7c3a('0xd')]=moment()['format'](_0x7c3a('0xe'));}if(_0x3558aa[_0x7c3a('0xf')]){_0x3558aa[_0x7c3a('0x10')]=moment()[_0x7c3a('0x11')](_0x7c3a('0xe'));}_0x36cc5b(null,_0x297a7b);},'beforeUpdate':function(_0x589650,_0x271d42,_0xcb597d){if(_0x589650[_0x7c3a('0x12')](_0x7c3a('0xc'))){_0x589650['substatusAt']=_0x589650[_0x7c3a('0xc')]?moment()[_0x7c3a('0x11')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x589650[_0x7c3a('0x12')](_0x7c3a('0xf'))){_0x589650['closedAt']=moment()[_0x7c3a('0x11')](_0x7c3a('0xe'));_0x589650[_0x7c3a('0xc')]=null;_0x589650[_0x7c3a('0xd')]=null;}_0xcb597d(null,_0x589650);},'afterUpdate':function(_0x4e9fdf,_0x555e63,_0x88e841){var _0x56a940=_0x35d1db[_0x7c3a('0x13')];var _0x551b94=_0x4e9fdf[_0x7c3a('0x14')]({'plain':!![]});if(_0x551b94[_0x7c3a('0xf')]){return _0x56a940[_0x7c3a('0x15')][_0x7c3a('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x551b94['id']}})['then'](function(){_0x88e841();})[_0x7c3a('0x17')](function(_0x40cd93){_0x88e841(_0x40cd93);});}else{_0x88e841();}}},'charset':_0x7c3a('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe351=['path','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','subject','substatus','substatusAt','format','closed','YYYY-MM-DD\x20HH:mm:ss','changed','closedAt','models','get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x117af3,_0x3a138e){var _0x236c1b=function(_0x16022b){while(--_0x16022b){_0x117af3['push'](_0x117af3['shift']());}};_0x236c1b(++_0x3a138e);}(_0xe351,0x123));var _0x1e35=function(_0x112710,_0x2d5e04){_0x112710=_0x112710-0x0;var _0x4ed6eb=_0xe351[_0x112710];return _0x4ed6eb;};'use strict';var _=require(_0x1e35('0x0'));var util=require(_0x1e35('0x1'));var logger=require(_0x1e35('0x2'))('api');var moment=require(_0x1e35('0x3'));var BPromise=require(_0x1e35('0x4'));var rp=require(_0x1e35('0x5'));var fs=require('fs');var path=require(_0x1e35('0x6'));var rimraf=require('rimraf');var config=require(_0x1e35('0x7'));var attributes=require(_0x1e35('0x8'));module['exports']=function(_0x5ef94f,_0x3b3192){return _0x5ef94f[_0x1e35('0x9')](_0x1e35('0xa'),attributes,{'tableName':_0x1e35('0xb'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x1e35('0xc'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5bd71f,_0x458143,_0x167a5f){if(_0x5bd71f[_0x1e35('0xd')]){_0x5bd71f[_0x1e35('0xe')]=moment()[_0x1e35('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5bd71f[_0x1e35('0x10')]){_0x5bd71f['closedAt']=moment()[_0x1e35('0xf')](_0x1e35('0x11'));}_0x167a5f(null,_0x458143);},'beforeUpdate':function(_0x5af83a,_0x34a673,_0x241306){if(_0x5af83a['changed'](_0x1e35('0xd'))){_0x5af83a[_0x1e35('0xe')]=_0x5af83a[_0x1e35('0xd')]?moment()[_0x1e35('0xf')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x5af83a[_0x1e35('0x12')]('closed')){_0x5af83a[_0x1e35('0x13')]=moment()['format'](_0x1e35('0x11'));_0x5af83a[_0x1e35('0xd')]=null;_0x5af83a['substatusAt']=null;}_0x241306(null,_0x5af83a);},'afterUpdate':function(_0x303ec7,_0x865d8e,_0x2557b3){var _0x46a6fd=_0x5ef94f[_0x1e35('0x14')];var _0x3e2b08=_0x303ec7[_0x1e35('0x15')]({'plain':!![]});if(_0x3e2b08[_0x1e35('0x10')]){return _0x46a6fd[_0x1e35('0x16')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x3e2b08['id']}})[_0x1e35('0x17')](function(){_0x2557b3();})[_0x1e35('0x18')](function(_0x4c1ee5){_0x2557b3(_0x4c1ee5);});}else{_0x2557b3();}}},'charset':_0x1e35('0x19'),'collate':_0x1e35('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 30f3a9e..6601dc9 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 _0xad56=['request\x20sent','error','message','result','UpdateMailInteraction','MailInteraction','body','options','where','limit','stringify','catch','AddTagsToMailInteraction','find','addTags','omit','ids','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x2f8dd4,_0x38373c){var _0x152c60=function(_0x422cb2){while(--_0x422cb2){_0x2f8dd4['push'](_0x2f8dd4['shift']());}};_0x152c60(++_0x38373c);}(_0xad56,0x17a));var _0x6ad5=function(_0x4a81d8,_0x3df215){_0x4a81d8=_0x4a81d8-0x0;var _0x2e76dc=_0xad56[_0x4a81d8];return _0x2e76dc;};'use strict';var _=require('lodash');var util=require(_0x6ad5('0x0'));var moment=require(_0x6ad5('0x1'));var BPromise=require(_0x6ad5('0x2'));var rs=require(_0x6ad5('0x3'));var fs=require('fs');var Redis=require(_0x6ad5('0x4'));var db=require(_0x6ad5('0x5'))['db'];var utils=require(_0x6ad5('0x6'));var logger=require(_0x6ad5('0x7'))(_0x6ad5('0x8'));var config=require(_0x6ad5('0x9'));var jayson=require(_0x6ad5('0xa'));var client=jayson[_0x6ad5('0xb')][_0x6ad5('0xc')]({'port':0x232a});config[_0x6ad5('0xd')]=_[_0x6ad5('0xe')](config[_0x6ad5('0xd')],{'host':_0x6ad5('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailInteraction.socket')[_0x6ad5('0x10')](socket);function respondWithRpcPromise(_0xa83d38,_0x2decb8,_0x37290a){return new BPromise(function(_0x5187c3,_0x2f0377){return client['request'](_0xa83d38,_0x37290a)[_0x6ad5('0x11')](function(_0x24bb71){logger[_0x6ad5('0x12')](_0x6ad5('0x13'),_0x2decb8,'request\x20sent');logger[_0x6ad5('0x14')](_0x6ad5('0x15'),_0x2decb8,_0x6ad5('0x16'),JSON['stringify'](_0x24bb71));if(_0x24bb71['error']){if(_0x24bb71['error']['code']===0x1f4){logger[_0x6ad5('0x17')](_0x6ad5('0x13'),_0x2decb8,_0x24bb71[_0x6ad5('0x17')][_0x6ad5('0x18')]);return _0x2f0377(_0x24bb71[_0x6ad5('0x17')][_0x6ad5('0x18')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x2decb8,_0x24bb71[_0x6ad5('0x17')][_0x6ad5('0x18')]);return _0x5187c3(_0x24bb71[_0x6ad5('0x17')][_0x6ad5('0x18')]);}else{logger[_0x6ad5('0x12')](_0x6ad5('0x13'),_0x2decb8,_0x6ad5('0x16'));_0x5187c3(_0x24bb71[_0x6ad5('0x19')][_0x6ad5('0x18')]);}})['catch'](function(_0xaf426){logger[_0x6ad5('0x17')](_0x6ad5('0x13'),_0x2decb8,_0xaf426);_0x2f0377(_0xaf426);});});}exports[_0x6ad5('0x1a')]=function(_0xc86ffa){var _0x4f4738=this;return new Promise(function(_0x19208a,_0x5157fc){return db[_0x6ad5('0x1b')]['update'](_0xc86ffa[_0x6ad5('0x1c')],{'raw':_0xc86ffa['options']?_0xc86ffa[_0x6ad5('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc86ffa[_0x6ad5('0x1d')]?_0xc86ffa[_0x6ad5('0x1d')][_0x6ad5('0x1e')]||null:null,'attributes':_0xc86ffa['options']?_0xc86ffa[_0x6ad5('0x1d')]['attributes']||null:null,'limit':_0xc86ffa[_0x6ad5('0x1d')]?_0xc86ffa[_0x6ad5('0x1d')][_0x6ad5('0x1f')]||null:null})['then'](function(_0x10c3a8){logger[_0x6ad5('0x12')](_0x6ad5('0x1a'),_0xc86ffa);logger[_0x6ad5('0x14')](_0x6ad5('0x1a'),_0xc86ffa,JSON[_0x6ad5('0x20')](_0x10c3a8));_0x19208a(_0x10c3a8);})[_0x6ad5('0x21')](function(_0x19932b){logger[_0x6ad5('0x17')](_0x6ad5('0x1a'),_0x19932b['message'],_0xc86ffa);_0x5157fc(_0x4f4738[_0x6ad5('0x17')](0x1f4,_0x19932b['message']));});});};exports[_0x6ad5('0x22')]=function(_0x53a2d9){return new Promise(function(_0x445047,_0xa8cc58){return db['MailInteraction'][_0x6ad5('0x23')]({'where':_0x53a2d9[_0x6ad5('0x1d')]?_0x53a2d9[_0x6ad5('0x1d')][_0x6ad5('0x1e')]||null:null})[_0x6ad5('0x11')](function(_0x5e177a){if(_0x5e177a){return _0x5e177a[_0x6ad5('0x24')](_0x53a2d9[_0x6ad5('0x1c')]['ids'],_[_0x6ad5('0x25')](_0x53a2d9[_0x6ad5('0x1c')],[_0x6ad5('0x26'),'id'])||{});}})['spread'](function(_0xc25938){logger[_0x6ad5('0x12')](_0x6ad5('0x27'),_0x53a2d9);logger[_0x6ad5('0x14')](_0x6ad5('0x27'),_0x53a2d9,JSON[_0x6ad5('0x20')](_0xc25938));_0x445047(_0xc25938);})[_0x6ad5('0x21')](function(_0x3c6fea){logger[_0x6ad5('0x17')](_0x6ad5('0x27'),_0x3c6fea[_0x6ad5('0x18')],_0x53a2d9);_0xa8cc58(_this[_0x6ad5('0x17')](0x1f4,_0x3c6fea[_0x6ad5('0x18')]));});});}; \ No newline at end of file +var _0x30cd=['jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','then','MailInteraction,\x20%s,\x20%s','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','MailInteraction','update','options','raw','where','UpdateMailInteraction','debug','find','body','ids','omit','AddTags','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x30cd,0x1e3));var _0xd30c=function(_0x75c346,_0x3aa49a){_0x75c346=_0x75c346-0x0;var _0x2b4b02=_0x30cd[_0x75c346];return _0x2b4b02;};'use strict';var _=require(_0xd30c('0x0'));var util=require(_0xd30c('0x1'));var moment=require(_0xd30c('0x2'));var BPromise=require('bluebird');var rs=require(_0xd30c('0x3'));var fs=require('fs');var Redis=require(_0xd30c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd30c('0x5'));var logger=require(_0xd30c('0x6'))(_0xd30c('0x7'));var config=require(_0xd30c('0x8'));var jayson=require(_0xd30c('0x9'));var client=jayson[_0xd30c('0xa')][_0xd30c('0xb')]({'port':0x232a});config['redis']=_[_0xd30c('0xc')](config[_0xd30c('0xd')],{'host':_0xd30c('0xe'),'port':0x18eb});var socket=require(_0xd30c('0xf'))(new Redis(config[_0xd30c('0xd')]));require(_0xd30c('0x10'))[_0xd30c('0x11')](socket);function respondWithRpcPromise(_0x39d619,_0x1445ab,_0x21c3bd){return new BPromise(function(_0x389b81,_0x53fc7f){return client['request'](_0x39d619,_0x21c3bd)[_0xd30c('0x12')](function(_0x2f3e6f){logger['info'](_0xd30c('0x13'),_0x1445ab,'request\x20sent');logger['debug'](_0xd30c('0x14'),_0x1445ab,_0xd30c('0x15'),JSON['stringify'](_0x2f3e6f));if(_0x2f3e6f[_0xd30c('0x16')]){if(_0x2f3e6f['error'][_0xd30c('0x17')]===0x1f4){logger[_0xd30c('0x16')](_0xd30c('0x13'),_0x1445ab,_0x2f3e6f[_0xd30c('0x16')][_0xd30c('0x18')]);return _0x53fc7f(_0x2f3e6f[_0xd30c('0x16')][_0xd30c('0x18')]);}logger[_0xd30c('0x16')](_0xd30c('0x13'),_0x1445ab,_0x2f3e6f[_0xd30c('0x16')][_0xd30c('0x18')]);return _0x389b81(_0x2f3e6f[_0xd30c('0x16')][_0xd30c('0x18')]);}else{logger[_0xd30c('0x19')]('MailInteraction,\x20%s,\x20%s',_0x1445ab,_0xd30c('0x15'));_0x389b81(_0x2f3e6f[_0xd30c('0x1a')][_0xd30c('0x18')]);}})[_0xd30c('0x1b')](function(_0x3eafa0){logger[_0xd30c('0x16')](_0xd30c('0x13'),_0x1445ab,_0x3eafa0);_0x53fc7f(_0x3eafa0);});});}exports['UpdateMailInteraction']=function(_0x106552){var _0x20da1e=this;return new Promise(function(_0x57f47e,_0x2b7571){return db[_0xd30c('0x1c')][_0xd30c('0x1d')](_0x106552['body'],{'raw':_0x106552[_0xd30c('0x1e')]?_0x106552['options'][_0xd30c('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x106552[_0xd30c('0x1e')]?_0x106552[_0xd30c('0x1e')][_0xd30c('0x20')]||null:null,'attributes':_0x106552[_0xd30c('0x1e')]?_0x106552['options']['attributes']||null:null,'limit':_0x106552[_0xd30c('0x1e')]?_0x106552[_0xd30c('0x1e')]['limit']||null:null})[_0xd30c('0x12')](function(_0x5953bc){logger['info'](_0xd30c('0x21'),_0x106552);logger[_0xd30c('0x22')](_0xd30c('0x21'),_0x106552,JSON['stringify'](_0x5953bc));_0x57f47e(_0x5953bc);})[_0xd30c('0x1b')](function(_0x57d933){logger['error'](_0xd30c('0x21'),_0x57d933[_0xd30c('0x18')],_0x106552);_0x2b7571(_0x20da1e[_0xd30c('0x16')](0x1f4,_0x57d933[_0xd30c('0x18')]));});});};exports['AddTagsToMailInteraction']=function(_0x110353){return new Promise(function(_0x50f60b,_0x48335c){return db[_0xd30c('0x1c')][_0xd30c('0x23')]({'where':_0x110353['options']?_0x110353['options']['where']||null:null})[_0xd30c('0x12')](function(_0x1d67ac){if(_0x1d67ac){return _0x1d67ac['addTags'](_0x110353[_0xd30c('0x24')][_0xd30c('0x25')],_[_0xd30c('0x26')](_0x110353['body'],[_0xd30c('0x25'),'id'])||{});}})['spread'](function(_0x20cf56){logger[_0xd30c('0x19')](_0xd30c('0x27'),_0x110353);logger[_0xd30c('0x22')]('AddTags',_0x110353,JSON[_0xd30c('0x28')](_0x20cf56));_0x50f60b(_0x20cf56);})[_0xd30c('0x1b')](function(_0x594a1e){logger[_0xd30c('0x16')](_0xd30c('0x27'),_0x594a1e[_0xd30c('0x18')],_0x110353);_0x48335c(_this[_0xd30c('0x16')](0x1f4,_0x594a1e[_0xd30c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 2528850..3d3f7f6 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 _0xee14=['emit','register','length','mailInteraction:','./mailInteraction.events','save','remove','update'];(function(_0x19a2a0,_0x22ba4d){var _0x4bd30d=function(_0x3e7c8d){while(--_0x3e7c8d){_0x19a2a0['push'](_0x19a2a0['shift']());}};_0x4bd30d(++_0x22ba4d);}(_0xee14,0x12c));var _0x4ee1=function(_0x37cab1,_0x3e0fec){_0x37cab1=_0x37cab1-0x0;var _0x429c58=_0xee14[_0x37cab1];return _0x429c58;};'use strict';var MailInteractionEvents=require(_0x4ee1('0x0'));var events=[_0x4ee1('0x1'),_0x4ee1('0x2'),_0x4ee1('0x3')];function createListener(_0x3547c7,_0x16996d){return function(_0x576dfe){_0x16996d[_0x4ee1('0x4')](_0x3547c7,_0x576dfe);};}function removeListener(_0x511d1a,_0x344fe2){return function(){MailInteractionEvents['removeListener'](_0x511d1a,_0x344fe2);};}exports[_0x4ee1('0x5')]=function(_0x4aa567){for(var _0x10f90e=0x0,_0x35365f=events[_0x4ee1('0x6')];_0x10f90e<_0x35365f;_0x10f90e++){var _0x311051=events[_0x10f90e];var _0x242277=createListener(_0x4ee1('0x7')+_0x311051,_0x4aa567);MailInteractionEvents['on'](_0x311051,_0x242277);}}; \ No newline at end of file +var _0x51cf=['emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove','update'];(function(_0x4d5f75,_0x3e6678){var _0x188ab4=function(_0x488246){while(--_0x488246){_0x4d5f75['push'](_0x4d5f75['shift']());}};_0x188ab4(++_0x3e6678);}(_0x51cf,0xd4));var _0xf51c=function(_0x5a071f,_0x2efdc2){_0x5a071f=_0x5a071f-0x0;var _0x33ff64=_0x51cf[_0x5a071f];return _0x33ff64;};'use strict';var MailInteractionEvents=require(_0xf51c('0x0'));var events=[_0xf51c('0x1'),_0xf51c('0x2'),_0xf51c('0x3')];function createListener(_0x5405da,_0x3df240){return function(_0x1f1f03){_0x3df240[_0xf51c('0x4')](_0x5405da,_0x1f1f03);};}function removeListener(_0x5630b2,_0x597ed9){return function(){MailInteractionEvents[_0xf51c('0x5')](_0x5630b2,_0x597ed9);};}exports[_0xf51c('0x6')]=function(_0x140075){for(var _0x41c088=0x0,_0x45b071=events[_0xf51c('0x7')];_0x41c088<_0x45b071;_0x41c088++){var _0x3a7484=events[_0x41c088];var _0x3fc190=createListener(_0xf51c('0x8')+_0x3a7484,_0x140075);MailInteractionEvents['on'](_0x3a7484,_0x3fc190);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 76c4709..02a78fd 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 _0xc4dd=['update','put','accept','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','tracked','mailmessage:create'];(function(_0x16c432,_0x48468f){var _0x401092=function(_0x13e9a7){while(--_0x13e9a7){_0x16c432['push'](_0x16c432['shift']());}};_0x401092(++_0x48468f);}(_0xc4dd,0xad));var _0xdc4d=function(_0x3f4e02,_0x509aca){_0x3f4e02=_0x3f4e02-0x0;var _0x39f019=_0xc4dd[_0x3f4e02];return _0x39f019;};'use strict';var multer=require(_0xdc4d('0x0'));var util=require(_0xdc4d('0x1'));var path=require(_0xdc4d('0x2'));var timeout=require('connect-timeout');var express=require(_0xdc4d('0x3'));var router=express[_0xdc4d('0x4')]();var fs_extra=require(_0xdc4d('0x5'));var auth=require(_0xdc4d('0x6'));var interaction=require(_0xdc4d('0x7'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xdc4d('0x8')]('/',auth[_0xdc4d('0x9')](),controller['index']);router[_0xdc4d('0x8')](_0xdc4d('0xa'),auth['isAuthenticated'](),controller[_0xdc4d('0xb')]);router[_0xdc4d('0x8')](_0xdc4d('0xc'),auth[_0xdc4d('0x9')](),controller[_0xdc4d('0xd')]);router[_0xdc4d('0x8')](_0xdc4d('0xe'),auth['isAuthenticated'](),controller[_0xdc4d('0xf')]);router[_0xdc4d('0x10')]('/',auth['isAuthenticated'](),interaction[_0xdc4d('0x11')]('mail',_0xdc4d('0x12')),controller['create']);router['put']('/:id',auth[_0xdc4d('0x9')](),controller[_0xdc4d('0x13')]);router[_0xdc4d('0x14')]('/:id/accept',auth[_0xdc4d('0x9')](),controller[_0xdc4d('0x15')]);router[_0xdc4d('0x14')]('/:id/reject',auth[_0xdc4d('0x9')](),controller['reject']);router['delete'](_0xdc4d('0xc'),auth[_0xdc4d('0x9')](),controller[_0xdc4d('0x16')]);module[_0xdc4d('0x17')]=router; \ No newline at end of file +var _0xa8d8=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','describe','show','download','mailmessage:create','create','update','put','accept','reject','delete','/:id','destroy'];(function(_0x2bc78d,_0x31a288){var _0x5d96c9=function(_0x3099e1){while(--_0x3099e1){_0x2bc78d['push'](_0x2bc78d['shift']());}};_0x5d96c9(++_0x31a288);}(_0xa8d8,0x79));var _0x8a8d=function(_0x5eb24d,_0xa71a6f){_0x5eb24d=_0x5eb24d-0x0;var _0x4d4507=_0xa8d8[_0x5eb24d];return _0x4d4507;};'use strict';var multer=require(_0x8a8d('0x0'));var util=require(_0x8a8d('0x1'));var path=require(_0x8a8d('0x2'));var timeout=require(_0x8a8d('0x3'));var express=require(_0x8a8d('0x4'));var router=express[_0x8a8d('0x5')]();var fs_extra=require(_0x8a8d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8a8d('0x7'));var config=require('../../config/environment');var controller=require(_0x8a8d('0x8'));router[_0x8a8d('0x9')]('/',auth[_0x8a8d('0xa')](),controller['index']);router[_0x8a8d('0x9')]('/describe',auth[_0x8a8d('0xa')](),controller[_0x8a8d('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8a8d('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x8a8d('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked']('mail',_0x8a8d('0xe')),controller[_0x8a8d('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8a8d('0x10')]);router[_0x8a8d('0x11')]('/:id/accept',auth['isAuthenticated'](),controller[_0x8a8d('0x12')]);router[_0x8a8d('0x11')]('/:id/reject',auth[_0x8a8d('0xa')](),controller[_0x8a8d('0x13')]);router[_0x8a8d('0x14')](_0x8a8d('0x15'),auth[_0x8a8d('0xa')](),controller[_0x8a8d('0x16')]);module[_0x8a8d('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index e59cf90..a3fc4fd 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 _0xa914=['exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Chat','lodash'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xa914,0x83));var _0x4a91=function(_0xa26e2c,_0x1ffb98){_0xa26e2c=_0xa26e2c-0x0;var _0x524b0e=_0xa914[_0xa26e2c];return _0x524b0e;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4a91('0x0'));module[_0x4a91('0x1')]={'body':{'type':Sequelize[_0x4a91('0x2')](_0x4a91('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4a91('0x2')](_0x4a91('0x4'))},'read':{'type':Sequelize[_0x4a91('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4a91('0x6')]('in',_0x4a91('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x4a91('0x8')]},'to':{'type':Sequelize['TEXT'](_0x4a91('0x3'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0x4a91('0x2')](_0x4a91('0x3'))},'subject':{'type':Sequelize[_0x4a91('0x2')]},'sentAt':{'type':Sequelize[_0x4a91('0x9')]},'attach':{'type':Sequelize[_0x4a91('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4a91('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4a91('0x9')]},'originTo':{'type':Sequelize[_0x4a91('0x2')]('long')},'originCc':{'type':Sequelize[_0x4a91('0x2')](_0x4a91('0x3'))},'originChannel':{'type':Sequelize[_0x4a91('0x6')]('Email',_0x4a91('0xb')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x86dc=['TEXT','long','medium','ENUM','out','STRING','BOOLEAN','DATE','Email','Chat','sequelize'];(function(_0x9fb7e4,_0x4225b3){var _0x1e83a2=function(_0x34befa){while(--_0x34befa){_0x9fb7e4['push'](_0x9fb7e4['shift']());}};_0x1e83a2(++_0x4225b3);}(_0x86dc,0x13e));var _0xc86d=function(_0x68bb5d,_0xe378d5){_0x68bb5d=_0x68bb5d-0x0;var _0x514c04=_0x86dc[_0x68bb5d];return _0x514c04;};'use strict';var Sequelize=require(_0xc86d('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0xc86d('0x1')](_0xc86d('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xc86d('0x1')](_0xc86d('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xc86d('0x4')]('in','out'),'defaultValue':_0xc86d('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xc86d('0x6')]},'to':{'type':Sequelize[_0xc86d('0x1')](_0xc86d('0x2'))},'cc':{'type':Sequelize['TEXT'](_0xc86d('0x2'))},'bcc':{'type':Sequelize['TEXT'](_0xc86d('0x2'))},'subject':{'type':Sequelize[_0xc86d('0x1')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xc86d('0x7')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xc86d('0x8')]},'originTo':{'type':Sequelize['TEXT'](_0xc86d('0x2'))},'originCc':{'type':Sequelize[_0xc86d('0x1')](_0xc86d('0x2'))},'originChannel':{'type':Sequelize[_0xc86d('0x4')](_0xc86d('0x9'),_0xc86d('0xa')),'defaultValue':_0xc86d('0x9'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index c8c4c1f..747b2ab 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 _0x347e=['then','info','debug','request\x20sent','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','catch','status','offset','undefined','limit','count','Content-Range','json','update','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','merge','options','find','body','describe','create','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','root','server/files/attachments','ListId','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','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','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','SIP/%s','rejectmessage','download','unix','toString','join','files','tmp','server','message-%s.eml','from','bcc','Attachment','subject','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','existsSync','push','readFileSync','writeFileSync','eml-format','moment','bluebird','path','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailMessage.socket','client','http','request'];(function(_0x346b8b,_0x58d85d){var _0x576942=function(_0x22a204){while(--_0x22a204){_0x346b8b['push'](_0x346b8b['shift']());}};_0x576942(++_0x58d85d);}(_0x347e,0x136));var _0xe347=function(_0x16c609,_0x3875d2){_0x16c609=_0x16c609-0x0;var _0x4a0dd6=_0x347e[_0x16c609];return _0x4a0dd6;};'use strict';var emlformat=require(_0xe347('0x0'));var moment=require(_0xe347('0x1'));var BPromise=require(_0xe347('0x2'));var util=require('util');var path=require(_0xe347('0x3'));var fs=require('fs');var _=require(_0xe347('0x4'));var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require(_0xe347('0x5'));var logger=require('../../config/logger')(_0xe347('0x6'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0xe347('0x7'));var db=require(_0xe347('0x8'))['db'];config[_0xe347('0x9')]=_[_0xe347('0xa')](config[_0xe347('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe347('0xb'))(new Redis(config[_0xe347('0x9')]));var htmlEntities=require('html-entities');require(_0xe347('0xc'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xe347('0xd')][_0xe347('0xe')]({'port':0x232c});var client9003=jayson[_0xe347('0xd')]['http']({'port':0x232b});var client9002=jayson[_0xe347('0xd')][_0xe347('0xe')]({'port':0x232a});function respondWithRpcPromise(_0x20f09e,_0x39ff9c,_0x4aabd3,_0x47ff2b){return new BPromise(function(_0x445a41,_0x1fcefd){var _0x224522=_0x47ff2b||client;return _0x224522[_0xe347('0xf')](_0x20f09e,_0x4aabd3)[_0xe347('0x10')](function(_0x450db8){logger[_0xe347('0x11')]('MailMessage,\x20%s,\x20%s',_0x39ff9c,'request\x20sent');logger[_0xe347('0x12')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x39ff9c,_0xe347('0x13'),JSON[_0xe347('0x14')](_0x450db8));if(_0x450db8[_0xe347('0x15')]){if(_0x450db8[_0xe347('0x15')][_0xe347('0x16')]===0x1f4){logger[_0xe347('0x15')]('MailMessage,\x20%s,\x20%s',_0x39ff9c,_0x450db8['error']['message']);return _0x1fcefd(_0x450db8[_0xe347('0x15')][_0xe347('0x17')]);}logger[_0xe347('0x15')]('MailMessage,\x20%s,\x20%s',_0x39ff9c,_0x450db8[_0xe347('0x15')][_0xe347('0x17')]);return _0x445a41(_0x450db8[_0xe347('0x15')][_0xe347('0x17')]);}else{logger['info'](_0xe347('0x18'),_0x39ff9c,_0xe347('0x13'));_0x445a41(_0x450db8[_0xe347('0x19')][_0xe347('0x17')]);}})[_0xe347('0x1a')](function(_0x4cd450){logger[_0xe347('0x15')]('MailMessage,\x20%s,\x20%s',_0x39ff9c,_0x4cd450);_0x1fcefd(_0x4cd450);});});}function respondWithResult(_0x53fef6,_0x293d92){_0x293d92=_0x293d92||0xc8;return function(_0x1bf4b8){if(_0x1bf4b8){return _0x53fef6[_0xe347('0x1b')](_0x293d92)['json'](_0x1bf4b8);}};}function respondWithFilteredResult(_0x2d546c,_0x17e9c6){return function(_0x378775){if(_0x378775){var _0x1e7a31=typeof _0x17e9c6[_0xe347('0x1c')]===_0xe347('0x1d')&&typeof _0x17e9c6[_0xe347('0x1e')]===_0xe347('0x1d');var _0x1582e0=_0x378775['count'];var _0x389e48=_0x1e7a31?0x0:_0x17e9c6[_0xe347('0x1c')];var _0x55e67c=_0x1e7a31?_0x378775[_0xe347('0x1f')]:_0x17e9c6[_0xe347('0x1c')]+_0x17e9c6[_0xe347('0x1e')];var _0x4f1a7f;if(_0x55e67c>=_0x1582e0){_0x55e67c=_0x1582e0;_0x4f1a7f=0xc8;}else{_0x4f1a7f=0xce;}_0x2d546c[_0xe347('0x1b')](_0x4f1a7f);return _0x2d546c['set'](_0xe347('0x20'),_0x389e48+'-'+_0x55e67c+'/'+_0x1582e0)[_0xe347('0x21')](_0x378775);}return null;};}function saveUpdates(_0x4aa163){return function(_0x5dbf5d){if(_0x5dbf5d){return _0x5dbf5d[_0xe347('0x22')](_0x4aa163)[_0xe347('0x10')](function(_0x225b19){return _0x225b19;});}return null;};}function removeEntity(_0x37b25d){return function(_0x2abef1){if(_0x2abef1){return _0x2abef1[_0xe347('0x23')]()[_0xe347('0x10')](function(){_0x37b25d['status'](0xcc)[_0xe347('0x24')]();});}};}function handleEntityNotFound(_0x42bfc2){return function(_0xcabdc){if(!_0xcabdc){_0x42bfc2[_0xe347('0x25')](0x194);}return _0xcabdc;};}function handleError(_0x2fb090,_0x7701aa){_0x7701aa=_0x7701aa||0x1f4;return function(_0x11b201){logger['error'](_0x11b201[_0xe347('0x26')]);if(_0x11b201[_0xe347('0x27')]){delete _0x11b201[_0xe347('0x27')];}_0x2fb090[_0xe347('0x1b')](_0x7701aa)[_0xe347('0x28')](_0x11b201);};}exports[_0xe347('0x29')]=function(_0x51a7a2,_0x4e16bd){var _0x3d486c={},_0x199cc4={},_0x15ccdb={'count':0x0,'rows':[]};var _0x1a9cd0=_[_0xe347('0x2a')](db[_0xe347('0x2b')][_0xe347('0x2c')],function(_0x1242dc){return{'name':_0x1242dc[_0xe347('0x2d')],'type':_0x1242dc[_0xe347('0x2e')][_0xe347('0x2f')]};});_0x199cc4[_0xe347('0x30')]=_[_0xe347('0x2a')](_0x1a9cd0,'name');_0x199cc4['query']=_[_0xe347('0x31')](_0x51a7a2['query']);_0x199cc4[_0xe347('0x32')]=_[_0xe347('0x33')](_0x199cc4[_0xe347('0x30')],_0x199cc4['query']);_0x3d486c['attributes']=_[_0xe347('0x33')](_0x199cc4['model'],qs[_0xe347('0x34')](_0x51a7a2[_0xe347('0x35')]['fields']));_0x3d486c[_0xe347('0x36')]=_0x3d486c['attributes'][_0xe347('0x37')]?_0x3d486c[_0xe347('0x36')]:_0x199cc4['model'];if(!_0x51a7a2[_0xe347('0x35')][_0xe347('0x38')](_0xe347('0x39'))){_0x3d486c[_0xe347('0x1e')]=qs[_0xe347('0x1e')](_0x51a7a2[_0xe347('0x35')][_0xe347('0x1e')]);_0x3d486c[_0xe347('0x1c')]=qs['offset'](_0x51a7a2[_0xe347('0x35')]['offset']);}_0x3d486c['order']=qs[_0xe347('0x3a')](_0x51a7a2['query'][_0xe347('0x3a')]);_0x3d486c[_0xe347('0x3b')]=qs[_0xe347('0x32')](_[_0xe347('0x3c')](_0x51a7a2[_0xe347('0x35')],_0x199cc4['filters']),_0x1a9cd0);if(_0x51a7a2[_0xe347('0x35')][_0xe347('0x3d')]){_0x3d486c[_0xe347('0x3b')]=_['merge'](_0x3d486c['where'],{'$or':_[_0xe347('0x2a')](_0x1a9cd0,function(_0x593550){if(_0x593550[_0xe347('0x2e')]!==_0xe347('0x3e')){var _0xc7b4b8={};_0xc7b4b8[_0x593550[_0xe347('0x27')]]={'$like':'%'+_0x51a7a2['query'][_0xe347('0x3d')]+'%'};return _0xc7b4b8;}})});}_0x3d486c=_['merge']({},_0x3d486c,_0x51a7a2['options']);var _0xe41522={'where':_0x3d486c[_0xe347('0x3b')]};return db[_0xe347('0x2b')][_0xe347('0x1f')](_0xe41522)[_0xe347('0x10')](function(_0x1710de){_0x15ccdb[_0xe347('0x1f')]=_0x1710de;if(_0x51a7a2[_0xe347('0x35')][_0xe347('0x3f')]){_0x3d486c[_0xe347('0x40')]=[{'all':!![]}];}return db[_0xe347('0x2b')][_0xe347('0x41')](_0x3d486c);})['then'](function(_0x29fdd7){_0x15ccdb[_0xe347('0x42')]=_0x29fdd7;return _0x15ccdb;})[_0xe347('0x10')](respondWithFilteredResult(_0x4e16bd,_0x3d486c))[_0xe347('0x1a')](handleError(_0x4e16bd,null));};exports[_0xe347('0x43')]=function(_0x50f728,_0x41664d){var _0x3dd2e4={'raw':!![],'where':{'id':_0x50f728[_0xe347('0x44')]['id']}},_0x1fa512={};_0x1fa512[_0xe347('0x30')]=_[_0xe347('0x31')](db[_0xe347('0x2b')][_0xe347('0x2c')]);_0x1fa512[_0xe347('0x35')]=_[_0xe347('0x31')](_0x50f728[_0xe347('0x35')]);_0x1fa512['filters']=_[_0xe347('0x33')](_0x1fa512[_0xe347('0x30')],_0x1fa512['query']);_0x3dd2e4[_0xe347('0x36')]=_[_0xe347('0x33')](_0x1fa512['model'],qs[_0xe347('0x34')](_0x50f728[_0xe347('0x35')][_0xe347('0x34')]));_0x3dd2e4['attributes']=_0x3dd2e4[_0xe347('0x36')][_0xe347('0x37')]?_0x3dd2e4[_0xe347('0x36')]:_0x1fa512[_0xe347('0x30')];if(_0x50f728[_0xe347('0x35')][_0xe347('0x3f')]){_0x3dd2e4[_0xe347('0x40')]=[{'all':!![]}];}_0x3dd2e4=_[_0xe347('0x45')]({},_0x3dd2e4,_0x50f728[_0xe347('0x46')]);return db['MailMessage'][_0xe347('0x47')](_0x3dd2e4)[_0xe347('0x10')](handleEntityNotFound(_0x41664d,null))['then'](respondWithResult(_0x41664d,null))[_0xe347('0x1a')](handleError(_0x41664d,null));};exports[_0xe347('0x22')]=function(_0x3925f6,_0x3beea0){if(_0x3925f6['body']['id']){delete _0x3925f6['body']['id'];}return db[_0xe347('0x2b')][_0xe347('0x47')]({'where':{'id':_0x3925f6[_0xe347('0x44')]['id']}})[_0xe347('0x10')](handleEntityNotFound(_0x3beea0,null))['then'](saveUpdates(_0x3925f6[_0xe347('0x48')],null))[_0xe347('0x10')](respondWithResult(_0x3beea0,null))['catch'](handleError(_0x3beea0,null));};exports[_0xe347('0x23')]=function(_0x5ed896,_0x24e541){return db[_0xe347('0x2b')][_0xe347('0x47')]({'where':{'id':_0x5ed896[_0xe347('0x44')]['id']}})[_0xe347('0x10')](handleEntityNotFound(_0x24e541,null))[_0xe347('0x10')](removeEntity(_0x24e541,null))['catch'](handleError(_0x24e541,null));};exports['describe']=function(_0x3b7de9,_0x48687f){return db['MailMessage'][_0xe347('0x49')]()[_0xe347('0x10')](respondWithResult(_0x48687f,null))['catch'](handleError(_0x48687f,null));};exports[_0xe347('0x4a')]=function(_0x5e4d4a,_0x1341ee){return db[_0xe347('0x2b')][_0xe347('0x4a')](_0x5e4d4a[_0xe347('0x48')])[_0xe347('0x10')](function(_0x57b8b5){if(_0x57b8b5){if(_0x57b8b5['direction']===_0xe347('0x4b')&&!_0x57b8b5[_0xe347('0x4c')]){var _0x293582,_0xbc3286,_0x4de45d;if(_0x5e4d4a[_0xe347('0x48')]['to']){_0xbc3286=_0x5e4d4a[_0xe347('0x48')]['to'][_0xe347('0x4d')](',')[0x0];}return db[_0xe347('0x4e')][_0xe347('0x4f')]({'where':{'id':_0x57b8b5[_0xe347('0x50')]},'include':[{'model':db[_0xe347('0x51')],'as':_0xe347('0x52'),'include':[{'model':db[_0xe347('0x53')],'as':_0xe347('0x54'),'where':{'email':_0xbc3286},'limit':0x1,'order':[[_0xe347('0x55'),_0xe347('0x56')]]}]},{'model':db[_0xe347('0x57')],'as':_0xe347('0x58'),'raw':!![],'include':[{'model':db[_0xe347('0x59')],'as':_0xe347('0x59'),'raw':!![]}]}]})[_0xe347('0x10')](function(_0x5ba6ab){_0x293582=_0x5ba6ab;if(!_0x293582||!_0x293582[_0xe347('0x58')])return;var _0x37d2d0=_0x293582[_0xe347('0x5a')]();if(_0x5e4d4a['body']['attachments']&&_0x5e4d4a[_0xe347('0x48')][_0xe347('0x5b')][_0xe347('0x37')]){for(var _0xfbee9c=0x0;_0xfbee9c<_0x5e4d4a['body'][_0xe347('0x5b')][_0xe347('0x37')];_0xfbee9c+=0x1){_0x5e4d4a['body'][_0xe347('0x5b')][_0xfbee9c]={'filename':_0x5e4d4a['body'][_0xe347('0x5b')][_0xfbee9c][_0xe347('0x27')],'path':path['join'](config[_0xe347('0x5c')],_0xe347('0x5d'),_0x5e4d4a['body'][_0xe347('0x5b')][_0xfbee9c]['basename'])};}}_0x4de45d={'account':_0x37d2d0,'message':_0x5e4d4a[_0xe347('0x48')]};return;})[_0xe347('0x10')](function(){if(_0x293582[_0xe347('0x52')]){if(_0x293582[_0xe347('0x52')][_0xe347('0x54')][_0xe347('0x37')]){return _0x293582[_0xe347('0x52')][_0xe347('0x54')][0x0];}else{return db[_0xe347('0x53')][_0xe347('0x4a')](_[_0xe347('0xa')](_0x5e4d4a[_0xe347('0x48')],{'firstName':_0x5e4d4a[_0xe347('0x48')]['to'],'email':_0x5e4d4a[_0xe347('0x48')]['to'],'phone':_0x5e4d4a[_0xe347('0x48')]['to'],'ListId':_0x293582[_0xe347('0x5e')]}));}}else{throw new Error(_0xe347('0x5f'));}})['then'](function(){if(_0x4de45d){return respondWithRpcPromise(_0xe347('0x60'),'sendMail',_0x4de45d,client9003)[_0xe347('0x10')](function(_0x3b4e73){return _0x57b8b5[_0xe347('0x22')]({'read':!![],'messageId':_0x3b4e73[_0xe347('0x61')],'sentAt':moment()[_0xe347('0x62')](_0xe347('0x63'))});})[_0xe347('0x1a')](function(_0x1db569){logger['error']('%s',JSON[_0xe347('0x14')](_0x1db569));return _0x57b8b5;});}return _0x57b8b5;});}return _0x57b8b5;}})[_0xe347('0x10')](respondWithResult(_0x1341ee,0xc9))[_0xe347('0x1a')](handleError(_0x1341ee,null));};exports['accept']=function(_0x1d715c,_0x593388){var _0x520343={'agent':{},'channel':_0xe347('0x64')};if(_0x1d715c['body']['id']){delete _0x1d715c[_0xe347('0x48')]['id'];}_0x1d715c[_0xe347('0x48')][_0xe347('0x65')]=!![];_0x1d715c['body'][_0xe347('0x66')]=moment()['format'](_0xe347('0x63'));_0x1d715c[_0xe347('0x48')][_0xe347('0x67')]=_0x1d715c['body'][_0xe347('0x67')]||_0x1d715c[_0xe347('0x68')]['id'];_0x520343[_0xe347('0x69')]['id']=_0x1d715c['body']['UserId'];return db[_0xe347('0x2b')][_0xe347('0x47')]({'where':{'id':_0x1d715c[_0xe347('0x44')]['id'],'UserId':null}})[_0xe347('0x10')](handleEntityNotFound(_0x593388,null))['then'](saveUpdates(_0x1d715c[_0xe347('0x48')],null))[_0xe347('0x10')](function(_0x4335c0){if(_0x4335c0){_0x520343['message']=_0x4335c0[_0xe347('0x6a')]({'plain':!![]});return db[_0xe347('0x6b')]['find']({'where':{'id':_0x4335c0[_0xe347('0x6c')]}});}return null;})[_0xe347('0x10')](handleEntityNotFound(_0x593388,null))[_0xe347('0x10')](function(_0x49b0e6){if(_0x49b0e6){return _0x49b0e6[_0xe347('0x22')]({'UserId':_0x1d715c[_0xe347('0x48')][_0xe347('0x67')],'read1stAt':_[_0xe347('0x6d')](_0x49b0e6[_0xe347('0x6e')])?moment()[_0xe347('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe347('0x10')](function(_0x3cda0c){if(_0x3cda0c){_0x520343[_0xe347('0x6f')]=_0x3cda0c[_0xe347('0x6a')]({'plain':!![]});interaction_log['info'](_0xe347('0x70'),_0x1d715c[_0xe347('0x68')]['id'],_0x1d715c['user']['name'],_0x1d715c[_0xe347('0x68')][_0xe347('0x71')],_0x520343[_0xe347('0x6f')]['id'],_0x1d715c['body']?JSON['stringify'](_0x1d715c[_0xe347('0x48')]):_0xe347('0x72'));return respondWithRpcPromise(_0xe347('0x73'),_0xe347('0x74'),_0x520343);}return null;})['then'](function(_0x2ff0bc){var _0x182403=_0xe347('0x75')+_0x2ff0bc[_0xe347('0x17')][_0xe347('0x76')];return db[_0xe347('0x77')][_0xe347('0x35')](_0x182403,{'type':db[_0xe347('0x78')][_0xe347('0x79')][_0xe347('0x7a')],'raw':!![]})['then'](function(_0x4f0bb5){return _0x4f0bb5;});})[_0xe347('0x10')](function(_0xca97ae){if(_0xca97ae){_0x520343[_0xe347('0x17')]['contact']=_0xca97ae[0x0];if(!_0x1d715c[_0xe347('0x48')][_0xe347('0x67')])return;return db[_0xe347('0x7b')][_0xe347('0x47')]({'where':{'id':_0x1d715c[_0xe347('0x48')][_0xe347('0x67')],'role':_0xe347('0x69')},'attributes':['id',_0xe347('0x27'),_0xe347('0x7c'),_0xe347('0x7d'),_0xe347('0x7e')],'raw':!![]});}return null;})[_0xe347('0x10')](function(_0x3bec4c){if(!_0x3bec4c)return null;_0x520343[_0xe347('0x17')][_0xe347('0x69')]=_0x3bec4c;return _0x520343;})['then'](function(_0x295c96){if(_0x295c96){if(_0x1d715c[_0xe347('0x48')][_0xe347('0x7f')]){_0x520343['message'][_0xe347('0x80')]=util[_0xe347('0x62')]('SIP/%s',_0x1d715c[_0xe347('0x68')]['name']);_0x520343[_0xe347('0x17')]['channel']=_0x520343[_0xe347('0x81')];_0x520343[_0xe347('0x17')][_0xe347('0x82')]=_0x520343[_0xe347('0x81')];_0x520343[_0xe347('0x17')][_0xe347('0x83')]='accept';_0x520343[_0xe347('0x17')][_0xe347('0x48')]=htmlToText[_0xe347('0x84')](_0x520343[_0xe347('0x17')][_0xe347('0x48')]);return respondWithRpcPromise(_0xe347('0x85'),_0xe347('0x85'),{'event':_0xe347('0x86'),'message':_0x520343[_0xe347('0x17')]},client9002)[_0xe347('0x10')](function(){return _0x520343;});}return _0x520343;}return null;})[_0xe347('0x10')](respondWithResult(_0x593388,null))[_0xe347('0x1a')](handleError(_0x593388,null));};exports[_0xe347('0x87')]=function(_0x37d3c9,_0x2e3e86){var _0x2fea1a={'agent':{},'channel':_0xe347('0x64')};if(_0x37d3c9[_0xe347('0x48')]['id']){delete _0x37d3c9[_0xe347('0x48')]['id'];}_0x37d3c9[_0xe347('0x48')][_0xe347('0x67')]=_0x37d3c9[_0xe347('0x48')][_0xe347('0x67')]||_0x37d3c9[_0xe347('0x68')]['id'];_0x2fea1a[_0xe347('0x69')]['id']=_0x37d3c9[_0xe347('0x48')][_0xe347('0x67')];return db[_0xe347('0x2b')][_0xe347('0x47')]({'where':{'id':_0x37d3c9[_0xe347('0x44')]['id'],'UserId':null}})[_0xe347('0x10')](handleEntityNotFound(_0x2e3e86,null))['then'](function(_0xdea12d){if(_0xdea12d){_0x2fea1a[_0xe347('0x17')]=_0xdea12d[_0xe347('0x6a')]({'plain':!![]});return db[_0xe347('0x6b')][_0xe347('0x47')]({'where':{'id':_0xdea12d[_0xe347('0x6c')]}});}return null;})[_0xe347('0x10')](handleEntityNotFound(_0x2e3e86,null))[_0xe347('0x10')](function(_0x5a733f){if(_0x5a733f){_0x2fea1a[_0xe347('0x6f')]=_0x5a733f['get']({'plain':!![]});interaction_log[_0xe347('0x11')](_0xe347('0x88'),_0x37d3c9['user']['id'],_0x37d3c9[_0xe347('0x68')][_0xe347('0x27')],_0x37d3c9['user'][_0xe347('0x71')],_0x2fea1a[_0xe347('0x6f')]['id'],_0x37d3c9[_0xe347('0x48')]?JSON[_0xe347('0x14')](_0x37d3c9[_0xe347('0x48')]):_0xe347('0x72'));return respondWithRpcPromise(_0xe347('0x89'),_0xe347('0x8a'),_0x2fea1a);}return null;})[_0xe347('0x10')](function(_0x563510){var _0x1ddcb1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x563510[_0xe347('0x17')][_0xe347('0x76')];return db['sequelize'][_0xe347('0x35')](_0x1ddcb1,{'type':db['Sequelize']['QueryTypes'][_0xe347('0x7a')],'raw':!![]})[_0xe347('0x10')](function(_0x2bb8bf){return _0x2bb8bf;});})[_0xe347('0x10')](function(_0x29b22b){if(_0x29b22b){_0x2fea1a['message'][_0xe347('0x8b')]=_0x29b22b[0x0];if(!_0x37d3c9[_0xe347('0x48')][_0xe347('0x67')])return;return db[_0xe347('0x7b')][_0xe347('0x47')]({'where':{'id':_0x37d3c9[_0xe347('0x48')][_0xe347('0x67')],'role':_0xe347('0x69')},'attributes':['id',_0xe347('0x27'),'fullname',_0xe347('0x7d'),_0xe347('0x7e')],'raw':!![]});}return null;})['then'](function(_0x4cefac){if(!_0x4cefac)return null;_0x2fea1a[_0xe347('0x17')][_0xe347('0x69')]=_0x4cefac;return _0x2fea1a;})[_0xe347('0x10')](function(_0x4a3c47){if(_0x4a3c47){_0x4a3c47[_0xe347('0x17')][_0xe347('0x80')]=util[_0xe347('0x62')](_0xe347('0x8c'),_0x37d3c9[_0xe347('0x68')]['name']);_0x4a3c47[_0xe347('0x17')][_0xe347('0x81')]=_0x2fea1a[_0xe347('0x81')];_0x4a3c47['message'][_0xe347('0x82')]=_0x2fea1a[_0xe347('0x81')];_0x4a3c47['message'][_0xe347('0x83')]=_0xe347('0x87');_0x4a3c47[_0xe347('0x17')][_0xe347('0x48')]=htmlToText[_0xe347('0x84')](_0x2fea1a[_0xe347('0x17')][_0xe347('0x48')]);respondWithRpcPromise(_0xe347('0x85'),_0xe347('0x85'),{'event':_0xe347('0x8d'),'message':_0x4a3c47[_0xe347('0x17')]},client9002);return _0x2fea1a;}return null;})[_0xe347('0x10')](respondWithResult(_0x2e3e86,null))[_0xe347('0x1a')](handleError(_0x2e3e86,null));};exports[_0xe347('0x8e')]=function(_0x2b396c,_0x414019){var _0x325957=moment()[_0xe347('0x8f')]()[_0xe347('0x90')]();var _0x38c328=path[_0xe347('0x91')](config[_0xe347('0x5c')],'server',_0xe347('0x92'),_0xe347('0x93'));var _0x126c7c=path[_0xe347('0x91')](config['root'],_0xe347('0x94'),_0xe347('0x92'),_0xe347('0x5b'));var _0x259dd5=util[_0xe347('0x62')](_0xe347('0x95'),_0x325957);return db[_0xe347('0x2b')][_0xe347('0x47')]({'where':{'id':_0x2b396c[_0xe347('0x44')]['id']},'attributes':['id',_0xe347('0x48'),_0xe347('0x96'),'to','cc',_0xe347('0x97'),'subject','createdAt'],'include':_0x2b396c['query']['attachments']?[{'model':db[_0xe347('0x98')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x414019,null))[_0xe347('0x10')](function(_0x537fea){if(_0x537fea){var _0x24e410=_0x537fea;var _0x1248ed={'from':_0x24e410[_0xe347('0x96')],'to':_0x24e410['to'],'subject':_0x24e410[_0xe347('0x99')],'html':htmlEntities[_0xe347('0x9a')](_0x24e410[_0xe347('0x48')]),'headers':{'Date':moment(_0x24e410[_0xe347('0x9b')])[_0xe347('0x62')](_0xe347('0x9c'))},'attachments':[]};if(_0x537fea['cc']){_0x1248ed['headers']['Cc']=_0x537fea['cc'];}if(_0x537fea[_0xe347('0x97')]){_0x1248ed[_0xe347('0x9d')]['Bcc']=_0x537fea[_0xe347('0x97')];}return new BPromise(function(_0x447ec8,_0x468ae5){if(_0x537fea[_0xe347('0x9e')]){for(var _0x4b07ae=0x0;_0x4b07ae<_0x537fea[_0xe347('0x9e')][_0xe347('0x37')];_0x4b07ae++){var _0x11a3f2=_0x537fea[_0xe347('0x9e')][_0x4b07ae];var _0x4ec79e=path[_0xe347('0x91')](_0x126c7c,_0x11a3f2['basename']);if(fs[_0xe347('0x9f')](_0x4ec79e)){_0x1248ed[_0xe347('0x5b')][_0xe347('0xa0')]({'name':_0x11a3f2['name'],'contentType':_0x11a3f2[_0xe347('0x2e')],'data':fs[_0xe347('0xa1')](_0x4ec79e)});}}}emlformat['build'](_0x1248ed,function(_0x1e2540,_0x4c3bb3){if(_0x1e2540)return _0x468ae5(_0x1e2540);fs[_0xe347('0xa2')](path[_0xe347('0x91')](_0x38c328,_0x259dd5),_0x4c3bb3);return _0x447ec8(_0x4c3bb3);});});}})[_0xe347('0x10')](function(_0x5e3a56){if(_0x5e3a56){return _0x414019[_0xe347('0x8e')](path[_0xe347('0x91')](_0x38c328,_0x259dd5),_0x259dd5,function(_0x427784){if(!_0x427784)fs['unlinkSync'](path[_0xe347('0x91')](_0x38c328,_0x259dd5));});}})['catch'](handleError(_0x414019,null));}; \ No newline at end of file +var _0x9df6=['mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','offset','undefined','limit','count','update','destroy','end','name','MailMessage','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','show','params','find','body','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','join','root','server/files/attachments','List','ListId','List\x20not\x20found','sendMail','messageId','format','stringify','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','MailInteraction','MailInteractionId','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','QueryTypes','contact','fullname','email','internal','manual','interface','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','mail','RejectMessage','rejectMessage','sequelize','SELECT','User','SIP/%s','unix','toString','server','files','bcc','subject','createdAt','Attachment','Attachments','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','readFileSync','build','writeFileSync','download','unlinkSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api'];(function(_0x252328,_0x4c22f0){var _0xaa85b7=function(_0x2623d0){while(--_0x2623d0){_0x252328['push'](_0x252328['shift']());}};_0xaa85b7(++_0x4c22f0);}(_0x9df6,0x1e8));var _0x69df=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x9df6[_0x4e1d03];return _0x362d4b;};'use strict';var emlformat=require(_0x69df('0x0'));var moment=require(_0x69df('0x1'));var BPromise=require('bluebird');var util=require(_0x69df('0x2'));var path=require(_0x69df('0x3'));var fs=require('fs');var _=require(_0x69df('0x4'));var Redis=require(_0x69df('0x5'));var htmlToText=require(_0x69df('0x6'));var qs=require(_0x69df('0x7'));var logger=require(_0x69df('0x8'))(_0x69df('0x9'));var interaction_log=require(_0x69df('0x8'))(_0x69df('0xa'));var config=require(_0x69df('0xb'));var db=require(_0x69df('0xc'))['db'];config[_0x69df('0xd')]=_[_0x69df('0xe')](config['redis'],{'host':_0x69df('0xf'),'port':0x18eb});var socket=require(_0x69df('0x10'))(new Redis(config[_0x69df('0xd')]));var htmlEntities=require(_0x69df('0x11'));require(_0x69df('0x12'))[_0x69df('0x13')](socket);var jayson=require(_0x69df('0x14'));var client=jayson['client'][_0x69df('0x15')]({'port':0x232c});var client9003=jayson[_0x69df('0x16')][_0x69df('0x15')]({'port':0x232b});var client9002=jayson[_0x69df('0x16')][_0x69df('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x44ac3b,_0x1231dc,_0x301418,_0x5b8cb9){return new BPromise(function(_0xbb412c,_0x5e894d){var _0x59a283=_0x5b8cb9||client;return _0x59a283[_0x69df('0x17')](_0x44ac3b,_0x301418)[_0x69df('0x18')](function(_0x4cfe53){logger[_0x69df('0x19')](_0x69df('0x1a'),_0x1231dc,_0x69df('0x1b'));logger[_0x69df('0x1c')](_0x69df('0x1d'),_0x1231dc,_0x69df('0x1b'),JSON['stringify'](_0x4cfe53));if(_0x4cfe53['error']){if(_0x4cfe53[_0x69df('0x1e')][_0x69df('0x1f')]===0x1f4){logger[_0x69df('0x1e')]('MailMessage,\x20%s,\x20%s',_0x1231dc,_0x4cfe53[_0x69df('0x1e')][_0x69df('0x20')]);return _0x5e894d(_0x4cfe53[_0x69df('0x1e')][_0x69df('0x20')]);}logger[_0x69df('0x1e')]('MailMessage,\x20%s,\x20%s',_0x1231dc,_0x4cfe53[_0x69df('0x1e')]['message']);return _0xbb412c(_0x4cfe53[_0x69df('0x1e')][_0x69df('0x20')]);}else{logger[_0x69df('0x19')](_0x69df('0x1a'),_0x1231dc,_0x69df('0x1b'));_0xbb412c(_0x4cfe53[_0x69df('0x21')]['message']);}})[_0x69df('0x22')](function(_0x1c6f74){logger['error'](_0x69df('0x1a'),_0x1231dc,_0x1c6f74);_0x5e894d(_0x1c6f74);});});}function respondWithResult(_0x3a90e2,_0x303274){_0x303274=_0x303274||0xc8;return function(_0x4618c1){if(_0x4618c1){return _0x3a90e2[_0x69df('0x23')](_0x303274)[_0x69df('0x24')](_0x4618c1);}};}function respondWithFilteredResult(_0x218b27,_0x438f56){return function(_0x12cc0a){if(_0x12cc0a){var _0x98a7ed=typeof _0x438f56[_0x69df('0x25')]===_0x69df('0x26')&&typeof _0x438f56[_0x69df('0x27')]==='undefined';var _0x143228=_0x12cc0a[_0x69df('0x28')];var _0x1c1ad1=_0x98a7ed?0x0:_0x438f56[_0x69df('0x25')];var _0x387d14=_0x98a7ed?_0x12cc0a[_0x69df('0x28')]:_0x438f56[_0x69df('0x25')]+_0x438f56[_0x69df('0x27')];var _0x5c69a5;if(_0x387d14>=_0x143228){_0x387d14=_0x143228;_0x5c69a5=0xc8;}else{_0x5c69a5=0xce;}_0x218b27[_0x69df('0x23')](_0x5c69a5);return _0x218b27['set']('Content-Range',_0x1c1ad1+'-'+_0x387d14+'/'+_0x143228)['json'](_0x12cc0a);}return null;};}function saveUpdates(_0x2d38dd){return function(_0xc2e7e0){if(_0xc2e7e0){return _0xc2e7e0[_0x69df('0x29')](_0x2d38dd)[_0x69df('0x18')](function(_0x462825){return _0x462825;});}return null;};}function removeEntity(_0x5d242f){return function(_0x44817b){if(_0x44817b){return _0x44817b[_0x69df('0x2a')]()[_0x69df('0x18')](function(){_0x5d242f[_0x69df('0x23')](0xcc)[_0x69df('0x2b')]();});}};}function handleEntityNotFound(_0x561fa4){return function(_0x413104){if(!_0x413104){_0x561fa4['sendStatus'](0x194);}return _0x413104;};}function handleError(_0x16cef1,_0x2fb34a){_0x2fb34a=_0x2fb34a||0x1f4;return function(_0x8704b2){logger[_0x69df('0x1e')](_0x8704b2['stack']);if(_0x8704b2['name']){delete _0x8704b2[_0x69df('0x2c')];}_0x16cef1['status'](_0x2fb34a)['send'](_0x8704b2);};}exports['index']=function(_0x229503,_0x15a1da){var _0x2f7101={},_0x4c6961={},_0x217d43={'count':0x0,'rows':[]};var _0x53b13d=_['map'](db[_0x69df('0x2d')][_0x69df('0x2e')],function(_0x21e7fa){return{'name':_0x21e7fa[_0x69df('0x2f')],'type':_0x21e7fa['type'][_0x69df('0x30')]};});_0x4c6961[_0x69df('0x31')]=_[_0x69df('0x32')](_0x53b13d,'name');_0x4c6961['query']=_[_0x69df('0x33')](_0x229503[_0x69df('0x34')]);_0x4c6961[_0x69df('0x35')]=_['intersection'](_0x4c6961[_0x69df('0x31')],_0x4c6961['query']);_0x2f7101['attributes']=_[_0x69df('0x36')](_0x4c6961[_0x69df('0x31')],qs[_0x69df('0x37')](_0x229503[_0x69df('0x34')][_0x69df('0x37')]));_0x2f7101['attributes']=_0x2f7101[_0x69df('0x38')][_0x69df('0x39')]?_0x2f7101['attributes']:_0x4c6961[_0x69df('0x31')];if(!_0x229503[_0x69df('0x34')][_0x69df('0x3a')](_0x69df('0x3b'))){_0x2f7101[_0x69df('0x27')]=qs[_0x69df('0x27')](_0x229503[_0x69df('0x34')][_0x69df('0x27')]);_0x2f7101['offset']=qs[_0x69df('0x25')](_0x229503[_0x69df('0x34')][_0x69df('0x25')]);}_0x2f7101[_0x69df('0x3c')]=qs[_0x69df('0x3d')](_0x229503[_0x69df('0x34')][_0x69df('0x3d')]);_0x2f7101[_0x69df('0x3e')]=qs[_0x69df('0x35')](_[_0x69df('0x3f')](_0x229503[_0x69df('0x34')],_0x4c6961[_0x69df('0x35')]),_0x53b13d);if(_0x229503[_0x69df('0x34')][_0x69df('0x40')]){_0x2f7101[_0x69df('0x3e')]=_[_0x69df('0x41')](_0x2f7101[_0x69df('0x3e')],{'$or':_[_0x69df('0x32')](_0x53b13d,function(_0x55f53f){if(_0x55f53f[_0x69df('0x42')]!=='VIRTUAL'){var _0x1f6d3a={};_0x1f6d3a[_0x55f53f[_0x69df('0x2c')]]={'$like':'%'+_0x229503[_0x69df('0x34')][_0x69df('0x40')]+'%'};return _0x1f6d3a;}})});}_0x2f7101=_['merge']({},_0x2f7101,_0x229503[_0x69df('0x43')]);var _0x4d0f07={'where':_0x2f7101[_0x69df('0x3e')]};return db['MailMessage']['count'](_0x4d0f07)['then'](function(_0x32ec9b){_0x217d43[_0x69df('0x28')]=_0x32ec9b;if(_0x229503['query'][_0x69df('0x44')]){_0x2f7101[_0x69df('0x45')]=[{'all':!![]}];}return db[_0x69df('0x2d')]['findAll'](_0x2f7101);})[_0x69df('0x18')](function(_0x34af25){_0x217d43[_0x69df('0x46')]=_0x34af25;return _0x217d43;})['then'](respondWithFilteredResult(_0x15a1da,_0x2f7101))[_0x69df('0x22')](handleError(_0x15a1da,null));};exports[_0x69df('0x47')]=function(_0x5b4506,_0xa4946c){var _0x279d6e={'raw':!![],'where':{'id':_0x5b4506[_0x69df('0x48')]['id']}},_0x111435={};_0x111435[_0x69df('0x31')]=_[_0x69df('0x33')](db[_0x69df('0x2d')][_0x69df('0x2e')]);_0x111435[_0x69df('0x34')]=_['keys'](_0x5b4506['query']);_0x111435['filters']=_[_0x69df('0x36')](_0x111435['model'],_0x111435[_0x69df('0x34')]);_0x279d6e[_0x69df('0x38')]=_['intersection'](_0x111435['model'],qs[_0x69df('0x37')](_0x5b4506[_0x69df('0x34')][_0x69df('0x37')]));_0x279d6e['attributes']=_0x279d6e['attributes']['length']?_0x279d6e['attributes']:_0x111435[_0x69df('0x31')];if(_0x5b4506[_0x69df('0x34')][_0x69df('0x44')]){_0x279d6e['include']=[{'all':!![]}];}_0x279d6e=_[_0x69df('0x41')]({},_0x279d6e,_0x5b4506[_0x69df('0x43')]);return db[_0x69df('0x2d')][_0x69df('0x49')](_0x279d6e)[_0x69df('0x18')](handleEntityNotFound(_0xa4946c,null))[_0x69df('0x18')](respondWithResult(_0xa4946c,null))[_0x69df('0x22')](handleError(_0xa4946c,null));};exports[_0x69df('0x29')]=function(_0x25477e,_0xce2b74){if(_0x25477e[_0x69df('0x4a')]['id']){delete _0x25477e[_0x69df('0x4a')]['id'];}return db['MailMessage'][_0x69df('0x49')]({'where':{'id':_0x25477e[_0x69df('0x48')]['id']}})[_0x69df('0x18')](handleEntityNotFound(_0xce2b74,null))[_0x69df('0x18')](saveUpdates(_0x25477e['body'],null))['then'](respondWithResult(_0xce2b74,null))[_0x69df('0x22')](handleError(_0xce2b74,null));};exports[_0x69df('0x2a')]=function(_0x16d228,_0x3e528e){return db[_0x69df('0x2d')][_0x69df('0x49')]({'where':{'id':_0x16d228['params']['id']}})['then'](handleEntityNotFound(_0x3e528e,null))[_0x69df('0x18')](removeEntity(_0x3e528e,null))[_0x69df('0x22')](handleError(_0x3e528e,null));};exports[_0x69df('0x4b')]=function(_0x558bb7,_0x3327fe){return db[_0x69df('0x2d')][_0x69df('0x4b')]()['then'](respondWithResult(_0x3327fe,null))[_0x69df('0x22')](handleError(_0x3327fe,null));};exports[_0x69df('0x4c')]=function(_0x1ea0d4,_0x5ad9fb){return db[_0x69df('0x2d')][_0x69df('0x4c')](_0x1ea0d4['body'])[_0x69df('0x18')](function(_0x33f45f){if(_0x33f45f){if(_0x33f45f[_0x69df('0x4d')]===_0x69df('0x4e')&&!_0x33f45f[_0x69df('0x4f')]){var _0x1aab88,_0x5e3f01,_0x3cba60;if(_0x1ea0d4['body']['to']){_0x5e3f01=_0x1ea0d4['body']['to']['split'](',')[0x0];}return db[_0x69df('0x50')][_0x69df('0x51')]({'where':{'id':_0x33f45f[_0x69df('0x52')]},'include':[{'model':db[_0x69df('0x53')],'as':'List','include':[{'model':db[_0x69df('0x54')],'as':_0x69df('0x55'),'where':{'email':_0x5e3f01},'limit':0x1,'order':[[_0x69df('0x56'),_0x69df('0x57')]]}]},{'model':db[_0x69df('0x58')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x69df('0x59')],'as':_0x69df('0x59'),'raw':!![]}]}]})[_0x69df('0x18')](function(_0x33dad4){_0x1aab88=_0x33dad4;if(!_0x1aab88||!_0x1aab88[_0x69df('0x5a')])return;var _0x4e0ba7=_0x1aab88[_0x69df('0x5b')]();if(_0x1ea0d4[_0x69df('0x4a')]['attachments']&&_0x1ea0d4[_0x69df('0x4a')]['attachments'][_0x69df('0x39')]){for(var _0x12b5bf=0x0;_0x12b5bf<_0x1ea0d4[_0x69df('0x4a')]['attachments'][_0x69df('0x39')];_0x12b5bf+=0x1){_0x1ea0d4[_0x69df('0x4a')][_0x69df('0x5c')][_0x12b5bf]={'filename':_0x1ea0d4[_0x69df('0x4a')][_0x69df('0x5c')][_0x12b5bf][_0x69df('0x2c')],'path':path[_0x69df('0x5d')](config[_0x69df('0x5e')],_0x69df('0x5f'),_0x1ea0d4[_0x69df('0x4a')][_0x69df('0x5c')][_0x12b5bf]['basename'])};}}_0x3cba60={'account':_0x4e0ba7,'message':_0x1ea0d4[_0x69df('0x4a')]};return;})['then'](function(){if(_0x1aab88[_0x69df('0x60')]){if(_0x1aab88['List'][_0x69df('0x55')]['length']){return _0x1aab88['List'][_0x69df('0x55')][0x0];}else{return db[_0x69df('0x54')][_0x69df('0x4c')](_['defaults'](_0x1ea0d4[_0x69df('0x4a')],{'firstName':_0x1ea0d4[_0x69df('0x4a')]['to'],'email':_0x1ea0d4['body']['to'],'phone':_0x1ea0d4[_0x69df('0x4a')]['to'],'ListId':_0x1aab88[_0x69df('0x61')]}));}}else{throw new Error(_0x69df('0x62'));}})['then'](function(){if(_0x3cba60){return respondWithRpcPromise('SendMail',_0x69df('0x63'),_0x3cba60,client9003)[_0x69df('0x18')](function(_0x56a18a){return _0x33f45f[_0x69df('0x29')]({'read':!![],'messageId':_0x56a18a[_0x69df('0x64')],'sentAt':moment()[_0x69df('0x65')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x69df('0x22')](function(_0xe72e8c){logger[_0x69df('0x1e')]('%s',JSON[_0x69df('0x66')](_0xe72e8c));return _0x33f45f;});}return _0x33f45f;});}return _0x33f45f;}})[_0x69df('0x18')](respondWithResult(_0x5ad9fb,0xc9))[_0x69df('0x22')](handleError(_0x5ad9fb,null));};exports[_0x69df('0x67')]=function(_0x362873,_0x2d302a){var _0x1adaab={'agent':{},'channel':'mail'};if(_0x362873['body']['id']){delete _0x362873['body']['id'];}_0x362873['body']['read']=!![];_0x362873[_0x69df('0x4a')][_0x69df('0x68')]=moment()[_0x69df('0x65')](_0x69df('0x69'));_0x362873[_0x69df('0x4a')][_0x69df('0x6a')]=_0x362873[_0x69df('0x4a')]['UserId']||_0x362873[_0x69df('0x6b')]['id'];_0x1adaab[_0x69df('0x6c')]['id']=_0x362873[_0x69df('0x4a')]['UserId'];return db['MailMessage']['find']({'where':{'id':_0x362873[_0x69df('0x48')]['id'],'UserId':null}})[_0x69df('0x18')](handleEntityNotFound(_0x2d302a,null))[_0x69df('0x18')](saveUpdates(_0x362873[_0x69df('0x4a')],null))[_0x69df('0x18')](function(_0x1fdc96){if(_0x1fdc96){_0x1adaab[_0x69df('0x20')]=_0x1fdc96[_0x69df('0x6d')]({'plain':!![]});return db[_0x69df('0x6e')][_0x69df('0x49')]({'where':{'id':_0x1fdc96[_0x69df('0x6f')]}});}return null;})[_0x69df('0x18')](handleEntityNotFound(_0x2d302a,null))[_0x69df('0x18')](function(_0x12483e){if(_0x12483e){return _0x12483e[_0x69df('0x29')]({'UserId':_0x362873[_0x69df('0x4a')][_0x69df('0x6a')],'read1stAt':_[_0x69df('0x70')](_0x12483e[_0x69df('0x71')])?moment()['format'](_0x69df('0x69')):undefined});}return null;})[_0x69df('0x18')](function(_0x4c1d7a){if(_0x4c1d7a){_0x1adaab['interaction']=_0x4c1d7a[_0x69df('0x6d')]({'plain':!![]});interaction_log['info'](_0x69df('0x72'),_0x362873['user']['id'],_0x362873[_0x69df('0x6b')][_0x69df('0x2c')],_0x362873['user'][_0x69df('0x73')],_0x1adaab[_0x69df('0x74')]['id'],_0x362873['body']?JSON['stringify'](_0x362873[_0x69df('0x4a')]):_0x69df('0x75'));return respondWithRpcPromise(_0x69df('0x76'),_0x69df('0x77'),_0x1adaab);}return null;})[_0x69df('0x18')](function(_0x1762c7){var _0x501c16=_0x69df('0x78')+_0x1762c7[_0x69df('0x20')][_0x69df('0x79')];return db['sequelize'][_0x69df('0x34')](_0x501c16,{'type':db[_0x69df('0x7a')][_0x69df('0x7b')]['SELECT'],'raw':!![]})[_0x69df('0x18')](function(_0x4e1103){return _0x4e1103;});})['then'](function(_0x7ddc8c){if(_0x7ddc8c){_0x1adaab[_0x69df('0x20')][_0x69df('0x7c')]=_0x7ddc8c[0x0];if(!_0x362873[_0x69df('0x4a')]['UserId'])return;return db['User'][_0x69df('0x49')]({'where':{'id':_0x362873[_0x69df('0x4a')]['UserId'],'role':_0x69df('0x6c')},'attributes':['id',_0x69df('0x2c'),_0x69df('0x7d'),_0x69df('0x7e'),_0x69df('0x7f')],'raw':!![]});}return null;})['then'](function(_0x4609a){if(!_0x4609a)return null;_0x1adaab[_0x69df('0x20')][_0x69df('0x6c')]=_0x4609a;return _0x1adaab;})[_0x69df('0x18')](function(_0x153ff2){if(_0x153ff2){if(_0x362873['body'][_0x69df('0x80')]){_0x1adaab['message'][_0x69df('0x81')]=util['format']('SIP/%s',_0x362873[_0x69df('0x6b')][_0x69df('0x2c')]);_0x1adaab[_0x69df('0x20')][_0x69df('0x82')]=_0x1adaab[_0x69df('0x82')];_0x1adaab[_0x69df('0x20')][_0x69df('0x83')]=_0x1adaab['channel'];_0x1adaab[_0x69df('0x20')][_0x69df('0x84')]='accept';_0x1adaab['message'][_0x69df('0x4a')]=htmlToText[_0x69df('0x85')](_0x1adaab[_0x69df('0x20')][_0x69df('0x4a')]);return respondWithRpcPromise(_0x69df('0x86'),_0x69df('0x86'),{'event':_0x69df('0x87'),'message':_0x1adaab['message']},client9002)[_0x69df('0x18')](function(){return _0x1adaab;});}return _0x1adaab;}return null;})[_0x69df('0x18')](respondWithResult(_0x2d302a,null))[_0x69df('0x22')](handleError(_0x2d302a,null));};exports[_0x69df('0x88')]=function(_0x3869f5,_0x3a21e3){var _0x43a06e={'agent':{},'channel':_0x69df('0x89')};if(_0x3869f5['body']['id']){delete _0x3869f5[_0x69df('0x4a')]['id'];}_0x3869f5[_0x69df('0x4a')][_0x69df('0x6a')]=_0x3869f5['body'][_0x69df('0x6a')]||_0x3869f5[_0x69df('0x6b')]['id'];_0x43a06e[_0x69df('0x6c')]['id']=_0x3869f5[_0x69df('0x4a')][_0x69df('0x6a')];return db[_0x69df('0x2d')]['find']({'where':{'id':_0x3869f5[_0x69df('0x48')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a21e3,null))['then'](function(_0x5a88c5){if(_0x5a88c5){_0x43a06e['message']=_0x5a88c5[_0x69df('0x6d')]({'plain':!![]});return db['MailInteraction'][_0x69df('0x49')]({'where':{'id':_0x5a88c5[_0x69df('0x6f')]}});}return null;})[_0x69df('0x18')](handleEntityNotFound(_0x3a21e3,null))[_0x69df('0x18')](function(_0x217dcf){if(_0x217dcf){_0x43a06e[_0x69df('0x74')]=_0x217dcf[_0x69df('0x6d')]({'plain':!![]});interaction_log[_0x69df('0x19')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3869f5[_0x69df('0x6b')]['id'],_0x3869f5[_0x69df('0x6b')][_0x69df('0x2c')],_0x3869f5['user']['role'],_0x43a06e['interaction']['id'],_0x3869f5[_0x69df('0x4a')]?JSON[_0x69df('0x66')](_0x3869f5[_0x69df('0x4a')]):_0x69df('0x75'));return respondWithRpcPromise(_0x69df('0x8a'),_0x69df('0x8b'),_0x43a06e);}return null;})[_0x69df('0x18')](function(_0x341315){var _0x49aebb=_0x69df('0x78')+_0x341315[_0x69df('0x20')]['ContactId'];return db[_0x69df('0x8c')]['query'](_0x49aebb,{'type':db[_0x69df('0x7a')][_0x69df('0x7b')][_0x69df('0x8d')],'raw':!![]})['then'](function(_0xea1087){return _0xea1087;});})['then'](function(_0x5966d1){if(_0x5966d1){_0x43a06e[_0x69df('0x20')][_0x69df('0x7c')]=_0x5966d1[0x0];if(!_0x3869f5['body'][_0x69df('0x6a')])return;return db[_0x69df('0x8e')][_0x69df('0x49')]({'where':{'id':_0x3869f5[_0x69df('0x4a')][_0x69df('0x6a')],'role':_0x69df('0x6c')},'attributes':['id',_0x69df('0x2c'),_0x69df('0x7d'),_0x69df('0x7e'),_0x69df('0x7f')],'raw':!![]});}return null;})[_0x69df('0x18')](function(_0x32a044){if(!_0x32a044)return null;_0x43a06e['message']['agent']=_0x32a044;return _0x43a06e;})[_0x69df('0x18')](function(_0x13de62){if(_0x13de62){_0x13de62['message']['interface']=util['format'](_0x69df('0x8f'),_0x3869f5['user']['name']);_0x13de62['message'][_0x69df('0x82')]=_0x43a06e[_0x69df('0x82')];_0x13de62[_0x69df('0x20')]['motionChannel']=_0x43a06e[_0x69df('0x82')];_0x13de62[_0x69df('0x20')][_0x69df('0x84')]='reject';_0x13de62[_0x69df('0x20')][_0x69df('0x4a')]=htmlToText[_0x69df('0x85')](_0x43a06e[_0x69df('0x20')][_0x69df('0x4a')]);respondWithRpcPromise(_0x69df('0x86'),_0x69df('0x86'),{'event':'rejectmessage','message':_0x13de62[_0x69df('0x20')]},client9002);return _0x43a06e;}return null;})['then'](respondWithResult(_0x3a21e3,null))[_0x69df('0x22')](handleError(_0x3a21e3,null));};exports['download']=function(_0x66d270,_0x4eec73){var _0x4a06bf=moment()[_0x69df('0x90')]()[_0x69df('0x91')]();var _0x590742=path[_0x69df('0x5d')](config['root'],_0x69df('0x92'),'files','tmp');var _0x928310=path[_0x69df('0x5d')](config[_0x69df('0x5e')],_0x69df('0x92'),_0x69df('0x93'),_0x69df('0x5c'));var _0x2fb737=util[_0x69df('0x65')]('message-%s.eml',_0x4a06bf);return db['MailMessage']['find']({'where':{'id':_0x66d270[_0x69df('0x48')]['id']},'attributes':['id',_0x69df('0x4a'),'from','to','cc',_0x69df('0x94'),_0x69df('0x95'),_0x69df('0x96')],'include':_0x66d270['query'][_0x69df('0x5c')]?[{'model':db[_0x69df('0x97')],'as':_0x69df('0x98')}]:undefined})['then'](handleEntityNotFound(_0x4eec73,null))[_0x69df('0x18')](function(_0x3f393a){if(_0x3f393a){var _0x46e496=_0x3f393a;var _0x466e1e={'from':_0x46e496[_0x69df('0x99')],'to':_0x46e496['to'],'subject':_0x46e496[_0x69df('0x95')],'html':htmlEntities[_0x69df('0x9a')](_0x46e496[_0x69df('0x4a')]),'headers':{'Date':moment(_0x46e496[_0x69df('0x96')])[_0x69df('0x65')](_0x69df('0x9b'))},'attachments':[]};if(_0x3f393a['cc']){_0x466e1e[_0x69df('0x9c')]['Cc']=_0x3f393a['cc'];}if(_0x3f393a['bcc']){_0x466e1e[_0x69df('0x9c')][_0x69df('0x9d')]=_0x3f393a['bcc'];}return new BPromise(function(_0x1823fb,_0xbe5ab6){if(_0x3f393a['Attachments']){for(var _0x5a9892=0x0;_0x5a9892<_0x3f393a['Attachments'][_0x69df('0x39')];_0x5a9892++){var _0x2989ca=_0x3f393a[_0x69df('0x98')][_0x5a9892];var _0x48063e=path[_0x69df('0x5d')](_0x928310,_0x2989ca[_0x69df('0x9e')]);if(fs[_0x69df('0x9f')](_0x48063e)){_0x466e1e[_0x69df('0x5c')][_0x69df('0xa0')]({'name':_0x2989ca[_0x69df('0x2c')],'contentType':_0x2989ca['type'],'data':fs[_0x69df('0xa1')](_0x48063e)});}}}emlformat[_0x69df('0xa2')](_0x466e1e,function(_0x3dee45,_0x354c24){if(_0x3dee45)return _0xbe5ab6(_0x3dee45);fs[_0x69df('0xa3')](path[_0x69df('0x5d')](_0x590742,_0x2fb737),_0x354c24);return _0x1823fb(_0x354c24);});});}})[_0x69df('0x18')](function(_0x3cd6b4){if(_0x3cd6b4){return _0x4eec73[_0x69df('0xa4')](path[_0x69df('0x5d')](_0x590742,_0x2fb737),_0x2fb737,function(_0x22db63){if(!_0x22db63)fs[_0x69df('0xa5')](path[_0x69df('0x5d')](_0x590742,_0x2fb737));});}})[_0x69df('0x22')](handleError(_0x4eec73,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 8023e53..88fefaa 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 _0x0bfe=['update','emit','hasOwnProperty','hook','events','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x582210,_0x184c36){var _0x18cf58=function(_0x3257b5){while(--_0x3257b5){_0x582210['push'](_0x582210['shift']());}};_0x18cf58(++_0x184c36);}(_0x0bfe,0x134));var _0xe0bf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0bfe[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0xe0bf('0x0'));var MailMessage=require(_0xe0bf('0x1'))['db'][_0xe0bf('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xe0bf('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe0bf('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5ef9d2){return function(_0x44c3e7,_0x4d878b,_0x48172c){MailMessageEvents[_0xe0bf('0x5')](_0x5ef9d2+':'+_0x44c3e7['id'],_0x44c3e7);MailMessageEvents[_0xe0bf('0x5')](_0x5ef9d2,_0x44c3e7);_0x48172c(null);};}for(var e in events){if(events[_0xe0bf('0x6')](e)){var event=events[e];MailMessage[_0xe0bf('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xfe3a=['../../mysqldb','MailMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x227478,_0x18c521){var _0x39c694=function(_0x5112ec){while(--_0x5112ec){_0x227478['push'](_0x227478['shift']());}};_0x39c694(++_0x18c521);}(_0xfe3a,0xef));var _0xafe3=function(_0x38b945,_0x847ad5){_0x38b945=_0x38b945-0x0;var _0x3dcdb7=_0xfe3a[_0x38b945];return _0x3dcdb7;};'use strict';var EventEmitter=require(_0xafe3('0x0'));var MailMessage=require(_0xafe3('0x1'))['db'][_0xafe3('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xafe3('0x3')](0x0);var events={'afterCreate':_0xafe3('0x4'),'afterUpdate':_0xafe3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4ff9b1){return function(_0x2f12e4,_0x13f1d2,_0x2e8aae){MailMessageEvents[_0xafe3('0x6')](_0x4ff9b1+':'+_0x2f12e4['id'],_0x2f12e4);MailMessageEvents[_0xafe3('0x6')](_0x4ff9b1,_0x2f12e4);_0x2e8aae(null);};}for(var e in events){if(events[_0xafe3('0x7')](e)){var event=events[e];MailMessage[_0xafe3('0x8')](e,emitEvent(event));}}module[_0xafe3('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 397ca2f..49b4d86 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 _0x2b53=['bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b53,0x16d));var _0x32b5=function(_0x9d806f,_0x486ab0){_0x9d806f=_0x9d806f-0x0;var _0x1fad91=_0x2b53[_0x9d806f];return _0x1fad91;};'use strict';var _=require(_0x32b5('0x0'));var util=require(_0x32b5('0x1'));var logger=require(_0x32b5('0x2'))(_0x32b5('0x3'));var moment=require(_0x32b5('0x4'));var BPromise=require(_0x32b5('0x5'));var rp=require(_0x32b5('0x6'));var htmlToText=require(_0x32b5('0x7'));var fs=require('fs');var path=require(_0x32b5('0x8'));var rimraf=require(_0x32b5('0x9'));var config=require(_0x32b5('0xa'));var attributes=require(_0x32b5('0xb'));module[_0x32b5('0xc')]=function(_0x41fa46,_0x325ace){return _0x41fa46[_0x32b5('0xd')](_0x32b5('0xe'),attributes,{'tableName':_0x32b5('0xf'),'paranoid':![],'indexes':[{'name':_0x32b5('0x10'),'fields':['messageId']},{'name':_0x32b5('0x11'),'fields':[_0x32b5('0x12'),_0x32b5('0x13')],'type':_0x32b5('0x14')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2e7d32,_0x395858,_0x5bb22b){if(_0x2e7d32['body']){_0x2e7d32['plainBody']=htmlToText['fromString'](_0x2e7d32['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5bb22b(null,_0x395858);},'afterCreate':function(_0x9a2493,_0x3d8099,_0x167508){var _0x51f795=_0x41fa46[_0x32b5('0x15')];var _0x1a4573=_0x9a2493[_0x32b5('0x16')]({'plain':!![]});if(_0x1a4573[_0x32b5('0x17')][_0x32b5('0x18')]()==='in'||_0x1a4573[_0x32b5('0x17')][_0x32b5('0x18')]()===_0x32b5('0x19')&&!_0x1a4573[_0x32b5('0x1a')]&&!_[_0x32b5('0x1b')](_0x1a4573[_0x32b5('0x1c')])){_0x51f795['MailInteraction'][_0x32b5('0x1d')]({'where':{'id':_0x1a4573['MailInteractionId']}})[_0x32b5('0x1e')](function(_0x44aef7){if(_0x44aef7){_0x44aef7[_0x32b5('0x1f')]({'lastMsgAt':_0x1a4573[_0x32b5('0x20')],'lastMsgDirection':_0x1a4573[_0x32b5('0x17')][_0x32b5('0x18')]()});}})[_0x32b5('0x21')](function(_0x3c0f01){console[_0x32b5('0x22')](_0x3c0f01);});}_0x167508();}},'charset':_0x32b5('0x23'),'collate':_0x32b5('0x24')});}; \ No newline at end of file +var _0x3fab=['secret','isNil','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path','./mailMessage.attributes','exports','define','mail_messages','messageId','plainBody','subject','body','models','get','toLowerCase','direction'];(function(_0x34cd18,_0x3adeb7){var _0x21dfd9=function(_0x31c91a){while(--_0x31c91a){_0x34cd18['push'](_0x34cd18['shift']());}};_0x21dfd9(++_0x3adeb7);}(_0x3fab,0x1cb));var _0xb3fa=function(_0x54d9ed,_0x34e17d){_0x54d9ed=_0x54d9ed-0x0;var _0x38fe3b=_0x3fab[_0x54d9ed];return _0x38fe3b;};'use strict';var _=require('lodash');var util=require(_0xb3fa('0x0'));var logger=require(_0xb3fa('0x1'))(_0xb3fa('0x2'));var moment=require('moment');var BPromise=require(_0xb3fa('0x3'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xb3fa('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb3fa('0x5'));module[_0xb3fa('0x6')]=function(_0x3a717e,_0x3f437b){return _0x3a717e[_0xb3fa('0x7')]('MailMessage',attributes,{'tableName':_0xb3fa('0x8'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xb3fa('0x9')]},{'name':'fti_mail_messages','fields':[_0xb3fa('0xa'),_0xb3fa('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x53c81c,_0x54e588,_0x3b6503){if(_0x53c81c[_0xb3fa('0xc')]){_0x53c81c['plainBody']=htmlToText['fromString'](_0x53c81c[_0xb3fa('0xc')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3b6503(null,_0x54e588);},'afterCreate':function(_0xc06dc9,_0x33d8bc,_0x23c794){var _0x363db1=_0x3a717e[_0xb3fa('0xd')];var _0x5d7070=_0xc06dc9[_0xb3fa('0xe')]({'plain':!![]});if(_0x5d7070['direction'][_0xb3fa('0xf')]()==='in'||_0x5d7070[_0xb3fa('0x10')][_0xb3fa('0xf')]()==='out'&&!_0x5d7070[_0xb3fa('0x11')]&&!_[_0xb3fa('0x12')](_0x5d7070['UserId'])){_0x363db1['MailInteraction'][_0xb3fa('0x13')]({'where':{'id':_0x5d7070[_0xb3fa('0x14')]}})[_0xb3fa('0x15')](function(_0x46a832){if(_0x46a832){_0x46a832[_0xb3fa('0x16')]({'lastMsgAt':_0x5d7070[_0xb3fa('0x17')],'lastMsgDirection':_0x5d7070[_0xb3fa('0x10')][_0xb3fa('0xf')]()});}})[_0xb3fa('0x18')](function(_0x547437){console[_0xb3fa('0x19')](_0x547437);});}_0x23c794();}},'charset':_0xb3fa('0x1a'),'collate':_0xb3fa('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 2d0ba90..3798666 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 _0x5eb8=['client','http','defaults','redis','localhost','register','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','MailMessage,\x20%s,\x20%s','message','result','catch','options','raw','then','stringify','CreateMailMessage','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x58f6f3,_0x154385){var _0x17c6c2=function(_0x516145){while(--_0x516145){_0x58f6f3['push'](_0x58f6f3['shift']());}};_0x17c6c2(++_0x154385);}(_0x5eb8,0xb0));var _0x85eb=function(_0x614ef4,_0x28a060){_0x614ef4=_0x614ef4-0x0;var _0x35e8e2=_0x5eb8[_0x614ef4];return _0x35e8e2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});config['redis']=_[_0x85eb('0xc')](config[_0x85eb('0xd')],{'host':_0x85eb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85eb('0xd')]));require('./mailMessage.socket')[_0x85eb('0xf')](socket);function respondWithRpcPromise(_0x40d6b6,_0x673228,_0x29030b){return new BPromise(function(_0x1dacf2,_0x73e6d0){return client[_0x85eb('0x10')](_0x40d6b6,_0x29030b)['then'](function(_0x163f32){logger[_0x85eb('0x11')]('MailMessage,\x20%s,\x20%s',_0x673228,_0x85eb('0x12'));logger[_0x85eb('0x13')](_0x85eb('0x14'),_0x673228,_0x85eb('0x12'),JSON['stringify'](_0x163f32));if(_0x163f32['error']){if(_0x163f32[_0x85eb('0x15')]['code']===0x1f4){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x73e6d0(_0x163f32[_0x85eb('0x15')]['message']);}logger[_0x85eb('0x15')]('MailMessage,\x20%s,\x20%s',_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x1dacf2(_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x673228,'request\x20sent');_0x1dacf2(_0x163f32[_0x85eb('0x18')][_0x85eb('0x17')]);}})[_0x85eb('0x19')](function(_0x2e986c){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x2e986c);_0x73e6d0(_0x2e986c);});});}exports['CreateMailMessage']=function(_0x24cf28){var _0x7244fc=this;return new Promise(function(_0xd9f06d,_0x4e8041){return db['MailMessage']['create'](_0x24cf28['body'],{'raw':_0x24cf28[_0x85eb('0x1a')]?_0x24cf28[_0x85eb('0x1a')][_0x85eb('0x1b')]===undefined?!![]:![]:!![]})[_0x85eb('0x1c')](function(_0x465c74){logger[_0x85eb('0x11')]('CreateMailMessage',_0x24cf28);logger['debug']('CreateMailMessage',_0x24cf28,JSON[_0x85eb('0x1d')](_0x465c74));_0xd9f06d(_0x465c74);})[_0x85eb('0x19')](function(_0x3f7a4d){logger[_0x85eb('0x15')](_0x85eb('0x1e'),_0x3f7a4d[_0x85eb('0x17')],_0x24cf28);_0x4e8041(_0x7244fc['error'](0x1f4,_0x3f7a4d[_0x85eb('0x17')]));});});}; \ No newline at end of file +var _0x4fc2=['message','info','result','catch','CreateMailMessage','MailMessage','body','options','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x4fc2,0x111));var _0x24fc=function(_0x543a89,_0x31e8fd){_0x543a89=_0x543a89-0x0;var _0x52c8a9=_0x4fc2[_0x543a89];return _0x52c8a9;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});config['redis']=_[_0x24fc('0xb')](config[_0x24fc('0xc')],{'host':_0x24fc('0xd'),'port':0x18eb});var socket=require(_0x24fc('0xe'))(new Redis(config[_0x24fc('0xc')]));require(_0x24fc('0xf'))['register'](socket);function respondWithRpcPromise(_0x44caca,_0x1819a5,_0x1a4462){return new BPromise(function(_0x133438,_0x24998d){return client[_0x24fc('0x10')](_0x44caca,_0x1a4462)[_0x24fc('0x11')](function(_0x9a1673){logger['info'](_0x24fc('0x12'),_0x1819a5,_0x24fc('0x13'));logger['debug'](_0x24fc('0x14'),_0x1819a5,_0x24fc('0x13'),JSON[_0x24fc('0x15')](_0x9a1673));if(_0x9a1673[_0x24fc('0x16')]){if(_0x9a1673[_0x24fc('0x16')][_0x24fc('0x17')]===0x1f4){logger['error'](_0x24fc('0x12'),_0x1819a5,_0x9a1673[_0x24fc('0x16')][_0x24fc('0x18')]);return _0x24998d(_0x9a1673[_0x24fc('0x16')]['message']);}logger[_0x24fc('0x16')]('MailMessage,\x20%s,\x20%s',_0x1819a5,_0x9a1673[_0x24fc('0x16')][_0x24fc('0x18')]);return _0x133438(_0x9a1673[_0x24fc('0x16')][_0x24fc('0x18')]);}else{logger[_0x24fc('0x19')]('MailMessage,\x20%s,\x20%s',_0x1819a5,_0x24fc('0x13'));_0x133438(_0x9a1673[_0x24fc('0x1a')][_0x24fc('0x18')]);}})[_0x24fc('0x1b')](function(_0x4c5a43){logger[_0x24fc('0x16')](_0x24fc('0x12'),_0x1819a5,_0x4c5a43);_0x24998d(_0x4c5a43);});});}exports[_0x24fc('0x1c')]=function(_0x5b0516){var _0x32a57d=this;return new Promise(function(_0x36a771,_0xbf1d6b){return db[_0x24fc('0x1d')]['create'](_0x5b0516[_0x24fc('0x1e')],{'raw':_0x5b0516['options']?_0x5b0516[_0x24fc('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x24fc('0x11')](function(_0x44c121){logger[_0x24fc('0x19')]('CreateMailMessage',_0x5b0516);logger[_0x24fc('0x20')]('CreateMailMessage',_0x5b0516,JSON[_0x24fc('0x15')](_0x44c121));_0x36a771(_0x44c121);})[_0x24fc('0x1b')](function(_0x36a9b4){logger[_0x24fc('0x16')](_0x24fc('0x1c'),_0x36a9b4[_0x24fc('0x18')],_0x5b0516);_0xbf1d6b(_0x32a57d[_0x24fc('0x16')](0x1f4,_0x36a9b4[_0x24fc('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 2ffaac9..fb62ac8 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 _0xfa38=['removeListener','register','length','mailMessage:','./mailMessage.events','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfa38,0x97));var _0x8fa3=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfa38[_0x2dafbe];return _0x58a45a;};'use strict';var MailMessageEvents=require(_0x8fa3('0x0'));var events=[_0x8fa3('0x1'),'remove','update'];function createListener(_0x2708c7,_0x33ae0a){return function(_0x31e591){_0x33ae0a[_0x8fa3('0x2')](_0x2708c7,_0x31e591);};}function removeListener(_0x4ae958,_0xde7d91){return function(){MailMessageEvents[_0x8fa3('0x3')](_0x4ae958,_0xde7d91);};}exports[_0x8fa3('0x4')]=function(_0x1bc11f){for(var _0x1b49e8=0x0,_0x355cb3=events[_0x8fa3('0x5')];_0x1b49e8<_0x355cb3;_0x1b49e8++){var _0x49308e=events[_0x1b49e8];var _0x16766a=createListener(_0x8fa3('0x6')+_0x49308e,_0x1bc11f);MailMessageEvents['on'](_0x49308e,_0x16766a);}}; \ No newline at end of file +var _0xa79e=['register','length','./mailMessage.events','remove','update'];(function(_0x24106c,_0x367a6f){var _0xbaeb73=function(_0x483603){while(--_0x483603){_0x24106c['push'](_0x24106c['shift']());}};_0xbaeb73(++_0x367a6f);}(_0xa79e,0xf7));var _0xea79=function(_0x46451c,_0x88ddd){_0x46451c=_0x46451c-0x0;var _0x12dce4=_0xa79e[_0x46451c];return _0x12dce4;};'use strict';var MailMessageEvents=require(_0xea79('0x0'));var events=['save',_0xea79('0x1'),_0xea79('0x2')];function createListener(_0x1bc135,_0x43bf5b){return function(_0x5a331b){_0x43bf5b['emit'](_0x1bc135,_0x5a331b);};}function removeListener(_0x124444,_0x4dced6){return function(){MailMessageEvents['removeListener'](_0x124444,_0x4dced6);};}exports[_0xea79('0x3')]=function(_0x29907d){for(var _0x5836de=0x0,_0x1b0770=events[_0xea79('0x4')];_0x5836de<_0x1b0770;_0x5836de++){var _0x448c7e=events[_0x5836de];var _0x59ab11=createListener('mailMessage:'+_0x448c7e,_0x29907d);MailMessageEvents['on'](_0x448c7e,_0x59ab11);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 64ff827..08d2612 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 _0x715c=['create','/:id/users','addAgents','put','update','delete','destroy','/:id/teams','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getAgents','post'];(function(_0x396b05,_0x268924){var _0x45bb7a=function(_0x4a0d2f){while(--_0x4a0d2f){_0x396b05['push'](_0x396b05['shift']());}};_0x45bb7a(++_0x268924);}(_0x715c,0xb9));var _0xc715=function(_0x4365ca,_0x36a835){_0x4365ca=_0x4365ca-0x0;var _0x18fff8=_0x715c[_0x4365ca];return _0x18fff8;};'use strict';var multer=require(_0xc715('0x0'));var util=require(_0xc715('0x1'));var path=require(_0xc715('0x2'));var timeout=require(_0xc715('0x3'));var express=require(_0xc715('0x4'));var router=express[_0xc715('0x5')]();var fs_extra=require(_0xc715('0x6'));var auth=require(_0xc715('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc715('0x8'));var controller=require('./mailQueue.controller');router[_0xc715('0x9')]('/',auth[_0xc715('0xa')](),controller[_0xc715('0xb')]);router[_0xc715('0x9')](_0xc715('0xc'),auth[_0xc715('0xa')](),controller[_0xc715('0xd')]);router[_0xc715('0x9')](_0xc715('0xe'),auth[_0xc715('0xa')](),controller[_0xc715('0xf')]);router[_0xc715('0x9')]('/:id/members',auth[_0xc715('0xa')](),controller['getMembers']);router[_0xc715('0x9')]('/:id/teams',auth[_0xc715('0xa')](),controller['getTeams']);router[_0xc715('0x9')]('/:id/users',auth[_0xc715('0xa')](),controller[_0xc715('0x10')]);router[_0xc715('0x11')]('/',auth['isAuthenticated'](),controller[_0xc715('0x12')]);router[_0xc715('0x11')]('/:id/teams',auth[_0xc715('0xa')](),controller['addTeams']);router[_0xc715('0x11')](_0xc715('0x13'),auth[_0xc715('0xa')](),controller[_0xc715('0x14')]);router[_0xc715('0x15')](_0xc715('0xe'),auth['isAuthenticated'](),controller[_0xc715('0x16')]);router[_0xc715('0x17')](_0xc715('0xe'),auth['isAuthenticated'](),controller[_0xc715('0x18')]);router[_0xc715('0x17')](_0xc715('0x19'),auth[_0xc715('0xa')](),controller[_0xc715('0x1a')]);router[_0xc715('0x17')](_0xc715('0x13'),auth[_0xc715('0xa')](),controller[_0xc715('0x1b')]);module[_0xc715('0x1c')]=router; \ No newline at end of file +var _0xab16=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','/:id','show','get','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','destroy','delete','removeTeams','removeAgents'];(function(_0xfdd85,_0x4a65be){var _0x57e037=function(_0x401d99){while(--_0x401d99){_0xfdd85['push'](_0xfdd85['shift']());}};_0x57e037(++_0x4a65be);}(_0xab16,0x1b4));var _0x6ab1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xab16[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x6ab1('0x0'));var path=require(_0x6ab1('0x1'));var timeout=require(_0x6ab1('0x2'));var express=require('express');var router=express[_0x6ab1('0x3')]();var fs_extra=require(_0x6ab1('0x4'));var auth=require(_0x6ab1('0x5'));var interaction=require(_0x6ab1('0x6'));var config=require(_0x6ab1('0x7'));var controller=require('./mailQueue.controller');router['get']('/',auth[_0x6ab1('0x8')](),controller['index']);router['get'](_0x6ab1('0x9'),auth[_0x6ab1('0x8')](),controller['describe']);router['get'](_0x6ab1('0xa'),auth[_0x6ab1('0x8')](),controller[_0x6ab1('0xb')]);router[_0x6ab1('0xc')](_0x6ab1('0xd'),auth[_0x6ab1('0x8')](),controller[_0x6ab1('0xe')]);router[_0x6ab1('0xc')](_0x6ab1('0xf'),auth[_0x6ab1('0x8')](),controller[_0x6ab1('0x10')]);router['get'](_0x6ab1('0x11'),auth[_0x6ab1('0x8')](),controller[_0x6ab1('0x12')]);router[_0x6ab1('0x13')]('/',auth['isAuthenticated'](),controller[_0x6ab1('0x14')]);router[_0x6ab1('0x13')](_0x6ab1('0xf'),auth[_0x6ab1('0x8')](),controller['addTeams']);router['post']('/:id/users',auth[_0x6ab1('0x8')](),controller[_0x6ab1('0x15')]);router[_0x6ab1('0x16')](_0x6ab1('0xa'),auth[_0x6ab1('0x8')](),controller[_0x6ab1('0x17')]);router['delete'](_0x6ab1('0xa'),auth[_0x6ab1('0x8')](),controller[_0x6ab1('0x18')]);router[_0x6ab1('0x19')](_0x6ab1('0xf'),auth['isAuthenticated'](),controller[_0x6ab1('0x1a')]);router[_0x6ab1('0x19')]('/:id/users',auth[_0x6ab1('0x8')](),controller[_0x6ab1('0x1b')]);module[_0x6ab1('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 b6add15..948eb76 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 _0xdaff=['INTEGER','ENUM','rrmemory','sequelize','exports','name'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xdaff,0x1bf));var _0xfdaf=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xdaff[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xfdaf('0x0'));module[_0xfdaf('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xfdaf('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xfdaf('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfdaf('0x4')](_0xfdaf('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x8cab=['sequelize','exports','name','STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x139e35,_0x939ac1){var _0x4b501b=function(_0x3406b2){while(--_0x3406b2){_0x139e35['push'](_0x139e35['shift']());}};_0x4b501b(++_0x939ac1);}(_0x8cab,0x160));var _0xb8ca=function(_0xcc04a0,_0x19721f){_0xcc04a0=_0xcc04a0-0x0;var _0x40a5de=_0x8cab[_0xcc04a0];return _0x40a5de;};'use strict';var Sequelize=require(_0xb8ca('0x0'));module[_0xb8ca('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb8ca('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb8ca('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb8ca('0x4')](_0xb8ca('0x5'),_0xb8ca('0x6'),_0xb8ca('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 1eea6f3..f809b10 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 _0xe11d=['emit','userMailQueue:remove','addAgents','spread','userMailQueue:save','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','status','end','json','offset','count','set','then','destroy','UserProfileResource','sendStatus','error','stack','name','index','map','MailQueue','rawAttributes','fieldName','key','getOptions','include','findAll','rows','catch','params','model','keys','query','filters','attributes','intersection','fields','length','includeAll','merge','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserMailQueue','hasOwnProperty','nolimit','limit','order','where','pick','MailQueueId','filter','User','UserId','mailPause','createdAt','%s/%s','updatedAt','getTeams','Team','sort','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','forEach','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','union','compact','value','transaction','removeTeams','isEmpty','removeAgents'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe11d,0x1db));var _0xde11=function(_0xb10fa6,_0x1789be){_0xb10fa6=_0xb10fa6-0x0;var _0x4d9e8b=_0xe11d[_0xb10fa6];return _0x4d9e8b;};'use strict';var BPromise=require(_0xde11('0x0'));var util=require(_0xde11('0x1'));var _=require(_0xde11('0x2'));var squel=require(_0xde11('0x3'));var Redis=require(_0xde11('0x4'));var qs=require(_0xde11('0x5'));var logger=require('../../config/logger')(_0xde11('0x6'));var config=require(_0xde11('0x7'));var db=require(_0xde11('0x8'))['db'];config[_0xde11('0x9')]=_[_0xde11('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xde11('0xb'))(new Redis(config[_0xde11('0x9')]));require('./mailQueue.socket')[_0xde11('0xc')](socket);function respondWithStatusCode(_0x3be8a7,_0x52af8b){_0x52af8b=_0x52af8b||0xcc;return function(_0x457199){if(_0x457199){return _0x3be8a7['sendStatus'](_0x52af8b);}return _0x3be8a7[_0xde11('0xd')](_0x52af8b)[_0xde11('0xe')]();};}function respondWithResult(_0x33ed2e,_0x5f4b89){_0x5f4b89=_0x5f4b89||0xc8;return function(_0x5f0149){if(_0x5f0149){return _0x33ed2e[_0xde11('0xd')](_0x5f4b89)[_0xde11('0xf')](_0x5f0149);}};}function respondWithFilteredResult(_0x3118d1,_0x4e01a1){return function(_0x1229fc){if(_0x1229fc){var _0x48dcb4=typeof _0x4e01a1[_0xde11('0x10')]==='undefined'&&typeof _0x4e01a1['limit']==='undefined';var _0x240dc5=_0x1229fc[_0xde11('0x11')];var _0x5884bc=_0x48dcb4?0x0:_0x4e01a1['offset'];var _0x53871c=_0x48dcb4?_0x1229fc['count']:_0x4e01a1[_0xde11('0x10')]+_0x4e01a1['limit'];var _0x480161;if(_0x53871c>=_0x240dc5){_0x53871c=_0x240dc5;_0x480161=0xc8;}else{_0x480161=0xce;}_0x3118d1[_0xde11('0xd')](_0x480161);return _0x3118d1[_0xde11('0x12')]('Content-Range',_0x5884bc+'-'+_0x53871c+'/'+_0x240dc5)[_0xde11('0xf')](_0x1229fc);}return null;};}function saveUpdates(_0x45efeb){return function(_0x3acf4c){if(_0x3acf4c){return _0x3acf4c['update'](_0x45efeb)[_0xde11('0x13')](function(_0x280f88){return _0x280f88;});}return null;};}function removeEntity(_0x1ec4d8){return function(_0xd05230){if(_0xd05230){return _0xd05230[_0xde11('0x14')]()[_0xde11('0x13')](function(){var _0x193df7=_0xd05230['get']({'plain':!![]});var _0x58658c='MailQueues';return db[_0xde11('0x15')][_0xde11('0x14')]({'where':{'type':_0x58658c,'resourceId':_0x193df7['id']}})[_0xde11('0x13')](function(){return _0xd05230;});})[_0xde11('0x13')](function(){_0x1ec4d8[_0xde11('0xd')](0xcc)[_0xde11('0xe')]();});}};}function handleEntityNotFound(_0x4a138e){return function(_0x4ada89){if(!_0x4ada89){_0x4a138e[_0xde11('0x16')](0x194);}return _0x4ada89;};}function handleError(_0x10a5f2,_0x30f764){_0x30f764=_0x30f764||0x1f4;return function(_0x42d0bb){logger[_0xde11('0x17')](_0x42d0bb[_0xde11('0x18')]);if(_0x42d0bb[_0xde11('0x19')]){delete _0x42d0bb['name'];}_0x10a5f2[_0xde11('0xd')](_0x30f764)['send'](_0x42d0bb);};}exports[_0xde11('0x1a')]=function(_0x5e1588,_0x3918b2){var _0xe8d916={};var _0x5686f5={'count':0x0,'rows':[]};var _0x1cb57e=_[_0xde11('0x1b')](db[_0xde11('0x1c')][_0xde11('0x1d')],function(_0x4501eb){return{'name':_0x4501eb[_0xde11('0x1e')],'type':_0x4501eb['type'][_0xde11('0x1f')]};});_0xe8d916=qs[_0xde11('0x20')](_0x1cb57e,_0x5e1588);var _0x5a1738={'where':_0xe8d916['where']};return db[_0xde11('0x1c')]['count'](_0x5a1738)[_0xde11('0x13')](function(_0x4a1a25){_0x5686f5['count']=_0x4a1a25;_0xe8d916[_0xde11('0x21')]=qs[_0xde11('0x21')](_0x5e1588['query']);return db[_0xde11('0x1c')][_0xde11('0x22')](_0xe8d916);})['then'](function(_0x7b1986){_0x5686f5[_0xde11('0x23')]=_0x7b1986;return _0x5686f5;})['then'](respondWithFilteredResult(_0x3918b2,_0xe8d916))[_0xde11('0x24')](handleError(_0x3918b2,null));};exports['show']=function(_0x4d7cd6,_0x188b42){var _0x3ba309={'raw':!![],'where':{'id':_0x4d7cd6[_0xde11('0x25')]['id']}},_0x1c3135={};_0x1c3135[_0xde11('0x26')]=_[_0xde11('0x27')](db[_0xde11('0x1c')]['rawAttributes']);_0x1c3135[_0xde11('0x28')]=_['keys'](_0x4d7cd6[_0xde11('0x28')]);_0x1c3135[_0xde11('0x29')]=_['intersection'](_0x1c3135['model'],_0x1c3135[_0xde11('0x28')]);_0x3ba309[_0xde11('0x2a')]=_[_0xde11('0x2b')](_0x1c3135[_0xde11('0x26')],qs[_0xde11('0x2c')](_0x4d7cd6[_0xde11('0x28')][_0xde11('0x2c')]));_0x3ba309[_0xde11('0x2a')]=_0x3ba309[_0xde11('0x2a')][_0xde11('0x2d')]?_0x3ba309['attributes']:_0x1c3135[_0xde11('0x26')];if(_0x4d7cd6[_0xde11('0x28')][_0xde11('0x2e')]){_0x3ba309[_0xde11('0x21')]=[{'all':!![]}];}_0x3ba309=_[_0xde11('0x2f')]({},_0x3ba309,_0x4d7cd6[_0xde11('0x30')]);return db[_0xde11('0x1c')][_0xde11('0x31')](_0x3ba309)[_0xde11('0x13')](handleEntityNotFound(_0x188b42,null))['then'](respondWithResult(_0x188b42,null))[_0xde11('0x24')](handleError(_0x188b42,null));};exports[_0xde11('0x32')]=function(_0x10f9b7,_0x64fb30){return db[_0xde11('0x1c')][_0xde11('0x32')](_0x10f9b7[_0xde11('0x33')],{})[_0xde11('0x13')](function(_0x122387){var _0x15a3fb=_0x10f9b7[_0xde11('0x34')][_0xde11('0x35')]({'plain':!![]});if(!_0x15a3fb)throw new Error(_0xde11('0x36'));if(_0x15a3fb[_0xde11('0x37')]==='user'){var _0x1ddfc6=_0x122387[_0xde11('0x35')]({'plain':!![]});var _0x2eb0e5=_0xde11('0x38');return db['UserProfileSection']['find']({'where':{'name':_0x2eb0e5,'userProfileId':_0x15a3fb[_0xde11('0x39')]},'raw':!![]})['then'](function(_0x37bc57){if(_0x37bc57&&_0x37bc57['autoAssociation']===0x0){return db[_0xde11('0x15')][_0xde11('0x32')]({'name':_0x1ddfc6[_0xde11('0x19')],'resourceId':_0x1ddfc6['id'],'type':_0x37bc57[_0xde11('0x19')],'sectionId':_0x37bc57['id']},{})[_0xde11('0x13')](function(){return _0x122387;});}else{return _0x122387;}})[_0xde11('0x24')](function(_0x59eee1){logger[_0xde11('0x17')](_0xde11('0x3a'),_0x59eee1);throw _0x59eee1;});}return _0x122387;})[_0xde11('0x13')](respondWithResult(_0x64fb30,0xc9))['catch'](handleError(_0x64fb30,null));};exports['update']=function(_0x403ee8,_0xc84436){if(_0x403ee8[_0xde11('0x33')]['id']){delete _0x403ee8[_0xde11('0x33')]['id'];}return db[_0xde11('0x1c')]['find']({'where':{'id':_0x403ee8[_0xde11('0x25')]['id']}})[_0xde11('0x13')](handleEntityNotFound(_0xc84436,null))[_0xde11('0x13')](saveUpdates(_0x403ee8[_0xde11('0x33')],null))[_0xde11('0x13')](respondWithResult(_0xc84436,null))['catch'](handleError(_0xc84436,null));};exports[_0xde11('0x14')]=function(_0x8cccde,_0x1669a5){return db[_0xde11('0x1c')][_0xde11('0x31')]({'where':{'id':_0x8cccde[_0xde11('0x25')]['id']}})[_0xde11('0x13')](handleEntityNotFound(_0x1669a5,null))[_0xde11('0x13')](removeEntity(_0x1669a5,null))[_0xde11('0x24')](handleError(_0x1669a5,null));};exports['describe']=function(_0x1198c7,_0xf40a10){return db['MailQueue']['describe']()[_0xde11('0x13')](respondWithResult(_0xf40a10,null))[_0xde11('0x24')](handleError(_0xf40a10,null));};exports[_0xde11('0x3b')]=function(_0x42170f,_0x591ffd){var _0x17c801={'raw':!![],'where':{}},_0x5d5105={},_0x285e75;return db['MailQueue'][_0xde11('0x3c')]({'where':{'id':_0x42170f['params']['id']}})[_0xde11('0x13')](handleEntityNotFound(_0x591ffd,null))[_0xde11('0x13')](function(_0x3ab780){if(_0x3ab780){_0x285e75=_0x3ab780[_0xde11('0x35')]({'plain':!![]});_0x5d5105[_0xde11('0x26')]=_[_0xde11('0x27')](db[_0xde11('0x3d')][_0xde11('0x1d')]);_0x5d5105[_0xde11('0x28')]=_[_0xde11('0x27')](_0x42170f[_0xde11('0x28')]);_0x5d5105[_0xde11('0x29')]=_[_0xde11('0x2b')](_0x5d5105[_0xde11('0x26')],_0x5d5105['query']);_0x17c801[_0xde11('0x2a')]=_[_0xde11('0x2b')](_0x5d5105[_0xde11('0x26')],qs['fields'](_0x42170f[_0xde11('0x28')]['fields']));_0x17c801[_0xde11('0x2a')]=_0x17c801['attributes'][_0xde11('0x2d')]?_0x17c801[_0xde11('0x2a')]:_0x5d5105[_0xde11('0x26')];if(!_0x42170f['query'][_0xde11('0x3e')](_0xde11('0x3f'))){_0x17c801[_0xde11('0x40')]=qs[_0xde11('0x40')](_0x42170f[_0xde11('0x28')][_0xde11('0x40')]);_0x17c801[_0xde11('0x10')]=qs[_0xde11('0x10')](_0x42170f['query'][_0xde11('0x10')]);}_0x17c801[_0xde11('0x41')]=qs['sort'](_0x42170f[_0xde11('0x28')]['sort']);_0x17c801[_0xde11('0x42')]=qs[_0xde11('0x29')](_[_0xde11('0x43')](_0x42170f[_0xde11('0x28')],_0x5d5105['filters']));_0x17c801[_0xde11('0x42')][_0xde11('0x44')]=_0x3ab780['id'];if(_0x42170f['query'][_0xde11('0x45')]){_0x17c801['where']=_[_0xde11('0x2f')](_0x17c801[_0xde11('0x42')],{'$or':_['map'](_0x17c801['attributes'],function(_0x1b2aee){var _0x141a33={};_0x141a33[_0x1b2aee]={'$like':'%'+_0x42170f[_0xde11('0x28')][_0xde11('0x45')]+'%'};return _0x141a33;})});}_0x17c801=_['merge']({},_0x17c801,_0x42170f[_0xde11('0x30')]);return db[_0xde11('0x3d')][_0xde11('0x22')](_0x17c801);}})['then'](function(_0x2b6bd6){if(_0x2b6bd6){return db[_0xde11('0x46')]['findAndCountAll']({'where':{'id':_[_0xde11('0x1b')](_0x2b6bd6,_0xde11('0x47')),'role':'agent'},'attributes':['id',_0xde11('0x19'),_0xde11('0x48'),'updatedAt',_0xde11('0x49')]});}})[_0xde11('0x13')](function(_0x45a5cd){if(_0x45a5cd){return{'count':_0x45a5cd['count'],'rows':_['map'](_0x45a5cd[_0xde11('0x23')],function(_0x4e497b){return{'membername':_0x4e497b[_0xde11('0x19')],'UserId':_0x4e497b['id'],'queue_name':_0x285e75['name'],'MailQueueId':_0x285e75['id'],'interface':util['format'](_0xde11('0x4a'),'SIP',_0x4e497b[_0xde11('0x19')]),'penalty':0x0,'paused':_0x4e497b[_0xde11('0x48')],'createdAt':_0x4e497b['createdAt'],'updatedAt':_0x4e497b[_0xde11('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xde11('0x13')](respondWithFilteredResult(_0x591ffd,_0x17c801))[_0xde11('0x24')](handleError(_0x591ffd,null));};exports[_0xde11('0x4c')]=function(_0x43b6a7,_0x200d60){var _0x2e5a24={};var _0xe55412={};var _0xa7646;var _0x173fd1;return db[_0xde11('0x1c')][_0xde11('0x3c')]({'where':{'id':_0x43b6a7['params']['id']}})['then'](handleEntityNotFound(_0x200d60,null))[_0xde11('0x13')](function(_0x5f556b){if(_0x5f556b){_0xa7646=_0x5f556b;_0xe55412['model']=_[_0xde11('0x27')](db[_0xde11('0x4d')]['rawAttributes']);_0xe55412['query']=_[_0xde11('0x27')](_0x43b6a7[_0xde11('0x28')]);_0xe55412[_0xde11('0x29')]=_['intersection'](_0xe55412[_0xde11('0x26')],_0xe55412[_0xde11('0x28')]);_0x2e5a24[_0xde11('0x2a')]=_[_0xde11('0x2b')](_0xe55412[_0xde11('0x26')],qs['fields'](_0x43b6a7[_0xde11('0x28')][_0xde11('0x2c')]));_0x2e5a24['attributes']=_0x2e5a24[_0xde11('0x2a')][_0xde11('0x2d')]?_0x2e5a24[_0xde11('0x2a')]:_0xe55412[_0xde11('0x26')];_0x2e5a24['order']=qs[_0xde11('0x4e')](_0x43b6a7['query'][_0xde11('0x4e')]);_0x2e5a24['where']=qs[_0xde11('0x29')](_[_0xde11('0x43')](_0x43b6a7[_0xde11('0x28')],_0xe55412[_0xde11('0x29')]));if(_0x43b6a7[_0xde11('0x28')]['filter']){_0x2e5a24['where']=_['merge'](_0x2e5a24['where'],{'$or':_[_0xde11('0x1b')](_0x2e5a24[_0xde11('0x2a')],function(_0x3d2851){var _0x1d46bf={};_0x1d46bf[_0x3d2851]={'$like':'%'+_0x43b6a7['query'][_0xde11('0x45')]+'%'};return _0x1d46bf;})});}_0x2e5a24=_[_0xde11('0x2f')]({},_0x2e5a24,_0x43b6a7['options']);return _0xa7646[_0xde11('0x4c')](_0x2e5a24);}})['then'](function(_0x4c4bba){if(_0x4c4bba){_0x173fd1=_0x4c4bba[_0xde11('0x2d')];if(!_0x43b6a7['query']['hasOwnProperty'](_0xde11('0x3f'))){_0x2e5a24[_0xde11('0x40')]=qs[_0xde11('0x40')](_0x43b6a7['query'][_0xde11('0x40')]);_0x2e5a24[_0xde11('0x10')]=qs['offset'](_0x43b6a7[_0xde11('0x28')]['offset']);}return _0xa7646[_0xde11('0x4c')](_0x2e5a24);}})['then'](function(_0x21f878){if(_0x21f878){return _0x21f878?{'count':_0x173fd1,'rows':_0x21f878}:null;}})[_0xde11('0x13')](respondWithResult(_0x200d60,null))['catch'](handleError(_0x200d60,null));};exports[_0xde11('0x4f')]=function(_0x143664,_0x2b44b9){var _0x314e01=_0x143664[_0xde11('0x33')][_0xde11('0x50')];return db[_0xde11('0x4d')][_0xde11('0x22')]({'where':{'id':_0x314e01},'attributes':['id'],'include':[{'model':db[_0xde11('0x46')],'as':_0xde11('0x51'),'attributes':['id',_0xde11('0x19'),_0xde11('0x52'),_0xde11('0x53'),_0xde11('0x54')],'raw':!![]}]})['then'](function(_0x57bd6c){if(_0x57bd6c){var _0x39f984=_[_0xde11('0x55')](_0x57bd6c,function(_0x27ddd9){var _0x25c89e=_0x27ddd9[_0xde11('0x35')]({'plain':!![]});return _0x25c89e[_0xde11('0x51')];});return db[_0xde11('0x1c')][_0xde11('0x31')]({'where':{'id':_0x143664[_0xde11('0x25')]['id']}})['then'](function(_0x1496bf){return db[_0xde11('0x56')]['transaction'](function(_0x54886e){return _0x1496bf[_0xde11('0x4f')](_0x314e01,{'transaction':_0x54886e})[_0xde11('0x13')](function(){return BPromise[_0xde11('0x57')](_0x39f984,function(_0x33e3d9){return db[_0xde11('0x3d')]['findOrCreate']({'where':{'UserId':_0x33e3d9['id'],'MailQueueId':_0x143664[_0xde11('0x25')]['id']},'transaction':_0x54886e});});})['then'](function(){_0x39f984[_0xde11('0x58')](function(_0x24ac8d){socket['emit']('userMailQueue:save',{'UserId':_0x24ac8d['id'],'MailQueueId':_0x1496bf['id']});});});});});}})[_0xde11('0x13')](respondWithStatusCode(_0x2b44b9,null))[_0xde11('0x24')](handleError(_0x2b44b9,null));};exports['removeTeams']=function(_0x2e1a63,_0x43aac0){return db[_0xde11('0x4d')][_0xde11('0x22')]({'where':{'id':_0x2e1a63[_0xde11('0x28')][_0xde11('0x50')]},'attributes':['id'],'include':[{'model':db[_0xde11('0x46')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xde11('0x13')](handleEntityNotFound(_0x43aac0,null))[_0xde11('0x13')](function(_0x45bb6a){var _0x2f216a=_['map'](_0x45bb6a,'id');var _0x49dee2=[];var _0x3c0f05=[];var _0x46d7b9=squel[_0xde11('0x59')]();_0x46d7b9[_0xde11('0x5a')](_0xde11('0x5b'))[_0xde11('0x5c')](_0xde11('0x5d'),'tq')[_0xde11('0x5e')](_0xde11('0x5f'),'ut',_0xde11('0x60'))[_0xde11('0x42')](_0xde11('0x61'),_0x2e1a63[_0xde11('0x25')]['id']);for(var _0x35e3a0=0x0;_0x35e3a0<_0x45bb6a[_0xde11('0x2d')];_0x35e3a0+=0x1){let _0x3a5143=_0x45bb6a[_0x35e3a0];for(var _0x182b73=0x0;_0x182b73<_0x3a5143[_0xde11('0x51')]['length'];_0x182b73+=0x1){let _0x43e128=_0x3a5143['Agents'][_0x182b73];var _0x50f52d=_0x46d7b9[_0xde11('0x62')]();_0x50f52d[_0xde11('0x42')](_0xde11('0x63'),_0x43e128['id']);_0x3c0f05[_0xde11('0x64')](db['sequelize'][_0xde11('0x28')](_0x50f52d['toString'](),{'type':db['sequelize']['QueryTypes'][_0xde11('0x65')]})['then'](function(_0x559967){if(_0x559967[_0xde11('0x2d')]===0x1){return _0x43e128['id'];}else{var _0x87dd78=_[_0xde11('0x66')](_['map'](_0x559967,'TeamId'),function(_0x2e4f4a){return _['includes'](_0x2f216a,_0x2e4f4a);});if(_0x87dd78){return _0x43e128['id'];}}}));}}return BPromise['all'](_0x3c0f05)['then'](function(_0x5ba7aa){_0x49dee2=_(_0x49dee2)[_0xde11('0x67')](_0x5ba7aa)[_0xde11('0x68')]()[_0xde11('0x69')]();return db[_0xde11('0x1c')][_0xde11('0x31')]({'where':{'id':_0x2e1a63[_0xde11('0x25')]['id']}})[_0xde11('0x13')](function(_0x113462){return db['sequelize'][_0xde11('0x6a')](function(_0x39301c){return _0x113462[_0xde11('0x6b')](_0x2e1a63[_0xde11('0x28')][_0xde11('0x50')],{'transaction':_0x39301c})[_0xde11('0x13')](function(){if(!_[_0xde11('0x6c')](_0x49dee2)){return _0x113462[_0xde11('0x6d')](_0x49dee2,{'transaction':_0x39301c});}})[_0xde11('0x13')](function(){_0x49dee2[_0xde11('0x58')](function(_0x66d0d1){socket[_0xde11('0x6e')](_0xde11('0x6f'),{'UserId':_0x66d0d1,'MailQueueId':_0x113462['id']});});});});});});})['then'](respondWithStatusCode(_0x43aac0,null))[_0xde11('0x24')](handleError(_0x43aac0,null));};exports['addAgents']=function(_0x571890,_0x1bd30b){return db[_0xde11('0x1c')]['find']({'where':{'id':_0x571890[_0xde11('0x25')]['id']}})[_0xde11('0x13')](handleEntityNotFound(_0x1bd30b,null))['then'](function(_0x31ecd){if(_0x31ecd){return _0x31ecd[_0xde11('0x70')](_0x571890[_0xde11('0x33')][_0xde11('0x50')],_['omit'](_0x571890['body'],[_0xde11('0x50'),'id'])||{})[_0xde11('0x71')](function(_0x2dc5ac){for(var _0x2226aa=0x0;_0x2226aa<_0x571890[_0xde11('0x33')]['ids'][_0xde11('0x2d')];_0x2226aa+=0x1){socket[_0xde11('0x6e')](_0xde11('0x72'),{'UserId':Number(_0x571890[_0xde11('0x33')][_0xde11('0x50')][_0x2226aa]),'MailQueueId':Number(_0x571890[_0xde11('0x25')]['id'])});}return _0x2dc5ac;});}})[_0xde11('0x13')](respondWithResult(_0x1bd30b,null))[_0xde11('0x24')](handleError(_0x1bd30b,null));};exports[_0xde11('0x6d')]=function(_0xd21968,_0x2aca44){return db[_0xde11('0x1c')][_0xde11('0x31')]({'where':{'id':_0xd21968[_0xde11('0x25')]['id']}})['then'](handleEntityNotFound(_0x2aca44,null))[_0xde11('0x13')](function(_0x3c7630){if(_0x3c7630){return _0x3c7630['removeAgents'](_0xd21968[_0xde11('0x28')][_0xde11('0x50')])[_0xde11('0x13')](function(){if(_[_0xde11('0x73')](_0xd21968[_0xde11('0x28')][_0xde11('0x50')])){for(var _0x477c19=0x0;_0x477c19<_0xd21968['query'][_0xde11('0x50')]['length'];_0x477c19+=0x1){socket[_0xde11('0x6e')](_0xde11('0x6f'),{'UserId':Number(_0xd21968[_0xde11('0x28')][_0xde11('0x50')][_0x477c19]),'MailQueueId':Number(_0xd21968[_0xde11('0x25')]['id'])});}}else{socket[_0xde11('0x6e')]('userMailQueue:remove',{'UserId':Number(_0xd21968[_0xde11('0x28')][_0xde11('0x50')]),'MailQueueId':Number(_0xd21968[_0xde11('0x25')]['id'])});}});}})[_0xde11('0x13')](respondWithStatusCode(_0x2aca44,null))['catch'](handleError(_0x2aca44,null));};exports[_0xde11('0x74')]=function(_0x583c35,_0x4728a7){var _0x583a6b={};var _0x2422a6={};var _0x5aa14d;var _0x1d4107;return db['MailQueue']['findOne']({'where':{'id':_0x583c35[_0xde11('0x25')]['id']}})[_0xde11('0x13')](handleEntityNotFound(_0x4728a7,null))[_0xde11('0x13')](function(_0xa94b63){if(_0xa94b63){_0x5aa14d=_0xa94b63;_0x2422a6['model']=_[_0xde11('0x27')](db[_0xde11('0x46')][_0xde11('0x1d')]);_0x2422a6[_0xde11('0x28')]=_[_0xde11('0x27')](_0x583c35[_0xde11('0x28')]);_0x2422a6[_0xde11('0x29')]=_[_0xde11('0x2b')](_0x2422a6[_0xde11('0x26')],_0x2422a6[_0xde11('0x28')]);_0x583a6b[_0xde11('0x2a')]=_[_0xde11('0x2b')](_0x2422a6[_0xde11('0x26')],qs[_0xde11('0x2c')](_0x583c35['query'][_0xde11('0x2c')]));_0x583a6b[_0xde11('0x2a')]=_0x583a6b[_0xde11('0x2a')][_0xde11('0x2d')]?_0x583a6b[_0xde11('0x2a')]:_0x2422a6[_0xde11('0x26')];_0x583a6b[_0xde11('0x41')]=qs['sort'](_0x583c35[_0xde11('0x28')][_0xde11('0x4e')]);_0x583a6b[_0xde11('0x42')]=qs[_0xde11('0x29')](_[_0xde11('0x43')](_0x583c35['query'],_0x2422a6['filters']));if(_0x583c35[_0xde11('0x28')][_0xde11('0x45')]){_0x583a6b[_0xde11('0x42')]=_[_0xde11('0x2f')](_0x583a6b[_0xde11('0x42')],{'$or':_[_0xde11('0x1b')](_0x583a6b[_0xde11('0x2a')],function(_0x56424d){var _0x108824={};_0x108824[_0x56424d]={'$like':'%'+_0x583c35[_0xde11('0x28')][_0xde11('0x45')]+'%'};return _0x108824;})});}_0x583a6b=_[_0xde11('0x2f')]({},_0x583a6b,_0x583c35['options']);return _0x5aa14d[_0xde11('0x74')](_0x583a6b);}})[_0xde11('0x13')](function(_0x601708){if(_0x601708){_0x1d4107=_0x601708[_0xde11('0x2d')];if(!_0x583c35['query']['hasOwnProperty'](_0xde11('0x3f'))){_0x583a6b[_0xde11('0x40')]=qs[_0xde11('0x40')](_0x583c35[_0xde11('0x28')][_0xde11('0x40')]);_0x583a6b['offset']=qs[_0xde11('0x10')](_0x583c35[_0xde11('0x28')][_0xde11('0x10')]);}return _0x5aa14d['getAgents'](_0x583a6b);}})[_0xde11('0x13')](function(_0x3c6644){if(_0x3c6644){return _0x3c6644?{'count':_0x1d4107,'rows':_0x3c6644}:null;}})[_0xde11('0x13')](respondWithResult(_0x4728a7,null))[_0xde11('0x24')](handleError(_0x4728a7,null));}; \ No newline at end of file +var _0xb19e=['MailQueueId','filter','options','UserMailQueue','findAndCountAll','updatedAt','format','mailPause','createdAt','getTeams','User','Agents','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','Team','select','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','includes','all','union','ids','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','order','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','update','destroy','then','MailQueues','UserProfileResource','error','stack','name','send','map','MailQueue','rawAttributes','fieldName','type','where','query','findAll','rows','catch','show','params','model','keys','intersection','fields','attributes','length','includeAll','include','merge','find','create','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','filters','hasOwnProperty','nolimit','sort','pick'];(function(_0x387675,_0x192cc2){var _0x1006c3=function(_0x1dbb3b){while(--_0x1dbb3b){_0x387675['push'](_0x387675['shift']());}};_0x1006c3(++_0x192cc2);}(_0xb19e,0x11a));var _0xeb19=function(_0x3b7b8a,_0x52c3b0){_0x3b7b8a=_0x3b7b8a-0x0;var _0x441206=_0xb19e[_0x3b7b8a];return _0x441206;};'use strict';var BPromise=require(_0xeb19('0x0'));var util=require('util');var _=require(_0xeb19('0x1'));var squel=require(_0xeb19('0x2'));var Redis=require(_0xeb19('0x3'));var qs=require(_0xeb19('0x4'));var logger=require(_0xeb19('0x5'))(_0xeb19('0x6'));var config=require(_0xeb19('0x7'));var db=require(_0xeb19('0x8'))['db'];config[_0xeb19('0x9')]=_[_0xeb19('0xa')](config[_0xeb19('0x9')],{'host':_0xeb19('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb19('0x9')]));require(_0xeb19('0xc'))[_0xeb19('0xd')](socket);function respondWithStatusCode(_0x57928e,_0x246b8c){_0x246b8c=_0x246b8c||0xcc;return function(_0x2ff9f1){if(_0x2ff9f1){return _0x57928e[_0xeb19('0xe')](_0x246b8c);}return _0x57928e[_0xeb19('0xf')](_0x246b8c)[_0xeb19('0x10')]();};}function respondWithResult(_0x5d2978,_0x2d5066){_0x2d5066=_0x2d5066||0xc8;return function(_0x1fc970){if(_0x1fc970){return _0x5d2978['status'](_0x2d5066)['json'](_0x1fc970);}};}function respondWithFilteredResult(_0x3eafb0,_0x3c8faf){return function(_0x240ce0){if(_0x240ce0){var _0x138356=typeof _0x3c8faf[_0xeb19('0x11')]==='undefined'&&typeof _0x3c8faf[_0xeb19('0x12')]===_0xeb19('0x13');var _0x2f7d40=_0x240ce0['count'];var _0x3fe112=_0x138356?0x0:_0x3c8faf['offset'];var _0x36134c=_0x138356?_0x240ce0[_0xeb19('0x14')]:_0x3c8faf['offset']+_0x3c8faf[_0xeb19('0x12')];var _0x9672ef;if(_0x36134c>=_0x2f7d40){_0x36134c=_0x2f7d40;_0x9672ef=0xc8;}else{_0x9672ef=0xce;}_0x3eafb0[_0xeb19('0xf')](_0x9672ef);return _0x3eafb0[_0xeb19('0x15')](_0xeb19('0x16'),_0x3fe112+'-'+_0x36134c+'/'+_0x2f7d40)[_0xeb19('0x17')](_0x240ce0);}return null;};}function saveUpdates(_0x341da9){return function(_0x521dca){if(_0x521dca){return _0x521dca[_0xeb19('0x18')](_0x341da9)['then'](function(_0x30445e){return _0x30445e;});}return null;};}function removeEntity(_0x20b42f){return function(_0x4495b5){if(_0x4495b5){return _0x4495b5[_0xeb19('0x19')]()[_0xeb19('0x1a')](function(){var _0x24d44f=_0x4495b5['get']({'plain':!![]});var _0x39e4b3=_0xeb19('0x1b');return db[_0xeb19('0x1c')]['destroy']({'where':{'type':_0x39e4b3,'resourceId':_0x24d44f['id']}})[_0xeb19('0x1a')](function(){return _0x4495b5;});})[_0xeb19('0x1a')](function(){_0x20b42f[_0xeb19('0xf')](0xcc)[_0xeb19('0x10')]();});}};}function handleEntityNotFound(_0x6abe13){return function(_0x520fb4){if(!_0x520fb4){_0x6abe13['sendStatus'](0x194);}return _0x520fb4;};}function handleError(_0x335d88,_0x32b17d){_0x32b17d=_0x32b17d||0x1f4;return function(_0x1e0717){logger[_0xeb19('0x1d')](_0x1e0717[_0xeb19('0x1e')]);if(_0x1e0717[_0xeb19('0x1f')]){delete _0x1e0717[_0xeb19('0x1f')];}_0x335d88[_0xeb19('0xf')](_0x32b17d)[_0xeb19('0x20')](_0x1e0717);};}exports['index']=function(_0x313422,_0x46175d){var _0x4c8fab={};var _0x1d10a4={'count':0x0,'rows':[]};var _0x514ebb=_[_0xeb19('0x21')](db[_0xeb19('0x22')][_0xeb19('0x23')],function(_0x3eea35){return{'name':_0x3eea35[_0xeb19('0x24')],'type':_0x3eea35[_0xeb19('0x25')]['key']};});_0x4c8fab=qs['getOptions'](_0x514ebb,_0x313422);var _0x52ea33={'where':_0x4c8fab[_0xeb19('0x26')]};return db['MailQueue'][_0xeb19('0x14')](_0x52ea33)['then'](function(_0x2261c9){_0x1d10a4[_0xeb19('0x14')]=_0x2261c9;_0x4c8fab['include']=qs['include'](_0x313422[_0xeb19('0x27')]);return db[_0xeb19('0x22')][_0xeb19('0x28')](_0x4c8fab);})['then'](function(_0x269053){_0x1d10a4[_0xeb19('0x29')]=_0x269053;return _0x1d10a4;})[_0xeb19('0x1a')](respondWithFilteredResult(_0x46175d,_0x4c8fab))[_0xeb19('0x2a')](handleError(_0x46175d,null));};exports[_0xeb19('0x2b')]=function(_0x3e2530,_0x48f0e3){var _0x44e8f2={'raw':!![],'where':{'id':_0x3e2530[_0xeb19('0x2c')]['id']}},_0x3c9f00={};_0x3c9f00[_0xeb19('0x2d')]=_[_0xeb19('0x2e')](db['MailQueue']['rawAttributes']);_0x3c9f00[_0xeb19('0x27')]=_[_0xeb19('0x2e')](_0x3e2530[_0xeb19('0x27')]);_0x3c9f00['filters']=_[_0xeb19('0x2f')](_0x3c9f00[_0xeb19('0x2d')],_0x3c9f00[_0xeb19('0x27')]);_0x44e8f2['attributes']=_[_0xeb19('0x2f')](_0x3c9f00[_0xeb19('0x2d')],qs[_0xeb19('0x30')](_0x3e2530[_0xeb19('0x27')][_0xeb19('0x30')]));_0x44e8f2[_0xeb19('0x31')]=_0x44e8f2[_0xeb19('0x31')][_0xeb19('0x32')]?_0x44e8f2['attributes']:_0x3c9f00[_0xeb19('0x2d')];if(_0x3e2530['query'][_0xeb19('0x33')]){_0x44e8f2[_0xeb19('0x34')]=[{'all':!![]}];}_0x44e8f2=_[_0xeb19('0x35')]({},_0x44e8f2,_0x3e2530['options']);return db[_0xeb19('0x22')][_0xeb19('0x36')](_0x44e8f2)[_0xeb19('0x1a')](handleEntityNotFound(_0x48f0e3,null))[_0xeb19('0x1a')](respondWithResult(_0x48f0e3,null))[_0xeb19('0x2a')](handleError(_0x48f0e3,null));};exports[_0xeb19('0x37')]=function(_0x5ca9fc,_0x5b95bc){return db['MailQueue']['create'](_0x5ca9fc['body'],{})[_0xeb19('0x1a')](function(_0x5e0745){var _0x553c54=_0x5ca9fc[_0xeb19('0x38')][_0xeb19('0x39')]({'plain':!![]});if(!_0x553c54)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x553c54['role']===_0xeb19('0x38')){var _0x111636=_0x5e0745[_0xeb19('0x39')]({'plain':!![]});var _0x46633a=_0xeb19('0x1b');return db[_0xeb19('0x3a')]['find']({'where':{'name':_0x46633a,'userProfileId':_0x553c54['userProfileId']},'raw':!![]})['then'](function(_0x26725c){if(_0x26725c&&_0x26725c[_0xeb19('0x3b')]===0x0){return db[_0xeb19('0x1c')][_0xeb19('0x37')]({'name':_0x111636['name'],'resourceId':_0x111636['id'],'type':_0x26725c[_0xeb19('0x1f')],'sectionId':_0x26725c['id']},{})[_0xeb19('0x1a')](function(){return _0x5e0745;});}else{return _0x5e0745;}})[_0xeb19('0x2a')](function(_0x24322c){logger[_0xeb19('0x1d')](_0xeb19('0x3c'),_0x24322c);throw _0x24322c;});}return _0x5e0745;})[_0xeb19('0x1a')](respondWithResult(_0x5b95bc,0xc9))['catch'](handleError(_0x5b95bc,null));};exports[_0xeb19('0x18')]=function(_0x1dcd87,_0x47ef9f){if(_0x1dcd87[_0xeb19('0x3d')]['id']){delete _0x1dcd87[_0xeb19('0x3d')]['id'];}return db[_0xeb19('0x22')][_0xeb19('0x36')]({'where':{'id':_0x1dcd87[_0xeb19('0x2c')]['id']}})[_0xeb19('0x1a')](handleEntityNotFound(_0x47ef9f,null))[_0xeb19('0x1a')](saveUpdates(_0x1dcd87[_0xeb19('0x3d')],null))['then'](respondWithResult(_0x47ef9f,null))['catch'](handleError(_0x47ef9f,null));};exports[_0xeb19('0x19')]=function(_0x18a8dc,_0x37ee15){return db[_0xeb19('0x22')]['find']({'where':{'id':_0x18a8dc[_0xeb19('0x2c')]['id']}})[_0xeb19('0x1a')](handleEntityNotFound(_0x37ee15,null))[_0xeb19('0x1a')](removeEntity(_0x37ee15,null))[_0xeb19('0x2a')](handleError(_0x37ee15,null));};exports[_0xeb19('0x3e')]=function(_0x1237e6,_0x2df904){return db['MailQueue']['describe']()[_0xeb19('0x1a')](respondWithResult(_0x2df904,null))[_0xeb19('0x2a')](handleError(_0x2df904,null));};exports['getMembers']=function(_0x489119,_0x9618d6){var _0x15b7f7={'raw':!![],'where':{}},_0x228b7d={},_0x9f5024;return db[_0xeb19('0x22')][_0xeb19('0x3f')]({'where':{'id':_0x489119['params']['id']}})[_0xeb19('0x1a')](handleEntityNotFound(_0x9618d6,null))[_0xeb19('0x1a')](function(_0x3e31b6){if(_0x3e31b6){_0x9f5024=_0x3e31b6[_0xeb19('0x39')]({'plain':!![]});_0x228b7d['model']=_[_0xeb19('0x2e')](db['UserMailQueue'][_0xeb19('0x23')]);_0x228b7d[_0xeb19('0x27')]=_['keys'](_0x489119['query']);_0x228b7d[_0xeb19('0x40')]=_[_0xeb19('0x2f')](_0x228b7d[_0xeb19('0x2d')],_0x228b7d[_0xeb19('0x27')]);_0x15b7f7['attributes']=_[_0xeb19('0x2f')](_0x228b7d[_0xeb19('0x2d')],qs[_0xeb19('0x30')](_0x489119[_0xeb19('0x27')][_0xeb19('0x30')]));_0x15b7f7['attributes']=_0x15b7f7[_0xeb19('0x31')][_0xeb19('0x32')]?_0x15b7f7[_0xeb19('0x31')]:_0x228b7d['model'];if(!_0x489119[_0xeb19('0x27')][_0xeb19('0x41')](_0xeb19('0x42'))){_0x15b7f7[_0xeb19('0x12')]=qs[_0xeb19('0x12')](_0x489119[_0xeb19('0x27')][_0xeb19('0x12')]);_0x15b7f7['offset']=qs[_0xeb19('0x11')](_0x489119['query'][_0xeb19('0x11')]);}_0x15b7f7['order']=qs[_0xeb19('0x43')](_0x489119[_0xeb19('0x27')][_0xeb19('0x43')]);_0x15b7f7[_0xeb19('0x26')]=qs[_0xeb19('0x40')](_[_0xeb19('0x44')](_0x489119[_0xeb19('0x27')],_0x228b7d[_0xeb19('0x40')]));_0x15b7f7[_0xeb19('0x26')][_0xeb19('0x45')]=_0x3e31b6['id'];if(_0x489119[_0xeb19('0x27')][_0xeb19('0x46')]){_0x15b7f7[_0xeb19('0x26')]=_[_0xeb19('0x35')](_0x15b7f7[_0xeb19('0x26')],{'$or':_[_0xeb19('0x21')](_0x15b7f7[_0xeb19('0x31')],function(_0x814a74){var _0x1809e7={};_0x1809e7[_0x814a74]={'$like':'%'+_0x489119[_0xeb19('0x27')]['filter']+'%'};return _0x1809e7;})});}_0x15b7f7=_[_0xeb19('0x35')]({},_0x15b7f7,_0x489119[_0xeb19('0x47')]);return db[_0xeb19('0x48')][_0xeb19('0x28')](_0x15b7f7);}})[_0xeb19('0x1a')](function(_0x3aeb50){if(_0x3aeb50){return db['User'][_0xeb19('0x49')]({'where':{'id':_[_0xeb19('0x21')](_0x3aeb50,'UserId'),'role':'agent'},'attributes':['id',_0xeb19('0x1f'),'mailPause',_0xeb19('0x4a'),'createdAt']});}})[_0xeb19('0x1a')](function(_0x40915a){if(_0x40915a){return{'count':_0x40915a[_0xeb19('0x14')],'rows':_['map'](_0x40915a['rows'],function(_0x50a453){return{'membername':_0x50a453['name'],'UserId':_0x50a453['id'],'queue_name':_0x9f5024['name'],'MailQueueId':_0x9f5024['id'],'interface':util[_0xeb19('0x4b')]('%s/%s','SIP',_0x50a453[_0xeb19('0x1f')]),'penalty':0x0,'paused':_0x50a453[_0xeb19('0x4c')],'createdAt':_0x50a453[_0xeb19('0x4d')],'updatedAt':_0x50a453[_0xeb19('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x9618d6,_0x15b7f7))[_0xeb19('0x2a')](handleError(_0x9618d6,null));};exports['getTeams']=function(_0xdc4a84,_0x2fc2e0){var _0x31222e={};var _0x23989b={};var _0x1df355;var _0x1038bc;return db[_0xeb19('0x22')][_0xeb19('0x3f')]({'where':{'id':_0xdc4a84[_0xeb19('0x2c')]['id']}})[_0xeb19('0x1a')](handleEntityNotFound(_0x2fc2e0,null))[_0xeb19('0x1a')](function(_0x406a07){if(_0x406a07){_0x1df355=_0x406a07;_0x23989b[_0xeb19('0x2d')]=_[_0xeb19('0x2e')](db['Team'][_0xeb19('0x23')]);_0x23989b[_0xeb19('0x27')]=_['keys'](_0xdc4a84[_0xeb19('0x27')]);_0x23989b['filters']=_[_0xeb19('0x2f')](_0x23989b['model'],_0x23989b['query']);_0x31222e[_0xeb19('0x31')]=_[_0xeb19('0x2f')](_0x23989b['model'],qs[_0xeb19('0x30')](_0xdc4a84[_0xeb19('0x27')][_0xeb19('0x30')]));_0x31222e[_0xeb19('0x31')]=_0x31222e[_0xeb19('0x31')][_0xeb19('0x32')]?_0x31222e[_0xeb19('0x31')]:_0x23989b[_0xeb19('0x2d')];_0x31222e['order']=qs[_0xeb19('0x43')](_0xdc4a84[_0xeb19('0x27')]['sort']);_0x31222e[_0xeb19('0x26')]=qs[_0xeb19('0x40')](_[_0xeb19('0x44')](_0xdc4a84['query'],_0x23989b[_0xeb19('0x40')]));if(_0xdc4a84[_0xeb19('0x27')][_0xeb19('0x46')]){_0x31222e['where']=_[_0xeb19('0x35')](_0x31222e[_0xeb19('0x26')],{'$or':_[_0xeb19('0x21')](_0x31222e['attributes'],function(_0x5b8266){var _0xc02c6a={};_0xc02c6a[_0x5b8266]={'$like':'%'+_0xdc4a84[_0xeb19('0x27')][_0xeb19('0x46')]+'%'};return _0xc02c6a;})});}_0x31222e=_[_0xeb19('0x35')]({},_0x31222e,_0xdc4a84[_0xeb19('0x47')]);return _0x1df355[_0xeb19('0x4e')](_0x31222e);}})[_0xeb19('0x1a')](function(_0x38f793){if(_0x38f793){_0x1038bc=_0x38f793[_0xeb19('0x32')];if(!_0xdc4a84[_0xeb19('0x27')]['hasOwnProperty'](_0xeb19('0x42'))){_0x31222e[_0xeb19('0x12')]=qs['limit'](_0xdc4a84[_0xeb19('0x27')]['limit']);_0x31222e[_0xeb19('0x11')]=qs[_0xeb19('0x11')](_0xdc4a84['query'][_0xeb19('0x11')]);}return _0x1df355['getTeams'](_0x31222e);}})[_0xeb19('0x1a')](function(_0x470349){if(_0x470349){return _0x470349?{'count':_0x1038bc,'rows':_0x470349}:null;}})[_0xeb19('0x1a')](respondWithResult(_0x2fc2e0,null))['catch'](handleError(_0x2fc2e0,null));};exports['addTeams']=function(_0x32ed52,_0x268662){var _0x3257a0=_0x32ed52[_0xeb19('0x3d')]['ids'];return db['Team']['findAll']({'where':{'id':_0x3257a0},'attributes':['id'],'include':[{'model':db[_0xeb19('0x4f')],'as':_0xeb19('0x50'),'attributes':['id',_0xeb19('0x1f'),'online',_0xeb19('0x51'),_0xeb19('0x52')],'raw':!![]}]})[_0xeb19('0x1a')](function(_0x226d24){if(_0x226d24){var _0x1b545d=_[_0xeb19('0x53')](_0x226d24,function(_0x5bdebd){var _0x578726=_0x5bdebd['get']({'plain':!![]});return _0x578726[_0xeb19('0x50')];});return db[_0xeb19('0x22')][_0xeb19('0x36')]({'where':{'id':_0x32ed52[_0xeb19('0x2c')]['id']}})[_0xeb19('0x1a')](function(_0x42e331){return db['sequelize'][_0xeb19('0x54')](function(_0x2cb3a7){return _0x42e331['addTeams'](_0x3257a0,{'transaction':_0x2cb3a7})[_0xeb19('0x1a')](function(){return BPromise[_0xeb19('0x55')](_0x1b545d,function(_0x121c1c){return db['UserMailQueue'][_0xeb19('0x56')]({'where':{'UserId':_0x121c1c['id'],'MailQueueId':_0x32ed52[_0xeb19('0x2c')]['id']},'transaction':_0x2cb3a7});});})[_0xeb19('0x1a')](function(){_0x1b545d[_0xeb19('0x57')](function(_0x5a0d11){socket[_0xeb19('0x58')](_0xeb19('0x59'),{'UserId':_0x5a0d11['id'],'MailQueueId':_0x42e331['id']});});});});});}})[_0xeb19('0x1a')](respondWithStatusCode(_0x268662,null))[_0xeb19('0x2a')](handleError(_0x268662,null));};exports[_0xeb19('0x5a')]=function(_0x5c2587,_0x3a12d6){return db[_0xeb19('0x5b')][_0xeb19('0x28')]({'where':{'id':_0x5c2587['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xeb19('0x4f')],'as':_0xeb19('0x50'),'attributes':['id'],'raw':!![]}]})[_0xeb19('0x1a')](handleEntityNotFound(_0x3a12d6,null))[_0xeb19('0x1a')](function(_0x36045f){var _0x3278f7=_['map'](_0x36045f,'id');var _0x42b2e8=[];var _0x539e64=[];var _0x5e27f9=squel[_0xeb19('0x5c')]();_0x5e27f9['field'](_0xeb19('0x5d'))['from']('team_has_mail_queues','tq')[_0xeb19('0x5e')](_0xeb19('0x5f'),'ut',_0xeb19('0x60'))['where'](_0xeb19('0x61'),_0x5c2587[_0xeb19('0x2c')]['id']);for(var _0x25935e=0x0;_0x25935e<_0x36045f[_0xeb19('0x32')];_0x25935e+=0x1){let _0x5c0db5=_0x36045f[_0x25935e];for(var _0x19dc7a=0x0;_0x19dc7a<_0x5c0db5[_0xeb19('0x50')][_0xeb19('0x32')];_0x19dc7a+=0x1){let _0x4b4fa0=_0x5c0db5[_0xeb19('0x50')][_0x19dc7a];var _0x1634e4=_0x5e27f9[_0xeb19('0x62')]();_0x1634e4['where']('ut.UserId\x20=\x20?',_0x4b4fa0['id']);_0x539e64[_0xeb19('0x63')](db[_0xeb19('0x64')][_0xeb19('0x27')](_0x1634e4[_0xeb19('0x65')](),{'type':db[_0xeb19('0x64')][_0xeb19('0x66')][_0xeb19('0x67')]})[_0xeb19('0x1a')](function(_0x29ebfe){if(_0x29ebfe[_0xeb19('0x32')]===0x1){return _0x4b4fa0['id'];}else{var _0x3d70af=_[_0xeb19('0x68')](_[_0xeb19('0x21')](_0x29ebfe,'TeamId'),function(_0x57b370){return _[_0xeb19('0x69')](_0x3278f7,_0x57b370);});if(_0x3d70af){return _0x4b4fa0['id'];}}}));}}return BPromise[_0xeb19('0x6a')](_0x539e64)[_0xeb19('0x1a')](function(_0x41bb9a){_0x42b2e8=_(_0x42b2e8)[_0xeb19('0x6b')](_0x41bb9a)['compact']()['value']();return db['MailQueue']['find']({'where':{'id':_0x5c2587[_0xeb19('0x2c')]['id']}})[_0xeb19('0x1a')](function(_0x1cb427){return db[_0xeb19('0x64')][_0xeb19('0x54')](function(_0x21db2e){return _0x1cb427[_0xeb19('0x5a')](_0x5c2587['query'][_0xeb19('0x6c')],{'transaction':_0x21db2e})[_0xeb19('0x1a')](function(){if(!_['isEmpty'](_0x42b2e8)){return _0x1cb427[_0xeb19('0x6d')](_0x42b2e8,{'transaction':_0x21db2e});}})[_0xeb19('0x1a')](function(){_0x42b2e8[_0xeb19('0x57')](function(_0x5aeafa){socket[_0xeb19('0x58')](_0xeb19('0x6e'),{'UserId':_0x5aeafa,'MailQueueId':_0x1cb427['id']});});});});});});})['then'](respondWithStatusCode(_0x3a12d6,null))[_0xeb19('0x2a')](handleError(_0x3a12d6,null));};exports['addAgents']=function(_0x28ba51,_0x5555fb){return db[_0xeb19('0x22')]['find']({'where':{'id':_0x28ba51[_0xeb19('0x2c')]['id']}})[_0xeb19('0x1a')](handleEntityNotFound(_0x5555fb,null))[_0xeb19('0x1a')](function(_0xbf6d30){if(_0xbf6d30){return _0xbf6d30[_0xeb19('0x6f')](_0x28ba51[_0xeb19('0x3d')][_0xeb19('0x6c')],_[_0xeb19('0x70')](_0x28ba51[_0xeb19('0x3d')],[_0xeb19('0x6c'),'id'])||{})[_0xeb19('0x71')](function(_0x370565){for(var _0x39c4a6=0x0;_0x39c4a6<_0x28ba51[_0xeb19('0x3d')]['ids'][_0xeb19('0x32')];_0x39c4a6+=0x1){socket[_0xeb19('0x58')](_0xeb19('0x59'),{'UserId':Number(_0x28ba51[_0xeb19('0x3d')][_0xeb19('0x6c')][_0x39c4a6]),'MailQueueId':Number(_0x28ba51[_0xeb19('0x2c')]['id'])});}return _0x370565;});}})[_0xeb19('0x1a')](respondWithResult(_0x5555fb,null))[_0xeb19('0x2a')](handleError(_0x5555fb,null));};exports[_0xeb19('0x6d')]=function(_0x165b49,_0x1288d2){return db['MailQueue']['find']({'where':{'id':_0x165b49[_0xeb19('0x2c')]['id']}})[_0xeb19('0x1a')](handleEntityNotFound(_0x1288d2,null))[_0xeb19('0x1a')](function(_0x775ebf){if(_0x775ebf){return _0x775ebf[_0xeb19('0x6d')](_0x165b49['query'][_0xeb19('0x6c')])[_0xeb19('0x1a')](function(){if(_[_0xeb19('0x72')](_0x165b49[_0xeb19('0x27')][_0xeb19('0x6c')])){for(var _0x6e5b41=0x0;_0x6e5b41<_0x165b49[_0xeb19('0x27')][_0xeb19('0x6c')]['length'];_0x6e5b41+=0x1){socket['emit'](_0xeb19('0x6e'),{'UserId':Number(_0x165b49[_0xeb19('0x27')][_0xeb19('0x6c')][_0x6e5b41]),'MailQueueId':Number(_0x165b49[_0xeb19('0x2c')]['id'])});}}else{socket[_0xeb19('0x58')](_0xeb19('0x6e'),{'UserId':Number(_0x165b49[_0xeb19('0x27')][_0xeb19('0x6c')]),'MailQueueId':Number(_0x165b49[_0xeb19('0x2c')]['id'])});}});}})['then'](respondWithStatusCode(_0x1288d2,null))[_0xeb19('0x2a')](handleError(_0x1288d2,null));};exports[_0xeb19('0x73')]=function(_0x4b1f83,_0x2b2f40){var _0x1d7c8c={};var _0x2a9437={};var _0x2bf042;var _0x458b57;return db[_0xeb19('0x22')][_0xeb19('0x3f')]({'where':{'id':_0x4b1f83[_0xeb19('0x2c')]['id']}})[_0xeb19('0x1a')](handleEntityNotFound(_0x2b2f40,null))['then'](function(_0x302ea6){if(_0x302ea6){_0x2bf042=_0x302ea6;_0x2a9437[_0xeb19('0x2d')]=_['keys'](db['User']['rawAttributes']);_0x2a9437['query']=_[_0xeb19('0x2e')](_0x4b1f83['query']);_0x2a9437['filters']=_[_0xeb19('0x2f')](_0x2a9437[_0xeb19('0x2d')],_0x2a9437[_0xeb19('0x27')]);_0x1d7c8c[_0xeb19('0x31')]=_[_0xeb19('0x2f')](_0x2a9437['model'],qs[_0xeb19('0x30')](_0x4b1f83[_0xeb19('0x27')]['fields']));_0x1d7c8c['attributes']=_0x1d7c8c['attributes'][_0xeb19('0x32')]?_0x1d7c8c[_0xeb19('0x31')]:_0x2a9437[_0xeb19('0x2d')];_0x1d7c8c[_0xeb19('0x74')]=qs[_0xeb19('0x43')](_0x4b1f83['query'][_0xeb19('0x43')]);_0x1d7c8c[_0xeb19('0x26')]=qs[_0xeb19('0x40')](_[_0xeb19('0x44')](_0x4b1f83[_0xeb19('0x27')],_0x2a9437[_0xeb19('0x40')]));if(_0x4b1f83[_0xeb19('0x27')][_0xeb19('0x46')]){_0x1d7c8c['where']=_[_0xeb19('0x35')](_0x1d7c8c[_0xeb19('0x26')],{'$or':_['map'](_0x1d7c8c[_0xeb19('0x31')],function(_0x2706dc){var _0x1ca18e={};_0x1ca18e[_0x2706dc]={'$like':'%'+_0x4b1f83['query'][_0xeb19('0x46')]+'%'};return _0x1ca18e;})});}_0x1d7c8c=_[_0xeb19('0x35')]({},_0x1d7c8c,_0x4b1f83[_0xeb19('0x47')]);return _0x2bf042[_0xeb19('0x73')](_0x1d7c8c);}})[_0xeb19('0x1a')](function(_0x5cddab){if(_0x5cddab){_0x458b57=_0x5cddab[_0xeb19('0x32')];if(!_0x4b1f83[_0xeb19('0x27')][_0xeb19('0x41')]('nolimit')){_0x1d7c8c[_0xeb19('0x12')]=qs['limit'](_0x4b1f83['query'][_0xeb19('0x12')]);_0x1d7c8c[_0xeb19('0x11')]=qs[_0xeb19('0x11')](_0x4b1f83[_0xeb19('0x27')][_0xeb19('0x11')]);}return _0x2bf042[_0xeb19('0x73')](_0x1d7c8c);}})[_0xeb19('0x1a')](function(_0x3e1b84){if(_0x3e1b84){return _0x3e1b84?{'count':_0x458b57,'rows':_0x3e1b84}:null;}})['then'](respondWithResult(_0x2b2f40,null))[_0xeb19('0x2a')](handleError(_0x2b2f40,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index d443644..45d3cc7 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 _0x3afe=['emit','hook','exports','events','../../mysqldb','MailQueue','update','remove'];(function(_0x5dd511,_0x375d07){var _0x128597=function(_0x171f01){while(--_0x171f01){_0x5dd511['push'](_0x5dd511['shift']());}};_0x128597(++_0x375d07);}(_0x3afe,0x16b));var _0xe3af=function(_0x321df4,_0x3efec5){_0x321df4=_0x321df4-0x0;var _0x50d06c=_0x3afe[_0x321df4];return _0x50d06c;};'use strict';var EventEmitter=require(_0xe3af('0x0'));var MailQueue=require(_0xe3af('0x1'))['db'][_0xe3af('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe3af('0x3'),'afterDestroy':_0xe3af('0x4')};function emitEvent(_0x488bce){return function(_0x656088,_0x2ff328,_0x15b66c){MailQueueEvents[_0xe3af('0x5')](_0x488bce+':'+_0x656088['id'],_0x656088);MailQueueEvents['emit'](_0x488bce,_0x656088);_0x15b66c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xe3af('0x6')](e,emitEvent(event));}}module[_0xe3af('0x7')]=MailQueueEvents; \ No newline at end of file +var _0xa3c8=['events','MailQueue','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x31ee1a,_0xfc5974){var _0xd1d3b1=function(_0x22dc73){while(--_0x22dc73){_0x31ee1a['push'](_0x31ee1a['shift']());}};_0xd1d3b1(++_0xfc5974);}(_0xa3c8,0x140));var _0x8a3c=function(_0x2ea876,_0xb4a969){_0x2ea876=_0x2ea876-0x0;var _0x31db92=_0xa3c8[_0x2ea876];return _0x31db92;};'use strict';var EventEmitter=require(_0x8a3c('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x8a3c('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x8a3c('0x2')](0x0);var events={'afterCreate':_0x8a3c('0x3'),'afterUpdate':'update','afterDestroy':_0x8a3c('0x4')};function emitEvent(_0x25d621){return function(_0x53efa7,_0x429311,_0x3f14eb){MailQueueEvents[_0x8a3c('0x5')](_0x25d621+':'+_0x53efa7['id'],_0x53efa7);MailQueueEvents[_0x8a3c('0x5')](_0x25d621,_0x53efa7);_0x3f14eb(null);};}for(var e in events){if(events[_0x8a3c('0x6')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x8a3c('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 308edd1..d36e04f 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 _0x53f9=['./mailQueue.attributes','MailQueue','util','api','moment','request-promise','path','rimraf'];(function(_0x589f71,_0x212326){var _0x5763bd=function(_0x2cb8e1){while(--_0x2cb8e1){_0x589f71['push'](_0x589f71['shift']());}};_0x5763bd(++_0x212326);}(_0x53f9,0xea));var _0x953f=function(_0x443520,_0x2fe333){_0x443520=_0x443520-0x0;var _0x20afa5=_0x53f9[_0x443520];return _0x20afa5;};'use strict';var _=require('lodash');var util=require(_0x953f('0x0'));var logger=require('../../config/logger')(_0x953f('0x1'));var moment=require(_0x953f('0x2'));var BPromise=require('bluebird');var rp=require(_0x953f('0x3'));var fs=require('fs');var path=require(_0x953f('0x4'));var rimraf=require(_0x953f('0x5'));var config=require('../../config/environment');var attributes=require(_0x953f('0x6'));module['exports']=function(_0x4cd387,_0x557b8d){return _0x4cd387['define'](_0x953f('0x7'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb41f=['rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','../../config/logger','api','moment','bluebird','path'];(function(_0x842e4c,_0x4cba4d){var _0x2abedb=function(_0x3eec8b){while(--_0x3eec8b){_0x842e4c['push'](_0x842e4c['shift']());}};_0x2abedb(++_0x4cba4d);}(_0xb41f,0x97));var _0xfb41=function(_0x59622c,_0x66fcea){_0x59622c=_0x59622c-0x0;var _0x5546ad=_0xb41f[_0x59622c];return _0x5546ad;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfb41('0x0'))(_0xfb41('0x1'));var moment=require(_0xfb41('0x2'));var BPromise=require(_0xfb41('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb41('0x4'));var rimraf=require(_0xfb41('0x5'));var config=require(_0xfb41('0x6'));var attributes=require(_0xfb41('0x7'));module[_0xfb41('0x8')]=function(_0x191375,_0x309ef2){return _0x191375[_0xfb41('0x9')](_0xfb41('0xa'),attributes,{'tableName':_0xfb41('0xb'),'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 04f67e5..2e3b568 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 _0x076b=['catch','ShowMailQueue','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','GetMailQueue','MailQueue','options','where','attributes','limit','include','map','model','debug','stringify'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x076b,0x76));var _0xb076=function(_0x5c85a7,_0xc1e03e){_0x5c85a7=_0x5c85a7-0x0;var _0x23df13=_0x076b[_0x5c85a7];return _0x23df13;};'use strict';var _=require(_0xb076('0x0'));var util=require(_0xb076('0x1'));var moment=require(_0xb076('0x2'));var BPromise=require(_0xb076('0x3'));var rs=require(_0xb076('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb076('0x5'))['db'];var utils=require(_0xb076('0x6'));var logger=require(_0xb076('0x7'))('rpc');var config=require(_0xb076('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb076('0x9')][_0xb076('0xa')]({'port':0x232a});config[_0xb076('0xb')]=_[_0xb076('0xc')](config[_0xb076('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb076('0xd'))[_0xb076('0xe')](socket);function respondWithRpcPromise(_0x271e78,_0x55b20c,_0x5bca38){return new BPromise(function(_0x5697d5,_0x14fae0){return client[_0xb076('0xf')](_0x271e78,_0x5bca38)['then'](function(_0x19d360){logger[_0xb076('0x10')](_0xb076('0x11'),_0x55b20c,_0xb076('0x12'));logger['debug'](_0xb076('0x13'),_0x55b20c,'request\x20sent',JSON['stringify'](_0x19d360));if(_0x19d360[_0xb076('0x14')]){if(_0x19d360[_0xb076('0x14')][_0xb076('0x15')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x55b20c,_0x19d360[_0xb076('0x14')][_0xb076('0x16')]);return _0x14fae0(_0x19d360[_0xb076('0x14')][_0xb076('0x16')]);}logger[_0xb076('0x14')](_0xb076('0x11'),_0x55b20c,_0x19d360[_0xb076('0x14')][_0xb076('0x16')]);return _0x5697d5(_0x19d360[_0xb076('0x14')][_0xb076('0x16')]);}else{logger[_0xb076('0x10')]('MailQueue,\x20%s,\x20%s',_0x55b20c,_0xb076('0x12'));_0x5697d5(_0x19d360['result']['message']);}})['catch'](function(_0x1ad404){logger[_0xb076('0x14')](_0xb076('0x11'),_0x55b20c,_0x1ad404);_0x14fae0(_0x1ad404);});});}exports[_0xb076('0x17')]=function(_0x1ec553){var _0x3cb82d=this;return new Promise(function(_0x3e9baf,_0x19791d){return db[_0xb076('0x18')]['findAll']({'raw':_0x1ec553[_0xb076('0x19')]?_0x1ec553[_0xb076('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1ec553['options']?_0x1ec553['options'][_0xb076('0x1a')]||null:null,'attributes':_0x1ec553[_0xb076('0x19')]?_0x1ec553[_0xb076('0x19')][_0xb076('0x1b')]||null:null,'limit':_0x1ec553['options']?_0x1ec553[_0xb076('0x19')][_0xb076('0x1c')]||null:null,'include':_0x1ec553[_0xb076('0x19')]?_0x1ec553[_0xb076('0x19')][_0xb076('0x1d')]?_[_0xb076('0x1e')](_0x1ec553[_0xb076('0x19')][_0xb076('0x1d')],function(_0x4e52d7){return{'model':db[_0x4e52d7[_0xb076('0x1f')]],'as':_0x4e52d7['as'],'attributes':_0x4e52d7[_0xb076('0x1b')],'include':_0x4e52d7[_0xb076('0x1d')]?_['map'](_0x4e52d7['include'],function(_0x31b722){return{'model':db[_0x31b722[_0xb076('0x1f')]],'as':_0x31b722['as'],'attributes':_0x31b722[_0xb076('0x1b')],'include':_0x31b722[_0xb076('0x1d')]?_[_0xb076('0x1e')](_0x31b722[_0xb076('0x1d')],function(_0x21f2b2){return{'model':db[_0x21f2b2[_0xb076('0x1f')]],'as':_0x21f2b2['as'],'attributes':_0x21f2b2[_0xb076('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xdd9c1){logger['info'](_0xb076('0x17'),_0x1ec553);logger[_0xb076('0x20')](_0xb076('0x17'),_0x1ec553,JSON[_0xb076('0x21')](_0xdd9c1));_0x3e9baf(_0xdd9c1);})[_0xb076('0x22')](function(_0x2fa468){logger[_0xb076('0x14')](_0xb076('0x17'),_0x2fa468[_0xb076('0x16')],_0x1ec553);_0x19791d(_0x3cb82d['error'](0x1f4,_0x2fa468[_0xb076('0x16')]));});});};exports[_0xb076('0x23')]=function(_0x269334){var _0x371b98=this;return new Promise(function(_0x1df255,_0x4faeee){return db[_0xb076('0x18')][_0xb076('0x24')]({'raw':_0x269334[_0xb076('0x19')]?_0x269334[_0xb076('0x19')][_0xb076('0x25')]===undefined?!![]:![]:!![],'where':_0x269334[_0xb076('0x19')]?_0x269334[_0xb076('0x19')][_0xb076('0x1a')]||null:null,'attributes':_0x269334[_0xb076('0x19')]?_0x269334['options'][_0xb076('0x1b')]||null:null,'include':_0x269334[_0xb076('0x19')]?_0x269334['options'][_0xb076('0x1d')]?_[_0xb076('0x1e')](_0x269334[_0xb076('0x19')][_0xb076('0x1d')],function(_0x445c09){return{'model':db[_0x445c09[_0xb076('0x1f')]],'as':_0x445c09['as'],'attributes':_0x445c09[_0xb076('0x1b')],'include':_0x445c09[_0xb076('0x1d')]?_[_0xb076('0x1e')](_0x445c09[_0xb076('0x1d')],function(_0x3881c4){return{'model':db[_0x3881c4[_0xb076('0x1f')]],'as':_0x3881c4['as'],'attributes':_0x3881c4[_0xb076('0x1b')],'include':_0x3881c4[_0xb076('0x1d')]?_[_0xb076('0x1e')](_0x3881c4[_0xb076('0x1d')],function(_0x15ce58){return{'model':db[_0x15ce58[_0xb076('0x1f')]],'as':_0x15ce58['as'],'attributes':_0x15ce58[_0xb076('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2611c6){logger[_0xb076('0x10')](_0xb076('0x23'),_0x269334);logger[_0xb076('0x20')]('ShowMailQueue',_0x269334,JSON[_0xb076('0x21')](_0x2611c6));_0x1df255(_0x2611c6);})['catch'](function(_0xd9db30){logger[_0xb076('0x14')](_0xb076('0x23'),_0xd9db30['message'],_0x269334);_0x4faeee(_0x371b98[_0xb076('0x14')](0x1f4,_0xd9db30['message']));});});}; \ No newline at end of file +var _0x0bc1=['MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','raw','where','limit','include','map','model','attributes','info','GetMailQueue','ShowMailQueue','MailQueue','find','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x542da8,_0x509c26){var _0x533d7e=function(_0x2a3d04){while(--_0x2a3d04){_0x542da8['push'](_0x542da8['shift']());}};_0x533d7e(++_0x509c26);}(_0x0bc1,0x1ae));var _0x10bc=function(_0x523f14,_0x1d77b2){_0x523f14=_0x523f14-0x0;var _0x40678e=_0x0bc1[_0x523f14];return _0x40678e;};'use strict';var _=require(_0x10bc('0x0'));var util=require(_0x10bc('0x1'));var moment=require(_0x10bc('0x2'));var BPromise=require(_0x10bc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x10bc('0x4'))['db'];var utils=require(_0x10bc('0x5'));var logger=require(_0x10bc('0x6'))(_0x10bc('0x7'));var config=require(_0x10bc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x10bc('0x9')][_0x10bc('0xa')]({'port':0x232a});config[_0x10bc('0xb')]=_[_0x10bc('0xc')](config[_0x10bc('0xb')],{'host':_0x10bc('0xd'),'port':0x18eb});var socket=require(_0x10bc('0xe'))(new Redis(config[_0x10bc('0xb')]));require('./mailQueue.socket')[_0x10bc('0xf')](socket);function respondWithRpcPromise(_0x4eba3f,_0x53e222,_0x17b19e){return new BPromise(function(_0x3e0414,_0x4e8d28){return client[_0x10bc('0x10')](_0x4eba3f,_0x17b19e)[_0x10bc('0x11')](function(_0x13462d){logger['info'](_0x10bc('0x12'),_0x53e222,_0x10bc('0x13'));logger[_0x10bc('0x14')](_0x10bc('0x15'),_0x53e222,_0x10bc('0x13'),JSON[_0x10bc('0x16')](_0x13462d));if(_0x13462d[_0x10bc('0x17')]){if(_0x13462d[_0x10bc('0x17')][_0x10bc('0x18')]===0x1f4){logger[_0x10bc('0x17')](_0x10bc('0x12'),_0x53e222,_0x13462d[_0x10bc('0x17')][_0x10bc('0x19')]);return _0x4e8d28(_0x13462d[_0x10bc('0x17')][_0x10bc('0x19')]);}logger[_0x10bc('0x17')](_0x10bc('0x12'),_0x53e222,_0x13462d[_0x10bc('0x17')][_0x10bc('0x19')]);return _0x3e0414(_0x13462d['error'][_0x10bc('0x19')]);}else{logger['info'](_0x10bc('0x12'),_0x53e222,'request\x20sent');_0x3e0414(_0x13462d['result'][_0x10bc('0x19')]);}})[_0x10bc('0x1a')](function(_0x8ea902){logger['error'](_0x10bc('0x12'),_0x53e222,_0x8ea902);_0x4e8d28(_0x8ea902);});});}exports['GetMailQueue']=function(_0x178915){var _0x5ad529=this;return new Promise(function(_0x1eab1e,_0x106233){return db['MailQueue'][_0x10bc('0x1b')]({'raw':_0x178915[_0x10bc('0x1c')]?_0x178915['options'][_0x10bc('0x1d')]===undefined?!![]:![]:!![],'where':_0x178915[_0x10bc('0x1c')]?_0x178915[_0x10bc('0x1c')][_0x10bc('0x1e')]||null:null,'attributes':_0x178915[_0x10bc('0x1c')]?_0x178915[_0x10bc('0x1c')]['attributes']||null:null,'limit':_0x178915['options']?_0x178915[_0x10bc('0x1c')][_0x10bc('0x1f')]||null:null,'include':_0x178915['options']?_0x178915[_0x10bc('0x1c')][_0x10bc('0x20')]?_[_0x10bc('0x21')](_0x178915[_0x10bc('0x1c')][_0x10bc('0x20')],function(_0x38b1e9){return{'model':db[_0x38b1e9[_0x10bc('0x22')]],'as':_0x38b1e9['as'],'attributes':_0x38b1e9[_0x10bc('0x23')],'include':_0x38b1e9[_0x10bc('0x20')]?_[_0x10bc('0x21')](_0x38b1e9[_0x10bc('0x20')],function(_0x43aef1){return{'model':db[_0x43aef1[_0x10bc('0x22')]],'as':_0x43aef1['as'],'attributes':_0x43aef1['attributes'],'include':_0x43aef1[_0x10bc('0x20')]?_['map'](_0x43aef1[_0x10bc('0x20')],function(_0x1f5b2c){return{'model':db[_0x1f5b2c['model']],'as':_0x1f5b2c['as'],'attributes':_0x1f5b2c[_0x10bc('0x23')]};}):[]};}):[]};}):[]:[]})[_0x10bc('0x11')](function(_0x11d2eb){logger[_0x10bc('0x24')](_0x10bc('0x25'),_0x178915);logger[_0x10bc('0x14')](_0x10bc('0x25'),_0x178915,JSON[_0x10bc('0x16')](_0x11d2eb));_0x1eab1e(_0x11d2eb);})[_0x10bc('0x1a')](function(_0x559390){logger[_0x10bc('0x17')](_0x10bc('0x25'),_0x559390[_0x10bc('0x19')],_0x178915);_0x106233(_0x5ad529[_0x10bc('0x17')](0x1f4,_0x559390[_0x10bc('0x19')]));});});};exports[_0x10bc('0x26')]=function(_0x5e117a){var _0x4cba87=this;return new Promise(function(_0x556239,_0x271820){return db[_0x10bc('0x27')][_0x10bc('0x28')]({'raw':_0x5e117a[_0x10bc('0x1c')]?_0x5e117a[_0x10bc('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5e117a[_0x10bc('0x1c')]?_0x5e117a[_0x10bc('0x1c')][_0x10bc('0x1e')]||null:null,'attributes':_0x5e117a[_0x10bc('0x1c')]?_0x5e117a[_0x10bc('0x1c')][_0x10bc('0x23')]||null:null,'include':_0x5e117a[_0x10bc('0x1c')]?_0x5e117a[_0x10bc('0x1c')][_0x10bc('0x20')]?_['map'](_0x5e117a[_0x10bc('0x1c')][_0x10bc('0x20')],function(_0x11ab84){return{'model':db[_0x11ab84[_0x10bc('0x22')]],'as':_0x11ab84['as'],'attributes':_0x11ab84[_0x10bc('0x23')],'include':_0x11ab84['include']?_['map'](_0x11ab84['include'],function(_0xc28921){return{'model':db[_0xc28921[_0x10bc('0x22')]],'as':_0xc28921['as'],'attributes':_0xc28921[_0x10bc('0x23')],'include':_0xc28921[_0x10bc('0x20')]?_[_0x10bc('0x21')](_0xc28921[_0x10bc('0x20')],function(_0x587ef6){return{'model':db[_0x587ef6[_0x10bc('0x22')]],'as':_0x587ef6['as'],'attributes':_0x587ef6[_0x10bc('0x23')]};}):[]};}):[]};}):[]:[]})[_0x10bc('0x11')](function(_0x186026){logger[_0x10bc('0x24')](_0x10bc('0x26'),_0x5e117a);logger[_0x10bc('0x14')]('ShowMailQueue',_0x5e117a,JSON[_0x10bc('0x16')](_0x186026));_0x556239(_0x186026);})[_0x10bc('0x1a')](function(_0x3467d0){logger[_0x10bc('0x17')](_0x10bc('0x26'),_0x3467d0[_0x10bc('0x19')],_0x5e117a);_0x271820(_0x4cba87['error'](0x1f4,_0x3467d0[_0x10bc('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 4b7c1f1..b864416 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 _0x934b=['emit','removeListener','register','mailQueue:','./mailQueue.events','save','remove','update'];(function(_0x20ecf3,_0x2f8b50){var _0x7b6396=function(_0x8a9120){while(--_0x8a9120){_0x20ecf3['push'](_0x20ecf3['shift']());}};_0x7b6396(++_0x2f8b50);}(_0x934b,0xe4));var _0xb934=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0x934b[_0x35d8af];return _0x1d08b0;};'use strict';var MailQueueEvents=require(_0xb934('0x0'));var events=[_0xb934('0x1'),_0xb934('0x2'),_0xb934('0x3')];function createListener(_0x4fbde2,_0x45f536){return function(_0x322de0){_0x45f536[_0xb934('0x4')](_0x4fbde2,_0x322de0);};}function removeListener(_0x2d4e86,_0x2c7cf2){return function(){MailQueueEvents[_0xb934('0x5')](_0x2d4e86,_0x2c7cf2);};}exports[_0xb934('0x6')]=function(_0x40978b){for(var _0x56734c=0x0,_0x27d583=events['length'];_0x56734c<_0x27d583;_0x56734c++){var _0xc9d0a6=events[_0x56734c];var _0x4ddd15=createListener(_0xb934('0x7')+_0xc9d0a6,_0x40978b);MailQueueEvents['on'](_0xc9d0a6,_0x4ddd15);}}; \ No newline at end of file +var _0xf692=['emit','removeListener','length','mailQueue:','./mailQueue.events','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf692,0x1f0));var _0x2f69=function(_0x584b4d,_0x116fdd){_0x584b4d=_0x584b4d-0x0;var _0x163ac8=_0xf692[_0x584b4d];return _0x163ac8;};'use strict';var MailQueueEvents=require(_0x2f69('0x0'));var events=['save','remove',_0x2f69('0x1')];function createListener(_0x2186e8,_0x4ead9f){return function(_0x509e5a){_0x4ead9f[_0x2f69('0x2')](_0x2186e8,_0x509e5a);};}function removeListener(_0x55e611,_0x3426fa){return function(){MailQueueEvents[_0x2f69('0x3')](_0x55e611,_0x3426fa);};}exports['register']=function(_0x22aa74){for(var _0x4b7a69=0x0,_0x3d053c=events[_0x2f69('0x4')];_0x4b7a69<_0x3d053c;_0x4b7a69++){var _0x32e2cf=events[_0x4b7a69];var _0x320a3a=createListener(_0x2f69('0x5')+_0x32e2cf,_0x22aa74);MailQueueEvents['on'](_0x32e2cf,_0x320a3a);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index a51a6b1..4247c1e 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 _0xb1de=['express','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','post','put','delete','exports','path'];(function(_0x1c8ca2,_0x3af582){var _0x1804e3=function(_0x2a79e1){while(--_0x2a79e1){_0x1c8ca2['push'](_0x1c8ca2['shift']());}};_0x1804e3(++_0x3af582);}(_0xb1de,0x6f));var _0xeb1d=function(_0x478c7a,_0x2be71d){_0x478c7a=_0x478c7a-0x0;var _0x1199a6=_0xb1de[_0x478c7a];return _0x1199a6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xeb1d('0x0'));var timeout=require('connect-timeout');var express=require(_0xeb1d('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xeb1d('0x2'));var config=require(_0xeb1d('0x3'));var controller=require(_0xeb1d('0x4'));router[_0xeb1d('0x5')]('/',auth[_0xeb1d('0x6')](),controller[_0xeb1d('0x7')]);router['get'](_0xeb1d('0x8'),auth[_0xeb1d('0x6')](),controller['describe']);router[_0xeb1d('0x5')](_0xeb1d('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xeb1d('0xa')]('/',auth[_0xeb1d('0x6')](),controller['create']);router[_0xeb1d('0xb')](_0xeb1d('0x9'),auth[_0xeb1d('0x6')](),controller['update']);router[_0xeb1d('0xc')](_0xeb1d('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xeb1d('0xd')]=router; \ No newline at end of file +var _0x5516=['index','/describe','isAuthenticated','describe','get','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller'];(function(_0x2ee897,_0x29060b){var _0x16a17e=function(_0x5378d1){while(--_0x5378d1){_0x2ee897['push'](_0x2ee897['shift']());}};_0x16a17e(++_0x29060b);}(_0x5516,0xab));var _0x6551=function(_0x45943a,_0x594756){_0x45943a=_0x45943a-0x0;var _0x96f728=_0x5516[_0x45943a];return _0x96f728;};'use strict';var multer=require(_0x6551('0x0'));var util=require(_0x6551('0x1'));var path=require(_0x6551('0x2'));var timeout=require(_0x6551('0x3'));var express=require(_0x6551('0x4'));var router=express['Router']();var fs_extra=require(_0x6551('0x5'));var auth=require(_0x6551('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6551('0x7'));var controller=require(_0x6551('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6551('0x9')]);router['get'](_0x6551('0xa'),auth[_0x6551('0xb')](),controller[_0x6551('0xc')]);router[_0x6551('0xd')](_0x6551('0xe'),auth[_0x6551('0xb')](),controller[_0x6551('0xf')]);router['post']('/',auth[_0x6551('0xb')](),controller['create']);router[_0x6551('0x10')](_0x6551('0xe'),auth[_0x6551('0xb')](),controller[_0x6551('0x11')]);router['delete'](_0x6551('0xe'),auth['isAuthenticated'](),controller[_0x6551('0x12')]);module[_0x6551('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 6f389c9..8a6d6b4 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 _0x19d1=['moment','sequelize','STRING','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x19d1,0x16c));var _0x119d=function(_0x3bbb00,_0x59eee4){_0x3bbb00=_0x3bbb00-0x0;var _0x4fa863=_0x19d1[_0x3bbb00];return _0x4fa863;};'use strict';var moment=require(_0x119d('0x0'));var Sequelize=require(_0x119d('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x119d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x119d('0x2')]},'joinAt':{'type':Sequelize[_0x119d('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x119d('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x119d('0x2')]}}; \ No newline at end of file +var _0x663f=['DATE','sequelize','exports','STRING'];(function(_0x168a5b,_0x295451){var _0x26bdd9=function(_0x602b2d){while(--_0x602b2d){_0x168a5b['push'](_0x168a5b['shift']());}};_0x26bdd9(++_0x295451);}(_0x663f,0xdd));var _0xf663=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0x663f[_0x1ab180];return _0xfb2c2d;};'use strict';var moment=require('moment');var Sequelize=require(_0xf663('0x0'));module[_0xf663('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xf663('0x2')]},'joinAt':{'type':Sequelize[_0xf663('0x3')]},'leaveAt':{'type':Sequelize[_0xf663('0x3')]},'acceptAt':{'type':Sequelize[_0xf663('0x3')]},'exitAt':{'type':Sequelize[_0xf663('0x3')]},'reason':{'type':Sequelize[_0xf663('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 0a69926..c8b2b6e 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 _0x6a55=['eml-format','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','update','then','destroy','end','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','fields','create','body','find','describe'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6a55,0xdb));var _0x56a5=function(_0x2ade6c,_0x2d42f2){_0x2ade6c=_0x2ade6c-0x0;var _0x2cb372=_0x6a55[_0x2ade6c];return _0x2cb372;};'use strict';var emlformat=require(_0x56a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x56a5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x56a5('0x2'));var util=require('util');var path=require(_0x56a5('0x3'));var sox=require('sox');var csv=require(_0x56a5('0x4'));var ejs=require(_0x56a5('0x5'));var fs=require('fs');var fs_extra=require(_0x56a5('0x6'));var _=require(_0x56a5('0x7'));var squel=require(_0x56a5('0x8'));var crypto=require(_0x56a5('0x9'));var jsforce=require(_0x56a5('0xa'));var deskjs=require(_0x56a5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x56a5('0xc'));var Papa=require(_0x56a5('0xd'));var Redis=require(_0x56a5('0xe'));var authService=require(_0x56a5('0xf'));var qs=require(_0x56a5('0x10'));var as=require(_0x56a5('0x11'));var hardwareService=require(_0x56a5('0x12'));var logger=require(_0x56a5('0x13'))(_0x56a5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x56a5('0x15'));var db=require(_0x56a5('0x16'))['db'];function respondWithStatusCode(_0x2b9d7d,_0x1a9bf0){_0x1a9bf0=_0x1a9bf0||0xcc;return function(_0x2de420){if(_0x2de420){return _0x2b9d7d[_0x56a5('0x17')](_0x1a9bf0);}return _0x2b9d7d['status'](_0x1a9bf0)['end']();};}function respondWithResult(_0x3e3ff6,_0x1e416f){_0x1e416f=_0x1e416f||0xc8;return function(_0x176c7b){if(_0x176c7b){return _0x3e3ff6[_0x56a5('0x18')](_0x1e416f)[_0x56a5('0x19')](_0x176c7b);}};}function respondWithFilteredResult(_0x2db112,_0xe3091f){return function(_0x5c4028){if(_0x5c4028){var _0x360297=typeof _0xe3091f['offset']===_0x56a5('0x1a')&&typeof _0xe3091f['limit']===_0x56a5('0x1a');var _0x3f3e5b=_0x5c4028[_0x56a5('0x1b')];var _0x28fe74=_0x360297?0x0:_0xe3091f[_0x56a5('0x1c')];var _0x143f3d=_0x360297?_0x5c4028[_0x56a5('0x1b')]:_0xe3091f['offset']+_0xe3091f[_0x56a5('0x1d')];var _0x3db687;if(_0x143f3d>=_0x3f3e5b){_0x143f3d=_0x3f3e5b;_0x3db687=0xc8;}else{_0x3db687=0xce;}_0x2db112[_0x56a5('0x18')](_0x3db687);return _0x2db112[_0x56a5('0x1e')]('Content-Range',_0x28fe74+'-'+_0x143f3d+'/'+_0x3f3e5b)[_0x56a5('0x19')](_0x5c4028);}return null;};}function patchUpdates(_0x1fdb7a){return function(_0xa274f4){try{jsonpatch[_0x56a5('0x1f')](_0xa274f4,_0x1fdb7a,!![]);}catch(_0x155d3b){return BPromise['reject'](_0x155d3b);}return _0xa274f4['save']();};}function saveUpdates(_0x29f181,_0x1c4ab8){return function(_0x487505){if(_0x487505){return _0x487505[_0x56a5('0x20')](_0x29f181)[_0x56a5('0x21')](function(_0x615d49){return _0x615d49;});}return null;};}function removeEntity(_0x15d9f8,_0xe1ded0){return function(_0x616922){if(_0x616922){return _0x616922[_0x56a5('0x22')]()[_0x56a5('0x21')](function(){_0x15d9f8[_0x56a5('0x18')](0xcc)[_0x56a5('0x23')]();});}};}function handleEntityNotFound(_0xcf212,_0x2f203f){return function(_0x460bc2){if(!_0x460bc2){_0xcf212['sendStatus'](0x194);}return _0x460bc2;};}function handleError(_0x5c76a7,_0x2d8e68){_0x2d8e68=_0x2d8e68||0x1f4;return function(_0x42cd45){logger[_0x56a5('0x24')](_0x42cd45[_0x56a5('0x25')]);if(_0x42cd45['name']){delete _0x42cd45[_0x56a5('0x26')];}_0x5c76a7['status'](_0x2d8e68)[_0x56a5('0x27')](_0x42cd45);};}exports[_0x56a5('0x28')]=function(_0x1b27b5,_0x284ee5){var _0x4e7afd={},_0x3b55e6={},_0x1f7aeb={'count':0x0,'rows':[]};var _0x178f11=_['map'](db[_0x56a5('0x29')][_0x56a5('0x2a')],function(_0xeb4378){return{'name':_0xeb4378[_0x56a5('0x2b')],'type':_0xeb4378[_0x56a5('0x2c')]['key']};});_0x3b55e6[_0x56a5('0x2d')]=_[_0x56a5('0x2e')](_0x178f11,_0x56a5('0x26'));_0x3b55e6[_0x56a5('0x2f')]=_[_0x56a5('0x30')](_0x1b27b5['query']);_0x3b55e6['filters']=_[_0x56a5('0x31')](_0x3b55e6[_0x56a5('0x2d')],_0x3b55e6[_0x56a5('0x2f')]);_0x4e7afd['attributes']=_[_0x56a5('0x31')](_0x3b55e6[_0x56a5('0x2d')],qs['fields'](_0x1b27b5['query']['fields']));_0x4e7afd['attributes']=_0x4e7afd[_0x56a5('0x32')][_0x56a5('0x33')]?_0x4e7afd[_0x56a5('0x32')]:_0x3b55e6['model'];if(!_0x1b27b5[_0x56a5('0x2f')]['hasOwnProperty'](_0x56a5('0x34'))){_0x4e7afd[_0x56a5('0x1d')]=qs['limit'](_0x1b27b5[_0x56a5('0x2f')]['limit']);_0x4e7afd[_0x56a5('0x1c')]=qs[_0x56a5('0x1c')](_0x1b27b5[_0x56a5('0x2f')]['offset']);}_0x4e7afd[_0x56a5('0x35')]=qs[_0x56a5('0x36')](_0x1b27b5[_0x56a5('0x2f')]['sort']);_0x4e7afd[_0x56a5('0x37')]=qs[_0x56a5('0x38')](_[_0x56a5('0x39')](_0x1b27b5[_0x56a5('0x2f')],_0x3b55e6[_0x56a5('0x38')]),_0x178f11);if(_0x1b27b5['query']['filter']){_0x4e7afd[_0x56a5('0x37')]=_[_0x56a5('0x3a')](_0x4e7afd[_0x56a5('0x37')],{'$or':_[_0x56a5('0x2e')](_0x178f11,function(_0xbf2db6){if(_0xbf2db6[_0x56a5('0x2c')]!==_0x56a5('0x3b')){var _0x652028={};_0x652028[_0xbf2db6[_0x56a5('0x26')]]={'$like':'%'+_0x1b27b5[_0x56a5('0x2f')][_0x56a5('0x3c')]+'%'};return _0x652028;}})});}_0x4e7afd=_[_0x56a5('0x3a')]({},_0x4e7afd,_0x1b27b5[_0x56a5('0x3d')]);var _0x389c01={'where':_0x4e7afd[_0x56a5('0x37')]};return db[_0x56a5('0x29')][_0x56a5('0x1b')](_0x389c01)[_0x56a5('0x21')](function(_0xf0f6c8){_0x1f7aeb[_0x56a5('0x1b')]=_0xf0f6c8;if(_0x1b27b5[_0x56a5('0x2f')][_0x56a5('0x3e')]){_0x4e7afd['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x56a5('0x3f')](_0x4e7afd);})['then'](function(_0x7c3c3e){_0x1f7aeb[_0x56a5('0x40')]=_0x7c3c3e;return _0x1f7aeb;})[_0x56a5('0x21')](respondWithFilteredResult(_0x284ee5,_0x4e7afd))[_0x56a5('0x41')](handleError(_0x284ee5,null));};exports[_0x56a5('0x42')]=function(_0x1160da,_0x5618f9){var _0x5c565a={'raw':!![],'where':{'id':_0x1160da[_0x56a5('0x43')]['id']}},_0x29ab9b={};_0x29ab9b[_0x56a5('0x2d')]=_[_0x56a5('0x30')](db[_0x56a5('0x29')][_0x56a5('0x2a')]);_0x29ab9b['query']=_[_0x56a5('0x30')](_0x1160da[_0x56a5('0x2f')]);_0x29ab9b['filters']=_[_0x56a5('0x31')](_0x29ab9b[_0x56a5('0x2d')],_0x29ab9b[_0x56a5('0x2f')]);_0x5c565a[_0x56a5('0x32')]=_['intersection'](_0x29ab9b[_0x56a5('0x2d')],qs['fields'](_0x1160da[_0x56a5('0x2f')][_0x56a5('0x44')]));_0x5c565a['attributes']=_0x5c565a[_0x56a5('0x32')]['length']?_0x5c565a[_0x56a5('0x32')]:_0x29ab9b[_0x56a5('0x2d')];if(_0x1160da['query'][_0x56a5('0x3e')]){_0x5c565a['include']=[{'all':!![]}];}_0x5c565a=_[_0x56a5('0x3a')]({},_0x5c565a,_0x1160da['options']);return db[_0x56a5('0x29')]['find'](_0x5c565a)[_0x56a5('0x21')](handleEntityNotFound(_0x5618f9,null))[_0x56a5('0x21')](respondWithResult(_0x5618f9,null))[_0x56a5('0x41')](handleError(_0x5618f9,null));};exports[_0x56a5('0x45')]=function(_0x30d377,_0x43196d){return db[_0x56a5('0x29')]['create'](_0x30d377['body'],{})['then'](respondWithResult(_0x43196d,0xc9))[_0x56a5('0x41')](handleError(_0x43196d,null));};exports[_0x56a5('0x20')]=function(_0x1e510a,_0x55d2e2){if(_0x1e510a[_0x56a5('0x46')]['id']){delete _0x1e510a[_0x56a5('0x46')]['id'];}return db[_0x56a5('0x29')]['find']({'where':{'id':_0x1e510a[_0x56a5('0x43')]['id']}})[_0x56a5('0x21')](handleEntityNotFound(_0x55d2e2,null))['then'](saveUpdates(_0x1e510a[_0x56a5('0x46')],null))[_0x56a5('0x21')](respondWithResult(_0x55d2e2,null))[_0x56a5('0x41')](handleError(_0x55d2e2,null));};exports[_0x56a5('0x22')]=function(_0xcb3cb9,_0x58d308){return db[_0x56a5('0x29')][_0x56a5('0x47')]({'where':{'id':_0xcb3cb9[_0x56a5('0x43')]['id']}})[_0x56a5('0x21')](handleEntityNotFound(_0x58d308,null))[_0x56a5('0x21')](removeEntity(_0x58d308,null))['catch'](handleError(_0x58d308,null));};exports[_0x56a5('0x48')]=function(_0x3bda32,_0x597e52){return db[_0x56a5('0x29')][_0x56a5('0x48')]()[_0x56a5('0x21')](respondWithResult(_0x597e52,null))['catch'](handleError(_0x597e52,null));}; \ No newline at end of file +var _0xfb11=['create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','type','key','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','rows','params','find','catch'];(function(_0x47d1f9,_0x1d133b){var _0x4dcb24=function(_0x42caf4){while(--_0x42caf4){_0x47d1f9['push'](_0x47d1f9['shift']());}};_0x4dcb24(++_0x1d133b);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xfb11[_0x45e98e];return _0x374dba;};'use strict';var emlformat=require(_0x1fb1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1fb1('0x1'));var jsonpatch=require(_0x1fb1('0x2'));var rp=require('request-promise');var moment=require(_0x1fb1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1fb1('0x4'));var util=require('util');var path=require(_0x1fb1('0x5'));var sox=require(_0x1fb1('0x6'));var csv=require('to-csv');var ejs=require(_0x1fb1('0x7'));var fs=require('fs');var fs_extra=require(_0x1fb1('0x8'));var _=require('lodash');var squel=require(_0x1fb1('0x9'));var crypto=require(_0x1fb1('0xa'));var jsforce=require(_0x1fb1('0xb'));var deskjs=require(_0x1fb1('0xc'));var toCsv=require(_0x1fb1('0xd'));var querystring=require(_0x1fb1('0xe'));var Papa=require(_0x1fb1('0xf'));var Redis=require(_0x1fb1('0x10'));var authService=require(_0x1fb1('0x11'));var qs=require(_0x1fb1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1fb1('0x13'));var logger=require('../../config/logger')(_0x1fb1('0x14'));var utils=require('../../config/utils');var config=require(_0x1fb1('0x15'));var licenseUtil=require(_0x1fb1('0x16'));var db=require(_0x1fb1('0x17'))['db'];function respondWithStatusCode(_0x10bcac,_0x333229){_0x333229=_0x333229||0xcc;return function(_0x14f290){if(_0x14f290){return _0x10bcac['sendStatus'](_0x333229);}return _0x10bcac[_0x1fb1('0x18')](_0x333229)[_0x1fb1('0x19')]();};}function respondWithResult(_0x2c5be1,_0x44f24c){_0x44f24c=_0x44f24c||0xc8;return function(_0xd83038){if(_0xd83038){return _0x2c5be1[_0x1fb1('0x18')](_0x44f24c)[_0x1fb1('0x1a')](_0xd83038);}};}function respondWithFilteredResult(_0x316fe5,_0x358b58){return function(_0x4cbe42){if(_0x4cbe42){var _0x5c8d23=typeof _0x358b58[_0x1fb1('0x1b')]===_0x1fb1('0x1c')&&typeof _0x358b58[_0x1fb1('0x1d')]==='undefined';var _0x161ca3=_0x4cbe42[_0x1fb1('0x1e')];var _0x24d4df=_0x5c8d23?0x0:_0x358b58[_0x1fb1('0x1b')];var _0x33c6b6=_0x5c8d23?_0x4cbe42[_0x1fb1('0x1e')]:_0x358b58[_0x1fb1('0x1b')]+_0x358b58[_0x1fb1('0x1d')];var _0x4041ea;if(_0x33c6b6>=_0x161ca3){_0x33c6b6=_0x161ca3;_0x4041ea=0xc8;}else{_0x4041ea=0xce;}_0x316fe5['status'](_0x4041ea);return _0x316fe5[_0x1fb1('0x1f')]('Content-Range',_0x24d4df+'-'+_0x33c6b6+'/'+_0x161ca3)['json'](_0x4cbe42);}return null;};}function patchUpdates(_0xdf9c1b){return function(_0x313d9a){try{jsonpatch[_0x1fb1('0x20')](_0x313d9a,_0xdf9c1b,!![]);}catch(_0x54ad97){return BPromise[_0x1fb1('0x21')](_0x54ad97);}return _0x313d9a['save']();};}function saveUpdates(_0x5c76f5,_0x532c63){return function(_0x31178c){if(_0x31178c){return _0x31178c[_0x1fb1('0x22')](_0x5c76f5)[_0x1fb1('0x23')](function(_0x10924f){return _0x10924f;});}return null;};}function removeEntity(_0x303a06,_0x53b8af){return function(_0x4272c7){if(_0x4272c7){return _0x4272c7[_0x1fb1('0x24')]()[_0x1fb1('0x23')](function(){_0x303a06[_0x1fb1('0x18')](0xcc)[_0x1fb1('0x19')]();});}};}function handleEntityNotFound(_0x1353a4,_0x3680b5){return function(_0x2de1d4){if(!_0x2de1d4){_0x1353a4['sendStatus'](0x194);}return _0x2de1d4;};}function handleError(_0x1b25b3,_0x1aac7d){_0x1aac7d=_0x1aac7d||0x1f4;return function(_0x46ff60){logger[_0x1fb1('0x25')](_0x46ff60[_0x1fb1('0x26')]);if(_0x46ff60[_0x1fb1('0x27')]){delete _0x46ff60[_0x1fb1('0x27')];}_0x1b25b3[_0x1fb1('0x18')](_0x1aac7d)[_0x1fb1('0x28')](_0x46ff60);};}exports[_0x1fb1('0x29')]=function(_0x5e99e7,_0x497017){var _0x39fc43={},_0xe8ec0a={},_0x2f6c88={'count':0x0,'rows':[]};var _0x520ee2=_[_0x1fb1('0x2a')](db[_0x1fb1('0x2b')][_0x1fb1('0x2c')],function(_0x1b71cb){return{'name':_0x1b71cb['fieldName'],'type':_0x1b71cb[_0x1fb1('0x2d')][_0x1fb1('0x2e')]};});_0xe8ec0a['model']=_[_0x1fb1('0x2a')](_0x520ee2,'name');_0xe8ec0a['query']=_[_0x1fb1('0x2f')](_0x5e99e7[_0x1fb1('0x30')]);_0xe8ec0a['filters']=_[_0x1fb1('0x31')](_0xe8ec0a[_0x1fb1('0x32')],_0xe8ec0a[_0x1fb1('0x30')]);_0x39fc43[_0x1fb1('0x33')]=_[_0x1fb1('0x31')](_0xe8ec0a['model'],qs[_0x1fb1('0x34')](_0x5e99e7[_0x1fb1('0x30')][_0x1fb1('0x34')]));_0x39fc43[_0x1fb1('0x33')]=_0x39fc43[_0x1fb1('0x33')][_0x1fb1('0x35')]?_0x39fc43[_0x1fb1('0x33')]:_0xe8ec0a[_0x1fb1('0x32')];if(!_0x5e99e7[_0x1fb1('0x30')]['hasOwnProperty'](_0x1fb1('0x36'))){_0x39fc43['limit']=qs[_0x1fb1('0x1d')](_0x5e99e7['query'][_0x1fb1('0x1d')]);_0x39fc43['offset']=qs['offset'](_0x5e99e7[_0x1fb1('0x30')][_0x1fb1('0x1b')]);}_0x39fc43[_0x1fb1('0x37')]=qs[_0x1fb1('0x38')](_0x5e99e7['query'][_0x1fb1('0x38')]);_0x39fc43[_0x1fb1('0x39')]=qs[_0x1fb1('0x3a')](_['pick'](_0x5e99e7[_0x1fb1('0x30')],_0xe8ec0a[_0x1fb1('0x3a')]),_0x520ee2);if(_0x5e99e7[_0x1fb1('0x30')][_0x1fb1('0x3b')]){_0x39fc43[_0x1fb1('0x39')]=_[_0x1fb1('0x3c')](_0x39fc43[_0x1fb1('0x39')],{'$or':_['map'](_0x520ee2,function(_0x3a8a63){if(_0x3a8a63[_0x1fb1('0x2d')]!=='VIRTUAL'){var _0x473894={};_0x473894[_0x3a8a63['name']]={'$like':'%'+_0x5e99e7[_0x1fb1('0x30')][_0x1fb1('0x3b')]+'%'};return _0x473894;}})});}_0x39fc43=_[_0x1fb1('0x3c')]({},_0x39fc43,_0x5e99e7[_0x1fb1('0x3d')]);var _0x1a0b32={'where':_0x39fc43[_0x1fb1('0x39')]};return db[_0x1fb1('0x2b')][_0x1fb1('0x1e')](_0x1a0b32)[_0x1fb1('0x23')](function(_0x2c023e){_0x2f6c88[_0x1fb1('0x1e')]=_0x2c023e;if(_0x5e99e7[_0x1fb1('0x30')][_0x1fb1('0x3e')]){_0x39fc43[_0x1fb1('0x3f')]=[{'all':!![]}];}return db[_0x1fb1('0x2b')]['findAll'](_0x39fc43);})[_0x1fb1('0x23')](function(_0xca1fd3){_0x2f6c88[_0x1fb1('0x40')]=_0xca1fd3;return _0x2f6c88;})[_0x1fb1('0x23')](respondWithFilteredResult(_0x497017,_0x39fc43))['catch'](handleError(_0x497017,null));};exports['show']=function(_0xf6f17d,_0xef42e0){var _0x307faf={'raw':!![],'where':{'id':_0xf6f17d[_0x1fb1('0x41')]['id']}},_0x3edc8a={};_0x3edc8a[_0x1fb1('0x32')]=_[_0x1fb1('0x2f')](db[_0x1fb1('0x2b')][_0x1fb1('0x2c')]);_0x3edc8a[_0x1fb1('0x30')]=_['keys'](_0xf6f17d[_0x1fb1('0x30')]);_0x3edc8a['filters']=_['intersection'](_0x3edc8a[_0x1fb1('0x32')],_0x3edc8a[_0x1fb1('0x30')]);_0x307faf[_0x1fb1('0x33')]=_[_0x1fb1('0x31')](_0x3edc8a['model'],qs['fields'](_0xf6f17d[_0x1fb1('0x30')][_0x1fb1('0x34')]));_0x307faf[_0x1fb1('0x33')]=_0x307faf[_0x1fb1('0x33')][_0x1fb1('0x35')]?_0x307faf[_0x1fb1('0x33')]:_0x3edc8a[_0x1fb1('0x32')];if(_0xf6f17d[_0x1fb1('0x30')][_0x1fb1('0x3e')]){_0x307faf['include']=[{'all':!![]}];}_0x307faf=_['merge']({},_0x307faf,_0xf6f17d[_0x1fb1('0x3d')]);return db['MailQueueReport'][_0x1fb1('0x42')](_0x307faf)[_0x1fb1('0x23')](handleEntityNotFound(_0xef42e0,null))[_0x1fb1('0x23')](respondWithResult(_0xef42e0,null))[_0x1fb1('0x43')](handleError(_0xef42e0,null));};exports[_0x1fb1('0x44')]=function(_0x3c3fbf,_0x5af135){return db[_0x1fb1('0x2b')][_0x1fb1('0x44')](_0x3c3fbf[_0x1fb1('0x45')],{})['then'](respondWithResult(_0x5af135,0xc9))[_0x1fb1('0x43')](handleError(_0x5af135,null));};exports['update']=function(_0x6e105b,_0xba4fa7){if(_0x6e105b[_0x1fb1('0x45')]['id']){delete _0x6e105b['body']['id'];}return db[_0x1fb1('0x2b')][_0x1fb1('0x42')]({'where':{'id':_0x6e105b['params']['id']}})[_0x1fb1('0x23')](handleEntityNotFound(_0xba4fa7,null))[_0x1fb1('0x23')](saveUpdates(_0x6e105b[_0x1fb1('0x45')],null))['then'](respondWithResult(_0xba4fa7,null))['catch'](handleError(_0xba4fa7,null));};exports['destroy']=function(_0x31a85a,_0x2365b5){return db[_0x1fb1('0x2b')][_0x1fb1('0x42')]({'where':{'id':_0x31a85a[_0x1fb1('0x41')]['id']}})[_0x1fb1('0x23')](handleEntityNotFound(_0x2365b5,null))['then'](removeEntity(_0x2365b5,null))['catch'](handleError(_0x2365b5,null));};exports[_0x1fb1('0x46')]=function(_0x2a6898,_0x2d03d2){return db[_0x1fb1('0x2b')]['describe']()['then'](respondWithResult(_0x2d03d2,null))[_0x1fb1('0x43')](handleError(_0x2d03d2,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index b02469e..d55b6ca 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 _0x7d81=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','report_mail_queue','uniqueid'];(function(_0x5cc9ae,_0x570ed4){var _0x269d95=function(_0x1d6efd){while(--_0x1d6efd){_0x5cc9ae['push'](_0x5cc9ae['shift']());}};_0x269d95(++_0x570ed4);}(_0x7d81,0xc3));var _0x17d8=function(_0x2db4c1,_0x3d87fd){_0x2db4c1=_0x2db4c1-0x0;var _0x3fe1c3=_0x7d81[_0x2db4c1];return _0x3fe1c3;};'use strict';var _=require(_0x17d8('0x0'));var util=require(_0x17d8('0x1'));var logger=require(_0x17d8('0x2'))('api');var moment=require(_0x17d8('0x3'));var BPromise=require(_0x17d8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x17d8('0x5'));var rimraf=require(_0x17d8('0x6'));var config=require(_0x17d8('0x7'));var attributes=require(_0x17d8('0x8'));module[_0x17d8('0x9')]=function(_0x571508,_0x5a9d39){return _0x571508[_0x17d8('0xa')]('MailQueueReport',attributes,{'tableName':_0x17d8('0xb'),'paranoid':![],'indexes':[{'name':_0x17d8('0xc'),'fields':[_0x17d8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb16a=['define','MailQueueReport','report_mail_queue','uniqueid','lodash','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x828160,_0x26d5be){var _0x296b5f=function(_0x5e16e3){while(--_0x5e16e3){_0x828160['push'](_0x828160['shift']());}};_0x296b5f(++_0x26d5be);}(_0xb16a,0x178));var _0xab16=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb16a[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xab16('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xab16('0x1'));var moment=require(_0xab16('0x2'));var BPromise=require(_0xab16('0x3'));var rp=require(_0xab16('0x4'));var fs=require('fs');var path=require(_0xab16('0x5'));var rimraf=require('rimraf');var config=require(_0xab16('0x6'));var attributes=require('./mailQueueReport.attributes');module[_0xab16('0x7')]=function(_0x5b3798,_0x457ef9){return _0x5b3798[_0xab16('0x8')](_0xab16('0x9'),attributes,{'tableName':_0xab16('0xa'),'paranoid':![],'indexes':[{'name':_0xab16('0xb'),'fields':[_0xab16('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 156ca27..7b5b6f1 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 _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x11722e,_0x3ce12a){var _0x486b33=function(_0x5ecb68){while(--_0x5ecb68){_0x11722e['push'](_0x11722e['shift']());}};_0x486b33(++_0x3ce12a);}(_0xadb5,0xad));var _0x5adb=function(_0x2b7abf,_0x19446d){_0x2b7abf=_0x2b7abf-0x0;var _0x47f33f=_0xadb5[_0x2b7abf];return _0x47f33f;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x50b75f,_0x172d02){var _0x3d0c35=function(_0x41f3db){while(--_0x41f3db){_0x50b75f['push'](_0x50b75f['shift']());}};_0x3d0c35(++_0x172d02);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xc4aa[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index dd4efbf..010dfb3 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3e9155,_0x38e9d2){var _0x5de67a=function(_0x177031){while(--_0x177031){_0x3e9155['push'](_0x3e9155['shift']());}};_0x5de67a(++_0x38e9d2);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x26478e,_0xa4ba6c){var _0x342471=function(_0xeffbd3){while(--_0xeffbd3){_0x26478e['push'](_0x26478e['shift']());}};_0x342471(++_0xa4ba6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 117af97..005990b 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 _0x7858=['INBOX','exports','STRING','BOOLEAN','INTEGER'];(function(_0x65eb4,_0x39e903){var _0x53d0b2=function(_0x5e8847){while(--_0x5e8847){_0x65eb4['push'](_0x65eb4['shift']());}};_0x53d0b2(++_0x39e903);}(_0x7858,0x132));var _0x8785=function(_0x4b2793,_0x4c8e4a){_0x4b2793=_0x4b2793-0x0;var _0x3ab477=_0x7858[_0x4b2793];return _0x3ab477;};'use strict';var Sequelize=require('sequelize');module[_0x8785('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x8785('0x1')]},'authentication':{'type':Sequelize[_0x8785('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x8785('0x1')]},'password':{'type':Sequelize[_0x8785('0x1')]},'port':{'type':Sequelize[_0x8785('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x8785('0x1')],'defaultValue':_0x8785('0x4')},'connTimeout':{'type':Sequelize[_0x8785('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x8785('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x8785('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x31b2=['INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x31b2,0xa4));var _0x231b=function(_0xd63e3a,_0x1bd6eb){_0xd63e3a=_0xd63e3a-0x0;var _0x19c178=_0x31b2[_0xd63e3a];return _0x19c178;};'use strict';var Sequelize=require(_0x231b('0x0'));module[_0x231b('0x1')]={'description':{'type':Sequelize[_0x231b('0x2')]},'host':{'type':Sequelize[_0x231b('0x2')]},'authentication':{'type':Sequelize[_0x231b('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x231b('0x2')]},'password':{'type':Sequelize[_0x231b('0x2')]},'port':{'type':Sequelize[_0x231b('0x4')]},'tls':{'type':Sequelize[_0x231b('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x231b('0x2')],'defaultValue':_0x231b('0x5')},'connTimeout':{'type':Sequelize[_0x231b('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x231b('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x231b('0x2')]},'modernAuthentication':{'type':Sequelize[_0x231b('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 b83c6ab..865fc80 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 _0xf024=['MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports'];(function(_0x4d8bed,_0x292561){var _0x5c5256=function(_0x1d165b){while(--_0x1d165b){_0x4d8bed['push'](_0x4d8bed['shift']());}};_0x5c5256(++_0x292561);}(_0xf024,0xf2));var _0x4f02=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xf024[_0x2112d4];return _0x434972;};'use strict';var _=require(_0x4f02('0x0'));var util=require(_0x4f02('0x1'));var logger=require(_0x4f02('0x2'))(_0x4f02('0x3'));var moment=require(_0x4f02('0x4'));var BPromise=require('bluebird');var rp=require(_0x4f02('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f02('0x6'));var config=require(_0x4f02('0x7'));var attributes=require(_0x4f02('0x8'));module[_0x4f02('0x9')]=function(_0x176101,_0x5e7bfb){return _0x176101['define'](_0x4f02('0xa'),attributes,{'tableName':_0x4f02('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60f9=['mail_servers_in','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./mailServerIn.attributes','define','MailServerIn'];(function(_0x177c50,_0x22feee){var _0x443456=function(_0x22d178){while(--_0x22d178){_0x177c50['push'](_0x177c50['shift']());}};_0x443456(++_0x22feee);}(_0x60f9,0xc7));var _0x960f=function(_0x4a5944,_0x148ba0){_0x4a5944=_0x4a5944-0x0;var _0xd16594=_0x60f9[_0x4a5944];return _0xd16594;};'use strict';var _=require(_0x960f('0x0'));var util=require(_0x960f('0x1'));var logger=require(_0x960f('0x2'))(_0x960f('0x3'));var moment=require(_0x960f('0x4'));var BPromise=require('bluebird');var rp=require(_0x960f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x960f('0x6'));var attributes=require(_0x960f('0x7'));module['exports']=function(_0x34c14c,_0xabe5ea){return _0x34c14c[_0x960f('0x8')](_0x960f('0x9'),attributes,{'tableName':_0x960f('0xa'),'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 e92eded..f5b2233 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 _0x05d9=['model','lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map'];(function(_0xfc4776,_0x298a7b){var _0x43961e=function(_0x49b921){while(--_0x49b921){_0xfc4776['push'](_0xfc4776['shift']());}};_0x43961e(++_0x298a7b);}(_0x05d9,0xc1));var _0x905d=function(_0x1d6cab,_0x2dc47b){_0x1d6cab=_0x1d6cab-0x0;var _0x488e84=_0x05d9[_0x1d6cab];return _0x488e84;};'use strict';var _=require(_0x905d('0x0'));var util=require(_0x905d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x905d('0x2'));var fs=require('fs');var Redis=require(_0x905d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x905d('0x4'));var logger=require('../../config/logger')(_0x905d('0x5'));var config=require(_0x905d('0x6'));var jayson=require(_0x905d('0x7'));var client=jayson['client'][_0x905d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1cee5f,_0x11856d,_0x22192d){return new BPromise(function(_0x3bb995,_0x345ecc){return client[_0x905d('0x9')](_0x1cee5f,_0x22192d)[_0x905d('0xa')](function(_0xb0701d){logger[_0x905d('0xb')]('MailServerIn,\x20%s,\x20%s',_0x11856d,'request\x20sent');logger[_0x905d('0xc')](_0x905d('0xd'),_0x11856d,_0x905d('0xe'),JSON[_0x905d('0xf')](_0xb0701d));if(_0xb0701d[_0x905d('0x10')]){if(_0xb0701d[_0x905d('0x10')][_0x905d('0x11')]===0x1f4){logger['error'](_0x905d('0x12'),_0x11856d,_0xb0701d[_0x905d('0x10')][_0x905d('0x13')]);return _0x345ecc(_0xb0701d[_0x905d('0x10')][_0x905d('0x13')]);}logger['error'](_0x905d('0x12'),_0x11856d,_0xb0701d['error'][_0x905d('0x13')]);return _0x3bb995(_0xb0701d['error']['message']);}else{logger[_0x905d('0xb')](_0x905d('0x12'),_0x11856d,_0x905d('0xe'));_0x3bb995(_0xb0701d['result']['message']);}})[_0x905d('0x14')](function(_0x28acab){logger[_0x905d('0x10')](_0x905d('0x12'),_0x11856d,_0x28acab);_0x345ecc(_0x28acab);});});}exports[_0x905d('0x15')]=function(_0x3cae0b){var _0x5f57ac=this;return new Promise(function(_0x3ffe9b,_0x2e4d0c){return db[_0x905d('0x16')][_0x905d('0x17')]({'raw':_0x3cae0b['options']?_0x3cae0b[_0x905d('0x18')][_0x905d('0x19')]===undefined?!![]:![]:!![],'where':_0x3cae0b[_0x905d('0x18')]?_0x3cae0b[_0x905d('0x18')][_0x905d('0x1a')]||null:null,'attributes':_0x3cae0b[_0x905d('0x18')]?_0x3cae0b[_0x905d('0x18')][_0x905d('0x1b')]||null:null,'limit':_0x3cae0b[_0x905d('0x18')]?_0x3cae0b[_0x905d('0x18')][_0x905d('0x1c')]||null:null,'include':_0x3cae0b[_0x905d('0x18')]?_0x3cae0b[_0x905d('0x18')][_0x905d('0x1d')]?_['map'](_0x3cae0b[_0x905d('0x18')][_0x905d('0x1d')],function(_0x5c78f5){return{'model':db[_0x5c78f5['model']],'as':_0x5c78f5['as'],'attributes':_0x5c78f5[_0x905d('0x1b')],'include':_0x5c78f5[_0x905d('0x1d')]?_[_0x905d('0x1e')](_0x5c78f5[_0x905d('0x1d')],function(_0x398061){return{'model':db[_0x398061['model']],'as':_0x398061['as'],'attributes':_0x398061[_0x905d('0x1b')],'include':_0x398061[_0x905d('0x1d')]?_[_0x905d('0x1e')](_0x398061[_0x905d('0x1d')],function(_0x2de59b){return{'model':db[_0x2de59b[_0x905d('0x1f')]],'as':_0x2de59b['as'],'attributes':_0x2de59b[_0x905d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x905d('0xa')](function(_0x5eb3e5){logger[_0x905d('0xb')](_0x905d('0x15'),_0x3cae0b);logger[_0x905d('0xc')](_0x905d('0x15'),_0x3cae0b,JSON[_0x905d('0xf')](_0x5eb3e5));_0x3ffe9b(_0x5eb3e5);})['catch'](function(_0x9de628){logger['error']('GetMailServerIn',_0x9de628['message'],_0x3cae0b);_0x2e4d0c(_0x5f57ac[_0x905d('0x10')](0x1f4,_0x9de628[_0x905d('0x13')]));});});}; \ No newline at end of file +var _0x38dc=['catch','GetMailServerIn','findAll','options','where','attributes','map','model','include','moment','bluebird','../../config/utils','rpc','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x38dc,0x117));var _0xc38d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x38dc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc38d('0x0'));var BPromise=require(_0xc38d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc38d('0x2'));var logger=require('../../config/logger')(_0xc38d('0x3'));var config=require('../../config/environment');var jayson=require(_0xc38d('0x4'));var client=jayson[_0xc38d('0x5')][_0xc38d('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x15a1fc,_0x19ebd3,_0x12ba6a){return new BPromise(function(_0x52cd19,_0x28209f){return client[_0xc38d('0x7')](_0x15a1fc,_0x12ba6a)[_0xc38d('0x8')](function(_0x30dde9){logger[_0xc38d('0x9')](_0xc38d('0xa'),_0x19ebd3,_0xc38d('0xb'));logger[_0xc38d('0xc')](_0xc38d('0xd'),_0x19ebd3,'request\x20sent',JSON[_0xc38d('0xe')](_0x30dde9));if(_0x30dde9['error']){if(_0x30dde9[_0xc38d('0xf')]['code']===0x1f4){logger[_0xc38d('0xf')](_0xc38d('0xa'),_0x19ebd3,_0x30dde9['error']['message']);return _0x28209f(_0x30dde9['error'][_0xc38d('0x10')]);}logger[_0xc38d('0xf')](_0xc38d('0xa'),_0x19ebd3,_0x30dde9[_0xc38d('0xf')][_0xc38d('0x10')]);return _0x52cd19(_0x30dde9[_0xc38d('0xf')][_0xc38d('0x10')]);}else{logger['info'](_0xc38d('0xa'),_0x19ebd3,'request\x20sent');_0x52cd19(_0x30dde9[_0xc38d('0x11')][_0xc38d('0x10')]);}})[_0xc38d('0x12')](function(_0x456218){logger['error'](_0xc38d('0xa'),_0x19ebd3,_0x456218);_0x28209f(_0x456218);});});}exports[_0xc38d('0x13')]=function(_0xc01865){var _0x4a757b=this;return new Promise(function(_0x27c320,_0x3af243){return db['MailServerIn'][_0xc38d('0x14')]({'raw':_0xc01865[_0xc38d('0x15')]?_0xc01865[_0xc38d('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0xc01865['options']?_0xc01865[_0xc38d('0x15')][_0xc38d('0x16')]||null:null,'attributes':_0xc01865['options']?_0xc01865['options'][_0xc38d('0x17')]||null:null,'limit':_0xc01865[_0xc38d('0x15')]?_0xc01865['options']['limit']||null:null,'include':_0xc01865[_0xc38d('0x15')]?_0xc01865[_0xc38d('0x15')]['include']?_[_0xc38d('0x18')](_0xc01865[_0xc38d('0x15')]['include'],function(_0x1e23f5){return{'model':db[_0x1e23f5[_0xc38d('0x19')]],'as':_0x1e23f5['as'],'attributes':_0x1e23f5[_0xc38d('0x17')],'include':_0x1e23f5['include']?_[_0xc38d('0x18')](_0x1e23f5[_0xc38d('0x1a')],function(_0x4a57c5){return{'model':db[_0x4a57c5[_0xc38d('0x19')]],'as':_0x4a57c5['as'],'attributes':_0x4a57c5[_0xc38d('0x17')],'include':_0x4a57c5[_0xc38d('0x1a')]?_['map'](_0x4a57c5[_0xc38d('0x1a')],function(_0x164413){return{'model':db[_0x164413['model']],'as':_0x164413['as'],'attributes':_0x164413[_0xc38d('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc38d('0x8')](function(_0x5f48a2){logger['info'](_0xc38d('0x13'),_0xc01865);logger['debug'](_0xc38d('0x13'),_0xc01865,JSON['stringify'](_0x5f48a2));_0x27c320(_0x5f48a2);})['catch'](function(_0x9b0c67){logger[_0xc38d('0xf')](_0xc38d('0x13'),_0x9b0c67['message'],_0xc01865);_0x3af243(_0x4a757b[_0xc38d('0xf')](0x1f4,_0x9b0c67[_0xc38d('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index d251c5e..2ba726a 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(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x7a54,0x106));var _0x47a5=function(_0xa7275,_0x267cb9){_0xa7275=_0xa7275-0x0;var _0x41826e=_0x7a54[_0xa7275];return _0x41826e;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 2d8a413..c205b4f 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 _0x1339=['BOOLEAN','STRING','INTEGER'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1339,0x1ed));var _0x9133=function(_0x2a5c9d,_0x5ff681){_0x2a5c9d=_0x2a5c9d-0x0;var _0x170c51=_0x1339[_0x2a5c9d];return _0x170c51;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x9133('0x0')]},'host':{'type':Sequelize[_0x9133('0x0')]},'user':{'type':Sequelize[_0x9133('0x0')]},'pass':{'type':Sequelize[_0x9133('0x0')]},'port':{'type':Sequelize[_0x9133('0x1')]},'secure':{'type':Sequelize[_0x9133('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x9133('0x0')]},'authentication':{'type':Sequelize[_0x9133('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x96cc=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x3b4691,_0x297c4d){var _0x5d4691=function(_0x1d2e6c){while(--_0x1d2e6c){_0x3b4691['push'](_0x3b4691['shift']());}};_0x5d4691(++_0x297c4d);}(_0x96cc,0x16c));var _0xc96c=function(_0x1ceb40,_0xba13f3){_0x1ceb40=_0x1ceb40-0x0;var _0x39e07c=_0x96cc[_0x1ceb40];return _0x39e07c;};'use strict';var Sequelize=require(_0xc96c('0x0'));module['exports']={'description':{'type':Sequelize[_0xc96c('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xc96c('0x1')]},'pass':{'type':Sequelize[_0xc96c('0x1')]},'port':{'type':Sequelize[_0xc96c('0x2')]},'secure':{'type':Sequelize[_0xc96c('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xc96c('0x1')]},'authentication':{'type':Sequelize[_0xc96c('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xc96c('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 7ca8d71..106aa84 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 _0xc85e=['name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','show','params','intersection','find','create','body','catch','destroy','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','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','sendStatus','status','end','undefined','limit','offset','count','json','apply','reject','save','update','then','error'];(function(_0x211d9f,_0x529df2){var _0x94e2ed=function(_0x3de81f){while(--_0x3de81f){_0x211d9f['push'](_0x211d9f['shift']());}};_0x94e2ed(++_0x529df2);}(_0xc85e,0x186));var _0xec85=function(_0x431fa5,_0x2a377a){_0x431fa5=_0x431fa5-0x0;var _0x3cce13=_0xc85e[_0x431fa5];return _0x3cce13;};'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(_0xec85('0x0'));var moment=require(_0xec85('0x1'));var BPromise=require(_0xec85('0x2'));var Mustache=require(_0xec85('0x3'));var util=require(_0xec85('0x4'));var path=require(_0xec85('0x5'));var sox=require('sox');var csv=require(_0xec85('0x6'));var ejs=require(_0xec85('0x7'));var fs=require('fs');var fs_extra=require(_0xec85('0x8'));var _=require('lodash');var squel=require(_0xec85('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xec85('0xa'));var toCsv=require('to-csv');var querystring=require(_0xec85('0xb'));var Papa=require(_0xec85('0xc'));var Redis=require(_0xec85('0xd'));var authService=require(_0xec85('0xe'));var qs=require(_0xec85('0xf'));var as=require(_0xec85('0x10'));var hardwareService=require(_0xec85('0x11'));var logger=require(_0xec85('0x12'))('api');var utils=require(_0xec85('0x13'));var config=require(_0xec85('0x14'));var licenseUtil=require(_0xec85('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40fa6a,_0x3f6fac){_0x3f6fac=_0x3f6fac||0xcc;return function(_0x51acbb){if(_0x51acbb){return _0x40fa6a[_0xec85('0x16')](_0x3f6fac);}return _0x40fa6a[_0xec85('0x17')](_0x3f6fac)[_0xec85('0x18')]();};}function respondWithResult(_0x41e034,_0x29808b){_0x29808b=_0x29808b||0xc8;return function(_0x57aed1){if(_0x57aed1){return _0x41e034[_0xec85('0x17')](_0x29808b)['json'](_0x57aed1);}};}function respondWithFilteredResult(_0x2bc345,_0x2c21be){return function(_0xc33036){if(_0xc33036){var _0x2ffab1=typeof _0x2c21be['offset']===_0xec85('0x19')&&typeof _0x2c21be[_0xec85('0x1a')]==='undefined';var _0x7bcbfd=_0xc33036['count'];var _0x3f770c=_0x2ffab1?0x0:_0x2c21be[_0xec85('0x1b')];var _0x1e7059=_0x2ffab1?_0xc33036[_0xec85('0x1c')]:_0x2c21be[_0xec85('0x1b')]+_0x2c21be[_0xec85('0x1a')];var _0x2a9f16;if(_0x1e7059>=_0x7bcbfd){_0x1e7059=_0x7bcbfd;_0x2a9f16=0xc8;}else{_0x2a9f16=0xce;}_0x2bc345['status'](_0x2a9f16);return _0x2bc345['set']('Content-Range',_0x3f770c+'-'+_0x1e7059+'/'+_0x7bcbfd)[_0xec85('0x1d')](_0xc33036);}return null;};}function patchUpdates(_0x24dfd4){return function(_0x40eb90){try{jsonpatch[_0xec85('0x1e')](_0x40eb90,_0x24dfd4,!![]);}catch(_0x3a73e7){return BPromise[_0xec85('0x1f')](_0x3a73e7);}return _0x40eb90[_0xec85('0x20')]();};}function saveUpdates(_0x2fdb48,_0xa1adbd){return function(_0x4a0f27){if(_0x4a0f27){return _0x4a0f27[_0xec85('0x21')](_0x2fdb48)[_0xec85('0x22')](function(_0x3ce357){return _0x3ce357;});}return null;};}function removeEntity(_0x46c46a,_0x12f9f9){return function(_0x54b926){if(_0x54b926){return _0x54b926['destroy']()[_0xec85('0x22')](function(){_0x46c46a[_0xec85('0x17')](0xcc)[_0xec85('0x18')]();});}};}function handleEntityNotFound(_0x420607,_0x2877af){return function(_0x50f12f){if(!_0x50f12f){_0x420607[_0xec85('0x16')](0x194);}return _0x50f12f;};}function handleError(_0x4b21c3,_0x14491c){_0x14491c=_0x14491c||0x1f4;return function(_0x42cbea){logger[_0xec85('0x23')](_0x42cbea['stack']);if(_0x42cbea[_0xec85('0x24')]){delete _0x42cbea[_0xec85('0x24')];}_0x4b21c3[_0xec85('0x17')](_0x14491c)[_0xec85('0x25')](_0x42cbea);};}exports[_0xec85('0x26')]=function(_0x2c5c18,_0x2f2490){var _0x196009={},_0x4b2709={},_0x463a59={'count':0x0,'rows':[]};var _0x570088=_[_0xec85('0x27')](db[_0xec85('0x28')][_0xec85('0x29')],function(_0x3544f1){return{'name':_0x3544f1[_0xec85('0x2a')],'type':_0x3544f1[_0xec85('0x2b')][_0xec85('0x2c')]};});_0x4b2709[_0xec85('0x2d')]=_[_0xec85('0x27')](_0x570088,'name');_0x4b2709[_0xec85('0x2e')]=_[_0xec85('0x2f')](_0x2c5c18['query']);_0x4b2709[_0xec85('0x30')]=_['intersection'](_0x4b2709[_0xec85('0x2d')],_0x4b2709[_0xec85('0x2e')]);_0x196009[_0xec85('0x31')]=_['intersection'](_0x4b2709['model'],qs[_0xec85('0x32')](_0x2c5c18['query'][_0xec85('0x32')]));_0x196009[_0xec85('0x31')]=_0x196009[_0xec85('0x31')][_0xec85('0x33')]?_0x196009[_0xec85('0x31')]:_0x4b2709['model'];if(!_0x2c5c18[_0xec85('0x2e')][_0xec85('0x34')](_0xec85('0x35'))){_0x196009[_0xec85('0x1a')]=qs[_0xec85('0x1a')](_0x2c5c18[_0xec85('0x2e')][_0xec85('0x1a')]);_0x196009[_0xec85('0x1b')]=qs[_0xec85('0x1b')](_0x2c5c18[_0xec85('0x2e')][_0xec85('0x1b')]);}_0x196009[_0xec85('0x36')]=qs[_0xec85('0x37')](_0x2c5c18[_0xec85('0x2e')][_0xec85('0x37')]);_0x196009[_0xec85('0x38')]=qs[_0xec85('0x30')](_['pick'](_0x2c5c18[_0xec85('0x2e')],_0x4b2709['filters']),_0x570088);if(_0x2c5c18[_0xec85('0x2e')][_0xec85('0x39')]){_0x196009[_0xec85('0x38')]=_[_0xec85('0x3a')](_0x196009['where'],{'$or':_[_0xec85('0x27')](_0x570088,function(_0x51435e){if(_0x51435e[_0xec85('0x2b')]!=='VIRTUAL'){var _0x370d32={};_0x370d32[_0x51435e[_0xec85('0x24')]]={'$like':'%'+_0x2c5c18[_0xec85('0x2e')][_0xec85('0x39')]+'%'};return _0x370d32;}})});}_0x196009=_[_0xec85('0x3a')]({},_0x196009,_0x2c5c18[_0xec85('0x3b')]);var _0x395be9={'where':_0x196009[_0xec85('0x38')]};return db[_0xec85('0x28')][_0xec85('0x1c')](_0x395be9)[_0xec85('0x22')](function(_0x792c38){_0x463a59[_0xec85('0x1c')]=_0x792c38;if(_0x2c5c18['query'][_0xec85('0x3c')]){_0x196009[_0xec85('0x3d')]=[{'all':!![]}];}return db[_0xec85('0x28')][_0xec85('0x3e')](_0x196009);})[_0xec85('0x22')](function(_0x53ecaf){_0x463a59['rows']=_0x53ecaf;return _0x463a59;})[_0xec85('0x22')](respondWithFilteredResult(_0x2f2490,_0x196009))['catch'](handleError(_0x2f2490,null));};exports[_0xec85('0x3f')]=function(_0x1f9b50,_0x65e143){var _0x18f988={'raw':!![],'where':{'id':_0x1f9b50[_0xec85('0x40')]['id']}},_0x3ec083={};_0x3ec083[_0xec85('0x2d')]=_['keys'](db[_0xec85('0x28')][_0xec85('0x29')]);_0x3ec083[_0xec85('0x2e')]=_[_0xec85('0x2f')](_0x1f9b50[_0xec85('0x2e')]);_0x3ec083[_0xec85('0x30')]=_[_0xec85('0x41')](_0x3ec083[_0xec85('0x2d')],_0x3ec083[_0xec85('0x2e')]);_0x18f988[_0xec85('0x31')]=_['intersection'](_0x3ec083[_0xec85('0x2d')],qs[_0xec85('0x32')](_0x1f9b50[_0xec85('0x2e')][_0xec85('0x32')]));_0x18f988[_0xec85('0x31')]=_0x18f988['attributes'][_0xec85('0x33')]?_0x18f988['attributes']:_0x3ec083['model'];if(_0x1f9b50[_0xec85('0x2e')]['includeAll']){_0x18f988[_0xec85('0x3d')]=[{'all':!![]}];}_0x18f988=_[_0xec85('0x3a')]({},_0x18f988,_0x1f9b50[_0xec85('0x3b')]);return db[_0xec85('0x28')][_0xec85('0x42')](_0x18f988)[_0xec85('0x22')](handleEntityNotFound(_0x65e143,null))[_0xec85('0x22')](respondWithResult(_0x65e143,null))['catch'](handleError(_0x65e143,null));};exports[_0xec85('0x43')]=function(_0x1c5e6d,_0x195ee8){return db[_0xec85('0x28')]['create'](_0x1c5e6d[_0xec85('0x44')],{})['then'](respondWithResult(_0x195ee8,0xc9))[_0xec85('0x45')](handleError(_0x195ee8,null));};exports[_0xec85('0x21')]=function(_0x1982b4,_0x1c923f){if(_0x1982b4[_0xec85('0x44')]['id']){delete _0x1982b4['body']['id'];}return db['MailServerOut'][_0xec85('0x42')]({'where':{'id':_0x1982b4[_0xec85('0x40')]['id']}})[_0xec85('0x22')](handleEntityNotFound(_0x1c923f,null))[_0xec85('0x22')](saveUpdates(_0x1982b4[_0xec85('0x44')],null))[_0xec85('0x22')](respondWithResult(_0x1c923f,null))[_0xec85('0x45')](handleError(_0x1c923f,null));};exports[_0xec85('0x46')]=function(_0x2e24ba,_0x4e2647){return db['MailServerOut'][_0xec85('0x42')]({'where':{'id':_0x2e24ba['params']['id']}})[_0xec85('0x22')](handleEntityNotFound(_0x4e2647,null))[_0xec85('0x22')](removeEntity(_0x4e2647,null))['catch'](handleError(_0x4e2647,null));}; \ No newline at end of file +var _0xd6f3=['count','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','end','offset','undefined'];(function(_0x515534,_0x5a08e6){var _0x3e4e10=function(_0x31b74){while(--_0x31b74){_0x515534['push'](_0x515534['shift']());}};_0x3e4e10(++_0x5a08e6);}(_0xd6f3,0x1e4));var _0x3d6f=function(_0x1bb051,_0x4ecb04){_0x1bb051=_0x1bb051-0x0;var _0x97927d=_0xd6f3[_0x1bb051];return _0x97927d;};'use strict';var emlformat=require(_0x3d6f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3d6f('0x1'));var rp=require(_0x3d6f('0x2'));var moment=require(_0x3d6f('0x3'));var BPromise=require(_0x3d6f('0x4'));var Mustache=require(_0x3d6f('0x5'));var util=require(_0x3d6f('0x6'));var path=require('path');var sox=require(_0x3d6f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d6f('0x8'));var _=require(_0x3d6f('0x9'));var squel=require(_0x3d6f('0xa'));var crypto=require(_0x3d6f('0xb'));var jsforce=require(_0x3d6f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3d6f('0xd'));var querystring=require(_0x3d6f('0xe'));var Papa=require('papaparse');var Redis=require(_0x3d6f('0xf'));var authService=require(_0x3d6f('0x10'));var qs=require(_0x3d6f('0x11'));var as=require(_0x3d6f('0x12'));var hardwareService=require(_0x3d6f('0x13'));var logger=require(_0x3d6f('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3d6f('0x15'));var db=require(_0x3d6f('0x16'))['db'];function respondWithStatusCode(_0x4b8679,_0x155852){_0x155852=_0x155852||0xcc;return function(_0x4244da){if(_0x4244da){return _0x4b8679['sendStatus'](_0x155852);}return _0x4b8679[_0x3d6f('0x17')](_0x155852)[_0x3d6f('0x18')]();};}function respondWithResult(_0x41a4cf,_0x22622c){_0x22622c=_0x22622c||0xc8;return function(_0x1626f1){if(_0x1626f1){return _0x41a4cf[_0x3d6f('0x17')](_0x22622c)['json'](_0x1626f1);}};}function respondWithFilteredResult(_0x40e658,_0x1a4bf1){return function(_0x139441){if(_0x139441){var _0x1ed6b1=typeof _0x1a4bf1[_0x3d6f('0x19')]===_0x3d6f('0x1a')&&typeof _0x1a4bf1['limit']===_0x3d6f('0x1a');var _0x361712=_0x139441[_0x3d6f('0x1b')];var _0x5a5015=_0x1ed6b1?0x0:_0x1a4bf1['offset'];var _0x569d8d=_0x1ed6b1?_0x139441[_0x3d6f('0x1b')]:_0x1a4bf1[_0x3d6f('0x19')]+_0x1a4bf1[_0x3d6f('0x1c')];var _0x33aacc;if(_0x569d8d>=_0x361712){_0x569d8d=_0x361712;_0x33aacc=0xc8;}else{_0x33aacc=0xce;}_0x40e658[_0x3d6f('0x17')](_0x33aacc);return _0x40e658[_0x3d6f('0x1d')](_0x3d6f('0x1e'),_0x5a5015+'-'+_0x569d8d+'/'+_0x361712)['json'](_0x139441);}return null;};}function patchUpdates(_0x36b75e){return function(_0x1d05f2){try{jsonpatch[_0x3d6f('0x1f')](_0x1d05f2,_0x36b75e,!![]);}catch(_0x8590b8){return BPromise[_0x3d6f('0x20')](_0x8590b8);}return _0x1d05f2[_0x3d6f('0x21')]();};}function saveUpdates(_0x1a6473,_0x5b6d44){return function(_0x5bdee6){if(_0x5bdee6){return _0x5bdee6[_0x3d6f('0x22')](_0x1a6473)[_0x3d6f('0x23')](function(_0x2973db){return _0x2973db;});}return null;};}function removeEntity(_0x4ce0c3,_0xe11e5d){return function(_0x5e9538){if(_0x5e9538){return _0x5e9538['destroy']()[_0x3d6f('0x23')](function(){_0x4ce0c3[_0x3d6f('0x17')](0xcc)[_0x3d6f('0x18')]();});}};}function handleEntityNotFound(_0x5f5278,_0x5ae9f1){return function(_0xd681e8){if(!_0xd681e8){_0x5f5278[_0x3d6f('0x24')](0x194);}return _0xd681e8;};}function handleError(_0x17ed76,_0x1aa4e7){_0x1aa4e7=_0x1aa4e7||0x1f4;return function(_0x590141){logger[_0x3d6f('0x25')](_0x590141[_0x3d6f('0x26')]);if(_0x590141[_0x3d6f('0x27')]){delete _0x590141[_0x3d6f('0x27')];}_0x17ed76[_0x3d6f('0x17')](_0x1aa4e7)['send'](_0x590141);};}exports['index']=function(_0x2d33ab,_0x27418e){var _0x7b8c7d={},_0xc481b3={},_0x39b4d4={'count':0x0,'rows':[]};var _0xf9df4c=_[_0x3d6f('0x28')](db[_0x3d6f('0x29')][_0x3d6f('0x2a')],function(_0x5c6e75){return{'name':_0x5c6e75[_0x3d6f('0x2b')],'type':_0x5c6e75[_0x3d6f('0x2c')][_0x3d6f('0x2d')]};});_0xc481b3[_0x3d6f('0x2e')]=_[_0x3d6f('0x28')](_0xf9df4c,_0x3d6f('0x27'));_0xc481b3[_0x3d6f('0x2f')]=_[_0x3d6f('0x30')](_0x2d33ab[_0x3d6f('0x2f')]);_0xc481b3[_0x3d6f('0x31')]=_[_0x3d6f('0x32')](_0xc481b3[_0x3d6f('0x2e')],_0xc481b3[_0x3d6f('0x2f')]);_0x7b8c7d[_0x3d6f('0x33')]=_['intersection'](_0xc481b3[_0x3d6f('0x2e')],qs['fields'](_0x2d33ab[_0x3d6f('0x2f')][_0x3d6f('0x34')]));_0x7b8c7d[_0x3d6f('0x33')]=_0x7b8c7d[_0x3d6f('0x33')][_0x3d6f('0x35')]?_0x7b8c7d[_0x3d6f('0x33')]:_0xc481b3[_0x3d6f('0x2e')];if(!_0x2d33ab[_0x3d6f('0x2f')][_0x3d6f('0x36')](_0x3d6f('0x37'))){_0x7b8c7d[_0x3d6f('0x1c')]=qs['limit'](_0x2d33ab[_0x3d6f('0x2f')]['limit']);_0x7b8c7d[_0x3d6f('0x19')]=qs['offset'](_0x2d33ab[_0x3d6f('0x2f')][_0x3d6f('0x19')]);}_0x7b8c7d[_0x3d6f('0x38')]=qs[_0x3d6f('0x39')](_0x2d33ab[_0x3d6f('0x2f')][_0x3d6f('0x39')]);_0x7b8c7d[_0x3d6f('0x3a')]=qs['filters'](_[_0x3d6f('0x3b')](_0x2d33ab[_0x3d6f('0x2f')],_0xc481b3[_0x3d6f('0x31')]),_0xf9df4c);if(_0x2d33ab[_0x3d6f('0x2f')]['filter']){_0x7b8c7d[_0x3d6f('0x3a')]=_[_0x3d6f('0x3c')](_0x7b8c7d[_0x3d6f('0x3a')],{'$or':_[_0x3d6f('0x28')](_0xf9df4c,function(_0x4598){if(_0x4598[_0x3d6f('0x2c')]!=='VIRTUAL'){var _0x41c7db={};_0x41c7db[_0x4598[_0x3d6f('0x27')]]={'$like':'%'+_0x2d33ab[_0x3d6f('0x2f')][_0x3d6f('0x3d')]+'%'};return _0x41c7db;}})});}_0x7b8c7d=_[_0x3d6f('0x3c')]({},_0x7b8c7d,_0x2d33ab[_0x3d6f('0x3e')]);var _0xc4dddd={'where':_0x7b8c7d[_0x3d6f('0x3a')]};return db[_0x3d6f('0x29')][_0x3d6f('0x1b')](_0xc4dddd)[_0x3d6f('0x23')](function(_0x5bd5c7){_0x39b4d4[_0x3d6f('0x1b')]=_0x5bd5c7;if(_0x2d33ab[_0x3d6f('0x2f')][_0x3d6f('0x3f')]){_0x7b8c7d[_0x3d6f('0x40')]=[{'all':!![]}];}return db[_0x3d6f('0x29')][_0x3d6f('0x41')](_0x7b8c7d);})[_0x3d6f('0x23')](function(_0x3ac67f){_0x39b4d4[_0x3d6f('0x42')]=_0x3ac67f;return _0x39b4d4;})[_0x3d6f('0x23')](respondWithFilteredResult(_0x27418e,_0x7b8c7d))[_0x3d6f('0x43')](handleError(_0x27418e,null));};exports[_0x3d6f('0x44')]=function(_0x4ad911,_0x2357e3){var _0x3a4f35={'raw':!![],'where':{'id':_0x4ad911[_0x3d6f('0x45')]['id']}},_0xb520e7={};_0xb520e7['model']=_['keys'](db[_0x3d6f('0x29')][_0x3d6f('0x2a')]);_0xb520e7[_0x3d6f('0x2f')]=_[_0x3d6f('0x30')](_0x4ad911[_0x3d6f('0x2f')]);_0xb520e7[_0x3d6f('0x31')]=_[_0x3d6f('0x32')](_0xb520e7[_0x3d6f('0x2e')],_0xb520e7[_0x3d6f('0x2f')]);_0x3a4f35['attributes']=_[_0x3d6f('0x32')](_0xb520e7[_0x3d6f('0x2e')],qs['fields'](_0x4ad911[_0x3d6f('0x2f')][_0x3d6f('0x34')]));_0x3a4f35['attributes']=_0x3a4f35[_0x3d6f('0x33')][_0x3d6f('0x35')]?_0x3a4f35[_0x3d6f('0x33')]:_0xb520e7[_0x3d6f('0x2e')];if(_0x4ad911[_0x3d6f('0x2f')][_0x3d6f('0x3f')]){_0x3a4f35[_0x3d6f('0x40')]=[{'all':!![]}];}_0x3a4f35=_['merge']({},_0x3a4f35,_0x4ad911['options']);return db[_0x3d6f('0x29')][_0x3d6f('0x46')](_0x3a4f35)['then'](handleEntityNotFound(_0x2357e3,null))[_0x3d6f('0x23')](respondWithResult(_0x2357e3,null))[_0x3d6f('0x43')](handleError(_0x2357e3,null));};exports[_0x3d6f('0x47')]=function(_0x8aa2,_0x5988d){return db['MailServerOut'][_0x3d6f('0x47')](_0x8aa2[_0x3d6f('0x48')],{})[_0x3d6f('0x23')](respondWithResult(_0x5988d,0xc9))[_0x3d6f('0x43')](handleError(_0x5988d,null));};exports['update']=function(_0x4ecbb0,_0x2903b5){if(_0x4ecbb0[_0x3d6f('0x48')]['id']){delete _0x4ecbb0[_0x3d6f('0x48')]['id'];}return db[_0x3d6f('0x29')]['find']({'where':{'id':_0x4ecbb0[_0x3d6f('0x45')]['id']}})['then'](handleEntityNotFound(_0x2903b5,null))[_0x3d6f('0x23')](saveUpdates(_0x4ecbb0[_0x3d6f('0x48')],null))['then'](respondWithResult(_0x2903b5,null))[_0x3d6f('0x43')](handleError(_0x2903b5,null));};exports['destroy']=function(_0x1bc29b,_0x10b3ee){return db['MailServerOut'][_0x3d6f('0x46')]({'where':{'id':_0x1bc29b[_0x3d6f('0x45')]['id']}})['then'](handleEntityNotFound(_0x10b3ee,null))[_0x3d6f('0x23')](removeEntity(_0x10b3ee,null))['catch'](handleError(_0x10b3ee,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index cf9b2ed..f1e8f47 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 _0xa306=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','MailServerOut','lodash','util','../../config/logger','api'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xa306,0x141));var _0x6a30=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0xa306[_0x2b9b7f];return _0x4ed19a;};'use strict';var _=require(_0x6a30('0x0'));var util=require(_0x6a30('0x1'));var logger=require(_0x6a30('0x2'))(_0x6a30('0x3'));var moment=require(_0x6a30('0x4'));var BPromise=require(_0x6a30('0x5'));var rp=require(_0x6a30('0x6'));var fs=require('fs');var path=require(_0x6a30('0x7'));var rimraf=require(_0x6a30('0x8'));var config=require(_0x6a30('0x9'));var attributes=require(_0x6a30('0xa'));module[_0x6a30('0xb')]=function(_0x4518ef,_0x5213cd){return _0x4518ef['define'](_0x6a30('0xc'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb20=['path','../../config/environment','./mailServerOut.attributes','define','MailServerOut','mail_servers_out','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5c5e21,_0x5e3375){var _0x171240=function(_0x1eb472){while(--_0x1eb472){_0x5c5e21['push'](_0x5c5e21['shift']());}};_0x171240(++_0x5e3375);}(_0xdb20,0xcc));var _0x0db2=function(_0x5982f1,_0x3f5689){_0x5982f1=_0x5982f1-0x0;var _0x3a1836=_0xdb20[_0x5982f1];return _0x3a1836;};'use strict';var _=require('lodash');var util=require(_0x0db2('0x0'));var logger=require(_0x0db2('0x1'))(_0x0db2('0x2'));var moment=require('moment');var BPromise=require(_0x0db2('0x3'));var rp=require(_0x0db2('0x4'));var fs=require('fs');var path=require(_0x0db2('0x5'));var rimraf=require('rimraf');var config=require(_0x0db2('0x6'));var attributes=require(_0x0db2('0x7'));module['exports']=function(_0x56a77c,_0x1d2684){return _0x56a77c[_0x0db2('0x8')](_0x0db2('0x9'),attributes,{'tableName':_0x0db2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 03d24c2..b342fae 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 _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(_0x375e7f,_0x3b5831){var _0x1e79e6=function(_0x2ce86a){while(--_0x2ce86a){_0x375e7f['push'](_0x375e7f['shift']());}};_0x1e79e6(++_0x3b5831);}(_0x1261,0x144));var _0x1126=function(_0x5a2d95,_0xb362e5){_0x5a2d95=_0x5a2d95-0x0;var _0x2c3986=_0x1261[_0x5a2d95];return _0x2c3986;};'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 +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(_0x3c17a1,_0x534990){var _0x593944=function(_0x5bbdb4){while(--_0x5bbdb4){_0x3c17a1['push'](_0x3c17a1['shift']());}};_0x593944(++_0x534990);}(_0x1261,0x144));var _0x1126=function(_0x29c934,_0x3c30e2){_0x29c934=_0x29c934-0x0;var _0x4302de=_0x1261[_0x29c934];return _0x4302de;};'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 83d956e..cacf06d 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 _0x3bc7=['create','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./mailSubstatus.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3bc7,0x7b));var _0x73bc=function(_0x2d9c69,_0x3ea0be){_0x2d9c69=_0x2d9c69-0x0;var _0x134a46=_0x3bc7[_0x2d9c69];return _0x134a46;};'use strict';var multer=require(_0x73bc('0x0'));var util=require(_0x73bc('0x1'));var path=require(_0x73bc('0x2'));var timeout=require(_0x73bc('0x3'));var express=require('express');var router=express[_0x73bc('0x4')]();var fs_extra=require(_0x73bc('0x5'));var auth=require(_0x73bc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x73bc('0x7'));router[_0x73bc('0x8')]('/',auth[_0x73bc('0x9')](),controller[_0x73bc('0xa')]);router[_0x73bc('0x8')](_0x73bc('0xb'),auth[_0x73bc('0x9')](),controller['describe']);router[_0x73bc('0x8')](_0x73bc('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x73bc('0x9')](),controller[_0x73bc('0xd')]);router['put'](_0x73bc('0xc'),auth[_0x73bc('0x9')](),controller['update']);router[_0x73bc('0xe')](_0x73bc('0xc'),auth['isAuthenticated'](),controller[_0x73bc('0xf')]);module[_0x73bc('0x10')]=router; \ No newline at end of file +var _0x342e=['destroy','exports','multer','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','describe','/:id','show','put','update'];(function(_0xee6266,_0x16ba9d){var _0x3580e2=function(_0x49fca6){while(--_0x49fca6){_0xee6266['push'](_0xee6266['shift']());}};_0x3580e2(++_0x16ba9d);}(_0x342e,0xf0));var _0xe342=function(_0x3d2012,_0x3d02b9){_0x3d2012=_0x3d2012-0x0;var _0x53d542=_0x342e[_0x3d2012];return _0x53d542;};'use strict';var multer=require(_0xe342('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(_0xe342('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0xe342('0x2'));var config=require(_0xe342('0x3'));var controller=require(_0xe342('0x4'));router[_0xe342('0x5')]('/',auth[_0xe342('0x6')](),controller['index']);router[_0xe342('0x5')]('/describe',auth['isAuthenticated'](),controller[_0xe342('0x7')]);router[_0xe342('0x5')](_0xe342('0x8'),auth[_0xe342('0x6')](),controller[_0xe342('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe342('0xa')](_0xe342('0x8'),auth[_0xe342('0x6')](),controller[_0xe342('0xb')]);router['delete'](_0xe342('0x8'),auth[_0xe342('0x6')](),controller[_0xe342('0xc')]);module[_0xe342('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 7fd278a..6fb9b3a 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 _0x3e24=['exports','STRING','name','sequelize'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x3e24,0x167));var _0x43e2=function(_0x77f20,_0x39ff0e){_0x77f20=_0x77f20-0x0;var _0x1b6084=_0x3e24[_0x77f20];return _0x1b6084;};'use strict';var Sequelize=require(_0x43e2('0x0'));module[_0x43e2('0x1')]={'name':{'type':Sequelize[_0x43e2('0x2')],'unique':_0x43e2('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x43e2('0x2')]}}; \ No newline at end of file +var _0x2c8f=['exports'];(function(_0x22f8f8,_0x49f424){var _0xd6c9b8=function(_0x103f57){while(--_0x103f57){_0x22f8f8['push'](_0x22f8f8['shift']());}};_0xd6c9b8(++_0x49f424);}(_0x2c8f,0x192));var _0xf2c8=function(_0x23acb2,_0x6e48ec){_0x23acb2=_0x23acb2-0x0;var _0x225ec0=_0x2c8f[_0x23acb2];return _0x225ec0;};'use strict';var Sequelize=require('sequelize');module[_0xf2c8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index ee2355e..b290c1b 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 _0x2ef0=['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','offset','limit','undefined','count','set','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','MailSubstatus','fieldName','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x10cc37,_0x15b350){var _0x537173=function(_0x1b951b){while(--_0x1b951b){_0x10cc37['push'](_0x10cc37['shift']());}};_0x537173(++_0x15b350);}(_0x2ef0,0x96));var _0x02ef=function(_0x558914,_0x20488a){_0x558914=_0x558914-0x0;var _0x3e8bbf=_0x2ef0[_0x558914];return _0x3e8bbf;};'use strict';var emlformat=require(_0x02ef('0x0'));var rimraf=require(_0x02ef('0x1'));var zipdir=require(_0x02ef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x02ef('0x3'));var moment=require(_0x02ef('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x02ef('0x5'));var util=require(_0x02ef('0x6'));var path=require(_0x02ef('0x7'));var sox=require(_0x02ef('0x8'));var csv=require(_0x02ef('0x9'));var ejs=require(_0x02ef('0xa'));var fs=require('fs');var fs_extra=require(_0x02ef('0xb'));var _=require(_0x02ef('0xc'));var squel=require(_0x02ef('0xd'));var crypto=require(_0x02ef('0xe'));var jsforce=require(_0x02ef('0xf'));var deskjs=require(_0x02ef('0x10'));var toCsv=require(_0x02ef('0x9'));var querystring=require(_0x02ef('0x11'));var Papa=require(_0x02ef('0x12'));var Redis=require('ioredis');var authService=require(_0x02ef('0x13'));var qs=require(_0x02ef('0x14'));var as=require(_0x02ef('0x15'));var hardwareService=require(_0x02ef('0x16'));var logger=require(_0x02ef('0x17'))(_0x02ef('0x18'));var utils=require('../../config/utils');var config=require(_0x02ef('0x19'));var licenseUtil=require(_0x02ef('0x1a'));var db=require(_0x02ef('0x1b'))['db'];function respondWithStatusCode(_0x2b16e8,_0x2ba54){_0x2ba54=_0x2ba54||0xcc;return function(_0xd61e9){if(_0xd61e9){return _0x2b16e8[_0x02ef('0x1c')](_0x2ba54);}return _0x2b16e8[_0x02ef('0x1d')](_0x2ba54)['end']();};}function respondWithResult(_0x29d635,_0x1b7d0d){_0x1b7d0d=_0x1b7d0d||0xc8;return function(_0x2473b6){if(_0x2473b6){return _0x29d635[_0x02ef('0x1d')](_0x1b7d0d)['json'](_0x2473b6);}};}function respondWithFilteredResult(_0x5ab128,_0x48b362){return function(_0x1220eb){if(_0x1220eb){var _0x3764e0=typeof _0x48b362[_0x02ef('0x1e')]==='undefined'&&typeof _0x48b362[_0x02ef('0x1f')]===_0x02ef('0x20');var _0x5d023e=_0x1220eb[_0x02ef('0x21')];var _0x3b12f1=_0x3764e0?0x0:_0x48b362[_0x02ef('0x1e')];var _0x5158af=_0x3764e0?_0x1220eb[_0x02ef('0x21')]:_0x48b362['offset']+_0x48b362[_0x02ef('0x1f')];var _0x5d90de;if(_0x5158af>=_0x5d023e){_0x5158af=_0x5d023e;_0x5d90de=0xc8;}else{_0x5d90de=0xce;}_0x5ab128['status'](_0x5d90de);return _0x5ab128[_0x02ef('0x22')]('Content-Range',_0x3b12f1+'-'+_0x5158af+'/'+_0x5d023e)[_0x02ef('0x23')](_0x1220eb);}return null;};}function patchUpdates(_0x435586){return function(_0x9a501){try{jsonpatch[_0x02ef('0x24')](_0x9a501,_0x435586,!![]);}catch(_0x3574a4){return BPromise[_0x02ef('0x25')](_0x3574a4);}return _0x9a501[_0x02ef('0x26')]();};}function saveUpdates(_0x2e34ad,_0x3736a4){return function(_0x50d6fb){if(_0x50d6fb){return _0x50d6fb['update'](_0x2e34ad)[_0x02ef('0x27')](function(_0x4d0b1d){return _0x4d0b1d;});}return null;};}function removeEntity(_0x214ffa,_0x2e7d1e){return function(_0x4b5515){if(_0x4b5515){return _0x4b5515[_0x02ef('0x28')]()['then'](function(){_0x214ffa[_0x02ef('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b38d,_0x58f5fb){return function(_0x2ea52f){if(!_0x2ea52f){_0x16b38d[_0x02ef('0x1c')](0x194);}return _0x2ea52f;};}function handleError(_0x368144,_0x2bee19){_0x2bee19=_0x2bee19||0x1f4;return function(_0x5e4f48){logger[_0x02ef('0x29')](_0x5e4f48[_0x02ef('0x2a')]);if(_0x5e4f48[_0x02ef('0x2b')]){delete _0x5e4f48[_0x02ef('0x2b')];}_0x368144[_0x02ef('0x1d')](_0x2bee19)[_0x02ef('0x2c')](_0x5e4f48);};}exports[_0x02ef('0x2d')]=function(_0x295fc7,_0x170430){var _0x443f82={},_0x1a0d4c={},_0x4ecc47={'count':0x0,'rows':[]};var _0x522410=_[_0x02ef('0x2e')](db[_0x02ef('0x2f')]['rawAttributes'],function(_0x2421c2){return{'name':_0x2421c2[_0x02ef('0x30')],'type':_0x2421c2['type'][_0x02ef('0x31')]};});_0x1a0d4c[_0x02ef('0x32')]=_['map'](_0x522410,_0x02ef('0x2b'));_0x1a0d4c[_0x02ef('0x33')]=_[_0x02ef('0x34')](_0x295fc7['query']);_0x1a0d4c['filters']=_[_0x02ef('0x35')](_0x1a0d4c[_0x02ef('0x32')],_0x1a0d4c[_0x02ef('0x33')]);_0x443f82[_0x02ef('0x36')]=_['intersection'](_0x1a0d4c['model'],qs['fields'](_0x295fc7['query']['fields']));_0x443f82[_0x02ef('0x36')]=_0x443f82[_0x02ef('0x36')][_0x02ef('0x37')]?_0x443f82['attributes']:_0x1a0d4c['model'];if(!_0x295fc7[_0x02ef('0x33')][_0x02ef('0x38')](_0x02ef('0x39'))){_0x443f82['limit']=qs[_0x02ef('0x1f')](_0x295fc7[_0x02ef('0x33')][_0x02ef('0x1f')]);_0x443f82['offset']=qs[_0x02ef('0x1e')](_0x295fc7[_0x02ef('0x33')][_0x02ef('0x1e')]);}_0x443f82[_0x02ef('0x3a')]=qs[_0x02ef('0x3b')](_0x295fc7[_0x02ef('0x33')]['sort']);_0x443f82['where']=qs[_0x02ef('0x3c')](_[_0x02ef('0x3d')](_0x295fc7[_0x02ef('0x33')],_0x1a0d4c['filters']),_0x522410);if(_0x295fc7['query'][_0x02ef('0x3e')]){_0x443f82[_0x02ef('0x3f')]=_[_0x02ef('0x40')](_0x443f82[_0x02ef('0x3f')],{'$or':_[_0x02ef('0x2e')](_0x522410,function(_0x490dc1){if(_0x490dc1[_0x02ef('0x41')]!==_0x02ef('0x42')){var _0x30e0a8={};_0x30e0a8[_0x490dc1[_0x02ef('0x2b')]]={'$like':'%'+_0x295fc7[_0x02ef('0x33')]['filter']+'%'};return _0x30e0a8;}})});}_0x443f82=_['merge']({},_0x443f82,_0x295fc7[_0x02ef('0x43')]);var _0xec5458={'where':_0x443f82[_0x02ef('0x3f')]};return db[_0x02ef('0x2f')][_0x02ef('0x21')](_0xec5458)[_0x02ef('0x27')](function(_0x2e07e2){_0x4ecc47['count']=_0x2e07e2;if(_0x295fc7[_0x02ef('0x33')][_0x02ef('0x44')]){_0x443f82[_0x02ef('0x45')]=[{'all':!![]}];}return db[_0x02ef('0x2f')][_0x02ef('0x46')](_0x443f82);})[_0x02ef('0x27')](function(_0x479089){_0x4ecc47[_0x02ef('0x47')]=_0x479089;return _0x4ecc47;})[_0x02ef('0x27')](respondWithFilteredResult(_0x170430,_0x443f82))[_0x02ef('0x48')](handleError(_0x170430,null));};exports[_0x02ef('0x49')]=function(_0x347e69,_0x424ad7){var _0xd729a1={'raw':!![],'where':{'id':_0x347e69[_0x02ef('0x4a')]['id']}},_0x5a6b72={};_0x5a6b72[_0x02ef('0x32')]=_['keys'](db[_0x02ef('0x2f')][_0x02ef('0x4b')]);_0x5a6b72[_0x02ef('0x33')]=_[_0x02ef('0x34')](_0x347e69[_0x02ef('0x33')]);_0x5a6b72[_0x02ef('0x3c')]=_[_0x02ef('0x35')](_0x5a6b72[_0x02ef('0x32')],_0x5a6b72[_0x02ef('0x33')]);_0xd729a1[_0x02ef('0x36')]=_['intersection'](_0x5a6b72[_0x02ef('0x32')],qs['fields'](_0x347e69[_0x02ef('0x33')][_0x02ef('0x4c')]));_0xd729a1[_0x02ef('0x36')]=_0xd729a1[_0x02ef('0x36')][_0x02ef('0x37')]?_0xd729a1[_0x02ef('0x36')]:_0x5a6b72[_0x02ef('0x32')];if(_0x347e69['query'][_0x02ef('0x44')]){_0xd729a1[_0x02ef('0x45')]=[{'all':!![]}];}_0xd729a1=_[_0x02ef('0x40')]({},_0xd729a1,_0x347e69[_0x02ef('0x43')]);return db[_0x02ef('0x2f')][_0x02ef('0x4d')](_0xd729a1)[_0x02ef('0x27')](handleEntityNotFound(_0x424ad7,null))['then'](respondWithResult(_0x424ad7,null))[_0x02ef('0x48')](handleError(_0x424ad7,null));};exports[_0x02ef('0x4e')]=function(_0x576b72,_0x328c54){return db[_0x02ef('0x2f')][_0x02ef('0x4e')](_0x576b72[_0x02ef('0x4f')],{})[_0x02ef('0x27')](respondWithResult(_0x328c54,0xc9))[_0x02ef('0x48')](handleError(_0x328c54,null));};exports['update']=function(_0x530402,_0x49e93a){if(_0x530402[_0x02ef('0x4f')]['id']){delete _0x530402[_0x02ef('0x4f')]['id'];}return db[_0x02ef('0x2f')][_0x02ef('0x4d')]({'where':{'id':_0x530402[_0x02ef('0x4a')]['id']}})[_0x02ef('0x27')](handleEntityNotFound(_0x49e93a,null))['then'](saveUpdates(_0x530402['body'],null))[_0x02ef('0x27')](respondWithResult(_0x49e93a,null))['catch'](handleError(_0x49e93a,null));};exports[_0x02ef('0x28')]=function(_0x4ab670,_0x5270d2){return db[_0x02ef('0x2f')][_0x02ef('0x4d')]({'where':{'id':_0x4ab670[_0x02ef('0x4a')]['id']}})[_0x02ef('0x27')](handleEntityNotFound(_0x5270d2,null))[_0x02ef('0x27')](removeEntity(_0x5270d2,null))[_0x02ef('0x48')](handleError(_0x5270d2,null));};exports[_0x02ef('0x50')]=function(_0x3b64ba,_0x47ab11){return db[_0x02ef('0x2f')][_0x02ef('0x50')]()[_0x02ef('0x27')](respondWithResult(_0x47ab11,null))[_0x02ef('0x48')](handleError(_0x47ab11,null));}; \ No newline at end of file +var _0x0a66=['to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','apply','save','update','destroy','error','stack','name','index','map','MailSubstatus','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','then','include','findAll','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x37f8fa,_0x37816b){var _0x4a43ca=function(_0x4b399a){while(--_0x4b399a){_0x37f8fa['push'](_0x37f8fa['shift']());}};_0x4a43ca(++_0x37816b);}(_0x0a66,0x8c));var _0x60a6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0a66[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x60a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x60a6('0x1'));var jsonpatch=require(_0x60a6('0x2'));var rp=require(_0x60a6('0x3'));var moment=require(_0x60a6('0x4'));var BPromise=require(_0x60a6('0x5'));var Mustache=require(_0x60a6('0x6'));var util=require(_0x60a6('0x7'));var path=require(_0x60a6('0x8'));var sox=require(_0x60a6('0x9'));var csv=require(_0x60a6('0xa'));var ejs=require(_0x60a6('0xb'));var fs=require('fs');var fs_extra=require(_0x60a6('0xc'));var _=require(_0x60a6('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x60a6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x60a6('0xa'));var querystring=require(_0x60a6('0xf'));var Papa=require(_0x60a6('0x10'));var Redis=require('ioredis');var authService=require(_0x60a6('0x11'));var qs=require(_0x60a6('0x12'));var as=require(_0x60a6('0x13'));var hardwareService=require(_0x60a6('0x14'));var logger=require('../../config/logger')(_0x60a6('0x15'));var utils=require(_0x60a6('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x60a6('0x17'))['db'];function respondWithStatusCode(_0x2def9a,_0x3c52ec){_0x3c52ec=_0x3c52ec||0xcc;return function(_0x57bac8){if(_0x57bac8){return _0x2def9a[_0x60a6('0x18')](_0x3c52ec);}return _0x2def9a[_0x60a6('0x19')](_0x3c52ec)[_0x60a6('0x1a')]();};}function respondWithResult(_0x36c68d,_0x4c09e3){_0x4c09e3=_0x4c09e3||0xc8;return function(_0xd1143a){if(_0xd1143a){return _0x36c68d['status'](_0x4c09e3)[_0x60a6('0x1b')](_0xd1143a);}};}function respondWithFilteredResult(_0x19bfcc,_0x2aec25){return function(_0x1ee905){if(_0x1ee905){var _0x3f87a5=typeof _0x2aec25[_0x60a6('0x1c')]==='undefined'&&typeof _0x2aec25['limit']==='undefined';var _0x497753=_0x1ee905[_0x60a6('0x1d')];var _0x12048f=_0x3f87a5?0x0:_0x2aec25[_0x60a6('0x1c')];var _0xdbabed=_0x3f87a5?_0x1ee905['count']:_0x2aec25['offset']+_0x2aec25[_0x60a6('0x1e')];var _0x25e500;if(_0xdbabed>=_0x497753){_0xdbabed=_0x497753;_0x25e500=0xc8;}else{_0x25e500=0xce;}_0x19bfcc[_0x60a6('0x19')](_0x25e500);return _0x19bfcc[_0x60a6('0x1f')]('Content-Range',_0x12048f+'-'+_0xdbabed+'/'+_0x497753)['json'](_0x1ee905);}return null;};}function patchUpdates(_0xe54a94){return function(_0x423440){try{jsonpatch[_0x60a6('0x20')](_0x423440,_0xe54a94,!![]);}catch(_0x51a3ba){return BPromise['reject'](_0x51a3ba);}return _0x423440[_0x60a6('0x21')]();};}function saveUpdates(_0x5002bf,_0x11abdc){return function(_0x258ccc){if(_0x258ccc){return _0x258ccc[_0x60a6('0x22')](_0x5002bf)['then'](function(_0x30db14){return _0x30db14;});}return null;};}function removeEntity(_0x330a57,_0x1a5d5d){return function(_0x1ac3e9){if(_0x1ac3e9){return _0x1ac3e9[_0x60a6('0x23')]()['then'](function(){_0x330a57[_0x60a6('0x19')](0xcc)[_0x60a6('0x1a')]();});}};}function handleEntityNotFound(_0x31b5bd,_0x2c1f0e){return function(_0x4c5553){if(!_0x4c5553){_0x31b5bd[_0x60a6('0x18')](0x194);}return _0x4c5553;};}function handleError(_0x12feac,_0x14fa26){_0x14fa26=_0x14fa26||0x1f4;return function(_0x5315bd){logger[_0x60a6('0x24')](_0x5315bd[_0x60a6('0x25')]);if(_0x5315bd[_0x60a6('0x26')]){delete _0x5315bd['name'];}_0x12feac[_0x60a6('0x19')](_0x14fa26)['send'](_0x5315bd);};}exports[_0x60a6('0x27')]=function(_0x5c6d1a,_0xaf449f){var _0x32182b={},_0x4cf596={},_0x556264={'count':0x0,'rows':[]};var _0x8a2dea=_[_0x60a6('0x28')](db[_0x60a6('0x29')][_0x60a6('0x2a')],function(_0x543dd1){return{'name':_0x543dd1[_0x60a6('0x2b')],'type':_0x543dd1[_0x60a6('0x2c')]['key']};});_0x4cf596[_0x60a6('0x2d')]=_['map'](_0x8a2dea,_0x60a6('0x26'));_0x4cf596[_0x60a6('0x2e')]=_[_0x60a6('0x2f')](_0x5c6d1a['query']);_0x4cf596['filters']=_[_0x60a6('0x30')](_0x4cf596[_0x60a6('0x2d')],_0x4cf596[_0x60a6('0x2e')]);_0x32182b['attributes']=_[_0x60a6('0x30')](_0x4cf596['model'],qs[_0x60a6('0x31')](_0x5c6d1a[_0x60a6('0x2e')][_0x60a6('0x31')]));_0x32182b[_0x60a6('0x32')]=_0x32182b[_0x60a6('0x32')][_0x60a6('0x33')]?_0x32182b[_0x60a6('0x32')]:_0x4cf596['model'];if(!_0x5c6d1a[_0x60a6('0x2e')][_0x60a6('0x34')](_0x60a6('0x35'))){_0x32182b[_0x60a6('0x1e')]=qs['limit'](_0x5c6d1a[_0x60a6('0x2e')]['limit']);_0x32182b[_0x60a6('0x1c')]=qs[_0x60a6('0x1c')](_0x5c6d1a[_0x60a6('0x2e')][_0x60a6('0x1c')]);}_0x32182b[_0x60a6('0x36')]=qs[_0x60a6('0x37')](_0x5c6d1a[_0x60a6('0x2e')][_0x60a6('0x37')]);_0x32182b[_0x60a6('0x38')]=qs[_0x60a6('0x39')](_[_0x60a6('0x3a')](_0x5c6d1a[_0x60a6('0x2e')],_0x4cf596[_0x60a6('0x39')]),_0x8a2dea);if(_0x5c6d1a[_0x60a6('0x2e')]['filter']){_0x32182b[_0x60a6('0x38')]=_['merge'](_0x32182b['where'],{'$or':_['map'](_0x8a2dea,function(_0x106ce7){if(_0x106ce7[_0x60a6('0x2c')]!==_0x60a6('0x3b')){var _0x2edb30={};_0x2edb30[_0x106ce7['name']]={'$like':'%'+_0x5c6d1a[_0x60a6('0x2e')][_0x60a6('0x3c')]+'%'};return _0x2edb30;}})});}_0x32182b=_[_0x60a6('0x3d')]({},_0x32182b,_0x5c6d1a[_0x60a6('0x3e')]);var _0x58bf69={'where':_0x32182b['where']};return db[_0x60a6('0x29')]['count'](_0x58bf69)[_0x60a6('0x3f')](function(_0x97d126){_0x556264[_0x60a6('0x1d')]=_0x97d126;if(_0x5c6d1a[_0x60a6('0x2e')]['includeAll']){_0x32182b[_0x60a6('0x40')]=[{'all':!![]}];}return db['MailSubstatus'][_0x60a6('0x41')](_0x32182b);})[_0x60a6('0x3f')](function(_0xcac868){_0x556264[_0x60a6('0x42')]=_0xcac868;return _0x556264;})[_0x60a6('0x3f')](respondWithFilteredResult(_0xaf449f,_0x32182b))[_0x60a6('0x43')](handleError(_0xaf449f,null));};exports[_0x60a6('0x44')]=function(_0x20fcb8,_0x4505b4){var _0x51c868={'raw':!![],'where':{'id':_0x20fcb8[_0x60a6('0x45')]['id']}},_0x47e87e={};_0x47e87e['model']=_[_0x60a6('0x2f')](db['MailSubstatus']['rawAttributes']);_0x47e87e[_0x60a6('0x2e')]=_[_0x60a6('0x2f')](_0x20fcb8[_0x60a6('0x2e')]);_0x47e87e[_0x60a6('0x39')]=_[_0x60a6('0x30')](_0x47e87e[_0x60a6('0x2d')],_0x47e87e['query']);_0x51c868[_0x60a6('0x32')]=_[_0x60a6('0x30')](_0x47e87e[_0x60a6('0x2d')],qs[_0x60a6('0x31')](_0x20fcb8[_0x60a6('0x2e')][_0x60a6('0x31')]));_0x51c868[_0x60a6('0x32')]=_0x51c868['attributes']['length']?_0x51c868[_0x60a6('0x32')]:_0x47e87e[_0x60a6('0x2d')];if(_0x20fcb8['query'][_0x60a6('0x46')]){_0x51c868[_0x60a6('0x40')]=[{'all':!![]}];}_0x51c868=_[_0x60a6('0x3d')]({},_0x51c868,_0x20fcb8[_0x60a6('0x3e')]);return db[_0x60a6('0x29')]['find'](_0x51c868)['then'](handleEntityNotFound(_0x4505b4,null))[_0x60a6('0x3f')](respondWithResult(_0x4505b4,null))[_0x60a6('0x43')](handleError(_0x4505b4,null));};exports[_0x60a6('0x47')]=function(_0x376d82,_0x148b4e){return db[_0x60a6('0x29')][_0x60a6('0x47')](_0x376d82['body'],{})[_0x60a6('0x3f')](respondWithResult(_0x148b4e,0xc9))[_0x60a6('0x43')](handleError(_0x148b4e,null));};exports[_0x60a6('0x22')]=function(_0x1bf273,_0x52345f){if(_0x1bf273['body']['id']){delete _0x1bf273[_0x60a6('0x48')]['id'];}return db[_0x60a6('0x29')][_0x60a6('0x49')]({'where':{'id':_0x1bf273[_0x60a6('0x45')]['id']}})[_0x60a6('0x3f')](handleEntityNotFound(_0x52345f,null))['then'](saveUpdates(_0x1bf273[_0x60a6('0x48')],null))['then'](respondWithResult(_0x52345f,null))[_0x60a6('0x43')](handleError(_0x52345f,null));};exports[_0x60a6('0x23')]=function(_0x2ae2ce,_0x4187a3){return db[_0x60a6('0x29')][_0x60a6('0x49')]({'where':{'id':_0x2ae2ce[_0x60a6('0x45')]['id']}})[_0x60a6('0x3f')](handleEntityNotFound(_0x4187a3,null))[_0x60a6('0x3f')](removeEntity(_0x4187a3,null))[_0x60a6('0x43')](handleError(_0x4187a3,null));};exports['describe']=function(_0x125881,_0x1b3c24){return db[_0x60a6('0x29')][_0x60a6('0x4a')]()[_0x60a6('0x3f')](respondWithResult(_0x1b3c24,null))[_0x60a6('0x43')](handleError(_0x1b3c24,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index b04a921..7455c3d 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 _0xe558=['emit','hasOwnProperty','exports','../../mysqldb','MailSubstatus','setMaxListeners','update'];(function(_0x567b34,_0x243dcc){var _0x483c16=function(_0x335304){while(--_0x335304){_0x567b34['push'](_0x567b34['shift']());}};_0x483c16(++_0x243dcc);}(_0xe558,0xb2));var _0x8e55=function(_0x239d71,_0x437ec3){_0x239d71=_0x239d71-0x0;var _0x1f8174=_0xe558[_0x239d71];return _0x1f8174;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x8e55('0x0'))['db'][_0x8e55('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x8e55('0x2')](0x0);var events={'afterUpdate':_0x8e55('0x3')};function emitEvent(_0x2b26af){return function(_0x19d52c,_0x1aa6b8,_0x598f4f){MailSubstatusEvents[_0x8e55('0x4')](_0x2b26af+':'+_0x19d52c['id'],_0x19d52c);MailSubstatusEvents[_0x8e55('0x4')](_0x2b26af,_0x19d52c);_0x598f4f(null);};}for(var e in events){if(events[_0x8e55('0x5')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x8e55('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0xaf34=['../../mysqldb','MailSubstatus','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf34,0xa8));var _0x4af3=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xaf34[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x4af3('0x0'))['db'][_0x4af3('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x4f8823){return function(_0xc75ce1,_0x476102,_0x55af12){MailSubstatusEvents[_0x4af3('0x2')](_0x4f8823+':'+_0xc75ce1['id'],_0xc75ce1);MailSubstatusEvents['emit'](_0x4f8823,_0xc75ce1);_0x55af12(null);};}for(var e in events){if(events[_0x4af3('0x3')](e)){var event=events[e];MailSubstatus[_0x4af3('0x4')](e,emitEvent(event));}}module[_0x4af3('0x5')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index f6b8e34..a0facf2 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 _0xf8cd=['define','MailSubstatus','mail_substatuses','Condition','update','name','_previousDataValues','./mailSubstatus.attributes','exports','models'];(function(_0x5c321d,_0x62b516){var _0x5e5b81=function(_0x3fa897){while(--_0x3fa897){_0x5c321d['push'](_0x5c321d['shift']());}};_0x5e5b81(++_0x62b516);}(_0xf8cd,0xf7));var _0xdf8c=function(_0x3c08e8,_0xe8ff06){_0x3c08e8=_0x3c08e8-0x0;var _0x20af88=_0xf8cd[_0x3c08e8];return _0x20af88;};'use strict';var attributes=require(_0xdf8c('0x0'));module[_0xdf8c('0x1')]=function(_0x4c4ea2){var _0x2f2be9=_0x4c4ea2[_0xdf8c('0x2')];return _0x4c4ea2[_0xdf8c('0x3')](_0xdf8c('0x4'),attributes,{'tableName':_0xdf8c('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x781b98,_0x281eec,_0x1bed2d){return _0x2f2be9[_0xdf8c('0x6')][_0xdf8c('0x7')]({'value':_0x781b98[_0xdf8c('0x8')]},{'where':{'field':'mailSubstatus','value':_0x781b98[_0xdf8c('0x9')]['name']}})['then'](function(){_0x1bed2d();})['catch'](function(_0xa3c8c9){_0x1bed2d(_0xa3c8c9);});}}});}; \ No newline at end of file +var _0x1540=['_previousDataValues','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','update','name'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x1540,0x1c4));var _0x0154=function(_0x267376,_0x49ea37){_0x267376=_0x267376-0x0;var _0xbd5b51=_0x1540[_0x267376];return _0xbd5b51;};'use strict';var attributes=require(_0x0154('0x0'));module[_0x0154('0x1')]=function(_0x103201){var _0x5153c9=_0x103201[_0x0154('0x2')];return _0x103201[_0x0154('0x3')](_0x0154('0x4'),attributes,{'tableName':_0x0154('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x240a2d,_0x52333a,_0xa29e95){return _0x5153c9['Condition'][_0x0154('0x6')]({'value':_0x240a2d[_0x0154('0x7')]},{'where':{'field':'mailSubstatus','value':_0x240a2d[_0x0154('0x8')][_0x0154('0x7')]}})['then'](function(){_0xa29e95();})[_0x0154('0x9')](function(_0x6e0425){_0xa29e95(_0x6e0425);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 6c78348..b3472e3 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 _0x0c9d=['request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x5b38dd,_0x51cbb4){var _0x1d95e2=function(_0x142e17){while(--_0x142e17){_0x5b38dd['push'](_0x5b38dd['shift']());}};_0x1d95e2(++_0x51cbb4);}(_0x0c9d,0x1ad));var _0xd0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd0c9('0x0'));var util=require('util');var moment=require(_0xd0c9('0x1'));var BPromise=require(_0xd0c9('0x2'));var rs=require(_0xd0c9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd0c9('0x4'));var logger=require(_0xd0c9('0x5'))(_0xd0c9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd0c9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46f6f9,_0x2743c5,_0x5bc6c5){return new BPromise(function(_0x203310,_0x5b74d8){return client['request'](_0x46f6f9,_0x5bc6c5)[_0xd0c9('0x8')](function(_0x2390a3){logger[_0xd0c9('0x9')](_0xd0c9('0xa'),_0x2743c5,_0xd0c9('0xb'));logger[_0xd0c9('0xc')](_0xd0c9('0xd'),_0x2743c5,_0xd0c9('0xb'),JSON[_0xd0c9('0xe')](_0x2390a3));if(_0x2390a3[_0xd0c9('0xf')]){if(_0x2390a3[_0xd0c9('0xf')][_0xd0c9('0x10')]===0x1f4){logger[_0xd0c9('0xf')](_0xd0c9('0xa'),_0x2743c5,_0x2390a3['error'][_0xd0c9('0x11')]);return _0x5b74d8(_0x2390a3[_0xd0c9('0xf')][_0xd0c9('0x11')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2743c5,_0x2390a3[_0xd0c9('0xf')][_0xd0c9('0x11')]);return _0x203310(_0x2390a3[_0xd0c9('0xf')]['message']);}else{logger[_0xd0c9('0x9')](_0xd0c9('0xa'),_0x2743c5,_0xd0c9('0xb'));_0x203310(_0x2390a3[_0xd0c9('0x12')]['message']);}})[_0xd0c9('0x13')](function(_0x10b492){logger[_0xd0c9('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x2743c5,_0x10b492);_0x5b74d8(_0x10b492);});});} \ No newline at end of file +var _0xaff4=['debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent'];(function(_0x5a554,_0x39fc96){var _0x177e5d=function(_0x1a0343){while(--_0x1a0343){_0x5a554['push'](_0x5a554['shift']());}};_0x177e5d(++_0x39fc96);}(_0xaff4,0xbf));var _0x4aff=function(_0x5ef905,_0x564b87){_0x5ef905=_0x5ef905-0x0;var _0x367808=_0xaff4[_0x5ef905];return _0x367808;};'use strict';var _=require(_0x4aff('0x0'));var util=require(_0x4aff('0x1'));var moment=require(_0x4aff('0x2'));var BPromise=require(_0x4aff('0x3'));var rs=require(_0x4aff('0x4'));var fs=require('fs');var Redis=require(_0x4aff('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4aff('0x6'))('rpc');var config=require(_0x4aff('0x7'));var jayson=require(_0x4aff('0x8'));var client=jayson[_0x4aff('0x9')][_0x4aff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a6727,_0x1c8a3d,_0x8be350){return new BPromise(function(_0x34fc6b,_0x550a0a){return client[_0x4aff('0xb')](_0x3a6727,_0x8be350)[_0x4aff('0xc')](function(_0x453a68){logger[_0x4aff('0xd')](_0x4aff('0xe'),_0x1c8a3d,_0x4aff('0xf'));logger[_0x4aff('0x10')](_0x4aff('0x11'),_0x1c8a3d,_0x4aff('0xf'),JSON[_0x4aff('0x12')](_0x453a68));if(_0x453a68[_0x4aff('0x13')]){if(_0x453a68[_0x4aff('0x13')]['code']===0x1f4){logger[_0x4aff('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x1c8a3d,_0x453a68[_0x4aff('0x13')][_0x4aff('0x14')]);return _0x550a0a(_0x453a68['error'][_0x4aff('0x14')]);}logger[_0x4aff('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x1c8a3d,_0x453a68['error']['message']);return _0x34fc6b(_0x453a68[_0x4aff('0x13')][_0x4aff('0x14')]);}else{logger[_0x4aff('0xd')](_0x4aff('0xe'),_0x1c8a3d,'request\x20sent');_0x34fc6b(_0x453a68[_0x4aff('0x15')]['message']);}})[_0x4aff('0x16')](function(_0x205da0){logger[_0x4aff('0x13')](_0x4aff('0xe'),_0x1c8a3d,_0x205da0);_0x550a0a(_0x205da0);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 9d1221b..4470557 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 _0xe868=['delete','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','post','create','put','update'];(function(_0x2d1af4,_0x202b1f){var _0xa6c28e=function(_0xc43158){while(--_0xc43158){_0x2d1af4['push'](_0x2d1af4['shift']());}};_0xa6c28e(++_0x202b1f);}(_0xe868,0x18d));var _0x8e86=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe868[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x8e86('0x0'));var util=require(_0x8e86('0x1'));var path=require(_0x8e86('0x2'));var timeout=require(_0x8e86('0x3'));var express=require(_0x8e86('0x4'));var router=express['Router']();var fs_extra=require(_0x8e86('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8e86('0x6'));var config=require(_0x8e86('0x7'));var controller=require('./mailTransferReport.controller');router[_0x8e86('0x8')]('/',auth[_0x8e86('0x9')](),controller[_0x8e86('0xa')]);router['get']('/describe',auth[_0x8e86('0x9')](),controller[_0x8e86('0xb')]);router[_0x8e86('0x8')](_0x8e86('0xc'),auth[_0x8e86('0x9')](),controller['show']);router[_0x8e86('0xd')]('/',auth[_0x8e86('0x9')](),controller[_0x8e86('0xe')]);router[_0x8e86('0xf')](_0x8e86('0xc'),auth[_0x8e86('0x9')](),controller[_0x8e86('0x10')]);router[_0x8e86('0x11')](_0x8e86('0xc'),auth[_0x8e86('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd0aa=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','multer','path','express','Router','fs-extra'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd0aa,0xcd));var _0xad0a=function(_0x25da85,_0x4830d9){_0x25da85=_0x25da85-0x0;var _0x1d4f37=_0xd0aa[_0x25da85];return _0x1d4f37;};'use strict';var multer=require(_0xad0a('0x0'));var util=require('util');var path=require(_0xad0a('0x1'));var timeout=require('connect-timeout');var express=require(_0xad0a('0x2'));var router=express[_0xad0a('0x3')]();var fs_extra=require(_0xad0a('0x4'));var auth=require(_0xad0a('0x5'));var interaction=require(_0xad0a('0x6'));var config=require(_0xad0a('0x7'));var controller=require(_0xad0a('0x8'));router[_0xad0a('0x9')]('/',auth[_0xad0a('0xa')](),controller[_0xad0a('0xb')]);router[_0xad0a('0x9')](_0xad0a('0xc'),auth[_0xad0a('0xa')](),controller[_0xad0a('0xd')]);router[_0xad0a('0x9')](_0xad0a('0xe'),auth['isAuthenticated'](),controller[_0xad0a('0xf')]);router[_0xad0a('0x10')]('/',auth[_0xad0a('0xa')](),controller[_0xad0a('0x11')]);router['put'](_0xad0a('0xe'),auth['isAuthenticated'](),controller[_0xad0a('0x12')]);router[_0xad0a('0x13')]('/:id',auth[_0xad0a('0xa')](),controller[_0xad0a('0x14')]);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 17e701d..deb74b1 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x147106,_0x25a803){var _0x47a326=function(_0x2d175c){while(--_0x2d175c){_0x147106['push'](_0x147106['shift']());}};_0x47a326(++_0x25a803);}(_0x70e0,0x17b));var _0x070e=function(_0x2cc4a1,_0x8b47a3){_0x2cc4a1=_0x2cc4a1-0x0;var _0x1f8048=_0x70e0[_0x2cc4a1];return _0x1f8048;};'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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x52304a,_0x3b4ac){var _0x2b89fb=function(_0x379630){while(--_0x379630){_0x52304a['push'](_0x52304a['shift']());}};_0x2b89fb(++_0x3b4ac);}(_0x70e0,0x17b));var _0x070e=function(_0x5e9bd1,_0x51ed01){_0x5e9bd1=_0x5e9bd1-0x0;var _0x5c493d=_0x70e0[_0x5e9bd1];return _0x5c493d;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 9fde168..507bab9 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 _0x6d5e=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','end','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','MailTransferReport','then','includeAll','findAll','rows','catch','show','params','keys','find','create','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6d5e,0x12a));var _0xe6d5=function(_0x482ae4,_0xcf147){_0x482ae4=_0x482ae4-0x0;var _0x2aedb0=_0x6d5e[_0x482ae4];return _0x2aedb0;};'use strict';var emlformat=require(_0xe6d5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe6d5('0x1'));var jsonpatch=require(_0xe6d5('0x2'));var rp=require(_0xe6d5('0x3'));var moment=require(_0xe6d5('0x4'));var BPromise=require(_0xe6d5('0x5'));var Mustache=require(_0xe6d5('0x6'));var util=require(_0xe6d5('0x7'));var path=require(_0xe6d5('0x8'));var sox=require(_0xe6d5('0x9'));var csv=require(_0xe6d5('0xa'));var ejs=require(_0xe6d5('0xb'));var fs=require('fs');var fs_extra=require(_0xe6d5('0xc'));var _=require('lodash');var squel=require(_0xe6d5('0xd'));var crypto=require(_0xe6d5('0xe'));var jsforce=require(_0xe6d5('0xf'));var deskjs=require(_0xe6d5('0x10'));var toCsv=require(_0xe6d5('0xa'));var querystring=require(_0xe6d5('0x11'));var Papa=require(_0xe6d5('0x12'));var Redis=require(_0xe6d5('0x13'));var authService=require(_0xe6d5('0x14'));var qs=require(_0xe6d5('0x15'));var as=require(_0xe6d5('0x16'));var hardwareService=require(_0xe6d5('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xe6d5('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe6d5('0x19'))['db'];function respondWithStatusCode(_0x4d49e0,_0x4c335b){_0x4c335b=_0x4c335b||0xcc;return function(_0xaff951){if(_0xaff951){return _0x4d49e0[_0xe6d5('0x1a')](_0x4c335b);}return _0x4d49e0['status'](_0x4c335b)['end']();};}function respondWithResult(_0x5bac23,_0x4c9e8f){_0x4c9e8f=_0x4c9e8f||0xc8;return function(_0x21bf5d){if(_0x21bf5d){return _0x5bac23[_0xe6d5('0x1b')](_0x4c9e8f)[_0xe6d5('0x1c')](_0x21bf5d);}};}function respondWithFilteredResult(_0xc9d1be,_0x27316d){return function(_0x38dd06){if(_0x38dd06){var _0x4a4c51=typeof _0x27316d[_0xe6d5('0x1d')]===_0xe6d5('0x1e')&&typeof _0x27316d[_0xe6d5('0x1f')]==='undefined';var _0xe41897=_0x38dd06[_0xe6d5('0x20')];var _0x41dfd0=_0x4a4c51?0x0:_0x27316d[_0xe6d5('0x1d')];var _0x52da63=_0x4a4c51?_0x38dd06[_0xe6d5('0x20')]:_0x27316d['offset']+_0x27316d[_0xe6d5('0x1f')];var _0x446e1e;if(_0x52da63>=_0xe41897){_0x52da63=_0xe41897;_0x446e1e=0xc8;}else{_0x446e1e=0xce;}_0xc9d1be[_0xe6d5('0x1b')](_0x446e1e);return _0xc9d1be[_0xe6d5('0x21')](_0xe6d5('0x22'),_0x41dfd0+'-'+_0x52da63+'/'+_0xe41897)[_0xe6d5('0x1c')](_0x38dd06);}return null;};}function patchUpdates(_0x2fad77){return function(_0x35cf62){try{jsonpatch[_0xe6d5('0x23')](_0x35cf62,_0x2fad77,!![]);}catch(_0x1722fa){return BPromise[_0xe6d5('0x24')](_0x1722fa);}return _0x35cf62[_0xe6d5('0x25')]();};}function saveUpdates(_0xc15c79,_0x3073e4){return function(_0x1d003c){if(_0x1d003c){return _0x1d003c['update'](_0xc15c79)['then'](function(_0x2565ac){return _0x2565ac;});}return null;};}function removeEntity(_0x26d7fc,_0x1535a6){return function(_0x525b8e){if(_0x525b8e){return _0x525b8e[_0xe6d5('0x26')]()['then'](function(){_0x26d7fc['status'](0xcc)[_0xe6d5('0x27')]();});}};}function handleEntityNotFound(_0x4e57c3,_0x263d85){return function(_0x5c74de){if(!_0x5c74de){_0x4e57c3[_0xe6d5('0x1a')](0x194);}return _0x5c74de;};}function handleError(_0x45b375,_0x948cba){_0x948cba=_0x948cba||0x1f4;return function(_0x2b0ca7){logger[_0xe6d5('0x28')](_0x2b0ca7['stack']);if(_0x2b0ca7['name']){delete _0x2b0ca7[_0xe6d5('0x29')];}_0x45b375[_0xe6d5('0x1b')](_0x948cba)[_0xe6d5('0x2a')](_0x2b0ca7);};}exports[_0xe6d5('0x2b')]=function(_0x284e0a,_0x4bd6f5){var _0x558224={},_0x128cf8={},_0x49e8db={'count':0x0,'rows':[]};var _0x590dfc=_['map'](db['MailTransferReport'][_0xe6d5('0x2c')],function(_0x19ad58){return{'name':_0x19ad58[_0xe6d5('0x2d')],'type':_0x19ad58[_0xe6d5('0x2e')][_0xe6d5('0x2f')]};});_0x128cf8[_0xe6d5('0x30')]=_[_0xe6d5('0x31')](_0x590dfc,'name');_0x128cf8[_0xe6d5('0x32')]=_['keys'](_0x284e0a['query']);_0x128cf8[_0xe6d5('0x33')]=_[_0xe6d5('0x34')](_0x128cf8[_0xe6d5('0x30')],_0x128cf8[_0xe6d5('0x32')]);_0x558224['attributes']=_[_0xe6d5('0x34')](_0x128cf8['model'],qs[_0xe6d5('0x35')](_0x284e0a[_0xe6d5('0x32')][_0xe6d5('0x35')]));_0x558224['attributes']=_0x558224[_0xe6d5('0x36')][_0xe6d5('0x37')]?_0x558224[_0xe6d5('0x36')]:_0x128cf8['model'];if(!_0x284e0a['query'][_0xe6d5('0x38')](_0xe6d5('0x39'))){_0x558224[_0xe6d5('0x1f')]=qs[_0xe6d5('0x1f')](_0x284e0a[_0xe6d5('0x32')]['limit']);_0x558224['offset']=qs['offset'](_0x284e0a[_0xe6d5('0x32')][_0xe6d5('0x1d')]);}_0x558224[_0xe6d5('0x3a')]=qs[_0xe6d5('0x3b')](_0x284e0a[_0xe6d5('0x32')][_0xe6d5('0x3b')]);_0x558224[_0xe6d5('0x3c')]=qs[_0xe6d5('0x33')](_['pick'](_0x284e0a['query'],_0x128cf8[_0xe6d5('0x33')]),_0x590dfc);if(_0x284e0a[_0xe6d5('0x32')][_0xe6d5('0x3d')]){_0x558224['where']=_[_0xe6d5('0x3e')](_0x558224['where'],{'$or':_[_0xe6d5('0x31')](_0x590dfc,function(_0x81f4ec){if(_0x81f4ec[_0xe6d5('0x2e')]!=='VIRTUAL'){var _0x590087={};_0x590087[_0x81f4ec[_0xe6d5('0x29')]]={'$like':'%'+_0x284e0a[_0xe6d5('0x32')][_0xe6d5('0x3d')]+'%'};return _0x590087;}})});}_0x558224=_[_0xe6d5('0x3e')]({},_0x558224,_0x284e0a[_0xe6d5('0x3f')]);var _0x1ad6b0={'where':_0x558224[_0xe6d5('0x3c')]};return db[_0xe6d5('0x40')]['count'](_0x1ad6b0)[_0xe6d5('0x41')](function(_0x273da3){_0x49e8db[_0xe6d5('0x20')]=_0x273da3;if(_0x284e0a['query'][_0xe6d5('0x42')]){_0x558224['include']=[{'all':!![]}];}return db[_0xe6d5('0x40')][_0xe6d5('0x43')](_0x558224);})[_0xe6d5('0x41')](function(_0x23f17b){_0x49e8db[_0xe6d5('0x44')]=_0x23f17b;return _0x49e8db;})[_0xe6d5('0x41')](respondWithFilteredResult(_0x4bd6f5,_0x558224))[_0xe6d5('0x45')](handleError(_0x4bd6f5,null));};exports[_0xe6d5('0x46')]=function(_0x3d5061,_0x5f7c35){var _0x2724c2={'raw':!![],'where':{'id':_0x3d5061[_0xe6d5('0x47')]['id']}},_0x3a1da0={};_0x3a1da0[_0xe6d5('0x30')]=_['keys'](db['MailTransferReport']['rawAttributes']);_0x3a1da0[_0xe6d5('0x32')]=_[_0xe6d5('0x48')](_0x3d5061[_0xe6d5('0x32')]);_0x3a1da0['filters']=_[_0xe6d5('0x34')](_0x3a1da0[_0xe6d5('0x30')],_0x3a1da0[_0xe6d5('0x32')]);_0x2724c2['attributes']=_['intersection'](_0x3a1da0[_0xe6d5('0x30')],qs[_0xe6d5('0x35')](_0x3d5061[_0xe6d5('0x32')][_0xe6d5('0x35')]));_0x2724c2[_0xe6d5('0x36')]=_0x2724c2[_0xe6d5('0x36')]['length']?_0x2724c2[_0xe6d5('0x36')]:_0x3a1da0['model'];if(_0x3d5061[_0xe6d5('0x32')][_0xe6d5('0x42')]){_0x2724c2['include']=[{'all':!![]}];}_0x2724c2=_[_0xe6d5('0x3e')]({},_0x2724c2,_0x3d5061[_0xe6d5('0x3f')]);return db['MailTransferReport'][_0xe6d5('0x49')](_0x2724c2)['then'](handleEntityNotFound(_0x5f7c35,null))[_0xe6d5('0x41')](respondWithResult(_0x5f7c35,null))[_0xe6d5('0x45')](handleError(_0x5f7c35,null));};exports[_0xe6d5('0x4a')]=function(_0x55874f,_0x599d5e){return db['MailTransferReport']['create'](_0x55874f['body'],{})['then'](respondWithResult(_0x599d5e,0xc9))[_0xe6d5('0x45')](handleError(_0x599d5e,null));};exports[_0xe6d5('0x4b')]=function(_0x59cffd,_0x5cc86e){if(_0x59cffd[_0xe6d5('0x4c')]['id']){delete _0x59cffd[_0xe6d5('0x4c')]['id'];}return db[_0xe6d5('0x40')][_0xe6d5('0x49')]({'where':{'id':_0x59cffd[_0xe6d5('0x47')]['id']}})[_0xe6d5('0x41')](handleEntityNotFound(_0x5cc86e,null))['then'](saveUpdates(_0x59cffd[_0xe6d5('0x4c')],null))[_0xe6d5('0x41')](respondWithResult(_0x5cc86e,null))[_0xe6d5('0x45')](handleError(_0x5cc86e,null));};exports[_0xe6d5('0x26')]=function(_0x37f834,_0x3ba89d){return db[_0xe6d5('0x40')]['find']({'where':{'id':_0x37f834[_0xe6d5('0x47')]['id']}})[_0xe6d5('0x41')](handleEntityNotFound(_0x3ba89d,null))[_0xe6d5('0x41')](removeEntity(_0x3ba89d,null))['catch'](handleError(_0x3ba89d,null));};exports['describe']=function(_0x19eaab,_0x524121){return db[_0xe6d5('0x40')][_0xe6d5('0x4d')]()[_0xe6d5('0x41')](respondWithResult(_0x524121,null))[_0xe6d5('0x45')](handleError(_0x524121,null));}; \ No newline at end of file +var _0xefef=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','MailTransferReport','rawAttributes','key','model','keys','filters','intersection','query','attributes','fields','length','order','sort','where','filter','merge','type','VIRTUAL','count','include','findAll','show','includeAll','options','find','create','catch','body','params','describe','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x2e9933,_0x3ed76c){var _0x295125=function(_0x369e3e){while(--_0x369e3e){_0x2e9933['push'](_0x2e9933['shift']());}};_0x295125(++_0x3ed76c);}(_0xefef,0x19c));var _0xfefe=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0xefef[_0x581af1];return _0x54c22e;};'use strict';var emlformat=require(_0xfefe('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfefe('0x1'));var rp=require(_0xfefe('0x2'));var moment=require(_0xfefe('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfefe('0x4'));var path=require(_0xfefe('0x5'));var sox=require(_0xfefe('0x6'));var csv=require(_0xfefe('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfefe('0x8'));var _=require('lodash');var squel=require(_0xfefe('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfefe('0xa'));var toCsv=require(_0xfefe('0x7'));var querystring=require(_0xfefe('0xb'));var Papa=require('papaparse');var Redis=require(_0xfefe('0xc'));var authService=require(_0xfefe('0xd'));var qs=require(_0xfefe('0xe'));var as=require(_0xfefe('0xf'));var hardwareService=require(_0xfefe('0x10'));var logger=require(_0xfefe('0x11'))(_0xfefe('0x12'));var utils=require(_0xfefe('0x13'));var config=require(_0xfefe('0x14'));var licenseUtil=require(_0xfefe('0x15'));var db=require(_0xfefe('0x16'))['db'];function respondWithStatusCode(_0x51e472,_0x9be0b8){_0x9be0b8=_0x9be0b8||0xcc;return function(_0x7ed8d1){if(_0x7ed8d1){return _0x51e472['sendStatus'](_0x9be0b8);}return _0x51e472['status'](_0x9be0b8)[_0xfefe('0x17')]();};}function respondWithResult(_0x29142d,_0x285058){_0x285058=_0x285058||0xc8;return function(_0x1b9e94){if(_0x1b9e94){return _0x29142d[_0xfefe('0x18')](_0x285058)[_0xfefe('0x19')](_0x1b9e94);}};}function respondWithFilteredResult(_0xd47547,_0x5d85e5){return function(_0x330d24){if(_0x330d24){var _0x4ba7d9=typeof _0x5d85e5[_0xfefe('0x1a')]==='undefined'&&typeof _0x5d85e5[_0xfefe('0x1b')]==='undefined';var _0x32b51f=_0x330d24['count'];var _0x41e0ff=_0x4ba7d9?0x0:_0x5d85e5[_0xfefe('0x1a')];var _0xe7e182=_0x4ba7d9?_0x330d24['count']:_0x5d85e5[_0xfefe('0x1a')]+_0x5d85e5['limit'];var _0x5dab53;if(_0xe7e182>=_0x32b51f){_0xe7e182=_0x32b51f;_0x5dab53=0xc8;}else{_0x5dab53=0xce;}_0xd47547[_0xfefe('0x18')](_0x5dab53);return _0xd47547[_0xfefe('0x1c')](_0xfefe('0x1d'),_0x41e0ff+'-'+_0xe7e182+'/'+_0x32b51f)[_0xfefe('0x19')](_0x330d24);}return null;};}function patchUpdates(_0x210fd8){return function(_0x53ae44){try{jsonpatch[_0xfefe('0x1e')](_0x53ae44,_0x210fd8,!![]);}catch(_0x1092a4){return BPromise[_0xfefe('0x1f')](_0x1092a4);}return _0x53ae44[_0xfefe('0x20')]();};}function saveUpdates(_0x129cd5,_0x44c12a){return function(_0x2302d3){if(_0x2302d3){return _0x2302d3[_0xfefe('0x21')](_0x129cd5)[_0xfefe('0x22')](function(_0x536fc2){return _0x536fc2;});}return null;};}function removeEntity(_0x3d4b64,_0x59a32c){return function(_0x417d3f){if(_0x417d3f){return _0x417d3f[_0xfefe('0x23')]()[_0xfefe('0x22')](function(){_0x3d4b64[_0xfefe('0x18')](0xcc)[_0xfefe('0x17')]();});}};}function handleEntityNotFound(_0x1ef244,_0x1dbed3){return function(_0x434704){if(!_0x434704){_0x1ef244['sendStatus'](0x194);}return _0x434704;};}function handleError(_0x4cc7d5,_0x908d8b){_0x908d8b=_0x908d8b||0x1f4;return function(_0x5f3eee){logger['error'](_0x5f3eee[_0xfefe('0x24')]);if(_0x5f3eee[_0xfefe('0x25')]){delete _0x5f3eee[_0xfefe('0x25')];}_0x4cc7d5[_0xfefe('0x18')](_0x908d8b)[_0xfefe('0x26')](_0x5f3eee);};}exports[_0xfefe('0x27')]=function(_0x4b1f96,_0x11aaa4){var _0x434e72={},_0x3bf6e5={},_0x121171={'count':0x0,'rows':[]};var _0x4637fa=_[_0xfefe('0x28')](db[_0xfefe('0x29')][_0xfefe('0x2a')],function(_0x44cbd4){return{'name':_0x44cbd4['fieldName'],'type':_0x44cbd4['type'][_0xfefe('0x2b')]};});_0x3bf6e5[_0xfefe('0x2c')]=_[_0xfefe('0x28')](_0x4637fa,_0xfefe('0x25'));_0x3bf6e5['query']=_[_0xfefe('0x2d')](_0x4b1f96['query']);_0x3bf6e5[_0xfefe('0x2e')]=_[_0xfefe('0x2f')](_0x3bf6e5[_0xfefe('0x2c')],_0x3bf6e5[_0xfefe('0x30')]);_0x434e72[_0xfefe('0x31')]=_[_0xfefe('0x2f')](_0x3bf6e5[_0xfefe('0x2c')],qs[_0xfefe('0x32')](_0x4b1f96['query'][_0xfefe('0x32')]));_0x434e72[_0xfefe('0x31')]=_0x434e72[_0xfefe('0x31')][_0xfefe('0x33')]?_0x434e72['attributes']:_0x3bf6e5[_0xfefe('0x2c')];if(!_0x4b1f96[_0xfefe('0x30')]['hasOwnProperty']('nolimit')){_0x434e72[_0xfefe('0x1b')]=qs['limit'](_0x4b1f96[_0xfefe('0x30')][_0xfefe('0x1b')]);_0x434e72[_0xfefe('0x1a')]=qs['offset'](_0x4b1f96[_0xfefe('0x30')][_0xfefe('0x1a')]);}_0x434e72[_0xfefe('0x34')]=qs[_0xfefe('0x35')](_0x4b1f96[_0xfefe('0x30')][_0xfefe('0x35')]);_0x434e72[_0xfefe('0x36')]=qs[_0xfefe('0x2e')](_['pick'](_0x4b1f96['query'],_0x3bf6e5[_0xfefe('0x2e')]),_0x4637fa);if(_0x4b1f96[_0xfefe('0x30')][_0xfefe('0x37')]){_0x434e72['where']=_[_0xfefe('0x38')](_0x434e72['where'],{'$or':_['map'](_0x4637fa,function(_0xa423ce){if(_0xa423ce[_0xfefe('0x39')]!==_0xfefe('0x3a')){var _0xcfc342={};_0xcfc342[_0xa423ce[_0xfefe('0x25')]]={'$like':'%'+_0x4b1f96['query'][_0xfefe('0x37')]+'%'};return _0xcfc342;}})});}_0x434e72=_[_0xfefe('0x38')]({},_0x434e72,_0x4b1f96['options']);var _0x2e5467={'where':_0x434e72[_0xfefe('0x36')]};return db[_0xfefe('0x29')]['count'](_0x2e5467)[_0xfefe('0x22')](function(_0x114dc8){_0x121171[_0xfefe('0x3b')]=_0x114dc8;if(_0x4b1f96['query']['includeAll']){_0x434e72[_0xfefe('0x3c')]=[{'all':!![]}];}return db[_0xfefe('0x29')][_0xfefe('0x3d')](_0x434e72);})[_0xfefe('0x22')](function(_0x28ddc2){_0x121171['rows']=_0x28ddc2;return _0x121171;})[_0xfefe('0x22')](respondWithFilteredResult(_0x11aaa4,_0x434e72))['catch'](handleError(_0x11aaa4,null));};exports[_0xfefe('0x3e')]=function(_0x51104f,_0x31ad53){var _0x462aa1={'raw':!![],'where':{'id':_0x51104f['params']['id']}},_0x32ca36={};_0x32ca36[_0xfefe('0x2c')]=_[_0xfefe('0x2d')](db['MailTransferReport'][_0xfefe('0x2a')]);_0x32ca36['query']=_[_0xfefe('0x2d')](_0x51104f['query']);_0x32ca36[_0xfefe('0x2e')]=_[_0xfefe('0x2f')](_0x32ca36[_0xfefe('0x2c')],_0x32ca36['query']);_0x462aa1['attributes']=_[_0xfefe('0x2f')](_0x32ca36[_0xfefe('0x2c')],qs['fields'](_0x51104f['query'][_0xfefe('0x32')]));_0x462aa1[_0xfefe('0x31')]=_0x462aa1[_0xfefe('0x31')][_0xfefe('0x33')]?_0x462aa1[_0xfefe('0x31')]:_0x32ca36[_0xfefe('0x2c')];if(_0x51104f[_0xfefe('0x30')][_0xfefe('0x3f')]){_0x462aa1['include']=[{'all':!![]}];}_0x462aa1=_['merge']({},_0x462aa1,_0x51104f[_0xfefe('0x40')]);return db['MailTransferReport'][_0xfefe('0x41')](_0x462aa1)['then'](handleEntityNotFound(_0x31ad53,null))['then'](respondWithResult(_0x31ad53,null))['catch'](handleError(_0x31ad53,null));};exports[_0xfefe('0x42')]=function(_0x48b2cc,_0x19455d){return db[_0xfefe('0x29')][_0xfefe('0x42')](_0x48b2cc['body'],{})[_0xfefe('0x22')](respondWithResult(_0x19455d,0xc9))[_0xfefe('0x43')](handleError(_0x19455d,null));};exports[_0xfefe('0x21')]=function(_0x2fa54a,_0xa12dee){if(_0x2fa54a[_0xfefe('0x44')]['id']){delete _0x2fa54a[_0xfefe('0x44')]['id'];}return db[_0xfefe('0x29')]['find']({'where':{'id':_0x2fa54a[_0xfefe('0x45')]['id']}})[_0xfefe('0x22')](handleEntityNotFound(_0xa12dee,null))[_0xfefe('0x22')](saveUpdates(_0x2fa54a[_0xfefe('0x44')],null))[_0xfefe('0x22')](respondWithResult(_0xa12dee,null))[_0xfefe('0x43')](handleError(_0xa12dee,null));};exports[_0xfefe('0x23')]=function(_0x2dd4a9,_0xc01fcd){return db['MailTransferReport'][_0xfefe('0x41')]({'where':{'id':_0x2dd4a9['params']['id']}})[_0xfefe('0x22')](handleEntityNotFound(_0xc01fcd,null))[_0xfefe('0x22')](removeEntity(_0xc01fcd,null))[_0xfefe('0x43')](handleError(_0xc01fcd,null));};exports[_0xfefe('0x46')]=function(_0x4bb3b8,_0x4a3c47){return db['MailTransferReport'][_0xfefe('0x46')]()[_0xfefe('0x22')](respondWithResult(_0x4a3c47,null))[_0xfefe('0x43')](handleError(_0x4a3c47,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index fd0e719..aa684dc 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 _0x1360=['request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x533b17,_0x195e40){var _0x16b24a=function(_0x147192){while(--_0x147192){_0x533b17['push'](_0x533b17['shift']());}};_0x16b24a(++_0x195e40);}(_0x1360,0x180));var _0x0136=function(_0x2034f4,_0x2567a3){_0x2034f4=_0x2034f4-0x0;var _0x12952f=_0x1360[_0x2034f4];return _0x12952f;};'use strict';var _=require(_0x0136('0x0'));var util=require(_0x0136('0x1'));var logger=require(_0x0136('0x2'))(_0x0136('0x3'));var moment=require(_0x0136('0x4'));var BPromise=require(_0x0136('0x5'));var rp=require(_0x0136('0x6'));var fs=require('fs');var path=require(_0x0136('0x7'));var rimraf=require(_0x0136('0x8'));var config=require(_0x0136('0x9'));var attributes=require(_0x0136('0xa'));module[_0x0136('0xb')]=function(_0x4af361,_0x1aad3c){return _0x4af361[_0x0136('0xc')](_0x0136('0xd'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x0136('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x383d=['define','MailTransferReport','report_mail_transfer','uniqueid','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports'];(function(_0x59f1e7,_0x19cabf){var _0x17edf0=function(_0xb13be8){while(--_0xb13be8){_0x59f1e7['push'](_0x59f1e7['shift']());}};_0x17edf0(++_0x19cabf);}(_0x383d,0x86));var _0xd383=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x383d[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd383('0x0'))(_0xd383('0x1'));var moment=require(_0xd383('0x2'));var BPromise=require('bluebird');var rp=require(_0xd383('0x3'));var fs=require('fs');var path=require(_0xd383('0x4'));var rimraf=require(_0xd383('0x5'));var config=require(_0xd383('0x6'));var attributes=require(_0xd383('0x7'));module[_0xd383('0x8')]=function(_0x5a0b1d,_0xc64e9b){return _0x5a0b1d[_0xd383('0x9')](_0xd383('0xa'),attributes,{'tableName':_0xd383('0xb'),'paranoid':![],'indexes':[{'name':_0xd383('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 286b5e8..1c0c3d7 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 _0x1321=['info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message'];(function(_0x355041,_0xb7fd6b){var _0x535f43=function(_0x309fa7){while(--_0x309fa7){_0x355041['push'](_0x355041['shift']());}};_0x535f43(++_0xb7fd6b);}(_0x1321,0x1ca));var _0x1132=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x1321[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x1132('0x0'));var util=require(_0x1132('0x1'));var moment=require(_0x1132('0x2'));var BPromise=require(_0x1132('0x3'));var rs=require(_0x1132('0x4'));var fs=require('fs');var Redis=require(_0x1132('0x5'));var db=require(_0x1132('0x6'))['db'];var utils=require(_0x1132('0x7'));var logger=require(_0x1132('0x8'))(_0x1132('0x9'));var config=require('../../config/environment');var jayson=require(_0x1132('0xa'));var client=jayson[_0x1132('0xb')][_0x1132('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4de154,_0x143655,_0xfe854f){return new BPromise(function(_0x2f27e6,_0x58ff63){return client[_0x1132('0xd')](_0x4de154,_0xfe854f)['then'](function(_0x498a0c){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x143655,_0x1132('0xe'));logger[_0x1132('0xf')](_0x1132('0x10'),_0x143655,_0x1132('0xe'),JSON[_0x1132('0x11')](_0x498a0c));if(_0x498a0c[_0x1132('0x12')]){if(_0x498a0c[_0x1132('0x12')][_0x1132('0x13')]===0x1f4){logger[_0x1132('0x12')](_0x1132('0x14'),_0x143655,_0x498a0c[_0x1132('0x12')][_0x1132('0x15')]);return _0x58ff63(_0x498a0c[_0x1132('0x12')][_0x1132('0x15')]);}logger[_0x1132('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x143655,_0x498a0c[_0x1132('0x12')][_0x1132('0x15')]);return _0x2f27e6(_0x498a0c[_0x1132('0x12')][_0x1132('0x15')]);}else{logger[_0x1132('0x16')](_0x1132('0x14'),_0x143655,'request\x20sent');_0x2f27e6(_0x498a0c[_0x1132('0x17')][_0x1132('0x15')]);}})['catch'](function(_0x4e28e6){logger[_0x1132('0x12')](_0x1132('0x14'),_0x143655,_0x4e28e6);_0x58ff63(_0x4e28e6);});});} \ No newline at end of file +var _0x1a6c=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x24f9d1,_0x16513d){var _0x179826=function(_0x373e22){while(--_0x373e22){_0x24f9d1['push'](_0x24f9d1['shift']());}};_0x179826(++_0x16513d);}(_0x1a6c,0xeb));var _0xc1a6=function(_0x2fdbd3,_0x4e1edd){_0x2fdbd3=_0x2fdbd3-0x0;var _0x59f096=_0x1a6c[_0x2fdbd3];return _0x59f096;};'use strict';var _=require(_0xc1a6('0x0'));var util=require(_0xc1a6('0x1'));var moment=require(_0xc1a6('0x2'));var BPromise=require('bluebird');var rs=require(_0xc1a6('0x3'));var fs=require('fs');var Redis=require(_0xc1a6('0x4'));var db=require(_0xc1a6('0x5'))['db'];var utils=require(_0xc1a6('0x6'));var logger=require(_0xc1a6('0x7'))(_0xc1a6('0x8'));var config=require('../../config/environment');var jayson=require(_0xc1a6('0x9'));var client=jayson[_0xc1a6('0xa')][_0xc1a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37b4c8,_0x54110b,_0x588cd6){return new BPromise(function(_0x5b719b,_0x5067b3){return client[_0xc1a6('0xc')](_0x37b4c8,_0x588cd6)[_0xc1a6('0xd')](function(_0x338c16){logger[_0xc1a6('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x54110b,'request\x20sent');logger[_0xc1a6('0xf')](_0xc1a6('0x10'),_0x54110b,_0xc1a6('0x11'),JSON[_0xc1a6('0x12')](_0x338c16));if(_0x338c16[_0xc1a6('0x13')]){if(_0x338c16[_0xc1a6('0x13')][_0xc1a6('0x14')]===0x1f4){logger['error'](_0xc1a6('0x15'),_0x54110b,_0x338c16[_0xc1a6('0x13')][_0xc1a6('0x16')]);return _0x5067b3(_0x338c16['error'][_0xc1a6('0x16')]);}logger[_0xc1a6('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x54110b,_0x338c16['error'][_0xc1a6('0x16')]);return _0x5b719b(_0x338c16[_0xc1a6('0x13')][_0xc1a6('0x16')]);}else{logger[_0xc1a6('0xe')](_0xc1a6('0x15'),_0x54110b,_0xc1a6('0x11'));_0x5b719b(_0x338c16[_0xc1a6('0x17')]['message']);}})['catch'](function(_0x49f5b5){logger[_0xc1a6('0x13')](_0xc1a6('0x15'),_0x54110b,_0x49f5b5);_0x5067b3(_0x49f5b5);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 41567e1..2d774a6 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 _0x594f=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','index','get','/describe','describe','post','create','update','delete','destroy','multer','util'];(function(_0x2f981a,_0x1bbf5b){var _0x3a6121=function(_0x5b20c3){while(--_0x5b20c3){_0x2f981a['push'](_0x2f981a['shift']());}};_0x3a6121(++_0x1bbf5b);}(_0x594f,0x12e));var _0xf594=function(_0x419c34,_0x19c882){_0x419c34=_0x419c34-0x0;var _0x8f8230=_0x594f[_0x419c34];return _0x8f8230;};'use strict';var multer=require(_0xf594('0x0'));var util=require(_0xf594('0x1'));var path=require(_0xf594('0x2'));var timeout=require('connect-timeout');var express=require(_0xf594('0x3'));var router=express['Router']();var fs_extra=require(_0xf594('0x4'));var auth=require(_0xf594('0x5'));var interaction=require(_0xf594('0x6'));var config=require(_0xf594('0x7'));var controller=require(_0xf594('0x8'));router['get']('/',auth[_0xf594('0x9')](),controller[_0xf594('0xa')]);router[_0xf594('0xb')](_0xf594('0xc'),auth[_0xf594('0x9')](),controller[_0xf594('0xd')]);router[_0xf594('0xb')]('/:id',auth[_0xf594('0x9')](),controller['show']);router[_0xf594('0xe')]('/',auth[_0xf594('0x9')](),controller[_0xf594('0xf')]);router['put']('/:id',auth[_0xf594('0x9')](),controller[_0xf594('0x10')]);router[_0xf594('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf594('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd29a=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated','describe','post','create','update','/:id','destroy','exports','multer','util'];(function(_0x4e0789,_0x5b9c75){var _0x1c2a2b=function(_0x4b87a7){while(--_0x4b87a7){_0x4e0789['push'](_0x4e0789['shift']());}};_0x1c2a2b(++_0x5b9c75);}(_0xd29a,0x1f2));var _0xad29=function(_0x278cae,_0x550daa){_0x278cae=_0x278cae-0x0;var _0x459646=_0xd29a[_0x278cae];return _0x459646;};'use strict';var multer=require(_0xad29('0x0'));var util=require(_0xad29('0x1'));var path=require('path');var timeout=require(_0xad29('0x2'));var express=require(_0xad29('0x3'));var router=express['Router']();var fs_extra=require(_0xad29('0x4'));var auth=require(_0xad29('0x5'));var interaction=require(_0xad29('0x6'));var config=require(_0xad29('0x7'));var controller=require(_0xad29('0x8'));router[_0xad29('0x9')]('/',auth['isAuthenticated'](),controller[_0xad29('0xa')]);router[_0xad29('0x9')](_0xad29('0xb'),auth[_0xad29('0xc')](),controller[_0xad29('0xd')]);router[_0xad29('0x9')]('/:id',auth[_0xad29('0xc')](),controller['show']);router[_0xad29('0xe')]('/',auth[_0xad29('0xc')](),controller[_0xad29('0xf')]);router['put']('/:id',auth[_0xad29('0xc')](),controller[_0xad29('0x10')]);router['delete'](_0xad29('0x11'),auth[_0xad29('0xc')](),controller[_0xad29('0x12')]);module[_0xad29('0x13')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 9c1c3c1..8cdd127 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 _0xa876=['talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','diff','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]'];(function(_0x2920dd,_0x19d049){var _0x5d4e52=function(_0x46c751){while(--_0x46c751){_0x2920dd['push'](_0x2920dd['shift']());}};_0x5d4e52(++_0x19d049);}(_0xa876,0x16f));var _0x6a87=function(_0x333bd0,_0x574a34){_0x333bd0=_0x333bd0-0x0;var _0x265a5c=_0xa876[_0x333bd0];return _0x265a5c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6a87('0x0'));module[_0x6a87('0x1')]={'channel':{'type':Sequelize[_0x6a87('0x2')]},'membername':{'type':Sequelize[_0x6a87('0x2')]},'interface':{'type':Sequelize[_0x6a87('0x2')]},'type':{'type':Sequelize[_0x6a87('0x2')],'defaultValue':_0x6a87('0x3'),'comment':_0x6a87('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x6a87('0x5')]},'exitAt':{'type':Sequelize[_0x6a87('0x5')],'set':function(_0x3002fe){var _0x3368a4=moment(_0x3002fe);var _0x443fb2=moment(this['getDataValue']('enterAt'));var _0x267bfe=_0x3368a4[_0x6a87('0x6')](_0x443fb2,'seconds');this[_0x6a87('0x7')]('exitAt',_0x3002fe);this[_0x6a87('0x7')]('duration',_0x267bfe>=0x0?_0x267bfe:null);}},'data1':{'type':Sequelize[_0x6a87('0x2')],'comment':_0x6a87('0x8')},'data2':{'type':Sequelize[_0x6a87('0x2')],'comment':_0x6a87('0x9')},'data3':{'type':Sequelize[_0x6a87('0x2')],'comment':_0x6a87('0xa')},'data4':{'type':Sequelize[_0x6a87('0x2')],'comment':_0x6a87('0xb')},'data5':{'type':Sequelize[_0x6a87('0x2')],'comment':_0x6a87('0xc')},'role':{'type':Sequelize[_0x6a87('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x47da=['setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff','seconds'];(function(_0x7a8be9,_0x1caf02){var _0x4bab19=function(_0x539448){while(--_0x539448){_0x7a8be9['push'](_0x7a8be9['shift']());}};_0x4bab19(++_0x1caf02);}(_0x47da,0x104));var _0xa47d=function(_0x2eb2d0,_0x21f57e){_0x2eb2d0=_0x2eb2d0-0x0;var _0x21f1a2=_0x47da[_0x2eb2d0];return _0x21f1a2;};'use strict';var Sequelize=require(_0xa47d('0x0'));var moment=require(_0xa47d('0x1'));module[_0xa47d('0x2')]={'channel':{'type':Sequelize[_0xa47d('0x3')]},'membername':{'type':Sequelize[_0xa47d('0x3')]},'interface':{'type':Sequelize[_0xa47d('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xa47d('0x4')},'duration':{'type':Sequelize[_0xa47d('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xa47d('0x6')],'set':function(_0x2ba05e){var _0x68b63a=moment(_0x2ba05e);var _0x57cc17=moment(this[_0xa47d('0x7')]('enterAt'));var _0x1fe717=_0x68b63a[_0xa47d('0x8')](_0x57cc17,_0xa47d('0x9'));this[_0xa47d('0xa')](_0xa47d('0xb'),_0x2ba05e);this[_0xa47d('0xa')](_0xa47d('0xc'),_0x1fe717>=0x0?_0x1fe717:null);}},'data1':{'type':Sequelize[_0xa47d('0x3')],'comment':_0xa47d('0xd')},'data2':{'type':Sequelize[_0xa47d('0x3')],'comment':_0xa47d('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0xa47d('0xf')},'data4':{'type':Sequelize[_0xa47d('0x3')],'comment':_0xa47d('0x10')},'data5':{'type':Sequelize[_0xa47d('0x3')],'comment':_0xa47d('0x11')},'role':{'type':Sequelize[_0xa47d('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xa47d('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 76f3d35..9b97de4 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 _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x22b2ce,_0x54f9f8){var _0x59f45d=function(_0x427ca5){while(--_0x427ca5){_0x22b2ce['push'](_0x22b2ce['shift']());}};_0x59f45d(++_0x54f9f8);}(_0x3e74,0x175));var _0x43e7=function(_0x103b80,_0x37f40a){_0x103b80=_0x103b80-0x0;var _0x282655=_0x3e74[_0x103b80];return _0x282655;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file +var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x4baabf,_0x5c227e){var _0xf4098e=function(_0x8f007a){while(--_0x8f007a){_0x4baabf['push'](_0x4baabf['shift']());}};_0xf4098e(++_0x5c227e);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 97d9000..3f2e245 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 _0xd931=['util','api','moment','bluebird','request-promise','path','exports','define','MemberReport','membername_interface','lodash'];(function(_0x16a344,_0x43dc6c){var _0x24f848=function(_0x23c39a){while(--_0x23c39a){_0x16a344['push'](_0x16a344['shift']());}};_0x24f848(++_0x43dc6c);}(_0xd931,0xa4));var _0x1d93=function(_0x2be104,_0x4bf5d0){_0x2be104=_0x2be104-0x0;var _0x31c115=_0xd931[_0x2be104];return _0x31c115;};'use strict';var _=require(_0x1d93('0x0'));var util=require(_0x1d93('0x1'));var logger=require('../../config/logger')(_0x1d93('0x2'));var moment=require(_0x1d93('0x3'));var BPromise=require(_0x1d93('0x4'));var rp=require(_0x1d93('0x5'));var fs=require('fs');var path=require(_0x1d93('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0x1d93('0x7')]=function(_0x42e9ac,_0x54053c){return _0x42e9ac[_0x1d93('0x8')](_0x1d93('0x9'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x1d93('0xa'),'fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbb5b=['moment','bluebird','request-promise','rimraf','define','membername','interface','lodash','../../config/logger'];(function(_0x4b234f,_0x30d262){var _0x4d3db1=function(_0x2e35c1){while(--_0x2e35c1){_0x4b234f['push'](_0x4b234f['shift']());}};_0x4d3db1(++_0x30d262);}(_0xbb5b,0x154));var _0xbbb5=function(_0x5ac0f0,_0xee4d98){_0x5ac0f0=_0x5ac0f0-0x0;var _0x4aceec=_0xbb5b[_0x5ac0f0];return _0x4aceec;};'use strict';var _=require(_0xbbb5('0x0'));var util=require('util');var logger=require(_0xbbb5('0x1'))('api');var moment=require(_0xbbb5('0x2'));var BPromise=require(_0xbbb5('0x3'));var rp=require(_0xbbb5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbbb5('0x5'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module['exports']=function(_0x1844a6,_0x4e8f73){return _0x1844a6[_0xbbb5('0x6')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xbbb5('0x7'),_0xbbb5('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 6a8b6e5..8f43c48 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 _0x39d9=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','MemberReport,\x20%s,\x20%s','message','info','result','catch','GetMemberReport','MemberReport','findAll','options','attributes','limit','map','include','model','CreateMemberReport','body','raw','UpdateMemberReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x44cf61,_0x27f226){var _0x4e63d8=function(_0x533dd7){while(--_0x533dd7){_0x44cf61['push'](_0x44cf61['shift']());}};_0x4e63d8(++_0x27f226);}(_0x39d9,0x17f));var _0x939d=function(_0x368d3a,_0x3232ff){_0x368d3a=_0x368d3a-0x0;var _0x484a42=_0x39d9[_0x368d3a];return _0x484a42;};'use strict';var _=require(_0x939d('0x0'));var util=require(_0x939d('0x1'));var moment=require(_0x939d('0x2'));var BPromise=require(_0x939d('0x3'));var rs=require(_0x939d('0x4'));var fs=require('fs');var Redis=require(_0x939d('0x5'));var db=require(_0x939d('0x6'))['db'];var utils=require(_0x939d('0x7'));var logger=require('../../config/logger')(_0x939d('0x8'));var config=require(_0x939d('0x9'));var jayson=require(_0x939d('0xa'));var client=jayson['client'][_0x939d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x537fd2,_0x2ba30f,_0x1bac28){return new BPromise(function(_0x20546a,_0xd65604){return client[_0x939d('0xc')](_0x537fd2,_0x1bac28)[_0x939d('0xd')](function(_0x39e0b5){logger['info']('MemberReport,\x20%s,\x20%s',_0x2ba30f,_0x939d('0xe'));logger[_0x939d('0xf')](_0x939d('0x10'),_0x2ba30f,_0x939d('0xe'),JSON[_0x939d('0x11')](_0x39e0b5));if(_0x39e0b5['error']){if(_0x39e0b5['error']['code']===0x1f4){logger[_0x939d('0x12')](_0x939d('0x13'),_0x2ba30f,_0x39e0b5[_0x939d('0x12')]['message']);return _0xd65604(_0x39e0b5[_0x939d('0x12')][_0x939d('0x14')]);}logger[_0x939d('0x12')](_0x939d('0x13'),_0x2ba30f,_0x39e0b5[_0x939d('0x12')][_0x939d('0x14')]);return _0x20546a(_0x39e0b5[_0x939d('0x12')][_0x939d('0x14')]);}else{logger[_0x939d('0x15')]('MemberReport,\x20%s,\x20%s',_0x2ba30f,'request\x20sent');_0x20546a(_0x39e0b5[_0x939d('0x16')]['message']);}})[_0x939d('0x17')](function(_0x1b1a4f){logger['error'](_0x939d('0x13'),_0x2ba30f,_0x1b1a4f);_0xd65604(_0x1b1a4f);});});}exports[_0x939d('0x18')]=function(_0xbed71e){var _0x538408=this;return new Promise(function(_0x42212f,_0x187a23){return db[_0x939d('0x19')][_0x939d('0x1a')]({'raw':_0xbed71e[_0x939d('0x1b')]?_0xbed71e[_0x939d('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xbed71e['options']?_0xbed71e[_0x939d('0x1b')]['where']||null:null,'attributes':_0xbed71e[_0x939d('0x1b')]?_0xbed71e[_0x939d('0x1b')][_0x939d('0x1c')]||null:null,'limit':_0xbed71e['options']?_0xbed71e['options'][_0x939d('0x1d')]||null:null,'include':_0xbed71e['options']?_0xbed71e['options']['include']?_[_0x939d('0x1e')](_0xbed71e[_0x939d('0x1b')][_0x939d('0x1f')],function(_0x2532f2){return{'model':db[_0x2532f2['model']],'as':_0x2532f2['as'],'attributes':_0x2532f2[_0x939d('0x1c')],'include':_0x2532f2[_0x939d('0x1f')]?_['map'](_0x2532f2[_0x939d('0x1f')],function(_0x59c200){return{'model':db[_0x59c200['model']],'as':_0x59c200['as'],'attributes':_0x59c200[_0x939d('0x1c')],'include':_0x59c200[_0x939d('0x1f')]?_[_0x939d('0x1e')](_0x59c200[_0x939d('0x1f')],function(_0x4ab0e6){return{'model':db[_0x4ab0e6[_0x939d('0x20')]],'as':_0x4ab0e6['as'],'attributes':_0x4ab0e6['attributes']};}):[]};}):[]};}):[]:[]})[_0x939d('0xd')](function(_0x30da59){logger[_0x939d('0x15')](_0x939d('0x18'),_0xbed71e);logger[_0x939d('0xf')](_0x939d('0x18'),_0xbed71e,JSON['stringify'](_0x30da59));_0x42212f(_0x30da59);})[_0x939d('0x17')](function(_0x203f07){logger[_0x939d('0x12')](_0x939d('0x18'),_0x203f07[_0x939d('0x14')],_0xbed71e);_0x187a23(_0x538408['error'](0x1f4,_0x203f07['message']));});});};exports[_0x939d('0x21')]=function(_0x2a70bb){var _0x1f362f=this;return new Promise(function(_0x3c5b33,_0x7258d8){return db[_0x939d('0x19')]['create'](_0x2a70bb[_0x939d('0x22')],{'raw':_0x2a70bb['options']?_0x2a70bb[_0x939d('0x1b')][_0x939d('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x5557af){logger[_0x939d('0x15')]('CreateMemberReport',_0x2a70bb);logger['debug'](_0x939d('0x21'),_0x2a70bb,JSON[_0x939d('0x11')](_0x5557af));_0x3c5b33(_0x5557af);})[_0x939d('0x17')](function(_0x3d5ab5){logger[_0x939d('0x12')]('CreateMemberReport',_0x3d5ab5['message'],_0x2a70bb);_0x7258d8(_0x1f362f[_0x939d('0x12')](0x1f4,_0x3d5ab5[_0x939d('0x14')]));});});};exports[_0x939d('0x24')]=function(_0x4adb16){var _0x56ea6e=this;return new Promise(function(_0x1bdc68,_0x49ba6b){return db[_0x939d('0x19')][_0x939d('0x25')](_0x4adb16[_0x939d('0x22')],{'raw':_0x4adb16['options']?_0x4adb16[_0x939d('0x1b')][_0x939d('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4adb16[_0x939d('0x1b')]?_0x4adb16['options'][_0x939d('0x26')]||null:null,'attributes':_0x4adb16['options']?_0x4adb16['options'][_0x939d('0x1c')]||null:null,'limit':_0x4adb16[_0x939d('0x1b')]?_0x4adb16[_0x939d('0x1b')][_0x939d('0x1d')]||null:null})[_0x939d('0xd')](function(_0x513010){logger[_0x939d('0x15')]('UpdateMemberReport',_0x4adb16);logger[_0x939d('0xf')]('UpdateMemberReport',_0x4adb16,JSON[_0x939d('0x11')](_0x513010));_0x1bdc68(_0x513010);})[_0x939d('0x17')](function(_0xe4f8f1){logger[_0x939d('0x12')](_0x939d('0x24'),_0xe4f8f1[_0x939d('0x14')],_0x4adb16);_0x49ba6b(_0x56ea6e[_0x939d('0x12')](0x1f4,_0xe4f8f1[_0x939d('0x14')]));});});}; \ No newline at end of file +var _0xf417=['include','model','map','CreateMemberReport','create','body','UpdateMemberReport','update','limit','debug','stringify','util','moment','bluebird','ioredis','../../config/logger','http','then','info','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes'];(function(_0x5eb3f4,_0x3a2385){var _0x1b0084=function(_0x31f2fa){while(--_0x31f2fa){_0x5eb3f4['push'](_0x5eb3f4['shift']());}};_0x1b0084(++_0x3a2385);}(_0xf417,0x8f));var _0x7f41=function(_0x22e690,_0x5f570e){_0x22e690=_0x22e690-0x0;var _0x2b515f=_0xf417[_0x22e690];return _0x2b515f;};'use strict';var _=require('lodash');var util=require(_0x7f41('0x0'));var moment=require(_0x7f41('0x1'));var BPromise=require(_0x7f41('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f41('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7f41('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7f41('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x4e37b5,_0x34e466,_0x295136){return new BPromise(function(_0x507ac0,_0x26cfb2){return client['request'](_0x4e37b5,_0x295136)[_0x7f41('0x6')](function(_0x5f3a44){logger[_0x7f41('0x7')](_0x7f41('0x8'),_0x34e466,'request\x20sent');logger['debug'](_0x7f41('0x9'),_0x34e466,'request\x20sent',JSON['stringify'](_0x5f3a44));if(_0x5f3a44[_0x7f41('0xa')]){if(_0x5f3a44[_0x7f41('0xa')][_0x7f41('0xb')]===0x1f4){logger[_0x7f41('0xa')](_0x7f41('0x8'),_0x34e466,_0x5f3a44[_0x7f41('0xa')][_0x7f41('0xc')]);return _0x26cfb2(_0x5f3a44['error']['message']);}logger[_0x7f41('0xa')]('MemberReport,\x20%s,\x20%s',_0x34e466,_0x5f3a44['error'][_0x7f41('0xc')]);return _0x507ac0(_0x5f3a44[_0x7f41('0xa')][_0x7f41('0xc')]);}else{logger['info'](_0x7f41('0x8'),_0x34e466,'request\x20sent');_0x507ac0(_0x5f3a44[_0x7f41('0xd')][_0x7f41('0xc')]);}})[_0x7f41('0xe')](function(_0x54b159){logger[_0x7f41('0xa')](_0x7f41('0x8'),_0x34e466,_0x54b159);_0x26cfb2(_0x54b159);});});}exports[_0x7f41('0xf')]=function(_0x5434d2){var _0xeb2394=this;return new Promise(function(_0x26580c,_0x549ee8){return db[_0x7f41('0x10')][_0x7f41('0x11')]({'raw':_0x5434d2[_0x7f41('0x12')]?_0x5434d2['options'][_0x7f41('0x13')]===undefined?!![]:![]:!![],'where':_0x5434d2['options']?_0x5434d2['options'][_0x7f41('0x14')]||null:null,'attributes':_0x5434d2[_0x7f41('0x12')]?_0x5434d2[_0x7f41('0x12')][_0x7f41('0x15')]||null:null,'limit':_0x5434d2[_0x7f41('0x12')]?_0x5434d2[_0x7f41('0x12')]['limit']||null:null,'include':_0x5434d2['options']?_0x5434d2[_0x7f41('0x12')]['include']?_['map'](_0x5434d2[_0x7f41('0x12')][_0x7f41('0x16')],function(_0x4fdd78){return{'model':db[_0x4fdd78[_0x7f41('0x17')]],'as':_0x4fdd78['as'],'attributes':_0x4fdd78[_0x7f41('0x15')],'include':_0x4fdd78[_0x7f41('0x16')]?_[_0x7f41('0x18')](_0x4fdd78[_0x7f41('0x16')],function(_0x4cbee7){return{'model':db[_0x4cbee7['model']],'as':_0x4cbee7['as'],'attributes':_0x4cbee7['attributes'],'include':_0x4cbee7['include']?_[_0x7f41('0x18')](_0x4cbee7[_0x7f41('0x16')],function(_0x55a32a){return{'model':db[_0x55a32a[_0x7f41('0x17')]],'as':_0x55a32a['as'],'attributes':_0x55a32a[_0x7f41('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a814e){logger['info'](_0x7f41('0xf'),_0x5434d2);logger['debug']('GetMemberReport',_0x5434d2,JSON['stringify'](_0x4a814e));_0x26580c(_0x4a814e);})[_0x7f41('0xe')](function(_0x379dbe){logger['error'](_0x7f41('0xf'),_0x379dbe[_0x7f41('0xc')],_0x5434d2);_0x549ee8(_0xeb2394['error'](0x1f4,_0x379dbe[_0x7f41('0xc')]));});});};exports[_0x7f41('0x19')]=function(_0x151272){var _0x5df9a3=this;return new Promise(function(_0x5d8bfd,_0x5f4224){return db[_0x7f41('0x10')][_0x7f41('0x1a')](_0x151272[_0x7f41('0x1b')],{'raw':_0x151272[_0x7f41('0x12')]?_0x151272[_0x7f41('0x12')][_0x7f41('0x13')]===undefined?!![]:![]:!![]})['then'](function(_0x1d61a4){logger[_0x7f41('0x7')](_0x7f41('0x19'),_0x151272);logger['debug'](_0x7f41('0x19'),_0x151272,JSON['stringify'](_0x1d61a4));_0x5d8bfd(_0x1d61a4);})[_0x7f41('0xe')](function(_0x393bba){logger[_0x7f41('0xa')]('CreateMemberReport',_0x393bba[_0x7f41('0xc')],_0x151272);_0x5f4224(_0x5df9a3[_0x7f41('0xa')](0x1f4,_0x393bba[_0x7f41('0xc')]));});});};exports[_0x7f41('0x1c')]=function(_0x1a1445){var _0x354be6=this;return new Promise(function(_0x303f1a,_0x450409){return db['MemberReport'][_0x7f41('0x1d')](_0x1a1445[_0x7f41('0x1b')],{'raw':_0x1a1445[_0x7f41('0x12')]?_0x1a1445[_0x7f41('0x12')][_0x7f41('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a1445[_0x7f41('0x12')]?_0x1a1445[_0x7f41('0x12')][_0x7f41('0x14')]||null:null,'attributes':_0x1a1445[_0x7f41('0x12')]?_0x1a1445[_0x7f41('0x12')][_0x7f41('0x15')]||null:null,'limit':_0x1a1445[_0x7f41('0x12')]?_0x1a1445['options'][_0x7f41('0x1e')]||null:null})[_0x7f41('0x6')](function(_0x4be50a){logger[_0x7f41('0x7')]('UpdateMemberReport',_0x1a1445);logger[_0x7f41('0x1f')](_0x7f41('0x1c'),_0x1a1445,JSON[_0x7f41('0x20')](_0x4be50a));_0x303f1a(_0x4be50a);})['catch'](function(_0x122380){logger[_0x7f41('0xa')]('UpdateMemberReport',_0x122380['message'],_0x1a1445);_0x450409(_0x354be6[_0x7f41('0xa')](0x1f4,_0x122380[_0x7f41('0xc')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index b954c19..0c024a9 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 _0x88ff=['express','Router','../../components/auth/service','get','index','exports','multer','util','path','connect-timeout'];(function(_0x1a8f38,_0x1f2b38){var _0x5ba348=function(_0x43bbcb){while(--_0x43bbcb){_0x1a8f38['push'](_0x1a8f38['shift']());}};_0x5ba348(++_0x1f2b38);}(_0x88ff,0x196));var _0xf88f=function(_0x261f0a,_0x127810){_0x261f0a=_0x261f0a-0x0;var _0x3a9b6e=_0x88ff[_0x261f0a];return _0x3a9b6e;};'use strict';var multer=require(_0xf88f('0x0'));var util=require(_0xf88f('0x1'));var path=require(_0xf88f('0x2'));var timeout=require(_0xf88f('0x3'));var express=require(_0xf88f('0x4'));var router=express[_0xf88f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf88f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./migration.controller');router[_0xf88f('0x7')]('/',controller[_0xf88f('0x8')]);module[_0xf88f('0x9')]=router; \ No newline at end of file +var _0x3cd2=['fs-extra','../../components/auth/service','../../config/environment','./migration.controller','index','multer','express','Router'];(function(_0x5b1c84,_0x112f31){var _0x4b90a0=function(_0x113bcd){while(--_0x113bcd){_0x5b1c84['push'](_0x5b1c84['shift']());}};_0x4b90a0(++_0x112f31);}(_0x3cd2,0x115));var _0x23cd=function(_0x15bc7e,_0x2c3e08){_0x15bc7e=_0x15bc7e-0x0;var _0x1a9642=_0x3cd2[_0x15bc7e];return _0x1a9642;};'use strict';var multer=require(_0x23cd('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x23cd('0x1'));var router=express[_0x23cd('0x2')]();var fs_extra=require(_0x23cd('0x3'));var auth=require(_0x23cd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x23cd('0x5'));var controller=require(_0x23cd('0x6'));router['get']('/',controller[_0x23cd('0x7')]);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 6351846..2d0efd1 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 _0x3b5b=['version','exports'];(function(_0x47c9e0,_0x26a84d){var _0x1d8a6a=function(_0x25e6f9){while(--_0x25e6f9){_0x47c9e0['push'](_0x47c9e0['shift']());}};_0x1d8a6a(++_0x26a84d);}(_0x3b5b,0x1c3));var _0xb3b5=function(_0x198d2a,_0x510eb7){_0x198d2a=_0x198d2a-0x0;var _0xfda34d=_0x3b5b[_0x198d2a];return _0xfda34d;};'use strict';var Sequelize=require('sequelize');module[_0xb3b5('0x0')]={'version':{'type':Sequelize['STRING'],'unique':_0xb3b5('0x1')}}; \ No newline at end of file +var _0x4408=['STRING','version','sequelize','exports'];(function(_0x17da98,_0x66755){var _0x1a4acd=function(_0x4f34fd){while(--_0x4f34fd){_0x17da98['push'](_0x17da98['shift']());}};_0x1a4acd(++_0x66755);}(_0x4408,0x66));var _0x8440=function(_0x54f013,_0x4ddea3){_0x54f013=_0x54f013-0x0;var _0x3686a3=_0x4408[_0x54f013];return _0x3686a3;};'use strict';var Sequelize=require(_0x8440('0x0'));module[_0x8440('0x1')]={'version':{'type':Sequelize[_0x8440('0x2')],'unique':_0x8440('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 9bf1e6c..2f93b32 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 _0x7409=['stack','name','index','map','Migration','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','reject','save','update','then','error'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x7409,0x1b6));var _0x9740=function(_0x28b440,_0x1b2b23){_0x28b440=_0x28b440-0x0;var _0x271fdd=_0x7409[_0x28b440];return _0x271fdd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9740('0x0'));var zipdir=require(_0x9740('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9740('0x2'));var moment=require('moment');var BPromise=require(_0x9740('0x3'));var Mustache=require(_0x9740('0x4'));var util=require('util');var path=require(_0x9740('0x5'));var sox=require(_0x9740('0x6'));var csv=require(_0x9740('0x7'));var ejs=require(_0x9740('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9740('0x9'));var squel=require(_0x9740('0xa'));var crypto=require(_0x9740('0xb'));var jsforce=require(_0x9740('0xc'));var deskjs=require(_0x9740('0xd'));var toCsv=require(_0x9740('0x7'));var querystring=require(_0x9740('0xe'));var Papa=require(_0x9740('0xf'));var Redis=require('ioredis');var authService=require(_0x9740('0x10'));var qs=require(_0x9740('0x11'));var as=require(_0x9740('0x12'));var hardwareService=require(_0x9740('0x13'));var logger=require(_0x9740('0x14'))(_0x9740('0x15'));var utils=require(_0x9740('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9740('0x17'));var db=require(_0x9740('0x18'))['db'];function respondWithStatusCode(_0x4ae190,_0x399d67){_0x399d67=_0x399d67||0xcc;return function(_0x3d343e){if(_0x3d343e){return _0x4ae190[_0x9740('0x19')](_0x399d67);}return _0x4ae190[_0x9740('0x1a')](_0x399d67)[_0x9740('0x1b')]();};}function respondWithResult(_0x2d5661,_0x42a83b){_0x42a83b=_0x42a83b||0xc8;return function(_0x458cf4){if(_0x458cf4){return _0x2d5661[_0x9740('0x1a')](_0x42a83b)[_0x9740('0x1c')](_0x458cf4);}};}function respondWithFilteredResult(_0x5d5057,_0x84da18){return function(_0x27c319){if(_0x27c319){var _0x241305=typeof _0x84da18[_0x9740('0x1d')]===_0x9740('0x1e')&&typeof _0x84da18[_0x9740('0x1f')]===_0x9740('0x1e');var _0x2dc397=_0x27c319['count'];var _0x5705cb=_0x241305?0x0:_0x84da18[_0x9740('0x1d')];var _0x4f4f93=_0x241305?_0x27c319['count']:_0x84da18[_0x9740('0x1d')]+_0x84da18[_0x9740('0x1f')];var _0x3ea89e;if(_0x4f4f93>=_0x2dc397){_0x4f4f93=_0x2dc397;_0x3ea89e=0xc8;}else{_0x3ea89e=0xce;}_0x5d5057[_0x9740('0x1a')](_0x3ea89e);return _0x5d5057['set'](_0x9740('0x20'),_0x5705cb+'-'+_0x4f4f93+'/'+_0x2dc397)['json'](_0x27c319);}return null;};}function patchUpdates(_0x98f43f){return function(_0x38c5d9){try{jsonpatch['apply'](_0x38c5d9,_0x98f43f,!![]);}catch(_0x4c7fa4){return BPromise[_0x9740('0x21')](_0x4c7fa4);}return _0x38c5d9[_0x9740('0x22')]();};}function saveUpdates(_0x515c6f,_0x3d1354){return function(_0x1f2eb5){if(_0x1f2eb5){return _0x1f2eb5[_0x9740('0x23')](_0x515c6f)[_0x9740('0x24')](function(_0x155b58){return _0x155b58;});}return null;};}function removeEntity(_0x370aff,_0x19b386){return function(_0x92cd53){if(_0x92cd53){return _0x92cd53['destroy']()['then'](function(){_0x370aff[_0x9740('0x1a')](0xcc)[_0x9740('0x1b')]();});}};}function handleEntityNotFound(_0x304be7,_0x7216f6){return function(_0x1148b6){if(!_0x1148b6){_0x304be7[_0x9740('0x19')](0x194);}return _0x1148b6;};}function handleError(_0x476913,_0x1eaef1){_0x1eaef1=_0x1eaef1||0x1f4;return function(_0x3e6605){logger[_0x9740('0x25')](_0x3e6605[_0x9740('0x26')]);if(_0x3e6605[_0x9740('0x27')]){delete _0x3e6605[_0x9740('0x27')];}_0x476913[_0x9740('0x1a')](_0x1eaef1)['send'](_0x3e6605);};}exports[_0x9740('0x28')]=function(_0x284eb1,_0x44458b){var _0x20caf2={},_0x3e774a={},_0x5cc439={'count':0x0,'rows':[]};var _0x2db0ec=_[_0x9740('0x29')](db[_0x9740('0x2a')][_0x9740('0x2b')],function(_0x25203c){return{'name':_0x25203c['fieldName'],'type':_0x25203c[_0x9740('0x2c')][_0x9740('0x2d')]};});_0x3e774a['model']=_[_0x9740('0x29')](_0x2db0ec,_0x9740('0x27'));_0x3e774a[_0x9740('0x2e')]=_[_0x9740('0x2f')](_0x284eb1[_0x9740('0x2e')]);_0x3e774a[_0x9740('0x30')]=_['intersection'](_0x3e774a[_0x9740('0x31')],_0x3e774a['query']);_0x20caf2[_0x9740('0x32')]=_[_0x9740('0x33')](_0x3e774a[_0x9740('0x31')],qs[_0x9740('0x34')](_0x284eb1[_0x9740('0x2e')][_0x9740('0x34')]));_0x20caf2[_0x9740('0x32')]=_0x20caf2[_0x9740('0x32')]['length']?_0x20caf2[_0x9740('0x32')]:_0x3e774a[_0x9740('0x31')];if(!_0x284eb1[_0x9740('0x2e')][_0x9740('0x35')](_0x9740('0x36'))){_0x20caf2['limit']=qs[_0x9740('0x1f')](_0x284eb1[_0x9740('0x2e')][_0x9740('0x1f')]);_0x20caf2[_0x9740('0x1d')]=qs[_0x9740('0x1d')](_0x284eb1[_0x9740('0x2e')][_0x9740('0x1d')]);}_0x20caf2['order']=qs[_0x9740('0x37')](_0x284eb1[_0x9740('0x2e')][_0x9740('0x37')]);_0x20caf2['where']=qs[_0x9740('0x30')](_[_0x9740('0x38')](_0x284eb1[_0x9740('0x2e')],_0x3e774a[_0x9740('0x30')]),_0x2db0ec);if(_0x284eb1['query'][_0x9740('0x39')]){_0x20caf2[_0x9740('0x3a')]=_['merge'](_0x20caf2[_0x9740('0x3a')],{'$or':_[_0x9740('0x29')](_0x2db0ec,function(_0xe06797){if(_0xe06797['type']!==_0x9740('0x3b')){var _0x1f8de0={};_0x1f8de0[_0xe06797[_0x9740('0x27')]]={'$like':'%'+_0x284eb1[_0x9740('0x2e')]['filter']+'%'};return _0x1f8de0;}})});}_0x20caf2=_[_0x9740('0x3c')]({},_0x20caf2,_0x284eb1[_0x9740('0x3d')]);var _0x342e11={'where':_0x20caf2[_0x9740('0x3a')]};return db['Migration'][_0x9740('0x3e')](_0x342e11)[_0x9740('0x24')](function(_0x4e9e52){_0x5cc439[_0x9740('0x3e')]=_0x4e9e52;if(_0x284eb1[_0x9740('0x2e')][_0x9740('0x3f')]){_0x20caf2[_0x9740('0x40')]=[{'all':!![]}];}return db['Migration'][_0x9740('0x41')](_0x20caf2);})[_0x9740('0x24')](function(_0x2190a2){_0x5cc439[_0x9740('0x42')]=_0x2190a2;return _0x5cc439;})[_0x9740('0x24')](respondWithFilteredResult(_0x44458b,_0x20caf2))[_0x9740('0x43')](handleError(_0x44458b,null));}; \ No newline at end of file +var _0x5f75=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','map','Migration','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','findAll','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce'];(function(_0x272e18,_0x75e43c){var _0x572ca9=function(_0xf2b51a){while(--_0xf2b51a){_0x272e18['push'](_0x272e18['shift']());}};_0x572ca9(++_0x75e43c);}(_0x5f75,0x190));var _0x55f7=function(_0x5e86db,_0xd4d2ec){_0x5e86db=_0x5e86db-0x0;var _0x1e3e17=_0x5f75[_0x5e86db];return _0x1e3e17;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x55f7('0x0'));var zipdir=require(_0x55f7('0x1'));var jsonpatch=require(_0x55f7('0x2'));var rp=require(_0x55f7('0x3'));var moment=require(_0x55f7('0x4'));var BPromise=require(_0x55f7('0x5'));var Mustache=require(_0x55f7('0x6'));var util=require(_0x55f7('0x7'));var path=require('path');var sox=require(_0x55f7('0x8'));var csv=require(_0x55f7('0x9'));var ejs=require(_0x55f7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x55f7('0xb'));var squel=require('squel');var crypto=require(_0x55f7('0xc'));var jsforce=require(_0x55f7('0xd'));var deskjs=require(_0x55f7('0xe'));var toCsv=require(_0x55f7('0x9'));var querystring=require('querystring');var Papa=require(_0x55f7('0xf'));var Redis=require(_0x55f7('0x10'));var authService=require(_0x55f7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x55f7('0x12'));var hardwareService=require(_0x55f7('0x13'));var logger=require(_0x55f7('0x14'))(_0x55f7('0x15'));var utils=require('../../config/utils');var config=require(_0x55f7('0x16'));var licenseUtil=require(_0x55f7('0x17'));var db=require(_0x55f7('0x18'))['db'];function respondWithStatusCode(_0x28cd7b,_0x4d776e){_0x4d776e=_0x4d776e||0xcc;return function(_0x465f1d){if(_0x465f1d){return _0x28cd7b['sendStatus'](_0x4d776e);}return _0x28cd7b[_0x55f7('0x19')](_0x4d776e)[_0x55f7('0x1a')]();};}function respondWithResult(_0xd417e0,_0x44368e){_0x44368e=_0x44368e||0xc8;return function(_0x23b088){if(_0x23b088){return _0xd417e0[_0x55f7('0x19')](_0x44368e)[_0x55f7('0x1b')](_0x23b088);}};}function respondWithFilteredResult(_0x28e6fa,_0x27e7b3){return function(_0x1e163b){if(_0x1e163b){var _0x371083=typeof _0x27e7b3[_0x55f7('0x1c')]===_0x55f7('0x1d')&&typeof _0x27e7b3['limit']===_0x55f7('0x1d');var _0x4eb0e3=_0x1e163b['count'];var _0x5c6932=_0x371083?0x0:_0x27e7b3[_0x55f7('0x1c')];var _0x56427e=_0x371083?_0x1e163b['count']:_0x27e7b3[_0x55f7('0x1c')]+_0x27e7b3[_0x55f7('0x1e')];var _0x4eb626;if(_0x56427e>=_0x4eb0e3){_0x56427e=_0x4eb0e3;_0x4eb626=0xc8;}else{_0x4eb626=0xce;}_0x28e6fa['status'](_0x4eb626);return _0x28e6fa[_0x55f7('0x1f')]('Content-Range',_0x5c6932+'-'+_0x56427e+'/'+_0x4eb0e3)[_0x55f7('0x1b')](_0x1e163b);}return null;};}function patchUpdates(_0x4e5c98){return function(_0x465c0b){try{jsonpatch[_0x55f7('0x20')](_0x465c0b,_0x4e5c98,!![]);}catch(_0x3bba36){return BPromise[_0x55f7('0x21')](_0x3bba36);}return _0x465c0b[_0x55f7('0x22')]();};}function saveUpdates(_0x2f0b0d,_0x439d90){return function(_0x11356a){if(_0x11356a){return _0x11356a['update'](_0x2f0b0d)['then'](function(_0xde3bf1){return _0xde3bf1;});}return null;};}function removeEntity(_0x1c1c98,_0x35034c){return function(_0x4bcb06){if(_0x4bcb06){return _0x4bcb06[_0x55f7('0x23')]()[_0x55f7('0x24')](function(){_0x1c1c98['status'](0xcc)[_0x55f7('0x1a')]();});}};}function handleEntityNotFound(_0x3021da,_0x2686ae){return function(_0x19c264){if(!_0x19c264){_0x3021da[_0x55f7('0x25')](0x194);}return _0x19c264;};}function handleError(_0x3b5c64,_0x20e821){_0x20e821=_0x20e821||0x1f4;return function(_0x3931b5){logger[_0x55f7('0x26')](_0x3931b5[_0x55f7('0x27')]);if(_0x3931b5[_0x55f7('0x28')]){delete _0x3931b5[_0x55f7('0x28')];}_0x3b5c64[_0x55f7('0x19')](_0x20e821)[_0x55f7('0x29')](_0x3931b5);};}exports['index']=function(_0x5184b9,_0x393d59){var _0x2d55cf={},_0x340558={},_0x20023e={'count':0x0,'rows':[]};var _0x5e90d3=_[_0x55f7('0x2a')](db[_0x55f7('0x2b')][_0x55f7('0x2c')],function(_0x536169){return{'name':_0x536169[_0x55f7('0x2d')],'type':_0x536169[_0x55f7('0x2e')][_0x55f7('0x2f')]};});_0x340558[_0x55f7('0x30')]=_[_0x55f7('0x2a')](_0x5e90d3,_0x55f7('0x28'));_0x340558['query']=_['keys'](_0x5184b9[_0x55f7('0x31')]);_0x340558[_0x55f7('0x32')]=_['intersection'](_0x340558[_0x55f7('0x30')],_0x340558[_0x55f7('0x31')]);_0x2d55cf[_0x55f7('0x33')]=_[_0x55f7('0x34')](_0x340558[_0x55f7('0x30')],qs[_0x55f7('0x35')](_0x5184b9[_0x55f7('0x31')][_0x55f7('0x35')]));_0x2d55cf[_0x55f7('0x33')]=_0x2d55cf['attributes'][_0x55f7('0x36')]?_0x2d55cf[_0x55f7('0x33')]:_0x340558[_0x55f7('0x30')];if(!_0x5184b9[_0x55f7('0x31')][_0x55f7('0x37')](_0x55f7('0x38'))){_0x2d55cf[_0x55f7('0x1e')]=qs['limit'](_0x5184b9[_0x55f7('0x31')][_0x55f7('0x1e')]);_0x2d55cf[_0x55f7('0x1c')]=qs[_0x55f7('0x1c')](_0x5184b9[_0x55f7('0x31')][_0x55f7('0x1c')]);}_0x2d55cf[_0x55f7('0x39')]=qs['sort'](_0x5184b9['query'][_0x55f7('0x3a')]);_0x2d55cf[_0x55f7('0x3b')]=qs[_0x55f7('0x32')](_[_0x55f7('0x3c')](_0x5184b9[_0x55f7('0x31')],_0x340558[_0x55f7('0x32')]),_0x5e90d3);if(_0x5184b9[_0x55f7('0x31')][_0x55f7('0x3d')]){_0x2d55cf[_0x55f7('0x3b')]=_['merge'](_0x2d55cf[_0x55f7('0x3b')],{'$or':_['map'](_0x5e90d3,function(_0xf3700b){if(_0xf3700b[_0x55f7('0x2e')]!==_0x55f7('0x3e')){var _0x378876={};_0x378876[_0xf3700b[_0x55f7('0x28')]]={'$like':'%'+_0x5184b9['query'][_0x55f7('0x3d')]+'%'};return _0x378876;}})});}_0x2d55cf=_[_0x55f7('0x3f')]({},_0x2d55cf,_0x5184b9[_0x55f7('0x40')]);var _0x15d7a0={'where':_0x2d55cf['where']};return db[_0x55f7('0x2b')][_0x55f7('0x41')](_0x15d7a0)[_0x55f7('0x24')](function(_0x114c0c){_0x20023e[_0x55f7('0x41')]=_0x114c0c;if(_0x5184b9[_0x55f7('0x31')][_0x55f7('0x42')]){_0x2d55cf['include']=[{'all':!![]}];}return db['Migration'][_0x55f7('0x43')](_0x2d55cf);})[_0x55f7('0x24')](function(_0x40c1ba){_0x20023e['rows']=_0x40c1ba;return _0x20023e;})[_0x55f7('0x24')](respondWithFilteredResult(_0x393d59,_0x2d55cf))[_0x55f7('0x44')](handleError(_0x393d59,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 08748ea..93cfbdd 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 _0x8f54=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','exports','define','Migration'];(function(_0x1e1c76,_0x5eee1d){var _0x4d6fba=function(_0x242d13){while(--_0x242d13){_0x1e1c76['push'](_0x1e1c76['shift']());}};_0x4d6fba(++_0x5eee1d);}(_0x8f54,0xbe));var _0x48f5=function(_0x1966f7,_0x332517){_0x1966f7=_0x1966f7-0x0;var _0x4300cf=_0x8f54[_0x1966f7];return _0x4300cf;};'use strict';var _=require(_0x48f5('0x0'));var util=require(_0x48f5('0x1'));var logger=require(_0x48f5('0x2'))(_0x48f5('0x3'));var moment=require(_0x48f5('0x4'));var BPromise=require(_0x48f5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x48f5('0x6'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0x48f5('0x7')]=function(_0x253944,_0x182276){return _0x253944[_0x48f5('0x8')](_0x48f5('0x9'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaab4=['request-promise','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x57a0e3,_0x2bb951){var _0x14b30f=function(_0x484967){while(--_0x484967){_0x57a0e3['push'](_0x57a0e3['shift']());}};_0x14b30f(++_0x2bb951);}(_0xaab4,0xbe));var _0x4aab=function(_0x412f88,_0x57dff6){_0x412f88=_0x412f88-0x0;var _0x58fa87=_0xaab4[_0x412f88];return _0x58fa87;};'use strict';var _=require(_0x4aab('0x0'));var util=require(_0x4aab('0x1'));var logger=require(_0x4aab('0x2'))('api');var moment=require(_0x4aab('0x3'));var BPromise=require(_0x4aab('0x4'));var rp=require(_0x4aab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4aab('0x6'));var config=require(_0x4aab('0x7'));var attributes=require(_0x4aab('0x8'));module[_0x4aab('0x9')]=function(_0x18368c,_0x39157d){return _0x18368c[_0x4aab('0xa')](_0x4aab('0xb'),attributes,{'tableName':_0x4aab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index cb0ff4b..7d3c518 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 _0xde56=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1ca6b9,_0x341300){var _0x364fdc=function(_0x2499e3){while(--_0x2499e3){_0x1ca6b9['push'](_0x1ca6b9['shift']());}};_0x364fdc(++_0x341300);}(_0xde56,0x144));var _0x6de5=function(_0x1139d0,_0x41e5f8){_0x1139d0=_0x1139d0-0x0;var _0xcc01a6=_0xde56[_0x1139d0];return _0xcc01a6;};'use strict';var _=require(_0x6de5('0x0'));var util=require('util');var moment=require(_0x6de5('0x1'));var BPromise=require(_0x6de5('0x2'));var rs=require(_0x6de5('0x3'));var fs=require('fs');var Redis=require(_0x6de5('0x4'));var db=require(_0x6de5('0x5'))['db'];var utils=require(_0x6de5('0x6'));var logger=require(_0x6de5('0x7'))(_0x6de5('0x8'));var config=require(_0x6de5('0x9'));var jayson=require(_0x6de5('0xa'));var client=jayson['client'][_0x6de5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x141d65,_0x27dcfe,_0x1f8236){return new BPromise(function(_0x1cd11e,_0x3f1400){return client['request'](_0x141d65,_0x1f8236)['then'](function(_0x1769af){logger[_0x6de5('0xc')](_0x6de5('0xd'),_0x27dcfe,_0x6de5('0xe'));logger['debug'](_0x6de5('0xf'),_0x27dcfe,_0x6de5('0xe'),JSON[_0x6de5('0x10')](_0x1769af));if(_0x1769af[_0x6de5('0x11')]){if(_0x1769af['error'][_0x6de5('0x12')]===0x1f4){logger[_0x6de5('0x11')]('Migration,\x20%s,\x20%s',_0x27dcfe,_0x1769af[_0x6de5('0x11')][_0x6de5('0x13')]);return _0x3f1400(_0x1769af[_0x6de5('0x11')][_0x6de5('0x13')]);}logger['error'](_0x6de5('0xd'),_0x27dcfe,_0x1769af[_0x6de5('0x11')][_0x6de5('0x13')]);return _0x1cd11e(_0x1769af[_0x6de5('0x11')]['message']);}else{logger[_0x6de5('0xc')](_0x6de5('0xd'),_0x27dcfe,_0x6de5('0xe'));_0x1cd11e(_0x1769af[_0x6de5('0x14')]['message']);}})[_0x6de5('0x15')](function(_0x2316a6){logger[_0x6de5('0x11')](_0x6de5('0xd'),_0x27dcfe,_0x2316a6);_0x3f1400(_0x2316a6);});});} \ No newline at end of file +var _0x833b=['request','then','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x56d4cf,_0x5267e6){var _0x36ddfb=function(_0x52b11a){while(--_0x52b11a){_0x56d4cf['push'](_0x56d4cf['shift']());}};_0x36ddfb(++_0x5267e6);}(_0x833b,0x131));var _0xb833=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x833b[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0xb833('0x0'));var moment=require('moment');var BPromise=require(_0xb833('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb833('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb833('0x3'));var logger=require(_0xb833('0x4'))(_0xb833('0x5'));var config=require(_0xb833('0x6'));var jayson=require(_0xb833('0x7'));var client=jayson[_0xb833('0x8')][_0xb833('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4eaff4,_0x3afa71,_0xb60891){return new BPromise(function(_0x3922f5,_0x2525aa){return client[_0xb833('0xa')](_0x4eaff4,_0xb60891)[_0xb833('0xb')](function(_0x26cbf6){logger['info'](_0xb833('0xc'),_0x3afa71,'request\x20sent');logger[_0xb833('0xd')](_0xb833('0xe'),_0x3afa71,_0xb833('0xf'),JSON[_0xb833('0x10')](_0x26cbf6));if(_0x26cbf6['error']){if(_0x26cbf6['error'][_0xb833('0x11')]===0x1f4){logger[_0xb833('0x12')]('Migration,\x20%s,\x20%s',_0x3afa71,_0x26cbf6[_0xb833('0x12')]['message']);return _0x2525aa(_0x26cbf6[_0xb833('0x12')][_0xb833('0x13')]);}logger[_0xb833('0x12')](_0xb833('0xc'),_0x3afa71,_0x26cbf6[_0xb833('0x12')][_0xb833('0x13')]);return _0x3922f5(_0x26cbf6[_0xb833('0x12')][_0xb833('0x13')]);}else{logger['info'](_0xb833('0xc'),_0x3afa71,_0xb833('0xf'));_0x3922f5(_0x26cbf6['result']['message']);}})[_0xb833('0x14')](function(_0x59d65f){logger[_0xb833('0x12')](_0xb833('0xc'),_0x3afa71,_0x59d65f);_0x2525aa(_0x59d65f);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 446e309..073048d 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 _0xee2c=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xee2c,0x1c7));var _0xcee2=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xee2c[_0x4a53d];return _0x27410e;};'use strict';var multer=require(_0xcee2('0x0'));var util=require('util');var path=require(_0xcee2('0x1'));var timeout=require(_0xcee2('0x2'));var express=require(_0xcee2('0x3'));var router=express[_0xcee2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcee2('0x5'));var config=require(_0xcee2('0x6'));var controller=require('./network.controller');router[_0xcee2('0x7')]('/',auth[_0xcee2('0x8')](),controller[_0xcee2('0x9')]);router[_0xcee2('0x7')](_0xcee2('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xcee2('0xb')]('/',auth[_0xcee2('0x8')](),controller[_0xcee2('0xc')]);router[_0xcee2('0xd')](_0xcee2('0xa'),auth[_0xcee2('0x8')](),controller[_0xcee2('0xe')]);router[_0xcee2('0xf')]('/:id',auth[_0xcee2('0x8')](),controller[_0xcee2('0x10')]);module[_0xcee2('0x11')]=router; \ No newline at end of file +var _0xd0c9=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','post','put','update','delete'];(function(_0x55adfc,_0x5b0c06){var _0x4a92cb=function(_0x201aae){while(--_0x201aae){_0x55adfc['push'](_0x55adfc['shift']());}};_0x4a92cb(++_0x5b0c06);}(_0xd0c9,0xe2));var _0x9d0c=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xd0c9[_0x1deb03];return _0x189fe7;};'use strict';var multer=require(_0x9d0c('0x0'));var util=require(_0x9d0c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9d0c('0x2')]();var fs_extra=require(_0x9d0c('0x3'));var auth=require(_0x9d0c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9d0c('0x5'));var controller=require('./network.controller');router['get']('/',auth[_0x9d0c('0x6')](),controller['index']);router[_0x9d0c('0x7')](_0x9d0c('0x8'),auth[_0x9d0c('0x6')](),controller[_0x9d0c('0x9')]);router[_0x9d0c('0xa')]('/',auth[_0x9d0c('0x6')](),controller['create']);router[_0x9d0c('0xb')]('/:id',auth[_0x9d0c('0x6')](),controller[_0x9d0c('0xc')]);router[_0x9d0c('0xd')]('/:id',auth[_0x9d0c('0x6')](),controller[_0x9d0c('0xe')]);module[_0x9d0c('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 549fd36..8a8c096 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 _0x35ad=['turn','STRING','sequelize','ENUM','localnet','externip'];(function(_0x10fd68,_0x56dd62){var _0x3b2181=function(_0x1db7c7){while(--_0x1db7c7){_0x10fd68['push'](_0x10fd68['shift']());}};_0x3b2181(++_0x56dd62);}(_0x35ad,0x158));var _0xd35a=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x35ad[_0x263a74];return _0x2aa86c;};'use strict';var Sequelize=require(_0xd35a('0x0'));module['exports']={'type':{'type':Sequelize[_0xd35a('0x1')](_0xd35a('0x2'),_0xd35a('0x3'),'stun',_0xd35a('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xd35a('0x5')]}}; \ No newline at end of file +var _0xa2da=['exports','ENUM','externip','turn','STRING'];(function(_0x3c7e90,_0x47559f){var _0x2cafa6=function(_0x4dd01a){while(--_0x4dd01a){_0x3c7e90['push'](_0x3c7e90['shift']());}};_0x2cafa6(++_0x47559f);}(_0xa2da,0x131));var _0xaa2d=function(_0x316904,_0x1e8b77){_0x316904=_0x316904-0x0;var _0xfa9a21=_0xa2da[_0x316904];return _0xfa9a21;};'use strict';var Sequelize=require('sequelize');module[_0xaa2d('0x0')]={'type':{'type':Sequelize[_0xaa2d('0x1')]('localnet',_0xaa2d('0x2'),'stun',_0xaa2d('0x3'))},'value':{'type':Sequelize[_0xaa2d('0x4')]},'username':{'type':Sequelize[_0xaa2d('0x4')]},'password':{'type':Sequelize[_0xaa2d('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 01b8bc4..d89c7ce 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 _0xde7d=['/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','TURN','server/files/templates/network.ejs','util','path','ejs','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','client','http','request','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','offset','limit','undefined','count','set','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','Network','includeAll','include','findAll','rows','show','params','length','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','server/files/templates/turn_multiple.ejs'];(function(_0x1156bb,_0x10229f){var _0xdf4f11=function(_0x328802){while(--_0x328802){_0x1156bb['push'](_0x1156bb['shift']());}};_0xdf4f11(++_0x10229f);}(_0xde7d,0x15c));var _0xdde7=function(_0x389736,_0x6da2cc){_0x389736=_0x389736-0x0;var _0x18a470=_0xde7d[_0x389736];return _0x18a470;};'use strict';var util=require(_0xdde7('0x0'));var path=require(_0xdde7('0x1'));var ejs=require(_0xdde7('0x2'));var fs=require('fs');var _=require('lodash');var qs=require(_0xdde7('0x3'));var logger=require(_0xdde7('0x4'))('api');var config=require(_0xdde7('0x5'));var db=require(_0xdde7('0x6'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xdde7('0x7')][_0xdde7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c185b,_0x2fba97,_0x31d74c,_0x5d2d00){return new Promise(function(_0x23c92c,_0x4fa0de){var _0x393543=_0x5d2d00||client;return _0x393543[_0xdde7('0x9')](_0x3c185b,_0x31d74c)['then'](function(_0x4ab67e){logger['info'](_0xdde7('0xa'),_0x2fba97,_0xdde7('0xb'));logger[_0xdde7('0xc')](_0xdde7('0xd'),_0x2fba97,'request\x20sent',JSON[_0xdde7('0xe')](_0x4ab67e));if(_0x4ab67e[_0xdde7('0xf')]){if(_0x4ab67e[_0xdde7('0xf')][_0xdde7('0x10')]===0x1f4){logger[_0xdde7('0xf')](_0xdde7('0xa'),_0x2fba97,_0x4ab67e['error']['message']);return _0x4fa0de(_0x4ab67e[_0xdde7('0xf')][_0xdde7('0x11')]);}logger[_0xdde7('0xf')](_0xdde7('0xa'),_0x2fba97,_0x4ab67e[_0xdde7('0xf')][_0xdde7('0x11')]);return _0x23c92c(_0x4ab67e[_0xdde7('0xf')]['message']);}else{logger['info']('Network,\x20%s,\x20%s',_0x2fba97,_0xdde7('0xb'));_0x23c92c(_0x4ab67e['result'][_0xdde7('0x11')]);}})[_0xdde7('0x12')](function(_0x4ff5f1){logger[_0xdde7('0xf')](_0xdde7('0xa'),_0x2fba97,_0x4ff5f1);_0x4fa0de(_0x4ff5f1);});});}function respondWithResult(_0x205094,_0x150ca3){_0x150ca3=_0x150ca3||0xc8;return function(_0x5a41ca){if(_0x5a41ca){return _0x205094[_0xdde7('0x13')](_0x150ca3)[_0xdde7('0x14')](_0x5a41ca);}};}function respondWithFilteredResult(_0x74772b,_0x518753){return function(_0x3346aa){if(_0x3346aa){var _0xcc971f=typeof _0x518753[_0xdde7('0x15')]==='undefined'&&typeof _0x518753[_0xdde7('0x16')]===_0xdde7('0x17');var _0x3659c9=_0x3346aa['count'];var _0x36d7e8=_0xcc971f?0x0:_0x518753['offset'];var _0x11aaec=_0xcc971f?_0x3346aa[_0xdde7('0x18')]:_0x518753[_0xdde7('0x15')]+_0x518753[_0xdde7('0x16')];var _0x426152;if(_0x11aaec>=_0x3659c9){_0x11aaec=_0x3659c9;_0x426152=0xc8;}else{_0x426152=0xce;}_0x74772b[_0xdde7('0x13')](_0x426152);return _0x74772b[_0xdde7('0x19')]('Content-Range',_0x36d7e8+'-'+_0x11aaec+'/'+_0x3659c9)[_0xdde7('0x14')](_0x3346aa);}return null;};}function saveUpdates(_0x236ee7){return function(_0x1f6ea2){if(_0x1f6ea2){return _0x1f6ea2[_0xdde7('0x1a')](_0x236ee7)[_0xdde7('0x1b')](function(_0x497bd5){return _0x497bd5;});}return null;};}function removeEntity(_0x31aabd){return function(_0x5675b7){if(_0x5675b7){return _0x5675b7[_0xdde7('0x1c')]()[_0xdde7('0x1b')](function(){_0x31aabd[_0xdde7('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b9094){return function(_0x2b3da2){if(!_0x2b3da2){_0x2b9094[_0xdde7('0x1d')](0x194);}return _0x2b3da2;};}function handleError(_0x1eae68,_0x699659){_0x699659=_0x699659||0x1f4;return function(_0x29250e){logger[_0xdde7('0xf')](_0x29250e[_0xdde7('0x1e')]);if(_0x29250e['name']){delete _0x29250e[_0xdde7('0x1f')];}_0x1eae68[_0xdde7('0x13')](_0x699659)[_0xdde7('0x20')](_0x29250e);};}exports[_0xdde7('0x21')]=function(_0x94564,_0x8f59e5){var _0x378b0f={},_0x22e613={},_0x2c60f2={'count':0x0,'rows':[]};var _0x5192ea=_[_0xdde7('0x22')](db['Network'][_0xdde7('0x23')],function(_0x5261d1){return{'name':_0x5261d1[_0xdde7('0x24')],'type':_0x5261d1[_0xdde7('0x25')][_0xdde7('0x26')]};});_0x22e613['model']=_['map'](_0x5192ea,_0xdde7('0x1f'));_0x22e613['query']=_[_0xdde7('0x27')](_0x94564[_0xdde7('0x28')]);_0x22e613[_0xdde7('0x29')]=_[_0xdde7('0x2a')](_0x22e613[_0xdde7('0x2b')],_0x22e613[_0xdde7('0x28')]);_0x378b0f[_0xdde7('0x2c')]=_['intersection'](_0x22e613[_0xdde7('0x2b')],qs[_0xdde7('0x2d')](_0x94564['query']['fields']));_0x378b0f[_0xdde7('0x2c')]=_0x378b0f[_0xdde7('0x2c')]['length']?_0x378b0f[_0xdde7('0x2c')]:_0x22e613[_0xdde7('0x2b')];if(!_0x94564['query']['hasOwnProperty'](_0xdde7('0x2e'))){_0x378b0f[_0xdde7('0x16')]=qs[_0xdde7('0x16')](_0x94564['query'][_0xdde7('0x16')]);_0x378b0f[_0xdde7('0x15')]=qs[_0xdde7('0x15')](_0x94564[_0xdde7('0x28')][_0xdde7('0x15')]);}_0x378b0f[_0xdde7('0x2f')]=qs['sort'](_0x94564[_0xdde7('0x28')][_0xdde7('0x30')]);_0x378b0f[_0xdde7('0x31')]=qs[_0xdde7('0x29')](_[_0xdde7('0x32')](_0x94564['query'],_0x22e613[_0xdde7('0x29')]),_0x5192ea);if(_0x94564[_0xdde7('0x28')][_0xdde7('0x33')]){_0x378b0f[_0xdde7('0x31')]=_[_0xdde7('0x34')](_0x378b0f[_0xdde7('0x31')],{'$or':_['map'](_0x5192ea,function(_0x24ebd7){if(_0x24ebd7[_0xdde7('0x25')]!=='VIRTUAL'){var _0x146674={};_0x146674[_0x24ebd7[_0xdde7('0x1f')]]={'$like':'%'+_0x94564[_0xdde7('0x28')][_0xdde7('0x33')]+'%'};return _0x146674;}})});}_0x378b0f=_['merge']({},_0x378b0f,_0x94564[_0xdde7('0x35')]);var _0x5a9d18={'where':_0x378b0f[_0xdde7('0x31')]};return db[_0xdde7('0x36')][_0xdde7('0x18')](_0x5a9d18)[_0xdde7('0x1b')](function(_0x1a5a6b){_0x2c60f2[_0xdde7('0x18')]=_0x1a5a6b;if(_0x94564['query'][_0xdde7('0x37')]){_0x378b0f[_0xdde7('0x38')]=[{'all':!![]}];}return db[_0xdde7('0x36')][_0xdde7('0x39')](_0x378b0f);})[_0xdde7('0x1b')](function(_0x4a1c03){_0x2c60f2[_0xdde7('0x3a')]=_0x4a1c03;return _0x2c60f2;})[_0xdde7('0x1b')](respondWithFilteredResult(_0x8f59e5,_0x378b0f))[_0xdde7('0x12')](handleError(_0x8f59e5,null));};exports[_0xdde7('0x3b')]=function(_0x7b6c4b,_0x407bf3){var _0x1ce6c6={'raw':!![],'where':{'id':_0x7b6c4b[_0xdde7('0x3c')]['id']}},_0x347a5b={};_0x347a5b[_0xdde7('0x2b')]=_[_0xdde7('0x27')](db[_0xdde7('0x36')][_0xdde7('0x23')]);_0x347a5b[_0xdde7('0x28')]=_[_0xdde7('0x27')](_0x7b6c4b[_0xdde7('0x28')]);_0x347a5b[_0xdde7('0x29')]=_[_0xdde7('0x2a')](_0x347a5b['model'],_0x347a5b[_0xdde7('0x28')]);_0x1ce6c6[_0xdde7('0x2c')]=_[_0xdde7('0x2a')](_0x347a5b[_0xdde7('0x2b')],qs[_0xdde7('0x2d')](_0x7b6c4b[_0xdde7('0x28')]['fields']));_0x1ce6c6[_0xdde7('0x2c')]=_0x1ce6c6[_0xdde7('0x2c')][_0xdde7('0x3d')]?_0x1ce6c6[_0xdde7('0x2c')]:_0x347a5b['model'];if(_0x7b6c4b[_0xdde7('0x28')][_0xdde7('0x37')]){_0x1ce6c6[_0xdde7('0x38')]=[{'all':!![]}];}_0x1ce6c6=_[_0xdde7('0x34')]({},_0x1ce6c6,_0x7b6c4b['options']);return db[_0xdde7('0x36')][_0xdde7('0x3e')](_0x1ce6c6)[_0xdde7('0x1b')](handleEntityNotFound(_0x407bf3,null))[_0xdde7('0x1b')](respondWithResult(_0x407bf3,null))[_0xdde7('0x12')](handleError(_0x407bf3,null));};exports[_0xdde7('0x3f')]=function(_0x72a36b,_0x2691ab){var _0x3845cd;return db['Network']['create'](_0x72a36b[_0xdde7('0x40')],{'raw':!![]})[_0xdde7('0x1b')](function(_0x1273fd){_0x3845cd=_0x1273fd;return db[_0xdde7('0x36')][_0xdde7('0x39')]({'where':{'type':_0x72a36b[_0xdde7('0x40')]['type']},'raw':!![]});})[_0xdde7('0x1b')](function(_0x4b30dd){if(_0x3845cd[_0xdde7('0x25')][_0xdde7('0x41')]()==_0xdde7('0x42')){var _0x48b321=fs[_0xdde7('0x43')](path[_0xdde7('0x44')](config[_0xdde7('0x45')],_0xdde7('0x46')),_0xdde7('0x47'));var _0x1e9e17=ejs[_0xdde7('0x48')](_0x48b321,{'networks':_0x4b30dd||[]});fs[_0xdde7('0x49')](_0xdde7('0x4a'),_0x1e9e17);return respondWithRpcPromise(_0xdde7('0x4b'),_0xdde7('0x3f'),{'module':'res_stun_monitor.so'});}else if(_0x3845cd[_0xdde7('0x25')][_0xdde7('0x41')]()=='TURN'){var _0x3e32c1=fs[_0xdde7('0x43')](path['join'](config[_0xdde7('0x45')],_0xdde7('0x4c')),_0xdde7('0x47'));var _0x269484=ejs[_0xdde7('0x48')](_0x3e32c1,{'networks':_0x4b30dd||[]});fs[_0xdde7('0x49')](_0xdde7('0x4d'),_0x269484);return respondWithRpcPromise(_0xdde7('0x4b'),_0xdde7('0x3f'),{'module':_0xdde7('0x4e')});}else{var _0xe4b8d9=fs['readFileSync'](path['join'](config['root'],'server/files/templates/network.ejs'),_0xdde7('0x47'));var _0x48abb6=ejs[_0xdde7('0x48')](_0xe4b8d9,{'networks':_0x4b30dd||[]});fs[_0xdde7('0x49')](util[_0xdde7('0x4f')](_0xdde7('0x50'),_0x72a36b['body'][_0xdde7('0x25')][_0xdde7('0x51')]()),_0x48abb6);return respondWithRpcPromise(_0xdde7('0x4b'),_0xdde7('0x3f'),{'module':_0xdde7('0x52')});}})[_0xdde7('0x1b')](function(){return _0x3845cd;})[_0xdde7('0x1b')](respondWithResult(_0x2691ab,0xc9))[_0xdde7('0x12')](handleError(_0x2691ab,null));};exports['update']=function(_0x2ef376,_0xf8dc){var _0x1b659d;return db[_0xdde7('0x36')][_0xdde7('0x3e')]({'where':{'id':_0x2ef376[_0xdde7('0x3c')]['id']}})[_0xdde7('0x1b')](handleEntityNotFound(_0xf8dc,null))[_0xdde7('0x1b')](saveUpdates(_0x2ef376[_0xdde7('0x40')],null))['then'](function(_0x75c017){if(_0x75c017){_0x1b659d=_0x75c017;return db[_0xdde7('0x36')][_0xdde7('0x39')]({'where':{'type':_0x1b659d[_0xdde7('0x25')]},'raw':!![]});}return null;})['then'](function(_0x4c7b8d){if(_0x1b659d['type'][_0xdde7('0x41')]()=='STUN'){var _0x169891=fs['readFileSync'](path[_0xdde7('0x44')](config[_0xdde7('0x45')],_0xdde7('0x46')),_0xdde7('0x47'));var _0x13141c=ejs['render'](_0x169891,{'networks':_0x4c7b8d||[]});fs[_0xdde7('0x49')](_0xdde7('0x4a'),_0x13141c);return respondWithRpcPromise('Reload',_0xdde7('0x1a'),{'module':_0xdde7('0x4e')});}else if(_0x1b659d[_0xdde7('0x25')][_0xdde7('0x41')]()==_0xdde7('0x53')){var _0x18a6eb=fs['readFileSync'](path[_0xdde7('0x44')](config[_0xdde7('0x45')],_0xdde7('0x4c')),_0xdde7('0x47'));var _0x1b206b=ejs[_0xdde7('0x48')](_0x18a6eb,{'networks':_0x4c7b8d||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x1b206b);return respondWithRpcPromise(_0xdde7('0x4b'),_0xdde7('0x1a'),{'module':'res_stun_monitor.so'});}else{var _0xdbfabc=fs['readFileSync'](path[_0xdde7('0x44')](config['root'],_0xdde7('0x54')),_0xdde7('0x47'));var _0x29f4c9=ejs[_0xdde7('0x48')](_0xdbfabc,{'networks':_0x4c7b8d||[]});fs['writeFileSync'](util[_0xdde7('0x4f')](_0xdde7('0x50'),_0x2ef376[_0xdde7('0x40')][_0xdde7('0x25')][_0xdde7('0x51')]()),_0x29f4c9);return respondWithRpcPromise('Reload',_0xdde7('0x1a'),{'module':_0xdde7('0x52')});}})['then'](function(_0x153254){if(_0x153254){return _0x1b659d;}return null;})[_0xdde7('0x1b')](respondWithResult(_0xf8dc,null))[_0xdde7('0x12')](handleError(_0xf8dc,null));};exports[_0xdde7('0x1c')]=function(_0x3ecc23,_0x40cfe1){var _0x334076;return db[_0xdde7('0x36')][_0xdde7('0x3e')]({'where':{'id':_0x3ecc23[_0xdde7('0x3c')]['id']}})[_0xdde7('0x1b')](function(_0x4784aa){_0x334076=_0x4784aa;return _0x4784aa;})[_0xdde7('0x1b')](handleEntityNotFound(_0x40cfe1,null))[_0xdde7('0x1b')](removeEntity(_0x40cfe1,null))[_0xdde7('0x1b')](function(){if(_0x334076){return db[_0xdde7('0x36')][_0xdde7('0x39')]({'where':{'type':_0x334076[_0xdde7('0x25')]},'raw':!![]});}})[_0xdde7('0x1b')](function(_0x537c33){if(_0x334076[_0xdde7('0x25')][_0xdde7('0x41')]()==_0xdde7('0x42')){var _0x587373=fs['readFileSync'](path[_0xdde7('0x44')](config[_0xdde7('0x45')],_0xdde7('0x46')),_0xdde7('0x47'));var _0x2a17c6=ejs[_0xdde7('0x48')](_0x587373,{'networks':_0x537c33||[]});fs['writeFileSync'](_0xdde7('0x4a'),_0x2a17c6);return respondWithRpcPromise(_0xdde7('0x4b'),_0xdde7('0x1c'),{'module':_0xdde7('0x4e')});}else if(_0x334076[_0xdde7('0x25')][_0xdde7('0x41')]()==_0xdde7('0x53')){var _0x58b579=fs[_0xdde7('0x43')](path['join'](config[_0xdde7('0x45')],'server/files/templates/turn_multiple.ejs'),_0xdde7('0x47'));var _0x3587b0=ejs[_0xdde7('0x48')](_0x58b579,{'networks':_0x537c33||[]});fs[_0xdde7('0x49')]('/etc/asterisk/turn_xcally.conf',_0x3587b0);return respondWithRpcPromise(_0xdde7('0x4b'),_0xdde7('0x1c'),{'module':'res_stun_monitor.so'});}else{var _0x3a3a05=fs[_0xdde7('0x43')](path[_0xdde7('0x44')](config['root'],_0xdde7('0x54')),_0xdde7('0x47'));var _0x5ea792=ejs['render'](_0x3a3a05,{'networks':_0x537c33||[]});fs[_0xdde7('0x49')](util['format'](_0xdde7('0x50'),_0x334076[_0xdde7('0x25')][_0xdde7('0x51')]()),_0x5ea792);return respondWithRpcPromise(_0xdde7('0x4b'),_0xdde7('0x1c'),{'module':'chan_sip.so'});}})[_0xdde7('0x12')](handleError(_0x40cfe1,null));}; \ No newline at end of file +var _0x8a59=['fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','map','merge','options','count','includeAll','Network','findAll','rows','catch','show','params','include','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','format','chan_sip.so','writeFileSync','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','server/files/templates/network.ejs','util','path','ejs','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','json','undefined','limit','set','Content-Range','update','destroy','end','stack','name','status','send','index','rawAttributes'];(function(_0x11f840,_0x2f7a23){var _0x3d0faa=function(_0x18b09e){while(--_0x18b09e){_0x11f840['push'](_0x11f840['shift']());}};_0x3d0faa(++_0x2f7a23);}(_0x8a59,0x8d));var _0x98a5=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x8a59[_0x5c351c];return _0x26f3b3;};'use strict';var util=require(_0x98a5('0x0'));var path=require(_0x98a5('0x1'));var ejs=require(_0x98a5('0x2'));var fs=require('fs');var _=require(_0x98a5('0x3'));var qs=require(_0x98a5('0x4'));var logger=require('../../config/logger')(_0x98a5('0x5'));var config=require(_0x98a5('0x6'));var db=require(_0x98a5('0x7'))['db'];var jayson=require(_0x98a5('0x8'));var client=jayson[_0x98a5('0x9')][_0x98a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2275ad,_0x18a1af,_0x237b7b,_0x4bcce2){return new Promise(function(_0x1cb562,_0x4195fe){var _0xfc146f=_0x4bcce2||client;return _0xfc146f[_0x98a5('0xb')](_0x2275ad,_0x237b7b)[_0x98a5('0xc')](function(_0xa70d9d){logger['info'](_0x98a5('0xd'),_0x18a1af,_0x98a5('0xe'));logger[_0x98a5('0xf')](_0x98a5('0x10'),_0x18a1af,_0x98a5('0xe'),JSON[_0x98a5('0x11')](_0xa70d9d));if(_0xa70d9d['error']){if(_0xa70d9d[_0x98a5('0x12')][_0x98a5('0x13')]===0x1f4){logger['error'](_0x98a5('0xd'),_0x18a1af,_0xa70d9d[_0x98a5('0x12')][_0x98a5('0x14')]);return _0x4195fe(_0xa70d9d['error'][_0x98a5('0x14')]);}logger[_0x98a5('0x12')](_0x98a5('0xd'),_0x18a1af,_0xa70d9d[_0x98a5('0x12')][_0x98a5('0x14')]);return _0x1cb562(_0xa70d9d['error'][_0x98a5('0x14')]);}else{logger['info'](_0x98a5('0xd'),_0x18a1af,_0x98a5('0xe'));_0x1cb562(_0xa70d9d['result'][_0x98a5('0x14')]);}})['catch'](function(_0x40044c){logger[_0x98a5('0x12')]('Network,\x20%s,\x20%s',_0x18a1af,_0x40044c);_0x4195fe(_0x40044c);});});}function respondWithResult(_0x451e41,_0x34ffce){_0x34ffce=_0x34ffce||0xc8;return function(_0x1b2303){if(_0x1b2303){return _0x451e41['status'](_0x34ffce)[_0x98a5('0x15')](_0x1b2303);}};}function respondWithFilteredResult(_0x5a4c28,_0x2621ae){return function(_0x5e33f0){if(_0x5e33f0){var _0x5e4f89=typeof _0x2621ae['offset']===_0x98a5('0x16')&&typeof _0x2621ae[_0x98a5('0x17')]===_0x98a5('0x16');var _0x50ea77=_0x5e33f0['count'];var _0x1e146b=_0x5e4f89?0x0:_0x2621ae['offset'];var _0x5201d0=_0x5e4f89?_0x5e33f0['count']:_0x2621ae['offset']+_0x2621ae[_0x98a5('0x17')];var _0x55618f;if(_0x5201d0>=_0x50ea77){_0x5201d0=_0x50ea77;_0x55618f=0xc8;}else{_0x55618f=0xce;}_0x5a4c28['status'](_0x55618f);return _0x5a4c28[_0x98a5('0x18')](_0x98a5('0x19'),_0x1e146b+'-'+_0x5201d0+'/'+_0x50ea77)['json'](_0x5e33f0);}return null;};}function saveUpdates(_0x5bf8f1){return function(_0x462a1a){if(_0x462a1a){return _0x462a1a[_0x98a5('0x1a')](_0x5bf8f1)['then'](function(_0x33a647){return _0x33a647;});}return null;};}function removeEntity(_0x2e34fa){return function(_0x566f4d){if(_0x566f4d){return _0x566f4d[_0x98a5('0x1b')]()[_0x98a5('0xc')](function(){_0x2e34fa['status'](0xcc)[_0x98a5('0x1c')]();});}};}function handleEntityNotFound(_0x33bda3){return function(_0x1754dc){if(!_0x1754dc){_0x33bda3['sendStatus'](0x194);}return _0x1754dc;};}function handleError(_0xeeacaf,_0x252e59){_0x252e59=_0x252e59||0x1f4;return function(_0x4891b2){logger[_0x98a5('0x12')](_0x4891b2[_0x98a5('0x1d')]);if(_0x4891b2[_0x98a5('0x1e')]){delete _0x4891b2[_0x98a5('0x1e')];}_0xeeacaf[_0x98a5('0x1f')](_0x252e59)[_0x98a5('0x20')](_0x4891b2);};}exports[_0x98a5('0x21')]=function(_0x73fb6,_0x2fd912){var _0x3b0198={},_0x3de86e={},_0x574241={'count':0x0,'rows':[]};var _0x1806be=_['map'](db['Network'][_0x98a5('0x22')],function(_0x2c52e3){return{'name':_0x2c52e3[_0x98a5('0x23')],'type':_0x2c52e3[_0x98a5('0x24')]['key']};});_0x3de86e[_0x98a5('0x25')]=_['map'](_0x1806be,_0x98a5('0x1e'));_0x3de86e[_0x98a5('0x26')]=_[_0x98a5('0x27')](_0x73fb6['query']);_0x3de86e[_0x98a5('0x28')]=_[_0x98a5('0x29')](_0x3de86e[_0x98a5('0x25')],_0x3de86e['query']);_0x3b0198['attributes']=_[_0x98a5('0x29')](_0x3de86e[_0x98a5('0x25')],qs[_0x98a5('0x2a')](_0x73fb6[_0x98a5('0x26')][_0x98a5('0x2a')]));_0x3b0198[_0x98a5('0x2b')]=_0x3b0198[_0x98a5('0x2b')][_0x98a5('0x2c')]?_0x3b0198[_0x98a5('0x2b')]:_0x3de86e[_0x98a5('0x25')];if(!_0x73fb6[_0x98a5('0x26')][_0x98a5('0x2d')](_0x98a5('0x2e'))){_0x3b0198[_0x98a5('0x17')]=qs[_0x98a5('0x17')](_0x73fb6['query'][_0x98a5('0x17')]);_0x3b0198[_0x98a5('0x2f')]=qs[_0x98a5('0x2f')](_0x73fb6[_0x98a5('0x26')]['offset']);}_0x3b0198[_0x98a5('0x30')]=qs['sort'](_0x73fb6[_0x98a5('0x26')][_0x98a5('0x31')]);_0x3b0198[_0x98a5('0x32')]=qs[_0x98a5('0x28')](_[_0x98a5('0x33')](_0x73fb6['query'],_0x3de86e['filters']),_0x1806be);if(_0x73fb6['query'][_0x98a5('0x34')]){_0x3b0198[_0x98a5('0x32')]=_['merge'](_0x3b0198[_0x98a5('0x32')],{'$or':_[_0x98a5('0x35')](_0x1806be,function(_0x36d3c0){if(_0x36d3c0[_0x98a5('0x24')]!=='VIRTUAL'){var _0x4ad6d4={};_0x4ad6d4[_0x36d3c0[_0x98a5('0x1e')]]={'$like':'%'+_0x73fb6[_0x98a5('0x26')][_0x98a5('0x34')]+'%'};return _0x4ad6d4;}})});}_0x3b0198=_[_0x98a5('0x36')]({},_0x3b0198,_0x73fb6[_0x98a5('0x37')]);var _0x2f717a={'where':_0x3b0198[_0x98a5('0x32')]};return db['Network'][_0x98a5('0x38')](_0x2f717a)[_0x98a5('0xc')](function(_0x57190a){_0x574241[_0x98a5('0x38')]=_0x57190a;if(_0x73fb6['query'][_0x98a5('0x39')]){_0x3b0198['include']=[{'all':!![]}];}return db[_0x98a5('0x3a')][_0x98a5('0x3b')](_0x3b0198);})[_0x98a5('0xc')](function(_0x327c36){_0x574241[_0x98a5('0x3c')]=_0x327c36;return _0x574241;})['then'](respondWithFilteredResult(_0x2fd912,_0x3b0198))[_0x98a5('0x3d')](handleError(_0x2fd912,null));};exports[_0x98a5('0x3e')]=function(_0x41172b,_0x2cc465){var _0x37bd14={'raw':!![],'where':{'id':_0x41172b[_0x98a5('0x3f')]['id']}},_0x1495cc={};_0x1495cc[_0x98a5('0x25')]=_['keys'](db[_0x98a5('0x3a')]['rawAttributes']);_0x1495cc['query']=_[_0x98a5('0x27')](_0x41172b[_0x98a5('0x26')]);_0x1495cc[_0x98a5('0x28')]=_[_0x98a5('0x29')](_0x1495cc[_0x98a5('0x25')],_0x1495cc[_0x98a5('0x26')]);_0x37bd14[_0x98a5('0x2b')]=_[_0x98a5('0x29')](_0x1495cc[_0x98a5('0x25')],qs['fields'](_0x41172b['query']['fields']));_0x37bd14[_0x98a5('0x2b')]=_0x37bd14[_0x98a5('0x2b')][_0x98a5('0x2c')]?_0x37bd14[_0x98a5('0x2b')]:_0x1495cc['model'];if(_0x41172b['query'][_0x98a5('0x39')]){_0x37bd14[_0x98a5('0x40')]=[{'all':!![]}];}_0x37bd14=_[_0x98a5('0x36')]({},_0x37bd14,_0x41172b[_0x98a5('0x37')]);return db[_0x98a5('0x3a')][_0x98a5('0x41')](_0x37bd14)[_0x98a5('0xc')](handleEntityNotFound(_0x2cc465,null))[_0x98a5('0xc')](respondWithResult(_0x2cc465,null))[_0x98a5('0x3d')](handleError(_0x2cc465,null));};exports[_0x98a5('0x42')]=function(_0x2cce24,_0x37d08d){var _0x555607;return db['Network'][_0x98a5('0x42')](_0x2cce24[_0x98a5('0x43')],{'raw':!![]})[_0x98a5('0xc')](function(_0x2d3aa8){_0x555607=_0x2d3aa8;return db[_0x98a5('0x3a')][_0x98a5('0x3b')]({'where':{'type':_0x2cce24[_0x98a5('0x43')]['type']},'raw':!![]});})['then'](function(_0x3f7e9f){if(_0x555607[_0x98a5('0x24')][_0x98a5('0x44')]()==_0x98a5('0x45')){var _0x2fb9b7=fs[_0x98a5('0x46')](path[_0x98a5('0x47')](config[_0x98a5('0x48')],_0x98a5('0x49')),'utf8');var _0x3e7d24=ejs[_0x98a5('0x4a')](_0x2fb9b7,{'networks':_0x3f7e9f||[]});fs['writeFileSync'](_0x98a5('0x4b'),_0x3e7d24);return respondWithRpcPromise(_0x98a5('0x4c'),_0x98a5('0x42'),{'module':_0x98a5('0x4d')});}else if(_0x555607[_0x98a5('0x24')][_0x98a5('0x44')]()==_0x98a5('0x4e')){var _0x47b33e=fs[_0x98a5('0x46')](path[_0x98a5('0x47')](config[_0x98a5('0x48')],_0x98a5('0x4f')),_0x98a5('0x50'));var _0x4845e3=ejs[_0x98a5('0x4a')](_0x47b33e,{'networks':_0x3f7e9f||[]});fs['writeFileSync'](_0x98a5('0x51'),_0x4845e3);return respondWithRpcPromise(_0x98a5('0x4c'),_0x98a5('0x42'),{'module':_0x98a5('0x4d')});}else{var _0x3a0330=fs[_0x98a5('0x46')](path[_0x98a5('0x47')](config[_0x98a5('0x48')],'server/files/templates/network.ejs'),_0x98a5('0x50'));var _0x3aaf07=ejs[_0x98a5('0x4a')](_0x3a0330,{'networks':_0x3f7e9f||[]});fs['writeFileSync'](util[_0x98a5('0x52')]('/etc/asterisk/sip_xcally_%s.conf',_0x2cce24[_0x98a5('0x43')][_0x98a5('0x24')]['toLowerCase']()),_0x3aaf07);return respondWithRpcPromise(_0x98a5('0x4c'),_0x98a5('0x42'),{'module':_0x98a5('0x53')});}})[_0x98a5('0xc')](function(){return _0x555607;})[_0x98a5('0xc')](respondWithResult(_0x37d08d,0xc9))[_0x98a5('0x3d')](handleError(_0x37d08d,null));};exports['update']=function(_0x5b181d,_0x572505){var _0x283ac9;return db[_0x98a5('0x3a')][_0x98a5('0x41')]({'where':{'id':_0x5b181d[_0x98a5('0x3f')]['id']}})['then'](handleEntityNotFound(_0x572505,null))['then'](saveUpdates(_0x5b181d[_0x98a5('0x43')],null))[_0x98a5('0xc')](function(_0x290c50){if(_0x290c50){_0x283ac9=_0x290c50;return db[_0x98a5('0x3a')]['findAll']({'where':{'type':_0x283ac9['type']},'raw':!![]});}return null;})[_0x98a5('0xc')](function(_0x3e0921){if(_0x283ac9[_0x98a5('0x24')][_0x98a5('0x44')]()=='STUN'){var _0x50b82b=fs[_0x98a5('0x46')](path[_0x98a5('0x47')](config['root'],_0x98a5('0x49')),'utf8');var _0x1c4f7d=ejs[_0x98a5('0x4a')](_0x50b82b,{'networks':_0x3e0921||[]});fs['writeFileSync'](_0x98a5('0x4b'),_0x1c4f7d);return respondWithRpcPromise(_0x98a5('0x4c'),_0x98a5('0x1a'),{'module':_0x98a5('0x4d')});}else if(_0x283ac9[_0x98a5('0x24')][_0x98a5('0x44')]()=='TURN'){var _0x4e717f=fs['readFileSync'](path[_0x98a5('0x47')](config[_0x98a5('0x48')],'server/files/templates/turn_multiple.ejs'),_0x98a5('0x50'));var _0x1b1642=ejs[_0x98a5('0x4a')](_0x4e717f,{'networks':_0x3e0921||[]});fs[_0x98a5('0x54')]('/etc/asterisk/turn_xcally.conf',_0x1b1642);return respondWithRpcPromise(_0x98a5('0x4c'),_0x98a5('0x1a'),{'module':'res_stun_monitor.so'});}else{var _0x6c1581=fs[_0x98a5('0x46')](path[_0x98a5('0x47')](config[_0x98a5('0x48')],'server/files/templates/network.ejs'),_0x98a5('0x50'));var _0x24114e=ejs[_0x98a5('0x4a')](_0x6c1581,{'networks':_0x3e0921||[]});fs['writeFileSync'](util[_0x98a5('0x52')](_0x98a5('0x55'),_0x5b181d[_0x98a5('0x43')]['type'][_0x98a5('0x56')]()),_0x24114e);return respondWithRpcPromise('Reload',_0x98a5('0x1a'),{'module':'chan_sip.so'});}})[_0x98a5('0xc')](function(_0x194084){if(_0x194084){return _0x283ac9;}return null;})[_0x98a5('0xc')](respondWithResult(_0x572505,null))['catch'](handleError(_0x572505,null));};exports[_0x98a5('0x1b')]=function(_0x362eb6,_0xcf98e4){var _0x1c070d;return db[_0x98a5('0x3a')][_0x98a5('0x41')]({'where':{'id':_0x362eb6['params']['id']}})[_0x98a5('0xc')](function(_0x2c9b26){_0x1c070d=_0x2c9b26;return _0x2c9b26;})[_0x98a5('0xc')](handleEntityNotFound(_0xcf98e4,null))[_0x98a5('0xc')](removeEntity(_0xcf98e4,null))[_0x98a5('0xc')](function(){if(_0x1c070d){return db[_0x98a5('0x3a')][_0x98a5('0x3b')]({'where':{'type':_0x1c070d[_0x98a5('0x24')]},'raw':!![]});}})[_0x98a5('0xc')](function(_0x300a04){if(_0x1c070d['type'][_0x98a5('0x44')]()==_0x98a5('0x45')){var _0x61752a=fs[_0x98a5('0x46')](path[_0x98a5('0x47')](config[_0x98a5('0x48')],_0x98a5('0x49')),_0x98a5('0x50'));var _0x2046d1=ejs[_0x98a5('0x4a')](_0x61752a,{'networks':_0x300a04||[]});fs[_0x98a5('0x54')](_0x98a5('0x4b'),_0x2046d1);return respondWithRpcPromise(_0x98a5('0x4c'),_0x98a5('0x1b'),{'module':_0x98a5('0x4d')});}else if(_0x1c070d[_0x98a5('0x24')]['toUpperCase']()==_0x98a5('0x4e')){var _0x147db6=fs['readFileSync'](path[_0x98a5('0x47')](config[_0x98a5('0x48')],_0x98a5('0x4f')),_0x98a5('0x50'));var _0x5560cc=ejs['render'](_0x147db6,{'networks':_0x300a04||[]});fs[_0x98a5('0x54')](_0x98a5('0x51'),_0x5560cc);return respondWithRpcPromise(_0x98a5('0x4c'),'destroy',{'module':_0x98a5('0x4d')});}else{var _0x2bbbf2=fs[_0x98a5('0x46')](path[_0x98a5('0x47')](config['root'],_0x98a5('0x57')),'utf8');var _0x59f842=ejs[_0x98a5('0x4a')](_0x2bbbf2,{'networks':_0x300a04||[]});fs['writeFileSync'](util[_0x98a5('0x52')](_0x98a5('0x55'),_0x1c070d['type'][_0x98a5('0x56')]()),_0x59f842);return respondWithRpcPromise('Reload',_0x98a5('0x1b'),{'module':'chan_sip.so'});}})[_0x98a5('0x3d')](handleError(_0xcf98e4,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 8141195..7969416 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 _0x422f=['./network.attributes','exports','define','network','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x422f,0x1c7));var _0xf422=function(_0x10985a,_0x5a1c42){_0x10985a=_0x10985a-0x0;var _0x96bb6d=_0x422f[_0x10985a];return _0x96bb6d;};'use strict';var _=require('lodash');var util=require(_0xf422('0x0'));var logger=require('../../config/logger')(_0xf422('0x1'));var moment=require(_0xf422('0x2'));var BPromise=require('bluebird');var rp=require(_0xf422('0x3'));var fs=require('fs');var path=require(_0xf422('0x4'));var rimraf=require(_0xf422('0x5'));var config=require(_0xf422('0x6'));var attributes=require(_0xf422('0x7'));module[_0xf422('0x8')]=function(_0x3e3e5d,_0x13ed91){return _0x3e3e5d[_0xf422('0x9')]('Network',attributes,{'tableName':_0xf422('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x657b=['api','moment','request-promise','path','../../config/environment','./network.attributes','exports','Network','lodash','util','../../config/logger'];(function(_0x18fe86,_0x21f937){var _0x400e35=function(_0x1cc7db){while(--_0x1cc7db){_0x18fe86['push'](_0x18fe86['shift']());}};_0x400e35(++_0x21f937);}(_0x657b,0x131));var _0xb657=function(_0x5727cb,_0x5133d0){_0x5727cb=_0x5727cb-0x0;var _0xe3f894=_0x657b[_0x5727cb];return _0xe3f894;};'use strict';var _=require(_0xb657('0x0'));var util=require(_0xb657('0x1'));var logger=require(_0xb657('0x2'))(_0xb657('0x3'));var moment=require(_0xb657('0x4'));var BPromise=require('bluebird');var rp=require(_0xb657('0x5'));var fs=require('fs');var path=require(_0xb657('0x6'));var rimraf=require('rimraf');var config=require(_0xb657('0x7'));var attributes=require(_0xb657('0x8'));module[_0xb657('0x9')]=function(_0x25738d,_0x446b17){return _0x25738d['define'](_0xb657('0xa'),attributes,{'tableName':'network','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 260ef68..1d22f7c 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 _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x3ce6a6,_0x555b8b){_0x3ce6a6=_0x3ce6a6-0x0;var _0x3dea5f=_0x7a54[_0x3ce6a6];return _0x3dea5f;};'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 +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(_0x5d3438,_0x393f47){var _0x1f3a88=function(_0x5ed91a){while(--_0x5ed91a){_0x5d3438['push'](_0x5d3438['shift']());}};_0x1f3a88(++_0x393f47);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 7a21a02..3b31059 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 _0x2462=['./openchannelAccount.controller','index','get','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','post','create','addDisposition','addAnswer','/:id/notify','addApplications','/:id/users','/:id/send','put','delete','destroy','removeDispositions','removeAgents','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x30e3f0,_0x2789e6){var _0x1ed4bc=function(_0x30ac42){while(--_0x30ac42){_0x30e3f0['push'](_0x30e3f0['shift']());}};_0x1ed4bc(++_0x2789e6);}(_0x2462,0x1c8));var _0x2246=function(_0x34b821,_0x43bcd5){_0x34b821=_0x34b821-0x0;var _0x4a2d30=_0x2462[_0x34b821];return _0x4a2d30;};'use strict';var multer=require('multer');var util=require(_0x2246('0x0'));var path=require('path');var timeout=require(_0x2246('0x1'));var express=require(_0x2246('0x2'));var router=express['Router']();var fs_extra=require(_0x2246('0x3'));var auth=require(_0x2246('0x4'));var interaction=require(_0x2246('0x5'));var config=require('../../config/environment');var controller=require(_0x2246('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x2246('0x7')]);router[_0x2246('0x8')]('/describe',auth[_0x2246('0x9')](),controller['describe']);router[_0x2246('0x8')](_0x2246('0xa'),auth[_0x2246('0x9')](),controller[_0x2246('0xb')]);router[_0x2246('0x8')](_0x2246('0xc'),auth['isAuthenticated'](),controller[_0x2246('0xd')]);router[_0x2246('0x8')]('/:id/canned_answers',auth[_0x2246('0x9')](),controller[_0x2246('0xe')]);router['get'](_0x2246('0xf'),auth['isAuthenticated'](),controller[_0x2246('0x10')]);router[_0x2246('0x8')](_0x2246('0x11'),auth['isAuthenticated'](),controller[_0x2246('0x12')]);router[_0x2246('0x8')]('/:id/users',auth[_0x2246('0x9')](),controller['getAgents']);router[_0x2246('0x13')]('/',auth[_0x2246('0x9')](),controller[_0x2246('0x14')]);router[_0x2246('0x13')](_0x2246('0xc'),auth[_0x2246('0x9')](),controller[_0x2246('0x15')]);router[_0x2246('0x13')]('/:id/canned_answers',auth[_0x2246('0x9')](),controller[_0x2246('0x16')]);router['post'](_0x2246('0x17'),controller['notify']);router['post'](_0x2246('0xf'),auth[_0x2246('0x9')](),controller[_0x2246('0x18')]);router['post'](_0x2246('0x19'),auth[_0x2246('0x9')](),controller['addAgents']);router[_0x2246('0x13')](_0x2246('0x1a'),auth[_0x2246('0x9')](),controller['send']);router[_0x2246('0x1b')](_0x2246('0xa'),auth[_0x2246('0x9')](),controller['update']);router[_0x2246('0x1c')](_0x2246('0xa'),auth[_0x2246('0x9')](),controller[_0x2246('0x1d')]);router[_0x2246('0x1c')](_0x2246('0xc'),auth['isAuthenticated'](),controller[_0x2246('0x1e')]);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x2246('0x19'),auth[_0x2246('0x9')](),controller[_0x2246('0x1f')]);module[_0x2246('0x20')]=router; \ No newline at end of file +var _0x065d=['/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id'];(function(_0x21b5d6,_0x205932){var _0x3e246d=function(_0x4559a1){while(--_0x4559a1){_0x21b5d6['push'](_0x21b5d6['shift']());}};_0x3e246d(++_0x205932);}(_0x065d,0x1d1));var _0xd065=function(_0x22b5b6,_0x4dd584){_0x22b5b6=_0x22b5b6-0x0;var _0x590e5d=_0x065d[_0x22b5b6];return _0x590e5d;};'use strict';var multer=require(_0xd065('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd065('0x1'));var router=express['Router']();var fs_extra=require(_0xd065('0x2'));var auth=require(_0xd065('0x3'));var interaction=require(_0xd065('0x4'));var config=require(_0xd065('0x5'));var controller=require('./openchannelAccount.controller');router[_0xd065('0x6')]('/',auth[_0xd065('0x7')](),controller['index']);router[_0xd065('0x6')](_0xd065('0x8'),auth[_0xd065('0x7')](),controller[_0xd065('0x9')]);router['get'](_0xd065('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd065('0x6')](_0xd065('0xb'),auth['isAuthenticated'](),controller[_0xd065('0xc')]);router[_0xd065('0x6')](_0xd065('0xd'),auth[_0xd065('0x7')](),controller['getAnswers']);router[_0xd065('0x6')](_0xd065('0xe'),auth['isAuthenticated'](),controller[_0xd065('0xf')]);router[_0xd065('0x6')](_0xd065('0x10'),auth[_0xd065('0x7')](),controller['getInteractions']);router[_0xd065('0x6')]('/:id/users',auth[_0xd065('0x7')](),controller['getAgents']);router[_0xd065('0x11')]('/',auth['isAuthenticated'](),controller[_0xd065('0x12')]);router[_0xd065('0x11')]('/:id/dispositions',auth[_0xd065('0x7')](),controller[_0xd065('0x13')]);router[_0xd065('0x11')]('/:id/canned_answers',auth[_0xd065('0x7')](),controller[_0xd065('0x14')]);router[_0xd065('0x11')](_0xd065('0x15'),controller[_0xd065('0x16')]);router[_0xd065('0x11')](_0xd065('0xe'),auth['isAuthenticated'](),controller[_0xd065('0x17')]);router[_0xd065('0x11')]('/:id/users',auth[_0xd065('0x7')](),controller[_0xd065('0x18')]);router[_0xd065('0x11')]('/:id/send',auth[_0xd065('0x7')](),controller['send']);router[_0xd065('0x19')](_0xd065('0xa'),auth[_0xd065('0x7')](),controller[_0xd065('0x1a')]);router[_0xd065('0x1b')]('/:id',auth[_0xd065('0x7')](),controller[_0xd065('0x1c')]);router[_0xd065('0x1b')](_0xd065('0xb'),auth[_0xd065('0x7')](),controller[_0xd065('0x1d')]);router[_0xd065('0x1b')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd065('0x1e')]);router[_0xd065('0x1b')](_0xd065('0x1f'),auth[_0xd065('0x7')](),controller[_0xd065('0x20')]);module[_0xd065('0x21')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 97fa091..cb09a81 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 _0x23bf=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x23bf,0xc4));var _0xf23b=function(_0x1e0655,_0x37cfeb){_0x1e0655=_0x1e0655-0x0;var _0xb4dfe7=_0x23bf[_0x1e0655];return _0xb4dfe7;};'use strict';var Sequelize=require(_0xf23b('0x0'));var rs=require(_0xf23b('0x1'));module[_0xf23b('0x2')]={'name':{'type':Sequelize[_0xf23b('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xf23b('0x3')]},'token':{'type':Sequelize[_0xf23b('0x3')],'defaultValue':function(){return rs[_0xf23b('0x4')]();}},'replyUri':{'type':Sequelize[_0xf23b('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xf23b('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xf23b('0x5');}},'notificationSound':{'type':Sequelize[_0xf23b('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf23b('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf23b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf23b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xf23b('0x3')]},'queueTransfer':{'type':Sequelize[_0xf23b('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf23b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf23b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xf23b('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf23b('0x9'),'set':function(_0xe82e43){if(!_0xe82e43)this[_0xf23b('0xa')]('mandatoryDispositionPauseId',null);this[_0xf23b('0xa')](_0xf23b('0xb'),_0xe82e43);}}}; \ No newline at end of file +var _0xc7c9=['sequelize','randomstring','exports','name','STRING','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x4b54ad,_0x48513a){var _0x1dc96f=function(_0x517012){while(--_0x517012){_0x4b54ad['push'](_0x4b54ad['shift']());}};_0x1dc96f(++_0x48513a);}(_0xc7c9,0xf0));var _0x9c7c=function(_0x1a1c60,_0x24d5ca){_0x1a1c60=_0x1a1c60-0x0;var _0x334cbf=_0xc7c9[_0x1a1c60];return _0x334cbf;};'use strict';var Sequelize=require(_0x9c7c('0x0'));var rs=require(_0x9c7c('0x1'));module[_0x9c7c('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x9c7c('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x9c7c('0x4')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9c7c('0x5')]();}},'replyUri':{'type':Sequelize[_0x9c7c('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9c7c('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9c7c('0x6')],'defaultValue':function(){return _0x9c7c('0x7');}},'notificationSound':{'type':Sequelize[_0x9c7c('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9c7c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x9c7c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x9c7c('0x4')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9c7c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9c7c('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9c7c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9c7c('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x9c7c('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9c7c('0xb'),'set':function(_0x4fd41b){if(!_0x4fd41b)this[_0x9c7c('0xc')](_0x9c7c('0xd'),null);this[_0x9c7c('0xc')](_0x9c7c('0xe'),_0x4fd41b);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index b42f07b..a89b08f 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 _0x82f8=['message','info','result','catch','status','end','json','offset','undefined','limit','count','set','reject','save','destroy','get','UserProfileResource','sendStatus','name','send','index','Pause','map','OpenchannelAccount','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','sort','pick','where','merge','filter','options','includeAll','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getDispositions','findOne','Disposition','nolimit','order','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','hasOwnProperty','removeAnswers','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','from','CmList','List','OpenchannelApplication','Applications','applications','list','orderBy','priority','asc','account','Contacts','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','messageId','interaction','created','autoclose','push','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','EventManager','addApplications','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate','stack','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','DESC','out','Messages','dataValues','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x82f8,0x157));var _0x882f=function(_0x2258cc,_0x3975f5){_0x2258cc=_0x2258cc-0x0;var _0xcd45b=_0x82f8[_0x2258cc];return _0xcd45b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x882f('0x0'));var zipdir=require(_0x882f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x882f('0x2'));var moment=require(_0x882f('0x3'));var BPromise=require(_0x882f('0x4'));var Mustache=require(_0x882f('0x5'));var util=require(_0x882f('0x6'));var path=require(_0x882f('0x7'));var sox=require(_0x882f('0x8'));var csv=require(_0x882f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x882f('0xa'));var squel=require(_0x882f('0xb'));var crypto=require(_0x882f('0xc'));var jsforce=require(_0x882f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x882f('0x9'));var querystring=require('querystring');var Papa=require(_0x882f('0xe'));var Redis=require('ioredis');var authService=require(_0x882f('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x882f('0x10'));var logger=require(_0x882f('0x11'))(_0x882f('0x12'));var utils=require(_0x882f('0x13'));var config=require(_0x882f('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x882f('0x15')]=_[_0x882f('0x16')](config[_0x882f('0x15')],{'host':_0x882f('0x17'),'port':0x18eb});var socket=require(_0x882f('0x18'))(new Redis(config[_0x882f('0x15')]));require(_0x882f('0x19'))['register'](socket);var jayson=require(_0x882f('0x1a'));var client=jayson[_0x882f('0x1b')][_0x882f('0x1c')]({'port':0x232c});var client9002=jayson[_0x882f('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ca189,_0x4e9b6e,_0x264da8,_0x187ce1){return new BPromise(function(_0x3357ef,_0x3c2afc){var _0x3f72c2=_0x187ce1||client;return _0x3f72c2[_0x882f('0x1d')](_0x4ca189,_0x264da8)[_0x882f('0x1e')](function(_0x67cc4b){logger['info'](_0x882f('0x1f'),_0x4e9b6e,'request\x20sent');logger['debug'](_0x882f('0x20'),_0x4e9b6e,_0x882f('0x21'),JSON[_0x882f('0x22')](_0x67cc4b));if(_0x67cc4b[_0x882f('0x23')]){if(_0x67cc4b['error'][_0x882f('0x24')]===0x1f4){logger[_0x882f('0x23')](_0x882f('0x1f'),_0x4e9b6e,_0x67cc4b[_0x882f('0x23')][_0x882f('0x25')]);return _0x3c2afc(_0x67cc4b[_0x882f('0x23')][_0x882f('0x25')]);}logger[_0x882f('0x23')](_0x882f('0x1f'),_0x4e9b6e,_0x67cc4b['error']['message']);return _0x3357ef(_0x67cc4b['error'][_0x882f('0x25')]);}else{logger[_0x882f('0x26')](_0x882f('0x1f'),_0x4e9b6e,_0x882f('0x21'));_0x3357ef(_0x67cc4b[_0x882f('0x27')][_0x882f('0x25')]);}})[_0x882f('0x28')](function(_0x2d6f58){logger[_0x882f('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x4e9b6e,_0x2d6f58);_0x3c2afc(_0x2d6f58);});});}function respondWithStatusCode(_0x42a827,_0x2a8605){_0x2a8605=_0x2a8605||0xcc;return function(_0x51d359){if(_0x51d359){return _0x42a827['sendStatus'](_0x2a8605);}return _0x42a827[_0x882f('0x29')](_0x2a8605)[_0x882f('0x2a')]();};}function respondWithResult(_0xd284e0,_0x4cf987){_0x4cf987=_0x4cf987||0xc8;return function(_0x2ae870){if(_0x2ae870){return _0xd284e0[_0x882f('0x29')](_0x4cf987)[_0x882f('0x2b')](_0x2ae870);}};}function respondWithFilteredResult(_0x29fc23,_0x58d4ce){return function(_0x41605c){if(_0x41605c){var _0x31d0b7=typeof _0x58d4ce[_0x882f('0x2c')]===_0x882f('0x2d')&&typeof _0x58d4ce[_0x882f('0x2e')]===_0x882f('0x2d');var _0x340e9b=_0x41605c[_0x882f('0x2f')];var _0x299f62=_0x31d0b7?0x0:_0x58d4ce[_0x882f('0x2c')];var _0x97706f=_0x31d0b7?_0x41605c[_0x882f('0x2f')]:_0x58d4ce[_0x882f('0x2c')]+_0x58d4ce['limit'];var _0x19c435;if(_0x97706f>=_0x340e9b){_0x97706f=_0x340e9b;_0x19c435=0xc8;}else{_0x19c435=0xce;}_0x29fc23['status'](_0x19c435);return _0x29fc23[_0x882f('0x30')]('Content-Range',_0x299f62+'-'+_0x97706f+'/'+_0x340e9b)['json'](_0x41605c);}return null;};}function patchUpdates(_0x20aa1c){return function(_0x425d28){try{jsonpatch['apply'](_0x425d28,_0x20aa1c,!![]);}catch(_0x206624){return BPromise[_0x882f('0x31')](_0x206624);}return _0x425d28[_0x882f('0x32')]();};}function saveUpdates(_0x394a37,_0x4910ab){return function(_0x19dded){if(_0x19dded){return _0x19dded['update'](_0x394a37)['then'](function(_0x5eba63){return _0x5eba63;});}return null;};}function removeEntity(_0x20f821,_0x55aec8){return function(_0x2080ac){if(_0x2080ac){return _0x2080ac[_0x882f('0x33')]()['then'](function(){var _0x5de26e=_0x2080ac[_0x882f('0x34')]({'plain':!![]});var _0x21a279='OpenchannelAccounts';return db[_0x882f('0x35')][_0x882f('0x33')]({'where':{'type':_0x21a279,'resourceId':_0x5de26e['id']}})[_0x882f('0x1e')](function(){return _0x2080ac;});})[_0x882f('0x1e')](function(){_0x20f821[_0x882f('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe86115,_0xab6c98){return function(_0x27303e){if(!_0x27303e){_0xe86115[_0x882f('0x36')](0x194);}return _0x27303e;};}function handleError(_0x34cba3,_0x587974){_0x587974=_0x587974||0x1f4;return function(_0x1a6210){logger[_0x882f('0x23')](_0x1a6210['stack']);if(_0x1a6210[_0x882f('0x37')]){delete _0x1a6210[_0x882f('0x37')];}_0x34cba3[_0x882f('0x29')](_0x587974)[_0x882f('0x38')](_0x1a6210);};}exports[_0x882f('0x39')]=function(_0x40a82f,_0x281e89){var _0x2f5514={'include':[{'model':db[_0x882f('0x3a')],'as':'mandatoryDispositionPause'}]},_0x5038c9={},_0xc5bd03={'count':0x0,'rows':[]};var _0x2a02f9=_[_0x882f('0x3b')](db[_0x882f('0x3c')]['rawAttributes'],function(_0xa8c4e3){return{'name':_0xa8c4e3[_0x882f('0x3d')],'type':_0xa8c4e3[_0x882f('0x3e')]['key']};});_0x5038c9['model']=_[_0x882f('0x3b')](_0x2a02f9,_0x882f('0x37'));_0x5038c9[_0x882f('0x3f')]=_[_0x882f('0x40')](_0x40a82f[_0x882f('0x3f')]);_0x5038c9[_0x882f('0x41')]=_[_0x882f('0x42')](_0x5038c9[_0x882f('0x43')],_0x5038c9[_0x882f('0x3f')]);_0x2f5514[_0x882f('0x44')]=_[_0x882f('0x42')](_0x5038c9['model'],qs[_0x882f('0x45')](_0x40a82f[_0x882f('0x3f')][_0x882f('0x45')]));_0x2f5514[_0x882f('0x44')]=_0x2f5514[_0x882f('0x44')][_0x882f('0x46')]?_0x2f5514[_0x882f('0x44')]:_0x5038c9[_0x882f('0x43')];if(!_0x40a82f[_0x882f('0x3f')]['hasOwnProperty']('nolimit')){_0x2f5514['limit']=qs[_0x882f('0x2e')](_0x40a82f['query']['limit']);_0x2f5514[_0x882f('0x2c')]=qs[_0x882f('0x2c')](_0x40a82f[_0x882f('0x3f')][_0x882f('0x2c')]);}_0x2f5514['order']=qs[_0x882f('0x47')](_0x40a82f[_0x882f('0x3f')][_0x882f('0x47')]);_0x2f5514['where']=qs[_0x882f('0x41')](_[_0x882f('0x48')](_0x40a82f[_0x882f('0x3f')],_0x5038c9[_0x882f('0x41')]),_0x2a02f9);if(_0x40a82f[_0x882f('0x3f')]['filter']){_0x2f5514[_0x882f('0x49')]=_[_0x882f('0x4a')](_0x2f5514['where'],{'$or':_[_0x882f('0x3b')](_0x2a02f9,function(_0xac7be3){if(_0xac7be3[_0x882f('0x3e')]!=='VIRTUAL'){var _0x88a481={};_0x88a481[_0xac7be3['name']]={'$like':'%'+_0x40a82f[_0x882f('0x3f')][_0x882f('0x4b')]+'%'};return _0x88a481;}})});}_0x2f5514=_[_0x882f('0x4a')]({},_0x2f5514,_0x40a82f[_0x882f('0x4c')]);var _0x3b2f7b={'where':_0x2f5514[_0x882f('0x49')]};return db[_0x882f('0x3c')][_0x882f('0x2f')](_0x3b2f7b)[_0x882f('0x1e')](function(_0x5329c5){_0xc5bd03[_0x882f('0x2f')]=_0x5329c5;if(_0x40a82f[_0x882f('0x3f')][_0x882f('0x4d')]){_0x2f5514['include']=[{'all':!![]}];}return db['OpenchannelAccount'][_0x882f('0x4e')](_0x2f5514);})[_0x882f('0x1e')](function(_0x3d2947){_0xc5bd03[_0x882f('0x4f')]=_0x3d2947;return _0xc5bd03;})[_0x882f('0x1e')](respondWithFilteredResult(_0x281e89,_0x2f5514))[_0x882f('0x28')](handleError(_0x281e89,null));};exports[_0x882f('0x50')]=function(_0x4c8106,_0x424a49){var _0x4ce2bc={'raw':![],'where':{'id':_0x4c8106[_0x882f('0x51')]['id']},'include':[{'model':db[_0x882f('0x3a')],'as':_0x882f('0x52')}]},_0x25368e={};_0x25368e[_0x882f('0x43')]=_[_0x882f('0x40')](db[_0x882f('0x3c')][_0x882f('0x53')]);_0x25368e[_0x882f('0x3f')]=_[_0x882f('0x40')](_0x4c8106[_0x882f('0x3f')]);_0x25368e[_0x882f('0x41')]=_[_0x882f('0x42')](_0x25368e[_0x882f('0x43')],_0x25368e[_0x882f('0x3f')]);_0x4ce2bc[_0x882f('0x44')]=_[_0x882f('0x42')](_0x25368e[_0x882f('0x43')],qs['fields'](_0x4c8106[_0x882f('0x3f')][_0x882f('0x45')]));_0x4ce2bc[_0x882f('0x44')]=_0x4ce2bc['attributes'][_0x882f('0x46')]?_0x4ce2bc['attributes']:_0x25368e[_0x882f('0x43')];if(_0x4c8106[_0x882f('0x3f')][_0x882f('0x4d')]){_0x4ce2bc[_0x882f('0x54')]=[{'all':!![]}];}_0x4ce2bc=_[_0x882f('0x4a')]({},_0x4ce2bc,_0x4c8106[_0x882f('0x4c')]);return db['OpenchannelAccount'][_0x882f('0x55')](_0x4ce2bc)[_0x882f('0x1e')](handleEntityNotFound(_0x424a49,null))[_0x882f('0x1e')](respondWithResult(_0x424a49,null))[_0x882f('0x28')](handleError(_0x424a49,null));};exports[_0x882f('0x56')]=function(_0x195918,_0x34ef3d){return db[_0x882f('0x3c')][_0x882f('0x56')](_0x195918[_0x882f('0x57')],{})[_0x882f('0x1e')](function(_0x5bc07e){var _0x219483=_0x195918[_0x882f('0x58')]['get']({'plain':!![]});if(!_0x219483)throw new Error(_0x882f('0x59'));if(_0x219483[_0x882f('0x5a')]==='user'){var _0xf17be9=_0x5bc07e['get']({'plain':!![]});var _0x5af318='OpenchannelAccounts';return db['UserProfileSection'][_0x882f('0x55')]({'where':{'name':_0x5af318,'userProfileId':_0x219483['userProfileId']},'raw':!![]})[_0x882f('0x1e')](function(_0x2cf962){if(_0x2cf962&&_0x2cf962[_0x882f('0x5b')]===0x0){return db['UserProfileResource']['create']({'name':_0xf17be9[_0x882f('0x37')],'resourceId':_0xf17be9['id'],'type':_0x2cf962[_0x882f('0x37')],'sectionId':_0x2cf962['id']},{})[_0x882f('0x1e')](function(){return _0x5bc07e;});}else{return _0x5bc07e;}})['catch'](function(_0x22ef2d){logger[_0x882f('0x23')](_0x882f('0x5c'),_0x22ef2d);throw _0x22ef2d;});}return _0x5bc07e;})[_0x882f('0x1e')](respondWithResult(_0x34ef3d,0xc9))[_0x882f('0x28')](handleError(_0x34ef3d,null));};exports[_0x882f('0x5d')]=function(_0x35095e,_0xf96814){if(_0x35095e[_0x882f('0x57')]['id']){delete _0x35095e['body']['id'];}return db[_0x882f('0x3c')][_0x882f('0x55')]({'where':{'id':_0x35095e['params']['id']},'include':[{'model':db['Pause'],'as':_0x882f('0x52')}]})[_0x882f('0x1e')](handleEntityNotFound(_0xf96814,null))[_0x882f('0x1e')](saveUpdates(_0x35095e[_0x882f('0x57')],null))[_0x882f('0x1e')](respondWithResult(_0xf96814,null))['catch'](handleError(_0xf96814,null));};exports[_0x882f('0x33')]=function(_0x235aad,_0x59f324){return db[_0x882f('0x3c')]['find']({'where':{'id':_0x235aad['params']['id']}})[_0x882f('0x1e')](handleEntityNotFound(_0x59f324,null))[_0x882f('0x1e')](removeEntity(_0x59f324,null))['catch'](handleError(_0x59f324,null));};exports[_0x882f('0x5e')]=function(_0x5a1d40,_0x584f78){return db[_0x882f('0x3c')][_0x882f('0x5e')]()[_0x882f('0x1e')](respondWithResult(_0x584f78,null))[_0x882f('0x28')](handleError(_0x584f78,null));};exports['addDisposition']=function(_0x4550ba,_0x259fb2,_0x1122c5){if(_0x4550ba[_0x882f('0x57')]['id']){delete _0x4550ba[_0x882f('0x57')]['id'];}return db[_0x882f('0x3c')]['find']({'where':{'id':_0x4550ba['params']['id']}})[_0x882f('0x1e')](handleEntityNotFound(_0x259fb2,null))['then'](function(_0x3aefd0){if(_0x3aefd0){_0x4550ba['body']['OpenchannelAccountId']=_0x3aefd0['id'];return db['Disposition'][_0x882f('0x56')](_0x4550ba[_0x882f('0x57')]);}})['then'](respondWithResult(_0x259fb2,null))[_0x882f('0x28')](handleError(_0x259fb2,null));};exports[_0x882f('0x5f')]=function(_0x3bb298,_0x48f535,_0x4fc877){var _0xabf5c4={'raw':![],'where':{}};var _0x417d0c={};var _0x2b6192={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x882f('0x60')]({'where':{'id':_0x3bb298[_0x882f('0x51')]['id']}})[_0x882f('0x1e')](handleEntityNotFound(_0x48f535,null))[_0x882f('0x1e')](function(_0x26bf1a){if(_0x26bf1a){_0x417d0c[_0x882f('0x43')]=_[_0x882f('0x40')](db[_0x882f('0x61')][_0x882f('0x53')]);_0x417d0c[_0x882f('0x3f')]=_[_0x882f('0x40')](_0x3bb298[_0x882f('0x3f')]);_0x417d0c['filters']=_[_0x882f('0x42')](_0x417d0c[_0x882f('0x43')],_0x417d0c[_0x882f('0x3f')]);_0xabf5c4['attributes']=_[_0x882f('0x42')](_0x417d0c[_0x882f('0x43')],qs[_0x882f('0x45')](_0x3bb298[_0x882f('0x3f')][_0x882f('0x45')]));_0xabf5c4[_0x882f('0x44')]=_0xabf5c4['attributes'][_0x882f('0x46')]?_0xabf5c4[_0x882f('0x44')]:_0x417d0c[_0x882f('0x43')];if(!_0x3bb298['query']['hasOwnProperty'](_0x882f('0x62'))){_0xabf5c4['limit']=qs[_0x882f('0x2e')](_0x3bb298['query']['limit']);_0xabf5c4['offset']=qs[_0x882f('0x2c')](_0x3bb298[_0x882f('0x3f')][_0x882f('0x2c')]);}_0xabf5c4[_0x882f('0x63')]=qs[_0x882f('0x47')](_0x3bb298[_0x882f('0x3f')][_0x882f('0x47')]);_0xabf5c4['where']=qs[_0x882f('0x41')](_[_0x882f('0x48')](_0x3bb298[_0x882f('0x3f')],_0x417d0c['filters']));_0xabf5c4[_0x882f('0x49')][_0x882f('0x64')]=_0x26bf1a['id'];if(_0x3bb298[_0x882f('0x3f')][_0x882f('0x4b')]){_0xabf5c4[_0x882f('0x49')]=_[_0x882f('0x4a')](_0xabf5c4[_0x882f('0x49')],{'$or':_[_0x882f('0x3b')](_0xabf5c4[_0x882f('0x44')],function(_0x47047a){var _0x1d994b={};_0x1d994b[_0x47047a]={'$like':'%'+_0x3bb298['query'][_0x882f('0x4b')]+'%'};return _0x1d994b;})});}_0xabf5c4=_[_0x882f('0x4a')]({},_0xabf5c4,_0x3bb298[_0x882f('0x4c')]);return db['Disposition'][_0x882f('0x2f')]({'where':_0xabf5c4[_0x882f('0x49')]})[_0x882f('0x1e')](function(_0xe0ff83){_0x2b6192['count']=_0xe0ff83;if(_0x3bb298[_0x882f('0x3f')]['includeAll']){_0xabf5c4[_0x882f('0x54')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0xabf5c4);})[_0x882f('0x1e')](function(_0x34a63b){_0x2b6192[_0x882f('0x4f')]=_0x34a63b;return _0x2b6192;});}})[_0x882f('0x1e')](respondWithFilteredResult(_0x48f535,_0xabf5c4))['catch'](handleError(_0x48f535,null));};exports[_0x882f('0x65')]=function(_0x31b39a,_0x5055a1,_0x3fbf78){return db[_0x882f('0x3c')][_0x882f('0x55')]({'where':{'id':_0x31b39a[_0x882f('0x51')]['id']}})[_0x882f('0x1e')](handleEntityNotFound(_0x5055a1,null))[_0x882f('0x1e')](function(_0x17a6e3){if(_0x17a6e3){return _0x17a6e3[_0x882f('0x65')](_0x31b39a[_0x882f('0x3f')][_0x882f('0x66')]);}})[_0x882f('0x1e')](respondWithStatusCode(_0x5055a1,null))[_0x882f('0x28')](handleError(_0x5055a1,null));};exports[_0x882f('0x67')]=function(_0x494f13,_0x429ab8,_0x306174){if(_0x494f13[_0x882f('0x57')]['id']){delete _0x494f13['body']['id'];}return db[_0x882f('0x3c')]['find']({'where':{'id':_0x494f13['params']['id']}})[_0x882f('0x1e')](handleEntityNotFound(_0x429ab8,null))[_0x882f('0x1e')](function(_0x59f02b){if(_0x59f02b){_0x494f13['body'][_0x882f('0x64')]=_0x59f02b['id'];return db['CannedAnswer']['create'](_0x494f13[_0x882f('0x57')]);}})[_0x882f('0x1e')](respondWithResult(_0x429ab8,null))['catch'](handleError(_0x429ab8,null));};exports['getAnswers']=function(_0x4a7efe,_0x68a7ff,_0x1e8e7b){var _0x434ca7={'raw':![],'where':{}};var _0x15ee21={};var _0x497e29={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x882f('0x60')]({'where':{'id':_0x4a7efe['params']['id']}})[_0x882f('0x1e')](handleEntityNotFound(_0x68a7ff,null))[_0x882f('0x1e')](function(_0x4b44ff){if(_0x4b44ff){_0x15ee21[_0x882f('0x43')]=_[_0x882f('0x40')](db[_0x882f('0x68')][_0x882f('0x53')]);_0x15ee21[_0x882f('0x3f')]=_[_0x882f('0x40')](_0x4a7efe[_0x882f('0x3f')]);_0x15ee21[_0x882f('0x41')]=_[_0x882f('0x42')](_0x15ee21['model'],_0x15ee21['query']);_0x434ca7[_0x882f('0x44')]=_[_0x882f('0x42')](_0x15ee21[_0x882f('0x43')],qs[_0x882f('0x45')](_0x4a7efe[_0x882f('0x3f')][_0x882f('0x45')]));_0x434ca7['attributes']=_0x434ca7[_0x882f('0x44')][_0x882f('0x46')]?_0x434ca7[_0x882f('0x44')]:_0x15ee21[_0x882f('0x43')];if(!_0x4a7efe[_0x882f('0x3f')][_0x882f('0x69')](_0x882f('0x62'))){_0x434ca7['limit']=qs['limit'](_0x4a7efe[_0x882f('0x3f')][_0x882f('0x2e')]);_0x434ca7['offset']=qs[_0x882f('0x2c')](_0x4a7efe['query'][_0x882f('0x2c')]);}_0x434ca7[_0x882f('0x63')]=qs[_0x882f('0x47')](_0x4a7efe[_0x882f('0x3f')][_0x882f('0x47')]);_0x434ca7[_0x882f('0x49')]=qs[_0x882f('0x41')](_['pick'](_0x4a7efe[_0x882f('0x3f')],_0x15ee21[_0x882f('0x41')]));_0x434ca7[_0x882f('0x49')][_0x882f('0x64')]=_0x4b44ff['id'];if(_0x4a7efe[_0x882f('0x3f')][_0x882f('0x4b')]){_0x434ca7[_0x882f('0x49')]=_['merge'](_0x434ca7[_0x882f('0x49')],{'$or':_[_0x882f('0x3b')](_0x434ca7[_0x882f('0x44')],function(_0x5f9b9e){var _0x76ec1={};_0x76ec1[_0x5f9b9e]={'$like':'%'+_0x4a7efe[_0x882f('0x3f')][_0x882f('0x4b')]+'%'};return _0x76ec1;})});}_0x434ca7=_['merge']({},_0x434ca7,_0x4a7efe['options']);return db['CannedAnswer'][_0x882f('0x2f')]({'where':_0x434ca7[_0x882f('0x49')]})['then'](function(_0x433418){_0x497e29[_0x882f('0x2f')]=_0x433418;if(_0x4a7efe[_0x882f('0x3f')][_0x882f('0x4d')]){_0x434ca7['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x882f('0x4e')](_0x434ca7);})[_0x882f('0x1e')](function(_0x201feb){_0x497e29[_0x882f('0x4f')]=_0x201feb;return _0x497e29;});}})[_0x882f('0x1e')](respondWithFilteredResult(_0x68a7ff,_0x434ca7))['catch'](handleError(_0x68a7ff,null));};exports['removeAnswers']=function(_0x504ab7,_0x263ca0,_0x33999f){return db['OpenchannelAccount'][_0x882f('0x55')]({'where':{'id':_0x504ab7['params']['id']}})[_0x882f('0x1e')](handleEntityNotFound(_0x263ca0,null))[_0x882f('0x1e')](function(_0x44af10){if(_0x44af10){return _0x44af10[_0x882f('0x6a')](_0x504ab7[_0x882f('0x3f')][_0x882f('0x66')]);}})[_0x882f('0x1e')](respondWithStatusCode(_0x263ca0,null))[_0x882f('0x28')](handleError(_0x263ca0,null));};exports[_0x882f('0x6b')]=function(_0x5cc7b9,_0x720815,_0x39a1c2){var _0x1e23c2={'body':_0x5cc7b9[_0x882f('0x57')],'channel':_0x882f('0x6c')};var _0x50130a=[];var _0x2aee38=[];var _0x330245={};var _0x51f81=![];return db[_0x882f('0x6d')][_0x882f('0x5e')]()['then'](function(_0x4c845b){if(!_0x4c845b){throw new db['Sequelize'][(_0x882f('0x6e'))](_0x882f('0x6f'));}_0x50130a=_[_0x882f('0x70')](_['keys'](_0x4c845b),[_0x882f('0x71'),_0x882f('0x72')]);_0x2aee38=_['difference'](_['keys'](_0x4c845b),[_0x882f('0x71'),_0x882f('0x72'),_0x882f('0x73'),_0x882f('0x74')]);if(_0x5cc7b9[_0x882f('0x57')]['id']){delete _0x5cc7b9['body']['id'];}if(_['isNil'](_0x5cc7b9[_0x882f('0x57')]['from'])){throw new db[(_0x882f('0x75'))][(_0x882f('0x6e'))](_0x882f('0x76'));}if(_[_0x882f('0x77')](_0x5cc7b9[_0x882f('0x57')]['body'])||_0x5cc7b9[_0x882f('0x57')][_0x882f('0x57')]===''){throw new db[(_0x882f('0x75'))][(_0x882f('0x6e'))](_0x882f('0x78'));}if(_['isNil'](_0x5cc7b9[_0x882f('0x57')]['mapKey'])){throw new db['Sequelize'][(_0x882f('0x6e'))](_0x882f('0x79')+_0x2aee38);}if(!_[_0x882f('0x7a')](_0x2aee38,_0x5cc7b9[_0x882f('0x57')]['mapKey'])){throw new db[(_0x882f('0x75'))][(_0x882f('0x6e'))](_0x882f('0x7b')+_0x2aee38);}_0x330245[_0x5cc7b9[_0x882f('0x57')][_0x882f('0x7c')]]=_0x5cc7b9[_0x882f('0x57')][_0x882f('0x7d')];})[_0x882f('0x1e')](function(){return db['OpenchannelAccount'][_0x882f('0x55')]({'where':{'id':_0x5cc7b9[_0x882f('0x51')]['id']},'include':[{'model':db[_0x882f('0x7e')],'as':_0x882f('0x7f'),'include':[{'model':db[_0x882f('0x6d')],'as':'Contacts','where':_0x330245,'limit':0x1,'order':[[_0x882f('0x72'),'DESC']]}]},{'model':db[_0x882f('0x80')],'as':_0x882f('0x81')}]});})[_0x882f('0x1e')](handleEntityNotFound(_0x720815,null))[_0x882f('0x1e')](function(_0x2fd3dc){if(_0x2fd3dc&&_0x2fd3dc[_0x882f('0x7f')]){_0x1e23c2['account']=_0x2fd3dc;_0x1e23c2[_0x882f('0x82')]=_0x2fd3dc[_0x882f('0x81')];_0x1e23c2[_0x882f('0x83')]=_0x2fd3dc[_0x882f('0x7f')];_0x1e23c2['applications']=_[_0x882f('0x84')](_0x1e23c2[_0x882f('0x82')],[_0x882f('0x85')],[_0x882f('0x86')]);if(_0x1e23c2['account'][_0x882f('0x81')]){delete _0x1e23c2[_0x882f('0x87')][_0x882f('0x81')];}if(_0x1e23c2[_0x882f('0x87')][_0x882f('0x7f')]&&_0x1e23c2['account'][_0x882f('0x7f')][_0x882f('0x88')][_0x882f('0x46')]){return _0x1e23c2[_0x882f('0x87')][_0x882f('0x7f')][_0x882f('0x88')][0x0];}var _0x1c8743=_[_0x882f('0x16')](_0x5cc7b9[_0x882f('0x57')],{'firstName':_0x5cc7b9[_0x882f('0x57')][_0x882f('0x7d')],'ListId':_0x2fd3dc['ListId']});_0x1c8743[_0x5cc7b9[_0x882f('0x57')][_0x882f('0x7c')]]=_0x5cc7b9['body'][_0x882f('0x7d')];return db[_0x882f('0x6d')][_0x882f('0x56')](_0x1c8743,{'fields':_0x50130a,'raw':!![]});}})[_0x882f('0x1e')](handleEntityNotFound(_0x720815,null))['then'](function(_0x5bd832){_0x1e23c2[_0x882f('0x89')]=_0x5bd832;if(_0x5bd832){var _0x4f0054={'ContactId':_0x5bd832['id'],'OpenchannelAccountId':_0x5cc7b9[_0x882f('0x51')]['id'],'from':(_0x5bd832['firstName']||'')+'\x20'+(_0x5bd832[_0x882f('0x8a')]||'')};var _0x481e59={'OpenchannelAccountId':_0x5cc7b9[_0x882f('0x51')]['id'],'closed':![]};if(_0x5cc7b9[_0x882f('0x57')][_0x882f('0x8b')]){_0x481e59['threadId']=_0x5cc7b9[_0x882f('0x57')][_0x882f('0x8b')];return db[_0x882f('0x8c')][_0x882f('0x55')]({'where':_0x481e59})[_0x882f('0x1e')](function(_0x1df88a){if(_0x1df88a){return[_0x1df88a,![]];}_0x4f0054['threadId']=_0x5cc7b9[_0x882f('0x57')]['threadId'];_0x4f0054[_0x882f('0x8d')]=_0x5cc7b9[_0x882f('0x57')]['externalUrl'];return db['OpenchannelInteraction']['create'](_0x4f0054)[_0x882f('0x1e')](function(_0x5b9fc6){return[_0x5b9fc6,!![]];});});}else{_0x481e59[_0x882f('0x8b')]=null;}_0x481e59[_0x882f('0x8e')]=_0x5bd832['id'];return db['OpenchannelInteraction'][_0x882f('0x55')]({'where':_0x481e59})['then'](function(_0x551753){if(_0x551753){return[_0x551753,![]];}return db['OpenchannelInteraction']['create'](_0x4f0054)[_0x882f('0x1e')](function(_0xf7d36){return[_0xf7d36,!![]];});});}})[_0x882f('0x8f')](function(_0x47c1be,_0x4281cd){if(_0x47c1be){_0x51f81=_0x4281cd;if(!_0x4281cd){var _0x47f49f={'from':(_0x1e23c2[_0x882f('0x89')][_0x882f('0x90')]||'')+'\x20'+(_0x1e23c2['contact'][_0x882f('0x8a')]||'')};if(_0x5cc7b9[_0x882f('0x57')]['threadId']&&_0x5cc7b9[_0x882f('0x57')][_0x882f('0x91')]&&_0x5cc7b9['body'][_0x882f('0x8b')]!=_0x5cc7b9[_0x882f('0x57')][_0x882f('0x91')]){_0x47f49f[_0x882f('0x8b')]=_0x5cc7b9[_0x882f('0x57')][_0x882f('0x91')];}return _0x47c1be[_0x882f('0x5d')](_0x47f49f);}else{return _0x47c1be;}}})[_0x882f('0x1e')](function(_0x4f3b97){_0x1e23c2[_0x882f('0x92')]=_0x4f3b97['get']({'plain':!![]});_0x1e23c2['interaction'][_0x882f('0x93')]=_0x51f81;if(_0x1e23c2[_0x882f('0x92')][_0x882f('0x93')]){if(_0x1e23c2[_0x882f('0x87')][_0x882f('0x94')]){_0x1e23c2[_0x882f('0x82')][_0x882f('0x95')]({'id':0x0,'priority':_0x1e23c2[_0x882f('0x82')][_0x882f('0x46')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x882f('0x96')});}}return db[_0x882f('0x97')][_0x882f('0x56')]({'body':_0x5cc7b9[_0x882f('0x57')][_0x882f('0x57')],'OpenchannelAccountId':_0x5cc7b9[_0x882f('0x51')]['id'],'OpenchannelInteractionId':_0x4f3b97['id'],'direction':'in','ContactId':_0x1e23c2[_0x882f('0x89')]['id'],'AttachmentId':_0x5cc7b9[_0x882f('0x57')][_0x882f('0x98')]});})[_0x882f('0x1e')](function(_0xde4c72){_0x1e23c2[_0x882f('0x25')]=_0xde4c72;if(!_0x1e23c2[_0x882f('0x92')][_0x882f('0x99')])return;return db[_0x882f('0x9a')][_0x882f('0x55')]({'attributes':['id','name'],'where':{'id':_0x1e23c2[_0x882f('0x92')][_0x882f('0x99')]}});})['then'](function(_0x15d926){if(_0x15d926){_0x1e23c2[_0x882f('0x82')][_0x882f('0x9b')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x15d926[_0x882f('0x37')]+','+(_0x1e23c2[_0x882f('0x87')][_0x882f('0x9c')]||0xa),'interval':_0x882f('0x96')});}if(!_0x1e23c2[_0x882f('0x92')][_0x882f('0x9d')])return;return db['OpenchannelQueue'][_0x882f('0x55')]({'attributes':['id',_0x882f('0x37')],'where':{'id':_0x1e23c2[_0x882f('0x92')][_0x882f('0x9d')]}});})['then'](function(_0xc95d04){if(_0xc95d04){_0x1e23c2['applications'][_0x882f('0x9b')]({'id':0x0,'priority':0x1,'app':_0x882f('0x9e'),'appdata':_0xc95d04[_0x882f('0x37')]+','+(_0x1e23c2[_0x882f('0x87')][_0x882f('0x9f')]||0x12c),'interval':_0x882f('0x96')});}return respondWithRpcPromise(_0x882f('0xa0'),'startRouting',_0x1e23c2);})[_0x882f('0x1e')](function(_0x23f7cb){respondWithRpcPromise('EventManager',_0x882f('0xa1'),{'event':_0x882f('0x6b'),'message':_0x23f7cb},client9002);return _0x23f7cb;})[_0x882f('0x1e')](respondWithResult(_0x720815,null))[_0x882f('0x28')](handleError(_0x720815,null));};exports[_0x882f('0xa2')]=function(_0x2a84bd,_0xb1e968){var _0x10e6c1=_0x2a84bd[_0x882f('0x51')]['id'];var _0x22e98b=_0x2a84bd['body'];var _0x17cf80=0xc8;var _0x2cac3d=null;return db[_0x882f('0xa3')]['transaction']({'isolationLevel':db[_0x882f('0xa3')][_0x882f('0xa4')][_0x882f('0xa5')]['READ_COMMITTED']},function(_0x202392){return db[_0x882f('0x3c')][_0x882f('0x60')]({'where':{'id':_0x10e6c1},'transaction':_0x202392})[_0x882f('0x1e')](function(_0x368d27){if(_0x368d27){return db['OpenchannelApplication'][_0x882f('0x33')]({'where':{'OpenchannelAccountId':_0x10e6c1},'transaction':_0x202392})[_0x882f('0x1e')](function(){var _0x503664=_[_0x882f('0x3b')](_0x22e98b,function(_0x1db800){_0x1db800[_0x882f('0x64')]=_0x10e6c1;return _0x1db800;});return db[_0x882f('0x80')][_0x882f('0xa6')](_0x503664,{'transaction':_0x202392});});}else{_0x17cf80=0x194;_0x2cac3d=[];}});})['then'](function(){if(_0x17cf80!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x10e6c1},'order':'priority'})[_0x882f('0x1e')](function(_0x5f4c85){_0x2cac3d=_0x5f4c85;});}})[_0x882f('0x28')](function(_0x338311){_0x17cf80=0x1f4;logger[_0x882f('0x23')](_0x338311[_0x882f('0xa7')]);if(_0x338311[_0x882f('0x37')]){delete _0x338311[_0x882f('0x37')];}_0x2cac3d=_0x338311;})[_0x882f('0xa8')](function(){if(_0x2cac3d===null){_0xb1e968['sendStatus'](_0x17cf80);}else{if(_0x17cf80===0x1f4){_0xb1e968[_0x882f('0x29')](_0x17cf80)[_0x882f('0x38')](_0x2cac3d);}else{_0xb1e968[_0x882f('0x29')](_0x17cf80)[_0x882f('0x2b')](_0x2cac3d);}}});};exports['getApplications']=function(_0x9d363c,_0x3a510a,_0x370b96){var _0x447989={};var _0x114277={};var _0x3c95d8;var _0x38620c;return db[_0x882f('0x3c')]['findOne']({'where':{'id':_0x9d363c[_0x882f('0x51')]['id']}})[_0x882f('0x1e')](handleEntityNotFound(_0x3a510a,null))[_0x882f('0x1e')](function(_0xe97864){if(_0xe97864){_0x3c95d8=_0xe97864;_0x114277[_0x882f('0x43')]=_[_0x882f('0x40')](db[_0x882f('0x80')]['rawAttributes']);_0x114277[_0x882f('0x3f')]=_[_0x882f('0x40')](_0x9d363c[_0x882f('0x3f')]);_0x114277['filters']=_[_0x882f('0x42')](_0x114277[_0x882f('0x43')],_0x114277[_0x882f('0x3f')]);_0x447989[_0x882f('0x44')]=_[_0x882f('0x42')](_0x114277[_0x882f('0x43')],qs['fields'](_0x9d363c[_0x882f('0x3f')][_0x882f('0x45')]));_0x447989[_0x882f('0x44')]=_0x447989[_0x882f('0x44')]['length']?_0x447989[_0x882f('0x44')]:_0x114277['model'];_0x447989[_0x882f('0x63')]=qs[_0x882f('0x47')](_0x9d363c[_0x882f('0x3f')]['sort']);_0x447989[_0x882f('0x49')]=qs[_0x882f('0x41')](_[_0x882f('0x48')](_0x9d363c[_0x882f('0x3f')],_0x114277[_0x882f('0x41')]));if(_0x9d363c['query']['filter']){_0x447989['where']=_[_0x882f('0x4a')](_0x447989[_0x882f('0x49')],{'$or':_[_0x882f('0x3b')](_0x447989[_0x882f('0x44')],function(_0x6ea58f){var _0x4397c7={};_0x4397c7[_0x6ea58f]={'$like':'%'+_0x9d363c[_0x882f('0x3f')]['filter']+'%'};return _0x4397c7;})});}_0x447989=_['merge']({},_0x447989,_0x9d363c['options']);return _0x3c95d8[_0x882f('0xa9')](_0x447989);}})[_0x882f('0x1e')](function(_0x40d4da){if(_0x40d4da){_0x38620c=_0x40d4da['length'];if(!_0x9d363c['query'][_0x882f('0x69')]('nolimit')){_0x447989[_0x882f('0x2e')]=qs[_0x882f('0x2e')](_0x9d363c[_0x882f('0x3f')][_0x882f('0x2e')]);_0x447989[_0x882f('0x2c')]=qs['offset'](_0x9d363c['query'][_0x882f('0x2c')]);}return _0x3c95d8['getApplications'](_0x447989);}})[_0x882f('0x1e')](function(_0x14b089){if(_0x14b089){return _0x14b089?{'count':_0x38620c,'rows':_0x14b089}:null;}})[_0x882f('0x1e')](respondWithResult(_0x3a510a,null))[_0x882f('0x28')](handleError(_0x3a510a,null));};exports[_0x882f('0xaa')]=function(_0x337e5e,_0x4e1758,_0x17304f){var _0x3c695c={'raw':![],'where':{}};var _0x1f2928={};var _0x2225f3={'count':0x0,'rows':[]};return db[_0x882f('0x3c')][_0x882f('0x60')]({'where':{'id':_0x337e5e[_0x882f('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e1758,null))[_0x882f('0x1e')](function(_0x2abc94){if(_0x2abc94){_0x1f2928[_0x882f('0x43')]=_[_0x882f('0x40')](db[_0x882f('0x8c')][_0x882f('0x53')]);_0x1f2928[_0x882f('0x3f')]=_[_0x882f('0x40')](_0x337e5e[_0x882f('0x3f')]);_0x1f2928[_0x882f('0x41')]=_[_0x882f('0x42')](_0x1f2928[_0x882f('0x43')],_0x1f2928[_0x882f('0x3f')]);_0x3c695c['attributes']=_['intersection'](_0x1f2928[_0x882f('0x43')],qs[_0x882f('0x45')](_0x337e5e[_0x882f('0x3f')][_0x882f('0x45')]));_0x3c695c['attributes']=_0x3c695c[_0x882f('0x44')][_0x882f('0x46')]?_0x3c695c[_0x882f('0x44')]:_0x1f2928['model'];if(!_0x337e5e['query'][_0x882f('0x69')]('nolimit')){_0x3c695c['limit']=qs[_0x882f('0x2e')](_0x337e5e[_0x882f('0x3f')][_0x882f('0x2e')]);_0x3c695c[_0x882f('0x2c')]=qs[_0x882f('0x2c')](_0x337e5e[_0x882f('0x3f')]['offset']);}_0x3c695c[_0x882f('0x63')]=qs[_0x882f('0x47')](_0x337e5e[_0x882f('0x3f')][_0x882f('0x47')]);_0x3c695c[_0x882f('0x49')]=qs[_0x882f('0x41')](_[_0x882f('0x48')](_0x337e5e[_0x882f('0x3f')],_0x1f2928['filters']));_0x3c695c[_0x882f('0x49')][_0x882f('0x64')]=_0x2abc94['id'];if(_0x337e5e[_0x882f('0x3f')][_0x882f('0x4b')]){_0x3c695c[_0x882f('0x49')]=_[_0x882f('0x4a')](_0x3c695c[_0x882f('0x49')],{'$or':_[_0x882f('0x3b')](_0x3c695c[_0x882f('0x44')],function(_0xce2311){var _0x9b6c59={};_0x9b6c59[_0xce2311]={'$like':'%'+_0x337e5e['query']['filter']+'%'};return _0x9b6c59;})});}_0x3c695c=_[_0x882f('0x4a')]({},_0x3c695c,_0x337e5e[_0x882f('0x4c')]);return db[_0x882f('0x8c')][_0x882f('0x2f')]({'where':_0x3c695c['where']})['then'](function(_0x4397f5){_0x2225f3['count']=_0x4397f5;if(_0x337e5e[_0x882f('0x3f')][_0x882f('0x4d')]){_0x3c695c['include']=[{'model':db[_0x882f('0x6d')],'as':_0x882f('0xab'),'required':![]},{'model':db['User'],'as':_0x882f('0xac'),'attributes':[_0x882f('0x37'),_0x882f('0xad'),_0x882f('0xae')],'required':![]},{'model':db[_0x882f('0xaf')],'as':_0x882f('0xb0'),'attributes':['id',_0x882f('0x37'),_0x882f('0xb1')],'where':_0x337e5e[_0x882f('0x3f')][_0x882f('0xb2')]?{'id':_0x337e5e['query']['tag']}:undefined,'required':_0x337e5e[_0x882f('0x3f')][_0x882f('0xb2')]?!![]:![]}];}return db[_0x882f('0x8c')][_0x882f('0x4e')](_0x3c695c);})[_0x882f('0x1e')](function(_0x42cc15){_0x2225f3[_0x882f('0x4f')]=_0x42cc15;return _0x2225f3;});}})[_0x882f('0x1e')](respondWithFilteredResult(_0x4e1758,_0x3c695c))[_0x882f('0x28')](handleError(_0x4e1758,null));};exports[_0x882f('0xb3')]=function(_0x205c2e,_0x5ab187,_0x392d5f){return db[_0x882f('0x3c')][_0x882f('0x55')]({'where':{'id':_0x205c2e[_0x882f('0x51')]['id']}})[_0x882f('0x1e')](handleEntityNotFound(_0x5ab187,null))['then'](function(_0x33a4d2){if(_0x33a4d2){return _0x33a4d2['addAgents'](_0x205c2e[_0x882f('0x57')][_0x882f('0x66')],_[_0x882f('0xb4')](_0x205c2e['body'],[_0x882f('0x66'),'id'])||{})[_0x882f('0x8f')](function(_0x3df7ea){for(var _0x1c27a5=0x0;_0x1c27a5<_0x205c2e['body'][_0x882f('0x66')][_0x882f('0x46')];_0x1c27a5+=0x1){socket[_0x882f('0xb5')](_0x882f('0xb6'),{'UserId':Number(_0x205c2e[_0x882f('0x57')][_0x882f('0x66')][_0x1c27a5]),'OpenchannelAccountId':Number(_0x205c2e[_0x882f('0x51')]['id'])});}return _0x3df7ea;});}})[_0x882f('0x1e')](respondWithResult(_0x5ab187,null))[_0x882f('0x28')](handleError(_0x5ab187,null));};exports[_0x882f('0xb7')]=function(_0x4944f0,_0x52962e,_0x1b4a6f){return db[_0x882f('0x3c')]['find']({'where':{'id':_0x4944f0[_0x882f('0x51')]['id']}})[_0x882f('0x1e')](handleEntityNotFound(_0x52962e,null))[_0x882f('0x1e')](function(_0x14fbb0){if(_0x14fbb0){return _0x14fbb0[_0x882f('0xb7')](_0x4944f0[_0x882f('0x3f')]['ids'])[_0x882f('0x1e')](function(){if(_['isArray'](_0x4944f0[_0x882f('0x3f')]['ids'])){for(var _0x141a94=0x0;_0x141a94<_0x4944f0[_0x882f('0x3f')][_0x882f('0x66')][_0x882f('0x46')];_0x141a94+=0x1){socket[_0x882f('0xb5')](_0x882f('0xb8'),{'UserId':Number(_0x4944f0[_0x882f('0x3f')][_0x882f('0x66')][_0x141a94]),'OpenchannelAccountId':Number(_0x4944f0[_0x882f('0x51')]['id'])});}}else{socket[_0x882f('0xb5')](_0x882f('0xb8'),{'UserId':Number(_0x4944f0[_0x882f('0x3f')]['ids']),'OpenchannelAccountId':Number(_0x4944f0['params']['id'])});}});}})[_0x882f('0x1e')](respondWithStatusCode(_0x52962e,null))[_0x882f('0x28')](handleError(_0x52962e,null));};exports[_0x882f('0xb9')]=function(_0x49e84f,_0x4f1862,_0x44cd0e){var _0x2c80d2={};var _0x4f69af={};var _0x3a2765;var _0x71b3cd;return db[_0x882f('0x3c')][_0x882f('0x60')]({'where':{'id':_0x49e84f['params']['id']}})[_0x882f('0x1e')](handleEntityNotFound(_0x4f1862,null))['then'](function(_0x257745){if(_0x257745){_0x3a2765=_0x257745;_0x4f69af[_0x882f('0x43')]=_[_0x882f('0x40')](db[_0x882f('0x9a')][_0x882f('0x53')]);_0x4f69af['query']=_[_0x882f('0x40')](_0x49e84f[_0x882f('0x3f')]);_0x4f69af[_0x882f('0x41')]=_['intersection'](_0x4f69af[_0x882f('0x43')],_0x4f69af[_0x882f('0x3f')]);_0x2c80d2[_0x882f('0x44')]=_['intersection'](_0x4f69af[_0x882f('0x43')],qs['fields'](_0x49e84f[_0x882f('0x3f')][_0x882f('0x45')]));_0x2c80d2[_0x882f('0x44')]=_0x2c80d2[_0x882f('0x44')][_0x882f('0x46')]?_0x2c80d2[_0x882f('0x44')]:_0x4f69af[_0x882f('0x43')];_0x2c80d2[_0x882f('0x63')]=qs[_0x882f('0x47')](_0x49e84f[_0x882f('0x3f')][_0x882f('0x47')]);_0x2c80d2[_0x882f('0x49')]=qs[_0x882f('0x41')](_[_0x882f('0x48')](_0x49e84f[_0x882f('0x3f')],_0x4f69af[_0x882f('0x41')]));if(_0x49e84f[_0x882f('0x3f')][_0x882f('0x4b')]){_0x2c80d2[_0x882f('0x49')]=_[_0x882f('0x4a')](_0x2c80d2['where'],{'$or':_[_0x882f('0x3b')](_0x2c80d2['attributes'],function(_0x2074de){var _0x5ac169={};_0x5ac169[_0x2074de]={'$like':'%'+_0x49e84f[_0x882f('0x3f')][_0x882f('0x4b')]+'%'};return _0x5ac169;})});}_0x2c80d2=_[_0x882f('0x4a')]({},_0x2c80d2,_0x49e84f[_0x882f('0x4c')]);return _0x3a2765['getAgents'](_0x2c80d2);}})[_0x882f('0x1e')](function(_0x8de575){if(_0x8de575){_0x71b3cd=_0x8de575[_0x882f('0x46')];if(!_0x49e84f['query'][_0x882f('0x69')](_0x882f('0x62'))){_0x2c80d2[_0x882f('0x2e')]=qs['limit'](_0x49e84f['query'][_0x882f('0x2e')]);_0x2c80d2[_0x882f('0x2c')]=qs[_0x882f('0x2c')](_0x49e84f[_0x882f('0x3f')][_0x882f('0x2c')]);}return _0x3a2765[_0x882f('0xb9')](_0x2c80d2);}})[_0x882f('0x1e')](function(_0x21d7e4){if(_0x21d7e4){return _0x21d7e4?{'count':_0x71b3cd,'rows':_0x21d7e4}:null;}})[_0x882f('0x1e')](respondWithResult(_0x4f1862,null))[_0x882f('0x28')](handleError(_0x4f1862,null));};exports['send']=function(_0x53e935,_0x4f63bb,_0x2c8a6e){var _0x336a52,_0x54982c,_0x4929de;if(_[_0x882f('0x77')](_0x53e935[_0x882f('0x57')][_0x882f('0x57')])||_0x53e935['body'][_0x882f('0x57')]===''){throw new db['Sequelize'][(_0x882f('0x6e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x882f('0x77')](_0x53e935[_0x882f('0x57')]['to'])){}_0x336a52=_0x53e935[_0x882f('0x57')]['to'];return db['OpenchannelAccount'][_0x882f('0x60')]({'where':{'id':_0x53e935[_0x882f('0x51')]['id']}})[_0x882f('0x1e')](handleEntityNotFound(_0x4f63bb,null))[_0x882f('0x1e')](function(_0x33e2c3){if(_0x33e2c3){return db[_0x882f('0x3c')][_0x882f('0x55')]({'where':{'id':_0x33e2c3['id']},'include':[{'model':db['CmList'],'as':_0x882f('0x7f'),'include':[{'model':db['CmContact'],'as':_0x882f('0x88'),'where':{[_0x33e2c3[_0x882f('0x7c')]]:_0x336a52},'limit':0x1,'order':[[_0x882f('0x72'),_0x882f('0xba')]]}]}]})['then'](handleEntityNotFound(_0x4f63bb,null))[_0x882f('0x1e')](function(_0x3ac833){if(_0x3ac833&&_0x3ac833[_0x882f('0x7f')]){_0x54982c=_0x3ac833[_0x882f('0x34')]({'plain':!![]});if(_0x54982c['List']&&_0x54982c[_0x882f('0x7f')]['Contacts'][_0x882f('0x46')]){return _0x54982c[_0x882f('0x7f')]['Contacts'][0x0];}return db[_0x882f('0x6d')][_0x882f('0x56')](_[_0x882f('0x16')](_0x53e935[_0x882f('0x57')],{'firstName':_0x336a52,[_0x3ac833[_0x882f('0x7c')]]:_0x336a52,'phone':_0x336a52,'ListId':_0x54982c[_0x882f('0x74')]}));}})[_0x882f('0x1e')](handleEntityNotFound(_0x4f63bb,null))['then'](function(_0x33c81){if(_0x33c81){_0x4929de=_0x33c81;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x4929de['id'],'closed':![],'OpenchannelAccountId':_0x54982c['id']}})[_0x882f('0x1e')](function(_0x5b96df){if(_0x5b96df){return[_0x5b96df,![]];}return db[_0x882f('0x8c')][_0x882f('0x56')]({'UserId':_0x53e935[_0x882f('0x58')]['id'],'ContactId':_0x4929de['id'],'OpenchannelAccountId':_0x54982c['id'],'lastMsgDirection':'out','firstMsgDirection':_0x882f('0xbb'),'Messages':[_['merge'](_0x53e935[_0x882f('0x57')],{'read':![],'body':_0x53e935['body'][_0x882f('0x57')],'OpenchannelAccountId':_0x54982c['id'],'UserId':_0x53e935[_0x882f('0x58')]['id'],'ContactId':_0x4929de['id']})]},{'include':[{'model':db[_0x882f('0x97')],'as':_0x882f('0xbc')}]})[_0x882f('0x1e')](function(_0x4142f4){return[_0x4142f4,!![]];});});}})['spread'](function(_0x412cfc,_0x38fbcd){if(_0x38fbcd){return _0x412cfc;}return db['OpenchannelMessage'][_0x882f('0x56')](_[_0x882f('0x4a')](_0x53e935[_0x882f('0x57')],{'read':![],'body':_0x53e935[_0x882f('0x57')][_0x882f('0x57')],'OpenchannelAccountId':_0x54982c['id'],'OpenchannelInteractionId':_0x412cfc['id'],'UserId':_0x53e935[_0x882f('0x58')]['id'],'ContactId':_0x4929de['id']}))[_0x882f('0x1e')](function(_0x2bf936){_0x412cfc[_0x882f('0xbd')]['Messages']=[];_0x412cfc[_0x882f('0xbd')]['Messages']['push'](_0x2bf936[_0x882f('0xbd')]);return _0x412cfc;});});}})['then'](respondWithResult(_0x4f63bb,null))[_0x882f('0x28')](handleError(_0x4f63bb,null));}; \ No newline at end of file +var _0xed20=['omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','client','http','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','code','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','save','then','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','findAll','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','update','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','notify','openchannel','ValidationError','difference','createdAt','updatedAt','ListId','isNil','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','lastName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','queueId','OpenchannelQueue','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','User','Owner','fullname','internal','Tag','Tags','color','tag','rows','addAgents'];(function(_0x455aae,_0x1aa375){var _0x31bbef=function(_0x2fe31b){while(--_0x2fe31b){_0x455aae['push'](_0x455aae['shift']());}};_0x31bbef(++_0x1aa375);}(_0xed20,0xce));var _0x0ed2=function(_0x4ffc17,_0x17b58f){_0x4ffc17=_0x4ffc17-0x0;var _0x5534bf=_0xed20[_0x4ffc17];return _0x5534bf;};'use strict';var emlformat=require(_0x0ed2('0x0'));var rimraf=require(_0x0ed2('0x1'));var zipdir=require(_0x0ed2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ed2('0x3'));var moment=require(_0x0ed2('0x4'));var BPromise=require(_0x0ed2('0x5'));var Mustache=require(_0x0ed2('0x6'));var util=require(_0x0ed2('0x7'));var path=require(_0x0ed2('0x8'));var sox=require('sox');var csv=require(_0x0ed2('0x9'));var ejs=require(_0x0ed2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ed2('0xb'));var squel=require(_0x0ed2('0xc'));var crypto=require(_0x0ed2('0xd'));var jsforce=require(_0x0ed2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0ed2('0x9'));var querystring=require(_0x0ed2('0xf'));var Papa=require(_0x0ed2('0x10'));var Redis=require(_0x0ed2('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0ed2('0x12'));var hardwareService=require(_0x0ed2('0x13'));var logger=require(_0x0ed2('0x14'))(_0x0ed2('0x15'));var utils=require(_0x0ed2('0x16'));var config=require(_0x0ed2('0x17'));var licenseUtil=require(_0x0ed2('0x18'));var db=require(_0x0ed2('0x19'))['db'];config[_0x0ed2('0x1a')]=_[_0x0ed2('0x1b')](config[_0x0ed2('0x1a')],{'host':_0x0ed2('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0ed2('0x1a')]));require(_0x0ed2('0x1d'))[_0x0ed2('0x1e')](socket);var jayson=require(_0x0ed2('0x1f'));var client=jayson[_0x0ed2('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x0ed2('0x20')][_0x0ed2('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x350995,_0x5101f2,_0x41bea7,_0x565cc7){return new BPromise(function(_0x225e4a,_0x12a54d){var _0xc0f621=_0x565cc7||client;return _0xc0f621['request'](_0x350995,_0x41bea7)['then'](function(_0x90b88e){logger[_0x0ed2('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x5101f2,_0x0ed2('0x23'));logger['debug'](_0x0ed2('0x24'),_0x5101f2,_0x0ed2('0x23'),JSON['stringify'](_0x90b88e));if(_0x90b88e['error']){if(_0x90b88e['error'][_0x0ed2('0x25')]===0x1f4){logger[_0x0ed2('0x26')](_0x0ed2('0x27'),_0x5101f2,_0x90b88e[_0x0ed2('0x26')][_0x0ed2('0x28')]);return _0x12a54d(_0x90b88e[_0x0ed2('0x26')][_0x0ed2('0x28')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5101f2,_0x90b88e[_0x0ed2('0x26')][_0x0ed2('0x28')]);return _0x225e4a(_0x90b88e[_0x0ed2('0x26')][_0x0ed2('0x28')]);}else{logger[_0x0ed2('0x22')](_0x0ed2('0x27'),_0x5101f2,_0x0ed2('0x23'));_0x225e4a(_0x90b88e[_0x0ed2('0x29')]['message']);}})[_0x0ed2('0x2a')](function(_0x24983e){logger[_0x0ed2('0x26')](_0x0ed2('0x27'),_0x5101f2,_0x24983e);_0x12a54d(_0x24983e);});});}function respondWithStatusCode(_0x466b49,_0x5bb903){_0x5bb903=_0x5bb903||0xcc;return function(_0x14c0e6){if(_0x14c0e6){return _0x466b49[_0x0ed2('0x2b')](_0x5bb903);}return _0x466b49[_0x0ed2('0x2c')](_0x5bb903)[_0x0ed2('0x2d')]();};}function respondWithResult(_0x2faa62,_0xe5cacc){_0xe5cacc=_0xe5cacc||0xc8;return function(_0x194380){if(_0x194380){return _0x2faa62[_0x0ed2('0x2c')](_0xe5cacc)[_0x0ed2('0x2e')](_0x194380);}};}function respondWithFilteredResult(_0x1e6efe,_0x597c6e){return function(_0x3bc558){if(_0x3bc558){var _0x5e9d4d=typeof _0x597c6e['offset']===_0x0ed2('0x2f')&&typeof _0x597c6e[_0x0ed2('0x30')]===_0x0ed2('0x2f');var _0x236c7a=_0x3bc558[_0x0ed2('0x31')];var _0xc0c69a=_0x5e9d4d?0x0:_0x597c6e['offset'];var _0x5d8394=_0x5e9d4d?_0x3bc558['count']:_0x597c6e[_0x0ed2('0x32')]+_0x597c6e[_0x0ed2('0x30')];var _0x41543f;if(_0x5d8394>=_0x236c7a){_0x5d8394=_0x236c7a;_0x41543f=0xc8;}else{_0x41543f=0xce;}_0x1e6efe[_0x0ed2('0x2c')](_0x41543f);return _0x1e6efe['set'](_0x0ed2('0x33'),_0xc0c69a+'-'+_0x5d8394+'/'+_0x236c7a)['json'](_0x3bc558);}return null;};}function patchUpdates(_0x43eb53){return function(_0x793700){try{jsonpatch['apply'](_0x793700,_0x43eb53,!![]);}catch(_0x1fdfb2){return BPromise['reject'](_0x1fdfb2);}return _0x793700[_0x0ed2('0x34')]();};}function saveUpdates(_0x541793,_0x1ddff5){return function(_0x3bdf05){if(_0x3bdf05){return _0x3bdf05['update'](_0x541793)[_0x0ed2('0x35')](function(_0x67087a){return _0x67087a;});}return null;};}function removeEntity(_0x4f942a,_0x360205){return function(_0x375dcb){if(_0x375dcb){return _0x375dcb[_0x0ed2('0x36')]()[_0x0ed2('0x35')](function(){var _0x146f13=_0x375dcb[_0x0ed2('0x37')]({'plain':!![]});var _0x3fb9a8=_0x0ed2('0x38');return db[_0x0ed2('0x39')][_0x0ed2('0x36')]({'where':{'type':_0x3fb9a8,'resourceId':_0x146f13['id']}})[_0x0ed2('0x35')](function(){return _0x375dcb;});})[_0x0ed2('0x35')](function(){_0x4f942a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x11bb54,_0x5b022a){return function(_0x39c8f3){if(!_0x39c8f3){_0x11bb54[_0x0ed2('0x2b')](0x194);}return _0x39c8f3;};}function handleError(_0x23526d,_0x1a6553){_0x1a6553=_0x1a6553||0x1f4;return function(_0x344661){logger['error'](_0x344661[_0x0ed2('0x3a')]);if(_0x344661[_0x0ed2('0x3b')]){delete _0x344661[_0x0ed2('0x3b')];}_0x23526d[_0x0ed2('0x2c')](_0x1a6553)[_0x0ed2('0x3c')](_0x344661);};}exports[_0x0ed2('0x3d')]=function(_0x33f001,_0x5b9c67){var _0x53c4eb={'include':[{'model':db[_0x0ed2('0x3e')],'as':_0x0ed2('0x3f')}]},_0x582bf4={},_0x2b7099={'count':0x0,'rows':[]};var _0x5606d7=_[_0x0ed2('0x40')](db['OpenchannelAccount'][_0x0ed2('0x41')],function(_0x3aaba6){return{'name':_0x3aaba6[_0x0ed2('0x42')],'type':_0x3aaba6[_0x0ed2('0x43')][_0x0ed2('0x44')]};});_0x582bf4[_0x0ed2('0x45')]=_[_0x0ed2('0x40')](_0x5606d7,'name');_0x582bf4['query']=_[_0x0ed2('0x46')](_0x33f001['query']);_0x582bf4[_0x0ed2('0x47')]=_[_0x0ed2('0x48')](_0x582bf4['model'],_0x582bf4[_0x0ed2('0x49')]);_0x53c4eb[_0x0ed2('0x4a')]=_['intersection'](_0x582bf4[_0x0ed2('0x45')],qs[_0x0ed2('0x4b')](_0x33f001['query'][_0x0ed2('0x4b')]));_0x53c4eb['attributes']=_0x53c4eb[_0x0ed2('0x4a')][_0x0ed2('0x4c')]?_0x53c4eb[_0x0ed2('0x4a')]:_0x582bf4['model'];if(!_0x33f001['query'][_0x0ed2('0x4d')](_0x0ed2('0x4e'))){_0x53c4eb[_0x0ed2('0x30')]=qs[_0x0ed2('0x30')](_0x33f001['query']['limit']);_0x53c4eb[_0x0ed2('0x32')]=qs['offset'](_0x33f001[_0x0ed2('0x49')][_0x0ed2('0x32')]);}_0x53c4eb[_0x0ed2('0x4f')]=qs[_0x0ed2('0x50')](_0x33f001[_0x0ed2('0x49')]['sort']);_0x53c4eb[_0x0ed2('0x51')]=qs[_0x0ed2('0x47')](_['pick'](_0x33f001[_0x0ed2('0x49')],_0x582bf4['filters']),_0x5606d7);if(_0x33f001['query'][_0x0ed2('0x52')]){_0x53c4eb[_0x0ed2('0x51')]=_[_0x0ed2('0x53')](_0x53c4eb[_0x0ed2('0x51')],{'$or':_[_0x0ed2('0x40')](_0x5606d7,function(_0x56ee63){if(_0x56ee63['type']!==_0x0ed2('0x54')){var _0xa9d87b={};_0xa9d87b[_0x56ee63[_0x0ed2('0x3b')]]={'$like':'%'+_0x33f001[_0x0ed2('0x49')][_0x0ed2('0x52')]+'%'};return _0xa9d87b;}})});}_0x53c4eb=_[_0x0ed2('0x53')]({},_0x53c4eb,_0x33f001[_0x0ed2('0x55')]);var _0x6b3269={'where':_0x53c4eb[_0x0ed2('0x51')]};return db[_0x0ed2('0x56')][_0x0ed2('0x31')](_0x6b3269)[_0x0ed2('0x35')](function(_0x42b808){_0x2b7099[_0x0ed2('0x31')]=_0x42b808;if(_0x33f001[_0x0ed2('0x49')][_0x0ed2('0x57')]){_0x53c4eb[_0x0ed2('0x58')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x0ed2('0x59')](_0x53c4eb);})[_0x0ed2('0x35')](function(_0x204460){_0x2b7099['rows']=_0x204460;return _0x2b7099;})[_0x0ed2('0x35')](respondWithFilteredResult(_0x5b9c67,_0x53c4eb))['catch'](handleError(_0x5b9c67,null));};exports[_0x0ed2('0x5a')]=function(_0x4df275,_0x3114d8){var _0x19ced0={'raw':![],'where':{'id':_0x4df275[_0x0ed2('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1e44c8={};_0x1e44c8[_0x0ed2('0x45')]=_['keys'](db[_0x0ed2('0x56')][_0x0ed2('0x41')]);_0x1e44c8[_0x0ed2('0x49')]=_['keys'](_0x4df275[_0x0ed2('0x49')]);_0x1e44c8['filters']=_[_0x0ed2('0x48')](_0x1e44c8[_0x0ed2('0x45')],_0x1e44c8[_0x0ed2('0x49')]);_0x19ced0[_0x0ed2('0x4a')]=_[_0x0ed2('0x48')](_0x1e44c8[_0x0ed2('0x45')],qs[_0x0ed2('0x4b')](_0x4df275[_0x0ed2('0x49')]['fields']));_0x19ced0[_0x0ed2('0x4a')]=_0x19ced0[_0x0ed2('0x4a')][_0x0ed2('0x4c')]?_0x19ced0[_0x0ed2('0x4a')]:_0x1e44c8[_0x0ed2('0x45')];if(_0x4df275[_0x0ed2('0x49')][_0x0ed2('0x57')]){_0x19ced0[_0x0ed2('0x58')]=[{'all':!![]}];}_0x19ced0=_[_0x0ed2('0x53')]({},_0x19ced0,_0x4df275[_0x0ed2('0x55')]);return db['OpenchannelAccount'][_0x0ed2('0x5c')](_0x19ced0)[_0x0ed2('0x35')](handleEntityNotFound(_0x3114d8,null))[_0x0ed2('0x35')](respondWithResult(_0x3114d8,null))[_0x0ed2('0x2a')](handleError(_0x3114d8,null));};exports[_0x0ed2('0x5d')]=function(_0x20f990,_0x3489cf){return db[_0x0ed2('0x56')][_0x0ed2('0x5d')](_0x20f990[_0x0ed2('0x5e')],{})[_0x0ed2('0x35')](function(_0x4e8794){var _0x18a0e7=_0x20f990['user']['get']({'plain':!![]});if(!_0x18a0e7)throw new Error(_0x0ed2('0x5f'));if(_0x18a0e7['role']===_0x0ed2('0x60')){var _0x46b804=_0x4e8794['get']({'plain':!![]});var _0x37c599='OpenchannelAccounts';return db[_0x0ed2('0x61')][_0x0ed2('0x5c')]({'where':{'name':_0x37c599,'userProfileId':_0x18a0e7[_0x0ed2('0x62')]},'raw':!![]})[_0x0ed2('0x35')](function(_0x3c1854){if(_0x3c1854&&_0x3c1854[_0x0ed2('0x63')]===0x0){return db['UserProfileResource'][_0x0ed2('0x5d')]({'name':_0x46b804[_0x0ed2('0x3b')],'resourceId':_0x46b804['id'],'type':_0x3c1854['name'],'sectionId':_0x3c1854['id']},{})[_0x0ed2('0x35')](function(){return _0x4e8794;});}else{return _0x4e8794;}})[_0x0ed2('0x2a')](function(_0x21628f){logger[_0x0ed2('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x21628f);throw _0x21628f;});}return _0x4e8794;})[_0x0ed2('0x35')](respondWithResult(_0x3489cf,0xc9))['catch'](handleError(_0x3489cf,null));};exports[_0x0ed2('0x64')]=function(_0x4b4f0e,_0x2f2ec2){if(_0x4b4f0e[_0x0ed2('0x5e')]['id']){delete _0x4b4f0e['body']['id'];}return db[_0x0ed2('0x56')][_0x0ed2('0x5c')]({'where':{'id':_0x4b4f0e[_0x0ed2('0x5b')]['id']},'include':[{'model':db[_0x0ed2('0x3e')],'as':_0x0ed2('0x3f')}]})[_0x0ed2('0x35')](handleEntityNotFound(_0x2f2ec2,null))[_0x0ed2('0x35')](saveUpdates(_0x4b4f0e[_0x0ed2('0x5e')],null))[_0x0ed2('0x35')](respondWithResult(_0x2f2ec2,null))[_0x0ed2('0x2a')](handleError(_0x2f2ec2,null));};exports[_0x0ed2('0x36')]=function(_0x526a8a,_0x525330){return db['OpenchannelAccount'][_0x0ed2('0x5c')]({'where':{'id':_0x526a8a[_0x0ed2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x525330,null))[_0x0ed2('0x35')](removeEntity(_0x525330,null))[_0x0ed2('0x2a')](handleError(_0x525330,null));};exports[_0x0ed2('0x65')]=function(_0x422dba,_0x1745a6){return db['OpenchannelAccount']['describe']()[_0x0ed2('0x35')](respondWithResult(_0x1745a6,null))[_0x0ed2('0x2a')](handleError(_0x1745a6,null));};exports['addDisposition']=function(_0x154691,_0x4dbfdd,_0x563456){if(_0x154691[_0x0ed2('0x5e')]['id']){delete _0x154691[_0x0ed2('0x5e')]['id'];}return db[_0x0ed2('0x56')]['find']({'where':{'id':_0x154691[_0x0ed2('0x5b')]['id']}})[_0x0ed2('0x35')](handleEntityNotFound(_0x4dbfdd,null))[_0x0ed2('0x35')](function(_0x5526bb){if(_0x5526bb){_0x154691['body'][_0x0ed2('0x66')]=_0x5526bb['id'];return db[_0x0ed2('0x67')][_0x0ed2('0x5d')](_0x154691[_0x0ed2('0x5e')]);}})[_0x0ed2('0x35')](respondWithResult(_0x4dbfdd,null))['catch'](handleError(_0x4dbfdd,null));};exports[_0x0ed2('0x68')]=function(_0x542e9c,_0x4144b9,_0x185f86){var _0x5a18b8={'raw':![],'where':{}};var _0xff65dd={};var _0x1d22b8={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x0ed2('0x69')]({'where':{'id':_0x542e9c[_0x0ed2('0x5b')]['id']}})[_0x0ed2('0x35')](handleEntityNotFound(_0x4144b9,null))[_0x0ed2('0x35')](function(_0x4c166b){if(_0x4c166b){_0xff65dd['model']=_[_0x0ed2('0x46')](db[_0x0ed2('0x67')]['rawAttributes']);_0xff65dd['query']=_['keys'](_0x542e9c['query']);_0xff65dd[_0x0ed2('0x47')]=_[_0x0ed2('0x48')](_0xff65dd[_0x0ed2('0x45')],_0xff65dd[_0x0ed2('0x49')]);_0x5a18b8[_0x0ed2('0x4a')]=_[_0x0ed2('0x48')](_0xff65dd[_0x0ed2('0x45')],qs['fields'](_0x542e9c[_0x0ed2('0x49')]['fields']));_0x5a18b8['attributes']=_0x5a18b8[_0x0ed2('0x4a')][_0x0ed2('0x4c')]?_0x5a18b8['attributes']:_0xff65dd[_0x0ed2('0x45')];if(!_0x542e9c[_0x0ed2('0x49')][_0x0ed2('0x4d')](_0x0ed2('0x4e'))){_0x5a18b8['limit']=qs[_0x0ed2('0x30')](_0x542e9c[_0x0ed2('0x49')][_0x0ed2('0x30')]);_0x5a18b8[_0x0ed2('0x32')]=qs[_0x0ed2('0x32')](_0x542e9c[_0x0ed2('0x49')][_0x0ed2('0x32')]);}_0x5a18b8[_0x0ed2('0x4f')]=qs[_0x0ed2('0x50')](_0x542e9c[_0x0ed2('0x49')][_0x0ed2('0x50')]);_0x5a18b8[_0x0ed2('0x51')]=qs[_0x0ed2('0x47')](_['pick'](_0x542e9c[_0x0ed2('0x49')],_0xff65dd[_0x0ed2('0x47')]));_0x5a18b8[_0x0ed2('0x51')][_0x0ed2('0x66')]=_0x4c166b['id'];if(_0x542e9c['query'][_0x0ed2('0x52')]){_0x5a18b8[_0x0ed2('0x51')]=_[_0x0ed2('0x53')](_0x5a18b8[_0x0ed2('0x51')],{'$or':_[_0x0ed2('0x40')](_0x5a18b8[_0x0ed2('0x4a')],function(_0x5d0d65){var _0x403417={};_0x403417[_0x5d0d65]={'$like':'%'+_0x542e9c['query']['filter']+'%'};return _0x403417;})});}_0x5a18b8=_[_0x0ed2('0x53')]({},_0x5a18b8,_0x542e9c[_0x0ed2('0x55')]);return db[_0x0ed2('0x67')][_0x0ed2('0x31')]({'where':_0x5a18b8[_0x0ed2('0x51')]})[_0x0ed2('0x35')](function(_0x4b9052){_0x1d22b8[_0x0ed2('0x31')]=_0x4b9052;if(_0x542e9c['query']['includeAll']){_0x5a18b8['include']=[{'all':!![]}];}return db['Disposition'][_0x0ed2('0x59')](_0x5a18b8);})[_0x0ed2('0x35')](function(_0x589c01){_0x1d22b8['rows']=_0x589c01;return _0x1d22b8;});}})[_0x0ed2('0x35')](respondWithFilteredResult(_0x4144b9,_0x5a18b8))['catch'](handleError(_0x4144b9,null));};exports[_0x0ed2('0x6a')]=function(_0x1b4eb6,_0x478ffa,_0x2100bc){return db[_0x0ed2('0x56')][_0x0ed2('0x5c')]({'where':{'id':_0x1b4eb6[_0x0ed2('0x5b')]['id']}})[_0x0ed2('0x35')](handleEntityNotFound(_0x478ffa,null))[_0x0ed2('0x35')](function(_0x4cd219){if(_0x4cd219){return _0x4cd219['removeDispositions'](_0x1b4eb6['query'][_0x0ed2('0x6b')]);}})[_0x0ed2('0x35')](respondWithStatusCode(_0x478ffa,null))[_0x0ed2('0x2a')](handleError(_0x478ffa,null));};exports[_0x0ed2('0x6c')]=function(_0x287675,_0x964d49,_0x2e35e5){if(_0x287675[_0x0ed2('0x5e')]['id']){delete _0x287675[_0x0ed2('0x5e')]['id'];}return db['OpenchannelAccount'][_0x0ed2('0x5c')]({'where':{'id':_0x287675[_0x0ed2('0x5b')]['id']}})[_0x0ed2('0x35')](handleEntityNotFound(_0x964d49,null))[_0x0ed2('0x35')](function(_0x34de3c){if(_0x34de3c){_0x287675[_0x0ed2('0x5e')][_0x0ed2('0x66')]=_0x34de3c['id'];return db[_0x0ed2('0x6d')][_0x0ed2('0x5d')](_0x287675['body']);}})[_0x0ed2('0x35')](respondWithResult(_0x964d49,null))[_0x0ed2('0x2a')](handleError(_0x964d49,null));};exports[_0x0ed2('0x6e')]=function(_0x58fbd,_0x3356f8,_0x588e70){var _0x2722d0={'raw':![],'where':{}};var _0x2c7329={};var _0x3dff8e={'count':0x0,'rows':[]};return db[_0x0ed2('0x56')][_0x0ed2('0x69')]({'where':{'id':_0x58fbd[_0x0ed2('0x5b')]['id']}})[_0x0ed2('0x35')](handleEntityNotFound(_0x3356f8,null))[_0x0ed2('0x35')](function(_0x4d4b79){if(_0x4d4b79){_0x2c7329[_0x0ed2('0x45')]=_[_0x0ed2('0x46')](db['CannedAnswer'][_0x0ed2('0x41')]);_0x2c7329[_0x0ed2('0x49')]=_['keys'](_0x58fbd[_0x0ed2('0x49')]);_0x2c7329['filters']=_[_0x0ed2('0x48')](_0x2c7329[_0x0ed2('0x45')],_0x2c7329[_0x0ed2('0x49')]);_0x2722d0[_0x0ed2('0x4a')]=_[_0x0ed2('0x48')](_0x2c7329[_0x0ed2('0x45')],qs[_0x0ed2('0x4b')](_0x58fbd[_0x0ed2('0x49')][_0x0ed2('0x4b')]));_0x2722d0[_0x0ed2('0x4a')]=_0x2722d0['attributes'][_0x0ed2('0x4c')]?_0x2722d0[_0x0ed2('0x4a')]:_0x2c7329[_0x0ed2('0x45')];if(!_0x58fbd[_0x0ed2('0x49')][_0x0ed2('0x4d')](_0x0ed2('0x4e'))){_0x2722d0[_0x0ed2('0x30')]=qs[_0x0ed2('0x30')](_0x58fbd[_0x0ed2('0x49')][_0x0ed2('0x30')]);_0x2722d0[_0x0ed2('0x32')]=qs[_0x0ed2('0x32')](_0x58fbd[_0x0ed2('0x49')][_0x0ed2('0x32')]);}_0x2722d0['order']=qs['sort'](_0x58fbd[_0x0ed2('0x49')][_0x0ed2('0x50')]);_0x2722d0[_0x0ed2('0x51')]=qs[_0x0ed2('0x47')](_[_0x0ed2('0x6f')](_0x58fbd[_0x0ed2('0x49')],_0x2c7329[_0x0ed2('0x47')]));_0x2722d0[_0x0ed2('0x51')][_0x0ed2('0x66')]=_0x4d4b79['id'];if(_0x58fbd['query']['filter']){_0x2722d0[_0x0ed2('0x51')]=_[_0x0ed2('0x53')](_0x2722d0[_0x0ed2('0x51')],{'$or':_[_0x0ed2('0x40')](_0x2722d0[_0x0ed2('0x4a')],function(_0x1154f1){var _0x2eb468={};_0x2eb468[_0x1154f1]={'$like':'%'+_0x58fbd[_0x0ed2('0x49')][_0x0ed2('0x52')]+'%'};return _0x2eb468;})});}_0x2722d0=_['merge']({},_0x2722d0,_0x58fbd['options']);return db[_0x0ed2('0x6d')]['count']({'where':_0x2722d0[_0x0ed2('0x51')]})[_0x0ed2('0x35')](function(_0x52c74c){_0x3dff8e[_0x0ed2('0x31')]=_0x52c74c;if(_0x58fbd['query'][_0x0ed2('0x57')]){_0x2722d0[_0x0ed2('0x58')]=[{'all':!![]}];}return db[_0x0ed2('0x6d')][_0x0ed2('0x59')](_0x2722d0);})[_0x0ed2('0x35')](function(_0x42f521){_0x3dff8e['rows']=_0x42f521;return _0x3dff8e;});}})['then'](respondWithFilteredResult(_0x3356f8,_0x2722d0))[_0x0ed2('0x2a')](handleError(_0x3356f8,null));};exports[_0x0ed2('0x70')]=function(_0x58b79b,_0x331e18,_0x5bd2b3){return db[_0x0ed2('0x56')][_0x0ed2('0x5c')]({'where':{'id':_0x58b79b[_0x0ed2('0x5b')]['id']}})[_0x0ed2('0x35')](handleEntityNotFound(_0x331e18,null))[_0x0ed2('0x35')](function(_0x5174aa){if(_0x5174aa){return _0x5174aa[_0x0ed2('0x70')](_0x58b79b[_0x0ed2('0x49')][_0x0ed2('0x6b')]);}})[_0x0ed2('0x35')](respondWithStatusCode(_0x331e18,null))[_0x0ed2('0x2a')](handleError(_0x331e18,null));};exports[_0x0ed2('0x71')]=function(_0x336eee,_0x3ab046,_0x1bdb15){var _0x432af6={'body':_0x336eee[_0x0ed2('0x5e')],'channel':_0x0ed2('0x72')};var _0x31defb=[];var _0x4c6ee1=[];var _0x2e9dca={};var _0x5ebdd2=![];return db['CmContact'][_0x0ed2('0x65')]()[_0x0ed2('0x35')](function(_0x933ce3){if(!_0x933ce3){throw new db['Sequelize'][(_0x0ed2('0x73'))]('no\x20available\x20attributes');}_0x31defb=_[_0x0ed2('0x74')](_[_0x0ed2('0x46')](_0x933ce3),['createdAt','updatedAt']);_0x4c6ee1=_['difference'](_[_0x0ed2('0x46')](_0x933ce3),[_0x0ed2('0x75'),_0x0ed2('0x76'),'CompanyId',_0x0ed2('0x77')]);if(_0x336eee[_0x0ed2('0x5e')]['id']){delete _0x336eee[_0x0ed2('0x5e')]['id'];}if(_[_0x0ed2('0x78')](_0x336eee[_0x0ed2('0x5e')][_0x0ed2('0x79')])){throw new db['Sequelize'][(_0x0ed2('0x73'))]('from\x20is\x20mandatory');}if(_[_0x0ed2('0x78')](_0x336eee[_0x0ed2('0x5e')][_0x0ed2('0x5e')])||_0x336eee[_0x0ed2('0x5e')]['body']===''){throw new db[(_0x0ed2('0x7a'))][(_0x0ed2('0x73'))](_0x0ed2('0x7b'));}if(_[_0x0ed2('0x78')](_0x336eee['body']['mapKey'])){throw new db[(_0x0ed2('0x7a'))]['ValidationError'](_0x0ed2('0x7c')+_0x4c6ee1);}if(!_['includes'](_0x4c6ee1,_0x336eee['body'][_0x0ed2('0x7d')])){throw new db[(_0x0ed2('0x7a'))][(_0x0ed2('0x73'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4c6ee1);}_0x2e9dca[_0x336eee[_0x0ed2('0x5e')][_0x0ed2('0x7d')]]=_0x336eee['body'][_0x0ed2('0x79')];})[_0x0ed2('0x35')](function(){return db[_0x0ed2('0x56')]['find']({'where':{'id':_0x336eee[_0x0ed2('0x5b')]['id']},'include':[{'model':db['CmList'],'as':_0x0ed2('0x7e'),'include':[{'model':db[_0x0ed2('0x7f')],'as':_0x0ed2('0x80'),'where':_0x2e9dca,'limit':0x1,'order':[[_0x0ed2('0x76'),_0x0ed2('0x81')]]}]},{'model':db[_0x0ed2('0x82')],'as':_0x0ed2('0x83')}]});})[_0x0ed2('0x35')](handleEntityNotFound(_0x3ab046,null))[_0x0ed2('0x35')](function(_0xcc77d6){if(_0xcc77d6&&_0xcc77d6['List']){_0x432af6[_0x0ed2('0x84')]=_0xcc77d6;_0x432af6[_0x0ed2('0x85')]=_0xcc77d6['Applications'];_0x432af6[_0x0ed2('0x86')]=_0xcc77d6[_0x0ed2('0x7e')];_0x432af6['applications']=_[_0x0ed2('0x87')](_0x432af6['applications'],[_0x0ed2('0x88')],['asc']);if(_0x432af6[_0x0ed2('0x84')][_0x0ed2('0x83')]){delete _0x432af6[_0x0ed2('0x84')]['Applications'];}if(_0x432af6[_0x0ed2('0x84')]['List']&&_0x432af6[_0x0ed2('0x84')]['List']['Contacts'][_0x0ed2('0x4c')]){return _0x432af6[_0x0ed2('0x84')][_0x0ed2('0x7e')][_0x0ed2('0x80')][0x0];}var _0x476ad0=_[_0x0ed2('0x1b')](_0x336eee[_0x0ed2('0x5e')],{'firstName':_0x336eee[_0x0ed2('0x5e')][_0x0ed2('0x79')],'ListId':_0xcc77d6[_0x0ed2('0x77')]});_0x476ad0[_0x336eee[_0x0ed2('0x5e')]['mapKey']]=_0x336eee[_0x0ed2('0x5e')][_0x0ed2('0x79')];return db['CmContact'][_0x0ed2('0x5d')](_0x476ad0,{'fields':_0x31defb,'raw':!![]});}})[_0x0ed2('0x35')](handleEntityNotFound(_0x3ab046,null))[_0x0ed2('0x35')](function(_0x3f5f11){_0x432af6[_0x0ed2('0x89')]=_0x3f5f11;if(_0x3f5f11){var _0x6c23b={'ContactId':_0x3f5f11['id'],'OpenchannelAccountId':_0x336eee[_0x0ed2('0x5b')]['id'],'from':(_0x3f5f11[_0x0ed2('0x8a')]||'')+'\x20'+(_0x3f5f11['lastName']||'')};var _0xa33d5c={'OpenchannelAccountId':_0x336eee[_0x0ed2('0x5b')]['id'],'closed':![]};if(_0x336eee[_0x0ed2('0x5e')][_0x0ed2('0x8b')]){_0xa33d5c['threadId']=_0x336eee['body'][_0x0ed2('0x8b')];return db[_0x0ed2('0x8c')][_0x0ed2('0x5c')]({'where':_0xa33d5c})[_0x0ed2('0x35')](function(_0x5e1311){if(_0x5e1311){return[_0x5e1311,![]];}_0x6c23b[_0x0ed2('0x8b')]=_0x336eee[_0x0ed2('0x5e')][_0x0ed2('0x8b')];_0x6c23b[_0x0ed2('0x8d')]=_0x336eee['body'][_0x0ed2('0x8d')];return db[_0x0ed2('0x8c')][_0x0ed2('0x5d')](_0x6c23b)[_0x0ed2('0x35')](function(_0x1a9b90){return[_0x1a9b90,!![]];});});}else{_0xa33d5c[_0x0ed2('0x8b')]=null;}_0xa33d5c[_0x0ed2('0x8e')]=_0x3f5f11['id'];return db[_0x0ed2('0x8c')][_0x0ed2('0x5c')]({'where':_0xa33d5c})[_0x0ed2('0x35')](function(_0x20f4cb){if(_0x20f4cb){return[_0x20f4cb,![]];}return db[_0x0ed2('0x8c')]['create'](_0x6c23b)[_0x0ed2('0x35')](function(_0x1b500f){return[_0x1b500f,!![]];});});}})[_0x0ed2('0x8f')](function(_0x988a82,_0x5c197f){if(_0x988a82){_0x5ebdd2=_0x5c197f;if(!_0x5c197f){var _0x3a3271={'from':(_0x432af6[_0x0ed2('0x89')][_0x0ed2('0x8a')]||'')+'\x20'+(_0x432af6['contact'][_0x0ed2('0x90')]||'')};if(_0x336eee[_0x0ed2('0x5e')][_0x0ed2('0x8b')]&&_0x336eee[_0x0ed2('0x5e')][_0x0ed2('0x91')]&&_0x336eee[_0x0ed2('0x5e')][_0x0ed2('0x8b')]!=_0x336eee[_0x0ed2('0x5e')][_0x0ed2('0x91')]){_0x3a3271[_0x0ed2('0x8b')]=_0x336eee[_0x0ed2('0x5e')]['messageId'];}return _0x988a82[_0x0ed2('0x64')](_0x3a3271);}else{return _0x988a82;}}})[_0x0ed2('0x35')](function(_0x3329c3){_0x432af6[_0x0ed2('0x92')]=_0x3329c3[_0x0ed2('0x37')]({'plain':!![]});_0x432af6[_0x0ed2('0x92')][_0x0ed2('0x93')]=_0x5ebdd2;if(_0x432af6[_0x0ed2('0x92')][_0x0ed2('0x93')]){if(_0x432af6[_0x0ed2('0x84')][_0x0ed2('0x94')]){_0x432af6[_0x0ed2('0x85')][_0x0ed2('0x95')]({'id':0x0,'priority':_0x432af6[_0x0ed2('0x85')][_0x0ed2('0x4c')]+0x1,'app':_0x0ed2('0x96'),'appdata':_0x0ed2('0x97'),'interval':_0x0ed2('0x98')});}}return db[_0x0ed2('0x99')]['create']({'body':_0x336eee[_0x0ed2('0x5e')][_0x0ed2('0x5e')],'OpenchannelAccountId':_0x336eee[_0x0ed2('0x5b')]['id'],'OpenchannelInteractionId':_0x3329c3['id'],'direction':'in','ContactId':_0x432af6[_0x0ed2('0x89')]['id'],'AttachmentId':_0x336eee[_0x0ed2('0x5e')][_0x0ed2('0x9a')]});})[_0x0ed2('0x35')](function(_0x4b80c8){_0x432af6[_0x0ed2('0x28')]=_0x4b80c8;if(!_0x432af6[_0x0ed2('0x92')][_0x0ed2('0x9b')])return;return db['User']['find']({'attributes':['id',_0x0ed2('0x3b')],'where':{'id':_0x432af6[_0x0ed2('0x92')][_0x0ed2('0x9b')]}});})[_0x0ed2('0x35')](function(_0x3460d5){if(_0x3460d5){_0x432af6[_0x0ed2('0x85')][_0x0ed2('0x9c')]({'id':0x0,'priority':0x0,'app':_0x0ed2('0x9d'),'appdata':_0x3460d5[_0x0ed2('0x3b')]+','+(_0x432af6[_0x0ed2('0x84')]['waitForTheAssignedAgent']||0xa),'interval':_0x0ed2('0x98')});}if(!_0x432af6[_0x0ed2('0x92')][_0x0ed2('0x9e')])return;return db[_0x0ed2('0x9f')][_0x0ed2('0x5c')]({'attributes':['id',_0x0ed2('0x3b')],'where':{'id':_0x432af6['interaction'][_0x0ed2('0x9e')]}});})['then'](function(_0x479756){if(_0x479756){_0x432af6[_0x0ed2('0x85')][_0x0ed2('0x9c')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x479756[_0x0ed2('0x3b')]+','+(_0x432af6['account']['waitForTheAssignedQueue']||0x12c),'interval':_0x0ed2('0x98')});}return respondWithRpcPromise(_0x0ed2('0xa0'),_0x0ed2('0xa1'),_0x432af6);})[_0x0ed2('0x35')](function(_0x165b64){respondWithRpcPromise(_0x0ed2('0xa2'),_0x0ed2('0xa2'),{'event':_0x0ed2('0x71'),'message':_0x165b64},client9002);return _0x165b64;})[_0x0ed2('0x35')](respondWithResult(_0x3ab046,null))[_0x0ed2('0x2a')](handleError(_0x3ab046,null));};exports[_0x0ed2('0xa3')]=function(_0x53edb2,_0x4a7403){var _0x578e85=_0x53edb2['params']['id'];var _0x251ffb=_0x53edb2[_0x0ed2('0x5e')];var _0x2df54a=0xc8;var _0x4ced79=null;return db[_0x0ed2('0xa4')][_0x0ed2('0xa5')]({'isolationLevel':db[_0x0ed2('0xa4')][_0x0ed2('0xa6')][_0x0ed2('0xa7')][_0x0ed2('0xa8')]},function(_0x14f1b3){return db[_0x0ed2('0x56')][_0x0ed2('0x69')]({'where':{'id':_0x578e85},'transaction':_0x14f1b3})[_0x0ed2('0x35')](function(_0x2e2fa4){if(_0x2e2fa4){return db[_0x0ed2('0x82')][_0x0ed2('0x36')]({'where':{'OpenchannelAccountId':_0x578e85},'transaction':_0x14f1b3})[_0x0ed2('0x35')](function(){var _0x439f4f=_[_0x0ed2('0x40')](_0x251ffb,function(_0x1f20c1){_0x1f20c1[_0x0ed2('0x66')]=_0x578e85;return _0x1f20c1;});return db[_0x0ed2('0x82')][_0x0ed2('0xa9')](_0x439f4f,{'transaction':_0x14f1b3});});}else{_0x2df54a=0x194;_0x4ced79=[];}});})[_0x0ed2('0x35')](function(){if(_0x2df54a!==0x194){return db[_0x0ed2('0x82')][_0x0ed2('0xaa')]({'where':{'OpenchannelAccountId':_0x578e85},'order':'priority'})[_0x0ed2('0x35')](function(_0x218b68){_0x4ced79=_0x218b68;});}})[_0x0ed2('0x2a')](function(_0x2aaad3){_0x2df54a=0x1f4;logger[_0x0ed2('0x26')](_0x2aaad3[_0x0ed2('0x3a')]);if(_0x2aaad3[_0x0ed2('0x3b')]){delete _0x2aaad3[_0x0ed2('0x3b')];}_0x4ced79=_0x2aaad3;})[_0x0ed2('0xab')](function(){if(_0x4ced79===null){_0x4a7403[_0x0ed2('0x2b')](_0x2df54a);}else{if(_0x2df54a===0x1f4){_0x4a7403[_0x0ed2('0x2c')](_0x2df54a)['send'](_0x4ced79);}else{_0x4a7403[_0x0ed2('0x2c')](_0x2df54a)['json'](_0x4ced79);}}});};exports[_0x0ed2('0xac')]=function(_0x2bb51e,_0x14d29d,_0x3375b3){var _0x398401={};var _0x1a300f={};var _0x1a23b2;var _0x5a01cb;return db[_0x0ed2('0x56')]['findOne']({'where':{'id':_0x2bb51e[_0x0ed2('0x5b')]['id']}})[_0x0ed2('0x35')](handleEntityNotFound(_0x14d29d,null))[_0x0ed2('0x35')](function(_0x205fa6){if(_0x205fa6){_0x1a23b2=_0x205fa6;_0x1a300f[_0x0ed2('0x45')]=_[_0x0ed2('0x46')](db[_0x0ed2('0x82')][_0x0ed2('0x41')]);_0x1a300f[_0x0ed2('0x49')]=_[_0x0ed2('0x46')](_0x2bb51e[_0x0ed2('0x49')]);_0x1a300f[_0x0ed2('0x47')]=_[_0x0ed2('0x48')](_0x1a300f['model'],_0x1a300f[_0x0ed2('0x49')]);_0x398401[_0x0ed2('0x4a')]=_[_0x0ed2('0x48')](_0x1a300f[_0x0ed2('0x45')],qs[_0x0ed2('0x4b')](_0x2bb51e[_0x0ed2('0x49')][_0x0ed2('0x4b')]));_0x398401[_0x0ed2('0x4a')]=_0x398401[_0x0ed2('0x4a')][_0x0ed2('0x4c')]?_0x398401['attributes']:_0x1a300f['model'];_0x398401['order']=qs[_0x0ed2('0x50')](_0x2bb51e[_0x0ed2('0x49')][_0x0ed2('0x50')]);_0x398401['where']=qs[_0x0ed2('0x47')](_[_0x0ed2('0x6f')](_0x2bb51e[_0x0ed2('0x49')],_0x1a300f['filters']));if(_0x2bb51e[_0x0ed2('0x49')][_0x0ed2('0x52')]){_0x398401[_0x0ed2('0x51')]=_[_0x0ed2('0x53')](_0x398401[_0x0ed2('0x51')],{'$or':_['map'](_0x398401['attributes'],function(_0x120ee8){var _0x448318={};_0x448318[_0x120ee8]={'$like':'%'+_0x2bb51e[_0x0ed2('0x49')][_0x0ed2('0x52')]+'%'};return _0x448318;})});}_0x398401=_[_0x0ed2('0x53')]({},_0x398401,_0x2bb51e[_0x0ed2('0x55')]);return _0x1a23b2[_0x0ed2('0xac')](_0x398401);}})[_0x0ed2('0x35')](function(_0x327564){if(_0x327564){_0x5a01cb=_0x327564['length'];if(!_0x2bb51e[_0x0ed2('0x49')][_0x0ed2('0x4d')]('nolimit')){_0x398401['limit']=qs[_0x0ed2('0x30')](_0x2bb51e[_0x0ed2('0x49')]['limit']);_0x398401[_0x0ed2('0x32')]=qs['offset'](_0x2bb51e['query'][_0x0ed2('0x32')]);}return _0x1a23b2[_0x0ed2('0xac')](_0x398401);}})[_0x0ed2('0x35')](function(_0x5990aa){if(_0x5990aa){return _0x5990aa?{'count':_0x5a01cb,'rows':_0x5990aa}:null;}})[_0x0ed2('0x35')](respondWithResult(_0x14d29d,null))[_0x0ed2('0x2a')](handleError(_0x14d29d,null));};exports[_0x0ed2('0xad')]=function(_0x33cc56,_0x82e8e9,_0x535d83){var _0x584457={'raw':![],'where':{}};var _0x1f199c={};var _0x404d0b={'count':0x0,'rows':[]};return db[_0x0ed2('0x56')][_0x0ed2('0x69')]({'where':{'id':_0x33cc56[_0x0ed2('0x5b')]['id']}})[_0x0ed2('0x35')](handleEntityNotFound(_0x82e8e9,null))[_0x0ed2('0x35')](function(_0x9eef7){if(_0x9eef7){_0x1f199c[_0x0ed2('0x45')]=_[_0x0ed2('0x46')](db[_0x0ed2('0x8c')][_0x0ed2('0x41')]);_0x1f199c['query']=_['keys'](_0x33cc56[_0x0ed2('0x49')]);_0x1f199c[_0x0ed2('0x47')]=_[_0x0ed2('0x48')](_0x1f199c['model'],_0x1f199c[_0x0ed2('0x49')]);_0x584457[_0x0ed2('0x4a')]=_[_0x0ed2('0x48')](_0x1f199c[_0x0ed2('0x45')],qs[_0x0ed2('0x4b')](_0x33cc56[_0x0ed2('0x49')]['fields']));_0x584457[_0x0ed2('0x4a')]=_0x584457[_0x0ed2('0x4a')][_0x0ed2('0x4c')]?_0x584457[_0x0ed2('0x4a')]:_0x1f199c[_0x0ed2('0x45')];if(!_0x33cc56['query']['hasOwnProperty'](_0x0ed2('0x4e'))){_0x584457['limit']=qs[_0x0ed2('0x30')](_0x33cc56['query'][_0x0ed2('0x30')]);_0x584457[_0x0ed2('0x32')]=qs[_0x0ed2('0x32')](_0x33cc56[_0x0ed2('0x49')][_0x0ed2('0x32')]);}_0x584457[_0x0ed2('0x4f')]=qs[_0x0ed2('0x50')](_0x33cc56[_0x0ed2('0x49')][_0x0ed2('0x50')]);_0x584457[_0x0ed2('0x51')]=qs['filters'](_[_0x0ed2('0x6f')](_0x33cc56[_0x0ed2('0x49')],_0x1f199c['filters']));_0x584457[_0x0ed2('0x51')][_0x0ed2('0x66')]=_0x9eef7['id'];if(_0x33cc56['query']['filter']){_0x584457['where']=_[_0x0ed2('0x53')](_0x584457[_0x0ed2('0x51')],{'$or':_[_0x0ed2('0x40')](_0x584457[_0x0ed2('0x4a')],function(_0x50cb66){var _0x57a1a7={};_0x57a1a7[_0x50cb66]={'$like':'%'+_0x33cc56[_0x0ed2('0x49')][_0x0ed2('0x52')]+'%'};return _0x57a1a7;})});}_0x584457=_[_0x0ed2('0x53')]({},_0x584457,_0x33cc56[_0x0ed2('0x55')]);return db[_0x0ed2('0x8c')][_0x0ed2('0x31')]({'where':_0x584457[_0x0ed2('0x51')]})['then'](function(_0x58f36d){_0x404d0b[_0x0ed2('0x31')]=_0x58f36d;if(_0x33cc56[_0x0ed2('0x49')][_0x0ed2('0x57')]){_0x584457[_0x0ed2('0x58')]=[{'model':db[_0x0ed2('0x7f')],'as':'Contact','required':![]},{'model':db[_0x0ed2('0xae')],'as':_0x0ed2('0xaf'),'attributes':['name',_0x0ed2('0xb0'),_0x0ed2('0xb1')],'required':![]},{'model':db[_0x0ed2('0xb2')],'as':_0x0ed2('0xb3'),'attributes':['id',_0x0ed2('0x3b'),_0x0ed2('0xb4')],'where':_0x33cc56['query']['tag']?{'id':_0x33cc56[_0x0ed2('0x49')][_0x0ed2('0xb5')]}:undefined,'required':_0x33cc56['query'][_0x0ed2('0xb5')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x584457);})[_0x0ed2('0x35')](function(_0x219a54){_0x404d0b[_0x0ed2('0xb6')]=_0x219a54;return _0x404d0b;});}})[_0x0ed2('0x35')](respondWithFilteredResult(_0x82e8e9,_0x584457))[_0x0ed2('0x2a')](handleError(_0x82e8e9,null));};exports[_0x0ed2('0xb7')]=function(_0x12bb08,_0x39c64b,_0x4522d0){return db[_0x0ed2('0x56')]['find']({'where':{'id':_0x12bb08[_0x0ed2('0x5b')]['id']}})[_0x0ed2('0x35')](handleEntityNotFound(_0x39c64b,null))[_0x0ed2('0x35')](function(_0x1a7ec7){if(_0x1a7ec7){return _0x1a7ec7[_0x0ed2('0xb7')](_0x12bb08[_0x0ed2('0x5e')]['ids'],_[_0x0ed2('0xb8')](_0x12bb08['body'],[_0x0ed2('0x6b'),'id'])||{})[_0x0ed2('0x8f')](function(_0x187767){for(var _0x40247d=0x0;_0x40247d<_0x12bb08[_0x0ed2('0x5e')][_0x0ed2('0x6b')][_0x0ed2('0x4c')];_0x40247d+=0x1){socket[_0x0ed2('0xb9')](_0x0ed2('0xba'),{'UserId':Number(_0x12bb08[_0x0ed2('0x5e')][_0x0ed2('0x6b')][_0x40247d]),'OpenchannelAccountId':Number(_0x12bb08['params']['id'])});}return _0x187767;});}})[_0x0ed2('0x35')](respondWithResult(_0x39c64b,null))['catch'](handleError(_0x39c64b,null));};exports[_0x0ed2('0xbb')]=function(_0x58eaf1,_0x530eca,_0x3b512a){return db[_0x0ed2('0x56')][_0x0ed2('0x5c')]({'where':{'id':_0x58eaf1[_0x0ed2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x530eca,null))['then'](function(_0x138a22){if(_0x138a22){return _0x138a22[_0x0ed2('0xbb')](_0x58eaf1['query'][_0x0ed2('0x6b')])[_0x0ed2('0x35')](function(){if(_[_0x0ed2('0xbc')](_0x58eaf1[_0x0ed2('0x49')][_0x0ed2('0x6b')])){for(var _0x3a87a4=0x0;_0x3a87a4<_0x58eaf1[_0x0ed2('0x49')][_0x0ed2('0x6b')][_0x0ed2('0x4c')];_0x3a87a4+=0x1){socket[_0x0ed2('0xb9')](_0x0ed2('0xbd'),{'UserId':Number(_0x58eaf1[_0x0ed2('0x49')][_0x0ed2('0x6b')][_0x3a87a4]),'OpenchannelAccountId':Number(_0x58eaf1['params']['id'])});}}else{socket[_0x0ed2('0xb9')](_0x0ed2('0xbd'),{'UserId':Number(_0x58eaf1[_0x0ed2('0x49')]['ids']),'OpenchannelAccountId':Number(_0x58eaf1[_0x0ed2('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x530eca,null))['catch'](handleError(_0x530eca,null));};exports['getAgents']=function(_0x41ab3b,_0x1a8490,_0x29ca5f){var _0x171f50={};var _0x342316={};var _0x32ca17;var _0x239fbf;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x41ab3b[_0x0ed2('0x5b')]['id']}})[_0x0ed2('0x35')](handleEntityNotFound(_0x1a8490,null))['then'](function(_0x776941){if(_0x776941){_0x32ca17=_0x776941;_0x342316[_0x0ed2('0x45')]=_[_0x0ed2('0x46')](db[_0x0ed2('0xae')]['rawAttributes']);_0x342316[_0x0ed2('0x49')]=_[_0x0ed2('0x46')](_0x41ab3b[_0x0ed2('0x49')]);_0x342316[_0x0ed2('0x47')]=_[_0x0ed2('0x48')](_0x342316[_0x0ed2('0x45')],_0x342316[_0x0ed2('0x49')]);_0x171f50['attributes']=_['intersection'](_0x342316[_0x0ed2('0x45')],qs[_0x0ed2('0x4b')](_0x41ab3b[_0x0ed2('0x49')][_0x0ed2('0x4b')]));_0x171f50[_0x0ed2('0x4a')]=_0x171f50[_0x0ed2('0x4a')][_0x0ed2('0x4c')]?_0x171f50[_0x0ed2('0x4a')]:_0x342316[_0x0ed2('0x45')];_0x171f50['order']=qs['sort'](_0x41ab3b[_0x0ed2('0x49')]['sort']);_0x171f50[_0x0ed2('0x51')]=qs[_0x0ed2('0x47')](_[_0x0ed2('0x6f')](_0x41ab3b[_0x0ed2('0x49')],_0x342316[_0x0ed2('0x47')]));if(_0x41ab3b['query']['filter']){_0x171f50[_0x0ed2('0x51')]=_[_0x0ed2('0x53')](_0x171f50[_0x0ed2('0x51')],{'$or':_['map'](_0x171f50['attributes'],function(_0x4ec0c4){var _0x397c1d={};_0x397c1d[_0x4ec0c4]={'$like':'%'+_0x41ab3b[_0x0ed2('0x49')][_0x0ed2('0x52')]+'%'};return _0x397c1d;})});}_0x171f50=_[_0x0ed2('0x53')]({},_0x171f50,_0x41ab3b[_0x0ed2('0x55')]);return _0x32ca17[_0x0ed2('0xbe')](_0x171f50);}})[_0x0ed2('0x35')](function(_0x4da816){if(_0x4da816){_0x239fbf=_0x4da816[_0x0ed2('0x4c')];if(!_0x41ab3b[_0x0ed2('0x49')]['hasOwnProperty'](_0x0ed2('0x4e'))){_0x171f50[_0x0ed2('0x30')]=qs[_0x0ed2('0x30')](_0x41ab3b[_0x0ed2('0x49')][_0x0ed2('0x30')]);_0x171f50[_0x0ed2('0x32')]=qs[_0x0ed2('0x32')](_0x41ab3b[_0x0ed2('0x49')][_0x0ed2('0x32')]);}return _0x32ca17[_0x0ed2('0xbe')](_0x171f50);}})['then'](function(_0x248e81){if(_0x248e81){return _0x248e81?{'count':_0x239fbf,'rows':_0x248e81}:null;}})[_0x0ed2('0x35')](respondWithResult(_0x1a8490,null))['catch'](handleError(_0x1a8490,null));};exports[_0x0ed2('0x3c')]=function(_0x10bc08,_0x1e4bf0,_0x4a36a8){var _0x3d5795,_0x3c9dbe,_0x13737b;if(_[_0x0ed2('0x78')](_0x10bc08[_0x0ed2('0x5e')][_0x0ed2('0x5e')])||_0x10bc08[_0x0ed2('0x5e')][_0x0ed2('0x5e')]===''){throw new db[(_0x0ed2('0x7a'))][(_0x0ed2('0x73'))](_0x0ed2('0x7b'));}if(_['isNil'](_0x10bc08['body']['to'])){}_0x3d5795=_0x10bc08[_0x0ed2('0x5e')]['to'];return db[_0x0ed2('0x56')][_0x0ed2('0x69')]({'where':{'id':_0x10bc08[_0x0ed2('0x5b')]['id']}})[_0x0ed2('0x35')](handleEntityNotFound(_0x1e4bf0,null))['then'](function(_0x442945){if(_0x442945){return db[_0x0ed2('0x56')]['find']({'where':{'id':_0x442945['id']},'include':[{'model':db[_0x0ed2('0xbf')],'as':'List','include':[{'model':db[_0x0ed2('0x7f')],'as':_0x0ed2('0x80'),'where':{[_0x442945[_0x0ed2('0x7d')]]:_0x3d5795},'limit':0x1,'order':[[_0x0ed2('0x76'),_0x0ed2('0x81')]]}]}]})[_0x0ed2('0x35')](handleEntityNotFound(_0x1e4bf0,null))[_0x0ed2('0x35')](function(_0x2cecfe){if(_0x2cecfe&&_0x2cecfe[_0x0ed2('0x7e')]){_0x3c9dbe=_0x2cecfe[_0x0ed2('0x37')]({'plain':!![]});if(_0x3c9dbe[_0x0ed2('0x7e')]&&_0x3c9dbe[_0x0ed2('0x7e')][_0x0ed2('0x80')][_0x0ed2('0x4c')]){return _0x3c9dbe['List']['Contacts'][0x0];}return db[_0x0ed2('0x7f')]['create'](_['defaults'](_0x10bc08[_0x0ed2('0x5e')],{'firstName':_0x3d5795,[_0x2cecfe[_0x0ed2('0x7d')]]:_0x3d5795,'phone':_0x3d5795,'ListId':_0x3c9dbe[_0x0ed2('0x77')]}));}})[_0x0ed2('0x35')](handleEntityNotFound(_0x1e4bf0,null))[_0x0ed2('0x35')](function(_0x369fda){if(_0x369fda){_0x13737b=_0x369fda;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x13737b['id'],'closed':![],'OpenchannelAccountId':_0x3c9dbe['id']}})['then'](function(_0x3071ed){if(_0x3071ed){return[_0x3071ed,![]];}return db[_0x0ed2('0x8c')][_0x0ed2('0x5d')]({'UserId':_0x10bc08[_0x0ed2('0x60')]['id'],'ContactId':_0x13737b['id'],'OpenchannelAccountId':_0x3c9dbe['id'],'lastMsgDirection':'out','firstMsgDirection':_0x0ed2('0xc0'),'Messages':[_[_0x0ed2('0x53')](_0x10bc08[_0x0ed2('0x5e')],{'read':![],'body':_0x10bc08[_0x0ed2('0x5e')][_0x0ed2('0x5e')],'OpenchannelAccountId':_0x3c9dbe['id'],'UserId':_0x10bc08['user']['id'],'ContactId':_0x13737b['id']})]},{'include':[{'model':db[_0x0ed2('0x99')],'as':_0x0ed2('0xc1')}]})['then'](function(_0x3eabce){return[_0x3eabce,!![]];});});}})[_0x0ed2('0x8f')](function(_0x37912b,_0x37e965){if(_0x37e965){return _0x37912b;}return db[_0x0ed2('0x99')][_0x0ed2('0x5d')](_[_0x0ed2('0x53')](_0x10bc08[_0x0ed2('0x5e')],{'read':![],'body':_0x10bc08[_0x0ed2('0x5e')][_0x0ed2('0x5e')],'OpenchannelAccountId':_0x3c9dbe['id'],'OpenchannelInteractionId':_0x37912b['id'],'UserId':_0x10bc08[_0x0ed2('0x60')]['id'],'ContactId':_0x13737b['id']}))[_0x0ed2('0x35')](function(_0x32bd11){_0x37912b[_0x0ed2('0xc2')][_0x0ed2('0xc1')]=[];_0x37912b['dataValues'][_0x0ed2('0xc1')][_0x0ed2('0x95')](_0x32bd11[_0x0ed2('0xc2')]);return _0x37912b;});});}})[_0x0ed2('0x35')](respondWithResult(_0x1e4bf0,null))[_0x0ed2('0x2a')](handleError(_0x1e4bf0,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 3ca61de..65dc1d8 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 _0x4ea3=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','update'];(function(_0x17f810,_0x42ae0d){var _0x5988a2=function(_0x1f6c75){while(--_0x1f6c75){_0x17f810['push'](_0x17f810['shift']());}};_0x5988a2(++_0x42ae0d);}(_0x4ea3,0x70));var _0x34ea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4ea3[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x34ea('0x0'));var OpenchannelAccount=require(_0x34ea('0x1'))['db'][_0x34ea('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x34ea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x34ea('0x4'),'afterDestroy':'remove'};function emitEvent(_0x269d4c){return function(_0x571f1b,_0x5e5a84,_0x2ce955){OpenchannelAccountEvents[_0x34ea('0x5')](_0x269d4c+':'+_0x571f1b['id'],_0x571f1b);OpenchannelAccountEvents[_0x34ea('0x5')](_0x269d4c,_0x571f1b);_0x2ce955(null);};}for(var e in events){if(events[_0x34ea('0x6')](e)){var event=events[e];OpenchannelAccount[_0x34ea('0x7')](e,emitEvent(event));}}module[_0x34ea('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x9c44=['save','update','remove','emit','hasOwnProperty','hook','exports','OpenchannelAccount','setMaxListeners'];(function(_0x3b12db,_0x2ae13a){var _0x29904e=function(_0x2e179f){while(--_0x2e179f){_0x3b12db['push'](_0x3b12db['shift']());}};_0x29904e(++_0x2ae13a);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x49c4('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x49c4('0x1')](0x0);var events={'afterCreate':_0x49c4('0x2'),'afterUpdate':_0x49c4('0x3'),'afterDestroy':_0x49c4('0x4')};function emitEvent(_0x2ad237){return function(_0x4e0313,_0x4941f1,_0x41a183){OpenchannelAccountEvents['emit'](_0x2ad237+':'+_0x4e0313['id'],_0x4e0313);OpenchannelAccountEvents[_0x49c4('0x5')](_0x2ad237,_0x4e0313);_0x41a183(null);};}for(var e in events){if(events[_0x49c4('0x6')](e)){var event=events[e];OpenchannelAccount[_0x49c4('0x7')](e,emitEvent(event));}}module[_0x49c4('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 99a8dc9..6a65804 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(_0x596b00,_0x12f348){var _0xe651d3=function(_0x402979){while(--_0x402979){_0x596b00['push'](_0x596b00['shift']());}};_0xe651d3(++_0x12f348);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x2021fd,_0x15ee79){var _0x363c53=function(_0x15c430){while(--_0x15c430){_0x2021fd['push'](_0x2021fd['shift']());}};_0x363c53(++_0x15ee79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 d650eba..f8c43fa 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 _0xd64b=['http','redis','defaults','localhost','socket.io-emitter','request','then','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4b3d13,_0x1993d5){var _0xf64dd8=function(_0x2304ed){while(--_0x2304ed){_0x4b3d13['push'](_0x4b3d13['shift']());}};_0xf64dd8(++_0x1993d5);}(_0xd64b,0xc1));var _0xbd64=function(_0x593fa0,_0x23b388){_0x593fa0=_0x593fa0-0x0;var _0x452eee=_0xd64b[_0x593fa0];return _0x452eee;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var moment=require(_0xbd64('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd64('0x2'));var fs=require('fs');var Redis=require(_0xbd64('0x3'));var db=require(_0xbd64('0x4'))['db'];var utils=require(_0xbd64('0x5'));var logger=require(_0xbd64('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd64('0x7')]({'port':0x232a});config[_0xbd64('0x8')]=_[_0xbd64('0x9')](config[_0xbd64('0x8')],{'host':_0xbd64('0xa'),'port':0x18eb});var socket=require(_0xbd64('0xb'))(new Redis(config[_0xbd64('0x8')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x40919e,_0xde7cc8,_0x1250be){return new BPromise(function(_0x4e1adb,_0xc80599){return client[_0xbd64('0xc')](_0x40919e,_0x1250be)[_0xbd64('0xd')](function(_0x18bde8){logger['info'](_0xbd64('0xe'),_0xde7cc8,'request\x20sent');logger[_0xbd64('0xf')](_0xbd64('0x10'),_0xde7cc8,_0xbd64('0x11'),JSON[_0xbd64('0x12')](_0x18bde8));if(_0x18bde8[_0xbd64('0x13')]){if(_0x18bde8[_0xbd64('0x13')][_0xbd64('0x14')]===0x1f4){logger[_0xbd64('0x13')](_0xbd64('0xe'),_0xde7cc8,_0x18bde8['error'][_0xbd64('0x15')]);return _0xc80599(_0x18bde8[_0xbd64('0x13')][_0xbd64('0x15')]);}logger[_0xbd64('0x13')](_0xbd64('0xe'),_0xde7cc8,_0x18bde8['error'][_0xbd64('0x15')]);return _0x4e1adb(_0x18bde8['error'][_0xbd64('0x15')]);}else{logger[_0xbd64('0x16')](_0xbd64('0xe'),_0xde7cc8,_0xbd64('0x11'));_0x4e1adb(_0x18bde8[_0xbd64('0x17')][_0xbd64('0x15')]);}})[_0xbd64('0x18')](function(_0x32c4c7){logger['error'](_0xbd64('0xe'),_0xde7cc8,_0x32c4c7);_0xc80599(_0x32c4c7);});});} \ No newline at end of file +var _0x8f59=['redis','localhost','socket.io-emitter','register','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8f59,0x11d));var _0x98f5=function(_0x3a7c8a,_0x24eeba){_0x3a7c8a=_0x3a7c8a-0x0;var _0x12ed2c=_0x8f59[_0x3a7c8a];return _0x12ed2c;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var moment=require(_0x98f5('0x2'));var BPromise=require(_0x98f5('0x3'));var rs=require(_0x98f5('0x4'));var fs=require('fs');var Redis=require(_0x98f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x98f5('0x6'));var logger=require(_0x98f5('0x7'))(_0x98f5('0x8'));var config=require(_0x98f5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x98f5('0xa')][_0x98f5('0xb')]({'port':0x232a});config[_0x98f5('0xc')]=_['defaults'](config['redis'],{'host':_0x98f5('0xd'),'port':0x18eb});var socket=require(_0x98f5('0xe'))(new Redis(config[_0x98f5('0xc')]));require('./openchannelAccount.socket')[_0x98f5('0xf')](socket);function respondWithRpcPromise(_0x31b669,_0x227cf3,_0x39e85d){return new BPromise(function(_0x4c4abc,_0x26a0fc){return client['request'](_0x31b669,_0x39e85d)['then'](function(_0x3cf4b2){logger[_0x98f5('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x227cf3,_0x98f5('0x11'));logger[_0x98f5('0x12')](_0x98f5('0x13'),_0x227cf3,_0x98f5('0x11'),JSON[_0x98f5('0x14')](_0x3cf4b2));if(_0x3cf4b2[_0x98f5('0x15')]){if(_0x3cf4b2['error'][_0x98f5('0x16')]===0x1f4){logger[_0x98f5('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x227cf3,_0x3cf4b2[_0x98f5('0x15')][_0x98f5('0x17')]);return _0x26a0fc(_0x3cf4b2[_0x98f5('0x15')]['message']);}logger[_0x98f5('0x15')](_0x98f5('0x18'),_0x227cf3,_0x3cf4b2[_0x98f5('0x15')]['message']);return _0x4c4abc(_0x3cf4b2[_0x98f5('0x15')][_0x98f5('0x17')]);}else{logger['info'](_0x98f5('0x18'),_0x227cf3,'request\x20sent');_0x4c4abc(_0x3cf4b2[_0x98f5('0x19')][_0x98f5('0x17')]);}})[_0x98f5('0x1a')](function(_0x11b6d4){logger[_0x98f5('0x15')](_0x98f5('0x18'),_0x227cf3,_0x11b6d4);_0x26a0fc(_0x11b6d4);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 4803e7d..ddefd74 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 _0x0834=['update','emit','removeListener','register','length','openchannelAccount:','remove'];(function(_0x56ff5e,_0x257c79){var _0x26d7c6=function(_0x3cd248){while(--_0x3cd248){_0x56ff5e['push'](_0x56ff5e['shift']());}};_0x26d7c6(++_0x257c79);}(_0x0834,0x18e));var _0x4083=function(_0x3e8497,_0x25ffe4){_0x3e8497=_0x3e8497-0x0;var _0xe1d210=_0x0834[_0x3e8497];return _0xe1d210;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x4083('0x0'),_0x4083('0x1')];function createListener(_0x5cbfad,_0x491147){return function(_0x5e1812){_0x491147[_0x4083('0x2')](_0x5cbfad,_0x5e1812);};}function removeListener(_0x14b7c6,_0x4e3837){return function(){OpenchannelAccountEvents[_0x4083('0x3')](_0x14b7c6,_0x4e3837);};}exports[_0x4083('0x4')]=function(_0x50a894){for(var _0x3bf635=0x0,_0x5c5a54=events[_0x4083('0x5')];_0x3bf635<_0x5c5a54;_0x3bf635++){var _0x26ed53=events[_0x3bf635];var _0x2c42bb=createListener(_0x4083('0x6')+_0x26ed53,_0x50a894);OpenchannelAccountEvents['on'](_0x26ed53,_0x2c42bb);}}; \ No newline at end of file +var _0xcee0=['openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x135a5d,_0x315674){var _0x4b96f4=function(_0x47d904){while(--_0x47d904){_0x135a5d['push'](_0x135a5d['shift']());}};_0x4b96f4(++_0x315674);}(_0xcee0,0x1e1));var _0x0cee=function(_0x4b9978,_0x58eb71){_0x4b9978=_0x4b9978-0x0;var _0x42f0e5=_0xcee0[_0x4b9978];return _0x42f0e5;};'use strict';var OpenchannelAccountEvents=require(_0x0cee('0x0'));var events=[_0x0cee('0x1'),_0x0cee('0x2'),_0x0cee('0x3')];function createListener(_0x3f1953,_0xb77cd5){return function(_0x26f908){_0xb77cd5[_0x0cee('0x4')](_0x3f1953,_0x26f908);};}function removeListener(_0x3d96bf,_0x4b32f3){return function(){OpenchannelAccountEvents[_0x0cee('0x5')](_0x3d96bf,_0x4b32f3);};}exports[_0x0cee('0x6')]=function(_0x1b3abb){for(var _0x465e67=0x0,_0x2af845=events['length'];_0x465e67<_0x2af845;_0x465e67++){var _0x45491f=events[_0x465e67];var _0x24ff83=createListener(_0x0cee('0x7')+_0x45491f,_0x1b3abb);OpenchannelAccountEvents['on'](_0x45491f,_0x24ff83);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 94ab14c..9f8ec40 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 _0x3483=['fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index','/:id','isAuthenticated','show','post','create','delete','destroy','multer','connect-timeout','express','Router'];(function(_0x4265f1,_0x4975b7){var _0x193575=function(_0x5560f5){while(--_0x5560f5){_0x4265f1['push'](_0x4265f1['shift']());}};_0x193575(++_0x4975b7);}(_0x3483,0x150));var _0x3348=function(_0x4c356a,_0x15b8eb){_0x4c356a=_0x4c356a-0x0;var _0x2f4927=_0x3483[_0x4c356a];return _0x2f4927;};'use strict';var multer=require(_0x3348('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3348('0x1'));var express=require(_0x3348('0x2'));var router=express[_0x3348('0x3')]();var fs_extra=require(_0x3348('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3348('0x5'));var config=require(_0x3348('0x6'));var controller=require(_0x3348('0x7'));router[_0x3348('0x8')]('/',auth['isAuthenticated'](),controller[_0x3348('0x9')]);router['get'](_0x3348('0xa'),auth[_0x3348('0xb')](),controller[_0x3348('0xc')]);router[_0x3348('0xd')]('/',auth[_0x3348('0xb')](),controller[_0x3348('0xe')]);router['put'](_0x3348('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x3348('0xf')](_0x3348('0xa'),auth[_0x3348('0xb')](),controller[_0x3348('0x10')]);module['exports']=router; \ No newline at end of file +var _0x280f=['/:id','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','isAuthenticated','index','get','show','post','create','put','delete'];(function(_0x32da9e,_0x1bde0c){var _0x4e532f=function(_0x319623){while(--_0x319623){_0x32da9e['push'](_0x32da9e['shift']());}};_0x4e532f(++_0x1bde0c);}(_0x280f,0x102));var _0xf280=function(_0x2b31a8,_0x28b862){_0x2b31a8=_0x2b31a8-0x0;var _0x1175a5=_0x280f[_0x2b31a8];return _0x1175a5;};'use strict';var multer=require(_0xf280('0x0'));var util=require(_0xf280('0x1'));var path=require(_0xf280('0x2'));var timeout=require(_0xf280('0x3'));var express=require('express');var router=express[_0xf280('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf280('0x5'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router['get']('/',auth[_0xf280('0x6')](),controller[_0xf280('0x7')]);router[_0xf280('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf280('0x9')]);router[_0xf280('0xa')]('/',auth[_0xf280('0x6')](),controller[_0xf280('0xb')]);router[_0xf280('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf280('0xd')](_0xf280('0xe'),auth[_0xf280('0x6')](),controller['destroy']);module[_0xf280('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 36d2470..8152444 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 _0xbe39=['*,*,*,*','INTEGER','STRING','TEXT'];(function(_0x275008,_0x589c15){var _0x35a725=function(_0x18f2c6){while(--_0x18f2c6){_0x275008['push'](_0x275008['shift']());}};_0x35a725(++_0x589c15);}(_0xbe39,0x145));var _0x9be3=function(_0x1d8915,_0x285a4e){_0x1d8915=_0x1d8915-0x0;var _0xa9b9a8=_0xbe39[_0x1d8915];return _0xa9b9a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x9be3('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x9be3('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9be3('0x2')]()},'description':{'type':Sequelize[_0x9be3('0x1')]},'interval':{'type':Sequelize[_0x9be3('0x1')],'defaultValue':_0x9be3('0x3')}}; \ No newline at end of file +var _0x05b8=['exports','STRING','TEXT','sequelize'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x05b8,0x1bb));var _0x805b=function(_0x3c8fd2,_0x59beef){_0x3c8fd2=_0x3c8fd2-0x0;var _0x355eb6=_0x05b8[_0x3c8fd2];return _0x355eb6;};'use strict';var Sequelize=require(_0x805b('0x0'));module[_0x805b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x805b('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x805b('0x3')]()},'description':{'type':Sequelize[_0x805b('0x2')]},'interval':{'type':Sequelize[_0x805b('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 35d4321..be881fd 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 _0x2a1f=['apply','reject','save','update','then','error','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','name','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','intersection','includeAll','find','create','body','destroy','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x2a1f,0x1ba));var _0xf2a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a1f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf2a1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf2a1('0x1'));var jsonpatch=require(_0xf2a1('0x2'));var rp=require(_0xf2a1('0x3'));var moment=require(_0xf2a1('0x4'));var BPromise=require(_0xf2a1('0x5'));var Mustache=require(_0xf2a1('0x6'));var util=require(_0xf2a1('0x7'));var path=require(_0xf2a1('0x8'));var sox=require(_0xf2a1('0x9'));var csv=require(_0xf2a1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf2a1('0xb'));var _=require(_0xf2a1('0xc'));var squel=require(_0xf2a1('0xd'));var crypto=require(_0xf2a1('0xe'));var jsforce=require(_0xf2a1('0xf'));var deskjs=require(_0xf2a1('0x10'));var toCsv=require(_0xf2a1('0xa'));var querystring=require(_0xf2a1('0x11'));var Papa=require(_0xf2a1('0x12'));var Redis=require(_0xf2a1('0x13'));var authService=require(_0xf2a1('0x14'));var qs=require(_0xf2a1('0x15'));var as=require(_0xf2a1('0x16'));var hardwareService=require(_0xf2a1('0x17'));var logger=require(_0xf2a1('0x18'))(_0xf2a1('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf2a1('0x1a'));var db=require(_0xf2a1('0x1b'))['db'];function respondWithStatusCode(_0x7c0d17,_0x2c4ff9){_0x2c4ff9=_0x2c4ff9||0xcc;return function(_0x5d31a0){if(_0x5d31a0){return _0x7c0d17[_0xf2a1('0x1c')](_0x2c4ff9);}return _0x7c0d17[_0xf2a1('0x1d')](_0x2c4ff9)[_0xf2a1('0x1e')]();};}function respondWithResult(_0x14d295,_0x2650f6){_0x2650f6=_0x2650f6||0xc8;return function(_0xfa3f5d){if(_0xfa3f5d){return _0x14d295['status'](_0x2650f6)['json'](_0xfa3f5d);}};}function respondWithFilteredResult(_0x57c93f,_0x50f0eb){return function(_0x3b94b){if(_0x3b94b){var _0x4a6d37=typeof _0x50f0eb['offset']===_0xf2a1('0x1f')&&typeof _0x50f0eb[_0xf2a1('0x20')]===_0xf2a1('0x1f');var _0x2579e3=_0x3b94b[_0xf2a1('0x21')];var _0x4d8595=_0x4a6d37?0x0:_0x50f0eb[_0xf2a1('0x22')];var _0x493cfc=_0x4a6d37?_0x3b94b[_0xf2a1('0x21')]:_0x50f0eb[_0xf2a1('0x22')]+_0x50f0eb[_0xf2a1('0x20')];var _0x552ea9;if(_0x493cfc>=_0x2579e3){_0x493cfc=_0x2579e3;_0x552ea9=0xc8;}else{_0x552ea9=0xce;}_0x57c93f[_0xf2a1('0x1d')](_0x552ea9);return _0x57c93f[_0xf2a1('0x23')](_0xf2a1('0x24'),_0x4d8595+'-'+_0x493cfc+'/'+_0x2579e3)[_0xf2a1('0x25')](_0x3b94b);}return null;};}function patchUpdates(_0x158595){return function(_0x34a654){try{jsonpatch[_0xf2a1('0x26')](_0x34a654,_0x158595,!![]);}catch(_0x32ab12){return BPromise[_0xf2a1('0x27')](_0x32ab12);}return _0x34a654[_0xf2a1('0x28')]();};}function saveUpdates(_0x44e7e2,_0x274a76){return function(_0x15554c){if(_0x15554c){return _0x15554c[_0xf2a1('0x29')](_0x44e7e2)['then'](function(_0x1574b1){return _0x1574b1;});}return null;};}function removeEntity(_0x3f3c6b,_0x20e033){return function(_0x55b338){if(_0x55b338){return _0x55b338['destroy']()[_0xf2a1('0x2a')](function(){_0x3f3c6b[_0xf2a1('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e230c,_0xb8c9ca){return function(_0x2be4d9){if(!_0x2be4d9){_0x3e230c['sendStatus'](0x194);}return _0x2be4d9;};}function handleError(_0x1535b6,_0x101126){_0x101126=_0x101126||0x1f4;return function(_0x57196a){logger[_0xf2a1('0x2b')](_0x57196a['stack']);if(_0x57196a['name']){delete _0x57196a['name'];}_0x1535b6[_0xf2a1('0x1d')](_0x101126)[_0xf2a1('0x2c')](_0x57196a);};}exports[_0xf2a1('0x2d')]=function(_0x41d050,_0x4004b2){var _0xb857a3={},_0x3bbfef={},_0x51a8e6={'count':0x0,'rows':[]};var _0xb06c3f=_[_0xf2a1('0x2e')](db[_0xf2a1('0x2f')][_0xf2a1('0x30')],function(_0x2e15db){return{'name':_0x2e15db[_0xf2a1('0x31')],'type':_0x2e15db[_0xf2a1('0x32')][_0xf2a1('0x33')]};});_0x3bbfef[_0xf2a1('0x34')]=_['map'](_0xb06c3f,_0xf2a1('0x35'));_0x3bbfef['query']=_[_0xf2a1('0x36')](_0x41d050[_0xf2a1('0x37')]);_0x3bbfef[_0xf2a1('0x38')]=_['intersection'](_0x3bbfef[_0xf2a1('0x34')],_0x3bbfef[_0xf2a1('0x37')]);_0xb857a3[_0xf2a1('0x39')]=_['intersection'](_0x3bbfef['model'],qs['fields'](_0x41d050[_0xf2a1('0x37')][_0xf2a1('0x3a')]));_0xb857a3[_0xf2a1('0x39')]=_0xb857a3[_0xf2a1('0x39')][_0xf2a1('0x3b')]?_0xb857a3[_0xf2a1('0x39')]:_0x3bbfef[_0xf2a1('0x34')];if(!_0x41d050[_0xf2a1('0x37')][_0xf2a1('0x3c')](_0xf2a1('0x3d'))){_0xb857a3[_0xf2a1('0x20')]=qs['limit'](_0x41d050[_0xf2a1('0x37')]['limit']);_0xb857a3[_0xf2a1('0x22')]=qs[_0xf2a1('0x22')](_0x41d050['query'][_0xf2a1('0x22')]);}_0xb857a3[_0xf2a1('0x3e')]=qs[_0xf2a1('0x3f')](_0x41d050[_0xf2a1('0x37')][_0xf2a1('0x3f')]);_0xb857a3[_0xf2a1('0x40')]=qs[_0xf2a1('0x38')](_['pick'](_0x41d050['query'],_0x3bbfef[_0xf2a1('0x38')]),_0xb06c3f);if(_0x41d050[_0xf2a1('0x37')][_0xf2a1('0x41')]){_0xb857a3[_0xf2a1('0x40')]=_[_0xf2a1('0x42')](_0xb857a3[_0xf2a1('0x40')],{'$or':_[_0xf2a1('0x2e')](_0xb06c3f,function(_0x2a710d){if(_0x2a710d[_0xf2a1('0x32')]!==_0xf2a1('0x43')){var _0x14efff={};_0x14efff[_0x2a710d['name']]={'$like':'%'+_0x41d050['query'][_0xf2a1('0x41')]+'%'};return _0x14efff;}})});}_0xb857a3=_[_0xf2a1('0x42')]({},_0xb857a3,_0x41d050[_0xf2a1('0x44')]);var _0x38adc0={'where':_0xb857a3['where']};return db[_0xf2a1('0x2f')][_0xf2a1('0x21')](_0x38adc0)[_0xf2a1('0x2a')](function(_0x16cb05){_0x51a8e6[_0xf2a1('0x21')]=_0x16cb05;if(_0x41d050[_0xf2a1('0x37')]['includeAll']){_0xb857a3[_0xf2a1('0x45')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xf2a1('0x46')](_0xb857a3);})[_0xf2a1('0x2a')](function(_0x4ab17c){_0x51a8e6[_0xf2a1('0x47')]=_0x4ab17c;return _0x51a8e6;})[_0xf2a1('0x2a')](respondWithFilteredResult(_0x4004b2,_0xb857a3))[_0xf2a1('0x48')](handleError(_0x4004b2,null));};exports['show']=function(_0x4d4f64,_0x12a062){var _0x5cd8f9={'raw':!![],'where':{'id':_0x4d4f64[_0xf2a1('0x49')]['id']}},_0x10f0f3={};_0x10f0f3[_0xf2a1('0x34')]=_[_0xf2a1('0x36')](db[_0xf2a1('0x2f')][_0xf2a1('0x30')]);_0x10f0f3['query']=_['keys'](_0x4d4f64[_0xf2a1('0x37')]);_0x10f0f3[_0xf2a1('0x38')]=_[_0xf2a1('0x4a')](_0x10f0f3[_0xf2a1('0x34')],_0x10f0f3['query']);_0x5cd8f9[_0xf2a1('0x39')]=_['intersection'](_0x10f0f3['model'],qs['fields'](_0x4d4f64[_0xf2a1('0x37')][_0xf2a1('0x3a')]));_0x5cd8f9['attributes']=_0x5cd8f9[_0xf2a1('0x39')][_0xf2a1('0x3b')]?_0x5cd8f9['attributes']:_0x10f0f3[_0xf2a1('0x34')];if(_0x4d4f64[_0xf2a1('0x37')][_0xf2a1('0x4b')]){_0x5cd8f9['include']=[{'all':!![]}];}_0x5cd8f9=_[_0xf2a1('0x42')]({},_0x5cd8f9,_0x4d4f64[_0xf2a1('0x44')]);return db[_0xf2a1('0x2f')][_0xf2a1('0x4c')](_0x5cd8f9)[_0xf2a1('0x2a')](handleEntityNotFound(_0x12a062,null))[_0xf2a1('0x2a')](respondWithResult(_0x12a062,null))[_0xf2a1('0x48')](handleError(_0x12a062,null));};exports[_0xf2a1('0x4d')]=function(_0x1a14f2,_0x20f506){return db[_0xf2a1('0x2f')][_0xf2a1('0x4d')](_0x1a14f2[_0xf2a1('0x4e')],{})[_0xf2a1('0x2a')](respondWithResult(_0x20f506,0xc9))[_0xf2a1('0x48')](handleError(_0x20f506,null));};exports[_0xf2a1('0x29')]=function(_0x58870b,_0x347849){if(_0x58870b['body']['id']){delete _0x58870b[_0xf2a1('0x4e')]['id'];}return db[_0xf2a1('0x2f')][_0xf2a1('0x4c')]({'where':{'id':_0x58870b[_0xf2a1('0x49')]['id']}})[_0xf2a1('0x2a')](handleEntityNotFound(_0x347849,null))[_0xf2a1('0x2a')](saveUpdates(_0x58870b[_0xf2a1('0x4e')],null))['then'](respondWithResult(_0x347849,null))['catch'](handleError(_0x347849,null));};exports[_0xf2a1('0x4f')]=function(_0x4027e0,_0x4d3ec2){return db[_0xf2a1('0x2f')]['find']({'where':{'id':_0x4027e0['params']['id']}})['then'](handleEntityNotFound(_0x4d3ec2,null))[_0xf2a1('0x2a')](removeEntity(_0x4d3ec2,null))[_0xf2a1('0x48')](handleError(_0x4d3ec2,null));}; \ No newline at end of file +var _0xdf02=['includeAll','include','findAll','rows','catch','show','params','merge','options','find','create','body','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','reject','update','destroy','then','end','error','name','send','index','map','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','OpenchannelApplication'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0xdf02,0x1b0));var _0x2df0=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xdf02[_0x4b2436];return _0x4f5ab2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2df0('0x0'));var zipdir=require(_0x2df0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2df0('0x2'));var moment=require(_0x2df0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2df0('0x4'));var util=require(_0x2df0('0x5'));var path=require(_0x2df0('0x6'));var sox=require('sox');var csv=require(_0x2df0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2df0('0x8'));var squel=require(_0x2df0('0x9'));var crypto=require(_0x2df0('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2df0('0xb'));var toCsv=require(_0x2df0('0x7'));var querystring=require(_0x2df0('0xc'));var Papa=require(_0x2df0('0xd'));var Redis=require('ioredis');var authService=require(_0x2df0('0xe'));var qs=require(_0x2df0('0xf'));var as=require(_0x2df0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2df0('0x11'))(_0x2df0('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2df0('0x13'));var db=require(_0x2df0('0x14'))['db'];function respondWithStatusCode(_0x2a6ba9,_0x95fd66){_0x95fd66=_0x95fd66||0xcc;return function(_0x4ffd3d){if(_0x4ffd3d){return _0x2a6ba9[_0x2df0('0x15')](_0x95fd66);}return _0x2a6ba9['status'](_0x95fd66)['end']();};}function respondWithResult(_0x40463a,_0x551df9){_0x551df9=_0x551df9||0xc8;return function(_0x489ec0){if(_0x489ec0){return _0x40463a['status'](_0x551df9)[_0x2df0('0x16')](_0x489ec0);}};}function respondWithFilteredResult(_0x4aed34,_0x4f91ee){return function(_0x8baf57){if(_0x8baf57){var _0x2b89fa=typeof _0x4f91ee[_0x2df0('0x17')]==='undefined'&&typeof _0x4f91ee[_0x2df0('0x18')]===_0x2df0('0x19');var _0x49f8b1=_0x8baf57[_0x2df0('0x1a')];var _0x500ac9=_0x2b89fa?0x0:_0x4f91ee['offset'];var _0x24368d=_0x2b89fa?_0x8baf57[_0x2df0('0x1a')]:_0x4f91ee[_0x2df0('0x17')]+_0x4f91ee[_0x2df0('0x18')];var _0x596656;if(_0x24368d>=_0x49f8b1){_0x24368d=_0x49f8b1;_0x596656=0xc8;}else{_0x596656=0xce;}_0x4aed34[_0x2df0('0x1b')](_0x596656);return _0x4aed34[_0x2df0('0x1c')]('Content-Range',_0x500ac9+'-'+_0x24368d+'/'+_0x49f8b1)[_0x2df0('0x16')](_0x8baf57);}return null;};}function patchUpdates(_0x51c8d1){return function(_0x431027){try{jsonpatch['apply'](_0x431027,_0x51c8d1,!![]);}catch(_0x1cce9f){return BPromise[_0x2df0('0x1d')](_0x1cce9f);}return _0x431027['save']();};}function saveUpdates(_0x35d498,_0x1f6306){return function(_0x4e24b5){if(_0x4e24b5){return _0x4e24b5[_0x2df0('0x1e')](_0x35d498)['then'](function(_0x4e860f){return _0x4e860f;});}return null;};}function removeEntity(_0x1f5f68,_0x31db73){return function(_0x95a8fb){if(_0x95a8fb){return _0x95a8fb[_0x2df0('0x1f')]()[_0x2df0('0x20')](function(){_0x1f5f68[_0x2df0('0x1b')](0xcc)[_0x2df0('0x21')]();});}};}function handleEntityNotFound(_0x53a57d,_0x2017c2){return function(_0x206dd7){if(!_0x206dd7){_0x53a57d['sendStatus'](0x194);}return _0x206dd7;};}function handleError(_0x3d1e1c,_0x3f80a2){_0x3f80a2=_0x3f80a2||0x1f4;return function(_0x209e62){logger[_0x2df0('0x22')](_0x209e62['stack']);if(_0x209e62[_0x2df0('0x23')]){delete _0x209e62['name'];}_0x3d1e1c[_0x2df0('0x1b')](_0x3f80a2)[_0x2df0('0x24')](_0x209e62);};}exports[_0x2df0('0x25')]=function(_0x51d126,_0x108898){var _0x36f340={},_0x3d40df={},_0x275e3b={'count':0x0,'rows':[]};var _0x51af7b=_[_0x2df0('0x26')](db['OpenchannelApplication']['rawAttributes'],function(_0x27f1b9){return{'name':_0x27f1b9[_0x2df0('0x27')],'type':_0x27f1b9['type']['key']};});_0x3d40df[_0x2df0('0x28')]=_[_0x2df0('0x26')](_0x51af7b,_0x2df0('0x23'));_0x3d40df[_0x2df0('0x29')]=_[_0x2df0('0x2a')](_0x51d126[_0x2df0('0x29')]);_0x3d40df[_0x2df0('0x2b')]=_[_0x2df0('0x2c')](_0x3d40df[_0x2df0('0x28')],_0x3d40df[_0x2df0('0x29')]);_0x36f340['attributes']=_[_0x2df0('0x2c')](_0x3d40df[_0x2df0('0x28')],qs[_0x2df0('0x2d')](_0x51d126['query']['fields']));_0x36f340[_0x2df0('0x2e')]=_0x36f340[_0x2df0('0x2e')][_0x2df0('0x2f')]?_0x36f340['attributes']:_0x3d40df['model'];if(!_0x51d126[_0x2df0('0x29')][_0x2df0('0x30')](_0x2df0('0x31'))){_0x36f340['limit']=qs['limit'](_0x51d126[_0x2df0('0x29')]['limit']);_0x36f340[_0x2df0('0x17')]=qs['offset'](_0x51d126[_0x2df0('0x29')][_0x2df0('0x17')]);}_0x36f340[_0x2df0('0x32')]=qs[_0x2df0('0x33')](_0x51d126[_0x2df0('0x29')][_0x2df0('0x33')]);_0x36f340[_0x2df0('0x34')]=qs[_0x2df0('0x2b')](_[_0x2df0('0x35')](_0x51d126[_0x2df0('0x29')],_0x3d40df[_0x2df0('0x2b')]),_0x51af7b);if(_0x51d126['query']['filter']){_0x36f340['where']=_['merge'](_0x36f340[_0x2df0('0x34')],{'$or':_[_0x2df0('0x26')](_0x51af7b,function(_0x14abb2){if(_0x14abb2[_0x2df0('0x36')]!==_0x2df0('0x37')){var _0x528614={};_0x528614[_0x14abb2['name']]={'$like':'%'+_0x51d126[_0x2df0('0x29')][_0x2df0('0x38')]+'%'};return _0x528614;}})});}_0x36f340=_['merge']({},_0x36f340,_0x51d126['options']);var _0x2e4a75={'where':_0x36f340[_0x2df0('0x34')]};return db[_0x2df0('0x39')][_0x2df0('0x1a')](_0x2e4a75)[_0x2df0('0x20')](function(_0x319330){_0x275e3b[_0x2df0('0x1a')]=_0x319330;if(_0x51d126[_0x2df0('0x29')][_0x2df0('0x3a')]){_0x36f340[_0x2df0('0x3b')]=[{'all':!![]}];}return db[_0x2df0('0x39')][_0x2df0('0x3c')](_0x36f340);})[_0x2df0('0x20')](function(_0x297dcc){_0x275e3b[_0x2df0('0x3d')]=_0x297dcc;return _0x275e3b;})['then'](respondWithFilteredResult(_0x108898,_0x36f340))[_0x2df0('0x3e')](handleError(_0x108898,null));};exports[_0x2df0('0x3f')]=function(_0xcd54e9,_0x33a674){var _0x2694b8={'raw':!![],'where':{'id':_0xcd54e9[_0x2df0('0x40')]['id']}},_0x307886={};_0x307886[_0x2df0('0x28')]=_[_0x2df0('0x2a')](db[_0x2df0('0x39')]['rawAttributes']);_0x307886['query']=_['keys'](_0xcd54e9['query']);_0x307886[_0x2df0('0x2b')]=_['intersection'](_0x307886[_0x2df0('0x28')],_0x307886[_0x2df0('0x29')]);_0x2694b8[_0x2df0('0x2e')]=_[_0x2df0('0x2c')](_0x307886[_0x2df0('0x28')],qs[_0x2df0('0x2d')](_0xcd54e9['query'][_0x2df0('0x2d')]));_0x2694b8[_0x2df0('0x2e')]=_0x2694b8[_0x2df0('0x2e')][_0x2df0('0x2f')]?_0x2694b8[_0x2df0('0x2e')]:_0x307886[_0x2df0('0x28')];if(_0xcd54e9[_0x2df0('0x29')][_0x2df0('0x3a')]){_0x2694b8['include']=[{'all':!![]}];}_0x2694b8=_[_0x2df0('0x41')]({},_0x2694b8,_0xcd54e9[_0x2df0('0x42')]);return db[_0x2df0('0x39')][_0x2df0('0x43')](_0x2694b8)[_0x2df0('0x20')](handleEntityNotFound(_0x33a674,null))[_0x2df0('0x20')](respondWithResult(_0x33a674,null))[_0x2df0('0x3e')](handleError(_0x33a674,null));};exports[_0x2df0('0x44')]=function(_0x24db03,_0x43d46a){return db[_0x2df0('0x39')]['create'](_0x24db03[_0x2df0('0x45')],{})[_0x2df0('0x20')](respondWithResult(_0x43d46a,0xc9))[_0x2df0('0x3e')](handleError(_0x43d46a,null));};exports[_0x2df0('0x1e')]=function(_0x11ec05,_0x5a5887){if(_0x11ec05[_0x2df0('0x45')]['id']){delete _0x11ec05[_0x2df0('0x45')]['id'];}return db[_0x2df0('0x39')][_0x2df0('0x43')]({'where':{'id':_0x11ec05[_0x2df0('0x40')]['id']}})[_0x2df0('0x20')](handleEntityNotFound(_0x5a5887,null))[_0x2df0('0x20')](saveUpdates(_0x11ec05[_0x2df0('0x45')],null))[_0x2df0('0x20')](respondWithResult(_0x5a5887,null))[_0x2df0('0x3e')](handleError(_0x5a5887,null));};exports[_0x2df0('0x1f')]=function(_0x3f9adf,_0x1b7222){return db['OpenchannelApplication'][_0x2df0('0x43')]({'where':{'id':_0x3f9adf[_0x2df0('0x40')]['id']}})['then'](handleEntityNotFound(_0x1b7222,null))[_0x2df0('0x20')](removeEntity(_0x1b7222,null))[_0x2df0('0x3e')](handleError(_0x1b7222,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index f81c877..f09cecf 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 _0x1e1a=['request-promise','path','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x15acd9,_0x5a390b){var _0x17da50=function(_0x3fe719){while(--_0x3fe719){_0x15acd9['push'](_0x15acd9['shift']());}};_0x17da50(++_0x5a390b);}(_0x1e1a,0x1b4));var _0xa1e1=function(_0x6db6c5,_0x2f0d9c){_0x6db6c5=_0x6db6c5-0x0;var _0x37686d=_0x1e1a[_0x6db6c5];return _0x37686d;};'use strict';var _=require(_0xa1e1('0x0'));var util=require(_0xa1e1('0x1'));var logger=require(_0xa1e1('0x2'))(_0xa1e1('0x3'));var moment=require(_0xa1e1('0x4'));var BPromise=require(_0xa1e1('0x5'));var rp=require(_0xa1e1('0x6'));var fs=require('fs');var path=require(_0xa1e1('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa1e1('0x8'));module['exports']=function(_0x150052,_0x304ebc){return _0x150052[_0xa1e1('0x9')](_0xa1e1('0xa'),attributes,{'tableName':_0xa1e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa1e1('0xc')});}; \ No newline at end of file +var _0xe2f6=['rimraf','./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','../../config/logger','path'];(function(_0x2d3f24,_0x3f0a19){var _0x54795e=function(_0x46e2b2){while(--_0x46e2b2){_0x2d3f24['push'](_0x2d3f24['shift']());}};_0x54795e(++_0x3f0a19);}(_0xe2f6,0x74));var _0x6e2f=function(_0x6ad4bf,_0x457188){_0x6ad4bf=_0x6ad4bf-0x0;var _0x34f66f=_0xe2f6[_0x6ad4bf];return _0x34f66f;};'use strict';var _=require(_0x6e2f('0x0'));var util=require(_0x6e2f('0x1'));var logger=require(_0x6e2f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e2f('0x3'));var rimraf=require(_0x6e2f('0x4'));var config=require('../../config/environment');var attributes=require(_0x6e2f('0x5'));module[_0x6e2f('0x6')]=function(_0x125007,_0x500412){return _0x125007['define'](_0x6e2f('0x7'),attributes,{'tableName':_0x6e2f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6e2f('0x9'),'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 5fdf689..4f89c08 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 _0x0141=['catch','UpdateOpenchannelApplication','OpenchannelApplication','options','raw','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result'];(function(_0x89dde5,_0x474a45){var _0x130123=function(_0x3969bd){while(--_0x3969bd){_0x89dde5['push'](_0x89dde5['shift']());}};_0x130123(++_0x474a45);}(_0x0141,0x17c));var _0x1014=function(_0x4f35c0,_0x58a8b8){_0x4f35c0=_0x4f35c0-0x0;var _0x2c2140=_0x0141[_0x4f35c0];return _0x2c2140;};'use strict';var _=require(_0x1014('0x0'));var util=require(_0x1014('0x1'));var moment=require('moment');var BPromise=require(_0x1014('0x2'));var rs=require(_0x1014('0x3'));var fs=require('fs');var Redis=require(_0x1014('0x4'));var db=require(_0x1014('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1014('0x6'))(_0x1014('0x7'));var config=require('../../config/environment');var jayson=require(_0x1014('0x8'));var client=jayson[_0x1014('0x9')][_0x1014('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f294f,_0x1751f9,_0x149aaf){return new BPromise(function(_0x4576b8,_0x5b8f46){return client[_0x1014('0xb')](_0x4f294f,_0x149aaf)[_0x1014('0xc')](function(_0x3fc838){logger[_0x1014('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x1751f9,_0x1014('0xe'));logger[_0x1014('0xf')](_0x1014('0x10'),_0x1751f9,_0x1014('0xe'),JSON[_0x1014('0x11')](_0x3fc838));if(_0x3fc838[_0x1014('0x12')]){if(_0x3fc838[_0x1014('0x12')][_0x1014('0x13')]===0x1f4){logger[_0x1014('0x12')](_0x1014('0x14'),_0x1751f9,_0x3fc838[_0x1014('0x12')][_0x1014('0x15')]);return _0x5b8f46(_0x3fc838[_0x1014('0x12')][_0x1014('0x15')]);}logger[_0x1014('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x1751f9,_0x3fc838['error']['message']);return _0x4576b8(_0x3fc838[_0x1014('0x12')][_0x1014('0x15')]);}else{logger['info'](_0x1014('0x14'),_0x1751f9,_0x1014('0xe'));_0x4576b8(_0x3fc838[_0x1014('0x16')][_0x1014('0x15')]);}})[_0x1014('0x17')](function(_0x4ce4ce){logger[_0x1014('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x1751f9,_0x4ce4ce);_0x5b8f46(_0x4ce4ce);});});}exports[_0x1014('0x18')]=function(_0x48fdfe){var _0x489ee1=this;return new Promise(function(_0xe96fc2,_0x55d9c5){return db[_0x1014('0x19')]['update'](_0x48fdfe['body'],{'raw':_0x48fdfe[_0x1014('0x1a')]?_0x48fdfe['options'][_0x1014('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48fdfe['options']?_0x48fdfe[_0x1014('0x1a')][_0x1014('0x1c')]||null:null,'attributes':_0x48fdfe[_0x1014('0x1a')]?_0x48fdfe[_0x1014('0x1a')][_0x1014('0x1d')]||null:null,'limit':_0x48fdfe[_0x1014('0x1a')]?_0x48fdfe[_0x1014('0x1a')][_0x1014('0x1e')]||null:null})[_0x1014('0xc')](function(_0xe918fe){logger['info'](_0x1014('0x18'),_0x48fdfe);logger['debug'](_0x1014('0x18'),_0x48fdfe,JSON['stringify'](_0xe918fe));_0xe96fc2(_0xe918fe);})['catch'](function(_0x319bf8){logger[_0x1014('0x12')](_0x1014('0x18'),_0x319bf8[_0x1014('0x15')],_0x48fdfe);_0x55d9c5(_0x489ee1[_0x1014('0x12')](0x1f4,_0x319bf8[_0x1014('0x15')]));});});}; \ No newline at end of file +var _0x58a3=['client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','update','options','raw','where','attributes','limit','UpdateOpenchannelApplication','debug','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x49b4ed,_0x51fa81){var _0x4ed6de=function(_0x25f0c6){while(--_0x25f0c6){_0x49b4ed['push'](_0x49b4ed['shift']());}};_0x4ed6de(++_0x51fa81);}(_0x58a3,0x106));var _0x358a=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0x58a3[_0xd13a88];return _0x1c993c;};'use strict';var _=require(_0x358a('0x0'));var util=require('util');var moment=require(_0x358a('0x1'));var BPromise=require(_0x358a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x358a('0x3'))['db'];var utils=require(_0x358a('0x4'));var logger=require('../../config/logger')(_0x358a('0x5'));var config=require(_0x358a('0x6'));var jayson=require(_0x358a('0x7'));var client=jayson[_0x358a('0x8')][_0x358a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4abe57,_0x100a67,_0x4e1e7c){return new BPromise(function(_0x20fee7,_0x179bc2){return client[_0x358a('0xa')](_0x4abe57,_0x4e1e7c)[_0x358a('0xb')](function(_0x2f6b5d){logger[_0x358a('0xc')](_0x358a('0xd'),_0x100a67,_0x358a('0xe'));logger['debug'](_0x358a('0xf'),_0x100a67,_0x358a('0xe'),JSON[_0x358a('0x10')](_0x2f6b5d));if(_0x2f6b5d[_0x358a('0x11')]){if(_0x2f6b5d['error'][_0x358a('0x12')]===0x1f4){logger[_0x358a('0x11')](_0x358a('0xd'),_0x100a67,_0x2f6b5d['error'][_0x358a('0x13')]);return _0x179bc2(_0x2f6b5d[_0x358a('0x11')][_0x358a('0x13')]);}logger[_0x358a('0x11')](_0x358a('0xd'),_0x100a67,_0x2f6b5d[_0x358a('0x11')][_0x358a('0x13')]);return _0x20fee7(_0x2f6b5d[_0x358a('0x11')][_0x358a('0x13')]);}else{logger[_0x358a('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x100a67,_0x358a('0xe'));_0x20fee7(_0x2f6b5d[_0x358a('0x14')][_0x358a('0x13')]);}})[_0x358a('0x15')](function(_0x4ebb94){logger[_0x358a('0x11')](_0x358a('0xd'),_0x100a67,_0x4ebb94);_0x179bc2(_0x4ebb94);});});}exports['UpdateOpenchannelApplication']=function(_0xdd45d8){var _0x1cfad6=this;return new Promise(function(_0x3c45c9,_0x14f979){return db['OpenchannelApplication'][_0x358a('0x16')](_0xdd45d8['body'],{'raw':_0xdd45d8[_0x358a('0x17')]?_0xdd45d8[_0x358a('0x17')][_0x358a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdd45d8[_0x358a('0x17')]?_0xdd45d8[_0x358a('0x17')][_0x358a('0x19')]||null:null,'attributes':_0xdd45d8[_0x358a('0x17')]?_0xdd45d8[_0x358a('0x17')][_0x358a('0x1a')]||null:null,'limit':_0xdd45d8[_0x358a('0x17')]?_0xdd45d8['options'][_0x358a('0x1b')]||null:null})[_0x358a('0xb')](function(_0x64ed0f){logger[_0x358a('0xc')](_0x358a('0x1c'),_0xdd45d8);logger[_0x358a('0x1d')]('UpdateOpenchannelApplication',_0xdd45d8,JSON[_0x358a('0x10')](_0x64ed0f));_0x3c45c9(_0x64ed0f);})[_0x358a('0x15')](function(_0x1ca4da){logger['error']('UpdateOpenchannelApplication',_0x1ca4da['message'],_0xdd45d8);_0x14f979(_0x1cfad6['error'](0x1f4,_0x1ca4da[_0x358a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 7d33649..8eb4af6 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 _0x7b8c=['show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','/describe','/:id'];(function(_0x38019a,_0x4298d4){var _0x45cece=function(_0x5808d0){while(--_0x5808d0){_0x38019a['push'](_0x38019a['shift']());}};_0x45cece(++_0x4298d4);}(_0x7b8c,0x174));var _0xc7b8=function(_0x2f354e,_0x3e2e39){_0x2f354e=_0x2f354e-0x0;var _0x20f268=_0x7b8c[_0x2f354e];return _0x20f268;};'use strict';var multer=require(_0xc7b8('0x0'));var util=require(_0xc7b8('0x1'));var path=require('path');var timeout=require(_0xc7b8('0x2'));var express=require(_0xc7b8('0x3'));var router=express[_0xc7b8('0x4')]();var fs_extra=require(_0xc7b8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc7b8('0x6'));var config=require('../../config/environment');var controller=require(_0xc7b8('0x7'));router[_0xc7b8('0x8')]('/',auth[_0xc7b8('0x9')](),controller['index']);router[_0xc7b8('0x8')](_0xc7b8('0xa'),auth[_0xc7b8('0x9')](),controller['describe']);router[_0xc7b8('0x8')](_0xc7b8('0xb'),auth[_0xc7b8('0x9')](),controller[_0xc7b8('0xc')]);router[_0xc7b8('0x8')](_0xc7b8('0xd'),auth[_0xc7b8('0x9')](),controller[_0xc7b8('0xe')]);router[_0xc7b8('0x8')](_0xc7b8('0xf'),auth[_0xc7b8('0x9')](),controller[_0xc7b8('0x10')]);router[_0xc7b8('0x11')]('/',auth[_0xc7b8('0x9')](),controller[_0xc7b8('0x12')]);router[_0xc7b8('0x11')]('/:id/messages',auth[_0xc7b8('0x9')](),controller[_0xc7b8('0x13')]);router[_0xc7b8('0x11')](_0xc7b8('0x14'),auth[_0xc7b8('0x9')](),interaction[_0xc7b8('0x15')](_0xc7b8('0x16'),_0xc7b8('0x17')),controller[_0xc7b8('0x18')]);router[_0xc7b8('0x19')](_0xc7b8('0xb'),auth[_0xc7b8('0x9')](),interaction[_0xc7b8('0x15')]('openchannel',_0xc7b8('0x1a')),controller[_0xc7b8('0x1b')]);router[_0xc7b8('0x1c')](_0xc7b8('0xb'),auth[_0xc7b8('0x9')](),interaction[_0xc7b8('0x15')](_0xc7b8('0x16'),_0xc7b8('0x1d')),controller[_0xc7b8('0x1e')]);router[_0xc7b8('0x1c')](_0xc7b8('0x14'),auth[_0xc7b8('0x9')](),controller[_0xc7b8('0x1f')]);module['exports']=router; \ No newline at end of file +var _0xd12e=['/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','/:id','update','delete','openchannelinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./openchannelInteraction.controller','index','get','/describe','isAuthenticated','describe','show'];(function(_0x4f946b,_0x2d6b1d){var _0x377dff=function(_0x2e3d09){while(--_0x2e3d09){_0x4f946b['push'](_0x4f946b['shift']());}};_0x377dff(++_0x2d6b1d);}(_0xd12e,0x1e0));var _0xed12=function(_0x226598,_0x5e129b){_0x226598=_0x226598-0x0;var _0x4d6a8e=_0xd12e[_0x226598];return _0x4d6a8e;};'use strict';var multer=require(_0xed12('0x0'));var util=require(_0xed12('0x1'));var path=require(_0xed12('0x2'));var timeout=require(_0xed12('0x3'));var express=require(_0xed12('0x4'));var router=express[_0xed12('0x5')]();var fs_extra=require(_0xed12('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xed12('0x7'));var controller=require(_0xed12('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xed12('0x9')]);router[_0xed12('0xa')](_0xed12('0xb'),auth[_0xed12('0xc')](),controller[_0xed12('0xd')]);router[_0xed12('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xed12('0xe')]);router[_0xed12('0xa')](_0xed12('0xf'),auth['isAuthenticated'](),controller['getMessages']);router[_0xed12('0xa')](_0xed12('0x10'),auth[_0xed12('0xc')](),controller[_0xed12('0x11')]);router[_0xed12('0x12')]('/',auth[_0xed12('0xc')](),controller[_0xed12('0x13')]);router[_0xed12('0x12')](_0xed12('0xf'),auth[_0xed12('0xc')](),controller[_0xed12('0x14')]);router['post'](_0xed12('0x15'),auth[_0xed12('0xc')](),interaction[_0xed12('0x16')](_0xed12('0x17'),_0xed12('0x18')),controller[_0xed12('0x19')]);router[_0xed12('0x1a')](_0xed12('0x1b'),auth[_0xed12('0xc')](),interaction[_0xed12('0x16')](_0xed12('0x17'),'openchannelinteraction:update'),controller[_0xed12('0x1c')]);router[_0xed12('0x1d')](_0xed12('0x1b'),auth[_0xed12('0xc')](),interaction['tracked'](_0xed12('0x17'),_0xed12('0x1e')),controller['destroy']);router[_0xed12('0x1d')](_0xed12('0x15'),auth[_0xed12('0xc')](),controller[_0xed12('0x1f')]);module[_0xed12('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 2db3d4c..6f79c4d 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 _0x5236=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x292168,_0x1e322e){var _0x5bc239=function(_0x104159){while(--_0x104159){_0x292168['push'](_0x292168['shift']());}};_0x5bc239(++_0x1e322e);}(_0x5236,0x109));var _0x6523=function(_0x4a3d9b,_0x308cbb){_0x4a3d9b=_0x4a3d9b-0x0;var _0x47728a=_0x5236[_0x4a3d9b];return _0x47728a;};'use strict';var Sequelize=require(_0x6523('0x0'));module[_0x6523('0x1')]={'closed':{'type':Sequelize[_0x6523('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6523('0x3')]},'disposition':{'type':Sequelize[_0x6523('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6523('0x4')]},'note':{'type':Sequelize[_0x6523('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x6523('0x4')]},'externalUrl':{'type':Sequelize[_0x6523('0x4')]},'lastMsgAt':{'type':Sequelize[_0x6523('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x6523('0x5')]('in',_0x6523('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6523('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6523('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x6523('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xd4f4=['ENUM','out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x191b4c,_0x2eebd0){_0x191b4c=_0x191b4c-0x0;var _0x4fe268=_0xd4f4[_0x191b4c];return _0x4fe268;};'use strict';var Sequelize=require(_0x4d4f('0x0'));module[_0x4d4f('0x1')]={'closed':{'type':Sequelize[_0x4d4f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4d4f('0x3')]},'disposition':{'type':Sequelize[_0x4d4f('0x4')]},'secondDisposition':{'type':Sequelize[_0x4d4f('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4d4f('0x4')]},'note':{'type':Sequelize[_0x4d4f('0x4')]},'read1stAt':{'type':Sequelize[_0x4d4f('0x3')]},'threadId':{'type':Sequelize[_0x4d4f('0x4')]},'externalUrl':{'type':Sequelize[_0x4d4f('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x4d4f('0x5')]('in',_0x4d4f('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x4d4f('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x4d4f('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x4d4f('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 775d81d..e4559a7 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 _0xac1b=['closed','disposition','threadId','Private','basename','createReadStream','createWriteStream','out','System','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','rimraf','zip-dir','moment','util','path','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','then','name','send','index','map','OpenchannelInteraction','fieldName','type','key','findAll','openchannel','query','user','catch','from','model','rawAttributes','keys','intersection','fields','attributes','includeAll','options','find','create','body','update','params','describe','OpenchannelMessage','addMessage','ids','getMessages','findOne','length','nolimit','sort','where','filters','pick','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','merge','include','rows','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','unix','toString','join','root','server','files','tmp','attachments','push','User','fullname','CmContact','Contact','firstName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','get','Openchannel','Owner','N.A.'];(function(_0x32c4b8,_0x277f22){var _0x1d0868=function(_0x267d62){while(--_0x267d62){_0x32c4b8['push'](_0x32c4b8['shift']());}};_0x1d0868(++_0x277f22);}(_0xac1b,0x18c));var _0xbac1=function(_0x62465e,_0x2f58a4){_0x62465e=_0x62465e-0x0;var _0x5c6979=_0xac1b[_0x62465e];return _0x5c6979;};'use strict';var rimraf=require(_0xbac1('0x0'));var zipdir=require(_0xbac1('0x1'));var moment=require(_0xbac1('0x2'));var util=require(_0xbac1('0x3'));var path=require(_0xbac1('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0xbac1('0x5'));var interaction=require(_0xbac1('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0xbac1('0x7'));var logger=require(_0xbac1('0x8'))(_0xbac1('0x9'));var config=require(_0xbac1('0xa'));var db=require(_0xbac1('0xb'))['db'];config['redis']=_[_0xbac1('0xc')](config[_0xbac1('0xd')],{'host':_0xbac1('0xe'),'port':0x18eb});var socket=require(_0xbac1('0xf'))(new Redis(config[_0xbac1('0xd')]));require(_0xbac1('0x10'))[_0xbac1('0x11')](socket);function respondWithStatusCode(_0x1e69d8,_0x2f926a){_0x2f926a=_0x2f926a||0xcc;return function(_0x3bb5ae){if(_0x3bb5ae){return _0x1e69d8[_0xbac1('0x12')](_0x2f926a);}return _0x1e69d8['status'](_0x2f926a)[_0xbac1('0x13')]();};}function respondWithResult(_0x22348b,_0x2ae537){_0x2ae537=_0x2ae537||0xc8;return function(_0x29364d){if(_0x29364d){return _0x22348b['status'](_0x2ae537)[_0xbac1('0x14')](_0x29364d);}};}function respondWithFilteredResult(_0x647890,_0x1a22f8){return function(_0x266e72){if(_0x266e72){var _0x35da23=typeof _0x1a22f8[_0xbac1('0x15')]===_0xbac1('0x16')&&typeof _0x1a22f8[_0xbac1('0x17')]===_0xbac1('0x16');var _0x519236=_0x266e72[_0xbac1('0x18')];var _0x4b8355=_0x35da23?0x0:_0x1a22f8[_0xbac1('0x15')];var _0x125b9e=_0x35da23?_0x266e72['count']:_0x1a22f8[_0xbac1('0x15')]+_0x1a22f8['limit'];var _0x40cf8b;if(_0x125b9e>=_0x519236){_0x125b9e=_0x519236;_0x40cf8b=0xc8;}else{_0x40cf8b=0xce;}_0x647890[_0xbac1('0x19')](_0x40cf8b);return _0x647890[_0xbac1('0x1a')](_0xbac1('0x1b'),_0x4b8355+'-'+_0x125b9e+'/'+_0x519236)[_0xbac1('0x14')](_0x266e72);}return null;};}function saveUpdates(_0xc2ea2f){return function(_0x193ea3){if(_0x193ea3){return _0x193ea3['update'](_0xc2ea2f)[_0xbac1('0x1c')](function(_0x15e9a1){return _0x15e9a1;});}return null;};}function removeEntity(_0x446498){return function(_0x28bd00){if(_0x28bd00){return _0x28bd00['destroy']()[_0xbac1('0x1c')](function(){_0x446498['status'](0xcc)[_0xbac1('0x13')]();});}};}function handleEntityNotFound(_0x375234){return function(_0x5ed923){if(!_0x5ed923){_0x375234['sendStatus'](0x194);}return _0x5ed923;};}function handleError(_0x371897,_0x13dec7){_0x13dec7=_0x13dec7||0x1f4;return function(_0x12d290){logger['error'](_0x12d290['stack']);if(_0x12d290[_0xbac1('0x1d')]){delete _0x12d290[_0xbac1('0x1d')];}_0x371897[_0xbac1('0x19')](_0x13dec7)[_0xbac1('0x1e')](_0x12d290);};}exports[_0xbac1('0x1f')]=function(_0x41dde3,_0x14fcc1){var _0x168c3a={};var _0x2e9677=_[_0xbac1('0x20')](db[_0xbac1('0x21')]['rawAttributes'],function(_0x2baa11){return{'name':_0x2baa11[_0xbac1('0x22')],'type':_0x2baa11[_0xbac1('0x23')][_0xbac1('0x24')]};});_0x168c3a=qs['getOptions'](_0x2e9677,_0x41dde3);return interaction[_0xbac1('0x25')](_0xbac1('0x26'),_0x41dde3[_0xbac1('0x27')],_0x41dde3[_0xbac1('0x28')],_0x168c3a,_0x2e9677)[_0xbac1('0x1c')](respondWithFilteredResult(_0x14fcc1,_0x168c3a))[_0xbac1('0x29')](handleError(_0x14fcc1,null));};exports['show']=function(_0x2a0090,_0x20db82){var _0x892dac={};if(_0x2a0090[_0xbac1('0x27')][_0xbac1('0x23')]&&_0x2a0090[_0xbac1('0x27')]['type']===_0xbac1('0x2a')){_0x892dac[_0xbac1('0x2a')]=_0x2a0090['params']['id'];}else{_0x892dac['id']=_0x2a0090['params']['id'];}var _0x574238={'raw':![],'where':_0x892dac},_0x15dc9a={};_0x15dc9a[_0xbac1('0x2b')]=_['keys'](db[_0xbac1('0x21')][_0xbac1('0x2c')]);_0x15dc9a[_0xbac1('0x27')]=_[_0xbac1('0x2d')](_0x2a0090['query']);_0x15dc9a['filters']=_[_0xbac1('0x2e')](_0x15dc9a[_0xbac1('0x2b')],_0x15dc9a[_0xbac1('0x27')]);_0x574238['attributes']=_[_0xbac1('0x2e')](_0x15dc9a['model'],qs['fields'](_0x2a0090['query'][_0xbac1('0x2f')]));_0x574238[_0xbac1('0x30')]=_0x574238['attributes']['length']?_0x574238['attributes']:_0x15dc9a[_0xbac1('0x2b')];if(_0x2a0090['query'][_0xbac1('0x31')]){_0x574238['include']=[{'all':!![]}];}_0x574238=_['merge']({},_0x574238,_0x2a0090[_0xbac1('0x32')]);return db[_0xbac1('0x21')][_0xbac1('0x33')](_0x574238)['then'](handleEntityNotFound(_0x20db82,null))[_0xbac1('0x1c')](respondWithResult(_0x20db82,null))[_0xbac1('0x29')](handleError(_0x20db82,null));};exports[_0xbac1('0x34')]=function(_0x4568df,_0x17182c){return db[_0xbac1('0x21')]['create'](_0x4568df[_0xbac1('0x35')],{})[_0xbac1('0x1c')](respondWithResult(_0x17182c,0xc9))[_0xbac1('0x29')](handleError(_0x17182c,null));};exports[_0xbac1('0x36')]=function(_0x2aa85d,_0x8af413){if(_0x2aa85d[_0xbac1('0x35')]['id']){delete _0x2aa85d[_0xbac1('0x35')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x2aa85d['params']['id']}})['then'](handleEntityNotFound(_0x8af413,null))['then'](saveUpdates(_0x2aa85d[_0xbac1('0x35')],null))[_0xbac1('0x1c')](respondWithResult(_0x8af413,null))[_0xbac1('0x29')](handleError(_0x8af413,null));};exports['destroy']=function(_0x47caa5,_0x46ed0b){return db['OpenchannelInteraction']['find']({'where':{'id':_0x47caa5[_0xbac1('0x37')]['id']}})[_0xbac1('0x1c')](handleEntityNotFound(_0x46ed0b,null))[_0xbac1('0x1c')](removeEntity(_0x46ed0b,null))[_0xbac1('0x29')](handleError(_0x46ed0b,null));};exports[_0xbac1('0x38')]=function(_0xcfd299,_0x22a899){return db[_0xbac1('0x21')][_0xbac1('0x38')]()['then'](respondWithResult(_0x22a899,null))[_0xbac1('0x29')](handleError(_0x22a899,null));};exports['addMessage']=function(_0x23e089,_0x28e074){return db[_0xbac1('0x39')]['find']({'where':{'id':_0x23e089[_0xbac1('0x37')]['id']}})[_0xbac1('0x1c')](handleEntityNotFound(_0x28e074,null))['then'](function(_0x5e6385){if(_0x5e6385){return _0x5e6385[_0xbac1('0x3a')](_0x23e089['body']['ids'],_['omit'](_0x23e089['body'],[_0xbac1('0x3b'),'id'])||{});}})[_0xbac1('0x1c')](respondWithResult(_0x28e074,null))[_0xbac1('0x29')](handleError(_0x28e074,null));};exports[_0xbac1('0x3c')]=function(_0x1c6118,_0x155cdb){var _0xad7b44={'raw':![],'where':{}};var _0x26af54={};var _0x716104={'count':0x0,'rows':[]};return db[_0xbac1('0x21')][_0xbac1('0x3d')]({'where':{'id':_0x1c6118[_0xbac1('0x37')]['id']}})[_0xbac1('0x1c')](handleEntityNotFound(_0x155cdb,null))['then'](function(_0xca2453){if(_0xca2453){_0x26af54[_0xbac1('0x2b')]=_[_0xbac1('0x2d')](db[_0xbac1('0x39')]['rawAttributes']);_0x26af54[_0xbac1('0x27')]=_[_0xbac1('0x2d')](_0x1c6118[_0xbac1('0x27')]);_0x26af54['filters']=_['intersection'](_0x26af54[_0xbac1('0x2b')],_0x26af54[_0xbac1('0x27')]);_0xad7b44[_0xbac1('0x30')]=_[_0xbac1('0x2e')](_0x26af54[_0xbac1('0x2b')],qs[_0xbac1('0x2f')](_0x1c6118['query']['fields']));_0xad7b44['attributes']=_0xad7b44['attributes'][_0xbac1('0x3e')]?_0xad7b44[_0xbac1('0x30')]:_0x26af54[_0xbac1('0x2b')];if(!_0x1c6118[_0xbac1('0x27')]['hasOwnProperty'](_0xbac1('0x3f'))){_0xad7b44[_0xbac1('0x17')]=qs[_0xbac1('0x17')](_0x1c6118[_0xbac1('0x27')][_0xbac1('0x17')]);_0xad7b44[_0xbac1('0x15')]=qs[_0xbac1('0x15')](_0x1c6118[_0xbac1('0x27')]['offset']);}_0xad7b44['order']=qs[_0xbac1('0x40')](_0x1c6118[_0xbac1('0x27')]['sort']);_0xad7b44[_0xbac1('0x41')]=qs[_0xbac1('0x42')](_[_0xbac1('0x43')](_0x1c6118[_0xbac1('0x27')],_0x26af54[_0xbac1('0x42')]));_0xad7b44[_0xbac1('0x41')]['OpenchannelInteractionId']=_0xca2453['id'];if(_0x1c6118['query'][_0xbac1('0x44')]){_0xad7b44[_0xbac1('0x41')]=_['merge'](_0xad7b44[_0xbac1('0x41')],{'$or':_[_0xbac1('0x20')](_0xad7b44[_0xbac1('0x30')],function(_0x5b35f3){var _0x5c60c1={};_0x5c60c1[_0x5b35f3]={'$like':'%'+_0x1c6118['query'][_0xbac1('0x44')]+'%'};return _0x5c60c1;})});}if(_0x1c6118['query'][_0xbac1('0x45')]){var _0x2b0cac=_0x1c6118[_0xbac1('0x27')][_0xbac1('0x45')]['split'](',');var _0x5abad3={};_0x5abad3[_0x2b0cac[0x0]]={'$gte':moment(_0x2b0cac[0x1])[_0xbac1('0x46')](_0xbac1('0x47'))};_0xad7b44[_0xbac1('0x41')]=_['merge'](_0xad7b44[_0xbac1('0x41')],_0x5abad3);}_0xad7b44=_[_0xbac1('0x48')]({},_0xad7b44,_0x1c6118[_0xbac1('0x32')]);return db['OpenchannelMessage']['count']({'where':_0xad7b44[_0xbac1('0x41')]})['then'](function(_0x153844){_0x716104[_0xbac1('0x18')]=_0x153844;if(_0x1c6118[_0xbac1('0x27')][_0xbac1('0x31')]){_0xad7b44[_0xbac1('0x49')]=[{'all':!![]}];}return db[_0xbac1('0x39')][_0xbac1('0x25')](_0xad7b44);})['then'](function(_0x1fb4e5){_0x716104[_0xbac1('0x4a')]=_0x1fb4e5;return _0x716104;});}})[_0xbac1('0x1c')](respondWithFilteredResult(_0x155cdb,_0xad7b44))[_0xbac1('0x29')](handleError(_0x155cdb,null));};exports[_0xbac1('0x4b')]=function(_0x16a0c8,_0x2c11ac){return db['OpenchannelInteraction']['find']({'where':{'id':_0x16a0c8['params']['id']}})['then'](handleEntityNotFound(_0x2c11ac,null))['then'](function(_0x15c376){if(_0x15c376){return _0x15c376[_0xbac1('0x4c')](_0x16a0c8[_0xbac1('0x35')][_0xbac1('0x3b')],_['omit'](_0x16a0c8[_0xbac1('0x35')],[_0xbac1('0x3b'),'id'])||{})[_0xbac1('0x4d')](function(){return db['Tag']['findAll']({'attributes':['id',_0xbac1('0x1d'),_0xbac1('0x4e')],'where':{'id':_0x16a0c8[_0xbac1('0x35')][_0xbac1('0x3b')]}});})[_0xbac1('0x1c')](function(_0x3f904c){socket[_0xbac1('0x4f')](_0xbac1('0x50'),{'id':Number(_0x16a0c8[_0xbac1('0x37')]['id']),'tags':_0x3f904c||[]});return{'id':Number(_0x16a0c8[_0xbac1('0x37')]['id']),'tags':_0x3f904c||[]};});}})[_0xbac1('0x1c')](respondWithResult(_0x2c11ac,null))[_0xbac1('0x29')](handleError(_0x2c11ac,null));};exports[_0xbac1('0x51')]=function(_0x5788bc,_0x5bd71e){return db[_0xbac1('0x21')][_0xbac1('0x33')]({'where':{'id':_0x5788bc[_0xbac1('0x37')]['id']}})[_0xbac1('0x1c')](handleEntityNotFound(_0x5bd71e,null))['then'](function(_0x2e89ec){if(_0x2e89ec){return _0x2e89ec['removeTags'](_0x5788bc[_0xbac1('0x27')][_0xbac1('0x3b')]);}})[_0xbac1('0x1c')](respondWithStatusCode(_0x5bd71e,null))[_0xbac1('0x29')](handleError(_0x5bd71e,null));};exports['download']=function(_0x10604f,_0x223663){var _0xdabcd=moment()[_0xbac1('0x52')]()[_0xbac1('0x53')]();var _0x34c0d9=path[_0xbac1('0x54')](config[_0xbac1('0x55')],_0xbac1('0x56'),_0xbac1('0x57'),_0xbac1('0x58'));var _0x15bb6c=path[_0xbac1('0x54')](config[_0xbac1('0x55')],_0xbac1('0x56'),_0xbac1('0x57'),_0xbac1('0x59'));var _0xdbf1f9=path[_0xbac1('0x54')](_0x34c0d9,_0xdabcd);var _0x519cf8=util['format']('transcript-%d-%s.zip',_0x10604f[_0xbac1('0x37')]['id'],_0xdabcd);var _0x3c3dd2=path[_0xbac1('0x54')](_0x34c0d9,_0x519cf8);var _0x2815fe=[];_0x2815fe[_0xbac1('0x5a')]({'model':db[_0xbac1('0x5b')],'as':_0xbac1('0x5b'),'attributes':['id',_0xbac1('0x5c')],'raw':!![]});_0x2815fe[_0xbac1('0x5a')]({'model':db[_0xbac1('0x5d')],'as':_0xbac1('0x5e'),'attributes':['id',_0xbac1('0x5f'),'lastName'],'raw':!![]});if(_0x10604f[_0xbac1('0x27')][_0xbac1('0x59')]){_0x2815fe[_0xbac1('0x5a')]({'model':db[_0xbac1('0x60')],'as':_0xbac1('0x60'),'raw':!![]});}var _0x4056ee=[{'model':db[_0xbac1('0x39')],'as':_0xbac1('0x61'),'attributes':['id',_0xbac1('0x35'),_0xbac1('0x62'),_0xbac1('0x63'),_0xbac1('0x64'),_0xbac1('0x65')],'include':_0x2815fe}];_0x4056ee[_0xbac1('0x5a')]({'model':db[_0xbac1('0x66')],'as':_0xbac1('0x67'),'attributes':['id',_0xbac1('0x1d')]});_0x4056ee['push']({'model':db[_0xbac1('0x5b')],'as':'Owner','attributes':['id',_0xbac1('0x5c')]});return db[_0xbac1('0x21')][_0xbac1('0x33')]({'where':{'id':_0x10604f[_0xbac1('0x37')]['id']},'include':_0x4056ee})['then'](handleEntityNotFound(_0x223663,null))['then'](function(_0x3771e5){if(_0x3771e5){var _0x19ee8c=_0x3771e5[_0xbac1('0x68')]({'plain':!![]});fs['mkdirSync'](_0xdbf1f9);var _0x360509={'channel':_0xbac1('0x69'),'account':_0x19ee8c[_0xbac1('0x67')][_0xbac1('0x1d')],'agent':_0x19ee8c['Owner']?_0x19ee8c[_0xbac1('0x6a')][_0xbac1('0x5c')]:_0xbac1('0x6b'),'createdAt':moment(_0x19ee8c[_0xbac1('0x62')])['format'](_0xbac1('0x47'))[_0xbac1('0x53')](),'closedAt':_0x19ee8c[_0xbac1('0x6c')]?moment(_0x19ee8c['closedAt'])[_0xbac1('0x46')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x19ee8c[_0xbac1('0x6d')],'visibility':_0x19ee8c[_0xbac1('0x6e')]?'Public':_0xbac1('0x6f'),'messages':_(_0x19ee8c['Messages'])[_0xbac1('0x44')]({'secret':![]})[_0xbac1('0x20')](function(_0x7d3d4e){if(_0x7d3d4e[_0xbac1('0x60')]){var _0x533418=path['join'](_0x15bb6c,_0x7d3d4e['Attachment'][_0xbac1('0x70')]);if(fs['existsSync'](_0x533418)){fs[_0xbac1('0x71')](_0x533418)['pipe'](fs[_0xbac1('0x72')](path['join'](_0xdbf1f9,_0x7d3d4e[_0xbac1('0x60')][_0xbac1('0x70')])));}}return{'date':moment(_0x7d3d4e[_0xbac1('0x62')])[_0xbac1('0x46')](_0xbac1('0x47'))[_0xbac1('0x53')](),'sender':_0x7d3d4e[_0xbac1('0x63')]===_0xbac1('0x73')?_0x7d3d4e[_0xbac1('0x5b')]?_0x7d3d4e[_0xbac1('0x5b')][_0xbac1('0x5c')]:_0xbac1('0x74'):_0x7d3d4e['Contact'][_0xbac1('0x5f')]+(_0x7d3d4e[_0xbac1('0x5e')]['lastName']?'\x20'+_0x7d3d4e[_0xbac1('0x5e')]['lastName']:''),'body':_0x7d3d4e[_0xbac1('0x60')]?_0x7d3d4e['Attachment'][_0xbac1('0x70')]:_0x7d3d4e[_0xbac1('0x35')],'direction':_0x7d3d4e[_0xbac1('0x63')]===_0xbac1('0x73')?'A':'C','secret':_0x7d3d4e['secret'],'read':_0x7d3d4e[_0xbac1('0x65')],'attachment':_0x7d3d4e[_0xbac1('0x60')]};})[_0xbac1('0x75')]()};return ejs[_0xbac1('0x76')](path[_0xbac1('0x54')](config[_0xbac1('0x55')],'server',_0xbac1('0x77'),_0xbac1('0x78')),{'interaction':_0x360509})[_0xbac1('0x1c')](function(_0x2db86a){var _0x14246e=path[_0xbac1('0x54')](_0xdbf1f9,_0xbac1('0x79')+_0x19ee8c['id']+'-'+_0xdabcd+_0xbac1('0x7a'));var _0x17b041={'path':_0x14246e,'channel':_0xbac1('0x69'),'interactionId':_0x19ee8c['id']};return pdf[_0xbac1('0x7b')](_0x2db86a,_0x17b041);})[_0xbac1('0x1c')](function(){return new Promise(function(_0x326603,_0x24fc9e){zipdir(_0xdbf1f9,{'saveTo':_0x3c3dd2},function(_0x19f150,_0xfd8054){if(_0x19f150)return _0x24fc9e(_0x19f150);return _0x326603(_0xfd8054);});})['then'](function(){return new Promise(function(_0x4520b5,_0x180685){rimraf(_0xdbf1f9,function(_0xe36718){if(_0xe36718)_0x180685(_0xe36718);return _0x4520b5();});});})['then'](function(){return _0x223663[_0xbac1('0x7c')](_0x3c3dd2,_0x519cf8,function(_0x4c4457){if(_0x4c4457){logger['error'](_0xbac1('0x7d'),_0x4c4457);}else{fs['unlinkSync'](_0x3c3dd2);}});});});}else{return _0x223663[_0xbac1('0x12')](0xc8);}})['catch'](handleError(_0x223663,null));}; \ No newline at end of file +var _0x945e=['catch','create','body','find','describe','addMessage','ids','findOne','OpenchannelMessage','nolimit','order','sort','where','filters','pick','OpenchannelInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','omit','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','server','tmp','files','format','transcript-%d-%s.zip','push','CmContact','Contact','firstName','lastName','Attachment','direction','secret','read','OpenchannelAccount','User','Owner','fullname','get','Openchannel','Account','N.A.','createdAt','closedAt','disposition','threadId','Public','basename','existsSync','pipe','System','out','value','renderFile','root','views','.pdf','Unable\x20to\x20delete\x20zip\x20file','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./openchannelInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','update','then','destroy','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','openchannel','query','user','show','from','params','model','keys','intersection','fields','attributes','length','includeAll','include','merge','options'];(function(_0x49cf9f,_0x15bc97){var _0xc52aba=function(_0x16a90e){while(--_0x16a90e){_0x49cf9f['push'](_0x49cf9f['shift']());}};_0xc52aba(++_0x15bc97);}(_0x945e,0xca));var _0xe945=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x945e[_0x455c6c];return _0x488242;};'use strict';var rimraf=require(_0xe945('0x0'));var zipdir=require(_0xe945('0x1'));var moment=require(_0xe945('0x2'));var util=require(_0xe945('0x3'));var path=require(_0xe945('0x4'));var ejs=require(_0xe945('0x5'));var fs=require('fs');var _=require(_0xe945('0x6'));var Redis=require(_0xe945('0x7'));var interaction=require(_0xe945('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0xe945('0x9'));var logger=require(_0xe945('0xa'))(_0xe945('0xb'));var config=require(_0xe945('0xc'));var db=require(_0xe945('0xd'))['db'];config[_0xe945('0xe')]=_[_0xe945('0xf')](config[_0xe945('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe945('0x10'))[_0xe945('0x11')](socket);function respondWithStatusCode(_0x21871e,_0x44a37b){_0x44a37b=_0x44a37b||0xcc;return function(_0x30f7f6){if(_0x30f7f6){return _0x21871e[_0xe945('0x12')](_0x44a37b);}return _0x21871e[_0xe945('0x13')](_0x44a37b)[_0xe945('0x14')]();};}function respondWithResult(_0x455342,_0xc54571){_0xc54571=_0xc54571||0xc8;return function(_0x2651c3){if(_0x2651c3){return _0x455342['status'](_0xc54571)['json'](_0x2651c3);}};}function respondWithFilteredResult(_0xb9b789,_0x5d9731){return function(_0x129068){if(_0x129068){var _0x2ecffc=typeof _0x5d9731[_0xe945('0x15')]===_0xe945('0x16')&&typeof _0x5d9731[_0xe945('0x17')]===_0xe945('0x16');var _0x4e0eca=_0x129068[_0xe945('0x18')];var _0x1b0130=_0x2ecffc?0x0:_0x5d9731['offset'];var _0x11d1c3=_0x2ecffc?_0x129068[_0xe945('0x18')]:_0x5d9731[_0xe945('0x15')]+_0x5d9731[_0xe945('0x17')];var _0x97d259;if(_0x11d1c3>=_0x4e0eca){_0x11d1c3=_0x4e0eca;_0x97d259=0xc8;}else{_0x97d259=0xce;}_0xb9b789[_0xe945('0x13')](_0x97d259);return _0xb9b789['set'](_0xe945('0x19'),_0x1b0130+'-'+_0x11d1c3+'/'+_0x4e0eca)[_0xe945('0x1a')](_0x129068);}return null;};}function saveUpdates(_0xb411bb){return function(_0x5c438d){if(_0x5c438d){return _0x5c438d[_0xe945('0x1b')](_0xb411bb)[_0xe945('0x1c')](function(_0x2302fa){return _0x2302fa;});}return null;};}function removeEntity(_0x23d833){return function(_0xbdd0f4){if(_0xbdd0f4){return _0xbdd0f4[_0xe945('0x1d')]()['then'](function(){_0x23d833['status'](0xcc)[_0xe945('0x14')]();});}};}function handleEntityNotFound(_0x4572ab){return function(_0x22d687){if(!_0x22d687){_0x4572ab['sendStatus'](0x194);}return _0x22d687;};}function handleError(_0x5e33ec,_0x412ede){_0x412ede=_0x412ede||0x1f4;return function(_0x5bd12e){logger[_0xe945('0x1e')](_0x5bd12e[_0xe945('0x1f')]);if(_0x5bd12e[_0xe945('0x20')]){delete _0x5bd12e['name'];}_0x5e33ec['status'](_0x412ede)[_0xe945('0x21')](_0x5bd12e);};}exports[_0xe945('0x22')]=function(_0x71fc74,_0x13fecb){var _0x15b264={};var _0x228741=_[_0xe945('0x23')](db[_0xe945('0x24')][_0xe945('0x25')],function(_0x1aee5b){return{'name':_0x1aee5b[_0xe945('0x26')],'type':_0x1aee5b[_0xe945('0x27')][_0xe945('0x28')]};});_0x15b264=qs[_0xe945('0x29')](_0x228741,_0x71fc74);return interaction['findAll'](_0xe945('0x2a'),_0x71fc74[_0xe945('0x2b')],_0x71fc74[_0xe945('0x2c')],_0x15b264,_0x228741)[_0xe945('0x1c')](respondWithFilteredResult(_0x13fecb,_0x15b264))['catch'](handleError(_0x13fecb,null));};exports[_0xe945('0x2d')]=function(_0x5c0ec9,_0x108868){var _0x3ade55={};if(_0x5c0ec9['query']['type']&&_0x5c0ec9[_0xe945('0x2b')][_0xe945('0x27')]===_0xe945('0x2e')){_0x3ade55[_0xe945('0x2e')]=_0x5c0ec9[_0xe945('0x2f')]['id'];}else{_0x3ade55['id']=_0x5c0ec9[_0xe945('0x2f')]['id'];}var _0x2ff907={'raw':![],'where':_0x3ade55},_0x32f7bb={};_0x32f7bb[_0xe945('0x30')]=_[_0xe945('0x31')](db['OpenchannelInteraction'][_0xe945('0x25')]);_0x32f7bb[_0xe945('0x2b')]=_['keys'](_0x5c0ec9[_0xe945('0x2b')]);_0x32f7bb['filters']=_[_0xe945('0x32')](_0x32f7bb[_0xe945('0x30')],_0x32f7bb['query']);_0x2ff907['attributes']=_['intersection'](_0x32f7bb['model'],qs[_0xe945('0x33')](_0x5c0ec9['query']['fields']));_0x2ff907['attributes']=_0x2ff907[_0xe945('0x34')][_0xe945('0x35')]?_0x2ff907[_0xe945('0x34')]:_0x32f7bb[_0xe945('0x30')];if(_0x5c0ec9['query'][_0xe945('0x36')]){_0x2ff907[_0xe945('0x37')]=[{'all':!![]}];}_0x2ff907=_[_0xe945('0x38')]({},_0x2ff907,_0x5c0ec9[_0xe945('0x39')]);return db['OpenchannelInteraction']['find'](_0x2ff907)[_0xe945('0x1c')](handleEntityNotFound(_0x108868,null))[_0xe945('0x1c')](respondWithResult(_0x108868,null))[_0xe945('0x3a')](handleError(_0x108868,null));};exports['create']=function(_0x413aef,_0x40ffae){return db[_0xe945('0x24')][_0xe945('0x3b')](_0x413aef[_0xe945('0x3c')],{})[_0xe945('0x1c')](respondWithResult(_0x40ffae,0xc9))[_0xe945('0x3a')](handleError(_0x40ffae,null));};exports[_0xe945('0x1b')]=function(_0x3df916,_0x53292b){if(_0x3df916['body']['id']){delete _0x3df916[_0xe945('0x3c')]['id'];}return db[_0xe945('0x24')][_0xe945('0x3d')]({'where':{'id':_0x3df916[_0xe945('0x2f')]['id']}})[_0xe945('0x1c')](handleEntityNotFound(_0x53292b,null))[_0xe945('0x1c')](saveUpdates(_0x3df916[_0xe945('0x3c')],null))[_0xe945('0x1c')](respondWithResult(_0x53292b,null))[_0xe945('0x3a')](handleError(_0x53292b,null));};exports['destroy']=function(_0x533d38,_0x500b3a){return db[_0xe945('0x24')]['find']({'where':{'id':_0x533d38[_0xe945('0x2f')]['id']}})[_0xe945('0x1c')](handleEntityNotFound(_0x500b3a,null))['then'](removeEntity(_0x500b3a,null))[_0xe945('0x3a')](handleError(_0x500b3a,null));};exports[_0xe945('0x3e')]=function(_0x2166a1,_0x2d7ece){return db[_0xe945('0x24')][_0xe945('0x3e')]()[_0xe945('0x1c')](respondWithResult(_0x2d7ece,null))[_0xe945('0x3a')](handleError(_0x2d7ece,null));};exports[_0xe945('0x3f')]=function(_0x21b91e,_0x4612dc){return db['OpenchannelMessage']['find']({'where':{'id':_0x21b91e['params']['id']}})['then'](handleEntityNotFound(_0x4612dc,null))['then'](function(_0x19f448){if(_0x19f448){return _0x19f448['addMessage'](_0x21b91e[_0xe945('0x3c')][_0xe945('0x40')],_['omit'](_0x21b91e[_0xe945('0x3c')],[_0xe945('0x40'),'id'])||{});}})[_0xe945('0x1c')](respondWithResult(_0x4612dc,null))[_0xe945('0x3a')](handleError(_0x4612dc,null));};exports['getMessages']=function(_0x55fba1,_0x5ce8ca){var _0x4aca43={'raw':![],'where':{}};var _0x1a2eac={};var _0x14262e={'count':0x0,'rows':[]};return db[_0xe945('0x24')][_0xe945('0x41')]({'where':{'id':_0x55fba1[_0xe945('0x2f')]['id']}})[_0xe945('0x1c')](handleEntityNotFound(_0x5ce8ca,null))[_0xe945('0x1c')](function(_0x475a51){if(_0x475a51){_0x1a2eac[_0xe945('0x30')]=_['keys'](db[_0xe945('0x42')][_0xe945('0x25')]);_0x1a2eac[_0xe945('0x2b')]=_[_0xe945('0x31')](_0x55fba1[_0xe945('0x2b')]);_0x1a2eac['filters']=_[_0xe945('0x32')](_0x1a2eac[_0xe945('0x30')],_0x1a2eac[_0xe945('0x2b')]);_0x4aca43[_0xe945('0x34')]=_['intersection'](_0x1a2eac[_0xe945('0x30')],qs['fields'](_0x55fba1[_0xe945('0x2b')]['fields']));_0x4aca43[_0xe945('0x34')]=_0x4aca43[_0xe945('0x34')][_0xe945('0x35')]?_0x4aca43[_0xe945('0x34')]:_0x1a2eac[_0xe945('0x30')];if(!_0x55fba1[_0xe945('0x2b')]['hasOwnProperty'](_0xe945('0x43'))){_0x4aca43[_0xe945('0x17')]=qs[_0xe945('0x17')](_0x55fba1[_0xe945('0x2b')][_0xe945('0x17')]);_0x4aca43[_0xe945('0x15')]=qs['offset'](_0x55fba1[_0xe945('0x2b')][_0xe945('0x15')]);}_0x4aca43[_0xe945('0x44')]=qs['sort'](_0x55fba1['query'][_0xe945('0x45')]);_0x4aca43[_0xe945('0x46')]=qs[_0xe945('0x47')](_[_0xe945('0x48')](_0x55fba1[_0xe945('0x2b')],_0x1a2eac[_0xe945('0x47')]));_0x4aca43[_0xe945('0x46')][_0xe945('0x49')]=_0x475a51['id'];if(_0x55fba1[_0xe945('0x2b')][_0xe945('0x4a')]){_0x4aca43[_0xe945('0x46')]=_[_0xe945('0x38')](_0x4aca43[_0xe945('0x46')],{'$or':_[_0xe945('0x23')](_0x4aca43['attributes'],function(_0x3f2646){var _0x141929={};_0x141929[_0x3f2646]={'$like':'%'+_0x55fba1[_0xe945('0x2b')][_0xe945('0x4a')]+'%'};return _0x141929;})});}if(_0x55fba1[_0xe945('0x2b')][_0xe945('0x4b')]){var _0x18c1d9=_0x55fba1[_0xe945('0x2b')][_0xe945('0x4b')][_0xe945('0x4c')](',');var _0x20381a={};_0x20381a[_0x18c1d9[0x0]]={'$gte':moment(_0x18c1d9[0x1])['format'](_0xe945('0x4d'))};_0x4aca43[_0xe945('0x46')]=_[_0xe945('0x38')](_0x4aca43[_0xe945('0x46')],_0x20381a);}_0x4aca43=_[_0xe945('0x38')]({},_0x4aca43,_0x55fba1[_0xe945('0x39')]);return db[_0xe945('0x42')][_0xe945('0x18')]({'where':_0x4aca43['where']})['then'](function(_0x397451){_0x14262e[_0xe945('0x18')]=_0x397451;if(_0x55fba1[_0xe945('0x2b')][_0xe945('0x36')]){_0x4aca43[_0xe945('0x37')]=[{'all':!![]}];}return db[_0xe945('0x42')][_0xe945('0x4e')](_0x4aca43);})['then'](function(_0x4d7254){_0x14262e[_0xe945('0x4f')]=_0x4d7254;return _0x14262e;});}})[_0xe945('0x1c')](respondWithFilteredResult(_0x5ce8ca,_0x4aca43))[_0xe945('0x3a')](handleError(_0x5ce8ca,null));};exports[_0xe945('0x50')]=function(_0x21df57,_0x183b59){return db[_0xe945('0x24')][_0xe945('0x3d')]({'where':{'id':_0x21df57['params']['id']}})[_0xe945('0x1c')](handleEntityNotFound(_0x183b59,null))[_0xe945('0x1c')](function(_0x16a8f9){if(_0x16a8f9){return _0x16a8f9[_0xe945('0x51')](_0x21df57[_0xe945('0x3c')][_0xe945('0x40')],_[_0xe945('0x52')](_0x21df57[_0xe945('0x3c')],[_0xe945('0x40'),'id'])||{})[_0xe945('0x53')](function(){return db['Tag'][_0xe945('0x4e')]({'attributes':['id','name',_0xe945('0x54')],'where':{'id':_0x21df57[_0xe945('0x3c')]['ids']}});})[_0xe945('0x1c')](function(_0x5e6d66){socket[_0xe945('0x55')](_0xe945('0x56'),{'id':Number(_0x21df57[_0xe945('0x2f')]['id']),'tags':_0x5e6d66||[]});return{'id':Number(_0x21df57['params']['id']),'tags':_0x5e6d66||[]};});}})[_0xe945('0x1c')](respondWithResult(_0x183b59,null))['catch'](handleError(_0x183b59,null));};exports['removeTags']=function(_0x4927e0,_0x35cbb3){return db['OpenchannelInteraction'][_0xe945('0x3d')]({'where':{'id':_0x4927e0['params']['id']}})[_0xe945('0x1c')](handleEntityNotFound(_0x35cbb3,null))[_0xe945('0x1c')](function(_0x1fb214){if(_0x1fb214){return _0x1fb214[_0xe945('0x57')](_0x4927e0[_0xe945('0x2b')][_0xe945('0x40')]);}})[_0xe945('0x1c')](respondWithStatusCode(_0x35cbb3,null))[_0xe945('0x3a')](handleError(_0x35cbb3,null));};exports[_0xe945('0x58')]=function(_0x60187b,_0x3bab92){var _0x7cc56f=moment()[_0xe945('0x59')]()[_0xe945('0x5a')]();var _0x137a3a=path[_0xe945('0x5b')](config['root'],_0xe945('0x5c'),'files',_0xe945('0x5d'));var _0x1e75cf=path[_0xe945('0x5b')](config['root'],'server',_0xe945('0x5e'),'attachments');var _0x4ebfd=path[_0xe945('0x5b')](_0x137a3a,_0x7cc56f);var _0x371ee1=util[_0xe945('0x5f')](_0xe945('0x60'),_0x60187b[_0xe945('0x2f')]['id'],_0x7cc56f);var _0x3e7af4=path[_0xe945('0x5b')](_0x137a3a,_0x371ee1);var _0x110796=[];_0x110796[_0xe945('0x61')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x110796[_0xe945('0x61')]({'model':db[_0xe945('0x62')],'as':_0xe945('0x63'),'attributes':['id',_0xe945('0x64'),_0xe945('0x65')],'raw':!![]});if(_0x60187b[_0xe945('0x2b')]['attachments']){_0x110796[_0xe945('0x61')]({'model':db[_0xe945('0x66')],'as':_0xe945('0x66'),'raw':!![]});}var _0x1c168d=[{'model':db[_0xe945('0x42')],'as':'Messages','attributes':['id',_0xe945('0x3c'),'createdAt',_0xe945('0x67'),_0xe945('0x68'),_0xe945('0x69')],'include':_0x110796}];_0x1c168d[_0xe945('0x61')]({'model':db[_0xe945('0x6a')],'as':'Account','attributes':['id','name']});_0x1c168d[_0xe945('0x61')]({'model':db[_0xe945('0x6b')],'as':_0xe945('0x6c'),'attributes':['id',_0xe945('0x6d')]});return db[_0xe945('0x24')][_0xe945('0x3d')]({'where':{'id':_0x60187b[_0xe945('0x2f')]['id']},'include':_0x1c168d})[_0xe945('0x1c')](handleEntityNotFound(_0x3bab92,null))[_0xe945('0x1c')](function(_0x44b65c){if(_0x44b65c){var _0x48df12=_0x44b65c[_0xe945('0x6e')]({'plain':!![]});fs['mkdirSync'](_0x4ebfd);var _0x2323a5={'channel':_0xe945('0x6f'),'account':_0x48df12[_0xe945('0x70')][_0xe945('0x20')],'agent':_0x48df12[_0xe945('0x6c')]?_0x48df12['Owner'][_0xe945('0x6d')]:_0xe945('0x71'),'createdAt':moment(_0x48df12[_0xe945('0x72')])[_0xe945('0x5f')](_0xe945('0x4d'))[_0xe945('0x5a')](),'closedAt':_0x48df12['closed']?moment(_0x48df12[_0xe945('0x73')])[_0xe945('0x5f')](_0xe945('0x4d'))[_0xe945('0x5a')]():'','disposition':_0x48df12[_0xe945('0x74')],'visibility':_0x48df12[_0xe945('0x75')]?_0xe945('0x76'):'Private','messages':_(_0x48df12['Messages'])[_0xe945('0x4a')]({'secret':![]})[_0xe945('0x23')](function(_0x7edf9d){if(_0x7edf9d[_0xe945('0x66')]){var _0xdec3c0=path[_0xe945('0x5b')](_0x1e75cf,_0x7edf9d[_0xe945('0x66')][_0xe945('0x77')]);if(fs[_0xe945('0x78')](_0xdec3c0)){fs['createReadStream'](_0xdec3c0)[_0xe945('0x79')](fs['createWriteStream'](path[_0xe945('0x5b')](_0x4ebfd,_0x7edf9d[_0xe945('0x66')][_0xe945('0x77')])));}}return{'date':moment(_0x7edf9d['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe945('0x5a')](),'sender':_0x7edf9d[_0xe945('0x67')]==='out'?_0x7edf9d[_0xe945('0x6b')]?_0x7edf9d['User'][_0xe945('0x6d')]:_0xe945('0x7a'):_0x7edf9d[_0xe945('0x63')][_0xe945('0x64')]+(_0x7edf9d[_0xe945('0x63')][_0xe945('0x65')]?'\x20'+_0x7edf9d[_0xe945('0x63')][_0xe945('0x65')]:''),'body':_0x7edf9d[_0xe945('0x66')]?_0x7edf9d[_0xe945('0x66')]['basename']:_0x7edf9d['body'],'direction':_0x7edf9d[_0xe945('0x67')]===_0xe945('0x7b')?'A':'C','secret':_0x7edf9d[_0xe945('0x68')],'read':_0x7edf9d[_0xe945('0x69')],'attachment':_0x7edf9d['Attachment']};})[_0xe945('0x7c')]()};return ejs[_0xe945('0x7d')](path[_0xe945('0x5b')](config[_0xe945('0x7e')],_0xe945('0x5c'),_0xe945('0x7f'),'downloadInteraction.ejs'),{'interaction':_0x2323a5})[_0xe945('0x1c')](function(_0x23c29e){var _0x428da0=path[_0xe945('0x5b')](_0x4ebfd,'transcript-'+_0x48df12['id']+'-'+_0x7cc56f+_0xe945('0x80'));var _0x239e64={'path':_0x428da0,'channel':'Openchannel','interactionId':_0x48df12['id']};return pdf['createPdfFromHTML'](_0x23c29e,_0x239e64);})['then'](function(){return new Promise(function(_0x151818,_0x4ba97a){zipdir(_0x4ebfd,{'saveTo':_0x3e7af4},function(_0x2d2ba0,_0x3df028){if(_0x2d2ba0)return _0x4ba97a(_0x2d2ba0);return _0x151818(_0x3df028);});})[_0xe945('0x1c')](function(){return new Promise(function(_0x559771,_0x89f16a){rimraf(_0x4ebfd,function(_0x1373f1){if(_0x1373f1)_0x89f16a(_0x1373f1);return _0x559771();});});})[_0xe945('0x1c')](function(){return _0x3bab92[_0xe945('0x58')](_0x3e7af4,_0x371ee1,function(_0x3c6100){if(_0x3c6100){logger[_0xe945('0x1e')](_0xe945('0x81'),_0x3c6100);}else{fs['unlinkSync'](_0x3e7af4);}});});});}else{return _0x3bab92[_0xe945('0x12')](0xc8);}})['catch'](handleError(_0x3bab92,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 937992e..ee67ef4 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 _0x3e26=['setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','getUsers','then'];(function(_0x51b19b,_0x5015d2){var _0x1a3cd6=function(_0x495134){while(--_0x495134){_0x51b19b['push'](_0x51b19b['shift']());}};_0x1a3cd6(++_0x5015d2);}(_0x3e26,0x108));var _0x63e2=function(_0x4c1702,_0x53b1ad){_0x4c1702=_0x4c1702-0x0;var _0x39a0b4=_0x3e26[_0x4c1702];return _0x39a0b4;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x63e2('0x0'))['db'][_0x63e2('0x1')];var OpenchannelMessage=require(_0x63e2('0x0'))['db'][_0x63e2('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x63e2('0x3')](0x0);var events={'afterCreate':_0x63e2('0x4'),'afterUpdate':_0x63e2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5ebe00){return function(_0x314cbb,_0x33d62e,_0x352f0b){_0x314cbb[_0x63e2('0x6')]({'attributes':['id'],'raw':!![]})[_0x63e2('0x7')](function(_0x5c74c5){_0x314cbb[_0x63e2('0x8')]('Users',_0x5c74c5[_0x63e2('0x9')](function(_0x2eccd8){return{'id':_0x2eccd8['id']};}));return OpenchannelMessage[_0x63e2('0xa')]({'where':{'OpenchannelInteractionId':_0x314cbb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x63e2('0x7')](function(_0x2a6046){_0x314cbb['setDataValue'](_0x63e2('0xb'),_0x2a6046[_0x63e2('0xc')]);OpenchannelInteractionEvents['emit'](_0x5ebe00+':'+_0x314cbb['id'],_0x314cbb);OpenchannelInteractionEvents[_0x63e2('0xd')](_0x5ebe00,_0x314cbb);_0x352f0b(null);})[_0x63e2('0xe')](_0x352f0b(null));};}for(var e in events){if(events[_0x63e2('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x63e2('0x10')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x8020=['setMaxListeners','update','then','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','../../mysqldb','OpenchannelInteraction'];(function(_0x27a2e4,_0x4749d1){var _0x3acf63=function(_0x2afd9b){while(--_0x2afd9b){_0x27a2e4['push'](_0x27a2e4['shift']());}};_0x3acf63(++_0x4749d1);}(_0x8020,0x7c));var _0x0802=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x8020[_0xbb091];return _0x467a04;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x0802('0x0'))['db'][_0x0802('0x1')];var OpenchannelMessage=require(_0x0802('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x0802('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0802('0x3'),'afterDestroy':'remove'};function emitEvent(_0x184887){return function(_0x5b5ebe,_0xcd278d,_0x27a5bc){_0x5b5ebe['getUsers']({'attributes':['id'],'raw':!![]})[_0x0802('0x4')](function(_0x1085c4){_0x5b5ebe['setDataValue'](_0x0802('0x5'),_0x1085c4[_0x0802('0x6')](function(_0x52415d){return{'id':_0x52415d['id']};}));return OpenchannelMessage[_0x0802('0x7')]({'where':{'OpenchannelInteractionId':_0x5b5ebe['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x431587){_0x5b5ebe['setDataValue'](_0x0802('0x8'),_0x431587[_0x0802('0x9')]);OpenchannelInteractionEvents[_0x0802('0xa')](_0x184887+':'+_0x5b5ebe['id'],_0x5b5ebe);OpenchannelInteractionEvents[_0x0802('0xa')](_0x184887,_0x5b5ebe);_0x27a5bc(null);})[_0x0802('0xb')](_0x27a5bc(null));};}for(var e in events){if(events[_0x0802('0xc')](e)){var event=events[e];OpenchannelInteraction[_0x0802('0xd')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index a5b0a9c..e46083b 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 _0xe80e=['moment','request-promise','rimraf','./openchannelInteraction.attributes','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0xb424fe,_0x4fada1){var _0x573a14=function(_0x13d713){while(--_0x13d713){_0xb424fe['push'](_0xb424fe['shift']());}};_0x573a14(++_0x4fada1);}(_0xe80e,0x1d8));var _0xee80=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe80e[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xee80('0x0'));var util=require(_0xee80('0x1'));var logger=require(_0xee80('0x2'))(_0xee80('0x3'));var moment=require(_0xee80('0x4'));var BPromise=require('bluebird');var rp=require(_0xee80('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee80('0x6'));var config=require('../../config/environment');var attributes=require(_0xee80('0x7'));module['exports']=function(_0x739547,_0x281a86){return _0x739547['define'](_0xee80('0x8'),attributes,{'tableName':_0xee80('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x221e95,_0x125e2e,_0x2e5c7b){if(_0x221e95[_0xee80('0xa')](_0xee80('0xb'))){_0x221e95[_0xee80('0xc')]=moment()['format'](_0xee80('0xd'));}_0x2e5c7b(null,_0x221e95);}}});}; \ No newline at end of file +var _0x3639=['openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction'];(function(_0x4f11cb,_0x14e174){var _0x491488=function(_0x2904a9){while(--_0x2904a9){_0x4f11cb['push'](_0x4f11cb['shift']());}};_0x491488(++_0x14e174);}(_0x3639,0x6c));var _0x9363=function(_0x194abf,_0x1432b6){_0x194abf=_0x194abf-0x0;var _0x52914c=_0x3639[_0x194abf];return _0x52914c;};'use strict';var _=require(_0x9363('0x0'));var util=require(_0x9363('0x1'));var logger=require('../../config/logger')(_0x9363('0x2'));var moment=require(_0x9363('0x3'));var BPromise=require(_0x9363('0x4'));var rp=require(_0x9363('0x5'));var fs=require('fs');var path=require(_0x9363('0x6'));var rimraf=require(_0x9363('0x7'));var config=require('../../config/environment');var attributes=require(_0x9363('0x8'));module[_0x9363('0x9')]=function(_0x42c73b,_0x4171f7){return _0x42c73b[_0x9363('0xa')](_0x9363('0xb'),attributes,{'tableName':_0x9363('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9363('0xd'),'collate':_0x9363('0xe'),'hooks':{'beforeUpdate':function(_0x3d37f7,_0x5ed105,_0x2e8f14){if(_0x3d37f7[_0x9363('0xf')](_0x9363('0x10'))){_0x3d37f7[_0x9363('0x11')]=moment()[_0x9363('0x12')](_0x9363('0x13'));}_0x2e8f14(null,_0x3d37f7);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 7d399e0..4cb87f4 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 _0x194b=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','raw','options','where','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment'];(function(_0x388874,_0x512c05){var _0x592d84=function(_0x5d416a){while(--_0x5d416a){_0x388874['push'](_0x388874['shift']());}};_0x592d84(++_0x512c05);}(_0x194b,0x181));var _0xb194=function(_0x413c5e,_0x439210){_0x413c5e=_0x413c5e-0x0;var _0x2b6699=_0x194b[_0x413c5e];return _0x2b6699;};'use strict';var _=require(_0xb194('0x0'));var util=require('util');var moment=require(_0xb194('0x1'));var BPromise=require(_0xb194('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb194('0x3'));var db=require(_0xb194('0x4'))['db'];var utils=require(_0xb194('0x5'));var logger=require(_0xb194('0x6'))(_0xb194('0x7'));var config=require(_0xb194('0x8'));var jayson=require(_0xb194('0x9'));var client=jayson[_0xb194('0xa')]['http']({'port':0x232a});config[_0xb194('0xb')]=_[_0xb194('0xc')](config[_0xb194('0xb')],{'host':_0xb194('0xd'),'port':0x18eb});var socket=require(_0xb194('0xe'))(new Redis(config[_0xb194('0xb')]));require(_0xb194('0xf'))[_0xb194('0x10')](socket);function respondWithRpcPromise(_0x2ffb6f,_0xc4783,_0x8fd133){return new BPromise(function(_0xd2c474,_0x1df137){return client[_0xb194('0x11')](_0x2ffb6f,_0x8fd133)[_0xb194('0x12')](function(_0x1fe486){logger[_0xb194('0x13')](_0xb194('0x14'),_0xc4783,_0xb194('0x15'));logger[_0xb194('0x16')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0xc4783,_0xb194('0x15'),JSON[_0xb194('0x17')](_0x1fe486));if(_0x1fe486['error']){if(_0x1fe486[_0xb194('0x18')][_0xb194('0x19')]===0x1f4){logger[_0xb194('0x18')](_0xb194('0x14'),_0xc4783,_0x1fe486[_0xb194('0x18')][_0xb194('0x1a')]);return _0x1df137(_0x1fe486[_0xb194('0x18')][_0xb194('0x1a')]);}logger[_0xb194('0x18')](_0xb194('0x14'),_0xc4783,_0x1fe486[_0xb194('0x18')][_0xb194('0x1a')]);return _0xd2c474(_0x1fe486[_0xb194('0x18')][_0xb194('0x1a')]);}else{logger[_0xb194('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0xc4783,_0xb194('0x15'));_0xd2c474(_0x1fe486[_0xb194('0x1b')][_0xb194('0x1a')]);}})[_0xb194('0x1c')](function(_0x37822b){logger[_0xb194('0x18')](_0xb194('0x14'),_0xc4783,_0x37822b);_0x1df137(_0x37822b);});});}exports[_0xb194('0x1d')]=function(_0x443cf6){var _0x2f5b63=this;return new Promise(function(_0xbf5937,_0x153142){return db[_0xb194('0x1e')][_0xb194('0x1f')](_0x443cf6[_0xb194('0x20')],{'raw':_0x443cf6['options']?_0x443cf6['options'][_0xb194('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x443cf6[_0xb194('0x22')]?_0x443cf6[_0xb194('0x22')][_0xb194('0x23')]||null:null,'attributes':_0x443cf6[_0xb194('0x22')]?_0x443cf6[_0xb194('0x22')]['attributes']||null:null,'limit':_0x443cf6['options']?_0x443cf6[_0xb194('0x22')]['limit']||null:null})[_0xb194('0x12')](function(_0x5798fe){logger[_0xb194('0x13')](_0xb194('0x1d'),_0x443cf6);logger[_0xb194('0x16')](_0xb194('0x1d'),_0x443cf6,JSON[_0xb194('0x17')](_0x5798fe));_0xbf5937(_0x5798fe);})['catch'](function(_0x30a183){logger[_0xb194('0x18')](_0xb194('0x1d'),_0x30a183['message'],_0x443cf6);_0x153142(_0x2f5b63[_0xb194('0x18')](0x1f4,_0x30a183['message']));});});};exports[_0xb194('0x24')]=function(_0x2f5bca){return new Promise(function(_0x150083,_0x3e9ff2){return db['OpenchannelInteraction'][_0xb194('0x25')]({'where':_0x2f5bca[_0xb194('0x22')]?_0x2f5bca['options']['where']||null:null})['then'](function(_0x14391f){if(_0x14391f){return _0x14391f[_0xb194('0x26')](_0x2f5bca[_0xb194('0x20')][_0xb194('0x27')],_[_0xb194('0x28')](_0x2f5bca[_0xb194('0x20')],[_0xb194('0x27'),'id'])||{});}})[_0xb194('0x29')](function(_0x205f55){logger[_0xb194('0x13')](_0xb194('0x2a'),_0x2f5bca);logger[_0xb194('0x16')](_0xb194('0x2a'),_0x2f5bca,JSON[_0xb194('0x17')](_0x205f55));_0x150083(_0x205f55);})[_0xb194('0x1c')](function(_0x2df30e){logger['error'](_0xb194('0x2a'),_0x2df30e[_0xb194('0x1a')],_0x2f5bca);_0x3e9ff2(_this['error'](0x1f4,_0x2df30e[_0xb194('0x1a')]));});});}; \ No newline at end of file +var _0x5ac3=['error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes','limit','then','AddTagsToOpenchannelInteraction','find','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','request\x20sent','debug','stringify'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5ac3,0x92));var _0x35ac=function(_0x4934fd,_0xdcfd5a){_0x4934fd=_0x4934fd-0x0;var _0x228c72=_0x5ac3[_0x4934fd];return _0x228c72;};'use strict';var _=require(_0x35ac('0x0'));var util=require(_0x35ac('0x1'));var moment=require(_0x35ac('0x2'));var BPromise=require(_0x35ac('0x3'));var rs=require(_0x35ac('0x4'));var fs=require('fs');var Redis=require(_0x35ac('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x35ac('0x6'))('rpc');var config=require(_0x35ac('0x7'));var jayson=require(_0x35ac('0x8'));var client=jayson[_0x35ac('0x9')][_0x35ac('0xa')]({'port':0x232a});config[_0x35ac('0xb')]=_[_0x35ac('0xc')](config[_0x35ac('0xb')],{'host':_0x35ac('0xd'),'port':0x18eb});var socket=require(_0x35ac('0xe'))(new Redis(config[_0x35ac('0xb')]));require(_0x35ac('0xf'))[_0x35ac('0x10')](socket);function respondWithRpcPromise(_0x571109,_0x228525,_0x3c8766){return new BPromise(function(_0x23d7dc,_0x373d51){return client[_0x35ac('0x11')](_0x571109,_0x3c8766)['then'](function(_0x399e2b){logger[_0x35ac('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x228525,_0x35ac('0x13'));logger[_0x35ac('0x14')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x228525,_0x35ac('0x13'),JSON[_0x35ac('0x15')](_0x399e2b));if(_0x399e2b[_0x35ac('0x16')]){if(_0x399e2b[_0x35ac('0x16')][_0x35ac('0x17')]===0x1f4){logger['error'](_0x35ac('0x18'),_0x228525,_0x399e2b[_0x35ac('0x16')][_0x35ac('0x19')]);return _0x373d51(_0x399e2b[_0x35ac('0x16')][_0x35ac('0x19')]);}logger[_0x35ac('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x228525,_0x399e2b['error'][_0x35ac('0x19')]);return _0x23d7dc(_0x399e2b[_0x35ac('0x16')][_0x35ac('0x19')]);}else{logger['info'](_0x35ac('0x18'),_0x228525,_0x35ac('0x13'));_0x23d7dc(_0x399e2b[_0x35ac('0x1a')][_0x35ac('0x19')]);}})[_0x35ac('0x1b')](function(_0x3d822d){logger[_0x35ac('0x16')](_0x35ac('0x18'),_0x228525,_0x3d822d);_0x373d51(_0x3d822d);});});}exports[_0x35ac('0x1c')]=function(_0x56e81f){var _0x1a5010=this;return new Promise(function(_0x583947,_0x189b5d){return db[_0x35ac('0x1d')][_0x35ac('0x1e')](_0x56e81f[_0x35ac('0x1f')],{'raw':_0x56e81f[_0x35ac('0x20')]?_0x56e81f[_0x35ac('0x20')][_0x35ac('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56e81f[_0x35ac('0x20')]?_0x56e81f['options']['where']||null:null,'attributes':_0x56e81f[_0x35ac('0x20')]?_0x56e81f[_0x35ac('0x20')][_0x35ac('0x22')]||null:null,'limit':_0x56e81f[_0x35ac('0x20')]?_0x56e81f[_0x35ac('0x20')][_0x35ac('0x23')]||null:null})[_0x35ac('0x24')](function(_0x51bc6f){logger['info'](_0x35ac('0x1c'),_0x56e81f);logger[_0x35ac('0x14')](_0x35ac('0x1c'),_0x56e81f,JSON['stringify'](_0x51bc6f));_0x583947(_0x51bc6f);})[_0x35ac('0x1b')](function(_0x572f61){logger['error'](_0x35ac('0x1c'),_0x572f61[_0x35ac('0x19')],_0x56e81f);_0x189b5d(_0x1a5010[_0x35ac('0x16')](0x1f4,_0x572f61['message']));});});};exports[_0x35ac('0x25')]=function(_0x2055cc){return new Promise(function(_0x50857f,_0x337e64){return db[_0x35ac('0x1d')][_0x35ac('0x26')]({'where':_0x2055cc[_0x35ac('0x20')]?_0x2055cc['options']['where']||null:null})['then'](function(_0x3d552c){if(_0x3d552c){return _0x3d552c[_0x35ac('0x27')](_0x2055cc[_0x35ac('0x1f')][_0x35ac('0x28')],_['omit'](_0x2055cc[_0x35ac('0x1f')],[_0x35ac('0x28'),'id'])||{});}})['spread'](function(_0x537fb7){logger[_0x35ac('0x12')](_0x35ac('0x29'),_0x2055cc);logger[_0x35ac('0x14')](_0x35ac('0x29'),_0x2055cc,JSON[_0x35ac('0x15')](_0x537fb7));_0x50857f(_0x537fb7);})[_0x35ac('0x1b')](function(_0x51a22c){logger['error'](_0x35ac('0x29'),_0x51a22c[_0x35ac('0x19')],_0x2055cc);_0x337e64(_this[_0x35ac('0x16')](0x1f4,_0x51a22c[_0x35ac('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 8601e2f..8629e8b 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 _0x5418=['openchannelInteraction:','./openchannelInteraction.events','save','remove','update','removeListener','register'];(function(_0x1568be,_0x2130c1){var _0xe81d56=function(_0x11dc2b){while(--_0x11dc2b){_0x1568be['push'](_0x1568be['shift']());}};_0xe81d56(++_0x2130c1);}(_0x5418,0x151));var _0x8541=function(_0x44c56b,_0x7a6e18){_0x44c56b=_0x44c56b-0x0;var _0x57a1eb=_0x5418[_0x44c56b];return _0x57a1eb;};'use strict';var OpenchannelInteractionEvents=require(_0x8541('0x0'));var events=[_0x8541('0x1'),_0x8541('0x2'),_0x8541('0x3')];function createListener(_0x7a0c05,_0x1d01a2){return function(_0x243a87){_0x1d01a2['emit'](_0x7a0c05,_0x243a87);};}function removeListener(_0x58bc6c,_0x6b485){return function(){OpenchannelInteractionEvents[_0x8541('0x4')](_0x58bc6c,_0x6b485);};}exports[_0x8541('0x5')]=function(_0x34fb7a){for(var _0x4cca62=0x0,_0x16f4e4=events['length'];_0x4cca62<_0x16f4e4;_0x4cca62++){var _0x2c4392=events[_0x4cca62];var _0x444c2a=createListener(_0x8541('0x6')+_0x2c4392,_0x34fb7a);OpenchannelInteractionEvents['on'](_0x2c4392,_0x444c2a);}}; \ No newline at end of file +var _0xe158=['removeListener','register','openchannelInteraction:','./openchannelInteraction.events','save','emit'];(function(_0x88a2ba,_0x4767e6){var _0x49b7bd=function(_0x1811bd){while(--_0x1811bd){_0x88a2ba['push'](_0x88a2ba['shift']());}};_0x49b7bd(++_0x4767e6);}(_0xe158,0xab));var _0x8e15=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xe158[_0x5f09c5];return _0x426ad9;};'use strict';var OpenchannelInteractionEvents=require(_0x8e15('0x0'));var events=[_0x8e15('0x1'),'remove','update'];function createListener(_0x2ad459,_0xe319cf){return function(_0x49368b){_0xe319cf[_0x8e15('0x2')](_0x2ad459,_0x49368b);};}function removeListener(_0x5c0206,_0x2e4e62){return function(){OpenchannelInteractionEvents[_0x8e15('0x3')](_0x5c0206,_0x2e4e62);};}exports[_0x8e15('0x4')]=function(_0x36142c){for(var _0x28f025=0x0,_0x3055bf=events['length'];_0x28f025<_0x3055bf;_0x28f025++){var _0x2138f9=events[_0x28f025];var _0x2e33d1=createListener(_0x8e15('0x5')+_0x2138f9,_0x36142c);OpenchannelInteractionEvents['on'](_0x2138f9,_0x2e33d1);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index f9232c0..effe50a 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(_0x3ebce0,_0x10bb8b){var _0x1458ae=function(_0xcbcdc1){while(--_0xcbcdc1){_0x3ebce0['push'](_0x3ebce0['shift']());}};_0x1458ae(++_0x10bb8b);}(_0xe706,0xa3));var _0x6e70=function(_0x5aff19,_0x1b2577){_0x5aff19=_0x5aff19-0x0;var _0x30d5ff=_0xe706[_0x5aff19];return _0x30d5ff;};'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 _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_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'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 092887a..8df798f 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 _0x349e=['ENUM','out','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x399032,_0x3bdc97){var _0x4f43a0=function(_0x3ecb08){while(--_0x3ecb08){_0x399032['push'](_0x399032['shift']());}};_0x4f43a0(++_0x3bdc97);}(_0x349e,0xcb));var _0xe349=function(_0x12fab4,_0x5e4564){_0x12fab4=_0x12fab4-0x0;var _0x39bee4=_0x349e[_0x12fab4];return _0x39bee4;};'use strict';var Sequelize=require(_0xe349('0x0'));module[_0xe349('0x1')]={'body':{'type':Sequelize[_0xe349('0x2')](_0xe349('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe349('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe349('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe349('0x5')]('in',_0xe349('0x6')),'defaultValue':_0xe349('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xe349('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5d86=['exports','BOOLEAN','ENUM','out','DATE','TEXT','sequelize'];(function(_0x12b17d,_0x5a335f){var _0x578773=function(_0x59905b){while(--_0x59905b){_0x12b17d['push'](_0x12b17d['shift']());}};_0x578773(++_0x5a335f);}(_0x5d86,0x76));var _0x65d8=function(_0x150c65,_0x303f38){_0x150c65=_0x150c65-0x0;var _0x4ca489=_0x5d86[_0x150c65];return _0x4ca489;};'use strict';var Sequelize=require(_0x65d8('0x0'));module[_0x65d8('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x65d8('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x65d8('0x3')]('in',_0x65d8('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x65d8('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x65d8('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 8165162..b75da00 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 _0xb0b0=['[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','sequelize','QueryTypes','contact','fullname','email','SIP/%s','rejectmessage','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','update','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','options','OpenchannelMessage','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','destroy','describe','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','User','agent','internal','manual','interface','channel','event','EventManager','acceptmessage','openchannel-interactions','openchannel','get'];(function(_0x34e2e7,_0x6b1d47){var _0x49c97d=function(_0x1785e8){while(--_0x1785e8){_0x34e2e7['push'](_0x34e2e7['shift']());}};_0x49c97d(++_0x6b1d47);}(_0xb0b0,0x196));var _0x0b0b=function(_0x1fbb37,_0x5840b8){_0x1fbb37=_0x1fbb37-0x0;var _0x591a30=_0xb0b0[_0x1fbb37];return _0x591a30;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0b0b('0x0'));var jsonpatch=require(_0x0b0b('0x1'));var rp=require(_0x0b0b('0x2'));var moment=require(_0x0b0b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0b0b('0x4'));var util=require(_0x0b0b('0x5'));var path=require(_0x0b0b('0x6'));var sox=require('sox');var csv=require(_0x0b0b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b0b('0x8'));var _=require(_0x0b0b('0x9'));var squel=require(_0x0b0b('0xa'));var crypto=require(_0x0b0b('0xb'));var jsforce=require(_0x0b0b('0xc'));var deskjs=require(_0x0b0b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0b0b('0xe'));var Papa=require(_0x0b0b('0xf'));var Redis=require(_0x0b0b('0x10'));var authService=require(_0x0b0b('0x11'));var qs=require(_0x0b0b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b0b('0x13'))(_0x0b0b('0x14'));var utils=require(_0x0b0b('0x15'));var config=require(_0x0b0b('0x16'));var licenseUtil=require(_0x0b0b('0x17'));var db=require(_0x0b0b('0x18'))['db'];config[_0x0b0b('0x19')]=_[_0x0b0b('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0b0b('0x1b'))(new Redis(config[_0x0b0b('0x19')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x0b0b('0x1c'));var client=jayson[_0x0b0b('0x1d')][_0x0b0b('0x1e')]({'port':0x232c});var client9002=jayson[_0x0b0b('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a2fab,_0x33b749,_0x9d4d3d,_0x5b64ab){return new BPromise(function(_0x1d8c48,_0x54c7ae){var _0x5d5c3b=_0x5b64ab||client;return _0x5d5c3b[_0x0b0b('0x1f')](_0x4a2fab,_0x9d4d3d)[_0x0b0b('0x20')](function(_0xada343){logger[_0x0b0b('0x21')](_0x0b0b('0x22'),_0x33b749,_0x0b0b('0x23'));logger[_0x0b0b('0x24')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x33b749,'request\x20sent',JSON[_0x0b0b('0x25')](_0xada343));if(_0xada343[_0x0b0b('0x26')]){if(_0xada343['error'][_0x0b0b('0x27')]===0x1f4){logger[_0x0b0b('0x26')](_0x0b0b('0x22'),_0x33b749,_0xada343[_0x0b0b('0x26')][_0x0b0b('0x28')]);return _0x54c7ae(_0xada343[_0x0b0b('0x26')][_0x0b0b('0x28')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x33b749,_0xada343[_0x0b0b('0x26')][_0x0b0b('0x28')]);return _0x1d8c48(_0xada343[_0x0b0b('0x26')]['message']);}else{logger[_0x0b0b('0x21')](_0x0b0b('0x22'),_0x33b749,_0x0b0b('0x23'));_0x1d8c48(_0xada343[_0x0b0b('0x29')][_0x0b0b('0x28')]);}})['catch'](function(_0x3e964e){logger[_0x0b0b('0x26')](_0x0b0b('0x22'),_0x33b749,_0x3e964e);_0x54c7ae(_0x3e964e);});});}function respondWithStatusCode(_0x1359ae,_0x27c9f2){_0x27c9f2=_0x27c9f2||0xcc;return function(_0x904bf4){if(_0x904bf4){return _0x1359ae[_0x0b0b('0x2a')](_0x27c9f2);}return _0x1359ae['status'](_0x27c9f2)[_0x0b0b('0x2b')]();};}function respondWithResult(_0x5d3c9a,_0x5136f0){_0x5136f0=_0x5136f0||0xc8;return function(_0x469310){if(_0x469310){return _0x5d3c9a[_0x0b0b('0x2c')](_0x5136f0)[_0x0b0b('0x2d')](_0x469310);}};}function respondWithFilteredResult(_0x3f6c03,_0x1051b7){return function(_0x132ba1){if(_0x132ba1){var _0x591e28=typeof _0x1051b7[_0x0b0b('0x2e')]===_0x0b0b('0x2f')&&typeof _0x1051b7[_0x0b0b('0x30')]===_0x0b0b('0x2f');var _0x425d0a=_0x132ba1[_0x0b0b('0x31')];var _0x223077=_0x591e28?0x0:_0x1051b7[_0x0b0b('0x2e')];var _0xde84e1=_0x591e28?_0x132ba1[_0x0b0b('0x31')]:_0x1051b7[_0x0b0b('0x2e')]+_0x1051b7[_0x0b0b('0x30')];var _0x5e7695;if(_0xde84e1>=_0x425d0a){_0xde84e1=_0x425d0a;_0x5e7695=0xc8;}else{_0x5e7695=0xce;}_0x3f6c03[_0x0b0b('0x2c')](_0x5e7695);return _0x3f6c03['set'](_0x0b0b('0x32'),_0x223077+'-'+_0xde84e1+'/'+_0x425d0a)['json'](_0x132ba1);}return null;};}function patchUpdates(_0x3d9b33){return function(_0x3eb5dc){try{jsonpatch['apply'](_0x3eb5dc,_0x3d9b33,!![]);}catch(_0x2b4724){return BPromise[_0x0b0b('0x33')](_0x2b4724);}return _0x3eb5dc['save']();};}function saveUpdates(_0x1df462,_0x2880bc){return function(_0x3670f0){if(_0x3670f0){return _0x3670f0[_0x0b0b('0x34')](_0x1df462)[_0x0b0b('0x20')](function(_0x58350b){return _0x58350b;});}return null;};}function removeEntity(_0x5be24a,_0x1d2711){return function(_0x2aadf8){if(_0x2aadf8){return _0x2aadf8['destroy']()['then'](function(){_0x5be24a[_0x0b0b('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4540a0,_0x4728c0){return function(_0x41e9ff){if(!_0x41e9ff){_0x4540a0[_0x0b0b('0x2a')](0x194);}return _0x41e9ff;};}function handleError(_0x4ba437,_0x4c25bb){_0x4c25bb=_0x4c25bb||0x1f4;return function(_0x3a3afc){logger[_0x0b0b('0x26')](_0x3a3afc[_0x0b0b('0x35')]);if(_0x3a3afc[_0x0b0b('0x36')]){delete _0x3a3afc[_0x0b0b('0x36')];}_0x4ba437[_0x0b0b('0x2c')](_0x4c25bb)[_0x0b0b('0x37')](_0x3a3afc);};}exports[_0x0b0b('0x38')]=function(_0xccdd7e,_0x1ab2fd){var _0x4da034={},_0x272360={},_0x3efd27={'count':0x0,'rows':[]};var _0x17d558=_[_0x0b0b('0x39')](db['OpenchannelMessage'][_0x0b0b('0x3a')],function(_0x4c132c){return{'name':_0x4c132c[_0x0b0b('0x3b')],'type':_0x4c132c[_0x0b0b('0x3c')][_0x0b0b('0x3d')]};});_0x272360[_0x0b0b('0x3e')]=_[_0x0b0b('0x39')](_0x17d558,_0x0b0b('0x36'));_0x272360[_0x0b0b('0x3f')]=_['keys'](_0xccdd7e['query']);_0x272360[_0x0b0b('0x40')]=_[_0x0b0b('0x41')](_0x272360[_0x0b0b('0x3e')],_0x272360['query']);_0x4da034[_0x0b0b('0x42')]=_['intersection'](_0x272360[_0x0b0b('0x3e')],qs[_0x0b0b('0x43')](_0xccdd7e['query']['fields']));_0x4da034['attributes']=_0x4da034[_0x0b0b('0x42')][_0x0b0b('0x44')]?_0x4da034['attributes']:_0x272360[_0x0b0b('0x3e')];if(!_0xccdd7e[_0x0b0b('0x3f')][_0x0b0b('0x45')](_0x0b0b('0x46'))){_0x4da034[_0x0b0b('0x30')]=qs[_0x0b0b('0x30')](_0xccdd7e[_0x0b0b('0x3f')][_0x0b0b('0x30')]);_0x4da034['offset']=qs[_0x0b0b('0x2e')](_0xccdd7e['query']['offset']);}_0x4da034[_0x0b0b('0x47')]=qs['sort'](_0xccdd7e[_0x0b0b('0x3f')]['sort']);_0x4da034[_0x0b0b('0x48')]=qs['filters'](_[_0x0b0b('0x49')](_0xccdd7e[_0x0b0b('0x3f')],_0x272360[_0x0b0b('0x40')]),_0x17d558);if(_0xccdd7e[_0x0b0b('0x3f')][_0x0b0b('0x4a')]){_0x4da034[_0x0b0b('0x48')]=_['merge'](_0x4da034[_0x0b0b('0x48')],{'$or':_[_0x0b0b('0x39')](_0x17d558,function(_0x1c803c){if(_0x1c803c['type']!==_0x0b0b('0x4b')){var _0x28f846={};_0x28f846[_0x1c803c['name']]={'$like':'%'+_0xccdd7e['query'][_0x0b0b('0x4a')]+'%'};return _0x28f846;}})});}_0x4da034=_['merge']({},_0x4da034,_0xccdd7e[_0x0b0b('0x4c')]);var _0x878c2={'where':_0x4da034[_0x0b0b('0x48')]};return db[_0x0b0b('0x4d')][_0x0b0b('0x31')](_0x878c2)['then'](function(_0x398f1a){_0x3efd27[_0x0b0b('0x31')]=_0x398f1a;if(_0xccdd7e[_0x0b0b('0x3f')][_0x0b0b('0x4e')]){_0x4da034[_0x0b0b('0x4f')]=[{'all':!![]}];}return db[_0x0b0b('0x4d')][_0x0b0b('0x50')](_0x4da034);})['then'](function(_0x3df916){_0x3efd27[_0x0b0b('0x51')]=_0x3df916;return _0x3efd27;})['then'](respondWithFilteredResult(_0x1ab2fd,_0x4da034))[_0x0b0b('0x52')](handleError(_0x1ab2fd,null));};exports[_0x0b0b('0x53')]=function(_0x27d4e6,_0x3a4dcd){var _0x2ac918={'raw':!![],'where':{'id':_0x27d4e6['params']['id']}},_0x2b69a3={};_0x2b69a3[_0x0b0b('0x3e')]=_[_0x0b0b('0x54')](db[_0x0b0b('0x4d')][_0x0b0b('0x3a')]);_0x2b69a3[_0x0b0b('0x3f')]=_[_0x0b0b('0x54')](_0x27d4e6[_0x0b0b('0x3f')]);_0x2b69a3[_0x0b0b('0x40')]=_[_0x0b0b('0x41')](_0x2b69a3['model'],_0x2b69a3[_0x0b0b('0x3f')]);_0x2ac918[_0x0b0b('0x42')]=_['intersection'](_0x2b69a3[_0x0b0b('0x3e')],qs['fields'](_0x27d4e6[_0x0b0b('0x3f')][_0x0b0b('0x43')]));_0x2ac918['attributes']=_0x2ac918[_0x0b0b('0x42')][_0x0b0b('0x44')]?_0x2ac918['attributes']:_0x2b69a3['model'];if(_0x27d4e6[_0x0b0b('0x3f')]['includeAll']){_0x2ac918['include']=[{'all':!![]}];}_0x2ac918=_['merge']({},_0x2ac918,_0x27d4e6['options']);return db[_0x0b0b('0x4d')][_0x0b0b('0x55')](_0x2ac918)[_0x0b0b('0x20')](handleEntityNotFound(_0x3a4dcd,null))[_0x0b0b('0x20')](respondWithResult(_0x3a4dcd,null))[_0x0b0b('0x52')](handleError(_0x3a4dcd,null));};exports['create']=function(_0x5a044d,_0x53742f){return db[_0x0b0b('0x4d')][_0x0b0b('0x56')](_0x5a044d['body'],{})['then'](respondWithResult(_0x53742f,0xc9))[_0x0b0b('0x52')](handleError(_0x53742f,null));};exports[_0x0b0b('0x34')]=function(_0x25a3ae,_0x2c82f1){if(_0x25a3ae[_0x0b0b('0x57')]['id']){delete _0x25a3ae[_0x0b0b('0x57')]['id'];}return db['OpenchannelMessage'][_0x0b0b('0x55')]({'where':{'id':_0x25a3ae[_0x0b0b('0x58')]['id']}})[_0x0b0b('0x20')](handleEntityNotFound(_0x2c82f1,null))[_0x0b0b('0x20')](saveUpdates(_0x25a3ae[_0x0b0b('0x57')],null))[_0x0b0b('0x20')](respondWithResult(_0x2c82f1,null))[_0x0b0b('0x52')](handleError(_0x2c82f1,null));};exports[_0x0b0b('0x59')]=function(_0x5b81f2,_0x486c5c){return db[_0x0b0b('0x4d')]['find']({'where':{'id':_0x5b81f2[_0x0b0b('0x58')]['id']}})[_0x0b0b('0x20')](handleEntityNotFound(_0x486c5c,null))[_0x0b0b('0x20')](removeEntity(_0x486c5c,null))[_0x0b0b('0x52')](handleError(_0x486c5c,null));};exports['describe']=function(_0x4a3835,_0xdd7911){return db[_0x0b0b('0x4d')][_0x0b0b('0x5a')]()[_0x0b0b('0x20')](respondWithResult(_0xdd7911,null))[_0x0b0b('0x52')](handleError(_0xdd7911,null));};var interaction_log=require(_0x0b0b('0x13'))('openchannel-interactions');exports['accept']=function(_0x5b67ae,_0x3c1449,_0x24b278){var _0x373313={'agent':{},'channel':'openchannel'};if(_0x5b67ae['body']['id']){delete _0x5b67ae[_0x0b0b('0x57')]['id'];}_0x5b67ae[_0x0b0b('0x57')][_0x0b0b('0x5b')]=!![];_0x5b67ae[_0x0b0b('0x57')][_0x0b0b('0x5c')]=moment()['format'](_0x0b0b('0x5d'));_0x5b67ae[_0x0b0b('0x57')][_0x0b0b('0x5e')]=_0x5b67ae[_0x0b0b('0x57')][_0x0b0b('0x5e')]||_0x5b67ae['user']['id'];_0x373313['agent']['id']=_0x5b67ae[_0x0b0b('0x57')][_0x0b0b('0x5e')];return db[_0x0b0b('0x4d')][_0x0b0b('0x55')]({'where':{'id':_0x5b67ae['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c1449,null))[_0x0b0b('0x20')](saveUpdates(_0x5b67ae['body'],null))['then'](function(_0x33134a){if(_0x33134a){_0x373313['message']=_0x33134a['get']({'plain':!![]});return db[_0x0b0b('0x5f')][_0x0b0b('0x55')]({'where':{'id':_0x33134a[_0x0b0b('0x60')]}});}return null;})[_0x0b0b('0x20')](handleEntityNotFound(_0x3c1449,null))[_0x0b0b('0x20')](function(_0x581df2){if(_0x581df2){return _0x581df2[_0x0b0b('0x34')]({'UserId':_0x5b67ae['body'][_0x0b0b('0x5e')],'read1stAt':_[_0x0b0b('0x61')](_0x581df2[_0x0b0b('0x62')])?moment()[_0x0b0b('0x63')](_0x0b0b('0x5d')):undefined});}return null;})[_0x0b0b('0x20')](function(_0x4feabc){if(_0x4feabc){_0x373313[_0x0b0b('0x64')]=_0x4feabc['get']({'plain':!![]});interaction_log[_0x0b0b('0x21')](_0x0b0b('0x65'),_0x5b67ae[_0x0b0b('0x66')]['id'],_0x5b67ae['user'][_0x0b0b('0x36')],_0x5b67ae[_0x0b0b('0x66')][_0x0b0b('0x67')],_0x373313[_0x0b0b('0x64')]['id'],_0x5b67ae[_0x0b0b('0x57')]?JSON['stringify'](_0x5b67ae['body']):_0x0b0b('0x68'));return respondWithRpcPromise(_0x0b0b('0x69'),_0x0b0b('0x6a'),_0x373313);}return null;})[_0x0b0b('0x20')](function(_0x5ac0ca){var _0x35a817=_0x0b0b('0x6b')+_0x5ac0ca[_0x0b0b('0x28')]['ContactId'];return db['sequelize'][_0x0b0b('0x3f')](_0x35a817,{'type':db[_0x0b0b('0x6c')]['QueryTypes'][_0x0b0b('0x6d')],'raw':!![]})[_0x0b0b('0x20')](function(_0x350027){return _0x350027;});})[_0x0b0b('0x20')](function(_0x269bfb){if(_0x269bfb){_0x373313[_0x0b0b('0x28')]['contact']=_0x269bfb[0x0];if(!_0x5b67ae['body'][_0x0b0b('0x5e')])return;return db[_0x0b0b('0x6e')][_0x0b0b('0x55')]({'where':{'id':_0x5b67ae[_0x0b0b('0x57')]['UserId'],'role':_0x0b0b('0x6f')},'attributes':['id',_0x0b0b('0x36'),'fullname','email',_0x0b0b('0x70')],'raw':!![]});}return null;})['then'](function(_0x70f4d3){if(!_0x70f4d3)return null;_0x373313[_0x0b0b('0x28')]['agent']=_0x70f4d3;return _0x373313;})['then'](function(_0x42a075){if(_0x42a075){if(_0x5b67ae[_0x0b0b('0x57')][_0x0b0b('0x71')]){_0x373313[_0x0b0b('0x28')][_0x0b0b('0x72')]=util[_0x0b0b('0x63')]('SIP/%s',_0x5b67ae[_0x0b0b('0x66')][_0x0b0b('0x36')]);_0x373313[_0x0b0b('0x28')][_0x0b0b('0x73')]=_0x373313[_0x0b0b('0x73')];_0x373313[_0x0b0b('0x28')]['motionChannel']=_0x373313[_0x0b0b('0x73')];_0x373313[_0x0b0b('0x28')][_0x0b0b('0x74')]='accept';return respondWithRpcPromise(_0x0b0b('0x75'),_0x0b0b('0x75'),{'event':_0x0b0b('0x76'),'message':_0x373313[_0x0b0b('0x28')]},client9002)['then'](function(){return _0x373313;});}return _0x373313;}return null;})['then'](respondWithResult(_0x3c1449,null))[_0x0b0b('0x52')](handleError(_0x3c1449,null));};var interaction_log=require(_0x0b0b('0x13'))(_0x0b0b('0x77'));exports['reject']=function(_0xfc5eda,_0x2e0405,_0x3b2a67){var _0x5394f3={'agent':{},'channel':_0x0b0b('0x78')};if(_0xfc5eda[_0x0b0b('0x57')]['id']){delete _0xfc5eda[_0x0b0b('0x57')]['id'];}_0xfc5eda[_0x0b0b('0x57')]['UserId']=_0xfc5eda[_0x0b0b('0x57')][_0x0b0b('0x5e')]||_0xfc5eda[_0x0b0b('0x66')]['id'];_0x5394f3['agent']['id']=_0xfc5eda['body']['UserId'];return db[_0x0b0b('0x4d')][_0x0b0b('0x55')]({'where':{'id':_0xfc5eda[_0x0b0b('0x58')]['id'],'UserId':null}})[_0x0b0b('0x20')](handleEntityNotFound(_0x2e0405,null))[_0x0b0b('0x20')](function(_0x205416){if(_0x205416){_0x5394f3[_0x0b0b('0x28')]=_0x205416['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x0b0b('0x55')]({'where':{'id':_0x205416[_0x0b0b('0x60')]}});}return null;})[_0x0b0b('0x20')](handleEntityNotFound(_0x2e0405,null))['then'](function(_0x1ed19e){if(_0x1ed19e){_0x5394f3['interaction']=_0x1ed19e[_0x0b0b('0x79')]({'plain':!![]});interaction_log[_0x0b0b('0x21')](_0x0b0b('0x7a'),_0xfc5eda[_0x0b0b('0x66')]['id'],_0xfc5eda[_0x0b0b('0x66')][_0x0b0b('0x36')],_0xfc5eda['user'][_0x0b0b('0x67')],_0x5394f3[_0x0b0b('0x64')]['id'],_0xfc5eda[_0x0b0b('0x57')]?JSON[_0x0b0b('0x25')](_0xfc5eda[_0x0b0b('0x57')]):_0x0b0b('0x68'));return respondWithRpcPromise(_0x0b0b('0x7b'),'rejectMessage',_0x5394f3);}return null;})['then'](function(_0x110871){var _0x53bcaa=_0x0b0b('0x6b')+_0x110871['message'][_0x0b0b('0x7c')];return db[_0x0b0b('0x7d')][_0x0b0b('0x3f')](_0x53bcaa,{'type':db[_0x0b0b('0x6c')][_0x0b0b('0x7e')][_0x0b0b('0x6d')],'raw':!![]})['then'](function(_0x44b666){return _0x44b666;});})[_0x0b0b('0x20')](function(_0x3817e3){if(_0x3817e3){_0x5394f3[_0x0b0b('0x28')][_0x0b0b('0x7f')]=_0x3817e3[0x0];if(!_0xfc5eda[_0x0b0b('0x57')]['UserId'])return;return db[_0x0b0b('0x6e')][_0x0b0b('0x55')]({'where':{'id':_0xfc5eda[_0x0b0b('0x57')]['UserId'],'role':_0x0b0b('0x6f')},'attributes':['id','name',_0x0b0b('0x80'),_0x0b0b('0x81'),'internal'],'raw':!![]});}return null;})[_0x0b0b('0x20')](function(_0x409c7){if(!_0x409c7)return null;_0x5394f3[_0x0b0b('0x28')][_0x0b0b('0x6f')]=_0x409c7;return _0x5394f3;})['then'](function(_0x427527){if(_0x427527){_0x427527[_0x0b0b('0x28')][_0x0b0b('0x72')]=util[_0x0b0b('0x63')](_0x0b0b('0x82'),_0xfc5eda[_0x0b0b('0x66')]['name']);_0x427527[_0x0b0b('0x28')]['channel']=_0x5394f3[_0x0b0b('0x73')];_0x427527[_0x0b0b('0x28')]['motionChannel']=_0x5394f3[_0x0b0b('0x73')];_0x427527[_0x0b0b('0x28')][_0x0b0b('0x74')]=_0x0b0b('0x33');respondWithRpcPromise(_0x0b0b('0x75'),_0x0b0b('0x75'),{'event':_0x0b0b('0x83'),'message':_0x427527['message']},client9002);return _0x5394f3;}return null;})['then'](respondWithResult(_0x2e0405,null))['catch'](handleError(_0x2e0405,null));}; \ No newline at end of file +var _0xbb67=['result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','merge','type','filter','options','includeAll','include','OpenchannelMessage','show','params','length','find','create','body','destroy','describe','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','update','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','email','internal','motionChannel','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x12a612,_0x2a147e){var _0x20eea8=function(_0x1745b3){while(--_0x1745b3){_0x12a612['push'](_0x12a612['shift']());}};_0x20eea8(++_0x2a147e);}(_0xbb67,0x161));var _0x7bb6=function(_0x139951,_0x524124){_0x139951=_0x139951-0x0;var _0x2d446d=_0xbb67[_0x139951];return _0x2d446d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7bb6('0x0'));var zipdir=require(_0x7bb6('0x1'));var jsonpatch=require(_0x7bb6('0x2'));var rp=require(_0x7bb6('0x3'));var moment=require(_0x7bb6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7bb6('0x5'));var util=require(_0x7bb6('0x6'));var path=require(_0x7bb6('0x7'));var sox=require(_0x7bb6('0x8'));var csv=require(_0x7bb6('0x9'));var ejs=require(_0x7bb6('0xa'));var fs=require('fs');var fs_extra=require(_0x7bb6('0xb'));var _=require(_0x7bb6('0xc'));var squel=require('squel');var crypto=require(_0x7bb6('0xd'));var jsforce=require(_0x7bb6('0xe'));var deskjs=require(_0x7bb6('0xf'));var toCsv=require(_0x7bb6('0x9'));var querystring=require(_0x7bb6('0x10'));var Papa=require(_0x7bb6('0x11'));var Redis=require(_0x7bb6('0x12'));var authService=require(_0x7bb6('0x13'));var qs=require(_0x7bb6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7bb6('0x15'));var logger=require(_0x7bb6('0x16'))(_0x7bb6('0x17'));var utils=require(_0x7bb6('0x18'));var config=require(_0x7bb6('0x19'));var licenseUtil=require(_0x7bb6('0x1a'));var db=require(_0x7bb6('0x1b'))['db'];config[_0x7bb6('0x1c')]=_[_0x7bb6('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7bb6('0x1e'))(new Redis(config[_0x7bb6('0x1c')]));require('./openchannelMessage.socket')[_0x7bb6('0x1f')](socket);var jayson=require(_0x7bb6('0x20'));var client=jayson[_0x7bb6('0x21')][_0x7bb6('0x22')]({'port':0x232c});var client9002=jayson[_0x7bb6('0x21')][_0x7bb6('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x496485,_0x377e28,_0xda67bf,_0x23d047){return new BPromise(function(_0x4095a1,_0x40c014){var _0x3aa271=_0x23d047||client;return _0x3aa271['request'](_0x496485,_0xda67bf)[_0x7bb6('0x23')](function(_0x5de5d4){logger[_0x7bb6('0x24')](_0x7bb6('0x25'),_0x377e28,_0x7bb6('0x26'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x377e28,'request\x20sent',JSON[_0x7bb6('0x27')](_0x5de5d4));if(_0x5de5d4[_0x7bb6('0x28')]){if(_0x5de5d4[_0x7bb6('0x28')][_0x7bb6('0x29')]===0x1f4){logger[_0x7bb6('0x28')](_0x7bb6('0x25'),_0x377e28,_0x5de5d4['error'][_0x7bb6('0x2a')]);return _0x40c014(_0x5de5d4[_0x7bb6('0x28')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x377e28,_0x5de5d4[_0x7bb6('0x28')][_0x7bb6('0x2a')]);return _0x4095a1(_0x5de5d4[_0x7bb6('0x28')]['message']);}else{logger[_0x7bb6('0x24')](_0x7bb6('0x25'),_0x377e28,_0x7bb6('0x26'));_0x4095a1(_0x5de5d4[_0x7bb6('0x2b')][_0x7bb6('0x2a')]);}})[_0x7bb6('0x2c')](function(_0x5a6a8c){logger[_0x7bb6('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x377e28,_0x5a6a8c);_0x40c014(_0x5a6a8c);});});}function respondWithStatusCode(_0x1dade2,_0x472955){_0x472955=_0x472955||0xcc;return function(_0x5d82d5){if(_0x5d82d5){return _0x1dade2[_0x7bb6('0x2d')](_0x472955);}return _0x1dade2[_0x7bb6('0x2e')](_0x472955)[_0x7bb6('0x2f')]();};}function respondWithResult(_0x4a01d7,_0xa7426f){_0xa7426f=_0xa7426f||0xc8;return function(_0x502c46){if(_0x502c46){return _0x4a01d7['status'](_0xa7426f)[_0x7bb6('0x30')](_0x502c46);}};}function respondWithFilteredResult(_0x13fad0,_0x42d410){return function(_0x29d10a){if(_0x29d10a){var _0x2b19f8=typeof _0x42d410[_0x7bb6('0x31')]==='undefined'&&typeof _0x42d410[_0x7bb6('0x32')]==='undefined';var _0x12ca03=_0x29d10a[_0x7bb6('0x33')];var _0x1c4f4c=_0x2b19f8?0x0:_0x42d410['offset'];var _0x435ceb=_0x2b19f8?_0x29d10a[_0x7bb6('0x33')]:_0x42d410[_0x7bb6('0x31')]+_0x42d410[_0x7bb6('0x32')];var _0x4ff660;if(_0x435ceb>=_0x12ca03){_0x435ceb=_0x12ca03;_0x4ff660=0xc8;}else{_0x4ff660=0xce;}_0x13fad0[_0x7bb6('0x2e')](_0x4ff660);return _0x13fad0[_0x7bb6('0x34')](_0x7bb6('0x35'),_0x1c4f4c+'-'+_0x435ceb+'/'+_0x12ca03)[_0x7bb6('0x30')](_0x29d10a);}return null;};}function patchUpdates(_0x18b620){return function(_0x59b645){try{jsonpatch[_0x7bb6('0x36')](_0x59b645,_0x18b620,!![]);}catch(_0x38cb38){return BPromise[_0x7bb6('0x37')](_0x38cb38);}return _0x59b645['save']();};}function saveUpdates(_0x1ed102,_0x5a6fe2){return function(_0x3f0a02){if(_0x3f0a02){return _0x3f0a02['update'](_0x1ed102)[_0x7bb6('0x23')](function(_0x43c97d){return _0x43c97d;});}return null;};}function removeEntity(_0xa3e75d,_0x338276){return function(_0x5ee4b4){if(_0x5ee4b4){return _0x5ee4b4['destroy']()[_0x7bb6('0x23')](function(){_0xa3e75d['status'](0xcc)[_0x7bb6('0x2f')]();});}};}function handleEntityNotFound(_0x261856,_0x3b4b85){return function(_0xfd3ce8){if(!_0xfd3ce8){_0x261856[_0x7bb6('0x2d')](0x194);}return _0xfd3ce8;};}function handleError(_0x316f5b,_0x3ea1f3){_0x3ea1f3=_0x3ea1f3||0x1f4;return function(_0xb231fb){logger[_0x7bb6('0x28')](_0xb231fb[_0x7bb6('0x38')]);if(_0xb231fb['name']){delete _0xb231fb[_0x7bb6('0x39')];}_0x316f5b[_0x7bb6('0x2e')](_0x3ea1f3)[_0x7bb6('0x3a')](_0xb231fb);};}exports[_0x7bb6('0x3b')]=function(_0x38f075,_0x439b94){var _0x4fb8c6={},_0x8c6aeb={},_0x2d26e7={'count':0x0,'rows':[]};var _0x2b2432=_[_0x7bb6('0x3c')](db['OpenchannelMessage'][_0x7bb6('0x3d')],function(_0x76e005){return{'name':_0x76e005['fieldName'],'type':_0x76e005['type'][_0x7bb6('0x3e')]};});_0x8c6aeb[_0x7bb6('0x3f')]=_[_0x7bb6('0x3c')](_0x2b2432,_0x7bb6('0x39'));_0x8c6aeb['query']=_[_0x7bb6('0x40')](_0x38f075[_0x7bb6('0x41')]);_0x8c6aeb[_0x7bb6('0x42')]=_[_0x7bb6('0x43')](_0x8c6aeb[_0x7bb6('0x3f')],_0x8c6aeb['query']);_0x4fb8c6['attributes']=_[_0x7bb6('0x43')](_0x8c6aeb['model'],qs[_0x7bb6('0x44')](_0x38f075['query']['fields']));_0x4fb8c6[_0x7bb6('0x45')]=_0x4fb8c6['attributes']['length']?_0x4fb8c6[_0x7bb6('0x45')]:_0x8c6aeb[_0x7bb6('0x3f')];if(!_0x38f075['query'][_0x7bb6('0x46')]('nolimit')){_0x4fb8c6[_0x7bb6('0x32')]=qs[_0x7bb6('0x32')](_0x38f075[_0x7bb6('0x41')][_0x7bb6('0x32')]);_0x4fb8c6[_0x7bb6('0x31')]=qs['offset'](_0x38f075[_0x7bb6('0x41')][_0x7bb6('0x31')]);}_0x4fb8c6[_0x7bb6('0x47')]=qs[_0x7bb6('0x48')](_0x38f075['query'][_0x7bb6('0x48')]);_0x4fb8c6[_0x7bb6('0x49')]=qs[_0x7bb6('0x42')](_['pick'](_0x38f075[_0x7bb6('0x41')],_0x8c6aeb[_0x7bb6('0x42')]),_0x2b2432);if(_0x38f075[_0x7bb6('0x41')]['filter']){_0x4fb8c6[_0x7bb6('0x49')]=_[_0x7bb6('0x4a')](_0x4fb8c6[_0x7bb6('0x49')],{'$or':_[_0x7bb6('0x3c')](_0x2b2432,function(_0x234079){if(_0x234079[_0x7bb6('0x4b')]!=='VIRTUAL'){var _0x4a7ff7={};_0x4a7ff7[_0x234079['name']]={'$like':'%'+_0x38f075['query'][_0x7bb6('0x4c')]+'%'};return _0x4a7ff7;}})});}_0x4fb8c6=_[_0x7bb6('0x4a')]({},_0x4fb8c6,_0x38f075[_0x7bb6('0x4d')]);var _0x51f988={'where':_0x4fb8c6[_0x7bb6('0x49')]};return db['OpenchannelMessage'][_0x7bb6('0x33')](_0x51f988)['then'](function(_0x312e2c){_0x2d26e7['count']=_0x312e2c;if(_0x38f075[_0x7bb6('0x41')][_0x7bb6('0x4e')]){_0x4fb8c6[_0x7bb6('0x4f')]=[{'all':!![]}];}return db[_0x7bb6('0x50')]['findAll'](_0x4fb8c6);})[_0x7bb6('0x23')](function(_0x5cb5e8){_0x2d26e7['rows']=_0x5cb5e8;return _0x2d26e7;})[_0x7bb6('0x23')](respondWithFilteredResult(_0x439b94,_0x4fb8c6))[_0x7bb6('0x2c')](handleError(_0x439b94,null));};exports[_0x7bb6('0x51')]=function(_0xb6ad64,_0x403241){var _0x5037df={'raw':!![],'where':{'id':_0xb6ad64[_0x7bb6('0x52')]['id']}},_0xba9b9f={};_0xba9b9f['model']=_[_0x7bb6('0x40')](db[_0x7bb6('0x50')]['rawAttributes']);_0xba9b9f[_0x7bb6('0x41')]=_['keys'](_0xb6ad64[_0x7bb6('0x41')]);_0xba9b9f[_0x7bb6('0x42')]=_[_0x7bb6('0x43')](_0xba9b9f[_0x7bb6('0x3f')],_0xba9b9f[_0x7bb6('0x41')]);_0x5037df[_0x7bb6('0x45')]=_[_0x7bb6('0x43')](_0xba9b9f[_0x7bb6('0x3f')],qs[_0x7bb6('0x44')](_0xb6ad64['query'][_0x7bb6('0x44')]));_0x5037df['attributes']=_0x5037df[_0x7bb6('0x45')][_0x7bb6('0x53')]?_0x5037df[_0x7bb6('0x45')]:_0xba9b9f['model'];if(_0xb6ad64['query'][_0x7bb6('0x4e')]){_0x5037df[_0x7bb6('0x4f')]=[{'all':!![]}];}_0x5037df=_[_0x7bb6('0x4a')]({},_0x5037df,_0xb6ad64[_0x7bb6('0x4d')]);return db[_0x7bb6('0x50')][_0x7bb6('0x54')](_0x5037df)[_0x7bb6('0x23')](handleEntityNotFound(_0x403241,null))[_0x7bb6('0x23')](respondWithResult(_0x403241,null))[_0x7bb6('0x2c')](handleError(_0x403241,null));};exports[_0x7bb6('0x55')]=function(_0xa6a004,_0x2af678){return db[_0x7bb6('0x50')][_0x7bb6('0x55')](_0xa6a004[_0x7bb6('0x56')],{})['then'](respondWithResult(_0x2af678,0xc9))['catch'](handleError(_0x2af678,null));};exports['update']=function(_0x405ae0,_0x554db3){if(_0x405ae0[_0x7bb6('0x56')]['id']){delete _0x405ae0['body']['id'];}return db[_0x7bb6('0x50')][_0x7bb6('0x54')]({'where':{'id':_0x405ae0[_0x7bb6('0x52')]['id']}})[_0x7bb6('0x23')](handleEntityNotFound(_0x554db3,null))[_0x7bb6('0x23')](saveUpdates(_0x405ae0[_0x7bb6('0x56')],null))['then'](respondWithResult(_0x554db3,null))['catch'](handleError(_0x554db3,null));};exports[_0x7bb6('0x57')]=function(_0x323a26,_0x13d3ea){return db[_0x7bb6('0x50')][_0x7bb6('0x54')]({'where':{'id':_0x323a26['params']['id']}})[_0x7bb6('0x23')](handleEntityNotFound(_0x13d3ea,null))[_0x7bb6('0x23')](removeEntity(_0x13d3ea,null))[_0x7bb6('0x2c')](handleError(_0x13d3ea,null));};exports['describe']=function(_0xe07e25,_0x57291f){return db[_0x7bb6('0x50')][_0x7bb6('0x58')]()[_0x7bb6('0x23')](respondWithResult(_0x57291f,null))['catch'](handleError(_0x57291f,null));};var interaction_log=require('../../config/logger')(_0x7bb6('0x59'));exports[_0x7bb6('0x5a')]=function(_0x32e51d,_0x48fd78,_0x3b3e6d){var _0x408d54={'agent':{},'channel':_0x7bb6('0x5b')};if(_0x32e51d[_0x7bb6('0x56')]['id']){delete _0x32e51d['body']['id'];}_0x32e51d[_0x7bb6('0x56')][_0x7bb6('0x5c')]=!![];_0x32e51d[_0x7bb6('0x56')]['readAt']=moment()[_0x7bb6('0x5d')](_0x7bb6('0x5e'));_0x32e51d[_0x7bb6('0x56')][_0x7bb6('0x5f')]=_0x32e51d[_0x7bb6('0x56')][_0x7bb6('0x5f')]||_0x32e51d[_0x7bb6('0x60')]['id'];_0x408d54[_0x7bb6('0x61')]['id']=_0x32e51d[_0x7bb6('0x56')][_0x7bb6('0x5f')];return db[_0x7bb6('0x50')][_0x7bb6('0x54')]({'where':{'id':_0x32e51d['params']['id'],'UserId':null}})[_0x7bb6('0x23')](handleEntityNotFound(_0x48fd78,null))[_0x7bb6('0x23')](saveUpdates(_0x32e51d[_0x7bb6('0x56')],null))['then'](function(_0x478339){if(_0x478339){_0x408d54['message']=_0x478339[_0x7bb6('0x62')]({'plain':!![]});return db[_0x7bb6('0x63')][_0x7bb6('0x54')]({'where':{'id':_0x478339[_0x7bb6('0x64')]}});}return null;})[_0x7bb6('0x23')](handleEntityNotFound(_0x48fd78,null))[_0x7bb6('0x23')](function(_0x45acb4){if(_0x45acb4){return _0x45acb4[_0x7bb6('0x65')]({'UserId':_0x32e51d[_0x7bb6('0x56')][_0x7bb6('0x5f')],'read1stAt':_[_0x7bb6('0x66')](_0x45acb4[_0x7bb6('0x67')])?moment()[_0x7bb6('0x5d')](_0x7bb6('0x5e')):undefined});}return null;})[_0x7bb6('0x23')](function(_0x15f32c){if(_0x15f32c){_0x408d54[_0x7bb6('0x68')]=_0x15f32c[_0x7bb6('0x62')]({'plain':!![]});interaction_log[_0x7bb6('0x24')](_0x7bb6('0x69'),_0x32e51d[_0x7bb6('0x60')]['id'],_0x32e51d['user'][_0x7bb6('0x39')],_0x32e51d['user'][_0x7bb6('0x6a')],_0x408d54[_0x7bb6('0x68')]['id'],_0x32e51d[_0x7bb6('0x56')]?JSON[_0x7bb6('0x27')](_0x32e51d[_0x7bb6('0x56')]):_0x7bb6('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x7bb6('0x6c'),_0x408d54);}return null;})[_0x7bb6('0x23')](function(_0x2ba4aa){var _0x3bedd6=_0x7bb6('0x6d')+_0x2ba4aa[_0x7bb6('0x2a')][_0x7bb6('0x6e')];return db[_0x7bb6('0x6f')][_0x7bb6('0x41')](_0x3bedd6,{'type':db[_0x7bb6('0x70')][_0x7bb6('0x71')]['SELECT'],'raw':!![]})[_0x7bb6('0x23')](function(_0x4a33a1){return _0x4a33a1;});})[_0x7bb6('0x23')](function(_0x3f0093){if(_0x3f0093){_0x408d54[_0x7bb6('0x2a')][_0x7bb6('0x72')]=_0x3f0093[0x0];if(!_0x32e51d['body'][_0x7bb6('0x5f')])return;return db[_0x7bb6('0x73')]['find']({'where':{'id':_0x32e51d[_0x7bb6('0x56')]['UserId'],'role':_0x7bb6('0x61')},'attributes':['id',_0x7bb6('0x39'),_0x7bb6('0x74'),'email','internal'],'raw':!![]});}return null;})[_0x7bb6('0x23')](function(_0x35d892){if(!_0x35d892)return null;_0x408d54[_0x7bb6('0x2a')][_0x7bb6('0x61')]=_0x35d892;return _0x408d54;})['then'](function(_0x55fae5){if(_0x55fae5){if(_0x32e51d[_0x7bb6('0x56')][_0x7bb6('0x75')]){_0x408d54[_0x7bb6('0x2a')][_0x7bb6('0x76')]=util[_0x7bb6('0x5d')](_0x7bb6('0x77'),_0x32e51d[_0x7bb6('0x60')][_0x7bb6('0x39')]);_0x408d54['message'][_0x7bb6('0x78')]=_0x408d54[_0x7bb6('0x78')];_0x408d54[_0x7bb6('0x2a')]['motionChannel']=_0x408d54[_0x7bb6('0x78')];_0x408d54[_0x7bb6('0x2a')][_0x7bb6('0x79')]=_0x7bb6('0x5a');return respondWithRpcPromise(_0x7bb6('0x7a'),'EventManager',{'event':_0x7bb6('0x7b'),'message':_0x408d54['message']},client9002)[_0x7bb6('0x23')](function(){return _0x408d54;});}return _0x408d54;}return null;})[_0x7bb6('0x23')](respondWithResult(_0x48fd78,null))[_0x7bb6('0x2c')](handleError(_0x48fd78,null));};var interaction_log=require(_0x7bb6('0x16'))(_0x7bb6('0x59'));exports['reject']=function(_0x4b2d7d,_0xfdda99,_0x49f329){var _0x243bf6={'agent':{},'channel':_0x7bb6('0x5b')};if(_0x4b2d7d[_0x7bb6('0x56')]['id']){delete _0x4b2d7d[_0x7bb6('0x56')]['id'];}_0x4b2d7d[_0x7bb6('0x56')][_0x7bb6('0x5f')]=_0x4b2d7d[_0x7bb6('0x56')]['UserId']||_0x4b2d7d[_0x7bb6('0x60')]['id'];_0x243bf6['agent']['id']=_0x4b2d7d[_0x7bb6('0x56')][_0x7bb6('0x5f')];return db[_0x7bb6('0x50')]['find']({'where':{'id':_0x4b2d7d[_0x7bb6('0x52')]['id'],'UserId':null}})[_0x7bb6('0x23')](handleEntityNotFound(_0xfdda99,null))[_0x7bb6('0x23')](function(_0x468340){if(_0x468340){_0x243bf6[_0x7bb6('0x2a')]=_0x468340[_0x7bb6('0x62')]({'plain':!![]});return db[_0x7bb6('0x63')][_0x7bb6('0x54')]({'where':{'id':_0x468340['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xfdda99,null))[_0x7bb6('0x23')](function(_0x439a17){if(_0x439a17){_0x243bf6[_0x7bb6('0x68')]=_0x439a17[_0x7bb6('0x62')]({'plain':!![]});interaction_log[_0x7bb6('0x24')](_0x7bb6('0x7c'),_0x4b2d7d[_0x7bb6('0x60')]['id'],_0x4b2d7d[_0x7bb6('0x60')][_0x7bb6('0x39')],_0x4b2d7d[_0x7bb6('0x60')][_0x7bb6('0x6a')],_0x243bf6[_0x7bb6('0x68')]['id'],_0x4b2d7d[_0x7bb6('0x56')]?JSON['stringify'](_0x4b2d7d['body']):_0x7bb6('0x6b'));return respondWithRpcPromise(_0x7bb6('0x7d'),_0x7bb6('0x7e'),_0x243bf6);}return null;})[_0x7bb6('0x23')](function(_0xbab83c){var _0x10eef6=_0x7bb6('0x6d')+_0xbab83c['message'][_0x7bb6('0x6e')];return db[_0x7bb6('0x6f')][_0x7bb6('0x41')](_0x10eef6,{'type':db['Sequelize']['QueryTypes'][_0x7bb6('0x7f')],'raw':!![]})['then'](function(_0x534bfd){return _0x534bfd;});})[_0x7bb6('0x23')](function(_0x76c2b){if(_0x76c2b){_0x243bf6[_0x7bb6('0x2a')][_0x7bb6('0x72')]=_0x76c2b[0x0];if(!_0x4b2d7d['body'][_0x7bb6('0x5f')])return;return db[_0x7bb6('0x73')]['find']({'where':{'id':_0x4b2d7d[_0x7bb6('0x56')][_0x7bb6('0x5f')],'role':_0x7bb6('0x61')},'attributes':['id',_0x7bb6('0x39'),'fullname',_0x7bb6('0x80'),_0x7bb6('0x81')],'raw':!![]});}return null;})[_0x7bb6('0x23')](function(_0x13288d){if(!_0x13288d)return null;_0x243bf6['message'][_0x7bb6('0x61')]=_0x13288d;return _0x243bf6;})[_0x7bb6('0x23')](function(_0x441836){if(_0x441836){_0x441836[_0x7bb6('0x2a')][_0x7bb6('0x76')]=util['format'](_0x7bb6('0x77'),_0x4b2d7d[_0x7bb6('0x60')][_0x7bb6('0x39')]);_0x441836[_0x7bb6('0x2a')]['channel']=_0x243bf6[_0x7bb6('0x78')];_0x441836[_0x7bb6('0x2a')][_0x7bb6('0x82')]=_0x243bf6[_0x7bb6('0x78')];_0x441836[_0x7bb6('0x2a')][_0x7bb6('0x79')]=_0x7bb6('0x37');respondWithRpcPromise(_0x7bb6('0x7a'),_0x7bb6('0x7a'),{'event':_0x7bb6('0x83'),'message':_0x441836[_0x7bb6('0x2a')]},client9002);return _0x243bf6;}return null;})['then'](respondWithResult(_0xfdda99,null))['catch'](handleError(_0xfdda99,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 83c15e2..a836c72 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 _0xde0e=['../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','emit','hasOwnProperty','events'];(function(_0x1839fa,_0x2d18ba){var _0x599af0=function(_0x4b1afe){while(--_0x4b1afe){_0x1839fa['push'](_0x1839fa['shift']());}};_0x599af0(++_0x2d18ba);}(_0xde0e,0x147));var _0xede0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde0e[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xede0('0x0'));var OpenchannelMessage=require(_0xede0('0x1'))['db'][_0xede0('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xede0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xede0('0x4'),'afterDestroy':_0xede0('0x5')};function emitEvent(_0x428f61){return function(_0x5515e2,_0x3e1ea9,_0x1c4472){OpenchannelMessageEvents[_0xede0('0x6')](_0x428f61+':'+_0x5515e2['id'],_0x5515e2);OpenchannelMessageEvents[_0xede0('0x6')](_0x428f61,_0x5515e2);_0x1c4472(null);};}for(var e in events){if(events[_0xede0('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x3486=['hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x158e6c,_0xaab4ed){var _0x3c26db=function(_0x3c57dd){while(--_0x3c57dd){_0x158e6c['push'](_0x158e6c['shift']());}};_0x3c26db(++_0xaab4ed);}(_0x3486,0x14c));var _0x6348=function(_0x58da8a,_0x1c0584){_0x58da8a=_0x58da8a-0x0;var _0x5ba3a3=_0x3486[_0x58da8a];return _0x5ba3a3;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x6348('0x0'))['db'][_0x6348('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x6348('0x2')](0x0);var events={'afterCreate':_0x6348('0x3'),'afterUpdate':_0x6348('0x4'),'afterDestroy':_0x6348('0x5')};function emitEvent(_0x2873ba){return function(_0x5a71f4,_0x144a50,_0x1fa825){OpenchannelMessageEvents[_0x6348('0x6')](_0x2873ba+':'+_0x5a71f4['id'],_0x5a71f4);OpenchannelMessageEvents[_0x6348('0x6')](_0x2873ba,_0x5a71f4);_0x1fa825(null);};}for(var e in events){if(events[_0x6348('0x7')](e)){var event=events[e];OpenchannelMessage[_0x6348('0x8')](e,emitEvent(event));}}module[_0x6348('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 9330b2f..5b0a744 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 _0x19d9=['describe','then','find','OpenchannelAccountId','CmContact','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','method','GET','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','catch','error','out'];(function(_0x3f5e45,_0x5419a8){var _0x2778b2=function(_0x2a5e2c){while(--_0x2a5e2c){_0x3f5e45['push'](_0x3f5e45['shift']());}};_0x2778b2(++_0x5419a8);}(_0x19d9,0x192));var _0x919d=function(_0x4453da,_0x405330){_0x4453da=_0x4453da-0x0;var _0x22a4b0=_0x19d9[_0x4453da];return _0x22a4b0;};'use strict';var _=require(_0x919d('0x0'));var util=require('util');var logger=require(_0x919d('0x1'))(_0x919d('0x2'));var moment=require(_0x919d('0x3'));var BPromise=require(_0x919d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x919d('0x5'));var rimraf=require(_0x919d('0x6'));var config=require(_0x919d('0x7'));var attributes=require(_0x919d('0x8'));module[_0x919d('0x9')]=function(_0x5abd7e,_0x32b460){return _0x5abd7e[_0x919d('0xa')](_0x919d('0xb'),attributes,{'tableName':_0x919d('0xc'),'paranoid':![],'indexes':[{'name':_0x919d('0xd'),'fields':[_0x919d('0xe')],'type':_0x919d('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e1c67,_0x46c3b9,_0x5ad477){var _0xa76332=_0x5abd7e[_0x919d('0x10')];var _0x5c081e=_0x3e1c67[_0x919d('0x11')]({'plain':!![]});if(_0x5c081e[_0x919d('0x12')][_0x919d('0x13')]()==='in'||_0x5c081e[_0x919d('0x12')][_0x919d('0x13')]()==='out'&&!_0x5c081e[_0x919d('0x14')]&&!_[_0x919d('0x15')](_0x5c081e[_0x919d('0x16')])){_0xa76332[_0x919d('0x17')][_0x919d('0x18')]({'where':{'id':_0x5c081e[_0x919d('0x19')]}})['then'](function(_0x13d8fa){if(_0x13d8fa){_0x13d8fa[_0x919d('0x1a')]({'lastMsgAt':_0x5c081e['createdAt'],'lastMsgDirection':_0x5c081e[_0x919d('0x12')][_0x919d('0x13')]()});}})[_0x919d('0x1b')](function(_0xdfd398){console[_0x919d('0x1c')](_0xdfd398);});}if(_0x5c081e[_0x919d('0x12')]===_0x919d('0x1d')&&!_0x5c081e[_0x919d('0x14')]){var _0x585d63;_0xa76332['CmContact'][_0x919d('0x1e')]()[_0x919d('0x1f')](function(_0xb85bd3){return _0xa76332['OpenchannelAccount'][_0x919d('0x20')]({'where':{'id':_0x5c081e[_0x919d('0x21')]},'include':[{'model':_0xa76332[_0x919d('0x17')],'as':'Interactions','where':{'id':_0x5c081e[_0x919d('0x19')]},'limit':0x1,'include':[{'model':_0xa76332[_0x919d('0x22')],'as':_0x919d('0x23'),'attributes':_['keys'](_0xb85bd3)}]}]});})[_0x919d('0x1f')](function(_0x1c0432){_0x585d63=_0x1c0432['get']({'plain':!![]});if(_0x585d63&&_0x585d63[_0x919d('0x24')]){logger[_0x919d('0x25')](_0x919d('0x26'),_0x919d('0x27'),util[_0x919d('0x28')](_0x919d('0x29'),_0x5c081e['id'],_0x585d63[_0x919d('0x24')]));if(_0x585d63[_0x919d('0x2a')]&&_0x585d63['Interactions'][_0x919d('0x2b')]){_0x5c081e[_0x919d('0x2c')]=_['omit'](_0x585d63['Interactions'][0x0],_0x919d('0x23'));_0x5c081e[_0x919d('0x23')]=_0x585d63['Interactions'][0x0][_0x919d('0x23')];}var _0x46c3b9={'method':'POST','uri':encodeURI(_0x585d63['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x46c3b9[_0x919d('0x2d')]){case _0x919d('0x2e'):_0x46c3b9['qs']=_0x5c081e;break;case _0x919d('0x2f'):_0x46c3b9['body']=_0x5c081e;break;}return rp(_0x46c3b9)[_0x919d('0x1f')](function(_0x3a9667){logger[_0x919d('0x25')](_0x919d('0x26'),'afterCreate',util['format'](_0x919d('0x30'),_0x5c081e['id'],_0x585d63[_0x919d('0x24')]));if(_0x3a9667[_0x919d('0xe')][_0x919d('0x31')]&&_0x3a9667[_0x919d('0xe')]['threadId']!=_0x5c081e[_0x919d('0x2c')][_0x919d('0x31')]){return _0xa76332[_0x919d('0x17')][_0x919d('0x1a')]({'threadId':_0x3a9667['body']['threadId']},{'where':{'id':_0x5c081e[_0x919d('0x2c')]['id']}});}else{return;}})[_0x919d('0x1f')](function(){return _0x3e1c67[_0x919d('0x1a')]({'read':!![]});})[_0x919d('0x1b')](function(_0x5cc4d9){logger[_0x919d('0x1c')](_0x919d('0x26'),'afterCreate',util[_0x919d('0x32')](_0x5cc4d9,{'showHidden':![],'depth':null}));_0x5ad477();});}else{_0x5ad477();}})[_0x919d('0x33')](function(){_0x5ad477();});}else{_0x5ad477();}}},'charset':_0x919d('0x34'),'collate':_0x919d('0x35')});}; \ No newline at end of file +var _0x2f65=['Interactions','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','omit','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','catch','inspect','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','toLowerCase','error','direction','out','CmContact','describe','OpenchannelAccountId','OpenchannelInteraction'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2f65,0x7d));var _0x52f6=function(_0x5302af,_0x585aed){_0x5302af=_0x5302af-0x0;var _0x5e77f8=_0x2f65[_0x5302af];return _0x5e77f8;};'use strict';var _=require(_0x52f6('0x0'));var util=require(_0x52f6('0x1'));var logger=require(_0x52f6('0x2'))('api');var moment=require(_0x52f6('0x3'));var BPromise=require(_0x52f6('0x4'));var rp=require(_0x52f6('0x5'));var fs=require('fs');var path=require(_0x52f6('0x6'));var rimraf=require(_0x52f6('0x7'));var config=require('../../config/environment');var attributes=require(_0x52f6('0x8'));module[_0x52f6('0x9')]=function(_0x5e9a0b,_0x1c6186){return _0x5e9a0b[_0x52f6('0xa')](_0x52f6('0xb'),attributes,{'tableName':_0x52f6('0xc'),'paranoid':![],'indexes':[{'name':_0x52f6('0xd'),'fields':[_0x52f6('0xe')],'type':_0x52f6('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b2681,_0x514e02,_0x46795d){var _0x2b2535=_0x5e9a0b[_0x52f6('0x10')];var _0x46dbe6=_0x2b2681[_0x52f6('0x11')]({'plain':!![]});if(_0x46dbe6['direction']['toLowerCase']()==='in'||_0x46dbe6['direction']['toLowerCase']()==='out'&&!_0x46dbe6[_0x52f6('0x12')]&&!_[_0x52f6('0x13')](_0x46dbe6[_0x52f6('0x14')])){_0x2b2535['OpenchannelInteraction'][_0x52f6('0x15')]({'where':{'id':_0x46dbe6[_0x52f6('0x16')]}})[_0x52f6('0x17')](function(_0x54ea3f){if(_0x54ea3f){_0x54ea3f[_0x52f6('0x18')]({'lastMsgAt':_0x46dbe6[_0x52f6('0x19')],'lastMsgDirection':_0x46dbe6['direction'][_0x52f6('0x1a')]()});}})['catch'](function(_0x440d7a){console[_0x52f6('0x1b')](_0x440d7a);});}if(_0x46dbe6[_0x52f6('0x1c')]===_0x52f6('0x1d')&&!_0x46dbe6['secret']){var _0x4dc152;_0x2b2535[_0x52f6('0x1e')][_0x52f6('0x1f')]()[_0x52f6('0x17')](function(_0x29458a){return _0x2b2535['OpenchannelAccount']['find']({'where':{'id':_0x46dbe6[_0x52f6('0x20')]},'include':[{'model':_0x2b2535[_0x52f6('0x21')],'as':_0x52f6('0x22'),'where':{'id':_0x46dbe6[_0x52f6('0x16')]},'limit':0x1,'include':[{'model':_0x2b2535['CmContact'],'as':_0x52f6('0x23'),'attributes':_[_0x52f6('0x24')](_0x29458a)}]}]});})['then'](function(_0xd440c8){_0x4dc152=_0xd440c8[_0x52f6('0x11')]({'plain':!![]});if(_0x4dc152&&_0x4dc152[_0x52f6('0x25')]){logger['info'](_0x52f6('0x26'),_0x52f6('0x27'),util[_0x52f6('0x28')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x46dbe6['id'],_0x4dc152[_0x52f6('0x25')]));if(_0x4dc152[_0x52f6('0x22')]&&_0x4dc152[_0x52f6('0x22')][_0x52f6('0x29')]){_0x46dbe6['Interaction']=_[_0x52f6('0x2a')](_0x4dc152[_0x52f6('0x22')][0x0],'Contact');_0x46dbe6['Contact']=_0x4dc152[_0x52f6('0x22')][0x0][_0x52f6('0x23')];}var _0x514e02={'method':_0x52f6('0x2b'),'uri':encodeURI(_0x4dc152[_0x52f6('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x514e02[_0x52f6('0x2c')]){case _0x52f6('0x2d'):_0x514e02['qs']=_0x46dbe6;break;case'POST':_0x514e02[_0x52f6('0xe')]=_0x46dbe6;break;}return rp(_0x514e02)[_0x52f6('0x17')](function(_0x3a9299){logger[_0x52f6('0x2e')](_0x52f6('0x26'),_0x52f6('0x27'),util['format'](_0x52f6('0x2f'),_0x46dbe6['id'],_0x4dc152[_0x52f6('0x25')]));if(_0x3a9299[_0x52f6('0xe')][_0x52f6('0x30')]&&_0x3a9299['body']['threadId']!=_0x46dbe6[_0x52f6('0x31')][_0x52f6('0x30')]){return _0x2b2535[_0x52f6('0x21')][_0x52f6('0x18')]({'threadId':_0x3a9299[_0x52f6('0xe')][_0x52f6('0x30')]},{'where':{'id':_0x46dbe6[_0x52f6('0x31')]['id']}});}else{return;}})['then'](function(){return _0x2b2681[_0x52f6('0x18')]({'read':!![]});})[_0x52f6('0x32')](function(_0x2bccfa){logger[_0x52f6('0x1b')]('OpenchannelMessage,\x20%s,\x20%s',_0x52f6('0x27'),util[_0x52f6('0x33')](_0x2bccfa,{'showHidden':![],'depth':null}));_0x46795d();});}else{_0x46795d();}})['finally'](function(){_0x46795d();});}else{_0x46795d();}}},'charset':'utf8mb4','collate':_0x52f6('0x34')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 31758cb..6884774 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(_0x143734,_0x98f1aa){var _0x4313d1=function(_0x3de5bd){while(--_0x3de5bd){_0x143734['push'](_0x143734['shift']());}};_0x4313d1(++_0x98f1aa);}(_0x2ef3,0xba));var _0x32ef=function(_0x42ec9b,_0x5e00d3){_0x42ec9b=_0x42ec9b-0x0;var _0x2f6005=_0x2ef3[_0x42ec9b];return _0x2f6005;};'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 _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x594311,_0x151f44){var _0x5a57c1=function(_0x19c038){while(--_0x19c038){_0x594311['push'](_0x594311['shift']());}};_0x5a57c1(++_0x151f44);}(_0x7a54,0x106));var _0x47a5=function(_0x7b4527,_0x559784){_0x7b4527=_0x7b4527-0x0;var _0x2498c4=_0x7a54[_0x7b4527];return _0x2498c4;};'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});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 37597c8..be891e5 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 _0x74cd=['./openchannelMessage.events','save','update','emit','removeListener','register'];(function(_0x168765,_0x534f44){var _0x3ee3a0=function(_0x274d2d){while(--_0x274d2d){_0x168765['push'](_0x168765['shift']());}};_0x3ee3a0(++_0x534f44);}(_0x74cd,0x162));var _0xd74c=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x74cd[_0x2cfb58];return _0xd99951;};'use strict';var OpenchannelMessageEvents=require(_0xd74c('0x0'));var events=[_0xd74c('0x1'),'remove',_0xd74c('0x2')];function createListener(_0x688814,_0x570aa5){return function(_0x131c4f){_0x570aa5[_0xd74c('0x3')](_0x688814,_0x131c4f);};}function removeListener(_0x1a43e1,_0x395516){return function(){OpenchannelMessageEvents[_0xd74c('0x4')](_0x1a43e1,_0x395516);};}exports[_0xd74c('0x5')]=function(_0x8837fb){for(var _0x42e5b9=0x0,_0x74b304=events['length'];_0x42e5b9<_0x74b304;_0x42e5b9++){var _0x2740b1=events[_0x42e5b9];var _0x5df310=createListener('openchannelMessage:'+_0x2740b1,_0x8837fb);OpenchannelMessageEvents['on'](_0x2740b1,_0x5df310);}}; \ No newline at end of file +var _0xefe9=['emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefe9,0x83));var _0x9efe=function(_0xe4d365,_0x460c68){_0xe4d365=_0xe4d365-0x0;var _0x1297f8=_0xefe9[_0xe4d365];return _0x1297f8;};'use strict';var OpenchannelMessageEvents=require(_0x9efe('0x0'));var events=['save',_0x9efe('0x1'),'update'];function createListener(_0x3155bc,_0x123900){return function(_0x55d82e){_0x123900[_0x9efe('0x2')](_0x3155bc,_0x55d82e);};}function removeListener(_0x51b705,_0x13af43){return function(){OpenchannelMessageEvents[_0x9efe('0x3')](_0x51b705,_0x13af43);};}exports[_0x9efe('0x4')]=function(_0x184e94){for(var _0x333ef7=0x0,_0xb8b973=events[_0x9efe('0x5')];_0x333ef7<_0xb8b973;_0x333ef7++){var _0x58afcc=events[_0x333ef7];var _0x108466=createListener(_0x9efe('0x6')+_0x58afcc,_0x184e94);OpenchannelMessageEvents['on'](_0x58afcc,_0x108466);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index acfde26..0b9a874 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 _0x925c=['isAuthenticated','index','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get'];(function(_0x1b4b3c,_0x508734){var _0x343c17=function(_0x1c3d5b){while(--_0x1c3d5b){_0x1b4b3c['push'](_0x1b4b3c['shift']());}};_0x343c17(++_0x508734);}(_0x925c,0x1c7));var _0xc925=function(_0x5c1faf,_0x4c4e58){_0x5c1faf=_0x5c1faf-0x0;var _0xaaaf45=_0x925c[_0x5c1faf];return _0xaaaf45;};'use strict';var multer=require(_0xc925('0x0'));var util=require('util');var path=require(_0xc925('0x1'));var timeout=require(_0xc925('0x2'));var express=require('express');var router=express[_0xc925('0x3')]();var fs_extra=require(_0xc925('0x4'));var auth=require(_0xc925('0x5'));var interaction=require(_0xc925('0x6'));var config=require('../../config/environment');var controller=require(_0xc925('0x7'));router[_0xc925('0x8')]('/',auth[_0xc925('0x9')](),controller[_0xc925('0xa')]);router['get']('/describe',auth[_0xc925('0x9')](),controller['describe']);router[_0xc925('0x8')](_0xc925('0xb'),auth[_0xc925('0x9')](),controller[_0xc925('0xc')]);router['get'](_0xc925('0xd'),auth[_0xc925('0x9')](),controller[_0xc925('0xe')]);router['get']('/:id/teams',auth[_0xc925('0x9')](),controller[_0xc925('0xf')]);router[_0xc925('0x8')](_0xc925('0x10'),auth[_0xc925('0x9')](),controller[_0xc925('0x11')]);router[_0xc925('0x12')]('/',auth[_0xc925('0x9')](),controller[_0xc925('0x13')]);router[_0xc925('0x12')](_0xc925('0x14'),auth[_0xc925('0x9')](),controller[_0xc925('0x15')]);router[_0xc925('0x12')](_0xc925('0x10'),auth[_0xc925('0x9')](),controller[_0xc925('0x16')]);router['put'](_0xc925('0xb'),auth[_0xc925('0x9')](),controller[_0xc925('0x17')]);router[_0xc925('0x18')](_0xc925('0xb'),auth['isAuthenticated'](),controller[_0xc925('0x19')]);router['delete'](_0xc925('0x14'),auth[_0xc925('0x9')](),controller[_0xc925('0x1a')]);router['delete'](_0xc925('0x10'),auth[_0xc925('0x9')](),controller[_0xc925('0x1b')]);module[_0xc925('0x1c')]=router; \ No newline at end of file +var _0x62e5=['delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/members','getMembers','getTeams','/:id/users','post','create','/:id/teams','addTeams','addAgents','put'];(function(_0x23475e,_0x47e75b){var _0x597e3c=function(_0x25b6c4){while(--_0x25b6c4){_0x23475e['push'](_0x23475e['shift']());}};_0x597e3c(++_0x47e75b);}(_0x62e5,0x1e5));var _0x562e=function(_0x5bb0f7,_0x1ee3c4){_0x5bb0f7=_0x5bb0f7-0x0;var _0x1d7677=_0x62e5[_0x5bb0f7];return _0x1d7677;};'use strict';var multer=require(_0x562e('0x0'));var util=require(_0x562e('0x1'));var path=require(_0x562e('0x2'));var timeout=require(_0x562e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x562e('0x4'));var auth=require(_0x562e('0x5'));var interaction=require(_0x562e('0x6'));var config=require(_0x562e('0x7'));var controller=require('./openchannelQueue.controller');router['get']('/',auth[_0x562e('0x8')](),controller[_0x562e('0x9')]);router['get'](_0x562e('0xa'),auth[_0x562e('0x8')](),controller[_0x562e('0xb')]);router[_0x562e('0xc')](_0x562e('0xd'),auth[_0x562e('0x8')](),controller[_0x562e('0xe')]);router[_0x562e('0xc')](_0x562e('0xf'),auth[_0x562e('0x8')](),controller[_0x562e('0x10')]);router[_0x562e('0xc')]('/:id/teams',auth['isAuthenticated'](),controller[_0x562e('0x11')]);router[_0x562e('0xc')](_0x562e('0x12'),auth[_0x562e('0x8')](),controller['getAgents']);router[_0x562e('0x13')]('/',auth[_0x562e('0x8')](),controller[_0x562e('0x14')]);router['post'](_0x562e('0x15'),auth['isAuthenticated'](),controller[_0x562e('0x16')]);router['post'](_0x562e('0x12'),auth[_0x562e('0x8')](),controller[_0x562e('0x17')]);router[_0x562e('0x18')](_0x562e('0xd'),auth[_0x562e('0x8')](),controller['update']);router[_0x562e('0x19')]('/:id',auth[_0x562e('0x8')](),controller[_0x562e('0x1a')]);router[_0x562e('0x19')](_0x562e('0x15'),auth['isAuthenticated'](),controller[_0x562e('0x1b')]);router[_0x562e('0x19')]('/:id/users',auth['isAuthenticated'](),controller[_0x562e('0x1c')]);module[_0x562e('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 38d338b..b33bd9d 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 _0x2606=['name','STRING','ENUM','rrmemory','exports'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0x2606,0x194));var _0x6260=function(_0x570943,_0x2d2b65){_0x570943=_0x570943-0x0;var _0x4b8eb4=_0x2606[_0x570943];return _0x4b8eb4;};'use strict';var Sequelize=require('sequelize');module[_0x6260('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x6260('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6260('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6260('0x3')](_0x6260('0x4'),'beepall','roundrobin')}}; \ No newline at end of file +var _0xfea3=['beepall','roundrobin','exports','STRING','name','ENUM','rrmemory'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xfea3,0xdb));var _0x3fea=function(_0x65a31e,_0x1cee3d){_0x65a31e=_0x65a31e-0x0;var _0x2c8f6e=_0xfea3[_0x65a31e];return _0x2c8f6e;};'use strict';var Sequelize=require('sequelize');module[_0x3fea('0x0')]={'name':{'type':Sequelize[_0x3fea('0x1')],'unique':_0x3fea('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3fea('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3fea('0x3')](_0x3fea('0x4'),_0x3fea('0x5'),_0x3fea('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index d448881..5e047e0 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 _0xf9d7=['defaults','localhost','socket.io-emitter','register','status','json','offset','undefined','limit','count','Content-Range','then','destroy','get','OpenchannelQueues','UserProfileResource','sendStatus','error','stack','name','index','map','OpenchannelQueue','rawAttributes','fieldName','getOptions','where','include','query','rows','catch','params','model','keys','filters','attributes','fields','length','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserOpenchannelQueue','intersection','hasOwnProperty','nolimit','sort','pick','OpenchannelQueueId','filter','merge','options','findAll','User','findAndCountAll','UserId','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','online','interface','flatMap','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','union','compact','transaction','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','removeAgents','isArray','getAgents','order','bluebird','lodash','squel','ioredis','../../config/logger','api','../../mysqldb','redis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf9d7,0x1d4));var _0x7f9d=function(_0x5bac10,_0x436643){_0x5bac10=_0x5bac10-0x0;var _0x362c49=_0xf9d7[_0x5bac10];return _0x362c49;};'use strict';var BPromise=require(_0x7f9d('0x0'));var util=require('util');var _=require(_0x7f9d('0x1'));var squel=require(_0x7f9d('0x2'));var Redis=require(_0x7f9d('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x7f9d('0x4'))(_0x7f9d('0x5'));var config=require('../../config/environment');var db=require(_0x7f9d('0x6'))['db'];config[_0x7f9d('0x7')]=_[_0x7f9d('0x8')](config[_0x7f9d('0x7')],{'host':_0x7f9d('0x9'),'port':0x18eb});var socket=require(_0x7f9d('0xa'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x7f9d('0xb')](socket);function respondWithStatusCode(_0x36709f,_0x41bf50){_0x41bf50=_0x41bf50||0xcc;return function(_0x3af77a){if(_0x3af77a){return _0x36709f['sendStatus'](_0x41bf50);}return _0x36709f['status'](_0x41bf50)['end']();};}function respondWithResult(_0x2b3bdf,_0x5f4517){_0x5f4517=_0x5f4517||0xc8;return function(_0x4fbe34){if(_0x4fbe34){return _0x2b3bdf[_0x7f9d('0xc')](_0x5f4517)[_0x7f9d('0xd')](_0x4fbe34);}};}function respondWithFilteredResult(_0x110384,_0x3c6439){return function(_0x309e34){if(_0x309e34){var _0x36dcc5=typeof _0x3c6439[_0x7f9d('0xe')]===_0x7f9d('0xf')&&typeof _0x3c6439[_0x7f9d('0x10')]===_0x7f9d('0xf');var _0x351663=_0x309e34[_0x7f9d('0x11')];var _0x1dde27=_0x36dcc5?0x0:_0x3c6439[_0x7f9d('0xe')];var _0x17167a=_0x36dcc5?_0x309e34['count']:_0x3c6439[_0x7f9d('0xe')]+_0x3c6439[_0x7f9d('0x10')];var _0x495534;if(_0x17167a>=_0x351663){_0x17167a=_0x351663;_0x495534=0xc8;}else{_0x495534=0xce;}_0x110384[_0x7f9d('0xc')](_0x495534);return _0x110384['set'](_0x7f9d('0x12'),_0x1dde27+'-'+_0x17167a+'/'+_0x351663)[_0x7f9d('0xd')](_0x309e34);}return null;};}function saveUpdates(_0x345efb){return function(_0x5b2497){if(_0x5b2497){return _0x5b2497['update'](_0x345efb)[_0x7f9d('0x13')](function(_0x32aa93){return _0x32aa93;});}return null;};}function removeEntity(_0x3a483d){return function(_0x10ee1d){if(_0x10ee1d){return _0x10ee1d[_0x7f9d('0x14')]()[_0x7f9d('0x13')](function(){var _0x104026=_0x10ee1d[_0x7f9d('0x15')]({'plain':!![]});var _0x1b1b38=_0x7f9d('0x16');return db[_0x7f9d('0x17')][_0x7f9d('0x14')]({'where':{'type':_0x1b1b38,'resourceId':_0x104026['id']}})[_0x7f9d('0x13')](function(){return _0x10ee1d;});})['then'](function(){_0x3a483d[_0x7f9d('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38cee9){return function(_0x111c80){if(!_0x111c80){_0x38cee9[_0x7f9d('0x18')](0x194);}return _0x111c80;};}function handleError(_0x298e22,_0x27e986){_0x27e986=_0x27e986||0x1f4;return function(_0x9946e1){logger[_0x7f9d('0x19')](_0x9946e1[_0x7f9d('0x1a')]);if(_0x9946e1['name']){delete _0x9946e1[_0x7f9d('0x1b')];}_0x298e22[_0x7f9d('0xc')](_0x27e986)['send'](_0x9946e1);};}exports[_0x7f9d('0x1c')]=function(_0x181024,_0x12b8a1){var _0x59c0f1={};var _0xcdb6c7={'count':0x0,'rows':[]};var _0x1c1cdd=_[_0x7f9d('0x1d')](db[_0x7f9d('0x1e')][_0x7f9d('0x1f')],function(_0x2e58b5){return{'name':_0x2e58b5[_0x7f9d('0x20')],'type':_0x2e58b5['type']['key']};});_0x59c0f1=qs[_0x7f9d('0x21')](_0x1c1cdd,_0x181024);var _0x3fd705={'where':_0x59c0f1[_0x7f9d('0x22')]};return db[_0x7f9d('0x1e')][_0x7f9d('0x11')](_0x3fd705)[_0x7f9d('0x13')](function(_0x288805){_0xcdb6c7[_0x7f9d('0x11')]=_0x288805;_0x59c0f1[_0x7f9d('0x23')]=qs[_0x7f9d('0x23')](_0x181024[_0x7f9d('0x24')]);return db[_0x7f9d('0x1e')]['findAll'](_0x59c0f1);})[_0x7f9d('0x13')](function(_0x5c5af1){_0xcdb6c7[_0x7f9d('0x25')]=_0x5c5af1;return _0xcdb6c7;})['then'](respondWithFilteredResult(_0x12b8a1,_0x59c0f1))[_0x7f9d('0x26')](handleError(_0x12b8a1,null));};exports['show']=function(_0x200414,_0x2dc195){var _0x3ff909={'raw':!![],'where':{'id':_0x200414[_0x7f9d('0x27')]['id']}},_0xbd535a={};_0xbd535a[_0x7f9d('0x28')]=_[_0x7f9d('0x29')](db[_0x7f9d('0x1e')][_0x7f9d('0x1f')]);_0xbd535a[_0x7f9d('0x24')]=_[_0x7f9d('0x29')](_0x200414['query']);_0xbd535a[_0x7f9d('0x2a')]=_['intersection'](_0xbd535a['model'],_0xbd535a[_0x7f9d('0x24')]);_0x3ff909[_0x7f9d('0x2b')]=_['intersection'](_0xbd535a[_0x7f9d('0x28')],qs['fields'](_0x200414[_0x7f9d('0x24')][_0x7f9d('0x2c')]));_0x3ff909[_0x7f9d('0x2b')]=_0x3ff909['attributes'][_0x7f9d('0x2d')]?_0x3ff909[_0x7f9d('0x2b')]:_0xbd535a[_0x7f9d('0x28')];if(_0x200414['query'][_0x7f9d('0x2e')]){_0x3ff909[_0x7f9d('0x23')]=[{'all':!![]}];}_0x3ff909=_['merge']({},_0x3ff909,_0x200414['options']);return db[_0x7f9d('0x1e')][_0x7f9d('0x2f')](_0x3ff909)['then'](handleEntityNotFound(_0x2dc195,null))[_0x7f9d('0x13')](respondWithResult(_0x2dc195,null))['catch'](handleError(_0x2dc195,null));};exports['create']=function(_0x46ad42,_0x4113b3){return db[_0x7f9d('0x1e')]['create'](_0x46ad42[_0x7f9d('0x30')],{})[_0x7f9d('0x13')](function(_0x417dad){var _0x1ed639=_0x46ad42[_0x7f9d('0x31')][_0x7f9d('0x15')]({'plain':!![]});if(!_0x1ed639)throw new Error(_0x7f9d('0x32'));if(_0x1ed639['role']===_0x7f9d('0x31')){var _0x953499=_0x417dad['get']({'plain':!![]});var _0x588bd2=_0x7f9d('0x16');return db['UserProfileSection'][_0x7f9d('0x2f')]({'where':{'name':_0x588bd2,'userProfileId':_0x1ed639[_0x7f9d('0x33')]},'raw':!![]})[_0x7f9d('0x13')](function(_0x1e892d){if(_0x1e892d&&_0x1e892d[_0x7f9d('0x34')]===0x0){return db['UserProfileResource']['create']({'name':_0x953499[_0x7f9d('0x1b')],'resourceId':_0x953499['id'],'type':_0x1e892d[_0x7f9d('0x1b')],'sectionId':_0x1e892d['id']},{})[_0x7f9d('0x13')](function(){return _0x417dad;});}else{return _0x417dad;}})[_0x7f9d('0x26')](function(_0x489922){logger[_0x7f9d('0x19')](_0x7f9d('0x35'),_0x489922);throw _0x489922;});}return _0x417dad;})[_0x7f9d('0x13')](respondWithResult(_0x4113b3,0xc9))['catch'](handleError(_0x4113b3,null));};exports['update']=function(_0x2fbd32,_0x5ac78a){if(_0x2fbd32[_0x7f9d('0x30')]['id']){delete _0x2fbd32[_0x7f9d('0x30')]['id'];}return db[_0x7f9d('0x1e')][_0x7f9d('0x2f')]({'where':{'id':_0x2fbd32[_0x7f9d('0x27')]['id']}})[_0x7f9d('0x13')](handleEntityNotFound(_0x5ac78a,null))[_0x7f9d('0x13')](saveUpdates(_0x2fbd32[_0x7f9d('0x30')],null))[_0x7f9d('0x13')](respondWithResult(_0x5ac78a,null))[_0x7f9d('0x26')](handleError(_0x5ac78a,null));};exports[_0x7f9d('0x14')]=function(_0x96d134,_0x3ddf6c){return db['OpenchannelQueue'][_0x7f9d('0x2f')]({'where':{'id':_0x96d134[_0x7f9d('0x27')]['id']}})['then'](handleEntityNotFound(_0x3ddf6c,null))['then'](removeEntity(_0x3ddf6c,null))[_0x7f9d('0x26')](handleError(_0x3ddf6c,null));};exports[_0x7f9d('0x36')]=function(_0x48f59b,_0x5cec8a){return db[_0x7f9d('0x1e')][_0x7f9d('0x36')]()['then'](respondWithResult(_0x5cec8a,null))['catch'](handleError(_0x5cec8a,null));};exports['getMembers']=function(_0x36ca92,_0x180a87){var _0x497608={'raw':!![],'where':{}},_0x38a865={},_0x287820;return db[_0x7f9d('0x1e')]['findOne']({'where':{'id':_0x36ca92[_0x7f9d('0x27')]['id']}})['then'](handleEntityNotFound(_0x180a87,null))['then'](function(_0x4a063b){if(_0x4a063b){_0x287820=_0x4a063b[_0x7f9d('0x15')]({'plain':!![]});_0x38a865[_0x7f9d('0x28')]=_[_0x7f9d('0x29')](db[_0x7f9d('0x37')][_0x7f9d('0x1f')]);_0x38a865['query']=_['keys'](_0x36ca92[_0x7f9d('0x24')]);_0x38a865[_0x7f9d('0x2a')]=_[_0x7f9d('0x38')](_0x38a865[_0x7f9d('0x28')],_0x38a865[_0x7f9d('0x24')]);_0x497608['attributes']=_[_0x7f9d('0x38')](_0x38a865[_0x7f9d('0x28')],qs['fields'](_0x36ca92[_0x7f9d('0x24')]['fields']));_0x497608['attributes']=_0x497608['attributes'][_0x7f9d('0x2d')]?_0x497608[_0x7f9d('0x2b')]:_0x38a865[_0x7f9d('0x28')];if(!_0x36ca92[_0x7f9d('0x24')][_0x7f9d('0x39')](_0x7f9d('0x3a'))){_0x497608['limit']=qs[_0x7f9d('0x10')](_0x36ca92['query'][_0x7f9d('0x10')]);_0x497608[_0x7f9d('0xe')]=qs[_0x7f9d('0xe')](_0x36ca92[_0x7f9d('0x24')][_0x7f9d('0xe')]);}_0x497608['order']=qs[_0x7f9d('0x3b')](_0x36ca92[_0x7f9d('0x24')][_0x7f9d('0x3b')]);_0x497608['where']=qs[_0x7f9d('0x2a')](_[_0x7f9d('0x3c')](_0x36ca92[_0x7f9d('0x24')],_0x38a865[_0x7f9d('0x2a')]));_0x497608[_0x7f9d('0x22')][_0x7f9d('0x3d')]=_0x4a063b['id'];if(_0x36ca92[_0x7f9d('0x24')][_0x7f9d('0x3e')]){_0x497608['where']=_[_0x7f9d('0x3f')](_0x497608[_0x7f9d('0x22')],{'$or':_[_0x7f9d('0x1d')](_0x497608['attributes'],function(_0x15642c){var _0x105ef4={};_0x105ef4[_0x15642c]={'$like':'%'+_0x36ca92[_0x7f9d('0x24')][_0x7f9d('0x3e')]+'%'};return _0x105ef4;})});}_0x497608=_[_0x7f9d('0x3f')]({},_0x497608,_0x36ca92[_0x7f9d('0x40')]);return db[_0x7f9d('0x37')][_0x7f9d('0x41')](_0x497608);}})[_0x7f9d('0x13')](function(_0x27360e){if(_0x27360e){return db[_0x7f9d('0x42')][_0x7f9d('0x43')]({'where':{'id':_[_0x7f9d('0x1d')](_0x27360e,_0x7f9d('0x44')),'role':'agent'},'attributes':['id','name',_0x7f9d('0x45'),'updatedAt',_0x7f9d('0x46')]});}})[_0x7f9d('0x13')](function(_0x270203){if(_0x270203){return{'count':_0x270203[_0x7f9d('0x11')],'rows':_[_0x7f9d('0x1d')](_0x270203[_0x7f9d('0x25')],function(_0x318bb7){return{'membername':_0x318bb7['name'],'UserId':_0x318bb7['id'],'queue_name':_0x287820[_0x7f9d('0x1b')],'OpenchannelQueueId':_0x287820['id'],'interface':util[_0x7f9d('0x47')](_0x7f9d('0x48'),_0x7f9d('0x49'),_0x318bb7[_0x7f9d('0x1b')]),'penalty':0x0,'paused':_0x318bb7[_0x7f9d('0x45')],'createdAt':_0x318bb7[_0x7f9d('0x46')],'updatedAt':_0x318bb7[_0x7f9d('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7f9d('0x13')](respondWithFilteredResult(_0x180a87,_0x497608))[_0x7f9d('0x26')](handleError(_0x180a87,null));};exports[_0x7f9d('0x4b')]=function(_0x226648,_0x20ae97){var _0x329367={};var _0x35b238={};var _0x1aeba2;var _0xe2d26d;return db[_0x7f9d('0x1e')][_0x7f9d('0x4c')]({'where':{'id':_0x226648[_0x7f9d('0x27')]['id']}})[_0x7f9d('0x13')](handleEntityNotFound(_0x20ae97,null))['then'](function(_0x5dcd0c){if(_0x5dcd0c){_0x1aeba2=_0x5dcd0c;_0x35b238[_0x7f9d('0x28')]=_[_0x7f9d('0x29')](db[_0x7f9d('0x4d')][_0x7f9d('0x1f')]);_0x35b238[_0x7f9d('0x24')]=_[_0x7f9d('0x29')](_0x226648[_0x7f9d('0x24')]);_0x35b238[_0x7f9d('0x2a')]=_[_0x7f9d('0x38')](_0x35b238['model'],_0x35b238['query']);_0x329367[_0x7f9d('0x2b')]=_[_0x7f9d('0x38')](_0x35b238['model'],qs[_0x7f9d('0x2c')](_0x226648['query'][_0x7f9d('0x2c')]));_0x329367[_0x7f9d('0x2b')]=_0x329367[_0x7f9d('0x2b')][_0x7f9d('0x2d')]?_0x329367[_0x7f9d('0x2b')]:_0x35b238['model'];_0x329367['order']=qs[_0x7f9d('0x3b')](_0x226648[_0x7f9d('0x24')][_0x7f9d('0x3b')]);_0x329367[_0x7f9d('0x22')]=qs[_0x7f9d('0x2a')](_[_0x7f9d('0x3c')](_0x226648[_0x7f9d('0x24')],_0x35b238[_0x7f9d('0x2a')]));if(_0x226648[_0x7f9d('0x24')][_0x7f9d('0x3e')]){_0x329367[_0x7f9d('0x22')]=_[_0x7f9d('0x3f')](_0x329367[_0x7f9d('0x22')],{'$or':_[_0x7f9d('0x1d')](_0x329367[_0x7f9d('0x2b')],function(_0x594b02){var _0x505f75={};_0x505f75[_0x594b02]={'$like':'%'+_0x226648[_0x7f9d('0x24')]['filter']+'%'};return _0x505f75;})});}_0x329367=_['merge']({},_0x329367,_0x226648[_0x7f9d('0x40')]);return _0x1aeba2[_0x7f9d('0x4b')](_0x329367);}})[_0x7f9d('0x13')](function(_0x35b751){if(_0x35b751){_0xe2d26d=_0x35b751[_0x7f9d('0x2d')];if(!_0x226648[_0x7f9d('0x24')][_0x7f9d('0x39')](_0x7f9d('0x3a'))){_0x329367[_0x7f9d('0x10')]=qs[_0x7f9d('0x10')](_0x226648[_0x7f9d('0x24')]['limit']);_0x329367[_0x7f9d('0xe')]=qs[_0x7f9d('0xe')](_0x226648['query']['offset']);}return _0x1aeba2[_0x7f9d('0x4b')](_0x329367);}})['then'](function(_0x567c72){if(_0x567c72){return _0x567c72?{'count':_0xe2d26d,'rows':_0x567c72}:null;}})['then'](respondWithResult(_0x20ae97,null))[_0x7f9d('0x26')](handleError(_0x20ae97,null));};exports[_0x7f9d('0x4e')]=function(_0x47d0a6,_0x4b4a69){var _0x3685db=_0x47d0a6[_0x7f9d('0x30')][_0x7f9d('0x4f')];return db[_0x7f9d('0x4d')]['findAll']({'where':{'id':_0x3685db},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7f9d('0x50'),'attributes':['id',_0x7f9d('0x1b'),_0x7f9d('0x51'),'voicePause',_0x7f9d('0x52')],'raw':!![]}]})[_0x7f9d('0x13')](function(_0x4b0aed){if(_0x4b0aed){var _0x14ee0d=_[_0x7f9d('0x53')](_0x4b0aed,function(_0xb33622){var _0xf5336e=_0xb33622[_0x7f9d('0x15')]({'plain':!![]});return _0xf5336e[_0x7f9d('0x50')];});return db[_0x7f9d('0x1e')][_0x7f9d('0x2f')]({'where':{'id':_0x47d0a6['params']['id']}})[_0x7f9d('0x13')](function(_0x2c1e82){return db['sequelize']['transaction'](function(_0x501738){return _0x2c1e82[_0x7f9d('0x4e')](_0x3685db,{'transaction':_0x501738})[_0x7f9d('0x13')](function(){return BPromise[_0x7f9d('0x54')](_0x14ee0d,function(_0xbc14db){return db[_0x7f9d('0x37')][_0x7f9d('0x55')]({'where':{'UserId':_0xbc14db['id'],'OpenchannelQueueId':_0x47d0a6['params']['id']},'transaction':_0x501738});});})[_0x7f9d('0x13')](function(){_0x14ee0d[_0x7f9d('0x56')](function(_0x3e4bd8){socket[_0x7f9d('0x57')]('userOpenchannelQueue:save',{'UserId':_0x3e4bd8['id'],'OpenchannelQueueId':_0x2c1e82['id']});});});});});}})['then'](respondWithStatusCode(_0x4b4a69,null))['catch'](handleError(_0x4b4a69,null));};exports[_0x7f9d('0x58')]=function(_0x13208b,_0x5c5010){return db[_0x7f9d('0x4d')][_0x7f9d('0x41')]({'where':{'id':_0x13208b['query'][_0x7f9d('0x4f')]},'attributes':['id'],'include':[{'model':db[_0x7f9d('0x42')],'as':_0x7f9d('0x50'),'attributes':['id'],'raw':!![]}]})[_0x7f9d('0x13')](handleEntityNotFound(_0x5c5010,null))[_0x7f9d('0x13')](function(_0x437830){var _0xcc8389=_['map'](_0x437830,'id');var _0x53f4f9=[];var _0x3534aa=[];var _0xc5570a=squel[_0x7f9d('0x59')]();_0xc5570a[_0x7f9d('0x5a')](_0x7f9d('0x5b'))['from'](_0x7f9d('0x5c'),'tq')[_0x7f9d('0x5d')](_0x7f9d('0x5e'),'ut',_0x7f9d('0x5f'))[_0x7f9d('0x22')](_0x7f9d('0x60'),_0x13208b[_0x7f9d('0x27')]['id']);for(var _0x167f86=0x0;_0x167f86<_0x437830[_0x7f9d('0x2d')];_0x167f86+=0x1){let _0xa4e250=_0x437830[_0x167f86];for(var _0x2a7e05=0x0;_0x2a7e05<_0xa4e250[_0x7f9d('0x50')][_0x7f9d('0x2d')];_0x2a7e05+=0x1){let _0x13ca15=_0xa4e250[_0x7f9d('0x50')][_0x2a7e05];var _0x18dee0=_0xc5570a[_0x7f9d('0x61')]();_0x18dee0[_0x7f9d('0x22')](_0x7f9d('0x62'),_0x13ca15['id']);_0x3534aa[_0x7f9d('0x63')](db[_0x7f9d('0x64')]['query'](_0x18dee0['toString'](),{'type':db[_0x7f9d('0x64')][_0x7f9d('0x65')][_0x7f9d('0x66')]})[_0x7f9d('0x13')](function(_0x1d0f14){if(_0x1d0f14[_0x7f9d('0x2d')]===0x1){return _0x13ca15['id'];}else{var _0x5948a1=_[_0x7f9d('0x67')](_[_0x7f9d('0x1d')](_0x1d0f14,_0x7f9d('0x68')),function(_0x509382){return _[_0x7f9d('0x69')](_0xcc8389,_0x509382);});if(_0x5948a1){return _0x13ca15['id'];}}}));}}return BPromise['all'](_0x3534aa)[_0x7f9d('0x13')](function(_0x13de10){_0x53f4f9=_(_0x53f4f9)[_0x7f9d('0x6a')](_0x13de10)[_0x7f9d('0x6b')]()['value']();return db[_0x7f9d('0x1e')][_0x7f9d('0x2f')]({'where':{'id':_0x13208b[_0x7f9d('0x27')]['id']}})['then'](function(_0x6fbcf3){return db[_0x7f9d('0x64')][_0x7f9d('0x6c')](function(_0x1ec168){return _0x6fbcf3['removeTeams'](_0x13208b['query'][_0x7f9d('0x4f')],{'transaction':_0x1ec168})[_0x7f9d('0x13')](function(){if(!_[_0x7f9d('0x6d')](_0x53f4f9)){return _0x6fbcf3['removeAgents'](_0x53f4f9,{'transaction':_0x1ec168});}})[_0x7f9d('0x13')](function(){_0x53f4f9[_0x7f9d('0x56')](function(_0x3264b9){socket[_0x7f9d('0x57')](_0x7f9d('0x6e'),{'UserId':_0x3264b9,'OpenchannelQueueId':_0x6fbcf3['id']});});});});});});})[_0x7f9d('0x13')](respondWithStatusCode(_0x5c5010,null))[_0x7f9d('0x26')](handleError(_0x5c5010,null));};exports[_0x7f9d('0x6f')]=function(_0x282e6d,_0x1b6855){return db[_0x7f9d('0x1e')][_0x7f9d('0x2f')]({'where':{'id':_0x282e6d['params']['id']}})['then'](handleEntityNotFound(_0x1b6855,null))[_0x7f9d('0x13')](function(_0x2f3246){if(_0x2f3246){return _0x2f3246[_0x7f9d('0x6f')](_0x282e6d[_0x7f9d('0x30')][_0x7f9d('0x4f')],_[_0x7f9d('0x70')](_0x282e6d[_0x7f9d('0x30')],['ids','id'])||{})[_0x7f9d('0x71')](function(_0x248d7c){for(var _0x1a55ed=0x0;_0x1a55ed<_0x282e6d[_0x7f9d('0x30')][_0x7f9d('0x4f')][_0x7f9d('0x2d')];_0x1a55ed+=0x1){socket[_0x7f9d('0x57')](_0x7f9d('0x72'),{'UserId':Number(_0x282e6d['body']['ids'][_0x1a55ed]),'OpenchannelQueueId':Number(_0x282e6d[_0x7f9d('0x27')]['id'])});}return _0x248d7c;});}})[_0x7f9d('0x13')](respondWithResult(_0x1b6855,null))[_0x7f9d('0x26')](handleError(_0x1b6855,null));};exports[_0x7f9d('0x73')]=function(_0xaaa05b,_0x3ed03e){return db['OpenchannelQueue']['find']({'where':{'id':_0xaaa05b[_0x7f9d('0x27')]['id']}})[_0x7f9d('0x13')](handleEntityNotFound(_0x3ed03e,null))[_0x7f9d('0x13')](function(_0x572fb6){if(_0x572fb6){return _0x572fb6[_0x7f9d('0x73')](_0xaaa05b['query']['ids'])['then'](function(){if(_[_0x7f9d('0x74')](_0xaaa05b[_0x7f9d('0x24')][_0x7f9d('0x4f')])){for(var _0x252deb=0x0;_0x252deb<_0xaaa05b[_0x7f9d('0x24')][_0x7f9d('0x4f')][_0x7f9d('0x2d')];_0x252deb+=0x1){socket[_0x7f9d('0x57')]('userOpenchannelQueue:remove',{'UserId':Number(_0xaaa05b['query'][_0x7f9d('0x4f')][_0x252deb]),'OpenchannelQueueId':Number(_0xaaa05b[_0x7f9d('0x27')]['id'])});}}else{socket[_0x7f9d('0x57')](_0x7f9d('0x6e'),{'UserId':Number(_0xaaa05b['query'][_0x7f9d('0x4f')]),'OpenchannelQueueId':Number(_0xaaa05b[_0x7f9d('0x27')]['id'])});}});}})[_0x7f9d('0x13')](respondWithStatusCode(_0x3ed03e,null))[_0x7f9d('0x26')](handleError(_0x3ed03e,null));};exports[_0x7f9d('0x75')]=function(_0x4cdce3,_0x91bc10){var _0x2c4877={};var _0x55f61a={};var _0x8b0977;var _0x36aebf;return db['OpenchannelQueue'][_0x7f9d('0x4c')]({'where':{'id':_0x4cdce3[_0x7f9d('0x27')]['id']}})[_0x7f9d('0x13')](handleEntityNotFound(_0x91bc10,null))['then'](function(_0x3eaa83){if(_0x3eaa83){_0x8b0977=_0x3eaa83;_0x55f61a[_0x7f9d('0x28')]=_['keys'](db['User']['rawAttributes']);_0x55f61a[_0x7f9d('0x24')]=_['keys'](_0x4cdce3['query']);_0x55f61a['filters']=_[_0x7f9d('0x38')](_0x55f61a['model'],_0x55f61a[_0x7f9d('0x24')]);_0x2c4877['attributes']=_[_0x7f9d('0x38')](_0x55f61a[_0x7f9d('0x28')],qs[_0x7f9d('0x2c')](_0x4cdce3[_0x7f9d('0x24')][_0x7f9d('0x2c')]));_0x2c4877[_0x7f9d('0x2b')]=_0x2c4877[_0x7f9d('0x2b')]['length']?_0x2c4877[_0x7f9d('0x2b')]:_0x55f61a[_0x7f9d('0x28')];_0x2c4877[_0x7f9d('0x76')]=qs[_0x7f9d('0x3b')](_0x4cdce3[_0x7f9d('0x24')]['sort']);_0x2c4877['where']=qs[_0x7f9d('0x2a')](_[_0x7f9d('0x3c')](_0x4cdce3['query'],_0x55f61a[_0x7f9d('0x2a')]));if(_0x4cdce3[_0x7f9d('0x24')][_0x7f9d('0x3e')]){_0x2c4877[_0x7f9d('0x22')]=_[_0x7f9d('0x3f')](_0x2c4877[_0x7f9d('0x22')],{'$or':_[_0x7f9d('0x1d')](_0x2c4877[_0x7f9d('0x2b')],function(_0x6d2165){var _0x5bfc5d={};_0x5bfc5d[_0x6d2165]={'$like':'%'+_0x4cdce3[_0x7f9d('0x24')][_0x7f9d('0x3e')]+'%'};return _0x5bfc5d;})});}_0x2c4877=_[_0x7f9d('0x3f')]({},_0x2c4877,_0x4cdce3[_0x7f9d('0x40')]);return _0x8b0977[_0x7f9d('0x75')](_0x2c4877);}})[_0x7f9d('0x13')](function(_0x5c34c0){if(_0x5c34c0){_0x36aebf=_0x5c34c0[_0x7f9d('0x2d')];if(!_0x4cdce3[_0x7f9d('0x24')][_0x7f9d('0x39')]('nolimit')){_0x2c4877[_0x7f9d('0x10')]=qs[_0x7f9d('0x10')](_0x4cdce3[_0x7f9d('0x24')][_0x7f9d('0x10')]);_0x2c4877[_0x7f9d('0xe')]=qs[_0x7f9d('0xe')](_0x4cdce3[_0x7f9d('0x24')]['offset']);}return _0x8b0977['getAgents'](_0x2c4877);}})[_0x7f9d('0x13')](function(_0x5ed274){if(_0x5ed274){return _0x5ed274?{'count':_0x36aebf,'rows':_0x5ed274}:null;}})[_0x7f9d('0x13')](respondWithResult(_0x91bc10,null))['catch'](handleError(_0x91bc10,null));}; \ No newline at end of file +var _0x8c20=['error','stack','name','index','map','OpenchannelQueue','rawAttributes','fieldName','type','getOptions','where','include','findAll','rows','catch','show','params','model','keys','query','filters','attributes','fields','length','merge','options','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','intersection','hasOwnProperty','nolimit','order','sort','pick','filter','User','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','addTeams','Team','online','voicePause','Agents','sequelize','transaction','forEach','userOpenchannelQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_openchannel_queues','join','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','compact','value','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelQueue.socket','status','json','offset','undefined','limit','count','set','update','then','destroy','get','OpenchannelQueues','end','sendStatus'];(function(_0x2e913b,_0x4b7071){var _0x173899=function(_0x2a7d22){while(--_0x2a7d22){_0x2e913b['push'](_0x2e913b['shift']());}};_0x173899(++_0x4b7071);}(_0x8c20,0x1b5));var _0x08c2=function(_0x44c25c,_0x4bf0a6){_0x44c25c=_0x44c25c-0x0;var _0x5aa80a=_0x8c20[_0x44c25c];return _0x5aa80a;};'use strict';var BPromise=require(_0x08c2('0x0'));var util=require(_0x08c2('0x1'));var _=require(_0x08c2('0x2'));var squel=require(_0x08c2('0x3'));var Redis=require(_0x08c2('0x4'));var qs=require(_0x08c2('0x5'));var logger=require(_0x08c2('0x6'))(_0x08c2('0x7'));var config=require(_0x08c2('0x8'));var db=require(_0x08c2('0x9'))['db'];config['redis']=_['defaults'](config[_0x08c2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x08c2('0xb'))(new Redis(config['redis']));require(_0x08c2('0xc'))['register'](socket);function respondWithStatusCode(_0x2b4a7e,_0x238306){_0x238306=_0x238306||0xcc;return function(_0x321aa2){if(_0x321aa2){return _0x2b4a7e['sendStatus'](_0x238306);}return _0x2b4a7e[_0x08c2('0xd')](_0x238306)['end']();};}function respondWithResult(_0x2c6b3d,_0xb5313b){_0xb5313b=_0xb5313b||0xc8;return function(_0x51a8db){if(_0x51a8db){return _0x2c6b3d[_0x08c2('0xd')](_0xb5313b)[_0x08c2('0xe')](_0x51a8db);}};}function respondWithFilteredResult(_0x3647a1,_0x5f3b3a){return function(_0x43d8d6){if(_0x43d8d6){var _0x36e000=typeof _0x5f3b3a[_0x08c2('0xf')]===_0x08c2('0x10')&&typeof _0x5f3b3a[_0x08c2('0x11')]==='undefined';var _0x592d2e=_0x43d8d6[_0x08c2('0x12')];var _0x3641de=_0x36e000?0x0:_0x5f3b3a['offset'];var _0x35c398=_0x36e000?_0x43d8d6['count']:_0x5f3b3a[_0x08c2('0xf')]+_0x5f3b3a['limit'];var _0x166c58;if(_0x35c398>=_0x592d2e){_0x35c398=_0x592d2e;_0x166c58=0xc8;}else{_0x166c58=0xce;}_0x3647a1[_0x08c2('0xd')](_0x166c58);return _0x3647a1[_0x08c2('0x13')]('Content-Range',_0x3641de+'-'+_0x35c398+'/'+_0x592d2e)[_0x08c2('0xe')](_0x43d8d6);}return null;};}function saveUpdates(_0x25d117){return function(_0x14cb2a){if(_0x14cb2a){return _0x14cb2a[_0x08c2('0x14')](_0x25d117)[_0x08c2('0x15')](function(_0x270c03){return _0x270c03;});}return null;};}function removeEntity(_0x30b051){return function(_0x5c61d8){if(_0x5c61d8){return _0x5c61d8[_0x08c2('0x16')]()[_0x08c2('0x15')](function(){var _0x52c329=_0x5c61d8[_0x08c2('0x17')]({'plain':!![]});var _0x2e5f0b=_0x08c2('0x18');return db['UserProfileResource'][_0x08c2('0x16')]({'where':{'type':_0x2e5f0b,'resourceId':_0x52c329['id']}})[_0x08c2('0x15')](function(){return _0x5c61d8;});})[_0x08c2('0x15')](function(){_0x30b051[_0x08c2('0xd')](0xcc)[_0x08c2('0x19')]();});}};}function handleEntityNotFound(_0x1eea4c){return function(_0xf46a69){if(!_0xf46a69){_0x1eea4c[_0x08c2('0x1a')](0x194);}return _0xf46a69;};}function handleError(_0x84c6c8,_0x2d5a45){_0x2d5a45=_0x2d5a45||0x1f4;return function(_0x13a452){logger[_0x08c2('0x1b')](_0x13a452[_0x08c2('0x1c')]);if(_0x13a452[_0x08c2('0x1d')]){delete _0x13a452[_0x08c2('0x1d')];}_0x84c6c8[_0x08c2('0xd')](_0x2d5a45)['send'](_0x13a452);};}exports[_0x08c2('0x1e')]=function(_0x1f0c8d,_0x38398e){var _0x38fbdb={};var _0x4ab5c7={'count':0x0,'rows':[]};var _0xc823c4=_[_0x08c2('0x1f')](db[_0x08c2('0x20')][_0x08c2('0x21')],function(_0x6ebb5d){return{'name':_0x6ebb5d[_0x08c2('0x22')],'type':_0x6ebb5d[_0x08c2('0x23')]['key']};});_0x38fbdb=qs[_0x08c2('0x24')](_0xc823c4,_0x1f0c8d);var _0x432eeb={'where':_0x38fbdb[_0x08c2('0x25')]};return db['OpenchannelQueue']['count'](_0x432eeb)[_0x08c2('0x15')](function(_0xd9d8c1){_0x4ab5c7['count']=_0xd9d8c1;_0x38fbdb[_0x08c2('0x26')]=qs[_0x08c2('0x26')](_0x1f0c8d['query']);return db[_0x08c2('0x20')][_0x08c2('0x27')](_0x38fbdb);})[_0x08c2('0x15')](function(_0xa362cc){_0x4ab5c7[_0x08c2('0x28')]=_0xa362cc;return _0x4ab5c7;})[_0x08c2('0x15')](respondWithFilteredResult(_0x38398e,_0x38fbdb))[_0x08c2('0x29')](handleError(_0x38398e,null));};exports[_0x08c2('0x2a')]=function(_0x42286e,_0xf52181){var _0x53f113={'raw':!![],'where':{'id':_0x42286e[_0x08c2('0x2b')]['id']}},_0x1a2aea={};_0x1a2aea[_0x08c2('0x2c')]=_[_0x08c2('0x2d')](db[_0x08c2('0x20')][_0x08c2('0x21')]);_0x1a2aea[_0x08c2('0x2e')]=_[_0x08c2('0x2d')](_0x42286e['query']);_0x1a2aea[_0x08c2('0x2f')]=_['intersection'](_0x1a2aea[_0x08c2('0x2c')],_0x1a2aea['query']);_0x53f113[_0x08c2('0x30')]=_['intersection'](_0x1a2aea[_0x08c2('0x2c')],qs[_0x08c2('0x31')](_0x42286e['query'][_0x08c2('0x31')]));_0x53f113['attributes']=_0x53f113['attributes'][_0x08c2('0x32')]?_0x53f113[_0x08c2('0x30')]:_0x1a2aea[_0x08c2('0x2c')];if(_0x42286e[_0x08c2('0x2e')]['includeAll']){_0x53f113[_0x08c2('0x26')]=[{'all':!![]}];}_0x53f113=_[_0x08c2('0x33')]({},_0x53f113,_0x42286e[_0x08c2('0x34')]);return db[_0x08c2('0x20')][_0x08c2('0x35')](_0x53f113)[_0x08c2('0x15')](handleEntityNotFound(_0xf52181,null))[_0x08c2('0x15')](respondWithResult(_0xf52181,null))[_0x08c2('0x29')](handleError(_0xf52181,null));};exports[_0x08c2('0x36')]=function(_0x176822,_0x1747f1){return db['OpenchannelQueue'][_0x08c2('0x36')](_0x176822[_0x08c2('0x37')],{})[_0x08c2('0x15')](function(_0x38e65a){var _0x35b336=_0x176822[_0x08c2('0x38')]['get']({'plain':!![]});if(!_0x35b336)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35b336[_0x08c2('0x39')]===_0x08c2('0x38')){var _0x2c8a0f=_0x38e65a[_0x08c2('0x17')]({'plain':!![]});var _0x410b7d=_0x08c2('0x18');return db[_0x08c2('0x3a')][_0x08c2('0x35')]({'where':{'name':_0x410b7d,'userProfileId':_0x35b336[_0x08c2('0x3b')]},'raw':!![]})[_0x08c2('0x15')](function(_0x2eb70f){if(_0x2eb70f&&_0x2eb70f['autoAssociation']===0x0){return db[_0x08c2('0x3c')]['create']({'name':_0x2c8a0f[_0x08c2('0x1d')],'resourceId':_0x2c8a0f['id'],'type':_0x2eb70f[_0x08c2('0x1d')],'sectionId':_0x2eb70f['id']},{})[_0x08c2('0x15')](function(){return _0x38e65a;});}else{return _0x38e65a;}})['catch'](function(_0x28d4b2){logger['error'](_0x08c2('0x3d'),_0x28d4b2);throw _0x28d4b2;});}return _0x38e65a;})[_0x08c2('0x15')](respondWithResult(_0x1747f1,0xc9))[_0x08c2('0x29')](handleError(_0x1747f1,null));};exports[_0x08c2('0x14')]=function(_0x1fa72d,_0x2a3992){if(_0x1fa72d[_0x08c2('0x37')]['id']){delete _0x1fa72d[_0x08c2('0x37')]['id'];}return db[_0x08c2('0x20')][_0x08c2('0x35')]({'where':{'id':_0x1fa72d[_0x08c2('0x2b')]['id']}})[_0x08c2('0x15')](handleEntityNotFound(_0x2a3992,null))[_0x08c2('0x15')](saveUpdates(_0x1fa72d['body'],null))[_0x08c2('0x15')](respondWithResult(_0x2a3992,null))['catch'](handleError(_0x2a3992,null));};exports[_0x08c2('0x16')]=function(_0x4bf987,_0x4402cf){return db['OpenchannelQueue'][_0x08c2('0x35')]({'where':{'id':_0x4bf987[_0x08c2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4402cf,null))[_0x08c2('0x15')](removeEntity(_0x4402cf,null))[_0x08c2('0x29')](handleError(_0x4402cf,null));};exports['describe']=function(_0x30125b,_0x1d4a2b){return db['OpenchannelQueue'][_0x08c2('0x3e')]()[_0x08c2('0x15')](respondWithResult(_0x1d4a2b,null))[_0x08c2('0x29')](handleError(_0x1d4a2b,null));};exports[_0x08c2('0x3f')]=function(_0x1e7270,_0x5c91ed){var _0x5daca9={'raw':!![],'where':{}},_0x3fdee3={},_0x4ae680;return db[_0x08c2('0x20')]['findOne']({'where':{'id':_0x1e7270[_0x08c2('0x2b')]['id']}})[_0x08c2('0x15')](handleEntityNotFound(_0x5c91ed,null))[_0x08c2('0x15')](function(_0x475467){if(_0x475467){_0x4ae680=_0x475467[_0x08c2('0x17')]({'plain':!![]});_0x3fdee3[_0x08c2('0x2c')]=_[_0x08c2('0x2d')](db[_0x08c2('0x40')][_0x08c2('0x21')]);_0x3fdee3['query']=_['keys'](_0x1e7270[_0x08c2('0x2e')]);_0x3fdee3[_0x08c2('0x2f')]=_[_0x08c2('0x41')](_0x3fdee3['model'],_0x3fdee3['query']);_0x5daca9[_0x08c2('0x30')]=_[_0x08c2('0x41')](_0x3fdee3[_0x08c2('0x2c')],qs[_0x08c2('0x31')](_0x1e7270[_0x08c2('0x2e')][_0x08c2('0x31')]));_0x5daca9[_0x08c2('0x30')]=_0x5daca9['attributes']['length']?_0x5daca9[_0x08c2('0x30')]:_0x3fdee3[_0x08c2('0x2c')];if(!_0x1e7270[_0x08c2('0x2e')][_0x08c2('0x42')](_0x08c2('0x43'))){_0x5daca9[_0x08c2('0x11')]=qs['limit'](_0x1e7270[_0x08c2('0x2e')][_0x08c2('0x11')]);_0x5daca9[_0x08c2('0xf')]=qs[_0x08c2('0xf')](_0x1e7270[_0x08c2('0x2e')]['offset']);}_0x5daca9[_0x08c2('0x44')]=qs['sort'](_0x1e7270[_0x08c2('0x2e')][_0x08c2('0x45')]);_0x5daca9[_0x08c2('0x25')]=qs[_0x08c2('0x2f')](_[_0x08c2('0x46')](_0x1e7270[_0x08c2('0x2e')],_0x3fdee3[_0x08c2('0x2f')]));_0x5daca9[_0x08c2('0x25')]['OpenchannelQueueId']=_0x475467['id'];if(_0x1e7270[_0x08c2('0x2e')][_0x08c2('0x47')]){_0x5daca9[_0x08c2('0x25')]=_[_0x08c2('0x33')](_0x5daca9['where'],{'$or':_[_0x08c2('0x1f')](_0x5daca9[_0x08c2('0x30')],function(_0x10c4be){var _0x505c78={};_0x505c78[_0x10c4be]={'$like':'%'+_0x1e7270[_0x08c2('0x2e')]['filter']+'%'};return _0x505c78;})});}_0x5daca9=_[_0x08c2('0x33')]({},_0x5daca9,_0x1e7270[_0x08c2('0x34')]);return db[_0x08c2('0x40')]['findAll'](_0x5daca9);}})['then'](function(_0x1b9675){if(_0x1b9675){return db[_0x08c2('0x48')]['findAndCountAll']({'where':{'id':_[_0x08c2('0x1f')](_0x1b9675,'UserId'),'role':_0x08c2('0x49')},'attributes':['id',_0x08c2('0x1d'),_0x08c2('0x4a'),_0x08c2('0x4b'),_0x08c2('0x4c')]});}})['then'](function(_0x57f4bf){if(_0x57f4bf){return{'count':_0x57f4bf['count'],'rows':_['map'](_0x57f4bf[_0x08c2('0x28')],function(_0x374775){return{'membername':_0x374775[_0x08c2('0x1d')],'UserId':_0x374775['id'],'queue_name':_0x4ae680['name'],'OpenchannelQueueId':_0x4ae680['id'],'interface':util[_0x08c2('0x4d')](_0x08c2('0x4e'),'SIP',_0x374775[_0x08c2('0x1d')]),'penalty':0x0,'paused':_0x374775['openchannelPause'],'createdAt':_0x374775[_0x08c2('0x4c')],'updatedAt':_0x374775[_0x08c2('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5c91ed,_0x5daca9))[_0x08c2('0x29')](handleError(_0x5c91ed,null));};exports[_0x08c2('0x4f')]=function(_0x425941,_0x51a1df){var _0x21d343={};var _0x8c3320={};var _0x57696c;var _0x3d7df1;return db['OpenchannelQueue'][_0x08c2('0x50')]({'where':{'id':_0x425941[_0x08c2('0x2b')]['id']}})[_0x08c2('0x15')](handleEntityNotFound(_0x51a1df,null))['then'](function(_0x3a9a3d){if(_0x3a9a3d){_0x57696c=_0x3a9a3d;_0x8c3320['model']=_['keys'](db['Team']['rawAttributes']);_0x8c3320[_0x08c2('0x2e')]=_[_0x08c2('0x2d')](_0x425941[_0x08c2('0x2e')]);_0x8c3320['filters']=_['intersection'](_0x8c3320[_0x08c2('0x2c')],_0x8c3320[_0x08c2('0x2e')]);_0x21d343['attributes']=_[_0x08c2('0x41')](_0x8c3320['model'],qs['fields'](_0x425941[_0x08c2('0x2e')][_0x08c2('0x31')]));_0x21d343['attributes']=_0x21d343[_0x08c2('0x30')][_0x08c2('0x32')]?_0x21d343[_0x08c2('0x30')]:_0x8c3320['model'];_0x21d343[_0x08c2('0x44')]=qs[_0x08c2('0x45')](_0x425941[_0x08c2('0x2e')][_0x08c2('0x45')]);_0x21d343['where']=qs['filters'](_[_0x08c2('0x46')](_0x425941[_0x08c2('0x2e')],_0x8c3320['filters']));if(_0x425941[_0x08c2('0x2e')]['filter']){_0x21d343[_0x08c2('0x25')]=_['merge'](_0x21d343[_0x08c2('0x25')],{'$or':_['map'](_0x21d343[_0x08c2('0x30')],function(_0x50d290){var _0x176cb4={};_0x176cb4[_0x50d290]={'$like':'%'+_0x425941[_0x08c2('0x2e')][_0x08c2('0x47')]+'%'};return _0x176cb4;})});}_0x21d343=_[_0x08c2('0x33')]({},_0x21d343,_0x425941[_0x08c2('0x34')]);return _0x57696c['getTeams'](_0x21d343);}})[_0x08c2('0x15')](function(_0x2df805){if(_0x2df805){_0x3d7df1=_0x2df805['length'];if(!_0x425941[_0x08c2('0x2e')][_0x08c2('0x42')](_0x08c2('0x43'))){_0x21d343[_0x08c2('0x11')]=qs[_0x08c2('0x11')](_0x425941[_0x08c2('0x2e')][_0x08c2('0x11')]);_0x21d343[_0x08c2('0xf')]=qs[_0x08c2('0xf')](_0x425941[_0x08c2('0x2e')][_0x08c2('0xf')]);}return _0x57696c[_0x08c2('0x4f')](_0x21d343);}})[_0x08c2('0x15')](function(_0x1a57e6){if(_0x1a57e6){return _0x1a57e6?{'count':_0x3d7df1,'rows':_0x1a57e6}:null;}})[_0x08c2('0x15')](respondWithResult(_0x51a1df,null))['catch'](handleError(_0x51a1df,null));};exports[_0x08c2('0x51')]=function(_0x5c6e27,_0x3e0f29){var _0x13a1cd=_0x5c6e27[_0x08c2('0x37')]['ids'];return db[_0x08c2('0x52')]['findAll']({'where':{'id':_0x13a1cd},'attributes':['id'],'include':[{'model':db[_0x08c2('0x48')],'as':'Agents','attributes':['id',_0x08c2('0x1d'),_0x08c2('0x53'),_0x08c2('0x54'),'interface'],'raw':!![]}]})[_0x08c2('0x15')](function(_0x540480){if(_0x540480){var _0x492c95=_['flatMap'](_0x540480,function(_0x570538){var _0x189fda=_0x570538[_0x08c2('0x17')]({'plain':!![]});return _0x189fda[_0x08c2('0x55')];});return db[_0x08c2('0x20')][_0x08c2('0x35')]({'where':{'id':_0x5c6e27['params']['id']}})[_0x08c2('0x15')](function(_0x6970f3){return db[_0x08c2('0x56')][_0x08c2('0x57')](function(_0x311773){return _0x6970f3['addTeams'](_0x13a1cd,{'transaction':_0x311773})[_0x08c2('0x15')](function(){return BPromise['each'](_0x492c95,function(_0x4327d6){return db[_0x08c2('0x40')]['findOrCreate']({'where':{'UserId':_0x4327d6['id'],'OpenchannelQueueId':_0x5c6e27[_0x08c2('0x2b')]['id']},'transaction':_0x311773});});})[_0x08c2('0x15')](function(){_0x492c95[_0x08c2('0x58')](function(_0x5abe2b){socket['emit'](_0x08c2('0x59'),{'UserId':_0x5abe2b['id'],'OpenchannelQueueId':_0x6970f3['id']});});});});});}})[_0x08c2('0x15')](respondWithStatusCode(_0x3e0f29,null))[_0x08c2('0x29')](handleError(_0x3e0f29,null));};exports[_0x08c2('0x5a')]=function(_0x58dca3,_0x22c645){return db[_0x08c2('0x52')][_0x08c2('0x27')]({'where':{'id':_0x58dca3[_0x08c2('0x2e')][_0x08c2('0x5b')]},'attributes':['id'],'include':[{'model':db[_0x08c2('0x48')],'as':_0x08c2('0x55'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x22c645,null))[_0x08c2('0x15')](function(_0x216bf6){var _0xbe41a8=_[_0x08c2('0x1f')](_0x216bf6,'id');var _0x66dd7d=[];var _0x568cb6=[];var _0x788e6f=squel['select']();_0x788e6f[_0x08c2('0x5c')](_0x08c2('0x5d'))[_0x08c2('0x5e')](_0x08c2('0x5f'),'tq')[_0x08c2('0x60')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x08c2('0x61'),_0x58dca3[_0x08c2('0x2b')]['id']);for(var _0x1a8e90=0x0;_0x1a8e90<_0x216bf6[_0x08c2('0x32')];_0x1a8e90+=0x1){let _0x51b3d1=_0x216bf6[_0x1a8e90];for(var _0x212ad0=0x0;_0x212ad0<_0x51b3d1['Agents'][_0x08c2('0x32')];_0x212ad0+=0x1){let _0x1f158c=_0x51b3d1[_0x08c2('0x55')][_0x212ad0];var _0x1b7551=_0x788e6f[_0x08c2('0x62')]();_0x1b7551[_0x08c2('0x25')](_0x08c2('0x63'),_0x1f158c['id']);_0x568cb6[_0x08c2('0x64')](db['sequelize'][_0x08c2('0x2e')](_0x1b7551['toString'](),{'type':db[_0x08c2('0x56')][_0x08c2('0x65')][_0x08c2('0x66')]})[_0x08c2('0x15')](function(_0x14fc82){if(_0x14fc82[_0x08c2('0x32')]===0x1){return _0x1f158c['id'];}else{var _0x137db8=_[_0x08c2('0x67')](_['map'](_0x14fc82,_0x08c2('0x68')),function(_0xa116d9){return _['includes'](_0xbe41a8,_0xa116d9);});if(_0x137db8){return _0x1f158c['id'];}}}));}}return BPromise[_0x08c2('0x69')](_0x568cb6)[_0x08c2('0x15')](function(_0x39087f){_0x66dd7d=_(_0x66dd7d)['union'](_0x39087f)[_0x08c2('0x6a')]()[_0x08c2('0x6b')]();return db[_0x08c2('0x20')][_0x08c2('0x35')]({'where':{'id':_0x58dca3[_0x08c2('0x2b')]['id']}})[_0x08c2('0x15')](function(_0xb9124){return db['sequelize'][_0x08c2('0x57')](function(_0x11b3d8){return _0xb9124[_0x08c2('0x5a')](_0x58dca3[_0x08c2('0x2e')]['ids'],{'transaction':_0x11b3d8})['then'](function(){if(!_['isEmpty'](_0x66dd7d)){return _0xb9124[_0x08c2('0x6c')](_0x66dd7d,{'transaction':_0x11b3d8});}})[_0x08c2('0x15')](function(){_0x66dd7d['forEach'](function(_0x47a023){socket[_0x08c2('0x6d')](_0x08c2('0x6e'),{'UserId':_0x47a023,'OpenchannelQueueId':_0xb9124['id']});});});});});});})['then'](respondWithStatusCode(_0x22c645,null))[_0x08c2('0x29')](handleError(_0x22c645,null));};exports['addAgents']=function(_0x3a06dc,_0x488341){return db[_0x08c2('0x20')][_0x08c2('0x35')]({'where':{'id':_0x3a06dc['params']['id']}})['then'](handleEntityNotFound(_0x488341,null))['then'](function(_0x5d72f1){if(_0x5d72f1){return _0x5d72f1[_0x08c2('0x6f')](_0x3a06dc[_0x08c2('0x37')]['ids'],_[_0x08c2('0x70')](_0x3a06dc['body'],['ids','id'])||{})[_0x08c2('0x71')](function(_0x17705b){for(var _0x1c9076=0x0;_0x1c9076<_0x3a06dc['body']['ids']['length'];_0x1c9076+=0x1){socket[_0x08c2('0x6d')](_0x08c2('0x59'),{'UserId':Number(_0x3a06dc[_0x08c2('0x37')]['ids'][_0x1c9076]),'OpenchannelQueueId':Number(_0x3a06dc[_0x08c2('0x2b')]['id'])});}return _0x17705b;});}})['then'](respondWithResult(_0x488341,null))[_0x08c2('0x29')](handleError(_0x488341,null));};exports[_0x08c2('0x6c')]=function(_0xb11e0a,_0x113980){return db[_0x08c2('0x20')][_0x08c2('0x35')]({'where':{'id':_0xb11e0a[_0x08c2('0x2b')]['id']}})[_0x08c2('0x15')](handleEntityNotFound(_0x113980,null))[_0x08c2('0x15')](function(_0x763142){if(_0x763142){return _0x763142[_0x08c2('0x6c')](_0xb11e0a['query']['ids'])[_0x08c2('0x15')](function(){if(_[_0x08c2('0x72')](_0xb11e0a['query'][_0x08c2('0x5b')])){for(var _0xbdbe71=0x0;_0xbdbe71<_0xb11e0a[_0x08c2('0x2e')][_0x08c2('0x5b')][_0x08c2('0x32')];_0xbdbe71+=0x1){socket[_0x08c2('0x6d')](_0x08c2('0x6e'),{'UserId':Number(_0xb11e0a[_0x08c2('0x2e')]['ids'][_0xbdbe71]),'OpenchannelQueueId':Number(_0xb11e0a['params']['id'])});}}else{socket['emit'](_0x08c2('0x6e'),{'UserId':Number(_0xb11e0a[_0x08c2('0x2e')]['ids']),'OpenchannelQueueId':Number(_0xb11e0a['params']['id'])});}});}})[_0x08c2('0x15')](respondWithStatusCode(_0x113980,null))[_0x08c2('0x29')](handleError(_0x113980,null));};exports[_0x08c2('0x73')]=function(_0x55395b,_0x4eaf95){var _0x3a983a={};var _0x2a3f33={};var _0xb3c928;var _0x3041f5;return db[_0x08c2('0x20')][_0x08c2('0x50')]({'where':{'id':_0x55395b[_0x08c2('0x2b')]['id']}})[_0x08c2('0x15')](handleEntityNotFound(_0x4eaf95,null))[_0x08c2('0x15')](function(_0x23ec04){if(_0x23ec04){_0xb3c928=_0x23ec04;_0x2a3f33[_0x08c2('0x2c')]=_[_0x08c2('0x2d')](db['User'][_0x08c2('0x21')]);_0x2a3f33['query']=_[_0x08c2('0x2d')](_0x55395b['query']);_0x2a3f33[_0x08c2('0x2f')]=_[_0x08c2('0x41')](_0x2a3f33['model'],_0x2a3f33[_0x08c2('0x2e')]);_0x3a983a['attributes']=_['intersection'](_0x2a3f33[_0x08c2('0x2c')],qs[_0x08c2('0x31')](_0x55395b['query'][_0x08c2('0x31')]));_0x3a983a[_0x08c2('0x30')]=_0x3a983a[_0x08c2('0x30')]['length']?_0x3a983a[_0x08c2('0x30')]:_0x2a3f33[_0x08c2('0x2c')];_0x3a983a['order']=qs[_0x08c2('0x45')](_0x55395b[_0x08c2('0x2e')]['sort']);_0x3a983a[_0x08c2('0x25')]=qs[_0x08c2('0x2f')](_[_0x08c2('0x46')](_0x55395b[_0x08c2('0x2e')],_0x2a3f33[_0x08c2('0x2f')]));if(_0x55395b[_0x08c2('0x2e')]['filter']){_0x3a983a['where']=_[_0x08c2('0x33')](_0x3a983a['where'],{'$or':_[_0x08c2('0x1f')](_0x3a983a[_0x08c2('0x30')],function(_0x5a87e7){var _0x104e07={};_0x104e07[_0x5a87e7]={'$like':'%'+_0x55395b['query']['filter']+'%'};return _0x104e07;})});}_0x3a983a=_[_0x08c2('0x33')]({},_0x3a983a,_0x55395b[_0x08c2('0x34')]);return _0xb3c928[_0x08c2('0x73')](_0x3a983a);}})[_0x08c2('0x15')](function(_0x59b08e){if(_0x59b08e){_0x3041f5=_0x59b08e[_0x08c2('0x32')];if(!_0x55395b[_0x08c2('0x2e')][_0x08c2('0x42')](_0x08c2('0x43'))){_0x3a983a[_0x08c2('0x11')]=qs[_0x08c2('0x11')](_0x55395b[_0x08c2('0x2e')][_0x08c2('0x11')]);_0x3a983a[_0x08c2('0xf')]=qs[_0x08c2('0xf')](_0x55395b['query']['offset']);}return _0xb3c928[_0x08c2('0x73')](_0x3a983a);}})[_0x08c2('0x15')](function(_0x3b9d50){if(_0x3b9d50){return _0x3b9d50?{'count':_0x3041f5,'rows':_0x3b9d50}:null;}})[_0x08c2('0x15')](respondWithResult(_0x4eaf95,null))[_0x08c2('0x29')](handleError(_0x4eaf95,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 420400b..0d9bc3d 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 _0xbd7d=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x108131,_0x3a27b2){var _0x468a53=function(_0x314256){while(--_0x314256){_0x108131['push'](_0x108131['shift']());}};_0x468a53(++_0x3a27b2);}(_0xbd7d,0x182));var _0xdbd7=function(_0x4014f5,_0x47a61f){_0x4014f5=_0x4014f5-0x0;var _0x583959=_0xbd7d[_0x4014f5];return _0x583959;};'use strict';var EventEmitter=require(_0xdbd7('0x0'));var OpenchannelQueue=require(_0xdbd7('0x1'))['db'][_0xdbd7('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xdbd7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdbd7('0x4'),'afterDestroy':_0xdbd7('0x5')};function emitEvent(_0x3a6cf7){return function(_0x1130f0,_0x1c8fae,_0x24bce7){OpenchannelQueueEvents[_0xdbd7('0x6')](_0x3a6cf7+':'+_0x1130f0['id'],_0x1130f0);OpenchannelQueueEvents['emit'](_0x3a6cf7,_0x1130f0);_0x24bce7(null);};}for(var e in events){if(events[_0xdbd7('0x7')](e)){var event=events[e];OpenchannelQueue[_0xdbd7('0x8')](e,emitEvent(event));}}module[_0xdbd7('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x4d09=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','remove','emit'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4d09,0x71));var _0x94d0=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x4d09[_0x2f1762];return _0x8ab21;};'use strict';var EventEmitter=require(_0x94d0('0x0'));var OpenchannelQueue=require(_0x94d0('0x1'))['db'][_0x94d0('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x94d0('0x3')](0x0);var events={'afterCreate':_0x94d0('0x4'),'afterUpdate':'update','afterDestroy':_0x94d0('0x5')};function emitEvent(_0x3e9a39){return function(_0xab7ce2,_0x5a3b15,_0x54523e){OpenchannelQueueEvents[_0x94d0('0x6')](_0x3e9a39+':'+_0xab7ce2['id'],_0xab7ce2);OpenchannelQueueEvents['emit'](_0x3e9a39,_0xab7ce2);_0x54523e(null);};}for(var e in events){if(events[_0x94d0('0x7')](e)){var event=events[e];OpenchannelQueue[_0x94d0('0x8')](e,emitEvent(event));}}module[_0x94d0('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index ee30c62..1e3f7cb 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 _0xbd31=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','lodash'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xbd31,0xba));var _0x1bd3=function(_0x2dfca5,_0x4b9215){_0x2dfca5=_0x2dfca5-0x0;var _0x359508=_0xbd31[_0x2dfca5];return _0x359508;};'use strict';var _=require(_0x1bd3('0x0'));var util=require(_0x1bd3('0x1'));var logger=require(_0x1bd3('0x2'))('api');var moment=require(_0x1bd3('0x3'));var BPromise=require(_0x1bd3('0x4'));var rp=require(_0x1bd3('0x5'));var fs=require('fs');var path=require(_0x1bd3('0x6'));var rimraf=require('rimraf');var config=require(_0x1bd3('0x7'));var attributes=require(_0x1bd3('0x8'));module['exports']=function(_0x1761fb,_0x4aea3c){return _0x1761fb[_0x1bd3('0x9')](_0x1bd3('0xa'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1188=['moment','request-promise','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api'];(function(_0x46176d,_0xcc39dd){var _0x5ae370=function(_0x5375da){while(--_0x5375da){_0x46176d['push'](_0x46176d['shift']());}};_0x5ae370(++_0xcc39dd);}(_0x1188,0x1d0));var _0x8118=function(_0x1a1b42,_0x387374){_0x1a1b42=_0x1a1b42-0x0;var _0x3e9d30=_0x1188[_0x1a1b42];return _0x3e9d30;};'use strict';var _=require(_0x8118('0x0'));var util=require(_0x8118('0x1'));var logger=require(_0x8118('0x2'))(_0x8118('0x3'));var moment=require(_0x8118('0x4'));var BPromise=require('bluebird');var rp=require(_0x8118('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8118('0x6'));var config=require('../../config/environment');var attributes=require(_0x8118('0x7'));module[_0x8118('0x8')]=function(_0x51b5a3,_0x2a56d0){return _0x51b5a3[_0x8118('0x9')](_0x8118('0xa'),attributes,{'tableName':_0x8118('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 762241b..d6e3574 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 _0x7777=['raw','where','limit','include','map','model','attributes','stringify','ShowOpenchannelQueue','OpenchannelQueue','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetOpenchannelQueue','options'];(function(_0x1f2f0d,_0x2ed845){var _0x43a1ed=function(_0x3e5384){while(--_0x3e5384){_0x1f2f0d['push'](_0x1f2f0d['shift']());}};_0x43a1ed(++_0x2ed845);}(_0x7777,0x1a5));var _0x7777=function(_0x53b304,_0x1efbab){_0x53b304=_0x53b304-0x0;var _0x471654=_0x7777[_0x53b304];return _0x471654;};'use strict';var _=require(_0x7777('0x0'));var util=require(_0x7777('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7777('0x2'));var fs=require('fs');var Redis=require(_0x7777('0x3'));var db=require(_0x7777('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7777('0x5'))(_0x7777('0x6'));var config=require(_0x7777('0x7'));var jayson=require(_0x7777('0x8'));var client=jayson[_0x7777('0x9')][_0x7777('0xa')]({'port':0x232a});config[_0x7777('0xb')]=_[_0x7777('0xc')](config[_0x7777('0xb')],{'host':_0x7777('0xd'),'port':0x18eb});var socket=require(_0x7777('0xe'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x7777('0xf')](socket);function respondWithRpcPromise(_0x3b830c,_0x919694,_0x2acf8f){return new BPromise(function(_0x47c34f,_0x1bc527){return client[_0x7777('0x10')](_0x3b830c,_0x2acf8f)[_0x7777('0x11')](function(_0x45ac2c){logger[_0x7777('0x12')](_0x7777('0x13'),_0x919694,_0x7777('0x14'));logger[_0x7777('0x15')](_0x7777('0x16'),_0x919694,_0x7777('0x14'),JSON['stringify'](_0x45ac2c));if(_0x45ac2c[_0x7777('0x17')]){if(_0x45ac2c[_0x7777('0x17')][_0x7777('0x18')]===0x1f4){logger[_0x7777('0x17')](_0x7777('0x13'),_0x919694,_0x45ac2c[_0x7777('0x17')]['message']);return _0x1bc527(_0x45ac2c['error'][_0x7777('0x19')]);}logger[_0x7777('0x17')](_0x7777('0x13'),_0x919694,_0x45ac2c[_0x7777('0x17')]['message']);return _0x47c34f(_0x45ac2c[_0x7777('0x17')]['message']);}else{logger[_0x7777('0x12')](_0x7777('0x13'),_0x919694,_0x7777('0x14'));_0x47c34f(_0x45ac2c[_0x7777('0x1a')][_0x7777('0x19')]);}})[_0x7777('0x1b')](function(_0x3667ff){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x919694,_0x3667ff);_0x1bc527(_0x3667ff);});});}exports[_0x7777('0x1c')]=function(_0x10ca1e){var _0x24ff4c=this;return new Promise(function(_0x1dbe87,_0x1cac98){return db['OpenchannelQueue']['findAll']({'raw':_0x10ca1e[_0x7777('0x1d')]?_0x10ca1e[_0x7777('0x1d')][_0x7777('0x1e')]===undefined?!![]:![]:!![],'where':_0x10ca1e[_0x7777('0x1d')]?_0x10ca1e[_0x7777('0x1d')][_0x7777('0x1f')]||null:null,'attributes':_0x10ca1e['options']?_0x10ca1e['options']['attributes']||null:null,'limit':_0x10ca1e['options']?_0x10ca1e[_0x7777('0x1d')][_0x7777('0x20')]||null:null,'include':_0x10ca1e[_0x7777('0x1d')]?_0x10ca1e[_0x7777('0x1d')][_0x7777('0x21')]?_[_0x7777('0x22')](_0x10ca1e[_0x7777('0x1d')][_0x7777('0x21')],function(_0x4abb7e){return{'model':db[_0x4abb7e[_0x7777('0x23')]],'as':_0x4abb7e['as'],'attributes':_0x4abb7e[_0x7777('0x24')],'include':_0x4abb7e[_0x7777('0x21')]?_[_0x7777('0x22')](_0x4abb7e['include'],function(_0x547264){return{'model':db[_0x547264[_0x7777('0x23')]],'as':_0x547264['as'],'attributes':_0x547264[_0x7777('0x24')],'include':_0x547264['include']?_[_0x7777('0x22')](_0x547264['include'],function(_0x598866){return{'model':db[_0x598866['model']],'as':_0x598866['as'],'attributes':_0x598866[_0x7777('0x24')]};}):[]};}):[]};}):[]:[]})[_0x7777('0x11')](function(_0x5663cd){logger[_0x7777('0x12')](_0x7777('0x1c'),_0x10ca1e);logger[_0x7777('0x15')](_0x7777('0x1c'),_0x10ca1e,JSON[_0x7777('0x25')](_0x5663cd));_0x1dbe87(_0x5663cd);})[_0x7777('0x1b')](function(_0x22e44b){logger[_0x7777('0x17')](_0x7777('0x1c'),_0x22e44b['message'],_0x10ca1e);_0x1cac98(_0x24ff4c[_0x7777('0x17')](0x1f4,_0x22e44b[_0x7777('0x19')]));});});};exports[_0x7777('0x26')]=function(_0x304bdd){var _0x4b343f=this;return new Promise(function(_0x1ea7e7,_0x3a4325){return db[_0x7777('0x27')][_0x7777('0x28')]({'raw':_0x304bdd[_0x7777('0x1d')]?_0x304bdd['options'][_0x7777('0x1e')]===undefined?!![]:![]:!![],'where':_0x304bdd[_0x7777('0x1d')]?_0x304bdd[_0x7777('0x1d')][_0x7777('0x1f')]||null:null,'attributes':_0x304bdd[_0x7777('0x1d')]?_0x304bdd[_0x7777('0x1d')][_0x7777('0x24')]||null:null,'include':_0x304bdd[_0x7777('0x1d')]?_0x304bdd[_0x7777('0x1d')]['include']?_[_0x7777('0x22')](_0x304bdd[_0x7777('0x1d')][_0x7777('0x21')],function(_0x428f12){return{'model':db[_0x428f12['model']],'as':_0x428f12['as'],'attributes':_0x428f12[_0x7777('0x24')],'include':_0x428f12[_0x7777('0x21')]?_[_0x7777('0x22')](_0x428f12[_0x7777('0x21')],function(_0x88c160){return{'model':db[_0x88c160[_0x7777('0x23')]],'as':_0x88c160['as'],'attributes':_0x88c160[_0x7777('0x24')],'include':_0x88c160['include']?_[_0x7777('0x22')](_0x88c160[_0x7777('0x21')],function(_0x36abcc){return{'model':db[_0x36abcc[_0x7777('0x23')]],'as':_0x36abcc['as'],'attributes':_0x36abcc['attributes']};}):[]};}):[]};}):[]:[]})[_0x7777('0x11')](function(_0x1d4d07){logger[_0x7777('0x12')]('ShowOpenchannelQueue',_0x304bdd);logger[_0x7777('0x15')]('ShowOpenchannelQueue',_0x304bdd,JSON[_0x7777('0x25')](_0x1d4d07));_0x1ea7e7(_0x1d4d07);})['catch'](function(_0x5b6c3e){logger[_0x7777('0x17')](_0x7777('0x26'),_0x5b6c3e[_0x7777('0x19')],_0x304bdd);_0x3a4325(_0x4b343f['error'](0x1f4,_0x5b6c3e[_0x7777('0x19')]));});});}; \ No newline at end of file +var _0x2e81=['OpenchannelQueue','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','redis','localhost','socket.io-emitter','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetOpenchannelQueue','findAll','options','where','attributes','include','model','map','ShowOpenchannelQueue'];(function(_0x49d2ce,_0x566c3e){var _0x49578a=function(_0x2a7a1b){while(--_0x2a7a1b){_0x49d2ce['push'](_0x49d2ce['shift']());}};_0x49578a(++_0x566c3e);}(_0x2e81,0x1a6));var _0x12e8=function(_0xcd49bd,_0x2a12a3){_0xcd49bd=_0xcd49bd-0x0;var _0xb6ee44=_0x2e81[_0xcd49bd];return _0xb6ee44;};'use strict';var _=require('lodash');var util=require(_0x12e8('0x0'));var moment=require(_0x12e8('0x1'));var BPromise=require(_0x12e8('0x2'));var rs=require(_0x12e8('0x3'));var fs=require('fs');var Redis=require(_0x12e8('0x4'));var db=require(_0x12e8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x12e8('0x6'))('rpc');var config=require(_0x12e8('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x12e8('0x8')]({'port':0x232a});config[_0x12e8('0x9')]=_['defaults'](config[_0x12e8('0x9')],{'host':_0x12e8('0xa'),'port':0x18eb});var socket=require(_0x12e8('0xb'))(new Redis(config[_0x12e8('0x9')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x544952,_0x2d1cd0,_0x232208){return new BPromise(function(_0xe2c3a1,_0x56b898){return client[_0x12e8('0xc')](_0x544952,_0x232208)[_0x12e8('0xd')](function(_0xcce1b7){logger[_0x12e8('0xe')](_0x12e8('0xf'),_0x2d1cd0,'request\x20sent');logger[_0x12e8('0x10')](_0x12e8('0x11'),_0x2d1cd0,_0x12e8('0x12'),JSON[_0x12e8('0x13')](_0xcce1b7));if(_0xcce1b7[_0x12e8('0x14')]){if(_0xcce1b7[_0x12e8('0x14')][_0x12e8('0x15')]===0x1f4){logger[_0x12e8('0x14')](_0x12e8('0xf'),_0x2d1cd0,_0xcce1b7[_0x12e8('0x14')][_0x12e8('0x16')]);return _0x56b898(_0xcce1b7[_0x12e8('0x14')]['message']);}logger[_0x12e8('0x14')](_0x12e8('0xf'),_0x2d1cd0,_0xcce1b7[_0x12e8('0x14')][_0x12e8('0x16')]);return _0xe2c3a1(_0xcce1b7[_0x12e8('0x14')][_0x12e8('0x16')]);}else{logger[_0x12e8('0xe')](_0x12e8('0xf'),_0x2d1cd0,_0x12e8('0x12'));_0xe2c3a1(_0xcce1b7['result'][_0x12e8('0x16')]);}})[_0x12e8('0x17')](function(_0x6d9c7b){logger[_0x12e8('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x2d1cd0,_0x6d9c7b);_0x56b898(_0x6d9c7b);});});}exports[_0x12e8('0x18')]=function(_0x5cef33){var _0x47362f=this;return new Promise(function(_0x304936,_0x48625c){return db['OpenchannelQueue'][_0x12e8('0x19')]({'raw':_0x5cef33[_0x12e8('0x1a')]?_0x5cef33[_0x12e8('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5cef33[_0x12e8('0x1a')]?_0x5cef33['options'][_0x12e8('0x1b')]||null:null,'attributes':_0x5cef33[_0x12e8('0x1a')]?_0x5cef33[_0x12e8('0x1a')][_0x12e8('0x1c')]||null:null,'limit':_0x5cef33['options']?_0x5cef33[_0x12e8('0x1a')]['limit']||null:null,'include':_0x5cef33[_0x12e8('0x1a')]?_0x5cef33['options']['include']?_['map'](_0x5cef33[_0x12e8('0x1a')][_0x12e8('0x1d')],function(_0x6d961a){return{'model':db[_0x6d961a[_0x12e8('0x1e')]],'as':_0x6d961a['as'],'attributes':_0x6d961a[_0x12e8('0x1c')],'include':_0x6d961a[_0x12e8('0x1d')]?_[_0x12e8('0x1f')](_0x6d961a['include'],function(_0x5c53cd){return{'model':db[_0x5c53cd[_0x12e8('0x1e')]],'as':_0x5c53cd['as'],'attributes':_0x5c53cd[_0x12e8('0x1c')],'include':_0x5c53cd[_0x12e8('0x1d')]?_[_0x12e8('0x1f')](_0x5c53cd[_0x12e8('0x1d')],function(_0x5423a8){return{'model':db[_0x5423a8['model']],'as':_0x5423a8['as'],'attributes':_0x5423a8[_0x12e8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x12e8('0xd')](function(_0x5d9d0b){logger[_0x12e8('0xe')](_0x12e8('0x18'),_0x5cef33);logger[_0x12e8('0x10')](_0x12e8('0x18'),_0x5cef33,JSON[_0x12e8('0x13')](_0x5d9d0b));_0x304936(_0x5d9d0b);})[_0x12e8('0x17')](function(_0x479aac){logger[_0x12e8('0x14')]('GetOpenchannelQueue',_0x479aac[_0x12e8('0x16')],_0x5cef33);_0x48625c(_0x47362f['error'](0x1f4,_0x479aac[_0x12e8('0x16')]));});});};exports[_0x12e8('0x20')]=function(_0x3dffd0){var _0x3d4f8c=this;return new Promise(function(_0x163b36,_0x47ad61){return db[_0x12e8('0x21')]['find']({'raw':_0x3dffd0['options']?_0x3dffd0['options'][_0x12e8('0x22')]===undefined?!![]:![]:!![],'where':_0x3dffd0[_0x12e8('0x1a')]?_0x3dffd0[_0x12e8('0x1a')]['where']||null:null,'attributes':_0x3dffd0[_0x12e8('0x1a')]?_0x3dffd0[_0x12e8('0x1a')]['attributes']||null:null,'include':_0x3dffd0[_0x12e8('0x1a')]?_0x3dffd0[_0x12e8('0x1a')][_0x12e8('0x1d')]?_[_0x12e8('0x1f')](_0x3dffd0[_0x12e8('0x1a')]['include'],function(_0x8ab932){return{'model':db[_0x8ab932[_0x12e8('0x1e')]],'as':_0x8ab932['as'],'attributes':_0x8ab932['attributes'],'include':_0x8ab932[_0x12e8('0x1d')]?_[_0x12e8('0x1f')](_0x8ab932['include'],function(_0x587548){return{'model':db[_0x587548[_0x12e8('0x1e')]],'as':_0x587548['as'],'attributes':_0x587548[_0x12e8('0x1c')],'include':_0x587548['include']?_[_0x12e8('0x1f')](_0x587548[_0x12e8('0x1d')],function(_0x3609d9){return{'model':db[_0x3609d9[_0x12e8('0x1e')]],'as':_0x3609d9['as'],'attributes':_0x3609d9[_0x12e8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x12e8('0xd')](function(_0x1c1ec6){logger[_0x12e8('0xe')](_0x12e8('0x20'),_0x3dffd0);logger[_0x12e8('0x10')]('ShowOpenchannelQueue',_0x3dffd0,JSON[_0x12e8('0x13')](_0x1c1ec6));_0x163b36(_0x1c1ec6);})[_0x12e8('0x17')](function(_0x2c057f){logger[_0x12e8('0x14')]('ShowOpenchannelQueue',_0x2c057f[_0x12e8('0x16')],_0x3dffd0);_0x47ad61(_0x3d4f8c[_0x12e8('0x14')](0x1f4,_0x2c057f[_0x12e8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index c3f6dd4..70cfe6c 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 _0x3d66=['save','remove','update','emit','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x300ba7,_0x4858e3){var _0x3f7bc1=function(_0x4e594d){while(--_0x4e594d){_0x300ba7['push'](_0x300ba7['shift']());}};_0x3f7bc1(++_0x4858e3);}(_0x3d66,0xbc));var _0x63d6=function(_0x11266d,_0x4df991){_0x11266d=_0x11266d-0x0;var _0x10d7a1=_0x3d66[_0x11266d];return _0x10d7a1;};'use strict';var OpenchannelQueueEvents=require(_0x63d6('0x0'));var events=[_0x63d6('0x1'),_0x63d6('0x2'),_0x63d6('0x3')];function createListener(_0x13f6ea,_0xb9a1db){return function(_0x599c54){_0xb9a1db[_0x63d6('0x4')](_0x13f6ea,_0x599c54);};}function removeListener(_0x29c353,_0x2c387b){return function(){OpenchannelQueueEvents['removeListener'](_0x29c353,_0x2c387b);};}exports['register']=function(_0x705a3){for(var _0x2885ca=0x0,_0x3950cf=events[_0x63d6('0x5')];_0x2885ca<_0x3950cf;_0x2885ca++){var _0xc49e4c=events[_0x2885ca];var _0x5c8a21=createListener(_0x63d6('0x6')+_0xc49e4c,_0x705a3);OpenchannelQueueEvents['on'](_0xc49e4c,_0x5c8a21);}}; \ No newline at end of file +var _0x174e=['emit','removeListener','length','./openchannelQueue.events','update'];(function(_0x4fdd28,_0xa33304){var _0x117f46=function(_0x956254){while(--_0x956254){_0x4fdd28['push'](_0x4fdd28['shift']());}};_0x117f46(++_0xa33304);}(_0x174e,0x11b));var _0xe174=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x174e[_0x57b54c];return _0x59cc19;};'use strict';var OpenchannelQueueEvents=require(_0xe174('0x0'));var events=['save','remove',_0xe174('0x1')];function createListener(_0x564d1a,_0x10e7ff){return function(_0x201ca0){_0x10e7ff[_0xe174('0x2')](_0x564d1a,_0x201ca0);};}function removeListener(_0x1d1a98,_0x14aa56){return function(){OpenchannelQueueEvents[_0xe174('0x3')](_0x1d1a98,_0x14aa56);};}exports['register']=function(_0x11b268){for(var _0x382315=0x0,_0x250eb6=events[_0xe174('0x4')];_0x382315<_0x250eb6;_0x382315++){var _0xaad1af=events[_0x382315];var _0x464c0c=createListener('openchannelQueue:'+_0xaad1af,_0x11b268);OpenchannelQueueEvents['on'](_0xaad1af,_0x464c0c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 60301eb..f8193f5 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 _0xdd10=['create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','/describe','describe','get','show','post'];(function(_0x4a232f,_0x77550d){var _0x47a1da=function(_0x7a4f4c){while(--_0x7a4f4c){_0x4a232f['push'](_0x4a232f['shift']());}};_0x47a1da(++_0x77550d);}(_0xdd10,0x7e));var _0x0dd1=function(_0x4cc8e9,_0xe5f38){_0x4cc8e9=_0x4cc8e9-0x0;var _0x3ef9c9=_0xdd10[_0x4cc8e9];return _0x3ef9c9;};'use strict';var multer=require(_0x0dd1('0x0'));var util=require(_0x0dd1('0x1'));var path=require(_0x0dd1('0x2'));var timeout=require(_0x0dd1('0x3'));var express=require(_0x0dd1('0x4'));var router=express[_0x0dd1('0x5')]();var fs_extra=require(_0x0dd1('0x6'));var auth=require(_0x0dd1('0x7'));var interaction=require(_0x0dd1('0x8'));var config=require(_0x0dd1('0x9'));var controller=require(_0x0dd1('0xa'));router['get']('/',auth[_0x0dd1('0xb')](),controller[_0x0dd1('0xc')]);router['get'](_0x0dd1('0xd'),auth[_0x0dd1('0xb')](),controller[_0x0dd1('0xe')]);router[_0x0dd1('0xf')]('/:id',auth[_0x0dd1('0xb')](),controller[_0x0dd1('0x10')]);router[_0x0dd1('0x11')]('/',auth[_0x0dd1('0xb')](),controller[_0x0dd1('0x12')]);router[_0x0dd1('0x13')](_0x0dd1('0x14'),auth[_0x0dd1('0xb')](),controller[_0x0dd1('0x15')]);router[_0x0dd1('0x16')](_0x0dd1('0x14'),auth[_0x0dd1('0xb')](),controller[_0x0dd1('0x17')]);module['exports']=router; \ No newline at end of file +var _0x74a0=['../../components/auth/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','post','put','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x598e6e,_0x377753){var _0xbd8641=function(_0x34be46){while(--_0x34be46){_0x598e6e['push'](_0x598e6e['shift']());}};_0xbd8641(++_0x377753);}(_0x74a0,0x6c));var _0x074a=function(_0x5d1386,_0x10ab65){_0x5d1386=_0x5d1386-0x0;var _0x226456=_0x74a0[_0x5d1386];return _0x226456;};'use strict';var multer=require(_0x074a('0x0'));var util=require(_0x074a('0x1'));var path=require(_0x074a('0x2'));var timeout=require(_0x074a('0x3'));var express=require(_0x074a('0x4'));var router=express[_0x074a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x074a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x074a('0x7'));var controller=require('./openchannelQueueReport.controller');router[_0x074a('0x8')]('/',auth['isAuthenticated'](),controller[_0x074a('0x9')]);router[_0x074a('0x8')](_0x074a('0xa'),auth['isAuthenticated'](),controller[_0x074a('0xb')]);router[_0x074a('0x8')](_0x074a('0xc'),auth[_0x074a('0xd')](),controller[_0x074a('0xe')]);router[_0x074a('0xf')]('/',auth[_0x074a('0xd')](),controller['create']);router[_0x074a('0x10')](_0x074a('0xc'),auth[_0x074a('0xd')](),controller['update']);router[_0x074a('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x074a('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 5431539..3f87b3b 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 _0x7fc4=['exports','STRING','DATE','moment','sequelize'];(function(_0xdbe3cf,_0x47c702){var _0x1d07ef=function(_0x1de6fd){while(--_0x1de6fd){_0xdbe3cf['push'](_0xdbe3cf['shift']());}};_0x1d07ef(++_0x47c702);}(_0x7fc4,0x8f));var _0x47fc=function(_0x2ade21,_0x3f833e){_0x2ade21=_0x2ade21-0x0;var _0x1d8b7d=_0x7fc4[_0x2ade21];return _0x1d8b7d;};'use strict';var moment=require(_0x47fc('0x0'));var Sequelize=require(_0x47fc('0x1'));module[_0x47fc('0x2')]={'uniqueid':{'type':Sequelize[_0x47fc('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47fc('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x47fc('0x4')]},'exitAt':{'type':Sequelize[_0x47fc('0x4')]},'reason':{'type':Sequelize[_0x47fc('0x3')]}}; \ No newline at end of file +var _0x399c=['sequelize','exports','STRING','DATE','moment'];(function(_0xbdf03f,_0x595215){var _0x2bbe9e=function(_0x59fbd4){while(--_0x59fbd4){_0xbdf03f['push'](_0xbdf03f['shift']());}};_0x2bbe9e(++_0x595215);}(_0x399c,0x10d));var _0xc399=function(_0x593c9c,_0x1c0a44){_0x593c9c=_0x593c9c-0x0;var _0x57b059=_0x399c[_0x593c9c];return _0x57b059;};'use strict';var moment=require(_0xc399('0x0'));var Sequelize=require(_0xc399('0x1'));module[_0xc399('0x2')]={'uniqueid':{'type':Sequelize[_0xc399('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc399('0x3')]},'joinAt':{'type':Sequelize[_0xc399('0x4')]},'leaveAt':{'type':Sequelize[_0xc399('0x4')]},'acceptAt':{'type':Sequelize[_0xc399('0x4')]},'exitAt':{'type':Sequelize[_0xc399('0x4')]},'reason':{'type':Sequelize[_0xc399('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 5d89b41..5250b3c 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 _0xddd9=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','undefined','count','offset','limit','status','set','json','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','destroy','describe','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis'];(function(_0x1bee83,_0x1d69c5){var _0x2c9186=function(_0x10272e){while(--_0x10272e){_0x1bee83['push'](_0x1bee83['shift']());}};_0x2c9186(++_0x1d69c5);}(_0xddd9,0x119));var _0x9ddd=function(_0x40e47a,_0x35e408){_0x40e47a=_0x40e47a-0x0;var _0x3374cb=_0xddd9[_0x40e47a];return _0x3374cb;};'use strict';var emlformat=require(_0x9ddd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9ddd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ddd('0x2'));var moment=require('moment');var BPromise=require(_0x9ddd('0x3'));var Mustache=require(_0x9ddd('0x4'));var util=require('util');var path=require(_0x9ddd('0x5'));var sox=require(_0x9ddd('0x6'));var csv=require(_0x9ddd('0x7'));var ejs=require(_0x9ddd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9ddd('0x9'));var squel=require(_0x9ddd('0xa'));var crypto=require(_0x9ddd('0xb'));var jsforce=require(_0x9ddd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9ddd('0x7'));var querystring=require('querystring');var Papa=require(_0x9ddd('0xd'));var Redis=require(_0x9ddd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9ddd('0xf'));var as=require(_0x9ddd('0x10'));var hardwareService=require(_0x9ddd('0x11'));var logger=require(_0x9ddd('0x12'))(_0x9ddd('0x13'));var utils=require(_0x9ddd('0x14'));var config=require(_0x9ddd('0x15'));var licenseUtil=require(_0x9ddd('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fdf32,_0x500a22){_0x500a22=_0x500a22||0xcc;return function(_0x5dcbd6){if(_0x5dcbd6){return _0x1fdf32['sendStatus'](_0x500a22);}return _0x1fdf32['status'](_0x500a22)[_0x9ddd('0x17')]();};}function respondWithResult(_0x414423,_0x9f9907){_0x9f9907=_0x9f9907||0xc8;return function(_0x5185de){if(_0x5185de){return _0x414423['status'](_0x9f9907)['json'](_0x5185de);}};}function respondWithFilteredResult(_0x4591c8,_0x23a01d){return function(_0x47f87d){if(_0x47f87d){var _0x32fa1d=typeof _0x23a01d['offset']===_0x9ddd('0x18')&&typeof _0x23a01d['limit']===_0x9ddd('0x18');var _0x4529a5=_0x47f87d[_0x9ddd('0x19')];var _0x40a2ce=_0x32fa1d?0x0:_0x23a01d[_0x9ddd('0x1a')];var _0x13a7bc=_0x32fa1d?_0x47f87d[_0x9ddd('0x19')]:_0x23a01d[_0x9ddd('0x1a')]+_0x23a01d[_0x9ddd('0x1b')];var _0x3951c8;if(_0x13a7bc>=_0x4529a5){_0x13a7bc=_0x4529a5;_0x3951c8=0xc8;}else{_0x3951c8=0xce;}_0x4591c8[_0x9ddd('0x1c')](_0x3951c8);return _0x4591c8[_0x9ddd('0x1d')]('Content-Range',_0x40a2ce+'-'+_0x13a7bc+'/'+_0x4529a5)[_0x9ddd('0x1e')](_0x47f87d);}return null;};}function patchUpdates(_0x1f15ed){return function(_0x1b5614){try{jsonpatch[_0x9ddd('0x1f')](_0x1b5614,_0x1f15ed,!![]);}catch(_0x583b41){return BPromise[_0x9ddd('0x20')](_0x583b41);}return _0x1b5614['save']();};}function saveUpdates(_0x25a188,_0x1b936e){return function(_0x4ed9c7){if(_0x4ed9c7){return _0x4ed9c7[_0x9ddd('0x21')](_0x25a188)[_0x9ddd('0x22')](function(_0x40f110){return _0x40f110;});}return null;};}function removeEntity(_0x125bfd,_0x251d17){return function(_0x94219b){if(_0x94219b){return _0x94219b['destroy']()[_0x9ddd('0x22')](function(){_0x125bfd[_0x9ddd('0x1c')](0xcc)[_0x9ddd('0x17')]();});}};}function handleEntityNotFound(_0x2043b9,_0x369f4d){return function(_0x41704c){if(!_0x41704c){_0x2043b9[_0x9ddd('0x23')](0x194);}return _0x41704c;};}function handleError(_0x3c124a,_0x2ee39a){_0x2ee39a=_0x2ee39a||0x1f4;return function(_0x12bfe7){logger[_0x9ddd('0x24')](_0x12bfe7[_0x9ddd('0x25')]);if(_0x12bfe7['name']){delete _0x12bfe7[_0x9ddd('0x26')];}_0x3c124a['status'](_0x2ee39a)[_0x9ddd('0x27')](_0x12bfe7);};}exports[_0x9ddd('0x28')]=function(_0x3379b1,_0x1bb420){var _0xb48211={},_0x40a2e2={},_0x5334f7={'count':0x0,'rows':[]};var _0x4282ed=_[_0x9ddd('0x29')](db[_0x9ddd('0x2a')][_0x9ddd('0x2b')],function(_0x4395af){return{'name':_0x4395af['fieldName'],'type':_0x4395af[_0x9ddd('0x2c')]['key']};});_0x40a2e2[_0x9ddd('0x2d')]=_[_0x9ddd('0x29')](_0x4282ed,_0x9ddd('0x26'));_0x40a2e2[_0x9ddd('0x2e')]=_[_0x9ddd('0x2f')](_0x3379b1[_0x9ddd('0x2e')]);_0x40a2e2['filters']=_[_0x9ddd('0x30')](_0x40a2e2['model'],_0x40a2e2[_0x9ddd('0x2e')]);_0xb48211[_0x9ddd('0x31')]=_['intersection'](_0x40a2e2[_0x9ddd('0x2d')],qs[_0x9ddd('0x32')](_0x3379b1[_0x9ddd('0x2e')]['fields']));_0xb48211[_0x9ddd('0x31')]=_0xb48211[_0x9ddd('0x31')][_0x9ddd('0x33')]?_0xb48211[_0x9ddd('0x31')]:_0x40a2e2['model'];if(!_0x3379b1[_0x9ddd('0x2e')][_0x9ddd('0x34')](_0x9ddd('0x35'))){_0xb48211['limit']=qs['limit'](_0x3379b1['query'][_0x9ddd('0x1b')]);_0xb48211[_0x9ddd('0x1a')]=qs[_0x9ddd('0x1a')](_0x3379b1[_0x9ddd('0x2e')][_0x9ddd('0x1a')]);}_0xb48211[_0x9ddd('0x36')]=qs[_0x9ddd('0x37')](_0x3379b1[_0x9ddd('0x2e')][_0x9ddd('0x37')]);_0xb48211[_0x9ddd('0x38')]=qs[_0x9ddd('0x39')](_[_0x9ddd('0x3a')](_0x3379b1[_0x9ddd('0x2e')],_0x40a2e2['filters']),_0x4282ed);if(_0x3379b1[_0x9ddd('0x2e')][_0x9ddd('0x3b')]){_0xb48211[_0x9ddd('0x38')]=_['merge'](_0xb48211[_0x9ddd('0x38')],{'$or':_[_0x9ddd('0x29')](_0x4282ed,function(_0x525a4f){if(_0x525a4f['type']!==_0x9ddd('0x3c')){var _0x374200={};_0x374200[_0x525a4f[_0x9ddd('0x26')]]={'$like':'%'+_0x3379b1[_0x9ddd('0x2e')][_0x9ddd('0x3b')]+'%'};return _0x374200;}})});}_0xb48211=_[_0x9ddd('0x3d')]({},_0xb48211,_0x3379b1['options']);var _0x26fe49={'where':_0xb48211[_0x9ddd('0x38')]};return db[_0x9ddd('0x2a')]['count'](_0x26fe49)[_0x9ddd('0x22')](function(_0x15f30a){_0x5334f7[_0x9ddd('0x19')]=_0x15f30a;if(_0x3379b1['query'][_0x9ddd('0x3e')]){_0xb48211[_0x9ddd('0x3f')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x9ddd('0x40')](_0xb48211);})[_0x9ddd('0x22')](function(_0x7d76df){_0x5334f7['rows']=_0x7d76df;return _0x5334f7;})[_0x9ddd('0x22')](respondWithFilteredResult(_0x1bb420,_0xb48211))[_0x9ddd('0x41')](handleError(_0x1bb420,null));};exports[_0x9ddd('0x42')]=function(_0x4de346,_0x22d37b){var _0x3bde97={'raw':!![],'where':{'id':_0x4de346['params']['id']}},_0x4e0fc0={};_0x4e0fc0[_0x9ddd('0x2d')]=_[_0x9ddd('0x2f')](db[_0x9ddd('0x2a')][_0x9ddd('0x2b')]);_0x4e0fc0[_0x9ddd('0x2e')]=_[_0x9ddd('0x2f')](_0x4de346[_0x9ddd('0x2e')]);_0x4e0fc0[_0x9ddd('0x39')]=_[_0x9ddd('0x30')](_0x4e0fc0[_0x9ddd('0x2d')],_0x4e0fc0['query']);_0x3bde97[_0x9ddd('0x31')]=_['intersection'](_0x4e0fc0['model'],qs[_0x9ddd('0x32')](_0x4de346[_0x9ddd('0x2e')][_0x9ddd('0x32')]));_0x3bde97[_0x9ddd('0x31')]=_0x3bde97[_0x9ddd('0x31')][_0x9ddd('0x33')]?_0x3bde97[_0x9ddd('0x31')]:_0x4e0fc0['model'];if(_0x4de346[_0x9ddd('0x2e')][_0x9ddd('0x3e')]){_0x3bde97[_0x9ddd('0x3f')]=[{'all':!![]}];}_0x3bde97=_[_0x9ddd('0x3d')]({},_0x3bde97,_0x4de346[_0x9ddd('0x43')]);return db[_0x9ddd('0x2a')][_0x9ddd('0x44')](_0x3bde97)[_0x9ddd('0x22')](handleEntityNotFound(_0x22d37b,null))[_0x9ddd('0x22')](respondWithResult(_0x22d37b,null))[_0x9ddd('0x41')](handleError(_0x22d37b,null));};exports['create']=function(_0x5dbbb5,_0x1e4e89){return db['OpenchannelQueueReport'][_0x9ddd('0x45')](_0x5dbbb5[_0x9ddd('0x46')],{})['then'](respondWithResult(_0x1e4e89,0xc9))[_0x9ddd('0x41')](handleError(_0x1e4e89,null));};exports[_0x9ddd('0x21')]=function(_0x32747e,_0xac8ce7){if(_0x32747e['body']['id']){delete _0x32747e[_0x9ddd('0x46')]['id'];}return db[_0x9ddd('0x2a')][_0x9ddd('0x44')]({'where':{'id':_0x32747e[_0x9ddd('0x47')]['id']}})[_0x9ddd('0x22')](handleEntityNotFound(_0xac8ce7,null))[_0x9ddd('0x22')](saveUpdates(_0x32747e['body'],null))['then'](respondWithResult(_0xac8ce7,null))[_0x9ddd('0x41')](handleError(_0xac8ce7,null));};exports[_0x9ddd('0x48')]=function(_0x4a05ed,_0x484cd1){return db[_0x9ddd('0x2a')][_0x9ddd('0x44')]({'where':{'id':_0x4a05ed[_0x9ddd('0x47')]['id']}})['then'](handleEntityNotFound(_0x484cd1,null))['then'](removeEntity(_0x484cd1,null))[_0x9ddd('0x41')](handleError(_0x484cd1,null));};exports[_0x9ddd('0x49')]=function(_0x40a0e7,_0x2a37b9){return db[_0x9ddd('0x2a')][_0x9ddd('0x49')]()[_0x9ddd('0x22')](respondWithResult(_0x2a37b9,null))[_0x9ddd('0x41')](handleError(_0x2a37b9,null));}; \ No newline at end of file +var _0xf7eb=['OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','update','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','reject','save','then','error','stack','name','index'];(function(_0x5ce181,_0x4daf32){var _0x4b3c8f=function(_0x242af0){while(--_0x242af0){_0x5ce181['push'](_0x5ce181['shift']());}};_0x4b3c8f(++_0x4daf32);}(_0xf7eb,0xb4));var _0xbf7e=function(_0x598185,_0x2bdc4a){_0x598185=_0x598185-0x0;var _0x29a1c3=_0xf7eb[_0x598185];return _0x29a1c3;};'use strict';var emlformat=require(_0xbf7e('0x0'));var rimraf=require(_0xbf7e('0x1'));var zipdir=require(_0xbf7e('0x2'));var jsonpatch=require(_0xbf7e('0x3'));var rp=require(_0xbf7e('0x4'));var moment=require('moment');var BPromise=require(_0xbf7e('0x5'));var Mustache=require(_0xbf7e('0x6'));var util=require(_0xbf7e('0x7'));var path=require(_0xbf7e('0x8'));var sox=require(_0xbf7e('0x9'));var csv=require('to-csv');var ejs=require(_0xbf7e('0xa'));var fs=require('fs');var fs_extra=require(_0xbf7e('0xb'));var _=require(_0xbf7e('0xc'));var squel=require(_0xbf7e('0xd'));var crypto=require('crypto');var jsforce=require(_0xbf7e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbf7e('0xf'));var querystring=require('querystring');var Papa=require(_0xbf7e('0x10'));var Redis=require(_0xbf7e('0x11'));var authService=require(_0xbf7e('0x12'));var qs=require(_0xbf7e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf7e('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xbf7e('0x15'));var licenseUtil=require(_0xbf7e('0x16'));var db=require(_0xbf7e('0x17'))['db'];function respondWithStatusCode(_0x237fa0,_0x2d352c){_0x2d352c=_0x2d352c||0xcc;return function(_0x42f0e1){if(_0x42f0e1){return _0x237fa0[_0xbf7e('0x18')](_0x2d352c);}return _0x237fa0[_0xbf7e('0x19')](_0x2d352c)[_0xbf7e('0x1a')]();};}function respondWithResult(_0x4fdeb,_0x23a17c){_0x23a17c=_0x23a17c||0xc8;return function(_0x3d451b){if(_0x3d451b){return _0x4fdeb[_0xbf7e('0x19')](_0x23a17c)[_0xbf7e('0x1b')](_0x3d451b);}};}function respondWithFilteredResult(_0x21dd7c,_0x37116b){return function(_0x105ca1){if(_0x105ca1){var _0x215665=typeof _0x37116b[_0xbf7e('0x1c')]==='undefined'&&typeof _0x37116b[_0xbf7e('0x1d')]==='undefined';var _0x23af31=_0x105ca1[_0xbf7e('0x1e')];var _0x53e6e5=_0x215665?0x0:_0x37116b[_0xbf7e('0x1c')];var _0x43efa9=_0x215665?_0x105ca1[_0xbf7e('0x1e')]:_0x37116b[_0xbf7e('0x1c')]+_0x37116b['limit'];var _0x2c0eed;if(_0x43efa9>=_0x23af31){_0x43efa9=_0x23af31;_0x2c0eed=0xc8;}else{_0x2c0eed=0xce;}_0x21dd7c['status'](_0x2c0eed);return _0x21dd7c[_0xbf7e('0x1f')]('Content-Range',_0x53e6e5+'-'+_0x43efa9+'/'+_0x23af31)[_0xbf7e('0x1b')](_0x105ca1);}return null;};}function patchUpdates(_0x106419){return function(_0x940095){try{jsonpatch['apply'](_0x940095,_0x106419,!![]);}catch(_0x30f06a){return BPromise[_0xbf7e('0x20')](_0x30f06a);}return _0x940095[_0xbf7e('0x21')]();};}function saveUpdates(_0x489cb3,_0x1d8875){return function(_0x19888e){if(_0x19888e){return _0x19888e['update'](_0x489cb3)[_0xbf7e('0x22')](function(_0x6b92ba){return _0x6b92ba;});}return null;};}function removeEntity(_0x21027c,_0x97cade){return function(_0xd5feb9){if(_0xd5feb9){return _0xd5feb9['destroy']()['then'](function(){_0x21027c['status'](0xcc)[_0xbf7e('0x1a')]();});}};}function handleEntityNotFound(_0x8581b7,_0x56438e){return function(_0x5d97e7){if(!_0x5d97e7){_0x8581b7[_0xbf7e('0x18')](0x194);}return _0x5d97e7;};}function handleError(_0x17ef58,_0x13f05a){_0x13f05a=_0x13f05a||0x1f4;return function(_0x3d776c){logger[_0xbf7e('0x23')](_0x3d776c[_0xbf7e('0x24')]);if(_0x3d776c['name']){delete _0x3d776c[_0xbf7e('0x25')];}_0x17ef58[_0xbf7e('0x19')](_0x13f05a)['send'](_0x3d776c);};}exports[_0xbf7e('0x26')]=function(_0x21264b,_0x3a755a){var _0x3c5dd6={},_0x51ad8c={},_0x222214={'count':0x0,'rows':[]};var _0x35e7ca=_['map'](db[_0xbf7e('0x27')][_0xbf7e('0x28')],function(_0x158880){return{'name':_0x158880[_0xbf7e('0x29')],'type':_0x158880[_0xbf7e('0x2a')][_0xbf7e('0x2b')]};});_0x51ad8c[_0xbf7e('0x2c')]=_[_0xbf7e('0x2d')](_0x35e7ca,_0xbf7e('0x25'));_0x51ad8c[_0xbf7e('0x2e')]=_[_0xbf7e('0x2f')](_0x21264b[_0xbf7e('0x2e')]);_0x51ad8c[_0xbf7e('0x30')]=_[_0xbf7e('0x31')](_0x51ad8c['model'],_0x51ad8c[_0xbf7e('0x2e')]);_0x3c5dd6[_0xbf7e('0x32')]=_[_0xbf7e('0x31')](_0x51ad8c[_0xbf7e('0x2c')],qs[_0xbf7e('0x33')](_0x21264b[_0xbf7e('0x2e')][_0xbf7e('0x33')]));_0x3c5dd6[_0xbf7e('0x32')]=_0x3c5dd6['attributes'][_0xbf7e('0x34')]?_0x3c5dd6['attributes']:_0x51ad8c[_0xbf7e('0x2c')];if(!_0x21264b['query']['hasOwnProperty'](_0xbf7e('0x35'))){_0x3c5dd6['limit']=qs[_0xbf7e('0x1d')](_0x21264b[_0xbf7e('0x2e')][_0xbf7e('0x1d')]);_0x3c5dd6[_0xbf7e('0x1c')]=qs[_0xbf7e('0x1c')](_0x21264b[_0xbf7e('0x2e')][_0xbf7e('0x1c')]);}_0x3c5dd6['order']=qs[_0xbf7e('0x36')](_0x21264b[_0xbf7e('0x2e')]['sort']);_0x3c5dd6[_0xbf7e('0x37')]=qs[_0xbf7e('0x30')](_[_0xbf7e('0x38')](_0x21264b[_0xbf7e('0x2e')],_0x51ad8c[_0xbf7e('0x30')]),_0x35e7ca);if(_0x21264b['query'][_0xbf7e('0x39')]){_0x3c5dd6[_0xbf7e('0x37')]=_[_0xbf7e('0x3a')](_0x3c5dd6['where'],{'$or':_[_0xbf7e('0x2d')](_0x35e7ca,function(_0x4414a0){if(_0x4414a0[_0xbf7e('0x2a')]!==_0xbf7e('0x3b')){var _0x5a2110={};_0x5a2110[_0x4414a0[_0xbf7e('0x25')]]={'$like':'%'+_0x21264b[_0xbf7e('0x2e')]['filter']+'%'};return _0x5a2110;}})});}_0x3c5dd6=_['merge']({},_0x3c5dd6,_0x21264b[_0xbf7e('0x3c')]);var _0x377a17={'where':_0x3c5dd6['where']};return db['OpenchannelQueueReport'][_0xbf7e('0x1e')](_0x377a17)[_0xbf7e('0x22')](function(_0x95e4e9){_0x222214['count']=_0x95e4e9;if(_0x21264b[_0xbf7e('0x2e')][_0xbf7e('0x3d')]){_0x3c5dd6[_0xbf7e('0x3e')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xbf7e('0x3f')](_0x3c5dd6);})[_0xbf7e('0x22')](function(_0x45a9e4){_0x222214['rows']=_0x45a9e4;return _0x222214;})[_0xbf7e('0x22')](respondWithFilteredResult(_0x3a755a,_0x3c5dd6))[_0xbf7e('0x40')](handleError(_0x3a755a,null));};exports[_0xbf7e('0x41')]=function(_0x24f6c2,_0x151125){var _0x513aee={'raw':!![],'where':{'id':_0x24f6c2[_0xbf7e('0x42')]['id']}},_0x1f1be1={};_0x1f1be1['model']=_['keys'](db[_0xbf7e('0x27')][_0xbf7e('0x28')]);_0x1f1be1['query']=_['keys'](_0x24f6c2[_0xbf7e('0x2e')]);_0x1f1be1['filters']=_[_0xbf7e('0x31')](_0x1f1be1['model'],_0x1f1be1[_0xbf7e('0x2e')]);_0x513aee[_0xbf7e('0x32')]=_[_0xbf7e('0x31')](_0x1f1be1[_0xbf7e('0x2c')],qs[_0xbf7e('0x33')](_0x24f6c2[_0xbf7e('0x2e')][_0xbf7e('0x33')]));_0x513aee[_0xbf7e('0x32')]=_0x513aee['attributes'][_0xbf7e('0x34')]?_0x513aee[_0xbf7e('0x32')]:_0x1f1be1['model'];if(_0x24f6c2['query']['includeAll']){_0x513aee[_0xbf7e('0x3e')]=[{'all':!![]}];}_0x513aee=_['merge']({},_0x513aee,_0x24f6c2[_0xbf7e('0x3c')]);return db['OpenchannelQueueReport']['find'](_0x513aee)[_0xbf7e('0x22')](handleEntityNotFound(_0x151125,null))[_0xbf7e('0x22')](respondWithResult(_0x151125,null))[_0xbf7e('0x40')](handleError(_0x151125,null));};exports[_0xbf7e('0x43')]=function(_0x17c21a,_0x4af9bf){return db[_0xbf7e('0x27')][_0xbf7e('0x43')](_0x17c21a[_0xbf7e('0x44')],{})['then'](respondWithResult(_0x4af9bf,0xc9))[_0xbf7e('0x40')](handleError(_0x4af9bf,null));};exports[_0xbf7e('0x45')]=function(_0x3b5479,_0x346759){if(_0x3b5479[_0xbf7e('0x44')]['id']){delete _0x3b5479[_0xbf7e('0x44')]['id'];}return db['OpenchannelQueueReport'][_0xbf7e('0x46')]({'where':{'id':_0x3b5479['params']['id']}})[_0xbf7e('0x22')](handleEntityNotFound(_0x346759,null))[_0xbf7e('0x22')](saveUpdates(_0x3b5479[_0xbf7e('0x44')],null))['then'](respondWithResult(_0x346759,null))[_0xbf7e('0x40')](handleError(_0x346759,null));};exports[_0xbf7e('0x47')]=function(_0x95e631,_0x3a58f7){return db[_0xbf7e('0x27')][_0xbf7e('0x46')]({'where':{'id':_0x95e631['params']['id']}})['then'](handleEntityNotFound(_0x3a58f7,null))['then'](removeEntity(_0x3a58f7,null))[_0xbf7e('0x40')](handleError(_0x3a58f7,null));};exports['describe']=function(_0x89e27,_0x5ef13){return db[_0xbf7e('0x27')][_0xbf7e('0x48')]()[_0xbf7e('0x22')](respondWithResult(_0x5ef13,null))[_0xbf7e('0x40')](handleError(_0x5ef13,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 135b9cd..ecfb992 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(_0xf07789,_0xa98320){var _0x4630b2=function(_0x2b41c0){while(--_0x2b41c0){_0xf07789['push'](_0xf07789['shift']());}};_0x4630b2(++_0xa98320);}(_0x326f,0xd1));var _0xf326=function(_0x5feaf5,_0x174169){_0x5feaf5=_0x5feaf5-0x0;var _0xd3f79e=_0x326f[_0x5feaf5];return _0xd3f79e;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x3e7b4d,_0x52be0c){var _0x3c46f6=function(_0x2112d6){while(--_0x2112d6){_0x3e7b4d['push'](_0x3e7b4d['shift']());}};_0x3c46f6(++_0x52be0c);}(_0x7a54,0x106));var _0x47a5=function(_0x1d288f,_0x395760){_0x1d288f=_0x1d288f-0x0;var _0x506a15=_0x7a54[_0x1d288f];return _0x506a15;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index f1b5259..67a8c84 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 _0x02a7=['raw','UpdateOpenchannelQueueReport','OpenchannelQueueReport','where','attributes','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','create','body','options'];(function(_0x3e6b2f,_0x1ffa07){var _0x323215=function(_0x5c4d82){while(--_0x5c4d82){_0x3e6b2f['push'](_0x3e6b2f['shift']());}};_0x323215(++_0x1ffa07);}(_0x02a7,0x1a6));var _0x702a=function(_0x40b8d4,_0x79c1f){_0x40b8d4=_0x40b8d4-0x0;var _0x1c989c=_0x02a7[_0x40b8d4];return _0x1c989c;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var moment=require(_0x702a('0x1'));var BPromise=require(_0x702a('0x2'));var rs=require(_0x702a('0x3'));var fs=require('fs');var Redis=require(_0x702a('0x4'));var db=require(_0x702a('0x5'))['db'];var utils=require(_0x702a('0x6'));var logger=require(_0x702a('0x7'))(_0x702a('0x8'));var config=require(_0x702a('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x702a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b6736,_0x27bfc7,_0x3f5ff8){return new BPromise(function(_0x51bf52,_0x562fdb){return client['request'](_0x4b6736,_0x3f5ff8)['then'](function(_0x3cb569){logger[_0x702a('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x27bfc7,_0x702a('0xc'));logger[_0x702a('0xd')](_0x702a('0xe'),_0x27bfc7,_0x702a('0xc'),JSON[_0x702a('0xf')](_0x3cb569));if(_0x3cb569[_0x702a('0x10')]){if(_0x3cb569[_0x702a('0x10')][_0x702a('0x11')]===0x1f4){logger['error'](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x562fdb(_0x3cb569[_0x702a('0x10')]['message']);}logger[_0x702a('0x10')](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x51bf52(_0x3cb569[_0x702a('0x10')]['message']);}else{logger[_0x702a('0xb')](_0x702a('0x12'),_0x27bfc7,_0x702a('0xc'));_0x51bf52(_0x3cb569[_0x702a('0x14')][_0x702a('0x13')]);}})[_0x702a('0x15')](function(_0x451881){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x27bfc7,_0x451881);_0x562fdb(_0x451881);});});}exports[_0x702a('0x16')]=function(_0x340dc2){var _0x2071ad=this;return new Promise(function(_0x3d1550,_0x1885eb){return db['OpenchannelQueueReport'][_0x702a('0x17')](_0x340dc2[_0x702a('0x18')],{'raw':_0x340dc2[_0x702a('0x19')]?_0x340dc2[_0x702a('0x19')][_0x702a('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5b2998){logger['info'](_0x702a('0x16'),_0x340dc2);logger['debug'](_0x702a('0x16'),_0x340dc2,JSON[_0x702a('0xf')](_0x5b2998));_0x3d1550(_0x5b2998);})['catch'](function(_0x2ca064){logger[_0x702a('0x10')](_0x702a('0x16'),_0x2ca064[_0x702a('0x13')],_0x340dc2);_0x1885eb(_0x2071ad[_0x702a('0x10')](0x1f4,_0x2ca064['message']));});});};exports[_0x702a('0x1b')]=function(_0x544be5){var _0x5e6cce=this;return new Promise(function(_0x57d897,_0xa2be1d){return db[_0x702a('0x1c')]['update'](_0x544be5[_0x702a('0x18')],{'raw':_0x544be5[_0x702a('0x19')]?_0x544be5[_0x702a('0x19')][_0x702a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x544be5[_0x702a('0x19')]?_0x544be5[_0x702a('0x19')][_0x702a('0x1d')]||null:null,'attributes':_0x544be5[_0x702a('0x19')]?_0x544be5[_0x702a('0x19')][_0x702a('0x1e')]||null:null,'limit':_0x544be5['options']?_0x544be5[_0x702a('0x19')]['limit']||null:null})[_0x702a('0x1f')](function(_0x51867d){logger[_0x702a('0xb')](_0x702a('0x1b'),_0x544be5);logger[_0x702a('0xd')]('UpdateOpenchannelQueueReport',_0x544be5,JSON[_0x702a('0xf')](_0x51867d));_0x57d897(_0x51867d);})[_0x702a('0x15')](function(_0x26e1d1){logger['error'](_0x702a('0x1b'),_0x26e1d1['message'],_0x544be5);_0xa2be1d(_0x5e6cce[_0x702a('0x10')](0x1f4,_0x26e1d1[_0x702a('0x13')]));});});}; \ No newline at end of file +var _0x4fad=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','update','attributes','limit','then','UpdateOpenchannelQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x31b137,_0xa54c07){var _0x35a4f8=function(_0x28e248){while(--_0x28e248){_0x31b137['push'](_0x31b137['shift']());}};_0x35a4f8(++_0xa54c07);}(_0x4fad,0xcb));var _0xd4fa=function(_0x1175cd,_0x4b609f){_0x1175cd=_0x1175cd-0x0;var _0x25d478=_0x4fad[_0x1175cd];return _0x25d478;};'use strict';var _=require(_0xd4fa('0x0'));var util=require(_0xd4fa('0x1'));var moment=require(_0xd4fa('0x2'));var BPromise=require('bluebird');var rs=require(_0xd4fa('0x3'));var fs=require('fs');var Redis=require(_0xd4fa('0x4'));var db=require(_0xd4fa('0x5'))['db'];var utils=require(_0xd4fa('0x6'));var logger=require(_0xd4fa('0x7'))(_0xd4fa('0x8'));var config=require(_0xd4fa('0x9'));var jayson=require(_0xd4fa('0xa'));var client=jayson['client'][_0xd4fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52b426,_0x2b9f6a,_0x19a910){return new BPromise(function(_0x155c09,_0x3fff99){return client[_0xd4fa('0xc')](_0x52b426,_0x19a910)['then'](function(_0x26a894){logger[_0xd4fa('0xd')](_0xd4fa('0xe'),_0x2b9f6a,'request\x20sent');logger[_0xd4fa('0xf')](_0xd4fa('0x10'),_0x2b9f6a,_0xd4fa('0x11'),JSON[_0xd4fa('0x12')](_0x26a894));if(_0x26a894['error']){if(_0x26a894[_0xd4fa('0x13')][_0xd4fa('0x14')]===0x1f4){logger[_0xd4fa('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2b9f6a,_0x26a894[_0xd4fa('0x13')][_0xd4fa('0x15')]);return _0x3fff99(_0x26a894[_0xd4fa('0x13')][_0xd4fa('0x15')]);}logger[_0xd4fa('0x13')](_0xd4fa('0xe'),_0x2b9f6a,_0x26a894['error'][_0xd4fa('0x15')]);return _0x155c09(_0x26a894[_0xd4fa('0x13')][_0xd4fa('0x15')]);}else{logger[_0xd4fa('0xd')](_0xd4fa('0xe'),_0x2b9f6a,_0xd4fa('0x11'));_0x155c09(_0x26a894[_0xd4fa('0x16')]['message']);}})[_0xd4fa('0x17')](function(_0x3a3b8c){logger[_0xd4fa('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2b9f6a,_0x3a3b8c);_0x3fff99(_0x3a3b8c);});});}exports['CreateOpenchannelQueueReport']=function(_0x1faa0b){var _0x5601d6=this;return new Promise(function(_0x5df190,_0x1f9be1){return db[_0xd4fa('0x18')][_0xd4fa('0x19')](_0x1faa0b[_0xd4fa('0x1a')],{'raw':_0x1faa0b['options']?_0x1faa0b[_0xd4fa('0x1b')][_0xd4fa('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0xbf7dcf){logger['info']('CreateOpenchannelQueueReport',_0x1faa0b);logger[_0xd4fa('0xf')](_0xd4fa('0x1d'),_0x1faa0b,JSON[_0xd4fa('0x12')](_0xbf7dcf));_0x5df190(_0xbf7dcf);})[_0xd4fa('0x17')](function(_0x586af0){logger[_0xd4fa('0x13')](_0xd4fa('0x1d'),_0x586af0[_0xd4fa('0x15')],_0x1faa0b);_0x1f9be1(_0x5601d6[_0xd4fa('0x13')](0x1f4,_0x586af0[_0xd4fa('0x15')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x2a9d07){var _0x14ea6e=this;return new Promise(function(_0x4c5836,_0x162459){return db[_0xd4fa('0x18')][_0xd4fa('0x1e')](_0x2a9d07[_0xd4fa('0x1a')],{'raw':_0x2a9d07[_0xd4fa('0x1b')]?_0x2a9d07[_0xd4fa('0x1b')][_0xd4fa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a9d07[_0xd4fa('0x1b')]?_0x2a9d07[_0xd4fa('0x1b')]['where']||null:null,'attributes':_0x2a9d07[_0xd4fa('0x1b')]?_0x2a9d07['options'][_0xd4fa('0x1f')]||null:null,'limit':_0x2a9d07[_0xd4fa('0x1b')]?_0x2a9d07['options'][_0xd4fa('0x20')]||null:null})[_0xd4fa('0x21')](function(_0x1b16ba){logger['info'](_0xd4fa('0x22'),_0x2a9d07);logger[_0xd4fa('0xf')]('UpdateOpenchannelQueueReport',_0x2a9d07,JSON[_0xd4fa('0x12')](_0x1b16ba));_0x4c5836(_0x1b16ba);})[_0xd4fa('0x17')](function(_0x5455a2){logger[_0xd4fa('0x13')](_0xd4fa('0x22'),_0x5455a2[_0xd4fa('0x15')],_0x2a9d07);_0x162459(_0x14ea6e[_0xd4fa('0x13')](0x1f4,_0x5455a2[_0xd4fa('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 2ae384f..ea5b1cd 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 _0x97a7=['path','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util'];(function(_0x456af7,_0x3d36d3){var _0x3818f7=function(_0x2e7ca1){while(--_0x2e7ca1){_0x456af7['push'](_0x456af7['shift']());}};_0x3818f7(++_0x3d36d3);}(_0x97a7,0x163));var _0x797a=function(_0xe51522,_0x266bf5){_0xe51522=_0xe51522-0x0;var _0x5dac8a=_0x97a7[_0xe51522];return _0x5dac8a;};'use strict';var multer=require(_0x797a('0x0'));var util=require(_0x797a('0x1'));var path=require(_0x797a('0x2'));var timeout=require('connect-timeout');var express=require(_0x797a('0x3'));var router=express['Router']();var fs_extra=require(_0x797a('0x4'));var auth=require(_0x797a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x797a('0x6'));var controller=require(_0x797a('0x7'));router[_0x797a('0x8')]('/',auth[_0x797a('0x9')](),controller[_0x797a('0xa')]);router[_0x797a('0x8')](_0x797a('0xb'),auth['isAuthenticated'](),controller[_0x797a('0xc')]);router[_0x797a('0x8')](_0x797a('0xd'),auth[_0x797a('0x9')](),controller[_0x797a('0xe')]);router[_0x797a('0xf')]('/',auth[_0x797a('0x9')](),controller[_0x797a('0x10')]);router[_0x797a('0x11')](_0x797a('0xd'),auth[_0x797a('0x9')](),controller[_0x797a('0x12')]);router[_0x797a('0x13')](_0x797a('0xd'),auth[_0x797a('0x9')](),controller['destroy']);module[_0x797a('0x14')]=router; \ No newline at end of file +var _0x07e1=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','destroy','exports','path','connect-timeout','express'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x07e1,0x18d));var _0x107e=function(_0x21b41d,_0x2dd57a){_0x21b41d=_0x21b41d-0x0;var _0x3485c7=_0x07e1[_0x21b41d];return _0x3485c7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x107e('0x0'));var timeout=require(_0x107e('0x1'));var express=require(_0x107e('0x2'));var router=express[_0x107e('0x3')]();var fs_extra=require(_0x107e('0x4'));var auth=require(_0x107e('0x5'));var interaction=require(_0x107e('0x6'));var config=require('../../config/environment');var controller=require(_0x107e('0x7'));router[_0x107e('0x8')]('/',auth[_0x107e('0x9')](),controller[_0x107e('0xa')]);router[_0x107e('0x8')](_0x107e('0xb'),auth[_0x107e('0x9')](),controller[_0x107e('0xc')]);router[_0x107e('0x8')](_0x107e('0xd'),auth[_0x107e('0x9')](),controller[_0x107e('0xe')]);router[_0x107e('0xf')]('/',auth[_0x107e('0x9')](),controller[_0x107e('0x10')]);router[_0x107e('0x11')]('/:id',auth[_0x107e('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x107e('0x12')]);module[_0x107e('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index f9251ad..d597eeb 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x45123a,_0x2c21d5){var _0x9472c8=function(_0x152412){while(--_0x152412){_0x45123a['push'](_0x45123a['shift']());}};_0x9472c8(++_0x2c21d5);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x00bb[_0x4cf98e];return _0x1623ac;};'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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x34c063,_0x11d3d7){var _0x2c63a3=function(_0x5983d0){while(--_0x5983d0){_0x34c063['push'](_0x34c063['shift']());}};_0x2c63a3(++_0x11d3d7);}(_0xb43b,0x1b2));var _0xbb43=function(_0x365d1c,_0x267654){_0x365d1c=_0x365d1c-0x0;var _0x51f7f9=_0xb43b[_0x365d1c];return _0x51f7f9;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 96ba0c2..3b06070 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 _0x7254=['apply','reject','then','stack','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','include','catch','show','params','length','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','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','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0x7254,0x6b));var _0x4725=function(_0x23c86e,_0x1f3686){_0x23c86e=_0x23c86e-0x0;var _0x4e64c8=_0x7254[_0x23c86e];return _0x4e64c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4725('0x0'));var zipdir=require(_0x4725('0x1'));var jsonpatch=require(_0x4725('0x2'));var rp=require('request-promise');var moment=require(_0x4725('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4725('0x4'));var util=require(_0x4725('0x5'));var path=require(_0x4725('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4725('0x7'));var fs=require('fs');var fs_extra=require(_0x4725('0x8'));var _=require('lodash');var squel=require(_0x4725('0x9'));var crypto=require(_0x4725('0xa'));var jsforce=require(_0x4725('0xb'));var deskjs=require(_0x4725('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4725('0xd'));var Papa=require(_0x4725('0xe'));var Redis=require(_0x4725('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4725('0x10'));var as=require(_0x4725('0x11'));var hardwareService=require(_0x4725('0x12'));var logger=require(_0x4725('0x13'))(_0x4725('0x14'));var utils=require(_0x4725('0x15'));var config=require(_0x4725('0x16'));var licenseUtil=require(_0x4725('0x17'));var db=require(_0x4725('0x18'))['db'];function respondWithStatusCode(_0x3a4118,_0x31c33d){_0x31c33d=_0x31c33d||0xcc;return function(_0x184b3b){if(_0x184b3b){return _0x3a4118[_0x4725('0x19')](_0x31c33d);}return _0x3a4118['status'](_0x31c33d)[_0x4725('0x1a')]();};}function respondWithResult(_0x2682b6,_0x3a5d7d){_0x3a5d7d=_0x3a5d7d||0xc8;return function(_0x330a01){if(_0x330a01){return _0x2682b6[_0x4725('0x1b')](_0x3a5d7d)['json'](_0x330a01);}};}function respondWithFilteredResult(_0x337a30,_0x13cb4d){return function(_0xea3ddc){if(_0xea3ddc){var _0xa97727=typeof _0x13cb4d[_0x4725('0x1c')]===_0x4725('0x1d')&&typeof _0x13cb4d[_0x4725('0x1e')]==='undefined';var _0x1db3d3=_0xea3ddc['count'];var _0x26120c=_0xa97727?0x0:_0x13cb4d[_0x4725('0x1c')];var _0x4c1639=_0xa97727?_0xea3ddc[_0x4725('0x1f')]:_0x13cb4d[_0x4725('0x1c')]+_0x13cb4d[_0x4725('0x1e')];var _0x2012bf;if(_0x4c1639>=_0x1db3d3){_0x4c1639=_0x1db3d3;_0x2012bf=0xc8;}else{_0x2012bf=0xce;}_0x337a30[_0x4725('0x1b')](_0x2012bf);return _0x337a30[_0x4725('0x20')](_0x4725('0x21'),_0x26120c+'-'+_0x4c1639+'/'+_0x1db3d3)[_0x4725('0x22')](_0xea3ddc);}return null;};}function patchUpdates(_0x55a146){return function(_0x37202f){try{jsonpatch[_0x4725('0x23')](_0x37202f,_0x55a146,!![]);}catch(_0x5a903d){return BPromise[_0x4725('0x24')](_0x5a903d);}return _0x37202f['save']();};}function saveUpdates(_0x8e1e0c,_0x38d9e9){return function(_0x14948f){if(_0x14948f){return _0x14948f['update'](_0x8e1e0c)[_0x4725('0x25')](function(_0x11f11a){return _0x11f11a;});}return null;};}function removeEntity(_0x21abcd,_0x1ff57a){return function(_0x2b4444){if(_0x2b4444){return _0x2b4444['destroy']()[_0x4725('0x25')](function(){_0x21abcd['status'](0xcc)[_0x4725('0x1a')]();});}};}function handleEntityNotFound(_0x42f5e3,_0x4355d6){return function(_0x4f3727){if(!_0x4f3727){_0x42f5e3[_0x4725('0x19')](0x194);}return _0x4f3727;};}function handleError(_0x26e359,_0x20ead3){_0x20ead3=_0x20ead3||0x1f4;return function(_0x10339e){logger['error'](_0x10339e[_0x4725('0x26')]);if(_0x10339e[_0x4725('0x27')]){delete _0x10339e[_0x4725('0x27')];}_0x26e359[_0x4725('0x1b')](_0x20ead3)['send'](_0x10339e);};}exports[_0x4725('0x28')]=function(_0x491a56,_0x1cf11c){var _0x4ab66f={},_0x37621e={},_0x3a6081={'count':0x0,'rows':[]};var _0x37c6b1=_[_0x4725('0x29')](db[_0x4725('0x2a')][_0x4725('0x2b')],function(_0x2c8ce5){return{'name':_0x2c8ce5[_0x4725('0x2c')],'type':_0x2c8ce5[_0x4725('0x2d')]['key']};});_0x37621e['model']=_[_0x4725('0x29')](_0x37c6b1,_0x4725('0x27'));_0x37621e[_0x4725('0x2e')]=_[_0x4725('0x2f')](_0x491a56[_0x4725('0x2e')]);_0x37621e[_0x4725('0x30')]=_[_0x4725('0x31')](_0x37621e[_0x4725('0x32')],_0x37621e[_0x4725('0x2e')]);_0x4ab66f[_0x4725('0x33')]=_['intersection'](_0x37621e[_0x4725('0x32')],qs[_0x4725('0x34')](_0x491a56[_0x4725('0x2e')][_0x4725('0x34')]));_0x4ab66f['attributes']=_0x4ab66f[_0x4725('0x33')]['length']?_0x4ab66f['attributes']:_0x37621e['model'];if(!_0x491a56[_0x4725('0x2e')][_0x4725('0x35')](_0x4725('0x36'))){_0x4ab66f[_0x4725('0x1e')]=qs[_0x4725('0x1e')](_0x491a56[_0x4725('0x2e')]['limit']);_0x4ab66f[_0x4725('0x1c')]=qs[_0x4725('0x1c')](_0x491a56[_0x4725('0x2e')]['offset']);}_0x4ab66f['order']=qs['sort'](_0x491a56[_0x4725('0x2e')]['sort']);_0x4ab66f[_0x4725('0x37')]=qs[_0x4725('0x30')](_[_0x4725('0x38')](_0x491a56[_0x4725('0x2e')],_0x37621e[_0x4725('0x30')]),_0x37c6b1);if(_0x491a56['query'][_0x4725('0x39')]){_0x4ab66f[_0x4725('0x37')]=_[_0x4725('0x3a')](_0x4ab66f[_0x4725('0x37')],{'$or':_['map'](_0x37c6b1,function(_0x10f9d2){if(_0x10f9d2[_0x4725('0x2d')]!=='VIRTUAL'){var _0x44a33c={};_0x44a33c[_0x10f9d2[_0x4725('0x27')]]={'$like':'%'+_0x491a56[_0x4725('0x2e')][_0x4725('0x39')]+'%'};return _0x44a33c;}})});}_0x4ab66f=_['merge']({},_0x4ab66f,_0x491a56[_0x4725('0x3b')]);var _0x40181d={'where':_0x4ab66f[_0x4725('0x37')]};return db[_0x4725('0x2a')][_0x4725('0x1f')](_0x40181d)[_0x4725('0x25')](function(_0x2b19d1){_0x3a6081[_0x4725('0x1f')]=_0x2b19d1;if(_0x491a56['query'][_0x4725('0x3c')]){_0x4ab66f[_0x4725('0x3d')]=[{'all':!![]}];}return db[_0x4725('0x2a')]['findAll'](_0x4ab66f);})[_0x4725('0x25')](function(_0xf96611){_0x3a6081['rows']=_0xf96611;return _0x3a6081;})[_0x4725('0x25')](respondWithFilteredResult(_0x1cf11c,_0x4ab66f))[_0x4725('0x3e')](handleError(_0x1cf11c,null));};exports[_0x4725('0x3f')]=function(_0x392534,_0x1e38d3){var _0x4bb113={'raw':!![],'where':{'id':_0x392534[_0x4725('0x40')]['id']}},_0x5dcc27={};_0x5dcc27[_0x4725('0x32')]=_[_0x4725('0x2f')](db[_0x4725('0x2a')]['rawAttributes']);_0x5dcc27[_0x4725('0x2e')]=_[_0x4725('0x2f')](_0x392534[_0x4725('0x2e')]);_0x5dcc27['filters']=_[_0x4725('0x31')](_0x5dcc27[_0x4725('0x32')],_0x5dcc27[_0x4725('0x2e')]);_0x4bb113[_0x4725('0x33')]=_['intersection'](_0x5dcc27[_0x4725('0x32')],qs[_0x4725('0x34')](_0x392534[_0x4725('0x2e')][_0x4725('0x34')]));_0x4bb113['attributes']=_0x4bb113[_0x4725('0x33')][_0x4725('0x41')]?_0x4bb113[_0x4725('0x33')]:_0x5dcc27['model'];if(_0x392534[_0x4725('0x2e')][_0x4725('0x3c')]){_0x4bb113['include']=[{'all':!![]}];}_0x4bb113=_[_0x4725('0x3a')]({},_0x4bb113,_0x392534['options']);return db['OpenchannelTransferReport'][_0x4725('0x42')](_0x4bb113)[_0x4725('0x25')](handleEntityNotFound(_0x1e38d3,null))['then'](respondWithResult(_0x1e38d3,null))['catch'](handleError(_0x1e38d3,null));};exports[_0x4725('0x43')]=function(_0x36a82d,_0x4cb003){return db[_0x4725('0x2a')]['create'](_0x36a82d[_0x4725('0x44')],{})[_0x4725('0x25')](respondWithResult(_0x4cb003,0xc9))[_0x4725('0x3e')](handleError(_0x4cb003,null));};exports['update']=function(_0x234bc3,_0x5270f8){if(_0x234bc3[_0x4725('0x44')]['id']){delete _0x234bc3[_0x4725('0x44')]['id'];}return db[_0x4725('0x2a')][_0x4725('0x42')]({'where':{'id':_0x234bc3[_0x4725('0x40')]['id']}})['then'](handleEntityNotFound(_0x5270f8,null))['then'](saveUpdates(_0x234bc3['body'],null))['then'](respondWithResult(_0x5270f8,null))[_0x4725('0x3e')](handleError(_0x5270f8,null));};exports[_0x4725('0x45')]=function(_0x46a5ce,_0x4bd73b){return db[_0x4725('0x2a')][_0x4725('0x42')]({'where':{'id':_0x46a5ce[_0x4725('0x40')]['id']}})['then'](handleEntityNotFound(_0x4bd73b,null))[_0x4725('0x25')](removeEntity(_0x4bd73b,null))['catch'](handleError(_0x4bd73b,null));};exports['describe']=function(_0x2f4159,_0x3d998b){return db[_0x4725('0x2a')][_0x4725('0x46')]()[_0x4725('0x25')](respondWithResult(_0x3d998b,null))[_0x4725('0x3e')](handleError(_0x3d998b,null));}; \ No newline at end of file +var _0xf9d2=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','create','catch','update','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','type','key','model'];(function(_0xd89fde,_0x4d2417){var _0xe67f58=function(_0x4b21f9){while(--_0x4b21f9){_0xd89fde['push'](_0xd89fde['shift']());}};_0xe67f58(++_0x4d2417);}(_0xf9d2,0x6a));var _0x2f9d=function(_0x5e39cb,_0x3675a1){_0x5e39cb=_0x5e39cb-0x0;var _0x35630c=_0xf9d2[_0x5e39cb];return _0x35630c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f9d('0x0'));var zipdir=require(_0x2f9d('0x1'));var jsonpatch=require(_0x2f9d('0x2'));var rp=require(_0x2f9d('0x3'));var moment=require(_0x2f9d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2f9d('0x5'));var util=require(_0x2f9d('0x6'));var path=require(_0x2f9d('0x7'));var sox=require('sox');var csv=require(_0x2f9d('0x8'));var ejs=require(_0x2f9d('0x9'));var fs=require('fs');var fs_extra=require(_0x2f9d('0xa'));var _=require(_0x2f9d('0xb'));var squel=require(_0x2f9d('0xc'));var crypto=require(_0x2f9d('0xd'));var jsforce=require(_0x2f9d('0xe'));var deskjs=require(_0x2f9d('0xf'));var toCsv=require(_0x2f9d('0x8'));var querystring=require(_0x2f9d('0x10'));var Papa=require(_0x2f9d('0x11'));var Redis=require(_0x2f9d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2f9d('0x13'));var as=require(_0x2f9d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f9d('0x15'))(_0x2f9d('0x16'));var utils=require(_0x2f9d('0x17'));var config=require(_0x2f9d('0x18'));var licenseUtil=require(_0x2f9d('0x19'));var db=require(_0x2f9d('0x1a'))['db'];function respondWithStatusCode(_0x2c54d4,_0x549e79){_0x549e79=_0x549e79||0xcc;return function(_0x5cc249){if(_0x5cc249){return _0x2c54d4[_0x2f9d('0x1b')](_0x549e79);}return _0x2c54d4[_0x2f9d('0x1c')](_0x549e79)[_0x2f9d('0x1d')]();};}function respondWithResult(_0x44abb0,_0x2dd7c5){_0x2dd7c5=_0x2dd7c5||0xc8;return function(_0x36d9f9){if(_0x36d9f9){return _0x44abb0[_0x2f9d('0x1c')](_0x2dd7c5)[_0x2f9d('0x1e')](_0x36d9f9);}};}function respondWithFilteredResult(_0xe3630,_0xeb4db8){return function(_0x3c8f90){if(_0x3c8f90){var _0x494454=typeof _0xeb4db8[_0x2f9d('0x1f')]===_0x2f9d('0x20')&&typeof _0xeb4db8['limit']==='undefined';var _0x1bf075=_0x3c8f90[_0x2f9d('0x21')];var _0x4c6f59=_0x494454?0x0:_0xeb4db8[_0x2f9d('0x1f')];var _0x47a925=_0x494454?_0x3c8f90[_0x2f9d('0x21')]:_0xeb4db8['offset']+_0xeb4db8[_0x2f9d('0x22')];var _0x5de2a5;if(_0x47a925>=_0x1bf075){_0x47a925=_0x1bf075;_0x5de2a5=0xc8;}else{_0x5de2a5=0xce;}_0xe3630[_0x2f9d('0x1c')](_0x5de2a5);return _0xe3630['set'](_0x2f9d('0x23'),_0x4c6f59+'-'+_0x47a925+'/'+_0x1bf075)[_0x2f9d('0x1e')](_0x3c8f90);}return null;};}function patchUpdates(_0x3c7f59){return function(_0x45eae7){try{jsonpatch[_0x2f9d('0x24')](_0x45eae7,_0x3c7f59,!![]);}catch(_0xfc899c){return BPromise[_0x2f9d('0x25')](_0xfc899c);}return _0x45eae7[_0x2f9d('0x26')]();};}function saveUpdates(_0x24b519,_0x37f375){return function(_0x1a33cb){if(_0x1a33cb){return _0x1a33cb['update'](_0x24b519)[_0x2f9d('0x27')](function(_0x2ed7a0){return _0x2ed7a0;});}return null;};}function removeEntity(_0x433661,_0x191fcb){return function(_0x2a9618){if(_0x2a9618){return _0x2a9618[_0x2f9d('0x28')]()['then'](function(){_0x433661[_0x2f9d('0x1c')](0xcc)[_0x2f9d('0x1d')]();});}};}function handleEntityNotFound(_0x4d22d6,_0x8ab12d){return function(_0x4a0a90){if(!_0x4a0a90){_0x4d22d6[_0x2f9d('0x1b')](0x194);}return _0x4a0a90;};}function handleError(_0x5da4b4,_0x3270f6){_0x3270f6=_0x3270f6||0x1f4;return function(_0x370298){logger[_0x2f9d('0x29')](_0x370298[_0x2f9d('0x2a')]);if(_0x370298['name']){delete _0x370298[_0x2f9d('0x2b')];}_0x5da4b4[_0x2f9d('0x1c')](_0x3270f6)[_0x2f9d('0x2c')](_0x370298);};}exports[_0x2f9d('0x2d')]=function(_0x1e7d66,_0x147b9f){var _0x2c5043={},_0x333ae0={},_0x2c870b={'count':0x0,'rows':[]};var _0x5b44ec=_[_0x2f9d('0x2e')](db[_0x2f9d('0x2f')][_0x2f9d('0x30')],function(_0x5538ae){return{'name':_0x5538ae['fieldName'],'type':_0x5538ae[_0x2f9d('0x31')][_0x2f9d('0x32')]};});_0x333ae0[_0x2f9d('0x33')]=_[_0x2f9d('0x2e')](_0x5b44ec,'name');_0x333ae0[_0x2f9d('0x34')]=_[_0x2f9d('0x35')](_0x1e7d66[_0x2f9d('0x34')]);_0x333ae0[_0x2f9d('0x36')]=_[_0x2f9d('0x37')](_0x333ae0[_0x2f9d('0x33')],_0x333ae0[_0x2f9d('0x34')]);_0x2c5043[_0x2f9d('0x38')]=_[_0x2f9d('0x37')](_0x333ae0['model'],qs[_0x2f9d('0x39')](_0x1e7d66[_0x2f9d('0x34')][_0x2f9d('0x39')]));_0x2c5043[_0x2f9d('0x38')]=_0x2c5043[_0x2f9d('0x38')][_0x2f9d('0x3a')]?_0x2c5043[_0x2f9d('0x38')]:_0x333ae0['model'];if(!_0x1e7d66[_0x2f9d('0x34')][_0x2f9d('0x3b')](_0x2f9d('0x3c'))){_0x2c5043['limit']=qs[_0x2f9d('0x22')](_0x1e7d66[_0x2f9d('0x34')][_0x2f9d('0x22')]);_0x2c5043[_0x2f9d('0x1f')]=qs[_0x2f9d('0x1f')](_0x1e7d66[_0x2f9d('0x34')]['offset']);}_0x2c5043[_0x2f9d('0x3d')]=qs[_0x2f9d('0x3e')](_0x1e7d66[_0x2f9d('0x34')][_0x2f9d('0x3e')]);_0x2c5043['where']=qs['filters'](_['pick'](_0x1e7d66['query'],_0x333ae0[_0x2f9d('0x36')]),_0x5b44ec);if(_0x1e7d66[_0x2f9d('0x34')][_0x2f9d('0x3f')]){_0x2c5043[_0x2f9d('0x40')]=_[_0x2f9d('0x41')](_0x2c5043[_0x2f9d('0x40')],{'$or':_[_0x2f9d('0x2e')](_0x5b44ec,function(_0x5ec9bd){if(_0x5ec9bd[_0x2f9d('0x31')]!==_0x2f9d('0x42')){var _0x301004={};_0x301004[_0x5ec9bd[_0x2f9d('0x2b')]]={'$like':'%'+_0x1e7d66[_0x2f9d('0x34')][_0x2f9d('0x3f')]+'%'};return _0x301004;}})});}_0x2c5043=_[_0x2f9d('0x41')]({},_0x2c5043,_0x1e7d66[_0x2f9d('0x43')]);var _0x462f22={'where':_0x2c5043['where']};return db['OpenchannelTransferReport'][_0x2f9d('0x21')](_0x462f22)[_0x2f9d('0x27')](function(_0x1e41e5){_0x2c870b[_0x2f9d('0x21')]=_0x1e41e5;if(_0x1e7d66['query'][_0x2f9d('0x44')]){_0x2c5043[_0x2f9d('0x45')]=[{'all':!![]}];}return db[_0x2f9d('0x2f')]['findAll'](_0x2c5043);})[_0x2f9d('0x27')](function(_0x22df3f){_0x2c870b[_0x2f9d('0x46')]=_0x22df3f;return _0x2c870b;})[_0x2f9d('0x27')](respondWithFilteredResult(_0x147b9f,_0x2c5043))['catch'](handleError(_0x147b9f,null));};exports[_0x2f9d('0x47')]=function(_0x40346e,_0x240319){var _0x43c378={'raw':!![],'where':{'id':_0x40346e[_0x2f9d('0x48')]['id']}},_0x46ae34={};_0x46ae34[_0x2f9d('0x33')]=_[_0x2f9d('0x35')](db[_0x2f9d('0x2f')][_0x2f9d('0x30')]);_0x46ae34[_0x2f9d('0x34')]=_[_0x2f9d('0x35')](_0x40346e[_0x2f9d('0x34')]);_0x46ae34[_0x2f9d('0x36')]=_[_0x2f9d('0x37')](_0x46ae34[_0x2f9d('0x33')],_0x46ae34[_0x2f9d('0x34')]);_0x43c378[_0x2f9d('0x38')]=_[_0x2f9d('0x37')](_0x46ae34[_0x2f9d('0x33')],qs['fields'](_0x40346e['query'][_0x2f9d('0x39')]));_0x43c378[_0x2f9d('0x38')]=_0x43c378['attributes'][_0x2f9d('0x3a')]?_0x43c378['attributes']:_0x46ae34[_0x2f9d('0x33')];if(_0x40346e[_0x2f9d('0x34')]['includeAll']){_0x43c378[_0x2f9d('0x45')]=[{'all':!![]}];}_0x43c378=_[_0x2f9d('0x41')]({},_0x43c378,_0x40346e[_0x2f9d('0x43')]);return db[_0x2f9d('0x2f')][_0x2f9d('0x49')](_0x43c378)[_0x2f9d('0x27')](handleEntityNotFound(_0x240319,null))[_0x2f9d('0x27')](respondWithResult(_0x240319,null))['catch'](handleError(_0x240319,null));};exports[_0x2f9d('0x4a')]=function(_0x5cdbfc,_0x46839c){return db[_0x2f9d('0x2f')][_0x2f9d('0x4a')](_0x5cdbfc['body'],{})[_0x2f9d('0x27')](respondWithResult(_0x46839c,0xc9))[_0x2f9d('0x4b')](handleError(_0x46839c,null));};exports[_0x2f9d('0x4c')]=function(_0x188f54,_0x327455){if(_0x188f54[_0x2f9d('0x4d')]['id']){delete _0x188f54[_0x2f9d('0x4d')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x188f54[_0x2f9d('0x48')]['id']}})['then'](handleEntityNotFound(_0x327455,null))[_0x2f9d('0x27')](saveUpdates(_0x188f54[_0x2f9d('0x4d')],null))[_0x2f9d('0x27')](respondWithResult(_0x327455,null))['catch'](handleError(_0x327455,null));};exports['destroy']=function(_0x174d29,_0x247630){return db['OpenchannelTransferReport'][_0x2f9d('0x49')]({'where':{'id':_0x174d29[_0x2f9d('0x48')]['id']}})[_0x2f9d('0x27')](handleEntityNotFound(_0x247630,null))[_0x2f9d('0x27')](removeEntity(_0x247630,null))[_0x2f9d('0x4b')](handleError(_0x247630,null));};exports[_0x2f9d('0x4e')]=function(_0x1787f0,_0x46b9c1){return db['OpenchannelTransferReport'][_0x2f9d('0x4e')]()[_0x2f9d('0x27')](respondWithResult(_0x46b9c1,null))[_0x2f9d('0x4b')](handleError(_0x46b9c1,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index dd12964..6db1234 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 _0x4331=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','uniqueid'];(function(_0x185ee0,_0x4230de){var _0x1622c8=function(_0x16241f){while(--_0x16241f){_0x185ee0['push'](_0x185ee0['shift']());}};_0x1622c8(++_0x4230de);}(_0x4331,0x15e));var _0x1433=function(_0x4a45b4,_0x59804f){_0x4a45b4=_0x4a45b4-0x0;var _0x1a99c9=_0x4331[_0x4a45b4];return _0x1a99c9;};'use strict';var _=require(_0x1433('0x0'));var util=require(_0x1433('0x1'));var logger=require(_0x1433('0x2'))(_0x1433('0x3'));var moment=require(_0x1433('0x4'));var BPromise=require(_0x1433('0x5'));var rp=require(_0x1433('0x6'));var fs=require('fs');var path=require(_0x1433('0x7'));var rimraf=require(_0x1433('0x8'));var config=require(_0x1433('0x9'));var attributes=require(_0x1433('0xa'));module['exports']=function(_0x25cc37,_0x44fde){return _0x25cc37[_0x1433('0xb')](_0x1433('0xc'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x1433('0xd'),'fields':[_0x1433('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe745=['lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xe745,0xfd));var _0x5e74=function(_0x56de40,_0x44385c){_0x56de40=_0x56de40-0x0;var _0x4c37f7=_0xe745[_0x56de40];return _0x4c37f7;};'use strict';var _=require(_0x5e74('0x0'));var util=require('util');var logger=require(_0x5e74('0x1'))(_0x5e74('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5e74('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e74('0x4'));var config=require(_0x5e74('0x5'));var attributes=require(_0x5e74('0x6'));module[_0x5e74('0x7')]=function(_0x5e34d1,_0x32b59f){return _0x5e34d1['define'](_0x5e74('0x8'),attributes,{'tableName':_0x5e74('0x9'),'paranoid':![],'indexes':[{'name':_0x5e74('0xa'),'fields':[_0x5e74('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index bc496a2..5b23696 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 _0x63b6=['debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x44d0b7,_0xb3fe71){var _0x498246=function(_0x369165){while(--_0x369165){_0x44d0b7['push'](_0x44d0b7['shift']());}};_0x498246(++_0xb3fe71);}(_0x63b6,0x127));var _0x663b=function(_0x28d6e1,_0x3bd067){_0x28d6e1=_0x28d6e1-0x0;var _0x529cf3=_0x63b6[_0x28d6e1];return _0x529cf3;};'use strict';var _=require(_0x663b('0x0'));var util=require(_0x663b('0x1'));var moment=require(_0x663b('0x2'));var BPromise=require('bluebird');var rs=require(_0x663b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x663b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x663b('0x5'))(_0x663b('0x6'));var config=require(_0x663b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x663b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x210eb1,_0x53f5cf,_0x414dc2){return new BPromise(function(_0x2976ff,_0xf8f3ff){return client[_0x663b('0x9')](_0x210eb1,_0x414dc2)[_0x663b('0xa')](function(_0x1e1698){logger['info'](_0x663b('0xb'),_0x53f5cf,_0x663b('0xc'));logger[_0x663b('0xd')](_0x663b('0xe'),_0x53f5cf,_0x663b('0xc'),JSON[_0x663b('0xf')](_0x1e1698));if(_0x1e1698[_0x663b('0x10')]){if(_0x1e1698[_0x663b('0x10')][_0x663b('0x11')]===0x1f4){logger[_0x663b('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x53f5cf,_0x1e1698['error'][_0x663b('0x12')]);return _0xf8f3ff(_0x1e1698[_0x663b('0x10')][_0x663b('0x12')]);}logger[_0x663b('0x10')](_0x663b('0xb'),_0x53f5cf,_0x1e1698[_0x663b('0x10')]['message']);return _0x2976ff(_0x1e1698[_0x663b('0x10')][_0x663b('0x12')]);}else{logger[_0x663b('0x13')](_0x663b('0xb'),_0x53f5cf,_0x663b('0xc'));_0x2976ff(_0x1e1698[_0x663b('0x14')][_0x663b('0x12')]);}})[_0x663b('0x15')](function(_0x63443b){logger[_0x663b('0x10')](_0x663b('0xb'),_0x53f5cf,_0x63443b);_0xf8f3ff(_0x63443b);});});} \ No newline at end of file +var _0x2b83=['request','then','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x1be819,_0x101b64){var _0x32c1a0=function(_0xc8e1f6){while(--_0xc8e1f6){_0x1be819['push'](_0x1be819['shift']());}};_0x32c1a0(++_0x101b64);}(_0x2b83,0x1d3));var _0x32b8=function(_0x5177f1,_0x154a41){_0x5177f1=_0x5177f1-0x0;var _0x31fdc0=_0x2b83[_0x5177f1];return _0x31fdc0;};'use strict';var _=require('lodash');var util=require(_0x32b8('0x0'));var moment=require(_0x32b8('0x1'));var BPromise=require('bluebird');var rs=require(_0x32b8('0x2'));var fs=require('fs');var Redis=require(_0x32b8('0x3'));var db=require(_0x32b8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x32b8('0x5'));var config=require(_0x32b8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x32b8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18150c,_0x342a03,_0x36bde3){return new BPromise(function(_0x10a967,_0x5cc6b2){return client[_0x32b8('0x8')](_0x18150c,_0x36bde3)[_0x32b8('0x9')](function(_0x48257a){logger['info'](_0x32b8('0xa'),_0x342a03,'request\x20sent');logger[_0x32b8('0xb')](_0x32b8('0xc'),_0x342a03,_0x32b8('0xd'),JSON[_0x32b8('0xe')](_0x48257a));if(_0x48257a['error']){if(_0x48257a[_0x32b8('0xf')][_0x32b8('0x10')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x342a03,_0x48257a[_0x32b8('0xf')]['message']);return _0x5cc6b2(_0x48257a[_0x32b8('0xf')]['message']);}logger[_0x32b8('0xf')](_0x32b8('0xa'),_0x342a03,_0x48257a[_0x32b8('0xf')][_0x32b8('0x11')]);return _0x10a967(_0x48257a[_0x32b8('0xf')]['message']);}else{logger['info'](_0x32b8('0xa'),_0x342a03,'request\x20sent');_0x10a967(_0x48257a['result']['message']);}})[_0x32b8('0x12')](function(_0x57a060){logger['error'](_0x32b8('0xa'),_0x342a03,_0x57a060);_0x5cc6b2(_0x57a060);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index dda6c72..b03d2dc 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 _0xfb58=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','get','isAuthenticated','post','create','put','/:id','update','delete'];(function(_0x22e1f6,_0x134f64){var _0x122846=function(_0x5c6934){while(--_0x5c6934){_0x22e1f6['push'](_0x22e1f6['shift']());}};_0x122846(++_0x134f64);}(_0xfb58,0xa3));var _0x8fb5=function(_0x4bfe54,_0x5bcba3){_0x4bfe54=_0x4bfe54-0x0;var _0x1dd339=_0xfb58[_0x4bfe54];return _0x1dd339;};'use strict';var multer=require(_0x8fb5('0x0'));var util=require('util');var path=require(_0x8fb5('0x1'));var timeout=require(_0x8fb5('0x2'));var express=require(_0x8fb5('0x3'));var router=express[_0x8fb5('0x4')]();var fs_extra=require(_0x8fb5('0x5'));var auth=require(_0x8fb5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8fb5('0x7'));var controller=require(_0x8fb5('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8fb5('0x9')]('/:id',auth[_0x8fb5('0xa')](),controller['show']);router[_0x8fb5('0xb')]('/',auth[_0x8fb5('0xa')](),controller[_0x8fb5('0xc')]);router[_0x8fb5('0xd')](_0x8fb5('0xe'),auth[_0x8fb5('0xa')](),controller[_0x8fb5('0xf')]);router[_0x8fb5('0x10')](_0x8fb5('0xe'),auth[_0x8fb5('0xa')](),controller['destroy']);module[_0x8fb5('0x11')]=router; \ No newline at end of file +var _0xeeb9=['get','/:id','isAuthenticated','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./pause.controller','index'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0xeeb9,0xed));var _0x9eeb=function(_0x3baf69,_0x4598c7){_0x3baf69=_0x3baf69-0x0;var _0x3e1815=_0xeeb9[_0x3baf69];return _0x3e1815;};'use strict';var multer=require(_0x9eeb('0x0'));var util=require(_0x9eeb('0x1'));var path=require(_0x9eeb('0x2'));var timeout=require(_0x9eeb('0x3'));var express=require(_0x9eeb('0x4'));var router=express[_0x9eeb('0x5')]();var fs_extra=require(_0x9eeb('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9eeb('0x7'));var controller=require(_0x9eeb('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9eeb('0x9')]);router[_0x9eeb('0xa')](_0x9eeb('0xb'),auth[_0x9eeb('0xc')](),controller[_0x9eeb('0xd')]);router[_0x9eeb('0xe')]('/',auth[_0x9eeb('0xc')](),controller['create']);router[_0x9eeb('0xf')]('/:id',auth[_0x9eeb('0xc')](),controller[_0x9eeb('0x10')]);router['delete']('/:id',auth[_0x9eeb('0xc')](),controller[_0x9eeb('0x11')]);module[_0x9eeb('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index cccbcf4..5ebb2fa 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 _0xf8e8=['sequelize','STRING'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xf8e8,0xc4));var _0x8f8e=function(_0x52a4f1,_0xf5d62e){_0x52a4f1=_0x52a4f1-0x0;var _0xd9a3ff=_0xf8e8[_0x52a4f1];return _0xd9a3ff;};'use strict';var Sequelize=require(_0x8f8e('0x0'));module['exports']={'name':{'type':Sequelize[_0x8f8e('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x8f8e('0x1')]}}; \ No newline at end of file +var _0xef21=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef21,0x1a8));var _0x1ef2=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xef21[_0x3740fe];return _0x55492b;};'use strict';var Sequelize=require(_0x1ef2('0x0'));module[_0x1ef2('0x1')]={'name':{'type':Sequelize[_0x1ef2('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x1ef2('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 6ab5773..af6ebfe 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 _0xeb53=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','json','apply','save','update','then','get','Pauses','UserProfileResource','error','name','send','map','Pause','rawAttributes','fieldName','type','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service'];(function(_0x4dfe07,_0x4f89ac){var _0x93d323=function(_0x366177){while(--_0x366177){_0x4dfe07['push'](_0x4dfe07['shift']());}};_0x93d323(++_0x4f89ac);}(_0xeb53,0x136));var _0x3eb5=function(_0x4f1d85,_0x12bd95){_0x4f1d85=_0x4f1d85-0x0;var _0x33856e=_0xeb53[_0x4f1d85];return _0x33856e;};'use strict';var emlformat=require(_0x3eb5('0x0'));var rimraf=require(_0x3eb5('0x1'));var zipdir=require(_0x3eb5('0x2'));var jsonpatch=require(_0x3eb5('0x3'));var rp=require(_0x3eb5('0x4'));var moment=require(_0x3eb5('0x5'));var BPromise=require(_0x3eb5('0x6'));var Mustache=require(_0x3eb5('0x7'));var util=require(_0x3eb5('0x8'));var path=require(_0x3eb5('0x9'));var sox=require(_0x3eb5('0xa'));var csv=require(_0x3eb5('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3eb5('0xc'));var _=require(_0x3eb5('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3eb5('0xe'));var deskjs=require(_0x3eb5('0xf'));var toCsv=require(_0x3eb5('0xb'));var querystring=require('querystring');var Papa=require(_0x3eb5('0x10'));var Redis=require('ioredis');var authService=require(_0x3eb5('0x11'));var qs=require(_0x3eb5('0x12'));var as=require(_0x3eb5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3eb5('0x14'))(_0x3eb5('0x15'));var utils=require(_0x3eb5('0x16'));var config=require(_0x3eb5('0x17'));var licenseUtil=require(_0x3eb5('0x18'));var db=require(_0x3eb5('0x19'))['db'];function respondWithStatusCode(_0x4efa77,_0x1c317d){_0x1c317d=_0x1c317d||0xcc;return function(_0x4f208e){if(_0x4f208e){return _0x4efa77[_0x3eb5('0x1a')](_0x1c317d);}return _0x4efa77[_0x3eb5('0x1b')](_0x1c317d)[_0x3eb5('0x1c')]();};}function respondWithResult(_0x2ef34d,_0x10d340){_0x10d340=_0x10d340||0xc8;return function(_0x54911c){if(_0x54911c){return _0x2ef34d[_0x3eb5('0x1b')](_0x10d340)['json'](_0x54911c);}};}function respondWithFilteredResult(_0x5f52fe,_0x357254){return function(_0x2aa70c){if(_0x2aa70c){var _0xd71208=typeof _0x357254[_0x3eb5('0x1d')]==='undefined'&&typeof _0x357254[_0x3eb5('0x1e')]==='undefined';var _0x2518d4=_0x2aa70c[_0x3eb5('0x1f')];var _0x301878=_0xd71208?0x0:_0x357254[_0x3eb5('0x1d')];var _0x11547b=_0xd71208?_0x2aa70c['count']:_0x357254[_0x3eb5('0x1d')]+_0x357254[_0x3eb5('0x1e')];var _0x312bcb;if(_0x11547b>=_0x2518d4){_0x11547b=_0x2518d4;_0x312bcb=0xc8;}else{_0x312bcb=0xce;}_0x5f52fe['status'](_0x312bcb);return _0x5f52fe[_0x3eb5('0x20')]('Content-Range',_0x301878+'-'+_0x11547b+'/'+_0x2518d4)[_0x3eb5('0x21')](_0x2aa70c);}return null;};}function patchUpdates(_0x396836){return function(_0x4d7c67){try{jsonpatch[_0x3eb5('0x22')](_0x4d7c67,_0x396836,!![]);}catch(_0x42d804){return BPromise['reject'](_0x42d804);}return _0x4d7c67[_0x3eb5('0x23')]();};}function saveUpdates(_0x258c87,_0x339c2f){return function(_0x20dc47){if(_0x20dc47){return _0x20dc47[_0x3eb5('0x24')](_0x258c87)[_0x3eb5('0x25')](function(_0x1f8eab){return _0x1f8eab;});}return null;};}function removeEntity(_0x26025f,_0x1e1361){return function(_0x740ef3){if(_0x740ef3){return _0x740ef3['destroy']()[_0x3eb5('0x25')](function(){var _0x32818d=_0x740ef3[_0x3eb5('0x26')]({'plain':!![]});var _0x2b9d36=_0x3eb5('0x27');return db[_0x3eb5('0x28')]['destroy']({'where':{'type':_0x2b9d36,'resourceId':_0x32818d['id']}})[_0x3eb5('0x25')](function(){return _0x740ef3;});})[_0x3eb5('0x25')](function(){_0x26025f[_0x3eb5('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30bd07,_0x512b51){return function(_0x39fe76){if(!_0x39fe76){_0x30bd07[_0x3eb5('0x1a')](0x194);}return _0x39fe76;};}function handleError(_0x274aa9,_0x2977a9){_0x2977a9=_0x2977a9||0x1f4;return function(_0x3edff9){logger[_0x3eb5('0x29')](_0x3edff9['stack']);if(_0x3edff9[_0x3eb5('0x2a')]){delete _0x3edff9['name'];}_0x274aa9[_0x3eb5('0x1b')](_0x2977a9)[_0x3eb5('0x2b')](_0x3edff9);};}exports['index']=function(_0x3728d1,_0x497101){var _0x5ece3b={},_0x4c47ff={},_0x2beac0={'count':0x0,'rows':[]};var _0x1e5c25=_[_0x3eb5('0x2c')](db[_0x3eb5('0x2d')][_0x3eb5('0x2e')],function(_0xeebf6d){return{'name':_0xeebf6d[_0x3eb5('0x2f')],'type':_0xeebf6d[_0x3eb5('0x30')]['key']};});_0x4c47ff['model']=_[_0x3eb5('0x2c')](_0x1e5c25,_0x3eb5('0x2a'));_0x4c47ff[_0x3eb5('0x31')]=_[_0x3eb5('0x32')](_0x3728d1['query']);_0x4c47ff['filters']=_['intersection'](_0x4c47ff[_0x3eb5('0x33')],_0x4c47ff[_0x3eb5('0x31')]);_0x5ece3b['attributes']=_[_0x3eb5('0x34')](_0x4c47ff[_0x3eb5('0x33')],qs[_0x3eb5('0x35')](_0x3728d1[_0x3eb5('0x31')][_0x3eb5('0x35')]));_0x5ece3b[_0x3eb5('0x36')]=_0x5ece3b[_0x3eb5('0x36')][_0x3eb5('0x37')]?_0x5ece3b[_0x3eb5('0x36')]:_0x4c47ff['model'];if(!_0x3728d1[_0x3eb5('0x31')][_0x3eb5('0x38')](_0x3eb5('0x39'))){_0x5ece3b[_0x3eb5('0x1e')]=qs[_0x3eb5('0x1e')](_0x3728d1[_0x3eb5('0x31')][_0x3eb5('0x1e')]);_0x5ece3b[_0x3eb5('0x1d')]=qs[_0x3eb5('0x1d')](_0x3728d1[_0x3eb5('0x31')][_0x3eb5('0x1d')]);}_0x5ece3b['order']=qs[_0x3eb5('0x3a')](_0x3728d1[_0x3eb5('0x31')][_0x3eb5('0x3a')]);_0x5ece3b[_0x3eb5('0x3b')]=qs['filters'](_[_0x3eb5('0x3c')](_0x3728d1[_0x3eb5('0x31')],_0x4c47ff[_0x3eb5('0x3d')]),_0x1e5c25);if(_0x3728d1[_0x3eb5('0x31')][_0x3eb5('0x3e')]){_0x5ece3b[_0x3eb5('0x3b')]=_['merge'](_0x5ece3b[_0x3eb5('0x3b')],{'$or':_[_0x3eb5('0x2c')](_0x1e5c25,function(_0x56543c){if(_0x56543c['type']!==_0x3eb5('0x3f')){var _0x1c26ff={};_0x1c26ff[_0x56543c[_0x3eb5('0x2a')]]={'$like':'%'+_0x3728d1[_0x3eb5('0x31')][_0x3eb5('0x3e')]+'%'};return _0x1c26ff;}})});}_0x5ece3b=_[_0x3eb5('0x40')]({},_0x5ece3b,_0x3728d1[_0x3eb5('0x41')]);var _0x232d58={'where':_0x5ece3b[_0x3eb5('0x3b')]};return db[_0x3eb5('0x2d')][_0x3eb5('0x1f')](_0x232d58)[_0x3eb5('0x25')](function(_0x3f0cd9){_0x2beac0['count']=_0x3f0cd9;if(_0x3728d1[_0x3eb5('0x31')]['includeAll']){_0x5ece3b[_0x3eb5('0x42')]=[{'all':!![]}];}return db['Pause'][_0x3eb5('0x43')](_0x5ece3b);})['then'](function(_0x3dab53){_0x2beac0[_0x3eb5('0x44')]=_0x3dab53;return _0x2beac0;})[_0x3eb5('0x25')](respondWithFilteredResult(_0x497101,_0x5ece3b))['catch'](handleError(_0x497101,null));};exports[_0x3eb5('0x45')]=function(_0x34c468,_0x140c7c){var _0x568495={'raw':!![],'where':{'id':_0x34c468[_0x3eb5('0x46')]['id']}},_0x493a57={};_0x493a57[_0x3eb5('0x33')]=_[_0x3eb5('0x32')](db['Pause'][_0x3eb5('0x2e')]);_0x493a57[_0x3eb5('0x31')]=_[_0x3eb5('0x32')](_0x34c468['query']);_0x493a57[_0x3eb5('0x3d')]=_[_0x3eb5('0x34')](_0x493a57[_0x3eb5('0x33')],_0x493a57[_0x3eb5('0x31')]);_0x568495['attributes']=_[_0x3eb5('0x34')](_0x493a57[_0x3eb5('0x33')],qs[_0x3eb5('0x35')](_0x34c468[_0x3eb5('0x31')][_0x3eb5('0x35')]));_0x568495[_0x3eb5('0x36')]=_0x568495[_0x3eb5('0x36')][_0x3eb5('0x37')]?_0x568495['attributes']:_0x493a57[_0x3eb5('0x33')];if(_0x34c468[_0x3eb5('0x31')]['includeAll']){_0x568495[_0x3eb5('0x42')]=[{'all':!![]}];}_0x568495=_[_0x3eb5('0x40')]({},_0x568495,_0x34c468['options']);return db[_0x3eb5('0x2d')][_0x3eb5('0x47')](_0x568495)[_0x3eb5('0x25')](handleEntityNotFound(_0x140c7c,null))['then'](respondWithResult(_0x140c7c,null))[_0x3eb5('0x48')](handleError(_0x140c7c,null));};exports['create']=function(_0x56831a,_0x253406){return db[_0x3eb5('0x2d')][_0x3eb5('0x49')](_0x56831a[_0x3eb5('0x4a')],{})[_0x3eb5('0x25')](function(_0x4600f9){var _0x40f1d7=_0x56831a[_0x3eb5('0x4b')][_0x3eb5('0x26')]({'plain':!![]});if(!_0x40f1d7)throw new Error(_0x3eb5('0x4c'));if(_0x40f1d7[_0x3eb5('0x4d')]==='user'){var _0x5e7d4a=_0x4600f9[_0x3eb5('0x26')]({'plain':!![]});var _0x34b284='Pauses';return db[_0x3eb5('0x4e')][_0x3eb5('0x47')]({'where':{'name':_0x34b284,'userProfileId':_0x40f1d7['userProfileId']},'raw':!![]})[_0x3eb5('0x25')](function(_0x23abb1){if(_0x23abb1&&_0x23abb1[_0x3eb5('0x4f')]===0x0){return db[_0x3eb5('0x28')][_0x3eb5('0x49')]({'name':_0x5e7d4a['name'],'resourceId':_0x5e7d4a['id'],'type':_0x23abb1[_0x3eb5('0x2a')],'sectionId':_0x23abb1['id']},{})[_0x3eb5('0x25')](function(){return _0x4600f9;});}else{return _0x4600f9;}})['catch'](function(_0xa089c5){logger['error'](_0x3eb5('0x50'),_0xa089c5);throw _0xa089c5;});}return _0x4600f9;})[_0x3eb5('0x25')](respondWithResult(_0x253406,0xc9))[_0x3eb5('0x48')](handleError(_0x253406,null));};exports[_0x3eb5('0x24')]=function(_0x4b3202,_0x5010d7){if(_0x4b3202['body']['id']){delete _0x4b3202[_0x3eb5('0x4a')]['id'];}return db['Pause'][_0x3eb5('0x47')]({'where':{'id':_0x4b3202['params']['id']}})[_0x3eb5('0x25')](handleEntityNotFound(_0x5010d7,null))[_0x3eb5('0x25')](saveUpdates(_0x4b3202['body'],null))[_0x3eb5('0x25')](respondWithResult(_0x5010d7,null))[_0x3eb5('0x48')](handleError(_0x5010d7,null));};exports[_0x3eb5('0x51')]=function(_0x822657,_0x1f9fb4){return db[_0x3eb5('0x2d')][_0x3eb5('0x47')]({'where':{'id':_0x822657[_0x3eb5('0x46')]['id']}})[_0x3eb5('0x25')](handleEntityNotFound(_0x1f9fb4,null))['then'](removeEntity(_0x1f9fb4,null))[_0x3eb5('0x48')](handleError(_0x1f9fb4,null));}; \ No newline at end of file +var _0x74c4=['query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Pause','findAll','rows','catch','show','params','keys','intersection','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','map','rawAttributes','type','key','model'];(function(_0xa2c0a3,_0x5bbac0){var _0x52c618=function(_0x20f7fd){while(--_0x20f7fd){_0xa2c0a3['push'](_0xa2c0a3['shift']());}};_0x52c618(++_0x5bbac0);}(_0x74c4,0x78));var _0x474c=function(_0x3218a9,_0x499e0c){_0x3218a9=_0x3218a9-0x0;var _0x20970e=_0x74c4[_0x3218a9];return _0x20970e;};'use strict';var emlformat=require(_0x474c('0x0'));var rimraf=require(_0x474c('0x1'));var zipdir=require(_0x474c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x474c('0x3'));var moment=require(_0x474c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x474c('0x5'));var util=require(_0x474c('0x6'));var path=require(_0x474c('0x7'));var sox=require('sox');var csv=require(_0x474c('0x8'));var ejs=require(_0x474c('0x9'));var fs=require('fs');var fs_extra=require(_0x474c('0xa'));var _=require(_0x474c('0xb'));var squel=require(_0x474c('0xc'));var crypto=require(_0x474c('0xd'));var jsforce=require(_0x474c('0xe'));var deskjs=require(_0x474c('0xf'));var toCsv=require(_0x474c('0x8'));var querystring=require(_0x474c('0x10'));var Papa=require(_0x474c('0x11'));var Redis=require(_0x474c('0x12'));var authService=require(_0x474c('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x474c('0x14'));var logger=require(_0x474c('0x15'))('api');var utils=require(_0x474c('0x16'));var config=require(_0x474c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x474c('0x18'))['db'];function respondWithStatusCode(_0x4efc72,_0x4df0eb){_0x4df0eb=_0x4df0eb||0xcc;return function(_0x5f0f46){if(_0x5f0f46){return _0x4efc72[_0x474c('0x19')](_0x4df0eb);}return _0x4efc72['status'](_0x4df0eb)[_0x474c('0x1a')]();};}function respondWithResult(_0x4a9d82,_0x23c519){_0x23c519=_0x23c519||0xc8;return function(_0x331811){if(_0x331811){return _0x4a9d82[_0x474c('0x1b')](_0x23c519)[_0x474c('0x1c')](_0x331811);}};}function respondWithFilteredResult(_0xa0d44a,_0x55c2b3){return function(_0x5d9945){if(_0x5d9945){var _0x86b7e0=typeof _0x55c2b3[_0x474c('0x1d')]===_0x474c('0x1e')&&typeof _0x55c2b3[_0x474c('0x1f')]===_0x474c('0x1e');var _0x44c11b=_0x5d9945[_0x474c('0x20')];var _0x5e1482=_0x86b7e0?0x0:_0x55c2b3[_0x474c('0x1d')];var _0x4f2c69=_0x86b7e0?_0x5d9945[_0x474c('0x20')]:_0x55c2b3['offset']+_0x55c2b3[_0x474c('0x1f')];var _0x26cf3f;if(_0x4f2c69>=_0x44c11b){_0x4f2c69=_0x44c11b;_0x26cf3f=0xc8;}else{_0x26cf3f=0xce;}_0xa0d44a[_0x474c('0x1b')](_0x26cf3f);return _0xa0d44a[_0x474c('0x21')](_0x474c('0x22'),_0x5e1482+'-'+_0x4f2c69+'/'+_0x44c11b)[_0x474c('0x1c')](_0x5d9945);}return null;};}function patchUpdates(_0xb36cec){return function(_0x3bde3d){try{jsonpatch[_0x474c('0x23')](_0x3bde3d,_0xb36cec,!![]);}catch(_0xf1e587){return BPromise[_0x474c('0x24')](_0xf1e587);}return _0x3bde3d['save']();};}function saveUpdates(_0x2c6327,_0x473a41){return function(_0x57577c){if(_0x57577c){return _0x57577c[_0x474c('0x25')](_0x2c6327)[_0x474c('0x26')](function(_0x140b10){return _0x140b10;});}return null;};}function removeEntity(_0x290557,_0x306a9d){return function(_0x3e57a4){if(_0x3e57a4){return _0x3e57a4[_0x474c('0x27')]()[_0x474c('0x26')](function(){var _0x9339a0=_0x3e57a4[_0x474c('0x28')]({'plain':!![]});var _0x4a0363=_0x474c('0x29');return db[_0x474c('0x2a')][_0x474c('0x27')]({'where':{'type':_0x4a0363,'resourceId':_0x9339a0['id']}})[_0x474c('0x26')](function(){return _0x3e57a4;});})[_0x474c('0x26')](function(){_0x290557[_0x474c('0x1b')](0xcc)[_0x474c('0x1a')]();});}};}function handleEntityNotFound(_0x499d17,_0x5f5a50){return function(_0x127839){if(!_0x127839){_0x499d17[_0x474c('0x19')](0x194);}return _0x127839;};}function handleError(_0x5e7c67,_0x2effdc){_0x2effdc=_0x2effdc||0x1f4;return function(_0x3d2b7c){logger[_0x474c('0x2b')](_0x3d2b7c[_0x474c('0x2c')]);if(_0x3d2b7c[_0x474c('0x2d')]){delete _0x3d2b7c[_0x474c('0x2d')];}_0x5e7c67[_0x474c('0x1b')](_0x2effdc)[_0x474c('0x2e')](_0x3d2b7c);};}exports['index']=function(_0x4e0951,_0x330d8d){var _0x54c8f8={},_0x2fbd10={},_0x4fb042={'count':0x0,'rows':[]};var _0x5cabe8=_[_0x474c('0x2f')](db['Pause'][_0x474c('0x30')],function(_0x13ba5e){return{'name':_0x13ba5e['fieldName'],'type':_0x13ba5e[_0x474c('0x31')][_0x474c('0x32')]};});_0x2fbd10[_0x474c('0x33')]=_[_0x474c('0x2f')](_0x5cabe8,_0x474c('0x2d'));_0x2fbd10['query']=_['keys'](_0x4e0951[_0x474c('0x34')]);_0x2fbd10[_0x474c('0x35')]=_['intersection'](_0x2fbd10[_0x474c('0x33')],_0x2fbd10[_0x474c('0x34')]);_0x54c8f8[_0x474c('0x36')]=_['intersection'](_0x2fbd10['model'],qs[_0x474c('0x37')](_0x4e0951[_0x474c('0x34')][_0x474c('0x37')]));_0x54c8f8['attributes']=_0x54c8f8[_0x474c('0x36')][_0x474c('0x38')]?_0x54c8f8[_0x474c('0x36')]:_0x2fbd10[_0x474c('0x33')];if(!_0x4e0951['query'][_0x474c('0x39')]('nolimit')){_0x54c8f8[_0x474c('0x1f')]=qs['limit'](_0x4e0951[_0x474c('0x34')][_0x474c('0x1f')]);_0x54c8f8[_0x474c('0x1d')]=qs[_0x474c('0x1d')](_0x4e0951[_0x474c('0x34')][_0x474c('0x1d')]);}_0x54c8f8[_0x474c('0x3a')]=qs[_0x474c('0x3b')](_0x4e0951[_0x474c('0x34')][_0x474c('0x3b')]);_0x54c8f8[_0x474c('0x3c')]=qs[_0x474c('0x35')](_[_0x474c('0x3d')](_0x4e0951[_0x474c('0x34')],_0x2fbd10['filters']),_0x5cabe8);if(_0x4e0951[_0x474c('0x34')][_0x474c('0x3e')]){_0x54c8f8[_0x474c('0x3c')]=_[_0x474c('0x3f')](_0x54c8f8[_0x474c('0x3c')],{'$or':_[_0x474c('0x2f')](_0x5cabe8,function(_0xcadf36){if(_0xcadf36[_0x474c('0x31')]!==_0x474c('0x40')){var _0x3ca055={};_0x3ca055[_0xcadf36[_0x474c('0x2d')]]={'$like':'%'+_0x4e0951[_0x474c('0x34')][_0x474c('0x3e')]+'%'};return _0x3ca055;}})});}_0x54c8f8=_[_0x474c('0x3f')]({},_0x54c8f8,_0x4e0951[_0x474c('0x41')]);var _0x423309={'where':_0x54c8f8[_0x474c('0x3c')]};return db[_0x474c('0x42')][_0x474c('0x20')](_0x423309)['then'](function(_0x3859b3){_0x4fb042['count']=_0x3859b3;if(_0x4e0951[_0x474c('0x34')]['includeAll']){_0x54c8f8['include']=[{'all':!![]}];}return db[_0x474c('0x42')][_0x474c('0x43')](_0x54c8f8);})[_0x474c('0x26')](function(_0xf5673d){_0x4fb042[_0x474c('0x44')]=_0xf5673d;return _0x4fb042;})['then'](respondWithFilteredResult(_0x330d8d,_0x54c8f8))[_0x474c('0x45')](handleError(_0x330d8d,null));};exports[_0x474c('0x46')]=function(_0xb26e8d,_0x4e910c){var _0x40fbad={'raw':!![],'where':{'id':_0xb26e8d[_0x474c('0x47')]['id']}},_0x31d255={};_0x31d255[_0x474c('0x33')]=_['keys'](db['Pause'][_0x474c('0x30')]);_0x31d255[_0x474c('0x34')]=_[_0x474c('0x48')](_0xb26e8d[_0x474c('0x34')]);_0x31d255[_0x474c('0x35')]=_[_0x474c('0x49')](_0x31d255['model'],_0x31d255[_0x474c('0x34')]);_0x40fbad[_0x474c('0x36')]=_['intersection'](_0x31d255['model'],qs[_0x474c('0x37')](_0xb26e8d['query'][_0x474c('0x37')]));_0x40fbad[_0x474c('0x36')]=_0x40fbad[_0x474c('0x36')]['length']?_0x40fbad[_0x474c('0x36')]:_0x31d255[_0x474c('0x33')];if(_0xb26e8d[_0x474c('0x34')][_0x474c('0x4a')]){_0x40fbad[_0x474c('0x4b')]=[{'all':!![]}];}_0x40fbad=_['merge']({},_0x40fbad,_0xb26e8d[_0x474c('0x41')]);return db[_0x474c('0x42')]['find'](_0x40fbad)[_0x474c('0x26')](handleEntityNotFound(_0x4e910c,null))[_0x474c('0x26')](respondWithResult(_0x4e910c,null))[_0x474c('0x45')](handleError(_0x4e910c,null));};exports[_0x474c('0x4c')]=function(_0xd04097,_0x36c2b3){return db[_0x474c('0x42')][_0x474c('0x4c')](_0xd04097[_0x474c('0x4d')],{})['then'](function(_0x3ad1cb){var _0x4d8128=_0xd04097[_0x474c('0x4e')]['get']({'plain':!![]});if(!_0x4d8128)throw new Error(_0x474c('0x4f'));if(_0x4d8128[_0x474c('0x50')]===_0x474c('0x4e')){var _0x4beaa2=_0x3ad1cb[_0x474c('0x28')]({'plain':!![]});var _0x40f151=_0x474c('0x29');return db[_0x474c('0x51')][_0x474c('0x52')]({'where':{'name':_0x40f151,'userProfileId':_0x4d8128[_0x474c('0x53')]},'raw':!![]})[_0x474c('0x26')](function(_0x5e53f2){if(_0x5e53f2&&_0x5e53f2[_0x474c('0x54')]===0x0){return db[_0x474c('0x2a')][_0x474c('0x4c')]({'name':_0x4beaa2[_0x474c('0x2d')],'resourceId':_0x4beaa2['id'],'type':_0x5e53f2[_0x474c('0x2d')],'sectionId':_0x5e53f2['id']},{})[_0x474c('0x26')](function(){return _0x3ad1cb;});}else{return _0x3ad1cb;}})[_0x474c('0x45')](function(_0xc25b5c){logger[_0x474c('0x2b')](_0x474c('0x55'),_0xc25b5c);throw _0xc25b5c;});}return _0x3ad1cb;})[_0x474c('0x26')](respondWithResult(_0x36c2b3,0xc9))[_0x474c('0x45')](handleError(_0x36c2b3,null));};exports['update']=function(_0x598df9,_0x153bdc){if(_0x598df9[_0x474c('0x4d')]['id']){delete _0x598df9[_0x474c('0x4d')]['id'];}return db[_0x474c('0x42')][_0x474c('0x52')]({'where':{'id':_0x598df9['params']['id']}})['then'](handleEntityNotFound(_0x153bdc,null))[_0x474c('0x26')](saveUpdates(_0x598df9[_0x474c('0x4d')],null))[_0x474c('0x26')](respondWithResult(_0x153bdc,null))[_0x474c('0x45')](handleError(_0x153bdc,null));};exports['destroy']=function(_0x5d6446,_0x47c28f){return db[_0x474c('0x42')]['find']({'where':{'id':_0x5d6446['params']['id']}})[_0x474c('0x26')](handleEntityNotFound(_0x47c28f,null))[_0x474c('0x26')](removeEntity(_0x47c28f,null))[_0x474c('0x45')](handleError(_0x47c28f,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 4e50f10..775c05e 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 _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0xfc2e62,_0x3bf6cc){var _0x2eefac=function(_0x8f60d2){while(--_0x8f60d2){_0xfc2e62['push'](_0xfc2e62['shift']());}};_0x2eefac(++_0x3bf6cc);}(_0xf494,0x1c6));var _0x4f49=function(_0x2d3934,_0x4588a6){_0x2d3934=_0x2d3934-0x0;var _0xbc87a2=_0xf494[_0x2d3934];return _0xbc87a2;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x1dcb3e,_0x3fed26){var _0x1bbd19=function(_0x186d0e){while(--_0x186d0e){_0x1dcb3e['push'](_0x1dcb3e['shift']());}};_0x1bbd19(++_0x3fed26);}(_0xabce,0x103));var _0xeabc=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xabce[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'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 5d73fed..d58707f 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x16bab6,_0x44b2c2){var _0x36db2e=function(_0xb5193f){while(--_0xb5193f){_0x16bab6['push'](_0x16bab6['shift']());}};_0x36db2e(++_0x44b2c2);}(_0xb10b,0x12a));var _0xbb10=function(_0x4f1c6c,_0x1e8f52){_0x4f1c6c=_0x4f1c6c-0x0;var _0x1d9e2a=_0xb10b[_0x4f1c6c];return _0x1d9e2a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x1a145f,_0x392cea){var _0x9b9395=function(_0x209813){while(--_0x209813){_0x1a145f['push'](_0x1a145f['shift']());}};_0x9b9395(++_0x392cea);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f6629,_0x1b013c){_0x2f6629=_0x2f6629-0x0;var _0x317739=_0xb10b[_0x2f6629];return _0x317739;};'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 8ae8767..86840d5 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 _0x50a6=['../../components/auth/service','../../components/interaction/service','./plugin.controller','index','get','/webhook','webhookGet','/:id','show','isAuthenticated','download','root','originalname','format','%s-%s%s','basename','extname','post','single','file','put','update','delete','exports','multer','util','express','fs-extra'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x50a6,0xa4));var _0x650a=function(_0x1510b9,_0x2b0346){_0x1510b9=_0x1510b9-0x0;var _0x380390=_0x50a6[_0x1510b9];return _0x380390;};'use strict';var multer=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x650a('0x2'));var router=express['Router']();var fs_extra=require(_0x650a('0x3'));var auth=require(_0x650a('0x4'));var interaction=require(_0x650a('0x5'));var config=require('../../config/environment');var controller=require(_0x650a('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x650a('0x7')]);router[_0x650a('0x8')](_0x650a('0x9'),controller[_0x650a('0xa')]);router['get'](_0x650a('0xb'),auth['isAuthenticated'](),controller[_0x650a('0xc')]);router[_0x650a('0x8')]('/:id/download',auth[_0x650a('0xd')](),controller[_0x650a('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3e2406,_0x526881,_0x142cdb){_0x142cdb(null,path['join'](config[_0x650a('0xf')],'server/files/plugins'));},'filename':function(_0x2f8bf8,_0x48077a,_0x33e73d){_0x48077a[_0x650a('0x10')]=_0x48077a[_0x650a('0x10')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x33e73d(null,util[_0x650a('0x11')](_0x650a('0x12'),path[_0x650a('0x13')](_0x48077a[_0x650a('0x10')],path[_0x650a('0x14')](_0x48077a[_0x650a('0x10')])),Date['now'](),path[_0x650a('0x14')](_0x48077a['originalname'])));}})});router[_0x650a('0x15')]('/',upload[_0x650a('0x16')](_0x650a('0x17')),controller['upload']);router['post']('/webhook',controller['webhookPost']);router[_0x650a('0x18')](_0x650a('0xb'),auth[_0x650a('0xd')](),controller[_0x650a('0x19')]);router[_0x650a('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x650a('0x1a')]);module[_0x650a('0x1b')]=router; \ No newline at end of file +var _0xb821=['upload','post','update','delete','exports','util','path','Router','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id','isAuthenticated','show','download','diskStorage','join','root','originalname','replace','basename','extname','single'];(function(_0xe11768,_0x2d767c){var _0x22c6bb=function(_0x5255f8){while(--_0x5255f8){_0xe11768['push'](_0xe11768['shift']());}};_0x22c6bb(++_0x2d767c);}(_0xb821,0xa7));var _0x1b82=function(_0x91aa11,_0x25615f){_0x91aa11=_0x91aa11-0x0;var _0x47bf2e=_0xb821[_0x91aa11];return _0x47bf2e;};'use strict';var multer=require('multer');var util=require(_0x1b82('0x0'));var path=require(_0x1b82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b82('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var controller=require(_0x1b82('0x5'));router[_0x1b82('0x6')]('/',auth['isAuthenticated'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x6')](_0x1b82('0x8'),controller[_0x1b82('0x9')]);router[_0x1b82('0x6')](_0x1b82('0xa'),auth[_0x1b82('0xb')](),controller[_0x1b82('0xc')]);router[_0x1b82('0x6')]('/:id/download',auth[_0x1b82('0xb')](),controller[_0x1b82('0xd')]);var upload=multer({'storage':multer[_0x1b82('0xe')]({'destination':function(_0x14c57a,_0xcffb87,_0x17a96b){_0x17a96b(null,path[_0x1b82('0xf')](config[_0x1b82('0x10')],'server/files/plugins'));},'filename':function(_0x46007e,_0x241d11,_0x2391f5){_0x241d11[_0x1b82('0x11')]=_0x241d11['originalname'][_0x1b82('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2391f5(null,util['format']('%s-%s%s',path[_0x1b82('0x13')](_0x241d11['originalname'],path[_0x1b82('0x14')](_0x241d11[_0x1b82('0x11')])),Date['now'](),path[_0x1b82('0x14')](_0x241d11['originalname'])));}})});router['post']('/',upload[_0x1b82('0x15')]('file'),controller[_0x1b82('0x16')]);router[_0x1b82('0x17')](_0x1b82('0x8'),controller['webhookPost']);router['put'](_0x1b82('0xa'),auth['isAuthenticated'](),controller[_0x1b82('0x18')]);router[_0x1b82('0x19')](_0x1b82('0xa'),auth['isAuthenticated'](),controller[_0x1b82('0x19')]);module[_0x1b82('0x1a')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 3cb3c25..0deee10 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 _0xc4a1=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','TEXT'];(function(_0x2fe8ab,_0x5e8e7b){var _0x3d5a6d=function(_0xf440c5){while(--_0xf440c5){_0x2fe8ab['push'](_0x2fe8ab['shift']());}};_0x3d5a6d(++_0x5e8e7b);}(_0xc4a1,0x104));var _0x1c4a=function(_0x476e1c,_0x431433){_0x476e1c=_0x476e1c-0x0;var _0x4941d3=_0xc4a1[_0x476e1c];return _0x4941d3;};'use strict';var Sequelize=require(_0x1c4a('0x0'));module[_0x1c4a('0x1')]={'name':{'type':Sequelize[_0x1c4a('0x2')]},'type':{'type':Sequelize[_0x1c4a('0x3')](_0x1c4a('0x4'),'script')},'description':{'type':Sequelize[_0x1c4a('0x5')]},'version':{'type':Sequelize[_0x1c4a('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0x1c4a('0x6')},'active':{'type':Sequelize[_0x1c4a('0x7')],'defaultValue':0x0,'comment':_0x1c4a('0x8')},'sidebar':{'type':Sequelize[_0x1c4a('0x3')](_0x1c4a('0x9'),_0x1c4a('0xa'),_0x1c4a('0xb'),_0x1c4a('0xc')),'defaultValue':'always','comment':_0x1c4a('0xd')},'icon':{'type':Sequelize[_0x1c4a('0x2')]},'adminUrl':{'type':Sequelize[_0x1c4a('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x1c4a('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc0ad=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0x15a59e,_0x373e55){var _0x3c8074=function(_0x5502fc){while(--_0x5502fc){_0x15a59e['push'](_0x15a59e['shift']());}};_0x3c8074(++_0x373e55);}(_0xc0ad,0x139));var _0xdc0a=function(_0x1b2e06,_0x4f35ec){_0x1b2e06=_0x1b2e06-0x0;var _0x53bf9d=_0xc0ad[_0x1b2e06];return _0x53bf9d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xdc0a('0x0')]},'type':{'type':Sequelize[_0xdc0a('0x1')]('html',_0xdc0a('0x2'))},'description':{'type':Sequelize[_0xdc0a('0x3')]},'version':{'type':Sequelize[_0xdc0a('0x3')]},'path':{'type':Sequelize['STRING'],'comment':_0xdc0a('0x4')},'active':{'type':Sequelize[_0xdc0a('0x5')],'defaultValue':0x0,'comment':_0xdc0a('0x6')},'sidebar':{'type':Sequelize[_0xdc0a('0x1')]('adminOnly',_0xdc0a('0x7'),_0xdc0a('0x8'),_0xdc0a('0x9')),'defaultValue':_0xdc0a('0x8'),'comment':_0xdc0a('0xa')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xdc0a('0x0')]},'agentUrl':{'type':Sequelize[_0xdc0a('0x0')]},'scriptName':{'type':Sequelize[_0xdc0a('0x0')]},'scriptPath':{'type':Sequelize[_0xdc0a('0x0')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index c46e1df..d3c09aa 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 _0x2f14=['create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','%s%s','headers','content-type','endsWith','statusCode','encoding','method','content-length','rimraf','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','to-csv','papaparse','extract-zip','archiver','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','destroy','then','get','Plugins','UserProfileResource','error','stack','name','map','Plugin','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','find','download','params','join','root','server/files/plugins','format','%s.zip','createWriteStream','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','basename','attachments/**/*','finalize','existsSync','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','readFileSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','Invalid\x20manifest:\x20views\x20missing','admin','agent','script','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','views','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection'];(function(_0x5c5c80,_0x283c70){var _0x4e1c48=function(_0x39f6f6){while(--_0x39f6f6){_0x5c5c80['push'](_0x5c5c80['shift']());}};_0x4e1c48(++_0x283c70);}(_0x2f14,0x1e4));var _0x42f1=function(_0x1e0d27,_0x2bd93b){_0x1e0d27=_0x1e0d27-0x0;var _0x4431e6=_0x2f14[_0x1e0d27];return _0x4431e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x42f1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x42f1('0x1'));var moment=require(_0x42f1('0x2'));var BPromise=require(_0x42f1('0x3'));var Mustache=require('mustache');var util=require(_0x42f1('0x4'));var path=require(_0x42f1('0x5'));var sox=require(_0x42f1('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x42f1('0x7'));var _=require('lodash');var squel=require(_0x42f1('0x8'));var crypto=require(_0x42f1('0x9'));var jsforce=require(_0x42f1('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x42f1('0xb'));var querystring=require('querystring');var Papa=require(_0x42f1('0xc'));var extract=require(_0x42f1('0xd'));var rimraf=require(_0x42f1('0x0'));var archiver=require(_0x42f1('0xe'));var Redis=require(_0x42f1('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x42f1('0x10'));var hardwareService=require(_0x42f1('0x11'));var logger=require(_0x42f1('0x12'))(_0x42f1('0x13'));var utils=require(_0x42f1('0x14'));var config=require(_0x42f1('0x15'));var licenseUtil=require(_0x42f1('0x16'));var db=require(_0x42f1('0x17'))['db'];config['redis']=_[_0x42f1('0x18')](config['redis'],{'host':_0x42f1('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./plugin.socket')[_0x42f1('0x1a')](socket);function respondWithStatusCode(_0x3b3abc,_0x365ae4){_0x365ae4=_0x365ae4||0xcc;return function(_0x32cb83){if(_0x32cb83){return _0x3b3abc[_0x42f1('0x1b')](_0x365ae4);}return _0x3b3abc[_0x42f1('0x1c')](_0x365ae4)[_0x42f1('0x1d')]();};}function respondWithResult(_0x1bffa9,_0x1d467d){_0x1d467d=_0x1d467d||0xc8;return function(_0x5e2bd8){if(_0x5e2bd8){return _0x1bffa9[_0x42f1('0x1c')](_0x1d467d)[_0x42f1('0x1e')](_0x5e2bd8);}};}function respondWithFilteredResult(_0x58a803,_0xa0516d){return function(_0x48f4ba){if(_0x48f4ba){var _0x51846a=typeof _0xa0516d['offset']===_0x42f1('0x1f')&&typeof _0xa0516d[_0x42f1('0x20')]==='undefined';var _0x32adf7=_0x48f4ba[_0x42f1('0x21')];var _0x48342e=_0x51846a?0x0:_0xa0516d[_0x42f1('0x22')];var _0x1474da=_0x51846a?_0x48f4ba['count']:_0xa0516d[_0x42f1('0x22')]+_0xa0516d[_0x42f1('0x20')];var _0x1a9273;if(_0x1474da>=_0x32adf7){_0x1474da=_0x32adf7;_0x1a9273=0xc8;}else{_0x1a9273=0xce;}_0x58a803[_0x42f1('0x1c')](_0x1a9273);return _0x58a803[_0x42f1('0x23')](_0x42f1('0x24'),_0x48342e+'-'+_0x1474da+'/'+_0x32adf7)[_0x42f1('0x1e')](_0x48f4ba);}return null;};}function patchUpdates(_0x47a359){return function(_0x24230a){try{jsonpatch['apply'](_0x24230a,_0x47a359,!![]);}catch(_0x1ee023){return BPromise[_0x42f1('0x25')](_0x1ee023);}return _0x24230a['save']();};}function saveUpdates(_0x389059,_0x12f2ae){return function(_0x375c34){if(_0x375c34){return _0x375c34['update'](_0x389059)['then'](function(_0xf52852){return _0xf52852;});}return null;};}function removeEntity(_0x3fba99,_0x5d14ff){return function(_0x46e20f){if(_0x46e20f){return _0x46e20f[_0x42f1('0x26')]()[_0x42f1('0x27')](function(){var _0xc2ca04=_0x46e20f[_0x42f1('0x28')]({'plain':!![]});var _0x5063ac=_0x42f1('0x29');return db[_0x42f1('0x2a')][_0x42f1('0x26')]({'where':{'type':_0x5063ac,'resourceId':_0xc2ca04['id']}})[_0x42f1('0x27')](function(){return _0x46e20f;});})[_0x42f1('0x27')](function(){_0x3fba99[_0x42f1('0x1c')](0xcc)[_0x42f1('0x1d')]();});}};}function handleEntityNotFound(_0x4ad4c1,_0x5dcc22){return function(_0x17d60e){if(!_0x17d60e){_0x4ad4c1['sendStatus'](0x194);}return _0x17d60e;};}function handleError(_0x19b243,_0x4c4863){_0x4c4863=_0x4c4863||0x1f4;return function(_0x5ab612){logger[_0x42f1('0x2b')](_0x5ab612[_0x42f1('0x2c')]);if(_0x5ab612[_0x42f1('0x2d')]){delete _0x5ab612[_0x42f1('0x2d')];}_0x19b243[_0x42f1('0x1c')](_0x4c4863)['send'](_0x5ab612);};}exports['index']=function(_0x2c7934,_0xf0a54e){var _0x2ecb99={},_0x4cb29c={},_0x51f6c6={'count':0x0,'rows':[]};var _0x581ab6=_[_0x42f1('0x2e')](db[_0x42f1('0x2f')][_0x42f1('0x30')],function(_0x28fef2){return{'name':_0x28fef2[_0x42f1('0x31')],'type':_0x28fef2[_0x42f1('0x32')]['key']};});_0x4cb29c['model']=_[_0x42f1('0x2e')](_0x581ab6,_0x42f1('0x2d'));_0x4cb29c['query']=_[_0x42f1('0x33')](_0x2c7934[_0x42f1('0x34')]);_0x4cb29c[_0x42f1('0x35')]=_[_0x42f1('0x36')](_0x4cb29c[_0x42f1('0x37')],_0x4cb29c[_0x42f1('0x34')]);_0x2ecb99[_0x42f1('0x38')]=_[_0x42f1('0x36')](_0x4cb29c[_0x42f1('0x37')],qs[_0x42f1('0x39')](_0x2c7934[_0x42f1('0x34')][_0x42f1('0x39')]));_0x2ecb99[_0x42f1('0x38')]=_0x2ecb99[_0x42f1('0x38')][_0x42f1('0x3a')]?_0x2ecb99['attributes']:_0x4cb29c[_0x42f1('0x37')];if(!_0x2c7934[_0x42f1('0x34')][_0x42f1('0x3b')](_0x42f1('0x3c'))){_0x2ecb99[_0x42f1('0x20')]=qs[_0x42f1('0x20')](_0x2c7934['query'][_0x42f1('0x20')]);_0x2ecb99['offset']=qs['offset'](_0x2c7934['query'][_0x42f1('0x22')]);}_0x2ecb99[_0x42f1('0x3d')]=qs[_0x42f1('0x3e')](_0x2c7934[_0x42f1('0x34')][_0x42f1('0x3e')]);_0x2ecb99[_0x42f1('0x3f')]=qs[_0x42f1('0x35')](_['pick'](_0x2c7934['query'],_0x4cb29c[_0x42f1('0x35')]),_0x581ab6);if(_0x2c7934['query'][_0x42f1('0x40')]){_0x2ecb99[_0x42f1('0x3f')]=_[_0x42f1('0x41')](_0x2ecb99[_0x42f1('0x3f')],{'$or':_[_0x42f1('0x2e')](_0x581ab6,function(_0x2ae19a){if(_0x2ae19a[_0x42f1('0x32')]!=='VIRTUAL'){var _0x31d8b8={};_0x31d8b8[_0x2ae19a['name']]={'$like':'%'+_0x2c7934['query'][_0x42f1('0x40')]+'%'};return _0x31d8b8;}})});}_0x2ecb99=_[_0x42f1('0x41')]({},_0x2ecb99,_0x2c7934[_0x42f1('0x42')]);var _0x4a4f5c={'where':_0x2ecb99[_0x42f1('0x3f')]};return db[_0x42f1('0x2f')][_0x42f1('0x21')](_0x4a4f5c)[_0x42f1('0x27')](function(_0x37bacc){_0x51f6c6[_0x42f1('0x21')]=_0x37bacc;if(_0x2c7934[_0x42f1('0x34')][_0x42f1('0x43')]){_0x2ecb99[_0x42f1('0x44')]=[{'all':!![]}];}return db['Plugin'][_0x42f1('0x45')](_0x2ecb99);})[_0x42f1('0x27')](function(_0x4315ef){_0x51f6c6['rows']=_0x4315ef;return _0x51f6c6;})[_0x42f1('0x27')](respondWithFilteredResult(_0xf0a54e,_0x2ecb99))[_0x42f1('0x46')](handleError(_0xf0a54e,null));};exports[_0x42f1('0x47')]=function(_0x55392d,_0x90da7e){var _0x47d9e2={'raw':!![],'where':{'id':_0x55392d['params']['id']}},_0x477b7a={};_0x477b7a[_0x42f1('0x37')]=_[_0x42f1('0x33')](db[_0x42f1('0x2f')][_0x42f1('0x30')]);_0x477b7a[_0x42f1('0x34')]=_[_0x42f1('0x33')](_0x55392d[_0x42f1('0x34')]);_0x477b7a[_0x42f1('0x35')]=_[_0x42f1('0x36')](_0x477b7a['model'],_0x477b7a[_0x42f1('0x34')]);_0x47d9e2[_0x42f1('0x38')]=_[_0x42f1('0x36')](_0x477b7a['model'],qs[_0x42f1('0x39')](_0x55392d[_0x42f1('0x34')][_0x42f1('0x39')]));_0x47d9e2['attributes']=_0x47d9e2['attributes'][_0x42f1('0x3a')]?_0x47d9e2[_0x42f1('0x38')]:_0x477b7a[_0x42f1('0x37')];if(_0x55392d['query'][_0x42f1('0x43')]){_0x47d9e2[_0x42f1('0x44')]=[{'all':!![]}];}_0x47d9e2=_['merge']({},_0x47d9e2,_0x55392d[_0x42f1('0x42')]);return db[_0x42f1('0x2f')][_0x42f1('0x48')](_0x47d9e2)[_0x42f1('0x27')](handleEntityNotFound(_0x90da7e,null))[_0x42f1('0x27')](respondWithResult(_0x90da7e,null))[_0x42f1('0x46')](handleError(_0x90da7e,null));};exports[_0x42f1('0x49')]=function(_0x4586bb,_0x2e3c9f,_0x1bdd7f){return db['Plugin'][_0x42f1('0x48')]({'where':{'id':_0x4586bb[_0x42f1('0x4a')]['id']},'attributes':[_0x42f1('0x2d'),_0x42f1('0x5')],'raw':!![]})['then'](handleEntityNotFound(_0x2e3c9f,null))[_0x42f1('0x27')](function(_0x1bd153){if(_0x1bd153){var _0x52c36b=path[_0x42f1('0x4b')](config[_0x42f1('0x4c')],_0x42f1('0x4d'),util[_0x42f1('0x4e')](_0x42f1('0x4f'),path['basename'](_0x1bd153[_0x42f1('0x5')])));var _0x1af4bb=fs[_0x42f1('0x50')](_0x52c36b);var _0x2608db=archiver('zip',{'zlib':{'level':0x9}});_0x2608db['on'](_0x42f1('0x51'),function(_0x4f91ac){if(_0x4f91ac['code']===_0x42f1('0x52')){logger[_0x42f1('0x2b')](_0x4f91ac);}else{throw new db[(_0x42f1('0x53'))][(_0x42f1('0x54'))](_0x42f1('0x55'));}});_0x2608db['on'](_0x42f1('0x2b'),function(_0x55b071){throw new db['Sequelize'][(_0x42f1('0x54'))](_0x42f1('0x55'));});_0x2608db[_0x42f1('0x56')](_0x1af4bb);_0x2608db[_0x42f1('0x57')]('**/*',{'cwd':path['join'](config[_0x42f1('0x4c')],_0x42f1('0x4d'),path['dirname'](_0x1bd153[_0x42f1('0x5')])),'ignore':[path[_0x42f1('0x4b')](path['basename'](_0x1bd153[_0x42f1('0x5')]),'node_modules/**/*'),path[_0x42f1('0x4b')](path[_0x42f1('0x58')](_0x1bd153['path']),_0x42f1('0x59'))],'nodir':!![]})[_0x42f1('0x5a')]();_0x1af4bb['on']('close',function(){if(!fs[_0x42f1('0x5b')](_0x52c36b)){throw new db[(_0x42f1('0x53'))][(_0x42f1('0x54'))]('Plugin\x20not\x20found');}return _0x2e3c9f[_0x42f1('0x49')](_0x52c36b,util[_0x42f1('0x4e')](_0x42f1('0x4f'),path[_0x42f1('0x58')](_0x1bd153['path'])),function(_0x287b9c){if(_0x287b9c){throw new db[(_0x42f1('0x53'))][(_0x42f1('0x54'))](_0x42f1('0x5c'));}fs[_0x42f1('0x5d')](_0x52c36b);logger[_0x42f1('0x5e')](_0x42f1('0x5f'));logger[_0x42f1('0x5e')](_0x42f1('0x60'));});});}return null;})['catch'](handleError(_0x2e3c9f,null));};exports[_0x42f1('0x61')]=function(_0x125ee7,_0x473c84,_0x29dae4){var _0xe9352a=path[_0x42f1('0x58')](_0x125ee7[_0x42f1('0x62')][_0x42f1('0x63')],path[_0x42f1('0x64')](_0x125ee7[_0x42f1('0x62')][_0x42f1('0x63')]));var _0x146d1e=path[_0x42f1('0x4b')](config[_0x42f1('0x4c')],_0x42f1('0x4d'),_0x125ee7[_0x42f1('0x62')][_0x42f1('0x63')]);var _0x3a791c=path[_0x42f1('0x4b')](config[_0x42f1('0x4c')],'server/files/plugins',_0xe9352a);logger[_0x42f1('0x5e')](_0x42f1('0x65'),_0x146d1e);logger['info'](_0x42f1('0x66'),_0x3a791c);try{fs['chmodSync'](_0x146d1e,parseInt(_0x42f1('0x67'),0x8));extract(_0x146d1e,{'dir':_0x3a791c},function(_0x39d673){if(_0x39d673){logger[_0x42f1('0x2b')](_0x39d673);handleError(_0x39d673,!![]);};var _0x53e542=fs[_0x42f1('0x68')](_0x3a791c);if(_0x53e542[_0x42f1('0x3a')]>0x1){removeReferences(_0x146d1e,_0x3a791c);logger[_0x42f1('0x2b')](_0x42f1('0x69'));return _0x29dae4(new Error('Invalid\x20plugin\x20structure'));}var _0x370090=fs['lstatSync'](path[_0x42f1('0x4b')](_0x3a791c,_0x53e542[0x0]));if(_0x370090[_0x42f1('0x6a')]()){removeReferences(_0x146d1e,_0x3a791c);logger[_0x42f1('0x2b')]('Invalid\x20plugin\x20structure');return _0x29dae4(new Error('Invalid\x20plugin\x20structure'));}if(_0x370090[_0x42f1('0x6b')]()){var _0xc29fa4=fs[_0x42f1('0x68')](path['join'](_0x3a791c,_0x53e542[0x0]));if(_0xc29fa4['length']===0x0){removeReferences(_0x146d1e,_0x3a791c);logger['error']('Invalid\x20plugin\x20structure');return _0x29dae4(new Error(_0x42f1('0x69')));}var _0x411c71=_0xc29fa4['some'](function(_0x2ce1bd){return _0x2ce1bd==='manifest.json';});if(!_0x411c71){return _0x29dae4(new Error('Plugin\x20manifest\x20missing'));}var _0x2db031=fs[_0x42f1('0x6c')](path[_0x42f1('0x4b')](_0x3a791c,_0x53e542[0x0],_0x42f1('0x6d')));var _0x139c65=JSON['parse'](_0x2db031);if(_0x42f1('0x1f')==typeof _0x139c65[_0x42f1('0x2d')]){return _0x29dae4(new Error(_0x42f1('0x6e')));}if(_0x42f1('0x1f')==typeof _0x139c65[_0x42f1('0x32')]){return _0x29dae4(new Error(_0x42f1('0x6f')));}if(_0x42f1('0x1f')==typeof _0x139c65[_0x42f1('0x70')]){return _0x29dae4(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x139c65['parameters']){return _0x29dae4(new Error(_0x42f1('0x71')));}if(_0x139c65[_0x42f1('0x32')]===_0x42f1('0x72')){if(_0x42f1('0x1f')==typeof _0x139c65[_0x42f1('0x73')]['views']){return _0x29dae4(new Error(_0x42f1('0x74')));}if(_0x42f1('0x1f')==typeof _0x139c65['parameters']['views'][_0x42f1('0x75')]&&'undefined'==typeof _0x139c65[_0x42f1('0x73')]['views'][_0x42f1('0x76')]){return _0x29dae4(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x139c65[_0x42f1('0x32')]===_0x42f1('0x77')){if(_0x42f1('0x1f')==typeof _0x139c65[_0x42f1('0x73')]['scriptName']){return _0x29dae4(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x42f1('0x1f')==typeof _0x139c65['parameters'][_0x42f1('0x78')]){return _0x29dae4(new Error(_0x42f1('0x79')));}}else{return _0x29dae4(new Error(_0x42f1('0x7a')));}var _0x1d6fd8=_0x139c65[_0x42f1('0x2d')];var _0x647b0d=_0x139c65[_0x42f1('0x7b')];var _0xda52dd=_0x139c65[_0x42f1('0x32')];var _0x475cab=_0x139c65[_0x42f1('0x7c')]?_0x139c65[_0x42f1('0x7c')]:_0x42f1('0x7d');var _0xd5bc1e=_0x139c65[_0x42f1('0x7e')]?_0x139c65[_0x42f1('0x7e')]:'icon-apps';var _0x121818='';var _0x2236f9='';var _0x478518='';var _0x3589fe='';var _0x2ec4c1=_0x139c65[_0x42f1('0x70')];if(_0xda52dd==='html'){if('undefined'!=typeof _0x139c65['parameters'][_0x42f1('0x7f')][_0x42f1('0x75')]){var _0x48c355=_0x139c65[_0x42f1('0x73')][_0x42f1('0x7f')][_0x42f1('0x75')];if(!/^(f|ht)tps?:\/\//i[_0x42f1('0x80')](_0x48c355)){_0x121818=path[_0x42f1('0x4b')](_0x42f1('0x81'),_0xe9352a,_0x53e542[0x0],_0x48c355);}else{_0x121818=_0x48c355;}}else{logger[_0x42f1('0x5e')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x42f1('0x1f')!=typeof _0x139c65['parameters']['views']['agent']){var _0x13f59f=_0x139c65['parameters']['views']['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x13f59f)){_0x2236f9=path[_0x42f1('0x4b')](_0x42f1('0x81'),_0xe9352a,_0x53e542[0x0],_0x13f59f);}else{_0x2236f9=_0x13f59f;}}else{logger[_0x42f1('0x5e')](_0x42f1('0x82'));}}else if(_0xda52dd===_0x42f1('0x77')){_0x478518=_0x139c65[_0x42f1('0x73')][_0x42f1('0x83')];_0x3589fe=_0x139c65[_0x42f1('0x73')][_0x42f1('0x78')];if(_0x42f1('0x1f')!=typeof _0x139c65['parameters']['views']){if(_0x42f1('0x1f')!=typeof _0x139c65['parameters'][_0x42f1('0x7f')][_0x42f1('0x75')]){var _0x48c355=_0x139c65['parameters'][_0x42f1('0x7f')][_0x42f1('0x75')];if(!/^(f|ht)tps?:\/\//i['test'](_0x48c355)){_0x121818=path['join'](_0x42f1('0x81'),_0xe9352a,_0x53e542[0x0],_0x48c355);}else{_0x121818=_0x48c355;}}if('undefined'!=typeof _0x139c65[_0x42f1('0x73')][_0x42f1('0x7f')][_0x42f1('0x76')]){var _0x13f59f=_0x139c65['parameters']['views'][_0x42f1('0x76')];if(!/^(f|ht)tps?:\/\//i[_0x42f1('0x80')](_0x13f59f)){_0x2236f9=path[_0x42f1('0x4b')](_0x42f1('0x81'),_0xe9352a,_0x53e542[0x0],_0x13f59f);}else{_0x2236f9=_0x13f59f;}}}}var _0x50c3ea={'name':_0x1d6fd8,'description':_0x647b0d,'path':path[_0x42f1('0x4b')](_0xe9352a,_0x53e542[0x0]),'type':_0xda52dd,'sidebar':_0x475cab,'icon':_0xd5bc1e,'adminUrl':_0x121818,'agentUrl':_0x2236f9,'scriptName':_0x478518,'scriptPath':_0x3589fe,'version':_0x2ec4c1};removeReferences(_0x146d1e,null);return db[_0x42f1('0x2f')]['create'](_0x50c3ea)[_0x42f1('0x27')](function(_0x2780a5){var _0xea2400={'role':_0x125ee7[_0x42f1('0x84')]['role'],'userProfileId':_0x125ee7['body']['userProfileId']};if(!_0xea2400)throw new Error(_0x42f1('0x85'));if(_0xea2400['role']===_0x42f1('0x86')){var _0x4814dc=_0x2780a5['get']({'plain':!![]});return db[_0x42f1('0x87')][_0x42f1('0x48')]({'where':{'name':'Plugins','userProfileId':_0xea2400['userProfileId']},'raw':!![]})[_0x42f1('0x27')](function(_0x177328){if(_0x177328&&_0x177328['autoAssociation']===0x0){return db[_0x42f1('0x2a')][_0x42f1('0x88')]({'name':_0x4814dc[_0x42f1('0x2d')],'resourceId':_0x4814dc['id'],'type':_0x177328[_0x42f1('0x2d')],'sectionId':_0x177328['id']},{})[_0x42f1('0x27')](function(){return _0x2780a5;});}else{return _0x2780a5;}})[_0x42f1('0x46')](function(_0x53ddb0){logger[_0x42f1('0x2b')](_0x42f1('0x89'),_0x53ddb0);throw _0x53ddb0;});}return _0x2780a5;})[_0x42f1('0x27')](respondWithResult(_0x473c84,null))[_0x42f1('0x46')](handleError(_0x473c84,null));}});}catch(_0x13ecf8){_0x473c84[_0x42f1('0x1c')](0x1f4)[_0x42f1('0x8a')](_0x13ecf8);}};function removeReferences(_0x11ab2e,_0x5a2952){try{if(_0x11ab2e){fs[_0x42f1('0x5d')](_0x11ab2e);logger[_0x42f1('0x5e')](_0x42f1('0x8b'));}if(_0x5a2952){rimraf(_0x5a2952,function(){});logger['info'](_0x42f1('0x8c'));}}catch(_0x3b3daa){logger[_0x42f1('0x2b')](_0x3b3daa);}}exports[_0x42f1('0x8d')]=function(_0xb1c2a0,_0xc7f405,_0x1c78de){return db[_0x42f1('0x2f')][_0x42f1('0x48')]({'where':{'id':_0xb1c2a0[_0x42f1('0x4a')]['id']}})[_0x42f1('0x27')](handleEntityNotFound(_0xc7f405,null))[_0x42f1('0x27')](saveUpdates(_0xb1c2a0[_0x42f1('0x84')],null))[_0x42f1('0x27')](respondWithResult(_0xc7f405,null))[_0x42f1('0x46')](handleError(_0xc7f405,null));};exports['delete']=function(_0x22dfcd,_0x362ca2,_0x4847f9){return db[_0x42f1('0x2f')][_0x42f1('0x48')]({'where':{'id':_0x22dfcd[_0x42f1('0x4a')]['id']}})[_0x42f1('0x27')](function(_0x17ccba){if(_0x17ccba){return _0x17ccba[_0x42f1('0x26')]();}})[_0x42f1('0x27')](function(_0x251473){rimraf(path[_0x42f1('0x4b')](config[_0x42f1('0x4c')],_0x42f1('0x4d'),path['dirname'](_0x251473[_0x42f1('0x5')])),function(){});return _0x251473;})[_0x42f1('0x27')](handleEntityNotFound(_0x362ca2,null))[_0x42f1('0x27')](respondWithStatusCode(_0x362ca2,null))[_0x42f1('0x46')](handleError(_0x362ca2,null));};exports['webhookGet']=function(_0x2f36e9,_0x4d9945,_0x12a1d7){return BPromise[_0x42f1('0x8e')]()['then'](function(){if(!_0x2f36e9[_0x42f1('0x34')][_0x42f1('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2f36e9[_0x42f1('0x34')][_0x42f1('0x8f')]){throw new Error(_0x42f1('0x90'));}var _0x2602ef=_0x2f36e9[_0x42f1('0x34')]['hostname']?_0x2f36e9[_0x42f1('0x34')][_0x42f1('0x91')]+':'+_0x2f36e9[_0x42f1('0x34')][_0x42f1('0x8f')]:_0x42f1('0x92')+_0x2f36e9[_0x42f1('0x34')][_0x42f1('0x8f')];var _0x87675e=_0x2f36e9[_0x42f1('0x34')][_0x42f1('0x1e')]?_0x2f36e9['query'][_0x42f1('0x1e')]:!![];var _0xb51e1=_0x2f36e9[_0x42f1('0x34')]['encoding']?_0x2f36e9['query']['encoding']:null;var _0x563fd5={'method':_0x2f36e9['method'],'uri':util[_0x42f1('0x4e')](_0x42f1('0x93'),_0x2602ef,_0x2f36e9['query'][_0x42f1('0x5')]),'json':_0x87675e,'resolveWithFullResponse':!![],'encoding':_0xb51e1,'qs':_0x2f36e9[_0x42f1('0x34')]};if(_0x2f36e9[_0x42f1('0x94')]){_0x563fd5['headers']=_0x2f36e9['headers'];if(_0x563fd5[_0x42f1('0x94')]['content-length']){delete _0x563fd5[_0x42f1('0x94')]['content-length'];}}if(_0x563fd5[_0x42f1('0x94')][_0x42f1('0x95')]){delete _0x563fd5[_0x42f1('0x94')]['content-type'];}return rp(_0x563fd5);})[_0x42f1('0x27')](function(_0x5ff41b){if(_0x5ff41b){_0x4d9945[_0x42f1('0x23')](_0x5ff41b[_0x42f1('0x94')]);logger[_0x42f1('0x5e')](_0x5ff41b[_0x42f1('0x84')]);if(_[_0x42f1('0x96')](_0x2f36e9[_0x42f1('0x34')][_0x42f1('0x5')],'download')&&_0x5ff41b[_0x42f1('0x97')]==0x1f4){return _0x4d9945[_0x42f1('0x1b')](_0x5ff41b[_0x42f1('0x97')]);}else{return _0x4d9945[_0x42f1('0x1c')](_0x5ff41b[_0x42f1('0x97')])[_0x42f1('0x8a')](_0x5ff41b['body']);}}else{return _0x4d9945[_0x42f1('0x1b')](0xc8);}})[_0x42f1('0x46')](handleError(_0x4d9945,null));};exports['webhookPost']=function(_0x542ca7,_0x3cd6f6,_0x16ae2f){return BPromise[_0x42f1('0x8e')]()['then'](function(){if(!_0x542ca7[_0x42f1('0x34')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x542ca7[_0x42f1('0x34')][_0x42f1('0x8f')]){throw new Error(_0x42f1('0x90'));}var _0x3369b0=_0x542ca7[_0x42f1('0x34')]['hostname']?_0x542ca7[_0x42f1('0x34')][_0x42f1('0x91')]+':'+_0x542ca7['query'][_0x42f1('0x8f')]:_0x42f1('0x92')+_0x542ca7[_0x42f1('0x34')][_0x42f1('0x8f')];var _0x5e4d19=_0x542ca7[_0x42f1('0x34')]['json']?_0x542ca7['query']['json']:!![];var _0x247832=_0x542ca7[_0x42f1('0x34')][_0x42f1('0x98')]?_0x542ca7[_0x42f1('0x34')][_0x42f1('0x98')]:null;var _0x908b61={'method':_0x542ca7[_0x42f1('0x99')],'uri':util['format']('%s%s',_0x3369b0,_0x542ca7[_0x42f1('0x34')][_0x42f1('0x5')]),'json':_0x5e4d19,'resolveWithFullResponse':!![],'encoding':_0x247832,'body':_0x542ca7[_0x42f1('0x84')]};if(_0x542ca7['headers']){_0x908b61['headers']=_0x542ca7[_0x42f1('0x94')];if(_0x908b61[_0x42f1('0x94')][_0x42f1('0x9a')]){delete _0x908b61['headers'][_0x42f1('0x9a')];}}if(_0x908b61['headers'][_0x42f1('0x95')]){delete _0x908b61['headers'][_0x42f1('0x95')];}return rp(_0x908b61);})['then'](function(_0x43d5ca){if(_0x43d5ca){_0x3cd6f6['set'](_0x43d5ca[_0x42f1('0x94')]);logger[_0x42f1('0x5e')](_0x43d5ca[_0x42f1('0x84')]);return _0x3cd6f6[_0x42f1('0x1c')](_0x43d5ca[_0x42f1('0x97')])[_0x42f1('0x8a')](_0x43d5ca[_0x42f1('0x84')]);}else{return _0x3cd6f6[_0x42f1('0x1b')](0xc8);}})[_0x42f1('0x46')](handleError(_0x3cd6f6,null));}; \ No newline at end of file +var _0xaa43=['undefined','limit','count','Content-Range','json','reject','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','options','find','path','join','root','server/files/plugins','format','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','download','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','upload','extname','file','filename','0777','readdirSync','lstatSync','isFile','Invalid\x20plugin\x20structure','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','agent','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','sidebar','always','icon','icon-apps','admin','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','statusCode','webhookPost','eml-format','rimraf','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','extract-zip','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','offset'];(function(_0x3355ab,_0x5349d9){var _0x129314=function(_0x69d39d){while(--_0x69d39d){_0x3355ab['push'](_0x3355ab['shift']());}};_0x129314(++_0x5349d9);}(_0xaa43,0x1ce));var _0x3aa4=function(_0x1d517e,_0x5aa969){_0x1d517e=_0x1d517e-0x0;var _0x26a2ea=_0xaa43[_0x1d517e];return _0x26a2ea;};'use strict';var emlformat=require(_0x3aa4('0x0'));var rimraf=require(_0x3aa4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3aa4('0x2'));var moment=require('moment');var BPromise=require(_0x3aa4('0x3'));var Mustache=require('mustache');var util=require(_0x3aa4('0x4'));var path=require('path');var sox=require(_0x3aa4('0x5'));var csv=require(_0x3aa4('0x6'));var ejs=require(_0x3aa4('0x7'));var fs=require('fs');var fs_extra=require(_0x3aa4('0x8'));var _=require(_0x3aa4('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3aa4('0xa'));var toCsv=require(_0x3aa4('0x6'));var querystring=require('querystring');var Papa=require(_0x3aa4('0xb'));var extract=require(_0x3aa4('0xc'));var rimraf=require(_0x3aa4('0x1'));var archiver=require('archiver');var Redis=require('ioredis');var authService=require(_0x3aa4('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3aa4('0xe'));var logger=require(_0x3aa4('0xf'))(_0x3aa4('0x10'));var utils=require(_0x3aa4('0x11'));var config=require(_0x3aa4('0x12'));var licenseUtil=require(_0x3aa4('0x13'));var db=require(_0x3aa4('0x14'))['db'];config[_0x3aa4('0x15')]=_['defaults'](config['redis'],{'host':_0x3aa4('0x16'),'port':0x18eb});var socket=require(_0x3aa4('0x17'))(new Redis(config[_0x3aa4('0x15')]));require(_0x3aa4('0x18'))[_0x3aa4('0x19')](socket);function respondWithStatusCode(_0x3aef0b,_0x1c3bba){_0x1c3bba=_0x1c3bba||0xcc;return function(_0x5f4626){if(_0x5f4626){return _0x3aef0b[_0x3aa4('0x1a')](_0x1c3bba);}return _0x3aef0b['status'](_0x1c3bba)[_0x3aa4('0x1b')]();};}function respondWithResult(_0x3b8098,_0x4e763b){_0x4e763b=_0x4e763b||0xc8;return function(_0x3ebcf3){if(_0x3ebcf3){return _0x3b8098[_0x3aa4('0x1c')](_0x4e763b)['json'](_0x3ebcf3);}};}function respondWithFilteredResult(_0x20ab05,_0x294e77){return function(_0x3e6538){if(_0x3e6538){var _0x408b25=typeof _0x294e77[_0x3aa4('0x1d')]===_0x3aa4('0x1e')&&typeof _0x294e77[_0x3aa4('0x1f')]===_0x3aa4('0x1e');var _0x17a454=_0x3e6538[_0x3aa4('0x20')];var _0x67810c=_0x408b25?0x0:_0x294e77['offset'];var _0x18ee64=_0x408b25?_0x3e6538[_0x3aa4('0x20')]:_0x294e77[_0x3aa4('0x1d')]+_0x294e77[_0x3aa4('0x1f')];var _0x233fd4;if(_0x18ee64>=_0x17a454){_0x18ee64=_0x17a454;_0x233fd4=0xc8;}else{_0x233fd4=0xce;}_0x20ab05[_0x3aa4('0x1c')](_0x233fd4);return _0x20ab05['set'](_0x3aa4('0x21'),_0x67810c+'-'+_0x18ee64+'/'+_0x17a454)[_0x3aa4('0x22')](_0x3e6538);}return null;};}function patchUpdates(_0x55cad9){return function(_0x3c2d29){try{jsonpatch['apply'](_0x3c2d29,_0x55cad9,!![]);}catch(_0x491cf6){return BPromise[_0x3aa4('0x23')](_0x491cf6);}return _0x3c2d29['save']();};}function saveUpdates(_0x5df44c,_0x55561a){return function(_0x139cf7){if(_0x139cf7){return _0x139cf7[_0x3aa4('0x24')](_0x5df44c)[_0x3aa4('0x25')](function(_0x2690f9){return _0x2690f9;});}return null;};}function removeEntity(_0x2105c6,_0x3e88ea){return function(_0xb64bf6){if(_0xb64bf6){return _0xb64bf6[_0x3aa4('0x26')]()['then'](function(){var _0x5ce50e=_0xb64bf6['get']({'plain':!![]});var _0x4cafce='Plugins';return db[_0x3aa4('0x27')][_0x3aa4('0x26')]({'where':{'type':_0x4cafce,'resourceId':_0x5ce50e['id']}})['then'](function(){return _0xb64bf6;});})[_0x3aa4('0x25')](function(){_0x2105c6[_0x3aa4('0x1c')](0xcc)[_0x3aa4('0x1b')]();});}};}function handleEntityNotFound(_0x134001,_0x1c8ba2){return function(_0x13ee9b){if(!_0x13ee9b){_0x134001[_0x3aa4('0x1a')](0x194);}return _0x13ee9b;};}function handleError(_0x1b8808,_0x57d003){_0x57d003=_0x57d003||0x1f4;return function(_0x1cb4b6){logger[_0x3aa4('0x28')](_0x1cb4b6[_0x3aa4('0x29')]);if(_0x1cb4b6['name']){delete _0x1cb4b6[_0x3aa4('0x2a')];}_0x1b8808['status'](_0x57d003)[_0x3aa4('0x2b')](_0x1cb4b6);};}exports[_0x3aa4('0x2c')]=function(_0x5f3125,_0x2ca31a){var _0x5ee2ba={},_0x241b8e={},_0x16718a={'count':0x0,'rows':[]};var _0x16276d=_[_0x3aa4('0x2d')](db[_0x3aa4('0x2e')][_0x3aa4('0x2f')],function(_0x445a8a){return{'name':_0x445a8a[_0x3aa4('0x30')],'type':_0x445a8a[_0x3aa4('0x31')]['key']};});_0x241b8e['model']=_[_0x3aa4('0x2d')](_0x16276d,_0x3aa4('0x2a'));_0x241b8e[_0x3aa4('0x32')]=_['keys'](_0x5f3125['query']);_0x241b8e[_0x3aa4('0x33')]=_[_0x3aa4('0x34')](_0x241b8e[_0x3aa4('0x35')],_0x241b8e[_0x3aa4('0x32')]);_0x5ee2ba[_0x3aa4('0x36')]=_[_0x3aa4('0x34')](_0x241b8e[_0x3aa4('0x35')],qs[_0x3aa4('0x37')](_0x5f3125['query']['fields']));_0x5ee2ba['attributes']=_0x5ee2ba['attributes'][_0x3aa4('0x38')]?_0x5ee2ba[_0x3aa4('0x36')]:_0x241b8e[_0x3aa4('0x35')];if(!_0x5f3125[_0x3aa4('0x32')][_0x3aa4('0x39')](_0x3aa4('0x3a'))){_0x5ee2ba[_0x3aa4('0x1f')]=qs[_0x3aa4('0x1f')](_0x5f3125['query'][_0x3aa4('0x1f')]);_0x5ee2ba[_0x3aa4('0x1d')]=qs[_0x3aa4('0x1d')](_0x5f3125[_0x3aa4('0x32')]['offset']);}_0x5ee2ba[_0x3aa4('0x3b')]=qs[_0x3aa4('0x3c')](_0x5f3125[_0x3aa4('0x32')][_0x3aa4('0x3c')]);_0x5ee2ba[_0x3aa4('0x3d')]=qs[_0x3aa4('0x33')](_[_0x3aa4('0x3e')](_0x5f3125['query'],_0x241b8e[_0x3aa4('0x33')]),_0x16276d);if(_0x5f3125[_0x3aa4('0x32')][_0x3aa4('0x3f')]){_0x5ee2ba[_0x3aa4('0x3d')]=_[_0x3aa4('0x40')](_0x5ee2ba['where'],{'$or':_['map'](_0x16276d,function(_0x579822){if(_0x579822[_0x3aa4('0x31')]!==_0x3aa4('0x41')){var _0x2adc6c={};_0x2adc6c[_0x579822[_0x3aa4('0x2a')]]={'$like':'%'+_0x5f3125[_0x3aa4('0x32')][_0x3aa4('0x3f')]+'%'};return _0x2adc6c;}})});}_0x5ee2ba=_[_0x3aa4('0x40')]({},_0x5ee2ba,_0x5f3125['options']);var _0x3032ff={'where':_0x5ee2ba[_0x3aa4('0x3d')]};return db[_0x3aa4('0x2e')]['count'](_0x3032ff)[_0x3aa4('0x25')](function(_0x322cfd){_0x16718a[_0x3aa4('0x20')]=_0x322cfd;if(_0x5f3125[_0x3aa4('0x32')][_0x3aa4('0x42')]){_0x5ee2ba[_0x3aa4('0x43')]=[{'all':!![]}];}return db[_0x3aa4('0x2e')][_0x3aa4('0x44')](_0x5ee2ba);})[_0x3aa4('0x25')](function(_0xc16a9d){_0x16718a['rows']=_0xc16a9d;return _0x16718a;})['then'](respondWithFilteredResult(_0x2ca31a,_0x5ee2ba))[_0x3aa4('0x45')](handleError(_0x2ca31a,null));};exports[_0x3aa4('0x46')]=function(_0x513042,_0x5b8a4f){var _0xb80b5f={'raw':!![],'where':{'id':_0x513042[_0x3aa4('0x47')]['id']}},_0x4c08a9={};_0x4c08a9[_0x3aa4('0x35')]=_[_0x3aa4('0x48')](db[_0x3aa4('0x2e')][_0x3aa4('0x2f')]);_0x4c08a9['query']=_[_0x3aa4('0x48')](_0x513042[_0x3aa4('0x32')]);_0x4c08a9['filters']=_[_0x3aa4('0x34')](_0x4c08a9[_0x3aa4('0x35')],_0x4c08a9[_0x3aa4('0x32')]);_0xb80b5f[_0x3aa4('0x36')]=_[_0x3aa4('0x34')](_0x4c08a9[_0x3aa4('0x35')],qs[_0x3aa4('0x37')](_0x513042['query']['fields']));_0xb80b5f[_0x3aa4('0x36')]=_0xb80b5f[_0x3aa4('0x36')][_0x3aa4('0x38')]?_0xb80b5f['attributes']:_0x4c08a9[_0x3aa4('0x35')];if(_0x513042[_0x3aa4('0x32')][_0x3aa4('0x42')]){_0xb80b5f[_0x3aa4('0x43')]=[{'all':!![]}];}_0xb80b5f=_[_0x3aa4('0x40')]({},_0xb80b5f,_0x513042[_0x3aa4('0x49')]);return db[_0x3aa4('0x2e')][_0x3aa4('0x4a')](_0xb80b5f)[_0x3aa4('0x25')](handleEntityNotFound(_0x5b8a4f,null))[_0x3aa4('0x25')](respondWithResult(_0x5b8a4f,null))[_0x3aa4('0x45')](handleError(_0x5b8a4f,null));};exports['download']=function(_0x579dac,_0x39376a,_0xba853a){return db[_0x3aa4('0x2e')]['find']({'where':{'id':_0x579dac[_0x3aa4('0x47')]['id']},'attributes':[_0x3aa4('0x2a'),_0x3aa4('0x4b')],'raw':!![]})[_0x3aa4('0x25')](handleEntityNotFound(_0x39376a,null))[_0x3aa4('0x25')](function(_0xcd2e63){if(_0xcd2e63){var _0x34d499=path[_0x3aa4('0x4c')](config[_0x3aa4('0x4d')],_0x3aa4('0x4e'),util[_0x3aa4('0x4f')]('%s.zip',path[_0x3aa4('0x50')](_0xcd2e63[_0x3aa4('0x4b')])));var _0x3ab2a6=fs[_0x3aa4('0x51')](_0x34d499);var _0x2c9465=archiver(_0x3aa4('0x52'),{'zlib':{'level':0x9}});_0x2c9465['on'](_0x3aa4('0x53'),function(_0x4bb534){if(_0x4bb534[_0x3aa4('0x54')]===_0x3aa4('0x55')){logger[_0x3aa4('0x28')](_0x4bb534);}else{throw new db[(_0x3aa4('0x56'))][(_0x3aa4('0x57'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x2c9465['on'](_0x3aa4('0x28'),function(_0x4524a5){throw new db['Sequelize'][(_0x3aa4('0x57'))](_0x3aa4('0x58'));});_0x2c9465[_0x3aa4('0x59')](_0x3ab2a6);_0x2c9465['glob'](_0x3aa4('0x5a'),{'cwd':path[_0x3aa4('0x4c')](config[_0x3aa4('0x4d')],_0x3aa4('0x4e'),path[_0x3aa4('0x5b')](_0xcd2e63[_0x3aa4('0x4b')])),'ignore':[path[_0x3aa4('0x4c')](path[_0x3aa4('0x50')](_0xcd2e63[_0x3aa4('0x4b')]),_0x3aa4('0x5c')),path[_0x3aa4('0x4c')](path[_0x3aa4('0x50')](_0xcd2e63[_0x3aa4('0x4b')]),_0x3aa4('0x5d'))],'nodir':!![]})[_0x3aa4('0x5e')]();_0x3ab2a6['on'](_0x3aa4('0x5f'),function(){if(!fs['existsSync'](_0x34d499)){throw new db[(_0x3aa4('0x56'))][(_0x3aa4('0x57'))]('Plugin\x20not\x20found');}return _0x39376a[_0x3aa4('0x60')](_0x34d499,util[_0x3aa4('0x4f')](_0x3aa4('0x61'),path['basename'](_0xcd2e63[_0x3aa4('0x4b')])),function(_0xc32884){if(_0xc32884){throw new db[(_0x3aa4('0x56'))][(_0x3aa4('0x57'))](_0x3aa4('0x62'));}fs[_0x3aa4('0x63')](_0x34d499);logger['info'](_0x3aa4('0x64'));logger[_0x3aa4('0x65')](_0x3aa4('0x66'));});});}return null;})[_0x3aa4('0x45')](handleError(_0x39376a,null));};exports[_0x3aa4('0x67')]=function(_0x263227,_0xfe78fb,_0x14106d){var _0x1a5575=path['basename'](_0x263227['file']['filename'],path[_0x3aa4('0x68')](_0x263227[_0x3aa4('0x69')][_0x3aa4('0x6a')]));var _0x4bbf83=path['join'](config[_0x3aa4('0x4d')],_0x3aa4('0x4e'),_0x263227[_0x3aa4('0x69')]['filename']);var _0x1e7cda=path[_0x3aa4('0x4c')](config[_0x3aa4('0x4d')],'server/files/plugins',_0x1a5575);logger[_0x3aa4('0x65')]('Plugin\x20upload\x20filepath:\x20%s',_0x4bbf83);logger[_0x3aa4('0x65')]('Plugin\x20upload\x20destination:\x20%s',_0x1e7cda);try{fs['chmodSync'](_0x4bbf83,parseInt(_0x3aa4('0x6b'),0x8));extract(_0x4bbf83,{'dir':_0x1e7cda},function(_0x4f2dfb){if(_0x4f2dfb){logger[_0x3aa4('0x28')](_0x4f2dfb);handleError(_0x4f2dfb,!![]);};var _0x1c94f3=fs[_0x3aa4('0x6c')](_0x1e7cda);if(_0x1c94f3[_0x3aa4('0x38')]>0x1){removeReferences(_0x4bbf83,_0x1e7cda);logger[_0x3aa4('0x28')]('Invalid\x20plugin\x20structure');return _0x14106d(new Error('Invalid\x20plugin\x20structure'));}var _0x5d43c2=fs[_0x3aa4('0x6d')](path[_0x3aa4('0x4c')](_0x1e7cda,_0x1c94f3[0x0]));if(_0x5d43c2[_0x3aa4('0x6e')]()){removeReferences(_0x4bbf83,_0x1e7cda);logger['error']('Invalid\x20plugin\x20structure');return _0x14106d(new Error('Invalid\x20plugin\x20structure'));}if(_0x5d43c2['isDirectory']()){var _0x2533a9=fs['readdirSync'](path['join'](_0x1e7cda,_0x1c94f3[0x0]));if(_0x2533a9['length']===0x0){removeReferences(_0x4bbf83,_0x1e7cda);logger['error'](_0x3aa4('0x6f'));return _0x14106d(new Error('Invalid\x20plugin\x20structure'));}var _0x599a59=_0x2533a9['some'](function(_0x2dc013){return _0x2dc013==='manifest.json';});if(!_0x599a59){return _0x14106d(new Error(_0x3aa4('0x70')));}var _0x45bcc3=fs[_0x3aa4('0x71')](path[_0x3aa4('0x4c')](_0x1e7cda,_0x1c94f3[0x0],_0x3aa4('0x72')));var _0x4b7b66=JSON[_0x3aa4('0x73')](_0x45bcc3);if('undefined'==typeof _0x4b7b66[_0x3aa4('0x2a')]){return _0x14106d(new Error(_0x3aa4('0x74')));}if(_0x3aa4('0x1e')==typeof _0x4b7b66['type']){return _0x14106d(new Error(_0x3aa4('0x75')));}if(_0x3aa4('0x1e')==typeof _0x4b7b66[_0x3aa4('0x76')]){return _0x14106d(new Error(_0x3aa4('0x77')));}if(_0x3aa4('0x1e')==typeof _0x4b7b66['parameters']){return _0x14106d(new Error(_0x3aa4('0x78')));}if(_0x4b7b66['type']===_0x3aa4('0x79')){if(_0x3aa4('0x1e')==typeof _0x4b7b66[_0x3aa4('0x7a')][_0x3aa4('0x7b')]){return _0x14106d(new Error(_0x3aa4('0x7c')));}if(_0x3aa4('0x1e')==typeof _0x4b7b66[_0x3aa4('0x7a')]['views']['admin']&&_0x3aa4('0x1e')==typeof _0x4b7b66[_0x3aa4('0x7a')][_0x3aa4('0x7b')][_0x3aa4('0x7d')]){return _0x14106d(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x4b7b66[_0x3aa4('0x31')]===_0x3aa4('0x7e')){if('undefined'==typeof _0x4b7b66['parameters']['scriptName']){return _0x14106d(new Error(_0x3aa4('0x7f')));}if(_0x3aa4('0x1e')==typeof _0x4b7b66['parameters'][_0x3aa4('0x80')]){return _0x14106d(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x14106d(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x28a136=_0x4b7b66[_0x3aa4('0x2a')];var _0x3dcfaf=_0x4b7b66['description'];var _0x166b99=_0x4b7b66[_0x3aa4('0x31')];var _0x16cdec=_0x4b7b66[_0x3aa4('0x81')]?_0x4b7b66['sidebar']:_0x3aa4('0x82');var _0x7ec5f0=_0x4b7b66[_0x3aa4('0x83')]?_0x4b7b66['icon']:_0x3aa4('0x84');var _0x31ec5d='';var _0x571abd='';var _0x397c4a='';var _0x3561f1='';var _0x4b2a0f=_0x4b7b66[_0x3aa4('0x76')];if(_0x166b99==='html'){if(_0x3aa4('0x1e')!=typeof _0x4b7b66[_0x3aa4('0x7a')][_0x3aa4('0x7b')][_0x3aa4('0x85')]){var _0x32bfbb=_0x4b7b66[_0x3aa4('0x7a')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x3aa4('0x86')](_0x32bfbb)){_0x31ec5d=path[_0x3aa4('0x4c')]('plugins',_0x1a5575,_0x1c94f3[0x0],_0x32bfbb);}else{_0x31ec5d=_0x32bfbb;}}else{logger['info'](_0x3aa4('0x87'));}if('undefined'!=typeof _0x4b7b66[_0x3aa4('0x7a')][_0x3aa4('0x7b')]['agent']){var _0x44da1f=_0x4b7b66['parameters'][_0x3aa4('0x7b')][_0x3aa4('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x3aa4('0x86')](_0x44da1f)){_0x571abd=path[_0x3aa4('0x4c')](_0x3aa4('0x88'),_0x1a5575,_0x1c94f3[0x0],_0x44da1f);}else{_0x571abd=_0x44da1f;}}else{logger[_0x3aa4('0x65')](_0x3aa4('0x89'));}}else if(_0x166b99===_0x3aa4('0x7e')){_0x397c4a=_0x4b7b66[_0x3aa4('0x7a')][_0x3aa4('0x8a')];_0x3561f1=_0x4b7b66[_0x3aa4('0x7a')][_0x3aa4('0x80')];if('undefined'!=typeof _0x4b7b66[_0x3aa4('0x7a')]['views']){if(_0x3aa4('0x1e')!=typeof _0x4b7b66[_0x3aa4('0x7a')][_0x3aa4('0x7b')][_0x3aa4('0x85')]){var _0x32bfbb=_0x4b7b66[_0x3aa4('0x7a')][_0x3aa4('0x7b')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x3aa4('0x86')](_0x32bfbb)){_0x31ec5d=path['join'](_0x3aa4('0x88'),_0x1a5575,_0x1c94f3[0x0],_0x32bfbb);}else{_0x31ec5d=_0x32bfbb;}}if(_0x3aa4('0x1e')!=typeof _0x4b7b66[_0x3aa4('0x7a')][_0x3aa4('0x7b')][_0x3aa4('0x7d')]){var _0x44da1f=_0x4b7b66[_0x3aa4('0x7a')][_0x3aa4('0x7b')][_0x3aa4('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x3aa4('0x86')](_0x44da1f)){_0x571abd=path[_0x3aa4('0x4c')](_0x3aa4('0x88'),_0x1a5575,_0x1c94f3[0x0],_0x44da1f);}else{_0x571abd=_0x44da1f;}}}}var _0x4c605a={'name':_0x28a136,'description':_0x3dcfaf,'path':path[_0x3aa4('0x4c')](_0x1a5575,_0x1c94f3[0x0]),'type':_0x166b99,'sidebar':_0x16cdec,'icon':_0x7ec5f0,'adminUrl':_0x31ec5d,'agentUrl':_0x571abd,'scriptName':_0x397c4a,'scriptPath':_0x3561f1,'version':_0x4b2a0f};removeReferences(_0x4bbf83,null);return db[_0x3aa4('0x2e')][_0x3aa4('0x8b')](_0x4c605a)[_0x3aa4('0x25')](function(_0x42545b){var _0x1ff726={'role':_0x263227[_0x3aa4('0x8c')]['role'],'userProfileId':_0x263227['body'][_0x3aa4('0x8d')]};if(!_0x1ff726)throw new Error(_0x3aa4('0x8e'));if(_0x1ff726[_0x3aa4('0x8f')]===_0x3aa4('0x90')){var _0x27ffe9=_0x42545b['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x3aa4('0x91'),'userProfileId':_0x1ff726[_0x3aa4('0x8d')]},'raw':!![]})[_0x3aa4('0x25')](function(_0x593e0b){if(_0x593e0b&&_0x593e0b[_0x3aa4('0x92')]===0x0){return db[_0x3aa4('0x27')][_0x3aa4('0x8b')]({'name':_0x27ffe9[_0x3aa4('0x2a')],'resourceId':_0x27ffe9['id'],'type':_0x593e0b[_0x3aa4('0x2a')],'sectionId':_0x593e0b['id']},{})[_0x3aa4('0x25')](function(){return _0x42545b;});}else{return _0x42545b;}})[_0x3aa4('0x45')](function(_0x4235a3){logger[_0x3aa4('0x28')](_0x3aa4('0x93'),_0x4235a3);throw _0x4235a3;});}return _0x42545b;})['then'](respondWithResult(_0xfe78fb,null))[_0x3aa4('0x45')](handleError(_0xfe78fb,null));}});}catch(_0x3669c5){_0xfe78fb[_0x3aa4('0x1c')](0x1f4)['send'](_0x3669c5);}};function removeReferences(_0x19a24a,_0x13f715){try{if(_0x19a24a){fs['unlinkSync'](_0x19a24a);logger[_0x3aa4('0x65')]('Zip\x20archive\x20removed');}if(_0x13f715){rimraf(_0x13f715,function(){});logger[_0x3aa4('0x65')](_0x3aa4('0x94'));}}catch(_0x47a740){logger[_0x3aa4('0x28')](_0x47a740);}}exports[_0x3aa4('0x24')]=function(_0x23532c,_0x3f6376,_0x6e163a){return db[_0x3aa4('0x2e')]['find']({'where':{'id':_0x23532c['params']['id']}})[_0x3aa4('0x25')](handleEntityNotFound(_0x3f6376,null))['then'](saveUpdates(_0x23532c['body'],null))[_0x3aa4('0x25')](respondWithResult(_0x3f6376,null))['catch'](handleError(_0x3f6376,null));};exports[_0x3aa4('0x95')]=function(_0x2af031,_0x3a2078,_0x227218){return db[_0x3aa4('0x2e')][_0x3aa4('0x4a')]({'where':{'id':_0x2af031['params']['id']}})[_0x3aa4('0x25')](function(_0x35b382){if(_0x35b382){return _0x35b382['destroy']();}})[_0x3aa4('0x25')](function(_0x5b1a91){rimraf(path['join'](config[_0x3aa4('0x4d')],_0x3aa4('0x4e'),path['dirname'](_0x5b1a91[_0x3aa4('0x4b')])),function(){});return _0x5b1a91;})[_0x3aa4('0x25')](handleEntityNotFound(_0x3a2078,null))['then'](respondWithStatusCode(_0x3a2078,null))[_0x3aa4('0x45')](handleError(_0x3a2078,null));};exports[_0x3aa4('0x96')]=function(_0x5b387d,_0x43216d,_0x53eff6){return BPromise[_0x3aa4('0x97')]()[_0x3aa4('0x25')](function(){if(!_0x5b387d[_0x3aa4('0x32')][_0x3aa4('0x4b')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5b387d['query']['port']){throw new Error(_0x3aa4('0x98'));}var _0x44a3b8=_0x5b387d['query']['hostname']?_0x5b387d[_0x3aa4('0x32')]['hostname']+':'+_0x5b387d[_0x3aa4('0x32')][_0x3aa4('0x99')]:_0x3aa4('0x9a')+_0x5b387d[_0x3aa4('0x32')][_0x3aa4('0x99')];var _0x35f4e3=_0x5b387d[_0x3aa4('0x32')][_0x3aa4('0x22')]?_0x5b387d['query'][_0x3aa4('0x22')]:!![];var _0x411316=_0x5b387d[_0x3aa4('0x32')][_0x3aa4('0x9b')]?_0x5b387d[_0x3aa4('0x32')]['encoding']:null;var _0x3f9123={'method':_0x5b387d[_0x3aa4('0x9c')],'uri':util[_0x3aa4('0x4f')](_0x3aa4('0x9d'),_0x44a3b8,_0x5b387d['query'][_0x3aa4('0x4b')]),'json':_0x35f4e3,'resolveWithFullResponse':!![],'encoding':_0x411316,'qs':_0x5b387d[_0x3aa4('0x32')]};if(_0x5b387d[_0x3aa4('0x9e')]){_0x3f9123[_0x3aa4('0x9e')]=_0x5b387d[_0x3aa4('0x9e')];if(_0x3f9123['headers']['content-length']){delete _0x3f9123[_0x3aa4('0x9e')][_0x3aa4('0x9f')];}}if(_0x3f9123['headers'][_0x3aa4('0xa0')]){delete _0x3f9123[_0x3aa4('0x9e')][_0x3aa4('0xa0')];}return rp(_0x3f9123);})['then'](function(_0x1f1f01){if(_0x1f1f01){_0x43216d[_0x3aa4('0xa1')](_0x1f1f01[_0x3aa4('0x9e')]);logger[_0x3aa4('0x65')](_0x1f1f01[_0x3aa4('0x8c')]);if(_['endsWith'](_0x5b387d[_0x3aa4('0x32')][_0x3aa4('0x4b')],_0x3aa4('0x60'))&&_0x1f1f01[_0x3aa4('0xa2')]==0x1f4){return _0x43216d[_0x3aa4('0x1a')](_0x1f1f01[_0x3aa4('0xa2')]);}else{return _0x43216d[_0x3aa4('0x1c')](_0x1f1f01['statusCode'])[_0x3aa4('0x2b')](_0x1f1f01[_0x3aa4('0x8c')]);}}else{return _0x43216d[_0x3aa4('0x1a')](0xc8);}})[_0x3aa4('0x45')](handleError(_0x43216d,null));};exports[_0x3aa4('0xa3')]=function(_0x554a89,_0x22b8e3,_0x564f5d){return BPromise[_0x3aa4('0x97')]()[_0x3aa4('0x25')](function(){if(!_0x554a89[_0x3aa4('0x32')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x554a89[_0x3aa4('0x32')][_0x3aa4('0x99')]){throw new Error(_0x3aa4('0x98'));}var _0x3b0965=_0x554a89[_0x3aa4('0x32')]['hostname']?_0x554a89[_0x3aa4('0x32')]['hostname']+':'+_0x554a89['query'][_0x3aa4('0x99')]:_0x3aa4('0x9a')+_0x554a89[_0x3aa4('0x32')][_0x3aa4('0x99')];var _0x59783c=_0x554a89[_0x3aa4('0x32')][_0x3aa4('0x22')]?_0x554a89['query'][_0x3aa4('0x22')]:!![];var _0x3a9f31=_0x554a89['query'][_0x3aa4('0x9b')]?_0x554a89[_0x3aa4('0x32')][_0x3aa4('0x9b')]:null;var _0x211905={'method':_0x554a89['method'],'uri':util[_0x3aa4('0x4f')]('%s%s',_0x3b0965,_0x554a89[_0x3aa4('0x32')][_0x3aa4('0x4b')]),'json':_0x59783c,'resolveWithFullResponse':!![],'encoding':_0x3a9f31,'body':_0x554a89[_0x3aa4('0x8c')]};if(_0x554a89[_0x3aa4('0x9e')]){_0x211905[_0x3aa4('0x9e')]=_0x554a89['headers'];if(_0x211905[_0x3aa4('0x9e')][_0x3aa4('0x9f')]){delete _0x211905[_0x3aa4('0x9e')][_0x3aa4('0x9f')];}}if(_0x211905['headers'][_0x3aa4('0xa0')]){delete _0x211905['headers'][_0x3aa4('0xa0')];}return rp(_0x211905);})[_0x3aa4('0x25')](function(_0x43f033){if(_0x43f033){_0x22b8e3[_0x3aa4('0xa1')](_0x43f033[_0x3aa4('0x9e')]);logger[_0x3aa4('0x65')](_0x43f033[_0x3aa4('0x8c')]);return _0x22b8e3['status'](_0x43f033[_0x3aa4('0xa2')])['send'](_0x43f033[_0x3aa4('0x8c')]);}else{return _0x22b8e3[_0x3aa4('0x1a')](0xc8);}})[_0x3aa4('0x45')](handleError(_0x22b8e3,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 5546c2e..6b9857f 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 _0xd916=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save','remove'];(function(_0x1a1b6e,_0x3a07a9){var _0x571e2c=function(_0x6cea62){while(--_0x6cea62){_0x1a1b6e['push'](_0x1a1b6e['shift']());}};_0x571e2c(++_0x3a07a9);}(_0xd916,0x18a));var _0x6d91=function(_0x39512c,_0x367bd8){_0x39512c=_0x39512c-0x0;var _0x5e31ca=_0xd916[_0x39512c];return _0x5e31ca;};'use strict';var EventEmitter=require(_0x6d91('0x0'));var Plugin=require(_0x6d91('0x1'))['db'][_0x6d91('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x6d91('0x3')](0x0);var events={'afterCreate':_0x6d91('0x4'),'afterUpdate':'update','afterDestroy':_0x6d91('0x5')};function emitEvent(_0x3644e5){return function(_0x5a4b38,_0x4f82b3,_0x35101c){PluginEvents[_0x6d91('0x6')](_0x3644e5+':'+_0x5a4b38['id'],_0x5a4b38);PluginEvents['emit'](_0x3644e5,_0x5a4b38);_0x35101c(null);};}for(var e in events){if(events[_0x6d91('0x7')](e)){var event=events[e];Plugin[_0x6d91('0x8')](e,emitEvent(event));}}module[_0x6d91('0x9')]=PluginEvents; \ No newline at end of file +var _0x1f2d=['hook','exports','events','../../mysqldb','Plugin','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x49f4b0,_0x180783){var _0x3130d9=function(_0x428440){while(--_0x428440){_0x49f4b0['push'](_0x49f4b0['shift']());}};_0x3130d9(++_0x180783);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0x57cb4f,_0x541f57){_0x57cb4f=_0x57cb4f-0x0;var _0x29bb45=_0x1f2d[_0x57cb4f];return _0x29bb45;};'use strict';var EventEmitter=require(_0xd1f2('0x0'));var Plugin=require(_0xd1f2('0x1'))['db'][_0xd1f2('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xd1f2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd1f2('0x4'),'afterDestroy':_0xd1f2('0x5')};function emitEvent(_0x13626e){return function(_0xd4f928,_0x21f154,_0x194b49){PluginEvents[_0xd1f2('0x6')](_0x13626e+':'+_0xd4f928['id'],_0xd4f928);PluginEvents[_0xd1f2('0x6')](_0x13626e,_0xd4f928);_0x194b49(null);};}for(var e in events){if(events[_0xd1f2('0x7')](e)){var event=events[e];Plugin[_0xd1f2('0x8')](e,emitEvent(event));}}module[_0xd1f2('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 0f510f0..d727b60 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 _0x6f67=['../../config/environment','./plugin.attributes','exports','Plugin','plugins','util','../../config/logger','bluebird','request-promise','path'];(function(_0x21c64b,_0x594ece){var _0x2e7580=function(_0x4b3d23){while(--_0x4b3d23){_0x21c64b['push'](_0x21c64b['shift']());}};_0x2e7580(++_0x594ece);}(_0x6f67,0x1ef));var _0x76f6=function(_0x5a4b6e,_0x2d7e09){_0x5a4b6e=_0x5a4b6e-0x0;var _0x1c68ed=_0x6f67[_0x5a4b6e];return _0x1c68ed;};'use strict';var _=require('lodash');var util=require(_0x76f6('0x0'));var logger=require(_0x76f6('0x1'))('api');var moment=require('moment');var BPromise=require(_0x76f6('0x2'));var rp=require(_0x76f6('0x3'));var fs=require('fs');var path=require(_0x76f6('0x4'));var rimraf=require('rimraf');var config=require(_0x76f6('0x5'));var attributes=require(_0x76f6('0x6'));module[_0x76f6('0x7')]=function(_0x371b78,_0x2a0e61){return _0x371b78['define'](_0x76f6('0x8'),attributes,{'tableName':_0x76f6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5272=['exports','Plugin','plugins','lodash','util','../../config/logger','path','rimraf','./plugin.attributes'];(function(_0x46805d,_0x582fc3){var _0x5316fa=function(_0x3f669f){while(--_0x3f669f){_0x46805d['push'](_0x46805d['shift']());}};_0x5316fa(++_0x582fc3);}(_0x5272,0x147));var _0x2527=function(_0x2abfef,_0x550f95){_0x2abfef=_0x2abfef-0x0;var _0x79050c=_0x5272[_0x2abfef];return _0x79050c;};'use strict';var _=require(_0x2527('0x0'));var util=require(_0x2527('0x1'));var logger=require(_0x2527('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2527('0x3'));var rimraf=require(_0x2527('0x4'));var config=require('../../config/environment');var attributes=require(_0x2527('0x5'));module[_0x2527('0x6')]=function(_0x4b553b,_0x444940){return _0x4b553b['define'](_0x2527('0x7'),attributes,{'tableName':_0x2527('0x8'),'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 2d30312..73b06bc 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 _0x3bc4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreatePlugin','Plugin','body','options','raw','util','moment','bluebird'];(function(_0x2163fc,_0x58ea83){var _0xd34cbf=function(_0x3b10a6){while(--_0x3b10a6){_0x2163fc['push'](_0x2163fc['shift']());}};_0xd34cbf(++_0x58ea83);}(_0x3bc4,0xc9));var _0x43bc=function(_0x5caf82,_0x9591f7){_0x5caf82=_0x5caf82-0x0;var _0x5cf782=_0x3bc4[_0x5caf82];return _0x5cf782;};'use strict';var _=require('lodash');var util=require(_0x43bc('0x0'));var moment=require(_0x43bc('0x1'));var BPromise=require(_0x43bc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43bc('0x3'));var db=require(_0x43bc('0x4'))['db'];var utils=require(_0x43bc('0x5'));var logger=require(_0x43bc('0x6'))(_0x43bc('0x7'));var config=require(_0x43bc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x43bc('0x9')][_0x43bc('0xa')]({'port':0x232a});config[_0x43bc('0xb')]=_[_0x43bc('0xc')](config[_0x43bc('0xb')],{'host':_0x43bc('0xd'),'port':0x18eb});var socket=require(_0x43bc('0xe'))(new Redis(config[_0x43bc('0xb')]));require(_0x43bc('0xf'))[_0x43bc('0x10')](socket);function respondWithRpcPromise(_0x2d1215,_0x146687,_0x52bab9){return new BPromise(function(_0x51e756,_0x3ffb48){return client[_0x43bc('0x11')](_0x2d1215,_0x52bab9)[_0x43bc('0x12')](function(_0x5957f8){logger['info'](_0x43bc('0x13'),_0x146687,_0x43bc('0x14'));logger[_0x43bc('0x15')](_0x43bc('0x16'),_0x146687,_0x43bc('0x14'),JSON[_0x43bc('0x17')](_0x5957f8));if(_0x5957f8[_0x43bc('0x18')]){if(_0x5957f8[_0x43bc('0x18')]['code']===0x1f4){logger['error'](_0x43bc('0x13'),_0x146687,_0x5957f8[_0x43bc('0x18')][_0x43bc('0x19')]);return _0x3ffb48(_0x5957f8[_0x43bc('0x18')][_0x43bc('0x19')]);}logger[_0x43bc('0x18')]('Plugin,\x20%s,\x20%s',_0x146687,_0x5957f8[_0x43bc('0x18')][_0x43bc('0x19')]);return _0x51e756(_0x5957f8[_0x43bc('0x18')][_0x43bc('0x19')]);}else{logger[_0x43bc('0x1a')]('Plugin,\x20%s,\x20%s',_0x146687,_0x43bc('0x14'));_0x51e756(_0x5957f8[_0x43bc('0x1b')]['message']);}})[_0x43bc('0x1c')](function(_0x37539d){logger['error'](_0x43bc('0x13'),_0x146687,_0x37539d);_0x3ffb48(_0x37539d);});});}exports[_0x43bc('0x1d')]=function(_0x77c57d){var _0x1eee63=this;return new Promise(function(_0x2f0608,_0x3a2ffa){return db[_0x43bc('0x1e')]['create'](_0x77c57d[_0x43bc('0x1f')],{'raw':_0x77c57d[_0x43bc('0x20')]?_0x77c57d['options'][_0x43bc('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x18adad){logger['info'](_0x43bc('0x1d'),_0x77c57d);logger[_0x43bc('0x15')](_0x43bc('0x1d'),_0x77c57d,JSON[_0x43bc('0x17')](_0x18adad));_0x2f0608(_0x18adad);})[_0x43bc('0x1c')](function(_0x349138){logger['error'](_0x43bc('0x1d'),_0x349138[_0x43bc('0x19')],_0x77c57d);_0x3a2ffa(_0x1eee63[_0x43bc('0x18')](0x1f4,_0x349138[_0x43bc('0x19')]));});});}; \ No newline at end of file +var _0x00da=['then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','options','raw','CreatePlugin','debug','lodash','util','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','localhost','socket.io-emitter','redis','./plugin.socket','register'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x00da,0x1f0));var _0xa00d=function(_0x79b98,_0x435b09){_0x79b98=_0x79b98-0x0;var _0x65eb12=_0x00da[_0x79b98];return _0x65eb12;};'use strict';var _=require(_0xa00d('0x0'));var util=require(_0xa00d('0x1'));var moment=require('moment');var BPromise=require(_0xa00d('0x2'));var rs=require(_0xa00d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa00d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa00d('0x5'));var config=require('../../config/environment');var jayson=require(_0xa00d('0x6'));var client=jayson[_0xa00d('0x7')][_0xa00d('0x8')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xa00d('0x9'),'port':0x18eb});var socket=require(_0xa00d('0xa'))(new Redis(config[_0xa00d('0xb')]));require(_0xa00d('0xc'))[_0xa00d('0xd')](socket);function respondWithRpcPromise(_0x52b2c9,_0x334332,_0x40f37a){return new BPromise(function(_0x2a28c9,_0x84d184){return client['request'](_0x52b2c9,_0x40f37a)[_0xa00d('0xe')](function(_0x3d1a4e){logger[_0xa00d('0xf')](_0xa00d('0x10'),_0x334332,_0xa00d('0x11'));logger['debug'](_0xa00d('0x12'),_0x334332,'request\x20sent',JSON[_0xa00d('0x13')](_0x3d1a4e));if(_0x3d1a4e[_0xa00d('0x14')]){if(_0x3d1a4e['error'][_0xa00d('0x15')]===0x1f4){logger[_0xa00d('0x14')](_0xa00d('0x10'),_0x334332,_0x3d1a4e['error'][_0xa00d('0x16')]);return _0x84d184(_0x3d1a4e[_0xa00d('0x14')][_0xa00d('0x16')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x334332,_0x3d1a4e[_0xa00d('0x14')][_0xa00d('0x16')]);return _0x2a28c9(_0x3d1a4e[_0xa00d('0x14')][_0xa00d('0x16')]);}else{logger['info'](_0xa00d('0x10'),_0x334332,_0xa00d('0x11'));_0x2a28c9(_0x3d1a4e['result'][_0xa00d('0x16')]);}})[_0xa00d('0x17')](function(_0xc3f557){logger[_0xa00d('0x14')]('Plugin,\x20%s,\x20%s',_0x334332,_0xc3f557);_0x84d184(_0xc3f557);});});}exports['CreatePlugin']=function(_0x5d55cf){var _0x3c741e=this;return new Promise(function(_0x1d71d9,_0x57d5fa){return db['Plugin'][_0xa00d('0x18')](_0x5d55cf[_0xa00d('0x19')],{'raw':_0x5d55cf[_0xa00d('0x1a')]?_0x5d55cf['options'][_0xa00d('0x1b')]===undefined?!![]:![]:!![]})[_0xa00d('0xe')](function(_0x43fc2a){logger['info'](_0xa00d('0x1c'),_0x5d55cf);logger[_0xa00d('0x1d')](_0xa00d('0x1c'),_0x5d55cf,JSON['stringify'](_0x43fc2a));_0x1d71d9(_0x43fc2a);})[_0xa00d('0x17')](function(_0x370850){logger[_0xa00d('0x14')](_0xa00d('0x1c'),_0x370850['message'],_0x5d55cf);_0x57d5fa(_0x3c741e[_0xa00d('0x14')](0x1f4,_0x370850[_0xa00d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 0e55e68..e3ab1e1 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 _0xb31c=['remove','update','emit','removeListener','length','plugin:','./plugin.events','save'];(function(_0x336ee1,_0x48490f){var _0x25417e=function(_0x3fcdeb){while(--_0x3fcdeb){_0x336ee1['push'](_0x336ee1['shift']());}};_0x25417e(++_0x48490f);}(_0xb31c,0x11e));var _0xcb31=function(_0x4ad27a,_0x20789e){_0x4ad27a=_0x4ad27a-0x0;var _0x2003a8=_0xb31c[_0x4ad27a];return _0x2003a8;};'use strict';var PluginEvents=require(_0xcb31('0x0'));var events=[_0xcb31('0x1'),_0xcb31('0x2'),_0xcb31('0x3')];function createListener(_0x78f1b9,_0x13d7e8){return function(_0x31cde3){_0x13d7e8[_0xcb31('0x4')](_0x78f1b9,_0x31cde3);};}function removeListener(_0x58f3cd,_0x17ab1d){return function(){PluginEvents[_0xcb31('0x5')](_0x58f3cd,_0x17ab1d);};}exports['register']=function(_0x50fdc2){for(var _0x3dda1d=0x0,_0xfa4887=events[_0xcb31('0x6')];_0x3dda1d<_0xfa4887;_0x3dda1d++){var _0x257a5d=events[_0x3dda1d];var _0x439e6a=createListener(_0xcb31('0x7')+_0x257a5d,_0x50fdc2);PluginEvents['on'](_0x257a5d,_0x439e6a);}}; \ No newline at end of file +var _0x6480=['update','emit','removeListener','register','length','plugin:','./plugin.events','save'];(function(_0x118fb4,_0x3135ee){var _0x1c148b=function(_0x637b06){while(--_0x637b06){_0x118fb4['push'](_0x118fb4['shift']());}};_0x1c148b(++_0x3135ee);}(_0x6480,0xf6));var _0x0648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6480[_0x3dd15e];return _0x231fd0;};'use strict';var PluginEvents=require(_0x0648('0x0'));var events=[_0x0648('0x1'),'remove',_0x0648('0x2')];function createListener(_0x742aa,_0x1d53d5){return function(_0x17e2cd){_0x1d53d5[_0x0648('0x3')](_0x742aa,_0x17e2cd);};}function removeListener(_0x475af4,_0x402f01){return function(){PluginEvents[_0x0648('0x4')](_0x475af4,_0x402f01);};}exports[_0x0648('0x5')]=function(_0x58f4bb){for(var _0x5df50b=0x0,_0x1ec83e=events[_0x0648('0x6')];_0x5df50b<_0x1ec83e;_0x5df50b++){var _0x2dd5e4=events[_0x5df50b];var _0x245a87=createListener(_0x0648('0x7')+_0x2dd5e4,_0x58f4bb);PluginEvents['on'](_0x2dd5e4,_0x245a87);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 7307687..d9cffd4 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(_0x24e5e1,_0x53d416){var _0x100ce1=function(_0x3d29d5){while(--_0x3d29d5){_0x24e5e1['push'](_0x24e5e1['shift']());}};_0x100ce1(++_0x53d416);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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(_0x33a290,_0x227bcd){var _0x6646c2=function(_0x16f17f){while(--_0x16f17f){_0x33a290['push'](_0x33a290['shift']());}};_0x6646c2(++_0x227bcd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 5fd66de..31428cf 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 _0xee5b=['exec','bluebird','sendStatus','error','stack','name','send','npm\x20install','info','index','list','then','reject','motion2','length','catch','show','describe','params','create','body','script','join','cwd','chdir','dirname','start','status','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/logger','api','child_process'];(function(_0x574a93,_0x3aba5c){var _0x58f028=function(_0x523e5c){while(--_0x523e5c){_0x574a93['push'](_0x574a93['shift']());}};_0x58f028(++_0x3aba5c);}(_0xee5b,0x1f4));var _0xbee5=function(_0x57f5a3,_0x161bb2){_0x57f5a3=_0x57f5a3-0x0;var _0x541b2a=_0xee5b[_0x57f5a3];return _0x541b2a;};'use strict';var _=require(_0xbee5('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var path=require('path');var exec=require(_0xbee5('0x3'))[_0xbee5('0x4')];var BPromise=require(_0xbee5('0x5'));function handleEntityNotFound(_0x210159,_0x4bd202){return function(_0x5200b1){if(!_0x5200b1){_0x210159[_0xbee5('0x6')](0x194);;}return _0x5200b1;};}function respondWithResult(_0x2c0bde,_0xab6e4d){_0xab6e4d=_0xab6e4d||0xc8;return function(_0x804ab8){if(_0x804ab8){return _0x2c0bde['status'](_0xab6e4d)['json'](_0x804ab8);}return null;};}function handleError(_0x53d5b9,_0x5baf5c){_0x5baf5c=_0x5baf5c||0x1f4;return function(_0x5536bd){logger[_0xbee5('0x7')](_0x5536bd[_0xbee5('0x8')]);if(_0x5536bd[_0xbee5('0x9')]){delete _0x5536bd[_0xbee5('0x9')];}_0x53d5b9['status'](_0x5baf5c)[_0xbee5('0xa')](_0x5536bd);};}function execChildProcess(){return new BPromise(function(_0x305921,_0x9b3d3b){exec(_0xbee5('0xb'),function(_0x16377d,_0x1509c7,_0x105e16){logger[_0xbee5('0xc')](_0x1509c7);logger[_0xbee5('0xc')](_0x105e16);if(_0x16377d){logger['error'](_0x16377d);return _0x9b3d3b(_0x16377d);}return _0x305921(_0x1509c7);});});}exports[_0xbee5('0xd')]=function(_0x532a78,_0x183877){return pm2[_0xbee5('0xe')]()[_0xbee5('0xf')](function(_0x593ecb){if(_0x593ecb){var _0x5092f2=_[_0xbee5('0x10')](_0x593ecb,function(_0x4cf5a8){return _0x4cf5a8[_0xbee5('0x9')]==='express'||_0x4cf5a8[_0xbee5('0x9')]===_0xbee5('0x11');});return{'rows':_0x5092f2,'count':_0x5092f2[_0xbee5('0x12')]};}return null;})['then'](respondWithResult(_0x183877,null))[_0xbee5('0x13')](handleError(_0x183877,null));};exports[_0xbee5('0x14')]=function(_0x5a0ae5,_0x254dd3){return pm2[_0xbee5('0x15')](_0x5a0ae5[_0xbee5('0x16')]['id'])[_0xbee5('0xf')](respondWithResult(_0x254dd3,null))[_0xbee5('0xf')](handleEntityNotFound(_0x254dd3,null))[_0xbee5('0x13')](handleError(_0x254dd3,null));};exports[_0xbee5('0x17')]=function(_0xa50ec9,_0x20cf52){if(_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x9')]&&_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x19')]){var _0x40a06=path[_0xbee5('0x1a')](__dirname,'../../files/plugins',_0xa50ec9['body'][_0xbee5('0x19')]);var _0x48bfb5=process[_0xbee5('0x1b')]();process[_0xbee5('0x1c')](path[_0xbee5('0x1d')](_0x40a06));return execChildProcess()[_0xbee5('0xf')](function(_0x3f23c5){process[_0xbee5('0x1c')](_0x48bfb5);return pm2[_0xbee5('0x1e')]({'name':_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x9')],'script':_0x40a06});})['then'](function(_0x5b43b3){pm2['dump']();return _0x5b43b3[0x0];})['then'](respondWithResult(_0x20cf52,0xc9))['catch'](handleError(_0x20cf52,null));}else{return _0x20cf52[_0xbee5('0x1f')](0x1f4)[_0xbee5('0xa')]({'message':_0xbee5('0x20')});}};exports[_0xbee5('0x21')]=function(_0x169042,_0x20e7e8){if(_0x169042[_0xbee5('0x18')]['id']){delete _0x169042['body']['id'];}var _0x36b50f={'online':_0xbee5('0x22'),'stopped':_0xbee5('0x23')};if(_0x36b50f[_0xbee5('0x24')](_0x169042[_0xbee5('0x18')]['status'])){return pm2[_0x36b50f[_0x169042[_0xbee5('0x18')][_0xbee5('0x1f')]]](_0x169042[_0xbee5('0x16')]['id'])[_0xbee5('0xf')](respondWithResult(_0x20e7e8,0xc8))[_0xbee5('0x13')](handleError(_0x20e7e8,null));}else{return _0x20e7e8[_0xbee5('0x1f')](0x1f4)[_0xbee5('0xa')]({'message':_0xbee5('0x25')});}};exports[_0xbee5('0x26')]=function(_0x59c2e4,_0x22df5f){if(_0x59c2e4['body']['id']){delete _0x59c2e4[_0xbee5('0x18')]['id'];}if(_0x59c2e4['params']['id']){return pm2[_0xbee5('0x27')](_0x59c2e4['params']['id'])[_0xbee5('0xf')](function(_0x5c1109){pm2[_0xbee5('0x28')]();return _0x5c1109[0x0];})[_0xbee5('0xf')](respondWithResult(_0x22df5f,null))[_0xbee5('0x13')](handleError(_0x22df5f,null));}else{return _0x22df5f[_0xbee5('0x1f')](0x1f4)['send']({'message':_0xbee5('0x29')});}}; \ No newline at end of file +var _0xd2ea=['update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','path','exec','bluebird','sendStatus','status','json','stack','name','send','npm\x20install','info','index','reject','express','motion2','length','then','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path'];(function(_0x55164b,_0xca9414){var _0x5dfc8c=function(_0x66cd6a){while(--_0x66cd6a){_0x55164b['push'](_0x55164b['shift']());}};_0x5dfc8c(++_0xca9414);}(_0xd2ea,0x15f));var _0xad2e=function(_0x108bd1,_0x24f78f){_0x108bd1=_0x108bd1-0x0;var _0x3375c5=_0xd2ea[_0x108bd1];return _0x3375c5;};'use strict';var _=require(_0xad2e('0x0'));var pm2=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var path=require(_0xad2e('0x4'));var exec=require('child_process')[_0xad2e('0x5')];var BPromise=require(_0xad2e('0x6'));function handleEntityNotFound(_0xcba7cb,_0x3e0741){return function(_0x2afdc4){if(!_0x2afdc4){_0xcba7cb[_0xad2e('0x7')](0x194);;}return _0x2afdc4;};}function respondWithResult(_0x29e97f,_0x592e8b){_0x592e8b=_0x592e8b||0xc8;return function(_0x3b5170){if(_0x3b5170){return _0x29e97f[_0xad2e('0x8')](_0x592e8b)[_0xad2e('0x9')](_0x3b5170);}return null;};}function handleError(_0x5710ac,_0x1e0e9e){_0x1e0e9e=_0x1e0e9e||0x1f4;return function(_0x19bb0d){logger['error'](_0x19bb0d[_0xad2e('0xa')]);if(_0x19bb0d['name']){delete _0x19bb0d[_0xad2e('0xb')];}_0x5710ac[_0xad2e('0x8')](_0x1e0e9e)[_0xad2e('0xc')](_0x19bb0d);};}function execChildProcess(){return new BPromise(function(_0x24c5da,_0x489f25){exec(_0xad2e('0xd'),function(_0x5707a5,_0x42d2ac,_0x347559){logger[_0xad2e('0xe')](_0x42d2ac);logger[_0xad2e('0xe')](_0x347559);if(_0x5707a5){logger['error'](_0x5707a5);return _0x489f25(_0x5707a5);}return _0x24c5da(_0x42d2ac);});});}exports[_0xad2e('0xf')]=function(_0x59201f,_0x1a91ce){return pm2['list']()['then'](function(_0x4a812b){if(_0x4a812b){var _0x5c96a7=_[_0xad2e('0x10')](_0x4a812b,function(_0x282780){return _0x282780[_0xad2e('0xb')]===_0xad2e('0x11')||_0x282780[_0xad2e('0xb')]===_0xad2e('0x12');});return{'rows':_0x5c96a7,'count':_0x5c96a7[_0xad2e('0x13')]};}return null;})[_0xad2e('0x14')](respondWithResult(_0x1a91ce,null))[_0xad2e('0x15')](handleError(_0x1a91ce,null));};exports[_0xad2e('0x16')]=function(_0x2af208,_0x39c5e4){return pm2[_0xad2e('0x17')](_0x2af208[_0xad2e('0x18')]['id'])[_0xad2e('0x14')](respondWithResult(_0x39c5e4,null))['then'](handleEntityNotFound(_0x39c5e4,null))[_0xad2e('0x15')](handleError(_0x39c5e4,null));};exports[_0xad2e('0x19')]=function(_0x489585,_0x50eb1a){if(_0x489585['body']['name']&&_0x489585[_0xad2e('0x1a')][_0xad2e('0x1b')]){var _0x5549db=path[_0xad2e('0x1c')](__dirname,_0xad2e('0x1d'),_0x489585[_0xad2e('0x1a')][_0xad2e('0x1b')]);var _0x23c0b6=process[_0xad2e('0x1e')]();process[_0xad2e('0x1f')](path[_0xad2e('0x20')](_0x5549db));return execChildProcess()[_0xad2e('0x14')](function(_0xd907a9){process[_0xad2e('0x1f')](_0x23c0b6);return pm2[_0xad2e('0x21')]({'name':_0x489585[_0xad2e('0x1a')]['name'],'script':_0x5549db});})[_0xad2e('0x14')](function(_0x2e8887){pm2[_0xad2e('0x22')]();return _0x2e8887[0x0];})[_0xad2e('0x14')](respondWithResult(_0x50eb1a,0xc9))[_0xad2e('0x15')](handleError(_0x50eb1a,null));}else{return _0x50eb1a[_0xad2e('0x8')](0x1f4)[_0xad2e('0xc')]({'message':_0xad2e('0x23')});}};exports[_0xad2e('0x24')]=function(_0x50d446,_0x356a19){if(_0x50d446['body']['id']){delete _0x50d446[_0xad2e('0x1a')]['id'];}var _0x28ef72={'online':_0xad2e('0x25'),'stopped':_0xad2e('0x26')};if(_0x28ef72[_0xad2e('0x27')](_0x50d446[_0xad2e('0x1a')][_0xad2e('0x8')])){return pm2[_0x28ef72[_0x50d446[_0xad2e('0x1a')][_0xad2e('0x8')]]](_0x50d446[_0xad2e('0x18')]['id'])['then'](respondWithResult(_0x356a19,0xc8))[_0xad2e('0x15')](handleError(_0x356a19,null));}else{return _0x356a19[_0xad2e('0x8')](0x1f4)[_0xad2e('0xc')]({'message':_0xad2e('0x28')});}};exports[_0xad2e('0x29')]=function(_0x9b4a23,_0x409f58){if(_0x9b4a23[_0xad2e('0x1a')]['id']){delete _0x9b4a23[_0xad2e('0x1a')]['id'];}if(_0x9b4a23[_0xad2e('0x18')]['id']){return pm2[_0xad2e('0x2a')](_0x9b4a23['params']['id'])[_0xad2e('0x14')](function(_0x55e1dc){pm2[_0xad2e('0x22')]();return _0x55e1dc[0x0];})[_0xad2e('0x14')](respondWithResult(_0x409f58,null))[_0xad2e('0x15')](handleError(_0x409f58,null));}else{return _0x409f58[_0xad2e('0x8')](0x1f4)[_0xad2e('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 0c62d09..e39584b 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 _0xef4c=['../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues','getQueues','exports','Router'];(function(_0x5dcf9e,_0x46534c){var _0x198a2c=function(_0x55d8d9){while(--_0x55d8d9){_0x5dcf9e['push'](_0x5dcf9e['shift']());}};_0x198a2c(++_0x46534c);}(_0xef4c,0x103));var _0xcef4=function(_0x24ee62,_0x4e26f7){_0x24ee62=_0x24ee62-0x0;var _0x1e34bd=_0xef4c[_0x24ee62];return _0x1e34bd;};'use strict';var express=require('express');var router=express[_0xcef4('0x0')]();var auth=require(_0xcef4('0x1'));var controller=require(_0xcef4('0x2'));router[_0xcef4('0x3')](_0xcef4('0x4'),auth[_0xcef4('0x5')](),controller[_0xcef4('0x6')]);router[_0xcef4('0x3')](_0xcef4('0x7'),auth[_0xcef4('0x5')](),controller[_0xcef4('0x8')]);module[_0xcef4('0x9')]=router; \ No newline at end of file +var _0x0ebc=['./realtime.controller','isAuthenticated','getAgents','/queues','getQueues','exports','express','Router','../../components/auth/service'];(function(_0xe2c95e,_0x3e6545){var _0x42ce6f=function(_0x218482){while(--_0x218482){_0xe2c95e['push'](_0xe2c95e['shift']());}};_0x42ce6f(++_0x3e6545);}(_0x0ebc,0x84));var _0xc0eb=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0ebc[_0x3ab51d];return _0x29a04e;};'use strict';var express=require(_0xc0eb('0x0'));var router=express[_0xc0eb('0x1')]();var auth=require(_0xc0eb('0x2'));var controller=require(_0xc0eb('0x3'));router['get']('/agents',auth[_0xc0eb('0x4')](),controller[_0xc0eb('0x5')]);router['get'](_0xc0eb('0x6'),auth[_0xc0eb('0x4')](),controller[_0xc0eb('0x7')]);module[_0xc0eb('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index af780e1..404163c 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 _0x041a=['filter','assign','UserProfile','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','APIBadRequestError','../../errors/api','offset','undefined','limit','count','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','*pause','resolve','then','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','length','map','User','fieldName','role','getOptions','raw','push','sequelize','literal','FIELD(id,','forEach','Pause','where','user','userProfileId','Agents','agent','online','extraQueryConditions','getResources','findAndCountAll','filterAgentAttributes','merge','getAgentStatus','includes','pause','talking','voiceStatus','Status','getRealtimeAgentsQueryFields','pick','catch','getQueues','format','startCase','type','name','dialMethod','voice','outbound','QueueCampaigns'];(function(_0xfcd89d,_0x401f31){var _0x27ab9c=function(_0xa51d46){while(--_0xa51d46){_0xfcd89d['push'](_0xfcd89d['shift']());}};_0x27ab9c(++_0x401f31);}(_0x041a,0x161));var _0xa041=function(_0x147c2a,_0x15619f){_0x147c2a=_0x147c2a-0x0;var _0x223f6f=_0x041a[_0x147c2a];return _0x223f6f;};'use strict';var _=require(_0xa041('0x0'));var util=require(_0xa041('0x1'));var rta=require(_0xa041('0x2'));var rtq=require(_0xa041('0x3'));var qs=require(_0xa041('0x4'));var utils=require(_0xa041('0x5'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require('../../errors/api')[_0xa041('0x6')];var APIHandleError=require(_0xa041('0x7'))['handleError'];function respondWithFilteredResult(_0x1f40db,_0x357be5){return function(_0xfdaba9){if(_0xfdaba9){var _0x24cfe4=typeof _0x357be5[_0xa041('0x8')]===_0xa041('0x9')&&typeof _0x357be5[_0xa041('0xa')]===_0xa041('0x9');var _0x4dd6f4=_0xfdaba9[_0xa041('0xb')];var _0x27fe6c=_0x24cfe4?0x0:_0x357be5[_0xa041('0x8')];var _0x1fb98d=_0x24cfe4?_0xfdaba9[_0xa041('0xb')]:_0x357be5['offset']+_0x357be5[_0xa041('0xa')];var _0x5dab94;if(_0x1fb98d>=_0x4dd6f4){_0x1fb98d=_0x4dd6f4;_0x5dab94=0xc8;}else{_0x5dab94=0xce;}_0x1f40db[_0xa041('0xc')](_0x5dab94);return _0x1f40db[_0xa041('0xd')](_0xa041('0xe'),_0x27fe6c+'-'+_0x1fb98d+'/'+_0x4dd6f4)[_0xa041('0xf')](_0xfdaba9);}return null;};}exports[_0xa041('0x10')]=function(_0x37ba20,_0x35f43e){var _0x7f8a85={'count':0x0,'rows':[]};var _0x1e5756={};var _0x28a775;var _0x2fd4a8=utils[_0xa041('0x11')]();var _0x345397;var _0x50968f;var _0x573834=_0x37ba20[_0xa041('0x12')][_0xa041('0x13')];var _0x26fc70=_0x37ba20['query'][_0xa041('0x14')];var _0xd2c4fc=_0x37ba20[_0xa041('0x12')][_0xa041('0x15')];var _0x2f31f9=_0x26fc70==='pause'||_0x26fc70===_0xa041('0x16')?!![]:![];var _0x408d85=[];var _0x1f2873;var _0x3e306b;Promise[_0xa041('0x17')]()[_0xa041('0x18')](function(){if(_0x37ba20[_0xa041('0x12')][_0xa041('0x19')]){if(!utils[_0xa041('0x1a')](_0x37ba20[_0xa041('0x12')][_0xa041('0x19')])){throw new APIBadRequestError(util['format'](_0xa041('0x1b'),_0x37ba20[_0xa041('0x12')][_0xa041('0x19')]));}_0x28a775=_0x37ba20['query'][_0xa041('0x19')][_0xa041('0x1c')]();}if(!_0x37ba20[_0xa041('0x12')][_0xa041('0x1d')]||!_0x37ba20[_0xa041('0x12')][_0xa041('0x1d')]['includes'](_0xa041('0x1e'))){_0x37ba20[_0xa041('0x12')][_0xa041('0x1d')]=rta[_0xa041('0x1f')](_0x37ba20[_0xa041('0x12')]['sort']);return;}var _0xa00a81=rta[_0xa041('0x20')](_0x37ba20[_0xa041('0x12')][_0xa041('0x1d')]);_0x37ba20[_0xa041('0x12')][_0xa041('0x1d')]=_0xa00a81[_0xa041('0x21')][_0xa041('0x22')](',');_0x1f2873=_0xa00a81[_0xa041('0x23')];})[_0xa041('0x18')](function(){if(!_0x573834){return[];}return rta[_0xa041('0x24')](_0x573834,_0x28a775);})[_0xa041('0x18')](function(_0x5dcc6f){_0x408d85=_0x5dcc6f;return rta[_0xa041('0x25')]();})[_0xa041('0x18')](function(_0x592bba){_0x50968f=_0x592bba[_0xa041('0x26')];if((!_0x26fc70||_0x2f31f9)&&!_0x1f2873){return _0x408d85;}if(_0x1f2873&&!_0x26fc70){return rta[_0xa041('0x27')](_0x50968f,_0x408d85,_0x1f2873);}else{return rta['getAgentIdsByStatus'](_0x50968f,_0x408d85,_0x26fc70);}})[_0xa041('0x18')](function(_0x37ed2d){_0x408d85=_0x37ed2d;var _0x36ddde=![];if(_0x408d85[_0xa041('0x28')]===0x0){if(_0x573834||_0x26fc70){_0x36ddde=!![];}if(_0x2f31f9){_0x36ddde=![];}}if(_0x36ddde){return _0x7f8a85;}var _0x34d63b=_[_0xa041('0x29')](db[_0xa041('0x2a')]['rawAttributes'],function(_0x3cd537){return{'name':_0x3cd537[_0xa041('0x2b')],'type':_0x3cd537['type']['key']};});_0x37ba20[_0xa041('0x12')][_0xa041('0x2c')]='agent';_0x1e5756=qs[_0xa041('0x2d')](_0x34d63b,_0x37ba20);_0x1e5756[_0xa041('0x2e')]=!![];var _0x4a3c63=[];if(_0x408d85[_0xa041('0x28')]>0x0){_0x4a3c63[_0xa041('0x2f')]({'id':{'$in':_0x408d85}});if(_0x1f2873&&!_0x26fc70){_0x3e306b=[db[_0xa041('0x30')][_0xa041('0x31')](_0xa041('0x32')+_0x408d85+')')];_0x1e5756['order']=_0x3e306b;}}if(_0x2f31f9){_0x2fd4a8[_0xa041('0x33')](function(_0xd50ca5){var _0x5b7769=!![];if(_0x26fc70===_0xa041('0x16')&&_0x28a775!==_0xd50ca5){_0x5b7769=![];}_0x4a3c63['push']({[_0xd50ca5+_0xa041('0x34')]:_0x5b7769});});if(_0xd2c4fc){_0x4a3c63['push']({'pauseType':_0xd2c4fc});}}else if(_0x26fc70){_0x2fd4a8[_0xa041('0x33')](function(_0x694103){_0x4a3c63[_0xa041('0x2f')]({[_0x694103+'Pause']:![]});});}_0x1e5756['where']=_['merge'](_0x1e5756[_0xa041('0x35')],{'$and':_0x4a3c63});if(_0x37ba20['user'][_0xa041('0x2c')]===_0xa041('0x36')){var _0x22dd5c={'params':{'id':_0x37ba20['user'][_0xa041('0x37')]},'query':{'section':_0xa041('0x38'),'role':_0xa041('0x39'),'raw':!![],'ids':_0x408d85,'customSorting':_0x3e306b}};if(_0x37ba20[_0xa041('0x12')][_0xa041('0x3a')]){_0x22dd5c['query'][_0xa041('0x3a')]=!![];}if(_0x2f31f9){_0x22dd5c[_0xa041('0x12')][_0xa041('0x3b')]=_0x4a3c63;}_0x22dd5c[_0xa041('0x12')]=Object['assign'](_0x22dd5c[_0xa041('0x12')],_0x37ba20[_0xa041('0x12')]);return db['UserProfile'][_0xa041('0x3c')](_0x22dd5c);}return db[_0xa041('0x2a')][_0xa041('0x3d')](_0x1e5756);})['then'](function(_0x3b85b4){_0x7f8a85['count']=_0x3b85b4[_0xa041('0xb')];_0x345397=_0x3b85b4[_0xa041('0x26')];return _0x345397['map'](function(_0x27303f){var _0x2f9d17=_['find'](_0x50968f,['id',_0x27303f['id']]);if(_0x2f9d17){var _0x1b1276=rta[_0xa041('0x3e')](_0x2f9d17);_[_0xa041('0x3f')](_0x27303f,_0x1b1276);}_0x27303f[_0xa041('0x1e')]=rta[_0xa041('0x40')](_0x27303f);if(_0x27303f[_0xa041('0x1e')][_0xa041('0x41')](_0xa041('0x42'))){_0x2fd4a8[_0xa041('0x33')](function(_0x1615d5){if(_0x27303f[_0x1615d5+_0xa041('0x34')]){if(_0x1615d5==='voice'){if(_0x27303f['voiceStatus']!==_0xa041('0x43')){_0x27303f[_0xa041('0x44')]=_0xa041('0x42');}}else{_0x27303f[_0x1615d5+_0xa041('0x45')]='pause';}}});}return _0x27303f;});})['then'](function(_0x5ea9d0){if(!_0x1f2873||_0x3e306b){return _0x5ea9d0;}return rta['sortAgentsByStatus'](_0x5ea9d0,_0x1f2873);})['then'](function(_0x3e9099){var _0x54f56d=rta[_0xa041('0x46')]();_0x7f8a85[_0xa041('0x26')]=_0x3e9099[_0xa041('0x29')](function(_0x366978){return _[_0xa041('0x47')](_0x366978,_0x54f56d);});return _0x7f8a85;})['then'](respondWithFilteredResult(_0x35f43e,_0x1e5756))[_0xa041('0x48')](APIHandleError(_0x35f43e));};exports[_0xa041('0x49')]=function(_0x541669,_0x4ae6ad){var _0x49d28b={'count':0x0,'rows':[]};var _0x31cff3={};var _0x3e354e;var _0x5912ef;var _0x416df4;Promise[_0xa041('0x17')]()['then'](function(){if(_0x541669['query'][_0xa041('0x19')]){if(!utils['isValidChannel'](_0x541669[_0xa041('0x12')][_0xa041('0x19')])){throw new APIBadRequestError(util[_0xa041('0x4a')](_0xa041('0x1b'),_0x541669[_0xa041('0x12')]['channel']));}_0x3e354e=_0x541669['query'][_0xa041('0x19')][_0xa041('0x1c')]();}var _0x3262e1=_[_0xa041('0x4b')](_0x3e354e)+'Queue';var _0x2872f4=_[_0xa041('0x29')](db[_0x3262e1]['rawAttributes'],function(_0x53f0e6){return{'name':_0x53f0e6[_0xa041('0x2b')],'type':_0x53f0e6[_0xa041('0x4c')]['key']};});if(!_0x541669['query'][_0xa041('0x21')]){var _0x36bfff=['id',_0xa041('0x4d')];if(_0x3e354e==='voice'){_0x36bfff[_0xa041('0x2f')](_0xa041('0x4c'));if(_0x541669[_0xa041('0x12')][_0xa041('0x4c')]==='outbound'){_0x36bfff[_0xa041('0x2f')](['dialActive',_0xa041('0x4e')]);}}_0x541669[_0xa041('0x12')][_0xa041('0x21')]=_0x36bfff[_0xa041('0x22')](',');}_0x31cff3=qs[_0xa041('0x2d')](_0x2872f4,_0x541669);if(_0x541669['user'][_0xa041('0x2c')]===_0xa041('0x36')){var _0x436955={'params':{'id':_0x541669['user'][_0xa041('0x37')]},'query':{'section':_0x3e354e===_0xa041('0x4f')&&_0x541669[_0xa041('0x12')][_0xa041('0x4c')]===_0xa041('0x50')?_0xa041('0x51'):_[_0xa041('0x4b')](_0x3e354e)+'Queues','type':_0x541669['query'][_0xa041('0x4c')],'nolimit':!![],'sort':_0xa041('0x4d'),'filter':_0x541669[_0xa041('0x12')][_0xa041('0x52')]}};_0x436955[_0xa041('0x12')]=Object[_0xa041('0x53')](_0x436955[_0xa041('0x12')],_0x541669['query']);delete _0x436955['query']['id'];return db[_0xa041('0x54')][_0xa041('0x3c')](_0x436955);}return db[_0x3262e1][_0xa041('0x3d')](_0x31cff3);})['then'](function(_0x3c5bba){_0x49d28b['count']=_0x3c5bba[_0xa041('0xb')];_0x5912ef=_0x3c5bba[_0xa041('0x26')];return rtq[_0xa041('0x55')](_0x541669,_0x3e354e);})[_0xa041('0x18')](function(_0x3c5e82){_0x416df4=_0x3c5e82[_0xa041('0x26')];return rtq[_0xa041('0x56')](_0x5912ef,_0x416df4,_0x3e354e,_0x541669[_0xa041('0x12')]['type']);})[_0xa041('0x18')](function(_0x760f60){_0x49d28b[_0xa041('0x26')]=_0x760f60;return _0x49d28b;})['then'](respondWithFilteredResult(_0x4ae6ad,_0x31cff3))['catch'](APIHandleError(_0x4ae6ad));}; \ No newline at end of file +var _0x975e=['assign','UserProfile','getResources','findAndCountAll','find','filterAgentAttributes','globalStatus','getAgentStatus','voice','voiceStatus','talking','Status','sortAgentsByStatus','catch','getQueues','startCase','type','key','name','outbound','dialMethod','QueueCampaigns','getRealtimeQueues','initializeQueues','lodash','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../errors/api','handleError','offset','undefined','limit','count','status','set','Content-Range','json','getChannels','query','globalQueueFilter','pause','*pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','fields','join','getAgentIdsByQueues','getRealtimeAgents','rows','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','role','agent','getOptions','raw','push','sequelize','FIELD(id,','order','Pause','forEach','merge','where','user','online','extraQueryConditions'];(function(_0x37b57a,_0x4022db){var _0x34a0b4=function(_0x1bff05){while(--_0x1bff05){_0x37b57a['push'](_0x37b57a['shift']());}};_0x34a0b4(++_0x4022db);}(_0x975e,0xb4));var _0xe975=function(_0x301ad4,_0x3ccbaa){_0x301ad4=_0x301ad4-0x0;var _0x1dfbd7=_0x975e[_0x301ad4];return _0x1dfbd7;};'use strict';var _=require(_0xe975('0x0'));var util=require('util');var rta=require(_0xe975('0x1'));var rtq=require('../../components/realtime/queues');var qs=require(_0xe975('0x2'));var utils=require(_0xe975('0x3'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0xe975('0x4'))['APIBadRequestError'];var APIHandleError=require(_0xe975('0x4'))[_0xe975('0x5')];function respondWithFilteredResult(_0x3cea49,_0x10e0ed){return function(_0x1e5b63){if(_0x1e5b63){var _0x1f3ea6=typeof _0x10e0ed[_0xe975('0x6')]===_0xe975('0x7')&&typeof _0x10e0ed[_0xe975('0x8')]===_0xe975('0x7');var _0xb8e719=_0x1e5b63[_0xe975('0x9')];var _0x146e57=_0x1f3ea6?0x0:_0x10e0ed[_0xe975('0x6')];var _0x11d571=_0x1f3ea6?_0x1e5b63[_0xe975('0x9')]:_0x10e0ed[_0xe975('0x6')]+_0x10e0ed[_0xe975('0x8')];var _0x467a24;if(_0x11d571>=_0xb8e719){_0x11d571=_0xb8e719;_0x467a24=0xc8;}else{_0x467a24=0xce;}_0x3cea49[_0xe975('0xa')](_0x467a24);return _0x3cea49[_0xe975('0xb')](_0xe975('0xc'),_0x146e57+'-'+_0x11d571+'/'+_0xb8e719)[_0xe975('0xd')](_0x1e5b63);}return null;};}exports['getAgents']=function(_0x4a427c,_0x1c3dbd){var _0x31160d={'count':0x0,'rows':[]};var _0x2e9eb2={};var _0x2a70ac;var _0x33dd95=utils[_0xe975('0xe')]();var _0x5c9a6e;var _0x22aa96;var _0x21f1dd=_0x4a427c[_0xe975('0xf')][_0xe975('0x10')];var _0x23b01d=_0x4a427c[_0xe975('0xf')]['globalStatusFilter'];var _0x1fc508=_0x4a427c[_0xe975('0xf')]['pauseTypeFilter'];var _0x100fbb=_0x23b01d===_0xe975('0x11')||_0x23b01d===_0xe975('0x12')?!![]:![];var _0x33da94=[];var _0x56ccb3;var _0x4cf6e9;Promise[_0xe975('0x13')]()[_0xe975('0x14')](function(){if(_0x4a427c['query'][_0xe975('0x15')]){if(!utils[_0xe975('0x16')](_0x4a427c[_0xe975('0xf')][_0xe975('0x15')])){throw new APIBadRequestError(util[_0xe975('0x17')](_0xe975('0x18'),_0x4a427c[_0xe975('0xf')][_0xe975('0x15')]));}_0x2a70ac=_0x4a427c[_0xe975('0xf')][_0xe975('0x15')][_0xe975('0x19')]();}if(!_0x4a427c['query']['sort']||!_0x4a427c['query'][_0xe975('0x1a')][_0xe975('0x1b')]('globalStatus')){_0x4a427c['query'][_0xe975('0x1a')]=rta['validateSortParameter'](_0x4a427c[_0xe975('0xf')][_0xe975('0x1a')]);return;}var _0x2cac4b=rta['getUpdatedSortOptions'](_0x4a427c[_0xe975('0xf')]['sort']);_0x4a427c[_0xe975('0xf')][_0xe975('0x1a')]=_0x2cac4b[_0xe975('0x1c')][_0xe975('0x1d')](',');_0x56ccb3=_0x2cac4b['order'];})[_0xe975('0x14')](function(){if(!_0x21f1dd){return[];}return rta[_0xe975('0x1e')](_0x21f1dd,_0x2a70ac);})[_0xe975('0x14')](function(_0x3bceb6){_0x33da94=_0x3bceb6;return rta[_0xe975('0x1f')]();})[_0xe975('0x14')](function(_0x44b091){_0x22aa96=_0x44b091[_0xe975('0x20')];if((!_0x23b01d||_0x100fbb)&&!_0x56ccb3){return _0x33da94;}if(_0x56ccb3&&!_0x23b01d){return rta['getSortedAgentsIdsByStatus'](_0x22aa96,_0x33da94,_0x56ccb3);}else{return rta[_0xe975('0x21')](_0x22aa96,_0x33da94,_0x23b01d);}})['then'](function(_0x2f39d6){_0x33da94=_0x2f39d6;var _0x57b590=![];if(_0x33da94[_0xe975('0x22')]===0x0){if(_0x21f1dd||_0x23b01d){_0x57b590=!![];}if(_0x100fbb){_0x57b590=![];}}if(_0x57b590){return _0x31160d;}var _0x566fd1=_[_0xe975('0x23')](db[_0xe975('0x24')][_0xe975('0x25')],function(_0x239a7c){return{'name':_0x239a7c[_0xe975('0x26')],'type':_0x239a7c['type']['key']};});_0x4a427c[_0xe975('0xf')][_0xe975('0x27')]=_0xe975('0x28');_0x2e9eb2=qs[_0xe975('0x29')](_0x566fd1,_0x4a427c);_0x2e9eb2[_0xe975('0x2a')]=!![];var _0x5f0341=[];if(_0x33da94[_0xe975('0x22')]>0x0){_0x5f0341[_0xe975('0x2b')]({'id':{'$in':_0x33da94}});if(_0x56ccb3&&!_0x23b01d){_0x4cf6e9=[db[_0xe975('0x2c')]['literal'](_0xe975('0x2d')+_0x33da94+')')];_0x2e9eb2[_0xe975('0x2e')]=_0x4cf6e9;}}if(_0x100fbb){_0x33dd95['forEach'](function(_0x3a4639){var _0x116a51=!![];if(_0x23b01d===_0xe975('0x12')&&_0x2a70ac!==_0x3a4639){_0x116a51=![];}_0x5f0341[_0xe975('0x2b')]({[_0x3a4639+_0xe975('0x2f')]:_0x116a51});});if(_0x1fc508){_0x5f0341['push']({'pauseType':_0x1fc508});}}else if(_0x23b01d){_0x33dd95[_0xe975('0x30')](function(_0x3233e2){_0x5f0341[_0xe975('0x2b')]({[_0x3233e2+_0xe975('0x2f')]:![]});});}_0x2e9eb2['where']=_[_0xe975('0x31')](_0x2e9eb2[_0xe975('0x32')],{'$and':_0x5f0341});if(_0x4a427c[_0xe975('0x33')]['role']==='user'){var _0x452ade={'params':{'id':_0x4a427c[_0xe975('0x33')]['userProfileId']},'query':{'section':'Agents','role':_0xe975('0x28'),'raw':!![],'ids':_0x33da94,'customSorting':_0x4cf6e9}};if(_0x4a427c[_0xe975('0xf')][_0xe975('0x34')]){_0x452ade[_0xe975('0xf')][_0xe975('0x34')]=!![];}if(_0x100fbb){_0x452ade[_0xe975('0xf')][_0xe975('0x35')]=_0x5f0341;}_0x452ade[_0xe975('0xf')]=Object[_0xe975('0x36')](_0x452ade[_0xe975('0xf')],_0x4a427c['query']);return db[_0xe975('0x37')][_0xe975('0x38')](_0x452ade);}return db['User'][_0xe975('0x39')](_0x2e9eb2);})[_0xe975('0x14')](function(_0x2de704){_0x31160d[_0xe975('0x9')]=_0x2de704[_0xe975('0x9')];_0x5c9a6e=_0x2de704[_0xe975('0x20')];return _0x5c9a6e[_0xe975('0x23')](function(_0x3bd001){var _0x3139e7=_[_0xe975('0x3a')](_0x22aa96,['id',_0x3bd001['id']]);if(_0x3139e7){var _0x27074c=rta[_0xe975('0x3b')](_0x3139e7);_['merge'](_0x3bd001,_0x27074c);}_0x3bd001[_0xe975('0x3c')]=rta[_0xe975('0x3d')](_0x3bd001);if(_0x3bd001[_0xe975('0x3c')][_0xe975('0x1b')](_0xe975('0x11'))){_0x33dd95[_0xe975('0x30')](function(_0x70a327){if(_0x3bd001[_0x70a327+_0xe975('0x2f')]){if(_0x70a327===_0xe975('0x3e')){if(_0x3bd001[_0xe975('0x3f')]!==_0xe975('0x40')){_0x3bd001[_0xe975('0x3f')]=_0xe975('0x11');}}else{_0x3bd001[_0x70a327+_0xe975('0x41')]=_0xe975('0x11');}}});}return _0x3bd001;});})[_0xe975('0x14')](function(_0x525ea5){if(!_0x56ccb3||_0x4cf6e9){return _0x525ea5;}return rta[_0xe975('0x42')](_0x525ea5,_0x56ccb3);})[_0xe975('0x14')](function(_0x136e35){var _0x2233bf=rta['getRealtimeAgentsQueryFields']();_0x31160d[_0xe975('0x20')]=_0x136e35[_0xe975('0x23')](function(_0x208b13){return _['pick'](_0x208b13,_0x2233bf);});return _0x31160d;})[_0xe975('0x14')](respondWithFilteredResult(_0x1c3dbd,_0x2e9eb2))[_0xe975('0x43')](APIHandleError(_0x1c3dbd));};exports[_0xe975('0x44')]=function(_0x8e2311,_0x136bb7){var _0xd91887={'count':0x0,'rows':[]};var _0x924c4d={};var _0x32efe6;var _0x5e75d1;var _0x1b637b;Promise['resolve']()['then'](function(){if(_0x8e2311[_0xe975('0xf')][_0xe975('0x15')]){if(!utils['isValidChannel'](_0x8e2311[_0xe975('0xf')][_0xe975('0x15')])){throw new APIBadRequestError(util[_0xe975('0x17')](_0xe975('0x18'),_0x8e2311[_0xe975('0xf')][_0xe975('0x15')]));}_0x32efe6=_0x8e2311['query'][_0xe975('0x15')]['toLowerCase']();}var _0x5c3fb0=_[_0xe975('0x45')](_0x32efe6)+'Queue';var _0x2401b2=_[_0xe975('0x23')](db[_0x5c3fb0][_0xe975('0x25')],function(_0x32e177){return{'name':_0x32e177[_0xe975('0x26')],'type':_0x32e177[_0xe975('0x46')][_0xe975('0x47')]};});if(!_0x8e2311[_0xe975('0xf')]['fields']){var _0x54f1e2=['id',_0xe975('0x48')];if(_0x32efe6==='voice'){_0x54f1e2['push'](_0xe975('0x46'));if(_0x8e2311[_0xe975('0xf')][_0xe975('0x46')]===_0xe975('0x49')){_0x54f1e2[_0xe975('0x2b')](['dialActive',_0xe975('0x4a')]);}}_0x8e2311['query']['fields']=_0x54f1e2[_0xe975('0x1d')](',');}_0x924c4d=qs[_0xe975('0x29')](_0x2401b2,_0x8e2311);if(_0x8e2311[_0xe975('0x33')][_0xe975('0x27')]===_0xe975('0x33')){var _0x1c8165={'params':{'id':_0x8e2311[_0xe975('0x33')]['userProfileId']},'query':{'section':_0x32efe6===_0xe975('0x3e')&&_0x8e2311[_0xe975('0xf')]['type']===_0xe975('0x49')?_0xe975('0x4b'):_['startCase'](_0x32efe6)+'Queues','type':_0x8e2311[_0xe975('0xf')][_0xe975('0x46')],'nolimit':!![],'sort':'name','filter':_0x8e2311['query']['filter']}};_0x1c8165[_0xe975('0xf')]=Object[_0xe975('0x36')](_0x1c8165[_0xe975('0xf')],_0x8e2311[_0xe975('0xf')]);delete _0x1c8165[_0xe975('0xf')]['id'];return db[_0xe975('0x37')][_0xe975('0x38')](_0x1c8165);}return db[_0x5c3fb0][_0xe975('0x39')](_0x924c4d);})[_0xe975('0x14')](function(_0x52b06b){_0xd91887['count']=_0x52b06b[_0xe975('0x9')];_0x5e75d1=_0x52b06b[_0xe975('0x20')];return rtq[_0xe975('0x4c')](_0x8e2311,_0x32efe6);})['then'](function(_0x91deb0){_0x1b637b=_0x91deb0['rows'];return rtq[_0xe975('0x4d')](_0x5e75d1,_0x1b637b,_0x32efe6,_0x8e2311[_0xe975('0xf')]['type']);})[_0xe975('0x14')](function(_0x1c6005){_0xd91887['rows']=_0x1c6005;return _0xd91887;})[_0xe975('0x14')](respondWithFilteredResult(_0x136bb7,_0x924c4d))[_0xe975('0x43')](APIHandleError(_0x136bb7));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 15d140c..30b31f5 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4a6600,_0x43190e){var _0x113e0c=function(_0x3ea719){while(--_0x3ea719){_0x4a6600['push'](_0x4a6600['shift']());}};_0x113e0c(++_0x43190e);}(_0xe706,0xa3));var _0x6e70=function(_0x3437a2,_0x4aa5ec){_0x3437a2=_0x3437a2-0x0;var _0x38ec72=_0xe706[_0x3437a2];return _0x38ec72;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5962b4,_0x84be73){var _0xe6443c=function(_0x2b37d4){while(--_0x2b37d4){_0x5962b4['push'](_0x5962b4['shift']());}};_0xe6443c(++_0x84be73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index a7fab76..1ad75db 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 _0x7da7=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x9307ea,_0x38968a){var _0x295554=function(_0x342dcf){while(--_0x342dcf){_0x9307ea['push'](_0x9307ea['shift']());}};_0x295554(++_0x38968a);}(_0x7da7,0x10d));var _0x77da=function(_0x56fb33,_0x37be08){_0x56fb33=_0x56fb33-0x0;var _0x435ee4=_0x7da7[_0x56fb33];return _0x435ee4;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'state':{'type':Sequelize[_0x77da('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x77da('0x3')]},'starttime':{'type':Sequelize[_0x77da('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x77da('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x77da('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x77da('0x3')]}}; \ No newline at end of file +var _0xa4dc=['STRING','INTEGER','sequelize','exports','DATE'];(function(_0x488236,_0x4cebb2){var _0x4239dc=function(_0x3b87df){while(--_0x3b87df){_0x488236['push'](_0x488236['shift']());}};_0x4239dc(++_0x4cebb2);}(_0xa4dc,0x16a));var _0xca4d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa4dc[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xca4d('0x0'));module[_0xca4d('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xca4d('0x2')]},'uniqueid':{'type':Sequelize[_0xca4d('0x3')]},'starttime':{'type':Sequelize[_0xca4d('0x2')]},'responsetime':{'type':Sequelize[_0xca4d('0x2')]},'ringtime':{'type':Sequelize[_0xca4d('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xca4d('0x3')]},'membername':{'type':Sequelize[_0xca4d('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 73b40d2..ebdcce9 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 _0x00ca=['ReportAgentPreview','report_agent_preview','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','define'];(function(_0x2e3633,_0xae2564){var _0x5aa17a=function(_0x5b0b45){while(--_0x5b0b45){_0x2e3633['push'](_0x2e3633['shift']());}};_0x5aa17a(++_0xae2564);}(_0x00ca,0xb2));var _0xa00c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x00ca[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xa00c('0x0'));var logger=require('../../config/logger')(_0xa00c('0x1'));var moment=require('moment');var BPromise=require(_0xa00c('0x2'));var rp=require(_0xa00c('0x3'));var fs=require('fs');var path=require(_0xa00c('0x4'));var rimraf=require(_0xa00c('0x5'));var config=require(_0xa00c('0x6'));var attributes=require(_0xa00c('0x7'));module['exports']=function(_0xb26829,_0x185a29){return _0xb26829[_0xa00c('0x8')](_0xa00c('0x9'),attributes,{'tableName':_0xa00c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb14c=['util','../../config/logger','api','request-promise','path','../../config/environment','define','lodash'];(function(_0x200aff,_0x2915db){var _0x47b3cc=function(_0x3283ff){while(--_0x3283ff){_0x200aff['push'](_0x200aff['shift']());}};_0x47b3cc(++_0x2915db);}(_0xb14c,0xff));var _0xcb14=function(_0x5b4f98,_0x4e2213){_0x5b4f98=_0x5b4f98-0x0;var _0x1f5022=_0xb14c[_0x5b4f98];return _0x1f5022;};'use strict';var _=require(_0xcb14('0x0'));var util=require(_0xcb14('0x1'));var logger=require(_0xcb14('0x2'))(_0xcb14('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb14('0x4'));var fs=require('fs');var path=require(_0xcb14('0x5'));var rimraf=require('rimraf');var config=require(_0xcb14('0x6'));var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x5be247,_0x13a67c){return _0x5be247[_0xcb14('0x7')]('ReportAgentPreview',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 e8e34d5..a990c16 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 _0x780c=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','message','result','ReportAgentPreview','body','options','raw','CreateReportAgentPreview','catch','util'];(function(_0x39b8b7,_0x3d5222){var _0x4c8dd0=function(_0x54a537){while(--_0x54a537){_0x39b8b7['push'](_0x39b8b7['shift']());}};_0x4c8dd0(++_0x3d5222);}(_0x780c,0xbc));var _0xc780=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x780c[_0x1d50f2];return _0x3769b8;};'use strict';var _=require('lodash');var util=require(_0xc780('0x0'));var moment=require(_0xc780('0x1'));var BPromise=require(_0xc780('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc780('0x3'));var db=require(_0xc780('0x4'))['db'];var utils=require(_0xc780('0x5'));var logger=require(_0xc780('0x6'))(_0xc780('0x7'));var config=require(_0xc780('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc780('0x9')][_0xc780('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x91c773,_0x2682f9,_0x182715){return new BPromise(function(_0x249ead,_0x1c7e1b){return client[_0xc780('0xb')](_0x91c773,_0x182715)[_0xc780('0xc')](function(_0x1b59b0){logger[_0xc780('0xd')](_0xc780('0xe'),_0x2682f9,_0xc780('0xf'));logger[_0xc780('0x10')](_0xc780('0x11'),_0x2682f9,_0xc780('0xf'),JSON['stringify'](_0x1b59b0));if(_0x1b59b0['error']){if(_0x1b59b0[_0xc780('0x12')]['code']===0x1f4){logger[_0xc780('0x12')](_0xc780('0xe'),_0x2682f9,_0x1b59b0[_0xc780('0x12')][_0xc780('0x13')]);return _0x1c7e1b(_0x1b59b0[_0xc780('0x12')][_0xc780('0x13')]);}logger['error'](_0xc780('0xe'),_0x2682f9,_0x1b59b0[_0xc780('0x12')]['message']);return _0x249ead(_0x1b59b0[_0xc780('0x12')][_0xc780('0x13')]);}else{logger[_0xc780('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x2682f9,'request\x20sent');_0x249ead(_0x1b59b0[_0xc780('0x14')]['message']);}})['catch'](function(_0x106667){logger[_0xc780('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x2682f9,_0x106667);_0x1c7e1b(_0x106667);});});}exports['CreateReportAgentPreview']=function(_0x3b0ef4){var _0x2282da=this;return new Promise(function(_0x1df35d,_0x55817a){return db[_0xc780('0x15')]['create'](_0x3b0ef4[_0xc780('0x16')],{'raw':_0x3b0ef4[_0xc780('0x17')]?_0x3b0ef4[_0xc780('0x17')][_0xc780('0x18')]===undefined?!![]:![]:!![]})[_0xc780('0xc')](function(_0x203fd2){logger[_0xc780('0xd')](_0xc780('0x19'),_0x3b0ef4);logger[_0xc780('0x10')](_0xc780('0x19'),_0x3b0ef4,JSON['stringify'](_0x203fd2));_0x1df35d(_0x203fd2);})[_0xc780('0x1a')](function(_0x47a010){logger[_0xc780('0x12')]('CreateReportAgentPreview',_0x47a010['message'],_0x3b0ef4);_0x55817a(_0x2282da[_0xc780('0x12')](0x1f4,_0x47a010[_0xc780('0x13')]));});});}; \ No newline at end of file +var _0x1f9e=['rpc','../../config/environment','jayson/promise','client','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x58e26f,_0x29c91d){var _0x482bf8=function(_0xdad445){while(--_0xdad445){_0x58e26f['push'](_0x58e26f['shift']());}};_0x482bf8(++_0x29c91d);}(_0x1f9e,0xa2));var _0xe1f9=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x1f9e[_0x209ec9];return _0x129b1b;};'use strict';var _=require('lodash');var util=require(_0xe1f9('0x0'));var moment=require(_0xe1f9('0x1'));var BPromise=require('bluebird');var rs=require(_0xe1f9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe1f9('0x3'))['db'];var utils=require(_0xe1f9('0x4'));var logger=require(_0xe1f9('0x5'))(_0xe1f9('0x6'));var config=require(_0xe1f9('0x7'));var jayson=require(_0xe1f9('0x8'));var client=jayson[_0xe1f9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23e460,_0x42b387,_0x363e11){return new BPromise(function(_0x82b018,_0x59a16f){return client[_0xe1f9('0xa')](_0x23e460,_0x363e11)[_0xe1f9('0xb')](function(_0x487001){logger['info'](_0xe1f9('0xc'),_0x42b387,_0xe1f9('0xd'));logger[_0xe1f9('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x42b387,_0xe1f9('0xd'),JSON[_0xe1f9('0xf')](_0x487001));if(_0x487001['error']){if(_0x487001[_0xe1f9('0x10')][_0xe1f9('0x11')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x42b387,_0x487001[_0xe1f9('0x10')][_0xe1f9('0x12')]);return _0x59a16f(_0x487001[_0xe1f9('0x10')][_0xe1f9('0x12')]);}logger[_0xe1f9('0x10')](_0xe1f9('0xc'),_0x42b387,_0x487001[_0xe1f9('0x10')][_0xe1f9('0x12')]);return _0x82b018(_0x487001[_0xe1f9('0x10')][_0xe1f9('0x12')]);}else{logger[_0xe1f9('0x13')](_0xe1f9('0xc'),_0x42b387,'request\x20sent');_0x82b018(_0x487001[_0xe1f9('0x14')]['message']);}})[_0xe1f9('0x15')](function(_0x2c39ba){logger['error'](_0xe1f9('0xc'),_0x42b387,_0x2c39ba);_0x59a16f(_0x2c39ba);});});}exports['CreateReportAgentPreview']=function(_0x57772d){var _0x11422b=this;return new Promise(function(_0x195b90,_0x24c56a){return db[_0xe1f9('0x16')][_0xe1f9('0x17')](_0x57772d[_0xe1f9('0x18')],{'raw':_0x57772d[_0xe1f9('0x19')]?_0x57772d[_0xe1f9('0x19')][_0xe1f9('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1c4560){logger['info'](_0xe1f9('0x1b'),_0x57772d);logger[_0xe1f9('0xe')](_0xe1f9('0x1b'),_0x57772d,JSON['stringify'](_0x1c4560));_0x195b90(_0x1c4560);})[_0xe1f9('0x15')](function(_0x5d474c){logger[_0xe1f9('0x10')](_0xe1f9('0x1b'),_0x5d474c[_0xe1f9('0x12')],_0x57772d);_0x24c56a(_0x11422b['error'](0x1f4,_0x5d474c['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 8a263f6..0436b82 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 _0x05a8=['/trunks','/campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','util','path','express','../../components/auth/service','/voice/channels','get','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','put','/agents/:id/capacity'];(function(_0x5d5ab7,_0x3dc918){var _0x4f0082=function(_0x3a1545){while(--_0x3a1545){_0x5d5ab7['push'](_0x5d5ab7['shift']());}};_0x4f0082(++_0x3dc918);}(_0x05a8,0xeb));var _0x805a=function(_0x34d16d,_0x195e3f){_0x34d16d=_0x34d16d-0x0;var _0x3ce58b=_0x05a8[_0x34d16d];return _0x3ce58b;};'use strict';var multer=require('multer');var util=require(_0x805a('0x0'));var path=require(_0x805a('0x1'));var express=require(_0x805a('0x2'));var router=express['Router']();var auth=require(_0x805a('0x3'));var controller=require('./rpc.controller');router['get'](_0x805a('0x4'),auth['isAuthenticated'](),controller['voiceChannels']);router[_0x805a('0x5')](_0x805a('0x6'),auth[_0x805a('0x7')](),controller[_0x805a('0x8')]);router[_0x805a('0x5')](_0x805a('0x9'),auth[_0x805a('0x7')](),controller[_0x805a('0xa')]);router[_0x805a('0x5')](_0x805a('0xb'),auth[_0x805a('0x7')](),controller['voiceQueues']);router[_0x805a('0x5')](_0x805a('0xc'),auth[_0x805a('0x7')](),controller[_0x805a('0xd')]);router['get']('/mail/queues',auth[_0x805a('0x7')](),controller[_0x805a('0xe')]);router[_0x805a('0x5')](_0x805a('0xf'),auth[_0x805a('0x7')](),controller[_0x805a('0x10')]);router[_0x805a('0x5')]('/openchannel/queues',auth[_0x805a('0x7')](),controller[_0x805a('0x11')]);router[_0x805a('0x5')](_0x805a('0x12'),auth[_0x805a('0x7')](),controller[_0x805a('0x13')]);router[_0x805a('0x5')](_0x805a('0x14'),auth[_0x805a('0x7')](),controller[_0x805a('0x15')]);router[_0x805a('0x5')](_0x805a('0x16'),auth['isAuthenticated'](),controller['faxQueues']);router[_0x805a('0x5')]('/voice/queues/preview/:id',auth[_0x805a('0x7')](),controller[_0x805a('0x17')]);router[_0x805a('0x5')](_0x805a('0x18'),auth[_0x805a('0x7')](),controller['voiceQueuesChannels']);router['get']('/voice/queues/channels/:uniqueid',auth[_0x805a('0x7')](),controller[_0x805a('0x19')]);router[_0x805a('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller[_0x805a('0x1a')]);router[_0x805a('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x805a('0x7')](),controller[_0x805a('0x1b')]);router[_0x805a('0x5')](_0x805a('0x1c'),auth[_0x805a('0x7')](),controller[_0x805a('0x1d')]);router['put']('/voice/queues/:id',auth[_0x805a('0x7')](),controller[_0x805a('0x1e')]);router[_0x805a('0x5')](_0x805a('0x1f'),auth[_0x805a('0x7')](),controller[_0x805a('0x20')]);router[_0x805a('0x5')]('/outbound/channels',auth[_0x805a('0x7')](),controller[_0x805a('0x21')]);router[_0x805a('0x5')](_0x805a('0x22'),auth[_0x805a('0x7')](),controller['agents']);router[_0x805a('0x23')](_0x805a('0x24'),auth[_0x805a('0x7')](),controller['agentCapacity']);router[_0x805a('0x5')]('/telephones',auth[_0x805a('0x7')](),controller['telephones']);router[_0x805a('0x5')](_0x805a('0x25'),auth[_0x805a('0x7')](),controller['trunks']);router[_0x805a('0x5')](_0x805a('0x26'),auth[_0x805a('0x7')](),controller['campaigns']);router[_0x805a('0x5')](_0x805a('0x27'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0x805a('0x5')](_0x805a('0x28'),auth['isAuthenticated'](),controller[_0x805a('0x29')]);router[_0x805a('0x5')](_0x805a('0x2a'),auth[_0x805a('0x7')](),controller['mailQueuesWaitingInteractions']);router[_0x805a('0x5')]('/openchannel/queues/waitinginteractions',auth[_0x805a('0x7')](),controller[_0x805a('0x2b')]);router[_0x805a('0x5')](_0x805a('0x2c'),auth['isAuthenticated'](),controller[_0x805a('0x2d')]);router[_0x805a('0x5')](_0x805a('0x2e'),auth[_0x805a('0x7')](),controller['smsQueuesWaitingInteractions']);router[_0x805a('0x5')]('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router[_0x805a('0x5')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router['post']('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0x805a('0x2f')](_0x805a('0x30')));router[_0x805a('0x5')](_0x805a('0x31'),auth[_0x805a('0x7')](),controller[_0x805a('0x32')]);router[_0x805a('0x33')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0x805a('0x2f')]('chat'));router[_0x805a('0x5')](_0x805a('0x34'),auth[_0x805a('0x7')](),controller['showChatQueues']);router['post'](_0x805a('0x35'),auth['isAuthenticated'](),controller['queueNotify'](_0x805a('0x36')));router[_0x805a('0x5')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x805a('0x37')]);router[_0x805a('0x33')](_0x805a('0x38'),auth['isAuthenticated'](),controller[_0x805a('0x2f')](_0x805a('0x39')));router[_0x805a('0x5')](_0x805a('0x3a'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0x805a('0x33')](_0x805a('0x3b'),auth['isAuthenticated'](),controller[_0x805a('0x2f')](_0x805a('0x3c')));router[_0x805a('0x33')](_0x805a('0x3d'),auth[_0x805a('0x7')](),controller[_0x805a('0x2f')](_0x805a('0x3e')));router['get'](_0x805a('0x3f'),auth[_0x805a('0x7')](),controller[_0x805a('0x40')]);router[_0x805a('0x5')](_0x805a('0x41'),auth[_0x805a('0x7')](),controller['showWhatsappQueues']);router[_0x805a('0x33')](_0x805a('0x42'),auth[_0x805a('0x7')](),controller[_0x805a('0x43')]);module['exports']=router; \ No newline at end of file +var _0xb923=['/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','/outbound/channels','agents','put','/agents/:id/capacity','/telephones','/trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','chat','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','path','express','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id'];(function(_0x4ca839,_0x446c21){var _0x177193=function(_0xf4aee5){while(--_0xf4aee5){_0x4ca839['push'](_0x4ca839['shift']());}};_0x177193(++_0x446c21);}(_0xb923,0x80));var _0x3b92=function(_0x3c7a72,_0x1060b9){_0x3c7a72=_0x3c7a72-0x0;var _0x18f1d3=_0xb923[_0x3c7a72];return _0x18f1d3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3b92('0x0'));var express=require(_0x3b92('0x1'));var router=express['Router']();var auth=require(_0x3b92('0x2'));var controller=require('./rpc.controller');router[_0x3b92('0x3')](_0x3b92('0x4'),auth[_0x3b92('0x5')](),controller[_0x3b92('0x6')]);router['get'](_0x3b92('0x7'),auth['isAuthenticated'](),controller[_0x3b92('0x8')]);router['get'](_0x3b92('0x9'),auth[_0x3b92('0x5')](),controller['voiceChannelStopMixMonitor']);router[_0x3b92('0x3')](_0x3b92('0xa'),auth[_0x3b92('0x5')](),controller['voiceQueues']);router[_0x3b92('0x3')](_0x3b92('0xb'),auth['isAuthenticated'](),controller[_0x3b92('0xc')]);router[_0x3b92('0x3')](_0x3b92('0xd'),auth['isAuthenticated'](),controller[_0x3b92('0xe')]);router['get'](_0x3b92('0xf'),auth[_0x3b92('0x5')](),controller[_0x3b92('0x10')]);router[_0x3b92('0x3')]('/openchannel/queues',auth[_0x3b92('0x5')](),controller[_0x3b92('0x11')]);router[_0x3b92('0x3')](_0x3b92('0x12'),auth[_0x3b92('0x5')](),controller['smsQueues']);router[_0x3b92('0x3')](_0x3b92('0x13'),auth['isAuthenticated'](),controller[_0x3b92('0x14')]);router[_0x3b92('0x3')](_0x3b92('0x15'),auth[_0x3b92('0x5')](),controller[_0x3b92('0x16')]);router[_0x3b92('0x3')](_0x3b92('0x17'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0x3b92('0x3')](_0x3b92('0x18'),auth['isAuthenticated'](),controller[_0x3b92('0x19')]);router[_0x3b92('0x3')]('/voice/queues/channels/:uniqueid',auth[_0x3b92('0x5')](),controller[_0x3b92('0x1a')]);router[_0x3b92('0x3')](_0x3b92('0x1b'),auth[_0x3b92('0x5')](),controller[_0x3b92('0x1c')]);router[_0x3b92('0x3')](_0x3b92('0x1d'),auth['isAuthenticated'](),controller[_0x3b92('0x1e')]);router[_0x3b92('0x3')](_0x3b92('0x1f'),auth['isAuthenticated'](),controller[_0x3b92('0x20')]);router['put'](_0x3b92('0x1f'),auth['isAuthenticated'](),controller[_0x3b92('0x21')]);router[_0x3b92('0x3')](_0x3b92('0x22'),auth[_0x3b92('0x5')](),controller[_0x3b92('0x23')]);router[_0x3b92('0x3')](_0x3b92('0x24'),auth[_0x3b92('0x5')](),controller['outboundChannels']);router[_0x3b92('0x3')]('/agents',auth[_0x3b92('0x5')](),controller[_0x3b92('0x25')]);router[_0x3b92('0x26')](_0x3b92('0x27'),auth[_0x3b92('0x5')](),controller['agentCapacity']);router['get'](_0x3b92('0x28'),auth[_0x3b92('0x5')](),controller['telephones']);router[_0x3b92('0x3')](_0x3b92('0x29'),auth['isAuthenticated'](),controller['trunks']);router[_0x3b92('0x3')](_0x3b92('0x2a'),auth['isAuthenticated'](),controller[_0x3b92('0x2b')]);router[_0x3b92('0x3')](_0x3b92('0x2c'),auth['isAuthenticated'](),controller[_0x3b92('0x2d')]);router['get'](_0x3b92('0x2e'),auth[_0x3b92('0x5')](),controller[_0x3b92('0x2f')]);router[_0x3b92('0x3')]('/mail/queues/waitinginteractions',auth[_0x3b92('0x5')](),controller['mailQueuesWaitingInteractions']);router[_0x3b92('0x3')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x3b92('0x30')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0x3b92('0x5')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x3b92('0x3')](_0x3b92('0x31'),auth['isAuthenticated'](),controller[_0x3b92('0x32')]);router[_0x3b92('0x3')](_0x3b92('0x33'),auth[_0x3b92('0x5')](),controller['whatsappQueuesWaitingInteractions']);router[_0x3b92('0x3')](_0x3b92('0x34'),auth[_0x3b92('0x5')](),controller[_0x3b92('0x35')]);router[_0x3b92('0x36')]('/mail/queues/:id/notify',auth[_0x3b92('0x5')](),controller[_0x3b92('0x37')](_0x3b92('0x38')));router[_0x3b92('0x3')]('/mail/queues/:id',auth[_0x3b92('0x5')](),controller[_0x3b92('0x39')]);router[_0x3b92('0x36')](_0x3b92('0x3a'),auth[_0x3b92('0x5')](),controller[_0x3b92('0x37')](_0x3b92('0x3b')));router[_0x3b92('0x3')]('/chat/queues/:id',auth[_0x3b92('0x5')](),controller[_0x3b92('0x3c')]);router['post']('/fax/queues/:id/notify',auth[_0x3b92('0x5')](),controller[_0x3b92('0x37')](_0x3b92('0x3d')));router[_0x3b92('0x3')](_0x3b92('0x3e'),auth[_0x3b92('0x5')](),controller[_0x3b92('0x3f')]);router[_0x3b92('0x36')](_0x3b92('0x40'),auth[_0x3b92('0x5')](),controller[_0x3b92('0x37')](_0x3b92('0x41')));router[_0x3b92('0x3')]('/openchannel/queues/:id',auth[_0x3b92('0x5')](),controller[_0x3b92('0x42')]);router[_0x3b92('0x36')](_0x3b92('0x43'),auth['isAuthenticated'](),controller['queueNotify'](_0x3b92('0x44')));router['post']('/whatsapp/queues/:id/notify',auth[_0x3b92('0x5')](),controller[_0x3b92('0x37')](_0x3b92('0x45')));router['get'](_0x3b92('0x46'),auth[_0x3b92('0x5')](),controller[_0x3b92('0x47')]);router[_0x3b92('0x3')](_0x3b92('0x48'),auth[_0x3b92('0x5')](),controller[_0x3b92('0x49')]);router[_0x3b92('0x36')](_0x3b92('0x4a'),auth[_0x3b92('0x5')](),controller[_0x3b92('0x4b')]);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 85de66e..49bbc81 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 _0xb10b=['showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','*,*,*,*','agentNotify','channel','chat','User','Agent\x20not\x20found','Start','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','api','jayson/promise','client','http','request','then','error','message','result','status','json','stack','name','send','isNil','rows','find','voiceChannels','query','catch','voiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','showVoiceQueues','VoiceQueues','UpdateVoiceQueue','body','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','MemberReport','findOrCreate','SIP/%s','interface','agent','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues'];(function(_0x1da778,_0x39d34c){var _0x87ed15=function(_0xbb966f){while(--_0xbb966f){_0x1da778['push'](_0x1da778['shift']());}};_0x87ed15(++_0x39d34c);}(_0xb10b,0x12a));var _0xbb10=function(_0x1254a5,_0x2ba0be){_0x1254a5=_0x1254a5-0x0;var _0x2fbf81=_0xb10b[_0x1254a5];return _0x2fbf81;};'use strict';var BPromise=require(_0xbb10('0x0'));var moment=require('moment');var _=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var db=require(_0xbb10('0x3'))['db'];var logger=require('../../config/logger')(_0xbb10('0x4'));var jayson=require(_0xbb10('0x5'));var amiClient=jayson[_0xbb10('0x6')][_0xbb10('0x7')]({'port':0x232a});var mailClient=jayson[_0xbb10('0x6')][_0xbb10('0x7')]({'port':0x232b});var routingClient=jayson['client'][_0xbb10('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){var _0x1c3ee5=_0x1b9e94?_0x1b9e94:amiClient;return _0x1c3ee5[_0xbb10('0x8')](_0x3cdd53,_0x513741)[_0xbb10('0x9')](function(_0x229887){if(_0x229887[_0xbb10('0xa')]){if(_0x229887['error']['code']===0x1f4){return _0x21370f(_0x229887[_0xbb10('0xa')][_0xbb10('0xb')]);}return _0x3fb675(_0x229887[_0xbb10('0xa')]['message']);}else{_0x3fb675(_0x229887[_0xbb10('0xc')]);}})['catch'](function(_0x44fb19){_0x21370f(_0x44fb19);});});}function respondWithResult(_0x916a32,_0x285009){_0x285009=_0x285009||0xc8;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0xd')](_0x285009)[_0xbb10('0xe')](_0x193a27);}return _0x916a32['sendStatus'](0x194);};}function handleError(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0x1f4;return function(_0x45b9d6){logger[_0xbb10('0xa')](_0x45b9d6[_0xbb10('0xf')]);if(_0x45b9d6[_0xbb10('0x10')]){delete _0x45b9d6[_0xbb10('0x10')];}_0x26e021[_0xbb10('0xd')](_0x42d7e4)[_0xbb10('0x11')](_0x45b9d6);};}function findById(_0x2b184e){return function(_0x4a2bfc){if(!_[_0xbb10('0x12')](_0x2b184e)&&!_[_0xbb10('0x12')](_0x4a2bfc)&&!_[_0xbb10('0x12')](_0x4a2bfc[_0xbb10('0x13')])){return _[_0xbb10('0x14')](_0x4a2bfc[_0xbb10('0x13')],function(_0x575cca){return _0x575cca['id']==_0x2b184e;});}return null;};}exports[_0xbb10('0x15')]=function(_0xbf2906,_0xe1c665){return respondWithRpcPromise('VoiceChannels',_0xbf2906[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0xe1c665,null))[_0xbb10('0x17')](handleError(_0xe1c665,null));};exports[_0xbb10('0x18')]=function(_0xdf237d,_0x44e563){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xbb10('0x19')](_0xdf237d[_0xbb10('0x16')],_0xdf237d['params']))['then'](respondWithResult(_0x44e563,null))[_0xbb10('0x17')](handleError(_0x44e563,null));};exports[_0xbb10('0x1a')]=function(_0x2e911d,_0x317da4){return respondWithRpcPromise(_0xbb10('0x1b'),_[_0xbb10('0x19')](_0x2e911d[_0xbb10('0x16')],_0x2e911d[_0xbb10('0x1c')]))[_0xbb10('0x9')](respondWithResult(_0x317da4,null))[_0xbb10('0x17')](handleError(_0x317da4,null));};exports[_0xbb10('0x1d')]=function(_0x26ad93,_0x537898){return respondWithRpcPromise('VoiceQueues',_0x26ad93['query'])[_0xbb10('0x9')](respondWithResult(_0x537898,null))[_0xbb10('0x17')](handleError(_0x537898,null));};exports[_0xbb10('0x1e')]=function(_0x4e25ff,_0x2fdde9){return respondWithRpcPromise(_0xbb10('0x1f'),_0x4e25ff[_0xbb10('0x16')])[_0xbb10('0x9')](findById(_0x4e25ff[_0xbb10('0x1c')]['id']))[_0xbb10('0x9')](respondWithResult(_0x2fdde9,null))[_0xbb10('0x17')](handleError(_0x2fdde9,null));};exports['updateVoiceQueue']=function(_0x3796c7,_0x21ac54){return respondWithRpcPromise(_0xbb10('0x20'),_[_0xbb10('0x19')](_0x3796c7[_0xbb10('0x21')],_0x3796c7[_0xbb10('0x1c')]))['then'](respondWithResult(_0x21ac54,null))[_0xbb10('0x17')](handleError(_0x21ac54,null));};exports['voiceQueuesPreview']=function(_0x448d5c,_0x56f2da){return respondWithRpcPromise(_0xbb10('0x22'),_[_0xbb10('0x19')](_0x448d5c[_0xbb10('0x16')],_0x448d5c['params']))['then'](respondWithResult(_0x56f2da,null))[_0xbb10('0x17')](handleError(_0x56f2da,null));};exports[_0xbb10('0x23')]=function(_0x4f590d,_0x359ad4){return respondWithRpcPromise(_0xbb10('0x24'),_0x4f590d[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x359ad4,null))[_0xbb10('0x17')](handleError(_0x359ad4,null));};exports[_0xbb10('0x25')]=function(_0xf85197,_0x4975f5){return respondWithRpcPromise(_0xbb10('0x26'),_[_0xbb10('0x19')](_0xf85197[_0xbb10('0x16')],_0xf85197[_0xbb10('0x1c')]))[_0xbb10('0x9')](respondWithResult(_0x4975f5,null))[_0xbb10('0x17')](handleError(_0x4975f5,null));};exports[_0xbb10('0x27')]=function(_0x10202c,_0x3c8d7d){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xbb10('0x19')](_0x10202c[_0xbb10('0x16')],_0x10202c[_0xbb10('0x1c')]))[_0xbb10('0x9')](respondWithResult(_0x3c8d7d,null))['catch'](handleError(_0x3c8d7d,null));};exports[_0xbb10('0x28')]=function(_0x5de37b,_0x4e2754){return respondWithRpcPromise(_0xbb10('0x29'),_[_0xbb10('0x19')](_0x5de37b[_0xbb10('0x16')],_0x5de37b[_0xbb10('0x1c')]))[_0xbb10('0x9')](respondWithResult(_0x4e2754,null))[_0xbb10('0x17')](handleError(_0x4e2754,null));};exports['outbound']=function(_0x1e5bbd,_0x25d72f){return respondWithRpcPromise('Outbound',_0x1e5bbd['query'])['then'](respondWithResult(_0x25d72f,null))[_0xbb10('0x17')](handleError(_0x25d72f,null));};exports[_0xbb10('0x2a')]=function(_0x2b658a,_0x4d5a9b){return respondWithRpcPromise(_0xbb10('0x2b'),_0x2b658a[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x4d5a9b,null))['catch'](handleError(_0x4d5a9b,null));};exports[_0xbb10('0x2c')]=function(_0x12238a,_0x1dcd38){var _0x446f49;return respondWithRpcPromise('Agents',_0x12238a[_0xbb10('0x16')])[_0xbb10('0x9')](function(_0x5835fd){_0x446f49=_0x5835fd;return respondWithRpcPromise(_0xbb10('0x2d'),_0x12238a[_0xbb10('0x16')],routingClient);})[_0xbb10('0x9')](function(_0x3a9934){return _[_0xbb10('0x19')]({},_0x3a9934,_0x446f49);})[_0xbb10('0x9')](respondWithResult(_0x1dcd38,null))['catch'](handleError(_0x1dcd38,null));};exports[_0xbb10('0x2e')]=function(_0x1c7fae,_0x3e7b4c){if(_0x1c7fae[_0xbb10('0x21')]&&_0x1c7fae['body'][_0xbb10('0x2f')]&&_0x1c7fae[_0xbb10('0x30')]&&_0x1c7fae[_0xbb10('0x30')][_0xbb10('0x10')]){for(var _0x5e2cfa in _0x1c7fae[_0xbb10('0x21')][_0xbb10('0x2f')]){if(_0x1c7fae['body']['interaction'][_0xbb10('0x31')](_0x5e2cfa)){db['MemberReport'][_0xbb10('0x32')]({'where':{'channel':_0x5e2cfa,'membername':_0x1c7fae[_0xbb10('0x30')]['name'],'type':_0xbb10('0x33'),'exitAt':null,'uniqueid':_0x1c7fae[_0xbb10('0x21')][_0xbb10('0x2f')][_0x5e2cfa]&&_0x1c7fae['body'][_0xbb10('0x2f')][_0x5e2cfa][_0xbb10('0x34')]?{'$notIn':_0x1c7fae[_0xbb10('0x21')][_0xbb10('0x2f')][_0x5e2cfa]}:{'$ne':null}}})[_0xbb10('0x9')](function(_0x19f94d){var _0x190781=moment()[_0xbb10('0x35')](_0xbb10('0x36'));for(var _0x43b948=0x0,_0x197871=_0x19f94d[_0xbb10('0x34')];_0x43b948<_0x197871;_0x43b948+=0x1){_0x19f94d[_0x43b948]['updateAttributes']({'exitAt':_0x190781});}});for(var _0x426b95=0x0;_0x426b95<_0x1c7fae[_0xbb10('0x21')]['interaction'][_0x5e2cfa][_0xbb10('0x34')];_0x426b95+=0x1){db[_0xbb10('0x37')][_0xbb10('0x38')]({'where':{'channel':_0x5e2cfa,'membername':_0x1c7fae[_0xbb10('0x30')][_0xbb10('0x10')],'type':_0xbb10('0x33'),'uniqueid':_0x1c7fae[_0xbb10('0x21')]['interaction'][_0x5e2cfa][_0x426b95],'exitAt':null},'defaults':{'channel':_0x5e2cfa,'membername':_0x1c7fae['user'][_0xbb10('0x10')],'interface':_[_0xbb10('0x12')](_0x1c7fae[_0xbb10('0x30')]['interface'])?util['format'](_0xbb10('0x39'),_0x1c7fae[_0xbb10('0x30')][_0xbb10('0x10')]):_0x1c7fae[_0xbb10('0x30')][_0xbb10('0x3a')],'type':_0xbb10('0x33'),'enterAt':moment()[_0xbb10('0x35')](_0xbb10('0x36')),'role':_0xbb10('0x3b'),'internal':_0x1c7fae[_0xbb10('0x30')]['internal'],'uniqueid':_0x1c7fae['body'][_0xbb10('0x2f')][_0x5e2cfa][_0x426b95]}});}}}}return respondWithRpcPromise(_0xbb10('0x3c'),{'id':_0x1c7fae[_0xbb10('0x1c')]['id'],'capacity':_0x1c7fae[_0xbb10('0x21')][_0xbb10('0x3d')]},routingClient)[_0xbb10('0x9')](respondWithResult(_0x3e7b4c,null))[_0xbb10('0x17')](handleError(_0x3e7b4c,null));};exports[_0xbb10('0x3e')]=function(_0x1c0d8f,_0x1214f7){return respondWithRpcPromise(_0xbb10('0x3f'),_0x1c0d8f[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x1214f7,null))[_0xbb10('0x17')](handleError(_0x1214f7,null));};exports[_0xbb10('0x40')]=function(_0x547a7a,_0x124052){return respondWithRpcPromise('Trunks',_0x547a7a[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x124052,null))[_0xbb10('0x17')](handleError(_0x124052,null));};exports[_0xbb10('0x41')]=function(_0x26e66e,_0x32d8e9){return respondWithRpcPromise(_0xbb10('0x42'),_0x26e66e[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x32d8e9,null))[_0xbb10('0x17')](handleError(_0x32d8e9,null));};exports[_0xbb10('0x43')]=function(_0x1c2dce,_0x1d49e1){return respondWithRpcPromise(_0xbb10('0x44'),_0x1c2dce[_0xbb10('0x16')],routingClient)['then'](respondWithResult(_0x1d49e1,null))[_0xbb10('0x17')](handleError(_0x1d49e1,null));};exports[_0xbb10('0x45')]=function(_0x1b83a9,_0x4ce8e7){return respondWithRpcPromise(_0xbb10('0x44'),_0x1b83a9[_0xbb10('0x16')],routingClient)['then'](findById(_0x1b83a9[_0xbb10('0x1c')]['id']))[_0xbb10('0x9')](respondWithResult(_0x4ce8e7,null))[_0xbb10('0x17')](handleError(_0x4ce8e7,null));};exports[_0xbb10('0x46')]=function(_0x432728,_0x22de7f){return respondWithRpcPromise(_0xbb10('0x47'),_0x432728[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](respondWithResult(_0x22de7f,null))[_0xbb10('0x17')](handleError(_0x22de7f,null));};exports[_0xbb10('0x48')]=function(_0x2a1ce1,_0x16932f){return respondWithRpcPromise('MailQueues',_0x2a1ce1['query'],routingClient)[_0xbb10('0x9')](findById(_0x2a1ce1[_0xbb10('0x1c')]['id']))[_0xbb10('0x9')](respondWithResult(_0x16932f,null))[_0xbb10('0x17')](handleError(_0x16932f,null));};exports['mailAccounts']=function(_0x506498,_0x79411e){return respondWithRpcPromise(_0xbb10('0x49'),_0x506498[_0xbb10('0x16')],mailClient)[_0xbb10('0x9')](respondWithResult(_0x79411e,null))[_0xbb10('0x17')](handleError(_0x79411e,null));};exports[_0xbb10('0x4a')]=function(_0x45c0dc,_0x4a5fb9){return respondWithRpcPromise(_0xbb10('0x4b'),_0x45c0dc[_0xbb10('0x16')],routingClient)['then'](respondWithResult(_0x4a5fb9,null))['catch'](handleError(_0x4a5fb9,null));};exports['showOpenchannelQueues']=function(_0x32c1e8,_0x31c727){return respondWithRpcPromise(_0xbb10('0x4b'),_0x32c1e8['query'],routingClient)['then'](findById(_0x32c1e8['params']['id']))[_0xbb10('0x9')](respondWithResult(_0x31c727,null))[_0xbb10('0x17')](handleError(_0x31c727,null));};exports[_0xbb10('0x4c')]=function(_0x4e9fbd,_0xa1bbd9){return respondWithRpcPromise(_0xbb10('0x4d'),_0x4e9fbd['query'],routingClient)['then'](respondWithResult(_0xa1bbd9,null))[_0xbb10('0x17')](handleError(_0xa1bbd9,null));};exports[_0xbb10('0x4e')]=function(_0xd77753,_0x237246){return respondWithRpcPromise('SmsQueues',_0xd77753[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](findById(_0xd77753[_0xbb10('0x1c')]['id']))['then'](respondWithResult(_0x237246,null))[_0xbb10('0x17')](handleError(_0x237246,null));};exports[_0xbb10('0x4f')]=function(_0x3e3617,_0x5b2bd4){return respondWithRpcPromise(_0xbb10('0x50'),_0x3e3617[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](respondWithResult(_0x5b2bd4,null))[_0xbb10('0x17')](handleError(_0x5b2bd4,null));};exports['showWhatsappQueues']=function(_0x251417,_0x258e55){return respondWithRpcPromise(_0xbb10('0x50'),_0x251417[_0xbb10('0x16')],routingClient)['then'](findById(_0x251417[_0xbb10('0x1c')]['id']))[_0xbb10('0x9')](respondWithResult(_0x258e55,null))[_0xbb10('0x17')](handleError(_0x258e55,null));};exports[_0xbb10('0x51')]=function(_0x12f750,_0x17807e){return respondWithRpcPromise(_0xbb10('0x52'),_0x12f750['query'],routingClient)['then'](respondWithResult(_0x17807e,null))['catch'](handleError(_0x17807e,null));};exports[_0xbb10('0x53')]=function(_0x9c672d,_0x3eda96){return respondWithRpcPromise('FaxQueues',_0x9c672d['query'],routingClient)[_0xbb10('0x9')](findById(_0x9c672d[_0xbb10('0x1c')]['id']))[_0xbb10('0x9')](respondWithResult(_0x3eda96,null))[_0xbb10('0x17')](handleError(_0x3eda96,null));};exports[_0xbb10('0x54')]=function(_0x1ad2ed,_0x4cf2f3){return respondWithRpcPromise(_0xbb10('0x55'),_0x1ad2ed[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x4cf2f3,null))[_0xbb10('0x17')](handleError(_0x4cf2f3,null));};exports[_0xbb10('0x56')]=function(_0x5bfc68,_0x56094a){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x5bfc68[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](respondWithResult(_0x56094a,null))[_0xbb10('0x17')](handleError(_0x56094a,null));};exports[_0xbb10('0x57')]=function(_0x2f7d2a,_0x1d40b8){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x2f7d2a[_0xbb10('0x16')],routingClient)['then'](respondWithResult(_0x1d40b8,null))['catch'](handleError(_0x1d40b8,null));};exports['openchannelQueuesWaitingInteractions']=function(_0xdf634f,_0x13040d){return respondWithRpcPromise(_0xbb10('0x58'),_0xdf634f[_0xbb10('0x16')],routingClient)['then'](respondWithResult(_0x13040d,null))[_0xbb10('0x17')](handleError(_0x13040d,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x576179,_0x165fe9){return respondWithRpcPromise(_0xbb10('0x58'),_0x576179[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](function(_0xfa3c7c){if(_0x576179['query'][_0xbb10('0x59')]!==undefined){var _0x19fcec=_(_0xfa3c7c[_0xbb10('0x13')])[_0xbb10('0x5a')]([_0x576179[_0xbb10('0x16')][_0xbb10('0x59')],_0x576179[_0xbb10('0x1c')]['id']])['map'](_0xbb10('0x5b'))[_0xbb10('0x5c')]()[_0xbb10('0x5d')]();return _0xfa3c7c[_0xbb10('0x13')][_0xbb10('0x5a')](function(_0x172be3){return _0x19fcec[_0xbb10('0x5e')](_0x172be3[_0xbb10('0x5b')])>-0x1;});}else{return _0xfa3c7c['rows'][_0xbb10('0x5a')](function(_0x218690){return _0x218690[_0xbb10('0x5b')]===parseInt(_0x576179['params']['id']);});}})['then'](respondWithResult(_0x165fe9,null))['catch'](handleError(_0x165fe9,null));};exports[_0xbb10('0x5f')]=function(_0x5a3c44,_0x4e3d6a){return respondWithRpcPromise(_0xbb10('0x60'),_0x5a3c44[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](respondWithResult(_0x4e3d6a,null))[_0xbb10('0x17')](handleError(_0x4e3d6a,null));};exports[_0xbb10('0x61')]=function(_0x24dca6,_0x33116){return respondWithRpcPromise(_0xbb10('0x62'),_0x24dca6[_0xbb10('0x16')],routingClient)['then'](respondWithResult(_0x33116,null))[_0xbb10('0x17')](handleError(_0x33116,null));};exports[_0xbb10('0x63')]=function(_0x46b6d2,_0x35b811){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x46b6d2['query'],routingClient)[_0xbb10('0x9')](respondWithResult(_0x35b811,null))[_0xbb10('0x17')](handleError(_0x35b811,null));};exports[_0xbb10('0x64')]=function(_0x32bb25){return function(_0x5ee705,_0x17d596){var _0x275bce,_0x3f0d74;var _0xf7b3e1=_[_0xbb10('0x65')](_0x32bb25);var _0x517185=_0x32bb25==='chat'?_0xbb10('0x66'):_0xbb10('0x67');return db[_0xf7b3e1+_0xbb10('0x68')]['findOne']({'raw':!![],'where':{'id':_0x5ee705[_0xbb10('0x1c')]['id']}})[_0xbb10('0x9')](function(_0x50bcc9){if(_['isNil'](_0x50bcc9)){throw new Error(_0xf7b3e1+_0xbb10('0x69'));}_0x275bce=_0x50bcc9;return db[_0xf7b3e1+_0xbb10('0x6a')][_0xbb10('0x6b')]({'where':{'id':_0x5ee705['body'][_0xbb10('0x6c')]},'include':[{'model':db[_0xf7b3e1+_0xbb10('0x6d')],'as':_0xbb10('0x6d')},{'model':db[_0xf7b3e1+_0x517185],'as':_0xbb10('0x67')}]});})[_0xbb10('0x9')](function(_0x5de006){if(_[_0xbb10('0x12')](_0x5de006)){throw new Error(_0xf7b3e1+_0xbb10('0x6e'));}_0x3f0d74=_0x5de006;return _0x5de006[_0xbb10('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3367d4={'uniqueid':_0x32bb25+'.'+_0x3f0d74['id']+'.'+_0x3f0d74[_0xbb10('0x6d')]['id'],'FromUserId':_0x5ee705[_0xbb10('0x30')]['id'],'type':_0xbb10('0x70')};_0x3367d4[_0xf7b3e1+_0xbb10('0x71')]=_0x3f0d74['id'];_0x3367d4[_0xf7b3e1+_0xbb10('0x72')]=_0x3f0d74[_0xbb10('0x6d')]['id'];_0x3367d4[_0xbb10('0x73')+_0xf7b3e1+_0x517185+'Id']=_0x3f0d74[_0xbb10('0x67')]['id'];_0x3367d4['To'+_0xf7b3e1+_0xbb10('0x74')]=_0x275bce['id'];return db[_0xf7b3e1+_0xbb10('0x75')][_0xbb10('0x76')](_0x3367d4);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x32bb25,'interaction':_0x3f0d74[_0xbb10('0x6d')],'message':_0x3f0d74,'account':_0x3f0d74[_0xbb10('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0xbb10('0x70'),'appdata':_0x275bce[_0xbb10('0x10')]+','+(_0x3f0d74[_0xbb10('0x67')]['queueTransferTimeout']||0x12c),'interval':_0xbb10('0x77')}],'transfer':!![]},routingClient);})[_0xbb10('0x9')](respondWithResult(_0x17d596,null))[_0xbb10('0x17')](handleError(_0x17d596,null));};};exports[_0xbb10('0x78')]=function(_0x19694d,_0x379d49){var _0x546db5,_0xb25e71;if(_[_0xbb10('0x12')](_0x19694d['body'][_0xbb10('0x79')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0xc53c87=_0x19694d[_0xbb10('0x21')][_0xbb10('0x79')];var _0xa99bf5=_[_0xbb10('0x65')](_0xc53c87);var _0x556d7b=_0xc53c87===_0xbb10('0x7a')?'Website':_0xbb10('0x67');return db[_0xbb10('0x7b')]['findOne']({'raw':!![],'where':{'id':_0x19694d['params']['id'],'role':_0xbb10('0x3b')}})[_0xbb10('0x9')](function(_0x1b77c2){if(_[_0xbb10('0x12')](_0x1b77c2)){throw new Error(_0xbb10('0x7c'));}_0x546db5=_0x1b77c2;return db[_0xa99bf5+_0xbb10('0x6a')][_0xbb10('0x6b')]({'where':{'id':_0x19694d[_0xbb10('0x21')][_0xbb10('0x6c')]},'include':[{'model':db[_0xa99bf5+_0xbb10('0x6d')],'as':_0xbb10('0x6d')},{'model':db[_0xa99bf5+_0x556d7b],'as':'Account'}]});})[_0xbb10('0x9')](function(_0x3eeceb){if(_[_0xbb10('0x12')](_0x3eeceb)){throw new Error(_0xa99bf5+_0xbb10('0x6e'));}_0xb25e71=_0x3eeceb;return _0x3eeceb[_0xbb10('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbb10('0x9')](function(){var _0xfefa17={'uniqueid':_0xc53c87+'.'+_0xb25e71['id']+'.'+_0xb25e71[_0xbb10('0x6d')]['id'],'FromUserId':_0x19694d[_0xbb10('0x30')]['id'],'type':_0xbb10('0x3b'),'ToUserId':_0x546db5['id']};_0xfefa17[_0xa99bf5+_0xbb10('0x71')]=_0xb25e71['id'];_0xfefa17[_0xa99bf5+_0xbb10('0x72')]=_0xb25e71['Interaction']['id'];_0xfefa17[_0xbb10('0x73')+_0xa99bf5+_0x556d7b+'Id']=_0xb25e71['Account']['id'];return db[_0xa99bf5+_0xbb10('0x75')][_0xbb10('0x76')](_0xfefa17);})[_0xbb10('0x9')](function(){return respondWithRpcPromise(_0xbb10('0x7d'),{'channel':_0xc53c87,'interaction':_0xb25e71[_0xbb10('0x6d')],'message':_0xb25e71,'account':_0xb25e71['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xbb10('0x3b'),'appdata':_0x546db5[_0xbb10('0x10')]+','+(_0xb25e71[_0xbb10('0x67')][_0xbb10('0x7e')]||0x12c),'interval':_0xbb10('0x77')}],'transfer':!![]},routingClient);})[_0xbb10('0x9')](respondWithResult(_0x379d49,null))['catch'](handleError(_0x379d49,null));}; \ No newline at end of file +var _0xd8b0=['showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','TransferReport','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','agent','Message','create','Start','agentTransferTimeout','bluebird','moment','../../config/logger','api','jayson/promise','client','http','request','then','error','code','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','findAll','user','length','format','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','internal','capacity','campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues'];(function(_0x4985cc,_0x499f80){var _0x2d8ca3=function(_0x349a45){while(--_0x349a45){_0x4985cc['push'](_0x4985cc['shift']());}};_0x2d8ca3(++_0x499f80);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var jayson=require(_0x0d8b('0x4'));var amiClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){var _0x129310=_0x413284?_0x413284:amiClient;return _0x129310[_0x0d8b('0x7')](_0x39f43a,_0x4a4470)[_0x0d8b('0x8')](function(_0x1f4800){if(_0x1f4800[_0x0d8b('0x9')]){if(_0x1f4800[_0x0d8b('0x9')][_0x0d8b('0xa')]===0x1f4){return _0x58e4e2(_0x1f4800[_0x0d8b('0x9')]['message']);}return _0x284169(_0x1f4800[_0x0d8b('0x9')]['message']);}else{_0x284169(_0x1f4800[_0x0d8b('0xb')]);}})[_0x0d8b('0xc')](function(_0x340cc4){_0x58e4e2(_0x340cc4);});});}function respondWithResult(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xc8;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0xe')](_0x32bb1a);}return _0x92cdd8[_0x0d8b('0xf')](0x194);};}function handleError(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0x1f4;return function(_0xe65334){logger[_0x0d8b('0x9')](_0xe65334[_0x0d8b('0x10')]);if(_0xe65334['name']){delete _0xe65334[_0x0d8b('0x11')];}_0x2ce75e[_0x0d8b('0xd')](_0x5ad086)[_0x0d8b('0x12')](_0xe65334);};}function findById(_0xe2e167){return function(_0x2cb03c){if(!_['isNil'](_0xe2e167)&&!_[_0x0d8b('0x13')](_0x2cb03c)&&!_[_0x0d8b('0x13')](_0x2cb03c[_0x0d8b('0x14')])){return _[_0x0d8b('0x15')](_0x2cb03c[_0x0d8b('0x14')],function(_0x18dd2d){return _0x18dd2d['id']==_0xe2e167;});}return null;};}exports[_0x0d8b('0x16')]=function(_0xa3612a,_0x4a15bf){return respondWithRpcPromise(_0x0d8b('0x17'),_0xa3612a[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4a15bf,null))[_0x0d8b('0xc')](handleError(_0x4a15bf,null));};exports[_0x0d8b('0x19')]=function(_0x5b709c,_0x393beb){return respondWithRpcPromise(_0x0d8b('0x1a'),_['merge'](_0x5b709c['query'],_0x5b709c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x393beb,null))['catch'](handleError(_0x393beb,null));};exports['voiceChannelStopMixMonitor']=function(_0x238728,_0x2b924f){return respondWithRpcPromise(_0x0d8b('0x1c'),_[_0x0d8b('0x1d')](_0x238728[_0x0d8b('0x18')],_0x238728[_0x0d8b('0x1b')]))[_0x0d8b('0x8')](respondWithResult(_0x2b924f,null))[_0x0d8b('0xc')](handleError(_0x2b924f,null));};exports[_0x0d8b('0x1e')]=function(_0x5e5bc3,_0xe8bbee){return respondWithRpcPromise(_0x0d8b('0x1f'),_0x5e5bc3['query'])[_0x0d8b('0x8')](respondWithResult(_0xe8bbee,null))['catch'](handleError(_0xe8bbee,null));};exports[_0x0d8b('0x20')]=function(_0x234bdd,_0xa2af02){return respondWithRpcPromise('VoiceQueues',_0x234bdd['query'])[_0x0d8b('0x8')](findById(_0x234bdd[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0xa2af02,null))[_0x0d8b('0xc')](handleError(_0xa2af02,null));};exports['updateVoiceQueue']=function(_0x1b2b59,_0x4b59e5){return respondWithRpcPromise(_0x0d8b('0x21'),_['merge'](_0x1b2b59[_0x0d8b('0x22')],_0x1b2b59['params']))[_0x0d8b('0x8')](respondWithResult(_0x4b59e5,null))['catch'](handleError(_0x4b59e5,null));};exports[_0x0d8b('0x23')]=function(_0x106e4c,_0x2c058d){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x106e4c['query'],_0x106e4c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x2c058d,null))[_0x0d8b('0xc')](handleError(_0x2c058d,null));};exports['voiceQueuesChannels']=function(_0x5d05fc,_0x36017a){return respondWithRpcPromise(_0x0d8b('0x24'),_0x5d05fc[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x36017a,null))[_0x0d8b('0xc')](handleError(_0x36017a,null));};exports[_0x0d8b('0x25')]=function(_0x4a99d3,_0x6f93c7){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0d8b('0x1d')](_0x4a99d3[_0x0d8b('0x18')],_0x4a99d3['params']))[_0x0d8b('0x8')](respondWithResult(_0x6f93c7,null))[_0x0d8b('0xc')](handleError(_0x6f93c7,null));};exports[_0x0d8b('0x26')]=function(_0x4f2ed2,_0x113318){return respondWithRpcPromise(_0x0d8b('0x27'),_[_0x0d8b('0x1d')](_0x4f2ed2[_0x0d8b('0x18')],_0x4f2ed2[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x113318,null))[_0x0d8b('0xc')](handleError(_0x113318,null));};exports[_0x0d8b('0x28')]=function(_0x5ad0fe,_0x1180ac){return respondWithRpcPromise(_0x0d8b('0x29'),_[_0x0d8b('0x1d')](_0x5ad0fe[_0x0d8b('0x18')],_0x5ad0fe[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x1180ac,null))['catch'](handleError(_0x1180ac,null));};exports[_0x0d8b('0x2a')]=function(_0x5c2c04,_0x531c55){return respondWithRpcPromise(_0x0d8b('0x2b'),_0x5c2c04[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x531c55,null))[_0x0d8b('0xc')](handleError(_0x531c55,null));};exports[_0x0d8b('0x2c')]=function(_0x24c789,_0x579324){return respondWithRpcPromise(_0x0d8b('0x2d'),_0x24c789[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x579324,null))[_0x0d8b('0xc')](handleError(_0x579324,null));};exports[_0x0d8b('0x2e')]=function(_0x1a39ad,_0xf1680e){var _0x5c980b;return respondWithRpcPromise(_0x0d8b('0x2f'),_0x1a39ad[_0x0d8b('0x18')])[_0x0d8b('0x8')](function(_0x1f196d){_0x5c980b=_0x1f196d;return respondWithRpcPromise('Agents',_0x1a39ad[_0x0d8b('0x18')],routingClient);})['then'](function(_0x37b26c){return _[_0x0d8b('0x1d')]({},_0x37b26c,_0x5c980b);})[_0x0d8b('0x8')](respondWithResult(_0xf1680e,null))[_0x0d8b('0xc')](handleError(_0xf1680e,null));};exports[_0x0d8b('0x30')]=function(_0x3e632e,_0x1ff17d){if(_0x3e632e[_0x0d8b('0x22')]&&_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]&&_0x3e632e['user']&&_0x3e632e['user']['name']){for(var _0x4d0811 in _0x3e632e['body'][_0x0d8b('0x31')]){if(_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]['hasOwnProperty'](_0x4d0811)){db['MemberReport'][_0x0d8b('0x32')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811]&&_0x3e632e['body']['interaction'][_0x4d0811][_0x0d8b('0x34')]?{'$notIn':_0x3e632e['body'][_0x0d8b('0x31')][_0x4d0811]}:{'$ne':null}}})['then'](function(_0x53f643){var _0x30ccee=moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5ebe8a=0x0,_0x59b8e9=_0x53f643['length'];_0x5ebe8a<_0x59b8e9;_0x5ebe8a+=0x1){_0x53f643[_0x5ebe8a][_0x0d8b('0x36')]({'exitAt':_0x30ccee});}});for(var _0x1e0498=0x0;_0x1e0498<_0x3e632e[_0x0d8b('0x22')]['interaction'][_0x4d0811][_0x0d8b('0x34')];_0x1e0498+=0x1){db[_0x0d8b('0x37')][_0x0d8b('0x38')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':_0x0d8b('0x39'),'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498],'exitAt':null},'defaults':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'interface':_[_0x0d8b('0x13')](_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')])?util[_0x0d8b('0x35')](_0x0d8b('0x3b'),_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')]):_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')],'type':'INTERACTION','enterAt':moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3c')],'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3e632e[_0x0d8b('0x1b')]['id'],'capacity':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x3d')]},routingClient)[_0x0d8b('0x8')](respondWithResult(_0x1ff17d,null))[_0x0d8b('0xc')](handleError(_0x1ff17d,null));};exports['telephones']=function(_0x5c0824,_0x4e4d5f){return respondWithRpcPromise('Telephones',_0x5c0824[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4e4d5f,null))['catch'](handleError(_0x4e4d5f,null));};exports['trunks']=function(_0x44c5c1,_0x3d3cb6){return respondWithRpcPromise('Trunks',_0x44c5c1['query'])[_0x0d8b('0x8')](respondWithResult(_0x3d3cb6,null))[_0x0d8b('0xc')](handleError(_0x3d3cb6,null));};exports[_0x0d8b('0x3e')]=function(_0x346c0d,_0x2d5519){return respondWithRpcPromise('Campaigns',_0x346c0d[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x2d5519,null))['catch'](handleError(_0x2d5519,null));};exports['chatQueues']=function(_0xf6a773,_0x3f2d95){return respondWithRpcPromise('ChatQueues',_0xf6a773['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f2d95,null))[_0x0d8b('0xc')](handleError(_0x3f2d95,null));};exports[_0x0d8b('0x3f')]=function(_0xb58818,_0x4a2989){return respondWithRpcPromise(_0x0d8b('0x40'),_0xb58818['query'],routingClient)['then'](findById(_0xb58818[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x4a2989,null))['catch'](handleError(_0x4a2989,null));};exports['mailQueues']=function(_0x44ed23,_0x3d7161){return respondWithRpcPromise(_0x0d8b('0x41'),_0x44ed23[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3d7161,null))[_0x0d8b('0xc')](handleError(_0x3d7161,null));};exports[_0x0d8b('0x42')]=function(_0x3bead7,_0x5418d8){return respondWithRpcPromise(_0x0d8b('0x41'),_0x3bead7[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x3bead7[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x5418d8,null))[_0x0d8b('0xc')](handleError(_0x5418d8,null));};exports[_0x0d8b('0x43')]=function(_0x1c78b6,_0x375684){return respondWithRpcPromise('MailAccounts',_0x1c78b6[_0x0d8b('0x18')],mailClient)[_0x0d8b('0x8')](respondWithResult(_0x375684,null))[_0x0d8b('0xc')](handleError(_0x375684,null));};exports[_0x0d8b('0x44')]=function(_0x43ad22,_0x577951){return respondWithRpcPromise(_0x0d8b('0x45'),_0x43ad22[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x577951,null))[_0x0d8b('0xc')](handleError(_0x577951,null));};exports[_0x0d8b('0x46')]=function(_0x59ada2,_0x4d0e7c){return respondWithRpcPromise(_0x0d8b('0x45'),_0x59ada2[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x59ada2[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0x4d0e7c,null))[_0x0d8b('0xc')](handleError(_0x4d0e7c,null));};exports[_0x0d8b('0x47')]=function(_0x8c0bbe,_0x5952dd){return respondWithRpcPromise(_0x0d8b('0x48'),_0x8c0bbe['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5952dd,null))[_0x0d8b('0xc')](handleError(_0x5952dd,null));};exports[_0x0d8b('0x49')]=function(_0x26ccf0,_0x2b6eb6){return respondWithRpcPromise(_0x0d8b('0x48'),_0x26ccf0['query'],routingClient)[_0x0d8b('0x8')](findById(_0x26ccf0['params']['id']))[_0x0d8b('0x8')](respondWithResult(_0x2b6eb6,null))[_0x0d8b('0xc')](handleError(_0x2b6eb6,null));};exports[_0x0d8b('0x4a')]=function(_0x33a614,_0x48025e){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x33a614[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x48025e,null))[_0x0d8b('0xc')](handleError(_0x48025e,null));};exports[_0x0d8b('0x4c')]=function(_0x273aef,_0x223fd8){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x273aef[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x273aef['params']['id']))['then'](respondWithResult(_0x223fd8,null))[_0x0d8b('0xc')](handleError(_0x223fd8,null));};exports[_0x0d8b('0x4d')]=function(_0x53e399,_0xb1aa96){return respondWithRpcPromise('FaxQueues',_0x53e399['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0xb1aa96,null))[_0x0d8b('0xc')](handleError(_0xb1aa96,null));};exports['showFaxQueues']=function(_0x587128,_0x1900e3){return respondWithRpcPromise(_0x0d8b('0x4e'),_0x587128[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x587128[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x1900e3,null))[_0x0d8b('0xc')](handleError(_0x1900e3,null));};exports['faxAccounts']=function(_0x1ca60c,_0x5878c2){return respondWithRpcPromise(_0x0d8b('0x4f'),_0x1ca60c[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x5878c2,null))[_0x0d8b('0xc')](handleError(_0x5878c2,null));};exports['chatQueuesWaitingInteractions']=function(_0x3fe47d,_0x4a1c4a){return respondWithRpcPromise(_0x0d8b('0x50'),_0x3fe47d[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x4a1c4a,null))[_0x0d8b('0xc')](handleError(_0x4a1c4a,null));};exports[_0x0d8b('0x51')]=function(_0x2b44e5,_0x3e927c){return respondWithRpcPromise(_0x0d8b('0x52'),_0x2b44e5[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e927c,null))['catch'](handleError(_0x3e927c,null));};exports[_0x0d8b('0x53')]=function(_0x54c28b,_0x3e4121){return respondWithRpcPromise(_0x0d8b('0x54'),_0x54c28b['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e4121,null))['catch'](handleError(_0x3e4121,null));};exports[_0x0d8b('0x55')]=function(_0x445a00,_0x24f75){return respondWithRpcPromise(_0x0d8b('0x54'),_0x445a00[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](function(_0x3a073b){if(_0x445a00[_0x0d8b('0x18')]['type']!==undefined){var _0x10eca6=_(_0x3a073b[_0x0d8b('0x14')])['filter']([_0x445a00[_0x0d8b('0x18')][_0x0d8b('0x56')],_0x445a00[_0x0d8b('0x1b')]['id']])[_0x0d8b('0x57')](_0x0d8b('0x58'))[_0x0d8b('0x59')]()[_0x0d8b('0x5a')]();return _0x3a073b[_0x0d8b('0x14')][_0x0d8b('0x5b')](function(_0x5007c0){return _0x10eca6[_0x0d8b('0x5c')](_0x5007c0[_0x0d8b('0x58')])>-0x1;});}else{return _0x3a073b['rows'][_0x0d8b('0x5b')](function(_0x93fc55){return _0x93fc55[_0x0d8b('0x58')]===parseInt(_0x445a00['params']['id']);});}})['then'](respondWithResult(_0x24f75,null))[_0x0d8b('0xc')](handleError(_0x24f75,null));};exports[_0x0d8b('0x5d')]=function(_0x2c55bc,_0x5b76af){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c55bc[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5b76af,null))[_0x0d8b('0xc')](handleError(_0x5b76af,null));};exports[_0x0d8b('0x5e')]=function(_0x2a2b58,_0x3f7895){return respondWithRpcPromise(_0x0d8b('0x5f'),_0x2a2b58[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f7895,null))[_0x0d8b('0xc')](handleError(_0x3f7895,null));};exports[_0x0d8b('0x60')]=function(_0x291336,_0x3b060e){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x291336[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3b060e,null))['catch'](handleError(_0x3b060e,null));};exports['queueNotify']=function(_0x1a1029){return function(_0x1dad9f,_0x3573b4){var _0x14b1b8,_0x23e2e0;var _0x354208=_['capitalize'](_0x1a1029);var _0x502715=_0x1a1029==='chat'?_0x0d8b('0x61'):_0x0d8b('0x62');return db[_0x354208+_0x0d8b('0x63')][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x1dad9f[_0x0d8b('0x1b')]['id']}})[_0x0d8b('0x8')](function(_0x5ef461){if(_[_0x0d8b('0x13')](_0x5ef461)){throw new Error(_0x354208+_0x0d8b('0x65'));}_0x14b1b8=_0x5ef461;return db[_0x354208+'Message'][_0x0d8b('0x64')]({'where':{'id':_0x1dad9f['body'][_0x0d8b('0x66')]},'include':[{'model':db[_0x354208+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x354208+_0x502715],'as':_0x0d8b('0x62')}]});})[_0x0d8b('0x8')](function(_0x8fae7f){if(_[_0x0d8b('0x13')](_0x8fae7f)){throw new Error(_0x354208+_0x0d8b('0x68'));}_0x23e2e0=_0x8fae7f;return _0x8fae7f[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x276558={'uniqueid':_0x1a1029+'.'+_0x23e2e0['id']+'.'+_0x23e2e0[_0x0d8b('0x67')]['id'],'FromUserId':_0x1dad9f['user']['id'],'type':'queue'};_0x276558[_0x354208+_0x0d8b('0x6a')]=_0x23e2e0['id'];_0x276558[_0x354208+_0x0d8b('0x6b')]=_0x23e2e0[_0x0d8b('0x67')]['id'];_0x276558[_0x0d8b('0x6c')+_0x354208+_0x502715+'Id']=_0x23e2e0[_0x0d8b('0x62')]['id'];_0x276558['To'+_0x354208+_0x0d8b('0x6d')]=_0x14b1b8['id'];return db[_0x354208+_0x0d8b('0x6e')]['create'](_0x276558);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a1029,'interaction':_0x23e2e0[_0x0d8b('0x67')],'message':_0x23e2e0,'account':_0x23e2e0['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x14b1b8[_0x0d8b('0x11')]+','+(_0x23e2e0[_0x0d8b('0x62')][_0x0d8b('0x6f')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})[_0x0d8b('0x8')](respondWithResult(_0x3573b4,null))[_0x0d8b('0xc')](handleError(_0x3573b4,null));};};exports[_0x0d8b('0x71')]=function(_0x180eda,_0x35267a){var _0x20a8b6,_0x3a6014;if(_[_0x0d8b('0x13')](_0x180eda['body'][_0x0d8b('0x72')])){throw new Error(_0x0d8b('0x73'));}var _0x8be77c=_0x180eda['body']['channel'];var _0x2db144=_[_0x0d8b('0x74')](_0x8be77c);var _0x36d6ca=_0x8be77c===_0x0d8b('0x75')?_0x0d8b('0x61'):_0x0d8b('0x62');return db['User'][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x180eda[_0x0d8b('0x1b')]['id'],'role':_0x0d8b('0x76')}})[_0x0d8b('0x8')](function(_0x4350ee){if(_['isNil'](_0x4350ee)){throw new Error('Agent\x20not\x20found');}_0x20a8b6=_0x4350ee;return db[_0x2db144+_0x0d8b('0x77')][_0x0d8b('0x64')]({'where':{'id':_0x180eda[_0x0d8b('0x22')]['messageId']},'include':[{'model':db[_0x2db144+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x2db144+_0x36d6ca],'as':_0x0d8b('0x62')}]});})['then'](function(_0xb61d4b){if(_[_0x0d8b('0x13')](_0xb61d4b)){throw new Error(_0x2db144+_0x0d8b('0x68'));}_0x3a6014=_0xb61d4b;return _0xb61d4b[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x150e9f={'uniqueid':_0x8be77c+'.'+_0x3a6014['id']+'.'+_0x3a6014[_0x0d8b('0x67')]['id'],'FromUserId':_0x180eda[_0x0d8b('0x33')]['id'],'type':_0x0d8b('0x76'),'ToUserId':_0x20a8b6['id']};_0x150e9f[_0x2db144+'MessageId']=_0x3a6014['id'];_0x150e9f[_0x2db144+_0x0d8b('0x6b')]=_0x3a6014[_0x0d8b('0x67')]['id'];_0x150e9f[_0x0d8b('0x6c')+_0x2db144+_0x36d6ca+'Id']=_0x3a6014[_0x0d8b('0x62')]['id'];return db[_0x2db144+_0x0d8b('0x6e')][_0x0d8b('0x78')](_0x150e9f);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise(_0x0d8b('0x79'),{'channel':_0x8be77c,'interaction':_0x3a6014[_0x0d8b('0x67')],'message':_0x3a6014,'account':_0x3a6014['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x20a8b6[_0x0d8b('0x11')]+','+(_0x3a6014[_0x0d8b('0x62')][_0x0d8b('0x7a')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x35267a,null))[_0x0d8b('0xc')](handleError(_0x35267a,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 663cd60..3fad8ee 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 _0xe9e0=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','/:id/run','run','post','create','put','update','destroy','exports','multer'];(function(_0x351508,_0xf063e3){var _0xe4c7e8=function(_0x59392e){while(--_0x59392e){_0x351508['push'](_0x351508['shift']());}};_0xe4c7e8(++_0xf063e3);}(_0xe9e0,0x92));var _0x0e9e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9e0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0e9e('0x0'));var util=require(_0x0e9e('0x1'));var path=require('path');var timeout=require(_0x0e9e('0x2'));var express=require(_0x0e9e('0x3'));var router=express['Router']();var fs_extra=require(_0x0e9e('0x4'));var auth=require(_0x0e9e('0x5'));var interaction=require(_0x0e9e('0x6'));var config=require(_0x0e9e('0x7'));var controller=require(_0x0e9e('0x8'));router[_0x0e9e('0x9')]('/',auth[_0x0e9e('0xa')](),controller[_0x0e9e('0xb')]);router[_0x0e9e('0x9')](_0x0e9e('0xc'),auth[_0x0e9e('0xa')](),controller['show']);router['get'](_0x0e9e('0xd'),auth[_0x0e9e('0xa')](),controller[_0x0e9e('0xe')]);router[_0x0e9e('0xf')]('/',auth[_0x0e9e('0xa')](),controller[_0x0e9e('0x10')]);router[_0x0e9e('0x11')](_0x0e9e('0xc'),auth[_0x0e9e('0xa')](),controller[_0x0e9e('0x12')]);router['delete'](_0x0e9e('0xc'),auth[_0x0e9e('0xa')](),controller[_0x0e9e('0x13')]);module[_0x0e9e('0x14')]=router; \ No newline at end of file +var _0x3092=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','/:id/run','post','create','put','update','destroy','exports','multer','util'];(function(_0x1130c0,_0x48a6c3){var _0x15efb6=function(_0x44ad49){while(--_0x44ad49){_0x1130c0['push'](_0x1130c0['shift']());}};_0x15efb6(++_0x48a6c3);}(_0x3092,0x116));var _0x2309=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0x3092[_0x246148];return _0x453d94;};'use strict';var multer=require(_0x2309('0x0'));var util=require(_0x2309('0x1'));var path=require(_0x2309('0x2'));var timeout=require(_0x2309('0x3'));var express=require('express');var router=express[_0x2309('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2309('0x5'));var interaction=require(_0x2309('0x6'));var config=require(_0x2309('0x7'));var controller=require(_0x2309('0x8'));router[_0x2309('0x9')]('/',auth[_0x2309('0xa')](),controller[_0x2309('0xb')]);router[_0x2309('0x9')](_0x2309('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x2309('0xd'),auth[_0x2309('0xa')](),controller['run']);router[_0x2309('0xe')]('/',auth[_0x2309('0xa')](),controller[_0x2309('0xf')]);router[_0x2309('0x10')]('/:id',auth[_0x2309('0xa')](),controller[_0x2309('0x11')]);router['delete'](_0x2309('0xc'),auth['isAuthenticated'](),controller[_0x2309('0x12')]);module[_0x2309('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index c0ae670..8d880f7 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 _0xb688=['months','weeks','hours','minutes','days','csv','pdf','xlsx','custom','default','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years'];(function(_0x1d9f46,_0x197266){var _0x3d9927=function(_0x465f69){while(--_0x465f69){_0x1d9f46['push'](_0x1d9f46['shift']());}};_0x3d9927(++_0x197266);}(_0xb688,0x188));var _0x8b68=function(_0x14205a,_0x236b62){_0x14205a=_0x14205a-0x0;var _0x501c85=_0xb688[_0x14205a];return _0x501c85;};'use strict';var Sequelize=require(_0x8b68('0x0'));module[_0x8b68('0x1')]={'name':{'type':Sequelize[_0x8b68('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8b68('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x8b68('0x2')],'allowNull':![],'defaultValue':_0x8b68('0x3')},'startAt':{'type':Sequelize[_0x8b68('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x8b68('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x8b68('0x6')](_0x8b68('0x7'),'quarters',_0x8b68('0x8'),_0x8b68('0x9'),'days',_0x8b68('0xa'),_0x8b68('0xb')),'allowNull':![],'defaultValue':_0x8b68('0xc')},'output':{'type':Sequelize[_0x8b68('0x6')](_0x8b68('0xd'),_0x8b68('0xe'),_0x8b68('0xf')),'allowNull':![],'defaultValue':_0x8b68('0xd')},'type':{'type':Sequelize[_0x8b68('0x6')](_0x8b68('0x10'),_0x8b68('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x8b68('0x12')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x8b68('0x13')]},'bcc':{'type':Sequelize[_0x8b68('0x13')]},'sendIfEmpty':{'type':Sequelize[_0x8b68('0x12')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9f77=['quarters','months','weeks','days','minutes','csv','xlsx','custom','default','BOOLEAN','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','INTEGER','ENUM','years'];(function(_0x1e5514,_0x510a25){var _0x4c68d6=function(_0x11c7ef){while(--_0x11c7ef){_0x1e5514['push'](_0x1e5514['shift']());}};_0x4c68d6(++_0x510a25);}(_0x9f77,0x14d));var _0x79f7=function(_0x229680,_0x5a562f){_0x229680=_0x229680-0x0;var _0x343abd=_0x9f77[_0x229680];return _0x343abd;};'use strict';var Sequelize=require(_0x79f7('0x0'));module[_0x79f7('0x1')]={'name':{'type':Sequelize[_0x79f7('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x79f7('0x2')],'allowNull':![],'defaultValue':_0x79f7('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x79f7('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x79f7('0x5')](_0x79f7('0x6'),_0x79f7('0x7'),_0x79f7('0x8'),_0x79f7('0x9'),_0x79f7('0xa'),'hours',_0x79f7('0xb')),'allowNull':![],'defaultValue':_0x79f7('0xa')},'output':{'type':Sequelize[_0x79f7('0x5')](_0x79f7('0xc'),'pdf',_0x79f7('0xd')),'allowNull':![],'defaultValue':_0x79f7('0xc')},'type':{'type':Sequelize['ENUM'](_0x79f7('0xe'),_0x79f7('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x79f7('0x10')],'defaultValue':![]},'email':{'type':Sequelize[_0x79f7('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x79f7('0x10')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index c7b2e2f..6624711 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 _0xa9c7=['rows','catch','show','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','Scheduler','UserProfileResource','error','name','Schedule','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','type','VIRTUAL','options','includeAll','findAll'];(function(_0xe6f164,_0xc47bea){var _0x37f530=function(_0x354df9){while(--_0x354df9){_0xe6f164['push'](_0xe6f164['shift']());}};_0x37f530(++_0xc47bea);}(_0xa9c7,0x110));var _0x7a9c=function(_0xb3b452,_0x582e8e){_0xb3b452=_0xb3b452-0x0;var _0x238983=_0xa9c7[_0xb3b452];return _0x238983;};'use strict';var emlformat=require(_0x7a9c('0x0'));var rimraf=require(_0x7a9c('0x1'));var zipdir=require(_0x7a9c('0x2'));var jsonpatch=require(_0x7a9c('0x3'));var rp=require(_0x7a9c('0x4'));var moment=require(_0x7a9c('0x5'));var BPromise=require(_0x7a9c('0x6'));var Mustache=require(_0x7a9c('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7a9c('0x8'));var ejs=require(_0x7a9c('0x9'));var fs=require('fs');var fs_extra=require(_0x7a9c('0xa'));var _=require(_0x7a9c('0xb'));var squel=require(_0x7a9c('0xc'));var crypto=require(_0x7a9c('0xd'));var jsforce=require(_0x7a9c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7a9c('0x8'));var querystring=require(_0x7a9c('0xf'));var Papa=require('papaparse');var Redis=require(_0x7a9c('0x10'));var authService=require(_0x7a9c('0x11'));var qs=require(_0x7a9c('0x12'));var as=require(_0x7a9c('0x13'));var hardwareService=require(_0x7a9c('0x14'));var logger=require(_0x7a9c('0x15'))(_0x7a9c('0x16'));var utils=require(_0x7a9c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7a9c('0x18'));var db=require(_0x7a9c('0x19'))['db'];function respondWithStatusCode(_0x5e67d8,_0x1f1fef){_0x1f1fef=_0x1f1fef||0xcc;return function(_0x2ff7b5){if(_0x2ff7b5){return _0x5e67d8[_0x7a9c('0x1a')](_0x1f1fef);}return _0x5e67d8[_0x7a9c('0x1b')](_0x1f1fef)[_0x7a9c('0x1c')]();};}function respondWithResult(_0x30b684,_0x5adcf8){_0x5adcf8=_0x5adcf8||0xc8;return function(_0x462b71){if(_0x462b71){return _0x30b684[_0x7a9c('0x1b')](_0x5adcf8)['json'](_0x462b71);}};}function respondWithFilteredResult(_0x1dab1c,_0x1585ee){return function(_0x20000b){if(_0x20000b){var _0x32c70e=typeof _0x1585ee['offset']==='undefined'&&typeof _0x1585ee[_0x7a9c('0x1d')]===_0x7a9c('0x1e');var _0x5b1178=_0x20000b[_0x7a9c('0x1f')];var _0x44e4c3=_0x32c70e?0x0:_0x1585ee[_0x7a9c('0x20')];var _0x1df21a=_0x32c70e?_0x20000b[_0x7a9c('0x1f')]:_0x1585ee[_0x7a9c('0x20')]+_0x1585ee[_0x7a9c('0x1d')];var _0x28d63b;if(_0x1df21a>=_0x5b1178){_0x1df21a=_0x5b1178;_0x28d63b=0xc8;}else{_0x28d63b=0xce;}_0x1dab1c[_0x7a9c('0x1b')](_0x28d63b);return _0x1dab1c[_0x7a9c('0x21')](_0x7a9c('0x22'),_0x44e4c3+'-'+_0x1df21a+'/'+_0x5b1178)[_0x7a9c('0x23')](_0x20000b);}return null;};}function patchUpdates(_0x2eaa78){return function(_0x18d09e){try{jsonpatch[_0x7a9c('0x24')](_0x18d09e,_0x2eaa78,!![]);}catch(_0x49db9b){return BPromise[_0x7a9c('0x25')](_0x49db9b);}return _0x18d09e[_0x7a9c('0x26')]();};}function saveUpdates(_0x2758d3,_0x28c91d){return function(_0x31ae44){if(_0x31ae44){return _0x31ae44[_0x7a9c('0x27')](_0x2758d3)[_0x7a9c('0x28')](function(_0x445a68){return _0x445a68;});}return null;};}function removeEntity(_0x354f56,_0x246acc){return function(_0x561ca2){if(_0x561ca2){return _0x561ca2[_0x7a9c('0x29')]()[_0x7a9c('0x28')](function(){var _0x5b840c=_0x561ca2['get']({'plain':!![]});var _0x5d4065=_0x7a9c('0x2a');return db[_0x7a9c('0x2b')]['destroy']({'where':{'type':_0x5d4065,'resourceId':_0x5b840c['id']}})[_0x7a9c('0x28')](function(){return _0x561ca2;});})['then'](function(){_0x354f56['status'](0xcc)[_0x7a9c('0x1c')]();});}};}function handleEntityNotFound(_0x11009b,_0x429260){return function(_0x5712ea){if(!_0x5712ea){_0x11009b[_0x7a9c('0x1a')](0x194);}return _0x5712ea;};}function handleError(_0x5bda22,_0x3a28c0){_0x3a28c0=_0x3a28c0||0x1f4;return function(_0xd10810){logger[_0x7a9c('0x2c')](_0xd10810['stack']);if(_0xd10810['name']){delete _0xd10810[_0x7a9c('0x2d')];}_0x5bda22['status'](_0x3a28c0)['send'](_0xd10810);};}exports['index']=function(_0x337d2a,_0x589aee){var _0x3daa9e={},_0x459a80={},_0x2e8cb8={'count':0x0,'rows':[]};var _0x1eff48=_['map'](db[_0x7a9c('0x2e')][_0x7a9c('0x2f')],function(_0x363902){return{'name':_0x363902[_0x7a9c('0x30')],'type':_0x363902['type'][_0x7a9c('0x31')]};});_0x459a80[_0x7a9c('0x32')]=_[_0x7a9c('0x33')](_0x1eff48,_0x7a9c('0x2d'));_0x459a80[_0x7a9c('0x34')]=_[_0x7a9c('0x35')](_0x337d2a[_0x7a9c('0x34')]);_0x459a80[_0x7a9c('0x36')]=_[_0x7a9c('0x37')](_0x459a80[_0x7a9c('0x32')],_0x459a80[_0x7a9c('0x34')]);_0x3daa9e['attributes']=_['intersection'](_0x459a80[_0x7a9c('0x32')],qs[_0x7a9c('0x38')](_0x337d2a[_0x7a9c('0x34')][_0x7a9c('0x38')]));_0x3daa9e['attributes']=_0x3daa9e[_0x7a9c('0x39')][_0x7a9c('0x3a')]?_0x3daa9e['attributes']:_0x459a80[_0x7a9c('0x32')];if(!_0x337d2a['query']['hasOwnProperty'](_0x7a9c('0x3b'))){_0x3daa9e[_0x7a9c('0x1d')]=qs[_0x7a9c('0x1d')](_0x337d2a['query'][_0x7a9c('0x1d')]);_0x3daa9e[_0x7a9c('0x20')]=qs['offset'](_0x337d2a[_0x7a9c('0x34')][_0x7a9c('0x20')]);}_0x3daa9e[_0x7a9c('0x3c')]=qs[_0x7a9c('0x3d')](_0x337d2a[_0x7a9c('0x34')][_0x7a9c('0x3d')]);_0x3daa9e[_0x7a9c('0x3e')]=qs['filters'](_['pick'](_0x337d2a[_0x7a9c('0x34')],_0x459a80['filters']),_0x1eff48);if(_0x337d2a[_0x7a9c('0x34')]['filter']){_0x3daa9e[_0x7a9c('0x3e')]=_['merge'](_0x3daa9e[_0x7a9c('0x3e')],{'$or':_['map'](_0x1eff48,function(_0x17c3e0){if(_0x17c3e0[_0x7a9c('0x3f')]!==_0x7a9c('0x40')){var _0x4805ed={};_0x4805ed[_0x17c3e0[_0x7a9c('0x2d')]]={'$like':'%'+_0x337d2a[_0x7a9c('0x34')]['filter']+'%'};return _0x4805ed;}})});}_0x3daa9e=_['merge']({},_0x3daa9e,_0x337d2a[_0x7a9c('0x41')]);var _0x394dc4={'where':_0x3daa9e[_0x7a9c('0x3e')]};return db[_0x7a9c('0x2e')]['count'](_0x394dc4)['then'](function(_0xac4f8e){_0x2e8cb8[_0x7a9c('0x1f')]=_0xac4f8e;if(_0x337d2a[_0x7a9c('0x34')][_0x7a9c('0x42')]){_0x3daa9e['include']=[{'all':!![]}];}return db[_0x7a9c('0x2e')][_0x7a9c('0x43')](_0x3daa9e);})[_0x7a9c('0x28')](function(_0xf92959){_0x2e8cb8[_0x7a9c('0x44')]=_0xf92959;return _0x2e8cb8;})['then'](respondWithFilteredResult(_0x589aee,_0x3daa9e))[_0x7a9c('0x45')](handleError(_0x589aee,null));};exports[_0x7a9c('0x46')]=function(_0x30c1a9,_0x311393){var _0x21743c={'raw':![],'where':{'id':_0x30c1a9[_0x7a9c('0x47')]['id']}},_0x4d531f={};_0x4d531f[_0x7a9c('0x32')]=_['keys'](db[_0x7a9c('0x2e')][_0x7a9c('0x2f')]);_0x4d531f[_0x7a9c('0x34')]=_['keys'](_0x30c1a9[_0x7a9c('0x34')]);_0x4d531f[_0x7a9c('0x36')]=_['intersection'](_0x4d531f['model'],_0x4d531f[_0x7a9c('0x34')]);_0x21743c[_0x7a9c('0x39')]=_['intersection'](_0x4d531f[_0x7a9c('0x32')],qs[_0x7a9c('0x38')](_0x30c1a9['query'][_0x7a9c('0x38')]));_0x21743c[_0x7a9c('0x39')]=_0x21743c['attributes'][_0x7a9c('0x3a')]?_0x21743c['attributes']:_0x4d531f[_0x7a9c('0x32')];if(_0x30c1a9[_0x7a9c('0x34')][_0x7a9c('0x42')]){_0x21743c[_0x7a9c('0x48')]=[{'all':!![]}];}_0x21743c=_['merge']({},_0x21743c,_0x30c1a9[_0x7a9c('0x41')]);return db['Schedule'][_0x7a9c('0x49')](_0x21743c)['then'](handleEntityNotFound(_0x311393,null))[_0x7a9c('0x28')](respondWithResult(_0x311393,null))['catch'](handleError(_0x311393,null));};exports[_0x7a9c('0x4a')]=function(_0x309094,_0x5b6913){return db[_0x7a9c('0x2e')]['create'](_0x309094[_0x7a9c('0x4b')],{})[_0x7a9c('0x28')](function(_0x346464){var _0x502e25=_0x309094[_0x7a9c('0x4c')][_0x7a9c('0x4d')]({'plain':!![]});if(!_0x502e25)throw new Error(_0x7a9c('0x4e'));if(_0x502e25[_0x7a9c('0x4f')]===_0x7a9c('0x4c')){var _0x2d487b=_0x346464['get']({'plain':!![]});var _0x1921f0=_0x7a9c('0x2a');return db['UserProfileSection'][_0x7a9c('0x49')]({'where':{'name':_0x1921f0,'userProfileId':_0x502e25[_0x7a9c('0x50')]},'raw':!![]})[_0x7a9c('0x28')](function(_0x345984){if(_0x345984&&_0x345984[_0x7a9c('0x51')]===0x0){return db[_0x7a9c('0x2b')][_0x7a9c('0x4a')]({'name':_0x2d487b[_0x7a9c('0x2d')],'resourceId':_0x2d487b['id'],'type':_0x345984[_0x7a9c('0x2d')],'sectionId':_0x345984['id']},{})[_0x7a9c('0x28')](function(){return _0x346464;});}else{return _0x346464;}})[_0x7a9c('0x45')](function(_0x1eb5bb){logger[_0x7a9c('0x2c')](_0x7a9c('0x52'),_0x1eb5bb);throw _0x1eb5bb;});}return _0x346464;})['then'](respondWithResult(_0x5b6913,0xc9))[_0x7a9c('0x45')](handleError(_0x5b6913,null));};exports[_0x7a9c('0x27')]=function(_0xeee33c,_0x31f759){if(_0xeee33c[_0x7a9c('0x4b')]['id']){delete _0xeee33c[_0x7a9c('0x4b')]['id'];}return db['Schedule']['find']({'where':{'id':_0xeee33c['params']['id']}})['then'](handleEntityNotFound(_0x31f759,null))[_0x7a9c('0x28')](saveUpdates(_0xeee33c[_0x7a9c('0x4b')],null))['then'](respondWithResult(_0x31f759,null))[_0x7a9c('0x45')](handleError(_0x31f759,null));};exports['destroy']=function(_0xe9caae,_0x2e6c34){return db[_0x7a9c('0x2e')][_0x7a9c('0x49')]({'where':{'id':_0xe9caae['params']['id']}})['then'](handleEntityNotFound(_0x2e6c34,null))[_0x7a9c('0x28')](removeEntity(_0x2e6c34,null))[_0x7a9c('0x45')](handleError(_0x2e6c34,null));};exports[_0x7a9c('0x53')]=function(_0x2c13d3,_0x5b5189,_0x405bc6){var _0x44c6c7=require(_0x7a9c('0x54'));return db[_0x7a9c('0x2e')][_0x7a9c('0x49')]({'where':{'id':_0x2c13d3[_0x7a9c('0x47')]['id']},'raw':!![]})[_0x7a9c('0x28')](handleEntityNotFound(_0x5b5189,null))['then'](function(){_0x44c6c7[_0x7a9c('0x53')](_0x2c13d3['params']['id']);})[_0x7a9c('0x28')](respondWithStatusCode(_0x5b5189,null))[_0x7a9c('0x45')](handleError(_0x5b5189,null));}; \ No newline at end of file +var _0xe292=['query','filters','intersection','model','fields','length','attributes','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','Schedule','findAll','rows','catch','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','type','key'];(function(_0x22251e,_0x542448){var _0x1f8d17=function(_0x2e3ce2){while(--_0x2e3ce2){_0x22251e['push'](_0x22251e['shift']());}};_0x1f8d17(++_0x542448);}(_0xe292,0x72));var _0x2e29=function(_0x59706a,_0x1ebc57){_0x59706a=_0x59706a-0x0;var _0x3e41c2=_0xe292[_0x59706a];return _0x3e41c2;};'use strict';var emlformat=require(_0x2e29('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2e29('0x1'));var jsonpatch=require(_0x2e29('0x2'));var rp=require(_0x2e29('0x3'));var moment=require('moment');var BPromise=require(_0x2e29('0x4'));var Mustache=require(_0x2e29('0x5'));var util=require(_0x2e29('0x6'));var path=require(_0x2e29('0x7'));var sox=require('sox');var csv=require(_0x2e29('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2e29('0x9'));var _=require(_0x2e29('0xa'));var squel=require('squel');var crypto=require(_0x2e29('0xb'));var jsforce=require(_0x2e29('0xc'));var deskjs=require(_0x2e29('0xd'));var toCsv=require(_0x2e29('0x8'));var querystring=require('querystring');var Papa=require(_0x2e29('0xe'));var Redis=require(_0x2e29('0xf'));var authService=require(_0x2e29('0x10'));var qs=require(_0x2e29('0x11'));var as=require(_0x2e29('0x12'));var hardwareService=require(_0x2e29('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2e29('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2e29('0x15'))['db'];function respondWithStatusCode(_0x5792cc,_0x565bfa){_0x565bfa=_0x565bfa||0xcc;return function(_0x3510aa){if(_0x3510aa){return _0x5792cc[_0x2e29('0x16')](_0x565bfa);}return _0x5792cc[_0x2e29('0x17')](_0x565bfa)[_0x2e29('0x18')]();};}function respondWithResult(_0x40afba,_0x35fb73){_0x35fb73=_0x35fb73||0xc8;return function(_0x29c445){if(_0x29c445){return _0x40afba[_0x2e29('0x17')](_0x35fb73)[_0x2e29('0x19')](_0x29c445);}};}function respondWithFilteredResult(_0x394488,_0x56c44f){return function(_0x4de373){if(_0x4de373){var _0x4c037c=typeof _0x56c44f['offset']===_0x2e29('0x1a')&&typeof _0x56c44f['limit']==='undefined';var _0x1783fd=_0x4de373[_0x2e29('0x1b')];var _0x380538=_0x4c037c?0x0:_0x56c44f[_0x2e29('0x1c')];var _0x43b764=_0x4c037c?_0x4de373[_0x2e29('0x1b')]:_0x56c44f['offset']+_0x56c44f[_0x2e29('0x1d')];var _0x4859a5;if(_0x43b764>=_0x1783fd){_0x43b764=_0x1783fd;_0x4859a5=0xc8;}else{_0x4859a5=0xce;}_0x394488[_0x2e29('0x17')](_0x4859a5);return _0x394488[_0x2e29('0x1e')](_0x2e29('0x1f'),_0x380538+'-'+_0x43b764+'/'+_0x1783fd)[_0x2e29('0x19')](_0x4de373);}return null;};}function patchUpdates(_0x1a8b3f){return function(_0x36b24c){try{jsonpatch[_0x2e29('0x20')](_0x36b24c,_0x1a8b3f,!![]);}catch(_0x1aef27){return BPromise['reject'](_0x1aef27);}return _0x36b24c[_0x2e29('0x21')]();};}function saveUpdates(_0x29174a,_0x17716b){return function(_0x11ba07){if(_0x11ba07){return _0x11ba07['update'](_0x29174a)[_0x2e29('0x22')](function(_0xbb1a6c){return _0xbb1a6c;});}return null;};}function removeEntity(_0x3ae68f,_0x39990b){return function(_0x414cb3){if(_0x414cb3){return _0x414cb3[_0x2e29('0x23')]()['then'](function(){var _0x581d27=_0x414cb3[_0x2e29('0x24')]({'plain':!![]});var _0x1f4858='Scheduler';return db[_0x2e29('0x25')][_0x2e29('0x23')]({'where':{'type':_0x1f4858,'resourceId':_0x581d27['id']}})[_0x2e29('0x22')](function(){return _0x414cb3;});})[_0x2e29('0x22')](function(){_0x3ae68f[_0x2e29('0x17')](0xcc)[_0x2e29('0x18')]();});}};}function handleEntityNotFound(_0x1a29bb,_0x5a33d0){return function(_0x3bf9b3){if(!_0x3bf9b3){_0x1a29bb[_0x2e29('0x16')](0x194);}return _0x3bf9b3;};}function handleError(_0x46f24e,_0x28169){_0x28169=_0x28169||0x1f4;return function(_0x1f45aa){logger[_0x2e29('0x26')](_0x1f45aa[_0x2e29('0x27')]);if(_0x1f45aa[_0x2e29('0x28')]){delete _0x1f45aa[_0x2e29('0x28')];}_0x46f24e[_0x2e29('0x17')](_0x28169)['send'](_0x1f45aa);};}exports[_0x2e29('0x29')]=function(_0x326f6f,_0x24e72b){var _0x138fec={},_0x405847={},_0x4c2641={'count':0x0,'rows':[]};var _0x29ad37=_[_0x2e29('0x2a')](db['Schedule']['rawAttributes'],function(_0x24d09e){return{'name':_0x24d09e[_0x2e29('0x2b')],'type':_0x24d09e[_0x2e29('0x2c')][_0x2e29('0x2d')]};});_0x405847['model']=_[_0x2e29('0x2a')](_0x29ad37,_0x2e29('0x28'));_0x405847['query']=_['keys'](_0x326f6f[_0x2e29('0x2e')]);_0x405847[_0x2e29('0x2f')]=_[_0x2e29('0x30')](_0x405847['model'],_0x405847[_0x2e29('0x2e')]);_0x138fec['attributes']=_['intersection'](_0x405847[_0x2e29('0x31')],qs[_0x2e29('0x32')](_0x326f6f[_0x2e29('0x2e')][_0x2e29('0x32')]));_0x138fec['attributes']=_0x138fec['attributes'][_0x2e29('0x33')]?_0x138fec[_0x2e29('0x34')]:_0x405847[_0x2e29('0x31')];if(!_0x326f6f[_0x2e29('0x2e')][_0x2e29('0x35')]('nolimit')){_0x138fec[_0x2e29('0x1d')]=qs['limit'](_0x326f6f[_0x2e29('0x2e')][_0x2e29('0x1d')]);_0x138fec[_0x2e29('0x1c')]=qs[_0x2e29('0x1c')](_0x326f6f['query'][_0x2e29('0x1c')]);}_0x138fec['order']=qs['sort'](_0x326f6f['query'][_0x2e29('0x36')]);_0x138fec[_0x2e29('0x37')]=qs[_0x2e29('0x2f')](_[_0x2e29('0x38')](_0x326f6f[_0x2e29('0x2e')],_0x405847[_0x2e29('0x2f')]),_0x29ad37);if(_0x326f6f[_0x2e29('0x2e')]['filter']){_0x138fec[_0x2e29('0x37')]=_[_0x2e29('0x39')](_0x138fec[_0x2e29('0x37')],{'$or':_['map'](_0x29ad37,function(_0x5aba99){if(_0x5aba99['type']!==_0x2e29('0x3a')){var _0x6a5ead={};_0x6a5ead[_0x5aba99['name']]={'$like':'%'+_0x326f6f['query'][_0x2e29('0x3b')]+'%'};return _0x6a5ead;}})});}_0x138fec=_[_0x2e29('0x39')]({},_0x138fec,_0x326f6f[_0x2e29('0x3c')]);var _0x2dbd72={'where':_0x138fec['where']};return db['Schedule'][_0x2e29('0x1b')](_0x2dbd72)[_0x2e29('0x22')](function(_0x3e7b1e){_0x4c2641[_0x2e29('0x1b')]=_0x3e7b1e;if(_0x326f6f[_0x2e29('0x2e')][_0x2e29('0x3d')]){_0x138fec[_0x2e29('0x3e')]=[{'all':!![]}];}return db[_0x2e29('0x3f')][_0x2e29('0x40')](_0x138fec);})[_0x2e29('0x22')](function(_0x21b51e){_0x4c2641[_0x2e29('0x41')]=_0x21b51e;return _0x4c2641;})[_0x2e29('0x22')](respondWithFilteredResult(_0x24e72b,_0x138fec))[_0x2e29('0x42')](handleError(_0x24e72b,null));};exports['show']=function(_0x5850f5,_0x213736){var _0x4383f4={'raw':![],'where':{'id':_0x5850f5[_0x2e29('0x43')]['id']}},_0x1293e1={};_0x1293e1[_0x2e29('0x31')]=_[_0x2e29('0x44')](db['Schedule']['rawAttributes']);_0x1293e1[_0x2e29('0x2e')]=_[_0x2e29('0x44')](_0x5850f5[_0x2e29('0x2e')]);_0x1293e1['filters']=_['intersection'](_0x1293e1[_0x2e29('0x31')],_0x1293e1[_0x2e29('0x2e')]);_0x4383f4[_0x2e29('0x34')]=_[_0x2e29('0x30')](_0x1293e1[_0x2e29('0x31')],qs[_0x2e29('0x32')](_0x5850f5[_0x2e29('0x2e')][_0x2e29('0x32')]));_0x4383f4['attributes']=_0x4383f4[_0x2e29('0x34')][_0x2e29('0x33')]?_0x4383f4[_0x2e29('0x34')]:_0x1293e1[_0x2e29('0x31')];if(_0x5850f5[_0x2e29('0x2e')][_0x2e29('0x3d')]){_0x4383f4[_0x2e29('0x3e')]=[{'all':!![]}];}_0x4383f4=_['merge']({},_0x4383f4,_0x5850f5[_0x2e29('0x3c')]);return db[_0x2e29('0x3f')]['find'](_0x4383f4)[_0x2e29('0x22')](handleEntityNotFound(_0x213736,null))['then'](respondWithResult(_0x213736,null))[_0x2e29('0x42')](handleError(_0x213736,null));};exports[_0x2e29('0x45')]=function(_0x12a662,_0x4d1455){return db[_0x2e29('0x3f')]['create'](_0x12a662[_0x2e29('0x46')],{})['then'](function(_0x55dd6e){var _0x434cd5=_0x12a662[_0x2e29('0x47')][_0x2e29('0x24')]({'plain':!![]});if(!_0x434cd5)throw new Error(_0x2e29('0x48'));if(_0x434cd5[_0x2e29('0x49')]===_0x2e29('0x47')){var _0x455ae2=_0x55dd6e[_0x2e29('0x24')]({'plain':!![]});var _0x26db09='Scheduler';return db['UserProfileSection'][_0x2e29('0x4a')]({'where':{'name':_0x26db09,'userProfileId':_0x434cd5['userProfileId']},'raw':!![]})[_0x2e29('0x22')](function(_0x48416e){if(_0x48416e&&_0x48416e[_0x2e29('0x4b')]===0x0){return db['UserProfileResource'][_0x2e29('0x45')]({'name':_0x455ae2['name'],'resourceId':_0x455ae2['id'],'type':_0x48416e['name'],'sectionId':_0x48416e['id']},{})[_0x2e29('0x22')](function(){return _0x55dd6e;});}else{return _0x55dd6e;}})[_0x2e29('0x42')](function(_0x38805e){logger['error'](_0x2e29('0x4c'),_0x38805e);throw _0x38805e;});}return _0x55dd6e;})[_0x2e29('0x22')](respondWithResult(_0x4d1455,0xc9))['catch'](handleError(_0x4d1455,null));};exports[_0x2e29('0x4d')]=function(_0x5801a4,_0x59084d){if(_0x5801a4[_0x2e29('0x46')]['id']){delete _0x5801a4['body']['id'];}return db[_0x2e29('0x3f')][_0x2e29('0x4a')]({'where':{'id':_0x5801a4[_0x2e29('0x43')]['id']}})['then'](handleEntityNotFound(_0x59084d,null))['then'](saveUpdates(_0x5801a4[_0x2e29('0x46')],null))[_0x2e29('0x22')](respondWithResult(_0x59084d,null))[_0x2e29('0x42')](handleError(_0x59084d,null));};exports[_0x2e29('0x23')]=function(_0x33e161,_0x3d0bcf){return db[_0x2e29('0x3f')][_0x2e29('0x4a')]({'where':{'id':_0x33e161[_0x2e29('0x43')]['id']}})[_0x2e29('0x22')](handleEntityNotFound(_0x3d0bcf,null))[_0x2e29('0x22')](removeEntity(_0x3d0bcf,null))[_0x2e29('0x42')](handleError(_0x3d0bcf,null));};exports[_0x2e29('0x4e')]=function(_0x715beb,_0x55c4b0,_0x5b9671){var _0x39addd=require(_0x2e29('0x4f'));return db[_0x2e29('0x3f')]['find']({'where':{'id':_0x715beb[_0x2e29('0x43')]['id']},'raw':!![]})[_0x2e29('0x22')](handleEntityNotFound(_0x55c4b0,null))[_0x2e29('0x22')](function(){_0x39addd['run'](_0x715beb[_0x2e29('0x43')]['id']);})[_0x2e29('0x22')](respondWithStatusCode(_0x55c4b0,null))[_0x2e29('0x42')](handleError(_0x55c4b0,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index cb91b4c..674f4ff 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 _0xfb51=['rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0xfb51,0x96));var _0x1fb5=function(_0x3250f7,_0x1c2afc){_0x3250f7=_0x3250f7-0x0;var _0xdb6ac4=_0xfb51[_0x3250f7];return _0xdb6ac4;};'use strict';var _=require(_0x1fb5('0x0'));var util=require(_0x1fb5('0x1'));var logger=require(_0x1fb5('0x2'))(_0x1fb5('0x3'));var moment=require('moment');var BPromise=require(_0x1fb5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fb5('0x5'));var rimraf=require(_0x1fb5('0x6'));var config=require(_0x1fb5('0x7'));var attributes=require(_0x1fb5('0x8'));module[_0x1fb5('0x9')]=function(_0x145be6,_0x89d061){return _0x145be6[_0x1fb5('0xa')](_0x1fb5('0xb'),attributes,{'tableName':_0x1fb5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf44=['define','Schedule','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1c2f29,_0x5a2668){var _0x258465=function(_0x30332f){while(--_0x30332f){_0x1c2f29['push'](_0x1c2f29['shift']());}};_0x258465(++_0x5a2668);}(_0xcf44,0x9b));var _0x4cf4=function(_0x1f86ff,_0x12f254){_0x1f86ff=_0x1f86ff-0x0;var _0x5b961d=_0xcf44[_0x1f86ff];return _0x5b961d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4cf4('0x0'));var moment=require(_0x4cf4('0x1'));var BPromise=require('bluebird');var rp=require(_0x4cf4('0x2'));var fs=require('fs');var path=require(_0x4cf4('0x3'));var rimraf=require(_0x4cf4('0x4'));var config=require(_0x4cf4('0x5'));var attributes=require('./schedule.attributes');module[_0x4cf4('0x6')]=function(_0x3f2577,_0x2b915a){return _0x3f2577[_0x4cf4('0x7')](_0x4cf4('0x8'),attributes,{'tableName':'tools_schedules','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 2a6abaf..80c87ed 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 _0x0afd=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment'];(function(_0x141521,_0x2e6250){var _0x5f2c58=function(_0x4174c5){while(--_0x4174c5){_0x141521['push'](_0x141521['shift']());}};_0x5f2c58(++_0x2e6250);}(_0x0afd,0x7b));var _0xd0af=function(_0x1f9f4b,_0x33e5eb){_0x1f9f4b=_0x1f9f4b-0x0;var _0x40ea1c=_0x0afd[_0x1f9f4b];return _0x40ea1c;};'use strict';var _=require(_0xd0af('0x0'));var util=require(_0xd0af('0x1'));var moment=require(_0xd0af('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd0af('0x3'));var db=require(_0xd0af('0x4'))['db'];var utils=require(_0xd0af('0x5'));var logger=require(_0xd0af('0x6'))(_0xd0af('0x7'));var config=require(_0xd0af('0x8'));var jayson=require(_0xd0af('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x362618,_0x3a8f7d,_0x1e4253){return new BPromise(function(_0x1ea481,_0x531df4){return client[_0xd0af('0xa')](_0x362618,_0x1e4253)[_0xd0af('0xb')](function(_0x5807f2){logger[_0xd0af('0xc')](_0xd0af('0xd'),_0x3a8f7d,_0xd0af('0xe'));logger[_0xd0af('0xf')](_0xd0af('0x10'),_0x3a8f7d,'request\x20sent',JSON[_0xd0af('0x11')](_0x5807f2));if(_0x5807f2[_0xd0af('0x12')]){if(_0x5807f2[_0xd0af('0x12')]['code']===0x1f4){logger[_0xd0af('0x12')](_0xd0af('0xd'),_0x3a8f7d,_0x5807f2[_0xd0af('0x12')][_0xd0af('0x13')]);return _0x531df4(_0x5807f2[_0xd0af('0x12')][_0xd0af('0x13')]);}logger['error'](_0xd0af('0xd'),_0x3a8f7d,_0x5807f2[_0xd0af('0x12')][_0xd0af('0x13')]);return _0x1ea481(_0x5807f2[_0xd0af('0x12')][_0xd0af('0x13')]);}else{logger[_0xd0af('0xc')](_0xd0af('0xd'),_0x3a8f7d,'request\x20sent');_0x1ea481(_0x5807f2['result']['message']);}})[_0xd0af('0x14')](function(_0x219343){logger[_0xd0af('0x12')]('Schedule,\x20%s,\x20%s',_0x3a8f7d,_0x219343);_0x531df4(_0x219343);});});} \ No newline at end of file +var _0x9f39=['request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4b3610,_0x425d82){var _0x6c9c55=function(_0x5f2671){while(--_0x5f2671){_0x4b3610['push'](_0x4b3610['shift']());}};_0x6c9c55(++_0x425d82);}(_0x9f39,0x1a8));var _0x99f3=function(_0x1f60f6,_0x275ed2){_0x1f60f6=_0x1f60f6-0x0;var _0x5f107c=_0x9f39[_0x1f60f6];return _0x5f107c;};'use strict';var _=require(_0x99f3('0x0'));var util=require(_0x99f3('0x1'));var moment=require(_0x99f3('0x2'));var BPromise=require(_0x99f3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99f3('0x4'));var db=require(_0x99f3('0x5'))['db'];var utils=require(_0x99f3('0x6'));var logger=require(_0x99f3('0x7'))(_0x99f3('0x8'));var config=require(_0x99f3('0x9'));var jayson=require(_0x99f3('0xa'));var client=jayson[_0x99f3('0xb')][_0x99f3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b6eb1,_0x58f80a,_0x2ab624){return new BPromise(function(_0x2cf522,_0x7f5f43){return client[_0x99f3('0xd')](_0x5b6eb1,_0x2ab624)['then'](function(_0x44f7d6){logger[_0x99f3('0xe')](_0x99f3('0xf'),_0x58f80a,_0x99f3('0x10'));logger[_0x99f3('0x11')]('Schedule,\x20%s,\x20%s,\x20%s',_0x58f80a,_0x99f3('0x10'),JSON[_0x99f3('0x12')](_0x44f7d6));if(_0x44f7d6[_0x99f3('0x13')]){if(_0x44f7d6[_0x99f3('0x13')]['code']===0x1f4){logger['error'](_0x99f3('0xf'),_0x58f80a,_0x44f7d6['error'][_0x99f3('0x14')]);return _0x7f5f43(_0x44f7d6['error'][_0x99f3('0x14')]);}logger[_0x99f3('0x13')]('Schedule,\x20%s,\x20%s',_0x58f80a,_0x44f7d6[_0x99f3('0x13')][_0x99f3('0x14')]);return _0x2cf522(_0x44f7d6[_0x99f3('0x13')][_0x99f3('0x14')]);}else{logger[_0x99f3('0xe')](_0x99f3('0xf'),_0x58f80a,_0x99f3('0x10'));_0x2cf522(_0x44f7d6[_0x99f3('0x15')][_0x99f3('0x14')]);}})[_0x99f3('0x16')](function(_0x427082){logger[_0x99f3('0x13')]('Schedule,\x20%s,\x20%s',_0x58f80a,_0x427082);_0x7f5f43(_0x427082);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 27c162b..7561987 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 _0x2a0c=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','get','/describe','describe','show','/:id/download','download','post','create','put','/:id','update','destroy','exports','util'];(function(_0x563caa,_0x4b4b66){var _0x39db78=function(_0x4a4348){while(--_0x4a4348){_0x563caa['push'](_0x563caa['shift']());}};_0x39db78(++_0x4b4b66);}(_0x2a0c,0xa0));var _0xc2a0=function(_0x44fab8,_0x135f37){_0x44fab8=_0x44fab8-0x0;var _0x2bd000=_0x2a0c[_0x44fab8];return _0x2bd000;};'use strict';var multer=require('multer');var util=require(_0xc2a0('0x0'));var path=require(_0xc2a0('0x1'));var timeout=require(_0xc2a0('0x2'));var express=require(_0xc2a0('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc2a0('0x4'));var interaction=require(_0xc2a0('0x5'));var config=require(_0xc2a0('0x6'));var controller=require(_0xc2a0('0x7'));router['get']('/',auth[_0xc2a0('0x8')](),controller[_0xc2a0('0x9')]);router[_0xc2a0('0xa')](_0xc2a0('0xb'),auth[_0xc2a0('0x8')](),controller[_0xc2a0('0xc')]);router['get']('/:id',auth[_0xc2a0('0x8')](),controller[_0xc2a0('0xd')]);router['get'](_0xc2a0('0xe'),auth[_0xc2a0('0x8')](),controller[_0xc2a0('0xf')]);router[_0xc2a0('0x10')]('/',auth[_0xc2a0('0x8')](),controller[_0xc2a0('0x11')]);router[_0xc2a0('0x12')](_0xc2a0('0x13'),auth[_0xc2a0('0x8')](),controller[_0xc2a0('0x14')]);router['delete'](_0xc2a0('0x13'),auth['isAuthenticated'](),controller[_0xc2a0('0x15')]);module[_0xc2a0('0x16')]=router; \ No newline at end of file +var _0xd983=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','get','/describe','/:id','show','/:id/download','download','post','create','put'];(function(_0x5e1d60,_0x3c9e92){var _0x46c789=function(_0x20b6e2){while(--_0x20b6e2){_0x5e1d60['push'](_0x5e1d60['shift']());}};_0x46c789(++_0x3c9e92);}(_0xd983,0x10b));var _0x3d98=function(_0x562687,_0x5690cd){_0x562687=_0x562687-0x0;var _0x545594=_0xd983[_0x562687];return _0x545594;};'use strict';var multer=require(_0x3d98('0x0'));var util=require(_0x3d98('0x1'));var path=require(_0x3d98('0x2'));var timeout=require(_0x3d98('0x3'));var express=require(_0x3d98('0x4'));var router=express[_0x3d98('0x5')]();var fs_extra=require(_0x3d98('0x6'));var auth=require(_0x3d98('0x7'));var interaction=require(_0x3d98('0x8'));var config=require(_0x3d98('0x9'));var controller=require(_0x3d98('0xa'));router['get']('/',auth[_0x3d98('0xb')](),controller['index']);router[_0x3d98('0xc')](_0x3d98('0xd'),auth[_0x3d98('0xb')](),controller['describe']);router[_0x3d98('0xc')](_0x3d98('0xe'),auth['isAuthenticated'](),controller[_0x3d98('0xf')]);router[_0x3d98('0xc')](_0x3d98('0x10'),auth['isAuthenticated'](),controller[_0x3d98('0x11')]);router[_0x3d98('0x12')]('/',auth[_0x3d98('0xb')](),controller[_0x3d98('0x13')]);router[_0x3d98('0x14')](_0x3d98('0xe'),auth[_0x3d98('0xb')](),controller[_0x3d98('0x15')]);router[_0x3d98('0x16')](_0x3d98('0xe'),auth['isAuthenticated'](),controller[_0x3d98('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index e79910d..3d49f03 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 _0x2581=['value','extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','DATE','startedAt','format','toString','MM-DD-YYYY\x20HH:mm','sequelize','moment','path','../../config/environment','exports','getDataValue'];(function(_0x3822c9,_0x347a81){var _0x41e94d=function(_0x55c545){while(--_0x55c545){_0x3822c9['push'](_0x3822c9['shift']());}};_0x41e94d(++_0x347a81);}(_0x2581,0xcb));var _0x1258=function(_0x2edbcd,_0x3f299f){_0x2edbcd=_0x2edbcd-0x0;var _0x23d859=_0x2581[_0x2edbcd];return _0x23d859;};'use strict';var Sequelize=require(_0x1258('0x0'));var moment=require(_0x1258('0x1'));var path=require(_0x1258('0x2'));var config=require(_0x1258('0x3'));module[_0x1258('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1258('0x5')](_0x1258('0x6'))?path[_0x1258('0x7')](this[_0x1258('0x5')](_0x1258('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x1258('0x8')]},'channel':{'type':Sequelize[_0x1258('0x8')]},'value':{'type':Sequelize[_0x1258('0x8')],'set':function(_0x582ed7){var _0x3e1044=_0x582ed7[_0x1258('0x9')](/\\/g,'/');this[_0x1258('0xa')](_0x1258('0x6'),_0x3e1044);}},'rating':{'type':Sequelize[_0x1258('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x1258('0xb')],'set':function(_0x429efc){this['setDataValue']('startedAt',moment()[_0x1258('0xc')](_0x429efc,'ms'));this[_0x1258('0xa')](_0x1258('0xd'),moment());this[_0x1258('0xa')]('duration',_0x429efc);}},'startedAt':{'type':Sequelize[_0x1258('0xe')],'get':function(){return moment(this[_0x1258('0x5')](_0x1258('0xf')))[_0x1258('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x1258('0x11')]();}},'closedAt':{'type':Sequelize[_0x1258('0xe')],'get':function(){return moment(this[_0x1258('0x5')](_0x1258('0xd')))[_0x1258('0x10')](_0x1258('0x12'))[_0x1258('0x11')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x1258('0x5')]('createdAt'))[_0x1258('0x10')](_0x1258('0x12'))[_0x1258('0x11')]();}},'updatedAt':{'type':Sequelize[_0x1258('0xe')],'get':function(){return moment(this[_0x1258('0x5')]('updatedAt'))[_0x1258('0x10')](_0x1258('0x12'))[_0x1258('0x11')]();}}}; \ No newline at end of file +var _0x6da9=['value','STRING','replace','setDataValue','startedAt','subtract','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue'];(function(_0x507404,_0x506e93){var _0x9963a5=function(_0xeb67fa){while(--_0xeb67fa){_0x507404['push'](_0x507404['shift']());}};_0x9963a5(++_0x506e93);}(_0x6da9,0x161));var _0x96da=function(_0x28767e,_0x216500){_0x28767e=_0x28767e-0x0;var _0x2d20de=_0x6da9[_0x28767e];return _0x2d20de;};'use strict';var Sequelize=require(_0x96da('0x0'));var moment=require(_0x96da('0x1'));var path=require(_0x96da('0x2'));var config=require(_0x96da('0x3'));module[_0x96da('0x4')]={'format':{'type':Sequelize[_0x96da('0x5')],'get':function(){return this[_0x96da('0x6')]('value')?path['extname'](this['getDataValue'](_0x96da('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0x96da('0x8')]},'channel':{'type':Sequelize[_0x96da('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x1bc4b0){var _0x5d7737=_0x1bc4b0[_0x96da('0x9')](/\\/g,'/');this[_0x96da('0xa')](_0x96da('0x7'),_0x5d7737);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x4ed0c1){this[_0x96da('0xa')](_0x96da('0xb'),moment()[_0x96da('0xc')](_0x4ed0c1,'ms'));this['setDataValue'](_0x96da('0xd'),moment());this[_0x96da('0xa')]('duration',_0x4ed0c1);}},'startedAt':{'type':Sequelize[_0x96da('0xe')],'get':function(){return moment(this[_0x96da('0x6')](_0x96da('0xb')))[_0x96da('0xf')](_0x96da('0x10'))[_0x96da('0x11')]();}},'closedAt':{'type':Sequelize[_0x96da('0xe')],'get':function(){return moment(this[_0x96da('0x6')](_0x96da('0xd')))['format'](_0x96da('0x10'))[_0x96da('0x11')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x96da('0x12')))[_0x96da('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x96da('0x11')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x96da('0x6')](_0x96da('0x13')))[_0x96da('0xf')](_0x96da('0x10'))[_0x96da('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index e308df9..034f102 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 _0x207c=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','duration','createdAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','recording','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','download','message','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb'];(function(_0x48208f,_0x89dd9c){var _0x3740b6=function(_0xcc9e97){while(--_0xcc9e97){_0x48208f['push'](_0x48208f['shift']());}};_0x3740b6(++_0x89dd9c);}(_0x207c,0x1e8));var _0xc207=function(_0x594dc7,_0x269225){_0x594dc7=_0x594dc7-0x0;var _0x2e287d=_0x207c[_0x594dc7];return _0x2e287d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc207('0x0'));var zipdir=require(_0xc207('0x1'));var jsonpatch=require(_0xc207('0x2'));var rp=require(_0xc207('0x3'));var moment=require(_0xc207('0x4'));var BPromise=require(_0xc207('0x5'));var Mustache=require(_0xc207('0x6'));var util=require('util');var path=require(_0xc207('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc207('0x8'));var _=require(_0xc207('0x9'));var squel=require(_0xc207('0xa'));var crypto=require('crypto');var jsforce=require(_0xc207('0xb'));var deskjs=require(_0xc207('0xc'));var toCsv=require(_0xc207('0xd'));var querystring=require('querystring');var Papa=require(_0xc207('0xe'));var Redis=require(_0xc207('0xf'));var authService=require(_0xc207('0x10'));var qs=require(_0xc207('0x11'));var as=require(_0xc207('0x12'));var hardwareService=require(_0xc207('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc207('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc207('0x15'))['db'];function respondWithStatusCode(_0x2782ce,_0x59d401){_0x59d401=_0x59d401||0xcc;return function(_0x3e1108){if(_0x3e1108){return _0x2782ce[_0xc207('0x16')](_0x59d401);}return _0x2782ce[_0xc207('0x17')](_0x59d401)[_0xc207('0x18')]();};}function respondWithResult(_0xe993a0,_0x51e967){_0x51e967=_0x51e967||0xc8;return function(_0xc62672){if(_0xc62672){return _0xe993a0[_0xc207('0x17')](_0x51e967)[_0xc207('0x19')](_0xc62672);}};}function respondWithFilteredResult(_0x4031ad,_0x4ef6c4){return function(_0x564cef){if(_0x564cef){var _0x554e5c=typeof _0x4ef6c4[_0xc207('0x1a')]===_0xc207('0x1b')&&typeof _0x4ef6c4[_0xc207('0x1c')]===_0xc207('0x1b');var _0x4b8f44=_0x564cef[_0xc207('0x1d')];var _0x282595=_0x554e5c?0x0:_0x4ef6c4[_0xc207('0x1a')];var _0x5f288e=_0x554e5c?_0x564cef[_0xc207('0x1d')]:_0x4ef6c4['offset']+_0x4ef6c4[_0xc207('0x1c')];var _0x33ddb1;if(_0x5f288e>=_0x4b8f44){_0x5f288e=_0x4b8f44;_0x33ddb1=0xc8;}else{_0x33ddb1=0xce;}_0x4031ad[_0xc207('0x17')](_0x33ddb1);return _0x4031ad[_0xc207('0x1e')](_0xc207('0x1f'),_0x282595+'-'+_0x5f288e+'/'+_0x4b8f44)[_0xc207('0x19')](_0x564cef);}return null;};}function patchUpdates(_0x35c0b0){return function(_0x464dea){try{jsonpatch[_0xc207('0x20')](_0x464dea,_0x35c0b0,!![]);}catch(_0x2bd2eb){return BPromise[_0xc207('0x21')](_0x2bd2eb);}return _0x464dea[_0xc207('0x22')]();};}function saveUpdates(_0x40de25,_0x4b52a7){return function(_0x163b36){if(_0x163b36){return _0x163b36['update'](_0x40de25)[_0xc207('0x23')](function(_0x3ac142){return _0x3ac142;});}return null;};}function removeEntity(_0x1eabe8,_0x83253f){return function(_0x3539f4){if(_0x3539f4){return _0x3539f4[_0xc207('0x24')]()[_0xc207('0x23')](function(){_0x1eabe8[_0xc207('0x17')](0xcc)[_0xc207('0x18')]();});}};}function handleEntityNotFound(_0x2385f7,_0x25c91e){return function(_0x27df03){if(!_0x27df03){_0x2385f7[_0xc207('0x16')](0x194);}return _0x27df03;};}function handleError(_0x138970,_0x1445d3){_0x1445d3=_0x1445d3||0x1f4;return function(_0x56a066){logger[_0xc207('0x25')](_0x56a066['stack']);if(_0x56a066['name']){delete _0x56a066[_0xc207('0x26')];}_0x138970[_0xc207('0x17')](_0x1445d3)[_0xc207('0x27')](_0x56a066);};}exports[_0xc207('0x28')]=function(_0x6a653d,_0x478af7){var _0xe5e848={},_0x463ac8={},_0x6223ef={'count':0x0,'rows':[]};var _0x1bec3f=_[_0xc207('0x29')](db[_0xc207('0x2a')][_0xc207('0x2b')],function(_0x27bc72){return{'name':_0x27bc72[_0xc207('0x2c')],'type':_0x27bc72[_0xc207('0x2d')][_0xc207('0x2e')]};});_0x463ac8[_0xc207('0x2f')]=_[_0xc207('0x30')](_['map'](_0x1bec3f,_0xc207('0x26')),[_0xc207('0x31')]);_0x463ac8[_0xc207('0x32')]=_[_0xc207('0x33')](_0x6a653d[_0xc207('0x32')]);_0x463ac8[_0xc207('0x34')]=_['intersection'](_0x463ac8[_0xc207('0x2f')],_0x463ac8[_0xc207('0x32')]);_0xe5e848[_0xc207('0x35')]=_[_0xc207('0x36')](_0x463ac8['model'],qs[_0xc207('0x37')](_0x6a653d[_0xc207('0x32')][_0xc207('0x37')]));_0xe5e848[_0xc207('0x35')]=_0xe5e848[_0xc207('0x35')][_0xc207('0x38')]?_0xe5e848[_0xc207('0x35')]:_0x463ac8[_0xc207('0x2f')];if(!_0x6a653d[_0xc207('0x32')]['hasOwnProperty']('nolimit')){_0xe5e848[_0xc207('0x1c')]=qs[_0xc207('0x1c')](_0x6a653d[_0xc207('0x32')][_0xc207('0x1c')]);_0xe5e848['offset']=qs[_0xc207('0x1a')](_0x6a653d[_0xc207('0x32')][_0xc207('0x1a')]);}_0xe5e848[_0xc207('0x39')]=qs[_0xc207('0x3a')](_0x6a653d['query'][_0xc207('0x3a')]);_0xe5e848[_0xc207('0x3b')]=qs['filters'](_[_0xc207('0x3c')](_0x6a653d['query'],_0x463ac8[_0xc207('0x34')]),_0x1bec3f);if(_0x6a653d[_0xc207('0x32')]['filter']){_0xe5e848[_0xc207('0x3b')]=_[_0xc207('0x3d')](_0xe5e848[_0xc207('0x3b')],{'$or':_['map'](_0x1bec3f,function(_0x5b3041){if(_0x5b3041[_0xc207('0x2d')]!==_0xc207('0x3e')){var _0x41d66c={};_0x41d66c[_0x5b3041[_0xc207('0x26')]]={'$like':'%'+_0x6a653d['query'][_0xc207('0x3f')]+'%'};return _0x41d66c;}})});}_0xe5e848=_['merge']({},_0xe5e848,_0x6a653d['options']);var _0x4c10ed={'where':_0xe5e848['where']};return db[_0xc207('0x2a')][_0xc207('0x1d')](_0x4c10ed)[_0xc207('0x23')](function(_0x487f98){_0x6223ef[_0xc207('0x1d')]=_0x487f98;if(_0x6a653d[_0xc207('0x32')][_0xc207('0x40')]){_0xe5e848[_0xc207('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0xc207('0x42')](_0xe5e848);})[_0xc207('0x23')](function(_0x123a46){_0x6223ef[_0xc207('0x43')]=_0x123a46;return _0x6223ef;})[_0xc207('0x23')](respondWithFilteredResult(_0x478af7,_0xe5e848))['catch'](handleError(_0x478af7,null));};exports[_0xc207('0x44')]=function(_0x19a67d,_0x3a935a){var _0x471a85={'raw':![],'where':{'id':_0x19a67d[_0xc207('0x45')]['id']}},_0x153490={};_0x153490[_0xc207('0x2f')]=_[_0xc207('0x33')](db[_0xc207('0x2a')]['rawAttributes']);_0x153490[_0xc207('0x32')]=_[_0xc207('0x33')](_0x19a67d['query']);_0x153490[_0xc207('0x34')]=_[_0xc207('0x36')](_0x153490[_0xc207('0x2f')],_0x153490[_0xc207('0x32')]);_0x471a85[_0xc207('0x35')]=_['intersection'](_0x153490[_0xc207('0x2f')],qs[_0xc207('0x37')](_0x19a67d[_0xc207('0x32')]['fields']));_0x471a85[_0xc207('0x35')]=_0x471a85[_0xc207('0x35')][_0xc207('0x38')]?_0x471a85[_0xc207('0x35')]:_0x153490['model'];if(_0x19a67d['query'][_0xc207('0x40')]){_0x471a85[_0xc207('0x41')]=[{'all':!![]}];}_0x471a85=_[_0xc207('0x3d')]({},_0x471a85,_0x19a67d[_0xc207('0x46')]);return db[_0xc207('0x2a')][_0xc207('0x47')](_0x471a85)[_0xc207('0x23')](handleEntityNotFound(_0x3a935a,null))[_0xc207('0x23')](respondWithResult(_0x3a935a,null))[_0xc207('0x48')](handleError(_0x3a935a,null));};exports[_0xc207('0x49')]=function(_0x2afcd1,_0x2fda4f){return db['ScreenRecording']['create'](_0x2afcd1[_0xc207('0x4a')],{})[_0xc207('0x23')](respondWithResult(_0x2fda4f,0xc9))[_0xc207('0x48')](handleError(_0x2fda4f,null));};exports['update']=function(_0x2b89e0,_0x3f712d){if(_0x2b89e0[_0xc207('0x4a')]['id']){delete _0x2b89e0[_0xc207('0x4a')]['id'];}delete _0x2b89e0['body'][_0xc207('0x4b')];delete _0x2b89e0['body'][_0xc207('0x4c')];delete _0x2b89e0['body']['closedAt'];delete _0x2b89e0[_0xc207('0x4a')][_0xc207('0x4d')];return db['ScreenRecording']['find']({'where':{'id':_0x2b89e0['params']['id']}})[_0xc207('0x23')](handleEntityNotFound(_0x3f712d,null))[_0xc207('0x23')](saveUpdates(_0x2b89e0[_0xc207('0x4a')],null))[_0xc207('0x23')](respondWithResult(_0x3f712d,null))[_0xc207('0x48')](handleError(_0x3f712d,null));};exports[_0xc207('0x4e')]=function(_0x3dc457,_0x1dfdee){return db['ScreenRecording'][_0xc207('0x4e')]()[_0xc207('0x23')](respondWithResult(_0x1dfdee,null))['catch'](handleError(_0x1dfdee,null));};exports['download']=function(_0x362001,_0x47c630,_0x49a78b){var _0x2634d6=require(_0xc207('0x4f'));var _0x356c8c=![];var _0x3b2448={};if(_0x362001[_0xc207('0x32')][_0xc207('0x2d')]&&_0x362001[_0xc207('0x32')][_0xc207('0x2d')]===_0xc207('0x50')){_0x3b2448[_0xc207('0x50')]=_0x362001[_0xc207('0x45')]['id'];}else{_0x3b2448['id']=_0x362001['params']['id'];}return db['ScreenRecording'][_0xc207('0x47')]({'where':_0x3b2448,'attributes':['id',_0xc207('0x4d')],'raw':!![]})[_0xc207('0x23')](handleEntityNotFound(_0x47c630,null))[_0xc207('0x23')](function(_0xaff7a0){if(_0xaff7a0){var _0x21c12b=path[_0xc207('0x51')](config[_0xc207('0x52')],_0xc207('0x53'),_0xaff7a0['value']);var _0x1cc4e3=util[_0xc207('0x31')](_0xc207('0x54'),_0x21c12b);if(fs[_0xc207('0x55')](_0x1cc4e3)){_0x356c8c=!![];return _0x2634d6['decryptFile'](_0x1cc4e3,_0x21c12b,config[_0xc207('0x56')][_0xc207('0x57')])[_0xc207('0x23')](function(){return _0xaff7a0;});}return _0xaff7a0;}})[_0xc207('0x23')](function(_0x464263){if(_0x464263){var _0x45ad58=path[_0xc207('0x51')](config['root'],_0xc207('0x53'),_0x464263[_0xc207('0x4d')]);if(!fs[_0xc207('0x55')](_0x45ad58)){throw new db[(_0xc207('0x58'))]['ValidationError'](_0xc207('0x59'));}if(_0x464263['filename']){return _0x47c630['download'](_0x45ad58,_0x464263[_0xc207('0x5a')]+path[_0xc207('0x5b')](_0x45ad58),function(){if(_0x356c8c){fs[_0xc207('0x5c')](_0x45ad58);}});}else{return _0x47c630[_0xc207('0x5d')](_0x45ad58,function(_0x441d5f){if(_0x356c8c){fs[_0xc207('0x5c')](_0x45ad58);}});}}})[_0xc207('0x48')](function(_0x33c372){if(_0x33c372[_0xc207('0x5e')]===_0xc207('0x59')){_0x47c630[_0xc207('0x17')](0x194)[_0xc207('0x27')](_0xc207('0x5f'));}else{return handleError(_0x47c630,null);}});};exports[_0xc207('0x24')]=function(_0x282ae5,_0x501bca){return db[_0xc207('0x2a')]['find']({'where':{'id':_0x282ae5[_0xc207('0x45')]['id']}})[_0xc207('0x23')](function(_0x2ade23){if(_['isNil'](_0x2ade23)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2ade23;})[_0xc207('0x23')](function(_0x3ac0dd){var _0x2f18a2=path['join'](config[_0xc207('0x52')],_0xc207('0x53'),_0x3ac0dd[_0xc207('0x4d')]);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x2f18a2);if(!_[_0xc207('0x60')](_0x3ac0dd['value'])&&fs[_0xc207('0x55')](_0x2f18a2)){logger[_0xc207('0x61')](_0xc207('0x62')+_0x2f18a2+_0xc207('0x63'));fs[_0xc207('0x64')](_0x2f18a2);}_0x2f18a2=_0x2f18a2+_0xc207('0x65');if(!_[_0xc207('0x60')](_0x3ac0dd[_0xc207('0x4d')])&&fs['existsSync'](_0x2f18a2)){logger[_0xc207('0x61')](_0xc207('0x62')+_0x2f18a2+_0xc207('0x63'));fs[_0xc207('0x64')](_0x2f18a2);}return _0x3ac0dd;})[_0xc207('0x23')](function(_0x14050a){if(!_0x14050a)throw new InternalError();return _0x14050a[_0xc207('0x24')]();})[_0xc207('0x23')](function(){_0x501bca[_0xc207('0x17')](0xcc)[_0xc207('0x18')]();})[_0xc207('0x48')](handleError(_0x501bca,null));}; \ No newline at end of file +var _0x7da7=['stack','name','send','index','map','ScreenRecording','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','filter','includeAll','findAll','rows','show','params','rawAttributes','options','find','create','body','duration','createdAt','value','catch','describe','download','../../components/encryptor','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','recording','join','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','end','error'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7da7,0x10d));var _0x77da=function(_0x14e27a,_0x3b4136){_0x14e27a=_0x14e27a-0x0;var _0x288688=_0x7da7[_0x14e27a];return _0x288688;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){_0x27b6c7['status'](0xcc)[_0x77da('0x23')]();});}};}function handleEntityNotFound(_0x2d009f,_0x835167){return function(_0xbd06b7){if(!_0xbd06b7){_0x2d009f['sendStatus'](0x194);}return _0xbd06b7;};}function handleError(_0x42240b,_0x167240){_0x167240=_0x167240||0x1f4;return function(_0x470c9f){logger[_0x77da('0x24')](_0x470c9f[_0x77da('0x25')]);if(_0x470c9f['name']){delete _0x470c9f[_0x77da('0x26')];}_0x42240b[_0x77da('0x18')](_0x167240)[_0x77da('0x27')](_0x470c9f);};}exports[_0x77da('0x28')]=function(_0x496ecd,_0x5b4638){var _0x4d395a={},_0x2258e9={},_0x30456a={'count':0x0,'rows':[]};var _0x410d09=_[_0x77da('0x29')](db[_0x77da('0x2a')]['rawAttributes'],function(_0x350b4e){return{'name':_0x350b4e[_0x77da('0x2b')],'type':_0x350b4e[_0x77da('0x2c')][_0x77da('0x2d')]};});_0x2258e9[_0x77da('0x2e')]=_[_0x77da('0x2f')](_['map'](_0x410d09,_0x77da('0x26')),[_0x77da('0x30')]);_0x2258e9[_0x77da('0x31')]=_[_0x77da('0x32')](_0x496ecd[_0x77da('0x31')]);_0x2258e9[_0x77da('0x33')]=_[_0x77da('0x34')](_0x2258e9[_0x77da('0x2e')],_0x2258e9['query']);_0x4d395a['attributes']=_[_0x77da('0x34')](_0x2258e9[_0x77da('0x2e')],qs['fields'](_0x496ecd[_0x77da('0x31')][_0x77da('0x35')]));_0x4d395a[_0x77da('0x36')]=_0x4d395a[_0x77da('0x36')][_0x77da('0x37')]?_0x4d395a[_0x77da('0x36')]:_0x2258e9[_0x77da('0x2e')];if(!_0x496ecd['query'][_0x77da('0x38')]('nolimit')){_0x4d395a['limit']=qs['limit'](_0x496ecd[_0x77da('0x31')]['limit']);_0x4d395a[_0x77da('0x19')]=qs[_0x77da('0x19')](_0x496ecd[_0x77da('0x31')][_0x77da('0x19')]);}_0x4d395a[_0x77da('0x39')]=qs[_0x77da('0x3a')](_0x496ecd[_0x77da('0x31')]['sort']);_0x4d395a[_0x77da('0x3b')]=qs[_0x77da('0x33')](_[_0x77da('0x3c')](_0x496ecd[_0x77da('0x31')],_0x2258e9[_0x77da('0x33')]),_0x410d09);if(_0x496ecd[_0x77da('0x31')]['filter']){_0x4d395a[_0x77da('0x3b')]=_[_0x77da('0x3d')](_0x4d395a[_0x77da('0x3b')],{'$or':_['map'](_0x410d09,function(_0xc5f0b8){if(_0xc5f0b8['type']!=='VIRTUAL'){var _0x599e21={};_0x599e21[_0xc5f0b8['name']]={'$like':'%'+_0x496ecd[_0x77da('0x31')][_0x77da('0x3e')]+'%'};return _0x599e21;}})});}_0x4d395a=_[_0x77da('0x3d')]({},_0x4d395a,_0x496ecd['options']);var _0x21d337={'where':_0x4d395a['where']};return db[_0x77da('0x2a')]['count'](_0x21d337)[_0x77da('0x21')](function(_0xa19b50){_0x30456a[_0x77da('0x1b')]=_0xa19b50;if(_0x496ecd[_0x77da('0x31')][_0x77da('0x3f')]){_0x4d395a['include']=[{'all':!![]}];}return db[_0x77da('0x2a')][_0x77da('0x40')](_0x4d395a);})[_0x77da('0x21')](function(_0x2f14f4){_0x30456a[_0x77da('0x41')]=_0x2f14f4;return _0x30456a;})[_0x77da('0x21')](respondWithFilteredResult(_0x5b4638,_0x4d395a))['catch'](handleError(_0x5b4638,null));};exports[_0x77da('0x42')]=function(_0x2f0495,_0x21de41){var _0x2dfeca={'raw':![],'where':{'id':_0x2f0495[_0x77da('0x43')]['id']}},_0x7d11f9={};_0x7d11f9['model']=_[_0x77da('0x32')](db['ScreenRecording'][_0x77da('0x44')]);_0x7d11f9[_0x77da('0x31')]=_[_0x77da('0x32')](_0x2f0495['query']);_0x7d11f9[_0x77da('0x33')]=_[_0x77da('0x34')](_0x7d11f9[_0x77da('0x2e')],_0x7d11f9[_0x77da('0x31')]);_0x2dfeca[_0x77da('0x36')]=_[_0x77da('0x34')](_0x7d11f9[_0x77da('0x2e')],qs[_0x77da('0x35')](_0x2f0495[_0x77da('0x31')]['fields']));_0x2dfeca[_0x77da('0x36')]=_0x2dfeca[_0x77da('0x36')][_0x77da('0x37')]?_0x2dfeca[_0x77da('0x36')]:_0x7d11f9[_0x77da('0x2e')];if(_0x2f0495[_0x77da('0x31')]['includeAll']){_0x2dfeca['include']=[{'all':!![]}];}_0x2dfeca=_[_0x77da('0x3d')]({},_0x2dfeca,_0x2f0495[_0x77da('0x45')]);return db[_0x77da('0x2a')][_0x77da('0x46')](_0x2dfeca)[_0x77da('0x21')](handleEntityNotFound(_0x21de41,null))[_0x77da('0x21')](respondWithResult(_0x21de41,null))['catch'](handleError(_0x21de41,null));};exports[_0x77da('0x47')]=function(_0x357ee4,_0x332f80){return db[_0x77da('0x2a')]['create'](_0x357ee4[_0x77da('0x48')],{})['then'](respondWithResult(_0x332f80,0xc9))['catch'](handleError(_0x332f80,null));};exports[_0x77da('0x20')]=function(_0x176f01,_0x143a68){if(_0x176f01[_0x77da('0x48')]['id']){delete _0x176f01['body']['id'];}delete _0x176f01[_0x77da('0x48')][_0x77da('0x49')];delete _0x176f01['body'][_0x77da('0x4a')];delete _0x176f01[_0x77da('0x48')]['closedAt'];delete _0x176f01[_0x77da('0x48')][_0x77da('0x4b')];return db[_0x77da('0x2a')][_0x77da('0x46')]({'where':{'id':_0x176f01[_0x77da('0x43')]['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x143a68,null))[_0x77da('0x21')](saveUpdates(_0x176f01[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x143a68,null))[_0x77da('0x4c')](handleError(_0x143a68,null));};exports['describe']=function(_0x3d04a3,_0x513017){return db[_0x77da('0x2a')][_0x77da('0x4d')]()[_0x77da('0x21')](respondWithResult(_0x513017,null))[_0x77da('0x4c')](handleError(_0x513017,null));};exports[_0x77da('0x4e')]=function(_0x8b377d,_0x3a78d2,_0x4c271d){var _0x17ed71=require(_0x77da('0x4f'));var _0x1a7115=![];var _0x353be9={};if(_0x8b377d['query'][_0x77da('0x2c')]&&_0x8b377d[_0x77da('0x31')][_0x77da('0x2c')]==='uniqueid'){_0x353be9['uniqueid']=_0x8b377d[_0x77da('0x43')]['id'];}else{_0x353be9['id']=_0x8b377d[_0x77da('0x43')]['id'];}return db[_0x77da('0x2a')][_0x77da('0x46')]({'where':_0x353be9,'attributes':['id',_0x77da('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x3a78d2,null))['then'](function(_0x365e91){if(_0x365e91){var _0x36f161=path['join'](config[_0x77da('0x50')],_0x77da('0x51'),_0x365e91[_0x77da('0x4b')]);var _0x4b1515=util[_0x77da('0x30')](_0x77da('0x52'),_0x36f161);if(fs['existsSync'](_0x4b1515)){_0x1a7115=!![];return _0x17ed71[_0x77da('0x53')](_0x4b1515,_0x36f161,config[_0x77da('0x54')][_0x77da('0x55')])[_0x77da('0x21')](function(){return _0x365e91;});}return _0x365e91;}})[_0x77da('0x21')](function(_0x99ac27){if(_0x99ac27){var _0x1dc4ab=path[_0x77da('0x56')](config[_0x77da('0x50')],'server/files/screen_recordings',_0x99ac27[_0x77da('0x4b')]);if(!fs[_0x77da('0x57')](_0x1dc4ab)){throw new db[(_0x77da('0x58'))][(_0x77da('0x59'))](_0x77da('0x5a'));}if(_0x99ac27[_0x77da('0x5b')]){return _0x3a78d2['download'](_0x1dc4ab,_0x99ac27[_0x77da('0x5b')]+path[_0x77da('0x5c')](_0x1dc4ab),function(){if(_0x1a7115){fs[_0x77da('0x5d')](_0x1dc4ab);}});}else{return _0x3a78d2['download'](_0x1dc4ab,function(_0x3e5dd9){if(_0x1a7115){fs[_0x77da('0x5d')](_0x1dc4ab);}});}}})[_0x77da('0x4c')](function(_0x8592c7){if(_0x8592c7[_0x77da('0x5e')]===_0x77da('0x5a')){_0x3a78d2[_0x77da('0x18')](0x194)['send'](_0x77da('0x5f'));}else{return handleError(_0x3a78d2,null);}});};exports['destroy']=function(_0x211310,_0x1922ab){return db[_0x77da('0x2a')]['find']({'where':{'id':_0x211310[_0x77da('0x43')]['id']}})[_0x77da('0x21')](function(_0x282481){if(_[_0x77da('0x60')](_0x282481)){throw new ReferenceError('Entity\x20not\x20found');}return _0x282481;})['then'](function(_0x571b1b){var _0x6b74fd=path[_0x77da('0x56')](config[_0x77da('0x50')],_0x77da('0x51'),_0x571b1b[_0x77da('0x4b')]);logger[_0x77da('0x61')](_0x77da('0x62'),_0x6b74fd);if(!_[_0x77da('0x60')](_0x571b1b[_0x77da('0x4b')])&&fs[_0x77da('0x57')](_0x6b74fd)){logger['info'](_0x77da('0x63')+_0x6b74fd+_0x77da('0x64'));fs['unlinkSync'](_0x6b74fd);}_0x6b74fd=_0x6b74fd+'.cypher';if(!_[_0x77da('0x60')](_0x571b1b['value'])&&fs[_0x77da('0x57')](_0x6b74fd)){logger[_0x77da('0x61')](_0x77da('0x63')+_0x6b74fd+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x77da('0x65')](_0x6b74fd);}return _0x571b1b;})[_0x77da('0x21')](function(_0x27fc45){if(!_0x27fc45)throw new InternalError();return _0x27fc45[_0x77da('0x22')]();})[_0x77da('0x21')](function(){_0x1922ab['status'](0xcc)[_0x77da('0x23')]();})[_0x77da('0x4c')](handleError(_0x1922ab,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 045aa2d..8e6f330 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 _0x9831=['util','api','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash'];(function(_0x26f04a,_0x5a6890){var _0x298576=function(_0x21944d){while(--_0x21944d){_0x26f04a['push'](_0x26f04a['shift']());}};_0x298576(++_0x5a6890);}(_0x9831,0x8e));var _0x1983=function(_0x2735f7,_0x577255){_0x2735f7=_0x2735f7-0x0;var _0x3a0e0e=_0x9831[_0x2735f7];return _0x3a0e0e;};'use strict';var _=require(_0x1983('0x0'));var util=require(_0x1983('0x1'));var logger=require('../../config/logger')(_0x1983('0x2'));var moment=require('moment');var BPromise=require(_0x1983('0x3'));var rp=require(_0x1983('0x4'));var fs=require('fs');var path=require(_0x1983('0x5'));var rimraf=require('rimraf');var config=require(_0x1983('0x6'));var attributes=require(_0x1983('0x7'));module[_0x1983('0x8')]=function(_0x1fba21,_0x32e655){return _0x1fba21[_0x1983('0x9')](_0x1983('0xa'),attributes,{'tableName':_0x1983('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x1983('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xef0f=['util','../../config/logger','api','moment','path','../../config/environment','exports','define','ScreenRecording','interactionid'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0xef0f,0x96));var _0xfef0=function(_0x33c2e4,_0x36fe37){_0x33c2e4=_0x33c2e4-0x0;var _0x13378f=_0xef0f[_0x33c2e4];return _0x13378f;};'use strict';var _=require('lodash');var util=require(_0xfef0('0x0'));var logger=require(_0xfef0('0x1'))(_0xfef0('0x2'));var moment=require(_0xfef0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfef0('0x4'));var rimraf=require('rimraf');var config=require(_0xfef0('0x5'));var attributes=require('./screenRecording.attributes');module[_0xfef0('0x6')]=function(_0x1b566d,_0xe2e29e){return _0x1b566d[_0xfef0('0x7')](_0xfef0('0x8'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xfef0('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 2cb1577..3f1c71c 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 _0x65f7=['error','code','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3a99b6,_0x5e2926){var _0x2b8bc0=function(_0x189934){while(--_0x189934){_0x3a99b6['push'](_0x3a99b6['shift']());}};_0x2b8bc0(++_0x5e2926);}(_0x65f7,0x1a8));var _0x765f=function(_0xd37a43,_0x48c953){_0xd37a43=_0xd37a43-0x0;var _0x31c0ce=_0x65f7[_0xd37a43];return _0x31c0ce;};'use strict';var _=require(_0x765f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x765f('0x1'));var rs=require(_0x765f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x765f('0x3'))['db'];var utils=require(_0x765f('0x4'));var logger=require(_0x765f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x765f('0x6'));var client=jayson[_0x765f('0x7')][_0x765f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa529d,_0x2364b3,_0xc38d8d){return new BPromise(function(_0x1a01a0,_0x20a055){return client['request'](_0xa529d,_0xc38d8d)[_0x765f('0x9')](function(_0xc0aae8){logger[_0x765f('0xa')](_0x765f('0xb'),_0x2364b3,_0x765f('0xc'));logger[_0x765f('0xd')](_0x765f('0xe'),_0x2364b3,_0x765f('0xc'),JSON[_0x765f('0xf')](_0xc0aae8));if(_0xc0aae8[_0x765f('0x10')]){if(_0xc0aae8[_0x765f('0x10')][_0x765f('0x11')]===0x1f4){logger[_0x765f('0x10')](_0x765f('0xb'),_0x2364b3,_0xc0aae8[_0x765f('0x10')][_0x765f('0x12')]);return _0x20a055(_0xc0aae8[_0x765f('0x10')][_0x765f('0x12')]);}logger[_0x765f('0x10')](_0x765f('0xb'),_0x2364b3,_0xc0aae8[_0x765f('0x10')][_0x765f('0x12')]);return _0x1a01a0(_0xc0aae8[_0x765f('0x10')][_0x765f('0x12')]);}else{logger['info'](_0x765f('0xb'),_0x2364b3,_0x765f('0xc'));_0x1a01a0(_0xc0aae8[_0x765f('0x13')][_0x765f('0x12')]);}})['catch'](function(_0x531a17){logger['error'](_0x765f('0xb'),_0x2364b3,_0x531a17);_0x20a055(_0x531a17);});});} \ No newline at end of file +var _0x70c3=['info','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x70c3,0xe8));var _0x370c=function(_0x26251a,_0x2bbb59){_0x26251a=_0x26251a-0x0;var _0x2568d2=_0x70c3[_0x26251a];return _0x2568d2;};'use strict';var _=require('lodash');var util=require(_0x370c('0x0'));var moment=require('moment');var BPromise=require(_0x370c('0x1'));var rs=require(_0x370c('0x2'));var fs=require('fs');var Redis=require(_0x370c('0x3'));var db=require(_0x370c('0x4'))['db'];var utils=require(_0x370c('0x5'));var logger=require(_0x370c('0x6'))(_0x370c('0x7'));var config=require(_0x370c('0x8'));var jayson=require(_0x370c('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x379745,_0x12bfae,_0x17aa9f){return new BPromise(function(_0x144a37,_0x527ff3){return client[_0x370c('0xa')](_0x379745,_0x17aa9f)[_0x370c('0xb')](function(_0xfe6de){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x12bfae,_0x370c('0xc'));logger[_0x370c('0xd')](_0x370c('0xe'),_0x12bfae,_0x370c('0xc'),JSON[_0x370c('0xf')](_0xfe6de));if(_0xfe6de['error']){if(_0xfe6de[_0x370c('0x10')][_0x370c('0x11')]===0x1f4){logger[_0x370c('0x10')](_0x370c('0x12'),_0x12bfae,_0xfe6de[_0x370c('0x10')][_0x370c('0x13')]);return _0x527ff3(_0xfe6de[_0x370c('0x10')]['message']);}logger[_0x370c('0x10')](_0x370c('0x12'),_0x12bfae,_0xfe6de[_0x370c('0x10')][_0x370c('0x13')]);return _0x144a37(_0xfe6de[_0x370c('0x10')][_0x370c('0x13')]);}else{logger[_0x370c('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x12bfae,_0x370c('0xc'));_0x144a37(_0xfe6de['result'][_0x370c('0x13')]);}})['catch'](function(_0x24f2b2){logger[_0x370c('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x12bfae,_0x24f2b2);_0x527ff3(_0x24f2b2);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 78eaf86..828971a 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 _0x2dab=['addPreferred','favicon','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','isAuthenticated','index','/now','getDate','get','/:id','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','/:id/logo','file','addLogo','logologin','single','preferred'];(function(_0x460e45,_0x152131){var _0x1e2f73=function(_0x2844bc){while(--_0x2844bc){_0x460e45['push'](_0x460e45['shift']());}};_0x1e2f73(++_0x152131);}(_0x2dab,0x1a7));var _0xb2da=function(_0x36f588,_0x42d7aa){_0x36f588=_0x36f588-0x0;var _0x1a1db9=_0x2dab[_0x36f588];return _0x1a1db9;};'use strict';var multer=require('multer');var util=require(_0xb2da('0x0'));var path=require(_0xb2da('0x1'));var timeout=require(_0xb2da('0x2'));var express=require('express');var router=express[_0xb2da('0x3')]();var fs_extra=require(_0xb2da('0x4'));var auth=require(_0xb2da('0x5'));var interaction=require(_0xb2da('0x6'));var config=require('../../config/environment');var controller=require(_0xb2da('0x7'));router['get']('/',auth[_0xb2da('0x8')](),controller[_0xb2da('0x9')]);router['get'](_0xb2da('0xa'),controller[_0xb2da('0xb')]);router[_0xb2da('0xc')](_0xb2da('0xd'),controller[_0xb2da('0xe')]);router[_0xb2da('0xc')]('/:id/logo',controller[_0xb2da('0xf')]);router[_0xb2da('0xc')](_0xb2da('0x10'),controller[_0xb2da('0x11')]);router[_0xb2da('0xc')](_0xb2da('0x12'),controller[_0xb2da('0x13')]);router[_0xb2da('0xc')](_0xb2da('0x14'),controller[_0xb2da('0x15')]);router['get'](_0xb2da('0x16'),controller['getFavicon']);var upload=multer({'storage':multer[_0xb2da('0x17')]({'destination':function(_0x1f08c6,_0x45f655,_0x3f98ac){_0x3f98ac(null,path[_0xb2da('0x18')](config[_0xb2da('0x19')],_0xb2da('0x1a')));},'filename':function(_0x11577b,_0x33c170,_0x16348a){_0x16348a(null,util[_0xb2da('0x1b')](_0xb2da('0x1c'),_0xb2da('0x1d'),path[_0xb2da('0x1e')](_0x33c170[_0xb2da('0x1f')])));}})});router[_0xb2da('0x20')](_0xb2da('0x21'),upload['single'](_0xb2da('0x22')),controller[_0xb2da('0x23')]);var upload=multer({'storage':multer[_0xb2da('0x17')]({'destination':function(_0x5dcd34,_0x458fbe,_0x34aff7){_0x34aff7(null,path[_0xb2da('0x18')](config['root'],_0xb2da('0x1a')));},'filename':function(_0x4afb7f,_0x4c792a,_0x1045e2){_0x1045e2(null,util[_0xb2da('0x1b')]('%s%s',_0xb2da('0x24'),path[_0xb2da('0x1e')](_0x4c792a[_0xb2da('0x1f')])));}})});router[_0xb2da('0x20')](_0xb2da('0x10'),upload[_0xb2da('0x25')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xb2da('0x17')]({'destination':function(_0x43b171,_0x40cda6,_0x5906c9){_0x5906c9(null,path[_0xb2da('0x18')](config[_0xb2da('0x19')],'server/files/images/logos/'));},'filename':function(_0x4a4ae4,_0x5803cb,_0x295f28){_0x295f28(null,util['format']('%s%s',_0xb2da('0x26'),path[_0xb2da('0x1e')](_0x5803cb[_0xb2da('0x1f')])));}})});router[_0xb2da('0x20')]('/:id/preferred',upload[_0xb2da('0x25')](_0xb2da('0x22')),controller[_0xb2da('0x27')]);var upload=multer({'storage':multer[_0xb2da('0x17')]({'destination':function(_0x47d88a,_0x2c6c9a,_0xfacb82){_0xfacb82(null,path[_0xb2da('0x18')](config[_0xb2da('0x19')],_0xb2da('0x1a')));},'filename':function(_0x97c7fb,_0xa5c02d,_0x2ed75d){_0x2ed75d(null,util[_0xb2da('0x1b')](_0xb2da('0x1c'),_0xb2da('0x28'),path['extname'](_0xa5c02d[_0xb2da('0x1f')])));}})});router[_0xb2da('0x20')](_0xb2da('0x16'),upload[_0xb2da('0x25')](_0xb2da('0x22')),controller['addFavicon']);router['put']('/:id',auth[_0xb2da('0x8')](),controller['update']);module[_0xb2da('0x29')]=router; \ No newline at end of file +var _0x7241=['root','server/files/images/logos/','format','extname','originalname','post','single','file','addLogo','%s%s','logologin','addLogoLogin','addPreferred','favicon','addFavicon','put','update','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join'];(function(_0x41ddf3,_0x4c5db7){var _0x2adac3=function(_0x15cf40){while(--_0x15cf40){_0x41ddf3['push'](_0x41ddf3['shift']());}};_0x2adac3(++_0x4c5db7);}(_0x7241,0x1d4));var _0x1724=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x7241[_0x6cf19c];return _0xce14f3;};'use strict';var multer=require('multer');var util=require(_0x1724('0x0'));var path=require(_0x1724('0x1'));var timeout=require(_0x1724('0x2'));var express=require('express');var router=express[_0x1724('0x3')]();var fs_extra=require(_0x1724('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1724('0x5'));var config=require(_0x1724('0x6'));var controller=require(_0x1724('0x7'));router[_0x1724('0x8')]('/',auth[_0x1724('0x9')](),controller[_0x1724('0xa')]);router['get'](_0x1724('0xb'),controller[_0x1724('0xc')]);router[_0x1724('0x8')](_0x1724('0xd'),controller[_0x1724('0xe')]);router[_0x1724('0x8')](_0x1724('0xf'),controller[_0x1724('0x10')]);router[_0x1724('0x8')](_0x1724('0x11'),controller[_0x1724('0x12')]);router[_0x1724('0x8')](_0x1724('0x13'),controller[_0x1724('0x14')]);router['get'](_0x1724('0x15'),controller[_0x1724('0x16')]);router[_0x1724('0x8')](_0x1724('0x17'),controller[_0x1724('0x18')]);var upload=multer({'storage':multer[_0x1724('0x19')]({'destination':function(_0x4f3cb2,_0x3b6441,_0x48976f){_0x48976f(null,path[_0x1724('0x1a')](config[_0x1724('0x1b')],_0x1724('0x1c')));},'filename':function(_0x18092c,_0x1aeff0,_0x4c80a7){_0x4c80a7(null,util[_0x1724('0x1d')]('%s%s','logo',path[_0x1724('0x1e')](_0x1aeff0[_0x1724('0x1f')])));}})});router[_0x1724('0x20')](_0x1724('0xf'),upload[_0x1724('0x21')](_0x1724('0x22')),controller[_0x1724('0x23')]);var upload=multer({'storage':multer[_0x1724('0x19')]({'destination':function(_0x167dcf,_0x3f0498,_0x314e90){_0x314e90(null,path[_0x1724('0x1a')](config[_0x1724('0x1b')],_0x1724('0x1c')));},'filename':function(_0x2f3e1b,_0x12fe03,_0x59773d){_0x59773d(null,util[_0x1724('0x1d')](_0x1724('0x24'),_0x1724('0x25'),path['extname'](_0x12fe03[_0x1724('0x1f')])));}})});router[_0x1724('0x20')](_0x1724('0x11'),upload['single'](_0x1724('0x22')),controller[_0x1724('0x26')]);var upload=multer({'storage':multer[_0x1724('0x19')]({'destination':function(_0x31bb9e,_0x4c6c0a,_0x4bcbe7){_0x4bcbe7(null,path['join'](config[_0x1724('0x1b')],_0x1724('0x1c')));},'filename':function(_0x5363e7,_0x28d646,_0x140c08){_0x140c08(null,util[_0x1724('0x1d')](_0x1724('0x24'),'preferred',path['extname'](_0x28d646[_0x1724('0x1f')])));}})});router[_0x1724('0x20')]('/:id/preferred',upload[_0x1724('0x21')](_0x1724('0x22')),controller[_0x1724('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x34ed26,_0x5520f7,_0x3c244a){_0x3c244a(null,path[_0x1724('0x1a')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5f3114,_0x2aff63,_0x51208d){_0x51208d(null,util[_0x1724('0x1d')]('%s%s',_0x1724('0x28'),path['extname'](_0x2aff63[_0x1724('0x1f')])));}})});router[_0x1724('0x20')](_0x1724('0x17'),upload[_0x1724('0x21')](_0x1724('0x22')),controller[_0x1724('0x29')]);router[_0x1724('0x2a')](_0x1724('0xd'),auth[_0x1724('0x9')](),controller[_0x1724('0x2b')]);module[_0x1724('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 3edf074..c3195fc 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(_0x47b944,_0x5884a1){var _0x523813=function(_0x25eea0){while(--_0x25eea0){_0x47b944['push'](_0x47b944['shift']());}};_0x523813(++_0x5884a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0x3f1877,_0x2f5bf5){var _0x41efc2=function(_0xb7a7df){while(--_0xb7a7df){_0x3f1877['push'](_0x3f1877['shift']());}};_0x41efc2(++_0x2f5bf5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 9d2ea75..f02dffd 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 _0x12c9=['count','limit','set','apply','save','update','destroy','end','stack','name','index','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options','Setting','includeAll','include','rows','catch','show','params','length','merge','body','find','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','defaultLogo','defaultLoginLogo','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','Sequelize','ValidationError','\x20not\x20found','download','../../config/license/util','getLogoLogin','getLicense','favicon','defaultPreferred','defaultFavicon','default_loginLogo.svg','custom','gdpr','securePassword','preferred','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','undefined'];(function(_0xac40fc,_0x29df14){var _0x1ef7c5=function(_0x2d79c1){while(--_0x2d79c1){_0xac40fc['push'](_0xac40fc['shift']());}};_0x1ef7c5(++_0x29df14);}(_0x12c9,0x1c9));var _0x912c=function(_0x54aacc,_0x587f81){_0x54aacc=_0x54aacc-0x0;var _0xfa93ff=_0x12c9[_0x54aacc];return _0xfa93ff;};'use strict';var emlformat=require(_0x912c('0x0'));var rimraf=require(_0x912c('0x1'));var zipdir=require(_0x912c('0x2'));var jsonpatch=require(_0x912c('0x3'));var rp=require(_0x912c('0x4'));var moment=require('moment');var BPromise=require(_0x912c('0x5'));var Mustache=require(_0x912c('0x6'));var util=require(_0x912c('0x7'));var path=require(_0x912c('0x8'));var sox=require(_0x912c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x912c('0xa'));var _=require(_0x912c('0xb'));var squel=require(_0x912c('0xc'));var crypto=require(_0x912c('0xd'));var jsforce=require(_0x912c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x912c('0xf'));var querystring=require('querystring');var Papa=require(_0x912c('0x10'));var Redis=require('ioredis');var authService=require(_0x912c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x912c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x912c('0x13'))(_0x912c('0x14'));var utils=require('../../config/utils');var config=require(_0x912c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x912c('0x16'))['db'];var jayson=require(_0x912c('0x17'));var client=jayson[_0x912c('0x18')][_0x912c('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x325880,_0x569010,_0x2564c2,_0x5cc804){return new BPromise(function(_0x28cdb4,_0x3682cf){var _0x5d9605=_0x5cc804||client;return _0x5d9605[_0x912c('0x1a')](_0x325880,_0x2564c2)[_0x912c('0x1b')](function(_0x2ddbf6){logger[_0x912c('0x1c')](_0x912c('0x1d'),_0x569010,_0x912c('0x1e'));logger[_0x912c('0x1f')](_0x912c('0x20'),_0x569010,_0x912c('0x1e'),JSON[_0x912c('0x21')](_0x2ddbf6));if(_0x2ddbf6['error']){if(_0x2ddbf6[_0x912c('0x22')][_0x912c('0x23')]===0x1f4){logger[_0x912c('0x22')](_0x912c('0x1d'),_0x569010,_0x2ddbf6[_0x912c('0x22')][_0x912c('0x24')]);return _0x3682cf(_0x2ddbf6[_0x912c('0x22')][_0x912c('0x24')]);}logger[_0x912c('0x22')]('Setting,\x20%s,\x20%s',_0x569010,_0x2ddbf6['error'][_0x912c('0x24')]);return _0x28cdb4(_0x2ddbf6[_0x912c('0x22')]['message']);}else{logger['info']('Setting,\x20%s,\x20%s',_0x569010,_0x912c('0x1e'));_0x28cdb4(_0x2ddbf6[_0x912c('0x25')]['message']);}})['catch'](function(_0x4f0a39){logger[_0x912c('0x22')](_0x912c('0x1d'),_0x569010,_0x4f0a39);_0x3682cf(_0x4f0a39);});});}function respondWithStatusCode(_0x4293f2,_0x1ec8a8){_0x1ec8a8=_0x1ec8a8||0xcc;return function(_0x2c964a){if(_0x2c964a){return _0x4293f2[_0x912c('0x26')](_0x1ec8a8);}return _0x4293f2[_0x912c('0x27')](_0x1ec8a8)['end']();};}function respondWithResult(_0x18b398,_0x5c539d){_0x5c539d=_0x5c539d||0xc8;return function(_0xde247c){if(_0xde247c){return _0x18b398[_0x912c('0x27')](_0x5c539d)[_0x912c('0x28')](_0xde247c);}};}function respondWithFilteredResult(_0x121865,_0x32b8c5){return function(_0x3a9fc0){if(_0x3a9fc0){var _0x18a188=typeof _0x32b8c5[_0x912c('0x29')]==='undefined'&&typeof _0x32b8c5['limit']===_0x912c('0x2a');var _0x4ac07b=_0x3a9fc0[_0x912c('0x2b')];var _0x24c2f2=_0x18a188?0x0:_0x32b8c5['offset'];var _0xefc100=_0x18a188?_0x3a9fc0[_0x912c('0x2b')]:_0x32b8c5[_0x912c('0x29')]+_0x32b8c5[_0x912c('0x2c')];var _0x4a3708;if(_0xefc100>=_0x4ac07b){_0xefc100=_0x4ac07b;_0x4a3708=0xc8;}else{_0x4a3708=0xce;}_0x121865['status'](_0x4a3708);return _0x121865[_0x912c('0x2d')]('Content-Range',_0x24c2f2+'-'+_0xefc100+'/'+_0x4ac07b)[_0x912c('0x28')](_0x3a9fc0);}return null;};}function patchUpdates(_0x1dc19c){return function(_0x3b112e){try{jsonpatch[_0x912c('0x2e')](_0x3b112e,_0x1dc19c,!![]);}catch(_0x1b9a68){return BPromise['reject'](_0x1b9a68);}return _0x3b112e[_0x912c('0x2f')]();};}function saveUpdates(_0x3492e7,_0x10bd1a){return function(_0x4d9e75){if(_0x4d9e75){return _0x4d9e75[_0x912c('0x30')](_0x3492e7)['then'](function(_0x4c066e){return _0x4c066e;});}return null;};}function removeEntity(_0x540fc2,_0x1e29b0){return function(_0x59084c){if(_0x59084c){return _0x59084c[_0x912c('0x31')]()[_0x912c('0x1b')](function(){_0x540fc2['status'](0xcc)[_0x912c('0x32')]();});}};}function handleEntityNotFound(_0x57779d,_0x21b708){return function(_0x3a6318){if(!_0x3a6318){_0x57779d[_0x912c('0x26')](0x194);}return _0x3a6318;};}function handleError(_0x22c77e,_0x1cf5b8){_0x1cf5b8=_0x1cf5b8||0x1f4;return function(_0x22fb40){logger['error'](_0x22fb40[_0x912c('0x33')]);if(_0x22fb40[_0x912c('0x34')]){delete _0x22fb40[_0x912c('0x34')];}_0x22c77e['status'](_0x1cf5b8)['send'](_0x22fb40);};}exports[_0x912c('0x35')]=function(_0xa2ac7f,_0x347c71){var _0x295a76={},_0x2d11b6={},_0x2816c5={'count':0x0,'rows':[]};var _0x354329=_['map'](db['Setting']['rawAttributes'],function(_0x182313){return{'name':_0x182313[_0x912c('0x36')],'type':_0x182313[_0x912c('0x37')][_0x912c('0x38')]};});_0x2d11b6[_0x912c('0x39')]=_[_0x912c('0x3a')](_0x354329,_0x912c('0x34'));_0x2d11b6['query']=_[_0x912c('0x3b')](_0xa2ac7f[_0x912c('0x3c')]);_0x2d11b6[_0x912c('0x3d')]=_['intersection'](_0x2d11b6['model'],_0x2d11b6[_0x912c('0x3c')]);_0x295a76[_0x912c('0x3e')]=_[_0x912c('0x3f')](_0x2d11b6[_0x912c('0x39')],qs[_0x912c('0x40')](_0xa2ac7f[_0x912c('0x3c')][_0x912c('0x40')]));_0x295a76['attributes']=_0x295a76['attributes']['length']?_0x295a76[_0x912c('0x3e')]:_0x2d11b6[_0x912c('0x39')];if(!_0xa2ac7f[_0x912c('0x3c')][_0x912c('0x41')](_0x912c('0x42'))){_0x295a76[_0x912c('0x2c')]=qs[_0x912c('0x2c')](_0xa2ac7f[_0x912c('0x3c')][_0x912c('0x2c')]);_0x295a76[_0x912c('0x29')]=qs[_0x912c('0x29')](_0xa2ac7f[_0x912c('0x3c')][_0x912c('0x29')]);}_0x295a76[_0x912c('0x43')]=qs['sort'](_0xa2ac7f[_0x912c('0x3c')][_0x912c('0x44')]);_0x295a76[_0x912c('0x45')]=qs[_0x912c('0x3d')](_[_0x912c('0x46')](_0xa2ac7f[_0x912c('0x3c')],_0x2d11b6[_0x912c('0x3d')]),_0x354329);if(_0xa2ac7f['query']['filter']){_0x295a76[_0x912c('0x45')]=_['merge'](_0x295a76[_0x912c('0x45')],{'$or':_[_0x912c('0x3a')](_0x354329,function(_0x11bbe0){if(_0x11bbe0[_0x912c('0x37')]!==_0x912c('0x47')){var _0x40d04b={};_0x40d04b[_0x11bbe0[_0x912c('0x34')]]={'$like':'%'+_0xa2ac7f[_0x912c('0x3c')]['filter']+'%'};return _0x40d04b;}})});}_0x295a76=_['merge']({},_0x295a76,_0xa2ac7f[_0x912c('0x48')]);var _0x393335={'where':_0x295a76[_0x912c('0x45')]};return db[_0x912c('0x49')][_0x912c('0x2b')](_0x393335)[_0x912c('0x1b')](function(_0x3caccb){_0x2816c5['count']=_0x3caccb;if(_0xa2ac7f[_0x912c('0x3c')][_0x912c('0x4a')]){_0x295a76[_0x912c('0x4b')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x295a76);})[_0x912c('0x1b')](function(_0x13c317){_0x2816c5[_0x912c('0x4c')]=_0x13c317;return _0x2816c5;})[_0x912c('0x1b')](respondWithFilteredResult(_0x347c71,_0x295a76))[_0x912c('0x4d')](handleError(_0x347c71,null));};exports[_0x912c('0x4e')]=function(_0x115ee7,_0x573467){var _0x3e7a8a={'raw':![],'where':{'id':_0x115ee7[_0x912c('0x4f')]['id']}},_0x121c09={};_0x121c09[_0x912c('0x39')]=_['keys'](db[_0x912c('0x49')]['rawAttributes']);_0x121c09[_0x912c('0x3c')]=_['keys'](_0x115ee7['query']);_0x121c09[_0x912c('0x3d')]=_[_0x912c('0x3f')](_0x121c09['model'],_0x121c09[_0x912c('0x3c')]);_0x3e7a8a[_0x912c('0x3e')]=_['intersection'](_0x121c09['model'],qs[_0x912c('0x40')](_0x115ee7[_0x912c('0x3c')][_0x912c('0x40')]));_0x3e7a8a['attributes']=_0x3e7a8a[_0x912c('0x3e')][_0x912c('0x50')]?_0x3e7a8a[_0x912c('0x3e')]:_0x121c09[_0x912c('0x39')];if(_0x115ee7[_0x912c('0x3c')]['includeAll']){_0x3e7a8a[_0x912c('0x4b')]=[{'all':!![]}];}_0x3e7a8a=_[_0x912c('0x51')]({},_0x3e7a8a,_0x115ee7['options']);return db[_0x912c('0x49')]['find'](_0x3e7a8a)[_0x912c('0x1b')](handleEntityNotFound(_0x573467,null))['then'](respondWithResult(_0x573467,null))[_0x912c('0x4d')](handleError(_0x573467,null));};exports[_0x912c('0x30')]=function(_0x23eea0,_0x17bdfa){if(_0x23eea0[_0x912c('0x52')]['id']){delete _0x23eea0[_0x912c('0x52')]['id'];}return db['Setting'][_0x912c('0x53')]({'where':{'id':_0x23eea0[_0x912c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x17bdfa,null))[_0x912c('0x1b')](saveUpdates(_0x23eea0['body'],null))[_0x912c('0x1b')](respondWithResult(_0x17bdfa,null))['catch'](handleError(_0x17bdfa,null));};exports[_0x912c('0x54')]=function(_0x103371,_0x86dbe5,_0x53f424){if(_0x103371['file']&&_0x103371[_0x912c('0x55')][_0x912c('0x56')]){_0x103371[_0x912c('0x52')][_0x912c('0x57')]=_0x103371[_0x912c('0x55')][_0x912c('0x56')];}return db['Setting']['find']({'where':{'id':_0x103371[_0x912c('0x4f')]['id']}})[_0x912c('0x1b')](handleEntityNotFound(_0x86dbe5,null))[_0x912c('0x1b')](saveUpdates(_0x103371['body'],null))[_0x912c('0x1b')](respondWithResult(_0x86dbe5,null))[_0x912c('0x4d')](handleError(_0x86dbe5,null));};exports[_0x912c('0x58')]=function(_0x3ce673,_0x388706,_0x44fcd9){if(_0x3ce673['file']&&_0x3ce673[_0x912c('0x55')][_0x912c('0x56')]){_0x3ce673[_0x912c('0x52')][_0x912c('0x59')]=_0x3ce673['file']['filename'];}return db[_0x912c('0x49')][_0x912c('0x53')]({'where':{'id':_0x3ce673[_0x912c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x388706,null))[_0x912c('0x1b')](saveUpdates(_0x3ce673[_0x912c('0x52')],null))[_0x912c('0x1b')](respondWithResult(_0x388706,null))[_0x912c('0x4d')](handleError(_0x388706,null));};var utilLicense=require('../../config/license/util');exports[_0x912c('0x5a')]=function(_0x2153f4,_0xc365dd,_0x2332e7){var _0x2afc13=_0x912c('0x5b');var _0x2360b6={'custom':![]};return utilLicense['getLicense']()[_0x912c('0x1b')](function(_0x5366e6){if(_0x5366e6){_0x2360b6=_0x5366e6;}return db[_0x912c('0x49')][_0x912c('0x53')]({'where':{'id':_0x2153f4[_0x912c('0x4f')]['id']},'attributes':[_0x912c('0x57'),_0x912c('0x59'),'preferred','favicon',_0x912c('0x5c'),_0x912c('0x5d'),'defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0xc365dd,null))[_0x912c('0x1b')](function(_0xa9d06){if(_0xa9d06){var _0x3dc4a0=_0xa9d06[_0x912c('0x57')]&&fs[_0x912c('0x5e')](path[_0x912c('0x5f')](config[_0x912c('0x60')],_0x2afc13,_[_0x912c('0x61')](_0xa9d06[_0x912c('0x57')])))?path[_0x912c('0x5f')](config[_0x912c('0x60')],_0x2afc13,_['toLower'](_0xa9d06['logo'])):path[_0x912c('0x5f')](config[_0x912c('0x60')],_0x2afc13,_[_0x912c('0x61')](_0x912c('0x62')));var _0x37de25=_0x912c('0x63')+_[_0x912c('0x64')](_0x912c('0x57'));if(_0xa9d06[_0x37de25]||!_0x2360b6['custom']){_0x3dc4a0=path[_0x912c('0x5f')](config['root'],_0x2afc13,_[_0x912c('0x61')](_0x912c('0x62')));}if(!fs['existsSync'](_0x3dc4a0)){throw new db[(_0x912c('0x65'))][(_0x912c('0x66'))](_[_0x912c('0x64')](_0x912c('0x57'))+_0x912c('0x67'));}return _0xc365dd[_0x912c('0x68')](_0x3dc4a0);}})[_0x912c('0x4d')](handleError(_0xc365dd,null));};var utilLicense=require(_0x912c('0x69'));exports[_0x912c('0x6a')]=function(_0x43f909,_0x2ea54e,_0x22a2f3){var _0x4dba2d=_0x912c('0x5b');var _0x2b5941={'custom':![]};return utilLicense[_0x912c('0x6b')]()[_0x912c('0x1b')](function(_0x23088e){if(_0x23088e){_0x2b5941=_0x23088e;}return db[_0x912c('0x49')][_0x912c('0x53')]({'where':{'id':_0x43f909[_0x912c('0x4f')]['id']},'attributes':[_0x912c('0x57'),_0x912c('0x59'),'preferred',_0x912c('0x6c'),_0x912c('0x5c'),_0x912c('0x5d'),_0x912c('0x6d'),_0x912c('0x6e')],'raw':!![]});})['then'](handleEntityNotFound(_0x2ea54e,null))[_0x912c('0x1b')](function(_0x17112a){if(_0x17112a){var _0x291be6=_0x17112a['loginLogo']&&fs[_0x912c('0x5e')](path[_0x912c('0x5f')](config['root'],_0x4dba2d,_[_0x912c('0x61')](_0x17112a[_0x912c('0x59')])))?path['join'](config[_0x912c('0x60')],_0x4dba2d,_[_0x912c('0x61')](_0x17112a[_0x912c('0x59')])):path['join'](config[_0x912c('0x60')],_0x4dba2d,_[_0x912c('0x61')](_0x912c('0x6f')));var _0x2a4c90='default'+_[_0x912c('0x64')]('loginLogo');if(_0x17112a[_0x2a4c90]||!_0x2b5941[_0x912c('0x70')]){_0x291be6=path[_0x912c('0x5f')](config['root'],_0x4dba2d,_[_0x912c('0x61')](_0x912c('0x6f')));}if(!fs[_0x912c('0x5e')](_0x291be6)){throw new db['Sequelize'][(_0x912c('0x66'))](_[_0x912c('0x64')](_0x912c('0x59'))+_0x912c('0x67'));}return _0x2ea54e[_0x912c('0x68')](_0x291be6);}})[_0x912c('0x4d')](handleError(_0x2ea54e,null));};exports[_0x912c('0x71')]=function(_0x171e09,_0x41050a){return db[_0x912c('0x49')][_0x912c('0x53')]({'where':{'id':_0x171e09[_0x912c('0x4f')]['id']},'attributes':[_0x912c('0x72')]})[_0x912c('0x1b')](respondWithResult(_0x41050a,null))[_0x912c('0x4d')](handleError(_0x41050a,null));};exports['addPreferred']=function(_0x1c4dd0,_0x13bb7f,_0x3d7bd2){if(_0x1c4dd0[_0x912c('0x55')]&&_0x1c4dd0['file'][_0x912c('0x56')]){_0x1c4dd0[_0x912c('0x52')][_0x912c('0x73')]=_0x1c4dd0[_0x912c('0x55')][_0x912c('0x56')];}return db[_0x912c('0x49')][_0x912c('0x53')]({'where':{'id':_0x1c4dd0[_0x912c('0x4f')]['id']}})[_0x912c('0x1b')](handleEntityNotFound(_0x13bb7f,null))[_0x912c('0x1b')](saveUpdates(_0x1c4dd0[_0x912c('0x52')],null))['then'](respondWithResult(_0x13bb7f,null))['catch'](handleError(_0x13bb7f,null));};var utilLicense=require(_0x912c('0x69'));exports[_0x912c('0x74')]=function(_0x3075c1,_0x41bb3f,_0x2bb57b){var _0x41439d=_0x912c('0x5b');var _0x338748={'custom':![]};return utilLicense[_0x912c('0x6b')]()[_0x912c('0x1b')](function(_0x3ed46d){if(_0x3ed46d){_0x338748=_0x3ed46d;}return db['Setting'][_0x912c('0x53')]({'where':{'id':_0x3075c1[_0x912c('0x4f')]['id']},'attributes':['logo',_0x912c('0x59'),_0x912c('0x73'),_0x912c('0x6c'),_0x912c('0x5c'),_0x912c('0x5d'),'defaultPreferred',_0x912c('0x6e')],'raw':!![]});})[_0x912c('0x1b')](handleEntityNotFound(_0x41bb3f,null))[_0x912c('0x1b')](function(_0x3b73ac){if(_0x3b73ac){var _0x1a4c4b=_0x3b73ac[_0x912c('0x73')]&&fs[_0x912c('0x5e')](path['join'](config[_0x912c('0x60')],_0x41439d,_['toLower'](_0x3b73ac[_0x912c('0x73')])))?path['join'](config[_0x912c('0x60')],_0x41439d,_[_0x912c('0x61')](_0x3b73ac[_0x912c('0x73')])):path[_0x912c('0x5f')](config['root'],_0x41439d,_[_0x912c('0x61')](_0x912c('0x75')));var _0x33ca24='default'+_[_0x912c('0x64')](_0x912c('0x73'));if(_0x3b73ac[_0x33ca24]||!_0x338748[_0x912c('0x70')]||!_0x338748[_0x912c('0x73')]){_0x1a4c4b=path[_0x912c('0x5f')](config[_0x912c('0x60')],_0x41439d,_[_0x912c('0x61')]('default_preferred.png'));}if(!fs[_0x912c('0x5e')](_0x1a4c4b)){throw new db[(_0x912c('0x65'))][(_0x912c('0x66'))](_[_0x912c('0x64')]('preferred')+'\x20not\x20found');}return _0x41bb3f[_0x912c('0x68')](_0x1a4c4b);}})[_0x912c('0x4d')](handleError(_0x41bb3f,null));};exports['addFavicon']=function(_0x276f3e,_0x480c16,_0x225f69){if(_0x276f3e[_0x912c('0x55')]&&_0x276f3e[_0x912c('0x55')][_0x912c('0x56')]){_0x276f3e[_0x912c('0x52')][_0x912c('0x6c')]=_0x276f3e['file'][_0x912c('0x56')];}return db['Setting'][_0x912c('0x53')]({'where':{'id':_0x276f3e[_0x912c('0x4f')]['id']}})[_0x912c('0x1b')](handleEntityNotFound(_0x480c16,null))[_0x912c('0x1b')](saveUpdates(_0x276f3e[_0x912c('0x52')],null))[_0x912c('0x1b')](respondWithResult(_0x480c16,null))['catch'](handleError(_0x480c16,null));};var utilLicense=require(_0x912c('0x69'));exports[_0x912c('0x76')]=function(_0x1bb405,_0x1faef5,_0x450e31){var _0x5edc51=_0x912c('0x5b');var _0x5d4601={'custom':![]};return utilLicense[_0x912c('0x6b')]()['then'](function(_0x27a9da){if(_0x27a9da){_0x5d4601=_0x27a9da;}return db[_0x912c('0x49')][_0x912c('0x53')]({'where':{'id':_0x1bb405[_0x912c('0x4f')]['id']},'attributes':['logo','loginLogo',_0x912c('0x73'),_0x912c('0x6c'),_0x912c('0x5c'),_0x912c('0x5d'),_0x912c('0x6d'),_0x912c('0x6e')],'raw':!![]});})['then'](handleEntityNotFound(_0x1faef5,null))[_0x912c('0x1b')](function(_0x5382c6){if(_0x5382c6){var _0x2258de=_0x5382c6['favicon']&&fs[_0x912c('0x5e')](path[_0x912c('0x5f')](config[_0x912c('0x60')],_0x5edc51,_['toLower'](_0x5382c6[_0x912c('0x6c')])))?path[_0x912c('0x5f')](config[_0x912c('0x60')],_0x5edc51,_['toLower'](_0x5382c6['favicon'])):path[_0x912c('0x5f')](config['root'],_0x5edc51,_[_0x912c('0x61')](_0x912c('0x77')));var _0x9b02d=_0x912c('0x63')+_[_0x912c('0x64')](_0x912c('0x6c'));if(_0x5382c6[_0x9b02d]||!_0x5d4601[_0x912c('0x70')]){_0x2258de=path[_0x912c('0x5f')](config[_0x912c('0x60')],_0x5edc51,_[_0x912c('0x61')](_0x912c('0x77')));}if(!fs[_0x912c('0x5e')](_0x2258de)){throw new db[(_0x912c('0x65'))][(_0x912c('0x66'))](_[_0x912c('0x64')](_0x912c('0x6c'))+_0x912c('0x67'));}return _0x1faef5[_0x912c('0x68')](_0x2258de);}})[_0x912c('0x4d')](handleError(_0x1faef5,null));};exports[_0x912c('0x78')]=function(_0x9be3b1,_0x1bda25){var _0x4f67ee={'offset':moment()[_0x912c('0x79')]()};_0x4f67ee['now']=moment()['utcOffset'](_0x4f67ee['offset'])[_0x912c('0x7a')](_0x912c('0x7b'));return _0x1bda25[_0x912c('0x27')](0xc8)[_0x912c('0x7c')](_0x4f67ee);}; \ No newline at end of file +var _0x3de0=['status','end','json','limit','undefined','offset','count','Content-Range','apply','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','rows','show','length','find','body','Setting','params','addLogo','filename','logo','file','addLogoLogin','loginLogo','server/files/images/logos','preferred','defaultLoginLogo','defaultPreferred','existsSync','join','toLower','root','default_logo.svg','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','defaultFavicon','default_loginLogo.svg','default','custom','gdpr','securePassword','addPreferred','getPreferred','favicon','defaultLogo','default_preferred.png','addFavicon','getLicense','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','sendStatus'];(function(_0x342119,_0x4f6b31){var _0x19ab38=function(_0x311195){while(--_0x311195){_0x342119['push'](_0x342119['shift']());}};_0x19ab38(++_0x4f6b31);}(_0x3de0,0x143));var _0x03de=function(_0x5909b3,_0x1678fb){_0x5909b3=_0x5909b3-0x0;var _0x9a233c=_0x3de0[_0x5909b3];return _0x9a233c;};'use strict';var emlformat=require(_0x03de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03de('0x1'));var jsonpatch=require(_0x03de('0x2'));var rp=require('request-promise');var moment=require(_0x03de('0x3'));var BPromise=require(_0x03de('0x4'));var Mustache=require('mustache');var util=require(_0x03de('0x5'));var path=require(_0x03de('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x03de('0x7'));var fs=require('fs');var fs_extra=require(_0x03de('0x8'));var _=require(_0x03de('0x9'));var squel=require(_0x03de('0xa'));var crypto=require(_0x03de('0xb'));var jsforce=require(_0x03de('0xc'));var deskjs=require(_0x03de('0xd'));var toCsv=require(_0x03de('0xe'));var querystring=require('querystring');var Papa=require(_0x03de('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x03de('0x10'));var as=require(_0x03de('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03de('0x12'))(_0x03de('0x13'));var utils=require('../../config/utils');var config=require(_0x03de('0x14'));var licenseUtil=require(_0x03de('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x03de('0x16'));var client=jayson[_0x03de('0x17')][_0x03de('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x341e6a,_0x1570c3,_0x5d37da,_0xf9553d){return new BPromise(function(_0x1b467e,_0x14d19c){var _0x4064a8=_0xf9553d||client;return _0x4064a8['request'](_0x341e6a,_0x5d37da)[_0x03de('0x19')](function(_0xedbc6b){logger[_0x03de('0x1a')](_0x03de('0x1b'),_0x1570c3,_0x03de('0x1c'));logger[_0x03de('0x1d')](_0x03de('0x1e'),_0x1570c3,_0x03de('0x1c'),JSON[_0x03de('0x1f')](_0xedbc6b));if(_0xedbc6b['error']){if(_0xedbc6b['error'][_0x03de('0x20')]===0x1f4){logger[_0x03de('0x21')](_0x03de('0x1b'),_0x1570c3,_0xedbc6b['error'][_0x03de('0x22')]);return _0x14d19c(_0xedbc6b[_0x03de('0x21')][_0x03de('0x22')]);}logger[_0x03de('0x21')](_0x03de('0x1b'),_0x1570c3,_0xedbc6b[_0x03de('0x21')][_0x03de('0x22')]);return _0x1b467e(_0xedbc6b['error']['message']);}else{logger['info'](_0x03de('0x1b'),_0x1570c3,_0x03de('0x1c'));_0x1b467e(_0xedbc6b['result'][_0x03de('0x22')]);}})[_0x03de('0x23')](function(_0xebbd43){logger['error'](_0x03de('0x1b'),_0x1570c3,_0xebbd43);_0x14d19c(_0xebbd43);});});}function respondWithStatusCode(_0x396a57,_0x5f2317){_0x5f2317=_0x5f2317||0xcc;return function(_0x13fb22){if(_0x13fb22){return _0x396a57[_0x03de('0x24')](_0x5f2317);}return _0x396a57[_0x03de('0x25')](_0x5f2317)[_0x03de('0x26')]();};}function respondWithResult(_0x183e72,_0x54b4fc){_0x54b4fc=_0x54b4fc||0xc8;return function(_0xf54687){if(_0xf54687){return _0x183e72[_0x03de('0x25')](_0x54b4fc)[_0x03de('0x27')](_0xf54687);}};}function respondWithFilteredResult(_0x1ed415,_0x5a9631){return function(_0x14e785){if(_0x14e785){var _0x28416a=typeof _0x5a9631['offset']==='undefined'&&typeof _0x5a9631[_0x03de('0x28')]===_0x03de('0x29');var _0x500534=_0x14e785['count'];var _0x261b19=_0x28416a?0x0:_0x5a9631[_0x03de('0x2a')];var _0x514232=_0x28416a?_0x14e785[_0x03de('0x2b')]:_0x5a9631[_0x03de('0x2a')]+_0x5a9631[_0x03de('0x28')];var _0x2c4e16;if(_0x514232>=_0x500534){_0x514232=_0x500534;_0x2c4e16=0xc8;}else{_0x2c4e16=0xce;}_0x1ed415['status'](_0x2c4e16);return _0x1ed415['set'](_0x03de('0x2c'),_0x261b19+'-'+_0x514232+'/'+_0x500534)[_0x03de('0x27')](_0x14e785);}return null;};}function patchUpdates(_0x338ae1){return function(_0x1be7da){try{jsonpatch[_0x03de('0x2d')](_0x1be7da,_0x338ae1,!![]);}catch(_0x7d35de){return BPromise['reject'](_0x7d35de);}return _0x1be7da[_0x03de('0x2e')]();};}function saveUpdates(_0x11289f,_0xab59a2){return function(_0x4399ed){if(_0x4399ed){return _0x4399ed[_0x03de('0x2f')](_0x11289f)[_0x03de('0x19')](function(_0x51fa95){return _0x51fa95;});}return null;};}function removeEntity(_0x52d9fd,_0x2a864d){return function(_0x5f1465){if(_0x5f1465){return _0x5f1465[_0x03de('0x30')]()[_0x03de('0x19')](function(){_0x52d9fd[_0x03de('0x25')](0xcc)[_0x03de('0x26')]();});}};}function handleEntityNotFound(_0x4a1819,_0x40a6dc){return function(_0x2971a0){if(!_0x2971a0){_0x4a1819[_0x03de('0x24')](0x194);}return _0x2971a0;};}function handleError(_0x147ac6,_0x54b182){_0x54b182=_0x54b182||0x1f4;return function(_0x111af4){logger[_0x03de('0x21')](_0x111af4[_0x03de('0x31')]);if(_0x111af4['name']){delete _0x111af4[_0x03de('0x32')];}_0x147ac6[_0x03de('0x25')](_0x54b182)[_0x03de('0x33')](_0x111af4);};}exports[_0x03de('0x34')]=function(_0x46aa12,_0x6290da){var _0xdb21c3={},_0x5bc7dd={},_0x10d0c8={'count':0x0,'rows':[]};var _0x17e2ca=_['map'](db['Setting'][_0x03de('0x35')],function(_0x3061d9){return{'name':_0x3061d9[_0x03de('0x36')],'type':_0x3061d9[_0x03de('0x37')][_0x03de('0x38')]};});_0x5bc7dd[_0x03de('0x39')]=_[_0x03de('0x3a')](_0x17e2ca,_0x03de('0x32'));_0x5bc7dd[_0x03de('0x3b')]=_[_0x03de('0x3c')](_0x46aa12[_0x03de('0x3b')]);_0x5bc7dd[_0x03de('0x3d')]=_[_0x03de('0x3e')](_0x5bc7dd[_0x03de('0x39')],_0x5bc7dd[_0x03de('0x3b')]);_0xdb21c3[_0x03de('0x3f')]=_[_0x03de('0x3e')](_0x5bc7dd[_0x03de('0x39')],qs[_0x03de('0x40')](_0x46aa12[_0x03de('0x3b')]['fields']));_0xdb21c3[_0x03de('0x3f')]=_0xdb21c3[_0x03de('0x3f')]['length']?_0xdb21c3[_0x03de('0x3f')]:_0x5bc7dd[_0x03de('0x39')];if(!_0x46aa12[_0x03de('0x3b')][_0x03de('0x41')](_0x03de('0x42'))){_0xdb21c3[_0x03de('0x28')]=qs[_0x03de('0x28')](_0x46aa12[_0x03de('0x3b')]['limit']);_0xdb21c3[_0x03de('0x2a')]=qs[_0x03de('0x2a')](_0x46aa12[_0x03de('0x3b')][_0x03de('0x2a')]);}_0xdb21c3[_0x03de('0x43')]=qs[_0x03de('0x44')](_0x46aa12[_0x03de('0x3b')][_0x03de('0x44')]);_0xdb21c3['where']=qs[_0x03de('0x3d')](_['pick'](_0x46aa12['query'],_0x5bc7dd[_0x03de('0x3d')]),_0x17e2ca);if(_0x46aa12[_0x03de('0x3b')][_0x03de('0x45')]){_0xdb21c3['where']=_['merge'](_0xdb21c3[_0x03de('0x46')],{'$or':_[_0x03de('0x3a')](_0x17e2ca,function(_0x33315f){if(_0x33315f[_0x03de('0x37')]!=='VIRTUAL'){var _0x99b1a1={};_0x99b1a1[_0x33315f['name']]={'$like':'%'+_0x46aa12[_0x03de('0x3b')][_0x03de('0x45')]+'%'};return _0x99b1a1;}})});}_0xdb21c3=_[_0x03de('0x47')]({},_0xdb21c3,_0x46aa12[_0x03de('0x48')]);var _0x1352c5={'where':_0xdb21c3[_0x03de('0x46')]};return db['Setting'][_0x03de('0x2b')](_0x1352c5)['then'](function(_0x2b8646){_0x10d0c8['count']=_0x2b8646;if(_0x46aa12[_0x03de('0x3b')][_0x03de('0x49')]){_0xdb21c3[_0x03de('0x4a')]=[{'all':!![]}];}return db['Setting']['findAll'](_0xdb21c3);})[_0x03de('0x19')](function(_0x1bd748){_0x10d0c8[_0x03de('0x4b')]=_0x1bd748;return _0x10d0c8;})[_0x03de('0x19')](respondWithFilteredResult(_0x6290da,_0xdb21c3))[_0x03de('0x23')](handleError(_0x6290da,null));};exports[_0x03de('0x4c')]=function(_0xa69b75,_0x47e771){var _0x2ae2c6={'raw':![],'where':{'id':_0xa69b75['params']['id']}},_0x1b6c6e={};_0x1b6c6e[_0x03de('0x39')]=_[_0x03de('0x3c')](db['Setting'][_0x03de('0x35')]);_0x1b6c6e[_0x03de('0x3b')]=_['keys'](_0xa69b75[_0x03de('0x3b')]);_0x1b6c6e['filters']=_['intersection'](_0x1b6c6e[_0x03de('0x39')],_0x1b6c6e[_0x03de('0x3b')]);_0x2ae2c6[_0x03de('0x3f')]=_[_0x03de('0x3e')](_0x1b6c6e[_0x03de('0x39')],qs['fields'](_0xa69b75['query'][_0x03de('0x40')]));_0x2ae2c6['attributes']=_0x2ae2c6['attributes'][_0x03de('0x4d')]?_0x2ae2c6['attributes']:_0x1b6c6e[_0x03de('0x39')];if(_0xa69b75[_0x03de('0x3b')][_0x03de('0x49')]){_0x2ae2c6['include']=[{'all':!![]}];}_0x2ae2c6=_[_0x03de('0x47')]({},_0x2ae2c6,_0xa69b75[_0x03de('0x48')]);return db['Setting'][_0x03de('0x4e')](_0x2ae2c6)[_0x03de('0x19')](handleEntityNotFound(_0x47e771,null))['then'](respondWithResult(_0x47e771,null))[_0x03de('0x23')](handleError(_0x47e771,null));};exports['update']=function(_0x9e151d,_0x115ae6){if(_0x9e151d[_0x03de('0x4f')]['id']){delete _0x9e151d[_0x03de('0x4f')]['id'];}return db[_0x03de('0x50')][_0x03de('0x4e')]({'where':{'id':_0x9e151d[_0x03de('0x51')]['id']}})[_0x03de('0x19')](handleEntityNotFound(_0x115ae6,null))['then'](saveUpdates(_0x9e151d['body'],null))[_0x03de('0x19')](respondWithResult(_0x115ae6,null))[_0x03de('0x23')](handleError(_0x115ae6,null));};exports[_0x03de('0x52')]=function(_0x4f1a61,_0x2dfed6,_0x1f4a70){if(_0x4f1a61['file']&&_0x4f1a61['file'][_0x03de('0x53')]){_0x4f1a61['body'][_0x03de('0x54')]=_0x4f1a61[_0x03de('0x55')][_0x03de('0x53')];}return db['Setting'][_0x03de('0x4e')]({'where':{'id':_0x4f1a61[_0x03de('0x51')]['id']}})['then'](handleEntityNotFound(_0x2dfed6,null))[_0x03de('0x19')](saveUpdates(_0x4f1a61[_0x03de('0x4f')],null))[_0x03de('0x19')](respondWithResult(_0x2dfed6,null))['catch'](handleError(_0x2dfed6,null));};exports[_0x03de('0x56')]=function(_0x5720c8,_0x1d4d45,_0x2b2f42){if(_0x5720c8[_0x03de('0x55')]&&_0x5720c8[_0x03de('0x55')][_0x03de('0x53')]){_0x5720c8['body'][_0x03de('0x57')]=_0x5720c8['file'][_0x03de('0x53')];}return db['Setting'][_0x03de('0x4e')]({'where':{'id':_0x5720c8['params']['id']}})[_0x03de('0x19')](handleEntityNotFound(_0x1d4d45,null))[_0x03de('0x19')](saveUpdates(_0x5720c8[_0x03de('0x4f')],null))['then'](respondWithResult(_0x1d4d45,null))[_0x03de('0x23')](handleError(_0x1d4d45,null));};var utilLicense=require(_0x03de('0x15'));exports['getLogo']=function(_0x3af274,_0x564e0a,_0x3ea1d3){var _0x203f62=_0x03de('0x58');var _0x5c225a={'custom':![]};return utilLicense['getLicense']()[_0x03de('0x19')](function(_0x2771a5){if(_0x2771a5){_0x5c225a=_0x2771a5;}return db[_0x03de('0x50')][_0x03de('0x4e')]({'where':{'id':_0x3af274[_0x03de('0x51')]['id']},'attributes':[_0x03de('0x54'),_0x03de('0x57'),_0x03de('0x59'),'favicon','defaultLogo',_0x03de('0x5a'),_0x03de('0x5b'),'defaultFavicon'],'raw':!![]});})[_0x03de('0x19')](handleEntityNotFound(_0x564e0a,null))[_0x03de('0x19')](function(_0x17557d){if(_0x17557d){var _0x480890=_0x17557d[_0x03de('0x54')]&&fs[_0x03de('0x5c')](path[_0x03de('0x5d')](config['root'],_0x203f62,_[_0x03de('0x5e')](_0x17557d[_0x03de('0x54')])))?path[_0x03de('0x5d')](config[_0x03de('0x5f')],_0x203f62,_[_0x03de('0x5e')](_0x17557d['logo'])):path[_0x03de('0x5d')](config[_0x03de('0x5f')],_0x203f62,_[_0x03de('0x5e')](_0x03de('0x60')));var _0x4b6886='default'+_['upperFirst'](_0x03de('0x54'));if(_0x17557d[_0x4b6886]||!_0x5c225a['custom']){_0x480890=path[_0x03de('0x5d')](config[_0x03de('0x5f')],_0x203f62,_[_0x03de('0x5e')]('default_logo.svg'));}if(!fs[_0x03de('0x5c')](_0x480890)){throw new db[(_0x03de('0x61'))][(_0x03de('0x62'))](_[_0x03de('0x63')]('logo')+_0x03de('0x64'));}return _0x564e0a[_0x03de('0x65')](_0x480890);}})['catch'](handleError(_0x564e0a,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x564f9a,_0x16e631,_0x1a6eb6){var _0x5b199a=_0x03de('0x58');var _0x20db51={'custom':![]};return utilLicense['getLicense']()[_0x03de('0x19')](function(_0x2a8650){if(_0x2a8650){_0x20db51=_0x2a8650;}return db['Setting']['find']({'where':{'id':_0x564f9a[_0x03de('0x51')]['id']},'attributes':[_0x03de('0x54'),_0x03de('0x57'),'preferred','favicon','defaultLogo',_0x03de('0x5a'),_0x03de('0x5b'),_0x03de('0x66')],'raw':!![]});})[_0x03de('0x19')](handleEntityNotFound(_0x16e631,null))[_0x03de('0x19')](function(_0x3a6824){if(_0x3a6824){var _0x225c0f=_0x3a6824[_0x03de('0x57')]&&fs['existsSync'](path[_0x03de('0x5d')](config[_0x03de('0x5f')],_0x5b199a,_[_0x03de('0x5e')](_0x3a6824[_0x03de('0x57')])))?path[_0x03de('0x5d')](config[_0x03de('0x5f')],_0x5b199a,_[_0x03de('0x5e')](_0x3a6824[_0x03de('0x57')])):path[_0x03de('0x5d')](config[_0x03de('0x5f')],_0x5b199a,_['toLower'](_0x03de('0x67')));var _0x5cc5b2=_0x03de('0x68')+_[_0x03de('0x63')](_0x03de('0x57'));if(_0x3a6824[_0x5cc5b2]||!_0x20db51[_0x03de('0x69')]){_0x225c0f=path['join'](config[_0x03de('0x5f')],_0x5b199a,_['toLower'](_0x03de('0x67')));}if(!fs[_0x03de('0x5c')](_0x225c0f)){throw new db[(_0x03de('0x61'))][(_0x03de('0x62'))](_[_0x03de('0x63')](_0x03de('0x57'))+_0x03de('0x64'));}return _0x16e631[_0x03de('0x65')](_0x225c0f);}})['catch'](handleError(_0x16e631,null));};exports[_0x03de('0x6a')]=function(_0x3333b0,_0x43f05c){return db['Setting'][_0x03de('0x4e')]({'where':{'id':_0x3333b0[_0x03de('0x51')]['id']},'attributes':[_0x03de('0x6b')]})['then'](respondWithResult(_0x43f05c,null))[_0x03de('0x23')](handleError(_0x43f05c,null));};exports[_0x03de('0x6c')]=function(_0x8e248c,_0x179e31,_0x2f1605){if(_0x8e248c[_0x03de('0x55')]&&_0x8e248c['file'][_0x03de('0x53')]){_0x8e248c['body']['preferred']=_0x8e248c[_0x03de('0x55')][_0x03de('0x53')];}return db[_0x03de('0x50')][_0x03de('0x4e')]({'where':{'id':_0x8e248c['params']['id']}})[_0x03de('0x19')](handleEntityNotFound(_0x179e31,null))['then'](saveUpdates(_0x8e248c['body'],null))[_0x03de('0x19')](respondWithResult(_0x179e31,null))[_0x03de('0x23')](handleError(_0x179e31,null));};var utilLicense=require(_0x03de('0x15'));exports[_0x03de('0x6d')]=function(_0x292c4e,_0x1129a2,_0x571bac){var _0x40a1ee=_0x03de('0x58');var _0x5f5b79={'custom':![]};return utilLicense['getLicense']()[_0x03de('0x19')](function(_0x3ec9ab){if(_0x3ec9ab){_0x5f5b79=_0x3ec9ab;}return db[_0x03de('0x50')][_0x03de('0x4e')]({'where':{'id':_0x292c4e[_0x03de('0x51')]['id']},'attributes':['logo',_0x03de('0x57'),_0x03de('0x59'),_0x03de('0x6e'),_0x03de('0x6f'),_0x03de('0x5a'),_0x03de('0x5b'),_0x03de('0x66')],'raw':!![]});})[_0x03de('0x19')](handleEntityNotFound(_0x1129a2,null))[_0x03de('0x19')](function(_0x1b2591){if(_0x1b2591){var _0x1c3184=_0x1b2591[_0x03de('0x59')]&&fs['existsSync'](path[_0x03de('0x5d')](config['root'],_0x40a1ee,_[_0x03de('0x5e')](_0x1b2591[_0x03de('0x59')])))?path[_0x03de('0x5d')](config[_0x03de('0x5f')],_0x40a1ee,_['toLower'](_0x1b2591[_0x03de('0x59')])):path[_0x03de('0x5d')](config['root'],_0x40a1ee,_[_0x03de('0x5e')](_0x03de('0x70')));var _0x32b7d1=_0x03de('0x68')+_['upperFirst']('preferred');if(_0x1b2591[_0x32b7d1]||!_0x5f5b79['custom']||!_0x5f5b79[_0x03de('0x59')]){_0x1c3184=path['join'](config[_0x03de('0x5f')],_0x40a1ee,_[_0x03de('0x5e')]('default_preferred.png'));}if(!fs[_0x03de('0x5c')](_0x1c3184)){throw new db['Sequelize'][(_0x03de('0x62'))](_[_0x03de('0x63')](_0x03de('0x59'))+'\x20not\x20found');}return _0x1129a2[_0x03de('0x65')](_0x1c3184);}})[_0x03de('0x23')](handleError(_0x1129a2,null));};exports[_0x03de('0x71')]=function(_0x2e2cf5,_0x2632d3,_0x151637){if(_0x2e2cf5[_0x03de('0x55')]&&_0x2e2cf5[_0x03de('0x55')][_0x03de('0x53')]){_0x2e2cf5[_0x03de('0x4f')][_0x03de('0x6e')]=_0x2e2cf5['file'][_0x03de('0x53')];}return db[_0x03de('0x50')][_0x03de('0x4e')]({'where':{'id':_0x2e2cf5[_0x03de('0x51')]['id']}})['then'](handleEntityNotFound(_0x2632d3,null))[_0x03de('0x19')](saveUpdates(_0x2e2cf5[_0x03de('0x4f')],null))[_0x03de('0x19')](respondWithResult(_0x2632d3,null))[_0x03de('0x23')](handleError(_0x2632d3,null));};var utilLicense=require(_0x03de('0x15'));exports['getFavicon']=function(_0x18b45e,_0x943abd,_0x44da26){var _0x4f64fa=_0x03de('0x58');var _0x3121b3={'custom':![]};return utilLicense[_0x03de('0x72')]()['then'](function(_0x677818){if(_0x677818){_0x3121b3=_0x677818;}return db[_0x03de('0x50')][_0x03de('0x4e')]({'where':{'id':_0x18b45e[_0x03de('0x51')]['id']},'attributes':[_0x03de('0x54'),_0x03de('0x57'),_0x03de('0x59'),_0x03de('0x6e'),_0x03de('0x6f'),_0x03de('0x5a'),_0x03de('0x5b'),_0x03de('0x66')],'raw':!![]});})[_0x03de('0x19')](handleEntityNotFound(_0x943abd,null))[_0x03de('0x19')](function(_0x2489dd){if(_0x2489dd){var _0xfa03ad=_0x2489dd[_0x03de('0x6e')]&&fs['existsSync'](path[_0x03de('0x5d')](config['root'],_0x4f64fa,_[_0x03de('0x5e')](_0x2489dd['favicon'])))?path[_0x03de('0x5d')](config[_0x03de('0x5f')],_0x4f64fa,_[_0x03de('0x5e')](_0x2489dd[_0x03de('0x6e')])):path['join'](config[_0x03de('0x5f')],_0x4f64fa,_['toLower'](_0x03de('0x73')));var _0x559311='default'+_[_0x03de('0x63')](_0x03de('0x6e'));if(_0x2489dd[_0x559311]||!_0x3121b3[_0x03de('0x69')]){_0xfa03ad=path['join'](config[_0x03de('0x5f')],_0x4f64fa,_[_0x03de('0x5e')](_0x03de('0x73')));}if(!fs[_0x03de('0x5c')](_0xfa03ad)){throw new db['Sequelize']['ValidationError'](_[_0x03de('0x63')]('favicon')+'\x20not\x20found');}return _0x943abd[_0x03de('0x65')](_0xfa03ad);}})[_0x03de('0x23')](handleError(_0x943abd,null));};exports[_0x03de('0x74')]=function(_0x5958a8,_0x3c3653){var _0x24b837={'offset':moment()[_0x03de('0x75')]()};_0x24b837[_0x03de('0x76')]=moment()[_0x03de('0x75')](_0x24b837[_0x03de('0x2a')])['format'](_0x03de('0x77'));return _0x3c3653[_0x03de('0x25')](0xc8)[_0x03de('0x33')](_0x24b837);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 06e6471..193f0cc 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(_0x58fbb0,_0xe497b5){var _0x1783d2=function(_0x5554a8){while(--_0x5554a8){_0x58fbb0['push'](_0x58fbb0['shift']());}};_0x1783d2(++_0xe497b5);}(_0x008c,0x188));var _0xc008=function(_0x9a7d5b,_0x50327f){_0x9a7d5b=_0x9a7d5b-0x0;var _0xe2a5b3=_0x008c[_0x9a7d5b];return _0xe2a5b3;};'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 _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x44c742,_0x5d69a4){var _0x40fcf0=function(_0x453d3c){while(--_0x453d3c){_0x44c742['push'](_0x44c742['shift']());}};_0x40fcf0(++_0x5d69a4);}(_0x3e74,0x175));var _0x43e7=function(_0x42596a,_0x4dc247){_0x42596a=_0x42596a-0x0;var _0x108e18=_0x3e74[_0x42596a];return _0x108e18;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index de07ebf..5e26527 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 _0x579d=['jayson/promise','http','then','info','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSetting','Setting','find','options','raw','where','map','model','include','attributes','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x40f210,_0x47ff44){var _0x3a7de6=function(_0x3360ac){while(--_0x3360ac){_0x40f210['push'](_0x40f210['shift']());}};_0x3a7de6(++_0x47ff44);}(_0x579d,0x1e7));var _0xd579=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x579d[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require(_0xd579('0x0'));var moment=require('moment');var BPromise=require(_0xd579('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd579('0x2'))['db'];var utils=require(_0xd579('0x3'));var logger=require(_0xd579('0x4'))(_0xd579('0x5'));var config=require('../../config/environment');var jayson=require(_0xd579('0x6'));var client=jayson['client'][_0xd579('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37d42a,_0x153194,_0x490bdf){return new BPromise(function(_0x51640d,_0x298f8a){return client['request'](_0x37d42a,_0x490bdf)[_0xd579('0x8')](function(_0x2579e5){logger[_0xd579('0x9')](_0xd579('0xa'),_0x153194,'request\x20sent');logger['debug'](_0xd579('0xb'),_0x153194,_0xd579('0xc'),JSON[_0xd579('0xd')](_0x2579e5));if(_0x2579e5[_0xd579('0xe')]){if(_0x2579e5[_0xd579('0xe')][_0xd579('0xf')]===0x1f4){logger[_0xd579('0xe')](_0xd579('0xa'),_0x153194,_0x2579e5[_0xd579('0xe')][_0xd579('0x10')]);return _0x298f8a(_0x2579e5['error'][_0xd579('0x10')]);}logger[_0xd579('0xe')](_0xd579('0xa'),_0x153194,_0x2579e5[_0xd579('0xe')][_0xd579('0x10')]);return _0x51640d(_0x2579e5[_0xd579('0xe')]['message']);}else{logger[_0xd579('0x9')](_0xd579('0xa'),_0x153194,_0xd579('0xc'));_0x51640d(_0x2579e5[_0xd579('0x11')][_0xd579('0x10')]);}})[_0xd579('0x12')](function(_0x1a2842){logger[_0xd579('0xe')]('Setting,\x20%s,\x20%s',_0x153194,_0x1a2842);_0x298f8a(_0x1a2842);});});}exports[_0xd579('0x13')]=function(_0x539360){var _0xa7dae5=this;return new Promise(function(_0xa5b768,_0x59ac8c){return db[_0xd579('0x14')][_0xd579('0x15')]({'raw':_0x539360[_0xd579('0x16')]?_0x539360[_0xd579('0x16')][_0xd579('0x17')]===undefined?!![]:![]:!![],'where':_0x539360[_0xd579('0x16')]?_0x539360['options'][_0xd579('0x18')]||null:null,'attributes':_0x539360[_0xd579('0x16')]?_0x539360[_0xd579('0x16')]['attributes']||null:null,'include':_0x539360['options']?_0x539360[_0xd579('0x16')]['include']?_[_0xd579('0x19')](_0x539360[_0xd579('0x16')]['include'],function(_0xb2b5b1){return{'model':db[_0xb2b5b1[_0xd579('0x1a')]],'as':_0xb2b5b1['as'],'attributes':_0xb2b5b1['attributes'],'include':_0xb2b5b1[_0xd579('0x1b')]?_['map'](_0xb2b5b1[_0xd579('0x1b')],function(_0x8df54b){return{'model':db[_0x8df54b[_0xd579('0x1a')]],'as':_0x8df54b['as'],'attributes':_0x8df54b[_0xd579('0x1c')],'include':_0x8df54b[_0xd579('0x1b')]?_[_0xd579('0x19')](_0x8df54b[_0xd579('0x1b')],function(_0x4a0345){return{'model':db[_0x4a0345[_0xd579('0x1a')]],'as':_0x4a0345['as'],'attributes':_0x4a0345[_0xd579('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd579('0x8')](function(_0x225b18){logger[_0xd579('0x9')]('ShowSetting',_0x539360);logger['debug'](_0xd579('0x13'),_0x539360,JSON[_0xd579('0xd')](_0x225b18));_0xa5b768(_0x225b18);})[_0xd579('0x12')](function(_0x232033){logger[_0xd579('0xe')](_0xd579('0x13'),_0x232033[_0xd579('0x10')],_0x539360);_0x59ac8c(_0xa7dae5[_0xd579('0xe')](0x1f4,_0x232033[_0xd579('0x10')]));});});}; \ No newline at end of file +var _0x5a69=['http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','options','raw','attributes','include','map','model','ShowSetting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x51c540,_0x365c0c){var _0x2cddc3=function(_0x47b352){while(--_0x47b352){_0x51c540['push'](_0x51c540['shift']());}};_0x2cddc3(++_0x365c0c);}(_0x5a69,0xce));var _0x95a6=function(_0xc23a57,_0x21d26f){_0xc23a57=_0xc23a57-0x0;var _0x4ba038=_0x5a69[_0xc23a57];return _0x4ba038;};'use strict';var _=require(_0x95a6('0x0'));var util=require('util');var moment=require(_0x95a6('0x1'));var BPromise=require(_0x95a6('0x2'));var rs=require(_0x95a6('0x3'));var fs=require('fs');var Redis=require(_0x95a6('0x4'));var db=require(_0x95a6('0x5'))['db'];var utils=require(_0x95a6('0x6'));var logger=require('../../config/logger')(_0x95a6('0x7'));var config=require(_0x95a6('0x8'));var jayson=require(_0x95a6('0x9'));var client=jayson['client'][_0x95a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ca56d,_0x3feded,_0x5b9932){return new BPromise(function(_0x51998e,_0x45602f){return client[_0x95a6('0xb')](_0x1ca56d,_0x5b9932)[_0x95a6('0xc')](function(_0x36f095){logger[_0x95a6('0xd')](_0x95a6('0xe'),_0x3feded,_0x95a6('0xf'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x3feded,_0x95a6('0xf'),JSON[_0x95a6('0x10')](_0x36f095));if(_0x36f095['error']){if(_0x36f095[_0x95a6('0x11')]['code']===0x1f4){logger[_0x95a6('0x11')]('Setting,\x20%s,\x20%s',_0x3feded,_0x36f095[_0x95a6('0x11')]['message']);return _0x45602f(_0x36f095['error'][_0x95a6('0x12')]);}logger[_0x95a6('0x11')]('Setting,\x20%s,\x20%s',_0x3feded,_0x36f095[_0x95a6('0x11')][_0x95a6('0x12')]);return _0x51998e(_0x36f095['error']['message']);}else{logger[_0x95a6('0xd')](_0x95a6('0xe'),_0x3feded,_0x95a6('0xf'));_0x51998e(_0x36f095[_0x95a6('0x13')][_0x95a6('0x12')]);}})['catch'](function(_0x39653d){logger[_0x95a6('0x11')](_0x95a6('0xe'),_0x3feded,_0x39653d);_0x45602f(_0x39653d);});});}exports['ShowSetting']=function(_0x5dec16){var _0x195698=this;return new Promise(function(_0x42a509,_0x223c28){return db['Setting']['find']({'raw':_0x5dec16[_0x95a6('0x14')]?_0x5dec16[_0x95a6('0x14')][_0x95a6('0x15')]===undefined?!![]:![]:!![],'where':_0x5dec16['options']?_0x5dec16[_0x95a6('0x14')]['where']||null:null,'attributes':_0x5dec16['options']?_0x5dec16[_0x95a6('0x14')][_0x95a6('0x16')]||null:null,'include':_0x5dec16[_0x95a6('0x14')]?_0x5dec16[_0x95a6('0x14')][_0x95a6('0x17')]?_[_0x95a6('0x18')](_0x5dec16[_0x95a6('0x14')][_0x95a6('0x17')],function(_0x2dce48){return{'model':db[_0x2dce48[_0x95a6('0x19')]],'as':_0x2dce48['as'],'attributes':_0x2dce48[_0x95a6('0x16')],'include':_0x2dce48[_0x95a6('0x17')]?_[_0x95a6('0x18')](_0x2dce48[_0x95a6('0x17')],function(_0x12db29){return{'model':db[_0x12db29[_0x95a6('0x19')]],'as':_0x12db29['as'],'attributes':_0x12db29[_0x95a6('0x16')],'include':_0x12db29['include']?_[_0x95a6('0x18')](_0x12db29['include'],function(_0x2c3c55){return{'model':db[_0x2c3c55['model']],'as':_0x2c3c55['as'],'attributes':_0x2c3c55['attributes']};}):[]};}):[]};}):[]:[]})[_0x95a6('0xc')](function(_0x276685){logger[_0x95a6('0xd')](_0x95a6('0x1a'),_0x5dec16);logger['debug'](_0x95a6('0x1a'),_0x5dec16,JSON[_0x95a6('0x10')](_0x276685));_0x42a509(_0x276685);})['catch'](function(_0x2c0a0c){logger[_0x95a6('0x11')](_0x95a6('0x1a'),_0x2c0a0c['message'],_0x5dec16);_0x223c28(_0x195698[_0x95a6('0x11')](0x1f4,_0x2c0a0c[_0x95a6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index eba9eb0..5ee2249 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 _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x4d95ae,_0x130ffa){var _0x2e6c2b=function(_0x5371da){while(--_0x5371da){_0x4d95ae['push'](_0x4d95ae['shift']());}};_0x2e6c2b(++_0x130ffa);}(_0x7a54,0x106));var _0x47a5=function(_0x1c3ef5,_0x823556){_0x1c3ef5=_0x1c3ef5-0x0;var _0x1b9329=_0x7a54[_0x1c3ef5];return _0x1b9329;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file +var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x5daa80,_0x4637ce){var _0x30f42f=function(_0x119726){while(--_0x119726){_0x5daa80['push'](_0x5daa80['shift']());}};_0x30f42f(++_0x4637ce);}(_0x7a54,0x106));var _0x47a5=function(_0x2e8f60,_0x56eeb5){_0x2e8f60=_0x2e8f60-0x0;var _0x40d499=_0x7a54[_0x2e8f60];return _0x40d499;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('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 6a3ee52..0f9dc8a 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 _0x068c=['ENUM','skebby','connectel','clicksend','plivo','clickatell','csc','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','STRING','name','generate'];(function(_0x1bf6ca,_0x2a054b){var _0x4c47ff=function(_0x41d24f){while(--_0x41d24f){_0x1bf6ca['push'](_0x1bf6ca['shift']());}};_0x4c47ff(++_0x2a054b);}(_0x068c,0x1d8));var _0xc068=function(_0x249a5f,_0x2538b6){_0x249a5f=_0x249a5f-0x0;var _0xd99b05=_0x068c[_0x249a5f];return _0xd99b05;};'use strict';var Sequelize=require(_0xc068('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xc068('0x1')],'unique':_0xc068('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xc068('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xc068('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0xc068('0x1')],'defaultValue':function(){return rs[_0xc068('0x3')]();}},'phone':{'type':Sequelize[_0xc068('0x1')]},'type':{'type':Sequelize[_0xc068('0x4')]('twilio',_0xc068('0x5'),_0xc068('0x6'),_0xc068('0x7'),_0xc068('0x8'),_0xc068('0x9'),'bandwidth',_0xc068('0xa'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0xc068('0x1')]},'authId':{'type':Sequelize[_0xc068('0x1')]},'authToken':{'type':Sequelize[_0xc068('0x1')]},'smsMethod':{'type':Sequelize[_0xc068('0x4')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc068('0x1')]},'apiKey':{'type':Sequelize[_0xc068('0x1')]},'applicationId':{'type':Sequelize[_0xc068('0x1')]},'accountId':{'type':Sequelize[_0xc068('0x1')]},'senderString':{'type':Sequelize[_0xc068('0x1')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xc068('0x1')]},'notificationTemplate':{'type':Sequelize[_0xc068('0xb')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc068('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc068('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc068('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc068('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc068('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc068('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xc068('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xc068('0xe')},'mandatoryDisposition':{'type':Sequelize[_0xc068('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x478494){if(!_0x478494)this[_0xc068('0xf')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xc068('0x10'),_0x478494);}}}; \ No newline at end of file +var _0xf097=['skebby','connectel','clicksend','clickatell','bandwidth','csc','infobip','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio'];(function(_0x2aecee,_0x11481b){var _0x4e1b01=function(_0x24bbfb){while(--_0x24bbfb){_0x2aecee['push'](_0x2aecee['shift']());}};_0x4e1b01(++_0x11481b);}(_0xf097,0x178));var _0x7f09=function(_0x5c4587,_0x37f2a4){_0x5c4587=_0x5c4587-0x0;var _0x209263=_0xf097[_0x5c4587];return _0x209263;};'use strict';var Sequelize=require(_0x7f09('0x0'));var rs=require(_0x7f09('0x1'));module[_0x7f09('0x2')]={'name':{'type':Sequelize[_0x7f09('0x3')],'unique':_0x7f09('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x7f09('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x7f09('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x7f09('0x3')],'defaultValue':function(){return rs[_0x7f09('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7f09('0x6')](_0x7f09('0x7'),_0x7f09('0x8'),_0x7f09('0x9'),_0x7f09('0xa'),'plivo',_0x7f09('0xb'),_0x7f09('0xc'),_0x7f09('0xd'),_0x7f09('0xe'),'intelepeer')},'accountSid':{'type':Sequelize[_0x7f09('0x3')]},'authId':{'type':Sequelize[_0x7f09('0x3')]},'authToken':{'type':Sequelize[_0x7f09('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x7f09('0x3')]},'password':{'type':Sequelize[_0x7f09('0x3')]},'apiKey':{'type':Sequelize[_0x7f09('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x7f09('0x3')]},'senderString':{'type':Sequelize[_0x7f09('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x7f09('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7f09('0xf')],'defaultValue':function(){return _0x7f09('0x10');}},'notificationSound':{'type':Sequelize[_0x7f09('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7f09('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7f09('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7f09('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7f09('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x7f09('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7f09('0x12')],'comment':_0x7f09('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x7f09('0x11')],'defaultValue':![],'comment':_0x7f09('0x14'),'set':function(_0x2a8f29){if(!_0x2a8f29)this[_0x7f09('0x15')](_0x7f09('0x16'),null);this[_0x7f09('0x15')](_0x7f09('0x17'),_0x2a8f29);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index d5df45d..e0ceb28 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 _0x3db8=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','keys','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','rows','removeAnswers','notify','SmsApplication','Applications','applications','priority','account','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','twilio','messageId','MessageSid','skebby','text','connectel','from','clicksend','message_id','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','bandwidth','intelepeer','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','Contacts','omit','CmContact','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','SmsQueue','queueId','queue','waitForTheAssignedQueue','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','order','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','CmList','List','DESC','ListId','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','inspect','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','sox','ejs','fs-extra','lodash','squel','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','redis','defaults','localhost','socket.io-emitter','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','Pause','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x595f68,_0x3e97ce){var _0x48e2d3=function(_0x1fb95c){while(--_0x1fb95c){_0x595f68['push'](_0x595f68['shift']());}};_0x48e2d3(++_0x3e97ce);}(_0x3db8,0x16d));var _0x83db=function(_0x2bf5d1,_0x14e28f){_0x2bf5d1=_0x2bf5d1-0x0;var _0x3472c6=_0x3db8[_0x2bf5d1];return _0x3472c6;};'use strict';var emlformat=require(_0x83db('0x0'));var rimraf=require(_0x83db('0x1'));var zipdir=require(_0x83db('0x2'));var jsonpatch=require(_0x83db('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x83db('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x83db('0x5'));var csv=require('to-csv');var ejs=require(_0x83db('0x6'));var fs=require('fs');var fs_extra=require(_0x83db('0x7'));var _=require(_0x83db('0x8'));var squel=require(_0x83db('0x9'));var crypto=require('crypto');var jsforce=require(_0x83db('0xa'));var deskjs=require(_0x83db('0xb'));var toCsv=require(_0x83db('0xc'));var querystring=require(_0x83db('0xd'));var Papa=require(_0x83db('0xe'));var Redis=require(_0x83db('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x83db('0x10'));var hardwareService=require(_0x83db('0x11'));var logger=require(_0x83db('0x12'))(_0x83db('0x13'));var utils=require(_0x83db('0x14'));var config=require(_0x83db('0x15'));var licenseUtil=require(_0x83db('0x16'));var db=require(_0x83db('0x17'))['db'];config[_0x83db('0x18')]=_[_0x83db('0x19')](config[_0x83db('0x18')],{'host':_0x83db('0x1a'),'port':0x18eb});var socket=require(_0x83db('0x1b'))(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x83db('0x1c')][_0x83db('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x311175,_0x47f31c,_0x5e3e3d,_0x4a077d){return new BPromise(function(_0x273d9c,_0x2b0ea0){var _0x1919ef=_0x4a077d||client;return _0x1919ef[_0x83db('0x1e')](_0x311175,_0x5e3e3d)[_0x83db('0x1f')](function(_0x547a83){logger[_0x83db('0x20')](_0x83db('0x21'),_0x47f31c,'request\x20sent');logger[_0x83db('0x22')](_0x83db('0x23'),_0x47f31c,'request\x20sent',JSON[_0x83db('0x24')](_0x547a83));if(_0x547a83['error']){if(_0x547a83[_0x83db('0x25')]['code']===0x1f4){logger[_0x83db('0x25')]('SmsAccount,\x20%s,\x20%s',_0x47f31c,_0x547a83[_0x83db('0x25')][_0x83db('0x26')]);return _0x2b0ea0(_0x547a83[_0x83db('0x25')][_0x83db('0x26')]);}logger['error'](_0x83db('0x21'),_0x47f31c,_0x547a83['error'][_0x83db('0x26')]);return _0x273d9c(_0x547a83[_0x83db('0x25')][_0x83db('0x26')]);}else{logger[_0x83db('0x20')](_0x83db('0x21'),_0x47f31c,_0x83db('0x27'));_0x273d9c(_0x547a83['result'][_0x83db('0x26')]);}})[_0x83db('0x28')](function(_0x1ab808){logger[_0x83db('0x25')](_0x83db('0x21'),_0x47f31c,_0x1ab808);_0x2b0ea0(_0x1ab808);});});}function respondWithStatusCode(_0x9d1634,_0x4ef011){_0x4ef011=_0x4ef011||0xcc;return function(_0x20d189){if(_0x20d189){return _0x9d1634[_0x83db('0x29')](_0x4ef011);}return _0x9d1634[_0x83db('0x2a')](_0x4ef011)[_0x83db('0x2b')]();};}function respondWithResult(_0x166666,_0x5e4039){_0x5e4039=_0x5e4039||0xc8;return function(_0x41cc3d){if(_0x41cc3d){return _0x166666[_0x83db('0x2a')](_0x5e4039)[_0x83db('0x2c')](_0x41cc3d);}};}function respondWithFilteredResult(_0x330bcd,_0x1e13e2){return function(_0x3bcd8b){if(_0x3bcd8b){var _0x31cd23=typeof _0x1e13e2[_0x83db('0x2d')]==='undefined'&&typeof _0x1e13e2['limit']===_0x83db('0x2e');var _0x514f44=_0x3bcd8b[_0x83db('0x2f')];var _0x234f5b=_0x31cd23?0x0:_0x1e13e2[_0x83db('0x2d')];var _0x1b8e89=_0x31cd23?_0x3bcd8b[_0x83db('0x2f')]:_0x1e13e2[_0x83db('0x2d')]+_0x1e13e2[_0x83db('0x30')];var _0x3e1818;if(_0x1b8e89>=_0x514f44){_0x1b8e89=_0x514f44;_0x3e1818=0xc8;}else{_0x3e1818=0xce;}_0x330bcd[_0x83db('0x2a')](_0x3e1818);return _0x330bcd[_0x83db('0x31')](_0x83db('0x32'),_0x234f5b+'-'+_0x1b8e89+'/'+_0x514f44)[_0x83db('0x2c')](_0x3bcd8b);}return null;};}function patchUpdates(_0x438532){return function(_0x383ddc){try{jsonpatch[_0x83db('0x33')](_0x383ddc,_0x438532,!![]);}catch(_0x33815c){return BPromise[_0x83db('0x34')](_0x33815c);}return _0x383ddc[_0x83db('0x35')]();};}function saveUpdates(_0x5e65c1,_0x3e7ac1){return function(_0x42490a){if(_0x42490a){return _0x42490a[_0x83db('0x36')](_0x5e65c1)[_0x83db('0x1f')](function(_0x4c67f8){return _0x4c67f8;});}return null;};}function removeEntity(_0x4dece7,_0x1442e0){return function(_0x5dc179){if(_0x5dc179){return _0x5dc179[_0x83db('0x37')]()[_0x83db('0x1f')](function(){var _0x2dc681=_0x5dc179[_0x83db('0x38')]({'plain':!![]});var _0x6f70a5=_0x83db('0x39');return db[_0x83db('0x3a')]['destroy']({'where':{'type':_0x6f70a5,'resourceId':_0x2dc681['id']}})[_0x83db('0x1f')](function(){return _0x5dc179;});})[_0x83db('0x1f')](function(){_0x4dece7[_0x83db('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dd8a2,_0x2f7083){return function(_0x1252b2){if(!_0x1252b2){_0x5dd8a2['sendStatus'](0x194);}return _0x1252b2;};}function handleError(_0x2af338,_0x1fd092){_0x1fd092=_0x1fd092||0x1f4;return function(_0x598dba){logger[_0x83db('0x25')](_0x598dba[_0x83db('0x3b')]);if(_0x598dba[_0x83db('0x3c')]){delete _0x598dba[_0x83db('0x3c')];}_0x2af338['status'](_0x1fd092)[_0x83db('0x3d')](_0x598dba);};}exports['index']=function(_0x4b4874,_0x381b53){var _0x514feb={'include':[{'model':db['Pause'],'as':_0x83db('0x3e')}]},_0x40b1c0={},_0x6b88ef={'count':0x0,'rows':[]};var _0x4b0527=_[_0x83db('0x3f')](db[_0x83db('0x40')][_0x83db('0x41')],function(_0x2bea38){return{'name':_0x2bea38[_0x83db('0x42')],'type':_0x2bea38[_0x83db('0x43')][_0x83db('0x44')]};});_0x40b1c0[_0x83db('0x45')]=_[_0x83db('0x3f')](_0x4b0527,_0x83db('0x3c'));_0x40b1c0[_0x83db('0x46')]=_['keys'](_0x4b4874[_0x83db('0x46')]);_0x40b1c0['filters']=_[_0x83db('0x47')](_0x40b1c0[_0x83db('0x45')],_0x40b1c0[_0x83db('0x46')]);_0x514feb[_0x83db('0x48')]=_[_0x83db('0x47')](_0x40b1c0['model'],qs[_0x83db('0x49')](_0x4b4874['query']['fields']));_0x514feb[_0x83db('0x48')]=_0x514feb['attributes'][_0x83db('0x4a')]?_0x514feb[_0x83db('0x48')]:_0x40b1c0[_0x83db('0x45')];if(!_0x4b4874[_0x83db('0x46')]['hasOwnProperty']('nolimit')){_0x514feb[_0x83db('0x30')]=qs[_0x83db('0x30')](_0x4b4874['query']['limit']);_0x514feb[_0x83db('0x2d')]=qs['offset'](_0x4b4874[_0x83db('0x46')][_0x83db('0x2d')]);}_0x514feb['order']=qs[_0x83db('0x4b')](_0x4b4874[_0x83db('0x46')]['sort']);_0x514feb[_0x83db('0x4c')]=qs[_0x83db('0x4d')](_[_0x83db('0x4e')](_0x4b4874[_0x83db('0x46')],_0x40b1c0[_0x83db('0x4d')]),_0x4b0527);if(_0x4b4874['query'][_0x83db('0x4f')]){_0x514feb[_0x83db('0x4c')]=_[_0x83db('0x50')](_0x514feb['where'],{'$or':_[_0x83db('0x3f')](_0x4b0527,function(_0x33f9ce){if(_0x33f9ce['type']!==_0x83db('0x51')){var _0x2532f7={};_0x2532f7[_0x33f9ce[_0x83db('0x3c')]]={'$like':'%'+_0x4b4874['query'][_0x83db('0x4f')]+'%'};return _0x2532f7;}})});}_0x514feb=_[_0x83db('0x50')]({},_0x514feb,_0x4b4874[_0x83db('0x52')]);var _0x38a843={'where':_0x514feb[_0x83db('0x4c')]};return db[_0x83db('0x40')][_0x83db('0x2f')](_0x38a843)[_0x83db('0x1f')](function(_0x5387ef){_0x6b88ef[_0x83db('0x2f')]=_0x5387ef;if(_0x4b4874[_0x83db('0x46')][_0x83db('0x53')]){_0x514feb['include']=[{'all':!![]}];}return db[_0x83db('0x40')][_0x83db('0x54')](_0x514feb);})[_0x83db('0x1f')](function(_0x4bd8fc){_0x6b88ef['rows']=_0x4bd8fc;return _0x6b88ef;})[_0x83db('0x1f')](respondWithFilteredResult(_0x381b53,_0x514feb))['catch'](handleError(_0x381b53,null));};exports['show']=function(_0x4ac095,_0x21e6b3){var _0x28e0b6={'raw':![],'where':{'id':_0x4ac095['params']['id']},'include':[{'model':db[_0x83db('0x55')],'as':_0x83db('0x3e')}]},_0x201199={};_0x201199['model']=_['keys'](db['SmsAccount']['rawAttributes']);_0x201199['query']=_['keys'](_0x4ac095[_0x83db('0x46')]);_0x201199[_0x83db('0x4d')]=_[_0x83db('0x47')](_0x201199[_0x83db('0x45')],_0x201199[_0x83db('0x46')]);_0x28e0b6['attributes']=_[_0x83db('0x47')](_0x201199[_0x83db('0x45')],qs[_0x83db('0x49')](_0x4ac095[_0x83db('0x46')]['fields']));_0x28e0b6[_0x83db('0x48')]=_0x28e0b6[_0x83db('0x48')][_0x83db('0x4a')]?_0x28e0b6[_0x83db('0x48')]:_0x201199[_0x83db('0x45')];if(_0x4ac095['query']['includeAll']){_0x28e0b6[_0x83db('0x56')]=[{'all':!![]}];}_0x28e0b6=_[_0x83db('0x50')]({},_0x28e0b6,_0x4ac095[_0x83db('0x52')]);return db[_0x83db('0x40')][_0x83db('0x57')](_0x28e0b6)[_0x83db('0x1f')](handleEntityNotFound(_0x21e6b3,null))[_0x83db('0x1f')](respondWithResult(_0x21e6b3,null))['catch'](handleError(_0x21e6b3,null));};exports[_0x83db('0x58')]=function(_0xec35c0,_0x1f2132){return db[_0x83db('0x40')][_0x83db('0x58')](_0xec35c0[_0x83db('0x59')],{})[_0x83db('0x1f')](function(_0x5db147){var _0x1db0c3=_0xec35c0[_0x83db('0x5a')][_0x83db('0x38')]({'plain':!![]});if(!_0x1db0c3)throw new Error(_0x83db('0x5b'));if(_0x1db0c3[_0x83db('0x5c')]===_0x83db('0x5a')){var _0x15f867=_0x5db147[_0x83db('0x38')]({'plain':!![]});var _0x5b826b=_0x83db('0x39');return db[_0x83db('0x5d')][_0x83db('0x57')]({'where':{'name':_0x5b826b,'userProfileId':_0x1db0c3[_0x83db('0x5e')]},'raw':!![]})[_0x83db('0x1f')](function(_0x3e14d8){if(_0x3e14d8&&_0x3e14d8[_0x83db('0x5f')]===0x0){return db[_0x83db('0x3a')]['create']({'name':_0x15f867['name'],'resourceId':_0x15f867['id'],'type':_0x3e14d8[_0x83db('0x3c')],'sectionId':_0x3e14d8['id']},{})[_0x83db('0x1f')](function(){return _0x5db147;});}else{return _0x5db147;}})['catch'](function(_0x3520c0){logger[_0x83db('0x25')](_0x83db('0x60'),_0x3520c0);throw _0x3520c0;});}return _0x5db147;})['then'](respondWithResult(_0x1f2132,0xc9))[_0x83db('0x28')](handleError(_0x1f2132,null));};exports[_0x83db('0x36')]=function(_0x350ae4,_0x37d239){if(_0x350ae4[_0x83db('0x59')]['id']){delete _0x350ae4[_0x83db('0x59')]['id'];}return db[_0x83db('0x40')][_0x83db('0x57')]({'where':{'id':_0x350ae4[_0x83db('0x61')]['id']},'include':[{'model':db[_0x83db('0x55')],'as':'mandatoryDispositionPause'}]})[_0x83db('0x1f')](handleEntityNotFound(_0x37d239,null))[_0x83db('0x1f')](saveUpdates(_0x350ae4['body'],null))[_0x83db('0x1f')](respondWithResult(_0x37d239,null))['catch'](handleError(_0x37d239,null));};exports[_0x83db('0x37')]=function(_0x725fd0,_0x17493e){return db[_0x83db('0x40')][_0x83db('0x57')]({'where':{'id':_0x725fd0[_0x83db('0x61')]['id']}})[_0x83db('0x1f')](handleEntityNotFound(_0x17493e,null))[_0x83db('0x1f')](removeEntity(_0x17493e,null))[_0x83db('0x28')](handleError(_0x17493e,null));};exports[_0x83db('0x62')]=function(_0x41603,_0x1b1286){return db['SmsAccount'][_0x83db('0x62')]()[_0x83db('0x1f')](respondWithResult(_0x1b1286,null))[_0x83db('0x28')](handleError(_0x1b1286,null));};exports[_0x83db('0x63')]=function(_0x2ccf4e,_0x5afd16,_0x84d45c){if(_0x2ccf4e[_0x83db('0x59')]['id']){delete _0x2ccf4e['body']['id'];}return db['SmsAccount'][_0x83db('0x57')]({'where':{'id':_0x2ccf4e[_0x83db('0x61')]['id']}})[_0x83db('0x1f')](handleEntityNotFound(_0x5afd16,null))['then'](function(_0x5d7464){if(_0x5d7464){_0x2ccf4e[_0x83db('0x59')][_0x83db('0x64')]=_0x5d7464['id'];return db[_0x83db('0x65')][_0x83db('0x58')](_0x2ccf4e[_0x83db('0x59')]);}})[_0x83db('0x1f')](respondWithResult(_0x5afd16,null))['catch'](handleError(_0x5afd16,null));};exports[_0x83db('0x66')]=function(_0x56d218,_0x26165e,_0x3a6146){var _0x142d3b={'raw':![],'where':{}};var _0x57300d={};var _0x49b341={'count':0x0,'rows':[]};return db['SmsAccount'][_0x83db('0x67')]({'where':{'id':_0x56d218['params']['id']}})[_0x83db('0x1f')](handleEntityNotFound(_0x26165e,null))['then'](function(_0x52025e){if(_0x52025e){_0x57300d[_0x83db('0x45')]=_[_0x83db('0x68')](db['Disposition'][_0x83db('0x41')]);_0x57300d['query']=_[_0x83db('0x68')](_0x56d218[_0x83db('0x46')]);_0x57300d['filters']=_[_0x83db('0x47')](_0x57300d[_0x83db('0x45')],_0x57300d[_0x83db('0x46')]);_0x142d3b[_0x83db('0x48')]=_[_0x83db('0x47')](_0x57300d[_0x83db('0x45')],qs[_0x83db('0x49')](_0x56d218[_0x83db('0x46')][_0x83db('0x49')]));_0x142d3b['attributes']=_0x142d3b[_0x83db('0x48')]['length']?_0x142d3b[_0x83db('0x48')]:_0x57300d[_0x83db('0x45')];if(!_0x56d218[_0x83db('0x46')]['hasOwnProperty'](_0x83db('0x69'))){_0x142d3b[_0x83db('0x30')]=qs['limit'](_0x56d218['query'][_0x83db('0x30')]);_0x142d3b[_0x83db('0x2d')]=qs[_0x83db('0x2d')](_0x56d218[_0x83db('0x46')][_0x83db('0x2d')]);}_0x142d3b['order']=qs[_0x83db('0x4b')](_0x56d218[_0x83db('0x46')]['sort']);_0x142d3b['where']=qs[_0x83db('0x4d')](_[_0x83db('0x4e')](_0x56d218['query'],_0x57300d['filters']));_0x142d3b[_0x83db('0x4c')][_0x83db('0x64')]=_0x52025e['id'];if(_0x56d218['query']['filter']){_0x142d3b['where']=_['merge'](_0x142d3b[_0x83db('0x4c')],{'$or':_[_0x83db('0x3f')](_0x142d3b[_0x83db('0x48')],function(_0x5184ad){var _0xf3c041={};_0xf3c041[_0x5184ad]={'$like':'%'+_0x56d218['query'][_0x83db('0x4f')]+'%'};return _0xf3c041;})});}_0x142d3b=_[_0x83db('0x50')]({},_0x142d3b,_0x56d218[_0x83db('0x52')]);return db[_0x83db('0x65')][_0x83db('0x2f')]({'where':_0x142d3b[_0x83db('0x4c')]})['then'](function(_0x120c63){_0x49b341[_0x83db('0x2f')]=_0x120c63;if(_0x56d218[_0x83db('0x46')][_0x83db('0x53')]){_0x142d3b['include']=[{'all':!![]}];}return db[_0x83db('0x65')][_0x83db('0x54')](_0x142d3b);})['then'](function(_0x49b589){_0x49b341['rows']=_0x49b589;return _0x49b341;});}})['then'](respondWithFilteredResult(_0x26165e,_0x142d3b))[_0x83db('0x28')](handleError(_0x26165e,null));};exports[_0x83db('0x6a')]=function(_0x5d4092,_0x42f16c,_0x4e0a45){return db[_0x83db('0x40')]['find']({'where':{'id':_0x5d4092[_0x83db('0x61')]['id']}})[_0x83db('0x1f')](handleEntityNotFound(_0x42f16c,null))[_0x83db('0x1f')](function(_0x38e8bc){if(_0x38e8bc){return _0x38e8bc[_0x83db('0x6a')](_0x5d4092[_0x83db('0x46')][_0x83db('0x6b')]);}})[_0x83db('0x1f')](respondWithStatusCode(_0x42f16c,null))[_0x83db('0x28')](handleError(_0x42f16c,null));};exports[_0x83db('0x6c')]=function(_0x59cfc6,_0x1d2a72,_0x3fded8){if(_0x59cfc6[_0x83db('0x59')]['id']){delete _0x59cfc6['body']['id'];}return db[_0x83db('0x40')][_0x83db('0x57')]({'where':{'id':_0x59cfc6[_0x83db('0x61')]['id']}})[_0x83db('0x1f')](handleEntityNotFound(_0x1d2a72,null))[_0x83db('0x1f')](function(_0x52885c){if(_0x52885c){_0x59cfc6[_0x83db('0x59')]['SmsAccountId']=_0x52885c['id'];return db[_0x83db('0x6d')][_0x83db('0x58')](_0x59cfc6[_0x83db('0x59')]);}})[_0x83db('0x1f')](respondWithResult(_0x1d2a72,null))[_0x83db('0x28')](handleError(_0x1d2a72,null));};exports[_0x83db('0x6e')]=function(_0x336067,_0x1de724,_0xfe4a68){var _0x4b3aa5={'raw':![],'where':{}};var _0x2b9fc5={};var _0x2d91e0={'count':0x0,'rows':[]};return db[_0x83db('0x40')][_0x83db('0x67')]({'where':{'id':_0x336067['params']['id']}})['then'](handleEntityNotFound(_0x1de724,null))[_0x83db('0x1f')](function(_0x4aebfc){if(_0x4aebfc){_0x2b9fc5['model']=_['keys'](db[_0x83db('0x6d')][_0x83db('0x41')]);_0x2b9fc5['query']=_['keys'](_0x336067[_0x83db('0x46')]);_0x2b9fc5[_0x83db('0x4d')]=_['intersection'](_0x2b9fc5['model'],_0x2b9fc5[_0x83db('0x46')]);_0x4b3aa5[_0x83db('0x48')]=_[_0x83db('0x47')](_0x2b9fc5[_0x83db('0x45')],qs[_0x83db('0x49')](_0x336067[_0x83db('0x46')]['fields']));_0x4b3aa5[_0x83db('0x48')]=_0x4b3aa5[_0x83db('0x48')][_0x83db('0x4a')]?_0x4b3aa5[_0x83db('0x48')]:_0x2b9fc5['model'];if(!_0x336067[_0x83db('0x46')][_0x83db('0x6f')](_0x83db('0x69'))){_0x4b3aa5[_0x83db('0x30')]=qs['limit'](_0x336067[_0x83db('0x46')][_0x83db('0x30')]);_0x4b3aa5[_0x83db('0x2d')]=qs[_0x83db('0x2d')](_0x336067['query'][_0x83db('0x2d')]);}_0x4b3aa5['order']=qs[_0x83db('0x4b')](_0x336067[_0x83db('0x46')][_0x83db('0x4b')]);_0x4b3aa5[_0x83db('0x4c')]=qs[_0x83db('0x4d')](_[_0x83db('0x4e')](_0x336067[_0x83db('0x46')],_0x2b9fc5['filters']));_0x4b3aa5[_0x83db('0x4c')][_0x83db('0x64')]=_0x4aebfc['id'];if(_0x336067['query'][_0x83db('0x4f')]){_0x4b3aa5['where']=_[_0x83db('0x50')](_0x4b3aa5[_0x83db('0x4c')],{'$or':_[_0x83db('0x3f')](_0x4b3aa5[_0x83db('0x48')],function(_0x57d6b7){var _0x398827={};_0x398827[_0x57d6b7]={'$like':'%'+_0x336067[_0x83db('0x46')]['filter']+'%'};return _0x398827;})});}_0x4b3aa5=_['merge']({},_0x4b3aa5,_0x336067['options']);return db[_0x83db('0x6d')]['count']({'where':_0x4b3aa5[_0x83db('0x4c')]})[_0x83db('0x1f')](function(_0x26fb5e){_0x2d91e0[_0x83db('0x2f')]=_0x26fb5e;if(_0x336067[_0x83db('0x46')][_0x83db('0x53')]){_0x4b3aa5[_0x83db('0x56')]=[{'all':!![]}];}return db[_0x83db('0x6d')]['findAll'](_0x4b3aa5);})[_0x83db('0x1f')](function(_0x43507b){_0x2d91e0[_0x83db('0x70')]=_0x43507b;return _0x2d91e0;});}})[_0x83db('0x1f')](respondWithFilteredResult(_0x1de724,_0x4b3aa5))['catch'](handleError(_0x1de724,null));};exports[_0x83db('0x71')]=function(_0x503647,_0x2032d4,_0x48e924){return db['SmsAccount'][_0x83db('0x57')]({'where':{'id':_0x503647[_0x83db('0x61')]['id']}})[_0x83db('0x1f')](handleEntityNotFound(_0x2032d4,null))[_0x83db('0x1f')](function(_0x207318){if(_0x207318){return _0x207318[_0x83db('0x71')](_0x503647['query'][_0x83db('0x6b')]);}})[_0x83db('0x1f')](respondWithStatusCode(_0x2032d4,null))[_0x83db('0x28')](handleError(_0x2032d4,null));};exports[_0x83db('0x72')]=function(_0x5a7c6f,_0xbb8ecf,_0x23ef35){var _0x297251={'channel':'sms'};var _0x372855=[];var _0x2f8fa5=[];var _0x175d6c={};return db['SmsAccount'][_0x83db('0x57')]({'where':{'id':_0x5a7c6f[_0x83db('0x61')]['id']},'include':[{'model':db[_0x83db('0x73')],'as':_0x83db('0x74')}]})['then'](handleEntityNotFound(_0xbb8ecf,null))[_0x83db('0x1f')](function(_0x559a4b){_0x297251['account']=_0x559a4b;_0x297251[_0x83db('0x75')]=_['orderBy'](_0x559a4b[_0x83db('0x74')],[_0x83db('0x76')],['asc']);if(_0x297251[_0x83db('0x77')][_0x83db('0x74')]){delete _0x297251[_0x83db('0x77')][_0x83db('0x74')];}return db['CmContact'][_0x83db('0x62')]();})[_0x83db('0x1f')](function(_0x468125){if(!_0x468125){throw new db[(_0x83db('0x78'))][(_0x83db('0x79'))](_0x83db('0x7a'));}_0x372855=_[_0x83db('0x7b')](_[_0x83db('0x68')](_0x468125),[_0x83db('0x7c'),_0x83db('0x7d')]);_0x2f8fa5=_[_0x83db('0x7b')](_[_0x83db('0x68')](_0x468125),[_0x83db('0x7c'),_0x83db('0x7d'),_0x83db('0x7e'),'ListId']);_0x297251[_0x83db('0x59')]={'mapKey':'mobile'};if(_0x297251[_0x83db('0x77')][_0x83db('0x43')]){switch(_0x297251[_0x83db('0x77')][_0x83db('0x43')]){case _0x83db('0x7f'):_0x297251[_0x83db('0x59')]['from']=_0x5a7c6f[_0x83db('0x59')]['From'];_0x297251[_0x83db('0x59')][_0x83db('0x59')]=_0x5a7c6f['body']['Body'];_0x297251['body'][_0x83db('0x80')]=_0x5a7c6f[_0x83db('0x59')][_0x83db('0x81')];break;case _0x83db('0x82'):_0x297251[_0x83db('0x59')]['from']='+'+_0x5a7c6f['body']['sender'];_0x297251[_0x83db('0x59')][_0x83db('0x59')]=_0x5a7c6f[_0x83db('0x59')][_0x83db('0x83')];break;case _0x83db('0x84'):_0x297251[_0x83db('0x59')][_0x83db('0x85')]=_0x5a7c6f[_0x83db('0x59')]['from'];_0x297251['body'][_0x83db('0x59')]=_0x5a7c6f[_0x83db('0x59')]['message'];break;case _0x83db('0x86'):_0x297251[_0x83db('0x59')]['from']=_0x5a7c6f[_0x83db('0x59')][_0x83db('0x85')];_0x297251[_0x83db('0x59')][_0x83db('0x59')]=_0x5a7c6f['body']['body'];_0x297251[_0x83db('0x59')][_0x83db('0x80')]=_0x5a7c6f[_0x83db('0x59')][_0x83db('0x87')];break;case'plivo':_0x297251[_0x83db('0x59')][_0x83db('0x85')]=_0x5a7c6f[_0x83db('0x59')]['From'];_0x297251['body'][_0x83db('0x59')]=_0x5a7c6f[_0x83db('0x59')]['Text'];_0x297251[_0x83db('0x59')]['messageId']=_0x5a7c6f[_0x83db('0x59')][_0x83db('0x88')];break;case _0x83db('0x89'):_0x297251[_0x83db('0x59')][_0x83db('0x85')]='+'+_0x5a7c6f[_0x83db('0x59')]['results'][0x0][_0x83db('0x85')];_0x297251[_0x83db('0x59')]['body']=_0x5a7c6f[_0x83db('0x59')][_0x83db('0x8a')][0x0]['text'];_0x297251[_0x83db('0x59')][_0x83db('0x80')]=_0x5a7c6f[_0x83db('0x59')][_0x83db('0x8a')][0x0][_0x83db('0x80')];break;case _0x83db('0x8b'):_0x297251[_0x83db('0x59')][_0x83db('0x85')]=_0x5a7c6f['body'][_0x83db('0x8c')];_0x297251[_0x83db('0x59')][_0x83db('0x59')]=_0x5a7c6f[_0x83db('0x59')][_0x83db('0x8d')][_0x83db('0x26')];break;case _0x83db('0x8e'):_0x297251[_0x83db('0x59')][_0x83db('0x85')]=_0x5a7c6f[_0x83db('0x59')][_0x83db('0x8f')];_0x297251[_0x83db('0x59')][_0x83db('0x59')]=_0x5a7c6f[_0x83db('0x59')][_0x83db('0x83')];_0x297251['body'][_0x83db('0x80')]=_0x5a7c6f[_0x83db('0x59')]['replyMessageId'];break;case _0x83db('0x90'):_0x297251[_0x83db('0x59')][_0x83db('0x80')]=_0x5a7c6f[_0x83db('0x59')][0x0]['message']['id'];_0x297251[_0x83db('0x59')]['from']=_0x5a7c6f[_0x83db('0x59')][0x0][_0x83db('0x26')][_0x83db('0x85')];_0x297251[_0x83db('0x59')][_0x83db('0x59')]=_0x5a7c6f['body'][0x0][_0x83db('0x26')][_0x83db('0x83')];break;case _0x83db('0x91'):_0x297251[_0x83db('0x59')]['from']=_0x5a7c6f['body'][_0x83db('0x85')];_0x297251[_0x83db('0x59')][_0x83db('0x59')]=_0x5a7c6f[_0x83db('0x59')][_0x83db('0x26')];_0x297251[_0x83db('0x59')][_0x83db('0x80')]=_0x5a7c6f['body']['refid'];break;}}if(_0x297251[_0x83db('0x59')]['id']){delete _0x297251[_0x83db('0x59')]['id'];}if(_[_0x83db('0x92')](_0x297251[_0x83db('0x59')][_0x83db('0x85')])){throw new db[(_0x83db('0x78'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x83db('0x92')](_0x297251[_0x83db('0x59')]['body'])||_0x297251['body'][_0x83db('0x59')]===''){throw new db[(_0x83db('0x78'))][(_0x83db('0x79'))](_0x83db('0x93'));}if(_[_0x83db('0x92')](_0x297251[_0x83db('0x59')][_0x83db('0x94')])){throw new db[(_0x83db('0x78'))][(_0x83db('0x79'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2f8fa5);}if(!_[_0x83db('0x95')](_0x2f8fa5,_0x297251[_0x83db('0x59')][_0x83db('0x94')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2f8fa5);}_0x175d6c[_0x297251[_0x83db('0x59')][_0x83db('0x94')]]=_0x297251[_0x83db('0x59')][_0x83db('0x85')];return db['CmList'][_0x83db('0x57')]({'where':{'id':_0x297251[_0x83db('0x77')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x83db('0x96'),'where':_0x175d6c,'limit':0x1,'order':[[_0x83db('0x7d'),'DESC']]}]});})[_0x83db('0x1f')](handleEntityNotFound(_0xbb8ecf,null))['then'](function(_0x5c050e){if(_0x5c050e){_0x297251['list']=_[_0x83db('0x97')](_0x5c050e,[_0x83db('0x96')]);if(_0x5c050e['Contacts']['length']){return _0x5c050e[_0x83db('0x96')][0x0];}var _0x1c86d4=_[_0x83db('0x19')](_0x297251[_0x83db('0x59')],{'firstName':_0x297251[_0x83db('0x59')][_0x83db('0x85')],'ListId':_0x5c050e['id']});_0x1c86d4[_0x297251[_0x83db('0x59')][_0x83db('0x94')]]=_0x297251[_0x83db('0x59')]['from'];return db[_0x83db('0x98')][_0x83db('0x58')](_0x1c86d4,{'fields':_0x372855,'raw':!![]});}})[_0x83db('0x1f')](handleEntityNotFound(_0xbb8ecf,null))[_0x83db('0x1f')](function(_0x1afdf0){if(_0x1afdf0){_0x297251[_0x83db('0x99')]=_0x1afdf0;var _0x4fb470={'ContactId':_0x1afdf0['id'],'phone':_0x297251[_0x83db('0x59')][_0x83db('0x85')],'SmsAccountId':_0x5a7c6f[_0x83db('0x61')]['id']};var _0x24302e={'ContactId':_0x1afdf0['id'],'SmsAccountId':_0x5a7c6f['params']['id'],'closed':![]};return db[_0x83db('0x9a')][_0x83db('0x57')]({'where':_0x24302e})[_0x83db('0x1f')](function(_0x49aea8){if(_0x49aea8){return[_0x49aea8,![]];}return db[_0x83db('0x9a')][_0x83db('0x58')](_0x4fb470)[_0x83db('0x1f')](function(_0x3bf4bd){return[_0x3bf4bd,!![]];});});}})[_0x83db('0x9b')](function(_0x6a47e6,_0x54ed25){_0x297251[_0x83db('0x9c')]=_0x6a47e6[_0x83db('0x38')]({'plain':!![]});_0x297251[_0x83db('0x9c')][_0x83db('0x9d')]=![];if(_0x54ed25){if(_0x297251[_0x83db('0x77')][_0x83db('0x9e')]){_0x297251[_0x83db('0x75')][_0x83db('0x9f')]({'id':0x0,'priority':_0x297251[_0x83db('0x75')][_0x83db('0x4a')]+0x1,'app':_0x83db('0xa0'),'appdata':_0x83db('0xa1'),'interval':'*,*,*,*'});}_0x297251[_0x83db('0x9c')][_0x83db('0x9d')]=!![];}return db[_0x83db('0xa2')]['create']({'phone':_0x297251[_0x83db('0x59')][_0x83db('0x85')],'messageId':_0x297251['body']['messageId'],'body':_0x297251['body'][_0x83db('0x59')],'SmsAccountId':_0x5a7c6f[_0x83db('0x61')]['id'],'SmsInteractionId':_0x6a47e6['id'],'direction':'in','ContactId':_0x6a47e6[_0x83db('0xa3')],'AttachmentId':_0x297251['body'][_0x83db('0xa4')]});})[_0x83db('0x1f')](function(_0x28d8fb){_0x297251['message']=_0x28d8fb;if(!_0x297251[_0x83db('0x9c')][_0x83db('0xa5')])return;return db[_0x83db('0xa6')][_0x83db('0x57')]({'attributes':['id','name'],'where':{'id':_0x297251[_0x83db('0x9c')][_0x83db('0xa5')]}});})[_0x83db('0x1f')](function(_0x2030f8){if(_0x2030f8){_0x297251[_0x83db('0x75')][_0x83db('0xa7')]({'id':0x0,'priority':0x0,'app':_0x83db('0xa8'),'appdata':_0x2030f8[_0x83db('0x3c')]+','+(_0x297251[_0x83db('0x77')][_0x83db('0xa9')]||0xa),'interval':'*,*,*,*'});}if(!_0x297251['interaction']['queueId'])return;return db[_0x83db('0xaa')]['find']({'attributes':['id','name'],'where':{'id':_0x297251[_0x83db('0x9c')][_0x83db('0xab')]}});})[_0x83db('0x1f')](function(_0x4aff92){if(_0x4aff92){_0x297251[_0x83db('0x75')][_0x83db('0xa7')]({'id':0x0,'priority':0x1,'app':_0x83db('0xac'),'appdata':_0x4aff92[_0x83db('0x3c')]+','+(_0x297251[_0x83db('0x77')][_0x83db('0xad')]||0x12c),'interval':_0x83db('0xae')});}return respondWithRpcPromise(_0x83db('0xaf'),_0x83db('0xb0'),_0x297251);})['then'](function(_0x42b034){if(_0x42b034){var _0x5a5621=0xc8;var _0x58d9fa=_0x83db('0xb1');logger[_0x83db('0x20')](_0x83db('0x23'),_0x58d9fa,_0x5a5621,_0x83db('0xb2'));logger[_0x83db('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x58d9fa,_0x5a5621,_0x83db('0xb2'),JSON['stringify'](_0x42b034));if(_0x297251[_0x83db('0x77')][_0x83db('0x43')]==='twilio'){return _0xbb8ecf[_0x83db('0x2a')](_0x5a5621)[_0x83db('0x31')](_0x83db('0xb3'),_0x83db('0xb4'))[_0x83db('0x3d')](_0x83db('0xb5'));}else{return _0xbb8ecf[_0x83db('0x2a')](_0x5a5621)['json'](_0x42b034);}}})['catch'](handleError(_0xbb8ecf,null));};exports[_0x83db('0xb6')]=function(_0x58223,_0x46df8c){var _0x364006=_0x58223[_0x83db('0x61')]['id'];var _0x13e4b9=_0x58223[_0x83db('0x59')];var _0x423035=0xc8;var _0x25dda8=null;return db[_0x83db('0xb7')][_0x83db('0xb8')]({'isolationLevel':db[_0x83db('0xb7')][_0x83db('0xb9')][_0x83db('0xba')]['READ_COMMITTED']},function(_0x33c903){return db[_0x83db('0x40')][_0x83db('0x67')]({'where':{'id':_0x364006},'transaction':_0x33c903})[_0x83db('0x1f')](function(_0x5abac4){if(_0x5abac4){return db[_0x83db('0x73')][_0x83db('0x37')]({'where':{'SmsAccountId':_0x364006},'transaction':_0x33c903})[_0x83db('0x1f')](function(){var _0x26c1fb=_['map'](_0x13e4b9,function(_0x29784b){_0x29784b[_0x83db('0x64')]=_0x364006;return _0x29784b;});return db[_0x83db('0x73')][_0x83db('0xbb')](_0x26c1fb,{'transaction':_0x33c903});});}else{_0x423035=0x194;_0x25dda8=[];}});})['then'](function(){if(_0x423035!==0x194){return db[_0x83db('0x73')][_0x83db('0xbc')]({'where':{'SmsAccountId':_0x364006},'order':_0x83db('0x76')})[_0x83db('0x1f')](function(_0x52a811){_0x25dda8=_0x52a811;});}})[_0x83db('0x28')](function(_0x19109c){_0x423035=0x1f4;logger[_0x83db('0x25')](_0x19109c['stack']);if(_0x19109c[_0x83db('0x3c')]){delete _0x19109c['name'];}_0x25dda8=_0x19109c;})[_0x83db('0xbd')](function(){if(_0x25dda8===null){_0x46df8c['sendStatus'](_0x423035);}else{if(_0x423035===0x1f4){_0x46df8c[_0x83db('0x2a')](_0x423035)[_0x83db('0x3d')](_0x25dda8);}else{_0x46df8c[_0x83db('0x2a')](_0x423035)[_0x83db('0x2c')](_0x25dda8);}}});};exports[_0x83db('0xbe')]=function(_0x216fb0,_0x1d5ce5,_0x8a98a5){var _0x19d526={};var _0x188fee={};var _0x389a99;var _0x3cd8f1;return db[_0x83db('0x40')]['findOne']({'where':{'id':_0x216fb0[_0x83db('0x61')]['id']}})[_0x83db('0x1f')](handleEntityNotFound(_0x1d5ce5,null))[_0x83db('0x1f')](function(_0x2f3ab1){if(_0x2f3ab1){_0x389a99=_0x2f3ab1;_0x188fee['model']=_[_0x83db('0x68')](db[_0x83db('0x73')][_0x83db('0x41')]);_0x188fee[_0x83db('0x46')]=_['keys'](_0x216fb0[_0x83db('0x46')]);_0x188fee[_0x83db('0x4d')]=_[_0x83db('0x47')](_0x188fee['model'],_0x188fee[_0x83db('0x46')]);_0x19d526[_0x83db('0x48')]=_[_0x83db('0x47')](_0x188fee['model'],qs[_0x83db('0x49')](_0x216fb0['query']['fields']));_0x19d526[_0x83db('0x48')]=_0x19d526[_0x83db('0x48')][_0x83db('0x4a')]?_0x19d526['attributes']:_0x188fee['model'];_0x19d526[_0x83db('0xbf')]=qs[_0x83db('0x4b')](_0x216fb0['query'][_0x83db('0x4b')]);_0x19d526[_0x83db('0x4c')]=qs['filters'](_[_0x83db('0x4e')](_0x216fb0[_0x83db('0x46')],_0x188fee[_0x83db('0x4d')]));if(_0x216fb0[_0x83db('0x46')][_0x83db('0x4f')]){_0x19d526[_0x83db('0x4c')]=_['merge'](_0x19d526['where'],{'$or':_[_0x83db('0x3f')](_0x19d526[_0x83db('0x48')],function(_0x16a28c){var _0x4e89ab={};_0x4e89ab[_0x16a28c]={'$like':'%'+_0x216fb0[_0x83db('0x46')]['filter']+'%'};return _0x4e89ab;})});}_0x19d526=_[_0x83db('0x50')]({},_0x19d526,_0x216fb0[_0x83db('0x52')]);return _0x389a99['getApplications'](_0x19d526);}})[_0x83db('0x1f')](function(_0x5b665a){if(_0x5b665a){_0x3cd8f1=_0x5b665a[_0x83db('0x4a')];if(!_0x216fb0[_0x83db('0x46')][_0x83db('0x6f')]('nolimit')){_0x19d526['limit']=qs[_0x83db('0x30')](_0x216fb0[_0x83db('0x46')][_0x83db('0x30')]);_0x19d526['offset']=qs['offset'](_0x216fb0['query'][_0x83db('0x2d')]);}return _0x389a99[_0x83db('0xbe')](_0x19d526);}})[_0x83db('0x1f')](function(_0x586c37){if(_0x586c37){return _0x586c37?{'count':_0x3cd8f1,'rows':_0x586c37}:null;}})[_0x83db('0x1f')](respondWithResult(_0x1d5ce5,null))['catch'](handleError(_0x1d5ce5,null));};exports[_0x83db('0xc0')]=function(_0x28bde4,_0x58c4ac,_0x512368){var _0x52e8b3={'raw':![],'where':{}};var _0xaf0d1c={};var _0x3958db={'count':0x0,'rows':[]};return db[_0x83db('0x40')][_0x83db('0x67')]({'where':{'id':_0x28bde4[_0x83db('0x61')]['id']}})[_0x83db('0x1f')](handleEntityNotFound(_0x58c4ac,null))['then'](function(_0x76a652){if(_0x76a652){_0xaf0d1c[_0x83db('0x45')]=_['keys'](db[_0x83db('0x9a')][_0x83db('0x41')]);_0xaf0d1c['query']=_[_0x83db('0x68')](_0x28bde4['query']);_0xaf0d1c[_0x83db('0x4d')]=_[_0x83db('0x47')](_0xaf0d1c[_0x83db('0x45')],_0xaf0d1c['query']);_0x52e8b3[_0x83db('0x48')]=_[_0x83db('0x47')](_0xaf0d1c['model'],qs[_0x83db('0x49')](_0x28bde4[_0x83db('0x46')][_0x83db('0x49')]));_0x52e8b3[_0x83db('0x48')]=_0x52e8b3[_0x83db('0x48')][_0x83db('0x4a')]?_0x52e8b3['attributes']:_0xaf0d1c[_0x83db('0x45')];if(!_0x28bde4[_0x83db('0x46')]['hasOwnProperty'](_0x83db('0x69'))){_0x52e8b3[_0x83db('0x30')]=qs['limit'](_0x28bde4[_0x83db('0x46')][_0x83db('0x30')]);_0x52e8b3[_0x83db('0x2d')]=qs[_0x83db('0x2d')](_0x28bde4[_0x83db('0x46')][_0x83db('0x2d')]);}_0x52e8b3[_0x83db('0xbf')]=qs[_0x83db('0x4b')](_0x28bde4[_0x83db('0x46')][_0x83db('0x4b')]);_0x52e8b3['where']=qs['filters'](_[_0x83db('0x4e')](_0x28bde4[_0x83db('0x46')],_0xaf0d1c[_0x83db('0x4d')]));_0x52e8b3[_0x83db('0x4c')]['SmsAccountId']=_0x76a652['id'];if(_0x28bde4[_0x83db('0x46')][_0x83db('0x4f')]){_0x52e8b3[_0x83db('0x4c')]=_[_0x83db('0x50')](_0x52e8b3[_0x83db('0x4c')],{'$or':_[_0x83db('0x3f')](_0x52e8b3[_0x83db('0x48')],function(_0x3e777a){var _0x5d6784={};_0x5d6784[_0x3e777a]={'$like':'%'+_0x28bde4[_0x83db('0x46')][_0x83db('0x4f')]+'%'};return _0x5d6784;})});}_0x52e8b3=_[_0x83db('0x50')]({},_0x52e8b3,_0x28bde4[_0x83db('0x52')]);return db['SmsInteraction'][_0x83db('0x2f')]({'where':_0x52e8b3['where']})[_0x83db('0x1f')](function(_0x4ea7bb){_0x3958db[_0x83db('0x2f')]=_0x4ea7bb;if(_0x28bde4[_0x83db('0x46')]['includeAll']){_0x52e8b3[_0x83db('0x56')]=[{'model':db['CmContact'],'as':_0x83db('0xc1'),'required':![]},{'model':db[_0x83db('0xa6')],'as':_0x83db('0xc2'),'attributes':[_0x83db('0x3c'),_0x83db('0xc3'),_0x83db('0xc4')],'required':![]},{'model':db[_0x83db('0xc5')],'as':_0x83db('0xc6'),'attributes':['id',_0x83db('0x3c'),_0x83db('0xc7')],'where':_0x28bde4[_0x83db('0x46')][_0x83db('0xc8')]?{'id':_0x28bde4[_0x83db('0x46')]['tag']}:undefined,'required':_0x28bde4[_0x83db('0x46')]['tag']?!![]:![]}];}return db[_0x83db('0x9a')]['findAll'](_0x52e8b3);})[_0x83db('0x1f')](function(_0xdcbfa1){_0x3958db['rows']=_0xdcbfa1;return _0x3958db;});}})[_0x83db('0x1f')](respondWithFilteredResult(_0x58c4ac,_0x52e8b3))[_0x83db('0x28')](handleError(_0x58c4ac,null));};exports[_0x83db('0x3d')]=function(_0x17bbc6,_0x8fc051,_0x3309ca){var _0x100092,_0x1a9d9c,_0x37f4fe;if(_[_0x83db('0x92')](_0x17bbc6['body'][_0x83db('0x59')])||_0x17bbc6['body']['body']===''){throw new db[(_0x83db('0x78'))]['ValidationError'](_0x83db('0x93'));}if(_[_0x83db('0x92')](_0x17bbc6[_0x83db('0x59')]['to'])){throw new db['Sequelize'][(_0x83db('0x79'))]('to\x20is\x20mandatory');}_0x100092=_0x17bbc6[_0x83db('0x59')]['to'];return db[_0x83db('0x40')]['find']({'where':{'id':_0x17bbc6[_0x83db('0x61')]['id']},'include':[{'model':db[_0x83db('0xc9')],'as':_0x83db('0xca'),'include':[{'model':db[_0x83db('0x98')],'as':_0x83db('0x96'),'where':{'mobile':_0x100092},'limit':0x1,'order':[['updatedAt',_0x83db('0xcb')]]}]}]})[_0x83db('0x1f')](handleEntityNotFound(_0x8fc051,null))[_0x83db('0x1f')](function(_0x144c91){if(_0x144c91&&_0x144c91['List']){_0x1a9d9c=_0x144c91[_0x83db('0x38')]({'plain':!![]});if(_0x1a9d9c[_0x83db('0xca')]&&_0x1a9d9c[_0x83db('0xca')]['Contacts'][_0x83db('0x4a')]){return _0x1a9d9c['List']['Contacts'][0x0];}return db[_0x83db('0x98')][_0x83db('0x58')](_['defaults'](_0x17bbc6[_0x83db('0x59')],{'firstName':_0x100092,'mobile':_0x100092,'phone':_0x100092,'ListId':_0x1a9d9c[_0x83db('0xcc')]}));}})[_0x83db('0x1f')](handleEntityNotFound(_0x8fc051,null))[_0x83db('0x1f')](function(_0x4242b8){if(_0x4242b8){_0x37f4fe=_0x4242b8;return db[_0x83db('0x9a')]['find']({'where':{'ContactId':_0x37f4fe['id'],'closed':![],'SmsAccountId':_0x1a9d9c['id']}})['then'](function(_0x309930){if(_0x309930){return[_0x309930,![]];}return db['SmsInteraction']['create']({'UserId':_0x17bbc6[_0x83db('0x5a')]['id'],'ContactId':_0x37f4fe['id'],'SmsAccountId':_0x1a9d9c['id'],'phone':_0x100092,'firstMsgDirection':_0x83db('0xcd'),'Messages':[_['merge'](_0x17bbc6[_0x83db('0x59')],{'read':![],'body':_0x17bbc6['body'][_0x83db('0x59')],'phone':_0x100092,'SmsAccountId':_0x1a9d9c['id'],'UserId':_0x17bbc6[_0x83db('0x5a')]['id'],'ContactId':_0x37f4fe['id']})]},{'include':[{'model':db[_0x83db('0xa2')],'as':_0x83db('0xce')}]})[_0x83db('0x1f')](function(_0x288e75){return[_0x288e75,!![]];});});}})[_0x83db('0x9b')](function(_0x554529,_0x559000){if(_0x559000){return _0x554529;}return db[_0x83db('0xa2')][_0x83db('0x58')](_['merge'](_0x17bbc6[_0x83db('0x59')],{'read':![],'body':_0x17bbc6[_0x83db('0x59')][_0x83db('0x59')],'phone':_0x100092,'SmsAccountId':_0x1a9d9c['id'],'SmsInteractionId':_0x554529['id'],'UserId':_0x17bbc6['user']['id'],'ContactId':_0x37f4fe['id']}))['then'](function(_0x34972f){_0x554529['dataValues'][_0x83db('0xce')]=[];_0x554529[_0x83db('0xcf')][_0x83db('0xce')][_0x83db('0x9f')](_0x34972f['dataValues']);return _0x554529;});})['then'](respondWithResult(_0x8fc051,null))[_0x83db('0x28')](handleError(_0x8fc051,null));};exports[_0x83db('0x2a')]=function(_0x337566,_0x2a7b24,_0x317a3d){if(_0x337566[_0x83db('0x59')]['id']){delete _0x337566[_0x83db('0x59')]['id'];}var _0x467d79,_0x5d9a97,_0x13a622;return db['SmsAccount'][_0x83db('0x57')]({'where':{'id':_0x337566[_0x83db('0x61')]['id']}})['then'](handleEntityNotFound(_0x2a7b24,null))[_0x83db('0x1f')](function(_0x32f27a){if(_0x32f27a){_0x13a622=_0x32f27a;logger[_0x83db('0x22')](_0x83db('0x23'),_0x83db('0x2a'),_0x83db('0xd0'),_0x32f27a[_0x83db('0x43')],util['inspect'](_0x337566[_0x83db('0x59')],{'showHidden':![],'depth':null}));switch(_0x32f27a[_0x83db('0x43')]){case _0x83db('0x82'):if(_0x337566[_0x83db('0x59')][_0x83db('0xd1')]&&_0x337566[_0x83db('0x59')]['status']){_0x5d9a97=_0x337566[_0x83db('0x59')][_0x83db('0x2a')];return db[_0x83db('0xa2')][_0x83db('0x57')]({'where':{'messageId':_0x337566['body']['skebby_dispatch_id']}});}break;case _0x83db('0x84'):if(_0x337566['body'][_0x83db('0xd2')]&&_0x337566['body'][_0x83db('0xd3')]){_0x5d9a97=_0x337566[_0x83db('0x59')][_0x83db('0xd3')];return db[_0x83db('0xa2')][_0x83db('0x57')]({'where':{'messageId':_0x337566[_0x83db('0x59')][_0x83db('0xd2')]}});}break;case _0x83db('0x86'):if(_0x337566[_0x83db('0x59')]['message_id']&&_0x337566[_0x83db('0x59')][_0x83db('0xd4')]){_0x5d9a97=_0x337566[_0x83db('0x59')][_0x83db('0xd4')];return db[_0x83db('0xa2')]['find']({'where':{'messageId':_0x337566[_0x83db('0x59')][_0x83db('0x87')]}});}break;case _0x83db('0x89'):var _0xeb0a6a=_0x337566[_0x83db('0x59')][_0x83db('0x8a')][0x0];if(_0xeb0a6a[_0x83db('0x80')]&&_0xeb0a6a[_0x83db('0x2a')][_0x83db('0xd5')]===_0x83db('0xd6')){_0x5d9a97=_0xeb0a6a[_0x83db('0x2a')][_0x83db('0xd5')];return db[_0x83db('0xa2')]['find']({'where':{'messageId':_0xeb0a6a[_0x83db('0x80')]}});}break;case'clickatell':if(_0x337566[_0x83db('0x59')][_0x83db('0x80')]&&_0x337566[_0x83db('0x59')][_0x83db('0x2a')]){_0x5d9a97=_0x337566[_0x83db('0x59')]['status'];return db[_0x83db('0xa2')][_0x83db('0x57')]({'where':{'messageId':_0x337566['body'][_0x83db('0x80')]}});}break;case _0x83db('0x90'):if(_0x337566[_0x83db('0x59')][0x0][_0x83db('0x26')]['id']){_0x5d9a97=_0x337566[_0x83db('0x59')][0x0][_0x83db('0x43')];return db['SmsMessage'][_0x83db('0x57')]({'where':{'messageId':_0x337566['body'][0x0]['message']['id']}});}break;case _0x83db('0x91'):if(_0x337566[_0x83db('0x59')][_0x83db('0xd7')]&&_0x337566['body']['status']){_0x5d9a97=_0x337566[_0x83db('0x59')]['status'];return db[_0x83db('0xa2')]['find']({'where':{'messageId':_0x337566[_0x83db('0x59')]['redif']}});}break;}}})[_0x83db('0x1f')](handleEntityNotFound(_0x2a7b24,null))[_0x83db('0x1f')](function(_0x3f1980){if(_0x3f1980){_0x467d79=_0x3f1980;switch(_0x13a622[_0x83db('0x43')]){case'skebby':if(_0x5d9a97===_0x83db('0xd6')){return _0x467d79[_0x83db('0x36')]({'read':!![]});}else{logger[_0x83db('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x83db('0x82'),util['inspect'](_0x337566[_0x83db('0x59')],{'showHidden':![],'depth':null}));}break;case _0x83db('0x84'):if(_0x5d9a97==='1'){return _0x467d79[_0x83db('0x36')]({'read':!![]});}else{logger['error'](_0x83db('0x23'),_0x83db('0x2a'),_0x83db('0x82'),util[_0x83db('0xd8')](_0x337566[_0x83db('0x59')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x337566['body']['error_code']&&_0x5d9a97>=0xc8&&_0x5d9a97<=0xce){return _0x467d79[_0x83db('0x36')]({'read':!![]});}else{logger[_0x83db('0x25')](_0x83db('0x23'),_0x83db('0x2a'),_0x83db('0x86'),util[_0x83db('0xd8')](_0x337566['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x3537c9=_0x337566['body'][_0x83db('0x8a')][0x0];if(_0x3537c9[_0x83db('0x2a')][_0x83db('0xd5')]===_0x83db('0xd6')){return _0x467d79['update']({'read':!![]});}else{logger[_0x83db('0x25')](_0x83db('0x23'),_0x83db('0x2a'),'infobip',util[_0x83db('0xd8')](_0x337566[_0x83db('0x59')],{'showHidden':![],'depth':null}));}break;case _0x83db('0x8e'):if(_0x5d9a97=='DELIVERED_TO_GATEWAY'||_0x5d9a97=='RECEIVED_BY_RECIPIENT'){return _0x467d79[_0x83db('0x36')]({'read':!![]});}else{logger[_0x83db('0x25')](_0x83db('0x23'),'status','clickatell',util[_0x83db('0xd8')](_0x337566[_0x83db('0x59')],{'showHidden':![],'depth':null}));}break;case _0x83db('0x90'):if(_0x5d9a97=='message-delivered'){return _0x467d79[_0x83db('0x36')]({'read':!![]});}else{logger[_0x83db('0x25')](_0x83db('0x23'),_0x83db('0x2a'),_0x83db('0x90'),util[_0x83db('0xd8')](_0x337566[_0x83db('0x59')],{'showHidden':![],'depth':null}));}break;case _0x83db('0x91'):if(_0x5d9a97===_0x83db('0xd9')||_0x5d9a97===_0x83db('0xda')){return _0x467d79[_0x83db('0x36')]({'read':!![]});}else{logger['error'](_0x83db('0x23'),_0x83db('0x2a'),'intelepeer',util[_0x83db('0xd8')](_0x337566['body'],{'showHidden':![],'depth':null}));}break;}return _0x467d79;}})['then'](respondWithResult(_0x2a7b24,null))[_0x83db('0x28')](handleError(_0x2a7b24,null));};exports[_0x83db('0xdb')]=function(_0x56904d,_0x8c0557,_0x3b8396){var _0x452b31,_0x54e26d,_0x52821f;return db[_0x83db('0x40')][_0x83db('0x57')]({'where':{'id':_0x56904d[_0x83db('0x61')]['id']}})[_0x83db('0x1f')](handleEntityNotFound(_0x8c0557,null))['then'](function(_0x46d037){if(_0x46d037){_0x52821f=_0x46d037;logger[_0x83db('0x22')](_0x83db('0x23'),_0x83db('0x2a'),_0x83db('0xd0'),_0x46d037[_0x83db('0x43')],util[_0x83db('0xd8')](_0x56904d[_0x83db('0x46')],{'showHidden':![],'depth':null}));switch(_0x46d037['type']){case _0x83db('0x8b'):if(_0x56904d['query'][_0x83db('0xdc')]&&_0x56904d[_0x83db('0x46')]['state']){_0x54e26d=_0x56904d['query'][_0x83db('0xdd')];return db['SmsMessage'][_0x83db('0x57')]({'where':{'messageId':_0x56904d[_0x83db('0x46')][_0x83db('0xdc')]}});}break;}}})['then'](handleEntityNotFound(_0x8c0557,null))[_0x83db('0x1f')](function(_0x670168){if(_0x670168){_0x452b31=_0x670168;switch(_0x52821f[_0x83db('0x43')]){case _0x83db('0x8b'):if(_0x54e26d==='2'||_0x54e26d==='6'){return _0x452b31[_0x83db('0x36')]({'read':!![]});}else{logger['error'](_0x83db('0x23'),_0x83db('0x2a'),_0x83db('0x8b'),util[_0x83db('0xd8')](_0x56904d[_0x83db('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x452b31;}})[_0x83db('0x1f')](respondWithResult(_0x8c0557,null))[_0x83db('0x28')](handleError(_0x8c0557,null));};exports['addAgents']=function(_0x118065,_0x11276e,_0x3c3ccd){return db['SmsAccount'][_0x83db('0x57')]({'where':{'id':_0x118065[_0x83db('0x61')]['id']}})[_0x83db('0x1f')](handleEntityNotFound(_0x11276e,null))[_0x83db('0x1f')](function(_0x5f0d8d){if(_0x5f0d8d){return _0x5f0d8d[_0x83db('0xde')](_0x118065[_0x83db('0x59')][_0x83db('0x6b')],_[_0x83db('0x97')](_0x118065['body'],[_0x83db('0x6b'),'id'])||{})[_0x83db('0x9b')](function(_0x2dc504){for(var _0x3135a7=0x0;_0x3135a7<_0x118065[_0x83db('0x59')][_0x83db('0x6b')]['length'];_0x3135a7+=0x1){socket[_0x83db('0xdf')](_0x83db('0xe0'),{'UserId':Number(_0x118065[_0x83db('0x59')][_0x83db('0x6b')][_0x3135a7]),'SmsAccountId':Number(_0x118065['params']['id'])});}return _0x2dc504;});}})[_0x83db('0x1f')](respondWithResult(_0x11276e,null))[_0x83db('0x28')](handleError(_0x11276e,null));};exports[_0x83db('0xe1')]=function(_0x440356,_0x3f4337,_0x2cea08){return db[_0x83db('0x40')][_0x83db('0x57')]({'where':{'id':_0x440356[_0x83db('0x61')]['id']}})[_0x83db('0x1f')](handleEntityNotFound(_0x3f4337,null))[_0x83db('0x1f')](function(_0x39e95c){if(_0x39e95c){return _0x39e95c[_0x83db('0xe1')](_0x440356['query'][_0x83db('0x6b')])[_0x83db('0x1f')](function(){if(_[_0x83db('0xe2')](_0x440356['query'][_0x83db('0x6b')])){for(var _0x4e1382=0x0;_0x4e1382<_0x440356[_0x83db('0x46')][_0x83db('0x6b')]['length'];_0x4e1382+=0x1){socket['emit'](_0x83db('0xe3'),{'UserId':Number(_0x440356[_0x83db('0x46')][_0x83db('0x6b')][_0x4e1382]),'SmsAccountId':Number(_0x440356[_0x83db('0x61')]['id'])});}}else{socket[_0x83db('0xdf')](_0x83db('0xe3'),{'UserId':Number(_0x440356['query'][_0x83db('0x6b')]),'SmsAccountId':Number(_0x440356['params']['id'])});}});}})[_0x83db('0x1f')](respondWithStatusCode(_0x3f4337,null))['catch'](handleError(_0x3f4337,null));};exports['getAgents']=function(_0x31e69f,_0x251ee4,_0x36e039){var _0x3578b2={};var _0x5a0035={};var _0x114f81;var _0xa5f72a;return db[_0x83db('0x40')]['findOne']({'where':{'id':_0x31e69f[_0x83db('0x61')]['id']}})[_0x83db('0x1f')](handleEntityNotFound(_0x251ee4,null))[_0x83db('0x1f')](function(_0xf2a944){if(_0xf2a944){_0x114f81=_0xf2a944;_0x5a0035[_0x83db('0x45')]=_['keys'](db[_0x83db('0xa6')][_0x83db('0x41')]);_0x5a0035['query']=_['keys'](_0x31e69f['query']);_0x5a0035['filters']=_[_0x83db('0x47')](_0x5a0035['model'],_0x5a0035[_0x83db('0x46')]);_0x3578b2[_0x83db('0x48')]=_['intersection'](_0x5a0035[_0x83db('0x45')],qs[_0x83db('0x49')](_0x31e69f['query']['fields']));_0x3578b2[_0x83db('0x48')]=_0x3578b2['attributes'][_0x83db('0x4a')]?_0x3578b2['attributes']:_0x5a0035[_0x83db('0x45')];_0x3578b2[_0x83db('0xbf')]=qs[_0x83db('0x4b')](_0x31e69f['query'][_0x83db('0x4b')]);_0x3578b2[_0x83db('0x4c')]=qs['filters'](_[_0x83db('0x4e')](_0x31e69f[_0x83db('0x46')],_0x5a0035[_0x83db('0x4d')]));if(_0x31e69f['query']['filter']){_0x3578b2['where']=_[_0x83db('0x50')](_0x3578b2[_0x83db('0x4c')],{'$or':_[_0x83db('0x3f')](_0x3578b2[_0x83db('0x48')],function(_0x689dbc){var _0x3e43c9={};_0x3e43c9[_0x689dbc]={'$like':'%'+_0x31e69f[_0x83db('0x46')][_0x83db('0x4f')]+'%'};return _0x3e43c9;})});}_0x3578b2=_['merge']({},_0x3578b2,_0x31e69f[_0x83db('0x52')]);return _0x114f81[_0x83db('0xe4')](_0x3578b2);}})['then'](function(_0x23c407){if(_0x23c407){_0xa5f72a=_0x23c407[_0x83db('0x4a')];if(!_0x31e69f[_0x83db('0x46')][_0x83db('0x6f')]('nolimit')){_0x3578b2[_0x83db('0x30')]=qs[_0x83db('0x30')](_0x31e69f[_0x83db('0x46')][_0x83db('0x30')]);_0x3578b2[_0x83db('0x2d')]=qs[_0x83db('0x2d')](_0x31e69f[_0x83db('0x46')]['offset']);}return _0x114f81[_0x83db('0xe4')](_0x3578b2);}})[_0x83db('0x1f')](function(_0x3c51e7){if(_0x3c51e7){return _0x3c51e7?{'count':_0xa5f72a,'rows':_0x3c51e7}:null;}})[_0x83db('0x1f')](respondWithResult(_0x251ee4,null))[_0x83db('0x28')](handleError(_0x251ee4,null));}; \ No newline at end of file +var _0xc8b4=['result','catch','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','SmsAccountId','Disposition','findOne','nolimit','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','notify','SmsApplication','Applications','account','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','MessageSid','sender','text','messageId','plivo','Text','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','applications','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','stack','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','Messages','dataValues','push','received\x20delivery\x20report\x20from','skebby_dispatch_id','connectel','requestid','statusInt','message_id','status_code','groupName','redif','skebby','inspect','clicksend','DELIVERED','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x4bea54,_0x474fbe){var _0x32cbe0=function(_0x57bd6f){while(--_0x57bd6f){_0x4bea54['push'](_0x4bea54['shift']());}};_0x32cbe0(++_0x474fbe);}(_0xc8b4,0x1b8));var _0x4c8b=function(_0x1aa154,_0x451b07){_0x1aa154=_0x1aa154-0x0;var _0x6e6eed=_0xc8b4[_0x1aa154];return _0x6e6eed;};'use strict';var emlformat=require(_0x4c8b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4c8b('0x1'));var BPromise=require(_0x4c8b('0x2'));var Mustache=require(_0x4c8b('0x3'));var util=require(_0x4c8b('0x4'));var path=require(_0x4c8b('0x5'));var sox=require(_0x4c8b('0x6'));var csv=require(_0x4c8b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c8b('0x8'));var _=require(_0x4c8b('0x9'));var squel=require(_0x4c8b('0xa'));var crypto=require(_0x4c8b('0xb'));var jsforce=require(_0x4c8b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4c8b('0xd'));var Papa=require(_0x4c8b('0xe'));var Redis=require('ioredis');var authService=require(_0x4c8b('0xf'));var qs=require(_0x4c8b('0x10'));var as=require(_0x4c8b('0x11'));var hardwareService=require(_0x4c8b('0x12'));var logger=require(_0x4c8b('0x13'))(_0x4c8b('0x14'));var utils=require(_0x4c8b('0x15'));var config=require(_0x4c8b('0x16'));var licenseUtil=require(_0x4c8b('0x17'));var db=require(_0x4c8b('0x18'))['db'];config['redis']=_['defaults'](config[_0x4c8b('0x19')],{'host':_0x4c8b('0x1a'),'port':0x18eb});var socket=require(_0x4c8b('0x1b'))(new Redis(config[_0x4c8b('0x19')]));require(_0x4c8b('0x1c'))['register'](socket);var jayson=require(_0x4c8b('0x1d'));var client=jayson[_0x4c8b('0x1e')][_0x4c8b('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0xb94220,_0x294158,_0x1feb09,_0x4ffee9){return new BPromise(function(_0x57e68b,_0x38eda3){var _0x3de6eb=_0x4ffee9||client;return _0x3de6eb[_0x4c8b('0x20')](_0xb94220,_0x1feb09)[_0x4c8b('0x21')](function(_0x14904b){logger[_0x4c8b('0x22')](_0x4c8b('0x23'),_0x294158,'request\x20sent');logger['debug'](_0x4c8b('0x24'),_0x294158,_0x4c8b('0x25'),JSON[_0x4c8b('0x26')](_0x14904b));if(_0x14904b['error']){if(_0x14904b[_0x4c8b('0x27')][_0x4c8b('0x28')]===0x1f4){logger['error'](_0x4c8b('0x23'),_0x294158,_0x14904b[_0x4c8b('0x27')][_0x4c8b('0x29')]);return _0x38eda3(_0x14904b['error'][_0x4c8b('0x29')]);}logger[_0x4c8b('0x27')](_0x4c8b('0x23'),_0x294158,_0x14904b['error'][_0x4c8b('0x29')]);return _0x57e68b(_0x14904b[_0x4c8b('0x27')][_0x4c8b('0x29')]);}else{logger[_0x4c8b('0x22')](_0x4c8b('0x23'),_0x294158,_0x4c8b('0x25'));_0x57e68b(_0x14904b[_0x4c8b('0x2a')][_0x4c8b('0x29')]);}})[_0x4c8b('0x2b')](function(_0x1f3ead){logger[_0x4c8b('0x27')](_0x4c8b('0x23'),_0x294158,_0x1f3ead);_0x38eda3(_0x1f3ead);});});}function respondWithStatusCode(_0x232859,_0x35b8e4){_0x35b8e4=_0x35b8e4||0xcc;return function(_0x5c2c71){if(_0x5c2c71){return _0x232859[_0x4c8b('0x2c')](_0x35b8e4);}return _0x232859[_0x4c8b('0x2d')](_0x35b8e4)[_0x4c8b('0x2e')]();};}function respondWithResult(_0x33c7c3,_0x5d8457){_0x5d8457=_0x5d8457||0xc8;return function(_0x3ebae6){if(_0x3ebae6){return _0x33c7c3[_0x4c8b('0x2d')](_0x5d8457)['json'](_0x3ebae6);}};}function respondWithFilteredResult(_0xaafe5b,_0x305f66){return function(_0x2bba87){if(_0x2bba87){var _0x124e61=typeof _0x305f66[_0x4c8b('0x2f')]==='undefined'&&typeof _0x305f66[_0x4c8b('0x30')]==='undefined';var _0x557a65=_0x2bba87[_0x4c8b('0x31')];var _0x3aab1c=_0x124e61?0x0:_0x305f66[_0x4c8b('0x2f')];var _0x24e46c=_0x124e61?_0x2bba87[_0x4c8b('0x31')]:_0x305f66[_0x4c8b('0x2f')]+_0x305f66[_0x4c8b('0x30')];var _0x3e43ae;if(_0x24e46c>=_0x557a65){_0x24e46c=_0x557a65;_0x3e43ae=0xc8;}else{_0x3e43ae=0xce;}_0xaafe5b['status'](_0x3e43ae);return _0xaafe5b[_0x4c8b('0x32')](_0x4c8b('0x33'),_0x3aab1c+'-'+_0x24e46c+'/'+_0x557a65)[_0x4c8b('0x34')](_0x2bba87);}return null;};}function patchUpdates(_0xeb962d){return function(_0x49e38f){try{jsonpatch[_0x4c8b('0x35')](_0x49e38f,_0xeb962d,!![]);}catch(_0x426234){return BPromise[_0x4c8b('0x36')](_0x426234);}return _0x49e38f[_0x4c8b('0x37')]();};}function saveUpdates(_0x231a0d,_0x5cc599){return function(_0x4ab3e9){if(_0x4ab3e9){return _0x4ab3e9['update'](_0x231a0d)[_0x4c8b('0x21')](function(_0x6b0326){return _0x6b0326;});}return null;};}function removeEntity(_0x3c9870,_0x1dbc8a){return function(_0x55b6e0){if(_0x55b6e0){return _0x55b6e0[_0x4c8b('0x38')]()[_0x4c8b('0x21')](function(){var _0x23b93c=_0x55b6e0[_0x4c8b('0x39')]({'plain':!![]});var _0x206e04=_0x4c8b('0x3a');return db[_0x4c8b('0x3b')][_0x4c8b('0x38')]({'where':{'type':_0x206e04,'resourceId':_0x23b93c['id']}})[_0x4c8b('0x21')](function(){return _0x55b6e0;});})[_0x4c8b('0x21')](function(){_0x3c9870[_0x4c8b('0x2d')](0xcc)[_0x4c8b('0x2e')]();});}};}function handleEntityNotFound(_0x275b9b,_0xaa207b){return function(_0x301f99){if(!_0x301f99){_0x275b9b[_0x4c8b('0x2c')](0x194);}return _0x301f99;};}function handleError(_0x3ce70b,_0x2919c5){_0x2919c5=_0x2919c5||0x1f4;return function(_0x21fd6b){logger[_0x4c8b('0x27')](_0x21fd6b['stack']);if(_0x21fd6b['name']){delete _0x21fd6b[_0x4c8b('0x3c')];}_0x3ce70b[_0x4c8b('0x2d')](_0x2919c5)[_0x4c8b('0x3d')](_0x21fd6b);};}exports[_0x4c8b('0x3e')]=function(_0x2d8c9b,_0x4dd2f3){var _0x59d60b={'include':[{'model':db[_0x4c8b('0x3f')],'as':_0x4c8b('0x40')}]},_0x5a6144={},_0x5a88b6={'count':0x0,'rows':[]};var _0x5c82e1=_[_0x4c8b('0x41')](db[_0x4c8b('0x42')][_0x4c8b('0x43')],function(_0x101c91){return{'name':_0x101c91['fieldName'],'type':_0x101c91[_0x4c8b('0x44')][_0x4c8b('0x45')]};});_0x5a6144[_0x4c8b('0x46')]=_[_0x4c8b('0x41')](_0x5c82e1,_0x4c8b('0x3c'));_0x5a6144[_0x4c8b('0x47')]=_[_0x4c8b('0x48')](_0x2d8c9b[_0x4c8b('0x47')]);_0x5a6144[_0x4c8b('0x49')]=_[_0x4c8b('0x4a')](_0x5a6144['model'],_0x5a6144['query']);_0x59d60b[_0x4c8b('0x4b')]=_[_0x4c8b('0x4a')](_0x5a6144[_0x4c8b('0x46')],qs[_0x4c8b('0x4c')](_0x2d8c9b[_0x4c8b('0x47')][_0x4c8b('0x4c')]));_0x59d60b[_0x4c8b('0x4b')]=_0x59d60b[_0x4c8b('0x4b')][_0x4c8b('0x4d')]?_0x59d60b[_0x4c8b('0x4b')]:_0x5a6144[_0x4c8b('0x46')];if(!_0x2d8c9b[_0x4c8b('0x47')]['hasOwnProperty']('nolimit')){_0x59d60b['limit']=qs[_0x4c8b('0x30')](_0x2d8c9b[_0x4c8b('0x47')][_0x4c8b('0x30')]);_0x59d60b[_0x4c8b('0x2f')]=qs['offset'](_0x2d8c9b[_0x4c8b('0x47')]['offset']);}_0x59d60b[_0x4c8b('0x4e')]=qs[_0x4c8b('0x4f')](_0x2d8c9b['query']['sort']);_0x59d60b['where']=qs[_0x4c8b('0x49')](_['pick'](_0x2d8c9b[_0x4c8b('0x47')],_0x5a6144[_0x4c8b('0x49')]),_0x5c82e1);if(_0x2d8c9b[_0x4c8b('0x47')][_0x4c8b('0x50')]){_0x59d60b[_0x4c8b('0x51')]=_[_0x4c8b('0x52')](_0x59d60b['where'],{'$or':_['map'](_0x5c82e1,function(_0x42f10d){if(_0x42f10d[_0x4c8b('0x44')]!==_0x4c8b('0x53')){var _0x5e0255={};_0x5e0255[_0x42f10d[_0x4c8b('0x3c')]]={'$like':'%'+_0x2d8c9b['query'][_0x4c8b('0x50')]+'%'};return _0x5e0255;}})});}_0x59d60b=_['merge']({},_0x59d60b,_0x2d8c9b[_0x4c8b('0x54')]);var _0x2ae716={'where':_0x59d60b['where']};return db[_0x4c8b('0x42')][_0x4c8b('0x31')](_0x2ae716)['then'](function(_0x450434){_0x5a88b6[_0x4c8b('0x31')]=_0x450434;if(_0x2d8c9b[_0x4c8b('0x47')][_0x4c8b('0x55')]){_0x59d60b[_0x4c8b('0x56')]=[{'all':!![]}];}return db['SmsAccount'][_0x4c8b('0x57')](_0x59d60b);})['then'](function(_0xd1d19c){_0x5a88b6[_0x4c8b('0x58')]=_0xd1d19c;return _0x5a88b6;})[_0x4c8b('0x21')](respondWithFilteredResult(_0x4dd2f3,_0x59d60b))[_0x4c8b('0x2b')](handleError(_0x4dd2f3,null));};exports[_0x4c8b('0x59')]=function(_0x69beb,_0x40f6ed){var _0x597aaf={'raw':![],'where':{'id':_0x69beb['params']['id']},'include':[{'model':db[_0x4c8b('0x3f')],'as':_0x4c8b('0x40')}]},_0x239102={};_0x239102[_0x4c8b('0x46')]=_[_0x4c8b('0x48')](db[_0x4c8b('0x42')][_0x4c8b('0x43')]);_0x239102[_0x4c8b('0x47')]=_[_0x4c8b('0x48')](_0x69beb[_0x4c8b('0x47')]);_0x239102[_0x4c8b('0x49')]=_[_0x4c8b('0x4a')](_0x239102[_0x4c8b('0x46')],_0x239102['query']);_0x597aaf[_0x4c8b('0x4b')]=_['intersection'](_0x239102[_0x4c8b('0x46')],qs['fields'](_0x69beb[_0x4c8b('0x47')][_0x4c8b('0x4c')]));_0x597aaf['attributes']=_0x597aaf[_0x4c8b('0x4b')][_0x4c8b('0x4d')]?_0x597aaf['attributes']:_0x239102[_0x4c8b('0x46')];if(_0x69beb['query'][_0x4c8b('0x55')]){_0x597aaf[_0x4c8b('0x56')]=[{'all':!![]}];}_0x597aaf=_[_0x4c8b('0x52')]({},_0x597aaf,_0x69beb['options']);return db[_0x4c8b('0x42')]['find'](_0x597aaf)[_0x4c8b('0x21')](handleEntityNotFound(_0x40f6ed,null))[_0x4c8b('0x21')](respondWithResult(_0x40f6ed,null))[_0x4c8b('0x2b')](handleError(_0x40f6ed,null));};exports[_0x4c8b('0x5a')]=function(_0x468ded,_0x17cd4c){return db[_0x4c8b('0x42')][_0x4c8b('0x5a')](_0x468ded[_0x4c8b('0x5b')],{})[_0x4c8b('0x21')](function(_0x5cd364){var _0x4c2745=_0x468ded[_0x4c8b('0x5c')][_0x4c8b('0x39')]({'plain':!![]});if(!_0x4c2745)throw new Error(_0x4c8b('0x5d'));if(_0x4c2745['role']===_0x4c8b('0x5c')){var _0x28b7fa=_0x5cd364[_0x4c8b('0x39')]({'plain':!![]});var _0x3150c4=_0x4c8b('0x3a');return db['UserProfileSection'][_0x4c8b('0x5e')]({'where':{'name':_0x3150c4,'userProfileId':_0x4c2745[_0x4c8b('0x5f')]},'raw':!![]})['then'](function(_0x570ad8){if(_0x570ad8&&_0x570ad8['autoAssociation']===0x0){return db[_0x4c8b('0x3b')][_0x4c8b('0x5a')]({'name':_0x28b7fa[_0x4c8b('0x3c')],'resourceId':_0x28b7fa['id'],'type':_0x570ad8[_0x4c8b('0x3c')],'sectionId':_0x570ad8['id']},{})['then'](function(){return _0x5cd364;});}else{return _0x5cd364;}})[_0x4c8b('0x2b')](function(_0x57f3d8){logger[_0x4c8b('0x27')](_0x4c8b('0x60'),_0x57f3d8);throw _0x57f3d8;});}return _0x5cd364;})[_0x4c8b('0x21')](respondWithResult(_0x17cd4c,0xc9))[_0x4c8b('0x2b')](handleError(_0x17cd4c,null));};exports[_0x4c8b('0x61')]=function(_0x112c53,_0x37bae2){if(_0x112c53[_0x4c8b('0x5b')]['id']){delete _0x112c53[_0x4c8b('0x5b')]['id'];}return db[_0x4c8b('0x42')]['find']({'where':{'id':_0x112c53[_0x4c8b('0x62')]['id']},'include':[{'model':db[_0x4c8b('0x3f')],'as':'mandatoryDispositionPause'}]})[_0x4c8b('0x21')](handleEntityNotFound(_0x37bae2,null))[_0x4c8b('0x21')](saveUpdates(_0x112c53[_0x4c8b('0x5b')],null))['then'](respondWithResult(_0x37bae2,null))[_0x4c8b('0x2b')](handleError(_0x37bae2,null));};exports['destroy']=function(_0x2d94a8,_0x1a2f8a){return db[_0x4c8b('0x42')][_0x4c8b('0x5e')]({'where':{'id':_0x2d94a8[_0x4c8b('0x62')]['id']}})[_0x4c8b('0x21')](handleEntityNotFound(_0x1a2f8a,null))[_0x4c8b('0x21')](removeEntity(_0x1a2f8a,null))['catch'](handleError(_0x1a2f8a,null));};exports[_0x4c8b('0x63')]=function(_0x2390ec,_0x38e42e){return db[_0x4c8b('0x42')][_0x4c8b('0x63')]()[_0x4c8b('0x21')](respondWithResult(_0x38e42e,null))[_0x4c8b('0x2b')](handleError(_0x38e42e,null));};exports[_0x4c8b('0x64')]=function(_0xee787,_0x6f876e,_0x27a2f0){if(_0xee787[_0x4c8b('0x5b')]['id']){delete _0xee787[_0x4c8b('0x5b')]['id'];}return db[_0x4c8b('0x42')][_0x4c8b('0x5e')]({'where':{'id':_0xee787['params']['id']}})['then'](handleEntityNotFound(_0x6f876e,null))['then'](function(_0x33f8d1){if(_0x33f8d1){_0xee787[_0x4c8b('0x5b')][_0x4c8b('0x65')]=_0x33f8d1['id'];return db[_0x4c8b('0x66')]['create'](_0xee787[_0x4c8b('0x5b')]);}})[_0x4c8b('0x21')](respondWithResult(_0x6f876e,null))[_0x4c8b('0x2b')](handleError(_0x6f876e,null));};exports['getDispositions']=function(_0x38d446,_0x4e228e,_0x235936){var _0x4ba111={'raw':![],'where':{}};var _0x522993={};var _0x15dc29={'count':0x0,'rows':[]};return db['SmsAccount'][_0x4c8b('0x67')]({'where':{'id':_0x38d446[_0x4c8b('0x62')]['id']}})[_0x4c8b('0x21')](handleEntityNotFound(_0x4e228e,null))[_0x4c8b('0x21')](function(_0x3cfa4){if(_0x3cfa4){_0x522993[_0x4c8b('0x46')]=_['keys'](db['Disposition'][_0x4c8b('0x43')]);_0x522993[_0x4c8b('0x47')]=_['keys'](_0x38d446['query']);_0x522993[_0x4c8b('0x49')]=_[_0x4c8b('0x4a')](_0x522993[_0x4c8b('0x46')],_0x522993['query']);_0x4ba111['attributes']=_['intersection'](_0x522993[_0x4c8b('0x46')],qs['fields'](_0x38d446[_0x4c8b('0x47')]['fields']));_0x4ba111['attributes']=_0x4ba111[_0x4c8b('0x4b')]['length']?_0x4ba111[_0x4c8b('0x4b')]:_0x522993[_0x4c8b('0x46')];if(!_0x38d446[_0x4c8b('0x47')]['hasOwnProperty'](_0x4c8b('0x68'))){_0x4ba111[_0x4c8b('0x30')]=qs['limit'](_0x38d446[_0x4c8b('0x47')][_0x4c8b('0x30')]);_0x4ba111[_0x4c8b('0x2f')]=qs[_0x4c8b('0x2f')](_0x38d446[_0x4c8b('0x47')][_0x4c8b('0x2f')]);}_0x4ba111[_0x4c8b('0x4e')]=qs['sort'](_0x38d446['query'][_0x4c8b('0x4f')]);_0x4ba111[_0x4c8b('0x51')]=qs['filters'](_[_0x4c8b('0x69')](_0x38d446[_0x4c8b('0x47')],_0x522993[_0x4c8b('0x49')]));_0x4ba111[_0x4c8b('0x51')][_0x4c8b('0x65')]=_0x3cfa4['id'];if(_0x38d446[_0x4c8b('0x47')][_0x4c8b('0x50')]){_0x4ba111[_0x4c8b('0x51')]=_[_0x4c8b('0x52')](_0x4ba111[_0x4c8b('0x51')],{'$or':_[_0x4c8b('0x41')](_0x4ba111[_0x4c8b('0x4b')],function(_0x210b43){var _0x307f79={};_0x307f79[_0x210b43]={'$like':'%'+_0x38d446['query'][_0x4c8b('0x50')]+'%'};return _0x307f79;})});}_0x4ba111=_[_0x4c8b('0x52')]({},_0x4ba111,_0x38d446[_0x4c8b('0x54')]);return db[_0x4c8b('0x66')]['count']({'where':_0x4ba111[_0x4c8b('0x51')]})[_0x4c8b('0x21')](function(_0x41274d){_0x15dc29['count']=_0x41274d;if(_0x38d446['query'][_0x4c8b('0x55')]){_0x4ba111[_0x4c8b('0x56')]=[{'all':!![]}];}return db[_0x4c8b('0x66')]['findAll'](_0x4ba111);})['then'](function(_0x34447f){_0x15dc29['rows']=_0x34447f;return _0x15dc29;});}})[_0x4c8b('0x21')](respondWithFilteredResult(_0x4e228e,_0x4ba111))[_0x4c8b('0x2b')](handleError(_0x4e228e,null));};exports[_0x4c8b('0x6a')]=function(_0x1a3df4,_0x3e515a,_0x5deb51){return db[_0x4c8b('0x42')][_0x4c8b('0x5e')]({'where':{'id':_0x1a3df4[_0x4c8b('0x62')]['id']}})['then'](handleEntityNotFound(_0x3e515a,null))['then'](function(_0x4d4a95){if(_0x4d4a95){return _0x4d4a95['removeDispositions'](_0x1a3df4[_0x4c8b('0x47')][_0x4c8b('0x6b')]);}})['then'](respondWithStatusCode(_0x3e515a,null))[_0x4c8b('0x2b')](handleError(_0x3e515a,null));};exports[_0x4c8b('0x6c')]=function(_0x62d1e8,_0x212300,_0x1fee33){if(_0x62d1e8['body']['id']){delete _0x62d1e8[_0x4c8b('0x5b')]['id'];}return db[_0x4c8b('0x42')]['find']({'where':{'id':_0x62d1e8[_0x4c8b('0x62')]['id']}})[_0x4c8b('0x21')](handleEntityNotFound(_0x212300,null))['then'](function(_0x9c967d){if(_0x9c967d){_0x62d1e8[_0x4c8b('0x5b')][_0x4c8b('0x65')]=_0x9c967d['id'];return db[_0x4c8b('0x6d')][_0x4c8b('0x5a')](_0x62d1e8[_0x4c8b('0x5b')]);}})['then'](respondWithResult(_0x212300,null))['catch'](handleError(_0x212300,null));};exports[_0x4c8b('0x6e')]=function(_0x1b08af,_0x578f60,_0x20be07){var _0x2ebd57={'raw':![],'where':{}};var _0x4b288a={};var _0xff7834={'count':0x0,'rows':[]};return db[_0x4c8b('0x42')][_0x4c8b('0x67')]({'where':{'id':_0x1b08af['params']['id']}})[_0x4c8b('0x21')](handleEntityNotFound(_0x578f60,null))[_0x4c8b('0x21')](function(_0x389612){if(_0x389612){_0x4b288a[_0x4c8b('0x46')]=_[_0x4c8b('0x48')](db[_0x4c8b('0x6d')]['rawAttributes']);_0x4b288a[_0x4c8b('0x47')]=_['keys'](_0x1b08af[_0x4c8b('0x47')]);_0x4b288a[_0x4c8b('0x49')]=_['intersection'](_0x4b288a[_0x4c8b('0x46')],_0x4b288a[_0x4c8b('0x47')]);_0x2ebd57[_0x4c8b('0x4b')]=_[_0x4c8b('0x4a')](_0x4b288a[_0x4c8b('0x46')],qs[_0x4c8b('0x4c')](_0x1b08af[_0x4c8b('0x47')][_0x4c8b('0x4c')]));_0x2ebd57[_0x4c8b('0x4b')]=_0x2ebd57['attributes']['length']?_0x2ebd57[_0x4c8b('0x4b')]:_0x4b288a[_0x4c8b('0x46')];if(!_0x1b08af[_0x4c8b('0x47')][_0x4c8b('0x6f')](_0x4c8b('0x68'))){_0x2ebd57[_0x4c8b('0x30')]=qs[_0x4c8b('0x30')](_0x1b08af['query']['limit']);_0x2ebd57[_0x4c8b('0x2f')]=qs[_0x4c8b('0x2f')](_0x1b08af[_0x4c8b('0x47')][_0x4c8b('0x2f')]);}_0x2ebd57[_0x4c8b('0x4e')]=qs[_0x4c8b('0x4f')](_0x1b08af[_0x4c8b('0x47')][_0x4c8b('0x4f')]);_0x2ebd57['where']=qs[_0x4c8b('0x49')](_[_0x4c8b('0x69')](_0x1b08af['query'],_0x4b288a[_0x4c8b('0x49')]));_0x2ebd57[_0x4c8b('0x51')][_0x4c8b('0x65')]=_0x389612['id'];if(_0x1b08af[_0x4c8b('0x47')][_0x4c8b('0x50')]){_0x2ebd57[_0x4c8b('0x51')]=_['merge'](_0x2ebd57[_0x4c8b('0x51')],{'$or':_['map'](_0x2ebd57[_0x4c8b('0x4b')],function(_0x2b0163){var _0x4ccf97={};_0x4ccf97[_0x2b0163]={'$like':'%'+_0x1b08af['query'][_0x4c8b('0x50')]+'%'};return _0x4ccf97;})});}_0x2ebd57=_[_0x4c8b('0x52')]({},_0x2ebd57,_0x1b08af[_0x4c8b('0x54')]);return db['CannedAnswer']['count']({'where':_0x2ebd57[_0x4c8b('0x51')]})[_0x4c8b('0x21')](function(_0x235dc2){_0xff7834['count']=_0x235dc2;if(_0x1b08af[_0x4c8b('0x47')]['includeAll']){_0x2ebd57[_0x4c8b('0x56')]=[{'all':!![]}];}return db[_0x4c8b('0x6d')][_0x4c8b('0x57')](_0x2ebd57);})[_0x4c8b('0x21')](function(_0x2a4c3b){_0xff7834[_0x4c8b('0x58')]=_0x2a4c3b;return _0xff7834;});}})[_0x4c8b('0x21')](respondWithFilteredResult(_0x578f60,_0x2ebd57))[_0x4c8b('0x2b')](handleError(_0x578f60,null));};exports[_0x4c8b('0x70')]=function(_0x2fae97,_0x5d16e1,_0x2ae905){return db[_0x4c8b('0x42')][_0x4c8b('0x5e')]({'where':{'id':_0x2fae97[_0x4c8b('0x62')]['id']}})[_0x4c8b('0x21')](handleEntityNotFound(_0x5d16e1,null))[_0x4c8b('0x21')](function(_0x2a8849){if(_0x2a8849){return _0x2a8849['removeAnswers'](_0x2fae97[_0x4c8b('0x47')][_0x4c8b('0x6b')]);}})[_0x4c8b('0x21')](respondWithStatusCode(_0x5d16e1,null))[_0x4c8b('0x2b')](handleError(_0x5d16e1,null));};exports[_0x4c8b('0x71')]=function(_0x950d02,_0x5a2baa,_0x262411){var _0x54c3c9={'channel':'sms'};var _0x385964=[];var _0x39465c=[];var _0x4bf10d={};return db[_0x4c8b('0x42')][_0x4c8b('0x5e')]({'where':{'id':_0x950d02[_0x4c8b('0x62')]['id']},'include':[{'model':db[_0x4c8b('0x72')],'as':_0x4c8b('0x73')}]})[_0x4c8b('0x21')](handleEntityNotFound(_0x5a2baa,null))[_0x4c8b('0x21')](function(_0xa22020){_0x54c3c9[_0x4c8b('0x74')]=_0xa22020;_0x54c3c9['applications']=_[_0x4c8b('0x75')](_0xa22020[_0x4c8b('0x73')],[_0x4c8b('0x76')],[_0x4c8b('0x77')]);if(_0x54c3c9[_0x4c8b('0x74')]['Applications']){delete _0x54c3c9[_0x4c8b('0x74')][_0x4c8b('0x73')];}return db[_0x4c8b('0x78')][_0x4c8b('0x63')]();})['then'](function(_0x5a6110){if(!_0x5a6110){throw new db[(_0x4c8b('0x79'))][(_0x4c8b('0x7a'))](_0x4c8b('0x7b'));}_0x385964=_[_0x4c8b('0x7c')](_[_0x4c8b('0x48')](_0x5a6110),[_0x4c8b('0x7d'),_0x4c8b('0x7e')]);_0x39465c=_[_0x4c8b('0x7c')](_['keys'](_0x5a6110),[_0x4c8b('0x7d'),_0x4c8b('0x7e'),_0x4c8b('0x7f'),_0x4c8b('0x80')]);_0x54c3c9[_0x4c8b('0x5b')]={'mapKey':_0x4c8b('0x81')};if(_0x54c3c9['account'][_0x4c8b('0x44')]){switch(_0x54c3c9[_0x4c8b('0x74')][_0x4c8b('0x44')]){case _0x4c8b('0x82'):_0x54c3c9['body'][_0x4c8b('0x83')]=_0x950d02[_0x4c8b('0x5b')][_0x4c8b('0x84')];_0x54c3c9[_0x4c8b('0x5b')]['body']=_0x950d02[_0x4c8b('0x5b')]['Body'];_0x54c3c9[_0x4c8b('0x5b')]['messageId']=_0x950d02[_0x4c8b('0x5b')][_0x4c8b('0x85')];break;case'skebby':_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x83')]='+'+_0x950d02[_0x4c8b('0x5b')][_0x4c8b('0x86')];_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x5b')]=_0x950d02[_0x4c8b('0x5b')][_0x4c8b('0x87')];break;case'connectel':_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x83')]=_0x950d02[_0x4c8b('0x5b')][_0x4c8b('0x83')];_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x5b')]=_0x950d02[_0x4c8b('0x5b')][_0x4c8b('0x29')];break;case'clicksend':_0x54c3c9['body'][_0x4c8b('0x83')]=_0x950d02[_0x4c8b('0x5b')][_0x4c8b('0x83')];_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x5b')]=_0x950d02[_0x4c8b('0x5b')][_0x4c8b('0x5b')];_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x88')]=_0x950d02[_0x4c8b('0x5b')]['message_id'];break;case _0x4c8b('0x89'):_0x54c3c9['body']['from']=_0x950d02[_0x4c8b('0x5b')][_0x4c8b('0x84')];_0x54c3c9[_0x4c8b('0x5b')]['body']=_0x950d02['body'][_0x4c8b('0x8a')];_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x88')]=_0x950d02['body']['MessageUUID'];break;case _0x4c8b('0x8b'):_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x83')]='+'+_0x950d02[_0x4c8b('0x5b')][_0x4c8b('0x8c')][0x0][_0x4c8b('0x83')];_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x5b')]=_0x950d02[_0x4c8b('0x5b')]['results'][0x0][_0x4c8b('0x87')];_0x54c3c9['body'][_0x4c8b('0x88')]=_0x950d02[_0x4c8b('0x5b')]['results'][0x0][_0x4c8b('0x88')];break;case _0x4c8b('0x8d'):_0x54c3c9['body'][_0x4c8b('0x83')]=_0x950d02[_0x4c8b('0x5b')][_0x4c8b('0x8e')];_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x5b')]=_0x950d02['body']['segmentedMessage'][_0x4c8b('0x29')];break;case _0x4c8b('0x8f'):_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x83')]=_0x950d02[_0x4c8b('0x5b')][_0x4c8b('0x90')];_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x5b')]=_0x950d02[_0x4c8b('0x5b')][_0x4c8b('0x87')];_0x54c3c9[_0x4c8b('0x5b')]['messageId']=_0x950d02['body'][_0x4c8b('0x91')];break;case _0x4c8b('0x92'):_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x88')]=_0x950d02[_0x4c8b('0x5b')][0x0][_0x4c8b('0x29')]['id'];_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x83')]=_0x950d02[_0x4c8b('0x5b')][0x0]['message']['from'];_0x54c3c9[_0x4c8b('0x5b')]['body']=_0x950d02[_0x4c8b('0x5b')][0x0][_0x4c8b('0x29')][_0x4c8b('0x87')];break;case _0x4c8b('0x93'):_0x54c3c9['body']['from']=_0x950d02[_0x4c8b('0x5b')][_0x4c8b('0x83')];_0x54c3c9['body'][_0x4c8b('0x5b')]=_0x950d02[_0x4c8b('0x5b')][_0x4c8b('0x29')];_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x88')]=_0x950d02['body']['refid'];break;}}if(_0x54c3c9[_0x4c8b('0x5b')]['id']){delete _0x54c3c9['body']['id'];}if(_[_0x4c8b('0x94')](_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x83')])){throw new db[(_0x4c8b('0x79'))][(_0x4c8b('0x7a'))](_0x4c8b('0x95'));}if(_[_0x4c8b('0x94')](_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x5b')])||_0x54c3c9[_0x4c8b('0x5b')]['body']===''){throw new db[(_0x4c8b('0x79'))][(_0x4c8b('0x7a'))](_0x4c8b('0x96'));}if(_[_0x4c8b('0x94')](_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x97')])){throw new db['Sequelize'][(_0x4c8b('0x7a'))](_0x4c8b('0x98')+_0x39465c);}if(!_[_0x4c8b('0x99')](_0x39465c,_0x54c3c9['body'][_0x4c8b('0x97')])){throw new db['Sequelize']['ValidationError'](_0x4c8b('0x9a')+_0x39465c);}_0x4bf10d[_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x97')]]=_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x83')];return db[_0x4c8b('0x9b')][_0x4c8b('0x5e')]({'where':{'id':_0x54c3c9[_0x4c8b('0x74')][_0x4c8b('0x80')]},'include':[{'model':db[_0x4c8b('0x78')],'as':_0x4c8b('0x9c'),'where':_0x4bf10d,'limit':0x1,'order':[['updatedAt',_0x4c8b('0x9d')]]}]});})[_0x4c8b('0x21')](handleEntityNotFound(_0x5a2baa,null))[_0x4c8b('0x21')](function(_0x511306){if(_0x511306){_0x54c3c9[_0x4c8b('0x9e')]=_[_0x4c8b('0x9f')](_0x511306,['Contacts']);if(_0x511306['Contacts'][_0x4c8b('0x4d')]){return _0x511306[_0x4c8b('0x9c')][0x0];}var _0x15024f=_[_0x4c8b('0xa0')](_0x54c3c9[_0x4c8b('0x5b')],{'firstName':_0x54c3c9[_0x4c8b('0x5b')]['from'],'ListId':_0x511306['id']});_0x15024f[_0x54c3c9[_0x4c8b('0x5b')]['mapKey']]=_0x54c3c9['body'][_0x4c8b('0x83')];return db[_0x4c8b('0x78')][_0x4c8b('0x5a')](_0x15024f,{'fields':_0x385964,'raw':!![]});}})[_0x4c8b('0x21')](handleEntityNotFound(_0x5a2baa,null))[_0x4c8b('0x21')](function(_0x23a59b){if(_0x23a59b){_0x54c3c9[_0x4c8b('0xa1')]=_0x23a59b;var _0x51cbdf={'ContactId':_0x23a59b['id'],'phone':_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x83')],'SmsAccountId':_0x950d02[_0x4c8b('0x62')]['id']};var _0x264c82={'ContactId':_0x23a59b['id'],'SmsAccountId':_0x950d02[_0x4c8b('0x62')]['id'],'closed':![]};return db[_0x4c8b('0xa2')]['find']({'where':_0x264c82})[_0x4c8b('0x21')](function(_0x5812ff){if(_0x5812ff){return[_0x5812ff,![]];}return db[_0x4c8b('0xa2')][_0x4c8b('0x5a')](_0x51cbdf)[_0x4c8b('0x21')](function(_0x427d55){return[_0x427d55,!![]];});});}})[_0x4c8b('0xa3')](function(_0x42d5f6,_0x5b17ca){_0x54c3c9[_0x4c8b('0xa4')]=_0x42d5f6[_0x4c8b('0x39')]({'plain':!![]});_0x54c3c9[_0x4c8b('0xa4')][_0x4c8b('0xa5')]=![];if(_0x5b17ca){if(_0x54c3c9[_0x4c8b('0x74')][_0x4c8b('0xa6')]){_0x54c3c9['applications']['push']({'id':0x0,'priority':_0x54c3c9[_0x4c8b('0xa7')][_0x4c8b('0x4d')]+0x1,'app':_0x4c8b('0xa8'),'appdata':_0x4c8b('0xa9'),'interval':_0x4c8b('0xaa')});}_0x54c3c9[_0x4c8b('0xa4')]['created']=!![];}return db[_0x4c8b('0xab')][_0x4c8b('0x5a')]({'phone':_0x54c3c9['body'][_0x4c8b('0x83')],'messageId':_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x88')],'body':_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0x5b')],'SmsAccountId':_0x950d02['params']['id'],'SmsInteractionId':_0x42d5f6['id'],'direction':'in','ContactId':_0x42d5f6[_0x4c8b('0xac')],'AttachmentId':_0x54c3c9[_0x4c8b('0x5b')][_0x4c8b('0xad')]});})[_0x4c8b('0x21')](function(_0x585421){_0x54c3c9[_0x4c8b('0x29')]=_0x585421;if(!_0x54c3c9[_0x4c8b('0xa4')]['UserId'])return;return db[_0x4c8b('0xae')]['find']({'attributes':['id',_0x4c8b('0x3c')],'where':{'id':_0x54c3c9['interaction'][_0x4c8b('0xaf')]}});})[_0x4c8b('0x21')](function(_0x290f4c){if(_0x290f4c){_0x54c3c9[_0x4c8b('0xa7')][_0x4c8b('0xb0')]({'id':0x0,'priority':0x0,'app':_0x4c8b('0xb1'),'appdata':_0x290f4c[_0x4c8b('0x3c')]+','+(_0x54c3c9[_0x4c8b('0x74')][_0x4c8b('0xb2')]||0xa),'interval':'*,*,*,*'});}if(!_0x54c3c9[_0x4c8b('0xa4')][_0x4c8b('0xb3')])return;return db[_0x4c8b('0xb4')][_0x4c8b('0x5e')]({'attributes':['id',_0x4c8b('0x3c')],'where':{'id':_0x54c3c9[_0x4c8b('0xa4')]['queueId']}});})['then'](function(_0x427018){if(_0x427018){_0x54c3c9[_0x4c8b('0xa7')][_0x4c8b('0xb0')]({'id':0x0,'priority':0x1,'app':_0x4c8b('0xb5'),'appdata':_0x427018[_0x4c8b('0x3c')]+','+(_0x54c3c9['account'][_0x4c8b('0xb6')]||0x12c),'interval':_0x4c8b('0xaa')});}return respondWithRpcPromise(_0x4c8b('0xb7'),_0x4c8b('0xb8'),_0x54c3c9);})[_0x4c8b('0x21')](function(_0x529057){if(_0x529057){var _0x320603=0xc8;var _0x42a9a0=_0x4c8b('0xb9');logger[_0x4c8b('0x22')](_0x4c8b('0x24'),_0x42a9a0,_0x320603,_0x4c8b('0xba'));logger[_0x4c8b('0xbb')](_0x4c8b('0xbc'),_0x42a9a0,_0x320603,'entity\x20found',JSON['stringify'](_0x529057));if(_0x54c3c9['account'][_0x4c8b('0x44')]===_0x4c8b('0x82')){return _0x5a2baa[_0x4c8b('0x2d')](_0x320603)[_0x4c8b('0x32')](_0x4c8b('0xbd'),_0x4c8b('0xbe'))[_0x4c8b('0x3d')](_0x4c8b('0xbf'));}else{return _0x5a2baa['status'](_0x320603)[_0x4c8b('0x34')](_0x529057);}}})[_0x4c8b('0x2b')](handleError(_0x5a2baa,null));};exports[_0x4c8b('0xc0')]=function(_0x18725b,_0x58d217){var _0x2676d9=_0x18725b['params']['id'];var _0x3b6250=_0x18725b[_0x4c8b('0x5b')];var _0x5aa561=0xc8;var _0x177e60=null;return db[_0x4c8b('0xc1')][_0x4c8b('0xc2')]({'isolationLevel':db['sequelize']['Transaction'][_0x4c8b('0xc3')][_0x4c8b('0xc4')]},function(_0x287f0b){return db[_0x4c8b('0x42')][_0x4c8b('0x67')]({'where':{'id':_0x2676d9},'transaction':_0x287f0b})[_0x4c8b('0x21')](function(_0x391372){if(_0x391372){return db[_0x4c8b('0x72')]['destroy']({'where':{'SmsAccountId':_0x2676d9},'transaction':_0x287f0b})['then'](function(){var _0x5c5960=_[_0x4c8b('0x41')](_0x3b6250,function(_0x5a26b5){_0x5a26b5[_0x4c8b('0x65')]=_0x2676d9;return _0x5a26b5;});return db[_0x4c8b('0x72')][_0x4c8b('0xc5')](_0x5c5960,{'transaction':_0x287f0b});});}else{_0x5aa561=0x194;_0x177e60=[];}});})[_0x4c8b('0x21')](function(){if(_0x5aa561!==0x194){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x2676d9},'order':_0x4c8b('0x76')})[_0x4c8b('0x21')](function(_0x63646d){_0x177e60=_0x63646d;});}})[_0x4c8b('0x2b')](function(_0x2ef2e4){_0x5aa561=0x1f4;logger[_0x4c8b('0x27')](_0x2ef2e4[_0x4c8b('0xc6')]);if(_0x2ef2e4[_0x4c8b('0x3c')]){delete _0x2ef2e4[_0x4c8b('0x3c')];}_0x177e60=_0x2ef2e4;})[_0x4c8b('0xc7')](function(){if(_0x177e60===null){_0x58d217[_0x4c8b('0x2c')](_0x5aa561);}else{if(_0x5aa561===0x1f4){_0x58d217[_0x4c8b('0x2d')](_0x5aa561)['send'](_0x177e60);}else{_0x58d217[_0x4c8b('0x2d')](_0x5aa561)[_0x4c8b('0x34')](_0x177e60);}}});};exports[_0x4c8b('0xc8')]=function(_0x4b35e2,_0xa82b23,_0x44fe7f){var _0x34ff8a={};var _0x14c651={};var _0x3f3681;var _0x1b9348;return db['SmsAccount'][_0x4c8b('0x67')]({'where':{'id':_0x4b35e2[_0x4c8b('0x62')]['id']}})[_0x4c8b('0x21')](handleEntityNotFound(_0xa82b23,null))[_0x4c8b('0x21')](function(_0x1fee49){if(_0x1fee49){_0x3f3681=_0x1fee49;_0x14c651[_0x4c8b('0x46')]=_[_0x4c8b('0x48')](db[_0x4c8b('0x72')]['rawAttributes']);_0x14c651[_0x4c8b('0x47')]=_[_0x4c8b('0x48')](_0x4b35e2[_0x4c8b('0x47')]);_0x14c651[_0x4c8b('0x49')]=_[_0x4c8b('0x4a')](_0x14c651[_0x4c8b('0x46')],_0x14c651[_0x4c8b('0x47')]);_0x34ff8a['attributes']=_[_0x4c8b('0x4a')](_0x14c651[_0x4c8b('0x46')],qs[_0x4c8b('0x4c')](_0x4b35e2[_0x4c8b('0x47')][_0x4c8b('0x4c')]));_0x34ff8a[_0x4c8b('0x4b')]=_0x34ff8a[_0x4c8b('0x4b')][_0x4c8b('0x4d')]?_0x34ff8a[_0x4c8b('0x4b')]:_0x14c651['model'];_0x34ff8a['order']=qs[_0x4c8b('0x4f')](_0x4b35e2[_0x4c8b('0x47')]['sort']);_0x34ff8a[_0x4c8b('0x51')]=qs['filters'](_['pick'](_0x4b35e2[_0x4c8b('0x47')],_0x14c651['filters']));if(_0x4b35e2[_0x4c8b('0x47')]['filter']){_0x34ff8a[_0x4c8b('0x51')]=_[_0x4c8b('0x52')](_0x34ff8a[_0x4c8b('0x51')],{'$or':_[_0x4c8b('0x41')](_0x34ff8a[_0x4c8b('0x4b')],function(_0xaf268c){var _0x515c31={};_0x515c31[_0xaf268c]={'$like':'%'+_0x4b35e2['query']['filter']+'%'};return _0x515c31;})});}_0x34ff8a=_[_0x4c8b('0x52')]({},_0x34ff8a,_0x4b35e2[_0x4c8b('0x54')]);return _0x3f3681[_0x4c8b('0xc8')](_0x34ff8a);}})[_0x4c8b('0x21')](function(_0x270595){if(_0x270595){_0x1b9348=_0x270595[_0x4c8b('0x4d')];if(!_0x4b35e2[_0x4c8b('0x47')][_0x4c8b('0x6f')](_0x4c8b('0x68'))){_0x34ff8a[_0x4c8b('0x30')]=qs[_0x4c8b('0x30')](_0x4b35e2['query'][_0x4c8b('0x30')]);_0x34ff8a[_0x4c8b('0x2f')]=qs[_0x4c8b('0x2f')](_0x4b35e2[_0x4c8b('0x47')][_0x4c8b('0x2f')]);}return _0x3f3681['getApplications'](_0x34ff8a);}})[_0x4c8b('0x21')](function(_0x2abdf2){if(_0x2abdf2){return _0x2abdf2?{'count':_0x1b9348,'rows':_0x2abdf2}:null;}})['then'](respondWithResult(_0xa82b23,null))[_0x4c8b('0x2b')](handleError(_0xa82b23,null));};exports[_0x4c8b('0xc9')]=function(_0x310b1d,_0x47ea3b,_0x310616){var _0x388620={'raw':![],'where':{}};var _0x5be0dc={};var _0x4b10aa={'count':0x0,'rows':[]};return db['SmsAccount'][_0x4c8b('0x67')]({'where':{'id':_0x310b1d[_0x4c8b('0x62')]['id']}})[_0x4c8b('0x21')](handleEntityNotFound(_0x47ea3b,null))['then'](function(_0x1ff7d1){if(_0x1ff7d1){_0x5be0dc[_0x4c8b('0x46')]=_[_0x4c8b('0x48')](db[_0x4c8b('0xa2')]['rawAttributes']);_0x5be0dc[_0x4c8b('0x47')]=_[_0x4c8b('0x48')](_0x310b1d['query']);_0x5be0dc[_0x4c8b('0x49')]=_[_0x4c8b('0x4a')](_0x5be0dc['model'],_0x5be0dc[_0x4c8b('0x47')]);_0x388620[_0x4c8b('0x4b')]=_[_0x4c8b('0x4a')](_0x5be0dc[_0x4c8b('0x46')],qs[_0x4c8b('0x4c')](_0x310b1d[_0x4c8b('0x47')][_0x4c8b('0x4c')]));_0x388620[_0x4c8b('0x4b')]=_0x388620[_0x4c8b('0x4b')][_0x4c8b('0x4d')]?_0x388620['attributes']:_0x5be0dc[_0x4c8b('0x46')];if(!_0x310b1d[_0x4c8b('0x47')][_0x4c8b('0x6f')](_0x4c8b('0x68'))){_0x388620[_0x4c8b('0x30')]=qs[_0x4c8b('0x30')](_0x310b1d[_0x4c8b('0x47')][_0x4c8b('0x30')]);_0x388620[_0x4c8b('0x2f')]=qs['offset'](_0x310b1d['query'][_0x4c8b('0x2f')]);}_0x388620[_0x4c8b('0x4e')]=qs['sort'](_0x310b1d[_0x4c8b('0x47')][_0x4c8b('0x4f')]);_0x388620[_0x4c8b('0x51')]=qs[_0x4c8b('0x49')](_[_0x4c8b('0x69')](_0x310b1d[_0x4c8b('0x47')],_0x5be0dc[_0x4c8b('0x49')]));_0x388620[_0x4c8b('0x51')][_0x4c8b('0x65')]=_0x1ff7d1['id'];if(_0x310b1d['query']['filter']){_0x388620['where']=_[_0x4c8b('0x52')](_0x388620[_0x4c8b('0x51')],{'$or':_['map'](_0x388620[_0x4c8b('0x4b')],function(_0x4a2ee1){var _0x2212a3={};_0x2212a3[_0x4a2ee1]={'$like':'%'+_0x310b1d['query'][_0x4c8b('0x50')]+'%'};return _0x2212a3;})});}_0x388620=_['merge']({},_0x388620,_0x310b1d[_0x4c8b('0x54')]);return db[_0x4c8b('0xa2')]['count']({'where':_0x388620[_0x4c8b('0x51')]})['then'](function(_0x1d189a){_0x4b10aa[_0x4c8b('0x31')]=_0x1d189a;if(_0x310b1d[_0x4c8b('0x47')][_0x4c8b('0x55')]){_0x388620[_0x4c8b('0x56')]=[{'model':db['CmContact'],'as':_0x4c8b('0xca'),'required':![]},{'model':db[_0x4c8b('0xae')],'as':_0x4c8b('0xcb'),'attributes':[_0x4c8b('0x3c'),_0x4c8b('0xcc'),_0x4c8b('0xcd')],'required':![]},{'model':db[_0x4c8b('0xce')],'as':_0x4c8b('0xcf'),'attributes':['id','name',_0x4c8b('0xd0')],'where':_0x310b1d[_0x4c8b('0x47')][_0x4c8b('0xd1')]?{'id':_0x310b1d[_0x4c8b('0x47')][_0x4c8b('0xd1')]}:undefined,'required':_0x310b1d[_0x4c8b('0x47')]['tag']?!![]:![]}];}return db[_0x4c8b('0xa2')][_0x4c8b('0x57')](_0x388620);})['then'](function(_0x129bee){_0x4b10aa[_0x4c8b('0x58')]=_0x129bee;return _0x4b10aa;});}})[_0x4c8b('0x21')](respondWithFilteredResult(_0x47ea3b,_0x388620))[_0x4c8b('0x2b')](handleError(_0x47ea3b,null));};exports[_0x4c8b('0x3d')]=function(_0x29e72d,_0x57b6d3,_0x234c8e){var _0x5481e5,_0x4b4c95,_0x5e940c;if(_[_0x4c8b('0x94')](_0x29e72d[_0x4c8b('0x5b')]['body'])||_0x29e72d[_0x4c8b('0x5b')][_0x4c8b('0x5b')]===''){throw new db[(_0x4c8b('0x79'))][(_0x4c8b('0x7a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4c8b('0x94')](_0x29e72d[_0x4c8b('0x5b')]['to'])){throw new db[(_0x4c8b('0x79'))][(_0x4c8b('0x7a'))](_0x4c8b('0xd2'));}_0x5481e5=_0x29e72d[_0x4c8b('0x5b')]['to'];return db[_0x4c8b('0x42')][_0x4c8b('0x5e')]({'where':{'id':_0x29e72d['params']['id']},'include':[{'model':db[_0x4c8b('0x9b')],'as':'List','include':[{'model':db['CmContact'],'as':_0x4c8b('0x9c'),'where':{'mobile':_0x5481e5},'limit':0x1,'order':[['updatedAt',_0x4c8b('0x9d')]]}]}]})[_0x4c8b('0x21')](handleEntityNotFound(_0x57b6d3,null))[_0x4c8b('0x21')](function(_0x28149a){if(_0x28149a&&_0x28149a[_0x4c8b('0xd3')]){_0x4b4c95=_0x28149a[_0x4c8b('0x39')]({'plain':!![]});if(_0x4b4c95['List']&&_0x4b4c95[_0x4c8b('0xd3')][_0x4c8b('0x9c')][_0x4c8b('0x4d')]){return _0x4b4c95[_0x4c8b('0xd3')][_0x4c8b('0x9c')][0x0];}return db[_0x4c8b('0x78')]['create'](_[_0x4c8b('0xa0')](_0x29e72d[_0x4c8b('0x5b')],{'firstName':_0x5481e5,'mobile':_0x5481e5,'phone':_0x5481e5,'ListId':_0x4b4c95[_0x4c8b('0x80')]}));}})[_0x4c8b('0x21')](handleEntityNotFound(_0x57b6d3,null))[_0x4c8b('0x21')](function(_0x52466c){if(_0x52466c){_0x5e940c=_0x52466c;return db['SmsInteraction'][_0x4c8b('0x5e')]({'where':{'ContactId':_0x5e940c['id'],'closed':![],'SmsAccountId':_0x4b4c95['id']}})[_0x4c8b('0x21')](function(_0xed0303){if(_0xed0303){return[_0xed0303,![]];}return db[_0x4c8b('0xa2')][_0x4c8b('0x5a')]({'UserId':_0x29e72d[_0x4c8b('0x5c')]['id'],'ContactId':_0x5e940c['id'],'SmsAccountId':_0x4b4c95['id'],'phone':_0x5481e5,'firstMsgDirection':'out','Messages':[_['merge'](_0x29e72d[_0x4c8b('0x5b')],{'read':![],'body':_0x29e72d[_0x4c8b('0x5b')][_0x4c8b('0x5b')],'phone':_0x5481e5,'SmsAccountId':_0x4b4c95['id'],'UserId':_0x29e72d[_0x4c8b('0x5c')]['id'],'ContactId':_0x5e940c['id']})]},{'include':[{'model':db[_0x4c8b('0xab')],'as':_0x4c8b('0xd4')}]})[_0x4c8b('0x21')](function(_0x4281d4){return[_0x4281d4,!![]];});});}})[_0x4c8b('0xa3')](function(_0xc68fd5,_0x2defac){if(_0x2defac){return _0xc68fd5;}return db[_0x4c8b('0xab')][_0x4c8b('0x5a')](_[_0x4c8b('0x52')](_0x29e72d[_0x4c8b('0x5b')],{'read':![],'body':_0x29e72d[_0x4c8b('0x5b')]['body'],'phone':_0x5481e5,'SmsAccountId':_0x4b4c95['id'],'SmsInteractionId':_0xc68fd5['id'],'UserId':_0x29e72d['user']['id'],'ContactId':_0x5e940c['id']}))[_0x4c8b('0x21')](function(_0xe4ab19){_0xc68fd5[_0x4c8b('0xd5')][_0x4c8b('0xd4')]=[];_0xc68fd5[_0x4c8b('0xd5')][_0x4c8b('0xd4')][_0x4c8b('0xd6')](_0xe4ab19[_0x4c8b('0xd5')]);return _0xc68fd5;});})[_0x4c8b('0x21')](respondWithResult(_0x57b6d3,null))['catch'](handleError(_0x57b6d3,null));};exports[_0x4c8b('0x2d')]=function(_0x2abf54,_0x5cff43,_0x21b51c){if(_0x2abf54[_0x4c8b('0x5b')]['id']){delete _0x2abf54[_0x4c8b('0x5b')]['id'];}var _0x3e85bb,_0x220376,_0x1baed1;return db[_0x4c8b('0x42')][_0x4c8b('0x5e')]({'where':{'id':_0x2abf54['params']['id']}})['then'](handleEntityNotFound(_0x5cff43,null))[_0x4c8b('0x21')](function(_0x5bf2c1){if(_0x5bf2c1){_0x1baed1=_0x5bf2c1;logger['debug'](_0x4c8b('0x24'),_0x4c8b('0x2d'),_0x4c8b('0xd7'),_0x5bf2c1['type'],util['inspect'](_0x2abf54[_0x4c8b('0x5b')],{'showHidden':![],'depth':null}));switch(_0x5bf2c1[_0x4c8b('0x44')]){case'skebby':if(_0x2abf54[_0x4c8b('0x5b')][_0x4c8b('0xd8')]&&_0x2abf54[_0x4c8b('0x5b')][_0x4c8b('0x2d')]){_0x220376=_0x2abf54[_0x4c8b('0x5b')][_0x4c8b('0x2d')];return db[_0x4c8b('0xab')][_0x4c8b('0x5e')]({'where':{'messageId':_0x2abf54[_0x4c8b('0x5b')][_0x4c8b('0xd8')]}});}break;case _0x4c8b('0xd9'):if(_0x2abf54[_0x4c8b('0x5b')][_0x4c8b('0xda')]&&_0x2abf54[_0x4c8b('0x5b')][_0x4c8b('0xdb')]){_0x220376=_0x2abf54[_0x4c8b('0x5b')][_0x4c8b('0xdb')];return db[_0x4c8b('0xab')]['find']({'where':{'messageId':_0x2abf54['body'][_0x4c8b('0xda')]}});}break;case'clicksend':if(_0x2abf54[_0x4c8b('0x5b')][_0x4c8b('0xdc')]&&_0x2abf54[_0x4c8b('0x5b')][_0x4c8b('0xdd')]){_0x220376=_0x2abf54[_0x4c8b('0x5b')][_0x4c8b('0xdd')];return db[_0x4c8b('0xab')][_0x4c8b('0x5e')]({'where':{'messageId':_0x2abf54[_0x4c8b('0x5b')]['message_id']}});}break;case _0x4c8b('0x8b'):var _0x56ba0e=_0x2abf54[_0x4c8b('0x5b')][_0x4c8b('0x8c')][0x0];if(_0x56ba0e[_0x4c8b('0x88')]&&_0x56ba0e['status'][_0x4c8b('0xde')]==='DELIVERED'){_0x220376=_0x56ba0e[_0x4c8b('0x2d')][_0x4c8b('0xde')];return db[_0x4c8b('0xab')][_0x4c8b('0x5e')]({'where':{'messageId':_0x56ba0e[_0x4c8b('0x88')]}});}break;case _0x4c8b('0x8f'):if(_0x2abf54[_0x4c8b('0x5b')]['messageId']&&_0x2abf54[_0x4c8b('0x5b')][_0x4c8b('0x2d')]){_0x220376=_0x2abf54[_0x4c8b('0x5b')][_0x4c8b('0x2d')];return db[_0x4c8b('0xab')][_0x4c8b('0x5e')]({'where':{'messageId':_0x2abf54['body'][_0x4c8b('0x88')]}});}break;case _0x4c8b('0x92'):if(_0x2abf54[_0x4c8b('0x5b')][0x0][_0x4c8b('0x29')]['id']){_0x220376=_0x2abf54[_0x4c8b('0x5b')][0x0][_0x4c8b('0x44')];return db[_0x4c8b('0xab')][_0x4c8b('0x5e')]({'where':{'messageId':_0x2abf54['body'][0x0]['message']['id']}});}break;case _0x4c8b('0x93'):if(_0x2abf54['body']['redif']&&_0x2abf54['body'][_0x4c8b('0x2d')]){_0x220376=_0x2abf54[_0x4c8b('0x5b')][_0x4c8b('0x2d')];return db[_0x4c8b('0xab')][_0x4c8b('0x5e')]({'where':{'messageId':_0x2abf54[_0x4c8b('0x5b')][_0x4c8b('0xdf')]}});}break;}}})['then'](handleEntityNotFound(_0x5cff43,null))['then'](function(_0x303b2a){if(_0x303b2a){_0x3e85bb=_0x303b2a;switch(_0x1baed1[_0x4c8b('0x44')]){case _0x4c8b('0xe0'):if(_0x220376==='DELIVERED'){return _0x3e85bb[_0x4c8b('0x61')]({'read':!![]});}else{logger['error'](_0x4c8b('0x24'),_0x4c8b('0x2d'),'skebby',util['inspect'](_0x2abf54[_0x4c8b('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4c8b('0xd9'):if(_0x220376==='1'){return _0x3e85bb['update']({'read':!![]});}else{logger[_0x4c8b('0x27')](_0x4c8b('0x24'),_0x4c8b('0x2d'),_0x4c8b('0xe0'),util[_0x4c8b('0xe1')](_0x2abf54[_0x4c8b('0x5b')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x2abf54[_0x4c8b('0x5b')]['error_code']&&_0x220376>=0xc8&&_0x220376<=0xce){return _0x3e85bb[_0x4c8b('0x61')]({'read':!![]});}else{logger[_0x4c8b('0x27')](_0x4c8b('0x24'),_0x4c8b('0x2d'),_0x4c8b('0xe2'),util[_0x4c8b('0xe1')](_0x2abf54[_0x4c8b('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4c8b('0x8b'):var _0x11f35e=_0x2abf54[_0x4c8b('0x5b')]['results'][0x0];if(_0x11f35e[_0x4c8b('0x2d')]['groupName']===_0x4c8b('0xe3')){return _0x3e85bb[_0x4c8b('0x61')]({'read':!![]});}else{logger[_0x4c8b('0x27')](_0x4c8b('0x24'),_0x4c8b('0x2d'),_0x4c8b('0x8b'),util[_0x4c8b('0xe1')](_0x2abf54[_0x4c8b('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4c8b('0x8f'):if(_0x220376==_0x4c8b('0xe4')||_0x220376=='RECEIVED_BY_RECIPIENT'){return _0x3e85bb[_0x4c8b('0x61')]({'read':!![]});}else{logger[_0x4c8b('0x27')](_0x4c8b('0x24'),_0x4c8b('0x2d'),_0x4c8b('0x8f'),util[_0x4c8b('0xe1')](_0x2abf54[_0x4c8b('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4c8b('0x92'):if(_0x220376==_0x4c8b('0xe5')){return _0x3e85bb[_0x4c8b('0x61')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4c8b('0x2d'),_0x4c8b('0x92'),util[_0x4c8b('0xe1')](_0x2abf54[_0x4c8b('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4c8b('0x93'):if(_0x220376===_0x4c8b('0xe6')||_0x220376===_0x4c8b('0xe7')){return _0x3e85bb['update']({'read':!![]});}else{logger[_0x4c8b('0x27')](_0x4c8b('0x24'),_0x4c8b('0x2d'),_0x4c8b('0x93'),util[_0x4c8b('0xe1')](_0x2abf54[_0x4c8b('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x3e85bb;}})['then'](respondWithResult(_0x5cff43,null))['catch'](handleError(_0x5cff43,null));};exports[_0x4c8b('0xe8')]=function(_0x2fdaa6,_0x221b64,_0xd5f57c){var _0x5d20aa,_0x1e9122,_0x18f946;return db[_0x4c8b('0x42')][_0x4c8b('0x5e')]({'where':{'id':_0x2fdaa6['params']['id']}})[_0x4c8b('0x21')](handleEntityNotFound(_0x221b64,null))[_0x4c8b('0x21')](function(_0x163325){if(_0x163325){_0x18f946=_0x163325;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4c8b('0x2d'),_0x4c8b('0xd7'),_0x163325[_0x4c8b('0x44')],util['inspect'](_0x2fdaa6['query'],{'showHidden':![],'depth':null}));switch(_0x163325['type']){case'csc':if(_0x2fdaa6[_0x4c8b('0x47')]['message-id']&&_0x2fdaa6[_0x4c8b('0x47')]['state']){_0x1e9122=_0x2fdaa6[_0x4c8b('0x47')]['state'];return db[_0x4c8b('0xab')][_0x4c8b('0x5e')]({'where':{'messageId':_0x2fdaa6['query'][_0x4c8b('0xe9')]}});}break;}}})['then'](handleEntityNotFound(_0x221b64,null))[_0x4c8b('0x21')](function(_0x4755a3){if(_0x4755a3){_0x5d20aa=_0x4755a3;switch(_0x18f946[_0x4c8b('0x44')]){case _0x4c8b('0x8d'):if(_0x1e9122==='2'||_0x1e9122==='6'){return _0x5d20aa[_0x4c8b('0x61')]({'read':!![]});}else{logger['error'](_0x4c8b('0x24'),_0x4c8b('0x2d'),_0x4c8b('0x8d'),util[_0x4c8b('0xe1')](_0x2fdaa6[_0x4c8b('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x5d20aa;}})['then'](respondWithResult(_0x221b64,null))[_0x4c8b('0x2b')](handleError(_0x221b64,null));};exports['addAgents']=function(_0x218b29,_0x2ce53a,_0x1ee754){return db['SmsAccount']['find']({'where':{'id':_0x218b29[_0x4c8b('0x62')]['id']}})[_0x4c8b('0x21')](handleEntityNotFound(_0x2ce53a,null))[_0x4c8b('0x21')](function(_0x5f14db){if(_0x5f14db){return _0x5f14db[_0x4c8b('0xea')](_0x218b29[_0x4c8b('0x5b')][_0x4c8b('0x6b')],_[_0x4c8b('0x9f')](_0x218b29['body'],[_0x4c8b('0x6b'),'id'])||{})[_0x4c8b('0xa3')](function(_0x18275a){for(var _0x2f4e97=0x0;_0x2f4e97<_0x218b29[_0x4c8b('0x5b')][_0x4c8b('0x6b')][_0x4c8b('0x4d')];_0x2f4e97+=0x1){socket['emit'](_0x4c8b('0xeb'),{'UserId':Number(_0x218b29[_0x4c8b('0x5b')][_0x4c8b('0x6b')][_0x2f4e97]),'SmsAccountId':Number(_0x218b29[_0x4c8b('0x62')]['id'])});}return _0x18275a;});}})['then'](respondWithResult(_0x2ce53a,null))[_0x4c8b('0x2b')](handleError(_0x2ce53a,null));};exports[_0x4c8b('0xec')]=function(_0x5a7b17,_0x439f73,_0x5c729d){return db['SmsAccount'][_0x4c8b('0x5e')]({'where':{'id':_0x5a7b17[_0x4c8b('0x62')]['id']}})[_0x4c8b('0x21')](handleEntityNotFound(_0x439f73,null))[_0x4c8b('0x21')](function(_0xca56ee){if(_0xca56ee){return _0xca56ee[_0x4c8b('0xec')](_0x5a7b17[_0x4c8b('0x47')][_0x4c8b('0x6b')])['then'](function(){if(_[_0x4c8b('0xed')](_0x5a7b17[_0x4c8b('0x47')][_0x4c8b('0x6b')])){for(var _0x2d7a4f=0x0;_0x2d7a4f<_0x5a7b17[_0x4c8b('0x47')][_0x4c8b('0x6b')][_0x4c8b('0x4d')];_0x2d7a4f+=0x1){socket[_0x4c8b('0xee')](_0x4c8b('0xef'),{'UserId':Number(_0x5a7b17['query']['ids'][_0x2d7a4f]),'SmsAccountId':Number(_0x5a7b17[_0x4c8b('0x62')]['id'])});}}else{socket[_0x4c8b('0xee')]('userSmsAccount:remove',{'UserId':Number(_0x5a7b17[_0x4c8b('0x47')]['ids']),'SmsAccountId':Number(_0x5a7b17['params']['id'])});}});}})[_0x4c8b('0x21')](respondWithStatusCode(_0x439f73,null))['catch'](handleError(_0x439f73,null));};exports[_0x4c8b('0xf0')]=function(_0x33124c,_0x39699b,_0x2d5ec4){var _0x5d85c7={};var _0x4acbcb={};var _0xe213aa;var _0x33545f;return db[_0x4c8b('0x42')]['findOne']({'where':{'id':_0x33124c[_0x4c8b('0x62')]['id']}})[_0x4c8b('0x21')](handleEntityNotFound(_0x39699b,null))[_0x4c8b('0x21')](function(_0x3b17ca){if(_0x3b17ca){_0xe213aa=_0x3b17ca;_0x4acbcb['model']=_[_0x4c8b('0x48')](db[_0x4c8b('0xae')]['rawAttributes']);_0x4acbcb[_0x4c8b('0x47')]=_[_0x4c8b('0x48')](_0x33124c[_0x4c8b('0x47')]);_0x4acbcb[_0x4c8b('0x49')]=_[_0x4c8b('0x4a')](_0x4acbcb[_0x4c8b('0x46')],_0x4acbcb['query']);_0x5d85c7[_0x4c8b('0x4b')]=_['intersection'](_0x4acbcb[_0x4c8b('0x46')],qs[_0x4c8b('0x4c')](_0x33124c['query'][_0x4c8b('0x4c')]));_0x5d85c7[_0x4c8b('0x4b')]=_0x5d85c7['attributes'][_0x4c8b('0x4d')]?_0x5d85c7['attributes']:_0x4acbcb['model'];_0x5d85c7[_0x4c8b('0x4e')]=qs[_0x4c8b('0x4f')](_0x33124c[_0x4c8b('0x47')]['sort']);_0x5d85c7[_0x4c8b('0x51')]=qs[_0x4c8b('0x49')](_['pick'](_0x33124c[_0x4c8b('0x47')],_0x4acbcb[_0x4c8b('0x49')]));if(_0x33124c[_0x4c8b('0x47')][_0x4c8b('0x50')]){_0x5d85c7[_0x4c8b('0x51')]=_[_0x4c8b('0x52')](_0x5d85c7[_0x4c8b('0x51')],{'$or':_[_0x4c8b('0x41')](_0x5d85c7[_0x4c8b('0x4b')],function(_0x25d6a8){var _0x344cc1={};_0x344cc1[_0x25d6a8]={'$like':'%'+_0x33124c[_0x4c8b('0x47')][_0x4c8b('0x50')]+'%'};return _0x344cc1;})});}_0x5d85c7=_[_0x4c8b('0x52')]({},_0x5d85c7,_0x33124c['options']);return _0xe213aa['getAgents'](_0x5d85c7);}})[_0x4c8b('0x21')](function(_0x3bbbd4){if(_0x3bbbd4){_0x33545f=_0x3bbbd4['length'];if(!_0x33124c['query'][_0x4c8b('0x6f')](_0x4c8b('0x68'))){_0x5d85c7[_0x4c8b('0x30')]=qs[_0x4c8b('0x30')](_0x33124c[_0x4c8b('0x47')][_0x4c8b('0x30')]);_0x5d85c7[_0x4c8b('0x2f')]=qs[_0x4c8b('0x2f')](_0x33124c[_0x4c8b('0x47')][_0x4c8b('0x2f')]);}return _0xe213aa['getAgents'](_0x5d85c7);}})[_0x4c8b('0x21')](function(_0x1975cc){if(_0x1975cc){return _0x1975cc?{'count':_0x33545f,'rows':_0x1975cc}:null;}})[_0x4c8b('0x21')](respondWithResult(_0x39699b,null))[_0x4c8b('0x2b')](handleError(_0x39699b,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 775bcf4..d9cb8ae 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 _0x2a27=['hook','exports','events','../../mysqldb','SmsAccount','save','emit','hasOwnProperty'];(function(_0x44f295,_0x21e003){var _0x3e8c8d=function(_0x29b6d4){while(--_0x29b6d4){_0x44f295['push'](_0x44f295['shift']());}};_0x3e8c8d(++_0x21e003);}(_0x2a27,0xaa));var _0x72a2=function(_0x3b52f3,_0x2bc752){_0x3b52f3=_0x3b52f3-0x0;var _0x4c1e69=_0x2a27[_0x3b52f3];return _0x4c1e69;};'use strict';var EventEmitter=require(_0x72a2('0x0'));var SmsAccount=require(_0x72a2('0x1'))['db'][_0x72a2('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x72a2('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x7da7a4){return function(_0x22be8e,_0x42d401,_0x46f521){SmsAccountEvents[_0x72a2('0x4')](_0x7da7a4+':'+_0x22be8e['id'],_0x22be8e);SmsAccountEvents[_0x72a2('0x4')](_0x7da7a4,_0x22be8e);_0x46f521(null);};}for(var e in events){if(events[_0x72a2('0x5')](e)){var event=events[e];SmsAccount[_0x72a2('0x6')](e,emitEvent(event));}}module[_0x72a2('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x9466=['events','../../mysqldb','SmsAccount','setMaxListeners','update','remove','hasOwnProperty','hook'];(function(_0x45e45e,_0xb20945){var _0x4ea331=function(_0x25f2b0){while(--_0x25f2b0){_0x45e45e['push'](_0x45e45e['shift']());}};_0x4ea331(++_0xb20945);}(_0x9466,0x158));var _0x6946=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9466[_0x255d5b];return _0x3e141a;};'use strict';var EventEmitter=require(_0x6946('0x0'));var SmsAccount=require(_0x6946('0x1'))['db'][_0x6946('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6946('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6946('0x4'),'afterDestroy':_0x6946('0x5')};function emitEvent(_0x27cadc){return function(_0x2e32c4,_0x556da7,_0x71d2f){SmsAccountEvents['emit'](_0x27cadc+':'+_0x2e32c4['id'],_0x2e32c4);SmsAccountEvents['emit'](_0x27cadc,_0x2e32c4);_0x71d2f(null);};}for(var e in events){if(events[_0x6946('0x6')](e)){var event=events[e];SmsAccount[_0x6946('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 21e7699..53b74a8 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 _0x41e9=['../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41e9,0x19c));var _0x941e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x41e9[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x941e('0x0'));var logger=require(_0x941e('0x1'))(_0x941e('0x2'));var moment=require(_0x941e('0x3'));var BPromise=require(_0x941e('0x4'));var rp=require(_0x941e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x941e('0x6'));var attributes=require(_0x941e('0x7'));module['exports']=function(_0x2bdf19,_0x57f477){return _0x2bdf19[_0x941e('0x8')](_0x941e('0x9'),attributes,{'tableName':_0x941e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa14a=['moment','bluebird','request-promise','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger'];(function(_0x30db0e,_0x5bc053){var _0x21b22e=function(_0x30c9f1){while(--_0x30c9f1){_0x30db0e['push'](_0x30db0e['shift']());}};_0x21b22e(++_0x5bc053);}(_0xa14a,0x1ad));var _0xaa14=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xa14a[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xaa14('0x0'));var util=require(_0xaa14('0x1'));var logger=require(_0xaa14('0x2'))('api');var moment=require(_0xaa14('0x3'));var BPromise=require(_0xaa14('0x4'));var rp=require(_0xaa14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa14('0x6'));var attributes=require(_0xaa14('0x7'));module[_0xaa14('0x8')]=function(_0x38be56,_0x31ca9d){return _0x38be56[_0xaa14('0x9')](_0xaa14('0xa'),attributes,{'tableName':_0xaa14('0xb'),'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 3304887..e5adbe5 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 _0x0229=['SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','include','map','attributes','model','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x5bfa42,_0x46ec12){var _0x5b1a31=function(_0x2e1e7e){while(--_0x2e1e7e){_0x5bfa42['push'](_0x5bfa42['shift']());}};_0x5b1a31(++_0x46ec12);}(_0x0229,0x1c2));var _0x9022=function(_0x36d2d1,_0x3e16bf){_0x36d2d1=_0x36d2d1-0x0;var _0xfeccb2=_0x0229[_0x36d2d1];return _0xfeccb2;};'use strict';var _=require(_0x9022('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9022('0x1'));var rs=require(_0x9022('0x2'));var fs=require('fs');var Redis=require(_0x9022('0x3'));var db=require(_0x9022('0x4'))['db'];var utils=require(_0x9022('0x5'));var logger=require(_0x9022('0x6'))(_0x9022('0x7'));var config=require(_0x9022('0x8'));var jayson=require(_0x9022('0x9'));var client=jayson[_0x9022('0xa')][_0x9022('0xb')]({'port':0x232a});config[_0x9022('0xc')]=_['defaults'](config[_0x9022('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9022('0xd'))(new Redis(config[_0x9022('0xc')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x5289b0,_0x505986,_0x4f0c86){return new BPromise(function(_0x8026bd,_0x2ee7a3){return client[_0x9022('0xe')](_0x5289b0,_0x4f0c86)[_0x9022('0xf')](function(_0x6ecb55){logger['info'](_0x9022('0x10'),_0x505986,_0x9022('0x11'));logger['debug'](_0x9022('0x12'),_0x505986,_0x9022('0x11'),JSON[_0x9022('0x13')](_0x6ecb55));if(_0x6ecb55[_0x9022('0x14')]){if(_0x6ecb55['error']['code']===0x1f4){logger['error'](_0x9022('0x10'),_0x505986,_0x6ecb55[_0x9022('0x14')][_0x9022('0x15')]);return _0x2ee7a3(_0x6ecb55[_0x9022('0x14')][_0x9022('0x15')]);}logger[_0x9022('0x14')](_0x9022('0x10'),_0x505986,_0x6ecb55[_0x9022('0x14')][_0x9022('0x15')]);return _0x8026bd(_0x6ecb55[_0x9022('0x14')][_0x9022('0x15')]);}else{logger[_0x9022('0x16')](_0x9022('0x10'),_0x505986,'request\x20sent');_0x8026bd(_0x6ecb55[_0x9022('0x17')]['message']);}})[_0x9022('0x18')](function(_0x2e3147){logger['error'](_0x9022('0x10'),_0x505986,_0x2e3147);_0x2ee7a3(_0x2e3147);});});}exports[_0x9022('0x19')]=function(_0xfb3716){var _0x8acbfa=this;return new Promise(function(_0x4d8194,_0x569aca){return db[_0x9022('0x1a')][_0x9022('0x1b')]({'raw':_0xfb3716[_0x9022('0x1c')]?_0xfb3716[_0x9022('0x1c')][_0x9022('0x1d')]===undefined?!![]:![]:!![],'where':_0xfb3716[_0x9022('0x1c')]?_0xfb3716['options'][_0x9022('0x1e')]||null:null,'attributes':_0xfb3716['options']?_0xfb3716['options']['attributes']||null:null,'include':_0xfb3716[_0x9022('0x1c')]?_0xfb3716[_0x9022('0x1c')][_0x9022('0x1f')]?_[_0x9022('0x20')](_0xfb3716['options'][_0x9022('0x1f')],function(_0x3a5ad6){return{'model':db[_0x3a5ad6['model']],'as':_0x3a5ad6['as'],'attributes':_0x3a5ad6[_0x9022('0x21')],'include':_0x3a5ad6[_0x9022('0x1f')]?_['map'](_0x3a5ad6[_0x9022('0x1f')],function(_0x2bec24){return{'model':db[_0x2bec24[_0x9022('0x22')]],'as':_0x2bec24['as'],'attributes':_0x2bec24['attributes'],'include':_0x2bec24[_0x9022('0x1f')]?_[_0x9022('0x20')](_0x2bec24[_0x9022('0x1f')],function(_0x5161ac){return{'model':db[_0x5161ac['model']],'as':_0x5161ac['as'],'attributes':_0x5161ac[_0x9022('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9022('0xf')](function(_0x5a2cb2){logger[_0x9022('0x16')](_0x9022('0x19'),_0xfb3716);logger[_0x9022('0x23')](_0x9022('0x19'),_0xfb3716,JSON[_0x9022('0x13')](_0x5a2cb2));_0x4d8194(_0x5a2cb2);})[_0x9022('0x18')](function(_0x471740){logger[_0x9022('0x14')](_0x9022('0x19'),_0x471740['message'],_0xfb3716);_0x569aca(_0x8acbfa['error'](0x1f4,_0x471740[_0x9022('0x15')]));});});}; \ No newline at end of file +var _0xe62a=['message','info','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','model','map','debug','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./smsAccount.socket','register','then','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s'];(function(_0x4d65f5,_0x4d2aed){var _0x4bead9=function(_0x4dd3c9){while(--_0x4dd3c9){_0x4d65f5['push'](_0x4d65f5['shift']());}};_0x4bead9(++_0x4d2aed);}(_0xe62a,0x1bf));var _0xae62=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe62a[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xae62('0x0'));var util=require(_0xae62('0x1'));var moment=require('moment');var BPromise=require(_0xae62('0x2'));var rs=require(_0xae62('0x3'));var fs=require('fs');var Redis=require(_0xae62('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xae62('0x5'));var logger=require(_0xae62('0x6'))(_0xae62('0x7'));var config=require('../../config/environment');var jayson=require(_0xae62('0x8'));var client=jayson['client'][_0xae62('0x9')]({'port':0x232a});config[_0xae62('0xa')]=_[_0xae62('0xb')](config[_0xae62('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xae62('0xc'))(new Redis(config[_0xae62('0xa')]));require(_0xae62('0xd'))[_0xae62('0xe')](socket);function respondWithRpcPromise(_0x87e8f6,_0x56e0c8,_0x3a28b){return new BPromise(function(_0x5c7fed,_0x186d40){return client['request'](_0x87e8f6,_0x3a28b)[_0xae62('0xf')](function(_0x3a3a1d){logger['info']('SmsAccount,\x20%s,\x20%s',_0x56e0c8,_0xae62('0x10'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x56e0c8,_0xae62('0x10'),JSON[_0xae62('0x11')](_0x3a3a1d));if(_0x3a3a1d[_0xae62('0x12')]){if(_0x3a3a1d['error'][_0xae62('0x13')]===0x1f4){logger[_0xae62('0x12')](_0xae62('0x14'),_0x56e0c8,_0x3a3a1d[_0xae62('0x12')][_0xae62('0x15')]);return _0x186d40(_0x3a3a1d[_0xae62('0x12')][_0xae62('0x15')]);}logger[_0xae62('0x12')](_0xae62('0x14'),_0x56e0c8,_0x3a3a1d[_0xae62('0x12')][_0xae62('0x15')]);return _0x5c7fed(_0x3a3a1d['error'][_0xae62('0x15')]);}else{logger[_0xae62('0x16')](_0xae62('0x14'),_0x56e0c8,_0xae62('0x10'));_0x5c7fed(_0x3a3a1d[_0xae62('0x17')][_0xae62('0x15')]);}})[_0xae62('0x18')](function(_0x4a4afc){logger['error'](_0xae62('0x14'),_0x56e0c8,_0x4a4afc);_0x186d40(_0x4a4afc);});});}exports[_0xae62('0x19')]=function(_0x2a3178){var _0x2c94c3=this;return new Promise(function(_0x335643,_0x1cf4a8){return db[_0xae62('0x1a')][_0xae62('0x1b')]({'raw':_0x2a3178[_0xae62('0x1c')]?_0x2a3178['options'][_0xae62('0x1d')]===undefined?!![]:![]:!![],'where':_0x2a3178[_0xae62('0x1c')]?_0x2a3178[_0xae62('0x1c')][_0xae62('0x1e')]||null:null,'attributes':_0x2a3178[_0xae62('0x1c')]?_0x2a3178[_0xae62('0x1c')][_0xae62('0x1f')]||null:null,'include':_0x2a3178['options']?_0x2a3178[_0xae62('0x1c')][_0xae62('0x20')]?_['map'](_0x2a3178[_0xae62('0x1c')][_0xae62('0x20')],function(_0x21b128){return{'model':db[_0x21b128['model']],'as':_0x21b128['as'],'attributes':_0x21b128[_0xae62('0x1f')],'include':_0x21b128['include']?_['map'](_0x21b128[_0xae62('0x20')],function(_0x283261){return{'model':db[_0x283261[_0xae62('0x21')]],'as':_0x283261['as'],'attributes':_0x283261[_0xae62('0x1f')],'include':_0x283261[_0xae62('0x20')]?_[_0xae62('0x22')](_0x283261[_0xae62('0x20')],function(_0x18ae0c){return{'model':db[_0x18ae0c[_0xae62('0x21')]],'as':_0x18ae0c['as'],'attributes':_0x18ae0c[_0xae62('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xae62('0xf')](function(_0x576135){logger['info'](_0xae62('0x19'),_0x2a3178);logger[_0xae62('0x23')](_0xae62('0x19'),_0x2a3178,JSON[_0xae62('0x11')](_0x576135));_0x335643(_0x576135);})[_0xae62('0x18')](function(_0x3c9756){logger[_0xae62('0x12')]('ShowSmsAccount',_0x3c9756[_0xae62('0x15')],_0x2a3178);_0x1cf4a8(_0x2c94c3[_0xae62('0x12')](0x1f4,_0x3c9756[_0xae62('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 7548ff3..871940d 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 9ab2b01..2753c23 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 _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(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_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 _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5d9c78,_0xf69a7){var _0x4ba737=function(_0xe5c9e7){while(--_0xe5c9e7){_0x5d9c78['push'](_0x5d9c78['shift']());}};_0x4ba737(++_0xf69a7);}(_0xedd9,0xfc));var _0x9edd=function(_0x3a1b90,_0x3c0158){_0x3a1b90=_0x3a1b90-0x0;var _0xf6de77=_0xedd9[_0x3a1b90];return _0xf6de77;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 1096f00..16981c2 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 _0xc0c3=['*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x20084e,_0x2fb557){var _0x1eac1e=function(_0x2acfd0){while(--_0x2acfd0){_0x20084e['push'](_0x20084e['shift']());}};_0x1eac1e(++_0x2fb557);}(_0xc0c3,0x7e));var _0x3c0c=function(_0x59cfd4,_0x1f7092){_0x59cfd4=_0x59cfd4-0x0;var _0x2593f4=_0xc0c3[_0x59cfd4];return _0x2593f4;};'use strict';var Sequelize=require(_0x3c0c('0x0'));module[_0x3c0c('0x1')]={'priority':{'type':Sequelize[_0x3c0c('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3c0c('0x3')],'defaultValue':_0x3c0c('0x4')}}; \ No newline at end of file +var _0x6c6d=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x2594e0,_0x1ee198){var _0x1eadb9=function(_0x52a325){while(--_0x52a325){_0x2594e0['push'](_0x2594e0['shift']());}};_0x1eadb9(++_0x1ee198);}(_0x6c6d,0x11e));var _0xd6c6=function(_0x37294f,_0x1d0b37){_0x37294f=_0x37294f-0x0;var _0x3d8646=_0x6c6d[_0x37294f];return _0x3d8646;};'use strict';var Sequelize=require(_0xd6c6('0x0'));module[_0xd6c6('0x1')]={'priority':{'type':Sequelize[_0xd6c6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd6c6('0x3')],'allowNull':![],'defaultValue':_0xd6c6('0x4')},'appdata':{'type':Sequelize[_0xd6c6('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd6c6('0x3')],'defaultValue':_0xd6c6('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 0c68932..3b7f7e9 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 _0x9121=['sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','SmsApplication','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','options','create','body','find','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x4a86d3,_0x3ac627){var _0x3d1dd3=function(_0x3b1860){while(--_0x3b1860){_0x4a86d3['push'](_0x4a86d3['shift']());}};_0x3d1dd3(++_0x3ac627);}(_0x9121,0x1f0));var _0x1912=function(_0x48507b,_0x5f0ac5){_0x48507b=_0x48507b-0x0;var _0x97adb2=_0x9121[_0x48507b];return _0x97adb2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1912('0x0'));var zipdir=require(_0x1912('0x1'));var jsonpatch=require(_0x1912('0x2'));var rp=require('request-promise');var moment=require(_0x1912('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1912('0x4'));var util=require(_0x1912('0x5'));var path=require('path');var sox=require(_0x1912('0x6'));var csv=require('to-csv');var ejs=require(_0x1912('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1912('0x8'));var squel=require(_0x1912('0x9'));var crypto=require(_0x1912('0xa'));var jsforce=require(_0x1912('0xb'));var deskjs=require(_0x1912('0xc'));var toCsv=require(_0x1912('0xd'));var querystring=require(_0x1912('0xe'));var Papa=require('papaparse');var Redis=require(_0x1912('0xf'));var authService=require(_0x1912('0x10'));var qs=require(_0x1912('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1912('0x12'))('api');var utils=require(_0x1912('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x1912('0x14'));var db=require(_0x1912('0x15'))['db'];function respondWithStatusCode(_0x4e7aed,_0x4db531){_0x4db531=_0x4db531||0xcc;return function(_0x18beac){if(_0x18beac){return _0x4e7aed[_0x1912('0x16')](_0x4db531);}return _0x4e7aed[_0x1912('0x17')](_0x4db531)[_0x1912('0x18')]();};}function respondWithResult(_0x380e94,_0x3bd656){_0x3bd656=_0x3bd656||0xc8;return function(_0x2b998c){if(_0x2b998c){return _0x380e94['status'](_0x3bd656)[_0x1912('0x19')](_0x2b998c);}};}function respondWithFilteredResult(_0x8a92ea,_0x17e8ab){return function(_0x19f586){if(_0x19f586){var _0x1df1f2=typeof _0x17e8ab[_0x1912('0x1a')]===_0x1912('0x1b')&&typeof _0x17e8ab[_0x1912('0x1c')]===_0x1912('0x1b');var _0x41bfc0=_0x19f586['count'];var _0x849994=_0x1df1f2?0x0:_0x17e8ab['offset'];var _0x37e250=_0x1df1f2?_0x19f586[_0x1912('0x1d')]:_0x17e8ab[_0x1912('0x1a')]+_0x17e8ab['limit'];var _0x23b871;if(_0x37e250>=_0x41bfc0){_0x37e250=_0x41bfc0;_0x23b871=0xc8;}else{_0x23b871=0xce;}_0x8a92ea[_0x1912('0x17')](_0x23b871);return _0x8a92ea[_0x1912('0x1e')]('Content-Range',_0x849994+'-'+_0x37e250+'/'+_0x41bfc0)[_0x1912('0x19')](_0x19f586);}return null;};}function patchUpdates(_0x293d8c){return function(_0x574800){try{jsonpatch[_0x1912('0x1f')](_0x574800,_0x293d8c,!![]);}catch(_0x4e067a){return BPromise[_0x1912('0x20')](_0x4e067a);}return _0x574800['save']();};}function saveUpdates(_0x11b1d9,_0x4140b7){return function(_0x5ecdb8){if(_0x5ecdb8){return _0x5ecdb8[_0x1912('0x21')](_0x11b1d9)[_0x1912('0x22')](function(_0x3db23a){return _0x3db23a;});}return null;};}function removeEntity(_0x100f64,_0x117cb5){return function(_0x146835){if(_0x146835){return _0x146835[_0x1912('0x23')]()[_0x1912('0x22')](function(){_0x100f64[_0x1912('0x17')](0xcc)[_0x1912('0x18')]();});}};}function handleEntityNotFound(_0x1a1488,_0xa3ad6){return function(_0x45b444){if(!_0x45b444){_0x1a1488[_0x1912('0x16')](0x194);}return _0x45b444;};}function handleError(_0x4fb7dc,_0x1aa676){_0x1aa676=_0x1aa676||0x1f4;return function(_0x2b1cb9){logger[_0x1912('0x24')](_0x2b1cb9[_0x1912('0x25')]);if(_0x2b1cb9[_0x1912('0x26')]){delete _0x2b1cb9[_0x1912('0x26')];}_0x4fb7dc[_0x1912('0x17')](_0x1aa676)[_0x1912('0x27')](_0x2b1cb9);};}exports[_0x1912('0x28')]=function(_0x5a48a4,_0x5df9b6){var _0x189d7f={},_0x2842a4={},_0x2f172b={'count':0x0,'rows':[]};var _0xe2e775=_[_0x1912('0x29')](db[_0x1912('0x2a')]['rawAttributes'],function(_0x121dca){return{'name':_0x121dca[_0x1912('0x2b')],'type':_0x121dca['type'][_0x1912('0x2c')]};});_0x2842a4[_0x1912('0x2d')]=_[_0x1912('0x29')](_0xe2e775,_0x1912('0x26'));_0x2842a4[_0x1912('0x2e')]=_[_0x1912('0x2f')](_0x5a48a4[_0x1912('0x2e')]);_0x2842a4[_0x1912('0x30')]=_[_0x1912('0x31')](_0x2842a4['model'],_0x2842a4['query']);_0x189d7f[_0x1912('0x32')]=_['intersection'](_0x2842a4[_0x1912('0x2d')],qs[_0x1912('0x33')](_0x5a48a4[_0x1912('0x2e')][_0x1912('0x33')]));_0x189d7f[_0x1912('0x32')]=_0x189d7f[_0x1912('0x32')]['length']?_0x189d7f[_0x1912('0x32')]:_0x2842a4['model'];if(!_0x5a48a4[_0x1912('0x2e')]['hasOwnProperty'](_0x1912('0x34'))){_0x189d7f['limit']=qs[_0x1912('0x1c')](_0x5a48a4[_0x1912('0x2e')]['limit']);_0x189d7f['offset']=qs[_0x1912('0x1a')](_0x5a48a4['query'][_0x1912('0x1a')]);}_0x189d7f[_0x1912('0x35')]=qs[_0x1912('0x36')](_0x5a48a4[_0x1912('0x2e')][_0x1912('0x36')]);_0x189d7f['where']=qs['filters'](_[_0x1912('0x37')](_0x5a48a4[_0x1912('0x2e')],_0x2842a4[_0x1912('0x30')]),_0xe2e775);if(_0x5a48a4['query'][_0x1912('0x38')]){_0x189d7f['where']=_[_0x1912('0x39')](_0x189d7f[_0x1912('0x3a')],{'$or':_[_0x1912('0x29')](_0xe2e775,function(_0x211a61){if(_0x211a61[_0x1912('0x3b')]!==_0x1912('0x3c')){var _0x4ea16f={};_0x4ea16f[_0x211a61['name']]={'$like':'%'+_0x5a48a4['query'][_0x1912('0x38')]+'%'};return _0x4ea16f;}})});}_0x189d7f=_[_0x1912('0x39')]({},_0x189d7f,_0x5a48a4['options']);var _0x3fcade={'where':_0x189d7f['where']};return db[_0x1912('0x2a')]['count'](_0x3fcade)['then'](function(_0x3b06be){_0x2f172b['count']=_0x3b06be;if(_0x5a48a4['query'][_0x1912('0x3d')]){_0x189d7f['include']=[{'all':!![]}];}return db[_0x1912('0x2a')][_0x1912('0x3e')](_0x189d7f);})[_0x1912('0x22')](function(_0x568d17){_0x2f172b[_0x1912('0x3f')]=_0x568d17;return _0x2f172b;})['then'](respondWithFilteredResult(_0x5df9b6,_0x189d7f))[_0x1912('0x40')](handleError(_0x5df9b6,null));};exports[_0x1912('0x41')]=function(_0x44f7e9,_0x2967b2){var _0x1dcad9={'raw':!![],'where':{'id':_0x44f7e9[_0x1912('0x42')]['id']}},_0x1be155={};_0x1be155[_0x1912('0x2d')]=_[_0x1912('0x2f')](db[_0x1912('0x2a')][_0x1912('0x43')]);_0x1be155[_0x1912('0x2e')]=_[_0x1912('0x2f')](_0x44f7e9[_0x1912('0x2e')]);_0x1be155['filters']=_[_0x1912('0x31')](_0x1be155[_0x1912('0x2d')],_0x1be155[_0x1912('0x2e')]);_0x1dcad9['attributes']=_[_0x1912('0x31')](_0x1be155['model'],qs[_0x1912('0x33')](_0x44f7e9[_0x1912('0x2e')][_0x1912('0x33')]));_0x1dcad9[_0x1912('0x32')]=_0x1dcad9[_0x1912('0x32')][_0x1912('0x44')]?_0x1dcad9[_0x1912('0x32')]:_0x1be155[_0x1912('0x2d')];if(_0x44f7e9[_0x1912('0x2e')]['includeAll']){_0x1dcad9[_0x1912('0x45')]=[{'all':!![]}];}_0x1dcad9=_[_0x1912('0x39')]({},_0x1dcad9,_0x44f7e9[_0x1912('0x46')]);return db[_0x1912('0x2a')]['find'](_0x1dcad9)['then'](handleEntityNotFound(_0x2967b2,null))[_0x1912('0x22')](respondWithResult(_0x2967b2,null))['catch'](handleError(_0x2967b2,null));};exports[_0x1912('0x47')]=function(_0x310c38,_0x7b1ed6){return db[_0x1912('0x2a')][_0x1912('0x47')](_0x310c38[_0x1912('0x48')],{})[_0x1912('0x22')](respondWithResult(_0x7b1ed6,0xc9))[_0x1912('0x40')](handleError(_0x7b1ed6,null));};exports[_0x1912('0x21')]=function(_0x5e048f,_0x2fc521){if(_0x5e048f[_0x1912('0x48')]['id']){delete _0x5e048f[_0x1912('0x48')]['id'];}return db[_0x1912('0x2a')][_0x1912('0x49')]({'where':{'id':_0x5e048f['params']['id']}})[_0x1912('0x22')](handleEntityNotFound(_0x2fc521,null))[_0x1912('0x22')](saveUpdates(_0x5e048f[_0x1912('0x48')],null))[_0x1912('0x22')](respondWithResult(_0x2fc521,null))['catch'](handleError(_0x2fc521,null));};exports[_0x1912('0x23')]=function(_0x17b1ed,_0x2bc1ba){return db['SmsApplication'][_0x1912('0x49')]({'where':{'id':_0x17b1ed['params']['id']}})['then'](handleEntityNotFound(_0x2bc1ba,null))[_0x1912('0x22')](removeEntity(_0x2bc1ba,null))[_0x1912('0x40')](handleError(_0x2bc1ba,null));}; \ No newline at end of file +var _0xf757=['fieldName','type','key','query','attributes','intersection','model','fields','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','SmsApplication','includeAll','findAll','rows','catch','params','keys','include','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','name','send','index','map','rawAttributes'];(function(_0x749a29,_0x3882da){var _0x523dde=function(_0x54f8cd){while(--_0x54f8cd){_0x749a29['push'](_0x749a29['shift']());}};_0x523dde(++_0x3882da);}(_0xf757,0xb4));var _0x7f75=function(_0x562faa,_0x23adc7){_0x562faa=_0x562faa-0x0;var _0xc70f59=_0xf757[_0x562faa];return _0xc70f59;};'use strict';var emlformat=require(_0x7f75('0x0'));var rimraf=require(_0x7f75('0x1'));var zipdir=require(_0x7f75('0x2'));var jsonpatch=require(_0x7f75('0x3'));var rp=require(_0x7f75('0x4'));var moment=require(_0x7f75('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7f75('0x6'));var path=require(_0x7f75('0x7'));var sox=require(_0x7f75('0x8'));var csv=require(_0x7f75('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f75('0xa'));var _=require(_0x7f75('0xb'));var squel=require(_0x7f75('0xc'));var crypto=require('crypto');var jsforce=require(_0x7f75('0xd'));var deskjs=require(_0x7f75('0xe'));var toCsv=require(_0x7f75('0x9'));var querystring=require(_0x7f75('0xf'));var Papa=require(_0x7f75('0x10'));var Redis=require(_0x7f75('0x11'));var authService=require(_0x7f75('0x12'));var qs=require(_0x7f75('0x13'));var as=require(_0x7f75('0x14'));var hardwareService=require(_0x7f75('0x15'));var logger=require(_0x7f75('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x7f75('0x17'));var licenseUtil=require(_0x7f75('0x18'));var db=require(_0x7f75('0x19'))['db'];function respondWithStatusCode(_0x7c7e71,_0x41f8e3){_0x41f8e3=_0x41f8e3||0xcc;return function(_0x141ec2){if(_0x141ec2){return _0x7c7e71[_0x7f75('0x1a')](_0x41f8e3);}return _0x7c7e71[_0x7f75('0x1b')](_0x41f8e3)[_0x7f75('0x1c')]();};}function respondWithResult(_0x52cb02,_0x50ecff){_0x50ecff=_0x50ecff||0xc8;return function(_0x4471db){if(_0x4471db){return _0x52cb02['status'](_0x50ecff)[_0x7f75('0x1d')](_0x4471db);}};}function respondWithFilteredResult(_0x37c54f,_0x427ea5){return function(_0x17f900){if(_0x17f900){var _0x10d0dd=typeof _0x427ea5[_0x7f75('0x1e')]===_0x7f75('0x1f')&&typeof _0x427ea5['limit']==='undefined';var _0x5a35bb=_0x17f900['count'];var _0x404bd7=_0x10d0dd?0x0:_0x427ea5[_0x7f75('0x1e')];var _0x5a302e=_0x10d0dd?_0x17f900[_0x7f75('0x20')]:_0x427ea5[_0x7f75('0x1e')]+_0x427ea5[_0x7f75('0x21')];var _0x182623;if(_0x5a302e>=_0x5a35bb){_0x5a302e=_0x5a35bb;_0x182623=0xc8;}else{_0x182623=0xce;}_0x37c54f[_0x7f75('0x1b')](_0x182623);return _0x37c54f[_0x7f75('0x22')](_0x7f75('0x23'),_0x404bd7+'-'+_0x5a302e+'/'+_0x5a35bb)[_0x7f75('0x1d')](_0x17f900);}return null;};}function patchUpdates(_0xd99da6){return function(_0x5d9461){try{jsonpatch[_0x7f75('0x24')](_0x5d9461,_0xd99da6,!![]);}catch(_0x12c933){return BPromise[_0x7f75('0x25')](_0x12c933);}return _0x5d9461[_0x7f75('0x26')]();};}function saveUpdates(_0x5597c1,_0x1eb38a){return function(_0x2532f1){if(_0x2532f1){return _0x2532f1['update'](_0x5597c1)[_0x7f75('0x27')](function(_0x412adb){return _0x412adb;});}return null;};}function removeEntity(_0x507559,_0x42b8ba){return function(_0x4f9bf5){if(_0x4f9bf5){return _0x4f9bf5['destroy']()[_0x7f75('0x27')](function(){_0x507559[_0x7f75('0x1b')](0xcc)[_0x7f75('0x1c')]();});}};}function handleEntityNotFound(_0x38e60e,_0x1fc2c7){return function(_0x4b236b){if(!_0x4b236b){_0x38e60e[_0x7f75('0x1a')](0x194);}return _0x4b236b;};}function handleError(_0x198585,_0x57ce44){_0x57ce44=_0x57ce44||0x1f4;return function(_0x39b158){logger['error'](_0x39b158['stack']);if(_0x39b158[_0x7f75('0x28')]){delete _0x39b158[_0x7f75('0x28')];}_0x198585[_0x7f75('0x1b')](_0x57ce44)[_0x7f75('0x29')](_0x39b158);};}exports[_0x7f75('0x2a')]=function(_0x46bd57,_0x48f8f6){var _0x1f69b9={},_0x393ffc={},_0x444433={'count':0x0,'rows':[]};var _0x3d4549=_[_0x7f75('0x2b')](db['SmsApplication'][_0x7f75('0x2c')],function(_0x2dfa1a){return{'name':_0x2dfa1a[_0x7f75('0x2d')],'type':_0x2dfa1a[_0x7f75('0x2e')][_0x7f75('0x2f')]};});_0x393ffc['model']=_[_0x7f75('0x2b')](_0x3d4549,'name');_0x393ffc[_0x7f75('0x30')]=_['keys'](_0x46bd57['query']);_0x393ffc['filters']=_['intersection'](_0x393ffc['model'],_0x393ffc[_0x7f75('0x30')]);_0x1f69b9[_0x7f75('0x31')]=_[_0x7f75('0x32')](_0x393ffc[_0x7f75('0x33')],qs[_0x7f75('0x34')](_0x46bd57[_0x7f75('0x30')][_0x7f75('0x34')]));_0x1f69b9['attributes']=_0x1f69b9[_0x7f75('0x31')]['length']?_0x1f69b9[_0x7f75('0x31')]:_0x393ffc[_0x7f75('0x33')];if(!_0x46bd57[_0x7f75('0x30')]['hasOwnProperty'](_0x7f75('0x35'))){_0x1f69b9['limit']=qs['limit'](_0x46bd57[_0x7f75('0x30')][_0x7f75('0x21')]);_0x1f69b9[_0x7f75('0x1e')]=qs[_0x7f75('0x1e')](_0x46bd57[_0x7f75('0x30')][_0x7f75('0x1e')]);}_0x1f69b9[_0x7f75('0x36')]=qs[_0x7f75('0x37')](_0x46bd57[_0x7f75('0x30')][_0x7f75('0x37')]);_0x1f69b9['where']=qs[_0x7f75('0x38')](_[_0x7f75('0x39')](_0x46bd57[_0x7f75('0x30')],_0x393ffc[_0x7f75('0x38')]),_0x3d4549);if(_0x46bd57['query'][_0x7f75('0x3a')]){_0x1f69b9[_0x7f75('0x3b')]=_[_0x7f75('0x3c')](_0x1f69b9['where'],{'$or':_[_0x7f75('0x2b')](_0x3d4549,function(_0x4d2951){if(_0x4d2951[_0x7f75('0x2e')]!==_0x7f75('0x3d')){var _0x4f7094={};_0x4f7094[_0x4d2951['name']]={'$like':'%'+_0x46bd57['query'][_0x7f75('0x3a')]+'%'};return _0x4f7094;}})});}_0x1f69b9=_[_0x7f75('0x3c')]({},_0x1f69b9,_0x46bd57[_0x7f75('0x3e')]);var _0x3c0ff4={'where':_0x1f69b9[_0x7f75('0x3b')]};return db[_0x7f75('0x3f')][_0x7f75('0x20')](_0x3c0ff4)[_0x7f75('0x27')](function(_0x101df8){_0x444433['count']=_0x101df8;if(_0x46bd57[_0x7f75('0x30')][_0x7f75('0x40')]){_0x1f69b9['include']=[{'all':!![]}];}return db[_0x7f75('0x3f')][_0x7f75('0x41')](_0x1f69b9);})['then'](function(_0x316396){_0x444433[_0x7f75('0x42')]=_0x316396;return _0x444433;})[_0x7f75('0x27')](respondWithFilteredResult(_0x48f8f6,_0x1f69b9))[_0x7f75('0x43')](handleError(_0x48f8f6,null));};exports['show']=function(_0x365d54,_0x5bce1e){var _0x20a387={'raw':!![],'where':{'id':_0x365d54[_0x7f75('0x44')]['id']}},_0x5d7e07={};_0x5d7e07[_0x7f75('0x33')]=_[_0x7f75('0x45')](db['SmsApplication'][_0x7f75('0x2c')]);_0x5d7e07[_0x7f75('0x30')]=_['keys'](_0x365d54[_0x7f75('0x30')]);_0x5d7e07[_0x7f75('0x38')]=_[_0x7f75('0x32')](_0x5d7e07[_0x7f75('0x33')],_0x5d7e07[_0x7f75('0x30')]);_0x20a387[_0x7f75('0x31')]=_[_0x7f75('0x32')](_0x5d7e07[_0x7f75('0x33')],qs[_0x7f75('0x34')](_0x365d54['query'][_0x7f75('0x34')]));_0x20a387[_0x7f75('0x31')]=_0x20a387[_0x7f75('0x31')]['length']?_0x20a387[_0x7f75('0x31')]:_0x5d7e07['model'];if(_0x365d54[_0x7f75('0x30')][_0x7f75('0x40')]){_0x20a387[_0x7f75('0x46')]=[{'all':!![]}];}_0x20a387=_[_0x7f75('0x3c')]({},_0x20a387,_0x365d54['options']);return db[_0x7f75('0x3f')]['find'](_0x20a387)[_0x7f75('0x27')](handleEntityNotFound(_0x5bce1e,null))[_0x7f75('0x27')](respondWithResult(_0x5bce1e,null))[_0x7f75('0x43')](handleError(_0x5bce1e,null));};exports[_0x7f75('0x47')]=function(_0x3c7b64,_0x1ef06d){return db['SmsApplication']['create'](_0x3c7b64[_0x7f75('0x48')],{})[_0x7f75('0x27')](respondWithResult(_0x1ef06d,0xc9))[_0x7f75('0x43')](handleError(_0x1ef06d,null));};exports[_0x7f75('0x49')]=function(_0x255c3f,_0x5ccf66){if(_0x255c3f[_0x7f75('0x48')]['id']){delete _0x255c3f[_0x7f75('0x48')]['id'];}return db[_0x7f75('0x3f')][_0x7f75('0x4a')]({'where':{'id':_0x255c3f[_0x7f75('0x44')]['id']}})['then'](handleEntityNotFound(_0x5ccf66,null))['then'](saveUpdates(_0x255c3f[_0x7f75('0x48')],null))[_0x7f75('0x27')](respondWithResult(_0x5ccf66,null))[_0x7f75('0x43')](handleError(_0x5ccf66,null));};exports['destroy']=function(_0x553127,_0xc390ad){return db['SmsApplication']['find']({'where':{'id':_0x553127[_0x7f75('0x44')]['id']}})[_0x7f75('0x27')](handleEntityNotFound(_0xc390ad,null))['then'](removeEntity(_0xc390ad,null))['catch'](handleError(_0xc390ad,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 4b6f3ca..c764d99 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 _0xe049=['path','rimraf','./smsApplication.attributes','exports','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x134214,_0x249ffe){var _0x12714b=function(_0x3680c9){while(--_0x3680c9){_0x134214['push'](_0x134214['shift']());}};_0x12714b(++_0x249ffe);}(_0xe049,0x70));var _0x9e04=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xe049[_0x2070da];return _0x4f9fe1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9e04('0x0'))(_0x9e04('0x1'));var moment=require(_0x9e04('0x2'));var BPromise=require(_0x9e04('0x3'));var rp=require(_0x9e04('0x4'));var fs=require('fs');var path=require(_0x9e04('0x5'));var rimraf=require(_0x9e04('0x6'));var config=require('../../config/environment');var attributes=require(_0x9e04('0x7'));module[_0x9e04('0x8')]=function(_0xee5358,_0x272e68){return _0xee5358[_0x9e04('0x9')](_0x9e04('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9e04('0xb'),'collate':_0x9e04('0xc')});}; \ No newline at end of file +var _0xf700=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','SmsApplication'];(function(_0xaf4e6d,_0x16c1ce){var _0xca53de=function(_0x488631){while(--_0x488631){_0xaf4e6d['push'](_0xaf4e6d['shift']());}};_0xca53de(++_0x16c1ce);}(_0xf700,0x1c9));var _0x0f70=function(_0x4c1290,_0x268e83){_0x4c1290=_0x4c1290-0x0;var _0xe06164=_0xf700[_0x4c1290];return _0xe06164;};'use strict';var _=require(_0x0f70('0x0'));var util=require(_0x0f70('0x1'));var logger=require(_0x0f70('0x2'))(_0x0f70('0x3'));var moment=require(_0x0f70('0x4'));var BPromise=require(_0x0f70('0x5'));var rp=require(_0x0f70('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f70('0x7'));var config=require(_0x0f70('0x8'));var attributes=require('./smsApplication.attributes');module[_0x0f70('0x9')]=function(_0x1af297,_0x397c81){return _0x1af297['define'](_0x0f70('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0f70('0xb'),'collate':_0x0f70('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 5b53a14..c25cee1 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 _0x80e0=['stringify','error','message','result','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x460966,_0x2c949f){var _0x22a7ec=function(_0x1f214b){while(--_0x1f214b){_0x460966['push'](_0x460966['shift']());}};_0x22a7ec(++_0x2c949f);}(_0x80e0,0x9d));var _0x080e=function(_0x34c518,_0x1242ee){_0x34c518=_0x34c518-0x0;var _0x1d25dc=_0x80e0[_0x34c518];return _0x1d25dc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x080e('0x0'));var BPromise=require(_0x080e('0x1'));var rs=require(_0x080e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x080e('0x3'))['db'];var utils=require(_0x080e('0x4'));var logger=require(_0x080e('0x5'))('rpc');var config=require(_0x080e('0x6'));var jayson=require(_0x080e('0x7'));var client=jayson[_0x080e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b61b7,_0x5583f7,_0xd00ba7){return new BPromise(function(_0x535ebf,_0x2886dd){return client['request'](_0x4b61b7,_0xd00ba7)[_0x080e('0x9')](function(_0x1241ec){logger[_0x080e('0xa')](_0x080e('0xb'),_0x5583f7,_0x080e('0xc'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x5583f7,_0x080e('0xc'),JSON[_0x080e('0xd')](_0x1241ec));if(_0x1241ec[_0x080e('0xe')]){if(_0x1241ec[_0x080e('0xe')]['code']===0x1f4){logger['error'](_0x080e('0xb'),_0x5583f7,_0x1241ec[_0x080e('0xe')][_0x080e('0xf')]);return _0x2886dd(_0x1241ec['error'][_0x080e('0xf')]);}logger[_0x080e('0xe')]('SmsApplication,\x20%s,\x20%s',_0x5583f7,_0x1241ec['error']['message']);return _0x535ebf(_0x1241ec['error'][_0x080e('0xf')]);}else{logger[_0x080e('0xa')]('SmsApplication,\x20%s,\x20%s',_0x5583f7,'request\x20sent');_0x535ebf(_0x1241ec[_0x080e('0x10')]['message']);}})['catch'](function(_0x1b87fb){logger['error'](_0x080e('0xb'),_0x5583f7,_0x1b87fb);_0x2886dd(_0x1b87fb);});});} \ No newline at end of file +var _0x7366=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','SmsApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x4ac5fa,_0x37dca5){var _0x3b89e5=function(_0x557149){while(--_0x557149){_0x4ac5fa['push'](_0x4ac5fa['shift']());}};_0x3b89e5(++_0x37dca5);}(_0x7366,0x9d));var _0x6736=function(_0x456cbb,_0x547275){_0x456cbb=_0x456cbb-0x0;var _0x9c3a70=_0x7366[_0x456cbb];return _0x9c3a70;};'use strict';var _=require(_0x6736('0x0'));var util=require(_0x6736('0x1'));var moment=require(_0x6736('0x2'));var BPromise=require(_0x6736('0x3'));var rs=require(_0x6736('0x4'));var fs=require('fs');var Redis=require(_0x6736('0x5'));var db=require(_0x6736('0x6'))['db'];var utils=require(_0x6736('0x7'));var logger=require(_0x6736('0x8'))('rpc');var config=require(_0x6736('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6736('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32e0c1,_0x2cc35d,_0x4f4944){return new BPromise(function(_0x123b3c,_0x3a966c){return client[_0x6736('0xb')](_0x32e0c1,_0x4f4944)['then'](function(_0x1d0c58){logger[_0x6736('0xc')](_0x6736('0xd'),_0x2cc35d,'request\x20sent');logger[_0x6736('0xe')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x2cc35d,_0x6736('0xf'),JSON[_0x6736('0x10')](_0x1d0c58));if(_0x1d0c58['error']){if(_0x1d0c58[_0x6736('0x11')][_0x6736('0x12')]===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x2cc35d,_0x1d0c58['error'][_0x6736('0x13')]);return _0x3a966c(_0x1d0c58[_0x6736('0x11')][_0x6736('0x13')]);}logger[_0x6736('0x11')](_0x6736('0xd'),_0x2cc35d,_0x1d0c58[_0x6736('0x11')][_0x6736('0x13')]);return _0x123b3c(_0x1d0c58[_0x6736('0x11')][_0x6736('0x13')]);}else{logger[_0x6736('0xc')](_0x6736('0xd'),_0x2cc35d,_0x6736('0xf'));_0x123b3c(_0x1d0c58[_0x6736('0x14')][_0x6736('0x13')]);}})[_0x6736('0x15')](function(_0x3290a1){logger['error'](_0x6736('0xd'),_0x2cc35d,_0x3290a1);_0x3a966c(_0x3290a1);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index c13b99c..2e2db27 100644 --- a/server/api/smsInteraction/index.js +++ b/server/api/smsInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cb4=['./smsInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','getMessages','/:id/download','create','post','/:id/messages','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x562d1b,_0x4e8a82){var _0x11fd3d=function(_0x1fda21){while(--_0x1fda21){_0x562d1b['push'](_0x562d1b['shift']());}};_0x11fd3d(++_0x4e8a82);}(_0x6cb4,0xff));var _0x46cb=function(_0x219cba,_0x28db49){_0x219cba=_0x219cba-0x0;var _0x203537=_0x6cb4[_0x219cba];return _0x203537;};'use strict';var multer=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var path=require(_0x46cb('0x2'));var timeout=require(_0x46cb('0x3'));var express=require(_0x46cb('0x4'));var router=express[_0x46cb('0x5')]();var fs_extra=require(_0x46cb('0x6'));var auth=require(_0x46cb('0x7'));var interaction=require(_0x46cb('0x8'));var config=require('../../config/environment');var controller=require(_0x46cb('0x9'));router['get']('/',auth[_0x46cb('0xa')](),controller['index']);router[_0x46cb('0xb')](_0x46cb('0xc'),auth[_0x46cb('0xa')](),controller[_0x46cb('0xd')]);router[_0x46cb('0xb')](_0x46cb('0xe'),auth['isAuthenticated'](),controller[_0x46cb('0xf')]);router[_0x46cb('0xb')]('/:id/messages',auth[_0x46cb('0xa')](),controller[_0x46cb('0x10')]);router['get'](_0x46cb('0x11'),auth[_0x46cb('0xa')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x46cb('0x12')]);router[_0x46cb('0x13')](_0x46cb('0x14'),auth[_0x46cb('0xa')](),controller['addMessage']);router[_0x46cb('0x13')](_0x46cb('0x15'),auth[_0x46cb('0xa')](),interaction[_0x46cb('0x16')](_0x46cb('0x17'),_0x46cb('0x18')),controller[_0x46cb('0x19')]);router[_0x46cb('0x1a')](_0x46cb('0xe'),auth[_0x46cb('0xa')](),interaction[_0x46cb('0x16')]('sms',_0x46cb('0x1b')),controller['update']);router[_0x46cb('0x1c')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x46cb('0x17'),_0x46cb('0x1d')),controller[_0x46cb('0x1e')]);router[_0x46cb('0x1c')](_0x46cb('0x15'),auth[_0x46cb('0xa')](),controller[_0x46cb('0x1f')]);module[_0x46cb('0x20')]=router; \ No newline at end of file +var _0xd7d1=['update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','download','post','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x18e03c,_0x40cd97){_0x18e03c=_0x18e03c-0x0;var _0x2de0c8=_0xd7d1[_0x18e03c];return _0x2de0c8;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xb')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0xb')](_0x1d7d('0x11'),auth[_0x1d7d('0xc')](),controller['getMessages']);router[_0x1d7d('0xb')]('/:id/download',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0x13')]('/',auth[_0x1d7d('0xc')](),controller['create']);router[_0x1d7d('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1d7d('0x14')]);router[_0x1d7d('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x1d7d('0x15')](_0x1d7d('0x16'),_0x1d7d('0x17')),controller[_0x1d7d('0x18')]);router[_0x1d7d('0x19')]('/:id',auth[_0x1d7d('0xc')](),interaction[_0x1d7d('0x15')]('sms',_0x1d7d('0x1a')),controller[_0x1d7d('0x1b')]);router[_0x1d7d('0x1c')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),interaction['tracked'](_0x1d7d('0x16'),_0x1d7d('0x1d')),controller['destroy']);router['delete'](_0x1d7d('0x1e'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1f')]);module[_0x1d7d('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 41d0f12..4ae999c 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 _0x68a5=['DATE','out','ENUM','INTEGER','sequelize','exports','BOOLEAN','STRING'];(function(_0x2e15de,_0x3b9a6f){var _0xdaa198=function(_0x575fed){while(--_0x575fed){_0x2e15de['push'](_0x2e15de['shift']());}};_0xdaa198(++_0x3b9a6f);}(_0x68a5,0xfc));var _0x568a=function(_0x99b21d,_0x99184){_0x99b21d=_0x99b21d-0x0;var _0x46bb4d=_0x68a5[_0x99b21d];return _0x46bb4d;};'use strict';var Sequelize=require(_0x568a('0x0'));var moment=require('moment');module[_0x568a('0x1')]={'closed':{'type':Sequelize[_0x568a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x568a('0x3')]},'secondDisposition':{'type':Sequelize[_0x568a('0x3')]},'thirdDisposition':{'type':Sequelize[_0x568a('0x3')]},'note':{'type':Sequelize[_0x568a('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x568a('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x568a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x568a('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x568a('0x6')]('in',_0x568a('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x568a('0x7')]}}; \ No newline at end of file +var _0x69d4=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x3284a9,_0x21e26e){var _0x3c56e9=function(_0xf8ece7){while(--_0xf8ece7){_0x3284a9['push'](_0x3284a9['shift']());}};_0x3c56e9(++_0x21e26e);}(_0x69d4,0x83));var _0x469d=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x69d4[_0x243b59];return _0x3e1676;};'use strict';var Sequelize=require(_0x469d('0x0'));var moment=require(_0x469d('0x1'));module['exports']={'closed':{'type':Sequelize[_0x469d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x469d('0x3')]},'disposition':{'type':Sequelize[_0x469d('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x469d('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x469d('0x4')]},'read1stAt':{'type':Sequelize[_0x469d('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x469d('0x5')]('in',_0x469d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x469d('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x469d('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x469d('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 0a003f5..be50882 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 _0xdd47=['hasOwnProperty','nolimit','where','pick','SmsInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','emit','removeTags','download','toString','root','files','join','User','push','CmContact','Contact','lastName','Messages','createdAt','direction','read','SmsAccount','Account','Owner','fullname','get','mkdirSync','Sms','closed','format','disposition','out','System','firstName','secret','value','renderFile','server','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','stack','name','send','index','SmsInteraction','rawAttributes','fieldName','type','getOptions','findAll','sms','user','catch','show','params','model','keys','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','create','body','update','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne'];(function(_0x2ae8ce,_0x2a5a1f){var _0x4bf686=function(_0x41cabf){while(--_0x41cabf){_0x2ae8ce['push'](_0x2ae8ce['shift']());}};_0x4bf686(++_0x2a5a1f);}(_0xdd47,0x12b));var _0x7dd4=function(_0x5d31f3,_0x4239b0){_0x5d31f3=_0x5d31f3-0x0;var _0x1cc88c=_0xdd47[_0x5d31f3];return _0x1cc88c;};'use strict';var rimraf=require(_0x7dd4('0x0'));var zipdir=require(_0x7dd4('0x1'));var moment=require(_0x7dd4('0x2'));var BPromise=require(_0x7dd4('0x3'));var util=require(_0x7dd4('0x4'));var path=require(_0x7dd4('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7dd4('0x6'));var Redis=require(_0x7dd4('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x7dd4('0x8'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x7dd4('0x9'));var config=require('../../config/environment');var db=require(_0x7dd4('0xa'))['db'];config[_0x7dd4('0xb')]=_[_0x7dd4('0xc')](config['redis'],{'host':_0x7dd4('0xd'),'port':0x18eb});var socket=require(_0x7dd4('0xe'))(new Redis(config[_0x7dd4('0xb')]));require('./smsInteraction.socket')[_0x7dd4('0xf')](socket);function respondWithStatusCode(_0x19341f,_0x751a58){_0x751a58=_0x751a58||0xcc;return function(_0x21e582){if(_0x21e582){return _0x19341f[_0x7dd4('0x10')](_0x751a58);}return _0x19341f[_0x7dd4('0x11')](_0x751a58)[_0x7dd4('0x12')]();};}function respondWithResult(_0x6d3cc4,_0x1fa6b3){_0x1fa6b3=_0x1fa6b3||0xc8;return function(_0xbfbac5){if(_0xbfbac5){return _0x6d3cc4[_0x7dd4('0x11')](_0x1fa6b3)[_0x7dd4('0x13')](_0xbfbac5);}};}function respondWithFilteredResult(_0x311199,_0x29d07f){return function(_0x45c37a){if(_0x45c37a){var _0x1559f2=typeof _0x29d07f[_0x7dd4('0x14')]===_0x7dd4('0x15')&&typeof _0x29d07f[_0x7dd4('0x16')]===_0x7dd4('0x15');var _0x55e01f=_0x45c37a[_0x7dd4('0x17')];var _0x5b2755=_0x1559f2?0x0:_0x29d07f[_0x7dd4('0x14')];var _0xf13f5b=_0x1559f2?_0x45c37a[_0x7dd4('0x17')]:_0x29d07f['offset']+_0x29d07f['limit'];var _0x13e554;if(_0xf13f5b>=_0x55e01f){_0xf13f5b=_0x55e01f;_0x13e554=0xc8;}else{_0x13e554=0xce;}_0x311199[_0x7dd4('0x11')](_0x13e554);return _0x311199[_0x7dd4('0x18')](_0x7dd4('0x19'),_0x5b2755+'-'+_0xf13f5b+'/'+_0x55e01f)[_0x7dd4('0x13')](_0x45c37a);}return null;};}function saveUpdates(_0x21435b){return function(_0x2af6bb){if(_0x2af6bb){return _0x2af6bb['update'](_0x21435b)[_0x7dd4('0x1a')](function(_0x24700e){return _0x24700e;});}return null;};}function removeEntity(_0xd80fbc){return function(_0x25cb5f){if(_0x25cb5f){return _0x25cb5f[_0x7dd4('0x1b')]()[_0x7dd4('0x1a')](function(){_0xd80fbc[_0x7dd4('0x11')](0xcc)[_0x7dd4('0x12')]();});}};}function handleEntityNotFound(_0x1a7d2e){return function(_0xbee8e2){if(!_0xbee8e2){_0x1a7d2e[_0x7dd4('0x10')](0x194);}return _0xbee8e2;};}function handleError(_0x14b524,_0x4e8a8e){_0x4e8a8e=_0x4e8a8e||0x1f4;return function(_0x234b3a){logger[_0x7dd4('0x1c')](_0x234b3a[_0x7dd4('0x1d')]);if(_0x234b3a['name']){delete _0x234b3a[_0x7dd4('0x1e')];}_0x14b524[_0x7dd4('0x11')](_0x4e8a8e)[_0x7dd4('0x1f')](_0x234b3a);};}exports[_0x7dd4('0x20')]=function(_0xb10af4,_0x16df3d){var _0x12696e={};var _0xf4aaf7=_['map'](db[_0x7dd4('0x21')][_0x7dd4('0x22')],function(_0x1a20cd){return{'name':_0x1a20cd[_0x7dd4('0x23')],'type':_0x1a20cd[_0x7dd4('0x24')]['key']};});_0x12696e=qs[_0x7dd4('0x25')](_0xf4aaf7,_0xb10af4);return interaction[_0x7dd4('0x26')](_0x7dd4('0x27'),_0xb10af4['query'],_0xb10af4[_0x7dd4('0x28')],_0x12696e,_0xf4aaf7)[_0x7dd4('0x1a')](respondWithFilteredResult(_0x16df3d,_0x12696e))[_0x7dd4('0x29')](handleError(_0x16df3d,null));};exports[_0x7dd4('0x2a')]=function(_0x629dba,_0x416847){var _0x59457a={'raw':![],'where':{'id':_0x629dba[_0x7dd4('0x2b')]['id']}},_0x401be2={};_0x401be2[_0x7dd4('0x2c')]=_[_0x7dd4('0x2d')](db[_0x7dd4('0x21')][_0x7dd4('0x22')]);_0x401be2[_0x7dd4('0x2e')]=_[_0x7dd4('0x2d')](_0x629dba['query']);_0x401be2[_0x7dd4('0x2f')]=_[_0x7dd4('0x30')](_0x401be2[_0x7dd4('0x2c')],_0x401be2[_0x7dd4('0x2e')]);_0x59457a['attributes']=_['intersection'](_0x401be2[_0x7dd4('0x2c')],qs[_0x7dd4('0x31')](_0x629dba[_0x7dd4('0x2e')][_0x7dd4('0x31')]));_0x59457a[_0x7dd4('0x32')]=_0x59457a[_0x7dd4('0x32')][_0x7dd4('0x33')]?_0x59457a['attributes']:_0x401be2[_0x7dd4('0x2c')];if(_0x629dba[_0x7dd4('0x2e')][_0x7dd4('0x34')]){_0x59457a[_0x7dd4('0x35')]=[{'all':!![]}];}_0x59457a=_[_0x7dd4('0x36')]({},_0x59457a,_0x629dba[_0x7dd4('0x37')]);return db[_0x7dd4('0x21')][_0x7dd4('0x38')](_0x59457a)[_0x7dd4('0x1a')](handleEntityNotFound(_0x416847,null))['then'](respondWithResult(_0x416847,null))[_0x7dd4('0x29')](handleError(_0x416847,null));};exports[_0x7dd4('0x39')]=function(_0x23ed1b,_0x211fc6){return db[_0x7dd4('0x21')][_0x7dd4('0x39')](_0x23ed1b[_0x7dd4('0x3a')],{})[_0x7dd4('0x1a')](respondWithResult(_0x211fc6,0xc9))[_0x7dd4('0x29')](handleError(_0x211fc6,null));};exports[_0x7dd4('0x3b')]=function(_0x3dfa56,_0x13b71e){if(_0x3dfa56[_0x7dd4('0x3a')]['id']){delete _0x3dfa56[_0x7dd4('0x3a')]['id'];}return db[_0x7dd4('0x21')][_0x7dd4('0x38')]({'where':{'id':_0x3dfa56[_0x7dd4('0x2b')]['id']}})[_0x7dd4('0x1a')](handleEntityNotFound(_0x13b71e,null))[_0x7dd4('0x1a')](saveUpdates(_0x3dfa56[_0x7dd4('0x3a')],null))[_0x7dd4('0x1a')](respondWithResult(_0x13b71e,null))[_0x7dd4('0x29')](handleError(_0x13b71e,null));};exports[_0x7dd4('0x1b')]=function(_0x74f219,_0x4da1fb){return db[_0x7dd4('0x21')][_0x7dd4('0x38')]({'where':{'id':_0x74f219[_0x7dd4('0x2b')]['id']}})[_0x7dd4('0x1a')](handleEntityNotFound(_0x4da1fb,null))['then'](removeEntity(_0x4da1fb,null))['catch'](handleError(_0x4da1fb,null));};exports['describe']=function(_0x4492c2,_0x20d3c5){return db[_0x7dd4('0x21')][_0x7dd4('0x3c')]()[_0x7dd4('0x1a')](respondWithResult(_0x20d3c5,null))[_0x7dd4('0x29')](handleError(_0x20d3c5,null));};exports[_0x7dd4('0x3d')]=function(_0x2545e2,_0x19a1fe){return db[_0x7dd4('0x3e')][_0x7dd4('0x38')]({'where':{'id':_0x2545e2[_0x7dd4('0x2b')]['id']}})[_0x7dd4('0x1a')](handleEntityNotFound(_0x19a1fe,null))[_0x7dd4('0x1a')](function(_0x22f085){if(_0x22f085){return _0x22f085['addMessage'](_0x2545e2[_0x7dd4('0x3a')][_0x7dd4('0x3f')],_[_0x7dd4('0x40')](_0x2545e2[_0x7dd4('0x3a')],['ids','id'])||{});}})[_0x7dd4('0x1a')](respondWithResult(_0x19a1fe,null))[_0x7dd4('0x29')](handleError(_0x19a1fe,null));};exports[_0x7dd4('0x41')]=function(_0x43e728,_0x2fe4e6){var _0x5ba93e={'raw':![],'where':{}};var _0x35f94c={};var _0x1a4b8b={'count':0x0,'rows':[]};return db[_0x7dd4('0x21')][_0x7dd4('0x42')]({'where':{'id':_0x43e728[_0x7dd4('0x2b')]['id']}})[_0x7dd4('0x1a')](handleEntityNotFound(_0x2fe4e6,null))[_0x7dd4('0x1a')](function(_0x54f3c7){if(_0x54f3c7){_0x35f94c[_0x7dd4('0x2c')]=_[_0x7dd4('0x2d')](db[_0x7dd4('0x3e')][_0x7dd4('0x22')]);_0x35f94c[_0x7dd4('0x2e')]=_[_0x7dd4('0x2d')](_0x43e728[_0x7dd4('0x2e')]);_0x35f94c['filters']=_[_0x7dd4('0x30')](_0x35f94c[_0x7dd4('0x2c')],_0x35f94c['query']);_0x5ba93e[_0x7dd4('0x32')]=_[_0x7dd4('0x30')](_0x35f94c[_0x7dd4('0x2c')],qs[_0x7dd4('0x31')](_0x43e728['query'][_0x7dd4('0x31')]));_0x5ba93e[_0x7dd4('0x32')]=_0x5ba93e[_0x7dd4('0x32')]['length']?_0x5ba93e['attributes']:_0x35f94c['model'];if(!_0x43e728[_0x7dd4('0x2e')][_0x7dd4('0x43')](_0x7dd4('0x44'))){_0x5ba93e['limit']=qs[_0x7dd4('0x16')](_0x43e728['query'][_0x7dd4('0x16')]);_0x5ba93e[_0x7dd4('0x14')]=qs[_0x7dd4('0x14')](_0x43e728[_0x7dd4('0x2e')][_0x7dd4('0x14')]);}_0x5ba93e['order']=qs['sort'](_0x43e728[_0x7dd4('0x2e')]['sort']);_0x5ba93e[_0x7dd4('0x45')]=qs[_0x7dd4('0x2f')](_[_0x7dd4('0x46')](_0x43e728[_0x7dd4('0x2e')],_0x35f94c['filters']));_0x5ba93e[_0x7dd4('0x45')][_0x7dd4('0x47')]=_0x54f3c7['id'];if(_0x43e728['query'][_0x7dd4('0x48')]){_0x5ba93e['where']=_[_0x7dd4('0x36')](_0x5ba93e['where'],{'$or':_[_0x7dd4('0x49')](_0x5ba93e['attributes'],function(_0x318f02){var _0x381c57={};_0x381c57[_0x318f02]={'$like':'%'+_0x43e728[_0x7dd4('0x2e')][_0x7dd4('0x48')]+'%'};return _0x381c57;})});}if(_0x43e728[_0x7dd4('0x2e')][_0x7dd4('0x4a')]){var _0x5192e7=_0x43e728[_0x7dd4('0x2e')][_0x7dd4('0x4a')][_0x7dd4('0x4b')](',');var _0x1c51a6={};_0x1c51a6[_0x5192e7[0x0]]={'$gte':moment(_0x5192e7[0x1])['format'](_0x7dd4('0x4c'))};_0x5ba93e[_0x7dd4('0x45')]=_[_0x7dd4('0x36')](_0x5ba93e[_0x7dd4('0x45')],_0x1c51a6);}_0x5ba93e=_[_0x7dd4('0x36')]({},_0x5ba93e,_0x43e728[_0x7dd4('0x37')]);return db['SmsMessage']['count']({'where':_0x5ba93e[_0x7dd4('0x45')]})['then'](function(_0x42f065){_0x1a4b8b[_0x7dd4('0x17')]=_0x42f065;if(_0x43e728[_0x7dd4('0x2e')][_0x7dd4('0x34')]){_0x5ba93e[_0x7dd4('0x35')]=[{'all':!![]}];}return db[_0x7dd4('0x3e')]['findAll'](_0x5ba93e);})[_0x7dd4('0x1a')](function(_0x3049ac){_0x1a4b8b[_0x7dd4('0x4d')]=_0x3049ac;return _0x1a4b8b;});}})[_0x7dd4('0x1a')](respondWithFilteredResult(_0x2fe4e6,_0x5ba93e))[_0x7dd4('0x29')](handleError(_0x2fe4e6,null));};exports[_0x7dd4('0x4e')]=function(_0x21a8db,_0x1582f7){return db['SmsInteraction'][_0x7dd4('0x38')]({'where':{'id':_0x21a8db[_0x7dd4('0x2b')]['id']}})[_0x7dd4('0x1a')](handleEntityNotFound(_0x1582f7,null))[_0x7dd4('0x1a')](function(_0x231a10){if(_0x231a10){return _0x231a10[_0x7dd4('0x4f')](_0x21a8db[_0x7dd4('0x3a')][_0x7dd4('0x3f')],_[_0x7dd4('0x40')](_0x21a8db['body'],[_0x7dd4('0x3f'),'id'])||{})[_0x7dd4('0x50')](function(){return db[_0x7dd4('0x51')]['findAll']({'attributes':['id',_0x7dd4('0x1e'),'color'],'where':{'id':_0x21a8db[_0x7dd4('0x3a')][_0x7dd4('0x3f')]}});})[_0x7dd4('0x1a')](function(_0x4d6318){socket[_0x7dd4('0x52')]('smsInteractionTags:save',{'id':Number(_0x21a8db[_0x7dd4('0x2b')]['id']),'tags':_0x4d6318||[]});return{'id':Number(_0x21a8db['params']['id']),'tags':_0x4d6318||[]};});}})[_0x7dd4('0x1a')](respondWithResult(_0x1582f7,null))[_0x7dd4('0x29')](handleError(_0x1582f7,null));};exports[_0x7dd4('0x53')]=function(_0xf4479b,_0x353e32){return db[_0x7dd4('0x21')][_0x7dd4('0x38')]({'where':{'id':_0xf4479b[_0x7dd4('0x2b')]['id']}})['then'](handleEntityNotFound(_0x353e32,null))[_0x7dd4('0x1a')](function(_0x300215){if(_0x300215){return _0x300215[_0x7dd4('0x53')](_0xf4479b[_0x7dd4('0x2e')][_0x7dd4('0x3f')]);}})[_0x7dd4('0x1a')](respondWithStatusCode(_0x353e32,null))[_0x7dd4('0x29')](handleError(_0x353e32,null));};exports[_0x7dd4('0x54')]=function(_0x14cbcf,_0x325e43){var _0x208b3c=moment()['unix']()[_0x7dd4('0x55')]();var _0x3200af=path['join'](config[_0x7dd4('0x56')],'server',_0x7dd4('0x57'),'tmp');var _0x161317=path[_0x7dd4('0x58')](_0x3200af,_0x208b3c);var _0x5bb8c4=util['format']('transcript-%d-%s.zip',_0x14cbcf['params']['id'],_0x208b3c);var _0x767962=path[_0x7dd4('0x58')](_0x3200af,_0x5bb8c4);var _0x5f3ed2=[];_0x5f3ed2['push']({'model':db[_0x7dd4('0x59')],'as':_0x7dd4('0x59'),'attributes':['id','fullname'],'raw':!![]});_0x5f3ed2[_0x7dd4('0x5a')]({'model':db[_0x7dd4('0x5b')],'as':_0x7dd4('0x5c'),'attributes':['id','firstName',_0x7dd4('0x5d')],'raw':!![]});var _0x20fd21=[{'model':db['SmsMessage'],'as':_0x7dd4('0x5e'),'attributes':['id',_0x7dd4('0x3a'),_0x7dd4('0x5f'),_0x7dd4('0x60'),'secret',_0x7dd4('0x61')],'include':_0x5f3ed2}];_0x20fd21['push']({'model':db[_0x7dd4('0x62')],'as':_0x7dd4('0x63'),'attributes':['id',_0x7dd4('0x1e')]});_0x20fd21[_0x7dd4('0x5a')]({'model':db[_0x7dd4('0x59')],'as':_0x7dd4('0x64'),'attributes':['id',_0x7dd4('0x65')]});return db[_0x7dd4('0x21')][_0x7dd4('0x38')]({'where':{'id':_0x14cbcf[_0x7dd4('0x2b')]['id']},'include':_0x20fd21})[_0x7dd4('0x1a')](handleEntityNotFound(_0x325e43,null))[_0x7dd4('0x1a')](function(_0x5a3c48){if(_0x5a3c48){var _0x34f6e8=_0x5a3c48[_0x7dd4('0x66')]({'plain':!![]});fs[_0x7dd4('0x67')](_0x161317);var _0x2dc110={'channel':_0x7dd4('0x68'),'account':_0x34f6e8['Account']['name'],'agent':_0x34f6e8[_0x7dd4('0x64')]?_0x34f6e8[_0x7dd4('0x64')][_0x7dd4('0x65')]:'N.A.','createdAt':moment(_0x34f6e8[_0x7dd4('0x5f')])['format'](_0x7dd4('0x4c'))[_0x7dd4('0x55')](),'closedAt':_0x34f6e8[_0x7dd4('0x69')]?moment(_0x34f6e8['closedAt'])[_0x7dd4('0x6a')](_0x7dd4('0x4c'))[_0x7dd4('0x55')]():'','disposition':_0x34f6e8[_0x7dd4('0x6b')],'messages':_(_0x34f6e8[_0x7dd4('0x5e')])[_0x7dd4('0x48')]({'secret':![]})[_0x7dd4('0x49')](function(_0x2f6f75){return{'date':moment(_0x2f6f75['createdAt'])['format'](_0x7dd4('0x4c'))[_0x7dd4('0x55')](),'sender':_0x2f6f75['direction']===_0x7dd4('0x6c')?_0x2f6f75[_0x7dd4('0x59')]?_0x2f6f75[_0x7dd4('0x59')][_0x7dd4('0x65')]:_0x7dd4('0x6d'):_0x2f6f75['Contact'][_0x7dd4('0x6e')]+(_0x2f6f75[_0x7dd4('0x5c')][_0x7dd4('0x5d')]?'\x20'+_0x2f6f75['Contact'][_0x7dd4('0x5d')]:''),'body':_0x2f6f75[_0x7dd4('0x3a')],'direction':_0x2f6f75[_0x7dd4('0x60')]===_0x7dd4('0x6c')?'A':'C','secret':_0x2f6f75[_0x7dd4('0x6f')],'read':_0x2f6f75[_0x7dd4('0x61')]};})[_0x7dd4('0x70')]()};return ejs[_0x7dd4('0x71')](path['join'](config[_0x7dd4('0x56')],_0x7dd4('0x72'),_0x7dd4('0x73'),'downloadInteraction.ejs'),{'interaction':_0x2dc110})['then'](function(_0x11e97c){var _0x420e8b=path[_0x7dd4('0x58')](_0x161317,_0x7dd4('0x74')+_0x34f6e8['id']+'-'+_0x208b3c+_0x7dd4('0x75'));var _0x5b2301={'path':_0x420e8b,'channel':_0x7dd4('0x68'),'interactionId':_0x34f6e8['id']};return pdf[_0x7dd4('0x76')](_0x11e97c,_0x5b2301);})[_0x7dd4('0x1a')](function(){return new BPromise(function(_0x5357fa,_0x453cfb){zipdir(_0x161317,{'saveTo':_0x767962},function(_0x1dcc8b,_0x46b5c4){if(_0x1dcc8b)return _0x453cfb(_0x1dcc8b);return _0x5357fa(_0x46b5c4);});})[_0x7dd4('0x1a')](function(){return new BPromise(function(_0x4b3433,_0x379474){rimraf(_0x161317,function(_0x89666f){if(_0x89666f)_0x379474(_0x89666f);return _0x4b3433();});});})[_0x7dd4('0x1a')](function(){return _0x325e43[_0x7dd4('0x54')](_0x767962,_0x5bb8c4,function(_0x5dd81f){if(_0x5dd81f){console[_0x7dd4('0x77')](_0x7dd4('0x78'),_0x5dd81f);}else{fs[_0x7dd4('0x79')](_0x767962);}});});});}else{return _0x325e43['sendStatus'](0xc8);}})[_0x7dd4('0x29')](handleError(_0x325e43,null));}; \ No newline at end of file +var _0x5cfd=['model','keys','filters','fields','attributes','length','includeAll','include','merge','catch','create','body','find','params','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','intersection','nolimit','order','sort','pick','where','SmsInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','unix','toString','join','server','tmp','push','User','CmContact','Contact','firstName','lastName','Messages','direction','read','SmsAccount','Account','Owner','get','Sms','N.A.','createdAt','closed','closedAt','filter','out','fullname','secret','renderFile','root','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','rimraf','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','update','destroy','name','index','map','SmsInteraction','rawAttributes','key','getOptions','findAll','sms','query','then','show'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5cfd,0x1ad));var _0xd5cf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5cfd[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0xd5cf('0x0'));var zipdir=require('zip-dir');var moment=require(_0xd5cf('0x1'));var BPromise=require('bluebird');var util=require(_0xd5cf('0x2'));var path=require(_0xd5cf('0x3'));var ejs=require(_0xd5cf('0x4'));var fs=require('fs');var _=require(_0xd5cf('0x5'));var Redis=require(_0xd5cf('0x6'));var interaction=require(_0xd5cf('0x7'));var qs=require(_0xd5cf('0x8'));var pdf=require(_0xd5cf('0x9'));var logger=require(_0xd5cf('0xa'))(_0xd5cf('0xb'));var config=require(_0xd5cf('0xc'));var db=require(_0xd5cf('0xd'))['db'];config['redis']=_[_0xd5cf('0xe')](config[_0xd5cf('0xf')],{'host':_0xd5cf('0x10'),'port':0x18eb});var socket=require(_0xd5cf('0x11'))(new Redis(config[_0xd5cf('0xf')]));require(_0xd5cf('0x12'))['register'](socket);function respondWithStatusCode(_0x465c5a,_0x4aeb9f){_0x4aeb9f=_0x4aeb9f||0xcc;return function(_0x5b29d1){if(_0x5b29d1){return _0x465c5a[_0xd5cf('0x13')](_0x4aeb9f);}return _0x465c5a[_0xd5cf('0x14')](_0x4aeb9f)[_0xd5cf('0x15')]();};}function respondWithResult(_0x1a5558,_0x2dbe1f){_0x2dbe1f=_0x2dbe1f||0xc8;return function(_0x268951){if(_0x268951){return _0x1a5558[_0xd5cf('0x14')](_0x2dbe1f)[_0xd5cf('0x16')](_0x268951);}};}function respondWithFilteredResult(_0x465e94,_0x4eb74b){return function(_0x4de9b3){if(_0x4de9b3){var _0x467fec=typeof _0x4eb74b['offset']===_0xd5cf('0x17')&&typeof _0x4eb74b['limit']==='undefined';var _0x18e8dd=_0x4de9b3[_0xd5cf('0x18')];var _0x1ff4d9=_0x467fec?0x0:_0x4eb74b[_0xd5cf('0x19')];var _0x45c603=_0x467fec?_0x4de9b3[_0xd5cf('0x18')]:_0x4eb74b[_0xd5cf('0x19')]+_0x4eb74b[_0xd5cf('0x1a')];var _0x170097;if(_0x45c603>=_0x18e8dd){_0x45c603=_0x18e8dd;_0x170097=0xc8;}else{_0x170097=0xce;}_0x465e94[_0xd5cf('0x14')](_0x170097);return _0x465e94[_0xd5cf('0x1b')](_0xd5cf('0x1c'),_0x1ff4d9+'-'+_0x45c603+'/'+_0x18e8dd)['json'](_0x4de9b3);}return null;};}function saveUpdates(_0x1d0f90){return function(_0x11a017){if(_0x11a017){return _0x11a017[_0xd5cf('0x1d')](_0x1d0f90)['then'](function(_0x1eb9a2){return _0x1eb9a2;});}return null;};}function removeEntity(_0x23c243){return function(_0x302513){if(_0x302513){return _0x302513[_0xd5cf('0x1e')]()['then'](function(){_0x23c243[_0xd5cf('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2652a2){return function(_0x58d8cd){if(!_0x58d8cd){_0x2652a2[_0xd5cf('0x13')](0x194);}return _0x58d8cd;};}function handleError(_0x59d372,_0x5c2913){_0x5c2913=_0x5c2913||0x1f4;return function(_0x3c7216){logger['error'](_0x3c7216['stack']);if(_0x3c7216[_0xd5cf('0x1f')]){delete _0x3c7216[_0xd5cf('0x1f')];}_0x59d372['status'](_0x5c2913)['send'](_0x3c7216);};}exports[_0xd5cf('0x20')]=function(_0x282e47,_0xda657c){var _0x371f9f={};var _0x280346=_[_0xd5cf('0x21')](db[_0xd5cf('0x22')][_0xd5cf('0x23')],function(_0x59a918){return{'name':_0x59a918['fieldName'],'type':_0x59a918['type'][_0xd5cf('0x24')]};});_0x371f9f=qs[_0xd5cf('0x25')](_0x280346,_0x282e47);return interaction[_0xd5cf('0x26')](_0xd5cf('0x27'),_0x282e47[_0xd5cf('0x28')],_0x282e47['user'],_0x371f9f,_0x280346)[_0xd5cf('0x29')](respondWithFilteredResult(_0xda657c,_0x371f9f))['catch'](handleError(_0xda657c,null));};exports[_0xd5cf('0x2a')]=function(_0x3e3093,_0x53bb8f){var _0x29310c={'raw':![],'where':{'id':_0x3e3093['params']['id']}},_0x45f9b1={};_0x45f9b1[_0xd5cf('0x2b')]=_['keys'](db[_0xd5cf('0x22')]['rawAttributes']);_0x45f9b1[_0xd5cf('0x28')]=_[_0xd5cf('0x2c')](_0x3e3093[_0xd5cf('0x28')]);_0x45f9b1[_0xd5cf('0x2d')]=_['intersection'](_0x45f9b1[_0xd5cf('0x2b')],_0x45f9b1[_0xd5cf('0x28')]);_0x29310c['attributes']=_['intersection'](_0x45f9b1[_0xd5cf('0x2b')],qs[_0xd5cf('0x2e')](_0x3e3093[_0xd5cf('0x28')][_0xd5cf('0x2e')]));_0x29310c['attributes']=_0x29310c[_0xd5cf('0x2f')][_0xd5cf('0x30')]?_0x29310c[_0xd5cf('0x2f')]:_0x45f9b1[_0xd5cf('0x2b')];if(_0x3e3093[_0xd5cf('0x28')][_0xd5cf('0x31')]){_0x29310c[_0xd5cf('0x32')]=[{'all':!![]}];}_0x29310c=_[_0xd5cf('0x33')]({},_0x29310c,_0x3e3093['options']);return db[_0xd5cf('0x22')]['find'](_0x29310c)['then'](handleEntityNotFound(_0x53bb8f,null))[_0xd5cf('0x29')](respondWithResult(_0x53bb8f,null))[_0xd5cf('0x34')](handleError(_0x53bb8f,null));};exports['create']=function(_0x5d38e7,_0x37416e){return db[_0xd5cf('0x22')][_0xd5cf('0x35')](_0x5d38e7[_0xd5cf('0x36')],{})[_0xd5cf('0x29')](respondWithResult(_0x37416e,0xc9))[_0xd5cf('0x34')](handleError(_0x37416e,null));};exports[_0xd5cf('0x1d')]=function(_0x40543b,_0x3d1a6e){if(_0x40543b[_0xd5cf('0x36')]['id']){delete _0x40543b['body']['id'];}return db[_0xd5cf('0x22')][_0xd5cf('0x37')]({'where':{'id':_0x40543b[_0xd5cf('0x38')]['id']}})['then'](handleEntityNotFound(_0x3d1a6e,null))[_0xd5cf('0x29')](saveUpdates(_0x40543b['body'],null))[_0xd5cf('0x29')](respondWithResult(_0x3d1a6e,null))[_0xd5cf('0x34')](handleError(_0x3d1a6e,null));};exports[_0xd5cf('0x1e')]=function(_0x3ceb81,_0x55bbfb){return db[_0xd5cf('0x22')]['find']({'where':{'id':_0x3ceb81['params']['id']}})[_0xd5cf('0x29')](handleEntityNotFound(_0x55bbfb,null))[_0xd5cf('0x29')](removeEntity(_0x55bbfb,null))[_0xd5cf('0x34')](handleError(_0x55bbfb,null));};exports[_0xd5cf('0x39')]=function(_0x2cba2d,_0x2bc342){return db['SmsInteraction']['describe']()[_0xd5cf('0x29')](respondWithResult(_0x2bc342,null))[_0xd5cf('0x34')](handleError(_0x2bc342,null));};exports[_0xd5cf('0x3a')]=function(_0x369dfb,_0x48b3aa){return db[_0xd5cf('0x3b')][_0xd5cf('0x37')]({'where':{'id':_0x369dfb['params']['id']}})['then'](handleEntityNotFound(_0x48b3aa,null))['then'](function(_0x18689a){if(_0x18689a){return _0x18689a[_0xd5cf('0x3a')](_0x369dfb['body'][_0xd5cf('0x3c')],_[_0xd5cf('0x3d')](_0x369dfb['body'],['ids','id'])||{});}})[_0xd5cf('0x29')](respondWithResult(_0x48b3aa,null))[_0xd5cf('0x34')](handleError(_0x48b3aa,null));};exports[_0xd5cf('0x3e')]=function(_0x27580f,_0x3801bb){var _0x28f6d5={'raw':![],'where':{}};var _0x7e3d74={};var _0x323a84={'count':0x0,'rows':[]};return db[_0xd5cf('0x22')][_0xd5cf('0x3f')]({'where':{'id':_0x27580f['params']['id']}})['then'](handleEntityNotFound(_0x3801bb,null))[_0xd5cf('0x29')](function(_0x2f3f3e){if(_0x2f3f3e){_0x7e3d74[_0xd5cf('0x2b')]=_[_0xd5cf('0x2c')](db[_0xd5cf('0x3b')][_0xd5cf('0x23')]);_0x7e3d74[_0xd5cf('0x28')]=_[_0xd5cf('0x2c')](_0x27580f['query']);_0x7e3d74['filters']=_[_0xd5cf('0x40')](_0x7e3d74[_0xd5cf('0x2b')],_0x7e3d74[_0xd5cf('0x28')]);_0x28f6d5[_0xd5cf('0x2f')]=_[_0xd5cf('0x40')](_0x7e3d74[_0xd5cf('0x2b')],qs['fields'](_0x27580f[_0xd5cf('0x28')]['fields']));_0x28f6d5[_0xd5cf('0x2f')]=_0x28f6d5[_0xd5cf('0x2f')]['length']?_0x28f6d5[_0xd5cf('0x2f')]:_0x7e3d74[_0xd5cf('0x2b')];if(!_0x27580f[_0xd5cf('0x28')]['hasOwnProperty'](_0xd5cf('0x41'))){_0x28f6d5[_0xd5cf('0x1a')]=qs[_0xd5cf('0x1a')](_0x27580f[_0xd5cf('0x28')][_0xd5cf('0x1a')]);_0x28f6d5[_0xd5cf('0x19')]=qs['offset'](_0x27580f[_0xd5cf('0x28')][_0xd5cf('0x19')]);}_0x28f6d5[_0xd5cf('0x42')]=qs[_0xd5cf('0x43')](_0x27580f[_0xd5cf('0x28')]['sort']);_0x28f6d5['where']=qs[_0xd5cf('0x2d')](_[_0xd5cf('0x44')](_0x27580f[_0xd5cf('0x28')],_0x7e3d74[_0xd5cf('0x2d')]));_0x28f6d5[_0xd5cf('0x45')][_0xd5cf('0x46')]=_0x2f3f3e['id'];if(_0x27580f[_0xd5cf('0x28')]['filter']){_0x28f6d5[_0xd5cf('0x45')]=_[_0xd5cf('0x33')](_0x28f6d5[_0xd5cf('0x45')],{'$or':_[_0xd5cf('0x21')](_0x28f6d5[_0xd5cf('0x2f')],function(_0x87c98c){var _0x30df27={};_0x30df27[_0x87c98c]={'$like':'%'+_0x27580f[_0xd5cf('0x28')]['filter']+'%'};return _0x30df27;})});}if(_0x27580f[_0xd5cf('0x28')]['$gte']){var _0x2b5771=_0x27580f['query'][_0xd5cf('0x47')][_0xd5cf('0x48')](',');var _0x2a40f9={};_0x2a40f9[_0x2b5771[0x0]]={'$gte':moment(_0x2b5771[0x1])[_0xd5cf('0x49')](_0xd5cf('0x4a'))};_0x28f6d5[_0xd5cf('0x45')]=_['merge'](_0x28f6d5[_0xd5cf('0x45')],_0x2a40f9);}_0x28f6d5=_[_0xd5cf('0x33')]({},_0x28f6d5,_0x27580f[_0xd5cf('0x4b')]);return db['SmsMessage'][_0xd5cf('0x18')]({'where':_0x28f6d5[_0xd5cf('0x45')]})[_0xd5cf('0x29')](function(_0x53d787){_0x323a84[_0xd5cf('0x18')]=_0x53d787;if(_0x27580f[_0xd5cf('0x28')][_0xd5cf('0x31')]){_0x28f6d5['include']=[{'all':!![]}];}return db[_0xd5cf('0x3b')][_0xd5cf('0x26')](_0x28f6d5);})[_0xd5cf('0x29')](function(_0x415470){_0x323a84['rows']=_0x415470;return _0x323a84;});}})[_0xd5cf('0x29')](respondWithFilteredResult(_0x3801bb,_0x28f6d5))[_0xd5cf('0x34')](handleError(_0x3801bb,null));};exports['addTags']=function(_0x34e47a,_0x3fce89){return db[_0xd5cf('0x22')]['find']({'where':{'id':_0x34e47a[_0xd5cf('0x38')]['id']}})[_0xd5cf('0x29')](handleEntityNotFound(_0x3fce89,null))['then'](function(_0xc69bfa){if(_0xc69bfa){return _0xc69bfa[_0xd5cf('0x4c')](_0x34e47a[_0xd5cf('0x36')]['ids'],_['omit'](_0x34e47a[_0xd5cf('0x36')],[_0xd5cf('0x3c'),'id'])||{})[_0xd5cf('0x4d')](function(){return db[_0xd5cf('0x4e')][_0xd5cf('0x26')]({'attributes':['id',_0xd5cf('0x1f'),_0xd5cf('0x4f')],'where':{'id':_0x34e47a[_0xd5cf('0x36')][_0xd5cf('0x3c')]}});})[_0xd5cf('0x29')](function(_0x537aec){socket[_0xd5cf('0x50')](_0xd5cf('0x51'),{'id':Number(_0x34e47a[_0xd5cf('0x38')]['id']),'tags':_0x537aec||[]});return{'id':Number(_0x34e47a[_0xd5cf('0x38')]['id']),'tags':_0x537aec||[]};});}})[_0xd5cf('0x29')](respondWithResult(_0x3fce89,null))[_0xd5cf('0x34')](handleError(_0x3fce89,null));};exports[_0xd5cf('0x52')]=function(_0x60ef9,_0xa76dc2){return db[_0xd5cf('0x22')][_0xd5cf('0x37')]({'where':{'id':_0x60ef9[_0xd5cf('0x38')]['id']}})[_0xd5cf('0x29')](handleEntityNotFound(_0xa76dc2,null))[_0xd5cf('0x29')](function(_0x3fdeac){if(_0x3fdeac){return _0x3fdeac[_0xd5cf('0x52')](_0x60ef9[_0xd5cf('0x28')][_0xd5cf('0x3c')]);}})[_0xd5cf('0x29')](respondWithStatusCode(_0xa76dc2,null))[_0xd5cf('0x34')](handleError(_0xa76dc2,null));};exports['download']=function(_0x35bddb,_0x5b4838){var _0x208720=moment()[_0xd5cf('0x53')]()[_0xd5cf('0x54')]();var _0x465586=path[_0xd5cf('0x55')](config['root'],_0xd5cf('0x56'),'files',_0xd5cf('0x57'));var _0xf3911b=path[_0xd5cf('0x55')](_0x465586,_0x208720);var _0x354207=util['format']('transcript-%d-%s.zip',_0x35bddb[_0xd5cf('0x38')]['id'],_0x208720);var _0x148a39=path[_0xd5cf('0x55')](_0x465586,_0x354207);var _0x55e6d2=[];_0x55e6d2[_0xd5cf('0x58')]({'model':db['User'],'as':_0xd5cf('0x59'),'attributes':['id','fullname'],'raw':!![]});_0x55e6d2[_0xd5cf('0x58')]({'model':db[_0xd5cf('0x5a')],'as':_0xd5cf('0x5b'),'attributes':['id',_0xd5cf('0x5c'),_0xd5cf('0x5d')],'raw':!![]});var _0x2b8244=[{'model':db[_0xd5cf('0x3b')],'as':_0xd5cf('0x5e'),'attributes':['id',_0xd5cf('0x36'),'createdAt',_0xd5cf('0x5f'),'secret',_0xd5cf('0x60')],'include':_0x55e6d2}];_0x2b8244[_0xd5cf('0x58')]({'model':db[_0xd5cf('0x61')],'as':_0xd5cf('0x62'),'attributes':['id','name']});_0x2b8244[_0xd5cf('0x58')]({'model':db[_0xd5cf('0x59')],'as':_0xd5cf('0x63'),'attributes':['id','fullname']});return db['SmsInteraction'][_0xd5cf('0x37')]({'where':{'id':_0x35bddb['params']['id']},'include':_0x2b8244})[_0xd5cf('0x29')](handleEntityNotFound(_0x5b4838,null))[_0xd5cf('0x29')](function(_0xebf3b){if(_0xebf3b){var _0xc19c19=_0xebf3b[_0xd5cf('0x64')]({'plain':!![]});fs['mkdirSync'](_0xf3911b);var _0xd79151={'channel':_0xd5cf('0x65'),'account':_0xc19c19[_0xd5cf('0x62')][_0xd5cf('0x1f')],'agent':_0xc19c19[_0xd5cf('0x63')]?_0xc19c19[_0xd5cf('0x63')]['fullname']:_0xd5cf('0x66'),'createdAt':moment(_0xc19c19[_0xd5cf('0x67')])[_0xd5cf('0x49')](_0xd5cf('0x4a'))['toString'](),'closedAt':_0xc19c19[_0xd5cf('0x68')]?moment(_0xc19c19[_0xd5cf('0x69')])[_0xd5cf('0x49')](_0xd5cf('0x4a'))[_0xd5cf('0x54')]():'','disposition':_0xc19c19['disposition'],'messages':_(_0xc19c19[_0xd5cf('0x5e')])[_0xd5cf('0x6a')]({'secret':![]})[_0xd5cf('0x21')](function(_0x49806f){return{'date':moment(_0x49806f[_0xd5cf('0x67')])[_0xd5cf('0x49')](_0xd5cf('0x4a'))[_0xd5cf('0x54')](),'sender':_0x49806f[_0xd5cf('0x5f')]===_0xd5cf('0x6b')?_0x49806f[_0xd5cf('0x59')]?_0x49806f[_0xd5cf('0x59')][_0xd5cf('0x6c')]:'System':_0x49806f[_0xd5cf('0x5b')][_0xd5cf('0x5c')]+(_0x49806f['Contact'][_0xd5cf('0x5d')]?'\x20'+_0x49806f[_0xd5cf('0x5b')][_0xd5cf('0x5d')]:''),'body':_0x49806f[_0xd5cf('0x36')],'direction':_0x49806f['direction']==='out'?'A':'C','secret':_0x49806f[_0xd5cf('0x6d')],'read':_0x49806f['read']};})['value']()};return ejs[_0xd5cf('0x6e')](path[_0xd5cf('0x55')](config[_0xd5cf('0x6f')],_0xd5cf('0x56'),_0xd5cf('0x70'),_0xd5cf('0x71')),{'interaction':_0xd79151})[_0xd5cf('0x29')](function(_0xf1714f){var _0x2e4386=path[_0xd5cf('0x55')](_0xf3911b,_0xd5cf('0x72')+_0xc19c19['id']+'-'+_0x208720+'.pdf');var _0x4e3fb1={'path':_0x2e4386,'channel':'Sms','interactionId':_0xc19c19['id']};return pdf[_0xd5cf('0x73')](_0xf1714f,_0x4e3fb1);})[_0xd5cf('0x29')](function(){return new BPromise(function(_0x29ed65,_0x1f6de4){zipdir(_0xf3911b,{'saveTo':_0x148a39},function(_0xd12254,_0x4eedcc){if(_0xd12254)return _0x1f6de4(_0xd12254);return _0x29ed65(_0x4eedcc);});})[_0xd5cf('0x29')](function(){return new BPromise(function(_0x103572,_0x3a516d){rimraf(_0xf3911b,function(_0x129ace){if(_0x129ace)_0x3a516d(_0x129ace);return _0x103572();});});})['then'](function(){return _0x5b4838['download'](_0x148a39,_0x354207,function(_0x2b8ab6){if(_0x2b8ab6){console['log'](_0xd5cf('0x74'),_0x2b8ab6);}else{fs[_0xd5cf('0x75')](_0x148a39);}});});});}else{return _0x5b4838['sendStatus'](0xc8);}})[_0xd5cf('0x34')](handleError(_0x5b4838,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 555732c..9643eb6 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 _0x36ee=['getUsers','then','Users','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','exports','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x36ee,0xe8));var _0xe36e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36ee[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0xe36e('0x0')];var SmsMessage=require('../../mysqldb')['db'][_0xe36e('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xe36e('0x2')](0x0);var events={'afterCreate':_0xe36e('0x3'),'afterUpdate':_0xe36e('0x4'),'afterDestroy':_0xe36e('0x5')};function emitEvent(_0x1118af){return function(_0x29e692,_0x3f29e1,_0x25a07d){_0x29e692[_0xe36e('0x6')]({'attributes':['id'],'raw':!![]})[_0xe36e('0x7')](function(_0x1aa596){_0x29e692['setDataValue'](_0xe36e('0x8'),_0x1aa596['map'](function(_0x2236e9){return{'id':_0x2236e9['id']};}));return SmsMessage[_0xe36e('0x9')]({'where':{'SmsInteractionId':_0x29e692['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe36e('0x7')](function(_0x47ce3a){_0x29e692[_0xe36e('0xa')]('unreadMessages',_0x47ce3a[_0xe36e('0xb')]);SmsInteractionEvents[_0xe36e('0xc')](_0x1118af+':'+_0x29e692['id'],_0x29e692);SmsInteractionEvents[_0xe36e('0xc')](_0x1118af,_0x29e692);_0x25a07d(null);})[_0xe36e('0xd')](_0x25a07d(null));};}for(var e in events){if(events[_0xe36e('0xe')](e)){var event=events[e];SmsInteraction[_0xe36e('0xf')](e,emitEvent(event));}}module[_0xe36e('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0x3de3=['length','emit','catch','hasOwnProperty','hook','exports','events','SmsInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','findAll','then','unreadMessages'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x3de3,0x1ce));var _0x33de=function(_0x47195d,_0x4014a1){_0x47195d=_0x47195d-0x0;var _0x257827=_0x3de3[_0x47195d];return _0x257827;};'use strict';var EventEmitter=require(_0x33de('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x33de('0x1')];var SmsMessage=require(_0x33de('0x2'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x33de('0x3')](0x0);var events={'afterCreate':_0x33de('0x4'),'afterUpdate':_0x33de('0x5'),'afterDestroy':_0x33de('0x6')};function emitEvent(_0x56b413){return function(_0x11c87e,_0x9382cb,_0x558f98){_0x11c87e[_0x33de('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x13afea){_0x11c87e[_0x33de('0x8')](_0x33de('0x9'),_0x13afea['map'](function(_0x2074fe){return{'id':_0x2074fe['id']};}));return SmsMessage[_0x33de('0xa')]({'where':{'SmsInteractionId':_0x11c87e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x33de('0xb')](function(_0x5e1be7){_0x11c87e[_0x33de('0x8')](_0x33de('0xc'),_0x5e1be7[_0x33de('0xd')]);SmsInteractionEvents[_0x33de('0xe')](_0x56b413+':'+_0x11c87e['id'],_0x11c87e);SmsInteractionEvents[_0x33de('0xe')](_0x56b413,_0x11c87e);_0x558f98(null);})[_0x33de('0xf')](_0x558f98(null));};}for(var e in events){if(events[_0x33de('0x10')](e)){var event=events[e];SmsInteraction[_0x33de('0x11')](e,emitEvent(event));}}module[_0x33de('0x12')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index fe2f00a..c0927ec 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 _0xc61f=['closed','closedAt','format','util','../../config/logger','api','bluebird','request-promise','path','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed'];(function(_0x5162d4,_0x5e6ad2){var _0x3a82c8=function(_0x5303ed){while(--_0x5303ed){_0x5162d4['push'](_0x5162d4['shift']());}};_0x3a82c8(++_0x5e6ad2);}(_0xc61f,0x1c5));var _0xfc61=function(_0x2f458b,_0x28c8b0){_0x2f458b=_0x2f458b-0x0;var _0x1c015b=_0xc61f[_0x2f458b];return _0x1c015b;};'use strict';var _=require('lodash');var util=require(_0xfc61('0x0'));var logger=require(_0xfc61('0x1'))(_0xfc61('0x2'));var moment=require('moment');var BPromise=require(_0xfc61('0x3'));var rp=require(_0xfc61('0x4'));var fs=require('fs');var path=require(_0xfc61('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfc61('0x6'));module[_0xfc61('0x7')]=function(_0x23cf9e,_0x4db527){return _0x23cf9e[_0xfc61('0x8')](_0xfc61('0x9'),attributes,{'tableName':_0xfc61('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x21bfad,_0x4f345b,_0x59efc7){if(_0x21bfad[_0xfc61('0xb')](_0xfc61('0xc'))){_0x21bfad[_0xfc61('0xd')]=moment()[_0xfc61('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x59efc7(null,_0x21bfad);}}});}; \ No newline at end of file +var _0xe1b7=['./smsInteraction.attributes','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x548449,_0x5cb2e5){var _0x4c0c2a=function(_0xca7048){while(--_0xca7048){_0x548449['push'](_0x548449['shift']());}};_0x4c0c2a(++_0x5cb2e5);}(_0xe1b7,0x14b));var _0x7e1b=function(_0x5ac8ee,_0x5a888e){_0x5ac8ee=_0x5ac8ee-0x0;var _0x2afd32=_0xe1b7[_0x5ac8ee];return _0x2afd32;};'use strict';var _=require('lodash');var util=require(_0x7e1b('0x0'));var logger=require(_0x7e1b('0x1'))(_0x7e1b('0x2'));var moment=require(_0x7e1b('0x3'));var BPromise=require(_0x7e1b('0x4'));var rp=require(_0x7e1b('0x5'));var fs=require('fs');var path=require(_0x7e1b('0x6'));var rimraf=require(_0x7e1b('0x7'));var config=require(_0x7e1b('0x8'));var attributes=require(_0x7e1b('0x9'));module['exports']=function(_0x3eb232,_0x5e554a){return _0x3eb232['define'](_0x7e1b('0xa'),attributes,{'tableName':_0x7e1b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x16849d,_0x5ca4ee,_0x42f9c6){if(_0x16849d[_0x7e1b('0xc')](_0x7e1b('0xd'))){_0x16849d[_0x7e1b('0xe')]=moment()[_0x7e1b('0xf')](_0x7e1b('0x10'));}_0x42f9c6(null,_0x16849d);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 8858f53..6c76ab4 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 _0x38b2=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./smsInteraction.socket','register','request','then','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','info','stringify','AddTagsToSmsInteraction','addTags','ids','spread','AddTags','util','moment','bluebird','ioredis'];(function(_0x2e6b8f,_0x5921c3){var _0x1e90fc=function(_0x26f4b0){while(--_0x26f4b0){_0x2e6b8f['push'](_0x2e6b8f['shift']());}};_0x1e90fc(++_0x5921c3);}(_0x38b2,0x1dc));var _0x238b=function(_0x8d7c1f,_0x161a67){_0x8d7c1f=_0x8d7c1f-0x0;var _0x12802b=_0x38b2[_0x8d7c1f];return _0x12802b;};'use strict';var _=require('lodash');var util=require(_0x238b('0x0'));var moment=require(_0x238b('0x1'));var BPromise=require(_0x238b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x238b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x238b('0x4'));var logger=require(_0x238b('0x5'))(_0x238b('0x6'));var config=require(_0x238b('0x7'));var jayson=require(_0x238b('0x8'));var client=jayson['client'][_0x238b('0x9')]({'port':0x232a});config['redis']=_[_0x238b('0xa')](config[_0x238b('0xb')],{'host':_0x238b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x238b('0xb')]));require(_0x238b('0xd'))[_0x238b('0xe')](socket);function respondWithRpcPromise(_0x1e3a3c,_0x44259b,_0x179800){return new BPromise(function(_0x445f91,_0xb6e1f3){return client[_0x238b('0xf')](_0x1e3a3c,_0x179800)[_0x238b('0x10')](function(_0x130785){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x44259b,_0x238b('0x11'));logger[_0x238b('0x12')](_0x238b('0x13'),_0x44259b,_0x238b('0x11'),JSON['stringify'](_0x130785));if(_0x130785[_0x238b('0x14')]){if(_0x130785[_0x238b('0x14')]['code']===0x1f4){logger[_0x238b('0x14')](_0x238b('0x15'),_0x44259b,_0x130785[_0x238b('0x14')][_0x238b('0x16')]);return _0xb6e1f3(_0x130785['error'][_0x238b('0x16')]);}logger[_0x238b('0x14')](_0x238b('0x15'),_0x44259b,_0x130785[_0x238b('0x14')][_0x238b('0x16')]);return _0x445f91(_0x130785[_0x238b('0x14')]['message']);}else{logger['info'](_0x238b('0x15'),_0x44259b,_0x238b('0x11'));_0x445f91(_0x130785[_0x238b('0x17')][_0x238b('0x16')]);}})[_0x238b('0x18')](function(_0x279095){logger['error'](_0x238b('0x15'),_0x44259b,_0x279095);_0xb6e1f3(_0x279095);});});}exports[_0x238b('0x19')]=function(_0x220611){var _0x2fc07c=this;return new Promise(function(_0x1ac93f,_0x1ef6c3){return db[_0x238b('0x1a')][_0x238b('0x1b')](_0x220611[_0x238b('0x1c')],{'raw':_0x220611['options']?_0x220611[_0x238b('0x1d')][_0x238b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x220611[_0x238b('0x1d')]?_0x220611['options'][_0x238b('0x1f')]||null:null,'attributes':_0x220611['options']?_0x220611[_0x238b('0x1d')]['attributes']||null:null,'limit':_0x220611[_0x238b('0x1d')]?_0x220611[_0x238b('0x1d')][_0x238b('0x20')]||null:null})[_0x238b('0x10')](function(_0x552a13){logger[_0x238b('0x21')]('UpdateSmsInteraction',_0x220611);logger[_0x238b('0x12')](_0x238b('0x19'),_0x220611,JSON[_0x238b('0x22')](_0x552a13));_0x1ac93f(_0x552a13);})['catch'](function(_0x5b2382){logger[_0x238b('0x14')]('UpdateSmsInteraction',_0x5b2382[_0x238b('0x16')],_0x220611);_0x1ef6c3(_0x2fc07c[_0x238b('0x14')](0x1f4,_0x5b2382[_0x238b('0x16')]));});});};exports[_0x238b('0x23')]=function(_0x1cb04c){return new Promise(function(_0x4e32a4,_0xb7df2b){return db['SmsInteraction']['find']({'where':_0x1cb04c[_0x238b('0x1d')]?_0x1cb04c[_0x238b('0x1d')][_0x238b('0x1f')]||null:null})[_0x238b('0x10')](function(_0x315f49){if(_0x315f49){return _0x315f49[_0x238b('0x24')](_0x1cb04c[_0x238b('0x1c')][_0x238b('0x25')],_['omit'](_0x1cb04c[_0x238b('0x1c')],[_0x238b('0x25'),'id'])||{});}})[_0x238b('0x26')](function(_0x49d09a){logger[_0x238b('0x21')]('AddTags',_0x1cb04c);logger[_0x238b('0x12')](_0x238b('0x27'),_0x1cb04c,JSON[_0x238b('0x22')](_0x49d09a));_0x4e32a4(_0x49d09a);})['catch'](function(_0x16eafd){logger[_0x238b('0x14')]('AddTags',_0x16eafd[_0x238b('0x16')],_0x1cb04c);_0xb7df2b(_this[_0x238b('0x14')](0x1f4,_0x16eafd[_0x238b('0x16')]));});});}; \ No newline at end of file +var _0xc14c=['../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','limit','body','ids','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x21883f,_0x42aff6){var _0x128238=function(_0x171887){while(--_0x171887){_0x21883f['push'](_0x21883f['shift']());}};_0x128238(++_0x42aff6);}(_0xc14c,0xd1));var _0xcc14=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc14c[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0xcc14('0x0'));var moment=require(_0xcc14('0x1'));var BPromise=require(_0xcc14('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc14('0x3'));var db=require(_0xcc14('0x4'))['db'];var utils=require(_0xcc14('0x5'));var logger=require('../../config/logger')(_0xcc14('0x6'));var config=require(_0xcc14('0x7'));var jayson=require(_0xcc14('0x8'));var client=jayson[_0xcc14('0x9')][_0xcc14('0xa')]({'port':0x232a});config['redis']=_[_0xcc14('0xb')](config[_0xcc14('0xc')],{'host':_0xcc14('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc14('0xc')]));require('./smsInteraction.socket')[_0xcc14('0xe')](socket);function respondWithRpcPromise(_0x221ad0,_0x12e664,_0x4e6268){return new BPromise(function(_0x2dd3ca,_0x153061){return client['request'](_0x221ad0,_0x4e6268)[_0xcc14('0xf')](function(_0x2365b5){logger['info'](_0xcc14('0x10'),_0x12e664,_0xcc14('0x11'));logger[_0xcc14('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x12e664,_0xcc14('0x11'),JSON[_0xcc14('0x13')](_0x2365b5));if(_0x2365b5[_0xcc14('0x14')]){if(_0x2365b5['error'][_0xcc14('0x15')]===0x1f4){logger[_0xcc14('0x14')](_0xcc14('0x10'),_0x12e664,_0x2365b5[_0xcc14('0x14')]['message']);return _0x153061(_0x2365b5[_0xcc14('0x14')][_0xcc14('0x16')]);}logger[_0xcc14('0x14')](_0xcc14('0x10'),_0x12e664,_0x2365b5['error'][_0xcc14('0x16')]);return _0x2dd3ca(_0x2365b5[_0xcc14('0x14')][_0xcc14('0x16')]);}else{logger[_0xcc14('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x12e664,_0xcc14('0x11'));_0x2dd3ca(_0x2365b5[_0xcc14('0x18')][_0xcc14('0x16')]);}})[_0xcc14('0x19')](function(_0x472652){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x12e664,_0x472652);_0x153061(_0x472652);});});}exports[_0xcc14('0x1a')]=function(_0x4ea903){var _0x59019d=this;return new Promise(function(_0x35820b,_0x581c6d){return db[_0xcc14('0x1b')][_0xcc14('0x1c')](_0x4ea903['body'],{'raw':_0x4ea903['options']?_0x4ea903[_0xcc14('0x1d')][_0xcc14('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ea903[_0xcc14('0x1d')]?_0x4ea903[_0xcc14('0x1d')]['where']||null:null,'attributes':_0x4ea903['options']?_0x4ea903['options']['attributes']||null:null,'limit':_0x4ea903[_0xcc14('0x1d')]?_0x4ea903[_0xcc14('0x1d')][_0xcc14('0x1f')]||null:null})[_0xcc14('0xf')](function(_0x426329){logger[_0xcc14('0x17')](_0xcc14('0x1a'),_0x4ea903);logger[_0xcc14('0x12')](_0xcc14('0x1a'),_0x4ea903,JSON[_0xcc14('0x13')](_0x426329));_0x35820b(_0x426329);})[_0xcc14('0x19')](function(_0x18ec1e){logger[_0xcc14('0x14')]('UpdateSmsInteraction',_0x18ec1e[_0xcc14('0x16')],_0x4ea903);_0x581c6d(_0x59019d[_0xcc14('0x14')](0x1f4,_0x18ec1e[_0xcc14('0x16')]));});});};exports['AddTagsToSmsInteraction']=function(_0x10b2ff){return new Promise(function(_0x5c1f68,_0x1d4dbd){return db[_0xcc14('0x1b')]['find']({'where':_0x10b2ff[_0xcc14('0x1d')]?_0x10b2ff[_0xcc14('0x1d')]['where']||null:null})[_0xcc14('0xf')](function(_0x388168){if(_0x388168){return _0x388168['addTags'](_0x10b2ff[_0xcc14('0x20')][_0xcc14('0x21')],_['omit'](_0x10b2ff[_0xcc14('0x20')],['ids','id'])||{});}})[_0xcc14('0x22')](function(_0x3117bf){logger[_0xcc14('0x17')](_0xcc14('0x23'),_0x10b2ff);logger[_0xcc14('0x12')](_0xcc14('0x23'),_0x10b2ff,JSON['stringify'](_0x3117bf));_0x5c1f68(_0x3117bf);})['catch'](function(_0x146021){logger[_0xcc14('0x14')](_0xcc14('0x23'),_0x146021[_0xcc14('0x16')],_0x10b2ff);_0x1d4dbd(_this['error'](0x1f4,_0x146021[_0xcc14('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 6333521..a66b139 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 _0x6498=['register','length','update','emit','removeListener'];(function(_0x2ae15f,_0x3e1860){var _0x42a3d3=function(_0xcd0e60){while(--_0xcd0e60){_0x2ae15f['push'](_0x2ae15f['shift']());}};_0x42a3d3(++_0x3e1860);}(_0x6498,0x16a));var _0x8649=function(_0x4bda69,_0x3899f7){_0x4bda69=_0x4bda69-0x0;var _0x78e2=_0x6498[_0x4bda69];return _0x78e2;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save','remove',_0x8649('0x0')];function createListener(_0x422cdf,_0x2c34f2){return function(_0xe31f0b){_0x2c34f2[_0x8649('0x1')](_0x422cdf,_0xe31f0b);};}function removeListener(_0x435ffa,_0x2f2c28){return function(){SmsInteractionEvents[_0x8649('0x2')](_0x435ffa,_0x2f2c28);};}exports[_0x8649('0x3')]=function(_0x1724f2){for(var _0x48d5cf=0x0,_0x3b8d2a=events[_0x8649('0x4')];_0x48d5cf<_0x3b8d2a;_0x48d5cf++){var _0x4998c9=events[_0x48d5cf];var _0x47e322=createListener('smsInteraction:'+_0x4998c9,_0x1724f2);SmsInteractionEvents['on'](_0x4998c9,_0x47e322);}}; \ No newline at end of file +var _0x4869=['register','length','smsInteraction:','./smsInteraction.events','remove','update','emit','removeListener'];(function(_0x2486a4,_0x3e3650){var _0x14cf68=function(_0x1b6f40){while(--_0x1b6f40){_0x2486a4['push'](_0x2486a4['shift']());}};_0x14cf68(++_0x3e3650);}(_0x4869,0x133));var _0x9486=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x4869[_0x1caf6a];return _0x1bf493;};'use strict';var SmsInteractionEvents=require(_0x9486('0x0'));var events=['save',_0x9486('0x1'),_0x9486('0x2')];function createListener(_0x363308,_0x5f4515){return function(_0x3ffaa8){_0x5f4515[_0x9486('0x3')](_0x363308,_0x3ffaa8);};}function removeListener(_0x1cecfd,_0x22cbb5){return function(){SmsInteractionEvents[_0x9486('0x4')](_0x1cecfd,_0x22cbb5);};}exports[_0x9486('0x5')]=function(_0x19e3b1){for(var _0x5ed112=0x0,_0x47dea9=events[_0x9486('0x6')];_0x5ed112<_0x47dea9;_0x5ed112++){var _0x4fb867=events[_0x5ed112];var _0x359ee8=createListener(_0x9486('0x7')+_0x4fb867,_0x19e3b1);SmsInteractionEvents['on'](_0x4fb867,_0x359ee8);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index d7421df..25fedb8 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 _0x4dfd=['describe','/:id','show','tracked','sms','smsmessage:create','create','post','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x49755e,_0x110f20){var _0x30d982=function(_0x2412a5){while(--_0x2412a5){_0x49755e['push'](_0x49755e['shift']());}};_0x30d982(++_0x110f20);}(_0x4dfd,0x148));var _0xd4df=function(_0x5682b1,_0x6db1f7){_0x5682b1=_0x5682b1-0x0;var _0x2a3733=_0x4dfd[_0x5682b1];return _0x2a3733;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd4df('0x0'));var timeout=require(_0xd4df('0x1'));var express=require(_0xd4df('0x2'));var router=express[_0xd4df('0x3')]();var fs_extra=require(_0xd4df('0x4'));var auth=require(_0xd4df('0x5'));var interaction=require(_0xd4df('0x6'));var config=require(_0xd4df('0x7'));var controller=require(_0xd4df('0x8'));router[_0xd4df('0x9')]('/',auth[_0xd4df('0xa')](),controller[_0xd4df('0xb')]);router['get'](_0xd4df('0xc'),auth[_0xd4df('0xa')](),controller[_0xd4df('0xd')]);router[_0xd4df('0x9')](_0xd4df('0xe'),auth[_0xd4df('0xa')](),controller[_0xd4df('0xf')]);router['post']('/',auth[_0xd4df('0xa')](),interaction[_0xd4df('0x10')](_0xd4df('0x11'),_0xd4df('0x12')),controller[_0xd4df('0x13')]);router[_0xd4df('0x14')]('/:id/status',controller[_0xd4df('0x15')]);router[_0xd4df('0x16')](_0xd4df('0xe'),auth[_0xd4df('0xa')](),controller[_0xd4df('0x17')]);router[_0xd4df('0x16')](_0xd4df('0x18'),auth[_0xd4df('0xa')](),controller[_0xd4df('0x19')]);router['put'](_0xd4df('0x1a'),auth['isAuthenticated'](),controller[_0xd4df('0x1b')]);router[_0xd4df('0x1c')](_0xd4df('0xe'),auth[_0xd4df('0xa')](),controller[_0xd4df('0x1d')]);module[_0xd4df('0x1e')]=router; \ No newline at end of file +var _0x23b6=['./smsMessage.controller','/describe','get','/:id','show','post','tracked','sms','create','/:id/status','status','put','isAuthenticated','update','/:id/accept','accept','/:id/reject','reject','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x47d6d2,_0x6b4efe){var _0x2535fa=function(_0x335ccb){while(--_0x335ccb){_0x47d6d2['push'](_0x47d6d2['shift']());}};_0x2535fa(++_0x6b4efe);}(_0x23b6,0xd7));var _0x623b=function(_0x65ff6c,_0x4c2da3){_0x65ff6c=_0x65ff6c-0x0;var _0x238215=_0x23b6[_0x65ff6c];return _0x238215;};'use strict';var multer=require(_0x623b('0x0'));var util=require(_0x623b('0x1'));var path=require('path');var timeout=require(_0x623b('0x2'));var express=require(_0x623b('0x3'));var router=express[_0x623b('0x4')]();var fs_extra=require(_0x623b('0x5'));var auth=require(_0x623b('0x6'));var interaction=require(_0x623b('0x7'));var config=require(_0x623b('0x8'));var controller=require(_0x623b('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x623b('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x623b('0xb')](_0x623b('0xc'),auth['isAuthenticated'](),controller[_0x623b('0xd')]);router[_0x623b('0xe')]('/',auth['isAuthenticated'](),interaction[_0x623b('0xf')](_0x623b('0x10'),'smsmessage:create'),controller[_0x623b('0x11')]);router['post'](_0x623b('0x12'),controller[_0x623b('0x13')]);router[_0x623b('0x14')](_0x623b('0xc'),auth[_0x623b('0x15')](),controller[_0x623b('0x16')]);router[_0x623b('0x14')](_0x623b('0x17'),auth['isAuthenticated'](),controller[_0x623b('0x18')]);router['put'](_0x623b('0x19'),auth['isAuthenticated'](),controller[_0x623b('0x1a')]);router['delete'](_0x623b('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x623b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index e7c2331..adffd86 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 _0x5c24=['BOOLEAN','ENUM','out','STRING','DATE','TEXT','exports','medium'];(function(_0x3a3758,_0x4dd8cf){var _0x1a9234=function(_0x3dda22){while(--_0x3dda22){_0x3a3758['push'](_0x3a3758['shift']());}};_0x1a9234(++_0x4dd8cf);}(_0x5c24,0x186));var _0x45c2=function(_0x54fbff,_0x53470e){_0x54fbff=_0x54fbff-0x0;var _0x5cf619=_0x5c24[_0x54fbff];return _0x5cf619;};'use strict';var Sequelize=require('sequelize');module[_0x45c2('0x0')]={'body':{'type':Sequelize['TEXT'](_0x45c2('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x45c2('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x45c2('0x3')]('in',_0x45c2('0x4')),'defaultValue':_0x45c2('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x45c2('0x5')]},'readAt':{'type':Sequelize[_0x45c2('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x45c2('0x5')]},'providerResponse':{'type':Sequelize[_0x45c2('0x7')]}}; \ No newline at end of file +var _0xe859=['medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xe859,0xba));var _0x9e85=function(_0x443119,_0x8c6fe7){_0x443119=_0x443119-0x0;var _0x54860a=_0xe859[_0x443119];return _0x54860a;};'use strict';var Sequelize=require(_0x9e85('0x0'));module[_0x9e85('0x1')]={'body':{'type':Sequelize[_0x9e85('0x2')](_0x9e85('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9e85('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9e85('0x5')]('in',_0x9e85('0x6')),'defaultValue':_0x9e85('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9e85('0x7')](0xbe)},'phone':{'type':Sequelize[_0x9e85('0x7')]},'readAt':{'type':Sequelize[_0x9e85('0x8')]},'secret':{'type':Sequelize[_0x9e85('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x9e85('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 0efe221..6110111 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 _0x46c1=['localhost','redis','./smsMessage.socket','register','jayson/promise','http','client','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','stack','name','send','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsMessage','includeAll','include','catch','show','params','find','create','body','destroy','describe','../../config/logger','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','[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','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','channel','event','EventManager','acceptmessage','reject','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','interface','motionChannel','SmsAccount','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','sent','delivered','Status','plivio','infobip','results','groupName','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults'];(function(_0x3b934f,_0x59dc45){var _0x136c82=function(_0x321a23){while(--_0x321a23){_0x3b934f['push'](_0x3b934f['shift']());}};_0x136c82(++_0x59dc45);}(_0x46c1,0x7c));var _0x146c=function(_0x47cfb2,_0x550212){_0x47cfb2=_0x47cfb2-0x0;var _0x1d5212=_0x46c1[_0x47cfb2];return _0x1d5212;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x146c('0x0'));var zipdir=require(_0x146c('0x1'));var jsonpatch=require(_0x146c('0x2'));var rp=require(_0x146c('0x3'));var moment=require(_0x146c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x146c('0x5'));var util=require(_0x146c('0x6'));var path=require(_0x146c('0x7'));var sox=require(_0x146c('0x8'));var csv=require(_0x146c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x146c('0xa'));var squel=require(_0x146c('0xb'));var crypto=require(_0x146c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x146c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x146c('0xe'));var Papa=require(_0x146c('0xf'));var Redis=require('ioredis');var authService=require(_0x146c('0x10'));var qs=require(_0x146c('0x11'));var as=require(_0x146c('0x12'));var hardwareService=require(_0x146c('0x13'));var logger=require('../../config/logger')(_0x146c('0x14'));var utils=require('../../config/utils');var config=require(_0x146c('0x15'));var licenseUtil=require(_0x146c('0x16'));var db=require(_0x146c('0x17'))['db'];config['redis']=_[_0x146c('0x18')](config['redis'],{'host':_0x146c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x146c('0x1a')]));require(_0x146c('0x1b'))[_0x146c('0x1c')](socket);var jayson=require(_0x146c('0x1d'));var client=jayson['client'][_0x146c('0x1e')]({'port':0x232c});var client9002=jayson[_0x146c('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25a3b3,_0x50bdae,_0x4a554b,_0x15aaf4){return new BPromise(function(_0x512ac8,_0x28411b){var _0x1543f4=_0x15aaf4||client;return _0x1543f4[_0x146c('0x20')](_0x25a3b3,_0x4a554b)['then'](function(_0x4335e4){logger[_0x146c('0x21')](_0x146c('0x22'),_0x50bdae,_0x146c('0x23'));logger[_0x146c('0x24')](_0x146c('0x25'),_0x50bdae,_0x146c('0x23'),JSON[_0x146c('0x26')](_0x4335e4));if(_0x4335e4[_0x146c('0x27')]){if(_0x4335e4['error'][_0x146c('0x28')]===0x1f4){logger[_0x146c('0x27')](_0x146c('0x22'),_0x50bdae,_0x4335e4[_0x146c('0x27')][_0x146c('0x29')]);return _0x28411b(_0x4335e4['error']['message']);}logger[_0x146c('0x27')](_0x146c('0x22'),_0x50bdae,_0x4335e4[_0x146c('0x27')][_0x146c('0x29')]);return _0x512ac8(_0x4335e4['error'][_0x146c('0x29')]);}else{logger[_0x146c('0x21')](_0x146c('0x22'),_0x50bdae,_0x146c('0x23'));_0x512ac8(_0x4335e4[_0x146c('0x2a')]['message']);}})['catch'](function(_0x1257ff){logger[_0x146c('0x27')](_0x146c('0x22'),_0x50bdae,_0x1257ff);_0x28411b(_0x1257ff);});});}function respondWithStatusCode(_0x46c83c,_0x4eef57){_0x4eef57=_0x4eef57||0xcc;return function(_0x33617e){if(_0x33617e){return _0x46c83c[_0x146c('0x2b')](_0x4eef57);}return _0x46c83c[_0x146c('0x2c')](_0x4eef57)[_0x146c('0x2d')]();};}function respondWithResult(_0x109a3f,_0x2298c0){_0x2298c0=_0x2298c0||0xc8;return function(_0x2b66d2){if(_0x2b66d2){return _0x109a3f[_0x146c('0x2c')](_0x2298c0)[_0x146c('0x2e')](_0x2b66d2);}};}function respondWithFilteredResult(_0x5158b2,_0x7c336b){return function(_0x566d90){if(_0x566d90){var _0x5c44ef=typeof _0x7c336b[_0x146c('0x2f')]===_0x146c('0x30')&&typeof _0x7c336b[_0x146c('0x31')]===_0x146c('0x30');var _0xed735b=_0x566d90[_0x146c('0x32')];var _0x2073e1=_0x5c44ef?0x0:_0x7c336b[_0x146c('0x2f')];var _0x3d5ca9=_0x5c44ef?_0x566d90[_0x146c('0x32')]:_0x7c336b[_0x146c('0x2f')]+_0x7c336b['limit'];var _0x280d01;if(_0x3d5ca9>=_0xed735b){_0x3d5ca9=_0xed735b;_0x280d01=0xc8;}else{_0x280d01=0xce;}_0x5158b2[_0x146c('0x2c')](_0x280d01);return _0x5158b2['set'](_0x146c('0x33'),_0x2073e1+'-'+_0x3d5ca9+'/'+_0xed735b)[_0x146c('0x2e')](_0x566d90);}return null;};}function patchUpdates(_0x3b591b){return function(_0x2ae581){try{jsonpatch[_0x146c('0x34')](_0x2ae581,_0x3b591b,!![]);}catch(_0x4a584e){return BPromise['reject'](_0x4a584e);}return _0x2ae581[_0x146c('0x35')]();};}function saveUpdates(_0xe77c87,_0x1f7f51){return function(_0x3a0b21){if(_0x3a0b21){return _0x3a0b21[_0x146c('0x36')](_0xe77c87)['then'](function(_0x1230bc){return _0x1230bc;});}return null;};}function removeEntity(_0x22b317,_0x38246d){return function(_0x28a542){if(_0x28a542){return _0x28a542['destroy']()[_0x146c('0x37')](function(){_0x22b317[_0x146c('0x2c')](0xcc)[_0x146c('0x2d')]();});}};}function handleEntityNotFound(_0x4550b8,_0xa4f815){return function(_0x2961c6){if(!_0x2961c6){_0x4550b8[_0x146c('0x2b')](0x194);}return _0x2961c6;};}function handleError(_0x22b4ae,_0x318210){_0x318210=_0x318210||0x1f4;return function(_0x95b262){logger[_0x146c('0x27')](_0x95b262[_0x146c('0x38')]);if(_0x95b262[_0x146c('0x39')]){delete _0x95b262[_0x146c('0x39')];}_0x22b4ae[_0x146c('0x2c')](_0x318210)[_0x146c('0x3a')](_0x95b262);};}exports['index']=function(_0x3a47ce,_0x527c6e){var _0x13c98b={},_0x37d8af={},_0x59463b={'count':0x0,'rows':[]};var _0x11db7e=_['map'](db['SmsMessage'][_0x146c('0x3b')],function(_0x2c998d){return{'name':_0x2c998d[_0x146c('0x3c')],'type':_0x2c998d[_0x146c('0x3d')][_0x146c('0x3e')]};});_0x37d8af['model']=_[_0x146c('0x3f')](_0x11db7e,_0x146c('0x39'));_0x37d8af['query']=_[_0x146c('0x40')](_0x3a47ce[_0x146c('0x41')]);_0x37d8af[_0x146c('0x42')]=_[_0x146c('0x43')](_0x37d8af[_0x146c('0x44')],_0x37d8af[_0x146c('0x41')]);_0x13c98b[_0x146c('0x45')]=_[_0x146c('0x43')](_0x37d8af['model'],qs[_0x146c('0x46')](_0x3a47ce[_0x146c('0x41')][_0x146c('0x46')]));_0x13c98b[_0x146c('0x45')]=_0x13c98b[_0x146c('0x45')][_0x146c('0x47')]?_0x13c98b[_0x146c('0x45')]:_0x37d8af[_0x146c('0x44')];if(!_0x3a47ce[_0x146c('0x41')][_0x146c('0x48')]('nolimit')){_0x13c98b[_0x146c('0x31')]=qs[_0x146c('0x31')](_0x3a47ce[_0x146c('0x41')]['limit']);_0x13c98b[_0x146c('0x2f')]=qs[_0x146c('0x2f')](_0x3a47ce[_0x146c('0x41')]['offset']);}_0x13c98b[_0x146c('0x49')]=qs[_0x146c('0x4a')](_0x3a47ce['query'][_0x146c('0x4a')]);_0x13c98b[_0x146c('0x4b')]=qs[_0x146c('0x42')](_[_0x146c('0x4c')](_0x3a47ce[_0x146c('0x41')],_0x37d8af['filters']),_0x11db7e);if(_0x3a47ce['query'][_0x146c('0x4d')]){_0x13c98b['where']=_[_0x146c('0x4e')](_0x13c98b[_0x146c('0x4b')],{'$or':_[_0x146c('0x3f')](_0x11db7e,function(_0x484430){if(_0x484430[_0x146c('0x3d')]!==_0x146c('0x4f')){var _0xd63896={};_0xd63896[_0x484430[_0x146c('0x39')]]={'$like':'%'+_0x3a47ce[_0x146c('0x41')]['filter']+'%'};return _0xd63896;}})});}_0x13c98b=_['merge']({},_0x13c98b,_0x3a47ce[_0x146c('0x50')]);var _0x3939fe={'where':_0x13c98b[_0x146c('0x4b')]};return db[_0x146c('0x51')][_0x146c('0x32')](_0x3939fe)[_0x146c('0x37')](function(_0x499eaa){_0x59463b[_0x146c('0x32')]=_0x499eaa;if(_0x3a47ce['query'][_0x146c('0x52')]){_0x13c98b[_0x146c('0x53')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x13c98b);})[_0x146c('0x37')](function(_0x510544){_0x59463b['rows']=_0x510544;return _0x59463b;})['then'](respondWithFilteredResult(_0x527c6e,_0x13c98b))[_0x146c('0x54')](handleError(_0x527c6e,null));};exports[_0x146c('0x55')]=function(_0x36af4c,_0x21c1ad){var _0x4d59e2={'raw':!![],'where':{'id':_0x36af4c[_0x146c('0x56')]['id']}},_0x4ae818={};_0x4ae818['model']=_[_0x146c('0x40')](db[_0x146c('0x51')][_0x146c('0x3b')]);_0x4ae818[_0x146c('0x41')]=_[_0x146c('0x40')](_0x36af4c[_0x146c('0x41')]);_0x4ae818[_0x146c('0x42')]=_['intersection'](_0x4ae818['model'],_0x4ae818['query']);_0x4d59e2[_0x146c('0x45')]=_['intersection'](_0x4ae818[_0x146c('0x44')],qs[_0x146c('0x46')](_0x36af4c[_0x146c('0x41')][_0x146c('0x46')]));_0x4d59e2[_0x146c('0x45')]=_0x4d59e2[_0x146c('0x45')][_0x146c('0x47')]?_0x4d59e2[_0x146c('0x45')]:_0x4ae818['model'];if(_0x36af4c['query']['includeAll']){_0x4d59e2[_0x146c('0x53')]=[{'all':!![]}];}_0x4d59e2=_['merge']({},_0x4d59e2,_0x36af4c['options']);return db[_0x146c('0x51')][_0x146c('0x57')](_0x4d59e2)[_0x146c('0x37')](handleEntityNotFound(_0x21c1ad,null))['then'](respondWithResult(_0x21c1ad,null))['catch'](handleError(_0x21c1ad,null));};exports['create']=function(_0x2852ab,_0x2514a6){return db[_0x146c('0x51')][_0x146c('0x58')](_0x2852ab[_0x146c('0x59')],{})[_0x146c('0x37')](respondWithResult(_0x2514a6,0xc9))['catch'](handleError(_0x2514a6,null));};exports['update']=function(_0x4567bb,_0x33b81c){if(_0x4567bb['body']['id']){delete _0x4567bb['body']['id'];}return db[_0x146c('0x51')]['find']({'where':{'id':_0x4567bb[_0x146c('0x56')]['id']}})[_0x146c('0x37')](handleEntityNotFound(_0x33b81c,null))[_0x146c('0x37')](saveUpdates(_0x4567bb[_0x146c('0x59')],null))[_0x146c('0x37')](respondWithResult(_0x33b81c,null))['catch'](handleError(_0x33b81c,null));};exports[_0x146c('0x5a')]=function(_0xe19a8b,_0x1e52d3){return db[_0x146c('0x51')][_0x146c('0x57')]({'where':{'id':_0xe19a8b['params']['id']}})['then'](handleEntityNotFound(_0x1e52d3,null))[_0x146c('0x37')](removeEntity(_0x1e52d3,null))['catch'](handleError(_0x1e52d3,null));};exports[_0x146c('0x5b')]=function(_0x5d1a2a,_0x3d239e){return db[_0x146c('0x51')]['describe']()[_0x146c('0x37')](respondWithResult(_0x3d239e,null))[_0x146c('0x54')](handleError(_0x3d239e,null));};var interaction_log=require(_0x146c('0x5c'))(_0x146c('0x5d'));exports[_0x146c('0x5e')]=function(_0x129a75,_0x54e054,_0x2d8498){var _0x4f2b73={'agent':{},'channel':_0x146c('0x5f')};if(_0x129a75[_0x146c('0x59')]['id']){delete _0x129a75['body']['id'];}_0x129a75['body'][_0x146c('0x60')]=!![];_0x129a75[_0x146c('0x59')][_0x146c('0x61')]=moment()[_0x146c('0x62')](_0x146c('0x63'));_0x129a75['body'][_0x146c('0x64')]=_0x129a75[_0x146c('0x59')][_0x146c('0x64')]||_0x129a75[_0x146c('0x65')]['id'];_0x4f2b73[_0x146c('0x66')]['id']=_0x129a75[_0x146c('0x59')]['UserId'];return db[_0x146c('0x51')]['find']({'where':{'id':_0x129a75[_0x146c('0x56')]['id'],'UserId':null}})[_0x146c('0x37')](handleEntityNotFound(_0x54e054,null))['then'](saveUpdates(_0x129a75['body'],null))[_0x146c('0x37')](function(_0x2ba6e6){if(_0x2ba6e6){_0x4f2b73[_0x146c('0x29')]=_0x2ba6e6[_0x146c('0x67')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x2ba6e6['SmsInteractionId']}});}return null;})[_0x146c('0x37')](handleEntityNotFound(_0x54e054,null))[_0x146c('0x37')](function(_0x15248e){if(_0x15248e){return _0x15248e[_0x146c('0x36')]({'UserId':_0x129a75[_0x146c('0x59')]['UserId'],'read1stAt':_[_0x146c('0x68')](_0x15248e[_0x146c('0x69')])?moment()[_0x146c('0x62')](_0x146c('0x63')):undefined});}return null;})[_0x146c('0x37')](function(_0x5c295b){if(_0x5c295b){_0x4f2b73['interaction']=_0x5c295b[_0x146c('0x67')]({'plain':!![]});interaction_log[_0x146c('0x21')](_0x146c('0x6a'),_0x129a75[_0x146c('0x65')]['id'],_0x129a75['user'][_0x146c('0x39')],_0x129a75[_0x146c('0x65')][_0x146c('0x6b')],_0x4f2b73[_0x146c('0x6c')]['id'],_0x129a75['body']?JSON['stringify'](_0x129a75[_0x146c('0x59')]):_0x146c('0x6d'));return respondWithRpcPromise('AcceptMessage',_0x146c('0x6e'),_0x4f2b73);}return null;})[_0x146c('0x37')](function(_0x1ebe3e){var _0x14b80f=_0x146c('0x6f')+_0x1ebe3e[_0x146c('0x29')][_0x146c('0x70')];return db['sequelize'][_0x146c('0x41')](_0x14b80f,{'type':db[_0x146c('0x71')][_0x146c('0x72')][_0x146c('0x73')],'raw':!![]})[_0x146c('0x37')](function(_0x10758f){return _0x10758f;});})[_0x146c('0x37')](function(_0x7b706f){if(_0x7b706f){_0x4f2b73[_0x146c('0x29')][_0x146c('0x74')]=_0x7b706f[0x0];if(!_0x129a75[_0x146c('0x59')][_0x146c('0x64')])return;return db[_0x146c('0x75')]['find']({'where':{'id':_0x129a75['body'][_0x146c('0x64')],'role':_0x146c('0x66')},'attributes':['id',_0x146c('0x39'),_0x146c('0x76'),_0x146c('0x77'),_0x146c('0x78')],'raw':!![]});}return null;})[_0x146c('0x37')](function(_0x3a7993){if(!_0x3a7993)return null;_0x4f2b73[_0x146c('0x29')][_0x146c('0x66')]=_0x3a7993;return _0x4f2b73;})[_0x146c('0x37')](function(_0x30da63){if(_0x30da63){if(_0x129a75[_0x146c('0x59')]['manual']){_0x4f2b73[_0x146c('0x29')]['interface']=util['format']('SIP/%s',_0x129a75[_0x146c('0x65')][_0x146c('0x39')]);_0x4f2b73['message'][_0x146c('0x79')]=_0x4f2b73[_0x146c('0x79')];_0x4f2b73[_0x146c('0x29')]['motionChannel']=_0x4f2b73[_0x146c('0x79')];_0x4f2b73[_0x146c('0x29')][_0x146c('0x7a')]=_0x146c('0x5e');return respondWithRpcPromise(_0x146c('0x7b'),_0x146c('0x7b'),{'event':_0x146c('0x7c'),'message':_0x4f2b73[_0x146c('0x29')]},client9002)['then'](function(){return _0x4f2b73;});}return _0x4f2b73;}return null;})['then'](respondWithResult(_0x54e054,null))[_0x146c('0x54')](handleError(_0x54e054,null));};var interaction_log=require('../../config/logger')(_0x146c('0x5d'));exports[_0x146c('0x7d')]=function(_0x1e395e,_0x6988b5,_0x263cf3){var _0xd7cb34={'agent':{},'channel':_0x146c('0x5f')};if(_0x1e395e[_0x146c('0x59')]['id']){delete _0x1e395e[_0x146c('0x59')]['id'];}_0x1e395e[_0x146c('0x59')]['UserId']=_0x1e395e[_0x146c('0x59')]['UserId']||_0x1e395e[_0x146c('0x65')]['id'];_0xd7cb34['agent']['id']=_0x1e395e['body']['UserId'];return db[_0x146c('0x51')][_0x146c('0x57')]({'where':{'id':_0x1e395e[_0x146c('0x56')]['id'],'UserId':null}})[_0x146c('0x37')](handleEntityNotFound(_0x6988b5,null))[_0x146c('0x37')](function(_0x408700){if(_0x408700){_0xd7cb34[_0x146c('0x29')]=_0x408700[_0x146c('0x67')]({'plain':!![]});return db[_0x146c('0x7e')][_0x146c('0x57')]({'where':{'id':_0x408700['SmsInteractionId']}});}return null;})[_0x146c('0x37')](handleEntityNotFound(_0x6988b5,null))[_0x146c('0x37')](function(_0x1ee960){if(_0x1ee960){_0xd7cb34[_0x146c('0x6c')]=_0x1ee960[_0x146c('0x67')]({'plain':!![]});interaction_log[_0x146c('0x21')](_0x146c('0x7f'),_0x1e395e[_0x146c('0x65')]['id'],_0x1e395e['user'][_0x146c('0x39')],_0x1e395e[_0x146c('0x65')][_0x146c('0x6b')],_0xd7cb34['interaction']['id'],_0x1e395e[_0x146c('0x59')]?JSON[_0x146c('0x26')](_0x1e395e[_0x146c('0x59')]):_0x146c('0x6d'));return respondWithRpcPromise(_0x146c('0x80'),_0x146c('0x81'),_0xd7cb34);}return null;})[_0x146c('0x37')](function(_0x2f868c){var _0x25e3e4=_0x146c('0x6f')+_0x2f868c['message'][_0x146c('0x70')];return db[_0x146c('0x82')][_0x146c('0x41')](_0x25e3e4,{'type':db['Sequelize'][_0x146c('0x72')][_0x146c('0x73')],'raw':!![]})['then'](function(_0x258824){return _0x258824;});})['then'](function(_0x5c4936){if(_0x5c4936){_0xd7cb34[_0x146c('0x29')]['contact']=_0x5c4936[0x0];if(!_0x1e395e['body'][_0x146c('0x64')])return;return db[_0x146c('0x75')][_0x146c('0x57')]({'where':{'id':_0x1e395e['body'][_0x146c('0x64')],'role':_0x146c('0x66')},'attributes':['id',_0x146c('0x39'),_0x146c('0x76'),_0x146c('0x77'),_0x146c('0x78')],'raw':!![]});}return null;})['then'](function(_0xba5dfe){if(!_0xba5dfe)return null;_0xd7cb34['message'][_0x146c('0x66')]=_0xba5dfe;return _0xd7cb34;})['then'](function(_0x32727d){if(_0x32727d){_0x32727d[_0x146c('0x29')][_0x146c('0x83')]=util['format']('SIP/%s',_0x1e395e[_0x146c('0x65')]['name']);_0x32727d[_0x146c('0x29')][_0x146c('0x79')]=_0xd7cb34[_0x146c('0x79')];_0x32727d[_0x146c('0x29')][_0x146c('0x84')]=_0xd7cb34[_0x146c('0x79')];_0x32727d[_0x146c('0x29')][_0x146c('0x7a')]=_0x146c('0x7d');respondWithRpcPromise('EventManager',_0x146c('0x7b'),{'event':'rejectmessage','message':_0x32727d['message']},client9002);return _0xd7cb34;}return null;})[_0x146c('0x37')](respondWithResult(_0x6988b5,null))[_0x146c('0x54')](handleError(_0x6988b5,null));};exports[_0x146c('0x2c')]=function(_0x263dcb,_0x3c2a1c,_0x774b2c){if(_0x263dcb['body']['id']){delete _0x263dcb[_0x146c('0x59')]['id'];}var _0x578794;return db[_0x146c('0x51')][_0x146c('0x57')]({'where':{'id':_0x263dcb[_0x146c('0x56')]['id']}})[_0x146c('0x37')](handleEntityNotFound(_0x3c2a1c,null))[_0x146c('0x37')](function(_0xba45f8){if(_0xba45f8){_0x578794=_0xba45f8;return db[_0x146c('0x85')][_0x146c('0x57')]({'where':{'id':_0xba45f8['SmsAccountId']}});}})[_0x146c('0x37')](handleEntityNotFound(_0x3c2a1c,null))[_0x146c('0x37')](function(_0x5a545c){if(_0x5a545c){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x146c('0x2c'),_0x146c('0x86'),_0x5a545c[_0x146c('0x3d')],util['inspect'](_0x263dcb[_0x146c('0x59')],{'showHidden':![],'depth':null}));switch(_0x5a545c[_0x146c('0x3d')]){case _0x146c('0x87'):if(_0x263dcb['body'][_0x146c('0x88')]&&_0x263dcb[_0x146c('0x59')]['MessageSid']===_0x578794[_0x146c('0x89')]){return _0x578794[_0x146c('0x36')]({'read':!![]});}else{logger[_0x146c('0x27')](_0x146c('0x8a'),_0x146c('0x2c'),_0x146c('0x87'),util[_0x146c('0x8b')](_0x263dcb['body'],{'showHidden':![],'depth':null}));}break;case _0x146c('0x8c'):if(_0x263dcb[_0x146c('0x59')][_0x146c('0x8d')]&&_0x263dcb['body'][_0x146c('0x8d')]===_0x578794['messageId']&&_['indexOf']([_0x146c('0x8e'),_0x146c('0x8f')],_0x263dcb['body'][_0x146c('0x90')])>=0x0){return _0x578794['update']({'read':!![]});}else{logger[_0x146c('0x27')](_0x146c('0x8a'),_0x146c('0x2c'),_0x146c('0x91'),util[_0x146c('0x8b')](_0x263dcb[_0x146c('0x59')],{'showHidden':![],'depth':null}));}break;case _0x146c('0x92'):var _0x4e44f1=_0x263dcb[_0x146c('0x59')][_0x146c('0x93')][0x0];if(_0x4e44f1[_0x146c('0x2c')][_0x146c('0x94')]==='DELIVERED'){return _0x578794[_0x146c('0x36')]({'read':!![]});}else{logger[_0x146c('0x27')](_0x146c('0x8a'),'status',_0x146c('0x92'),util[_0x146c('0x8b')](_0x263dcb[_0x146c('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x578794;}})['then'](respondWithResult(_0x3c2a1c,null))[_0x146c('0x54')](handleError(_0x3c2a1c,null));}; \ No newline at end of file +var _0x75ea=['register','client','http','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','end','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','SmsMessage','length','find','create','body','destroy','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','contact','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','twilio','plivo','MessageUUID','messageId','indexOf','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','groupName','DELIVERED','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x257222,_0x24f971){var _0x4204cf=function(_0x37557){while(--_0x37557){_0x257222['push'](_0x257222['shift']());}};_0x4204cf(++_0x24f971);}(_0x75ea,0x7d));var _0xa75e=function(_0x51531,_0x32b13a){_0x51531=_0x51531-0x0;var _0x5f4f30=_0x75ea[_0x51531];return _0x5f4f30;};'use strict';var emlformat=require(_0xa75e('0x0'));var rimraf=require(_0xa75e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa75e('0x2'));var rp=require(_0xa75e('0x3'));var moment=require('moment');var BPromise=require(_0xa75e('0x4'));var Mustache=require(_0xa75e('0x5'));var util=require(_0xa75e('0x6'));var path=require(_0xa75e('0x7'));var sox=require(_0xa75e('0x8'));var csv=require('to-csv');var ejs=require(_0xa75e('0x9'));var fs=require('fs');var fs_extra=require(_0xa75e('0xa'));var _=require(_0xa75e('0xb'));var squel=require(_0xa75e('0xc'));var crypto=require(_0xa75e('0xd'));var jsforce=require(_0xa75e('0xe'));var deskjs=require(_0xa75e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa75e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa75e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa75e('0x12'))(_0xa75e('0x13'));var utils=require('../../config/utils');var config=require(_0xa75e('0x14'));var licenseUtil=require(_0xa75e('0x15'));var db=require(_0xa75e('0x16'))['db'];config[_0xa75e('0x17')]=_[_0xa75e('0x18')](config[_0xa75e('0x17')],{'host':_0xa75e('0x19'),'port':0x18eb});var socket=require(_0xa75e('0x1a'))(new Redis(config[_0xa75e('0x17')]));require('./smsMessage.socket')[_0xa75e('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa75e('0x1c')][_0xa75e('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xa75e('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3179e2,_0x1d78ce,_0x49cbf7,_0xb55a6f){return new BPromise(function(_0x315fde,_0x11bc0f){var _0x5c0725=_0xb55a6f||client;return _0x5c0725[_0xa75e('0x1e')](_0x3179e2,_0x49cbf7)[_0xa75e('0x1f')](function(_0x34c0c2){logger[_0xa75e('0x20')]('SmsMessage,\x20%s,\x20%s',_0x1d78ce,_0xa75e('0x21'));logger[_0xa75e('0x22')](_0xa75e('0x23'),_0x1d78ce,'request\x20sent',JSON['stringify'](_0x34c0c2));if(_0x34c0c2[_0xa75e('0x24')]){if(_0x34c0c2['error']['code']===0x1f4){logger['error'](_0xa75e('0x25'),_0x1d78ce,_0x34c0c2['error'][_0xa75e('0x26')]);return _0x11bc0f(_0x34c0c2['error'][_0xa75e('0x26')]);}logger[_0xa75e('0x24')](_0xa75e('0x25'),_0x1d78ce,_0x34c0c2['error'][_0xa75e('0x26')]);return _0x315fde(_0x34c0c2[_0xa75e('0x24')][_0xa75e('0x26')]);}else{logger['info'](_0xa75e('0x25'),_0x1d78ce,_0xa75e('0x21'));_0x315fde(_0x34c0c2[_0xa75e('0x27')][_0xa75e('0x26')]);}})[_0xa75e('0x28')](function(_0x29c9df){logger[_0xa75e('0x24')](_0xa75e('0x25'),_0x1d78ce,_0x29c9df);_0x11bc0f(_0x29c9df);});});}function respondWithStatusCode(_0x2064db,_0x5c41c0){_0x5c41c0=_0x5c41c0||0xcc;return function(_0x52bee6){if(_0x52bee6){return _0x2064db[_0xa75e('0x29')](_0x5c41c0);}return _0x2064db[_0xa75e('0x2a')](_0x5c41c0)['end']();};}function respondWithResult(_0x909d5b,_0x316197){_0x316197=_0x316197||0xc8;return function(_0xdb92a2){if(_0xdb92a2){return _0x909d5b[_0xa75e('0x2a')](_0x316197)[_0xa75e('0x2b')](_0xdb92a2);}};}function respondWithFilteredResult(_0x113af5,_0x57bbba){return function(_0x455b8a){if(_0x455b8a){var _0x15241f=typeof _0x57bbba[_0xa75e('0x2c')]===_0xa75e('0x2d')&&typeof _0x57bbba[_0xa75e('0x2e')]==='undefined';var _0x63e6a1=_0x455b8a['count'];var _0x5799d8=_0x15241f?0x0:_0x57bbba[_0xa75e('0x2c')];var _0x2a6c74=_0x15241f?_0x455b8a[_0xa75e('0x2f')]:_0x57bbba[_0xa75e('0x2c')]+_0x57bbba[_0xa75e('0x2e')];var _0xf091d7;if(_0x2a6c74>=_0x63e6a1){_0x2a6c74=_0x63e6a1;_0xf091d7=0xc8;}else{_0xf091d7=0xce;}_0x113af5[_0xa75e('0x2a')](_0xf091d7);return _0x113af5[_0xa75e('0x30')](_0xa75e('0x31'),_0x5799d8+'-'+_0x2a6c74+'/'+_0x63e6a1)[_0xa75e('0x2b')](_0x455b8a);}return null;};}function patchUpdates(_0x30a7e5){return function(_0x5d3d53){try{jsonpatch[_0xa75e('0x32')](_0x5d3d53,_0x30a7e5,!![]);}catch(_0x5ca192){return BPromise[_0xa75e('0x33')](_0x5ca192);}return _0x5d3d53[_0xa75e('0x34')]();};}function saveUpdates(_0x3cefdd,_0x11b280){return function(_0x38ac6f){if(_0x38ac6f){return _0x38ac6f[_0xa75e('0x35')](_0x3cefdd)['then'](function(_0x5265b7){return _0x5265b7;});}return null;};}function removeEntity(_0x512db7,_0x2c560c){return function(_0x587ed9){if(_0x587ed9){return _0x587ed9['destroy']()[_0xa75e('0x1f')](function(){_0x512db7['status'](0xcc)[_0xa75e('0x36')]();});}};}function handleEntityNotFound(_0xd0ce21,_0x17fa2a){return function(_0x44e838){if(!_0x44e838){_0xd0ce21['sendStatus'](0x194);}return _0x44e838;};}function handleError(_0x11988e,_0x1a2a31){_0x1a2a31=_0x1a2a31||0x1f4;return function(_0x1679d1){logger['error'](_0x1679d1['stack']);if(_0x1679d1[_0xa75e('0x37')]){delete _0x1679d1[_0xa75e('0x37')];}_0x11988e['status'](_0x1a2a31)[_0xa75e('0x38')](_0x1679d1);};}exports[_0xa75e('0x39')]=function(_0x582d73,_0x241fb8){var _0x140464={},_0x490366={},_0x257e4f={'count':0x0,'rows':[]};var _0x1b3d60=_[_0xa75e('0x3a')](db['SmsMessage'][_0xa75e('0x3b')],function(_0x15e2a8){return{'name':_0x15e2a8[_0xa75e('0x3c')],'type':_0x15e2a8[_0xa75e('0x3d')][_0xa75e('0x3e')]};});_0x490366['model']=_[_0xa75e('0x3a')](_0x1b3d60,'name');_0x490366[_0xa75e('0x3f')]=_[_0xa75e('0x40')](_0x582d73[_0xa75e('0x3f')]);_0x490366[_0xa75e('0x41')]=_[_0xa75e('0x42')](_0x490366['model'],_0x490366[_0xa75e('0x3f')]);_0x140464[_0xa75e('0x43')]=_[_0xa75e('0x42')](_0x490366['model'],qs[_0xa75e('0x44')](_0x582d73[_0xa75e('0x3f')]['fields']));_0x140464[_0xa75e('0x43')]=_0x140464[_0xa75e('0x43')]['length']?_0x140464[_0xa75e('0x43')]:_0x490366[_0xa75e('0x45')];if(!_0x582d73[_0xa75e('0x3f')][_0xa75e('0x46')](_0xa75e('0x47'))){_0x140464[_0xa75e('0x2e')]=qs['limit'](_0x582d73[_0xa75e('0x3f')][_0xa75e('0x2e')]);_0x140464[_0xa75e('0x2c')]=qs[_0xa75e('0x2c')](_0x582d73['query']['offset']);}_0x140464['order']=qs[_0xa75e('0x48')](_0x582d73[_0xa75e('0x3f')][_0xa75e('0x48')]);_0x140464[_0xa75e('0x49')]=qs['filters'](_[_0xa75e('0x4a')](_0x582d73['query'],_0x490366[_0xa75e('0x41')]),_0x1b3d60);if(_0x582d73[_0xa75e('0x3f')][_0xa75e('0x4b')]){_0x140464['where']=_[_0xa75e('0x4c')](_0x140464[_0xa75e('0x49')],{'$or':_['map'](_0x1b3d60,function(_0xe1420c){if(_0xe1420c[_0xa75e('0x3d')]!==_0xa75e('0x4d')){var _0x3e4bd5={};_0x3e4bd5[_0xe1420c['name']]={'$like':'%'+_0x582d73[_0xa75e('0x3f')][_0xa75e('0x4b')]+'%'};return _0x3e4bd5;}})});}_0x140464=_[_0xa75e('0x4c')]({},_0x140464,_0x582d73[_0xa75e('0x4e')]);var _0x5b184d={'where':_0x140464[_0xa75e('0x49')]};return db['SmsMessage'][_0xa75e('0x2f')](_0x5b184d)[_0xa75e('0x1f')](function(_0x21fba5){_0x257e4f['count']=_0x21fba5;if(_0x582d73[_0xa75e('0x3f')][_0xa75e('0x4f')]){_0x140464[_0xa75e('0x50')]=[{'all':!![]}];}return db['SmsMessage'][_0xa75e('0x51')](_0x140464);})[_0xa75e('0x1f')](function(_0x193bfd){_0x257e4f['rows']=_0x193bfd;return _0x257e4f;})[_0xa75e('0x1f')](respondWithFilteredResult(_0x241fb8,_0x140464))['catch'](handleError(_0x241fb8,null));};exports[_0xa75e('0x52')]=function(_0x445c0e,_0x281b05){var _0x5e1cd3={'raw':!![],'where':{'id':_0x445c0e[_0xa75e('0x53')]['id']}},_0x2ef7b2={};_0x2ef7b2['model']=_[_0xa75e('0x40')](db[_0xa75e('0x54')][_0xa75e('0x3b')]);_0x2ef7b2[_0xa75e('0x3f')]=_[_0xa75e('0x40')](_0x445c0e[_0xa75e('0x3f')]);_0x2ef7b2[_0xa75e('0x41')]=_[_0xa75e('0x42')](_0x2ef7b2[_0xa75e('0x45')],_0x2ef7b2[_0xa75e('0x3f')]);_0x5e1cd3[_0xa75e('0x43')]=_[_0xa75e('0x42')](_0x2ef7b2['model'],qs[_0xa75e('0x44')](_0x445c0e[_0xa75e('0x3f')]['fields']));_0x5e1cd3[_0xa75e('0x43')]=_0x5e1cd3['attributes'][_0xa75e('0x55')]?_0x5e1cd3[_0xa75e('0x43')]:_0x2ef7b2[_0xa75e('0x45')];if(_0x445c0e[_0xa75e('0x3f')][_0xa75e('0x4f')]){_0x5e1cd3[_0xa75e('0x50')]=[{'all':!![]}];}_0x5e1cd3=_[_0xa75e('0x4c')]({},_0x5e1cd3,_0x445c0e['options']);return db[_0xa75e('0x54')][_0xa75e('0x56')](_0x5e1cd3)[_0xa75e('0x1f')](handleEntityNotFound(_0x281b05,null))[_0xa75e('0x1f')](respondWithResult(_0x281b05,null))[_0xa75e('0x28')](handleError(_0x281b05,null));};exports[_0xa75e('0x57')]=function(_0x1b62fd,_0x5cde75){return db[_0xa75e('0x54')][_0xa75e('0x57')](_0x1b62fd['body'],{})[_0xa75e('0x1f')](respondWithResult(_0x5cde75,0xc9))['catch'](handleError(_0x5cde75,null));};exports['update']=function(_0x49f816,_0x3aadef){if(_0x49f816['body']['id']){delete _0x49f816[_0xa75e('0x58')]['id'];}return db[_0xa75e('0x54')]['find']({'where':{'id':_0x49f816[_0xa75e('0x53')]['id']}})['then'](handleEntityNotFound(_0x3aadef,null))[_0xa75e('0x1f')](saveUpdates(_0x49f816[_0xa75e('0x58')],null))[_0xa75e('0x1f')](respondWithResult(_0x3aadef,null))['catch'](handleError(_0x3aadef,null));};exports[_0xa75e('0x59')]=function(_0x22bcff,_0xb7c3aa){return db[_0xa75e('0x54')][_0xa75e('0x56')]({'where':{'id':_0x22bcff[_0xa75e('0x53')]['id']}})['then'](handleEntityNotFound(_0xb7c3aa,null))['then'](removeEntity(_0xb7c3aa,null))[_0xa75e('0x28')](handleError(_0xb7c3aa,null));};exports[_0xa75e('0x5a')]=function(_0x102702,_0x4ade67){return db[_0xa75e('0x54')][_0xa75e('0x5a')]()[_0xa75e('0x1f')](respondWithResult(_0x4ade67,null))[_0xa75e('0x28')](handleError(_0x4ade67,null));};var interaction_log=require(_0xa75e('0x12'))(_0xa75e('0x5b'));exports[_0xa75e('0x5c')]=function(_0x167ebc,_0x22f2a7,_0x140dbb){var _0x106513={'agent':{},'channel':_0xa75e('0x5d')};if(_0x167ebc[_0xa75e('0x58')]['id']){delete _0x167ebc['body']['id'];}_0x167ebc['body'][_0xa75e('0x5e')]=!![];_0x167ebc[_0xa75e('0x58')][_0xa75e('0x5f')]=moment()[_0xa75e('0x60')](_0xa75e('0x61'));_0x167ebc[_0xa75e('0x58')][_0xa75e('0x62')]=_0x167ebc[_0xa75e('0x58')][_0xa75e('0x62')]||_0x167ebc[_0xa75e('0x63')]['id'];_0x106513[_0xa75e('0x64')]['id']=_0x167ebc[_0xa75e('0x58')][_0xa75e('0x62')];return db[_0xa75e('0x54')][_0xa75e('0x56')]({'where':{'id':_0x167ebc[_0xa75e('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x22f2a7,null))['then'](saveUpdates(_0x167ebc[_0xa75e('0x58')],null))[_0xa75e('0x1f')](function(_0x138e84){if(_0x138e84){_0x106513[_0xa75e('0x26')]=_0x138e84[_0xa75e('0x65')]({'plain':!![]});return db[_0xa75e('0x66')][_0xa75e('0x56')]({'where':{'id':_0x138e84[_0xa75e('0x67')]}});}return null;})[_0xa75e('0x1f')](handleEntityNotFound(_0x22f2a7,null))[_0xa75e('0x1f')](function(_0x1f2efd){if(_0x1f2efd){return _0x1f2efd[_0xa75e('0x35')]({'UserId':_0x167ebc[_0xa75e('0x58')][_0xa75e('0x62')],'read1stAt':_[_0xa75e('0x68')](_0x1f2efd[_0xa75e('0x69')])?moment()['format'](_0xa75e('0x61')):undefined});}return null;})['then'](function(_0x4851ea){if(_0x4851ea){_0x106513['interaction']=_0x4851ea[_0xa75e('0x65')]({'plain':!![]});interaction_log['info'](_0xa75e('0x6a'),_0x167ebc[_0xa75e('0x63')]['id'],_0x167ebc[_0xa75e('0x63')][_0xa75e('0x37')],_0x167ebc['user'][_0xa75e('0x6b')],_0x106513[_0xa75e('0x6c')]['id'],_0x167ebc[_0xa75e('0x58')]?JSON[_0xa75e('0x6d')](_0x167ebc[_0xa75e('0x58')]):_0xa75e('0x6e'));return respondWithRpcPromise(_0xa75e('0x6f'),_0xa75e('0x70'),_0x106513);}return null;})[_0xa75e('0x1f')](function(_0x4f5557){var _0x2949d3=_0xa75e('0x71')+_0x4f5557[_0xa75e('0x26')][_0xa75e('0x72')];return db[_0xa75e('0x73')]['query'](_0x2949d3,{'type':db['Sequelize'][_0xa75e('0x74')][_0xa75e('0x75')],'raw':!![]})['then'](function(_0x359358){return _0x359358;});})[_0xa75e('0x1f')](function(_0x2b4124){if(_0x2b4124){_0x106513['message']['contact']=_0x2b4124[0x0];if(!_0x167ebc[_0xa75e('0x58')][_0xa75e('0x62')])return;return db[_0xa75e('0x76')][_0xa75e('0x56')]({'where':{'id':_0x167ebc['body'][_0xa75e('0x62')],'role':_0xa75e('0x64')},'attributes':['id','name',_0xa75e('0x77'),_0xa75e('0x78'),'internal'],'raw':!![]});}return null;})[_0xa75e('0x1f')](function(_0x2ccdfd){if(!_0x2ccdfd)return null;_0x106513['message'][_0xa75e('0x64')]=_0x2ccdfd;return _0x106513;})[_0xa75e('0x1f')](function(_0x38e608){if(_0x38e608){if(_0x167ebc[_0xa75e('0x58')][_0xa75e('0x79')]){_0x106513['message'][_0xa75e('0x7a')]=util['format'](_0xa75e('0x7b'),_0x167ebc[_0xa75e('0x63')][_0xa75e('0x37')]);_0x106513['message'][_0xa75e('0x7c')]=_0x106513[_0xa75e('0x7c')];_0x106513[_0xa75e('0x26')][_0xa75e('0x7d')]=_0x106513[_0xa75e('0x7c')];_0x106513[_0xa75e('0x26')][_0xa75e('0x7e')]=_0xa75e('0x5c');return respondWithRpcPromise(_0xa75e('0x7f'),_0xa75e('0x7f'),{'event':_0xa75e('0x80'),'message':_0x106513[_0xa75e('0x26')]},client9002)[_0xa75e('0x1f')](function(){return _0x106513;});}return _0x106513;}return null;})[_0xa75e('0x1f')](respondWithResult(_0x22f2a7,null))['catch'](handleError(_0x22f2a7,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0xa75e('0x33')]=function(_0x14fb8b,_0x179226,_0x55360c){var _0x2b9624={'agent':{},'channel':_0xa75e('0x5d')};if(_0x14fb8b[_0xa75e('0x58')]['id']){delete _0x14fb8b[_0xa75e('0x58')]['id'];}_0x14fb8b[_0xa75e('0x58')][_0xa75e('0x62')]=_0x14fb8b[_0xa75e('0x58')][_0xa75e('0x62')]||_0x14fb8b[_0xa75e('0x63')]['id'];_0x2b9624[_0xa75e('0x64')]['id']=_0x14fb8b[_0xa75e('0x58')][_0xa75e('0x62')];return db[_0xa75e('0x54')][_0xa75e('0x56')]({'where':{'id':_0x14fb8b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x179226,null))['then'](function(_0x2eebdb){if(_0x2eebdb){_0x2b9624['message']=_0x2eebdb[_0xa75e('0x65')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x2eebdb['SmsInteractionId']}});}return null;})[_0xa75e('0x1f')](handleEntityNotFound(_0x179226,null))[_0xa75e('0x1f')](function(_0x34d5a5){if(_0x34d5a5){_0x2b9624[_0xa75e('0x6c')]=_0x34d5a5[_0xa75e('0x65')]({'plain':!![]});interaction_log[_0xa75e('0x20')](_0xa75e('0x81'),_0x14fb8b['user']['id'],_0x14fb8b[_0xa75e('0x63')][_0xa75e('0x37')],_0x14fb8b[_0xa75e('0x63')]['role'],_0x2b9624[_0xa75e('0x6c')]['id'],_0x14fb8b['body']?JSON[_0xa75e('0x6d')](_0x14fb8b[_0xa75e('0x58')]):_0xa75e('0x6e'));return respondWithRpcPromise(_0xa75e('0x82'),_0xa75e('0x83'),_0x2b9624);}return null;})['then'](function(_0x5f5c7d){var _0x1bbc98=_0xa75e('0x71')+_0x5f5c7d[_0xa75e('0x26')]['ContactId'];return db[_0xa75e('0x73')][_0xa75e('0x3f')](_0x1bbc98,{'type':db[_0xa75e('0x84')][_0xa75e('0x74')]['SELECT'],'raw':!![]})[_0xa75e('0x1f')](function(_0x3d2f9f){return _0x3d2f9f;});})[_0xa75e('0x1f')](function(_0xb044a){if(_0xb044a){_0x2b9624[_0xa75e('0x26')][_0xa75e('0x85')]=_0xb044a[0x0];if(!_0x14fb8b[_0xa75e('0x58')]['UserId'])return;return db[_0xa75e('0x76')][_0xa75e('0x56')]({'where':{'id':_0x14fb8b[_0xa75e('0x58')][_0xa75e('0x62')],'role':_0xa75e('0x64')},'attributes':['id',_0xa75e('0x37'),_0xa75e('0x77'),_0xa75e('0x78'),'internal'],'raw':!![]});}return null;})[_0xa75e('0x1f')](function(_0x2b5eb3){if(!_0x2b5eb3)return null;_0x2b9624['message']['agent']=_0x2b5eb3;return _0x2b9624;})[_0xa75e('0x1f')](function(_0x2f1813){if(_0x2f1813){_0x2f1813[_0xa75e('0x26')][_0xa75e('0x7a')]=util[_0xa75e('0x60')](_0xa75e('0x7b'),_0x14fb8b['user'][_0xa75e('0x37')]);_0x2f1813[_0xa75e('0x26')][_0xa75e('0x7c')]=_0x2b9624[_0xa75e('0x7c')];_0x2f1813[_0xa75e('0x26')]['motionChannel']=_0x2b9624['channel'];_0x2f1813['message'][_0xa75e('0x7e')]=_0xa75e('0x33');respondWithRpcPromise(_0xa75e('0x7f'),'EventManager',{'event':_0xa75e('0x86'),'message':_0x2f1813[_0xa75e('0x26')]},client9002);return _0x2b9624;}return null;})[_0xa75e('0x1f')](respondWithResult(_0x179226,null))[_0xa75e('0x28')](handleError(_0x179226,null));};exports['status']=function(_0x51e3e5,_0x1e075c,_0x9bc96c){if(_0x51e3e5['body']['id']){delete _0x51e3e5[_0xa75e('0x58')]['id'];}var _0x278002;return db['SmsMessage'][_0xa75e('0x56')]({'where':{'id':_0x51e3e5[_0xa75e('0x53')]['id']}})[_0xa75e('0x1f')](handleEntityNotFound(_0x1e075c,null))['then'](function(_0x399358){if(_0x399358){_0x278002=_0x399358;return db[_0xa75e('0x87')][_0xa75e('0x56')]({'where':{'id':_0x399358[_0xa75e('0x88')]}});}})[_0xa75e('0x1f')](handleEntityNotFound(_0x1e075c,null))[_0xa75e('0x1f')](function(_0xf22cba){if(_0xf22cba){logger['debug'](_0xa75e('0x23'),'status',_0xa75e('0x89'),_0xf22cba[_0xa75e('0x3d')],util[_0xa75e('0x8a')](_0x51e3e5['body'],{'showHidden':![],'depth':null}));switch(_0xf22cba[_0xa75e('0x3d')]){case'twilio':if(_0x51e3e5[_0xa75e('0x58')][_0xa75e('0x8b')]&&_0x51e3e5['body'][_0xa75e('0x8b')]===_0x278002['messageId']){return _0x278002['update']({'read':!![]});}else{logger[_0xa75e('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa75e('0x2a'),_0xa75e('0x8c'),util[_0xa75e('0x8a')](_0x51e3e5['body'],{'showHidden':![],'depth':null}));}break;case _0xa75e('0x8d'):if(_0x51e3e5['body'][_0xa75e('0x8e')]&&_0x51e3e5['body']['MessageUUID']===_0x278002[_0xa75e('0x8f')]&&_[_0xa75e('0x90')](['sent',_0xa75e('0x91')],_0x51e3e5[_0xa75e('0x58')][_0xa75e('0x92')])>=0x0){return _0x278002[_0xa75e('0x35')]({'read':!![]});}else{logger[_0xa75e('0x24')](_0xa75e('0x93'),_0xa75e('0x2a'),_0xa75e('0x94'),util[_0xa75e('0x8a')](_0x51e3e5[_0xa75e('0x58')],{'showHidden':![],'depth':null}));}break;case _0xa75e('0x95'):var _0x485ea7=_0x51e3e5[_0xa75e('0x58')]['results'][0x0];if(_0x485ea7[_0xa75e('0x2a')][_0xa75e('0x96')]===_0xa75e('0x97')){return _0x278002[_0xa75e('0x35')]({'read':!![]});}else{logger[_0xa75e('0x24')](_0xa75e('0x93'),_0xa75e('0x2a'),_0xa75e('0x95'),util[_0xa75e('0x8a')](_0x51e3e5[_0xa75e('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x278002;}})['then'](respondWithResult(_0x1e075c,null))[_0xa75e('0x28')](handleError(_0x1e075c,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 3015167..b21ecd5 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 _0x0262=['remove','emit','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0xf7a64a,_0xcb9b7d){var _0x3423c6=function(_0x2a7359){while(--_0x2a7359){_0xf7a64a['push'](_0xf7a64a['shift']());}};_0x3423c6(++_0xcb9b7d);}(_0x0262,0x16a));var _0x2026=function(_0x313416,_0x22e1a7){_0x313416=_0x313416-0x0;var _0x4cd43d=_0x0262[_0x313416];return _0x4cd43d;};'use strict';var EventEmitter=require(_0x2026('0x0'));var SmsMessage=require(_0x2026('0x1'))['db'][_0x2026('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x2026('0x3')](0x0);var events={'afterCreate':_0x2026('0x4'),'afterUpdate':_0x2026('0x5'),'afterDestroy':_0x2026('0x6')};function emitEvent(_0x4af458){return function(_0x188a84,_0x3d951b,_0x5e3e46){SmsMessageEvents[_0x2026('0x7')](_0x4af458+':'+_0x188a84['id'],_0x188a84);SmsMessageEvents[_0x2026('0x7')](_0x4af458,_0x188a84);_0x5e3e46(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x0830=['SmsMessage','setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x42a284,_0x320e53){var _0x262065=function(_0x559b1f){while(--_0x559b1f){_0x42a284['push'](_0x42a284['shift']());}};_0x262065(++_0x320e53);}(_0x0830,0x11e));var _0x0083=function(_0x32efc7,_0x59650a){_0x32efc7=_0x32efc7-0x0;var _0x5b188d=_0x0830[_0x32efc7];return _0x5b188d;};'use strict';var EventEmitter=require(_0x0083('0x0'));var SmsMessage=require(_0x0083('0x1'))['db'][_0x0083('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0083('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0083('0x4'),'afterDestroy':_0x0083('0x5')};function emitEvent(_0x4e30da){return function(_0x3aca03,_0x4c68cc,_0x330772){SmsMessageEvents[_0x0083('0x6')](_0x4e30da+':'+_0x3aca03['id'],_0x3aca03);SmsMessageEvents[_0x0083('0x6')](_0x4e30da,_0x3aca03);_0x330772(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x0083('0x7')](e,emitEvent(event));}}module[_0x0083('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 636b35b..1bf652d 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 _0xc3db=['apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','sms_messages','messageId','fti_sms_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','then','update','createdAt','catch','error','SmsAccount','SmsAccountId','type','twilio','accountSid','phone','create','/api/sms/messages/','/status?token=','token','sid','afterCreate','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','sms','POST','session_key','internal_order_id','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','authToken','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','base64','http_code','data','queued_count','head','messages','clickSend','plivo','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','csc','crypto','login','text','timestamp','length','apiKey','createHash','md5','digest','signature=','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid'];(function(_0x1b87ac,_0x1e31a7){var _0x4d604e=function(_0x385e41){while(--_0x385e41){_0x1b87ac['push'](_0x1b87ac['shift']());}};_0x4d604e(++_0x1e31a7);}(_0xc3db,0x1eb));var _0xbc3d=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0xc3db[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require(_0xbc3d('0x0'));var util=require(_0xbc3d('0x1'));var logger=require('../../config/logger')(_0xbc3d('0x2'));var moment=require(_0xbc3d('0x3'));var BPromise=require(_0xbc3d('0x4'));var rp=require(_0xbc3d('0x5'));var fs=require('fs');var path=require(_0xbc3d('0x6'));var rimraf=require(_0xbc3d('0x7'));var config=require(_0xbc3d('0x8'));var attributes=require(_0xbc3d('0x9'));module['exports']=function(_0x147f2d,_0xc97477){return _0x147f2d[_0xbc3d('0xa')]('SmsMessage',attributes,{'tableName':_0xbc3d('0xb'),'paranoid':![],'indexes':[{'name':_0xbc3d('0xc'),'fields':[_0xbc3d('0xc')]},{'name':_0xbc3d('0xd'),'fields':[_0xbc3d('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4be386,_0x559ebf,_0xf8f78c){var _0x1a7efd=_0x147f2d[_0xbc3d('0xf')];var _0x43eea6=_0x4be386[_0xbc3d('0x10')]({'plain':!![]});if(_0x43eea6[_0xbc3d('0x11')][_0xbc3d('0x12')]()==='in'||_0x43eea6['direction']['toLowerCase']()===_0xbc3d('0x13')&&!_0x43eea6[_0xbc3d('0x14')]&&!_[_0xbc3d('0x15')](_0x43eea6[_0xbc3d('0x16')])&&!_[_0xbc3d('0x15')](_0x43eea6['SmsInteractionId'])){_0x1a7efd['SmsInteraction']['findOne']({'where':{'id':_0x43eea6[_0xbc3d('0x17')]}})[_0xbc3d('0x18')](function(_0x21ca5f){if(_0x21ca5f){_0x21ca5f[_0xbc3d('0x19')]({'lastMsgAt':_0x43eea6[_0xbc3d('0x1a')],'lastMsgDirection':_0x43eea6['direction'][_0xbc3d('0x12')]()});}})[_0xbc3d('0x1b')](function(_0x10c121){console[_0xbc3d('0x1c')](_0x10c121);});}if(_0x43eea6[_0xbc3d('0x11')]===_0xbc3d('0x13')&&!_0x43eea6[_0xbc3d('0x14')]){var _0x1ce097;_0x1a7efd[_0xbc3d('0x1d')]['find']({'where':{'id':_0x43eea6[_0xbc3d('0x1e')]},'raw':!![]})[_0xbc3d('0x18')](function(_0x26e325){_0x1ce097=_0x26e325;if(_0x1ce097&&_0x1ce097[_0xbc3d('0x1f')]){switch(_0x1ce097[_0xbc3d('0x1f')]){case _0xbc3d('0x20'):var _0xe5afaf=require(_0xbc3d('0x20'));if(_0x1ce097[_0xbc3d('0x21')]&&_0x1ce097['authToken']&&_0x1ce097[_0xbc3d('0x22')]){var _0x5e6b7a=new _0xe5afaf(_0x1ce097['accountSid'],_0x1ce097['authToken']);_0x5e6b7a['messages'][_0xbc3d('0x23')]({'body':_0x43eea6[_0xbc3d('0xe')],'to':_0x43eea6['phone'],'from':_0x1ce097[_0xbc3d('0x22')],'statusCallback':_0x1ce097['remote']+_0xbc3d('0x24')+_0x43eea6['id']+_0xbc3d('0x25')+_0x1ce097[_0xbc3d('0x26')]})['then'](function(_0x1736ef){if(_0x1736ef[_0xbc3d('0x27')]){return _0x4be386[_0xbc3d('0x19')]({'messageId':_0x1736ef[_0xbc3d('0x27')]});}})['catch'](function(_0x398e73){logger[_0xbc3d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbc3d('0x28'),_0xbc3d('0x20'),util['inspect'](_0x398e73,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xbc3d('0x29'),_0xbc3d('0x28'),_0xbc3d('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xbc3d('0x2a'):var _0xdc6457=_0xbc3d('0x2b');if(_0x1ce097[_0xbc3d('0x2c')]&&_0x1ce097[_0xbc3d('0x2d')]){var _0x47f687={'recipient':[_0x43eea6[_0xbc3d('0x22')]],'message':_0x43eea6[_0xbc3d('0xe')],'message_type':_0x1ce097[_0xbc3d('0x2e')]};if(_0x1ce097[_0xbc3d('0x2e')]&&_0x1ce097[_0xbc3d('0x2e')]!=='SI'){_0x47f687[_0xbc3d('0x2f')]=_0x1ce097['phone'];}var _0x5f0484={'url':_0xdc6457+_0xbc3d('0x30')+_0x1ce097[_0xbc3d('0x2c')]+_0xbc3d('0x31')+_0x1ce097[_0xbc3d('0x2d')],'method':_0xbc3d('0x32')};rp(_0x5f0484)[_0xbc3d('0x18')](function(_0x4386cd){var _0x14476d=_0x4386cd['split'](';');var _0x2c51d0={'user_key':_0x14476d[0x0],'session_key':_0x14476d[0x1]};_0x5f0484={'url':_0xdc6457+_0xbc3d('0x33'),'method':_0xbc3d('0x34'),'headers':{'user_key':_0x2c51d0['user_key'],'Session_key':_0x2c51d0[_0xbc3d('0x35')]},'json':!![],'body':_0x47f687};return rp(_0x5f0484);})[_0xbc3d('0x18')](function(_0x11d6a2){if(_0x11d6a2['total_sent']>=0x1){var _0x3f2a34={'messageId':_0x11d6a2[_0xbc3d('0x36')]};if(_0x1ce097[_0xbc3d('0x2e')]!=='GP'||!_0x1ce097['deliveryReport']){_0x3f2a34[_0xbc3d('0x37')]=!![];}return _0x4be386[_0xbc3d('0x19')](_0x3f2a34);}else{return logger[_0xbc3d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xbc3d('0x2a'),util['inspect'](_0x11d6a2,{'showHidden':![],'depth':null}));}})[_0xbc3d('0x1b')](function(_0x81ade){return logger[_0xbc3d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbc3d('0x28'),_0xbc3d('0x2a'),util[_0xbc3d('0x38')](_0x81ade,{'showHidden':![],'depth':null}));});}else{logger[_0xbc3d('0x1c')](_0xbc3d('0x29'),_0xbc3d('0x28'),_0xbc3d('0x2a'),_0xbc3d('0x39'));}break;case _0xbc3d('0x3a'):if(_0x1ce097['authToken']){var _0x396909={'recipient':_0x43eea6[_0xbc3d('0x22')],'message':_0x43eea6[_0xbc3d('0xe')],'sender':_0x1ce097[_0xbc3d('0x3b')]||_0x1ce097[_0xbc3d('0x22')],'authorization':_0x1ce097[_0xbc3d('0x3c')]};var _0x559ebf={'method':_0xbc3d('0x34'),'uri':_0xbc3d('0x3d'),'body':_0x396909,'json':!![]};rp(_0x559ebf)[_0xbc3d('0x18')](function(_0x3fcb1c){var _0x3a0a8b={'messageId':_0x3fcb1c[_0xbc3d('0x3e')]};if(!_0x1ce097[_0xbc3d('0x3f')]){_0x3a0a8b['read']=!![];}return _0x4be386[_0xbc3d('0x19')](_0x3a0a8b);})[_0xbc3d('0x1b')](function(_0x4d52a0){logger[_0xbc3d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbc3d('0x28'),'connectel',util[_0xbc3d('0x38')](_0x4d52a0,{'showHidden':![],'depth':null}));});}else{logger[_0xbc3d('0x1c')](_0xbc3d('0x29'),_0xbc3d('0x28'),_0xbc3d('0x3a'),_0xbc3d('0x40'));}break;case'clicksend':if(_0x1ce097['username']&&_0x1ce097[_0xbc3d('0x2d')]){var _0x396909={'messages':[{'source':_0xbc3d('0x41'),'to':_0x43eea6['phone'],'body':_0x43eea6[_0xbc3d('0xe')],'from':_0x1ce097[_0xbc3d('0x3b')]||_0x1ce097['phone']}]};var _0x2355b4=util['format'](_0xbc3d('0x42'),_0x1ce097['username'],_0x1ce097['password']);var _0x559ebf={'method':_0xbc3d('0x34'),'uri':_0xbc3d('0x43'),'body':_0x396909,'headers':{'Authorization':util[_0xbc3d('0x44')](_0xbc3d('0x45'),new Buffer(_0x2355b4)[_0xbc3d('0x46')](_0xbc3d('0x47')))},'json':!![]};rp(_0x559ebf)['then'](function(_0x28d947){if(_0x28d947['http_code']>=0xc8&&_0x28d947[_0xbc3d('0x48')]<=0xce){if(_0x28d947[_0xbc3d('0x49')]&&_0x28d947[_0xbc3d('0x49')][_0xbc3d('0x4a')]>0x0){var _0x3fdfec=_[_0xbc3d('0x4b')](_0x28d947['data'][_0xbc3d('0x4c')]);var _0x2c2600={'messageId':_0x3fdfec['message_id']};if(!_0x1ce097[_0xbc3d('0x3f')]){_0x2c2600[_0xbc3d('0x37')]=!![];}return _0x4be386[_0xbc3d('0x19')](_0x2c2600);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbc3d('0x28'),'clickSend',util[_0xbc3d('0x38')](_0x28d947,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xbc3d('0x29'),_0xbc3d('0x28'),_0xbc3d('0x4d'),util[_0xbc3d('0x38')](_0x28d947,{'showHidden':![],'depth':null}));}})['catch'](function(_0x317c6b){logger[_0xbc3d('0x1c')](_0xbc3d('0x29'),_0xbc3d('0x28'),'clickSend',util[_0xbc3d('0x38')](_0x317c6b,{'showHidden':![],'depth':null}));});}else{logger[_0xbc3d('0x1c')](_0xbc3d('0x29'),'afterCreate','clickSend',_0xbc3d('0x39'));}break;case _0xbc3d('0x4e'):if(_0x1ce097[_0xbc3d('0x4f')]&&_0x1ce097[_0xbc3d('0x3c')]){var _0x396909={'dst':_0x43eea6[_0xbc3d('0x22')],'text':_0x43eea6[_0xbc3d('0xe')],'src':_0x1ce097['senderString']||_0x1ce097['phone'],'url':_0x1ce097[_0xbc3d('0x50')]+_0xbc3d('0x24')+_0x43eea6['id']+_0xbc3d('0x25')+_0x1ce097[_0xbc3d('0x26')]};var _0x2355b4=util[_0xbc3d('0x44')](_0xbc3d('0x42'),_0x1ce097[_0xbc3d('0x4f')],_0x1ce097[_0xbc3d('0x3c')]);var _0x559ebf={'method':_0xbc3d('0x34'),'uri':util[_0xbc3d('0x44')](_0xbc3d('0x51'),_0x1ce097['authId']),'body':_0x396909,'headers':{'Authorization':util[_0xbc3d('0x44')]('Basic\x20%s',new Buffer(_0x2355b4)[_0xbc3d('0x46')](_0xbc3d('0x47')))},'json':!![]};rp(_0x559ebf)[_0xbc3d('0x18')](function(_0x902c04){var _0x2df920={'messageId':_0x902c04[_0xbc3d('0x52')][0x0]};return _0x4be386[_0xbc3d('0x19')](_0x2df920);})[_0xbc3d('0x1b')](function(_0xe9dbed){logger[_0xbc3d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbc3d('0x28'),'plivo',util[_0xbc3d('0x38')](_0xe9dbed,{'showHidden':![],'depth':null}));});}else{logger[_0xbc3d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',_0xbc3d('0x53'));}break;case _0xbc3d('0x54'):if(_0x1ce097[_0xbc3d('0x2c')]&&_0x1ce097[_0xbc3d('0x2d')]){if(_0x1ce097[_0xbc3d('0x55')]){var _0x32fd5f={'method':_0xbc3d('0x34'),'uri':_0x1ce097[_0xbc3d('0x55')]+_0xbc3d('0x56'),'body':{'username':_0x1ce097[_0xbc3d('0x2c')],'password':_0x1ce097[_0xbc3d('0x2d')]},'json':!![]};return rp(_0x32fd5f)[_0xbc3d('0x18')](function(_0x535554){var _0x39cce3={'method':'POST','uri':_0x1ce097[_0xbc3d('0x55')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x1ce097[_0xbc3d('0x22')],'destinations':[{'to':_0x43eea6[_0xbc3d('0x22')]}],'text':_0x43eea6[_0xbc3d('0xe')],'notifyUrl':_0x1ce097[_0xbc3d('0x50')]+_0xbc3d('0x24')+_0x43eea6['id']+_0xbc3d('0x25')+_0x1ce097[_0xbc3d('0x26')],'notifyContentType':_0xbc3d('0x57'),'callbackData':_0x1ce097[_0xbc3d('0x22')]+';'+_0x43eea6['body']}]},'headers':{'Authorization':_0xbc3d('0x58')+_0x535554[_0xbc3d('0x26')]},'json':!![]};return rp(_0x39cce3)[_0xbc3d('0x18')](function(_0x176c26){if(_0x176c26[_0xbc3d('0x4c')]){var _0x59a5ed={'messageId':_0x176c26['messages'][0x0][_0xbc3d('0xc')]};if(!_0x1ce097[_0xbc3d('0x3f')]){_0x59a5ed[_0xbc3d('0x37')]=!![];}return _0x4be386[_0xbc3d('0x19')](_0x59a5ed);}else{return logger[_0xbc3d('0x1c')](_0xbc3d('0x29'),'afterCreate',_0xbc3d('0x54'),util[_0xbc3d('0x38')](_0x176c26,{'showHidden':![],'depth':null}));}});})[_0xbc3d('0x1b')](function(_0xfca2a4){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xbc3d('0x54'),util[_0xbc3d('0x38')](_0xfca2a4,{'showHidden':![],'depth':null}));});}else{logger[_0xbc3d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbc3d('0x28'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0xbc3d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbc3d('0x28'),_0xbc3d('0x54'),_0xbc3d('0x39'));}break;case _0xbc3d('0x59'):var _0x38f3a1=require(_0xbc3d('0x5a'));if(_0x1ce097['apiKey']){var _0x1b6a9f={};_0x1b6a9f[_0xbc3d('0x5b')]=_0x1ce097[_0xbc3d('0x2c')];_0x1b6a9f[_0xbc3d('0x22')]=_0x43eea6[_0xbc3d('0x22')];_0x1b6a9f[_0xbc3d('0x2f')]=_0x1ce097['phone'];_0x1b6a9f[_0xbc3d('0x5c')]=_0x43eea6[_0xbc3d('0xe')];_0x1b6a9f[_0xbc3d('0x5d')]=+new Date();var _0xb8acd3='';var _0x13a5a1='';var _0x42df77=Object['keys'](_0x1b6a9f);_0x42df77['sort']();for(var _0x4761b4=0x0;_0x4761b4<_0x42df77[_0xbc3d('0x5e')];_0x4761b4++){if(_0xb8acd3!=''){_0xb8acd3+='&';}_0xb8acd3+=_0x42df77[_0x4761b4]+'='+encodeURIComponent(_0x1b6a9f[_0x42df77[_0x4761b4]]);_0x13a5a1+=_0x1b6a9f[_0x42df77[_0x4761b4]];}_0x13a5a1+=_0x1ce097[_0xbc3d('0x5f')];_0x13a5a1=_0x38f3a1[_0xbc3d('0x60')](_0xbc3d('0x61'))[_0xbc3d('0x19')](_0x13a5a1)[_0xbc3d('0x62')]('hex');if(_0xb8acd3!==''){_0xb8acd3+='&';}_0xb8acd3+=_0xbc3d('0x63')+_0x13a5a1;var _0x5f0484={'method':'GET','uri':_0x1ce097[_0xbc3d('0x55')]+'/external/get/send.php?'+_0xb8acd3,'json':!![]};return rp(_0x5f0484)[_0xbc3d('0x18')](function(_0x520fe0){var _0x1574d5=Object['keys'](_0x520fe0);if(_0x520fe0[_0x1574d5[0x0]][_0xbc3d('0x1c')]&&parseInt(_0x520fe0[_0x1574d5[0x0]][_0xbc3d('0x1c')])===0x0){var _0x4c6a01={'messageId':_0x520fe0[_0x1574d5[0x0]][_0xbc3d('0x64')]};if(!_0x1ce097[_0xbc3d('0x3f')]){_0x4c6a01[_0xbc3d('0x37')]=!![];}return _0x4be386[_0xbc3d('0x19')](_0x4c6a01);}else{return logger[_0xbc3d('0x1c')](_0xbc3d('0x29'),_0xbc3d('0x28'),_0xbc3d('0x59'),util[_0xbc3d('0x38')](_0x520fe0[_0xbc3d('0x1c')],{'showHidden':![],'depth':null}));}})[_0xbc3d('0x1b')](function(_0x4854df){return logger['error'](_0xbc3d('0x29'),_0xbc3d('0x28'),_0xbc3d('0x59'),util[_0xbc3d('0x38')](_0x4854df,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xbc3d('0x29'),'afterCreate',_0xbc3d('0x59'),_0xbc3d('0x65'));}break;case _0xbc3d('0x66'):if(_0x1ce097[_0xbc3d('0x5f')]){var _0x1398f1={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x1ce097[_0xbc3d('0x5f')]},'body':{'content':_0x43eea6[_0xbc3d('0xe')],'to':[_0x43eea6['phone']],'from':_0x1ce097[_0xbc3d('0x22')],'binary':![],'clientMessageId':_0xbc3d('0x67'),'charset':'UTF-8'},'json':!![]};rp(_0x1398f1)['then'](function(_0x1975fd){if(!_0x1975fd[_0xbc3d('0x1c')]){var _0x3c9153={'messageId':_0x1975fd['messages'][0x0][_0xbc3d('0x68')]};if(!_0x1ce097[_0xbc3d('0x3f')]){_0x3c9153['read']=!![];}return _0x4be386['update'](_0x3c9153);}else{return logger[_0xbc3d('0x1c')](_0xbc3d('0x29'),_0xbc3d('0x28'),_0xbc3d('0x66'),util[_0xbc3d('0x38')](_0x1975fd[_0xbc3d('0x1c')],{'showHidden':![],'depth':null}));}})[_0xbc3d('0x1b')](function(_0x1e7fb7){return logger[_0xbc3d('0x1c')](_0xbc3d('0x29'),_0xbc3d('0x28'),_0xbc3d('0x66'),util['inspect'](_0x1e7fb7,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xbc3d('0x66'),_0xbc3d('0x65'));}break;case _0xbc3d('0x69'):if(_0x1ce097[_0xbc3d('0x2c')]&&_0x1ce097['password']){var _0x2355b4=util[_0xbc3d('0x44')](_0xbc3d('0x42'),_0x1ce097['username'],_0x1ce097[_0xbc3d('0x2d')]);var _0x559ebf={'method':_0xbc3d('0x34'),'uri':_0xbc3d('0x6a')+_0x1ce097['accountId']+_0xbc3d('0x6b'),'body':{'to':[_0x43eea6[_0xbc3d('0x22')]],'text':_0x43eea6[_0xbc3d('0xe')],'from':_0x1ce097[_0xbc3d('0x22')],'applicationId':_0x1ce097[_0xbc3d('0x6c')]},'headers':{'Authorization':util[_0xbc3d('0x44')](_0xbc3d('0x45'),new Buffer(_0x2355b4)[_0xbc3d('0x46')](_0xbc3d('0x47')))},'json':!![]};rp(_0x559ebf)[_0xbc3d('0x18')](function(_0x7a7c09){if(_0x7a7c09['id']){var _0x2a0702={'messageId':_0x7a7c09['id']};return _0x4be386['update'](_0x2a0702);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xbc3d('0x69'),util[_0xbc3d('0x38')](_0x7a7c09,{'showHidden':![],'depth':null}));}})[_0xbc3d('0x1b')](function(_0x3c3c58){logger[_0xbc3d('0x1c')](_0xbc3d('0x29'),_0xbc3d('0x28'),'bandwidth',util[_0xbc3d('0x38')](_0x3c3c58,{'showHidden':![],'depth':null}));});}else{logger[_0xbc3d('0x1c')](_0xbc3d('0x29'),_0xbc3d('0x28'),_0xbc3d('0x69'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xbc3d('0x6d'):if(_0x1ce097[_0xbc3d('0x5f')]){var _0x3f3c35={};var _0x5f0484={'method':_0xbc3d('0x34'),'uri':_0xbc3d('0x6e'),'headers':{'Authorization':'Bearer\x20'+_0x1ce097[_0xbc3d('0x5f')],'Content-Type':'application/json'},'body':{'from':_0x1ce097[_0xbc3d('0x22')],'to':_0x43eea6[_0xbc3d('0x22')],'text':_0x43eea6[_0xbc3d('0xe')]},'json':!![]};return rp(_0x5f0484)[_0xbc3d('0x18')](function(_0x5c526c){if(_0x5c526c['code']==0xca){_0x3f3c35['message']=_0x5c526c;var _0x44cf3a={'method':_0xbc3d('0x34'),'uri':_0xbc3d('0x6f'),'headers':{'Authorization':_0xbc3d('0x70')+_0x1ce097[_0xbc3d('0x5f')],'Content-Type':_0xbc3d('0x57')},'body':{'refid':_0x3f3c35['message'][_0xbc3d('0x71')]},'json':!![]};return rp(_0x44cf3a)[_0xbc3d('0x18')](function(_0x59d106){_0x3f3c35[_0xbc3d('0x72')]=_0x59d106;var _0x41f995={'messageId':_0x3f3c35['message'][_0xbc3d('0x71')],'read':!![]};return _0x4be386[_0xbc3d('0x19')](_0x41f995);});}else{return logger[_0xbc3d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbc3d('0x28'),_0xbc3d('0x6d'),util[_0xbc3d('0x38')](_0x5c526c,{'showHidden':![],'depth':null}));}})[_0xbc3d('0x1b')](function(_0x3d2c51){return logger[_0xbc3d('0x1c')](_0xbc3d('0x29'),_0xbc3d('0x28'),_0xbc3d('0x6d'),util['inspect'](_0x3d2c51,{'showHidden':![],'depth':null}));});}else{return logger[_0xbc3d('0x1c')](_0xbc3d('0x29'),_0xbc3d('0x28'),_0xbc3d('0x6d'),_0xbc3d('0x73'));}break;}}})[_0xbc3d('0x74')](function(){_0xf8f78c();});}else{_0xf8f78c();}}},'charset':_0xbc3d('0x75'),'collate':_0xbc3d('0x76')});}; \ No newline at end of file +var _0xb1ac=['message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','toLowerCase','out','secret','isNil','SmsInteraction','findOne','SmsInteractionId','then','update','direction','catch','error','find','type','twilio','accountSid','phone','authToken','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','POST','user_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','login','timestamp','sort','length','md5','digest','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','apiKey','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','Bearer\x20','application/json','code'];(function(_0x1d2691,_0x259b30){var _0x203317=function(_0x4a9141){while(--_0x4a9141){_0x1d2691['push'](_0x1d2691['shift']());}};_0x203317(++_0x259b30);}(_0xb1ac,0x179));var _0xcb1a=function(_0x2bc14d,_0x1a94cd){_0x2bc14d=_0x2bc14d-0x0;var _0x54f2aa=_0xb1ac[_0x2bc14d];return _0x54f2aa;};'use strict';var _=require(_0xcb1a('0x0'));var util=require(_0xcb1a('0x1'));var logger=require(_0xcb1a('0x2'))(_0xcb1a('0x3'));var moment=require(_0xcb1a('0x4'));var BPromise=require(_0xcb1a('0x5'));var rp=require(_0xcb1a('0x6'));var fs=require('fs');var path=require(_0xcb1a('0x7'));var rimraf=require(_0xcb1a('0x8'));var config=require(_0xcb1a('0x9'));var attributes=require(_0xcb1a('0xa'));module[_0xcb1a('0xb')]=function(_0x4a58eb,_0x26629d){return _0x4a58eb['define'](_0xcb1a('0xc'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xcb1a('0xd'),'fields':[_0xcb1a('0xd')]},{'name':_0xcb1a('0xe'),'fields':[_0xcb1a('0xf')],'type':_0xcb1a('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x274afb,_0x376a02,_0xbd3d94){var _0x5ec6a7=_0x4a58eb['models'];var _0x2c55ac=_0x274afb['get']({'plain':!![]});if(_0x2c55ac['direction'][_0xcb1a('0x11')]()==='in'||_0x2c55ac['direction'][_0xcb1a('0x11')]()===_0xcb1a('0x12')&&!_0x2c55ac[_0xcb1a('0x13')]&&!_[_0xcb1a('0x14')](_0x2c55ac['UserId'])&&!_[_0xcb1a('0x14')](_0x2c55ac['SmsInteractionId'])){_0x5ec6a7[_0xcb1a('0x15')][_0xcb1a('0x16')]({'where':{'id':_0x2c55ac[_0xcb1a('0x17')]}})[_0xcb1a('0x18')](function(_0xa7890){if(_0xa7890){_0xa7890[_0xcb1a('0x19')]({'lastMsgAt':_0x2c55ac['createdAt'],'lastMsgDirection':_0x2c55ac[_0xcb1a('0x1a')]['toLowerCase']()});}})[_0xcb1a('0x1b')](function(_0x2267a2){console[_0xcb1a('0x1c')](_0x2267a2);});}if(_0x2c55ac[_0xcb1a('0x1a')]===_0xcb1a('0x12')&&!_0x2c55ac[_0xcb1a('0x13')]){var _0x53806f;_0x5ec6a7['SmsAccount'][_0xcb1a('0x1d')]({'where':{'id':_0x2c55ac['SmsAccountId']},'raw':!![]})[_0xcb1a('0x18')](function(_0x28d603){_0x53806f=_0x28d603;if(_0x53806f&&_0x53806f[_0xcb1a('0x1e')]){switch(_0x53806f[_0xcb1a('0x1e')]){case _0xcb1a('0x1f'):var _0x3ce080=require(_0xcb1a('0x1f'));if(_0x53806f[_0xcb1a('0x20')]&&_0x53806f['authToken']&&_0x53806f[_0xcb1a('0x21')]){var _0x561189=new _0x3ce080(_0x53806f[_0xcb1a('0x20')],_0x53806f[_0xcb1a('0x22')]);_0x561189[_0xcb1a('0x23')][_0xcb1a('0x24')]({'body':_0x2c55ac[_0xcb1a('0xf')],'to':_0x2c55ac[_0xcb1a('0x21')],'from':_0x53806f[_0xcb1a('0x21')],'statusCallback':_0x53806f[_0xcb1a('0x25')]+_0xcb1a('0x26')+_0x2c55ac['id']+_0xcb1a('0x27')+_0x53806f[_0xcb1a('0x28')]})[_0xcb1a('0x18')](function(_0x306f36){if(_0x306f36['sid']){return _0x274afb[_0xcb1a('0x19')]({'messageId':_0x306f36[_0xcb1a('0x29')]});}})[_0xcb1a('0x1b')](function(_0x3a9f9a){logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x1f'),util[_0xcb1a('0x2c')](_0x3a9f9a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x1f'),_0xcb1a('0x2d'));}break;case _0xcb1a('0x2e'):var _0x4776a8=_0xcb1a('0x2f');if(_0x53806f[_0xcb1a('0x30')]&&_0x53806f[_0xcb1a('0x31')]){var _0x35822c={'recipient':[_0x2c55ac[_0xcb1a('0x21')]],'message':_0x2c55ac['body'],'message_type':_0x53806f[_0xcb1a('0x32')]};if(_0x53806f[_0xcb1a('0x32')]&&_0x53806f['smsMethod']!=='SI'){_0x35822c[_0xcb1a('0x33')]=_0x53806f[_0xcb1a('0x21')];}var _0x4f39db={'url':_0x4776a8+_0xcb1a('0x34')+_0x53806f[_0xcb1a('0x30')]+_0xcb1a('0x35')+_0x53806f['password'],'method':_0xcb1a('0x36')};rp(_0x4f39db)[_0xcb1a('0x18')](function(_0x2d243d){var _0x4a9b3c=_0x2d243d['split'](';');var _0x301b2d={'user_key':_0x4a9b3c[0x0],'session_key':_0x4a9b3c[0x1]};_0x4f39db={'url':_0x4776a8+'sms','method':_0xcb1a('0x37'),'headers':{'user_key':_0x301b2d[_0xcb1a('0x38')],'Session_key':_0x301b2d['session_key']},'json':!![],'body':_0x35822c};return rp(_0x4f39db);})[_0xcb1a('0x18')](function(_0x567b78){if(_0x567b78[_0xcb1a('0x39')]>=0x1){var _0x422da9={'messageId':_0x567b78[_0xcb1a('0x3a')]};if(_0x53806f[_0xcb1a('0x32')]!=='GP'||!_0x53806f[_0xcb1a('0x3b')]){_0x422da9[_0xcb1a('0x3c')]=!![];}return _0x274afb['update'](_0x422da9);}else{return logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x2e'),util[_0xcb1a('0x2c')](_0x567b78,{'showHidden':![],'depth':null}));}})[_0xcb1a('0x1b')](function(_0x5a9e4f){return logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x2e'),util[_0xcb1a('0x2c')](_0x5a9e4f,{'showHidden':![],'depth':null}));});}else{logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),'afterCreate',_0xcb1a('0x2e'),_0xcb1a('0x3d'));}break;case _0xcb1a('0x3e'):if(_0x53806f[_0xcb1a('0x22')]){var _0x2d6ce3={'recipient':_0x2c55ac['phone'],'message':_0x2c55ac[_0xcb1a('0xf')],'sender':_0x53806f[_0xcb1a('0x3f')]||_0x53806f['phone'],'authorization':_0x53806f[_0xcb1a('0x22')]};var _0x376a02={'method':_0xcb1a('0x37'),'uri':_0xcb1a('0x40'),'body':_0x2d6ce3,'json':!![]};rp(_0x376a02)[_0xcb1a('0x18')](function(_0x5d690b){var _0x1ca4c8={'messageId':_0x5d690b[_0xcb1a('0x41')]};if(!_0x53806f[_0xcb1a('0x3b')]){_0x1ca4c8[_0xcb1a('0x3c')]=!![];}return _0x274afb[_0xcb1a('0x19')](_0x1ca4c8);})[_0xcb1a('0x1b')](function(_0x4e2239){logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x3e'),util[_0xcb1a('0x2c')](_0x4e2239,{'showHidden':![],'depth':null}));});}else{logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),'connectel',_0xcb1a('0x42'));}break;case _0xcb1a('0x43'):if(_0x53806f[_0xcb1a('0x30')]&&_0x53806f[_0xcb1a('0x31')]){var _0x2d6ce3={'messages':[{'source':_0xcb1a('0x44'),'to':_0x2c55ac[_0xcb1a('0x21')],'body':_0x2c55ac['body'],'from':_0x53806f['senderString']||_0x53806f[_0xcb1a('0x21')]}]};var _0x33a657=util[_0xcb1a('0x45')](_0xcb1a('0x46'),_0x53806f['username'],_0x53806f[_0xcb1a('0x31')]);var _0x376a02={'method':_0xcb1a('0x37'),'uri':_0xcb1a('0x47'),'body':_0x2d6ce3,'headers':{'Authorization':util[_0xcb1a('0x45')](_0xcb1a('0x48'),new Buffer(_0x33a657)[_0xcb1a('0x49')](_0xcb1a('0x4a')))},'json':!![]};rp(_0x376a02)['then'](function(_0x40979c){if(_0x40979c[_0xcb1a('0x4b')]>=0xc8&&_0x40979c[_0xcb1a('0x4b')]<=0xce){if(_0x40979c[_0xcb1a('0x4c')]&&_0x40979c['data'][_0xcb1a('0x4d')]>0x0){var _0x5b6c3d=_[_0xcb1a('0x4e')](_0x40979c[_0xcb1a('0x4c')][_0xcb1a('0x23')]);var _0x39ddef={'messageId':_0x5b6c3d[_0xcb1a('0x4f')]};if(!_0x53806f[_0xcb1a('0x3b')]){_0x39ddef[_0xcb1a('0x3c')]=!![];}return _0x274afb[_0xcb1a('0x19')](_0x39ddef);}else{logger['error'](_0xcb1a('0x2a'),_0xcb1a('0x2b'),'clickSend',util[_0xcb1a('0x2c')](_0x40979c,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util['inspect'](_0x40979c,{'showHidden':![],'depth':null}));}})[_0xcb1a('0x1b')](function(_0x90c343){logger['error'](_0xcb1a('0x2a'),'afterCreate',_0xcb1a('0x50'),util['inspect'](_0x90c343,{'showHidden':![],'depth':null}));});}else{logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x50'),_0xcb1a('0x3d'));}break;case _0xcb1a('0x51'):if(_0x53806f[_0xcb1a('0x52')]&&_0x53806f[_0xcb1a('0x22')]){var _0x2d6ce3={'dst':_0x2c55ac[_0xcb1a('0x21')],'text':_0x2c55ac[_0xcb1a('0xf')],'src':_0x53806f[_0xcb1a('0x3f')]||_0x53806f[_0xcb1a('0x21')],'url':_0x53806f[_0xcb1a('0x25')]+_0xcb1a('0x26')+_0x2c55ac['id']+_0xcb1a('0x27')+_0x53806f[_0xcb1a('0x28')]};var _0x33a657=util['format'](_0xcb1a('0x46'),_0x53806f[_0xcb1a('0x52')],_0x53806f['authToken']);var _0x376a02={'method':'POST','uri':util[_0xcb1a('0x45')](_0xcb1a('0x53'),_0x53806f['authId']),'body':_0x2d6ce3,'headers':{'Authorization':util[_0xcb1a('0x45')](_0xcb1a('0x48'),new Buffer(_0x33a657)[_0xcb1a('0x49')](_0xcb1a('0x4a')))},'json':!![]};rp(_0x376a02)['then'](function(_0x27f5c4){var _0x4bf6f9={'messageId':_0x27f5c4[_0xcb1a('0x54')][0x0]};return _0x274afb[_0xcb1a('0x19')](_0x4bf6f9);})[_0xcb1a('0x1b')](function(_0x3d8513){logger['error'](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x51'),util[_0xcb1a('0x2c')](_0x3d8513,{'showHidden':![],'depth':null}));});}else{logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x51'),_0xcb1a('0x55'));}break;case _0xcb1a('0x56'):if(_0x53806f[_0xcb1a('0x30')]&&_0x53806f[_0xcb1a('0x31')]){if(_0x53806f[_0xcb1a('0x57')]){var _0x3af2a0={'method':_0xcb1a('0x37'),'uri':_0x53806f['baseUrl']+'/auth/1/session','body':{'username':_0x53806f[_0xcb1a('0x30')],'password':_0x53806f[_0xcb1a('0x31')]},'json':!![]};return rp(_0x3af2a0)['then'](function(_0x1997f7){var _0x218e29={'method':'POST','uri':_0x53806f['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x53806f['phone'],'destinations':[{'to':_0x2c55ac[_0xcb1a('0x21')]}],'text':_0x2c55ac[_0xcb1a('0xf')],'notifyUrl':_0x53806f['remote']+_0xcb1a('0x26')+_0x2c55ac['id']+_0xcb1a('0x27')+_0x53806f['token'],'notifyContentType':'application/json','callbackData':_0x53806f[_0xcb1a('0x21')]+';'+_0x2c55ac[_0xcb1a('0xf')]}]},'headers':{'Authorization':_0xcb1a('0x58')+_0x1997f7[_0xcb1a('0x28')]},'json':!![]};return rp(_0x218e29)['then'](function(_0x128ea0){if(_0x128ea0[_0xcb1a('0x23')]){var _0x2b97b1={'messageId':_0x128ea0[_0xcb1a('0x23')][0x0][_0xcb1a('0xd')]};if(!_0x53806f['deliveryReport']){_0x2b97b1[_0xcb1a('0x3c')]=!![];}return _0x274afb[_0xcb1a('0x19')](_0x2b97b1);}else{return logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x56'),util[_0xcb1a('0x2c')](_0x128ea0,{'showHidden':![],'depth':null}));}});})[_0xcb1a('0x1b')](function(_0x4de71f){return logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x56'),util[_0xcb1a('0x2c')](_0x4de71f,{'showHidden':![],'depth':null}));});}else{logger[_0xcb1a('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcb1a('0x2b'),_0xcb1a('0x56'),_0xcb1a('0x59'));}}else{logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x56'),_0xcb1a('0x3d'));}break;case'csc':var _0x4881e5=require(_0xcb1a('0x5a'));if(_0x53806f['apiKey']){var _0x2c3b8b={};_0x2c3b8b[_0xcb1a('0x5b')]=_0x53806f[_0xcb1a('0x30')];_0x2c3b8b[_0xcb1a('0x21')]=_0x2c55ac[_0xcb1a('0x21')];_0x2c3b8b[_0xcb1a('0x33')]=_0x53806f[_0xcb1a('0x21')];_0x2c3b8b['text']=_0x2c55ac[_0xcb1a('0xf')];_0x2c3b8b[_0xcb1a('0x5c')]=+new Date();var _0x2dbc7d='';var _0x45a6e0='';var _0x2ed35d=Object['keys'](_0x2c3b8b);_0x2ed35d[_0xcb1a('0x5d')]();for(var _0x5e2aab=0x0;_0x5e2aab<_0x2ed35d[_0xcb1a('0x5e')];_0x5e2aab++){if(_0x2dbc7d!=''){_0x2dbc7d+='&';}_0x2dbc7d+=_0x2ed35d[_0x5e2aab]+'='+encodeURIComponent(_0x2c3b8b[_0x2ed35d[_0x5e2aab]]);_0x45a6e0+=_0x2c3b8b[_0x2ed35d[_0x5e2aab]];}_0x45a6e0+=_0x53806f['apiKey'];_0x45a6e0=_0x4881e5['createHash'](_0xcb1a('0x5f'))['update'](_0x45a6e0)[_0xcb1a('0x60')]('hex');if(_0x2dbc7d!==''){_0x2dbc7d+='&';}_0x2dbc7d+=_0xcb1a('0x61')+_0x45a6e0;var _0x4f39db={'method':_0xcb1a('0x36'),'uri':_0x53806f[_0xcb1a('0x57')]+_0xcb1a('0x62')+_0x2dbc7d,'json':!![]};return rp(_0x4f39db)[_0xcb1a('0x18')](function(_0x4e37bb){var _0x576f54=Object['keys'](_0x4e37bb);if(_0x4e37bb[_0x576f54[0x0]][_0xcb1a('0x1c')]&&parseInt(_0x4e37bb[_0x576f54[0x0]]['error'])===0x0){var _0x3a5821={'messageId':_0x4e37bb[_0x576f54[0x0]][_0xcb1a('0x63')]};if(!_0x53806f[_0xcb1a('0x3b')]){_0x3a5821[_0xcb1a('0x3c')]=!![];}return _0x274afb[_0xcb1a('0x19')](_0x3a5821);}else{return logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),'afterCreate','csc',util[_0xcb1a('0x2c')](_0x4e37bb['error'],{'showHidden':![],'depth':null}));}})[_0xcb1a('0x1b')](function(_0x47e49a){return logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x64'),util['inspect'](_0x47e49a,{'showHidden':![],'depth':null}));});}else{logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),'csc',_0xcb1a('0x65'));}break;case _0xcb1a('0x66'):if(_0x53806f[_0xcb1a('0x67')]){var _0x37232d={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x53806f[_0xcb1a('0x67')]},'body':{'content':_0x2c55ac['body'],'to':[_0x2c55ac[_0xcb1a('0x21')]],'from':_0x53806f[_0xcb1a('0x21')],'binary':![],'clientMessageId':_0xcb1a('0x68'),'charset':_0xcb1a('0x69')},'json':!![]};rp(_0x37232d)[_0xcb1a('0x18')](function(_0x1726fe){if(!_0x1726fe['error']){var _0x61a533={'messageId':_0x1726fe[_0xcb1a('0x23')][0x0][_0xcb1a('0x6a')]};if(!_0x53806f[_0xcb1a('0x3b')]){_0x61a533[_0xcb1a('0x3c')]=!![];}return _0x274afb['update'](_0x61a533);}else{return logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),'afterCreate',_0xcb1a('0x66'),util['inspect'](_0x1726fe[_0xcb1a('0x1c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x2ae0f4){return logger[_0xcb1a('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcb1a('0x2b'),_0xcb1a('0x66'),util[_0xcb1a('0x2c')](_0x2ae0f4,{'showHidden':![],'depth':null}));});}else{logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x66'),'Missing\x20parameters:\x20apiKey');}break;case _0xcb1a('0x6b'):if(_0x53806f[_0xcb1a('0x30')]&&_0x53806f[_0xcb1a('0x31')]){var _0x33a657=util[_0xcb1a('0x45')]('%s:%s',_0x53806f[_0xcb1a('0x30')],_0x53806f['password']);var _0x376a02={'method':_0xcb1a('0x37'),'uri':_0xcb1a('0x6c')+_0x53806f[_0xcb1a('0x6d')]+_0xcb1a('0x6e'),'body':{'to':[_0x2c55ac[_0xcb1a('0x21')]],'text':_0x2c55ac[_0xcb1a('0xf')],'from':_0x53806f[_0xcb1a('0x21')],'applicationId':_0x53806f['applicationId']},'headers':{'Authorization':util['format'](_0xcb1a('0x48'),new Buffer(_0x33a657)[_0xcb1a('0x49')](_0xcb1a('0x4a')))},'json':!![]};rp(_0x376a02)[_0xcb1a('0x18')](function(_0x1fd5d8){if(_0x1fd5d8['id']){var _0x53ece8={'messageId':_0x1fd5d8['id']};return _0x274afb[_0xcb1a('0x19')](_0x53ece8);}else{logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x6b'),util[_0xcb1a('0x2c')](_0x1fd5d8,{'showHidden':![],'depth':null}));}})[_0xcb1a('0x1b')](function(_0x210f1c){logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x6b'),util[_0xcb1a('0x2c')](_0x210f1c,{'showHidden':![],'depth':null}));});}else{logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0xcb1a('0x6f'):if(_0x53806f['apiKey']){var _0x39c09c={};var _0x4f39db={'method':_0xcb1a('0x37'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xcb1a('0x70')+_0x53806f[_0xcb1a('0x67')],'Content-Type':_0xcb1a('0x71')},'body':{'from':_0x53806f[_0xcb1a('0x21')],'to':_0x2c55ac[_0xcb1a('0x21')],'text':_0x2c55ac[_0xcb1a('0xf')]},'json':!![]};return rp(_0x4f39db)[_0xcb1a('0x18')](function(_0x1f2750){if(_0x1f2750[_0xcb1a('0x72')]==0xca){_0x39c09c[_0xcb1a('0x73')]=_0x1f2750;var _0x26b332={'method':_0xcb1a('0x37'),'uri':_0xcb1a('0x74'),'headers':{'Authorization':_0xcb1a('0x70')+_0x53806f[_0xcb1a('0x67')],'Content-Type':'application/json'},'body':{'refid':_0x39c09c[_0xcb1a('0x73')][_0xcb1a('0x75')]},'json':!![]};return rp(_0x26b332)['then'](function(_0x4779dd){_0x39c09c[_0xcb1a('0x76')]=_0x4779dd;var _0xef4583={'messageId':_0x39c09c['message'][_0xcb1a('0x75')],'read':!![]};return _0x274afb[_0xcb1a('0x19')](_0xef4583);});}else{return logger['error'](_0xcb1a('0x2a'),'afterCreate',_0xcb1a('0x6f'),util[_0xcb1a('0x2c')](_0x1f2750,{'showHidden':![],'depth':null}));}})[_0xcb1a('0x1b')](function(_0x15cb46){return logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x6f'),util[_0xcb1a('0x2c')](_0x15cb46,{'showHidden':![],'depth':null}));});}else{return logger[_0xcb1a('0x1c')](_0xcb1a('0x2a'),_0xcb1a('0x2b'),_0xcb1a('0x6f'),_0xcb1a('0x77'));}break;}}})[_0xcb1a('0x78')](function(){_0xbd3d94();});}else{_0xbd3d94();}}},'charset':_0xcb1a('0x79'),'collate':_0xcb1a('0x7a')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 4cb3204..bc254e5 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 _0x4a8c=['SmsMessage','create','body','options','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateSmsMessage'];(function(_0x38d8ab,_0x53f163){var _0x3f9e46=function(_0x8685e3){while(--_0x8685e3){_0x38d8ab['push'](_0x38d8ab['shift']());}};_0x3f9e46(++_0x53f163);}(_0x4a8c,0x95));var _0xc4a8=function(_0x386e75,_0xd9d542){_0x386e75=_0x386e75-0x0;var _0x1706fa=_0x4a8c[_0x386e75];return _0x1706fa;};'use strict';var _=require(_0xc4a8('0x0'));var util=require(_0xc4a8('0x1'));var moment=require(_0xc4a8('0x2'));var BPromise=require(_0xc4a8('0x3'));var rs=require(_0xc4a8('0x4'));var fs=require('fs');var Redis=require(_0xc4a8('0x5'));var db=require(_0xc4a8('0x6'))['db'];var utils=require(_0xc4a8('0x7'));var logger=require(_0xc4a8('0x8'))(_0xc4a8('0x9'));var config=require(_0xc4a8('0xa'));var jayson=require(_0xc4a8('0xb'));var client=jayson[_0xc4a8('0xc')][_0xc4a8('0xd')]({'port':0x232a});config[_0xc4a8('0xe')]=_[_0xc4a8('0xf')](config[_0xc4a8('0xe')],{'host':_0xc4a8('0x10'),'port':0x18eb});var socket=require(_0xc4a8('0x11'))(new Redis(config[_0xc4a8('0xe')]));require('./smsMessage.socket')[_0xc4a8('0x12')](socket);function respondWithRpcPromise(_0x2217a6,_0x2e4ea5,_0x4e9e31){return new BPromise(function(_0x4426c6,_0x377a32){return client['request'](_0x2217a6,_0x4e9e31)[_0xc4a8('0x13')](function(_0x3faafa){logger['info'](_0xc4a8('0x14'),_0x2e4ea5,_0xc4a8('0x15'));logger[_0xc4a8('0x16')](_0xc4a8('0x17'),_0x2e4ea5,'request\x20sent',JSON['stringify'](_0x3faafa));if(_0x3faafa['error']){if(_0x3faafa[_0xc4a8('0x18')][_0xc4a8('0x19')]===0x1f4){logger[_0xc4a8('0x18')](_0xc4a8('0x14'),_0x2e4ea5,_0x3faafa['error'][_0xc4a8('0x1a')]);return _0x377a32(_0x3faafa['error'][_0xc4a8('0x1a')]);}logger[_0xc4a8('0x18')](_0xc4a8('0x14'),_0x2e4ea5,_0x3faafa[_0xc4a8('0x18')][_0xc4a8('0x1a')]);return _0x4426c6(_0x3faafa[_0xc4a8('0x18')][_0xc4a8('0x1a')]);}else{logger[_0xc4a8('0x1b')](_0xc4a8('0x14'),_0x2e4ea5,'request\x20sent');_0x4426c6(_0x3faafa[_0xc4a8('0x1c')][_0xc4a8('0x1a')]);}})[_0xc4a8('0x1d')](function(_0x88e5bf){logger[_0xc4a8('0x18')]('SmsMessage,\x20%s,\x20%s',_0x2e4ea5,_0x88e5bf);_0x377a32(_0x88e5bf);});});}exports[_0xc4a8('0x1e')]=function(_0x5df1ff){var _0x7ebf1a=this;return new Promise(function(_0x25afdc,_0x5bca5a){return db[_0xc4a8('0x1f')][_0xc4a8('0x20')](_0x5df1ff[_0xc4a8('0x21')],{'raw':_0x5df1ff[_0xc4a8('0x22')]?_0x5df1ff[_0xc4a8('0x22')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x53f1b5){logger[_0xc4a8('0x1b')](_0xc4a8('0x1e'),_0x5df1ff);logger['debug'](_0xc4a8('0x1e'),_0x5df1ff,JSON[_0xc4a8('0x23')](_0x53f1b5));_0x25afdc(_0x53f1b5);})[_0xc4a8('0x1d')](function(_0x224f3b){logger[_0xc4a8('0x18')](_0xc4a8('0x1e'),_0x224f3b[_0xc4a8('0x1a')],_0x5df1ff);_0x5bca5a(_0x7ebf1a['error'](0x1f4,_0x224f3b[_0xc4a8('0x1a')]));});});}; \ No newline at end of file +var _0xf91d=['../../config/logger','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','create','options','CreateSmsMessage','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0xf91d,0x1a5));var _0xdf91=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf91d[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xdf91('0x0'));var util=require(_0xdf91('0x1'));var moment=require(_0xdf91('0x2'));var BPromise=require(_0xdf91('0x3'));var rs=require(_0xdf91('0x4'));var fs=require('fs');var Redis=require(_0xdf91('0x5'));var db=require(_0xdf91('0x6'))['db'];var utils=require(_0xdf91('0x7'));var logger=require(_0xdf91('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdf91('0x9'));var client=jayson[_0xdf91('0xa')]['http']({'port':0x232a});config['redis']=_[_0xdf91('0xb')](config[_0xdf91('0xc')],{'host':_0xdf91('0xd'),'port':0x18eb});var socket=require(_0xdf91('0xe'))(new Redis(config[_0xdf91('0xc')]));require(_0xdf91('0xf'))[_0xdf91('0x10')](socket);function respondWithRpcPromise(_0x1a85e6,_0x8b1e40,_0x5a8368){return new BPromise(function(_0x5ed3f8,_0x187ee5){return client[_0xdf91('0x11')](_0x1a85e6,_0x5a8368)[_0xdf91('0x12')](function(_0x23a304){logger[_0xdf91('0x13')](_0xdf91('0x14'),_0x8b1e40,_0xdf91('0x15'));logger[_0xdf91('0x16')](_0xdf91('0x17'),_0x8b1e40,_0xdf91('0x15'),JSON[_0xdf91('0x18')](_0x23a304));if(_0x23a304[_0xdf91('0x19')]){if(_0x23a304[_0xdf91('0x19')][_0xdf91('0x1a')]===0x1f4){logger[_0xdf91('0x19')](_0xdf91('0x14'),_0x8b1e40,_0x23a304[_0xdf91('0x19')][_0xdf91('0x1b')]);return _0x187ee5(_0x23a304[_0xdf91('0x19')][_0xdf91('0x1b')]);}logger['error'](_0xdf91('0x14'),_0x8b1e40,_0x23a304[_0xdf91('0x19')][_0xdf91('0x1b')]);return _0x5ed3f8(_0x23a304[_0xdf91('0x19')][_0xdf91('0x1b')]);}else{logger[_0xdf91('0x13')](_0xdf91('0x14'),_0x8b1e40,_0xdf91('0x15'));_0x5ed3f8(_0x23a304[_0xdf91('0x1c')][_0xdf91('0x1b')]);}})['catch'](function(_0x2f607c){logger[_0xdf91('0x19')]('SmsMessage,\x20%s,\x20%s',_0x8b1e40,_0x2f607c);_0x187ee5(_0x2f607c);});});}exports['CreateSmsMessage']=function(_0xa066b4){var _0x5d9f60=this;return new Promise(function(_0x34ebec,_0x272968){return db['SmsMessage'][_0xdf91('0x1d')](_0xa066b4['body'],{'raw':_0xa066b4[_0xdf91('0x1e')]?_0xa066b4[_0xdf91('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x552bff){logger[_0xdf91('0x13')]('CreateSmsMessage',_0xa066b4);logger['debug'](_0xdf91('0x1f'),_0xa066b4,JSON[_0xdf91('0x18')](_0x552bff));_0x34ebec(_0x552bff);})[_0xdf91('0x20')](function(_0x24086b){logger['error'](_0xdf91('0x1f'),_0x24086b[_0xdf91('0x1b')],_0xa066b4);_0x272968(_0x5d9f60[_0xdf91('0x19')](0x1f4,_0x24086b[_0xdf91('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 77db506..f8c175a 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 _0x384c=['save','update','emit','removeListener','register','length','smsMessage:'];(function(_0x4efc87,_0x17a7d1){var _0x191fc4=function(_0x19dda1){while(--_0x19dda1){_0x4efc87['push'](_0x4efc87['shift']());}};_0x191fc4(++_0x17a7d1);}(_0x384c,0xa1));var _0xc384=function(_0x578e36,_0x3beca6){_0x578e36=_0x578e36-0x0;var _0xc39fd5=_0x384c[_0x578e36];return _0xc39fd5;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xc384('0x0'),'remove',_0xc384('0x1')];function createListener(_0x50545b,_0x1c7cbf){return function(_0x282818){_0x1c7cbf[_0xc384('0x2')](_0x50545b,_0x282818);};}function removeListener(_0x458165,_0x571958){return function(){SmsMessageEvents[_0xc384('0x3')](_0x458165,_0x571958);};}exports[_0xc384('0x4')]=function(_0x9bd669){for(var _0x2d8686=0x0,_0x415ebb=events[_0xc384('0x5')];_0x2d8686<_0x415ebb;_0x2d8686++){var _0x21ecf7=events[_0x2d8686];var _0x1a094f=createListener(_0xc384('0x6')+_0x21ecf7,_0x9bd669);SmsMessageEvents['on'](_0x21ecf7,_0x1a094f);}}; \ No newline at end of file +var _0x0640=['removeListener','length','smsMessage:','./smsMessage.events','save','remove','emit'];(function(_0x44177e,_0x3f7380){var _0x579311=function(_0x4ccb51){while(--_0x4ccb51){_0x44177e['push'](_0x44177e['shift']());}};_0x579311(++_0x3f7380);}(_0x0640,0xdc));var _0x0064=function(_0x33ea07,_0x398d22){_0x33ea07=_0x33ea07-0x0;var _0x4a7928=_0x0640[_0x33ea07];return _0x4a7928;};'use strict';var SmsMessageEvents=require(_0x0064('0x0'));var events=[_0x0064('0x1'),_0x0064('0x2'),'update'];function createListener(_0x4341f9,_0x558347){return function(_0x517bbb){_0x558347[_0x0064('0x3')](_0x4341f9,_0x517bbb);};}function removeListener(_0x216688,_0xd79e4e){return function(){SmsMessageEvents[_0x0064('0x4')](_0x216688,_0xd79e4e);};}exports['register']=function(_0x5e9a86){for(var _0x380682=0x0,_0x577e74=events[_0x0064('0x5')];_0x380682<_0x577e74;_0x380682++){var _0x1d26ee=events[_0x380682];var _0x1441f5=createListener(_0x0064('0x6')+_0x1d26ee,_0x5e9a86);SmsMessageEvents['on'](_0x1d26ee,_0x1441f5);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 35d2d05..298fed7 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 _0x29ec=['addAgents','put','update','/:id','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams'];(function(_0x25a42a,_0x3d489b){var _0x1129b1=function(_0x4ae61b){while(--_0x4ae61b){_0x25a42a['push'](_0x25a42a['shift']());}};_0x1129b1(++_0x3d489b);}(_0x29ec,0x147));var _0xc29e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29ec[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc29e('0x0'));var util=require(_0xc29e('0x1'));var path=require(_0xc29e('0x2'));var timeout=require(_0xc29e('0x3'));var express=require(_0xc29e('0x4'));var router=express[_0xc29e('0x5')]();var fs_extra=require(_0xc29e('0x6'));var auth=require(_0xc29e('0x7'));var interaction=require(_0xc29e('0x8'));var config=require('../../config/environment');var controller=require(_0xc29e('0x9'));router[_0xc29e('0xa')]('/',auth[_0xc29e('0xb')](),controller[_0xc29e('0xc')]);router['get'](_0xc29e('0xd'),auth[_0xc29e('0xb')](),controller[_0xc29e('0xe')]);router['get']('/:id',auth[_0xc29e('0xb')](),controller[_0xc29e('0xf')]);router[_0xc29e('0xa')](_0xc29e('0x10'),auth[_0xc29e('0xb')](),controller[_0xc29e('0x11')]);router[_0xc29e('0xa')]('/:id/teams',auth['isAuthenticated'](),controller[_0xc29e('0x12')]);router[_0xc29e('0xa')](_0xc29e('0x13'),auth[_0xc29e('0xb')](),controller[_0xc29e('0x14')]);router[_0xc29e('0x15')]('/',auth['isAuthenticated'](),controller[_0xc29e('0x16')]);router['post'](_0xc29e('0x17'),auth[_0xc29e('0xb')](),controller[_0xc29e('0x18')]);router['post'](_0xc29e('0x13'),auth[_0xc29e('0xb')](),controller[_0xc29e('0x19')]);router[_0xc29e('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0xc29e('0x1b')]);router['delete'](_0xc29e('0x1c'),auth[_0xc29e('0xb')](),controller[_0xc29e('0x1d')]);router['delete'](_0xc29e('0x17'),auth[_0xc29e('0xb')](),controller['removeTeams']);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xc29e('0x1e')]);module[_0xc29e('0x1f')]=router; \ No newline at end of file +var _0x2981=['post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents'];(function(_0x448f8,_0x2aa1d7){var _0xa73126=function(_0x1fcafa){while(--_0x1fcafa){_0x448f8['push'](_0x448f8['shift']());}};_0xa73126(++_0x2aa1d7);}(_0x2981,0x149));var _0x1298=function(_0x56e994,_0xb1eb42){_0x56e994=_0x56e994-0x0;var _0x1c7996=_0x2981[_0x56e994];return _0x1c7996;};'use strict';var multer=require(_0x1298('0x0'));var util=require(_0x1298('0x1'));var path=require('path');var timeout=require(_0x1298('0x2'));var express=require(_0x1298('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1298('0x4'));var interaction=require(_0x1298('0x5'));var config=require(_0x1298('0x6'));var controller=require('./smsQueue.controller');router[_0x1298('0x7')]('/',auth[_0x1298('0x8')](),controller[_0x1298('0x9')]);router[_0x1298('0x7')](_0x1298('0xa'),auth[_0x1298('0x8')](),controller[_0x1298('0xb')]);router[_0x1298('0x7')](_0x1298('0xc'),auth[_0x1298('0x8')](),controller[_0x1298('0xd')]);router[_0x1298('0x7')](_0x1298('0xe'),auth[_0x1298('0x8')](),controller[_0x1298('0xf')]);router[_0x1298('0x7')](_0x1298('0x10'),auth['isAuthenticated'](),controller['getTeams']);router[_0x1298('0x7')](_0x1298('0x11'),auth['isAuthenticated'](),controller[_0x1298('0x12')]);router[_0x1298('0x13')]('/',auth[_0x1298('0x8')](),controller[_0x1298('0x14')]);router[_0x1298('0x13')](_0x1298('0x10'),auth[_0x1298('0x8')](),controller[_0x1298('0x15')]);router[_0x1298('0x13')](_0x1298('0x11'),auth[_0x1298('0x8')](),controller[_0x1298('0x16')]);router[_0x1298('0x17')](_0x1298('0xc'),auth[_0x1298('0x8')](),controller[_0x1298('0x18')]);router[_0x1298('0x19')]('/:id',auth[_0x1298('0x8')](),controller['destroy']);router[_0x1298('0x19')]('/:id/teams',auth[_0x1298('0x8')](),controller[_0x1298('0x1a')]);router[_0x1298('0x19')](_0x1298('0x11'),auth[_0x1298('0x8')](),controller[_0x1298('0x1b')]);module[_0x1298('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index c7157d4..d39ac7c 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 _0xd368=['name','INTEGER','ENUM','rrmemory','beepall','sequelize','STRING'];(function(_0x359b45,_0x40f922){var _0x4798a0=function(_0x279483){while(--_0x279483){_0x359b45['push'](_0x359b45['shift']());}};_0x4798a0(++_0x40f922);}(_0xd368,0x139));var _0x8d36=function(_0x4a6c77,_0xc10e03){_0x4a6c77=_0x4a6c77-0x0;var _0x1d3b19=_0xd368[_0x4a6c77];return _0x1d3b19;};'use strict';var Sequelize=require(_0x8d36('0x0'));module['exports']={'name':{'type':Sequelize[_0x8d36('0x1')],'unique':_0x8d36('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8d36('0x1')]},'timeout':{'type':Sequelize[_0x8d36('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8d36('0x4')](_0x8d36('0x5'),_0x8d36('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x4415=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x179c4a,_0x10eb06){var _0x5d1879=function(_0x1f1dcd){while(--_0x1f1dcd){_0x179c4a['push'](_0x179c4a['shift']());}};_0x5d1879(++_0x10eb06);}(_0x4415,0xf0));var _0x5441=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x4415[_0x556927];return _0x5f1235;};'use strict';var Sequelize=require(_0x5441('0x0'));module[_0x5441('0x1')]={'name':{'type':Sequelize[_0x5441('0x2')],'unique':_0x5441('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5441('0x2')]},'timeout':{'type':Sequelize[_0x5441('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5441('0x5')](_0x5441('0x6'),'beepall',_0x5441('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index b1ac1b8..f6b8bf5 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 _0x5f66=['show','params','model','keys','intersection','attributes','fields','includeAll','merge','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','rawAttributes','filters','hasOwnProperty','order','sort','pick','map','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','length','filter','nolimit','ids','Team','Agents','interface','flatMap','sequelize','transaction','addTeams','forEach','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','isArray','findOne','getAgents','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','./smsQueue.socket','register','end','json','offset','limit','undefined','count','status','update','then','UserProfileResource','destroy','sendStatus','stack','name','send','index','fieldName','key','getOptions','where','SmsQueue','include','query','findAll','catch'];(function(_0x4c9024,_0x32d1c4){var _0x378664=function(_0x56dfa9){while(--_0x56dfa9){_0x4c9024['push'](_0x4c9024['shift']());}};_0x378664(++_0x32d1c4);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var BPromise=require('bluebird');var util=require(_0x65f6('0x0'));var _=require('lodash');var squel=require(_0x65f6('0x1'));var Redis=require(_0x65f6('0x2'));var qs=require(_0x65f6('0x3'));var logger=require(_0x65f6('0x4'))(_0x65f6('0x5'));var config=require('../../config/environment');var db=require(_0x65f6('0x6'))['db'];config['redis']=_[_0x65f6('0x7')](config[_0x65f6('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65f6('0x8')]));require(_0x65f6('0x9'))[_0x65f6('0xa')](socket);function respondWithStatusCode(_0x8f6451,_0xc44c70){_0xc44c70=_0xc44c70||0xcc;return function(_0x14f4c7){if(_0x14f4c7){return _0x8f6451['sendStatus'](_0xc44c70);}return _0x8f6451['status'](_0xc44c70)[_0x65f6('0xb')]();};}function respondWithResult(_0x2f6d5b,_0x264647){_0x264647=_0x264647||0xc8;return function(_0x25c416){if(_0x25c416){return _0x2f6d5b['status'](_0x264647)[_0x65f6('0xc')](_0x25c416);}};}function respondWithFilteredResult(_0x571436,_0x497cf3){return function(_0x2d2dfa){if(_0x2d2dfa){var _0x576875=typeof _0x497cf3[_0x65f6('0xd')]==='undefined'&&typeof _0x497cf3[_0x65f6('0xe')]===_0x65f6('0xf');var _0x2c4ee5=_0x2d2dfa[_0x65f6('0x10')];var _0x369f96=_0x576875?0x0:_0x497cf3[_0x65f6('0xd')];var _0x44144b=_0x576875?_0x2d2dfa[_0x65f6('0x10')]:_0x497cf3[_0x65f6('0xd')]+_0x497cf3[_0x65f6('0xe')];var _0x59154e;if(_0x44144b>=_0x2c4ee5){_0x44144b=_0x2c4ee5;_0x59154e=0xc8;}else{_0x59154e=0xce;}_0x571436[_0x65f6('0x11')](_0x59154e);return _0x571436['set']('Content-Range',_0x369f96+'-'+_0x44144b+'/'+_0x2c4ee5)[_0x65f6('0xc')](_0x2d2dfa);}return null;};}function saveUpdates(_0x5c69f8){return function(_0x37330d){if(_0x37330d){return _0x37330d[_0x65f6('0x12')](_0x5c69f8)[_0x65f6('0x13')](function(_0x1f974c){return _0x1f974c;});}return null;};}function removeEntity(_0xc8660c){return function(_0x18380e){if(_0x18380e){return _0x18380e['destroy']()['then'](function(){var _0x2d538c=_0x18380e['get']({'plain':!![]});var _0x4c81f3='SmsQueues';return db[_0x65f6('0x14')][_0x65f6('0x15')]({'where':{'type':_0x4c81f3,'resourceId':_0x2d538c['id']}})['then'](function(){return _0x18380e;});})[_0x65f6('0x13')](function(){_0xc8660c[_0x65f6('0x11')](0xcc)[_0x65f6('0xb')]();});}};}function handleEntityNotFound(_0x3876ed){return function(_0x219ab2){if(!_0x219ab2){_0x3876ed[_0x65f6('0x16')](0x194);}return _0x219ab2;};}function handleError(_0x581374,_0x197a49){_0x197a49=_0x197a49||0x1f4;return function(_0x4bb39e){logger['error'](_0x4bb39e[_0x65f6('0x17')]);if(_0x4bb39e[_0x65f6('0x18')]){delete _0x4bb39e['name'];}_0x581374[_0x65f6('0x11')](_0x197a49)[_0x65f6('0x19')](_0x4bb39e);};}exports[_0x65f6('0x1a')]=function(_0x2774a1,_0x4f5a69){var _0x9d7bb0={};var _0x59ea32={'count':0x0,'rows':[]};var _0x20a161=_['map'](db['SmsQueue']['rawAttributes'],function(_0x29abdb){return{'name':_0x29abdb[_0x65f6('0x1b')],'type':_0x29abdb['type'][_0x65f6('0x1c')]};});_0x9d7bb0=qs[_0x65f6('0x1d')](_0x20a161,_0x2774a1);var _0x52277c={'where':_0x9d7bb0[_0x65f6('0x1e')]};return db[_0x65f6('0x1f')][_0x65f6('0x10')](_0x52277c)['then'](function(_0x4ac04b){_0x59ea32['count']=_0x4ac04b;_0x9d7bb0[_0x65f6('0x20')]=qs[_0x65f6('0x20')](_0x2774a1[_0x65f6('0x21')]);return db[_0x65f6('0x1f')][_0x65f6('0x22')](_0x9d7bb0);})[_0x65f6('0x13')](function(_0x144e55){_0x59ea32['rows']=_0x144e55;return _0x59ea32;})['then'](respondWithFilteredResult(_0x4f5a69,_0x9d7bb0))[_0x65f6('0x23')](handleError(_0x4f5a69,null));};exports[_0x65f6('0x24')]=function(_0x5878bc,_0x4e50c0){var _0x10b368={'raw':!![],'where':{'id':_0x5878bc[_0x65f6('0x25')]['id']}},_0x1ce43c={};_0x1ce43c[_0x65f6('0x26')]=_[_0x65f6('0x27')](db[_0x65f6('0x1f')]['rawAttributes']);_0x1ce43c[_0x65f6('0x21')]=_[_0x65f6('0x27')](_0x5878bc[_0x65f6('0x21')]);_0x1ce43c['filters']=_[_0x65f6('0x28')](_0x1ce43c[_0x65f6('0x26')],_0x1ce43c[_0x65f6('0x21')]);_0x10b368[_0x65f6('0x29')]=_[_0x65f6('0x28')](_0x1ce43c[_0x65f6('0x26')],qs['fields'](_0x5878bc[_0x65f6('0x21')][_0x65f6('0x2a')]));_0x10b368['attributes']=_0x10b368[_0x65f6('0x29')]['length']?_0x10b368[_0x65f6('0x29')]:_0x1ce43c['model'];if(_0x5878bc[_0x65f6('0x21')][_0x65f6('0x2b')]){_0x10b368['include']=[{'all':!![]}];}_0x10b368=_[_0x65f6('0x2c')]({},_0x10b368,_0x5878bc[_0x65f6('0x2d')]);return db[_0x65f6('0x1f')]['find'](_0x10b368)['then'](handleEntityNotFound(_0x4e50c0,null))[_0x65f6('0x13')](respondWithResult(_0x4e50c0,null))['catch'](handleError(_0x4e50c0,null));};exports[_0x65f6('0x2e')]=function(_0x4e6653,_0x22d760){return db[_0x65f6('0x1f')]['create'](_0x4e6653[_0x65f6('0x2f')],{})['then'](function(_0x5edd04){var _0x71b16b=_0x4e6653[_0x65f6('0x30')][_0x65f6('0x31')]({'plain':!![]});if(!_0x71b16b)throw new Error(_0x65f6('0x32'));if(_0x71b16b[_0x65f6('0x33')]===_0x65f6('0x30')){var _0x1a55da=_0x5edd04[_0x65f6('0x31')]({'plain':!![]});var _0x4f933b=_0x65f6('0x34');return db['UserProfileSection'][_0x65f6('0x35')]({'where':{'name':_0x4f933b,'userProfileId':_0x71b16b[_0x65f6('0x36')]},'raw':!![]})[_0x65f6('0x13')](function(_0x2ea7f7){if(_0x2ea7f7&&_0x2ea7f7['autoAssociation']===0x0){return db[_0x65f6('0x14')][_0x65f6('0x2e')]({'name':_0x1a55da[_0x65f6('0x18')],'resourceId':_0x1a55da['id'],'type':_0x2ea7f7[_0x65f6('0x18')],'sectionId':_0x2ea7f7['id']},{})[_0x65f6('0x13')](function(){return _0x5edd04;});}else{return _0x5edd04;}})[_0x65f6('0x23')](function(_0xed4c96){logger[_0x65f6('0x37')](_0x65f6('0x38'),_0xed4c96);throw _0xed4c96;});}return _0x5edd04;})['then'](respondWithResult(_0x22d760,0xc9))[_0x65f6('0x23')](handleError(_0x22d760,null));};exports[_0x65f6('0x12')]=function(_0x377ae5,_0x181798){if(_0x377ae5[_0x65f6('0x2f')]['id']){delete _0x377ae5[_0x65f6('0x2f')]['id'];}return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x377ae5[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x181798,null))[_0x65f6('0x13')](saveUpdates(_0x377ae5[_0x65f6('0x2f')],null))[_0x65f6('0x13')](respondWithResult(_0x181798,null))[_0x65f6('0x23')](handleError(_0x181798,null));};exports[_0x65f6('0x15')]=function(_0x2cb38d,_0x5119ee){return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x2cb38d[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x5119ee,null))['then'](removeEntity(_0x5119ee,null))[_0x65f6('0x23')](handleError(_0x5119ee,null));};exports[_0x65f6('0x39')]=function(_0x2b01eb,_0x5e69b4){return db[_0x65f6('0x1f')][_0x65f6('0x39')]()[_0x65f6('0x13')](respondWithResult(_0x5e69b4,null))[_0x65f6('0x23')](handleError(_0x5e69b4,null));};exports['getMembers']=function(_0x2ec114,_0x512527){var _0x3f1baa={'raw':!![],'where':{}},_0x6968b={},_0x577c93;return db[_0x65f6('0x1f')]['findOne']({'where':{'id':_0x2ec114[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x512527,null))[_0x65f6('0x13')](function(_0xc0db01){if(_0xc0db01){_0x577c93=_0xc0db01[_0x65f6('0x31')]({'plain':!![]});_0x6968b[_0x65f6('0x26')]=_['keys'](db['UserSmsQueue'][_0x65f6('0x3a')]);_0x6968b[_0x65f6('0x21')]=_[_0x65f6('0x27')](_0x2ec114[_0x65f6('0x21')]);_0x6968b[_0x65f6('0x3b')]=_[_0x65f6('0x28')](_0x6968b[_0x65f6('0x26')],_0x6968b[_0x65f6('0x21')]);_0x3f1baa[_0x65f6('0x29')]=_['intersection'](_0x6968b[_0x65f6('0x26')],qs[_0x65f6('0x2a')](_0x2ec114[_0x65f6('0x21')]['fields']));_0x3f1baa[_0x65f6('0x29')]=_0x3f1baa[_0x65f6('0x29')]['length']?_0x3f1baa[_0x65f6('0x29')]:_0x6968b[_0x65f6('0x26')];if(!_0x2ec114['query'][_0x65f6('0x3c')]('nolimit')){_0x3f1baa[_0x65f6('0xe')]=qs[_0x65f6('0xe')](_0x2ec114[_0x65f6('0x21')]['limit']);_0x3f1baa[_0x65f6('0xd')]=qs[_0x65f6('0xd')](_0x2ec114['query'][_0x65f6('0xd')]);}_0x3f1baa[_0x65f6('0x3d')]=qs['sort'](_0x2ec114[_0x65f6('0x21')][_0x65f6('0x3e')]);_0x3f1baa[_0x65f6('0x1e')]=qs[_0x65f6('0x3b')](_[_0x65f6('0x3f')](_0x2ec114[_0x65f6('0x21')],_0x6968b[_0x65f6('0x3b')]));_0x3f1baa[_0x65f6('0x1e')]['SmsQueueId']=_0xc0db01['id'];if(_0x2ec114['query']['filter']){_0x3f1baa[_0x65f6('0x1e')]=_[_0x65f6('0x2c')](_0x3f1baa[_0x65f6('0x1e')],{'$or':_[_0x65f6('0x40')](_0x3f1baa['attributes'],function(_0x183c08){var _0x2032b9={};_0x2032b9[_0x183c08]={'$like':'%'+_0x2ec114[_0x65f6('0x21')]['filter']+'%'};return _0x2032b9;})});}_0x3f1baa=_[_0x65f6('0x2c')]({},_0x3f1baa,_0x2ec114[_0x65f6('0x2d')]);return db[_0x65f6('0x41')]['findAll'](_0x3f1baa);}})['then'](function(_0x1d337d){if(_0x1d337d){return db[_0x65f6('0x42')][_0x65f6('0x43')]({'where':{'id':_[_0x65f6('0x40')](_0x1d337d,_0x65f6('0x44')),'role':_0x65f6('0x45')},'attributes':['id',_0x65f6('0x18'),_0x65f6('0x46'),_0x65f6('0x47'),_0x65f6('0x48')]});}})[_0x65f6('0x13')](function(_0x141fcc){if(_0x141fcc){return{'count':_0x141fcc[_0x65f6('0x10')],'rows':_[_0x65f6('0x40')](_0x141fcc['rows'],function(_0x47610a){return{'membername':_0x47610a[_0x65f6('0x18')],'UserId':_0x47610a['id'],'queue_name':_0x577c93[_0x65f6('0x18')],'SmsQueueId':_0x577c93['id'],'interface':util['format'](_0x65f6('0x49'),_0x65f6('0x4a'),_0x47610a[_0x65f6('0x18')]),'penalty':0x0,'paused':_0x47610a[_0x65f6('0x46')],'createdAt':_0x47610a['createdAt'],'updatedAt':_0x47610a[_0x65f6('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x65f6('0x13')](respondWithFilteredResult(_0x512527,_0x3f1baa))[_0x65f6('0x23')](handleError(_0x512527,null));};exports[_0x65f6('0x4b')]=function(_0x553ff0,_0x2923ff){var _0x2fc20f={};var _0x5c55e4={};var _0x28682b;var _0x26481e;return db[_0x65f6('0x1f')]['findOne']({'where':{'id':_0x553ff0[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x2923ff,null))[_0x65f6('0x13')](function(_0x3c23e3){if(_0x3c23e3){_0x28682b=_0x3c23e3;_0x5c55e4[_0x65f6('0x26')]=_[_0x65f6('0x27')](db['Team']['rawAttributes']);_0x5c55e4['query']=_[_0x65f6('0x27')](_0x553ff0[_0x65f6('0x21')]);_0x5c55e4[_0x65f6('0x3b')]=_[_0x65f6('0x28')](_0x5c55e4[_0x65f6('0x26')],_0x5c55e4[_0x65f6('0x21')]);_0x2fc20f['attributes']=_[_0x65f6('0x28')](_0x5c55e4[_0x65f6('0x26')],qs['fields'](_0x553ff0[_0x65f6('0x21')][_0x65f6('0x2a')]));_0x2fc20f[_0x65f6('0x29')]=_0x2fc20f['attributes'][_0x65f6('0x4c')]?_0x2fc20f[_0x65f6('0x29')]:_0x5c55e4['model'];_0x2fc20f[_0x65f6('0x3d')]=qs[_0x65f6('0x3e')](_0x553ff0[_0x65f6('0x21')][_0x65f6('0x3e')]);_0x2fc20f[_0x65f6('0x1e')]=qs[_0x65f6('0x3b')](_[_0x65f6('0x3f')](_0x553ff0['query'],_0x5c55e4['filters']));if(_0x553ff0[_0x65f6('0x21')][_0x65f6('0x4d')]){_0x2fc20f['where']=_[_0x65f6('0x2c')](_0x2fc20f['where'],{'$or':_[_0x65f6('0x40')](_0x2fc20f['attributes'],function(_0x440df1){var _0xdc8989={};_0xdc8989[_0x440df1]={'$like':'%'+_0x553ff0[_0x65f6('0x21')][_0x65f6('0x4d')]+'%'};return _0xdc8989;})});}_0x2fc20f=_[_0x65f6('0x2c')]({},_0x2fc20f,_0x553ff0[_0x65f6('0x2d')]);return _0x28682b[_0x65f6('0x4b')](_0x2fc20f);}})[_0x65f6('0x13')](function(_0x2405a7){if(_0x2405a7){_0x26481e=_0x2405a7['length'];if(!_0x553ff0['query'][_0x65f6('0x3c')](_0x65f6('0x4e'))){_0x2fc20f[_0x65f6('0xe')]=qs['limit'](_0x553ff0['query'][_0x65f6('0xe')]);_0x2fc20f[_0x65f6('0xd')]=qs[_0x65f6('0xd')](_0x553ff0[_0x65f6('0x21')][_0x65f6('0xd')]);}return _0x28682b[_0x65f6('0x4b')](_0x2fc20f);}})['then'](function(_0x4f42ae){if(_0x4f42ae){return _0x4f42ae?{'count':_0x26481e,'rows':_0x4f42ae}:null;}})[_0x65f6('0x13')](respondWithResult(_0x2923ff,null))[_0x65f6('0x23')](handleError(_0x2923ff,null));};exports['addTeams']=function(_0x219bf8,_0x4a8b60){var _0x254e9f=_0x219bf8[_0x65f6('0x2f')][_0x65f6('0x4f')];return db[_0x65f6('0x50')]['findAll']({'where':{'id':_0x254e9f},'attributes':['id'],'include':[{'model':db[_0x65f6('0x42')],'as':_0x65f6('0x51'),'attributes':['id',_0x65f6('0x18'),'online','voicePause',_0x65f6('0x52')],'raw':!![]}]})['then'](function(_0x305967){if(_0x305967){var _0xf6de=_[_0x65f6('0x53')](_0x305967,function(_0x354b90){var _0x512776=_0x354b90['get']({'plain':!![]});return _0x512776['Agents'];});return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x219bf8[_0x65f6('0x25')]['id']}})['then'](function(_0x46cbde){return db[_0x65f6('0x54')][_0x65f6('0x55')](function(_0x49cee2){return _0x46cbde[_0x65f6('0x56')](_0x254e9f,{'transaction':_0x49cee2})[_0x65f6('0x13')](function(){return BPromise['each'](_0xf6de,function(_0x758e80){return db[_0x65f6('0x41')]['findOrCreate']({'where':{'UserId':_0x758e80['id'],'SmsQueueId':_0x219bf8[_0x65f6('0x25')]['id']},'transaction':_0x49cee2});});})['then'](function(){_0xf6de[_0x65f6('0x57')](function(_0x55ea91){socket[_0x65f6('0x58')](_0x65f6('0x59'),{'UserId':_0x55ea91['id'],'SmsQueueId':_0x46cbde['id']});});});});});}})['then'](respondWithStatusCode(_0x4a8b60,null))[_0x65f6('0x23')](handleError(_0x4a8b60,null));};exports[_0x65f6('0x5a')]=function(_0x2a700b,_0x299b85){return db[_0x65f6('0x50')][_0x65f6('0x22')]({'where':{'id':_0x2a700b[_0x65f6('0x21')][_0x65f6('0x4f')]},'attributes':['id'],'include':[{'model':db[_0x65f6('0x42')],'as':_0x65f6('0x51'),'attributes':['id'],'raw':!![]}]})[_0x65f6('0x13')](handleEntityNotFound(_0x299b85,null))['then'](function(_0x10a661){var _0x1cf1bd=_[_0x65f6('0x40')](_0x10a661,'id');var _0x219e42=[];var _0x5694f9=[];var _0x453080=squel[_0x65f6('0x5b')]();_0x453080['field'](_0x65f6('0x5c'))['from'](_0x65f6('0x5d'),'tq')['join'](_0x65f6('0x5e'),'ut',_0x65f6('0x5f'))['where']('SmsQueueId\x20=\x20?',_0x2a700b[_0x65f6('0x25')]['id']);for(var _0x413c21=0x0;_0x413c21<_0x10a661['length'];_0x413c21+=0x1){let _0x2d86c8=_0x10a661[_0x413c21];for(var _0x3b3bd5=0x0;_0x3b3bd5<_0x2d86c8[_0x65f6('0x51')]['length'];_0x3b3bd5+=0x1){let _0x1348ec=_0x2d86c8[_0x65f6('0x51')][_0x3b3bd5];var _0x5889dc=_0x453080[_0x65f6('0x60')]();_0x5889dc['where'](_0x65f6('0x61'),_0x1348ec['id']);_0x5694f9['push'](db['sequelize'][_0x65f6('0x21')](_0x5889dc[_0x65f6('0x62')](),{'type':db[_0x65f6('0x54')][_0x65f6('0x63')][_0x65f6('0x64')]})[_0x65f6('0x13')](function(_0x1ac46f){if(_0x1ac46f[_0x65f6('0x4c')]===0x1){return _0x1348ec['id'];}else{var _0x4d66fe=_['every'](_[_0x65f6('0x40')](_0x1ac46f,'TeamId'),function(_0x1ee28a){return _[_0x65f6('0x65')](_0x1cf1bd,_0x1ee28a);});if(_0x4d66fe){return _0x1348ec['id'];}}}));}}return BPromise[_0x65f6('0x66')](_0x5694f9)[_0x65f6('0x13')](function(_0x43127b){_0x219e42=_(_0x219e42)['union'](_0x43127b)[_0x65f6('0x67')]()[_0x65f6('0x68')]();return db[_0x65f6('0x1f')]['find']({'where':{'id':_0x2a700b[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](function(_0x4254c2){return db[_0x65f6('0x54')][_0x65f6('0x55')](function(_0x16bf93){return _0x4254c2['removeTeams'](_0x2a700b['query'][_0x65f6('0x4f')],{'transaction':_0x16bf93})[_0x65f6('0x13')](function(){if(!_[_0x65f6('0x69')](_0x219e42)){return _0x4254c2[_0x65f6('0x6a')](_0x219e42,{'transaction':_0x16bf93});}})['then'](function(){_0x219e42['forEach'](function(_0x336076){socket[_0x65f6('0x58')](_0x65f6('0x6b'),{'UserId':_0x336076,'SmsQueueId':_0x4254c2['id']});});});});});});})[_0x65f6('0x13')](respondWithStatusCode(_0x299b85,null))[_0x65f6('0x23')](handleError(_0x299b85,null));};exports[_0x65f6('0x6c')]=function(_0x5daaf4,_0x4d607a){return db['SmsQueue'][_0x65f6('0x35')]({'where':{'id':_0x5daaf4[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x4d607a,null))[_0x65f6('0x13')](function(_0x53b11c){if(_0x53b11c){return _0x53b11c['addAgents'](_0x5daaf4[_0x65f6('0x2f')][_0x65f6('0x4f')],_['omit'](_0x5daaf4[_0x65f6('0x2f')],['ids','id'])||{})[_0x65f6('0x6d')](function(_0x4f3ef8){for(var _0x3a30ed=0x0;_0x3a30ed<_0x5daaf4[_0x65f6('0x2f')]['ids'][_0x65f6('0x4c')];_0x3a30ed+=0x1){socket[_0x65f6('0x58')](_0x65f6('0x59'),{'UserId':Number(_0x5daaf4[_0x65f6('0x2f')][_0x65f6('0x4f')][_0x3a30ed]),'SmsQueueId':Number(_0x5daaf4[_0x65f6('0x25')]['id'])});}return _0x4f3ef8;});}})['then'](respondWithResult(_0x4d607a,null))[_0x65f6('0x23')](handleError(_0x4d607a,null));};exports['removeAgents']=function(_0x24495c,_0x56336a){return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x24495c[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x56336a,null))['then'](function(_0x2b6f98){if(_0x2b6f98){return _0x2b6f98[_0x65f6('0x6a')](_0x24495c[_0x65f6('0x21')]['ids'])['then'](function(){if(_[_0x65f6('0x6e')](_0x24495c[_0x65f6('0x21')]['ids'])){for(var _0x180cde=0x0;_0x180cde<_0x24495c[_0x65f6('0x21')][_0x65f6('0x4f')]['length'];_0x180cde+=0x1){socket[_0x65f6('0x58')](_0x65f6('0x6b'),{'UserId':Number(_0x24495c['query'][_0x65f6('0x4f')][_0x180cde]),'SmsQueueId':Number(_0x24495c[_0x65f6('0x25')]['id'])});}}else{socket[_0x65f6('0x58')]('userSmsQueue:remove',{'UserId':Number(_0x24495c[_0x65f6('0x21')][_0x65f6('0x4f')]),'SmsQueueId':Number(_0x24495c[_0x65f6('0x25')]['id'])});}});}})['then'](respondWithStatusCode(_0x56336a,null))[_0x65f6('0x23')](handleError(_0x56336a,null));};exports['getAgents']=function(_0x1beaa7,_0x87a9e4){var _0x31ec61={};var _0x22be6e={};var _0x29b2de;var _0x430fb8;return db['SmsQueue'][_0x65f6('0x6f')]({'where':{'id':_0x1beaa7[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x87a9e4,null))[_0x65f6('0x13')](function(_0x207d15){if(_0x207d15){_0x29b2de=_0x207d15;_0x22be6e['model']=_['keys'](db['User'][_0x65f6('0x3a')]);_0x22be6e[_0x65f6('0x21')]=_[_0x65f6('0x27')](_0x1beaa7['query']);_0x22be6e[_0x65f6('0x3b')]=_['intersection'](_0x22be6e['model'],_0x22be6e[_0x65f6('0x21')]);_0x31ec61[_0x65f6('0x29')]=_['intersection'](_0x22be6e[_0x65f6('0x26')],qs[_0x65f6('0x2a')](_0x1beaa7[_0x65f6('0x21')][_0x65f6('0x2a')]));_0x31ec61[_0x65f6('0x29')]=_0x31ec61[_0x65f6('0x29')][_0x65f6('0x4c')]?_0x31ec61[_0x65f6('0x29')]:_0x22be6e[_0x65f6('0x26')];_0x31ec61[_0x65f6('0x3d')]=qs[_0x65f6('0x3e')](_0x1beaa7[_0x65f6('0x21')]['sort']);_0x31ec61[_0x65f6('0x1e')]=qs['filters'](_['pick'](_0x1beaa7[_0x65f6('0x21')],_0x22be6e[_0x65f6('0x3b')]));if(_0x1beaa7[_0x65f6('0x21')][_0x65f6('0x4d')]){_0x31ec61['where']=_[_0x65f6('0x2c')](_0x31ec61['where'],{'$or':_['map'](_0x31ec61[_0x65f6('0x29')],function(_0x99fe6e){var _0x1a7e52={};_0x1a7e52[_0x99fe6e]={'$like':'%'+_0x1beaa7[_0x65f6('0x21')][_0x65f6('0x4d')]+'%'};return _0x1a7e52;})});}_0x31ec61=_[_0x65f6('0x2c')]({},_0x31ec61,_0x1beaa7['options']);return _0x29b2de[_0x65f6('0x70')](_0x31ec61);}})['then'](function(_0x1ef2a0){if(_0x1ef2a0){_0x430fb8=_0x1ef2a0[_0x65f6('0x4c')];if(!_0x1beaa7[_0x65f6('0x21')]['hasOwnProperty'](_0x65f6('0x4e'))){_0x31ec61['limit']=qs['limit'](_0x1beaa7[_0x65f6('0x21')][_0x65f6('0xe')]);_0x31ec61[_0x65f6('0xd')]=qs[_0x65f6('0xd')](_0x1beaa7[_0x65f6('0x21')]['offset']);}return _0x29b2de[_0x65f6('0x70')](_0x31ec61);}})[_0x65f6('0x13')](function(_0x3bebe3){if(_0x3bebe3){return _0x3bebe3?{'count':_0x430fb8,'rows':_0x3bebe3}:null;}})[_0x65f6('0x13')](respondWithResult(_0x87a9e4,null))['catch'](handleError(_0x87a9e4,null));}; \ No newline at end of file +var _0xadb5=['%s/%s','pick','filter','getTeams','addTeams','ids','findAll','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','userSmsQueue:save','removeTeams','Team','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','find','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','util','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','index','SmsQueue','rawAttributes','type','key','getOptions','where','count','include','query','rows','catch','show','model','keys','filters','fields','attributes','length','includeAll','options','create','user','get','role','autoAssociation','body','params','describe','getMembers','findOne','intersection','hasOwnProperty','nolimit','order','sort','SmsQueueId','merge','UserSmsQueue','User','findAndCountAll','map','UserId','agent','smsPause','updatedAt','createdAt','format'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xadb5,0xad));var _0x5adb=function(_0x40a971,_0x1b850f){_0x40a971=_0x40a971-0x0;var _0x52d89f=_0xadb5[_0x40a971];return _0x52d89f;};'use strict';var BPromise=require('bluebird');var util=require(_0x5adb('0x0'));var _=require('lodash');var squel=require(_0x5adb('0x1'));var Redis=require(_0x5adb('0x2'));var qs=require(_0x5adb('0x3'));var logger=require('../../config/logger')(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var db=require(_0x5adb('0x6'))['db'];config['redis']=_[_0x5adb('0x7')](config[_0x5adb('0x8')],{'host':_0x5adb('0x9'),'port':0x18eb});var socket=require(_0x5adb('0xa'))(new Redis(config[_0x5adb('0x8')]));require(_0x5adb('0xb'))[_0x5adb('0xc')](socket);function respondWithStatusCode(_0x6d1b45,_0x41261c){_0x41261c=_0x41261c||0xcc;return function(_0x7293ab){if(_0x7293ab){return _0x6d1b45[_0x5adb('0xd')](_0x41261c);}return _0x6d1b45[_0x5adb('0xe')](_0x41261c)[_0x5adb('0xf')]();};}function respondWithResult(_0x275428,_0x563d86){_0x563d86=_0x563d86||0xc8;return function(_0x4c268d){if(_0x4c268d){return _0x275428[_0x5adb('0xe')](_0x563d86)[_0x5adb('0x10')](_0x4c268d);}};}function respondWithFilteredResult(_0x82e67e,_0x53b772){return function(_0x29f0d5){if(_0x29f0d5){var _0x56012f=typeof _0x53b772[_0x5adb('0x11')]==='undefined'&&typeof _0x53b772[_0x5adb('0x12')]===_0x5adb('0x13');var _0x44abe3=_0x29f0d5['count'];var _0x2a545b=_0x56012f?0x0:_0x53b772[_0x5adb('0x11')];var _0xf82f72=_0x56012f?_0x29f0d5['count']:_0x53b772[_0x5adb('0x11')]+_0x53b772['limit'];var _0x367d82;if(_0xf82f72>=_0x44abe3){_0xf82f72=_0x44abe3;_0x367d82=0xc8;}else{_0x367d82=0xce;}_0x82e67e[_0x5adb('0xe')](_0x367d82);return _0x82e67e[_0x5adb('0x14')](_0x5adb('0x15'),_0x2a545b+'-'+_0xf82f72+'/'+_0x44abe3)[_0x5adb('0x10')](_0x29f0d5);}return null;};}function saveUpdates(_0x39d24d){return function(_0xa29dc){if(_0xa29dc){return _0xa29dc[_0x5adb('0x16')](_0x39d24d)[_0x5adb('0x17')](function(_0x529b65){return _0x529b65;});}return null;};}function removeEntity(_0x3fff62){return function(_0x5de028){if(_0x5de028){return _0x5de028[_0x5adb('0x18')]()['then'](function(){var _0x3ef465=_0x5de028['get']({'plain':!![]});var _0x5e218c=_0x5adb('0x19');return db[_0x5adb('0x1a')][_0x5adb('0x18')]({'where':{'type':_0x5e218c,'resourceId':_0x3ef465['id']}})[_0x5adb('0x17')](function(){return _0x5de028;});})[_0x5adb('0x17')](function(){_0x3fff62['status'](0xcc)[_0x5adb('0xf')]();});}};}function handleEntityNotFound(_0x5c296e){return function(_0x4e9f16){if(!_0x4e9f16){_0x5c296e[_0x5adb('0xd')](0x194);}return _0x4e9f16;};}function handleError(_0x379b33,_0x1a38d3){_0x1a38d3=_0x1a38d3||0x1f4;return function(_0x1a8014){logger[_0x5adb('0x1b')](_0x1a8014[_0x5adb('0x1c')]);if(_0x1a8014[_0x5adb('0x1d')]){delete _0x1a8014['name'];}_0x379b33[_0x5adb('0xe')](_0x1a38d3)[_0x5adb('0x1e')](_0x1a8014);};}exports[_0x5adb('0x1f')]=function(_0x3839fb,_0xeb556c){var _0x49f203={};var _0x2fee18={'count':0x0,'rows':[]};var _0x2e1e63=_['map'](db[_0x5adb('0x20')][_0x5adb('0x21')],function(_0x1a0acd){return{'name':_0x1a0acd['fieldName'],'type':_0x1a0acd[_0x5adb('0x22')][_0x5adb('0x23')]};});_0x49f203=qs[_0x5adb('0x24')](_0x2e1e63,_0x3839fb);var _0x2c64a3={'where':_0x49f203[_0x5adb('0x25')]};return db[_0x5adb('0x20')]['count'](_0x2c64a3)['then'](function(_0x5d457e){_0x2fee18[_0x5adb('0x26')]=_0x5d457e;_0x49f203[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x3839fb[_0x5adb('0x28')]);return db[_0x5adb('0x20')]['findAll'](_0x49f203);})[_0x5adb('0x17')](function(_0x34b793){_0x2fee18[_0x5adb('0x29')]=_0x34b793;return _0x2fee18;})[_0x5adb('0x17')](respondWithFilteredResult(_0xeb556c,_0x49f203))[_0x5adb('0x2a')](handleError(_0xeb556c,null));};exports[_0x5adb('0x2b')]=function(_0x28190d,_0x28bf1f){var _0x138bf6={'raw':!![],'where':{'id':_0x28190d['params']['id']}},_0x260295={};_0x260295[_0x5adb('0x2c')]=_['keys'](db[_0x5adb('0x20')][_0x5adb('0x21')]);_0x260295['query']=_[_0x5adb('0x2d')](_0x28190d[_0x5adb('0x28')]);_0x260295[_0x5adb('0x2e')]=_['intersection'](_0x260295[_0x5adb('0x2c')],_0x260295[_0x5adb('0x28')]);_0x138bf6['attributes']=_['intersection'](_0x260295[_0x5adb('0x2c')],qs['fields'](_0x28190d[_0x5adb('0x28')][_0x5adb('0x2f')]));_0x138bf6[_0x5adb('0x30')]=_0x138bf6[_0x5adb('0x30')][_0x5adb('0x31')]?_0x138bf6['attributes']:_0x260295[_0x5adb('0x2c')];if(_0x28190d[_0x5adb('0x28')][_0x5adb('0x32')]){_0x138bf6['include']=[{'all':!![]}];}_0x138bf6=_['merge']({},_0x138bf6,_0x28190d[_0x5adb('0x33')]);return db[_0x5adb('0x20')]['find'](_0x138bf6)[_0x5adb('0x17')](handleEntityNotFound(_0x28bf1f,null))['then'](respondWithResult(_0x28bf1f,null))[_0x5adb('0x2a')](handleError(_0x28bf1f,null));};exports['create']=function(_0x11cb37,_0x4d052f){return db[_0x5adb('0x20')][_0x5adb('0x34')](_0x11cb37['body'],{})[_0x5adb('0x17')](function(_0x5a6a79){var _0xadbe37=_0x11cb37[_0x5adb('0x35')][_0x5adb('0x36')]({'plain':!![]});if(!_0xadbe37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xadbe37[_0x5adb('0x37')]===_0x5adb('0x35')){var _0xcdaf8e=_0x5a6a79[_0x5adb('0x36')]({'plain':!![]});var _0x22aa95='SmsQueues';return db['UserProfileSection']['find']({'where':{'name':_0x22aa95,'userProfileId':_0xadbe37['userProfileId']},'raw':!![]})[_0x5adb('0x17')](function(_0x2fbe14){if(_0x2fbe14&&_0x2fbe14[_0x5adb('0x38')]===0x0){return db[_0x5adb('0x1a')][_0x5adb('0x34')]({'name':_0xcdaf8e[_0x5adb('0x1d')],'resourceId':_0xcdaf8e['id'],'type':_0x2fbe14[_0x5adb('0x1d')],'sectionId':_0x2fbe14['id']},{})[_0x5adb('0x17')](function(){return _0x5a6a79;});}else{return _0x5a6a79;}})['catch'](function(_0x53f2c6){logger[_0x5adb('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53f2c6);throw _0x53f2c6;});}return _0x5a6a79;})[_0x5adb('0x17')](respondWithResult(_0x4d052f,0xc9))[_0x5adb('0x2a')](handleError(_0x4d052f,null));};exports[_0x5adb('0x16')]=function(_0x121714,_0xdfecfd){if(_0x121714['body']['id']){delete _0x121714[_0x5adb('0x39')]['id'];}return db[_0x5adb('0x20')]['find']({'where':{'id':_0x121714[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0xdfecfd,null))['then'](saveUpdates(_0x121714[_0x5adb('0x39')],null))[_0x5adb('0x17')](respondWithResult(_0xdfecfd,null))[_0x5adb('0x2a')](handleError(_0xdfecfd,null));};exports[_0x5adb('0x18')]=function(_0xea3307,_0x4362ec){return db[_0x5adb('0x20')]['find']({'where':{'id':_0xea3307['params']['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x4362ec,null))[_0x5adb('0x17')](removeEntity(_0x4362ec,null))[_0x5adb('0x2a')](handleError(_0x4362ec,null));};exports[_0x5adb('0x3b')]=function(_0x57b8af,_0x507e48){return db[_0x5adb('0x20')][_0x5adb('0x3b')]()[_0x5adb('0x17')](respondWithResult(_0x507e48,null))[_0x5adb('0x2a')](handleError(_0x507e48,null));};exports[_0x5adb('0x3c')]=function(_0x5358c0,_0x182cbc){var _0x437f52={'raw':!![],'where':{}},_0x5b574c={},_0x7786c4;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0x5358c0[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x182cbc,null))[_0x5adb('0x17')](function(_0x39840e){if(_0x39840e){_0x7786c4=_0x39840e[_0x5adb('0x36')]({'plain':!![]});_0x5b574c['model']=_[_0x5adb('0x2d')](db['UserSmsQueue']['rawAttributes']);_0x5b574c['query']=_[_0x5adb('0x2d')](_0x5358c0[_0x5adb('0x28')]);_0x5b574c[_0x5adb('0x2e')]=_['intersection'](_0x5b574c[_0x5adb('0x2c')],_0x5b574c['query']);_0x437f52[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x5b574c[_0x5adb('0x2c')],qs['fields'](_0x5358c0[_0x5adb('0x28')]['fields']));_0x437f52[_0x5adb('0x30')]=_0x437f52[_0x5adb('0x30')]['length']?_0x437f52[_0x5adb('0x30')]:_0x5b574c[_0x5adb('0x2c')];if(!_0x5358c0[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x437f52['limit']=qs[_0x5adb('0x12')](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x12')]);_0x437f52[_0x5adb('0x11')]=qs['offset'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x11')]);}_0x437f52[_0x5adb('0x41')]=qs['sort'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x42')]);_0x437f52[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_['pick'](_0x5358c0[_0x5adb('0x28')],_0x5b574c[_0x5adb('0x2e')]));_0x437f52[_0x5adb('0x25')][_0x5adb('0x43')]=_0x39840e['id'];if(_0x5358c0[_0x5adb('0x28')]['filter']){_0x437f52[_0x5adb('0x25')]=_['merge'](_0x437f52[_0x5adb('0x25')],{'$or':_['map'](_0x437f52[_0x5adb('0x30')],function(_0x35df22){var _0x1a9358={};_0x1a9358[_0x35df22]={'$like':'%'+_0x5358c0[_0x5adb('0x28')]['filter']+'%'};return _0x1a9358;})});}_0x437f52=_[_0x5adb('0x44')]({},_0x437f52,_0x5358c0[_0x5adb('0x33')]);return db[_0x5adb('0x45')]['findAll'](_0x437f52);}})['then'](function(_0x4ddfdf){if(_0x4ddfdf){return db[_0x5adb('0x46')][_0x5adb('0x47')]({'where':{'id':_[_0x5adb('0x48')](_0x4ddfdf,_0x5adb('0x49')),'role':_0x5adb('0x4a')},'attributes':['id',_0x5adb('0x1d'),_0x5adb('0x4b'),_0x5adb('0x4c'),_0x5adb('0x4d')]});}})[_0x5adb('0x17')](function(_0x452767){if(_0x452767){return{'count':_0x452767[_0x5adb('0x26')],'rows':_[_0x5adb('0x48')](_0x452767['rows'],function(_0x49f4c8){return{'membername':_0x49f4c8[_0x5adb('0x1d')],'UserId':_0x49f4c8['id'],'queue_name':_0x7786c4[_0x5adb('0x1d')],'SmsQueueId':_0x7786c4['id'],'interface':util[_0x5adb('0x4e')](_0x5adb('0x4f'),'SIP',_0x49f4c8[_0x5adb('0x1d')]),'penalty':0x0,'paused':_0x49f4c8[_0x5adb('0x4b')],'createdAt':_0x49f4c8['createdAt'],'updatedAt':_0x49f4c8[_0x5adb('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5adb('0x17')](respondWithFilteredResult(_0x182cbc,_0x437f52))[_0x5adb('0x2a')](handleError(_0x182cbc,null));};exports['getTeams']=function(_0x30d185,_0x409357){var _0x19df2f={};var _0x30c92c={};var _0x330290;var _0x428019;return db['SmsQueue'][_0x5adb('0x3d')]({'where':{'id':_0x30d185[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x409357,null))['then'](function(_0xcd71d2){if(_0xcd71d2){_0x330290=_0xcd71d2;_0x30c92c[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](db['Team'][_0x5adb('0x21')]);_0x30c92c['query']=_[_0x5adb('0x2d')](_0x30d185[_0x5adb('0x28')]);_0x30c92c[_0x5adb('0x2e')]=_['intersection'](_0x30c92c[_0x5adb('0x2c')],_0x30c92c[_0x5adb('0x28')]);_0x19df2f['attributes']=_[_0x5adb('0x3e')](_0x30c92c[_0x5adb('0x2c')],qs[_0x5adb('0x2f')](_0x30d185[_0x5adb('0x28')]['fields']));_0x19df2f[_0x5adb('0x30')]=_0x19df2f[_0x5adb('0x30')][_0x5adb('0x31')]?_0x19df2f[_0x5adb('0x30')]:_0x30c92c['model'];_0x19df2f['order']=qs[_0x5adb('0x42')](_0x30d185['query']['sort']);_0x19df2f['where']=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0x30d185['query'],_0x30c92c[_0x5adb('0x2e')]));if(_0x30d185[_0x5adb('0x28')][_0x5adb('0x51')]){_0x19df2f[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x19df2f[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x19df2f[_0x5adb('0x30')],function(_0x5240c1){var _0x4b9e80={};_0x4b9e80[_0x5240c1]={'$like':'%'+_0x30d185['query'][_0x5adb('0x51')]+'%'};return _0x4b9e80;})});}_0x19df2f=_[_0x5adb('0x44')]({},_0x19df2f,_0x30d185[_0x5adb('0x33')]);return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x2f6ef7){if(_0x2f6ef7){_0x428019=_0x2f6ef7[_0x5adb('0x31')];if(!_0x30d185[_0x5adb('0x28')]['hasOwnProperty']('nolimit')){_0x19df2f[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x12')]);_0x19df2f[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x484f3d){if(_0x484f3d){return _0x484f3d?{'count':_0x428019,'rows':_0x484f3d}:null;}})[_0x5adb('0x17')](respondWithResult(_0x409357,null))[_0x5adb('0x2a')](handleError(_0x409357,null));};exports[_0x5adb('0x53')]=function(_0x5d3aa4,_0x31f041){var _0xa1bd33=_0x5d3aa4['body'][_0x5adb('0x54')];return db['Team'][_0x5adb('0x55')]({'where':{'id':_0xa1bd33},'attributes':['id'],'include':[{'model':db[_0x5adb('0x46')],'as':'Agents','attributes':['id',_0x5adb('0x1d'),_0x5adb('0x56'),_0x5adb('0x57'),_0x5adb('0x58')],'raw':!![]}]})[_0x5adb('0x17')](function(_0x10f54a){if(_0x10f54a){var _0x3cee6c=_[_0x5adb('0x59')](_0x10f54a,function(_0x49a8a6){var _0x3786b4=_0x49a8a6[_0x5adb('0x36')]({'plain':!![]});return _0x3786b4[_0x5adb('0x5a')];});return db['SmsQueue']['find']({'where':{'id':_0x5d3aa4[_0x5adb('0x3a')]['id']}})['then'](function(_0x27d3d8){return db[_0x5adb('0x5b')][_0x5adb('0x5c')](function(_0x50600f){return _0x27d3d8[_0x5adb('0x53')](_0xa1bd33,{'transaction':_0x50600f})[_0x5adb('0x17')](function(){return BPromise[_0x5adb('0x5d')](_0x3cee6c,function(_0x3ecc56){return db[_0x5adb('0x45')]['findOrCreate']({'where':{'UserId':_0x3ecc56['id'],'SmsQueueId':_0x5d3aa4[_0x5adb('0x3a')]['id']},'transaction':_0x50600f});});})[_0x5adb('0x17')](function(){_0x3cee6c[_0x5adb('0x5e')](function(_0xe3d12d){socket['emit'](_0x5adb('0x5f'),{'UserId':_0xe3d12d['id'],'SmsQueueId':_0x27d3d8['id']});});});});});}})[_0x5adb('0x17')](respondWithStatusCode(_0x31f041,null))[_0x5adb('0x2a')](handleError(_0x31f041,null));};exports[_0x5adb('0x60')]=function(_0x15d4f1,_0x20faf6){return db[_0x5adb('0x61')]['findAll']({'where':{'id':_0x15d4f1[_0x5adb('0x28')][_0x5adb('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5adb('0x5a'),'attributes':['id'],'raw':!![]}]})[_0x5adb('0x17')](handleEntityNotFound(_0x20faf6,null))['then'](function(_0x462fa0){var _0x50f8ed=_[_0x5adb('0x48')](_0x462fa0,'id');var _0x268df2=[];var _0x4a2ebc=[];var _0x167432=squel['select']();_0x167432[_0x5adb('0x62')](_0x5adb('0x63'))[_0x5adb('0x64')](_0x5adb('0x65'),'tq')[_0x5adb('0x66')]('user_has_teams','ut',_0x5adb('0x67'))[_0x5adb('0x25')](_0x5adb('0x68'),_0x15d4f1[_0x5adb('0x3a')]['id']);for(var _0x47c631=0x0;_0x47c631<_0x462fa0['length'];_0x47c631+=0x1){let _0x3f3db9=_0x462fa0[_0x47c631];for(var _0x461a07=0x0;_0x461a07<_0x3f3db9[_0x5adb('0x5a')][_0x5adb('0x31')];_0x461a07+=0x1){let _0x277668=_0x3f3db9[_0x5adb('0x5a')][_0x461a07];var _0x31f5b2=_0x167432['clone']();_0x31f5b2[_0x5adb('0x25')](_0x5adb('0x69'),_0x277668['id']);_0x4a2ebc[_0x5adb('0x6a')](db[_0x5adb('0x5b')]['query'](_0x31f5b2[_0x5adb('0x6b')](),{'type':db[_0x5adb('0x5b')][_0x5adb('0x6c')][_0x5adb('0x6d')]})[_0x5adb('0x17')](function(_0x188cbd){if(_0x188cbd[_0x5adb('0x31')]===0x1){return _0x277668['id'];}else{var _0x2d1b65=_[_0x5adb('0x6e')](_['map'](_0x188cbd,_0x5adb('0x6f')),function(_0x456799){return _['includes'](_0x50f8ed,_0x456799);});if(_0x2d1b65){return _0x277668['id'];}}}));}}return BPromise[_0x5adb('0x70')](_0x4a2ebc)[_0x5adb('0x17')](function(_0x2b8915){_0x268df2=_(_0x268df2)[_0x5adb('0x71')](_0x2b8915)[_0x5adb('0x72')]()[_0x5adb('0x73')]();return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x15d4f1['params']['id']}})[_0x5adb('0x17')](function(_0x2386c0){return db['sequelize'][_0x5adb('0x5c')](function(_0x58a26f){return _0x2386c0[_0x5adb('0x60')](_0x15d4f1['query']['ids'],{'transaction':_0x58a26f})[_0x5adb('0x17')](function(){if(!_[_0x5adb('0x75')](_0x268df2)){return _0x2386c0[_0x5adb('0x76')](_0x268df2,{'transaction':_0x58a26f});}})['then'](function(){_0x268df2[_0x5adb('0x5e')](function(_0x321c3a){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':_0x321c3a,'SmsQueueId':_0x2386c0['id']});});});});});});})[_0x5adb('0x17')](respondWithStatusCode(_0x20faf6,null))[_0x5adb('0x2a')](handleError(_0x20faf6,null));};exports[_0x5adb('0x79')]=function(_0x463e84,_0x28bd33){return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x463e84[_0x5adb('0x3a')]['id']}})['then'](handleEntityNotFound(_0x28bd33,null))['then'](function(_0x312463){if(_0x312463){return _0x312463[_0x5adb('0x79')](_0x463e84['body'][_0x5adb('0x54')],_[_0x5adb('0x7a')](_0x463e84[_0x5adb('0x39')],[_0x5adb('0x54'),'id'])||{})[_0x5adb('0x7b')](function(_0x24cd3b){for(var _0x15626b=0x0;_0x15626b<_0x463e84[_0x5adb('0x39')][_0x5adb('0x54')]['length'];_0x15626b+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x5f'),{'UserId':Number(_0x463e84[_0x5adb('0x39')]['ids'][_0x15626b]),'SmsQueueId':Number(_0x463e84[_0x5adb('0x3a')]['id'])});}return _0x24cd3b;});}})[_0x5adb('0x17')](respondWithResult(_0x28bd33,null))[_0x5adb('0x2a')](handleError(_0x28bd33,null));};exports[_0x5adb('0x76')]=function(_0x64475f,_0x2a78f9){return db['SmsQueue'][_0x5adb('0x74')]({'where':{'id':_0x64475f[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x2a78f9,null))[_0x5adb('0x17')](function(_0x2c3af8){if(_0x2c3af8){return _0x2c3af8[_0x5adb('0x76')](_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')])[_0x5adb('0x17')](function(){if(_[_0x5adb('0x7c')](_0x64475f['query'][_0x5adb('0x54')])){for(var _0x5b9565=0x0;_0x5b9565<_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')][_0x5adb('0x31')];_0x5b9565+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f['query']['ids'][_0x5b9565]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}}else{socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a78f9,null))['catch'](handleError(_0x2a78f9,null));};exports[_0x5adb('0x7d')]=function(_0xd5b95d,_0x9d80fd){var _0x4f5721={};var _0x542626={};var _0x227c17;var _0x5982a5;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0xd5b95d['params']['id']}})['then'](handleEntityNotFound(_0x9d80fd,null))[_0x5adb('0x17')](function(_0x4bb198){if(_0x4bb198){_0x227c17=_0x4bb198;_0x542626['model']=_[_0x5adb('0x2d')](db[_0x5adb('0x46')][_0x5adb('0x21')]);_0x542626[_0x5adb('0x28')]=_[_0x5adb('0x2d')](_0xd5b95d[_0x5adb('0x28')]);_0x542626[_0x5adb('0x2e')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],_0x542626[_0x5adb('0x28')]);_0x4f5721[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],qs['fields'](_0xd5b95d[_0x5adb('0x28')]['fields']));_0x4f5721[_0x5adb('0x30')]=_0x4f5721[_0x5adb('0x30')][_0x5adb('0x31')]?_0x4f5721[_0x5adb('0x30')]:_0x542626[_0x5adb('0x2c')];_0x4f5721[_0x5adb('0x41')]=qs[_0x5adb('0x42')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x42')]);_0x4f5721[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0xd5b95d['query'],_0x542626[_0x5adb('0x2e')]));if(_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]){_0x4f5721[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x4f5721[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x4f5721[_0x5adb('0x30')],function(_0x57c160){var _0xe7ddc4={};_0xe7ddc4[_0x57c160]={'$like':'%'+_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]+'%'};return _0xe7ddc4;})});}_0x4f5721=_['merge']({},_0x4f5721,_0xd5b95d[_0x5adb('0x33')]);return _0x227c17['getAgents'](_0x4f5721);}})[_0x5adb('0x17')](function(_0x50c3a3){if(_0x50c3a3){_0x5982a5=_0x50c3a3['length'];if(!_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x4f5721[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x12')]);_0x4f5721[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x227c17[_0x5adb('0x7d')](_0x4f5721);}})['then'](function(_0x364da7){if(_0x364da7){return _0x364da7?{'count':_0x5982a5,'rows':_0x364da7}:null;}})['then'](respondWithResult(_0x9d80fd,null))[_0x5adb('0x2a')](handleError(_0x9d80fd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 417e38e..bd28ad2 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 _0x3e5d=['../../mysqldb','SmsQueue','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x20e7d5,_0x45aec6){var _0xfa0c1c=function(_0x207383){while(--_0x207383){_0x20e7d5['push'](_0x20e7d5['shift']());}};_0xfa0c1c(++_0x45aec6);}(_0x3e5d,0x140));var _0xd3e5=function(_0x1df6c4,_0x33b9e7){_0x1df6c4=_0x1df6c4-0x0;var _0x7469ef=_0x3e5d[_0x1df6c4];return _0x7469ef;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xd3e5('0x0'))['db'][_0xd3e5('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd3e5('0x2'),'afterUpdate':'update','afterDestroy':_0xd3e5('0x3')};function emitEvent(_0x54df20){return function(_0x36159e,_0x4b5b9f,_0x26d2b0){SmsQueueEvents[_0xd3e5('0x4')](_0x54df20+':'+_0x36159e['id'],_0x36159e);SmsQueueEvents[_0xd3e5('0x4')](_0x54df20,_0x36159e);_0x26d2b0(null);};}for(var e in events){if(events[_0xd3e5('0x5')](e)){var event=events[e];SmsQueue[_0xd3e5('0x6')](e,emitEvent(event));}}module[_0xd3e5('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x211e=['hasOwnProperty','hook','events','../../mysqldb','SmsQueue','save','update','remove','emit'];(function(_0x2af1e7,_0xc1377a){var _0x376a37=function(_0x2676b1){while(--_0x2676b1){_0x2af1e7['push'](_0x2af1e7['shift']());}};_0x376a37(++_0xc1377a);}(_0x211e,0xbf));var _0xe211=function(_0x50d8b0,_0xba165d){_0x50d8b0=_0x50d8b0-0x0;var _0x2d5045=_0x211e[_0x50d8b0];return _0x2d5045;};'use strict';var EventEmitter=require(_0xe211('0x0'));var SmsQueue=require(_0xe211('0x1'))['db'][_0xe211('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe211('0x3'),'afterUpdate':_0xe211('0x4'),'afterDestroy':_0xe211('0x5')};function emitEvent(_0x194868){return function(_0x2fc390,_0x50ad24,_0x34ce16){SmsQueueEvents[_0xe211('0x6')](_0x194868+':'+_0x2fc390['id'],_0x2fc390);SmsQueueEvents[_0xe211('0x6')](_0x194868,_0x2fc390);_0x34ce16(null);};}for(var e in events){if(events[_0xe211('0x7')](e)){var event=events[e];SmsQueue[_0xe211('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 98b1347..f8269ba 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 _0x90b4=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash'];(function(_0x138e3a,_0x3ffe82){var _0x791c0f=function(_0x5111e2){while(--_0x5111e2){_0x138e3a['push'](_0x138e3a['shift']());}};_0x791c0f(++_0x3ffe82);}(_0x90b4,0x117));var _0x490b=function(_0x20ca5c,_0x456626){_0x20ca5c=_0x20ca5c-0x0;var _0x1590ff=_0x90b4[_0x20ca5c];return _0x1590ff;};'use strict';var _=require(_0x490b('0x0'));var util=require(_0x490b('0x1'));var logger=require(_0x490b('0x2'))(_0x490b('0x3'));var moment=require(_0x490b('0x4'));var BPromise=require(_0x490b('0x5'));var rp=require(_0x490b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x490b('0x7'));var config=require(_0x490b('0x8'));var attributes=require(_0x490b('0x9'));module[_0x490b('0xa')]=function(_0x9097a4,_0x4b4b5b){return _0x9097a4[_0x490b('0xb')](_0x490b('0xc'),attributes,{'tableName':_0x490b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33af=['request-promise','path','rimraf','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','util','api','moment','bluebird'];(function(_0x118653,_0x50ef26){var _0xc11fa6=function(_0x2ec581){while(--_0x2ec581){_0x118653['push'](_0x118653['shift']());}};_0xc11fa6(++_0x50ef26);}(_0x33af,0xec));var _0xf33a=function(_0x5a905e,_0x31aa4a){_0x5a905e=_0x5a905e-0x0;var _0x4124d6=_0x33af[_0x5a905e];return _0x4124d6;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var logger=require('../../config/logger')(_0xf33a('0x1'));var moment=require(_0xf33a('0x2'));var BPromise=require(_0xf33a('0x3'));var rp=require(_0xf33a('0x4'));var fs=require('fs');var path=require(_0xf33a('0x5'));var rimraf=require(_0xf33a('0x6'));var config=require('../../config/environment');var attributes=require(_0xf33a('0x7'));module[_0xf33a('0x8')]=function(_0x583e54,_0xc0dd13){return _0x583e54[_0xf33a('0x9')](_0xf33a('0xa'),attributes,{'tableName':_0xf33a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 2bf6647..d365eee 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 _0xb9f6=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','map','include','model','ShowSmsQueue','util','randomstring'];(function(_0x2f92ae,_0xce177e){var _0x3990db=function(_0x4f75a3){while(--_0x4f75a3){_0x2f92ae['push'](_0x2f92ae['shift']());}};_0x3990db(++_0xce177e);}(_0xb9f6,0xb7));var _0x6b9f=function(_0x519cb2,_0x3f0214){_0x519cb2=_0x519cb2-0x0;var _0x40e6f9=_0xb9f6[_0x519cb2];return _0x40e6f9;};'use strict';var _=require('lodash');var util=require(_0x6b9f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b9f('0x1'));var fs=require('fs');var Redis=require(_0x6b9f('0x2'));var db=require(_0x6b9f('0x3'))['db'];var utils=require(_0x6b9f('0x4'));var logger=require(_0x6b9f('0x5'))(_0x6b9f('0x6'));var config=require(_0x6b9f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6b9f('0x8')]['http']({'port':0x232a});config['redis']=_[_0x6b9f('0x9')](config[_0x6b9f('0xa')],{'host':_0x6b9f('0xb'),'port':0x18eb});var socket=require(_0x6b9f('0xc'))(new Redis(config[_0x6b9f('0xa')]));require(_0x6b9f('0xd'))[_0x6b9f('0xe')](socket);function respondWithRpcPromise(_0x3313ca,_0xee811f,_0x569bfb){return new BPromise(function(_0x293cb9,_0x12369c){return client[_0x6b9f('0xf')](_0x3313ca,_0x569bfb)[_0x6b9f('0x10')](function(_0x42dbb8){logger[_0x6b9f('0x11')](_0x6b9f('0x12'),_0xee811f,'request\x20sent');logger[_0x6b9f('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0xee811f,_0x6b9f('0x14'),JSON[_0x6b9f('0x15')](_0x42dbb8));if(_0x42dbb8[_0x6b9f('0x16')]){if(_0x42dbb8['error']['code']===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0xee811f,_0x42dbb8[_0x6b9f('0x16')]['message']);return _0x12369c(_0x42dbb8[_0x6b9f('0x16')]['message']);}logger[_0x6b9f('0x16')](_0x6b9f('0x12'),_0xee811f,_0x42dbb8[_0x6b9f('0x16')][_0x6b9f('0x17')]);return _0x293cb9(_0x42dbb8[_0x6b9f('0x16')][_0x6b9f('0x17')]);}else{logger[_0x6b9f('0x11')]('SmsQueue,\x20%s,\x20%s',_0xee811f,_0x6b9f('0x14'));_0x293cb9(_0x42dbb8[_0x6b9f('0x18')][_0x6b9f('0x17')]);}})[_0x6b9f('0x19')](function(_0x49ea6d){logger[_0x6b9f('0x16')]('SmsQueue,\x20%s,\x20%s',_0xee811f,_0x49ea6d);_0x12369c(_0x49ea6d);});});}exports[_0x6b9f('0x1a')]=function(_0x2a35b8){var _0x3882fd=this;return new Promise(function(_0x5c4e38,_0x17e965){return db[_0x6b9f('0x1b')][_0x6b9f('0x1c')]({'raw':_0x2a35b8[_0x6b9f('0x1d')]?_0x2a35b8[_0x6b9f('0x1d')][_0x6b9f('0x1e')]===undefined?!![]:![]:!![],'where':_0x2a35b8[_0x6b9f('0x1d')]?_0x2a35b8[_0x6b9f('0x1d')][_0x6b9f('0x1f')]||null:null,'attributes':_0x2a35b8[_0x6b9f('0x1d')]?_0x2a35b8[_0x6b9f('0x1d')][_0x6b9f('0x20')]||null:null,'limit':_0x2a35b8[_0x6b9f('0x1d')]?_0x2a35b8['options']['limit']||null:null,'include':_0x2a35b8[_0x6b9f('0x1d')]?_0x2a35b8['options']['include']?_[_0x6b9f('0x21')](_0x2a35b8['options']['include'],function(_0x3a32f8){return{'model':db[_0x3a32f8['model']],'as':_0x3a32f8['as'],'attributes':_0x3a32f8[_0x6b9f('0x20')],'include':_0x3a32f8[_0x6b9f('0x22')]?_['map'](_0x3a32f8[_0x6b9f('0x22')],function(_0x183725){return{'model':db[_0x183725[_0x6b9f('0x23')]],'as':_0x183725['as'],'attributes':_0x183725[_0x6b9f('0x20')],'include':_0x183725[_0x6b9f('0x22')]?_['map'](_0x183725['include'],function(_0x1852b7){return{'model':db[_0x1852b7[_0x6b9f('0x23')]],'as':_0x1852b7['as'],'attributes':_0x1852b7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x57f58e){logger[_0x6b9f('0x11')]('GetSmsQueue',_0x2a35b8);logger['debug'](_0x6b9f('0x1a'),_0x2a35b8,JSON['stringify'](_0x57f58e));_0x5c4e38(_0x57f58e);})[_0x6b9f('0x19')](function(_0x2e5cbf){logger[_0x6b9f('0x16')](_0x6b9f('0x1a'),_0x2e5cbf[_0x6b9f('0x17')],_0x2a35b8);_0x17e965(_0x3882fd['error'](0x1f4,_0x2e5cbf[_0x6b9f('0x17')]));});});};exports[_0x6b9f('0x24')]=function(_0xf32e41){var _0x44949e=this;return new Promise(function(_0x28d360,_0x4352eb){return db['SmsQueue']['find']({'raw':_0xf32e41[_0x6b9f('0x1d')]?_0xf32e41[_0x6b9f('0x1d')][_0x6b9f('0x1e')]===undefined?!![]:![]:!![],'where':_0xf32e41[_0x6b9f('0x1d')]?_0xf32e41[_0x6b9f('0x1d')][_0x6b9f('0x1f')]||null:null,'attributes':_0xf32e41[_0x6b9f('0x1d')]?_0xf32e41[_0x6b9f('0x1d')][_0x6b9f('0x20')]||null:null,'include':_0xf32e41[_0x6b9f('0x1d')]?_0xf32e41[_0x6b9f('0x1d')][_0x6b9f('0x22')]?_[_0x6b9f('0x21')](_0xf32e41[_0x6b9f('0x1d')]['include'],function(_0x534646){return{'model':db[_0x534646[_0x6b9f('0x23')]],'as':_0x534646['as'],'attributes':_0x534646[_0x6b9f('0x20')],'include':_0x534646[_0x6b9f('0x22')]?_[_0x6b9f('0x21')](_0x534646['include'],function(_0x597ca4){return{'model':db[_0x597ca4['model']],'as':_0x597ca4['as'],'attributes':_0x597ca4['attributes'],'include':_0x597ca4[_0x6b9f('0x22')]?_['map'](_0x597ca4[_0x6b9f('0x22')],function(_0x4be5a3){return{'model':db[_0x4be5a3[_0x6b9f('0x23')]],'as':_0x4be5a3['as'],'attributes':_0x4be5a3[_0x6b9f('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13b384){logger[_0x6b9f('0x11')]('ShowSmsQueue',_0xf32e41);logger[_0x6b9f('0x13')](_0x6b9f('0x24'),_0xf32e41,JSON[_0x6b9f('0x15')](_0x13b384));_0x28d360(_0x13b384);})[_0x6b9f('0x19')](function(_0x54812d){logger[_0x6b9f('0x16')]('ShowSmsQueue',_0x54812d[_0x6b9f('0x17')],_0xf32e41);_0x4352eb(_0x44949e[_0x6b9f('0x16')](0x1f4,_0x54812d[_0x6b9f('0x17')]));});});}; \ No newline at end of file +var _0x636a=['./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','include','model','map','attributes','find','ShowSmsQueue','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x567aa6,_0x3078f7){var _0x4a89ad=function(_0x544f81){while(--_0x544f81){_0x567aa6['push'](_0x567aa6['shift']());}};_0x4a89ad(++_0x3078f7);}(_0x636a,0x18b));var _0xa636=function(_0x5e32f3,_0x3386c1){_0x5e32f3=_0x5e32f3-0x0;var _0x4d4e03=_0x636a[_0x5e32f3];return _0x4d4e03;};'use strict';var _=require(_0xa636('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa636('0x1'));var fs=require('fs');var Redis=require(_0xa636('0x2'));var db=require(_0xa636('0x3'))['db'];var utils=require(_0xa636('0x4'));var logger=require(_0xa636('0x5'))(_0xa636('0x6'));var config=require(_0xa636('0x7'));var jayson=require(_0xa636('0x8'));var client=jayson[_0xa636('0x9')][_0xa636('0xa')]({'port':0x232a});config[_0xa636('0xb')]=_[_0xa636('0xc')](config[_0xa636('0xb')],{'host':_0xa636('0xd'),'port':0x18eb});var socket=require(_0xa636('0xe'))(new Redis(config[_0xa636('0xb')]));require(_0xa636('0xf'))[_0xa636('0x10')](socket);function respondWithRpcPromise(_0x54e234,_0x3ec872,_0x3208d6){return new BPromise(function(_0x33bd49,_0x5ec5e7){return client[_0xa636('0x11')](_0x54e234,_0x3208d6)[_0xa636('0x12')](function(_0x44ed27){logger[_0xa636('0x13')](_0xa636('0x14'),_0x3ec872,'request\x20sent');logger[_0xa636('0x15')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x3ec872,_0xa636('0x16'),JSON[_0xa636('0x17')](_0x44ed27));if(_0x44ed27[_0xa636('0x18')]){if(_0x44ed27[_0xa636('0x18')][_0xa636('0x19')]===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x3ec872,_0x44ed27[_0xa636('0x18')]['message']);return _0x5ec5e7(_0x44ed27[_0xa636('0x18')][_0xa636('0x1a')]);}logger[_0xa636('0x18')](_0xa636('0x14'),_0x3ec872,_0x44ed27[_0xa636('0x18')][_0xa636('0x1a')]);return _0x33bd49(_0x44ed27[_0xa636('0x18')][_0xa636('0x1a')]);}else{logger['info'](_0xa636('0x14'),_0x3ec872,'request\x20sent');_0x33bd49(_0x44ed27[_0xa636('0x1b')][_0xa636('0x1a')]);}})[_0xa636('0x1c')](function(_0x5f3ba5){logger['error'](_0xa636('0x14'),_0x3ec872,_0x5f3ba5);_0x5ec5e7(_0x5f3ba5);});});}exports[_0xa636('0x1d')]=function(_0x460e5e){var _0x5408e1=this;return new Promise(function(_0x292cf3,_0x3d2157){return db[_0xa636('0x1e')][_0xa636('0x1f')]({'raw':_0x460e5e[_0xa636('0x20')]?_0x460e5e['options'][_0xa636('0x21')]===undefined?!![]:![]:!![],'where':_0x460e5e[_0xa636('0x20')]?_0x460e5e[_0xa636('0x20')][_0xa636('0x22')]||null:null,'attributes':_0x460e5e[_0xa636('0x20')]?_0x460e5e[_0xa636('0x20')]['attributes']||null:null,'limit':_0x460e5e[_0xa636('0x20')]?_0x460e5e[_0xa636('0x20')]['limit']||null:null,'include':_0x460e5e['options']?_0x460e5e[_0xa636('0x20')][_0xa636('0x23')]?_['map'](_0x460e5e['options'][_0xa636('0x23')],function(_0xe5faf1){return{'model':db[_0xe5faf1[_0xa636('0x24')]],'as':_0xe5faf1['as'],'attributes':_0xe5faf1['attributes'],'include':_0xe5faf1[_0xa636('0x23')]?_[_0xa636('0x25')](_0xe5faf1[_0xa636('0x23')],function(_0x53dd32){return{'model':db[_0x53dd32[_0xa636('0x24')]],'as':_0x53dd32['as'],'attributes':_0x53dd32[_0xa636('0x26')],'include':_0x53dd32[_0xa636('0x23')]?_['map'](_0x53dd32[_0xa636('0x23')],function(_0x45c605){return{'model':db[_0x45c605['model']],'as':_0x45c605['as'],'attributes':_0x45c605[_0xa636('0x26')]};}):[]};}):[]};}):[]:[]})[_0xa636('0x12')](function(_0x17fc1e){logger[_0xa636('0x13')](_0xa636('0x1d'),_0x460e5e);logger[_0xa636('0x15')](_0xa636('0x1d'),_0x460e5e,JSON[_0xa636('0x17')](_0x17fc1e));_0x292cf3(_0x17fc1e);})[_0xa636('0x1c')](function(_0x3df047){logger['error']('GetSmsQueue',_0x3df047[_0xa636('0x1a')],_0x460e5e);_0x3d2157(_0x5408e1[_0xa636('0x18')](0x1f4,_0x3df047[_0xa636('0x1a')]));});});};exports['ShowSmsQueue']=function(_0x1af7be){var _0x138db1=this;return new Promise(function(_0x4b0c07,_0x4a9a8d){return db[_0xa636('0x1e')][_0xa636('0x27')]({'raw':_0x1af7be['options']?_0x1af7be[_0xa636('0x20')][_0xa636('0x21')]===undefined?!![]:![]:!![],'where':_0x1af7be[_0xa636('0x20')]?_0x1af7be[_0xa636('0x20')]['where']||null:null,'attributes':_0x1af7be[_0xa636('0x20')]?_0x1af7be[_0xa636('0x20')][_0xa636('0x26')]||null:null,'include':_0x1af7be[_0xa636('0x20')]?_0x1af7be[_0xa636('0x20')][_0xa636('0x23')]?_['map'](_0x1af7be[_0xa636('0x20')]['include'],function(_0x616fe8){return{'model':db[_0x616fe8['model']],'as':_0x616fe8['as'],'attributes':_0x616fe8[_0xa636('0x26')],'include':_0x616fe8['include']?_[_0xa636('0x25')](_0x616fe8[_0xa636('0x23')],function(_0x24f688){return{'model':db[_0x24f688[_0xa636('0x24')]],'as':_0x24f688['as'],'attributes':_0x24f688[_0xa636('0x26')],'include':_0x24f688[_0xa636('0x23')]?_[_0xa636('0x25')](_0x24f688['include'],function(_0x43a4fe){return{'model':db[_0x43a4fe[_0xa636('0x24')]],'as':_0x43a4fe['as'],'attributes':_0x43a4fe['attributes']};}):[]};}):[]};}):[]:[]})[_0xa636('0x12')](function(_0x1fd7aa){logger['info'](_0xa636('0x28'),_0x1af7be);logger['debug'](_0xa636('0x28'),_0x1af7be,JSON[_0xa636('0x17')](_0x1fd7aa));_0x4b0c07(_0x1fd7aa);})['catch'](function(_0x584c9e){logger[_0xa636('0x18')](_0xa636('0x28'),_0x584c9e[_0xa636('0x1a')],_0x1af7be);_0x4a9a8d(_0x138db1[_0xa636('0x18')](0x1f4,_0x584c9e[_0xa636('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 005c03c..8f9e600 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 _0xca81=['./smsQueue.events','save','remove','emit','removeListener','register','smsQueue:'];(function(_0x7fe2c8,_0x257d65){var _0x19bde3=function(_0x53ea06){while(--_0x53ea06){_0x7fe2c8['push'](_0x7fe2c8['shift']());}};_0x19bde3(++_0x257d65);}(_0xca81,0x7e));var _0x1ca8=function(_0x18bb96,_0x165684){_0x18bb96=_0x18bb96-0x0;var _0x11968d=_0xca81[_0x18bb96];return _0x11968d;};'use strict';var SmsQueueEvents=require(_0x1ca8('0x0'));var events=[_0x1ca8('0x1'),_0x1ca8('0x2'),'update'];function createListener(_0x4fdd41,_0x572cb5){return function(_0xf97110){_0x572cb5[_0x1ca8('0x3')](_0x4fdd41,_0xf97110);};}function removeListener(_0x3d98b4,_0x21178a){return function(){SmsQueueEvents[_0x1ca8('0x4')](_0x3d98b4,_0x21178a);};}exports[_0x1ca8('0x5')]=function(_0x241f2a){for(var _0x4edd30=0x0,_0x5b8bc5=events['length'];_0x4edd30<_0x5b8bc5;_0x4edd30++){var _0x46ab45=events[_0x4edd30];var _0x47e89c=createListener(_0x1ca8('0x6')+_0x46ab45,_0x241f2a);SmsQueueEvents['on'](_0x46ab45,_0x47e89c);}}; \ No newline at end of file +var _0x33a2=['save','remove','update','emit','register','length','smsQueue:','./smsQueue.events'];(function(_0x3d5067,_0x41ed07){var _0x350a3d=function(_0x3cdccb){while(--_0x3cdccb){_0x3d5067['push'](_0x3d5067['shift']());}};_0x350a3d(++_0x41ed07);}(_0x33a2,0xd7));var _0x233a=function(_0x51b484,_0x321870){_0x51b484=_0x51b484-0x0;var _0x447f4e=_0x33a2[_0x51b484];return _0x447f4e;};'use strict';var SmsQueueEvents=require(_0x233a('0x0'));var events=[_0x233a('0x1'),_0x233a('0x2'),_0x233a('0x3')];function createListener(_0x45a39b,_0x229a5d){return function(_0x5614fa){_0x229a5d[_0x233a('0x4')](_0x45a39b,_0x5614fa);};}function removeListener(_0x3fe8be,_0x5b4c8c){return function(){SmsQueueEvents['removeListener'](_0x3fe8be,_0x5b4c8c);};}exports[_0x233a('0x5')]=function(_0x56ca5c){for(var _0x258b3b=0x0,_0x1cb3a4=events[_0x233a('0x6')];_0x258b3b<_0x1cb3a4;_0x258b3b++){var _0x273dbb=events[_0x258b3b];var _0x4e07fd=createListener(_0x233a('0x7')+_0x273dbb,_0x56ca5c);SmsQueueEvents['on'](_0x273dbb,_0x4e07fd);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 460a4a4..3e1d75f 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 _0x9375=['./smsQueueReport.controller','get','isAuthenticated','/describe','describe','post','create','/:id','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4f3409,_0x47f818){var _0x39383c=function(_0x3fdf6b){while(--_0x3fdf6b){_0x4f3409['push'](_0x4f3409['shift']());}};_0x39383c(++_0x47f818);}(_0x9375,0xf8));var _0x5937=function(_0x56dd58,_0xb1287d){_0x56dd58=_0x56dd58-0x0;var _0x103e75=_0x9375[_0x56dd58];return _0x103e75;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5937('0x0'));var timeout=require(_0x5937('0x1'));var express=require(_0x5937('0x2'));var router=express[_0x5937('0x3')]();var fs_extra=require(_0x5937('0x4'));var auth=require(_0x5937('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5937('0x6'));var controller=require(_0x5937('0x7'));router[_0x5937('0x8')]('/',auth[_0x5937('0x9')](),controller['index']);router[_0x5937('0x8')](_0x5937('0xa'),auth[_0x5937('0x9')](),controller[_0x5937('0xb')]);router[_0x5937('0x8')]('/:id',auth[_0x5937('0x9')](),controller['show']);router[_0x5937('0xc')]('/',auth[_0x5937('0x9')](),controller[_0x5937('0xd')]);router['put'](_0x5937('0xe'),auth[_0x5937('0x9')](),controller[_0x5937('0xf')]);router['delete']('/:id',auth[_0x5937('0x9')](),controller['destroy']);module[_0x5937('0x10')]=router; \ No newline at end of file +var _0x28b1=['../../components/auth/service','./smsQueueReport.controller','index','/describe','isAuthenticated','describe','get','/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x5beb12,_0x443cbf){var _0x4c981a=function(_0x5e39ce){while(--_0x5e39ce){_0x5beb12['push'](_0x5beb12['shift']());}};_0x4c981a(++_0x443cbf);}(_0x28b1,0x1d6));var _0x128b=function(_0xd3bb34,_0x589626){_0xd3bb34=_0xd3bb34-0x0;var _0x1e957a=_0x28b1[_0xd3bb34];return _0x1e957a;};'use strict';var multer=require(_0x128b('0x0'));var util=require(_0x128b('0x1'));var path=require(_0x128b('0x2'));var timeout=require('connect-timeout');var express=require(_0x128b('0x3'));var router=express[_0x128b('0x4')]();var fs_extra=require(_0x128b('0x5'));var auth=require(_0x128b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x128b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x128b('0x8')]);router['get'](_0x128b('0x9'),auth[_0x128b('0xa')](),controller[_0x128b('0xb')]);router[_0x128b('0xc')](_0x128b('0xd'),auth[_0x128b('0xa')](),controller['show']);router['post']('/',auth[_0x128b('0xa')](),controller['create']);router['put'](_0x128b('0xd'),auth[_0x128b('0xa')](),controller[_0x128b('0xe')]);router[_0x128b('0xf')](_0x128b('0xd'),auth['isAuthenticated'](),controller[_0x128b('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 363dfe4..21f0749 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 _0xe6f0=['exports','STRING','DATE'];(function(_0x397a61,_0x1b4d7b){var _0x3497ad=function(_0x3c7c5c){while(--_0x3c7c5c){_0x397a61['push'](_0x397a61['shift']());}};_0x3497ad(++_0x1b4d7b);}(_0xe6f0,0x10e));var _0x0e6f=function(_0x56b14c,_0x1d5241){_0x56b14c=_0x56b14c-0x0;var _0x385a9e=_0xe6f0[_0x56b14c];return _0x385a9e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x0e6f('0x0')]={'uniqueid':{'type':Sequelize[_0x0e6f('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x0e6f('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0e6f('0x2')]},'acceptAt':{'type':Sequelize[_0x0e6f('0x2')]},'exitAt':{'type':Sequelize[_0x0e6f('0x2')]},'reason':{'type':Sequelize[_0x0e6f('0x1')]}}; \ No newline at end of file +var _0x9622=['DATE','moment','sequelize','exports','STRING'];(function(_0x575572,_0x159360){var _0x3a6801=function(_0x10925c){while(--_0x10925c){_0x575572['push'](_0x575572['shift']());}};_0x3a6801(++_0x159360);}(_0x9622,0x8d));var _0x2962=function(_0x20f96d,_0x23e67f){_0x20f96d=_0x20f96d-0x0;var _0x9a7524=_0x9622[_0x20f96d];return _0x9a7524;};'use strict';var moment=require(_0x2962('0x0'));var Sequelize=require(_0x2962('0x1'));module[_0x2962('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x2962('0x3')]},'joinAt':{'type':Sequelize[_0x2962('0x4')]},'leaveAt':{'type':Sequelize[_0x2962('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index f004484..2f60477 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 _0x9c2d=['sendStatus','end','status','json','offset','limit','count','Content-Range','apply','reject','save','update','destroy','error','name','send','SmsQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','rows','catch','show','params','keys','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5333ba,_0x22e1bb){var _0x20f9dc=function(_0x1956af){while(--_0x1956af){_0x5333ba['push'](_0x5333ba['shift']());}};_0x20f9dc(++_0x22e1bb);}(_0x9c2d,0xc9));var _0xd9c2=function(_0x29e91b,_0x65a5bd){_0x29e91b=_0x29e91b-0x0;var _0x40a594=_0x9c2d[_0x29e91b];return _0x40a594;};'use strict';var emlformat=require(_0xd9c2('0x0'));var rimraf=require(_0xd9c2('0x1'));var zipdir=require(_0xd9c2('0x2'));var jsonpatch=require(_0xd9c2('0x3'));var rp=require(_0xd9c2('0x4'));var moment=require(_0xd9c2('0x5'));var BPromise=require(_0xd9c2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd9c2('0x7'));var sox=require(_0xd9c2('0x8'));var csv=require(_0xd9c2('0x9'));var ejs=require(_0xd9c2('0xa'));var fs=require('fs');var fs_extra=require(_0xd9c2('0xb'));var _=require(_0xd9c2('0xc'));var squel=require('squel');var crypto=require(_0xd9c2('0xd'));var jsforce=require(_0xd9c2('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd9c2('0xf'));var Redis=require(_0xd9c2('0x10'));var authService=require(_0xd9c2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd9c2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd9c2('0x13'));var utils=require(_0xd9c2('0x14'));var config=require(_0xd9c2('0x15'));var licenseUtil=require(_0xd9c2('0x16'));var db=require(_0xd9c2('0x17'))['db'];function respondWithStatusCode(_0x26caa9,_0x2f5c88){_0x2f5c88=_0x2f5c88||0xcc;return function(_0x40e1a9){if(_0x40e1a9){return _0x26caa9[_0xd9c2('0x18')](_0x2f5c88);}return _0x26caa9['status'](_0x2f5c88)[_0xd9c2('0x19')]();};}function respondWithResult(_0x19ecfe,_0x57c59b){_0x57c59b=_0x57c59b||0xc8;return function(_0x52978e){if(_0x52978e){return _0x19ecfe[_0xd9c2('0x1a')](_0x57c59b)[_0xd9c2('0x1b')](_0x52978e);}};}function respondWithFilteredResult(_0x4687e5,_0x2a5c3a){return function(_0x3e939a){if(_0x3e939a){var _0x22a78a=typeof _0x2a5c3a[_0xd9c2('0x1c')]==='undefined'&&typeof _0x2a5c3a[_0xd9c2('0x1d')]==='undefined';var _0x476d09=_0x3e939a[_0xd9c2('0x1e')];var _0x4998f4=_0x22a78a?0x0:_0x2a5c3a[_0xd9c2('0x1c')];var _0x2585b0=_0x22a78a?_0x3e939a['count']:_0x2a5c3a[_0xd9c2('0x1c')]+_0x2a5c3a[_0xd9c2('0x1d')];var _0x329d13;if(_0x2585b0>=_0x476d09){_0x2585b0=_0x476d09;_0x329d13=0xc8;}else{_0x329d13=0xce;}_0x4687e5[_0xd9c2('0x1a')](_0x329d13);return _0x4687e5['set'](_0xd9c2('0x1f'),_0x4998f4+'-'+_0x2585b0+'/'+_0x476d09)[_0xd9c2('0x1b')](_0x3e939a);}return null;};}function patchUpdates(_0x139b01){return function(_0xd5d0ae){try{jsonpatch[_0xd9c2('0x20')](_0xd5d0ae,_0x139b01,!![]);}catch(_0x471a96){return BPromise[_0xd9c2('0x21')](_0x471a96);}return _0xd5d0ae[_0xd9c2('0x22')]();};}function saveUpdates(_0x11a46b,_0x3671f6){return function(_0xcadba4){if(_0xcadba4){return _0xcadba4[_0xd9c2('0x23')](_0x11a46b)['then'](function(_0x140d51){return _0x140d51;});}return null;};}function removeEntity(_0x2dd392,_0x307e01){return function(_0x304d9d){if(_0x304d9d){return _0x304d9d[_0xd9c2('0x24')]()['then'](function(){_0x2dd392['status'](0xcc)[_0xd9c2('0x19')]();});}};}function handleEntityNotFound(_0x4c9aa8,_0x3fb799){return function(_0x15a906){if(!_0x15a906){_0x4c9aa8[_0xd9c2('0x18')](0x194);}return _0x15a906;};}function handleError(_0xd25879,_0x318796){_0x318796=_0x318796||0x1f4;return function(_0x370a1d){logger[_0xd9c2('0x25')](_0x370a1d['stack']);if(_0x370a1d[_0xd9c2('0x26')]){delete _0x370a1d[_0xd9c2('0x26')];}_0xd25879[_0xd9c2('0x1a')](_0x318796)[_0xd9c2('0x27')](_0x370a1d);};}exports['index']=function(_0x28482c,_0x40a7da){var _0x38bbf2={},_0x2e69b8={},_0x16a4d8={'count':0x0,'rows':[]};var _0x34b99e=_['map'](db[_0xd9c2('0x28')][_0xd9c2('0x29')],function(_0xd38711){return{'name':_0xd38711[_0xd9c2('0x2a')],'type':_0xd38711[_0xd9c2('0x2b')][_0xd9c2('0x2c')]};});_0x2e69b8[_0xd9c2('0x2d')]=_[_0xd9c2('0x2e')](_0x34b99e,_0xd9c2('0x26'));_0x2e69b8[_0xd9c2('0x2f')]=_['keys'](_0x28482c['query']);_0x2e69b8[_0xd9c2('0x30')]=_['intersection'](_0x2e69b8[_0xd9c2('0x2d')],_0x2e69b8['query']);_0x38bbf2['attributes']=_[_0xd9c2('0x31')](_0x2e69b8['model'],qs[_0xd9c2('0x32')](_0x28482c[_0xd9c2('0x2f')][_0xd9c2('0x32')]));_0x38bbf2[_0xd9c2('0x33')]=_0x38bbf2[_0xd9c2('0x33')][_0xd9c2('0x34')]?_0x38bbf2['attributes']:_0x2e69b8[_0xd9c2('0x2d')];if(!_0x28482c[_0xd9c2('0x2f')][_0xd9c2('0x35')](_0xd9c2('0x36'))){_0x38bbf2['limit']=qs[_0xd9c2('0x1d')](_0x28482c[_0xd9c2('0x2f')][_0xd9c2('0x1d')]);_0x38bbf2[_0xd9c2('0x1c')]=qs[_0xd9c2('0x1c')](_0x28482c[_0xd9c2('0x2f')][_0xd9c2('0x1c')]);}_0x38bbf2[_0xd9c2('0x37')]=qs['sort'](_0x28482c[_0xd9c2('0x2f')][_0xd9c2('0x38')]);_0x38bbf2[_0xd9c2('0x39')]=qs[_0xd9c2('0x30')](_[_0xd9c2('0x3a')](_0x28482c['query'],_0x2e69b8[_0xd9c2('0x30')]),_0x34b99e);if(_0x28482c['query'][_0xd9c2('0x3b')]){_0x38bbf2[_0xd9c2('0x39')]=_[_0xd9c2('0x3c')](_0x38bbf2[_0xd9c2('0x39')],{'$or':_[_0xd9c2('0x2e')](_0x34b99e,function(_0x27adf4){if(_0x27adf4[_0xd9c2('0x2b')]!==_0xd9c2('0x3d')){var _0x1fec94={};_0x1fec94[_0x27adf4[_0xd9c2('0x26')]]={'$like':'%'+_0x28482c['query'][_0xd9c2('0x3b')]+'%'};return _0x1fec94;}})});}_0x38bbf2=_[_0xd9c2('0x3c')]({},_0x38bbf2,_0x28482c['options']);var _0x110492={'where':_0x38bbf2[_0xd9c2('0x39')]};return db[_0xd9c2('0x28')][_0xd9c2('0x1e')](_0x110492)[_0xd9c2('0x3e')](function(_0x1d95aa){_0x16a4d8['count']=_0x1d95aa;if(_0x28482c[_0xd9c2('0x2f')][_0xd9c2('0x3f')]){_0x38bbf2[_0xd9c2('0x40')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x38bbf2);})[_0xd9c2('0x3e')](function(_0x5c3981){_0x16a4d8[_0xd9c2('0x41')]=_0x5c3981;return _0x16a4d8;})['then'](respondWithFilteredResult(_0x40a7da,_0x38bbf2))[_0xd9c2('0x42')](handleError(_0x40a7da,null));};exports[_0xd9c2('0x43')]=function(_0x4e49b8,_0x4f0751){var _0x10ccf5={'raw':!![],'where':{'id':_0x4e49b8[_0xd9c2('0x44')]['id']}},_0x59bcc8={};_0x59bcc8[_0xd9c2('0x2d')]=_['keys'](db[_0xd9c2('0x28')][_0xd9c2('0x29')]);_0x59bcc8[_0xd9c2('0x2f')]=_[_0xd9c2('0x45')](_0x4e49b8['query']);_0x59bcc8[_0xd9c2('0x30')]=_[_0xd9c2('0x31')](_0x59bcc8[_0xd9c2('0x2d')],_0x59bcc8[_0xd9c2('0x2f')]);_0x10ccf5[_0xd9c2('0x33')]=_['intersection'](_0x59bcc8['model'],qs['fields'](_0x4e49b8[_0xd9c2('0x2f')][_0xd9c2('0x32')]));_0x10ccf5['attributes']=_0x10ccf5[_0xd9c2('0x33')]['length']?_0x10ccf5[_0xd9c2('0x33')]:_0x59bcc8[_0xd9c2('0x2d')];if(_0x4e49b8[_0xd9c2('0x2f')][_0xd9c2('0x3f')]){_0x10ccf5[_0xd9c2('0x40')]=[{'all':!![]}];}_0x10ccf5=_[_0xd9c2('0x3c')]({},_0x10ccf5,_0x4e49b8[_0xd9c2('0x46')]);return db['SmsQueueReport'][_0xd9c2('0x47')](_0x10ccf5)['then'](handleEntityNotFound(_0x4f0751,null))[_0xd9c2('0x3e')](respondWithResult(_0x4f0751,null))[_0xd9c2('0x42')](handleError(_0x4f0751,null));};exports['create']=function(_0x2ed5b1,_0x4b67db){return db[_0xd9c2('0x28')][_0xd9c2('0x48')](_0x2ed5b1[_0xd9c2('0x49')],{})[_0xd9c2('0x3e')](respondWithResult(_0x4b67db,0xc9))['catch'](handleError(_0x4b67db,null));};exports['update']=function(_0x148db3,_0x3c2aec){if(_0x148db3['body']['id']){delete _0x148db3[_0xd9c2('0x49')]['id'];}return db[_0xd9c2('0x28')][_0xd9c2('0x47')]({'where':{'id':_0x148db3[_0xd9c2('0x44')]['id']}})[_0xd9c2('0x3e')](handleEntityNotFound(_0x3c2aec,null))[_0xd9c2('0x3e')](saveUpdates(_0x148db3[_0xd9c2('0x49')],null))[_0xd9c2('0x3e')](respondWithResult(_0x3c2aec,null))['catch'](handleError(_0x3c2aec,null));};exports['destroy']=function(_0x18fdce,_0x1d50cb){return db['SmsQueueReport'][_0xd9c2('0x47')]({'where':{'id':_0x18fdce['params']['id']}})[_0xd9c2('0x3e')](handleEntityNotFound(_0x1d50cb,null))[_0xd9c2('0x3e')](removeEntity(_0x1d50cb,null))[_0xd9c2('0x42')](handleError(_0x1d50cb,null));};exports['describe']=function(_0x4099c6,_0x23f78c){return db[_0xd9c2('0x28')][_0xd9c2('0x4a')]()[_0xd9c2('0x3e')](respondWithResult(_0x23f78c,null))[_0xd9c2('0x42')](handleError(_0x23f78c,null));}; \ No newline at end of file +var _0x8146=['describe','eml-format','rimraf','request-promise','moment','bluebird','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','type','merge','options','SmsQueueReport','includeAll','include','findAll','rows','params','find','catch','create','body'];(function(_0x5caf7e,_0x52e1bc){var _0x5c3435=function(_0xb77e11){while(--_0xb77e11){_0x5caf7e['push'](_0x5caf7e['shift']());}};_0x5c3435(++_0x52e1bc);}(_0x8146,0x97));var _0x6814=function(_0x216112,_0x3a57f4){_0x216112=_0x216112-0x0;var _0x578c6f=_0x8146[_0x216112];return _0x578c6f;};'use strict';var emlformat=require(_0x6814('0x0'));var rimraf=require(_0x6814('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6814('0x2'));var moment=require(_0x6814('0x3'));var BPromise=require(_0x6814('0x4'));var Mustache=require('mustache');var util=require(_0x6814('0x5'));var path=require(_0x6814('0x6'));var sox=require(_0x6814('0x7'));var csv=require(_0x6814('0x8'));var ejs=require(_0x6814('0x9'));var fs=require('fs');var fs_extra=require(_0x6814('0xa'));var _=require(_0x6814('0xb'));var squel=require(_0x6814('0xc'));var crypto=require(_0x6814('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6814('0xe'));var toCsv=require(_0x6814('0x8'));var querystring=require(_0x6814('0xf'));var Papa=require('papaparse');var Redis=require(_0x6814('0x10'));var authService=require(_0x6814('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6814('0x12'));var hardwareService=require(_0x6814('0x13'));var logger=require(_0x6814('0x14'))(_0x6814('0x15'));var utils=require(_0x6814('0x16'));var config=require(_0x6814('0x17'));var licenseUtil=require(_0x6814('0x18'));var db=require(_0x6814('0x19'))['db'];function respondWithStatusCode(_0x7af88f,_0x2bbd73){_0x2bbd73=_0x2bbd73||0xcc;return function(_0x251892){if(_0x251892){return _0x7af88f[_0x6814('0x1a')](_0x2bbd73);}return _0x7af88f[_0x6814('0x1b')](_0x2bbd73)[_0x6814('0x1c')]();};}function respondWithResult(_0x252b86,_0x30ada0){_0x30ada0=_0x30ada0||0xc8;return function(_0x450d53){if(_0x450d53){return _0x252b86['status'](_0x30ada0)[_0x6814('0x1d')](_0x450d53);}};}function respondWithFilteredResult(_0x23c93c,_0x2393c0){return function(_0x4fb968){if(_0x4fb968){var _0x416ddb=typeof _0x2393c0[_0x6814('0x1e')]===_0x6814('0x1f')&&typeof _0x2393c0[_0x6814('0x20')]===_0x6814('0x1f');var _0x1083e4=_0x4fb968[_0x6814('0x21')];var _0x3d5e75=_0x416ddb?0x0:_0x2393c0[_0x6814('0x1e')];var _0x5095f5=_0x416ddb?_0x4fb968[_0x6814('0x21')]:_0x2393c0['offset']+_0x2393c0[_0x6814('0x20')];var _0x2d0fe2;if(_0x5095f5>=_0x1083e4){_0x5095f5=_0x1083e4;_0x2d0fe2=0xc8;}else{_0x2d0fe2=0xce;}_0x23c93c[_0x6814('0x1b')](_0x2d0fe2);return _0x23c93c[_0x6814('0x22')](_0x6814('0x23'),_0x3d5e75+'-'+_0x5095f5+'/'+_0x1083e4)[_0x6814('0x1d')](_0x4fb968);}return null;};}function patchUpdates(_0x29b4a3){return function(_0x53e0b8){try{jsonpatch[_0x6814('0x24')](_0x53e0b8,_0x29b4a3,!![]);}catch(_0x306ad7){return BPromise[_0x6814('0x25')](_0x306ad7);}return _0x53e0b8[_0x6814('0x26')]();};}function saveUpdates(_0x1f44d7,_0x1d37c6){return function(_0x4b4e44){if(_0x4b4e44){return _0x4b4e44[_0x6814('0x27')](_0x1f44d7)[_0x6814('0x28')](function(_0x1f73f6){return _0x1f73f6;});}return null;};}function removeEntity(_0x1dbd86,_0x2997ef){return function(_0x52982c){if(_0x52982c){return _0x52982c[_0x6814('0x29')]()[_0x6814('0x28')](function(){_0x1dbd86[_0x6814('0x1b')](0xcc)[_0x6814('0x1c')]();});}};}function handleEntityNotFound(_0xb2b307,_0x5d4219){return function(_0x8715a4){if(!_0x8715a4){_0xb2b307[_0x6814('0x1a')](0x194);}return _0x8715a4;};}function handleError(_0x1b9476,_0x31b529){_0x31b529=_0x31b529||0x1f4;return function(_0xccf950){logger['error'](_0xccf950['stack']);if(_0xccf950[_0x6814('0x2a')]){delete _0xccf950[_0x6814('0x2a')];}_0x1b9476[_0x6814('0x1b')](_0x31b529)[_0x6814('0x2b')](_0xccf950);};}exports['index']=function(_0x1550f8,_0x180193){var _0x242009={},_0x2596b6={},_0x207f0e={'count':0x0,'rows':[]};var _0x2c641f=_[_0x6814('0x2c')](db['SmsQueueReport'][_0x6814('0x2d')],function(_0x44f1ac){return{'name':_0x44f1ac[_0x6814('0x2e')],'type':_0x44f1ac['type'][_0x6814('0x2f')]};});_0x2596b6[_0x6814('0x30')]=_[_0x6814('0x2c')](_0x2c641f,'name');_0x2596b6[_0x6814('0x31')]=_[_0x6814('0x32')](_0x1550f8[_0x6814('0x31')]);_0x2596b6[_0x6814('0x33')]=_['intersection'](_0x2596b6[_0x6814('0x30')],_0x2596b6['query']);_0x242009[_0x6814('0x34')]=_[_0x6814('0x35')](_0x2596b6[_0x6814('0x30')],qs[_0x6814('0x36')](_0x1550f8[_0x6814('0x31')]['fields']));_0x242009[_0x6814('0x34')]=_0x242009[_0x6814('0x34')]['length']?_0x242009['attributes']:_0x2596b6['model'];if(!_0x1550f8[_0x6814('0x31')][_0x6814('0x37')](_0x6814('0x38'))){_0x242009[_0x6814('0x20')]=qs[_0x6814('0x20')](_0x1550f8[_0x6814('0x31')]['limit']);_0x242009[_0x6814('0x1e')]=qs[_0x6814('0x1e')](_0x1550f8['query'][_0x6814('0x1e')]);}_0x242009['order']=qs[_0x6814('0x39')](_0x1550f8[_0x6814('0x31')][_0x6814('0x39')]);_0x242009[_0x6814('0x3a')]=qs[_0x6814('0x33')](_[_0x6814('0x3b')](_0x1550f8['query'],_0x2596b6[_0x6814('0x33')]),_0x2c641f);if(_0x1550f8['query'][_0x6814('0x3c')]){_0x242009[_0x6814('0x3a')]=_['merge'](_0x242009[_0x6814('0x3a')],{'$or':_[_0x6814('0x2c')](_0x2c641f,function(_0x7c0f9e){if(_0x7c0f9e[_0x6814('0x3d')]!=='VIRTUAL'){var _0x5aa1c4={};_0x5aa1c4[_0x7c0f9e[_0x6814('0x2a')]]={'$like':'%'+_0x1550f8['query'][_0x6814('0x3c')]+'%'};return _0x5aa1c4;}})});}_0x242009=_[_0x6814('0x3e')]({},_0x242009,_0x1550f8[_0x6814('0x3f')]);var _0x5efdbe={'where':_0x242009['where']};return db[_0x6814('0x40')][_0x6814('0x21')](_0x5efdbe)[_0x6814('0x28')](function(_0x2209e2){_0x207f0e[_0x6814('0x21')]=_0x2209e2;if(_0x1550f8[_0x6814('0x31')][_0x6814('0x41')]){_0x242009[_0x6814('0x42')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x6814('0x43')](_0x242009);})[_0x6814('0x28')](function(_0x480d58){_0x207f0e[_0x6814('0x44')]=_0x480d58;return _0x207f0e;})[_0x6814('0x28')](respondWithFilteredResult(_0x180193,_0x242009))['catch'](handleError(_0x180193,null));};exports['show']=function(_0x50a87f,_0x32ecf4){var _0x52e537={'raw':!![],'where':{'id':_0x50a87f[_0x6814('0x45')]['id']}},_0x26c532={};_0x26c532['model']=_[_0x6814('0x32')](db[_0x6814('0x40')][_0x6814('0x2d')]);_0x26c532[_0x6814('0x31')]=_[_0x6814('0x32')](_0x50a87f[_0x6814('0x31')]);_0x26c532[_0x6814('0x33')]=_[_0x6814('0x35')](_0x26c532[_0x6814('0x30')],_0x26c532[_0x6814('0x31')]);_0x52e537[_0x6814('0x34')]=_['intersection'](_0x26c532[_0x6814('0x30')],qs[_0x6814('0x36')](_0x50a87f[_0x6814('0x31')][_0x6814('0x36')]));_0x52e537['attributes']=_0x52e537[_0x6814('0x34')]['length']?_0x52e537[_0x6814('0x34')]:_0x26c532[_0x6814('0x30')];if(_0x50a87f[_0x6814('0x31')][_0x6814('0x41')]){_0x52e537[_0x6814('0x42')]=[{'all':!![]}];}_0x52e537=_[_0x6814('0x3e')]({},_0x52e537,_0x50a87f[_0x6814('0x3f')]);return db['SmsQueueReport'][_0x6814('0x46')](_0x52e537)['then'](handleEntityNotFound(_0x32ecf4,null))[_0x6814('0x28')](respondWithResult(_0x32ecf4,null))[_0x6814('0x47')](handleError(_0x32ecf4,null));};exports[_0x6814('0x48')]=function(_0x3acafa,_0x4ab038){return db[_0x6814('0x40')][_0x6814('0x48')](_0x3acafa[_0x6814('0x49')],{})['then'](respondWithResult(_0x4ab038,0xc9))[_0x6814('0x47')](handleError(_0x4ab038,null));};exports['update']=function(_0x4aa936,_0x5c32ff){if(_0x4aa936[_0x6814('0x49')]['id']){delete _0x4aa936[_0x6814('0x49')]['id'];}return db['SmsQueueReport'][_0x6814('0x46')]({'where':{'id':_0x4aa936['params']['id']}})['then'](handleEntityNotFound(_0x5c32ff,null))[_0x6814('0x28')](saveUpdates(_0x4aa936[_0x6814('0x49')],null))[_0x6814('0x28')](respondWithResult(_0x5c32ff,null))[_0x6814('0x47')](handleError(_0x5c32ff,null));};exports['destroy']=function(_0x480ab7,_0x1e0059){return db[_0x6814('0x40')][_0x6814('0x46')]({'where':{'id':_0x480ab7[_0x6814('0x45')]['id']}})[_0x6814('0x28')](handleEntityNotFound(_0x1e0059,null))[_0x6814('0x28')](removeEntity(_0x1e0059,null))[_0x6814('0x47')](handleError(_0x1e0059,null));};exports[_0x6814('0x4a')]=function(_0x20c528,_0xb8d33c){return db[_0x6814('0x40')][_0x6814('0x4a')]()['then'](respondWithResult(_0xb8d33c,null))[_0x6814('0x47')](handleError(_0xb8d33c,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 0e54a1f..5d666cd 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(_0xcc3caf,_0x11800f){var _0x5d1173=function(_0x398db1){while(--_0x398db1){_0xcc3caf['push'](_0xcc3caf['shift']());}};_0x5d1173(++_0x11800f);}(_0xe706,0xa3));var _0x6e70=function(_0x2d120a,_0x5e4d33){_0x2d120a=_0x2d120a-0x0;var _0x205747=_0xe706[_0x2d120a];return _0x205747;};'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(_0x1b9252,_0x56fd3e){var _0x51d591=function(_0x42f4ed){while(--_0x42f4ed){_0x1b9252['push'](_0x1b9252['shift']());}};_0x51d591(++_0x56fd3e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x383dbb,_0x17d41b){_0x383dbb=_0x383dbb-0x0;var _0x6e8bde=_0xcb91[_0x383dbb];return _0x6e8bde;};'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 acec758..406fb6f 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 _0xd28a=['debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SmsQueueReport','create','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','body','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd28a,0x129));var _0xad28=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xd28a[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0xad28('0x0'));var util=require(_0xad28('0x1'));var moment=require(_0xad28('0x2'));var BPromise=require(_0xad28('0x3'));var rs=require(_0xad28('0x4'));var fs=require('fs');var Redis=require(_0xad28('0x5'));var db=require(_0xad28('0x6'))['db'];var utils=require(_0xad28('0x7'));var logger=require(_0xad28('0x8'))(_0xad28('0x9'));var config=require('../../config/environment');var jayson=require(_0xad28('0xa'));var client=jayson[_0xad28('0xb')][_0xad28('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33017c,_0x4a588d,_0x3c8d7a){return new BPromise(function(_0x139288,_0x57983a){return client[_0xad28('0xd')](_0x33017c,_0x3c8d7a)[_0xad28('0xe')](function(_0x30d8ef){logger[_0xad28('0xf')](_0xad28('0x10'),_0x4a588d,_0xad28('0x11'));logger[_0xad28('0x12')](_0xad28('0x13'),_0x4a588d,_0xad28('0x11'),JSON[_0xad28('0x14')](_0x30d8ef));if(_0x30d8ef['error']){if(_0x30d8ef[_0xad28('0x15')][_0xad28('0x16')]===0x1f4){logger[_0xad28('0x15')](_0xad28('0x10'),_0x4a588d,_0x30d8ef[_0xad28('0x15')]['message']);return _0x57983a(_0x30d8ef['error'][_0xad28('0x17')]);}logger[_0xad28('0x15')](_0xad28('0x10'),_0x4a588d,_0x30d8ef[_0xad28('0x15')][_0xad28('0x17')]);return _0x139288(_0x30d8ef[_0xad28('0x15')][_0xad28('0x17')]);}else{logger[_0xad28('0xf')](_0xad28('0x10'),_0x4a588d,_0xad28('0x11'));_0x139288(_0x30d8ef['result'][_0xad28('0x17')]);}})[_0xad28('0x18')](function(_0x266403){logger[_0xad28('0x15')](_0xad28('0x10'),_0x4a588d,_0x266403);_0x57983a(_0x266403);});});}exports['CreateSmsQueueReport']=function(_0x26e60d){var _0x2681be=this;return new Promise(function(_0x36cd73,_0x588e47){return db[_0xad28('0x19')][_0xad28('0x1a')](_0x26e60d['body'],{'raw':_0x26e60d['options']?_0x26e60d[_0xad28('0x1b')][_0xad28('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0xb6e786){logger[_0xad28('0xf')](_0xad28('0x1d'),_0x26e60d);logger[_0xad28('0x12')]('CreateSmsQueueReport',_0x26e60d,JSON[_0xad28('0x14')](_0xb6e786));_0x36cd73(_0xb6e786);})['catch'](function(_0x4fe277){logger[_0xad28('0x15')](_0xad28('0x1d'),_0x4fe277[_0xad28('0x17')],_0x26e60d);_0x588e47(_0x2681be[_0xad28('0x15')](0x1f4,_0x4fe277[_0xad28('0x17')]));});});};exports[_0xad28('0x1e')]=function(_0x26cb1f){var _0x1e77ad=this;return new Promise(function(_0x3df96f,_0x2382e6){return db[_0xad28('0x19')][_0xad28('0x1f')](_0x26cb1f[_0xad28('0x20')],{'raw':_0x26cb1f['options']?_0x26cb1f[_0xad28('0x1b')][_0xad28('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26cb1f['options']?_0x26cb1f['options'][_0xad28('0x21')]||null:null,'attributes':_0x26cb1f['options']?_0x26cb1f[_0xad28('0x1b')]['attributes']||null:null,'limit':_0x26cb1f[_0xad28('0x1b')]?_0x26cb1f[_0xad28('0x1b')][_0xad28('0x22')]||null:null})['then'](function(_0x584961){logger[_0xad28('0xf')](_0xad28('0x1e'),_0x26cb1f);logger['debug'](_0xad28('0x1e'),_0x26cb1f,JSON['stringify'](_0x584961));_0x3df96f(_0x584961);})[_0xad28('0x18')](function(_0x4187de){logger[_0xad28('0x15')](_0xad28('0x1e'),_0x4187de[_0xad28('0x17')],_0x26cb1f);_0x2382e6(_0x1e77ad[_0xad28('0x15')](0x1f4,_0x4187de['message']));});});}; \ No newline at end of file +var _0x7af0=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','then','UpdateSmsQueueReport','lodash','util','bluebird'];(function(_0x360f19,_0x10c68c){var _0x24809e=function(_0x3453e8){while(--_0x3453e8){_0x360f19['push'](_0x360f19['shift']());}};_0x24809e(++_0x10c68c);}(_0x7af0,0x1ec));var _0x07af=function(_0xf84870,_0x4dc38f){_0xf84870=_0xf84870-0x0;var _0x4541a4=_0x7af0[_0xf84870];return _0x4541a4;};'use strict';var _=require(_0x07af('0x0'));var util=require(_0x07af('0x1'));var moment=require('moment');var BPromise=require(_0x07af('0x2'));var rs=require(_0x07af('0x3'));var fs=require('fs');var Redis=require(_0x07af('0x4'));var db=require(_0x07af('0x5'))['db'];var utils=require(_0x07af('0x6'));var logger=require(_0x07af('0x7'))(_0x07af('0x8'));var config=require(_0x07af('0x9'));var jayson=require(_0x07af('0xa'));var client=jayson[_0x07af('0xb')][_0x07af('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33c1d8,_0x5490f2,_0x5cfe14){return new BPromise(function(_0x4af2d2,_0x27b542){return client[_0x07af('0xd')](_0x33c1d8,_0x5cfe14)['then'](function(_0x2d7342){logger[_0x07af('0xe')](_0x07af('0xf'),_0x5490f2,_0x07af('0x10'));logger[_0x07af('0x11')](_0x07af('0x12'),_0x5490f2,_0x07af('0x10'),JSON[_0x07af('0x13')](_0x2d7342));if(_0x2d7342['error']){if(_0x2d7342[_0x07af('0x14')][_0x07af('0x15')]===0x1f4){logger[_0x07af('0x14')]('SmsQueueReport,\x20%s,\x20%s',_0x5490f2,_0x2d7342[_0x07af('0x14')][_0x07af('0x16')]);return _0x27b542(_0x2d7342[_0x07af('0x14')][_0x07af('0x16')]);}logger['error'](_0x07af('0xf'),_0x5490f2,_0x2d7342['error'][_0x07af('0x16')]);return _0x4af2d2(_0x2d7342['error'][_0x07af('0x16')]);}else{logger[_0x07af('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x5490f2,_0x07af('0x10'));_0x4af2d2(_0x2d7342[_0x07af('0x17')][_0x07af('0x16')]);}})[_0x07af('0x18')](function(_0x42a3d1){logger[_0x07af('0x14')](_0x07af('0xf'),_0x5490f2,_0x42a3d1);_0x27b542(_0x42a3d1);});});}exports[_0x07af('0x19')]=function(_0x5c2b63){var _0x37f0d2=this;return new Promise(function(_0x42f75f,_0x389c24){return db[_0x07af('0x1a')][_0x07af('0x1b')](_0x5c2b63[_0x07af('0x1c')],{'raw':_0x5c2b63[_0x07af('0x1d')]?_0x5c2b63[_0x07af('0x1d')][_0x07af('0x1e')]===undefined?!![]:![]:!![]})[_0x07af('0x1f')](function(_0x2d6ce6){logger[_0x07af('0xe')]('CreateSmsQueueReport',_0x5c2b63);logger[_0x07af('0x11')]('CreateSmsQueueReport',_0x5c2b63,JSON[_0x07af('0x13')](_0x2d6ce6));_0x42f75f(_0x2d6ce6);})[_0x07af('0x18')](function(_0x5336af){logger[_0x07af('0x14')](_0x07af('0x19'),_0x5336af['message'],_0x5c2b63);_0x389c24(_0x37f0d2[_0x07af('0x14')](0x1f4,_0x5336af[_0x07af('0x16')]));});});};exports[_0x07af('0x20')]=function(_0x109edc){var _0x20770b=this;return new Promise(function(_0x13e48c,_0x17e470){return db[_0x07af('0x1a')]['update'](_0x109edc[_0x07af('0x1c')],{'raw':_0x109edc[_0x07af('0x1d')]?_0x109edc[_0x07af('0x1d')][_0x07af('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x109edc[_0x07af('0x1d')]?_0x109edc['options']['where']||null:null,'attributes':_0x109edc[_0x07af('0x1d')]?_0x109edc['options']['attributes']||null:null,'limit':_0x109edc[_0x07af('0x1d')]?_0x109edc[_0x07af('0x1d')]['limit']||null:null})[_0x07af('0x1f')](function(_0x43beeb){logger[_0x07af('0xe')]('UpdateSmsQueueReport',_0x109edc);logger[_0x07af('0x11')](_0x07af('0x20'),_0x109edc,JSON[_0x07af('0x13')](_0x43beeb));_0x13e48c(_0x43beeb);})[_0x07af('0x18')](function(_0xe8ad04){logger[_0x07af('0x14')](_0x07af('0x20'),_0xe8ad04['message'],_0x109edc);_0x17e470(_0x20770b[_0x07af('0x14')](0x1f4,_0xe8ad04[_0x07af('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 9b7d956..c5ce0f8 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 _0x0bde=['create','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x19dc1,_0x5b9295){var _0x476cb8=function(_0x306c0e){while(--_0x306c0e){_0x19dc1['push'](_0x19dc1['shift']());}};_0x476cb8(++_0x5b9295);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xe0bd('0x0'));var path=require('path');var timeout=require(_0xe0bd('0x1'));var express=require(_0xe0bd('0x2'));var router=express[_0xe0bd('0x3')]();var fs_extra=require(_0xe0bd('0x4'));var auth=require(_0xe0bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe0bd('0x6'));var controller=require(_0xe0bd('0x7'));router[_0xe0bd('0x8')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xa')]);router[_0xe0bd('0x8')](_0xe0bd('0xb'),auth['isAuthenticated'](),controller[_0xe0bd('0xc')]);router[_0xe0bd('0x8')](_0xe0bd('0xd'),auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xe')]);router[_0xe0bd('0xf')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe0bd('0x11')]);router['delete']('/:id',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3eea=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x39f119,_0xc67edd){var _0x36d66c=function(_0x55b146){while(--_0x55b146){_0x39f119['push'](_0x39f119['shift']());}};_0x36d66c(++_0xc67edd);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x5e36f1,_0x175d1c){_0x5e36f1=_0x5e36f1-0x0;var _0x5b5c58=_0x3eea[_0x5e36f1];return _0x5b5c58;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')]('/',auth[_0xa3ee('0xb')](),controller['index']);router['get'](_0xa3ee('0xc'),auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['get'](_0xa3ee('0xe'),auth['isAuthenticated'](),controller[_0xa3ee('0xf')]);router['post']('/',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x10')]);router[_0xa3ee('0x11')]('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x12')]);router['delete']('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x13')]);module[_0xa3ee('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index a921bb5..c8a0627 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x58f6c1,_0x39dd86){var _0x5a78e7=function(_0x40f056){while(--_0x40f056){_0x58f6c1['push'](_0x58f6c1['shift']());}};_0x5a78e7(++_0x39dd86);}(_0xedd9,0xfc));var _0x9edd=function(_0x66b107,_0x40fe06){_0x66b107=_0x66b107-0x0;var _0x5d5d56=_0xedd9[_0x66b107];return _0x5d5d56;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x48edf7,_0x3272ab){var _0x41853a=function(_0x2f330a){while(--_0x2f330a){_0x48edf7['push'](_0x48edf7['shift']());}};_0x41853a(++_0x3272ab);}(_0xedd9,0xfc));var _0x9edd=function(_0x1a1ed3,_0x185fa8){_0x1a1ed3=_0x1a1ed3-0x0;var _0x33d32b=_0xedd9[_0x1a1ed3];return _0x33d32b;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index ceeb5a6..3073528 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 _0xbc48=['includeAll','include','findAll','rows','catch','show','rawAttributes','merge','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','options'];(function(_0xd3165b,_0x488295){var _0x1faa2d=function(_0x3ec2ae){while(--_0x3ec2ae){_0xd3165b['push'](_0xd3165b['shift']());}};_0x1faa2d(++_0x488295);}(_0xbc48,0xf4));var _0x8bc4=function(_0x503286,_0x44a867){_0x503286=_0x503286-0x0;var _0x278824=_0xbc48[_0x503286];return _0x278824;};'use strict';var emlformat=require(_0x8bc4('0x0'));var rimraf=require(_0x8bc4('0x1'));var zipdir=require(_0x8bc4('0x2'));var jsonpatch=require(_0x8bc4('0x3'));var rp=require(_0x8bc4('0x4'));var moment=require('moment');var BPromise=require(_0x8bc4('0x5'));var Mustache=require(_0x8bc4('0x6'));var util=require(_0x8bc4('0x7'));var path=require(_0x8bc4('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8bc4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bc4('0xa'));var squel=require(_0x8bc4('0xb'));var crypto=require(_0x8bc4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8bc4('0xd'));var toCsv=require(_0x8bc4('0xe'));var querystring=require(_0x8bc4('0xf'));var Papa=require(_0x8bc4('0x10'));var Redis=require(_0x8bc4('0x11'));var authService=require(_0x8bc4('0x12'));var qs=require(_0x8bc4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8bc4('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x8bc4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8bc4('0x16'));var db=require(_0x8bc4('0x17'))['db'];function respondWithStatusCode(_0x30a39a,_0x5c421a){_0x5c421a=_0x5c421a||0xcc;return function(_0xae115a){if(_0xae115a){return _0x30a39a[_0x8bc4('0x18')](_0x5c421a);}return _0x30a39a['status'](_0x5c421a)[_0x8bc4('0x19')]();};}function respondWithResult(_0x352b30,_0x1f04d8){_0x1f04d8=_0x1f04d8||0xc8;return function(_0x40d771){if(_0x40d771){return _0x352b30[_0x8bc4('0x1a')](_0x1f04d8)[_0x8bc4('0x1b')](_0x40d771);}};}function respondWithFilteredResult(_0x321fe5,_0xc94e5c){return function(_0x3380f1){if(_0x3380f1){var _0x5dce13=typeof _0xc94e5c[_0x8bc4('0x1c')]===_0x8bc4('0x1d')&&typeof _0xc94e5c['limit']===_0x8bc4('0x1d');var _0x4c6893=_0x3380f1[_0x8bc4('0x1e')];var _0x3f6bf2=_0x5dce13?0x0:_0xc94e5c['offset'];var _0x31fefa=_0x5dce13?_0x3380f1[_0x8bc4('0x1e')]:_0xc94e5c[_0x8bc4('0x1c')]+_0xc94e5c[_0x8bc4('0x1f')];var _0x1a0021;if(_0x31fefa>=_0x4c6893){_0x31fefa=_0x4c6893;_0x1a0021=0xc8;}else{_0x1a0021=0xce;}_0x321fe5['status'](_0x1a0021);return _0x321fe5[_0x8bc4('0x20')]('Content-Range',_0x3f6bf2+'-'+_0x31fefa+'/'+_0x4c6893)[_0x8bc4('0x1b')](_0x3380f1);}return null;};}function patchUpdates(_0xf51117){return function(_0xd33d9){try{jsonpatch[_0x8bc4('0x21')](_0xd33d9,_0xf51117,!![]);}catch(_0x5afead){return BPromise[_0x8bc4('0x22')](_0x5afead);}return _0xd33d9[_0x8bc4('0x23')]();};}function saveUpdates(_0x3ce515,_0x28740e){return function(_0x5aa2ba){if(_0x5aa2ba){return _0x5aa2ba[_0x8bc4('0x24')](_0x3ce515)[_0x8bc4('0x25')](function(_0x4a0b8c){return _0x4a0b8c;});}return null;};}function removeEntity(_0x3a6ea4,_0x490279){return function(_0xaade53){if(_0xaade53){return _0xaade53[_0x8bc4('0x26')]()[_0x8bc4('0x25')](function(){_0x3a6ea4[_0x8bc4('0x1a')](0xcc)[_0x8bc4('0x19')]();});}};}function handleEntityNotFound(_0x52ef95,_0x19374b){return function(_0x496fed){if(!_0x496fed){_0x52ef95[_0x8bc4('0x18')](0x194);}return _0x496fed;};}function handleError(_0x5494b8,_0x46545d){_0x46545d=_0x46545d||0x1f4;return function(_0x52f412){logger[_0x8bc4('0x27')](_0x52f412[_0x8bc4('0x28')]);if(_0x52f412[_0x8bc4('0x29')]){delete _0x52f412[_0x8bc4('0x29')];}_0x5494b8['status'](_0x46545d)[_0x8bc4('0x2a')](_0x52f412);};}exports[_0x8bc4('0x2b')]=function(_0x524ff2,_0x43a17b){var _0x22f98b={},_0x3bb60f={},_0x240350={'count':0x0,'rows':[]};var _0x2c681f=_[_0x8bc4('0x2c')](db[_0x8bc4('0x2d')]['rawAttributes'],function(_0x508b7a){return{'name':_0x508b7a['fieldName'],'type':_0x508b7a[_0x8bc4('0x2e')][_0x8bc4('0x2f')]};});_0x3bb60f[_0x8bc4('0x30')]=_['map'](_0x2c681f,'name');_0x3bb60f[_0x8bc4('0x31')]=_[_0x8bc4('0x32')](_0x524ff2[_0x8bc4('0x31')]);_0x3bb60f[_0x8bc4('0x33')]=_[_0x8bc4('0x34')](_0x3bb60f['model'],_0x3bb60f[_0x8bc4('0x31')]);_0x22f98b[_0x8bc4('0x35')]=_[_0x8bc4('0x34')](_0x3bb60f[_0x8bc4('0x30')],qs[_0x8bc4('0x36')](_0x524ff2[_0x8bc4('0x31')]['fields']));_0x22f98b[_0x8bc4('0x35')]=_0x22f98b[_0x8bc4('0x35')][_0x8bc4('0x37')]?_0x22f98b['attributes']:_0x3bb60f[_0x8bc4('0x30')];if(!_0x524ff2[_0x8bc4('0x31')][_0x8bc4('0x38')](_0x8bc4('0x39'))){_0x22f98b[_0x8bc4('0x1f')]=qs[_0x8bc4('0x1f')](_0x524ff2[_0x8bc4('0x31')][_0x8bc4('0x1f')]);_0x22f98b[_0x8bc4('0x1c')]=qs['offset'](_0x524ff2[_0x8bc4('0x31')][_0x8bc4('0x1c')]);}_0x22f98b[_0x8bc4('0x3a')]=qs[_0x8bc4('0x3b')](_0x524ff2['query'][_0x8bc4('0x3b')]);_0x22f98b['where']=qs[_0x8bc4('0x33')](_[_0x8bc4('0x3c')](_0x524ff2[_0x8bc4('0x31')],_0x3bb60f[_0x8bc4('0x33')]),_0x2c681f);if(_0x524ff2[_0x8bc4('0x31')]['filter']){_0x22f98b['where']=_['merge'](_0x22f98b[_0x8bc4('0x3d')],{'$or':_[_0x8bc4('0x2c')](_0x2c681f,function(_0x54c16d){if(_0x54c16d['type']!==_0x8bc4('0x3e')){var _0x5de5cc={};_0x5de5cc[_0x54c16d[_0x8bc4('0x29')]]={'$like':'%'+_0x524ff2['query']['filter']+'%'};return _0x5de5cc;}})});}_0x22f98b=_['merge']({},_0x22f98b,_0x524ff2[_0x8bc4('0x3f')]);var _0x1f3867={'where':_0x22f98b[_0x8bc4('0x3d')]};return db['SmsTransferReport'][_0x8bc4('0x1e')](_0x1f3867)[_0x8bc4('0x25')](function(_0x3b0076){_0x240350[_0x8bc4('0x1e')]=_0x3b0076;if(_0x524ff2[_0x8bc4('0x31')][_0x8bc4('0x40')]){_0x22f98b[_0x8bc4('0x41')]=[{'all':!![]}];}return db[_0x8bc4('0x2d')][_0x8bc4('0x42')](_0x22f98b);})['then'](function(_0x4cbaf5){_0x240350[_0x8bc4('0x43')]=_0x4cbaf5;return _0x240350;})['then'](respondWithFilteredResult(_0x43a17b,_0x22f98b))[_0x8bc4('0x44')](handleError(_0x43a17b,null));};exports[_0x8bc4('0x45')]=function(_0x45db50,_0x2cdb25){var _0x8d9dc1={'raw':!![],'where':{'id':_0x45db50['params']['id']}},_0x27c738={};_0x27c738[_0x8bc4('0x30')]=_[_0x8bc4('0x32')](db[_0x8bc4('0x2d')][_0x8bc4('0x46')]);_0x27c738[_0x8bc4('0x31')]=_['keys'](_0x45db50['query']);_0x27c738[_0x8bc4('0x33')]=_[_0x8bc4('0x34')](_0x27c738[_0x8bc4('0x30')],_0x27c738['query']);_0x8d9dc1['attributes']=_['intersection'](_0x27c738[_0x8bc4('0x30')],qs[_0x8bc4('0x36')](_0x45db50[_0x8bc4('0x31')][_0x8bc4('0x36')]));_0x8d9dc1[_0x8bc4('0x35')]=_0x8d9dc1['attributes']['length']?_0x8d9dc1['attributes']:_0x27c738['model'];if(_0x45db50[_0x8bc4('0x31')][_0x8bc4('0x40')]){_0x8d9dc1['include']=[{'all':!![]}];}_0x8d9dc1=_[_0x8bc4('0x47')]({},_0x8d9dc1,_0x45db50[_0x8bc4('0x3f')]);return db[_0x8bc4('0x2d')][_0x8bc4('0x48')](_0x8d9dc1)[_0x8bc4('0x25')](handleEntityNotFound(_0x2cdb25,null))[_0x8bc4('0x25')](respondWithResult(_0x2cdb25,null))[_0x8bc4('0x44')](handleError(_0x2cdb25,null));};exports[_0x8bc4('0x49')]=function(_0x2cefd5,_0x55d923){return db[_0x8bc4('0x2d')]['create'](_0x2cefd5['body'],{})[_0x8bc4('0x25')](respondWithResult(_0x55d923,0xc9))[_0x8bc4('0x44')](handleError(_0x55d923,null));};exports[_0x8bc4('0x24')]=function(_0x21256c,_0x487282){if(_0x21256c[_0x8bc4('0x4a')]['id']){delete _0x21256c['body']['id'];}return db[_0x8bc4('0x2d')][_0x8bc4('0x48')]({'where':{'id':_0x21256c[_0x8bc4('0x4b')]['id']}})[_0x8bc4('0x25')](handleEntityNotFound(_0x487282,null))[_0x8bc4('0x25')](saveUpdates(_0x21256c[_0x8bc4('0x4a')],null))[_0x8bc4('0x25')](respondWithResult(_0x487282,null))[_0x8bc4('0x44')](handleError(_0x487282,null));};exports[_0x8bc4('0x26')]=function(_0x56e07c,_0x2577af){return db[_0x8bc4('0x2d')][_0x8bc4('0x48')]({'where':{'id':_0x56e07c[_0x8bc4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2577af,null))[_0x8bc4('0x25')](removeEntity(_0x2577af,null))[_0x8bc4('0x44')](handleError(_0x2577af,null));};exports[_0x8bc4('0x4c')]=function(_0x4493f0,_0x26e101){return db[_0x8bc4('0x2d')][_0x8bc4('0x4c')]()[_0x8bc4('0x25')](respondWithResult(_0x26e101,null))['catch'](handleError(_0x26e101,null));}; \ No newline at end of file +var _0xc072=['findAll','show','catch','create','body','update','find','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','apply','reject','save','then','end','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','SmsTransferReport','count','includeAll','include'];(function(_0x1b11af,_0x410836){var _0x9adfb1=function(_0xa58eb4){while(--_0xa58eb4){_0x1b11af['push'](_0x1b11af['shift']());}};_0x9adfb1(++_0x410836);}(_0xc072,0x97));var _0x2c07=function(_0x6af669,_0x2b7ac1){_0x6af669=_0x6af669-0x0;var _0x1933c9=_0xc072[_0x6af669];return _0x1933c9;};'use strict';var emlformat=require(_0x2c07('0x0'));var rimraf=require(_0x2c07('0x1'));var zipdir=require(_0x2c07('0x2'));var jsonpatch=require(_0x2c07('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2c07('0x4'));var Mustache=require('mustache');var util=require(_0x2c07('0x5'));var path=require(_0x2c07('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2c07('0x7'));var fs=require('fs');var fs_extra=require(_0x2c07('0x8'));var _=require(_0x2c07('0x9'));var squel=require(_0x2c07('0xa'));var crypto=require(_0x2c07('0xb'));var jsforce=require(_0x2c07('0xc'));var deskjs=require(_0x2c07('0xd'));var toCsv=require(_0x2c07('0xe'));var querystring=require(_0x2c07('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2c07('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c07('0x11'))(_0x2c07('0x12'));var utils=require(_0x2c07('0x13'));var config=require(_0x2c07('0x14'));var licenseUtil=require(_0x2c07('0x15'));var db=require(_0x2c07('0x16'))['db'];function respondWithStatusCode(_0x282f5e,_0x2d82a6){_0x2d82a6=_0x2d82a6||0xcc;return function(_0x3b06b4){if(_0x3b06b4){return _0x282f5e[_0x2c07('0x17')](_0x2d82a6);}return _0x282f5e[_0x2c07('0x18')](_0x2d82a6)['end']();};}function respondWithResult(_0x5a378a,_0x22889a){_0x22889a=_0x22889a||0xc8;return function(_0x4206d3){if(_0x4206d3){return _0x5a378a[_0x2c07('0x18')](_0x22889a)[_0x2c07('0x19')](_0x4206d3);}};}function respondWithFilteredResult(_0x9c7e0b,_0x4a061a){return function(_0x2f7ca8){if(_0x2f7ca8){var _0x5ea94e=typeof _0x4a061a[_0x2c07('0x1a')]===_0x2c07('0x1b')&&typeof _0x4a061a[_0x2c07('0x1c')]===_0x2c07('0x1b');var _0x5b17e8=_0x2f7ca8['count'];var _0x16801f=_0x5ea94e?0x0:_0x4a061a[_0x2c07('0x1a')];var _0x1766b7=_0x5ea94e?_0x2f7ca8['count']:_0x4a061a['offset']+_0x4a061a[_0x2c07('0x1c')];var _0x3899a0;if(_0x1766b7>=_0x5b17e8){_0x1766b7=_0x5b17e8;_0x3899a0=0xc8;}else{_0x3899a0=0xce;}_0x9c7e0b[_0x2c07('0x18')](_0x3899a0);return _0x9c7e0b[_0x2c07('0x1d')]('Content-Range',_0x16801f+'-'+_0x1766b7+'/'+_0x5b17e8)[_0x2c07('0x19')](_0x2f7ca8);}return null;};}function patchUpdates(_0x58f5b9){return function(_0x4252bb){try{jsonpatch[_0x2c07('0x1e')](_0x4252bb,_0x58f5b9,!![]);}catch(_0x157779){return BPromise[_0x2c07('0x1f')](_0x157779);}return _0x4252bb[_0x2c07('0x20')]();};}function saveUpdates(_0x5ed1e7,_0x13cb6e){return function(_0x5b0b04){if(_0x5b0b04){return _0x5b0b04['update'](_0x5ed1e7)[_0x2c07('0x21')](function(_0x41e6c0){return _0x41e6c0;});}return null;};}function removeEntity(_0x1b1504,_0x2bdbfe){return function(_0x357e7d){if(_0x357e7d){return _0x357e7d['destroy']()[_0x2c07('0x21')](function(){_0x1b1504[_0x2c07('0x18')](0xcc)[_0x2c07('0x22')]();});}};}function handleEntityNotFound(_0x220ef7,_0x490e01){return function(_0x36148d){if(!_0x36148d){_0x220ef7[_0x2c07('0x17')](0x194);}return _0x36148d;};}function handleError(_0x1ad0ca,_0x218afd){_0x218afd=_0x218afd||0x1f4;return function(_0x4538b7){logger[_0x2c07('0x23')](_0x4538b7['stack']);if(_0x4538b7[_0x2c07('0x24')]){delete _0x4538b7[_0x2c07('0x24')];}_0x1ad0ca['status'](_0x218afd)[_0x2c07('0x25')](_0x4538b7);};}exports[_0x2c07('0x26')]=function(_0x1276b0,_0x3573c8){var _0x5545e0={},_0x51d18b={},_0x2ea1e0={'count':0x0,'rows':[]};var _0x454333=_[_0x2c07('0x27')](db['SmsTransferReport'][_0x2c07('0x28')],function(_0x6f716c){return{'name':_0x6f716c[_0x2c07('0x29')],'type':_0x6f716c[_0x2c07('0x2a')]['key']};});_0x51d18b[_0x2c07('0x2b')]=_[_0x2c07('0x27')](_0x454333,_0x2c07('0x24'));_0x51d18b[_0x2c07('0x2c')]=_[_0x2c07('0x2d')](_0x1276b0[_0x2c07('0x2c')]);_0x51d18b[_0x2c07('0x2e')]=_[_0x2c07('0x2f')](_0x51d18b[_0x2c07('0x2b')],_0x51d18b[_0x2c07('0x2c')]);_0x5545e0[_0x2c07('0x30')]=_[_0x2c07('0x2f')](_0x51d18b[_0x2c07('0x2b')],qs['fields'](_0x1276b0[_0x2c07('0x2c')][_0x2c07('0x31')]));_0x5545e0[_0x2c07('0x30')]=_0x5545e0[_0x2c07('0x30')][_0x2c07('0x32')]?_0x5545e0[_0x2c07('0x30')]:_0x51d18b[_0x2c07('0x2b')];if(!_0x1276b0[_0x2c07('0x2c')]['hasOwnProperty']('nolimit')){_0x5545e0[_0x2c07('0x1c')]=qs[_0x2c07('0x1c')](_0x1276b0['query'][_0x2c07('0x1c')]);_0x5545e0[_0x2c07('0x1a')]=qs[_0x2c07('0x1a')](_0x1276b0['query']['offset']);}_0x5545e0['order']=qs['sort'](_0x1276b0['query'][_0x2c07('0x33')]);_0x5545e0[_0x2c07('0x34')]=qs['filters'](_[_0x2c07('0x35')](_0x1276b0['query'],_0x51d18b['filters']),_0x454333);if(_0x1276b0['query'][_0x2c07('0x36')]){_0x5545e0[_0x2c07('0x34')]=_[_0x2c07('0x37')](_0x5545e0['where'],{'$or':_['map'](_0x454333,function(_0x57b38d){if(_0x57b38d[_0x2c07('0x2a')]!==_0x2c07('0x38')){var _0x165cbb={};_0x165cbb[_0x57b38d[_0x2c07('0x24')]]={'$like':'%'+_0x1276b0[_0x2c07('0x2c')][_0x2c07('0x36')]+'%'};return _0x165cbb;}})});}_0x5545e0=_[_0x2c07('0x37')]({},_0x5545e0,_0x1276b0[_0x2c07('0x39')]);var _0x14ec21={'where':_0x5545e0['where']};return db[_0x2c07('0x3a')][_0x2c07('0x3b')](_0x14ec21)[_0x2c07('0x21')](function(_0x295322){_0x2ea1e0[_0x2c07('0x3b')]=_0x295322;if(_0x1276b0[_0x2c07('0x2c')][_0x2c07('0x3c')]){_0x5545e0[_0x2c07('0x3d')]=[{'all':!![]}];}return db[_0x2c07('0x3a')][_0x2c07('0x3e')](_0x5545e0);})['then'](function(_0x64fad1){_0x2ea1e0['rows']=_0x64fad1;return _0x2ea1e0;})[_0x2c07('0x21')](respondWithFilteredResult(_0x3573c8,_0x5545e0))['catch'](handleError(_0x3573c8,null));};exports[_0x2c07('0x3f')]=function(_0x40df24,_0x237d0f){var _0x1dad31={'raw':!![],'where':{'id':_0x40df24['params']['id']}},_0x292b23={};_0x292b23[_0x2c07('0x2b')]=_[_0x2c07('0x2d')](db[_0x2c07('0x3a')][_0x2c07('0x28')]);_0x292b23[_0x2c07('0x2c')]=_[_0x2c07('0x2d')](_0x40df24[_0x2c07('0x2c')]);_0x292b23['filters']=_['intersection'](_0x292b23[_0x2c07('0x2b')],_0x292b23[_0x2c07('0x2c')]);_0x1dad31[_0x2c07('0x30')]=_[_0x2c07('0x2f')](_0x292b23[_0x2c07('0x2b')],qs['fields'](_0x40df24[_0x2c07('0x2c')]['fields']));_0x1dad31[_0x2c07('0x30')]=_0x1dad31[_0x2c07('0x30')]['length']?_0x1dad31[_0x2c07('0x30')]:_0x292b23[_0x2c07('0x2b')];if(_0x40df24['query'][_0x2c07('0x3c')]){_0x1dad31[_0x2c07('0x3d')]=[{'all':!![]}];}_0x1dad31=_[_0x2c07('0x37')]({},_0x1dad31,_0x40df24[_0x2c07('0x39')]);return db['SmsTransferReport']['find'](_0x1dad31)[_0x2c07('0x21')](handleEntityNotFound(_0x237d0f,null))[_0x2c07('0x21')](respondWithResult(_0x237d0f,null))[_0x2c07('0x40')](handleError(_0x237d0f,null));};exports[_0x2c07('0x41')]=function(_0x1b0cd5,_0x37a8ba){return db['SmsTransferReport'][_0x2c07('0x41')](_0x1b0cd5[_0x2c07('0x42')],{})[_0x2c07('0x21')](respondWithResult(_0x37a8ba,0xc9))[_0x2c07('0x40')](handleError(_0x37a8ba,null));};exports[_0x2c07('0x43')]=function(_0x31ce25,_0x3397b9){if(_0x31ce25['body']['id']){delete _0x31ce25[_0x2c07('0x42')]['id'];}return db[_0x2c07('0x3a')][_0x2c07('0x44')]({'where':{'id':_0x31ce25[_0x2c07('0x45')]['id']}})[_0x2c07('0x21')](handleEntityNotFound(_0x3397b9,null))['then'](saveUpdates(_0x31ce25[_0x2c07('0x42')],null))[_0x2c07('0x21')](respondWithResult(_0x3397b9,null))[_0x2c07('0x40')](handleError(_0x3397b9,null));};exports[_0x2c07('0x46')]=function(_0x1f97e5,_0x274ddf){return db[_0x2c07('0x3a')]['find']({'where':{'id':_0x1f97e5[_0x2c07('0x45')]['id']}})[_0x2c07('0x21')](handleEntityNotFound(_0x274ddf,null))[_0x2c07('0x21')](removeEntity(_0x274ddf,null))[_0x2c07('0x40')](handleError(_0x274ddf,null));};exports['describe']=function(_0xb0934d,_0x523827){return db[_0x2c07('0x3a')]['describe']()[_0x2c07('0x21')](respondWithResult(_0x523827,null))[_0x2c07('0x40')](handleError(_0x523827,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index a1de696..ef60608 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 _0xfae2=['report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport'];(function(_0xddbccf,_0x2866e0){var _0xd001bf=function(_0x368c1c){while(--_0x368c1c){_0xddbccf['push'](_0xddbccf['shift']());}};_0xd001bf(++_0x2866e0);}(_0xfae2,0x152));var _0x2fae=function(_0x11bd81,_0x11fa4c){_0x11bd81=_0x11bd81-0x0;var _0x158de0=_0xfae2[_0x11bd81];return _0x158de0;};'use strict';var _=require(_0x2fae('0x0'));var util=require(_0x2fae('0x1'));var logger=require(_0x2fae('0x2'))(_0x2fae('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2fae('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2fae('0x5'));var config=require(_0x2fae('0x6'));var attributes=require(_0x2fae('0x7'));module[_0x2fae('0x8')]=function(_0x115bf4,_0x5f52b2){return _0x115bf4['define'](_0x2fae('0x9'),attributes,{'tableName':_0x2fae('0xa'),'paranoid':![],'indexes':[{'name':_0x2fae('0xb'),'fields':[_0x2fae('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0f93=['exports','define','SmsTransferReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes'];(function(_0x1f6b80,_0x2171e9){var _0x3140c5=function(_0x4cef7b){while(--_0x4cef7b){_0x1f6b80['push'](_0x1f6b80['shift']());}};_0x3140c5(++_0x2171e9);}(_0x0f93,0x66));var _0x30f9=function(_0x5292a0,_0x3e9acf){_0x5292a0=_0x5292a0-0x0;var _0x3522dc=_0x0f93[_0x5292a0];return _0x3522dc;};'use strict';var _=require('lodash');var util=require(_0x30f9('0x0'));var logger=require(_0x30f9('0x1'))(_0x30f9('0x2'));var moment=require(_0x30f9('0x3'));var BPromise=require(_0x30f9('0x4'));var rp=require(_0x30f9('0x5'));var fs=require('fs');var path=require(_0x30f9('0x6'));var rimraf=require(_0x30f9('0x7'));var config=require(_0x30f9('0x8'));var attributes=require(_0x30f9('0x9'));module[_0x30f9('0xa')]=function(_0x4d6276,_0xaad949){return _0x4d6276[_0x30f9('0xb')](_0x30f9('0xc'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x30f9('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index cc4605d..d3a5c6a 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 _0x67a2=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x67a2,0xd3));var _0x267a=function(_0x4b19be,_0x1e845d){_0x4b19be=_0x4b19be-0x0;var _0x50d81c=_0x67a2[_0x4b19be];return _0x50d81c;};'use strict';var _=require(_0x267a('0x0'));var util=require(_0x267a('0x1'));var moment=require('moment');var BPromise=require(_0x267a('0x2'));var rs=require(_0x267a('0x3'));var fs=require('fs');var Redis=require(_0x267a('0x4'));var db=require(_0x267a('0x5'))['db'];var utils=require(_0x267a('0x6'));var logger=require(_0x267a('0x7'))(_0x267a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x267a('0x9')][_0x267a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39d281,_0x4aac51,_0x1ac13e){return new BPromise(function(_0x4f1728,_0xe9ea73){return client[_0x267a('0xb')](_0x39d281,_0x1ac13e)[_0x267a('0xc')](function(_0x95a54e){logger[_0x267a('0xd')](_0x267a('0xe'),_0x4aac51,_0x267a('0xf'));logger['debug'](_0x267a('0x10'),_0x4aac51,_0x267a('0xf'),JSON[_0x267a('0x11')](_0x95a54e));if(_0x95a54e[_0x267a('0x12')]){if(_0x95a54e[_0x267a('0x12')][_0x267a('0x13')]===0x1f4){logger[_0x267a('0x12')](_0x267a('0xe'),_0x4aac51,_0x95a54e[_0x267a('0x12')][_0x267a('0x14')]);return _0xe9ea73(_0x95a54e[_0x267a('0x12')]['message']);}logger[_0x267a('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x4aac51,_0x95a54e[_0x267a('0x12')][_0x267a('0x14')]);return _0x4f1728(_0x95a54e[_0x267a('0x12')]['message']);}else{logger['info'](_0x267a('0xe'),_0x4aac51,_0x267a('0xf'));_0x4f1728(_0x95a54e[_0x267a('0x15')]['message']);}})[_0x267a('0x16')](function(_0x168d29){logger[_0x267a('0x12')](_0x267a('0xe'),_0x4aac51,_0x168d29);_0xe9ea73(_0x168d29);});});} \ No newline at end of file +var _0xea81=['rpc','../../config/environment','request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1a300b,_0x4af88f){var _0x31008d=function(_0x590ec9){while(--_0x590ec9){_0x1a300b['push'](_0x1a300b['shift']());}};_0x31008d(++_0x4af88f);}(_0xea81,0x1ed));var _0x1ea8=function(_0x3e8c23,_0x3e1887){_0x3e8c23=_0x3e8c23-0x0;var _0x3fa914=_0xea81[_0x3e8c23];return _0x3fa914;};'use strict';var _=require(_0x1ea8('0x0'));var util=require(_0x1ea8('0x1'));var moment=require(_0x1ea8('0x2'));var BPromise=require(_0x1ea8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ea8('0x4'))['db'];var utils=require(_0x1ea8('0x5'));var logger=require(_0x1ea8('0x6'))(_0x1ea8('0x7'));var config=require(_0x1ea8('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x28192b,_0x372fdc,_0x43404b){return new BPromise(function(_0x2140e8,_0x4ec13b){return client[_0x1ea8('0x9')](_0x28192b,_0x43404b)[_0x1ea8('0xa')](function(_0x35160b){logger[_0x1ea8('0xb')](_0x1ea8('0xc'),_0x372fdc,'request\x20sent');logger[_0x1ea8('0xd')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x372fdc,_0x1ea8('0xe'),JSON[_0x1ea8('0xf')](_0x35160b));if(_0x35160b[_0x1ea8('0x10')]){if(_0x35160b[_0x1ea8('0x10')][_0x1ea8('0x11')]===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x372fdc,_0x35160b[_0x1ea8('0x10')][_0x1ea8('0x12')]);return _0x4ec13b(_0x35160b['error'][_0x1ea8('0x12')]);}logger[_0x1ea8('0x10')](_0x1ea8('0xc'),_0x372fdc,_0x35160b[_0x1ea8('0x10')][_0x1ea8('0x12')]);return _0x2140e8(_0x35160b['error'][_0x1ea8('0x12')]);}else{logger[_0x1ea8('0xb')](_0x1ea8('0xc'),_0x372fdc,'request\x20sent');_0x2140e8(_0x35160b[_0x1ea8('0x13')][_0x1ea8('0x12')]);}})['catch'](function(_0x5c053a){logger[_0x1ea8('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x372fdc,_0x5c053a);_0x4ec13b(_0x5c053a);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 44cae39..28fb547 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 _0xe49b=['%s-%s%s','basename','extname','now','create','put','isAuthenticated','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xe49b,0x1ea));var _0xbe49=function(_0x577dca,_0x56276e){_0x577dca=_0x577dca-0x0;var _0x437647=_0xe49b[_0x577dca];return _0x437647;};'use strict';var multer=require(_0xbe49('0x0'));var util=require('util');var path=require(_0xbe49('0x1'));var timeout=require(_0xbe49('0x2'));var express=require('express');var router=express[_0xbe49('0x3')]();var fs_extra=require(_0xbe49('0x4'));var auth=require(_0xbe49('0x5'));var interaction=require(_0xbe49('0x6'));var config=require(_0xbe49('0x7'));var controller=require(_0xbe49('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xbe49('0x9')](_0xbe49('0xa'),auth['isAuthenticated'](),controller[_0xbe49('0xb')]);router[_0xbe49('0x9')](_0xbe49('0xc'),auth['isAuthenticated'](),controller[_0xbe49('0xd')]);var upload=multer({'storage':multer[_0xbe49('0xe')]({'destination':function(_0x4d95da,_0x8c2268,_0x58387c){_0x58387c(null,path[_0xbe49('0xf')](config[_0xbe49('0x10')],_0xbe49('0x11')));},'filename':function(_0x512790,_0x357a87,_0x2f6ba2){_0x357a87['originalname']=_0x357a87[_0xbe49('0x12')][_0xbe49('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2f6ba2(null,util['format'](_0xbe49('0x14'),path[_0xbe49('0x15')](_0x357a87[_0xbe49('0x12')],path[_0xbe49('0x16')](_0x357a87[_0xbe49('0x12')])),Date[_0xbe49('0x17')](),path[_0xbe49('0x16')](_0x357a87[_0xbe49('0x12')])));}})});router['post']('/',upload['single']('file'),controller[_0xbe49('0x18')]);router[_0xbe49('0x19')](_0xbe49('0xa'),auth[_0xbe49('0x1a')](),controller[_0xbe49('0x1b')]);router[_0xbe49('0x1c')]('/:id',auth[_0xbe49('0x1a')](),controller['delete']);module[_0xbe49('0x1d')]=router; \ No newline at end of file +var _0x45d0=['isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','single','file','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','index'];(function(_0x4b0880,_0x4d631b){var _0x2b1346=function(_0xd9cbf){while(--_0xd9cbf){_0x4b0880['push'](_0x4b0880['shift']());}};_0x2b1346(++_0x4d631b);}(_0x45d0,0x180));var _0x045d=function(_0x4b71e6,_0x1e3c78){_0x4b71e6=_0x4b71e6-0x0;var _0xf69192=_0x45d0[_0x4b71e6];return _0xf69192;};'use strict';var multer=require(_0x045d('0x0'));var util=require(_0x045d('0x1'));var path=require(_0x045d('0x2'));var timeout=require('connect-timeout');var express=require(_0x045d('0x3'));var router=express[_0x045d('0x4')]();var fs_extra=require(_0x045d('0x5'));var auth=require(_0x045d('0x6'));var interaction=require(_0x045d('0x7'));var config=require(_0x045d('0x8'));var controller=require(_0x045d('0x9'));router[_0x045d('0xa')]('/',auth['isAuthenticated'](),controller[_0x045d('0xb')]);router[_0x045d('0xa')]('/:id',auth[_0x045d('0xc')](),controller[_0x045d('0xd')]);router['get'](_0x045d('0xe'),auth[_0x045d('0xc')](),controller[_0x045d('0xf')]);var upload=multer({'storage':multer[_0x045d('0x10')]({'destination':function(_0x2acffc,_0x9b34de,_0x495329){_0x495329(null,path[_0x045d('0x11')](config[_0x045d('0x12')],_0x045d('0x13')));},'filename':function(_0x27bab8,_0xedd448,_0x4e3cd4){_0xedd448['originalname']=_0xedd448[_0x045d('0x14')][_0x045d('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4e3cd4(null,util['format'](_0x045d('0x16'),path[_0x045d('0x17')](_0xedd448[_0x045d('0x14')],path[_0x045d('0x18')](_0xedd448[_0x045d('0x14')])),Date[_0x045d('0x19')](),path[_0x045d('0x18')](_0xedd448[_0x045d('0x14')])));}})});router['post']('/',upload[_0x045d('0x1a')](_0x045d('0x1b')),controller[_0x045d('0x1c')]);router[_0x045d('0x1d')]('/:id',auth[_0x045d('0xc')](),controller[_0x045d('0x1e')]);router[_0x045d('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0x045d('0x1f')]);module[_0x045d('0x20')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 1dbcf6a..96c1207 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 _0x7ecd=['STRING','name','FLOAT','INTEGER','BIGINT','sequelize','exports'];(function(_0x50d8b2,_0x46f88d){var _0x2f9972=function(_0x4f728b){while(--_0x4f728b){_0x50d8b2['push'](_0x50d8b2['shift']());}};_0x2f9972(++_0x46f88d);}(_0x7ecd,0xb4));var _0xd7ec=function(_0x4490f0,_0x1443be){_0x4490f0=_0x4490f0-0x0;var _0x34ff58=_0x7ecd[_0x4490f0];return _0x34ff58;};'use strict';var Sequelize=require(_0xd7ec('0x0'));module[_0xd7ec('0x1')]={'name':{'type':Sequelize[_0xd7ec('0x2')],'unique':_0xd7ec('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xd7ec('0x2')]},'display_name':{'type':Sequelize[_0xd7ec('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xd7ec('0x2')]},'original_duration':{'type':Sequelize[_0xd7ec('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xd7ec('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xd7ec('0x5')]},'converted_format':{'type':Sequelize[_0xd7ec('0x2')]},'converted_duration':{'type':Sequelize[_0xd7ec('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xd7ec('0x6')]},'converted_sampleRate':{'type':Sequelize[_0xd7ec('0x5')]}}; \ No newline at end of file +var _0xecd9=['INTEGER','sequelize','exports','STRING','name','BIGINT'];(function(_0x37ecca,_0xe415cc){var _0x5e3a33=function(_0x56b3af){while(--_0x56b3af){_0x37ecca['push'](_0x37ecca['shift']());}};_0x5e3a33(++_0xe415cc);}(_0xecd9,0x13f));var _0x9ecd=function(_0x561299,_0xe96fa1){_0x561299=_0x561299-0x0;var _0x3a7ad3=_0xecd9[_0x561299];return _0x3a7ad3;};'use strict';var Sequelize=require(_0x9ecd('0x0'));module[_0x9ecd('0x1')]={'name':{'type':Sequelize[_0x9ecd('0x2')],'unique':_0x9ecd('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x9ecd('0x2')]},'display_name':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x9ecd('0x2')]},'original_format':{'type':Sequelize[_0x9ecd('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x9ecd('0x4')]},'original_channelCount':{'type':Sequelize[_0x9ecd('0x5')]},'original_bitRate':{'type':Sequelize[_0x9ecd('0x4')]},'original_sampleRate':{'type':Sequelize[_0x9ecd('0x5')]},'converted_format':{'type':Sequelize[_0x9ecd('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x9ecd('0x4')]},'converted_channelCount':{'type':Sequelize[_0x9ecd('0x5')]},'converted_bitRate':{'type':Sequelize[_0x9ecd('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x9ecd('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 0521b90..1b7f94e 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 _0x53f6=['info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','body','userProfileId','role','user','UserProfileSection','Sounds','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','send','params','description','delete','server/files/sounds/original','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','status','Content-Range','apply','update','destroy','then','get','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Sound','findAll','rows','show','find','download','save_name','join','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','root','format','%s.%s','catch','create','basename','originalname','extname','file','filename','substring','wav'];(function(_0x36ce5b,_0xbe9833){var _0xda5232=function(_0x211bbf){while(--_0x211bbf){_0x36ce5b['push'](_0x36ce5b['shift']());}};_0xda5232(++_0xbe9833);}(_0x53f6,0x19e));var _0x653f=function(_0x59d546,_0x107f05){_0x59d546=_0x59d546-0x0;var _0x41fbdb=_0x53f6[_0x59d546];return _0x41fbdb;};'use strict';var emlformat=require(_0x653f('0x0'));var rimraf=require(_0x653f('0x1'));var zipdir=require(_0x653f('0x2'));var jsonpatch=require(_0x653f('0x3'));var rp=require(_0x653f('0x4'));var moment=require('moment');var BPromise=require(_0x653f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x653f('0x6'));var sox=require(_0x653f('0x7'));var csv=require(_0x653f('0x8'));var ejs=require(_0x653f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x653f('0xa'));var crypto=require(_0x653f('0xb'));var jsforce=require(_0x653f('0xc'));var deskjs=require(_0x653f('0xd'));var toCsv=require(_0x653f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x653f('0xe'));var authService=require(_0x653f('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x653f('0x10'))(_0x653f('0x11'));var utils=require(_0x653f('0x12'));var config=require(_0x653f('0x13'));var licenseUtil=require(_0x653f('0x14'));var db=require(_0x653f('0x15'))['db'];function respondWithStatusCode(_0x396085,_0x3a2413){_0x3a2413=_0x3a2413||0xcc;return function(_0x57fb86){if(_0x57fb86){return _0x396085['sendStatus'](_0x3a2413);}return _0x396085['status'](_0x3a2413)[_0x653f('0x16')]();};}function respondWithResult(_0x485cd1,_0x397cea){_0x397cea=_0x397cea||0xc8;return function(_0x4851e4){if(_0x4851e4){return _0x485cd1['status'](_0x397cea)[_0x653f('0x17')](_0x4851e4);}};}function respondWithFilteredResult(_0x201811,_0xf6b113){return function(_0x583f87){if(_0x583f87){var _0x21f233=typeof _0xf6b113[_0x653f('0x18')]===_0x653f('0x19')&&typeof _0xf6b113['limit']===_0x653f('0x19');var _0x5f2add=_0x583f87[_0x653f('0x1a')];var _0x2c2ae9=_0x21f233?0x0:_0xf6b113[_0x653f('0x18')];var _0x43f443=_0x21f233?_0x583f87[_0x653f('0x1a')]:_0xf6b113['offset']+_0xf6b113['limit'];var _0x46e8d6;if(_0x43f443>=_0x5f2add){_0x43f443=_0x5f2add;_0x46e8d6=0xc8;}else{_0x46e8d6=0xce;}_0x201811[_0x653f('0x1b')](_0x46e8d6);return _0x201811['set'](_0x653f('0x1c'),_0x2c2ae9+'-'+_0x43f443+'/'+_0x5f2add)[_0x653f('0x17')](_0x583f87);}return null;};}function patchUpdates(_0x194323){return function(_0x100fe2){try{jsonpatch[_0x653f('0x1d')](_0x100fe2,_0x194323,!![]);}catch(_0xe62234){return BPromise['reject'](_0xe62234);}return _0x100fe2['save']();};}function saveUpdates(_0x229b25,_0x33653b){return function(_0x1e6839){if(_0x1e6839){return _0x1e6839[_0x653f('0x1e')](_0x229b25)['then'](function(_0xb5d7c0){return _0xb5d7c0;});}return null;};}function removeEntity(_0x4e3e35,_0x411b97){return function(_0x360c40){if(_0x360c40){return _0x360c40[_0x653f('0x1f')]()[_0x653f('0x20')](function(){var _0xbb3514=_0x360c40[_0x653f('0x21')]({'plain':!![]});var _0x49d1fe='Sounds';return db['UserProfileResource'][_0x653f('0x1f')]({'where':{'type':_0x49d1fe,'resourceId':_0xbb3514['id']}})[_0x653f('0x20')](function(){return _0x360c40;});})['then'](function(){_0x4e3e35[_0x653f('0x1b')](0xcc)[_0x653f('0x16')]();});}};}function handleEntityNotFound(_0x46354c,_0xb64a3f){return function(_0x22b0c0){if(!_0x22b0c0){_0x46354c[_0x653f('0x22')](0x194);}return _0x22b0c0;};}function handleError(_0x2ff9d2,_0x5d3613){_0x5d3613=_0x5d3613||0x1f4;return function(_0x208e25){logger[_0x653f('0x23')](_0x208e25[_0x653f('0x24')]);if(_0x208e25[_0x653f('0x25')]){delete _0x208e25[_0x653f('0x25')];}_0x2ff9d2['status'](_0x5d3613)['send'](_0x208e25);};}exports[_0x653f('0x26')]=function(_0x477ca0,_0x4a6337){var _0x5ce071={},_0x616ffd={},_0x5ad9a7={'count':0x0,'rows':[]};var _0x57d11f=_[_0x653f('0x27')](db['Sound'][_0x653f('0x28')],function(_0x14517c){return{'name':_0x14517c[_0x653f('0x29')],'type':_0x14517c[_0x653f('0x2a')][_0x653f('0x2b')]};});_0x616ffd[_0x653f('0x2c')]=_['map'](_0x57d11f,'name');_0x616ffd[_0x653f('0x2d')]=_[_0x653f('0x2e')](_0x477ca0[_0x653f('0x2d')]);_0x616ffd[_0x653f('0x2f')]=_[_0x653f('0x30')](_0x616ffd['model'],_0x616ffd[_0x653f('0x2d')]);_0x5ce071[_0x653f('0x31')]=_[_0x653f('0x30')](_0x616ffd[_0x653f('0x2c')],qs[_0x653f('0x32')](_0x477ca0[_0x653f('0x2d')][_0x653f('0x32')]));_0x5ce071[_0x653f('0x31')]=_0x5ce071[_0x653f('0x31')][_0x653f('0x33')]?_0x5ce071[_0x653f('0x31')]:_0x616ffd[_0x653f('0x2c')];if(!_0x477ca0[_0x653f('0x2d')][_0x653f('0x34')](_0x653f('0x35'))){_0x5ce071[_0x653f('0x36')]=qs['limit'](_0x477ca0[_0x653f('0x2d')][_0x653f('0x36')]);_0x5ce071['offset']=qs[_0x653f('0x18')](_0x477ca0[_0x653f('0x2d')]['offset']);}_0x5ce071[_0x653f('0x37')]=qs[_0x653f('0x38')](_0x477ca0['query'][_0x653f('0x38')]);_0x5ce071[_0x653f('0x39')]=qs['filters'](_[_0x653f('0x3a')](_0x477ca0[_0x653f('0x2d')],_0x616ffd[_0x653f('0x2f')]),_0x57d11f);if(_0x477ca0[_0x653f('0x2d')][_0x653f('0x3b')]){_0x5ce071[_0x653f('0x39')]=_[_0x653f('0x3c')](_0x5ce071[_0x653f('0x39')],{'$or':_[_0x653f('0x27')](_0x57d11f,function(_0x1ae5a2){if(_0x1ae5a2[_0x653f('0x2a')]!==_0x653f('0x3d')){var _0x2e1d6b={};_0x2e1d6b[_0x1ae5a2['name']]={'$like':'%'+_0x477ca0['query'][_0x653f('0x3b')]+'%'};return _0x2e1d6b;}})});}_0x5ce071=_['merge']({},_0x5ce071,_0x477ca0[_0x653f('0x3e')]);var _0x3579c6={'where':_0x5ce071[_0x653f('0x39')]};return db['Sound'][_0x653f('0x1a')](_0x3579c6)['then'](function(_0x1ebe57){_0x5ad9a7[_0x653f('0x1a')]=_0x1ebe57;if(_0x477ca0[_0x653f('0x2d')][_0x653f('0x3f')]){_0x5ce071[_0x653f('0x40')]=[{'all':!![]}];}return db[_0x653f('0x41')][_0x653f('0x42')](_0x5ce071);})['then'](function(_0x3f3007){_0x5ad9a7[_0x653f('0x43')]=_0x3f3007;return _0x5ad9a7;})['then'](respondWithFilteredResult(_0x4a6337,_0x5ce071))['catch'](handleError(_0x4a6337,null));};exports[_0x653f('0x44')]=function(_0x222f2e,_0x52ce30){var _0x2bef8e={'raw':!![],'where':{'id':_0x222f2e['params']['id']}},_0x29e0f9={};_0x29e0f9['model']=_[_0x653f('0x2e')](db[_0x653f('0x41')][_0x653f('0x28')]);_0x29e0f9[_0x653f('0x2d')]=_['keys'](_0x222f2e[_0x653f('0x2d')]);_0x29e0f9[_0x653f('0x2f')]=_['intersection'](_0x29e0f9[_0x653f('0x2c')],_0x29e0f9['query']);_0x2bef8e[_0x653f('0x31')]=_[_0x653f('0x30')](_0x29e0f9[_0x653f('0x2c')],qs[_0x653f('0x32')](_0x222f2e['query'][_0x653f('0x32')]));_0x2bef8e[_0x653f('0x31')]=_0x2bef8e['attributes']['length']?_0x2bef8e[_0x653f('0x31')]:_0x29e0f9[_0x653f('0x2c')];if(_0x222f2e[_0x653f('0x2d')]['includeAll']){_0x2bef8e[_0x653f('0x40')]=[{'all':!![]}];}_0x2bef8e=_['merge']({},_0x2bef8e,_0x222f2e['options']);return db[_0x653f('0x41')][_0x653f('0x45')](_0x2bef8e)[_0x653f('0x20')](handleEntityNotFound(_0x52ce30,null))[_0x653f('0x20')](respondWithResult(_0x52ce30,null))['catch'](handleError(_0x52ce30,null));};exports[_0x653f('0x46')]=function(_0x3d9095,_0xd74ebe,_0x473b9c){return db[_0x653f('0x41')][_0x653f('0x45')]({'where':{'id':_0x3d9095['params']['id']},'attributes':[_0x653f('0x25'),_0x653f('0x47'),'converted_format'],'raw':!![]})[_0x653f('0x20')](handleEntityNotFound(_0xd74ebe,null))[_0x653f('0x20')](function(_0x137981){if(_0x137981){if(!fs['existsSync'](path[_0x653f('0x48')](config['root'],_0x653f('0x49'),_0x137981[_0x653f('0x47')]+'.'+_0x137981[_0x653f('0x4a')]))){throw new db[(_0x653f('0x4b'))][(_0x653f('0x4c'))](_0x653f('0x4d'));}return _0xd74ebe[_0x653f('0x46')](path['join'](config[_0x653f('0x4e')],_0x653f('0x49'),util[_0x653f('0x4f')](_0x653f('0x50'),_0x137981[_0x653f('0x47')],_0x137981[_0x653f('0x4a')])),util[_0x653f('0x4f')](_0x653f('0x50'),_0x137981[_0x653f('0x25')],_0x137981[_0x653f('0x4a')]));}return null;})[_0x653f('0x51')](handleError(_0xd74ebe,null));};exports[_0x653f('0x52')]=function(_0x5eddf0,_0x4d09e9,_0x3c0a68){var _0x55d910={'name':path[_0x653f('0x53')](_0x5eddf0['file'][_0x653f('0x54')],path[_0x653f('0x55')](_0x5eddf0['file']['originalname'])),'save_name':path[_0x653f('0x53')](_0x5eddf0[_0x653f('0x56')][_0x653f('0x57')],path[_0x653f('0x55')](_0x5eddf0[_0x653f('0x56')][_0x653f('0x57')])),'original_format':path[_0x653f('0x55')](_0x5eddf0[_0x653f('0x56')][_0x653f('0x54')])[_0x653f('0x58')](0x1),'converted_format':_0x653f('0x59')};var _0x3b859d=path[_0x653f('0x48')](config['root'],'server/files/sounds/original',_0x5eddf0[_0x653f('0x56')]['filename']);var _0x406aae=path[_0x653f('0x48')](config[_0x653f('0x4e')],'server/files/sounds/converted',util[_0x653f('0x4f')](_0x653f('0x50'),path['basename'](_0x5eddf0[_0x653f('0x56')][_0x653f('0x57')],path[_0x653f('0x55')](_0x5eddf0[_0x653f('0x56')][_0x653f('0x57')])),_0x55d910[_0x653f('0x4a')]));logger[_0x653f('0x5a')](_0x653f('0x5b'),_0x3b859d);logger[_0x653f('0x5a')]('Sound\x20upload\x20destination:\x20%s',_0x406aae);try{fs[_0x653f('0x5c')](_0x3b859d,parseInt(_0x653f('0x5d'),0x8));var _0x36439a=sox[_0x653f('0x5e')](_0x3b859d,_0x406aae,{'sampleRate':0x1f40,'format':_0x653f('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x36439a['on'](_0x653f('0x23'),function(_0x5245cb){fs[_0x653f('0x5f')](_0x3b859d);_0x4d09e9['status'](0x1f4)['send'](_0x5245cb);});_0x36439a['on'](_0x653f('0x60'),function(_0x16fd4d){_0x55d910[_0x653f('0x61')]=isNaN(_0x16fd4d[_0x653f('0x62')])?null:_0x16fd4d[_0x653f('0x62')]*0x3e8;_0x55d910[_0x653f('0x63')]=isNaN(_0x16fd4d[_0x653f('0x64')])?null:_0x16fd4d[_0x653f('0x64')];_0x55d910[_0x653f('0x65')]=isNaN(_0x16fd4d[_0x653f('0x66')])?null:_0x16fd4d['channelCount'];_0x55d910['original_bitRate']=isNaN(_0x16fd4d[_0x653f('0x67')])?null:_0x16fd4d[_0x653f('0x67')];_0x55d910[_0x653f('0x68')]=isNaN(_0x16fd4d[_0x653f('0x69')])?null:_0x16fd4d[_0x653f('0x69')];});_0x36439a['on'](_0x653f('0x6a'),function(_0x29c657){_0x55d910[_0x653f('0x6b')]=isNaN(_0x29c657[_0x653f('0x62')])?null:_0x29c657[_0x653f('0x62')]*0x3e8;_0x55d910[_0x653f('0x6c')]=isNaN(_0x29c657['sampleCount'])?null:_0x29c657[_0x653f('0x64')];_0x55d910[_0x653f('0x6d')]=isNaN(_0x29c657[_0x653f('0x66')])?null:_0x29c657[_0x653f('0x66')];_0x55d910['converted_bitRate']=isNaN(_0x29c657[_0x653f('0x67')])?null:_0x29c657[_0x653f('0x67')];_0x55d910['converted_sampleRate']=isNaN(_0x29c657[_0x653f('0x69')])?null:_0x29c657[_0x653f('0x69')];});_0x36439a['on'](_0x653f('0x16'),function(){fs[_0x653f('0x5c')](_0x406aae,parseInt(_0x653f('0x5d'),0x8));return db['Sound']['create'](_0x55d910)[_0x653f('0x20')](function(_0x579acf){var _0x58bc83={'role':_0x5eddf0[_0x653f('0x6e')]['role'],'userProfileId':_0x5eddf0['body'][_0x653f('0x6f')]};if(!_0x58bc83)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58bc83[_0x653f('0x70')]===_0x653f('0x71')){var _0x684205=_0x579acf['get']({'plain':!![]});return db[_0x653f('0x72')]['find']({'where':{'name':_0x653f('0x73'),'userProfileId':_0x58bc83[_0x653f('0x6f')]},'raw':!![]})[_0x653f('0x20')](function(_0x929c84){if(_0x929c84&&_0x929c84[_0x653f('0x74')]===0x0){return db[_0x653f('0x75')][_0x653f('0x52')]({'name':_0x684205[_0x653f('0x25')],'resourceId':_0x684205['id'],'type':_0x929c84[_0x653f('0x25')],'sectionId':_0x929c84['id']},{})[_0x653f('0x20')](function(){return _0x579acf;});}else{return _0x579acf;}})[_0x653f('0x51')](function(_0x415427){logger['error'](_0x653f('0x76'),_0x415427);throw _0x415427;});}return _0x579acf;})['then'](respondWithResult(_0x4d09e9,null))[_0x653f('0x51')](handleError(_0x4d09e9,null));});_0x36439a[_0x653f('0x77')]();}catch(_0x302da6){_0x4d09e9[_0x653f('0x1b')](0x1f4)[_0x653f('0x78')](_0x302da6);}};exports[_0x653f('0x1e')]=function(_0x340900,_0x1a3173,_0x1044af){return db[_0x653f('0x41')][_0x653f('0x45')]({'where':{'id':_0x340900[_0x653f('0x79')]['id']}})[_0x653f('0x20')](handleEntityNotFound(_0x1a3173,null))[_0x653f('0x20')](saveUpdates(_['pick'](_0x340900[_0x653f('0x6e')],['name',_0x653f('0x7a')]),null))[_0x653f('0x20')](respondWithResult(_0x1a3173,null))[_0x653f('0x51')](handleError(_0x1a3173,null));};exports[_0x653f('0x7b')]=function(_0x1b7a83,_0x2dc63a,_0x425a1e){return db[_0x653f('0x41')][_0x653f('0x45')]({'where':{'id':_0x1b7a83[_0x653f('0x79')]['id']}})[_0x653f('0x20')](function(_0x1af673){if(_0x1af673){return _0x1af673[_0x653f('0x1f')]();}})[_0x653f('0x20')](function(_0x324094){var _0x107b22=path[_0x653f('0x48')](config['root'],_0x653f('0x7c'),util[_0x653f('0x4f')](_0x653f('0x50'),_0x324094['save_name'],_0x324094[_0x653f('0x7d')]));var _0x134bb7=path[_0x653f('0x48')](config[_0x653f('0x4e')],_0x653f('0x49'),util['format'](_0x653f('0x50'),_0x324094[_0x653f('0x47')],_0x324094[_0x653f('0x4a')]));fs[_0x653f('0x5f')](_0x107b22);fs[_0x653f('0x5f')](_0x134bb7);return _0x324094;})[_0x653f('0x20')](function(_0x37f1e7){if(_0x37f1e7){return _0x2dc63a[_0x653f('0x1b')](0xcc)[_0x653f('0x16')]();}})[_0x653f('0x20')](handleEntityNotFound(_0x2dc63a,null))[_0x653f('0x51')](handleError(_0x2dc63a,null));}; \ No newline at end of file +var _0x9930=['reject','update','then','destroy','Sounds','stack','name','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','download','save_name','converted_format','root','server/files/sounds/converted','Sequelize','ValidationError','format','%s.%s','create','basename','originalname','extname','file','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','delete','join','original_format','eml-format','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply'];(function(_0x4263fb,_0x55f77b){var _0x19776b=function(_0x5765c5){while(--_0x5765c5){_0x4263fb['push'](_0x4263fb['shift']());}};_0x19776b(++_0x55f77b);}(_0x9930,0x148));var _0x0993=function(_0x3b3d1c,_0x3ce052){_0x3b3d1c=_0x3b3d1c-0x0;var _0x383ad7=_0x9930[_0x3b3d1c];return _0x383ad7;};'use strict';var emlformat=require(_0x0993('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0993('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0993('0x2'));var Mustache=require('mustache');var util=require(_0x0993('0x3'));var path=require(_0x0993('0x4'));var sox=require(_0x0993('0x5'));var csv=require(_0x0993('0x6'));var ejs=require(_0x0993('0x7'));var fs=require('fs');var fs_extra=require(_0x0993('0x8'));var _=require(_0x0993('0x9'));var squel=require(_0x0993('0xa'));var crypto=require(_0x0993('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0993('0xc'));var toCsv=require(_0x0993('0x6'));var querystring=require(_0x0993('0xd'));var Papa=require('papaparse');var Redis=require(_0x0993('0xe'));var authService=require(_0x0993('0xf'));var qs=require(_0x0993('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0993('0x11'));var logger=require(_0x0993('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x0993('0x13'));var licenseUtil=require(_0x0993('0x14'));var db=require(_0x0993('0x15'))['db'];function respondWithStatusCode(_0x12c5cc,_0x2978dc){_0x2978dc=_0x2978dc||0xcc;return function(_0x5daa9a){if(_0x5daa9a){return _0x12c5cc[_0x0993('0x16')](_0x2978dc);}return _0x12c5cc[_0x0993('0x17')](_0x2978dc)[_0x0993('0x18')]();};}function respondWithResult(_0x371265,_0x5c9605){_0x5c9605=_0x5c9605||0xc8;return function(_0x4ce7c2){if(_0x4ce7c2){return _0x371265[_0x0993('0x17')](_0x5c9605)[_0x0993('0x19')](_0x4ce7c2);}};}function respondWithFilteredResult(_0x25b234,_0x5ddc0b){return function(_0x1b54d2){if(_0x1b54d2){var _0x23f8d0=typeof _0x5ddc0b[_0x0993('0x1a')]===_0x0993('0x1b')&&typeof _0x5ddc0b['limit']===_0x0993('0x1b');var _0x399ca6=_0x1b54d2[_0x0993('0x1c')];var _0x592997=_0x23f8d0?0x0:_0x5ddc0b[_0x0993('0x1a')];var _0x4e6557=_0x23f8d0?_0x1b54d2[_0x0993('0x1c')]:_0x5ddc0b[_0x0993('0x1a')]+_0x5ddc0b[_0x0993('0x1d')];var _0x2498f4;if(_0x4e6557>=_0x399ca6){_0x4e6557=_0x399ca6;_0x2498f4=0xc8;}else{_0x2498f4=0xce;}_0x25b234[_0x0993('0x17')](_0x2498f4);return _0x25b234['set'](_0x0993('0x1e'),_0x592997+'-'+_0x4e6557+'/'+_0x399ca6)['json'](_0x1b54d2);}return null;};}function patchUpdates(_0x40e973){return function(_0x4a9368){try{jsonpatch[_0x0993('0x1f')](_0x4a9368,_0x40e973,!![]);}catch(_0x2ddaca){return BPromise[_0x0993('0x20')](_0x2ddaca);}return _0x4a9368['save']();};}function saveUpdates(_0x51ebc3,_0x40b936){return function(_0x5f32cc){if(_0x5f32cc){return _0x5f32cc[_0x0993('0x21')](_0x51ebc3)[_0x0993('0x22')](function(_0x33a231){return _0x33a231;});}return null;};}function removeEntity(_0x2fbf11,_0x5669bc){return function(_0x1fe793){if(_0x1fe793){return _0x1fe793[_0x0993('0x23')]()[_0x0993('0x22')](function(){var _0x4cb42e=_0x1fe793['get']({'plain':!![]});var _0x3042a8=_0x0993('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x3042a8,'resourceId':_0x4cb42e['id']}})['then'](function(){return _0x1fe793;});})['then'](function(){_0x2fbf11[_0x0993('0x17')](0xcc)[_0x0993('0x18')]();});}};}function handleEntityNotFound(_0x1b2839,_0xe1875b){return function(_0x498896){if(!_0x498896){_0x1b2839[_0x0993('0x16')](0x194);}return _0x498896;};}function handleError(_0x32ee49,_0x12e2b5){_0x12e2b5=_0x12e2b5||0x1f4;return function(_0x1dc9a3){logger['error'](_0x1dc9a3[_0x0993('0x25')]);if(_0x1dc9a3[_0x0993('0x26')]){delete _0x1dc9a3[_0x0993('0x26')];}_0x32ee49[_0x0993('0x17')](_0x12e2b5)['send'](_0x1dc9a3);};}exports[_0x0993('0x27')]=function(_0x44cbe5,_0x5d1bda){var _0x51a514={},_0x1edc8d={},_0x12cd4d={'count':0x0,'rows':[]};var _0x277b02=_[_0x0993('0x28')](db[_0x0993('0x29')][_0x0993('0x2a')],function(_0x9da03c){return{'name':_0x9da03c[_0x0993('0x2b')],'type':_0x9da03c[_0x0993('0x2c')][_0x0993('0x2d')]};});_0x1edc8d[_0x0993('0x2e')]=_[_0x0993('0x28')](_0x277b02,_0x0993('0x26'));_0x1edc8d[_0x0993('0x2f')]=_[_0x0993('0x30')](_0x44cbe5[_0x0993('0x2f')]);_0x1edc8d['filters']=_[_0x0993('0x31')](_0x1edc8d[_0x0993('0x2e')],_0x1edc8d[_0x0993('0x2f')]);_0x51a514[_0x0993('0x32')]=_[_0x0993('0x31')](_0x1edc8d[_0x0993('0x2e')],qs[_0x0993('0x33')](_0x44cbe5[_0x0993('0x2f')][_0x0993('0x33')]));_0x51a514['attributes']=_0x51a514['attributes'][_0x0993('0x34')]?_0x51a514['attributes']:_0x1edc8d[_0x0993('0x2e')];if(!_0x44cbe5[_0x0993('0x2f')][_0x0993('0x35')](_0x0993('0x36'))){_0x51a514[_0x0993('0x1d')]=qs[_0x0993('0x1d')](_0x44cbe5[_0x0993('0x2f')][_0x0993('0x1d')]);_0x51a514[_0x0993('0x1a')]=qs[_0x0993('0x1a')](_0x44cbe5[_0x0993('0x2f')][_0x0993('0x1a')]);}_0x51a514['order']=qs['sort'](_0x44cbe5[_0x0993('0x2f')][_0x0993('0x37')]);_0x51a514[_0x0993('0x38')]=qs['filters'](_[_0x0993('0x39')](_0x44cbe5[_0x0993('0x2f')],_0x1edc8d[_0x0993('0x3a')]),_0x277b02);if(_0x44cbe5[_0x0993('0x2f')][_0x0993('0x3b')]){_0x51a514['where']=_['merge'](_0x51a514[_0x0993('0x38')],{'$or':_['map'](_0x277b02,function(_0x3ffda4){if(_0x3ffda4[_0x0993('0x2c')]!=='VIRTUAL'){var _0xdf7ec2={};_0xdf7ec2[_0x3ffda4[_0x0993('0x26')]]={'$like':'%'+_0x44cbe5['query']['filter']+'%'};return _0xdf7ec2;}})});}_0x51a514=_[_0x0993('0x3c')]({},_0x51a514,_0x44cbe5[_0x0993('0x3d')]);var _0x1b0370={'where':_0x51a514[_0x0993('0x38')]};return db[_0x0993('0x29')][_0x0993('0x1c')](_0x1b0370)[_0x0993('0x22')](function(_0x16dcd8){_0x12cd4d['count']=_0x16dcd8;if(_0x44cbe5['query'][_0x0993('0x3e')]){_0x51a514[_0x0993('0x3f')]=[{'all':!![]}];}return db['Sound'][_0x0993('0x40')](_0x51a514);})[_0x0993('0x22')](function(_0x4091b8){_0x12cd4d[_0x0993('0x41')]=_0x4091b8;return _0x12cd4d;})['then'](respondWithFilteredResult(_0x5d1bda,_0x51a514))[_0x0993('0x42')](handleError(_0x5d1bda,null));};exports[_0x0993('0x43')]=function(_0x4c260b,_0x6a0187){var _0x147171={'raw':!![],'where':{'id':_0x4c260b[_0x0993('0x44')]['id']}},_0x45af98={};_0x45af98[_0x0993('0x2e')]=_['keys'](db[_0x0993('0x29')][_0x0993('0x2a')]);_0x45af98[_0x0993('0x2f')]=_['keys'](_0x4c260b[_0x0993('0x2f')]);_0x45af98['filters']=_[_0x0993('0x31')](_0x45af98[_0x0993('0x2e')],_0x45af98[_0x0993('0x2f')]);_0x147171[_0x0993('0x32')]=_['intersection'](_0x45af98[_0x0993('0x2e')],qs[_0x0993('0x33')](_0x4c260b[_0x0993('0x2f')]['fields']));_0x147171[_0x0993('0x32')]=_0x147171[_0x0993('0x32')][_0x0993('0x34')]?_0x147171[_0x0993('0x32')]:_0x45af98[_0x0993('0x2e')];if(_0x4c260b[_0x0993('0x2f')][_0x0993('0x3e')]){_0x147171[_0x0993('0x3f')]=[{'all':!![]}];}_0x147171=_[_0x0993('0x3c')]({},_0x147171,_0x4c260b['options']);return db[_0x0993('0x29')][_0x0993('0x45')](_0x147171)['then'](handleEntityNotFound(_0x6a0187,null))['then'](respondWithResult(_0x6a0187,null))[_0x0993('0x42')](handleError(_0x6a0187,null));};exports[_0x0993('0x46')]=function(_0x356848,_0xecc8ba,_0x1a3d84){return db[_0x0993('0x29')]['find']({'where':{'id':_0x356848['params']['id']},'attributes':[_0x0993('0x26'),_0x0993('0x47'),_0x0993('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0xecc8ba,null))['then'](function(_0x3e3ae6){if(_0x3e3ae6){if(!fs['existsSync'](path['join'](config[_0x0993('0x49')],_0x0993('0x4a'),_0x3e3ae6[_0x0993('0x47')]+'.'+_0x3e3ae6[_0x0993('0x48')]))){throw new db[(_0x0993('0x4b'))][(_0x0993('0x4c'))]('Sound\x20not\x20found');}return _0xecc8ba[_0x0993('0x46')](path['join'](config[_0x0993('0x49')],'server/files/sounds/converted',util[_0x0993('0x4d')](_0x0993('0x4e'),_0x3e3ae6[_0x0993('0x47')],_0x3e3ae6[_0x0993('0x48')])),util[_0x0993('0x4d')](_0x0993('0x4e'),_0x3e3ae6[_0x0993('0x26')],_0x3e3ae6[_0x0993('0x48')]));}return null;})[_0x0993('0x42')](handleError(_0xecc8ba,null));};exports[_0x0993('0x4f')]=function(_0x29c439,_0x55471b,_0x1f2dec){var _0x544fa9={'name':path[_0x0993('0x50')](_0x29c439['file'][_0x0993('0x51')],path[_0x0993('0x52')](_0x29c439[_0x0993('0x53')][_0x0993('0x51')])),'save_name':path[_0x0993('0x50')](_0x29c439[_0x0993('0x53')][_0x0993('0x54')],path['extname'](_0x29c439[_0x0993('0x53')][_0x0993('0x54')])),'original_format':path[_0x0993('0x52')](_0x29c439[_0x0993('0x53')]['originalname'])['substring'](0x1),'converted_format':_0x0993('0x55')};var _0x420577=path['join'](config[_0x0993('0x49')],_0x0993('0x56'),_0x29c439[_0x0993('0x53')][_0x0993('0x54')]);var _0x16268c=path['join'](config[_0x0993('0x49')],_0x0993('0x4a'),util[_0x0993('0x4d')](_0x0993('0x4e'),path[_0x0993('0x50')](_0x29c439[_0x0993('0x53')]['filename'],path['extname'](_0x29c439[_0x0993('0x53')][_0x0993('0x54')])),_0x544fa9[_0x0993('0x48')]));logger[_0x0993('0x57')](_0x0993('0x58'),_0x420577);logger[_0x0993('0x57')](_0x0993('0x59'),_0x16268c);try{fs[_0x0993('0x5a')](_0x420577,parseInt(_0x0993('0x5b'),0x8));var _0x1b9211=sox[_0x0993('0x5c')](_0x420577,_0x16268c,{'sampleRate':0x1f40,'format':_0x0993('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1b9211['on'](_0x0993('0x5d'),function(_0x44d74f){fs[_0x0993('0x5e')](_0x420577);_0x55471b[_0x0993('0x17')](0x1f4)['send'](_0x44d74f);});_0x1b9211['on'](_0x0993('0x5f'),function(_0x4396d8){_0x544fa9[_0x0993('0x60')]=isNaN(_0x4396d8[_0x0993('0x61')])?null:_0x4396d8['duration']*0x3e8;_0x544fa9[_0x0993('0x62')]=isNaN(_0x4396d8['sampleCount'])?null:_0x4396d8[_0x0993('0x63')];_0x544fa9[_0x0993('0x64')]=isNaN(_0x4396d8[_0x0993('0x65')])?null:_0x4396d8['channelCount'];_0x544fa9[_0x0993('0x66')]=isNaN(_0x4396d8[_0x0993('0x67')])?null:_0x4396d8[_0x0993('0x67')];_0x544fa9[_0x0993('0x68')]=isNaN(_0x4396d8[_0x0993('0x69')])?null:_0x4396d8[_0x0993('0x69')];});_0x1b9211['on'](_0x0993('0x6a'),function(_0xc379f3){_0x544fa9['converted_duration']=isNaN(_0xc379f3[_0x0993('0x61')])?null:_0xc379f3[_0x0993('0x61')]*0x3e8;_0x544fa9['converted_sampleCount']=isNaN(_0xc379f3[_0x0993('0x63')])?null:_0xc379f3[_0x0993('0x63')];_0x544fa9['converted_channelCount']=isNaN(_0xc379f3[_0x0993('0x65')])?null:_0xc379f3[_0x0993('0x65')];_0x544fa9['converted_bitRate']=isNaN(_0xc379f3[_0x0993('0x67')])?null:_0xc379f3['bitRate'];_0x544fa9['converted_sampleRate']=isNaN(_0xc379f3[_0x0993('0x69')])?null:_0xc379f3[_0x0993('0x69')];});_0x1b9211['on'](_0x0993('0x18'),function(){fs[_0x0993('0x5a')](_0x16268c,parseInt(_0x0993('0x5b'),0x8));return db[_0x0993('0x29')]['create'](_0x544fa9)['then'](function(_0x4368ea){var _0x335ec6={'role':_0x29c439[_0x0993('0x6b')]['role'],'userProfileId':_0x29c439[_0x0993('0x6b')][_0x0993('0x6c')]};if(!_0x335ec6)throw new Error(_0x0993('0x6d'));if(_0x335ec6[_0x0993('0x6e')]===_0x0993('0x6f')){var _0x372d31=_0x4368ea[_0x0993('0x70')]({'plain':!![]});return db[_0x0993('0x71')]['find']({'where':{'name':'Sounds','userProfileId':_0x335ec6[_0x0993('0x6c')]},'raw':!![]})[_0x0993('0x22')](function(_0x2c1966){if(_0x2c1966&&_0x2c1966[_0x0993('0x72')]===0x0){return db[_0x0993('0x73')][_0x0993('0x4f')]({'name':_0x372d31[_0x0993('0x26')],'resourceId':_0x372d31['id'],'type':_0x2c1966[_0x0993('0x26')],'sectionId':_0x2c1966['id']},{})[_0x0993('0x22')](function(){return _0x4368ea;});}else{return _0x4368ea;}})[_0x0993('0x42')](function(_0x27738b){logger[_0x0993('0x5d')](_0x0993('0x74'),_0x27738b);throw _0x27738b;});}return _0x4368ea;})[_0x0993('0x22')](respondWithResult(_0x55471b,null))[_0x0993('0x42')](handleError(_0x55471b,null));});_0x1b9211['start']();}catch(_0x20b04f){_0x55471b['status'](0x1f4)['send'](_0x20b04f);}};exports['update']=function(_0x45ab95,_0x6625a4,_0x56434f){return db['Sound'][_0x0993('0x45')]({'where':{'id':_0x45ab95['params']['id']}})['then'](handleEntityNotFound(_0x6625a4,null))['then'](saveUpdates(_[_0x0993('0x39')](_0x45ab95[_0x0993('0x6b')],[_0x0993('0x26'),'description']),null))['then'](respondWithResult(_0x6625a4,null))['catch'](handleError(_0x6625a4,null));};exports[_0x0993('0x75')]=function(_0x5d9d39,_0x31376c,_0x243137){return db[_0x0993('0x29')][_0x0993('0x45')]({'where':{'id':_0x5d9d39[_0x0993('0x44')]['id']}})[_0x0993('0x22')](function(_0xed3a2c){if(_0xed3a2c){return _0xed3a2c['destroy']();}})[_0x0993('0x22')](function(_0x323c64){var _0xee6c70=path[_0x0993('0x76')](config[_0x0993('0x49')],'server/files/sounds/original',util[_0x0993('0x4d')](_0x0993('0x4e'),_0x323c64['save_name'],_0x323c64[_0x0993('0x77')]));var _0x70463=path['join'](config[_0x0993('0x49')],'server/files/sounds/converted',util[_0x0993('0x4d')](_0x0993('0x4e'),_0x323c64[_0x0993('0x47')],_0x323c64[_0x0993('0x48')]));fs[_0x0993('0x5e')](_0xee6c70);fs[_0x0993('0x5e')](_0x70463);return _0x323c64;})[_0x0993('0x22')](function(_0x1b93c7){if(_0x1b93c7){return _0x31376c[_0x0993('0x17')](0xcc)[_0x0993('0x18')]();}})['then'](handleEntityNotFound(_0x31376c,null))[_0x0993('0x42')](handleError(_0x31376c,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 7aa220f..b52974f 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 _0xa04a=['request-promise','rimraf','../../config/environment','exports','tools_sounds','util','../../config/logger','api','moment','bluebird'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa04a,0xff));var _0xaa04=function(_0x2d24e2,_0x38c3af){_0x2d24e2=_0x2d24e2-0x0;var _0x330f61=_0xa04a[_0x2d24e2];return _0x330f61;};'use strict';var _=require('lodash');var util=require(_0xaa04('0x0'));var logger=require(_0xaa04('0x1'))(_0xaa04('0x2'));var moment=require(_0xaa04('0x3'));var BPromise=require(_0xaa04('0x4'));var rp=require(_0xaa04('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa04('0x6'));var config=require(_0xaa04('0x7'));var attributes=require('./sound.attributes');module[_0xaa04('0x8')]=function(_0x4d1b84,_0x2bcff7){return _0x4d1b84['define']('Sound',attributes,{'tableName':_0xaa04('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b7f=['path','rimraf','./sound.attributes','exports','define','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x15ecad,_0x5eb53e){var _0x32b200=function(_0x1d645c){while(--_0x1d645c){_0x15ecad['push'](_0x15ecad['shift']());}};_0x32b200(++_0x5eb53e);}(_0x4b7f,0xb9));var _0xf4b7=function(_0x38d696,_0x481c50){_0x38d696=_0x38d696-0x0;var _0x11b025=_0x4b7f[_0x38d696];return _0x11b025;};'use strict';var _=require(_0xf4b7('0x0'));var util=require('util');var logger=require(_0xf4b7('0x1'))('api');var moment=require(_0xf4b7('0x2'));var BPromise=require(_0xf4b7('0x3'));var rp=require(_0xf4b7('0x4'));var fs=require('fs');var path=require(_0xf4b7('0x5'));var rimraf=require(_0xf4b7('0x6'));var config=require('../../config/environment');var attributes=require(_0xf4b7('0x7'));module[_0xf4b7('0x8')]=function(_0x39898c,_0x2ce00b){return _0x39898c[_0xf4b7('0x9')]('Sound',attributes,{'tableName':'tools_sounds','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 7114cec..017977c 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 _0xdc8d=['lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','Sound','raw','options','where','attributes','include','map','model','ShowSound','debug','stringify'];(function(_0x3b14ad,_0x5e4401){var _0x392677=function(_0x4c9139){while(--_0x4c9139){_0x3b14ad['push'](_0x3b14ad['shift']());}};_0x392677(++_0x5e4401);}(_0xdc8d,0x15c));var _0xddc8=function(_0x3d6157,_0x50510d){_0x3d6157=_0x3d6157-0x0;var _0x18bf28=_0xdc8d[_0x3d6157];return _0x18bf28;};'use strict';var _=require(_0xddc8('0x0'));var util=require(_0xddc8('0x1'));var moment=require(_0xddc8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddc8('0x3'))['db'];var utils=require(_0xddc8('0x4'));var logger=require('../../config/logger')(_0xddc8('0x5'));var config=require(_0xddc8('0x6'));var jayson=require(_0xddc8('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2457ae,_0x340419,_0x19a81c){return new BPromise(function(_0x5ebda9,_0x574ee1){return client['request'](_0x2457ae,_0x19a81c)[_0xddc8('0x8')](function(_0x44dbb1){logger[_0xddc8('0x9')](_0xddc8('0xa'),_0x340419,'request\x20sent');logger['debug'](_0xddc8('0xb'),_0x340419,_0xddc8('0xc'),JSON['stringify'](_0x44dbb1));if(_0x44dbb1[_0xddc8('0xd')]){if(_0x44dbb1[_0xddc8('0xd')][_0xddc8('0xe')]===0x1f4){logger[_0xddc8('0xd')](_0xddc8('0xa'),_0x340419,_0x44dbb1[_0xddc8('0xd')][_0xddc8('0xf')]);return _0x574ee1(_0x44dbb1[_0xddc8('0xd')]['message']);}logger[_0xddc8('0xd')]('Sound,\x20%s,\x20%s',_0x340419,_0x44dbb1['error'][_0xddc8('0xf')]);return _0x5ebda9(_0x44dbb1['error'][_0xddc8('0xf')]);}else{logger['info'](_0xddc8('0xa'),_0x340419,_0xddc8('0xc'));_0x5ebda9(_0x44dbb1[_0xddc8('0x10')][_0xddc8('0xf')]);}})[_0xddc8('0x11')](function(_0x4ebd90){logger[_0xddc8('0xd')](_0xddc8('0xa'),_0x340419,_0x4ebd90);_0x574ee1(_0x4ebd90);});});}exports['ShowSound']=function(_0x53ed43){var _0x2784ce=this;return new Promise(function(_0x3ccba1,_0x245138){return db[_0xddc8('0x12')]['find']({'raw':_0x53ed43['options']?_0x53ed43['options'][_0xddc8('0x13')]===undefined?!![]:![]:!![],'where':_0x53ed43[_0xddc8('0x14')]?_0x53ed43[_0xddc8('0x14')][_0xddc8('0x15')]||null:null,'attributes':_0x53ed43['options']?_0x53ed43['options'][_0xddc8('0x16')]||null:null,'include':_0x53ed43[_0xddc8('0x14')]?_0x53ed43[_0xddc8('0x14')][_0xddc8('0x17')]?_[_0xddc8('0x18')](_0x53ed43[_0xddc8('0x14')]['include'],function(_0x25d793){return{'model':db[_0x25d793[_0xddc8('0x19')]],'as':_0x25d793['as'],'attributes':_0x25d793[_0xddc8('0x16')],'include':_0x25d793['include']?_['map'](_0x25d793[_0xddc8('0x17')],function(_0x2c565b){return{'model':db[_0x2c565b[_0xddc8('0x19')]],'as':_0x2c565b['as'],'attributes':_0x2c565b[_0xddc8('0x16')],'include':_0x2c565b[_0xddc8('0x17')]?_[_0xddc8('0x18')](_0x2c565b[_0xddc8('0x17')],function(_0x481554){return{'model':db[_0x481554[_0xddc8('0x19')]],'as':_0x481554['as'],'attributes':_0x481554[_0xddc8('0x16')]};}):[]};}):[]};}):[]:[]})[_0xddc8('0x8')](function(_0x193ef8){logger['info'](_0xddc8('0x1a'),_0x53ed43);logger[_0xddc8('0x1b')](_0xddc8('0x1a'),_0x53ed43,JSON[_0xddc8('0x1c')](_0x193ef8));_0x3ccba1(_0x193ef8);})[_0xddc8('0x11')](function(_0x56d354){logger[_0xddc8('0xd')](_0xddc8('0x1a'),_0x56d354['message'],_0x53ed43);_0x245138(_0x2784ce[_0xddc8('0xd')](0x1f4,_0x56d354['message']));});});}; \ No newline at end of file +var _0x906c=['model','then','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','info','result','catch','ShowSound','Sound','find','options','where','attributes','include','map'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x906c,0x1bd));var _0xc906=function(_0x30a3ba,_0x5a28a0){_0x30a3ba=_0x30a3ba-0x0;var _0x4ba438=_0x906c[_0x30a3ba];return _0x4ba438;};'use strict';var _=require(_0xc906('0x0'));var util=require(_0xc906('0x1'));var moment=require(_0xc906('0x2'));var BPromise=require(_0xc906('0x3'));var rs=require(_0xc906('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc906('0x5'))['db'];var utils=require(_0xc906('0x6'));var logger=require('../../config/logger')(_0xc906('0x7'));var config=require(_0xc906('0x8'));var jayson=require(_0xc906('0x9'));var client=jayson[_0xc906('0xa')][_0xc906('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d1848,_0x5a7800,_0xe7f8aa){return new BPromise(function(_0xcbeb35,_0x43eece){return client[_0xc906('0xc')](_0x4d1848,_0xe7f8aa)['then'](function(_0x5bc8c1){logger['info']('Sound,\x20%s,\x20%s',_0x5a7800,_0xc906('0xd'));logger['debug'](_0xc906('0xe'),_0x5a7800,_0xc906('0xd'),JSON[_0xc906('0xf')](_0x5bc8c1));if(_0x5bc8c1['error']){if(_0x5bc8c1[_0xc906('0x10')][_0xc906('0x11')]===0x1f4){logger[_0xc906('0x10')](_0xc906('0x12'),_0x5a7800,_0x5bc8c1['error']['message']);return _0x43eece(_0x5bc8c1['error'][_0xc906('0x13')]);}logger['error'](_0xc906('0x12'),_0x5a7800,_0x5bc8c1[_0xc906('0x10')][_0xc906('0x13')]);return _0xcbeb35(_0x5bc8c1[_0xc906('0x10')][_0xc906('0x13')]);}else{logger[_0xc906('0x14')](_0xc906('0x12'),_0x5a7800,_0xc906('0xd'));_0xcbeb35(_0x5bc8c1[_0xc906('0x15')][_0xc906('0x13')]);}})[_0xc906('0x16')](function(_0x2063e1){logger[_0xc906('0x10')](_0xc906('0x12'),_0x5a7800,_0x2063e1);_0x43eece(_0x2063e1);});});}exports[_0xc906('0x17')]=function(_0x3e4fb4){var _0x335baa=this;return new Promise(function(_0x210c60,_0x4425ba){return db[_0xc906('0x18')][_0xc906('0x19')]({'raw':_0x3e4fb4[_0xc906('0x1a')]?_0x3e4fb4[_0xc906('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3e4fb4[_0xc906('0x1a')]?_0x3e4fb4[_0xc906('0x1a')][_0xc906('0x1b')]||null:null,'attributes':_0x3e4fb4['options']?_0x3e4fb4[_0xc906('0x1a')][_0xc906('0x1c')]||null:null,'include':_0x3e4fb4[_0xc906('0x1a')]?_0x3e4fb4[_0xc906('0x1a')][_0xc906('0x1d')]?_[_0xc906('0x1e')](_0x3e4fb4[_0xc906('0x1a')][_0xc906('0x1d')],function(_0x53c78){return{'model':db[_0x53c78['model']],'as':_0x53c78['as'],'attributes':_0x53c78[_0xc906('0x1c')],'include':_0x53c78[_0xc906('0x1d')]?_[_0xc906('0x1e')](_0x53c78[_0xc906('0x1d')],function(_0x423b0b){return{'model':db[_0x423b0b[_0xc906('0x1f')]],'as':_0x423b0b['as'],'attributes':_0x423b0b[_0xc906('0x1c')],'include':_0x423b0b[_0xc906('0x1d')]?_[_0xc906('0x1e')](_0x423b0b['include'],function(_0x3d7e0b){return{'model':db[_0x3d7e0b[_0xc906('0x1f')]],'as':_0x3d7e0b['as'],'attributes':_0x3d7e0b[_0xc906('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc906('0x20')](function(_0x26a4e1){logger['info'](_0xc906('0x17'),_0x3e4fb4);logger[_0xc906('0x21')](_0xc906('0x17'),_0x3e4fb4,JSON[_0xc906('0xf')](_0x26a4e1));_0x210c60(_0x26a4e1);})[_0xc906('0x16')](function(_0x39ea24){logger['error'](_0xc906('0x17'),_0x39ea24[_0xc906('0x13')],_0x3e4fb4);_0x4425ba(_0x335baa[_0xc906('0x10')](0x1f4,_0x39ea24[_0xc906('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index e33d7d8..54a2dd4 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 _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x4a5f6c,_0x4f532e){var _0x281ffd=function(_0x4c68e3){while(--_0x4c68e3){_0x4a5f6c['push'](_0x4a5f6c['shift']());}};_0x281ffd(++_0x4f532e);}(_0x8603,0x190));var _0x3860=function(_0x32c1c3,_0x5078f5){_0x32c1c3=_0x32c1c3-0x0;var _0x1877cd=_0x8603[_0x32c1c3];return _0x1877cd;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file +var _0x0b0e=['./squareMessage.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1587d1,_0x4ac855){var _0x376394=function(_0x513269){while(--_0x513269){_0x1587d1['push'](_0x1587d1['shift']());}};_0x376394(++_0x4ac855);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0x0b0e[_0x4067ac];return _0x53d74d;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 3161b00..026c330 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 _0x2662=['exports','STRING','medium','ENUM','out','TEXT'];(function(_0x4f744c,_0x3047cb){var _0xee8eaf=function(_0x57665e){while(--_0x57665e){_0x4f744c['push'](_0x4f744c['shift']());}};_0xee8eaf(++_0x3047cb);}(_0x2662,0x9c));var _0x2266=function(_0xaef419,_0x3bad83){_0xaef419=_0xaef419-0x0;var _0x4c92df=_0x2662[_0xaef419];return _0x4c92df;};'use strict';var Sequelize=require('sequelize');module[_0x2266('0x0')]={'uniqueid':{'type':Sequelize[_0x2266('0x1')]},'body':{'type':Sequelize['TEXT'](_0x2266('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x2266('0x3')]('in','out'),'defaultValue':_0x2266('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x2266('0x1')]},'providerResponse':{'type':Sequelize[_0x2266('0x5')]}}; \ No newline at end of file +var _0x6300=['ENUM','out','sequelize','STRING','TEXT','medium'];(function(_0x35d9cf,_0x5f1c0){var _0x5e02cb=function(_0xbc574b){while(--_0xbc574b){_0x35d9cf['push'](_0x35d9cf['shift']());}};_0x5e02cb(++_0x5f1c0);}(_0x6300,0x1ee));var _0x0630=function(_0x146ebe,_0xc49e7f){_0x146ebe=_0x146ebe-0x0;var _0x308e38=_0x6300[_0x146ebe];return _0x308e38;};'use strict';var Sequelize=require(_0x0630('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x0630('0x1')]},'body':{'type':Sequelize[_0x0630('0x2')](_0x0630('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x0630('0x4')]('in',_0x0630('0x5')),'defaultValue':_0x0630('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x0630('0x1')]},'providerResponse':{'type':Sequelize[_0x0630('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index d38ae7b..653b6bb 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 _0x18a6=['body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','update','destroy','then','end','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','SquareMessage','includeAll','findAll','rows','catch','show','params','include','find','create'];(function(_0x497786,_0x14c622){var _0x538174=function(_0x13a0bf){while(--_0x13a0bf){_0x497786['push'](_0x497786['shift']());}};_0x538174(++_0x14c622);}(_0x18a6,0x1c9));var _0x618a=function(_0xa56f2f,_0x109384){_0xa56f2f=_0xa56f2f-0x0;var _0x4f5679=_0x18a6[_0xa56f2f];return _0x4f5679;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x618a('0x0'));var zipdir=require(_0x618a('0x1'));var jsonpatch=require(_0x618a('0x2'));var rp=require(_0x618a('0x3'));var moment=require(_0x618a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x618a('0x5'));var util=require(_0x618a('0x6'));var path=require(_0x618a('0x7'));var sox=require(_0x618a('0x8'));var csv=require(_0x618a('0x9'));var ejs=require(_0x618a('0xa'));var fs=require('fs');var fs_extra=require(_0x618a('0xb'));var _=require(_0x618a('0xc'));var squel=require(_0x618a('0xd'));var crypto=require('crypto');var jsforce=require(_0x618a('0xe'));var deskjs=require(_0x618a('0xf'));var toCsv=require(_0x618a('0x9'));var querystring=require(_0x618a('0x10'));var Papa=require(_0x618a('0x11'));var Redis=require('ioredis');var authService=require(_0x618a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x618a('0x13'));var hardwareService=require(_0x618a('0x14'));var logger=require(_0x618a('0x15'))(_0x618a('0x16'));var utils=require('../../config/utils');var config=require(_0x618a('0x17'));var licenseUtil=require(_0x618a('0x18'));var db=require(_0x618a('0x19'))['db'];function respondWithStatusCode(_0x2861fb,_0x1f5ebe){_0x1f5ebe=_0x1f5ebe||0xcc;return function(_0x28bb2f){if(_0x28bb2f){return _0x2861fb[_0x618a('0x1a')](_0x1f5ebe);}return _0x2861fb[_0x618a('0x1b')](_0x1f5ebe)['end']();};}function respondWithResult(_0x594b8e,_0x4c7923){_0x4c7923=_0x4c7923||0xc8;return function(_0x34f2ac){if(_0x34f2ac){return _0x594b8e['status'](_0x4c7923)[_0x618a('0x1c')](_0x34f2ac);}};}function respondWithFilteredResult(_0x26e379,_0x2a04e9){return function(_0x576e56){if(_0x576e56){var _0x3e17cd=typeof _0x2a04e9[_0x618a('0x1d')]==='undefined'&&typeof _0x2a04e9[_0x618a('0x1e')]===_0x618a('0x1f');var _0x1c056f=_0x576e56[_0x618a('0x20')];var _0x35b13e=_0x3e17cd?0x0:_0x2a04e9[_0x618a('0x1d')];var _0x469ffd=_0x3e17cd?_0x576e56[_0x618a('0x20')]:_0x2a04e9[_0x618a('0x1d')]+_0x2a04e9['limit'];var _0x89aba0;if(_0x469ffd>=_0x1c056f){_0x469ffd=_0x1c056f;_0x89aba0=0xc8;}else{_0x89aba0=0xce;}_0x26e379[_0x618a('0x1b')](_0x89aba0);return _0x26e379['set'](_0x618a('0x21'),_0x35b13e+'-'+_0x469ffd+'/'+_0x1c056f)['json'](_0x576e56);}return null;};}function patchUpdates(_0x246349){return function(_0x4e50b3){try{jsonpatch[_0x618a('0x22')](_0x4e50b3,_0x246349,!![]);}catch(_0xaecf23){return BPromise['reject'](_0xaecf23);}return _0x4e50b3['save']();};}function saveUpdates(_0x3381df,_0x96031){return function(_0x4f3293){if(_0x4f3293){return _0x4f3293[_0x618a('0x23')](_0x3381df)['then'](function(_0x245e6f){return _0x245e6f;});}return null;};}function removeEntity(_0x45e0f9,_0x3175dc){return function(_0x5a462a){if(_0x5a462a){return _0x5a462a[_0x618a('0x24')]()[_0x618a('0x25')](function(){_0x45e0f9['status'](0xcc)[_0x618a('0x26')]();});}};}function handleEntityNotFound(_0x1da2a9,_0x17164c){return function(_0x3986f3){if(!_0x3986f3){_0x1da2a9[_0x618a('0x1a')](0x194);}return _0x3986f3;};}function handleError(_0x2a38b1,_0x1e88f3){_0x1e88f3=_0x1e88f3||0x1f4;return function(_0x12074e){logger['error'](_0x12074e['stack']);if(_0x12074e[_0x618a('0x27')]){delete _0x12074e['name'];}_0x2a38b1[_0x618a('0x1b')](_0x1e88f3)[_0x618a('0x28')](_0x12074e);};}exports[_0x618a('0x29')]=function(_0x1582aa,_0x4e3a17){var _0x2b7066={},_0x4f3aa2={},_0x69a697={'count':0x0,'rows':[]};var _0x4abb30=_[_0x618a('0x2a')](db['SquareMessage'][_0x618a('0x2b')],function(_0xc1fb12){return{'name':_0xc1fb12[_0x618a('0x2c')],'type':_0xc1fb12['type'][_0x618a('0x2d')]};});_0x4f3aa2[_0x618a('0x2e')]=_[_0x618a('0x2a')](_0x4abb30,'name');_0x4f3aa2[_0x618a('0x2f')]=_[_0x618a('0x30')](_0x1582aa[_0x618a('0x2f')]);_0x4f3aa2['filters']=_[_0x618a('0x31')](_0x4f3aa2['model'],_0x4f3aa2[_0x618a('0x2f')]);_0x2b7066[_0x618a('0x32')]=_[_0x618a('0x31')](_0x4f3aa2[_0x618a('0x2e')],qs['fields'](_0x1582aa[_0x618a('0x2f')][_0x618a('0x33')]));_0x2b7066[_0x618a('0x32')]=_0x2b7066[_0x618a('0x32')][_0x618a('0x34')]?_0x2b7066[_0x618a('0x32')]:_0x4f3aa2[_0x618a('0x2e')];if(!_0x1582aa[_0x618a('0x2f')][_0x618a('0x35')](_0x618a('0x36'))){_0x2b7066['limit']=qs[_0x618a('0x1e')](_0x1582aa[_0x618a('0x2f')][_0x618a('0x1e')]);_0x2b7066[_0x618a('0x1d')]=qs[_0x618a('0x1d')](_0x1582aa['query'][_0x618a('0x1d')]);}_0x2b7066[_0x618a('0x37')]=qs[_0x618a('0x38')](_0x1582aa[_0x618a('0x2f')][_0x618a('0x38')]);_0x2b7066[_0x618a('0x39')]=qs[_0x618a('0x3a')](_[_0x618a('0x3b')](_0x1582aa[_0x618a('0x2f')],_0x4f3aa2[_0x618a('0x3a')]),_0x4abb30);if(_0x1582aa[_0x618a('0x2f')][_0x618a('0x3c')]){_0x2b7066[_0x618a('0x39')]=_[_0x618a('0x3d')](_0x2b7066[_0x618a('0x39')],{'$or':_[_0x618a('0x2a')](_0x4abb30,function(_0x2a4bf5){if(_0x2a4bf5[_0x618a('0x3e')]!==_0x618a('0x3f')){var _0x2d26ea={};_0x2d26ea[_0x2a4bf5[_0x618a('0x27')]]={'$like':'%'+_0x1582aa[_0x618a('0x2f')][_0x618a('0x3c')]+'%'};return _0x2d26ea;}})});}_0x2b7066=_['merge']({},_0x2b7066,_0x1582aa[_0x618a('0x40')]);var _0x2ebec0={'where':_0x2b7066[_0x618a('0x39')]};return db[_0x618a('0x41')][_0x618a('0x20')](_0x2ebec0)[_0x618a('0x25')](function(_0x3fb29b){_0x69a697[_0x618a('0x20')]=_0x3fb29b;if(_0x1582aa['query'][_0x618a('0x42')]){_0x2b7066['include']=[{'all':!![]}];}return db[_0x618a('0x41')][_0x618a('0x43')](_0x2b7066);})[_0x618a('0x25')](function(_0x22164a){_0x69a697[_0x618a('0x44')]=_0x22164a;return _0x69a697;})['then'](respondWithFilteredResult(_0x4e3a17,_0x2b7066))[_0x618a('0x45')](handleError(_0x4e3a17,null));};exports[_0x618a('0x46')]=function(_0x45285e,_0x110e25){var _0x5eca01={'raw':!![],'where':{'id':_0x45285e[_0x618a('0x47')]['id']}},_0x40132e={};_0x40132e[_0x618a('0x2e')]=_[_0x618a('0x30')](db[_0x618a('0x41')][_0x618a('0x2b')]);_0x40132e[_0x618a('0x2f')]=_[_0x618a('0x30')](_0x45285e[_0x618a('0x2f')]);_0x40132e[_0x618a('0x3a')]=_[_0x618a('0x31')](_0x40132e[_0x618a('0x2e')],_0x40132e[_0x618a('0x2f')]);_0x5eca01[_0x618a('0x32')]=_[_0x618a('0x31')](_0x40132e[_0x618a('0x2e')],qs['fields'](_0x45285e[_0x618a('0x2f')][_0x618a('0x33')]));_0x5eca01[_0x618a('0x32')]=_0x5eca01['attributes'][_0x618a('0x34')]?_0x5eca01[_0x618a('0x32')]:_0x40132e['model'];if(_0x45285e[_0x618a('0x2f')][_0x618a('0x42')]){_0x5eca01[_0x618a('0x48')]=[{'all':!![]}];}_0x5eca01=_[_0x618a('0x3d')]({},_0x5eca01,_0x45285e[_0x618a('0x40')]);return db[_0x618a('0x41')][_0x618a('0x49')](_0x5eca01)[_0x618a('0x25')](handleEntityNotFound(_0x110e25,null))[_0x618a('0x25')](respondWithResult(_0x110e25,null))['catch'](handleError(_0x110e25,null));};exports[_0x618a('0x4a')]=function(_0x326e43,_0x597288){return db[_0x618a('0x41')][_0x618a('0x4a')](_0x326e43[_0x618a('0x4b')],{})[_0x618a('0x25')](respondWithResult(_0x597288,0xc9))[_0x618a('0x45')](handleError(_0x597288,null));};exports['update']=function(_0x571086,_0x4d8be3){if(_0x571086['body']['id']){delete _0x571086['body']['id'];}return db[_0x618a('0x41')][_0x618a('0x49')]({'where':{'id':_0x571086['params']['id']}})['then'](handleEntityNotFound(_0x4d8be3,null))[_0x618a('0x25')](saveUpdates(_0x571086[_0x618a('0x4b')],null))[_0x618a('0x25')](respondWithResult(_0x4d8be3,null))[_0x618a('0x45')](handleError(_0x4d8be3,null));};exports[_0x618a('0x24')]=function(_0x387022,_0x5ba7ac){return db[_0x618a('0x41')][_0x618a('0x49')]({'where':{'id':_0x387022['params']['id']}})[_0x618a('0x25')](handleEntityNotFound(_0x5ba7ac,null))[_0x618a('0x25')](removeEntity(_0x5ba7ac,null))[_0x618a('0x45')](handleError(_0x5ba7ac,null));}; \ No newline at end of file +var _0x3166=['reject','save','update','then','destroy','error','stack','name','send','index','SquareMessage','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','options','create','body','params','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range'];(function(_0xdf3db6,_0x2a1952){var _0x4b7a65=function(_0x2953be){while(--_0x2953be){_0xdf3db6['push'](_0xdf3db6['shift']());}};_0x4b7a65(++_0x2a1952);}(_0x3166,0xbb));var _0x6316=function(_0x3c97bb,_0x315f08){_0x3c97bb=_0x3c97bb-0x0;var _0x3020c1=_0x3166[_0x3c97bb];return _0x3020c1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6316('0x0'));var zipdir=require(_0x6316('0x1'));var jsonpatch=require(_0x6316('0x2'));var rp=require('request-promise');var moment=require(_0x6316('0x3'));var BPromise=require(_0x6316('0x4'));var Mustache=require('mustache');var util=require(_0x6316('0x5'));var path=require(_0x6316('0x6'));var sox=require('sox');var csv=require(_0x6316('0x7'));var ejs=require(_0x6316('0x8'));var fs=require('fs');var fs_extra=require(_0x6316('0x9'));var _=require(_0x6316('0xa'));var squel=require('squel');var crypto=require(_0x6316('0xb'));var jsforce=require(_0x6316('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6316('0x7'));var querystring=require(_0x6316('0xd'));var Papa=require(_0x6316('0xe'));var Redis=require(_0x6316('0xf'));var authService=require(_0x6316('0x10'));var qs=require(_0x6316('0x11'));var as=require(_0x6316('0x12'));var hardwareService=require(_0x6316('0x13'));var logger=require(_0x6316('0x14'))(_0x6316('0x15'));var utils=require(_0x6316('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6316('0x17'));var db=require(_0x6316('0x18'))['db'];function respondWithStatusCode(_0x1a1c46,_0x34898b){_0x34898b=_0x34898b||0xcc;return function(_0x468c19){if(_0x468c19){return _0x1a1c46[_0x6316('0x19')](_0x34898b);}return _0x1a1c46['status'](_0x34898b)[_0x6316('0x1a')]();};}function respondWithResult(_0x6261d5,_0x15b8bb){_0x15b8bb=_0x15b8bb||0xc8;return function(_0xcba5ff){if(_0xcba5ff){return _0x6261d5['status'](_0x15b8bb)[_0x6316('0x1b')](_0xcba5ff);}};}function respondWithFilteredResult(_0x46022e,_0x2e1d48){return function(_0x493139){if(_0x493139){var _0x22348f=typeof _0x2e1d48[_0x6316('0x1c')]==='undefined'&&typeof _0x2e1d48[_0x6316('0x1d')]===_0x6316('0x1e');var _0x3f9e07=_0x493139[_0x6316('0x1f')];var _0x569db2=_0x22348f?0x0:_0x2e1d48['offset'];var _0x2eecb9=_0x22348f?_0x493139[_0x6316('0x1f')]:_0x2e1d48[_0x6316('0x1c')]+_0x2e1d48[_0x6316('0x1d')];var _0x22cd6e;if(_0x2eecb9>=_0x3f9e07){_0x2eecb9=_0x3f9e07;_0x22cd6e=0xc8;}else{_0x22cd6e=0xce;}_0x46022e[_0x6316('0x20')](_0x22cd6e);return _0x46022e[_0x6316('0x21')](_0x6316('0x22'),_0x569db2+'-'+_0x2eecb9+'/'+_0x3f9e07)[_0x6316('0x1b')](_0x493139);}return null;};}function patchUpdates(_0x3e4543){return function(_0x36db62){try{jsonpatch['apply'](_0x36db62,_0x3e4543,!![]);}catch(_0x1ed2d2){return BPromise[_0x6316('0x23')](_0x1ed2d2);}return _0x36db62[_0x6316('0x24')]();};}function saveUpdates(_0x156065,_0x3cfc43){return function(_0x236256){if(_0x236256){return _0x236256[_0x6316('0x25')](_0x156065)[_0x6316('0x26')](function(_0x59000b){return _0x59000b;});}return null;};}function removeEntity(_0x4063e3,_0x46e2c1){return function(_0x3206ef){if(_0x3206ef){return _0x3206ef[_0x6316('0x27')]()['then'](function(){_0x4063e3[_0x6316('0x20')](0xcc)[_0x6316('0x1a')]();});}};}function handleEntityNotFound(_0x11a2b1,_0x4c5bd7){return function(_0x8dd4f6){if(!_0x8dd4f6){_0x11a2b1[_0x6316('0x19')](0x194);}return _0x8dd4f6;};}function handleError(_0x271379,_0x16a64b){_0x16a64b=_0x16a64b||0x1f4;return function(_0x1483ba){logger[_0x6316('0x28')](_0x1483ba[_0x6316('0x29')]);if(_0x1483ba[_0x6316('0x2a')]){delete _0x1483ba[_0x6316('0x2a')];}_0x271379['status'](_0x16a64b)[_0x6316('0x2b')](_0x1483ba);};}exports[_0x6316('0x2c')]=function(_0x546eae,_0x30b984){var _0x49a51c={},_0x33c001={},_0x2bd2a4={'count':0x0,'rows':[]};var _0x5889e4=_['map'](db[_0x6316('0x2d')]['rawAttributes'],function(_0x528f8d){return{'name':_0x528f8d['fieldName'],'type':_0x528f8d['type'][_0x6316('0x2e')]};});_0x33c001[_0x6316('0x2f')]=_[_0x6316('0x30')](_0x5889e4,'name');_0x33c001[_0x6316('0x31')]=_[_0x6316('0x32')](_0x546eae[_0x6316('0x31')]);_0x33c001[_0x6316('0x33')]=_[_0x6316('0x34')](_0x33c001[_0x6316('0x2f')],_0x33c001[_0x6316('0x31')]);_0x49a51c[_0x6316('0x35')]=_['intersection'](_0x33c001[_0x6316('0x2f')],qs[_0x6316('0x36')](_0x546eae[_0x6316('0x31')][_0x6316('0x36')]));_0x49a51c[_0x6316('0x35')]=_0x49a51c['attributes'][_0x6316('0x37')]?_0x49a51c[_0x6316('0x35')]:_0x33c001['model'];if(!_0x546eae[_0x6316('0x31')][_0x6316('0x38')](_0x6316('0x39'))){_0x49a51c[_0x6316('0x1d')]=qs['limit'](_0x546eae[_0x6316('0x31')][_0x6316('0x1d')]);_0x49a51c['offset']=qs[_0x6316('0x1c')](_0x546eae[_0x6316('0x31')][_0x6316('0x1c')]);}_0x49a51c[_0x6316('0x3a')]=qs[_0x6316('0x3b')](_0x546eae[_0x6316('0x31')][_0x6316('0x3b')]);_0x49a51c['where']=qs[_0x6316('0x33')](_[_0x6316('0x3c')](_0x546eae[_0x6316('0x31')],_0x33c001[_0x6316('0x33')]),_0x5889e4);if(_0x546eae[_0x6316('0x31')]['filter']){_0x49a51c[_0x6316('0x3d')]=_[_0x6316('0x3e')](_0x49a51c[_0x6316('0x3d')],{'$or':_[_0x6316('0x30')](_0x5889e4,function(_0x305036){if(_0x305036['type']!==_0x6316('0x3f')){var _0x483873={};_0x483873[_0x305036['name']]={'$like':'%'+_0x546eae['query'][_0x6316('0x40')]+'%'};return _0x483873;}})});}_0x49a51c=_['merge']({},_0x49a51c,_0x546eae['options']);var _0x11b566={'where':_0x49a51c[_0x6316('0x3d')]};return db[_0x6316('0x2d')]['count'](_0x11b566)[_0x6316('0x26')](function(_0x7e8308){_0x2bd2a4[_0x6316('0x1f')]=_0x7e8308;if(_0x546eae[_0x6316('0x31')][_0x6316('0x41')]){_0x49a51c[_0x6316('0x42')]=[{'all':!![]}];}return db['SquareMessage'][_0x6316('0x43')](_0x49a51c);})['then'](function(_0x446a1f){_0x2bd2a4[_0x6316('0x44')]=_0x446a1f;return _0x2bd2a4;})[_0x6316('0x26')](respondWithFilteredResult(_0x30b984,_0x49a51c))['catch'](handleError(_0x30b984,null));};exports['show']=function(_0x2dee31,_0x49f73e){var _0x353f71={'raw':!![],'where':{'id':_0x2dee31['params']['id']}},_0x4ed79c={};_0x4ed79c['model']=_[_0x6316('0x32')](db[_0x6316('0x2d')]['rawAttributes']);_0x4ed79c[_0x6316('0x31')]=_[_0x6316('0x32')](_0x2dee31[_0x6316('0x31')]);_0x4ed79c[_0x6316('0x33')]=_[_0x6316('0x34')](_0x4ed79c[_0x6316('0x2f')],_0x4ed79c['query']);_0x353f71['attributes']=_[_0x6316('0x34')](_0x4ed79c[_0x6316('0x2f')],qs[_0x6316('0x36')](_0x2dee31[_0x6316('0x31')][_0x6316('0x36')]));_0x353f71[_0x6316('0x35')]=_0x353f71[_0x6316('0x35')][_0x6316('0x37')]?_0x353f71[_0x6316('0x35')]:_0x4ed79c[_0x6316('0x2f')];if(_0x2dee31[_0x6316('0x31')]['includeAll']){_0x353f71['include']=[{'all':!![]}];}_0x353f71=_[_0x6316('0x3e')]({},_0x353f71,_0x2dee31[_0x6316('0x45')]);return db[_0x6316('0x2d')]['find'](_0x353f71)['then'](handleEntityNotFound(_0x49f73e,null))[_0x6316('0x26')](respondWithResult(_0x49f73e,null))['catch'](handleError(_0x49f73e,null));};exports['create']=function(_0x100d70,_0x4f3c7d){return db[_0x6316('0x2d')][_0x6316('0x46')](_0x100d70[_0x6316('0x47')],{})[_0x6316('0x26')](respondWithResult(_0x4f3c7d,0xc9))['catch'](handleError(_0x4f3c7d,null));};exports[_0x6316('0x25')]=function(_0x73cf7b,_0x253ded){if(_0x73cf7b[_0x6316('0x47')]['id']){delete _0x73cf7b[_0x6316('0x47')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x73cf7b[_0x6316('0x48')]['id']}})[_0x6316('0x26')](handleEntityNotFound(_0x253ded,null))[_0x6316('0x26')](saveUpdates(_0x73cf7b[_0x6316('0x47')],null))['then'](respondWithResult(_0x253ded,null))[_0x6316('0x49')](handleError(_0x253ded,null));};exports[_0x6316('0x27')]=function(_0x81538d,_0x5f5dc9){return db[_0x6316('0x2d')]['find']({'where':{'id':_0x81538d[_0x6316('0x48')]['id']}})[_0x6316('0x26')](handleEntityNotFound(_0x5f5dc9,null))[_0x6316('0x26')](removeEntity(_0x5f5dc9,null))['catch'](handleError(_0x5f5dc9,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 987e094..eb60ccf 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 _0x5fcc=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','SquareMessage','square_messages'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x5fcc,0x10e));var _0xc5fc=function(_0xd85994,_0x5c4a56){_0xd85994=_0xd85994-0x0;var _0x23dc28=_0x5fcc[_0xd85994];return _0x23dc28;};'use strict';var _=require('lodash');var util=require(_0xc5fc('0x0'));var logger=require(_0xc5fc('0x1'))('api');var moment=require(_0xc5fc('0x2'));var BPromise=require(_0xc5fc('0x3'));var rp=require(_0xc5fc('0x4'));var fs=require('fs');var path=require(_0xc5fc('0x5'));var rimraf=require(_0xc5fc('0x6'));var config=require(_0xc5fc('0x7'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x2b35ac,_0x5e5da5){return _0x2b35ac['define'](_0xc5fc('0x8'),attributes,{'tableName':_0xc5fc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf075=['square_messages','lodash','util','../../config/logger','api','request-promise','exports','define'];(function(_0x598047,_0x4253a6){var _0x156360=function(_0xafdc47){while(--_0xafdc47){_0x598047['push'](_0x598047['shift']());}};_0x156360(++_0x4253a6);}(_0xf075,0xe9));var _0x5f07=function(_0x25334d,_0x3c9762){_0x25334d=_0x25334d-0x0;var _0x17f153=_0xf075[_0x25334d];return _0x17f153;};'use strict';var _=require(_0x5f07('0x0'));var util=require(_0x5f07('0x1'));var logger=require(_0x5f07('0x2'))(_0x5f07('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5f07('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0x5f07('0x5')]=function(_0x12c904,_0x22eabe){return _0x12c904[_0x5f07('0x6')]('SquareMessage',attributes,{'tableName':_0x5f07('0x7'),'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 83737b6..13ab1c1 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 _0x037e=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSquareMessage','SquareMessage','create','options','raw','stringify','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x037e,0x12e));var _0xe037=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x037e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe037('0x0'));var util=require(_0xe037('0x1'));var moment=require('moment');var BPromise=require(_0xe037('0x2'));var rs=require(_0xe037('0x3'));var fs=require('fs');var Redis=require(_0xe037('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe037('0x5'));var logger=require(_0xe037('0x6'))(_0xe037('0x7'));var config=require('../../config/environment');var jayson=require(_0xe037('0x8'));var client=jayson[_0xe037('0x9')][_0xe037('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a2ecc,_0x3e7f05,_0x345460){return new BPromise(function(_0x40eccc,_0xfd9082){return client[_0xe037('0xb')](_0x4a2ecc,_0x345460)[_0xe037('0xc')](function(_0x534c45){logger[_0xe037('0xd')](_0xe037('0xe'),_0x3e7f05,_0xe037('0xf'));logger[_0xe037('0x10')](_0xe037('0x11'),_0x3e7f05,_0xe037('0xf'),JSON['stringify'](_0x534c45));if(_0x534c45[_0xe037('0x12')]){if(_0x534c45[_0xe037('0x12')][_0xe037('0x13')]===0x1f4){logger[_0xe037('0x12')]('SquareMessage,\x20%s,\x20%s',_0x3e7f05,_0x534c45[_0xe037('0x12')][_0xe037('0x14')]);return _0xfd9082(_0x534c45['error'][_0xe037('0x14')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x3e7f05,_0x534c45[_0xe037('0x12')][_0xe037('0x14')]);return _0x40eccc(_0x534c45[_0xe037('0x12')][_0xe037('0x14')]);}else{logger['info'](_0xe037('0xe'),_0x3e7f05,_0xe037('0xf'));_0x40eccc(_0x534c45['result'][_0xe037('0x14')]);}})[_0xe037('0x15')](function(_0x5cf7b2){logger['error'](_0xe037('0xe'),_0x3e7f05,_0x5cf7b2);_0xfd9082(_0x5cf7b2);});});}exports[_0xe037('0x16')]=function(_0x4775c9){var _0x3b936d=this;return new Promise(function(_0x2946db,_0x393899){return db[_0xe037('0x17')][_0xe037('0x18')](_0x4775c9['body'],{'raw':_0x4775c9[_0xe037('0x19')]?_0x4775c9[_0xe037('0x19')][_0xe037('0x1a')]===undefined?!![]:![]:!![]})[_0xe037('0xc')](function(_0x538f48){logger['info']('CreateSquareMessage',_0x4775c9);logger[_0xe037('0x10')]('CreateSquareMessage',_0x4775c9,JSON[_0xe037('0x1b')](_0x538f48));_0x2946db(_0x538f48);})[_0xe037('0x15')](function(_0x4e529b){logger['error'](_0xe037('0x16'),_0x4e529b[_0xe037('0x14')],_0x4775c9);_0x393899(_0x3b936d[_0xe037('0x12')](0x1f4,_0x4e529b['message']));});});}; \ No newline at end of file +var _0x05b5=['body','options','raw','CreateSquareMessage','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SquareMessage','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05b5,0x14e));var _0x505b=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x05b5[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x505b('0x0'));var util=require(_0x505b('0x1'));var moment=require(_0x505b('0x2'));var BPromise=require('bluebird');var rs=require(_0x505b('0x3'));var fs=require('fs');var Redis=require(_0x505b('0x4'));var db=require(_0x505b('0x5'))['db'];var utils=require(_0x505b('0x6'));var logger=require(_0x505b('0x7'))(_0x505b('0x8'));var config=require(_0x505b('0x9'));var jayson=require(_0x505b('0xa'));var client=jayson[_0x505b('0xb')][_0x505b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1256ac,_0x49b505,_0x2acc85){return new BPromise(function(_0x3c380a,_0x7f678a){return client['request'](_0x1256ac,_0x2acc85)[_0x505b('0xd')](function(_0x50be5d){logger[_0x505b('0xe')](_0x505b('0xf'),_0x49b505,_0x505b('0x10'));logger[_0x505b('0x11')](_0x505b('0x12'),_0x49b505,_0x505b('0x10'),JSON[_0x505b('0x13')](_0x50be5d));if(_0x50be5d[_0x505b('0x14')]){if(_0x50be5d[_0x505b('0x14')][_0x505b('0x15')]===0x1f4){logger[_0x505b('0x14')](_0x505b('0xf'),_0x49b505,_0x50be5d['error'][_0x505b('0x16')]);return _0x7f678a(_0x50be5d['error'][_0x505b('0x16')]);}logger['error'](_0x505b('0xf'),_0x49b505,_0x50be5d[_0x505b('0x14')]['message']);return _0x3c380a(_0x50be5d[_0x505b('0x14')][_0x505b('0x16')]);}else{logger['info'](_0x505b('0xf'),_0x49b505,_0x505b('0x10'));_0x3c380a(_0x50be5d['result'][_0x505b('0x16')]);}})[_0x505b('0x17')](function(_0x453aa6){logger[_0x505b('0x14')]('SquareMessage,\x20%s,\x20%s',_0x49b505,_0x453aa6);_0x7f678a(_0x453aa6);});});}exports['CreateSquareMessage']=function(_0x246404){var _0x3481d2=this;return new Promise(function(_0x6344c8,_0x51e014){return db[_0x505b('0x18')][_0x505b('0x19')](_0x246404[_0x505b('0x1a')],{'raw':_0x246404['options']?_0x246404[_0x505b('0x1b')][_0x505b('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x13e04c){logger[_0x505b('0xe')](_0x505b('0x1d'),_0x246404);logger['debug'](_0x505b('0x1d'),_0x246404,JSON[_0x505b('0x13')](_0x13e04c));_0x6344c8(_0x13e04c);})[_0x505b('0x17')](function(_0x471736){logger['error'](_0x505b('0x1d'),_0x471736[_0x505b('0x16')],_0x246404);_0x51e014(_0x3481d2[_0x505b('0x14')](0x1f4,_0x471736[_0x505b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 1ddefa8..d04b2c5 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 _0xb68d=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../config/environment','./squareOdbc.controller','isAuthenticated','index','get','show','15s','create','put'];(function(_0x5c98ea,_0xa782aa){var _0x51e853=function(_0x57d5b0){while(--_0x57d5b0){_0x5c98ea['push'](_0x5c98ea['shift']());}};_0x51e853(++_0xa782aa);}(_0xb68d,0xc3));var _0xdb68=function(_0x1292ad,_0x338612){_0x1292ad=_0x1292ad-0x0;var _0x5e305f=_0xb68d[_0x1292ad];return _0x5e305f;};'use strict';var multer=require(_0xdb68('0x0'));var util=require('util');var path=require(_0xdb68('0x1'));var timeout=require(_0xdb68('0x2'));var express=require(_0xdb68('0x3'));var router=express['Router']();var fs_extra=require(_0xdb68('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdb68('0x5'));var controller=require(_0xdb68('0x6'));router['get']('/',auth[_0xdb68('0x7')](),controller[_0xdb68('0x8')]);router[_0xdb68('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xdb68('0xa')]);router[_0xdb68('0x9')]('/:id/test',auth[_0xdb68('0x7')](),timeout(_0xdb68('0xb')),controller['test']);router['post']('/',auth[_0xdb68('0x7')](),controller[_0xdb68('0xc')]);router[_0xdb68('0xd')](_0xdb68('0xe'),auth[_0xdb68('0x7')](),controller[_0xdb68('0xf')]);router[_0xdb68('0x10')]('/:id',auth[_0xdb68('0x7')](),controller[_0xdb68('0x11')]);module[_0xdb68('0x12')]=router; \ No newline at end of file +var _0x5548=['fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','isAuthenticated','/:id','get','15s','test','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5548,0x1b3));var _0x8554=function(_0x1357eb,_0x268533){_0x1357eb=_0x1357eb-0x0;var _0x2f3b80=_0x5548[_0x1357eb];return _0x2f3b80;};'use strict';var multer=require(_0x8554('0x0'));var util=require(_0x8554('0x1'));var path=require(_0x8554('0x2'));var timeout=require(_0x8554('0x3'));var express=require(_0x8554('0x4'));var router=express[_0x8554('0x5')]();var fs_extra=require(_0x8554('0x6'));var auth=require(_0x8554('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8554('0x8'));var controller=require(_0x8554('0x9'));router['get']('/',auth[_0x8554('0xa')](),controller['index']);router['get'](_0x8554('0xb'),auth[_0x8554('0xa')](),controller['show']);router[_0x8554('0xc')]('/:id/test',auth[_0x8554('0xa')](),timeout(_0x8554('0xd')),controller[_0x8554('0xe')]);router[_0x8554('0xf')]('/',auth[_0x8554('0xa')](),controller['create']);router[_0x8554('0x10')](_0x8554('0xb'),auth[_0x8554('0xa')](),controller[_0x8554('0x11')]);router[_0x8554('0x12')](_0x8554('0xb'),auth['isAuthenticated'](),controller[_0x8554('0x13')]);module[_0x8554('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 7800d99..d567157 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 _0x2fb4=['sequelize','exports','STRING'];(function(_0x69b0bf,_0x248a70){var _0x53a201=function(_0x5d1c3f){while(--_0x5d1c3f){_0x69b0bf['push'](_0x69b0bf['shift']());}};_0x53a201(++_0x248a70);}(_0x2fb4,0x1d7));var _0x42fb=function(_0x5deee9,_0xf7bae7){_0x5deee9=_0x5deee9-0x0;var _0x1d84e0=_0x2fb4[_0x5deee9];return _0x1d84e0;};'use strict';var Sequelize=require(_0x42fb('0x0'));module[_0x42fb('0x1')]={'name':{'type':Sequelize[_0x42fb('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x42fb('0x2')]},'description':{'type':Sequelize[_0x42fb('0x2')]}}; \ No newline at end of file +var _0x223a=['exports','name','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x223a,0x1e9));var _0xa223=function(_0x270f49,_0x76bc58){_0x270f49=_0x270f49-0x0;var _0x4eebba=_0x223a[_0x270f49];return _0x4eebba;};'use strict';var Sequelize=require('sequelize');module[_0xa223('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xa223('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xa223('0x2')]},'description':{'type':Sequelize[_0xa223('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index da203dd..4583fc7 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 _0x336a=['filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareOdbc','includeAll','include','findAll','rows','catch','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','dsn','odbc','openSync','closeSync','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','fieldName','type','key','model','map','keys'];(function(_0x59c272,_0x5cdb9d){var _0x2376ab=function(_0x3bdcca){while(--_0x3bdcca){_0x59c272['push'](_0x59c272['shift']());}};_0x2376ab(++_0x5cdb9d);}(_0x336a,0xd1));var _0xa336=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x336a[_0x3ea913];return _0x2b4f28;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa336('0x0'));var zipdir=require(_0xa336('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa336('0x2'));var moment=require(_0xa336('0x3'));var BPromise=require(_0xa336('0x4'));var Mustache=require('mustache');var util=require(_0xa336('0x5'));var path=require(_0xa336('0x6'));var sox=require(_0xa336('0x7'));var csv=require(_0xa336('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa336('0x9'));var _=require('lodash');var squel=require(_0xa336('0xa'));var crypto=require(_0xa336('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa336('0x8'));var querystring=require('querystring');var Papa=require(_0xa336('0xc'));var Redis=require('ioredis');var authService=require(_0xa336('0xd'));var qs=require(_0xa336('0xe'));var as=require(_0xa336('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa336('0x10'))(_0xa336('0x11'));var utils=require('../../config/utils');var config=require(_0xa336('0x12'));var licenseUtil=require(_0xa336('0x13'));var db=require(_0xa336('0x14'))['db'];function respondWithStatusCode(_0x35d2c7,_0x4a8129){_0x4a8129=_0x4a8129||0xcc;return function(_0x1c9e0e){if(_0x1c9e0e){return _0x35d2c7['sendStatus'](_0x4a8129);}return _0x35d2c7['status'](_0x4a8129)[_0xa336('0x15')]();};}function respondWithResult(_0xc27ea8,_0x16294a){_0x16294a=_0x16294a||0xc8;return function(_0x5f201e){if(_0x5f201e){return _0xc27ea8[_0xa336('0x16')](_0x16294a)[_0xa336('0x17')](_0x5f201e);}};}function respondWithFilteredResult(_0x18802e,_0x4c7c87){return function(_0x4aa3e2){if(_0x4aa3e2){var _0x6115ea=typeof _0x4c7c87[_0xa336('0x18')]===_0xa336('0x19')&&typeof _0x4c7c87[_0xa336('0x1a')]===_0xa336('0x19');var _0x3e9118=_0x4aa3e2[_0xa336('0x1b')];var _0x51f6f0=_0x6115ea?0x0:_0x4c7c87['offset'];var _0xc5fa0c=_0x6115ea?_0x4aa3e2['count']:_0x4c7c87['offset']+_0x4c7c87['limit'];var _0x43a9db;if(_0xc5fa0c>=_0x3e9118){_0xc5fa0c=_0x3e9118;_0x43a9db=0xc8;}else{_0x43a9db=0xce;}_0x18802e[_0xa336('0x16')](_0x43a9db);return _0x18802e[_0xa336('0x1c')](_0xa336('0x1d'),_0x51f6f0+'-'+_0xc5fa0c+'/'+_0x3e9118)['json'](_0x4aa3e2);}return null;};}function patchUpdates(_0x16df28){return function(_0x4eae4c){try{jsonpatch[_0xa336('0x1e')](_0x4eae4c,_0x16df28,!![]);}catch(_0x217bd1){return BPromise[_0xa336('0x1f')](_0x217bd1);}return _0x4eae4c[_0xa336('0x20')]();};}function saveUpdates(_0x2b490a,_0x40b837){return function(_0x460b26){if(_0x460b26){return _0x460b26[_0xa336('0x21')](_0x2b490a)[_0xa336('0x22')](function(_0x75f7b9){return _0x75f7b9;});}return null;};}function removeEntity(_0x5cdc1c,_0x8eede2){return function(_0x519075){if(_0x519075){return _0x519075['destroy']()[_0xa336('0x22')](function(){var _0x2e9846=_0x519075['get']({'plain':!![]});var _0x3c1326='ODBC';return db['UserProfileResource'][_0xa336('0x23')]({'where':{'type':_0x3c1326,'resourceId':_0x2e9846['id']}})[_0xa336('0x22')](function(){return _0x519075;});})[_0xa336('0x22')](function(){_0x5cdc1c[_0xa336('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40ae79,_0x58b095){return function(_0x227aef){if(!_0x227aef){_0x40ae79[_0xa336('0x24')](0x194);}return _0x227aef;};}function handleError(_0x4e60d4,_0x29d48d){_0x29d48d=_0x29d48d||0x1f4;return function(_0x33461c){logger['error'](_0x33461c['stack']);if(_0x33461c[_0xa336('0x25')]){delete _0x33461c['name'];}_0x4e60d4[_0xa336('0x16')](_0x29d48d)[_0xa336('0x26')](_0x33461c);};}exports[_0xa336('0x27')]=function(_0x11af4e,_0xaee82d){var _0x20fcf0={},_0x8db81b={},_0x24460c={'count':0x0,'rows':[]};var _0xa9245f=_['map'](db['SquareOdbc']['rawAttributes'],function(_0x4edb45){return{'name':_0x4edb45[_0xa336('0x28')],'type':_0x4edb45[_0xa336('0x29')][_0xa336('0x2a')]};});_0x8db81b[_0xa336('0x2b')]=_[_0xa336('0x2c')](_0xa9245f,'name');_0x8db81b['query']=_[_0xa336('0x2d')](_0x11af4e['query']);_0x8db81b[_0xa336('0x2e')]=_[_0xa336('0x2f')](_0x8db81b[_0xa336('0x2b')],_0x8db81b[_0xa336('0x30')]);_0x20fcf0[_0xa336('0x31')]=_[_0xa336('0x2f')](_0x8db81b[_0xa336('0x2b')],qs[_0xa336('0x32')](_0x11af4e[_0xa336('0x30')]['fields']));_0x20fcf0['attributes']=_0x20fcf0[_0xa336('0x31')][_0xa336('0x33')]?_0x20fcf0['attributes']:_0x8db81b[_0xa336('0x2b')];if(!_0x11af4e[_0xa336('0x30')][_0xa336('0x34')](_0xa336('0x35'))){_0x20fcf0[_0xa336('0x1a')]=qs['limit'](_0x11af4e[_0xa336('0x30')][_0xa336('0x1a')]);_0x20fcf0[_0xa336('0x18')]=qs['offset'](_0x11af4e['query']['offset']);}_0x20fcf0[_0xa336('0x36')]=qs[_0xa336('0x37')](_0x11af4e['query'][_0xa336('0x37')]);_0x20fcf0[_0xa336('0x38')]=qs[_0xa336('0x2e')](_[_0xa336('0x39')](_0x11af4e['query'],_0x8db81b[_0xa336('0x2e')]),_0xa9245f);if(_0x11af4e[_0xa336('0x30')][_0xa336('0x3a')]){_0x20fcf0[_0xa336('0x38')]=_[_0xa336('0x3b')](_0x20fcf0[_0xa336('0x38')],{'$or':_[_0xa336('0x2c')](_0xa9245f,function(_0x3c66a8){if(_0x3c66a8[_0xa336('0x29')]!==_0xa336('0x3c')){var _0x50a8c6={};_0x50a8c6[_0x3c66a8[_0xa336('0x25')]]={'$like':'%'+_0x11af4e['query']['filter']+'%'};return _0x50a8c6;}})});}_0x20fcf0=_[_0xa336('0x3b')]({},_0x20fcf0,_0x11af4e[_0xa336('0x3d')]);var _0x21b4f7={'where':_0x20fcf0[_0xa336('0x38')]};return db[_0xa336('0x3e')][_0xa336('0x1b')](_0x21b4f7)[_0xa336('0x22')](function(_0x35f6b7){_0x24460c[_0xa336('0x1b')]=_0x35f6b7;if(_0x11af4e[_0xa336('0x30')][_0xa336('0x3f')]){_0x20fcf0[_0xa336('0x40')]=[{'all':!![]}];}return db[_0xa336('0x3e')][_0xa336('0x41')](_0x20fcf0);})[_0xa336('0x22')](function(_0x542cae){_0x24460c[_0xa336('0x42')]=_0x542cae;return _0x24460c;})['then'](respondWithFilteredResult(_0xaee82d,_0x20fcf0))[_0xa336('0x43')](handleError(_0xaee82d,null));};exports['show']=function(_0x411c4b,_0x154f68){var _0x476a7d={'raw':!![],'where':{'id':_0x411c4b[_0xa336('0x44')]['id']}},_0x27cc42={};_0x27cc42[_0xa336('0x2b')]=_['keys'](db[_0xa336('0x3e')]['rawAttributes']);_0x27cc42[_0xa336('0x30')]=_[_0xa336('0x2d')](_0x411c4b[_0xa336('0x30')]);_0x27cc42[_0xa336('0x2e')]=_['intersection'](_0x27cc42[_0xa336('0x2b')],_0x27cc42[_0xa336('0x30')]);_0x476a7d[_0xa336('0x31')]=_[_0xa336('0x2f')](_0x27cc42[_0xa336('0x2b')],qs[_0xa336('0x32')](_0x411c4b[_0xa336('0x30')][_0xa336('0x32')]));_0x476a7d[_0xa336('0x31')]=_0x476a7d[_0xa336('0x31')][_0xa336('0x33')]?_0x476a7d[_0xa336('0x31')]:_0x27cc42[_0xa336('0x2b')];if(_0x411c4b[_0xa336('0x30')][_0xa336('0x3f')]){_0x476a7d[_0xa336('0x40')]=[{'all':!![]}];}_0x476a7d=_[_0xa336('0x3b')]({},_0x476a7d,_0x411c4b[_0xa336('0x3d')]);return db[_0xa336('0x3e')][_0xa336('0x45')](_0x476a7d)[_0xa336('0x22')](handleEntityNotFound(_0x154f68,null))[_0xa336('0x22')](respondWithResult(_0x154f68,null))['catch'](handleError(_0x154f68,null));};exports[_0xa336('0x46')]=function(_0x204780,_0x2bda85){return db['SquareOdbc'][_0xa336('0x46')](_0x204780['body'],{})[_0xa336('0x22')](function(_0x1d0642){var _0x5bb0f2=_0x204780[_0xa336('0x47')][_0xa336('0x48')]({'plain':!![]});if(!_0x5bb0f2)throw new Error(_0xa336('0x49'));if(_0x5bb0f2[_0xa336('0x4a')]===_0xa336('0x47')){var _0x3006a9=_0x1d0642[_0xa336('0x48')]({'plain':!![]});var _0x163614=_0xa336('0x4b');return db[_0xa336('0x4c')][_0xa336('0x45')]({'where':{'name':_0x163614,'userProfileId':_0x5bb0f2[_0xa336('0x4d')]},'raw':!![]})[_0xa336('0x22')](function(_0x2be2e0){if(_0x2be2e0&&_0x2be2e0[_0xa336('0x4e')]===0x0){return db['UserProfileResource'][_0xa336('0x46')]({'name':_0x3006a9['name'],'resourceId':_0x3006a9['id'],'type':_0x2be2e0[_0xa336('0x25')],'sectionId':_0x2be2e0['id']},{})[_0xa336('0x22')](function(){return _0x1d0642;});}else{return _0x1d0642;}})[_0xa336('0x43')](function(_0x497be3){logger['error'](_0xa336('0x4f'),_0x497be3);throw _0x497be3;});}return _0x1d0642;})[_0xa336('0x22')](respondWithResult(_0x2bda85,0xc9))[_0xa336('0x43')](handleError(_0x2bda85,null));};exports[_0xa336('0x21')]=function(_0x1d97f3,_0x38c0e6){if(_0x1d97f3[_0xa336('0x50')]['id']){delete _0x1d97f3[_0xa336('0x50')]['id'];}return db['SquareOdbc'][_0xa336('0x45')]({'where':{'id':_0x1d97f3[_0xa336('0x44')]['id']}})[_0xa336('0x22')](handleEntityNotFound(_0x38c0e6,null))[_0xa336('0x22')](saveUpdates(_0x1d97f3[_0xa336('0x50')],null))[_0xa336('0x22')](respondWithResult(_0x38c0e6,null))[_0xa336('0x43')](handleError(_0x38c0e6,null));};exports[_0xa336('0x23')]=function(_0x295a8a,_0x4b096c){return db[_0xa336('0x3e')][_0xa336('0x45')]({'where':{'id':_0x295a8a[_0xa336('0x44')]['id']}})[_0xa336('0x22')](handleEntityNotFound(_0x4b096c,null))['then'](removeEntity(_0x4b096c,null))['catch'](handleError(_0x4b096c,null));};exports['test']=function(_0x37ac6f,_0x1e3b37,_0x578cfb){var _0x15b3bd;return db[_0xa336('0x3e')][_0xa336('0x45')]({'where':{'id':_0x37ac6f[_0xa336('0x44')]['id']},'attributes':['id',_0xa336('0x51')]})['then'](handleEntityNotFound(_0x1e3b37,null))['then'](function(_0x3f7696){if(_0x3f7696){var _0x266f42=require(_0xa336('0x52'))();_0x266f42[_0xa336('0x53')](_0x3f7696['dsn']);_0x266f42[_0xa336('0x54')]();return _0x3f7696;}})['then'](respondWithResult(_0x1e3b37,null))['catch'](handleError(_0x1e3b37,null));}; \ No newline at end of file +var _0xaa25=['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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','then','ODBC','UserProfileResource','destroy','error','stack','name','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','odbc','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1f8dc0,_0x3d20c7){var _0x53b469=function(_0x5e2879){while(--_0x5e2879){_0x1f8dc0['push'](_0x1f8dc0['shift']());}};_0x53b469(++_0x3d20c7);}(_0xaa25,0x166));var _0x5aa2=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xaa25[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0x5aa2('0x0'));var rimraf=require(_0x5aa2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5aa2('0x2'));var rp=require(_0x5aa2('0x3'));var moment=require(_0x5aa2('0x4'));var BPromise=require(_0x5aa2('0x5'));var Mustache=require(_0x5aa2('0x6'));var util=require(_0x5aa2('0x7'));var path=require(_0x5aa2('0x8'));var sox=require(_0x5aa2('0x9'));var csv=require(_0x5aa2('0xa'));var ejs=require(_0x5aa2('0xb'));var fs=require('fs');var fs_extra=require(_0x5aa2('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5aa2('0xd'));var jsforce=require(_0x5aa2('0xe'));var deskjs=require(_0x5aa2('0xf'));var toCsv=require(_0x5aa2('0xa'));var querystring=require(_0x5aa2('0x10'));var Papa=require(_0x5aa2('0x11'));var Redis=require(_0x5aa2('0x12'));var authService=require(_0x5aa2('0x13'));var qs=require(_0x5aa2('0x14'));var as=require(_0x5aa2('0x15'));var hardwareService=require(_0x5aa2('0x16'));var logger=require(_0x5aa2('0x17'))(_0x5aa2('0x18'));var utils=require(_0x5aa2('0x19'));var config=require(_0x5aa2('0x1a'));var licenseUtil=require(_0x5aa2('0x1b'));var db=require(_0x5aa2('0x1c'))['db'];function respondWithStatusCode(_0x88ba4c,_0x1eaa43){_0x1eaa43=_0x1eaa43||0xcc;return function(_0x28c4f3){if(_0x28c4f3){return _0x88ba4c[_0x5aa2('0x1d')](_0x1eaa43);}return _0x88ba4c['status'](_0x1eaa43)[_0x5aa2('0x1e')]();};}function respondWithResult(_0x151409,_0x1328c6){_0x1328c6=_0x1328c6||0xc8;return function(_0x430f41){if(_0x430f41){return _0x151409[_0x5aa2('0x1f')](_0x1328c6)['json'](_0x430f41);}};}function respondWithFilteredResult(_0xf1217e,_0x399689){return function(_0x4e4e93){if(_0x4e4e93){var _0x29848d=typeof _0x399689[_0x5aa2('0x20')]===_0x5aa2('0x21')&&typeof _0x399689[_0x5aa2('0x22')]==='undefined';var _0x16b1d6=_0x4e4e93[_0x5aa2('0x23')];var _0x153caa=_0x29848d?0x0:_0x399689[_0x5aa2('0x20')];var _0x268aab=_0x29848d?_0x4e4e93[_0x5aa2('0x23')]:_0x399689[_0x5aa2('0x20')]+_0x399689['limit'];var _0x4df2bd;if(_0x268aab>=_0x16b1d6){_0x268aab=_0x16b1d6;_0x4df2bd=0xc8;}else{_0x4df2bd=0xce;}_0xf1217e['status'](_0x4df2bd);return _0xf1217e['set'](_0x5aa2('0x24'),_0x153caa+'-'+_0x268aab+'/'+_0x16b1d6)[_0x5aa2('0x25')](_0x4e4e93);}return null;};}function patchUpdates(_0x3b9f4c){return function(_0x31321d){try{jsonpatch['apply'](_0x31321d,_0x3b9f4c,!![]);}catch(_0x40eb15){return BPromise[_0x5aa2('0x26')](_0x40eb15);}return _0x31321d[_0x5aa2('0x27')]();};}function saveUpdates(_0x233da8,_0x1f38cc){return function(_0x2def62){if(_0x2def62){return _0x2def62['update'](_0x233da8)[_0x5aa2('0x28')](function(_0x446a14){return _0x446a14;});}return null;};}function removeEntity(_0x20da0b,_0x4b61e3){return function(_0x42c7b8){if(_0x42c7b8){return _0x42c7b8['destroy']()['then'](function(){var _0x1a1bb5=_0x42c7b8['get']({'plain':!![]});var _0x36793a=_0x5aa2('0x29');return db[_0x5aa2('0x2a')][_0x5aa2('0x2b')]({'where':{'type':_0x36793a,'resourceId':_0x1a1bb5['id']}})[_0x5aa2('0x28')](function(){return _0x42c7b8;});})['then'](function(){_0x20da0b[_0x5aa2('0x1f')](0xcc)[_0x5aa2('0x1e')]();});}};}function handleEntityNotFound(_0x18ae70,_0x3ef507){return function(_0x5ece0a){if(!_0x5ece0a){_0x18ae70['sendStatus'](0x194);}return _0x5ece0a;};}function handleError(_0x26c30f,_0x555399){_0x555399=_0x555399||0x1f4;return function(_0xcaedbc){logger[_0x5aa2('0x2c')](_0xcaedbc[_0x5aa2('0x2d')]);if(_0xcaedbc[_0x5aa2('0x2e')]){delete _0xcaedbc[_0x5aa2('0x2e')];}_0x26c30f[_0x5aa2('0x1f')](_0x555399)['send'](_0xcaedbc);};}exports[_0x5aa2('0x2f')]=function(_0x4c3ac1,_0x2494ce){var _0x3bbc18={},_0x4edf8e={},_0x405c21={'count':0x0,'rows':[]};var _0x2276da=_[_0x5aa2('0x30')](db[_0x5aa2('0x31')][_0x5aa2('0x32')],function(_0x5593a8){return{'name':_0x5593a8[_0x5aa2('0x33')],'type':_0x5593a8[_0x5aa2('0x34')][_0x5aa2('0x35')]};});_0x4edf8e[_0x5aa2('0x36')]=_['map'](_0x2276da,_0x5aa2('0x2e'));_0x4edf8e[_0x5aa2('0x37')]=_[_0x5aa2('0x38')](_0x4c3ac1[_0x5aa2('0x37')]);_0x4edf8e[_0x5aa2('0x39')]=_[_0x5aa2('0x3a')](_0x4edf8e[_0x5aa2('0x36')],_0x4edf8e[_0x5aa2('0x37')]);_0x3bbc18[_0x5aa2('0x3b')]=_[_0x5aa2('0x3a')](_0x4edf8e[_0x5aa2('0x36')],qs[_0x5aa2('0x3c')](_0x4c3ac1[_0x5aa2('0x37')]['fields']));_0x3bbc18[_0x5aa2('0x3b')]=_0x3bbc18[_0x5aa2('0x3b')]['length']?_0x3bbc18['attributes']:_0x4edf8e['model'];if(!_0x4c3ac1['query']['hasOwnProperty'](_0x5aa2('0x3d'))){_0x3bbc18[_0x5aa2('0x22')]=qs[_0x5aa2('0x22')](_0x4c3ac1['query'][_0x5aa2('0x22')]);_0x3bbc18[_0x5aa2('0x20')]=qs['offset'](_0x4c3ac1[_0x5aa2('0x37')][_0x5aa2('0x20')]);}_0x3bbc18[_0x5aa2('0x3e')]=qs['sort'](_0x4c3ac1[_0x5aa2('0x37')]['sort']);_0x3bbc18[_0x5aa2('0x3f')]=qs[_0x5aa2('0x39')](_[_0x5aa2('0x40')](_0x4c3ac1[_0x5aa2('0x37')],_0x4edf8e[_0x5aa2('0x39')]),_0x2276da);if(_0x4c3ac1['query'][_0x5aa2('0x41')]){_0x3bbc18[_0x5aa2('0x3f')]=_['merge'](_0x3bbc18[_0x5aa2('0x3f')],{'$or':_[_0x5aa2('0x30')](_0x2276da,function(_0x40205a){if(_0x40205a['type']!==_0x5aa2('0x42')){var _0x24fd58={};_0x24fd58[_0x40205a[_0x5aa2('0x2e')]]={'$like':'%'+_0x4c3ac1[_0x5aa2('0x37')][_0x5aa2('0x41')]+'%'};return _0x24fd58;}})});}_0x3bbc18=_[_0x5aa2('0x43')]({},_0x3bbc18,_0x4c3ac1[_0x5aa2('0x44')]);var _0x42dbc9={'where':_0x3bbc18[_0x5aa2('0x3f')]};return db[_0x5aa2('0x31')][_0x5aa2('0x23')](_0x42dbc9)['then'](function(_0x5567ae){_0x405c21[_0x5aa2('0x23')]=_0x5567ae;if(_0x4c3ac1['query']['includeAll']){_0x3bbc18[_0x5aa2('0x45')]=[{'all':!![]}];}return db[_0x5aa2('0x31')][_0x5aa2('0x46')](_0x3bbc18);})['then'](function(_0x2e5e89){_0x405c21[_0x5aa2('0x47')]=_0x2e5e89;return _0x405c21;})[_0x5aa2('0x28')](respondWithFilteredResult(_0x2494ce,_0x3bbc18))[_0x5aa2('0x48')](handleError(_0x2494ce,null));};exports[_0x5aa2('0x49')]=function(_0x1b66eb,_0x1f9bf3){var _0x2bea4d={'raw':!![],'where':{'id':_0x1b66eb[_0x5aa2('0x4a')]['id']}},_0x28a11a={};_0x28a11a[_0x5aa2('0x36')]=_[_0x5aa2('0x38')](db[_0x5aa2('0x31')][_0x5aa2('0x32')]);_0x28a11a[_0x5aa2('0x37')]=_[_0x5aa2('0x38')](_0x1b66eb[_0x5aa2('0x37')]);_0x28a11a[_0x5aa2('0x39')]=_[_0x5aa2('0x3a')](_0x28a11a[_0x5aa2('0x36')],_0x28a11a['query']);_0x2bea4d[_0x5aa2('0x3b')]=_[_0x5aa2('0x3a')](_0x28a11a[_0x5aa2('0x36')],qs[_0x5aa2('0x3c')](_0x1b66eb['query']['fields']));_0x2bea4d[_0x5aa2('0x3b')]=_0x2bea4d[_0x5aa2('0x3b')][_0x5aa2('0x4b')]?_0x2bea4d['attributes']:_0x28a11a[_0x5aa2('0x36')];if(_0x1b66eb['query']['includeAll']){_0x2bea4d[_0x5aa2('0x45')]=[{'all':!![]}];}_0x2bea4d=_[_0x5aa2('0x43')]({},_0x2bea4d,_0x1b66eb[_0x5aa2('0x44')]);return db[_0x5aa2('0x31')][_0x5aa2('0x4c')](_0x2bea4d)['then'](handleEntityNotFound(_0x1f9bf3,null))[_0x5aa2('0x28')](respondWithResult(_0x1f9bf3,null))[_0x5aa2('0x48')](handleError(_0x1f9bf3,null));};exports[_0x5aa2('0x4d')]=function(_0x2f51f3,_0x2ad44b){return db[_0x5aa2('0x31')][_0x5aa2('0x4d')](_0x2f51f3[_0x5aa2('0x4e')],{})[_0x5aa2('0x28')](function(_0x4d18d7){var _0x1be319=_0x2f51f3[_0x5aa2('0x4f')][_0x5aa2('0x50')]({'plain':!![]});if(!_0x1be319)throw new Error(_0x5aa2('0x51'));if(_0x1be319['role']===_0x5aa2('0x4f')){var _0xf72465=_0x4d18d7[_0x5aa2('0x50')]({'plain':!![]});var _0x529b9c=_0x5aa2('0x29');return db[_0x5aa2('0x52')][_0x5aa2('0x4c')]({'where':{'name':_0x529b9c,'userProfileId':_0x1be319[_0x5aa2('0x53')]},'raw':!![]})[_0x5aa2('0x28')](function(_0x4423f6){if(_0x4423f6&&_0x4423f6[_0x5aa2('0x54')]===0x0){return db[_0x5aa2('0x2a')][_0x5aa2('0x4d')]({'name':_0xf72465[_0x5aa2('0x2e')],'resourceId':_0xf72465['id'],'type':_0x4423f6[_0x5aa2('0x2e')],'sectionId':_0x4423f6['id']},{})[_0x5aa2('0x28')](function(){return _0x4d18d7;});}else{return _0x4d18d7;}})['catch'](function(_0x2239a6){logger[_0x5aa2('0x2c')](_0x5aa2('0x55'),_0x2239a6);throw _0x2239a6;});}return _0x4d18d7;})[_0x5aa2('0x28')](respondWithResult(_0x2ad44b,0xc9))[_0x5aa2('0x48')](handleError(_0x2ad44b,null));};exports[_0x5aa2('0x56')]=function(_0x2043e7,_0xd24207){if(_0x2043e7[_0x5aa2('0x4e')]['id']){delete _0x2043e7[_0x5aa2('0x4e')]['id'];}return db['SquareOdbc'][_0x5aa2('0x4c')]({'where':{'id':_0x2043e7['params']['id']}})['then'](handleEntityNotFound(_0xd24207,null))[_0x5aa2('0x28')](saveUpdates(_0x2043e7[_0x5aa2('0x4e')],null))[_0x5aa2('0x28')](respondWithResult(_0xd24207,null))[_0x5aa2('0x48')](handleError(_0xd24207,null));};exports[_0x5aa2('0x2b')]=function(_0xd7c367,_0x3660fa){return db[_0x5aa2('0x31')][_0x5aa2('0x4c')]({'where':{'id':_0xd7c367['params']['id']}})[_0x5aa2('0x28')](handleEntityNotFound(_0x3660fa,null))[_0x5aa2('0x28')](removeEntity(_0x3660fa,null))[_0x5aa2('0x48')](handleError(_0x3660fa,null));};exports[_0x5aa2('0x57')]=function(_0x49a72c,_0x435fd6,_0x3df529){var _0x321104;return db[_0x5aa2('0x31')][_0x5aa2('0x4c')]({'where':{'id':_0x49a72c[_0x5aa2('0x4a')]['id']},'attributes':['id',_0x5aa2('0x58')]})[_0x5aa2('0x28')](handleEntityNotFound(_0x435fd6,null))[_0x5aa2('0x28')](function(_0x5a5dc4){if(_0x5a5dc4){var _0x22786e=require(_0x5aa2('0x59'))();_0x22786e['openSync'](_0x5a5dc4[_0x5aa2('0x58')]);_0x22786e[_0x5aa2('0x5a')]();return _0x5a5dc4;}})['then'](respondWithResult(_0x435fd6,null))[_0x5aa2('0x48')](handleError(_0x435fd6,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 323035e..3438125 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 _0x6824=['bluebird','request-promise','rimraf','../../config/environment','exports','define','square_odbc','lodash','util','../../config/logger','moment'];(function(_0x5c328e,_0x1e9625){var _0x35f259=function(_0x2b1a5e){while(--_0x2b1a5e){_0x5c328e['push'](_0x5c328e['shift']());}};_0x35f259(++_0x1e9625);}(_0x6824,0x104));var _0x4682=function(_0x4bf367,_0x4820f8){_0x4bf367=_0x4bf367-0x0;var _0x66636c=_0x6824[_0x4bf367];return _0x66636c;};'use strict';var _=require(_0x4682('0x0'));var util=require(_0x4682('0x1'));var logger=require(_0x4682('0x2'))('api');var moment=require(_0x4682('0x3'));var BPromise=require(_0x4682('0x4'));var rp=require(_0x4682('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4682('0x6'));var config=require(_0x4682('0x7'));var attributes=require('./squareOdbc.attributes');module[_0x4682('0x8')]=function(_0x1f3b03,_0x1c4e1f){return _0x1f3b03[_0x4682('0x9')]('SquareOdbc',attributes,{'tableName':_0x4682('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22f2=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util'];(function(_0x334aee,_0x240f87){var _0x37acd5=function(_0x53e6cc){while(--_0x53e6cc){_0x334aee['push'](_0x334aee['shift']());}};_0x37acd5(++_0x240f87);}(_0x22f2,0x98));var _0x222f=function(_0x410448,_0x3f8548){_0x410448=_0x410448-0x0;var _0x5c3225=_0x22f2[_0x410448];return _0x5c3225;};'use strict';var _=require(_0x222f('0x0'));var util=require(_0x222f('0x1'));var logger=require(_0x222f('0x2'))(_0x222f('0x3'));var moment=require('moment');var BPromise=require(_0x222f('0x4'));var rp=require(_0x222f('0x5'));var fs=require('fs');var path=require(_0x222f('0x6'));var rimraf=require(_0x222f('0x7'));var config=require(_0x222f('0x8'));var attributes=require(_0x222f('0x9'));module[_0x222f('0xa')]=function(_0x12c528,_0x2148a1){return _0x12c528[_0x222f('0xb')](_0x222f('0xc'),attributes,{'tableName':_0x222f('0xd'),'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 5213f73..5ec384f 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 _0x65d4=['stringify','error','code','message','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x65d4,0x163));var _0x465d=function(_0x5cab69,_0xfdd787){_0x5cab69=_0x5cab69-0x0;var _0x67bff9=_0x65d4[_0x5cab69];return _0x67bff9;};'use strict';var _=require(_0x465d('0x0'));var util=require(_0x465d('0x1'));var moment=require(_0x465d('0x2'));var BPromise=require(_0x465d('0x3'));var rs=require(_0x465d('0x4'));var fs=require('fs');var Redis=require(_0x465d('0x5'));var db=require(_0x465d('0x6'))['db'];var utils=require(_0x465d('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x465d('0x8'));var jayson=require(_0x465d('0x9'));var client=jayson[_0x465d('0xa')][_0x465d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x547dd4,_0x24788d,_0x16af6c){return new BPromise(function(_0x214a17,_0x210d1a){return client[_0x465d('0xc')](_0x547dd4,_0x16af6c)[_0x465d('0xd')](function(_0x77af04){logger[_0x465d('0xe')](_0x465d('0xf'),_0x24788d,'request\x20sent');logger[_0x465d('0x10')](_0x465d('0x11'),_0x24788d,_0x465d('0x12'),JSON[_0x465d('0x13')](_0x77af04));if(_0x77af04[_0x465d('0x14')]){if(_0x77af04[_0x465d('0x14')][_0x465d('0x15')]===0x1f4){logger[_0x465d('0x14')](_0x465d('0xf'),_0x24788d,_0x77af04[_0x465d('0x14')][_0x465d('0x16')]);return _0x210d1a(_0x77af04[_0x465d('0x14')][_0x465d('0x16')]);}logger['error'](_0x465d('0xf'),_0x24788d,_0x77af04[_0x465d('0x14')][_0x465d('0x16')]);return _0x214a17(_0x77af04['error'][_0x465d('0x16')]);}else{logger['info'](_0x465d('0xf'),_0x24788d,_0x465d('0x12'));_0x214a17(_0x77af04['result'][_0x465d('0x16')]);}})[_0x465d('0x17')](function(_0x5b81cb){logger[_0x465d('0x14')](_0x465d('0xf'),_0x24788d,_0x5b81cb);_0x210d1a(_0x5b81cb);});});}exports[_0x465d('0x18')]=function(_0x45b7ef){var _0x251c46=this;return new Promise(function(_0x5098d2,_0x65596b){return db[_0x465d('0x19')][_0x465d('0x1a')]({'raw':_0x45b7ef['options']?_0x45b7ef[_0x465d('0x1b')][_0x465d('0x1c')]===undefined?!![]:![]:!![],'where':_0x45b7ef[_0x465d('0x1b')]?_0x45b7ef[_0x465d('0x1b')][_0x465d('0x1d')]||null:null,'attributes':_0x45b7ef[_0x465d('0x1b')]?_0x45b7ef[_0x465d('0x1b')][_0x465d('0x1e')]||null:null,'include':_0x45b7ef[_0x465d('0x1b')]?_0x45b7ef[_0x465d('0x1b')][_0x465d('0x1f')]?_[_0x465d('0x20')](_0x45b7ef[_0x465d('0x1b')][_0x465d('0x1f')],function(_0x73895e){return{'model':db[_0x73895e[_0x465d('0x21')]],'as':_0x73895e['as'],'attributes':_0x73895e['attributes'],'include':_0x73895e[_0x465d('0x1f')]?_[_0x465d('0x20')](_0x73895e[_0x465d('0x1f')],function(_0xd52e80){return{'model':db[_0xd52e80[_0x465d('0x21')]],'as':_0xd52e80['as'],'attributes':_0xd52e80['attributes'],'include':_0xd52e80[_0x465d('0x1f')]?_[_0x465d('0x20')](_0xd52e80[_0x465d('0x1f')],function(_0x23fc29){return{'model':db[_0x23fc29[_0x465d('0x21')]],'as':_0x23fc29['as'],'attributes':_0x23fc29['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cb093){logger['info'](_0x465d('0x18'),_0x45b7ef);logger[_0x465d('0x10')]('ShowSquareOdbc',_0x45b7ef,JSON[_0x465d('0x13')](_0x4cb093));_0x5098d2(_0x4cb093);})[_0x465d('0x17')](function(_0x16532b){logger['error']('ShowSquareOdbc',_0x16532b[_0x465d('0x16')],_0x45b7ef);_0x65596b(_0x251c46[_0x465d('0x14')](0x1f4,_0x16532b[_0x465d('0x16')]));});});}; \ No newline at end of file +var _0xb533=['../../config/environment','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','message','result','SquareOdbc','find','options','raw','where','include','map','model','attributes','then','ShowSquareOdbc','stringify','catch','moment','../../config/utils'];(function(_0x55849b,_0x2229c1){var _0x4a7713=function(_0x14437d){while(--_0x14437d){_0x55849b['push'](_0x55849b['shift']());}};_0x4a7713(++_0x2229c1);}(_0xb533,0x10c));var _0x3b53=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xb533[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3b53('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3b53('0x1'));var logger=require('../../config/logger')('rpc');var config=require(_0x3b53('0x2'));var jayson=require('jayson/promise');var client=jayson[_0x3b53('0x3')][_0x3b53('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x9952b3,_0x5d030e,_0x4d4fcc){return new BPromise(function(_0x506767,_0x390f26){return client[_0x3b53('0x5')](_0x9952b3,_0x4d4fcc)['then'](function(_0x411a5a){logger[_0x3b53('0x6')](_0x3b53('0x7'),_0x5d030e,_0x3b53('0x8'));logger[_0x3b53('0x9')](_0x3b53('0xa'),_0x5d030e,'request\x20sent',JSON['stringify'](_0x411a5a));if(_0x411a5a['error']){if(_0x411a5a[_0x3b53('0xb')]['code']===0x1f4){logger[_0x3b53('0xb')](_0x3b53('0x7'),_0x5d030e,_0x411a5a[_0x3b53('0xb')]['message']);return _0x390f26(_0x411a5a['error'][_0x3b53('0xc')]);}logger[_0x3b53('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x5d030e,_0x411a5a['error'][_0x3b53('0xc')]);return _0x506767(_0x411a5a['error']['message']);}else{logger[_0x3b53('0x6')]('SquareOdbc,\x20%s,\x20%s',_0x5d030e,_0x3b53('0x8'));_0x506767(_0x411a5a[_0x3b53('0xd')][_0x3b53('0xc')]);}})['catch'](function(_0xc9b31b){logger[_0x3b53('0xb')](_0x3b53('0x7'),_0x5d030e,_0xc9b31b);_0x390f26(_0xc9b31b);});});}exports['ShowSquareOdbc']=function(_0x398559){var _0xb5c2b=this;return new Promise(function(_0x4ae789,_0x29964f){return db[_0x3b53('0xe')][_0x3b53('0xf')]({'raw':_0x398559[_0x3b53('0x10')]?_0x398559['options'][_0x3b53('0x11')]===undefined?!![]:![]:!![],'where':_0x398559[_0x3b53('0x10')]?_0x398559['options'][_0x3b53('0x12')]||null:null,'attributes':_0x398559['options']?_0x398559[_0x3b53('0x10')]['attributes']||null:null,'include':_0x398559[_0x3b53('0x10')]?_0x398559['options'][_0x3b53('0x13')]?_[_0x3b53('0x14')](_0x398559['options']['include'],function(_0x163894){return{'model':db[_0x163894[_0x3b53('0x15')]],'as':_0x163894['as'],'attributes':_0x163894['attributes'],'include':_0x163894[_0x3b53('0x13')]?_['map'](_0x163894[_0x3b53('0x13')],function(_0xb395fe){return{'model':db[_0xb395fe['model']],'as':_0xb395fe['as'],'attributes':_0xb395fe[_0x3b53('0x16')],'include':_0xb395fe[_0x3b53('0x13')]?_[_0x3b53('0x14')](_0xb395fe[_0x3b53('0x13')],function(_0x4c0466){return{'model':db[_0x4c0466[_0x3b53('0x15')]],'as':_0x4c0466['as'],'attributes':_0x4c0466[_0x3b53('0x16')]};}):[]};}):[]};}):[]:[]})[_0x3b53('0x17')](function(_0xaaf408){logger[_0x3b53('0x6')](_0x3b53('0x18'),_0x398559);logger[_0x3b53('0x9')]('ShowSquareOdbc',_0x398559,JSON[_0x3b53('0x19')](_0xaaf408));_0x4ae789(_0xaaf408);})[_0x3b53('0x1a')](function(_0x4db76b){logger[_0x3b53('0xb')](_0x3b53('0x18'),_0x4db76b['message'],_0x398559);_0x29964f(_0xb5c2b[_0x3b53('0xb')](0x1f4,_0x4db76b['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 9ffc6ef..97cdd20 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 _0x4b8b=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x3f9fad,_0x1c8ca6){var _0x56230f=function(_0x29db5e){while(--_0x29db5e){_0x3f9fad['push'](_0x3f9fad['shift']());}};_0x56230f(++_0x1c8ca6);}(_0x4b8b,0x179));var _0xb4b8=function(_0xb949a9,_0x2f948a){_0xb949a9=_0xb949a9-0x0;var _0x31932b=_0x4b8b[_0xb949a9];return _0x31932b;};'use strict';var multer=require('multer');var util=require(_0xb4b8('0x0'));var path=require(_0xb4b8('0x1'));var timeout=require(_0xb4b8('0x2'));var express=require(_0xb4b8('0x3'));var router=express[_0xb4b8('0x4')]();var fs_extra=require(_0xb4b8('0x5'));var auth=require(_0xb4b8('0x6'));var interaction=require(_0xb4b8('0x7'));var config=require(_0xb4b8('0x8'));var controller=require(_0xb4b8('0x9'));router[_0xb4b8('0xa')]('/',auth[_0xb4b8('0xb')](),controller[_0xb4b8('0xc')]);router[_0xb4b8('0xa')](_0xb4b8('0xd'),auth[_0xb4b8('0xb')](),controller[_0xb4b8('0xe')]);router[_0xb4b8('0xf')]('/',auth['isAuthenticated'](),controller[_0xb4b8('0x10')]);router[_0xb4b8('0x11')](_0xb4b8('0xd'),auth['isAuthenticated'](),controller[_0xb4b8('0x12')]);router[_0xb4b8('0x13')](_0xb4b8('0xd'),auth[_0xb4b8('0xb')](),controller[_0xb4b8('0x14')]);module[_0xb4b8('0x15')]=router; \ No newline at end of file +var _0x0fe1=['update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0fe1,0x1cb));var _0x10fe=function(_0x453ccf,_0x4ed71d){_0x453ccf=_0x453ccf-0x0;var _0x1c6582=_0x0fe1[_0x453ccf];return _0x1c6582;};'use strict';var multer=require(_0x10fe('0x0'));var util=require(_0x10fe('0x1'));var path=require(_0x10fe('0x2'));var timeout=require(_0x10fe('0x3'));var express=require('express');var router=express[_0x10fe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x10fe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x10fe('0x6'));var controller=require(_0x10fe('0x7'));router[_0x10fe('0x8')]('/',auth[_0x10fe('0x9')](),controller[_0x10fe('0xa')]);router[_0x10fe('0x8')](_0x10fe('0xb'),auth[_0x10fe('0x9')](),controller[_0x10fe('0xc')]);router[_0x10fe('0xd')]('/',auth[_0x10fe('0x9')](),controller[_0x10fe('0xe')]);router[_0x10fe('0xf')](_0x10fe('0xb'),auth[_0x10fe('0x9')](),controller[_0x10fe('0x10')]);router[_0x10fe('0x11')](_0x10fe('0xb'),auth[_0x10fe('0x9')](),controller['destroy']);module[_0x10fe('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 8764c25..6195088 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 _0x6ead=['toString','utf8','production','DATE','sequelize','exports','STRING','BLOB','long','getDataValue','preproduction'];(function(_0x544abc,_0x1fc906){var _0x2f285a=function(_0x4158a3){while(--_0x4158a3){_0x544abc['push'](_0x544abc['shift']());}};_0x2f285a(++_0x1fc906);}(_0x6ead,0x122));var _0xd6ea=function(_0x540a64,_0x198609){_0x540a64=_0x540a64-0x0;var _0x1d9160=_0x6ead[_0x540a64];return _0x1d9160;};'use strict';var Sequelize=require(_0xd6ea('0x0'));module[_0xd6ea('0x1')]={'name':{'type':Sequelize[_0xd6ea('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xd6ea('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xd6ea('0x3')](_0xd6ea('0x4')),'get':function(){if(this[_0xd6ea('0x5')](_0xd6ea('0x6'))){return this['getDataValue'](_0xd6ea('0x6'))[_0xd6ea('0x7')](_0xd6ea('0x8'));}}},'production':{'type':Sequelize[_0xd6ea('0x3')]('long'),'get':function(){if(this[_0xd6ea('0x5')](_0xd6ea('0x9'))){return this[_0xd6ea('0x5')](_0xd6ea('0x9'))[_0xd6ea('0x7')](_0xd6ea('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xd6ea('0xa')]}}; \ No newline at end of file +var _0x56b1=['TEXT','BLOB','getDataValue','preproduction','toString','utf8','long','production','DATE','sequelize','exports','name','STRING'];(function(_0x227446,_0x5312bc){var _0x4dc9cc=function(_0x5ef9f1){while(--_0x5ef9f1){_0x227446['push'](_0x227446['shift']());}};_0x4dc9cc(++_0x5312bc);}(_0x56b1,0x168));var _0x156b=function(_0x1982ca,_0x3c0eeb){_0x1982ca=_0x1982ca-0x0;var _0x691ee2=_0x56b1[_0x1982ca];return _0x691ee2;};'use strict';var Sequelize=require(_0x156b('0x0'));module[_0x156b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x156b('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x156b('0x3')]},'notes':{'type':Sequelize[_0x156b('0x4')]},'preproduction':{'type':Sequelize[_0x156b('0x5')]('long'),'get':function(){if(this[_0x156b('0x6')](_0x156b('0x7'))){return this['getDataValue'](_0x156b('0x7'))[_0x156b('0x8')](_0x156b('0x9'));}}},'production':{'type':Sequelize[_0x156b('0x5')](_0x156b('0xa')),'get':function(){if(this['getDataValue'](_0x156b('0xb'))){return this[_0x156b('0x6')]('production')[_0x156b('0x8')](_0x156b('0x9'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x156b('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 44a2a59..7702111 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 _0x4c10=['SquareProject','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','pick','production','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','UserProfileResource','publish','agi','end','error','stack','name','send','index','map'];(function(_0x16b19e,_0x59877d){var _0x49a970=function(_0x5106c0){while(--_0x5106c0){_0x16b19e['push'](_0x16b19e['shift']());}};_0x49a970(++_0x59877d);}(_0x4c10,0xb6));var _0x04c1=function(_0x510dc5,_0xae00a0){_0x510dc5=_0x510dc5-0x0;var _0x109993=_0x4c10[_0x510dc5];return _0x109993;};'use strict';var _=require('lodash');var Redis=require(_0x04c1('0x0'));var qs=require(_0x04c1('0x1'));var logger=require(_0x04c1('0x2'))(_0x04c1('0x3'));var config=require(_0x04c1('0x4'));var db=require(_0x04c1('0x5'))['db'];config[_0x04c1('0x6')]=_[_0x04c1('0x7')](config[_0x04c1('0x6')],{'host':_0x04c1('0x8'),'port':0x18eb});var socket=require(_0x04c1('0x9'))(new Redis(config[_0x04c1('0x6')]));require(_0x04c1('0xa'))[_0x04c1('0xb')](socket);function respondWithResult(_0x413c04,_0x38db7c){_0x38db7c=_0x38db7c||0xc8;return function(_0x149c62){if(_0x149c62){return _0x413c04[_0x04c1('0xc')](_0x38db7c)[_0x04c1('0xd')](_0x149c62);}};}function respondWithFilteredResult(_0x552824,_0x57cdc8){return function(_0x2364ec){if(_0x2364ec){var _0x127da4=typeof _0x57cdc8[_0x04c1('0xe')]===_0x04c1('0xf')&&typeof _0x57cdc8[_0x04c1('0x10')]==='undefined';var _0x7928e=_0x2364ec[_0x04c1('0x11')];var _0x1bf7f1=_0x127da4?0x0:_0x57cdc8[_0x04c1('0xe')];var _0xcb4773=_0x127da4?_0x2364ec[_0x04c1('0x11')]:_0x57cdc8[_0x04c1('0xe')]+_0x57cdc8[_0x04c1('0x10')];var _0x5c8718;if(_0xcb4773>=_0x7928e){_0xcb4773=_0x7928e;_0x5c8718=0xc8;}else{_0x5c8718=0xce;}_0x552824[_0x04c1('0xc')](_0x5c8718);return _0x552824[_0x04c1('0x12')](_0x04c1('0x13'),_0x1bf7f1+'-'+_0xcb4773+'/'+_0x7928e)[_0x04c1('0xd')](_0x2364ec);}return null;};}function saveUpdates(_0x463190){return function(_0x5e848c){if(_0x5e848c){return _0x5e848c[_0x04c1('0x14')](_0x463190)[_0x04c1('0x15')](function(_0x43318f){return _0x43318f;});}return null;};}function removeEntity(_0x5c57a7){return function(_0xeebed2){if(_0xeebed2){return _0xeebed2[_0x04c1('0x16')]()[_0x04c1('0x15')](function(){var _0x424436=_0xeebed2[_0x04c1('0x17')]({'plain':!![]});var _0x34574a='SquareProjects';return db[_0x04c1('0x18')]['destroy']({'where':{'type':_0x34574a,'resourceId':_0x424436['id']}})[_0x04c1('0x15')](function(){return _0xeebed2;});})['then'](function(){var _0x26d382=new Redis(config[_0x04c1('0x6')]);_0x26d382[_0x04c1('0x19')](_0x04c1('0x1a'),JSON['stringify']({'id':_0xeebed2['id'],'deleted':!![]}));})[_0x04c1('0x15')](function(){_0x5c57a7['status'](0xcc)[_0x04c1('0x1b')]();});}};}function handleEntityNotFound(_0xb07a52){return function(_0x518c32){if(!_0x518c32){_0xb07a52['sendStatus'](0x194);}return _0x518c32;};}function handleError(_0x21750b,_0x294ce3){_0x294ce3=_0x294ce3||0x1f4;return function(_0x5a454c){logger[_0x04c1('0x1c')](_0x5a454c[_0x04c1('0x1d')]);if(_0x5a454c[_0x04c1('0x1e')]){delete _0x5a454c[_0x04c1('0x1e')];}_0x21750b[_0x04c1('0xc')](_0x294ce3)[_0x04c1('0x1f')](_0x5a454c);};}exports[_0x04c1('0x20')]=function(_0x44863a,_0x4a8dc2){var _0x10166b={},_0x4548a0={},_0x38fd7f={'count':0x0,'rows':[]};var _0xd0160d=_[_0x04c1('0x21')](db[_0x04c1('0x22')][_0x04c1('0x23')],function(_0x13d0ec){return{'name':_0x13d0ec[_0x04c1('0x24')],'type':_0x13d0ec[_0x04c1('0x25')]['key']};});_0x4548a0[_0x04c1('0x26')]=_[_0x04c1('0x21')](_0xd0160d,_0x04c1('0x1e'));_0x4548a0[_0x04c1('0x27')]=_['keys'](_0x44863a['query']);_0x4548a0[_0x04c1('0x28')]=_[_0x04c1('0x29')](_0x4548a0[_0x04c1('0x26')],_0x4548a0[_0x04c1('0x27')]);_0x10166b['attributes']=_[_0x04c1('0x29')](_0x4548a0[_0x04c1('0x26')],qs[_0x04c1('0x2a')](_0x44863a[_0x04c1('0x27')]['fields']));_0x10166b[_0x04c1('0x2b')]=_0x10166b[_0x04c1('0x2b')][_0x04c1('0x2c')]?_0x10166b[_0x04c1('0x2b')]:_0x4548a0['model'];if(!_0x44863a[_0x04c1('0x27')][_0x04c1('0x2d')](_0x04c1('0x2e'))){_0x10166b[_0x04c1('0x10')]=qs[_0x04c1('0x10')](_0x44863a[_0x04c1('0x27')]['limit']);_0x10166b[_0x04c1('0xe')]=qs[_0x04c1('0xe')](_0x44863a[_0x04c1('0x27')][_0x04c1('0xe')]);}_0x10166b['order']=qs['sort'](_0x44863a['query'][_0x04c1('0x2f')]);_0x10166b[_0x04c1('0x30')]=qs[_0x04c1('0x28')](_['pick'](_0x44863a[_0x04c1('0x27')],_0x4548a0[_0x04c1('0x28')]),_0xd0160d);if(_0x44863a[_0x04c1('0x27')][_0x04c1('0x31')]){_0x10166b['where']=_[_0x04c1('0x32')](_0x10166b[_0x04c1('0x30')],{'$or':_['map'](_0xd0160d,function(_0x5ecb96){if(_0x5ecb96['type']!=='VIRTUAL'){var _0x2d1ff1={};_0x2d1ff1[_0x5ecb96[_0x04c1('0x1e')]]={'$like':'%'+_0x44863a[_0x04c1('0x27')]['filter']+'%'};return _0x2d1ff1;}})});}_0x10166b=_['merge']({},_0x10166b,_0x44863a[_0x04c1('0x33')]);var _0x5b5086={'where':_0x10166b['where']};return db[_0x04c1('0x22')][_0x04c1('0x11')](_0x5b5086)[_0x04c1('0x15')](function(_0x5f52c2){_0x38fd7f[_0x04c1('0x11')]=_0x5f52c2;if(_0x44863a[_0x04c1('0x27')]['includeAll']){_0x10166b[_0x04c1('0x34')]=[{'all':!![]}];}return db['SquareProject'][_0x04c1('0x35')](_0x10166b);})[_0x04c1('0x15')](function(_0x7fecfe){_0x38fd7f[_0x04c1('0x36')]=_0x7fecfe;return _0x38fd7f;})['then'](respondWithFilteredResult(_0x4a8dc2,_0x10166b))[_0x04c1('0x37')](handleError(_0x4a8dc2,null));};exports[_0x04c1('0x38')]=function(_0x4983fe,_0x2829e6){var _0x3cfb30={'raw':![],'where':{'id':_0x4983fe['params']['id']}},_0x581e17={};_0x581e17[_0x04c1('0x26')]=_[_0x04c1('0x39')](db[_0x04c1('0x22')]['rawAttributes']);_0x581e17[_0x04c1('0x27')]=_[_0x04c1('0x39')](_0x4983fe[_0x04c1('0x27')]);_0x581e17[_0x04c1('0x28')]=_[_0x04c1('0x29')](_0x581e17['model'],_0x581e17[_0x04c1('0x27')]);_0x3cfb30[_0x04c1('0x2b')]=_[_0x04c1('0x29')](_0x581e17[_0x04c1('0x26')],qs[_0x04c1('0x2a')](_0x4983fe['query'][_0x04c1('0x2a')]));_0x3cfb30[_0x04c1('0x2b')]=_0x3cfb30[_0x04c1('0x2b')][_0x04c1('0x2c')]?_0x3cfb30[_0x04c1('0x2b')]:_0x581e17[_0x04c1('0x26')];if(_0x4983fe[_0x04c1('0x27')][_0x04c1('0x3a')]){_0x3cfb30['include']=[{'all':!![]}];}_0x3cfb30=_[_0x04c1('0x32')]({},_0x3cfb30,_0x4983fe[_0x04c1('0x33')]);return db[_0x04c1('0x22')][_0x04c1('0x3b')](_0x3cfb30)['then'](handleEntityNotFound(_0x2829e6,null))['then'](respondWithResult(_0x2829e6,null))[_0x04c1('0x37')](handleError(_0x2829e6,null));};exports[_0x04c1('0x3c')]=function(_0x3360ad,_0x3d1967){return db[_0x04c1('0x22')]['create'](_0x3360ad[_0x04c1('0x3d')],{})[_0x04c1('0x15')](function(_0x46e160){var _0x5b7df5=_0x3360ad['user'][_0x04c1('0x17')]({'plain':!![]});if(!_0x5b7df5)throw new Error(_0x04c1('0x3e'));if(_0x5b7df5[_0x04c1('0x3f')]==='user'){var _0xcaa8f1=_0x46e160[_0x04c1('0x17')]({'plain':!![]});var _0x17aa04=_0x04c1('0x40');return db[_0x04c1('0x41')][_0x04c1('0x3b')]({'where':{'name':_0x17aa04,'userProfileId':_0x5b7df5[_0x04c1('0x42')]},'raw':!![]})[_0x04c1('0x15')](function(_0x4db628){if(_0x4db628&&_0x4db628[_0x04c1('0x43')]===0x0){return db[_0x04c1('0x18')]['create']({'name':_0xcaa8f1[_0x04c1('0x1e')],'resourceId':_0xcaa8f1['id'],'type':_0x4db628[_0x04c1('0x1e')],'sectionId':_0x4db628['id']},{})[_0x04c1('0x15')](function(){return _0x46e160;});}else{return _0x46e160;}})[_0x04c1('0x37')](function(_0x23c69e){logger[_0x04c1('0x1c')](_0x04c1('0x44'),_0x23c69e);throw _0x23c69e;});}return _0x46e160;})[_0x04c1('0x15')](respondWithResult(_0x3d1967,0xc9))['catch'](handleError(_0x3d1967,null));};exports[_0x04c1('0x14')]=function(_0x45f352,_0x3fe217){if(_0x45f352['body']['id']){delete _0x45f352[_0x04c1('0x3d')]['id'];}return db[_0x04c1('0x22')][_0x04c1('0x3b')]({'where':{'id':_0x45f352[_0x04c1('0x45')]['id']}})['then'](handleEntityNotFound(_0x3fe217,null))['then'](saveUpdates(_0x45f352[_0x04c1('0x3d')],null))[_0x04c1('0x15')](function(_0x4ef096){if(!_0x4ef096)return;var _0x43077f=_0x4ef096[_0x04c1('0x17')]({'plain':!![]});return _0x43077f;})[_0x04c1('0x15')](function(_0x117cb4){var _0x4ac2bc=new Redis(config[_0x04c1('0x6')]);_0x4ac2bc[_0x04c1('0x19')](_0x04c1('0x1a'),JSON['stringify'](_[_0x04c1('0x46')](_0x117cb4,['id',_0x04c1('0x1e'),_0x04c1('0x47')])));return _0x117cb4;})[_0x04c1('0x15')](respondWithResult(_0x3fe217,null))[_0x04c1('0x37')](handleError(_0x3fe217,null));};exports['destroy']=function(_0x5df1c3,_0x2c0550){return db[_0x04c1('0x22')][_0x04c1('0x3b')]({'where':{'id':_0x5df1c3[_0x04c1('0x45')]['id']}})[_0x04c1('0x15')](handleEntityNotFound(_0x2c0550,null))[_0x04c1('0x15')](removeEntity(_0x2c0550,null))[_0x04c1('0x37')](handleError(_0x2c0550,null));}; \ No newline at end of file +var _0xebad=['pick','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','get','SquareProjects','publish','agi','stringify','end','name','index','SquareProject','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','type','includeAll','include','findAll','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find'];(function(_0x2bfa51,_0x59be1b){var _0x32145f=function(_0x2fe333){while(--_0x2fe333){_0x2bfa51['push'](_0x2bfa51['shift']());}};_0x32145f(++_0x59be1b);}(_0xebad,0x88));var _0xdeba=function(_0x4fd372,_0x3ca32f){_0x4fd372=_0x4fd372-0x0;var _0x3228f2=_0xebad[_0x4fd372];return _0x3228f2;};'use strict';var _=require(_0xdeba('0x0'));var Redis=require(_0xdeba('0x1'));var qs=require(_0xdeba('0x2'));var logger=require(_0xdeba('0x3'))(_0xdeba('0x4'));var config=require(_0xdeba('0x5'));var db=require('../../mysqldb')['db'];config[_0xdeba('0x6')]=_[_0xdeba('0x7')](config[_0xdeba('0x6')],{'host':_0xdeba('0x8'),'port':0x18eb});var socket=require(_0xdeba('0x9'))(new Redis(config[_0xdeba('0x6')]));require(_0xdeba('0xa'))[_0xdeba('0xb')](socket);function respondWithResult(_0x5b4b58,_0x37be96){_0x37be96=_0x37be96||0xc8;return function(_0x386379){if(_0x386379){return _0x5b4b58[_0xdeba('0xc')](_0x37be96)[_0xdeba('0xd')](_0x386379);}};}function respondWithFilteredResult(_0x14598c,_0x1b6e78){return function(_0x21c3b3){if(_0x21c3b3){var _0x497708=typeof _0x1b6e78['offset']===_0xdeba('0xe')&&typeof _0x1b6e78[_0xdeba('0xf')]===_0xdeba('0xe');var _0x2eb979=_0x21c3b3[_0xdeba('0x10')];var _0xc643d5=_0x497708?0x0:_0x1b6e78[_0xdeba('0x11')];var _0x236bf8=_0x497708?_0x21c3b3['count']:_0x1b6e78['offset']+_0x1b6e78[_0xdeba('0xf')];var _0x29a12d;if(_0x236bf8>=_0x2eb979){_0x236bf8=_0x2eb979;_0x29a12d=0xc8;}else{_0x29a12d=0xce;}_0x14598c[_0xdeba('0xc')](_0x29a12d);return _0x14598c[_0xdeba('0x12')](_0xdeba('0x13'),_0xc643d5+'-'+_0x236bf8+'/'+_0x2eb979)[_0xdeba('0xd')](_0x21c3b3);}return null;};}function saveUpdates(_0x1fba66){return function(_0x40404f){if(_0x40404f){return _0x40404f[_0xdeba('0x14')](_0x1fba66)[_0xdeba('0x15')](function(_0x597d5b){return _0x597d5b;});}return null;};}function removeEntity(_0x35a4c2){return function(_0x297820){if(_0x297820){return _0x297820[_0xdeba('0x16')]()[_0xdeba('0x15')](function(){var _0x4c2541=_0x297820[_0xdeba('0x17')]({'plain':!![]});var _0x499809=_0xdeba('0x18');return db['UserProfileResource'][_0xdeba('0x16')]({'where':{'type':_0x499809,'resourceId':_0x4c2541['id']}})[_0xdeba('0x15')](function(){return _0x297820;});})[_0xdeba('0x15')](function(){var _0x82f66b=new Redis(config[_0xdeba('0x6')]);_0x82f66b[_0xdeba('0x19')](_0xdeba('0x1a'),JSON[_0xdeba('0x1b')]({'id':_0x297820['id'],'deleted':!![]}));})[_0xdeba('0x15')](function(){_0x35a4c2[_0xdeba('0xc')](0xcc)[_0xdeba('0x1c')]();});}};}function handleEntityNotFound(_0x489c75){return function(_0x48a466){if(!_0x48a466){_0x489c75['sendStatus'](0x194);}return _0x48a466;};}function handleError(_0x47c42f,_0x237418){_0x237418=_0x237418||0x1f4;return function(_0x177d8a){logger['error'](_0x177d8a['stack']);if(_0x177d8a[_0xdeba('0x1d')]){delete _0x177d8a[_0xdeba('0x1d')];}_0x47c42f[_0xdeba('0xc')](_0x237418)['send'](_0x177d8a);};}exports[_0xdeba('0x1e')]=function(_0x2729ab,_0x2c5d37){var _0x227799={},_0x2883b6={},_0x4dfeab={'count':0x0,'rows':[]};var _0x5a534b=_['map'](db[_0xdeba('0x1f')]['rawAttributes'],function(_0x59e460){return{'name':_0x59e460[_0xdeba('0x20')],'type':_0x59e460['type'][_0xdeba('0x21')]};});_0x2883b6[_0xdeba('0x22')]=_[_0xdeba('0x23')](_0x5a534b,'name');_0x2883b6[_0xdeba('0x24')]=_[_0xdeba('0x25')](_0x2729ab['query']);_0x2883b6['filters']=_[_0xdeba('0x26')](_0x2883b6[_0xdeba('0x22')],_0x2883b6[_0xdeba('0x24')]);_0x227799[_0xdeba('0x27')]=_[_0xdeba('0x26')](_0x2883b6['model'],qs[_0xdeba('0x28')](_0x2729ab[_0xdeba('0x24')]['fields']));_0x227799['attributes']=_0x227799[_0xdeba('0x27')][_0xdeba('0x29')]?_0x227799['attributes']:_0x2883b6[_0xdeba('0x22')];if(!_0x2729ab[_0xdeba('0x24')][_0xdeba('0x2a')](_0xdeba('0x2b'))){_0x227799[_0xdeba('0xf')]=qs['limit'](_0x2729ab[_0xdeba('0x24')][_0xdeba('0xf')]);_0x227799[_0xdeba('0x11')]=qs[_0xdeba('0x11')](_0x2729ab[_0xdeba('0x24')][_0xdeba('0x11')]);}_0x227799['order']=qs['sort'](_0x2729ab[_0xdeba('0x24')]['sort']);_0x227799[_0xdeba('0x2c')]=qs['filters'](_['pick'](_0x2729ab[_0xdeba('0x24')],_0x2883b6['filters']),_0x5a534b);if(_0x2729ab[_0xdeba('0x24')][_0xdeba('0x2d')]){_0x227799[_0xdeba('0x2c')]=_[_0xdeba('0x2e')](_0x227799[_0xdeba('0x2c')],{'$or':_['map'](_0x5a534b,function(_0x30b0fb){if(_0x30b0fb[_0xdeba('0x2f')]!=='VIRTUAL'){var _0x5adbd6={};_0x5adbd6[_0x30b0fb['name']]={'$like':'%'+_0x2729ab[_0xdeba('0x24')]['filter']+'%'};return _0x5adbd6;}})});}_0x227799=_[_0xdeba('0x2e')]({},_0x227799,_0x2729ab['options']);var _0x3c05e2={'where':_0x227799[_0xdeba('0x2c')]};return db[_0xdeba('0x1f')][_0xdeba('0x10')](_0x3c05e2)[_0xdeba('0x15')](function(_0x580865){_0x4dfeab[_0xdeba('0x10')]=_0x580865;if(_0x2729ab[_0xdeba('0x24')][_0xdeba('0x30')]){_0x227799[_0xdeba('0x31')]=[{'all':!![]}];}return db['SquareProject'][_0xdeba('0x32')](_0x227799);})[_0xdeba('0x15')](function(_0x527ad5){_0x4dfeab['rows']=_0x527ad5;return _0x4dfeab;})[_0xdeba('0x15')](respondWithFilteredResult(_0x2c5d37,_0x227799))[_0xdeba('0x33')](handleError(_0x2c5d37,null));};exports[_0xdeba('0x34')]=function(_0x27b1a9,_0x21c5cf){var _0x1ea84b={'raw':![],'where':{'id':_0x27b1a9[_0xdeba('0x35')]['id']}},_0x2a5ce3={};_0x2a5ce3[_0xdeba('0x22')]=_[_0xdeba('0x25')](db['SquareProject']['rawAttributes']);_0x2a5ce3[_0xdeba('0x24')]=_['keys'](_0x27b1a9[_0xdeba('0x24')]);_0x2a5ce3['filters']=_[_0xdeba('0x26')](_0x2a5ce3['model'],_0x2a5ce3[_0xdeba('0x24')]);_0x1ea84b[_0xdeba('0x27')]=_[_0xdeba('0x26')](_0x2a5ce3[_0xdeba('0x22')],qs[_0xdeba('0x28')](_0x27b1a9[_0xdeba('0x24')][_0xdeba('0x28')]));_0x1ea84b[_0xdeba('0x27')]=_0x1ea84b['attributes']['length']?_0x1ea84b[_0xdeba('0x27')]:_0x2a5ce3['model'];if(_0x27b1a9[_0xdeba('0x24')][_0xdeba('0x30')]){_0x1ea84b[_0xdeba('0x31')]=[{'all':!![]}];}_0x1ea84b=_[_0xdeba('0x2e')]({},_0x1ea84b,_0x27b1a9[_0xdeba('0x36')]);return db[_0xdeba('0x1f')]['find'](_0x1ea84b)[_0xdeba('0x15')](handleEntityNotFound(_0x21c5cf,null))['then'](respondWithResult(_0x21c5cf,null))[_0xdeba('0x33')](handleError(_0x21c5cf,null));};exports[_0xdeba('0x37')]=function(_0x50fad9,_0xb85c69){return db[_0xdeba('0x1f')]['create'](_0x50fad9[_0xdeba('0x38')],{})['then'](function(_0x59c845){var _0x4c119b=_0x50fad9[_0xdeba('0x39')]['get']({'plain':!![]});if(!_0x4c119b)throw new Error(_0xdeba('0x3a'));if(_0x4c119b['role']==='user'){var _0x20f03c=_0x59c845[_0xdeba('0x17')]({'plain':!![]});var _0x57adbd=_0xdeba('0x18');return db[_0xdeba('0x3b')]['find']({'where':{'name':_0x57adbd,'userProfileId':_0x4c119b[_0xdeba('0x3c')]},'raw':!![]})[_0xdeba('0x15')](function(_0x5bdcc0){if(_0x5bdcc0&&_0x5bdcc0[_0xdeba('0x3d')]===0x0){return db[_0xdeba('0x3e')]['create']({'name':_0x20f03c[_0xdeba('0x1d')],'resourceId':_0x20f03c['id'],'type':_0x5bdcc0[_0xdeba('0x1d')],'sectionId':_0x5bdcc0['id']},{})[_0xdeba('0x15')](function(){return _0x59c845;});}else{return _0x59c845;}})[_0xdeba('0x33')](function(_0x44c4a7){logger['error'](_0xdeba('0x3f'),_0x44c4a7);throw _0x44c4a7;});}return _0x59c845;})[_0xdeba('0x15')](respondWithResult(_0xb85c69,0xc9))[_0xdeba('0x33')](handleError(_0xb85c69,null));};exports[_0xdeba('0x14')]=function(_0x17aab9,_0x4cafaa){if(_0x17aab9['body']['id']){delete _0x17aab9[_0xdeba('0x38')]['id'];}return db[_0xdeba('0x1f')][_0xdeba('0x40')]({'where':{'id':_0x17aab9[_0xdeba('0x35')]['id']}})['then'](handleEntityNotFound(_0x4cafaa,null))[_0xdeba('0x15')](saveUpdates(_0x17aab9['body'],null))['then'](function(_0x5188e5){if(!_0x5188e5)return;var _0x3fb20a=_0x5188e5[_0xdeba('0x17')]({'plain':!![]});return _0x3fb20a;})['then'](function(_0x1708ec){var _0x3f3f7c=new Redis(config[_0xdeba('0x6')]);_0x3f3f7c[_0xdeba('0x19')]('agi',JSON[_0xdeba('0x1b')](_[_0xdeba('0x41')](_0x1708ec,['id','name',_0xdeba('0x42')])));return _0x1708ec;})[_0xdeba('0x15')](respondWithResult(_0x4cafaa,null))[_0xdeba('0x33')](handleError(_0x4cafaa,null));};exports[_0xdeba('0x16')]=function(_0x3e54ba,_0x557919){return db['SquareProject'][_0xdeba('0x40')]({'where':{'id':_0x3e54ba[_0xdeba('0x35')]['id']}})[_0xdeba('0x15')](handleEntityNotFound(_0x557919,null))[_0xdeba('0x15')](removeEntity(_0x557919,null))['catch'](handleError(_0x557919,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 5b78b06..e6f6421 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 _0x1b60=['update','remove','emit','hasOwnProperty','hook','exports','events','SquareProject','setMaxListeners'];(function(_0x2b2496,_0x51d885){var _0xeb2e0f=function(_0xdf9d1c){while(--_0xdf9d1c){_0x2b2496['push'](_0x2b2496['shift']());}};_0xeb2e0f(++_0x51d885);}(_0x1b60,0x180));var _0x01b6=function(_0x13fabf,_0x554b3a){_0x13fabf=_0x13fabf-0x0;var _0x35e697=_0x1b60[_0x13fabf];return _0x35e697;};'use strict';var EventEmitter=require(_0x01b6('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x01b6('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x01b6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x01b6('0x3'),'afterDestroy':_0x01b6('0x4')};function emitEvent(_0x14b79a){return function(_0x1c78e4,_0x327d43,_0x1f20c4){SquareProjectEvents[_0x01b6('0x5')](_0x14b79a+':'+_0x1c78e4['id'],_0x1c78e4);SquareProjectEvents[_0x01b6('0x5')](_0x14b79a,_0x1c78e4);_0x1f20c4(null);};}for(var e in events){if(events[_0x01b6('0x6')](e)){var event=events[e];SquareProject[_0x01b6('0x7')](e,emitEvent(event));}}module[_0x01b6('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xab50=['emit','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update'];(function(_0x4d8b8e,_0x12fb10){var _0x3103ba=function(_0x361cae){while(--_0x361cae){_0x4d8b8e['push'](_0x4d8b8e['shift']());}};_0x3103ba(++_0x12fb10);}(_0xab50,0x198));var _0x0ab5=function(_0x41aeef,_0xd58da){_0x41aeef=_0x41aeef-0x0;var _0xb7ee2b=_0xab50[_0x41aeef];return _0xb7ee2b;};'use strict';var EventEmitter=require(_0x0ab5('0x0'));var SquareProject=require(_0x0ab5('0x1'))['db'][_0x0ab5('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x0ab5('0x3')](0x0);var events={'afterCreate':_0x0ab5('0x4'),'afterUpdate':_0x0ab5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5e1dd2){return function(_0x35f0f6,_0x248f0f,_0x56f22a){SquareProjectEvents['emit'](_0x5e1dd2+':'+_0x35f0f6['id'],_0x35f0f6);SquareProjectEvents[_0x0ab5('0x6')](_0x5e1dd2,_0x35f0f6);_0x56f22a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x0ab5('0x7')](e,emitEvent(event));}}module[_0x0ab5('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index e839bbe..1e0ec15 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 _0x1908=['production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','path','./squareProject.attributes','exports','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1d36f9,_0x3a2412){var _0x101176=function(_0x245aba){while(--_0x245aba){_0x1d36f9['push'](_0x1d36f9['shift']());}};_0x101176(++_0x3a2412);}(_0x1908,0x1bc));var _0x8190=function(_0x251deb,_0x4b6fb8){_0x251deb=_0x251deb-0x0;var _0x17ef5d=_0x1908[_0x251deb];return _0x17ef5d;};'use strict';var _=require(_0x8190('0x0'));var util=require(_0x8190('0x1'));var logger=require(_0x8190('0x2'))(_0x8190('0x3'));var moment=require(_0x8190('0x4'));var BPromise=require(_0x8190('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8190('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8190('0x7'));module[_0x8190('0x8')]=function(_0x2fda53,_0x11c1ed){return _0x2fda53['define']('SquareProject',attributes,{'tableName':_0x8190('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x47e630,_0x5b642c,_0x3e90d6){if(_0x47e630[_0x8190('0xa')](_0x8190('0xb'))){_0x47e630[_0x8190('0xc')]=moment()[_0x8190('0xd')](_0x8190('0xe'));}if(_0x47e630[_0x8190('0xa')](_0x8190('0xf'))){_0x47e630[_0x8190('0x10')]=moment()['format'](_0x8190('0xe'));}_0x3e90d6(null,_0x47e630);}}});}; \ No newline at end of file +var _0x84f5=['YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt'];(function(_0x356f24,_0x1672cc){var _0x28ec3c=function(_0x397fe5){while(--_0x397fe5){_0x356f24['push'](_0x356f24['shift']());}};_0x28ec3c(++_0x1672cc);}(_0x84f5,0x1bc));var _0x584f=function(_0x2aef75,_0x13edab){_0x2aef75=_0x2aef75-0x0;var _0x26e106=_0x84f5[_0x2aef75];return _0x26e106;};'use strict';var _=require(_0x584f('0x0'));var util=require(_0x584f('0x1'));var logger=require(_0x584f('0x2'))(_0x584f('0x3'));var moment=require(_0x584f('0x4'));var BPromise=require('bluebird');var rp=require(_0x584f('0x5'));var fs=require('fs');var path=require(_0x584f('0x6'));var rimraf=require('rimraf');var config=require(_0x584f('0x7'));var attributes=require(_0x584f('0x8'));module[_0x584f('0x9')]=function(_0x220465,_0x3f5b11){return _0x220465[_0x584f('0xa')](_0x584f('0xb'),attributes,{'tableName':_0x584f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a95f4,_0x465423,_0x3f7408){if(_0x3a95f4[_0x584f('0xd')](_0x584f('0xe'))){_0x3a95f4[_0x584f('0xf')]=moment()['format'](_0x584f('0x10'));}if(_0x3a95f4[_0x584f('0xd')](_0x584f('0x11'))){_0x3a95f4[_0x584f('0x12')]=moment()[_0x584f('0x13')](_0x584f('0x10'));}_0x3f7408(null,_0x3a95f4);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 0958fd1..ac9ddb2 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 _0x82cd=['GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','include','map','model','then','stringify','catch','error','message','find','ShowSquareProject','debug','lodash','ioredis','../../mysqldb','../../config/logger','rpc','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register'];(function(_0x1476a7,_0x43411f){var _0x717f66=function(_0x2300b4){while(--_0x2300b4){_0x1476a7['push'](_0x1476a7['shift']());}};_0x717f66(++_0x43411f);}(_0x82cd,0x16e));var _0xd82c=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x82cd[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0xd82c('0x0'));var Redis=require(_0xd82c('0x1'));var db=require(_0xd82c('0x2'))['db'];var logger=require(_0xd82c('0x3'))(_0xd82c('0x4'));var config=require('../../config/environment');config['redis']=_[_0xd82c('0x5')](config[_0xd82c('0x6')],{'host':_0xd82c('0x7'),'port':0x18eb});var socket=require(_0xd82c('0x8'))(new Redis(config[_0xd82c('0x6')]));require(_0xd82c('0x9'))[_0xd82c('0xa')](socket);exports[_0xd82c('0xb')]=function(_0x5c7ded){var _0x98b5dc=this;return new Promise(function(_0x34196f,_0x4d9177){return db[_0xd82c('0xc')][_0xd82c('0xd')]({'raw':_0x5c7ded['options']?_0x5c7ded[_0xd82c('0xe')][_0xd82c('0xf')]===undefined?!![]:![]:!![],'where':_0x5c7ded[_0xd82c('0xe')]?_0x5c7ded['options'][_0xd82c('0x10')]||null:null,'attributes':_0x5c7ded[_0xd82c('0xe')]?_0x5c7ded['options'][_0xd82c('0x11')]||null:null,'limit':_0x5c7ded[_0xd82c('0xe')]?_0x5c7ded[_0xd82c('0xe')]['limit']||null:null,'include':_0x5c7ded[_0xd82c('0xe')]?_0x5c7ded[_0xd82c('0xe')][_0xd82c('0x12')]?_[_0xd82c('0x13')](_0x5c7ded[_0xd82c('0xe')][_0xd82c('0x12')],function(_0x4ddaf3){return{'model':db[_0x4ddaf3[_0xd82c('0x14')]],'as':_0x4ddaf3['as'],'attributes':_0x4ddaf3[_0xd82c('0x11')],'include':_0x4ddaf3[_0xd82c('0x12')]?_[_0xd82c('0x13')](_0x4ddaf3[_0xd82c('0x12')],function(_0x12ddf2){return{'model':db[_0x12ddf2['model']],'as':_0x12ddf2['as'],'attributes':_0x12ddf2[_0xd82c('0x11')],'include':_0x12ddf2[_0xd82c('0x12')]?_[_0xd82c('0x13')](_0x12ddf2[_0xd82c('0x12')],function(_0x28148e){return{'model':db[_0x28148e[_0xd82c('0x14')]],'as':_0x28148e['as'],'attributes':_0x28148e[_0xd82c('0x11')]};}):[]};}):[]};}):[]:[]})[_0xd82c('0x15')](function(_0x5b7cac){logger['info'](_0xd82c('0xb'),_0x5c7ded);logger['debug'](_0xd82c('0xb'),_0x5c7ded,JSON[_0xd82c('0x16')](_0x5b7cac));_0x34196f(_0x5b7cac);})[_0xd82c('0x17')](function(_0x1f7009){logger[_0xd82c('0x18')]('GetSquareProjects',_0x1f7009[_0xd82c('0x19')],_0x5c7ded);_0x4d9177(_0x98b5dc[_0xd82c('0x18')](0x1f4,_0x1f7009['message']));});});};exports['ShowSquareProject']=function(_0x498944){var _0x519f24=this;return new Promise(function(_0x4457d0,_0x59e677){return db[_0xd82c('0xc')][_0xd82c('0x1a')]({'raw':_0x498944[_0xd82c('0xe')]?_0x498944[_0xd82c('0xe')][_0xd82c('0xf')]===undefined?!![]:![]:!![],'where':_0x498944[_0xd82c('0xe')]?_0x498944[_0xd82c('0xe')]['where']||null:null,'attributes':_0x498944['options']?_0x498944[_0xd82c('0xe')][_0xd82c('0x11')]||null:null,'include':_0x498944['options']?_0x498944[_0xd82c('0xe')][_0xd82c('0x12')]?_['map'](_0x498944[_0xd82c('0xe')]['include'],function(_0x1814b6){return{'model':db[_0x1814b6[_0xd82c('0x14')]],'as':_0x1814b6['as'],'attributes':_0x1814b6[_0xd82c('0x11')],'include':_0x1814b6[_0xd82c('0x12')]?_[_0xd82c('0x13')](_0x1814b6[_0xd82c('0x12')],function(_0x34af52){return{'model':db[_0x34af52['model']],'as':_0x34af52['as'],'attributes':_0x34af52[_0xd82c('0x11')],'include':_0x34af52[_0xd82c('0x12')]?_[_0xd82c('0x13')](_0x34af52[_0xd82c('0x12')],function(_0x40923b){return{'model':db[_0x40923b[_0xd82c('0x14')]],'as':_0x40923b['as'],'attributes':_0x40923b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xd2023e){logger['info'](_0xd82c('0x1b'),_0x498944);logger[_0xd82c('0x1c')](_0xd82c('0x1b'),_0x498944,JSON[_0xd82c('0x16')](_0xd2023e));_0x4457d0(_0xd2023e);})[_0xd82c('0x17')](function(_0x366e2d){logger[_0xd82c('0x18')]('ShowSquareProject',_0x366e2d[_0xd82c('0x19')],_0x498944);_0x59e677(_0x519f24[_0xd82c('0x18')](0x1f4,_0x366e2d[_0xd82c('0x19')]));});});}; \ No newline at end of file +var _0xddc6=['model','include','then','info','GetSquareProjects','debug','stringify','catch','error','message','ShowSquareProject','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','localhost','socket.io-emitter','redis','./squareProject.socket','SquareProject','findAll','options','raw','where','attributes','map'];(function(_0x3904e9,_0x1c0782){var _0x1ba0e0=function(_0x44f87e){while(--_0x44f87e){_0x3904e9['push'](_0x3904e9['shift']());}};_0x1ba0e0(++_0x1c0782);}(_0xddc6,0x123));var _0x6ddc=function(_0x436b29,_0x4ab830){_0x436b29=_0x436b29-0x0;var _0x34f5c7=_0xddc6[_0x436b29];return _0x34f5c7;};'use strict';var _=require('lodash');var Redis=require(_0x6ddc('0x0'));var db=require(_0x6ddc('0x1'))['db'];var logger=require(_0x6ddc('0x2'))(_0x6ddc('0x3'));var config=require(_0x6ddc('0x4'));config['redis']=_[_0x6ddc('0x5')](config['redis'],{'host':_0x6ddc('0x6'),'port':0x18eb});var socket=require(_0x6ddc('0x7'))(new Redis(config[_0x6ddc('0x8')]));require(_0x6ddc('0x9'))['register'](socket);exports['GetSquareProjects']=function(_0x4b0ea6){var _0x1af6cd=this;return new Promise(function(_0x1e89c8,_0xc3edcc){return db[_0x6ddc('0xa')][_0x6ddc('0xb')]({'raw':_0x4b0ea6[_0x6ddc('0xc')]?_0x4b0ea6['options'][_0x6ddc('0xd')]===undefined?!![]:![]:!![],'where':_0x4b0ea6[_0x6ddc('0xc')]?_0x4b0ea6[_0x6ddc('0xc')][_0x6ddc('0xe')]||null:null,'attributes':_0x4b0ea6[_0x6ddc('0xc')]?_0x4b0ea6[_0x6ddc('0xc')][_0x6ddc('0xf')]||null:null,'limit':_0x4b0ea6[_0x6ddc('0xc')]?_0x4b0ea6[_0x6ddc('0xc')]['limit']||null:null,'include':_0x4b0ea6[_0x6ddc('0xc')]?_0x4b0ea6['options']['include']?_[_0x6ddc('0x10')](_0x4b0ea6[_0x6ddc('0xc')]['include'],function(_0xaae9a8){return{'model':db[_0xaae9a8[_0x6ddc('0x11')]],'as':_0xaae9a8['as'],'attributes':_0xaae9a8[_0x6ddc('0xf')],'include':_0xaae9a8[_0x6ddc('0x12')]?_[_0x6ddc('0x10')](_0xaae9a8['include'],function(_0x5158b2){return{'model':db[_0x5158b2[_0x6ddc('0x11')]],'as':_0x5158b2['as'],'attributes':_0x5158b2[_0x6ddc('0xf')],'include':_0x5158b2[_0x6ddc('0x12')]?_[_0x6ddc('0x10')](_0x5158b2[_0x6ddc('0x12')],function(_0xb583d0){return{'model':db[_0xb583d0[_0x6ddc('0x11')]],'as':_0xb583d0['as'],'attributes':_0xb583d0[_0x6ddc('0xf')]};}):[]};}):[]};}):[]:[]})[_0x6ddc('0x13')](function(_0x3a7ec9){logger[_0x6ddc('0x14')](_0x6ddc('0x15'),_0x4b0ea6);logger[_0x6ddc('0x16')](_0x6ddc('0x15'),_0x4b0ea6,JSON[_0x6ddc('0x17')](_0x3a7ec9));_0x1e89c8(_0x3a7ec9);})[_0x6ddc('0x18')](function(_0xcf867c){logger[_0x6ddc('0x19')]('GetSquareProjects',_0xcf867c[_0x6ddc('0x1a')],_0x4b0ea6);_0xc3edcc(_0x1af6cd[_0x6ddc('0x19')](0x1f4,_0xcf867c[_0x6ddc('0x1a')]));});});};exports[_0x6ddc('0x1b')]=function(_0x219f6f){var _0x37f555=this;return new Promise(function(_0x107032,_0x24586d){return db[_0x6ddc('0xa')]['find']({'raw':_0x219f6f[_0x6ddc('0xc')]?_0x219f6f[_0x6ddc('0xc')][_0x6ddc('0xd')]===undefined?!![]:![]:!![],'where':_0x219f6f['options']?_0x219f6f['options'][_0x6ddc('0xe')]||null:null,'attributes':_0x219f6f['options']?_0x219f6f[_0x6ddc('0xc')][_0x6ddc('0xf')]||null:null,'include':_0x219f6f['options']?_0x219f6f[_0x6ddc('0xc')][_0x6ddc('0x12')]?_[_0x6ddc('0x10')](_0x219f6f['options'][_0x6ddc('0x12')],function(_0x5b2666){return{'model':db[_0x5b2666[_0x6ddc('0x11')]],'as':_0x5b2666['as'],'attributes':_0x5b2666[_0x6ddc('0xf')],'include':_0x5b2666['include']?_['map'](_0x5b2666[_0x6ddc('0x12')],function(_0x4d1683){return{'model':db[_0x4d1683[_0x6ddc('0x11')]],'as':_0x4d1683['as'],'attributes':_0x4d1683[_0x6ddc('0xf')],'include':_0x4d1683['include']?_[_0x6ddc('0x10')](_0x4d1683['include'],function(_0x52f999){return{'model':db[_0x52f999[_0x6ddc('0x11')]],'as':_0x52f999['as'],'attributes':_0x52f999[_0x6ddc('0xf')]};}):[]};}):[]};}):[]:[]})[_0x6ddc('0x13')](function(_0x3ff45a){logger[_0x6ddc('0x14')](_0x6ddc('0x1b'),_0x219f6f);logger['debug'](_0x6ddc('0x1b'),_0x219f6f,JSON[_0x6ddc('0x17')](_0x3ff45a));_0x107032(_0x3ff45a);})[_0x6ddc('0x18')](function(_0x226d28){logger['error'](_0x6ddc('0x1b'),_0x226d28['message'],_0x219f6f);_0x24586d(_0x37f555[_0x6ddc('0x19')](0x1f4,_0x226d28['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index aea75d2..d9a7356 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 _0x41ad=['removeListener','length','squareProject:','./squareProject.events','save','remove','update','emit'];(function(_0x4e2148,_0x382a2c){var _0x323345=function(_0x426339){while(--_0x426339){_0x4e2148['push'](_0x4e2148['shift']());}};_0x323345(++_0x382a2c);}(_0x41ad,0x1b3));var _0xd41a=function(_0x471949,_0x4b3624){_0x471949=_0x471949-0x0;var _0x31e1db=_0x41ad[_0x471949];return _0x31e1db;};'use strict';var SquareProjectEvents=require(_0xd41a('0x0'));var events=[_0xd41a('0x1'),_0xd41a('0x2'),_0xd41a('0x3')];function createListener(_0x108802,_0x4bd658){return function(_0x31604b){_0x4bd658[_0xd41a('0x4')](_0x108802,_0x31604b);};}function removeListener(_0x5a9ce4,_0x4c26e){return function(){SquareProjectEvents[_0xd41a('0x5')](_0x5a9ce4,_0x4c26e);};}exports['register']=function(_0x137cba){for(var _0x2e82cd=0x0,_0x47741a=events[_0xd41a('0x6')];_0x2e82cd<_0x47741a;_0x2e82cd++){var _0x2b3526=events[_0x2e82cd];var _0x15098a=createListener(_0xd41a('0x7')+_0x2b3526,_0x137cba);SquareProjectEvents['on'](_0x2b3526,_0x15098a);}}; \ No newline at end of file +var _0xd92e=['squareProject:','save','update','removeListener'];(function(_0x2a880e,_0x44beb7){var _0x45e0ce=function(_0x10cbc2){while(--_0x10cbc2){_0x2a880e['push'](_0x2a880e['shift']());}};_0x45e0ce(++_0x44beb7);}(_0xd92e,0x195));var _0xed92=function(_0x4d55cb,_0x44e7e2){_0x4d55cb=_0x4d55cb-0x0;var _0x6ef76e=_0xd92e[_0x4d55cb];return _0x6ef76e;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xed92('0x0'),'remove',_0xed92('0x1')];function createListener(_0x23ab69,_0x3e96cc){return function(_0x15e9d2){_0x3e96cc['emit'](_0x23ab69,_0x15e9d2);};}function removeListener(_0x47950b,_0x5431d5){return function(){SquareProjectEvents[_0xed92('0x2')](_0x47950b,_0x5431d5);};}exports['register']=function(_0xb9dfc6){for(var _0x2f7f77=0x0,_0x3c7dab=events['length'];_0x2f7f77<_0x3c7dab;_0x2f7f77++){var _0x49119c=events[_0x2f7f77];var _0x11259c=createListener(_0xed92('0x3')+_0x49119c,_0xb9dfc6);SquareProjectEvents['on'](_0x49119c,_0x11259c);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index b689b16..26e4978 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 _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x5d18ee,_0x406b6c){var _0x2db3e9=function(_0x13c53f){while(--_0x13c53f){_0x5d18ee['push'](_0x5d18ee['shift']());}};_0x2db3e9(++_0x406b6c);}(_0x5fab,0x177));var _0xb5fa=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x5fab[_0x4a53d];return _0x27410e;};'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['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file +var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x4327fe,_0x4f8040){var _0x138651=function(_0x418acc){while(--_0x418acc){_0x4327fe['push'](_0x4327fe['shift']());}};_0x138651(++_0x4f8040);}(_0x326f,0xd1));var _0xf326=function(_0x11fabc,_0x5bb056){_0x11fabc=_0x11fabc-0x0;var _0x1939b8=_0x326f[_0x11fabc];return _0x1939b8;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index c5d42c4..6be57c1 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(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x46ed,0x168));var _0xd46e=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x46ed[_0x599f41];return _0x2e4d58;};'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 _0x207c=['savePath','substring','exports','STRING','VIRTUAL','getDataValue'];(function(_0x1ca8cc,_0x125951){var _0x252c10=function(_0x2eac39){while(--_0x2eac39){_0x1ca8cc['push'](_0x1ca8cc['shift']());}};_0x252c10(++_0x125951);}(_0x207c,0x1e8));var _0xc207=function(_0x890db7,_0x4dcf2c){_0x890db7=_0x890db7-0x0;var _0x46412=_0x207c[_0x890db7];return _0x46412;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'uniqueid':{'type':Sequelize[_0xc207('0x1')]},'callerid':{'type':Sequelize[_0xc207('0x1')]},'calleridname':{'type':Sequelize[_0xc207('0x1')]},'context':{'type':Sequelize[_0xc207('0x1')]},'extension':{'type':Sequelize[_0xc207('0x1')]},'priority':{'type':Sequelize[_0xc207('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xc207('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xc207('0x1')]},'format':{'type':Sequelize[_0xc207('0x2')],'get':function(){var _0x3395e4='';var _0x59ff6f=this[_0xc207('0x3')](_0xc207('0x4'));if(_0x59ff6f){_0x3395e4=_0x59ff6f[_0xc207('0x5')](_0x59ff6f['lastIndexOf']('.'));}return _0x3395e4;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 63e5e61..e2a4699 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 _0xbd61=['limit','count','offset','set','Content-Range','apply','reject','save','then','stack','name','send','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','includeAll','include','catch','show','find','create','body','params','download','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','decryptFile','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xbd61,0x1b7));var _0x1bd6=function(_0x22ff8b,_0x19fe58){_0x22ff8b=_0x22ff8b-0x0;var _0x354ac9=_0xbd61[_0x22ff8b];return _0x354ac9;};'use strict';var emlformat=require(_0x1bd6('0x0'));var rimraf=require(_0x1bd6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1bd6('0x2'));var rp=require(_0x1bd6('0x3'));var moment=require(_0x1bd6('0x4'));var BPromise=require(_0x1bd6('0x5'));var Mustache=require(_0x1bd6('0x6'));var util=require(_0x1bd6('0x7'));var path=require(_0x1bd6('0x8'));var sox=require(_0x1bd6('0x9'));var csv=require(_0x1bd6('0xa'));var ejs=require(_0x1bd6('0xb'));var fs=require('fs');var fs_extra=require(_0x1bd6('0xc'));var _=require(_0x1bd6('0xd'));var squel=require(_0x1bd6('0xe'));var crypto=require(_0x1bd6('0xf'));var jsforce=require(_0x1bd6('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1bd6('0xa'));var querystring=require('querystring');var Papa=require(_0x1bd6('0x11'));var Redis=require(_0x1bd6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1bd6('0x13'));var as=require(_0x1bd6('0x14'));var hardwareService=require(_0x1bd6('0x15'));var logger=require('../../config/logger')(_0x1bd6('0x16'));var utils=require(_0x1bd6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1bd6('0x18'));var db=require(_0x1bd6('0x19'))['db'];function respondWithStatusCode(_0x438bd2,_0x2dc47e){_0x2dc47e=_0x2dc47e||0xcc;return function(_0x26befa){if(_0x26befa){return _0x438bd2[_0x1bd6('0x1a')](_0x2dc47e);}return _0x438bd2['status'](_0x2dc47e)[_0x1bd6('0x1b')]();};}function respondWithResult(_0x49350f,_0x3e3b88){_0x3e3b88=_0x3e3b88||0xc8;return function(_0x357824){if(_0x357824){return _0x49350f[_0x1bd6('0x1c')](_0x3e3b88)[_0x1bd6('0x1d')](_0x357824);}};}function respondWithFilteredResult(_0x2fcca2,_0x2a5e48){return function(_0x3c329e){if(_0x3c329e){var _0x7f64a0=typeof _0x2a5e48['offset']===_0x1bd6('0x1e')&&typeof _0x2a5e48[_0x1bd6('0x1f')]==='undefined';var _0x1b08ea=_0x3c329e[_0x1bd6('0x20')];var _0x5ba3a6=_0x7f64a0?0x0:_0x2a5e48[_0x1bd6('0x21')];var _0x4d15e3=_0x7f64a0?_0x3c329e[_0x1bd6('0x20')]:_0x2a5e48[_0x1bd6('0x21')]+_0x2a5e48[_0x1bd6('0x1f')];var _0x2e070a;if(_0x4d15e3>=_0x1b08ea){_0x4d15e3=_0x1b08ea;_0x2e070a=0xc8;}else{_0x2e070a=0xce;}_0x2fcca2[_0x1bd6('0x1c')](_0x2e070a);return _0x2fcca2[_0x1bd6('0x22')](_0x1bd6('0x23'),_0x5ba3a6+'-'+_0x4d15e3+'/'+_0x1b08ea)[_0x1bd6('0x1d')](_0x3c329e);}return null;};}function patchUpdates(_0x15bb07){return function(_0x3abb29){try{jsonpatch[_0x1bd6('0x24')](_0x3abb29,_0x15bb07,!![]);}catch(_0x44d622){return BPromise[_0x1bd6('0x25')](_0x44d622);}return _0x3abb29[_0x1bd6('0x26')]();};}function saveUpdates(_0x388dc7,_0x127878){return function(_0x58e3bb){if(_0x58e3bb){return _0x58e3bb['update'](_0x388dc7)[_0x1bd6('0x27')](function(_0x27cfb1){return _0x27cfb1;});}return null;};}function removeEntity(_0x3a1da7,_0x308ffd){return function(_0x12c7e8){if(_0x12c7e8){return _0x12c7e8['destroy']()[_0x1bd6('0x27')](function(){_0x3a1da7[_0x1bd6('0x1c')](0xcc)[_0x1bd6('0x1b')]();});}};}function handleEntityNotFound(_0x32274d,_0x7f93d3){return function(_0x3499ce){if(!_0x3499ce){_0x32274d[_0x1bd6('0x1a')](0x194);}return _0x3499ce;};}function handleError(_0x1353f0,_0x4ea2ee){_0x4ea2ee=_0x4ea2ee||0x1f4;return function(_0x1d0019){logger['error'](_0x1d0019[_0x1bd6('0x28')]);if(_0x1d0019['name']){delete _0x1d0019[_0x1bd6('0x29')];}_0x1353f0[_0x1bd6('0x1c')](_0x4ea2ee)[_0x1bd6('0x2a')](_0x1d0019);};}exports['index']=function(_0x5b30d8,_0x2244d7){var _0x10ccb3={},_0xe66418={},_0x33a1dc={'count':0x0,'rows':[]};var _0x45687a=_[_0x1bd6('0x2b')](db[_0x1bd6('0x2c')][_0x1bd6('0x2d')],function(_0x292011){return{'name':_0x292011[_0x1bd6('0x2e')],'type':_0x292011[_0x1bd6('0x2f')][_0x1bd6('0x30')]};});_0xe66418[_0x1bd6('0x31')]=_[_0x1bd6('0x2b')](_0x45687a,'name');_0xe66418[_0x1bd6('0x32')]=_[_0x1bd6('0x33')](_0x5b30d8[_0x1bd6('0x32')]);_0xe66418[_0x1bd6('0x34')]=_[_0x1bd6('0x35')](_0xe66418[_0x1bd6('0x31')],_0xe66418['query']);_0x10ccb3[_0x1bd6('0x36')]=_[_0x1bd6('0x35')](_0xe66418['model'],qs[_0x1bd6('0x37')](_0x5b30d8[_0x1bd6('0x32')][_0x1bd6('0x37')]));_0x10ccb3['attributes']=_0x10ccb3[_0x1bd6('0x36')][_0x1bd6('0x38')]?_0x10ccb3['attributes']:_0xe66418[_0x1bd6('0x31')];if(!_0x5b30d8[_0x1bd6('0x32')][_0x1bd6('0x39')](_0x1bd6('0x3a'))){_0x10ccb3[_0x1bd6('0x1f')]=qs['limit'](_0x5b30d8[_0x1bd6('0x32')]['limit']);_0x10ccb3['offset']=qs[_0x1bd6('0x21')](_0x5b30d8[_0x1bd6('0x32')][_0x1bd6('0x21')]);}_0x10ccb3['order']=qs[_0x1bd6('0x3b')](_0x5b30d8[_0x1bd6('0x32')]['sort']);_0x10ccb3[_0x1bd6('0x3c')]=qs['filters'](_['pick'](_0x5b30d8[_0x1bd6('0x32')],_0xe66418[_0x1bd6('0x34')]),_0x45687a);if(_0x5b30d8[_0x1bd6('0x32')]['filter']){_0x10ccb3[_0x1bd6('0x3c')]=_[_0x1bd6('0x3d')](_0x10ccb3['where'],{'$or':_[_0x1bd6('0x2b')](_0x45687a,function(_0x305e3a){if(_0x305e3a['type']!==_0x1bd6('0x3e')){var _0x9341ff={};_0x9341ff[_0x305e3a['name']]={'$like':'%'+_0x5b30d8['query']['filter']+'%'};return _0x9341ff;}})});}_0x10ccb3=_['merge']({},_0x10ccb3,_0x5b30d8[_0x1bd6('0x3f')]);var _0xefaa9f={'where':_0x10ccb3[_0x1bd6('0x3c')]};return db[_0x1bd6('0x2c')][_0x1bd6('0x20')](_0xefaa9f)[_0x1bd6('0x27')](function(_0x1620e1){_0x33a1dc['count']=_0x1620e1;if(_0x5b30d8[_0x1bd6('0x32')][_0x1bd6('0x40')]){_0x10ccb3[_0x1bd6('0x41')]=[{'all':!![]}];}return db[_0x1bd6('0x2c')]['findAll'](_0x10ccb3);})[_0x1bd6('0x27')](function(_0x46f34f){_0x33a1dc['rows']=_0x46f34f;return _0x33a1dc;})[_0x1bd6('0x27')](respondWithFilteredResult(_0x2244d7,_0x10ccb3))[_0x1bd6('0x42')](handleError(_0x2244d7,null));};exports[_0x1bd6('0x43')]=function(_0x3956fa,_0x29d205){var _0x1fd0c3={'raw':!![],'where':{'id':_0x3956fa['params']['id']}},_0x2622de={};_0x2622de[_0x1bd6('0x31')]=_[_0x1bd6('0x33')](db['SquareRecording']['rawAttributes']);_0x2622de[_0x1bd6('0x32')]=_[_0x1bd6('0x33')](_0x3956fa['query']);_0x2622de[_0x1bd6('0x34')]=_[_0x1bd6('0x35')](_0x2622de[_0x1bd6('0x31')],_0x2622de[_0x1bd6('0x32')]);_0x1fd0c3[_0x1bd6('0x36')]=_['intersection'](_0x2622de[_0x1bd6('0x31')],qs[_0x1bd6('0x37')](_0x3956fa[_0x1bd6('0x32')][_0x1bd6('0x37')]));_0x1fd0c3[_0x1bd6('0x36')]=_0x1fd0c3['attributes'][_0x1bd6('0x38')]?_0x1fd0c3[_0x1bd6('0x36')]:_0x2622de['model'];if(_0x3956fa[_0x1bd6('0x32')][_0x1bd6('0x40')]){_0x1fd0c3[_0x1bd6('0x41')]=[{'all':!![]}];}_0x1fd0c3=_[_0x1bd6('0x3d')]({},_0x1fd0c3,_0x3956fa['options']);return db['SquareRecording'][_0x1bd6('0x44')](_0x1fd0c3)['then'](handleEntityNotFound(_0x29d205,null))[_0x1bd6('0x27')](respondWithResult(_0x29d205,null))[_0x1bd6('0x42')](handleError(_0x29d205,null));};exports['create']=function(_0x35777d,_0x147fed){return db[_0x1bd6('0x2c')][_0x1bd6('0x45')](_0x35777d[_0x1bd6('0x46')],{})[_0x1bd6('0x27')](respondWithResult(_0x147fed,0xc9))[_0x1bd6('0x42')](handleError(_0x147fed,null));};exports['update']=function(_0x109020,_0x270b17){if(_0x109020[_0x1bd6('0x46')]['id']){delete _0x109020[_0x1bd6('0x46')]['id'];}return db['SquareRecording'][_0x1bd6('0x44')]({'where':{'id':_0x109020[_0x1bd6('0x47')]['id']}})[_0x1bd6('0x27')](handleEntityNotFound(_0x270b17,null))['then'](saveUpdates(_0x109020['body'],null))[_0x1bd6('0x27')](respondWithResult(_0x270b17,null))[_0x1bd6('0x42')](handleError(_0x270b17,null));};exports[_0x1bd6('0x48')]=function(_0x46a770,_0x519212,_0x47a3df){var _0x48089e=require(_0x1bd6('0x49'));var _0x404d9b=![];var _0x10e11b={};if(_0x46a770[_0x1bd6('0x32')][_0x1bd6('0x2f')]&&_0x46a770[_0x1bd6('0x32')][_0x1bd6('0x2f')]==='uniqueid'){_0x10e11b[_0x1bd6('0x4a')]=_0x46a770[_0x1bd6('0x47')]['id'];}else{_0x10e11b['id']=_0x46a770['params']['id'];}return db[_0x1bd6('0x2c')][_0x1bd6('0x44')]({'where':_0x10e11b,'attributes':['id',_0x1bd6('0x4b'),_0x1bd6('0x4c')],'raw':!![]})[_0x1bd6('0x27')](handleEntityNotFound(_0x519212,null))['then'](function(_0x5a3691){if(_0x5a3691){var _0x2c1954=_0x5a3691['savePath'];var _0x20c4c5=util['format'](_0x1bd6('0x4d'),_0x2c1954);if(fs['existsSync'](_0x20c4c5)){_0x404d9b=!![];return _0x48089e[_0x1bd6('0x4e')](_0x20c4c5,_0x2c1954,config['secrets']['recording'])['then'](function(){return _0x5a3691;});}return _0x5a3691;}})['then'](function(_0x14a94e){if(_0x14a94e){var _0x444632=_0x14a94e[_0x1bd6('0x4b')];if(!fs[_0x1bd6('0x4f')](_0x444632)){throw new db[(_0x1bd6('0x50'))][(_0x1bd6('0x51'))](_0x1bd6('0x52'));}if(_0x14a94e['filename']){return _0x519212[_0x1bd6('0x48')](_0x444632,_0x14a94e[_0x1bd6('0x4c')]+path['extname'](_0x444632),function(){if(_0x404d9b){fs['unlink'](_0x444632);}});}else{return _0x519212['download'](_0x444632,function(_0x17bc19){if(_0x404d9b){fs[_0x1bd6('0x53')](_0x444632);}});}}})[_0x1bd6('0x42')](function(_0xcce6b3){if(_0xcce6b3['message']===_0x1bd6('0x52')){_0x519212[_0x1bd6('0x1c')](0x194)['send'](_0x1bd6('0x54'));}else{return handleError(_0x519212,null);}});};exports[_0x1bd6('0x55')]=function(_0x38495d,_0x49f508){return db[_0x1bd6('0x2c')][_0x1bd6('0x44')]({'where':{'id':_0x38495d[_0x1bd6('0x47')]['id']}})[_0x1bd6('0x27')](function(_0x26018f){if(_[_0x1bd6('0x56')](_0x26018f)){throw new ReferenceError(_0x1bd6('0x57'));}return _0x26018f;})[_0x1bd6('0x27')](function(_0x46cb9a){var _0x353bd6=_0x46cb9a[_0x1bd6('0x4b')];logger[_0x1bd6('0x58')](_0x1bd6('0x59'),_0x353bd6);if(!_[_0x1bd6('0x56')](_0x46cb9a[_0x1bd6('0x4b')])&&fs[_0x1bd6('0x4f')](_0x353bd6)){logger[_0x1bd6('0x58')](_0x1bd6('0x5a')+_0x353bd6+_0x1bd6('0x5b'));fs[_0x1bd6('0x5c')](_0x353bd6);}_0x353bd6=_0x353bd6+_0x1bd6('0x5d');if(!_[_0x1bd6('0x56')](_0x46cb9a['savePath'])&&fs[_0x1bd6('0x4f')](_0x353bd6)){logger[_0x1bd6('0x58')](_0x1bd6('0x5a')+_0x353bd6+_0x1bd6('0x5b'));fs[_0x1bd6('0x5c')](_0x353bd6);}return _0x46cb9a;})[_0x1bd6('0x27')](function(_0x2b502a){if(!_0x2b502a)throw new InternalError();return _0x2b502a[_0x1bd6('0x55')]();})['then'](function(){_0x49f508[_0x1bd6('0x1c')](0xcc)[_0x1bd6('0x1b')]();})[_0x1bd6('0x42')](handleError(_0x49f508,null));}; \ No newline at end of file +var _0xd099=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','length','nolimit','order','where','filters','filter','merge','SquareRecording','includeAll','include','findAll','rows','catch','params','find','create','body','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','SquareRecording\x20not\x20found','extname','unlink','download','message','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util'];(function(_0x4d4571,_0x449dfb){var _0x5d3488=function(_0x5c0440){while(--_0x5c0440){_0x4d4571['push'](_0x4d4571['shift']());}};_0x5d3488(++_0x449dfb);}(_0xd099,0x153));var _0x9d09=function(_0x2e767e,_0x591c30){_0x2e767e=_0x2e767e-0x0;var _0x539d6c=_0xd099[_0x2e767e];return _0x539d6c;};'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(_0x9d09('0x4'));var moment=require('moment');var BPromise=require(_0x9d09('0x5'));var Mustache=require(_0x9d09('0x6'));var util=require(_0x9d09('0x7'));var path=require(_0x9d09('0x8'));var sox=require(_0x9d09('0x9'));var csv=require(_0x9d09('0xa'));var ejs=require(_0x9d09('0xb'));var fs=require('fs');var fs_extra=require(_0x9d09('0xc'));var _=require(_0x9d09('0xd'));var squel=require('squel');var crypto=require(_0x9d09('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9d09('0xf'));var toCsv=require(_0x9d09('0xa'));var querystring=require(_0x9d09('0x10'));var Papa=require(_0x9d09('0x11'));var Redis=require(_0x9d09('0x12'));var authService=require(_0x9d09('0x13'));var qs=require(_0x9d09('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d09('0x15'));var logger=require(_0x9d09('0x16'))(_0x9d09('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9d09('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f5171,_0xf015db){_0xf015db=_0xf015db||0xcc;return function(_0x2e4ef0){if(_0x2e4ef0){return _0x1f5171[_0x9d09('0x19')](_0xf015db);}return _0x1f5171[_0x9d09('0x1a')](_0xf015db)[_0x9d09('0x1b')]();};}function respondWithResult(_0x544792,_0x88c4ab){_0x88c4ab=_0x88c4ab||0xc8;return function(_0x918d8){if(_0x918d8){return _0x544792[_0x9d09('0x1a')](_0x88c4ab)[_0x9d09('0x1c')](_0x918d8);}};}function respondWithFilteredResult(_0x9506aa,_0x27332d){return function(_0x3e886c){if(_0x3e886c){var _0xdadf4b=typeof _0x27332d[_0x9d09('0x1d')]===_0x9d09('0x1e')&&typeof _0x27332d[_0x9d09('0x1f')]===_0x9d09('0x1e');var _0x4a0d32=_0x3e886c[_0x9d09('0x20')];var _0x3275b1=_0xdadf4b?0x0:_0x27332d[_0x9d09('0x1d')];var _0x37a38e=_0xdadf4b?_0x3e886c[_0x9d09('0x20')]:_0x27332d[_0x9d09('0x1d')]+_0x27332d[_0x9d09('0x1f')];var _0x159542;if(_0x37a38e>=_0x4a0d32){_0x37a38e=_0x4a0d32;_0x159542=0xc8;}else{_0x159542=0xce;}_0x9506aa[_0x9d09('0x1a')](_0x159542);return _0x9506aa[_0x9d09('0x21')](_0x9d09('0x22'),_0x3275b1+'-'+_0x37a38e+'/'+_0x4a0d32)['json'](_0x3e886c);}return null;};}function patchUpdates(_0x57f39f){return function(_0x34ed56){try{jsonpatch['apply'](_0x34ed56,_0x57f39f,!![]);}catch(_0x91f066){return BPromise[_0x9d09('0x23')](_0x91f066);}return _0x34ed56['save']();};}function saveUpdates(_0x4a7e9a,_0x5ea8f8){return function(_0x260727){if(_0x260727){return _0x260727[_0x9d09('0x24')](_0x4a7e9a)[_0x9d09('0x25')](function(_0x449213){return _0x449213;});}return null;};}function removeEntity(_0x2ed3ff,_0x487fed){return function(_0x51099a){if(_0x51099a){return _0x51099a[_0x9d09('0x26')]()['then'](function(){_0x2ed3ff[_0x9d09('0x1a')](0xcc)[_0x9d09('0x1b')]();});}};}function handleEntityNotFound(_0x251626,_0x4957bb){return function(_0x5741a8){if(!_0x5741a8){_0x251626['sendStatus'](0x194);}return _0x5741a8;};}function handleError(_0x5a36f6,_0x300191){_0x300191=_0x300191||0x1f4;return function(_0x1a6a98){logger[_0x9d09('0x27')](_0x1a6a98[_0x9d09('0x28')]);if(_0x1a6a98['name']){delete _0x1a6a98[_0x9d09('0x29')];}_0x5a36f6['status'](_0x300191)[_0x9d09('0x2a')](_0x1a6a98);};}exports['index']=function(_0x3fb6a4,_0x40a2d6){var _0x399846={},_0x4ca939={},_0x483a0e={'count':0x0,'rows':[]};var _0x308a85=_['map'](db['SquareRecording'][_0x9d09('0x2b')],function(_0x2d9441){return{'name':_0x2d9441[_0x9d09('0x2c')],'type':_0x2d9441[_0x9d09('0x2d')][_0x9d09('0x2e')]};});_0x4ca939[_0x9d09('0x2f')]=_[_0x9d09('0x30')](_0x308a85,_0x9d09('0x29'));_0x4ca939['query']=_[_0x9d09('0x31')](_0x3fb6a4[_0x9d09('0x32')]);_0x4ca939['filters']=_[_0x9d09('0x33')](_0x4ca939['model'],_0x4ca939['query']);_0x399846['attributes']=_[_0x9d09('0x33')](_0x4ca939['model'],qs[_0x9d09('0x34')](_0x3fb6a4['query'][_0x9d09('0x34')]));_0x399846[_0x9d09('0x35')]=_0x399846[_0x9d09('0x35')][_0x9d09('0x36')]?_0x399846[_0x9d09('0x35')]:_0x4ca939[_0x9d09('0x2f')];if(!_0x3fb6a4[_0x9d09('0x32')]['hasOwnProperty'](_0x9d09('0x37'))){_0x399846[_0x9d09('0x1f')]=qs['limit'](_0x3fb6a4[_0x9d09('0x32')][_0x9d09('0x1f')]);_0x399846['offset']=qs[_0x9d09('0x1d')](_0x3fb6a4[_0x9d09('0x32')][_0x9d09('0x1d')]);}_0x399846[_0x9d09('0x38')]=qs['sort'](_0x3fb6a4['query']['sort']);_0x399846[_0x9d09('0x39')]=qs[_0x9d09('0x3a')](_['pick'](_0x3fb6a4[_0x9d09('0x32')],_0x4ca939[_0x9d09('0x3a')]),_0x308a85);if(_0x3fb6a4['query'][_0x9d09('0x3b')]){_0x399846[_0x9d09('0x39')]=_[_0x9d09('0x3c')](_0x399846[_0x9d09('0x39')],{'$or':_[_0x9d09('0x30')](_0x308a85,function(_0x194f38){if(_0x194f38[_0x9d09('0x2d')]!=='VIRTUAL'){var _0x3f0151={};_0x3f0151[_0x194f38[_0x9d09('0x29')]]={'$like':'%'+_0x3fb6a4[_0x9d09('0x32')][_0x9d09('0x3b')]+'%'};return _0x3f0151;}})});}_0x399846=_['merge']({},_0x399846,_0x3fb6a4['options']);var _0x21e852={'where':_0x399846[_0x9d09('0x39')]};return db[_0x9d09('0x3d')][_0x9d09('0x20')](_0x21e852)['then'](function(_0x29202b){_0x483a0e['count']=_0x29202b;if(_0x3fb6a4[_0x9d09('0x32')][_0x9d09('0x3e')]){_0x399846[_0x9d09('0x3f')]=[{'all':!![]}];}return db[_0x9d09('0x3d')][_0x9d09('0x40')](_0x399846);})[_0x9d09('0x25')](function(_0x372256){_0x483a0e[_0x9d09('0x41')]=_0x372256;return _0x483a0e;})['then'](respondWithFilteredResult(_0x40a2d6,_0x399846))[_0x9d09('0x42')](handleError(_0x40a2d6,null));};exports['show']=function(_0x2686ca,_0x18dd31){var _0x125352={'raw':!![],'where':{'id':_0x2686ca[_0x9d09('0x43')]['id']}},_0x43678d={};_0x43678d[_0x9d09('0x2f')]=_[_0x9d09('0x31')](db[_0x9d09('0x3d')][_0x9d09('0x2b')]);_0x43678d[_0x9d09('0x32')]=_['keys'](_0x2686ca[_0x9d09('0x32')]);_0x43678d['filters']=_[_0x9d09('0x33')](_0x43678d[_0x9d09('0x2f')],_0x43678d[_0x9d09('0x32')]);_0x125352[_0x9d09('0x35')]=_[_0x9d09('0x33')](_0x43678d['model'],qs['fields'](_0x2686ca[_0x9d09('0x32')]['fields']));_0x125352[_0x9d09('0x35')]=_0x125352[_0x9d09('0x35')][_0x9d09('0x36')]?_0x125352[_0x9d09('0x35')]:_0x43678d['model'];if(_0x2686ca[_0x9d09('0x32')][_0x9d09('0x3e')]){_0x125352[_0x9d09('0x3f')]=[{'all':!![]}];}_0x125352=_[_0x9d09('0x3c')]({},_0x125352,_0x2686ca['options']);return db[_0x9d09('0x3d')][_0x9d09('0x44')](_0x125352)[_0x9d09('0x25')](handleEntityNotFound(_0x18dd31,null))[_0x9d09('0x25')](respondWithResult(_0x18dd31,null))[_0x9d09('0x42')](handleError(_0x18dd31,null));};exports['create']=function(_0x3197f8,_0x891f00){return db[_0x9d09('0x3d')][_0x9d09('0x45')](_0x3197f8[_0x9d09('0x46')],{})[_0x9d09('0x25')](respondWithResult(_0x891f00,0xc9))[_0x9d09('0x42')](handleError(_0x891f00,null));};exports['update']=function(_0x20d376,_0x2add48){if(_0x20d376[_0x9d09('0x46')]['id']){delete _0x20d376['body']['id'];}return db[_0x9d09('0x3d')]['find']({'where':{'id':_0x20d376[_0x9d09('0x43')]['id']}})[_0x9d09('0x25')](handleEntityNotFound(_0x2add48,null))['then'](saveUpdates(_0x20d376[_0x9d09('0x46')],null))['then'](respondWithResult(_0x2add48,null))['catch'](handleError(_0x2add48,null));};exports['download']=function(_0x3f1c37,_0x7a090,_0x3f92a6){var _0x5ce248=require('../../components/encryptor');var _0x4758f6=![];var _0x182d82={};if(_0x3f1c37[_0x9d09('0x32')][_0x9d09('0x2d')]&&_0x3f1c37[_0x9d09('0x32')]['type']===_0x9d09('0x47')){_0x182d82[_0x9d09('0x47')]=_0x3f1c37[_0x9d09('0x43')]['id'];}else{_0x182d82['id']=_0x3f1c37['params']['id'];}return db['SquareRecording'][_0x9d09('0x44')]({'where':_0x182d82,'attributes':['id',_0x9d09('0x48'),_0x9d09('0x49')],'raw':!![]})[_0x9d09('0x25')](handleEntityNotFound(_0x7a090,null))[_0x9d09('0x25')](function(_0xeb81f3){if(_0xeb81f3){var _0x6cf9c3=_0xeb81f3[_0x9d09('0x48')];var _0x4851a1=util[_0x9d09('0x4a')]('%s.cypher',_0x6cf9c3);if(fs[_0x9d09('0x4b')](_0x4851a1)){_0x4758f6=!![];return _0x5ce248[_0x9d09('0x4c')](_0x4851a1,_0x6cf9c3,config[_0x9d09('0x4d')]['recording'])[_0x9d09('0x25')](function(){return _0xeb81f3;});}return _0xeb81f3;}})['then'](function(_0x22d45a){if(_0x22d45a){var _0x53076a=_0x22d45a[_0x9d09('0x48')];if(!fs[_0x9d09('0x4b')](_0x53076a)){throw new db['Sequelize']['ValidationError'](_0x9d09('0x4e'));}if(_0x22d45a[_0x9d09('0x49')]){return _0x7a090['download'](_0x53076a,_0x22d45a[_0x9d09('0x49')]+path[_0x9d09('0x4f')](_0x53076a),function(){if(_0x4758f6){fs[_0x9d09('0x50')](_0x53076a);}});}else{return _0x7a090[_0x9d09('0x51')](_0x53076a,function(_0xce71fc){if(_0x4758f6){fs['unlink'](_0x53076a);}});}}})[_0x9d09('0x42')](function(_0x1b438e){if(_0x1b438e[_0x9d09('0x52')]==='SquareRecording\x20not\x20found'){_0x7a090[_0x9d09('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x7a090,null);}});};exports[_0x9d09('0x26')]=function(_0x33bdf0,_0x4724bd){return db[_0x9d09('0x3d')]['find']({'where':{'id':_0x33bdf0[_0x9d09('0x43')]['id']}})[_0x9d09('0x25')](function(_0x1a1480){if(_[_0x9d09('0x53')](_0x1a1480)){throw new ReferenceError(_0x9d09('0x54'));}return _0x1a1480;})[_0x9d09('0x25')](function(_0x46bff1){var _0xb757ee=_0x46bff1['savePath'];logger[_0x9d09('0x55')](_0x9d09('0x56'),_0xb757ee);if(!_[_0x9d09('0x53')](_0x46bff1['savePath'])&&fs['existsSync'](_0xb757ee)){logger[_0x9d09('0x55')](_0x9d09('0x57')+_0xb757ee+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x9d09('0x58')](_0xb757ee);}_0xb757ee=_0xb757ee+_0x9d09('0x59');if(!_[_0x9d09('0x53')](_0x46bff1[_0x9d09('0x48')])&&fs['existsSync'](_0xb757ee)){logger[_0x9d09('0x55')](_0x9d09('0x57')+_0xb757ee+_0x9d09('0x5a'));fs[_0x9d09('0x58')](_0xb757ee);}return _0x46bff1;})[_0x9d09('0x25')](function(_0x29dd5c){if(!_0x29dd5c)throw new InternalError();return _0x29dd5c[_0x9d09('0x26')]();})[_0x9d09('0x25')](function(){_0x4724bd[_0x9d09('0x1a')](0xcc)[_0x9d09('0x1b')]();})['catch'](handleError(_0x4724bd,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index c979735..e9f0393 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 _0x44c2=['../../config/environment','./squareRecording.attributes','SquareRecording','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x26a818,_0x40708a){var _0x5d8ca0=function(_0x3cc7ed){while(--_0x3cc7ed){_0x26a818['push'](_0x26a818['shift']());}};_0x5d8ca0(++_0x40708a);}(_0x44c2,0x100));var _0x244c=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0x44c2[_0xd2d54];return _0x78b113;};'use strict';var _=require(_0x244c('0x0'));var util=require(_0x244c('0x1'));var logger=require(_0x244c('0x2'))(_0x244c('0x3'));var moment=require('moment');var BPromise=require(_0x244c('0x4'));var rp=require(_0x244c('0x5'));var fs=require('fs');var path=require(_0x244c('0x6'));var rimraf=require(_0x244c('0x7'));var config=require(_0x244c('0x8'));var attributes=require(_0x244c('0x9'));module['exports']=function(_0x5b6f9a,_0x446a4c){return _0x5b6f9a['define'](_0x244c('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf446=['api','bluebird','path','rimraf','./squareRecording.attributes','define','square_recordings','lodash','../../config/logger'];(function(_0xe848ba,_0x4e19e1){var _0x310a7b=function(_0xaaa9da){while(--_0xaaa9da){_0xe848ba['push'](_0xe848ba['shift']());}};_0x310a7b(++_0x4e19e1);}(_0xf446,0x1c0));var _0x6f44=function(_0x32fd28,_0x41d6c0){_0x32fd28=_0x32fd28-0x0;var _0x4edba3=_0xf446[_0x32fd28];return _0x4edba3;};'use strict';var _=require(_0x6f44('0x0'));var util=require('util');var logger=require(_0x6f44('0x1'))(_0x6f44('0x2'));var moment=require('moment');var BPromise=require(_0x6f44('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f44('0x4'));var rimraf=require(_0x6f44('0x5'));var config=require('../../config/environment');var attributes=require(_0x6f44('0x6'));module['exports']=function(_0x4ffb0e,_0x531344){return _0x4ffb0e[_0x6f44('0x7')]('SquareRecording',attributes,{'tableName':_0x6f44('0x8'),'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 779e5bd..894c911 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 _0x013e=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareRecording','create','body','options','raw','lodash','util','moment','bluebird','randomstring'];(function(_0xbc93c3,_0x180233){var _0x22cdbc=function(_0x3dbd3a){while(--_0x3dbd3a){_0xbc93c3['push'](_0xbc93c3['shift']());}};_0x22cdbc(++_0x180233);}(_0x013e,0x183));var _0xe013=function(_0x3ae2b2,_0x2d936f){_0x3ae2b2=_0x3ae2b2-0x0;var _0x1dbf00=_0x013e[_0x3ae2b2];return _0x1dbf00;};'use strict';var _=require(_0xe013('0x0'));var util=require(_0xe013('0x1'));var moment=require(_0xe013('0x2'));var BPromise=require(_0xe013('0x3'));var rs=require(_0xe013('0x4'));var fs=require('fs');var Redis=require(_0xe013('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe013('0x6'));var logger=require(_0xe013('0x7'))(_0xe013('0x8'));var config=require(_0xe013('0x9'));var jayson=require(_0xe013('0xa'));var client=jayson[_0xe013('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35488e,_0x2365d5,_0x32bd18){return new BPromise(function(_0xcbed6,_0x1b79ba){return client[_0xe013('0xc')](_0x35488e,_0x32bd18)[_0xe013('0xd')](function(_0x574682){logger['info'](_0xe013('0xe'),_0x2365d5,_0xe013('0xf'));logger[_0xe013('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x2365d5,'request\x20sent',JSON[_0xe013('0x11')](_0x574682));if(_0x574682[_0xe013('0x12')]){if(_0x574682[_0xe013('0x12')][_0xe013('0x13')]===0x1f4){logger['error'](_0xe013('0xe'),_0x2365d5,_0x574682[_0xe013('0x12')][_0xe013('0x14')]);return _0x1b79ba(_0x574682['error']['message']);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x2365d5,_0x574682[_0xe013('0x12')]['message']);return _0xcbed6(_0x574682[_0xe013('0x12')]['message']);}else{logger['info'](_0xe013('0xe'),_0x2365d5,_0xe013('0xf'));_0xcbed6(_0x574682[_0xe013('0x15')][_0xe013('0x14')]);}})[_0xe013('0x16')](function(_0x1253ab){logger['error'](_0xe013('0xe'),_0x2365d5,_0x1253ab);_0x1b79ba(_0x1253ab);});});}exports[_0xe013('0x17')]=function(_0x483451){var _0xffadbe=this;return new Promise(function(_0x4e983f,_0x165623){return db['SquareRecording'][_0xe013('0x18')](_0x483451[_0xe013('0x19')],{'raw':_0x483451[_0xe013('0x1a')]?_0x483451['options'][_0xe013('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2916a6){logger['info'](_0xe013('0x17'),_0x483451);logger['debug'](_0xe013('0x17'),_0x483451,JSON[_0xe013('0x11')](_0x2916a6));_0x4e983f(_0x2916a6);})[_0xe013('0x16')](function(_0x46469b){logger['error'](_0xe013('0x17'),_0x46469b[_0xe013('0x14')],_0x483451);_0x165623(_0xffadbe[_0xe013('0x12')](0x1f4,_0x46469b['message']));});});}; \ No newline at end of file +var _0x149f=['request','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording','SquareRecording','create','body','then','bluebird','randomstring','ioredis','../../config/environment'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0x149f,0x164));var _0xf149=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x149f[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf149('0x0'));var rs=require(_0xf149('0x1'));var fs=require('fs');var Redis=require(_0xf149('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf149('0x3'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x9db427,_0x48ff18,_0x3451ea){return new BPromise(function(_0x310d62,_0x12d28e){return client[_0xf149('0x4')](_0x9db427,_0x3451ea)['then'](function(_0x35e50a){logger[_0xf149('0x5')]('SquareRecording,\x20%s,\x20%s',_0x48ff18,_0xf149('0x6'));logger[_0xf149('0x7')](_0xf149('0x8'),_0x48ff18,_0xf149('0x6'),JSON[_0xf149('0x9')](_0x35e50a));if(_0x35e50a[_0xf149('0xa')]){if(_0x35e50a[_0xf149('0xa')]['code']===0x1f4){logger[_0xf149('0xa')](_0xf149('0xb'),_0x48ff18,_0x35e50a[_0xf149('0xa')]['message']);return _0x12d28e(_0x35e50a[_0xf149('0xa')]['message']);}logger[_0xf149('0xa')](_0xf149('0xb'),_0x48ff18,_0x35e50a[_0xf149('0xa')][_0xf149('0xc')]);return _0x310d62(_0x35e50a['error'][_0xf149('0xc')]);}else{logger[_0xf149('0x5')]('SquareRecording,\x20%s,\x20%s',_0x48ff18,_0xf149('0x6'));_0x310d62(_0x35e50a[_0xf149('0xd')][_0xf149('0xc')]);}})[_0xf149('0xe')](function(_0x242122){logger[_0xf149('0xa')](_0xf149('0xb'),_0x48ff18,_0x242122);_0x12d28e(_0x242122);});});}exports[_0xf149('0xf')]=function(_0x4ca44e){var _0x2646a7=this;return new Promise(function(_0x1a7697,_0x454d36){return db[_0xf149('0x10')][_0xf149('0x11')](_0x4ca44e[_0xf149('0x12')],{'raw':_0x4ca44e['options']?_0x4ca44e['options']['raw']===undefined?!![]:![]:!![]})[_0xf149('0x13')](function(_0x375109){logger[_0xf149('0x5')](_0xf149('0xf'),_0x4ca44e);logger[_0xf149('0x7')](_0xf149('0xf'),_0x4ca44e,JSON[_0xf149('0x9')](_0x375109));_0x1a7697(_0x375109);})[_0xf149('0xe')](function(_0x32843f){logger[_0xf149('0xa')](_0xf149('0xf'),_0x32843f[_0xf149('0xc')],_0x4ca44e);_0x454d36(_0x2646a7[_0xf149('0xa')](0x1f4,_0x32843f[_0xf149('0xc')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 9bcd93e..ccefc73 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 _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x1e8adf,_0x26a9c2){var _0x4b4732=function(_0x56a9bd){while(--_0x56a9bd){_0x1e8adf['push'](_0x1e8adf['shift']());}};_0x4b4732(++_0x26a9c2);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x357ec3,_0x5ee0a2){var _0x2308af=function(_0x5c4928){while(--_0x5c4928){_0x357ec3['push'](_0x357ec3['shift']());}};_0x2308af(++_0x5ee0a2);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 8d0aa8c..d0a89c4 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 _0x5111=['BOOLEAN','exports','STRING','DATE'];(function(_0x37a0ed,_0x399b23){var _0xba6f39=function(_0x2846e0){while(--_0x2846e0){_0x37a0ed['push'](_0x37a0ed['shift']());}};_0xba6f39(++_0x399b23);}(_0x5111,0xc9));var _0x1511=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5111[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module[_0x1511('0x0')]={'network':{'type':Sequelize[_0x1511('0x1')]},'network_script':{'type':Sequelize[_0x1511('0x1')]},'request':{'type':Sequelize[_0x1511('0x1')]},'channel':{'type':Sequelize[_0x1511('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1511('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x1511('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x1511('0x1')]},'callingani2':{'type':Sequelize[_0x1511('0x1')]},'callington':{'type':Sequelize[_0x1511('0x1')]},'callingtns':{'type':Sequelize[_0x1511('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x1511('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x1511('0x1')]},'enhanced':{'type':Sequelize[_0x1511('0x1')]},'accountcode':{'type':Sequelize[_0x1511('0x1')]},'threadid':{'type':Sequelize[_0x1511('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1511('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x1511('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8481=['exports','STRING','DATE'];(function(_0x2dc7c9,_0x3a15f8){var _0x3e6536=function(_0x312829){while(--_0x312829){_0x2dc7c9['push'](_0x2dc7c9['shift']());}};_0x3e6536(++_0x3a15f8);}(_0x8481,0x6c));var _0x1848=function(_0x5400a1,_0x2275aa){_0x5400a1=_0x5400a1-0x0;var _0x4006c7=_0x8481[_0x5400a1];return _0x4006c7;};'use strict';var Sequelize=require('sequelize');module[_0x1848('0x0')]={'network':{'type':Sequelize[_0x1848('0x1')]},'network_script':{'type':Sequelize[_0x1848('0x1')]},'request':{'type':Sequelize[_0x1848('0x1')]},'channel':{'type':Sequelize[_0x1848('0x1')]},'language':{'type':Sequelize[_0x1848('0x1')]},'type':{'type':Sequelize[_0x1848('0x1')]},'uniqueid':{'type':Sequelize[_0x1848('0x1')]},'version':{'type':Sequelize[_0x1848('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1848('0x1')]},'callingpres':{'type':Sequelize[_0x1848('0x1')]},'callingani2':{'type':Sequelize[_0x1848('0x1')]},'callington':{'type':Sequelize[_0x1848('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x1848('0x1')]},'rdnis':{'type':Sequelize[_0x1848('0x1')]},'context':{'type':Sequelize[_0x1848('0x1')]},'extension':{'type':Sequelize[_0x1848('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x1848('0x1')]},'accountcode':{'type':Sequelize[_0x1848('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x1848('0x1')]},'joinAt':{'type':Sequelize[_0x1848('0x2')]},'leaveAt':{'type':Sequelize[_0x1848('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index bb8b732..738be73 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 _0xcba5=['reject','save','then','destroy','error','stack','name','index','SquareReport','rawAttributes','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','describe','eml-format','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','apply'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcba5,0x74));var _0x5cba=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xcba5[_0x4ff09b];return _0x3f5c2e;};'use strict';var emlformat=require(_0x5cba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5cba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5cba('0x2'));var BPromise=require(_0x5cba('0x3'));var Mustache=require('mustache');var util=require(_0x5cba('0x4'));var path=require(_0x5cba('0x5'));var sox=require('sox');var csv=require(_0x5cba('0x6'));var ejs=require(_0x5cba('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5cba('0x8'));var squel=require(_0x5cba('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5cba('0xa'));var toCsv=require(_0x5cba('0x6'));var querystring=require(_0x5cba('0xb'));var Papa=require(_0x5cba('0xc'));var Redis=require(_0x5cba('0xd'));var authService=require(_0x5cba('0xe'));var qs=require(_0x5cba('0xf'));var as=require(_0x5cba('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5cba('0x11'))(_0x5cba('0x12'));var utils=require('../../config/utils');var config=require(_0x5cba('0x13'));var licenseUtil=require(_0x5cba('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5879df,_0x3a80fe){_0x3a80fe=_0x3a80fe||0xcc;return function(_0x46f59f){if(_0x46f59f){return _0x5879df[_0x5cba('0x15')](_0x3a80fe);}return _0x5879df[_0x5cba('0x16')](_0x3a80fe)[_0x5cba('0x17')]();};}function respondWithResult(_0x17a4a9,_0x47f677){_0x47f677=_0x47f677||0xc8;return function(_0x2ef4f3){if(_0x2ef4f3){return _0x17a4a9['status'](_0x47f677)['json'](_0x2ef4f3);}};}function respondWithFilteredResult(_0x4d38e6,_0x56262e){return function(_0x162c77){if(_0x162c77){var _0x241559=typeof _0x56262e['offset']===_0x5cba('0x18')&&typeof _0x56262e['limit']===_0x5cba('0x18');var _0x23dcd5=_0x162c77[_0x5cba('0x19')];var _0x48e765=_0x241559?0x0:_0x56262e[_0x5cba('0x1a')];var _0x2a01c9=_0x241559?_0x162c77[_0x5cba('0x19')]:_0x56262e[_0x5cba('0x1a')]+_0x56262e[_0x5cba('0x1b')];var _0x4cacd5;if(_0x2a01c9>=_0x23dcd5){_0x2a01c9=_0x23dcd5;_0x4cacd5=0xc8;}else{_0x4cacd5=0xce;}_0x4d38e6[_0x5cba('0x16')](_0x4cacd5);return _0x4d38e6[_0x5cba('0x1c')]('Content-Range',_0x48e765+'-'+_0x2a01c9+'/'+_0x23dcd5)['json'](_0x162c77);}return null;};}function patchUpdates(_0x5b1a41){return function(_0x47f014){try{jsonpatch[_0x5cba('0x1d')](_0x47f014,_0x5b1a41,!![]);}catch(_0x53895e){return BPromise[_0x5cba('0x1e')](_0x53895e);}return _0x47f014[_0x5cba('0x1f')]();};}function saveUpdates(_0x259f0b,_0xf16644){return function(_0x244d05){if(_0x244d05){return _0x244d05['update'](_0x259f0b)[_0x5cba('0x20')](function(_0x55b01c){return _0x55b01c;});}return null;};}function removeEntity(_0x21447e,_0x27f5be){return function(_0x3894e4){if(_0x3894e4){return _0x3894e4[_0x5cba('0x21')]()['then'](function(){_0x21447e[_0x5cba('0x16')](0xcc)[_0x5cba('0x17')]();});}};}function handleEntityNotFound(_0x4e81e6,_0x588567){return function(_0xdb3106){if(!_0xdb3106){_0x4e81e6[_0x5cba('0x15')](0x194);}return _0xdb3106;};}function handleError(_0x2bc106,_0x19d6e9){_0x19d6e9=_0x19d6e9||0x1f4;return function(_0x47db75){logger[_0x5cba('0x22')](_0x47db75[_0x5cba('0x23')]);if(_0x47db75[_0x5cba('0x24')]){delete _0x47db75[_0x5cba('0x24')];}_0x2bc106[_0x5cba('0x16')](_0x19d6e9)['send'](_0x47db75);};}exports[_0x5cba('0x25')]=function(_0x35e41e,_0x5dfca2){var _0x5264f6={},_0x352818={},_0x22ce98={'count':0x0,'rows':[]};var _0x3f9958=_['map'](db[_0x5cba('0x26')][_0x5cba('0x27')],function(_0x39f90e){return{'name':_0x39f90e['fieldName'],'type':_0x39f90e['type'][_0x5cba('0x28')]};});_0x352818['model']=_[_0x5cba('0x29')](_0x3f9958,'name');_0x352818['query']=_[_0x5cba('0x2a')](_0x35e41e[_0x5cba('0x2b')]);_0x352818[_0x5cba('0x2c')]=_[_0x5cba('0x2d')](_0x352818[_0x5cba('0x2e')],_0x352818[_0x5cba('0x2b')]);_0x5264f6[_0x5cba('0x2f')]=_['intersection'](_0x352818[_0x5cba('0x2e')],qs[_0x5cba('0x30')](_0x35e41e[_0x5cba('0x2b')][_0x5cba('0x30')]));_0x5264f6['attributes']=_0x5264f6[_0x5cba('0x2f')][_0x5cba('0x31')]?_0x5264f6[_0x5cba('0x2f')]:_0x352818[_0x5cba('0x2e')];if(!_0x35e41e[_0x5cba('0x2b')][_0x5cba('0x32')](_0x5cba('0x33'))){_0x5264f6[_0x5cba('0x1b')]=qs['limit'](_0x35e41e[_0x5cba('0x2b')]['limit']);_0x5264f6['offset']=qs[_0x5cba('0x1a')](_0x35e41e[_0x5cba('0x2b')][_0x5cba('0x1a')]);}_0x5264f6[_0x5cba('0x34')]=qs[_0x5cba('0x35')](_0x35e41e[_0x5cba('0x2b')]['sort']);_0x5264f6[_0x5cba('0x36')]=qs[_0x5cba('0x2c')](_[_0x5cba('0x37')](_0x35e41e[_0x5cba('0x2b')],_0x352818['filters']),_0x3f9958);if(_0x35e41e['query'][_0x5cba('0x38')]){_0x5264f6[_0x5cba('0x36')]=_['merge'](_0x5264f6[_0x5cba('0x36')],{'$or':_['map'](_0x3f9958,function(_0x1425e1){if(_0x1425e1[_0x5cba('0x39')]!==_0x5cba('0x3a')){var _0x30fbdf={};_0x30fbdf[_0x1425e1[_0x5cba('0x24')]]={'$like':'%'+_0x35e41e[_0x5cba('0x2b')][_0x5cba('0x38')]+'%'};return _0x30fbdf;}})});}_0x5264f6=_[_0x5cba('0x3b')]({},_0x5264f6,_0x35e41e[_0x5cba('0x3c')]);var _0x275b8e={'where':_0x5264f6[_0x5cba('0x36')]};return db[_0x5cba('0x26')][_0x5cba('0x19')](_0x275b8e)['then'](function(_0x591695){_0x22ce98[_0x5cba('0x19')]=_0x591695;if(_0x35e41e[_0x5cba('0x2b')][_0x5cba('0x3d')]){_0x5264f6[_0x5cba('0x3e')]=[{'all':!![]}];}return db[_0x5cba('0x26')][_0x5cba('0x3f')](_0x5264f6);})[_0x5cba('0x20')](function(_0x3a4862){_0x22ce98[_0x5cba('0x40')]=_0x3a4862;return _0x22ce98;})[_0x5cba('0x20')](respondWithFilteredResult(_0x5dfca2,_0x5264f6))['catch'](handleError(_0x5dfca2,null));};exports[_0x5cba('0x41')]=function(_0x49c078,_0x278b8d){var _0x3e9d0a={'raw':!![],'where':{'id':_0x49c078[_0x5cba('0x42')]['id']}},_0x220955={};_0x220955[_0x5cba('0x2e')]=_[_0x5cba('0x2a')](db[_0x5cba('0x26')]['rawAttributes']);_0x220955[_0x5cba('0x2b')]=_[_0x5cba('0x2a')](_0x49c078[_0x5cba('0x2b')]);_0x220955[_0x5cba('0x2c')]=_['intersection'](_0x220955['model'],_0x220955[_0x5cba('0x2b')]);_0x3e9d0a[_0x5cba('0x2f')]=_[_0x5cba('0x2d')](_0x220955[_0x5cba('0x2e')],qs[_0x5cba('0x30')](_0x49c078[_0x5cba('0x2b')][_0x5cba('0x30')]));_0x3e9d0a['attributes']=_0x3e9d0a[_0x5cba('0x2f')][_0x5cba('0x31')]?_0x3e9d0a[_0x5cba('0x2f')]:_0x220955['model'];if(_0x49c078[_0x5cba('0x2b')][_0x5cba('0x3d')]){_0x3e9d0a[_0x5cba('0x3e')]=[{'all':!![]}];}_0x3e9d0a=_[_0x5cba('0x3b')]({},_0x3e9d0a,_0x49c078[_0x5cba('0x3c')]);return db[_0x5cba('0x26')][_0x5cba('0x43')](_0x3e9d0a)[_0x5cba('0x20')](handleEntityNotFound(_0x278b8d,null))[_0x5cba('0x20')](respondWithResult(_0x278b8d,null))[_0x5cba('0x44')](handleError(_0x278b8d,null));};exports[_0x5cba('0x45')]=function(_0x45c124,_0xe0c729){return db[_0x5cba('0x26')][_0x5cba('0x45')](_0x45c124[_0x5cba('0x46')],{})[_0x5cba('0x20')](respondWithResult(_0xe0c729,0xc9))['catch'](handleError(_0xe0c729,null));};exports[_0x5cba('0x47')]=function(_0x3588c1,_0x3464c1){if(_0x3588c1['body']['id']){delete _0x3588c1[_0x5cba('0x46')]['id'];}return db[_0x5cba('0x26')][_0x5cba('0x43')]({'where':{'id':_0x3588c1[_0x5cba('0x42')]['id']}})['then'](handleEntityNotFound(_0x3464c1,null))[_0x5cba('0x20')](saveUpdates(_0x3588c1[_0x5cba('0x46')],null))['then'](respondWithResult(_0x3464c1,null))['catch'](handleError(_0x3464c1,null));};exports[_0x5cba('0x21')]=function(_0x4f58c6,_0x334bac){return db['SquareReport'][_0x5cba('0x43')]({'where':{'id':_0x4f58c6[_0x5cba('0x42')]['id']}})[_0x5cba('0x20')](handleEntityNotFound(_0x334bac,null))['then'](removeEntity(_0x334bac,null))[_0x5cba('0x44')](handleError(_0x334bac,null));};exports[_0x5cba('0x48')]=function(_0x5d28f0,_0x221fb1){return db[_0x5cba('0x26')]['describe']()[_0x5cba('0x20')](respondWithResult(_0x221fb1,null))[_0x5cba('0x44')](handleError(_0x221fb1,null));}; \ No newline at end of file +var _0x97d9=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','send','SquareReport','rawAttributes','type','key','name','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','filters','filter','where','map','merge','options','includeAll','include','rows','show','find','catch','create','body','params','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x238f08,_0x17b2d6){var _0x306697=function(_0x28a705){while(--_0x28a705){_0x238f08['push'](_0x238f08['shift']());}};_0x306697(++_0x17b2d6);}(_0x97d9,0x72));var _0x997d=function(_0x34b348,_0x12e1b7){_0x34b348=_0x34b348-0x0;var _0xeccd2c=_0x97d9[_0x34b348];return _0xeccd2c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x997d('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x997d('0x1'));var moment=require(_0x997d('0x2'));var BPromise=require(_0x997d('0x3'));var Mustache=require(_0x997d('0x4'));var util=require(_0x997d('0x5'));var path=require('path');var sox=require(_0x997d('0x6'));var csv=require('to-csv');var ejs=require(_0x997d('0x7'));var fs=require('fs');var fs_extra=require(_0x997d('0x8'));var _=require(_0x997d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x997d('0xa'));var deskjs=require(_0x997d('0xb'));var toCsv=require('to-csv');var querystring=require(_0x997d('0xc'));var Papa=require(_0x997d('0xd'));var Redis=require(_0x997d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x997d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x997d('0x10'));var logger=require(_0x997d('0x11'))(_0x997d('0x12'));var utils=require('../../config/utils');var config=require(_0x997d('0x13'));var licenseUtil=require(_0x997d('0x14'));var db=require(_0x997d('0x15'))['db'];function respondWithStatusCode(_0x164b5b,_0x55a5bb){_0x55a5bb=_0x55a5bb||0xcc;return function(_0x3c30a7){if(_0x3c30a7){return _0x164b5b['sendStatus'](_0x55a5bb);}return _0x164b5b[_0x997d('0x16')](_0x55a5bb)[_0x997d('0x17')]();};}function respondWithResult(_0x59bc02,_0xd74e6c){_0xd74e6c=_0xd74e6c||0xc8;return function(_0x25d45b){if(_0x25d45b){return _0x59bc02[_0x997d('0x16')](_0xd74e6c)[_0x997d('0x18')](_0x25d45b);}};}function respondWithFilteredResult(_0x2c97f5,_0x2da792){return function(_0x553da6){if(_0x553da6){var _0x1d165f=typeof _0x2da792[_0x997d('0x19')]===_0x997d('0x1a')&&typeof _0x2da792[_0x997d('0x1b')]===_0x997d('0x1a');var _0x328dca=_0x553da6[_0x997d('0x1c')];var _0x3dcf1d=_0x1d165f?0x0:_0x2da792[_0x997d('0x19')];var _0x4256ed=_0x1d165f?_0x553da6[_0x997d('0x1c')]:_0x2da792[_0x997d('0x19')]+_0x2da792[_0x997d('0x1b')];var _0x16143d;if(_0x4256ed>=_0x328dca){_0x4256ed=_0x328dca;_0x16143d=0xc8;}else{_0x16143d=0xce;}_0x2c97f5[_0x997d('0x16')](_0x16143d);return _0x2c97f5[_0x997d('0x1d')](_0x997d('0x1e'),_0x3dcf1d+'-'+_0x4256ed+'/'+_0x328dca)['json'](_0x553da6);}return null;};}function patchUpdates(_0x142c7d){return function(_0x389c83){try{jsonpatch[_0x997d('0x1f')](_0x389c83,_0x142c7d,!![]);}catch(_0x3e4ccd){return BPromise[_0x997d('0x20')](_0x3e4ccd);}return _0x389c83['save']();};}function saveUpdates(_0xc4fa98,_0x1273ae){return function(_0xe6aeae){if(_0xe6aeae){return _0xe6aeae[_0x997d('0x21')](_0xc4fa98)[_0x997d('0x22')](function(_0x328390){return _0x328390;});}return null;};}function removeEntity(_0x5e9383,_0x39bf37){return function(_0x2d61c2){if(_0x2d61c2){return _0x2d61c2[_0x997d('0x23')]()['then'](function(){_0x5e9383[_0x997d('0x16')](0xcc)[_0x997d('0x17')]();});}};}function handleEntityNotFound(_0x5e01c9,_0x431d30){return function(_0xaecc78){if(!_0xaecc78){_0x5e01c9[_0x997d('0x24')](0x194);}return _0xaecc78;};}function handleError(_0x3a9190,_0x1bc1a5){_0x1bc1a5=_0x1bc1a5||0x1f4;return function(_0x2e9234){logger[_0x997d('0x25')](_0x2e9234['stack']);if(_0x2e9234['name']){delete _0x2e9234['name'];}_0x3a9190[_0x997d('0x16')](_0x1bc1a5)[_0x997d('0x26')](_0x2e9234);};}exports['index']=function(_0xfef41c,_0x2a0b3a){var _0x59f847={},_0x3ad586={},_0x3719f4={'count':0x0,'rows':[]};var _0x47feb9=_['map'](db[_0x997d('0x27')][_0x997d('0x28')],function(_0x2adc93){return{'name':_0x2adc93['fieldName'],'type':_0x2adc93[_0x997d('0x29')][_0x997d('0x2a')]};});_0x3ad586['model']=_['map'](_0x47feb9,_0x997d('0x2b'));_0x3ad586[_0x997d('0x2c')]=_[_0x997d('0x2d')](_0xfef41c['query']);_0x3ad586['filters']=_['intersection'](_0x3ad586[_0x997d('0x2e')],_0x3ad586[_0x997d('0x2c')]);_0x59f847[_0x997d('0x2f')]=_[_0x997d('0x30')](_0x3ad586[_0x997d('0x2e')],qs[_0x997d('0x31')](_0xfef41c['query'][_0x997d('0x31')]));_0x59f847['attributes']=_0x59f847[_0x997d('0x2f')][_0x997d('0x32')]?_0x59f847[_0x997d('0x2f')]:_0x3ad586[_0x997d('0x2e')];if(!_0xfef41c[_0x997d('0x2c')]['hasOwnProperty'](_0x997d('0x33'))){_0x59f847['limit']=qs[_0x997d('0x1b')](_0xfef41c[_0x997d('0x2c')][_0x997d('0x1b')]);_0x59f847['offset']=qs[_0x997d('0x19')](_0xfef41c[_0x997d('0x2c')]['offset']);}_0x59f847[_0x997d('0x34')]=qs['sort'](_0xfef41c[_0x997d('0x2c')][_0x997d('0x35')]);_0x59f847['where']=qs[_0x997d('0x36')](_['pick'](_0xfef41c['query'],_0x3ad586[_0x997d('0x36')]),_0x47feb9);if(_0xfef41c[_0x997d('0x2c')][_0x997d('0x37')]){_0x59f847['where']=_['merge'](_0x59f847[_0x997d('0x38')],{'$or':_[_0x997d('0x39')](_0x47feb9,function(_0x244bc0){if(_0x244bc0[_0x997d('0x29')]!=='VIRTUAL'){var _0x13ce45={};_0x13ce45[_0x244bc0[_0x997d('0x2b')]]={'$like':'%'+_0xfef41c[_0x997d('0x2c')][_0x997d('0x37')]+'%'};return _0x13ce45;}})});}_0x59f847=_[_0x997d('0x3a')]({},_0x59f847,_0xfef41c[_0x997d('0x3b')]);var _0x389247={'where':_0x59f847[_0x997d('0x38')]};return db[_0x997d('0x27')]['count'](_0x389247)[_0x997d('0x22')](function(_0x4133f0){_0x3719f4[_0x997d('0x1c')]=_0x4133f0;if(_0xfef41c[_0x997d('0x2c')][_0x997d('0x3c')]){_0x59f847[_0x997d('0x3d')]=[{'all':!![]}];}return db[_0x997d('0x27')]['findAll'](_0x59f847);})[_0x997d('0x22')](function(_0x4c9055){_0x3719f4[_0x997d('0x3e')]=_0x4c9055;return _0x3719f4;})[_0x997d('0x22')](respondWithFilteredResult(_0x2a0b3a,_0x59f847))['catch'](handleError(_0x2a0b3a,null));};exports[_0x997d('0x3f')]=function(_0x261fc1,_0x241ae0){var _0x2a78fd={'raw':!![],'where':{'id':_0x261fc1['params']['id']}},_0x4bd455={};_0x4bd455[_0x997d('0x2e')]=_[_0x997d('0x2d')](db['SquareReport'][_0x997d('0x28')]);_0x4bd455[_0x997d('0x2c')]=_[_0x997d('0x2d')](_0x261fc1[_0x997d('0x2c')]);_0x4bd455[_0x997d('0x36')]=_[_0x997d('0x30')](_0x4bd455[_0x997d('0x2e')],_0x4bd455[_0x997d('0x2c')]);_0x2a78fd['attributes']=_[_0x997d('0x30')](_0x4bd455[_0x997d('0x2e')],qs['fields'](_0x261fc1[_0x997d('0x2c')]['fields']));_0x2a78fd[_0x997d('0x2f')]=_0x2a78fd[_0x997d('0x2f')][_0x997d('0x32')]?_0x2a78fd['attributes']:_0x4bd455['model'];if(_0x261fc1['query'][_0x997d('0x3c')]){_0x2a78fd[_0x997d('0x3d')]=[{'all':!![]}];}_0x2a78fd=_[_0x997d('0x3a')]({},_0x2a78fd,_0x261fc1[_0x997d('0x3b')]);return db[_0x997d('0x27')][_0x997d('0x40')](_0x2a78fd)[_0x997d('0x22')](handleEntityNotFound(_0x241ae0,null))[_0x997d('0x22')](respondWithResult(_0x241ae0,null))[_0x997d('0x41')](handleError(_0x241ae0,null));};exports[_0x997d('0x42')]=function(_0x5e7c4a,_0x218ba9){return db[_0x997d('0x27')][_0x997d('0x42')](_0x5e7c4a[_0x997d('0x43')],{})[_0x997d('0x22')](respondWithResult(_0x218ba9,0xc9))[_0x997d('0x41')](handleError(_0x218ba9,null));};exports[_0x997d('0x21')]=function(_0x1d3e3a,_0x148ccb){if(_0x1d3e3a[_0x997d('0x43')]['id']){delete _0x1d3e3a[_0x997d('0x43')]['id'];}return db[_0x997d('0x27')][_0x997d('0x40')]({'where':{'id':_0x1d3e3a[_0x997d('0x44')]['id']}})[_0x997d('0x22')](handleEntityNotFound(_0x148ccb,null))['then'](saveUpdates(_0x1d3e3a['body'],null))[_0x997d('0x22')](respondWithResult(_0x148ccb,null))['catch'](handleError(_0x148ccb,null));};exports[_0x997d('0x23')]=function(_0x4c7f92,_0x1df136){return db[_0x997d('0x27')]['find']({'where':{'id':_0x4c7f92[_0x997d('0x44')]['id']}})[_0x997d('0x22')](handleEntityNotFound(_0x1df136,null))[_0x997d('0x22')](removeEntity(_0x1df136,null))[_0x997d('0x41')](handleError(_0x1df136,null));};exports['describe']=function(_0x575ba8,_0x58d4b1){return db[_0x997d('0x27')]['describe']()[_0x997d('0x22')](respondWithResult(_0x58d4b1,null))[_0x997d('0x41')](handleError(_0x58d4b1,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index c6edd4d..e6761c0 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 _0x0aed=['uniqueid','project_name','leaveAt','util','../../config/logger','api','bluebird','request-promise','path','./squareReport.attributes','exports','SquareReport'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x0aed,0x1cb));var _0xd0ae=function(_0x404f13,_0x4fa35f){_0x404f13=_0x404f13-0x0;var _0x1f9dbb=_0x0aed[_0x404f13];return _0x1f9dbb;};'use strict';var _=require('lodash');var util=require(_0xd0ae('0x0'));var logger=require(_0xd0ae('0x1'))(_0xd0ae('0x2'));var moment=require('moment');var BPromise=require(_0xd0ae('0x3'));var rp=require(_0xd0ae('0x4'));var fs=require('fs');var path=require(_0xd0ae('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd0ae('0x6'));module[_0xd0ae('0x7')]=function(_0x374276,_0x173b68){return _0x374276['define'](_0xd0ae('0x8'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xd0ae('0x9'),_0xd0ae('0xa')]},{'name':_0xd0ae('0xb'),'fields':[_0xd0ae('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa95b=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt'];(function(_0x246b46,_0x306ec8){var _0x4280a4=function(_0x509beb){while(--_0x509beb){_0x246b46['push'](_0x246b46['shift']());}};_0x4280a4(++_0x306ec8);}(_0xa95b,0x10e));var _0xba95=function(_0x30a8c2,_0x2f4d46){_0x30a8c2=_0x30a8c2-0x0;var _0x5b891f=_0xa95b[_0x30a8c2];return _0x5b891f;};'use strict';var _=require(_0xba95('0x0'));var util=require(_0xba95('0x1'));var logger=require(_0xba95('0x2'))(_0xba95('0x3'));var moment=require(_0xba95('0x4'));var BPromise=require(_0xba95('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba95('0x6'));var rimraf=require(_0xba95('0x7'));var config=require(_0xba95('0x8'));var attributes=require(_0xba95('0x9'));module[_0xba95('0xa')]=function(_0x164d85,_0x1c3756){return _0x164d85[_0xba95('0xb')](_0xba95('0xc'),attributes,{'tableName':_0xba95('0xd'),'paranoid':![],'indexes':[{'name':_0xba95('0xe'),'fields':[_0xba95('0xf'),_0xba95('0x10')]},{'name':_0xba95('0x11'),'fields':[_0xba95('0x11')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 032ee5d..dc0a558 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 _0xb9e5=['../../config/environment','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareReport','create','body','options','SquareReport','raw','where','attributes','limit','UpdateSquareReport','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xdcb46f,_0x8f628e){var _0x1382d8=function(_0x381441){while(--_0x381441){_0xdcb46f['push'](_0xdcb46f['shift']());}};_0x1382d8(++_0x8f628e);}(_0xb9e5,0xb9));var _0x5b9e=function(_0x4f768a,_0x413685){_0x4f768a=_0x4f768a-0x0;var _0x4ab541=_0xb9e5[_0x4f768a];return _0x4ab541;};'use strict';var _=require('lodash');var util=require(_0x5b9e('0x0'));var moment=require('moment');var BPromise=require(_0x5b9e('0x1'));var rs=require(_0x5b9e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b9e('0x3'))['db'];var utils=require(_0x5b9e('0x4'));var logger=require(_0x5b9e('0x5'))(_0x5b9e('0x6'));var config=require(_0x5b9e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5b9e('0x8')][_0x5b9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c3206,_0x1d19db,_0x4deeae){return new BPromise(function(_0x3472e5,_0x28d4a8){return client[_0x5b9e('0xa')](_0x3c3206,_0x4deeae)[_0x5b9e('0xb')](function(_0x2f3763){logger[_0x5b9e('0xc')](_0x5b9e('0xd'),_0x1d19db,_0x5b9e('0xe'));logger[_0x5b9e('0xf')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x1d19db,_0x5b9e('0xe'),JSON[_0x5b9e('0x10')](_0x2f3763));if(_0x2f3763[_0x5b9e('0x11')]){if(_0x2f3763[_0x5b9e('0x11')][_0x5b9e('0x12')]===0x1f4){logger[_0x5b9e('0x11')](_0x5b9e('0xd'),_0x1d19db,_0x2f3763[_0x5b9e('0x11')][_0x5b9e('0x13')]);return _0x28d4a8(_0x2f3763[_0x5b9e('0x11')]['message']);}logger['error'](_0x5b9e('0xd'),_0x1d19db,_0x2f3763['error'][_0x5b9e('0x13')]);return _0x3472e5(_0x2f3763[_0x5b9e('0x11')]['message']);}else{logger[_0x5b9e('0xc')](_0x5b9e('0xd'),_0x1d19db,_0x5b9e('0xe'));_0x3472e5(_0x2f3763[_0x5b9e('0x14')]['message']);}})[_0x5b9e('0x15')](function(_0x3c664c){logger[_0x5b9e('0x11')](_0x5b9e('0xd'),_0x1d19db,_0x3c664c);_0x28d4a8(_0x3c664c);});});}exports[_0x5b9e('0x16')]=function(_0x2ddb31){var _0xf92776=this;return new Promise(function(_0x11d280,_0x5b5030){return db['SquareReport'][_0x5b9e('0x17')](_0x2ddb31[_0x5b9e('0x18')],{'raw':_0x2ddb31[_0x5b9e('0x19')]?_0x2ddb31[_0x5b9e('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x405e02){logger[_0x5b9e('0xc')](_0x5b9e('0x16'),_0x2ddb31);logger['debug'](_0x5b9e('0x16'),_0x2ddb31,JSON[_0x5b9e('0x10')](_0x405e02));_0x11d280(_0x405e02);})[_0x5b9e('0x15')](function(_0x5eb68e){logger['error']('CreateSquareReport',_0x5eb68e[_0x5b9e('0x13')],_0x2ddb31);_0x5b5030(_0xf92776[_0x5b9e('0x11')](0x1f4,_0x5eb68e[_0x5b9e('0x13')]));});});};exports['UpdateSquareReport']=function(_0x4cdffb){var _0x2601e4=this;return new Promise(function(_0x461ab4,_0x58d7c4){return db[_0x5b9e('0x1a')]['update'](_0x4cdffb['body'],{'raw':_0x4cdffb[_0x5b9e('0x19')]?_0x4cdffb[_0x5b9e('0x19')][_0x5b9e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cdffb[_0x5b9e('0x19')]?_0x4cdffb['options'][_0x5b9e('0x1c')]||null:null,'attributes':_0x4cdffb[_0x5b9e('0x19')]?_0x4cdffb[_0x5b9e('0x19')][_0x5b9e('0x1d')]||null:null,'limit':_0x4cdffb[_0x5b9e('0x19')]?_0x4cdffb[_0x5b9e('0x19')][_0x5b9e('0x1e')]||null:null})[_0x5b9e('0xb')](function(_0x59d20a){logger['info'](_0x5b9e('0x1f'),_0x4cdffb);logger['debug']('UpdateSquareReport',_0x4cdffb,JSON[_0x5b9e('0x10')](_0x59d20a));_0x461ab4(_0x59d20a);})['catch'](function(_0xee266b){logger[_0x5b9e('0x11')](_0x5b9e('0x1f'),_0xee266b['message'],_0x4cdffb);_0x58d7c4(_0x2601e4[_0x5b9e('0x11')](0x1f4,_0xee266b[_0x5b9e('0x13')]));});});}; \ No newline at end of file +var _0x9bbf=['SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareReport','create','body','raw','SquareReport','update','options','where','attributes','limit','UpdateSquareReport','moment','randomstring','ioredis','rpc','../../config/environment','client','http','request','then','info'];(function(_0x4c8bce,_0x1814b2){var _0x267dc6=function(_0x2bace9){while(--_0x2bace9){_0x4c8bce['push'](_0x4c8bce['shift']());}};_0x267dc6(++_0x1814b2);}(_0x9bbf,0xde));var _0xf9bb=function(_0x206c55,_0x103b17){_0x206c55=_0x206c55-0x0;var _0x33cf66=_0x9bbf[_0x206c55];return _0x33cf66;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf9bb('0x0'));var BPromise=require('bluebird');var rs=require(_0xf9bb('0x1'));var fs=require('fs');var Redis=require(_0xf9bb('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf9bb('0x3'));var config=require(_0xf9bb('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xf9bb('0x5')][_0xf9bb('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5ba0c3,_0x570e43,_0x22da77){return new BPromise(function(_0x42850b,_0x554468){return client[_0xf9bb('0x7')](_0x5ba0c3,_0x22da77)[_0xf9bb('0x8')](function(_0x1036d1){logger[_0xf9bb('0x9')](_0xf9bb('0xa'),_0x570e43,_0xf9bb('0xb'));logger[_0xf9bb('0xc')](_0xf9bb('0xd'),_0x570e43,_0xf9bb('0xb'),JSON[_0xf9bb('0xe')](_0x1036d1));if(_0x1036d1['error']){if(_0x1036d1['error']['code']===0x1f4){logger[_0xf9bb('0xf')](_0xf9bb('0xa'),_0x570e43,_0x1036d1['error'][_0xf9bb('0x10')]);return _0x554468(_0x1036d1[_0xf9bb('0xf')][_0xf9bb('0x10')]);}logger[_0xf9bb('0xf')](_0xf9bb('0xa'),_0x570e43,_0x1036d1[_0xf9bb('0xf')][_0xf9bb('0x10')]);return _0x42850b(_0x1036d1[_0xf9bb('0xf')]['message']);}else{logger['info'](_0xf9bb('0xa'),_0x570e43,'request\x20sent');_0x42850b(_0x1036d1['result'][_0xf9bb('0x10')]);}})[_0xf9bb('0x11')](function(_0x4961ed){logger[_0xf9bb('0xf')](_0xf9bb('0xa'),_0x570e43,_0x4961ed);_0x554468(_0x4961ed);});});}exports[_0xf9bb('0x12')]=function(_0x51bc8a){var _0x298db2=this;return new Promise(function(_0x333ebc,_0x30888f){return db['SquareReport'][_0xf9bb('0x13')](_0x51bc8a[_0xf9bb('0x14')],{'raw':_0x51bc8a['options']?_0x51bc8a['options'][_0xf9bb('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x3fbf27){logger[_0xf9bb('0x9')](_0xf9bb('0x12'),_0x51bc8a);logger[_0xf9bb('0xc')](_0xf9bb('0x12'),_0x51bc8a,JSON[_0xf9bb('0xe')](_0x3fbf27));_0x333ebc(_0x3fbf27);})[_0xf9bb('0x11')](function(_0x1db4bf){logger[_0xf9bb('0xf')](_0xf9bb('0x12'),_0x1db4bf[_0xf9bb('0x10')],_0x51bc8a);_0x30888f(_0x298db2[_0xf9bb('0xf')](0x1f4,_0x1db4bf[_0xf9bb('0x10')]));});});};exports['UpdateSquareReport']=function(_0x2eb1ef){var _0x4e056e=this;return new Promise(function(_0xef32ac,_0x2617f6){return db[_0xf9bb('0x16')][_0xf9bb('0x17')](_0x2eb1ef[_0xf9bb('0x14')],{'raw':_0x2eb1ef[_0xf9bb('0x18')]?_0x2eb1ef[_0xf9bb('0x18')][_0xf9bb('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2eb1ef['options']?_0x2eb1ef[_0xf9bb('0x18')][_0xf9bb('0x19')]||null:null,'attributes':_0x2eb1ef[_0xf9bb('0x18')]?_0x2eb1ef[_0xf9bb('0x18')][_0xf9bb('0x1a')]||null:null,'limit':_0x2eb1ef[_0xf9bb('0x18')]?_0x2eb1ef[_0xf9bb('0x18')][_0xf9bb('0x1b')]||null:null})[_0xf9bb('0x8')](function(_0x524e30){logger['info'](_0xf9bb('0x1c'),_0x2eb1ef);logger[_0xf9bb('0xc')]('UpdateSquareReport',_0x2eb1ef,JSON['stringify'](_0x524e30));_0xef32ac(_0x524e30);})[_0xf9bb('0x11')](function(_0x5b34b9){logger[_0xf9bb('0xf')](_0xf9bb('0x1c'),_0x5b34b9[_0xf9bb('0x10')],_0x2eb1ef);_0x2617f6(_0x4e056e['error'](0x1f4,_0x5b34b9[_0xf9bb('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index a69f34c..726497c 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 _0x73af=['../../config/environment','./squareReportDetail.controller','get','index','/describe','describe','isAuthenticated','post','create','/:id','update','delete','destroy','util','path','connect-timeout','../../components/auth/service'];(function(_0x3bf1c9,_0x1d2aa1){var _0x4022ed=function(_0x1b7e27){while(--_0x1b7e27){_0x3bf1c9['push'](_0x3bf1c9['shift']());}};_0x4022ed(++_0x1d2aa1);}(_0x73af,0x1c7));var _0xf73a=function(_0x4c5a24,_0x5ef60c){_0x4c5a24=_0x4c5a24-0x0;var _0x4b067e=_0x73af[_0x4c5a24];return _0x4b067e;};'use strict';var multer=require('multer');var util=require(_0xf73a('0x0'));var path=require(_0xf73a('0x1'));var timeout=require(_0xf73a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf73a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf73a('0x4'));var controller=require(_0xf73a('0x5'));router[_0xf73a('0x6')]('/',auth['isAuthenticated'](),controller[_0xf73a('0x7')]);router[_0xf73a('0x6')](_0xf73a('0x8'),auth['isAuthenticated'](),controller[_0xf73a('0x9')]);router[_0xf73a('0x6')]('/:id',auth[_0xf73a('0xa')](),controller['show']);router[_0xf73a('0xb')]('/',auth[_0xf73a('0xa')](),controller[_0xf73a('0xc')]);router['put'](_0xf73a('0xd'),auth[_0xf73a('0xa')](),controller[_0xf73a('0xe')]);router[_0xf73a('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf73a('0x10')]);module['exports']=router; \ No newline at end of file +var _0x32d3=['delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put'];(function(_0x42f092,_0x53a12d){var _0x5e2af9=function(_0x1c27e3){while(--_0x1c27e3){_0x42f092['push'](_0x42f092['shift']());}};_0x5e2af9(++_0x53a12d);}(_0x32d3,0x1e9));var _0x332d=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x32d3[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x332d('0x0'));var util=require('util');var path=require(_0x332d('0x1'));var timeout=require('connect-timeout');var express=require(_0x332d('0x2'));var router=express[_0x332d('0x3')]();var fs_extra=require(_0x332d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x332d('0x5'));var config=require(_0x332d('0x6'));var controller=require('./squareReportDetail.controller');router[_0x332d('0x7')]('/',auth['isAuthenticated'](),controller[_0x332d('0x8')]);router[_0x332d('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x332d('0x7')](_0x332d('0x9'),auth[_0x332d('0xa')](),controller[_0x332d('0xb')]);router[_0x332d('0xc')]('/',auth['isAuthenticated'](),controller[_0x332d('0xd')]);router[_0x332d('0xe')]('/:id',auth[_0x332d('0xa')](),controller['update']);router[_0x332d('0xf')](_0x332d('0x9'),auth[_0x332d('0xa')](),controller[_0x332d('0x10')]);module[_0x332d('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 3d50848..9e66682 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 _0xb381=['sequelize','exports','STRING','TEXT'];(function(_0x221131,_0x15f78e){var _0x2eabb2=function(_0x20ef5e){while(--_0x20ef5e){_0x221131['push'](_0x221131['shift']());}};_0x2eabb2(++_0x15f78e);}(_0xb381,0x1d8));var _0x1b38=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0xb381[_0xaa6a4];return _0xdc31a4;};'use strict';var Sequelize=require(_0x1b38('0x0'));module[_0x1b38('0x1')]={'uniqueid':{'type':Sequelize[_0x1b38('0x2')]},'node':{'type':Sequelize[_0x1b38('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x1b38('0x3')]},'project_name':{'type':Sequelize[_0x1b38('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3211=['exports','STRING','TEXT','sequelize'];(function(_0x3545c2,_0xf76ec){var _0xb7fb16=function(_0x3d9bb4){while(--_0x3d9bb4){_0x3545c2['push'](_0x3545c2['shift']());}};_0xb7fb16(++_0xf76ec);}(_0x3211,0x107));var _0x1321=function(_0x1f0b3b,_0xc56231){_0x1f0b3b=_0x1f0b3b-0x0;var _0x4f889a=_0x3211[_0x1f0b3b];return _0x4f889a;};'use strict';var Sequelize=require(_0x1321('0x0'));module[_0x1321('0x1')]={'uniqueid':{'type':Sequelize[_0x1321('0x2')]},'node':{'type':Sequelize[_0x1321('0x2')]},'application':{'type':Sequelize[_0x1321('0x2')]},'data':{'type':Sequelize[_0x1321('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x1321('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 9e01d56..d9e5929 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 _0x40e0=['../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','map','SquareDetailsReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','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'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x40e0,0x1b9));var _0x040e=function(_0x3931c5,_0x386e97){_0x3931c5=_0x3931c5-0x0;var _0x48c5be=_0x40e0[_0x3931c5];return _0x48c5be;};'use strict';var emlformat=require(_0x040e('0x0'));var rimraf=require(_0x040e('0x1'));var zipdir=require(_0x040e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x040e('0x3'));var moment=require(_0x040e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x040e('0x5'));var util=require('util');var path=require(_0x040e('0x6'));var sox=require(_0x040e('0x7'));var csv=require(_0x040e('0x8'));var ejs=require(_0x040e('0x9'));var fs=require('fs');var fs_extra=require(_0x040e('0xa'));var _=require(_0x040e('0xb'));var squel=require(_0x040e('0xc'));var crypto=require(_0x040e('0xd'));var jsforce=require(_0x040e('0xe'));var deskjs=require(_0x040e('0xf'));var toCsv=require(_0x040e('0x8'));var querystring=require('querystring');var Papa=require(_0x040e('0x10'));var Redis=require(_0x040e('0x11'));var authService=require(_0x040e('0x12'));var qs=require(_0x040e('0x13'));var as=require(_0x040e('0x14'));var hardwareService=require(_0x040e('0x15'));var logger=require(_0x040e('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x040e('0x17'));var licenseUtil=require(_0x040e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47cd5b,_0x5b532e){_0x5b532e=_0x5b532e||0xcc;return function(_0x1bb922){if(_0x1bb922){return _0x47cd5b[_0x040e('0x19')](_0x5b532e);}return _0x47cd5b[_0x040e('0x1a')](_0x5b532e)[_0x040e('0x1b')]();};}function respondWithResult(_0x57580d,_0x5973e7){_0x5973e7=_0x5973e7||0xc8;return function(_0x5a7528){if(_0x5a7528){return _0x57580d['status'](_0x5973e7)[_0x040e('0x1c')](_0x5a7528);}};}function respondWithFilteredResult(_0x2ede9b,_0x4e9074){return function(_0x141d40){if(_0x141d40){var _0x4c973c=typeof _0x4e9074['offset']==='undefined'&&typeof _0x4e9074['limit']===_0x040e('0x1d');var _0x40da3a=_0x141d40[_0x040e('0x1e')];var _0x16c847=_0x4c973c?0x0:_0x4e9074['offset'];var _0x201a80=_0x4c973c?_0x141d40[_0x040e('0x1e')]:_0x4e9074[_0x040e('0x1f')]+_0x4e9074[_0x040e('0x20')];var _0x289148;if(_0x201a80>=_0x40da3a){_0x201a80=_0x40da3a;_0x289148=0xc8;}else{_0x289148=0xce;}_0x2ede9b[_0x040e('0x1a')](_0x289148);return _0x2ede9b[_0x040e('0x21')](_0x040e('0x22'),_0x16c847+'-'+_0x201a80+'/'+_0x40da3a)[_0x040e('0x1c')](_0x141d40);}return null;};}function patchUpdates(_0x1b992f){return function(_0x345777){try{jsonpatch[_0x040e('0x23')](_0x345777,_0x1b992f,!![]);}catch(_0x50f6e8){return BPromise[_0x040e('0x24')](_0x50f6e8);}return _0x345777[_0x040e('0x25')]();};}function saveUpdates(_0x280aa1,_0x3587f9){return function(_0x269346){if(_0x269346){return _0x269346[_0x040e('0x26')](_0x280aa1)[_0x040e('0x27')](function(_0xb5d1c4){return _0xb5d1c4;});}return null;};}function removeEntity(_0x403218,_0x164638){return function(_0x3a96c0){if(_0x3a96c0){return _0x3a96c0['destroy']()[_0x040e('0x27')](function(){_0x403218['status'](0xcc)[_0x040e('0x1b')]();});}};}function handleEntityNotFound(_0x3132d9,_0xd5c4a9){return function(_0x516d85){if(!_0x516d85){_0x3132d9[_0x040e('0x19')](0x194);}return _0x516d85;};}function handleError(_0x42ced3,_0x2cebaa){_0x2cebaa=_0x2cebaa||0x1f4;return function(_0x7848f8){logger[_0x040e('0x28')](_0x7848f8['stack']);if(_0x7848f8['name']){delete _0x7848f8[_0x040e('0x29')];}_0x42ced3['status'](_0x2cebaa)[_0x040e('0x2a')](_0x7848f8);};}exports['index']=function(_0x1fe2c4,_0x4db6e2){var _0x4c3658={},_0x5a6173={},_0x1b3566={'count':0x0,'rows':[]};var _0x52d5d5=_[_0x040e('0x2b')](db[_0x040e('0x2c')][_0x040e('0x2d')],function(_0x1c5fb5){return{'name':_0x1c5fb5['fieldName'],'type':_0x1c5fb5[_0x040e('0x2e')][_0x040e('0x2f')]};});_0x5a6173[_0x040e('0x30')]=_['map'](_0x52d5d5,_0x040e('0x29'));_0x5a6173[_0x040e('0x31')]=_[_0x040e('0x32')](_0x1fe2c4[_0x040e('0x31')]);_0x5a6173[_0x040e('0x33')]=_[_0x040e('0x34')](_0x5a6173[_0x040e('0x30')],_0x5a6173['query']);_0x4c3658[_0x040e('0x35')]=_[_0x040e('0x34')](_0x5a6173[_0x040e('0x30')],qs[_0x040e('0x36')](_0x1fe2c4[_0x040e('0x31')]['fields']));_0x4c3658['attributes']=_0x4c3658['attributes'][_0x040e('0x37')]?_0x4c3658['attributes']:_0x5a6173[_0x040e('0x30')];if(!_0x1fe2c4[_0x040e('0x31')][_0x040e('0x38')](_0x040e('0x39'))){_0x4c3658[_0x040e('0x20')]=qs[_0x040e('0x20')](_0x1fe2c4[_0x040e('0x31')][_0x040e('0x20')]);_0x4c3658[_0x040e('0x1f')]=qs[_0x040e('0x1f')](_0x1fe2c4[_0x040e('0x31')][_0x040e('0x1f')]);}_0x4c3658[_0x040e('0x3a')]=qs[_0x040e('0x3b')](_0x1fe2c4[_0x040e('0x31')][_0x040e('0x3b')]);_0x4c3658[_0x040e('0x3c')]=qs[_0x040e('0x33')](_[_0x040e('0x3d')](_0x1fe2c4[_0x040e('0x31')],_0x5a6173[_0x040e('0x33')]),_0x52d5d5);if(_0x1fe2c4[_0x040e('0x31')][_0x040e('0x3e')]){_0x4c3658[_0x040e('0x3c')]=_[_0x040e('0x3f')](_0x4c3658[_0x040e('0x3c')],{'$or':_[_0x040e('0x2b')](_0x52d5d5,function(_0x59ba47){if(_0x59ba47['type']!==_0x040e('0x40')){var _0x429aa5={};_0x429aa5[_0x59ba47['name']]={'$like':'%'+_0x1fe2c4[_0x040e('0x31')]['filter']+'%'};return _0x429aa5;}})});}_0x4c3658=_[_0x040e('0x3f')]({},_0x4c3658,_0x1fe2c4[_0x040e('0x41')]);var _0x2362d9={'where':_0x4c3658[_0x040e('0x3c')]};return db[_0x040e('0x2c')][_0x040e('0x1e')](_0x2362d9)['then'](function(_0x346a8e){_0x1b3566[_0x040e('0x1e')]=_0x346a8e;if(_0x1fe2c4[_0x040e('0x31')][_0x040e('0x42')]){_0x4c3658[_0x040e('0x43')]=[{'all':!![]}];}return db[_0x040e('0x2c')]['findAll'](_0x4c3658);})[_0x040e('0x27')](function(_0x4be0ec){_0x1b3566[_0x040e('0x44')]=_0x4be0ec;return _0x1b3566;})[_0x040e('0x27')](respondWithFilteredResult(_0x4db6e2,_0x4c3658))[_0x040e('0x45')](handleError(_0x4db6e2,null));};exports[_0x040e('0x46')]=function(_0x46bbef,_0x5d5ee7){var _0x43b548={'raw':!![],'where':{'id':_0x46bbef[_0x040e('0x47')]['id']}},_0x53a542={};_0x53a542[_0x040e('0x30')]=_[_0x040e('0x32')](db[_0x040e('0x2c')][_0x040e('0x2d')]);_0x53a542['query']=_[_0x040e('0x32')](_0x46bbef['query']);_0x53a542[_0x040e('0x33')]=_['intersection'](_0x53a542['model'],_0x53a542[_0x040e('0x31')]);_0x43b548['attributes']=_[_0x040e('0x34')](_0x53a542['model'],qs[_0x040e('0x36')](_0x46bbef[_0x040e('0x31')][_0x040e('0x36')]));_0x43b548[_0x040e('0x35')]=_0x43b548['attributes']['length']?_0x43b548[_0x040e('0x35')]:_0x53a542[_0x040e('0x30')];if(_0x46bbef['query'][_0x040e('0x42')]){_0x43b548['include']=[{'all':!![]}];}_0x43b548=_[_0x040e('0x3f')]({},_0x43b548,_0x46bbef[_0x040e('0x41')]);return db['SquareDetailsReport'][_0x040e('0x48')](_0x43b548)['then'](handleEntityNotFound(_0x5d5ee7,null))[_0x040e('0x27')](respondWithResult(_0x5d5ee7,null))[_0x040e('0x45')](handleError(_0x5d5ee7,null));};exports[_0x040e('0x49')]=function(_0x380952,_0x4f2b78){return db[_0x040e('0x2c')][_0x040e('0x49')](_0x380952['body'],{})['then'](respondWithResult(_0x4f2b78,0xc9))['catch'](handleError(_0x4f2b78,null));};exports[_0x040e('0x26')]=function(_0x3b8e99,_0x3aa94b){if(_0x3b8e99['body']['id']){delete _0x3b8e99[_0x040e('0x4a')]['id'];}return db[_0x040e('0x2c')][_0x040e('0x48')]({'where':{'id':_0x3b8e99[_0x040e('0x47')]['id']}})[_0x040e('0x27')](handleEntityNotFound(_0x3aa94b,null))['then'](saveUpdates(_0x3b8e99[_0x040e('0x4a')],null))[_0x040e('0x27')](respondWithResult(_0x3aa94b,null))['catch'](handleError(_0x3aa94b,null));};exports[_0x040e('0x4b')]=function(_0x298c9d,_0x2be3cf){return db[_0x040e('0x2c')][_0x040e('0x48')]({'where':{'id':_0x298c9d['params']['id']}})[_0x040e('0x27')](handleEntityNotFound(_0x2be3cf,null))[_0x040e('0x27')](removeEntity(_0x2be3cf,null))[_0x040e('0x45')](handleError(_0x2be3cf,null));};exports[_0x040e('0x4c')]=function(_0x1816f4,_0x33a18e){return db[_0x040e('0x2c')]['describe']()[_0x040e('0x27')](respondWithResult(_0x33a18e,null))[_0x040e('0x45')](handleError(_0x33a18e,null));}; \ No newline at end of file +var _0x091c=['attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','VIRTUAL','options','includeAll','include','show','params','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x5b8464,_0x45c75e){var _0x3b49fe=function(_0xbc742a){while(--_0xbc742a){_0x5b8464['push'](_0x5b8464['shift']());}};_0x3b49fe(++_0x45c75e);}(_0x091c,0x181));var _0xc091=function(_0x111d00,_0x2049d5){_0x111d00=_0x111d00-0x0;var _0x1016e4=_0x091c[_0x111d00];return _0x1016e4;};'use strict';var emlformat=require(_0xc091('0x0'));var rimraf=require(_0xc091('0x1'));var zipdir=require(_0xc091('0x2'));var jsonpatch=require(_0xc091('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc091('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc091('0x5'));var ejs=require(_0xc091('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc091('0x7'));var squel=require(_0xc091('0x8'));var crypto=require(_0xc091('0x9'));var jsforce=require(_0xc091('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xc091('0x5'));var querystring=require('querystring');var Papa=require(_0xc091('0xb'));var Redis=require(_0xc091('0xc'));var authService=require(_0xc091('0xd'));var qs=require(_0xc091('0xe'));var as=require(_0xc091('0xf'));var hardwareService=require(_0xc091('0x10'));var logger=require(_0xc091('0x11'))(_0xc091('0x12'));var utils=require('../../config/utils');var config=require(_0xc091('0x13'));var licenseUtil=require(_0xc091('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ed6fc,_0x47e7ef){_0x47e7ef=_0x47e7ef||0xcc;return function(_0x2a963c){if(_0x2a963c){return _0x5ed6fc[_0xc091('0x15')](_0x47e7ef);}return _0x5ed6fc['status'](_0x47e7ef)[_0xc091('0x16')]();};}function respondWithResult(_0x21dc24,_0x3e93b5){_0x3e93b5=_0x3e93b5||0xc8;return function(_0x40ed58){if(_0x40ed58){return _0x21dc24[_0xc091('0x17')](_0x3e93b5)[_0xc091('0x18')](_0x40ed58);}};}function respondWithFilteredResult(_0x1088e4,_0x427f36){return function(_0x5d9440){if(_0x5d9440){var _0x1a88f1=typeof _0x427f36[_0xc091('0x19')]===_0xc091('0x1a')&&typeof _0x427f36['limit']==='undefined';var _0x5083f4=_0x5d9440['count'];var _0x4c5dd0=_0x1a88f1?0x0:_0x427f36[_0xc091('0x19')];var _0x5cdddd=_0x1a88f1?_0x5d9440[_0xc091('0x1b')]:_0x427f36[_0xc091('0x19')]+_0x427f36[_0xc091('0x1c')];var _0x406642;if(_0x5cdddd>=_0x5083f4){_0x5cdddd=_0x5083f4;_0x406642=0xc8;}else{_0x406642=0xce;}_0x1088e4['status'](_0x406642);return _0x1088e4[_0xc091('0x1d')](_0xc091('0x1e'),_0x4c5dd0+'-'+_0x5cdddd+'/'+_0x5083f4)['json'](_0x5d9440);}return null;};}function patchUpdates(_0x4b2633){return function(_0x30be71){try{jsonpatch[_0xc091('0x1f')](_0x30be71,_0x4b2633,!![]);}catch(_0xec69f0){return BPromise[_0xc091('0x20')](_0xec69f0);}return _0x30be71[_0xc091('0x21')]();};}function saveUpdates(_0x468b48,_0x2320ee){return function(_0x2ef0ad){if(_0x2ef0ad){return _0x2ef0ad['update'](_0x468b48)[_0xc091('0x22')](function(_0x2b4f50){return _0x2b4f50;});}return null;};}function removeEntity(_0x480057,_0x331a6a){return function(_0x15ff27){if(_0x15ff27){return _0x15ff27[_0xc091('0x23')]()[_0xc091('0x22')](function(){_0x480057[_0xc091('0x17')](0xcc)[_0xc091('0x16')]();});}};}function handleEntityNotFound(_0x1e1a7a,_0x5c39ee){return function(_0x538e69){if(!_0x538e69){_0x1e1a7a[_0xc091('0x15')](0x194);}return _0x538e69;};}function handleError(_0x7bbbf9,_0x36d3b2){_0x36d3b2=_0x36d3b2||0x1f4;return function(_0x20b66e){logger['error'](_0x20b66e[_0xc091('0x24')]);if(_0x20b66e[_0xc091('0x25')]){delete _0x20b66e['name'];}_0x7bbbf9[_0xc091('0x17')](_0x36d3b2)[_0xc091('0x26')](_0x20b66e);};}exports['index']=function(_0x492d06,_0x57df8a){var _0x4bbb7e={},_0x37e9f9={},_0x597891={'count':0x0,'rows':[]};var _0x54cc3a=_['map'](db[_0xc091('0x27')][_0xc091('0x28')],function(_0x224aaf){return{'name':_0x224aaf[_0xc091('0x29')],'type':_0x224aaf[_0xc091('0x2a')][_0xc091('0x2b')]};});_0x37e9f9[_0xc091('0x2c')]=_['map'](_0x54cc3a,_0xc091('0x25'));_0x37e9f9[_0xc091('0x2d')]=_[_0xc091('0x2e')](_0x492d06[_0xc091('0x2d')]);_0x37e9f9['filters']=_['intersection'](_0x37e9f9[_0xc091('0x2c')],_0x37e9f9['query']);_0x4bbb7e[_0xc091('0x2f')]=_[_0xc091('0x30')](_0x37e9f9[_0xc091('0x2c')],qs['fields'](_0x492d06[_0xc091('0x2d')]['fields']));_0x4bbb7e[_0xc091('0x2f')]=_0x4bbb7e[_0xc091('0x2f')][_0xc091('0x31')]?_0x4bbb7e[_0xc091('0x2f')]:_0x37e9f9[_0xc091('0x2c')];if(!_0x492d06['query'][_0xc091('0x32')](_0xc091('0x33'))){_0x4bbb7e[_0xc091('0x1c')]=qs[_0xc091('0x1c')](_0x492d06[_0xc091('0x2d')][_0xc091('0x1c')]);_0x4bbb7e['offset']=qs[_0xc091('0x19')](_0x492d06[_0xc091('0x2d')][_0xc091('0x19')]);}_0x4bbb7e[_0xc091('0x34')]=qs[_0xc091('0x35')](_0x492d06[_0xc091('0x2d')][_0xc091('0x35')]);_0x4bbb7e[_0xc091('0x36')]=qs['filters'](_[_0xc091('0x37')](_0x492d06[_0xc091('0x2d')],_0x37e9f9[_0xc091('0x38')]),_0x54cc3a);if(_0x492d06[_0xc091('0x2d')][_0xc091('0x39')]){_0x4bbb7e[_0xc091('0x36')]=_[_0xc091('0x3a')](_0x4bbb7e['where'],{'$or':_[_0xc091('0x3b')](_0x54cc3a,function(_0x50fcb6){if(_0x50fcb6[_0xc091('0x2a')]!==_0xc091('0x3c')){var _0x308ed7={};_0x308ed7[_0x50fcb6[_0xc091('0x25')]]={'$like':'%'+_0x492d06[_0xc091('0x2d')][_0xc091('0x39')]+'%'};return _0x308ed7;}})});}_0x4bbb7e=_[_0xc091('0x3a')]({},_0x4bbb7e,_0x492d06[_0xc091('0x3d')]);var _0x4bcdc7={'where':_0x4bbb7e[_0xc091('0x36')]};return db[_0xc091('0x27')][_0xc091('0x1b')](_0x4bcdc7)[_0xc091('0x22')](function(_0x2ba33d){_0x597891[_0xc091('0x1b')]=_0x2ba33d;if(_0x492d06[_0xc091('0x2d')][_0xc091('0x3e')]){_0x4bbb7e[_0xc091('0x3f')]=[{'all':!![]}];}return db[_0xc091('0x27')]['findAll'](_0x4bbb7e);})[_0xc091('0x22')](function(_0x1b8acb){_0x597891['rows']=_0x1b8acb;return _0x597891;})[_0xc091('0x22')](respondWithFilteredResult(_0x57df8a,_0x4bbb7e))['catch'](handleError(_0x57df8a,null));};exports[_0xc091('0x40')]=function(_0x2660ac,_0x5e0f24){var _0xaa4846={'raw':!![],'where':{'id':_0x2660ac[_0xc091('0x41')]['id']}},_0x3d3da1={};_0x3d3da1[_0xc091('0x2c')]=_[_0xc091('0x2e')](db[_0xc091('0x27')]['rawAttributes']);_0x3d3da1[_0xc091('0x2d')]=_[_0xc091('0x2e')](_0x2660ac[_0xc091('0x2d')]);_0x3d3da1[_0xc091('0x38')]=_['intersection'](_0x3d3da1[_0xc091('0x2c')],_0x3d3da1['query']);_0xaa4846[_0xc091('0x2f')]=_[_0xc091('0x30')](_0x3d3da1[_0xc091('0x2c')],qs['fields'](_0x2660ac[_0xc091('0x2d')]['fields']));_0xaa4846[_0xc091('0x2f')]=_0xaa4846[_0xc091('0x2f')][_0xc091('0x31')]?_0xaa4846['attributes']:_0x3d3da1[_0xc091('0x2c')];if(_0x2660ac['query']['includeAll']){_0xaa4846[_0xc091('0x3f')]=[{'all':!![]}];}_0xaa4846=_[_0xc091('0x3a')]({},_0xaa4846,_0x2660ac[_0xc091('0x3d')]);return db[_0xc091('0x27')][_0xc091('0x42')](_0xaa4846)[_0xc091('0x22')](handleEntityNotFound(_0x5e0f24,null))[_0xc091('0x22')](respondWithResult(_0x5e0f24,null))[_0xc091('0x43')](handleError(_0x5e0f24,null));};exports[_0xc091('0x44')]=function(_0x3fb977,_0x383d3d){return db[_0xc091('0x27')][_0xc091('0x44')](_0x3fb977[_0xc091('0x45')],{})[_0xc091('0x22')](respondWithResult(_0x383d3d,0xc9))[_0xc091('0x43')](handleError(_0x383d3d,null));};exports[_0xc091('0x46')]=function(_0x3eaeff,_0x30e3a5){if(_0x3eaeff[_0xc091('0x45')]['id']){delete _0x3eaeff[_0xc091('0x45')]['id'];}return db['SquareDetailsReport'][_0xc091('0x42')]({'where':{'id':_0x3eaeff[_0xc091('0x41')]['id']}})[_0xc091('0x22')](handleEntityNotFound(_0x30e3a5,null))[_0xc091('0x22')](saveUpdates(_0x3eaeff[_0xc091('0x45')],null))[_0xc091('0x22')](respondWithResult(_0x30e3a5,null))[_0xc091('0x43')](handleError(_0x30e3a5,null));};exports['destroy']=function(_0x102ae8,_0x83b24c){return db['SquareDetailsReport']['find']({'where':{'id':_0x102ae8['params']['id']}})[_0xc091('0x22')](handleEntityNotFound(_0x83b24c,null))[_0xc091('0x22')](removeEntity(_0x83b24c,null))[_0xc091('0x43')](handleError(_0x83b24c,null));};exports[_0xc091('0x47')]=function(_0x24f929,_0x4bacae){return db[_0xc091('0x27')][_0xc091('0x47')]()[_0xc091('0x22')](respondWithResult(_0x4bacae,null))[_0xc091('0x43')](handleError(_0x4bacae,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 79c4057..98cb3ec 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 _0x6754=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareReportDetail.attributes','exports','report_square_details','lodash'];(function(_0x5c3993,_0x5b9b11){var _0x5144ab=function(_0x477438){while(--_0x477438){_0x5c3993['push'](_0x5c3993['shift']());}};_0x5144ab(++_0x5b9b11);}(_0x6754,0xbf));var _0x4675=function(_0x5ca0c4,_0x35c52f){_0x5ca0c4=_0x5ca0c4-0x0;var _0x7fe0e7=_0x6754[_0x5ca0c4];return _0x7fe0e7;};'use strict';var _=require(_0x4675('0x0'));var util=require(_0x4675('0x1'));var logger=require(_0x4675('0x2'))(_0x4675('0x3'));var moment=require(_0x4675('0x4'));var BPromise=require(_0x4675('0x5'));var rp=require(_0x4675('0x6'));var fs=require('fs');var path=require(_0x4675('0x7'));var rimraf=require(_0x4675('0x8'));var config=require('../../config/environment');var attributes=require(_0x4675('0x9'));module[_0x4675('0xa')]=function(_0x541aeb,_0x51a733){return _0x541aeb['define']('SquareDetailsReport',attributes,{'tableName':_0x4675('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b76=['define','report_square_details','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x5a07dd,_0x188ed0){var _0x50cbe4=function(_0x236db9){while(--_0x236db9){_0x5a07dd['push'](_0x5a07dd['shift']());}};_0x50cbe4(++_0x188ed0);}(_0x7b76,0xca));var _0x67b7=function(_0x3585e2,_0x4cf6fd){_0x3585e2=_0x3585e2-0x0;var _0x115393=_0x7b76[_0x3585e2];return _0x115393;};'use strict';var _=require('lodash');var util=require(_0x67b7('0x0'));var logger=require(_0x67b7('0x1'))('api');var moment=require(_0x67b7('0x2'));var BPromise=require(_0x67b7('0x3'));var rp=require(_0x67b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x67b7('0x5'));var config=require(_0x67b7('0x6'));var attributes=require('./squareReportDetail.attributes');module[_0x67b7('0x7')]=function(_0x1916a5,_0x5ed591){return _0x1916a5[_0x67b7('0x8')]('SquareDetailsReport',attributes,{'tableName':_0x67b7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 955e8e1..3c2bf34 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 _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(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_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 +var _0x94df=['client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x18ec5b,_0x14eb77){var _0x58127e=function(_0x581aa2){while(--_0x581aa2){_0x18ec5b['push'](_0x18ec5b['shift']());}};_0x58127e(++_0x14eb77);}(_0x94df,0xa3));var _0xf94d=function(_0x4b8d8e,_0x479a0a){_0x4b8d8e=_0x4b8d8e-0x0;var _0x2cc0a6=_0x94df[_0x4b8d8e];return _0x2cc0a6;};'use strict';var _=require(_0xf94d('0x0'));var util=require(_0xf94d('0x1'));var moment=require(_0xf94d('0x2'));var BPromise=require(_0xf94d('0x3'));var rs=require(_0xf94d('0x4'));var fs=require('fs');var Redis=require(_0xf94d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf94d('0x6'));var logger=require(_0xf94d('0x7'))(_0xf94d('0x8'));var config=require(_0xf94d('0x9'));var jayson=require(_0xf94d('0xa'));var client=jayson[_0xf94d('0xb')][_0xf94d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18a11a,_0x1ebc19,_0xf285b5){return new BPromise(function(_0x1832e9,_0x504670){return client[_0xf94d('0xd')](_0x18a11a,_0xf285b5)[_0xf94d('0xe')](function(_0x145f5b){logger[_0xf94d('0xf')](_0xf94d('0x10'),_0x1ebc19,_0xf94d('0x11'));logger['debug'](_0xf94d('0x12'),_0x1ebc19,_0xf94d('0x11'),JSON[_0xf94d('0x13')](_0x145f5b));if(_0x145f5b[_0xf94d('0x14')]){if(_0x145f5b[_0xf94d('0x14')]['code']===0x1f4){logger['error'](_0xf94d('0x10'),_0x1ebc19,_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);return _0x504670(_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);}logger[_0xf94d('0x14')]('SquareDetailsReport,\x20%s,\x20%s',_0x1ebc19,_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);return _0x1832e9(_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);}else{logger[_0xf94d('0xf')](_0xf94d('0x10'),_0x1ebc19,_0xf94d('0x11'));_0x1832e9(_0x145f5b[_0xf94d('0x16')]['message']);}})[_0xf94d('0x17')](function(_0x5cd967){logger[_0xf94d('0x14')]('SquareDetailsReport,\x20%s,\x20%s',_0x1ebc19,_0x5cd967);_0x504670(_0x5cd967);});});}exports[_0xf94d('0x18')]=function(_0x559e0c){var _0x30d231=this;return new Promise(function(_0x3bf001,_0x510eef){return db[_0xf94d('0x19')]['create'](_0x559e0c[_0xf94d('0x1a')],{'raw':_0x559e0c['options']?_0x559e0c[_0xf94d('0x1b')][_0xf94d('0x1c')]===undefined?!![]:![]:!![]})[_0xf94d('0xe')](function(_0x2ede5b){logger['info'](_0xf94d('0x18'),_0x559e0c);logger['debug'](_0xf94d('0x18'),_0x559e0c,JSON[_0xf94d('0x13')](_0x2ede5b));_0x3bf001(_0x2ede5b);})[_0xf94d('0x17')](function(_0x56e5f5){logger[_0xf94d('0x14')](_0xf94d('0x18'),_0x56e5f5[_0xf94d('0x15')],_0x559e0c);_0x510eef(_0x30d231[_0xf94d('0x14')](0x1f4,_0x56e5f5[_0xf94d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index faece83..2194983 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 _0xd308=['Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports'];(function(_0x2fe76d,_0x12261b){var _0x170be2=function(_0x137d53){while(--_0x137d53){_0x2fe76d['push'](_0x2fe76d['shift']());}};_0x170be2(++_0x12261b);}(_0xd308,0x120));var _0x8d30=function(_0x5a7f18,_0x4cdfaf){_0x5a7f18=_0x5a7f18-0x0;var _0x46c11e=_0xd308[_0x5a7f18];return _0x46c11e;};'use strict';var express=require('express');var router=express[_0x8d30('0x0')]();var auth=require(_0x8d30('0x1'));var controller=require(_0x8d30('0x2'));router[_0x8d30('0x3')]('/',auth[_0x8d30('0x4')](),controller[_0x8d30('0x5')]);router[_0x8d30('0x3')](_0x8d30('0x6'),auth[_0x8d30('0x4')](),controller[_0x8d30('0x7')]);module[_0x8d30('0x8')]=router; \ No newline at end of file +var _0xcfab=['killProcess','exports','express','Router','../../components/auth/service','get','isAuthenticated','index','/process/:pid/kill'];(function(_0x3465e6,_0x15fcb3){var _0x4f591b=function(_0x2544a2){while(--_0x2544a2){_0x3465e6['push'](_0x3465e6['shift']());}};_0x4f591b(++_0x15fcb3);}(_0xcfab,0x119));var _0xbcfa=function(_0x3a4d88,_0x51b9b1){_0x3a4d88=_0x3a4d88-0x0;var _0x5adb49=_0xcfab[_0x3a4d88];return _0x5adb49;};'use strict';var express=require(_0xbcfa('0x0'));var router=express[_0xbcfa('0x1')]();var auth=require(_0xbcfa('0x2'));var controller=require('./system.controller');router[_0xbcfa('0x3')]('/',auth[_0xbcfa('0x4')](),controller[_0xbcfa('0x5')]);router[_0xbcfa('0x3')](_0xbcfa('0x6'),auth[_0xbcfa('0x4')](),controller[_0xbcfa('0x7')]);module[_0xbcfa('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index f368421..fd2e449 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 _0x1e1d=['format','params','split','indexOf','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','pid','killProcess','systeminformation','child_process','exec','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','then','status','json','catch'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x1e1d,0xa9));var _0xd1e1=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x1e1d[_0x36ed48];return _0x51c63a;};'use strict';var info=require(_0xd1e1('0x0'));var exec=require(_0xd1e1('0x1'))[_0xd1e1('0x2')];var logger=require('../../config/logger')(_0xd1e1('0x3'));var util=require(_0xd1e1('0x4'));var BPromise=require(_0xd1e1('0x5'));var _=require('lodash');function handleError(_0x775655,_0x563cdd,_0x286f37){_0x563cdd=_0x563cdd||0x1f4;return function(_0x1158a8){logger[_0xd1e1('0x6')](_0xd1e1('0x7'),_0x286f37,_0x563cdd,util[_0xd1e1('0x8')](_0x1158a8,{'showHidden':![],'depth':null}));delete _0x1158a8[_0xd1e1('0x9')];_0x775655['status'](_0x563cdd)[_0xd1e1('0xa')](_0x1158a8);};}exports['index']=function(_0x41fafb,_0x4d5416){return info['getAllData']()[_0xd1e1('0xb')](function(_0x3d0ac4){return _0x4d5416[_0xd1e1('0xc')](0xc8)[_0xd1e1('0xd')](_0x3d0ac4);})[_0xd1e1('0xe')](function(_0x44b69f){return _0x4d5416[_0xd1e1('0xc')](0x1f4)[_0xd1e1('0xd')](_0x44b69f);});};exports['killProcess']=function(_0x50e6d1,_0x43a2d1){var _0x489006=['components/import/cm'];return new BPromise(function(_0x1dd454,_0x2c4f1f){return exec(util[_0xd1e1('0xf')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x50e6d1[_0xd1e1('0x10')]['pid']),function(_0xb46d2d,_0x1ff054,_0x4ab145){if(_0xb46d2d){return _0x2c4f1f(_0xb46d2d);}return _0x1dd454(_0x1ff054);});})[_0xd1e1('0xb')](function(_0x265482){var _0x55a356=![];var _0x28d719=_0x265482[_0xd1e1('0x11')](/\n/);for(var _0x4e1c88=0x0,_0x48e582=_0x489006['length'];_0x4e1c88<_0x48e582,_0x55a356===![];_0x4e1c88+=0x1){if(_0x265482[_0xd1e1('0x12')](_0x489006[_0x4e1c88])>=0x0){_0x55a356=!![];}}if(!_0x55a356){throw new Error(util[_0xd1e1('0xf')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x50e6d1[_0xd1e1('0x10')]['pid']));}process[_0xd1e1('0x13')](_0x50e6d1['params']['pid'],'SIGINT');return _0x43a2d1['status'](0xc8)['json']({'message':util['format'](_0xd1e1('0x14'),_0x50e6d1[_0xd1e1('0x10')][_0xd1e1('0x15')])});})['catch'](handleError(_0x43a2d1,null,_0xd1e1('0x16')));}; \ No newline at end of file +var _0xb459=['lodash','error','inspect','name','index','getAllData','then','json','catch','status','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger','api','util','bluebird'];(function(_0x2ab18b,_0x1c8efc){var _0x5d0fdc=function(_0xa9d570){while(--_0xa9d570){_0x2ab18b['push'](_0x2ab18b['shift']());}};_0x5d0fdc(++_0x1c8efc);}(_0xb459,0x1d5));var _0x9b45=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0xb459[_0x445101];return _0x3c3d04;};'use strict';var info=require(_0x9b45('0x0'));var exec=require('child_process')[_0x9b45('0x1')];var logger=require(_0x9b45('0x2'))(_0x9b45('0x3'));var util=require(_0x9b45('0x4'));var BPromise=require(_0x9b45('0x5'));var _=require(_0x9b45('0x6'));function handleError(_0x3e8c15,_0x137fda,_0x55751a){_0x137fda=_0x137fda||0x1f4;return function(_0x5307e0){logger[_0x9b45('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x55751a,_0x137fda,util[_0x9b45('0x8')](_0x5307e0,{'showHidden':![],'depth':null}));delete _0x5307e0[_0x9b45('0x9')];_0x3e8c15['status'](_0x137fda)['send'](_0x5307e0);};}exports[_0x9b45('0xa')]=function(_0x4e57db,_0x339bea){return info[_0x9b45('0xb')]()[_0x9b45('0xc')](function(_0x265312){return _0x339bea['status'](0xc8)[_0x9b45('0xd')](_0x265312);})[_0x9b45('0xe')](function(_0x10bdd5){return _0x339bea[_0x9b45('0xf')](0x1f4)[_0x9b45('0xd')](_0x10bdd5);});};exports[_0x9b45('0x10')]=function(_0x534fed,_0x270d55){var _0x41c585=['components/import/cm'];return new BPromise(function(_0x485adc,_0x2cd449){return exec(util[_0x9b45('0x11')](_0x9b45('0x12'),_0x534fed['params'][_0x9b45('0x13')]),function(_0x90bb81,_0x3fc018,_0x12a30b){if(_0x90bb81){return _0x2cd449(_0x90bb81);}return _0x485adc(_0x3fc018);});})[_0x9b45('0xc')](function(_0x211a02){var _0xb4381=![];var _0x45c963=_0x211a02['split'](/\n/);for(var _0x1d7d24=0x0,_0x5ae007=_0x41c585['length'];_0x1d7d24<_0x5ae007,_0xb4381===![];_0x1d7d24+=0x1){if(_0x211a02[_0x9b45('0x14')](_0x41c585[_0x1d7d24])>=0x0){_0xb4381=!![];}}if(!_0xb4381){throw new Error(util[_0x9b45('0x11')](_0x9b45('0x15'),_0x534fed['params'][_0x9b45('0x13')]));}process['kill'](_0x534fed[_0x9b45('0x16')][_0x9b45('0x13')],_0x9b45('0x17'));return _0x270d55['status'](0xc8)['json']({'message':util[_0x9b45('0x11')](_0x9b45('0x18'),_0x534fed[_0x9b45('0x16')][_0x9b45('0x13')])});})[_0x9b45('0xe')](handleError(_0x270d55,null,_0x9b45('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index f92ad9b..a4c45e2 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 _0x8c28=['Router','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x8c28,0x1c8));var _0x88c2=function(_0xdc8f5c,_0x29d354){_0xdc8f5c=_0xdc8f5c-0x0;var _0x2c87ac=_0x8c28[_0xdc8f5c];return _0x2c87ac;};'use strict';var multer=require(_0x88c2('0x0'));var util=require(_0x88c2('0x1'));var path=require(_0x88c2('0x2'));var timeout=require(_0x88c2('0x3'));var express=require('express');var router=express[_0x88c2('0x4')]();var fs_extra=require(_0x88c2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x88c2('0x6'));var config=require(_0x88c2('0x7'));var controller=require(_0x88c2('0x8'));router[_0x88c2('0x9')]('/',auth[_0x88c2('0xa')](),controller[_0x88c2('0xb')]);router['get'](_0x88c2('0xc'),auth[_0x88c2('0xa')](),controller[_0x88c2('0xd')]);router[_0x88c2('0xe')]('/',auth[_0x88c2('0xa')](),controller[_0x88c2('0xf')]);router[_0x88c2('0x10')](_0x88c2('0xc'),auth[_0x88c2('0xa')](),controller[_0x88c2('0x11')]);router[_0x88c2('0x12')]('/:id',auth[_0x88c2('0xa')](),controller['destroy']);module[_0x88c2('0x13')]=router; \ No newline at end of file +var _0xe3e6=['show','post','create','put','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x5cdc21,_0x19b1f0){var _0x57c49d=function(_0x2c873c){while(--_0x2c873c){_0x5cdc21['push'](_0x5cdc21['shift']());}};_0x57c49d(++_0x19b1f0);}(_0xe3e6,0x14a));var _0x6e3e=function(_0x18d5d7,_0x19074b){_0x18d5d7=_0x18d5d7-0x0;var _0x30a9ea=_0xe3e6[_0x18d5d7];return _0x30a9ea;};'use strict';var multer=require(_0x6e3e('0x0'));var util=require(_0x6e3e('0x1'));var path=require('path');var timeout=require(_0x6e3e('0x2'));var express=require(_0x6e3e('0x3'));var router=express['Router']();var fs_extra=require(_0x6e3e('0x4'));var auth=require(_0x6e3e('0x5'));var interaction=require(_0x6e3e('0x6'));var config=require(_0x6e3e('0x7'));var controller=require('./tag.controller');router[_0x6e3e('0x8')]('/',auth[_0x6e3e('0x9')](),controller[_0x6e3e('0xa')]);router[_0x6e3e('0x8')](_0x6e3e('0xb'),auth[_0x6e3e('0x9')](),controller[_0x6e3e('0xc')]);router[_0x6e3e('0xd')]('/',auth[_0x6e3e('0x9')](),controller[_0x6e3e('0xe')]);router[_0x6e3e('0xf')](_0x6e3e('0xb'),auth[_0x6e3e('0x9')](),controller['update']);router['delete'](_0x6e3e('0xb'),auth['isAuthenticated'](),controller[_0x6e3e('0x10')]);module[_0x6e3e('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 1d8358b..f28d9cc 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 _0x0bb5=['sequelize','exports','STRING','#0091EA'];(function(_0x21ea8d,_0x2e1673){var _0x201541=function(_0x13ab8c){while(--_0x13ab8c){_0x21ea8d['push'](_0x21ea8d['shift']());}};_0x201541(++_0x2e1673);}(_0x0bb5,0x148));var _0x50bb=function(_0x22b023,_0x307ae0){_0x22b023=_0x22b023-0x0;var _0x5b6f6b=_0x0bb5[_0x22b023];return _0x5b6f6b;};'use strict';var Sequelize=require(_0x50bb('0x0'));module[_0x50bb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x3')},'description':{'type':Sequelize[_0x50bb('0x2')]}}; \ No newline at end of file +var _0x4ffe=['STRING','#0091EA','sequelize','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4ffe,0x172));var _0xe4ff=function(_0x152499,_0x4eefc4){_0x152499=_0x152499-0x0;var _0x2804f2=_0x4ffe[_0x152499];return _0x2804f2;};'use strict';var Sequelize=require(_0xe4ff('0x0'));module[_0xe4ff('0x1')]={'name':{'type':Sequelize[_0xe4ff('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xe4ff('0x2')],'defaultValue':_0xe4ff('0x3')},'description':{'type':Sequelize[_0xe4ff('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 710f379..9cd6fe0 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 _0xa0bc=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','Tags','UserProfileResource','sendStatus','error','stack','name','send','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x1282a0,_0x58b2f9){var _0x18af0c=function(_0x5ac73f){while(--_0x5ac73f){_0x1282a0['push'](_0x1282a0['shift']());}};_0x18af0c(++_0x58b2f9);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca0b('0x0'));var zipdir=require(_0xca0b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca0b('0x2'));var moment=require(_0xca0b('0x3'));var BPromise=require(_0xca0b('0x4'));var Mustache=require(_0xca0b('0x5'));var util=require(_0xca0b('0x6'));var path=require(_0xca0b('0x7'));var sox=require(_0xca0b('0x8'));var csv=require(_0xca0b('0x9'));var ejs=require(_0xca0b('0xa'));var fs=require('fs');var fs_extra=require(_0xca0b('0xb'));var _=require(_0xca0b('0xc'));var squel=require(_0xca0b('0xd'));var crypto=require(_0xca0b('0xe'));var jsforce=require(_0xca0b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xca0b('0x9'));var querystring=require(_0xca0b('0x10'));var Papa=require(_0xca0b('0x11'));var Redis=require(_0xca0b('0x12'));var authService=require(_0xca0b('0x13'));var qs=require(_0xca0b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca0b('0x15'));var logger=require(_0xca0b('0x16'))(_0xca0b('0x17'));var utils=require(_0xca0b('0x18'));var config=require(_0xca0b('0x19'));var licenseUtil=require(_0xca0b('0x1a'));var db=require(_0xca0b('0x1b'))['db'];function respondWithStatusCode(_0x3a2e25,_0x22ca9d){_0x22ca9d=_0x22ca9d||0xcc;return function(_0x2ce366){if(_0x2ce366){return _0x3a2e25['sendStatus'](_0x22ca9d);}return _0x3a2e25[_0xca0b('0x1c')](_0x22ca9d)[_0xca0b('0x1d')]();};}function respondWithResult(_0x358972,_0x5da205){_0x5da205=_0x5da205||0xc8;return function(_0x106ed6){if(_0x106ed6){return _0x358972[_0xca0b('0x1c')](_0x5da205)[_0xca0b('0x1e')](_0x106ed6);}};}function respondWithFilteredResult(_0x2beba9,_0x42b68e){return function(_0x404c6d){if(_0x404c6d){var _0x4d7620=typeof _0x42b68e[_0xca0b('0x1f')]===_0xca0b('0x20')&&typeof _0x42b68e['limit']===_0xca0b('0x20');var _0x5db810=_0x404c6d[_0xca0b('0x21')];var _0x5050b7=_0x4d7620?0x0:_0x42b68e[_0xca0b('0x1f')];var _0x32eff7=_0x4d7620?_0x404c6d[_0xca0b('0x21')]:_0x42b68e['offset']+_0x42b68e[_0xca0b('0x22')];var _0x2c0c53;if(_0x32eff7>=_0x5db810){_0x32eff7=_0x5db810;_0x2c0c53=0xc8;}else{_0x2c0c53=0xce;}_0x2beba9['status'](_0x2c0c53);return _0x2beba9[_0xca0b('0x23')](_0xca0b('0x24'),_0x5050b7+'-'+_0x32eff7+'/'+_0x5db810)[_0xca0b('0x1e')](_0x404c6d);}return null;};}function patchUpdates(_0x59bda9){return function(_0x865393){try{jsonpatch[_0xca0b('0x25')](_0x865393,_0x59bda9,!![]);}catch(_0x484e26){return BPromise[_0xca0b('0x26')](_0x484e26);}return _0x865393[_0xca0b('0x27')]();};}function saveUpdates(_0x2ae93b,_0x49e695){return function(_0x119589){if(_0x119589){return _0x119589[_0xca0b('0x28')](_0x2ae93b)[_0xca0b('0x29')](function(_0x504d91){return _0x504d91;});}return null;};}function removeEntity(_0x54fb03,_0x11f5c3){return function(_0x428459){if(_0x428459){return _0x428459[_0xca0b('0x2a')]()[_0xca0b('0x29')](function(){var _0x3ae1dc=_0x428459['get']({'plain':!![]});var _0xe122e8=_0xca0b('0x2b');return db[_0xca0b('0x2c')][_0xca0b('0x2a')]({'where':{'type':_0xe122e8,'resourceId':_0x3ae1dc['id']}})[_0xca0b('0x29')](function(){return _0x428459;});})['then'](function(){_0x54fb03['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44a6fd,_0xa71d57){return function(_0x3fd832){if(!_0x3fd832){_0x44a6fd[_0xca0b('0x2d')](0x194);}return _0x3fd832;};}function handleError(_0xe7673b,_0x515f83){_0x515f83=_0x515f83||0x1f4;return function(_0x23af62){logger[_0xca0b('0x2e')](_0x23af62[_0xca0b('0x2f')]);if(_0x23af62[_0xca0b('0x30')]){delete _0x23af62[_0xca0b('0x30')];}_0xe7673b[_0xca0b('0x1c')](_0x515f83)[_0xca0b('0x31')](_0x23af62);};}exports['index']=function(_0x6016f6,_0x17a365){var _0x3b72b2={},_0x26f168={},_0x5a8c2f={'count':0x0,'rows':[]};var _0x43cf1a=_[_0xca0b('0x32')](db[_0xca0b('0x33')][_0xca0b('0x34')],function(_0x3beea0){return{'name':_0x3beea0[_0xca0b('0x35')],'type':_0x3beea0[_0xca0b('0x36')][_0xca0b('0x37')]};});_0x26f168[_0xca0b('0x38')]=_[_0xca0b('0x32')](_0x43cf1a,_0xca0b('0x30'));_0x26f168[_0xca0b('0x39')]=_[_0xca0b('0x3a')](_0x6016f6[_0xca0b('0x39')]);_0x26f168[_0xca0b('0x3b')]=_['intersection'](_0x26f168[_0xca0b('0x38')],_0x26f168[_0xca0b('0x39')]);_0x3b72b2[_0xca0b('0x3c')]=_[_0xca0b('0x3d')](_0x26f168['model'],qs[_0xca0b('0x3e')](_0x6016f6[_0xca0b('0x39')]['fields']));_0x3b72b2[_0xca0b('0x3c')]=_0x3b72b2[_0xca0b('0x3c')][_0xca0b('0x3f')]?_0x3b72b2[_0xca0b('0x3c')]:_0x26f168[_0xca0b('0x38')];if(!_0x6016f6[_0xca0b('0x39')][_0xca0b('0x40')](_0xca0b('0x41'))){_0x3b72b2['limit']=qs['limit'](_0x6016f6[_0xca0b('0x39')][_0xca0b('0x22')]);_0x3b72b2[_0xca0b('0x1f')]=qs[_0xca0b('0x1f')](_0x6016f6[_0xca0b('0x39')][_0xca0b('0x1f')]);}_0x3b72b2[_0xca0b('0x42')]=qs[_0xca0b('0x43')](_0x6016f6[_0xca0b('0x39')][_0xca0b('0x43')]);_0x3b72b2[_0xca0b('0x44')]=qs[_0xca0b('0x3b')](_[_0xca0b('0x45')](_0x6016f6[_0xca0b('0x39')],_0x26f168[_0xca0b('0x3b')]),_0x43cf1a);if(_0x6016f6[_0xca0b('0x39')][_0xca0b('0x46')]){_0x3b72b2[_0xca0b('0x44')]=_[_0xca0b('0x47')](_0x3b72b2[_0xca0b('0x44')],{'$or':_[_0xca0b('0x32')](_0x43cf1a,function(_0x25a5a1){if(_0x25a5a1[_0xca0b('0x36')]!==_0xca0b('0x48')){var _0x90dc6c={};_0x90dc6c[_0x25a5a1['name']]={'$like':'%'+_0x6016f6['query'][_0xca0b('0x46')]+'%'};return _0x90dc6c;}})});}_0x3b72b2=_[_0xca0b('0x47')]({},_0x3b72b2,_0x6016f6['options']);var _0x54890e={'where':_0x3b72b2['where']};return db[_0xca0b('0x33')][_0xca0b('0x21')](_0x54890e)[_0xca0b('0x29')](function(_0xf9e175){_0x5a8c2f[_0xca0b('0x21')]=_0xf9e175;if(_0x6016f6['query']['includeAll']){_0x3b72b2[_0xca0b('0x49')]=[{'all':!![]}];}return db['Tag'][_0xca0b('0x4a')](_0x3b72b2);})['then'](function(_0x57bab3){_0x5a8c2f['rows']=_0x57bab3;return _0x5a8c2f;})[_0xca0b('0x29')](respondWithFilteredResult(_0x17a365,_0x3b72b2))[_0xca0b('0x4b')](handleError(_0x17a365,null));};exports[_0xca0b('0x4c')]=function(_0x3448ab,_0x19f760){var _0xcc9be0={'raw':!![],'where':{'id':_0x3448ab[_0xca0b('0x4d')]['id']}},_0x54bcb7={};_0x54bcb7[_0xca0b('0x38')]=_[_0xca0b('0x3a')](db[_0xca0b('0x33')][_0xca0b('0x34')]);_0x54bcb7['query']=_['keys'](_0x3448ab[_0xca0b('0x39')]);_0x54bcb7[_0xca0b('0x3b')]=_[_0xca0b('0x3d')](_0x54bcb7[_0xca0b('0x38')],_0x54bcb7['query']);_0xcc9be0[_0xca0b('0x3c')]=_[_0xca0b('0x3d')](_0x54bcb7[_0xca0b('0x38')],qs[_0xca0b('0x3e')](_0x3448ab['query']['fields']));_0xcc9be0[_0xca0b('0x3c')]=_0xcc9be0[_0xca0b('0x3c')][_0xca0b('0x3f')]?_0xcc9be0['attributes']:_0x54bcb7[_0xca0b('0x38')];if(_0x3448ab[_0xca0b('0x39')]['includeAll']){_0xcc9be0['include']=[{'all':!![]}];}_0xcc9be0=_['merge']({},_0xcc9be0,_0x3448ab[_0xca0b('0x4e')]);return db[_0xca0b('0x33')][_0xca0b('0x4f')](_0xcc9be0)['then'](handleEntityNotFound(_0x19f760,null))['then'](respondWithResult(_0x19f760,null))[_0xca0b('0x4b')](handleError(_0x19f760,null));};exports[_0xca0b('0x50')]=function(_0x250288,_0x174e81){return db[_0xca0b('0x33')][_0xca0b('0x50')](_0x250288['body'],{})['then'](function(_0x499b43){var _0x456ea1=_0x250288[_0xca0b('0x51')]['get']({'plain':!![]});if(!_0x456ea1)throw new Error(_0xca0b('0x52'));if(_0x456ea1[_0xca0b('0x53')]===_0xca0b('0x51')){var _0x535cce=_0x499b43[_0xca0b('0x54')]({'plain':!![]});var _0x5a3734=_0xca0b('0x2b');return db[_0xca0b('0x55')][_0xca0b('0x4f')]({'where':{'name':_0x5a3734,'userProfileId':_0x456ea1[_0xca0b('0x56')]},'raw':!![]})[_0xca0b('0x29')](function(_0x1d569e){if(_0x1d569e&&_0x1d569e[_0xca0b('0x57')]===0x0){return db[_0xca0b('0x2c')][_0xca0b('0x50')]({'name':_0x535cce[_0xca0b('0x30')],'resourceId':_0x535cce['id'],'type':_0x1d569e[_0xca0b('0x30')],'sectionId':_0x1d569e['id']},{})[_0xca0b('0x29')](function(){return _0x499b43;});}else{return _0x499b43;}})[_0xca0b('0x4b')](function(_0x21d2d5){logger[_0xca0b('0x2e')](_0xca0b('0x58'),_0x21d2d5);throw _0x21d2d5;});}return _0x499b43;})[_0xca0b('0x29')](respondWithResult(_0x174e81,0xc9))[_0xca0b('0x4b')](handleError(_0x174e81,null));};exports['update']=function(_0x27fdbd,_0xbef02e){if(_0x27fdbd['body']['id']){delete _0x27fdbd[_0xca0b('0x59')]['id'];}return db[_0xca0b('0x33')][_0xca0b('0x4f')]({'where':{'id':_0x27fdbd[_0xca0b('0x4d')]['id']}})[_0xca0b('0x29')](handleEntityNotFound(_0xbef02e,null))[_0xca0b('0x29')](saveUpdates(_0x27fdbd[_0xca0b('0x59')],null))[_0xca0b('0x29')](respondWithResult(_0xbef02e,null))['catch'](handleError(_0xbef02e,null));};exports[_0xca0b('0x2a')]=function(_0x36feaa,_0x416fd5){return db[_0xca0b('0x33')]['find']({'where':{'id':_0x36feaa['params']['id']}})[_0xca0b('0x29')](handleEntityNotFound(_0x416fd5,null))[_0xca0b('0x29')](removeEntity(_0x416fd5,null))['catch'](handleError(_0x416fd5,null));}; \ No newline at end of file +var _0x99e9=['show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','error','name','send','index','map','Tag','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch'];(function(_0x5c734b,_0x5884b9){var _0x34a113=function(_0x315e70){while(--_0x315e70){_0x5c734b['push'](_0x5c734b['shift']());}};_0x34a113(++_0x5884b9);}(_0x99e9,0xb4));var _0x999e=function(_0x388914,_0x3c63f9){_0x388914=_0x388914-0x0;var _0x1f9111=_0x99e9[_0x388914];return _0x1f9111;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x999e('0x0'));var zipdir=require(_0x999e('0x1'));var jsonpatch=require(_0x999e('0x2'));var rp=require(_0x999e('0x3'));var moment=require('moment');var BPromise=require(_0x999e('0x4'));var Mustache=require(_0x999e('0x5'));var util=require(_0x999e('0x6'));var path=require('path');var sox=require(_0x999e('0x7'));var csv=require('to-csv');var ejs=require(_0x999e('0x8'));var fs=require('fs');var fs_extra=require(_0x999e('0x9'));var _=require(_0x999e('0xa'));var squel=require(_0x999e('0xb'));var crypto=require('crypto');var jsforce=require(_0x999e('0xc'));var deskjs=require(_0x999e('0xd'));var toCsv=require(_0x999e('0xe'));var querystring=require(_0x999e('0xf'));var Papa=require(_0x999e('0x10'));var Redis=require(_0x999e('0x11'));var authService=require(_0x999e('0x12'));var qs=require(_0x999e('0x13'));var as=require(_0x999e('0x14'));var hardwareService=require(_0x999e('0x15'));var logger=require(_0x999e('0x16'))(_0x999e('0x17'));var utils=require(_0x999e('0x18'));var config=require(_0x999e('0x19'));var licenseUtil=require(_0x999e('0x1a'));var db=require(_0x999e('0x1b'))['db'];function respondWithStatusCode(_0x26b55a,_0x47a3c1){_0x47a3c1=_0x47a3c1||0xcc;return function(_0x15f771){if(_0x15f771){return _0x26b55a['sendStatus'](_0x47a3c1);}return _0x26b55a[_0x999e('0x1c')](_0x47a3c1)[_0x999e('0x1d')]();};}function respondWithResult(_0x2fbc3e,_0x538a92){_0x538a92=_0x538a92||0xc8;return function(_0x28bdd1){if(_0x28bdd1){return _0x2fbc3e['status'](_0x538a92)[_0x999e('0x1e')](_0x28bdd1);}};}function respondWithFilteredResult(_0x539598,_0x549ad4){return function(_0x1eee64){if(_0x1eee64){var _0x22feac=typeof _0x549ad4[_0x999e('0x1f')]===_0x999e('0x20')&&typeof _0x549ad4[_0x999e('0x21')]===_0x999e('0x20');var _0x4aac66=_0x1eee64['count'];var _0x4fcdfb=_0x22feac?0x0:_0x549ad4[_0x999e('0x1f')];var _0x43b09e=_0x22feac?_0x1eee64[_0x999e('0x22')]:_0x549ad4[_0x999e('0x1f')]+_0x549ad4[_0x999e('0x21')];var _0x3ece5e;if(_0x43b09e>=_0x4aac66){_0x43b09e=_0x4aac66;_0x3ece5e=0xc8;}else{_0x3ece5e=0xce;}_0x539598['status'](_0x3ece5e);return _0x539598['set'](_0x999e('0x23'),_0x4fcdfb+'-'+_0x43b09e+'/'+_0x4aac66)[_0x999e('0x1e')](_0x1eee64);}return null;};}function patchUpdates(_0x3b3642){return function(_0x510fa2){try{jsonpatch[_0x999e('0x24')](_0x510fa2,_0x3b3642,!![]);}catch(_0x42e167){return BPromise[_0x999e('0x25')](_0x42e167);}return _0x510fa2[_0x999e('0x26')]();};}function saveUpdates(_0x373b80,_0x3750a0){return function(_0x427bcf){if(_0x427bcf){return _0x427bcf['update'](_0x373b80)['then'](function(_0x11a6bf){return _0x11a6bf;});}return null;};}function removeEntity(_0x4f0091,_0x4c5491){return function(_0x452acd){if(_0x452acd){return _0x452acd[_0x999e('0x27')]()[_0x999e('0x28')](function(){var _0x13027c=_0x452acd[_0x999e('0x29')]({'plain':!![]});var _0x320634='Tags';return db[_0x999e('0x2a')][_0x999e('0x27')]({'where':{'type':_0x320634,'resourceId':_0x13027c['id']}})[_0x999e('0x28')](function(){return _0x452acd;});})[_0x999e('0x28')](function(){_0x4f0091[_0x999e('0x1c')](0xcc)[_0x999e('0x1d')]();});}};}function handleEntityNotFound(_0x44b790,_0x5798f3){return function(_0x28f803){if(!_0x28f803){_0x44b790['sendStatus'](0x194);}return _0x28f803;};}function handleError(_0x4fed13,_0x3dff6b){_0x3dff6b=_0x3dff6b||0x1f4;return function(_0x1059bd){logger[_0x999e('0x2b')](_0x1059bd['stack']);if(_0x1059bd[_0x999e('0x2c')]){delete _0x1059bd[_0x999e('0x2c')];}_0x4fed13[_0x999e('0x1c')](_0x3dff6b)[_0x999e('0x2d')](_0x1059bd);};}exports[_0x999e('0x2e')]=function(_0x327079,_0x82e067){var _0x2e9b0e={},_0x27102b={},_0x3ddacb={'count':0x0,'rows':[]};var _0x53ece1=_[_0x999e('0x2f')](db[_0x999e('0x30')][_0x999e('0x31')],function(_0x4c2ce8){return{'name':_0x4c2ce8[_0x999e('0x32')],'type':_0x4c2ce8['type']['key']};});_0x27102b[_0x999e('0x33')]=_[_0x999e('0x2f')](_0x53ece1,'name');_0x27102b['query']=_[_0x999e('0x34')](_0x327079[_0x999e('0x35')]);_0x27102b[_0x999e('0x36')]=_[_0x999e('0x37')](_0x27102b['model'],_0x27102b[_0x999e('0x35')]);_0x2e9b0e[_0x999e('0x38')]=_[_0x999e('0x37')](_0x27102b[_0x999e('0x33')],qs['fields'](_0x327079['query'][_0x999e('0x39')]));_0x2e9b0e['attributes']=_0x2e9b0e[_0x999e('0x38')][_0x999e('0x3a')]?_0x2e9b0e[_0x999e('0x38')]:_0x27102b[_0x999e('0x33')];if(!_0x327079['query'][_0x999e('0x3b')](_0x999e('0x3c'))){_0x2e9b0e['limit']=qs['limit'](_0x327079[_0x999e('0x35')]['limit']);_0x2e9b0e[_0x999e('0x1f')]=qs['offset'](_0x327079['query']['offset']);}_0x2e9b0e['order']=qs[_0x999e('0x3d')](_0x327079['query'][_0x999e('0x3d')]);_0x2e9b0e['where']=qs['filters'](_['pick'](_0x327079[_0x999e('0x35')],_0x27102b[_0x999e('0x36')]),_0x53ece1);if(_0x327079[_0x999e('0x35')][_0x999e('0x3e')]){_0x2e9b0e[_0x999e('0x3f')]=_[_0x999e('0x40')](_0x2e9b0e[_0x999e('0x3f')],{'$or':_[_0x999e('0x2f')](_0x53ece1,function(_0x54866a){if(_0x54866a[_0x999e('0x41')]!==_0x999e('0x42')){var _0x1e1229={};_0x1e1229[_0x54866a[_0x999e('0x2c')]]={'$like':'%'+_0x327079['query'][_0x999e('0x3e')]+'%'};return _0x1e1229;}})});}_0x2e9b0e=_['merge']({},_0x2e9b0e,_0x327079[_0x999e('0x43')]);var _0x35b318={'where':_0x2e9b0e[_0x999e('0x3f')]};return db[_0x999e('0x30')]['count'](_0x35b318)[_0x999e('0x28')](function(_0x108c96){_0x3ddacb[_0x999e('0x22')]=_0x108c96;if(_0x327079['query']['includeAll']){_0x2e9b0e[_0x999e('0x44')]=[{'all':!![]}];}return db[_0x999e('0x30')][_0x999e('0x45')](_0x2e9b0e);})[_0x999e('0x28')](function(_0x1009a0){_0x3ddacb[_0x999e('0x46')]=_0x1009a0;return _0x3ddacb;})[_0x999e('0x28')](respondWithFilteredResult(_0x82e067,_0x2e9b0e))[_0x999e('0x47')](handleError(_0x82e067,null));};exports[_0x999e('0x48')]=function(_0xf4fa,_0x55da0b){var _0x4c8b36={'raw':!![],'where':{'id':_0xf4fa[_0x999e('0x49')]['id']}},_0xa5742d={};_0xa5742d[_0x999e('0x33')]=_[_0x999e('0x34')](db[_0x999e('0x30')][_0x999e('0x31')]);_0xa5742d['query']=_[_0x999e('0x34')](_0xf4fa['query']);_0xa5742d['filters']=_[_0x999e('0x37')](_0xa5742d['model'],_0xa5742d['query']);_0x4c8b36['attributes']=_['intersection'](_0xa5742d[_0x999e('0x33')],qs[_0x999e('0x39')](_0xf4fa['query'][_0x999e('0x39')]));_0x4c8b36[_0x999e('0x38')]=_0x4c8b36[_0x999e('0x38')]['length']?_0x4c8b36['attributes']:_0xa5742d[_0x999e('0x33')];if(_0xf4fa[_0x999e('0x35')][_0x999e('0x4a')]){_0x4c8b36['include']=[{'all':!![]}];}_0x4c8b36=_['merge']({},_0x4c8b36,_0xf4fa['options']);return db['Tag'][_0x999e('0x4b')](_0x4c8b36)['then'](handleEntityNotFound(_0x55da0b,null))['then'](respondWithResult(_0x55da0b,null))[_0x999e('0x47')](handleError(_0x55da0b,null));};exports[_0x999e('0x4c')]=function(_0x5843f1,_0xa50dc6){return db[_0x999e('0x30')]['create'](_0x5843f1[_0x999e('0x4d')],{})['then'](function(_0x9322ca){var _0x42dfea=_0x5843f1['user'][_0x999e('0x29')]({'plain':!![]});if(!_0x42dfea)throw new Error(_0x999e('0x4e'));if(_0x42dfea['role']==='user'){var _0x254292=_0x9322ca['get']({'plain':!![]});var _0x5ebc95='Tags';return db[_0x999e('0x4f')][_0x999e('0x4b')]({'where':{'name':_0x5ebc95,'userProfileId':_0x42dfea[_0x999e('0x50')]},'raw':!![]})[_0x999e('0x28')](function(_0x37c3ff){if(_0x37c3ff&&_0x37c3ff[_0x999e('0x51')]===0x0){return db['UserProfileResource'][_0x999e('0x4c')]({'name':_0x254292[_0x999e('0x2c')],'resourceId':_0x254292['id'],'type':_0x37c3ff['name'],'sectionId':_0x37c3ff['id']},{})[_0x999e('0x28')](function(){return _0x9322ca;});}else{return _0x9322ca;}})[_0x999e('0x47')](function(_0x4169eb){logger[_0x999e('0x2b')](_0x999e('0x52'),_0x4169eb);throw _0x4169eb;});}return _0x9322ca;})[_0x999e('0x28')](respondWithResult(_0xa50dc6,0xc9))[_0x999e('0x47')](handleError(_0xa50dc6,null));};exports[_0x999e('0x53')]=function(_0x290c7a,_0x53932a){if(_0x290c7a[_0x999e('0x4d')]['id']){delete _0x290c7a[_0x999e('0x4d')]['id'];}return db[_0x999e('0x30')][_0x999e('0x4b')]({'where':{'id':_0x290c7a['params']['id']}})[_0x999e('0x28')](handleEntityNotFound(_0x53932a,null))[_0x999e('0x28')](saveUpdates(_0x290c7a[_0x999e('0x4d')],null))[_0x999e('0x28')](respondWithResult(_0x53932a,null))[_0x999e('0x47')](handleError(_0x53932a,null));};exports[_0x999e('0x27')]=function(_0x3f5790,_0x1a6925){return db['Tag']['find']({'where':{'id':_0x3f5790[_0x999e('0x49')]['id']}})[_0x999e('0x28')](handleEntityNotFound(_0x1a6925,null))[_0x999e('0x28')](removeEntity(_0x1a6925,null))[_0x999e('0x47')](handleError(_0x1a6925,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 919555b..a0becf9 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 _0x0332=['tools_tags','lodash','util','../../config/logger','api','bluebird','../../config/environment','./tag.attributes','exports','define','Tag'];(function(_0x32f4e7,_0x2cac26){var _0x4cd1d4=function(_0x5cf5ce){while(--_0x5cf5ce){_0x32f4e7['push'](_0x32f4e7['shift']());}};_0x4cd1d4(++_0x2cac26);}(_0x0332,0x198));var _0x2033=function(_0x361fd8,_0x30462c){_0x361fd8=_0x361fd8-0x0;var _0x58726d=_0x0332[_0x361fd8];return _0x58726d;};'use strict';var _=require(_0x2033('0x0'));var util=require(_0x2033('0x1'));var logger=require(_0x2033('0x2'))(_0x2033('0x3'));var moment=require('moment');var BPromise=require(_0x2033('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2033('0x5'));var attributes=require(_0x2033('0x6'));module[_0x2033('0x7')]=function(_0x4ae3b9,_0x3e9d8f){return _0x4ae3b9[_0x2033('0x8')](_0x2033('0x9'),attributes,{'tableName':_0x2033('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22d0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./tag.attributes','exports','define','tools_tags','lodash','util'];(function(_0x18fb4c,_0x578f22){var _0x4a75b3=function(_0x27d762){while(--_0x27d762){_0x18fb4c['push'](_0x18fb4c['shift']());}};_0x4a75b3(++_0x578f22);}(_0x22d0,0x106));var _0x022d=function(_0x510b98,_0x4c4cbb){_0x510b98=_0x510b98-0x0;var _0x45e775=_0x22d0[_0x510b98];return _0x45e775;};'use strict';var _=require(_0x022d('0x0'));var util=require(_0x022d('0x1'));var logger=require(_0x022d('0x2'))(_0x022d('0x3'));var moment=require(_0x022d('0x4'));var BPromise=require(_0x022d('0x5'));var rp=require(_0x022d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x022d('0x7'));var config=require('../../config/environment');var attributes=require(_0x022d('0x8'));module[_0x022d('0x9')]=function(_0x1f0fe6,_0x32d4c5){return _0x1f0fe6[_0x022d('0xa')]('Tag',attributes,{'tableName':_0x022d('0xb'),'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 b1cff6a..fab6bbc 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 _0x66fa=['../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x232eb8,_0x27527a){var _0x3ebc81=function(_0x581ee2){while(--_0x581ee2){_0x232eb8['push'](_0x232eb8['shift']());}};_0x3ebc81(++_0x27527a);}(_0x66fa,0x168));var _0xa66f=function(_0x5e324b,_0x3d7fe2){_0x5e324b=_0x5e324b-0x0;var _0xa81abc=_0x66fa[_0x5e324b];return _0xa81abc;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require(_0xa66f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa66f('0x3'));var db=require(_0xa66f('0x4'))['db'];var utils=require(_0xa66f('0x5'));var logger=require(_0xa66f('0x6'))(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var jayson=require(_0xa66f('0x9'));var client=jayson[_0xa66f('0xa')][_0xa66f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33bd0d,_0x150f73,_0x5b7cf7){return new BPromise(function(_0x1cf624,_0x5ec156){return client[_0xa66f('0xc')](_0x33bd0d,_0x5b7cf7)[_0xa66f('0xd')](function(_0x5ad336){logger[_0xa66f('0xe')](_0xa66f('0xf'),_0x150f73,_0xa66f('0x10'));logger[_0xa66f('0x11')](_0xa66f('0x12'),_0x150f73,_0xa66f('0x10'),JSON['stringify'](_0x5ad336));if(_0x5ad336['error']){if(_0x5ad336[_0xa66f('0x13')]['code']===0x1f4){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x150f73,_0x5ad336[_0xa66f('0x13')]['message']);return _0x5ec156(_0x5ad336[_0xa66f('0x13')][_0xa66f('0x14')]);}logger['error'](_0xa66f('0xf'),_0x150f73,_0x5ad336[_0xa66f('0x13')][_0xa66f('0x14')]);return _0x1cf624(_0x5ad336[_0xa66f('0x13')]['message']);}else{logger[_0xa66f('0xe')](_0xa66f('0xf'),_0x150f73,'request\x20sent');_0x1cf624(_0x5ad336[_0xa66f('0x15')][_0xa66f('0x14')]);}})[_0xa66f('0x16')](function(_0x76af81){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x150f73,_0x76af81);_0x5ec156(_0x76af81);});});} \ No newline at end of file +var _0xb458=['Tag,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Tag,\x20%s,\x20%s','debug'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xb458,0x103));var _0x8b45=function(_0x182558,_0x1d1cfa){_0x182558=_0x182558-0x0;var _0x1e1bb7=_0xb458[_0x182558];return _0x1e1bb7;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var moment=require(_0x8b45('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b45('0x3'));var db=require(_0x8b45('0x4'))['db'];var utils=require(_0x8b45('0x5'));var logger=require(_0x8b45('0x6'))('rpc');var config=require(_0x8b45('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8b45('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12bd05,_0x2daa9a,_0x3a8ccb){return new BPromise(function(_0x32342f,_0x4d1718){return client[_0x8b45('0x9')](_0x12bd05,_0x3a8ccb)[_0x8b45('0xa')](function(_0x33f30e){logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,'request\x20sent');logger[_0x8b45('0xd')](_0x8b45('0xe'),_0x2daa9a,'request\x20sent',JSON['stringify'](_0x33f30e));if(_0x33f30e['error']){if(_0x33f30e['error'][_0x8b45('0xf')]===0x1f4){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e['error'][_0x8b45('0x11')]);return _0x4d1718(_0x33f30e[_0x8b45('0x10')][_0x8b45('0x11')]);}logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e[_0x8b45('0x10')]['message']);return _0x32342f(_0x33f30e['error'][_0x8b45('0x11')]);}else{logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,_0x8b45('0x12'));_0x32342f(_0x33f30e[_0x8b45('0x13')][_0x8b45('0x11')]);}})[_0x8b45('0x14')](function(_0x147d6b){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x147d6b);_0x4d1718(_0x147d6b);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index b433759..a59655f 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 55296d2..be865c9 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 _0x757a=['exports','STRING'];(function(_0x5bb3d4,_0x3b3b41){var _0x107d76=function(_0x52a2e7){while(--_0x52a2e7){_0x5bb3d4['push'](_0x5bb3d4['shift']());}};_0x107d76(++_0x3b3b41);}(_0x757a,0xde));var _0xa757=function(_0x487eed,_0x50f112){_0x487eed=_0x487eed-0x0;var _0xa790b5=_0x757a[_0x487eed];return _0xa790b5;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0x3afc9f,_0x1841de){var _0x588f19=function(_0x433159){while(--_0x433159){_0x3afc9f['push'](_0x3afc9f['shift']());}};_0x588f19(++_0x1841de);}(_0xb10b,0x12a));var _0xbb10=function(_0x4334af,_0x21e066){_0x4334af=_0x4334af-0x0;var _0xec5be0=_0xb10b[_0x4334af];return _0xec5be0;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 8a20be6..bf02f2b 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 _0xabd1=['SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','WhatsappQueueId','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','options','Queues','ids','removeQueues','remove','addAgents','isArray','Chat','Mail','Sms','Fax','Voice','TeamVoiceQueue','penalty','User','findOrCreate','QueueId','online','voicePause','upsert','isNil','interface','all','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','spread','removeAgents','emit','Queue:remove','UserVoiceQueueRt','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./team.socket','register','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','VoiceQueueId','UserVoiceQueue','MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue'];(function(_0x2f0d5b,_0x3a5769){var _0x1fda7a=function(_0x477b4b){while(--_0x477b4b){_0x2f0d5b['push'](_0x2f0d5b['shift']());}};_0x1fda7a(++_0x3a5769);}(_0xabd1,0x15c));var _0x1abd=function(_0x56b138,_0x2396d6){_0x56b138=_0x56b138-0x0;var _0x3df878=_0xabd1[_0x56b138];return _0x3df878;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1abd('0x0'));var zipdir=require(_0x1abd('0x1'));var jsonpatch=require(_0x1abd('0x2'));var rp=require(_0x1abd('0x3'));var moment=require(_0x1abd('0x4'));var BPromise=require(_0x1abd('0x5'));var Mustache=require(_0x1abd('0x6'));var util=require(_0x1abd('0x7'));var path=require(_0x1abd('0x8'));var sox=require(_0x1abd('0x9'));var csv=require(_0x1abd('0xa'));var ejs=require(_0x1abd('0xb'));var fs=require('fs');var fs_extra=require(_0x1abd('0xc'));var _=require(_0x1abd('0xd'));var squel=require('squel');var crypto=require(_0x1abd('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1abd('0xa'));var querystring=require(_0x1abd('0xf'));var Papa=require(_0x1abd('0x10'));var Redis=require('ioredis');var authService=require(_0x1abd('0x11'));var qs=require(_0x1abd('0x12'));var as=require(_0x1abd('0x13'));var hardwareService=require(_0x1abd('0x14'));var logger=require(_0x1abd('0x15'))(_0x1abd('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1abd('0x17'));var db=require(_0x1abd('0x18'))['db'];config[_0x1abd('0x19')]=_[_0x1abd('0x1a')](config[_0x1abd('0x19')],{'host':_0x1abd('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1abd('0x1c'))[_0x1abd('0x1d')](socket);function respondWithStatusCode(_0x5b68bf,_0x24d20c){_0x24d20c=_0x24d20c||0xcc;return function(_0x1f8185){if(_0x1f8185){return _0x5b68bf['sendStatus'](_0x24d20c);}return _0x5b68bf[_0x1abd('0x1e')](_0x24d20c)['end']();};}function respondWithResult(_0x4ff382,_0x4054dd){_0x4054dd=_0x4054dd||0xc8;return function(_0x3e4c6a){if(_0x3e4c6a){return _0x4ff382['status'](_0x4054dd)[_0x1abd('0x1f')](_0x3e4c6a);}};}function respondWithFilteredResult(_0x37390f,_0x6b20ef){return function(_0x2f0d22){if(_0x2f0d22){var _0x9dcf5f=typeof _0x6b20ef[_0x1abd('0x20')]===_0x1abd('0x21')&&typeof _0x6b20ef['limit']===_0x1abd('0x21');var _0x15c7b4=_0x2f0d22[_0x1abd('0x22')];var _0x56bf57=_0x9dcf5f?0x0:_0x6b20ef['offset'];var _0x491bd7=_0x9dcf5f?_0x2f0d22[_0x1abd('0x22')]:_0x6b20ef['offset']+_0x6b20ef['limit'];var _0x533b60;if(_0x491bd7>=_0x15c7b4){_0x491bd7=_0x15c7b4;_0x533b60=0xc8;}else{_0x533b60=0xce;}_0x37390f[_0x1abd('0x1e')](_0x533b60);return _0x37390f[_0x1abd('0x23')](_0x1abd('0x24'),_0x56bf57+'-'+_0x491bd7+'/'+_0x15c7b4)[_0x1abd('0x1f')](_0x2f0d22);}return null;};}function patchUpdates(_0x435b2c){return function(_0xf5fdd){try{jsonpatch[_0x1abd('0x25')](_0xf5fdd,_0x435b2c,!![]);}catch(_0x40e226){return BPromise['reject'](_0x40e226);}return _0xf5fdd[_0x1abd('0x26')]();};}function saveUpdates(_0x2ca6b2,_0x5530c6){return function(_0xcd3a2c){if(_0xcd3a2c){return _0xcd3a2c[_0x1abd('0x27')](_0x2ca6b2)[_0x1abd('0x28')](function(_0x3bb889){return _0x3bb889;});}return null;};}function handleEntityNotFound(_0x46d7eb,_0x56809a){return function(_0xcc4d49){if(!_0xcc4d49){_0x46d7eb[_0x1abd('0x29')](0x194);}return _0xcc4d49;};}function handleError(_0x3b9894,_0x105646){_0x105646=_0x105646||0x1f4;return function(_0x994ced){logger[_0x1abd('0x2a')](_0x994ced[_0x1abd('0x2b')]);if(_0x994ced[_0x1abd('0x2c')]){delete _0x994ced['name'];}_0x3b9894[_0x1abd('0x1e')](_0x105646)[_0x1abd('0x2d')](_0x994ced);};}exports[_0x1abd('0x2e')]=function(_0x2ba702,_0x578548){var _0x5c87ef={},_0x534790={},_0x457aa6={'count':0x0,'rows':[]};var _0x5d945b=_[_0x1abd('0x2f')](db[_0x1abd('0x30')][_0x1abd('0x31')],function(_0x315b10){return{'name':_0x315b10[_0x1abd('0x32')],'type':_0x315b10[_0x1abd('0x33')][_0x1abd('0x34')]};});_0x534790['model']=_[_0x1abd('0x2f')](_0x5d945b,_0x1abd('0x2c'));_0x534790[_0x1abd('0x35')]=_['keys'](_0x2ba702['query']);_0x534790[_0x1abd('0x36')]=_[_0x1abd('0x37')](_0x534790[_0x1abd('0x38')],_0x534790['query']);_0x5c87ef[_0x1abd('0x39')]=_[_0x1abd('0x37')](_0x534790['model'],qs[_0x1abd('0x3a')](_0x2ba702[_0x1abd('0x35')][_0x1abd('0x3a')]));_0x5c87ef[_0x1abd('0x39')]=_0x5c87ef[_0x1abd('0x39')]['length']?_0x5c87ef['attributes']:_0x534790[_0x1abd('0x38')];if(!_0x2ba702[_0x1abd('0x35')][_0x1abd('0x3b')](_0x1abd('0x3c'))){_0x5c87ef['limit']=qs['limit'](_0x2ba702[_0x1abd('0x35')][_0x1abd('0x3d')]);_0x5c87ef[_0x1abd('0x20')]=qs[_0x1abd('0x20')](_0x2ba702['query'][_0x1abd('0x20')]);}_0x5c87ef[_0x1abd('0x3e')]=qs[_0x1abd('0x3f')](_0x2ba702[_0x1abd('0x35')][_0x1abd('0x3f')]);_0x5c87ef[_0x1abd('0x40')]=qs['filters'](_[_0x1abd('0x41')](_0x2ba702[_0x1abd('0x35')],_0x534790[_0x1abd('0x36')]),_0x5d945b);if(_0x2ba702['query'][_0x1abd('0x42')]){_0x5c87ef[_0x1abd('0x40')]=_[_0x1abd('0x43')](_0x5c87ef['where'],{'$or':_[_0x1abd('0x2f')](_0x5d945b,function(_0x531dc4){if(_0x531dc4[_0x1abd('0x33')]!==_0x1abd('0x44')){var _0x37a895={};_0x37a895[_0x531dc4[_0x1abd('0x2c')]]={'$like':'%'+_0x2ba702[_0x1abd('0x35')][_0x1abd('0x42')]+'%'};return _0x37a895;}})});}_0x5c87ef=_[_0x1abd('0x43')]({},_0x5c87ef,_0x2ba702['options']);var _0x4cb161={'where':_0x5c87ef['where']};return db['Team'][_0x1abd('0x22')](_0x4cb161)[_0x1abd('0x28')](function(_0x5c8720){_0x457aa6[_0x1abd('0x22')]=_0x5c8720;if(_0x2ba702['query'][_0x1abd('0x45')]){_0x5c87ef[_0x1abd('0x46')]=[{'all':!![]}];}return db[_0x1abd('0x30')][_0x1abd('0x47')](_0x5c87ef);})[_0x1abd('0x28')](function(_0x4ced66){_0x457aa6[_0x1abd('0x48')]=_0x4ced66;return _0x457aa6;})[_0x1abd('0x28')](respondWithFilteredResult(_0x578548,_0x5c87ef))[_0x1abd('0x49')](handleError(_0x578548,null));};exports[_0x1abd('0x4a')]=function(_0x880ad5,_0x2e42ec){var _0x48a34f={'raw':![],'where':{'id':_0x880ad5[_0x1abd('0x4b')]['id']}},_0x45944c={};_0x45944c[_0x1abd('0x38')]=_[_0x1abd('0x4c')](db[_0x1abd('0x30')][_0x1abd('0x31')]);_0x45944c['query']=_['keys'](_0x880ad5['query']);_0x45944c[_0x1abd('0x36')]=_['intersection'](_0x45944c['model'],_0x45944c[_0x1abd('0x35')]);_0x48a34f[_0x1abd('0x39')]=_[_0x1abd('0x37')](_0x45944c[_0x1abd('0x38')],qs['fields'](_0x880ad5[_0x1abd('0x35')][_0x1abd('0x3a')]));_0x48a34f['attributes']=_0x48a34f[_0x1abd('0x39')][_0x1abd('0x4d')]?_0x48a34f[_0x1abd('0x39')]:_0x45944c['model'];if(_0x880ad5[_0x1abd('0x35')][_0x1abd('0x45')]){_0x48a34f[_0x1abd('0x46')]=[{'all':!![]}];}_0x48a34f=_[_0x1abd('0x43')]({},_0x48a34f,_0x880ad5['options']);return db[_0x1abd('0x30')][_0x1abd('0x4e')](_0x48a34f)[_0x1abd('0x28')](handleEntityNotFound(_0x2e42ec,null))[_0x1abd('0x28')](respondWithResult(_0x2e42ec,null))[_0x1abd('0x49')](handleError(_0x2e42ec,null));};exports[_0x1abd('0x4f')]=function(_0x3b8096,_0xf5d702){return db['Team'][_0x1abd('0x4f')](_0x3b8096[_0x1abd('0x50')],{})[_0x1abd('0x28')](function(_0x99da12){var _0x1041f1=_0x3b8096['user']['get']({'plain':!![]});if(!_0x1041f1)throw new Error(_0x1abd('0x51'));if(_0x1041f1['role']==='user'){var _0x1c715a=_0x99da12[_0x1abd('0x52')]({'plain':!![]});var _0xebc8d3=_0x1abd('0x53');return db[_0x1abd('0x54')]['find']({'where':{'name':_0xebc8d3,'userProfileId':_0x1041f1[_0x1abd('0x55')]},'raw':!![]})[_0x1abd('0x28')](function(_0x229860){if(_0x229860&&_0x229860[_0x1abd('0x56')]===0x0){return db[_0x1abd('0x57')][_0x1abd('0x4f')]({'name':_0x1c715a['name'],'resourceId':_0x1c715a['id'],'type':_0x229860['name'],'sectionId':_0x229860['id']},{})[_0x1abd('0x28')](function(){return _0x99da12;});}else{return _0x99da12;}})[_0x1abd('0x49')](function(_0x227d22){logger[_0x1abd('0x2a')](_0x1abd('0x58'),_0x227d22);throw _0x227d22;});}return _0x99da12;})[_0x1abd('0x28')](respondWithResult(_0xf5d702,0xc9))[_0x1abd('0x49')](handleError(_0xf5d702,null));};exports[_0x1abd('0x27')]=function(_0x24bbba,_0xfdd1d3){if(_0x24bbba[_0x1abd('0x50')]['id']){delete _0x24bbba[_0x1abd('0x50')]['id'];}return db[_0x1abd('0x30')][_0x1abd('0x4e')]({'where':{'id':_0x24bbba[_0x1abd('0x4b')]['id']}})[_0x1abd('0x28')](handleEntityNotFound(_0xfdd1d3,null))[_0x1abd('0x28')](saveUpdates(_0x24bbba[_0x1abd('0x50')],null))['then'](respondWithResult(_0xfdd1d3,null))[_0x1abd('0x49')](handleError(_0xfdd1d3,null));};exports[_0x1abd('0x59')]=function(_0x23d9e9,_0x4600a1){var _0x13d7e5=_0x23d9e9[_0x1abd('0x4b')]['id'];var _0x24aa87=[];return db[_0x1abd('0x5a')][_0x1abd('0x5b')](function(_0x589ca8){var _0x3309a8=_0x1abd('0x5c')+_0x13d7e5;return db[_0x1abd('0x5a')]['query'](_0x3309a8,{'type':db[_0x1abd('0x5d')][_0x1abd('0x5e')]['SELECT'],'raw':!![],'transaction':_0x589ca8})[_0x1abd('0x28')](function(_0x587a35){_0x24aa87=_[_0x1abd('0x2f')](_0x587a35,function(_0x11c7e5){return Number(_0x11c7e5['UserId']);});})[_0x1abd('0x28')](function(){var _0x3c1728='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x13d7e5;return db[_0x1abd('0x5a')][_0x1abd('0x35')](_0x3c1728,{'type':db[_0x1abd('0x5d')]['QueryTypes'][_0x1abd('0x5f')],'raw':!![],'transaction':_0x589ca8});})['then'](function(_0x485ed8){var _0x38399f=_['map'](_0x485ed8,function(_0x50a2fd){return Number(_0x50a2fd[_0x1abd('0x60')]);});return db[_0x1abd('0x61')][_0x1abd('0x59')]({'where':{'UserId':{'$in':_0x24aa87},'VoiceQueueId':{'$in':_0x38399f}},'transaction':_0x589ca8});})[_0x1abd('0x28')](function(){var _0x4bbd47='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x13d7e5;return db[_0x1abd('0x5a')][_0x1abd('0x35')](_0x4bbd47,{'type':db['Sequelize'][_0x1abd('0x5e')][_0x1abd('0x5f')],'raw':!![],'transaction':_0x589ca8});})[_0x1abd('0x28')](function(_0x309d3d){var _0x27aa6f=_[_0x1abd('0x2f')](_0x309d3d,function(_0x51a18a){return Number(_0x51a18a[_0x1abd('0x62')]);});return db[_0x1abd('0x63')][_0x1abd('0x59')]({'where':{'UserId':{'$in':_0x24aa87},'MailQueueId':{'$in':_0x27aa6f}},'transaction':_0x589ca8});})[_0x1abd('0x28')](function(){var _0x8db90d='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x13d7e5;return db[_0x1abd('0x5a')][_0x1abd('0x35')](_0x8db90d,{'type':db[_0x1abd('0x5d')][_0x1abd('0x5e')][_0x1abd('0x5f')],'raw':!![],'transaction':_0x589ca8});})['then'](function(_0x1e5fac){var _0x5296c2=_[_0x1abd('0x2f')](_0x1e5fac,function(_0x5d9106){return Number(_0x5d9106[_0x1abd('0x64')]);});return db[_0x1abd('0x65')][_0x1abd('0x59')]({'where':{'UserId':{'$in':_0x24aa87},'SmsQueueId':{'$in':_0x5296c2}},'transaction':_0x589ca8});})[_0x1abd('0x28')](function(){var _0x7da4d1=_0x1abd('0x66')+_0x13d7e5;return db[_0x1abd('0x5a')][_0x1abd('0x35')](_0x7da4d1,{'type':db[_0x1abd('0x5d')]['QueryTypes'][_0x1abd('0x5f')],'raw':!![],'transaction':_0x589ca8});})[_0x1abd('0x28')](function(_0x46bd75){var _0x1234cb=_[_0x1abd('0x2f')](_0x46bd75,function(_0x416201){return Number(_0x416201[_0x1abd('0x67')]);});return db[_0x1abd('0x68')][_0x1abd('0x59')]({'where':{'UserId':{'$in':_0x24aa87},'ChatQueueId':{'$in':_0x1234cb}},'transaction':_0x589ca8});})['then'](function(){var _0x31b5bb='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x13d7e5;return db[_0x1abd('0x5a')][_0x1abd('0x35')](_0x31b5bb,{'type':db[_0x1abd('0x5d')][_0x1abd('0x5e')][_0x1abd('0x5f')],'raw':!![],'transaction':_0x589ca8});})[_0x1abd('0x28')](function(_0x321653){var _0x15eaff=_[_0x1abd('0x2f')](_0x321653,function(_0x388e65){return Number(_0x388e65[_0x1abd('0x69')]);});return db['UserFaxQueue'][_0x1abd('0x59')]({'where':{'UserId':{'$in':_0x24aa87},'FaxQueueId':{'$in':_0x15eaff}},'transaction':_0x589ca8});})['then'](function(){var _0x32f16a=_0x1abd('0x6a')+_0x13d7e5;return db['sequelize'][_0x1abd('0x35')](_0x32f16a,{'type':db[_0x1abd('0x5d')][_0x1abd('0x5e')][_0x1abd('0x5f')],'raw':!![],'transaction':_0x589ca8});})['then'](function(_0x420701){var _0xd3716d=_[_0x1abd('0x2f')](_0x420701,function(_0x292408){return Number(_0x292408[_0x1abd('0x6b')]);});return db['UserOpenchannelQueue'][_0x1abd('0x59')]({'where':{'UserId':{'$in':_0x24aa87},'OpenchannelQueueId':{'$in':_0xd3716d}},'transaction':_0x589ca8});})[_0x1abd('0x28')](function(){var _0x5443b3='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x13d7e5;return db[_0x1abd('0x5a')]['query'](_0x5443b3,{'type':db[_0x1abd('0x5d')][_0x1abd('0x5e')][_0x1abd('0x5f')],'raw':!![],'transaction':_0x589ca8});})[_0x1abd('0x28')](function(_0x3b5533){var _0x1da660=_[_0x1abd('0x2f')](_0x3b5533,function(_0x3e75f8){return Number(_0x3e75f8[_0x1abd('0x6c')]);});return db['UserWhatsappQueue'][_0x1abd('0x59')]({'where':{'UserId':{'$in':_0x24aa87},'WhatsappQueueId':{'$in':_0x1da660}},'transaction':_0x589ca8});})[_0x1abd('0x28')](function(){return db['TeamVoicePrefix'][_0x1abd('0x4e')]({'where':{'TeamId':_0x13d7e5}});})['then'](function(_0x438629){if(_0x438629===null){return;}return db['UserVoicePrefix'][_0x1abd('0x59')]({'where':{'UserId':{'$in':_0x24aa87},'VoicePrefixId':_0x438629['VoicePrefixId']},'transaction':_0x589ca8});})['then'](function(){return db['Team'][_0x1abd('0x59')]({'where':{'id':_0x13d7e5},'cascade':!![],'transaction':_0x589ca8});})[_0x1abd('0x28')](function(_0x11f10f){if(_0x11f10f===0x0){_0x4600a1[_0x1abd('0x29')](0x194);}else{return db[_0x1abd('0x57')]['destroy']({'where':{'type':_0x1abd('0x53'),'resourceId':_0x13d7e5},'cascade':!![],'transaction':_0x589ca8})[_0x1abd('0x28')](function(){_0x4600a1[_0x1abd('0x1e')](0xcc)['end']();});}})[_0x1abd('0x49')](function(_0x1b7a4c){_0x4600a1[_0x1abd('0x1e')](0x1f4)[_0x1abd('0x2d')](_0x1b7a4c);});});};exports[_0x1abd('0x6d')]=function(_0x59e4e6,_0xd43bcf,_0x2907a9){return db[_0x1abd('0x30')][_0x1abd('0x6e')]({'where':{'id':_0x59e4e6[_0x1abd('0x4b')]['id']}})[_0x1abd('0x28')](handleEntityNotFound(_0xd43bcf,null))[_0x1abd('0x28')](function(_0x484700){if(!_0x59e4e6[_0x1abd('0x35')][_0x1abd('0x6f')]||!utils[_0x1abd('0x70')](_0x59e4e6['query']['channel'])){throw new db['Sequelize'][(_0x1abd('0x71'))](_0x1abd('0x72'));}var _0x34b7a6={};var _0x5384ec={};_0x5384ec[_0x1abd('0x38')]=_['keys'](db[_[_0x1abd('0x73')](_0x59e4e6[_0x1abd('0x35')]['channel'][_0x1abd('0x74')]())+_0x1abd('0x75')][_0x1abd('0x31')]);_0x5384ec['query']=_['keys'](_0x59e4e6[_0x1abd('0x35')]);_0x5384ec[_0x1abd('0x36')]=_[_0x1abd('0x37')](_0x5384ec['model'],_0x5384ec[_0x1abd('0x35')]);_0x34b7a6[_0x1abd('0x39')]=_[_0x1abd('0x37')](_0x5384ec[_0x1abd('0x38')],qs[_0x1abd('0x3a')](_0x59e4e6['query'][_0x1abd('0x3a')]));_0x34b7a6[_0x1abd('0x39')]=_0x34b7a6[_0x1abd('0x39')][_0x1abd('0x4d')]?_0x34b7a6['attributes']:_0x5384ec[_0x1abd('0x38')];_0x34b7a6[_0x1abd('0x3d')]=qs[_0x1abd('0x3d')](_0x59e4e6[_0x1abd('0x35')][_0x1abd('0x3d')]);_0x34b7a6['offset']=qs['offset'](_0x59e4e6[_0x1abd('0x35')]['offset']);_0x34b7a6[_0x1abd('0x3e')]=qs['sort'](_0x59e4e6['query'][_0x1abd('0x3f')]);_0x34b7a6[_0x1abd('0x40')]=qs[_0x1abd('0x36')](_[_0x1abd('0x41')](_0x59e4e6['query'],_0x5384ec[_0x1abd('0x36')]));_0x34b7a6=_[_0x1abd('0x43')]({},_0x34b7a6,_0x59e4e6[_0x1abd('0x76')]);return _0x484700[_0x1abd('0x52')+_['capitalize'](_0x59e4e6['query'][_0x1abd('0x6f')][_0x1abd('0x74')]())+_0x1abd('0x77')](_0x34b7a6);})[_0x1abd('0x28')](respondWithResult(_0xd43bcf,null))[_0x1abd('0x49')](handleError(_0xd43bcf,null));};exports['addQueues']=function(_0x4c3f7c,_0x1e8ca0,_0x39d724){return db['Team']['findOne']({'where':{'id':_0x4c3f7c[_0x1abd('0x4b')]['id']}})[_0x1abd('0x28')](function(_0x314546){if(_0x314546){if(!_0x4c3f7c[_0x1abd('0x50')][_0x1abd('0x6f')]||!utils[_0x1abd('0x70')](_0x4c3f7c[_0x1abd('0x50')][_0x1abd('0x6f')])){throw new db[(_0x1abd('0x5d'))]['ValidationError'](_0x1abd('0x72'));}return _0x314546['add'+_[_0x1abd('0x73')](_0x4c3f7c['body']['channel'][_0x1abd('0x74')]())+_0x1abd('0x77')](_0x4c3f7c[_0x1abd('0x50')][_0x1abd('0x78')]);}return null;})[_0x1abd('0x28')](handleEntityNotFound(_0x1e8ca0,null))['then'](respondWithStatusCode(_0x1e8ca0,null))[_0x1abd('0x49')](handleError(_0x1e8ca0,null));};exports[_0x1abd('0x79')]=function(_0x185390,_0xa1d789,_0x51ffd3){return db[_0x1abd('0x30')][_0x1abd('0x6e')]({'where':{'id':_0x185390[_0x1abd('0x4b')]['id']}})[_0x1abd('0x28')](function(_0x39d131){if(_0x39d131){if(!_0x185390[_0x1abd('0x35')]['channel']||!utils[_0x1abd('0x70')](_0x185390[_0x1abd('0x35')][_0x1abd('0x6f')])){throw new db[(_0x1abd('0x5d'))][(_0x1abd('0x71'))]('Unknown\x20channel');}return _0x39d131[_0x1abd('0x7a')+_[_0x1abd('0x73')](_0x185390[_0x1abd('0x35')]['channel'][_0x1abd('0x74')]())+_0x1abd('0x77')](_0x185390[_0x1abd('0x35')][_0x1abd('0x78')]);}return null;})['then'](handleEntityNotFound(_0xa1d789,null))[_0x1abd('0x28')](respondWithStatusCode(_0xa1d789,null))[_0x1abd('0x49')](handleError(_0xa1d789,null));};exports[_0x1abd('0x7b')]=function(_0x22eab4,_0x1e67af){var _0x2855dd=_[_0x1abd('0x7c')](_0x22eab4[_0x1abd('0x50')][_0x1abd('0x78')])?_0x22eab4[_0x1abd('0x50')][_0x1abd('0x78')]:[_0x22eab4[_0x1abd('0x50')]['ids']];var _0x34abe3=_0x22eab4[_0x1abd('0x4b')]['id'];return db[_0x1abd('0x30')][_0x1abd('0x4e')]({'where':{'id':_0x34abe3}})[_0x1abd('0x28')](handleEntityNotFound(_0x1e67af,null))[_0x1abd('0x28')](function(_0x33bba3){if(_0x33bba3){var _0x387184=['Voice',_0x1abd('0x7d'),_0x1abd('0x7e'),_0x1abd('0x7f'),_0x1abd('0x80'),'Openchannel','Whatsapp'];return db[_0x1abd('0x5a')][_0x1abd('0x5b')](function(_0x44fa0a){var _0x37d800=_[_0x1abd('0x2f')](_0x387184,function(_0x47284a){var _0x3ac88e={'attributes':['id',_0x1abd('0x2c')]};if(_0x47284a===_0x1abd('0x81')){_0x3ac88e['through']={'attributes':['penalty']};}return _0x33bba3[_0x1abd('0x52')+_0x47284a+_0x1abd('0x77')](_0x3ac88e)[_0x1abd('0x28')](function(_0x2db702){var _0x3f6dc3=_[_0x1abd('0x2f')](_0x2db702,function(_0x521289){var _0x1f817b=_['map'](_0x2855dd,function(_0x3ff018){var _0x1feb00={'where':{'UserId':_0x3ff018,[_0x47284a+'QueueId']:_0x521289['id']},'transaction':_0x44fa0a};if(_0x47284a==='Voice'){_0x1feb00[_0x1abd('0x1a')]={'penalty':_0x521289[_0x1abd('0x82')][_0x1abd('0x83')]};}return db[_0x1abd('0x84')+_0x47284a+_0x1abd('0x75')][_0x1abd('0x85')](_0x1feb00)[_0x1abd('0x28')](function(){socket['emit']('user'+_0x47284a+'Queue:save',{'UserId':_0x3ff018,[_0x47284a+_0x1abd('0x86')]:_0x521289['id']});if(_0x47284a!==_0x1abd('0x81')){return;}return db[_0x1abd('0x84')][_0x1abd('0x47')]({'where':{'id':_0x2855dd,'online':0x1},'attributes':['id',_0x1abd('0x2c'),_0x1abd('0x87'),_0x1abd('0x88'),'interface'],'raw':!![]})[_0x1abd('0x28')](function(_0x277387){var _0x37fc57=_[_0x1abd('0x2f')](_0x277387,function(_0x36d6f1){return db['UserVoiceQueueRt'][_0x1abd('0x89')]({'membername':_0x36d6f1[_0x1abd('0x2c')],'UserId':_0x36d6f1['id'],'queue_name':_0x521289['name'],'VoiceQueueId':_0x521289['id'],'interface':_[_0x1abd('0x8a')](_0x36d6f1[_0x1abd('0x8b')])?util['format']('SIP/%s',_0x36d6f1['name']):_0x36d6f1['interface'],'paused':_0x36d6f1[_0x1abd('0x88')]||![],'penalty':_0x521289['TeamVoiceQueue'][_0x1abd('0x83')]},{'transaction':_0x44fa0a});});return Promise['all'](_0x37fc57);});});});return Promise[_0x1abd('0x8c')](_0x1f817b);});return Promise[_0x1abd('0x8c')](_0x3f6dc3);})[_0x1abd('0x28')](function(){return db[_0x1abd('0x8d')]['findOne']({'where':{'teamId':_0x34abe3}})['then'](function(_0x1cbbe6){if(_0x1cbbe6){var _0x369cd3=_[_0x1abd('0x2f')](_0x2855dd,function(_0x1fa920){db[_0x1abd('0x8e')]['upsert']({'UserId':_0x1fa920,'VoicePrefixId':_0x1cbbe6[_0x1abd('0x8f')]});});return Promise[_0x1abd('0x8c')](_0x369cd3);}});});});return Promise[_0x1abd('0x8c')](_0x37d800)[_0x1abd('0x28')](function(){return _0x33bba3['addAgents'](_0x2855dd,{'transaction':_0x44fa0a})[_0x1abd('0x90')](function(_0x4a88a4){return _0x4a88a4;});});});}})[_0x1abd('0x28')](respondWithResult(_0x1e67af,null))[_0x1abd('0x49')](handleError(_0x1e67af,null));};exports['removeAgents']=function(_0xd2f3be,_0x22cded){var _0x120494=_[_0x1abd('0x7c')](_0xd2f3be['query'][_0x1abd('0x78')])?_0xd2f3be[_0x1abd('0x35')][_0x1abd('0x78')]:[_0xd2f3be[_0x1abd('0x35')]['ids']];var _0x330848=_0xd2f3be['params']['id'];return db[_0x1abd('0x30')]['find']({'where':{'id':_0x330848}})['then'](handleEntityNotFound(_0x22cded,null))[_0x1abd('0x28')](function(_0x5bfcbb){if(_0x5bfcbb){var _0x1c14ce=[_0x1abd('0x81'),'Chat',_0x1abd('0x7e'),'Sms','Fax','Openchannel','Whatsapp'];return db[_0x1abd('0x5a')][_0x1abd('0x5b')](function(_0x483b38){var _0x1c6116=_['map'](_0x1c14ce,function(_0x34d1c1){var _0x104490={'attributes':['id',_0x1abd('0x2c')]};return _0x5bfcbb[_0x1abd('0x52')+_0x34d1c1+'Queues'](_0x104490)[_0x1abd('0x28')](function(_0x54a4a4){var _0x5115bf=_['map'](_0x54a4a4,function(_0x1e90b1){return _0x1e90b1[_0x1abd('0x91')](_0x120494,{'transaction':_0x483b38})[_0x1abd('0x28')](function(){var _0x56ac2a=_[_0x1abd('0x2f')](_0x120494,function(_0x298fcf){socket[_0x1abd('0x92')]('user'+_0x34d1c1+_0x1abd('0x93'),{'UserId':Number(_0x298fcf),[_0x34d1c1+_0x1abd('0x86')]:_0x1e90b1['id']});if(_0x34d1c1!==_0x1abd('0x81')){return;}return db[_0x1abd('0x94')][_0x1abd('0x59')]({'where':{'VoiceQueueId':_0x1e90b1['id'],'UserId':_0x298fcf},'transaction':_0x483b38});});return Promise[_0x1abd('0x8c')](_0x56ac2a);});});return Promise[_0x1abd('0x8c')](_0x5115bf);});});return Promise[_0x1abd('0x8c')](_0x1c6116)[_0x1abd('0x28')](function(){return _0x5bfcbb[_0x1abd('0x91')](_0x120494,{'transaction':_0x483b38});})[_0x1abd('0x28')](function(){return db['TeamVoicePrefix'][_0x1abd('0x6e')]({'where':{'teamId':_0x330848}})[_0x1abd('0x28')](function(_0x37d5aa){if(_0x37d5aa){var _0x1e6de8=_[_0x1abd('0x2f')](_0x120494,function(_0x11940f){db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x11940f,'VoicePrefixId':_0x37d5aa[_0x1abd('0x8f')]}});});return Promise[_0x1abd('0x8c')](_0x1e6de8);}});});});}})['then'](respondWithStatusCode(_0x22cded,null))[_0x1abd('0x49')](handleError(_0x22cded,null));};exports['getAgents']=function(_0x179263,_0xb82dfa,_0x21b190){var _0xa83e2a={};var _0x54a6b7={};var _0x46c420;var _0x4a2ce8;return db['Team']['findOne']({'where':{'id':_0x179263[_0x1abd('0x4b')]['id']}})[_0x1abd('0x28')](handleEntityNotFound(_0xb82dfa,null))[_0x1abd('0x28')](function(_0x196afd){if(_0x196afd){_0x46c420=_0x196afd;_0x54a6b7[_0x1abd('0x38')]=_[_0x1abd('0x4c')](db[_0x1abd('0x84')][_0x1abd('0x31')]);_0x54a6b7[_0x1abd('0x35')]=_[_0x1abd('0x4c')](_0x179263[_0x1abd('0x35')]);_0x54a6b7[_0x1abd('0x36')]=_['intersection'](_0x54a6b7['model'],_0x54a6b7['query']);_0xa83e2a[_0x1abd('0x39')]=_[_0x1abd('0x37')](_0x54a6b7['model'],qs[_0x1abd('0x3a')](_0x179263[_0x1abd('0x35')][_0x1abd('0x3a')]));_0xa83e2a[_0x1abd('0x39')]=_0xa83e2a[_0x1abd('0x39')]['length']?_0xa83e2a[_0x1abd('0x39')]:_0x54a6b7['model'];_0xa83e2a['order']=qs[_0x1abd('0x3f')](_0x179263[_0x1abd('0x35')][_0x1abd('0x3f')]);_0xa83e2a[_0x1abd('0x40')]=qs[_0x1abd('0x36')](_['pick'](_0x179263[_0x1abd('0x35')],_0x54a6b7[_0x1abd('0x36')]));if(_0x179263[_0x1abd('0x35')][_0x1abd('0x42')]){_0xa83e2a[_0x1abd('0x40')]=_[_0x1abd('0x43')](_0xa83e2a[_0x1abd('0x40')],{'$or':_[_0x1abd('0x2f')](_0xa83e2a[_0x1abd('0x39')],function(_0x493e86){var _0x39f062={};_0x39f062[_0x493e86]={'$like':'%'+_0x179263['query'][_0x1abd('0x42')]+'%'};return _0x39f062;})});}_0xa83e2a=_['merge']({},_0xa83e2a,_0x179263[_0x1abd('0x76')]);return _0x46c420[_0x1abd('0x95')](_0xa83e2a);}})[_0x1abd('0x28')](function(_0x21c605){if(_0x21c605){_0x4a2ce8=_0x21c605[_0x1abd('0x4d')];if(!_0x179263[_0x1abd('0x35')]['hasOwnProperty'](_0x1abd('0x3c'))){_0xa83e2a[_0x1abd('0x3d')]=qs['limit'](_0x179263['query'][_0x1abd('0x3d')]);_0xa83e2a[_0x1abd('0x20')]=qs['offset'](_0x179263[_0x1abd('0x35')][_0x1abd('0x20')]);}return _0x46c420[_0x1abd('0x95')](_0xa83e2a);}})['then'](function(_0x5c4590){if(_0x5c4590){return _0x5c4590?{'count':_0x4a2ce8,'rows':_0x5c4590}:null;}})['then'](respondWithResult(_0xb82dfa,null))[_0x1abd('0x49')](handleError(_0xb82dfa,null));}; \ No newline at end of file +var _0x4be6=['options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserProfileResource','getQueues','findOne','isValidChannel','channel','toLowerCase','Queue','sort','capitalize','Queues','ValidationError','ids','removeQueues','Unknown\x20channel','isArray','Voice','Chat','Fax','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','findOrCreate','emit','User','online','interface','upsert','isNil','format','all','VoicePrefixId','addAgents','spread','Mail','Sms','Openchannel','removeAgents','Queue:remove','UserVoiceQueueRt','UserVoicePrefix','hasOwnProperty','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./team.socket','sendStatus','end','status','offset','limit','undefined','count','Content-Range','apply','reject','save','then','error','name','send','index','Team','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','where','pick','merge','map','type','VIRTUAL','filter','includeAll','findAll','rows','catch','show','fields'];(function(_0x49e4bc,_0x2f8162){var _0x437218=function(_0x48e9a1){while(--_0x48e9a1){_0x49e4bc['push'](_0x49e4bc['shift']());}};_0x437218(++_0x2f8162);}(_0x4be6,0xf0));var _0x64be=function(_0x3022ca,_0x20ea74){_0x3022ca=_0x3022ca-0x0;var _0x25b59b=_0x4be6[_0x3022ca];return _0x25b59b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x64be('0x0'));var zipdir=require(_0x64be('0x1'));var jsonpatch=require(_0x64be('0x2'));var rp=require(_0x64be('0x3'));var moment=require(_0x64be('0x4'));var BPromise=require(_0x64be('0x5'));var Mustache=require(_0x64be('0x6'));var util=require('util');var path=require(_0x64be('0x7'));var sox=require('sox');var csv=require(_0x64be('0x8'));var ejs=require(_0x64be('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x64be('0xa'));var squel=require(_0x64be('0xb'));var crypto=require(_0x64be('0xc'));var jsforce=require(_0x64be('0xd'));var deskjs=require(_0x64be('0xe'));var toCsv=require(_0x64be('0x8'));var querystring=require(_0x64be('0xf'));var Papa=require(_0x64be('0x10'));var Redis=require(_0x64be('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x64be('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x64be('0x13'));var logger=require(_0x64be('0x14'))(_0x64be('0x15'));var utils=require(_0x64be('0x16'));var config=require(_0x64be('0x17'));var licenseUtil=require(_0x64be('0x18'));var db=require(_0x64be('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x64be('0x1a'),'port':0x18eb});var socket=require(_0x64be('0x1b'))(new Redis(config[_0x64be('0x1c')]));require(_0x64be('0x1d'))['register'](socket);function respondWithStatusCode(_0x5cf6dd,_0x3fe220){_0x3fe220=_0x3fe220||0xcc;return function(_0x355b7c){if(_0x355b7c){return _0x5cf6dd[_0x64be('0x1e')](_0x3fe220);}return _0x5cf6dd['status'](_0x3fe220)[_0x64be('0x1f')]();};}function respondWithResult(_0xfb4e4,_0x195ec8){_0x195ec8=_0x195ec8||0xc8;return function(_0x43c84d){if(_0x43c84d){return _0xfb4e4[_0x64be('0x20')](_0x195ec8)['json'](_0x43c84d);}};}function respondWithFilteredResult(_0x211986,_0x4cf076){return function(_0x10c26c){if(_0x10c26c){var _0x1b093a=typeof _0x4cf076[_0x64be('0x21')]==='undefined'&&typeof _0x4cf076[_0x64be('0x22')]===_0x64be('0x23');var _0x16219c=_0x10c26c[_0x64be('0x24')];var _0x168597=_0x1b093a?0x0:_0x4cf076[_0x64be('0x21')];var _0x2ed782=_0x1b093a?_0x10c26c[_0x64be('0x24')]:_0x4cf076[_0x64be('0x21')]+_0x4cf076[_0x64be('0x22')];var _0x5d897b;if(_0x2ed782>=_0x16219c){_0x2ed782=_0x16219c;_0x5d897b=0xc8;}else{_0x5d897b=0xce;}_0x211986['status'](_0x5d897b);return _0x211986['set'](_0x64be('0x25'),_0x168597+'-'+_0x2ed782+'/'+_0x16219c)['json'](_0x10c26c);}return null;};}function patchUpdates(_0x40c666){return function(_0x1a71c3){try{jsonpatch[_0x64be('0x26')](_0x1a71c3,_0x40c666,!![]);}catch(_0x3c7803){return BPromise[_0x64be('0x27')](_0x3c7803);}return _0x1a71c3[_0x64be('0x28')]();};}function saveUpdates(_0x4f02a9,_0x1b51ed){return function(_0x1de6e4){if(_0x1de6e4){return _0x1de6e4['update'](_0x4f02a9)[_0x64be('0x29')](function(_0x3fa7ae){return _0x3fa7ae;});}return null;};}function handleEntityNotFound(_0x355fa2,_0x4d7142){return function(_0x1a538b){if(!_0x1a538b){_0x355fa2['sendStatus'](0x194);}return _0x1a538b;};}function handleError(_0x2cb4cf,_0x278f2b){_0x278f2b=_0x278f2b||0x1f4;return function(_0x1bfc1c){logger[_0x64be('0x2a')](_0x1bfc1c['stack']);if(_0x1bfc1c[_0x64be('0x2b')]){delete _0x1bfc1c[_0x64be('0x2b')];}_0x2cb4cf[_0x64be('0x20')](_0x278f2b)[_0x64be('0x2c')](_0x1bfc1c);};}exports[_0x64be('0x2d')]=function(_0x24723c,_0x48ec28){var _0x11aad6={},_0x54fff7={},_0x35957f={'count':0x0,'rows':[]};var _0x2eee65=_['map'](db[_0x64be('0x2e')][_0x64be('0x2f')],function(_0x176d4d){return{'name':_0x176d4d[_0x64be('0x30')],'type':_0x176d4d['type'][_0x64be('0x31')]};});_0x54fff7[_0x64be('0x32')]=_['map'](_0x2eee65,_0x64be('0x2b'));_0x54fff7[_0x64be('0x33')]=_[_0x64be('0x34')](_0x24723c['query']);_0x54fff7[_0x64be('0x35')]=_[_0x64be('0x36')](_0x54fff7[_0x64be('0x32')],_0x54fff7[_0x64be('0x33')]);_0x11aad6[_0x64be('0x37')]=_[_0x64be('0x36')](_0x54fff7[_0x64be('0x32')],qs['fields'](_0x24723c[_0x64be('0x33')]['fields']));_0x11aad6[_0x64be('0x37')]=_0x11aad6[_0x64be('0x37')][_0x64be('0x38')]?_0x11aad6[_0x64be('0x37')]:_0x54fff7[_0x64be('0x32')];if(!_0x24723c[_0x64be('0x33')]['hasOwnProperty'](_0x64be('0x39'))){_0x11aad6[_0x64be('0x22')]=qs[_0x64be('0x22')](_0x24723c[_0x64be('0x33')][_0x64be('0x22')]);_0x11aad6[_0x64be('0x21')]=qs[_0x64be('0x21')](_0x24723c[_0x64be('0x33')][_0x64be('0x21')]);}_0x11aad6[_0x64be('0x3a')]=qs['sort'](_0x24723c[_0x64be('0x33')]['sort']);_0x11aad6[_0x64be('0x3b')]=qs[_0x64be('0x35')](_[_0x64be('0x3c')](_0x24723c[_0x64be('0x33')],_0x54fff7['filters']),_0x2eee65);if(_0x24723c['query']['filter']){_0x11aad6['where']=_[_0x64be('0x3d')](_0x11aad6['where'],{'$or':_[_0x64be('0x3e')](_0x2eee65,function(_0x5f08f2){if(_0x5f08f2[_0x64be('0x3f')]!==_0x64be('0x40')){var _0x199a89={};_0x199a89[_0x5f08f2[_0x64be('0x2b')]]={'$like':'%'+_0x24723c[_0x64be('0x33')][_0x64be('0x41')]+'%'};return _0x199a89;}})});}_0x11aad6=_[_0x64be('0x3d')]({},_0x11aad6,_0x24723c['options']);var _0x1ffb8e={'where':_0x11aad6[_0x64be('0x3b')]};return db[_0x64be('0x2e')]['count'](_0x1ffb8e)[_0x64be('0x29')](function(_0x3228cd){_0x35957f['count']=_0x3228cd;if(_0x24723c[_0x64be('0x33')][_0x64be('0x42')]){_0x11aad6['include']=[{'all':!![]}];}return db[_0x64be('0x2e')][_0x64be('0x43')](_0x11aad6);})[_0x64be('0x29')](function(_0x1f9c6e){_0x35957f[_0x64be('0x44')]=_0x1f9c6e;return _0x35957f;})['then'](respondWithFilteredResult(_0x48ec28,_0x11aad6))[_0x64be('0x45')](handleError(_0x48ec28,null));};exports[_0x64be('0x46')]=function(_0x27d581,_0x11afa6){var _0x1f5906={'raw':![],'where':{'id':_0x27d581['params']['id']}},_0x1cda86={};_0x1cda86[_0x64be('0x32')]=_[_0x64be('0x34')](db['Team'][_0x64be('0x2f')]);_0x1cda86[_0x64be('0x33')]=_[_0x64be('0x34')](_0x27d581['query']);_0x1cda86[_0x64be('0x35')]=_[_0x64be('0x36')](_0x1cda86['model'],_0x1cda86['query']);_0x1f5906[_0x64be('0x37')]=_[_0x64be('0x36')](_0x1cda86['model'],qs[_0x64be('0x47')](_0x27d581[_0x64be('0x33')][_0x64be('0x47')]));_0x1f5906[_0x64be('0x37')]=_0x1f5906['attributes'][_0x64be('0x38')]?_0x1f5906[_0x64be('0x37')]:_0x1cda86[_0x64be('0x32')];if(_0x27d581[_0x64be('0x33')]['includeAll']){_0x1f5906['include']=[{'all':!![]}];}_0x1f5906=_[_0x64be('0x3d')]({},_0x1f5906,_0x27d581[_0x64be('0x48')]);return db['Team']['find'](_0x1f5906)[_0x64be('0x29')](handleEntityNotFound(_0x11afa6,null))['then'](respondWithResult(_0x11afa6,null))[_0x64be('0x45')](handleError(_0x11afa6,null));};exports[_0x64be('0x49')]=function(_0x3716e5,_0x58d6c1){return db[_0x64be('0x2e')]['create'](_0x3716e5[_0x64be('0x4a')],{})[_0x64be('0x29')](function(_0x732b2e){var _0x435994=_0x3716e5[_0x64be('0x4b')][_0x64be('0x4c')]({'plain':!![]});if(!_0x435994)throw new Error(_0x64be('0x4d'));if(_0x435994[_0x64be('0x4e')]===_0x64be('0x4b')){var _0x9e2719=_0x732b2e['get']({'plain':!![]});var _0x511ca4=_0x64be('0x4f');return db['UserProfileSection'][_0x64be('0x50')]({'where':{'name':_0x511ca4,'userProfileId':_0x435994[_0x64be('0x51')]},'raw':!![]})['then'](function(_0x2cabf5){if(_0x2cabf5&&_0x2cabf5[_0x64be('0x52')]===0x0){return db['UserProfileResource'][_0x64be('0x49')]({'name':_0x9e2719[_0x64be('0x2b')],'resourceId':_0x9e2719['id'],'type':_0x2cabf5[_0x64be('0x2b')],'sectionId':_0x2cabf5['id']},{})['then'](function(){return _0x732b2e;});}else{return _0x732b2e;}})[_0x64be('0x45')](function(_0x2dfc8e){logger['error'](_0x64be('0x53'),_0x2dfc8e);throw _0x2dfc8e;});}return _0x732b2e;})[_0x64be('0x29')](respondWithResult(_0x58d6c1,0xc9))['catch'](handleError(_0x58d6c1,null));};exports[_0x64be('0x54')]=function(_0x43dd79,_0x13558b){if(_0x43dd79[_0x64be('0x4a')]['id']){delete _0x43dd79[_0x64be('0x4a')]['id'];}return db[_0x64be('0x2e')][_0x64be('0x50')]({'where':{'id':_0x43dd79[_0x64be('0x55')]['id']}})['then'](handleEntityNotFound(_0x13558b,null))[_0x64be('0x29')](saveUpdates(_0x43dd79[_0x64be('0x4a')],null))[_0x64be('0x29')](respondWithResult(_0x13558b,null))[_0x64be('0x45')](handleError(_0x13558b,null));};exports[_0x64be('0x56')]=function(_0x63ef42,_0x3457b8){var _0x21af2b=_0x63ef42[_0x64be('0x55')]['id'];var _0x2fe113=[];return db[_0x64be('0x57')][_0x64be('0x58')](function(_0x4e51a9){var _0x143789=_0x64be('0x59')+_0x21af2b;return db['sequelize'][_0x64be('0x33')](_0x143789,{'type':db[_0x64be('0x5a')]['QueryTypes'][_0x64be('0x5b')],'raw':!![],'transaction':_0x4e51a9})[_0x64be('0x29')](function(_0x4c199c){_0x2fe113=_[_0x64be('0x3e')](_0x4c199c,function(_0x183806){return Number(_0x183806[_0x64be('0x5c')]);});})[_0x64be('0x29')](function(){var _0x1de493=_0x64be('0x5d')+_0x21af2b;return db[_0x64be('0x57')][_0x64be('0x33')](_0x1de493,{'type':db['Sequelize'][_0x64be('0x5e')][_0x64be('0x5b')],'raw':!![],'transaction':_0x4e51a9});})[_0x64be('0x29')](function(_0x2fc754){var _0x9e538a=_['map'](_0x2fc754,function(_0x2af798){return Number(_0x2af798[_0x64be('0x5f')]);});return db[_0x64be('0x60')][_0x64be('0x56')]({'where':{'UserId':{'$in':_0x2fe113},'VoiceQueueId':{'$in':_0x9e538a}},'transaction':_0x4e51a9});})[_0x64be('0x29')](function(){var _0x2c5604=_0x64be('0x61')+_0x21af2b;return db[_0x64be('0x57')]['query'](_0x2c5604,{'type':db[_0x64be('0x5a')][_0x64be('0x5e')][_0x64be('0x5b')],'raw':!![],'transaction':_0x4e51a9});})[_0x64be('0x29')](function(_0x46ee55){var _0x5e859c=_['map'](_0x46ee55,function(_0x34fa7b){return Number(_0x34fa7b[_0x64be('0x62')]);});return db[_0x64be('0x63')][_0x64be('0x56')]({'where':{'UserId':{'$in':_0x2fe113},'MailQueueId':{'$in':_0x5e859c}},'transaction':_0x4e51a9});})[_0x64be('0x29')](function(){var _0x3e0097=_0x64be('0x64')+_0x21af2b;return db[_0x64be('0x57')]['query'](_0x3e0097,{'type':db[_0x64be('0x5a')][_0x64be('0x5e')][_0x64be('0x5b')],'raw':!![],'transaction':_0x4e51a9});})[_0x64be('0x29')](function(_0x446c4c){var _0x21d039=_[_0x64be('0x3e')](_0x446c4c,function(_0x27b643){return Number(_0x27b643[_0x64be('0x65')]);});return db[_0x64be('0x66')]['destroy']({'where':{'UserId':{'$in':_0x2fe113},'SmsQueueId':{'$in':_0x21d039}},'transaction':_0x4e51a9});})['then'](function(){var _0x3db714='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x21af2b;return db[_0x64be('0x57')][_0x64be('0x33')](_0x3db714,{'type':db[_0x64be('0x5a')][_0x64be('0x5e')]['SELECT'],'raw':!![],'transaction':_0x4e51a9});})[_0x64be('0x29')](function(_0x52debd){var _0x32475a=_[_0x64be('0x3e')](_0x52debd,function(_0x3b469e){return Number(_0x3b469e['ChatQueueId']);});return db[_0x64be('0x67')]['destroy']({'where':{'UserId':{'$in':_0x2fe113},'ChatQueueId':{'$in':_0x32475a}},'transaction':_0x4e51a9});})['then'](function(){var _0x138334=_0x64be('0x68')+_0x21af2b;return db[_0x64be('0x57')][_0x64be('0x33')](_0x138334,{'type':db[_0x64be('0x5a')]['QueryTypes'][_0x64be('0x5b')],'raw':!![],'transaction':_0x4e51a9});})[_0x64be('0x29')](function(_0x12b94c){var _0x172fb2=_[_0x64be('0x3e')](_0x12b94c,function(_0x50c9d2){return Number(_0x50c9d2[_0x64be('0x69')]);});return db['UserFaxQueue'][_0x64be('0x56')]({'where':{'UserId':{'$in':_0x2fe113},'FaxQueueId':{'$in':_0x172fb2}},'transaction':_0x4e51a9});})[_0x64be('0x29')](function(){var _0x401894=_0x64be('0x6a')+_0x21af2b;return db[_0x64be('0x57')]['query'](_0x401894,{'type':db['Sequelize'][_0x64be('0x5e')][_0x64be('0x5b')],'raw':!![],'transaction':_0x4e51a9});})['then'](function(_0x202c9e){var _0x52f2f9=_[_0x64be('0x3e')](_0x202c9e,function(_0xd9fd22){return Number(_0xd9fd22['OpenchannelQueueId']);});return db[_0x64be('0x6b')][_0x64be('0x56')]({'where':{'UserId':{'$in':_0x2fe113},'OpenchannelQueueId':{'$in':_0x52f2f9}},'transaction':_0x4e51a9});})[_0x64be('0x29')](function(){var _0x584641=_0x64be('0x6c')+_0x21af2b;return db[_0x64be('0x57')][_0x64be('0x33')](_0x584641,{'type':db[_0x64be('0x5a')][_0x64be('0x5e')][_0x64be('0x5b')],'raw':!![],'transaction':_0x4e51a9});})[_0x64be('0x29')](function(_0x232129){var _0x61d67f=_['map'](_0x232129,function(_0x2c3fe0){return Number(_0x2c3fe0[_0x64be('0x6d')]);});return db[_0x64be('0x6e')]['destroy']({'where':{'UserId':{'$in':_0x2fe113},'WhatsappQueueId':{'$in':_0x61d67f}},'transaction':_0x4e51a9});})[_0x64be('0x29')](function(){return db[_0x64be('0x6f')][_0x64be('0x50')]({'where':{'TeamId':_0x21af2b}});})[_0x64be('0x29')](function(_0x125bba){if(_0x125bba===null){return;}return db['UserVoicePrefix'][_0x64be('0x56')]({'where':{'UserId':{'$in':_0x2fe113},'VoicePrefixId':_0x125bba['VoicePrefixId']},'transaction':_0x4e51a9});})['then'](function(){return db[_0x64be('0x2e')][_0x64be('0x56')]({'where':{'id':_0x21af2b},'cascade':!![],'transaction':_0x4e51a9});})[_0x64be('0x29')](function(_0xa232a3){if(_0xa232a3===0x0){_0x3457b8[_0x64be('0x1e')](0x194);}else{return db[_0x64be('0x70')][_0x64be('0x56')]({'where':{'type':_0x64be('0x4f'),'resourceId':_0x21af2b},'cascade':!![],'transaction':_0x4e51a9})['then'](function(){_0x3457b8[_0x64be('0x20')](0xcc)[_0x64be('0x1f')]();});}})['catch'](function(_0x517ecf){_0x3457b8[_0x64be('0x20')](0x1f4)[_0x64be('0x2c')](_0x517ecf);});});};exports[_0x64be('0x71')]=function(_0x2acb35,_0x2d4a72,_0x3671e5){return db[_0x64be('0x2e')][_0x64be('0x72')]({'where':{'id':_0x2acb35[_0x64be('0x55')]['id']}})[_0x64be('0x29')](handleEntityNotFound(_0x2d4a72,null))[_0x64be('0x29')](function(_0x347bb0){if(!_0x2acb35[_0x64be('0x33')]['channel']||!utils[_0x64be('0x73')](_0x2acb35[_0x64be('0x33')][_0x64be('0x74')])){throw new db[(_0x64be('0x5a'))]['ValidationError']('Unknown\x20channel');}var _0x24c8fb={};var _0xdb635a={};_0xdb635a[_0x64be('0x32')]=_[_0x64be('0x34')](db[_['capitalize'](_0x2acb35['query'][_0x64be('0x74')][_0x64be('0x75')]())+_0x64be('0x76')][_0x64be('0x2f')]);_0xdb635a[_0x64be('0x33')]=_[_0x64be('0x34')](_0x2acb35[_0x64be('0x33')]);_0xdb635a[_0x64be('0x35')]=_[_0x64be('0x36')](_0xdb635a[_0x64be('0x32')],_0xdb635a[_0x64be('0x33')]);_0x24c8fb[_0x64be('0x37')]=_['intersection'](_0xdb635a[_0x64be('0x32')],qs[_0x64be('0x47')](_0x2acb35[_0x64be('0x33')][_0x64be('0x47')]));_0x24c8fb[_0x64be('0x37')]=_0x24c8fb[_0x64be('0x37')][_0x64be('0x38')]?_0x24c8fb['attributes']:_0xdb635a[_0x64be('0x32')];_0x24c8fb[_0x64be('0x22')]=qs['limit'](_0x2acb35[_0x64be('0x33')][_0x64be('0x22')]);_0x24c8fb[_0x64be('0x21')]=qs['offset'](_0x2acb35[_0x64be('0x33')][_0x64be('0x21')]);_0x24c8fb[_0x64be('0x3a')]=qs[_0x64be('0x77')](_0x2acb35['query']['sort']);_0x24c8fb[_0x64be('0x3b')]=qs[_0x64be('0x35')](_[_0x64be('0x3c')](_0x2acb35[_0x64be('0x33')],_0xdb635a[_0x64be('0x35')]));_0x24c8fb=_[_0x64be('0x3d')]({},_0x24c8fb,_0x2acb35['options']);return _0x347bb0['get'+_[_0x64be('0x78')](_0x2acb35['query']['channel']['toLowerCase']())+_0x64be('0x79')](_0x24c8fb);})['then'](respondWithResult(_0x2d4a72,null))[_0x64be('0x45')](handleError(_0x2d4a72,null));};exports['addQueues']=function(_0x1cd510,_0x3ab811,_0x152912){return db[_0x64be('0x2e')][_0x64be('0x72')]({'where':{'id':_0x1cd510['params']['id']}})[_0x64be('0x29')](function(_0x38615b){if(_0x38615b){if(!_0x1cd510[_0x64be('0x4a')][_0x64be('0x74')]||!utils[_0x64be('0x73')](_0x1cd510[_0x64be('0x4a')][_0x64be('0x74')])){throw new db[(_0x64be('0x5a'))][(_0x64be('0x7a'))]('Unknown\x20channel');}return _0x38615b['add'+_[_0x64be('0x78')](_0x1cd510[_0x64be('0x4a')][_0x64be('0x74')][_0x64be('0x75')]())+_0x64be('0x79')](_0x1cd510[_0x64be('0x4a')][_0x64be('0x7b')]);}return null;})[_0x64be('0x29')](handleEntityNotFound(_0x3ab811,null))['then'](respondWithStatusCode(_0x3ab811,null))['catch'](handleError(_0x3ab811,null));};exports[_0x64be('0x7c')]=function(_0x3c1f4f,_0x1cdac2,_0x46403d){return db[_0x64be('0x2e')][_0x64be('0x72')]({'where':{'id':_0x3c1f4f[_0x64be('0x55')]['id']}})[_0x64be('0x29')](function(_0x2719c1){if(_0x2719c1){if(!_0x3c1f4f[_0x64be('0x33')][_0x64be('0x74')]||!utils[_0x64be('0x73')](_0x3c1f4f[_0x64be('0x33')][_0x64be('0x74')])){throw new db[(_0x64be('0x5a'))]['ValidationError'](_0x64be('0x7d'));}return _0x2719c1['remove'+_['capitalize'](_0x3c1f4f[_0x64be('0x33')][_0x64be('0x74')][_0x64be('0x75')]())+_0x64be('0x79')](_0x3c1f4f[_0x64be('0x33')][_0x64be('0x7b')]);}return null;})[_0x64be('0x29')](handleEntityNotFound(_0x1cdac2,null))[_0x64be('0x29')](respondWithStatusCode(_0x1cdac2,null))[_0x64be('0x45')](handleError(_0x1cdac2,null));};exports['addAgents']=function(_0x51e06b,_0x4f0f73){var _0x1f5d5c=_[_0x64be('0x7e')](_0x51e06b[_0x64be('0x4a')][_0x64be('0x7b')])?_0x51e06b['body']['ids']:[_0x51e06b[_0x64be('0x4a')]['ids']];var _0x2ad16f=_0x51e06b[_0x64be('0x55')]['id'];return db['Team'][_0x64be('0x50')]({'where':{'id':_0x2ad16f}})[_0x64be('0x29')](handleEntityNotFound(_0x4f0f73,null))[_0x64be('0x29')](function(_0x516e99){if(_0x516e99){var _0xec640b=[_0x64be('0x7f'),_0x64be('0x80'),'Mail','Sms',_0x64be('0x81'),'Openchannel',_0x64be('0x82')];return db[_0x64be('0x57')][_0x64be('0x58')](function(_0x5d84c8){var _0x3e0918=_['map'](_0xec640b,function(_0x1182a6){var _0x1b84fb={'attributes':['id',_0x64be('0x2b')]};if(_0x1182a6===_0x64be('0x7f')){_0x1b84fb[_0x64be('0x83')]={'attributes':[_0x64be('0x84')]};}return _0x516e99['get'+_0x1182a6+'Queues'](_0x1b84fb)[_0x64be('0x29')](function(_0x36a9ba){var _0xdc7be8=_[_0x64be('0x3e')](_0x36a9ba,function(_0xf0c8ce){var _0x3e02cd=_[_0x64be('0x3e')](_0x1f5d5c,function(_0x43a5f1){var _0x5c7a27={'where':{'UserId':_0x43a5f1,[_0x1182a6+_0x64be('0x85')]:_0xf0c8ce['id']},'transaction':_0x5d84c8};if(_0x1182a6===_0x64be('0x7f')){_0x5c7a27['defaults']={'penalty':_0xf0c8ce[_0x64be('0x86')][_0x64be('0x84')]};}return db['User'+_0x1182a6+_0x64be('0x76')][_0x64be('0x87')](_0x5c7a27)[_0x64be('0x29')](function(){socket[_0x64be('0x88')](_0x64be('0x4b')+_0x1182a6+'Queue:save',{'UserId':_0x43a5f1,[_0x1182a6+_0x64be('0x85')]:_0xf0c8ce['id']});if(_0x1182a6!=='Voice'){return;}return db[_0x64be('0x89')][_0x64be('0x43')]({'where':{'id':_0x1f5d5c,'online':0x1},'attributes':['id',_0x64be('0x2b'),_0x64be('0x8a'),'voicePause',_0x64be('0x8b')],'raw':!![]})[_0x64be('0x29')](function(_0x441461){var _0x49ad65=_[_0x64be('0x3e')](_0x441461,function(_0x507436){return db['UserVoiceQueueRt'][_0x64be('0x8c')]({'membername':_0x507436['name'],'UserId':_0x507436['id'],'queue_name':_0xf0c8ce[_0x64be('0x2b')],'VoiceQueueId':_0xf0c8ce['id'],'interface':_[_0x64be('0x8d')](_0x507436[_0x64be('0x8b')])?util[_0x64be('0x8e')]('SIP/%s',_0x507436[_0x64be('0x2b')]):_0x507436[_0x64be('0x8b')],'paused':_0x507436['voicePause']||![],'penalty':_0xf0c8ce[_0x64be('0x86')][_0x64be('0x84')]},{'transaction':_0x5d84c8});});return Promise[_0x64be('0x8f')](_0x49ad65);});});});return Promise[_0x64be('0x8f')](_0x3e02cd);});return Promise[_0x64be('0x8f')](_0xdc7be8);})[_0x64be('0x29')](function(){return db[_0x64be('0x6f')][_0x64be('0x72')]({'where':{'teamId':_0x2ad16f}})[_0x64be('0x29')](function(_0x481c05){if(_0x481c05){var _0x55d55c=_[_0x64be('0x3e')](_0x1f5d5c,function(_0x352440){db['UserVoicePrefix'][_0x64be('0x8c')]({'UserId':_0x352440,'VoicePrefixId':_0x481c05[_0x64be('0x90')]});});return Promise['all'](_0x55d55c);}});});});return Promise['all'](_0x3e0918)[_0x64be('0x29')](function(){return _0x516e99[_0x64be('0x91')](_0x1f5d5c,{'transaction':_0x5d84c8})[_0x64be('0x92')](function(_0x1a809f){return _0x1a809f;});});});}})[_0x64be('0x29')](respondWithResult(_0x4f0f73,null))[_0x64be('0x45')](handleError(_0x4f0f73,null));};exports['removeAgents']=function(_0x28045d,_0x5a949c){var _0x323d2f=_[_0x64be('0x7e')](_0x28045d[_0x64be('0x33')][_0x64be('0x7b')])?_0x28045d['query'][_0x64be('0x7b')]:[_0x28045d[_0x64be('0x33')][_0x64be('0x7b')]];var _0x136abd=_0x28045d[_0x64be('0x55')]['id'];return db['Team']['find']({'where':{'id':_0x136abd}})['then'](handleEntityNotFound(_0x5a949c,null))[_0x64be('0x29')](function(_0x3d1425){if(_0x3d1425){var _0x318b88=[_0x64be('0x7f'),_0x64be('0x80'),_0x64be('0x93'),_0x64be('0x94'),_0x64be('0x81'),_0x64be('0x95'),'Whatsapp'];return db[_0x64be('0x57')][_0x64be('0x58')](function(_0x5e22f7){var _0x24fdf0=_[_0x64be('0x3e')](_0x318b88,function(_0x1defa7){var _0x30f399={'attributes':['id',_0x64be('0x2b')]};return _0x3d1425['get'+_0x1defa7+_0x64be('0x79')](_0x30f399)['then'](function(_0x3b7097){var _0x146684=_[_0x64be('0x3e')](_0x3b7097,function(_0x313d80){return _0x313d80[_0x64be('0x96')](_0x323d2f,{'transaction':_0x5e22f7})[_0x64be('0x29')](function(){var _0x55878a=_[_0x64be('0x3e')](_0x323d2f,function(_0x46d7b0){socket[_0x64be('0x88')](_0x64be('0x4b')+_0x1defa7+_0x64be('0x97'),{'UserId':Number(_0x46d7b0),[_0x1defa7+'QueueId']:_0x313d80['id']});if(_0x1defa7!==_0x64be('0x7f')){return;}return db[_0x64be('0x98')][_0x64be('0x56')]({'where':{'VoiceQueueId':_0x313d80['id'],'UserId':_0x46d7b0},'transaction':_0x5e22f7});});return Promise[_0x64be('0x8f')](_0x55878a);});});return Promise['all'](_0x146684);});});return Promise[_0x64be('0x8f')](_0x24fdf0)[_0x64be('0x29')](function(){return _0x3d1425[_0x64be('0x96')](_0x323d2f,{'transaction':_0x5e22f7});})['then'](function(){return db[_0x64be('0x6f')][_0x64be('0x72')]({'where':{'teamId':_0x136abd}})[_0x64be('0x29')](function(_0x3223fb){if(_0x3223fb){var _0x332d48=_[_0x64be('0x3e')](_0x323d2f,function(_0x443c1c){db[_0x64be('0x99')][_0x64be('0x56')]({'where':{'UserId':_0x443c1c,'VoicePrefixId':_0x3223fb[_0x64be('0x90')]}});});return Promise[_0x64be('0x8f')](_0x332d48);}});});});}})[_0x64be('0x29')](respondWithStatusCode(_0x5a949c,null))['catch'](handleError(_0x5a949c,null));};exports['getAgents']=function(_0x34a0ea,_0x26c6b9,_0x41decf){var _0x3bd54e={};var _0x26cf52={};var _0x16d999;var _0x1f5f1c;return db[_0x64be('0x2e')][_0x64be('0x72')]({'where':{'id':_0x34a0ea[_0x64be('0x55')]['id']}})[_0x64be('0x29')](handleEntityNotFound(_0x26c6b9,null))['then'](function(_0x5ad940){if(_0x5ad940){_0x16d999=_0x5ad940;_0x26cf52['model']=_[_0x64be('0x34')](db[_0x64be('0x89')][_0x64be('0x2f')]);_0x26cf52[_0x64be('0x33')]=_[_0x64be('0x34')](_0x34a0ea['query']);_0x26cf52[_0x64be('0x35')]=_[_0x64be('0x36')](_0x26cf52[_0x64be('0x32')],_0x26cf52[_0x64be('0x33')]);_0x3bd54e[_0x64be('0x37')]=_[_0x64be('0x36')](_0x26cf52[_0x64be('0x32')],qs[_0x64be('0x47')](_0x34a0ea['query'][_0x64be('0x47')]));_0x3bd54e[_0x64be('0x37')]=_0x3bd54e[_0x64be('0x37')][_0x64be('0x38')]?_0x3bd54e['attributes']:_0x26cf52[_0x64be('0x32')];_0x3bd54e[_0x64be('0x3a')]=qs[_0x64be('0x77')](_0x34a0ea[_0x64be('0x33')][_0x64be('0x77')]);_0x3bd54e['where']=qs['filters'](_[_0x64be('0x3c')](_0x34a0ea[_0x64be('0x33')],_0x26cf52[_0x64be('0x35')]));if(_0x34a0ea[_0x64be('0x33')][_0x64be('0x41')]){_0x3bd54e[_0x64be('0x3b')]=_['merge'](_0x3bd54e[_0x64be('0x3b')],{'$or':_[_0x64be('0x3e')](_0x3bd54e['attributes'],function(_0xd86782){var _0x23cbbe={};_0x23cbbe[_0xd86782]={'$like':'%'+_0x34a0ea[_0x64be('0x33')]['filter']+'%'};return _0x23cbbe;})});}_0x3bd54e=_[_0x64be('0x3d')]({},_0x3bd54e,_0x34a0ea[_0x64be('0x48')]);return _0x16d999['getAgents'](_0x3bd54e);}})[_0x64be('0x29')](function(_0x5a97c4){if(_0x5a97c4){_0x1f5f1c=_0x5a97c4[_0x64be('0x38')];if(!_0x34a0ea[_0x64be('0x33')][_0x64be('0x9a')]('nolimit')){_0x3bd54e[_0x64be('0x22')]=qs['limit'](_0x34a0ea[_0x64be('0x33')][_0x64be('0x22')]);_0x3bd54e[_0x64be('0x21')]=qs[_0x64be('0x21')](_0x34a0ea['query'][_0x64be('0x21')]);}return _0x16d999[_0x64be('0x9b')](_0x3bd54e);}})[_0x64be('0x29')](function(_0x7e5b09){if(_0x7e5b09){return _0x7e5b09?{'count':_0x1f5f1c,'rows':_0x7e5b09}:null;}})['then'](respondWithResult(_0x26c6b9,null))['catch'](handleError(_0x26c6b9,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 0822635..6847dd7 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 _0x8135=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','save','update'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8135,0xae));var _0x5813=function(_0x54f596,_0x1b0a71){_0x54f596=_0x54f596-0x0;var _0x1603c8=_0x8135[_0x54f596];return _0x1603c8;};'use strict';var EventEmitter=require(_0x5813('0x0'));var Team=require(_0x5813('0x1'))['db'][_0x5813('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x5813('0x3')](0x0);var events={'afterCreate':_0x5813('0x4'),'afterUpdate':_0x5813('0x5'),'afterDestroy':'remove'};function emitEvent(_0x542e79){return function(_0x55ed9f,_0x441146,_0x2a3921){TeamEvents[_0x5813('0x6')](_0x542e79+':'+_0x55ed9f['id'],_0x55ed9f);TeamEvents['emit'](_0x542e79,_0x55ed9f);_0x2a3921(null);};}for(var e in events){if(events[_0x5813('0x7')](e)){var event=events[e];Team[_0x5813('0x8')](e,emitEvent(event));}}module[_0x5813('0x9')]=TeamEvents; \ No newline at end of file +var _0x8b99=['emit','hasOwnProperty','exports','../../mysqldb','Team','save','update'];(function(_0x4d1101,_0x415b12){var _0x4fe135=function(_0x2266c1){while(--_0x2266c1){_0x4d1101['push'](_0x4d1101['shift']());}};_0x4fe135(++_0x415b12);}(_0x8b99,0x1ca));var _0x98b9=function(_0x47a4fa,_0x2737a8){_0x47a4fa=_0x47a4fa-0x0;var _0x21314d=_0x8b99[_0x47a4fa];return _0x21314d;};'use strict';var EventEmitter=require('events');var Team=require(_0x98b9('0x0'))['db'][_0x98b9('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x98b9('0x2'),'afterUpdate':_0x98b9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1eb222){return function(_0xc29ea8,_0x52bb4d,_0x381807){TeamEvents[_0x98b9('0x4')](_0x1eb222+':'+_0xc29ea8['id'],_0xc29ea8);TeamEvents[_0x98b9('0x4')](_0x1eb222,_0xc29ea8);_0x381807(null);};}for(var e in events){if(events[_0x98b9('0x5')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x98b9('0x6')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 8a4581d..a59e9a8 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 _0x912a=['resolve','map','all','lodash','Queues','then','setDataValue','channel','catch','exports','define','teams','Mail','Openchannel','Sms','Whatsapp'];(function(_0x1282a0,_0x58b2f9){var _0x18af0c=function(_0x5ac73f){while(--_0x5ac73f){_0x1282a0['push'](_0x1282a0['shift']());}};_0x18af0c(++_0x58b2f9);}(_0x912a,0x103));var _0xa912=function(_0x466247,_0x5d69e3){_0x466247=_0x466247-0x0;var _0x4b352e=_0x912a[_0x466247];return _0x4b352e;};'use strict';var _=require(_0xa912('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0xd2cb57,_0x170d47){var _0x4ee0af='get'+_0x170d47+_0xa912('0x1');return _0xd2cb57[_0x4ee0af]()[_0xa912('0x2')](function(_0x48344c){return _['map'](_0x48344c,function(_0x2827ec){_0x2827ec[_0xa912('0x3')](_0xa912('0x4'),_0x170d47);return _0x2827ec;});})[_0xa912('0x5')](function(_0x1b6507){throw _0x1b6507;});}module[_0xa912('0x6')]=function(_0x3ac82a){return _0x3ac82a[_0xa912('0x7')]('Team',attributes,{'tableName':_0xa912('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x392721=this;var _0x3f97e0=['Chat','Fax',_0xa912('0x9'),_0xa912('0xa'),_0xa912('0xb'),'Voice',_0xa912('0xc')];return Promise[_0xa912('0xd')]()[_0xa912('0x2')](function(){var _0x8d933c=_[_0xa912('0xe')](_0x3f97e0,function(_0x154312){return getQueuesByChannel(_0x392721,_0x154312);});return Promise[_0xa912('0xf')](_0x8d933c);})['catch'](function(_0x3e6fe5){throw _0x3e6fe5;});}}});}; \ No newline at end of file +var _0x74c7=['Sms','Whatsapp','all','lodash','./team.attributes','Queues','then','map','setDataValue','channel','exports','teams','Mail','Openchannel'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x74c7,0xc7));var _0x774c=function(_0x261c87,_0x4f404e){_0x261c87=_0x261c87-0x0;var _0x33fe03=_0x74c7[_0x261c87];return _0x33fe03;};'use strict';var _=require(_0x774c('0x0'));var attributes=require(_0x774c('0x1'));function getQueuesByChannel(_0xec8c1,_0x3b6789){var _0xb1ac9e='get'+_0x3b6789+_0x774c('0x2');return _0xec8c1[_0xb1ac9e]()[_0x774c('0x3')](function(_0x2dd43c){return _[_0x774c('0x4')](_0x2dd43c,function(_0x2a85aa){_0x2a85aa[_0x774c('0x5')](_0x774c('0x6'),_0x3b6789);return _0x2a85aa;});})['catch'](function(_0x5d4fb4){throw _0x5d4fb4;});}module[_0x774c('0x7')]=function(_0x3c4bcd){return _0x3c4bcd['define']('Team',attributes,{'tableName':_0x774c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x25b11b=this;var _0x3b2786=['Chat','Fax',_0x774c('0x9'),_0x774c('0xa'),_0x774c('0xb'),'Voice',_0x774c('0xc')];return Promise['resolve']()['then'](function(){var _0x13bbb7=_['map'](_0x3b2786,function(_0x2d5409){return getQueuesByChannel(_0x25b11b,_0x2d5409);});return Promise[_0x774c('0xd')](_0x13bbb7);})['catch'](function(_0x1d52d4){throw _0x1d52d4;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 50a6c6d..6ccd660 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 _0x4832=['../../config/logger','client','http','redis','defaults','./team.socket','register','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0xd84572,_0x20301c){var _0x4bdd53=function(_0x57a0e2){while(--_0x57a0e2){_0xd84572['push'](_0xd84572['shift']());}};_0x4bdd53(++_0x20301c);}(_0x4832,0x1c9));var _0x2483=function(_0x54ea7a,_0x19df9b){_0x54ea7a=_0x54ea7a-0x0;var _0x65a10d=_0x4832[_0x54ea7a];return _0x65a10d;};'use strict';var _=require(_0x2483('0x0'));var util=require('util');var moment=require(_0x2483('0x1'));var BPromise=require('bluebird');var rs=require(_0x2483('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2483('0x3'))['db'];var utils=require(_0x2483('0x4'));var logger=require(_0x2483('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2483('0x6')][_0x2483('0x7')]({'port':0x232a});config[_0x2483('0x8')]=_[_0x2483('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2483('0x8')]));require(_0x2483('0xa'))[_0x2483('0xb')](socket);function respondWithRpcPromise(_0x400c75,_0x44f18e,_0x5b3a6b){return new BPromise(function(_0x38f63a,_0x2bf46c){return client['request'](_0x400c75,_0x5b3a6b)['then'](function(_0x4b594d){logger[_0x2483('0xc')](_0x2483('0xd'),_0x44f18e,_0x2483('0xe'));logger[_0x2483('0xf')](_0x2483('0x10'),_0x44f18e,_0x2483('0xe'),JSON[_0x2483('0x11')](_0x4b594d));if(_0x4b594d[_0x2483('0x12')]){if(_0x4b594d[_0x2483('0x12')][_0x2483('0x13')]===0x1f4){logger[_0x2483('0x12')](_0x2483('0xd'),_0x44f18e,_0x4b594d[_0x2483('0x12')][_0x2483('0x14')]);return _0x2bf46c(_0x4b594d[_0x2483('0x12')][_0x2483('0x14')]);}logger[_0x2483('0x12')]('Team,\x20%s,\x20%s',_0x44f18e,_0x4b594d[_0x2483('0x12')][_0x2483('0x14')]);return _0x38f63a(_0x4b594d[_0x2483('0x12')][_0x2483('0x14')]);}else{logger[_0x2483('0xc')](_0x2483('0xd'),_0x44f18e,_0x2483('0xe'));_0x38f63a(_0x4b594d['result'][_0x2483('0x14')]);}})[_0x2483('0x15')](function(_0x436054){logger[_0x2483('0x12')](_0x2483('0xd'),_0x44f18e,_0x436054);_0x2bf46c(_0x436054);});});} \ No newline at end of file +var _0x2cc2=['Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','then','Team,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x161bcf,_0x547999){var _0x20f449=function(_0x3e1a07){while(--_0x3e1a07){_0x161bcf['push'](_0x161bcf['shift']());}};_0x20f449(++_0x547999);}(_0x2cc2,0xcc));var _0x22cc=function(_0x273c83,_0x2b2100){_0x273c83=_0x273c83-0x0;var _0x1ade28=_0x2cc2[_0x273c83];return _0x1ade28;};'use strict';var _=require(_0x22cc('0x0'));var util=require('util');var moment=require(_0x22cc('0x1'));var BPromise=require(_0x22cc('0x2'));var rs=require(_0x22cc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22cc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x22cc('0x5'))(_0x22cc('0x6'));var config=require(_0x22cc('0x7'));var jayson=require(_0x22cc('0x8'));var client=jayson['client'][_0x22cc('0x9')]({'port':0x232a});config[_0x22cc('0xa')]=_[_0x22cc('0xb')](config[_0x22cc('0xa')],{'host':_0x22cc('0xc'),'port':0x18eb});var socket=require(_0x22cc('0xd'))(new Redis(config[_0x22cc('0xa')]));require(_0x22cc('0xe'))[_0x22cc('0xf')](socket);function respondWithRpcPromise(_0xd304a2,_0x179edd,_0x387109){return new BPromise(function(_0x4a63ca,_0x9924db){return client['request'](_0xd304a2,_0x387109)[_0x22cc('0x10')](function(_0x1a09f5){logger['info'](_0x22cc('0x11'),_0x179edd,_0x22cc('0x12'));logger[_0x22cc('0x13')](_0x22cc('0x14'),_0x179edd,_0x22cc('0x12'),JSON[_0x22cc('0x15')](_0x1a09f5));if(_0x1a09f5['error']){if(_0x1a09f5[_0x22cc('0x16')][_0x22cc('0x17')]===0x1f4){logger['error'](_0x22cc('0x11'),_0x179edd,_0x1a09f5[_0x22cc('0x16')][_0x22cc('0x18')]);return _0x9924db(_0x1a09f5[_0x22cc('0x16')][_0x22cc('0x18')]);}logger[_0x22cc('0x16')](_0x22cc('0x11'),_0x179edd,_0x1a09f5['error']['message']);return _0x4a63ca(_0x1a09f5[_0x22cc('0x16')][_0x22cc('0x18')]);}else{logger[_0x22cc('0x19')]('Team,\x20%s,\x20%s',_0x179edd,'request\x20sent');_0x4a63ca(_0x1a09f5[_0x22cc('0x1a')][_0x22cc('0x18')]);}})[_0x22cc('0x1b')](function(_0x1769c6){logger[_0x22cc('0x16')](_0x22cc('0x11'),_0x179edd,_0x1769c6);_0x9924db(_0x1769c6);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index b6b8573..87cd541 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 _0x1bc4=['team:','./team.events','remove','update','removeListener','length'];(function(_0x20a089,_0x158776){var _0x4521e9=function(_0x5b1728){while(--_0x5b1728){_0x20a089['push'](_0x20a089['shift']());}};_0x4521e9(++_0x158776);}(_0x1bc4,0xd3));var _0x41bc=function(_0xd7f220,_0x1c0cd3){_0xd7f220=_0xd7f220-0x0;var _0x155b80=_0x1bc4[_0xd7f220];return _0x155b80;};'use strict';var TeamEvents=require(_0x41bc('0x0'));var events=['save',_0x41bc('0x1'),_0x41bc('0x2')];function createListener(_0x3f9098,_0x376240){return function(_0x4d1ff5){_0x376240['emit'](_0x3f9098,_0x4d1ff5);};}function removeListener(_0x48ec5f,_0x995199){return function(){TeamEvents[_0x41bc('0x3')](_0x48ec5f,_0x995199);};}exports['register']=function(_0x4178e7){for(var _0x4a425f=0x0,_0x1b042f=events[_0x41bc('0x4')];_0x4a425f<_0x1b042f;_0x4a425f++){var _0x25bcbd=events[_0x4a425f];var _0x1c0e04=createListener(_0x41bc('0x5')+_0x25bcbd,_0x4178e7);TeamEvents['on'](_0x25bcbd,_0x1c0e04);}}; \ No newline at end of file +var _0x3c60=['register','length','save','remove','update','removeListener'];(function(_0x1a2b47,_0x10ad6e){var _0x362d86=function(_0x3fa68f){while(--_0x3fa68f){_0x1a2b47['push'](_0x1a2b47['shift']());}};_0x362d86(++_0x10ad6e);}(_0x3c60,0x14c));var _0x03c6=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0x3c60[_0x26b8b5];return _0x2150a9;};'use strict';var TeamEvents=require('./team.events');var events=[_0x03c6('0x0'),_0x03c6('0x1'),_0x03c6('0x2')];function createListener(_0x1741ef,_0x5b7053){return function(_0x48091f){_0x5b7053['emit'](_0x1741ef,_0x48091f);};}function removeListener(_0x1988c4,_0x5138c6){return function(){TeamEvents[_0x03c6('0x3')](_0x1988c4,_0x5138c6);};}exports[_0x03c6('0x4')]=function(_0x51a24c){for(var _0x1cff42=0x0,_0x51215e=events[_0x03c6('0x5')];_0x1cff42<_0x51215e;_0x1cff42++){var _0x135315=events[_0x1cff42];var _0x16af10=createListener('team:'+_0x135315,_0x51a24c);TeamEvents['on'](_0x135315,_0x16af10);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 75b434a..db9fb91 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 _0x9189=['INTEGER'];(function(_0x36ad25,_0x16b22a){var _0x50d462=function(_0x528d61){while(--_0x528d61){_0x36ad25['push'](_0x36ad25['shift']());}};_0x50d462(++_0x16b22a);}(_0x9189,0x1b0));var _0x9918=function(_0x41892a,_0x456c01){_0x41892a=_0x41892a-0x0;var _0x4c33a0=_0x9189[_0x41892a];return _0x4c33a0;};'use strict';var Sequelize=require('sequelize');module['exports']={'TeamId':{'type':Sequelize[_0x9918('0x0')]},'VoicePrefixId':{'type':Sequelize[_0x9918('0x0')]}}; \ No newline at end of file +var _0x3d15=['INTEGER','exports'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x3d15,0x127));var _0x53d1=function(_0x4acd36,_0x5aee49){_0x4acd36=_0x4acd36-0x0;var _0x1ffcf4=_0x3d15[_0x4acd36];return _0x1ffcf4;};'use strict';var Sequelize=require('sequelize');module[_0x53d1('0x0')]={'TeamId':{'type':Sequelize[_0x53d1('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 959dfb7..dd15147 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 _0x4b74=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','lodash'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x4b74,0x103));var _0x44b7=function(_0x33ec76,_0x5ae8ab){_0x33ec76=_0x33ec76-0x0;var _0x55dee5=_0x4b74[_0x33ec76];return _0x55dee5;};'use strict';var _=require(_0x44b7('0x0'));var util=require(_0x44b7('0x1'));var logger=require(_0x44b7('0x2'))('api');var moment=require(_0x44b7('0x3'));var BPromise=require(_0x44b7('0x4'));var rp=require(_0x44b7('0x5'));var fs=require('fs');var path=require(_0x44b7('0x6'));var rimraf=require(_0x44b7('0x7'));var config=require(_0x44b7('0x8'));var attributes=require(_0x44b7('0x9'));module[_0x44b7('0xa')]=function(_0x5ef96c,_0xdfcf5){return _0x5ef96c[_0x44b7('0xb')](_0x44b7('0xc'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd983=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x357a2b,_0x2ccf7c){var _0x1d9a54=function(_0x36ea98){while(--_0x36ea98){_0x357a2b['push'](_0x357a2b['shift']());}};_0x1d9a54(++_0x2ccf7c);}(_0xd983,0x1df));var _0x3d98=function(_0x2fe04c,_0x5332f8){_0x2fe04c=_0x2fe04c-0x0;var _0x4d2b73=_0xd983[_0x2fe04c];return _0x4d2b73;};'use strict';var _=require(_0x3d98('0x0'));var util=require(_0x3d98('0x1'));var logger=require(_0x3d98('0x2'))(_0x3d98('0x3'));var moment=require(_0x3d98('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d98('0x5'));var rimraf=require(_0x3d98('0x6'));var config=require(_0x3d98('0x7'));var attributes=require(_0x3d98('0x8'));module[_0x3d98('0x9')]=function(_0x3e32c6,_0x394587){return _0x3e32c6['define'](_0x3d98('0xa'),attributes,{'tableName':_0x3d98('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 819d0a1..254cc08 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x279d15,_0x18d443){var _0x3b0413=function(_0x14fdcc){while(--_0x14fdcc){_0x279d15['push'](_0x279d15['shift']());}};_0x3b0413(++_0x18d443);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x10f6a0,_0x3503c6){var _0x3cbdac=function(_0x423e7a){while(--_0x423e7a){_0x10f6a0['push'](_0x10f6a0['shift']());}};_0x3cbdac(++_0x3503c6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 7a85523..cbead20 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 _0x1c8a=['INTEGER','sequelize','exports'];(function(_0x2709bb,_0x41eede){var _0x5a5bbd=function(_0x1d2f50){while(--_0x1d2f50){_0x2709bb['push'](_0x2709bb['shift']());}};_0x5a5bbd(++_0x41eede);}(_0x1c8a,0x1f0));var _0xa1c8=function(_0x5a7782,_0x4db9d2){_0x5a7782=_0x5a7782-0x0;var _0x449a6b=_0x1c8a[_0x5a7782];return _0x449a6b;};'use strict';var Sequelize=require(_0xa1c8('0x0'));module[_0xa1c8('0x1')]={'penalty':{'type':Sequelize[_0xa1c8('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf5b6=['INTEGER','exports'];(function(_0x11aa50,_0x134759){var _0xfadfae=function(_0x4e0b3b){while(--_0x4e0b3b){_0x11aa50['push'](_0x11aa50['shift']());}};_0xfadfae(++_0x134759);}(_0xf5b6,0xe9));var _0x6f5b=function(_0x234f4b,_0x56963c){_0x234f4b=_0x234f4b-0x0;var _0x358610=_0xf5b6[_0x234f4b];return _0x358610;};'use strict';var Sequelize=require('sequelize');module[_0x6f5b('0x0')]={'penalty':{'type':Sequelize[_0x6f5b('0x1')],'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 9bff265..7e24c36 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 _0xa73a=['util','../../config/logger','api','moment','bluebird','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue'];(function(_0x2ce1c8,_0x260246){var _0x4a028e=function(_0x5184df){while(--_0x5184df){_0x2ce1c8['push'](_0x2ce1c8['shift']());}};_0x4a028e(++_0x260246);}(_0xa73a,0x82));var _0xaa73=function(_0x21bfab,_0x2fee48){_0x21bfab=_0x21bfab-0x0;var _0x4db318=_0xa73a[_0x21bfab];return _0x4db318;};'use strict';var _=require('lodash');var util=require(_0xaa73('0x0'));var logger=require(_0xaa73('0x1'))(_0xaa73('0x2'));var moment=require(_0xaa73('0x3'));var BPromise=require(_0xaa73('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa73('0x5'));var attributes=require(_0xaa73('0x6'));module[_0xaa73('0x7')]=function(_0x15d1c6,_0xf84c2e){return _0x15d1c6[_0xaa73('0x8')](_0xaa73('0x9'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c6d=['request-promise','rimraf','define','team_has_voice_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x3f07cb,_0x285a1d){var _0x5789a9=function(_0x2adbf5){while(--_0x2adbf5){_0x3f07cb['push'](_0x3f07cb['shift']());}};_0x5789a9(++_0x285a1d);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x1aceb8,_0xb2e2f8){_0x1aceb8=_0x1aceb8-0x0;var _0x22bbe6=_0x0c6d[_0x1aceb8];return _0x22bbe6;};'use strict';var _=require('lodash');var util=require(_0xd0c6('0x0'));var logger=require(_0xd0c6('0x1'))(_0xd0c6('0x2'));var moment=require(_0xd0c6('0x3'));var BPromise=require(_0xd0c6('0x4'));var rp=require(_0xd0c6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0c6('0x6'));var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x2b4c40,_0x41f475){return _0x2b4c40[_0xd0c6('0x7')]('TeamVoiceQueue',attributes,{'tableName':_0xd0c6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 21bdf74..32bccf1 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 _0x4a06=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3fa366,_0x3b2b34){var _0x1cca03=function(_0x2e9e3b){while(--_0x2e9e3b){_0x3fa366['push'](_0x3fa366['shift']());}};_0x1cca03(++_0x3b2b34);}(_0x4a06,0x1f2));var _0x64a0=function(_0x4a1b05,_0x5b664c){_0x4a1b05=_0x4a1b05-0x0;var _0x3d5e45=_0x4a06[_0x4a1b05];return _0x3d5e45;};'use strict';var _=require(_0x64a0('0x0'));var util=require(_0x64a0('0x1'));var moment=require(_0x64a0('0x2'));var BPromise=require(_0x64a0('0x3'));var rs=require(_0x64a0('0x4'));var fs=require('fs');var Redis=require(_0x64a0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x64a0('0x6'));var logger=require(_0x64a0('0x7'))(_0x64a0('0x8'));var config=require(_0x64a0('0x9'));var jayson=require(_0x64a0('0xa'));var client=jayson[_0x64a0('0xb')][_0x64a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2914f1,_0x987eb5,_0x44f259){return new BPromise(function(_0x2060fa,_0x12c52b){return client[_0x64a0('0xd')](_0x2914f1,_0x44f259)[_0x64a0('0xe')](function(_0x47064f){logger['info'](_0x64a0('0xf'),_0x987eb5,_0x64a0('0x10'));logger['debug'](_0x64a0('0x11'),_0x987eb5,_0x64a0('0x10'),JSON[_0x64a0('0x12')](_0x47064f));if(_0x47064f[_0x64a0('0x13')]){if(_0x47064f[_0x64a0('0x13')][_0x64a0('0x14')]===0x1f4){logger['error'](_0x64a0('0xf'),_0x987eb5,_0x47064f[_0x64a0('0x13')][_0x64a0('0x15')]);return _0x12c52b(_0x47064f['error'][_0x64a0('0x15')]);}logger[_0x64a0('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x987eb5,_0x47064f[_0x64a0('0x13')][_0x64a0('0x15')]);return _0x2060fa(_0x47064f[_0x64a0('0x13')][_0x64a0('0x15')]);}else{logger['info'](_0x64a0('0xf'),_0x987eb5,_0x64a0('0x10'));_0x2060fa(_0x47064f[_0x64a0('0x16')][_0x64a0('0x15')]);}})[_0x64a0('0x17')](function(_0x45008e){logger[_0x64a0('0x13')](_0x64a0('0xf'),_0x987eb5,_0x45008e);_0x12c52b(_0x45008e);});});} \ No newline at end of file +var _0xfda0=['request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x4c62af,_0x234da8){var _0x3d8c6d=function(_0x18b67b){while(--_0x18b67b){_0x4c62af['push'](_0x4c62af['shift']());}};_0x3d8c6d(++_0x234da8);}(_0xfda0,0xee));var _0x0fda=function(_0x4e3d3f,_0x20c769){_0x4e3d3f=_0x4e3d3f-0x0;var _0x2ad2e9=_0xfda0[_0x4e3d3f];return _0x2ad2e9;};'use strict';var _=require(_0x0fda('0x0'));var util=require(_0x0fda('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0fda('0x2'));var fs=require('fs');var Redis=require(_0x0fda('0x3'));var db=require(_0x0fda('0x4'))['db'];var utils=require(_0x0fda('0x5'));var logger=require(_0x0fda('0x6'))(_0x0fda('0x7'));var config=require(_0x0fda('0x8'));var jayson=require(_0x0fda('0x9'));var client=jayson[_0x0fda('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45b74e,_0x3984f1,_0x4394b5){return new BPromise(function(_0x32b258,_0x2cf63c){return client[_0x0fda('0xb')](_0x45b74e,_0x4394b5)['then'](function(_0xbf910e){logger['info'](_0x0fda('0xc'),_0x3984f1,'request\x20sent');logger[_0x0fda('0xd')](_0x0fda('0xe'),_0x3984f1,_0x0fda('0xf'),JSON[_0x0fda('0x10')](_0xbf910e));if(_0xbf910e[_0x0fda('0x11')]){if(_0xbf910e[_0x0fda('0x11')][_0x0fda('0x12')]===0x1f4){logger[_0x0fda('0x11')](_0x0fda('0xc'),_0x3984f1,_0xbf910e[_0x0fda('0x11')][_0x0fda('0x13')]);return _0x2cf63c(_0xbf910e[_0x0fda('0x11')][_0x0fda('0x13')]);}logger[_0x0fda('0x11')](_0x0fda('0xc'),_0x3984f1,_0xbf910e['error'][_0x0fda('0x13')]);return _0x32b258(_0xbf910e[_0x0fda('0x11')][_0x0fda('0x13')]);}else{logger[_0x0fda('0x14')](_0x0fda('0xc'),_0x3984f1,'request\x20sent');_0x32b258(_0xbf910e[_0x0fda('0x15')][_0x0fda('0x13')]);}})[_0x0fda('0x16')](function(_0x2b5cc7){logger[_0x0fda('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3984f1,_0x2b5cc7);_0x2cf63c(_0x2b5cc7);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 38c85de..d6af8a5 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 _0xa057=['isAuthenticated','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./template.controller','index','get','/:id','show','post'];(function(_0x467025,_0x162d7a){var _0x48175c=function(_0xea9229){while(--_0xea9229){_0x467025['push'](_0x467025['shift']());}};_0x48175c(++_0x162d7a);}(_0xa057,0x123));var _0x7a05=function(_0x31b184,_0xc9bfe){_0x31b184=_0x31b184-0x0;var _0x5ec64f=_0xa057[_0x31b184];return _0x5ec64f;};'use strict';var multer=require(_0x7a05('0x0'));var util=require(_0x7a05('0x1'));var path=require('path');var timeout=require(_0x7a05('0x2'));var express=require(_0x7a05('0x3'));var router=express[_0x7a05('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7a05('0x5'));var interaction=require(_0x7a05('0x6'));var config=require('../../config/environment');var controller=require(_0x7a05('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x7a05('0x8')]);router[_0x7a05('0x9')](_0x7a05('0xa'),auth['isAuthenticated'](),controller[_0x7a05('0xb')]);router[_0x7a05('0xc')]('/',auth[_0x7a05('0xd')](),controller['create']);router[_0x7a05('0xe')](_0x7a05('0xa'),auth[_0x7a05('0xd')](),controller[_0x7a05('0xf')]);router[_0x7a05('0x10')](_0x7a05('0xa'),auth['isAuthenticated'](),controller[_0x7a05('0x11')]);module[_0x7a05('0x12')]=router; \ No newline at end of file +var _0xaac4=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','index','/:id','show','isAuthenticated','create','put','delete','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaac4,0x6c));var _0x4aac=function(_0x161341,_0x1c054d){_0x161341=_0x161341-0x0;var _0x5e06c3=_0xaac4[_0x161341];return _0x5e06c3;};'use strict';var multer=require(_0x4aac('0x0'));var util=require(_0x4aac('0x1'));var path=require('path');var timeout=require(_0x4aac('0x2'));var express=require(_0x4aac('0x3'));var router=express[_0x4aac('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4aac('0x5'));var interaction=require(_0x4aac('0x6'));var config=require(_0x4aac('0x7'));var controller=require(_0x4aac('0x8'));router[_0x4aac('0x9')]('/',auth['isAuthenticated'](),controller[_0x4aac('0xa')]);router[_0x4aac('0x9')](_0x4aac('0xb'),auth['isAuthenticated'](),controller[_0x4aac('0xc')]);router['post']('/',auth[_0x4aac('0xd')](),controller[_0x4aac('0xe')]);router[_0x4aac('0xf')](_0x4aac('0xb'),auth[_0x4aac('0xd')](),controller['update']);router[_0x4aac('0x10')](_0x4aac('0xb'),auth[_0x4aac('0xd')](),controller[_0x4aac('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 4e1e1e6..78a8726 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 _0x36fe=['sequelize','STRING'];(function(_0x251296,_0x51d7a8){var _0x5f3ead=function(_0x354000){while(--_0x354000){_0x251296['push'](_0x251296['shift']());}};_0x5f3ead(++_0x51d7a8);}(_0x36fe,0x198));var _0xe36f=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0x36fe[_0x7b173];return _0x1c598c;};'use strict';var Sequelize=require(_0xe36f('0x0'));module['exports']={'name':{'type':Sequelize[_0xe36f('0x1')]},'description':{'type':Sequelize[_0xe36f('0x1')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x1360=['STRING','sequelize'];(function(_0x3782aa,_0x25e870){var _0x285056=function(_0x1c2361){while(--_0x1c2361){_0x3782aa['push'](_0x3782aa['shift']());}};_0x285056(++_0x25e870);}(_0x1360,0x17f));var _0x0136=function(_0x2ef714,_0x49e1c4){_0x2ef714=_0x2ef714-0x0;var _0x252ab0=_0x1360[_0x2ef714];return _0x252ab0;};'use strict';var Sequelize=require(_0x0136('0x0'));module['exports']={'name':{'type':Sequelize[_0x0136('0x1')]},'description':{'type':Sequelize[_0x0136('0x1')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 87f8002..c1def99 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 _0xf1df=['query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Template','includeAll','include','rows','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','get','Templates','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key'];(function(_0x29d571,_0x2a7d2c){var _0x483dbb=function(_0x4a6cb2){while(--_0x4a6cb2){_0x29d571['push'](_0x29d571['shift']());}};_0x483dbb(++_0x2a7d2c);}(_0xf1df,0x1c0));var _0xff1d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf1df[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xff1d('0x0'));var jsonpatch=require(_0xff1d('0x1'));var rp=require(_0xff1d('0x2'));var moment=require(_0xff1d('0x3'));var BPromise=require(_0xff1d('0x4'));var Mustache=require(_0xff1d('0x5'));var util=require(_0xff1d('0x6'));var path=require(_0xff1d('0x7'));var sox=require(_0xff1d('0x8'));var csv=require('to-csv');var ejs=require(_0xff1d('0x9'));var fs=require('fs');var fs_extra=require(_0xff1d('0xa'));var _=require(_0xff1d('0xb'));var squel=require(_0xff1d('0xc'));var crypto=require(_0xff1d('0xd'));var jsforce=require(_0xff1d('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xff1d('0xf'));var Redis=require('ioredis');var authService=require(_0xff1d('0x10'));var qs=require(_0xff1d('0x11'));var as=require(_0xff1d('0x12'));var hardwareService=require(_0xff1d('0x13'));var logger=require(_0xff1d('0x14'))(_0xff1d('0x15'));var utils=require(_0xff1d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xff1d('0x17'));var db=require(_0xff1d('0x18'))['db'];function respondWithStatusCode(_0x5c7698,_0x41ca27){_0x41ca27=_0x41ca27||0xcc;return function(_0x15e70e){if(_0x15e70e){return _0x5c7698['sendStatus'](_0x41ca27);}return _0x5c7698[_0xff1d('0x19')](_0x41ca27)[_0xff1d('0x1a')]();};}function respondWithResult(_0x12d5b0,_0x6b057f){_0x6b057f=_0x6b057f||0xc8;return function(_0x1be90b){if(_0x1be90b){return _0x12d5b0[_0xff1d('0x19')](_0x6b057f)[_0xff1d('0x1b')](_0x1be90b);}};}function respondWithFilteredResult(_0x9b98bf,_0x47fd45){return function(_0x16a657){if(_0x16a657){var _0xa19729=typeof _0x47fd45[_0xff1d('0x1c')]===_0xff1d('0x1d')&&typeof _0x47fd45['limit']===_0xff1d('0x1d');var _0x3e8235=_0x16a657[_0xff1d('0x1e')];var _0x3dd3b3=_0xa19729?0x0:_0x47fd45['offset'];var _0x3e23ee=_0xa19729?_0x16a657['count']:_0x47fd45[_0xff1d('0x1c')]+_0x47fd45[_0xff1d('0x1f')];var _0x512be9;if(_0x3e23ee>=_0x3e8235){_0x3e23ee=_0x3e8235;_0x512be9=0xc8;}else{_0x512be9=0xce;}_0x9b98bf['status'](_0x512be9);return _0x9b98bf[_0xff1d('0x20')]('Content-Range',_0x3dd3b3+'-'+_0x3e23ee+'/'+_0x3e8235)[_0xff1d('0x1b')](_0x16a657);}return null;};}function patchUpdates(_0x2c9226){return function(_0x182c5b){try{jsonpatch[_0xff1d('0x21')](_0x182c5b,_0x2c9226,!![]);}catch(_0x15a269){return BPromise[_0xff1d('0x22')](_0x15a269);}return _0x182c5b[_0xff1d('0x23')]();};}function saveUpdates(_0x16cb62,_0x51ae41){return function(_0x1d1a75){if(_0x1d1a75){return _0x1d1a75['update'](_0x16cb62)[_0xff1d('0x24')](function(_0xcb58be){return _0xcb58be;});}return null;};}function removeEntity(_0x2f23d3,_0x1819ee){return function(_0x4ae48b){if(_0x4ae48b){return _0x4ae48b[_0xff1d('0x25')]()[_0xff1d('0x24')](function(){var _0x3926a6=_0x4ae48b[_0xff1d('0x26')]({'plain':!![]});var _0xe18180=_0xff1d('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0xe18180,'resourceId':_0x3926a6['id']}})['then'](function(){return _0x4ae48b;});})[_0xff1d('0x24')](function(){_0x2f23d3[_0xff1d('0x19')](0xcc)[_0xff1d('0x1a')]();});}};}function handleEntityNotFound(_0x1979ee,_0x3a3f63){return function(_0x482da8){if(!_0x482da8){_0x1979ee[_0xff1d('0x28')](0x194);}return _0x482da8;};}function handleError(_0x4b4c84,_0x34cc3a){_0x34cc3a=_0x34cc3a||0x1f4;return function(_0x3b441e){logger[_0xff1d('0x29')](_0x3b441e[_0xff1d('0x2a')]);if(_0x3b441e[_0xff1d('0x2b')]){delete _0x3b441e[_0xff1d('0x2b')];}_0x4b4c84[_0xff1d('0x19')](_0x34cc3a)[_0xff1d('0x2c')](_0x3b441e);};}exports['index']=function(_0x1a9cab,_0x3550a1){var _0x3b6a14={},_0x2958f5={},_0x12accc={'count':0x0,'rows':[]};var _0x32776d=_[_0xff1d('0x2d')](db['Template'][_0xff1d('0x2e')],function(_0x4cf420){return{'name':_0x4cf420[_0xff1d('0x2f')],'type':_0x4cf420[_0xff1d('0x30')][_0xff1d('0x31')]};});_0x2958f5['model']=_[_0xff1d('0x2d')](_0x32776d,_0xff1d('0x2b'));_0x2958f5[_0xff1d('0x32')]=_['keys'](_0x1a9cab[_0xff1d('0x32')]);_0x2958f5['filters']=_['intersection'](_0x2958f5['model'],_0x2958f5['query']);_0x3b6a14['attributes']=_[_0xff1d('0x33')](_0x2958f5[_0xff1d('0x34')],qs[_0xff1d('0x35')](_0x1a9cab[_0xff1d('0x32')][_0xff1d('0x35')]));_0x3b6a14[_0xff1d('0x36')]=_0x3b6a14[_0xff1d('0x36')][_0xff1d('0x37')]?_0x3b6a14[_0xff1d('0x36')]:_0x2958f5['model'];if(!_0x1a9cab['query'][_0xff1d('0x38')](_0xff1d('0x39'))){_0x3b6a14[_0xff1d('0x1f')]=qs[_0xff1d('0x1f')](_0x1a9cab[_0xff1d('0x32')][_0xff1d('0x1f')]);_0x3b6a14[_0xff1d('0x1c')]=qs['offset'](_0x1a9cab[_0xff1d('0x32')][_0xff1d('0x1c')]);}_0x3b6a14[_0xff1d('0x3a')]=qs[_0xff1d('0x3b')](_0x1a9cab[_0xff1d('0x32')][_0xff1d('0x3b')]);_0x3b6a14[_0xff1d('0x3c')]=qs[_0xff1d('0x3d')](_[_0xff1d('0x3e')](_0x1a9cab[_0xff1d('0x32')],_0x2958f5['filters']),_0x32776d);if(_0x1a9cab[_0xff1d('0x32')][_0xff1d('0x3f')]){_0x3b6a14[_0xff1d('0x3c')]=_[_0xff1d('0x40')](_0x3b6a14['where'],{'$or':_[_0xff1d('0x2d')](_0x32776d,function(_0x5a1687){if(_0x5a1687[_0xff1d('0x30')]!==_0xff1d('0x41')){var _0x37f8f4={};_0x37f8f4[_0x5a1687['name']]={'$like':'%'+_0x1a9cab[_0xff1d('0x32')][_0xff1d('0x3f')]+'%'};return _0x37f8f4;}})});}_0x3b6a14=_[_0xff1d('0x40')]({},_0x3b6a14,_0x1a9cab[_0xff1d('0x42')]);var _0x4f860f={'where':_0x3b6a14[_0xff1d('0x3c')]};return db[_0xff1d('0x43')][_0xff1d('0x1e')](_0x4f860f)['then'](function(_0x546df7){_0x12accc[_0xff1d('0x1e')]=_0x546df7;if(_0x1a9cab[_0xff1d('0x32')][_0xff1d('0x44')]){_0x3b6a14[_0xff1d('0x45')]=[{'all':!![]}];}return db['Template']['findAll'](_0x3b6a14);})[_0xff1d('0x24')](function(_0x491ff5){_0x12accc[_0xff1d('0x46')]=_0x491ff5;return _0x12accc;})[_0xff1d('0x24')](respondWithFilteredResult(_0x3550a1,_0x3b6a14))['catch'](handleError(_0x3550a1,null));};exports['show']=function(_0x1cf6a6,_0x5e7b41){var _0x44bde3={'raw':!![],'where':{'id':_0x1cf6a6[_0xff1d('0x47')]['id']}},_0x27c016={};_0x27c016[_0xff1d('0x34')]=_[_0xff1d('0x48')](db[_0xff1d('0x43')][_0xff1d('0x2e')]);_0x27c016['query']=_['keys'](_0x1cf6a6[_0xff1d('0x32')]);_0x27c016[_0xff1d('0x3d')]=_[_0xff1d('0x33')](_0x27c016[_0xff1d('0x34')],_0x27c016[_0xff1d('0x32')]);_0x44bde3[_0xff1d('0x36')]=_[_0xff1d('0x33')](_0x27c016['model'],qs['fields'](_0x1cf6a6['query'][_0xff1d('0x35')]));_0x44bde3[_0xff1d('0x36')]=_0x44bde3['attributes'][_0xff1d('0x37')]?_0x44bde3['attributes']:_0x27c016[_0xff1d('0x34')];if(_0x1cf6a6[_0xff1d('0x32')][_0xff1d('0x44')]){_0x44bde3[_0xff1d('0x45')]=[{'all':!![]}];}_0x44bde3=_['merge']({},_0x44bde3,_0x1cf6a6[_0xff1d('0x42')]);return db[_0xff1d('0x43')][_0xff1d('0x49')](_0x44bde3)[_0xff1d('0x24')](handleEntityNotFound(_0x5e7b41,null))[_0xff1d('0x24')](respondWithResult(_0x5e7b41,null))[_0xff1d('0x4a')](handleError(_0x5e7b41,null));};exports[_0xff1d('0x4b')]=function(_0x4c4584,_0x172ad0){return db[_0xff1d('0x43')][_0xff1d('0x4b')](_0x4c4584[_0xff1d('0x4c')],{})[_0xff1d('0x24')](function(_0x1fa7ce){var _0x22e19e=_0x4c4584[_0xff1d('0x4d')][_0xff1d('0x26')]({'plain':!![]});if(!_0x22e19e)throw new Error(_0xff1d('0x4e'));if(_0x22e19e[_0xff1d('0x4f')]===_0xff1d('0x4d')){var _0x257ba6=_0x1fa7ce['get']({'plain':!![]});var _0x4a6419=_0xff1d('0x27');return db[_0xff1d('0x50')][_0xff1d('0x49')]({'where':{'name':_0x4a6419,'userProfileId':_0x22e19e['userProfileId']},'raw':!![]})[_0xff1d('0x24')](function(_0x33929a){if(_0x33929a&&_0x33929a[_0xff1d('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x257ba6[_0xff1d('0x2b')],'resourceId':_0x257ba6['id'],'type':_0x33929a[_0xff1d('0x2b')],'sectionId':_0x33929a['id']},{})[_0xff1d('0x24')](function(){return _0x1fa7ce;});}else{return _0x1fa7ce;}})['catch'](function(_0x5d15e4){logger[_0xff1d('0x29')](_0xff1d('0x52'),_0x5d15e4);throw _0x5d15e4;});}return _0x1fa7ce;})['then'](respondWithResult(_0x172ad0,0xc9))['catch'](handleError(_0x172ad0,null));};exports['update']=function(_0x44ec28,_0x147c26){if(_0x44ec28[_0xff1d('0x4c')]['id']){delete _0x44ec28[_0xff1d('0x4c')]['id'];}return db[_0xff1d('0x43')]['find']({'where':{'id':_0x44ec28[_0xff1d('0x47')]['id']}})[_0xff1d('0x24')](handleEntityNotFound(_0x147c26,null))[_0xff1d('0x24')](saveUpdates(_0x44ec28['body'],null))[_0xff1d('0x24')](respondWithResult(_0x147c26,null))[_0xff1d('0x4a')](handleError(_0x147c26,null));};exports['destroy']=function(_0x40190a,_0x1df7ae){return db[_0xff1d('0x43')][_0xff1d('0x49')]({'where':{'id':_0x40190a[_0xff1d('0x47')]['id']}})[_0xff1d('0x24')](handleEntityNotFound(_0x1df7ae,null))[_0xff1d('0x24')](removeEntity(_0x1df7ae,null))[_0xff1d('0x4a')](handleError(_0x1df7ae,null));}; \ No newline at end of file +var _0x5f85=['status','end','undefined','count','offset','limit','Content-Range','json','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','Template','fieldName','type','key','keys','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','body','moment','mustache','util','path','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3eb630,_0x552586){var _0x1b840d=function(_0x2594a8){while(--_0x2594a8){_0x3eb630['push'](_0x3eb630['shift']());}};_0x1b840d(++_0x552586);}(_0x5f85,0x1a2));var _0x55f8=function(_0xa75ba2,_0x62a215){_0xa75ba2=_0xa75ba2-0x0;var _0x53608d=_0x5f85[_0xa75ba2];return _0x53608d;};'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(_0x55f8('0x0'));var BPromise=require('bluebird');var Mustache=require(_0x55f8('0x1'));var util=require(_0x55f8('0x2'));var path=require(_0x55f8('0x3'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x55f8('0x4'));var _=require(_0x55f8('0x5'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x55f8('0x6'));var deskjs=require('desk.js');var toCsv=require(_0x55f8('0x7'));var querystring=require(_0x55f8('0x8'));var Papa=require(_0x55f8('0x9'));var Redis=require(_0x55f8('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x55f8('0xb'));var as=require(_0x55f8('0xc'));var hardwareService=require(_0x55f8('0xd'));var logger=require(_0x55f8('0xe'))('api');var utils=require(_0x55f8('0xf'));var config=require(_0x55f8('0x10'));var licenseUtil=require(_0x55f8('0x11'));var db=require(_0x55f8('0x12'))['db'];function respondWithStatusCode(_0x1df2bd,_0x543be8){_0x543be8=_0x543be8||0xcc;return function(_0x13cba8){if(_0x13cba8){return _0x1df2bd[_0x55f8('0x13')](_0x543be8);}return _0x1df2bd[_0x55f8('0x14')](_0x543be8)[_0x55f8('0x15')]();};}function respondWithResult(_0xb12873,_0x3caa61){_0x3caa61=_0x3caa61||0xc8;return function(_0x2100d1){if(_0x2100d1){return _0xb12873[_0x55f8('0x14')](_0x3caa61)['json'](_0x2100d1);}};}function respondWithFilteredResult(_0xbdaff1,_0x39ea9a){return function(_0x589565){if(_0x589565){var _0x376d74=typeof _0x39ea9a['offset']===_0x55f8('0x16')&&typeof _0x39ea9a['limit']===_0x55f8('0x16');var _0x5eb64a=_0x589565[_0x55f8('0x17')];var _0x5332f1=_0x376d74?0x0:_0x39ea9a[_0x55f8('0x18')];var _0x54344d=_0x376d74?_0x589565[_0x55f8('0x17')]:_0x39ea9a[_0x55f8('0x18')]+_0x39ea9a[_0x55f8('0x19')];var _0x4e8b47;if(_0x54344d>=_0x5eb64a){_0x54344d=_0x5eb64a;_0x4e8b47=0xc8;}else{_0x4e8b47=0xce;}_0xbdaff1[_0x55f8('0x14')](_0x4e8b47);return _0xbdaff1['set'](_0x55f8('0x1a'),_0x5332f1+'-'+_0x54344d+'/'+_0x5eb64a)[_0x55f8('0x1b')](_0x589565);}return null;};}function patchUpdates(_0x569181){return function(_0x29ef51){try{jsonpatch['apply'](_0x29ef51,_0x569181,!![]);}catch(_0x48ac08){return BPromise['reject'](_0x48ac08);}return _0x29ef51[_0x55f8('0x1c')]();};}function saveUpdates(_0x3046cb,_0x5d9988){return function(_0xe9407d){if(_0xe9407d){return _0xe9407d['update'](_0x3046cb)[_0x55f8('0x1d')](function(_0x239fa9){return _0x239fa9;});}return null;};}function removeEntity(_0x5e38d7,_0x335571){return function(_0xd3173b){if(_0xd3173b){return _0xd3173b[_0x55f8('0x1e')]()[_0x55f8('0x1d')](function(){var _0xff154e=_0xd3173b[_0x55f8('0x1f')]({'plain':!![]});var _0x3af92e='Templates';return db[_0x55f8('0x20')]['destroy']({'where':{'type':_0x3af92e,'resourceId':_0xff154e['id']}})[_0x55f8('0x1d')](function(){return _0xd3173b;});})[_0x55f8('0x1d')](function(){_0x5e38d7[_0x55f8('0x14')](0xcc)[_0x55f8('0x15')]();});}};}function handleEntityNotFound(_0x5206f1,_0x489537){return function(_0x19ce75){if(!_0x19ce75){_0x5206f1[_0x55f8('0x13')](0x194);}return _0x19ce75;};}function handleError(_0x4086bc,_0x1b55ff){_0x1b55ff=_0x1b55ff||0x1f4;return function(_0x493056){logger[_0x55f8('0x21')](_0x493056[_0x55f8('0x22')]);if(_0x493056[_0x55f8('0x23')]){delete _0x493056[_0x55f8('0x23')];}_0x4086bc[_0x55f8('0x14')](_0x1b55ff)['send'](_0x493056);};}exports[_0x55f8('0x24')]=function(_0x50a63d,_0x5a0c58){var _0x4b0b80={},_0x39837e={},_0xf5b3a6={'count':0x0,'rows':[]};var _0x125f3d=_[_0x55f8('0x25')](db[_0x55f8('0x26')]['rawAttributes'],function(_0x298052){return{'name':_0x298052[_0x55f8('0x27')],'type':_0x298052[_0x55f8('0x28')][_0x55f8('0x29')]};});_0x39837e['model']=_[_0x55f8('0x25')](_0x125f3d,_0x55f8('0x23'));_0x39837e['query']=_[_0x55f8('0x2a')](_0x50a63d['query']);_0x39837e['filters']=_['intersection'](_0x39837e[_0x55f8('0x2b')],_0x39837e[_0x55f8('0x2c')]);_0x4b0b80[_0x55f8('0x2d')]=_[_0x55f8('0x2e')](_0x39837e[_0x55f8('0x2b')],qs[_0x55f8('0x2f')](_0x50a63d['query'][_0x55f8('0x2f')]));_0x4b0b80['attributes']=_0x4b0b80['attributes'][_0x55f8('0x30')]?_0x4b0b80[_0x55f8('0x2d')]:_0x39837e[_0x55f8('0x2b')];if(!_0x50a63d['query'][_0x55f8('0x31')](_0x55f8('0x32'))){_0x4b0b80[_0x55f8('0x19')]=qs['limit'](_0x50a63d[_0x55f8('0x2c')][_0x55f8('0x19')]);_0x4b0b80['offset']=qs[_0x55f8('0x18')](_0x50a63d[_0x55f8('0x2c')][_0x55f8('0x18')]);}_0x4b0b80[_0x55f8('0x33')]=qs['sort'](_0x50a63d['query']['sort']);_0x4b0b80[_0x55f8('0x34')]=qs['filters'](_['pick'](_0x50a63d['query'],_0x39837e[_0x55f8('0x35')]),_0x125f3d);if(_0x50a63d['query'][_0x55f8('0x36')]){_0x4b0b80[_0x55f8('0x34')]=_[_0x55f8('0x37')](_0x4b0b80['where'],{'$or':_['map'](_0x125f3d,function(_0x2e4d8a){if(_0x2e4d8a[_0x55f8('0x28')]!==_0x55f8('0x38')){var _0x5d2983={};_0x5d2983[_0x2e4d8a[_0x55f8('0x23')]]={'$like':'%'+_0x50a63d[_0x55f8('0x2c')][_0x55f8('0x36')]+'%'};return _0x5d2983;}})});}_0x4b0b80=_[_0x55f8('0x37')]({},_0x4b0b80,_0x50a63d[_0x55f8('0x39')]);var _0x401f91={'where':_0x4b0b80[_0x55f8('0x34')]};return db['Template'][_0x55f8('0x17')](_0x401f91)[_0x55f8('0x1d')](function(_0x23521b){_0xf5b3a6[_0x55f8('0x17')]=_0x23521b;if(_0x50a63d[_0x55f8('0x2c')][_0x55f8('0x3a')]){_0x4b0b80[_0x55f8('0x3b')]=[{'all':!![]}];}return db[_0x55f8('0x26')][_0x55f8('0x3c')](_0x4b0b80);})[_0x55f8('0x1d')](function(_0x55f1f1){_0xf5b3a6['rows']=_0x55f1f1;return _0xf5b3a6;})[_0x55f8('0x1d')](respondWithFilteredResult(_0x5a0c58,_0x4b0b80))['catch'](handleError(_0x5a0c58,null));};exports[_0x55f8('0x3d')]=function(_0x7e2d06,_0x44d441){var _0x4c0148={'raw':!![],'where':{'id':_0x7e2d06[_0x55f8('0x3e')]['id']}},_0x26ac41={};_0x26ac41[_0x55f8('0x2b')]=_[_0x55f8('0x2a')](db[_0x55f8('0x26')][_0x55f8('0x3f')]);_0x26ac41[_0x55f8('0x2c')]=_[_0x55f8('0x2a')](_0x7e2d06[_0x55f8('0x2c')]);_0x26ac41[_0x55f8('0x35')]=_[_0x55f8('0x2e')](_0x26ac41[_0x55f8('0x2b')],_0x26ac41['query']);_0x4c0148['attributes']=_['intersection'](_0x26ac41['model'],qs[_0x55f8('0x2f')](_0x7e2d06[_0x55f8('0x2c')]['fields']));_0x4c0148['attributes']=_0x4c0148['attributes'][_0x55f8('0x30')]?_0x4c0148[_0x55f8('0x2d')]:_0x26ac41[_0x55f8('0x2b')];if(_0x7e2d06['query']['includeAll']){_0x4c0148[_0x55f8('0x3b')]=[{'all':!![]}];}_0x4c0148=_[_0x55f8('0x37')]({},_0x4c0148,_0x7e2d06[_0x55f8('0x39')]);return db[_0x55f8('0x26')]['find'](_0x4c0148)['then'](handleEntityNotFound(_0x44d441,null))['then'](respondWithResult(_0x44d441,null))[_0x55f8('0x40')](handleError(_0x44d441,null));};exports[_0x55f8('0x41')]=function(_0x8b544b,_0x402a20){return db[_0x55f8('0x26')]['create'](_0x8b544b['body'],{})[_0x55f8('0x1d')](function(_0x34e221){var _0x3adfc8=_0x8b544b[_0x55f8('0x42')]['get']({'plain':!![]});if(!_0x3adfc8)throw new Error(_0x55f8('0x43'));if(_0x3adfc8[_0x55f8('0x44')]===_0x55f8('0x42')){var _0x25e543=_0x34e221[_0x55f8('0x1f')]({'plain':!![]});var _0x2d62f6='Templates';return db['UserProfileSection']['find']({'where':{'name':_0x2d62f6,'userProfileId':_0x3adfc8[_0x55f8('0x45')]},'raw':!![]})['then'](function(_0x47b00d){if(_0x47b00d&&_0x47b00d['autoAssociation']===0x0){return db[_0x55f8('0x20')][_0x55f8('0x41')]({'name':_0x25e543['name'],'resourceId':_0x25e543['id'],'type':_0x47b00d['name'],'sectionId':_0x47b00d['id']},{})[_0x55f8('0x1d')](function(){return _0x34e221;});}else{return _0x34e221;}})[_0x55f8('0x40')](function(_0x414945){logger['error'](_0x55f8('0x46'),_0x414945);throw _0x414945;});}return _0x34e221;})[_0x55f8('0x1d')](respondWithResult(_0x402a20,0xc9))[_0x55f8('0x40')](handleError(_0x402a20,null));};exports['update']=function(_0x159ec7,_0x343af0){if(_0x159ec7['body']['id']){delete _0x159ec7['body']['id'];}return db[_0x55f8('0x26')][_0x55f8('0x47')]({'where':{'id':_0x159ec7[_0x55f8('0x3e')]['id']}})[_0x55f8('0x1d')](handleEntityNotFound(_0x343af0,null))['then'](saveUpdates(_0x159ec7[_0x55f8('0x48')],null))[_0x55f8('0x1d')](respondWithResult(_0x343af0,null))[_0x55f8('0x40')](handleError(_0x343af0,null));};exports[_0x55f8('0x1e')]=function(_0x52f41d,_0x1690d9){return db[_0x55f8('0x26')]['find']({'where':{'id':_0x52f41d['params']['id']}})[_0x55f8('0x1d')](handleEntityNotFound(_0x1690d9,null))['then'](removeEntity(_0x1690d9,null))[_0x55f8('0x40')](handleError(_0x1690d9,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 7463bfc..ed1b5b5 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 _0xcdfd=['path','rimraf','./template.attributes','define','tools_templates','util','../../config/logger','api','moment','request-promise'];(function(_0x4d60ea,_0x59a54d){var _0x37fd5d=function(_0x52d541){while(--_0x52d541){_0x4d60ea['push'](_0x4d60ea['shift']());}};_0x37fd5d(++_0x59a54d);}(_0xcdfd,0x109));var _0xdcdf=function(_0x5c8957,_0x40f077){_0x5c8957=_0x5c8957-0x0;var _0x3e7ffb=_0xcdfd[_0x5c8957];return _0x3e7ffb;};'use strict';var _=require('lodash');var util=require(_0xdcdf('0x0'));var logger=require(_0xdcdf('0x1'))(_0xdcdf('0x2'));var moment=require(_0xdcdf('0x3'));var BPromise=require('bluebird');var rp=require(_0xdcdf('0x4'));var fs=require('fs');var path=require(_0xdcdf('0x5'));var rimraf=require(_0xdcdf('0x6'));var config=require('../../config/environment');var attributes=require(_0xdcdf('0x7'));module['exports']=function(_0x6be7a1,_0x12ff5a){return _0x6be7a1[_0xdcdf('0x8')]('Template',attributes,{'tableName':_0xdcdf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8912=['tools_templates','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Template'];(function(_0x25ffad,_0x4d4c32){var _0x103470=function(_0x167aa9){while(--_0x167aa9){_0x25ffad['push'](_0x25ffad['shift']());}};_0x103470(++_0x4d4c32);}(_0x8912,0xe8));var _0x2891=function(_0x43a707,_0x306a7a){_0x43a707=_0x43a707-0x0;var _0x1ca84e=_0x8912[_0x43a707];return _0x1ca84e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2891('0x0'))('api');var moment=require(_0x2891('0x1'));var BPromise=require(_0x2891('0x2'));var rp=require(_0x2891('0x3'));var fs=require('fs');var path=require(_0x2891('0x4'));var rimraf=require(_0x2891('0x5'));var config=require(_0x2891('0x6'));var attributes=require('./template.attributes');module[_0x2891('0x7')]=function(_0x43c411,_0x79fc70){return _0x43c411[_0x2891('0x8')](_0x2891('0x9'),attributes,{'tableName':_0x2891('0xa'),'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 c982ea9..3f26143 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 _0x25bd=['request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','include','map','model','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Template,\x20%s,\x20%s'];(function(_0x14c69e,_0x1d5493){var _0x2696ad=function(_0x52b93e){while(--_0x52b93e){_0x14c69e['push'](_0x14c69e['shift']());}};_0x2696ad(++_0x1d5493);}(_0x25bd,0x14e));var _0xd25b=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x25bd[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0xd25b('0x0'));var util=require(_0xd25b('0x1'));var moment=require(_0xd25b('0x2'));var BPromise=require('bluebird');var rs=require(_0xd25b('0x3'));var fs=require('fs');var Redis=require(_0xd25b('0x4'));var db=require(_0xd25b('0x5'))['db'];var utils=require(_0xd25b('0x6'));var logger=require(_0xd25b('0x7'))(_0xd25b('0x8'));var config=require(_0xd25b('0x9'));var jayson=require(_0xd25b('0xa'));var client=jayson[_0xd25b('0xb')][_0xd25b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f439c,_0xdb3cb8,_0x24acff){return new BPromise(function(_0x3d4fdc,_0x4e089a){return client[_0xd25b('0xd')](_0x4f439c,_0x24acff)['then'](function(_0x3d4b38){logger[_0xd25b('0xe')](_0xd25b('0xf'),_0xdb3cb8,_0xd25b('0x10'));logger[_0xd25b('0x11')](_0xd25b('0x12'),_0xdb3cb8,_0xd25b('0x10'),JSON[_0xd25b('0x13')](_0x3d4b38));if(_0x3d4b38[_0xd25b('0x14')]){if(_0x3d4b38[_0xd25b('0x14')]['code']===0x1f4){logger['error'](_0xd25b('0xf'),_0xdb3cb8,_0x3d4b38[_0xd25b('0x14')]['message']);return _0x4e089a(_0x3d4b38[_0xd25b('0x14')]['message']);}logger[_0xd25b('0x14')](_0xd25b('0xf'),_0xdb3cb8,_0x3d4b38[_0xd25b('0x14')][_0xd25b('0x15')]);return _0x3d4fdc(_0x3d4b38[_0xd25b('0x14')][_0xd25b('0x15')]);}else{logger[_0xd25b('0xe')]('Template,\x20%s,\x20%s',_0xdb3cb8,_0xd25b('0x10'));_0x3d4fdc(_0x3d4b38[_0xd25b('0x16')]['message']);}})[_0xd25b('0x17')](function(_0x23ffda){logger[_0xd25b('0x14')]('Template,\x20%s,\x20%s',_0xdb3cb8,_0x23ffda);_0x4e089a(_0x23ffda);});});}exports[_0xd25b('0x18')]=function(_0x49f80a){var _0x440a17=this;return new Promise(function(_0x3b3cf9,_0x54b99c){return db[_0xd25b('0x19')][_0xd25b('0x1a')]({'raw':_0x49f80a[_0xd25b('0x1b')]?_0x49f80a[_0xd25b('0x1b')][_0xd25b('0x1c')]===undefined?!![]:![]:!![],'where':_0x49f80a[_0xd25b('0x1b')]?_0x49f80a[_0xd25b('0x1b')][_0xd25b('0x1d')]||null:null,'attributes':_0x49f80a[_0xd25b('0x1b')]?_0x49f80a[_0xd25b('0x1b')][_0xd25b('0x1e')]||null:null,'limit':_0x49f80a[_0xd25b('0x1b')]?_0x49f80a[_0xd25b('0x1b')]['limit']||null:null,'include':_0x49f80a[_0xd25b('0x1b')]?_0x49f80a[_0xd25b('0x1b')][_0xd25b('0x1f')]?_[_0xd25b('0x20')](_0x49f80a[_0xd25b('0x1b')][_0xd25b('0x1f')],function(_0x11e104){return{'model':db[_0x11e104[_0xd25b('0x21')]],'as':_0x11e104['as'],'attributes':_0x11e104[_0xd25b('0x1e')],'include':_0x11e104['include']?_['map'](_0x11e104['include'],function(_0x161619){return{'model':db[_0x161619['model']],'as':_0x161619['as'],'attributes':_0x161619[_0xd25b('0x1e')],'include':_0x161619[_0xd25b('0x1f')]?_[_0xd25b('0x20')](_0x161619[_0xd25b('0x1f')],function(_0x538963){return{'model':db[_0x538963[_0xd25b('0x21')]],'as':_0x538963['as'],'attributes':_0x538963[_0xd25b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd25b('0x22')](function(_0x399986){logger[_0xd25b('0xe')]('GetTemplate',_0x49f80a);logger[_0xd25b('0x11')]('GetTemplate',_0x49f80a,JSON['stringify'](_0x399986));_0x3b3cf9(_0x399986);})[_0xd25b('0x17')](function(_0x2bd94d){logger[_0xd25b('0x14')]('GetTemplate',_0x2bd94d[_0xd25b('0x15')],_0x49f80a);_0x54b99c(_0x440a17[_0xd25b('0x14')](0x1f4,_0x2bd94d[_0xd25b('0x15')]));});});}; \ No newline at end of file +var _0x622f=['../../config/environment','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','Template','findAll','options','raw','where','attributes','include','model','map','GetTemplate','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x34d779,_0x42e118){var _0x10aec0=function(_0x3329fc){while(--_0x3329fc){_0x34d779['push'](_0x34d779['shift']());}};_0x10aec0(++_0x42e118);}(_0x622f,0x172));var _0xf622=function(_0x5ca5cb,_0x4a5c24){_0x5ca5cb=_0x5ca5cb-0x0;var _0x31c6b5=_0x622f[_0x5ca5cb];return _0x31c6b5;};'use strict';var _=require(_0xf622('0x0'));var util=require(_0xf622('0x1'));var moment=require('moment');var BPromise=require(_0xf622('0x2'));var rs=require(_0xf622('0x3'));var fs=require('fs');var Redis=require(_0xf622('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf622('0x5'));var logger=require('../../config/logger')(_0xf622('0x6'));var config=require(_0xf622('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf622('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x847984,_0x540b19,_0x4211d8){return new BPromise(function(_0x8b4fab,_0x54a7bc){return client['request'](_0x847984,_0x4211d8)[_0xf622('0x9')](function(_0x54f10a){logger[_0xf622('0xa')](_0xf622('0xb'),_0x540b19,_0xf622('0xc'));logger[_0xf622('0xd')]('Template,\x20%s,\x20%s,\x20%s',_0x540b19,_0xf622('0xc'),JSON[_0xf622('0xe')](_0x54f10a));if(_0x54f10a[_0xf622('0xf')]){if(_0x54f10a[_0xf622('0xf')]['code']===0x1f4){logger[_0xf622('0xf')](_0xf622('0xb'),_0x540b19,_0x54f10a[_0xf622('0xf')]['message']);return _0x54a7bc(_0x54f10a[_0xf622('0xf')][_0xf622('0x10')]);}logger[_0xf622('0xf')](_0xf622('0xb'),_0x540b19,_0x54f10a[_0xf622('0xf')][_0xf622('0x10')]);return _0x8b4fab(_0x54f10a['error'][_0xf622('0x10')]);}else{logger['info'](_0xf622('0xb'),_0x540b19,'request\x20sent');_0x8b4fab(_0x54f10a[_0xf622('0x11')][_0xf622('0x10')]);}})[_0xf622('0x12')](function(_0x52c66f){logger[_0xf622('0xf')](_0xf622('0xb'),_0x540b19,_0x52c66f);_0x54a7bc(_0x52c66f);});});}exports['GetTemplate']=function(_0x5e842e){var _0x4cc01a=this;return new Promise(function(_0x1a572d,_0x430c4a){return db[_0xf622('0x13')][_0xf622('0x14')]({'raw':_0x5e842e[_0xf622('0x15')]?_0x5e842e[_0xf622('0x15')][_0xf622('0x16')]===undefined?!![]:![]:!![],'where':_0x5e842e['options']?_0x5e842e[_0xf622('0x15')][_0xf622('0x17')]||null:null,'attributes':_0x5e842e[_0xf622('0x15')]?_0x5e842e[_0xf622('0x15')][_0xf622('0x18')]||null:null,'limit':_0x5e842e[_0xf622('0x15')]?_0x5e842e['options']['limit']||null:null,'include':_0x5e842e[_0xf622('0x15')]?_0x5e842e[_0xf622('0x15')]['include']?_['map'](_0x5e842e['options'][_0xf622('0x19')],function(_0x24552a){return{'model':db[_0x24552a[_0xf622('0x1a')]],'as':_0x24552a['as'],'attributes':_0x24552a[_0xf622('0x18')],'include':_0x24552a[_0xf622('0x19')]?_[_0xf622('0x1b')](_0x24552a[_0xf622('0x19')],function(_0x4b4c0d){return{'model':db[_0x4b4c0d[_0xf622('0x1a')]],'as':_0x4b4c0d['as'],'attributes':_0x4b4c0d[_0xf622('0x18')],'include':_0x4b4c0d[_0xf622('0x19')]?_[_0xf622('0x1b')](_0x4b4c0d[_0xf622('0x19')],function(_0x3805ec){return{'model':db[_0x3805ec['model']],'as':_0x3805ec['as'],'attributes':_0x3805ec[_0xf622('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x67834a){logger[_0xf622('0xa')]('GetTemplate',_0x5e842e);logger[_0xf622('0xd')](_0xf622('0x1c'),_0x5e842e,JSON[_0xf622('0xe')](_0x67834a));_0x1a572d(_0x67834a);})['catch'](function(_0x2c95c4){logger[_0xf622('0xf')](_0xf622('0x1c'),_0x2c95c4[_0xf622('0x10')],_0x5e842e);_0x430c4a(_0x4cc01a[_0xf622('0xf')](0x1f4,_0x2c95c4[_0xf622('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 9247dd9..e85d720 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 _0xf0c3=['/:id/any_conditions','getAnyConditions','/:id/actions','getActions','addAllCondition','addAnyCondition','addAction','put','update','delete','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','/:id','show','get','/:id/all_conditions','getAllConditions'];(function(_0x419c4a,_0x5d525d){var _0x4dae37=function(_0x95e7cd){while(--_0x95e7cd){_0x419c4a['push'](_0x419c4a['shift']());}};_0x4dae37(++_0x5d525d);}(_0xf0c3,0x142));var _0x3f0c=function(_0x1ff213,_0x338cf0){_0x1ff213=_0x1ff213-0x0;var _0x34f968=_0xf0c3[_0x1ff213];return _0x34f968;};'use strict';var multer=require(_0x3f0c('0x0'));var util=require('util');var path=require(_0x3f0c('0x1'));var timeout=require(_0x3f0c('0x2'));var express=require(_0x3f0c('0x3'));var router=express['Router']();var fs_extra=require(_0x3f0c('0x4'));var auth=require(_0x3f0c('0x5'));var interaction=require(_0x3f0c('0x6'));var config=require(_0x3f0c('0x7'));var controller=require(_0x3f0c('0x8'));router['get']('/',auth[_0x3f0c('0x9')](),controller[_0x3f0c('0xa')]);router['get'](_0x3f0c('0xb'),auth['isAuthenticated'](),controller[_0x3f0c('0xc')]);router[_0x3f0c('0xd')](_0x3f0c('0xe'),auth['isAuthenticated'](),controller[_0x3f0c('0xf')]);router[_0x3f0c('0xd')](_0x3f0c('0x10'),auth[_0x3f0c('0x9')](),controller[_0x3f0c('0x11')]);router[_0x3f0c('0xd')](_0x3f0c('0x12'),auth[_0x3f0c('0x9')](),controller[_0x3f0c('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x3f0c('0xe'),auth[_0x3f0c('0x9')](),controller[_0x3f0c('0x14')]);router['post'](_0x3f0c('0x10'),auth[_0x3f0c('0x9')](),controller[_0x3f0c('0x15')]);router['post'](_0x3f0c('0x12'),auth[_0x3f0c('0x9')](),controller[_0x3f0c('0x16')]);router[_0x3f0c('0x17')](_0x3f0c('0xb'),auth[_0x3f0c('0x9')](),controller[_0x3f0c('0x18')]);router[_0x3f0c('0x19')](_0x3f0c('0xb'),auth[_0x3f0c('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5815=['../../components/auth/service','../../components/interaction/service','./trigger.controller','isAuthenticated','index','get','/:id','show','/:id/any_conditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x13c5a9,_0x95fb6a){var _0x393ee6=function(_0x136d23){while(--_0x136d23){_0x13c5a9['push'](_0x13c5a9['shift']());}};_0x393ee6(++_0x95fb6a);}(_0x5815,0xdb));var _0x5581=function(_0x5a883a,_0x323811){_0x5a883a=_0x5a883a-0x0;var _0x204cb3=_0x5815[_0x5a883a];return _0x204cb3;};'use strict';var multer=require(_0x5581('0x0'));var util=require(_0x5581('0x1'));var path=require(_0x5581('0x2'));var timeout=require(_0x5581('0x3'));var express=require('express');var router=express[_0x5581('0x4')]();var fs_extra=require(_0x5581('0x5'));var auth=require(_0x5581('0x6'));var interaction=require(_0x5581('0x7'));var config=require('../../config/environment');var controller=require(_0x5581('0x8'));router['get']('/',auth[_0x5581('0x9')](),controller[_0x5581('0xa')]);router[_0x5581('0xb')](_0x5581('0xc'),auth['isAuthenticated'](),controller[_0x5581('0xd')]);router[_0x5581('0xb')]('/:id/all_conditions',auth[_0x5581('0x9')](),controller['getAllConditions']);router[_0x5581('0xb')](_0x5581('0xe'),auth['isAuthenticated'](),controller['getAnyConditions']);router[_0x5581('0xb')](_0x5581('0xf'),auth[_0x5581('0x9')](),controller[_0x5581('0x10')]);router[_0x5581('0x11')]('/',auth[_0x5581('0x9')](),controller['create']);router[_0x5581('0x11')]('/:id/all_conditions',auth[_0x5581('0x9')](),controller[_0x5581('0x12')]);router[_0x5581('0x11')]('/:id/any_conditions',auth[_0x5581('0x9')](),controller[_0x5581('0x13')]);router[_0x5581('0x11')](_0x5581('0xf'),auth[_0x5581('0x9')](),controller['addAction']);router[_0x5581('0x14')](_0x5581('0xc'),auth['isAuthenticated'](),controller[_0x5581('0x15')]);router[_0x5581('0x16')](_0x5581('0xc'),auth['isAuthenticated'](),controller[_0x5581('0x17')]);module[_0x5581('0x18')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 592e38c..993272c 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 _0x13ad=['STRING','BOOLEAN'];(function(_0x1f4bd5,_0x408499){var _0x417be5=function(_0x3146dd){while(--_0x3146dd){_0x1f4bd5['push'](_0x1f4bd5['shift']());}};_0x417be5(++_0x408499);}(_0x13ad,0xd8));var _0xd13a=function(_0x536525,_0xbca2e4){_0x536525=_0x536525-0x0;var _0x225d66=_0x13ad[_0x536525];return _0x225d66;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd13a('0x0')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd13a('0x0')]},'status':{'type':Sequelize[_0xd13a('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x2d03=['sequelize','STRING','BOOLEAN'];(function(_0x2d982d,_0x121028){var _0x4f36b0=function(_0x11f3a9){while(--_0x11f3a9){_0x2d982d['push'](_0x2d982d['shift']());}};_0x4f36b0(++_0x121028);}(_0x2d03,0xcf));var _0x32d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2d03[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x32d0('0x0'));module['exports']={'name':{'type':Sequelize[_0x32d0('0x1')]},'channel':{'type':Sequelize[_0x32d0('0x1')]},'description':{'type':Sequelize[_0x32d0('0x1')]},'status':{'type':Sequelize[_0x32d0('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index b3bd4bd..257deb9 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 _0xa83c=['catch','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','order','filter','getAnyConditions','length','TriggerId','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','Trigger','include','findAll','rows','show','params','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation'];(function(_0xa656ef,_0x3d31df){var _0x20e81=function(_0x128119){while(--_0x128119){_0xa656ef['push'](_0xa656ef['shift']());}};_0x20e81(++_0x3d31df);}(_0xa83c,0xce));var _0xca83=function(_0x296754,_0x5befe9){_0x296754=_0x296754-0x0;var _0x1d9f1d=_0xa83c[_0x296754];return _0x1d9f1d;};'use strict';var emlformat=require(_0xca83('0x0'));var rimraf=require(_0xca83('0x1'));var zipdir=require(_0xca83('0x2'));var jsonpatch=require(_0xca83('0x3'));var rp=require(_0xca83('0x4'));var moment=require(_0xca83('0x5'));var BPromise=require(_0xca83('0x6'));var Mustache=require(_0xca83('0x7'));var util=require(_0xca83('0x8'));var path=require(_0xca83('0x9'));var sox=require('sox');var csv=require(_0xca83('0xa'));var ejs=require(_0xca83('0xb'));var fs=require('fs');var fs_extra=require(_0xca83('0xc'));var _=require(_0xca83('0xd'));var squel=require(_0xca83('0xe'));var crypto=require(_0xca83('0xf'));var jsforce=require(_0xca83('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xca83('0xa'));var querystring=require(_0xca83('0x11'));var Papa=require(_0xca83('0x12'));var Redis=require(_0xca83('0x13'));var authService=require(_0xca83('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xca83('0x15'));var hardwareService=require(_0xca83('0x16'));var logger=require('../../config/logger')(_0xca83('0x17'));var utils=require(_0xca83('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xca83('0x19'))['db'];function respondWithStatusCode(_0x108443,_0x41ed7a){_0x41ed7a=_0x41ed7a||0xcc;return function(_0x23d2ed){if(_0x23d2ed){return _0x108443[_0xca83('0x1a')](_0x41ed7a);}return _0x108443[_0xca83('0x1b')](_0x41ed7a)['end']();};}function respondWithResult(_0x50e4aa,_0x5bb8fc){_0x5bb8fc=_0x5bb8fc||0xc8;return function(_0xd106b9){if(_0xd106b9){return _0x50e4aa[_0xca83('0x1b')](_0x5bb8fc)[_0xca83('0x1c')](_0xd106b9);}};}function respondWithFilteredResult(_0x518a58,_0x116586){return function(_0x50aed4){if(_0x50aed4){var _0xf41c42=typeof _0x116586['offset']==='undefined'&&typeof _0x116586[_0xca83('0x1d')]==='undefined';var _0x56bd04=_0x50aed4[_0xca83('0x1e')];var _0x33e686=_0xf41c42?0x0:_0x116586[_0xca83('0x1f')];var _0x5a6ba6=_0xf41c42?_0x50aed4[_0xca83('0x1e')]:_0x116586[_0xca83('0x1f')]+_0x116586[_0xca83('0x1d')];var _0x508f0e;if(_0x5a6ba6>=_0x56bd04){_0x5a6ba6=_0x56bd04;_0x508f0e=0xc8;}else{_0x508f0e=0xce;}_0x518a58['status'](_0x508f0e);return _0x518a58[_0xca83('0x20')](_0xca83('0x21'),_0x33e686+'-'+_0x5a6ba6+'/'+_0x56bd04)[_0xca83('0x1c')](_0x50aed4);}return null;};}function patchUpdates(_0x10e25f){return function(_0x5a4476){try{jsonpatch['apply'](_0x5a4476,_0x10e25f,!![]);}catch(_0x530131){return BPromise[_0xca83('0x22')](_0x530131);}return _0x5a4476[_0xca83('0x23')]();};}function saveUpdates(_0x43536f,_0x5a59a6){return function(_0xe4f29f){if(_0xe4f29f){return _0xe4f29f[_0xca83('0x24')](_0x43536f)[_0xca83('0x25')](function(_0xd671ea){return _0xd671ea;});}return null;};}function removeEntity(_0x1ea205,_0x56a70a){return function(_0x3079d2){if(_0x3079d2){return _0x3079d2[_0xca83('0x26')]()[_0xca83('0x25')](function(){var _0x1e10cc=_0x3079d2[_0xca83('0x27')]({'plain':!![]});var _0x4c3df0=_0xca83('0x28');return db[_0xca83('0x29')][_0xca83('0x26')]({'where':{'type':_0x4c3df0,'resourceId':_0x1e10cc['id']}})[_0xca83('0x25')](function(){return _0x3079d2;});})[_0xca83('0x25')](function(){_0x1ea205[_0xca83('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe06b4e,_0x1276c2){return function(_0x364b27){if(!_0x364b27){_0xe06b4e[_0xca83('0x1a')](0x194);}return _0x364b27;};}function handleError(_0x4105,_0x2c9009){_0x2c9009=_0x2c9009||0x1f4;return function(_0x2fcff4){logger[_0xca83('0x2a')](_0x2fcff4[_0xca83('0x2b')]);if(_0x2fcff4['name']){delete _0x2fcff4[_0xca83('0x2c')];}_0x4105[_0xca83('0x1b')](_0x2c9009)[_0xca83('0x2d')](_0x2fcff4);};}exports['index']=function(_0x35d9b2,_0x3f5a39){var _0x6f9b0a={},_0x1a4f92={},_0x2e883c={'count':0x0,'rows':[]};var _0x4f9189=_[_0xca83('0x2e')](db['Trigger']['rawAttributes'],function(_0x35b090){return{'name':_0x35b090[_0xca83('0x2f')],'type':_0x35b090[_0xca83('0x30')][_0xca83('0x31')]};});_0x1a4f92[_0xca83('0x32')]=_[_0xca83('0x2e')](_0x4f9189,'name');_0x1a4f92[_0xca83('0x33')]=_[_0xca83('0x34')](_0x35d9b2['query']);_0x1a4f92[_0xca83('0x35')]=_[_0xca83('0x36')](_0x1a4f92[_0xca83('0x32')],_0x1a4f92[_0xca83('0x33')]);_0x6f9b0a['attributes']=_[_0xca83('0x36')](_0x1a4f92['model'],qs[_0xca83('0x37')](_0x35d9b2[_0xca83('0x33')]['fields']));_0x6f9b0a['attributes']=_0x6f9b0a[_0xca83('0x38')]['length']?_0x6f9b0a['attributes']:_0x1a4f92[_0xca83('0x32')];if(!_0x35d9b2[_0xca83('0x33')][_0xca83('0x39')](_0xca83('0x3a'))){_0x6f9b0a[_0xca83('0x1d')]=qs[_0xca83('0x1d')](_0x35d9b2[_0xca83('0x33')]['limit']);_0x6f9b0a[_0xca83('0x1f')]=qs[_0xca83('0x1f')](_0x35d9b2[_0xca83('0x33')][_0xca83('0x1f')]);}_0x6f9b0a['order']=qs[_0xca83('0x3b')](_0x35d9b2[_0xca83('0x33')][_0xca83('0x3b')]);_0x6f9b0a[_0xca83('0x3c')]=qs['filters'](_[_0xca83('0x3d')](_0x35d9b2[_0xca83('0x33')],_0x1a4f92[_0xca83('0x35')]),_0x4f9189);if(_0x35d9b2[_0xca83('0x33')]['filter']){_0x6f9b0a[_0xca83('0x3c')]=_[_0xca83('0x3e')](_0x6f9b0a[_0xca83('0x3c')],{'$or':_[_0xca83('0x2e')](_0x4f9189,function(_0x31d4be){if(_0x31d4be['type']!==_0xca83('0x3f')){var _0x13cec5={};_0x13cec5[_0x31d4be[_0xca83('0x2c')]]={'$like':'%'+_0x35d9b2[_0xca83('0x33')]['filter']+'%'};return _0x13cec5;}})});}_0x6f9b0a=_[_0xca83('0x3e')]({},_0x6f9b0a,_0x35d9b2[_0xca83('0x40')]);var _0x1f7da5={'where':_0x6f9b0a['where']};return db[_0xca83('0x41')][_0xca83('0x1e')](_0x1f7da5)['then'](function(_0x4925d1){_0x2e883c['count']=_0x4925d1;if(_0x35d9b2[_0xca83('0x33')]['includeAll']){_0x6f9b0a[_0xca83('0x42')]=[{'all':!![]}];}return db['Trigger'][_0xca83('0x43')](_0x6f9b0a);})[_0xca83('0x25')](function(_0x16a6df){_0x2e883c[_0xca83('0x44')]=_0x16a6df;return _0x2e883c;})[_0xca83('0x25')](respondWithFilteredResult(_0x3f5a39,_0x6f9b0a))['catch'](handleError(_0x3f5a39,null));};exports[_0xca83('0x45')]=function(_0x3b7766,_0x2f68f8){var _0x2b742e={'raw':![],'where':{'id':_0x3b7766[_0xca83('0x46')]['id']}},_0xce376d={};_0xce376d['model']=_[_0xca83('0x34')](db[_0xca83('0x41')][_0xca83('0x47')]);_0xce376d['query']=_['keys'](_0x3b7766['query']);_0xce376d[_0xca83('0x35')]=_[_0xca83('0x36')](_0xce376d['model'],_0xce376d[_0xca83('0x33')]);_0x2b742e[_0xca83('0x38')]=_[_0xca83('0x36')](_0xce376d[_0xca83('0x32')],qs[_0xca83('0x37')](_0x3b7766['query'][_0xca83('0x37')]));_0x2b742e[_0xca83('0x38')]=_0x2b742e[_0xca83('0x38')]['length']?_0x2b742e[_0xca83('0x38')]:_0xce376d[_0xca83('0x32')];if(_0x3b7766[_0xca83('0x33')]['includeAll']){_0x2b742e[_0xca83('0x42')]=[{'all':!![]}];}_0x2b742e=_[_0xca83('0x3e')]({},_0x2b742e,_0x3b7766[_0xca83('0x40')]);return db[_0xca83('0x41')]['find'](_0x2b742e)[_0xca83('0x25')](handleEntityNotFound(_0x2f68f8,null))['then'](respondWithResult(_0x2f68f8,null))['catch'](handleError(_0x2f68f8,null));};exports['create']=function(_0x4ee3d4,_0x1b9154){return db[_0xca83('0x41')][_0xca83('0x48')](_0x4ee3d4['body'],{})['then'](function(_0x2a80f8){var _0x170cbf=_0x4ee3d4[_0xca83('0x49')][_0xca83('0x27')]({'plain':!![]});if(!_0x170cbf)throw new Error(_0xca83('0x4a'));if(_0x170cbf['role']===_0xca83('0x49')){var _0x1ed882=_0x2a80f8[_0xca83('0x27')]({'plain':!![]});var _0x4c915d=_0xca83('0x28');return db[_0xca83('0x4b')][_0xca83('0x4c')]({'where':{'name':_0x4c915d,'userProfileId':_0x170cbf[_0xca83('0x4d')]},'raw':!![]})['then'](function(_0x5d0802){if(_0x5d0802&&_0x5d0802[_0xca83('0x4e')]===0x0){return db[_0xca83('0x29')][_0xca83('0x48')]({'name':_0x1ed882[_0xca83('0x2c')],'resourceId':_0x1ed882['id'],'type':_0x5d0802[_0xca83('0x2c')],'sectionId':_0x5d0802['id']},{})[_0xca83('0x25')](function(){return _0x2a80f8;});}else{return _0x2a80f8;}})[_0xca83('0x4f')](function(_0x3074fb){logger[_0xca83('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3074fb);throw _0x3074fb;});}return _0x2a80f8;})[_0xca83('0x25')](respondWithResult(_0x1b9154,0xc9))['catch'](handleError(_0x1b9154,null));};exports[_0xca83('0x24')]=function(_0x556d4f,_0x52617d){if(_0x556d4f[_0xca83('0x50')]['id']){delete _0x556d4f['body']['id'];}return db['Trigger'][_0xca83('0x4c')]({'where':{'id':_0x556d4f[_0xca83('0x46')]['id']}})[_0xca83('0x25')](handleEntityNotFound(_0x52617d,null))[_0xca83('0x25')](saveUpdates(_0x556d4f[_0xca83('0x50')],null))['then'](respondWithResult(_0x52617d,null))[_0xca83('0x4f')](handleError(_0x52617d,null));};exports['destroy']=function(_0x10eac1,_0x5bfc2d){return db[_0xca83('0x41')][_0xca83('0x4c')]({'where':{'id':_0x10eac1[_0xca83('0x46')]['id']}})['then'](handleEntityNotFound(_0x5bfc2d,null))['then'](removeEntity(_0x5bfc2d,null))['catch'](handleError(_0x5bfc2d,null));};exports[_0xca83('0x51')]=function(_0x48806f,_0x3c5d16,_0x4fac0d){if(_0x48806f[_0xca83('0x50')]['id']){delete _0x48806f[_0xca83('0x50')]['id'];}return db['Trigger'][_0xca83('0x4c')]({'where':{'id':_0x48806f[_0xca83('0x46')]['id']}})[_0xca83('0x25')](handleEntityNotFound(_0x3c5d16,null))[_0xca83('0x25')](function(_0x46b51d){if(_0x46b51d){_0x48806f['body'][_0xca83('0x52')]=_0x46b51d['id'];return db[_0xca83('0x53')][_0xca83('0x48')](_0x48806f['body']);}})[_0xca83('0x25')](respondWithResult(_0x3c5d16,null))[_0xca83('0x4f')](handleError(_0x3c5d16,null));};exports[_0xca83('0x54')]=function(_0x791aea,_0x239217,_0x497c35){if(_0x791aea[_0xca83('0x50')]['id']){delete _0x791aea[_0xca83('0x50')]['id'];}return db[_0xca83('0x41')]['find']({'where':{'id':_0x791aea[_0xca83('0x46')]['id']}})[_0xca83('0x25')](handleEntityNotFound(_0x239217,null))[_0xca83('0x25')](function(_0x5593ee){if(_0x5593ee){_0x791aea[_0xca83('0x50')][_0xca83('0x55')]=_0x5593ee['id'];return db[_0xca83('0x53')][_0xca83('0x48')](_0x791aea[_0xca83('0x50')]);}})['then'](respondWithResult(_0x239217,null))[_0xca83('0x4f')](handleError(_0x239217,null));};exports[_0xca83('0x56')]=function(_0x1d4e74,_0x132852,_0x56a5fa){var _0x404995={};var _0x19abbb={};var _0x1b699d;var _0x334889;return db[_0xca83('0x41')][_0xca83('0x57')]({'where':{'id':_0x1d4e74[_0xca83('0x46')]['id']}})['then'](handleEntityNotFound(_0x132852,null))['then'](function(_0x43edb5){if(_0x43edb5){_0x1b699d=_0x43edb5;_0x19abbb['model']=_['keys'](db[_0xca83('0x53')][_0xca83('0x47')]);_0x19abbb[_0xca83('0x33')]=_[_0xca83('0x34')](_0x1d4e74['query']);_0x19abbb[_0xca83('0x35')]=_[_0xca83('0x36')](_0x19abbb['model'],_0x19abbb['query']);_0x404995[_0xca83('0x38')]=_[_0xca83('0x36')](_0x19abbb[_0xca83('0x32')],qs[_0xca83('0x37')](_0x1d4e74[_0xca83('0x33')]['fields']));_0x404995[_0xca83('0x38')]=_0x404995[_0xca83('0x38')]['length']?_0x404995[_0xca83('0x38')]:_0x19abbb[_0xca83('0x32')];_0x404995[_0xca83('0x58')]=qs[_0xca83('0x3b')](_0x1d4e74[_0xca83('0x33')][_0xca83('0x3b')]);_0x404995[_0xca83('0x3c')]=qs[_0xca83('0x35')](_[_0xca83('0x3d')](_0x1d4e74[_0xca83('0x33')],_0x19abbb['filters']));if(_0x1d4e74['query'][_0xca83('0x59')]){_0x404995[_0xca83('0x3c')]=_[_0xca83('0x3e')](_0x404995['where'],{'$or':_['map'](_0x404995[_0xca83('0x38')],function(_0x199007){var _0x50701c={};_0x50701c[_0x199007]={'$like':'%'+_0x1d4e74[_0xca83('0x33')]['filter']+'%'};return _0x50701c;})});}_0x404995=_[_0xca83('0x3e')]({},_0x404995,_0x1d4e74[_0xca83('0x40')]);return _0x1b699d[_0xca83('0x56')](_0x404995);}})['then'](function(_0x345d03){if(_0x345d03){_0x334889=_0x345d03['length'];if(!_0x1d4e74[_0xca83('0x33')][_0xca83('0x39')](_0xca83('0x3a'))){_0x404995[_0xca83('0x1d')]=qs[_0xca83('0x1d')](_0x1d4e74[_0xca83('0x33')][_0xca83('0x1d')]);_0x404995[_0xca83('0x1f')]=qs['offset'](_0x1d4e74[_0xca83('0x33')][_0xca83('0x1f')]);}return _0x1b699d[_0xca83('0x56')](_0x404995);}})[_0xca83('0x25')](function(_0x3671ae){if(_0x3671ae){return _0x3671ae?{'count':_0x334889,'rows':_0x3671ae}:null;}})['then'](respondWithResult(_0x132852,null))[_0xca83('0x4f')](handleError(_0x132852,null));};exports[_0xca83('0x5a')]=function(_0xecfeb2,_0x49a96d,_0x338a2e){var _0xf180cc={};var _0x18631d={};var _0x425d44;var _0x1969f7;return db['Trigger'][_0xca83('0x57')]({'where':{'id':_0xecfeb2[_0xca83('0x46')]['id']}})[_0xca83('0x25')](handleEntityNotFound(_0x49a96d,null))['then'](function(_0x266634){if(_0x266634){_0x425d44=_0x266634;_0x18631d['model']=_['keys'](db[_0xca83('0x53')]['rawAttributes']);_0x18631d[_0xca83('0x33')]=_[_0xca83('0x34')](_0xecfeb2['query']);_0x18631d[_0xca83('0x35')]=_[_0xca83('0x36')](_0x18631d[_0xca83('0x32')],_0x18631d[_0xca83('0x33')]);_0xf180cc[_0xca83('0x38')]=_['intersection'](_0x18631d[_0xca83('0x32')],qs[_0xca83('0x37')](_0xecfeb2[_0xca83('0x33')][_0xca83('0x37')]));_0xf180cc['attributes']=_0xf180cc[_0xca83('0x38')][_0xca83('0x5b')]?_0xf180cc[_0xca83('0x38')]:_0x18631d['model'];_0xf180cc[_0xca83('0x58')]=qs['sort'](_0xecfeb2[_0xca83('0x33')][_0xca83('0x3b')]);_0xf180cc[_0xca83('0x3c')]=qs[_0xca83('0x35')](_[_0xca83('0x3d')](_0xecfeb2[_0xca83('0x33')],_0x18631d['filters']));if(_0xecfeb2[_0xca83('0x33')][_0xca83('0x59')]){_0xf180cc[_0xca83('0x3c')]=_[_0xca83('0x3e')](_0xf180cc[_0xca83('0x3c')],{'$or':_[_0xca83('0x2e')](_0xf180cc[_0xca83('0x38')],function(_0x5b7aa5){var _0x51682c={};_0x51682c[_0x5b7aa5]={'$like':'%'+_0xecfeb2[_0xca83('0x33')][_0xca83('0x59')]+'%'};return _0x51682c;})});}_0xf180cc=_[_0xca83('0x3e')]({},_0xf180cc,_0xecfeb2[_0xca83('0x40')]);return _0x425d44[_0xca83('0x5a')](_0xf180cc);}})[_0xca83('0x25')](function(_0x384603){if(_0x384603){_0x1969f7=_0x384603['length'];if(!_0xecfeb2['query'][_0xca83('0x39')](_0xca83('0x3a'))){_0xf180cc['limit']=qs[_0xca83('0x1d')](_0xecfeb2[_0xca83('0x33')][_0xca83('0x1d')]);_0xf180cc['offset']=qs['offset'](_0xecfeb2[_0xca83('0x33')][_0xca83('0x1f')]);}return _0x425d44['getAnyConditions'](_0xf180cc);}})[_0xca83('0x25')](function(_0x9cd570){if(_0x9cd570){return _0x9cd570?{'count':_0x1969f7,'rows':_0x9cd570}:null;}})['then'](respondWithResult(_0x49a96d,null))[_0xca83('0x4f')](handleError(_0x49a96d,null));};exports['addAction']=function(_0x353354,_0x5d0ca9,_0x9c9eef){if(_0x353354[_0xca83('0x50')]['id']){delete _0x353354[_0xca83('0x50')]['id'];}return db[_0xca83('0x41')][_0xca83('0x4c')]({'where':{'id':_0x353354[_0xca83('0x46')]['id']}})[_0xca83('0x25')](handleEntityNotFound(_0x5d0ca9,null))[_0xca83('0x25')](function(_0x24d82f){if(_0x24d82f){_0x353354[_0xca83('0x50')][_0xca83('0x5c')]=_0x24d82f['id'];return db['Action'][_0xca83('0x48')](_0x353354[_0xca83('0x50')]);}})[_0xca83('0x25')](respondWithResult(_0x5d0ca9,null))[_0xca83('0x4f')](handleError(_0x5d0ca9,null));};exports[_0xca83('0x5d')]=function(_0x2cea89,_0x4b051b,_0x41137c){var _0x30ec3f={};var _0x3bb34f={};var _0xd30557;var _0x3c19d6;return db[_0xca83('0x41')][_0xca83('0x57')]({'where':{'id':_0x2cea89[_0xca83('0x46')]['id']}})[_0xca83('0x25')](handleEntityNotFound(_0x4b051b,null))['then'](function(_0x95fb65){if(_0x95fb65){_0xd30557=_0x95fb65;_0x3bb34f[_0xca83('0x32')]=_[_0xca83('0x34')](db[_0xca83('0x5e')][_0xca83('0x47')]);_0x3bb34f[_0xca83('0x33')]=_[_0xca83('0x34')](_0x2cea89[_0xca83('0x33')]);_0x3bb34f[_0xca83('0x35')]=_[_0xca83('0x36')](_0x3bb34f[_0xca83('0x32')],_0x3bb34f[_0xca83('0x33')]);_0x30ec3f[_0xca83('0x38')]=_[_0xca83('0x36')](_0x3bb34f[_0xca83('0x32')],qs['fields'](_0x2cea89['query'][_0xca83('0x37')]));_0x30ec3f[_0xca83('0x38')]=_0x30ec3f[_0xca83('0x38')][_0xca83('0x5b')]?_0x30ec3f[_0xca83('0x38')]:_0x3bb34f[_0xca83('0x32')];_0x30ec3f[_0xca83('0x58')]=qs['sort'](_0x2cea89[_0xca83('0x33')][_0xca83('0x3b')]);_0x30ec3f['where']=qs[_0xca83('0x35')](_[_0xca83('0x3d')](_0x2cea89['query'],_0x3bb34f['filters']));if(_0x2cea89[_0xca83('0x33')]['filter']){_0x30ec3f['where']=_[_0xca83('0x3e')](_0x30ec3f[_0xca83('0x3c')],{'$or':_[_0xca83('0x2e')](_0x30ec3f[_0xca83('0x38')],function(_0x17e74a){var _0x2aff8a={};_0x2aff8a[_0x17e74a]={'$like':'%'+_0x2cea89[_0xca83('0x33')]['filter']+'%'};return _0x2aff8a;})});}_0x30ec3f=_[_0xca83('0x3e')]({},_0x30ec3f,_0x2cea89[_0xca83('0x40')]);return _0xd30557[_0xca83('0x5d')](_0x30ec3f);}})[_0xca83('0x25')](function(_0x8da1c7){if(_0x8da1c7){_0x3c19d6=_0x8da1c7['length'];if(!_0x2cea89[_0xca83('0x33')][_0xca83('0x39')]('nolimit')){_0x30ec3f[_0xca83('0x1d')]=qs[_0xca83('0x1d')](_0x2cea89[_0xca83('0x33')][_0xca83('0x1d')]);_0x30ec3f[_0xca83('0x1f')]=qs[_0xca83('0x1f')](_0x2cea89[_0xca83('0x33')][_0xca83('0x1f')]);}return _0xd30557[_0xca83('0x5d')](_0x30ec3f);}})['then'](function(_0x47e54d){if(_0x47e54d){return _0x47e54d?{'count':_0x3c19d6,'rows':_0x47e54d}:null;}})['then'](respondWithResult(_0x4b051b,null))['catch'](handleError(_0x4b051b,null));}; \ No newline at end of file +var _0x8ad4=['findOne','getAnyConditions','addAction','TriggerId','Action','getActions','order','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','Trigger','includeAll','include','findAll','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Triggers','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions'];(function(_0x54549d,_0x39f0e6){var _0x5388b4=function(_0x3bd58a){while(--_0x3bd58a){_0x54549d['push'](_0x54549d['shift']());}};_0x5388b4(++_0x39f0e6);}(_0x8ad4,0x183));var _0x48ad=function(_0x5883e0,_0x5410f5){_0x5883e0=_0x5883e0-0x0;var _0x49e5a2=_0x8ad4[_0x5883e0];return _0x49e5a2;};'use strict';var emlformat=require(_0x48ad('0x0'));var rimraf=require(_0x48ad('0x1'));var zipdir=require(_0x48ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x48ad('0x3'));var moment=require(_0x48ad('0x4'));var BPromise=require(_0x48ad('0x5'));var Mustache=require(_0x48ad('0x6'));var util=require('util');var path=require(_0x48ad('0x7'));var sox=require(_0x48ad('0x8'));var csv=require(_0x48ad('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x48ad('0xa'));var _=require(_0x48ad('0xb'));var squel=require(_0x48ad('0xc'));var crypto=require('crypto');var jsforce=require(_0x48ad('0xd'));var deskjs=require(_0x48ad('0xe'));var toCsv=require(_0x48ad('0x9'));var querystring=require(_0x48ad('0xf'));var Papa=require('papaparse');var Redis=require(_0x48ad('0x10'));var authService=require(_0x48ad('0x11'));var qs=require(_0x48ad('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x48ad('0x13'));var logger=require(_0x48ad('0x14'))(_0x48ad('0x15'));var utils=require(_0x48ad('0x16'));var config=require(_0x48ad('0x17'));var licenseUtil=require(_0x48ad('0x18'));var db=require(_0x48ad('0x19'))['db'];function respondWithStatusCode(_0x5384cf,_0x33ae89){_0x33ae89=_0x33ae89||0xcc;return function(_0x5da2da){if(_0x5da2da){return _0x5384cf[_0x48ad('0x1a')](_0x33ae89);}return _0x5384cf[_0x48ad('0x1b')](_0x33ae89)[_0x48ad('0x1c')]();};}function respondWithResult(_0x56d5e1,_0x5db801){_0x5db801=_0x5db801||0xc8;return function(_0x46f732){if(_0x46f732){return _0x56d5e1['status'](_0x5db801)['json'](_0x46f732);}};}function respondWithFilteredResult(_0x15d0f7,_0x8c45ad){return function(_0x517f1d){if(_0x517f1d){var _0x30f25d=typeof _0x8c45ad[_0x48ad('0x1d')]===_0x48ad('0x1e')&&typeof _0x8c45ad[_0x48ad('0x1f')]===_0x48ad('0x1e');var _0x1890c0=_0x517f1d[_0x48ad('0x20')];var _0x544572=_0x30f25d?0x0:_0x8c45ad[_0x48ad('0x1d')];var _0x2e4e00=_0x30f25d?_0x517f1d[_0x48ad('0x20')]:_0x8c45ad['offset']+_0x8c45ad['limit'];var _0x44e905;if(_0x2e4e00>=_0x1890c0){_0x2e4e00=_0x1890c0;_0x44e905=0xc8;}else{_0x44e905=0xce;}_0x15d0f7[_0x48ad('0x1b')](_0x44e905);return _0x15d0f7['set']('Content-Range',_0x544572+'-'+_0x2e4e00+'/'+_0x1890c0)[_0x48ad('0x21')](_0x517f1d);}return null;};}function patchUpdates(_0x540e18){return function(_0x265bb8){try{jsonpatch[_0x48ad('0x22')](_0x265bb8,_0x540e18,!![]);}catch(_0x3cc87a){return BPromise[_0x48ad('0x23')](_0x3cc87a);}return _0x265bb8['save']();};}function saveUpdates(_0x17bf84,_0x536490){return function(_0x2e5057){if(_0x2e5057){return _0x2e5057['update'](_0x17bf84)[_0x48ad('0x24')](function(_0x9178be){return _0x9178be;});}return null;};}function removeEntity(_0x33ee80,_0x21737a){return function(_0x2ec354){if(_0x2ec354){return _0x2ec354[_0x48ad('0x25')]()[_0x48ad('0x24')](function(){var _0x1a8428=_0x2ec354[_0x48ad('0x26')]({'plain':!![]});var _0x2e5e52='Triggers';return db[_0x48ad('0x27')][_0x48ad('0x25')]({'where':{'type':_0x2e5e52,'resourceId':_0x1a8428['id']}})[_0x48ad('0x24')](function(){return _0x2ec354;});})[_0x48ad('0x24')](function(){_0x33ee80['status'](0xcc)[_0x48ad('0x1c')]();});}};}function handleEntityNotFound(_0x489ece,_0x5888ea){return function(_0x48e125){if(!_0x48e125){_0x489ece[_0x48ad('0x1a')](0x194);}return _0x48e125;};}function handleError(_0x47d836,_0x58e69e){_0x58e69e=_0x58e69e||0x1f4;return function(_0x71e58e){logger[_0x48ad('0x28')](_0x71e58e[_0x48ad('0x29')]);if(_0x71e58e[_0x48ad('0x2a')]){delete _0x71e58e[_0x48ad('0x2a')];}_0x47d836['status'](_0x58e69e)['send'](_0x71e58e);};}exports[_0x48ad('0x2b')]=function(_0x1c6c56,_0x4e2288){var _0x289f00={},_0x5bb581={},_0x4245ab={'count':0x0,'rows':[]};var _0x57a7a5=_[_0x48ad('0x2c')](db['Trigger'][_0x48ad('0x2d')],function(_0x76c2be){return{'name':_0x76c2be[_0x48ad('0x2e')],'type':_0x76c2be[_0x48ad('0x2f')][_0x48ad('0x30')]};});_0x5bb581[_0x48ad('0x31')]=_[_0x48ad('0x2c')](_0x57a7a5,_0x48ad('0x2a'));_0x5bb581[_0x48ad('0x32')]=_[_0x48ad('0x33')](_0x1c6c56[_0x48ad('0x32')]);_0x5bb581[_0x48ad('0x34')]=_[_0x48ad('0x35')](_0x5bb581['model'],_0x5bb581[_0x48ad('0x32')]);_0x289f00[_0x48ad('0x36')]=_['intersection'](_0x5bb581[_0x48ad('0x31')],qs[_0x48ad('0x37')](_0x1c6c56[_0x48ad('0x32')][_0x48ad('0x37')]));_0x289f00['attributes']=_0x289f00[_0x48ad('0x36')][_0x48ad('0x38')]?_0x289f00[_0x48ad('0x36')]:_0x5bb581[_0x48ad('0x31')];if(!_0x1c6c56[_0x48ad('0x32')][_0x48ad('0x39')](_0x48ad('0x3a'))){_0x289f00[_0x48ad('0x1f')]=qs['limit'](_0x1c6c56['query'][_0x48ad('0x1f')]);_0x289f00[_0x48ad('0x1d')]=qs['offset'](_0x1c6c56[_0x48ad('0x32')][_0x48ad('0x1d')]);}_0x289f00['order']=qs[_0x48ad('0x3b')](_0x1c6c56[_0x48ad('0x32')][_0x48ad('0x3b')]);_0x289f00[_0x48ad('0x3c')]=qs[_0x48ad('0x34')](_[_0x48ad('0x3d')](_0x1c6c56['query'],_0x5bb581['filters']),_0x57a7a5);if(_0x1c6c56['query']['filter']){_0x289f00[_0x48ad('0x3c')]=_[_0x48ad('0x3e')](_0x289f00[_0x48ad('0x3c')],{'$or':_[_0x48ad('0x2c')](_0x57a7a5,function(_0x258695){if(_0x258695[_0x48ad('0x2f')]!==_0x48ad('0x3f')){var _0x256bc9={};_0x256bc9[_0x258695[_0x48ad('0x2a')]]={'$like':'%'+_0x1c6c56[_0x48ad('0x32')][_0x48ad('0x40')]+'%'};return _0x256bc9;}})});}_0x289f00=_[_0x48ad('0x3e')]({},_0x289f00,_0x1c6c56[_0x48ad('0x41')]);var _0x1f4464={'where':_0x289f00[_0x48ad('0x3c')]};return db[_0x48ad('0x42')][_0x48ad('0x20')](_0x1f4464)[_0x48ad('0x24')](function(_0x3d621e){_0x4245ab['count']=_0x3d621e;if(_0x1c6c56[_0x48ad('0x32')][_0x48ad('0x43')]){_0x289f00[_0x48ad('0x44')]=[{'all':!![]}];}return db[_0x48ad('0x42')][_0x48ad('0x45')](_0x289f00);})[_0x48ad('0x24')](function(_0x2d0a6c){_0x4245ab['rows']=_0x2d0a6c;return _0x4245ab;})['then'](respondWithFilteredResult(_0x4e2288,_0x289f00))[_0x48ad('0x46')](handleError(_0x4e2288,null));};exports[_0x48ad('0x47')]=function(_0x2659a8,_0x3a276d){var _0x47d61f={'raw':![],'where':{'id':_0x2659a8['params']['id']}},_0x51ac75={};_0x51ac75['model']=_['keys'](db[_0x48ad('0x42')]['rawAttributes']);_0x51ac75['query']=_[_0x48ad('0x33')](_0x2659a8[_0x48ad('0x32')]);_0x51ac75[_0x48ad('0x34')]=_[_0x48ad('0x35')](_0x51ac75[_0x48ad('0x31')],_0x51ac75[_0x48ad('0x32')]);_0x47d61f[_0x48ad('0x36')]=_[_0x48ad('0x35')](_0x51ac75[_0x48ad('0x31')],qs[_0x48ad('0x37')](_0x2659a8[_0x48ad('0x32')][_0x48ad('0x37')]));_0x47d61f['attributes']=_0x47d61f['attributes'][_0x48ad('0x38')]?_0x47d61f['attributes']:_0x51ac75[_0x48ad('0x31')];if(_0x2659a8[_0x48ad('0x32')]['includeAll']){_0x47d61f[_0x48ad('0x44')]=[{'all':!![]}];}_0x47d61f=_[_0x48ad('0x3e')]({},_0x47d61f,_0x2659a8[_0x48ad('0x41')]);return db[_0x48ad('0x42')][_0x48ad('0x48')](_0x47d61f)[_0x48ad('0x24')](handleEntityNotFound(_0x3a276d,null))[_0x48ad('0x24')](respondWithResult(_0x3a276d,null))[_0x48ad('0x46')](handleError(_0x3a276d,null));};exports[_0x48ad('0x49')]=function(_0x556d6b,_0x4b8b55){return db[_0x48ad('0x42')][_0x48ad('0x49')](_0x556d6b[_0x48ad('0x4a')],{})[_0x48ad('0x24')](function(_0x1c294c){var _0x3925e2=_0x556d6b[_0x48ad('0x4b')][_0x48ad('0x26')]({'plain':!![]});if(!_0x3925e2)throw new Error(_0x48ad('0x4c'));if(_0x3925e2['role']===_0x48ad('0x4b')){var _0x52eeb8=_0x1c294c['get']({'plain':!![]});var _0x111452=_0x48ad('0x4d');return db[_0x48ad('0x4e')]['find']({'where':{'name':_0x111452,'userProfileId':_0x3925e2[_0x48ad('0x4f')]},'raw':!![]})[_0x48ad('0x24')](function(_0x5f4372){if(_0x5f4372&&_0x5f4372['autoAssociation']===0x0){return db[_0x48ad('0x27')]['create']({'name':_0x52eeb8[_0x48ad('0x2a')],'resourceId':_0x52eeb8['id'],'type':_0x5f4372[_0x48ad('0x2a')],'sectionId':_0x5f4372['id']},{})['then'](function(){return _0x1c294c;});}else{return _0x1c294c;}})[_0x48ad('0x46')](function(_0xa5b98e){logger[_0x48ad('0x28')](_0x48ad('0x50'),_0xa5b98e);throw _0xa5b98e;});}return _0x1c294c;})[_0x48ad('0x24')](respondWithResult(_0x4b8b55,0xc9))['catch'](handleError(_0x4b8b55,null));};exports[_0x48ad('0x51')]=function(_0x3cd018,_0x362f8c){if(_0x3cd018[_0x48ad('0x4a')]['id']){delete _0x3cd018[_0x48ad('0x4a')]['id'];}return db[_0x48ad('0x42')][_0x48ad('0x48')]({'where':{'id':_0x3cd018[_0x48ad('0x52')]['id']}})[_0x48ad('0x24')](handleEntityNotFound(_0x362f8c,null))[_0x48ad('0x24')](saveUpdates(_0x3cd018[_0x48ad('0x4a')],null))['then'](respondWithResult(_0x362f8c,null))[_0x48ad('0x46')](handleError(_0x362f8c,null));};exports['destroy']=function(_0x2e3249,_0xf4df74){return db[_0x48ad('0x42')][_0x48ad('0x48')]({'where':{'id':_0x2e3249[_0x48ad('0x52')]['id']}})[_0x48ad('0x24')](handleEntityNotFound(_0xf4df74,null))[_0x48ad('0x24')](removeEntity(_0xf4df74,null))[_0x48ad('0x46')](handleError(_0xf4df74,null));};exports[_0x48ad('0x53')]=function(_0x880f26,_0x12af8b,_0x3567ca){if(_0x880f26[_0x48ad('0x4a')]['id']){delete _0x880f26[_0x48ad('0x4a')]['id'];}return db[_0x48ad('0x42')][_0x48ad('0x48')]({'where':{'id':_0x880f26[_0x48ad('0x52')]['id']}})['then'](handleEntityNotFound(_0x12af8b,null))[_0x48ad('0x24')](function(_0x38a4b2){if(_0x38a4b2){_0x880f26[_0x48ad('0x4a')][_0x48ad('0x54')]=_0x38a4b2['id'];return db[_0x48ad('0x55')][_0x48ad('0x49')](_0x880f26[_0x48ad('0x4a')]);}})[_0x48ad('0x24')](respondWithResult(_0x12af8b,null))[_0x48ad('0x46')](handleError(_0x12af8b,null));};exports['addAnyCondition']=function(_0xb3d877,_0x1f69af,_0x9e7649){if(_0xb3d877[_0x48ad('0x4a')]['id']){delete _0xb3d877[_0x48ad('0x4a')]['id'];}return db[_0x48ad('0x42')][_0x48ad('0x48')]({'where':{'id':_0xb3d877[_0x48ad('0x52')]['id']}})[_0x48ad('0x24')](handleEntityNotFound(_0x1f69af,null))['then'](function(_0x16a288){if(_0x16a288){_0xb3d877[_0x48ad('0x4a')][_0x48ad('0x56')]=_0x16a288['id'];return db['Condition']['create'](_0xb3d877['body']);}})[_0x48ad('0x24')](respondWithResult(_0x1f69af,null))[_0x48ad('0x46')](handleError(_0x1f69af,null));};exports[_0x48ad('0x57')]=function(_0x155bc2,_0x982dcf,_0xa902f3){var _0x582635={};var _0xbfe102={};var _0x4ab04a;var _0x3d1baf;return db[_0x48ad('0x42')][_0x48ad('0x58')]({'where':{'id':_0x155bc2['params']['id']}})[_0x48ad('0x24')](handleEntityNotFound(_0x982dcf,null))[_0x48ad('0x24')](function(_0x256045){if(_0x256045){_0x4ab04a=_0x256045;_0xbfe102['model']=_[_0x48ad('0x33')](db[_0x48ad('0x55')][_0x48ad('0x2d')]);_0xbfe102[_0x48ad('0x32')]=_[_0x48ad('0x33')](_0x155bc2[_0x48ad('0x32')]);_0xbfe102['filters']=_[_0x48ad('0x35')](_0xbfe102[_0x48ad('0x31')],_0xbfe102[_0x48ad('0x32')]);_0x582635['attributes']=_['intersection'](_0xbfe102[_0x48ad('0x31')],qs['fields'](_0x155bc2[_0x48ad('0x32')]['fields']));_0x582635[_0x48ad('0x36')]=_0x582635[_0x48ad('0x36')][_0x48ad('0x38')]?_0x582635[_0x48ad('0x36')]:_0xbfe102[_0x48ad('0x31')];_0x582635['order']=qs[_0x48ad('0x3b')](_0x155bc2[_0x48ad('0x32')][_0x48ad('0x3b')]);_0x582635[_0x48ad('0x3c')]=qs[_0x48ad('0x34')](_[_0x48ad('0x3d')](_0x155bc2['query'],_0xbfe102[_0x48ad('0x34')]));if(_0x155bc2[_0x48ad('0x32')][_0x48ad('0x40')]){_0x582635[_0x48ad('0x3c')]=_[_0x48ad('0x3e')](_0x582635['where'],{'$or':_[_0x48ad('0x2c')](_0x582635['attributes'],function(_0x20bba7){var _0x25435f={};_0x25435f[_0x20bba7]={'$like':'%'+_0x155bc2['query']['filter']+'%'};return _0x25435f;})});}_0x582635=_['merge']({},_0x582635,_0x155bc2['options']);return _0x4ab04a[_0x48ad('0x57')](_0x582635);}})[_0x48ad('0x24')](function(_0x436ce9){if(_0x436ce9){_0x3d1baf=_0x436ce9['length'];if(!_0x155bc2[_0x48ad('0x32')][_0x48ad('0x39')](_0x48ad('0x3a'))){_0x582635[_0x48ad('0x1f')]=qs[_0x48ad('0x1f')](_0x155bc2['query'][_0x48ad('0x1f')]);_0x582635[_0x48ad('0x1d')]=qs[_0x48ad('0x1d')](_0x155bc2['query'][_0x48ad('0x1d')]);}return _0x4ab04a[_0x48ad('0x57')](_0x582635);}})[_0x48ad('0x24')](function(_0x3485ab){if(_0x3485ab){return _0x3485ab?{'count':_0x3d1baf,'rows':_0x3485ab}:null;}})['then'](respondWithResult(_0x982dcf,null))[_0x48ad('0x46')](handleError(_0x982dcf,null));};exports[_0x48ad('0x59')]=function(_0x44e3a3,_0x24bbda,_0xd1599b){var _0xbe0189={};var _0x26606c={};var _0x2f6443;var _0x213826;return db[_0x48ad('0x42')][_0x48ad('0x58')]({'where':{'id':_0x44e3a3[_0x48ad('0x52')]['id']}})[_0x48ad('0x24')](handleEntityNotFound(_0x24bbda,null))[_0x48ad('0x24')](function(_0x4c6c1a){if(_0x4c6c1a){_0x2f6443=_0x4c6c1a;_0x26606c[_0x48ad('0x31')]=_[_0x48ad('0x33')](db['Condition'][_0x48ad('0x2d')]);_0x26606c['query']=_[_0x48ad('0x33')](_0x44e3a3[_0x48ad('0x32')]);_0x26606c['filters']=_[_0x48ad('0x35')](_0x26606c[_0x48ad('0x31')],_0x26606c[_0x48ad('0x32')]);_0xbe0189[_0x48ad('0x36')]=_[_0x48ad('0x35')](_0x26606c[_0x48ad('0x31')],qs[_0x48ad('0x37')](_0x44e3a3[_0x48ad('0x32')]['fields']));_0xbe0189[_0x48ad('0x36')]=_0xbe0189[_0x48ad('0x36')][_0x48ad('0x38')]?_0xbe0189[_0x48ad('0x36')]:_0x26606c[_0x48ad('0x31')];_0xbe0189['order']=qs['sort'](_0x44e3a3[_0x48ad('0x32')][_0x48ad('0x3b')]);_0xbe0189[_0x48ad('0x3c')]=qs[_0x48ad('0x34')](_[_0x48ad('0x3d')](_0x44e3a3[_0x48ad('0x32')],_0x26606c[_0x48ad('0x34')]));if(_0x44e3a3[_0x48ad('0x32')]['filter']){_0xbe0189[_0x48ad('0x3c')]=_[_0x48ad('0x3e')](_0xbe0189[_0x48ad('0x3c')],{'$or':_[_0x48ad('0x2c')](_0xbe0189[_0x48ad('0x36')],function(_0x300d82){var _0xca8f29={};_0xca8f29[_0x300d82]={'$like':'%'+_0x44e3a3[_0x48ad('0x32')][_0x48ad('0x40')]+'%'};return _0xca8f29;})});}_0xbe0189=_[_0x48ad('0x3e')]({},_0xbe0189,_0x44e3a3[_0x48ad('0x41')]);return _0x2f6443[_0x48ad('0x59')](_0xbe0189);}})['then'](function(_0x4e3e98){if(_0x4e3e98){_0x213826=_0x4e3e98[_0x48ad('0x38')];if(!_0x44e3a3[_0x48ad('0x32')][_0x48ad('0x39')](_0x48ad('0x3a'))){_0xbe0189[_0x48ad('0x1f')]=qs[_0x48ad('0x1f')](_0x44e3a3[_0x48ad('0x32')][_0x48ad('0x1f')]);_0xbe0189[_0x48ad('0x1d')]=qs[_0x48ad('0x1d')](_0x44e3a3[_0x48ad('0x32')]['offset']);}return _0x2f6443[_0x48ad('0x59')](_0xbe0189);}})['then'](function(_0x245eac){if(_0x245eac){return _0x245eac?{'count':_0x213826,'rows':_0x245eac}:null;}})['then'](respondWithResult(_0x24bbda,null))[_0x48ad('0x46')](handleError(_0x24bbda,null));};exports[_0x48ad('0x5a')]=function(_0x352f58,_0x3dd2c6,_0x4c5dac){if(_0x352f58['body']['id']){delete _0x352f58[_0x48ad('0x4a')]['id'];}return db['Trigger'][_0x48ad('0x48')]({'where':{'id':_0x352f58[_0x48ad('0x52')]['id']}})[_0x48ad('0x24')](handleEntityNotFound(_0x3dd2c6,null))[_0x48ad('0x24')](function(_0x39357d){if(_0x39357d){_0x352f58[_0x48ad('0x4a')][_0x48ad('0x5b')]=_0x39357d['id'];return db[_0x48ad('0x5c')][_0x48ad('0x49')](_0x352f58['body']);}})['then'](respondWithResult(_0x3dd2c6,null))[_0x48ad('0x46')](handleError(_0x3dd2c6,null));};exports[_0x48ad('0x5d')]=function(_0x16af5f,_0x16ba72,_0x93c330){var _0x5a5f26={};var _0x59dbe9={};var _0x1e10fd;var _0xd58a18;return db[_0x48ad('0x42')][_0x48ad('0x58')]({'where':{'id':_0x16af5f[_0x48ad('0x52')]['id']}})[_0x48ad('0x24')](handleEntityNotFound(_0x16ba72,null))[_0x48ad('0x24')](function(_0x2cb720){if(_0x2cb720){_0x1e10fd=_0x2cb720;_0x59dbe9[_0x48ad('0x31')]=_['keys'](db[_0x48ad('0x5c')][_0x48ad('0x2d')]);_0x59dbe9['query']=_[_0x48ad('0x33')](_0x16af5f[_0x48ad('0x32')]);_0x59dbe9[_0x48ad('0x34')]=_[_0x48ad('0x35')](_0x59dbe9[_0x48ad('0x31')],_0x59dbe9[_0x48ad('0x32')]);_0x5a5f26['attributes']=_[_0x48ad('0x35')](_0x59dbe9[_0x48ad('0x31')],qs[_0x48ad('0x37')](_0x16af5f[_0x48ad('0x32')][_0x48ad('0x37')]));_0x5a5f26[_0x48ad('0x36')]=_0x5a5f26[_0x48ad('0x36')][_0x48ad('0x38')]?_0x5a5f26[_0x48ad('0x36')]:_0x59dbe9[_0x48ad('0x31')];_0x5a5f26[_0x48ad('0x5e')]=qs[_0x48ad('0x3b')](_0x16af5f['query'][_0x48ad('0x3b')]);_0x5a5f26[_0x48ad('0x3c')]=qs[_0x48ad('0x34')](_[_0x48ad('0x3d')](_0x16af5f[_0x48ad('0x32')],_0x59dbe9[_0x48ad('0x34')]));if(_0x16af5f[_0x48ad('0x32')][_0x48ad('0x40')]){_0x5a5f26[_0x48ad('0x3c')]=_[_0x48ad('0x3e')](_0x5a5f26['where'],{'$or':_[_0x48ad('0x2c')](_0x5a5f26['attributes'],function(_0x2a28ad){var _0x2c9291={};_0x2c9291[_0x2a28ad]={'$like':'%'+_0x16af5f[_0x48ad('0x32')][_0x48ad('0x40')]+'%'};return _0x2c9291;})});}_0x5a5f26=_[_0x48ad('0x3e')]({},_0x5a5f26,_0x16af5f[_0x48ad('0x41')]);return _0x1e10fd[_0x48ad('0x5d')](_0x5a5f26);}})[_0x48ad('0x24')](function(_0x3ca7f2){if(_0x3ca7f2){_0xd58a18=_0x3ca7f2[_0x48ad('0x38')];if(!_0x16af5f[_0x48ad('0x32')][_0x48ad('0x39')](_0x48ad('0x3a'))){_0x5a5f26['limit']=qs['limit'](_0x16af5f[_0x48ad('0x32')][_0x48ad('0x1f')]);_0x5a5f26['offset']=qs[_0x48ad('0x1d')](_0x16af5f[_0x48ad('0x32')]['offset']);}return _0x1e10fd['getActions'](_0x5a5f26);}})[_0x48ad('0x24')](function(_0x4c5885){if(_0x4c5885){return _0x4c5885?{'count':_0xd58a18,'rows':_0x4c5885}:null;}})[_0x48ad('0x24')](respondWithResult(_0x16ba72,null))['catch'](handleError(_0x16ba72,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index ab4f2f3..777723c 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 _0xf987=['bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','../../config/logger','api'];(function(_0x1a2cdb,_0x125fb7){var _0x13223b=function(_0x45c90e){while(--_0x45c90e){_0x1a2cdb['push'](_0x1a2cdb['shift']());}};_0x13223b(++_0x125fb7);}(_0xf987,0x18a));var _0x7f98=function(_0x2165c3,_0x1dd6f7){_0x2165c3=_0x2165c3-0x0;var _0x8fc34b=_0xf987[_0x2165c3];return _0x8fc34b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7f98('0x0'))(_0x7f98('0x1'));var moment=require('moment');var BPromise=require(_0x7f98('0x2'));var rp=require(_0x7f98('0x3'));var fs=require('fs');var path=require(_0x7f98('0x4'));var rimraf=require(_0x7f98('0x5'));var config=require(_0x7f98('0x6'));var attributes=require(_0x7f98('0x7'));module[_0x7f98('0x8')]=function(_0x3b5abb,_0x3fb8e2){return _0x3b5abb[_0x7f98('0x9')](_0x7f98('0xa'),attributes,{'tableName':_0x7f98('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x093a=['Trigger','tools_triggers','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x093a,0x16a));var _0xa093=function(_0x2650e9,_0xb91cc){_0x2650e9=_0x2650e9-0x0;var _0x3511c8=_0x093a[_0x2650e9];return _0x3511c8;};'use strict';var _=require('lodash');var util=require(_0xa093('0x0'));var logger=require(_0xa093('0x1'))(_0xa093('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa093('0x3'));var fs=require('fs');var path=require(_0xa093('0x4'));var rimraf=require(_0xa093('0x5'));var config=require(_0xa093('0x6'));var attributes=require(_0xa093('0x7'));module[_0xa093('0x8')]=function(_0x2346f1,_0x145f58){return _0x2346f1[_0xa093('0x9')](_0xa093('0xa'),attributes,{'tableName':_0xa093('0xb'),'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 15bc332..214e280 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 _0x883d=['Trigger,\x20%s,\x20%s','message','info','GetTrigger','Trigger','options','raw','where','attributes','limit','include','map','model','catch','ShowTrigger','lodash','util','moment','ioredis','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x883d,0xc3));var _0xd883=function(_0x56f49a,_0x3bc289){_0x56f49a=_0x56f49a-0x0;var _0x3c42a3=_0x883d[_0x56f49a];return _0x3c42a3;};'use strict';var _=require(_0xd883('0x0'));var util=require(_0xd883('0x1'));var moment=require(_0xd883('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd883('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd883('0x4'));var jayson=require(_0xd883('0x5'));var client=jayson[_0xd883('0x6')][_0xd883('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x292d57,_0x345986,_0xf0ff9f){return new BPromise(function(_0x3175a3,_0x305478){return client['request'](_0x292d57,_0xf0ff9f)[_0xd883('0x8')](function(_0x497e42){logger['info']('Trigger,\x20%s,\x20%s',_0x345986,_0xd883('0x9'));logger[_0xd883('0xa')](_0xd883('0xb'),_0x345986,_0xd883('0x9'),JSON[_0xd883('0xc')](_0x497e42));if(_0x497e42['error']){if(_0x497e42['error'][_0xd883('0xd')]===0x1f4){logger[_0xd883('0xe')](_0xd883('0xf'),_0x345986,_0x497e42[_0xd883('0xe')]['message']);return _0x305478(_0x497e42[_0xd883('0xe')][_0xd883('0x10')]);}logger['error'](_0xd883('0xf'),_0x345986,_0x497e42['error'][_0xd883('0x10')]);return _0x3175a3(_0x497e42[_0xd883('0xe')][_0xd883('0x10')]);}else{logger[_0xd883('0x11')](_0xd883('0xf'),_0x345986,'request\x20sent');_0x3175a3(_0x497e42['result'][_0xd883('0x10')]);}})['catch'](function(_0x1ed050){logger[_0xd883('0xe')](_0xd883('0xf'),_0x345986,_0x1ed050);_0x305478(_0x1ed050);});});}exports[_0xd883('0x12')]=function(_0x591d8a){var _0x3f02c2=this;return new Promise(function(_0xbac973,_0x2ddeb8){return db[_0xd883('0x13')]['findAll']({'raw':_0x591d8a[_0xd883('0x14')]?_0x591d8a[_0xd883('0x14')][_0xd883('0x15')]===undefined?!![]:![]:!![],'where':_0x591d8a[_0xd883('0x14')]?_0x591d8a[_0xd883('0x14')][_0xd883('0x16')]||null:null,'attributes':_0x591d8a[_0xd883('0x14')]?_0x591d8a[_0xd883('0x14')][_0xd883('0x17')]||null:null,'limit':_0x591d8a['options']?_0x591d8a[_0xd883('0x14')][_0xd883('0x18')]||null:null,'include':_0x591d8a[_0xd883('0x14')]?_0x591d8a[_0xd883('0x14')][_0xd883('0x19')]?_[_0xd883('0x1a')](_0x591d8a['options'][_0xd883('0x19')],function(_0xebb7e3){return{'model':db[_0xebb7e3[_0xd883('0x1b')]],'as':_0xebb7e3['as'],'attributes':_0xebb7e3[_0xd883('0x17')],'include':_0xebb7e3['include']?_[_0xd883('0x1a')](_0xebb7e3[_0xd883('0x19')],function(_0x21e8bf){return{'model':db[_0x21e8bf['model']],'as':_0x21e8bf['as'],'attributes':_0x21e8bf[_0xd883('0x17')],'include':_0x21e8bf[_0xd883('0x19')]?_[_0xd883('0x1a')](_0x21e8bf['include'],function(_0x3f8ebe){return{'model':db[_0x3f8ebe['model']],'as':_0x3f8ebe['as'],'attributes':_0x3f8ebe[_0xd883('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd883('0x8')](function(_0x4307fb){logger[_0xd883('0x11')](_0xd883('0x12'),_0x591d8a);logger[_0xd883('0xa')](_0xd883('0x12'),_0x591d8a,JSON[_0xd883('0xc')](_0x4307fb));_0xbac973(_0x4307fb);})[_0xd883('0x1c')](function(_0x42c0f4){logger['error']('GetTrigger',_0x42c0f4[_0xd883('0x10')],_0x591d8a);_0x2ddeb8(_0x3f02c2[_0xd883('0xe')](0x1f4,_0x42c0f4[_0xd883('0x10')]));});});};exports[_0xd883('0x1d')]=function(_0x2b01b0){var _0x29698c=this;return new Promise(function(_0x5a3e27,_0x239c45){return db['Trigger']['find']({'raw':_0x2b01b0[_0xd883('0x14')]?_0x2b01b0[_0xd883('0x14')][_0xd883('0x15')]===undefined?!![]:![]:!![],'where':_0x2b01b0['options']?_0x2b01b0[_0xd883('0x14')]['where']||null:null,'attributes':_0x2b01b0[_0xd883('0x14')]?_0x2b01b0['options']['attributes']||null:null,'include':_0x2b01b0[_0xd883('0x14')]?_0x2b01b0[_0xd883('0x14')][_0xd883('0x19')]?_['map'](_0x2b01b0[_0xd883('0x14')][_0xd883('0x19')],function(_0x4586b1){return{'model':db[_0x4586b1['model']],'as':_0x4586b1['as'],'attributes':_0x4586b1[_0xd883('0x17')],'include':_0x4586b1['include']?_[_0xd883('0x1a')](_0x4586b1[_0xd883('0x19')],function(_0x250311){return{'model':db[_0x250311[_0xd883('0x1b')]],'as':_0x250311['as'],'attributes':_0x250311[_0xd883('0x17')],'include':_0x250311[_0xd883('0x19')]?_[_0xd883('0x1a')](_0x250311[_0xd883('0x19')],function(_0x1d35d0){return{'model':db[_0x1d35d0[_0xd883('0x1b')]],'as':_0x1d35d0['as'],'attributes':_0x1d35d0[_0xd883('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd883('0x8')](function(_0x44436c){logger[_0xd883('0x11')](_0xd883('0x1d'),_0x2b01b0);logger[_0xd883('0xa')](_0xd883('0x1d'),_0x2b01b0,JSON[_0xd883('0xc')](_0x44436c));_0x5a3e27(_0x44436c);})[_0xd883('0x1c')](function(_0x13808d){logger[_0xd883('0xe')](_0xd883('0x1d'),_0x13808d[_0xd883('0x10')],_0x2b01b0);_0x239c45(_0x29698c[_0xd883('0xe')](0x1f4,_0x13808d[_0xd883('0x10')]));});});}; \ No newline at end of file +var _0x29ca=['client','request','info','Trigger,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','then','ShowTrigger','find','model','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x2b7748,_0x256db9){var _0x45f027=function(_0x28e272){while(--_0x28e272){_0x2b7748['push'](_0x2b7748['shift']());}};_0x45f027(++_0x256db9);}(_0x29ca,0x1a6));var _0xa29c=function(_0x187d80,_0x5b793f){_0x187d80=_0x187d80-0x0;var _0x498a77=_0x29ca[_0x187d80];return _0x498a77;};'use strict';var _=require(_0xa29c('0x0'));var util=require('util');var moment=require(_0xa29c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa29c('0x2'));var db=require(_0xa29c('0x3'))['db'];var utils=require(_0xa29c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa29c('0x5'));var jayson=require(_0xa29c('0x6'));var client=jayson[_0xa29c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19a037,_0x3994d2,_0x5cc38b){return new BPromise(function(_0x554984,_0x5b5c3b){return client[_0xa29c('0x8')](_0x19a037,_0x5cc38b)['then'](function(_0x58b3a2){logger[_0xa29c('0x9')](_0xa29c('0xa'),_0x3994d2,'request\x20sent');logger[_0xa29c('0xb')]('Trigger,\x20%s,\x20%s,\x20%s',_0x3994d2,_0xa29c('0xc'),JSON[_0xa29c('0xd')](_0x58b3a2));if(_0x58b3a2['error']){if(_0x58b3a2['error'][_0xa29c('0xe')]===0x1f4){logger[_0xa29c('0xf')]('Trigger,\x20%s,\x20%s',_0x3994d2,_0x58b3a2['error'][_0xa29c('0x10')]);return _0x5b5c3b(_0x58b3a2[_0xa29c('0xf')][_0xa29c('0x10')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x3994d2,_0x58b3a2[_0xa29c('0xf')][_0xa29c('0x10')]);return _0x554984(_0x58b3a2[_0xa29c('0xf')][_0xa29c('0x10')]);}else{logger['info'](_0xa29c('0xa'),_0x3994d2,_0xa29c('0xc'));_0x554984(_0x58b3a2[_0xa29c('0x11')][_0xa29c('0x10')]);}})[_0xa29c('0x12')](function(_0x1381c8){logger[_0xa29c('0xf')](_0xa29c('0xa'),_0x3994d2,_0x1381c8);_0x5b5c3b(_0x1381c8);});});}exports[_0xa29c('0x13')]=function(_0x1b3730){var _0x25ea74=this;return new Promise(function(_0x5905d8,_0x41b46c){return db[_0xa29c('0x14')][_0xa29c('0x15')]({'raw':_0x1b3730[_0xa29c('0x16')]?_0x1b3730[_0xa29c('0x16')][_0xa29c('0x17')]===undefined?!![]:![]:!![],'where':_0x1b3730['options']?_0x1b3730['options'][_0xa29c('0x18')]||null:null,'attributes':_0x1b3730[_0xa29c('0x16')]?_0x1b3730['options'][_0xa29c('0x19')]||null:null,'limit':_0x1b3730['options']?_0x1b3730[_0xa29c('0x16')][_0xa29c('0x1a')]||null:null,'include':_0x1b3730['options']?_0x1b3730[_0xa29c('0x16')][_0xa29c('0x1b')]?_[_0xa29c('0x1c')](_0x1b3730[_0xa29c('0x16')]['include'],function(_0x15d88d){return{'model':db[_0x15d88d['model']],'as':_0x15d88d['as'],'attributes':_0x15d88d[_0xa29c('0x19')],'include':_0x15d88d[_0xa29c('0x1b')]?_[_0xa29c('0x1c')](_0x15d88d[_0xa29c('0x1b')],function(_0x1c7eeb){return{'model':db[_0x1c7eeb['model']],'as':_0x1c7eeb['as'],'attributes':_0x1c7eeb[_0xa29c('0x19')],'include':_0x1c7eeb[_0xa29c('0x1b')]?_[_0xa29c('0x1c')](_0x1c7eeb['include'],function(_0x50a682){return{'model':db[_0x50a682['model']],'as':_0x50a682['as'],'attributes':_0x50a682[_0xa29c('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa29c('0x1d')](function(_0x311352){logger['info'](_0xa29c('0x13'),_0x1b3730);logger[_0xa29c('0xb')](_0xa29c('0x13'),_0x1b3730,JSON[_0xa29c('0xd')](_0x311352));_0x5905d8(_0x311352);})[_0xa29c('0x12')](function(_0x59d82c){logger[_0xa29c('0xf')](_0xa29c('0x13'),_0x59d82c[_0xa29c('0x10')],_0x1b3730);_0x41b46c(_0x25ea74[_0xa29c('0xf')](0x1f4,_0x59d82c[_0xa29c('0x10')]));});});};exports[_0xa29c('0x1e')]=function(_0x33ac68){var _0x3fad73=this;return new Promise(function(_0x1c366b,_0xb9cda0){return db[_0xa29c('0x14')][_0xa29c('0x1f')]({'raw':_0x33ac68[_0xa29c('0x16')]?_0x33ac68['options'][_0xa29c('0x17')]===undefined?!![]:![]:!![],'where':_0x33ac68['options']?_0x33ac68[_0xa29c('0x16')][_0xa29c('0x18')]||null:null,'attributes':_0x33ac68[_0xa29c('0x16')]?_0x33ac68[_0xa29c('0x16')][_0xa29c('0x19')]||null:null,'include':_0x33ac68[_0xa29c('0x16')]?_0x33ac68['options']['include']?_[_0xa29c('0x1c')](_0x33ac68[_0xa29c('0x16')][_0xa29c('0x1b')],function(_0x40eab9){return{'model':db[_0x40eab9[_0xa29c('0x20')]],'as':_0x40eab9['as'],'attributes':_0x40eab9[_0xa29c('0x19')],'include':_0x40eab9['include']?_[_0xa29c('0x1c')](_0x40eab9[_0xa29c('0x1b')],function(_0x504b4d){return{'model':db[_0x504b4d['model']],'as':_0x504b4d['as'],'attributes':_0x504b4d[_0xa29c('0x19')],'include':_0x504b4d[_0xa29c('0x1b')]?_[_0xa29c('0x1c')](_0x504b4d[_0xa29c('0x1b')],function(_0x688032){return{'model':db[_0x688032[_0xa29c('0x20')]],'as':_0x688032['as'],'attributes':_0x688032[_0xa29c('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a62aa){logger[_0xa29c('0x9')](_0xa29c('0x1e'),_0x33ac68);logger[_0xa29c('0xb')](_0xa29c('0x1e'),_0x33ac68,JSON['stringify'](_0x5a62aa));_0x1c366b(_0x5a62aa);})['catch'](function(_0x51d8da){logger['error'](_0xa29c('0x1e'),_0x51d8da['message'],_0x33ac68);_0xb9cda0(_0x3fad73['error'](0x1f4,_0x51d8da[_0xa29c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 56f106b..5cd1204 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 _0x8cb3=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','show','post','create','put','/:id'];(function(_0x257adc,_0x3018ea){var _0x3b0c44=function(_0x10cf9b){while(--_0x10cf9b){_0x257adc['push'](_0x257adc['shift']());}};_0x3b0c44(++_0x3018ea);}(_0x8cb3,0x19f));var _0x38cb=function(_0x16f4c7,_0x37c2f3){_0x16f4c7=_0x16f4c7-0x0;var _0x3c681a=_0x8cb3[_0x16f4c7];return _0x3c681a;};'use strict';var multer=require(_0x38cb('0x0'));var util=require(_0x38cb('0x1'));var path=require('path');var timeout=require(_0x38cb('0x2'));var express=require(_0x38cb('0x3'));var router=express[_0x38cb('0x4')]();var fs_extra=require(_0x38cb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x38cb('0x6'));var config=require(_0x38cb('0x7'));var controller=require(_0x38cb('0x8'));router[_0x38cb('0x9')]('/',auth[_0x38cb('0xa')](),controller[_0x38cb('0xb')]);router[_0x38cb('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x38cb('0xc')]);router[_0x38cb('0xd')]('/:id/clone',auth['isAuthenticated'](),controller['clone']);router['post']('/',auth[_0x38cb('0xa')](),controller[_0x38cb('0xe')]);router[_0x38cb('0xf')](_0x38cb('0x10'),auth[_0x38cb('0xa')](),controller['update']);router['delete'](_0x38cb('0x10'),auth[_0x38cb('0xa')](),controller['destroy']);module[_0x38cb('0x11')]=router; \ No newline at end of file +var _0xbede=['exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','post','/:id/clone','clone','create','put','/:id','update','destroy'];(function(_0x2de53d,_0x2a0af2){var _0xc487c4=function(_0x292826){while(--_0x292826){_0x2de53d['push'](_0x2de53d['shift']());}};_0xc487c4(++_0x2a0af2);}(_0xbede,0x16a));var _0xebed=function(_0x209e76,_0x391793){_0x209e76=_0x209e76-0x0;var _0x266a39=_0xbede[_0x209e76];return _0x266a39;};'use strict';var multer=require(_0xebed('0x0'));var util=require(_0xebed('0x1'));var path=require(_0xebed('0x2'));var timeout=require(_0xebed('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xebed('0x4'));var interaction=require(_0xebed('0x5'));var config=require(_0xebed('0x6'));var controller=require(_0xebed('0x7'));router[_0xebed('0x8')]('/',auth[_0xebed('0x9')](),controller['index']);router['get']('/:id',auth[_0xebed('0x9')](),controller['show']);router[_0xebed('0xa')](_0xebed('0xb'),auth[_0xebed('0x9')](),controller[_0xebed('0xc')]);router[_0xebed('0xa')]('/',auth[_0xebed('0x9')](),controller[_0xebed('0xd')]);router[_0xebed('0xe')](_0xebed('0xf'),auth[_0xebed('0x9')](),controller[_0xebed('0x10')]);router['delete'](_0xebed('0xf'),auth[_0xebed('0x9')](),controller[_0xebed('0x11')]);module[_0xebed('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index a7c17e8..9caa8ea 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 _0x98aa=['friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','rfc2833','info','shortinfo','inband','auto','yes','force_rport,comedia','nat','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','\x22\x22\x20<>','always','refuse','originate','uac','uas','pai','certificate','active','actpass','nonat','update','update,nonat','sequelize','exports','STRING','name','ENUM'];(function(_0xf5802e,_0x346340){var _0x55133d=function(_0x306b00){while(--_0x306b00){_0xf5802e['push'](_0xf5802e['shift']());}};_0x55133d(++_0x346340);}(_0x98aa,0x167));var _0xa98a=function(_0x2ec94a,_0x211406){_0x2ec94a=_0x2ec94a-0x0;var _0x5e4c25=_0x98aa[_0x2ec94a];return _0x5e4c25;};'use strict';var Sequelize=require(_0xa98a('0x0'));module[_0xa98a('0x1')]={'name':{'type':Sequelize[_0xa98a('0x2')],'allowNull':![],'unique':_0xa98a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x5'),_0xa98a('0x6'),_0xa98a('0x7')),'allowNull':![],'defaultValue':_0xa98a('0x5')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa98a('0x8')},'callingpres':{'type':Sequelize['ENUM'](_0xa98a('0x9'),_0xa98a('0xa'),_0xa98a('0xb'),_0xa98a('0xc'),_0xa98a('0xd'),_0xa98a('0xe'),_0xa98a('0xf'),_0xa98a('0x10'))},'deny':{'type':Sequelize[_0xa98a('0x2')]},'permit':{'type':Sequelize[_0xa98a('0x2')]},'secret':{'type':Sequelize[_0xa98a('0x2')]},'md5secret':{'type':Sequelize[_0xa98a('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xa98a('0x2')],'defaultValue':_0xa98a('0x11'),'set':function(_0x56c958){this[_0xa98a('0x12')](_0xa98a('0x13'),_0x56c958?_0x56c958[_0xa98a('0x14')](','):null);},'get':function(){return this[_0xa98a('0x15')](_0xa98a('0x13'))?this[_0xa98a('0x15')](_0xa98a('0x13'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x16'),_0xa98a('0x17'),_0xa98a('0x18'),_0xa98a('0x19'),_0xa98a('0x1a')),'defaultValue':_0xa98a('0x16')},'directmedia':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x1b'),'no','nonat','update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa98a('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa98a('0x2')]},'directmediadeny':{'type':Sequelize[_0xa98a('0x2')]},'nat':{'type':Sequelize[_0xa98a('0x2')],'defaultValue':_0xa98a('0x1c'),'set':function(_0x1b6e89){this['setDataValue']('nat',_0x1b6e89?_0x1b6e89[_0xa98a('0x14')](','):null);},'get':function(){return this['getDataValue'](_0xa98a('0x1d'))?this[_0xa98a('0x15')](_0xa98a('0x1d'))[_0xa98a('0x1e')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xa98a('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xa98a('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa98a('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa98a('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xa98a('0x1f')},'allow':{'type':Sequelize[_0xa98a('0x2')],'allowNull':![],'defaultValue':_0xa98a('0x20'),'set':function(_0x537544){this[_0xa98a('0x12')]('allow',_0x537544?_0x537544['join'](';'):_0xa98a('0x20'));},'get':function(){return this[_0xa98a('0x15')](_0xa98a('0x21'))?this[_0xa98a('0x15')]('allow')[_0xa98a('0x1e')](';'):null;},'comment':_0xa98a('0x22')},'autoframing':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x1b'),'no')},'insecure':{'type':Sequelize[_0xa98a('0x2')],'defaultValue':_0xa98a('0x23'),'set':function(_0x47306c){this[_0xa98a('0x12')](_0xa98a('0x24'),_0x47306c?_0x47306c[_0xa98a('0x14')](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0xa98a('0x15')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x1b'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa98a('0x4')]('yes','no',_0xa98a('0x25'))},'promiscredir':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x1b'),'no')},'useclientcode':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x1b'),'no')},'accountcode':{'type':Sequelize[_0xa98a('0x26')](0xb)},'setvar':{'type':Sequelize[_0xa98a('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xa98a('0x27')},'amaflags':{'type':Sequelize[_0xa98a('0x2')]},'callcounter':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x1b'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xa98a('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x1b'),'no')},'allowsubscribe':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x1b'),'no')},'allowtransfer':{'type':Sequelize[_0xa98a('0x4')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x1b'),'no')},'subscribecontext':{'type':Sequelize[_0xa98a('0x2')]},'template':{'type':Sequelize[_0xa98a('0x2')]},'videosupport':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x1b'),'no',_0xa98a('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xa98a('0x4')]('yes','no')},'mailbox':{'type':Sequelize[_0xa98a('0x2')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xa98a('0x29'),_0xa98a('0x2a'))},'session_expires':{'type':Sequelize[_0xa98a('0x26')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xa98a('0x2b'),_0xa98a('0x2c')),'defaultValue':_0xa98a('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0xa98a('0x2')]},'regexten':{'type':Sequelize[_0xa98a('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xa98a('0x2')]},'port':{'type':Sequelize[_0xa98a('0x26')](0x5)},'qualify':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x1b'),'no'),'defaultValue':_0xa98a('0x1b')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xa98a('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xa98a('0x4')]('yes','no',_0xa98a('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa98a('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xa98a('0x26')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xa98a('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0xa98a('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xa98a('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xa98a('0x2')]},'use_q850_reason':{'type':Sequelize[_0xa98a('0x2')]},'maxforwards':{'type':Sequelize[_0xa98a('0x26')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xa98a('0x1b'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xa98a('0x1b'),'no')},'force_avp':{'type':Sequelize[_0xa98a('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x1b'),'no')},'dtlsenable':{'type':Sequelize[_0xa98a('0x4')]('yes','no')},'dtlsverify':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x1b'),'no','fingerprint',_0xa98a('0x2e'))},'dtlsrekey':{'type':Sequelize[_0xa98a('0x26')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xa98a('0x2')]},'dtlscipher':{'type':Sequelize[_0xa98a('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xa98a('0x2')]},'dtlssetup':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x2f'),'passive',_0xa98a('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa98a('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0xa98a('0x1b'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa98a('0x2')]},'recordofffeature':{'type':Sequelize[_0xa98a('0x2')]},'call_limit':{'type':Sequelize[_0xa98a('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xa98a('0x4')](_0xa98a('0x1b'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xa98a('0x1b'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xa98a('0x2')]},'mohsuggest':{'type':Sequelize[_0xa98a('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xa98a('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0xa98a('0x1b'),'no',_0xa98a('0x31'),_0xa98a('0x32'),_0xa98a('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xa98a('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xa98a('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xddc6=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','refuse','uac','fingerprint','certificate','active','actpass','update','update,nonat','BOOLEAN','exports','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','outgoing','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]','port,invite','insecure'];(function(_0x7eaf41,_0x4455db){var _0x513162=function(_0x30a82a){while(--_0x30a82a){_0x7eaf41['push'](_0x7eaf41['shift']());}};_0x513162(++_0x4455db);}(_0xddc6,0x102));var _0x6ddc=function(_0x271f86,_0x575a91){_0x271f86=_0x271f86-0x0;var _0x4a59b4=_0xddc6[_0x271f86];return _0x4a59b4;};'use strict';var Sequelize=require('sequelize');module[_0x6ddc('0x0')]={'name':{'type':Sequelize[_0x6ddc('0x1')],'allowNull':![],'unique':_0x6ddc('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x4'),_0x6ddc('0x5'),'peer'),'allowNull':![],'defaultValue':_0x6ddc('0x4')},'context':{'type':Sequelize[_0x6ddc('0x1')],'allowNull':![],'defaultValue':_0x6ddc('0x6')},'callingpres':{'type':Sequelize[_0x6ddc('0x3')]('ALLOWED_NOT_SCREENED',_0x6ddc('0x7'),_0x6ddc('0x8'),'ALLOWED',_0x6ddc('0x9'),_0x6ddc('0xa'),_0x6ddc('0xb'),_0x6ddc('0xc'))},'deny':{'type':Sequelize[_0x6ddc('0x1')]},'permit':{'type':Sequelize[_0x6ddc('0x1')]},'secret':{'type':Sequelize[_0x6ddc('0x1')]},'md5secret':{'type':Sequelize[_0x6ddc('0x1')]},'remotesecret':{'type':Sequelize[_0x6ddc('0x1')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x6ddc('0xd'),'set':function(_0xc32e00){this['setDataValue']('transport',_0xc32e00?_0xc32e00[_0x6ddc('0xe')](','):null);},'get':function(){return this[_0x6ddc('0xf')](_0x6ddc('0x10'))?this[_0x6ddc('0xf')](_0x6ddc('0x10'))[_0x6ddc('0x11')](','):null;},'comment':_0x6ddc('0x12')},'dtmfmode':{'type':Sequelize['ENUM'](_0x6ddc('0x13'),_0x6ddc('0x14'),_0x6ddc('0x15'),_0x6ddc('0x16'),_0x6ddc('0x17')),'defaultValue':_0x6ddc('0x13')},'directmedia':{'type':Sequelize['ENUM'](_0x6ddc('0x18'),'no',_0x6ddc('0x19'),'update',_0x6ddc('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x6ddc('0x1')]},'nat':{'type':Sequelize[_0x6ddc('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x7dc545){this[_0x6ddc('0x1b')]('nat',_0x7dc545?_0x7dc545['join'](','):null);},'get':function(){return this[_0x6ddc('0xf')](_0x6ddc('0x1c'))?this[_0x6ddc('0xf')](_0x6ddc('0x1c'))[_0x6ddc('0x11')](','):null;},'comment':_0x6ddc('0x1d')},'callgroup':{'type':Sequelize[_0x6ddc('0x1')]},'namedcallgroup':{'type':Sequelize[_0x6ddc('0x1')]},'pickupgroup':{'type':Sequelize[_0x6ddc('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x6ddc('0x1')]},'language':{'type':Sequelize[_0x6ddc('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6ddc('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x6ddc('0x1')],'defaultValue':_0x6ddc('0x1e')},'allow':{'type':Sequelize[_0x6ddc('0x1')],'allowNull':![],'defaultValue':_0x6ddc('0x1f'),'set':function(_0x3b36b2){this[_0x6ddc('0x1b')](_0x6ddc('0x20'),_0x3b36b2?_0x3b36b2[_0x6ddc('0xe')](';'):_0x6ddc('0x1f'));},'get':function(){return this[_0x6ddc('0xf')](_0x6ddc('0x20'))?this['getDataValue'](_0x6ddc('0x20'))[_0x6ddc('0x11')](';'):null;},'comment':_0x6ddc('0x21')},'autoframing':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x18'),'no')},'insecure':{'type':Sequelize[_0x6ddc('0x1')],'defaultValue':_0x6ddc('0x22'),'set':function(_0x1bf87b){this[_0x6ddc('0x1b')]('insecure',_0x1bf87b?_0x1bf87b['join'](','):null);},'get':function(){return this[_0x6ddc('0xf')](_0x6ddc('0x23'))?this[_0x6ddc('0xf')](_0x6ddc('0x23'))['split'](','):null;},'comment':_0x6ddc('0x24')},'trustrpid':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no','never')},'promiscredir':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x6ddc('0x1')]},'callerid':{'type':Sequelize[_0x6ddc('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x6ddc('0x1')]},'callcounter':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x18'),'no'),'defaultValue':_0x6ddc('0x18')},'busylevel':{'type':Sequelize[_0x6ddc('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize[_0x6ddc('0x1')]},'template':{'type':Sequelize[_0x6ddc('0x1')]},'videosupport':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x18'),'no',_0x6ddc('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6ddc('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x6ddc('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0x6ddc('0x1')]},'session_timers':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x27'),_0x6ddc('0x28'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x29'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x6ddc('0x1')]},'regexten':{'type':Sequelize[_0x6ddc('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x6ddc('0x1')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x6ddc('0x18'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x6ddc('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x6ddc('0x1')]},'defaultuser':{'type':Sequelize[_0x6ddc('0x1')]},'rtptimeout':{'type':Sequelize[_0x6ddc('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x6ddc('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x6ddc('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x6ddc('0x3')]('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6ddc('0x1')]},'callbackextension':{'type':Sequelize[_0x6ddc('0x1')]},'timert1':{'type':Sequelize[_0x6ddc('0x25')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x6ddc('0x1')]},'contactdeny':{'type':Sequelize[_0x6ddc('0x1')]},'contactacl':{'type':Sequelize[_0x6ddc('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x6ddc('0x1')]},'use_q850_reason':{'type':Sequelize[_0x6ddc('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x6ddc('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x18'),'no')},'force_avp':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x18'),'no')},'icesupport':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x6ddc('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x6ddc('0x3')]('yes','no',_0x6ddc('0x2a'),_0x6ddc('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x6ddc('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x6ddc('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x6ddc('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x6ddc('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x2c'),'passive',_0x6ddc('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6ddc('0x1')]},'usereqphone':{'type':Sequelize[_0x6ddc('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6ddc('0x1')]},'recordofffeature':{'type':Sequelize[_0x6ddc('0x1')]},'call_limit':{'type':Sequelize[_0x6ddc('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x6ddc('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x18'),'no')},'vmexten':{'type':Sequelize[_0x6ddc('0x1')]},'mohinterpret':{'type':Sequelize[_0x6ddc('0x1')]},'mohsuggest':{'type':Sequelize[_0x6ddc('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6ddc('0x1')]},'host':{'type':Sequelize[_0x6ddc('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x6ddc('0x3')](_0x6ddc('0x18'),'no',_0x6ddc('0x19'),_0x6ddc('0x2e'),_0x6ddc('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x6ddc('0x1')]},'otherFields':{'type':Sequelize[_0x6ddc('0x1')]},'active':{'type':Sequelize[_0x6ddc('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 9a619aa..04412e6 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 _0xf3cd=['length','limit','sort','where','filter','merge','options','Trunk','includeAll','include','findAll','show','find','clone','createdAt','updatedAt','omit','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','undefined','offset','count','json','reject','save','update','get','UserProfileResource','destroy','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x3c1d95,_0x14a886){var _0x3cd7de=function(_0x33bf06){while(--_0x33bf06){_0x3c1d95['push'](_0x3c1d95['shift']());}};_0x3cd7de(++_0x14a886);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3a902a,_0xca8442){_0x3a902a=_0x3a902a-0x0;var _0x24f2d5=_0xf3cd[_0x3a902a];return _0x24f2d5;};'use strict';var emlformat=require(_0xdf3c('0x0'));var rimraf=require(_0xdf3c('0x1'));var zipdir=require(_0xdf3c('0x2'));var jsonpatch=require(_0xdf3c('0x3'));var rp=require(_0xdf3c('0x4'));var moment=require(_0xdf3c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdf3c('0x6'));var util=require(_0xdf3c('0x7'));var path=require(_0xdf3c('0x8'));var sox=require('sox');var csv=require(_0xdf3c('0x9'));var ejs=require(_0xdf3c('0xa'));var fs=require('fs');var fs_extra=require(_0xdf3c('0xb'));var _=require(_0xdf3c('0xc'));var squel=require(_0xdf3c('0xd'));var crypto=require(_0xdf3c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdf3c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf3c('0x10'));var Redis=require(_0xdf3c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdf3c('0x12'));var as=require(_0xdf3c('0x13'));var hardwareService=require(_0xdf3c('0x14'));var logger=require(_0xdf3c('0x15'))(_0xdf3c('0x16'));var utils=require(_0xdf3c('0x17'));var config=require(_0xdf3c('0x18'));var licenseUtil=require(_0xdf3c('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdf3c('0x1a'));var client=jayson[_0xdf3c('0x1b')][_0xdf3c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x17319c,_0x59e431,_0x2ae4ad,_0x461079){return new BPromise(function(_0x13ea5f,_0x5e0047){var _0x18aafa=_0x461079||client;return _0x18aafa[_0xdf3c('0x1d')](_0x17319c,_0x2ae4ad)[_0xdf3c('0x1e')](function(_0x4274fd){logger[_0xdf3c('0x1f')](_0xdf3c('0x20'),_0x59e431,_0xdf3c('0x21'));logger[_0xdf3c('0x22')](_0xdf3c('0x23'),_0x59e431,_0xdf3c('0x21'),JSON['stringify'](_0x4274fd));if(_0x4274fd[_0xdf3c('0x24')]){if(_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x25')]===0x1f4){logger[_0xdf3c('0x24')](_0xdf3c('0x20'),_0x59e431,_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);return _0x5e0047(_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);}logger[_0xdf3c('0x24')](_0xdf3c('0x20'),_0x59e431,_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);return _0x13ea5f(_0x4274fd['error']['message']);}else{logger[_0xdf3c('0x1f')]('Trunk,\x20%s,\x20%s',_0x59e431,_0xdf3c('0x21'));_0x13ea5f(_0x4274fd[_0xdf3c('0x27')][_0xdf3c('0x26')]);}})[_0xdf3c('0x28')](function(_0x33652f){logger[_0xdf3c('0x24')]('Trunk,\x20%s,\x20%s',_0x59e431,_0x33652f);_0x5e0047(_0x33652f);});});}function respondWithStatusCode(_0x22a164,_0x213d75){_0x213d75=_0x213d75||0xcc;return function(_0x13e3ca){if(_0x13e3ca){return _0x22a164[_0xdf3c('0x29')](_0x213d75);}return _0x22a164[_0xdf3c('0x2a')](_0x213d75)[_0xdf3c('0x2b')]();};}function respondWithResult(_0xef54cb,_0x155f54){_0x155f54=_0x155f54||0xc8;return function(_0x18cb46){if(_0x18cb46){return _0xef54cb[_0xdf3c('0x2a')](_0x155f54)['json'](_0x18cb46);}};}function respondWithFilteredResult(_0xd284d7,_0x153daa){return function(_0x4b57a4){if(_0x4b57a4){var _0xdc8962=typeof _0x153daa['offset']==='undefined'&&typeof _0x153daa['limit']===_0xdf3c('0x2c');var _0x186bba=_0x4b57a4['count'];var _0x5c3b5a=_0xdc8962?0x0:_0x153daa[_0xdf3c('0x2d')];var _0x1f2ce4=_0xdc8962?_0x4b57a4[_0xdf3c('0x2e')]:_0x153daa[_0xdf3c('0x2d')]+_0x153daa['limit'];var _0x43ce06;if(_0x1f2ce4>=_0x186bba){_0x1f2ce4=_0x186bba;_0x43ce06=0xc8;}else{_0x43ce06=0xce;}_0xd284d7[_0xdf3c('0x2a')](_0x43ce06);return _0xd284d7['set']('Content-Range',_0x5c3b5a+'-'+_0x1f2ce4+'/'+_0x186bba)[_0xdf3c('0x2f')](_0x4b57a4);}return null;};}function patchUpdates(_0x46f0e3){return function(_0x36937e){try{jsonpatch['apply'](_0x36937e,_0x46f0e3,!![]);}catch(_0x2355f6){return BPromise[_0xdf3c('0x30')](_0x2355f6);}return _0x36937e[_0xdf3c('0x31')]();};}function saveUpdates(_0x10099e,_0x575ae1){return function(_0xda0de0){if(_0xda0de0){return _0xda0de0[_0xdf3c('0x32')](_0x10099e)['then'](function(_0x40ae3d){return _0x40ae3d;});}return null;};}function removeEntity(_0x3daeda,_0x217a65){return function(_0x2287f){if(_0x2287f){return _0x2287f['destroy']()[_0xdf3c('0x1e')](function(){var _0x360d5c=_0x2287f[_0xdf3c('0x33')]({'plain':!![]});var _0x3b9ce8='Trunks';return db[_0xdf3c('0x34')][_0xdf3c('0x35')]({'where':{'type':_0x3b9ce8,'resourceId':_0x360d5c['id']}})['then'](function(){return _0x2287f;});})['then'](function(){_0x3daeda[_0xdf3c('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x216115,_0x5e8130){return function(_0x57faba){if(!_0x57faba){_0x216115['sendStatus'](0x194);}return _0x57faba;};}function handleError(_0x44a478,_0x2ee9ad){_0x2ee9ad=_0x2ee9ad||0x1f4;return function(_0x1d0b8a){logger[_0xdf3c('0x24')](_0x1d0b8a['stack']);if(_0x1d0b8a['name']){delete _0x1d0b8a[_0xdf3c('0x36')];}_0x44a478['status'](_0x2ee9ad)[_0xdf3c('0x37')](_0x1d0b8a);};}exports[_0xdf3c('0x38')]=function(_0x3628ae,_0xcdd731){var _0x1004e9={},_0x1e0cf2={},_0x1c7335={'count':0x0,'rows':[]};var _0x809f3d=_[_0xdf3c('0x39')](db['Trunk'][_0xdf3c('0x3a')],function(_0x54e689){return{'name':_0x54e689['fieldName'],'type':_0x54e689[_0xdf3c('0x3b')]['key']};});_0x1e0cf2[_0xdf3c('0x3c')]=_['map'](_0x809f3d,_0xdf3c('0x36'));_0x1e0cf2[_0xdf3c('0x3d')]=_[_0xdf3c('0x3e')](_0x3628ae[_0xdf3c('0x3d')]);_0x1e0cf2[_0xdf3c('0x3f')]=_[_0xdf3c('0x40')](_0x1e0cf2[_0xdf3c('0x3c')],_0x1e0cf2[_0xdf3c('0x3d')]);_0x1004e9[_0xdf3c('0x41')]=_[_0xdf3c('0x40')](_0x1e0cf2[_0xdf3c('0x3c')],qs[_0xdf3c('0x42')](_0x3628ae['query']['fields']));_0x1004e9[_0xdf3c('0x41')]=_0x1004e9['attributes'][_0xdf3c('0x43')]?_0x1004e9[_0xdf3c('0x41')]:_0x1e0cf2[_0xdf3c('0x3c')];if(!_0x3628ae[_0xdf3c('0x3d')]['hasOwnProperty']('nolimit')){_0x1004e9[_0xdf3c('0x44')]=qs[_0xdf3c('0x44')](_0x3628ae[_0xdf3c('0x3d')]['limit']);_0x1004e9[_0xdf3c('0x2d')]=qs[_0xdf3c('0x2d')](_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x2d')]);}_0x1004e9['order']=qs[_0xdf3c('0x45')](_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x45')]);_0x1004e9[_0xdf3c('0x46')]=qs[_0xdf3c('0x3f')](_['pick'](_0x3628ae[_0xdf3c('0x3d')],_0x1e0cf2[_0xdf3c('0x3f')]),_0x809f3d);if(_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x47')]){_0x1004e9[_0xdf3c('0x46')]=_[_0xdf3c('0x48')](_0x1004e9['where'],{'$or':_['map'](_0x809f3d,function(_0x2c6c6d){if(_0x2c6c6d[_0xdf3c('0x3b')]!=='VIRTUAL'){var _0x5c9885={};_0x5c9885[_0x2c6c6d[_0xdf3c('0x36')]]={'$like':'%'+_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x47')]+'%'};return _0x5c9885;}})});}_0x1004e9=_[_0xdf3c('0x48')]({},_0x1004e9,_0x3628ae[_0xdf3c('0x49')]);var _0x2dbf54={'where':_0x1004e9[_0xdf3c('0x46')]};return db[_0xdf3c('0x4a')][_0xdf3c('0x2e')](_0x2dbf54)['then'](function(_0x129c2a){_0x1c7335[_0xdf3c('0x2e')]=_0x129c2a;if(_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x1004e9[_0xdf3c('0x4c')]=[{'all':!![]}];}return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')](_0x1004e9);})['then'](function(_0x1751a8){_0x1c7335['rows']=_0x1751a8;return _0x1c7335;})[_0xdf3c('0x1e')](respondWithFilteredResult(_0xcdd731,_0x1004e9))['catch'](handleError(_0xcdd731,null));};exports[_0xdf3c('0x4e')]=function(_0x28144f,_0x2ec575){var _0x94c5b9={'raw':![],'where':{'id':_0x28144f['params']['id']}},_0x5eef94={};_0x5eef94['model']=_[_0xdf3c('0x3e')](db['Trunk'][_0xdf3c('0x3a')]);_0x5eef94[_0xdf3c('0x3d')]=_[_0xdf3c('0x3e')](_0x28144f[_0xdf3c('0x3d')]);_0x5eef94[_0xdf3c('0x3f')]=_['intersection'](_0x5eef94['model'],_0x5eef94[_0xdf3c('0x3d')]);_0x94c5b9[_0xdf3c('0x41')]=_['intersection'](_0x5eef94[_0xdf3c('0x3c')],qs[_0xdf3c('0x42')](_0x28144f[_0xdf3c('0x3d')][_0xdf3c('0x42')]));_0x94c5b9[_0xdf3c('0x41')]=_0x94c5b9[_0xdf3c('0x41')][_0xdf3c('0x43')]?_0x94c5b9['attributes']:_0x5eef94['model'];if(_0x28144f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x94c5b9[_0xdf3c('0x4c')]=[{'all':!![]}];}_0x94c5b9=_[_0xdf3c('0x48')]({},_0x94c5b9,_0x28144f[_0xdf3c('0x49')]);return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')](_0x94c5b9)[_0xdf3c('0x1e')](handleEntityNotFound(_0x2ec575,null))[_0xdf3c('0x1e')](respondWithResult(_0x2ec575,null))[_0xdf3c('0x28')](handleError(_0x2ec575,null));};exports[_0xdf3c('0x50')]=function(_0x4cb28f,_0x1eebcf){var _0x47cb74={'where':{'id':_0x4cb28f['params']['id']}},_0x5e7247={};_0x5e7247['model']=_['keys'](db[_0xdf3c('0x4a')][_0xdf3c('0x3a')]);_0x47cb74['attributes']=_[_0xdf3c('0x40')](_0x5e7247[_0xdf3c('0x3c')],qs['fields'](_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x42')]));_0x47cb74[_0xdf3c('0x41')]=_0x47cb74[_0xdf3c('0x41')][_0xdf3c('0x43')]?_0x47cb74[_0xdf3c('0x41')]:_0x5e7247[_0xdf3c('0x3c')];if(_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x47cb74[_0xdf3c('0x4c')]=[{'all':!![]}];}_0x47cb74=_[_0xdf3c('0x48')]({},_0x47cb74,_0x4cb28f['options']);return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')](_0x47cb74)[_0xdf3c('0x1e')](handleEntityNotFound(_0x1eebcf,null))['then'](function(_0x245c68){if(_0x245c68){var _0x3e327e=_0x245c68[_0xdf3c('0x33')]({'plain':!![]});_0x3e327e=qs['omit'](_0x3e327e,['id',_0xdf3c('0x51'),_0xdf3c('0x52')]);_0x4cb28f['body']=_[_0xdf3c('0x53')](_0x4cb28f['body'],['id',_0xdf3c('0x51'),_0xdf3c('0x52')]);return db[_0xdf3c('0x4a')][_0xdf3c('0x54')](_[_0xdf3c('0x48')](_0x3e327e,_0x4cb28f[_0xdf3c('0x55')]),{'include':_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]?[{'all':!![]}]:undefined})[_0xdf3c('0x1e')](function(_0x330730){var _0x283be2=_0x4cb28f[_0xdf3c('0x56')][_0xdf3c('0x33')]({'plain':!![]});if(!_0x283be2)throw new Error(_0xdf3c('0x57'));if(_0x283be2[_0xdf3c('0x58')]===_0xdf3c('0x56')){var _0xd7fb2d=_0x330730['get']({'plain':!![]});var _0x4dade5=_0xdf3c('0x59');return db[_0xdf3c('0x5a')][_0xdf3c('0x4f')]({'where':{'name':_0x4dade5,'userProfileId':_0x283be2['userProfileId']},'raw':!![]})[_0xdf3c('0x1e')](function(_0x5f2765){if(_0x5f2765&&_0x5f2765['autoAssociation']===0x0){return db[_0xdf3c('0x34')][_0xdf3c('0x54')]({'name':_0xd7fb2d[_0xdf3c('0x36')],'resourceId':_0xd7fb2d['id'],'type':_0x5f2765[_0xdf3c('0x36')],'sectionId':_0x5f2765['id']},{})[_0xdf3c('0x1e')](function(){return _0x330730;});}else{return _0x330730;}})[_0xdf3c('0x28')](function(_0x1a31d7){logger[_0xdf3c('0x24')](_0xdf3c('0x5b'),_0x1a31d7);throw _0x1a31d7;});}return _0x330730;});}})[_0xdf3c('0x1e')](respondWithResult(_0x1eebcf,0xc9))[_0xdf3c('0x28')](handleError(_0x1eebcf,null));};exports[_0xdf3c('0x54')]=function(_0x34000c,_0x4be79a,_0x3febac){var _0x2cb0f5;return db[_0xdf3c('0x4a')][_0xdf3c('0x54')](_0x34000c[_0xdf3c('0x55')],{'raw':!![]})['then'](function(_0x18bf4f){_0x2cb0f5=_0x18bf4f;return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});})[_0xdf3c('0x1e')](function(_0x1efa9c){var _0x50805c=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],_0xdf3c('0x5f')),'utf8');var _0xb867a1=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],_0xdf3c('0x60')),_0xdf3c('0x61'));var _0x19c851=ejs['render'](_0x50805c,{'trunks':_0x1efa9c||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x19c851);if(_0x2cb0f5['registry']){var _0x52a2e1=ejs[_0xdf3c('0x64')](_0xb867a1,{'trunks':_0x1efa9c||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x52a2e1);}})[_0xdf3c('0x1e')](function(){return respondWithRpcPromise(_0xdf3c('0x66'),_0xdf3c('0x54'),{'module':_0xdf3c('0x67')});})[_0xdf3c('0x1e')](function(){var _0x5e6606=_0x34000c[_0xdf3c('0x56')][_0xdf3c('0x33')]({'plain':!![]});if(!_0x5e6606)throw new Error(_0xdf3c('0x57'));if(_0x5e6606['role']===_0xdf3c('0x56')){var _0x354ff4=_0x2cb0f5[_0xdf3c('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xdf3c('0x4f')]({'where':{'name':_0xdf3c('0x59'),'userProfileId':_0x5e6606[_0xdf3c('0x68')]},'raw':!![]})[_0xdf3c('0x1e')](function(_0xe01538){if(_0xe01538&&_0xe01538[_0xdf3c('0x69')]===0x0){return db['UserProfileResource']['create']({'name':_0x354ff4['name'],'resourceId':_0x354ff4['id'],'type':_0xe01538['name'],'sectionId':_0xe01538['id']},{})['then'](function(){return _0x2cb0f5;});}else{return _0x2cb0f5;}})[_0xdf3c('0x28')](function(_0x3f43a0){logger[_0xdf3c('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f43a0);throw _0x3f43a0;});}return _0x2cb0f5;})[_0xdf3c('0x1e')](respondWithResult(_0x4be79a,0xc9))[_0xdf3c('0x28')](handleError(_0x4be79a,null));};exports[_0xdf3c('0x32')]=function(_0x51e8c6,_0x591936,_0x233718){var _0x4e3517;return db[_0xdf3c('0x4a')]['find']({'where':{'id':_0x51e8c6[_0xdf3c('0x6a')]['id']}})[_0xdf3c('0x1e')](handleEntityNotFound(_0x591936,null))[_0xdf3c('0x1e')](saveUpdates(_0x51e8c6[_0xdf3c('0x55')],null))['then'](function(_0x5148f6){if(_0x5148f6){_0x4e3517=_0x5148f6;return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});}})[_0xdf3c('0x1e')](function(_0x12a7b0){if(_0x12a7b0){var _0x39d9f0=fs[_0xdf3c('0x5c')](path['join'](config[_0xdf3c('0x5e')],'server/files/templates/trunk.ejs'),_0xdf3c('0x61'));var _0x9c761a=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],'server/files/templates/registry.ejs'),_0xdf3c('0x61'));var _0x5c27cc=ejs[_0xdf3c('0x64')](_0x39d9f0,{'trunks':_0x12a7b0||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x5c27cc);var _0x53b0c3=ejs['render'](_0x9c761a,{'trunks':_0x12a7b0||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x53b0c3);return respondWithRpcPromise(_0xdf3c('0x66'),_0xdf3c('0x32'),{'module':_0xdf3c('0x67')});}return null;})[_0xdf3c('0x1e')](function(_0x5c8e5e){if(_0x5c8e5e){return _0x4e3517;}})[_0xdf3c('0x1e')](respondWithResult(_0x591936,null))['catch'](handleError(_0x591936,null));};exports[_0xdf3c('0x35')]=function(_0x389708,_0x2e5f82,_0x15a057){var _0x320452;return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')]({'where':{'id':_0x389708[_0xdf3c('0x6a')]['id']}})[_0xdf3c('0x1e')](handleEntityNotFound(_0x2e5f82,null))[_0xdf3c('0x1e')](removeEntity(_0x2e5f82,null))[_0xdf3c('0x1e')](function(){return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});})[_0xdf3c('0x1e')](function(_0x55fd73){var _0x118ab5=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],'server/files/templates/trunk.ejs'),_0xdf3c('0x61'));var _0x1c8fe4=fs['readFileSync'](path['join'](config[_0xdf3c('0x5e')],_0xdf3c('0x60')),_0xdf3c('0x61'));var _0x1aaf8b=ejs[_0xdf3c('0x64')](_0x118ab5,{'trunks':_0x55fd73});var _0x56fc77=ejs[_0xdf3c('0x64')](_0x1c8fe4,{'trunks':_0x55fd73});fs[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x1aaf8b);fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x56fc77);return respondWithRpcPromise(_0xdf3c('0x66'),'destroy',{'module':_0xdf3c('0x67')});})[_0xdf3c('0x28')](handleError(_0x2e5f82,null));}; \ No newline at end of file +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(_0x3050ca,_0x3e36b0){var _0x1eed1d=function(_0x195e8f){while(--_0x195e8f){_0x3050ca['push'](_0x3050ca['shift']());}};_0x1eed1d(++_0x3e36b0);}(_0xe5b3,0x133));var _0x3e5b=function(_0x49141a,_0x32710c){_0x49141a=_0x49141a-0x0;var _0x4dd9ca=_0xe5b3[_0x49141a];return _0x4dd9ca;};'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 diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 4249ae1..6b0e043 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 _0x38a9=['api','moment','bluebird','path','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','util','../../config/logger'];(function(_0x70303f,_0x3d6709){var _0x38b120=function(_0x5b2495){while(--_0x5b2495){_0x70303f['push'](_0x70303f['shift']());}};_0x38b120(++_0x3d6709);}(_0x38a9,0xb2));var _0x938a=function(_0x1e8f1b,_0x2ce436){_0x1e8f1b=_0x1e8f1b-0x0;var _0x365a33=_0x38a9[_0x1e8f1b];return _0x365a33;};'use strict';var _=require('lodash');var util=require(_0x938a('0x0'));var logger=require(_0x938a('0x1'))(_0x938a('0x2'));var moment=require(_0x938a('0x3'));var BPromise=require(_0x938a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x938a('0x5'));var rimraf=require('rimraf');var config=require(_0x938a('0x6'));var attributes=require(_0x938a('0x7'));module[_0x938a('0x8')]=function(_0x1f5533,_0x25feb5){return _0x1f5533[_0x938a('0x9')](_0x938a('0xa'),attributes,{'tableName':_0x938a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c45=['../../config/environment','./trunk.attributes','exports','Trunk','../../config/logger','api','moment','request-promise'];(function(_0x2fa744,_0x4d44bd){var _0x40a680=function(_0x41dfed){while(--_0x41dfed){_0x2fa744['push'](_0x2fa744['shift']());}};_0x40a680(++_0x4d44bd);}(_0x8c45,0x1d4));var _0x58c4=function(_0x512eca,_0x5ebb4d){_0x512eca=_0x512eca-0x0;var _0x2ae224=_0x8c45[_0x512eca];return _0x2ae224;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x58c4('0x0'))(_0x58c4('0x1'));var moment=require(_0x58c4('0x2'));var BPromise=require('bluebird');var rp=require(_0x58c4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x58c4('0x4'));var attributes=require(_0x58c4('0x5'));module[_0x58c4('0x6')]=function(_0x5986d8,_0x4d7916){return _0x5986d8['define'](_0x58c4('0x7'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 1642805..73fd0d2 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 _0x18b4=['map','model','then','ShowTrunk','find','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','code','message','Trunk,\x20%s,\x20%s','result','catch','GetTrunk','Trunk','findAll','options','raw','attributes','limit','include'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x18b4,0xd8));var _0x418b=function(_0x17ffc8,_0x5d0890){_0x17ffc8=_0x17ffc8-0x0;var _0x234953=_0x18b4[_0x17ffc8];return _0x234953;};'use strict';var _=require(_0x418b('0x0'));var util=require(_0x418b('0x1'));var moment=require('moment');var BPromise=require(_0x418b('0x2'));var rs=require(_0x418b('0x3'));var fs=require('fs');var Redis=require(_0x418b('0x4'));var db=require(_0x418b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x418b('0x6'));var config=require(_0x418b('0x7'));var jayson=require(_0x418b('0x8'));var client=jayson['client'][_0x418b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ee9b7,_0x406035,_0x321066){return new BPromise(function(_0x48eedc,_0x449879){return client[_0x418b('0xa')](_0x5ee9b7,_0x321066)['then'](function(_0x216396){logger[_0x418b('0xb')]('Trunk,\x20%s,\x20%s',_0x406035,_0x418b('0xc'));logger[_0x418b('0xd')]('Trunk,\x20%s,\x20%s,\x20%s',_0x406035,_0x418b('0xc'),JSON[_0x418b('0xe')](_0x216396));if(_0x216396['error']){if(_0x216396[_0x418b('0xf')][_0x418b('0x10')]===0x1f4){logger[_0x418b('0xf')]('Trunk,\x20%s,\x20%s',_0x406035,_0x216396[_0x418b('0xf')][_0x418b('0x11')]);return _0x449879(_0x216396[_0x418b('0xf')]['message']);}logger[_0x418b('0xf')](_0x418b('0x12'),_0x406035,_0x216396[_0x418b('0xf')][_0x418b('0x11')]);return _0x48eedc(_0x216396[_0x418b('0xf')][_0x418b('0x11')]);}else{logger[_0x418b('0xb')](_0x418b('0x12'),_0x406035,_0x418b('0xc'));_0x48eedc(_0x216396[_0x418b('0x13')][_0x418b('0x11')]);}})[_0x418b('0x14')](function(_0xe7cedf){logger[_0x418b('0xf')](_0x418b('0x12'),_0x406035,_0xe7cedf);_0x449879(_0xe7cedf);});});}exports[_0x418b('0x15')]=function(_0x21b071){var _0x275bd1=this;return new Promise(function(_0x48873a,_0x24fb93){return db[_0x418b('0x16')][_0x418b('0x17')]({'raw':_0x21b071[_0x418b('0x18')]?_0x21b071['options'][_0x418b('0x19')]===undefined?!![]:![]:!![],'where':_0x21b071[_0x418b('0x18')]?_0x21b071[_0x418b('0x18')]['where']||null:null,'attributes':_0x21b071['options']?_0x21b071[_0x418b('0x18')][_0x418b('0x1a')]||null:null,'limit':_0x21b071['options']?_0x21b071[_0x418b('0x18')][_0x418b('0x1b')]||null:null,'include':_0x21b071['options']?_0x21b071[_0x418b('0x18')][_0x418b('0x1c')]?_[_0x418b('0x1d')](_0x21b071[_0x418b('0x18')][_0x418b('0x1c')],function(_0x554916){return{'model':db[_0x554916['model']],'as':_0x554916['as'],'attributes':_0x554916[_0x418b('0x1a')],'include':_0x554916[_0x418b('0x1c')]?_['map'](_0x554916[_0x418b('0x1c')],function(_0x15cddc){return{'model':db[_0x15cddc[_0x418b('0x1e')]],'as':_0x15cddc['as'],'attributes':_0x15cddc['attributes'],'include':_0x15cddc[_0x418b('0x1c')]?_[_0x418b('0x1d')](_0x15cddc[_0x418b('0x1c')],function(_0x5c6676){return{'model':db[_0x5c6676[_0x418b('0x1e')]],'as':_0x5c6676['as'],'attributes':_0x5c6676['attributes']};}):[]};}):[]};}):[]:[]})[_0x418b('0x1f')](function(_0x32c1ba){logger['info']('GetTrunk',_0x21b071);logger['debug'](_0x418b('0x15'),_0x21b071,JSON[_0x418b('0xe')](_0x32c1ba));_0x48873a(_0x32c1ba);})['catch'](function(_0x33d4fd){logger[_0x418b('0xf')](_0x418b('0x15'),_0x33d4fd[_0x418b('0x11')],_0x21b071);_0x24fb93(_0x275bd1[_0x418b('0xf')](0x1f4,_0x33d4fd['message']));});});};exports[_0x418b('0x20')]=function(_0x2b31ea){var _0x3e208b=this;return new Promise(function(_0x1854cb,_0x448265){return db[_0x418b('0x16')][_0x418b('0x21')]({'raw':_0x2b31ea[_0x418b('0x18')]?_0x2b31ea[_0x418b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2b31ea[_0x418b('0x18')]?_0x2b31ea[_0x418b('0x18')][_0x418b('0x22')]||null:null,'attributes':_0x2b31ea[_0x418b('0x18')]?_0x2b31ea[_0x418b('0x18')][_0x418b('0x1a')]||null:null,'include':_0x2b31ea[_0x418b('0x18')]?_0x2b31ea[_0x418b('0x18')][_0x418b('0x1c')]?_[_0x418b('0x1d')](_0x2b31ea[_0x418b('0x18')][_0x418b('0x1c')],function(_0x3bdf5e){return{'model':db[_0x3bdf5e[_0x418b('0x1e')]],'as':_0x3bdf5e['as'],'attributes':_0x3bdf5e[_0x418b('0x1a')],'include':_0x3bdf5e['include']?_[_0x418b('0x1d')](_0x3bdf5e[_0x418b('0x1c')],function(_0x305da0){return{'model':db[_0x305da0[_0x418b('0x1e')]],'as':_0x305da0['as'],'attributes':_0x305da0[_0x418b('0x1a')],'include':_0x305da0[_0x418b('0x1c')]?_[_0x418b('0x1d')](_0x305da0['include'],function(_0x3f2167){return{'model':db[_0x3f2167['model']],'as':_0x3f2167['as'],'attributes':_0x3f2167['attributes']};}):[]};}):[]};}):[]:[]})[_0x418b('0x1f')](function(_0x4eb0d2){logger[_0x418b('0xb')](_0x418b('0x20'),_0x2b31ea);logger[_0x418b('0xd')](_0x418b('0x20'),_0x2b31ea,JSON[_0x418b('0xe')](_0x4eb0d2));_0x1854cb(_0x4eb0d2);})[_0x418b('0x14')](function(_0x468eba){logger[_0x418b('0xf')](_0x418b('0x20'),_0x468eba['message'],_0x2b31ea);_0x448265(_0x3e208b[_0x418b('0xf')](0x1f4,_0x468eba[_0x418b('0x11')]));});});}; \ No newline at end of file +var _0xed91=['error','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','map','model','debug','stringify','ShowTrunk','find','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s'];(function(_0x24875d,_0x4fb24d){var _0x181471=function(_0x4ecd6d){while(--_0x4ecd6d){_0x24875d['push'](_0x24875d['shift']());}};_0x181471(++_0x4fb24d);}(_0xed91,0x133));var _0x1ed9=function(_0x1c92a,_0x410cd3){_0x1c92a=_0x1c92a-0x0;var _0xb116d9=_0xed91[_0x1c92a];return _0xb116d9;};'use strict';var _=require(_0x1ed9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1ed9('0x1'));var fs=require('fs');var Redis=require(_0x1ed9('0x2'));var db=require(_0x1ed9('0x3'))['db'];var utils=require(_0x1ed9('0x4'));var logger=require(_0x1ed9('0x5'))('rpc');var config=require(_0x1ed9('0x6'));var jayson=require(_0x1ed9('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x582411,_0x4c5f6a,_0x557a56){return new BPromise(function(_0x5f3a51,_0x22367c){return client[_0x1ed9('0x8')](_0x582411,_0x557a56)[_0x1ed9('0x9')](function(_0x512d75){logger[_0x1ed9('0xa')]('Trunk,\x20%s,\x20%s',_0x4c5f6a,_0x1ed9('0xb'));logger['debug'](_0x1ed9('0xc'),_0x4c5f6a,_0x1ed9('0xb'),JSON['stringify'](_0x512d75));if(_0x512d75[_0x1ed9('0xd')]){if(_0x512d75[_0x1ed9('0xd')]['code']===0x1f4){logger['error'](_0x1ed9('0xe'),_0x4c5f6a,_0x512d75[_0x1ed9('0xd')][_0x1ed9('0xf')]);return _0x22367c(_0x512d75[_0x1ed9('0xd')][_0x1ed9('0xf')]);}logger[_0x1ed9('0xd')](_0x1ed9('0xe'),_0x4c5f6a,_0x512d75[_0x1ed9('0xd')][_0x1ed9('0xf')]);return _0x5f3a51(_0x512d75['error'][_0x1ed9('0xf')]);}else{logger[_0x1ed9('0xa')]('Trunk,\x20%s,\x20%s',_0x4c5f6a,_0x1ed9('0xb'));_0x5f3a51(_0x512d75[_0x1ed9('0x10')][_0x1ed9('0xf')]);}})[_0x1ed9('0x11')](function(_0x3704eb){logger[_0x1ed9('0xd')](_0x1ed9('0xe'),_0x4c5f6a,_0x3704eb);_0x22367c(_0x3704eb);});});}exports[_0x1ed9('0x12')]=function(_0x119d7c){var _0xc7acf4=this;return new Promise(function(_0x3b9b88,_0x231839){return db[_0x1ed9('0x13')][_0x1ed9('0x14')]({'raw':_0x119d7c[_0x1ed9('0x15')]?_0x119d7c['options'][_0x1ed9('0x16')]===undefined?!![]:![]:!![],'where':_0x119d7c[_0x1ed9('0x15')]?_0x119d7c['options'][_0x1ed9('0x17')]||null:null,'attributes':_0x119d7c[_0x1ed9('0x15')]?_0x119d7c[_0x1ed9('0x15')][_0x1ed9('0x18')]||null:null,'limit':_0x119d7c[_0x1ed9('0x15')]?_0x119d7c[_0x1ed9('0x15')]['limit']||null:null,'include':_0x119d7c[_0x1ed9('0x15')]?_0x119d7c[_0x1ed9('0x15')][_0x1ed9('0x19')]?_[_0x1ed9('0x1a')](_0x119d7c[_0x1ed9('0x15')]['include'],function(_0x5e81af){return{'model':db[_0x5e81af[_0x1ed9('0x1b')]],'as':_0x5e81af['as'],'attributes':_0x5e81af[_0x1ed9('0x18')],'include':_0x5e81af[_0x1ed9('0x19')]?_[_0x1ed9('0x1a')](_0x5e81af[_0x1ed9('0x19')],function(_0x4b7339){return{'model':db[_0x4b7339['model']],'as':_0x4b7339['as'],'attributes':_0x4b7339[_0x1ed9('0x18')],'include':_0x4b7339[_0x1ed9('0x19')]?_[_0x1ed9('0x1a')](_0x4b7339[_0x1ed9('0x19')],function(_0x30a102){return{'model':db[_0x30a102[_0x1ed9('0x1b')]],'as':_0x30a102['as'],'attributes':_0x30a102['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ed9('0x9')](function(_0x50b10f){logger['info'](_0x1ed9('0x12'),_0x119d7c);logger[_0x1ed9('0x1c')]('GetTrunk',_0x119d7c,JSON[_0x1ed9('0x1d')](_0x50b10f));_0x3b9b88(_0x50b10f);})[_0x1ed9('0x11')](function(_0x3c7621){logger[_0x1ed9('0xd')](_0x1ed9('0x12'),_0x3c7621[_0x1ed9('0xf')],_0x119d7c);_0x231839(_0xc7acf4[_0x1ed9('0xd')](0x1f4,_0x3c7621['message']));});});};exports[_0x1ed9('0x1e')]=function(_0x4da36f){var _0x23a87a=this;return new Promise(function(_0x158a67,_0x59321){return db[_0x1ed9('0x13')][_0x1ed9('0x1f')]({'raw':_0x4da36f[_0x1ed9('0x15')]?_0x4da36f[_0x1ed9('0x15')][_0x1ed9('0x16')]===undefined?!![]:![]:!![],'where':_0x4da36f[_0x1ed9('0x15')]?_0x4da36f[_0x1ed9('0x15')][_0x1ed9('0x17')]||null:null,'attributes':_0x4da36f[_0x1ed9('0x15')]?_0x4da36f[_0x1ed9('0x15')][_0x1ed9('0x18')]||null:null,'include':_0x4da36f['options']?_0x4da36f[_0x1ed9('0x15')][_0x1ed9('0x19')]?_[_0x1ed9('0x1a')](_0x4da36f[_0x1ed9('0x15')]['include'],function(_0x278e80){return{'model':db[_0x278e80[_0x1ed9('0x1b')]],'as':_0x278e80['as'],'attributes':_0x278e80[_0x1ed9('0x18')],'include':_0x278e80[_0x1ed9('0x19')]?_[_0x1ed9('0x1a')](_0x278e80[_0x1ed9('0x19')],function(_0x4d1e64){return{'model':db[_0x4d1e64[_0x1ed9('0x1b')]],'as':_0x4d1e64['as'],'attributes':_0x4d1e64[_0x1ed9('0x18')],'include':_0x4d1e64['include']?_[_0x1ed9('0x1a')](_0x4d1e64[_0x1ed9('0x19')],function(_0x45c0a4){return{'model':db[_0x45c0a4[_0x1ed9('0x1b')]],'as':_0x45c0a4['as'],'attributes':_0x45c0a4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e9d68){logger['info'](_0x1ed9('0x1e'),_0x4da36f);logger[_0x1ed9('0x1c')](_0x1ed9('0x1e'),_0x4da36f,JSON['stringify'](_0x1e9d68));_0x158a67(_0x1e9d68);})['catch'](function(_0x223a7e){logger['error'](_0x1ed9('0x1e'),_0x223a7e[_0x1ed9('0xf')],_0x4da36f);_0x59321(_0x23a87a[_0x1ed9('0xd')](0x1f4,_0x223a7e[_0x1ed9('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 6e55ef7..f47a59d 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 _0xcf05=['exports','./user-setting.controller','put','/:id','isAuthenticated','update'];(function(_0x7b842c,_0x393863){var _0x5c3f59=function(_0x2fdfc8){while(--_0x2fdfc8){_0x7b842c['push'](_0x7b842c['shift']());}};_0x5c3f59(++_0x393863);}(_0xcf05,0x169));var _0x5cf0=function(_0x641907,_0x56b4b8){_0x641907=_0x641907-0x0;var _0x33dcac=_0xcf05[_0x641907];return _0x33dcac;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x5cf0('0x0'));router[_0x5cf0('0x1')](_0x5cf0('0x2'),auth[_0x5cf0('0x3')](),controller[_0x5cf0('0x4')]);module[_0x5cf0('0x5')]=router; \ No newline at end of file +var _0xb40c=['./user-setting.controller','put','isAuthenticated','exports','Router'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb40c,0x8b));var _0xcb40=function(_0x29082c,_0x201f34){_0x29082c=_0x29082c-0x0;var _0x35a173=_0xb40c[_0x29082c];return _0x35a173;};'use strict';var express=require('express');var router=express[_0xcb40('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xcb40('0x1'));router[_0xcb40('0x2')]('/:id',auth[_0xcb40('0x3')](),controller['update']);module[_0xcb40('0x4')]=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 2157b0f..e48bdc1 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 _0xf57f=['error','debug','exports','ENUM','BOOLEAN','INTEGER','UserId','sequelize'];(function(_0xe3bb5c,_0x468d46){var _0xc680b9=function(_0x39f4f8){while(--_0x39f4f8){_0xe3bb5c['push'](_0xe3bb5c['shift']());}};_0xc680b9(++_0x468d46);}(_0xf57f,0x8f));var _0xff57=function(_0x34e14d,_0x5dea39){_0x34e14d=_0x34e14d-0x0;var _0x3d8e08=_0xf57f[_0x34e14d];return _0x3d8e08;};'use strict';var Sequelize=require(_0xff57('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xff57('0x1'),'warning','info',_0xff57('0x2')];module[_0xff57('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0xff57('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xff57('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xff57('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xff57('0x6')],'unique':_0xff57('0x7')}}; \ No newline at end of file +var _0x3cb7=['exports','ENUM','BOOLEAN','TEXT','INTEGER','UserId','sequelize','error','warning','info','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cb7,0x7f));var _0x73cb=function(_0x575057,_0x14baf3){_0x575057=_0x575057-0x0;var _0x49dbc8=_0x3cb7[_0x575057];return _0x49dbc8;};'use strict';var Sequelize=require(_0x73cb('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x73cb('0x1'),_0x73cb('0x2'),_0x73cb('0x3'),_0x73cb('0x4')];module[_0x73cb('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0x73cb('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x73cb('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x73cb('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x73cb('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x73cb('0x9')],'unique':_0x73cb('0xa')}}; \ 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 9bb810b..0e96003 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 _0xba33=['../../config/logger','api','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','status','json','update','error','stack','name','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xba33,0xf1));var _0x3ba3=function(_0x100f2d,_0x428850){_0x100f2d=_0x100f2d-0x0;var _0x483e44=_0xba33[_0x100f2d];return _0x483e44;};'use strict';var _=require(_0x3ba3('0x0'));var Redis=require(_0x3ba3('0x1'));var logger=require(_0x3ba3('0x2'))(_0x3ba3('0x3'));var config=require('../../config/environment');var db=require(_0x3ba3('0x4'))['db'];var socket=require(_0x3ba3('0x5'))(new Redis(config[_0x3ba3('0x6')]));require(_0x3ba3('0x7'))[_0x3ba3('0x8')](socket);config[_0x3ba3('0x6')]=_[_0x3ba3('0x9')](config[_0x3ba3('0x6')],{'host':_0x3ba3('0xa'),'port':0x18eb});function respondWithResult(_0xfbfa81,_0x15082b){_0x15082b=_0x15082b||0xc8;return function(_0x55f171){if(_0x55f171){return _0xfbfa81[_0x3ba3('0xb')](_0x15082b)[_0x3ba3('0xc')](_0x55f171);}};}function saveUpdates(_0x32bd32){return function(_0x3b2cff){if(_0x3b2cff){return _0x3b2cff[_0x3ba3('0xd')](_0x32bd32)['then'](function(_0x14ac22){return _0x14ac22;});}return null;};}function handleEntityNotFound(_0x2c95e5){return function(_0x105953){if(!_0x105953){_0x2c95e5['sendStatus'](0x194);}return _0x105953;};}function handleError(_0x4a402f,_0x5d0e64){_0x5d0e64=_0x5d0e64||0x1f4;return function(_0x88904b){logger[_0x3ba3('0xe')](_0x88904b[_0x3ba3('0xf')]);if(_0x88904b['name']){delete _0x88904b[_0x3ba3('0x10')];}_0x4a402f[_0x3ba3('0xb')](_0x5d0e64)['send'](_0x88904b);};}exports[_0x3ba3('0xd')]=function(_0x12bd07,_0x1e4772){if(_0x12bd07[_0x3ba3('0x11')][_0x3ba3('0x12')]!==_0x3ba3('0x13'))throw new Error(_0x3ba3('0x14'));if(isNaN(Number(_0x12bd07[_0x3ba3('0x15')]['id'])))throw new Error(_0x3ba3('0x16'));return db[_0x3ba3('0x17')][_0x3ba3('0x18')]({'where':{'id':_0x12bd07['params']['id']}})['then'](handleEntityNotFound(_0x1e4772,null))['then'](saveUpdates(_0x12bd07[_0x3ba3('0x19')],null))['then'](respondWithResult(_0x1e4772,null))[_0x3ba3('0x1a')](handleError(_0x1e4772,null));}; \ No newline at end of file +var _0x33a1=['name','send','user','role','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis','socket.io-emitter','redis','./user-setting.socket','defaults','json','update','sendStatus'];(function(_0x12c77c,_0x122304){var _0x2dc1ef=function(_0x54d6eb){while(--_0x54d6eb){_0x12c77c['push'](_0x12c77c['shift']());}};_0x2dc1ef(++_0x122304);}(_0x33a1,0x7c));var _0x133a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x33a1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x133a('0x0'));var Redis=require(_0x133a('0x1'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require(_0x133a('0x2'))(new Redis(config[_0x133a('0x3')]));require(_0x133a('0x4'))['register'](socket);config[_0x133a('0x3')]=_[_0x133a('0x5')](config[_0x133a('0x3')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x13fe1d,_0x1a6b64){_0x1a6b64=_0x1a6b64||0xc8;return function(_0x31409d){if(_0x31409d){return _0x13fe1d['status'](_0x1a6b64)[_0x133a('0x6')](_0x31409d);}};}function saveUpdates(_0x1dd1bf){return function(_0x113522){if(_0x113522){return _0x113522[_0x133a('0x7')](_0x1dd1bf)['then'](function(_0x5cba56){return _0x5cba56;});}return null;};}function handleEntityNotFound(_0x4866ce){return function(_0x3b022c){if(!_0x3b022c){_0x4866ce[_0x133a('0x8')](0x194);}return _0x3b022c;};}function handleError(_0x1f989c,_0x453900){_0x453900=_0x453900||0x1f4;return function(_0x1b60c3){logger['error'](_0x1b60c3['stack']);if(_0x1b60c3[_0x133a('0x9')]){delete _0x1b60c3['name'];}_0x1f989c['status'](_0x453900)[_0x133a('0xa')](_0x1b60c3);};}exports[_0x133a('0x7')]=function(_0x4ab7f3,_0x6e17){if(_0x4ab7f3[_0x133a('0xb')][_0x133a('0xc')]!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x4ab7f3[_0x133a('0xd')]['id'])))throw new Error(_0x133a('0xe'));return db[_0x133a('0xf')][_0x133a('0x10')]({'where':{'id':_0x4ab7f3['params']['id']}})['then'](handleEntityNotFound(_0x6e17,null))['then'](saveUpdates(_0x4ab7f3[_0x133a('0x11')],null))['then'](respondWithResult(_0x6e17,null))[_0x133a('0x12')](handleError(_0x6e17,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 ae8283e..495194c 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 _0x31ef=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserSetting','setMaxListeners','update'];(function(_0x3a0784,_0x1f973b){var _0x1b28a8=function(_0xe77f6e){while(--_0xe77f6e){_0x3a0784['push'](_0x3a0784['shift']());}};_0x1b28a8(++_0x1f973b);}(_0x31ef,0x18b));var _0xf31e=function(_0x2cabc0,_0x898fbb){_0x2cabc0=_0x2cabc0-0x0;var _0x39fb1d=_0x31ef[_0x2cabc0];return _0x39fb1d;};'use strict';var EventEmitter=require(_0xf31e('0x0'));var UserSetting=require(_0xf31e('0x1'))['db'][_0xf31e('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xf31e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf31e('0x4'),'afterDestroy':_0xf31e('0x5')};function emitEvent(_0x5e7fa9){return function(_0x132b3f,_0x260642,_0x2f0ffb){UserSettingEvents['emit'](_0x5e7fa9+':'+_0x132b3f['id'],_0x132b3f);UserSettingEvents[_0xf31e('0x6')](_0x5e7fa9,_0x132b3f);_0x2f0ffb(null);};}for(var e in events){if(events[_0xf31e('0x7')](e)){var event=events[e];UserSetting[_0xf31e('0x8')](e,emitEvent(event));}}module[_0xf31e('0x9')]=UserSettingEvents; \ No newline at end of file +var _0x903e=['hook','exports','events','../../mysqldb','UserSetting','save','emit'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x903e,0x8e));var _0xe903=function(_0x581960,_0x1232ff){_0x581960=_0x581960-0x0;var _0x4ee892=_0x903e[_0x581960];return _0x4ee892;};'use strict';var EventEmitter=require(_0xe903('0x0'));var UserSetting=require(_0xe903('0x1'))['db'][_0xe903('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe903('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xf0b54c){return function(_0x3f4832,_0x5086f3,_0x49b527){UserSettingEvents['emit'](_0xf0b54c+':'+_0x3f4832['id'],_0x3f4832);UserSettingEvents[_0xe903('0x4')](_0xf0b54c,_0x3f4832);_0x49b527(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xe903('0x5')](e,emitEvent(event));}}module[_0xe903('0x6')]=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 9e6750d..f1f81a1 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 _0xae87=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','UserSetting','user_settings'];(function(_0x4b1473,_0x570c61){var _0x4eb602=function(_0x4ee4ab){while(--_0x4ee4ab){_0x4b1473['push'](_0x4b1473['shift']());}};_0x4eb602(++_0x570c61);}(_0xae87,0x1ce));var _0x7ae8=function(_0x532112,_0x37d94b){_0x532112=_0x532112-0x0;var _0x23e5fb=_0xae87[_0x532112];return _0x23e5fb;};'use strict';var attributes=require('./user-setting.attributes');module['exports']=function(_0x5e7782){return _0x5e7782['define'](_0x7ae8('0x0'),attributes,{'tableName':_0x7ae8('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4a4e99){if(!_0x4a4e99[_0x7ae8('0x2')])_0x4a4e99['clientSideLoggingEnabledSince']=null;else if(_0x4a4e99['clientSideLoggingEnabledSince']===null)_0x4a4e99[_0x7ae8('0x3')]=new Date();}}});}; \ No newline at end of file +var _0x7be1=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','UserSetting'];(function(_0x564314,_0x25ad70){var _0x3e9b67=function(_0x5b1ab7){while(--_0x5b1ab7){_0x564314['push'](_0x564314['shift']());}};_0x3e9b67(++_0x25ad70);}(_0x7be1,0x165));var _0x17be=function(_0x106895,_0xf6b6be){_0x106895=_0x106895-0x0;var _0x3ee675=_0x7be1[_0x106895];return _0x3ee675;};'use strict';var attributes=require(_0x17be('0x0'));module[_0x17be('0x1')]=function(_0x6a550d){return _0x6a550d['define'](_0x17be('0x2'),attributes,{'tableName':_0x17be('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x740a8){if(!_0x740a8[_0x17be('0x4')])_0x740a8[_0x17be('0x5')]=null;else if(_0x740a8['clientSideLoggingEnabledSince']===null)_0x740a8['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 85e7568..4cd3d65 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 _0xbc70=['user-setting:','./user-setting.events','save','remove','update','emit','user-setting:update:user-','register','length'];(function(_0x3b0d98,_0x346f06){var _0x296885=function(_0x8b1247){while(--_0x8b1247){_0x3b0d98['push'](_0x3b0d98['shift']());}};_0x296885(++_0x346f06);}(_0xbc70,0x145));var _0x0bc7=function(_0x5ba4ec,_0x127305){_0x5ba4ec=_0x5ba4ec-0x0;var _0x214c0f=_0xbc70[_0x5ba4ec];return _0x214c0f;};'use strict';var UserSettingEvents=require(_0x0bc7('0x0'));var events=[_0x0bc7('0x1'),_0x0bc7('0x2'),_0x0bc7('0x3')];function createListener(_0xf506a0,_0x4eeb02){return function(_0x185d8a){_0x4eeb02[_0x0bc7('0x4')](_0xf506a0,_0x185d8a);if(_0xf506a0==='user-setting:update'){_0x4eeb02[_0x0bc7('0x4')](_0x0bc7('0x5')+_0x185d8a['UserId'],_0x185d8a);}};}exports[_0x0bc7('0x6')]=function(_0x224e99){for(var _0x426c40=0x0,_0x263439=events[_0x0bc7('0x7')];_0x426c40<_0x263439;_0x426c40++){var _0x8540f8=events[_0x426c40];var _0xc76b5d=createListener(_0x0bc7('0x8')+_0x8540f8,_0x224e99);UserSettingEvents['on'](_0x8540f8,_0xc76b5d);}}; \ No newline at end of file +var _0x34bd=['length','user-setting:','./user-setting.events','remove','update','user-setting:update','user-setting:update:user-'];(function(_0x242a88,_0x1083b4){var _0x198ec0=function(_0x4ea0d1){while(--_0x4ea0d1){_0x242a88['push'](_0x242a88['shift']());}};_0x198ec0(++_0x1083b4);}(_0x34bd,0xfe));var _0xd34b=function(_0x5572b7,_0x244036){_0x5572b7=_0x5572b7-0x0;var _0x1bc232=_0x34bd[_0x5572b7];return _0x1bc232;};'use strict';var UserSettingEvents=require(_0xd34b('0x0'));var events=['save',_0xd34b('0x1'),_0xd34b('0x2')];function createListener(_0x31144f,_0x8e8213){return function(_0x4ad3e4){_0x8e8213['emit'](_0x31144f,_0x4ad3e4);if(_0x31144f===_0xd34b('0x3')){_0x8e8213['emit'](_0xd34b('0x4')+_0x4ad3e4['UserId'],_0x4ad3e4);}};}exports['register']=function(_0x2a98da){for(var _0xd1ac91=0x0,_0x139c6a=events[_0xd34b('0x5')];_0xd1ac91<_0x139c6a;_0xd1ac91++){var _0x247496=events[_0xd1ac91];var _0x3d3d19=createListener(_0xd34b('0x6')+_0x247496,_0x2a98da);UserSettingEvents['on'](_0x247496,_0x3d3d19);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index f1f1f94..ce4ef42 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 _0x7c93=['/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/chat/interactions','/:id/openchannel/interactions','/:id/sms/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','/create_many','diskStorage','join','root','server/files/images/','format','now','single','file','addAvatar','/:id/login','logout','pause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','/:id/mail_accounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','put','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami'];(function(_0x5a0778,_0x4184ae){var _0x5e4a01=function(_0x357ecc){while(--_0x357ecc){_0x5a0778['push'](_0x5a0778['shift']());}};_0x5e4a01(++_0x4184ae);}(_0x7c93,0xc4));var _0x37c9=function(_0x13e65b,_0x403098){_0x13e65b=_0x13e65b-0x0;var _0x33a05c=_0x7c93[_0x13e65b];return _0x33a05c;};'use strict';var multer=require(_0x37c9('0x0'));var util=require(_0x37c9('0x1'));var path=require(_0x37c9('0x2'));var timeout=require(_0x37c9('0x3'));var express=require(_0x37c9('0x4'));var router=express[_0x37c9('0x5')]();var fs_extra=require(_0x37c9('0x6'));var auth=require(_0x37c9('0x7'));var interaction=require(_0x37c9('0x8'));var config=require(_0x37c9('0x9'));var controller=require(_0x37c9('0xa'));router[_0x37c9('0xb')]('/',auth[_0x37c9('0xc')](),controller[_0x37c9('0xd')]);router[_0x37c9('0xb')](_0x37c9('0xe'),auth['isAuthenticated'](),controller[_0x37c9('0xf')]);router[_0x37c9('0xb')](_0x37c9('0x10'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x11')]);router[_0x37c9('0xb')](_0x37c9('0x12'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x13')]);router[_0x37c9('0xb')](_0x37c9('0x14'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x15')]);router['get'](_0x37c9('0x16'),controller[_0x37c9('0x17')]);router[_0x37c9('0xb')](_0x37c9('0x18'),auth['isAuthenticated'](),controller[_0x37c9('0x19')]);router['get'](_0x37c9('0x1a'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x1b')]);router['get'](_0x37c9('0x1c'),auth[_0x37c9('0xc')](),controller['getQueues']);router[_0x37c9('0xb')]('/:id/queues_rt',auth[_0x37c9('0xc')](),controller[_0x37c9('0x1d')]);router[_0x37c9('0xb')]('/:id/groups',auth[_0x37c9('0xc')](),controller[_0x37c9('0x1e')]);router[_0x37c9('0xb')](_0x37c9('0x1f'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x20')]);router[_0x37c9('0xb')]('/:id/screen_recordings',auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0x37c9('0xb')](_0x37c9('0x21'),auth[_0x37c9('0xc')](),controller['getChatInteractions']);router['get'](_0x37c9('0x22'),auth[_0x37c9('0xc')](),controller['getOpenchannelInteractions']);router['get']('/:id/mail/interactions',auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x37c9('0xb')](_0x37c9('0x23'),auth[_0x37c9('0xc')](),controller['getSmsInteractions']);router[_0x37c9('0xb')]('/:id/fax/interactions',auth[_0x37c9('0xc')](),controller[_0x37c9('0x24')]);router[_0x37c9('0xb')](_0x37c9('0x25'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x26')]);router[_0x37c9('0xb')]('/:id/teams',auth[_0x37c9('0xc')](),controller[_0x37c9('0x27')]);router[_0x37c9('0xb')](_0x37c9('0x28'),auth['isAuthenticated'](),controller['getLists']);router[_0x37c9('0xb')](_0x37c9('0x29'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x2a')]);router[_0x37c9('0xb')](_0x37c9('0x2b'),auth['isAuthenticated'](),controller[_0x37c9('0x2c')]);router['get']('/:id/fax_accounts',auth[_0x37c9('0xc')](),controller['getFaxAccounts']);router['get']('/:id/mail_accounts',auth[_0x37c9('0xc')](),controller[_0x37c9('0x2d')]);router[_0x37c9('0xb')](_0x37c9('0x2e'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x2f')]);router[_0x37c9('0xb')]('/:id/sms_accounts',auth[_0x37c9('0xc')](),controller[_0x37c9('0x30')]);router[_0x37c9('0xb')](_0x37c9('0x31'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x37c9('0xb')]('/:id/whatsapp_accounts',auth[_0x37c9('0xc')](),controller[_0x37c9('0x32')]);router['get'](_0x37c9('0x33'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x34')]);router[_0x37c9('0xb')](_0x37c9('0x35'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x36')]);router[_0x37c9('0x37')](_0x37c9('0x1a'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x38')]);router[_0x37c9('0x37')]('/',auth[_0x37c9('0xc')](),controller['create']);router[_0x37c9('0x37')](_0x37c9('0x39'),auth[_0x37c9('0xc')](),controller['bulkCreate']);router['post'](_0x37c9('0x1c'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer[_0x37c9('0x3a')]({'destination':function(_0xce1cab,_0x2d3ee2,_0x4bf4eb){_0x4bf4eb(null,path[_0x37c9('0x3b')](config[_0x37c9('0x3c')],_0x37c9('0x3d')));},'filename':function(_0x9b949c,_0x51188e,_0x114a41){_0x114a41(null,util[_0x37c9('0x3e')]('%s-%s',Date[_0x37c9('0x3f')](),_0x51188e['originalname']));}})});router[_0x37c9('0x37')]('/:id/avatar',upload[_0x37c9('0x40')](_0x37c9('0x41')),controller[_0x37c9('0x42')]);router[_0x37c9('0x37')](_0x37c9('0x43'),auth[_0x37c9('0xc')](),controller['login']);router[_0x37c9('0x37')]('/:id/logout',auth[_0x37c9('0xc')](),controller[_0x37c9('0x44')]);router[_0x37c9('0x37')]('/:id/pause',auth[_0x37c9('0xc')](),controller[_0x37c9('0x45')]);router['post']('/:id/unpause',auth['isAuthenticated'](),controller['unpause']);router[_0x37c9('0x37')](_0x37c9('0x46'),auth['isAuthenticated'](),controller[_0x37c9('0x47')]);router[_0x37c9('0x37')](_0x37c9('0x48'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x49')]);router[_0x37c9('0x37')](_0x37c9('0x4a'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x4b')]);router[_0x37c9('0x37')](_0x37c9('0x4c'),auth[_0x37c9('0xc')](),controller['addFaxInteractions']);router[_0x37c9('0x37')](_0x37c9('0x4d'),auth[_0x37c9('0xc')](),controller['addSmsInteractions']);router[_0x37c9('0x37')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x37c9('0x4e')]);router['post'](_0x37c9('0x4f'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x50')]);router[_0x37c9('0x37')](_0x37c9('0x51'),auth['isAuthenticated'](),controller[_0x37c9('0x52')]);router[_0x37c9('0x37')](_0x37c9('0x53'),auth[_0x37c9('0xc')](),controller['addMailAccounts']);router['post']('/:id/openchannel_accounts',auth[_0x37c9('0xc')](),controller['addOpenchannelAccounts']);router[_0x37c9('0x37')](_0x37c9('0x54'),auth['isAuthenticated'](),controller[_0x37c9('0x55')]);router['post'](_0x37c9('0x31'),auth['isAuthenticated'](),controller[_0x37c9('0x56')]);router[_0x37c9('0x37')](_0x37c9('0x57'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x58')]);router[_0x37c9('0x37')](_0x37c9('0x35'),auth['isAuthenticated'](),controller['createApiKey']);router[_0x37c9('0x59')]('/:id',auth[_0x37c9('0xc')](),controller['update']);router[_0x37c9('0x59')](_0x37c9('0x5a'),auth[_0x37c9('0xc')](),controller['changePassword']);router[_0x37c9('0x5b')](_0x37c9('0x1c'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x5c')]);router[_0x37c9('0x5b')]('/:id/teams',auth['isAuthenticated'](),controller[_0x37c9('0x5d')]);router[_0x37c9('0x5b')](_0x37c9('0x14'),auth['isAuthenticated'](),controller[_0x37c9('0x5e')]);router[_0x37c9('0x5b')](_0x37c9('0x48'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x5f')]);router[_0x37c9('0x5b')](_0x37c9('0x4a'),auth[_0x37c9('0xc')](),controller['removeMailInteractions']);router[_0x37c9('0x5b')](_0x37c9('0x4c'),auth[_0x37c9('0xc')](),controller['removeFaxInteractions']);router[_0x37c9('0x5b')](_0x37c9('0x4d'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x60')]);router['delete'](_0x37c9('0x61'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x62')]);router[_0x37c9('0x5b')](_0x37c9('0x4f'),auth[_0x37c9('0xc')](),controller['removeWhatsappInteractions']);router[_0x37c9('0x5b')]('/:id/fax_accounts',auth[_0x37c9('0xc')](),controller[_0x37c9('0x63')]);router['delete']('/:id/mail_accounts',auth[_0x37c9('0xc')](),controller['removeMailAccounts']);router[_0x37c9('0x5b')](_0x37c9('0x2e'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x64')]);router['delete'](_0x37c9('0x54'),auth['isAuthenticated'](),controller[_0x37c9('0x65')]);router[_0x37c9('0x5b')](_0x37c9('0x31'),auth['isAuthenticated'](),controller[_0x37c9('0x66')]);router[_0x37c9('0x5b')](_0x37c9('0x57'),auth[_0x37c9('0xc')](),controller['removeWhatsappAccounts']);router[_0x37c9('0x5b')]('/:id/api_key',auth[_0x37c9('0xc')](),controller[_0x37c9('0x67')]);router[_0x37c9('0x37')](_0x37c9('0x68'),auth[_0x37c9('0xc')](),controller[_0x37c9('0x69')]);module[_0x37c9('0x6a')]=router; \ No newline at end of file +var _0x7989=['delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','/:id/messengerSoundNotification','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','join','root','format','%s-%s','now','file','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','put','update','/:id/password','changePassword','removeQueues'];(function(_0x3255c4,_0x4298f6){var _0x171cf0=function(_0x55b58e){while(--_0x55b58e){_0x3255c4['push'](_0x3255c4['shift']());}};_0x171cf0(++_0x4298f6);}(_0x7989,0x82));var _0x9798=function(_0x35cb30,_0x12ac50){_0x35cb30=_0x35cb30-0x0;var _0x2742b9=_0x7989[_0x35cb30];return _0x2742b9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9798('0x0'));var timeout=require(_0x9798('0x1'));var express=require('express');var router=express[_0x9798('0x2')]();var fs_extra=require(_0x9798('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9798('0x4'));var config=require(_0x9798('0x5'));var controller=require(_0x9798('0x6'));router[_0x9798('0x7')]('/',auth[_0x9798('0x8')](),controller[_0x9798('0x9')]);router[_0x9798('0x7')](_0x9798('0xa'),auth[_0x9798('0x8')](),controller['describe']);router[_0x9798('0x7')](_0x9798('0xb'),auth['isAuthenticated'](),controller[_0x9798('0xc')]);router['get'](_0x9798('0xd'),auth['isAuthenticated'](),controller[_0x9798('0xe')]);router[_0x9798('0x7')](_0x9798('0xf'),auth[_0x9798('0x8')](),controller[_0x9798('0x10')]);router[_0x9798('0x7')](_0x9798('0x11'),controller[_0x9798('0x12')]);router['get'](_0x9798('0x13'),auth['isAuthenticated'](),controller['getOpenTabs']);router[_0x9798('0x7')](_0x9798('0x14'),auth[_0x9798('0x8')](),controller[_0x9798('0x15')]);router['get']('/:id/queues',auth[_0x9798('0x8')](),controller[_0x9798('0x16')]);router['get'](_0x9798('0x17'),auth[_0x9798('0x8')](),controller[_0x9798('0x18')]);router[_0x9798('0x7')](_0x9798('0x19'),auth[_0x9798('0x8')](),controller[_0x9798('0x1a')]);router[_0x9798('0x7')]('/:id/recordings',auth[_0x9798('0x8')](),controller[_0x9798('0x1b')]);router[_0x9798('0x7')](_0x9798('0x1c'),auth['isAuthenticated'](),controller[_0x9798('0x1d')]);router[_0x9798('0x7')](_0x9798('0x1e'),auth[_0x9798('0x8')](),controller[_0x9798('0x1f')]);router[_0x9798('0x7')](_0x9798('0x20'),auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router[_0x9798('0x7')](_0x9798('0x21'),auth[_0x9798('0x8')](),controller[_0x9798('0x22')]);router['get'](_0x9798('0x23'),auth[_0x9798('0x8')](),controller[_0x9798('0x24')]);router[_0x9798('0x7')](_0x9798('0x25'),auth[_0x9798('0x8')](),controller['getFaxInteractions']);router['get']('/:id/whatsapp/interactions',auth[_0x9798('0x8')](),controller[_0x9798('0x26')]);router[_0x9798('0x7')](_0x9798('0x27'),auth[_0x9798('0x8')](),controller[_0x9798('0x28')]);router['get'](_0x9798('0x29'),auth['isAuthenticated'](),controller[_0x9798('0x2a')]);router[_0x9798('0x7')]('/:id/agents',auth[_0x9798('0x8')](),controller[_0x9798('0x2b')]);router[_0x9798('0x7')](_0x9798('0x2c'),auth['isAuthenticated'](),controller[_0x9798('0x2d')]);router['get']('/:id/fax_accounts',auth[_0x9798('0x8')](),controller[_0x9798('0x2e')]);router[_0x9798('0x7')](_0x9798('0x2f'),auth[_0x9798('0x8')](),controller[_0x9798('0x30')]);router[_0x9798('0x7')](_0x9798('0x31'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router['get'](_0x9798('0x32'),auth[_0x9798('0x8')](),controller[_0x9798('0x33')]);router['get']('/:id/chat_websites',auth[_0x9798('0x8')](),controller[_0x9798('0x34')]);router[_0x9798('0x7')]('/:id/whatsapp_accounts',auth[_0x9798('0x8')](),controller[_0x9798('0x35')]);router[_0x9798('0x7')](_0x9798('0x36'),auth[_0x9798('0x8')](),controller[_0x9798('0x37')]);router[_0x9798('0x7')](_0x9798('0x38'),auth['isAuthenticated'](),controller[_0x9798('0x39')]);router[_0x9798('0x3a')](_0x9798('0x14'),auth[_0x9798('0x8')](),controller[_0x9798('0x3b')]);router[_0x9798('0x3a')]('/',auth[_0x9798('0x8')](),controller[_0x9798('0x3c')]);router[_0x9798('0x3a')](_0x9798('0x3d'),auth['isAuthenticated'](),controller[_0x9798('0x3e')]);router['post'](_0x9798('0x3f'),auth[_0x9798('0x8')](),controller[_0x9798('0x40')]);var upload=multer({'storage':multer[_0x9798('0x41')]({'destination':function(_0x3cbed7,_0x348621,_0x26fe52){_0x26fe52(null,path[_0x9798('0x42')](config[_0x9798('0x43')],'server/files/images/'));},'filename':function(_0x4fd6f4,_0x401e0b,_0x5ae8c8){_0x5ae8c8(null,util[_0x9798('0x44')](_0x9798('0x45'),Date[_0x9798('0x46')](),_0x401e0b['originalname']));}})});router[_0x9798('0x3a')]('/:id/avatar',upload['single'](_0x9798('0x47')),controller['addAvatar']);router['post'](_0x9798('0x48'),auth[_0x9798('0x8')](),controller[_0x9798('0x49')]);router['post'](_0x9798('0x4a'),auth['isAuthenticated'](),controller[_0x9798('0x4b')]);router[_0x9798('0x3a')](_0x9798('0x4c'),auth['isAuthenticated'](),controller[_0x9798('0x4d')]);router[_0x9798('0x3a')](_0x9798('0x4e'),auth['isAuthenticated'](),controller['unpause']);router['post']('/:id/teams',auth[_0x9798('0x8')](),controller[_0x9798('0x4f')]);router[_0x9798('0x3a')](_0x9798('0x50'),auth[_0x9798('0x8')](),controller[_0x9798('0x51')]);router[_0x9798('0x3a')](_0x9798('0x52'),auth[_0x9798('0x8')](),controller[_0x9798('0x53')]);router[_0x9798('0x3a')]('/:id/fax_interactions',auth[_0x9798('0x8')](),controller[_0x9798('0x54')]);router['post'](_0x9798('0x55'),auth[_0x9798('0x8')](),controller['addSmsInteractions']);router[_0x9798('0x3a')]('/:id/openchannel_interactions',auth[_0x9798('0x8')](),controller[_0x9798('0x56')]);router[_0x9798('0x3a')](_0x9798('0x57'),auth[_0x9798('0x8')](),controller[_0x9798('0x58')]);router[_0x9798('0x3a')](_0x9798('0x59'),auth[_0x9798('0x8')](),controller[_0x9798('0x5a')]);router['post'](_0x9798('0x2f'),auth['isAuthenticated'](),controller[_0x9798('0x5b')]);router[_0x9798('0x3a')]('/:id/openchannel_accounts',auth[_0x9798('0x8')](),controller[_0x9798('0x5c')]);router[_0x9798('0x3a')](_0x9798('0x32'),auth[_0x9798('0x8')](),controller[_0x9798('0x5d')]);router[_0x9798('0x3a')]('/:id/chat_websites',auth[_0x9798('0x8')](),controller[_0x9798('0x5e')]);router[_0x9798('0x3a')](_0x9798('0x5f'),auth['isAuthenticated'](),controller[_0x9798('0x60')]);router[_0x9798('0x3a')](_0x9798('0x38'),auth[_0x9798('0x8')](),controller['createApiKey']);router[_0x9798('0x61')](_0x9798('0xf'),auth[_0x9798('0x8')](),controller[_0x9798('0x62')]);router[_0x9798('0x61')](_0x9798('0x63'),auth[_0x9798('0x8')](),controller[_0x9798('0x64')]);router['delete']('/:id/queues',auth[_0x9798('0x8')](),controller[_0x9798('0x65')]);router[_0x9798('0x66')](_0x9798('0x27'),auth[_0x9798('0x8')](),controller[_0x9798('0x67')]);router[_0x9798('0x66')](_0x9798('0xf'),auth[_0x9798('0x8')](),controller[_0x9798('0x68')]);router[_0x9798('0x66')](_0x9798('0x50'),auth['isAuthenticated'](),controller[_0x9798('0x69')]);router[_0x9798('0x66')]('/:id/mail_interactions',auth[_0x9798('0x8')](),controller[_0x9798('0x6a')]);router[_0x9798('0x66')]('/:id/fax_interactions',auth[_0x9798('0x8')](),controller[_0x9798('0x6b')]);router[_0x9798('0x66')](_0x9798('0x55'),auth[_0x9798('0x8')](),controller['removeSmsInteractions']);router[_0x9798('0x66')](_0x9798('0x6c'),auth['isAuthenticated'](),controller[_0x9798('0x6d')]);router[_0x9798('0x66')](_0x9798('0x57'),auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router[_0x9798('0x66')](_0x9798('0x59'),auth[_0x9798('0x8')](),controller['removeFaxAccounts']);router['delete'](_0x9798('0x2f'),auth['isAuthenticated'](),controller[_0x9798('0x6e')]);router[_0x9798('0x66')](_0x9798('0x31'),auth[_0x9798('0x8')](),controller[_0x9798('0x6f')]);router[_0x9798('0x66')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x9798('0x70')]);router['delete']('/:id/chat_websites',auth[_0x9798('0x8')](),controller[_0x9798('0x71')]);router[_0x9798('0x66')](_0x9798('0x5f'),auth[_0x9798('0x8')](),controller[_0x9798('0x72')]);router['delete'](_0x9798('0x38'),auth['isAuthenticated'](),controller['removeApiKey']);router[_0x9798('0x3a')](_0x9798('0x73'),auth[_0x9798('0x8')](),controller['messengerSoundNotification']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 5fad3e0..6963fe6 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 _0x70e9=['map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','moment','util','exports','STRING','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','email','toLowerCase','user','agent','local','internal','accountcode','BOOLEAN','DATE','INTEGER','ENUM','friend','peer','from-sip','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','uas','certificate','active','passive','actpass','update,nonat','TEXT','get','isArray','transport','wss','avpf','force_avp','icesupport','dtlsenable','dtlscertfile','dtlsprivatekey','rtcp_mux','encryption','dtlsverify','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0x70e9,0xbb));var _0x970e=function(_0x162caa,_0x307231){_0x162caa=_0x162caa-0x0;var _0x21bb52=_0x70e9[_0x162caa];return _0x21bb52;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x970e('0x0'));var util=require(_0x970e('0x1'));var _=require('lodash');module[_0x970e('0x2')]={'name':{'type':Sequelize[_0x970e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4a6799){this[_0x970e('0x4')]('name',_0x4a6799);this[_0x970e('0x4')](_0x970e('0x5'),_0x4a6799);},'comment':_0x970e('0x6')},'fullname':{'type':Sequelize[_0x970e('0x3')],'allowNull':![],'set':function(_0xd79653){this['setDataValue'](_0x970e('0x7'),_0xd79653);this['setDataValue'](_0x970e('0x8'),util[_0x970e('0x9')]('\x22%s\x22\x20<%s>',_0xd79653,this[_0x970e('0xa')]('internal')));}},'alias':{'type':Sequelize[_0x970e('0x3')]},'email':{'type':Sequelize[_0x970e('0x3')],'allowNull':![],'unique':_0x970e('0xb'),'validate':{'isEmail':!![]},'set':function(_0x5e8131){if(_0x5e8131){this[_0x970e('0x4')]('email',_0x5e8131[_0x970e('0xc')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0x970e('0xd'),_0x970e('0xe'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x970e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x970e('0xf')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x970e('0x10'),'set':function(_0x31d553){this[_0x970e('0x4')](_0x970e('0x10'),_0x31d553);this[_0x970e('0x4')](_0x970e('0x11'),_0x31d553);this[_0x970e('0x4')](_0x970e('0x8'),util[_0x970e('0x9')]('\x22%s\x22\x20<%s>',this['getDataValue']('fullname'),_0x31d553));}},'salt':{'type':Sequelize[_0x970e('0x3')]},'phone':{'type':Sequelize[_0x970e('0x3')]},'mobile':{'type':Sequelize[_0x970e('0x3')]},'address':{'type':Sequelize[_0x970e('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x970e('0x3')]},'city':{'type':Sequelize[_0x970e('0x3')]},'country':{'type':Sequelize[_0x970e('0x3')]},'online':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x970e('0x13')]},'voicePause':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x970e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x970e('0x13')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x970e('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x970e('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x970e('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x970e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x970e('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x970e('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x970e('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x16'),_0x970e('0xd'),_0x970e('0x17')),'allowNull':!![],'defaultValue':_0x970e('0x16')},'context':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![],'defaultValue':_0x970e('0x18')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x970e('0x19'),_0x970e('0x1a'),_0x970e('0x1b'),_0x970e('0x1c'),'PROHIB_FAILED_SCREEN',_0x970e('0x1d')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![],'defaultValue':_0x970e('0x1e'),'set':function(_0x56dff4){this[_0x970e('0x4')]('transport',_0x56dff4?_0x56dff4['join'](','):null);},'get':function(){return this[_0x970e('0xa')]('transport')?this[_0x970e('0xa')]('transport')[_0x970e('0x1f')](','):null;},'comment':_0x970e('0x20')},'dtmfmode':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x21'),_0x970e('0x22'),_0x970e('0x23'),_0x970e('0x24'),_0x970e('0x25')),'allowNull':!![],'defaultValue':_0x970e('0x21')},'directmedia':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x26'),'no','nonat',_0x970e('0x27'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x970e('0x28'),'set':function(_0x229c69){this[_0x970e('0x4')](_0x970e('0x29'),_0x229c69?_0x229c69[_0x970e('0x2a')](','):null);},'get':function(){return this[_0x970e('0xa')]('nat')?this[_0x970e('0xa')](_0x970e('0x29'))[_0x970e('0x1f')](','):null;},'comment':_0x970e('0x2b')},'callgroup':{'type':Sequelize[_0x970e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x970e('0x3')]},'pickupgroup':{'type':Sequelize[_0x970e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x970e('0x3')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x970e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x970e('0x3')],'allowNull':![],'defaultValue':_0x970e('0x2c'),'set':function(_0x56e74a){this[_0x970e('0x4')](_0x970e('0x2d'),_0x56e74a?_0x56e74a['join'](';'):_0x970e('0x2c'));},'get':function(){return this['getDataValue'](_0x970e('0x2d'))?this[_0x970e('0xa')](_0x970e('0x2d'))[_0x970e('0x1f')](';'):null;},'comment':_0x970e('0x2e')},'autoframing':{'type':Sequelize['ENUM'](_0x970e('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![],'set':function(_0xbaacf8){this[_0x970e('0x4')](_0x970e('0x2f'),_0xbaacf8?_0xbaacf8['join'](','):null);},'get':function(){return this['getDataValue'](_0x970e('0x2f'))?this[_0x970e('0xa')](_0x970e('0x2f'))[_0x970e('0x1f')](','):null;},'comment':_0x970e('0x30')},'trustrpid':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x970e('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x26'),'no',_0x970e('0x31')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x970e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x970e('0x32')},'amaflags':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x970e('0x26'),'no'),'allowNull':!![],'defaultValue':_0x970e('0x26')},'busylevel':{'type':Sequelize[_0x970e('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x970e('0x15')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x970e('0x26'),'no',_0x970e('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x970e('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x970e('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x34'),_0x970e('0x35'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x970e('0x15')]('uac',_0x970e('0x36')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x26'),'no'),'allowNull':!![],'defaultValue':_0x970e('0x26')},'keepalive':{'type':Sequelize[_0x970e('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x970e('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x970e('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x970e('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x970e('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x970e('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x970e('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x970e('0x15')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x970e('0x26'),'no','fingerprint',_0x970e('0x37')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x970e('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x38'),_0x970e('0x39'),_0x970e('0x3a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x970e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x970e('0x15')](_0x970e('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM']('yes','no','nonat',_0x970e('0x27'),_0x970e('0x3b')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x970e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x970e('0x13')]},'passwordResetAt':{'type':Sequelize[_0x970e('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x970e('0x3c')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x5e2616){this['setDataValue']('showWebBar',_0x5e2616);var _0x4d1b6b=this[_0x970e('0x3d')]({'plain':!![]});switch(_0x5e2616){case 0x0:case 0x1:var _0x61e35d=_0x4d1b6b['transport']?_[_0x970e('0x3e')](_0x4d1b6b[_0x970e('0x3f')])?_0x4d1b6b['transport'][_0x970e('0x2a')]():_0x4d1b6b['transport']:_0x970e('0x1e');if(_0x61e35d===_0x970e('0x40')){_0x61e35d=_0x970e('0x1e');}this[_0x970e('0x4')](_0x970e('0x3f'),_0x61e35d);this[_0x970e('0x4')]('encryption','no');this[_0x970e('0x4')](_0x970e('0x41'),null);this[_0x970e('0x4')](_0x970e('0x42'),null);this[_0x970e('0x4')](_0x970e('0x43'),null);this[_0x970e('0x4')](_0x970e('0x44'),null);this['setDataValue']('dtlsverify',null);this[_0x970e('0x4')]('dtlssetup',null);this[_0x970e('0x4')](_0x970e('0x45'),null);this[_0x970e('0x4')](_0x970e('0x46'),null);this[_0x970e('0x4')](_0x970e('0x47'),'no');break;case 0x2:this[_0x970e('0x4')](_0x970e('0x3f'),_0x970e('0x40'));this[_0x970e('0x4')](_0x970e('0x48'),_0x970e('0x26'));this[_0x970e('0x4')]('avpf',_0x970e('0x26'));this[_0x970e('0x4')]('force_avp','yes');this['setDataValue'](_0x970e('0x43'),_0x970e('0x26'));this[_0x970e('0x4')]('dtlsenable',_0x970e('0x26'));this[_0x970e('0x4')](_0x970e('0x49'),'no');this[_0x970e('0x4')]('dtlssetup','actpass');this[_0x970e('0x4')](_0x970e('0x45'),_0x4d1b6b[_0x970e('0x45')]||_0x970e('0x4a'));this[_0x970e('0x4')](_0x970e('0x46'),_0x4d1b6b[_0x970e('0x46')]||_0x970e('0x4b'));this[_0x970e('0x4')](_0x970e('0x47'),_0x970e('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0x970e('0x3c')],'set':function(_0x18cca2){this[_0x970e('0x4')](_0x970e('0x4c'),_0x18cca2?_0x18cca2[_0x970e('0x2a')](','):[]);},'get':function(){return this[_0x970e('0xa')](_0x970e('0x4c'))?_[_0x970e('0x4d')](this[_0x970e('0xa')](_0x970e('0x4c'))['split'](','),function(_0x5a5e84){return parseInt(_0x5a5e84,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x970e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x970e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x970e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x970e('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x970e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x970e('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x970e('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x970e('0x3')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x970e('0x4e')],'get':function(){return this[_0x970e('0xa')](_0x970e('0x4f'))?this[_0x970e('0xa')](_0x970e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x970e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![],'set':function(_0x28325c){if(typeof _0x28325c===_0x970e('0x50')){var _0x178277=_0x28325c==='1'?!![]:_0x28325c==='0'?![]:_0x28325c===_0x970e('0x51')?!![]:_0x28325c===_0x970e('0x52')?![]:![];this[_0x970e('0x4')](_0x970e('0x53'),_0x178277);}else{this[_0x970e('0x4')](_0x970e('0x53'),_0x28325c);}}},'blocked':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![],'set':function(_0x276cff){this['setDataValue'](_0x970e('0x54'),_0x276cff);if(_0x276cff===!![]){this[_0x970e('0x4')](_0x970e('0x55'),moment());this[_0x970e('0x4')](_0x970e('0x56'),0x0);}else{this[_0x970e('0x4')](_0x970e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x970e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x970e('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x970e('0x12')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x970e('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x970e('0x12')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x970e('0x12')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x970e('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x970e('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x970e('0x12')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x970e('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x970e('0x14')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4fb7=['lodash','STRING','setDataValue','name','defaultuser','callerid','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase','ENUM','admin','user','agent','telephone','local','internal','accountcode','format','BOOLEAN','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','info','shortinfo','inband','rfc2833','yes','nonat','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uas','fingerprint','certificate','active','update,nonat','DATE','showWebBar','encryption','avpf','force_avp','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','util'];(function(_0x2678b7,_0x168f84){var _0x36aec9=function(_0x5d042c){while(--_0x5d042c){_0x2678b7['push'](_0x2678b7['shift']());}};_0x36aec9(++_0x168f84);}(_0x4fb7,0x105));var _0x74fb=function(_0x325598,_0x4da853){_0x325598=_0x325598-0x0;var _0x26244f=_0x4fb7[_0x325598];return _0x26244f;};'use strict';var Sequelize=require(_0x74fb('0x0'));var moment=require(_0x74fb('0x1'));var util=require(_0x74fb('0x2'));var _=require(_0x74fb('0x3'));module['exports']={'name':{'type':Sequelize[_0x74fb('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5d3439){this[_0x74fb('0x5')](_0x74fb('0x6'),_0x5d3439);this[_0x74fb('0x5')](_0x74fb('0x7'),_0x5d3439);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x74fb('0x4')],'allowNull':![],'set':function(_0x31f10c){this[_0x74fb('0x5')]('fullname',_0x31f10c);this[_0x74fb('0x5')](_0x74fb('0x8'),util['format'](_0x74fb('0x9'),_0x31f10c,this[_0x74fb('0xa')]('internal')));}},'alias':{'type':Sequelize[_0x74fb('0x4')]},'email':{'type':Sequelize[_0x74fb('0x4')],'allowNull':![],'unique':_0x74fb('0xb'),'validate':{'isEmail':!![]},'set':function(_0x2da359){if(_0x2da359){this['setDataValue'](_0x74fb('0xb'),_0x2da359[_0x74fb('0xc')]());}}},'role':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0xe'),_0x74fb('0xf'),_0x74fb('0x10'),_0x74fb('0x11')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x74fb('0x12')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x18b111){this[_0x74fb('0x5')](_0x74fb('0x13'),_0x18b111);this[_0x74fb('0x5')](_0x74fb('0x14'),_0x18b111);this[_0x74fb('0x5')]('callerid',util[_0x74fb('0x15')](_0x74fb('0x9'),this[_0x74fb('0xa')]('fullname'),_0x18b111));}},'salt':{'type':Sequelize[_0x74fb('0x4')]},'phone':{'type':Sequelize[_0x74fb('0x4')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x74fb('0x4')]},'zipcode':{'type':Sequelize[_0x74fb('0x4')]},'userpic':{'type':Sequelize[_0x74fb('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x74fb('0x4')]},'online':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x74fb('0x4')],'defaultValue':_0x74fb('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x74fb('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x74fb('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x74fb('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x74fb('0x18')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x74fb('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x74fb('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x74fb('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x74fb('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![],'defaultValue':_0x74fb('0x19')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x74fb('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x74fb('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x74fb('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x1a'),_0x74fb('0xf'),'peer'),'allowNull':!![],'defaultValue':_0x74fb('0x1a')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x74fb('0x1b')},'callingpres':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x1c'),_0x74fb('0x1d'),'ALLOWED_FAILED_SCREEN',_0x74fb('0x1e'),'PROHIB_NOT_SCREENED',_0x74fb('0x1f'),_0x74fb('0x20'),_0x74fb('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x74fb('0x22'),'set':function(_0xfd21e2){this['setDataValue'](_0x74fb('0x23'),_0xfd21e2?_0xfd21e2[_0x74fb('0x24')](','):null);},'get':function(){return this[_0x74fb('0xa')](_0x74fb('0x23'))?this[_0x74fb('0xa')](_0x74fb('0x23'))[_0x74fb('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x74fb('0xd')]('rfc2833',_0x74fb('0x26'),_0x74fb('0x27'),_0x74fb('0x28'),'auto'),'allowNull':!![],'defaultValue':_0x74fb('0x29')},'directmedia':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x2a'),'no',_0x74fb('0x2b'),_0x74fb('0x2c'),_0x74fb('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x3f6ff6){this[_0x74fb('0x5')](_0x74fb('0x2e'),_0x3f6ff6?_0x3f6ff6['join'](','):null);},'get':function(){return this[_0x74fb('0xa')](_0x74fb('0x2e'))?this[_0x74fb('0xa')]('nat')[_0x74fb('0x25')](','):null;},'comment':_0x74fb('0x2f')},'callgroup':{'type':Sequelize[_0x74fb('0x4')]},'namedcallgroup':{'type':Sequelize[_0x74fb('0x4')]},'pickupgroup':{'type':Sequelize[_0x74fb('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x74fb('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x74fb('0x4')]},'disallow':{'type':Sequelize[_0x74fb('0x4')],'allowNull':![],'defaultValue':_0x74fb('0x30')},'allow':{'type':Sequelize[_0x74fb('0x4')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x540774){this[_0x74fb('0x5')](_0x74fb('0x31'),_0x540774?_0x540774[_0x74fb('0x24')](';'):_0x74fb('0x32'));},'get':function(){return this[_0x74fb('0xa')](_0x74fb('0x31'))?this[_0x74fb('0xa')](_0x74fb('0x31'))[_0x74fb('0x25')](';'):null;},'comment':_0x74fb('0x33')},'autoframing':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![],'set':function(_0xde9f6e){this[_0x74fb('0x5')](_0x74fb('0x34'),_0xde9f6e?_0xde9f6e[_0x74fb('0x24')](','):null);},'get':function(){return this[_0x74fb('0xa')]('insecure')?this[_0x74fb('0xa')](_0x74fb('0x34'))['split'](','):null;},'comment':_0x74fb('0x35')},'trustrpid':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x2a'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![],'defaultValue':_0x74fb('0x36')},'amaflags':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x74fb('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x74fb('0x2a')},'busylevel':{'type':Sequelize[_0x74fb('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x74fb('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x74fb('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x74fb('0xd')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x74fb('0xd')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x2a'),'no',_0x74fb('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x74fb('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x74fb('0xd')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x38'),_0x74fb('0x39'),_0x74fb('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x74fb('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x74fb('0x3b')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x74fb('0x2a')},'keepalive':{'type':Sequelize[_0x74fb('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x74fb('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x74fb('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x74fb('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x74fb('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x74fb('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x74fb('0xd')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x2a'),'no',_0x74fb('0x3c'),_0x74fb('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x74fb('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x3e'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x74fb('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x74fb('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x74fb('0xd')](_0x74fb('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x74fb('0xd')]('yes','no',_0x74fb('0x2b'),_0x74fb('0x2c'),_0x74fb('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x74fb('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x74fb('0x40')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x74fb('0x18')],'defaultValue':0x0,'set':function(_0x8f461c){this[_0x74fb('0x5')](_0x74fb('0x41'),_0x8f461c);var _0x5d4f95=this['get']({'plain':!![]});switch(_0x8f461c){case 0x0:case 0x1:var _0x5a1416=_0x5d4f95[_0x74fb('0x23')]?_['isArray'](_0x5d4f95[_0x74fb('0x23')])?_0x5d4f95[_0x74fb('0x23')][_0x74fb('0x24')]():_0x5d4f95['transport']:_0x74fb('0x22');if(_0x5a1416==='wss'){_0x5a1416=_0x74fb('0x22');}this[_0x74fb('0x5')](_0x74fb('0x23'),_0x5a1416);this[_0x74fb('0x5')](_0x74fb('0x42'),'no');this[_0x74fb('0x5')](_0x74fb('0x43'),null);this['setDataValue'](_0x74fb('0x44'),null);this[_0x74fb('0x5')](_0x74fb('0x45'),null);this[_0x74fb('0x5')]('dtlsenable',null);this[_0x74fb('0x5')](_0x74fb('0x46'),null);this[_0x74fb('0x5')](_0x74fb('0x47'),null);this[_0x74fb('0x5')]('dtlscertfile',null);this[_0x74fb('0x5')]('dtlsprivatekey',null);this[_0x74fb('0x5')](_0x74fb('0x48'),'no');break;case 0x2:this[_0x74fb('0x5')](_0x74fb('0x23'),_0x74fb('0x49'));this['setDataValue']('encryption',_0x74fb('0x2a'));this[_0x74fb('0x5')](_0x74fb('0x43'),_0x74fb('0x2a'));this['setDataValue'](_0x74fb('0x44'),_0x74fb('0x2a'));this[_0x74fb('0x5')]('icesupport',_0x74fb('0x2a'));this['setDataValue']('dtlsenable',_0x74fb('0x2a'));this[_0x74fb('0x5')](_0x74fb('0x46'),'no');this[_0x74fb('0x5')](_0x74fb('0x47'),'actpass');this[_0x74fb('0x5')]('dtlscertfile',_0x5d4f95[_0x74fb('0x4a')]||_0x74fb('0x4b'));this[_0x74fb('0x5')](_0x74fb('0x4c'),_0x5d4f95[_0x74fb('0x4c')]||'/etc/pki/tls/private/motion.key');this[_0x74fb('0x5')](_0x74fb('0x48'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x74fb('0x4d')],'set':function(_0x58ea14){this[_0x74fb('0x5')](_0x74fb('0x4e'),_0x58ea14?_0x58ea14['join'](','):[]);},'get':function(){return this['getDataValue']('permissions')?_[_0x74fb('0x4f')](this['getDataValue'](_0x74fb('0x4e'))[_0x74fb('0x25')](','),function(_0xb663db){return parseInt(_0xb663db,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x74fb('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x74fb('0x18')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x74fb('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x74fb('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x74fb('0x50')],'get':function(){return this['getDataValue'](_0x74fb('0x51'))?this['getDataValue'](_0x74fb('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x74fb('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![],'set':function(_0x4fd92b){if(typeof _0x4fd92b==='string'){var _0x2b2e11=_0x4fd92b==='1'?!![]:_0x4fd92b==='0'?![]:_0x4fd92b===_0x74fb('0x52')?!![]:_0x4fd92b===_0x74fb('0x53')?![]:![];this[_0x74fb('0x5')](_0x74fb('0x54'),_0x2b2e11);}else{this[_0x74fb('0x5')](_0x74fb('0x54'),_0x4fd92b);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4ee7ca){this[_0x74fb('0x5')]('blocked',_0x4ee7ca);if(_0x4ee7ca===!![]){this[_0x74fb('0x5')]('blockedAt',moment());this['setDataValue'](_0x74fb('0x55'),0x0);}else{this[_0x74fb('0x5')](_0x74fb('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x74fb('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x74fb('0x18')](0x5)[_0x74fb('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x74fb('0x18')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x74fb('0x18')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x74fb('0x18')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x74fb('0x16')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 2115f1a..028cac2 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 _0xd8ee=['body','describe','addContacts','ids','internal','Setting','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','QueryTypes','SELECT','length','from','voicemail','mailbox','fullname','email','permissions','101','102','103','113','110','104','105','106','107','108','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','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','telephone','isEmpty','compact','changePassword','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','online','loginInPause','interface','isValidChannel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','Queue:save','voice','format','voicePause','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','Queue:remove','addAvatar','file','filename','join','root','server/files/images/logos/default_profile.png','userpic','download','server/files/images/','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WHATSAPP','concat','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','includeAll','CmList','List','Tag','Tags','color','tag','Unknown\x20channel','model','keys','Queue','intersection','fields','order','sort','pick','options','nolimit','getVoiceQueuesRt','filters','getGroups','ChatGroup','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','phone','mobile','LOCAL/%s@from-sip/n','SIP/%s','intrf','user:%s','x-forwarded-for','socket','connection','remoteAddress','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','isMiddleware','resolve','pause','updateAttributes','DEFAULT\x20PAUSE','bulkCreate','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','getTeams','Team','addTeams','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','removeAgent','VoicePrefixId','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','omit','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','CmHopper','$and','$gt','$gte','$lte','$eq','$not','$between','$notBetween','$in','$notLike','$iLike','$notILike','$contains','$contained','$any','firstName','lastName','CmContact','Contact','VoiceQueue','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','apiKeyNonce','apiKeyIat','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','idle','unknown','teams','inbound','flatten','toString','lower','col','desc','asc','uniqBy','orderBy','getRealtimeAgents','offline','voiceStatus','unavailable','busy','charAt','slice','select','field','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','enabled','moment','util','squel','../../components/auth/service','../../components/contacts','../../components/parsers/qs','../../components/realtime/agents','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','handleError','../../mysqldb','socket.io-emitter','./user.socket','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','agent','emit','destroy','get','role','admin','Users','user','Agents','Telephones','filter','ignore','map','value','includes','find','name','UserProfileResource','stack','send','rawAttributes','fieldName','type','key','password','salt','previousPasswords','resetPasswordToken','resetPasswordExpires','md5secret','index','where','User','query','include','userSetting','UserSetting','attributes','push','findAll','rows','openTabs','true','chat','sms','dataValues','fax','catch','show','params','getOptions','merge','openchannel','whatsapp','mail','all'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8ee,0x133));var _0xed8e=function(_0x55dbd0,_0x341a80){_0x55dbd0=_0x55dbd0-0x0;var _0xda1a93=_0xd8ee[_0x55dbd0];return _0xda1a93;};'use strict';var moment=require(_0xed8e('0x0'));var util=require(_0xed8e('0x1'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0xed8e('0x2'));var Redis=require('ioredis');var authService=require(_0xed8e('0x3'));var contacts=require(_0xed8e('0x4'));var qs=require(_0xed8e('0x5'));var rta=require(_0xed8e('0x6'));var logger=require('../../config/logger')(_0xed8e('0x7'));var utils=require(_0xed8e('0x8'));var config=require(_0xed8e('0x9'));var licenseUtil=require(_0xed8e('0xa'));var APIBadRequestError=require(_0xed8e('0xb'))[_0xed8e('0xc')];var APINotFoundError=require(_0xed8e('0xb'))['APINotFoundError'];var APIHandleError=require(_0xed8e('0xb'))[_0xed8e('0xd')];var db=require(_0xed8e('0xe'))['db'];var socket=require(_0xed8e('0xf'))(new Redis(config['redis']));require(_0xed8e('0x10'))['register'](socket);config[_0xed8e('0x11')]=_[_0xed8e('0x12')](config[_0xed8e('0x11')],{'host':_0xed8e('0x13'),'port':0x18eb});var values;function respondWithStatusCode(_0x279c0e,_0x2b5a84){_0x2b5a84=_0x2b5a84||0xcc;return function(_0x2c2f0f){if(_0x2c2f0f){return _0x279c0e[_0xed8e('0x14')](_0x2b5a84);}return _0x279c0e[_0xed8e('0x15')](_0x2b5a84)[_0xed8e('0x16')]();};}function respondWithResult(_0x8f8589,_0x16f450){_0x16f450=_0x16f450||0xc8;return function(_0x1dc444){if(_0x1dc444){return _0x8f8589[_0xed8e('0x15')](_0x16f450)[_0xed8e('0x17')](_0x1dc444);}};}function respondWithFilteredResult(_0x5be0b1,_0x47bc86){return function(_0x40b8b4){if(_0x40b8b4){var _0x527e1a=typeof _0x47bc86[_0xed8e('0x18')]===_0xed8e('0x19')&&typeof _0x47bc86[_0xed8e('0x1a')]===_0xed8e('0x19');var _0x54af25=_0x40b8b4[_0xed8e('0x1b')];var _0x5bde02=_0x527e1a?0x0:_0x47bc86[_0xed8e('0x18')];var _0x314d7e=_0x527e1a?_0x40b8b4[_0xed8e('0x1b')]:_0x47bc86[_0xed8e('0x18')]+_0x47bc86[_0xed8e('0x1a')];var _0x39adc9;if(_0x314d7e>=_0x54af25){_0x314d7e=_0x54af25;_0x39adc9=0xc8;}else{_0x39adc9=0xce;}_0x5be0b1[_0xed8e('0x15')](_0x39adc9);return _0x5be0b1[_0xed8e('0x1c')](_0xed8e('0x1d'),_0x5bde02+'-'+_0x314d7e+'/'+_0x54af25)['json'](_0x40b8b4);}return null;};}function saveUpdates(_0x3789a7){return function(_0x3b8ec2){if(_0x3b8ec2){return _0x3b8ec2[_0xed8e('0x1e')](_0x3789a7)[_0xed8e('0x1f')](function(_0x39ef91){if(_0x39ef91['role']===_0xed8e('0x20')){socket[_0xed8e('0x21')]('userNotification:recalc:'+_0x39ef91['id'],_0x39ef91);}return _0x39ef91;});}return null;};}function removeEntity(_0x2eb435){return function(_0x935337){if(_0x935337){return _0x935337[_0xed8e('0x22')]()['then'](function(){var _0x48a233=_0x935337[_0xed8e('0x23')]({'plain':!![]});if(_0x48a233[_0xed8e('0x24')]===_0xed8e('0x25'))return;var _0x3dd0eb=[{'name':_0xed8e('0x26'),'value':_0xed8e('0x27'),'ignore':!![]},{'name':_0xed8e('0x28'),'value':'agent','ignore':![]},{'name':_0xed8e('0x29'),'value':'telephone','ignore':![]}];var _0x212d5f=_(_0x3dd0eb)[_0xed8e('0x2a')](_0xed8e('0x2b'))[_0xed8e('0x2c')](_0xed8e('0x2d'))['value']();if(_[_0xed8e('0x2e')](_0x212d5f,_0x48a233[_0xed8e('0x24')])){return;}var _0x2824c=_[_0xed8e('0x2f')](_0x3dd0eb,[_0xed8e('0x2d'),_0x48a233[_0xed8e('0x24')]])[_0xed8e('0x30')];return db[_0xed8e('0x31')][_0xed8e('0x22')]({'where':{'type':_0x2824c,'resourceId':_0x48a233['id']}})[_0xed8e('0x1f')](function(){return _0x935337;});})[_0xed8e('0x1f')](function(){_0x2eb435[_0xed8e('0x15')](0xcc)[_0xed8e('0x16')]();});}};}function handleEntityNotFound(_0x4a5101){return function(_0x43ac4e){if(!_0x43ac4e){_0x4a5101[_0xed8e('0x14')](0x194);}return _0x43ac4e;};}function handleError(_0x2131f9,_0x5c08df){_0x5c08df=_0x5c08df||0x1f4;return function(_0x20e741){logger['error'](_0x20e741[_0xed8e('0x32')]);if(_0x20e741[_0xed8e('0x30')]){delete _0x20e741[_0xed8e('0x30')];}_0x2131f9['status'](_0x5c08df)[_0xed8e('0x33')](_0x20e741);};}function getUserAttributes(){return _(db['User'][_0xed8e('0x34')])['map'](function(_0x3f5b46){return{'name':_0x3f5b46[_0xed8e('0x35')],'type':_0x3f5b46[_0xed8e('0x36')][_0xed8e('0x37')]};})[_0xed8e('0x2a')](function(_0x3f1f5b){return![_0xed8e('0x38'),_0xed8e('0x39'),_0xed8e('0x3a'),_0xed8e('0x3b'),_0xed8e('0x3c'),_0xed8e('0x3d')][_0xed8e('0x2e')](_0x3f1f5b[_0xed8e('0x30')]);})[_0xed8e('0x2d')]();}exports[_0xed8e('0x3e')]=function(_0x2c443f,_0x4c01f0){var _0x7baf14={},_0x47a91f={'count':0x0,'rows':[]};var _0x4685d9=getUserAttributes();_0x7baf14=qs['getOptions'](_0x4685d9,_0x2c443f);var _0x4fb5ba={'where':_0x7baf14[_0xed8e('0x3f')]};return db[_0xed8e('0x40')][_0xed8e('0x1b')](_0x4fb5ba)['then'](function(_0x58fe2d){_0x47a91f['count']=_0x58fe2d;if(_0x2c443f[_0xed8e('0x41')]['includeAll']){_0x7baf14[_0xed8e('0x42')]=[{'all':!![]}];}if(_0x2c443f[_0xed8e('0x41')][_0xed8e('0x43')]==='true'){_0x7baf14['include']=[{'model':db[_0xed8e('0x44')],'as':'userSetting'}];}if(!_[_0xed8e('0x2e')](_0x7baf14['attributes'],'id')){_0x7baf14[_0xed8e('0x45')][_0xed8e('0x46')]('id');}return db['User'][_0xed8e('0x47')](_0x7baf14);})[_0xed8e('0x1f')](function(_0x30de4e){_0x47a91f[_0xed8e('0x48')]=_0x30de4e;if(_0x2c443f['query'][_0xed8e('0x49')]===_0xed8e('0x4a')){var _0x4a0a5b=[];for(var _0x3bedc9=0x0;_0x3bedc9<_0x47a91f[_0xed8e('0x48')]['length'];_0x3bedc9++){_0x4a0a5b[_0xed8e('0x46')](get_open_tabs(_0xed8e('0x4b'),_0x47a91f[_0xed8e('0x48')][_0x3bedc9]['dataValues']));_0x4a0a5b[_0xed8e('0x46')](get_open_tabs(_0xed8e('0x4c'),_0x47a91f[_0xed8e('0x48')][_0x3bedc9][_0xed8e('0x4d')]));_0x4a0a5b[_0xed8e('0x46')](get_open_tabs(_0xed8e('0x4e'),_0x47a91f[_0xed8e('0x48')][_0x3bedc9][_0xed8e('0x4d')]));_0x4a0a5b['push'](get_open_tabs('mail',_0x47a91f[_0xed8e('0x48')][_0x3bedc9][_0xed8e('0x4d')]));_0x4a0a5b[_0xed8e('0x46')](get_open_tabs('openchannel',_0x47a91f['rows'][_0x3bedc9]['dataValues']));_0x4a0a5b[_0xed8e('0x46')](get_open_tabs('whatsapp',_0x47a91f[_0xed8e('0x48')][_0x3bedc9]['dataValues']));}return Promise['all'](_0x4a0a5b)[_0xed8e('0x1f')](function(){return _0x47a91f;});}else{return _0x47a91f;}})[_0xed8e('0x1f')](respondWithFilteredResult(_0x4c01f0,_0x7baf14))[_0xed8e('0x4f')](handleError(_0x4c01f0,null));};exports[_0xed8e('0x50')]=function(_0x6ba67e,_0x9d1c21){var _0x2f7c6c=getUserAttributes();_0x6ba67e[_0xed8e('0x41')]['id']=_0x6ba67e[_0xed8e('0x51')]['id'];var _0x150846=qs[_0xed8e('0x52')](_0x2f7c6c,_0x6ba67e);if(_0x6ba67e[_0xed8e('0x41')]['includeAll']){_0x150846[_0xed8e('0x42')]=[{'all':!![]}];}if(_0x6ba67e[_0xed8e('0x41')][_0xed8e('0x43')]===_0xed8e('0x4a')){_0x150846['include']=[{'model':db['UserSetting'],'as':'userSetting'}];}_0x150846=_[_0xed8e('0x53')]({},_0x150846,_0x6ba67e['options']);if(!_['includes'](_0x150846[_0xed8e('0x45')],'id')){_0x150846[_0xed8e('0x45')][_0xed8e('0x46')]('id');}return db['User'][_0xed8e('0x2f')](_0x150846)[_0xed8e('0x1f')](handleEntityNotFound(_0x9d1c21,null))[_0xed8e('0x1f')](function(_0x5c0dbe){var _0x171fa8=[];values=_0x5c0dbe;if(_0x6ba67e[_0xed8e('0x41')]['openTabs']==='true'){_0x171fa8['push'](get_open_tabs(_0xed8e('0x4b'),_0x5c0dbe['dataValues']));_0x171fa8[_0xed8e('0x46')](get_open_tabs(_0xed8e('0x4c'),_0x5c0dbe[_0xed8e('0x4d')]));_0x171fa8[_0xed8e('0x46')](get_open_tabs(_0xed8e('0x54'),_0x5c0dbe[_0xed8e('0x4d')]));_0x171fa8['push'](get_open_tabs(_0xed8e('0x55'),_0x5c0dbe['dataValues']));_0x171fa8[_0xed8e('0x46')](get_open_tabs('fax',_0x5c0dbe[_0xed8e('0x4d')]));_0x171fa8['push'](get_open_tabs(_0xed8e('0x56'),_0x5c0dbe[_0xed8e('0x4d')]));return Promise[_0xed8e('0x57')](_0x171fa8);}else{return values;}})[_0xed8e('0x1f')](function(){return values;})['then'](respondWithResult(_0x9d1c21,null))[_0xed8e('0x4f')](handleError(_0x9d1c21,null));};exports[_0xed8e('0x1e')]=function(_0x315834,_0x3d107f){if(_0x315834[_0xed8e('0x58')]['id']){delete _0x315834[_0xed8e('0x58')]['id'];}delete _0x315834[_0xed8e('0x58')][_0xed8e('0x24')];return db[_0xed8e('0x40')][_0xed8e('0x2f')]({'where':{'id':_0x315834['params']['id']}})[_0xed8e('0x1f')](handleEntityNotFound(_0x3d107f,null))[_0xed8e('0x1f')](saveUpdates(_0x315834[_0xed8e('0x58')],null))[_0xed8e('0x1f')](respondWithResult(_0x3d107f,null))['catch'](handleError(_0x3d107f,null));};exports[_0xed8e('0x59')]=function(_0x2a2eca,_0x16393b){return db[_0xed8e('0x40')][_0xed8e('0x59')]()[_0xed8e('0x1f')](respondWithResult(_0x16393b,null))['catch'](handleError(_0x16393b,null));};exports['addContacts']=function(_0x3a9c16,_0x1a9c0c){return db[_0xed8e('0x40')][_0xed8e('0x2f')]({'where':{'id':_0x3a9c16[_0xed8e('0x51')]['id']}})[_0xed8e('0x1f')](handleEntityNotFound(_0x1a9c0c,null))[_0xed8e('0x1f')](function(_0x38e405){if(_0x38e405){return _0x38e405[_0xed8e('0x5a')](_0x3a9c16[_0xed8e('0x58')][_0xed8e('0x5b')],_['omit'](_0x3a9c16[_0xed8e('0x58')],[_0xed8e('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x1a9c0c,null))[_0xed8e('0x4f')](handleError(_0x1a9c0c,null));};function validateUser(_0x4360d9){return new Promise(function(_0x2dfdc6,_0xa3323b){if(_0x4360d9[_0xed8e('0x5c')])return _0x2dfdc6(_0x4360d9);return db[_0xed8e('0x5d')][_0xed8e('0x5e')](0x1)['then'](function(_0x165dd8){if(_0x165dd8[_0xed8e('0x5f')])authService[_0xed8e('0x60')](_0x4360d9[_0xed8e('0x38')]);db[_0xed8e('0x40')][_0xed8e('0x61')]('internal')[_0xed8e('0x1f')](function(_0xce0df4){if(_[_0xed8e('0x62')](_0xce0df4)){_0x4360d9[_0xed8e('0x5c')]=_0x165dd8[_0xed8e('0x63')]||0x1;return;}if(_['isNil'](_0x165dd8['min_internal'])||_0x165dd8[_0xed8e('0x63')]===_0xce0df4){_0x4360d9[_0xed8e('0x5c')]=_0xce0df4+0x1;return;}if(_0x165dd8['min_internal']>_0xce0df4){_0x4360d9[_0xed8e('0x5c')]=_0x165dd8[_0xed8e('0x63')];return;}return db[_0xed8e('0x64')][_0xed8e('0x41')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xed8e('0x64')][_0xed8e('0x65')][_0xed8e('0x66')]})[_0xed8e('0x1f')](function(_0x2d9f35){if(_0x2d9f35&&_0x2d9f35[_0xed8e('0x67')]){for(var _0x1cb58e=0x0,_0x1ecd03=_0x2d9f35[_0xed8e('0x67')];_0x1cb58e<_0x1ecd03&&_['isNil'](_0x4360d9[_0xed8e('0x5c')]);_0x1cb58e++){if(_0x165dd8[_0xed8e('0x63')]<=_0x2d9f35[_0x1cb58e][_0xed8e('0x68')]){_0x4360d9[_0xed8e('0x5c')]=_0x2d9f35[_0x1cb58e][_0xed8e('0x68')];}else if(_0x165dd8[_0xed8e('0x63')]>_0x2d9f35[_0x1cb58e]['from']&&_0x165dd8[_0xed8e('0x63')]<=_0x2d9f35[_0x1cb58e]['to']){_0x4360d9['internal']=_0x165dd8[_0xed8e('0x63')];}}}if(_[_0xed8e('0x62')](_0x4360d9[_0xed8e('0x5c')])){_0x4360d9['internal']=_0xce0df4+0x1;}return _0x2dfdc6(_0x4360d9);});});})[_0xed8e('0x4f')](function(_0x5edee6){_0xa3323b(_0x5edee6);});});}function updateUser(_0xe36925){return new Promise(function(_0x2b558d,_0x54c526){try{if(_0xe36925[_0xed8e('0x69')]){_0xe36925[_0xed8e('0x6a')]=_0xe36925[_0xed8e('0x5c')];_0xe36925['VoiceMail']={'mailbox':_0xe36925[_0xed8e('0x5c')],'password':_0xe36925[_0xed8e('0x38')],'fullname':_0xe36925[_0xed8e('0x6b')],'email':_0xe36925[_0xed8e('0x6c')]};}if(_0xe36925[_0xed8e('0x24')]==='agent'){if(!_0xe36925['permissions'])_0xe36925[_0xed8e('0x6d')]=[_0xed8e('0x6e'),_0xed8e('0x6f'),_0xed8e('0x70'),_0xed8e('0x71'),_0xed8e('0x72'),_0xed8e('0x73'),_0xed8e('0x74'),_0xed8e('0x75'),_0xed8e('0x76'),_0xed8e('0x77'),'109','100',_0xed8e('0x78'),_0xed8e('0x79'),_0xed8e('0x7a')];}_0x2b558d(_0xe36925);}catch(_0x1803d2){_0x54c526(_0x1803d2);}});}exports[_0xed8e('0x7b')]=function(_0x561151,_0x21b832){if(_0x561151[_0xed8e('0x27')]['role']==='agent')throw new Error('Unauthorized');if(_0x561151[_0xed8e('0x58')][_0xed8e('0x24')]===_0xed8e('0x27')&&_0x561151[_0xed8e('0x27')]['role']!=='admin'){throw new Error(_0xed8e('0x7c'));}if(_0x561151[_0xed8e('0x58')][_0xed8e('0x24')]==='admin'&&_0x561151[_0xed8e('0x27')][_0xed8e('0x24')]!==_0xed8e('0x25')){throw new Error(_0xed8e('0x7d'));}return licenseUtil[_0xed8e('0x7e')]([_0x561151['body']])['then'](function(){return validateUser(_0x561151[_0xed8e('0x58')]);})[_0xed8e('0x1f')](function(_0x2ed9ab){return updateUser(_0x2ed9ab)[_0xed8e('0x1f')](function(_0x4d2591){if(_0x4d2591[_0xed8e('0x24')]===_0xed8e('0x25')){_0x4d2591[_0xed8e('0x7f')]=_0x561151[_0xed8e('0x27')][_0xed8e('0x7f')];delete _0x4d2591[_0xed8e('0x80')];}return _0x4d2591;});})[_0xed8e('0x1f')](function(_0x459992){return db[_0xed8e('0x40')][_0xed8e('0x7b')](_0x459992,{'include':[{'model':db['VoiceMail'],'as':_0xed8e('0x81')}]});})['then'](function(_0x4eaf2f){if(_0x561151[_0xed8e('0x58')]['role']===_0xed8e('0x27'))return _0x4eaf2f;if(_0x561151[_0xed8e('0x27')]['role']!=='user')return _0x4eaf2f;return db[_0xed8e('0x82')][_0xed8e('0x2f')]({'where':{'name':_0x4eaf2f[_0xed8e('0x24')]===_0xed8e('0x20')?'Agents':_0xed8e('0x29'),'userProfileId':_0x561151['user'][_0xed8e('0x80')]},'raw':!![]})[_0xed8e('0x1f')](function(_0x1ec2c2){if(!_0x1ec2c2||_0x1ec2c2[_0xed8e('0x83')]!=0x0)return _0x4eaf2f;return db[_0xed8e('0x31')][_0xed8e('0x7b')]({'name':_0x4eaf2f[_0xed8e('0x30')],'resourceId':_0x4eaf2f['id'],'type':_0x1ec2c2[_0xed8e('0x30')],'sectionId':_0x1ec2c2['id']},{})[_0xed8e('0x1f')](function(){return _0x4eaf2f;});})[_0xed8e('0x4f')](function(_0x2fc93d){logger[_0xed8e('0x84')](_0xed8e('0x85'),_0x2fc93d);throw _0x2fc93d;});})[_0xed8e('0x1f')](respondWithResult(_0x21b832,0xc9))[_0xed8e('0x4f')](handleError(_0x21b832,null));};exports['bulkCreate']=function(_0x433076,_0x480bf9){var _0x342a2b=_0x433076[_0xed8e('0x58')];var _0x43eaab=[];if(_0x433076[_0xed8e('0x27')][_0xed8e('0x24')]==='agent')throw new Error(_0xed8e('0x86'));if(_[_0xed8e('0x87')](_0x342a2b,['role','user'])&&_0x433076[_0xed8e('0x27')][_0xed8e('0x24')]!==_0xed8e('0x25')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xed8e('0x87')](_0x342a2b,[_0xed8e('0x24'),_0xed8e('0x25')])&&_0x433076[_0xed8e('0x27')][_0xed8e('0x24')]!==_0xed8e('0x25')){throw new Error(_0xed8e('0x88'));}return licenseUtil[_0xed8e('0x7e')](_0x342a2b)[_0xed8e('0x1f')](function(){return validateUser(_0x342a2b[0x0]);})[_0xed8e('0x1f')](function(){for(var _0x1a7a35=0x1;_0x1a7a35<_0x342a2b['length'];_0x1a7a35++){var _0x689de1=_0x342a2b[_0x1a7a35-0x1][_0xed8e('0x5c')];if(!_0x342a2b[_0x1a7a35][_0xed8e('0x5c')])_0x342a2b[_0x1a7a35][_0xed8e('0x5c')]=_0x689de1+0x1;_0x43eaab['push'](validateUser(_0x342a2b[_0x1a7a35]));}return Promise[_0xed8e('0x57')](_0x43eaab);})['then'](function(){_0x43eaab=[];for(var _0x249bac=0x0;_0x249bac<_0x342a2b[_0xed8e('0x67')];_0x249bac++){_0x43eaab[_0xed8e('0x46')](updateUser(_0x342a2b[_0x249bac]));}return Promise[_0xed8e('0x57')](_0x43eaab);})[_0xed8e('0x1f')](function(){_0x43eaab=_0x342a2b[_0xed8e('0x2c')](function(_0x5ddbd0){return db['User']['create'](_0x5ddbd0,{'include':[{'model':db[_0xed8e('0x81')],'as':'VoiceMail'}]})[_0xed8e('0x1f')](function(_0x5aed98){_0x5ddbd0['id']=_0x5aed98['id'];return _0x5ddbd0;});});return Promise['all'](_0x43eaab);})['then'](function(_0x531ea1){if(_0x433076[_0xed8e('0x58')][_0xed8e('0x24')]==='user')return _0x531ea1;if(_0x433076['user'][_0xed8e('0x24')]!=='user')return _0x531ea1;var _0x900048=_[_0xed8e('0x87')](_0x531ea1,function(_0x43c2af){return _0x43c2af[_0xed8e('0x24')]===_0xed8e('0x20')||_0x43c2af['role']===_0xed8e('0x89');});if(!_0x900048)return _0x531ea1;return db['UserProfileSection'][_0xed8e('0x47')]({'where':{'name':{'$or':['Agents',_0xed8e('0x29')]},'userProfileId':_0x433076[_0xed8e('0x27')]['userProfileId']},'raw':!![]})['then'](function(_0x748ad2){if(_[_0xed8e('0x8a')](_0x748ad2)||!_[_0xed8e('0x87')](_0x748ad2,[_0xed8e('0x83'),0x0]))return _0x531ea1;_0x43eaab=[];var _0x1e0eb8=_(_0x748ad2)[_0xed8e('0x2c')](function(_0x5c24ca){if(_0x5c24ca[_0xed8e('0x83')]===0x1)return;return _0x5c24ca[_0xed8e('0x30')]==='Agents'?_0xed8e('0x20'):_0xed8e('0x89');})[_0xed8e('0x8b')]()[_0xed8e('0x2d')]();for(var _0x29d37b=0x0;_0x29d37b<_0x531ea1[_0xed8e('0x67')];_0x29d37b++){if(!_[_0xed8e('0x2e')](_0x1e0eb8,_0x531ea1[_0x29d37b][_0xed8e('0x24')]))return;var _0x413212=_0x531ea1[_0x29d37b][_0xed8e('0x24')]===_0xed8e('0x20')?_0xed8e('0x28'):_0xed8e('0x29');_0x43eaab[_0xed8e('0x46')](db[_0xed8e('0x31')][_0xed8e('0x7b')]({'name':_0x531ea1[_0x29d37b][_0xed8e('0x30')],'resourceId':_0x531ea1[_0x29d37b]['id'],'type':_0x413212,'sectionId':_[_0xed8e('0x2f')](_0x748ad2,[_0xed8e('0x30'),_0x413212])['id']},{}));}return Promise['all'](_0x43eaab);});})[_0xed8e('0x1f')](respondWithResult(_0x480bf9,0xc9))['catch'](handleError(_0x480bf9,null));};exports[_0xed8e('0x8c')]=function(_0x59be80,_0x31e248){if(_0x59be80[_0xed8e('0x58')]['id']){delete _0x59be80[_0xed8e('0x58')]['id'];}return db['User'][_0xed8e('0x2f')]({'where':{'id':_0x59be80[_0xed8e('0x51')]['id']}})[_0xed8e('0x1f')](function(_0x32b7d3){if(!_0x32b7d3)return null;if(_0x32b7d3['id']===_0x59be80[_0xed8e('0x27')]['id']){if(!_0x59be80[_0xed8e('0x58')][_0xed8e('0x8d')]||!_0x59be80[_0xed8e('0x58')][_0xed8e('0x8e')]){throw new db['Sequelize'][(_0xed8e('0x8f'))](_0xed8e('0x90'));}if(!_0x32b7d3[_0xed8e('0x91')](_0x59be80[_0xed8e('0x58')][_0xed8e('0x8d')])){throw new db['Sequelize'][(_0xed8e('0x8f'))]('Wrong\x20credentials');}if(_0x59be80[_0xed8e('0x58')]['oldPassword']===_0x59be80[_0xed8e('0x58')][_0xed8e('0x8e')]){throw new db[(_0xed8e('0x92'))][(_0xed8e('0x8f'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x59be80[_0xed8e('0x27')][_0xed8e('0x24')]===_0xed8e('0x25')){if(!_0x59be80[_0xed8e('0x58')][_0xed8e('0x8e')]){throw new db[(_0xed8e('0x92'))][(_0xed8e('0x8f'))](_0xed8e('0x93'));}}else if(_0x59be80['user'][_0xed8e('0x24')]===_0xed8e('0x27')){if(!_0x59be80[_0xed8e('0x58')]['newPassword']){throw new db['Sequelize'][(_0xed8e('0x8f'))](_0xed8e('0x93'));}if(_0x32b7d3[_0xed8e('0x24')]!==_0xed8e('0x20')){throw new db[(_0xed8e('0x92'))][(_0xed8e('0x8f'))](_0xed8e('0x86'));}}else{throw new db[(_0xed8e('0x92'))][(_0xed8e('0x8f'))](_0xed8e('0x86'));}return _0x32b7d3;})[_0xed8e('0x1f')](handleEntityNotFound(_0x31e248,null))['then'](function(_0x5edae2){return db[_0xed8e('0x5d')][_0xed8e('0x94')]({'attributes':['id',_0xed8e('0x5f'),_0xed8e('0x95'),_0xed8e('0x96')]})[_0xed8e('0x1f')](function(_0x2ad5e3){if(_0x2ad5e3['securePassword'])authService[_0xed8e('0x60')](_0x59be80[_0xed8e('0x58')][_0xed8e('0x8e')]);if(!_0x2ad5e3[_0xed8e('0x95')]||!_0x5edae2[_0xed8e('0x3a')])return _0x5edae2;authService['validatePasswordHistory'](_0x59be80['body'][_0xed8e('0x8e')],_0x5edae2['previousPasswords'],_0x2ad5e3[_0xed8e('0x96')]);return _0x5edae2;})['then'](saveUpdates({'password':_0x59be80[_0xed8e('0x58')][_0xed8e('0x8e')],'passwordResetAt':_0x59be80[_0xed8e('0x27')]['id']==_0x59be80[_0xed8e('0x51')]['id']?moment():null,'previousPasswords':authService[_0xed8e('0x97')](_0x59be80[_0xed8e('0x58')][_0xed8e('0x8e')],_0x5edae2['previousPasswords'])},null));})[_0xed8e('0x1f')](respondWithResult(_0x31e248,null))[_0xed8e('0x4f')](handleError(_0x31e248,null));};exports[_0xed8e('0x98')]=function(_0x30109d,_0x5079ca){var _0x2dd800=_0x30109d[_0xed8e('0x58')][_0xed8e('0x99')];return db[_0xed8e('0x40')][_0xed8e('0x2f')]({'where':{'id':_0x30109d[_0xed8e('0x51')]['id']},'attributes':['id','name',_0xed8e('0x24'),_0xed8e('0x9a'),_0xed8e('0x9b'),'voicePause',_0xed8e('0x9c')]})[_0xed8e('0x1f')](handleEntityNotFound(_0x5079ca,null))[_0xed8e('0x1f')](function(_0x371590){if(_0x371590){if(!utils[_0xed8e('0x9d')](_0x2dd800)){throw new db[(_0xed8e('0x92'))][(_0xed8e('0x8f'))]('Unknown\x20channel');}return _0x371590[_0xed8e('0x9e')+_[_0xed8e('0x9f')](_0x2dd800[_0xed8e('0xa0')]())+_0xed8e('0xa1')](_0x30109d[_0xed8e('0x58')][_0xed8e('0x5b')],{'penalty':_0x30109d[_0xed8e('0x58')][_0xed8e('0xa2')]||0x0})[_0xed8e('0xa3')](function(_0x108262){for(var _0x376c96=0x0;_0x376c96<_0x30109d[_0xed8e('0x58')][_0xed8e('0x5b')][_0xed8e('0x67')];_0x376c96+=0x1){var _0x50e512={'UserId':Number(_0x30109d[_0xed8e('0x51')]['id'])};_0x50e512[_[_0xed8e('0x9f')](_0x2dd800[_0xed8e('0xa0')]())+_0xed8e('0xa4')]=Number(_0x30109d[_0xed8e('0x58')]['ids'][_0x376c96]);socket[_0xed8e('0x21')](_0xed8e('0x27')+_[_0xed8e('0x9f')](_0x2dd800[_0xed8e('0xa0')]())+_0xed8e('0xa5'),_0x50e512);}return _0x108262;})[_0xed8e('0x1f')](function(){if(_0x2dd800===_0xed8e('0xa6')){return db['VoiceQueue'][_0xed8e('0x47')]({'where':{'id':_0x30109d['body'][_0xed8e('0x5b')]||[]},'raw':!![],'attributes':['id',_0xed8e('0x30')]});}})[_0xed8e('0x1f')](function(_0xce38d8){var _0x317c12=_0x371590[_0xed8e('0x23')]({'plain':!![]});var _0x4726cf=[];if(_0x2dd800===_0xed8e('0xa6')&&_0x317c12[_0xed8e('0x24')]===_0xed8e('0x20')&&_0x317c12['online']){for(let _0x315a58=0x0;_0x315a58<_0xce38d8[_0xed8e('0x67')];_0x315a58+=0x1){_0x4726cf['push']({'membername':_0x317c12[_0xed8e('0x30')],'UserId':_0x317c12['id'],'queue_name':_0xce38d8[_0x315a58][_0xed8e('0x30')],'VoiceQueueId':_0xce38d8[_0x315a58]['id'],'interface':_[_0xed8e('0x62')](_0x317c12['interface'])?util[_0xed8e('0xa7')]('SIP/%s',_0x317c12[_0xed8e('0x30')]):_0x317c12[_0xed8e('0x9c')],'paused':_0x317c12[_0xed8e('0xa8')]||![],'penalty':_0x30109d['body'][_0xed8e('0xa2')]||0x0});}return Promise['all'](_0x4726cf['map'](function(_0x51479d){return db[_0xed8e('0xa9')][_0xed8e('0xaa')](_0x51479d);}));}return _0x371590;});}})[_0xed8e('0x1f')](respondWithStatusCode(_0x5079ca,null))[_0xed8e('0x4f')](handleError(_0x5079ca,null));};exports[_0xed8e('0xab')]=function(_0x2cdab8,_0x28e69a){var _0x41d55a,_0x3bbba6;return db[_0xed8e('0x40')][_0xed8e('0x2f')]({'where':{'id':_0x2cdab8[_0xed8e('0x51')]['id']},'attributes':['id','name',_0xed8e('0x24')]})[_0xed8e('0x1f')](handleEntityNotFound(_0x28e69a,null))[_0xed8e('0x1f')](function(_0x2c1670){if(_0x2c1670){_0x41d55a=_0x2c1670;if(!_0x2cdab8[_0xed8e('0x41')]['channel']||!utils[_0xed8e('0x9d')](_0x2cdab8['query']['channel'])){throw new db[(_0xed8e('0x92'))][(_0xed8e('0x8f'))]('Unknown\x20channel');}return _0x2c1670[_0xed8e('0xac')+_[_0xed8e('0x9f')](_0x2cdab8[_0xed8e('0x41')]['channel'][_0xed8e('0xa0')]())+_0xed8e('0xa1')](_0x2cdab8[_0xed8e('0x41')][_0xed8e('0x5b')]);}})[_0xed8e('0x1f')](function(_0x531528){if(_[_0xed8e('0xad')](_0x2cdab8[_0xed8e('0x41')][_0xed8e('0x5b')])){for(var _0x8bef0d=0x0;_0x8bef0d<_0x2cdab8[_0xed8e('0x41')]['ids']['length'];_0x8bef0d+=0x1){_0x3bbba6={'UserId':Number(_0x2cdab8['params']['id'])};_0x3bbba6[_[_0xed8e('0x9f')](_0x2cdab8[_0xed8e('0x41')][_0xed8e('0x99')][_0xed8e('0xa0')]())+_0xed8e('0xa4')]=Number(_0x2cdab8[_0xed8e('0x41')][_0xed8e('0x5b')][_0x8bef0d]);socket[_0xed8e('0x21')](_0xed8e('0x27')+_[_0xed8e('0x9f')](_0x2cdab8['query'][_0xed8e('0x99')][_0xed8e('0xa0')]())+_0xed8e('0xae'),_0x3bbba6);}}else{_0x3bbba6={'UserId':Number(_0x2cdab8[_0xed8e('0x51')]['id'])};_0x3bbba6[_[_0xed8e('0x9f')](_0x2cdab8[_0xed8e('0x41')][_0xed8e('0x99')][_0xed8e('0xa0')]())+_0xed8e('0xa4')]=Number(_0x2cdab8['query'][_0xed8e('0x5b')]);socket[_0xed8e('0x21')]('user'+_['capitalize'](_0x2cdab8[_0xed8e('0x41')][_0xed8e('0x99')][_0xed8e('0xa0')]())+_0xed8e('0xae'),_0x3bbba6);}return _0x531528;})[_0xed8e('0x1f')](function(){if(_0x2cdab8[_0xed8e('0x41')][_0xed8e('0x99')]==='voice'){return db[_0xed8e('0xa9')][_0xed8e('0x22')]({'where':{'UserId':_0x2cdab8['params']['id'],'VoiceQueueId':_0x2cdab8['query'][_0xed8e('0x5b')]},'individualHooks':!![]})['then'](function(){return _0x41d55a;});}return _0x41d55a;})['then'](respondWithStatusCode(_0x28e69a,null))[_0xed8e('0x4f')](handleError(_0x28e69a,null));};exports[_0xed8e('0xaf')]=function(_0xf73b22,_0x567b0c){_0xf73b22['body']['userpic']=_0xf73b22[_0xed8e('0xb0')][_0xed8e('0xb1')];return db[_0xed8e('0x40')]['find']({'where':{'id':_0xf73b22[_0xed8e('0x51')]['id']}})[_0xed8e('0x1f')](handleEntityNotFound(_0x567b0c,null))[_0xed8e('0x1f')](saveUpdates(_0xf73b22[_0xed8e('0x58')],null))[_0xed8e('0x1f')](respondWithResult(_0x567b0c,null))['catch'](handleError(_0x567b0c,null));};exports['getAvatar']=function(_0x15cf16,_0x5b4237){var _0x2054d5=path[_0xed8e('0xb2')](config[_0xed8e('0xb3')],_0xed8e('0xb4'));return db[_0xed8e('0x40')][_0xed8e('0x2f')]({'where':{'id':_0x15cf16[_0xed8e('0x51')]['id']},'attributes':['id',_0xed8e('0xb5')],'raw':!![]})['then'](handleEntityNotFound(_0x5b4237,null))[_0xed8e('0x1f')](function(_0x4b1ef8){if(_0x4b1ef8){if(_[_0xed8e('0x62')](_0x4b1ef8[_0xed8e('0xb5')])){return _0x5b4237[_0xed8e('0xb6')](_0x2054d5);}else{if(!fs['existsSync'](path[_0xed8e('0xb2')](config['root'],_0xed8e('0xb7'),_0x4b1ef8[_0xed8e('0xb5')]))){return _0x5b4237[_0xed8e('0xb6')](_0x2054d5);}return _0x5b4237['download'](path[_0xed8e('0xb2')](config[_0xed8e('0xb3')],'server/files/images/',_0x4b1ef8['userpic']));}}})['catch'](handleError(_0x5b4237,null));};exports['getOpenTabs']=function(_0xe7e3bd,_0x271628){return db[_0xed8e('0x40')]['find']({'where':{'id':_0xe7e3bd[_0xed8e('0x51')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x271628,null))[_0xed8e('0x1f')](function(_0x5587e1){var _0x3cabd9=[];values=_0x5587e1['dataValues'];_0x3cabd9[_0xed8e('0x46')](get_open_tabs(_0xed8e('0x4b'),_0x5587e1['dataValues']));_0x3cabd9['push'](get_open_tabs('sms',_0x5587e1[_0xed8e('0x4d')]));_0x3cabd9['push'](get_open_tabs(_0xed8e('0x54'),_0x5587e1['dataValues']));_0x3cabd9[_0xed8e('0x46')](get_open_tabs(_0xed8e('0x55'),_0x5587e1[_0xed8e('0x4d')]));_0x3cabd9['push'](get_open_tabs('fax',_0x5587e1[_0xed8e('0x4d')]));_0x3cabd9[_0xed8e('0x46')](get_open_tabs(_0xed8e('0x56'),_0x5587e1['dataValues']));return Promise[_0xed8e('0x57')](_0x3cabd9);})['then'](function(_0x4fd9e5){if(_0x4fd9e5){var _0x1f0cb7=_[_0xed8e('0x2c')](values[_0xed8e('0xb8')],function(_0x435a25){return{'channel':'CHAT','id':_0x435a25['id'],'createdAt':_0x435a25[_0xed8e('0xb9')]};});var _0x33d978=_['map'](values[_0xed8e('0xba')],function(_0x9113a){return{'channel':_0xed8e('0xbb'),'id':_0x9113a['id'],'createdAt':_0x9113a[_0xed8e('0xb9')]};});var _0x58bd1f=_[_0xed8e('0x2c')](values[_0xed8e('0xbc')],function(_0xecf3df){return{'channel':_0xed8e('0xbd'),'id':_0xecf3df['id'],'createdAt':_0xecf3df[_0xed8e('0xb9')]};});var _0x23c43e=_[_0xed8e('0x2c')](values[_0xed8e('0xbe')],function(_0x446d25){return{'channel':_0xed8e('0xbf'),'id':_0x446d25['id'],'createdAt':_0x446d25[_0xed8e('0xb9')]};});var _0x47a644=_[_0xed8e('0x2c')](values[_0xed8e('0xc0')],function(_0x49b840){return{'channel':_0xed8e('0xc1'),'id':_0x49b840['id'],'createdAt':_0x49b840[_0xed8e('0xb9')]};});var _0xa893cc=_['map'](values['WhatsappOpenTabs'],function(_0x50eda3){return{'channel':_0xed8e('0xc2'),'id':_0x50eda3['id'],'createdAt':_0x50eda3[_0xed8e('0xb9')]};});var _0x4e8f13=_[_0xed8e('0xc3')](_0x1f0cb7,_0x33d978,_0x58bd1f,_0x23c43e,_0x47a644,_0xa893cc);var _0xb2780a={'count':_0x4e8f13[_0xed8e('0x67')],'rows':_0x4e8f13};return _0xb2780a;}else return null;})['then'](respondWithResult(_0x271628,null))['catch'](handleError(_0x271628,null));};exports['getContacts']=function(_0x16388f,_0x4ba290){var _0x27727b={};return db[_0xed8e('0x40')][_0xed8e('0x94')]({'where':{'id':_0x16388f[_0xed8e('0x51')]['id']}})[_0xed8e('0x1f')](function(_0x373ee4){if(!_0x373ee4){throw new APINotFoundError(util[_0xed8e('0xa7')](_0xed8e('0xc4'),_0x16388f['params']['id']));}return contacts[_0xed8e('0x59')]();})[_0xed8e('0x1f')](function(_0x318e1a){_0x16388f[_0xed8e('0x41')][_0xed8e('0x40')]=_0x16388f[_0xed8e('0x51')]['id'];_0x27727b=qs[_0xed8e('0x52')](_0x318e1a,_0x16388f);if(_0x16388f['query'][_0xed8e('0xc5')](_0xed8e('0xc6'))){_0x27727b[_0xed8e('0x42')]=[{'model':db[_0xed8e('0xc7')],'as':_0xed8e('0xc8'),'required':![]},{'model':db[_0xed8e('0xc9')],'as':_0xed8e('0xca'),'attributes':['id',_0xed8e('0x30'),_0xed8e('0xcb')],'where':_0x16388f['query'][_0xed8e('0xcc')]?{'id':_0x16388f['query'][_0xed8e('0xcc')]}:undefined,'required':_0x16388f[_0xed8e('0x41')][_0xed8e('0xcc')]?!![]:![]}];}return contacts[_0xed8e('0x47')](_0x16388f[_0xed8e('0x41')],_0x16388f['user'],_0x27727b,_0x318e1a);})[_0xed8e('0x1f')](respondWithFilteredResult(_0x4ba290,_0x27727b))['catch'](APIHandleError(_0x4ba290));};exports['getQueues']=function(_0x4c3012,_0x52daeb){var _0x1ec77e;var _0x91d50d={};var _0x2eb4f5;return db['User'][_0xed8e('0x94')]({'where':{'id':_0x4c3012[_0xed8e('0x51')]['id']},'attributes':['id','name',_0xed8e('0x24')]})[_0xed8e('0x1f')](handleEntityNotFound(_0x52daeb,null))[_0xed8e('0x1f')](function(_0x4300f5){if(!utils[_0xed8e('0x9d')](_0x4c3012[_0xed8e('0x41')][_0xed8e('0x99')])){throw new db[(_0xed8e('0x92'))]['ValidationError'](_0xed8e('0xcd'));}_0x1ec77e=_0x4300f5;var _0x2f3b1c={};_0x2f3b1c[_0xed8e('0xce')]=_[_0xed8e('0xcf')](db[_[_0xed8e('0x9f')](_0x4c3012[_0xed8e('0x41')][_0xed8e('0x99')])+_0xed8e('0xd0')][_0xed8e('0x34')]);_0x2f3b1c['query']=_['keys'](_0x4c3012['query']);_0x2f3b1c['filters']=_['intersection'](_0x2f3b1c[_0xed8e('0xce')],_0x2f3b1c['query']);_0x91d50d['attributes']=_[_0xed8e('0xd1')](_0x2f3b1c[_0xed8e('0xce')],qs[_0xed8e('0xd2')](_0x4c3012[_0xed8e('0x41')][_0xed8e('0xd2')]));_0x91d50d['attributes']=_0x91d50d['attributes'][_0xed8e('0x67')]?_0x91d50d[_0xed8e('0x45')]:_0x2f3b1c['model'];_0x91d50d[_0xed8e('0xd3')]=qs[_0xed8e('0xd4')](_0x4c3012['query'][_0xed8e('0xd4')]);_0x91d50d['where']=qs['filters'](_[_0xed8e('0xd5')](_0x4c3012[_0xed8e('0x41')],_0x2f3b1c['filters']));if(_0x4c3012[_0xed8e('0x41')][_0xed8e('0x2a')]){_0x91d50d[_0xed8e('0x3f')]=_['merge'](_0x91d50d[_0xed8e('0x3f')],{'$or':_[_0xed8e('0x2c')](_0x91d50d[_0xed8e('0x45')],function(_0x4c11f9){var _0x2868db={};_0x2868db[_0x4c11f9]={'$like':'%'+_0x4c3012[_0xed8e('0x41')][_0xed8e('0x2a')]+'%'};return _0x2868db;})});}_0x91d50d=_['merge']({},_0x91d50d,_0x4c3012[_0xed8e('0xd6')]);switch(_0x1ec77e['role']){case _0xed8e('0x25'):return db[_[_0xed8e('0x9f')](_0x4c3012[_0xed8e('0x41')][_0xed8e('0x99')])+_0xed8e('0xd0')]['findAll'](_0x91d50d);case _0xed8e('0x27'):case _0xed8e('0x20'):return _0x1ec77e[_0xed8e('0x23')+_[_0xed8e('0x9f')](_0x4c3012['query']['channel'])+'Queues'](_0x91d50d);default:throw new db['Sequelize']['ValidationError']('Unknown\x20role');}})['then'](function(_0x4d4cc6){_0x2eb4f5=_0x4d4cc6[_0xed8e('0x67')];if(!_0x4c3012['query']['hasOwnProperty'](_0xed8e('0xd7'))){_0x91d50d[_0xed8e('0x1a')]=qs[_0xed8e('0x1a')](_0x4c3012[_0xed8e('0x41')][_0xed8e('0x1a')]);_0x91d50d[_0xed8e('0x18')]=qs['offset'](_0x4c3012[_0xed8e('0x41')][_0xed8e('0x18')]);}switch(_0x1ec77e[_0xed8e('0x24')]){case'admin':return db[_[_0xed8e('0x9f')](_0x4c3012[_0xed8e('0x41')]['channel'])+_0xed8e('0xd0')][_0xed8e('0x47')](_0x91d50d);case'user':case _0xed8e('0x20'):return _0x1ec77e[_0xed8e('0x23')+_[_0xed8e('0x9f')](_0x4c3012[_0xed8e('0x41')]['channel'])+'Queues'](_0x91d50d);}})['then'](function(_0x5dd320){return{'count':_0x2eb4f5,'rows':_0x5dd320};})['then'](respondWithResult(_0x52daeb,null))[_0xed8e('0x4f')](handleError(_0x52daeb,null));};exports[_0xed8e('0xd8')]=function(_0x3650e3,_0x5af4a1){var _0x3be4a0={};var _0x1cf6f8={};var _0x827ac0;var _0x2bc925;return db[_0xed8e('0x40')][_0xed8e('0x94')]({'where':{'id':_0x3650e3[_0xed8e('0x51')]['id']}})[_0xed8e('0x1f')](handleEntityNotFound(_0x5af4a1,null))[_0xed8e('0x1f')](function(_0x7f939a){if(_0x7f939a){_0x827ac0=_0x7f939a;_0x1cf6f8[_0xed8e('0xce')]=_['keys'](db[_0xed8e('0xa9')][_0xed8e('0x34')]);_0x1cf6f8[_0xed8e('0x41')]=_[_0xed8e('0xcf')](_0x3650e3[_0xed8e('0x41')]);_0x1cf6f8[_0xed8e('0xd9')]=_[_0xed8e('0xd1')](_0x1cf6f8[_0xed8e('0xce')],_0x1cf6f8[_0xed8e('0x41')]);_0x3be4a0['attributes']=_[_0xed8e('0xd1')](_0x1cf6f8[_0xed8e('0xce')],qs[_0xed8e('0xd2')](_0x3650e3[_0xed8e('0x41')][_0xed8e('0xd2')]));_0x3be4a0[_0xed8e('0x45')]=_0x3be4a0[_0xed8e('0x45')]['length']?_0x3be4a0[_0xed8e('0x45')]:_0x1cf6f8[_0xed8e('0xce')];_0x3be4a0[_0xed8e('0xd3')]=qs[_0xed8e('0xd4')](_0x3650e3[_0xed8e('0x41')][_0xed8e('0xd4')]);_0x3be4a0[_0xed8e('0x3f')]=qs['filters'](_[_0xed8e('0xd5')](_0x3650e3[_0xed8e('0x41')],_0x1cf6f8[_0xed8e('0xd9')]));if(_0x3650e3['query'][_0xed8e('0x2a')]){_0x3be4a0[_0xed8e('0x3f')]=_['merge'](_0x3be4a0[_0xed8e('0x3f')],{'$or':_['map'](_0x3be4a0[_0xed8e('0x45')],function(_0x59a687){var _0x4f021e={};_0x4f021e[_0x59a687]={'$like':'%'+_0x3650e3['query'][_0xed8e('0x2a')]+'%'};return _0x4f021e;})});}_0x3be4a0=_[_0xed8e('0x53')]({},_0x3be4a0,_0x3650e3[_0xed8e('0xd6')]);return _0x827ac0['getVoiceQueuesRt'](_0x3be4a0);}})[_0xed8e('0x1f')](function(_0x3335e8){if(_0x3335e8){_0x2bc925=_0x3335e8[_0xed8e('0x67')];if(!_0x3650e3[_0xed8e('0x41')]['hasOwnProperty'](_0xed8e('0xd7'))){_0x3be4a0[_0xed8e('0x1a')]=qs['limit'](_0x3650e3[_0xed8e('0x41')][_0xed8e('0x1a')]);_0x3be4a0[_0xed8e('0x18')]=qs[_0xed8e('0x18')](_0x3650e3[_0xed8e('0x41')][_0xed8e('0x18')]);}return _0x827ac0[_0xed8e('0xd8')](_0x3be4a0);}})['then'](function(_0x4e9fdf){if(_0x4e9fdf){return _0x4e9fdf?{'count':_0x2bc925,'rows':_0x4e9fdf}:null;}})[_0xed8e('0x1f')](respondWithResult(_0x5af4a1,null))[_0xed8e('0x4f')](handleError(_0x5af4a1,null));};exports[_0xed8e('0xda')]=function(_0xeadf25,_0x10698a){var _0x5da999={};var _0x4d0786={};var _0x26b0da;var _0x4e4585;return db[_0xed8e('0x40')][_0xed8e('0x94')]({'where':{'id':_0xeadf25[_0xed8e('0x51')]['id']}})[_0xed8e('0x1f')](handleEntityNotFound(_0x10698a,null))['then'](function(_0x32fc3b){if(_0x32fc3b){_0x26b0da=_0x32fc3b;_0x4d0786[_0xed8e('0xce')]=_[_0xed8e('0xcf')](db[_0xed8e('0xdb')][_0xed8e('0x34')]);_0x4d0786[_0xed8e('0x41')]=_[_0xed8e('0xcf')](_0xeadf25[_0xed8e('0x41')]);_0x4d0786[_0xed8e('0xd9')]=_[_0xed8e('0xd1')](_0x4d0786[_0xed8e('0xce')],_0x4d0786[_0xed8e('0x41')]);_0x5da999[_0xed8e('0x45')]=_[_0xed8e('0xd1')](_0x4d0786['model'],qs[_0xed8e('0xd2')](_0xeadf25[_0xed8e('0x41')]['fields']));_0x5da999[_0xed8e('0x45')]=_0x5da999[_0xed8e('0x45')][_0xed8e('0x67')]?_0x5da999[_0xed8e('0x45')]:_0x4d0786['model'];_0x5da999[_0xed8e('0xd3')]=qs[_0xed8e('0xd4')](_0xeadf25['query'][_0xed8e('0xd4')]);_0x5da999[_0xed8e('0x3f')]=qs[_0xed8e('0xd9')](_[_0xed8e('0xd5')](_0xeadf25['query'],_0x4d0786[_0xed8e('0xd9')]));if(_0xeadf25[_0xed8e('0x41')][_0xed8e('0x2a')]){_0x5da999['where']=_[_0xed8e('0x53')](_0x5da999[_0xed8e('0x3f')],{'$or':_[_0xed8e('0x2c')](_0x5da999[_0xed8e('0x45')],function(_0x51127f){var _0x34790d={};_0x34790d[_0x51127f]={'$like':'%'+_0xeadf25[_0xed8e('0x41')][_0xed8e('0x2a')]+'%'};return _0x34790d;})});}_0x5da999=_['merge']({},_0x5da999,_0xeadf25[_0xed8e('0xd6')]);return _0x26b0da[_0xed8e('0xda')](_0x5da999);}})[_0xed8e('0x1f')](function(_0x21c975){if(_0x21c975){_0x4e4585=_0x21c975[_0xed8e('0x67')];if(!_0xeadf25[_0xed8e('0x41')][_0xed8e('0xc5')]('nolimit')){_0x5da999[_0xed8e('0x1a')]=qs[_0xed8e('0x1a')](_0xeadf25[_0xed8e('0x41')][_0xed8e('0x1a')]);_0x5da999[_0xed8e('0x18')]=qs[_0xed8e('0x18')](_0xeadf25[_0xed8e('0x41')]['offset']);}return _0x26b0da[_0xed8e('0xda')](_0x5da999);}})[_0xed8e('0x1f')](function(_0x32dc9f){if(_0x32dc9f){return _0x32dc9f?{'count':_0x4e4585,'rows':_0x32dc9f}:null;}})[_0xed8e('0x1f')](respondWithResult(_0x10698a,null))[_0xed8e('0x4f')](handleError(_0x10698a,null));};exports[_0xed8e('0xdc')]=function(_0x3f0a9f,_0x40ed33){var _0x582228={'raw':!![],'where':{}};var _0x5c6fbe={};var _0x5be4cc={'count':0x0,'rows':[]};return db[_0xed8e('0x40')][_0xed8e('0x94')]({'where':{'id':_0x3f0a9f['params']['id']}})[_0xed8e('0x1f')](handleEntityNotFound(_0x40ed33,null))[_0xed8e('0x1f')](function(_0x29ada4){if(_0x29ada4){_0x5c6fbe[_0xed8e('0xce')]=_[_0xed8e('0xcf')](db['VoiceRecording'][_0xed8e('0x34')]);_0x5c6fbe[_0xed8e('0x41')]=_['keys'](_0x3f0a9f[_0xed8e('0x41')]);_0x5c6fbe[_0xed8e('0xd9')]=_[_0xed8e('0xd1')](_0x5c6fbe['model'],_0x5c6fbe['query']);_0x582228[_0xed8e('0x45')]=_[_0xed8e('0xd1')](_0x5c6fbe[_0xed8e('0xce')],qs[_0xed8e('0xd2')](_0x3f0a9f[_0xed8e('0x41')][_0xed8e('0xd2')]));_0x582228[_0xed8e('0x45')]=_0x582228[_0xed8e('0x45')][_0xed8e('0x67')]?_0x582228[_0xed8e('0x45')]:_0x5c6fbe[_0xed8e('0xce')];if(!_0x3f0a9f[_0xed8e('0x41')]['hasOwnProperty'](_0xed8e('0xd7'))){_0x582228[_0xed8e('0x1a')]=qs[_0xed8e('0x1a')](_0x3f0a9f[_0xed8e('0x41')][_0xed8e('0x1a')]);_0x582228['offset']=qs[_0xed8e('0x18')](_0x3f0a9f[_0xed8e('0x41')][_0xed8e('0x18')]);}_0x582228[_0xed8e('0xd3')]=qs['sort'](_0x3f0a9f[_0xed8e('0x41')][_0xed8e('0xd4')]);_0x582228[_0xed8e('0x3f')]=qs['filters'](_['pick'](_0x3f0a9f['query'],_0x5c6fbe[_0xed8e('0xd9')]));_0x582228[_0xed8e('0x3f')]['UserId']=_0x29ada4['id'];if(_0x3f0a9f[_0xed8e('0x41')]['filter']){_0x582228['where']=_[_0xed8e('0x53')](_0x582228[_0xed8e('0x3f')],{'$or':_[_0xed8e('0x2c')](_0x582228[_0xed8e('0x45')],function(_0x261c6c){var _0x5f38a3={};_0x5f38a3[_0x261c6c]={'$like':'%'+_0x3f0a9f[_0xed8e('0x41')][_0xed8e('0x2a')]+'%'};return _0x5f38a3;})});}_0x582228=_['merge']({},_0x582228,_0x3f0a9f['options']);return db[_0xed8e('0xdd')]['count']({'where':_0x582228[_0xed8e('0x3f')]})[_0xed8e('0x1f')](function(_0xcd26c4){_0x5be4cc[_0xed8e('0x1b')]=_0xcd26c4;if(_0x3f0a9f['query'][_0xed8e('0xc6')]){_0x582228[_0xed8e('0x42')]=[{'all':!![]}];}return db[_0xed8e('0xdd')][_0xed8e('0x47')](_0x582228);})[_0xed8e('0x1f')](function(_0x4dfd9b){_0x5be4cc[_0xed8e('0x48')]=_0x4dfd9b;return _0x5be4cc;});}})[_0xed8e('0x1f')](respondWithFilteredResult(_0x40ed33,_0x582228))[_0xed8e('0x4f')](handleError(_0x40ed33,null));};exports[_0xed8e('0xde')]=function(_0x29fe21,_0xc7a46e){var _0x372745={'raw':!![],'where':{}};var _0x3eb055={};var _0x134e47={'count':0x0,'rows':[]};return db[_0xed8e('0x40')]['findOne']({'where':{'id':_0x29fe21[_0xed8e('0x51')]['id']}})['then'](handleEntityNotFound(_0xc7a46e,null))['then'](function(_0x2f03df){if(_0x2f03df){_0x3eb055[_0xed8e('0xce')]=_[_0xed8e('0xcf')](db[_0xed8e('0xdf')]['rawAttributes']);_0x3eb055[_0xed8e('0x41')]=_[_0xed8e('0xcf')](_0x29fe21['query']);_0x3eb055['filters']=_[_0xed8e('0xd1')](_0x3eb055[_0xed8e('0xce')],_0x3eb055[_0xed8e('0x41')]);_0x372745[_0xed8e('0x45')]=_[_0xed8e('0xd1')](_0x3eb055[_0xed8e('0xce')],qs[_0xed8e('0xd2')](_0x29fe21[_0xed8e('0x41')][_0xed8e('0xd2')]));_0x372745['attributes']=_0x372745[_0xed8e('0x45')][_0xed8e('0x67')]?_0x372745[_0xed8e('0x45')]:_0x3eb055[_0xed8e('0xce')];if(!_0x29fe21[_0xed8e('0x41')][_0xed8e('0xc5')](_0xed8e('0xd7'))){_0x372745[_0xed8e('0x1a')]=qs[_0xed8e('0x1a')](_0x29fe21[_0xed8e('0x41')][_0xed8e('0x1a')]);_0x372745[_0xed8e('0x18')]=qs[_0xed8e('0x18')](_0x29fe21[_0xed8e('0x41')][_0xed8e('0x18')]);}_0x372745[_0xed8e('0xd3')]=qs[_0xed8e('0xd4')](_0x29fe21['query'][_0xed8e('0xd4')]);_0x372745[_0xed8e('0x3f')]=qs[_0xed8e('0xd9')](_[_0xed8e('0xd5')](_0x29fe21[_0xed8e('0x41')],_0x3eb055['filters']));_0x372745[_0xed8e('0x3f')][_0xed8e('0xe0')]=_0x2f03df['id'];if(_0x29fe21[_0xed8e('0x41')][_0xed8e('0x2a')]){_0x372745['where']=_[_0xed8e('0x53')](_0x372745[_0xed8e('0x3f')],{'$or':_[_0xed8e('0x2c')](_0x372745[_0xed8e('0x45')],function(_0x5e102f){var _0x1575b3={};_0x1575b3[_0x5e102f]={'$like':'%'+_0x29fe21[_0xed8e('0x41')][_0xed8e('0x2a')]+'%'};return _0x1575b3;})});}_0x372745=_[_0xed8e('0x53')]({},_0x372745,_0x29fe21[_0xed8e('0xd6')]);return db[_0xed8e('0xdf')]['count']({'where':_0x372745[_0xed8e('0x3f')]})[_0xed8e('0x1f')](function(_0x3ff875){_0x134e47[_0xed8e('0x1b')]=_0x3ff875;if(_0x29fe21['query']['includeAll']){_0x372745['include']=[{'all':!![]}];}return db[_0xed8e('0xdf')][_0xed8e('0x47')](_0x372745);})['then'](function(_0x34ced4){_0x134e47[_0xed8e('0x48')]=_0x34ced4;return _0x134e47;});}})[_0xed8e('0x1f')](respondWithFilteredResult(_0xc7a46e,_0x372745))[_0xed8e('0x4f')](handleError(_0xc7a46e,null));};exports[_0xed8e('0xe1')]=function(_0x37ee16,_0x9d22be){var _0x345469={};var _0x2d9bf9={};var _0x184a1d;var _0x3fb6da;return db[_0xed8e('0x40')][_0xed8e('0x94')]({'where':{'id':_0x37ee16['params']['id']}})[_0xed8e('0x1f')](handleEntityNotFound(_0x9d22be,null))['then'](function(_0x1c9dcf){if(_0x1c9dcf){_0x184a1d=_0x1c9dcf;_0x2d9bf9[_0xed8e('0xce')]=_[_0xed8e('0xcf')](db[_0xed8e('0xe2')]['rawAttributes']);_0x2d9bf9[_0xed8e('0x41')]=_['keys'](_0x37ee16[_0xed8e('0x41')]);_0x2d9bf9['filters']=_['intersection'](_0x2d9bf9[_0xed8e('0xce')],_0x2d9bf9[_0xed8e('0x41')]);_0x345469['attributes']=_[_0xed8e('0xd1')](_0x2d9bf9['model'],qs[_0xed8e('0xd2')](_0x37ee16[_0xed8e('0x41')][_0xed8e('0xd2')]));_0x345469[_0xed8e('0x45')]=_0x345469[_0xed8e('0x45')][_0xed8e('0x67')]?_0x345469[_0xed8e('0x45')]:_0x2d9bf9[_0xed8e('0xce')];_0x345469[_0xed8e('0xd3')]=qs[_0xed8e('0xd4')](_0x37ee16['query'][_0xed8e('0xd4')]);_0x345469['where']=qs[_0xed8e('0xd9')](_[_0xed8e('0xd5')](_0x37ee16['query'],_0x2d9bf9[_0xed8e('0xd9')]));if(_0x37ee16[_0xed8e('0x41')]['filter']){_0x345469[_0xed8e('0x3f')]=_[_0xed8e('0x53')](_0x345469['where'],{'$or':_[_0xed8e('0x2c')](_0x345469[_0xed8e('0x45')],function(_0x420393){var _0x47b2ff={};_0x47b2ff[_0x420393]={'$like':'%'+_0x37ee16[_0xed8e('0x41')]['filter']+'%'};return _0x47b2ff;})});}_0x345469=_[_0xed8e('0x53')]({},_0x345469,_0x37ee16[_0xed8e('0xd6')]);return _0x184a1d[_0xed8e('0xe1')](_0x345469);}})[_0xed8e('0x1f')](function(_0x320373){if(_0x320373){_0x3fb6da=_0x320373[_0xed8e('0x67')];if(!_0x37ee16['query'][_0xed8e('0xc5')](_0xed8e('0xd7'))){_0x345469[_0xed8e('0x1a')]=qs[_0xed8e('0x1a')](_0x37ee16['query'][_0xed8e('0x1a')]);_0x345469[_0xed8e('0x18')]=qs['offset'](_0x37ee16['query']['offset']);}return _0x184a1d['getChatInteractions'](_0x345469);}})[_0xed8e('0x1f')](function(_0x7b4b3e){if(_0x7b4b3e){return _0x7b4b3e?{'count':_0x3fb6da,'rows':_0x7b4b3e}:null;}})[_0xed8e('0x1f')](respondWithResult(_0x9d22be,null))[_0xed8e('0x4f')](handleError(_0x9d22be,null));};exports[_0xed8e('0xe3')]=function(_0x10e423,_0xeb8f4b){var _0xb6697e={};var _0x583492={};var _0x42f126;var _0x293145;return db['User'][_0xed8e('0x94')]({'where':{'id':_0x10e423[_0xed8e('0x51')]['id']}})[_0xed8e('0x1f')](handleEntityNotFound(_0xeb8f4b,null))['then'](function(_0x2c130c){if(_0x2c130c){_0x42f126=_0x2c130c;_0x583492[_0xed8e('0xce')]=_[_0xed8e('0xcf')](db[_0xed8e('0xe4')]['rawAttributes']);_0x583492[_0xed8e('0x41')]=_[_0xed8e('0xcf')](_0x10e423['query']);_0x583492['filters']=_[_0xed8e('0xd1')](_0x583492['model'],_0x583492[_0xed8e('0x41')]);_0xb6697e[_0xed8e('0x45')]=_[_0xed8e('0xd1')](_0x583492[_0xed8e('0xce')],qs[_0xed8e('0xd2')](_0x10e423[_0xed8e('0x41')][_0xed8e('0xd2')]));_0xb6697e['attributes']=_0xb6697e[_0xed8e('0x45')]['length']?_0xb6697e['attributes']:_0x583492['model'];_0xb6697e['order']=qs[_0xed8e('0xd4')](_0x10e423[_0xed8e('0x41')][_0xed8e('0xd4')]);_0xb6697e[_0xed8e('0x3f')]=qs[_0xed8e('0xd9')](_[_0xed8e('0xd5')](_0x10e423['query'],_0x583492['filters']));if(_0x10e423[_0xed8e('0x41')]['filter']){_0xb6697e['where']=_['merge'](_0xb6697e[_0xed8e('0x3f')],{'$or':_[_0xed8e('0x2c')](_0xb6697e[_0xed8e('0x45')],function(_0x52e9cf){var _0x5421b8={};_0x5421b8[_0x52e9cf]={'$like':'%'+_0x10e423[_0xed8e('0x41')][_0xed8e('0x2a')]+'%'};return _0x5421b8;})});}_0xb6697e=_[_0xed8e('0x53')]({},_0xb6697e,_0x10e423['options']);return _0x42f126[_0xed8e('0xe3')](_0xb6697e);}})[_0xed8e('0x1f')](function(_0x4c8ef8){if(_0x4c8ef8){_0x293145=_0x4c8ef8['length'];if(!_0x10e423['query'][_0xed8e('0xc5')]('nolimit')){_0xb6697e[_0xed8e('0x1a')]=qs['limit'](_0x10e423['query'][_0xed8e('0x1a')]);_0xb6697e['offset']=qs[_0xed8e('0x18')](_0x10e423[_0xed8e('0x41')][_0xed8e('0x18')]);}return _0x42f126[_0xed8e('0xe3')](_0xb6697e);}})[_0xed8e('0x1f')](function(_0x4842c9){if(_0x4842c9){return _0x4842c9?{'count':_0x293145,'rows':_0x4842c9}:null;}})[_0xed8e('0x1f')](respondWithResult(_0xeb8f4b,null))[_0xed8e('0x4f')](handleError(_0xeb8f4b,null));};exports[_0xed8e('0xe5')]=function(_0x5a4cf6,_0x9c0648){var _0x327376={'raw':!![],'where':{}};var _0x5484bb={};var _0x592793={'count':0x0,'rows':[]};return db[_0xed8e('0x40')][_0xed8e('0x94')]({'where':{'id':_0x5a4cf6[_0xed8e('0x51')]['id']}})['then'](handleEntityNotFound(_0x9c0648,null))[_0xed8e('0x1f')](function(_0xe0da08){if(_0xe0da08){_0x5484bb[_0xed8e('0xce')]=_[_0xed8e('0xcf')](db[_0xed8e('0xe6')]['rawAttributes']);_0x5484bb['query']=_[_0xed8e('0xcf')](_0x5a4cf6[_0xed8e('0x41')]);_0x5484bb[_0xed8e('0xd9')]=_[_0xed8e('0xd1')](_0x5484bb['model'],_0x5484bb[_0xed8e('0x41')]);_0x327376[_0xed8e('0x45')]=_[_0xed8e('0xd1')](_0x5484bb[_0xed8e('0xce')],qs[_0xed8e('0xd2')](_0x5a4cf6[_0xed8e('0x41')][_0xed8e('0xd2')]));_0x327376[_0xed8e('0x45')]=_0x327376[_0xed8e('0x45')][_0xed8e('0x67')]?_0x327376[_0xed8e('0x45')]:_0x5484bb[_0xed8e('0xce')];if(!_0x5a4cf6[_0xed8e('0x41')]['hasOwnProperty'](_0xed8e('0xd7'))){_0x327376[_0xed8e('0x1a')]=qs[_0xed8e('0x1a')](_0x5a4cf6[_0xed8e('0x41')][_0xed8e('0x1a')]);_0x327376[_0xed8e('0x18')]=qs['offset'](_0x5a4cf6[_0xed8e('0x41')][_0xed8e('0x18')]);}_0x327376[_0xed8e('0xd3')]=qs['sort'](_0x5a4cf6[_0xed8e('0x41')][_0xed8e('0xd4')]);_0x327376[_0xed8e('0x3f')]=qs[_0xed8e('0xd9')](_['pick'](_0x5a4cf6[_0xed8e('0x41')],_0x5484bb[_0xed8e('0xd9')]));_0x327376[_0xed8e('0x3f')][_0xed8e('0xe0')]=_0xe0da08['id'];if(_0x5a4cf6[_0xed8e('0x41')][_0xed8e('0x2a')]){_0x327376[_0xed8e('0x3f')]=_[_0xed8e('0x53')](_0x327376[_0xed8e('0x3f')],{'$or':_[_0xed8e('0x2c')](_0x327376['attributes'],function(_0x24b04b){var _0x181df7={};_0x181df7[_0x24b04b]={'$like':'%'+_0x5a4cf6[_0xed8e('0x41')]['filter']+'%'};return _0x181df7;})});}_0x327376=_[_0xed8e('0x53')]({},_0x327376,_0x5a4cf6[_0xed8e('0xd6')]);return db['MailInteraction']['count']({'where':_0x327376[_0xed8e('0x3f')]})[_0xed8e('0x1f')](function(_0x33aca1){_0x592793[_0xed8e('0x1b')]=_0x33aca1;if(_0x5a4cf6[_0xed8e('0x41')][_0xed8e('0xc6')]){_0x327376[_0xed8e('0x42')]=[{'all':!![]}];}return db['MailInteraction']['findAll'](_0x327376);})['then'](function(_0x1e8e04){_0x592793[_0xed8e('0x48')]=_0x1e8e04;return _0x592793;});}})['then'](respondWithFilteredResult(_0x9c0648,_0x327376))[_0xed8e('0x4f')](handleError(_0x9c0648,null));};exports[_0xed8e('0xe7')]=function(_0x2a8ed5,_0x564aef){var _0x81c037={};var _0xbbddbd={};var _0x29e27d;var _0x4c554e;return db[_0xed8e('0x40')][_0xed8e('0x94')]({'where':{'id':_0x2a8ed5[_0xed8e('0x51')]['id']}})['then'](handleEntityNotFound(_0x564aef,null))['then'](function(_0x3908d4){if(_0x3908d4){_0x29e27d=_0x3908d4;_0xbbddbd[_0xed8e('0xce')]=_[_0xed8e('0xcf')](db[_0xed8e('0xe8')][_0xed8e('0x34')]);_0xbbddbd[_0xed8e('0x41')]=_['keys'](_0x2a8ed5[_0xed8e('0x41')]);_0xbbddbd[_0xed8e('0xd9')]=_['intersection'](_0xbbddbd[_0xed8e('0xce')],_0xbbddbd['query']);_0x81c037[_0xed8e('0x45')]=_[_0xed8e('0xd1')](_0xbbddbd[_0xed8e('0xce')],qs[_0xed8e('0xd2')](_0x2a8ed5['query'][_0xed8e('0xd2')]));_0x81c037[_0xed8e('0x45')]=_0x81c037['attributes']['length']?_0x81c037[_0xed8e('0x45')]:_0xbbddbd[_0xed8e('0xce')];_0x81c037[_0xed8e('0xd3')]=qs[_0xed8e('0xd4')](_0x2a8ed5['query'][_0xed8e('0xd4')]);_0x81c037[_0xed8e('0x3f')]=qs[_0xed8e('0xd9')](_[_0xed8e('0xd5')](_0x2a8ed5['query'],_0xbbddbd[_0xed8e('0xd9')]));if(_0x2a8ed5[_0xed8e('0x41')]['filter']){_0x81c037['where']=_[_0xed8e('0x53')](_0x81c037[_0xed8e('0x3f')],{'$or':_[_0xed8e('0x2c')](_0x81c037[_0xed8e('0x45')],function(_0x1f5b85){var _0x5e6ed2={};_0x5e6ed2[_0x1f5b85]={'$like':'%'+_0x2a8ed5[_0xed8e('0x41')][_0xed8e('0x2a')]+'%'};return _0x5e6ed2;})});}_0x81c037=_[_0xed8e('0x53')]({},_0x81c037,_0x2a8ed5[_0xed8e('0xd6')]);return _0x29e27d[_0xed8e('0xe7')](_0x81c037);}})['then'](function(_0x45d3c8){if(_0x45d3c8){_0x4c554e=_0x45d3c8[_0xed8e('0x67')];if(!_0x2a8ed5[_0xed8e('0x41')][_0xed8e('0xc5')]('nolimit')){_0x81c037[_0xed8e('0x1a')]=qs[_0xed8e('0x1a')](_0x2a8ed5[_0xed8e('0x41')][_0xed8e('0x1a')]);_0x81c037[_0xed8e('0x18')]=qs[_0xed8e('0x18')](_0x2a8ed5['query'][_0xed8e('0x18')]);}return _0x29e27d['getSmsInteractions'](_0x81c037);}})[_0xed8e('0x1f')](function(_0x4f0f4f){if(_0x4f0f4f){return _0x4f0f4f?{'count':_0x4c554e,'rows':_0x4f0f4f}:null;}})[_0xed8e('0x1f')](respondWithResult(_0x564aef,null))[_0xed8e('0x4f')](handleError(_0x564aef,null));};exports[_0xed8e('0xe9')]=function(_0x439687,_0x228997){var _0x45ad36={};var _0x2588cf={};var _0x1e7345;var _0x56ecf2;return db[_0xed8e('0x40')][_0xed8e('0x94')]({'where':{'id':_0x439687[_0xed8e('0x51')]['id']}})[_0xed8e('0x1f')](handleEntityNotFound(_0x228997,null))[_0xed8e('0x1f')](function(_0x539e70){if(_0x539e70){_0x1e7345=_0x539e70;_0x2588cf[_0xed8e('0xce')]=_[_0xed8e('0xcf')](db[_0xed8e('0xea')][_0xed8e('0x34')]);_0x2588cf[_0xed8e('0x41')]=_[_0xed8e('0xcf')](_0x439687[_0xed8e('0x41')]);_0x2588cf[_0xed8e('0xd9')]=_[_0xed8e('0xd1')](_0x2588cf['model'],_0x2588cf[_0xed8e('0x41')]);_0x45ad36[_0xed8e('0x45')]=_[_0xed8e('0xd1')](_0x2588cf['model'],qs[_0xed8e('0xd2')](_0x439687[_0xed8e('0x41')][_0xed8e('0xd2')]));_0x45ad36[_0xed8e('0x45')]=_0x45ad36[_0xed8e('0x45')][_0xed8e('0x67')]?_0x45ad36[_0xed8e('0x45')]:_0x2588cf[_0xed8e('0xce')];_0x45ad36[_0xed8e('0xd3')]=qs[_0xed8e('0xd4')](_0x439687['query'][_0xed8e('0xd4')]);_0x45ad36[_0xed8e('0x3f')]=qs[_0xed8e('0xd9')](_[_0xed8e('0xd5')](_0x439687[_0xed8e('0x41')],_0x2588cf[_0xed8e('0xd9')]));if(_0x439687[_0xed8e('0x41')][_0xed8e('0x2a')]){_0x45ad36[_0xed8e('0x3f')]=_[_0xed8e('0x53')](_0x45ad36[_0xed8e('0x3f')],{'$or':_[_0xed8e('0x2c')](_0x45ad36['attributes'],function(_0x4c1bff){var _0x3e745f={};_0x3e745f[_0x4c1bff]={'$like':'%'+_0x439687['query'][_0xed8e('0x2a')]+'%'};return _0x3e745f;})});}_0x45ad36=_[_0xed8e('0x53')]({},_0x45ad36,_0x439687[_0xed8e('0xd6')]);return _0x1e7345['getFaxInteractions'](_0x45ad36);}})[_0xed8e('0x1f')](function(_0x3c8093){if(_0x3c8093){_0x56ecf2=_0x3c8093[_0xed8e('0x67')];if(!_0x439687[_0xed8e('0x41')][_0xed8e('0xc5')](_0xed8e('0xd7'))){_0x45ad36[_0xed8e('0x1a')]=qs[_0xed8e('0x1a')](_0x439687[_0xed8e('0x41')][_0xed8e('0x1a')]);_0x45ad36[_0xed8e('0x18')]=qs[_0xed8e('0x18')](_0x439687[_0xed8e('0x41')][_0xed8e('0x18')]);}return _0x1e7345[_0xed8e('0xe9')](_0x45ad36);}})[_0xed8e('0x1f')](function(_0x58fcc4){if(_0x58fcc4){return _0x58fcc4?{'count':_0x56ecf2,'rows':_0x58fcc4}:null;}})[_0xed8e('0x1f')](respondWithResult(_0x228997,null))[_0xed8e('0x4f')](handleError(_0x228997,null));};exports['getWhatsappInteractions']=function(_0x184c28,_0x43a361){var _0x26108e={};var _0x501a7c={};var _0x15dd6c;var _0x4fc1e4;return db['User'][_0xed8e('0x94')]({'where':{'id':_0x184c28[_0xed8e('0x51')]['id']}})[_0xed8e('0x1f')](handleEntityNotFound(_0x43a361,null))[_0xed8e('0x1f')](function(_0x239f68){if(_0x239f68){_0x15dd6c=_0x239f68;_0x501a7c[_0xed8e('0xce')]=_[_0xed8e('0xcf')](db['WhatsappInteraction']['rawAttributes']);_0x501a7c[_0xed8e('0x41')]=_['keys'](_0x184c28[_0xed8e('0x41')]);_0x501a7c['filters']=_['intersection'](_0x501a7c[_0xed8e('0xce')],_0x501a7c[_0xed8e('0x41')]);_0x26108e[_0xed8e('0x45')]=_[_0xed8e('0xd1')](_0x501a7c[_0xed8e('0xce')],qs[_0xed8e('0xd2')](_0x184c28[_0xed8e('0x41')][_0xed8e('0xd2')]));_0x26108e['attributes']=_0x26108e[_0xed8e('0x45')]['length']?_0x26108e[_0xed8e('0x45')]:_0x501a7c['model'];_0x26108e['order']=qs[_0xed8e('0xd4')](_0x184c28[_0xed8e('0x41')][_0xed8e('0xd4')]);_0x26108e[_0xed8e('0x3f')]=qs[_0xed8e('0xd9')](_['pick'](_0x184c28['query'],_0x501a7c[_0xed8e('0xd9')]));if(_0x184c28[_0xed8e('0x41')][_0xed8e('0x2a')]){_0x26108e['where']=_[_0xed8e('0x53')](_0x26108e['where'],{'$or':_[_0xed8e('0x2c')](_0x26108e[_0xed8e('0x45')],function(_0x246b7f){var _0x9d3c7d={};_0x9d3c7d[_0x246b7f]={'$like':'%'+_0x184c28[_0xed8e('0x41')][_0xed8e('0x2a')]+'%'};return _0x9d3c7d;})});}_0x26108e=_[_0xed8e('0x53')]({},_0x26108e,_0x184c28[_0xed8e('0xd6')]);return _0x15dd6c['getWhatsappInteractions'](_0x26108e);}})[_0xed8e('0x1f')](function(_0x4f8c46){if(_0x4f8c46){_0x4fc1e4=_0x4f8c46['length'];if(!_0x184c28[_0xed8e('0x41')][_0xed8e('0xc5')](_0xed8e('0xd7'))){_0x26108e['limit']=qs['limit'](_0x184c28['query']['limit']);_0x26108e['offset']=qs[_0xed8e('0x18')](_0x184c28[_0xed8e('0x41')][_0xed8e('0x18')]);}return _0x15dd6c[_0xed8e('0xeb')](_0x26108e);}})[_0xed8e('0x1f')](function(_0x2f15cb){if(_0x2f15cb){return _0x2f15cb?{'count':_0x4fc1e4,'rows':_0x2f15cb}:null;}})['then'](respondWithResult(_0x43a361,null))['catch'](handleError(_0x43a361,null));};exports['login']=function(_0x2e1e2e,_0x50beba,_0x451a3a){var _0x42511d;var _0x438f2b;var _0x2eb460;var _0x446b8a=!_['isNil'](_0x2e1e2e[_0xed8e('0x51')]['id'])?_0x2e1e2e[_0xed8e('0x51')]['id']:!_['isNil'](_0x2e1e2e[_0xed8e('0x27')]['id'])?_0x2e1e2e['user']['id']:null;return db['User'][_0xed8e('0x2f')]({'where':{'id':_0x446b8a,'role':{'$or':[_0xed8e('0x25'),_0xed8e('0x27'),_0xed8e('0x20')]}},'attributes':['id',_0xed8e('0x30'),_0xed8e('0xec'),_0xed8e('0xed'),'role','internal','loginInPause']})[_0xed8e('0x1f')](function(_0xd0b5b5){if(_0xd0b5b5){if(_0xd0b5b5['role']===_0xed8e('0x20')){_0x42511d=_0xd0b5b5;if(_0x2e1e2e[_0xed8e('0x58')]['interface']){_0x2eb460=util[_0xed8e('0xa7')](_0xed8e('0xee'),_0x42511d[_0x2e1e2e['body'][_0xed8e('0x9c')]]);}else if(_0x2e1e2e[_0xed8e('0x58')]['intrf']){_0x2eb460=util['format'](_0xed8e('0xef'),_0x2e1e2e[_0xed8e('0x58')][_0xed8e('0xf0')]);}else{_0x2eb460=util[_0xed8e('0xa7')](_0xed8e('0xef'),_0x42511d[_0xed8e('0x30')]);}socket['to'](util['format'](_0xed8e('0xf1'),_0x42511d[_0xed8e('0x30')]))[_0xed8e('0x21')]('user:forcelogout',{'user':{'id':_0x42511d['id'],'name':_0x42511d[_0xed8e('0x30')]},'ip':_0x2e1e2e['headers'][_0xed8e('0xf2')]||_0x2e1e2e['connection']['remoteAddress']||_0x2e1e2e[_0xed8e('0xf3')]['remoteAddress']||_0x2e1e2e[_0xed8e('0xf4')]['socket'][_0xed8e('0xf5')]});return db[_0xed8e('0xa9')][_0xed8e('0x22')]({'where':{'membername':_0x42511d[_0xed8e('0x30')]},'individualHooks':!![]});}}else{throw new db[(_0xed8e('0x92'))][(_0xed8e('0x8f'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0xed8e('0x1f')](function(){if(_0x42511d){return _0x42511d[_0xed8e('0xf6')]({'raw':!![]});}})[_0xed8e('0x1f')](function(_0x5f49df){if(_0x42511d){if(_0x5f49df){_0x438f2b=_0x5f49df;if(_0x438f2b['length']){var _0x4828e6=_0x438f2b[_0xed8e('0x2c')](function(_0x19c420){var _0x7b22a1={'membername':_0x42511d[_0xed8e('0x30')],'UserId':_0x42511d['id'],'queue_name':_0x19c420[_0xed8e('0x30')],'VoiceQueueId':_0x19c420['id'],'interface':_0x2eb460,'paused':_0x42511d[_0xed8e('0x9b')]||![],'penalty':_0x19c420[_0xed8e('0xf7')]||0x0};return db[_0xed8e('0xa9')][_0xed8e('0xaa')](_0x7b22a1);});return Promise[_0xed8e('0x57')](_0x4828e6);}}}})[_0xed8e('0x1f')](function(){if(_0x42511d){return db[_0xed8e('0xf8')][_0xed8e('0x47')]({'where':{'membername':_0x42511d['name'],'exitAt':null}});}})[_0xed8e('0x1f')](function(_0xa34fa3){if(_0x42511d){var _0x501b8c=[];_0xa34fa3[_0xed8e('0xf9')](function(_0x8c67e4){_0x501b8c['push'](_0x8c67e4[_0xed8e('0x1e')]({'exitAt':moment()[_0xed8e('0xa7')](_0xed8e('0xfa'))}));});return Promise[_0xed8e('0x57')](_0x501b8c);}})[_0xed8e('0x1f')](function(){if(_0x42511d){var _0x23b80c=[];var _0x50c6bc=[];var _0x11a18d=utils[_0xed8e('0xfb')]();var _0x229dd6={'membername':_0x42511d['name'],'interface':_0x2eb460,'enterAt':moment()[_0xed8e('0xa7')](_0xed8e('0xfa')),'role':_0x42511d['role'],'internal':_0x42511d[_0xed8e('0x5c')]};_0x11a18d[_0xed8e('0xf9')](function(_0x87f19b){_0x23b80c['push'](_[_0xed8e('0x53')]({'channel':_0x87f19b,'type':_0xed8e('0xfc'),'data1':_0x2e1e2e[_0xed8e('0x58')][_0xed8e('0xfd')],'data2':_0x2eb460},_0x229dd6));if(_0x42511d[_0xed8e('0x9b')]){_0x50c6bc[_0xed8e('0x46')](_[_0xed8e('0x53')]({'channel':_0x87f19b,'type':_0xed8e('0xfe'),'data1':'LOGININPAUSE'},_0x229dd6));}});return db[_0xed8e('0xf8')]['bulkCreate'](_0x23b80c[_0xed8e('0xc3')](_0x50c6bc),{'individualHooks':!![]});}})[_0xed8e('0x1f')](function(){if(_0x42511d){return _0x42511d[_0xed8e('0x1e')]({'online':!![],'lastLoginAt':moment()[_0xed8e('0xa7')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x42511d['loginInPause']||![],'mailPause':_0x42511d[_0xed8e('0x9b')]||![],'chatPause':_0x42511d[_0xed8e('0x9b')]||![],'faxPause':_0x42511d['loginInPause']||![],'smsPause':_0x42511d[_0xed8e('0x9b')]||![],'openchannelPause':_0x42511d['loginInPause']||![],'whatsappPause':_0x42511d[_0xed8e('0x9b')]||![],'pauseType':_0x42511d[_0xed8e('0x9b')]?'LOGININPAUSE':null,'interface':_0x2eb460,'lastPauseAt':moment()[_0xed8e('0xa7')](_0xed8e('0xfa'))});}})[_0xed8e('0x1f')](function(_0x2a6f25){if(_0x2e1e2e[_0xed8e('0xff')]){return _0x451a3a();}else{return Promise[_0xed8e('0x100')](_0x2a6f25)[_0xed8e('0x1f')](respondWithResult(_0x50beba,null));}})[_0xed8e('0x4f')](handleError(_0x50beba,null));};exports['logout']=function(_0x306a70,_0x3be148){var _0x468899;return db[_0xed8e('0x40')][_0xed8e('0x2f')]({'where':{'id':_0x306a70[_0xed8e('0x51')]['id'],'role':_0xed8e('0x20')},'attributes':['id',_0xed8e('0x30'),_0xed8e('0x24')]})[_0xed8e('0x1f')](handleEntityNotFound(_0x3be148,null))[_0xed8e('0x1f')](function(_0x49ede0){if(_0x49ede0){_0x468899=_0x49ede0;return db['UserVoiceQueueRt'][_0xed8e('0x22')]({'where':{'membername':_0x468899[_0xed8e('0x30')]},'individualHooks':!![]});}})['then'](function(){return db[_0xed8e('0xf8')]['findAll']({'where':{'membername':_0x468899[_0xed8e('0x30')],'exitAt':null}});})[_0xed8e('0x1f')](function(_0x366361){var _0xda2113=[];_0x366361[_0xed8e('0xf9')](function(_0x3b72e8){_0xda2113[_0xed8e('0x46')](_0x3b72e8[_0xed8e('0x1e')]({'exitAt':moment()[_0xed8e('0xa7')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xed8e('0x57')](_0xda2113);})[_0xed8e('0x1f')](function(){return _0x468899[_0xed8e('0x1e')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xed8e('0x1f')](respondWithResult(_0x3be148,null))[_0xed8e('0x4f')](handleError(_0x3be148,null));};exports[_0xed8e('0x101')]=function(_0x54189e,_0x133fbe){var _0x40f4ee;return db['UserVoiceQueueRt'][_0xed8e('0x1e')]({'paused':0x1},{'where':{'UserId':_0x54189e[_0xed8e('0x51')]['id']},'individualHooks':!![]})[_0xed8e('0x1f')](function(){return db[_0xed8e('0x40')]['find']({'where':{'id':_0x54189e['params']['id'],'role':_0xed8e('0x20')},'attributes':['id',_0xed8e('0x30'),_0xed8e('0x24'),_0xed8e('0x5c'),_0xed8e('0x9c'),_0xed8e('0x9a')]});})[_0xed8e('0x1f')](handleEntityNotFound(_0x133fbe,null))[_0xed8e('0x1f')](function(_0x158cac){if(_0x158cac){_0x40f4ee=_0x158cac;return db['MemberReport'][_0xed8e('0x47')]({'where':{'membername':_0x40f4ee[_0xed8e('0x30')],'type':'PAUSE','exitAt':null}});}})[_0xed8e('0x1f')](function(_0x7dc7e7){if(_0x7dc7e7[_0xed8e('0x67')]){var _0x2200e1=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3ec100=0x0,_0x2a4857=_0x7dc7e7[_0xed8e('0x67')];_0x3ec100<_0x2a4857;_0x3ec100++){_0x7dc7e7[_0x3ec100][_0xed8e('0x102')]({'exitAt':_0x2200e1});}}})[_0xed8e('0x1f')](function(){var _0x435eac=[];var _0x423633=utils[_0xed8e('0xfb')]();_0x423633[_0xed8e('0xf9')](function(_0x39ca05){_0x435eac['push']({'channel':_0x39ca05,'membername':_0x40f4ee[_0xed8e('0x30')],'interface':_[_0xed8e('0x62')](_0x40f4ee[_0xed8e('0x9c')])?util[_0xed8e('0xa7')]('SIP/%s',_0x40f4ee[_0xed8e('0x30')]):_0x40f4ee[_0xed8e('0x9c')],'type':'PAUSE','enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x54189e['body'][_0xed8e('0x36')]||_0xed8e('0x103'),'role':_0x40f4ee[_0xed8e('0x24')],'internal':_0x40f4ee[_0xed8e('0x5c')]});});return db['MemberReport'][_0xed8e('0x104')](_0x435eac,{'individualHooks':!![]});})['then'](function(){return _0x40f4ee[_0xed8e('0x1e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x54189e[_0xed8e('0x58')][_0xed8e('0x36')]||_0xed8e('0x103'),'lastPauseAt':moment()[_0xed8e('0xa7')](_0xed8e('0xfa'))});})[_0xed8e('0x1f')](respondWithResult(_0x133fbe,null))[_0xed8e('0x4f')](handleError(_0x133fbe,null));};exports[_0xed8e('0x105')]=function(_0x23f096,_0xa864e8){if(_0x23f096[_0xed8e('0x58')][_0xed8e('0x99')]&&!utils[_0xed8e('0x9d')](_0x23f096[_0xed8e('0x58')][_0xed8e('0x99')])){throw new APIBadRequestError(util[_0xed8e('0xa7')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x23f096[_0xed8e('0x58')][_0xed8e('0x99')]));}return db[_0xed8e('0x40')][_0xed8e('0x2f')]({'where':{'id':_0x23f096[_0xed8e('0x51')]['id']},'attributes':['id',_0xed8e('0x30'),_0xed8e('0x24'),_0xed8e('0x5c'),_0xed8e('0x9c'),_0xed8e('0x9a'),'voicePause',_0xed8e('0x106'),_0xed8e('0x107'),_0xed8e('0x108'),_0xed8e('0x109'),_0xed8e('0x10a'),'whatsappPause',_0xed8e('0x10b'),_0xed8e('0x10c')]})[_0xed8e('0x1f')](function(_0x40e8ff){if(!_0x40e8ff){throw new APINotFoundError(util['format'](_0xed8e('0xc4'),_0x23f096['params']['id']));}return _0x40e8ff[_0xed8e('0x105')](_0x23f096[_0xed8e('0x58')][_0xed8e('0x99')]);})[_0xed8e('0x1f')](respondWithResult(_0xa864e8,null))['catch'](APIHandleError(_0xa864e8));};exports[_0xed8e('0x10d')]=function(_0x3a1a13,_0x833416){var _0x32fe7d={};var _0x507b85={};var _0x32b18f;var _0x14bc7a;return db[_0xed8e('0x40')][_0xed8e('0x94')]({'where':{'id':_0x3a1a13[_0xed8e('0x51')]['id']}})[_0xed8e('0x1f')](handleEntityNotFound(_0x833416,null))[_0xed8e('0x1f')](function(_0x525fd0){if(_0x525fd0){_0x32b18f=_0x525fd0;_0x507b85[_0xed8e('0xce')]=_[_0xed8e('0xcf')](db[_0xed8e('0x10e')]['rawAttributes']);_0x507b85[_0xed8e('0x41')]=_['keys'](_0x3a1a13['query']);_0x507b85[_0xed8e('0xd9')]=_['intersection'](_0x507b85['model'],_0x507b85['query']);_0x32fe7d['attributes']=_[_0xed8e('0xd1')](_0x507b85[_0xed8e('0xce')],qs[_0xed8e('0xd2')](_0x3a1a13[_0xed8e('0x41')][_0xed8e('0xd2')]));_0x32fe7d[_0xed8e('0x45')]=_0x32fe7d[_0xed8e('0x45')][_0xed8e('0x67')]?_0x32fe7d[_0xed8e('0x45')]:_0x507b85['model'];_0x32fe7d[_0xed8e('0xd3')]=qs[_0xed8e('0xd4')](_0x3a1a13['query'][_0xed8e('0xd4')]);_0x32fe7d[_0xed8e('0x3f')]=qs['filters'](_[_0xed8e('0xd5')](_0x3a1a13['query'],_0x507b85[_0xed8e('0xd9')]));if(_0x3a1a13[_0xed8e('0x41')][_0xed8e('0x2a')]){_0x32fe7d[_0xed8e('0x3f')]=_[_0xed8e('0x53')](_0x32fe7d[_0xed8e('0x3f')],{'$or':_[_0xed8e('0x2c')](_0x32fe7d[_0xed8e('0x45')],function(_0x11d1c7){var _0x7b2796={};_0x7b2796[_0x11d1c7]={'$like':'%'+_0x3a1a13['query']['filter']+'%'};return _0x7b2796;})});}_0x32fe7d=_[_0xed8e('0x53')]({},_0x32fe7d,_0x3a1a13['options']);return _0x32b18f['getTeams'](_0x32fe7d);}})[_0xed8e('0x1f')](function(_0x543091){if(_0x543091){_0x14bc7a=_0x543091[_0xed8e('0x67')];if(!_0x3a1a13['query'][_0xed8e('0xc5')]('nolimit')){_0x32fe7d[_0xed8e('0x1a')]=qs[_0xed8e('0x1a')](_0x3a1a13[_0xed8e('0x41')]['limit']);_0x32fe7d['offset']=qs['offset'](_0x3a1a13['query'][_0xed8e('0x18')]);}return _0x32b18f[_0xed8e('0x10d')](_0x32fe7d);}})[_0xed8e('0x1f')](function(_0x156a28){if(_0x156a28){return _0x156a28?{'count':_0x14bc7a,'rows':_0x156a28}:null;}})[_0xed8e('0x1f')](respondWithResult(_0x833416,null))[_0xed8e('0x4f')](handleError(_0x833416,null));};exports[_0xed8e('0x10f')]=function(_0x1ff546,_0x315662){var _0x37e3e0=_0x1ff546[_0xed8e('0x51')]['id'];var _0x1c5322=_0x1ff546[_0xed8e('0x58')]?_0x1ff546[_0xed8e('0x58')][_0xed8e('0x5b')]:null;var _0xaa9e8e=[];return Promise['resolve']()[_0xed8e('0x1f')](function(){if(!_0x1c5322)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0xed8e('0x1f')](function(){return db[_0xed8e('0x40')][_0xed8e('0x94')]({'where':{'id':_0x37e3e0}});})[_0xed8e('0x1f')](function(_0xe6a8a1){if(!_0xe6a8a1)throw new APINotFoundError(util[_0xed8e('0xa7')]('User\x20with\x20id\x20%s\x20not\x20found',_0x1ff546['params']['id']));return db[_0xed8e('0x64')]['transaction'](function(_0xb4ae4e){return _0xe6a8a1['addTeams'](_0x1c5322,{'transaction':_0xb4ae4e})[_0xed8e('0x1f')](function(){return db[_0xed8e('0x10e')][_0xed8e('0x47')]({'where':{'id':{'$in':_0x1c5322}}});})[_0xed8e('0x1f')](function(_0x4f3902){var _0x251e70=_[_0xed8e('0x2c')](_0x4f3902,function(_0x18c511){return _0x18c511[_0xed8e('0x110')]();});return Promise[_0xed8e('0x57')](_0x251e70);})[_0xed8e('0x1f')](function(_0x1ad167){_0xaa9e8e=_[_0xed8e('0x111')](_0x1ad167);var _0xf5893=_[_0xed8e('0x2c')](_0xaa9e8e,function(_0x2cb91c){return _0x2cb91c[_0xed8e('0x112')](_0xe6a8a1['id'],{'transaction':_0xb4ae4e});});return Promise[_0xed8e('0x57')](_0xf5893);})[_0xed8e('0x1f')](function(){if(!_0xe6a8a1[_0xed8e('0x9a')])return;var _0x27be6e=_[_0xed8e('0x2a')](_0xaa9e8e,function(_0x4ba61e){return _0x4ba61e[_0xed8e('0x113')]('channel')===_0xed8e('0x114');});var _0x1ec135=_[_0xed8e('0x2c')](_0x27be6e,function(_0x1e2781){return db['UserVoiceQueueRt'][_0xed8e('0xaa')]({'membername':_0xe6a8a1[_0xed8e('0x30')],'UserId':_0xe6a8a1['id'],'queue_name':_0x1e2781['name'],'VoiceQueueId':_0x1e2781['id'],'interface':_[_0xed8e('0x62')](_0xe6a8a1[_0xed8e('0x9c')])?util[_0xed8e('0xa7')]('SIP/%s',_0xe6a8a1[_0xed8e('0x30')]):_0xe6a8a1['interface'],'paused':_0xe6a8a1['voicePause']||![],'penalty':_0xe6a8a1[_0xed8e('0xa2')]},{'transaction':_0xb4ae4e});});return Promise[_0xed8e('0x57')](_0x1ec135);})[_0xed8e('0x1f')](function(){return db[_0xed8e('0x115')][_0xed8e('0x47')]({'where':{'teamId':{'$in':_0x1c5322}}});})[_0xed8e('0x1f')](function(_0x1ba029){var _0x4c2e01=_['map'](_0x1ba029,function(_0x3ea4a8){return db[_0xed8e('0x116')][_0xed8e('0x7b')]({'UserId':_0xe6a8a1['id'],'VoicePrefixId':_0x3ea4a8['VoicePrefixId']},{'transaction':_0xb4ae4e});});return Promise[_0xed8e('0x57')](_0x4c2e01);});});})['then'](function(){for(var _0x7bab5=0x0;_0x7bab5<_0xaa9e8e[_0xed8e('0x67')];_0x7bab5++){var _0x178ac9=_0xaa9e8e[_0x7bab5][_0xed8e('0x113')](_0xed8e('0x99'));var _0xa4580f=_0x178ac9+_0xed8e('0xa4');socket[_0xed8e('0x21')](_0xed8e('0x27')+_0x178ac9+_0xed8e('0xa5'),{'UserId':_0x37e3e0,['queueField']:_0xaa9e8e[_0x7bab5]['id']});}})[_0xed8e('0x1f')](respondWithStatusCode(_0x315662,null))[_0xed8e('0x4f')](APIHandleError(_0x315662));};exports[_0xed8e('0x117')]=function(_0x648fab,_0x32e320){var _0x2b9af4=_0x648fab[_0xed8e('0x51')]['id'];var _0x146883=null;if(_0x648fab[_0xed8e('0x41')][_0xed8e('0x5b')]){_0x146883=_[_0xed8e('0xad')](_0x648fab['query'][_0xed8e('0x5b')])?_0x648fab[_0xed8e('0x41')][_0xed8e('0x5b')]:[_0x648fab['query'][_0xed8e('0x5b')]];}var _0x34b552=[];return Promise[_0xed8e('0x100')]()[_0xed8e('0x1f')](function(){if(!_0x146883)throw new APIBadRequestError(_0xed8e('0x118'));})[_0xed8e('0x1f')](function(){return db['User'][_0xed8e('0x94')]({'where':{'id':_0x2b9af4}});})['then'](function(_0x2f92bc){if(!_0x2f92bc)throw new APINotFoundError(util[_0xed8e('0xa7')](_0xed8e('0xc4'),_0x648fab[_0xed8e('0x51')]['id']));return db[_0xed8e('0x64')][_0xed8e('0x119')](function(_0x1b3158){return _0x2f92bc[_0xed8e('0x117')](_0x146883,{'transaction':_0x1b3158})[_0xed8e('0x1f')](function(){return db[_0xed8e('0x10e')]['findAll']({'where':{'id':{'$in':_0x146883}}});})['then'](function(_0x194b8e){var _0x4e2a3b=_[_0xed8e('0x2c')](_0x194b8e,function(_0x27b851){return _0x27b851['getAssociatedQueues']();});return Promise[_0xed8e('0x57')](_0x4e2a3b);})['then'](function(_0x14654d){_0x34b552=_[_0xed8e('0x111')](_0x14654d);var _0x3d64e5=_[_0xed8e('0x2c')](_0x34b552,function(_0x4a085b){return _0x4a085b[_0xed8e('0x11a')](_0x2f92bc['id'],{'transaction':_0x1b3158});});return Promise['all'](_0x3d64e5);})[_0xed8e('0x1f')](function(){if(!_0x2f92bc[_0xed8e('0x9a')])return;var _0x3e3e00=_[_0xed8e('0x2a')](_0x34b552,function(_0x159e87){return _0x159e87[_0xed8e('0x113')](_0xed8e('0x99'))===_0xed8e('0x114');});var _0x3a9fc8=_[_0xed8e('0x2c')](_0x3e3e00,function(_0x553891){return db[_0xed8e('0xa9')][_0xed8e('0x22')]({'where':{'VoiceQueueId':_0x553891['id'],'UserId':_0x2f92bc['id']},'transaction':_0x1b3158});});return Promise[_0xed8e('0x57')](_0x3a9fc8);})[_0xed8e('0x1f')](function(){return db['TeamVoicePrefix'][_0xed8e('0x47')]({'where':{'teamId':{'$in':_0x146883}}});})['then'](function(_0x172261){var _0x478e0d=_[_0xed8e('0x2c')](_0x172261,function(_0x1f0cce){return db[_0xed8e('0x116')][_0xed8e('0x22')]({'where':{'UserId':_0x2f92bc['id'],'VoicePrefixId':_0x1f0cce[_0xed8e('0x11b')]}},{'transaction':_0x1b3158});});return Promise['all'](_0x478e0d);});});})[_0xed8e('0x1f')](function(){for(var _0x3efdfc=0x0;_0x3efdfc<_0x34b552['length'];_0x3efdfc++){var _0x365905=_0x34b552[_0x3efdfc]['getDataValue'](_0xed8e('0x99'));var _0x20d546=_0x365905+_0xed8e('0xa4');socket['emit'](_0xed8e('0x27')+_0x365905+'Queue:remove',{'UserId':_0x2b9af4,['queueField']:_0x34b552[_0x3efdfc]['id']});}})[_0xed8e('0x1f')](respondWithStatusCode(_0x32e320,null))[_0xed8e('0x4f')](APIHandleError(_0x32e320));};exports[_0xed8e('0x11c')]=function(_0x33426c,_0x15fc6c){var _0x5808b0={};var _0x380f6f={};var _0x55c5ba;var _0x500526;return db[_0xed8e('0x40')][_0xed8e('0x94')]({'where':{'id':_0x33426c['params']['id']}})[_0xed8e('0x1f')](handleEntityNotFound(_0x15fc6c,null))[_0xed8e('0x1f')](function(_0x32524b){if(_0x32524b){_0x55c5ba=_0x32524b;_0x380f6f[_0xed8e('0xce')]=_['keys'](db[_0xed8e('0xc7')][_0xed8e('0x34')]);_0x380f6f[_0xed8e('0x41')]=_[_0xed8e('0xcf')](_0x33426c[_0xed8e('0x41')]);_0x380f6f['filters']=_[_0xed8e('0xd1')](_0x380f6f[_0xed8e('0xce')],_0x380f6f[_0xed8e('0x41')]);_0x5808b0['attributes']=_['intersection'](_0x380f6f[_0xed8e('0xce')],qs[_0xed8e('0xd2')](_0x33426c[_0xed8e('0x41')]['fields']));_0x5808b0[_0xed8e('0x45')]=_0x5808b0['attributes']['length']?_0x5808b0[_0xed8e('0x45')]:_0x380f6f['model'];_0x5808b0[_0xed8e('0xd3')]=qs[_0xed8e('0xd4')](_0x33426c[_0xed8e('0x41')]['sort']);_0x5808b0[_0xed8e('0x3f')]=qs['filters'](_[_0xed8e('0xd5')](_0x33426c[_0xed8e('0x41')],_0x380f6f[_0xed8e('0xd9')]));if(_0x33426c[_0xed8e('0x41')][_0xed8e('0x2a')]){_0x5808b0[_0xed8e('0x3f')]=_[_0xed8e('0x53')](_0x5808b0[_0xed8e('0x3f')],{'$or':_[_0xed8e('0x2c')](_0x5808b0[_0xed8e('0x45')],function(_0x4da938){var _0x426a26={};_0x426a26[_0x4da938]={'$like':'%'+_0x33426c[_0xed8e('0x41')][_0xed8e('0x2a')]+'%'};return _0x426a26;})});}_0x5808b0=_[_0xed8e('0x53')]({},_0x5808b0,_0x33426c[_0xed8e('0xd6')]);return _0x55c5ba[_0xed8e('0x11c')](_0x5808b0);}})[_0xed8e('0x1f')](function(_0x5cd485){if(_0x5cd485){_0x500526=_0x5cd485['length'];if(!_0x33426c['query'][_0xed8e('0xc5')](_0xed8e('0xd7'))){_0x5808b0['limit']=qs['limit'](_0x33426c[_0xed8e('0x41')][_0xed8e('0x1a')]);_0x5808b0[_0xed8e('0x18')]=qs[_0xed8e('0x18')](_0x33426c[_0xed8e('0x41')]['offset']);}return _0x55c5ba[_0xed8e('0x11c')](_0x5808b0);}})[_0xed8e('0x1f')](function(_0x5f0f2c){if(_0x5f0f2c){return _0x5f0f2c?{'count':_0x500526,'rows':_0x5f0f2c}:null;}})[_0xed8e('0x1f')](respondWithResult(_0x15fc6c,null))['catch'](handleError(_0x15fc6c,null));};exports[_0xed8e('0x11d')]=function(_0x15efed,_0x2e357f){var _0x2d4d6f={};var _0x2b9e43={};var _0x2a3e16;return db[_0xed8e('0x40')]['findOne']({'where':{'id':_0x15efed[_0xed8e('0x51')]['id']}})[_0xed8e('0x1f')](handleEntityNotFound(_0x2e357f,null))[_0xed8e('0x1f')](function(_0x276d6a){if(_0x276d6a){_0x2a3e16=_0x276d6a;_0x2b9e43[_0xed8e('0xce')]=_[_0xed8e('0xcf')](db[_0xed8e('0x40')]['rawAttributes']);_0x2b9e43[_0xed8e('0x41')]=_[_0xed8e('0xcf')](_0x15efed[_0xed8e('0x41')]);_0x2b9e43[_0xed8e('0xd9')]=_[_0xed8e('0xd1')](_0x2b9e43['model'],_0x2b9e43[_0xed8e('0x41')]);_0x2d4d6f['attributes']=_[_0xed8e('0xd1')](_0x2b9e43[_0xed8e('0xce')],qs[_0xed8e('0xd2')](_0x15efed[_0xed8e('0x41')][_0xed8e('0xd2')]));_0x2d4d6f[_0xed8e('0x45')]=_0x2d4d6f[_0xed8e('0x45')]['length']?_0x2d4d6f[_0xed8e('0x45')]:_0x2b9e43[_0xed8e('0xce')];_0x2d4d6f['order']=qs[_0xed8e('0xd4')](_0x15efed[_0xed8e('0x41')]['sort']);_0x2d4d6f[_0xed8e('0x3f')]=qs[_0xed8e('0xd9')](_[_0xed8e('0xd5')](_0x15efed[_0xed8e('0x41')],_0x2b9e43[_0xed8e('0xd9')]));if(_0x15efed[_0xed8e('0x41')][_0xed8e('0x2a')]){_0x2d4d6f[_0xed8e('0x3f')]=_['merge'](_0x2d4d6f[_0xed8e('0x3f')],{'$or':_[_0xed8e('0x2c')](_0x2d4d6f[_0xed8e('0x45')],function(_0x49454f){var _0x1eac84={};_0x1eac84[_0x49454f]={'$like':'%'+_0x15efed[_0xed8e('0x41')][_0xed8e('0x2a')]+'%'};return _0x1eac84;})});}_0x2d4d6f[_0xed8e('0xce')]=db[_0xed8e('0x40')];_0x2d4d6f['as']=_0xed8e('0x28');_0x2d4d6f=_[_0xed8e('0x53')]({},_0x2d4d6f,_0x15efed[_0xed8e('0xd6')]);return _0x2a3e16['getVoiceQueues']({'include':[_0x2d4d6f]});}})[_0xed8e('0x1f')](function(_0x750498){if(_0x750498){var _0x1da897={},_0x1ce518=[];for(var _0x3e4023=0x0;_0x3e4023<_0x750498[_0xed8e('0x67')];_0x3e4023+=0x1){for(var _0x7b7040=0x0,_0x787ce9;_0x7b7040<_0x750498[_0x3e4023][_0xed8e('0x28')][_0xed8e('0x67')];_0x7b7040+=0x1){_0x787ce9=_0x750498[_0x3e4023]['Agents'][_0x7b7040][_0xed8e('0x23')]({'plain':!![]});_0x1da897[_0x787ce9['id']]=_0x787ce9;}}_0x1da897=_[_0xed8e('0x11e')](_0x1da897);for(var _0x488230=qs[_0xed8e('0x18')](_0x15efed[_0xed8e('0x41')][_0xed8e('0x18')]);_0x488230<_0x1da897['length']&&_0x1ce518[_0xed8e('0x67')]=_0x368729){_0x48e14f=_0x368729;_0x140ab3=0xc8;}else{_0x140ab3=0xce;}_0x138866['status'](_0x140ab3);return _0x138866[_0xab40('0x1b')](_0xab40('0x1c'),_0x591d0e+'-'+_0x48e14f+'/'+_0x368729)[_0xab40('0x16')](_0x4347fb);}return null;};}function saveUpdates(_0x5d01b8){return function(_0x31ec03){if(_0x31ec03){return _0x31ec03[_0xab40('0x1d')](_0x5d01b8)['then'](function(_0x486abc){if(_0x486abc[_0xab40('0x1e')]===_0xab40('0x1f')){socket[_0xab40('0x20')]('userNotification:recalc:'+_0x486abc['id'],_0x486abc);}return _0x486abc;});}return null;};}function removeEntity(_0x430c1e){return function(_0x3f5086){if(_0x3f5086){return _0x3f5086[_0xab40('0x21')]()[_0xab40('0x22')](function(){var _0x3518fa=_0x3f5086[_0xab40('0x23')]({'plain':!![]});if(_0x3518fa[_0xab40('0x1e')]===_0xab40('0x24'))return;var _0x328538=[{'name':_0xab40('0x25'),'value':_0xab40('0x26'),'ignore':!![]},{'name':_0xab40('0x27'),'value':_0xab40('0x1f'),'ignore':![]},{'name':'Telephones','value':_0xab40('0x28'),'ignore':![]}];var _0x5ce2e3=_(_0x328538)[_0xab40('0x29')](_0xab40('0x2a'))['map'](_0xab40('0x2b'))[_0xab40('0x2b')]();if(_['includes'](_0x5ce2e3,_0x3518fa[_0xab40('0x1e')])){return;}var _0x3e1c19=_['find'](_0x328538,[_0xab40('0x2b'),_0x3518fa['role']])[_0xab40('0x2c')];return db['UserProfileResource']['destroy']({'where':{'type':_0x3e1c19,'resourceId':_0x3518fa['id']}})[_0xab40('0x22')](function(){return _0x3f5086;});})['then'](function(){_0x430c1e[_0xab40('0x14')](0xcc)[_0xab40('0x15')]();});}};}function handleEntityNotFound(_0x59b0fa){return function(_0x2ea319){if(!_0x2ea319){_0x59b0fa['sendStatus'](0x194);}return _0x2ea319;};}function handleError(_0x1b5b56,_0x5405cc){_0x5405cc=_0x5405cc||0x1f4;return function(_0x3031c2){logger['error'](_0x3031c2[_0xab40('0x2d')]);if(_0x3031c2[_0xab40('0x2c')]){delete _0x3031c2[_0xab40('0x2c')];}_0x1b5b56[_0xab40('0x14')](_0x5405cc)[_0xab40('0x2e')](_0x3031c2);};}function getUserAttributes(){return _(db[_0xab40('0x2f')][_0xab40('0x30')])[_0xab40('0x31')](function(_0x4a81b7){return{'name':_0x4a81b7[_0xab40('0x32')],'type':_0x4a81b7['type'][_0xab40('0x33')]};})[_0xab40('0x29')](function(_0x5c361d){return![_0xab40('0x34'),_0xab40('0x35'),_0xab40('0x36'),_0xab40('0x37'),_0xab40('0x38'),_0xab40('0x39')]['includes'](_0x5c361d[_0xab40('0x2c')]);})[_0xab40('0x2b')]();}exports[_0xab40('0x3a')]=function(_0x186748,_0xdaa04f){var _0x19bf55={},_0x5b4e0d={'count':0x0,'rows':[]};var _0x3ab6b4=getUserAttributes();_0x19bf55=qs[_0xab40('0x3b')](_0x3ab6b4,_0x186748);var _0x530ee4={'where':_0x19bf55[_0xab40('0x3c')]};return db[_0xab40('0x2f')][_0xab40('0x18')](_0x530ee4)[_0xab40('0x22')](function(_0x2d0db2){_0x5b4e0d[_0xab40('0x18')]=_0x2d0db2;if(_0x186748[_0xab40('0x3d')][_0xab40('0x3e')]){_0x19bf55['include']=[{'all':!![]}];}if(_0x186748[_0xab40('0x3d')][_0xab40('0x3f')]===_0xab40('0x40')){_0x19bf55[_0xab40('0x41')]=[{'model':db[_0xab40('0x42')],'as':'userSetting'}];}if(!_['includes'](_0x19bf55[_0xab40('0x43')],'id')){_0x19bf55[_0xab40('0x43')][_0xab40('0x44')]('id');}return db[_0xab40('0x2f')][_0xab40('0x45')](_0x19bf55);})[_0xab40('0x22')](function(_0x2328ce){_0x5b4e0d[_0xab40('0x46')]=_0x2328ce;if(_0x186748[_0xab40('0x3d')][_0xab40('0x47')]==='true'){var _0x3c6fec=[];for(var _0xdf2b95=0x0;_0xdf2b95<_0x5b4e0d[_0xab40('0x46')][_0xab40('0x48')];_0xdf2b95++){_0x3c6fec[_0xab40('0x44')](get_open_tabs(_0xab40('0x49'),_0x5b4e0d[_0xab40('0x46')][_0xdf2b95][_0xab40('0x4a')]));_0x3c6fec[_0xab40('0x44')](get_open_tabs(_0xab40('0x4b'),_0x5b4e0d['rows'][_0xdf2b95][_0xab40('0x4a')]));_0x3c6fec['push'](get_open_tabs(_0xab40('0x4c'),_0x5b4e0d['rows'][_0xdf2b95][_0xab40('0x4a')]));_0x3c6fec[_0xab40('0x44')](get_open_tabs('mail',_0x5b4e0d[_0xab40('0x46')][_0xdf2b95][_0xab40('0x4a')]));_0x3c6fec[_0xab40('0x44')](get_open_tabs('openchannel',_0x5b4e0d['rows'][_0xdf2b95][_0xab40('0x4a')]));_0x3c6fec[_0xab40('0x44')](get_open_tabs(_0xab40('0x4d'),_0x5b4e0d[_0xab40('0x46')][_0xdf2b95][_0xab40('0x4a')]));}return Promise[_0xab40('0x4e')](_0x3c6fec)[_0xab40('0x22')](function(){return _0x5b4e0d;});}else{return _0x5b4e0d;}})[_0xab40('0x22')](respondWithFilteredResult(_0xdaa04f,_0x19bf55))[_0xab40('0x4f')](handleError(_0xdaa04f,null));};exports[_0xab40('0x50')]=function(_0x1f0d54,_0x5be84c){var _0x381a4f=getUserAttributes();_0x1f0d54['query']['id']=_0x1f0d54[_0xab40('0x51')]['id'];var _0x344618=qs['getOptions'](_0x381a4f,_0x1f0d54);if(_0x1f0d54[_0xab40('0x3d')][_0xab40('0x3e')]){_0x344618['include']=[{'all':!![]}];}if(_0x1f0d54[_0xab40('0x3d')][_0xab40('0x3f')]===_0xab40('0x40')){_0x344618[_0xab40('0x41')]=[{'model':db[_0xab40('0x42')],'as':_0xab40('0x3f')}];}_0x344618=_[_0xab40('0x52')]({},_0x344618,_0x1f0d54[_0xab40('0x53')]);if(!_[_0xab40('0x54')](_0x344618['attributes'],'id')){_0x344618[_0xab40('0x43')]['push']('id');}return db[_0xab40('0x2f')][_0xab40('0x55')](_0x344618)['then'](handleEntityNotFound(_0x5be84c,null))['then'](function(_0x8eda18){var _0x1fafef=[];values=_0x8eda18;if(_0x1f0d54[_0xab40('0x3d')]['openTabs']===_0xab40('0x40')){_0x1fafef[_0xab40('0x44')](get_open_tabs(_0xab40('0x49'),_0x8eda18['dataValues']));_0x1fafef[_0xab40('0x44')](get_open_tabs(_0xab40('0x4b'),_0x8eda18['dataValues']));_0x1fafef['push'](get_open_tabs('openchannel',_0x8eda18[_0xab40('0x4a')]));_0x1fafef[_0xab40('0x44')](get_open_tabs(_0xab40('0x4d'),_0x8eda18['dataValues']));_0x1fafef[_0xab40('0x44')](get_open_tabs(_0xab40('0x4c'),_0x8eda18['dataValues']));_0x1fafef[_0xab40('0x44')](get_open_tabs(_0xab40('0x56'),_0x8eda18[_0xab40('0x4a')]));return Promise['all'](_0x1fafef);}else{return values;}})[_0xab40('0x22')](function(){return values;})[_0xab40('0x22')](respondWithResult(_0x5be84c,null))[_0xab40('0x4f')](handleError(_0x5be84c,null));};exports[_0xab40('0x1d')]=function(_0x5dbfa5,_0x3911d3){if(_0x5dbfa5[_0xab40('0x57')]['id']){delete _0x5dbfa5['body']['id'];}delete _0x5dbfa5['body'][_0xab40('0x1e')];return db[_0xab40('0x2f')][_0xab40('0x55')]({'where':{'id':_0x5dbfa5['params']['id']}})[_0xab40('0x22')](handleEntityNotFound(_0x3911d3,null))[_0xab40('0x22')](saveUpdates(_0x5dbfa5[_0xab40('0x57')],null))[_0xab40('0x22')](respondWithResult(_0x3911d3,null))[_0xab40('0x4f')](handleError(_0x3911d3,null));};exports['describe']=function(_0xf2eeba,_0x28636e){return db[_0xab40('0x2f')][_0xab40('0x58')]()['then'](respondWithResult(_0x28636e,null))[_0xab40('0x4f')](handleError(_0x28636e,null));};exports[_0xab40('0x59')]=function(_0x2fe589,_0x2d90d7){return db['User'][_0xab40('0x55')]({'where':{'id':_0x2fe589[_0xab40('0x51')]['id']}})['then'](handleEntityNotFound(_0x2d90d7,null))[_0xab40('0x22')](function(_0x562e42){if(_0x562e42){return _0x562e42[_0xab40('0x59')](_0x2fe589[_0xab40('0x57')][_0xab40('0x5a')],_[_0xab40('0x5b')](_0x2fe589[_0xab40('0x57')],[_0xab40('0x5a'),'id'])||{});}})[_0xab40('0x22')](respondWithResult(_0x2d90d7,null))[_0xab40('0x4f')](handleError(_0x2d90d7,null));};function validateUser(_0x1b81fa){return new Promise(function(_0x437ab6,_0x46568d){if(_0x1b81fa[_0xab40('0x5c')])return _0x437ab6(_0x1b81fa);return db['Setting']['findById'](0x1)[_0xab40('0x22')](function(_0x3cf231){if(_0x3cf231['securePassword'])authService[_0xab40('0x5d')](_0x1b81fa[_0xab40('0x34')]);db['User']['max'](_0xab40('0x5c'))['then'](function(_0x35a9ec){if(_[_0xab40('0x5e')](_0x35a9ec)){_0x1b81fa[_0xab40('0x5c')]=_0x3cf231[_0xab40('0x5f')]||0x1;return;}if(_['isNil'](_0x3cf231[_0xab40('0x5f')])||_0x3cf231[_0xab40('0x5f')]===_0x35a9ec){_0x1b81fa[_0xab40('0x5c')]=_0x35a9ec+0x1;return;}if(_0x3cf231[_0xab40('0x5f')]>_0x35a9ec){_0x1b81fa[_0xab40('0x5c')]=_0x3cf231['min_internal'];return;}return db['sequelize'][_0xab40('0x3d')](_0xab40('0x60'),{'type':db[_0xab40('0x61')][_0xab40('0x62')][_0xab40('0x63')]})[_0xab40('0x22')](function(_0x87669e){if(_0x87669e&&_0x87669e[_0xab40('0x48')]){for(var _0x32e7ba=0x0,_0x27a52d=_0x87669e[_0xab40('0x48')];_0x32e7ba<_0x27a52d&&_[_0xab40('0x5e')](_0x1b81fa['internal']);_0x32e7ba++){if(_0x3cf231['min_internal']<=_0x87669e[_0x32e7ba]['from']){_0x1b81fa['internal']=_0x87669e[_0x32e7ba][_0xab40('0x64')];}else if(_0x3cf231[_0xab40('0x5f')]>_0x87669e[_0x32e7ba][_0xab40('0x64')]&&_0x3cf231['min_internal']<=_0x87669e[_0x32e7ba]['to']){_0x1b81fa['internal']=_0x3cf231['min_internal'];}}}if(_[_0xab40('0x5e')](_0x1b81fa[_0xab40('0x5c')])){_0x1b81fa[_0xab40('0x5c')]=_0x35a9ec+0x1;}return _0x437ab6(_0x1b81fa);});});})[_0xab40('0x4f')](function(_0x1bbc5e){_0x46568d(_0x1bbc5e);});});}function updateUser(_0x37f038){return new Promise(function(_0x3bac1e,_0x4a6280){try{if(_0x37f038[_0xab40('0x65')]){_0x37f038[_0xab40('0x66')]=_0x37f038[_0xab40('0x5c')];_0x37f038['VoiceMail']={'mailbox':_0x37f038[_0xab40('0x5c')],'password':_0x37f038['password'],'fullname':_0x37f038[_0xab40('0x67')],'email':_0x37f038['email']};}if(_0x37f038['role']==='agent'){if(!_0x37f038[_0xab40('0x68')])_0x37f038[_0xab40('0x68')]=[_0xab40('0x69'),'102','103','113',_0xab40('0x6a'),_0xab40('0x6b'),_0xab40('0x6c'),_0xab40('0x6d'),_0xab40('0x6e'),_0xab40('0x6f'),_0xab40('0x70'),_0xab40('0x71'),'111',_0xab40('0x72'),'115'];}_0x3bac1e(_0x37f038);}catch(_0x467514){_0x4a6280(_0x467514);}});}exports[_0xab40('0x73')]=function(_0x3cde29,_0x57b6df){if(_0x3cde29[_0xab40('0x26')][_0xab40('0x1e')]===_0xab40('0x1f'))throw new Error(_0xab40('0x74'));if(_0x3cde29[_0xab40('0x57')]['role']==='user'&&_0x3cde29['user'][_0xab40('0x1e')]!==_0xab40('0x24')){throw new Error(_0xab40('0x75'));}if(_0x3cde29[_0xab40('0x57')][_0xab40('0x1e')]==='admin'&&_0x3cde29[_0xab40('0x26')][_0xab40('0x1e')]!=='admin'){throw new Error(_0xab40('0x76'));}return licenseUtil[_0xab40('0x77')]([_0x3cde29['body']])[_0xab40('0x22')](function(){return validateUser(_0x3cde29['body']);})[_0xab40('0x22')](function(_0x13bf5c){return updateUser(_0x13bf5c)['then'](function(_0x357e6a){if(_0x357e6a[_0xab40('0x1e')]==='admin'){_0x357e6a['settingsEnabled']=_0x3cde29[_0xab40('0x26')][_0xab40('0x78')];delete _0x357e6a[_0xab40('0x79')];}return _0x357e6a;});})['then'](function(_0x3973b8){return db['User'][_0xab40('0x73')](_0x3973b8,{'include':[{'model':db[_0xab40('0x7a')],'as':_0xab40('0x7a')}]});})['then'](function(_0x369fe5){if(_0x3cde29['body']['role']===_0xab40('0x26'))return _0x369fe5;if(_0x3cde29[_0xab40('0x26')][_0xab40('0x1e')]!=='user')return _0x369fe5;return db[_0xab40('0x7b')]['find']({'where':{'name':_0x369fe5[_0xab40('0x1e')]==='agent'?_0xab40('0x27'):_0xab40('0x7c'),'userProfileId':_0x3cde29[_0xab40('0x26')][_0xab40('0x79')]},'raw':!![]})[_0xab40('0x22')](function(_0x48aa9c){if(!_0x48aa9c||_0x48aa9c[_0xab40('0x7d')]!=0x0)return _0x369fe5;return db[_0xab40('0x7e')][_0xab40('0x73')]({'name':_0x369fe5['name'],'resourceId':_0x369fe5['id'],'type':_0x48aa9c[_0xab40('0x2c')],'sectionId':_0x48aa9c['id']},{})[_0xab40('0x22')](function(){return _0x369fe5;});})[_0xab40('0x4f')](function(_0x43e31c){logger['error'](_0xab40('0x7f'),_0x43e31c);throw _0x43e31c;});})[_0xab40('0x22')](respondWithResult(_0x57b6df,0xc9))[_0xab40('0x4f')](handleError(_0x57b6df,null));};exports[_0xab40('0x80')]=function(_0x2039cb,_0x34266b){var _0x51f216=_0x2039cb[_0xab40('0x57')];var _0x2384ba=[];if(_0x2039cb[_0xab40('0x26')]['role']===_0xab40('0x1f'))throw new Error('Unauthorized');if(_[_0xab40('0x81')](_0x51f216,[_0xab40('0x1e'),_0xab40('0x26')])&&_0x2039cb[_0xab40('0x26')]['role']!==_0xab40('0x24')){throw new Error(_0xab40('0x75'));}if(_[_0xab40('0x81')](_0x51f216,[_0xab40('0x1e'),'admin'])&&_0x2039cb[_0xab40('0x26')][_0xab40('0x1e')]!==_0xab40('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xab40('0x77')](_0x51f216)[_0xab40('0x22')](function(){return validateUser(_0x51f216[0x0]);})['then'](function(){for(var _0x2d6790=0x1;_0x2d6790<_0x51f216['length'];_0x2d6790++){var _0x2ba69f=_0x51f216[_0x2d6790-0x1]['internal'];if(!_0x51f216[_0x2d6790][_0xab40('0x5c')])_0x51f216[_0x2d6790][_0xab40('0x5c')]=_0x2ba69f+0x1;_0x2384ba[_0xab40('0x44')](validateUser(_0x51f216[_0x2d6790]));}return Promise[_0xab40('0x4e')](_0x2384ba);})[_0xab40('0x22')](function(){_0x2384ba=[];for(var _0x441b33=0x0;_0x441b33<_0x51f216[_0xab40('0x48')];_0x441b33++){_0x2384ba['push'](updateUser(_0x51f216[_0x441b33]));}return Promise[_0xab40('0x4e')](_0x2384ba);})['then'](function(){_0x2384ba=_0x51f216['map'](function(_0x21f0df){return db['User'][_0xab40('0x73')](_0x21f0df,{'include':[{'model':db['VoiceMail'],'as':_0xab40('0x7a')}]})['then'](function(_0x414592){_0x21f0df['id']=_0x414592['id'];return _0x21f0df;});});return Promise[_0xab40('0x4e')](_0x2384ba);})['then'](function(_0x34d2c9){if(_0x2039cb[_0xab40('0x57')]['role']===_0xab40('0x26'))return _0x34d2c9;if(_0x2039cb[_0xab40('0x26')][_0xab40('0x1e')]!==_0xab40('0x26'))return _0x34d2c9;var _0x4508fa=_[_0xab40('0x81')](_0x34d2c9,function(_0x5aa4d2){return _0x5aa4d2[_0xab40('0x1e')]==='agent'||_0x5aa4d2[_0xab40('0x1e')]==='telephone';});if(!_0x4508fa)return _0x34d2c9;return db[_0xab40('0x7b')][_0xab40('0x45')]({'where':{'name':{'$or':['Agents',_0xab40('0x7c')]},'userProfileId':_0x2039cb[_0xab40('0x26')][_0xab40('0x79')]},'raw':!![]})[_0xab40('0x22')](function(_0x4e6de0){if(_[_0xab40('0x82')](_0x4e6de0)||!_['some'](_0x4e6de0,[_0xab40('0x7d'),0x0]))return _0x34d2c9;_0x2384ba=[];var _0x5029bb=_(_0x4e6de0)[_0xab40('0x31')](function(_0xea6bf1){if(_0xea6bf1[_0xab40('0x7d')]===0x1)return;return _0xea6bf1[_0xab40('0x2c')]===_0xab40('0x27')?'agent':_0xab40('0x28');})[_0xab40('0x83')]()[_0xab40('0x2b')]();for(var _0x9d9a3a=0x0;_0x9d9a3a<_0x34d2c9[_0xab40('0x48')];_0x9d9a3a++){if(!_[_0xab40('0x54')](_0x5029bb,_0x34d2c9[_0x9d9a3a][_0xab40('0x1e')]))return;var _0x3818da=_0x34d2c9[_0x9d9a3a][_0xab40('0x1e')]===_0xab40('0x1f')?_0xab40('0x27'):_0xab40('0x7c');_0x2384ba['push'](db[_0xab40('0x7e')]['create']({'name':_0x34d2c9[_0x9d9a3a][_0xab40('0x2c')],'resourceId':_0x34d2c9[_0x9d9a3a]['id'],'type':_0x3818da,'sectionId':_[_0xab40('0x55')](_0x4e6de0,[_0xab40('0x2c'),_0x3818da])['id']},{}));}return Promise[_0xab40('0x4e')](_0x2384ba);});})[_0xab40('0x22')](respondWithResult(_0x34266b,0xc9))[_0xab40('0x4f')](handleError(_0x34266b,null));};exports[_0xab40('0x84')]=function(_0x2667d9,_0x46386d){if(_0x2667d9[_0xab40('0x57')]['id']){delete _0x2667d9[_0xab40('0x57')]['id'];}return db[_0xab40('0x2f')][_0xab40('0x55')]({'where':{'id':_0x2667d9[_0xab40('0x51')]['id']}})['then'](function(_0x19daaf){if(!_0x19daaf)return null;if(_0x19daaf['id']===_0x2667d9[_0xab40('0x26')]['id']){if(!_0x2667d9['body'][_0xab40('0x85')]||!_0x2667d9[_0xab40('0x57')][_0xab40('0x86')]){throw new db['Sequelize'][(_0xab40('0x87'))](_0xab40('0x88'));}if(!_0x19daaf[_0xab40('0x89')](_0x2667d9[_0xab40('0x57')][_0xab40('0x85')])){throw new db[(_0xab40('0x8a'))]['ValidationError'](_0xab40('0x8b'));}if(_0x2667d9[_0xab40('0x57')][_0xab40('0x85')]===_0x2667d9['body']['newPassword']){throw new db[(_0xab40('0x8a'))][(_0xab40('0x87'))](_0xab40('0x8c'));}}else if(_0x2667d9[_0xab40('0x26')][_0xab40('0x1e')]==='admin'){if(!_0x2667d9['body'][_0xab40('0x86')]){throw new db[(_0xab40('0x8a'))][(_0xab40('0x87'))](_0xab40('0x8d'));}}else if(_0x2667d9[_0xab40('0x26')][_0xab40('0x1e')]===_0xab40('0x26')){if(!_0x2667d9['body']['newPassword']){throw new db[(_0xab40('0x8a'))][(_0xab40('0x87'))](_0xab40('0x8d'));}if(_0x19daaf['role']!==_0xab40('0x1f')){throw new db[(_0xab40('0x8a'))][(_0xab40('0x87'))](_0xab40('0x74'));}}else{throw new db[(_0xab40('0x8a'))][(_0xab40('0x87'))](_0xab40('0x74'));}return _0x19daaf;})['then'](handleEntityNotFound(_0x46386d,null))[_0xab40('0x22')](function(_0x469f05){return db['Setting'][_0xab40('0x8e')]({'attributes':['id',_0xab40('0x8f'),_0xab40('0x90'),_0xab40('0x91')]})[_0xab40('0x22')](function(_0x379e1d){if(_0x379e1d[_0xab40('0x8f')])authService[_0xab40('0x5d')](_0x2667d9[_0xab40('0x57')][_0xab40('0x86')]);if(!_0x379e1d[_0xab40('0x90')]||!_0x469f05[_0xab40('0x36')])return _0x469f05;authService[_0xab40('0x92')](_0x2667d9[_0xab40('0x57')][_0xab40('0x86')],_0x469f05[_0xab40('0x36')],_0x379e1d[_0xab40('0x91')]);return _0x469f05;})[_0xab40('0x22')](saveUpdates({'password':_0x2667d9[_0xab40('0x57')]['newPassword'],'passwordResetAt':_0x2667d9[_0xab40('0x26')]['id']==_0x2667d9['params']['id']?moment():null,'previousPasswords':authService[_0xab40('0x93')](_0x2667d9[_0xab40('0x57')][_0xab40('0x86')],_0x469f05['previousPasswords'])},null));})[_0xab40('0x22')](respondWithResult(_0x46386d,null))[_0xab40('0x4f')](handleError(_0x46386d,null));};exports['addQueues']=function(_0xa355e6,_0x1c4e33){var _0x32485e=_0xa355e6[_0xab40('0x57')][_0xab40('0x94')];return db['User'][_0xab40('0x55')]({'where':{'id':_0xa355e6[_0xab40('0x51')]['id']},'attributes':['id',_0xab40('0x2c'),_0xab40('0x1e'),_0xab40('0x95'),_0xab40('0x96'),_0xab40('0x97'),_0xab40('0x98')]})[_0xab40('0x22')](handleEntityNotFound(_0x1c4e33,null))[_0xab40('0x22')](function(_0x55dfac){if(_0x55dfac){if(!utils[_0xab40('0x99')](_0x32485e)){throw new db['Sequelize'][(_0xab40('0x87'))](_0xab40('0x9a'));}return _0x55dfac['add'+_[_0xab40('0x9b')](_0x32485e[_0xab40('0x9c')]())+'Queues'](_0xa355e6[_0xab40('0x57')][_0xab40('0x5a')],{'penalty':_0xa355e6[_0xab40('0x57')][_0xab40('0x9d')]||0x0})[_0xab40('0x9e')](function(_0x169410){for(var _0x514b4e=0x0;_0x514b4e<_0xa355e6[_0xab40('0x57')][_0xab40('0x5a')]['length'];_0x514b4e+=0x1){var _0x4fa08f={'UserId':Number(_0xa355e6[_0xab40('0x51')]['id'])};_0x4fa08f[_[_0xab40('0x9b')](_0x32485e[_0xab40('0x9c')]())+_0xab40('0x9f')]=Number(_0xa355e6[_0xab40('0x57')][_0xab40('0x5a')][_0x514b4e]);socket[_0xab40('0x20')]('user'+_[_0xab40('0x9b')](_0x32485e['toLowerCase']())+_0xab40('0xa0'),_0x4fa08f);}return _0x169410;})[_0xab40('0x22')](function(){if(_0x32485e===_0xab40('0xa1')){return db[_0xab40('0xa2')]['findAll']({'where':{'id':_0xa355e6[_0xab40('0x57')][_0xab40('0x5a')]||[]},'raw':!![],'attributes':['id',_0xab40('0x2c')]});}})[_0xab40('0x22')](function(_0x4de6a5){var _0x41b306=_0x55dfac[_0xab40('0x23')]({'plain':!![]});var _0x47c490=[];if(_0x32485e===_0xab40('0xa1')&&_0x41b306[_0xab40('0x1e')]===_0xab40('0x1f')&&_0x41b306[_0xab40('0x95')]){for(let _0x36048f=0x0;_0x36048f<_0x4de6a5[_0xab40('0x48')];_0x36048f+=0x1){_0x47c490[_0xab40('0x44')]({'membername':_0x41b306[_0xab40('0x2c')],'UserId':_0x41b306['id'],'queue_name':_0x4de6a5[_0x36048f][_0xab40('0x2c')],'VoiceQueueId':_0x4de6a5[_0x36048f]['id'],'interface':_['isNil'](_0x41b306[_0xab40('0x98')])?util[_0xab40('0xa3')](_0xab40('0xa4'),_0x41b306[_0xab40('0x2c')]):_0x41b306[_0xab40('0x98')],'paused':_0x41b306[_0xab40('0x97')]||![],'penalty':_0xa355e6[_0xab40('0x57')][_0xab40('0x9d')]||0x0});}return Promise[_0xab40('0x4e')](_0x47c490[_0xab40('0x31')](function(_0x460377){return db[_0xab40('0xa5')][_0xab40('0xa6')](_0x460377);}));}return _0x55dfac;});}})['then'](respondWithStatusCode(_0x1c4e33,null))[_0xab40('0x4f')](handleError(_0x1c4e33,null));};exports[_0xab40('0xa7')]=function(_0x887fb7,_0xf82d46){var _0x508139,_0x359d9d;return db[_0xab40('0x2f')][_0xab40('0x55')]({'where':{'id':_0x887fb7[_0xab40('0x51')]['id']},'attributes':['id',_0xab40('0x2c'),_0xab40('0x1e')]})[_0xab40('0x22')](handleEntityNotFound(_0xf82d46,null))[_0xab40('0x22')](function(_0x10de3f){if(_0x10de3f){_0x508139=_0x10de3f;if(!_0x887fb7[_0xab40('0x3d')][_0xab40('0x94')]||!utils[_0xab40('0x99')](_0x887fb7[_0xab40('0x3d')]['channel'])){throw new db['Sequelize'][(_0xab40('0x87'))](_0xab40('0x9a'));}return _0x10de3f[_0xab40('0xa8')+_[_0xab40('0x9b')](_0x887fb7[_0xab40('0x3d')]['channel'][_0xab40('0x9c')]())+_0xab40('0xa9')](_0x887fb7[_0xab40('0x3d')][_0xab40('0x5a')]);}})[_0xab40('0x22')](function(_0x400cf6){if(_[_0xab40('0xaa')](_0x887fb7[_0xab40('0x3d')][_0xab40('0x5a')])){for(var _0x20ef38=0x0;_0x20ef38<_0x887fb7[_0xab40('0x3d')][_0xab40('0x5a')][_0xab40('0x48')];_0x20ef38+=0x1){_0x359d9d={'UserId':Number(_0x887fb7['params']['id'])};_0x359d9d[_['capitalize'](_0x887fb7['query'][_0xab40('0x94')][_0xab40('0x9c')]())+'QueueId']=Number(_0x887fb7[_0xab40('0x3d')]['ids'][_0x20ef38]);socket['emit'](_0xab40('0x26')+_[_0xab40('0x9b')](_0x887fb7[_0xab40('0x3d')][_0xab40('0x94')]['toLowerCase']())+'Queue:remove',_0x359d9d);}}else{_0x359d9d={'UserId':Number(_0x887fb7[_0xab40('0x51')]['id'])};_0x359d9d[_['capitalize'](_0x887fb7['query']['channel'][_0xab40('0x9c')]())+_0xab40('0x9f')]=Number(_0x887fb7['query']['ids']);socket[_0xab40('0x20')](_0xab40('0x26')+_['capitalize'](_0x887fb7[_0xab40('0x3d')][_0xab40('0x94')][_0xab40('0x9c')]())+'Queue:remove',_0x359d9d);}return _0x400cf6;})['then'](function(){if(_0x887fb7['query']['channel']===_0xab40('0xa1')){return db['UserVoiceQueueRt'][_0xab40('0x21')]({'where':{'UserId':_0x887fb7[_0xab40('0x51')]['id'],'VoiceQueueId':_0x887fb7[_0xab40('0x3d')][_0xab40('0x5a')]},'individualHooks':!![]})[_0xab40('0x22')](function(){return _0x508139;});}return _0x508139;})[_0xab40('0x22')](respondWithStatusCode(_0xf82d46,null))[_0xab40('0x4f')](handleError(_0xf82d46,null));};exports['addAvatar']=function(_0x5eae2b,_0x5742fe){_0x5eae2b[_0xab40('0x57')][_0xab40('0xab')]=_0x5eae2b[_0xab40('0xac')][_0xab40('0xad')];return db['User'][_0xab40('0x55')]({'where':{'id':_0x5eae2b['params']['id']}})['then'](handleEntityNotFound(_0x5742fe,null))[_0xab40('0x22')](saveUpdates(_0x5eae2b[_0xab40('0x57')],null))[_0xab40('0x22')](respondWithResult(_0x5742fe,null))['catch'](handleError(_0x5742fe,null));};exports[_0xab40('0xae')]=function(_0x535422,_0x2f2097){var _0x4fa6b0=path[_0xab40('0xaf')](config[_0xab40('0xb0')],'server/files/images/logos/default_profile.png');return db[_0xab40('0x2f')][_0xab40('0x55')]({'where':{'id':_0x535422[_0xab40('0x51')]['id']},'attributes':['id',_0xab40('0xab')],'raw':!![]})[_0xab40('0x22')](handleEntityNotFound(_0x2f2097,null))['then'](function(_0xff68b6){if(_0xff68b6){if(_[_0xab40('0x5e')](_0xff68b6[_0xab40('0xab')])){return _0x2f2097['download'](_0x4fa6b0);}else{if(!fs[_0xab40('0xb1')](path[_0xab40('0xaf')](config[_0xab40('0xb0')],'server/files/images/',_0xff68b6[_0xab40('0xab')]))){return _0x2f2097['download'](_0x4fa6b0);}return _0x2f2097[_0xab40('0xb2')](path[_0xab40('0xaf')](config[_0xab40('0xb0')],_0xab40('0xb3'),_0xff68b6[_0xab40('0xab')]));}}})['catch'](handleError(_0x2f2097,null));};exports['getOpenTabs']=function(_0x4dd055,_0x254540){return db[_0xab40('0x2f')]['find']({'where':{'id':_0x4dd055[_0xab40('0x51')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x254540,null))[_0xab40('0x22')](function(_0x21bb7c){var _0x100bf3=[];values=_0x21bb7c[_0xab40('0x4a')];_0x100bf3[_0xab40('0x44')](get_open_tabs(_0xab40('0x49'),_0x21bb7c['dataValues']));_0x100bf3[_0xab40('0x44')](get_open_tabs(_0xab40('0x4b'),_0x21bb7c[_0xab40('0x4a')]));_0x100bf3['push'](get_open_tabs(_0xab40('0xb4'),_0x21bb7c[_0xab40('0x4a')]));_0x100bf3['push'](get_open_tabs('whatsapp',_0x21bb7c[_0xab40('0x4a')]));_0x100bf3[_0xab40('0x44')](get_open_tabs(_0xab40('0x4c'),_0x21bb7c[_0xab40('0x4a')]));_0x100bf3['push'](get_open_tabs(_0xab40('0x56'),_0x21bb7c[_0xab40('0x4a')]));return Promise[_0xab40('0x4e')](_0x100bf3);})[_0xab40('0x22')](function(_0x378fd1){if(_0x378fd1){var _0x17091b=_['map'](values['ChatOpenTabs'],function(_0x470509){return{'channel':_0xab40('0xb5'),'id':_0x470509['id'],'createdAt':_0x470509['createdAt']};});var _0x11e9ec=_[_0xab40('0x31')](values[_0xab40('0xb6')],function(_0x3055da){return{'channel':_0xab40('0xb7'),'id':_0x3055da['id'],'createdAt':_0x3055da[_0xab40('0xb8')]};});var _0x5eeac7=_['map'](values[_0xab40('0xb9')],function(_0x33feff){return{'channel':_0xab40('0xba'),'id':_0x33feff['id'],'createdAt':_0x33feff[_0xab40('0xb8')]};});var _0xbde0b9=_[_0xab40('0x31')](values[_0xab40('0xbb')],function(_0x3bf79b){return{'channel':'MAIL','id':_0x3bf79b['id'],'createdAt':_0x3bf79b[_0xab40('0xb8')]};});var _0x256bfd=_['map'](values[_0xab40('0xbc')],function(_0x3ba807){return{'channel':_0xab40('0xbd'),'id':_0x3ba807['id'],'createdAt':_0x3ba807['createdAt']};});var _0x2196f7=_['map'](values['WhatsappOpenTabs'],function(_0x580ad2){return{'channel':_0xab40('0xbe'),'id':_0x580ad2['id'],'createdAt':_0x580ad2[_0xab40('0xb8')]};});var _0x504c6d=_[_0xab40('0xbf')](_0x17091b,_0x11e9ec,_0x5eeac7,_0xbde0b9,_0x256bfd,_0x2196f7);var _0x5de4c0={'count':_0x504c6d[_0xab40('0x48')],'rows':_0x504c6d};return _0x5de4c0;}else return null;})[_0xab40('0x22')](respondWithResult(_0x254540,null))[_0xab40('0x4f')](handleError(_0x254540,null));};exports[_0xab40('0xc0')]=function(_0x1f6fa6,_0x18d2af){var _0x346b5a={};return db[_0xab40('0x2f')][_0xab40('0x8e')]({'where':{'id':_0x1f6fa6[_0xab40('0x51')]['id']}})[_0xab40('0x22')](function(_0x3adebe){if(!_0x3adebe){throw new APINotFoundError(util[_0xab40('0xa3')](_0xab40('0xc1'),_0x1f6fa6[_0xab40('0x51')]['id']));}return contacts[_0xab40('0x58')]();})['then'](function(_0x21ce10){_0x1f6fa6[_0xab40('0x3d')][_0xab40('0x2f')]=_0x1f6fa6[_0xab40('0x51')]['id'];_0x346b5a=qs['getOptions'](_0x21ce10,_0x1f6fa6);if(_0x1f6fa6['query'][_0xab40('0xc2')](_0xab40('0x3e'))){_0x346b5a[_0xab40('0x41')]=[{'model':db[_0xab40('0xc3')],'as':_0xab40('0xc4'),'required':![]},{'model':db[_0xab40('0xc5')],'as':_0xab40('0xc6'),'attributes':['id',_0xab40('0x2c'),_0xab40('0xc7')],'where':_0x1f6fa6[_0xab40('0x3d')][_0xab40('0xc8')]?{'id':_0x1f6fa6[_0xab40('0x3d')][_0xab40('0xc8')]}:undefined,'required':_0x1f6fa6['query'][_0xab40('0xc8')]?!![]:![]}];}return contacts[_0xab40('0x45')](_0x1f6fa6['query'],_0x1f6fa6[_0xab40('0x26')],_0x346b5a,_0x21ce10);})[_0xab40('0x22')](respondWithFilteredResult(_0x18d2af,_0x346b5a))[_0xab40('0x4f')](APIHandleError(_0x18d2af));};exports[_0xab40('0xc9')]=function(_0x2d86ad,_0xb8384b){var _0x403ca4;var _0x187aa8={};var _0x29841e;return db['User'][_0xab40('0x8e')]({'where':{'id':_0x2d86ad[_0xab40('0x51')]['id']},'attributes':['id',_0xab40('0x2c'),_0xab40('0x1e')]})[_0xab40('0x22')](handleEntityNotFound(_0xb8384b,null))[_0xab40('0x22')](function(_0x2cb649){if(!utils[_0xab40('0x99')](_0x2d86ad[_0xab40('0x3d')]['channel'])){throw new db[(_0xab40('0x8a'))][(_0xab40('0x87'))](_0xab40('0x9a'));}_0x403ca4=_0x2cb649;var _0x2e83c6={};_0x2e83c6[_0xab40('0xca')]=_[_0xab40('0xcb')](db[_['capitalize'](_0x2d86ad['query'][_0xab40('0x94')])+_0xab40('0xcc')][_0xab40('0x30')]);_0x2e83c6[_0xab40('0x3d')]=_[_0xab40('0xcb')](_0x2d86ad['query']);_0x2e83c6[_0xab40('0xcd')]=_['intersection'](_0x2e83c6[_0xab40('0xca')],_0x2e83c6[_0xab40('0x3d')]);_0x187aa8[_0xab40('0x43')]=_[_0xab40('0xce')](_0x2e83c6['model'],qs[_0xab40('0xcf')](_0x2d86ad['query'][_0xab40('0xcf')]));_0x187aa8['attributes']=_0x187aa8[_0xab40('0x43')][_0xab40('0x48')]?_0x187aa8['attributes']:_0x2e83c6['model'];_0x187aa8['order']=qs[_0xab40('0xd0')](_0x2d86ad[_0xab40('0x3d')][_0xab40('0xd0')]);_0x187aa8[_0xab40('0x3c')]=qs[_0xab40('0xcd')](_[_0xab40('0xd1')](_0x2d86ad[_0xab40('0x3d')],_0x2e83c6['filters']));if(_0x2d86ad[_0xab40('0x3d')][_0xab40('0x29')]){_0x187aa8[_0xab40('0x3c')]=_[_0xab40('0x52')](_0x187aa8[_0xab40('0x3c')],{'$or':_[_0xab40('0x31')](_0x187aa8[_0xab40('0x43')],function(_0x2c4015){var _0x443e68={};_0x443e68[_0x2c4015]={'$like':'%'+_0x2d86ad[_0xab40('0x3d')]['filter']+'%'};return _0x443e68;})});}_0x187aa8=_['merge']({},_0x187aa8,_0x2d86ad['options']);switch(_0x403ca4[_0xab40('0x1e')]){case _0xab40('0x24'):return db[_[_0xab40('0x9b')](_0x2d86ad['query'][_0xab40('0x94')])+_0xab40('0xcc')][_0xab40('0x45')](_0x187aa8);case'user':case _0xab40('0x1f'):return _0x403ca4[_0xab40('0x23')+_[_0xab40('0x9b')](_0x2d86ad[_0xab40('0x3d')][_0xab40('0x94')])+'Queues'](_0x187aa8);default:throw new db['Sequelize']['ValidationError'](_0xab40('0xd2'));}})[_0xab40('0x22')](function(_0x52d5ca){_0x29841e=_0x52d5ca[_0xab40('0x48')];if(!_0x2d86ad[_0xab40('0x3d')][_0xab40('0xc2')]('nolimit')){_0x187aa8[_0xab40('0x1a')]=qs[_0xab40('0x1a')](_0x2d86ad['query'][_0xab40('0x1a')]);_0x187aa8[_0xab40('0x19')]=qs[_0xab40('0x19')](_0x2d86ad['query'][_0xab40('0x19')]);}switch(_0x403ca4['role']){case _0xab40('0x24'):return db[_['capitalize'](_0x2d86ad[_0xab40('0x3d')]['channel'])+'Queue'][_0xab40('0x45')](_0x187aa8);case'user':case'agent':return _0x403ca4[_0xab40('0x23')+_['capitalize'](_0x2d86ad['query'][_0xab40('0x94')])+'Queues'](_0x187aa8);}})[_0xab40('0x22')](function(_0x58fd03){return{'count':_0x29841e,'rows':_0x58fd03};})[_0xab40('0x22')](respondWithResult(_0xb8384b,null))[_0xab40('0x4f')](handleError(_0xb8384b,null));};exports[_0xab40('0xd3')]=function(_0xc65185,_0xbf2272){var _0x46ade0={};var _0x305975={};var _0x43ba88;var _0x21c5bd;return db[_0xab40('0x2f')][_0xab40('0x8e')]({'where':{'id':_0xc65185[_0xab40('0x51')]['id']}})['then'](handleEntityNotFound(_0xbf2272,null))['then'](function(_0x2f6769){if(_0x2f6769){_0x43ba88=_0x2f6769;_0x305975['model']=_[_0xab40('0xcb')](db[_0xab40('0xa5')][_0xab40('0x30')]);_0x305975['query']=_['keys'](_0xc65185[_0xab40('0x3d')]);_0x305975['filters']=_[_0xab40('0xce')](_0x305975[_0xab40('0xca')],_0x305975[_0xab40('0x3d')]);_0x46ade0[_0xab40('0x43')]=_[_0xab40('0xce')](_0x305975[_0xab40('0xca')],qs[_0xab40('0xcf')](_0xc65185[_0xab40('0x3d')]['fields']));_0x46ade0['attributes']=_0x46ade0[_0xab40('0x43')]['length']?_0x46ade0['attributes']:_0x305975[_0xab40('0xca')];_0x46ade0['order']=qs['sort'](_0xc65185['query']['sort']);_0x46ade0[_0xab40('0x3c')]=qs[_0xab40('0xcd')](_['pick'](_0xc65185['query'],_0x305975[_0xab40('0xcd')]));if(_0xc65185[_0xab40('0x3d')][_0xab40('0x29')]){_0x46ade0[_0xab40('0x3c')]=_[_0xab40('0x52')](_0x46ade0[_0xab40('0x3c')],{'$or':_[_0xab40('0x31')](_0x46ade0[_0xab40('0x43')],function(_0x312781){var _0x17f22e={};_0x17f22e[_0x312781]={'$like':'%'+_0xc65185['query']['filter']+'%'};return _0x17f22e;})});}_0x46ade0=_['merge']({},_0x46ade0,_0xc65185['options']);return _0x43ba88[_0xab40('0xd3')](_0x46ade0);}})[_0xab40('0x22')](function(_0xdae29){if(_0xdae29){_0x21c5bd=_0xdae29['length'];if(!_0xc65185[_0xab40('0x3d')]['hasOwnProperty'](_0xab40('0xd4'))){_0x46ade0['limit']=qs['limit'](_0xc65185[_0xab40('0x3d')][_0xab40('0x1a')]);_0x46ade0[_0xab40('0x19')]=qs[_0xab40('0x19')](_0xc65185[_0xab40('0x3d')]['offset']);}return _0x43ba88[_0xab40('0xd3')](_0x46ade0);}})['then'](function(_0x1720bf){if(_0x1720bf){return _0x1720bf?{'count':_0x21c5bd,'rows':_0x1720bf}:null;}})[_0xab40('0x22')](respondWithResult(_0xbf2272,null))[_0xab40('0x4f')](handleError(_0xbf2272,null));};exports[_0xab40('0xd5')]=function(_0x3614cc,_0x2b0f28){var _0x42e8d7={};var _0x275c87={};var _0x532aa2;var _0x5aff7d;return db['User'][_0xab40('0x8e')]({'where':{'id':_0x3614cc[_0xab40('0x51')]['id']}})[_0xab40('0x22')](handleEntityNotFound(_0x2b0f28,null))[_0xab40('0x22')](function(_0x4d0754){if(_0x4d0754){_0x532aa2=_0x4d0754;_0x275c87['model']=_['keys'](db[_0xab40('0xd6')][_0xab40('0x30')]);_0x275c87[_0xab40('0x3d')]=_[_0xab40('0xcb')](_0x3614cc[_0xab40('0x3d')]);_0x275c87['filters']=_[_0xab40('0xce')](_0x275c87[_0xab40('0xca')],_0x275c87[_0xab40('0x3d')]);_0x42e8d7[_0xab40('0x43')]=_[_0xab40('0xce')](_0x275c87[_0xab40('0xca')],qs[_0xab40('0xcf')](_0x3614cc[_0xab40('0x3d')][_0xab40('0xcf')]));_0x42e8d7[_0xab40('0x43')]=_0x42e8d7['attributes']['length']?_0x42e8d7[_0xab40('0x43')]:_0x275c87['model'];_0x42e8d7[_0xab40('0xd7')]=qs[_0xab40('0xd0')](_0x3614cc[_0xab40('0x3d')]['sort']);_0x42e8d7[_0xab40('0x3c')]=qs[_0xab40('0xcd')](_[_0xab40('0xd1')](_0x3614cc['query'],_0x275c87[_0xab40('0xcd')]));if(_0x3614cc[_0xab40('0x3d')][_0xab40('0x29')]){_0x42e8d7[_0xab40('0x3c')]=_[_0xab40('0x52')](_0x42e8d7[_0xab40('0x3c')],{'$or':_[_0xab40('0x31')](_0x42e8d7[_0xab40('0x43')],function(_0xeb20f4){var _0x36c527={};_0x36c527[_0xeb20f4]={'$like':'%'+_0x3614cc['query']['filter']+'%'};return _0x36c527;})});}_0x42e8d7=_[_0xab40('0x52')]({},_0x42e8d7,_0x3614cc[_0xab40('0x53')]);return _0x532aa2['getGroups'](_0x42e8d7);}})['then'](function(_0x50e841){if(_0x50e841){_0x5aff7d=_0x50e841[_0xab40('0x48')];if(!_0x3614cc[_0xab40('0x3d')][_0xab40('0xc2')]('nolimit')){_0x42e8d7[_0xab40('0x1a')]=qs[_0xab40('0x1a')](_0x3614cc[_0xab40('0x3d')][_0xab40('0x1a')]);_0x42e8d7[_0xab40('0x19')]=qs[_0xab40('0x19')](_0x3614cc[_0xab40('0x3d')][_0xab40('0x19')]);}return _0x532aa2[_0xab40('0xd5')](_0x42e8d7);}})['then'](function(_0x3c6eac){if(_0x3c6eac){return _0x3c6eac?{'count':_0x5aff7d,'rows':_0x3c6eac}:null;}})[_0xab40('0x22')](respondWithResult(_0x2b0f28,null))[_0xab40('0x4f')](handleError(_0x2b0f28,null));};exports[_0xab40('0xd8')]=function(_0xb86833,_0x5a19df){var _0x5717e1={'raw':!![],'where':{}};var _0x1e25d9={};var _0x3edb46={'count':0x0,'rows':[]};return db[_0xab40('0x2f')]['findOne']({'where':{'id':_0xb86833[_0xab40('0x51')]['id']}})['then'](handleEntityNotFound(_0x5a19df,null))[_0xab40('0x22')](function(_0x5ddb81){if(_0x5ddb81){_0x1e25d9[_0xab40('0xca')]=_[_0xab40('0xcb')](db['VoiceRecording'][_0xab40('0x30')]);_0x1e25d9['query']=_[_0xab40('0xcb')](_0xb86833[_0xab40('0x3d')]);_0x1e25d9[_0xab40('0xcd')]=_[_0xab40('0xce')](_0x1e25d9['model'],_0x1e25d9['query']);_0x5717e1[_0xab40('0x43')]=_['intersection'](_0x1e25d9[_0xab40('0xca')],qs[_0xab40('0xcf')](_0xb86833[_0xab40('0x3d')][_0xab40('0xcf')]));_0x5717e1[_0xab40('0x43')]=_0x5717e1[_0xab40('0x43')]['length']?_0x5717e1['attributes']:_0x1e25d9[_0xab40('0xca')];if(!_0xb86833[_0xab40('0x3d')][_0xab40('0xc2')](_0xab40('0xd4'))){_0x5717e1[_0xab40('0x1a')]=qs['limit'](_0xb86833[_0xab40('0x3d')][_0xab40('0x1a')]);_0x5717e1['offset']=qs[_0xab40('0x19')](_0xb86833[_0xab40('0x3d')][_0xab40('0x19')]);}_0x5717e1['order']=qs[_0xab40('0xd0')](_0xb86833[_0xab40('0x3d')][_0xab40('0xd0')]);_0x5717e1[_0xab40('0x3c')]=qs['filters'](_[_0xab40('0xd1')](_0xb86833[_0xab40('0x3d')],_0x1e25d9[_0xab40('0xcd')]));_0x5717e1[_0xab40('0x3c')][_0xab40('0xd9')]=_0x5ddb81['id'];if(_0xb86833['query'][_0xab40('0x29')]){_0x5717e1[_0xab40('0x3c')]=_[_0xab40('0x52')](_0x5717e1[_0xab40('0x3c')],{'$or':_['map'](_0x5717e1[_0xab40('0x43')],function(_0x30e905){var _0x42faa1={};_0x42faa1[_0x30e905]={'$like':'%'+_0xb86833[_0xab40('0x3d')][_0xab40('0x29')]+'%'};return _0x42faa1;})});}_0x5717e1=_[_0xab40('0x52')]({},_0x5717e1,_0xb86833[_0xab40('0x53')]);return db[_0xab40('0xda')][_0xab40('0x18')]({'where':_0x5717e1[_0xab40('0x3c')]})[_0xab40('0x22')](function(_0x321946){_0x3edb46[_0xab40('0x18')]=_0x321946;if(_0xb86833[_0xab40('0x3d')]['includeAll']){_0x5717e1[_0xab40('0x41')]=[{'all':!![]}];}return db['VoiceRecording'][_0xab40('0x45')](_0x5717e1);})[_0xab40('0x22')](function(_0x23273b){_0x3edb46[_0xab40('0x46')]=_0x23273b;return _0x3edb46;});}})[_0xab40('0x22')](respondWithFilteredResult(_0x5a19df,_0x5717e1))['catch'](handleError(_0x5a19df,null));};exports['getScreenRecordings']=function(_0x5f2d1d,_0x22e733){var _0xe4909b={'raw':!![],'where':{}};var _0x3fbdcd={};var _0x47174a={'count':0x0,'rows':[]};return db[_0xab40('0x2f')][_0xab40('0x8e')]({'where':{'id':_0x5f2d1d[_0xab40('0x51')]['id']}})['then'](handleEntityNotFound(_0x22e733,null))[_0xab40('0x22')](function(_0x2f43a5){if(_0x2f43a5){_0x3fbdcd['model']=_['keys'](db['ScreenRecording']['rawAttributes']);_0x3fbdcd[_0xab40('0x3d')]=_[_0xab40('0xcb')](_0x5f2d1d[_0xab40('0x3d')]);_0x3fbdcd[_0xab40('0xcd')]=_[_0xab40('0xce')](_0x3fbdcd[_0xab40('0xca')],_0x3fbdcd[_0xab40('0x3d')]);_0xe4909b[_0xab40('0x43')]=_[_0xab40('0xce')](_0x3fbdcd[_0xab40('0xca')],qs[_0xab40('0xcf')](_0x5f2d1d[_0xab40('0x3d')][_0xab40('0xcf')]));_0xe4909b['attributes']=_0xe4909b[_0xab40('0x43')][_0xab40('0x48')]?_0xe4909b[_0xab40('0x43')]:_0x3fbdcd[_0xab40('0xca')];if(!_0x5f2d1d[_0xab40('0x3d')]['hasOwnProperty'](_0xab40('0xd4'))){_0xe4909b[_0xab40('0x1a')]=qs['limit'](_0x5f2d1d[_0xab40('0x3d')][_0xab40('0x1a')]);_0xe4909b[_0xab40('0x19')]=qs[_0xab40('0x19')](_0x5f2d1d['query'][_0xab40('0x19')]);}_0xe4909b[_0xab40('0xd7')]=qs[_0xab40('0xd0')](_0x5f2d1d[_0xab40('0x3d')]['sort']);_0xe4909b[_0xab40('0x3c')]=qs[_0xab40('0xcd')](_[_0xab40('0xd1')](_0x5f2d1d['query'],_0x3fbdcd['filters']));_0xe4909b['where']['UserId']=_0x2f43a5['id'];if(_0x5f2d1d[_0xab40('0x3d')]['filter']){_0xe4909b['where']=_[_0xab40('0x52')](_0xe4909b[_0xab40('0x3c')],{'$or':_[_0xab40('0x31')](_0xe4909b[_0xab40('0x43')],function(_0x1571ce){var _0x54fb26={};_0x54fb26[_0x1571ce]={'$like':'%'+_0x5f2d1d[_0xab40('0x3d')][_0xab40('0x29')]+'%'};return _0x54fb26;})});}_0xe4909b=_['merge']({},_0xe4909b,_0x5f2d1d['options']);return db[_0xab40('0xdb')][_0xab40('0x18')]({'where':_0xe4909b[_0xab40('0x3c')]})[_0xab40('0x22')](function(_0x4e4575){_0x47174a[_0xab40('0x18')]=_0x4e4575;if(_0x5f2d1d[_0xab40('0x3d')][_0xab40('0x3e')]){_0xe4909b['include']=[{'all':!![]}];}return db['ScreenRecording'][_0xab40('0x45')](_0xe4909b);})['then'](function(_0x209bc2){_0x47174a[_0xab40('0x46')]=_0x209bc2;return _0x47174a;});}})[_0xab40('0x22')](respondWithFilteredResult(_0x22e733,_0xe4909b))[_0xab40('0x4f')](handleError(_0x22e733,null));};exports['getChatInteractions']=function(_0xe802ef,_0x248997){var _0x4bd4fb={};var _0x4e7ad3={};var _0x1dfda4;var _0x1f92ef;return db[_0xab40('0x2f')]['findOne']({'where':{'id':_0xe802ef[_0xab40('0x51')]['id']}})[_0xab40('0x22')](handleEntityNotFound(_0x248997,null))[_0xab40('0x22')](function(_0x494b46){if(_0x494b46){_0x1dfda4=_0x494b46;_0x4e7ad3[_0xab40('0xca')]=_[_0xab40('0xcb')](db[_0xab40('0xdc')]['rawAttributes']);_0x4e7ad3[_0xab40('0x3d')]=_[_0xab40('0xcb')](_0xe802ef['query']);_0x4e7ad3[_0xab40('0xcd')]=_[_0xab40('0xce')](_0x4e7ad3[_0xab40('0xca')],_0x4e7ad3[_0xab40('0x3d')]);_0x4bd4fb[_0xab40('0x43')]=_['intersection'](_0x4e7ad3[_0xab40('0xca')],qs['fields'](_0xe802ef[_0xab40('0x3d')][_0xab40('0xcf')]));_0x4bd4fb[_0xab40('0x43')]=_0x4bd4fb['attributes'][_0xab40('0x48')]?_0x4bd4fb[_0xab40('0x43')]:_0x4e7ad3[_0xab40('0xca')];_0x4bd4fb[_0xab40('0xd7')]=qs[_0xab40('0xd0')](_0xe802ef[_0xab40('0x3d')][_0xab40('0xd0')]);_0x4bd4fb[_0xab40('0x3c')]=qs['filters'](_[_0xab40('0xd1')](_0xe802ef[_0xab40('0x3d')],_0x4e7ad3[_0xab40('0xcd')]));if(_0xe802ef[_0xab40('0x3d')]['filter']){_0x4bd4fb['where']=_[_0xab40('0x52')](_0x4bd4fb[_0xab40('0x3c')],{'$or':_[_0xab40('0x31')](_0x4bd4fb[_0xab40('0x43')],function(_0x3ab636){var _0x3b0b95={};_0x3b0b95[_0x3ab636]={'$like':'%'+_0xe802ef[_0xab40('0x3d')][_0xab40('0x29')]+'%'};return _0x3b0b95;})});}_0x4bd4fb=_[_0xab40('0x52')]({},_0x4bd4fb,_0xe802ef['options']);return _0x1dfda4[_0xab40('0xdd')](_0x4bd4fb);}})[_0xab40('0x22')](function(_0x33b53d){if(_0x33b53d){_0x1f92ef=_0x33b53d[_0xab40('0x48')];if(!_0xe802ef[_0xab40('0x3d')]['hasOwnProperty']('nolimit')){_0x4bd4fb[_0xab40('0x1a')]=qs[_0xab40('0x1a')](_0xe802ef[_0xab40('0x3d')][_0xab40('0x1a')]);_0x4bd4fb['offset']=qs['offset'](_0xe802ef[_0xab40('0x3d')]['offset']);}return _0x1dfda4[_0xab40('0xdd')](_0x4bd4fb);}})[_0xab40('0x22')](function(_0x5786dc){if(_0x5786dc){return _0x5786dc?{'count':_0x1f92ef,'rows':_0x5786dc}:null;}})[_0xab40('0x22')](respondWithResult(_0x248997,null))[_0xab40('0x4f')](handleError(_0x248997,null));};exports[_0xab40('0xde')]=function(_0x38f387,_0x5a0daa){var _0x46b5bf={};var _0x3cdc79={};var _0x43d37b;var _0x462a75;return db['User'][_0xab40('0x8e')]({'where':{'id':_0x38f387['params']['id']}})[_0xab40('0x22')](handleEntityNotFound(_0x5a0daa,null))[_0xab40('0x22')](function(_0x3318bc){if(_0x3318bc){_0x43d37b=_0x3318bc;_0x3cdc79[_0xab40('0xca')]=_[_0xab40('0xcb')](db['OpenchannelInteraction'][_0xab40('0x30')]);_0x3cdc79['query']=_[_0xab40('0xcb')](_0x38f387[_0xab40('0x3d')]);_0x3cdc79['filters']=_['intersection'](_0x3cdc79[_0xab40('0xca')],_0x3cdc79['query']);_0x46b5bf['attributes']=_['intersection'](_0x3cdc79['model'],qs['fields'](_0x38f387[_0xab40('0x3d')][_0xab40('0xcf')]));_0x46b5bf['attributes']=_0x46b5bf['attributes']['length']?_0x46b5bf[_0xab40('0x43')]:_0x3cdc79[_0xab40('0xca')];_0x46b5bf[_0xab40('0xd7')]=qs['sort'](_0x38f387[_0xab40('0x3d')][_0xab40('0xd0')]);_0x46b5bf[_0xab40('0x3c')]=qs[_0xab40('0xcd')](_[_0xab40('0xd1')](_0x38f387[_0xab40('0x3d')],_0x3cdc79[_0xab40('0xcd')]));if(_0x38f387[_0xab40('0x3d')][_0xab40('0x29')]){_0x46b5bf[_0xab40('0x3c')]=_[_0xab40('0x52')](_0x46b5bf[_0xab40('0x3c')],{'$or':_[_0xab40('0x31')](_0x46b5bf['attributes'],function(_0x32479a){var _0x175834={};_0x175834[_0x32479a]={'$like':'%'+_0x38f387[_0xab40('0x3d')][_0xab40('0x29')]+'%'};return _0x175834;})});}_0x46b5bf=_[_0xab40('0x52')]({},_0x46b5bf,_0x38f387[_0xab40('0x53')]);return _0x43d37b['getOpenchannelInteractions'](_0x46b5bf);}})[_0xab40('0x22')](function(_0x2bd5f6){if(_0x2bd5f6){_0x462a75=_0x2bd5f6[_0xab40('0x48')];if(!_0x38f387['query']['hasOwnProperty'](_0xab40('0xd4'))){_0x46b5bf[_0xab40('0x1a')]=qs[_0xab40('0x1a')](_0x38f387['query']['limit']);_0x46b5bf['offset']=qs[_0xab40('0x19')](_0x38f387[_0xab40('0x3d')]['offset']);}return _0x43d37b[_0xab40('0xde')](_0x46b5bf);}})[_0xab40('0x22')](function(_0xfa9d11){if(_0xfa9d11){return _0xfa9d11?{'count':_0x462a75,'rows':_0xfa9d11}:null;}})[_0xab40('0x22')](respondWithResult(_0x5a0daa,null))[_0xab40('0x4f')](handleError(_0x5a0daa,null));};exports[_0xab40('0xdf')]=function(_0x3b1e78,_0x59ba68){var _0x4135b3={'raw':!![],'where':{}};var _0xe9111b={};var _0x963f9={'count':0x0,'rows':[]};return db[_0xab40('0x2f')][_0xab40('0x8e')]({'where':{'id':_0x3b1e78[_0xab40('0x51')]['id']}})[_0xab40('0x22')](handleEntityNotFound(_0x59ba68,null))[_0xab40('0x22')](function(_0x1ed132){if(_0x1ed132){_0xe9111b[_0xab40('0xca')]=_[_0xab40('0xcb')](db[_0xab40('0xe0')][_0xab40('0x30')]);_0xe9111b[_0xab40('0x3d')]=_[_0xab40('0xcb')](_0x3b1e78[_0xab40('0x3d')]);_0xe9111b['filters']=_[_0xab40('0xce')](_0xe9111b[_0xab40('0xca')],_0xe9111b['query']);_0x4135b3['attributes']=_[_0xab40('0xce')](_0xe9111b[_0xab40('0xca')],qs['fields'](_0x3b1e78[_0xab40('0x3d')][_0xab40('0xcf')]));_0x4135b3[_0xab40('0x43')]=_0x4135b3['attributes']['length']?_0x4135b3['attributes']:_0xe9111b[_0xab40('0xca')];if(!_0x3b1e78[_0xab40('0x3d')][_0xab40('0xc2')](_0xab40('0xd4'))){_0x4135b3[_0xab40('0x1a')]=qs[_0xab40('0x1a')](_0x3b1e78['query'][_0xab40('0x1a')]);_0x4135b3['offset']=qs[_0xab40('0x19')](_0x3b1e78[_0xab40('0x3d')]['offset']);}_0x4135b3[_0xab40('0xd7')]=qs[_0xab40('0xd0')](_0x3b1e78[_0xab40('0x3d')][_0xab40('0xd0')]);_0x4135b3[_0xab40('0x3c')]=qs['filters'](_[_0xab40('0xd1')](_0x3b1e78['query'],_0xe9111b['filters']));_0x4135b3[_0xab40('0x3c')][_0xab40('0xd9')]=_0x1ed132['id'];if(_0x3b1e78[_0xab40('0x3d')]['filter']){_0x4135b3[_0xab40('0x3c')]=_['merge'](_0x4135b3[_0xab40('0x3c')],{'$or':_[_0xab40('0x31')](_0x4135b3[_0xab40('0x43')],function(_0x2de824){var _0x316bcd={};_0x316bcd[_0x2de824]={'$like':'%'+_0x3b1e78[_0xab40('0x3d')][_0xab40('0x29')]+'%'};return _0x316bcd;})});}_0x4135b3=_[_0xab40('0x52')]({},_0x4135b3,_0x3b1e78[_0xab40('0x53')]);return db[_0xab40('0xe0')][_0xab40('0x18')]({'where':_0x4135b3['where']})[_0xab40('0x22')](function(_0x54504a){_0x963f9[_0xab40('0x18')]=_0x54504a;if(_0x3b1e78['query'][_0xab40('0x3e')]){_0x4135b3['include']=[{'all':!![]}];}return db[_0xab40('0xe0')][_0xab40('0x45')](_0x4135b3);})[_0xab40('0x22')](function(_0x2b3060){_0x963f9[_0xab40('0x46')]=_0x2b3060;return _0x963f9;});}})[_0xab40('0x22')](respondWithFilteredResult(_0x59ba68,_0x4135b3))[_0xab40('0x4f')](handleError(_0x59ba68,null));};exports[_0xab40('0xe1')]=function(_0x2efa93,_0x14cabd){var _0x41cec7={};var _0x24e47e={};var _0x35f9f2;var _0x537aaa;return db[_0xab40('0x2f')][_0xab40('0x8e')]({'where':{'id':_0x2efa93['params']['id']}})['then'](handleEntityNotFound(_0x14cabd,null))['then'](function(_0x1e0d87){if(_0x1e0d87){_0x35f9f2=_0x1e0d87;_0x24e47e[_0xab40('0xca')]=_['keys'](db[_0xab40('0xe2')]['rawAttributes']);_0x24e47e[_0xab40('0x3d')]=_[_0xab40('0xcb')](_0x2efa93['query']);_0x24e47e[_0xab40('0xcd')]=_[_0xab40('0xce')](_0x24e47e[_0xab40('0xca')],_0x24e47e['query']);_0x41cec7[_0xab40('0x43')]=_[_0xab40('0xce')](_0x24e47e['model'],qs[_0xab40('0xcf')](_0x2efa93[_0xab40('0x3d')][_0xab40('0xcf')]));_0x41cec7['attributes']=_0x41cec7[_0xab40('0x43')][_0xab40('0x48')]?_0x41cec7['attributes']:_0x24e47e[_0xab40('0xca')];_0x41cec7[_0xab40('0xd7')]=qs['sort'](_0x2efa93[_0xab40('0x3d')][_0xab40('0xd0')]);_0x41cec7[_0xab40('0x3c')]=qs[_0xab40('0xcd')](_[_0xab40('0xd1')](_0x2efa93[_0xab40('0x3d')],_0x24e47e['filters']));if(_0x2efa93[_0xab40('0x3d')][_0xab40('0x29')]){_0x41cec7[_0xab40('0x3c')]=_[_0xab40('0x52')](_0x41cec7['where'],{'$or':_[_0xab40('0x31')](_0x41cec7[_0xab40('0x43')],function(_0x86d9d6){var _0x12fbf8={};_0x12fbf8[_0x86d9d6]={'$like':'%'+_0x2efa93[_0xab40('0x3d')][_0xab40('0x29')]+'%'};return _0x12fbf8;})});}_0x41cec7=_[_0xab40('0x52')]({},_0x41cec7,_0x2efa93[_0xab40('0x53')]);return _0x35f9f2['getSmsInteractions'](_0x41cec7);}})[_0xab40('0x22')](function(_0x17352f){if(_0x17352f){_0x537aaa=_0x17352f[_0xab40('0x48')];if(!_0x2efa93[_0xab40('0x3d')][_0xab40('0xc2')](_0xab40('0xd4'))){_0x41cec7[_0xab40('0x1a')]=qs[_0xab40('0x1a')](_0x2efa93[_0xab40('0x3d')][_0xab40('0x1a')]);_0x41cec7['offset']=qs[_0xab40('0x19')](_0x2efa93[_0xab40('0x3d')]['offset']);}return _0x35f9f2[_0xab40('0xe1')](_0x41cec7);}})['then'](function(_0x1d704a){if(_0x1d704a){return _0x1d704a?{'count':_0x537aaa,'rows':_0x1d704a}:null;}})[_0xab40('0x22')](respondWithResult(_0x14cabd,null))[_0xab40('0x4f')](handleError(_0x14cabd,null));};exports[_0xab40('0xe3')]=function(_0x53c5ac,_0x265d71){var _0x58895a={};var _0x357499={};var _0x5c8058;var _0xbe62fb;return db[_0xab40('0x2f')][_0xab40('0x8e')]({'where':{'id':_0x53c5ac[_0xab40('0x51')]['id']}})[_0xab40('0x22')](handleEntityNotFound(_0x265d71,null))[_0xab40('0x22')](function(_0x3cbd87){if(_0x3cbd87){_0x5c8058=_0x3cbd87;_0x357499[_0xab40('0xca')]=_[_0xab40('0xcb')](db[_0xab40('0xe4')]['rawAttributes']);_0x357499[_0xab40('0x3d')]=_['keys'](_0x53c5ac[_0xab40('0x3d')]);_0x357499[_0xab40('0xcd')]=_[_0xab40('0xce')](_0x357499[_0xab40('0xca')],_0x357499[_0xab40('0x3d')]);_0x58895a[_0xab40('0x43')]=_[_0xab40('0xce')](_0x357499[_0xab40('0xca')],qs[_0xab40('0xcf')](_0x53c5ac[_0xab40('0x3d')][_0xab40('0xcf')]));_0x58895a[_0xab40('0x43')]=_0x58895a[_0xab40('0x43')]['length']?_0x58895a[_0xab40('0x43')]:_0x357499[_0xab40('0xca')];_0x58895a[_0xab40('0xd7')]=qs[_0xab40('0xd0')](_0x53c5ac[_0xab40('0x3d')][_0xab40('0xd0')]);_0x58895a[_0xab40('0x3c')]=qs[_0xab40('0xcd')](_[_0xab40('0xd1')](_0x53c5ac[_0xab40('0x3d')],_0x357499[_0xab40('0xcd')]));if(_0x53c5ac[_0xab40('0x3d')][_0xab40('0x29')]){_0x58895a[_0xab40('0x3c')]=_[_0xab40('0x52')](_0x58895a[_0xab40('0x3c')],{'$or':_[_0xab40('0x31')](_0x58895a[_0xab40('0x43')],function(_0x5590b4){var _0x2904ed={};_0x2904ed[_0x5590b4]={'$like':'%'+_0x53c5ac[_0xab40('0x3d')][_0xab40('0x29')]+'%'};return _0x2904ed;})});}_0x58895a=_[_0xab40('0x52')]({},_0x58895a,_0x53c5ac[_0xab40('0x53')]);return _0x5c8058[_0xab40('0xe3')](_0x58895a);}})[_0xab40('0x22')](function(_0x1adc9e){if(_0x1adc9e){_0xbe62fb=_0x1adc9e[_0xab40('0x48')];if(!_0x53c5ac[_0xab40('0x3d')][_0xab40('0xc2')](_0xab40('0xd4'))){_0x58895a[_0xab40('0x1a')]=qs[_0xab40('0x1a')](_0x53c5ac[_0xab40('0x3d')][_0xab40('0x1a')]);_0x58895a[_0xab40('0x19')]=qs[_0xab40('0x19')](_0x53c5ac[_0xab40('0x3d')][_0xab40('0x19')]);}return _0x5c8058[_0xab40('0xe3')](_0x58895a);}})[_0xab40('0x22')](function(_0x4bfce7){if(_0x4bfce7){return _0x4bfce7?{'count':_0xbe62fb,'rows':_0x4bfce7}:null;}})[_0xab40('0x22')](respondWithResult(_0x265d71,null))[_0xab40('0x4f')](handleError(_0x265d71,null));};exports[_0xab40('0xe5')]=function(_0x3f77d7,_0x3d54eb){var _0x24c48f={};var _0x37bf3d={};var _0x49a2e0;var _0x23eca5;return db[_0xab40('0x2f')][_0xab40('0x8e')]({'where':{'id':_0x3f77d7[_0xab40('0x51')]['id']}})['then'](handleEntityNotFound(_0x3d54eb,null))[_0xab40('0x22')](function(_0x3437b8){if(_0x3437b8){_0x49a2e0=_0x3437b8;_0x37bf3d[_0xab40('0xca')]=_[_0xab40('0xcb')](db['WhatsappInteraction'][_0xab40('0x30')]);_0x37bf3d[_0xab40('0x3d')]=_[_0xab40('0xcb')](_0x3f77d7['query']);_0x37bf3d[_0xab40('0xcd')]=_[_0xab40('0xce')](_0x37bf3d[_0xab40('0xca')],_0x37bf3d[_0xab40('0x3d')]);_0x24c48f[_0xab40('0x43')]=_[_0xab40('0xce')](_0x37bf3d[_0xab40('0xca')],qs['fields'](_0x3f77d7[_0xab40('0x3d')][_0xab40('0xcf')]));_0x24c48f[_0xab40('0x43')]=_0x24c48f[_0xab40('0x43')]['length']?_0x24c48f[_0xab40('0x43')]:_0x37bf3d[_0xab40('0xca')];_0x24c48f['order']=qs['sort'](_0x3f77d7[_0xab40('0x3d')][_0xab40('0xd0')]);_0x24c48f[_0xab40('0x3c')]=qs[_0xab40('0xcd')](_[_0xab40('0xd1')](_0x3f77d7['query'],_0x37bf3d[_0xab40('0xcd')]));if(_0x3f77d7[_0xab40('0x3d')]['filter']){_0x24c48f[_0xab40('0x3c')]=_[_0xab40('0x52')](_0x24c48f['where'],{'$or':_['map'](_0x24c48f[_0xab40('0x43')],function(_0x11b94e){var _0x4c866b={};_0x4c866b[_0x11b94e]={'$like':'%'+_0x3f77d7['query'][_0xab40('0x29')]+'%'};return _0x4c866b;})});}_0x24c48f=_[_0xab40('0x52')]({},_0x24c48f,_0x3f77d7[_0xab40('0x53')]);return _0x49a2e0['getWhatsappInteractions'](_0x24c48f);}})[_0xab40('0x22')](function(_0x46d16a){if(_0x46d16a){_0x23eca5=_0x46d16a[_0xab40('0x48')];if(!_0x3f77d7[_0xab40('0x3d')][_0xab40('0xc2')](_0xab40('0xd4'))){_0x24c48f[_0xab40('0x1a')]=qs[_0xab40('0x1a')](_0x3f77d7[_0xab40('0x3d')]['limit']);_0x24c48f[_0xab40('0x19')]=qs['offset'](_0x3f77d7['query'][_0xab40('0x19')]);}return _0x49a2e0[_0xab40('0xe5')](_0x24c48f);}})[_0xab40('0x22')](function(_0x139a31){if(_0x139a31){return _0x139a31?{'count':_0x23eca5,'rows':_0x139a31}:null;}})[_0xab40('0x22')](respondWithResult(_0x3d54eb,null))[_0xab40('0x4f')](handleError(_0x3d54eb,null));};exports[_0xab40('0xe6')]=function(_0x29f1dc,_0x487691,_0x1036e0){var _0x58ce1d;var _0x309b6f;var _0x3bb32c;var _0x5616fb=!_[_0xab40('0x5e')](_0x29f1dc[_0xab40('0x51')]['id'])?_0x29f1dc[_0xab40('0x51')]['id']:!_[_0xab40('0x5e')](_0x29f1dc[_0xab40('0x26')]['id'])?_0x29f1dc['user']['id']:null;return db[_0xab40('0x2f')][_0xab40('0x55')]({'where':{'id':_0x5616fb,'role':{'$or':[_0xab40('0x24'),_0xab40('0x26'),_0xab40('0x1f')]}},'attributes':['id','name',_0xab40('0xe7'),_0xab40('0xe8'),_0xab40('0x1e'),_0xab40('0x5c'),'loginInPause']})['then'](function(_0x34665b){if(_0x34665b){if(_0x34665b[_0xab40('0x1e')]==='agent'){_0x58ce1d=_0x34665b;if(_0x29f1dc[_0xab40('0x57')][_0xab40('0x98')]){_0x3bb32c=util[_0xab40('0xa3')](_0xab40('0xe9'),_0x58ce1d[_0x29f1dc[_0xab40('0x57')][_0xab40('0x98')]]);}else if(_0x29f1dc[_0xab40('0x57')][_0xab40('0xea')]){_0x3bb32c=util[_0xab40('0xa3')](_0xab40('0xa4'),_0x29f1dc[_0xab40('0x57')][_0xab40('0xea')]);}else{_0x3bb32c=util[_0xab40('0xa3')](_0xab40('0xa4'),_0x58ce1d[_0xab40('0x2c')]);}socket['to'](util['format'](_0xab40('0xeb'),_0x58ce1d[_0xab40('0x2c')]))[_0xab40('0x20')]('user:forcelogout',{'user':{'id':_0x58ce1d['id'],'name':_0x58ce1d[_0xab40('0x2c')]},'ip':_0x29f1dc[_0xab40('0xec')][_0xab40('0xed')]||_0x29f1dc[_0xab40('0xee')][_0xab40('0xef')]||_0x29f1dc['socket'][_0xab40('0xef')]||_0x29f1dc[_0xab40('0xee')]['socket'][_0xab40('0xef')]});return db['UserVoiceQueueRt'][_0xab40('0x21')]({'where':{'membername':_0x58ce1d[_0xab40('0x2c')]},'individualHooks':!![]});}}else{throw new db[(_0xab40('0x8a'))][(_0xab40('0x87'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0x58ce1d){return _0x58ce1d[_0xab40('0xf0')]({'raw':!![]});}})[_0xab40('0x22')](function(_0x56cbd1){if(_0x58ce1d){if(_0x56cbd1){_0x309b6f=_0x56cbd1;if(_0x309b6f[_0xab40('0x48')]){var _0x3aa02e=_0x309b6f[_0xab40('0x31')](function(_0x251b75){var _0x1604d3={'membername':_0x58ce1d[_0xab40('0x2c')],'UserId':_0x58ce1d['id'],'queue_name':_0x251b75[_0xab40('0x2c')],'VoiceQueueId':_0x251b75['id'],'interface':_0x3bb32c,'paused':_0x58ce1d[_0xab40('0x96')]||![],'penalty':_0x251b75[_0xab40('0xf1')]||0x0};return db[_0xab40('0xa5')][_0xab40('0xa6')](_0x1604d3);});return Promise[_0xab40('0x4e')](_0x3aa02e);}}}})[_0xab40('0x22')](function(){if(_0x58ce1d){return db[_0xab40('0xf2')][_0xab40('0x45')]({'where':{'membername':_0x58ce1d[_0xab40('0x2c')],'exitAt':null}});}})['then'](function(_0x596826){if(_0x58ce1d){var _0x8b2727=[];_0x596826[_0xab40('0xf3')](function(_0x42d6b8){_0x8b2727[_0xab40('0x44')](_0x42d6b8[_0xab40('0x1d')]({'exitAt':moment()[_0xab40('0xa3')](_0xab40('0xf4'))}));});return Promise['all'](_0x8b2727);}})[_0xab40('0x22')](function(){if(_0x58ce1d){var _0x10aaf2=[];var _0x2f4519=[];var _0x5e7b1e=utils[_0xab40('0xf5')]();var _0xf5ea7b={'membername':_0x58ce1d[_0xab40('0x2c')],'interface':_0x3bb32c,'enterAt':moment()[_0xab40('0xa3')](_0xab40('0xf4')),'role':_0x58ce1d[_0xab40('0x1e')],'internal':_0x58ce1d['internal']};_0x5e7b1e[_0xab40('0xf3')](function(_0x56dc44){_0x10aaf2[_0xab40('0x44')](_[_0xab40('0x52')]({'channel':_0x56dc44,'type':_0xab40('0xf6'),'data1':_0x29f1dc['body'][_0xab40('0xf7')],'data2':_0x3bb32c},_0xf5ea7b));if(_0x58ce1d['loginInPause']){_0x2f4519[_0xab40('0x44')](_['merge']({'channel':_0x56dc44,'type':'PAUSE','data1':_0xab40('0xf8')},_0xf5ea7b));}});return db['MemberReport'][_0xab40('0x80')](_0x10aaf2[_0xab40('0xbf')](_0x2f4519),{'individualHooks':!![]});}})[_0xab40('0x22')](function(){if(_0x58ce1d){return _0x58ce1d[_0xab40('0x1d')]({'online':!![],'lastLoginAt':moment()['format'](_0xab40('0xf4')),'voicePause':_0x58ce1d[_0xab40('0x96')]||![],'mailPause':_0x58ce1d[_0xab40('0x96')]||![],'chatPause':_0x58ce1d[_0xab40('0x96')]||![],'faxPause':_0x58ce1d[_0xab40('0x96')]||![],'smsPause':_0x58ce1d[_0xab40('0x96')]||![],'openchannelPause':_0x58ce1d[_0xab40('0x96')]||![],'whatsappPause':_0x58ce1d[_0xab40('0x96')]||![],'pauseType':_0x58ce1d['loginInPause']?_0xab40('0xf8'):null,'interface':_0x3bb32c,'lastPauseAt':moment()[_0xab40('0xa3')](_0xab40('0xf4'))});}})[_0xab40('0x22')](function(_0x30c9c9){if(_0x29f1dc[_0xab40('0xf9')]){return _0x1036e0();}else{return Promise[_0xab40('0xfa')](_0x30c9c9)[_0xab40('0x22')](respondWithResult(_0x487691,null));}})[_0xab40('0x4f')](handleError(_0x487691,null));};exports[_0xab40('0xfb')]=function(_0x34c369,_0x56a55b){var _0x51d37e;return db['User'][_0xab40('0x55')]({'where':{'id':_0x34c369[_0xab40('0x51')]['id'],'role':'agent'},'attributes':['id',_0xab40('0x2c'),'role']})[_0xab40('0x22')](handleEntityNotFound(_0x56a55b,null))['then'](function(_0x5df0ec){if(_0x5df0ec){_0x51d37e=_0x5df0ec;return db['UserVoiceQueueRt'][_0xab40('0x21')]({'where':{'membername':_0x51d37e[_0xab40('0x2c')]},'individualHooks':!![]});}})[_0xab40('0x22')](function(){return db[_0xab40('0xf2')][_0xab40('0x45')]({'where':{'membername':_0x51d37e[_0xab40('0x2c')],'exitAt':null}});})[_0xab40('0x22')](function(_0x3d590a){var _0x281b93=[];_0x3d590a[_0xab40('0xf3')](function(_0x17ba53){_0x281b93[_0xab40('0x44')](_0x17ba53[_0xab40('0x1d')]({'exitAt':moment()['format'](_0xab40('0xf4'))}));});return Promise['all'](_0x281b93);})[_0xab40('0x22')](function(){return _0x51d37e[_0xab40('0x1d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xab40('0x22')](respondWithResult(_0x56a55b,null))[_0xab40('0x4f')](handleError(_0x56a55b,null));};exports[_0xab40('0xfc')]=function(_0x24b0d1,_0x1e9605){var _0x36c0fc;return db[_0xab40('0xa5')][_0xab40('0x1d')]({'paused':0x1},{'where':{'UserId':_0x24b0d1[_0xab40('0x51')]['id']},'individualHooks':!![]})[_0xab40('0x22')](function(){return db[_0xab40('0x2f')][_0xab40('0x55')]({'where':{'id':_0x24b0d1[_0xab40('0x51')]['id'],'role':'agent'},'attributes':['id',_0xab40('0x2c'),'role','internal',_0xab40('0x98'),_0xab40('0x95')]});})[_0xab40('0x22')](handleEntityNotFound(_0x1e9605,null))['then'](function(_0x7c9fdc){if(_0x7c9fdc){_0x36c0fc=_0x7c9fdc;return db[_0xab40('0xf2')][_0xab40('0x45')]({'where':{'membername':_0x36c0fc[_0xab40('0x2c')],'type':_0xab40('0xfd'),'exitAt':null}});}})[_0xab40('0x22')](function(_0x435abd){if(_0x435abd[_0xab40('0x48')]){var _0x477953=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5c5739=0x0,_0x408eea=_0x435abd[_0xab40('0x48')];_0x5c5739<_0x408eea;_0x5c5739++){_0x435abd[_0x5c5739]['updateAttributes']({'exitAt':_0x477953});}}})['then'](function(){var _0x2caa94=[];var _0x218291=utils[_0xab40('0xf5')]();_0x218291[_0xab40('0xf3')](function(_0x59e6ea){_0x2caa94[_0xab40('0x44')]({'channel':_0x59e6ea,'membername':_0x36c0fc[_0xab40('0x2c')],'interface':_[_0xab40('0x5e')](_0x36c0fc['interface'])?util[_0xab40('0xa3')]('SIP/%s',_0x36c0fc[_0xab40('0x2c')]):_0x36c0fc[_0xab40('0x98')],'type':'PAUSE','enterAt':moment()['format'](_0xab40('0xf4')),'data1':_0x24b0d1[_0xab40('0x57')][_0xab40('0xfe')]||_0xab40('0xff'),'role':_0x36c0fc['role'],'internal':_0x36c0fc[_0xab40('0x5c')]});});return db[_0xab40('0xf2')][_0xab40('0x80')](_0x2caa94,{'individualHooks':!![]});})[_0xab40('0x22')](function(){return _0x36c0fc[_0xab40('0x1d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x24b0d1[_0xab40('0x57')][_0xab40('0xfe')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0xab40('0xf4'))});})[_0xab40('0x22')](respondWithResult(_0x1e9605,null))['catch'](handleError(_0x1e9605,null));};exports[_0xab40('0x100')]=function(_0x72fc32,_0x1c01d8){if(_0x72fc32['body'][_0xab40('0x94')]&&!utils['isValidChannel'](_0x72fc32[_0xab40('0x57')][_0xab40('0x94')])){throw new APIBadRequestError(util[_0xab40('0xa3')](_0xab40('0x101'),_0x72fc32[_0xab40('0x57')]['channel']));}return db['User'][_0xab40('0x55')]({'where':{'id':_0x72fc32['params']['id']},'attributes':['id','name',_0xab40('0x1e'),_0xab40('0x5c'),_0xab40('0x98'),_0xab40('0x95'),_0xab40('0x97'),'mailPause',_0xab40('0x102'),_0xab40('0x103'),_0xab40('0x104'),_0xab40('0x105'),_0xab40('0x106'),_0xab40('0x107'),'lastPauseAt']})[_0xab40('0x22')](function(_0x46eeea){if(!_0x46eeea){throw new APINotFoundError(util[_0xab40('0xa3')](_0xab40('0xc1'),_0x72fc32['params']['id']));}return _0x46eeea['unpause'](_0x72fc32['body'][_0xab40('0x94')]);})[_0xab40('0x22')](respondWithResult(_0x1c01d8,null))[_0xab40('0x4f')](APIHandleError(_0x1c01d8));};exports[_0xab40('0x108')]=function(_0x1d5896,_0x44da18){var _0xacf5ad={};var _0x266d04={};var _0x478d21;var _0x2bc80a;return db[_0xab40('0x2f')]['findOne']({'where':{'id':_0x1d5896[_0xab40('0x51')]['id']}})['then'](handleEntityNotFound(_0x44da18,null))[_0xab40('0x22')](function(_0x52397b){if(_0x52397b){_0x478d21=_0x52397b;_0x266d04[_0xab40('0xca')]=_['keys'](db['Team'][_0xab40('0x30')]);_0x266d04[_0xab40('0x3d')]=_['keys'](_0x1d5896[_0xab40('0x3d')]);_0x266d04['filters']=_[_0xab40('0xce')](_0x266d04[_0xab40('0xca')],_0x266d04[_0xab40('0x3d')]);_0xacf5ad[_0xab40('0x43')]=_[_0xab40('0xce')](_0x266d04[_0xab40('0xca')],qs[_0xab40('0xcf')](_0x1d5896[_0xab40('0x3d')]['fields']));_0xacf5ad[_0xab40('0x43')]=_0xacf5ad[_0xab40('0x43')][_0xab40('0x48')]?_0xacf5ad[_0xab40('0x43')]:_0x266d04['model'];_0xacf5ad['order']=qs[_0xab40('0xd0')](_0x1d5896[_0xab40('0x3d')]['sort']);_0xacf5ad[_0xab40('0x3c')]=qs[_0xab40('0xcd')](_[_0xab40('0xd1')](_0x1d5896['query'],_0x266d04[_0xab40('0xcd')]));if(_0x1d5896['query']['filter']){_0xacf5ad[_0xab40('0x3c')]=_[_0xab40('0x52')](_0xacf5ad[_0xab40('0x3c')],{'$or':_[_0xab40('0x31')](_0xacf5ad[_0xab40('0x43')],function(_0x52e2b4){var _0x3b22b3={};_0x3b22b3[_0x52e2b4]={'$like':'%'+_0x1d5896[_0xab40('0x3d')][_0xab40('0x29')]+'%'};return _0x3b22b3;})});}_0xacf5ad=_[_0xab40('0x52')]({},_0xacf5ad,_0x1d5896[_0xab40('0x53')]);return _0x478d21[_0xab40('0x108')](_0xacf5ad);}})[_0xab40('0x22')](function(_0x518379){if(_0x518379){_0x2bc80a=_0x518379[_0xab40('0x48')];if(!_0x1d5896[_0xab40('0x3d')]['hasOwnProperty'](_0xab40('0xd4'))){_0xacf5ad[_0xab40('0x1a')]=qs[_0xab40('0x1a')](_0x1d5896[_0xab40('0x3d')][_0xab40('0x1a')]);_0xacf5ad[_0xab40('0x19')]=qs[_0xab40('0x19')](_0x1d5896['query'][_0xab40('0x19')]);}return _0x478d21[_0xab40('0x108')](_0xacf5ad);}})[_0xab40('0x22')](function(_0x5a81ce){if(_0x5a81ce){return _0x5a81ce?{'count':_0x2bc80a,'rows':_0x5a81ce}:null;}})[_0xab40('0x22')](respondWithResult(_0x44da18,null))[_0xab40('0x4f')](handleError(_0x44da18,null));};exports['addTeams']=function(_0x3c0dd1,_0x5e6de9){var _0x144b09=_0x3c0dd1[_0xab40('0x51')]['id'];var _0x50c50d=_0x3c0dd1[_0xab40('0x57')]?_0x3c0dd1[_0xab40('0x57')][_0xab40('0x5a')]:null;var _0x7b734d=[];return Promise[_0xab40('0xfa')]()[_0xab40('0x22')](function(){if(!_0x50c50d)throw new APIBadRequestError(_0xab40('0x109'));})[_0xab40('0x22')](function(){return db[_0xab40('0x2f')][_0xab40('0x8e')]({'where':{'id':_0x144b09}});})['then'](function(_0x266a7a){if(!_0x266a7a)throw new APINotFoundError(util[_0xab40('0xa3')](_0xab40('0xc1'),_0x3c0dd1['params']['id']));return db['sequelize'][_0xab40('0x10a')](function(_0x5926f2){return _0x266a7a[_0xab40('0x10b')](_0x50c50d,{'transaction':_0x5926f2})[_0xab40('0x22')](function(){return db[_0xab40('0x10c')][_0xab40('0x45')]({'where':{'id':{'$in':_0x50c50d}}});})[_0xab40('0x22')](function(_0x3cf6d5){var _0x251560=_[_0xab40('0x31')](_0x3cf6d5,function(_0x4d1844){return _0x4d1844[_0xab40('0x10d')]();});return Promise['all'](_0x251560);})['then'](function(_0x448200){_0x7b734d=_[_0xab40('0x10e')](_0x448200);var _0x250f64=_[_0xab40('0x31')](_0x7b734d,function(_0x3a0547){return _0x3a0547[_0xab40('0x10f')](_0x266a7a['id'],{'transaction':_0x5926f2});});return Promise[_0xab40('0x4e')](_0x250f64);})[_0xab40('0x22')](function(){if(!_0x266a7a[_0xab40('0x95')])return;var _0xf6fab9=_[_0xab40('0x29')](_0x7b734d,function(_0xa9469d){return _0xa9469d[_0xab40('0x110')](_0xab40('0x94'))===_0xab40('0x111');});var _0x7ce2cf=_[_0xab40('0x31')](_0xf6fab9,function(_0x17e39a){return db['UserVoiceQueueRt'][_0xab40('0xa6')]({'membername':_0x266a7a[_0xab40('0x2c')],'UserId':_0x266a7a['id'],'queue_name':_0x17e39a[_0xab40('0x2c')],'VoiceQueueId':_0x17e39a['id'],'interface':_[_0xab40('0x5e')](_0x266a7a[_0xab40('0x98')])?util[_0xab40('0xa3')](_0xab40('0xa4'),_0x266a7a[_0xab40('0x2c')]):_0x266a7a[_0xab40('0x98')],'paused':_0x266a7a[_0xab40('0x97')]||![],'penalty':_0x266a7a[_0xab40('0x9d')]},{'transaction':_0x5926f2});});return Promise[_0xab40('0x4e')](_0x7ce2cf);})['then'](function(){return db[_0xab40('0x112')][_0xab40('0x45')]({'where':{'teamId':{'$in':_0x50c50d}}});})[_0xab40('0x22')](function(_0x1565b4){var _0x20e2c4=_[_0xab40('0x31')](_0x1565b4,function(_0x47ac96){return db[_0xab40('0x113')]['create']({'UserId':_0x266a7a['id'],'VoicePrefixId':_0x47ac96['VoicePrefixId']},{'transaction':_0x5926f2});});return Promise[_0xab40('0x4e')](_0x20e2c4);});});})[_0xab40('0x22')](function(){for(var _0x1ba64e=0x0;_0x1ba64e<_0x7b734d[_0xab40('0x48')];_0x1ba64e++){var _0x49499f=_0x7b734d[_0x1ba64e]['getDataValue'](_0xab40('0x94'));var _0x47fc8f=_0x49499f+_0xab40('0x9f');socket[_0xab40('0x20')](_0xab40('0x26')+_0x49499f+_0xab40('0xa0'),{'UserId':_0x144b09,['queueField']:_0x7b734d[_0x1ba64e]['id']});}})[_0xab40('0x22')](respondWithStatusCode(_0x5e6de9,null))['catch'](APIHandleError(_0x5e6de9));};exports[_0xab40('0x114')]=function(_0x5d57a3,_0x99bd1){var _0x16dc9c=_0x5d57a3['params']['id'];var _0x57653d=null;if(_0x5d57a3[_0xab40('0x3d')][_0xab40('0x5a')]){_0x57653d=_[_0xab40('0xaa')](_0x5d57a3[_0xab40('0x3d')]['ids'])?_0x5d57a3[_0xab40('0x3d')][_0xab40('0x5a')]:[_0x5d57a3['query'][_0xab40('0x5a')]];}var _0x4f9c59=[];return Promise[_0xab40('0xfa')]()[_0xab40('0x22')](function(){if(!_0x57653d)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db[_0xab40('0x2f')]['findOne']({'where':{'id':_0x16dc9c}});})['then'](function(_0x3d4077){if(!_0x3d4077)throw new APINotFoundError(util[_0xab40('0xa3')](_0xab40('0xc1'),_0x5d57a3[_0xab40('0x51')]['id']));return db[_0xab40('0x61')]['transaction'](function(_0x5d5a6d){return _0x3d4077[_0xab40('0x114')](_0x57653d,{'transaction':_0x5d5a6d})[_0xab40('0x22')](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0x57653d}}});})[_0xab40('0x22')](function(_0x5eb0b4){var _0x4c0d77=_['map'](_0x5eb0b4,function(_0xba05ad){return _0xba05ad[_0xab40('0x10d')]();});return Promise['all'](_0x4c0d77);})[_0xab40('0x22')](function(_0x592d96){_0x4f9c59=_[_0xab40('0x10e')](_0x592d96);var _0x3bc1c4=_['map'](_0x4f9c59,function(_0x505d9f){return _0x505d9f[_0xab40('0x115')](_0x3d4077['id'],{'transaction':_0x5d5a6d});});return Promise['all'](_0x3bc1c4);})['then'](function(){if(!_0x3d4077[_0xab40('0x95')])return;var _0x44b493=_[_0xab40('0x29')](_0x4f9c59,function(_0x1a043c){return _0x1a043c[_0xab40('0x110')](_0xab40('0x94'))==='Voice';});var _0x4e70eb=_[_0xab40('0x31')](_0x44b493,function(_0x416a90){return db['UserVoiceQueueRt'][_0xab40('0x21')]({'where':{'VoiceQueueId':_0x416a90['id'],'UserId':_0x3d4077['id']},'transaction':_0x5d5a6d});});return Promise[_0xab40('0x4e')](_0x4e70eb);})['then'](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x57653d}}});})[_0xab40('0x22')](function(_0x43f997){var _0x3b6ebe=_['map'](_0x43f997,function(_0x20e567){return db[_0xab40('0x113')][_0xab40('0x21')]({'where':{'UserId':_0x3d4077['id'],'VoicePrefixId':_0x20e567[_0xab40('0x116')]}},{'transaction':_0x5d5a6d});});return Promise[_0xab40('0x4e')](_0x3b6ebe);});});})['then'](function(){for(var _0x49f071=0x0;_0x49f071<_0x4f9c59[_0xab40('0x48')];_0x49f071++){var _0x1a4fa1=_0x4f9c59[_0x49f071]['getDataValue'](_0xab40('0x94'));var _0x1f66a7=_0x1a4fa1+_0xab40('0x9f');socket['emit'](_0xab40('0x26')+_0x1a4fa1+_0xab40('0x117'),{'UserId':_0x16dc9c,['queueField']:_0x4f9c59[_0x49f071]['id']});}})[_0xab40('0x22')](respondWithStatusCode(_0x99bd1,null))[_0xab40('0x4f')](APIHandleError(_0x99bd1));};exports[_0xab40('0x118')]=function(_0x5f0f98,_0x409941){var _0x1875d8={};var _0x45bd15={};var _0xf5598f;var _0x27882a;return db[_0xab40('0x2f')][_0xab40('0x8e')]({'where':{'id':_0x5f0f98[_0xab40('0x51')]['id']}})[_0xab40('0x22')](handleEntityNotFound(_0x409941,null))[_0xab40('0x22')](function(_0x637a8a){if(_0x637a8a){_0xf5598f=_0x637a8a;_0x45bd15['model']=_['keys'](db['CmList']['rawAttributes']);_0x45bd15['query']=_[_0xab40('0xcb')](_0x5f0f98[_0xab40('0x3d')]);_0x45bd15['filters']=_[_0xab40('0xce')](_0x45bd15['model'],_0x45bd15['query']);_0x1875d8[_0xab40('0x43')]=_[_0xab40('0xce')](_0x45bd15[_0xab40('0xca')],qs[_0xab40('0xcf')](_0x5f0f98[_0xab40('0x3d')][_0xab40('0xcf')]));_0x1875d8[_0xab40('0x43')]=_0x1875d8[_0xab40('0x43')][_0xab40('0x48')]?_0x1875d8[_0xab40('0x43')]:_0x45bd15[_0xab40('0xca')];_0x1875d8[_0xab40('0xd7')]=qs[_0xab40('0xd0')](_0x5f0f98['query']['sort']);_0x1875d8['where']=qs['filters'](_[_0xab40('0xd1')](_0x5f0f98['query'],_0x45bd15['filters']));if(_0x5f0f98['query'][_0xab40('0x29')]){_0x1875d8[_0xab40('0x3c')]=_['merge'](_0x1875d8[_0xab40('0x3c')],{'$or':_[_0xab40('0x31')](_0x1875d8[_0xab40('0x43')],function(_0x1756d5){var _0x40b640={};_0x40b640[_0x1756d5]={'$like':'%'+_0x5f0f98[_0xab40('0x3d')][_0xab40('0x29')]+'%'};return _0x40b640;})});}_0x1875d8=_['merge']({},_0x1875d8,_0x5f0f98[_0xab40('0x53')]);return _0xf5598f['getLists'](_0x1875d8);}})['then'](function(_0x34a1e2){if(_0x34a1e2){_0x27882a=_0x34a1e2[_0xab40('0x48')];if(!_0x5f0f98[_0xab40('0x3d')][_0xab40('0xc2')](_0xab40('0xd4'))){_0x1875d8['limit']=qs['limit'](_0x5f0f98[_0xab40('0x3d')][_0xab40('0x1a')]);_0x1875d8[_0xab40('0x19')]=qs[_0xab40('0x19')](_0x5f0f98[_0xab40('0x3d')][_0xab40('0x19')]);}return _0xf5598f[_0xab40('0x118')](_0x1875d8);}})[_0xab40('0x22')](function(_0x1e29b7){if(_0x1e29b7){return _0x1e29b7?{'count':_0x27882a,'rows':_0x1e29b7}:null;}})['then'](respondWithResult(_0x409941,null))[_0xab40('0x4f')](handleError(_0x409941,null));};exports[_0xab40('0x119')]=function(_0x1e9721,_0x1fca36){var _0x23d227={};var _0x28996d={};var _0x39ace7;return db[_0xab40('0x2f')][_0xab40('0x8e')]({'where':{'id':_0x1e9721['params']['id']}})[_0xab40('0x22')](handleEntityNotFound(_0x1fca36,null))[_0xab40('0x22')](function(_0x450cde){if(_0x450cde){_0x39ace7=_0x450cde;_0x28996d[_0xab40('0xca')]=_[_0xab40('0xcb')](db[_0xab40('0x2f')][_0xab40('0x30')]);_0x28996d[_0xab40('0x3d')]=_[_0xab40('0xcb')](_0x1e9721[_0xab40('0x3d')]);_0x28996d['filters']=_[_0xab40('0xce')](_0x28996d[_0xab40('0xca')],_0x28996d[_0xab40('0x3d')]);_0x23d227[_0xab40('0x43')]=_[_0xab40('0xce')](_0x28996d['model'],qs['fields'](_0x1e9721[_0xab40('0x3d')][_0xab40('0xcf')]));_0x23d227[_0xab40('0x43')]=_0x23d227[_0xab40('0x43')][_0xab40('0x48')]?_0x23d227[_0xab40('0x43')]:_0x28996d[_0xab40('0xca')];_0x23d227[_0xab40('0xd7')]=qs[_0xab40('0xd0')](_0x1e9721[_0xab40('0x3d')][_0xab40('0xd0')]);_0x23d227[_0xab40('0x3c')]=qs[_0xab40('0xcd')](_[_0xab40('0xd1')](_0x1e9721[_0xab40('0x3d')],_0x28996d['filters']));if(_0x1e9721[_0xab40('0x3d')][_0xab40('0x29')]){_0x23d227[_0xab40('0x3c')]=_[_0xab40('0x52')](_0x23d227['where'],{'$or':_[_0xab40('0x31')](_0x23d227[_0xab40('0x43')],function(_0x28f82b){var _0x19e03e={};_0x19e03e[_0x28f82b]={'$like':'%'+_0x1e9721[_0xab40('0x3d')]['filter']+'%'};return _0x19e03e;})});}_0x23d227[_0xab40('0xca')]=db[_0xab40('0x2f')];_0x23d227['as']=_0xab40('0x27');_0x23d227=_['merge']({},_0x23d227,_0x1e9721[_0xab40('0x53')]);return _0x39ace7['getVoiceQueues']({'include':[_0x23d227]});}})['then'](function(_0x3357f4){if(_0x3357f4){var _0x4ce67f={},_0x4c31ef=[];for(var _0x5ab4d1=0x0;_0x5ab4d1<_0x3357f4[_0xab40('0x48')];_0x5ab4d1+=0x1){for(var _0x2acaac=0x0,_0x3e4e18;_0x2acaac<_0x3357f4[_0x5ab4d1][_0xab40('0x27')][_0xab40('0x48')];_0x2acaac+=0x1){_0x3e4e18=_0x3357f4[_0x5ab4d1]['Agents'][_0x2acaac]['get']({'plain':!![]});_0x4ce67f[_0x3e4e18['id']]=_0x3e4e18;}}_0x4ce67f=_[_0xab40('0x11a')](_0x4ce67f);for(var _0x18cd2c=qs[_0xab40('0x19')](_0x1e9721[_0xab40('0x3d')][_0xab40('0x19')]);_0x18cd2c<_0x4ce67f[_0xab40('0x48')]&&_0x4c31ef[_0xab40('0x48')]=_0x4177a0[_0xdfdb('0x49')]){throw new Error(_0xdfdb('0x4a'));}})[_0xdfdb('0x14')](function(){if(_0x3216bb){return db[_0xdfdb('0x26')][_0xdfdb('0x4b')]({'where':{'membername':_0x3216bb[_0xdfdb('0x1f')]},'individualHooks':!![]});}})[_0xdfdb('0x14')](function(){if(_0x3216bb){return _0x3216bb[_0xdfdb('0x4c')]({'raw':!![]});}})[_0xdfdb('0x14')](function(_0x4d463b){if(_0x3216bb){if(_0x4d463b){var _0x89dab7=[];_0x153dc9=_0x4d463b;if(_0x153dc9[_0xdfdb('0x2b')]){for(var _0x1d2271=0x0;_0x1d2271<_0x153dc9[_0xdfdb('0x2b')];_0x1d2271++){_0x89dab7[_0xdfdb('0x2c')](db['UserVoiceQueueRt']['upsert']({'membername':_0x3216bb[_0xdfdb('0x1f')],'UserId':_0x3216bb['id'],'queue_name':_0x153dc9[_0x1d2271][_0xdfdb('0x1f')],'VoiceQueueId':_0x153dc9[_0x1d2271]['id'],'interface':_0x32e2ba,'paused':_0x3216bb[_0xdfdb('0x43')]||![],'penalty':_0x153dc9[_0x1d2271]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x89dab7);}}}})[_0xdfdb('0x14')](function(){if(_0x3216bb){return db[_0xdfdb('0x28')][_0xdfdb('0xb')]({'where':{'membername':_0x3216bb[_0xdfdb('0x1f')],'exitAt':null}});}})['then'](function(_0x570611){if(_0x3216bb){if(_0x570611&&_0x570611['length']){var _0x34e0b2=[];_0x570611[_0xdfdb('0x4d')](function(_0x29f72a){_0x34e0b2[_0xdfdb('0x2c')](_0x29f72a[_0xdfdb('0x27')]({'exitAt':moment()[_0xdfdb('0x23')](_0xdfdb('0x2a'))}));});return BPromise['all'](_0x34e0b2);}}})['then'](function(){if(_0x3216bb){var _0x4b7752=[];var _0x21494b=[];var _0x5312ce=utils[_0xdfdb('0x4e')]();var _0xc3902e={'membername':_0x3216bb[_0xdfdb('0x1f')],'interface':_0x32e2ba,'enterAt':moment()['format'](_0xdfdb('0x2a')),'role':_0x3216bb[_0xdfdb('0x20')],'internal':_0x3216bb[_0xdfdb('0x21')]};_0x5312ce[_0xdfdb('0x4d')](function(_0x5146a4){_0x4b7752[_0xdfdb('0x2c')](_['merge']({'channel':_0x5146a4,'type':'LOGIN','data1':_0xdfdb('0x4f'),'data2':_0x32e2ba},_0xc3902e));if(_0x3216bb['loginInPause']){_0x21494b['push'](_['merge']({'channel':_0x5146a4,'type':_0xdfdb('0x29'),'data1':_0xdfdb('0x50')},_0xc3902e));}});return db[_0xdfdb('0x28')][_0xdfdb('0x51')](_0x4b7752['concat'](_0x21494b),{'individualHooks':!![]});}})[_0xdfdb('0x14')](function(){if(_0x3216bb){return _0x3216bb[_0xdfdb('0x27')]({'online':!![],'lastLoginAt':moment()[_0xdfdb('0x23')](_0xdfdb('0x2a')),'voicePause':_0x3216bb[_0xdfdb('0x43')]||![],'mailPause':_0x3216bb['loginInPause']||![],'chatPause':_0x3216bb[_0xdfdb('0x43')]||![],'faxPause':_0x3216bb['loginInPause']||![],'smsPause':_0x3216bb['loginInPause']||![],'openchannelPause':_0x3216bb['loginInPause']||![],'pauseType':_0x3216bb[_0xdfdb('0x43')]?_0xdfdb('0x50'):null,'lastPauseAt':moment()[_0xdfdb('0x23')](_0xdfdb('0x2a')),'interface':_0x32e2ba});}})[_0xdfdb('0x14')](function(_0xd783e4){_0xf494fc(_0xd783e4);})[_0xdfdb('0x18')](function(_0x49d47d){_0x1a438d(_0xeb4a5b['error'](0x1f4,_0x49d47d[_0xdfdb('0x1a')]));});});}; \ No newline at end of file +var _0x86f5=['SIP/%s','type','DEFAULT\x20PAUSE','body','uniqueid','bulkCreate','YYYY-MM-DD\x20HH:mm:ss','UnpauseUser','resolve','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','whatsappPause','pauseType','lastPauseAt','unpause','system','LogoutUser','all','LoginUser','mobile','phone','loginInPause','../../config/license/util','getLicense','Maximum\x20login\x20has\x20been\x20reached','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','register','GetUser','User','findAll','options','attributes','map','include','model','then','debug','stringify','catch','error','message','ShowUser','find','raw','PauseUser','where','name','role','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','MemberReport','PAUSE','length','updateAttributes','getChannels','forEach','push'];(function(_0x408a02,_0x478ca0){var _0x579bce=function(_0x2da6a0){while(--_0x2da6a0){_0x408a02['push'](_0x408a02['shift']());}};_0x579bce(++_0x478ca0);}(_0x86f5,0x127));var _0x586f=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0x86f5[_0x5cab28];return _0xa3554d;};'use strict';var _=require(_0x586f('0x0'));var util=require(_0x586f('0x1'));var moment=require('moment');var BPromise=require(_0x586f('0x2'));var Redis=require(_0x586f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x586f('0x4'));var logger=require(_0x586f('0x5'))(_0x586f('0x6'));var config=require(_0x586f('0x7'));config[_0x586f('0x8')]=_[_0x586f('0x9')](config[_0x586f('0x8')],{'host':_0x586f('0xa'),'port':0x18eb});var socket=require(_0x586f('0xb'))(new Redis(config[_0x586f('0x8')]));require(_0x586f('0xc'))[_0x586f('0xd')](socket);exports[_0x586f('0xe')]=function(_0x515369){var _0x1262ba=this;return new Promise(function(_0x4ec1fd,_0x259857){return db[_0x586f('0xf')][_0x586f('0x10')]({'raw':_0x515369['options']?_0x515369['options']['raw']===undefined?!![]:![]:!![],'where':_0x515369[_0x586f('0x11')]?_0x515369[_0x586f('0x11')]['where']||null:null,'attributes':_0x515369[_0x586f('0x11')]?_0x515369[_0x586f('0x11')][_0x586f('0x12')]||null:null,'limit':_0x515369['options']?_0x515369['options']['limit']||null:null,'include':_0x515369[_0x586f('0x11')]?_0x515369[_0x586f('0x11')]['include']?_[_0x586f('0x13')](_0x515369[_0x586f('0x11')][_0x586f('0x14')],function(_0x4905a5){return{'model':db[_0x4905a5['model']],'as':_0x4905a5['as'],'attributes':_0x4905a5[_0x586f('0x12')],'include':_0x4905a5[_0x586f('0x14')]?_[_0x586f('0x13')](_0x4905a5[_0x586f('0x14')],function(_0x10682e){return{'model':db[_0x10682e[_0x586f('0x15')]],'as':_0x10682e['as'],'attributes':_0x10682e[_0x586f('0x12')],'include':_0x10682e[_0x586f('0x14')]?_[_0x586f('0x13')](_0x10682e[_0x586f('0x14')],function(_0x177f93){return{'model':db[_0x177f93[_0x586f('0x15')]],'as':_0x177f93['as'],'attributes':_0x177f93[_0x586f('0x12')]};}):[]};}):[]};}):[]:[]})[_0x586f('0x16')](function(_0x57bfc1){logger['info'](_0x586f('0xe'),_0x515369);logger[_0x586f('0x17')](_0x586f('0xe'),_0x515369,JSON[_0x586f('0x18')](_0x57bfc1));_0x4ec1fd(_0x57bfc1);})[_0x586f('0x19')](function(_0x1c0c19){logger[_0x586f('0x1a')](_0x586f('0xe'),_0x1c0c19[_0x586f('0x1b')],_0x515369);_0x259857(_0x1262ba[_0x586f('0x1a')](0x1f4,_0x1c0c19['message']));});});};exports[_0x586f('0x1c')]=function(_0x3c3cb0){var _0x5757c5=this;return new Promise(function(_0x51e5d9,_0x5f1a93){return db[_0x586f('0xf')][_0x586f('0x1d')]({'raw':_0x3c3cb0['options']?_0x3c3cb0['options'][_0x586f('0x1e')]===undefined?!![]:![]:!![],'where':_0x3c3cb0[_0x586f('0x11')]?_0x3c3cb0[_0x586f('0x11')]['where']||null:null,'attributes':_0x3c3cb0['options']?_0x3c3cb0[_0x586f('0x11')][_0x586f('0x12')]||null:null,'include':_0x3c3cb0[_0x586f('0x11')]?_0x3c3cb0[_0x586f('0x11')]['include']?_['map'](_0x3c3cb0[_0x586f('0x11')][_0x586f('0x14')],function(_0x199f36){return{'model':db[_0x199f36[_0x586f('0x15')]],'as':_0x199f36['as'],'attributes':_0x199f36[_0x586f('0x12')],'include':_0x199f36[_0x586f('0x14')]?_['map'](_0x199f36[_0x586f('0x14')],function(_0x356e3c){return{'model':db[_0x356e3c['model']],'as':_0x356e3c['as'],'attributes':_0x356e3c[_0x586f('0x12')],'include':_0x356e3c[_0x586f('0x14')]?_[_0x586f('0x13')](_0x356e3c['include'],function(_0x33e5cb){return{'model':db[_0x33e5cb[_0x586f('0x15')]],'as':_0x33e5cb['as'],'attributes':_0x33e5cb[_0x586f('0x12')]};}):[]};}):[]};}):[]:[]})[_0x586f('0x16')](function(_0x2172ad){logger['info'](_0x586f('0x1c'),_0x3c3cb0);logger[_0x586f('0x17')](_0x586f('0x1c'),_0x3c3cb0,JSON['stringify'](_0x2172ad));_0x51e5d9(_0x2172ad);})[_0x586f('0x19')](function(_0x3833a8){logger['error'](_0x586f('0x1c'),_0x3833a8[_0x586f('0x1b')],_0x3c3cb0);_0x5f1a93(_0x5757c5[_0x586f('0x1a')](0x1f4,_0x3833a8[_0x586f('0x1b')]));});});};exports[_0x586f('0x1f')]=function(_0x9862a4){var _0x4867c1;return db[_0x586f('0xf')][_0x586f('0x1d')]({'where':_0x9862a4[_0x586f('0x11')][_0x586f('0x20')]||{},'attributes':['id',_0x586f('0x21'),_0x586f('0x22'),_0x586f('0x23'),_0x586f('0x24')]})['then'](function(_0x41e0f0){if(!_0x41e0f0){throw new Error(util[_0x586f('0x25')](_0x586f('0x26'),_0x9862a4[_0x586f('0x27')]['id']));}_0x4867c1=_0x41e0f0;return db[_0x586f('0x28')][_0x586f('0x29')]({'paused':0x1},{'where':{'UserId':_0x4867c1['id']},'individualHooks':!![]});})['then'](function(){return db[_0x586f('0x2a')][_0x586f('0x10')]({'where':{'membername':_0x4867c1[_0x586f('0x21')],'type':_0x586f('0x2b'),'exitAt':null}});})[_0x586f('0x16')](function(_0x3f4899){if(_0x3f4899&&_0x3f4899[_0x586f('0x2c')]){var _0x23989=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3b583d=0x0,_0x3a1896=_0x3f4899['length'];_0x3b583d<_0x3a1896;_0x3b583d++){_0x3f4899[_0x3b583d][_0x586f('0x2d')]({'exitAt':_0x23989});}}})[_0x586f('0x16')](function(){var _0x33350d=[];var _0x487948=utils[_0x586f('0x2e')]();_0x487948[_0x586f('0x2f')](function(_0x5337e5){_0x33350d[_0x586f('0x30')]({'channel':_0x5337e5,'membername':_0x4867c1['name'],'interface':_['isNil'](_0x4867c1[_0x586f('0x24')])?util[_0x586f('0x25')](_0x586f('0x31'),_0x4867c1[_0x586f('0x21')]):_0x4867c1[_0x586f('0x24')],'type':_0x586f('0x2b'),'enterAt':moment()[_0x586f('0x25')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x9862a4['body'][_0x586f('0x32')]||_0x586f('0x33'),'role':_0x4867c1['role'],'internal':_0x4867c1[_0x586f('0x23')],'uniqueid':_0x9862a4[_0x586f('0x34')][_0x586f('0x35')]||null});});return db[_0x586f('0x2a')][_0x586f('0x36')](_0x33350d,{'individualHooks':!![]});})[_0x586f('0x16')](function(){return _0x4867c1[_0x586f('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x9862a4['body'][_0x586f('0x32')]||_0x586f('0x33'),'lastPauseAt':moment()[_0x586f('0x25')](_0x586f('0x37'))});})[_0x586f('0x19')](function(_0x37c815){throw _0x37c815;});};exports[_0x586f('0x38')]=function(_0x828879){return Promise[_0x586f('0x39')]()[_0x586f('0x16')](function(){if(_0x828879[_0x586f('0x34')][_0x586f('0x3a')]&&!utils['isValidChannel'](_0x828879[_0x586f('0x34')][_0x586f('0x3a')])){throw new Error(util[_0x586f('0x25')](_0x586f('0x3b'),_0x828879[_0x586f('0x34')][_0x586f('0x3a')]));}return db[_0x586f('0xf')][_0x586f('0x3c')]({'where':_0x828879['options']['where']||{},'attributes':['id',_0x586f('0x21'),_0x586f('0x22'),'internal','interface',_0x586f('0x3d'),_0x586f('0x3e'),_0x586f('0x3f'),_0x586f('0x40'),_0x586f('0x41'),_0x586f('0x42'),'smsPause',_0x586f('0x43'),_0x586f('0x44'),_0x586f('0x45')]});})[_0x586f('0x16')](function(_0x53cea2){if(!_0x53cea2){throw new Error(util[_0x586f('0x25')](_0x586f('0x26'),_0x828879[_0x586f('0x27')]['id']));}return _0x53cea2[_0x586f('0x46')](_0x828879[_0x586f('0x34')]['channel'],_0x586f('0x47'));})[_0x586f('0x19')](function(_0x482127){throw _0x482127;});};exports[_0x586f('0x48')]=function(_0x24af6b){var _0x6aebd1=this;return new Promise(function(_0x35f01b,_0x5ac5d1){var _0x300fd3;return db[_0x586f('0xf')][_0x586f('0x3c')]({'where':_0x24af6b[_0x586f('0x11')]['where']||{},'attributes':['id',_0x586f('0x21')]})[_0x586f('0x16')](function(_0x19171b){if(_0x19171b){_0x300fd3=_0x19171b;return db[_0x586f('0x28')]['destroy']({'where':{'membername':_0x300fd3[_0x586f('0x21')]},'individualHooks':!![]});}})[_0x586f('0x16')](function(){if(_0x300fd3){return db[_0x586f('0x2a')][_0x586f('0x10')]({'where':{'membername':_0x300fd3[_0x586f('0x21')],'exitAt':null}});}})[_0x586f('0x16')](function(_0x236017){if(_0x300fd3){if(_0x236017&&_0x236017['length']){var _0x5bcddf=[];_0x236017[_0x586f('0x2f')](function(_0x3303af){_0x5bcddf['push'](_0x3303af[_0x586f('0x29')]({'exitAt':moment()['format'](_0x586f('0x37'))}));});return BPromise[_0x586f('0x49')](_0x5bcddf);}}})['then'](function(){if(_0x300fd3){return _0x300fd3['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0xe9c194){_0x35f01b(_0xe9c194);})[_0x586f('0x19')](function(_0x9e4075){_0x5ac5d1(_0x6aebd1[_0x586f('0x1a')](0x1f4,_0x9e4075[_0x586f('0x1b')]));});});};exports[_0x586f('0x4a')]=function(_0x52f8e1){var _0x5e5aaa=this;return new Promise(function(_0x66fe9b,_0x3883f8){var _0x25bcb4;var _0x38bc0b;var _0x397261;var _0x16370e;return db[_0x586f('0xf')][_0x586f('0x3c')]({'where':_0x52f8e1[_0x586f('0x11')][_0x586f('0x20')]||{},'attributes':['id',_0x586f('0x21'),'role',_0x586f('0x4b'),_0x586f('0x4c'),_0x586f('0x23'),_0x586f('0x4d'),_0x586f('0x24')]})[_0x586f('0x16')](function(_0x22ea2a){if(_0x22ea2a){_0x25bcb4=_0x22ea2a;_0x16370e=_0x52f8e1[_0x586f('0x34')]['interface']?_0x52f8e1[_0x586f('0x34')]['interface']:util[_0x586f('0x25')](_0x586f('0x31'),_0x25bcb4[_0x586f('0x21')]);return db[_0x586f('0xf')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x25bcb4['id']}}});}})[_0x586f('0x16')](function(_0x2648d3){if(_0x2648d3){_0x397261=_0x2648d3;return require(_0x586f('0x4e'))[_0x586f('0x4f')]();}})['then'](function(_0x2fe61e){if(_0x2fe61e&&_0x2fe61e['agents']&&_0x397261>=_0x2fe61e['agents']){throw new Error(_0x586f('0x50'));}})[_0x586f('0x16')](function(){if(_0x25bcb4){return db[_0x586f('0x28')]['destroy']({'where':{'membername':_0x25bcb4[_0x586f('0x21')]},'individualHooks':!![]});}})[_0x586f('0x16')](function(){if(_0x25bcb4){return _0x25bcb4['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x1975fa){if(_0x25bcb4){if(_0x1975fa){var _0x279031=[];_0x38bc0b=_0x1975fa;if(_0x38bc0b[_0x586f('0x2c')]){for(var _0x4c8eff=0x0;_0x4c8eff<_0x38bc0b[_0x586f('0x2c')];_0x4c8eff++){_0x279031[_0x586f('0x30')](db[_0x586f('0x28')]['upsert']({'membername':_0x25bcb4['name'],'UserId':_0x25bcb4['id'],'queue_name':_0x38bc0b[_0x4c8eff][_0x586f('0x21')],'VoiceQueueId':_0x38bc0b[_0x4c8eff]['id'],'interface':_0x16370e,'paused':_0x25bcb4['loginInPause']||![],'penalty':_0x38bc0b[_0x4c8eff]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x586f('0x49')](_0x279031);}}}})[_0x586f('0x16')](function(){if(_0x25bcb4){return db[_0x586f('0x2a')][_0x586f('0x10')]({'where':{'membername':_0x25bcb4[_0x586f('0x21')],'exitAt':null}});}})[_0x586f('0x16')](function(_0x43f63d){if(_0x25bcb4){if(_0x43f63d&&_0x43f63d[_0x586f('0x2c')]){var _0x59f7db=[];_0x43f63d[_0x586f('0x2f')](function(_0x2be5b2){_0x59f7db[_0x586f('0x30')](_0x2be5b2[_0x586f('0x29')]({'exitAt':moment()[_0x586f('0x25')](_0x586f('0x37'))}));});return BPromise[_0x586f('0x49')](_0x59f7db);}}})[_0x586f('0x16')](function(){if(_0x25bcb4){var _0x1c6bf7=[];var _0x513555=[];var _0x2c6357=utils[_0x586f('0x2e')]();var _0x3fb239={'membername':_0x25bcb4[_0x586f('0x21')],'interface':_0x16370e,'enterAt':moment()[_0x586f('0x25')](_0x586f('0x37')),'role':_0x25bcb4['role'],'internal':_0x25bcb4[_0x586f('0x23')]};_0x2c6357['forEach'](function(_0x8bed0f){_0x1c6bf7[_0x586f('0x30')](_[_0x586f('0x51')]({'channel':_0x8bed0f,'type':_0x586f('0x52'),'data1':_0x586f('0x53'),'data2':_0x16370e},_0x3fb239));if(_0x25bcb4[_0x586f('0x4d')]){_0x513555['push'](_[_0x586f('0x51')]({'channel':_0x8bed0f,'type':_0x586f('0x2b'),'data1':_0x586f('0x54')},_0x3fb239));}});return db['MemberReport']['bulkCreate'](_0x1c6bf7[_0x586f('0x55')](_0x513555),{'individualHooks':!![]});}})[_0x586f('0x16')](function(){if(_0x25bcb4){return _0x25bcb4[_0x586f('0x29')]({'online':!![],'lastLoginAt':moment()[_0x586f('0x25')](_0x586f('0x37')),'voicePause':_0x25bcb4[_0x586f('0x4d')]||![],'mailPause':_0x25bcb4[_0x586f('0x4d')]||![],'chatPause':_0x25bcb4[_0x586f('0x4d')]||![],'faxPause':_0x25bcb4[_0x586f('0x4d')]||![],'smsPause':_0x25bcb4[_0x586f('0x4d')]||![],'openchannelPause':_0x25bcb4[_0x586f('0x4d')]||![],'pauseType':_0x25bcb4[_0x586f('0x4d')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x586f('0x25')](_0x586f('0x37')),'interface':_0x16370e});}})[_0x586f('0x16')](function(_0x4dff2a){_0x66fe9b(_0x4dff2a);})[_0x586f('0x19')](function(_0x53f07f){_0x3883f8(_0x5e5aaa['error'](0x1f4,_0x53f07f[_0x586f('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index b8317c8..a24d54e 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 _0x311d=['remove','removeListener','length','user:','./user.events','save'];(function(_0x170d5e,_0x2e3c89){var _0x1b2146=function(_0x28275e){while(--_0x28275e){_0x170d5e['push'](_0x170d5e['shift']());}};_0x1b2146(++_0x2e3c89);}(_0x311d,0x1b4));var _0xd311=function(_0x422b37,_0x11cca6){_0x422b37=_0x422b37-0x0;var _0x1744a1=_0x311d[_0x422b37];return _0x1744a1;};'use strict';var UserEvents=require(_0xd311('0x0'));var events=[_0xd311('0x1'),_0xd311('0x2'),'update'];function createListener(_0x11a080,_0x4b2843){return function(_0x3d25a4){_0x4b2843['emit'](_0x11a080,_0x3d25a4);};}function removeListener(_0xe906dd,_0x4702fc){return function(){UserEvents[_0xd311('0x3')](_0xe906dd,_0x4702fc);};}exports['register']=function(_0x2876f7){for(var _0xccaa5f=0x0,_0x6630c2=events[_0xd311('0x4')];_0xccaa5f<_0x6630c2;_0xccaa5f++){var _0x109fc1=events[_0xccaa5f];var _0x127ba1=createListener(_0xd311('0x5')+_0x109fc1,_0x2876f7);UserEvents['on'](_0x109fc1,_0x127ba1);}}; \ No newline at end of file +var _0xf562=['update','emit','removeListener','user:','./user.events','save'];(function(_0x5a01f3,_0x2773eb){var _0x5571da=function(_0x17f82c){while(--_0x17f82c){_0x5a01f3['push'](_0x5a01f3['shift']());}};_0x5571da(++_0x2773eb);}(_0xf562,0xe8));var _0x2f56=function(_0x4e71c8,_0x22fa24){_0x4e71c8=_0x4e71c8-0x0;var _0x3f28ce=_0xf562[_0x4e71c8];return _0x3f28ce;};'use strict';var UserEvents=require(_0x2f56('0x0'));var events=[_0x2f56('0x1'),'remove',_0x2f56('0x2')];function createListener(_0x499b2c,_0xae280){return function(_0x57cdc1){_0xae280[_0x2f56('0x3')](_0x499b2c,_0x57cdc1);};}function removeListener(_0x4112d0,_0x18ab99){return function(){UserEvents[_0x2f56('0x4')](_0x4112d0,_0x18ab99);};}exports['register']=function(_0x4e3a7b){for(var _0xe1efa3=0x0,_0x4a484a=events['length'];_0xe1efa3<_0x4a484a;_0xe1efa3++){var _0x534f2f=events[_0xe1efa3];var _0x31adb5=createListener(_0x2f56('0x5')+_0x534f2f,_0x4e3a7b);UserEvents['on'](_0x534f2f,_0x31adb5);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index d9f5f4d..1b648c0 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x17d666,_0x516a5d){var _0x4722f9=function(_0x32b22b){while(--_0x32b22b){_0x17d666['push'](_0x17d666['shift']());}};_0x4722f9(++_0x516a5d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1fd2c4,_0x589b35){var _0x42e0d7=function(_0x2cb6a3){while(--_0x2cb6a3){_0x1fd2c4['push'](_0x1fd2c4['shift']());}};_0x42e0d7(++_0x589b35);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 100c5d6..e403dd7 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 _0xe780=['INTEGER','sequelize'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xe780,0x77));var _0x0e78=function(_0x348c18,_0xfbef1d){_0x348c18=_0x348c18-0x0;var _0x456457=_0xe780[_0x348c18];return _0x456457;};'use strict';var Sequelize=require(_0x0e78('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x0e78('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8b0b=['sequelize','exports','INTEGER'];(function(_0x3477f8,_0x5eaf95){var _0x6b43af=function(_0x380da6){while(--_0x380da6){_0x3477f8['push'](_0x3477f8['shift']());}};_0x6b43af(++_0x5eaf95);}(_0x8b0b,0x1e3));var _0xb8b0=function(_0x48f7cf,_0x4baa04){_0x48f7cf=_0x48f7cf-0x0;var _0xc201c0=_0x8b0b[_0x48f7cf];return _0xc201c0;};'use strict';var Sequelize=require(_0xb8b0('0x0'));module[_0xb8b0('0x1')]={'penalty':{'type':Sequelize[_0xb8b0('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index a53f93a..323f436 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 _0xc5f6=['./userChatQueue.attributes','exports','UserChatQueue','lodash','util','../../config/logger','request-promise','path','../../config/environment'];(function(_0x2f1114,_0x4561f1){var _0x2fe856=function(_0x8397f8){while(--_0x8397f8){_0x2f1114['push'](_0x2f1114['shift']());}};_0x2fe856(++_0x4561f1);}(_0xc5f6,0x6f));var _0x6c5f=function(_0x2b1e9f,_0x3a94b2){_0x2b1e9f=_0x2b1e9f-0x0;var _0x573c1d=_0xc5f6[_0x2b1e9f];return _0x573c1d;};'use strict';var _=require(_0x6c5f('0x0'));var util=require(_0x6c5f('0x1'));var logger=require(_0x6c5f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6c5f('0x3'));var fs=require('fs');var path=require(_0x6c5f('0x4'));var rimraf=require('rimraf');var config=require(_0x6c5f('0x5'));var attributes=require(_0x6c5f('0x6'));module[_0x6c5f('0x7')]=function(_0xb5f8be,_0x2ffa32){return _0xb5f8be['define'](_0x6c5f('0x8'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71be=['UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x71be,0x16a));var _0xe71b=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0x71be[_0x55c1f0];return _0x1530fa;};'use strict';var _=require(_0xe71b('0x0'));var util=require(_0xe71b('0x1'));var logger=require(_0xe71b('0x2'))(_0xe71b('0x3'));var moment=require(_0xe71b('0x4'));var BPromise=require(_0xe71b('0x5'));var rp=require(_0xe71b('0x6'));var fs=require('fs');var path=require(_0xe71b('0x7'));var rimraf=require(_0xe71b('0x8'));var config=require(_0xe71b('0x9'));var attributes=require(_0xe71b('0xa'));module[_0xe71b('0xb')]=function(_0x1d06a4,_0x4877e6){return _0x1d06a4[_0xe71b('0xc')](_0xe71b('0xd'),attributes,{'tableName':_0xe71b('0xe'),'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 6820408..f88adda 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 _0x10e5=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x10e5,0x6b));var _0x510e=function(_0x40d5cc,_0xf9d2c7){_0x40d5cc=_0x40d5cc-0x0;var _0x6950af=_0x10e5[_0x40d5cc];return _0x6950af;};'use strict';var _=require(_0x510e('0x0'));var util=require(_0x510e('0x1'));var moment=require(_0x510e('0x2'));var BPromise=require(_0x510e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x510e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x510e('0x5'));var logger=require(_0x510e('0x6'))(_0x510e('0x7'));var config=require(_0x510e('0x8'));var jayson=require(_0x510e('0x9'));var client=jayson[_0x510e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48d59,_0xbfbf65,_0x483ee8){return new BPromise(function(_0x947e00,_0x49021b){return client[_0x510e('0xb')](_0x48d59,_0x483ee8)[_0x510e('0xc')](function(_0x1b5ca9){logger[_0x510e('0xd')](_0x510e('0xe'),_0xbfbf65,'request\x20sent');logger[_0x510e('0xf')](_0x510e('0x10'),_0xbfbf65,'request\x20sent',JSON[_0x510e('0x11')](_0x1b5ca9));if(_0x1b5ca9[_0x510e('0x12')]){if(_0x1b5ca9[_0x510e('0x12')][_0x510e('0x13')]===0x1f4){logger[_0x510e('0x12')](_0x510e('0xe'),_0xbfbf65,_0x1b5ca9[_0x510e('0x12')][_0x510e('0x14')]);return _0x49021b(_0x1b5ca9[_0x510e('0x12')][_0x510e('0x14')]);}logger[_0x510e('0x12')](_0x510e('0xe'),_0xbfbf65,_0x1b5ca9['error'][_0x510e('0x14')]);return _0x947e00(_0x1b5ca9[_0x510e('0x12')][_0x510e('0x14')]);}else{logger[_0x510e('0xd')](_0x510e('0xe'),_0xbfbf65,'request\x20sent');_0x947e00(_0x1b5ca9['result']['message']);}})[_0x510e('0x15')](function(_0x44c0c8){logger[_0x510e('0x12')](_0x510e('0xe'),_0xbfbf65,_0x44c0c8);_0x49021b(_0x44c0c8);});});} \ No newline at end of file +var _0xaf92=['rpc','../../config/environment','jayson/promise','client','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5a2d57,_0x45f756){var _0x527095=function(_0x3baa1b){while(--_0x3baa1b){_0x5a2d57['push'](_0x5a2d57['shift']());}};_0x527095(++_0x45f756);}(_0xaf92,0x1c7));var _0x2af9=function(_0x3e5afe,_0x117c59){_0x3e5afe=_0x3e5afe-0x0;var _0x274c80=_0xaf92[_0x3e5afe];return _0x274c80;};'use strict';var _=require(_0x2af9('0x0'));var util=require('util');var moment=require(_0x2af9('0x1'));var BPromise=require(_0x2af9('0x2'));var rs=require(_0x2af9('0x3'));var fs=require('fs');var Redis=require(_0x2af9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2af9('0x5'));var logger=require(_0x2af9('0x6'))(_0x2af9('0x7'));var config=require(_0x2af9('0x8'));var jayson=require(_0x2af9('0x9'));var client=jayson[_0x2af9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25011d,_0x283f28,_0x4dc034){return new BPromise(function(_0x4dd556,_0x2352b4){return client[_0x2af9('0xb')](_0x25011d,_0x4dc034)[_0x2af9('0xc')](function(_0xd345e9){logger[_0x2af9('0xd')](_0x2af9('0xe'),_0x283f28,_0x2af9('0xf'));logger[_0x2af9('0x10')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x283f28,_0x2af9('0xf'),JSON[_0x2af9('0x11')](_0xd345e9));if(_0xd345e9[_0x2af9('0x12')]){if(_0xd345e9[_0x2af9('0x12')]['code']===0x1f4){logger['error'](_0x2af9('0xe'),_0x283f28,_0xd345e9[_0x2af9('0x12')][_0x2af9('0x13')]);return _0x2352b4(_0xd345e9[_0x2af9('0x12')]['message']);}logger[_0x2af9('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x283f28,_0xd345e9[_0x2af9('0x12')][_0x2af9('0x13')]);return _0x4dd556(_0xd345e9[_0x2af9('0x12')]['message']);}else{logger[_0x2af9('0xd')](_0x2af9('0xe'),_0x283f28,_0x2af9('0xf'));_0x4dd556(_0xd345e9[_0x2af9('0x14')]['message']);}})[_0x2af9('0x15')](function(_0xbf537){logger[_0x2af9('0x12')](_0x2af9('0xe'),_0x283f28,_0xbf537);_0x2352b4(_0xbf537);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index d327bce..3eb6c27 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x355084,_0x3a531c){var _0x2ccf50=function(_0x31d5f0){while(--_0x31d5f0){_0x355084['push'](_0x355084['shift']());}};_0x2ccf50(++_0x3a531c);}(_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(_0x3e7e18,_0x6d6dfd){var _0xbc91f2=function(_0x4be5ae){while(--_0x4be5ae){_0x3e7e18['push'](_0x3e7e18['shift']());}};_0xbc91f2(++_0x6d6dfd);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0xcb91[_0x421196];return _0x2738af;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index f5545ce..fe04b56 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 _0x788e=['INTEGER','sequelize'];(function(_0x1d9de8,_0x2df873){var _0x4f8591=function(_0x571b39){while(--_0x571b39){_0x1d9de8['push'](_0x1d9de8['shift']());}};_0x4f8591(++_0x2df873);}(_0x788e,0x9b));var _0xe788=function(_0x123c80,_0x432b80){_0x123c80=_0x123c80-0x0;var _0x52bbcf=_0x788e[_0x123c80];return _0x52bbcf;};'use strict';var Sequelize=require(_0xe788('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xe788('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf94a=['exports','INTEGER'];(function(_0x16d25e,_0x2a50ca){var _0x4b4c17=function(_0x4e1fd4){while(--_0x4e1fd4){_0x16d25e['push'](_0x16d25e['shift']());}};_0x4b4c17(++_0x2a50ca);}(_0xf94a,0x19a));var _0xaf94=function(_0x2619fb,_0x2c60f6){_0x2619fb=_0x2619fb-0x0;var _0x1ac4c4=_0xf94a[_0x2619fb];return _0x1ac4c4;};'use strict';var Sequelize=require('sequelize');module[_0xaf94('0x0')]={'penalty':{'type':Sequelize[_0xaf94('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'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 86b4917..251b367 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 _0x2e7e=['bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','define','user_has_fax_queues','lodash','util','../../config/logger','moment'];(function(_0x18be13,_0x12f269){var _0x17317b=function(_0x449d31){while(--_0x449d31){_0x18be13['push'](_0x18be13['shift']());}};_0x17317b(++_0x12f269);}(_0x2e7e,0xa1));var _0xe2e7=function(_0x14ae21,_0x2b0d81){_0x14ae21=_0x14ae21-0x0;var _0x2ba5b4=_0x2e7e[_0x14ae21];return _0x2ba5b4;};'use strict';var _=require(_0xe2e7('0x0'));var util=require(_0xe2e7('0x1'));var logger=require(_0xe2e7('0x2'))('api');var moment=require(_0xe2e7('0x3'));var BPromise=require(_0xe2e7('0x4'));var rp=require(_0xe2e7('0x5'));var fs=require('fs');var path=require(_0xe2e7('0x6'));var rimraf=require('rimraf');var config=require(_0xe2e7('0x7'));var attributes=require(_0xe2e7('0x8'));module['exports']=function(_0x4a4a00,_0x59e133){return _0x4a4a00[_0xe2e7('0x9')]('UserFaxQueue',attributes,{'tableName':_0xe2e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33a1=['lodash','util','../../config/logger','moment','request-promise','../../config/environment','exports','define'];(function(_0x5ad178,_0xc36ba2){var _0x232fd4=function(_0x330683){while(--_0x330683){_0x5ad178['push'](_0x5ad178['shift']());}};_0x232fd4(++_0xc36ba2);}(_0x33a1,0x180));var _0x133a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x33a1[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x133a('0x0'));var util=require(_0x133a('0x1'));var logger=require(_0x133a('0x2'))('api');var moment=require(_0x133a('0x3'));var BPromise=require('bluebird');var rp=require(_0x133a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x133a('0x5'));var attributes=require('./userFaxQueue.attributes');module[_0x133a('0x6')]=function(_0x5be4a2,_0x508594){return _0x5be4a2[_0x133a('0x7')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 07ffdd7..e0edc23 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 _0x5e74=['UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x408ddd,_0x48c30c){var _0x397ca9=function(_0x4de110){while(--_0x4de110){_0x408ddd['push'](_0x408ddd['shift']());}};_0x397ca9(++_0x48c30c);}(_0x5e74,0x92));var _0x45e7=function(_0x3bf2c4,_0x75a8d9){_0x3bf2c4=_0x3bf2c4-0x0;var _0x4f98d3=_0x5e74[_0x3bf2c4];return _0x4f98d3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x45e7('0x0'));var BPromise=require(_0x45e7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45e7('0x2'));var db=require(_0x45e7('0x3'))['db'];var utils=require(_0x45e7('0x4'));var logger=require(_0x45e7('0x5'))(_0x45e7('0x6'));var config=require(_0x45e7('0x7'));var jayson=require(_0x45e7('0x8'));var client=jayson['client'][_0x45e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x356fbe,_0x3d7f56,_0x128397){return new BPromise(function(_0x23d238,_0x291edf){return client[_0x45e7('0xa')](_0x356fbe,_0x128397)[_0x45e7('0xb')](function(_0x13ed78){logger['info'](_0x45e7('0xc'),_0x3d7f56,_0x45e7('0xd'));logger[_0x45e7('0xe')](_0x45e7('0xf'),_0x3d7f56,_0x45e7('0xd'),JSON[_0x45e7('0x10')](_0x13ed78));if(_0x13ed78[_0x45e7('0x11')]){if(_0x13ed78[_0x45e7('0x11')][_0x45e7('0x12')]===0x1f4){logger[_0x45e7('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x3d7f56,_0x13ed78[_0x45e7('0x11')][_0x45e7('0x13')]);return _0x291edf(_0x13ed78[_0x45e7('0x11')]['message']);}logger['error'](_0x45e7('0xc'),_0x3d7f56,_0x13ed78[_0x45e7('0x11')][_0x45e7('0x13')]);return _0x23d238(_0x13ed78[_0x45e7('0x11')]['message']);}else{logger[_0x45e7('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x3d7f56,_0x45e7('0xd'));_0x23d238(_0x13ed78[_0x45e7('0x15')][_0x45e7('0x13')]);}})[_0x45e7('0x16')](function(_0x536a1f){logger[_0x45e7('0x11')](_0x45e7('0xc'),_0x3d7f56,_0x536a1f);_0x291edf(_0x536a1f);});});} \ No newline at end of file +var _0x8369=['http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x8369,0x110));var _0x9836=function(_0x1b4941,_0x1a75b4){_0x1b4941=_0x1b4941-0x0;var _0x142c8f=_0x8369[_0x1b4941];return _0x142c8f;};'use strict';var _=require(_0x9836('0x0'));var util=require(_0x9836('0x1'));var moment=require(_0x9836('0x2'));var BPromise=require('bluebird');var rs=require(_0x9836('0x3'));var fs=require('fs');var Redis=require(_0x9836('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9836('0x5'));var config=require(_0x9836('0x6'));var jayson=require(_0x9836('0x7'));var client=jayson['client'][_0x9836('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x543c51,_0x30b081,_0x1207a5){return new BPromise(function(_0x391fc9,_0x8f5c45){return client[_0x9836('0x9')](_0x543c51,_0x1207a5)[_0x9836('0xa')](function(_0x4779e9){logger['info'](_0x9836('0xb'),_0x30b081,_0x9836('0xc'));logger['debug'](_0x9836('0xd'),_0x30b081,_0x9836('0xc'),JSON[_0x9836('0xe')](_0x4779e9));if(_0x4779e9[_0x9836('0xf')]){if(_0x4779e9[_0x9836('0xf')][_0x9836('0x10')]===0x1f4){logger[_0x9836('0xf')](_0x9836('0xb'),_0x30b081,_0x4779e9[_0x9836('0xf')]['message']);return _0x8f5c45(_0x4779e9['error'][_0x9836('0x11')]);}logger['error'](_0x9836('0xb'),_0x30b081,_0x4779e9[_0x9836('0xf')]['message']);return _0x391fc9(_0x4779e9[_0x9836('0xf')][_0x9836('0x11')]);}else{logger[_0x9836('0x12')](_0x9836('0xb'),_0x30b081,_0x9836('0xc'));_0x391fc9(_0x4779e9['result'][_0x9836('0x11')]);}})[_0x9836('0x13')](function(_0x46362f){logger[_0x9836('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x30b081,_0x46362f);_0x8f5c45(_0x46362f);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 18138ce..201ef59 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x10a622,_0x1804be){var _0x707210=function(_0x557c30){while(--_0x557c30){_0x10a622['push'](_0x10a622['shift']());}};_0x707210(++_0x1804be);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5485e1,_0x17b6ad){var _0x1ad02d=function(_0x51abb1){while(--_0x51abb1){_0x5485e1['push'](_0x5485e1['shift']());}};_0x1ad02d(++_0x17b6ad);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x21af3a,_0x386e1d){_0x21af3a=_0x21af3a-0x0;var _0x268a49=_0xcb91[_0x21af3a];return _0x268a49;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 4dc4903..57d7000 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 _0xdded=['INTEGER','sequelize','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xdded,0x115));var _0xddde=function(_0x6e2ec0,_0x18ab4f){_0x6e2ec0=_0x6e2ec0-0x0;var _0x4b466c=_0xdded[_0x6e2ec0];return _0x4b466c;};'use strict';var Sequelize=require(_0xddde('0x0'));module[_0xddde('0x1')]={'penalty':{'type':Sequelize[_0xddde('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdf69=['sequelize','exports'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xdf69,0xf6));var _0x9df6=function(_0x204bd1,_0xb5e7a4){_0x204bd1=_0x204bd1-0x0;var _0x3711f4=_0xdf69[_0x204bd1];return _0x3711f4;};'use strict';var Sequelize=require(_0x9df6('0x0'));module[_0x9df6('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 e8651b5..d2198f3 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 _0xff65=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff65,0xa8));var _0x5ff6=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xff65[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x5ff6('0x0'));var util=require(_0x5ff6('0x1'));var logger=require('../../config/logger')(_0x5ff6('0x2'));var moment=require(_0x5ff6('0x3'));var BPromise=require(_0x5ff6('0x4'));var rp=require(_0x5ff6('0x5'));var fs=require('fs');var path=require(_0x5ff6('0x6'));var rimraf=require(_0x5ff6('0x7'));var config=require(_0x5ff6('0x8'));var attributes=require(_0x5ff6('0x9'));module[_0x5ff6('0xa')]=function(_0x4260d1,_0x2ce81a){return _0x4260d1[_0x5ff6('0xb')](_0x5ff6('0xc'),attributes,{'tableName':_0x5ff6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8969=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','exports','UserMailQueue','lodash','util'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x8969,0x1a2));var _0x9896=function(_0x342044,_0x1add57){_0x342044=_0x342044-0x0;var _0x5613d8=_0x8969[_0x342044];return _0x5613d8;};'use strict';var _=require(_0x9896('0x0'));var util=require(_0x9896('0x1'));var logger=require(_0x9896('0x2'))(_0x9896('0x3'));var moment=require(_0x9896('0x4'));var BPromise=require(_0x9896('0x5'));var rp=require(_0x9896('0x6'));var fs=require('fs');var path=require(_0x9896('0x7'));var rimraf=require(_0x9896('0x8'));var config=require('../../config/environment');var attributes=require(_0x9896('0x9'));module[_0x9896('0xa')]=function(_0x311704,_0x5c2d3f){return _0x311704['define'](_0x9896('0xb'),attributes,{'tableName':'user_has_mail_queues','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 647e58a..f7e9184 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x1cb9,0x14e));var _0x91cb=function(_0x40610b,_0x5f4b82){_0x40610b=_0x40610b-0x0;var _0x542c0b=_0x1cb9[_0x40610b];return _0x542c0b;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file +var _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x138270,_0x632ed4){var _0x5c769f=function(_0x49956b){while(--_0x49956b){_0x138270['push'](_0x138270['shift']());}};_0x5c769f(++_0x632ed4);}(_0x4b84,0x1cc));var _0x44b8=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x4b84[_0x48d6a3];return _0x38bfa0;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index e6f76bc..35708a5 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 _0x7fa7=['post','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller'];(function(_0x259863,_0x3d5648){var _0x4c42f2=function(_0x4296ae){while(--_0x4296ae){_0x259863['push'](_0x259863['shift']());}};_0x4c42f2(++_0x3d5648);}(_0x7fa7,0x9d));var _0x77fa=function(_0x5579d1,_0x13d147){_0x5579d1=_0x5579d1-0x0;var _0x505828=_0x7fa7[_0x5579d1];return _0x505828;};'use strict';var multer=require(_0x77fa('0x0'));var util=require(_0x77fa('0x1'));var path=require(_0x77fa('0x2'));var timeout=require(_0x77fa('0x3'));var express=require(_0x77fa('0x4'));var router=express[_0x77fa('0x5')]();var fs_extra=require(_0x77fa('0x6'));var auth=require(_0x77fa('0x7'));var interaction=require(_0x77fa('0x8'));var config=require(_0x77fa('0x9'));var controller=require(_0x77fa('0xa'));router[_0x77fa('0xb')]('/',auth[_0x77fa('0xc')](),controller['sendUserNotification']);module[_0x77fa('0xd')]=router; \ No newline at end of file +var _0xb849=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','sendUserNotification'];(function(_0x57779a,_0x37eaf5){var _0x145bc5=function(_0x46d1a4){while(--_0x46d1a4){_0x57779a['push'](_0x57779a['shift']());}};_0x145bc5(++_0x37eaf5);}(_0xb849,0x187));var _0x9b84=function(_0x211a3f,_0x4122ff){_0x211a3f=_0x211a3f-0x0;var _0x3a85fe=_0xb849[_0x211a3f];return _0x3a85fe;};'use strict';var multer=require(_0x9b84('0x0'));var util=require('util');var path=require(_0x9b84('0x1'));var timeout=require(_0x9b84('0x2'));var express=require(_0x9b84('0x3'));var router=express[_0x9b84('0x4')]();var fs_extra=require(_0x9b84('0x5'));var auth=require(_0x9b84('0x6'));var interaction=require(_0x9b84('0x7'));var config=require(_0x9b84('0x8'));var controller=require(_0x9b84('0x9'));router[_0x9b84('0xa')]('/',auth['isAuthenticated'](),controller[_0x9b84('0xb')]);module[_0x9b84('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index af383eb..33ef45d 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 _0x8327=['BOOLEAN','exports','TEXT','STRING'];(function(_0x5c8811,_0x4f77d5){var _0x2c0941=function(_0x30e2bc){while(--_0x30e2bc){_0x5c8811['push'](_0x5c8811['shift']());}};_0x2c0941(++_0x4f77d5);}(_0x8327,0xa5));var _0x7832=function(_0x38ede4,_0xa1c561){_0x38ede4=_0x38ede4-0x0;var _0x134f59=_0x8327[_0x38ede4];return _0x134f59;};'use strict';var Sequelize=require('sequelize');module[_0x7832('0x0')]={'body':{'type':Sequelize[_0x7832('0x1')]},'senderName':{'type':Sequelize[_0x7832('0x2')]},'recipientsId':{'type':Sequelize[_0x7832('0x1')]},'recipientsDescription':{'type':Sequelize[_0x7832('0x2')]},'beep':{'type':Sequelize[_0x7832('0x3')]}}; \ No newline at end of file +var _0xc920=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x435d14,_0x78999d){var _0x54bb25=function(_0x44c977){while(--_0x44c977){_0x435d14['push'](_0x435d14['shift']());}};_0x54bb25(++_0x78999d);}(_0xc920,0xff));var _0x0c92=function(_0x49cb71,_0x2f0149){_0x49cb71=_0x49cb71-0x0;var _0x3a50fd=_0xc920[_0x49cb71];return _0x3a50fd;};'use strict';var Sequelize=require(_0x0c92('0x0'));module[_0x0c92('0x1')]={'body':{'type':Sequelize[_0x0c92('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x0c92('0x2')]},'recipientsDescription':{'type':Sequelize[_0x0c92('0x3')]},'beep':{'type':Sequelize[_0x0c92('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 3381f0e..ea4e49c 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 _0x8bbe=['lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./userNotification.socket','register','sendStatus','status','end','json','undefined','count','offset','reject','save','update','then','destroy','error','stack','sendUserNotification','body','hasOwnProperty','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','chatqueue','faxqueue','mailqueue','openchannelqueue','whatsappqueue','team','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','catch','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','ids','includes','replace','queue','all','getAgents','map','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x15ee41,_0x9275d8){var _0x2b2846=function(_0x88d0a4){while(--_0x88d0a4){_0x15ee41['push'](_0x15ee41['shift']());}};_0x2b2846(++_0x9275d8);}(_0x8bbe,0x1c9));var _0xe8bb=function(_0x31bbf7,_0x292c9a){_0x31bbf7=_0x31bbf7-0x0;var _0x1469f3=_0x8bbe[_0x31bbf7];return _0x1469f3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe8bb('0x0'));var rp=require('request-promise');var moment=require(_0xe8bb('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xe8bb('0x2'));var util=require(_0xe8bb('0x3'));var path=require(_0xe8bb('0x4'));var sox=require('sox');var csv=require(_0xe8bb('0x5'));var ejs=require(_0xe8bb('0x6'));var fs=require('fs');var fs_extra=require(_0xe8bb('0x7'));var _=require(_0xe8bb('0x8'));var squel=require(_0xe8bb('0x9'));var crypto=require(_0xe8bb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe8bb('0xb'));var toCsv=require(_0xe8bb('0x5'));var querystring=require(_0xe8bb('0xc'));var Papa=require(_0xe8bb('0xd'));var Redis=require(_0xe8bb('0xe'));var authService=require(_0xe8bb('0xf'));var qs=require(_0xe8bb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8bb('0x11'))('api');var utils=require(_0xe8bb('0x12'));var config=require(_0xe8bb('0x13'));var licenseUtil=require(_0xe8bb('0x14'));var db=require('../../mysqldb')['db'];config[_0xe8bb('0x15')]=_[_0xe8bb('0x16')](config[_0xe8bb('0x15')],{'host':_0xe8bb('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe8bb('0x18'))[_0xe8bb('0x19')](socket);function respondWithStatusCode(_0x580d69,_0x5c65fb){_0x5c65fb=_0x5c65fb||0xcc;return function(_0x3df8b6){if(_0x3df8b6){return _0x580d69[_0xe8bb('0x1a')](_0x5c65fb);}return _0x580d69[_0xe8bb('0x1b')](_0x5c65fb)[_0xe8bb('0x1c')]();};}function respondWithResult(_0x4fa834,_0x5375fc){_0x5375fc=_0x5375fc||0xc8;return function(_0x178671){if(_0x178671){return _0x4fa834[_0xe8bb('0x1b')](_0x5375fc)[_0xe8bb('0x1d')](_0x178671);}};}function respondWithFilteredResult(_0x5be441,_0x118bb1){return function(_0x39907b){if(_0x39907b){var _0x3079da=typeof _0x118bb1['offset']===_0xe8bb('0x1e')&&typeof _0x118bb1['limit']===_0xe8bb('0x1e');var _0x2227dc=_0x39907b[_0xe8bb('0x1f')];var _0x56b03d=_0x3079da?0x0:_0x118bb1[_0xe8bb('0x20')];var _0xcdceaf=_0x3079da?_0x39907b[_0xe8bb('0x1f')]:_0x118bb1['offset']+_0x118bb1['limit'];var _0xa7bcd;if(_0xcdceaf>=_0x2227dc){_0xcdceaf=_0x2227dc;_0xa7bcd=0xc8;}else{_0xa7bcd=0xce;}_0x5be441[_0xe8bb('0x1b')](_0xa7bcd);return _0x5be441['set']('Content-Range',_0x56b03d+'-'+_0xcdceaf+'/'+_0x2227dc)['json'](_0x39907b);}return null;};}function patchUpdates(_0x4de562){return function(_0x190520){try{jsonpatch['apply'](_0x190520,_0x4de562,!![]);}catch(_0x53a4f3){return BPromise[_0xe8bb('0x21')](_0x53a4f3);}return _0x190520[_0xe8bb('0x22')]();};}function saveUpdates(_0x25f032,_0x407f04){return function(_0x1d58e6){if(_0x1d58e6){return _0x1d58e6[_0xe8bb('0x23')](_0x25f032)[_0xe8bb('0x24')](function(_0x3d93e4){return _0x3d93e4;});}return null;};}function removeEntity(_0x3fd452,_0x394581){return function(_0x2b8799){if(_0x2b8799){return _0x2b8799[_0xe8bb('0x25')]()[_0xe8bb('0x24')](function(){_0x3fd452[_0xe8bb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x439580,_0x4dd9da){return function(_0x53008e){if(!_0x53008e){_0x439580[_0xe8bb('0x1a')](0x194);}return _0x53008e;};}function handleError(_0x1241e1,_0x527927){_0x527927=_0x527927||0x1f4;return function(_0x54054b){logger[_0xe8bb('0x26')](_0x54054b[_0xe8bb('0x27')]);if(_0x54054b['name']){delete _0x54054b['name'];}_0x1241e1['status'](_0x527927)['send'](_0x54054b);};}exports[_0xe8bb('0x28')]=function(_0x16522f,_0x3b265d,_0x58956a){if(!_0x16522f[_0xe8bb('0x29')][_0xe8bb('0x2a')]('text')&&!_0x16522f['body'][_0xe8bb('0x2a')](_0xe8bb('0x2b'))){throw new db[(_0xe8bb('0x2c'))][(_0xe8bb('0x2d'))](_0xe8bb('0x2e'));}else{if(_0x16522f[_0xe8bb('0x29')][_0xe8bb('0x2a')]('TemplateId')&&!_0x16522f[_0xe8bb('0x29')]['hasOwnProperty'](_0xe8bb('0x2f'))){throw new db[(_0xe8bb('0x2c'))][(_0xe8bb('0x2d'))](_0xe8bb('0x30'));}if(!_0x16522f['body'][_0xe8bb('0x2a')](_0xe8bb('0x31'))){throw new db[(_0xe8bb('0x2c'))][(_0xe8bb('0x2d'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x5f303f=JSON[_0xe8bb('0x32')](_0x16522f['body']['recipients']);}catch(_0x58eddd){logger['error'](_0x58eddd);throw new db[(_0xe8bb('0x2c'))][(_0xe8bb('0x2d'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x22f3dd=[_0xe8bb('0x33'),_0xe8bb('0x34'),_0xe8bb('0x35'),_0xe8bb('0x36'),'smsqueue','voicequeue',_0xe8bb('0x37'),_0xe8bb('0x38'),'user'];if(_['some'](_0x5f303f,function(_0x24f4a7){return!_['includes'](_0x22f3dd,_0x24f4a7[_0xe8bb('0x39')][_0xe8bb('0x3a')]());})){throw new db[(_0xe8bb('0x2c'))]['ValidationError'](_0xe8bb('0x3b'));}}}var _0x32c52f={};_0x32c52f[_0xe8bb('0x3c')]=_0x16522f[_0xe8bb('0x29')]['hasOwnProperty']('senderName')?_0x16522f[_0xe8bb('0x29')][_0xe8bb('0x3c')]:_0x16522f[_0xe8bb('0x3d')][_0xe8bb('0x3e')];_0x32c52f[_0xe8bb('0x3f')]=_[_0xe8bb('0x40')](_0x16522f[_0xe8bb('0x29')][_0xe8bb('0x3f')])?null:_0x16522f[_0xe8bb('0x29')][_0xe8bb('0x3f')];_0x32c52f[_0xe8bb('0x41')]=_0x16522f['body'][_0xe8bb('0x41')]||![];_0x32c52f['SenderId']=_0x16522f[_0xe8bb('0x3d')]['id'];return getContent(_0x16522f[_0xe8bb('0x29')])[_0xe8bb('0x24')](function(_0x2638c3){_0x32c52f[_0xe8bb('0x29')]=_0x2638c3;return getRecipients(_0x5f303f);})['then'](function(_0x156737){_0x32c52f[_0xe8bb('0x42')]=_[_0xe8bb('0x43')](_0x156737)[_0xe8bb('0x44')](',');return db[_0xe8bb('0x45')][_0xe8bb('0x46')](function(_0x4f4519){return db[_0xe8bb('0x47')][_0xe8bb('0x48')](_0x32c52f,{'raw':!![],'transaction':_0x4f4519})[_0xe8bb('0x24')](function(_0x316bde){var _0x52aea6={'sender':_0x32c52f['senderName'],'description':_0x32c52f[_0xe8bb('0x3f')],'content':_0x32c52f[_0xe8bb('0x29')],'beep':_0x32c52f[_0xe8bb('0x41')]};_0x156737[_0xe8bb('0x49')](function(_0x5daa56){_0x52aea6[_0xe8bb('0x4a')]=_0x5daa56;socket[_0xe8bb('0x4b')]('userNotification:send',_0x52aea6);});return _0x316bde;});});})[_0xe8bb('0x24')](respondWithResult(_0x3b265d,0xc9))[_0xe8bb('0x4c')](handleError(_0x3b265d,null));};function getContent(_0x4fa1ba){return new BPromise(function(_0x24c541,_0x24fbe9){if(_0x4fa1ba[_0xe8bb('0x4d')]){_0x24c541(_0x4fa1ba[_0xe8bb('0x4d')]);return;}return db[_0xe8bb('0x4e')][_0xe8bb('0x4f')]({'attributes':[_0xe8bb('0x50')],'where':{'id':_0x4fa1ba[_0xe8bb('0x2b')]},'raw':!![]})[_0xe8bb('0x24')](function(_0x88b8d6){if(!_0x88b8d6)throw new db[(_0xe8bb('0x2c'))][(_0xe8bb('0x2d'))](_0xe8bb('0x51'));var _0x1f9641=Mustache[_0xe8bb('0x52')](_0x88b8d6['html'],_0x4fa1ba[_0xe8bb('0x2f')]);_0x24c541(_0x1f9641);})[_0xe8bb('0x4c')](function(_0x532c56){_0x24fbe9(_0x532c56);});});}function getRecipients(_0x3ef048){return new BPromise(function(_0x9fab22,_0x5a89f1){var _0x2d0136=[];var _0x158cda=[];_0x3ef048[_0xe8bb('0x49')](function(_0x437db9){var _0x50672a=_[_0xe8bb('0x53')](_0x437db9[_0xe8bb('0x39')][_0xe8bb('0x3a')]());if(_0x50672a===_0xe8bb('0x54')){_0x2d0136=_[_0xe8bb('0x55')](_0x2d0136,_0x437db9[_0xe8bb('0x56')]);}else{if(_[_0xe8bb('0x57')](_0x50672a,'queue'))_0x50672a=_0x50672a[_0xe8bb('0x58')](_0xe8bb('0x59'),'Queue');_0x437db9[_0xe8bb('0x56')][_0xe8bb('0x49')](function(_0x1db0e0){_0x158cda['push'](getAgents(_0x50672a,_0x1db0e0));});}});return BPromise[_0xe8bb('0x5a')](_0x158cda)[_0xe8bb('0x24')](function(_0x5b5370){_0x2d0136=_[_0xe8bb('0x55')](_0x2d0136,_['flatten'](_0x5b5370));_0x9fab22(_0x2d0136);})[_0xe8bb('0x4c')](function(_0x587b63){_0x5a89f1(_0x587b63);});});}function getAgents(_0x47ea58,_0x5c1b17){return new BPromise(function(_0x18f4a3,_0x54dc5c){return db[_0x47ea58]['findOne']({'where':{'id':_0x5c1b17}})['then'](function(_0x2631ad){return _0x2631ad[_0xe8bb('0x5b')]({'attributes':['id'],'raw':!![]})[_0xe8bb('0x24')](function(_0x6c2668){var _0x160242=_[_0xe8bb('0x5c')](_0x6c2668,'id');_0x18f4a3(_0x160242);});})[_0xe8bb('0x4c')](function(_0x504ebf){_0x54dc5c(_0x504ebf);});});} \ No newline at end of file +var _0x79f7=['replace','Queue','ids','push','all','union','getAgents','map','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','send','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','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','beep','recipient','emit','userNotification:send','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','catch','forEach','startCase','User','queue'];(function(_0xdb6fe8,_0x2ef81e){var _0x3d235d=function(_0x2f6d28){while(--_0x2f6d28){_0xdb6fe8['push'](_0xdb6fe8['shift']());}};_0x3d235d(++_0x2ef81e);}(_0x79f7,0x1b0));var _0x779f=function(_0x357cfd,_0xcf2cb7){_0x357cfd=_0x357cfd-0x0;var _0x5e1d7a=_0x79f7[_0x357cfd];return _0x5e1d7a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x779f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x779f('0x1'));var BPromise=require(_0x779f('0x2'));var Mustache=require(_0x779f('0x3'));var util=require(_0x779f('0x4'));var path=require(_0x779f('0x5'));var sox=require(_0x779f('0x6'));var csv=require(_0x779f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x779f('0x8'));var _=require(_0x779f('0x9'));var squel=require(_0x779f('0xa'));var crypto=require(_0x779f('0xb'));var jsforce=require(_0x779f('0xc'));var deskjs=require(_0x779f('0xd'));var toCsv=require(_0x779f('0x7'));var querystring=require(_0x779f('0xe'));var Papa=require(_0x779f('0xf'));var Redis=require(_0x779f('0x10'));var authService=require(_0x779f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x779f('0x12'))(_0x779f('0x13'));var utils=require(_0x779f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x779f('0x15'));var db=require(_0x779f('0x16'))['db'];config[_0x779f('0x17')]=_[_0x779f('0x18')](config[_0x779f('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x779f('0x19'))(new Redis(config[_0x779f('0x17')]));require(_0x779f('0x1a'))[_0x779f('0x1b')](socket);function respondWithStatusCode(_0x9e51d9,_0x2b997f){_0x2b997f=_0x2b997f||0xcc;return function(_0x44b43a){if(_0x44b43a){return _0x9e51d9[_0x779f('0x1c')](_0x2b997f);}return _0x9e51d9[_0x779f('0x1d')](_0x2b997f)[_0x779f('0x1e')]();};}function respondWithResult(_0x13a0dd,_0xd38b23){_0xd38b23=_0xd38b23||0xc8;return function(_0x3fd1ec){if(_0x3fd1ec){return _0x13a0dd['status'](_0xd38b23)['json'](_0x3fd1ec);}};}function respondWithFilteredResult(_0x3f272c,_0xe1bc5e){return function(_0x46ce6d){if(_0x46ce6d){var _0x2644e9=typeof _0xe1bc5e[_0x779f('0x1f')]==='undefined'&&typeof _0xe1bc5e[_0x779f('0x20')]===_0x779f('0x21');var _0xfefc71=_0x46ce6d['count'];var _0x1074ab=_0x2644e9?0x0:_0xe1bc5e[_0x779f('0x1f')];var _0x440ce9=_0x2644e9?_0x46ce6d[_0x779f('0x22')]:_0xe1bc5e[_0x779f('0x1f')]+_0xe1bc5e[_0x779f('0x20')];var _0x4d8a3a;if(_0x440ce9>=_0xfefc71){_0x440ce9=_0xfefc71;_0x4d8a3a=0xc8;}else{_0x4d8a3a=0xce;}_0x3f272c[_0x779f('0x1d')](_0x4d8a3a);return _0x3f272c[_0x779f('0x23')](_0x779f('0x24'),_0x1074ab+'-'+_0x440ce9+'/'+_0xfefc71)[_0x779f('0x25')](_0x46ce6d);}return null;};}function patchUpdates(_0x44065d){return function(_0x1d7d86){try{jsonpatch[_0x779f('0x26')](_0x1d7d86,_0x44065d,!![]);}catch(_0x2fdc9a){return BPromise[_0x779f('0x27')](_0x2fdc9a);}return _0x1d7d86['save']();};}function saveUpdates(_0x20d161,_0x492ffe){return function(_0x353f40){if(_0x353f40){return _0x353f40['update'](_0x20d161)[_0x779f('0x28')](function(_0x257484){return _0x257484;});}return null;};}function removeEntity(_0x3f7c19,_0x580a1f){return function(_0x552cb9){if(_0x552cb9){return _0x552cb9[_0x779f('0x29')]()[_0x779f('0x28')](function(){_0x3f7c19[_0x779f('0x1d')](0xcc)[_0x779f('0x1e')]();});}};}function handleEntityNotFound(_0xe1b077,_0x20e019){return function(_0x4cc271){if(!_0x4cc271){_0xe1b077[_0x779f('0x1c')](0x194);}return _0x4cc271;};}function handleError(_0x36a456,_0x4edaed){_0x4edaed=_0x4edaed||0x1f4;return function(_0x204fee){logger[_0x779f('0x2a')](_0x204fee[_0x779f('0x2b')]);if(_0x204fee[_0x779f('0x2c')]){delete _0x204fee['name'];}_0x36a456[_0x779f('0x1d')](_0x4edaed)[_0x779f('0x2d')](_0x204fee);};}exports['sendUserNotification']=function(_0x1c5dac,_0x2de3c9,_0x2844d4){if(!_0x1c5dac[_0x779f('0x2e')][_0x779f('0x2f')](_0x779f('0x30'))&&!_0x1c5dac[_0x779f('0x2e')][_0x779f('0x2f')](_0x779f('0x31'))){throw new db[(_0x779f('0x32'))][(_0x779f('0x33'))](_0x779f('0x34'));}else{if(_0x1c5dac['body'][_0x779f('0x2f')](_0x779f('0x31'))&&!_0x1c5dac[_0x779f('0x2e')][_0x779f('0x2f')](_0x779f('0x35'))){throw new db[(_0x779f('0x32'))][(_0x779f('0x33'))](_0x779f('0x36'));}if(!_0x1c5dac[_0x779f('0x2e')][_0x779f('0x2f')](_0x779f('0x37'))){throw new db[(_0x779f('0x32'))][(_0x779f('0x33'))](_0x779f('0x38'));}else{try{var _0x2437f3=JSON[_0x779f('0x39')](_0x1c5dac['body']['recipients']);}catch(_0x2ec7a9){logger[_0x779f('0x2a')](_0x2ec7a9);throw new db[(_0x779f('0x32'))][(_0x779f('0x33'))](_0x779f('0x3a'));}var _0xd28594=[_0x779f('0x3b'),_0x779f('0x3c'),_0x779f('0x3d'),_0x779f('0x3e'),_0x779f('0x3f'),_0x779f('0x40'),_0x779f('0x41'),_0x779f('0x42'),_0x779f('0x43')];if(_[_0x779f('0x44')](_0x2437f3,function(_0x2cb613){return!_[_0x779f('0x45')](_0xd28594,_0x2cb613[_0x779f('0x46')]['toLowerCase']());})){throw new db[(_0x779f('0x32'))]['ValidationError'](_0x779f('0x47'));}}}var _0x4e48e7={};_0x4e48e7['senderName']=_0x1c5dac['body'][_0x779f('0x2f')](_0x779f('0x48'))?_0x1c5dac['body'][_0x779f('0x48')]:_0x1c5dac['user'][_0x779f('0x49')];_0x4e48e7[_0x779f('0x4a')]=_[_0x779f('0x4b')](_0x1c5dac['body'][_0x779f('0x4a')])?null:_0x1c5dac[_0x779f('0x2e')][_0x779f('0x4a')];_0x4e48e7['beep']=_0x1c5dac[_0x779f('0x2e')]['beep']||![];_0x4e48e7[_0x779f('0x4c')]=_0x1c5dac[_0x779f('0x43')]['id'];return getContent(_0x1c5dac[_0x779f('0x2e')])['then'](function(_0x18308c){_0x4e48e7[_0x779f('0x2e')]=_0x18308c;return getRecipients(_0x2437f3);})[_0x779f('0x28')](function(_0x40610c){_0x4e48e7[_0x779f('0x4d')]=_[_0x779f('0x4e')](_0x40610c)[_0x779f('0x4f')](',');return db[_0x779f('0x50')][_0x779f('0x51')](function(_0x556b8a){return db[_0x779f('0x52')][_0x779f('0x53')](_0x4e48e7,{'raw':!![],'transaction':_0x556b8a})[_0x779f('0x28')](function(_0x52e308){var _0xa16e93={'sender':_0x4e48e7[_0x779f('0x48')],'description':_0x4e48e7['recipientsDescription'],'content':_0x4e48e7['body'],'beep':_0x4e48e7[_0x779f('0x54')]};_0x40610c['forEach'](function(_0x2e7689){_0xa16e93[_0x779f('0x55')]=_0x2e7689;socket[_0x779f('0x56')](_0x779f('0x57'),_0xa16e93);});return _0x52e308;});});})[_0x779f('0x28')](respondWithResult(_0x2de3c9,0xc9))['catch'](handleError(_0x2de3c9,null));};function getContent(_0x438d39){return new BPromise(function(_0x1eaf50,_0x2533fe){if(_0x438d39[_0x779f('0x30')]){_0x1eaf50(_0x438d39[_0x779f('0x30')]);return;}return db[_0x779f('0x58')][_0x779f('0x59')]({'attributes':['html'],'where':{'id':_0x438d39[_0x779f('0x31')]},'raw':!![]})['then'](function(_0xdd890){if(!_0xdd890)throw new db['Sequelize'][(_0x779f('0x33'))](_0x779f('0x5a'));var _0x5541fe=Mustache[_0x779f('0x5b')](_0xdd890[_0x779f('0x5c')],_0x438d39[_0x779f('0x35')]);_0x1eaf50(_0x5541fe);})[_0x779f('0x5d')](function(_0x5170a9){_0x2533fe(_0x5170a9);});});}function getRecipients(_0x57ccd1){return new BPromise(function(_0x365f8b,_0x25610){var _0x11ac38=[];var _0xa8179b=[];_0x57ccd1[_0x779f('0x5e')](function(_0x718bf0){var _0x4a8793=_[_0x779f('0x5f')](_0x718bf0['model']['toLowerCase']());if(_0x4a8793===_0x779f('0x60')){_0x11ac38=_['union'](_0x11ac38,_0x718bf0['ids']);}else{if(_[_0x779f('0x45')](_0x4a8793,_0x779f('0x61')))_0x4a8793=_0x4a8793[_0x779f('0x62')]('queue',_0x779f('0x63'));_0x718bf0[_0x779f('0x64')][_0x779f('0x5e')](function(_0x53174a){_0xa8179b[_0x779f('0x65')](getAgents(_0x4a8793,_0x53174a));});}});return BPromise[_0x779f('0x66')](_0xa8179b)[_0x779f('0x28')](function(_0x317624){_0x11ac38=_[_0x779f('0x67')](_0x11ac38,_['flatten'](_0x317624));_0x365f8b(_0x11ac38);})[_0x779f('0x5d')](function(_0x58bf2a){_0x25610(_0x58bf2a);});});}function getAgents(_0x49fe43,_0x4a140f){return new BPromise(function(_0x46c55f,_0x1b7ff6){return db[_0x49fe43][_0x779f('0x59')]({'where':{'id':_0x4a140f}})[_0x779f('0x28')](function(_0x3be925){return _0x3be925[_0x779f('0x68')]({'attributes':['id'],'raw':!![]})[_0x779f('0x28')](function(_0x387d09){var _0x61e117=_[_0x779f('0x69')](_0x387d09,'id');_0x46c55f(_0x61e117);});})[_0x779f('0x5d')](function(_0x1af96d){_0x1b7ff6(_0x1af96d);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 65f9488..2ce6fd8 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 _0xc36b=['update','emit','hasOwnProperty','events','UserNotification','setMaxListeners','save'];(function(_0x352cac,_0x501972){var _0x595d54=function(_0x2bf843){while(--_0x2bf843){_0x352cac['push'](_0x352cac['shift']());}};_0x595d54(++_0x501972);}(_0xc36b,0x1ae));var _0xbc36=function(_0x574394,_0x49d75f){_0x574394=_0x574394-0x0;var _0x93a092=_0xc36b[_0x574394];return _0x93a092;};'use strict';var EventEmitter=require(_0xbc36('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xbc36('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xbc36('0x2')](0x0);var events={'afterCreate':_0xbc36('0x3'),'afterUpdate':_0xbc36('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3d578c){return function(_0x3e9a93,_0x668513,_0x31b42f){UserNotificationEvents[_0xbc36('0x5')](_0x3d578c+':'+_0x3e9a93['id'],_0x3e9a93);UserNotificationEvents[_0xbc36('0x5')](_0x3d578c,_0x3e9a93);_0x31b42f(null);};}for(var e in events){if(events[_0xbc36('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x852b=['update','emit','hasOwnProperty','hook','exports','UserNotification','setMaxListeners'];(function(_0xd8a3b0,_0x296d12){var _0xf9276=function(_0x582a30){while(--_0x582a30){_0xd8a3b0['push'](_0xd8a3b0['shift']());}};_0xf9276(++_0x296d12);}(_0x852b,0x91));var _0xb852=function(_0x15978d,_0xc384cd){_0x15978d=_0x15978d-0x0;var _0x4e4fa5=_0x852b[_0x15978d];return _0x4e4fa5;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0xb852('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xb852('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb852('0x2'),'afterDestroy':'remove'};function emitEvent(_0xc82de1){return function(_0x162e0b,_0x5f182f,_0xe19fb7){UserNotificationEvents[_0xb852('0x3')](_0xc82de1+':'+_0x162e0b['id'],_0x162e0b);UserNotificationEvents[_0xb852('0x3')](_0xc82de1,_0x162e0b);_0xe19fb7(null);};}for(var e in events){if(events[_0xb852('0x4')](e)){var event=events[e];UserNotification[_0xb852('0x5')](e,emitEvent(event));}}module[_0xb852('0x6')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index ea10b0e..256308c 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 _0x2197=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','exports','define','userNotifications','utf8mb4'];(function(_0x272278,_0x4e0f18){var _0x341238=function(_0x1d96e5){while(--_0x1d96e5){_0x272278['push'](_0x272278['shift']());}};_0x341238(++_0x4e0f18);}(_0x2197,0x84));var _0x7219=function(_0x5cc85c,_0x722e10){_0x5cc85c=_0x5cc85c-0x0;var _0xf6c9df=_0x2197[_0x5cc85c];return _0xf6c9df;};'use strict';var _=require(_0x7219('0x0'));var util=require(_0x7219('0x1'));var logger=require(_0x7219('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7219('0x3'));var fs=require('fs');var path=require(_0x7219('0x4'));var rimraf=require(_0x7219('0x5'));var config=require(_0x7219('0x6'));var attributes=require('./userNotification.attributes');module[_0x7219('0x7')]=function(_0x389dd1,_0x424cde){return _0x389dd1[_0x7219('0x8')]('UserNotification',attributes,{'tableName':_0x7219('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7219('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xfa4c=['request-promise','path','rimraf','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4_unicode_ci','../../config/logger','api','moment'];(function(_0x2e3e26,_0x3a8d97){var _0xe01600=function(_0x492925){while(--_0x492925){_0x2e3e26['push'](_0x2e3e26['shift']());}};_0xe01600(++_0x3a8d97);}(_0xfa4c,0x194));var _0xcfa4=function(_0xd720d0,_0x2e05e6){_0xd720d0=_0xd720d0-0x0;var _0x7a2a44=_0xfa4c[_0xd720d0];return _0x7a2a44;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcfa4('0x0'))(_0xcfa4('0x1'));var moment=require(_0xcfa4('0x2'));var BPromise=require('bluebird');var rp=require(_0xcfa4('0x3'));var fs=require('fs');var path=require(_0xcfa4('0x4'));var rimraf=require(_0xcfa4('0x5'));var config=require('../../config/environment');var attributes=require(_0xcfa4('0x6'));module[_0xcfa4('0x7')]=function(_0x22d98b,_0x2a40bc){return _0x22d98b['define'](_0xcfa4('0x8'),attributes,{'tableName':_0xcfa4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcfa4('0xa')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 994fc74..26195e2 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 _0x2645=['jayson/promise','client','http','localhost','socket.io-emitter','redis','./userNotification.socket','register','request','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','UserNotification,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x55ce38,_0x44cfdf){var _0x564ebb=function(_0x5a08f3){while(--_0x5a08f3){_0x55ce38['push'](_0x55ce38['shift']());}};_0x564ebb(++_0x44cfdf);}(_0x2645,0x1b8));var _0x5264=function(_0x438903,_0xe7073c){_0x438903=_0x438903-0x0;var _0xcea052=_0x2645[_0x438903];return _0xcea052;};'use strict';var _=require('lodash');var util=require(_0x5264('0x0'));var moment=require(_0x5264('0x1'));var BPromise=require(_0x5264('0x2'));var rs=require(_0x5264('0x3'));var fs=require('fs');var Redis=require(_0x5264('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5264('0x5'))(_0x5264('0x6'));var config=require(_0x5264('0x7'));var jayson=require(_0x5264('0x8'));var client=jayson[_0x5264('0x9')][_0x5264('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x5264('0xb'),'port':0x18eb});var socket=require(_0x5264('0xc'))(new Redis(config[_0x5264('0xd')]));require(_0x5264('0xe'))[_0x5264('0xf')](socket);function respondWithRpcPromise(_0x593bae,_0x4acb34,_0x2edc94){return new BPromise(function(_0x400547,_0x45eeee){return client[_0x5264('0x10')](_0x593bae,_0x2edc94)[_0x5264('0x11')](function(_0x3b0698){logger[_0x5264('0x12')]('UserNotification,\x20%s,\x20%s',_0x4acb34,_0x5264('0x13'));logger[_0x5264('0x14')](_0x5264('0x15'),_0x4acb34,_0x5264('0x13'),JSON['stringify'](_0x3b0698));if(_0x3b0698['error']){if(_0x3b0698[_0x5264('0x16')][_0x5264('0x17')]===0x1f4){logger[_0x5264('0x16')](_0x5264('0x18'),_0x4acb34,_0x3b0698['error'][_0x5264('0x19')]);return _0x45eeee(_0x3b0698[_0x5264('0x16')]['message']);}logger[_0x5264('0x16')]('UserNotification,\x20%s,\x20%s',_0x4acb34,_0x3b0698[_0x5264('0x16')]['message']);return _0x400547(_0x3b0698[_0x5264('0x16')][_0x5264('0x19')]);}else{logger[_0x5264('0x12')]('UserNotification,\x20%s,\x20%s',_0x4acb34,_0x5264('0x13'));_0x400547(_0x3b0698[_0x5264('0x1a')][_0x5264('0x19')]);}})[_0x5264('0x1b')](function(_0x1ff68b){logger[_0x5264('0x16')](_0x5264('0x18'),_0x4acb34,_0x1ff68b);_0x45eeee(_0x1ff68b);});});} \ No newline at end of file +var _0x969e=['catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userNotification.socket','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x27aec3,_0xe08193){var _0x435213=function(_0x5be776){while(--_0x5be776){_0x27aec3['push'](_0x27aec3['shift']());}};_0x435213(++_0xe08193);}(_0x969e,0x7e));var _0xe969=function(_0x230888,_0x41c203){_0x230888=_0x230888-0x0;var _0x1a27ed=_0x969e[_0x230888];return _0x1a27ed;};'use strict';var _=require(_0xe969('0x0'));var util=require(_0xe969('0x1'));var moment=require(_0xe969('0x2'));var BPromise=require('bluebird');var rs=require(_0xe969('0x3'));var fs=require('fs');var Redis=require(_0xe969('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe969('0x5'));var logger=require('../../config/logger')(_0xe969('0x6'));var config=require(_0xe969('0x7'));var jayson=require(_0xe969('0x8'));var client=jayson[_0xe969('0x9')][_0xe969('0xa')]({'port':0x232a});config[_0xe969('0xb')]=_['defaults'](config['redis'],{'host':_0xe969('0xc'),'port':0x18eb});var socket=require(_0xe969('0xd'))(new Redis(config['redis']));require(_0xe969('0xe'))['register'](socket);function respondWithRpcPromise(_0xb2cb34,_0x544833,_0x1de534){return new BPromise(function(_0x13d836,_0x24cd7e){return client['request'](_0xb2cb34,_0x1de534)[_0xe969('0xf')](function(_0xa6bc7b){logger[_0xe969('0x10')](_0xe969('0x11'),_0x544833,_0xe969('0x12'));logger[_0xe969('0x13')](_0xe969('0x14'),_0x544833,_0xe969('0x12'),JSON[_0xe969('0x15')](_0xa6bc7b));if(_0xa6bc7b[_0xe969('0x16')]){if(_0xa6bc7b[_0xe969('0x16')]['code']===0x1f4){logger[_0xe969('0x16')](_0xe969('0x11'),_0x544833,_0xa6bc7b[_0xe969('0x16')][_0xe969('0x17')]);return _0x24cd7e(_0xa6bc7b[_0xe969('0x16')][_0xe969('0x17')]);}logger[_0xe969('0x16')](_0xe969('0x11'),_0x544833,_0xa6bc7b[_0xe969('0x16')][_0xe969('0x17')]);return _0x13d836(_0xa6bc7b[_0xe969('0x16')][_0xe969('0x17')]);}else{logger['info'](_0xe969('0x11'),_0x544833,_0xe969('0x12'));_0x13d836(_0xa6bc7b['result'][_0xe969('0x17')]);}})[_0xe969('0x18')](function(_0x5025e3){logger[_0xe969('0x16')](_0xe969('0x11'),_0x544833,_0x5025e3);_0x24cd7e(_0x5025e3);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 70f1fd7..94e8802 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 _0x2c09=['update','emit','removeListener','register','length','userNotification:','./userNotification.events','save'];(function(_0x2da8e3,_0x397415){var _0x281fd5=function(_0x1d9db5){while(--_0x1d9db5){_0x2da8e3['push'](_0x2da8e3['shift']());}};_0x281fd5(++_0x397415);}(_0x2c09,0xe6));var _0x92c0=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x2c09[_0x138adb];return _0x1b27f2;};'use strict';var UserNotificationEvents=require(_0x92c0('0x0'));var events=[_0x92c0('0x1'),'remove',_0x92c0('0x2')];function createListener(_0x1dfdca,_0x429d64){return function(_0x1b7a2d){_0x429d64[_0x92c0('0x3')](_0x1dfdca,_0x1b7a2d);};}function removeListener(_0x937d8c,_0x123009){return function(){UserNotificationEvents[_0x92c0('0x4')](_0x937d8c,_0x123009);};}exports[_0x92c0('0x5')]=function(_0x4d6879){for(var _0x5efe5b=0x0,_0x56be2c=events[_0x92c0('0x6')];_0x5efe5b<_0x56be2c;_0x5efe5b++){var _0x58fbc0=events[_0x5efe5b];var _0x10d72a=createListener(_0x92c0('0x7')+_0x58fbc0,_0x4d6879);UserNotificationEvents['on'](_0x58fbc0,_0x10d72a);}}; \ No newline at end of file +var _0xfc20=['./userNotification.events','save','remove','update','emit','register','length'];(function(_0x654102,_0x4fa2f9){var _0x3cc306=function(_0x4be5d2){while(--_0x4be5d2){_0x654102['push'](_0x654102['shift']());}};_0x3cc306(++_0x4fa2f9);}(_0xfc20,0x13b));var _0x0fc2=function(_0x1a0c19,_0x36286a){_0x1a0c19=_0x1a0c19-0x0;var _0x44c19e=_0xfc20[_0x1a0c19];return _0x44c19e;};'use strict';var UserNotificationEvents=require(_0x0fc2('0x0'));var events=[_0x0fc2('0x1'),_0x0fc2('0x2'),_0x0fc2('0x3')];function createListener(_0x4ad22d,_0x1a74c1){return function(_0x52cb6a){_0x1a74c1[_0x0fc2('0x4')](_0x4ad22d,_0x52cb6a);};}function removeListener(_0x522f3d,_0x3ce19a){return function(){UserNotificationEvents['removeListener'](_0x522f3d,_0x3ce19a);};}exports[_0x0fc2('0x5')]=function(_0x5d5778){for(var _0x3d6fb7=0x0,_0xdb6457=events[_0x0fc2('0x6')];_0x3d6fb7<_0xdb6457;_0x3d6fb7++){var _0x3cf310=events[_0x3d6fb7];var _0xb1bf0b=createListener('userNotification:'+_0x3cf310,_0x5d5778);UserNotificationEvents['on'](_0x3cf310,_0xb1bf0b);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 64e62d3..6987527 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x9bc1b5,_0x2a0313){var _0x35e68e=function(_0x58dbc6){while(--_0x58dbc6){_0x9bc1b5['push'](_0x9bc1b5['shift']());}};_0x35e68e(++_0x2a0313);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3d51c4,_0x5aaab9){var _0x1b8cf9=function(_0x138d37){while(--_0x138d37){_0x3d51c4['push'](_0x3d51c4['shift']());}};_0x1b8cf9(++_0x5aaab9);}(_0xe706,0xa3));var _0x6e70=function(_0x4b84e8,_0x23e807){_0x4b84e8=_0x4b84e8-0x0;var _0x3d8b44=_0xe706[_0x4b84e8];return _0x3d8b44;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 25c3cf0..ec161d6 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 _0xb889=['INTEGER','sequelize','exports'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xb889,0x16f));var _0x9b88=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xb889[_0x36c5b0];return _0xf19333;};'use strict';var Sequelize=require(_0x9b88('0x0'));module[_0x9b88('0x1')]={'penalty':{'type':Sequelize[_0x9b88('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc0bc=['exports','INTEGER','sequelize'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0xc0bc,0x17f));var _0xcc0b=function(_0x42abc3,_0x3f1665){_0x42abc3=_0x42abc3-0x0;var _0x5d2c54=_0xc0bc[_0x42abc3];return _0x5d2c54;};'use strict';var Sequelize=require(_0xcc0b('0x0'));module[_0xcc0b('0x1')]={'penalty':{'type':Sequelize[_0xcc0b('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 1cb2cf2..3cb79db 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 _0xcc64=['path','rimraf','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','api','moment','request-promise'];(function(_0x461304,_0x526a11){var _0x450729=function(_0x23aac3){while(--_0x23aac3){_0x461304['push'](_0x461304['shift']());}};_0x450729(++_0x526a11);}(_0xcc64,0x8b));var _0x4cc6=function(_0x4fad92,_0x116dc6){_0x4fad92=_0x4fad92-0x0;var _0x345a32=_0xcc64[_0x4fad92];return _0x345a32;};'use strict';var _=require('lodash');var util=require(_0x4cc6('0x0'));var logger=require(_0x4cc6('0x1'))(_0x4cc6('0x2'));var moment=require(_0x4cc6('0x3'));var BPromise=require('bluebird');var rp=require(_0x4cc6('0x4'));var fs=require('fs');var path=require(_0x4cc6('0x5'));var rimraf=require(_0x4cc6('0x6'));var config=require('../../config/environment');var attributes=require(_0x4cc6('0x7'));module[_0x4cc6('0x8')]=function(_0x3644af,_0x409db1){return _0x3644af[_0x4cc6('0x9')](_0x4cc6('0xa'),attributes,{'tableName':_0x4cc6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11a9=['api','moment','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','lodash','util','../../config/logger'];(function(_0x9efd02,_0x48b78f){var _0x1526a1=function(_0x3a047c){while(--_0x3a047c){_0x9efd02['push'](_0x9efd02['shift']());}};_0x1526a1(++_0x48b78f);}(_0x11a9,0x177));var _0x911a=function(_0x4e14d3,_0x315965){_0x4e14d3=_0x4e14d3-0x0;var _0x284d0c=_0x11a9[_0x4e14d3];return _0x284d0c;};'use strict';var _=require(_0x911a('0x0'));var util=require(_0x911a('0x1'));var logger=require(_0x911a('0x2'))(_0x911a('0x3'));var moment=require(_0x911a('0x4'));var BPromise=require('bluebird');var rp=require(_0x911a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x911a('0x6'));var config=require(_0x911a('0x7'));var attributes=require(_0x911a('0x8'));module['exports']=function(_0x249f69,_0x18ea52){return _0x249f69['define']('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 901adbd..7d9abb9 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 _0xbaa4=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2e8ea6,_0x34b874){var _0x782bba=function(_0x5baa1f){while(--_0x5baa1f){_0x2e8ea6['push'](_0x2e8ea6['shift']());}};_0x782bba(++_0x34b874);}(_0xbaa4,0x130));var _0x4baa=function(_0xc6e47b,_0x55e17b){_0xc6e47b=_0xc6e47b-0x0;var _0x1ce1e8=_0xbaa4[_0xc6e47b];return _0x1ce1e8;};'use strict';var _=require(_0x4baa('0x0'));var util=require(_0x4baa('0x1'));var moment=require(_0x4baa('0x2'));var BPromise=require('bluebird');var rs=require(_0x4baa('0x3'));var fs=require('fs');var Redis=require(_0x4baa('0x4'));var db=require(_0x4baa('0x5'))['db'];var utils=require(_0x4baa('0x6'));var logger=require(_0x4baa('0x7'))(_0x4baa('0x8'));var config=require(_0x4baa('0x9'));var jayson=require(_0x4baa('0xa'));var client=jayson[_0x4baa('0xb')][_0x4baa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xbb2087,_0x5ecdf0,_0x2e2021){return new BPromise(function(_0x5c0362,_0x2c4665){return client['request'](_0xbb2087,_0x2e2021)[_0x4baa('0xd')](function(_0x21861c){logger[_0x4baa('0xe')](_0x4baa('0xf'),_0x5ecdf0,_0x4baa('0x10'));logger[_0x4baa('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x5ecdf0,_0x4baa('0x10'),JSON['stringify'](_0x21861c));if(_0x21861c[_0x4baa('0x12')]){if(_0x21861c[_0x4baa('0x12')][_0x4baa('0x13')]===0x1f4){logger[_0x4baa('0x12')](_0x4baa('0xf'),_0x5ecdf0,_0x21861c[_0x4baa('0x12')][_0x4baa('0x14')]);return _0x2c4665(_0x21861c[_0x4baa('0x12')][_0x4baa('0x14')]);}logger[_0x4baa('0x12')](_0x4baa('0xf'),_0x5ecdf0,_0x21861c[_0x4baa('0x12')][_0x4baa('0x14')]);return _0x5c0362(_0x21861c[_0x4baa('0x12')][_0x4baa('0x14')]);}else{logger['info'](_0x4baa('0xf'),_0x5ecdf0,_0x4baa('0x10'));_0x5c0362(_0x21861c[_0x4baa('0x15')][_0x4baa('0x14')]);}})[_0x4baa('0x16')](function(_0x1f4ac8){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x5ecdf0,_0x1f4ac8);_0x2c4665(_0x1f4ac8);});});} \ No newline at end of file +var _0x6a8e=['stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0x6a8e,0xcc));var _0xe6a8=function(_0x1c9fc4,_0x240343){_0x1c9fc4=_0x1c9fc4-0x0;var _0x2efcba=_0x6a8e[_0x1c9fc4];return _0x2efcba;};'use strict';var _=require(_0xe6a8('0x0'));var util=require(_0xe6a8('0x1'));var moment=require('moment');var BPromise=require(_0xe6a8('0x2'));var rs=require(_0xe6a8('0x3'));var fs=require('fs');var Redis=require(_0xe6a8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe6a8('0x5'));var logger=require('../../config/logger')(_0xe6a8('0x6'));var config=require(_0xe6a8('0x7'));var jayson=require(_0xe6a8('0x8'));var client=jayson[_0xe6a8('0x9')][_0xe6a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15d15d,_0x9d8f21,_0x24388f){return new BPromise(function(_0x21a798,_0x5543cd){return client[_0xe6a8('0xb')](_0x15d15d,_0x24388f)[_0xe6a8('0xc')](function(_0x2d13c2){logger[_0xe6a8('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x9d8f21,_0xe6a8('0xe'));logger[_0xe6a8('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x9d8f21,'request\x20sent',JSON[_0xe6a8('0x10')](_0x2d13c2));if(_0x2d13c2['error']){if(_0x2d13c2[_0xe6a8('0x11')][_0xe6a8('0x12')]===0x1f4){logger[_0xe6a8('0x11')](_0xe6a8('0x13'),_0x9d8f21,_0x2d13c2[_0xe6a8('0x11')][_0xe6a8('0x14')]);return _0x5543cd(_0x2d13c2[_0xe6a8('0x11')][_0xe6a8('0x14')]);}logger[_0xe6a8('0x11')](_0xe6a8('0x13'),_0x9d8f21,_0x2d13c2['error'][_0xe6a8('0x14')]);return _0x21a798(_0x2d13c2[_0xe6a8('0x11')]['message']);}else{logger[_0xe6a8('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x9d8f21,'request\x20sent');_0x21a798(_0x2d13c2[_0xe6a8('0x15')]['message']);}})['catch'](function(_0x98e953){logger[_0xe6a8('0x11')](_0xe6a8('0x13'),_0x9d8f21,_0x98e953);_0x5543cd(_0x98e953);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 6dbe604..f2c93ab 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 _0xed49=['removeSections','removeResources','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','clone','addResources','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed49,0x8f));var _0x9ed4=function(_0x346f2e,_0xf7c392){_0x346f2e=_0x346f2e-0x0;var _0x4c24b0=_0xed49[_0x346f2e];return _0x4c24b0;};'use strict';var multer=require(_0x9ed4('0x0'));var util=require(_0x9ed4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9ed4('0x2'));var router=express[_0x9ed4('0x3')]();var fs_extra=require(_0x9ed4('0x4'));var auth=require(_0x9ed4('0x5'));var interaction=require(_0x9ed4('0x6'));var config=require(_0x9ed4('0x7'));var controller=require(_0x9ed4('0x8'));router[_0x9ed4('0x9')]('/',auth[_0x9ed4('0xa')](),controller['index']);router['get']('/describe',auth[_0x9ed4('0xa')](),controller['describe']);router[_0x9ed4('0x9')](_0x9ed4('0xb'),auth['isAuthenticated'](),controller[_0x9ed4('0xc')]);router[_0x9ed4('0x9')](_0x9ed4('0xd'),auth[_0x9ed4('0xa')](),controller[_0x9ed4('0xe')]);router[_0x9ed4('0x9')](_0x9ed4('0xf'),auth[_0x9ed4('0xa')](),controller[_0x9ed4('0x10')]);router[_0x9ed4('0x11')]('/',auth[_0x9ed4('0xa')](),controller[_0x9ed4('0x12')]);router[_0x9ed4('0x11')]('/:id/clone',auth[_0x9ed4('0xa')](),controller[_0x9ed4('0x13')]);router[_0x9ed4('0x11')](_0x9ed4('0xd'),auth[_0x9ed4('0xa')](),controller['addSections']);router['post'](_0x9ed4('0xf'),auth[_0x9ed4('0xa')](),controller[_0x9ed4('0x14')]);router[_0x9ed4('0x15')](_0x9ed4('0xb'),auth[_0x9ed4('0xa')](),controller[_0x9ed4('0x16')]);router[_0x9ed4('0x17')]('/:id',auth[_0x9ed4('0xa')](),controller[_0x9ed4('0x18')]);router[_0x9ed4('0x17')](_0x9ed4('0xd'),auth[_0x9ed4('0xa')](),controller[_0x9ed4('0x19')]);router[_0x9ed4('0x17')]('/:id/resources',auth[_0x9ed4('0xa')](),controller[_0x9ed4('0x1a')]);module[_0x9ed4('0x1b')]=router; \ No newline at end of file +var _0x9c55=['index','get','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeSections','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated'];(function(_0x3ba1c8,_0x1bd012){var _0x3a8829=function(_0x4fa757){while(--_0x4fa757){_0x3ba1c8['push'](_0x3ba1c8['shift']());}};_0x3a8829(++_0x1bd012);}(_0x9c55,0x156));var _0x59c5=function(_0x3074f1,_0x4901aa){_0x3074f1=_0x3074f1-0x0;var _0x149af8=_0x9c55[_0x3074f1];return _0x149af8;};'use strict';var multer=require(_0x59c5('0x0'));var util=require('util');var path=require(_0x59c5('0x1'));var timeout=require(_0x59c5('0x2'));var express=require(_0x59c5('0x3'));var router=express[_0x59c5('0x4')]();var fs_extra=require(_0x59c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x59c5('0x6'));var config=require(_0x59c5('0x7'));var controller=require(_0x59c5('0x8'));router['get']('/',auth[_0x59c5('0x9')](),controller[_0x59c5('0xa')]);router[_0x59c5('0xb')](_0x59c5('0xc'),auth['isAuthenticated'](),controller[_0x59c5('0xd')]);router[_0x59c5('0xb')](_0x59c5('0xe'),auth[_0x59c5('0x9')](),controller[_0x59c5('0xf')]);router[_0x59c5('0xb')](_0x59c5('0x10'),auth['isAuthenticated'](),controller[_0x59c5('0x11')]);router[_0x59c5('0xb')](_0x59c5('0x12'),auth['isAuthenticated'](),controller[_0x59c5('0x13')]);router[_0x59c5('0x14')]('/',auth[_0x59c5('0x9')](),controller[_0x59c5('0x15')]);router[_0x59c5('0x14')](_0x59c5('0x16'),auth[_0x59c5('0x9')](),controller[_0x59c5('0x17')]);router[_0x59c5('0x14')](_0x59c5('0x10'),auth[_0x59c5('0x9')](),controller[_0x59c5('0x18')]);router[_0x59c5('0x14')](_0x59c5('0x12'),auth[_0x59c5('0x9')](),controller[_0x59c5('0x19')]);router[_0x59c5('0x1a')](_0x59c5('0xe'),auth[_0x59c5('0x9')](),controller[_0x59c5('0x1b')]);router[_0x59c5('0x1c')](_0x59c5('0xe'),auth[_0x59c5('0x9')](),controller[_0x59c5('0x1d')]);router['delete'](_0x59c5('0x10'),auth[_0x59c5('0x9')](),controller[_0x59c5('0x1e')]);router[_0x59c5('0x1c')](_0x59c5('0x12'),auth[_0x59c5('0x9')](),controller['removeResources']);module[_0x59c5('0x1f')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index fedd9db..8dceae3 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 _0xea44=['BOOLEAN','STRING','setDataValue','join','getDataValue','crudPermissions','split'];(function(_0x6fcc6e,_0x5d1c4e){var _0x234cee=function(_0x298e0e){while(--_0x298e0e){_0x6fcc6e['push'](_0x6fcc6e['shift']());}};_0x234cee(++_0x5d1c4e);}(_0xea44,0x189));var _0x4ea4=function(_0x3adf9b,_0x3e9b4d){_0x3adf9b=_0x3adf9b-0x0;var _0x3467c0=_0xea44[_0x3adf9b];return _0x3467c0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ea4('0x0')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x4c3068){this[_0x4ea4('0x1')]('crudPermissions',_0x4c3068?_0x4c3068[_0x4ea4('0x2')](''):[]);},'get':function(){return this[_0x4ea4('0x3')](_0x4ea4('0x4'))?this[_0x4ea4('0x3')]('crudPermissions')[_0x4ea4('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x4ea4('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x4ea4('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x4ea4('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x4ea4('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x4ea4('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x4ea4('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x4ea4('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x4ea4('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1b7b=['split','BOOLEAN','sequelize','exports','name','STRING','getDataValue','crudPermissions'];(function(_0x1af508,_0x42e31c){var _0x8b2bc4=function(_0x29d0b1){while(--_0x29d0b1){_0x1af508['push'](_0x1af508['shift']());}};_0x8b2bc4(++_0x42e31c);}(_0x1b7b,0x1b2));var _0xb1b7=function(_0x188150,_0x4cb031){_0x188150=_0x188150-0x0;var _0x185ada=_0x1b7b[_0x188150];return _0x185ada;};'use strict';var Sequelize=require(_0xb1b7('0x0'));module[_0xb1b7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb1b7('0x2')},'crudPermissions':{'type':Sequelize[_0xb1b7('0x3')],'set':function(_0x94426f){this['setDataValue']('crudPermissions',_0x94426f?_0x94426f['join'](''):[]);},'get':function(){return this[_0xb1b7('0x4')](_0xb1b7('0x5'))?this['getDataValue'](_0xb1b7('0x5'))[_0xb1b7('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xb1b7('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xb1b7('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xb1b7('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xb1b7('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index e23ec3e..86c4282 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 _0x9dd5=['type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','count','includeAll','findAll','rows','show','params','include','find','catch','create','body','clone','get','omit','updatedAt','transaction','UserProfileSection','autoAssociation','UserProfileResource','createdAt','sectionId','userProfileId','Resources','destroy','describe','addSections','sequelize','each','push','removeSections','filter','enabled','includes','subsections','concat','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','update','then','sendStatus','error','name','index','UserProfile','rawAttributes'];(function(_0xb6366a,_0x1e2bb2){var _0x22cdd4=function(_0x4feb3b){while(--_0x4feb3b){_0xb6366a['push'](_0xb6366a['shift']());}};_0x22cdd4(++_0x1e2bb2);}(_0x9dd5,0x127));var _0x59dd=function(_0x5a9fda,_0x52d739){_0x5a9fda=_0x5a9fda-0x0;var _0x318e60=_0x9dd5[_0x5a9fda];return _0x318e60;};'use strict';var emlformat=require(_0x59dd('0x0'));var rimraf=require(_0x59dd('0x1'));var zipdir=require(_0x59dd('0x2'));var jsonpatch=require(_0x59dd('0x3'));var rp=require(_0x59dd('0x4'));var moment=require(_0x59dd('0x5'));var BPromise=require(_0x59dd('0x6'));var Mustache=require(_0x59dd('0x7'));var util=require(_0x59dd('0x8'));var path=require('path');var sox=require(_0x59dd('0x9'));var csv=require('to-csv');var ejs=require(_0x59dd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x59dd('0xb'));var squel=require('squel');var crypto=require(_0x59dd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x59dd('0xd'));var toCsv=require(_0x59dd('0xe'));var querystring=require(_0x59dd('0xf'));var Papa=require(_0x59dd('0x10'));var Redis=require(_0x59dd('0x11'));var authService=require(_0x59dd('0x12'));var qs=require(_0x59dd('0x13'));var as=require(_0x59dd('0x14'));var hardwareService=require(_0x59dd('0x15'));var logger=require(_0x59dd('0x16'))(_0x59dd('0x17'));var utils=require(_0x59dd('0x18'));var config=require(_0x59dd('0x19'));var licenseUtil=require(_0x59dd('0x1a'));var db=require(_0x59dd('0x1b'))['db'];config[_0x59dd('0x1c')]=_[_0x59dd('0x1d')](config[_0x59dd('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x59dd('0x1e'))(new Redis(config[_0x59dd('0x1c')]));require('./userProfile.socket')[_0x59dd('0x1f')](socket);function respondWithStatusCode(_0x51c3d0,_0x103d73){_0x103d73=_0x103d73||0xcc;return function(_0x50b987){if(_0x50b987){return _0x51c3d0['sendStatus'](_0x103d73);}return _0x51c3d0[_0x59dd('0x20')](_0x103d73)[_0x59dd('0x21')]();};}function respondWithResult(_0x139ff4,_0x290ff4){_0x290ff4=_0x290ff4||0xc8;return function(_0x2d7a11){if(_0x2d7a11){return _0x139ff4['status'](_0x290ff4)[_0x59dd('0x22')](_0x2d7a11);}};}function respondWithFilteredResult(_0x2ff5e8,_0x2ce68a){return function(_0x12030b){if(_0x12030b){var _0x23b6ef=typeof _0x2ce68a['offset']===_0x59dd('0x23')&&typeof _0x2ce68a[_0x59dd('0x24')]==='undefined';var _0x5e6909=_0x12030b['count'];var _0x472d17=_0x23b6ef?0x0:_0x2ce68a[_0x59dd('0x25')];var _0x39d1cf=_0x23b6ef?_0x12030b['count']:_0x2ce68a[_0x59dd('0x25')]+_0x2ce68a[_0x59dd('0x24')];var _0x59342d;if(_0x39d1cf>=_0x5e6909){_0x39d1cf=_0x5e6909;_0x59342d=0xc8;}else{_0x59342d=0xce;}_0x2ff5e8[_0x59dd('0x20')](_0x59342d);return _0x2ff5e8[_0x59dd('0x26')](_0x59dd('0x27'),_0x472d17+'-'+_0x39d1cf+'/'+_0x5e6909)[_0x59dd('0x22')](_0x12030b);}return null;};}function patchUpdates(_0x1465d4){return function(_0x5d9877){try{jsonpatch[_0x59dd('0x28')](_0x5d9877,_0x1465d4,!![]);}catch(_0x5d5aa1){return BPromise[_0x59dd('0x29')](_0x5d5aa1);}return _0x5d9877['save']();};}function saveUpdates(_0x325362,_0x11c00e){return function(_0x38e765){if(_0x38e765){return _0x38e765[_0x59dd('0x2a')](_0x325362)['then'](function(_0x49b920){return _0x49b920;});}return null;};}function removeEntity(_0x190df9,_0x4b8d87){return function(_0x28b46e){if(_0x28b46e){return _0x28b46e['destroy']()[_0x59dd('0x2b')](function(){_0x190df9[_0x59dd('0x20')](0xcc)[_0x59dd('0x21')]();});}};}function handleEntityNotFound(_0x25bb31,_0x54eccd){return function(_0x33e89e){if(!_0x33e89e){_0x25bb31[_0x59dd('0x2c')](0x194);}return _0x33e89e;};}function handleError(_0x128767,_0x2f6095){_0x2f6095=_0x2f6095||0x1f4;return function(_0x52790b){logger[_0x59dd('0x2d')](_0x52790b['stack']);if(_0x52790b['name']){delete _0x52790b[_0x59dd('0x2e')];}_0x128767['status'](_0x2f6095)['send'](_0x52790b);};}exports[_0x59dd('0x2f')]=function(_0x47c219,_0x4ea7e7){var _0x1e6adc={},_0xa2cd1={},_0x25bcac={'count':0x0,'rows':[]};var _0x3eb23c=_['map'](db[_0x59dd('0x30')][_0x59dd('0x31')],function(_0x1f179c){return{'name':_0x1f179c['fieldName'],'type':_0x1f179c[_0x59dd('0x32')]['key']};});_0xa2cd1[_0x59dd('0x33')]=_[_0x59dd('0x34')](_0x3eb23c,_0x59dd('0x2e'));_0xa2cd1[_0x59dd('0x35')]=_[_0x59dd('0x36')](_0x47c219[_0x59dd('0x35')]);_0xa2cd1[_0x59dd('0x37')]=_[_0x59dd('0x38')](_0xa2cd1[_0x59dd('0x33')],_0xa2cd1[_0x59dd('0x35')]);_0x1e6adc['attributes']=_[_0x59dd('0x38')](_0xa2cd1[_0x59dd('0x33')],qs[_0x59dd('0x39')](_0x47c219[_0x59dd('0x35')][_0x59dd('0x39')]));_0x1e6adc[_0x59dd('0x3a')]=_0x1e6adc[_0x59dd('0x3a')][_0x59dd('0x3b')]?_0x1e6adc['attributes']:_0xa2cd1[_0x59dd('0x33')];if(!_0x47c219[_0x59dd('0x35')][_0x59dd('0x3c')](_0x59dd('0x3d'))){_0x1e6adc[_0x59dd('0x24')]=qs[_0x59dd('0x24')](_0x47c219['query'][_0x59dd('0x24')]);_0x1e6adc[_0x59dd('0x25')]=qs[_0x59dd('0x25')](_0x47c219['query'][_0x59dd('0x25')]);}_0x1e6adc[_0x59dd('0x3e')]=qs['sort'](_0x47c219[_0x59dd('0x35')][_0x59dd('0x3f')]);_0x1e6adc[_0x59dd('0x40')]=qs[_0x59dd('0x37')](_[_0x59dd('0x41')](_0x47c219['query'],_0xa2cd1[_0x59dd('0x37')]),_0x3eb23c);if(_0x47c219[_0x59dd('0x35')]['filter']){_0x1e6adc['where']=_[_0x59dd('0x42')](_0x1e6adc[_0x59dd('0x40')],{'$or':_[_0x59dd('0x34')](_0x3eb23c,function(_0x2fbf21){if(_0x2fbf21[_0x59dd('0x32')]!==_0x59dd('0x43')){var _0x566e4a={};_0x566e4a[_0x2fbf21[_0x59dd('0x2e')]]={'$like':'%'+_0x47c219[_0x59dd('0x35')]['filter']+'%'};return _0x566e4a;}})});}_0x1e6adc=_[_0x59dd('0x42')]({},_0x1e6adc,_0x47c219[_0x59dd('0x44')]);var _0x22e269={'where':_0x1e6adc[_0x59dd('0x40')]};return db[_0x59dd('0x30')][_0x59dd('0x45')](_0x22e269)['then'](function(_0x46dc03){_0x25bcac['count']=_0x46dc03;if(_0x47c219[_0x59dd('0x35')][_0x59dd('0x46')]){_0x1e6adc['include']=[{'all':!![]}];}return db[_0x59dd('0x30')][_0x59dd('0x47')](_0x1e6adc);})[_0x59dd('0x2b')](function(_0x52e7e5){_0x25bcac[_0x59dd('0x48')]=_0x52e7e5;return _0x25bcac;})[_0x59dd('0x2b')](respondWithFilteredResult(_0x4ea7e7,_0x1e6adc))['catch'](handleError(_0x4ea7e7,null));};exports[_0x59dd('0x49')]=function(_0x3e73b9,_0x3fd10f){var _0x90858f={'raw':![],'where':{'id':_0x3e73b9[_0x59dd('0x4a')]['id']}},_0x211a0c={};_0x211a0c[_0x59dd('0x33')]=_['keys'](db[_0x59dd('0x30')][_0x59dd('0x31')]);_0x211a0c[_0x59dd('0x35')]=_['keys'](_0x3e73b9[_0x59dd('0x35')]);_0x211a0c[_0x59dd('0x37')]=_[_0x59dd('0x38')](_0x211a0c[_0x59dd('0x33')],_0x211a0c[_0x59dd('0x35')]);_0x90858f['attributes']=_['intersection'](_0x211a0c['model'],qs['fields'](_0x3e73b9[_0x59dd('0x35')]['fields']));_0x90858f[_0x59dd('0x3a')]=_0x90858f[_0x59dd('0x3a')][_0x59dd('0x3b')]?_0x90858f['attributes']:_0x211a0c[_0x59dd('0x33')];if(_0x3e73b9[_0x59dd('0x35')][_0x59dd('0x46')]){_0x90858f[_0x59dd('0x4b')]=[{'all':!![]}];}_0x90858f=_[_0x59dd('0x42')]({},_0x90858f,_0x3e73b9['options']);return db[_0x59dd('0x30')][_0x59dd('0x4c')](_0x90858f)[_0x59dd('0x2b')](handleEntityNotFound(_0x3fd10f,null))[_0x59dd('0x2b')](respondWithResult(_0x3fd10f,null))[_0x59dd('0x4d')](handleError(_0x3fd10f,null));};exports[_0x59dd('0x4e')]=function(_0x217218,_0x1a5a91){return db['UserProfile'][_0x59dd('0x4e')](_0x217218[_0x59dd('0x4f')],{})[_0x59dd('0x2b')](respondWithResult(_0x1a5a91,0xc9))[_0x59dd('0x4d')](handleError(_0x1a5a91,null));};exports[_0x59dd('0x50')]=function(_0x43947c,_0x368716){var _0xeed3e1={'where':{'id':_0x43947c[_0x59dd('0x4a')]['id']}},_0x4dc5a8={};_0x4dc5a8['model']=_[_0x59dd('0x36')](db[_0x59dd('0x30')][_0x59dd('0x31')]);_0xeed3e1[_0x59dd('0x3a')]=_[_0x59dd('0x38')](_0x4dc5a8[_0x59dd('0x33')],qs[_0x59dd('0x39')](_0x43947c['query']['fields']));_0xeed3e1[_0x59dd('0x3a')]=_0xeed3e1[_0x59dd('0x3a')][_0x59dd('0x3b')]?_0xeed3e1[_0x59dd('0x3a')]:_0x4dc5a8['model'];if(_0x43947c[_0x59dd('0x35')][_0x59dd('0x46')]){_0xeed3e1['include']=[{'all':!![]}];}_0xeed3e1=_['merge']({},_0xeed3e1,_0x43947c[_0x59dd('0x44')]);return db[_0x59dd('0x30')][_0x59dd('0x4c')](_0xeed3e1)['then'](handleEntityNotFound(_0x368716,null))[_0x59dd('0x2b')](function(_0x5517d8){if(_0x5517d8){var _0x59bb01=_0x5517d8[_0x59dd('0x51')]({'plain':!![]});_0x59bb01=qs[_0x59dd('0x52')](_0x59bb01,['id','createdAt','updatedAt','crudPermissions']);_0x43947c[_0x59dd('0x4f')]=_[_0x59dd('0x52')](_0x43947c[_0x59dd('0x4f')],['id','createdAt',_0x59dd('0x53')]);return db['sequelize'][_0x59dd('0x54')](function(_0x2c5226){return db[_0x59dd('0x30')][_0x59dd('0x4e')](_['merge'](_0x59bb01,_0x43947c['body']),{'include':_0x43947c[_0x59dd('0x35')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x2c5226})[_0x59dd('0x2b')](function(_0x4ca530){var _0x5e208d=_0x4ca530[_0x59dd('0x51')]({'plain':!![]});return db[_0x59dd('0x55')]['findAll']({'where':{'userProfileId':_0x43947c[_0x59dd('0x4a')]['id']},'raw':!![]})[_0x59dd('0x2b')](function(_0x14e0e4){if(_0x14e0e4){return BPromise['each'](_0x14e0e4,function(_0x5a6089){return new BPromise(function(_0x567c57,_0x2f56dd){if(_0x5a6089[_0x59dd('0x56')]===null||_0x5a6089[_0x59dd('0x56')]===0x1)_0x567c57(null);return db[_0x59dd('0x57')][_0x59dd('0x47')]({'where':{'sectionId':_0x5a6089['id']},'raw':!![]})[_0x59dd('0x2b')](function(_0x3e1685){var _0x4b1256=_[_0x59dd('0x34')](_0x3e1685,function(_0x29a864){return qs['omit'](_0x29a864,['id',_0x59dd('0x58'),_0x59dd('0x53'),_0x59dd('0x59')]);});_0x567c57(_0x4b1256);})[_0x59dd('0x4d')](function(_0x8a63eb){_0x2f56dd(_0x8a63eb);});})[_0x59dd('0x2b')](function(_0x117dca){var _0x47b489=qs[_0x59dd('0x52')](_0x5a6089,['id',_0x59dd('0x58'),_0x59dd('0x53')]);_0x47b489[_0x59dd('0x5a')]=_0x5e208d['id'];if(_0x117dca)_0x47b489['Resources']=_0x117dca;return _0x47b489;})[_0x59dd('0x2b')](function(_0xfd6b86){return db[_0x59dd('0x55')][_0x59dd('0x4e')](_0xfd6b86,{'include':[{'model':db[_0x59dd('0x57')],'as':_0x59dd('0x5b')}],'raw':!![],'transaction':_0x2c5226});});})[_0x59dd('0x2b')](function(){return _0x5e208d;});}});});});}})[_0x59dd('0x2b')](respondWithResult(_0x368716,0xc9))[_0x59dd('0x4d')](handleError(_0x368716,null));};exports[_0x59dd('0x2a')]=function(_0x37a27f,_0x39a7da){if(_0x37a27f[_0x59dd('0x4f')]['id']){delete _0x37a27f[_0x59dd('0x4f')]['id'];}return db['UserProfile'][_0x59dd('0x4c')]({'where':{'id':_0x37a27f['params']['id']}})['then'](handleEntityNotFound(_0x39a7da,null))[_0x59dd('0x2b')](saveUpdates(_0x37a27f[_0x59dd('0x4f')],null))[_0x59dd('0x2b')](respondWithResult(_0x39a7da,null))[_0x59dd('0x4d')](handleError(_0x39a7da,null));};exports[_0x59dd('0x5c')]=function(_0x3663cb,_0x40f772){return db[_0x59dd('0x30')][_0x59dd('0x4c')]({'where':{'id':_0x3663cb['params']['id']}})['then'](handleEntityNotFound(_0x40f772,null))[_0x59dd('0x2b')](removeEntity(_0x40f772,null))[_0x59dd('0x4d')](handleError(_0x40f772,null));};exports[_0x59dd('0x5d')]=function(_0x2f0877,_0x13ffbd){return db[_0x59dd('0x30')][_0x59dd('0x5d')]()[_0x59dd('0x2b')](respondWithResult(_0x13ffbd,null))[_0x59dd('0x4d')](handleError(_0x13ffbd,null));};exports[_0x59dd('0x5e')]=function(_0x1f8878,_0x2c8b4a){var _0x4041e4=_0x1f8878[_0x59dd('0x4f')];return db[_0x59dd('0x30')][_0x59dd('0x4c')]({'where':{'id':_0x1f8878[_0x59dd('0x4a')]['id']}})[_0x59dd('0x2b')](handleEntityNotFound(_0x2c8b4a,null))[_0x59dd('0x2b')](function(_0x1fb51a){if(_0x1fb51a){return db[_0x59dd('0x5f')][_0x59dd('0x54')](function(_0x57bcd5){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x1f8878[_0x59dd('0x4a')]['id'],'sectionId':_['map'](_0x4041e4,function(_0x248069){return _0x248069[_0x59dd('0x59')];})},'transaction':_0x57bcd5})[_0x59dd('0x2b')](function(){var _0x1023a8=_['map'](_0x4041e4,function(_0x492d32){_0x492d32[_0x59dd('0x5a')]=_0x1f8878[_0x59dd('0x4a')]['id'];return _0x492d32;});var _0xa64add=[];return BPromise[_0x59dd('0x60')](_0x1023a8,function(_0x526fca){return db[_0x59dd('0x55')][_0x59dd('0x4e')](_0x526fca,{'include':[{'model':db[_0x59dd('0x57')],'as':_0x59dd('0x5b')}],'raw':!![],'transaction':_0x57bcd5})['then'](function(_0x9e0425){_0xa64add[_0x59dd('0x61')](_0x9e0425[_0x59dd('0x51')]({'plain':!![]}));});})['then'](function(){return _0xa64add;});});});}})['then'](function(_0x2bd8b4){return _0x2bd8b4;})[_0x59dd('0x2b')](respondWithResult(_0x2c8b4a,null))[_0x59dd('0x4d')](handleError(_0x2c8b4a,null));};exports[_0x59dd('0x62')]=function(_0x510a6b,_0x6d0312){var _0x72640d;return db[_0x59dd('0x30')]['find']({'where':{'id':_0x510a6b['params']['id']},'attributes':['id','name']})[_0x59dd('0x2b')](handleEntityNotFound(_0x6d0312,null))[_0x59dd('0x2b')](function(_0x244868){if(_0x244868){_0x72640d=_0x244868;return db['UserProfileSection'][_0x59dd('0x5c')]({'where':{'userProfileId':_0x510a6b[_0x59dd('0x4a')]['id'],'sectionId':_0x510a6b[_0x59dd('0x35')]['ids']}});}})[_0x59dd('0x2b')](function(){return _0x72640d;})['then'](respondWithStatusCode(_0x6d0312,null))['catch'](handleError(_0x6d0312,null));};exports['getSections']=function(_0x33011e,_0x24dab9){var _0x2eea5c=[];var _0x21d730=[];return db['UserProfileSection'][_0x59dd('0x47')]({'where':{'userProfileId':_0x33011e[_0x59dd('0x4a')]['id']},'raw':!![]})[_0x59dd('0x2b')](function(_0x96aaea){_0x2eea5c=_[_0x59dd('0x63')](_0x96aaea,function(_0x47c056){return _0x47c056[_0x59dd('0x64')]===0x1||_[_0x59dd('0x65')]([0x3eb,0x709],_0x47c056[_0x59dd('0x59')]);});if(!_['isEmpty'](_0x2eea5c)){return _[_0x59dd('0x34')](_0x2eea5c,function(_0x1436a7){return _0x1436a7[_0x59dd('0x59')];});}else{return;}})[_0x59dd('0x2b')](function(_0x3b49ce){if(_0x3b49ce)_0x21d730=_0x3b49ce;if(_[_0x59dd('0x65')](_0x21d730,0x64)){var _0x3d4938=_[_0x59dd('0x4c')](_0x2eea5c,{'sectionId':0x64});return hasDefaultDashboard(_0x3d4938)[_0x59dd('0x2b')](function(_0x1cf52c){return _[_0x59dd('0x34')](_0x2eea5c,function(_0x20ade7){if(_0x20ade7[_0x59dd('0x59')]===0x64){_0x20ade7[_0x59dd('0x66')]=_0x1cf52c;}return _0x20ade7;});});}else{return;}})[_0x59dd('0x2b')](function(_0x3b8b20){if(_0x3b8b20)_0x2eea5c=_0x3b8b20;if(_[_0x59dd('0x65')](_0x21d730,0x3eb)){var _0x2f7a98=_[_0x59dd('0x4c')](_0x2eea5c,{'sectionId':0x3eb});return getCustomDashboards(_0x2f7a98)[_0x59dd('0x2b')](function(_0x3719dd){return _[_0x59dd('0x34')](_0x2eea5c,function(_0x4df221){if(_0x2f7a98[_0x59dd('0x64')]){if(_0x4df221[_0x59dd('0x59')]===0x3eb){_0x4df221[_0x59dd('0x66')]=_0x3719dd;}}else{if(_0x4df221[_0x59dd('0x59')]===0x64){if(!_0x4df221[_0x59dd('0x66')]){_0x4df221['subsections']=[];}_0x4df221[_0x59dd('0x66')]=_0x4df221[_0x59dd('0x66')][_0x59dd('0x67')](_0x3719dd);}}return _0x4df221;});});}else{return;}})[_0x59dd('0x2b')](function(_0x1f4430){if(_0x1f4430)_0x2eea5c=_0x1f4430;if(_['includes'](_0x21d730,0x709)){var _0x16c0d3=_['find'](_0x2eea5c,{'sectionId':0x709});return getPlugins(_0x16c0d3)['then'](function(_0x4f381c){if(_0x16c0d3[_0x59dd('0x64')]){return _[_0x59dd('0x34')](_0x2eea5c,function(_0x23ca8f){if(_0x23ca8f[_0x59dd('0x59')]===0x709){_0x23ca8f[_0x59dd('0x66')]=_0x4f381c;}return _0x23ca8f;});}else{var _0x2d0f43={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4f381c};var _0x3a5f65=_[_0x59dd('0x34')](_0x2eea5c);_0x3a5f65['push'](_0x2d0f43);return _0x3a5f65;}});}else{return;}})[_0x59dd('0x2b')](function(_0x221bb5){if(_0x221bb5)_0x2eea5c=_0x221bb5;return _[_0x59dd('0x63')](_0x2eea5c,[_0x59dd('0x64'),0x1]);})['then'](respondWithResult(_0x24dab9,null))[_0x59dd('0x4d')](handleError(_0x24dab9,null));};function hasDefaultDashboard(_0x1bac0a){var _0x54335f=[0x65];return new BPromise(function(_0x1d404f,_0xc6656d){try{if(_0x1bac0a[_0x59dd('0x56')]){_0x1d404f(_0x54335f);}else{return db['UserProfileResource'][_0x59dd('0x68')]({'where':{'sectionId':_0x1bac0a['id']},'raw':!![]})[_0x59dd('0x2b')](function(_0x1d1102){_0x1d1102?_0x1d404f(_0x54335f):_0x1d404f();});}}catch(_0x4d3400){_0xc6656d(_0x4d3400);}});}function getCustomDashboards(_0x414cb0){var _0x1fc6cf=[];return new BPromise(function(_0x57aad3,_0x5375d8){try{if(_0x414cb0[_0x59dd('0x56')]){return db[_0x59dd('0x69')]['findAll']({'raw':!![]})[_0x59dd('0x2b')](function(_0x5a7be4){_0x5a7be4[_0x59dd('0x6a')](function(_0x3e2798){_0x1fc6cf[_0x59dd('0x61')](_0x3e2798['id']+0x1869f);});_0x57aad3(_0x1fc6cf);});}else{return db[_0x59dd('0x57')][_0x59dd('0x47')]({'where':{'sectionId':_0x414cb0['id']},'raw':!![]})[_0x59dd('0x2b')](function(_0x147282){_0x147282['forEach'](function(_0x51a392){_0x1fc6cf['push'](_0x51a392[_0x59dd('0x6b')]+0x1869f);});_0x57aad3(_0x1fc6cf);});}}catch(_0xd4ac62){_0x5375d8(_0xd4ac62);}});}function getPlugins(_0x3bf1b6){var _0x5aae64=[];return new BPromise(function(_0x3ee5b5,_0x5dbff6){try{if(_0x3bf1b6['autoAssociation']){return db[_0x59dd('0x6c')]['findAll']({'raw':!![]})['then'](function(_0x5cd1e4){_0x5cd1e4[_0x59dd('0x6a')](function(_0xcf0339){_0x5aae64[_0x59dd('0x61')](_0xcf0339['id']+0x15b38);});_0x3ee5b5(_0x5aae64);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x3bf1b6['id']},'raw':!![]})[_0x59dd('0x2b')](function(_0x177216){_0x177216['forEach'](function(_0xfba40a){_0x5aae64[_0x59dd('0x61')](_0xfba40a[_0x59dd('0x6b')]+0x15b38);});_0x3ee5b5(_0x5aae64);});}}catch(_0x520737){_0x5dbff6(_0x520737);}});}exports['addResources']=function(_0x221205,_0x29b827){return db[_0x59dd('0x30')]['find']({'where':{'id':_0x221205['params']['id']}})['then'](handleEntityNotFound(_0x29b827,null))['then'](function(_0x475387){if(_0x475387){return db[_0x59dd('0x5f')][_0x59dd('0x54')](function(_0x2dcb4f){return db[_0x59dd('0x55')][_0x59dd('0x47')]({'where':{'userProfileId':_0x221205[_0x59dd('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0x59dd('0x2b')](function(_0x46d25b){if(_0x46d25b){return db[_0x59dd('0x55')][_0x59dd('0x5c')]({'where':{'userProfileId':_0x221205[_0x59dd('0x4a')]['id'],'id':_[_0x59dd('0x34')](_0x46d25b,function(_0x2ba2d9){return _0x2ba2d9['id'];})},'transaction':_0x2dcb4f});}})['then'](function(_0x117c5d){var _0x53d593=_[_0x59dd('0x34')](_0x221205[_0x59dd('0x4f')],function(_0x58cadf){_0x58cadf['userProfileId']=_0x221205[_0x59dd('0x4a')]['id'];return _0x58cadf;});return db['UserProfileSection'][_0x59dd('0x6d')](_0x53d593,{'raw':!![],'transaction':_0x2dcb4f});})[_0x59dd('0x2b')](function(_0x327917){var _0x138408=_['filter'](_[_0x59dd('0x34')](_0x327917,function(_0x289456){return _0x289456[_0x59dd('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x138408){return db[_0x59dd('0x55')][_0x59dd('0x47')]({'where':{'userProfileId':_0x221205[_0x59dd('0x4a')]['id'],'sectionId':_[_0x59dd('0x34')](_0x138408,function(_0x3e5909){return _0x3e5909[_0x59dd('0x59')];})},'attributes':['id',_0x59dd('0x59')],'raw':!![]})['then'](function(_0x84eee3){var _0x4d17c1=_[_0x59dd('0x34')](_0x221205[_0x59dd('0x4f')],function(_0x115bda){_0x115bda[_0x59dd('0x5a')]=_0x221205['params']['id'];return _0x115bda;});return db[_0x59dd('0x57')][_0x59dd('0x6d')](_0x4d17c1,{'raw':!![],'transaction':_0x2dcb4f});});}})['catch'](handleError(_0x29b827,null));});}})['then'](function(_0x2862cb){var _0x2dda4d=_[_0x59dd('0x34')](_0x2862cb,function(_0x8c3354){return _0x8c3354[_0x59dd('0x51')]({'plain':!![]});});})[_0x59dd('0x2b')](respondWithResult(_0x29b827,null))[_0x59dd('0x4d')](handleError(_0x29b827,null));};exports[_0x59dd('0x6e')]=function(_0x3c613b,_0x168baf,_0x1d1fc5){return db[_0x59dd('0x30')][_0x59dd('0x4c')]({'where':{'id':_0x3c613b[_0x59dd('0x4a')]['id']}})[_0x59dd('0x2b')](handleEntityNotFound(_0x168baf,null))[_0x59dd('0x2b')](function(_0x47177b){if(_0x47177b){return _0x47177b[_0x59dd('0x6e')](_0x3c613b['query'][_0x59dd('0x6f')]);}})[_0x59dd('0x2b')](respondWithStatusCode(_0x168baf,null))[_0x59dd('0x4d')](handleError(_0x168baf,null));};exports[_0x59dd('0x70')]=function(_0x8886e1,_0x2aa524){var _0xbf2f91={};if(!_0x8886e1[_0x59dd('0x35')][_0x59dd('0x71')])throw new Error(_0x59dd('0x72'));if(!_0x8886e1['query'][_0x59dd('0x3c')](_0x59dd('0x3d'))){_0xbf2f91[_0x59dd('0x24')]=qs['limit'](_0x8886e1[_0x59dd('0x35')][_0x59dd('0x24')]);_0xbf2f91[_0x59dd('0x25')]=qs[_0x59dd('0x25')](_0x8886e1['query'][_0x59dd('0x25')]);}return db[_0x59dd('0x30')][_0x59dd('0x4c')]({'where':{'id':_0x8886e1['params']['id']}})[_0x59dd('0x2b')](function(_0x256360){if(!_0x256360)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x8886e1[_0x59dd('0x4a')]['id']);return db[_0x59dd('0x30')][_0x59dd('0x70')](_0x8886e1);})[_0x59dd('0x2b')](respondWithFilteredResult(_0x2aa524,_0xbf2f91))[_0x59dd('0x4d')](handleError(_0x2aa524,null));}; \ No newline at end of file +var _0x50dc=['stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','UserProfile','rows','catch','show','options','find','create','clone','params','get','omit','updatedAt','body','createdAt','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','findAll','sectionId','Resources','describe','addSections','push','ids','getSections','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','Plugin','addResources','userProfileId','bulkCreate','removeResources','getResources','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x2262a4,_0x39d0c1){var _0x3ec190=function(_0x3ef421){while(--_0x3ef421){_0x2262a4['push'](_0x2262a4['shift']());}};_0x3ec190(++_0x39d0c1);}(_0x50dc,0x194));var _0xc50d=function(_0x5b5c7c,_0x5889af){_0x5b5c7c=_0x5b5c7c-0x0;var _0x5c53d1=_0x50dc[_0x5b5c7c];return _0x5c53d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc50d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc50d('0x1'));var rp=require('request-promise');var moment=require(_0xc50d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc50d('0x3'));var util=require(_0xc50d('0x4'));var path=require(_0xc50d('0x5'));var sox=require(_0xc50d('0x6'));var csv=require(_0xc50d('0x7'));var ejs=require(_0xc50d('0x8'));var fs=require('fs');var fs_extra=require(_0xc50d('0x9'));var _=require(_0xc50d('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc50d('0xb'));var Papa=require('papaparse');var Redis=require(_0xc50d('0xc'));var authService=require(_0xc50d('0xd'));var qs=require(_0xc50d('0xe'));var as=require(_0xc50d('0xf'));var hardwareService=require(_0xc50d('0x10'));var logger=require(_0xc50d('0x11'))(_0xc50d('0x12'));var utils=require(_0xc50d('0x13'));var config=require(_0xc50d('0x14'));var licenseUtil=require(_0xc50d('0x15'));var db=require(_0xc50d('0x16'))['db'];config['redis']=_['defaults'](config[_0xc50d('0x17')],{'host':_0xc50d('0x18'),'port':0x18eb});var socket=require(_0xc50d('0x19'))(new Redis(config[_0xc50d('0x17')]));require(_0xc50d('0x1a'))[_0xc50d('0x1b')](socket);function respondWithStatusCode(_0x33816f,_0x44a06e){_0x44a06e=_0x44a06e||0xcc;return function(_0x51cb8f){if(_0x51cb8f){return _0x33816f[_0xc50d('0x1c')](_0x44a06e);}return _0x33816f['status'](_0x44a06e)[_0xc50d('0x1d')]();};}function respondWithResult(_0x397e32,_0x32bfac){_0x32bfac=_0x32bfac||0xc8;return function(_0x4fcec7){if(_0x4fcec7){return _0x397e32[_0xc50d('0x1e')](_0x32bfac)[_0xc50d('0x1f')](_0x4fcec7);}};}function respondWithFilteredResult(_0x5f367c,_0x5355f7){return function(_0x1f5337){if(_0x1f5337){var _0x512f0c=typeof _0x5355f7[_0xc50d('0x20')]==='undefined'&&typeof _0x5355f7[_0xc50d('0x21')]===_0xc50d('0x22');var _0x490520=_0x1f5337[_0xc50d('0x23')];var _0x17afae=_0x512f0c?0x0:_0x5355f7[_0xc50d('0x20')];var _0x4e0f75=_0x512f0c?_0x1f5337[_0xc50d('0x23')]:_0x5355f7[_0xc50d('0x20')]+_0x5355f7['limit'];var _0x51f624;if(_0x4e0f75>=_0x490520){_0x4e0f75=_0x490520;_0x51f624=0xc8;}else{_0x51f624=0xce;}_0x5f367c[_0xc50d('0x1e')](_0x51f624);return _0x5f367c[_0xc50d('0x24')](_0xc50d('0x25'),_0x17afae+'-'+_0x4e0f75+'/'+_0x490520)[_0xc50d('0x1f')](_0x1f5337);}return null;};}function patchUpdates(_0x394745){return function(_0x911f28){try{jsonpatch[_0xc50d('0x26')](_0x911f28,_0x394745,!![]);}catch(_0x2c2929){return BPromise[_0xc50d('0x27')](_0x2c2929);}return _0x911f28[_0xc50d('0x28')]();};}function saveUpdates(_0x155ce5,_0x288ccf){return function(_0x43b661){if(_0x43b661){return _0x43b661[_0xc50d('0x29')](_0x155ce5)[_0xc50d('0x2a')](function(_0x512b00){return _0x512b00;});}return null;};}function removeEntity(_0x1999e8,_0x1db5ed){return function(_0x52bfdd){if(_0x52bfdd){return _0x52bfdd[_0xc50d('0x2b')]()[_0xc50d('0x2a')](function(){_0x1999e8[_0xc50d('0x1e')](0xcc)[_0xc50d('0x1d')]();});}};}function handleEntityNotFound(_0x289b3d,_0x5b31f7){return function(_0x23130c){if(!_0x23130c){_0x289b3d[_0xc50d('0x1c')](0x194);}return _0x23130c;};}function handleError(_0x1aacfc,_0x42c493){_0x42c493=_0x42c493||0x1f4;return function(_0x57020b){logger['error'](_0x57020b[_0xc50d('0x2c')]);if(_0x57020b[_0xc50d('0x2d')]){delete _0x57020b[_0xc50d('0x2d')];}_0x1aacfc[_0xc50d('0x1e')](_0x42c493)['send'](_0x57020b);};}exports['index']=function(_0x1fbf28,_0x56b8c6){var _0x4922c8={},_0x5d2998={},_0x1a73d5={'count':0x0,'rows':[]};var _0x5dffb6=_[_0xc50d('0x2e')](db['UserProfile'][_0xc50d('0x2f')],function(_0x427be5){return{'name':_0x427be5[_0xc50d('0x30')],'type':_0x427be5[_0xc50d('0x31')][_0xc50d('0x32')]};});_0x5d2998[_0xc50d('0x33')]=_[_0xc50d('0x2e')](_0x5dffb6,'name');_0x5d2998[_0xc50d('0x34')]=_[_0xc50d('0x35')](_0x1fbf28[_0xc50d('0x34')]);_0x5d2998[_0xc50d('0x36')]=_[_0xc50d('0x37')](_0x5d2998[_0xc50d('0x33')],_0x5d2998['query']);_0x4922c8['attributes']=_['intersection'](_0x5d2998[_0xc50d('0x33')],qs[_0xc50d('0x38')](_0x1fbf28[_0xc50d('0x34')][_0xc50d('0x38')]));_0x4922c8[_0xc50d('0x39')]=_0x4922c8[_0xc50d('0x39')][_0xc50d('0x3a')]?_0x4922c8[_0xc50d('0x39')]:_0x5d2998[_0xc50d('0x33')];if(!_0x1fbf28[_0xc50d('0x34')][_0xc50d('0x3b')](_0xc50d('0x3c'))){_0x4922c8[_0xc50d('0x21')]=qs['limit'](_0x1fbf28[_0xc50d('0x34')][_0xc50d('0x21')]);_0x4922c8['offset']=qs[_0xc50d('0x20')](_0x1fbf28[_0xc50d('0x34')][_0xc50d('0x20')]);}_0x4922c8[_0xc50d('0x3d')]=qs[_0xc50d('0x3e')](_0x1fbf28[_0xc50d('0x34')][_0xc50d('0x3e')]);_0x4922c8[_0xc50d('0x3f')]=qs[_0xc50d('0x36')](_[_0xc50d('0x40')](_0x1fbf28[_0xc50d('0x34')],_0x5d2998[_0xc50d('0x36')]),_0x5dffb6);if(_0x1fbf28[_0xc50d('0x34')]['filter']){_0x4922c8[_0xc50d('0x3f')]=_[_0xc50d('0x41')](_0x4922c8[_0xc50d('0x3f')],{'$or':_[_0xc50d('0x2e')](_0x5dffb6,function(_0x20450d){if(_0x20450d[_0xc50d('0x31')]!==_0xc50d('0x42')){var _0x57cef1={};_0x57cef1[_0x20450d[_0xc50d('0x2d')]]={'$like':'%'+_0x1fbf28[_0xc50d('0x34')][_0xc50d('0x43')]+'%'};return _0x57cef1;}})});}_0x4922c8=_[_0xc50d('0x41')]({},_0x4922c8,_0x1fbf28['options']);var _0x12128d={'where':_0x4922c8[_0xc50d('0x3f')]};return db['UserProfile']['count'](_0x12128d)[_0xc50d('0x2a')](function(_0x76e29f){_0x1a73d5[_0xc50d('0x23')]=_0x76e29f;if(_0x1fbf28[_0xc50d('0x34')][_0xc50d('0x44')]){_0x4922c8[_0xc50d('0x45')]=[{'all':!![]}];}return db[_0xc50d('0x46')]['findAll'](_0x4922c8);})[_0xc50d('0x2a')](function(_0x51f158){_0x1a73d5[_0xc50d('0x47')]=_0x51f158;return _0x1a73d5;})[_0xc50d('0x2a')](respondWithFilteredResult(_0x56b8c6,_0x4922c8))[_0xc50d('0x48')](handleError(_0x56b8c6,null));};exports[_0xc50d('0x49')]=function(_0xf64f68,_0x2a36f0){var _0x4395d2={'raw':![],'where':{'id':_0xf64f68['params']['id']}},_0x417d25={};_0x417d25['model']=_[_0xc50d('0x35')](db['UserProfile'][_0xc50d('0x2f')]);_0x417d25[_0xc50d('0x34')]=_['keys'](_0xf64f68['query']);_0x417d25['filters']=_[_0xc50d('0x37')](_0x417d25[_0xc50d('0x33')],_0x417d25[_0xc50d('0x34')]);_0x4395d2[_0xc50d('0x39')]=_[_0xc50d('0x37')](_0x417d25[_0xc50d('0x33')],qs['fields'](_0xf64f68['query']['fields']));_0x4395d2[_0xc50d('0x39')]=_0x4395d2[_0xc50d('0x39')][_0xc50d('0x3a')]?_0x4395d2[_0xc50d('0x39')]:_0x417d25[_0xc50d('0x33')];if(_0xf64f68[_0xc50d('0x34')][_0xc50d('0x44')]){_0x4395d2[_0xc50d('0x45')]=[{'all':!![]}];}_0x4395d2=_[_0xc50d('0x41')]({},_0x4395d2,_0xf64f68[_0xc50d('0x4a')]);return db[_0xc50d('0x46')][_0xc50d('0x4b')](_0x4395d2)['then'](handleEntityNotFound(_0x2a36f0,null))['then'](respondWithResult(_0x2a36f0,null))['catch'](handleError(_0x2a36f0,null));};exports[_0xc50d('0x4c')]=function(_0x2ed08d,_0x23d862){return db[_0xc50d('0x46')][_0xc50d('0x4c')](_0x2ed08d['body'],{})[_0xc50d('0x2a')](respondWithResult(_0x23d862,0xc9))[_0xc50d('0x48')](handleError(_0x23d862,null));};exports[_0xc50d('0x4d')]=function(_0x2f53b9,_0x33a638){var _0x5af5b1={'where':{'id':_0x2f53b9[_0xc50d('0x4e')]['id']}},_0x2fac85={};_0x2fac85['model']=_[_0xc50d('0x35')](db['UserProfile']['rawAttributes']);_0x5af5b1[_0xc50d('0x39')]=_['intersection'](_0x2fac85[_0xc50d('0x33')],qs[_0xc50d('0x38')](_0x2f53b9[_0xc50d('0x34')]['fields']));_0x5af5b1[_0xc50d('0x39')]=_0x5af5b1['attributes']['length']?_0x5af5b1[_0xc50d('0x39')]:_0x2fac85['model'];if(_0x2f53b9['query']['includeAll']){_0x5af5b1[_0xc50d('0x45')]=[{'all':!![]}];}_0x5af5b1=_[_0xc50d('0x41')]({},_0x5af5b1,_0x2f53b9[_0xc50d('0x4a')]);return db[_0xc50d('0x46')][_0xc50d('0x4b')](_0x5af5b1)[_0xc50d('0x2a')](handleEntityNotFound(_0x33a638,null))[_0xc50d('0x2a')](function(_0x3b8031){if(_0x3b8031){var _0xd6cb99=_0x3b8031[_0xc50d('0x4f')]({'plain':!![]});_0xd6cb99=qs[_0xc50d('0x50')](_0xd6cb99,['id','createdAt',_0xc50d('0x51'),'crudPermissions']);_0x2f53b9['body']=_[_0xc50d('0x50')](_0x2f53b9[_0xc50d('0x52')],['id',_0xc50d('0x53'),_0xc50d('0x51')]);return db[_0xc50d('0x54')][_0xc50d('0x55')](function(_0x2b671a){return db['UserProfile']['create'](_[_0xc50d('0x41')](_0xd6cb99,_0x2f53b9[_0xc50d('0x52')]),{'include':_0x2f53b9[_0xc50d('0x34')][_0xc50d('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x2b671a})[_0xc50d('0x2a')](function(_0x4d6006){var _0x5a1229=_0x4d6006[_0xc50d('0x4f')]({'plain':!![]});return db[_0xc50d('0x56')]['findAll']({'where':{'userProfileId':_0x2f53b9['params']['id']},'raw':!![]})[_0xc50d('0x2a')](function(_0x17f122){if(_0x17f122){return BPromise['each'](_0x17f122,function(_0x2f3626){return new BPromise(function(_0x225af7,_0x3cc06c){if(_0x2f3626[_0xc50d('0x57')]===null||_0x2f3626[_0xc50d('0x57')]===0x1)_0x225af7(null);return db[_0xc50d('0x58')][_0xc50d('0x59')]({'where':{'sectionId':_0x2f3626['id']},'raw':!![]})['then'](function(_0x3a2f4c){var _0x4ab69b=_[_0xc50d('0x2e')](_0x3a2f4c,function(_0x4b4251){return qs[_0xc50d('0x50')](_0x4b4251,['id',_0xc50d('0x53'),_0xc50d('0x51'),_0xc50d('0x5a')]);});_0x225af7(_0x4ab69b);})[_0xc50d('0x48')](function(_0x4bf0a6){_0x3cc06c(_0x4bf0a6);});})[_0xc50d('0x2a')](function(_0x19d9c5){var _0x1f38dd=qs[_0xc50d('0x50')](_0x2f3626,['id',_0xc50d('0x53'),_0xc50d('0x51')]);_0x1f38dd['userProfileId']=_0x5a1229['id'];if(_0x19d9c5)_0x1f38dd[_0xc50d('0x5b')]=_0x19d9c5;return _0x1f38dd;})['then'](function(_0x312a9c){return db[_0xc50d('0x56')][_0xc50d('0x4c')](_0x312a9c,{'include':[{'model':db[_0xc50d('0x58')],'as':'Resources'}],'raw':!![],'transaction':_0x2b671a});});})[_0xc50d('0x2a')](function(){return _0x5a1229;});}});});});}})['then'](respondWithResult(_0x33a638,0xc9))[_0xc50d('0x48')](handleError(_0x33a638,null));};exports[_0xc50d('0x29')]=function(_0x30ea39,_0x4d9a16){if(_0x30ea39['body']['id']){delete _0x30ea39[_0xc50d('0x52')]['id'];}return db[_0xc50d('0x46')][_0xc50d('0x4b')]({'where':{'id':_0x30ea39['params']['id']}})['then'](handleEntityNotFound(_0x4d9a16,null))[_0xc50d('0x2a')](saveUpdates(_0x30ea39[_0xc50d('0x52')],null))[_0xc50d('0x2a')](respondWithResult(_0x4d9a16,null))['catch'](handleError(_0x4d9a16,null));};exports[_0xc50d('0x2b')]=function(_0xa9104b,_0x34fbd3){return db[_0xc50d('0x46')]['find']({'where':{'id':_0xa9104b[_0xc50d('0x4e')]['id']}})[_0xc50d('0x2a')](handleEntityNotFound(_0x34fbd3,null))[_0xc50d('0x2a')](removeEntity(_0x34fbd3,null))[_0xc50d('0x48')](handleError(_0x34fbd3,null));};exports[_0xc50d('0x5c')]=function(_0x5ad5ac,_0x2c0667){return db[_0xc50d('0x46')]['describe']()[_0xc50d('0x2a')](respondWithResult(_0x2c0667,null))[_0xc50d('0x48')](handleError(_0x2c0667,null));};exports[_0xc50d('0x5d')]=function(_0x41206d,_0x2c0e31){var _0x42a8f6=_0x41206d[_0xc50d('0x52')];return db[_0xc50d('0x46')][_0xc50d('0x4b')]({'where':{'id':_0x41206d[_0xc50d('0x4e')]['id']}})[_0xc50d('0x2a')](handleEntityNotFound(_0x2c0e31,null))['then'](function(_0x1484d9){if(_0x1484d9){return db[_0xc50d('0x54')][_0xc50d('0x55')](function(_0x7e66f9){return db['UserProfileSection'][_0xc50d('0x2b')]({'where':{'userProfileId':_0x41206d[_0xc50d('0x4e')]['id'],'sectionId':_[_0xc50d('0x2e')](_0x42a8f6,function(_0x1590d0){return _0x1590d0[_0xc50d('0x5a')];})},'transaction':_0x7e66f9})[_0xc50d('0x2a')](function(){var _0x2f73fc=_[_0xc50d('0x2e')](_0x42a8f6,function(_0x430ddb){_0x430ddb['userProfileId']=_0x41206d['params']['id'];return _0x430ddb;});var _0xee964f=[];return BPromise['each'](_0x2f73fc,function(_0x1099a1){return db['UserProfileSection']['create'](_0x1099a1,{'include':[{'model':db[_0xc50d('0x58')],'as':_0xc50d('0x5b')}],'raw':!![],'transaction':_0x7e66f9})[_0xc50d('0x2a')](function(_0x3b37ba){_0xee964f[_0xc50d('0x5e')](_0x3b37ba[_0xc50d('0x4f')]({'plain':!![]}));});})['then'](function(){return _0xee964f;});});});}})[_0xc50d('0x2a')](function(_0x2f3c15){return _0x2f3c15;})[_0xc50d('0x2a')](respondWithResult(_0x2c0e31,null))[_0xc50d('0x48')](handleError(_0x2c0e31,null));};exports['removeSections']=function(_0x50d56a,_0x4c86cd){var _0x5a6ff5;return db[_0xc50d('0x46')][_0xc50d('0x4b')]({'where':{'id':_0x50d56a[_0xc50d('0x4e')]['id']},'attributes':['id',_0xc50d('0x2d')]})[_0xc50d('0x2a')](handleEntityNotFound(_0x4c86cd,null))[_0xc50d('0x2a')](function(_0x26cd66){if(_0x26cd66){_0x5a6ff5=_0x26cd66;return db[_0xc50d('0x56')][_0xc50d('0x2b')]({'where':{'userProfileId':_0x50d56a[_0xc50d('0x4e')]['id'],'sectionId':_0x50d56a[_0xc50d('0x34')][_0xc50d('0x5f')]}});}})[_0xc50d('0x2a')](function(){return _0x5a6ff5;})[_0xc50d('0x2a')](respondWithStatusCode(_0x4c86cd,null))['catch'](handleError(_0x4c86cd,null));};exports[_0xc50d('0x60')]=function(_0x509ab3,_0x228b8f){var _0x4fb1d8=[];var _0x3a66e8=[];return db['UserProfileSection'][_0xc50d('0x59')]({'where':{'userProfileId':_0x509ab3[_0xc50d('0x4e')]['id']},'raw':!![]})[_0xc50d('0x2a')](function(_0x213f52){_0x4fb1d8=_[_0xc50d('0x43')](_0x213f52,function(_0x4bc2d3){return _0x4bc2d3[_0xc50d('0x61')]===0x1||_[_0xc50d('0x62')]([0x3eb,0x709],_0x4bc2d3[_0xc50d('0x5a')]);});if(!_[_0xc50d('0x63')](_0x4fb1d8)){return _[_0xc50d('0x2e')](_0x4fb1d8,function(_0x249b19){return _0x249b19[_0xc50d('0x5a')];});}else{return;}})[_0xc50d('0x2a')](function(_0x3d6ba6){if(_0x3d6ba6)_0x3a66e8=_0x3d6ba6;if(_[_0xc50d('0x62')](_0x3a66e8,0x64)){var _0x52ee67=_[_0xc50d('0x4b')](_0x4fb1d8,{'sectionId':0x64});return hasDefaultDashboard(_0x52ee67)['then'](function(_0x437f3e){return _['map'](_0x4fb1d8,function(_0x55cf59){if(_0x55cf59[_0xc50d('0x5a')]===0x64){_0x55cf59[_0xc50d('0x64')]=_0x437f3e;}return _0x55cf59;});});}else{return;}})['then'](function(_0x488223){if(_0x488223)_0x4fb1d8=_0x488223;if(_[_0xc50d('0x62')](_0x3a66e8,0x3eb)){var _0x124bf7=_[_0xc50d('0x4b')](_0x4fb1d8,{'sectionId':0x3eb});return getCustomDashboards(_0x124bf7)[_0xc50d('0x2a')](function(_0xd7feb4){return _[_0xc50d('0x2e')](_0x4fb1d8,function(_0x4a847e){if(_0x124bf7[_0xc50d('0x61')]){if(_0x4a847e[_0xc50d('0x5a')]===0x3eb){_0x4a847e[_0xc50d('0x64')]=_0xd7feb4;}}else{if(_0x4a847e['sectionId']===0x64){if(!_0x4a847e[_0xc50d('0x64')]){_0x4a847e[_0xc50d('0x64')]=[];}_0x4a847e[_0xc50d('0x64')]=_0x4a847e[_0xc50d('0x64')][_0xc50d('0x65')](_0xd7feb4);}}return _0x4a847e;});});}else{return;}})[_0xc50d('0x2a')](function(_0x10cbce){if(_0x10cbce)_0x4fb1d8=_0x10cbce;if(_[_0xc50d('0x62')](_0x3a66e8,0x709)){var _0x2662e8=_['find'](_0x4fb1d8,{'sectionId':0x709});return getPlugins(_0x2662e8)[_0xc50d('0x2a')](function(_0x4ce7de){if(_0x2662e8[_0xc50d('0x61')]){return _[_0xc50d('0x2e')](_0x4fb1d8,function(_0x563aff){if(_0x563aff[_0xc50d('0x5a')]===0x709){_0x563aff[_0xc50d('0x64')]=_0x4ce7de;}return _0x563aff;});}else{var _0x15d5ca={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4ce7de};var _0x10fad1=_[_0xc50d('0x2e')](_0x4fb1d8);_0x10fad1['push'](_0x15d5ca);return _0x10fad1;}});}else{return;}})[_0xc50d('0x2a')](function(_0x2e5cdd){if(_0x2e5cdd)_0x4fb1d8=_0x2e5cdd;return _[_0xc50d('0x43')](_0x4fb1d8,[_0xc50d('0x61'),0x1]);})[_0xc50d('0x2a')](respondWithResult(_0x228b8f,null))[_0xc50d('0x48')](handleError(_0x228b8f,null));};function hasDefaultDashboard(_0x264d7e){var _0x2f97a8=[0x65];return new BPromise(function(_0x384e86,_0x279303){try{if(_0x264d7e[_0xc50d('0x57')]){_0x384e86(_0x2f97a8);}else{return db[_0xc50d('0x58')][_0xc50d('0x66')]({'where':{'sectionId':_0x264d7e['id']},'raw':!![]})[_0xc50d('0x2a')](function(_0x52a022){_0x52a022?_0x384e86(_0x2f97a8):_0x384e86();});}}catch(_0x5ecf0a){_0x279303(_0x5ecf0a);}});}function getCustomDashboards(_0x4c4007){var _0xbad03b=[];return new BPromise(function(_0x1db998,_0x515cb9){try{if(_0x4c4007[_0xc50d('0x57')]){return db[_0xc50d('0x67')]['findAll']({'raw':!![]})['then'](function(_0x209e07){_0x209e07[_0xc50d('0x68')](function(_0x1c43d4){_0xbad03b[_0xc50d('0x5e')](_0x1c43d4['id']+0x1869f);});_0x1db998(_0xbad03b);});}else{return db[_0xc50d('0x58')][_0xc50d('0x59')]({'where':{'sectionId':_0x4c4007['id']},'raw':!![]})[_0xc50d('0x2a')](function(_0xacc96a){_0xacc96a['forEach'](function(_0x39fef8){_0xbad03b[_0xc50d('0x5e')](_0x39fef8[_0xc50d('0x69')]+0x1869f);});_0x1db998(_0xbad03b);});}}catch(_0x558553){_0x515cb9(_0x558553);}});}function getPlugins(_0x325021){var _0x183425=[];return new BPromise(function(_0x426874,_0xa2fb02){try{if(_0x325021['autoAssociation']){return db[_0xc50d('0x6a')][_0xc50d('0x59')]({'raw':!![]})[_0xc50d('0x2a')](function(_0x3b0e61){_0x3b0e61[_0xc50d('0x68')](function(_0x59e960){_0x183425[_0xc50d('0x5e')](_0x59e960['id']+0x15b38);});_0x426874(_0x183425);});}else{return db[_0xc50d('0x58')]['findAll']({'where':{'sectionId':_0x325021['id']},'raw':!![]})[_0xc50d('0x2a')](function(_0x5701ac){_0x5701ac[_0xc50d('0x68')](function(_0x57be56){_0x183425[_0xc50d('0x5e')](_0x57be56['resourceId']+0x15b38);});_0x426874(_0x183425);});}}catch(_0x1b8ec5){_0xa2fb02(_0x1b8ec5);}});}exports[_0xc50d('0x6b')]=function(_0x306c38,_0x2763c7){return db[_0xc50d('0x46')][_0xc50d('0x4b')]({'where':{'id':_0x306c38[_0xc50d('0x4e')]['id']}})[_0xc50d('0x2a')](handleEntityNotFound(_0x2763c7,null))['then'](function(_0x5e66b8){if(_0x5e66b8){return db[_0xc50d('0x54')]['transaction'](function(_0x2f58bb){return db[_0xc50d('0x56')][_0xc50d('0x59')]({'where':{'userProfileId':_0x306c38[_0xc50d('0x4e')]['id']},'attributes':['id'],'raw':!![]})[_0xc50d('0x2a')](function(_0x3c026f){if(_0x3c026f){return db[_0xc50d('0x56')][_0xc50d('0x2b')]({'where':{'userProfileId':_0x306c38['params']['id'],'id':_[_0xc50d('0x2e')](_0x3c026f,function(_0x35963e){return _0x35963e['id'];})},'transaction':_0x2f58bb});}})['then'](function(_0x33ab9d){var _0x4b1693=_[_0xc50d('0x2e')](_0x306c38['body'],function(_0x57fc2c){_0x57fc2c[_0xc50d('0x6c')]=_0x306c38[_0xc50d('0x4e')]['id'];return _0x57fc2c;});return db[_0xc50d('0x56')][_0xc50d('0x6d')](_0x4b1693,{'raw':!![],'transaction':_0x2f58bb});})[_0xc50d('0x2a')](function(_0x328eae){var _0x13da2a=_['filter'](_[_0xc50d('0x2e')](_0x328eae,function(_0x9accd7){return _0x9accd7[_0xc50d('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x13da2a){return db[_0xc50d('0x56')][_0xc50d('0x59')]({'where':{'userProfileId':_0x306c38[_0xc50d('0x4e')]['id'],'sectionId':_['map'](_0x13da2a,function(_0x6c67b6){return _0x6c67b6['sectionId'];})},'attributes':['id',_0xc50d('0x5a')],'raw':!![]})['then'](function(_0x31c759){var _0x15ce13=_['map'](_0x306c38['body'],function(_0x1df6fb){_0x1df6fb[_0xc50d('0x6c')]=_0x306c38[_0xc50d('0x4e')]['id'];return _0x1df6fb;});return db[_0xc50d('0x58')][_0xc50d('0x6d')](_0x15ce13,{'raw':!![],'transaction':_0x2f58bb});});}})[_0xc50d('0x48')](handleError(_0x2763c7,null));});}})['then'](function(_0x26a0a5){var _0x12bb4a=_['map'](_0x26a0a5,function(_0x32e31a){return _0x32e31a[_0xc50d('0x4f')]({'plain':!![]});});})[_0xc50d('0x2a')](respondWithResult(_0x2763c7,null))['catch'](handleError(_0x2763c7,null));};exports[_0xc50d('0x6e')]=function(_0x343f4a,_0x4aece5,_0x5953fe){return db[_0xc50d('0x46')][_0xc50d('0x4b')]({'where':{'id':_0x343f4a[_0xc50d('0x4e')]['id']}})[_0xc50d('0x2a')](handleEntityNotFound(_0x4aece5,null))[_0xc50d('0x2a')](function(_0x57ea6c){if(_0x57ea6c){return _0x57ea6c[_0xc50d('0x6e')](_0x343f4a[_0xc50d('0x34')]['ids']);}})[_0xc50d('0x2a')](respondWithStatusCode(_0x4aece5,null))['catch'](handleError(_0x4aece5,null));};exports['getResources']=function(_0x1e2ab7,_0x17021e){var _0x4a1881={};if(!_0x1e2ab7[_0xc50d('0x34')]['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x1e2ab7[_0xc50d('0x34')][_0xc50d('0x3b')](_0xc50d('0x3c'))){_0x4a1881[_0xc50d('0x21')]=qs[_0xc50d('0x21')](_0x1e2ab7['query'][_0xc50d('0x21')]);_0x4a1881[_0xc50d('0x20')]=qs['offset'](_0x1e2ab7[_0xc50d('0x34')][_0xc50d('0x20')]);}return db[_0xc50d('0x46')][_0xc50d('0x4b')]({'where':{'id':_0x1e2ab7[_0xc50d('0x4e')]['id']}})['then'](function(_0x31a1fa){if(!_0x31a1fa)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x1e2ab7['params']['id']);return db[_0xc50d('0x46')][_0xc50d('0x6f')](_0x1e2ab7);})[_0xc50d('0x2a')](respondWithFilteredResult(_0x17021e,_0x4a1881))[_0xc50d('0x48')](handleError(_0x17021e,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 5710a24..21a03f5 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 _0xa6b0=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x13e6b7,_0x1df3ec){_0x13e6b7=_0x13e6b7-0x0;var _0x4dfd65=_0xa6b0[_0x13e6b7];return _0x4dfd65;};'use strict';var EventEmitter=require(_0x0a6b('0x0'));var UserProfile=require(_0x0a6b('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0a6b('0x2'),'afterUpdate':_0x0a6b('0x3'),'afterDestroy':_0x0a6b('0x4')};function emitEvent(_0x4c9a84){return function(_0x29ff80,_0x33e8c3,_0x195697){UserProfileEvents[_0x0a6b('0x5')](_0x4c9a84+':'+_0x29ff80['id'],_0x29ff80);UserProfileEvents[_0x0a6b('0x5')](_0x4c9a84,_0x29ff80);_0x195697(null);};}for(var e in events){if(events[_0x0a6b('0x6')](e)){var event=events[e];UserProfile[_0x0a6b('0x7')](e,emitEvent(event));}}module[_0x0a6b('0x8')]=UserProfileEvents; \ No newline at end of file +var _0xe1d7=['update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x11012c,_0x1b5409){var _0x49e792=function(_0x505fa1){while(--_0x505fa1){_0x11012c['push'](_0x11012c['shift']());}};_0x49e792(++_0x1b5409);}(_0xe1d7,0x1a9));var _0x7e1d=function(_0x5c1911,_0x5063d9){_0x5c1911=_0x5c1911-0x0;var _0x360290=_0xe1d7[_0x5c1911];return _0x360290;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x7e1d('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7e1d('0x1'),'afterDestroy':_0x7e1d('0x2')};function emitEvent(_0x416747){return function(_0x57e913,_0x347f78,_0x882bec){UserProfileEvents[_0x7e1d('0x3')](_0x416747+':'+_0x57e913['id'],_0x57e913);UserProfileEvents[_0x7e1d('0x3')](_0x416747,_0x57e913);_0x882bec(null);};}for(var e in events){if(events[_0x7e1d('0x4')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x7e1d('0x5')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index d9810b3..6dc2815 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 _0x7916=['variables','Variable','plugins','extractedreports','Reports','charAt','toUpperCase','slice','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','UserProfile','user_profiles','../../components/parsers/qs','raw','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','limit','offset','sort','filters','merge','key','foreignKey','forEach','options','autoAssociation','includeAll','reportType','default','reportId','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','order','extraQueryConditions','include','color','tag','ThroughTags','openTabs','chat','dataValues','sms','fax','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','findAll','then','associatedResources','model','map','name','catch','resolve','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','ListId','lists','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceRecording','parentSections','Agents','membername','User','agent','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','whatsappaccounts','teams','Team','queuecampaigns','users','telephones','Users','role','admin','Telephones','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','Tag','templates','Trigger','trunks','Trunk'];(function(_0x191cbb,_0x1059d6){var _0x30424f=function(_0xf37787){while(--_0xf37787){_0x191cbb['push'](_0x191cbb['shift']());}};_0x30424f(++_0x1059d6);}(_0x7916,0x101));var _0x6791=function(_0x5b295c,_0x312ce7){_0x5b295c=_0x5b295c-0x0;var _0x3d9f4d=_0x7916[_0x5b295c];return _0x3d9f4d;};'use strict';var _=require(_0x6791('0x0'));var attributes=require(_0x6791('0x1'));var squel=require(_0x6791('0x2'));module[_0x6791('0x3')]=function(_0xa0148f){var _0x33416a=_0xa0148f[_0x6791('0x4')];function _0x188a7e(_0x43c3ff,_0x39ea5f){return new Promise(function(_0x381c84,_0x571d3e){if(!_0x39ea5f)return _0x381c84(null);var _0x19c90d=_0x39ea5f[_0x6791('0x5')]?{[_0x39ea5f[_0x6791('0x5')][_0x6791('0x6')]]:_0x39ea5f[_0x6791('0x5')][_0x6791('0x7')]}:undefined;return _0x33416a[_0x43c3ff][_0x6791('0x8')]({'where':_0x19c90d,'raw':!![]})[_0x6791('0x9')](function(_0x42fbd0){_0x39ea5f[_0x6791('0xa')]=_['map'](_0x42fbd0,'id');_0x381c84(_0x39ea5f);})['catch'](function(_0x814b63){_0x571d3e(_0x814b63);});});}function _0x422574(_0x4614e0,_0x4d65b4){return new Promise(function(_0x46e8f5,_0x53e7ad){var _0xf6e5d1=_0x4614e0[_0x6791('0x5')]?{[_0x4614e0['filter'][_0x6791('0x6')]]:_0x4614e0[_0x6791('0x5')][_0x6791('0x7')]}:undefined;return _0x33416a[_0x4614e0[_0x6791('0xb')]]['findAll']({'where':_0xf6e5d1,'raw':!![]})['then'](function(_0xd4918a){_0x4d65b4[_0x6791('0xa')]=_[_0x6791('0xc')](_0xd4918a,function(_0x5b53c2){return _0x5b53c2[_0x6791('0xd')];});_0x46e8f5(_0x4d65b4);})[_0x6791('0xe')](function(_0x3f5888){_0x53e7ad(_0x3f5888);});});}function _0x2544d1(_0x8b23bb,_0x467ef5,_0x133fdc){if(!_0x467ef5)return Promise[_0x6791('0xf')](null);return new Promise(function(_0x2838f9,_0x3908d9){return _0x33416a['UserProfileResource']['findAll']({'where':{'sectionId':_0x467ef5['id']},'raw':!![]})['then'](function(_0x189314){if(_0x8b23bb[_0x6791('0x6')]&&_0x8b23bb[_0x6791('0x6')]!=='id'){_0x467ef5['associatedResources']=_[_0x6791('0xc')](_0x189314,function(_0x33b24f){return _0x33b24f[_0x8b23bb[_0x6791('0x6')]];});}else{if(_0x133fdc===_0x6791('0x10')){_0x467ef5['associatedResources']=_[_0x6791('0xc')](_0x189314,function(_0x4bbe08){return{'id':_0x4bbe08[_0x6791('0x11')],'type':_0x4bbe08[_0x6791('0x12')]};});}else{_0x467ef5[_0x6791('0xa')]=_[_0x6791('0xc')](_0x189314,function(_0x380ad9){return _0x380ad9['resourceId'];});}}_0x2838f9(_0x467ef5);})[_0x6791('0xe')](function(_0x3628b6){_0x3908d9(_0x3628b6);});});}function _0xacd4da(_0xbb50f2,_0xd0fb9a){var _0x1c3f9c={'parentSections':[]};switch(_0xbb50f2[_0x6791('0x13')]()){case _0x6791('0x14'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x16');break;case _0x6791('0x17'):_0x1c3f9c[_0x6791('0x15')]='SquareOdbc';break;case'squarerecordings':_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x18');_0x1c3f9c['parentSections']=[{'name':_0x6791('0x19'),'field':_0x6791('0xd'),'foreignKey':_0x6791('0x1a')}];break;case _0x6791('0x1b'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x1c');break;case _0x6791('0x1d'):_0x1c3f9c['childModel']=_0x6791('0x1e');_0x1c3f9c['parentSections']=[{'name':'Lists','field':'id','foreignKey':_0x6791('0x1f')}];break;case _0x6791('0x20'):_0x1c3f9c[_0x6791('0x15')]='CmList';break;case _0x6791('0x21'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x22');break;case _0x6791('0x23'):_0x1c3f9c['childModel']=_0x6791('0x24');break;case _0x6791('0x25'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x26');break;case'chatwebsites':_0x1c3f9c['childModel']=_0x6791('0x27');break;case _0x6791('0x28'):_0x1c3f9c[_0x6791('0x15')]='FaxQueue';break;case'faxaccounts':_0x1c3f9c[_0x6791('0x15')]='FaxAccount';break;case _0x6791('0x29'):case _0x6791('0x2a'):case _0x6791('0x2b'):_0x1c3f9c['childModel']=_0x6791('0x2c');break;case _0x6791('0x2d'):_0x1c3f9c['childModel']=_0x6791('0x2e');break;case'voicemails':_0x1c3f9c[_0x6791('0x15')]='VoiceMail';break;case'voicerecordings':_0x1c3f9c['childModel']=_0x6791('0x2f');_0x1c3f9c[_0x6791('0x30')]=[{'name':_0x6791('0x31'),'field':'name','foreignKey':_0x6791('0x32'),'model':_0x6791('0x33'),'filter':{'field':'role','value':[_0x6791('0x34')]}},{'name':'Telephones','field':_0x6791('0xd'),'foreignKey':_0x6791('0x32'),'model':_0x6791('0x33'),'filter':{'field':'role','value':['telephone']}},{'name':_0x6791('0x35'),'field':_0x6791('0xd'),'foreignKey':_0x6791('0x36'),'model':_0x6791('0x37'),'filter':{'field':_0x6791('0x12'),'value':[_0x6791('0x38')]}},{'name':_0x6791('0x39'),'field':'name','foreignKey':_0x6791('0x36'),'model':'VoiceQueue','filter':{'field':_0x6791('0x12'),'value':[_0x6791('0x3a')]}}];break;case'musiconholds':_0x1c3f9c[_0x6791('0x15')]='VoiceMusicOnHold';break;case _0x6791('0x3b'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x3c');break;case _0x6791('0x3d'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x3e');break;case'ivrcampaigns':_0x1c3f9c['childModel']='Campaign';break;case _0x6791('0x3f'):_0x1c3f9c[_0x6791('0x15')]='MailQueue';break;case _0x6791('0x40'):_0x1c3f9c['childModel']=_0x6791('0x41');break;case _0x6791('0x42'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x43');break;case _0x6791('0x44'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x45');break;case _0x6791('0x46'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x47');break;case _0x6791('0x48'):_0x1c3f9c['childModel']=_0x6791('0x49');break;case _0x6791('0x4a'):_0x1c3f9c[_0x6791('0x15')]='SmsAccount';break;case'whatsappqueues':_0x1c3f9c[_0x6791('0x15')]='WhatsappQueue';break;case _0x6791('0x4b'):_0x1c3f9c[_0x6791('0x15')]='WhatsappAccount';break;case _0x6791('0x4c'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x4d');break;case'voicequeues':case _0x6791('0x4e'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x37');if(_0xd0fb9a){_0x1c3f9c[_0x6791('0x30')]=[{'name':_0x6791('0x35')},{'name':_0x6791('0x39')}];}break;case _0x6791('0x4f'):case'agents':case _0x6791('0x50'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x33');if(_0xd0fb9a){_0x1c3f9c[_0x6791('0x30')]=[{'name':_0x6791('0x51'),'filter':{'field':_0x6791('0x52'),'value':[_0x6791('0x53'),'user']},'ignore':!![]},{'name':_0x6791('0x31')},{'name':_0x6791('0x54')}];}break;case _0x6791('0x55'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x56');break;case'salesforceaccounts':_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x57');break;case _0x6791('0x58'):_0x1c3f9c[_0x6791('0x15')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x1c3f9c[_0x6791('0x15')]='SugarcrmAccount';break;case'deskaccounts':_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x59');break;case'zohoaccounts':_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x5a');break;case _0x6791('0x5b'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x33');break;case _0x6791('0x5c'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x5d');break;case _0x6791('0x5e'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x5f');break;case _0x6791('0x60'):_0x1c3f9c[_0x6791('0x15')]='Dashboard';break;case _0x6791('0x61'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x62');break;case _0x6791('0x63'):_0x1c3f9c[_0x6791('0x15')]='Pause';break;case _0x6791('0x64'):_0x1c3f9c['childModel']=_0x6791('0x65');break;case _0x6791('0x66'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x67');break;case'tags':_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x68');break;case _0x6791('0x69'):_0x1c3f9c[_0x6791('0x15')]='Template';break;case'triggers':_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x6a');break;case _0x6791('0x6b'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x6c');break;case _0x6791('0x6d'):_0x1c3f9c[_0x6791('0x15')]=_0x6791('0x6e');break;case _0x6791('0x6f'):_0x1c3f9c[_0x6791('0x15')]='Plugin';break;case _0x6791('0x70'):_0x1c3f9c[_0x6791('0x15')]='AnalyticExtractedReport';_0x1c3f9c[_0x6791('0x30')]=[{'name':_0x6791('0x71'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x1c3f9c[_0x6791('0x15')]='AnalyticMetric';break;}return _0x1c3f9c;}function _0x2d9d01(_0x12ad26,_0x4f256b){var _0x11943e=_0x12ad26[_0x6791('0x72')](0x0)[_0x6791('0x73')]()+_0x12ad26[_0x6791('0x74')](0x1);var _0x5bb99f={'type':_0x33416a['Sequelize'][_0x6791('0x75')][_0x6791('0x76')],'raw':!![]};return new Promise(function(_0x2f9038,_0x4790b8){var _0x105b53=squel['select']()[_0x6791('0x6')](_0x6791('0x77')+_0x11943e+_0x6791('0x78'),'id')['field'](_0x6791('0x79'))[_0x6791('0x7a')](_0x6791('0x7b')+_0x12ad26+_0x6791('0x7c'),'ui')[_0x6791('0x7d')]('ui.UserId\x20=\x20?',_0x4f256b['id']);return _0x33416a[_0x6791('0x7e')][_0x6791('0x7f')](_0x105b53[_0x6791('0x80')](),_0x5bb99f)[_0x6791('0x9')](function(_0x36aa61){_0x4f256b[_0x11943e+_0x6791('0x81')]=_0x36aa61;_0x2f9038(_0x36aa61);})[_0x6791('0xe')](function(_0xa790bd){_0x4790b8(_0xa790bd);});});}return _0xa0148f['define'](_0x6791('0x82'),attributes,{'tableName':_0x6791('0x83'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x343f7c){var _0x325412=require(_0x6791('0x84'));var _0xe997cf={'raw':_0x343f7c['query'][_0x6791('0x85')],'where':{}};var _0x2f416d={};var _0x8e5bc1={'count':0x0,'rows':[]};var _0x2c2c4a=_0x343f7c['query']['section'];var _0x1fe04b=_0x343f7c[_0x6791('0x7f')]['mergeResources']||![];var _0x521797=_0xacd4da(_0x2c2c4a,_0x1fe04b);if(!_0x521797[_0x6791('0x15')])throw new Error(_0x6791('0x86')+_0x2c2c4a+'\x27');var _0x3a0744=[{'name':_0x2c2c4a}];if(!_[_0x6791('0x87')](_0x521797['parentSections']))_0x3a0744=_0x521797[_0x6791('0x30')];var _0xa08158=[];for(var _0x588b37=0x0;_0x588b37<_0x3a0744[_0x6791('0x88')];_0x588b37++){_0xa08158[_0x6791('0x89')](_0x33416a[_0x6791('0x8a')][_0x6791('0x8b')]({'where':{'userProfileId':_0x343f7c[_0x6791('0x8c')]['id'],'name':_0x3a0744[_0x588b37][_0x6791('0xd')]},'raw':!![]}));}return Promise[_0x6791('0x8d')](_0xa08158)[_0x6791('0x9')](function(_0x3ad3f5){var _0x3ce026=_['filter'](_0x3ad3f5,function(_0x9babc5){return _0x9babc5?_0x9babc5:undefined;});var _0x2546ab=_[_0x6791('0x5')](_0x3a0744,[_0x6791('0x8e'),!![]]);var _0x301f85=_['isEmpty'](_0x3ce026)&&_[_0x6791('0x87')](_0x2546ab)?null:_[_0x6791('0x8f')](_0x2546ab,_0x3ce026);if(!_0x301f85)return null;var _0x3bb505=[];for(var _0x261145=0x0;_0x261145<_0x301f85[_0x6791('0x88')];_0x261145++){var _0xa1d8fa=_['find'](_0x3a0744,function(_0x15190f){return _0x301f85[_0x261145]?_0x15190f[_0x6791('0xd')]===_0x301f85[_0x261145]['name']:null;});if(_0xa1d8fa){if(_0x301f85[_0x261145][_0x6791('0x8e')]){_0x3bb505['push'](_0x188a7e(_0x521797['childModel'],_0x301f85[_0x261145]));}else{if(!_0x301f85[_0x261145]['autoAssociation']){_0x3bb505[_0x6791('0x89')](_0x2544d1(_0xa1d8fa,_0x301f85[_0x261145],_0x521797['childModel']));}else{if(_0xa1d8fa['model']){_0x3bb505['push'](_0x422574(_0xa1d8fa,_0x301f85[_0x261145]));}}}}}return Promise[_0x6791('0x8d')](_0x3bb505);})[_0x6791('0x9')](function(_0xa2f352){var _0x3deec7=_0xa2f352;var _0x4b531b=null;if(_0x3deec7){_0x4b531b=_0x3deec7[_0x6791('0x88')]===0x1?_0x3deec7[0x0]:null;}if(!_0x4b531b&&!_0x3deec7)return _0x8e5bc1;var _0x1a227b=_0x33416a[_0x521797[_0x6791('0x15')]][_0x6791('0x90')];_0x2f416d[_0x6791('0xb')]=_[_0x6791('0x91')](_0x1a227b);_0x2f416d[_0x6791('0x7f')]=_[_0x6791('0x91')](_0x343f7c['query']);_0x2f416d['filters']=_[_0x6791('0x92')](_0x2f416d[_0x6791('0xb')],_0x2f416d[_0x6791('0x7f')]);_0xe997cf[_0x6791('0x93')]=_[_0x6791('0x92')](_0x2f416d['model'],_0x325412[_0x6791('0x94')](_0x343f7c[_0x6791('0x7f')]['fields']));_0xe997cf[_0x6791('0x93')]=_0xe997cf['attributes'][_0x6791('0x88')]?_0xe997cf[_0x6791('0x93')]:_0x2f416d[_0x6791('0xb')];if(!_0x343f7c['query'][_0x6791('0x95')]('nolimit')){_0xe997cf[_0x6791('0x96')]=_0x325412[_0x6791('0x96')](_0x343f7c[_0x6791('0x7f')][_0x6791('0x96')]);_0xe997cf[_0x6791('0x97')]=_0x325412[_0x6791('0x97')](_0x343f7c['query'][_0x6791('0x97')]);}_0xe997cf['order']=_0x325412[_0x6791('0x98')](_0x343f7c[_0x6791('0x7f')][_0x6791('0x98')]);_0xe997cf[_0x6791('0x7d')]=_0x325412[_0x6791('0x99')](_['pick'](_0x343f7c['query'],_0x2f416d[_0x6791('0x99')]));if(_0x343f7c[_0x6791('0x7f')][_0x6791('0x5')]){_0xe997cf[_0x6791('0x7d')]=_[_0x6791('0x9a')](_0xe997cf[_0x6791('0x7d')],{'$or':_[_0x6791('0xc')](_0x1a227b,function(_0x1d7957){if(_0x1d7957[_0x6791('0x12')][_0x6791('0x9b')]!=='VIRTUAL'){var _0x1d8dde={};_0x1d8dde[_0x1d7957[_0x6791('0x6')]]={'$like':'%'+_0x343f7c['query'][_0x6791('0x5')]+'%'};return _0x1d8dde;}})});}var _0x344784=[];var _0x2984ef=null;var _0x4b3be0={};if(_0x4b531b){_0x2984ef=_[_0x6791('0x8b')](_0x3a0744,[_0x6791('0xd'),_0x4b531b[_0x6791('0xd')]]);if(_0x2984ef[_0x6791('0x6')]){_0x4b3be0={};if(_0x521797[_0x6791('0x15')]===_0x6791('0x10')){_0x4b3be0[_0x2984ef[_0x6791('0x9c')]]=_[_0x6791('0xc')](_0x4b531b[_0x6791('0xa')],'id');}else{_0x4b3be0[_0x2984ef[_0x6791('0x9c')]]=_0x4b531b['associatedResources'];}_0x344784[_0x6791('0x89')](_0x4b3be0);}else{_0xe997cf[_0x6791('0x7d')]['id']=_0x4b531b[_0x6791('0xa')];}}else{for(var _0x401eec=0x0;_0x401eec<_0x3deec7[_0x6791('0x88')];_0x401eec++){_0x2984ef=_['find'](_0x3a0744,['name',_0x3deec7[_0x401eec][_0x6791('0xd')]]);if(_0x2984ef[_0x6791('0x6')]){_0x4b3be0={};_0x4b3be0[_0x2984ef['foreignKey']]=_0x3deec7[_0x401eec]['associatedResources'];_0x344784[_0x6791('0x89')](_0x4b3be0);}else{if(!_0xe997cf[_0x6791('0x7d')]['id'])_0xe997cf[_0x6791('0x7d')]['id']=[];_0x3deec7[_0x401eec]['associatedResources'][_0x6791('0x9d')](function(_0x32a33e){_0xe997cf[_0x6791('0x7d')]['id'][_0x6791('0x89')](_0x32a33e);});}}}if(!_[_0x6791('0x87')](_0x344784)){_0xe997cf[_0x6791('0x7d')]=_[_0x6791('0x9a')](_0xe997cf[_0x6791('0x7d')],{'$and':{'$or':_0x344784}});}_0xe997cf=_[_0x6791('0x9a')]({},_0xe997cf,_0x343f7c[_0x6791('0x9e')]);if(_0x4b531b&&!_0x4b531b[_0x6791('0x9f')]&&_0x521797['childModel']===_0x6791('0x10')){if(_0x343f7c[_0x6791('0x7f')][_0x6791('0xa0')]){_0xe997cf['include']=[{'all':!![]}];}return _0x33416a[_0x521797['childModel']][_0x6791('0x8')](_0xe997cf)[_0x6791('0x9')](function(_0x37a387){var _0xea783b=[];_0x37a387[_0x6791('0x9d')](function(_0x344d1a){var _0x367181;switch(_0x344d1a[_0x6791('0xa1')]){case _0x6791('0xa2'):_0x367181=_[_0x6791('0x8b')](_0x4b531b['associatedResources'],function(_0x8f7cd8){return _0x8f7cd8['id']===_0x344d1a[_0x6791('0xa3')]&&_0x8f7cd8[_0x6791('0x12')]===_0x6791('0xa4');});break;case _0x6791('0xa5'):_0x367181=_[_0x6791('0x8b')](_0x4b531b[_0x6791('0xa')],function(_0x272133){return _0x272133['id']===_0x344d1a[_0x6791('0xa3')]&&_0x272133[_0x6791('0x12')]===_0x6791('0xa6');});break;}if(_0x367181)_0xea783b['push'](_0x344d1a);});_0x8e5bc1[_0x6791('0xa7')]=_0xea783b[_0x6791('0x88')];_0x8e5bc1[_0x6791('0xa8')]=_0xea783b;return _0x8e5bc1;});}else{if(!_['isEmpty'](_0x343f7c[_0x6791('0x7f')][_0x6791('0xa9')])){_0xe997cf['where']['id']=_0xe997cf[_0x6791('0x7d')]['id']?_[_0x6791('0x92')](_0xe997cf[_0x6791('0x7d')]['id'],_0x343f7c[_0x6791('0x7f')][_0x6791('0xa9')]):_0x343f7c['query'][_0x6791('0xa9')];if(_0x343f7c[_0x6791('0x7f')][_0x6791('0xaa')]){_0xe997cf[_0x6791('0xab')]=_0x343f7c[_0x6791('0x7f')][_0x6791('0xaa')];}}if(_0x343f7c[_0x6791('0x7f')][_0x6791('0xac')]){_0xe997cf[_0x6791('0x7d')]=_[_0x6791('0x9a')](_0xe997cf['where'],{'$and':_0x343f7c['query'][_0x6791('0xac')]});}return _0x33416a[_0x521797[_0x6791('0x15')]][_0x6791('0xa7')]({'where':_0xe997cf[_0x6791('0x7d')]})[_0x6791('0x9')](function(_0x4975e4){_0x8e5bc1[_0x6791('0xa7')]=_0x4975e4;if(_0x343f7c[_0x6791('0x7f')][_0x6791('0xa0')]){if(_0x521797[_0x6791('0x15')]===_0x6791('0x1e')){_0xe997cf[_0x6791('0xad')]=[{'model':_0x33416a['Tag'],'as':'Tags','attributes':['id',_0x6791('0xd'),_0x6791('0xae')],'required':_0x343f7c['query'][_0x6791('0xaf')]?!![]:![]},{'model':_0x33416a['Tag'],'as':_0x6791('0xb0'),'attributes':['id',_0x6791('0xd'),'color'],'through':_0x343f7c[_0x6791('0x7f')][_0x6791('0xaf')]?{'attributes':[],'where':{'TagId':_0x343f7c[_0x6791('0x7f')][_0x6791('0xaf')]||undefined}}:{},'required':_0x343f7c[_0x6791('0x7f')]['tag']?!![]:![]}];}else{_0xe997cf['include']=[{'all':!![]}];}}return _0x33416a[_0x521797['childModel']][_0x6791('0x8')](_0xe997cf);})[_0x6791('0x9')](function(_0x399828){_0x8e5bc1[_0x6791('0xa8')]=_0x399828;if(_0x2c2c4a===_0x6791('0x31')&&_0x343f7c['query'][_0x6791('0xb1')]==='true'){var _0x428de7=[];for(var _0x5abb12=0x0;_0x5abb12<_0x8e5bc1['rows'][_0x6791('0x88')];_0x5abb12++){_0x428de7['push'](_0x2d9d01(_0x6791('0xb2'),_0x8e5bc1[_0x6791('0xa8')][_0x5abb12][_0x6791('0xb3')]));_0x428de7[_0x6791('0x89')](_0x2d9d01(_0x6791('0xb4'),_0x8e5bc1['rows'][_0x5abb12][_0x6791('0xb3')]));_0x428de7[_0x6791('0x89')](_0x2d9d01(_0x6791('0xb5'),_0x8e5bc1['rows'][_0x5abb12][_0x6791('0xb3')]));_0x428de7[_0x6791('0x89')](_0x2d9d01('mail',_0x8e5bc1[_0x6791('0xa8')][_0x5abb12][_0x6791('0xb3')]));_0x428de7[_0x6791('0x89')](_0x2d9d01('openchannel',_0x8e5bc1['rows'][_0x5abb12][_0x6791('0xb3')]));_0x428de7['push'](_0x2d9d01(_0x6791('0xb6'),_0x8e5bc1[_0x6791('0xa8')][_0x5abb12][_0x6791('0xb3')]));}return Promise[_0x6791('0x8d')](_0x428de7)['then'](function(){return _0x8e5bc1;});}return _0x8e5bc1;});}});}}});}; \ No newline at end of file +var _0x03d8=['VIRTUAL','foreignKey','forEach','includeAll','reportType','default','custom','rows','ids','customSorting','extraQueryConditions','count','include','Tags','color','tag','ThroughTags','Agents','openTabs','true','chat','dataValues','sms','mail','openchannel','whatsapp','lodash','squel','exports','models','filter','field','value','findAll','then','map','model','name','catch','UserProfileResource','associatedResources','AnalyticExtractedReport','type','toLowerCase','childModel','SquareProject','squarerecordings','SquareRecording','SquareProjects','projectName','JscriptyProject','contacts','CmContact','parentSections','Lists','CmList','companies','CmCompany','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','User','role','Telephones','membername','VoiceQueues','queue','VoiceQueue','inbound','musiconholds','chanspies','VoiceChanSpy','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailSubstatus','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','QueueCampaigns','agents','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','sounds','Sound','Tag','Template','triggers','Trigger','trunks','Trunk','variables','plugins','extractedreports','Reports','reportId','AnalyticMetric','charAt','slice','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','define','UserProfile','user_profiles','../../components/parsers/qs','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','params','ignore','union','find','autoAssociation','all','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key'];(function(_0x16aca9,_0x5bd285){var _0x5b34ce=function(_0x13a2f6){while(--_0x13a2f6){_0x16aca9['push'](_0x16aca9['shift']());}};_0x5b34ce(++_0x5bd285);}(_0x03d8,0xd9));var _0x803d=function(_0xa1cf84,_0x308f81){_0xa1cf84=_0xa1cf84-0x0;var _0x32f05a=_0x03d8[_0xa1cf84];return _0x32f05a;};'use strict';var _=require(_0x803d('0x0'));var attributes=require('./userProfile.attributes');var squel=require(_0x803d('0x1'));module[_0x803d('0x2')]=function(_0x2cf628){var _0x45c252=_0x2cf628[_0x803d('0x3')];function _0x25767f(_0x276d76,_0xf583b3){return new Promise(function(_0x45ce03,_0x4f1b21){if(!_0xf583b3)return _0x45ce03(null);var _0x26d755=_0xf583b3[_0x803d('0x4')]?{[_0xf583b3[_0x803d('0x4')][_0x803d('0x5')]]:_0xf583b3[_0x803d('0x4')][_0x803d('0x6')]}:undefined;return _0x45c252[_0x276d76][_0x803d('0x7')]({'where':_0x26d755,'raw':!![]})[_0x803d('0x8')](function(_0x38ba90){_0xf583b3['associatedResources']=_[_0x803d('0x9')](_0x38ba90,'id');_0x45ce03(_0xf583b3);})['catch'](function(_0xfc8850){_0x4f1b21(_0xfc8850);});});}function _0x34466f(_0xfd09ea,_0x4f9ee1){return new Promise(function(_0x745190,_0x7d554b){var _0x2b4ec0=_0xfd09ea['filter']?{[_0xfd09ea['filter'][_0x803d('0x5')]]:_0xfd09ea['filter'][_0x803d('0x6')]}:undefined;return _0x45c252[_0xfd09ea[_0x803d('0xa')]][_0x803d('0x7')]({'where':_0x2b4ec0,'raw':!![]})[_0x803d('0x8')](function(_0x492326){_0x4f9ee1['associatedResources']=_[_0x803d('0x9')](_0x492326,function(_0x4bd4e7){return _0x4bd4e7[_0x803d('0xb')];});_0x745190(_0x4f9ee1);})[_0x803d('0xc')](function(_0x597ec8){_0x7d554b(_0x597ec8);});});}function _0x14fa0b(_0x36a59a,_0x30766e,_0x29909d){if(!_0x30766e)return Promise['resolve'](null);return new Promise(function(_0x15a833,_0x1e6a69){return _0x45c252[_0x803d('0xd')][_0x803d('0x7')]({'where':{'sectionId':_0x30766e['id']},'raw':!![]})['then'](function(_0x31b244){if(_0x36a59a['field']&&_0x36a59a[_0x803d('0x5')]!=='id'){_0x30766e[_0x803d('0xe')]=_[_0x803d('0x9')](_0x31b244,function(_0x1dc5d9){return _0x1dc5d9[_0x36a59a['field']];});}else{if(_0x29909d===_0x803d('0xf')){_0x30766e[_0x803d('0xe')]=_[_0x803d('0x9')](_0x31b244,function(_0x32f9b7){return{'id':_0x32f9b7['resourceId'],'type':_0x32f9b7[_0x803d('0x10')]};});}else{_0x30766e['associatedResources']=_['map'](_0x31b244,function(_0x5abe41){return _0x5abe41['resourceId'];});}}_0x15a833(_0x30766e);})[_0x803d('0xc')](function(_0x4ba3ae){_0x1e6a69(_0x4ba3ae);});});}function _0x4401ee(_0x5479e8,_0x59e67f){var _0x2fa9d7={'parentSections':[]};switch(_0x5479e8[_0x803d('0x11')]()){case'squareprojects':_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x13');break;case'odbc':_0x2fa9d7[_0x803d('0x12')]='SquareOdbc';break;case _0x803d('0x14'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x15');_0x2fa9d7['parentSections']=[{'name':_0x803d('0x16'),'field':_0x803d('0xb'),'foreignKey':_0x803d('0x17')}];break;case'projects':_0x2fa9d7['childModel']=_0x803d('0x18');break;case _0x803d('0x19'):_0x2fa9d7['childModel']=_0x803d('0x1a');_0x2fa9d7[_0x803d('0x1b')]=[{'name':_0x803d('0x1c'),'field':'id','foreignKey':'ListId'}];break;case'lists':_0x2fa9d7['childModel']=_0x803d('0x1d');break;case _0x803d('0x1e'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x1f');break;case'globalcustomfields':_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x20');break;case _0x803d('0x21'):_0x2fa9d7['childModel']='ChatQueue';break;case _0x803d('0x22'):_0x2fa9d7['childModel']=_0x803d('0x23');break;case _0x803d('0x24'):_0x2fa9d7['childModel']=_0x803d('0x25');break;case'faxaccounts':_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x26');break;case'inboundroutes':case _0x803d('0x27'):case _0x803d('0x28'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x29');break;case _0x803d('0x2a'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x2b');break;case _0x803d('0x2c'):_0x2fa9d7['childModel']=_0x803d('0x2d');break;case _0x803d('0x2e'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x2f');_0x2fa9d7[_0x803d('0x1b')]=[{'name':'Agents','field':_0x803d('0xb'),'foreignKey':'membername','model':_0x803d('0x30'),'filter':{'field':_0x803d('0x31'),'value':['agent']}},{'name':_0x803d('0x32'),'field':_0x803d('0xb'),'foreignKey':_0x803d('0x33'),'model':_0x803d('0x30'),'filter':{'field':_0x803d('0x31'),'value':['telephone']}},{'name':_0x803d('0x34'),'field':_0x803d('0xb'),'foreignKey':_0x803d('0x35'),'model':_0x803d('0x36'),'filter':{'field':_0x803d('0x10'),'value':[_0x803d('0x37')]}},{'name':'QueueCampaigns','field':'name','foreignKey':'queue','model':_0x803d('0x36'),'filter':{'field':_0x803d('0x10'),'value':['outbound']}}];break;case _0x803d('0x38'):_0x2fa9d7[_0x803d('0x12')]='VoiceMusicOnHold';break;case _0x803d('0x39'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x3a');break;case'voiceprefixes':_0x2fa9d7['childModel']=_0x803d('0x3b');break;case'ivrcampaigns':_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x3c');break;case _0x803d('0x3d'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x3e');break;case _0x803d('0x3f'):_0x2fa9d7['childModel']='MailAccount';break;case'mailsubstatuses':_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x40');break;case'openchannelqueues':_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x41');break;case'openchannelaccounts':_0x2fa9d7['childModel']=_0x803d('0x42');break;case _0x803d('0x43'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x44');break;case _0x803d('0x45'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x46');break;case'whatsappqueues':_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x47');break;case _0x803d('0x48'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x49');break;case _0x803d('0x4a'):_0x2fa9d7[_0x803d('0x12')]='Team';break;case _0x803d('0x4b'):case _0x803d('0x4c'):_0x2fa9d7[_0x803d('0x12')]='VoiceQueue';if(_0x59e67f){_0x2fa9d7['parentSections']=[{'name':_0x803d('0x34')},{'name':_0x803d('0x4d')}];}break;case'users':case _0x803d('0x4e'):case'telephones':_0x2fa9d7[_0x803d('0x12')]='User';if(_0x59e67f){_0x2fa9d7['parentSections']=[{'name':'Users','filter':{'field':_0x803d('0x31'),'value':[_0x803d('0x4f'),_0x803d('0x50')]},'ignore':!![]},{'name':'Agents'},{'name':_0x803d('0x32')}];}break;case _0x803d('0x51'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x52');break;case _0x803d('0x53'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x54');break;case _0x803d('0x55'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x56');break;case _0x803d('0x57'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x58');break;case'deskaccounts':_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x59');break;case _0x803d('0x5a'):_0x2fa9d7[_0x803d('0x12')]='ZohoAccount';break;case _0x803d('0x5b'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x30');break;case _0x803d('0x5c'):_0x2fa9d7['childModel']='CannedAnswer';break;case _0x803d('0x5d'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x5e');break;case _0x803d('0x5f'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x60');break;case _0x803d('0x61'):_0x2fa9d7['childModel']=_0x803d('0x62');break;case _0x803d('0x63'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x64');break;case _0x803d('0x65'):_0x2fa9d7[_0x803d('0x12')]='Schedule';break;case _0x803d('0x66'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x67');break;case'tags':_0x2fa9d7['childModel']=_0x803d('0x68');break;case'templates':_0x2fa9d7['childModel']=_0x803d('0x69');break;case _0x803d('0x6a'):_0x2fa9d7['childModel']=_0x803d('0x6b');break;case _0x803d('0x6c'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0x6d');break;case _0x803d('0x6e'):_0x2fa9d7[_0x803d('0x12')]='Variable';break;case _0x803d('0x6f'):_0x2fa9d7[_0x803d('0x12')]='Plugin';break;case _0x803d('0x70'):_0x2fa9d7[_0x803d('0x12')]=_0x803d('0xf');_0x2fa9d7['parentSections']=[{'name':_0x803d('0x71'),'field':'id','foreignKey':_0x803d('0x72')}];break;case'metrics':_0x2fa9d7['childModel']=_0x803d('0x73');break;}return _0x2fa9d7;}function _0x2ee6ee(_0x798f6f,_0x1ff96e){var _0x56b6be=_0x798f6f[_0x803d('0x74')](0x0)['toUpperCase']()+_0x798f6f[_0x803d('0x75')](0x1);var _0x42ddaa={'type':_0x45c252['Sequelize'][_0x803d('0x76')][_0x803d('0x77')],'raw':!![]};return new Promise(function(_0x42d2a7,_0x2d4088){var _0x479559=squel[_0x803d('0x78')]()[_0x803d('0x5')](_0x803d('0x79')+_0x56b6be+_0x803d('0x7a'),'id')[_0x803d('0x5')](_0x803d('0x7b'))[_0x803d('0x7c')](_0x803d('0x7d')+_0x798f6f+_0x803d('0x7e'),'ui')[_0x803d('0x7f')](_0x803d('0x80'),_0x1ff96e['id']);return _0x45c252[_0x803d('0x81')][_0x803d('0x82')](_0x479559[_0x803d('0x83')](),_0x42ddaa)[_0x803d('0x8')](function(_0x3ac724){_0x1ff96e[_0x56b6be+'OpenTabs']=_0x3ac724;_0x42d2a7(_0x3ac724);})['catch'](function(_0x51484f){_0x2d4088(_0x51484f);});});}return _0x2cf628[_0x803d('0x84')](_0x803d('0x85'),attributes,{'tableName':_0x803d('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4a2dd0){var _0x519c94=require(_0x803d('0x87'));var _0x506e05={'raw':_0x4a2dd0[_0x803d('0x82')][_0x803d('0x88')],'where':{}};var _0x3a02c6={};var _0x31bb5b={'count':0x0,'rows':[]};var _0x296402=_0x4a2dd0[_0x803d('0x82')][_0x803d('0x89')];var _0x1ac720=_0x4a2dd0[_0x803d('0x82')][_0x803d('0x8a')]||![];var _0x1196fc=_0x4401ee(_0x296402,_0x1ac720);if(!_0x1196fc[_0x803d('0x12')])throw new Error(_0x803d('0x8b')+_0x296402+'\x27');var _0x5ba305=[{'name':_0x296402}];if(!_[_0x803d('0x8c')](_0x1196fc[_0x803d('0x1b')]))_0x5ba305=_0x1196fc['parentSections'];var _0xcb8a99=[];for(var _0x19d7d4=0x0;_0x19d7d4<_0x5ba305[_0x803d('0x8d')];_0x19d7d4++){_0xcb8a99[_0x803d('0x8e')](_0x45c252[_0x803d('0x8f')]['find']({'where':{'userProfileId':_0x4a2dd0[_0x803d('0x90')]['id'],'name':_0x5ba305[_0x19d7d4]['name']},'raw':!![]}));}return Promise['all'](_0xcb8a99)[_0x803d('0x8')](function(_0x485651){var _0x147a55=_[_0x803d('0x4')](_0x485651,function(_0xbafaac){return _0xbafaac?_0xbafaac:undefined;});var _0x51a9b3=_[_0x803d('0x4')](_0x5ba305,[_0x803d('0x91'),!![]]);var _0xe98b16=_['isEmpty'](_0x147a55)&&_['isEmpty'](_0x51a9b3)?null:_[_0x803d('0x92')](_0x51a9b3,_0x147a55);if(!_0xe98b16)return null;var _0x495d61=[];for(var _0x38c5ee=0x0;_0x38c5ee<_0xe98b16[_0x803d('0x8d')];_0x38c5ee++){var _0x498668=_[_0x803d('0x93')](_0x5ba305,function(_0x241509){return _0xe98b16[_0x38c5ee]?_0x241509['name']===_0xe98b16[_0x38c5ee][_0x803d('0xb')]:null;});if(_0x498668){if(_0xe98b16[_0x38c5ee][_0x803d('0x91')]){_0x495d61[_0x803d('0x8e')](_0x25767f(_0x1196fc[_0x803d('0x12')],_0xe98b16[_0x38c5ee]));}else{if(!_0xe98b16[_0x38c5ee][_0x803d('0x94')]){_0x495d61['push'](_0x14fa0b(_0x498668,_0xe98b16[_0x38c5ee],_0x1196fc['childModel']));}else{if(_0x498668[_0x803d('0xa')]){_0x495d61[_0x803d('0x8e')](_0x34466f(_0x498668,_0xe98b16[_0x38c5ee]));}}}}}return Promise[_0x803d('0x95')](_0x495d61);})[_0x803d('0x8')](function(_0x66c81b){var _0x2b94d8=_0x66c81b;var _0x443c61=null;if(_0x2b94d8){_0x443c61=_0x2b94d8['length']===0x1?_0x2b94d8[0x0]:null;}if(!_0x443c61&&!_0x2b94d8)return _0x31bb5b;var _0x3d17c9=_0x45c252[_0x1196fc[_0x803d('0x12')]][_0x803d('0x96')];_0x3a02c6[_0x803d('0xa')]=_[_0x803d('0x97')](_0x3d17c9);_0x3a02c6['query']=_[_0x803d('0x97')](_0x4a2dd0[_0x803d('0x82')]);_0x3a02c6[_0x803d('0x98')]=_[_0x803d('0x99')](_0x3a02c6['model'],_0x3a02c6[_0x803d('0x82')]);_0x506e05[_0x803d('0x9a')]=_[_0x803d('0x99')](_0x3a02c6[_0x803d('0xa')],_0x519c94[_0x803d('0x9b')](_0x4a2dd0[_0x803d('0x82')][_0x803d('0x9b')]));_0x506e05['attributes']=_0x506e05[_0x803d('0x9a')][_0x803d('0x8d')]?_0x506e05[_0x803d('0x9a')]:_0x3a02c6['model'];if(!_0x4a2dd0[_0x803d('0x82')][_0x803d('0x9c')](_0x803d('0x9d'))){_0x506e05['limit']=_0x519c94['limit'](_0x4a2dd0['query'][_0x803d('0x9e')]);_0x506e05[_0x803d('0x9f')]=_0x519c94['offset'](_0x4a2dd0[_0x803d('0x82')][_0x803d('0x9f')]);}_0x506e05[_0x803d('0xa0')]=_0x519c94[_0x803d('0xa1')](_0x4a2dd0[_0x803d('0x82')][_0x803d('0xa1')]);_0x506e05[_0x803d('0x7f')]=_0x519c94[_0x803d('0x98')](_[_0x803d('0xa2')](_0x4a2dd0['query'],_0x3a02c6[_0x803d('0x98')]));if(_0x4a2dd0[_0x803d('0x82')]['filter']){_0x506e05[_0x803d('0x7f')]=_[_0x803d('0xa3')](_0x506e05['where'],{'$or':_[_0x803d('0x9')](_0x3d17c9,function(_0x9c5a5b){if(_0x9c5a5b[_0x803d('0x10')][_0x803d('0xa4')]!==_0x803d('0xa5')){var _0x11c812={};_0x11c812[_0x9c5a5b[_0x803d('0x5')]]={'$like':'%'+_0x4a2dd0[_0x803d('0x82')]['filter']+'%'};return _0x11c812;}})});}var _0x1526c0=[];var _0x1cf6db=null;var _0x187ac9={};if(_0x443c61){_0x1cf6db=_[_0x803d('0x93')](_0x5ba305,[_0x803d('0xb'),_0x443c61['name']]);if(_0x1cf6db['field']){_0x187ac9={};if(_0x1196fc['childModel']===_0x803d('0xf')){_0x187ac9[_0x1cf6db[_0x803d('0xa6')]]=_[_0x803d('0x9')](_0x443c61['associatedResources'],'id');}else{_0x187ac9[_0x1cf6db[_0x803d('0xa6')]]=_0x443c61[_0x803d('0xe')];}_0x1526c0[_0x803d('0x8e')](_0x187ac9);}else{_0x506e05[_0x803d('0x7f')]['id']=_0x443c61[_0x803d('0xe')];}}else{for(var _0x64e499=0x0;_0x64e499<_0x2b94d8[_0x803d('0x8d')];_0x64e499++){_0x1cf6db=_[_0x803d('0x93')](_0x5ba305,['name',_0x2b94d8[_0x64e499][_0x803d('0xb')]]);if(_0x1cf6db[_0x803d('0x5')]){_0x187ac9={};_0x187ac9[_0x1cf6db['foreignKey']]=_0x2b94d8[_0x64e499][_0x803d('0xe')];_0x1526c0[_0x803d('0x8e')](_0x187ac9);}else{if(!_0x506e05['where']['id'])_0x506e05[_0x803d('0x7f')]['id']=[];_0x2b94d8[_0x64e499][_0x803d('0xe')][_0x803d('0xa7')](function(_0x4444f6){_0x506e05[_0x803d('0x7f')]['id'][_0x803d('0x8e')](_0x4444f6);});}}}if(!_[_0x803d('0x8c')](_0x1526c0)){_0x506e05[_0x803d('0x7f')]=_['merge'](_0x506e05[_0x803d('0x7f')],{'$and':{'$or':_0x1526c0}});}_0x506e05=_[_0x803d('0xa3')]({},_0x506e05,_0x4a2dd0['options']);if(_0x443c61&&!_0x443c61[_0x803d('0x94')]&&_0x1196fc[_0x803d('0x12')]===_0x803d('0xf')){if(_0x4a2dd0[_0x803d('0x82')][_0x803d('0xa8')]){_0x506e05['include']=[{'all':!![]}];}return _0x45c252[_0x1196fc[_0x803d('0x12')]][_0x803d('0x7')](_0x506e05)[_0x803d('0x8')](function(_0x341d83){var _0xd9fb7=[];_0x341d83['forEach'](function(_0x36fb57){var _0x1eaf2e;switch(_0x36fb57[_0x803d('0xa9')]){case _0x803d('0xaa'):_0x1eaf2e=_[_0x803d('0x93')](_0x443c61['associatedResources'],function(_0xdfdcdd){return _0xdfdcdd['id']===_0x36fb57[_0x803d('0x72')]&&_0xdfdcdd[_0x803d('0x10')]==='DefaultReports';});break;case _0x803d('0xab'):_0x1eaf2e=_[_0x803d('0x93')](_0x443c61[_0x803d('0xe')],function(_0x26dbb4){return _0x26dbb4['id']===_0x36fb57[_0x803d('0x72')]&&_0x26dbb4[_0x803d('0x10')]==='CustomReports';});break;}if(_0x1eaf2e)_0xd9fb7[_0x803d('0x8e')](_0x36fb57);});_0x31bb5b['count']=_0xd9fb7[_0x803d('0x8d')];_0x31bb5b[_0x803d('0xac')]=_0xd9fb7;return _0x31bb5b;});}else{if(!_[_0x803d('0x8c')](_0x4a2dd0[_0x803d('0x82')][_0x803d('0xad')])){_0x506e05[_0x803d('0x7f')]['id']=_0x506e05[_0x803d('0x7f')]['id']?_['intersection'](_0x506e05[_0x803d('0x7f')]['id'],_0x4a2dd0['query'][_0x803d('0xad')]):_0x4a2dd0[_0x803d('0x82')][_0x803d('0xad')];if(_0x4a2dd0[_0x803d('0x82')][_0x803d('0xae')]){_0x506e05['order']=_0x4a2dd0['query'][_0x803d('0xae')];}}if(_0x4a2dd0['query'][_0x803d('0xaf')]){_0x506e05['where']=_['merge'](_0x506e05['where'],{'$and':_0x4a2dd0[_0x803d('0x82')]['extraQueryConditions']});}return _0x45c252[_0x1196fc['childModel']]['count']({'where':_0x506e05[_0x803d('0x7f')]})[_0x803d('0x8')](function(_0xc85263){_0x31bb5b[_0x803d('0xb0')]=_0xc85263;if(_0x4a2dd0[_0x803d('0x82')]['includeAll']){if(_0x1196fc['childModel']===_0x803d('0x1a')){_0x506e05[_0x803d('0xb1')]=[{'model':_0x45c252[_0x803d('0x68')],'as':_0x803d('0xb2'),'attributes':['id',_0x803d('0xb'),_0x803d('0xb3')],'required':_0x4a2dd0['query'][_0x803d('0xb4')]?!![]:![]},{'model':_0x45c252[_0x803d('0x68')],'as':_0x803d('0xb5'),'attributes':['id','name',_0x803d('0xb3')],'through':_0x4a2dd0[_0x803d('0x82')]['tag']?{'attributes':[],'where':{'TagId':_0x4a2dd0['query'][_0x803d('0xb4')]||undefined}}:{},'required':_0x4a2dd0['query'][_0x803d('0xb4')]?!![]:![]}];}else{_0x506e05[_0x803d('0xb1')]=[{'all':!![]}];}}return _0x45c252[_0x1196fc[_0x803d('0x12')]]['findAll'](_0x506e05);})['then'](function(_0x4d7b6e){_0x31bb5b[_0x803d('0xac')]=_0x4d7b6e;if(_0x296402===_0x803d('0xb6')&&_0x4a2dd0[_0x803d('0x82')][_0x803d('0xb7')]===_0x803d('0xb8')){var _0xad3be4=[];for(var _0x3f8a54=0x0;_0x3f8a54<_0x31bb5b[_0x803d('0xac')][_0x803d('0x8d')];_0x3f8a54++){_0xad3be4[_0x803d('0x8e')](_0x2ee6ee(_0x803d('0xb9'),_0x31bb5b[_0x803d('0xac')][_0x3f8a54][_0x803d('0xba')]));_0xad3be4[_0x803d('0x8e')](_0x2ee6ee(_0x803d('0xbb'),_0x31bb5b['rows'][_0x3f8a54][_0x803d('0xba')]));_0xad3be4[_0x803d('0x8e')](_0x2ee6ee('fax',_0x31bb5b[_0x803d('0xac')][_0x3f8a54][_0x803d('0xba')]));_0xad3be4[_0x803d('0x8e')](_0x2ee6ee(_0x803d('0xbc'),_0x31bb5b['rows'][_0x3f8a54][_0x803d('0xba')]));_0xad3be4[_0x803d('0x8e')](_0x2ee6ee(_0x803d('0xbd'),_0x31bb5b[_0x803d('0xac')][_0x3f8a54][_0x803d('0xba')]));_0xad3be4[_0x803d('0x8e')](_0x2ee6ee(_0x803d('0xbe'),_0x31bb5b[_0x803d('0xac')][_0x3f8a54][_0x803d('0xba')]));}return Promise[_0x803d('0x95')](_0xad3be4)[_0x803d('0x8')](function(){return _0x31bb5b;});}return _0x31bb5b;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 8979027..b7817a2 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 _0x6fad=['code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x351782,_0x183c66){var _0x520c8b=function(_0x1abf65){while(--_0x1abf65){_0x351782['push'](_0x351782['shift']());}};_0x520c8b(++_0x183c66);}(_0x6fad,0x17a));var _0xd6fa=function(_0x570496,_0x26a150){_0x570496=_0x570496-0x0;var _0x1d4204=_0x6fad[_0x570496];return _0x1d4204;};'use strict';var _=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var moment=require(_0xd6fa('0x2'));var BPromise=require(_0xd6fa('0x3'));var rs=require(_0xd6fa('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6fa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6fa('0x6'))('rpc');var config=require(_0xd6fa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd6fa('0x8')][_0xd6fa('0x9')]({'port':0x232a});config[_0xd6fa('0xa')]=_[_0xd6fa('0xb')](config[_0xd6fa('0xa')],{'host':_0xd6fa('0xc'),'port':0x18eb});var socket=require(_0xd6fa('0xd'))(new Redis(config['redis']));require(_0xd6fa('0xe'))['register'](socket);function respondWithRpcPromise(_0x1f7672,_0x23cb2b,_0x41a335){return new BPromise(function(_0x1cc80c,_0x31286a){return client['request'](_0x1f7672,_0x41a335)['then'](function(_0x28f2e6){logger[_0xd6fa('0xf')](_0xd6fa('0x10'),_0x23cb2b,'request\x20sent');logger[_0xd6fa('0x11')](_0xd6fa('0x12'),_0x23cb2b,_0xd6fa('0x13'),JSON[_0xd6fa('0x14')](_0x28f2e6));if(_0x28f2e6[_0xd6fa('0x15')]){if(_0x28f2e6[_0xd6fa('0x15')][_0xd6fa('0x16')]===0x1f4){logger['error'](_0xd6fa('0x10'),_0x23cb2b,_0x28f2e6['error']['message']);return _0x31286a(_0x28f2e6[_0xd6fa('0x15')][_0xd6fa('0x17')]);}logger['error'](_0xd6fa('0x10'),_0x23cb2b,_0x28f2e6[_0xd6fa('0x15')]['message']);return _0x1cc80c(_0x28f2e6[_0xd6fa('0x15')][_0xd6fa('0x17')]);}else{logger[_0xd6fa('0xf')]('UserProfile,\x20%s,\x20%s',_0x23cb2b,_0xd6fa('0x13'));_0x1cc80c(_0x28f2e6['result'][_0xd6fa('0x17')]);}})[_0xd6fa('0x18')](function(_0x6a8922){logger[_0xd6fa('0x15')](_0xd6fa('0x10'),_0x23cb2b,_0x6a8922);_0x31286a(_0x6a8922);});});} \ No newline at end of file +var _0x349f=['register','request','then','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./userProfile.socket'];(function(_0x5a92ad,_0x2219a6){var _0x2466f8=function(_0x4ad04e){while(--_0x4ad04e){_0x5a92ad['push'](_0x5a92ad['shift']());}};_0x2466f8(++_0x2219a6);}(_0x349f,0xa8));var _0xf349=function(_0x302e77,_0x12fb1f){_0x302e77=_0x302e77-0x0;var _0x585ebf=_0x349f[_0x302e77];return _0x585ebf;};'use strict';var _=require(_0xf349('0x0'));var util=require(_0xf349('0x1'));var moment=require(_0xf349('0x2'));var BPromise=require('bluebird');var rs=require(_0xf349('0x3'));var fs=require('fs');var Redis=require(_0xf349('0x4'));var db=require(_0xf349('0x5'))['db'];var utils=require(_0xf349('0x6'));var logger=require(_0xf349('0x7'))(_0xf349('0x8'));var config=require(_0xf349('0x9'));var jayson=require(_0xf349('0xa'));var client=jayson[_0xf349('0xb')][_0xf349('0xc')]({'port':0x232a});config['redis']=_[_0xf349('0xd')](config[_0xf349('0xe')],{'host':_0xf349('0xf'),'port':0x18eb});var socket=require(_0xf349('0x10'))(new Redis(config[_0xf349('0xe')]));require(_0xf349('0x11'))[_0xf349('0x12')](socket);function respondWithRpcPromise(_0x5e30ef,_0x50652e,_0x1e2abf){return new BPromise(function(_0x2eb18e,_0x459747){return client[_0xf349('0x13')](_0x5e30ef,_0x1e2abf)[_0xf349('0x14')](function(_0x497611){logger['info']('UserProfile,\x20%s,\x20%s',_0x50652e,_0xf349('0x15'));logger[_0xf349('0x16')](_0xf349('0x17'),_0x50652e,_0xf349('0x15'),JSON[_0xf349('0x18')](_0x497611));if(_0x497611['error']){if(_0x497611[_0xf349('0x19')][_0xf349('0x1a')]===0x1f4){logger['error'](_0xf349('0x1b'),_0x50652e,_0x497611[_0xf349('0x19')]['message']);return _0x459747(_0x497611[_0xf349('0x19')]['message']);}logger[_0xf349('0x19')](_0xf349('0x1b'),_0x50652e,_0x497611[_0xf349('0x19')][_0xf349('0x1c')]);return _0x2eb18e(_0x497611[_0xf349('0x19')][_0xf349('0x1c')]);}else{logger[_0xf349('0x1d')]('UserProfile,\x20%s,\x20%s',_0x50652e,_0xf349('0x15'));_0x2eb18e(_0x497611['result'][_0xf349('0x1c')]);}})[_0xf349('0x1e')](function(_0x296894){logger[_0xf349('0x19')](_0xf349('0x1b'),_0x50652e,_0x296894);_0x459747(_0x296894);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 9c35a8f..200dbda 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 _0x7f8e=['./userProfile.events','update','emit','removeListener','length','userProfile:'];(function(_0x17f145,_0x3422bb){var _0x2d5420=function(_0x3eb38b){while(--_0x3eb38b){_0x17f145['push'](_0x17f145['shift']());}};_0x2d5420(++_0x3422bb);}(_0x7f8e,0x15c));var _0xe7f8=function(_0x5b567a,_0x4ac7c2){_0x5b567a=_0x5b567a-0x0;var _0x1da84d=_0x7f8e[_0x5b567a];return _0x1da84d;};'use strict';var UserProfileEvents=require(_0xe7f8('0x0'));var events=['save','remove',_0xe7f8('0x1')];function createListener(_0x512363,_0xe02946){return function(_0x39f515){_0xe02946[_0xe7f8('0x2')](_0x512363,_0x39f515);};}function removeListener(_0x133e52,_0x155be4){return function(){UserProfileEvents[_0xe7f8('0x3')](_0x133e52,_0x155be4);};}exports['register']=function(_0x22467d){for(var _0x2b1ffc=0x0,_0x1d9edd=events[_0xe7f8('0x4')];_0x2b1ffc<_0x1d9edd;_0x2b1ffc++){var _0x21c9e6=events[_0x2b1ffc];var _0x5d6de0=createListener(_0xe7f8('0x5')+_0x21c9e6,_0x22467d);UserProfileEvents['on'](_0x21c9e6,_0x5d6de0);}}; \ No newline at end of file +var _0x40c9=['save','remove','update','emit','removeListener','register','userProfile:','./userProfile.events'];(function(_0x446430,_0x47922f){var _0x3b47d6=function(_0x224cb7){while(--_0x224cb7){_0x446430['push'](_0x446430['shift']());}};_0x3b47d6(++_0x47922f);}(_0x40c9,0x18f));var _0x940c=function(_0x13b3d5,_0x57ec6e){_0x13b3d5=_0x13b3d5-0x0;var _0x40916e=_0x40c9[_0x13b3d5];return _0x40916e;};'use strict';var UserProfileEvents=require(_0x940c('0x0'));var events=[_0x940c('0x1'),_0x940c('0x2'),_0x940c('0x3')];function createListener(_0x1d32f0,_0x5c04fa){return function(_0x42272c){_0x5c04fa[_0x940c('0x4')](_0x1d32f0,_0x42272c);};}function removeListener(_0xaed811,_0x12db99){return function(){UserProfileEvents[_0x940c('0x5')](_0xaed811,_0x12db99);};}exports[_0x940c('0x6')]=function(_0x214d3d){for(var _0x42b4d4=0x0,_0x4b8268=events['length'];_0x42b4d4<_0x4b8268;_0x42b4d4++){var _0x95036f=events[_0x42b4d4];var _0x110d8d=createListener(_0x940c('0x7')+_0x95036f,_0x214d3d);UserProfileEvents['on'](_0x95036f,_0x110d8d);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index c249b02..575de42 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 _0x2e02=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','isAuthenticated','describe','/:id','show','post','create','put','destroy','exports','multer'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x2e02,0x125));var _0x22e0=function(_0x526acc,_0x128d58){_0x526acc=_0x526acc-0x0;var _0x294267=_0x2e02[_0x526acc];return _0x294267;};'use strict';var multer=require(_0x22e0('0x0'));var util=require(_0x22e0('0x1'));var path=require(_0x22e0('0x2'));var timeout=require('connect-timeout');var express=require(_0x22e0('0x3'));var router=express[_0x22e0('0x4')]();var fs_extra=require(_0x22e0('0x5'));var auth=require(_0x22e0('0x6'));var interaction=require(_0x22e0('0x7'));var config=require(_0x22e0('0x8'));var controller=require(_0x22e0('0x9'));router[_0x22e0('0xa')]('/',auth['isAuthenticated'](),controller[_0x22e0('0xb')]);router[_0x22e0('0xa')]('/describe',auth[_0x22e0('0xc')](),controller[_0x22e0('0xd')]);router[_0x22e0('0xa')](_0x22e0('0xe'),auth[_0x22e0('0xc')](),controller[_0x22e0('0xf')]);router[_0x22e0('0x10')]('/',auth['isAuthenticated'](),controller[_0x22e0('0x11')]);router[_0x22e0('0x12')](_0x22e0('0xe'),auth[_0x22e0('0xc')](),controller['update']);router['delete'](_0x22e0('0xe'),auth[_0x22e0('0xc')](),controller[_0x22e0('0x13')]);module[_0x22e0('0x14')]=router; \ No newline at end of file +var _0xd3de=['show','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','/:id'];(function(_0x5bef39,_0x12095f){var _0x132ed8=function(_0x3a528e){while(--_0x3a528e){_0x5bef39['push'](_0x5bef39['shift']());}};_0x132ed8(++_0x12095f);}(_0xd3de,0x1a4));var _0xed3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3de[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xed3d('0x0'));var util=require(_0xed3d('0x1'));var path=require('path');var timeout=require(_0xed3d('0x2'));var express=require(_0xed3d('0x3'));var router=express[_0xed3d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed3d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed3d('0x6'));var controller=require('./userProfileResource.controller');router[_0xed3d('0x7')]('/',auth['isAuthenticated'](),controller[_0xed3d('0x8')]);router[_0xed3d('0x7')]('/describe',auth[_0xed3d('0x9')](),controller[_0xed3d('0xa')]);router[_0xed3d('0x7')](_0xed3d('0xb'),auth[_0xed3d('0x9')](),controller[_0xed3d('0xc')]);router['post']('/',auth[_0xed3d('0x9')](),controller[_0xed3d('0xd')]);router[_0xed3d('0xe')]('/:id',auth[_0xed3d('0x9')](),controller[_0xed3d('0xf')]);router['delete']('/:id',auth[_0xed3d('0x9')](),controller[_0xed3d('0x10')]);module[_0xed3d('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 0f63e93..d6ce824 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 _0x15ae=['STRING','sequelize'];(function(_0x4cfaf9,_0x344a74){var _0x4d5e1b=function(_0x5848b7){while(--_0x5848b7){_0x4cfaf9['push'](_0x4cfaf9['shift']());}};_0x4d5e1b(++_0x344a74);}(_0x15ae,0x1f1));var _0xe15a=function(_0xae0420,_0x28d72c){_0xae0420=_0xae0420-0x0;var _0x1b1dd8=_0x15ae[_0xae0420];return _0x1b1dd8;};'use strict';var Sequelize=require(_0xe15a('0x0'));module['exports']={'name':{'type':Sequelize[_0xe15a('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xe15a('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x08c9=['STRING','INTEGER','sequelize','exports'];(function(_0x2e8e7b,_0x5e4613){var _0x15fdab=function(_0x534cf4){while(--_0x534cf4){_0x2e8e7b['push'](_0x2e8e7b['shift']());}};_0x15fdab(++_0x5e4613);}(_0x08c9,0xd2));var _0x908c=function(_0xe81443,_0x2cf5c4){_0xe81443=_0xe81443-0x0;var _0x5e120f=_0x08c9[_0xe81443];return _0x5e120f;};'use strict';var Sequelize=require(_0x908c('0x0'));module[_0x908c('0x1')]={'name':{'type':Sequelize[_0x908c('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x908c('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 42baa05..435029d 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 _0x1261=['end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','UserProfileResource','model','map','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','findAll','rows','params','include','find','create','catch','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x53a1c3,_0x438ad2){var _0x2f3a0b=function(_0x3de980){while(--_0x3de980){_0x53a1c3['push'](_0x53a1c3['shift']());}};_0x2f3a0b(++_0x438ad2);}(_0x1261,0x144));var _0x1126=function(_0x305c93,_0x3421dc){_0x305c93=_0x305c93-0x0;var _0x5bae39=_0x1261[_0x305c93];return _0x5bae39;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}exports['index']=function(_0x2fb797,_0x23d2bc){var _0x4a334a={},_0x3fa694={},_0x4bf807={'count':0x0,'rows':[]};var _0xc62460=_['map'](db[_0x1126('0x29')]['rawAttributes'],function(_0x378f4d){return{'name':_0x378f4d['fieldName'],'type':_0x378f4d['type']['key']};});_0x3fa694[_0x1126('0x2a')]=_[_0x1126('0x2b')](_0xc62460,_0x1126('0x2c'));_0x3fa694['query']=_[_0x1126('0x2d')](_0x2fb797[_0x1126('0x2e')]);_0x3fa694['filters']=_[_0x1126('0x2f')](_0x3fa694[_0x1126('0x2a')],_0x3fa694[_0x1126('0x2e')]);_0x4a334a[_0x1126('0x30')]=_['intersection'](_0x3fa694['model'],qs[_0x1126('0x31')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x31')]));_0x4a334a[_0x1126('0x30')]=_0x4a334a['attributes'][_0x1126('0x32')]?_0x4a334a[_0x1126('0x30')]:_0x3fa694[_0x1126('0x2a')];if(!_0x2fb797[_0x1126('0x2e')][_0x1126('0x33')]('nolimit')){_0x4a334a[_0x1126('0x1e')]=qs[_0x1126('0x1e')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1e')]);_0x4a334a['offset']=qs['offset'](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1c')]);}_0x4a334a['order']=qs[_0x1126('0x34')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x34')]);_0x4a334a['where']=qs['filters'](_[_0x1126('0x35')](_0x2fb797[_0x1126('0x2e')],_0x3fa694[_0x1126('0x36')]),_0xc62460);if(_0x2fb797[_0x1126('0x2e')]['filter']){_0x4a334a[_0x1126('0x37')]=_['merge'](_0x4a334a[_0x1126('0x37')],{'$or':_[_0x1126('0x2b')](_0xc62460,function(_0xfa96e0){if(_0xfa96e0[_0x1126('0x38')]!==_0x1126('0x39')){var _0x5746f6={};_0x5746f6[_0xfa96e0[_0x1126('0x2c')]]={'$like':'%'+_0x2fb797[_0x1126('0x2e')][_0x1126('0x3a')]+'%'};return _0x5746f6;}})});}_0x4a334a=_[_0x1126('0x3b')]({},_0x4a334a,_0x2fb797[_0x1126('0x3c')]);var _0x3442b8={'where':_0x4a334a[_0x1126('0x37')]};return db['UserProfileResource'][_0x1126('0x1f')](_0x3442b8)[_0x1126('0x25')](function(_0x227a6b){_0x4bf807[_0x1126('0x1f')]=_0x227a6b;if(_0x2fb797[_0x1126('0x2e')]['includeAll']){_0x4a334a['include']=[{'all':!![]}];}return db[_0x1126('0x29')][_0x1126('0x3d')](_0x4a334a);})[_0x1126('0x25')](function(_0x21c38e){_0x4bf807[_0x1126('0x3e')]=_0x21c38e;return _0x4bf807;})[_0x1126('0x25')](respondWithFilteredResult(_0x23d2bc,_0x4a334a))['catch'](handleError(_0x23d2bc,null));};exports['show']=function(_0x4cb1db,_0xb8054e){var _0x5d4194={'raw':![],'where':{'id':_0x4cb1db[_0x1126('0x3f')]['id']}},_0xf84005={};_0xf84005[_0x1126('0x2a')]=_[_0x1126('0x2d')](db['UserProfileResource']['rawAttributes']);_0xf84005[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x4cb1db[_0x1126('0x2e')]);_0xf84005['filters']=_[_0x1126('0x2f')](_0xf84005['model'],_0xf84005[_0x1126('0x2e')]);_0x5d4194['attributes']=_[_0x1126('0x2f')](_0xf84005[_0x1126('0x2a')],qs[_0x1126('0x31')](_0x4cb1db['query'][_0x1126('0x31')]));_0x5d4194[_0x1126('0x30')]=_0x5d4194[_0x1126('0x30')]['length']?_0x5d4194['attributes']:_0xf84005['model'];if(_0x4cb1db[_0x1126('0x2e')]['includeAll']){_0x5d4194[_0x1126('0x40')]=[{'all':!![]}];}_0x5d4194=_['merge']({},_0x5d4194,_0x4cb1db[_0x1126('0x3c')]);return db[_0x1126('0x29')][_0x1126('0x41')](_0x5d4194)[_0x1126('0x25')](handleEntityNotFound(_0xb8054e,null))[_0x1126('0x25')](respondWithResult(_0xb8054e,null))['catch'](handleError(_0xb8054e,null));};exports[_0x1126('0x42')]=function(_0x512f60,_0x5111d3){return db[_0x1126('0x29')][_0x1126('0x42')](_0x512f60['body'],{})[_0x1126('0x25')](respondWithResult(_0x5111d3,0xc9))[_0x1126('0x43')](handleError(_0x5111d3,null));};exports['update']=function(_0x3e4eeb,_0xbdde58){if(_0x3e4eeb[_0x1126('0x44')]['id']){delete _0x3e4eeb['body']['id'];}return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x3e4eeb[_0x1126('0x3f')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0xbdde58,null))[_0x1126('0x25')](saveUpdates(_0x3e4eeb[_0x1126('0x44')],null))[_0x1126('0x25')](respondWithResult(_0xbdde58,null))[_0x1126('0x43')](handleError(_0xbdde58,null));};exports['destroy']=function(_0x1b8b83,_0x5a2287){return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x1b8b83['params']['id']}})['then'](handleEntityNotFound(_0x5a2287,null))[_0x1126('0x25')](removeEntity(_0x5a2287,null))[_0x1126('0x43')](handleError(_0x5a2287,null));};exports[_0x1126('0x45')]=function(_0x52a9a4,_0x3cb44c){return db[_0x1126('0x29')][_0x1126('0x45')]()[_0x1126('0x25')](respondWithResult(_0x3cb44c,null))['catch'](handleError(_0x3cb44c,null));}; \ No newline at end of file +var _0x430c=['status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','describe','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0xc471d2,_0x26ab16){var _0x334c68=function(_0x2deae4){while(--_0x2deae4){_0xc471d2['push'](_0xc471d2['shift']());}};_0x334c68(++_0x26ab16);}(_0x430c,0x1a1));var _0xc430=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x430c[_0x2aea9e];return _0x430b92;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['create']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')](_0x10db27[_0xc430('0x45')],{})['then'](respondWithResult(_0x4eafae,0xc9))[_0xc430('0x40')](handleError(_0x4eafae,null));};exports[_0xc430('0x46')]=function(_0x19e563,_0x549400){if(_0x19e563[_0xc430('0x45')]['id']){delete _0x19e563[_0xc430('0x45')]['id'];}return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x19e563[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x549400,null))[_0xc430('0x1e')](saveUpdates(_0x19e563['body'],null))[_0xc430('0x1e')](respondWithResult(_0x549400,null))[_0xc430('0x40')](handleError(_0x549400,null));};exports[_0xc430('0x1f')]=function(_0x4e9aff,_0x23cb41){return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x4e9aff[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x23cb41,null))[_0xc430('0x1e')](removeEntity(_0x23cb41,null))['catch'](handleError(_0x23cb41,null));};exports[_0xc430('0x48')]=function(_0x214954,_0x2a5143){return db[_0xc430('0x25')][_0xc430('0x48')]()[_0xc430('0x1e')](respondWithResult(_0x2a5143,null))['catch'](handleError(_0x2a5143,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 0b1cfae..0d78d5a 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 _0x6f7c=['resourceId','sectionId','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x6f7c,0x136));var _0xc6f7=function(_0x21dd37,_0x2f1ff9){_0x21dd37=_0x21dd37-0x0;var _0x4d4884=_0x6f7c[_0x21dd37];return _0x4d4884;};'use strict';var _=require(_0xc6f7('0x0'));var util=require(_0xc6f7('0x1'));var logger=require(_0xc6f7('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc6f7('0x3'));var rp=require(_0xc6f7('0x4'));var fs=require('fs');var path=require(_0xc6f7('0x5'));var rimraf=require('rimraf');var config=require(_0xc6f7('0x6'));var attributes=require(_0xc6f7('0x7'));module[_0xc6f7('0x8')]=function(_0x27856e,_0x47ede7){return _0x27856e[_0xc6f7('0x9')](_0xc6f7('0xa'),attributes,{'tableName':_0xc6f7('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xc6f7('0xc'),_0xc6f7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad53=['path','rimraf','../../config/environment','exports','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3ab444,_0x33f590){var _0x476b61=function(_0x443c06){while(--_0x443c06){_0x3ab444['push'](_0x3ab444['shift']());}};_0x476b61(++_0x33f590);}(_0xad53,0x72));var _0x3ad5=function(_0x250534,_0x51c570){_0x250534=_0x250534-0x0;var _0x47be44=_0xad53[_0x250534];return _0x47be44;};'use strict';var _=require(_0x3ad5('0x0'));var util=require(_0x3ad5('0x1'));var logger=require(_0x3ad5('0x2'))('api');var moment=require(_0x3ad5('0x3'));var BPromise=require(_0x3ad5('0x4'));var rp=require(_0x3ad5('0x5'));var fs=require('fs');var path=require(_0x3ad5('0x6'));var rimraf=require(_0x3ad5('0x7'));var config=require(_0x3ad5('0x8'));var attributes=require('./userProfileResource.attributes');module[_0x3ad5('0x9')]=function(_0x51fcd2,_0x586619){return _0x51fcd2[_0x3ad5('0xa')](_0x3ad5('0xb'),attributes,{'tableName':_0x3ad5('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x3ad5('0xd'),_0x3ad5('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 772ccdb..a12647e 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 _0x7d53=['ioredis','../../mysqldb','../../config/utils','rpc','http','request','info','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0x7d53,0x1c3));var _0x37d5=function(_0x124101,_0xb2d628){_0x124101=_0x124101-0x0;var _0x8fc5c4=_0x7d53[_0x124101];return _0x8fc5c4;};'use strict';var _=require(_0x37d5('0x0'));var util=require(_0x37d5('0x1'));var moment=require(_0x37d5('0x2'));var BPromise=require(_0x37d5('0x3'));var rs=require(_0x37d5('0x4'));var fs=require('fs');var Redis=require(_0x37d5('0x5'));var db=require(_0x37d5('0x6'))['db'];var utils=require(_0x37d5('0x7'));var logger=require('../../config/logger')(_0x37d5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x37d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2095a6,_0x556aeb,_0x76c533){return new BPromise(function(_0x5ebc77,_0x19400c){return client[_0x37d5('0xa')](_0x2095a6,_0x76c533)['then'](function(_0x4f8dba){logger[_0x37d5('0xb')](_0x37d5('0xc'),_0x556aeb,'request\x20sent');logger[_0x37d5('0xd')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x556aeb,_0x37d5('0xe'),JSON[_0x37d5('0xf')](_0x4f8dba));if(_0x4f8dba['error']){if(_0x4f8dba[_0x37d5('0x10')]['code']===0x1f4){logger[_0x37d5('0x10')](_0x37d5('0xc'),_0x556aeb,_0x4f8dba['error']['message']);return _0x19400c(_0x4f8dba[_0x37d5('0x10')]['message']);}logger[_0x37d5('0x10')](_0x37d5('0xc'),_0x556aeb,_0x4f8dba['error'][_0x37d5('0x11')]);return _0x5ebc77(_0x4f8dba[_0x37d5('0x10')][_0x37d5('0x11')]);}else{logger[_0x37d5('0xb')](_0x37d5('0xc'),_0x556aeb,_0x37d5('0xe'));_0x5ebc77(_0x4f8dba[_0x37d5('0x12')][_0x37d5('0x11')]);}})['catch'](function(_0xdbcb0b){logger[_0x37d5('0x10')](_0x37d5('0xc'),_0x556aeb,_0xdbcb0b);_0x19400c(_0xdbcb0b);});});} \ No newline at end of file +var _0x2788=['http','request','then','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x308b2c,_0x5e5c73){var _0x4f1083=function(_0x1e57eb){while(--_0x1e57eb){_0x308b2c['push'](_0x308b2c['shift']());}};_0x4f1083(++_0x5e5c73);}(_0x2788,0xa6));var _0x8278=function(_0x3a9d25,_0x5c686a){_0x3a9d25=_0x3a9d25-0x0;var _0x18a22c=_0x2788[_0x3a9d25];return _0x18a22c;};'use strict';var _=require(_0x8278('0x0'));var util=require(_0x8278('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8278('0x2'));var fs=require('fs');var Redis=require(_0x8278('0x3'));var db=require(_0x8278('0x4'))['db'];var utils=require(_0x8278('0x5'));var logger=require('../../config/logger')(_0x8278('0x6'));var config=require(_0x8278('0x7'));var jayson=require(_0x8278('0x8'));var client=jayson[_0x8278('0x9')][_0x8278('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5051cb,_0x38bb7e,_0xa763bd){return new BPromise(function(_0x2f394c,_0x2e376a){return client[_0x8278('0xb')](_0x5051cb,_0xa763bd)[_0x8278('0xc')](function(_0x29bb6c){logger['info'](_0x8278('0xd'),_0x38bb7e,'request\x20sent');logger[_0x8278('0xe')](_0x8278('0xf'),_0x38bb7e,'request\x20sent',JSON['stringify'](_0x29bb6c));if(_0x29bb6c[_0x8278('0x10')]){if(_0x29bb6c[_0x8278('0x10')][_0x8278('0x11')]===0x1f4){logger[_0x8278('0x10')](_0x8278('0xd'),_0x38bb7e,_0x29bb6c['error'][_0x8278('0x12')]);return _0x2e376a(_0x29bb6c[_0x8278('0x10')]['message']);}logger['error'](_0x8278('0xd'),_0x38bb7e,_0x29bb6c[_0x8278('0x10')][_0x8278('0x12')]);return _0x2f394c(_0x29bb6c['error'][_0x8278('0x12')]);}else{logger[_0x8278('0x13')](_0x8278('0xd'),_0x38bb7e,_0x8278('0x14'));_0x2f394c(_0x29bb6c['result'][_0x8278('0x12')]);}})[_0x8278('0x15')](function(_0x919f51){logger['error'](_0x8278('0xd'),_0x38bb7e,_0x919f51);_0x2e376a(_0x919f51);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index d3aed34..6ca3bf2 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 _0xadbe=['isAuthenticated','describe','/:id','show','create','put','update','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','/describe'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xadbe,0x178));var _0xeadb=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0xadbe[_0xd22d95];return _0x15d7a3;};'use strict';var multer=require(_0xeadb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xeadb('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xeadb('0x2'));var auth=require(_0xeadb('0x3'));var interaction=require(_0xeadb('0x4'));var config=require('../../config/environment');var controller=require(_0xeadb('0x5'));router[_0xeadb('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeadb('0x6')](_0xeadb('0x7'),auth[_0xeadb('0x8')](),controller[_0xeadb('0x9')]);router[_0xeadb('0x6')](_0xeadb('0xa'),auth[_0xeadb('0x8')](),controller[_0xeadb('0xb')]);router['post']('/',auth[_0xeadb('0x8')](),controller[_0xeadb('0xc')]);router[_0xeadb('0xd')](_0xeadb('0xa'),auth[_0xeadb('0x8')](),controller[_0xeadb('0xe')]);router['delete']('/:id',auth[_0xeadb('0x8')](),controller['destroy']);module[_0xeadb('0xf')]=router; \ No newline at end of file +var _0x8ec0=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','util'];(function(_0x302866,_0x59a9cf){var _0x129112=function(_0x3bc39f){while(--_0x3bc39f){_0x302866['push'](_0x302866['shift']());}};_0x129112(++_0x59a9cf);}(_0x8ec0,0xa7));var _0x08ec=function(_0x488aa7,_0x19ed0f){_0x488aa7=_0x488aa7-0x0;var _0x28db0d=_0x8ec0[_0x488aa7];return _0x28db0d;};'use strict';var multer=require('multer');var util=require(_0x08ec('0x0'));var path=require(_0x08ec('0x1'));var timeout=require('connect-timeout');var express=require(_0x08ec('0x2'));var router=express[_0x08ec('0x3')]();var fs_extra=require(_0x08ec('0x4'));var auth=require(_0x08ec('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x08ec('0x6'));var controller=require(_0x08ec('0x7'));router[_0x08ec('0x8')]('/',auth[_0x08ec('0x9')](),controller[_0x08ec('0xa')]);router[_0x08ec('0x8')](_0x08ec('0xb'),auth[_0x08ec('0x9')](),controller[_0x08ec('0xc')]);router[_0x08ec('0x8')](_0x08ec('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x08ec('0xe')]('/',auth[_0x08ec('0x9')](),controller[_0x08ec('0xf')]);router[_0x08ec('0x10')](_0x08ec('0xd'),auth['isAuthenticated'](),controller[_0x08ec('0x11')]);router[_0x08ec('0x12')](_0x08ec('0xd'),auth[_0x08ec('0x9')](),controller[_0x08ec('0x13')]);module[_0x08ec('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index d8685b7..ef4e67b 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 _0x9354=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','exports','STRING','INTEGER'];(function(_0x11e05d,_0x3a4491){var _0x335588=function(_0x35ec3f){while(--_0x35ec3f){_0x11e05d['push'](_0x11e05d['shift']());}};_0x335588(++_0x3a4491);}(_0x9354,0x96));var _0x4935=function(_0x70bb8,_0x1da278){_0x70bb8=_0x70bb8-0x0;var _0x48ba84=_0x9354[_0x70bb8];return _0x48ba84;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'name':{'type':Sequelize[_0x4935('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4935('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4935('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4935('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4935('0x1')],'set':function(_0x5327fc){this[_0x4935('0x4')](_0x4935('0x5'),_0x5327fc?_0x5327fc[_0x4935('0x6')](''):[]);},'get':function(){return this[_0x4935('0x7')](_0x4935('0x5'))?this[_0x4935('0x7')](_0x4935('0x5'))[_0x4935('0x8')](''):[];}}}; \ No newline at end of file +var _0xb688=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','split','exports'];(function(_0x4c80f9,_0x423956){var _0x2e4401=function(_0x1e37ca){while(--_0x1e37ca){_0x4c80f9['push'](_0x4c80f9['shift']());}};_0x2e4401(++_0x423956);}(_0xb688,0xcf));var _0x8b68=function(_0x136b92,_0x113b9d){_0x136b92=_0x136b92-0x0;var _0x67cf46=_0xb688[_0x136b92];return _0x67cf46;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'name':{'type':Sequelize[_0x8b68('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x8b68('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x8b68('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x8b68('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x8b68('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x41030e){this[_0x8b68('0x4')](_0x8b68('0x5'),_0x41030e?_0x41030e[_0x8b68('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x8b68('0x5'))?this['getDataValue'](_0x8b68('0x5'))[_0x8b68('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 6e68c4d..80ac5d8 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 _0xe137=['rows','params','intersection','length','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','save','update','destroy','error','name','send','map','UserProfileSection','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','then'];(function(_0x421483,_0x3ab41e){var _0xc00e78=function(_0x410052){while(--_0x410052){_0x421483['push'](_0x421483['shift']());}};_0xc00e78(++_0x3ab41e);}(_0xe137,0x9d));var _0x7e13=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0xe137[_0x172133];return _0x2460e5;};'use strict';var emlformat=require(_0x7e13('0x0'));var rimraf=require(_0x7e13('0x1'));var zipdir=require(_0x7e13('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e13('0x3'));var moment=require(_0x7e13('0x4'));var BPromise=require(_0x7e13('0x5'));var Mustache=require(_0x7e13('0x6'));var util=require(_0x7e13('0x7'));var path=require(_0x7e13('0x8'));var sox=require(_0x7e13('0x9'));var csv=require(_0x7e13('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e13('0xb'));var _=require(_0x7e13('0xc'));var squel=require(_0x7e13('0xd'));var crypto=require('crypto');var jsforce=require(_0x7e13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7e13('0xa'));var querystring=require(_0x7e13('0xf'));var Papa=require('papaparse');var Redis=require(_0x7e13('0x10'));var authService=require(_0x7e13('0x11'));var qs=require(_0x7e13('0x12'));var as=require(_0x7e13('0x13'));var hardwareService=require(_0x7e13('0x14'));var logger=require(_0x7e13('0x15'))(_0x7e13('0x16'));var utils=require(_0x7e13('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d6502,_0x180523){_0x180523=_0x180523||0xcc;return function(_0x75d343){if(_0x75d343){return _0x1d6502[_0x7e13('0x18')](_0x180523);}return _0x1d6502['status'](_0x180523)[_0x7e13('0x19')]();};}function respondWithResult(_0x1ba0f9,_0x37d347){_0x37d347=_0x37d347||0xc8;return function(_0x41bc83){if(_0x41bc83){return _0x1ba0f9[_0x7e13('0x1a')](_0x37d347)[_0x7e13('0x1b')](_0x41bc83);}};}function respondWithFilteredResult(_0xe8c46e,_0x27e3f6){return function(_0x30ce8e){if(_0x30ce8e){var _0x4b198c=typeof _0x27e3f6[_0x7e13('0x1c')]==='undefined'&&typeof _0x27e3f6[_0x7e13('0x1d')]===_0x7e13('0x1e');var _0x4ee168=_0x30ce8e[_0x7e13('0x1f')];var _0x5d0df5=_0x4b198c?0x0:_0x27e3f6[_0x7e13('0x1c')];var _0x287a69=_0x4b198c?_0x30ce8e[_0x7e13('0x1f')]:_0x27e3f6[_0x7e13('0x1c')]+_0x27e3f6[_0x7e13('0x1d')];var _0x1b38b5;if(_0x287a69>=_0x4ee168){_0x287a69=_0x4ee168;_0x1b38b5=0xc8;}else{_0x1b38b5=0xce;}_0xe8c46e['status'](_0x1b38b5);return _0xe8c46e[_0x7e13('0x20')](_0x7e13('0x21'),_0x5d0df5+'-'+_0x287a69+'/'+_0x4ee168)[_0x7e13('0x1b')](_0x30ce8e);}return null;};}function patchUpdates(_0x40f114){return function(_0x36a030){try{jsonpatch['apply'](_0x36a030,_0x40f114,!![]);}catch(_0x39afc0){return BPromise['reject'](_0x39afc0);}return _0x36a030[_0x7e13('0x22')]();};}function saveUpdates(_0x4618d5,_0x1c11bb){return function(_0xbb807a){if(_0xbb807a){return _0xbb807a[_0x7e13('0x23')](_0x4618d5)['then'](function(_0x4d8b17){return _0x4d8b17;});}return null;};}function removeEntity(_0xde2537,_0x4c5d45){return function(_0x1f757a){if(_0x1f757a){return _0x1f757a[_0x7e13('0x24')]()['then'](function(){_0xde2537[_0x7e13('0x1a')](0xcc)[_0x7e13('0x19')]();});}};}function handleEntityNotFound(_0x2df402,_0x1f4e85){return function(_0x2f0d63){if(!_0x2f0d63){_0x2df402[_0x7e13('0x18')](0x194);}return _0x2f0d63;};}function handleError(_0x386aaf,_0x412d78){_0x412d78=_0x412d78||0x1f4;return function(_0xd3a245){logger[_0x7e13('0x25')](_0xd3a245['stack']);if(_0xd3a245[_0x7e13('0x26')]){delete _0xd3a245[_0x7e13('0x26')];}_0x386aaf['status'](_0x412d78)[_0x7e13('0x27')](_0xd3a245);};}exports['index']=function(_0xefb0f9,_0x529ccc){var _0x231757={},_0x1125fc={},_0x1ccae8={'count':0x0,'rows':[]};var _0x35c998=_[_0x7e13('0x28')](db[_0x7e13('0x29')]['rawAttributes'],function(_0x562531){return{'name':_0x562531[_0x7e13('0x2a')],'type':_0x562531[_0x7e13('0x2b')][_0x7e13('0x2c')]};});_0x1125fc[_0x7e13('0x2d')]=_[_0x7e13('0x28')](_0x35c998,_0x7e13('0x26'));_0x1125fc[_0x7e13('0x2e')]=_[_0x7e13('0x2f')](_0xefb0f9[_0x7e13('0x2e')]);_0x1125fc[_0x7e13('0x30')]=_['intersection'](_0x1125fc[_0x7e13('0x2d')],_0x1125fc[_0x7e13('0x2e')]);_0x231757[_0x7e13('0x31')]=_['intersection'](_0x1125fc[_0x7e13('0x2d')],qs[_0x7e13('0x32')](_0xefb0f9[_0x7e13('0x2e')][_0x7e13('0x32')]));_0x231757[_0x7e13('0x31')]=_0x231757['attributes']['length']?_0x231757['attributes']:_0x1125fc['model'];if(!_0xefb0f9[_0x7e13('0x2e')][_0x7e13('0x33')](_0x7e13('0x34'))){_0x231757['limit']=qs['limit'](_0xefb0f9[_0x7e13('0x2e')][_0x7e13('0x1d')]);_0x231757[_0x7e13('0x1c')]=qs[_0x7e13('0x1c')](_0xefb0f9[_0x7e13('0x2e')][_0x7e13('0x1c')]);}_0x231757[_0x7e13('0x35')]=qs[_0x7e13('0x36')](_0xefb0f9[_0x7e13('0x2e')][_0x7e13('0x36')]);_0x231757['where']=qs['filters'](_[_0x7e13('0x37')](_0xefb0f9[_0x7e13('0x2e')],_0x1125fc[_0x7e13('0x30')]),_0x35c998);if(_0xefb0f9[_0x7e13('0x2e')]['filter']){_0x231757[_0x7e13('0x38')]=_[_0x7e13('0x39')](_0x231757[_0x7e13('0x38')],{'$or':_[_0x7e13('0x28')](_0x35c998,function(_0x117160){if(_0x117160[_0x7e13('0x2b')]!==_0x7e13('0x3a')){var _0x3c44a0={};_0x3c44a0[_0x117160[_0x7e13('0x26')]]={'$like':'%'+_0xefb0f9['query'][_0x7e13('0x3b')]+'%'};return _0x3c44a0;}})});}_0x231757=_['merge']({},_0x231757,_0xefb0f9[_0x7e13('0x3c')]);var _0x58216d={'where':_0x231757[_0x7e13('0x38')]};return db[_0x7e13('0x29')][_0x7e13('0x1f')](_0x58216d)['then'](function(_0x32bbfc){_0x1ccae8[_0x7e13('0x1f')]=_0x32bbfc;if(_0xefb0f9[_0x7e13('0x2e')][_0x7e13('0x3d')]){_0x231757[_0x7e13('0x3e')]=[{'all':!![]}];}return db[_0x7e13('0x29')][_0x7e13('0x3f')](_0x231757);})[_0x7e13('0x40')](function(_0x1c2503){_0x1ccae8[_0x7e13('0x41')]=_0x1c2503;return _0x1ccae8;})['then'](respondWithFilteredResult(_0x529ccc,_0x231757))['catch'](handleError(_0x529ccc,null));};exports['show']=function(_0x40e949,_0x4f8ba5){var _0x1b0021={'raw':![],'where':{'id':_0x40e949[_0x7e13('0x42')]['id']}},_0x187a7b={};_0x187a7b[_0x7e13('0x2d')]=_[_0x7e13('0x2f')](db[_0x7e13('0x29')]['rawAttributes']);_0x187a7b[_0x7e13('0x2e')]=_[_0x7e13('0x2f')](_0x40e949[_0x7e13('0x2e')]);_0x187a7b[_0x7e13('0x30')]=_['intersection'](_0x187a7b[_0x7e13('0x2d')],_0x187a7b[_0x7e13('0x2e')]);_0x1b0021['attributes']=_[_0x7e13('0x43')](_0x187a7b[_0x7e13('0x2d')],qs[_0x7e13('0x32')](_0x40e949[_0x7e13('0x2e')]['fields']));_0x1b0021[_0x7e13('0x31')]=_0x1b0021[_0x7e13('0x31')][_0x7e13('0x44')]?_0x1b0021[_0x7e13('0x31')]:_0x187a7b[_0x7e13('0x2d')];if(_0x40e949['query'][_0x7e13('0x3d')]){_0x1b0021[_0x7e13('0x3e')]=[{'all':!![]}];}_0x1b0021=_[_0x7e13('0x39')]({},_0x1b0021,_0x40e949[_0x7e13('0x3c')]);return db[_0x7e13('0x29')][_0x7e13('0x45')](_0x1b0021)[_0x7e13('0x40')](handleEntityNotFound(_0x4f8ba5,null))[_0x7e13('0x40')](respondWithResult(_0x4f8ba5,null))[_0x7e13('0x46')](handleError(_0x4f8ba5,null));};exports[_0x7e13('0x47')]=function(_0x3a651a,_0x137574){return db['UserProfileSection'][_0x7e13('0x47')](_0x3a651a[_0x7e13('0x48')],{})[_0x7e13('0x40')](respondWithResult(_0x137574,0xc9))[_0x7e13('0x46')](handleError(_0x137574,null));};exports[_0x7e13('0x23')]=function(_0x204b7b,_0x467dd0){if(_0x204b7b['body']['id']){delete _0x204b7b['body']['id'];}return db[_0x7e13('0x29')][_0x7e13('0x45')]({'where':{'id':_0x204b7b[_0x7e13('0x42')]['id']}})[_0x7e13('0x40')](handleEntityNotFound(_0x467dd0,null))[_0x7e13('0x40')](saveUpdates(_0x204b7b['body'],null))['then'](respondWithResult(_0x467dd0,null))[_0x7e13('0x46')](handleError(_0x467dd0,null));};exports[_0x7e13('0x24')]=function(_0xf5078f,_0x76e513){return db[_0x7e13('0x29')][_0x7e13('0x45')]({'where':{'id':_0xf5078f['params']['id']}})[_0x7e13('0x40')](handleEntityNotFound(_0x76e513,null))[_0x7e13('0x40')](removeEntity(_0x76e513,null))[_0x7e13('0x46')](handleError(_0x76e513,null));};exports['describe']=function(_0x35db8c,_0x2b9259){return db['UserProfileSection'][_0x7e13('0x49')]()[_0x7e13('0x40')](respondWithResult(_0x2b9259,null))[_0x7e13('0x46')](handleError(_0x2b9259,null));}; \ No newline at end of file +var _0x0210=['status','json','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','stack','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','name','merge','options','include','rows','show','length','create','body','catch','params','describe','eml-format','zip-dir','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x41b0a8,_0x1b05cc){var _0x3a83d4=function(_0x3d1011){while(--_0x3d1011){_0x41b0a8['push'](_0x41b0a8['shift']());}};_0x3a83d4(++_0x1b05cc);}(_0x0210,0x104));var _0x0021=function(_0x46bb60,_0x5abf16){_0x46bb60=_0x46bb60-0x0;var _0x2b23a8=_0x0210[_0x46bb60];return _0x2b23a8;};'use strict';var emlformat=require(_0x0021('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0021('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0021('0x2'));var BPromise=require(_0x0021('0x3'));var Mustache=require('mustache');var util=require(_0x0021('0x4'));var path=require('path');var sox=require(_0x0021('0x5'));var csv=require(_0x0021('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0021('0x7'));var squel=require(_0x0021('0x8'));var crypto=require(_0x0021('0x9'));var jsforce=require(_0x0021('0xa'));var deskjs=require(_0x0021('0xb'));var toCsv=require(_0x0021('0x6'));var querystring=require(_0x0021('0xc'));var Papa=require(_0x0021('0xd'));var Redis=require(_0x0021('0xe'));var authService=require(_0x0021('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0021('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0021('0x11'))(_0x0021('0x12'));var utils=require('../../config/utils');var config=require(_0x0021('0x13'));var licenseUtil=require(_0x0021('0x14'));var db=require(_0x0021('0x15'))['db'];function respondWithStatusCode(_0x2360ab,_0x57d037){_0x57d037=_0x57d037||0xcc;return function(_0x3bedb5){if(_0x3bedb5){return _0x2360ab[_0x0021('0x16')](_0x57d037);}return _0x2360ab['status'](_0x57d037)[_0x0021('0x17')]();};}function respondWithResult(_0x51b9df,_0x55bed3){_0x55bed3=_0x55bed3||0xc8;return function(_0x572913){if(_0x572913){return _0x51b9df[_0x0021('0x18')](_0x55bed3)[_0x0021('0x19')](_0x572913);}};}function respondWithFilteredResult(_0x455f50,_0x533473){return function(_0x1f2160){if(_0x1f2160){var _0x5518a7=typeof _0x533473['offset']==='undefined'&&typeof _0x533473[_0x0021('0x1a')]===_0x0021('0x1b');var _0x40ca0b=_0x1f2160[_0x0021('0x1c')];var _0x270d8b=_0x5518a7?0x0:_0x533473['offset'];var _0x1c5e12=_0x5518a7?_0x1f2160[_0x0021('0x1c')]:_0x533473['offset']+_0x533473[_0x0021('0x1a')];var _0x403ae4;if(_0x1c5e12>=_0x40ca0b){_0x1c5e12=_0x40ca0b;_0x403ae4=0xc8;}else{_0x403ae4=0xce;}_0x455f50['status'](_0x403ae4);return _0x455f50[_0x0021('0x1d')](_0x0021('0x1e'),_0x270d8b+'-'+_0x1c5e12+'/'+_0x40ca0b)[_0x0021('0x19')](_0x1f2160);}return null;};}function patchUpdates(_0x3aa633){return function(_0x4d1476){try{jsonpatch['apply'](_0x4d1476,_0x3aa633,!![]);}catch(_0xa1ede0){return BPromise[_0x0021('0x1f')](_0xa1ede0);}return _0x4d1476[_0x0021('0x20')]();};}function saveUpdates(_0x1ea677,_0x1d1d64){return function(_0x2582c3){if(_0x2582c3){return _0x2582c3[_0x0021('0x21')](_0x1ea677)[_0x0021('0x22')](function(_0x504877){return _0x504877;});}return null;};}function removeEntity(_0x3add91,_0x2e8177){return function(_0x38b8b5){if(_0x38b8b5){return _0x38b8b5[_0x0021('0x23')]()[_0x0021('0x22')](function(){_0x3add91[_0x0021('0x18')](0xcc)[_0x0021('0x17')]();});}};}function handleEntityNotFound(_0x39e7ff,_0xa4605d){return function(_0x3b061c){if(!_0x3b061c){_0x39e7ff[_0x0021('0x16')](0x194);}return _0x3b061c;};}function handleError(_0x5b837d,_0x54d2d2){_0x54d2d2=_0x54d2d2||0x1f4;return function(_0x547be3){logger['error'](_0x547be3[_0x0021('0x24')]);if(_0x547be3['name']){delete _0x547be3['name'];}_0x5b837d[_0x0021('0x18')](_0x54d2d2)['send'](_0x547be3);};}exports[_0x0021('0x25')]=function(_0x48a0f0,_0x1d1203){var _0x1320ef={},_0x26199a={},_0x2c2892={'count':0x0,'rows':[]};var _0x1bba2c=_[_0x0021('0x26')](db[_0x0021('0x27')][_0x0021('0x28')],function(_0x170c3b){return{'name':_0x170c3b[_0x0021('0x29')],'type':_0x170c3b[_0x0021('0x2a')][_0x0021('0x2b')]};});_0x26199a[_0x0021('0x2c')]=_[_0x0021('0x26')](_0x1bba2c,'name');_0x26199a['query']=_[_0x0021('0x2d')](_0x48a0f0[_0x0021('0x2e')]);_0x26199a[_0x0021('0x2f')]=_[_0x0021('0x30')](_0x26199a['model'],_0x26199a[_0x0021('0x2e')]);_0x1320ef['attributes']=_['intersection'](_0x26199a['model'],qs[_0x0021('0x31')](_0x48a0f0[_0x0021('0x2e')][_0x0021('0x31')]));_0x1320ef[_0x0021('0x32')]=_0x1320ef[_0x0021('0x32')]['length']?_0x1320ef[_0x0021('0x32')]:_0x26199a[_0x0021('0x2c')];if(!_0x48a0f0[_0x0021('0x2e')][_0x0021('0x33')](_0x0021('0x34'))){_0x1320ef[_0x0021('0x1a')]=qs[_0x0021('0x1a')](_0x48a0f0['query'][_0x0021('0x1a')]);_0x1320ef[_0x0021('0x35')]=qs[_0x0021('0x35')](_0x48a0f0[_0x0021('0x2e')][_0x0021('0x35')]);}_0x1320ef[_0x0021('0x36')]=qs['sort'](_0x48a0f0[_0x0021('0x2e')][_0x0021('0x37')]);_0x1320ef['where']=qs[_0x0021('0x2f')](_[_0x0021('0x38')](_0x48a0f0['query'],_0x26199a['filters']),_0x1bba2c);if(_0x48a0f0['query'][_0x0021('0x39')]){_0x1320ef[_0x0021('0x3a')]=_['merge'](_0x1320ef[_0x0021('0x3a')],{'$or':_[_0x0021('0x26')](_0x1bba2c,function(_0x55684a){if(_0x55684a['type']!=='VIRTUAL'){var _0x4c472a={};_0x4c472a[_0x55684a[_0x0021('0x3b')]]={'$like':'%'+_0x48a0f0['query'][_0x0021('0x39')]+'%'};return _0x4c472a;}})});}_0x1320ef=_[_0x0021('0x3c')]({},_0x1320ef,_0x48a0f0[_0x0021('0x3d')]);var _0x314141={'where':_0x1320ef[_0x0021('0x3a')]};return db[_0x0021('0x27')]['count'](_0x314141)[_0x0021('0x22')](function(_0x58d058){_0x2c2892[_0x0021('0x1c')]=_0x58d058;if(_0x48a0f0[_0x0021('0x2e')]['includeAll']){_0x1320ef[_0x0021('0x3e')]=[{'all':!![]}];}return db[_0x0021('0x27')]['findAll'](_0x1320ef);})[_0x0021('0x22')](function(_0x4377dd){_0x2c2892[_0x0021('0x3f')]=_0x4377dd;return _0x2c2892;})[_0x0021('0x22')](respondWithFilteredResult(_0x1d1203,_0x1320ef))['catch'](handleError(_0x1d1203,null));};exports[_0x0021('0x40')]=function(_0x39b79d,_0x4d6338){var _0x17f791={'raw':![],'where':{'id':_0x39b79d['params']['id']}},_0x2305e1={};_0x2305e1[_0x0021('0x2c')]=_[_0x0021('0x2d')](db['UserProfileSection'][_0x0021('0x28')]);_0x2305e1[_0x0021('0x2e')]=_[_0x0021('0x2d')](_0x39b79d[_0x0021('0x2e')]);_0x2305e1['filters']=_[_0x0021('0x30')](_0x2305e1[_0x0021('0x2c')],_0x2305e1[_0x0021('0x2e')]);_0x17f791[_0x0021('0x32')]=_['intersection'](_0x2305e1[_0x0021('0x2c')],qs[_0x0021('0x31')](_0x39b79d['query'][_0x0021('0x31')]));_0x17f791[_0x0021('0x32')]=_0x17f791[_0x0021('0x32')][_0x0021('0x41')]?_0x17f791[_0x0021('0x32')]:_0x2305e1[_0x0021('0x2c')];if(_0x39b79d[_0x0021('0x2e')]['includeAll']){_0x17f791[_0x0021('0x3e')]=[{'all':!![]}];}_0x17f791=_[_0x0021('0x3c')]({},_0x17f791,_0x39b79d[_0x0021('0x3d')]);return db['UserProfileSection']['find'](_0x17f791)[_0x0021('0x22')](handleEntityNotFound(_0x4d6338,null))[_0x0021('0x22')](respondWithResult(_0x4d6338,null))['catch'](handleError(_0x4d6338,null));};exports[_0x0021('0x42')]=function(_0x43455d,_0x3087fa){return db[_0x0021('0x27')]['create'](_0x43455d[_0x0021('0x43')],{})[_0x0021('0x22')](respondWithResult(_0x3087fa,0xc9))[_0x0021('0x44')](handleError(_0x3087fa,null));};exports[_0x0021('0x21')]=function(_0x1a1bed,_0x493bb6){if(_0x1a1bed['body']['id']){delete _0x1a1bed[_0x0021('0x43')]['id'];}return db[_0x0021('0x27')]['find']({'where':{'id':_0x1a1bed[_0x0021('0x45')]['id']}})[_0x0021('0x22')](handleEntityNotFound(_0x493bb6,null))[_0x0021('0x22')](saveUpdates(_0x1a1bed['body'],null))[_0x0021('0x22')](respondWithResult(_0x493bb6,null))[_0x0021('0x44')](handleError(_0x493bb6,null));};exports['destroy']=function(_0x3dbb53,_0x1cec93){return db[_0x0021('0x27')]['find']({'where':{'id':_0x3dbb53['params']['id']}})[_0x0021('0x22')](handleEntityNotFound(_0x1cec93,null))[_0x0021('0x22')](removeEntity(_0x1cec93,null))['catch'](handleError(_0x1cec93,null));};exports[_0x0021('0x46')]=function(_0x40386e,_0x4475a3){return db[_0x0021('0x27')][_0x0021('0x46')]()[_0x0021('0x22')](respondWithResult(_0x4475a3,null))['catch'](handleError(_0x4475a3,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 5990dee..648b466 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 _0x5767=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./userProfileSection.attributes','define','compositeIndex','sectionId','lodash'];(function(_0x159a82,_0x1edd0c){var _0x188272=function(_0x5b54c3){while(--_0x5b54c3){_0x159a82['push'](_0x159a82['shift']());}};_0x188272(++_0x1edd0c);}(_0x5767,0x77));var _0x7576=function(_0x4e7c03,_0x29ffcf){_0x4e7c03=_0x4e7c03-0x0;var _0x5510d3=_0x5767[_0x4e7c03];return _0x5510d3;};'use strict';var _=require(_0x7576('0x0'));var util=require(_0x7576('0x1'));var logger=require(_0x7576('0x2'))(_0x7576('0x3'));var moment=require('moment');var BPromise=require(_0x7576('0x4'));var rp=require(_0x7576('0x5'));var fs=require('fs');var path=require(_0x7576('0x6'));var rimraf=require('rimraf');var config=require(_0x7576('0x7'));var attributes=require(_0x7576('0x8'));module['exports']=function(_0x42ebad,_0x37268d){return _0x42ebad[_0x7576('0x9')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x7576('0xa'),'fields':[_0x7576('0xb'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7cb2=['moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','compositeIndex','userProfileId','util','api'];(function(_0x403f23,_0x48c483){var _0x5877cd=function(_0x4c21e4){while(--_0x4c21e4){_0x403f23['push'](_0x403f23['shift']());}};_0x5877cd(++_0x48c483);}(_0x7cb2,0xbe));var _0x27cb=function(_0x36239f,_0x243bff){_0x36239f=_0x36239f-0x0;var _0x259d5d=_0x7cb2[_0x36239f];return _0x259d5d;};'use strict';var _=require('lodash');var util=require(_0x27cb('0x0'));var logger=require('../../config/logger')(_0x27cb('0x1'));var moment=require(_0x27cb('0x2'));var BPromise=require(_0x27cb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27cb('0x4'));var rimraf=require(_0x27cb('0x5'));var config=require(_0x27cb('0x6'));var attributes=require(_0x27cb('0x7'));module[_0x27cb('0x8')]=function(_0x85a671,_0x2fe0d6){return _0x85a671[_0x27cb('0x9')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x27cb('0xa'),'fields':['sectionId',_0x27cb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index e698a60..8861ebf 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 _0xb2b2=['debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x144cbe,_0x2f0567){var _0x135df1=function(_0x531a8f){while(--_0x531a8f){_0x144cbe['push'](_0x144cbe['shift']());}};_0x135df1(++_0x2f0567);}(_0xb2b2,0x7b));var _0x2b2b=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xb2b2[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x2b2b('0x0'));var util=require('util');var moment=require(_0x2b2b('0x1'));var BPromise=require('bluebird');var rs=require(_0x2b2b('0x2'));var fs=require('fs');var Redis=require(_0x2b2b('0x3'));var db=require(_0x2b2b('0x4'))['db'];var utils=require(_0x2b2b('0x5'));var logger=require('../../config/logger')(_0x2b2b('0x6'));var config=require(_0x2b2b('0x7'));var jayson=require(_0x2b2b('0x8'));var client=jayson[_0x2b2b('0x9')][_0x2b2b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2182ae,_0x118e08,_0x37db6d){return new BPromise(function(_0x5629a4,_0x1d39d0){return client[_0x2b2b('0xb')](_0x2182ae,_0x37db6d)[_0x2b2b('0xc')](function(_0x5ec322){logger[_0x2b2b('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x118e08,_0x2b2b('0xe'));logger[_0x2b2b('0xf')](_0x2b2b('0x10'),_0x118e08,_0x2b2b('0xe'),JSON[_0x2b2b('0x11')](_0x5ec322));if(_0x5ec322[_0x2b2b('0x12')]){if(_0x5ec322['error'][_0x2b2b('0x13')]===0x1f4){logger[_0x2b2b('0x12')](_0x2b2b('0x14'),_0x118e08,_0x5ec322[_0x2b2b('0x12')][_0x2b2b('0x15')]);return _0x1d39d0(_0x5ec322[_0x2b2b('0x12')][_0x2b2b('0x15')]);}logger[_0x2b2b('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x118e08,_0x5ec322[_0x2b2b('0x12')][_0x2b2b('0x15')]);return _0x5629a4(_0x5ec322[_0x2b2b('0x12')][_0x2b2b('0x15')]);}else{logger['info'](_0x2b2b('0x14'),_0x118e08,_0x2b2b('0xe'));_0x5629a4(_0x5ec322['result'][_0x2b2b('0x15')]);}})[_0x2b2b('0x16')](function(_0x3aa329){logger[_0x2b2b('0x12')](_0x2b2b('0x14'),_0x118e08,_0x3aa329);_0x1d39d0(_0x3aa329);});});} \ No newline at end of file +var _0x7047=['rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3fac43,_0x3e9028){var _0x3a0251=function(_0x390230){while(--_0x390230){_0x3fac43['push'](_0x3fac43['shift']());}};_0x3a0251(++_0x3e9028);}(_0x7047,0x10d));var _0x7704=function(_0x336bde,_0x1fb530){_0x336bde=_0x336bde-0x0;var _0x451243=_0x7047[_0x336bde];return _0x451243;};'use strict';var _=require(_0x7704('0x0'));var util=require(_0x7704('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7704('0x2'));var fs=require('fs');var Redis=require(_0x7704('0x3'));var db=require(_0x7704('0x4'))['db'];var utils=require(_0x7704('0x5'));var logger=require(_0x7704('0x6'))(_0x7704('0x7'));var config=require(_0x7704('0x8'));var jayson=require(_0x7704('0x9'));var client=jayson[_0x7704('0xa')][_0x7704('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43caab,_0x561718,_0x595367){return new BPromise(function(_0x14998d,_0x37cd9b){return client['request'](_0x43caab,_0x595367)[_0x7704('0xc')](function(_0x2449fa){logger[_0x7704('0xd')](_0x7704('0xe'),_0x561718,'request\x20sent');logger['debug'](_0x7704('0xf'),_0x561718,_0x7704('0x10'),JSON[_0x7704('0x11')](_0x2449fa));if(_0x2449fa[_0x7704('0x12')]){if(_0x2449fa[_0x7704('0x12')][_0x7704('0x13')]===0x1f4){logger[_0x7704('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x561718,_0x2449fa[_0x7704('0x12')]['message']);return _0x37cd9b(_0x2449fa[_0x7704('0x12')][_0x7704('0x14')]);}logger['error'](_0x7704('0xe'),_0x561718,_0x2449fa['error'][_0x7704('0x14')]);return _0x14998d(_0x2449fa[_0x7704('0x12')][_0x7704('0x14')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x561718,'request\x20sent');_0x14998d(_0x2449fa[_0x7704('0x15')][_0x7704('0x14')]);}})[_0x7704('0x16')](function(_0xd107a){logger[_0x7704('0x12')](_0x7704('0xe'),_0x561718,_0xd107a);_0x37cd9b(_0xd107a);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 425d937..727e60b 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xfdcd,_0xaf500c){var _0x4f65b0=function(_0x35b57b){while(--_0x35b57b){_0xfdcd['push'](_0xfdcd['shift']());}};_0x4f65b0(++_0xaf500c);}(_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(_0x5cdae9,_0x5e30a9){var _0x417701=function(_0x3e0142){while(--_0x3e0142){_0x5cdae9['push'](_0x5cdae9['shift']());}};_0x417701(++_0x5e30a9);}(_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 diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 07df49a..9f7a856 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 _0x61d2=['INTEGER','sequelize','exports'];(function(_0x12384f,_0x5eef4d){var _0xb4e98d=function(_0x44428b){while(--_0x44428b){_0x12384f['push'](_0x12384f['shift']());}};_0xb4e98d(++_0x5eef4d);}(_0x61d2,0x13c));var _0x261d=function(_0x513ed2,_0x51efb4){_0x513ed2=_0x513ed2-0x0;var _0x3f8b34=_0x61d2[_0x513ed2];return _0x3f8b34;};'use strict';var Sequelize=require(_0x261d('0x0'));module[_0x261d('0x1')]={'penalty':{'type':Sequelize[_0x261d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4971=['sequelize','INTEGER'];(function(_0xd02def,_0x144f25){var _0x2e8374=function(_0x5ceb35){while(--_0x5ceb35){_0xd02def['push'](_0xd02def['shift']());}};_0x2e8374(++_0x144f25);}(_0x4971,0xa4));var _0x1497=function(_0x5b26d1,_0x363a3d){_0x5b26d1=_0x5b26d1-0x0;var _0x940da3=_0x4971[_0x5b26d1];return _0x940da3;};'use strict';var Sequelize=require(_0x1497('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1497('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 2dd608e..655d68c 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 _0x4819=['user_has_sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','UserSmsQueue'];(function(_0x20c1ec,_0x13c071){var _0x193a91=function(_0x1abc11){while(--_0x1abc11){_0x20c1ec['push'](_0x20c1ec['shift']());}};_0x193a91(++_0x13c071);}(_0x4819,0xcd));var _0x9481=function(_0x4de8f9,_0xde3981){_0x4de8f9=_0x4de8f9-0x0;var _0x472379=_0x4819[_0x4de8f9];return _0x472379;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1623=['lodash','api','moment','bluebird','request-promise','path','./userSmsQueue.attributes','UserSmsQueue','user_has_sms_queues'];(function(_0x240d22,_0x3fec05){var _0x215044=function(_0x36a5e4){while(--_0x36a5e4){_0x240d22['push'](_0x240d22['shift']());}};_0x215044(++_0x3fec05);}(_0x1623,0xab));var _0x3162=function(_0x38f592,_0xcff281){_0x38f592=_0x38f592-0x0;var _0x21b6a1=_0x1623[_0x38f592];return _0x21b6a1;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3162('0x1'));var moment=require(_0x3162('0x2'));var BPromise=require(_0x3162('0x3'));var rp=require(_0x3162('0x4'));var fs=require('fs');var path=require(_0x3162('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3162('0x6'));module['exports']=function(_0x1b55f2,_0x428de6){return _0x1b55f2['define'](_0x3162('0x7'),attributes,{'tableName':_0x3162('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 b7d37aa..04c8753 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 _0x2e7d=['../../config/utils','../../config/logger','rpc','client','http','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x2e7d,0x1c3));var _0xd2e7=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x2e7d[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0xd2e7('0x0'));var util=require('util');var moment=require(_0xd2e7('0x1'));var BPromise=require(_0xd2e7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2e7('0x3'));var db=require(_0xd2e7('0x4'))['db'];var utils=require(_0xd2e7('0x5'));var logger=require(_0xd2e7('0x6'))(_0xd2e7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd2e7('0x8')][_0xd2e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd20bc0,_0x535cc6,_0x44e17b){return new BPromise(function(_0x519a27,_0x59c948){return client[_0xd2e7('0xa')](_0xd20bc0,_0x44e17b)[_0xd2e7('0xb')](function(_0x1d10fa){logger['info'](_0xd2e7('0xc'),_0x535cc6,_0xd2e7('0xd'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x535cc6,_0xd2e7('0xd'),JSON[_0xd2e7('0xe')](_0x1d10fa));if(_0x1d10fa[_0xd2e7('0xf')]){if(_0x1d10fa[_0xd2e7('0xf')]['code']===0x1f4){logger[_0xd2e7('0xf')](_0xd2e7('0xc'),_0x535cc6,_0x1d10fa[_0xd2e7('0xf')][_0xd2e7('0x10')]);return _0x59c948(_0x1d10fa[_0xd2e7('0xf')]['message']);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x535cc6,_0x1d10fa[_0xd2e7('0xf')][_0xd2e7('0x10')]);return _0x519a27(_0x1d10fa[_0xd2e7('0xf')][_0xd2e7('0x10')]);}else{logger['info'](_0xd2e7('0xc'),_0x535cc6,_0xd2e7('0xd'));_0x519a27(_0x1d10fa[_0xd2e7('0x11')][_0xd2e7('0x10')]);}})[_0xd2e7('0x12')](function(_0x24ac15){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x535cc6,_0x24ac15);_0x59c948(_0x24ac15);});});} \ No newline at end of file +var _0x3d16=['lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x1e524a,_0x18bb89){var _0x2e410d=function(_0xe10f90){while(--_0xe10f90){_0x1e524a['push'](_0x1e524a['shift']());}};_0x2e410d(++_0x18bb89);}(_0x3d16,0x18c));var _0x63d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d16[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x63d1('0x0'));var util=require(_0x63d1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x63d1('0x2'));var db=require(_0x63d1('0x3'))['db'];var utils=require(_0x63d1('0x4'));var logger=require(_0x63d1('0x5'))(_0x63d1('0x6'));var config=require(_0x63d1('0x7'));var jayson=require(_0x63d1('0x8'));var client=jayson['client'][_0x63d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x355ebd,_0x4c95d4,_0x1cb392){return new BPromise(function(_0x5ea21a,_0x266803){return client['request'](_0x355ebd,_0x1cb392)[_0x63d1('0xa')](function(_0x307cc3){logger['info'](_0x63d1('0xb'),_0x4c95d4,_0x63d1('0xc'));logger[_0x63d1('0xd')](_0x63d1('0xe'),_0x4c95d4,_0x63d1('0xc'),JSON[_0x63d1('0xf')](_0x307cc3));if(_0x307cc3[_0x63d1('0x10')]){if(_0x307cc3[_0x63d1('0x10')][_0x63d1('0x11')]===0x1f4){logger[_0x63d1('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x4c95d4,_0x307cc3[_0x63d1('0x10')][_0x63d1('0x12')]);return _0x266803(_0x307cc3[_0x63d1('0x10')]['message']);}logger[_0x63d1('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x4c95d4,_0x307cc3['error'][_0x63d1('0x12')]);return _0x5ea21a(_0x307cc3[_0x63d1('0x10')][_0x63d1('0x12')]);}else{logger[_0x63d1('0x13')](_0x63d1('0xb'),_0x4c95d4,_0x63d1('0xc'));_0x5ea21a(_0x307cc3[_0x63d1('0x14')][_0x63d1('0x12')]);}})[_0x63d1('0x15')](function(_0x460143){logger[_0x63d1('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x4c95d4,_0x460143);_0x266803(_0x460143);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index c4291a4..73b870c 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 _0xcd63=['INTEGER','exports'];(function(_0x1f8cfa,_0x59f527){var _0x2a0c34=function(_0x5a66ac){while(--_0x5a66ac){_0x1f8cfa['push'](_0x1f8cfa['shift']());}};_0x2a0c34(++_0x59f527);}(_0xcd63,0x1dd));var _0x3cd6=function(_0x3986ef,_0x386059){_0x3986ef=_0x3986ef-0x0;var _0x3d4655=_0xcd63[_0x3986ef];return _0x3d4655;};'use strict';var Sequelize=require('sequelize');module[_0x3cd6('0x0')]={'UserId':{'type':Sequelize[_0x3cd6('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x3cd6('0x1')]}}; \ No newline at end of file +var _0xa0fe=['INTEGER','sequelize','exports'];(function(_0x24b792,_0x361c31){var _0x4abf51=function(_0xeb7531){while(--_0xeb7531){_0x24b792['push'](_0x24b792['shift']());}};_0x4abf51(++_0x361c31);}(_0xa0fe,0x73));var _0xea0f=function(_0xb0b763,_0x429f73){_0xb0b763=_0xb0b763-0x0;var _0x466cd3=_0xa0fe[_0xb0b763];return _0x466cd3;};'use strict';var Sequelize=require(_0xea0f('0x0'));module[_0xea0f('0x1')]={'UserId':{'type':Sequelize[_0xea0f('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xea0f('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 19eda2d..11dcadf 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(_0x2741a7,_0x2998e1){var _0x344d51=function(_0x571ca5){while(--_0x571ca5){_0x2741a7['push'](_0x2741a7['shift']());}};_0x344d51(++_0x2998e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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(_0x4b4971,_0x4e7bea){var _0x3eaab1=function(_0x31bef3){while(--_0x31bef3){_0x4b4971['push'](_0x4b4971['shift']());}};_0x3eaab1(++_0x4e7bea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 51374e1..e2c9cb6 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x76d0dd,_0x16716d){var _0x508d20=function(_0x15af09){while(--_0x15af09){_0x76d0dd['push'](_0x76d0dd['shift']());}};_0x508d20(++_0x16716d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3c327d,_0x1c6652){var _0x15bdbe=function(_0x862b16){while(--_0x862b16){_0x3c327d['push'](_0x3c327d['shift']());}};_0x15bdbe(++_0x1c6652);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 03b8a44..c8e9b78 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 _0xa74c=['exports','INTEGER'];(function(_0xe720ee,_0x483d99){var _0x5c3c0c=function(_0xa720a8){while(--_0xa720a8){_0xe720ee['push'](_0xe720ee['shift']());}};_0x5c3c0c(++_0x483d99);}(_0xa74c,0x106));var _0xca74=function(_0x2381d2,_0x2402d6){_0x2381d2=_0x2381d2-0x0;var _0x525b03=_0xa74c[_0x2381d2];return _0x525b03;};'use strict';var Sequelize=require('sequelize');module[_0xca74('0x0')]={'penalty':{'type':Sequelize[_0xca74('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0b5b=['INTEGER','exports'];(function(_0x43393f,_0xf6352b){var _0x25212c=function(_0x33d001){while(--_0x33d001){_0x43393f['push'](_0x43393f['shift']());}};_0x25212c(++_0xf6352b);}(_0x0b5b,0x147));var _0xb0b5=function(_0x5cd2d7,_0x47d6e3){_0x5cd2d7=_0x5cd2d7-0x0;var _0x355556=_0x0b5b[_0x5cd2d7];return _0x355556;};'use strict';var Sequelize=require('sequelize');module[_0xb0b5('0x0')]={'penalty':{'type':Sequelize[_0xb0b5('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index f2c6a38..cb7da9b 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 _0x66c8=['rimraf','../../config/environment','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x26724b,_0x398322){var _0x51cdee=function(_0xf031bb){while(--_0xf031bb){_0x26724b['push'](_0x26724b['shift']());}};_0x51cdee(++_0x398322);}(_0x66c8,0x87));var _0x866c=function(_0x203134,_0x364dbf){_0x203134=_0x203134-0x0;var _0x5aeb5a=_0x66c8[_0x203134];return _0x5aeb5a;};'use strict';var _=require(_0x866c('0x0'));var util=require(_0x866c('0x1'));var logger=require(_0x866c('0x2'))(_0x866c('0x3'));var moment=require(_0x866c('0x4'));var BPromise=require(_0x866c('0x5'));var rp=require(_0x866c('0x6'));var fs=require('fs');var path=require(_0x866c('0x7'));var rimraf=require(_0x866c('0x8'));var config=require(_0x866c('0x9'));var attributes=require('./userVoiceQueue.attributes');module[_0x866c('0xa')]=function(_0x2ffb74,_0x132d78){return _0x2ffb74['define'](_0x866c('0xb'),attributes,{'tableName':_0x866c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7786=['api','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','UserVoiceQueue','lodash','util','../../config/logger'];(function(_0x3b23d2,_0x11afb7){var _0x48ec0f=function(_0x136534){while(--_0x136534){_0x3b23d2['push'](_0x3b23d2['shift']());}};_0x48ec0f(++_0x11afb7);}(_0x7786,0x1bf));var _0x6778=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7786[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6778('0x0'));var util=require(_0x6778('0x1'));var logger=require(_0x6778('0x2'))(_0x6778('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6778('0x4'));var fs=require('fs');var path=require(_0x6778('0x5'));var rimraf=require(_0x6778('0x6'));var config=require(_0x6778('0x7'));var attributes=require(_0x6778('0x8'));module['exports']=function(_0x43a90c,_0x29d76d){return _0x43a90c['define'](_0x6778('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 243e799..f61bd1e 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 _0x0ce8=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util'];(function(_0x53d123,_0xbb2096){var _0x23d6a9=function(_0x30f125){while(--_0x30f125){_0x53d123['push'](_0x53d123['shift']());}};_0x23d6a9(++_0xbb2096);}(_0x0ce8,0x108));var _0x80ce=function(_0x543d68,_0x293c8c){_0x543d68=_0x543d68-0x0;var _0x496258=_0x0ce8[_0x543d68];return _0x496258;};'use strict';var _=require(_0x80ce('0x0'));var util=require(_0x80ce('0x1'));var moment=require(_0x80ce('0x2'));var BPromise=require(_0x80ce('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80ce('0x4'));var db=require(_0x80ce('0x5'))['db'];var utils=require(_0x80ce('0x6'));var logger=require(_0x80ce('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5957c7,_0x17c461,_0x1cf636){return new BPromise(function(_0x184d1b,_0x3b0f8c){return client[_0x80ce('0x8')](_0x5957c7,_0x1cf636)[_0x80ce('0x9')](function(_0x8431d0){logger['info'](_0x80ce('0xa'),_0x17c461,_0x80ce('0xb'));logger[_0x80ce('0xc')](_0x80ce('0xd'),_0x17c461,_0x80ce('0xb'),JSON['stringify'](_0x8431d0));if(_0x8431d0[_0x80ce('0xe')]){if(_0x8431d0[_0x80ce('0xe')][_0x80ce('0xf')]===0x1f4){logger[_0x80ce('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x17c461,_0x8431d0[_0x80ce('0xe')]['message']);return _0x3b0f8c(_0x8431d0[_0x80ce('0xe')][_0x80ce('0x10')]);}logger[_0x80ce('0xe')](_0x80ce('0xa'),_0x17c461,_0x8431d0[_0x80ce('0xe')][_0x80ce('0x10')]);return _0x184d1b(_0x8431d0[_0x80ce('0xe')][_0x80ce('0x10')]);}else{logger[_0x80ce('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x17c461,_0x80ce('0xb'));_0x184d1b(_0x8431d0['result'][_0x80ce('0x10')]);}})[_0x80ce('0x12')](function(_0x10cbea){logger[_0x80ce('0xe')](_0x80ce('0xa'),_0x17c461,_0x10cbea);_0x3b0f8c(_0x10cbea);});});} \ No newline at end of file +var _0xda1b=['debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x7ae484,_0x487e00){var _0x365271=function(_0xcc52d5){while(--_0xcc52d5){_0x7ae484['push'](_0x7ae484['shift']());}};_0x365271(++_0x487e00);}(_0xda1b,0x1aa));var _0xbda1=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xda1b[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xbda1('0x0'));var util=require(_0xbda1('0x1'));var moment=require('moment');var BPromise=require(_0xbda1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbda1('0x3'));var db=require(_0xbda1('0x4'))['db'];var utils=require(_0xbda1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xbda1('0x6'));var jayson=require(_0xbda1('0x7'));var client=jayson[_0xbda1('0x8')][_0xbda1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x406ba2,_0x3d2d31,_0x238cdf){return new BPromise(function(_0x5be979,_0x11e20f){return client[_0xbda1('0xa')](_0x406ba2,_0x238cdf)['then'](function(_0x2f2179){logger[_0xbda1('0xb')](_0xbda1('0xc'),_0x3d2d31,_0xbda1('0xd'));logger[_0xbda1('0xe')](_0xbda1('0xf'),_0x3d2d31,_0xbda1('0xd'),JSON[_0xbda1('0x10')](_0x2f2179));if(_0x2f2179[_0xbda1('0x11')]){if(_0x2f2179[_0xbda1('0x11')][_0xbda1('0x12')]===0x1f4){logger[_0xbda1('0x11')](_0xbda1('0xc'),_0x3d2d31,_0x2f2179[_0xbda1('0x11')][_0xbda1('0x13')]);return _0x11e20f(_0x2f2179[_0xbda1('0x11')][_0xbda1('0x13')]);}logger[_0xbda1('0x11')](_0xbda1('0xc'),_0x3d2d31,_0x2f2179[_0xbda1('0x11')][_0xbda1('0x13')]);return _0x5be979(_0x2f2179['error'][_0xbda1('0x13')]);}else{logger['info'](_0xbda1('0xc'),_0x3d2d31,'request\x20sent');_0x5be979(_0x2f2179[_0xbda1('0x14')][_0xbda1('0x13')]);}})[_0xbda1('0x15')](function(_0x288a6b){logger[_0xbda1('0x11')](_0xbda1('0xc'),_0x3d2d31,_0x288a6b);_0x11e20f(_0x288a6b);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 6d0ccbc..2ea92c9 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x280a7b,_0x1bd4b8){var _0x3e4f9b=function(_0xaf3b21){while(--_0xaf3b21){_0x280a7b['push'](_0x280a7b['shift']());}};_0x3e4f9b(++_0x1bd4b8);}(_0x70e0,0x17b));var _0x070e=function(_0x1a12da,_0x4abdab){_0x1a12da=_0x1a12da-0x0;var _0x31012e=_0x70e0[_0x1a12da];return _0x31012e;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x545fe3,_0x3b191f){var _0x480702=function(_0x21c970){while(--_0x21c970){_0x545fe3['push'](_0x545fe3['shift']());}};_0x480702(++_0x3b191f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index c8fac9a..5951c8d 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 _0x5bea=['STRING','Required\x20by\x20Asterisk','queue_interface','sequelize','INTEGER'];(function(_0x45a816,_0x4a7232){var _0x5d2c81=function(_0x4a4ece){while(--_0x4a4ece){_0x45a816['push'](_0x45a816['shift']());}};_0x5d2c81(++_0x4a7232);}(_0x5bea,0x18e));var _0xa5be=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x5bea[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0xa5be('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa5be('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xa5be('0x2')],'allowNull':![],'comment':_0xa5be('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa5be('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xa5be('0x2')],'allowNull':![],'unique':_0xa5be('0x4'),'comment':_0xa5be('0x3')},'penalty':{'type':Sequelize[_0xa5be('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xa5be('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x92f7=['queue_interface','INTEGER','exports','Required\x20by\x20Asterisk','STRING'];(function(_0x277b6f,_0x429cb6){var _0x5cafec=function(_0x393d14){while(--_0x393d14){_0x277b6f['push'](_0x277b6f['shift']());}};_0x5cafec(++_0x429cb6);}(_0x92f7,0xa7));var _0x792f=function(_0x651c32,_0x554df9){_0x651c32=_0x651c32-0x0;var _0x25c174=_0x92f7[_0x651c32];return _0x25c174;};'use strict';var Sequelize=require('sequelize');module[_0x792f('0x0')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x792f('0x1')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x792f('0x1')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x792f('0x2')],'allowNull':![],'unique':_0x792f('0x3'),'comment':_0x792f('0x1')},'VoiceQueueId':{'type':Sequelize[_0x792f('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x792f('0x2')],'allowNull':![],'unique':_0x792f('0x3'),'comment':_0x792f('0x1')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x792f('0x1')},'paused':{'type':Sequelize[_0x792f('0x4')](0xb),'defaultValue':0x0,'comment':_0x792f('0x1')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index f460cee..b04140b 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 _0x0fd8=['emit','hasOwnProperty','hook','exports','events','UserVoiceQueueRt','setMaxListeners','remove'];(function(_0x4864ce,_0x3f7366){var _0xeffa0c=function(_0x15751d){while(--_0x15751d){_0x4864ce['push'](_0x4864ce['shift']());}};_0xeffa0c(++_0x3f7366);}(_0x0fd8,0x1f4));var _0x80fd=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x0fd8[_0x53ccf2];return _0x5a2964;};'use strict';var EventEmitter=require(_0x80fd('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x80fd('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x80fd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x80fd('0x3')};function emitEvent(_0x431dd4){return function(_0x309fc6,_0x48239e,_0x346cc2){UserVoiceQueueRtEvents['emit'](_0x431dd4+':'+_0x309fc6['id'],_0x309fc6);UserVoiceQueueRtEvents[_0x80fd('0x4')](_0x431dd4,_0x309fc6);_0x346cc2(null);};}for(var e in events){if(events[_0x80fd('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x80fd('0x6')](e,emitEvent(event));}}module[_0x80fd('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xc918=['hasOwnProperty','hook','exports','events','UserVoiceQueueRt','emit'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0xc918,0xa5));var _0x8c91=function(_0x5bc7e0,_0x64e6ed){_0x5bc7e0=_0x5bc7e0-0x0;var _0x41bda1=_0xc918[_0x5bc7e0];return _0x41bda1;};'use strict';var EventEmitter=require(_0x8c91('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x8c91('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x321960){return function(_0x5dbde0,_0x5d87d4,_0x47f7ae){UserVoiceQueueRtEvents['emit'](_0x321960+':'+_0x5dbde0['id'],_0x5dbde0);UserVoiceQueueRtEvents[_0x8c91('0x2')](_0x321960,_0x5dbde0);_0x47f7ae(null);};}for(var e in events){if(events[_0x8c91('0x3')](e)){var event=events[e];UserVoiceQueueRt[_0x8c91('0x4')](e,emitEvent(event));}}module[_0x8c91('0x5')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index c5d8be6..c0d4ec0 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 _0x7766=['user_has_voice_queues_rt','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x7766,0x1bd));var _0x6776=function(_0x2bbd0e,_0x1f3e77){_0x2bbd0e=_0x2bbd0e-0x0;var _0x40a0c4=_0x7766[_0x2bbd0e];return _0x40a0c4;};'use strict';var _=require(_0x6776('0x0'));var util=require(_0x6776('0x1'));var logger=require(_0x6776('0x2'))('api');var moment=require(_0x6776('0x3'));var BPromise=require(_0x6776('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6776('0x5'));var rimraf=require(_0x6776('0x6'));var config=require('../../config/environment');var attributes=require(_0x6776('0x7'));module[_0x6776('0x8')]=function(_0x23750e,_0x18fda8){return _0x23750e[_0x6776('0x9')](_0x6776('0xa'),attributes,{'tableName':_0x6776('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xebf6=['bluebird','rimraf','./userVoiceQueueRt.attributes','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xebf6,0x155));var _0x6ebf=function(_0x305c93,_0x3421dc){_0x305c93=_0x305c93-0x0;var _0x5bae39=_0xebf6[_0x305c93];return _0x5bae39;};'use strict';var _=require('lodash');var util=require(_0x6ebf('0x0'));var logger=require(_0x6ebf('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6ebf('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6ebf('0x3'));var config=require('../../config/environment');var attributes=require(_0x6ebf('0x4'));module['exports']=function(_0x18706b,_0x2eb26d){return _0x18706b['define'](_0x6ebf('0x5'),attributes,{'tableName':_0x6ebf('0x6'),'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 40bc5e6..458d864 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 _0x782e=['message','result','catch','UserVoiceQueueRt','findAll','options','raw','where','COUNT','sequelize','literal','outboundQueuePauses','info','GetVoiceQueueRtPauses','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0x782e,0x180));var _0xe782=function(_0x2deaa7,_0x29dddb){_0x2deaa7=_0x2deaa7-0x0;var _0x2220f4=_0x782e[_0x2deaa7];return _0x2220f4;};'use strict';var _=require(_0xe782('0x0'));var util=require(_0xe782('0x1'));var moment=require('moment');var BPromise=require(_0xe782('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe782('0x3'))['db'];var utils=require(_0xe782('0x4'));var logger=require(_0xe782('0x5'))('rpc');var config=require(_0xe782('0x6'));var jayson=require(_0xe782('0x7'));var client=jayson[_0xe782('0x8')][_0xe782('0x9')]({'port':0x232a});config[_0xe782('0xa')]=_[_0xe782('0xb')](config[_0xe782('0xa')],{'host':_0xe782('0xc'),'port':0x18eb});var socket=require(_0xe782('0xd'))(new Redis(config[_0xe782('0xa')]));require('./userVoiceQueueRt.socket')[_0xe782('0xe')](socket);function respondWithRpcPromise(_0x2dae52,_0x1bd73a,_0x34a2ae){return new BPromise(function(_0x48d45c,_0xa31f36){return client[_0xe782('0xf')](_0x2dae52,_0x34a2ae)[_0xe782('0x10')](function(_0x53d2d3){logger['info'](_0xe782('0x11'),_0x1bd73a,_0xe782('0x12'));logger[_0xe782('0x13')](_0xe782('0x14'),_0x1bd73a,'request\x20sent',JSON[_0xe782('0x15')](_0x53d2d3));if(_0x53d2d3['error']){if(_0x53d2d3[_0xe782('0x16')]['code']===0x1f4){logger['error'](_0xe782('0x11'),_0x1bd73a,_0x53d2d3[_0xe782('0x16')][_0xe782('0x17')]);return _0xa31f36(_0x53d2d3['error']['message']);}logger[_0xe782('0x16')](_0xe782('0x11'),_0x1bd73a,_0x53d2d3[_0xe782('0x16')]['message']);return _0x48d45c(_0x53d2d3['error']['message']);}else{logger['info'](_0xe782('0x11'),_0x1bd73a,_0xe782('0x12'));_0x48d45c(_0x53d2d3[_0xe782('0x18')]['message']);}})[_0xe782('0x19')](function(_0x1d58d5){logger[_0xe782('0x16')](_0xe782('0x11'),_0x1bd73a,_0x1d58d5);_0xa31f36(_0x1d58d5);});});}exports['GetVoiceQueueRtPauses']=function(_0x451f23){var _0x4398da=this;return new Promise(function(_0x1cd33d,_0x32bc26){return db[_0xe782('0x1a')][_0xe782('0x1b')]({'raw':_0x451f23[_0xe782('0x1c')]?_0x451f23[_0xe782('0x1c')][_0xe782('0x1d')]===undefined?!![]:![]:!![],'where':_0x451f23[_0xe782('0x1c')]?_0x451f23[_0xe782('0x1c')][_0xe782('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0xe782('0x1f'),db[_0xe782('0x20')]['fn']('IF',db[_0xe782('0x20')][_0xe782('0x21')]('`paused`\x20=\x201,\x201,\x20null'))),_0xe782('0x22')]]})['then'](function(_0x5e11d6){logger[_0xe782('0x23')](_0xe782('0x24'),_0x451f23);logger['debug'](_0xe782('0x24'),_0x451f23,JSON[_0xe782('0x15')](_0x5e11d6));_0x1cd33d(_0x5e11d6);})[_0xe782('0x19')](function(_0x2334a5){logger[_0xe782('0x16')](_0xe782('0x24'),_0x2334a5['message'],_0x451f23);_0x32bc26(_0x4398da[_0xe782('0x16')](0x1f4,_0x2334a5['message']));});});}; \ No newline at end of file +var _0xde40=['http','redis','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','result','GetVoiceQueueRtPauses','findAll','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3cab97,_0x5e4a06){var _0x5071bd=function(_0x401694){while(--_0x401694){_0x3cab97['push'](_0x3cab97['shift']());}};_0x5071bd(++_0x5e4a06);}(_0xde40,0x8a));var _0x0de4=function(_0x29537d,_0x193762){_0x29537d=_0x29537d-0x0;var _0x36461c=_0xde40[_0x29537d];return _0x36461c;};'use strict';var _=require('lodash');var util=require(_0x0de4('0x0'));var moment=require(_0x0de4('0x1'));var BPromise=require(_0x0de4('0x2'));var rs=require(_0x0de4('0x3'));var fs=require('fs');var Redis=require(_0x0de4('0x4'));var db=require(_0x0de4('0x5'))['db'];var utils=require(_0x0de4('0x6'));var logger=require('../../config/logger')(_0x0de4('0x7'));var config=require(_0x0de4('0x8'));var jayson=require(_0x0de4('0x9'));var client=jayson['client'][_0x0de4('0xa')]({'port':0x232a});config[_0x0de4('0xb')]=_['defaults'](config[_0x0de4('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0de4('0xc'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0x0de4('0xd')](socket);function respondWithRpcPromise(_0x2f8d4d,_0x2c1792,_0x1861c9){return new BPromise(function(_0x57dea0,_0x4a187c){return client[_0x0de4('0xe')](_0x2f8d4d,_0x1861c9)[_0x0de4('0xf')](function(_0x355488){logger[_0x0de4('0x10')](_0x0de4('0x11'),_0x2c1792,'request\x20sent');logger[_0x0de4('0x12')](_0x0de4('0x13'),_0x2c1792,_0x0de4('0x14'),JSON[_0x0de4('0x15')](_0x355488));if(_0x355488[_0x0de4('0x16')]){if(_0x355488[_0x0de4('0x16')][_0x0de4('0x17')]===0x1f4){logger['error'](_0x0de4('0x11'),_0x2c1792,_0x355488[_0x0de4('0x16')][_0x0de4('0x18')]);return _0x4a187c(_0x355488[_0x0de4('0x16')][_0x0de4('0x18')]);}logger[_0x0de4('0x16')](_0x0de4('0x11'),_0x2c1792,_0x355488[_0x0de4('0x16')]['message']);return _0x57dea0(_0x355488[_0x0de4('0x16')][_0x0de4('0x18')]);}else{logger[_0x0de4('0x10')](_0x0de4('0x11'),_0x2c1792,_0x0de4('0x14'));_0x57dea0(_0x355488[_0x0de4('0x19')][_0x0de4('0x18')]);}})['catch'](function(_0x228c90){logger[_0x0de4('0x16')](_0x0de4('0x11'),_0x2c1792,_0x228c90);_0x4a187c(_0x228c90);});});}exports[_0x0de4('0x1a')]=function(_0x45d275){var _0x51598f=this;return new Promise(function(_0x2e37bb,_0x7bbddd){return db['UserVoiceQueueRt'][_0x0de4('0x1b')]({'raw':_0x45d275[_0x0de4('0x1c')]?_0x45d275[_0x0de4('0x1c')][_0x0de4('0x1d')]===undefined?!![]:![]:!![],'where':_0x45d275[_0x0de4('0x1c')]?_0x45d275['options'][_0x0de4('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x0de4('0x1f'),db[_0x0de4('0x20')]['fn']('IF',db[_0x0de4('0x20')][_0x0de4('0x21')](_0x0de4('0x22')))),_0x0de4('0x23')]]})[_0x0de4('0xf')](function(_0x1818b3){logger[_0x0de4('0x10')]('GetVoiceQueueRtPauses',_0x45d275);logger[_0x0de4('0x12')]('GetVoiceQueueRtPauses',_0x45d275,JSON[_0x0de4('0x15')](_0x1818b3));_0x2e37bb(_0x1818b3);})[_0x0de4('0x24')](function(_0x1fc10e){logger[_0x0de4('0x16')](_0x0de4('0x1a'),_0x1fc10e['message'],_0x45d275);_0x7bbddd(_0x51598f['error'](0x1f4,_0x1fc10e[_0x0de4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 62deca1..b0ddfa0 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 _0x6333=['removeListener','register','length','update'];(function(_0xc2b0f9,_0x2d2dc0){var _0x4139b4=function(_0x4888b2){while(--_0x4888b2){_0xc2b0f9['push'](_0xc2b0f9['shift']());}};_0x4139b4(++_0x2d2dc0);}(_0x6333,0x83));var _0x3633=function(_0x4b77f5,_0x2a1069){_0x4b77f5=_0x4b77f5-0x0;var _0x50f896=_0x6333[_0x4b77f5];return _0x50f896;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save','remove',_0x3633('0x0')];function createListener(_0x528e8c,_0x2c7f7e){return function(_0x31ea34){_0x2c7f7e['emit'](_0x528e8c,_0x31ea34);};}function removeListener(_0x3e0961,_0x5cb6c6){return function(){UserVoiceQueueRtEvents[_0x3633('0x1')](_0x3e0961,_0x5cb6c6);};}exports[_0x3633('0x2')]=function(_0x566b21){for(var _0x547e6d=0x0,_0x23c014=events[_0x3633('0x3')];_0x547e6d<_0x23c014;_0x547e6d++){var _0x272da5=events[_0x547e6d];var _0x5c35ba=createListener('userVoiceQueueRt:'+_0x272da5,_0x566b21);UserVoiceQueueRtEvents['on'](_0x272da5,_0x5c35ba);}}; \ No newline at end of file +var _0x03db=['remove','update','emit','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x22c849,_0x325470){var _0x2cf2ac=function(_0x2dae54){while(--_0x2dae54){_0x22c849['push'](_0x22c849['shift']());}};_0x2cf2ac(++_0x325470);}(_0x03db,0x156));var _0xb03d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x03db[_0x321bb2];return _0x9c12ed;};'use strict';var UserVoiceQueueRtEvents=require(_0xb03d('0x0'));var events=[_0xb03d('0x1'),_0xb03d('0x2'),_0xb03d('0x3')];function createListener(_0x552e4d,_0x312e63){return function(_0x262205){_0x312e63[_0xb03d('0x4')](_0x552e4d,_0x262205);};}function removeListener(_0x43f58e,_0xdc4440){return function(){UserVoiceQueueRtEvents['removeListener'](_0x43f58e,_0xdc4440);};}exports[_0xb03d('0x5')]=function(_0x1a01ba){for(var _0x9a0f36=0x0,_0x57a19b=events[_0xb03d('0x6')];_0x9a0f36<_0x57a19b;_0x9a0f36++){var _0x5f1238=events[_0x9a0f36];var _0x181291=createListener(_0xb03d('0x7')+_0x5f1238,_0x1a01ba);UserVoiceQueueRtEvents['on'](_0x5f1238,_0x181291);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 56c1559..7e36d5f 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x487a72,_0x4ee2df){var _0xcd3559=function(_0x1becd3){while(--_0x1becd3){_0x487a72['push'](_0x487a72['shift']());}};_0xcd3559(++_0x4ee2df);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xf2e1db,_0x14ce67){var _0x41dfa3=function(_0x2ae944){while(--_0x2ae944){_0xf2e1db['push'](_0xf2e1db['shift']());}};_0x41dfa3(++_0x14ce67);}(_0xe706,0xa3));var _0x6e70=function(_0x592416,_0x2c75e9){_0x592416=_0x592416-0x0;var _0x3005fa=_0xe706[_0x592416];return _0x3005fa;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 6f2238b..4039061 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 _0x7ff9=['INTEGER','sequelize','exports'];(function(_0x19ad17,_0x27941a){var _0x4a67ab=function(_0x541d90){while(--_0x541d90){_0x19ad17['push'](_0x19ad17['shift']());}};_0x4a67ab(++_0x27941a);}(_0x7ff9,0x17b));var _0x97ff=function(_0x28e342,_0x2652d3){_0x28e342=_0x28e342-0x0;var _0x3fd6e9=_0x7ff9[_0x28e342];return _0x3fd6e9;};'use strict';var Sequelize=require(_0x97ff('0x0'));module[_0x97ff('0x1')]={'penalty':{'type':Sequelize[_0x97ff('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5dfe=['sequelize','exports','INTEGER'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x5dfe,0x1a4));var _0xe5df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5dfe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe5df('0x0'));module[_0xe5df('0x1')]={'penalty':{'type':Sequelize[_0xe5df('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 f4bc194..cb939f4 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 _0x48f6=['rimraf','../../config/environment','exports','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','moment','bluebird','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48f6,0x18b));var _0x648f=function(_0x4a25c1,_0x290e2d){_0x4a25c1=_0x4a25c1-0x0;var _0x44e261=_0x48f6[_0x4a25c1];return _0x44e261;};'use strict';var _=require(_0x648f('0x0'));var util=require(_0x648f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x648f('0x2'));var BPromise=require(_0x648f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x648f('0x4'));var rimraf=require(_0x648f('0x5'));var config=require(_0x648f('0x6'));var attributes=require('./userWhatsappQueue.attributes');module[_0x648f('0x7')]=function(_0x2ffe92,_0x56edea){return _0x2ffe92['define'](_0x648f('0x8'),attributes,{'tableName':_0x648f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8aa2=['user_has_whatsapp_queues','util','moment','request-promise','path','rimraf','exports','define'];(function(_0x588011,_0x5e9d11){var _0x3b3773=function(_0x4cca54){while(--_0x4cca54){_0x588011['push'](_0x588011['shift']());}};_0x3b3773(++_0x5e9d11);}(_0x8aa2,0xc1));var _0x28aa=function(_0x29d768,_0x172042){_0x29d768=_0x29d768-0x0;var _0x3d9458=_0x8aa2[_0x29d768];return _0x3d9458;};'use strict';var _=require('lodash');var util=require(_0x28aa('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x28aa('0x1'));var BPromise=require('bluebird');var rp=require(_0x28aa('0x2'));var fs=require('fs');var path=require(_0x28aa('0x3'));var rimraf=require(_0x28aa('0x4'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0x28aa('0x5')]=function(_0x9bb06a,_0x539fb1){return _0x9bb06a[_0x28aa('0x6')]('UserWhatsappQueue',attributes,{'tableName':_0x28aa('0x7'),'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 2a50666..076f7c5 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 _0x3ae8=['UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info'];(function(_0xada04,_0x384d40){var _0x22083a=function(_0x2288ef){while(--_0x2288ef){_0xada04['push'](_0xada04['shift']());}};_0x22083a(++_0x384d40);}(_0x3ae8,0x14b));var _0x83ae=function(_0x2ecf93,_0x2356cb){_0x2ecf93=_0x2ecf93-0x0;var _0x4c38d2=_0x3ae8[_0x2ecf93];return _0x4c38d2;};'use strict';var _=require(_0x83ae('0x0'));var util=require(_0x83ae('0x1'));var moment=require(_0x83ae('0x2'));var BPromise=require('bluebird');var rs=require(_0x83ae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83ae('0x4'))['db'];var utils=require(_0x83ae('0x5'));var logger=require(_0x83ae('0x6'))(_0x83ae('0x7'));var config=require(_0x83ae('0x8'));var jayson=require(_0x83ae('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f24a0,_0xcff184,_0x20cdfe){return new BPromise(function(_0x37be05,_0x4de46c){return client['request'](_0x1f24a0,_0x20cdfe)['then'](function(_0x3ad65d){logger[_0x83ae('0xa')](_0x83ae('0xb'),_0xcff184,_0x83ae('0xc'));logger[_0x83ae('0xd')](_0x83ae('0xe'),_0xcff184,_0x83ae('0xc'),JSON['stringify'](_0x3ad65d));if(_0x3ad65d[_0x83ae('0xf')]){if(_0x3ad65d[_0x83ae('0xf')]['code']===0x1f4){logger['error'](_0x83ae('0xb'),_0xcff184,_0x3ad65d[_0x83ae('0xf')][_0x83ae('0x10')]);return _0x4de46c(_0x3ad65d[_0x83ae('0xf')][_0x83ae('0x10')]);}logger[_0x83ae('0xf')](_0x83ae('0xb'),_0xcff184,_0x3ad65d[_0x83ae('0xf')][_0x83ae('0x10')]);return _0x37be05(_0x3ad65d[_0x83ae('0xf')][_0x83ae('0x10')]);}else{logger[_0x83ae('0xa')](_0x83ae('0xb'),_0xcff184,_0x83ae('0xc'));_0x37be05(_0x3ad65d[_0x83ae('0x11')][_0x83ae('0x10')]);}})['catch'](function(_0x41c212){logger[_0x83ae('0xf')](_0x83ae('0xb'),_0xcff184,_0x41c212);_0x4de46c(_0x41c212);});});} \ No newline at end of file +var _0xe94b=['error','code','UserWhatsappQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xe94b,0x10f));var _0xbe94=function(_0xb703ed,_0x3a6914){_0xb703ed=_0xb703ed-0x0;var _0x5e0223=_0xe94b[_0xb703ed];return _0x5e0223;};'use strict';var _=require(_0xbe94('0x0'));var util=require(_0xbe94('0x1'));var moment=require(_0xbe94('0x2'));var BPromise=require(_0xbe94('0x3'));var rs=require(_0xbe94('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe94('0x5'))['db'];var utils=require(_0xbe94('0x6'));var logger=require(_0xbe94('0x7'))(_0xbe94('0x8'));var config=require(_0xbe94('0x9'));var jayson=require(_0xbe94('0xa'));var client=jayson[_0xbe94('0xb')][_0xbe94('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x185f53,_0x33bdf5,_0x579620){return new BPromise(function(_0x5f4d1e,_0xe45c60){return client[_0xbe94('0xd')](_0x185f53,_0x579620)[_0xbe94('0xe')](function(_0x59ca22){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x33bdf5,_0xbe94('0xf'));logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x33bdf5,_0xbe94('0xf'),JSON[_0xbe94('0x10')](_0x59ca22));if(_0x59ca22[_0xbe94('0x11')]){if(_0x59ca22[_0xbe94('0x11')][_0xbe94('0x12')]===0x1f4){logger[_0xbe94('0x11')](_0xbe94('0x13'),_0x33bdf5,_0x59ca22[_0xbe94('0x11')][_0xbe94('0x14')]);return _0xe45c60(_0x59ca22[_0xbe94('0x11')][_0xbe94('0x14')]);}logger[_0xbe94('0x11')](_0xbe94('0x13'),_0x33bdf5,_0x59ca22['error']['message']);return _0x5f4d1e(_0x59ca22[_0xbe94('0x11')]['message']);}else{logger[_0xbe94('0x15')]('UserWhatsappQueue,\x20%s,\x20%s',_0x33bdf5,_0xbe94('0xf'));_0x5f4d1e(_0x59ca22[_0xbe94('0x16')]['message']);}})[_0xbe94('0x17')](function(_0x5b6cbd){logger[_0xbe94('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x33bdf5,_0x5b6cbd);_0xe45c60(_0x5b6cbd);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index f1f9394..198d0d4 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 _0x40b5=['Router','fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','/:id','show','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x53c009,_0x313d20){var _0x1b0b1c=function(_0x16887b){while(--_0x16887b){_0x53c009['push'](_0x53c009['shift']());}};_0x1b0b1c(++_0x313d20);}(_0x40b5,0x1d7));var _0x540b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40b5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x540b('0x0'));var util=require(_0x540b('0x1'));var path=require(_0x540b('0x2'));var timeout=require(_0x540b('0x3'));var express=require(_0x540b('0x4'));var router=express[_0x540b('0x5')]();var fs_extra=require(_0x540b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x540b('0x7'));var config=require(_0x540b('0x8'));var controller=require(_0x540b('0x9'));router[_0x540b('0xa')]('/',auth[_0x540b('0xb')](),controller['index']);router[_0x540b('0xa')](_0x540b('0xc'),auth[_0x540b('0xb')](),controller[_0x540b('0xd')]);router['post']('/',auth[_0x540b('0xb')](),controller['create']);router['put']('/:id',auth[_0x540b('0xb')](),controller['update']);router[_0x540b('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x540b('0xf')]);module[_0x540b('0x10')]=router; \ No newline at end of file +var _0xe198=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','get'];(function(_0x26294a,_0x420213){var _0x5dbac7=function(_0x1fa2b1){while(--_0x1fa2b1){_0x26294a['push'](_0x26294a['shift']());}};_0x5dbac7(++_0x420213);}(_0xe198,0x6f));var _0x8e19=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xe198[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require(_0x8e19('0x0'));var util=require(_0x8e19('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8e19('0x2'));var router=express[_0x8e19('0x3')]();var fs_extra=require(_0x8e19('0x4'));var auth=require(_0x8e19('0x5'));var interaction=require(_0x8e19('0x6'));var config=require('../../config/environment');var controller=require(_0x8e19('0x7'));router[_0x8e19('0x8')]('/',auth[_0x8e19('0x9')](),controller[_0x8e19('0xa')]);router[_0x8e19('0x8')](_0x8e19('0xb'),auth[_0x8e19('0x9')](),controller[_0x8e19('0xc')]);router[_0x8e19('0xd')]('/',auth[_0x8e19('0x9')](),controller[_0x8e19('0xe')]);router[_0x8e19('0xf')](_0x8e19('0xb'),auth['isAuthenticated'](),controller[_0x8e19('0x10')]);router[_0x8e19('0x11')](_0x8e19('0xb'),auth[_0x8e19('0x9')](),controller[_0x8e19('0x12')]);module[_0x8e19('0x13')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 8b6c7d8..ba18de1 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 _0xa9fe=['exports','STRING','sequelize'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xa9fe,0xb6));var _0xea9f=function(_0x45f21d,_0x3e259a){_0x45f21d=_0x45f21d-0x0;var _0x28c45d=_0xa9fe[_0x45f21d];return _0x28c45d;};'use strict';var Sequelize=require(_0xea9f('0x0'));module[_0xea9f('0x1')]={'name':{'type':Sequelize[_0xea9f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xea9f('0x2')]}}; \ No newline at end of file +var _0xeed7=['name','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xeed7,0xdf));var _0x7eed=function(_0x253ce8,_0x5d77db){_0x253ce8=_0x253ce8-0x0;var _0x1fcc23=_0xeed7[_0x253ce8];return _0x1fcc23;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7eed('0x0')],'unique':_0x7eed('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 18a934c..2b31d77 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 _0x3d71=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','destroy','then','get','Variables','UserProfileResource','end','name','send','index','map','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','Variable','includeAll','include','show','rawAttributes','find'];(function(_0x13067c,_0x2c5838){var _0xc2a569=function(_0x117822){while(--_0x117822){_0x13067c['push'](_0x13067c['shift']());}};_0xc2a569(++_0x2c5838);}(_0x3d71,0x186));var _0x13d7=function(_0x486d8f,_0x780d7c){_0x486d8f=_0x486d8f-0x0;var _0x1f2cd8=_0x3d71[_0x486d8f];return _0x1f2cd8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13d7('0x0'));var zipdir=require(_0x13d7('0x1'));var jsonpatch=require(_0x13d7('0x2'));var rp=require(_0x13d7('0x3'));var moment=require(_0x13d7('0x4'));var BPromise=require(_0x13d7('0x5'));var Mustache=require('mustache');var util=require(_0x13d7('0x6'));var path=require(_0x13d7('0x7'));var sox=require(_0x13d7('0x8'));var csv=require(_0x13d7('0x9'));var ejs=require(_0x13d7('0xa'));var fs=require('fs');var fs_extra=require(_0x13d7('0xb'));var _=require(_0x13d7('0xc'));var squel=require('squel');var crypto=require(_0x13d7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x13d7('0xe'));var toCsv=require(_0x13d7('0x9'));var querystring=require(_0x13d7('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x13d7('0x10'));var qs=require(_0x13d7('0x11'));var as=require(_0x13d7('0x12'));var hardwareService=require(_0x13d7('0x13'));var logger=require(_0x13d7('0x14'))(_0x13d7('0x15'));var utils=require(_0x13d7('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x538d7a,_0x1ef546){_0x1ef546=_0x1ef546||0xcc;return function(_0x51ba7a){if(_0x51ba7a){return _0x538d7a[_0x13d7('0x17')](_0x1ef546);}return _0x538d7a[_0x13d7('0x18')](_0x1ef546)['end']();};}function respondWithResult(_0x5c2553,_0x24fded){_0x24fded=_0x24fded||0xc8;return function(_0x4adede){if(_0x4adede){return _0x5c2553[_0x13d7('0x18')](_0x24fded)[_0x13d7('0x19')](_0x4adede);}};}function respondWithFilteredResult(_0x5c908a,_0xba73d4){return function(_0x4ba31e){if(_0x4ba31e){var _0x5c39b4=typeof _0xba73d4[_0x13d7('0x1a')]===_0x13d7('0x1b')&&typeof _0xba73d4[_0x13d7('0x1c')]===_0x13d7('0x1b');var _0x4654ee=_0x4ba31e[_0x13d7('0x1d')];var _0x3b0d10=_0x5c39b4?0x0:_0xba73d4['offset'];var _0x312d1e=_0x5c39b4?_0x4ba31e[_0x13d7('0x1d')]:_0xba73d4['offset']+_0xba73d4[_0x13d7('0x1c')];var _0x1910c5;if(_0x312d1e>=_0x4654ee){_0x312d1e=_0x4654ee;_0x1910c5=0xc8;}else{_0x1910c5=0xce;}_0x5c908a[_0x13d7('0x18')](_0x1910c5);return _0x5c908a['set'](_0x13d7('0x1e'),_0x3b0d10+'-'+_0x312d1e+'/'+_0x4654ee)['json'](_0x4ba31e);}return null;};}function patchUpdates(_0x3f1e4b){return function(_0x2b97de){try{jsonpatch[_0x13d7('0x1f')](_0x2b97de,_0x3f1e4b,!![]);}catch(_0x2ca07d){return BPromise['reject'](_0x2ca07d);}return _0x2b97de['save']();};}function saveUpdates(_0x18782f,_0x9d5bf){return function(_0x2b1dca){if(_0x2b1dca){return _0x2b1dca['update'](_0x18782f)['then'](function(_0x214113){return _0x214113;});}return null;};}function removeEntity(_0x3b6ada,_0x45cb95){return function(_0x35b35d){if(_0x35b35d){return _0x35b35d[_0x13d7('0x20')]()[_0x13d7('0x21')](function(){var _0x3d1a84=_0x35b35d[_0x13d7('0x22')]({'plain':!![]});var _0x1d5d21=_0x13d7('0x23');return db[_0x13d7('0x24')][_0x13d7('0x20')]({'where':{'type':_0x1d5d21,'resourceId':_0x3d1a84['id']}})[_0x13d7('0x21')](function(){return _0x35b35d;});})[_0x13d7('0x21')](function(){_0x3b6ada[_0x13d7('0x18')](0xcc)[_0x13d7('0x25')]();});}};}function handleEntityNotFound(_0x11b9cf,_0x4c7a12){return function(_0xebabf){if(!_0xebabf){_0x11b9cf[_0x13d7('0x17')](0x194);}return _0xebabf;};}function handleError(_0x2ffba6,_0x38d1c9){_0x38d1c9=_0x38d1c9||0x1f4;return function(_0x5e3dce){logger['error'](_0x5e3dce['stack']);if(_0x5e3dce[_0x13d7('0x26')]){delete _0x5e3dce[_0x13d7('0x26')];}_0x2ffba6[_0x13d7('0x18')](_0x38d1c9)[_0x13d7('0x27')](_0x5e3dce);};}exports[_0x13d7('0x28')]=function(_0x456d19,_0x15aea7){var _0x55fe2e={},_0x16b145={},_0x1aff74={'count':0x0,'rows':[]};var _0x2dc72e=_[_0x13d7('0x29')](db['Variable']['rawAttributes'],function(_0x340b47){return{'name':_0x340b47[_0x13d7('0x2a')],'type':_0x340b47[_0x13d7('0x2b')][_0x13d7('0x2c')]};});_0x16b145[_0x13d7('0x2d')]=_[_0x13d7('0x29')](_0x2dc72e,_0x13d7('0x26'));_0x16b145['query']=_[_0x13d7('0x2e')](_0x456d19[_0x13d7('0x2f')]);_0x16b145[_0x13d7('0x30')]=_['intersection'](_0x16b145['model'],_0x16b145[_0x13d7('0x2f')]);_0x55fe2e[_0x13d7('0x31')]=_[_0x13d7('0x32')](_0x16b145['model'],qs[_0x13d7('0x33')](_0x456d19['query'][_0x13d7('0x33')]));_0x55fe2e[_0x13d7('0x31')]=_0x55fe2e[_0x13d7('0x31')]['length']?_0x55fe2e[_0x13d7('0x31')]:_0x16b145[_0x13d7('0x2d')];if(!_0x456d19['query'][_0x13d7('0x34')]('nolimit')){_0x55fe2e[_0x13d7('0x1c')]=qs[_0x13d7('0x1c')](_0x456d19[_0x13d7('0x2f')][_0x13d7('0x1c')]);_0x55fe2e[_0x13d7('0x1a')]=qs['offset'](_0x456d19['query'][_0x13d7('0x1a')]);}_0x55fe2e['order']=qs['sort'](_0x456d19[_0x13d7('0x2f')][_0x13d7('0x35')]);_0x55fe2e['where']=qs[_0x13d7('0x30')](_[_0x13d7('0x36')](_0x456d19['query'],_0x16b145[_0x13d7('0x30')]),_0x2dc72e);if(_0x456d19[_0x13d7('0x2f')][_0x13d7('0x37')]){_0x55fe2e[_0x13d7('0x38')]=_[_0x13d7('0x39')](_0x55fe2e['where'],{'$or':_[_0x13d7('0x29')](_0x2dc72e,function(_0x5b6508){if(_0x5b6508['type']!==_0x13d7('0x3a')){var _0x465bb4={};_0x465bb4[_0x5b6508[_0x13d7('0x26')]]={'$like':'%'+_0x456d19[_0x13d7('0x2f')][_0x13d7('0x37')]+'%'};return _0x465bb4;}})});}_0x55fe2e=_[_0x13d7('0x39')]({},_0x55fe2e,_0x456d19[_0x13d7('0x3b')]);var _0x20a84d={'where':_0x55fe2e['where']};return db[_0x13d7('0x3c')][_0x13d7('0x1d')](_0x20a84d)['then'](function(_0x453bfe){_0x1aff74[_0x13d7('0x1d')]=_0x453bfe;if(_0x456d19['query'][_0x13d7('0x3d')]){_0x55fe2e[_0x13d7('0x3e')]=[{'all':!![]}];}return db[_0x13d7('0x3c')]['findAll'](_0x55fe2e);})[_0x13d7('0x21')](function(_0x54fed0){_0x1aff74['rows']=_0x54fed0;return _0x1aff74;})['then'](respondWithFilteredResult(_0x15aea7,_0x55fe2e))['catch'](handleError(_0x15aea7,null));};exports[_0x13d7('0x3f')]=function(_0x15f249,_0x23d6be){var _0x85506d={'raw':!![],'where':{'id':_0x15f249['params']['id']}},_0x17e2d4={};_0x17e2d4[_0x13d7('0x2d')]=_[_0x13d7('0x2e')](db[_0x13d7('0x3c')][_0x13d7('0x40')]);_0x17e2d4[_0x13d7('0x2f')]=_['keys'](_0x15f249[_0x13d7('0x2f')]);_0x17e2d4[_0x13d7('0x30')]=_[_0x13d7('0x32')](_0x17e2d4[_0x13d7('0x2d')],_0x17e2d4['query']);_0x85506d[_0x13d7('0x31')]=_[_0x13d7('0x32')](_0x17e2d4['model'],qs[_0x13d7('0x33')](_0x15f249[_0x13d7('0x2f')][_0x13d7('0x33')]));_0x85506d[_0x13d7('0x31')]=_0x85506d[_0x13d7('0x31')]['length']?_0x85506d[_0x13d7('0x31')]:_0x17e2d4[_0x13d7('0x2d')];if(_0x15f249['query']['includeAll']){_0x85506d[_0x13d7('0x3e')]=[{'all':!![]}];}_0x85506d=_['merge']({},_0x85506d,_0x15f249['options']);return db[_0x13d7('0x3c')][_0x13d7('0x41')](_0x85506d)[_0x13d7('0x21')](handleEntityNotFound(_0x23d6be,null))[_0x13d7('0x21')](respondWithResult(_0x23d6be,null))['catch'](handleError(_0x23d6be,null));};exports['create']=function(_0x53cbc3,_0x22fd6f){return db['Variable'][_0x13d7('0x42')](_0x53cbc3['body'],{})[_0x13d7('0x21')](function(_0x13e90b){var _0x2febad=_0x53cbc3[_0x13d7('0x43')]['get']({'plain':!![]});if(!_0x2febad)throw new Error(_0x13d7('0x44'));if(_0x2febad[_0x13d7('0x45')]==='user'){var _0x57cc44=_0x13e90b['get']({'plain':!![]});var _0x448883='Variables';return db['UserProfileSection'][_0x13d7('0x41')]({'where':{'name':_0x448883,'userProfileId':_0x2febad[_0x13d7('0x46')]},'raw':!![]})[_0x13d7('0x21')](function(_0x4f7c10){if(_0x4f7c10&&_0x4f7c10['autoAssociation']===0x0){return db[_0x13d7('0x24')][_0x13d7('0x42')]({'name':_0x57cc44[_0x13d7('0x26')],'resourceId':_0x57cc44['id'],'type':_0x4f7c10[_0x13d7('0x26')],'sectionId':_0x4f7c10['id']},{})['then'](function(){return _0x13e90b;});}else{return _0x13e90b;}})['catch'](function(_0x33555a){logger[_0x13d7('0x47')](_0x13d7('0x48'),_0x33555a);throw _0x33555a;});}return _0x13e90b;})[_0x13d7('0x21')](respondWithResult(_0x22fd6f,0xc9))['catch'](handleError(_0x22fd6f,null));};exports['update']=function(_0x7ae737,_0x58c037){if(_0x7ae737[_0x13d7('0x49')]['id']){delete _0x7ae737['body']['id'];}return db[_0x13d7('0x3c')][_0x13d7('0x41')]({'where':{'id':_0x7ae737[_0x13d7('0x4a')]['id']}})[_0x13d7('0x21')](handleEntityNotFound(_0x58c037,null))[_0x13d7('0x21')](saveUpdates(_0x7ae737[_0x13d7('0x49')],null))[_0x13d7('0x21')](respondWithResult(_0x58c037,null))['catch'](handleError(_0x58c037,null));};exports[_0x13d7('0x20')]=function(_0x4ab5b0,_0x440ee6){return db[_0x13d7('0x3c')][_0x13d7('0x41')]({'where':{'id':_0x4ab5b0['params']['id']}})['then'](handleEntityNotFound(_0x440ee6,null))[_0x13d7('0x21')](removeEntity(_0x440ee6,null))[_0x13d7('0x4b')](handleError(_0x440ee6,null));}; \ No newline at end of file +var _0x63e1=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','error','name','send','map','fieldName','type','key','model','query','keys','attributes','length','hasOwnProperty','sort','filters','pick','filter','where','VIRTUAL','merge','options','Variable','include','rows','catch','show','params','rawAttributes','intersection','fields','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Variables','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format'];(function(_0x379232,_0x50a17e){var _0x57ed49=function(_0x43be00){while(--_0x43be00){_0x379232['push'](_0x379232['shift']());}};_0x57ed49(++_0x50a17e);}(_0x63e1,0xa7));var _0x163e=function(_0x3d8a90,_0x425912){_0x3d8a90=_0x3d8a90-0x0;var _0x263daa=_0x63e1[_0x3d8a90];return _0x263daa;};'use strict';var emlformat=require(_0x163e('0x0'));var rimraf=require(_0x163e('0x1'));var zipdir=require(_0x163e('0x2'));var jsonpatch=require(_0x163e('0x3'));var rp=require(_0x163e('0x4'));var moment=require(_0x163e('0x5'));var BPromise=require(_0x163e('0x6'));var Mustache=require(_0x163e('0x7'));var util=require(_0x163e('0x8'));var path=require('path');var sox=require(_0x163e('0x9'));var csv=require('to-csv');var ejs=require(_0x163e('0xa'));var fs=require('fs');var fs_extra=require(_0x163e('0xb'));var _=require(_0x163e('0xc'));var squel=require('squel');var crypto=require(_0x163e('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x163e('0xe'));var querystring=require(_0x163e('0xf'));var Papa=require('papaparse');var Redis=require(_0x163e('0x10'));var authService=require(_0x163e('0x11'));var qs=require(_0x163e('0x12'));var as=require(_0x163e('0x13'));var hardwareService=require(_0x163e('0x14'));var logger=require(_0x163e('0x15'))(_0x163e('0x16'));var utils=require(_0x163e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x163e('0x18'));var db=require(_0x163e('0x19'))['db'];function respondWithStatusCode(_0x24f32a,_0x545a4c){_0x545a4c=_0x545a4c||0xcc;return function(_0x37f767){if(_0x37f767){return _0x24f32a[_0x163e('0x1a')](_0x545a4c);}return _0x24f32a['status'](_0x545a4c)[_0x163e('0x1b')]();};}function respondWithResult(_0x3eb68a,_0x281c75){_0x281c75=_0x281c75||0xc8;return function(_0x50edb8){if(_0x50edb8){return _0x3eb68a[_0x163e('0x1c')](_0x281c75)[_0x163e('0x1d')](_0x50edb8);}};}function respondWithFilteredResult(_0x2e6825,_0x207bc2){return function(_0x208772){if(_0x208772){var _0x304dd7=typeof _0x207bc2['offset']===_0x163e('0x1e')&&typeof _0x207bc2[_0x163e('0x1f')]==='undefined';var _0x3ca5b0=_0x208772[_0x163e('0x20')];var _0x23b41c=_0x304dd7?0x0:_0x207bc2[_0x163e('0x21')];var _0x31860a=_0x304dd7?_0x208772[_0x163e('0x20')]:_0x207bc2[_0x163e('0x21')]+_0x207bc2[_0x163e('0x1f')];var _0x437fb5;if(_0x31860a>=_0x3ca5b0){_0x31860a=_0x3ca5b0;_0x437fb5=0xc8;}else{_0x437fb5=0xce;}_0x2e6825['status'](_0x437fb5);return _0x2e6825[_0x163e('0x22')](_0x163e('0x23'),_0x23b41c+'-'+_0x31860a+'/'+_0x3ca5b0)[_0x163e('0x1d')](_0x208772);}return null;};}function patchUpdates(_0x2ac510){return function(_0xa1b203){try{jsonpatch[_0x163e('0x24')](_0xa1b203,_0x2ac510,!![]);}catch(_0x4cd175){return BPromise[_0x163e('0x25')](_0x4cd175);}return _0xa1b203[_0x163e('0x26')]();};}function saveUpdates(_0x5c5eb6,_0x22701e){return function(_0x352c6e){if(_0x352c6e){return _0x352c6e[_0x163e('0x27')](_0x5c5eb6)['then'](function(_0x38ef38){return _0x38ef38;});}return null;};}function removeEntity(_0x1f0855,_0x47e902){return function(_0xc49540){if(_0xc49540){return _0xc49540[_0x163e('0x28')]()['then'](function(){var _0xd35ed4=_0xc49540[_0x163e('0x29')]({'plain':!![]});var _0x1c8fac='Variables';return db[_0x163e('0x2a')][_0x163e('0x28')]({'where':{'type':_0x1c8fac,'resourceId':_0xd35ed4['id']}})[_0x163e('0x2b')](function(){return _0xc49540;});})[_0x163e('0x2b')](function(){_0x1f0855[_0x163e('0x1c')](0xcc)[_0x163e('0x1b')]();});}};}function handleEntityNotFound(_0x31208e,_0x1d2337){return function(_0x34df97){if(!_0x34df97){_0x31208e[_0x163e('0x1a')](0x194);}return _0x34df97;};}function handleError(_0x194776,_0x5eff02){_0x5eff02=_0x5eff02||0x1f4;return function(_0x454df1){logger[_0x163e('0x2c')](_0x454df1['stack']);if(_0x454df1[_0x163e('0x2d')]){delete _0x454df1[_0x163e('0x2d')];}_0x194776[_0x163e('0x1c')](_0x5eff02)[_0x163e('0x2e')](_0x454df1);};}exports['index']=function(_0x126996,_0x1c5607){var _0xe68302={},_0x5158a5={},_0x31f6c8={'count':0x0,'rows':[]};var _0x47733c=_[_0x163e('0x2f')](db['Variable']['rawAttributes'],function(_0x2c40b6){return{'name':_0x2c40b6[_0x163e('0x30')],'type':_0x2c40b6[_0x163e('0x31')][_0x163e('0x32')]};});_0x5158a5[_0x163e('0x33')]=_[_0x163e('0x2f')](_0x47733c,_0x163e('0x2d'));_0x5158a5[_0x163e('0x34')]=_[_0x163e('0x35')](_0x126996['query']);_0x5158a5['filters']=_['intersection'](_0x5158a5[_0x163e('0x33')],_0x5158a5[_0x163e('0x34')]);_0xe68302[_0x163e('0x36')]=_['intersection'](_0x5158a5[_0x163e('0x33')],qs['fields'](_0x126996[_0x163e('0x34')]['fields']));_0xe68302[_0x163e('0x36')]=_0xe68302[_0x163e('0x36')][_0x163e('0x37')]?_0xe68302[_0x163e('0x36')]:_0x5158a5[_0x163e('0x33')];if(!_0x126996[_0x163e('0x34')][_0x163e('0x38')]('nolimit')){_0xe68302[_0x163e('0x1f')]=qs[_0x163e('0x1f')](_0x126996['query'][_0x163e('0x1f')]);_0xe68302['offset']=qs['offset'](_0x126996['query']['offset']);}_0xe68302['order']=qs[_0x163e('0x39')](_0x126996['query'][_0x163e('0x39')]);_0xe68302['where']=qs[_0x163e('0x3a')](_[_0x163e('0x3b')](_0x126996[_0x163e('0x34')],_0x5158a5[_0x163e('0x3a')]),_0x47733c);if(_0x126996['query'][_0x163e('0x3c')]){_0xe68302['where']=_['merge'](_0xe68302[_0x163e('0x3d')],{'$or':_[_0x163e('0x2f')](_0x47733c,function(_0x4fa67b){if(_0x4fa67b[_0x163e('0x31')]!==_0x163e('0x3e')){var _0x104c64={};_0x104c64[_0x4fa67b[_0x163e('0x2d')]]={'$like':'%'+_0x126996['query']['filter']+'%'};return _0x104c64;}})});}_0xe68302=_[_0x163e('0x3f')]({},_0xe68302,_0x126996[_0x163e('0x40')]);var _0xb6cc70={'where':_0xe68302[_0x163e('0x3d')]};return db[_0x163e('0x41')][_0x163e('0x20')](_0xb6cc70)['then'](function(_0x13fa46){_0x31f6c8[_0x163e('0x20')]=_0x13fa46;if(_0x126996[_0x163e('0x34')]['includeAll']){_0xe68302[_0x163e('0x42')]=[{'all':!![]}];}return db[_0x163e('0x41')]['findAll'](_0xe68302);})[_0x163e('0x2b')](function(_0x3a497b){_0x31f6c8[_0x163e('0x43')]=_0x3a497b;return _0x31f6c8;})[_0x163e('0x2b')](respondWithFilteredResult(_0x1c5607,_0xe68302))[_0x163e('0x44')](handleError(_0x1c5607,null));};exports[_0x163e('0x45')]=function(_0x4197a7,_0x82a3c5){var _0x4dc776={'raw':!![],'where':{'id':_0x4197a7[_0x163e('0x46')]['id']}},_0xbf4996={};_0xbf4996[_0x163e('0x33')]=_[_0x163e('0x35')](db[_0x163e('0x41')][_0x163e('0x47')]);_0xbf4996[_0x163e('0x34')]=_[_0x163e('0x35')](_0x4197a7[_0x163e('0x34')]);_0xbf4996['filters']=_[_0x163e('0x48')](_0xbf4996['model'],_0xbf4996[_0x163e('0x34')]);_0x4dc776[_0x163e('0x36')]=_['intersection'](_0xbf4996[_0x163e('0x33')],qs[_0x163e('0x49')](_0x4197a7['query'][_0x163e('0x49')]));_0x4dc776[_0x163e('0x36')]=_0x4dc776[_0x163e('0x36')]['length']?_0x4dc776[_0x163e('0x36')]:_0xbf4996[_0x163e('0x33')];if(_0x4197a7['query'][_0x163e('0x4a')]){_0x4dc776[_0x163e('0x42')]=[{'all':!![]}];}_0x4dc776=_[_0x163e('0x3f')]({},_0x4dc776,_0x4197a7[_0x163e('0x40')]);return db[_0x163e('0x41')]['find'](_0x4dc776)[_0x163e('0x2b')](handleEntityNotFound(_0x82a3c5,null))[_0x163e('0x2b')](respondWithResult(_0x82a3c5,null))['catch'](handleError(_0x82a3c5,null));};exports[_0x163e('0x4b')]=function(_0x1fbf39,_0x39e92e){return db[_0x163e('0x41')][_0x163e('0x4b')](_0x1fbf39[_0x163e('0x4c')],{})[_0x163e('0x2b')](function(_0x363b2b){var _0x2389af=_0x1fbf39['user'][_0x163e('0x29')]({'plain':!![]});if(!_0x2389af)throw new Error(_0x163e('0x4d'));if(_0x2389af['role']===_0x163e('0x4e')){var _0x3d47db=_0x363b2b[_0x163e('0x29')]({'plain':!![]});var _0x2b8f78=_0x163e('0x4f');return db[_0x163e('0x50')][_0x163e('0x51')]({'where':{'name':_0x2b8f78,'userProfileId':_0x2389af[_0x163e('0x52')]},'raw':!![]})['then'](function(_0x386491){if(_0x386491&&_0x386491['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3d47db[_0x163e('0x2d')],'resourceId':_0x3d47db['id'],'type':_0x386491[_0x163e('0x2d')],'sectionId':_0x386491['id']},{})['then'](function(){return _0x363b2b;});}else{return _0x363b2b;}})[_0x163e('0x44')](function(_0x5337b2){logger[_0x163e('0x2c')](_0x163e('0x53'),_0x5337b2);throw _0x5337b2;});}return _0x363b2b;})['then'](respondWithResult(_0x39e92e,0xc9))[_0x163e('0x44')](handleError(_0x39e92e,null));};exports[_0x163e('0x27')]=function(_0x3c5de3,_0x443ae9){if(_0x3c5de3['body']['id']){delete _0x3c5de3[_0x163e('0x4c')]['id'];}return db[_0x163e('0x41')][_0x163e('0x51')]({'where':{'id':_0x3c5de3[_0x163e('0x46')]['id']}})[_0x163e('0x2b')](handleEntityNotFound(_0x443ae9,null))[_0x163e('0x2b')](saveUpdates(_0x3c5de3['body'],null))[_0x163e('0x2b')](respondWithResult(_0x443ae9,null))[_0x163e('0x44')](handleError(_0x443ae9,null));};exports[_0x163e('0x28')]=function(_0x46ad0a,_0x36d825){return db[_0x163e('0x41')][_0x163e('0x51')]({'where':{'id':_0x46ad0a['params']['id']}})['then'](handleEntityNotFound(_0x36d825,null))[_0x163e('0x2b')](removeEntity(_0x36d825,null))[_0x163e('0x44')](handleError(_0x36d825,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 2b4cdc1..367a863 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 _0xb976=['path','../../config/environment','./variable.attributes','exports','tools_variables','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1753ce,_0x82d12c){var _0x5d93f0=function(_0x4cd52b){while(--_0x4cd52b){_0x1753ce['push'](_0x1753ce['shift']());}};_0x5d93f0(++_0x82d12c);}(_0xb976,0x145));var _0x6b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb976[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6b97('0x0'));var util=require('util');var logger=require(_0x6b97('0x1'))(_0x6b97('0x2'));var moment=require(_0x6b97('0x3'));var BPromise=require(_0x6b97('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b97('0x5'));var rimraf=require('rimraf');var config=require(_0x6b97('0x6'));var attributes=require(_0x6b97('0x7'));module[_0x6b97('0x8')]=function(_0x4f235a,_0x4d29cd){return _0x4f235a['define']('Variable',attributes,{'tableName':_0x6b97('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c4d=['define','tools_variables','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes'];(function(_0x1a4878,_0x26adb8){var _0x3e5350=function(_0x2d44eb){while(--_0x2d44eb){_0x1a4878['push'](_0x1a4878['shift']());}};_0x3e5350(++_0x26adb8);}(_0x5c4d,0x11a));var _0xd5c4=function(_0x4aa33b,_0x18235f){_0x4aa33b=_0x4aa33b-0x0;var _0x5efce2=_0x5c4d[_0x4aa33b];return _0x5efce2;};'use strict';var _=require(_0xd5c4('0x0'));var util=require('util');var logger=require(_0xd5c4('0x1'))('api');var moment=require(_0xd5c4('0x2'));var BPromise=require(_0xd5c4('0x3'));var rp=require(_0xd5c4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd5c4('0x5'));var config=require(_0xd5c4('0x6'));var attributes=require(_0xd5c4('0x7'));module['exports']=function(_0x37f2e0,_0x3439e8){return _0x37f2e0[_0xd5c4('0x8')]('Variable',attributes,{'tableName':_0xd5c4('0x9'),'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 f3f9ac9..d0923c1 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 _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x5c3023,_0x59be84){var _0x3e3f58=function(_0x52f5da){while(--_0x52f5da){_0x5c3023['push'](_0x5c3023['shift']());}};_0x3e3f58(++_0x59be84);}(_0x1cb9,0x14e));var _0x91cb=function(_0x48565e,_0x21319f){_0x48565e=_0x48565e-0x0;var _0xc49449=_0x1cb9[_0x48565e];return _0xc49449;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ No newline at end of file +var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x5cfe84,_0x58720c){var _0x4b767b=function(_0xad1801){while(--_0xad1801){_0x5cfe84['push'](_0x5cfe84['shift']());}};_0x4b767b(++_0x58720c);}(_0x6aa7,0x178));var _0x76aa=function(_0xbe9771,_0x2b7a9d){_0xbe9771=_0xbe9771-0x0;var _0x52b66e=_0x6aa7[_0xbe9771];return _0x52b66e;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 7ec92e1..fa56c2e 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 _0x3ef9=['./version.controller','get','index','/fetch','fetch','/reset','isAuthenticated','canUpdate','reset','pull','restart','/migrations','migrations','exports','Router'];(function(_0x307b4e,_0x582fff){var _0xc74f79=function(_0x1ee804){while(--_0x1ee804){_0x307b4e['push'](_0x307b4e['shift']());}};_0xc74f79(++_0x582fff);}(_0x3ef9,0xb3));var _0x93ef=function(_0x325720,_0x11cf04){_0x325720=_0x325720-0x0;var _0x18011c=_0x3ef9[_0x325720];return _0x18011c;};'use strict';var express=require('express');var router=express[_0x93ef('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x93ef('0x1'));router[_0x93ef('0x2')]('/',controller[_0x93ef('0x3')]);router[_0x93ef('0x2')](_0x93ef('0x4'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x93ef('0x5')]);router[_0x93ef('0x2')](_0x93ef('0x6'),auth[_0x93ef('0x7')](),auth[_0x93ef('0x8')](),controller[_0x93ef('0x9')]);router['get']('/pull',auth[_0x93ef('0x7')](),auth[_0x93ef('0x8')](),controller[_0x93ef('0xa')]);router[_0x93ef('0x2')]('/restart',auth[_0x93ef('0x7')](),controller[_0x93ef('0xb')]);router[_0x93ef('0x2')](_0x93ef('0xc'),controller[_0x93ef('0xd')]);module[_0x93ef('0xe')]=router; \ No newline at end of file +var _0x6b3b=['/restart','restart','migrations','exports','./version.controller','get','/fetch','canUpdate','fetch','/reset','isAuthenticated','reset','/pull','pull'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0x6b3b,0xc8));var _0xb6b3=function(_0x6fe33f,_0x2ae4df){_0x6fe33f=_0x6fe33f-0x0;var _0xf3670f=_0x6b3b[_0x6fe33f];return _0xf3670f;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xb6b3('0x0'));router[_0xb6b3('0x1')]('/',controller['index']);router['get'](_0xb6b3('0x2'),auth['isAuthenticated'](),auth[_0xb6b3('0x3')](),controller[_0xb6b3('0x4')]);router['get'](_0xb6b3('0x5'),auth[_0xb6b3('0x6')](),auth[_0xb6b3('0x3')](),controller[_0xb6b3('0x7')]);router[_0xb6b3('0x1')](_0xb6b3('0x8'),auth[_0xb6b3('0x6')](),auth[_0xb6b3('0x3')](),controller[_0xb6b3('0x9')]);router[_0xb6b3('0x1')](_0xb6b3('0xa'),auth['isAuthenticated'](),controller[_0xb6b3('0xb')]);router[_0xb6b3('0x1')]('/migrations',controller[_0xb6b3('0xc')]);module[_0xb6b3('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index a55cd24..4d37ae0 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 _0xa9a9=['FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','info','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','server','replace','push','length','sequelize','Migration','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','version','query','fetch','tags','latest','exports','2.0.0','status','json','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard'];(function(_0x4a29a9,_0x58cd04){var _0x386570=function(_0x1d2d09){while(--_0x1d2d09){_0x4a29a9['push'](_0x4a29a9['shift']());}};_0x386570(++_0x58cd04);}(_0xa9a9,0x186));var _0x9a9a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa9a9[_0x321bb2];return _0x9c12ed;};'use strict';var Umzug=require(_0x9a9a('0x0'));var path=require(_0x9a9a('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x9a9a('0x2'))(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x9a9a('0x3'))['exec'];var db=require(_0x9a9a('0x4'))['db'];var config=require(_0x9a9a('0x5'));var pm2=require(_0x9a9a('0x6'));var logger=require(_0x9a9a('0x7'))('update');var git=require(_0x9a9a('0x8'))(config[_0x9a9a('0x9')]);exports['index']=function(_0x5b93de,_0x5ecc51){var _0x465189={'current':module['exports'][_0x9a9a('0xa')],'phonebar':0x2};if(_0x5b93de[_0x9a9a('0xb')]&&_0x5b93de['query']['latest']){return git[_0x9a9a('0xc')]()[_0x9a9a('0xd')](function(_0xca2210,_0x3289a8){_0x465189[_0x9a9a('0xe')]=(_0xca2210?module[_0x9a9a('0xf')][_0x9a9a('0xa')]:_0x3289a8['latest'])||_0x9a9a('0x10');return _0x5ecc51[_0x9a9a('0x11')](0xc8)[_0x9a9a('0x12')](_0x465189);});}else{return _0x5ecc51[_0x9a9a('0x11')](0xc8)[_0x9a9a('0x12')](_0x465189);}};exports[_0x9a9a('0xc')]=function(_0x2f6c01,_0x31d1ee){return git['fetch']([_0x9a9a('0x13'),_0x9a9a('0x14')],function(_0x52d5a6){if(_0x52d5a6){logger[_0x9a9a('0x15')](_0x52d5a6);return _0x31d1ee[_0x9a9a('0x11')](0x1f4)[_0x9a9a('0x12')](_0x52d5a6);}logger['info'](_0x9a9a('0x16'));return _0x31d1ee['status'](0xc8)['json']({'output':_0x9a9a('0x17')});});};exports[_0x9a9a('0x18')]=function(_0x12ff61,_0x61411a){return git[_0x9a9a('0x18')]([_0x9a9a('0x19'),_0x9a9a('0x1a')],function(_0x5d01c8){if(_0x5d01c8){logger[_0x9a9a('0x15')](_0x5d01c8);return _0x61411a[_0x9a9a('0x11')](0x1f4)[_0x9a9a('0x12')](_0x5d01c8);}logger['info'](_0x9a9a('0x1b'));return _0x61411a['status'](0xc8)['json']({'output':_0x9a9a('0x1c')});});};exports[_0x9a9a('0x1d')]=function(_0x3f7981,_0x1c5704){exec(_0x9a9a('0x1e'),function(_0x382baf,_0x566683,_0x82f168){logger[_0x9a9a('0x1f')](_0x566683);logger[_0x9a9a('0x1f')](_0x82f168);if(_0x382baf){logger[_0x9a9a('0x15')](_0x382baf);return _0x1c5704[_0x9a9a('0x11')](0x1f4)[_0x9a9a('0x12')](_0x382baf);}return _0x1c5704['status'](0xc8)[_0x9a9a('0x12')]({'output':_0x566683});});};exports['restart']=function(_0x15d886,_0x3d6310){return pm2[_0x9a9a('0x20')](_0x9a9a('0x21'))[_0x9a9a('0x22')](function(_0x470b6b){logger[_0x9a9a('0x1f')](_0x9a9a('0x23'),_0x470b6b);return _0x3d6310[_0x9a9a('0x11')](0xc8)[_0x9a9a('0x12')]({'output':_0x9a9a('0x24')});})[_0x9a9a('0x25')](function(_0x258f2e){logger['error'](_0x258f2e);return _0x3d6310[_0x9a9a('0x11')](0x1f4)[_0x9a9a('0x12')](_0x258f2e);});};exports[_0x9a9a('0x26')]=function(_0xe8bd46,_0x1542a1){var _0x2885b4=fs['readdirSync'](path[_0x9a9a('0x27')](config[_0x9a9a('0x9')],_0x9a9a('0x28'),'migrations'));var _0x560f2a=[];for(var _0x1aaeba=0x0;_0x1aaeba<_0x2885b4['length'];_0x1aaeba++){var _0x2e3407=_0x2885b4[_0x1aaeba][_0x9a9a('0x29')]('.js','');if(compareVersions(module[_0x9a9a('0xf')][_0x9a9a('0xa')],_0x2e3407)===-0x1){_0x560f2a[_0x9a9a('0x2a')](_0x2e3407);}}if(_0x560f2a[_0x9a9a('0x2b')]){var _0x2ed7f0=_0x560f2a['sort'](compareVersions);var _0x522142=new Umzug({'storage':_0x9a9a('0x2c'),'storageOptions':{'model':db['Migration'],'modelName':_0x9a9a('0x2d'),'columnName':_0x9a9a('0xa')},'migrations':{'params':[db[_0x9a9a('0x2c')]['getQueryInterface'](),db[_0x9a9a('0x2c')]['constructor'],function(){throw new Error(_0x9a9a('0x2e'));}],'path':path['join'](config[_0x9a9a('0x9')],_0x9a9a('0x28'),_0x9a9a('0x26')),'pattern':/\.js$/}});_0x522142['up']({'migrations':_[_0x9a9a('0x2f')](_0x2ed7f0,function(_0x12599c){return _0x12599c+'.js';})})[_0x9a9a('0x22')](function(){return _0x1542a1['status'](0xc8)[_0x9a9a('0x12')]({'output':_0x9a9a('0x30')+module[_0x9a9a('0xf')][_0x9a9a('0xa')]+'\x20to\x20'+_[_0x9a9a('0x31')](_0x2ed7f0),'migrations':_['join'](_0x2ed7f0)});})[_0x9a9a('0x25')](function(_0x3a3307){if(_0x3a3307 instanceof db[_0x9a9a('0x2c')][_0x9a9a('0x32')]){return _0x1542a1[_0x9a9a('0x11')](0xc8)[_0x9a9a('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x1542a1[_0x9a9a('0x11')](0x1f4)['json'](_0x3a3307);}});}else{return _0x1542a1[_0x9a9a('0x11')](0xc8)[_0x9a9a('0x12')]({'output':_0x9a9a('0x33')});}}; \ No newline at end of file +var _0x1fd9=['json','fetch','master','error','info','git\x20fetch','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','last','Database\x20already\x20up-to-date','lodash','pkginfo','version','child_process','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','query','latest','tags','exports','2.0.0','status'];(function(_0x186306,_0x2b9e73){var _0x18cf67=function(_0x463959){while(--_0x463959){_0x186306['push'](_0x186306['shift']());}};_0x18cf67(++_0x2b9e73);}(_0x1fd9,0x154));var _0x91fd=function(_0x4077cf,_0x5be8f0){_0x4077cf=_0x4077cf-0x0;var _0x16f802=_0x1fd9[_0x4077cf];return _0x16f802;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require(_0x91fd('0x0'));var pkginfo=require(_0x91fd('0x1'))(module,_0x91fd('0x2'));var compareVersions=require('compare-versions');var exec=require(_0x91fd('0x3'))['exec'];var db=require(_0x91fd('0x4'))['db'];var config=require(_0x91fd('0x5'));var pm2=require(_0x91fd('0x6'));var logger=require('../../config/logger')(_0x91fd('0x7'));var git=require(_0x91fd('0x8'))(config[_0x91fd('0x9')]);exports[_0x91fd('0xa')]=function(_0xb89107,_0x44407d){var _0x42f564={'current':module['exports'][_0x91fd('0x2')],'phonebar':0x2};if(_0xb89107[_0x91fd('0xb')]&&_0xb89107['query'][_0x91fd('0xc')]){return git['fetch']()[_0x91fd('0xd')](function(_0x1c430d,_0xa58f37){_0x42f564[_0x91fd('0xc')]=(_0x1c430d?module[_0x91fd('0xe')][_0x91fd('0x2')]:_0xa58f37[_0x91fd('0xc')])||_0x91fd('0xf');return _0x44407d[_0x91fd('0x10')](0xc8)[_0x91fd('0x11')](_0x42f564);});}else{return _0x44407d[_0x91fd('0x10')](0xc8)[_0x91fd('0x11')](_0x42f564);}};exports[_0x91fd('0x12')]=function(_0x1382ba,_0x52ce13){return git[_0x91fd('0x12')](['origin',_0x91fd('0x13')],function(_0x309f28){if(_0x309f28){logger[_0x91fd('0x14')](_0x309f28);return _0x52ce13[_0x91fd('0x10')](0x1f4)['json'](_0x309f28);}logger[_0x91fd('0x15')](_0x91fd('0x16'));return _0x52ce13['status'](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x422661,_0x241632){return git[_0x91fd('0x17')](['--hard',_0x91fd('0x18')],function(_0x597333){if(_0x597333){logger['error'](_0x597333);return _0x241632['status'](0x1f4)[_0x91fd('0x11')](_0x597333);}logger[_0x91fd('0x15')](_0x91fd('0x19'));return _0x241632[_0x91fd('0x10')](0xc8)['json']({'output':_0x91fd('0x1a')});});};exports[_0x91fd('0x1b')]=function(_0x8f4c5,_0x33053f){exec('npm\x20install\x20--production',function(_0x58f518,_0x1c24f4,_0x5c373b){logger[_0x91fd('0x15')](_0x1c24f4);logger[_0x91fd('0x15')](_0x5c373b);if(_0x58f518){logger[_0x91fd('0x14')](_0x58f518);return _0x33053f[_0x91fd('0x10')](0x1f4)[_0x91fd('0x11')](_0x58f518);}return _0x33053f[_0x91fd('0x10')](0xc8)[_0x91fd('0x11')]({'output':_0x1c24f4});});};exports[_0x91fd('0x1c')]=function(_0x5dee74,_0x306154){return pm2[_0x91fd('0x1c')](_0x91fd('0x1d'))['then'](function(_0x2c7cc9){logger[_0x91fd('0x15')](_0x91fd('0x1e'),_0x2c7cc9);return _0x306154['status'](0xc8)[_0x91fd('0x11')]({'output':_0x91fd('0x1f')});})[_0x91fd('0x20')](function(_0x289149){logger[_0x91fd('0x14')](_0x289149);return _0x306154[_0x91fd('0x10')](0x1f4)[_0x91fd('0x11')](_0x289149);});};exports[_0x91fd('0x21')]=function(_0x2ee7b9,_0x49094e){var _0x7d658c=fs[_0x91fd('0x22')](path[_0x91fd('0x23')](config['root'],_0x91fd('0x24'),_0x91fd('0x21')));var _0x4de7f1=[];for(var _0x46bf4e=0x0;_0x46bf4e<_0x7d658c[_0x91fd('0x25')];_0x46bf4e++){var _0x24ff96=_0x7d658c[_0x46bf4e]['replace'](_0x91fd('0x26'),'');if(compareVersions(module[_0x91fd('0xe')][_0x91fd('0x2')],_0x24ff96)===-0x1){_0x4de7f1[_0x91fd('0x27')](_0x24ff96);}}if(_0x4de7f1['length']){var _0x548d1c=_0x4de7f1[_0x91fd('0x28')](compareVersions);var _0x2b1a80=new Umzug({'storage':_0x91fd('0x29'),'storageOptions':{'model':db[_0x91fd('0x2a')],'modelName':_0x91fd('0x2a'),'columnName':_0x91fd('0x2')},'migrations':{'params':[db['sequelize'][_0x91fd('0x2b')](),db[_0x91fd('0x29')][_0x91fd('0x2c')],function(){throw new Error(_0x91fd('0x2d'));}],'path':path[_0x91fd('0x23')](config[_0x91fd('0x9')],_0x91fd('0x24'),'migrations'),'pattern':/\.js$/}});_0x2b1a80['up']({'migrations':_[_0x91fd('0x2e')](_0x548d1c,function(_0x205038){return _0x205038+_0x91fd('0x26');})})[_0x91fd('0x2f')](function(){return _0x49094e['status'](0xc8)[_0x91fd('0x11')]({'output':_0x91fd('0x30')+module[_0x91fd('0xe')][_0x91fd('0x2')]+'\x20to\x20'+_[_0x91fd('0x31')](_0x548d1c),'migrations':_[_0x91fd('0x23')](_0x548d1c)});})[_0x91fd('0x20')](function(_0x19b4b4){if(_0x19b4b4 instanceof db[_0x91fd('0x29')]['UniqueConstraintError']){return _0x49094e['status'](0xc8)[_0x91fd('0x11')]({'output':_0x91fd('0x32')});}else{return _0x49094e[_0x91fd('0x10')](0x1f4)[_0x91fd('0x11')](_0x19b4b4);}});}else{return _0x49094e['status'](0xc8)[_0x91fd('0x11')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index f1bf6b2..e8c0151 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 _0xf3bf=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','create','put','delete','destroy','exports'];(function(_0x346966,_0x1a1d7d){var _0x487973=function(_0x3e388d){while(--_0x3e388d){_0x346966['push'](_0x346966['shift']());}};_0x487973(++_0x1a1d7d);}(_0xf3bf,0x1b9));var _0xff3b=function(_0xcadb66,_0x21a21e){_0xcadb66=_0xcadb66-0x0;var _0x5745f8=_0xf3bf[_0xcadb66];return _0x5745f8;};'use strict';var multer=require('multer');var util=require(_0xff3b('0x0'));var path=require(_0xff3b('0x1'));var timeout=require(_0xff3b('0x2'));var express=require(_0xff3b('0x3'));var router=express['Router']();var fs_extra=require(_0xff3b('0x4'));var auth=require(_0xff3b('0x5'));var interaction=require(_0xff3b('0x6'));var config=require(_0xff3b('0x7'));var controller=require(_0xff3b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xff3b('0x9')]);router[_0xff3b('0xa')](_0xff3b('0xb'),auth['isAuthenticated'](),controller[_0xff3b('0xc')]);router['get'](_0xff3b('0xd'),auth[_0xff3b('0xe')](),controller[_0xff3b('0xf')]);router['post']('/',auth[_0xff3b('0xe')](),controller[_0xff3b('0x10')]);router[_0xff3b('0x11')](_0xff3b('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xff3b('0x12')](_0xff3b('0xd'),auth['isAuthenticated'](),controller[_0xff3b('0x13')]);module[_0xff3b('0x14')]=router; \ No newline at end of file +var _0xd6f6=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path'];(function(_0x2ff739,_0x1c8e0f){var _0x12dc13=function(_0x26fc97){while(--_0x26fc97){_0x2ff739['push'](_0x2ff739['shift']());}};_0x12dc13(++_0x1c8e0f);}(_0xd6f6,0x19b));var _0x6d6f=function(_0x4bc7b1,_0x40e1fa){_0x4bc7b1=_0x4bc7b1-0x0;var _0x1e068c=_0xd6f6[_0x4bc7b1];return _0x1e068c;};'use strict';var multer=require(_0x6d6f('0x0'));var util=require(_0x6d6f('0x1'));var path=require(_0x6d6f('0x2'));var timeout=require(_0x6d6f('0x3'));var express=require(_0x6d6f('0x4'));var router=express[_0x6d6f('0x5')]();var fs_extra=require(_0x6d6f('0x6'));var auth=require(_0x6d6f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6d6f('0x8'));var controller=require(_0x6d6f('0x9'));router['get']('/',auth[_0x6d6f('0xa')](),controller[_0x6d6f('0xb')]);router[_0x6d6f('0xc')](_0x6d6f('0xd'),auth[_0x6d6f('0xa')](),controller[_0x6d6f('0xe')]);router[_0x6d6f('0xc')](_0x6d6f('0xf'),auth[_0x6d6f('0xa')](),controller[_0x6d6f('0x10')]);router[_0x6d6f('0x11')]('/',auth[_0x6d6f('0xa')](),controller[_0x6d6f('0x12')]);router[_0x6d6f('0x13')](_0x6d6f('0xf'),auth[_0x6d6f('0xa')](),controller[_0x6d6f('0x14')]);router[_0x6d6f('0x15')](_0x6d6f('0xf'),auth[_0x6d6f('0xa')](),controller['destroy']);module[_0x6d6f('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 220176f..6d2c7f8 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 _0x32b6=['DATE','INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x32b6,0x1d1));var _0x632b=function(_0x3a65a8,_0x12e405){_0x3a65a8=_0x3a65a8-0x0;var _0x497d59=_0x32b6[_0x3a65a8];return _0x497d59;};'use strict';var Sequelize=require(_0x632b('0x0'));module[_0x632b('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x632b('0x2')]},'calleridnum':{'type':Sequelize[_0x632b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x632b('0x2')]},'membername':{'type':Sequelize[_0x632b('0x2')]},'agentcalledAt':{'type':Sequelize[_0x632b('0x3')]},'agentconnectAt':{'type':Sequelize[_0x632b('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x632b('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x632b('0x3')]},'agentdumpAt':{'type':Sequelize[_0x632b('0x3')]},'holdtime':{'type':Sequelize[_0x632b('0x4')]},'agentcomplete':{'type':Sequelize[_0x632b('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x632b('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x632b('0x4')]},'agentacw':{'type':Sequelize[_0x632b('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x632b('0x4')]},'reason':{'type':Sequelize[_0x632b('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x632b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x632b('0x2')]},'language':{'type':Sequelize[_0x632b('0x2')]},'accountcode':{'type':Sequelize[_0x632b('0x2')]},'context':{'type':Sequelize[_0x632b('0x2')]},'exten':{'type':Sequelize[_0x632b('0x2')]},'priority':{'type':Sequelize[_0x632b('0x2')]},'destchannel':{'type':Sequelize[_0x632b('0x2')]},'destchannelstate':{'type':Sequelize[_0x632b('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x632b('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x632b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x632b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x632b('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x632b('0x2')]},'destcontext':{'type':Sequelize[_0x632b('0x2')]},'destexten':{'type':Sequelize[_0x632b('0x2')]},'destpriority':{'type':Sequelize[_0x632b('0x2')]},'destuniqueid':{'type':Sequelize[_0x632b('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x632b('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x632b('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x632b('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x632b('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa1cc=['STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0xa1cc,0x10f));var _0xca1c=function(_0x27551c,_0x1b903d){_0x27551c=_0x27551c-0x0;var _0x5fc15c=_0xa1cc[_0x27551c];return _0x5fc15c;};'use strict';var Sequelize=require(_0xca1c('0x0'));module[_0xca1c('0x1')]={'type':{'type':Sequelize[_0xca1c('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xca1c('0x2')]},'calleridname':{'type':Sequelize[_0xca1c('0x2')]},'queue':{'type':Sequelize[_0xca1c('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xca1c('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xca1c('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xca1c('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xca1c('0x3')]},'agentdumpAt':{'type':Sequelize[_0xca1c('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xca1c('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xca1c('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xca1c('0x5')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xca1c('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xca1c('0x5')]},'channelstatedesc':{'type':Sequelize[_0xca1c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xca1c('0x2')]},'connectedlinename':{'type':Sequelize[_0xca1c('0x2')]},'language':{'type':Sequelize[_0xca1c('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xca1c('0x2')]},'exten':{'type':Sequelize[_0xca1c('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xca1c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xca1c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xca1c('0x2')]},'destcalleridname':{'type':Sequelize[_0xca1c('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xca1c('0x2')]},'destlanguage':{'type':Sequelize[_0xca1c('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xca1c('0x2')]},'destpriority':{'type':Sequelize[_0xca1c('0x2')]},'destuniqueid':{'type':Sequelize[_0xca1c('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xca1c('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xca1c('0x2')]},'transfer':{'type':Sequelize[_0xca1c('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xca1c('0x2')],'comment':_0xca1c('0x6')},'transferexten':{'type':Sequelize[_0xca1c('0x2')]},'transferuniqueid':{'type':Sequelize[_0xca1c('0x2')]},'agententerreason':{'type':Sequelize[_0xca1c('0x5')],'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 8e905c0..666a102 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(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 3da1720..330c58a 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 _0xa786=['VoiceAgentReport','report_agent','uniqueid','destuniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define'];(function(_0x46fdf8,_0x3840df){var _0x57e457=function(_0x49aa38){while(--_0x49aa38){_0x46fdf8['push'](_0x46fdf8['shift']());}};_0x57e457(++_0x3840df);}(_0xa786,0x1d2));var _0x6a78=function(_0x1103d6,_0x5184bd){_0x1103d6=_0x1103d6-0x0;var _0x1f5c90=_0xa786[_0x1103d6];return _0x1f5c90;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6a78('0x0'))(_0x6a78('0x1'));var moment=require(_0x6a78('0x2'));var BPromise=require(_0x6a78('0x3'));var rp=require(_0x6a78('0x4'));var fs=require('fs');var path=require(_0x6a78('0x5'));var rimraf=require(_0x6a78('0x6'));var config=require('../../config/environment');var attributes=require(_0x6a78('0x7'));module[_0x6a78('0x8')]=function(_0xc0be8b,_0x45470e){return _0xc0be8b[_0x6a78('0x9')](_0x6a78('0xa'),attributes,{'tableName':_0x6a78('0xb'),'paranoid':![],'indexes':[{'fields':[_0x6a78('0xc'),_0x6a78('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d19=['../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x6d19,0x160));var _0x96d1=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x6d19[_0x35da42];return _0x370035;};'use strict';var _=require(_0x96d1('0x0'));var util=require(_0x96d1('0x1'));var logger=require(_0x96d1('0x2'))(_0x96d1('0x3'));var moment=require(_0x96d1('0x4'));var BPromise=require(_0x96d1('0x5'));var rp=require(_0x96d1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x96d1('0x7'));var config=require(_0x96d1('0x8'));var attributes=require(_0x96d1('0x9'));module[_0x96d1('0xa')]=function(_0x58854b,_0x32b7d9){return _0x58854b[_0x96d1('0xb')](_0x96d1('0xc'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x96d1('0xd'),_0x96d1('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 0bf5fd5..9f0575c 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 _0x2d02=['limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','then','stringify','where','attributes'];(function(_0x1bd874,_0x51db36){var _0x358255=function(_0x34844a){while(--_0x34844a){_0x1bd874['push'](_0x1bd874['shift']());}};_0x358255(++_0x51db36);}(_0x2d02,0xac));var _0x22d0=function(_0x48600b,_0x867081){_0x48600b=_0x48600b-0x0;var _0x4e6e60=_0x2d02[_0x48600b];return _0x4e6e60;};'use strict';var _=require(_0x22d0('0x0'));var util=require(_0x22d0('0x1'));var moment=require(_0x22d0('0x2'));var BPromise=require(_0x22d0('0x3'));var rs=require(_0x22d0('0x4'));var fs=require('fs');var Redis=require(_0x22d0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x22d0('0x6'));var logger=require(_0x22d0('0x7'))('rpc');var config=require(_0x22d0('0x8'));var jayson=require(_0x22d0('0x9'));var client=jayson['client'][_0x22d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44f894,_0xbaf18b,_0x49bc01){return new BPromise(function(_0x198e96,_0x3f882c){return client[_0x22d0('0xb')](_0x44f894,_0x49bc01)['then'](function(_0x2a814f){logger[_0x22d0('0xc')](_0x22d0('0xd'),_0xbaf18b,_0x22d0('0xe'));logger[_0x22d0('0xf')](_0x22d0('0x10'),_0xbaf18b,'request\x20sent',JSON['stringify'](_0x2a814f));if(_0x2a814f['error']){if(_0x2a814f[_0x22d0('0x11')][_0x22d0('0x12')]===0x1f4){logger['error'](_0x22d0('0xd'),_0xbaf18b,_0x2a814f[_0x22d0('0x11')][_0x22d0('0x13')]);return _0x3f882c(_0x2a814f[_0x22d0('0x11')]['message']);}logger[_0x22d0('0x11')](_0x22d0('0xd'),_0xbaf18b,_0x2a814f['error'][_0x22d0('0x13')]);return _0x198e96(_0x2a814f['error'][_0x22d0('0x13')]);}else{logger[_0x22d0('0xc')](_0x22d0('0xd'),_0xbaf18b,_0x22d0('0xe'));_0x198e96(_0x2a814f[_0x22d0('0x14')][_0x22d0('0x13')]);}})[_0x22d0('0x15')](function(_0x53e537){logger[_0x22d0('0x11')](_0x22d0('0xd'),_0xbaf18b,_0x53e537);_0x3f882c(_0x53e537);});});}exports[_0x22d0('0x16')]=function(_0xb0a158){var _0x25b737=this;return new Promise(function(_0x51afc6,_0xb04812){return db[_0x22d0('0x17')][_0x22d0('0x18')](_0xb0a158[_0x22d0('0x19')],{'raw':_0xb0a158['options']?_0xb0a158[_0x22d0('0x1a')][_0x22d0('0x1b')]===undefined?!![]:![]:!![]})[_0x22d0('0x1c')](function(_0x25f32f){logger['info']('CreateVoiceAgentReport',_0xb0a158);logger[_0x22d0('0xf')](_0x22d0('0x16'),_0xb0a158,JSON[_0x22d0('0x1d')](_0x25f32f));_0x51afc6(_0x25f32f);})['catch'](function(_0xcb1987){logger[_0x22d0('0x11')]('CreateVoiceAgentReport',_0xcb1987[_0x22d0('0x13')],_0xb0a158);_0xb04812(_0x25b737[_0x22d0('0x11')](0x1f4,_0xcb1987['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x52997b){var _0x342ebb=this;return new Promise(function(_0x106167,_0x5c2267){return db[_0x22d0('0x17')]['update'](_0x52997b[_0x22d0('0x19')],{'raw':_0x52997b['options']?_0x52997b[_0x22d0('0x1a')][_0x22d0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52997b[_0x22d0('0x1a')]?_0x52997b[_0x22d0('0x1a')][_0x22d0('0x1e')]||null:null,'attributes':_0x52997b[_0x22d0('0x1a')]?_0x52997b[_0x22d0('0x1a')][_0x22d0('0x1f')]||null:null,'limit':_0x52997b[_0x22d0('0x1a')]?_0x52997b['options'][_0x22d0('0x20')]||null:null})[_0x22d0('0x1c')](function(_0xb3c158){logger['info'](_0x22d0('0x21'),_0x52997b);logger[_0x22d0('0xf')](_0x22d0('0x21'),_0x52997b,JSON[_0x22d0('0x1d')](_0xb3c158));_0x106167(_0xb3c158);})['catch'](function(_0x18194e){logger[_0x22d0('0x11')](_0x22d0('0x21'),_0x18194e[_0x22d0('0x13')],_0x52997b);_0x5c2267(_0x342ebb[_0x22d0('0x11')](0x1f4,_0x18194e[_0x22d0('0x13')]));});});}; \ No newline at end of file +var _0x540b=['VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','stringify','where','limit','UpdateVoiceAgentReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','then','info','VoiceAgentReport,\x20%s,\x20%s','debug'];(function(_0x47b18c,_0x28dff1){var _0x1c53c4=function(_0x3259d8){while(--_0x3259d8){_0x47b18c['push'](_0x47b18c['shift']());}};_0x1c53c4(++_0x28dff1);}(_0x540b,0x160));var _0xb540=function(_0x32abdb,_0x1f62c8){_0x32abdb=_0x32abdb-0x0;var _0x20e8e8=_0x540b[_0x32abdb];return _0x20e8e8;};'use strict';var _=require('lodash');var util=require(_0xb540('0x0'));var moment=require(_0xb540('0x1'));var BPromise=require('bluebird');var rs=require(_0xb540('0x2'));var fs=require('fs');var Redis=require(_0xb540('0x3'));var db=require(_0xb540('0x4'))['db'];var utils=require(_0xb540('0x5'));var logger=require('../../config/logger')(_0xb540('0x6'));var config=require(_0xb540('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x17d294,_0x1a2aca,_0x152519){return new BPromise(function(_0x56824e,_0x3937a7){return client['request'](_0x17d294,_0x152519)[_0xb540('0x8')](function(_0x49b266){logger[_0xb540('0x9')](_0xb540('0xa'),_0x1a2aca,'request\x20sent');logger[_0xb540('0xb')](_0xb540('0xc'),_0x1a2aca,_0xb540('0xd'),JSON['stringify'](_0x49b266));if(_0x49b266['error']){if(_0x49b266[_0xb540('0xe')]['code']===0x1f4){logger[_0xb540('0xe')](_0xb540('0xa'),_0x1a2aca,_0x49b266['error']['message']);return _0x3937a7(_0x49b266[_0xb540('0xe')][_0xb540('0xf')]);}logger[_0xb540('0xe')](_0xb540('0xa'),_0x1a2aca,_0x49b266[_0xb540('0xe')][_0xb540('0xf')]);return _0x56824e(_0x49b266[_0xb540('0xe')][_0xb540('0xf')]);}else{logger['info'](_0xb540('0xa'),_0x1a2aca,_0xb540('0xd'));_0x56824e(_0x49b266[_0xb540('0x10')]['message']);}})[_0xb540('0x11')](function(_0x2898b8){logger[_0xb540('0xe')](_0xb540('0xa'),_0x1a2aca,_0x2898b8);_0x3937a7(_0x2898b8);});});}exports[_0xb540('0x12')]=function(_0x23577f){var _0x44e4a0=this;return new Promise(function(_0xc7020f,_0x1ec5dd){return db[_0xb540('0x13')][_0xb540('0x14')](_0x23577f[_0xb540('0x15')],{'raw':_0x23577f[_0xb540('0x16')]?_0x23577f[_0xb540('0x16')][_0xb540('0x17')]===undefined?!![]:![]:!![]})[_0xb540('0x8')](function(_0x6213ab){logger[_0xb540('0x9')](_0xb540('0x12'),_0x23577f);logger['debug'](_0xb540('0x12'),_0x23577f,JSON[_0xb540('0x18')](_0x6213ab));_0xc7020f(_0x6213ab);})[_0xb540('0x11')](function(_0x3abe8f){logger[_0xb540('0xe')](_0xb540('0x12'),_0x3abe8f['message'],_0x23577f);_0x1ec5dd(_0x44e4a0[_0xb540('0xe')](0x1f4,_0x3abe8f['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x29fbda){var _0x2538b4=this;return new Promise(function(_0x1058c0,_0x4f0aa3){return db[_0xb540('0x13')]['update'](_0x29fbda['body'],{'raw':_0x29fbda[_0xb540('0x16')]?_0x29fbda['options'][_0xb540('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29fbda['options']?_0x29fbda[_0xb540('0x16')][_0xb540('0x19')]||null:null,'attributes':_0x29fbda[_0xb540('0x16')]?_0x29fbda['options']['attributes']||null:null,'limit':_0x29fbda[_0xb540('0x16')]?_0x29fbda['options'][_0xb540('0x1a')]||null:null})[_0xb540('0x8')](function(_0x5ecbe1){logger['info'](_0xb540('0x1b'),_0x29fbda);logger[_0xb540('0xb')](_0xb540('0x1b'),_0x29fbda,JSON['stringify'](_0x5ecbe1));_0x1058c0(_0x5ecbe1);})[_0xb540('0x11')](function(_0xcbd9e3){logger[_0xb540('0xe')]('UpdateVoiceAgentReport',_0xcbd9e3[_0xb540('0xf')],_0x29fbda);_0x4f0aa3(_0x2538b4[_0xb540('0xe')](0x1f4,_0xcbd9e3[_0xb540('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index e796e37..42ea170 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 _0xf006=['post','create','put','update','destroy','exports','path','connect-timeout','Router','../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x22a1e0,_0x279d8b){var _0x5d0dc7=function(_0x421aff){while(--_0x421aff){_0x22a1e0['push'](_0x22a1e0['shift']());}};_0x5d0dc7(++_0x279d8b);}(_0xf006,0x146));var _0x6f00=function(_0x49c48a,_0x246b54){_0x49c48a=_0x49c48a-0x0;var _0x54d95f=_0xf006[_0x49c48a];return _0x54d95f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f00('0x0'));var timeout=require(_0x6f00('0x1'));var express=require('express');var router=express[_0x6f00('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6f00('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f00('0x4'));router[_0x6f00('0x5')]('/',auth[_0x6f00('0x6')](),controller['index']);router[_0x6f00('0x5')]('/describe',auth[_0x6f00('0x6')](),controller[_0x6f00('0x7')]);router[_0x6f00('0x5')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0x9')]);router[_0x6f00('0xa')]('/',auth[_0x6f00('0x6')](),controller[_0x6f00('0xb')]);router[_0x6f00('0xc')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xd')]);router['delete'](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xe')]);module[_0x6f00('0xf')]=router; \ No newline at end of file +var _0x4c4e=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','delete','destroy','multer','path','connect-timeout','express'];(function(_0x58de4c,_0x8c01eb){var _0x12af81=function(_0x19d453){while(--_0x19d453){_0x58de4c['push'](_0x58de4c['shift']());}};_0x12af81(++_0x8c01eb);}(_0x4c4e,0x152));var _0xe4c4=function(_0x125ad8,_0xed6782){_0x125ad8=_0x125ad8-0x0;var _0x509a59=_0x4c4e[_0x125ad8];return _0x509a59;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var fs_extra=require(_0xe4c4('0x4'));var auth=require(_0xe4c4('0x5'));var interaction=require(_0xe4c4('0x6'));var config=require('../../config/environment');var controller=require(_0xe4c4('0x7'));router['get']('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x9')]);router[_0xe4c4('0xa')](_0xe4c4('0xb'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xc')]);router[_0xe4c4('0xa')](_0xe4c4('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe4c4('0xe')]('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xf')]);router[_0xe4c4('0x10')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller['update']);router[_0xe4c4('0x11')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index b94dd1e..072adeb 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 _0x87ef=['outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','STRING','ENUM','inbound','internal'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87ef,0x13f));var _0xf87e=function(_0x31c19c,_0xbe4b70){_0x31c19c=_0x31c19c-0x0;var _0x1a87f7=_0x87ef[_0x31c19c];return _0x1a87f7;};'use strict';var Sequelize=require(_0xf87e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xf87e('0x1')]},'type':{'type':Sequelize[_0xf87e('0x2')](_0xf87e('0x3'),_0xf87e('0x4'),_0xf87e('0x5'),_0xf87e('0x6'),_0xf87e('0x7'),_0xf87e('0x8'))},'tag':{'type':Sequelize[_0xf87e('0x1')]},'accountcode':{'type':Sequelize[_0xf87e('0x1')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xf87e('0x1')]},'destinationcontext':{'type':Sequelize[_0xf87e('0x1')]},'callerid':{'type':Sequelize[_0xf87e('0x1')]},'channel':{'type':Sequelize[_0xf87e('0x1')]},'destinationchannel':{'type':Sequelize[_0xf87e('0x1')]},'lastapplication':{'type':Sequelize[_0xf87e('0x1')]},'lastdata':{'type':Sequelize[_0xf87e('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xf87e('0xa')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf87e('0xa')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xf87e('0xb')]},'mohtime':{'type':Sequelize[_0xf87e('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf87e('0x1')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xf87e('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xf87e('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xf87e('0x1')]},'note':{'type':Sequelize[_0xf87e('0x1')]},'prefix':{'type':Sequelize[_0xf87e('0x1')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1ae6=['ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x23f6b1,_0x4af15a){var _0x13766a=function(_0x841615){while(--_0x841615){_0x23f6b1['push'](_0x23f6b1['shift']());}};_0x13766a(++_0x4af15a);}(_0x1ae6,0x65));var _0x61ae=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x1ae6[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0x61ae('0x0'));module[_0x61ae('0x1')]={'uniqueid':{'type':Sequelize[_0x61ae('0x2')]},'type':{'type':Sequelize[_0x61ae('0x3')](_0x61ae('0x4'),_0x61ae('0x5'),_0x61ae('0x6'),_0x61ae('0x7'),_0x61ae('0x8'),_0x61ae('0x9'))},'tag':{'type':Sequelize[_0x61ae('0x2')]},'accountcode':{'type':Sequelize[_0x61ae('0x2')]},'source':{'type':Sequelize[_0x61ae('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x61ae('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x61ae('0xa')]},'starttime':{'type':Sequelize[_0x61ae('0xb')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x61ae('0xc')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x61ae('0xc')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x61ae('0x2')]},'amaflags':{'type':Sequelize[_0x61ae('0x2')]},'userfield':{'type':Sequelize[_0x61ae('0x2')]},'userDisposition':{'type':Sequelize[_0x61ae('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x61ae('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x61ae('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x61ae('0xc')]},'sipcallid':{'type':Sequelize[_0x61ae('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index aeff532..2b38088 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 _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x381329,_0x18ce38){var _0xff7923=function(_0x1bfcde){while(--_0x1bfcde){_0x381329['push'](_0x381329['shift']());}};_0xff7923(++_0x18ce38);}(_0xdb28,0x106));var _0x8db2=function(_0x3e491,_0x111d33){_0x3e491=_0x3e491-0x0;var _0x5af946=_0xdb28[_0x3e491];return _0x5af946;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index de0908b..4fdc645 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 _0xf0f4=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','VoiceCallReport','report_call','uniqueid','lodash'];(function(_0x3b9289,_0x90e91d){var _0x521cd7=function(_0x400382){while(--_0x400382){_0x3b9289['push'](_0x3b9289['shift']());}};_0x521cd7(++_0x90e91d);}(_0xf0f4,0x1d3));var _0x4f0f=function(_0x4c3398,_0x3a5ff0){_0x4c3398=_0x4c3398-0x0;var _0xe252fc=_0xf0f4[_0x4c3398];return _0xe252fc;};'use strict';var _=require(_0x4f0f('0x0'));var util=require(_0x4f0f('0x1'));var logger=require(_0x4f0f('0x2'))(_0x4f0f('0x3'));var moment=require(_0x4f0f('0x4'));var BPromise=require(_0x4f0f('0x5'));var rp=require(_0x4f0f('0x6'));var fs=require('fs');var path=require(_0x4f0f('0x7'));var rimraf=require('rimraf');var config=require(_0x4f0f('0x8'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x21ee5d,_0x53e4b5){return _0x21ee5d['define'](_0x4f0f('0x9'),attributes,{'tableName':_0x4f0f('0xa'),'paranoid':![],'indexes':[{'fields':[_0x4f0f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x79d3=['rimraf','exports','define','VoiceCallReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x524e23,_0x1e2aa7){var _0x231413=function(_0x22ac35){while(--_0x22ac35){_0x524e23['push'](_0x524e23['shift']());}};_0x231413(++_0x1e2aa7);}(_0x79d3,0x179));var _0x379d=function(_0xfb86f6,_0x127103){_0xfb86f6=_0xfb86f6-0x0;var _0x534a4b=_0x79d3[_0xfb86f6];return _0x534a4b;};'use strict';var _=require(_0x379d('0x0'));var util=require(_0x379d('0x1'));var logger=require(_0x379d('0x2'))(_0x379d('0x3'));var moment=require(_0x379d('0x4'));var BPromise=require(_0x379d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x379d('0x6'));var rimraf=require(_0x379d('0x7'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0x379d('0x8')]=function(_0x18b0be,_0x2a0f02){return _0x18b0be[_0x379d('0x9')](_0x379d('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x379d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 996fab1..c9ffc8d 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 _0x86ae=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','GetVoiceCallReport','VoiceCallReport','findAll','options','attributes','limit','include','map','model','create','body','raw','CreateVoiceCallReport','catch','UpdateVoiceCallReport','where','lodash','util','bluebird','randomstring'];(function(_0x21da21,_0x23c690){var _0x2998c3=function(_0x8b97b2){while(--_0x8b97b2){_0x21da21['push'](_0x21da21['shift']());}};_0x2998c3(++_0x23c690);}(_0x86ae,0x152));var _0xe86a=function(_0x24ff54,_0x524b48){_0x24ff54=_0x24ff54-0x0;var _0x4bb560=_0x86ae[_0x24ff54];return _0x4bb560;};'use strict';var _=require(_0xe86a('0x0'));var util=require(_0xe86a('0x1'));var moment=require('moment');var BPromise=require(_0xe86a('0x2'));var rs=require(_0xe86a('0x3'));var fs=require('fs');var Redis=require(_0xe86a('0x4'));var db=require(_0xe86a('0x5'))['db'];var utils=require(_0xe86a('0x6'));var logger=require(_0xe86a('0x7'))('rpc');var config=require(_0xe86a('0x8'));var jayson=require(_0xe86a('0x9'));var client=jayson[_0xe86a('0xa')][_0xe86a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f6918,_0x3c6bd3,_0x38e7bf){return new BPromise(function(_0x3cdef0,_0x559834){return client['request'](_0x2f6918,_0x38e7bf)[_0xe86a('0xc')](function(_0x4e365c){logger[_0xe86a('0xd')](_0xe86a('0xe'),_0x3c6bd3,'request\x20sent');logger[_0xe86a('0xf')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x3c6bd3,'request\x20sent',JSON[_0xe86a('0x10')](_0x4e365c));if(_0x4e365c[_0xe86a('0x11')]){if(_0x4e365c['error'][_0xe86a('0x12')]===0x1f4){logger[_0xe86a('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x3c6bd3,_0x4e365c['error']['message']);return _0x559834(_0x4e365c[_0xe86a('0x11')][_0xe86a('0x13')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x3c6bd3,_0x4e365c[_0xe86a('0x11')][_0xe86a('0x13')]);return _0x3cdef0(_0x4e365c[_0xe86a('0x11')][_0xe86a('0x13')]);}else{logger[_0xe86a('0xd')](_0xe86a('0xe'),_0x3c6bd3,_0xe86a('0x14'));_0x3cdef0(_0x4e365c[_0xe86a('0x15')][_0xe86a('0x13')]);}})['catch'](function(_0x2dadf1){logger['error'](_0xe86a('0xe'),_0x3c6bd3,_0x2dadf1);_0x559834(_0x2dadf1);});});}exports[_0xe86a('0x16')]=function(_0x8ece55){var _0x2b7c80=this;return new Promise(function(_0x2641e4,_0x4903e9){return db[_0xe86a('0x17')][_0xe86a('0x18')]({'raw':_0x8ece55[_0xe86a('0x19')]?_0x8ece55[_0xe86a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x8ece55['options']?_0x8ece55[_0xe86a('0x19')]['where']||null:null,'attributes':_0x8ece55[_0xe86a('0x19')]?_0x8ece55['options'][_0xe86a('0x1a')]||null:null,'limit':_0x8ece55[_0xe86a('0x19')]?_0x8ece55[_0xe86a('0x19')][_0xe86a('0x1b')]||null:null,'include':_0x8ece55[_0xe86a('0x19')]?_0x8ece55[_0xe86a('0x19')][_0xe86a('0x1c')]?_[_0xe86a('0x1d')](_0x8ece55[_0xe86a('0x19')]['include'],function(_0x91d53a){return{'model':db[_0x91d53a['model']],'as':_0x91d53a['as'],'attributes':_0x91d53a[_0xe86a('0x1a')],'include':_0x91d53a['include']?_[_0xe86a('0x1d')](_0x91d53a[_0xe86a('0x1c')],function(_0x19c889){return{'model':db[_0x19c889['model']],'as':_0x19c889['as'],'attributes':_0x19c889['attributes'],'include':_0x19c889['include']?_[_0xe86a('0x1d')](_0x19c889[_0xe86a('0x1c')],function(_0x14a8a4){return{'model':db[_0x14a8a4[_0xe86a('0x1e')]],'as':_0x14a8a4['as'],'attributes':_0x14a8a4[_0xe86a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe86a('0xc')](function(_0x57004b){logger[_0xe86a('0xd')](_0xe86a('0x16'),_0x8ece55);logger[_0xe86a('0xf')](_0xe86a('0x16'),_0x8ece55,JSON['stringify'](_0x57004b));_0x2641e4(_0x57004b);})['catch'](function(_0x3adfc0){logger['error']('GetVoiceCallReport',_0x3adfc0[_0xe86a('0x13')],_0x8ece55);_0x4903e9(_0x2b7c80[_0xe86a('0x11')](0x1f4,_0x3adfc0[_0xe86a('0x13')]));});});};exports['CreateVoiceCallReport']=function(_0x5e1a61){var _0x1b1b8a=this;return new Promise(function(_0x2f39af,_0x237233){return db[_0xe86a('0x17')][_0xe86a('0x1f')](_0x5e1a61[_0xe86a('0x20')],{'raw':_0x5e1a61[_0xe86a('0x19')]?_0x5e1a61[_0xe86a('0x19')][_0xe86a('0x21')]===undefined?!![]:![]:!![]})[_0xe86a('0xc')](function(_0x4fb0bf){logger[_0xe86a('0xd')](_0xe86a('0x22'),_0x5e1a61);logger[_0xe86a('0xf')](_0xe86a('0x22'),_0x5e1a61,JSON[_0xe86a('0x10')](_0x4fb0bf));_0x2f39af(_0x4fb0bf);})[_0xe86a('0x23')](function(_0x32adc3){logger[_0xe86a('0x11')](_0xe86a('0x22'),_0x32adc3[_0xe86a('0x13')],_0x5e1a61);_0x237233(_0x1b1b8a['error'](0x1f4,_0x32adc3[_0xe86a('0x13')]));});});};exports[_0xe86a('0x24')]=function(_0x28ba75){var _0x4520c=this;return new Promise(function(_0x164ce8,_0x324319){return db[_0xe86a('0x17')]['update'](_0x28ba75[_0xe86a('0x20')],{'raw':_0x28ba75[_0xe86a('0x19')]?_0x28ba75['options'][_0xe86a('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28ba75['options']?_0x28ba75['options'][_0xe86a('0x25')]||null:null,'attributes':_0x28ba75[_0xe86a('0x19')]?_0x28ba75[_0xe86a('0x19')][_0xe86a('0x1a')]||null:null,'limit':_0x28ba75['options']?_0x28ba75[_0xe86a('0x19')]['limit']||null:null})['then'](function(_0x402123){logger[_0xe86a('0xd')](_0xe86a('0x24'),_0x28ba75);logger[_0xe86a('0xf')]('UpdateVoiceCallReport',_0x28ba75,JSON['stringify'](_0x402123));_0x164ce8(_0x402123);})['catch'](function(_0x9f8e32){logger[_0xe86a('0x11')]('UpdateVoiceCallReport',_0x9f8e32[_0xe86a('0x13')],_0x28ba75);_0x324319(_0x4520c[_0xe86a('0x11')](0x1f4,_0x9f8e32['message']));});});}; \ No newline at end of file +var _0x5044=['findAll','options','raw','where','attributes','limit','map','model','include','VoiceCallReport','CreateVoiceCallReport','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport'];(function(_0x6176d2,_0x207dfb){var _0x17d90e=function(_0x1895ad){while(--_0x1895ad){_0x6176d2['push'](_0x6176d2['shift']());}};_0x17d90e(++_0x207dfb);}(_0x5044,0x117));var _0x4504=function(_0x1f2f0d,_0x2ed845){_0x1f2f0d=_0x1f2f0d-0x0;var _0x43a1ed=_0x5044[_0x1f2f0d];return _0x43a1ed;};'use strict';var _=require(_0x4504('0x0'));var util=require(_0x4504('0x1'));var moment=require(_0x4504('0x2'));var BPromise=require(_0x4504('0x3'));var rs=require(_0x4504('0x4'));var fs=require('fs');var Redis=require(_0x4504('0x5'));var db=require(_0x4504('0x6'))['db'];var utils=require(_0x4504('0x7'));var logger=require('../../config/logger')(_0x4504('0x8'));var config=require(_0x4504('0x9'));var jayson=require(_0x4504('0xa'));var client=jayson['client'][_0x4504('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x463831,_0x68c80c,_0x241faa){return new BPromise(function(_0x3673e2,_0x553893){return client[_0x4504('0xc')](_0x463831,_0x241faa)['then'](function(_0x452c84){logger[_0x4504('0xd')](_0x4504('0xe'),_0x68c80c,_0x4504('0xf'));logger[_0x4504('0x10')](_0x4504('0x11'),_0x68c80c,'request\x20sent',JSON[_0x4504('0x12')](_0x452c84));if(_0x452c84[_0x4504('0x13')]){if(_0x452c84[_0x4504('0x13')][_0x4504('0x14')]===0x1f4){logger[_0x4504('0x13')](_0x4504('0xe'),_0x68c80c,_0x452c84['error'][_0x4504('0x15')]);return _0x553893(_0x452c84[_0x4504('0x13')]['message']);}logger[_0x4504('0x13')](_0x4504('0xe'),_0x68c80c,_0x452c84[_0x4504('0x13')][_0x4504('0x15')]);return _0x3673e2(_0x452c84[_0x4504('0x13')][_0x4504('0x15')]);}else{logger['info'](_0x4504('0xe'),_0x68c80c,_0x4504('0xf'));_0x3673e2(_0x452c84[_0x4504('0x16')][_0x4504('0x15')]);}})[_0x4504('0x17')](function(_0xa499c2){logger['error'](_0x4504('0xe'),_0x68c80c,_0xa499c2);_0x553893(_0xa499c2);});});}exports[_0x4504('0x18')]=function(_0x3dc3c2){var _0xd7dc6f=this;return new Promise(function(_0x584453,_0x195a34){return db['VoiceCallReport'][_0x4504('0x19')]({'raw':_0x3dc3c2[_0x4504('0x1a')]?_0x3dc3c2['options'][_0x4504('0x1b')]===undefined?!![]:![]:!![],'where':_0x3dc3c2[_0x4504('0x1a')]?_0x3dc3c2['options'][_0x4504('0x1c')]||null:null,'attributes':_0x3dc3c2[_0x4504('0x1a')]?_0x3dc3c2[_0x4504('0x1a')][_0x4504('0x1d')]||null:null,'limit':_0x3dc3c2['options']?_0x3dc3c2[_0x4504('0x1a')][_0x4504('0x1e')]||null:null,'include':_0x3dc3c2['options']?_0x3dc3c2[_0x4504('0x1a')]['include']?_[_0x4504('0x1f')](_0x3dc3c2[_0x4504('0x1a')]['include'],function(_0x7e71f6){return{'model':db[_0x7e71f6[_0x4504('0x20')]],'as':_0x7e71f6['as'],'attributes':_0x7e71f6['attributes'],'include':_0x7e71f6[_0x4504('0x21')]?_[_0x4504('0x1f')](_0x7e71f6[_0x4504('0x21')],function(_0xdc9aac){return{'model':db[_0xdc9aac[_0x4504('0x20')]],'as':_0xdc9aac['as'],'attributes':_0xdc9aac[_0x4504('0x1d')],'include':_0xdc9aac[_0x4504('0x21')]?_['map'](_0xdc9aac['include'],function(_0x35d59d){return{'model':db[_0x35d59d['model']],'as':_0x35d59d['as'],'attributes':_0x35d59d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x57a87c){logger[_0x4504('0xd')](_0x4504('0x18'),_0x3dc3c2);logger[_0x4504('0x10')](_0x4504('0x18'),_0x3dc3c2,JSON['stringify'](_0x57a87c));_0x584453(_0x57a87c);})[_0x4504('0x17')](function(_0x4d8352){logger[_0x4504('0x13')](_0x4504('0x18'),_0x4d8352['message'],_0x3dc3c2);_0x195a34(_0xd7dc6f[_0x4504('0x13')](0x1f4,_0x4d8352['message']));});});};exports['CreateVoiceCallReport']=function(_0xae2096){var _0x308324=this;return new Promise(function(_0x51813d,_0x26e961){return db[_0x4504('0x22')]['create'](_0xae2096['body'],{'raw':_0xae2096[_0x4504('0x1a')]?_0xae2096['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x24af5b){logger[_0x4504('0xd')](_0x4504('0x23'),_0xae2096);logger[_0x4504('0x10')]('CreateVoiceCallReport',_0xae2096,JSON[_0x4504('0x12')](_0x24af5b));_0x51813d(_0x24af5b);})['catch'](function(_0xf14e7f){logger[_0x4504('0x13')]('CreateVoiceCallReport',_0xf14e7f[_0x4504('0x15')],_0xae2096);_0x26e961(_0x308324[_0x4504('0x13')](0x1f4,_0xf14e7f['message']));});});};exports[_0x4504('0x24')]=function(_0xca0d6b){var _0x2996ec=this;return new Promise(function(_0x72c70d,_0x1a4797){return db[_0x4504('0x22')][_0x4504('0x25')](_0xca0d6b['body'],{'raw':_0xca0d6b['options']?_0xca0d6b['options'][_0x4504('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xca0d6b['options']?_0xca0d6b[_0x4504('0x1a')]['where']||null:null,'attributes':_0xca0d6b[_0x4504('0x1a')]?_0xca0d6b[_0x4504('0x1a')][_0x4504('0x1d')]||null:null,'limit':_0xca0d6b['options']?_0xca0d6b[_0x4504('0x1a')][_0x4504('0x1e')]||null:null})['then'](function(_0x334a58){logger[_0x4504('0xd')](_0x4504('0x24'),_0xca0d6b);logger[_0x4504('0x10')](_0x4504('0x24'),_0xca0d6b,JSON[_0x4504('0x12')](_0x334a58));_0x72c70d(_0x334a58);})[_0x4504('0x17')](function(_0x35c8f2){logger[_0x4504('0x13')](_0x4504('0x24'),_0x35c8f2[_0x4504('0x15')],_0xca0d6b);_0x1a4797(_0x2996ec[_0x4504('0x13')](0x1f4,_0x35c8f2['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 798777a..dbb6f91 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 _0xf50a=['get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4914f3,_0x1f865e){var _0x48129b=function(_0x108ddd){while(--_0x108ddd){_0x4914f3['push'](_0x4914f3['shift']());}};_0x48129b(++_0x1f865e);}(_0xf50a,0x1f0));var _0xaf50=function(_0x509f97,_0x442414){_0x509f97=_0x509f97-0x0;var _0x18bbef=_0xf50a[_0x509f97];return _0x18bbef;};'use strict';var multer=require(_0xaf50('0x0'));var util=require('util');var path=require(_0xaf50('0x1'));var timeout=require(_0xaf50('0x2'));var express=require(_0xaf50('0x3'));var router=express[_0xaf50('0x4')]();var fs_extra=require(_0xaf50('0x5'));var auth=require(_0xaf50('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaf50('0x7'));var controller=require('./voiceChanSpy.controller');router[_0xaf50('0x8')]('/',auth['isAuthenticated'](),controller[_0xaf50('0x9')]);router[_0xaf50('0x8')](_0xaf50('0xa'),auth[_0xaf50('0xb')](),controller['show']);router[_0xaf50('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xaf50('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xaf50('0xe')]);router[_0xaf50('0xf')]('/:id',auth[_0xaf50('0xb')](),controller[_0xaf50('0x10')]);module[_0xaf50('0x11')]=router; \ No newline at end of file +var _0x53fd=['fs-extra','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','Router'];(function(_0x270b84,_0x3588e1){var _0x5e19ab=function(_0x329a50){while(--_0x329a50){_0x270b84['push'](_0x270b84['shift']());}};_0x5e19ab(++_0x3588e1);}(_0x53fd,0x1a6));var _0xd53f=function(_0x594a71,_0x1347b7){_0x594a71=_0x594a71-0x0;var _0x480fc5=_0x53fd[_0x594a71];return _0x480fc5;};'use strict';var multer=require(_0xd53f('0x0'));var util=require(_0xd53f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd53f('0x2')]();var fs_extra=require(_0xd53f('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd53f('0x4'));var controller=require(_0xd53f('0x5'));router[_0xd53f('0x6')]('/',auth['isAuthenticated'](),controller[_0xd53f('0x7')]);router[_0xd53f('0x6')](_0xd53f('0x8'),auth[_0xd53f('0x9')](),controller[_0xd53f('0xa')]);router['post']('/',auth[_0xd53f('0x9')](),controller[_0xd53f('0xb')]);router[_0xd53f('0xc')]('/:id',auth[_0xd53f('0x9')](),controller[_0xd53f('0xd')]);router[_0xd53f('0xe')]('/:id',auth[_0xd53f('0x9')](),controller[_0xd53f('0xf')]);module[_0xd53f('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 13b27d9..612d0c7 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 _0x75d4=['BOOLEAN','STRING','name','setDataValue','options','getDataValue','split'];(function(_0x40b2a7,_0x1c69f8){var _0x30a81a=function(_0xb1c60){while(--_0xb1c60){_0x40b2a7['push'](_0x40b2a7['shift']());}};_0x30a81a(++_0x1c69f8);}(_0x75d4,0x1b3));var _0x475d=function(_0x3d8d4d,_0x367ca1){_0x3d8d4d=_0x3d8d4d-0x0;var _0x1a0674=_0x75d4[_0x3d8d4d];return _0x1a0674;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x475d('0x0')]},'prefix':{'type':Sequelize[_0x475d('0x0')],'unique':_0x475d('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0x475d('0x0')],'set':function(_0x45a9fb){this[_0x475d('0x2')](_0x475d('0x3'),_0x45a9fb?_0x45a9fb['join'](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0x475d('0x4')]('options')[_0x475d('0x5')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x475d('0x0')]},'record':{'type':Sequelize[_0x475d('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x475d('0x0')]},'description':{'type':Sequelize[_0x475d('0x0')]}}; \ No newline at end of file +var _0xa775=['setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x1ccf79,_0x8ba45b){var _0x12319a=function(_0x5c5b66){while(--_0x5c5b66){_0x1ccf79['push'](_0x1ccf79['shift']());}};_0x12319a(++_0x8ba45b);}(_0xa775,0x1b4));var _0x5a77=function(_0x4af092,_0x31588d){_0x4af092=_0x4af092-0x0;var _0x259a06=_0xa775[_0x4af092];return _0x259a06;};'use strict';var Sequelize=require(_0x5a77('0x0'));module[_0x5a77('0x1')]={'name':{'type':Sequelize[_0x5a77('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x5a77('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x5a77('0x2')],'set':function(_0x491f15){this[_0x5a77('0x4')](_0x5a77('0x5'),_0x491f15?_0x491f15[_0x5a77('0x6')](''):[]);},'get':function(){return this[_0x5a77('0x7')](_0x5a77('0x5'))?this[_0x5a77('0x7')](_0x5a77('0x5'))[_0x5a77('0x8')](''):[];}},'auth':{'type':Sequelize[_0x5a77('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x5a77('0x2')]},'record':{'type':Sequelize[_0x5a77('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x5a77('0x2')]},'description':{'type':Sequelize[_0x5a77('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 064b12f..d0bfebf 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 _0x19ea=['findAll','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','fast-json-patch','moment','bluebird','mustache','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','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','type','key','keys','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','where','merge','options','includeAll','include'];(function(_0x3c6442,_0x488c4c){var _0xa80893=function(_0x23af0d){while(--_0x23af0d){_0x3c6442['push'](_0x3c6442['shift']());}};_0xa80893(++_0x488c4c);}(_0x19ea,0xfe));var _0xa19e=function(_0x4e4f0e,_0x1c3892){_0x4e4f0e=_0x4e4f0e-0x0;var _0x1a7219=_0x19ea[_0x4e4f0e];return _0x1a7219;};'use strict';var emlformat=require(_0xa19e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa19e('0x1'));var rp=require('request-promise');var moment=require(_0xa19e('0x2'));var BPromise=require(_0xa19e('0x3'));var Mustache=require(_0xa19e('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa19e('0x5'));var csv=require(_0xa19e('0x6'));var ejs=require(_0xa19e('0x7'));var fs=require('fs');var fs_extra=require(_0xa19e('0x8'));var _=require(_0xa19e('0x9'));var squel=require(_0xa19e('0xa'));var crypto=require(_0xa19e('0xb'));var jsforce=require(_0xa19e('0xc'));var deskjs=require(_0xa19e('0xd'));var toCsv=require(_0xa19e('0x6'));var querystring=require(_0xa19e('0xe'));var Papa=require('papaparse');var Redis=require(_0xa19e('0xf'));var authService=require(_0xa19e('0x10'));var qs=require(_0xa19e('0x11'));var as=require(_0xa19e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa19e('0x13'))(_0xa19e('0x14'));var utils=require(_0xa19e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa19e('0x16'));var db=require(_0xa19e('0x17'))['db'];function respondWithStatusCode(_0xc781a2,_0x1bd1f5){_0x1bd1f5=_0x1bd1f5||0xcc;return function(_0x35ca5b){if(_0x35ca5b){return _0xc781a2['sendStatus'](_0x1bd1f5);}return _0xc781a2[_0xa19e('0x18')](_0x1bd1f5)[_0xa19e('0x19')]();};}function respondWithResult(_0xa7e0c4,_0x28dedd){_0x28dedd=_0x28dedd||0xc8;return function(_0x564d2a){if(_0x564d2a){return _0xa7e0c4[_0xa19e('0x18')](_0x28dedd)[_0xa19e('0x1a')](_0x564d2a);}};}function respondWithFilteredResult(_0x245bcb,_0x3be281){return function(_0x1fdea2){if(_0x1fdea2){var _0x2598f5=typeof _0x3be281['offset']===_0xa19e('0x1b')&&typeof _0x3be281[_0xa19e('0x1c')]===_0xa19e('0x1b');var _0x256819=_0x1fdea2[_0xa19e('0x1d')];var _0x38e398=_0x2598f5?0x0:_0x3be281[_0xa19e('0x1e')];var _0x530a75=_0x2598f5?_0x1fdea2[_0xa19e('0x1d')]:_0x3be281['offset']+_0x3be281[_0xa19e('0x1c')];var _0x5d05fd;if(_0x530a75>=_0x256819){_0x530a75=_0x256819;_0x5d05fd=0xc8;}else{_0x5d05fd=0xce;}_0x245bcb['status'](_0x5d05fd);return _0x245bcb[_0xa19e('0x1f')](_0xa19e('0x20'),_0x38e398+'-'+_0x530a75+'/'+_0x256819)['json'](_0x1fdea2);}return null;};}function patchUpdates(_0x1cb9f9){return function(_0x3f2060){try{jsonpatch[_0xa19e('0x21')](_0x3f2060,_0x1cb9f9,!![]);}catch(_0x93eb86){return BPromise['reject'](_0x93eb86);}return _0x3f2060[_0xa19e('0x22')]();};}function saveUpdates(_0x33b588,_0x105874){return function(_0x301f6d){if(_0x301f6d){return _0x301f6d[_0xa19e('0x23')](_0x33b588)[_0xa19e('0x24')](function(_0x2a416e){return _0x2a416e;});}return null;};}function removeEntity(_0x20a649,_0xc16a44){return function(_0x536386){if(_0x536386){return _0x536386[_0xa19e('0x25')]()[_0xa19e('0x24')](function(){var _0x504437=_0x536386[_0xa19e('0x26')]({'plain':!![]});var _0x1d3ce6='ChanSpies';return db[_0xa19e('0x27')][_0xa19e('0x25')]({'where':{'type':_0x1d3ce6,'resourceId':_0x504437['id']}})['then'](function(){return _0x536386;});})[_0xa19e('0x24')](function(){_0x20a649[_0xa19e('0x18')](0xcc)[_0xa19e('0x19')]();});}};}function handleEntityNotFound(_0x21c9ca,_0x2076c5){return function(_0x180407){if(!_0x180407){_0x21c9ca[_0xa19e('0x28')](0x194);}return _0x180407;};}function handleError(_0x3f5ac6,_0x18c96f){_0x18c96f=_0x18c96f||0x1f4;return function(_0x24dd51){logger[_0xa19e('0x29')](_0x24dd51[_0xa19e('0x2a')]);if(_0x24dd51[_0xa19e('0x2b')]){delete _0x24dd51[_0xa19e('0x2b')];}_0x3f5ac6[_0xa19e('0x18')](_0x18c96f)[_0xa19e('0x2c')](_0x24dd51);};}exports[_0xa19e('0x2d')]=function(_0x27f3a0,_0x3dcd74){var _0x114656={},_0x557439={},_0x121c37={'count':0x0,'rows':[]};var _0x1311c5=_[_0xa19e('0x2e')](db[_0xa19e('0x2f')][_0xa19e('0x30')],function(_0x355fd9){return{'name':_0x355fd9['fieldName'],'type':_0x355fd9[_0xa19e('0x31')][_0xa19e('0x32')]};});_0x557439['model']=_[_0xa19e('0x2e')](_0x1311c5,'name');_0x557439['query']=_[_0xa19e('0x33')](_0x27f3a0['query']);_0x557439['filters']=_['intersection'](_0x557439[_0xa19e('0x34')],_0x557439[_0xa19e('0x35')]);_0x114656[_0xa19e('0x36')]=_['intersection'](_0x557439[_0xa19e('0x34')],qs[_0xa19e('0x37')](_0x27f3a0[_0xa19e('0x35')][_0xa19e('0x37')]));_0x114656[_0xa19e('0x36')]=_0x114656[_0xa19e('0x36')]['length']?_0x114656[_0xa19e('0x36')]:_0x557439[_0xa19e('0x34')];if(!_0x27f3a0['query'][_0xa19e('0x38')](_0xa19e('0x39'))){_0x114656[_0xa19e('0x1c')]=qs['limit'](_0x27f3a0['query'][_0xa19e('0x1c')]);_0x114656['offset']=qs[_0xa19e('0x1e')](_0x27f3a0[_0xa19e('0x35')][_0xa19e('0x1e')]);}_0x114656[_0xa19e('0x3a')]=qs['sort'](_0x27f3a0[_0xa19e('0x35')][_0xa19e('0x3b')]);_0x114656['where']=qs[_0xa19e('0x3c')](_['pick'](_0x27f3a0[_0xa19e('0x35')],_0x557439[_0xa19e('0x3c')]),_0x1311c5);if(_0x27f3a0[_0xa19e('0x35')]['filter']){_0x114656[_0xa19e('0x3d')]=_[_0xa19e('0x3e')](_0x114656[_0xa19e('0x3d')],{'$or':_['map'](_0x1311c5,function(_0xfcf01a){if(_0xfcf01a[_0xa19e('0x31')]!=='VIRTUAL'){var _0x561608={};_0x561608[_0xfcf01a[_0xa19e('0x2b')]]={'$like':'%'+_0x27f3a0[_0xa19e('0x35')]['filter']+'%'};return _0x561608;}})});}_0x114656=_[_0xa19e('0x3e')]({},_0x114656,_0x27f3a0[_0xa19e('0x3f')]);var _0x4b64d7={'where':_0x114656[_0xa19e('0x3d')]};return db[_0xa19e('0x2f')][_0xa19e('0x1d')](_0x4b64d7)[_0xa19e('0x24')](function(_0x30fdfb){_0x121c37['count']=_0x30fdfb;if(_0x27f3a0[_0xa19e('0x35')][_0xa19e('0x40')]){_0x114656[_0xa19e('0x41')]=[{'all':!![]}];}return db[_0xa19e('0x2f')][_0xa19e('0x42')](_0x114656);})['then'](function(_0x315341){_0x121c37['rows']=_0x315341;return _0x121c37;})[_0xa19e('0x24')](respondWithFilteredResult(_0x3dcd74,_0x114656))[_0xa19e('0x43')](handleError(_0x3dcd74,null));};exports['show']=function(_0x8dfa7e,_0x19a712){var _0x48e370={'raw':![],'where':{'id':_0x8dfa7e['params']['id']}},_0x41d7ae={};_0x41d7ae[_0xa19e('0x34')]=_[_0xa19e('0x33')](db[_0xa19e('0x2f')][_0xa19e('0x30')]);_0x41d7ae[_0xa19e('0x35')]=_[_0xa19e('0x33')](_0x8dfa7e[_0xa19e('0x35')]);_0x41d7ae[_0xa19e('0x3c')]=_['intersection'](_0x41d7ae[_0xa19e('0x34')],_0x41d7ae[_0xa19e('0x35')]);_0x48e370['attributes']=_['intersection'](_0x41d7ae[_0xa19e('0x34')],qs[_0xa19e('0x37')](_0x8dfa7e[_0xa19e('0x35')]['fields']));_0x48e370[_0xa19e('0x36')]=_0x48e370[_0xa19e('0x36')]['length']?_0x48e370[_0xa19e('0x36')]:_0x41d7ae[_0xa19e('0x34')];if(_0x8dfa7e[_0xa19e('0x35')]['includeAll']){_0x48e370[_0xa19e('0x41')]=[{'all':!![]}];}_0x48e370=_['merge']({},_0x48e370,_0x8dfa7e[_0xa19e('0x3f')]);return db[_0xa19e('0x2f')][_0xa19e('0x44')](_0x48e370)[_0xa19e('0x24')](handleEntityNotFound(_0x19a712,null))[_0xa19e('0x24')](respondWithResult(_0x19a712,null))['catch'](handleError(_0x19a712,null));};exports[_0xa19e('0x45')]=function(_0x4c90fe,_0x4779d8){return db['VoiceChanSpy'][_0xa19e('0x45')](_0x4c90fe[_0xa19e('0x46')],{})[_0xa19e('0x24')](function(_0x203c03){var _0x538c9a=_0x4c90fe[_0xa19e('0x47')][_0xa19e('0x26')]({'plain':!![]});if(!_0x538c9a)throw new Error(_0xa19e('0x48'));if(_0x538c9a[_0xa19e('0x49')]==='user'){var _0x454c9f=_0x203c03['get']({'plain':!![]});var _0x2c58c8=_0xa19e('0x4a');return db[_0xa19e('0x4b')]['find']({'where':{'name':_0x2c58c8,'userProfileId':_0x538c9a[_0xa19e('0x4c')]},'raw':!![]})[_0xa19e('0x24')](function(_0x5bd756){if(_0x5bd756&&_0x5bd756[_0xa19e('0x4d')]===0x0){return db[_0xa19e('0x27')][_0xa19e('0x45')]({'name':_0x454c9f[_0xa19e('0x2b')],'resourceId':_0x454c9f['id'],'type':_0x5bd756['name'],'sectionId':_0x5bd756['id']},{})['then'](function(){return _0x203c03;});}else{return _0x203c03;}})[_0xa19e('0x43')](function(_0x239a3b){logger['error'](_0xa19e('0x4e'),_0x239a3b);throw _0x239a3b;});}return _0x203c03;})[_0xa19e('0x24')](respondWithResult(_0x4779d8,0xc9))['catch'](handleError(_0x4779d8,null));};exports[_0xa19e('0x23')]=function(_0x68e0d1,_0x44a946){if(_0x68e0d1[_0xa19e('0x46')]['id']){delete _0x68e0d1[_0xa19e('0x46')]['id'];}return db[_0xa19e('0x2f')][_0xa19e('0x44')]({'where':{'id':_0x68e0d1[_0xa19e('0x4f')]['id']}})[_0xa19e('0x24')](handleEntityNotFound(_0x44a946,null))[_0xa19e('0x24')](saveUpdates(_0x68e0d1[_0xa19e('0x46')],null))['then'](respondWithResult(_0x44a946,null))['catch'](handleError(_0x44a946,null));};exports[_0xa19e('0x25')]=function(_0x1a41a0,_0x17ac29){return db['VoiceChanSpy']['find']({'where':{'id':_0x1a41a0['params']['id']}})[_0xa19e('0x24')](handleEntityNotFound(_0x17ac29,null))['then'](removeEntity(_0x17ac29,null))[_0xa19e('0x43')](handleError(_0x17ac29,null));}; \ No newline at end of file +var _0x688a=['destroy','get','UserProfileResource','end','sendStatus','error','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','merge','map','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','autoAssociation','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','set','apply','reject','save','update','then'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x688a,0x124));var _0xa688=function(_0x2b3400,_0x51f5ea){_0x2b3400=_0x2b3400-0x0;var _0x1dcbf6=_0x688a[_0x2b3400];return _0x1dcbf6;};'use strict';var emlformat=require(_0xa688('0x0'));var rimraf=require(_0xa688('0x1'));var zipdir=require(_0xa688('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa688('0x3'));var moment=require('moment');var BPromise=require(_0xa688('0x4'));var Mustache=require(_0xa688('0x5'));var util=require('util');var path=require(_0xa688('0x6'));var sox=require(_0xa688('0x7'));var csv=require(_0xa688('0x8'));var ejs=require(_0xa688('0x9'));var fs=require('fs');var fs_extra=require(_0xa688('0xa'));var _=require(_0xa688('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa688('0xc'));var deskjs=require(_0xa688('0xd'));var toCsv=require(_0xa688('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa688('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa688('0xf'));var hardwareService=require(_0xa688('0x10'));var logger=require(_0xa688('0x11'))(_0xa688('0x12'));var utils=require(_0xa688('0x13'));var config=require(_0xa688('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50f101,_0x1dc3d3){_0x1dc3d3=_0x1dc3d3||0xcc;return function(_0x33eed4){if(_0x33eed4){return _0x50f101['sendStatus'](_0x1dc3d3);}return _0x50f101[_0xa688('0x15')](_0x1dc3d3)['end']();};}function respondWithResult(_0x10c371,_0x43159e){_0x43159e=_0x43159e||0xc8;return function(_0x506fca){if(_0x506fca){return _0x10c371['status'](_0x43159e)[_0xa688('0x16')](_0x506fca);}};}function respondWithFilteredResult(_0x4c7442,_0x1a55c2){return function(_0x5b8b1f){if(_0x5b8b1f){var _0xe776d6=typeof _0x1a55c2[_0xa688('0x17')]===_0xa688('0x18')&&typeof _0x1a55c2[_0xa688('0x19')]===_0xa688('0x18');var _0x10fc2d=_0x5b8b1f['count'];var _0x59e392=_0xe776d6?0x0:_0x1a55c2[_0xa688('0x17')];var _0x1330d5=_0xe776d6?_0x5b8b1f['count']:_0x1a55c2['offset']+_0x1a55c2[_0xa688('0x19')];var _0x2085bf;if(_0x1330d5>=_0x10fc2d){_0x1330d5=_0x10fc2d;_0x2085bf=0xc8;}else{_0x2085bf=0xce;}_0x4c7442['status'](_0x2085bf);return _0x4c7442[_0xa688('0x1a')]('Content-Range',_0x59e392+'-'+_0x1330d5+'/'+_0x10fc2d)['json'](_0x5b8b1f);}return null;};}function patchUpdates(_0x152cfe){return function(_0x466ae3){try{jsonpatch[_0xa688('0x1b')](_0x466ae3,_0x152cfe,!![]);}catch(_0x27f12e){return BPromise[_0xa688('0x1c')](_0x27f12e);}return _0x466ae3[_0xa688('0x1d')]();};}function saveUpdates(_0x7d9036,_0x203214){return function(_0x2a9f67){if(_0x2a9f67){return _0x2a9f67[_0xa688('0x1e')](_0x7d9036)[_0xa688('0x1f')](function(_0x301560){return _0x301560;});}return null;};}function removeEntity(_0x42643,_0x11133b){return function(_0x48cb17){if(_0x48cb17){return _0x48cb17[_0xa688('0x20')]()[_0xa688('0x1f')](function(){var _0x4fa15e=_0x48cb17[_0xa688('0x21')]({'plain':!![]});var _0x1e3106='ChanSpies';return db[_0xa688('0x22')][_0xa688('0x20')]({'where':{'type':_0x1e3106,'resourceId':_0x4fa15e['id']}})[_0xa688('0x1f')](function(){return _0x48cb17;});})[_0xa688('0x1f')](function(){_0x42643[_0xa688('0x15')](0xcc)[_0xa688('0x23')]();});}};}function handleEntityNotFound(_0x337779,_0x286376){return function(_0x3fa53f){if(!_0x3fa53f){_0x337779[_0xa688('0x24')](0x194);}return _0x3fa53f;};}function handleError(_0x3ab038,_0x161741){_0x161741=_0x161741||0x1f4;return function(_0x3c7245){logger[_0xa688('0x25')](_0x3c7245[_0xa688('0x26')]);if(_0x3c7245['name']){delete _0x3c7245[_0xa688('0x27')];}_0x3ab038[_0xa688('0x15')](_0x161741)[_0xa688('0x28')](_0x3c7245);};}exports[_0xa688('0x29')]=function(_0x3d52fc,_0x10fbce){var _0x49e148={},_0x5b0527={},_0x5291ac={'count':0x0,'rows':[]};var _0x1824d1=_['map'](db[_0xa688('0x2a')][_0xa688('0x2b')],function(_0x6b3179){return{'name':_0x6b3179[_0xa688('0x2c')],'type':_0x6b3179[_0xa688('0x2d')][_0xa688('0x2e')]};});_0x5b0527[_0xa688('0x2f')]=_['map'](_0x1824d1,'name');_0x5b0527['query']=_['keys'](_0x3d52fc[_0xa688('0x30')]);_0x5b0527[_0xa688('0x31')]=_[_0xa688('0x32')](_0x5b0527['model'],_0x5b0527[_0xa688('0x30')]);_0x49e148['attributes']=_['intersection'](_0x5b0527['model'],qs[_0xa688('0x33')](_0x3d52fc[_0xa688('0x30')][_0xa688('0x33')]));_0x49e148['attributes']=_0x49e148['attributes'][_0xa688('0x34')]?_0x49e148[_0xa688('0x35')]:_0x5b0527[_0xa688('0x2f')];if(!_0x3d52fc[_0xa688('0x30')][_0xa688('0x36')]('nolimit')){_0x49e148['limit']=qs[_0xa688('0x19')](_0x3d52fc['query'][_0xa688('0x19')]);_0x49e148[_0xa688('0x17')]=qs[_0xa688('0x17')](_0x3d52fc[_0xa688('0x30')]['offset']);}_0x49e148[_0xa688('0x37')]=qs['sort'](_0x3d52fc['query'][_0xa688('0x38')]);_0x49e148['where']=qs[_0xa688('0x31')](_['pick'](_0x3d52fc[_0xa688('0x30')],_0x5b0527[_0xa688('0x31')]),_0x1824d1);if(_0x3d52fc[_0xa688('0x30')]['filter']){_0x49e148[_0xa688('0x39')]=_[_0xa688('0x3a')](_0x49e148[_0xa688('0x39')],{'$or':_[_0xa688('0x3b')](_0x1824d1,function(_0x244202){if(_0x244202[_0xa688('0x2d')]!==_0xa688('0x3c')){var _0x9d54a6={};_0x9d54a6[_0x244202[_0xa688('0x27')]]={'$like':'%'+_0x3d52fc[_0xa688('0x30')][_0xa688('0x3d')]+'%'};return _0x9d54a6;}})});}_0x49e148=_['merge']({},_0x49e148,_0x3d52fc[_0xa688('0x3e')]);var _0x5436a8={'where':_0x49e148[_0xa688('0x39')]};return db[_0xa688('0x2a')][_0xa688('0x3f')](_0x5436a8)[_0xa688('0x1f')](function(_0x56a5e5){_0x5291ac[_0xa688('0x3f')]=_0x56a5e5;if(_0x3d52fc[_0xa688('0x30')]['includeAll']){_0x49e148[_0xa688('0x40')]=[{'all':!![]}];}return db[_0xa688('0x2a')][_0xa688('0x41')](_0x49e148);})[_0xa688('0x1f')](function(_0x3205d4){_0x5291ac[_0xa688('0x42')]=_0x3205d4;return _0x5291ac;})[_0xa688('0x1f')](respondWithFilteredResult(_0x10fbce,_0x49e148))[_0xa688('0x43')](handleError(_0x10fbce,null));};exports[_0xa688('0x44')]=function(_0x5b4912,_0xeaf237){var _0x2c0b03={'raw':![],'where':{'id':_0x5b4912[_0xa688('0x45')]['id']}},_0x4475b5={};_0x4475b5[_0xa688('0x2f')]=_[_0xa688('0x46')](db[_0xa688('0x2a')][_0xa688('0x2b')]);_0x4475b5['query']=_[_0xa688('0x46')](_0x5b4912[_0xa688('0x30')]);_0x4475b5[_0xa688('0x31')]=_[_0xa688('0x32')](_0x4475b5['model'],_0x4475b5[_0xa688('0x30')]);_0x2c0b03[_0xa688('0x35')]=_['intersection'](_0x4475b5[_0xa688('0x2f')],qs[_0xa688('0x33')](_0x5b4912[_0xa688('0x30')][_0xa688('0x33')]));_0x2c0b03[_0xa688('0x35')]=_0x2c0b03[_0xa688('0x35')]['length']?_0x2c0b03[_0xa688('0x35')]:_0x4475b5[_0xa688('0x2f')];if(_0x5b4912[_0xa688('0x30')][_0xa688('0x47')]){_0x2c0b03[_0xa688('0x40')]=[{'all':!![]}];}_0x2c0b03=_['merge']({},_0x2c0b03,_0x5b4912[_0xa688('0x3e')]);return db[_0xa688('0x2a')][_0xa688('0x48')](_0x2c0b03)[_0xa688('0x1f')](handleEntityNotFound(_0xeaf237,null))[_0xa688('0x1f')](respondWithResult(_0xeaf237,null))[_0xa688('0x43')](handleError(_0xeaf237,null));};exports['create']=function(_0x128191,_0x3c858c){return db[_0xa688('0x2a')][_0xa688('0x49')](_0x128191[_0xa688('0x4a')],{})[_0xa688('0x1f')](function(_0x30f6ee){var _0x497ec3=_0x128191[_0xa688('0x4b')][_0xa688('0x21')]({'plain':!![]});if(!_0x497ec3)throw new Error(_0xa688('0x4c'));if(_0x497ec3[_0xa688('0x4d')]==='user'){var _0x2904fd=_0x30f6ee[_0xa688('0x21')]({'plain':!![]});var _0x416bfd=_0xa688('0x4e');return db[_0xa688('0x4f')][_0xa688('0x48')]({'where':{'name':_0x416bfd,'userProfileId':_0x497ec3['userProfileId']},'raw':!![]})[_0xa688('0x1f')](function(_0x57861d){if(_0x57861d&&_0x57861d[_0xa688('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x2904fd[_0xa688('0x27')],'resourceId':_0x2904fd['id'],'type':_0x57861d[_0xa688('0x27')],'sectionId':_0x57861d['id']},{})[_0xa688('0x1f')](function(){return _0x30f6ee;});}else{return _0x30f6ee;}})['catch'](function(_0x4381a4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4381a4);throw _0x4381a4;});}return _0x30f6ee;})['then'](respondWithResult(_0x3c858c,0xc9))['catch'](handleError(_0x3c858c,null));};exports['update']=function(_0x3e1f82,_0x1b8be2){if(_0x3e1f82[_0xa688('0x4a')]['id']){delete _0x3e1f82['body']['id'];}return db[_0xa688('0x2a')]['find']({'where':{'id':_0x3e1f82[_0xa688('0x45')]['id']}})[_0xa688('0x1f')](handleEntityNotFound(_0x1b8be2,null))[_0xa688('0x1f')](saveUpdates(_0x3e1f82[_0xa688('0x4a')],null))[_0xa688('0x1f')](respondWithResult(_0x1b8be2,null))[_0xa688('0x43')](handleError(_0x1b8be2,null));};exports[_0xa688('0x20')]=function(_0x449094,_0x2571be){return db[_0xa688('0x2a')]['find']({'where':{'id':_0x449094['params']['id']}})['then'](handleEntityNotFound(_0x2571be,null))[_0xa688('0x1f')](removeEntity(_0x2571be,null))[_0xa688('0x43')](handleError(_0x2571be,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index d5ff2ff..dc5e7d3 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 _0xf754=['concat','internal','User','findAll','agent','then','catch','models','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','format','prefix','system','push','merge','Set','chanspy','MixMonitor','recordingFormat','SIP/%s,%s','name','options','join','record','StopMixMonitor','length'];(function(_0x4b1681,_0x4e93c9){var _0x341b9e=function(_0x5d8cbc){while(--_0x5d8cbc){_0x4b1681['push'](_0x4b1681['shift']());}};_0x341b9e(++_0x4e93c9);}(_0xf754,0x70));var _0x4f75=function(_0x2ea572,_0x4fb210){_0x2ea572=_0x2ea572-0x0;var _0x466de3=_0xf754[_0x2ea572];return _0x466de3;};'use strict';var _=require(_0x4f75('0x0'));var util=require('util');var BPromise=require(_0x4f75('0x1'));var attributes=require(_0x4f75('0x2'));var getUserApplications=function(_0x45b052,_0x43a75a,_0x2a3c28){var _0x56560b=0x1;var _0x4eda85=[];var _0xc7ac7a={'context':_0x43a75a[_0x4f75('0x3')]||'from-sip','exten':util[_0x4f75('0x4')]('%s%s',_0x45b052[_0x4f75('0x5')],_0x2a3c28),'type':_0x4f75('0x6'),'isApp':![],'ChanSpyId':_0x45b052['id'],'UserId':_0x43a75a['id']};_0x4eda85[_0x4f75('0x7')](_[_0x4f75('0x8')]({'app':_0x4f75('0x9'),'appdata':util[_0x4f75('0x4')]('CDR(type)=%s',_0x4f75('0xa')),'priority':_0x56560b++},_0xc7ac7a));if(_0x45b052['record']){_0x4eda85[_0x4f75('0x7')](_[_0x4f75('0x8')]({'app':_0x4f75('0xb'),'appdata':util[_0x4f75('0x4')]('${UNIQUEID}.%s,a',_0x45b052[_0x4f75('0xc')]),'priority':_0x56560b++},_0xc7ac7a));}if(_0x45b052['auth']){_0x4eda85[_0x4f75('0x7')](_[_0x4f75('0x8')]({'app':'Authenticate','appdata':_0x45b052['password'],'priority':_0x56560b++},_0xc7ac7a));}_0x4eda85['push'](_['merge']({'app':'ChanSpy','appdata':util[_0x4f75('0x4')](_0x4f75('0xd'),_0x43a75a[_0x4f75('0xe')],_0x45b052[_0x4f75('0xf')]?_0x45b052[_0x4f75('0xf')][_0x4f75('0x10')](''):''),'priority':_0x56560b++},_0xc7ac7a));if(_0x45b052[_0x4f75('0x11')]){_0x4eda85['push'](_[_0x4f75('0x8')]({'app':_0x4f75('0x12'),'priority':_0x56560b++},_0xc7ac7a));}return _0x4eda85;};var getChanSpyApplications=function(_0x592001,_0x1b7d2f){var _0x2c4204=[];for(var _0x5d6495=0x0,_0x1921e9=0x1;_0x5d6495<_0x1b7d2f[_0x4f75('0x13')];_0x5d6495++,_0x1921e9=0x1){_0x2c4204=_0x2c4204[_0x4f75('0x14')](getUserApplications(_0x592001,_0x1b7d2f[_0x5d6495],_0x1b7d2f[_0x5d6495][_0x4f75('0x15')]));if(_0x1b7d2f[_0x5d6495][_0x4f75('0x15')]!=_0x1b7d2f[_0x5d6495][_0x4f75('0xe')]){_0x2c4204=_0x2c4204[_0x4f75('0x14')](getUserApplications(_0x592001,_0x1b7d2f[_0x5d6495],_0x1b7d2f[_0x5d6495]['name']));}}return _0x2c4204;};var getChanSpyPromise=function(_0x384417,_0x290592){return new BPromise(function(_0x18df56,_0x4853ab){return _0x384417[_0x4f75('0x16')][_0x4f75('0x17')]({'attributes':['id','name',_0x4f75('0x15')],'where':{'role':_0x4f75('0x18'),'chanspy':!![]},'raw':!![]})[_0x4f75('0x19')](function(_0x5e7b5f){if(_0x5e7b5f){return _0x18df56(getChanSpyApplications(_0x290592,_0x5e7b5f));}return _0x18df56([]);})[_0x4f75('0x1a')](function(_0x3b0086){_0x4853ab(_0x3b0086);});});};module['exports']=function(_0x3a57eb,_0x408067){var _0x281e9f=_0x3a57eb[_0x4f75('0x1b')];return _0x3a57eb['define'](_0x4f75('0x1c'),attributes,{'tableName':_0x4f75('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x39cd7c,_0x5dd6cf,_0x264426){return getChanSpyPromise(_0x281e9f,_0x39cd7c)['then'](function(_0x623f56){if(_0x623f56&&_0x623f56[_0x4f75('0x13')]){return _0x281e9f['VoiceExtension'][_0x4f75('0x1e')](_0x623f56);}})['then'](function(){_0x264426();})[_0x4f75('0x1a')](function(_0x475275){_0x264426(_0x475275);});},'afterUpdate':function(_0x44a5c2,_0x316118,_0xd2b000){return _0x281e9f[_0x4f75('0x1f')][_0x4f75('0x20')]({'where':{'ChanSpyId':_0x44a5c2['id']}})['then'](function(){return getChanSpyPromise(_0x281e9f,_0x44a5c2);})[_0x4f75('0x19')](function(_0x12e219){if(_0x12e219&&_0x12e219[_0x4f75('0x13')]){return _0x281e9f[_0x4f75('0x1f')]['bulkCreate'](_0x12e219);}})[_0x4f75('0x19')](function(){_0xd2b000();})['catch'](function(_0x20ded){_0xd2b000(_0x20ded);});},'afterDestroy':function(_0x41a620,_0x11576e,_0x4c9337){return _0x281e9f[_0x4f75('0x1f')][_0x4f75('0x20')]({'where':{'ChanSpyId':_0x41a620['id']}})[_0x4f75('0x19')](function(){_0x4c9337();})['catch'](function(_0x279b9e){_0x4c9337(_0x279b9e);});}}});}; \ No newline at end of file +var _0x1882=['SIP/%s,%s','name','options','StopMixMonitor','concat','User','findAll','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix','push','merge','Set','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy'];(function(_0x2df0c3,_0x3d9071){var _0x4504e6=function(_0x354dcd){while(--_0x354dcd){_0x2df0c3['push'](_0x2df0c3['shift']());}};_0x4504e6(++_0x3d9071);}(_0x1882,0x19e));var _0x2188=function(_0x4b5dab,_0x4ebf93){_0x4b5dab=_0x4b5dab-0x0;var _0x42274c=_0x1882[_0x4b5dab];return _0x42274c;};'use strict';var _=require(_0x2188('0x0'));var util=require(_0x2188('0x1'));var BPromise=require(_0x2188('0x2'));var attributes=require(_0x2188('0x3'));var getUserApplications=function(_0x41537c,_0x4392e5,_0x4fc84c){var _0x579bc2=0x1;var _0x2fc457=[];var _0x11c820={'context':_0x4392e5[_0x2188('0x4')]||'from-sip','exten':util[_0x2188('0x5')](_0x2188('0x6'),_0x41537c[_0x2188('0x7')],_0x4fc84c),'type':'system','isApp':![],'ChanSpyId':_0x41537c['id'],'UserId':_0x4392e5['id']};_0x2fc457[_0x2188('0x8')](_[_0x2188('0x9')]({'app':_0x2188('0xa'),'appdata':util[_0x2188('0x5')]('CDR(type)=%s','chanspy'),'priority':_0x579bc2++},_0x11c820));if(_0x41537c[_0x2188('0xb')]){_0x2fc457['push'](_['merge']({'app':_0x2188('0xc'),'appdata':util[_0x2188('0x5')](_0x2188('0xd'),_0x41537c[_0x2188('0xe')]),'priority':_0x579bc2++},_0x11c820));}if(_0x41537c[_0x2188('0xf')]){_0x2fc457[_0x2188('0x8')](_[_0x2188('0x9')]({'app':'Authenticate','appdata':_0x41537c[_0x2188('0x10')],'priority':_0x579bc2++},_0x11c820));}_0x2fc457['push'](_[_0x2188('0x9')]({'app':_0x2188('0x11'),'appdata':util[_0x2188('0x5')](_0x2188('0x12'),_0x4392e5[_0x2188('0x13')],_0x41537c[_0x2188('0x14')]?_0x41537c[_0x2188('0x14')]['join'](''):''),'priority':_0x579bc2++},_0x11c820));if(_0x41537c[_0x2188('0xb')]){_0x2fc457[_0x2188('0x8')](_[_0x2188('0x9')]({'app':_0x2188('0x15'),'priority':_0x579bc2++},_0x11c820));}return _0x2fc457;};var getChanSpyApplications=function(_0x40e725,_0x16a162){var _0x7f961=[];for(var _0x197284=0x0,_0x5c6154=0x1;_0x197284<_0x16a162['length'];_0x197284++,_0x5c6154=0x1){_0x7f961=_0x7f961[_0x2188('0x16')](getUserApplications(_0x40e725,_0x16a162[_0x197284],_0x16a162[_0x197284]['internal']));if(_0x16a162[_0x197284]['internal']!=_0x16a162[_0x197284][_0x2188('0x13')]){_0x7f961=_0x7f961[_0x2188('0x16')](getUserApplications(_0x40e725,_0x16a162[_0x197284],_0x16a162[_0x197284]['name']));}}return _0x7f961;};var getChanSpyPromise=function(_0x524105,_0x233997){return new BPromise(function(_0xacb2c9,_0x2ae475){return _0x524105[_0x2188('0x17')][_0x2188('0x18')]({'attributes':['id','name','internal'],'where':{'role':_0x2188('0x19'),'chanspy':!![]},'raw':!![]})[_0x2188('0x1a')](function(_0x377f76){if(_0x377f76){return _0xacb2c9(getChanSpyApplications(_0x233997,_0x377f76));}return _0xacb2c9([]);})[_0x2188('0x1b')](function(_0x20ff28){_0x2ae475(_0x20ff28);});});};module[_0x2188('0x1c')]=function(_0x132486,_0x16654f){var _0x2974b1=_0x132486[_0x2188('0x1d')];return _0x132486['define'](_0x2188('0x1e'),attributes,{'tableName':_0x2188('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d3e9,_0x1b5f95,_0x29f744){return getChanSpyPromise(_0x2974b1,_0x3d3e9)[_0x2188('0x1a')](function(_0x2e2e9b){if(_0x2e2e9b&&_0x2e2e9b[_0x2188('0x20')]){return _0x2974b1[_0x2188('0x21')][_0x2188('0x22')](_0x2e2e9b);}})[_0x2188('0x1a')](function(){_0x29f744();})[_0x2188('0x1b')](function(_0x10adc7){_0x29f744(_0x10adc7);});},'afterUpdate':function(_0x141a40,_0x2a2239,_0x26c4af){return _0x2974b1[_0x2188('0x21')][_0x2188('0x23')]({'where':{'ChanSpyId':_0x141a40['id']}})[_0x2188('0x1a')](function(){return getChanSpyPromise(_0x2974b1,_0x141a40);})[_0x2188('0x1a')](function(_0x2e270a){if(_0x2e270a&&_0x2e270a[_0x2188('0x20')]){return _0x2974b1['VoiceExtension'][_0x2188('0x22')](_0x2e270a);}})[_0x2188('0x1a')](function(){_0x26c4af();})[_0x2188('0x1b')](function(_0x52a20e){_0x26c4af(_0x52a20e);});},'afterDestroy':function(_0x16f85a,_0x109d84,_0x2d0cb5){return _0x2974b1[_0x2188('0x21')][_0x2188('0x23')]({'where':{'ChanSpyId':_0x16f85a['id']}})[_0x2188('0x1a')](function(){_0x2d0cb5();})[_0x2188('0x1b')](function(_0x513d1e){_0x2d0cb5(_0x513d1e);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 9c9b06b..cd1228d 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 _0xe205=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash'];(function(_0x1f239e,_0x367b43){var _0x826971=function(_0x2c5777){while(--_0x2c5777){_0x1f239e['push'](_0x1f239e['shift']());}};_0x826971(++_0x367b43);}(_0xe205,0xa7));var _0x5e20=function(_0x2e748c,_0x55ec8e){_0x2e748c=_0x2e748c-0x0;var _0x37e219=_0xe205[_0x2e748c];return _0x37e219;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var moment=require(_0x5e20('0x2'));var BPromise=require(_0x5e20('0x3'));var rs=require(_0x5e20('0x4'));var fs=require('fs');var Redis=require(_0x5e20('0x5'));var db=require(_0x5e20('0x6'))['db'];var utils=require(_0x5e20('0x7'));var logger=require(_0x5e20('0x8'))('rpc');var config=require(_0x5e20('0x9'));var jayson=require(_0x5e20('0xa'));var client=jayson[_0x5e20('0xb')][_0x5e20('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5eca5c,_0x4cc88d,_0x3a382f){return new BPromise(function(_0x4c9332,_0x533e18){return client[_0x5e20('0xd')](_0x5eca5c,_0x3a382f)[_0x5e20('0xe')](function(_0x5c1eee){logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));logger[_0x5e20('0x12')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x4cc88d,_0x5e20('0x11'),JSON[_0x5e20('0x13')](_0x5c1eee));if(_0x5c1eee[_0x5e20('0x14')]){if(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x15')]===0x1f4){logger[_0x5e20('0x14')]('VoiceChanSpy,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);return _0x533e18(_0x5c1eee[_0x5e20('0x14')]['message']);}logger[_0x5e20('0x14')]('VoiceChanSpy,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')]['message']);return _0x4c9332(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);}else{logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));_0x4c9332(_0x5c1eee['result'][_0x5e20('0x16')]);}})[_0x5e20('0x17')](function(_0x166ffd){logger[_0x5e20('0x14')](_0x5e20('0x10'),_0x4cc88d,_0x166ffd);_0x533e18(_0x166ffd);});});} \ No newline at end of file +var _0xa588=['stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa588,0xe1));var _0x8a58=function(_0x3a90b6,_0x782086){_0x3a90b6=_0x3a90b6-0x0;var _0x56f71a=_0xa588[_0x3a90b6];return _0x56f71a;};'use strict';var _=require('lodash');var util=require(_0x8a58('0x0'));var moment=require(_0x8a58('0x1'));var BPromise=require(_0x8a58('0x2'));var rs=require(_0x8a58('0x3'));var fs=require('fs');var Redis=require(_0x8a58('0x4'));var db=require(_0x8a58('0x5'))['db'];var utils=require(_0x8a58('0x6'));var logger=require(_0x8a58('0x7'))(_0x8a58('0x8'));var config=require('../../config/environment');var jayson=require(_0x8a58('0x9'));var client=jayson[_0x8a58('0xa')][_0x8a58('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35d5ad,_0xe0af18,_0x140f99){return new BPromise(function(_0x77b421,_0x585376){return client['request'](_0x35d5ad,_0x140f99)[_0x8a58('0xc')](function(_0x39a20e){logger[_0x8a58('0xd')](_0x8a58('0xe'),_0xe0af18,_0x8a58('0xf'));logger['debug'](_0x8a58('0x10'),_0xe0af18,_0x8a58('0xf'),JSON[_0x8a58('0x11')](_0x39a20e));if(_0x39a20e[_0x8a58('0x12')]){if(_0x39a20e['error']['code']===0x1f4){logger[_0x8a58('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0xe0af18,_0x39a20e[_0x8a58('0x12')][_0x8a58('0x13')]);return _0x585376(_0x39a20e['error'][_0x8a58('0x13')]);}logger[_0x8a58('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0xe0af18,_0x39a20e[_0x8a58('0x12')][_0x8a58('0x13')]);return _0x77b421(_0x39a20e['error'][_0x8a58('0x13')]);}else{logger[_0x8a58('0xd')](_0x8a58('0xe'),_0xe0af18,_0x8a58('0xf'));_0x77b421(_0x39a20e[_0x8a58('0x14')][_0x8a58('0x13')]);}})[_0x8a58('0x15')](function(_0x49ee0e){logger['error'](_0x8a58('0xe'),_0xe0af18,_0x49ee0e);_0x585376(_0x49ee0e);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 92f87e8..9e40bbd 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 _0x3ed4=['../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x296dbc,_0x1b68c3){var _0x375a6a=function(_0x3f6a72){while(--_0x3f6a72){_0x296dbc['push'](_0x296dbc['shift']());}};_0x375a6a(++_0x1b68c3);}(_0x3ed4,0xa3));var _0x43ed=function(_0x527a23,_0xa3430d){_0x527a23=_0x527a23-0x0;var _0x4d0e71=_0x3ed4[_0x527a23];return _0x4d0e71;};'use strict';var multer=require('multer');var util=require(_0x43ed('0x0'));var path=require(_0x43ed('0x1'));var timeout=require(_0x43ed('0x2'));var express=require(_0x43ed('0x3'));var router=express[_0x43ed('0x4')]();var fs_extra=require(_0x43ed('0x5'));var auth=require(_0x43ed('0x6'));var interaction=require(_0x43ed('0x7'));var config=require(_0x43ed('0x8'));var controller=require(_0x43ed('0x9'));router[_0x43ed('0xa')]('/',auth[_0x43ed('0xb')](),controller[_0x43ed('0xc')]);router['get'](_0x43ed('0xd'),auth[_0x43ed('0xb')](),controller[_0x43ed('0xe')]);router[_0x43ed('0xf')]('/',auth['isAuthenticated'](),controller[_0x43ed('0x10')]);router[_0x43ed('0x11')]('/:id',auth[_0x43ed('0xb')](),controller[_0x43ed('0x12')]);router['delete'](_0x43ed('0xd'),auth[_0x43ed('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2db2=['util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x13b392,_0x3481f2){var _0x39db24=function(_0xab91e5){while(--_0xab91e5){_0x13b392['push'](_0x13b392['shift']());}};_0x39db24(++_0x3481f2);}(_0x2db2,0x17b));var _0x22db=function(_0x1c34e7,_0x33f9a8){_0x1c34e7=_0x1c34e7-0x0;var _0x378cb1=_0x2db2[_0x1c34e7];return _0x378cb1;};'use strict';var multer=require(_0x22db('0x0'));var util=require(_0x22db('0x1'));var path=require(_0x22db('0x2'));var timeout=require(_0x22db('0x3'));var express=require('express');var router=express[_0x22db('0x4')]();var fs_extra=require(_0x22db('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22db('0x6'));var config=require(_0x22db('0x7'));var controller=require('./voiceContext.controller');router[_0x22db('0x8')]('/',auth[_0x22db('0x9')](),controller[_0x22db('0xa')]);router[_0x22db('0x8')](_0x22db('0xb'),auth[_0x22db('0x9')](),controller[_0x22db('0xc')]);router[_0x22db('0xd')]('/',auth[_0x22db('0x9')](),controller[_0x22db('0xe')]);router[_0x22db('0xf')](_0x22db('0xb'),auth[_0x22db('0x9')](),controller[_0x22db('0x10')]);router[_0x22db('0x11')](_0x22db('0xb'),auth[_0x22db('0x9')](),controller[_0x22db('0x12')]);module[_0x22db('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 2abbc9d..9ec822a 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 _0x8d06=['sequelize','exports','STRING'];(function(_0x236499,_0x2c1b0e){var _0x4c5287=function(_0x3c1e24){while(--_0x3c1e24){_0x236499['push'](_0x236499['shift']());}};_0x4c5287(++_0x2c1b0e);}(_0x8d06,0x1ef));var _0x68d0=function(_0x1fdf4d,_0xe8aac){_0x1fdf4d=_0x1fdf4d-0x0;var _0x255294=_0x8d06[_0x1fdf4d];return _0x255294;};'use strict';var Sequelize=require(_0x68d0('0x0'));module[_0x68d0('0x1')]={'name':{'type':Sequelize[_0x68d0('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x68d0('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7bbc=['sequelize','exports','STRING','name'];(function(_0x2a086e,_0x304033){var _0x1ff462=function(_0x1220a8){while(--_0x1220a8){_0x2a086e['push'](_0x2a086e['shift']());}};_0x1ff462(++_0x304033);}(_0x7bbc,0x154));var _0xc7bb=function(_0x2ccc2d,_0x109100){_0x2ccc2d=_0x2ccc2d-0x0;var _0x5cba6d=_0x7bbc[_0x2ccc2d];return _0x5cba6d;};'use strict';var Sequelize=require(_0xc7bb('0x0'));module[_0xc7bb('0x1')]={'name':{'type':Sequelize[_0xc7bb('0x2')],'unique':_0xc7bb('0x3')},'description':{'type':Sequelize[_0xc7bb('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 69e3f4c..e74aba5 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 _0x232a=['jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','sendStatus','stack','send','index','map','VoiceContext','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','show','include','find','create','body','findAll','readFileSync','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','join','root','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','squel','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'];(function(_0x597952,_0x14e9cf){var _0x2cf578=function(_0x2783ac){while(--_0x2783ac){_0x597952['push'](_0x597952['shift']());}};_0x2cf578(++_0x14e9cf);}(_0x232a,0xb8));var _0xa232=function(_0x4b4dd0,_0x4b7586){_0x4b4dd0=_0x4b4dd0-0x0;var _0x42da25=_0x232a[_0x4b4dd0];return _0x42da25;};'use strict';var emlformat=require(_0xa232('0x0'));var rimraf=require(_0xa232('0x1'));var zipdir=require(_0xa232('0x2'));var jsonpatch=require(_0xa232('0x3'));var rp=require(_0xa232('0x4'));var moment=require('moment');var BPromise=require(_0xa232('0x5'));var Mustache=require(_0xa232('0x6'));var util=require('util');var path=require(_0xa232('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa232('0x8'));var _=require('lodash');var squel=require(_0xa232('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa232('0xa'));var toCsv=require('to-csv');var querystring=require(_0xa232('0xb'));var Papa=require(_0xa232('0xc'));var Redis=require(_0xa232('0xd'));var authService=require(_0xa232('0xe'));var qs=require(_0xa232('0xf'));var as=require(_0xa232('0x10'));var hardwareService=require(_0xa232('0x11'));var logger=require(_0xa232('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xa232('0x13'));var licenseUtil=require(_0xa232('0x14'));var db=require(_0xa232('0x15'))['db'];var jayson=require(_0xa232('0x16'));var client=jayson[_0xa232('0x17')][_0xa232('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x5d7932,_0x4ecf93,_0x4aca6f,_0x5f1e53){return new BPromise(function(_0xa8967,_0x33be14){var _0x5b722a=_0x5f1e53||client;return _0x5b722a[_0xa232('0x19')](_0x5d7932,_0x4aca6f)[_0xa232('0x1a')](function(_0x159efa){logger[_0xa232('0x1b')](_0xa232('0x1c'),_0x4ecf93,'request\x20sent');logger[_0xa232('0x1d')](_0xa232('0x1e'),_0x4ecf93,_0xa232('0x1f'),JSON[_0xa232('0x20')](_0x159efa));if(_0x159efa[_0xa232('0x21')]){if(_0x159efa[_0xa232('0x21')][_0xa232('0x22')]===0x1f4){logger[_0xa232('0x21')](_0xa232('0x1c'),_0x4ecf93,_0x159efa[_0xa232('0x21')]['message']);return _0x33be14(_0x159efa[_0xa232('0x21')][_0xa232('0x23')]);}logger[_0xa232('0x21')]('VoiceContext,\x20%s,\x20%s',_0x4ecf93,_0x159efa[_0xa232('0x21')]['message']);return _0xa8967(_0x159efa[_0xa232('0x21')]['message']);}else{logger[_0xa232('0x1b')](_0xa232('0x1c'),_0x4ecf93,_0xa232('0x1f'));_0xa8967(_0x159efa[_0xa232('0x24')][_0xa232('0x23')]);}})[_0xa232('0x25')](function(_0x3ac0a1){logger[_0xa232('0x21')](_0xa232('0x1c'),_0x4ecf93,_0x3ac0a1);_0x33be14(_0x3ac0a1);});});}function respondWithStatusCode(_0x57ab6c,_0x5ca66e){_0x5ca66e=_0x5ca66e||0xcc;return function(_0x5bdd88){if(_0x5bdd88){return _0x57ab6c['sendStatus'](_0x5ca66e);}return _0x57ab6c['status'](_0x5ca66e)[_0xa232('0x26')]();};}function respondWithResult(_0x3e5e37,_0x30d739){_0x30d739=_0x30d739||0xc8;return function(_0x3038c4){if(_0x3038c4){return _0x3e5e37[_0xa232('0x27')](_0x30d739)[_0xa232('0x28')](_0x3038c4);}};}function respondWithFilteredResult(_0x8e06e6,_0x554ed0){return function(_0x1cf6b9){if(_0x1cf6b9){var _0x3fdf01=typeof _0x554ed0[_0xa232('0x29')]===_0xa232('0x2a')&&typeof _0x554ed0[_0xa232('0x2b')]===_0xa232('0x2a');var _0x1fd4cf=_0x1cf6b9[_0xa232('0x2c')];var _0x4663ad=_0x3fdf01?0x0:_0x554ed0['offset'];var _0x286237=_0x3fdf01?_0x1cf6b9[_0xa232('0x2c')]:_0x554ed0[_0xa232('0x29')]+_0x554ed0[_0xa232('0x2b')];var _0xaff4e4;if(_0x286237>=_0x1fd4cf){_0x286237=_0x1fd4cf;_0xaff4e4=0xc8;}else{_0xaff4e4=0xce;}_0x8e06e6[_0xa232('0x27')](_0xaff4e4);return _0x8e06e6[_0xa232('0x2d')](_0xa232('0x2e'),_0x4663ad+'-'+_0x286237+'/'+_0x1fd4cf)[_0xa232('0x28')](_0x1cf6b9);}return null;};}function patchUpdates(_0x210bde){return function(_0x13c1e7){try{jsonpatch[_0xa232('0x2f')](_0x13c1e7,_0x210bde,!![]);}catch(_0x412622){return BPromise[_0xa232('0x30')](_0x412622);}return _0x13c1e7[_0xa232('0x31')]();};}function saveUpdates(_0x5851b3,_0x4e8b4d){return function(_0x2a2d44){if(_0x2a2d44){return _0x2a2d44['update'](_0x5851b3)[_0xa232('0x1a')](function(_0x695199){return _0x695199;});}return null;};}function removeEntity(_0x4e3b75,_0x3eb5ca){return function(_0x32251d){if(_0x32251d){return _0x32251d[_0xa232('0x32')]()['then'](function(){var _0x27444b=_0x32251d[_0xa232('0x33')]({'plain':!![]});var _0x31d3f0='Contexts';return db['UserProfileResource'][_0xa232('0x32')]({'where':{'type':_0x31d3f0,'resourceId':_0x27444b['id']}})[_0xa232('0x1a')](function(){return _0x32251d;});})[_0xa232('0x1a')](function(){_0x4e3b75[_0xa232('0x27')](0xcc)[_0xa232('0x26')]();});}};}function handleEntityNotFound(_0xd84e51,_0x24f384){return function(_0xe17e4a){if(!_0xe17e4a){_0xd84e51[_0xa232('0x34')](0x194);}return _0xe17e4a;};}function handleError(_0x42cdbb,_0x1ba28e){_0x1ba28e=_0x1ba28e||0x1f4;return function(_0x41a3f3){logger[_0xa232('0x21')](_0x41a3f3[_0xa232('0x35')]);if(_0x41a3f3['name']){delete _0x41a3f3['name'];}_0x42cdbb[_0xa232('0x27')](_0x1ba28e)[_0xa232('0x36')](_0x41a3f3);};}exports[_0xa232('0x37')]=function(_0x1713df,_0x20b609){var _0x1554ed={},_0x21d7de={},_0x2bebd6={'count':0x0,'rows':[]};var _0x40237e=_[_0xa232('0x38')](db[_0xa232('0x39')][_0xa232('0x3a')],function(_0x353d94){return{'name':_0x353d94[_0xa232('0x3b')],'type':_0x353d94[_0xa232('0x3c')]['key']};});_0x21d7de[_0xa232('0x3d')]=_[_0xa232('0x38')](_0x40237e,_0xa232('0x3e'));_0x21d7de[_0xa232('0x3f')]=_[_0xa232('0x40')](_0x1713df['query']);_0x21d7de[_0xa232('0x41')]=_[_0xa232('0x42')](_0x21d7de[_0xa232('0x3d')],_0x21d7de[_0xa232('0x3f')]);_0x1554ed[_0xa232('0x43')]=_[_0xa232('0x42')](_0x21d7de[_0xa232('0x3d')],qs[_0xa232('0x44')](_0x1713df[_0xa232('0x3f')][_0xa232('0x44')]));_0x1554ed[_0xa232('0x43')]=_0x1554ed['attributes'][_0xa232('0x45')]?_0x1554ed['attributes']:_0x21d7de[_0xa232('0x3d')];if(!_0x1713df['query']['hasOwnProperty'](_0xa232('0x46'))){_0x1554ed['limit']=qs['limit'](_0x1713df['query'][_0xa232('0x2b')]);_0x1554ed['offset']=qs[_0xa232('0x29')](_0x1713df[_0xa232('0x3f')][_0xa232('0x29')]);}_0x1554ed['order']=qs[_0xa232('0x47')](_0x1713df[_0xa232('0x3f')]['sort']);_0x1554ed[_0xa232('0x48')]=qs[_0xa232('0x41')](_[_0xa232('0x49')](_0x1713df[_0xa232('0x3f')],_0x21d7de[_0xa232('0x41')]),_0x40237e);if(_0x1713df[_0xa232('0x3f')][_0xa232('0x4a')]){_0x1554ed['where']=_[_0xa232('0x4b')](_0x1554ed['where'],{'$or':_[_0xa232('0x38')](_0x40237e,function(_0x41e243){if(_0x41e243['type']!==_0xa232('0x4c')){var _0x28c175={};_0x28c175[_0x41e243[_0xa232('0x3e')]]={'$like':'%'+_0x1713df['query'][_0xa232('0x4a')]+'%'};return _0x28c175;}})});}_0x1554ed=_['merge']({},_0x1554ed,_0x1713df['options']);var _0x22978e={'where':_0x1554ed['where']};return db[_0xa232('0x39')]['count'](_0x22978e)[_0xa232('0x1a')](function(_0x30073f){_0x2bebd6[_0xa232('0x2c')]=_0x30073f;if(_0x1713df['query'][_0xa232('0x4d')]){_0x1554ed['include']=[{'all':!![]}];}return db[_0xa232('0x39')]['findAll'](_0x1554ed);})[_0xa232('0x1a')](function(_0x27a3f8){_0x2bebd6['rows']=_0x27a3f8;return _0x2bebd6;})['then'](respondWithFilteredResult(_0x20b609,_0x1554ed))['catch'](handleError(_0x20b609,null));};exports[_0xa232('0x4e')]=function(_0x3061c0,_0x4ceaa1){var _0x20cded={'raw':![],'where':{'id':_0x3061c0['params']['id']}},_0x15463b={};_0x15463b[_0xa232('0x3d')]=_[_0xa232('0x40')](db['VoiceContext'][_0xa232('0x3a')]);_0x15463b['query']=_[_0xa232('0x40')](_0x3061c0['query']);_0x15463b['filters']=_[_0xa232('0x42')](_0x15463b[_0xa232('0x3d')],_0x15463b[_0xa232('0x3f')]);_0x20cded[_0xa232('0x43')]=_['intersection'](_0x15463b['model'],qs[_0xa232('0x44')](_0x3061c0['query'][_0xa232('0x44')]));_0x20cded[_0xa232('0x43')]=_0x20cded[_0xa232('0x43')][_0xa232('0x45')]?_0x20cded[_0xa232('0x43')]:_0x15463b['model'];if(_0x3061c0[_0xa232('0x3f')][_0xa232('0x4d')]){_0x20cded[_0xa232('0x4f')]=[{'all':!![]}];}_0x20cded=_[_0xa232('0x4b')]({},_0x20cded,_0x3061c0['options']);return db[_0xa232('0x39')][_0xa232('0x50')](_0x20cded)['then'](handleEntityNotFound(_0x4ceaa1,null))[_0xa232('0x1a')](respondWithResult(_0x4ceaa1,null))[_0xa232('0x25')](handleError(_0x4ceaa1,null));};exports[_0xa232('0x51')]=function(_0x58630d,_0x229ea9,_0x27061b){var _0x473670;return db['VoiceContext'][_0xa232('0x51')](_0x58630d[_0xa232('0x52')],{'raw':!![]})[_0xa232('0x1a')](function(_0x1377d6){_0x473670=_0x1377d6;return db[_0xa232('0x39')][_0xa232('0x53')]({'raw':!![]});})[_0xa232('0x1a')](function(_0x5efec6){var _0x5d1bb4=fs[_0xa232('0x54')](path['join'](config['root'],_0xa232('0x55')),_0xa232('0x56'));var _0x25b8d6=ejs[_0xa232('0x57')](_0x5d1bb4,{'contexts':_0x5efec6||[]});fs[_0xa232('0x58')](_0xa232('0x59'),_0x25b8d6);})['then'](function(){return respondWithRpcPromise(_0xa232('0x5a'),'create',{'module':_0xa232('0x5b')});})['then'](function(){var _0x4a982a=_0x58630d['user'][_0xa232('0x33')]({'plain':!![]});if(!_0x4a982a)throw new Error(_0xa232('0x5c'));if(_0x4a982a[_0xa232('0x5d')]==='user'){var _0x37c0e4=_0x473670[_0xa232('0x33')]({'plain':!![]});return db[_0xa232('0x5e')][_0xa232('0x50')]({'where':{'name':_0xa232('0x5f'),'userProfileId':_0x4a982a[_0xa232('0x60')]},'raw':!![]})[_0xa232('0x1a')](function(_0x1a7ad3){if(_0x1a7ad3&&_0x1a7ad3['autoAssociation']===0x0){return db[_0xa232('0x61')][_0xa232('0x51')]({'name':_0x37c0e4[_0xa232('0x3e')],'resourceId':_0x37c0e4['id'],'type':_0x1a7ad3[_0xa232('0x3e')],'sectionId':_0x1a7ad3['id']},{})[_0xa232('0x1a')](function(){return _0x473670;});}else{return _0x473670;}})[_0xa232('0x25')](function(_0x13fbda){logger[_0xa232('0x21')](_0xa232('0x62'),_0x13fbda);throw _0x13fbda;});}return _0x473670;})[_0xa232('0x1a')](respondWithResult(_0x229ea9,0xc9))[_0xa232('0x25')](handleError(_0x229ea9,null));};exports[_0xa232('0x63')]=function(_0x1b424a,_0xf63218,_0x1b4d4f){var _0x1ef530;return db['VoiceContext'][_0xa232('0x50')]({'where':{'id':_0x1b424a['params']['id']}})[_0xa232('0x1a')](handleEntityNotFound(_0xf63218,null))[_0xa232('0x1a')](saveUpdates(_0x1b424a['body'],null))[_0xa232('0x1a')](function(_0x46efed){if(_0x46efed){_0x1ef530=_0x46efed;return db['VoiceContext']['findAll']({'raw':!![]});}})['then'](function(_0x8441d3){var _0x1ea7a3=fs['readFileSync'](path[_0xa232('0x64')](config[_0xa232('0x65')],_0xa232('0x55')),'utf8');var _0x5d7e8c=ejs[_0xa232('0x57')](_0x1ea7a3,{'contexts':_0x8441d3||[]});fs[_0xa232('0x58')](_0xa232('0x59'),_0x5d7e8c);})[_0xa232('0x1a')](function(){return respondWithRpcPromise(_0xa232('0x5a'),_0xa232('0x63'),{'module':'chan_sip.so'});})[_0xa232('0x1a')](function(){return _0x1ef530;})['then'](respondWithResult(_0xf63218,null))['catch'](handleError(_0xf63218,null));};exports['destroy']=function(_0x2bc28a,_0x1a7820,_0x32b524){var _0x191d2e;return db[_0xa232('0x39')][_0xa232('0x50')]({'where':{'id':_0x2bc28a[_0xa232('0x66')]['id']}})['then'](handleEntityNotFound(_0x1a7820,null))[_0xa232('0x1a')](removeEntity(_0x1a7820,null))['then'](function(){return db[_0xa232('0x39')]['findAll']({'raw':!![]});})['then'](function(_0xd201b5){var _0x1a4df9=fs[_0xa232('0x54')](path[_0xa232('0x64')](config[_0xa232('0x65')],'server/files/templates/context.ejs'),_0xa232('0x56'));var _0x4f5c37=ejs[_0xa232('0x57')](_0x1a4df9,{'contexts':_0xd201b5});fs['writeFileSync'](_0xa232('0x59'),_0x4f5c37);return respondWithRpcPromise(_0xa232('0x5a'),_0xa232('0x32'),{'module':_0xa232('0x5b')});})['catch'](handleError(_0x1a7820,null));}; \ No newline at end of file +var _0x1a09=['include','findAll','rows','show','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','params','writeFileSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','undefined','count','offset','limit','Content-Range','apply','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','VoiceContext','includeAll'];(function(_0x20ebb5,_0x237d88){var _0x487182=function(_0xaa5491){while(--_0xaa5491){_0x20ebb5['push'](_0x20ebb5['shift']());}};_0x487182(++_0x237d88);}(_0x1a09,0x7a));var _0x91a0=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x1a09[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0x91a0('0x0'));var rimraf=require(_0x91a0('0x1'));var zipdir=require(_0x91a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x91a0('0x3'));var moment=require('moment');var BPromise=require(_0x91a0('0x4'));var Mustache=require(_0x91a0('0x5'));var util=require(_0x91a0('0x6'));var path=require('path');var sox=require(_0x91a0('0x7'));var csv=require(_0x91a0('0x8'));var ejs=require(_0x91a0('0x9'));var fs=require('fs');var fs_extra=require(_0x91a0('0xa'));var _=require(_0x91a0('0xb'));var squel=require(_0x91a0('0xc'));var crypto=require(_0x91a0('0xd'));var jsforce=require(_0x91a0('0xe'));var deskjs=require(_0x91a0('0xf'));var toCsv=require(_0x91a0('0x8'));var querystring=require(_0x91a0('0x10'));var Papa=require(_0x91a0('0x11'));var Redis=require(_0x91a0('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x91a0('0x13'));var hardwareService=require(_0x91a0('0x14'));var logger=require(_0x91a0('0x15'))(_0x91a0('0x16'));var utils=require(_0x91a0('0x17'));var config=require(_0x91a0('0x18'));var licenseUtil=require(_0x91a0('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0x91a0('0x1a'));var client=jayson[_0x91a0('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34bcf9,_0x49087e,_0x5f0722,_0x38b940){return new BPromise(function(_0x5a63c8,_0x26af0c){var _0x783e37=_0x38b940||client;return _0x783e37['request'](_0x34bcf9,_0x5f0722)[_0x91a0('0x1c')](function(_0x154ba5){logger[_0x91a0('0x1d')](_0x91a0('0x1e'),_0x49087e,_0x91a0('0x1f'));logger[_0x91a0('0x20')](_0x91a0('0x21'),_0x49087e,'request\x20sent',JSON['stringify'](_0x154ba5));if(_0x154ba5['error']){if(_0x154ba5[_0x91a0('0x22')][_0x91a0('0x23')]===0x1f4){logger[_0x91a0('0x22')](_0x91a0('0x1e'),_0x49087e,_0x154ba5[_0x91a0('0x22')][_0x91a0('0x24')]);return _0x26af0c(_0x154ba5['error'][_0x91a0('0x24')]);}logger[_0x91a0('0x22')](_0x91a0('0x1e'),_0x49087e,_0x154ba5[_0x91a0('0x22')][_0x91a0('0x24')]);return _0x5a63c8(_0x154ba5['error']['message']);}else{logger[_0x91a0('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x49087e,_0x91a0('0x1f'));_0x5a63c8(_0x154ba5[_0x91a0('0x25')][_0x91a0('0x24')]);}})[_0x91a0('0x26')](function(_0x13df65){logger[_0x91a0('0x22')](_0x91a0('0x1e'),_0x49087e,_0x13df65);_0x26af0c(_0x13df65);});});}function respondWithStatusCode(_0x2a8f70,_0x1e9bc0){_0x1e9bc0=_0x1e9bc0||0xcc;return function(_0x465ca7){if(_0x465ca7){return _0x2a8f70[_0x91a0('0x27')](_0x1e9bc0);}return _0x2a8f70[_0x91a0('0x28')](_0x1e9bc0)[_0x91a0('0x29')]();};}function respondWithResult(_0x58c371,_0x52093d){_0x52093d=_0x52093d||0xc8;return function(_0x4920f2){if(_0x4920f2){return _0x58c371[_0x91a0('0x28')](_0x52093d)['json'](_0x4920f2);}};}function respondWithFilteredResult(_0x55548b,_0x220ee4){return function(_0x4f177e){if(_0x4f177e){var _0x18cdaf=typeof _0x220ee4['offset']===_0x91a0('0x2a')&&typeof _0x220ee4['limit']===_0x91a0('0x2a');var _0x562db2=_0x4f177e[_0x91a0('0x2b')];var _0x3fe68d=_0x18cdaf?0x0:_0x220ee4[_0x91a0('0x2c')];var _0xd4713d=_0x18cdaf?_0x4f177e[_0x91a0('0x2b')]:_0x220ee4[_0x91a0('0x2c')]+_0x220ee4[_0x91a0('0x2d')];var _0x2a79bf;if(_0xd4713d>=_0x562db2){_0xd4713d=_0x562db2;_0x2a79bf=0xc8;}else{_0x2a79bf=0xce;}_0x55548b[_0x91a0('0x28')](_0x2a79bf);return _0x55548b['set'](_0x91a0('0x2e'),_0x3fe68d+'-'+_0xd4713d+'/'+_0x562db2)['json'](_0x4f177e);}return null;};}function patchUpdates(_0x4c1240){return function(_0x35c155){try{jsonpatch[_0x91a0('0x2f')](_0x35c155,_0x4c1240,!![]);}catch(_0x623029){return BPromise['reject'](_0x623029);}return _0x35c155[_0x91a0('0x30')]();};}function saveUpdates(_0x595be8,_0x369ddf){return function(_0x3778f3){if(_0x3778f3){return _0x3778f3[_0x91a0('0x31')](_0x595be8)[_0x91a0('0x1c')](function(_0xb885b0){return _0xb885b0;});}return null;};}function removeEntity(_0x55c64a,_0x1d735f){return function(_0x46836e){if(_0x46836e){return _0x46836e[_0x91a0('0x32')]()['then'](function(){var _0x5f3b7b=_0x46836e[_0x91a0('0x33')]({'plain':!![]});var _0x1d1c7e=_0x91a0('0x34');return db[_0x91a0('0x35')]['destroy']({'where':{'type':_0x1d1c7e,'resourceId':_0x5f3b7b['id']}})[_0x91a0('0x1c')](function(){return _0x46836e;});})[_0x91a0('0x1c')](function(){_0x55c64a[_0x91a0('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b2efd,_0x367f63){return function(_0x2de235){if(!_0x2de235){_0x4b2efd[_0x91a0('0x27')](0x194);}return _0x2de235;};}function handleError(_0x5908ea,_0x6654e4){_0x6654e4=_0x6654e4||0x1f4;return function(_0x55608b){logger[_0x91a0('0x22')](_0x55608b[_0x91a0('0x36')]);if(_0x55608b[_0x91a0('0x37')]){delete _0x55608b[_0x91a0('0x37')];}_0x5908ea[_0x91a0('0x28')](_0x6654e4)[_0x91a0('0x38')](_0x55608b);};}exports[_0x91a0('0x39')]=function(_0x1e4d25,_0x4ab903){var _0x57a48f={},_0x39064d={},_0x39f929={'count':0x0,'rows':[]};var _0x4b684c=_[_0x91a0('0x3a')](db['VoiceContext'][_0x91a0('0x3b')],function(_0x3f6d6a){return{'name':_0x3f6d6a[_0x91a0('0x3c')],'type':_0x3f6d6a[_0x91a0('0x3d')][_0x91a0('0x3e')]};});_0x39064d[_0x91a0('0x3f')]=_[_0x91a0('0x3a')](_0x4b684c,_0x91a0('0x37'));_0x39064d[_0x91a0('0x40')]=_[_0x91a0('0x41')](_0x1e4d25[_0x91a0('0x40')]);_0x39064d[_0x91a0('0x42')]=_[_0x91a0('0x43')](_0x39064d[_0x91a0('0x3f')],_0x39064d['query']);_0x57a48f[_0x91a0('0x44')]=_['intersection'](_0x39064d[_0x91a0('0x3f')],qs[_0x91a0('0x45')](_0x1e4d25[_0x91a0('0x40')][_0x91a0('0x45')]));_0x57a48f[_0x91a0('0x44')]=_0x57a48f[_0x91a0('0x44')][_0x91a0('0x46')]?_0x57a48f['attributes']:_0x39064d['model'];if(!_0x1e4d25[_0x91a0('0x40')]['hasOwnProperty'](_0x91a0('0x47'))){_0x57a48f[_0x91a0('0x2d')]=qs[_0x91a0('0x2d')](_0x1e4d25[_0x91a0('0x40')][_0x91a0('0x2d')]);_0x57a48f[_0x91a0('0x2c')]=qs[_0x91a0('0x2c')](_0x1e4d25[_0x91a0('0x40')]['offset']);}_0x57a48f['order']=qs[_0x91a0('0x48')](_0x1e4d25[_0x91a0('0x40')]['sort']);_0x57a48f[_0x91a0('0x49')]=qs[_0x91a0('0x42')](_[_0x91a0('0x4a')](_0x1e4d25[_0x91a0('0x40')],_0x39064d[_0x91a0('0x42')]),_0x4b684c);if(_0x1e4d25[_0x91a0('0x40')][_0x91a0('0x4b')]){_0x57a48f[_0x91a0('0x49')]=_['merge'](_0x57a48f[_0x91a0('0x49')],{'$or':_[_0x91a0('0x3a')](_0x4b684c,function(_0x15f9e8){if(_0x15f9e8['type']!=='VIRTUAL'){var _0x320171={};_0x320171[_0x15f9e8[_0x91a0('0x37')]]={'$like':'%'+_0x1e4d25[_0x91a0('0x40')][_0x91a0('0x4b')]+'%'};return _0x320171;}})});}_0x57a48f=_[_0x91a0('0x4c')]({},_0x57a48f,_0x1e4d25[_0x91a0('0x4d')]);var _0x28eb9c={'where':_0x57a48f['where']};return db[_0x91a0('0x4e')]['count'](_0x28eb9c)[_0x91a0('0x1c')](function(_0x1ce0f8){_0x39f929[_0x91a0('0x2b')]=_0x1ce0f8;if(_0x1e4d25[_0x91a0('0x40')][_0x91a0('0x4f')]){_0x57a48f[_0x91a0('0x50')]=[{'all':!![]}];}return db[_0x91a0('0x4e')][_0x91a0('0x51')](_0x57a48f);})[_0x91a0('0x1c')](function(_0x14e843){_0x39f929[_0x91a0('0x52')]=_0x14e843;return _0x39f929;})[_0x91a0('0x1c')](respondWithFilteredResult(_0x4ab903,_0x57a48f))[_0x91a0('0x26')](handleError(_0x4ab903,null));};exports[_0x91a0('0x53')]=function(_0x1f48d0,_0x1dde0b){var _0x17891f={'raw':![],'where':{'id':_0x1f48d0['params']['id']}},_0x3a3f00={};_0x3a3f00['model']=_[_0x91a0('0x41')](db[_0x91a0('0x4e')][_0x91a0('0x3b')]);_0x3a3f00['query']=_[_0x91a0('0x41')](_0x1f48d0['query']);_0x3a3f00[_0x91a0('0x42')]=_[_0x91a0('0x43')](_0x3a3f00['model'],_0x3a3f00[_0x91a0('0x40')]);_0x17891f[_0x91a0('0x44')]=_[_0x91a0('0x43')](_0x3a3f00[_0x91a0('0x3f')],qs[_0x91a0('0x45')](_0x1f48d0[_0x91a0('0x40')][_0x91a0('0x45')]));_0x17891f[_0x91a0('0x44')]=_0x17891f[_0x91a0('0x44')][_0x91a0('0x46')]?_0x17891f[_0x91a0('0x44')]:_0x3a3f00[_0x91a0('0x3f')];if(_0x1f48d0[_0x91a0('0x40')]['includeAll']){_0x17891f['include']=[{'all':!![]}];}_0x17891f=_[_0x91a0('0x4c')]({},_0x17891f,_0x1f48d0[_0x91a0('0x4d')]);return db['VoiceContext'][_0x91a0('0x54')](_0x17891f)[_0x91a0('0x1c')](handleEntityNotFound(_0x1dde0b,null))['then'](respondWithResult(_0x1dde0b,null))[_0x91a0('0x26')](handleError(_0x1dde0b,null));};exports['create']=function(_0x254df9,_0x101ada,_0x283ae4){var _0x531728;return db[_0x91a0('0x4e')][_0x91a0('0x55')](_0x254df9[_0x91a0('0x56')],{'raw':!![]})[_0x91a0('0x1c')](function(_0x5d207f){_0x531728=_0x5d207f;return db[_0x91a0('0x4e')][_0x91a0('0x51')]({'raw':!![]});})[_0x91a0('0x1c')](function(_0x43ed6e){var _0x2e5ee4=fs[_0x91a0('0x57')](path[_0x91a0('0x58')](config[_0x91a0('0x59')],_0x91a0('0x5a')),_0x91a0('0x5b'));var _0x3ea6d3=ejs[_0x91a0('0x5c')](_0x2e5ee4,{'contexts':_0x43ed6e||[]});fs['writeFileSync'](_0x91a0('0x5d'),_0x3ea6d3);})[_0x91a0('0x1c')](function(){return respondWithRpcPromise(_0x91a0('0x5e'),_0x91a0('0x55'),{'module':_0x91a0('0x5f')});})[_0x91a0('0x1c')](function(){var _0x56cb04=_0x254df9['user']['get']({'plain':!![]});if(!_0x56cb04)throw new Error(_0x91a0('0x60'));if(_0x56cb04[_0x91a0('0x61')]==='user'){var _0x4b0b05=_0x531728[_0x91a0('0x33')]({'plain':!![]});return db['UserProfileSection'][_0x91a0('0x54')]({'where':{'name':_0x91a0('0x34'),'userProfileId':_0x56cb04['userProfileId']},'raw':!![]})[_0x91a0('0x1c')](function(_0x382513){if(_0x382513&&_0x382513[_0x91a0('0x62')]===0x0){return db[_0x91a0('0x35')]['create']({'name':_0x4b0b05[_0x91a0('0x37')],'resourceId':_0x4b0b05['id'],'type':_0x382513[_0x91a0('0x37')],'sectionId':_0x382513['id']},{})[_0x91a0('0x1c')](function(){return _0x531728;});}else{return _0x531728;}})[_0x91a0('0x26')](function(_0x5eaee1){logger[_0x91a0('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5eaee1);throw _0x5eaee1;});}return _0x531728;})[_0x91a0('0x1c')](respondWithResult(_0x101ada,0xc9))[_0x91a0('0x26')](handleError(_0x101ada,null));};exports[_0x91a0('0x31')]=function(_0x14df81,_0x51372a,_0x7d9a74){var _0x6bddc7;return db[_0x91a0('0x4e')][_0x91a0('0x54')]({'where':{'id':_0x14df81[_0x91a0('0x63')]['id']}})['then'](handleEntityNotFound(_0x51372a,null))['then'](saveUpdates(_0x14df81['body'],null))[_0x91a0('0x1c')](function(_0x13524c){if(_0x13524c){_0x6bddc7=_0x13524c;return db['VoiceContext'][_0x91a0('0x51')]({'raw':!![]});}})[_0x91a0('0x1c')](function(_0x217c15){var _0x35dd18=fs['readFileSync'](path['join'](config[_0x91a0('0x59')],_0x91a0('0x5a')),'utf8');var _0x2e5379=ejs[_0x91a0('0x5c')](_0x35dd18,{'contexts':_0x217c15||[]});fs[_0x91a0('0x64')](_0x91a0('0x5d'),_0x2e5379);})[_0x91a0('0x1c')](function(){return respondWithRpcPromise(_0x91a0('0x5e'),_0x91a0('0x31'),{'module':'chan_sip.so'});})[_0x91a0('0x1c')](function(){return _0x6bddc7;})['then'](respondWithResult(_0x51372a,null))[_0x91a0('0x26')](handleError(_0x51372a,null));};exports[_0x91a0('0x32')]=function(_0x5db6a2,_0x17456f,_0x113c97){var _0x3e8dba;return db[_0x91a0('0x4e')][_0x91a0('0x54')]({'where':{'id':_0x5db6a2[_0x91a0('0x63')]['id']}})['then'](handleEntityNotFound(_0x17456f,null))[_0x91a0('0x1c')](removeEntity(_0x17456f,null))[_0x91a0('0x1c')](function(){return db[_0x91a0('0x4e')][_0x91a0('0x51')]({'raw':!![]});})[_0x91a0('0x1c')](function(_0x569bcc){var _0x2a2d18=fs[_0x91a0('0x57')](path[_0x91a0('0x58')](config['root'],_0x91a0('0x5a')),_0x91a0('0x5b'));var _0x4c7931=ejs[_0x91a0('0x5c')](_0x2a2d18,{'contexts':_0x569bcc});fs[_0x91a0('0x64')](_0x91a0('0x5d'),_0x4c7931);return respondWithRpcPromise(_0x91a0('0x5e'),_0x91a0('0x32'),{'module':'chan_sip.so'});})[_0x91a0('0x26')](handleError(_0x17456f,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index cba3802..ce23d13 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 _0x9779=['request-promise','rimraf','../../config/environment','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment'];(function(_0x3f3a47,_0x28f84b){var _0x57a682=function(_0x1175d3){while(--_0x1175d3){_0x3f3a47['push'](_0x3f3a47['shift']());}};_0x57a682(++_0x28f84b);}(_0x9779,0x69));var _0x9977=function(_0x1d5eb6,_0x608918){_0x1d5eb6=_0x1d5eb6-0x0;var _0x4aa162=_0x9779[_0x1d5eb6];return _0x4aa162;};'use strict';var _=require(_0x9977('0x0'));var util=require(_0x9977('0x1'));var logger=require(_0x9977('0x2'))(_0x9977('0x3'));var moment=require(_0x9977('0x4'));var BPromise=require('bluebird');var rp=require(_0x9977('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9977('0x6'));var config=require(_0x9977('0x7'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0x29b6dd,_0x5d11e8){return _0x29b6dd[_0x9977('0x8')](_0x9977('0x9'),attributes,{'tableName':_0x9977('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c3c=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','lodash','util'];(function(_0x339dd4,_0x4c1563){var _0x10992f=function(_0x44a770){while(--_0x44a770){_0x339dd4['push'](_0x339dd4['shift']());}};_0x10992f(++_0x4c1563);}(_0x5c3c,0x132));var _0xc5c3=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x5c3c[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var logger=require(_0xc5c3('0x2'))(_0xc5c3('0x3'));var moment=require('moment');var BPromise=require(_0xc5c3('0x4'));var rp=require(_0xc5c3('0x5'));var fs=require('fs');var path=require(_0xc5c3('0x6'));var rimraf=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var attributes=require(_0xc5c3('0x9'));module[_0xc5c3('0xa')]=function(_0x23a6b5,_0x28bdd9){return _0x23a6b5['define']('VoiceContext',attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index c5abebe..04596dc 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 _0x3eae=['result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x3eae,0x66));var _0xe3ea=function(_0x5a8aa3,_0x2294d5){_0x5a8aa3=_0x5a8aa3-0x0;var _0x5d0458=_0x3eae[_0x5a8aa3];return _0x5d0458;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe3ea('0x0'));var BPromise=require(_0xe3ea('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3ea('0x2'));var db=require(_0xe3ea('0x3'))['db'];var utils=require(_0xe3ea('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xe3ea('0x5'));var jayson=require(_0xe3ea('0x6'));var client=jayson['client'][_0xe3ea('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x234e2a,_0x59335d,_0x26f1b6){return new BPromise(function(_0x47f24d,_0x42e89f){return client[_0xe3ea('0x8')](_0x234e2a,_0x26f1b6)[_0xe3ea('0x9')](function(_0x5b026d){logger[_0xe3ea('0xa')](_0xe3ea('0xb'),_0x59335d,_0xe3ea('0xc'));logger[_0xe3ea('0xd')](_0xe3ea('0xe'),_0x59335d,_0xe3ea('0xc'),JSON[_0xe3ea('0xf')](_0x5b026d));if(_0x5b026d[_0xe3ea('0x10')]){if(_0x5b026d['error']['code']===0x1f4){logger[_0xe3ea('0x10')](_0xe3ea('0xb'),_0x59335d,_0x5b026d[_0xe3ea('0x10')][_0xe3ea('0x11')]);return _0x42e89f(_0x5b026d[_0xe3ea('0x10')][_0xe3ea('0x11')]);}logger[_0xe3ea('0x10')](_0xe3ea('0xb'),_0x59335d,_0x5b026d[_0xe3ea('0x10')][_0xe3ea('0x11')]);return _0x47f24d(_0x5b026d[_0xe3ea('0x10')][_0xe3ea('0x11')]);}else{logger[_0xe3ea('0xa')]('VoiceContext,\x20%s,\x20%s',_0x59335d,_0xe3ea('0xc'));_0x47f24d(_0x5b026d[_0xe3ea('0x12')][_0xe3ea('0x11')]);}})[_0xe3ea('0x13')](function(_0x3d12be){logger[_0xe3ea('0x10')](_0xe3ea('0xb'),_0x59335d,_0x3d12be);_0x42e89f(_0x3d12be);});});} \ No newline at end of file +var _0x09dd=['stringify','error','code','message','result','catch','VoiceContext,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1fa381,_0x758c2a){var _0x47eefe=function(_0x127f8c){while(--_0x127f8c){_0x1fa381['push'](_0x1fa381['shift']());}};_0x47eefe(++_0x758c2a);}(_0x09dd,0xb7));var _0xd09d=function(_0x3a096c,_0x1f9d72){_0x3a096c=_0x3a096c-0x0;var _0x44a6a4=_0x09dd[_0x3a096c];return _0x44a6a4;};'use strict';var _=require(_0xd09d('0x0'));var util=require(_0xd09d('0x1'));var moment=require(_0xd09d('0x2'));var BPromise=require(_0xd09d('0x3'));var rs=require(_0xd09d('0x4'));var fs=require('fs');var Redis=require(_0xd09d('0x5'));var db=require(_0xd09d('0x6'))['db'];var utils=require(_0xd09d('0x7'));var logger=require(_0xd09d('0x8'))('rpc');var config=require(_0xd09d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd09d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57eba0,_0x5e2910,_0x50af75){return new BPromise(function(_0x58c10c,_0x483c0a){return client[_0xd09d('0xb')](_0x57eba0,_0x50af75)['then'](function(_0x439f9c){logger[_0xd09d('0xc')]('VoiceContext,\x20%s,\x20%s',_0x5e2910,'request\x20sent');logger['debug'](_0xd09d('0xd'),_0x5e2910,_0xd09d('0xe'),JSON[_0xd09d('0xf')](_0x439f9c));if(_0x439f9c[_0xd09d('0x10')]){if(_0x439f9c[_0xd09d('0x10')][_0xd09d('0x11')]===0x1f4){logger[_0xd09d('0x10')]('VoiceContext,\x20%s,\x20%s',_0x5e2910,_0x439f9c[_0xd09d('0x10')][_0xd09d('0x12')]);return _0x483c0a(_0x439f9c[_0xd09d('0x10')][_0xd09d('0x12')]);}logger[_0xd09d('0x10')]('VoiceContext,\x20%s,\x20%s',_0x5e2910,_0x439f9c[_0xd09d('0x10')][_0xd09d('0x12')]);return _0x58c10c(_0x439f9c[_0xd09d('0x10')][_0xd09d('0x12')]);}else{logger[_0xd09d('0xc')]('VoiceContext,\x20%s,\x20%s',_0x5e2910,_0xd09d('0xe'));_0x58c10c(_0x439f9c[_0xd09d('0x13')]['message']);}})[_0xd09d('0x14')](function(_0x1a4def){logger[_0xd09d('0x10')](_0xd09d('0x15'),_0x5e2910,_0x1a4def);_0x483c0a(_0x1a4def);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 71d0115..af42b41 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 _0x6267=['show','post','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x48bb8f,_0x15ae9f){var _0x115417=function(_0x3be454){while(--_0x3be454){_0x48bb8f['push'](_0x48bb8f['shift']());}};_0x115417(++_0x15ae9f);}(_0x6267,0x1ec));var _0x7626=function(_0x990879,_0x4dbc0b){_0x990879=_0x990879-0x0;var _0x3cbfca=_0x6267[_0x990879];return _0x3cbfca;};'use strict';var multer=require('multer');var util=require(_0x7626('0x0'));var path=require('path');var timeout=require(_0x7626('0x1'));var express=require(_0x7626('0x2'));var router=express[_0x7626('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7626('0x4'));var interaction=require(_0x7626('0x5'));var config=require('../../config/environment');var controller=require(_0x7626('0x6'));router[_0x7626('0x7')]('/',auth[_0x7626('0x8')](),controller[_0x7626('0x9')]);router[_0x7626('0x7')](_0x7626('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x7626('0x7')](_0x7626('0xb'),auth['isAuthenticated'](),controller[_0x7626('0xc')]);router[_0x7626('0xd')]('/',auth[_0x7626('0x8')](),controller['create']);router['put'](_0x7626('0xb'),auth['isAuthenticated'](),controller[_0x7626('0xe')]);router[_0x7626('0xf')]('/:id',auth[_0x7626('0x8')](),controller[_0x7626('0x10')]);module[_0x7626('0x11')]=router; \ No newline at end of file +var _0x46cd=['/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','/describe','isAuthenticated','post','create','put'];(function(_0xcdfb7f,_0x543de1){var _0x291b3e=function(_0x287a7){while(--_0x287a7){_0xcdfb7f['push'](_0xcdfb7f['shift']());}};_0x291b3e(++_0x543de1);}(_0x46cd,0x181));var _0xd46c=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x46cd[_0x2f45ea];return _0x485a84;};'use strict';var multer=require('multer');var util=require(_0xd46c('0x0'));var path=require(_0xd46c('0x1'));var timeout=require(_0xd46c('0x2'));var express=require('express');var router=express[_0xd46c('0x3')]();var fs_extra=require(_0xd46c('0x4'));var auth=require(_0xd46c('0x5'));var interaction=require(_0xd46c('0x6'));var config=require('../../config/environment');var controller=require(_0xd46c('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd46c('0x8')](_0xd46c('0x9'),auth[_0xd46c('0xa')](),controller['describe']);router[_0xd46c('0x8')]('/:id',auth[_0xd46c('0xa')](),controller['show']);router[_0xd46c('0xb')]('/',auth[_0xd46c('0xa')](),controller[_0xd46c('0xc')]);router[_0xd46c('0xd')](_0xd46c('0xe'),auth['isAuthenticated'](),controller[_0xd46c('0xf')]);router[_0xd46c('0x10')](_0xd46c('0xe'),auth[_0xd46c('0xa')](),controller[_0xd46c('0x11')]);module[_0xd46c('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 12b729c..db8047d 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 _0xedd9=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x51412a,_0x40ada0){var _0x435b2e=function(_0x3a439c){while(--_0x3a439c){_0x51412a['push'](_0x51412a['shift']());}};_0x435b2e(++_0x40ada0);}(_0xedd9,0xfc));var _0x9edd=function(_0x2caeef,_0x5cda7d){_0x2caeef=_0x2caeef-0x0;var _0x3877a0=_0xedd9[_0x2caeef];return _0x3877a0;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'privilege':{'type':Sequelize[_0x9edd('0x1')]},'channel':{'type':Sequelize[_0x9edd('0x1')]},'channelstate':{'type':Sequelize[_0x9edd('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'calleridnum':{'type':Sequelize[_0x9edd('0x1')]},'calleridname':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9edd('0x1')]},'accountcode':{'type':Sequelize[_0x9edd('0x1')]},'context':{'type':Sequelize[_0x9edd('0x1')]},'exten':{'type':Sequelize[_0x9edd('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9edd('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9edd('0x1')]},'destchannelstate':{'type':Sequelize[_0x9edd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9edd('0x1')]},'destaccountcode':{'type':Sequelize[_0x9edd('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9edd('0x1')]},'destpriority':{'type':Sequelize[_0x9edd('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x9edd('0x1')]},'dialstring':{'type':Sequelize[_0x9edd('0x1')]},'dialstatus':{'type':Sequelize[_0x9edd('0x1')]},'starttime':{'type':Sequelize[_0x9edd('0x3')]},'answertime':{'type':Sequelize[_0x9edd('0x3')]},'endtime':{'type':Sequelize[_0x9edd('0x3')]},'lastevent':{'type':Sequelize[_0x9edd('0x1')],'comment':_0x9edd('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x9edd('0x2')]},'holdtime':{'type':Sequelize[_0x9edd('0x2')]},'billableseconds':{'type':Sequelize[_0x9edd('0x2')]}}; \ No newline at end of file +var _0x00bb=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x27aed7,_0x33bd33){var _0x46f4c5=function(_0x5aae98){while(--_0x5aae98){_0x27aed7['push'](_0x27aed7['shift']());}};_0x46f4c5(++_0x33bd33);}(_0x00bb,0x1d8));var _0xb00b=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x00bb[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'privilege':{'type':Sequelize[_0xb00b('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xb00b('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb00b('0x2')]},'calleridname':{'type':Sequelize[_0xb00b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'language':{'type':Sequelize[_0xb00b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb00b('0x3')]},'uniqueid':{'type':Sequelize[_0xb00b('0x2')]},'linkedid':{'type':Sequelize[_0xb00b('0x2')]},'destchannel':{'type':Sequelize[_0xb00b('0x2')]},'destchannelstate':{'type':Sequelize[_0xb00b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xb00b('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb00b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'destlanguage':{'type':Sequelize[_0xb00b('0x2')]},'destaccountcode':{'type':Sequelize[_0xb00b('0x2')]},'destcontext':{'type':Sequelize[_0xb00b('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb00b('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xb00b('0x2')]},'starttime':{'type':Sequelize[_0xb00b('0x4')]},'answertime':{'type':Sequelize[_0xb00b('0x4')]},'endtime':{'type':Sequelize[_0xb00b('0x4')]},'lastevent':{'type':Sequelize[_0xb00b('0x2')],'comment':_0xb00b('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xb00b('0x3')]},'holdtime':{'type':Sequelize[_0xb00b('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 4a24d05..0f10e9c 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 _0x2238=['fieldName','key','query','keys','model','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','name','send','index','map','VoiceDialReport','rawAttributes'];(function(_0x48ccaa,_0x118a60){var _0x3c11ab=function(_0x4cfdee){while(--_0x4cfdee){_0x48ccaa['push'](_0x48ccaa['shift']());}};_0x3c11ab(++_0x118a60);}(_0x2238,0x68));var _0x8223=function(_0x4c3bbe,_0x5a5d17){_0x4c3bbe=_0x4c3bbe-0x0;var _0x339a60=_0x2238[_0x4c3bbe];return _0x339a60;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8223('0x0'));var zipdir=require(_0x8223('0x1'));var jsonpatch=require(_0x8223('0x2'));var rp=require(_0x8223('0x3'));var moment=require(_0x8223('0x4'));var BPromise=require(_0x8223('0x5'));var Mustache=require('mustache');var util=require(_0x8223('0x6'));var path=require(_0x8223('0x7'));var sox=require(_0x8223('0x8'));var csv=require(_0x8223('0x9'));var ejs=require(_0x8223('0xa'));var fs=require('fs');var fs_extra=require(_0x8223('0xb'));var _=require('lodash');var squel=require(_0x8223('0xc'));var crypto=require(_0x8223('0xd'));var jsforce=require(_0x8223('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8223('0xf'));var Papa=require(_0x8223('0x10'));var Redis=require(_0x8223('0x11'));var authService=require(_0x8223('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8223('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8223('0x14'))('api');var utils=require(_0x8223('0x15'));var config=require(_0x8223('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8223('0x17'))['db'];function respondWithStatusCode(_0x53059b,_0x509a4c){_0x509a4c=_0x509a4c||0xcc;return function(_0x1dc13c){if(_0x1dc13c){return _0x53059b[_0x8223('0x18')](_0x509a4c);}return _0x53059b['status'](_0x509a4c)[_0x8223('0x19')]();};}function respondWithResult(_0x46f993,_0x40f196){_0x40f196=_0x40f196||0xc8;return function(_0x51a8c9){if(_0x51a8c9){return _0x46f993[_0x8223('0x1a')](_0x40f196)[_0x8223('0x1b')](_0x51a8c9);}};}function respondWithFilteredResult(_0x56fdf5,_0xf286be){return function(_0x419679){if(_0x419679){var _0x12f577=typeof _0xf286be[_0x8223('0x1c')]===_0x8223('0x1d')&&typeof _0xf286be[_0x8223('0x1e')]===_0x8223('0x1d');var _0x4be3d2=_0x419679[_0x8223('0x1f')];var _0x5513c9=_0x12f577?0x0:_0xf286be['offset'];var _0x21d01e=_0x12f577?_0x419679[_0x8223('0x1f')]:_0xf286be[_0x8223('0x1c')]+_0xf286be[_0x8223('0x1e')];var _0x48410d;if(_0x21d01e>=_0x4be3d2){_0x21d01e=_0x4be3d2;_0x48410d=0xc8;}else{_0x48410d=0xce;}_0x56fdf5[_0x8223('0x1a')](_0x48410d);return _0x56fdf5[_0x8223('0x20')](_0x8223('0x21'),_0x5513c9+'-'+_0x21d01e+'/'+_0x4be3d2)['json'](_0x419679);}return null;};}function patchUpdates(_0x523c2e){return function(_0x184b65){try{jsonpatch[_0x8223('0x22')](_0x184b65,_0x523c2e,!![]);}catch(_0x406d9c){return BPromise['reject'](_0x406d9c);}return _0x184b65['save']();};}function saveUpdates(_0x5d4314,_0xce3227){return function(_0x16055c){if(_0x16055c){return _0x16055c[_0x8223('0x23')](_0x5d4314)[_0x8223('0x24')](function(_0x234759){return _0x234759;});}return null;};}function removeEntity(_0x532f53,_0x50212c){return function(_0x13c10c){if(_0x13c10c){return _0x13c10c[_0x8223('0x25')]()[_0x8223('0x24')](function(){_0x532f53[_0x8223('0x1a')](0xcc)[_0x8223('0x19')]();});}};}function handleEntityNotFound(_0x5f3f71,_0x47fe90){return function(_0x31c22e){if(!_0x31c22e){_0x5f3f71[_0x8223('0x18')](0x194);}return _0x31c22e;};}function handleError(_0x3b6451,_0x2bd4f7){_0x2bd4f7=_0x2bd4f7||0x1f4;return function(_0x2a4642){logger['error'](_0x2a4642['stack']);if(_0x2a4642[_0x8223('0x26')]){delete _0x2a4642[_0x8223('0x26')];}_0x3b6451['status'](_0x2bd4f7)[_0x8223('0x27')](_0x2a4642);};}exports[_0x8223('0x28')]=function(_0x2f1a75,_0x584004){var _0x36efd3={},_0xd6db47={},_0x23c11c={'count':0x0,'rows':[]};var _0x51f968=_[_0x8223('0x29')](db[_0x8223('0x2a')][_0x8223('0x2b')],function(_0x12dea1){return{'name':_0x12dea1[_0x8223('0x2c')],'type':_0x12dea1['type'][_0x8223('0x2d')]};});_0xd6db47['model']=_[_0x8223('0x29')](_0x51f968,_0x8223('0x26'));_0xd6db47[_0x8223('0x2e')]=_[_0x8223('0x2f')](_0x2f1a75[_0x8223('0x2e')]);_0xd6db47['filters']=_['intersection'](_0xd6db47['model'],_0xd6db47[_0x8223('0x2e')]);_0x36efd3['attributes']=_['intersection'](_0xd6db47[_0x8223('0x30')],qs['fields'](_0x2f1a75[_0x8223('0x2e')][_0x8223('0x31')]));_0x36efd3[_0x8223('0x32')]=_0x36efd3[_0x8223('0x32')]['length']?_0x36efd3[_0x8223('0x32')]:_0xd6db47[_0x8223('0x30')];if(!_0x2f1a75[_0x8223('0x2e')][_0x8223('0x33')]('nolimit')){_0x36efd3[_0x8223('0x1e')]=qs[_0x8223('0x1e')](_0x2f1a75[_0x8223('0x2e')][_0x8223('0x1e')]);_0x36efd3['offset']=qs['offset'](_0x2f1a75[_0x8223('0x2e')]['offset']);}_0x36efd3[_0x8223('0x34')]=qs[_0x8223('0x35')](_0x2f1a75[_0x8223('0x2e')][_0x8223('0x35')]);_0x36efd3[_0x8223('0x36')]=qs[_0x8223('0x37')](_[_0x8223('0x38')](_0x2f1a75['query'],_0xd6db47['filters']),_0x51f968);if(_0x2f1a75[_0x8223('0x2e')][_0x8223('0x39')]){_0x36efd3[_0x8223('0x36')]=_['merge'](_0x36efd3[_0x8223('0x36')],{'$or':_[_0x8223('0x29')](_0x51f968,function(_0x533141){if(_0x533141[_0x8223('0x3a')]!=='VIRTUAL'){var _0x4fd342={};_0x4fd342[_0x533141[_0x8223('0x26')]]={'$like':'%'+_0x2f1a75[_0x8223('0x2e')][_0x8223('0x39')]+'%'};return _0x4fd342;}})});}_0x36efd3=_[_0x8223('0x3b')]({},_0x36efd3,_0x2f1a75[_0x8223('0x3c')]);var _0x5ba6e5={'where':_0x36efd3[_0x8223('0x36')]};return db[_0x8223('0x2a')][_0x8223('0x1f')](_0x5ba6e5)['then'](function(_0x351bac){_0x23c11c[_0x8223('0x1f')]=_0x351bac;if(_0x2f1a75[_0x8223('0x2e')][_0x8223('0x3d')]){_0x36efd3[_0x8223('0x3e')]=[{'all':!![]}];}return db[_0x8223('0x2a')][_0x8223('0x3f')](_0x36efd3);})['then'](function(_0x6b3f37){_0x23c11c[_0x8223('0x40')]=_0x6b3f37;return _0x23c11c;})['then'](respondWithFilteredResult(_0x584004,_0x36efd3))[_0x8223('0x41')](handleError(_0x584004,null));};exports[_0x8223('0x42')]=function(_0x224aae,_0x5eb90d){var _0x582882={'raw':!![],'where':{'id':_0x224aae[_0x8223('0x43')]['id']}},_0x34cba7={};_0x34cba7[_0x8223('0x30')]=_[_0x8223('0x2f')](db[_0x8223('0x2a')][_0x8223('0x2b')]);_0x34cba7[_0x8223('0x2e')]=_[_0x8223('0x2f')](_0x224aae[_0x8223('0x2e')]);_0x34cba7[_0x8223('0x37')]=_[_0x8223('0x44')](_0x34cba7['model'],_0x34cba7[_0x8223('0x2e')]);_0x582882[_0x8223('0x32')]=_[_0x8223('0x44')](_0x34cba7[_0x8223('0x30')],qs[_0x8223('0x31')](_0x224aae[_0x8223('0x2e')]['fields']));_0x582882[_0x8223('0x32')]=_0x582882[_0x8223('0x32')][_0x8223('0x45')]?_0x582882[_0x8223('0x32')]:_0x34cba7[_0x8223('0x30')];if(_0x224aae[_0x8223('0x2e')][_0x8223('0x3d')]){_0x582882[_0x8223('0x3e')]=[{'all':!![]}];}_0x582882=_['merge']({},_0x582882,_0x224aae[_0x8223('0x3c')]);return db['VoiceDialReport'][_0x8223('0x46')](_0x582882)[_0x8223('0x24')](handleEntityNotFound(_0x5eb90d,null))[_0x8223('0x24')](respondWithResult(_0x5eb90d,null))[_0x8223('0x41')](handleError(_0x5eb90d,null));};exports[_0x8223('0x47')]=function(_0x26c27f,_0x1b14fd){return db[_0x8223('0x2a')]['create'](_0x26c27f[_0x8223('0x48')],{})[_0x8223('0x24')](respondWithResult(_0x1b14fd,0xc9))[_0x8223('0x41')](handleError(_0x1b14fd,null));};exports[_0x8223('0x23')]=function(_0x56db07,_0x1b0fc8){if(_0x56db07['body']['id']){delete _0x56db07[_0x8223('0x48')]['id'];}return db[_0x8223('0x2a')]['find']({'where':{'id':_0x56db07[_0x8223('0x43')]['id']}})[_0x8223('0x24')](handleEntityNotFound(_0x1b0fc8,null))[_0x8223('0x24')](saveUpdates(_0x56db07[_0x8223('0x48')],null))['then'](respondWithResult(_0x1b0fc8,null))[_0x8223('0x41')](handleError(_0x1b0fc8,null));};exports[_0x8223('0x25')]=function(_0x38d534,_0x3c0576){return db[_0x8223('0x2a')][_0x8223('0x46')]({'where':{'id':_0x38d534[_0x8223('0x43')]['id']}})['then'](handleEntityNotFound(_0x3c0576,null))[_0x8223('0x24')](removeEntity(_0x3c0576,null))[_0x8223('0x41')](handleError(_0x3c0576,null));};exports[_0x8223('0x49')]=function(_0x2be459,_0x2d0182){return db[_0x8223('0x2a')][_0x8223('0x49')]()[_0x8223('0x24')](respondWithResult(_0x2d0182,null))['catch'](handleError(_0x2d0182,null));}; \ No newline at end of file +var _0x74b3=['map','VoiceDialReport','fieldName','type','key','query','keys','filters','attributes','intersection','model','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','destroy','error','name','send'];(function(_0x471d6a,_0x56e87c){var _0x5e837e=function(_0x5b4110){while(--_0x5b4110){_0x471d6a['push'](_0x471d6a['shift']());}};_0x5e837e(++_0x56e87c);}(_0x74b3,0x109));var _0x374b=function(_0x482985,_0x47b828){_0x482985=_0x482985-0x0;var _0x21333e=_0x74b3[_0x482985];return _0x21333e;};'use strict';var emlformat=require(_0x374b('0x0'));var rimraf=require(_0x374b('0x1'));var zipdir=require(_0x374b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x374b('0x3'));var moment=require(_0x374b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x374b('0x5'));var util=require(_0x374b('0x6'));var path=require(_0x374b('0x7'));var sox=require(_0x374b('0x8'));var csv=require(_0x374b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x374b('0xa'));var crypto=require(_0x374b('0xb'));var jsforce=require(_0x374b('0xc'));var deskjs=require(_0x374b('0xd'));var toCsv=require(_0x374b('0x9'));var querystring=require(_0x374b('0xe'));var Papa=require(_0x374b('0xf'));var Redis=require(_0x374b('0x10'));var authService=require(_0x374b('0x11'));var qs=require(_0x374b('0x12'));var as=require(_0x374b('0x13'));var hardwareService=require(_0x374b('0x14'));var logger=require(_0x374b('0x15'))(_0x374b('0x16'));var utils=require(_0x374b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x374b('0x18'));var db=require(_0x374b('0x19'))['db'];function respondWithStatusCode(_0x2a2ba8,_0x5c059f){_0x5c059f=_0x5c059f||0xcc;return function(_0x57685a){if(_0x57685a){return _0x2a2ba8[_0x374b('0x1a')](_0x5c059f);}return _0x2a2ba8[_0x374b('0x1b')](_0x5c059f)[_0x374b('0x1c')]();};}function respondWithResult(_0x5d86eb,_0x265083){_0x265083=_0x265083||0xc8;return function(_0x245c42){if(_0x245c42){return _0x5d86eb[_0x374b('0x1b')](_0x265083)['json'](_0x245c42);}};}function respondWithFilteredResult(_0x3a3f07,_0x2f4411){return function(_0x4d4601){if(_0x4d4601){var _0x347056=typeof _0x2f4411['offset']===_0x374b('0x1d')&&typeof _0x2f4411[_0x374b('0x1e')]===_0x374b('0x1d');var _0x4e995c=_0x4d4601[_0x374b('0x1f')];var _0x536415=_0x347056?0x0:_0x2f4411[_0x374b('0x20')];var _0x35bccb=_0x347056?_0x4d4601[_0x374b('0x1f')]:_0x2f4411['offset']+_0x2f4411['limit'];var _0xbd6bb1;if(_0x35bccb>=_0x4e995c){_0x35bccb=_0x4e995c;_0xbd6bb1=0xc8;}else{_0xbd6bb1=0xce;}_0x3a3f07[_0x374b('0x1b')](_0xbd6bb1);return _0x3a3f07[_0x374b('0x21')](_0x374b('0x22'),_0x536415+'-'+_0x35bccb+'/'+_0x4e995c)[_0x374b('0x23')](_0x4d4601);}return null;};}function patchUpdates(_0x5aa2a2){return function(_0x53739b){try{jsonpatch[_0x374b('0x24')](_0x53739b,_0x5aa2a2,!![]);}catch(_0x10689d){return BPromise['reject'](_0x10689d);}return _0x53739b[_0x374b('0x25')]();};}function saveUpdates(_0x510e2e,_0x266611){return function(_0x55944d){if(_0x55944d){return _0x55944d[_0x374b('0x26')](_0x510e2e)['then'](function(_0x17aaa0){return _0x17aaa0;});}return null;};}function removeEntity(_0x1d2fd3,_0x1d8b5f){return function(_0x6628d3){if(_0x6628d3){return _0x6628d3[_0x374b('0x27')]()['then'](function(){_0x1d2fd3[_0x374b('0x1b')](0xcc)[_0x374b('0x1c')]();});}};}function handleEntityNotFound(_0x3b0ec4,_0x2ab61e){return function(_0x4ed26a){if(!_0x4ed26a){_0x3b0ec4[_0x374b('0x1a')](0x194);}return _0x4ed26a;};}function handleError(_0x1b5af3,_0x4df4b8){_0x4df4b8=_0x4df4b8||0x1f4;return function(_0x52b041){logger[_0x374b('0x28')](_0x52b041['stack']);if(_0x52b041[_0x374b('0x29')]){delete _0x52b041[_0x374b('0x29')];}_0x1b5af3[_0x374b('0x1b')](_0x4df4b8)[_0x374b('0x2a')](_0x52b041);};}exports['index']=function(_0x397bd8,_0x1a32f9){var _0x583d6b={},_0x37b4d8={},_0x5b98a0={'count':0x0,'rows':[]};var _0x3bf040=_[_0x374b('0x2b')](db[_0x374b('0x2c')]['rawAttributes'],function(_0x4975ca){return{'name':_0x4975ca[_0x374b('0x2d')],'type':_0x4975ca[_0x374b('0x2e')][_0x374b('0x2f')]};});_0x37b4d8['model']=_['map'](_0x3bf040,'name');_0x37b4d8[_0x374b('0x30')]=_[_0x374b('0x31')](_0x397bd8[_0x374b('0x30')]);_0x37b4d8[_0x374b('0x32')]=_['intersection'](_0x37b4d8['model'],_0x37b4d8[_0x374b('0x30')]);_0x583d6b[_0x374b('0x33')]=_[_0x374b('0x34')](_0x37b4d8[_0x374b('0x35')],qs['fields'](_0x397bd8['query']['fields']));_0x583d6b[_0x374b('0x33')]=_0x583d6b[_0x374b('0x33')][_0x374b('0x36')]?_0x583d6b['attributes']:_0x37b4d8['model'];if(!_0x397bd8[_0x374b('0x30')][_0x374b('0x37')]('nolimit')){_0x583d6b[_0x374b('0x1e')]=qs[_0x374b('0x1e')](_0x397bd8['query'][_0x374b('0x1e')]);_0x583d6b[_0x374b('0x20')]=qs['offset'](_0x397bd8['query']['offset']);}_0x583d6b['order']=qs[_0x374b('0x38')](_0x397bd8[_0x374b('0x30')][_0x374b('0x38')]);_0x583d6b[_0x374b('0x39')]=qs[_0x374b('0x32')](_[_0x374b('0x3a')](_0x397bd8[_0x374b('0x30')],_0x37b4d8[_0x374b('0x32')]),_0x3bf040);if(_0x397bd8[_0x374b('0x30')][_0x374b('0x3b')]){_0x583d6b[_0x374b('0x39')]=_[_0x374b('0x3c')](_0x583d6b[_0x374b('0x39')],{'$or':_[_0x374b('0x2b')](_0x3bf040,function(_0x32359e){if(_0x32359e[_0x374b('0x2e')]!==_0x374b('0x3d')){var _0x2d8edc={};_0x2d8edc[_0x32359e[_0x374b('0x29')]]={'$like':'%'+_0x397bd8[_0x374b('0x30')][_0x374b('0x3b')]+'%'};return _0x2d8edc;}})});}_0x583d6b=_[_0x374b('0x3c')]({},_0x583d6b,_0x397bd8[_0x374b('0x3e')]);var _0x2e1399={'where':_0x583d6b['where']};return db[_0x374b('0x2c')][_0x374b('0x1f')](_0x2e1399)[_0x374b('0x3f')](function(_0x1af4b6){_0x5b98a0[_0x374b('0x1f')]=_0x1af4b6;if(_0x397bd8[_0x374b('0x30')][_0x374b('0x40')]){_0x583d6b[_0x374b('0x41')]=[{'all':!![]}];}return db[_0x374b('0x2c')][_0x374b('0x42')](_0x583d6b);})[_0x374b('0x3f')](function(_0x3fb1e3){_0x5b98a0[_0x374b('0x43')]=_0x3fb1e3;return _0x5b98a0;})['then'](respondWithFilteredResult(_0x1a32f9,_0x583d6b))[_0x374b('0x44')](handleError(_0x1a32f9,null));};exports[_0x374b('0x45')]=function(_0x3c20bb,_0x163dfe){var _0x8886b0={'raw':!![],'where':{'id':_0x3c20bb[_0x374b('0x46')]['id']}},_0x14550c={};_0x14550c[_0x374b('0x35')]=_[_0x374b('0x31')](db['VoiceDialReport'][_0x374b('0x47')]);_0x14550c[_0x374b('0x30')]=_[_0x374b('0x31')](_0x3c20bb[_0x374b('0x30')]);_0x14550c[_0x374b('0x32')]=_[_0x374b('0x34')](_0x14550c[_0x374b('0x35')],_0x14550c['query']);_0x8886b0[_0x374b('0x33')]=_[_0x374b('0x34')](_0x14550c[_0x374b('0x35')],qs[_0x374b('0x48')](_0x3c20bb[_0x374b('0x30')][_0x374b('0x48')]));_0x8886b0['attributes']=_0x8886b0[_0x374b('0x33')][_0x374b('0x36')]?_0x8886b0['attributes']:_0x14550c[_0x374b('0x35')];if(_0x3c20bb[_0x374b('0x30')][_0x374b('0x40')]){_0x8886b0[_0x374b('0x41')]=[{'all':!![]}];}_0x8886b0=_[_0x374b('0x3c')]({},_0x8886b0,_0x3c20bb[_0x374b('0x3e')]);return db[_0x374b('0x2c')][_0x374b('0x49')](_0x8886b0)[_0x374b('0x3f')](handleEntityNotFound(_0x163dfe,null))['then'](respondWithResult(_0x163dfe,null))['catch'](handleError(_0x163dfe,null));};exports[_0x374b('0x4a')]=function(_0x30c9cd,_0x2f65fa){return db[_0x374b('0x2c')]['create'](_0x30c9cd[_0x374b('0x4b')],{})[_0x374b('0x3f')](respondWithResult(_0x2f65fa,0xc9))[_0x374b('0x44')](handleError(_0x2f65fa,null));};exports[_0x374b('0x26')]=function(_0x34df8d,_0x4c4a9d){if(_0x34df8d[_0x374b('0x4b')]['id']){delete _0x34df8d['body']['id'];}return db[_0x374b('0x2c')]['find']({'where':{'id':_0x34df8d[_0x374b('0x46')]['id']}})[_0x374b('0x3f')](handleEntityNotFound(_0x4c4a9d,null))[_0x374b('0x3f')](saveUpdates(_0x34df8d[_0x374b('0x4b')],null))[_0x374b('0x3f')](respondWithResult(_0x4c4a9d,null))['catch'](handleError(_0x4c4a9d,null));};exports[_0x374b('0x27')]=function(_0x55e88d,_0x319bb8){return db['VoiceDialReport'][_0x374b('0x49')]({'where':{'id':_0x55e88d[_0x374b('0x46')]['id']}})['then'](handleEntityNotFound(_0x319bb8,null))['then'](removeEntity(_0x319bb8,null))[_0x374b('0x44')](handleError(_0x319bb8,null));};exports[_0x374b('0x4c')]=function(_0x2c0627,_0x1425e0){return db['VoiceDialReport'][_0x374b('0x4c')]()[_0x374b('0x3f')](respondWithResult(_0x1425e0,null))[_0x374b('0x44')](handleError(_0x1425e0,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 727ede8..54997d2 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 _0x3d11=['api','moment','bluebird','request-promise','../../config/environment','exports','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger'];(function(_0x51bd9b,_0x36977f){var _0x40324d=function(_0x1d6f07){while(--_0x1d6f07){_0x51bd9b['push'](_0x51bd9b['shift']());}};_0x40324d(++_0x36977f);}(_0x3d11,0x105));var _0x13d1=function(_0x528745,_0x14863a){_0x528745=_0x528745-0x0;var _0x5cb738=_0x3d11[_0x528745];return _0x5cb738;};'use strict';var _=require(_0x13d1('0x0'));var util=require(_0x13d1('0x1'));var logger=require(_0x13d1('0x2'))(_0x13d1('0x3'));var moment=require(_0x13d1('0x4'));var BPromise=require(_0x13d1('0x5'));var rp=require(_0x13d1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x13d1('0x7'));var attributes=require('./voiceDialReport.attributes');module[_0x13d1('0x8')]=function(_0x496e02,_0x5537ec){return _0x496e02['define'](_0x13d1('0x9'),attributes,{'tableName':_0x13d1('0xa'),'paranoid':![],'indexes':[{'fields':[_0x13d1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x141d=['util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','lodash'];(function(_0x49120f,_0x27ce4f){var _0x2521c0=function(_0x1368b6){while(--_0x1368b6){_0x49120f['push'](_0x49120f['shift']());}};_0x2521c0(++_0x27ce4f);}(_0x141d,0x12b));var _0xd141=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x141d[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0xd141('0x0'));var util=require(_0xd141('0x1'));var logger=require(_0xd141('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd141('0x3'));var rp=require(_0xd141('0x4'));var fs=require('fs');var path=require(_0xd141('0x5'));var rimraf=require(_0xd141('0x6'));var config=require('../../config/environment');var attributes=require(_0xd141('0x7'));module[_0xd141('0x8')]=function(_0x430eba,_0x1e6b5c){return _0x430eba[_0xd141('0x9')](_0xd141('0xa'),attributes,{'tableName':_0xd141('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 0cf62aa..df8ba19 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 _0x57ef=['limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceDialReport,\x20%s,\x20%s','message','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw','UpdateVoiceDialReport','body','where'];(function(_0x2c3241,_0x30b161){var _0x29e3a4=function(_0x2fbcec){while(--_0x2fbcec){_0x2c3241['push'](_0x2c3241['shift']());}};_0x29e3a4(++_0x30b161);}(_0x57ef,0x1e1));var _0xf57e=function(_0xc7d87e,_0x8580e8){_0xc7d87e=_0xc7d87e-0x0;var _0x3d85ae=_0x57ef[_0xc7d87e];return _0x3d85ae;};'use strict';var _=require(_0xf57e('0x0'));var util=require(_0xf57e('0x1'));var moment=require(_0xf57e('0x2'));var BPromise=require(_0xf57e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf57e('0x4'));var db=require(_0xf57e('0x5'))['db'];var utils=require(_0xf57e('0x6'));var logger=require(_0xf57e('0x7'))(_0xf57e('0x8'));var config=require(_0xf57e('0x9'));var jayson=require(_0xf57e('0xa'));var client=jayson[_0xf57e('0xb')][_0xf57e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x582bac,_0x23d18b,_0x39868f){return new BPromise(function(_0x1b3081,_0x5c5541){return client['request'](_0x582bac,_0x39868f)[_0xf57e('0xd')](function(_0x16c88a){logger[_0xf57e('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x23d18b,_0xf57e('0xf'));logger[_0xf57e('0x10')](_0xf57e('0x11'),_0x23d18b,_0xf57e('0xf'),JSON[_0xf57e('0x12')](_0x16c88a));if(_0x16c88a[_0xf57e('0x13')]){if(_0x16c88a[_0xf57e('0x13')]['code']===0x1f4){logger[_0xf57e('0x13')](_0xf57e('0x14'),_0x23d18b,_0x16c88a['error'][_0xf57e('0x15')]);return _0x5c5541(_0x16c88a[_0xf57e('0x13')][_0xf57e('0x15')]);}logger[_0xf57e('0x13')](_0xf57e('0x14'),_0x23d18b,_0x16c88a[_0xf57e('0x13')]['message']);return _0x1b3081(_0x16c88a['error'][_0xf57e('0x15')]);}else{logger[_0xf57e('0xe')](_0xf57e('0x14'),_0x23d18b,_0xf57e('0xf'));_0x1b3081(_0x16c88a['result'][_0xf57e('0x15')]);}})[_0xf57e('0x16')](function(_0x94bf8d){logger[_0xf57e('0x13')](_0xf57e('0x14'),_0x23d18b,_0x94bf8d);_0x5c5541(_0x94bf8d);});});}exports[_0xf57e('0x17')]=function(_0xbf3155){var _0x4ff2b0=this;return new Promise(function(_0x552339,_0x446d0f){return db[_0xf57e('0x18')][_0xf57e('0x19')](_0xbf3155['body'],{'raw':_0xbf3155['options']?_0xbf3155[_0xf57e('0x1a')][_0xf57e('0x1b')]===undefined?!![]:![]:!![]})[_0xf57e('0xd')](function(_0x1ee8d3){logger[_0xf57e('0xe')](_0xf57e('0x17'),_0xbf3155);logger[_0xf57e('0x10')]('CreateVoiceDialReport',_0xbf3155,JSON[_0xf57e('0x12')](_0x1ee8d3));_0x552339(_0x1ee8d3);})[_0xf57e('0x16')](function(_0x3ac45a){logger[_0xf57e('0x13')]('CreateVoiceDialReport',_0x3ac45a['message'],_0xbf3155);_0x446d0f(_0x4ff2b0[_0xf57e('0x13')](0x1f4,_0x3ac45a[_0xf57e('0x15')]));});});};exports[_0xf57e('0x1c')]=function(_0x9ace0c){var _0x53c825=this;return new Promise(function(_0x281892,_0x455a1d){return db['VoiceDialReport']['update'](_0x9ace0c[_0xf57e('0x1d')],{'raw':_0x9ace0c['options']?_0x9ace0c[_0xf57e('0x1a')][_0xf57e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9ace0c[_0xf57e('0x1a')]?_0x9ace0c[_0xf57e('0x1a')][_0xf57e('0x1e')]||null:null,'attributes':_0x9ace0c[_0xf57e('0x1a')]?_0x9ace0c['options']['attributes']||null:null,'limit':_0x9ace0c[_0xf57e('0x1a')]?_0x9ace0c[_0xf57e('0x1a')][_0xf57e('0x1f')]||null:null})[_0xf57e('0xd')](function(_0x89b1f9){logger[_0xf57e('0xe')]('UpdateVoiceDialReport',_0x9ace0c);logger[_0xf57e('0x10')](_0xf57e('0x1c'),_0x9ace0c,JSON['stringify'](_0x89b1f9));_0x281892(_0x89b1f9);})[_0xf57e('0x16')](function(_0x9ab39d){logger[_0xf57e('0x13')](_0xf57e('0x1c'),_0x9ab39d[_0xf57e('0x15')],_0x9ace0c);_0x455a1d(_0x53c825[_0xf57e('0x13')](0x1f4,_0x9ab39d[_0xf57e('0x15')]));});});}; \ No newline at end of file +var _0x8dd9=['util','moment','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','VoiceDialReport','create','options','raw','CreateVoiceDialReport','stringify','catch','UpdateVoiceDialReport','update','body','where','attributes','limit','then','lodash'];(function(_0x242c3c,_0x545b5b){var _0x5108c3=function(_0xc7c025){while(--_0xc7c025){_0x242c3c['push'](_0x242c3c['shift']());}};_0x5108c3(++_0x545b5b);}(_0x8dd9,0x1df));var _0x98dd=function(_0x1025d4,_0x5d85d9){_0x1025d4=_0x1025d4-0x0;var _0x583c6f=_0x8dd9[_0x1025d4];return _0x583c6f;};'use strict';var _=require(_0x98dd('0x0'));var util=require(_0x98dd('0x1'));var moment=require(_0x98dd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98dd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x98dd('0x4'));var config=require(_0x98dd('0x5'));var jayson=require(_0x98dd('0x6'));var client=jayson[_0x98dd('0x7')][_0x98dd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x534cbd,_0x249f60,_0x531d4e){return new BPromise(function(_0x1223a1,_0x8e2fe8){return client[_0x98dd('0x9')](_0x534cbd,_0x531d4e)['then'](function(_0x1a6b4b){logger[_0x98dd('0xa')](_0x98dd('0xb'),_0x249f60,_0x98dd('0xc'));logger[_0x98dd('0xd')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x249f60,'request\x20sent',JSON['stringify'](_0x1a6b4b));if(_0x1a6b4b[_0x98dd('0xe')]){if(_0x1a6b4b[_0x98dd('0xe')][_0x98dd('0xf')]===0x1f4){logger[_0x98dd('0xe')](_0x98dd('0xb'),_0x249f60,_0x1a6b4b[_0x98dd('0xe')][_0x98dd('0x10')]);return _0x8e2fe8(_0x1a6b4b[_0x98dd('0xe')]['message']);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x249f60,_0x1a6b4b[_0x98dd('0xe')][_0x98dd('0x10')]);return _0x1223a1(_0x1a6b4b[_0x98dd('0xe')][_0x98dd('0x10')]);}else{logger[_0x98dd('0xa')](_0x98dd('0xb'),_0x249f60,_0x98dd('0xc'));_0x1223a1(_0x1a6b4b[_0x98dd('0x11')][_0x98dd('0x10')]);}})['catch'](function(_0x2d8140){logger[_0x98dd('0xe')](_0x98dd('0xb'),_0x249f60,_0x2d8140);_0x8e2fe8(_0x2d8140);});});}exports['CreateVoiceDialReport']=function(_0x44bf78){var _0x31aa8b=this;return new Promise(function(_0x7bc586,_0x4dd1b5){return db[_0x98dd('0x12')][_0x98dd('0x13')](_0x44bf78['body'],{'raw':_0x44bf78[_0x98dd('0x14')]?_0x44bf78['options'][_0x98dd('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x2deaf6){logger[_0x98dd('0xa')](_0x98dd('0x16'),_0x44bf78);logger[_0x98dd('0xd')]('CreateVoiceDialReport',_0x44bf78,JSON[_0x98dd('0x17')](_0x2deaf6));_0x7bc586(_0x2deaf6);})[_0x98dd('0x18')](function(_0x71769){logger[_0x98dd('0xe')](_0x98dd('0x16'),_0x71769[_0x98dd('0x10')],_0x44bf78);_0x4dd1b5(_0x31aa8b[_0x98dd('0xe')](0x1f4,_0x71769[_0x98dd('0x10')]));});});};exports[_0x98dd('0x19')]=function(_0x5c53e1){var _0x39af85=this;return new Promise(function(_0x528006,_0x5d7e06){return db['VoiceDialReport'][_0x98dd('0x1a')](_0x5c53e1[_0x98dd('0x1b')],{'raw':_0x5c53e1[_0x98dd('0x14')]?_0x5c53e1[_0x98dd('0x14')][_0x98dd('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c53e1[_0x98dd('0x14')]?_0x5c53e1[_0x98dd('0x14')][_0x98dd('0x1c')]||null:null,'attributes':_0x5c53e1['options']?_0x5c53e1[_0x98dd('0x14')][_0x98dd('0x1d')]||null:null,'limit':_0x5c53e1[_0x98dd('0x14')]?_0x5c53e1[_0x98dd('0x14')][_0x98dd('0x1e')]||null:null})[_0x98dd('0x1f')](function(_0x253b33){logger['info'](_0x98dd('0x19'),_0x5c53e1);logger[_0x98dd('0xd')](_0x98dd('0x19'),_0x5c53e1,JSON[_0x98dd('0x17')](_0x253b33));_0x528006(_0x253b33);})[_0x98dd('0x18')](function(_0x20a883){logger[_0x98dd('0xe')](_0x98dd('0x19'),_0x20a883[_0x98dd('0x10')],_0x5c53e1);_0x5d7e06(_0x39af85[_0x98dd('0xe')](0x1f4,_0x20a883[_0x98dd('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index af505b5..37f0998 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 _0x7d0e=['exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','addApplications','put','update','delete'];(function(_0x32dea3,_0x25bb8f){var _0x495157=function(_0x4678ce){while(--_0x4678ce){_0x32dea3['push'](_0x32dea3['shift']());}};_0x495157(++_0x25bb8f);}(_0x7d0e,0xbf));var _0xe7d0=function(_0x33aad2,_0x6d0e7d){_0x33aad2=_0x33aad2-0x0;var _0x550dca=_0x7d0e[_0x33aad2];return _0x550dca;};'use strict';var multer=require('multer');var util=require(_0xe7d0('0x0'));var path=require(_0xe7d0('0x1'));var timeout=require(_0xe7d0('0x2'));var express=require(_0xe7d0('0x3'));var router=express['Router']();var fs_extra=require(_0xe7d0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe7d0('0x5'));var config=require(_0xe7d0('0x6'));var controller=require('./voiceExtension.controller');router['get']('/',auth[_0xe7d0('0x7')](),controller[_0xe7d0('0x8')]);router[_0xe7d0('0x9')](_0xe7d0('0xa'),auth['isAuthenticated'](),controller[_0xe7d0('0xb')]);router[_0xe7d0('0xc')]('/',auth[_0xe7d0('0x7')](),controller[_0xe7d0('0xd')]);router[_0xe7d0('0xc')]('/:id/applications',auth['isAuthenticated'](),controller[_0xe7d0('0xe')]);router[_0xe7d0('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xe7d0('0x10')]);router[_0xe7d0('0x11')](_0xe7d0('0xa'),auth[_0xe7d0('0x7')](),controller['destroy']);module[_0xe7d0('0x12')]=router; \ No newline at end of file +var _0x1278=['./voiceExtension.controller','get','index','/:id','isAuthenticated','show','post','/:id/applications','addApplications','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1019e6,_0x322a22){var _0x315d21=function(_0x2ac87d){while(--_0x2ac87d){_0x1019e6['push'](_0x1019e6['shift']());}};_0x315d21(++_0x322a22);}(_0x1278,0xc1));var _0x8127=function(_0x51b2f1,_0x22c27a){_0x51b2f1=_0x51b2f1-0x0;var _0xf9ddf8=_0x1278[_0x51b2f1];return _0xf9ddf8;};'use strict';var multer=require('multer');var util=require(_0x8127('0x0'));var path=require(_0x8127('0x1'));var timeout=require(_0x8127('0x2'));var express=require('express');var router=express[_0x8127('0x3')]();var fs_extra=require(_0x8127('0x4'));var auth=require(_0x8127('0x5'));var interaction=require(_0x8127('0x6'));var config=require('../../config/environment');var controller=require(_0x8127('0x7'));router[_0x8127('0x8')]('/',auth['isAuthenticated'](),controller[_0x8127('0x9')]);router['get'](_0x8127('0xa'),auth[_0x8127('0xb')](),controller[_0x8127('0xc')]);router[_0x8127('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8127('0xd')](_0x8127('0xe'),auth[_0x8127('0xb')](),controller[_0x8127('0xf')]);router[_0x8127('0x10')](_0x8127('0xa'),auth[_0x8127('0xb')](),controller[_0x8127('0x11')]);router['delete'](_0x8127('0xa'),auth['isAuthenticated'](),controller[_0x8127('0x12')]);module[_0x8127('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index fdc6479..b1d1c88 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 _0xab72=['compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','system','INTEGER','BOOLEAN','wav','getDataValue','exten','sequelize','exports'];(function(_0xa003c3,_0x1c2faf){var _0x4e6094=function(_0x21c408){while(--_0x21c408){_0xa003c3['push'](_0xa003c3['shift']());}};_0x4e6094(++_0x1c2faf);}(_0xab72,0x85));var _0x2ab7=function(_0x6d6ab2,_0x4d2d9b){_0x6d6ab2=_0x6d6ab2-0x0;var _0x27ca2d=_0xab72[_0x6d6ab2];return _0x27ca2d;};'use strict';var Sequelize=require(_0x2ab7('0x0'));module[_0x2ab7('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2ab7('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2ab7('0x2')},'priority':{'type':Sequelize[_0x2ab7('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x2ab7('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x2ab7('0x3')],'allowNull':![],'defaultValue':_0x2ab7('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x2ab7('0x5')](_0x2ab7('0x6'),_0x2ab7('0x7'),_0x2ab7('0x8'),'inbound-fax','outbound-fax',_0x2ab7('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x2ab7('0x3')]},'interval':{'type':Sequelize[_0x2ab7('0x3')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x2ab7('0xa')]},'isApp':{'type':Sequelize[_0x2ab7('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x2ab7('0x3')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x2ab7('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x2ab7('0x3')],'defaultValue':_0x2ab7('0xc')},'answer':{'type':Sequelize[_0x2ab7('0xb')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x38cb4d){return this[_0x2ab7('0xd')](_0x2ab7('0xe'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xc4f5=['outbound','internal','system','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue','exten','exports','STRING','compositeIndex','NoOp','ENUM','inbound'];(function(_0x190e41,_0x5e4167){var _0x2bfc0b=function(_0x1a79a5){while(--_0x1a79a5){_0x190e41['push'](_0x190e41['shift']());}};_0x2bfc0b(++_0x5e4167);}(_0xc4f5,0x9f));var _0x5c4f=function(_0x3f6c27,_0x47ef96){_0x3f6c27=_0x3f6c27-0x0;var _0xfc6c2c=_0xc4f5[_0x3f6c27];return _0xfc6c2c;};'use strict';var Sequelize=require('sequelize');module[_0x5c4f('0x0')]={'context':{'type':Sequelize[_0x5c4f('0x1')],'allowNull':![],'unique':_0x5c4f('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x5c4f('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x5c4f('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x5c4f('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x5c4f('0x1')],'allowNull':![],'defaultValue':_0x5c4f('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x5c4f('0x4')](_0x5c4f('0x5'),_0x5c4f('0x6'),_0x5c4f('0x7'),'inbound-fax','outbound-fax',_0x5c4f('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x5c4f('0x1')]},'interval':{'type':Sequelize[_0x5c4f('0x1')],'allowNull':![],'defaultValue':_0x5c4f('0x9')},'IntervalId':{'type':Sequelize[_0x5c4f('0xa')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x5c4f('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x5c4f('0xa')]},'recordingFormat':{'type':Sequelize[_0x5c4f('0x1')],'defaultValue':_0x5c4f('0xc')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x30aa7d){return this[_0x5c4f('0xd')](_0x5c4f('0xe'));}},'alias':{'type':Sequelize[_0x5c4f('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 882bde5..80b1211 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 _0x0656=['transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','includes','type','find','name','destroy','then','error','stack','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','VIRTUAL','VoiceExtension','includeAll','include','findAll','catch','show','merge','options','params','create','body','exten','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','update','description','recordingFormat','cutdigits','mandatoryDisposition','context','addApplications','sequelize'];(function(_0x28f380,_0x55cb60){var _0x53f350=function(_0x5d3123){while(--_0x5d3123){_0x28f380['push'](_0x28f380['shift']());}};_0x53f350(++_0x55cb60);}(_0x0656,0x169));var _0x6065=function(_0x1ad307,_0x49ffb1){_0x1ad307=_0x1ad307-0x0;var _0x2c8da2=_0x0656[_0x1ad307];return _0x2c8da2;};'use strict';var _=require(_0x6065('0x0'));var Redis=require(_0x6065('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x6065('0x2'));var config=require('../../config/environment');var db=require(_0x6065('0x3'))['db'];config['redis']=_[_0x6065('0x4')](config['redis'],{'host':_0x6065('0x5'),'port':0x18eb});var socket=require(_0x6065('0x6'))(new Redis(config[_0x6065('0x7')]));require('./voiceExtension.socket')[_0x6065('0x8')](socket);function respondWithStatusCode(_0xbd9761,_0x43acb9){_0x43acb9=_0x43acb9||0xcc;return function(_0x393bf4){if(_0x393bf4){return _0xbd9761[_0x6065('0x9')](_0x43acb9);}return _0xbd9761['status'](_0x43acb9)[_0x6065('0xa')]();};}function respondWithResult(_0x453f83,_0x2edaba){_0x2edaba=_0x2edaba||0xc8;return function(_0x9f4806){if(_0x9f4806){return _0x453f83[_0x6065('0xb')](_0x2edaba)[_0x6065('0xc')](_0x9f4806);}};}function respondWithFilteredResult(_0x54620f,_0x4e7a87){return function(_0x394f4f){if(_0x394f4f){var _0x2804a7=typeof _0x4e7a87[_0x6065('0xd')]===_0x6065('0xe')&&typeof _0x4e7a87[_0x6065('0xf')]===_0x6065('0xe');var _0x56f569=_0x394f4f['count'];var _0x5536e8=_0x2804a7?0x0:_0x4e7a87[_0x6065('0xd')];var _0x34eaef=_0x2804a7?_0x394f4f[_0x6065('0x10')]:_0x4e7a87['offset']+_0x4e7a87[_0x6065('0xf')];var _0x1d624f;if(_0x34eaef>=_0x56f569){_0x34eaef=_0x56f569;_0x1d624f=0xc8;}else{_0x1d624f=0xce;}_0x54620f[_0x6065('0xb')](_0x1d624f);return _0x54620f[_0x6065('0x11')](_0x6065('0x12'),_0x5536e8+'-'+_0x34eaef+'/'+_0x56f569)[_0x6065('0xc')](_0x394f4f);}return null;};}function removeEntity(_0x1e7d70){return function(_0x2a698a){if(_0x2a698a){return _0x2a698a['destroy']()['then'](function(){var _0x2fff65=_0x2a698a['get']({'plain':!![]});var _0xa64f81=[{'name':_0x6065('0x13'),'value':'inbound','ignore':![]},{'name':_0x6065('0x14'),'value':_0x6065('0x15'),'ignore':![]},{'name':_0x6065('0x16'),'value':_0x6065('0x17'),'ignore':![]}];var _0x44f8d5=_(_0xa64f81)[_0x6065('0x18')]('ignore')[_0x6065('0x19')](_0x6065('0x1a'))[_0x6065('0x1a')]();if(_[_0x6065('0x1b')](_0x44f8d5,_0x2fff65[_0x6065('0x1c')])){return;}var _0x4c09b4=_[_0x6065('0x1d')](_0xa64f81,[_0x6065('0x1a'),_0x2fff65[_0x6065('0x1c')]])[_0x6065('0x1e')];return db['UserProfileResource'][_0x6065('0x1f')]({'where':{'type':_0x4c09b4,'resourceId':_0x2fff65['id']}})[_0x6065('0x20')](function(){return _0x2a698a;});})[_0x6065('0x20')](function(){_0x1e7d70['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x239771){return function(_0x3b0e3e){if(!_0x3b0e3e){_0x239771[_0x6065('0x9')](0x194);}return _0x3b0e3e;};}function handleError(_0x5b5050,_0xe9c3f3){_0xe9c3f3=_0xe9c3f3||0x1f4;return function(_0x584c27){logger[_0x6065('0x21')](_0x584c27[_0x6065('0x22')]);if(_0x584c27[_0x6065('0x1e')]){delete _0x584c27[_0x6065('0x1e')];}_0x5b5050['status'](_0xe9c3f3)[_0x6065('0x23')](_0x584c27);};}exports[_0x6065('0x24')]=function(_0x3f70eb,_0x3de71b){var _0x1da563={},_0x339896={},_0x56ac73={'count':0x0,'rows':[]};var _0x1dfb1b=_[_0x6065('0x19')](db['VoiceExtension'][_0x6065('0x25')],function(_0x112f0a){return{'name':_0x112f0a[_0x6065('0x26')],'type':_0x112f0a[_0x6065('0x1c')][_0x6065('0x27')]};});_0x339896[_0x6065('0x28')]=_['map'](_0x1dfb1b,_0x6065('0x1e'));_0x339896[_0x6065('0x29')]=_[_0x6065('0x2a')](_0x3f70eb['query']);_0x339896[_0x6065('0x2b')]=_[_0x6065('0x2c')](_0x339896[_0x6065('0x28')],_0x339896[_0x6065('0x29')]);_0x1da563[_0x6065('0x2d')]=_[_0x6065('0x2c')](_0x339896[_0x6065('0x28')],qs[_0x6065('0x2e')](_0x3f70eb[_0x6065('0x29')][_0x6065('0x2e')]));_0x1da563[_0x6065('0x2d')]=_0x1da563['attributes'][_0x6065('0x2f')]?_0x1da563[_0x6065('0x2d')]:_0x339896['model'];if(!_0x3f70eb['query']['hasOwnProperty']('nolimit')){_0x1da563['limit']=qs[_0x6065('0xf')](_0x3f70eb[_0x6065('0x29')][_0x6065('0xf')]);_0x1da563[_0x6065('0xd')]=qs[_0x6065('0xd')](_0x3f70eb['query'][_0x6065('0xd')]);}_0x1da563['order']=qs[_0x6065('0x30')](_0x3f70eb[_0x6065('0x29')][_0x6065('0x30')]);_0x1da563[_0x6065('0x31')]=qs['filters'](_[_0x6065('0x32')](_0x3f70eb['query'],_0x339896[_0x6065('0x2b')]),_0x1dfb1b);if(_0x3f70eb['query'][_0x6065('0x18')]){_0x1da563['where']=_['merge'](_0x1da563['where'],{'$or':_[_0x6065('0x19')](_0x1dfb1b,function(_0x49219b){if(_0x49219b[_0x6065('0x1c')]!==_0x6065('0x33')){var _0xdde30b={};_0xdde30b[_0x49219b[_0x6065('0x1e')]]={'$like':'%'+_0x3f70eb['query'][_0x6065('0x18')]+'%'};return _0xdde30b;}})});}_0x1da563=_['merge']({},_0x1da563,_0x3f70eb['options']);var _0x114ab3={'where':_0x1da563[_0x6065('0x31')]};return db[_0x6065('0x34')][_0x6065('0x10')](_0x114ab3)[_0x6065('0x20')](function(_0x452a4d){_0x56ac73['count']=_0x452a4d;if(_0x3f70eb[_0x6065('0x29')][_0x6065('0x35')]){_0x1da563[_0x6065('0x36')]=[{'all':!![]}];}return db['VoiceExtension'][_0x6065('0x37')](_0x1da563);})[_0x6065('0x20')](function(_0x2b06e3){_0x56ac73['rows']=_0x2b06e3;return _0x56ac73;})['then'](respondWithFilteredResult(_0x3de71b,_0x1da563))[_0x6065('0x38')](handleError(_0x3de71b,null));};exports[_0x6065('0x39')]=function(_0xd0087a,_0x40c975){var _0x68350d={'raw':![],'where':{'id':_0xd0087a['params']['id']}},_0x45f883={};_0x45f883[_0x6065('0x28')]=_['keys'](db[_0x6065('0x34')][_0x6065('0x25')]);_0x45f883[_0x6065('0x29')]=_[_0x6065('0x2a')](_0xd0087a[_0x6065('0x29')]);_0x45f883[_0x6065('0x2b')]=_['intersection'](_0x45f883[_0x6065('0x28')],_0x45f883[_0x6065('0x29')]);_0x68350d[_0x6065('0x2d')]=_[_0x6065('0x2c')](_0x45f883['model'],qs[_0x6065('0x2e')](_0xd0087a[_0x6065('0x29')]['fields']));_0x68350d[_0x6065('0x2d')]=_0x68350d['attributes'][_0x6065('0x2f')]?_0x68350d[_0x6065('0x2d')]:_0x45f883['model'];if(_0xd0087a[_0x6065('0x29')][_0x6065('0x35')]){_0x68350d[_0x6065('0x36')]=[{'all':!![]}];}_0x68350d=_[_0x6065('0x3a')]({},_0x68350d,_0xd0087a[_0x6065('0x3b')]);return db[_0x6065('0x34')][_0x6065('0x1d')](_0x68350d)['then'](handleEntityNotFound(_0x40c975,null))['then'](respondWithResult(_0x40c975,null))[_0x6065('0x38')](handleError(_0x40c975,null));};exports[_0x6065('0x1f')]=function(_0x38d883,_0x5f4baf){return db[_0x6065('0x34')][_0x6065('0x1d')]({'where':{'id':_0x38d883[_0x6065('0x3c')]['id']}})[_0x6065('0x20')](handleEntityNotFound(_0x5f4baf,null))[_0x6065('0x20')](removeEntity(_0x5f4baf,null))[_0x6065('0x38')](handleError(_0x5f4baf,null));};exports[_0x6065('0x3d')]=function(_0x7cf024,_0x8d1de8){if(_0x7cf024[_0x6065('0x3e')][_0x6065('0x1c')]===_0x6065('0x15')&&!_['startsWith'](_0x7cf024[_0x6065('0x3e')][_0x6065('0x3f')],'_')){_0x7cf024[_0x6065('0x3e')]['exten']='_'['concat'](_0x7cf024[_0x6065('0x3e')][_0x6065('0x3f')]);}return db['VoiceExtension'][_0x6065('0x3d')](_0x7cf024[_0x6065('0x3e')],{'raw':![]})['then'](function(_0x5b2567){var _0x41ede4=_0x7cf024[_0x6065('0x40')][_0x6065('0x41')]({'plain':!![]});if(!_0x41ede4)throw new Error(_0x6065('0x42'));if(_0x41ede4[_0x6065('0x43')]==='user'){var _0x1eb9ce=_0x5b2567['get']({'plain':!![]});var _0x3568c0=[{'name':'InboundRoutes','value':_0x6065('0x44')},{'name':_0x6065('0x14'),'value':_0x6065('0x15')},{'name':'InternalRoutes','value':'internal'}];var _0x12f373=_[_0x6065('0x1d')](_0x3568c0,[_0x6065('0x1a'),_0x1eb9ce[_0x6065('0x1c')]])['name'];return db[_0x6065('0x45')]['find']({'where':{'name':_0x12f373,'userProfileId':_0x41ede4[_0x6065('0x46')]},'raw':!![]})[_0x6065('0x20')](function(_0x349fae){if(_0x349fae&&_0x349fae['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1eb9ce[_0x6065('0x1e')],'resourceId':_0x1eb9ce['id'],'type':_0x349fae['name'],'sectionId':_0x349fae['id']},{})['then'](function(){return _0x5b2567;});}else{return _0x5b2567;}})[_0x6065('0x38')](function(_0xeba441){logger[_0x6065('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xeba441);throw _0xeba441;});}return _0x5b2567;})[_0x6065('0x20')](respondWithResult(_0x8d1de8,0xc9))[_0x6065('0x38')](handleError(_0x8d1de8,null));};exports[_0x6065('0x47')]=function(_0x195391,_0x212aea){if(_0x195391['body']['id']){delete _0x195391['body']['id'];}return db[_0x6065('0x34')][_0x6065('0x1d')]({'where':{'id':_0x195391['params']['id']}})[_0x6065('0x20')](handleEntityNotFound(_0x212aea,null))['then'](function(_0x39abe1){if(_0x39abe1){return db['VoiceExtension']['update'](_['pick'](_0x195391['body'],[_0x6065('0x3f'),'context',_0x6065('0x48'),_0x6065('0x49'),_0x6065('0x4a'),_0x6065('0x4b'),'alias']),{'where':{'context':_0x39abe1[_0x6065('0x4c')],'exten':_0x39abe1['exten']},'individualHooks':!![]})['then'](function(_0x4cb5bb){return _0x4cb5bb;});}return null;})[_0x6065('0x20')](respondWithStatusCode(_0x212aea,null))[_0x6065('0x38')](handleError(_0x212aea,null));};exports[_0x6065('0x4d')]=function(_0x5dec3b,_0x5c5c28){var _0x23e875=_0x5dec3b[_0x6065('0x3c')]['id'];var _0x5500b7=_0x5dec3b[_0x6065('0x3e')];var _0x583b53=0xc8;var _0x159599=null;return db[_0x6065('0x4e')][_0x6065('0x4f')]({'isolationLevel':db['sequelize']['Transaction'][_0x6065('0x50')][_0x6065('0x51')]},function(_0x32acc4){return db[_0x6065('0x34')][_0x6065('0x52')]({'where':{'id':_0x23e875},'transaction':_0x32acc4})[_0x6065('0x20')](function(_0x36ce1d){if(_0x36ce1d){return db['VoiceExtension'][_0x6065('0x1f')]({'where':{'VoiceExtensionId':_0x23e875},'transaction':_0x32acc4})[_0x6065('0x20')](function(){var _0x5d8358=_[_0x6065('0x19')](_0x5500b7,function(_0x45cb3f){_0x45cb3f[_0x6065('0x53')]=_0x23e875;_0x45cb3f['isApp']=!![];return _0x45cb3f;});return _0x36ce1d['createRouting'](_0x5d8358);})[_0x6065('0x20')](function(_0x33bfc6){return db['VoiceExtension'][_0x6065('0x54')](_0x33bfc6,{'transaction':_0x32acc4});});}else{_0x583b53=0x194;_0x159599=[];}});})['then'](function(){if(_0x583b53!==0x194){return db[_0x6065('0x34')][_0x6065('0x55')]({'where':{'isApp':!![],'VoiceExtensionId':_0x23e875},'order':_0x6065('0x56')})['then'](function(_0x1be19f){_0x159599=_0x1be19f;});}})[_0x6065('0x38')](function(_0x38395b){_0x583b53=0x1f4;logger[_0x6065('0x21')](_0x38395b['stack']);if(_0x38395b[_0x6065('0x1e')]){delete _0x38395b[_0x6065('0x1e')];}_0x159599=_0x38395b;})[_0x6065('0x57')](function(){if(_0x159599===null){_0x5c5c28[_0x6065('0x9')](_0x583b53);}else{if(_0x583b53===0x1f4){_0x5c5c28['status'](_0x583b53)[_0x6065('0x23')](_0x159599);}else{_0x5c5c28[_0x6065('0xb')](_0x583b53)[_0x6065('0xc')](_0x159599);}}});}; \ No newline at end of file +var _0x7b93=['VIRTUAL','includeAll','include','rows','catch','params','body','startsWith','exten','concat','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','recordingFormat','cutdigits','alias','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','cast(priority\x20as\x20unsigned)','stack','finally','lodash','ioredis','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','destroy','then','get','InboundRoutes','inbound','InternalRoutes','internal','filter','map','value','type','find','UserProfileResource','error','name','send','index','VoiceExtension','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','where','merge'];(function(_0x411189,_0xe45048){var _0x2fa336=function(_0x18f01b){while(--_0x18f01b){_0x411189['push'](_0x411189['shift']());}};_0x2fa336(++_0xe45048);}(_0x7b93,0x1dc));var _0x37b9=function(_0x43044e,_0x5725d6){_0x43044e=_0x43044e-0x0;var _0x1c6b54=_0x7b93[_0x43044e];return _0x1c6b54;};'use strict';var _=require(_0x37b9('0x0'));var Redis=require(_0x37b9('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x37b9('0x2'));var config=require(_0x37b9('0x3'));var db=require(_0x37b9('0x4'))['db'];config['redis']=_[_0x37b9('0x5')](config[_0x37b9('0x6')],{'host':_0x37b9('0x7'),'port':0x18eb});var socket=require(_0x37b9('0x8'))(new Redis(config[_0x37b9('0x6')]));require('./voiceExtension.socket')[_0x37b9('0x9')](socket);function respondWithStatusCode(_0x1d0623,_0x369d45){_0x369d45=_0x369d45||0xcc;return function(_0x3c4221){if(_0x3c4221){return _0x1d0623[_0x37b9('0xa')](_0x369d45);}return _0x1d0623[_0x37b9('0xb')](_0x369d45)[_0x37b9('0xc')]();};}function respondWithResult(_0x1a5ed4,_0x135939){_0x135939=_0x135939||0xc8;return function(_0x24d719){if(_0x24d719){return _0x1a5ed4[_0x37b9('0xb')](_0x135939)[_0x37b9('0xd')](_0x24d719);}};}function respondWithFilteredResult(_0x27959f,_0x390ebd){return function(_0x2f704e){if(_0x2f704e){var _0x366482=typeof _0x390ebd['offset']===_0x37b9('0xe')&&typeof _0x390ebd[_0x37b9('0xf')]===_0x37b9('0xe');var _0x2ea4fb=_0x2f704e[_0x37b9('0x10')];var _0x44783b=_0x366482?0x0:_0x390ebd[_0x37b9('0x11')];var _0x30391e=_0x366482?_0x2f704e[_0x37b9('0x10')]:_0x390ebd[_0x37b9('0x11')]+_0x390ebd[_0x37b9('0xf')];var _0x510713;if(_0x30391e>=_0x2ea4fb){_0x30391e=_0x2ea4fb;_0x510713=0xc8;}else{_0x510713=0xce;}_0x27959f[_0x37b9('0xb')](_0x510713);return _0x27959f['set'](_0x37b9('0x12'),_0x44783b+'-'+_0x30391e+'/'+_0x2ea4fb)[_0x37b9('0xd')](_0x2f704e);}return null;};}function removeEntity(_0x107361){return function(_0x3ba9de){if(_0x3ba9de){return _0x3ba9de[_0x37b9('0x13')]()[_0x37b9('0x14')](function(){var _0x59f5c9=_0x3ba9de[_0x37b9('0x15')]({'plain':!![]});var _0x39f846=[{'name':_0x37b9('0x16'),'value':_0x37b9('0x17'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0x37b9('0x18'),'value':_0x37b9('0x19'),'ignore':![]}];var _0x5efe80=_(_0x39f846)[_0x37b9('0x1a')]('ignore')[_0x37b9('0x1b')](_0x37b9('0x1c'))[_0x37b9('0x1c')]();if(_['includes'](_0x5efe80,_0x59f5c9[_0x37b9('0x1d')])){return;}var _0x26b38b=_[_0x37b9('0x1e')](_0x39f846,[_0x37b9('0x1c'),_0x59f5c9['type']])['name'];return db[_0x37b9('0x1f')][_0x37b9('0x13')]({'where':{'type':_0x26b38b,'resourceId':_0x59f5c9['id']}})[_0x37b9('0x14')](function(){return _0x3ba9de;});})[_0x37b9('0x14')](function(){_0x107361['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f2b2c){return function(_0x3c0157){if(!_0x3c0157){_0x1f2b2c['sendStatus'](0x194);}return _0x3c0157;};}function handleError(_0xd40caa,_0x25e5e6){_0x25e5e6=_0x25e5e6||0x1f4;return function(_0x420da6){logger[_0x37b9('0x20')](_0x420da6['stack']);if(_0x420da6['name']){delete _0x420da6[_0x37b9('0x21')];}_0xd40caa[_0x37b9('0xb')](_0x25e5e6)[_0x37b9('0x22')](_0x420da6);};}exports[_0x37b9('0x23')]=function(_0x3db510,_0x44d8d2){var _0x34a108={},_0x4a4bdc={},_0x32df3f={'count':0x0,'rows':[]};var _0x5e07f2=_[_0x37b9('0x1b')](db[_0x37b9('0x24')][_0x37b9('0x25')],function(_0x5dbbc0){return{'name':_0x5dbbc0[_0x37b9('0x26')],'type':_0x5dbbc0[_0x37b9('0x1d')]['key']};});_0x4a4bdc[_0x37b9('0x27')]=_[_0x37b9('0x1b')](_0x5e07f2,'name');_0x4a4bdc['query']=_[_0x37b9('0x28')](_0x3db510[_0x37b9('0x29')]);_0x4a4bdc[_0x37b9('0x2a')]=_[_0x37b9('0x2b')](_0x4a4bdc[_0x37b9('0x27')],_0x4a4bdc[_0x37b9('0x29')]);_0x34a108['attributes']=_[_0x37b9('0x2b')](_0x4a4bdc[_0x37b9('0x27')],qs[_0x37b9('0x2c')](_0x3db510[_0x37b9('0x29')]['fields']));_0x34a108[_0x37b9('0x2d')]=_0x34a108[_0x37b9('0x2d')][_0x37b9('0x2e')]?_0x34a108[_0x37b9('0x2d')]:_0x4a4bdc[_0x37b9('0x27')];if(!_0x3db510[_0x37b9('0x29')][_0x37b9('0x2f')]('nolimit')){_0x34a108[_0x37b9('0xf')]=qs[_0x37b9('0xf')](_0x3db510[_0x37b9('0x29')][_0x37b9('0xf')]);_0x34a108['offset']=qs['offset'](_0x3db510[_0x37b9('0x29')][_0x37b9('0x11')]);}_0x34a108['order']=qs[_0x37b9('0x30')](_0x3db510[_0x37b9('0x29')][_0x37b9('0x30')]);_0x34a108['where']=qs['filters'](_[_0x37b9('0x31')](_0x3db510['query'],_0x4a4bdc[_0x37b9('0x2a')]),_0x5e07f2);if(_0x3db510[_0x37b9('0x29')][_0x37b9('0x1a')]){_0x34a108[_0x37b9('0x32')]=_[_0x37b9('0x33')](_0x34a108[_0x37b9('0x32')],{'$or':_[_0x37b9('0x1b')](_0x5e07f2,function(_0xc0ae3b){if(_0xc0ae3b['type']!==_0x37b9('0x34')){var _0x2ce8bf={};_0x2ce8bf[_0xc0ae3b[_0x37b9('0x21')]]={'$like':'%'+_0x3db510['query']['filter']+'%'};return _0x2ce8bf;}})});}_0x34a108=_[_0x37b9('0x33')]({},_0x34a108,_0x3db510['options']);var _0x31e3ad={'where':_0x34a108[_0x37b9('0x32')]};return db[_0x37b9('0x24')]['count'](_0x31e3ad)[_0x37b9('0x14')](function(_0x14319f){_0x32df3f['count']=_0x14319f;if(_0x3db510['query'][_0x37b9('0x35')]){_0x34a108[_0x37b9('0x36')]=[{'all':!![]}];}return db[_0x37b9('0x24')]['findAll'](_0x34a108);})[_0x37b9('0x14')](function(_0x2da678){_0x32df3f[_0x37b9('0x37')]=_0x2da678;return _0x32df3f;})['then'](respondWithFilteredResult(_0x44d8d2,_0x34a108))[_0x37b9('0x38')](handleError(_0x44d8d2,null));};exports['show']=function(_0x17f47a,_0x5244d0){var _0x3438e3={'raw':![],'where':{'id':_0x17f47a[_0x37b9('0x39')]['id']}},_0x97d384={};_0x97d384[_0x37b9('0x27')]=_['keys'](db[_0x37b9('0x24')][_0x37b9('0x25')]);_0x97d384[_0x37b9('0x29')]=_[_0x37b9('0x28')](_0x17f47a[_0x37b9('0x29')]);_0x97d384[_0x37b9('0x2a')]=_[_0x37b9('0x2b')](_0x97d384['model'],_0x97d384[_0x37b9('0x29')]);_0x3438e3[_0x37b9('0x2d')]=_['intersection'](_0x97d384[_0x37b9('0x27')],qs[_0x37b9('0x2c')](_0x17f47a[_0x37b9('0x29')][_0x37b9('0x2c')]));_0x3438e3['attributes']=_0x3438e3[_0x37b9('0x2d')][_0x37b9('0x2e')]?_0x3438e3[_0x37b9('0x2d')]:_0x97d384[_0x37b9('0x27')];if(_0x17f47a['query']['includeAll']){_0x3438e3[_0x37b9('0x36')]=[{'all':!![]}];}_0x3438e3=_[_0x37b9('0x33')]({},_0x3438e3,_0x17f47a['options']);return db[_0x37b9('0x24')]['find'](_0x3438e3)['then'](handleEntityNotFound(_0x5244d0,null))[_0x37b9('0x14')](respondWithResult(_0x5244d0,null))['catch'](handleError(_0x5244d0,null));};exports['destroy']=function(_0x257add,_0xbe2d7a){return db[_0x37b9('0x24')][_0x37b9('0x1e')]({'where':{'id':_0x257add[_0x37b9('0x39')]['id']}})[_0x37b9('0x14')](handleEntityNotFound(_0xbe2d7a,null))[_0x37b9('0x14')](removeEntity(_0xbe2d7a,null))[_0x37b9('0x38')](handleError(_0xbe2d7a,null));};exports['create']=function(_0x4e28e4,_0x4ba03e){if(_0x4e28e4[_0x37b9('0x3a')]['type']==='outbound'&&!_[_0x37b9('0x3b')](_0x4e28e4[_0x37b9('0x3a')][_0x37b9('0x3c')],'_')){_0x4e28e4['body'][_0x37b9('0x3c')]='_'[_0x37b9('0x3d')](_0x4e28e4[_0x37b9('0x3a')][_0x37b9('0x3c')]);}return db[_0x37b9('0x24')][_0x37b9('0x3e')](_0x4e28e4[_0x37b9('0x3a')],{'raw':![]})[_0x37b9('0x14')](function(_0x5a0a18){var _0x395971=_0x4e28e4['user'][_0x37b9('0x15')]({'plain':!![]});if(!_0x395971)throw new Error(_0x37b9('0x3f'));if(_0x395971[_0x37b9('0x40')]==='user'){var _0x40c975=_0x5a0a18[_0x37b9('0x15')]({'plain':!![]});var _0x557213=[{'name':_0x37b9('0x16'),'value':_0x37b9('0x17')},{'name':_0x37b9('0x41'),'value':_0x37b9('0x42')},{'name':_0x37b9('0x18'),'value':_0x37b9('0x19')}];var _0x50f53c=_[_0x37b9('0x1e')](_0x557213,[_0x37b9('0x1c'),_0x40c975[_0x37b9('0x1d')]])['name'];return db[_0x37b9('0x43')][_0x37b9('0x1e')]({'where':{'name':_0x50f53c,'userProfileId':_0x395971[_0x37b9('0x44')]},'raw':!![]})[_0x37b9('0x14')](function(_0x168ca9){if(_0x168ca9&&_0x168ca9[_0x37b9('0x45')]===0x0){return db[_0x37b9('0x1f')][_0x37b9('0x3e')]({'name':_0x40c975['name'],'resourceId':_0x40c975['id'],'type':_0x168ca9[_0x37b9('0x21')],'sectionId':_0x168ca9['id']},{})[_0x37b9('0x14')](function(){return _0x5a0a18;});}else{return _0x5a0a18;}})[_0x37b9('0x38')](function(_0x4ff8b6){logger[_0x37b9('0x20')](_0x37b9('0x46'),_0x4ff8b6);throw _0x4ff8b6;});}return _0x5a0a18;})[_0x37b9('0x14')](respondWithResult(_0x4ba03e,0xc9))[_0x37b9('0x38')](handleError(_0x4ba03e,null));};exports['update']=function(_0x13d4db,_0x10db1b){if(_0x13d4db['body']['id']){delete _0x13d4db['body']['id'];}return db[_0x37b9('0x24')][_0x37b9('0x1e')]({'where':{'id':_0x13d4db[_0x37b9('0x39')]['id']}})[_0x37b9('0x14')](handleEntityNotFound(_0x10db1b,null))[_0x37b9('0x14')](function(_0x2ef53f){if(_0x2ef53f){return db['VoiceExtension']['update'](_[_0x37b9('0x31')](_0x13d4db[_0x37b9('0x3a')],['exten',_0x37b9('0x47'),'description',_0x37b9('0x48'),_0x37b9('0x49'),'mandatoryDisposition',_0x37b9('0x4a')]),{'where':{'context':_0x2ef53f[_0x37b9('0x47')],'exten':_0x2ef53f[_0x37b9('0x3c')]},'individualHooks':!![]})[_0x37b9('0x14')](function(_0x4f5292){return _0x4f5292;});}return null;})['then'](respondWithStatusCode(_0x10db1b,null))[_0x37b9('0x38')](handleError(_0x10db1b,null));};exports[_0x37b9('0x4b')]=function(_0x217ad4,_0x4b67aa){var _0x4ea902=_0x217ad4[_0x37b9('0x39')]['id'];var _0x2480cd=_0x217ad4[_0x37b9('0x3a')];var _0x13c94c=0xc8;var _0x4a3458=null;return db['sequelize'][_0x37b9('0x4c')]({'isolationLevel':db[_0x37b9('0x4d')][_0x37b9('0x4e')][_0x37b9('0x4f')][_0x37b9('0x50')]},function(_0x3b5791){return db[_0x37b9('0x24')][_0x37b9('0x51')]({'where':{'id':_0x4ea902},'transaction':_0x3b5791})[_0x37b9('0x14')](function(_0x4b7fa9){if(_0x4b7fa9){return db[_0x37b9('0x24')][_0x37b9('0x13')]({'where':{'VoiceExtensionId':_0x4ea902},'transaction':_0x3b5791})[_0x37b9('0x14')](function(){var _0x3cb91a=_['map'](_0x2480cd,function(_0x5d0f2c){_0x5d0f2c[_0x37b9('0x52')]=_0x4ea902;_0x5d0f2c[_0x37b9('0x53')]=!![];return _0x5d0f2c;});return _0x4b7fa9['createRouting'](_0x3cb91a);})['then'](function(_0x396237){return db[_0x37b9('0x24')][_0x37b9('0x54')](_0x396237,{'transaction':_0x3b5791});});}else{_0x13c94c=0x194;_0x4a3458=[];}});})[_0x37b9('0x14')](function(){if(_0x13c94c!==0x194){return db[_0x37b9('0x24')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x4ea902},'order':_0x37b9('0x55')})['then'](function(_0x63d529){_0x4a3458=_0x63d529;});}})[_0x37b9('0x38')](function(_0xb98363){_0x13c94c=0x1f4;logger['error'](_0xb98363[_0x37b9('0x56')]);if(_0xb98363[_0x37b9('0x21')]){delete _0xb98363['name'];}_0x4a3458=_0xb98363;})[_0x37b9('0x57')](function(){if(_0x4a3458===null){_0x4b67aa['sendStatus'](_0x13c94c);}else{if(_0x13c94c===0x1f4){_0x4b67aa[_0x37b9('0xb')](_0x13c94c)[_0x37b9('0x22')](_0x4a3458);}else{_0x4b67aa[_0x37b9('0xb')](_0x13c94c)[_0x37b9('0xd')](_0x4a3458);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 08e802a..6b3598d 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 _0x6a92=['save','update','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x2300c7,_0x255f74){var _0x23f720=function(_0x3fea57){while(--_0x3fea57){_0x2300c7['push'](_0x2300c7['shift']());}};_0x23f720(++_0x255f74);}(_0x6a92,0x11d));var _0x26a9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6a92[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x26a9('0x0'));var VoiceExtension=require(_0x26a9('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x26a9('0x2')](0x0);var events={'afterCreate':_0x26a9('0x3'),'afterUpdate':_0x26a9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x42af65){return function(_0x12209a,_0x30480d,_0x174bab){VoiceExtensionEvents[_0x26a9('0x5')](_0x42af65+':'+_0x12209a['id'],_0x12209a);VoiceExtensionEvents['emit'](_0x42af65,_0x12209a);_0x174bab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x26a9('0x6')](e,emitEvent(event));}}module[_0x26a9('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0xa11d=['remove','emit','hasOwnProperty','exports','events','update'];(function(_0x430f44,_0x4ae21b){var _0x1f6b0f=function(_0x35968f){while(--_0x35968f){_0x430f44['push'](_0x430f44['shift']());}};_0x1f6b0f(++_0x4ae21b);}(_0xa11d,0x1d2));var _0xda11=function(_0x22b327,_0x8b59fa){_0x22b327=_0x22b327-0x0;var _0x5f11d3=_0xa11d[_0x22b327];return _0x5f11d3;};'use strict';var EventEmitter=require(_0xda11('0x0'));var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xda11('0x1'),'afterDestroy':_0xda11('0x2')};function emitEvent(_0x6cdf0c){return function(_0x22fe15,_0x3219eb,_0x4875c8){VoiceExtensionEvents[_0xda11('0x3')](_0x6cdf0c+':'+_0x22fe15['id'],_0x22fe15);VoiceExtensionEvents[_0xda11('0x3')](_0x6cdf0c,_0x22fe15);_0x4875c8(null);};}for(var e in events){if(events[_0xda11('0x4')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xda11('0x5')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index f3457e2..3fdaa5d 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 _0x78b3=['No\x20alias\x20set','context','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','param','phone','prefix','SIP','join','none','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','IntervalId','interval','*,*,*,*','intervals','map','filter','toLowerCase','hasOwnProperty','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','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','catch','define','voice_extensions','get','then','Hangup','lodash','./voiceExtension.attributes','exports','models','Set','type','exten','alias','NoOp','CDR(routeAlias)='];(function(_0x151334,_0x1e11ac){var _0x3d03da=function(_0x2099cf){while(--_0x2099cf){_0x151334['push'](_0x151334['shift']());}};_0x3d03da(++_0x1e11ac);}(_0x78b3,0x1b3));var _0x378b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78b3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x378b('0x0'));var attributes=require(_0x378b('0x1'));module[_0x378b('0x2')]=function(_0x541740){var _0x101907=_0x541740[_0x378b('0x3')];function _0x2d6733(_0xaf4672){var _0x41965e=0x2;var _0x35b692=[{'type':_0xaf4672['type'],'app':_0x378b('0x4'),'appdata':'CDR(type)='+_0xaf4672[_0x378b('0x5')],'context':_0xaf4672['context'],'exten':_0xaf4672[_0x378b('0x6')],'priority':_0x41965e++,'VoiceExtensionId':_0xaf4672['id']},{'type':_0xaf4672['type'],'app':_0xaf4672[_0x378b('0x7')]?_0x378b('0x4'):_0x378b('0x8'),'appdata':_0xaf4672[_0x378b('0x7')]?_0x378b('0x9')+_0xaf4672[_0x378b('0x7')]:_0x378b('0xa'),'context':_0xaf4672[_0x378b('0xb')],'exten':_0xaf4672[_0x378b('0x6')],'priority':_0x41965e++,'VoiceExtensionId':_0xaf4672['id']}];if(_0xaf4672['type']===_0x378b('0xc')){_0x35b692[_0x378b('0xd')]({'type':_0x378b('0xc'),'app':'Set','appdata':'CDR(routeid)='+_0xaf4672['id'],'context':_0xaf4672[_0x378b('0xb')],'exten':_0xaf4672[_0x378b('0x6')],'priority':_0x41965e++,'VoiceExtensionId':_0xaf4672['id']});}_0x35b692['push']({'type':_0xaf4672[_0x378b('0x5')],'app':'Set','appdata':_0x378b('0xe'),'context':_0xaf4672[_0x378b('0xb')],'exten':_0xaf4672[_0x378b('0x6')],'priority':_0x41965e++,'VoiceExtensionId':_0xaf4672['id']},{'type':_0xaf4672[_0x378b('0x5')],'app':'Set','appdata':_0x378b('0xf'),'context':_0xaf4672[_0x378b('0xb')],'exten':_0xaf4672[_0x378b('0x6')],'priority':_0x41965e++,'VoiceExtensionId':_0xaf4672['id']},{'type':_0xaf4672[_0x378b('0x5')],'app':_0x378b('0x4'),'appdata':_0x378b('0x10'),'context':_0xaf4672[_0x378b('0xb')],'exten':_0xaf4672['exten'],'priority':_0x41965e++,'VoiceExtensionId':_0xaf4672['id']});return _0x35b692;}function _0x4b5c09(_0x26b11e){var _0x5494db=0x2;var _0x2000ba=[{'type':_0x378b('0x11'),'app':'Set','appdata':_0x378b('0x12'),'context':_0x26b11e[_0x378b('0xb')],'exten':_0x26b11e[_0x378b('0x6')],'priority':_0x5494db++,'VoiceExtensionId':_0x26b11e['id']},{'type':_0x378b('0x11'),'app':_0x26b11e['alias']?_0x378b('0x4'):_0x378b('0x8'),'appdata':_0x26b11e[_0x378b('0x7')]?_0x378b('0x9')+_0x26b11e[_0x378b('0x7')]:_0x378b('0xa'),'context':_0x26b11e[_0x378b('0xb')],'exten':_0x26b11e['exten'],'priority':_0x5494db++,'VoiceExtensionId':_0x26b11e['id']},{'type':_0x378b('0x11'),'app':_0x378b('0x4'),'appdata':_0x378b('0x13')+(_0x26b11e[_0x378b('0x14')]?_0x378b('0x15')+_0x26b11e['cutdigits']+'}':_0x378b('0x16')),'context':_0x26b11e[_0x378b('0xb')],'exten':_0x26b11e[_0x378b('0x6')],'priority':_0x5494db++,'VoiceExtensionId':_0x26b11e['id']},{'type':_0x378b('0x11'),'app':_0x378b('0x4'),'appdata':_0x378b('0x17')+_0x26b11e['id'],'context':_0x26b11e[_0x378b('0xb')],'exten':_0x26b11e[_0x378b('0x6')],'priority':_0x5494db++,'VoiceExtensionId':_0x26b11e['id']},{'type':'outbound','app':_0x378b('0x18'),'appdata':_0x378b('0x19')+(_0x5494db+0x2)+'):Goto('+(_0x5494db+0x1)+')','context':_0x26b11e[_0x378b('0xb')],'exten':_0x26b11e[_0x378b('0x6')],'priority':_0x5494db++,'VoiceExtensionId':_0x26b11e['id']},{'type':_0x378b('0x11'),'app':_0x378b('0x4'),'appdata':_0x26b11e[_0x378b('0x14')]?_0x378b('0x1a')+_0x26b11e['cutdigits']+'}':_0x378b('0x1b'),'context':_0x26b11e[_0x378b('0xb')],'exten':_0x26b11e[_0x378b('0x6')],'priority':_0x5494db++,'VoiceExtensionId':_0x26b11e['id']},{'type':_0x378b('0x11'),'app':_0x378b('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x26b11e[_0x378b('0xb')],'exten':_0x26b11e[_0x378b('0x6')],'priority':_0x5494db++,'VoiceExtensionId':_0x26b11e['id']},{'type':_0x378b('0x11'),'app':_0x378b('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x26b11e[_0x378b('0xb')],'exten':_0x26b11e[_0x378b('0x6')],'priority':_0x5494db++,'VoiceExtensionId':_0x26b11e['id']},{'type':'outbound','app':_0x378b('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x26b11e['context'],'exten':_0x26b11e[_0x378b('0x6')],'priority':_0x5494db++,'VoiceExtensionId':_0x26b11e['id']},{'type':_0x378b('0x11'),'app':_0x378b('0x4'),'appdata':_0x378b('0x1c')+_0x26b11e['id'],'context':_0x26b11e['context'],'exten':_0x26b11e[_0x378b('0x6')],'priority':_0x5494db++,'VoiceExtensionId':_0x26b11e['id']}];if(_0x26b11e['hasOwnProperty'](_0x378b('0x1d'))&&_0x26b11e[_0x378b('0x1d')]!=='none'){_0x2000ba['push']({'type':_0x378b('0x11'),'app':_0x378b('0x4'),'appdata':_0x378b('0x1e'),'context':_0x26b11e[_0x378b('0xb')],'exten':_0x26b11e[_0x378b('0x6')],'priority':_0x5494db++,'VoiceExtensionId':_0x26b11e['id']},{'type':_0x378b('0x11'),'app':_0x378b('0x4'),'appdata':_0x378b('0x1f')+_0x26b11e['recordingFormat']||_0x378b('0x20'),'context':_0x26b11e[_0x378b('0xb')],'exten':_0x26b11e[_0x378b('0x6')],'priority':_0x5494db++,'VoiceExtensionId':_0x26b11e['id']});}return _0x2000ba;}function _0x319017(_0x2637fe,_0x2fd054){var _0x5a4a2e=[{'name':_0x378b('0x21'),'param':0x0},{'name':_0x378b('0x22'),'param':0x1},{'name':_0x378b('0x23'),'param':0x2},{'name':_0x378b('0x24'),'param':0x3}];var _0x54b638={};var _0x408c8f=_0x2fd054[_0x378b('0x25')](',');var _0x538e97=[];for(var _0x13bd7d=0x0;_0x13bd7d<_0x5a4a2e[_0x378b('0x26')];_0x13bd7d++){switch(_0x5a4a2e[_0x13bd7d][_0x378b('0x27')]){case'trunk':_0x54b638[_0x378b('0x21')]=_0x408c8f[_0x5a4a2e[_0x13bd7d][_0x378b('0x28')]][_0x378b('0x25')]('/')[0x1];_0x54b638[_0x378b('0x29')]=_0x408c8f[_0x5a4a2e[_0x13bd7d][_0x378b('0x28')]][_0x378b('0x25')]('/')[0x2];_0x54b638['prefix']=_0x54b638[_0x378b('0x29')]?_0x54b638[_0x378b('0x29')][_0x378b('0x25')]('$')[0x0]:undefined;_0x54b638['phone']=_0x2637fe[_0x378b('0x14')]?(_0x54b638[_0x378b('0x2a')]||'')+_0x378b('0x15')+_0x2637fe[_0x378b('0x14')]+'}':(_0x54b638[_0x378b('0x2a')]||'')+_0x378b('0x16');_0x538e97[_0x5a4a2e[_0x13bd7d]['param']]=[_0x378b('0x2b'),_0x54b638[_0x378b('0x21')],_0x54b638[_0x378b('0x29')]][_0x378b('0x2c')]('/');break;case'options':_0x54b638[_0x378b('0x23')]=_0x408c8f[_0x5a4a2e[_0x13bd7d][_0x378b('0x28')]];if(_0x2637fe[_0x378b('0x1d')]!==_0x378b('0x2d')){if(_0x54b638[_0x378b('0x23')][_0x378b('0x2e')](_0x378b('0x2f'))<0x0){_0x54b638[_0x378b('0x23')]+=_0x378b('0x2f');}}else{_0x54b638[_0x378b('0x23')]=_0x54b638['options'][_0x378b('0x30')](_0x378b('0x2f'),'');}_0x538e97[_0x5a4a2e[_0x13bd7d][_0x378b('0x28')]]=_0x54b638[_0x378b('0x23')];break;default:_0x538e97[_0x5a4a2e[_0x13bd7d][_0x378b('0x28')]]=_0x408c8f[_0x5a4a2e[_0x13bd7d][_0x378b('0x28')]];}}return _0x538e97['join'](',');}function _0x4c1ec6(_0x335026,_0x56587a,_0x18766b){return new Promise(function(_0x247477,_0x5f4002){var _0x33a4ad=[];if(_[_0x378b('0x31')](_0x56587a))return _0x247477(_0x33a4ad);_0x101907['Interval']['findAll']({'attributes':['id','interval',_0x378b('0x32')],'raw':!![]})['then'](function(_0x2d175d){for(var _0x5670c4=0x0,_0x40e222=0x0;_0x5670c4<_0x56587a['length'];_0x5670c4++,_0x40e222=0x0){var _0x320b92=_0x56587a[_0x5670c4];var _0x1bd9a1=[];var _0x36361c=[];delete _0x320b92['id'];if(_0x320b92[_0x378b('0x33')]!==_0x378b('0x34')){_0x320b92[_0x378b('0x35')]=[_0x320b92[_0x378b('0x33')]];}else{_0x320b92[_0x378b('0x35')]=_0x320b92[_0x378b('0x32')]?_[_0x378b('0x36')](_[_0x378b('0x37')](_0x2d175d,{'IntervalId':_0x320b92['IntervalId']}),_0x378b('0x33')):[];}_0x320b92[_0x378b('0xb')]=_0x335026['context'];_0x320b92[_0x378b('0x6')]=_0x335026['exten'];if(_0x320b92['type'])_0x320b92[_0x378b('0x5')]=_0x320b92['type'][_0x378b('0x38')]();if(_0x335026[_0x378b('0x5')]===_0x378b('0x11')){if(_0x320b92[_0x378b('0x39')]('tag')&&_0x320b92[_0x378b('0x3a')]&&_0x320b92[_0x378b('0x3a')]!=='--'){_0x1bd9a1[_0x378b('0xd')]({'type':_0x320b92[_0x378b('0x5')][_0x378b('0x38')](),'app':_0x378b('0x4'),'appdata':_0x378b('0x3b')+_0x320b92[_0x378b('0x3a')],'context':_0x335026['context'],'exten':_0x335026[_0x378b('0x6')],'priority':_0x320b92[_0x378b('0x35')]['length']+_0x18766b+_0x40e222++,'VoiceExtensionId':_0x335026['id']});}_0x1bd9a1[_0x378b('0xd')]({'type':_0x320b92[_0x378b('0x5')][_0x378b('0x38')](),'app':_0x378b('0x18'),'appdata':_0x378b('0x3c')+(_0x320b92[_0x378b('0x3d')]?_0x378b('0x3e')+_0x320b92['callerID']+')':_0x378b('0x3f')),'context':_0x335026[_0x378b('0xb')],'exten':_0x335026[_0x378b('0x6')],'priority':_0x320b92[_0x378b('0x35')]['length']+_0x18766b+_0x40e222++,'VoiceExtensionId':_0x335026['id']});}else{if(_0x320b92['hasOwnProperty'](_0x378b('0x40'))){if([_0x378b('0x41'),_0x378b('0x42')][_0x378b('0x43')](_0x320b92[_0x378b('0x44')]['toLowerCase']())&&_0x320b92[_0x378b('0x45')]!==_0x378b('0x46')){if(_0x320b92[_0x378b('0x40')]){_0x1bd9a1[_0x378b('0xd')]({'type':_0x320b92[_0x378b('0x5')][_0x378b('0x38')](),'app':_0x378b('0x18'),'appdata':_0x378b('0x47'),'context':_0x335026['context'],'exten':_0x335026['exten'],'priority':_0x320b92['intervals'][_0x378b('0x26')]+_0x18766b+_0x40e222++,'VoiceExtensionId':_0x335026['id']});_0x1bd9a1[_0x378b('0xd')]({'type':_0x320b92[_0x378b('0x5')][_0x378b('0x38')](),'app':'Set','appdata':_0x378b('0x48'),'context':_0x335026[_0x378b('0xb')],'exten':_0x335026[_0x378b('0x6')],'priority':_0x320b92[_0x378b('0x35')][_0x378b('0x26')]+_0x18766b+_0x40e222++,'VoiceExtensionId':_0x335026['id']});}else{_0x1bd9a1[_0x378b('0xd')]({'type':_0x320b92[_0x378b('0x5')][_0x378b('0x38')](),'app':_0x378b('0x18'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x335026[_0x378b('0xb')],'exten':_0x335026[_0x378b('0x6')],'priority':_0x320b92['intervals'][_0x378b('0x26')]+_0x18766b+_0x40e222++,'VoiceExtensionId':_0x335026['id']});_0x1bd9a1[_0x378b('0xd')]({'type':_0x320b92[_0x378b('0x5')][_0x378b('0x38')](),'app':_0x378b('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x335026[_0x378b('0xb')],'exten':_0x335026[_0x378b('0x6')],'priority':_0x320b92[_0x378b('0x35')][_0x378b('0x26')]+_0x18766b+_0x40e222++,'VoiceExtensionId':_0x335026['id']});}}}}for(var _0x5bc107=0x0;_0x5bc107<_0x320b92[_0x378b('0x35')]['length'];_0x5bc107++){var _0x47b33d=_0x18766b+_0x320b92[_0x378b('0x35')][_0x378b('0x26')];var _0x53b8de=_0x5bc107===_0x320b92[_0x378b('0x35')][_0x378b('0x26')]-0x1?_0x18766b+_0x1bd9a1[_0x378b('0x26')]+_0x36361c['length']+0x2:_0x18766b+_0x5bc107+0x1;_0x1bd9a1[_0x378b('0x49')](_0x5bc107,0x0,{'type':_0x335026[_0x378b('0x5')],'app':_0x378b('0x4a'),'appdata':_0x320b92[_0x378b('0x35')][_0x5bc107]+'?'+_0x335026[_0x378b('0xb')]+_0x378b('0x4b')+_0x47b33d+':'+_0x335026['context']+_0x378b('0x4b')+_0x53b8de,'exten':_0x335026[_0x378b('0x6')],'context':_0x335026[_0x378b('0xb')],'priority':_0x18766b+_0x5bc107,'VoiceExtensionId':_0x335026['id']});}if(_0x320b92[_0x378b('0x45')]===_0x378b('0x4c')){_0x320b92['appdata']=_0x319017(_0x335026,_0x320b92[_0x378b('0x4d')]);}if(_0x320b92['appType']===_0x378b('0x4e')){_0x1bd9a1[_0x378b('0xd')]({'type':_0x320b92['type']['toLowerCase'](),'app':'Set','appdata':_0x378b('0x4f'),'context':_0x335026['context'],'exten':_0x335026[_0x378b('0x6')],'priority':_0x320b92[_0x378b('0x35')][_0x378b('0x26')]+_0x18766b+_0x40e222++,'VoiceExtensionId':_0x335026['id']});}_0x320b92[_0x378b('0x50')]=_0x1bd9a1['length']?_[_0x378b('0x51')](_0x1bd9a1)[_0x378b('0x50')]+0x1:_0x18766b;_0x33a4ad=_[_0x378b('0x52')](_0x33a4ad,_0x1bd9a1,[_0x320b92],_0x36361c);_0x18766b=_[_0x378b('0x51')](_0x33a4ad)[_0x378b('0x50')]+0x1;}return _0x247477(_0x33a4ad);})[_0x378b('0x53')](function(_0x44442e){_0x5f4002(_0x44442e);});});}return _0x541740[_0x378b('0x54')]('VoiceExtension',attributes,{'tableName':_0x378b('0x55'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3e523a){var _0xfd41b6=this[_0x378b('0x56')]({'plain':!![]});var _0xb8a3ab=_0xfd41b6['type']===_0x378b('0x11')?_0x4b5c09(_0xfd41b6):_0x2d6733(_0xfd41b6);return _0x4c1ec6(_0xfd41b6,_0x3e523a,_[_0x378b('0x51')](_0xb8a3ab)[_0x378b('0x50')]+0x1)[_0x378b('0x57')](function(_0x4bf4f2){var _0x2a9f35=_[_0x378b('0x52')](_0xb8a3ab,_0x4bf4f2);_0x2a9f35['push']({'type':_0xfd41b6[_0x378b('0x5')],'app':_0x378b('0x58'),'exten':_0xfd41b6['exten'],'context':_0xfd41b6[_0x378b('0xb')],'priority':_[_0x378b('0x51')](_0x2a9f35)[_0x378b('0x50')]+0x1,'VoiceExtensionId':_0xfd41b6['id']});return _0x2a9f35;});}}});}; \ No newline at end of file +var _0x1b4d=['interval','IntervalId','then','*,*,*,*','intervals','filter','toLowerCase','tag','CDR(tag)=','ExecIf','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','last','priority','VoiceExtension','voice_extensions','get','Hangup','lodash','exports','models','type','context','exten','Set','NoOp','alias','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','split','length','name','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x1b4d,0x123));var _0xd1b4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x1b4d[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0xd1b4('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xd1b4('0x1')]=function(_0x5749c8){var _0x2e3a12=_0x5749c8[_0xd1b4('0x2')];function _0x6c62d0(_0xd5965){var _0x3b1162=0x2;var _0x2d0ea6=[{'type':_0xd5965[_0xd1b4('0x3')],'app':'Set','appdata':'CDR(type)='+_0xd5965[_0xd1b4('0x3')],'context':_0xd5965[_0xd1b4('0x4')],'exten':_0xd5965[_0xd1b4('0x5')],'priority':_0x3b1162++,'VoiceExtensionId':_0xd5965['id']},{'type':_0xd5965[_0xd1b4('0x3')],'app':_0xd5965['alias']?_0xd1b4('0x6'):_0xd1b4('0x7'),'appdata':_0xd5965[_0xd1b4('0x8')]?'CDR(routeAlias)='+_0xd5965[_0xd1b4('0x8')]:_0xd1b4('0x9'),'context':_0xd5965[_0xd1b4('0x4')],'exten':_0xd5965['exten'],'priority':_0x3b1162++,'VoiceExtensionId':_0xd5965['id']}];if(_0xd5965[_0xd1b4('0x3')]===_0xd1b4('0xa')){_0x2d0ea6[_0xd1b4('0xb')]({'type':_0xd1b4('0xa'),'app':_0xd1b4('0x6'),'appdata':_0xd1b4('0xc')+_0xd5965['id'],'context':_0xd5965[_0xd1b4('0x4')],'exten':_0xd5965['exten'],'priority':_0x3b1162++,'VoiceExtensionId':_0xd5965['id']});}_0x2d0ea6['push']({'type':_0xd5965[_0xd1b4('0x3')],'app':_0xd1b4('0x6'),'appdata':_0xd1b4('0xd'),'context':_0xd5965[_0xd1b4('0x4')],'exten':_0xd5965[_0xd1b4('0x5')],'priority':_0x3b1162++,'VoiceExtensionId':_0xd5965['id']},{'type':_0xd5965[_0xd1b4('0x3')],'app':_0xd1b4('0x6'),'appdata':_0xd1b4('0xe'),'context':_0xd5965[_0xd1b4('0x4')],'exten':_0xd5965[_0xd1b4('0x5')],'priority':_0x3b1162++,'VoiceExtensionId':_0xd5965['id']},{'type':_0xd5965[_0xd1b4('0x3')],'app':_0xd1b4('0x6'),'appdata':'MONITOR_OPTIONS=ab','context':_0xd5965['context'],'exten':_0xd5965['exten'],'priority':_0x3b1162++,'VoiceExtensionId':_0xd5965['id']});return _0x2d0ea6;}function _0x42b23b(_0x10e1cf){var _0x3ce42a=0x2;var _0x42a169=[{'type':_0xd1b4('0xf'),'app':_0xd1b4('0x6'),'appdata':_0xd1b4('0x10'),'context':_0x10e1cf[_0xd1b4('0x4')],'exten':_0x10e1cf[_0xd1b4('0x5')],'priority':_0x3ce42a++,'VoiceExtensionId':_0x10e1cf['id']},{'type':_0xd1b4('0xf'),'app':_0x10e1cf[_0xd1b4('0x8')]?_0xd1b4('0x6'):_0xd1b4('0x7'),'appdata':_0x10e1cf[_0xd1b4('0x8')]?_0xd1b4('0x11')+_0x10e1cf[_0xd1b4('0x8')]:_0xd1b4('0x9'),'context':_0x10e1cf[_0xd1b4('0x4')],'exten':_0x10e1cf['exten'],'priority':_0x3ce42a++,'VoiceExtensionId':_0x10e1cf['id']},{'type':_0xd1b4('0xf'),'app':_0xd1b4('0x6'),'appdata':_0xd1b4('0x12')+(_0x10e1cf[_0xd1b4('0x13')]?_0xd1b4('0x14')+_0x10e1cf[_0xd1b4('0x13')]+'}':_0xd1b4('0x15')),'context':_0x10e1cf[_0xd1b4('0x4')],'exten':_0x10e1cf['exten'],'priority':_0x3ce42a++,'VoiceExtensionId':_0x10e1cf['id']},{'type':_0xd1b4('0xf'),'app':'Set','appdata':_0xd1b4('0xc')+_0x10e1cf['id'],'context':_0x10e1cf['context'],'exten':_0x10e1cf[_0xd1b4('0x5')],'priority':_0x3ce42a++,'VoiceExtensionId':_0x10e1cf['id']},{'type':_0xd1b4('0xf'),'app':'ExecIf','appdata':_0xd1b4('0x16')+(_0x3ce42a+0x2)+_0xd1b4('0x17')+(_0x3ce42a+0x1)+')','context':_0x10e1cf[_0xd1b4('0x4')],'exten':_0x10e1cf[_0xd1b4('0x5')],'priority':_0x3ce42a++,'VoiceExtensionId':_0x10e1cf['id']},{'type':'outbound','app':_0xd1b4('0x6'),'appdata':_0x10e1cf[_0xd1b4('0x13')]?_0xd1b4('0x18')+_0x10e1cf['cutdigits']+'}':_0xd1b4('0x19'),'context':_0x10e1cf['context'],'exten':_0x10e1cf['exten'],'priority':_0x3ce42a++,'VoiceExtensionId':_0x10e1cf['id']},{'type':_0xd1b4('0xf'),'app':_0xd1b4('0x6'),'appdata':_0xd1b4('0xd'),'context':_0x10e1cf['context'],'exten':_0x10e1cf[_0xd1b4('0x5')],'priority':_0x3ce42a++,'VoiceExtensionId':_0x10e1cf['id']},{'type':'outbound','app':'Set','appdata':_0xd1b4('0xe'),'context':_0x10e1cf[_0xd1b4('0x4')],'exten':_0x10e1cf[_0xd1b4('0x5')],'priority':_0x3ce42a++,'VoiceExtensionId':_0x10e1cf['id']},{'type':_0xd1b4('0xf'),'app':_0xd1b4('0x6'),'appdata':'MONITOR_OPTIONS=ab','context':_0x10e1cf[_0xd1b4('0x4')],'exten':_0x10e1cf[_0xd1b4('0x5')],'priority':_0x3ce42a++,'VoiceExtensionId':_0x10e1cf['id']},{'type':_0xd1b4('0xf'),'app':'Set','appdata':_0xd1b4('0x1a')+_0x10e1cf['id'],'context':_0x10e1cf['context'],'exten':_0x10e1cf[_0xd1b4('0x5')],'priority':_0x3ce42a++,'VoiceExtensionId':_0x10e1cf['id']}];if(_0x10e1cf[_0xd1b4('0x1b')](_0xd1b4('0x1c'))&&_0x10e1cf[_0xd1b4('0x1c')]!==_0xd1b4('0x1d')){_0x42a169['push']({'type':'outbound','app':_0xd1b4('0x6'),'appdata':_0xd1b4('0x1e'),'context':_0x10e1cf[_0xd1b4('0x4')],'exten':_0x10e1cf[_0xd1b4('0x5')],'priority':_0x3ce42a++,'VoiceExtensionId':_0x10e1cf['id']},{'type':_0xd1b4('0xf'),'app':_0xd1b4('0x6'),'appdata':_0xd1b4('0x1f')+_0x10e1cf[_0xd1b4('0x1c')]||'wav','context':_0x10e1cf[_0xd1b4('0x4')],'exten':_0x10e1cf[_0xd1b4('0x5')],'priority':_0x3ce42a++,'VoiceExtensionId':_0x10e1cf['id']});}return _0x42a169;}function _0x369932(_0x17917b,_0x306039){var _0x578370=[{'name':_0xd1b4('0x20'),'param':0x0},{'name':_0xd1b4('0x21'),'param':0x1},{'name':_0xd1b4('0x22'),'param':0x2},{'name':'url','param':0x3}];var _0x334a5d={};var _0xf40db1=_0x306039[_0xd1b4('0x23')](',');var _0x46d993=[];for(var _0x1ae889=0x0;_0x1ae889<_0x578370[_0xd1b4('0x24')];_0x1ae889++){switch(_0x578370[_0x1ae889][_0xd1b4('0x25')]){case'trunk':_0x334a5d[_0xd1b4('0x20')]=_0xf40db1[_0x578370[_0x1ae889][_0xd1b4('0x26')]]['split']('/')[0x1];_0x334a5d['phone']=_0xf40db1[_0x578370[_0x1ae889]['param']][_0xd1b4('0x23')]('/')[0x2];_0x334a5d['prefix']=_0x334a5d['phone']?_0x334a5d[_0xd1b4('0x27')][_0xd1b4('0x23')]('$')[0x0]:undefined;_0x334a5d['phone']=_0x17917b[_0xd1b4('0x13')]?(_0x334a5d[_0xd1b4('0x28')]||'')+'${EXTEN:'+_0x17917b[_0xd1b4('0x13')]+'}':(_0x334a5d['prefix']||'')+'${EXTEN}';_0x46d993[_0x578370[_0x1ae889]['param']]=[_0xd1b4('0x29'),_0x334a5d[_0xd1b4('0x20')],_0x334a5d[_0xd1b4('0x27')]][_0xd1b4('0x2a')]('/');break;case _0xd1b4('0x22'):_0x334a5d[_0xd1b4('0x22')]=_0xf40db1[_0x578370[_0x1ae889][_0xd1b4('0x26')]];if(_0x17917b[_0xd1b4('0x1c')]!==_0xd1b4('0x1d')){if(_0x334a5d[_0xd1b4('0x22')][_0xd1b4('0x2b')](_0xd1b4('0x2c'))<0x0){_0x334a5d[_0xd1b4('0x22')]+=_0xd1b4('0x2c');}}else{_0x334a5d[_0xd1b4('0x22')]=_0x334a5d[_0xd1b4('0x22')][_0xd1b4('0x2d')]('U(xcally-mixmonitor-context)','');}_0x46d993[_0x578370[_0x1ae889][_0xd1b4('0x26')]]=_0x334a5d[_0xd1b4('0x22')];break;default:_0x46d993[_0x578370[_0x1ae889][_0xd1b4('0x26')]]=_0xf40db1[_0x578370[_0x1ae889][_0xd1b4('0x26')]];}}return _0x46d993['join'](',');}function _0x57fbee(_0x1d2913,_0x50f868,_0x2ad261){return new Promise(function(_0x366858,_0x144112){var _0x139fc7=[];if(_[_0xd1b4('0x2e')](_0x50f868))return _0x366858(_0x139fc7);_0x2e3a12[_0xd1b4('0x2f')][_0xd1b4('0x30')]({'attributes':['id',_0xd1b4('0x31'),_0xd1b4('0x32')],'raw':!![]})[_0xd1b4('0x33')](function(_0x217053){for(var _0x57a4c5=0x0,_0x742ffb=0x0;_0x57a4c5<_0x50f868[_0xd1b4('0x24')];_0x57a4c5++,_0x742ffb=0x0){var _0x24f899=_0x50f868[_0x57a4c5];var _0x1e02b6=[];var _0x32be33=[];delete _0x24f899['id'];if(_0x24f899['interval']!==_0xd1b4('0x34')){_0x24f899[_0xd1b4('0x35')]=[_0x24f899['interval']];}else{_0x24f899[_0xd1b4('0x35')]=_0x24f899['IntervalId']?_['map'](_[_0xd1b4('0x36')](_0x217053,{'IntervalId':_0x24f899['IntervalId']}),_0xd1b4('0x31')):[];}_0x24f899['context']=_0x1d2913['context'];_0x24f899[_0xd1b4('0x5')]=_0x1d2913[_0xd1b4('0x5')];if(_0x24f899[_0xd1b4('0x3')])_0x24f899[_0xd1b4('0x3')]=_0x24f899['type'][_0xd1b4('0x37')]();if(_0x1d2913[_0xd1b4('0x3')]==='outbound'){if(_0x24f899[_0xd1b4('0x1b')]('tag')&&_0x24f899[_0xd1b4('0x38')]&&_0x24f899[_0xd1b4('0x38')]!=='--'){_0x1e02b6[_0xd1b4('0xb')]({'type':_0x24f899[_0xd1b4('0x3')][_0xd1b4('0x37')](),'app':_0xd1b4('0x6'),'appdata':_0xd1b4('0x39')+_0x24f899[_0xd1b4('0x38')],'context':_0x1d2913[_0xd1b4('0x4')],'exten':_0x1d2913[_0xd1b4('0x5')],'priority':_0x24f899['intervals'][_0xd1b4('0x24')]+_0x2ad261+_0x742ffb++,'VoiceExtensionId':_0x1d2913['id']});}_0x1e02b6[_0xd1b4('0xb')]({'type':_0x24f899['type'][_0xd1b4('0x37')](),'app':_0xd1b4('0x3a'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x24f899[_0xd1b4('0x3b')]?_0xd1b4('0x3c')+_0x24f899[_0xd1b4('0x3b')]+')':_0xd1b4('0x3d')),'context':_0x1d2913[_0xd1b4('0x4')],'exten':_0x1d2913['exten'],'priority':_0x24f899[_0xd1b4('0x35')][_0xd1b4('0x24')]+_0x2ad261+_0x742ffb++,'VoiceExtensionId':_0x1d2913['id']});}else{if(_0x24f899[_0xd1b4('0x1b')](_0xd1b4('0x3e'))){if([_0xd1b4('0x3f'),'playback'][_0xd1b4('0x40')](_0x24f899[_0xd1b4('0x41')][_0xd1b4('0x37')]())&&_0x24f899[_0xd1b4('0x42')]!==_0xd1b4('0x43')){if(_0x24f899['answer']){_0x1e02b6['push']({'type':_0x24f899[_0xd1b4('0x3')][_0xd1b4('0x37')](),'app':_0xd1b4('0x3a'),'appdata':_0xd1b4('0x44'),'context':_0x1d2913['context'],'exten':_0x1d2913[_0xd1b4('0x5')],'priority':_0x24f899[_0xd1b4('0x35')][_0xd1b4('0x24')]+_0x2ad261+_0x742ffb++,'VoiceExtensionId':_0x1d2913['id']});_0x1e02b6[_0xd1b4('0xb')]({'type':_0x24f899[_0xd1b4('0x3')][_0xd1b4('0x37')](),'app':'Set','appdata':_0xd1b4('0x45'),'context':_0x1d2913['context'],'exten':_0x1d2913[_0xd1b4('0x5')],'priority':_0x24f899[_0xd1b4('0x35')]['length']+_0x2ad261+_0x742ffb++,'VoiceExtensionId':_0x1d2913['id']});}else{_0x1e02b6[_0xd1b4('0xb')]({'type':_0x24f899[_0xd1b4('0x3')]['toLowerCase'](),'app':_0xd1b4('0x3a'),'appdata':_0xd1b4('0x46'),'context':_0x1d2913[_0xd1b4('0x4')],'exten':_0x1d2913[_0xd1b4('0x5')],'priority':_0x24f899['intervals'][_0xd1b4('0x24')]+_0x2ad261+_0x742ffb++,'VoiceExtensionId':_0x1d2913['id']});_0x1e02b6[_0xd1b4('0xb')]({'type':_0x24f899['type']['toLowerCase'](),'app':'Set','appdata':_0xd1b4('0x47'),'context':_0x1d2913[_0xd1b4('0x4')],'exten':_0x1d2913['exten'],'priority':_0x24f899['intervals'][_0xd1b4('0x24')]+_0x2ad261+_0x742ffb++,'VoiceExtensionId':_0x1d2913['id']});}}}}for(var _0x1c5383=0x0;_0x1c5383<_0x24f899[_0xd1b4('0x35')][_0xd1b4('0x24')];_0x1c5383++){var _0x5ca996=_0x2ad261+_0x24f899['intervals'][_0xd1b4('0x24')];var _0x231a67=_0x1c5383===_0x24f899[_0xd1b4('0x35')][_0xd1b4('0x24')]-0x1?_0x2ad261+_0x1e02b6[_0xd1b4('0x24')]+_0x32be33['length']+0x2:_0x2ad261+_0x1c5383+0x1;_0x1e02b6[_0xd1b4('0x48')](_0x1c5383,0x0,{'type':_0x1d2913[_0xd1b4('0x3')],'app':_0xd1b4('0x49'),'appdata':_0x24f899[_0xd1b4('0x35')][_0x1c5383]+'?'+_0x1d2913[_0xd1b4('0x4')]+_0xd1b4('0x4a')+_0x5ca996+':'+_0x1d2913[_0xd1b4('0x4')]+_0xd1b4('0x4a')+_0x231a67,'exten':_0x1d2913['exten'],'context':_0x1d2913[_0xd1b4('0x4')],'priority':_0x2ad261+_0x1c5383,'VoiceExtensionId':_0x1d2913['id']});}if(_0x24f899[_0xd1b4('0x42')]===_0xd1b4('0x4b')){_0x24f899[_0xd1b4('0x4c')]=_0x369932(_0x1d2913,_0x24f899['appdata']);}if(_0x24f899['appType']===_0xd1b4('0x4d')){_0x1e02b6[_0xd1b4('0xb')]({'type':_0x24f899[_0xd1b4('0x3')][_0xd1b4('0x37')](),'app':_0xd1b4('0x6'),'appdata':_0xd1b4('0x4e'),'context':_0x1d2913['context'],'exten':_0x1d2913[_0xd1b4('0x5')],'priority':_0x24f899[_0xd1b4('0x35')][_0xd1b4('0x24')]+_0x2ad261+_0x742ffb++,'VoiceExtensionId':_0x1d2913['id']});}_0x24f899['priority']=_0x1e02b6[_0xd1b4('0x24')]?_['last'](_0x1e02b6)['priority']+0x1:_0x2ad261;_0x139fc7=_['concat'](_0x139fc7,_0x1e02b6,[_0x24f899],_0x32be33);_0x2ad261=_[_0xd1b4('0x4f')](_0x139fc7)[_0xd1b4('0x50')]+0x1;}return _0x366858(_0x139fc7);})['catch'](function(_0x397278){_0x144112(_0x397278);});});}return _0x5749c8['define'](_0xd1b4('0x51'),attributes,{'tableName':_0xd1b4('0x52'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x195abb){var _0x371c26=this[_0xd1b4('0x53')]({'plain':!![]});var _0x44ee30=_0x371c26['type']==='outbound'?_0x42b23b(_0x371c26):_0x6c62d0(_0x371c26);return _0x57fbee(_0x371c26,_0x195abb,_[_0xd1b4('0x4f')](_0x44ee30)['priority']+0x1)['then'](function(_0xface2d){var _0x583a1d=_['concat'](_0x44ee30,_0xface2d);_0x583a1d[_0xd1b4('0xb')]({'type':_0x371c26[_0xd1b4('0x3')],'app':_0xd1b4('0x54'),'exten':_0x371c26[_0xd1b4('0x5')],'context':_0x371c26[_0xd1b4('0x4')],'priority':_[_0xd1b4('0x4f')](_0x583a1d)['priority']+0x1,'VoiceExtensionId':_0x371c26['id']});return _0x583a1d;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 14ac040..7adddcd 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 _0xcddd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./voiceExtension.socket','request','then','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceExtension,\x20%s,\x20%s','request\x20sent','result','VoiceExtension','findAll','options','raw','where','attributes','include','map','model','GetVoiceExtension','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcddd,0x1a1));var _0xdcdd=function(_0x3ae21e,_0x351db0){_0x3ae21e=_0x3ae21e-0x0;var _0x4abdcc=_0xcddd[_0x3ae21e];return _0x4abdcc;};'use strict';var _=require(_0xdcdd('0x0'));var util=require(_0xdcdd('0x1'));var moment=require(_0xdcdd('0x2'));var BPromise=require(_0xdcdd('0x3'));var rs=require(_0xdcdd('0x4'));var fs=require('fs');var Redis=require(_0xdcdd('0x5'));var db=require(_0xdcdd('0x6'))['db'];var utils=require(_0xdcdd('0x7'));var logger=require(_0xdcdd('0x8'))(_0xdcdd('0x9'));var config=require(_0xdcdd('0xa'));var jayson=require(_0xdcdd('0xb'));var client=jayson['client'][_0xdcdd('0xc')]({'port':0x232a});config[_0xdcdd('0xd')]=_['defaults'](config[_0xdcdd('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xdcdd('0xe'))(new Redis(config[_0xdcdd('0xd')]));require(_0xdcdd('0xf'))['register'](socket);function respondWithRpcPromise(_0x2c4357,_0x5b4041,_0x257e7f){return new BPromise(function(_0x429bb5,_0x4a203b){return client[_0xdcdd('0x10')](_0x2c4357,_0x257e7f)[_0xdcdd('0x11')](function(_0x144783){logger[_0xdcdd('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x5b4041,'request\x20sent');logger[_0xdcdd('0x13')](_0xdcdd('0x14'),_0x5b4041,'request\x20sent',JSON[_0xdcdd('0x15')](_0x144783));if(_0x144783[_0xdcdd('0x16')]){if(_0x144783[_0xdcdd('0x16')][_0xdcdd('0x17')]===0x1f4){logger[_0xdcdd('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x5b4041,_0x144783[_0xdcdd('0x16')][_0xdcdd('0x18')]);return _0x4a203b(_0x144783['error'][_0xdcdd('0x18')]);}logger[_0xdcdd('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x5b4041,_0x144783['error'][_0xdcdd('0x18')]);return _0x429bb5(_0x144783['error'][_0xdcdd('0x18')]);}else{logger[_0xdcdd('0x12')](_0xdcdd('0x19'),_0x5b4041,_0xdcdd('0x1a'));_0x429bb5(_0x144783[_0xdcdd('0x1b')][_0xdcdd('0x18')]);}})['catch'](function(_0x3d4932){logger['error'](_0xdcdd('0x19'),_0x5b4041,_0x3d4932);_0x4a203b(_0x3d4932);});});}exports['GetVoiceExtension']=function(_0x569046){var _0x41ca09=this;return new Promise(function(_0xddaa45,_0x28a477){return db[_0xdcdd('0x1c')][_0xdcdd('0x1d')]({'raw':_0x569046[_0xdcdd('0x1e')]?_0x569046[_0xdcdd('0x1e')][_0xdcdd('0x1f')]===undefined?!![]:![]:!![],'where':_0x569046[_0xdcdd('0x1e')]?_0x569046['options'][_0xdcdd('0x20')]||null:null,'attributes':_0x569046[_0xdcdd('0x1e')]?_0x569046[_0xdcdd('0x1e')][_0xdcdd('0x21')]||null:null,'limit':_0x569046[_0xdcdd('0x1e')]?_0x569046[_0xdcdd('0x1e')]['limit']||null:null,'include':_0x569046[_0xdcdd('0x1e')]?_0x569046[_0xdcdd('0x1e')][_0xdcdd('0x22')]?_[_0xdcdd('0x23')](_0x569046[_0xdcdd('0x1e')][_0xdcdd('0x22')],function(_0x43ca67){return{'model':db[_0x43ca67[_0xdcdd('0x24')]],'as':_0x43ca67['as'],'attributes':_0x43ca67[_0xdcdd('0x21')],'include':_0x43ca67[_0xdcdd('0x22')]?_[_0xdcdd('0x23')](_0x43ca67[_0xdcdd('0x22')],function(_0x3b1b4a){return{'model':db[_0x3b1b4a[_0xdcdd('0x24')]],'as':_0x3b1b4a['as'],'attributes':_0x3b1b4a['attributes'],'include':_0x3b1b4a['include']?_['map'](_0x3b1b4a[_0xdcdd('0x22')],function(_0x24cb6c){return{'model':db[_0x24cb6c['model']],'as':_0x24cb6c['as'],'attributes':_0x24cb6c[_0xdcdd('0x21')]};}):[]};}):[]};}):[]:[]})[_0xdcdd('0x11')](function(_0x5154c0){logger['info']('GetVoiceExtension',_0x569046);logger[_0xdcdd('0x13')](_0xdcdd('0x25'),_0x569046,JSON['stringify'](_0x5154c0));_0xddaa45(_0x5154c0);})['catch'](function(_0x3b2e92){logger[_0xdcdd('0x16')](_0xdcdd('0x25'),_0x3b2e92['message'],_0x569046);_0x28a477(_0x41ca09[_0xdcdd('0x16')](0x1f4,_0x3b2e92[_0xdcdd('0x18')]));});});}; \ No newline at end of file +var _0x326f=['stringify','error','code','message','request\x20sent','result','catch','VoiceExtension','options','raw','where','attributes','limit','include','model','map','then','info','GetVoiceExtension','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s'];(function(_0x256b0f,_0x28b7d6){var _0xc575af=function(_0x285fc6){while(--_0x285fc6){_0x256b0f['push'](_0x256b0f['shift']());}};_0xc575af(++_0x28b7d6);}(_0x326f,0xd1));var _0xf326=function(_0x25171f,_0x279f88){_0x25171f=_0x25171f-0x0;var _0x15335c=_0x326f[_0x25171f];return _0x15335c;};'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});config[_0xf326('0xb')]=_[_0xf326('0xc')](config[_0xf326('0xb')],{'host':_0xf326('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceExtension.socket')[_0xf326('0xe')](socket);function respondWithRpcPromise(_0x1fc80e,_0x163416,_0x2686e1){return new BPromise(function(_0x1f3a33,_0x5db9d7){return client[_0xf326('0xf')](_0x1fc80e,_0x2686e1)['then'](function(_0x1cf441){logger['info'](_0xf326('0x10'),_0x163416,'request\x20sent');logger[_0xf326('0x11')](_0xf326('0x12'),_0x163416,'request\x20sent',JSON[_0xf326('0x13')](_0x1cf441));if(_0x1cf441[_0xf326('0x14')]){if(_0x1cf441[_0xf326('0x14')][_0xf326('0x15')]===0x1f4){logger['error'](_0xf326('0x10'),_0x163416,_0x1cf441['error']['message']);return _0x5db9d7(_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);}logger[_0xf326('0x14')](_0xf326('0x10'),_0x163416,_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);return _0x1f3a33(_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);}else{logger['info'](_0xf326('0x10'),_0x163416,_0xf326('0x17'));_0x1f3a33(_0x1cf441[_0xf326('0x18')][_0xf326('0x16')]);}})[_0xf326('0x19')](function(_0x311af0){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x163416,_0x311af0);_0x5db9d7(_0x311af0);});});}exports['GetVoiceExtension']=function(_0x16e605){var _0x289f4b=this;return new Promise(function(_0x484cbe,_0x4cabce){return db[_0xf326('0x1a')]['findAll']({'raw':_0x16e605['options']?_0x16e605[_0xf326('0x1b')][_0xf326('0x1c')]===undefined?!![]:![]:!![],'where':_0x16e605['options']?_0x16e605['options'][_0xf326('0x1d')]||null:null,'attributes':_0x16e605[_0xf326('0x1b')]?_0x16e605['options'][_0xf326('0x1e')]||null:null,'limit':_0x16e605[_0xf326('0x1b')]?_0x16e605[_0xf326('0x1b')][_0xf326('0x1f')]||null:null,'include':_0x16e605[_0xf326('0x1b')]?_0x16e605[_0xf326('0x1b')]['include']?_['map'](_0x16e605['options'][_0xf326('0x20')],function(_0x1a2c4e){return{'model':db[_0x1a2c4e[_0xf326('0x21')]],'as':_0x1a2c4e['as'],'attributes':_0x1a2c4e[_0xf326('0x1e')],'include':_0x1a2c4e[_0xf326('0x20')]?_[_0xf326('0x22')](_0x1a2c4e['include'],function(_0x201d28){return{'model':db[_0x201d28[_0xf326('0x21')]],'as':_0x201d28['as'],'attributes':_0x201d28[_0xf326('0x1e')],'include':_0x201d28['include']?_[_0xf326('0x22')](_0x201d28['include'],function(_0x4a9abf){return{'model':db[_0x4a9abf[_0xf326('0x21')]],'as':_0x4a9abf['as'],'attributes':_0x4a9abf[_0xf326('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf326('0x23')](function(_0x5dbe63){logger[_0xf326('0x24')](_0xf326('0x25'),_0x16e605);logger['debug'](_0xf326('0x25'),_0x16e605,JSON[_0xf326('0x13')](_0x5dbe63));_0x484cbe(_0x5dbe63);})[_0xf326('0x19')](function(_0x18d110){logger[_0xf326('0x14')](_0xf326('0x25'),_0x18d110[_0xf326('0x16')],_0x16e605);_0x4cabce(_0x289f4b[_0xf326('0x14')](0x1f4,_0x18d110[_0xf326('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 1af1779..d571016 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 _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x4edff2,_0x3bedaf){var _0x39b99e=function(_0x55163b){while(--_0x55163b){_0x4edff2['push'](_0x4edff2['shift']());}};_0x39b99e(++_0x3bedaf);}(_0x5fc3,0xa8));var _0x35fc=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0x5fc3[_0x10291b];return _0x1d5fbe;};'use strict';var VoiceExtensionEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){VoiceExtensionEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);VoiceExtensionEvents['on'](_0x16e153,_0x27524f);}}; \ No newline at end of file +var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x5895b7,_0x24fd9d){var _0x108037=function(_0x3a8886){while(--_0x3a8886){_0x5895b7['push'](_0x5895b7['shift']());}};_0x108037(++_0x24fd9d);}(_0xe14b,0x93));var _0xbe14=function(_0x30c18a,_0x6516d8){_0x30c18a=_0x30c18a-0x0;var _0x354e07=_0xe14b[_0x30c18a];return _0x354e07;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 297f556..0056b1b 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 _0x2675=['post','create','update','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show'];(function(_0x24e166,_0x2bdae9){var _0x394500=function(_0x298049){while(--_0x298049){_0x24e166['push'](_0x24e166['shift']());}};_0x394500(++_0x2bdae9);}(_0x2675,0x75));var _0x5267=function(_0x4ba130,_0x55d0ad){_0x4ba130=_0x4ba130-0x0;var _0x1c5bbf=_0x2675[_0x4ba130];return _0x1c5bbf;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5267('0x3'));var interaction=require(_0x5267('0x4'));var config=require('../../config/environment');var controller=require(_0x5267('0x5'));router[_0x5267('0x6')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0x8')]);router[_0x5267('0x6')](_0x5267('0x9'),auth['isAuthenticated'](),controller[_0x5267('0xa')]);router[_0x5267('0x6')]('/:id/messages',auth[_0x5267('0x7')](),controller['getMessages']);router[_0x5267('0xb')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0xc')]);router['put'](_0x5267('0x9'),auth['isAuthenticated'](),controller[_0x5267('0xd')]);router['delete'](_0x5267('0x9'),auth[_0x5267('0x7')](),controller[_0x5267('0xe')]);module[_0x5267('0xf')]=router; \ No newline at end of file +var _0x524e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','show','/:id/messages','isAuthenticated','getMessages','post','create','put','update','delete','destroy','path','connect-timeout'];(function(_0xb70d21,_0x2589a5){var _0x3b929e=function(_0x550848){while(--_0x550848){_0xb70d21['push'](_0xb70d21['shift']());}};_0x3b929e(++_0x2589a5);}(_0x524e,0x15e));var _0xe524=function(_0x178df5,_0x1b47c9){_0x178df5=_0x178df5-0x0;var _0x85853a=_0x524e[_0x178df5];return _0x85853a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x10')]('/',auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x12')](_0xe524('0xb'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x14')](_0xe524('0xb'),auth[_0xe524('0xe')](),controller[_0xe524('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index a53b187..9fc25e5 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 _0xb2c1=['INTEGER','VIRTUAL','getDataValue','fullname','sequelize','STRING','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP'];(function(_0x2116f0,_0xb34f81){var _0x2b1509=function(_0x4578a9){while(--_0x4578a9){_0x2116f0['push'](_0x2116f0['shift']());}};_0x2b1509(++_0xb34f81);}(_0xb2c1,0x194));var _0x1b2c=function(_0x5c48ea,_0x2191a2){_0x5c48ea=_0x5c48ea-0x0;var _0x1262dc=_0xb2c1[_0x5c48ea];return _0x1262dc;};'use strict';var Sequelize=require(_0x1b2c('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x1b2c('0x1')]},'context':{'type':Sequelize[_0x1b2c('0x1')],'defaultValue':'from-voicemail','unique':_0x1b2c('0x2')},'mailbox':{'type':Sequelize[_0x1b2c('0x1')],'defaultValue':'','allowNull':![],'unique':_0x1b2c('0x2')},'password':{'type':Sequelize[_0x1b2c('0x1')]},'fullname':{'type':Sequelize[_0x1b2c('0x1')]},'email':{'type':Sequelize[_0x1b2c('0x1')],'validate':{'isEmail':!![]},'set':function(_0x13936d){this[_0x1b2c('0x3')](_0x1b2c('0x4'),typeof _0x13936d===_0x1b2c('0x5')&&_0x13936d[_0x1b2c('0x6')]()?_0x13936d[_0x1b2c('0x6')]():null);}},'pager':{'type':Sequelize[_0x1b2c('0x1')]},'tz':{'type':Sequelize[_0x1b2c('0x1')],'defaultValue':_0x1b2c('0x7')},'attach':{'type':Sequelize[_0x1b2c('0x8')](_0x1b2c('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x1b2c('0x8')](_0x1b2c('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x1b2c('0x1')]},'callback':{'type':Sequelize[_0x1b2c('0x1')]},'review':{'type':Sequelize[_0x1b2c('0x8')](_0x1b2c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x1b2c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x1b2c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x1b2c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1b2c('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x1b2c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1b2c('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1b2c('0x8')](_0x1b2c('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x1b2c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x1b2c('0x8')](_0x1b2c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x1b2c('0x9'),'no'),'defaultValue':_0x1b2c('0x9'),'allowNull':![]},'stamp':{'type':_0x1b2c('0xb')},'emailsubject':{'type':Sequelize[_0x1b2c('0x1')]},'emailbody':{'type':Sequelize[_0x1b2c('0x1')]},'maxsecs':{'type':Sequelize[_0x1b2c('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1b2c('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x1b2c('0xd')],'get':function(){return this[_0x1b2c('0xe')](_0x1b2c('0xf'))+'\x20-\x20'+this[_0x1b2c('0xe')]('mailbox');}}}; \ No newline at end of file +var _0x8061=['VIRTUAL','getDataValue','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x4372b3,_0x2cfe97){var _0x37fc4c=function(_0x29691b){while(--_0x29691b){_0x4372b3['push'](_0x4372b3['shift']());}};_0x37fc4c(++_0x2cfe97);}(_0x8061,0x89));var _0x1806=function(_0x5d136e,_0x31649a){_0x5d136e=_0x5d136e-0x0;var _0x3884de=_0x8061[_0x5d136e];return _0x3884de;};'use strict';var Sequelize=require(_0x1806('0x0'));module[_0x1806('0x1')]={'customer_id':{'type':Sequelize[_0x1806('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x1806('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x1806('0x2')],'defaultValue':'','allowNull':![],'unique':_0x1806('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x1806('0x2')]},'email':{'type':Sequelize[_0x1806('0x2')],'validate':{'isEmail':!![]},'set':function(_0x4d41ca){this[_0x1806('0x5')](_0x1806('0x6'),typeof _0x4d41ca===_0x1806('0x7')&&_0x4d41ca[_0x1806('0x8')]()?_0x4d41ca[_0x1806('0x8')]():null);}},'pager':{'type':Sequelize[_0x1806('0x2')]},'tz':{'type':Sequelize[_0x1806('0x2')],'defaultValue':_0x1806('0x9')},'attach':{'type':Sequelize[_0x1806('0xa')](_0x1806('0xb'),'no'),'defaultValue':_0x1806('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x1806('0xa')](_0x1806('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x1806('0x2')]},'callback':{'type':Sequelize[_0x1806('0x2')]},'review':{'type':Sequelize[_0x1806('0xa')](_0x1806('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x1806('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x1806('0xa')](_0x1806('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x1806('0xa')](_0x1806('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1806('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x1806('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1806('0xa')](_0x1806('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1806('0xa')](_0x1806('0xb'),'no'),'defaultValue':_0x1806('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0x1806('0xa')](_0x1806('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x1806('0xa')](_0x1806('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x1806('0xb'),'no'),'defaultValue':_0x1806('0xb'),'allowNull':![]},'stamp':{'type':_0x1806('0xd')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x1806('0x2')]},'maxsecs':{'type':Sequelize[_0x1806('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1806('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x1806('0xf')],'get':function(){return this[_0x1806('0x10')]('fullname')+_0x1806('0x11')+this[_0x1806('0x10')](_0x1806('0x12'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index aaf9476..98c066d 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 _0xc900=['body','params','findOne','VoiceMailMessage','findAndCountAll','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','Voicemails','UserProfileResource','error','name','send','index','map','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','VoiceMail','includeAll','include','findAll','catch','show','rawAttributes','keys','find','user','get','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xc900,0xb3));var _0x0c90=function(_0x5162dc,_0x53a606){_0x5162dc=_0x5162dc-0x0;var _0x53b545=_0xc900[_0x5162dc];return _0x53b545;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0c90('0x0'));var jsonpatch=require(_0x0c90('0x1'));var rp=require(_0x0c90('0x2'));var moment=require('moment');var BPromise=require(_0x0c90('0x3'));var Mustache=require(_0x0c90('0x4'));var util=require('util');var path=require(_0x0c90('0x5'));var sox=require(_0x0c90('0x6'));var csv=require(_0x0c90('0x7'));var ejs=require(_0x0c90('0x8'));var fs=require('fs');var fs_extra=require(_0x0c90('0x9'));var _=require(_0x0c90('0xa'));var squel=require('squel');var crypto=require(_0x0c90('0xb'));var jsforce=require(_0x0c90('0xc'));var deskjs=require(_0x0c90('0xd'));var toCsv=require(_0x0c90('0x7'));var querystring=require(_0x0c90('0xe'));var Papa=require(_0x0c90('0xf'));var Redis=require(_0x0c90('0x10'));var authService=require(_0x0c90('0x11'));var qs=require(_0x0c90('0x12'));var as=require(_0x0c90('0x13'));var hardwareService=require(_0x0c90('0x14'));var logger=require(_0x0c90('0x15'))(_0x0c90('0x16'));var utils=require('../../config/utils');var config=require(_0x0c90('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c90('0x18'))['db'];function respondWithStatusCode(_0x50e7db,_0x459cdb){_0x459cdb=_0x459cdb||0xcc;return function(_0x26fc46){if(_0x26fc46){return _0x50e7db[_0x0c90('0x19')](_0x459cdb);}return _0x50e7db[_0x0c90('0x1a')](_0x459cdb)[_0x0c90('0x1b')]();};}function respondWithResult(_0x59ea8e,_0x467b32){_0x467b32=_0x467b32||0xc8;return function(_0x4451e0){if(_0x4451e0){return _0x59ea8e['status'](_0x467b32)[_0x0c90('0x1c')](_0x4451e0);}};}function respondWithFilteredResult(_0x3a492d,_0x3bd5e8){return function(_0x5bef7d){if(_0x5bef7d){var _0x5daeb7=typeof _0x3bd5e8[_0x0c90('0x1d')]===_0x0c90('0x1e')&&typeof _0x3bd5e8[_0x0c90('0x1f')]===_0x0c90('0x1e');var _0x276b92=_0x5bef7d[_0x0c90('0x20')];var _0x42321a=_0x5daeb7?0x0:_0x3bd5e8['offset'];var _0xc3bb47=_0x5daeb7?_0x5bef7d[_0x0c90('0x20')]:_0x3bd5e8[_0x0c90('0x1d')]+_0x3bd5e8[_0x0c90('0x1f')];var _0x594267;if(_0xc3bb47>=_0x276b92){_0xc3bb47=_0x276b92;_0x594267=0xc8;}else{_0x594267=0xce;}_0x3a492d[_0x0c90('0x1a')](_0x594267);return _0x3a492d[_0x0c90('0x21')](_0x0c90('0x22'),_0x42321a+'-'+_0xc3bb47+'/'+_0x276b92)[_0x0c90('0x1c')](_0x5bef7d);}return null;};}function patchUpdates(_0x315932){return function(_0xc08f54){try{jsonpatch['apply'](_0xc08f54,_0x315932,!![]);}catch(_0x365a42){return BPromise['reject'](_0x365a42);}return _0xc08f54[_0x0c90('0x23')]();};}function saveUpdates(_0x1a021e,_0x47b13c){return function(_0x2a053a){if(_0x2a053a){return _0x2a053a[_0x0c90('0x24')](_0x1a021e)[_0x0c90('0x25')](function(_0x86dee){return _0x86dee;});}return null;};}function removeEntity(_0x212164,_0x3b287c){return function(_0x4dfbc3){if(_0x4dfbc3){return _0x4dfbc3[_0x0c90('0x26')]()[_0x0c90('0x25')](function(){var _0x5695a2=_0x4dfbc3['get']({'plain':!![]});var _0x28d005=_0x0c90('0x27');return db[_0x0c90('0x28')][_0x0c90('0x26')]({'where':{'type':_0x28d005,'resourceId':_0x5695a2['id']}})['then'](function(){return _0x4dfbc3;});})[_0x0c90('0x25')](function(){_0x212164[_0x0c90('0x1a')](0xcc)[_0x0c90('0x1b')]();});}};}function handleEntityNotFound(_0x277d4a,_0x427c2b){return function(_0x114589){if(!_0x114589){_0x277d4a['sendStatus'](0x194);}return _0x114589;};}function handleError(_0x15de68,_0x22a47d){_0x22a47d=_0x22a47d||0x1f4;return function(_0x39f1b2){logger[_0x0c90('0x29')](_0x39f1b2['stack']);if(_0x39f1b2['name']){delete _0x39f1b2[_0x0c90('0x2a')];}_0x15de68[_0x0c90('0x1a')](_0x22a47d)[_0x0c90('0x2b')](_0x39f1b2);};}exports[_0x0c90('0x2c')]=function(_0x119e09,_0x562664){var _0x120136={},_0x50b156={},_0x478002={'count':0x0,'rows':[]};var _0x47a935=_[_0x0c90('0x2d')](db['VoiceMail']['rawAttributes'],function(_0x886634){return{'name':_0x886634[_0x0c90('0x2e')],'type':_0x886634[_0x0c90('0x2f')][_0x0c90('0x30')]};});_0x50b156['model']=_[_0x0c90('0x2d')](_0x47a935,'name');_0x50b156[_0x0c90('0x31')]=_['keys'](_0x119e09[_0x0c90('0x31')]);_0x50b156[_0x0c90('0x32')]=_['intersection'](_0x50b156[_0x0c90('0x33')],_0x50b156[_0x0c90('0x31')]);_0x120136[_0x0c90('0x34')]=_[_0x0c90('0x35')](_0x50b156[_0x0c90('0x33')],qs[_0x0c90('0x36')](_0x119e09[_0x0c90('0x31')][_0x0c90('0x36')]));_0x120136['attributes']=_0x120136[_0x0c90('0x34')][_0x0c90('0x37')]?_0x120136[_0x0c90('0x34')]:_0x50b156[_0x0c90('0x33')];if(!_0x119e09['query'][_0x0c90('0x38')](_0x0c90('0x39'))){_0x120136[_0x0c90('0x1f')]=qs[_0x0c90('0x1f')](_0x119e09[_0x0c90('0x31')][_0x0c90('0x1f')]);_0x120136[_0x0c90('0x1d')]=qs[_0x0c90('0x1d')](_0x119e09['query'][_0x0c90('0x1d')]);}_0x120136[_0x0c90('0x3a')]=qs['sort'](_0x119e09[_0x0c90('0x31')][_0x0c90('0x3b')]);_0x120136[_0x0c90('0x3c')]=qs[_0x0c90('0x32')](_[_0x0c90('0x3d')](_0x119e09['query'],_0x50b156[_0x0c90('0x32')]),_0x47a935);if(_0x119e09[_0x0c90('0x31')][_0x0c90('0x3e')]){_0x120136[_0x0c90('0x3c')]=_[_0x0c90('0x3f')](_0x120136[_0x0c90('0x3c')],{'$or':_[_0x0c90('0x2d')](_0x47a935,function(_0x1695dd){if(_0x1695dd[_0x0c90('0x2f')]!=='VIRTUAL'){var _0x2cd2c2={};_0x2cd2c2[_0x1695dd['name']]={'$like':'%'+_0x119e09[_0x0c90('0x31')]['filter']+'%'};return _0x2cd2c2;}})});}_0x120136=_[_0x0c90('0x3f')]({},_0x120136,_0x119e09[_0x0c90('0x40')]);var _0x49f8b4={'where':_0x120136['where']};return db[_0x0c90('0x41')]['count'](_0x49f8b4)[_0x0c90('0x25')](function(_0x4545bb){_0x478002[_0x0c90('0x20')]=_0x4545bb;if(_0x119e09['query'][_0x0c90('0x42')]){_0x120136[_0x0c90('0x43')]=[{'all':!![]}];}return db[_0x0c90('0x41')][_0x0c90('0x44')](_0x120136);})[_0x0c90('0x25')](function(_0x1184c4){_0x478002['rows']=_0x1184c4;return _0x478002;})[_0x0c90('0x25')](respondWithFilteredResult(_0x562664,_0x120136))[_0x0c90('0x45')](handleError(_0x562664,null));};exports[_0x0c90('0x46')]=function(_0x399115,_0x3c47c9){var _0x15d040={'raw':!![],'where':{'id':_0x399115['params']['id']}},_0x30b9df={};_0x30b9df[_0x0c90('0x33')]=_['keys'](db[_0x0c90('0x41')][_0x0c90('0x47')]);_0x30b9df[_0x0c90('0x31')]=_[_0x0c90('0x48')](_0x399115[_0x0c90('0x31')]);_0x30b9df[_0x0c90('0x32')]=_[_0x0c90('0x35')](_0x30b9df[_0x0c90('0x33')],_0x30b9df[_0x0c90('0x31')]);_0x15d040[_0x0c90('0x34')]=_[_0x0c90('0x35')](_0x30b9df[_0x0c90('0x33')],qs[_0x0c90('0x36')](_0x399115[_0x0c90('0x31')][_0x0c90('0x36')]));_0x15d040['attributes']=_0x15d040[_0x0c90('0x34')][_0x0c90('0x37')]?_0x15d040[_0x0c90('0x34')]:_0x30b9df[_0x0c90('0x33')];if(_0x399115[_0x0c90('0x31')][_0x0c90('0x42')]){_0x15d040[_0x0c90('0x43')]=[{'all':!![]}];}_0x15d040=_[_0x0c90('0x3f')]({},_0x15d040,_0x399115[_0x0c90('0x40')]);return db[_0x0c90('0x41')][_0x0c90('0x49')](_0x15d040)[_0x0c90('0x25')](handleEntityNotFound(_0x3c47c9,null))[_0x0c90('0x25')](respondWithResult(_0x3c47c9,null))[_0x0c90('0x45')](handleError(_0x3c47c9,null));};exports['create']=function(_0x1b4aac,_0x38f492){return db['VoiceMail']['create'](_0x1b4aac['body'],{})[_0x0c90('0x25')](function(_0x1205d0){var _0x460cf9=_0x1b4aac[_0x0c90('0x4a')][_0x0c90('0x4b')]({'plain':!![]});if(!_0x460cf9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x460cf9[_0x0c90('0x4c')]===_0x0c90('0x4a')){var _0x2b756d=_0x1205d0['get']({'plain':!![]});var _0x119776=_0x0c90('0x27');return db[_0x0c90('0x4d')][_0x0c90('0x49')]({'where':{'name':_0x119776,'userProfileId':_0x460cf9[_0x0c90('0x4e')]},'raw':!![]})[_0x0c90('0x25')](function(_0x42c121){if(_0x42c121&&_0x42c121[_0x0c90('0x4f')]===0x0){return db[_0x0c90('0x28')][_0x0c90('0x50')]({'name':_0x2b756d['name'],'resourceId':_0x2b756d['id'],'type':_0x42c121[_0x0c90('0x2a')],'sectionId':_0x42c121['id']},{})['then'](function(){return _0x1205d0;});}else{return _0x1205d0;}})[_0x0c90('0x45')](function(_0x67539d){logger[_0x0c90('0x29')](_0x0c90('0x51'),_0x67539d);throw _0x67539d;});}return _0x1205d0;})[_0x0c90('0x25')](respondWithResult(_0x38f492,0xc9))[_0x0c90('0x45')](handleError(_0x38f492,null));};exports['update']=function(_0x4930fc,_0x5382d9){if(_0x4930fc['body']['id']){delete _0x4930fc[_0x0c90('0x52')]['id'];}return db[_0x0c90('0x41')][_0x0c90('0x49')]({'where':{'id':_0x4930fc['params']['id']}})[_0x0c90('0x25')](handleEntityNotFound(_0x5382d9,null))[_0x0c90('0x25')](saveUpdates(_0x4930fc['body'],null))[_0x0c90('0x25')](respondWithResult(_0x5382d9,null))['catch'](handleError(_0x5382d9,null));};exports[_0x0c90('0x26')]=function(_0x8951f2,_0x42398b){return db[_0x0c90('0x41')]['find']({'where':{'id':_0x8951f2[_0x0c90('0x53')]['id']}})['then'](handleEntityNotFound(_0x42398b,null))[_0x0c90('0x25')](removeEntity(_0x42398b,null))[_0x0c90('0x45')](handleError(_0x42398b,null));};exports['getMessages']=function(_0x52b437,_0x51c356,_0x221fba){return db[_0x0c90('0x41')][_0x0c90('0x54')]({'where':{'id':_0x52b437[_0x0c90('0x53')]['id']}})[_0x0c90('0x25')](handleEntityNotFound(_0x51c356,null))['then'](function(_0x3bfd01){var _0x25ab13;var _0x5ee971={},_0x3eb725={};_0x3eb725['model']=_[_0x0c90('0x48')](db[_0x0c90('0x55')]['rawAttributes']);_0x3eb725[_0x0c90('0x31')]=_['keys'](_0x52b437['query']);_0x3eb725['filters']=_[_0x0c90('0x35')](_0x3eb725[_0x0c90('0x33')],_0x3eb725[_0x0c90('0x31')]);_0x5ee971[_0x0c90('0x34')]=_['intersection'](_0x3eb725['model'],qs[_0x0c90('0x36')](_0x52b437[_0x0c90('0x31')][_0x0c90('0x36')]));_0x5ee971['attributes']=_0x5ee971[_0x0c90('0x34')][_0x0c90('0x37')]?_0x5ee971[_0x0c90('0x34')]:_0x3eb725['model'];if(!_0x52b437[_0x0c90('0x31')][_0x0c90('0x38')](_0x0c90('0x39'))){_0x5ee971['limit']=qs[_0x0c90('0x1f')](_0x52b437[_0x0c90('0x31')][_0x0c90('0x1f')]);_0x5ee971[_0x0c90('0x1d')]=qs[_0x0c90('0x1d')](_0x52b437[_0x0c90('0x31')][_0x0c90('0x1d')]);}_0x5ee971[_0x0c90('0x3a')]=qs[_0x0c90('0x3b')](_0x52b437['query']['sort']);_0x5ee971[_0x0c90('0x3c')]=qs[_0x0c90('0x32')](_[_0x0c90('0x3d')](_0x52b437[_0x0c90('0x31')],_0x3eb725[_0x0c90('0x32')]));if(_0x52b437[_0x0c90('0x31')][_0x0c90('0x3e')]){_0x5ee971[_0x0c90('0x3c')]=_[_0x0c90('0x3f')](_0x5ee971[_0x0c90('0x3c')],{'$or':_[_0x0c90('0x2d')](_0x5ee971[_0x0c90('0x34')],function(_0x309152){var _0x164d4d={};_0x164d4d[_0x309152]={'$like':'%'+_0x52b437[_0x0c90('0x31')]['filter']+'%'};return _0x164d4d;})});}_0x5ee971[_0x0c90('0x3c')]=_[_0x0c90('0x3f')](_0x5ee971[_0x0c90('0x3c')],{'mailboxuser':_0x3bfd01['mailbox']});_0x5ee971=_['merge']({},_0x5ee971,_0x52b437[_0x0c90('0x40')]);return db['VoiceMailMessage'][_0x0c90('0x56')](_0x5ee971)[_0x0c90('0x25')](respondWithFilteredResult(_0x51c356,_0x5ee971));})['catch'](handleError(_0x51c356,null));}; \ No newline at end of file +var _0x757a=['../../config/license/hardware','../../config/logger','api','status','json','offset','undefined','count','limit','Content-Range','apply','update','then','get','Voicemails','UserProfileResource','destroy','end','error','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','hasOwnProperty','findAndCountAll','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x48ce56,_0x213bea){var _0x25e8a1=function(_0x34f473){while(--_0x34f473){_0x48ce56['push'](_0x48ce56['shift']());}};_0x25e8a1(++_0x213bea);}(_0x757a,0xde));var _0xa757=function(_0x33717e,_0x5c13d3){_0x33717e=_0x33717e-0x0;var _0x4bdb4e=_0x757a[_0x33717e];return _0x4bdb4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require(_0xa757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require(_0xa757('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0x7'));var querystring=require(_0xa757('0xd'));var Papa=require('papaparse');var Redis=require(_0xa757('0xe'));var authService=require(_0xa757('0xf'));var qs=require(_0xa757('0x10'));var as=require(_0xa757('0x11'));var hardwareService=require(_0xa757('0x12'));var logger=require(_0xa757('0x13'))(_0xa757('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4db68e,_0x421040){_0x421040=_0x421040||0xcc;return function(_0x544b45){if(_0x544b45){return _0x4db68e['sendStatus'](_0x421040);}return _0x4db68e[_0xa757('0x15')](_0x421040)['end']();};}function respondWithResult(_0x481508,_0x32112b){_0x32112b=_0x32112b||0xc8;return function(_0x1b670e){if(_0x1b670e){return _0x481508[_0xa757('0x15')](_0x32112b)[_0xa757('0x16')](_0x1b670e);}};}function respondWithFilteredResult(_0x86abd,_0x31cfd2){return function(_0xf12b68){if(_0xf12b68){var _0x2f7947=typeof _0x31cfd2[_0xa757('0x17')]===_0xa757('0x18')&&typeof _0x31cfd2['limit']===_0xa757('0x18');var _0x44eab8=_0xf12b68[_0xa757('0x19')];var _0x4d9f58=_0x2f7947?0x0:_0x31cfd2['offset'];var _0x151c04=_0x2f7947?_0xf12b68[_0xa757('0x19')]:_0x31cfd2[_0xa757('0x17')]+_0x31cfd2[_0xa757('0x1a')];var _0x27f4ba;if(_0x151c04>=_0x44eab8){_0x151c04=_0x44eab8;_0x27f4ba=0xc8;}else{_0x27f4ba=0xce;}_0x86abd[_0xa757('0x15')](_0x27f4ba);return _0x86abd['set'](_0xa757('0x1b'),_0x4d9f58+'-'+_0x151c04+'/'+_0x44eab8)['json'](_0xf12b68);}return null;};}function patchUpdates(_0x32c2a1){return function(_0x167640){try{jsonpatch[_0xa757('0x1c')](_0x167640,_0x32c2a1,!![]);}catch(_0x2c9ec6){return BPromise['reject'](_0x2c9ec6);}return _0x167640['save']();};}function saveUpdates(_0x40ec48,_0x2159cf){return function(_0x2ba923){if(_0x2ba923){return _0x2ba923[_0xa757('0x1d')](_0x40ec48)[_0xa757('0x1e')](function(_0x40562f){return _0x40562f;});}return null;};}function removeEntity(_0x2ca10d,_0x21f1af){return function(_0x2bf276){if(_0x2bf276){return _0x2bf276['destroy']()[_0xa757('0x1e')](function(){var _0x59e9d4=_0x2bf276[_0xa757('0x1f')]({'plain':!![]});var _0x47903b=_0xa757('0x20');return db[_0xa757('0x21')][_0xa757('0x22')]({'where':{'type':_0x47903b,'resourceId':_0x59e9d4['id']}})['then'](function(){return _0x2bf276;});})[_0xa757('0x1e')](function(){_0x2ca10d[_0xa757('0x15')](0xcc)[_0xa757('0x23')]();});}};}function handleEntityNotFound(_0x3bf7f3,_0x5b4779){return function(_0x449a7d){if(!_0x449a7d){_0x3bf7f3['sendStatus'](0x194);}return _0x449a7d;};}function handleError(_0x5a5664,_0x54b75e){_0x54b75e=_0x54b75e||0x1f4;return function(_0x4f8de2){logger[_0xa757('0x24')](_0x4f8de2['stack']);if(_0x4f8de2[_0xa757('0x25')]){delete _0x4f8de2[_0xa757('0x25')];}_0x5a5664['status'](_0x54b75e)[_0xa757('0x26')](_0x4f8de2);};}exports['index']=function(_0x2c4823,_0xa6d0f6){var _0x5307c3={},_0x235e54={},_0x5ade7b={'count':0x0,'rows':[]};var _0x3a4a66=_[_0xa757('0x27')](db[_0xa757('0x28')][_0xa757('0x29')],function(_0xcc87c0){return{'name':_0xcc87c0[_0xa757('0x2a')],'type':_0xcc87c0[_0xa757('0x2b')][_0xa757('0x2c')]};});_0x235e54[_0xa757('0x2d')]=_[_0xa757('0x27')](_0x3a4a66,_0xa757('0x25'));_0x235e54[_0xa757('0x2e')]=_[_0xa757('0x2f')](_0x2c4823[_0xa757('0x2e')]);_0x235e54[_0xa757('0x30')]=_[_0xa757('0x31')](_0x235e54[_0xa757('0x2d')],_0x235e54[_0xa757('0x2e')]);_0x5307c3[_0xa757('0x32')]=_[_0xa757('0x31')](_0x235e54[_0xa757('0x2d')],qs[_0xa757('0x33')](_0x2c4823[_0xa757('0x2e')][_0xa757('0x33')]));_0x5307c3['attributes']=_0x5307c3[_0xa757('0x32')][_0xa757('0x34')]?_0x5307c3[_0xa757('0x32')]:_0x235e54[_0xa757('0x2d')];if(!_0x2c4823[_0xa757('0x2e')]['hasOwnProperty'](_0xa757('0x35'))){_0x5307c3[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x2c4823[_0xa757('0x2e')][_0xa757('0x1a')]);_0x5307c3[_0xa757('0x17')]=qs['offset'](_0x2c4823[_0xa757('0x2e')][_0xa757('0x17')]);}_0x5307c3[_0xa757('0x36')]=qs[_0xa757('0x37')](_0x2c4823[_0xa757('0x2e')][_0xa757('0x37')]);_0x5307c3[_0xa757('0x38')]=qs[_0xa757('0x30')](_[_0xa757('0x39')](_0x2c4823['query'],_0x235e54[_0xa757('0x30')]),_0x3a4a66);if(_0x2c4823[_0xa757('0x2e')][_0xa757('0x3a')]){_0x5307c3[_0xa757('0x38')]=_[_0xa757('0x3b')](_0x5307c3[_0xa757('0x38')],{'$or':_['map'](_0x3a4a66,function(_0x10d3fd){if(_0x10d3fd[_0xa757('0x2b')]!=='VIRTUAL'){var _0x5eae0b={};_0x5eae0b[_0x10d3fd[_0xa757('0x25')]]={'$like':'%'+_0x2c4823[_0xa757('0x2e')]['filter']+'%'};return _0x5eae0b;}})});}_0x5307c3=_['merge']({},_0x5307c3,_0x2c4823[_0xa757('0x3c')]);var _0x1725a2={'where':_0x5307c3[_0xa757('0x38')]};return db['VoiceMail'][_0xa757('0x19')](_0x1725a2)[_0xa757('0x1e')](function(_0x26802c){_0x5ade7b[_0xa757('0x19')]=_0x26802c;if(_0x2c4823[_0xa757('0x2e')]['includeAll']){_0x5307c3[_0xa757('0x3d')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x5307c3);})[_0xa757('0x1e')](function(_0x57298b){_0x5ade7b[_0xa757('0x3e')]=_0x57298b;return _0x5ade7b;})[_0xa757('0x1e')](respondWithFilteredResult(_0xa6d0f6,_0x5307c3))[_0xa757('0x3f')](handleError(_0xa6d0f6,null));};exports['show']=function(_0x5d25bb,_0x11e141){var _0x129d77={'raw':!![],'where':{'id':_0x5d25bb[_0xa757('0x40')]['id']}},_0x2b171c={};_0x2b171c[_0xa757('0x2d')]=_[_0xa757('0x2f')](db['VoiceMail'][_0xa757('0x29')]);_0x2b171c[_0xa757('0x2e')]=_['keys'](_0x5d25bb[_0xa757('0x2e')]);_0x2b171c['filters']=_[_0xa757('0x31')](_0x2b171c[_0xa757('0x2d')],_0x2b171c['query']);_0x129d77[_0xa757('0x32')]=_[_0xa757('0x31')](_0x2b171c['model'],qs[_0xa757('0x33')](_0x5d25bb[_0xa757('0x2e')][_0xa757('0x33')]));_0x129d77[_0xa757('0x32')]=_0x129d77['attributes'][_0xa757('0x34')]?_0x129d77[_0xa757('0x32')]:_0x2b171c[_0xa757('0x2d')];if(_0x5d25bb[_0xa757('0x2e')]['includeAll']){_0x129d77[_0xa757('0x3d')]=[{'all':!![]}];}_0x129d77=_['merge']({},_0x129d77,_0x5d25bb['options']);return db[_0xa757('0x28')][_0xa757('0x41')](_0x129d77)[_0xa757('0x1e')](handleEntityNotFound(_0x11e141,null))['then'](respondWithResult(_0x11e141,null))[_0xa757('0x3f')](handleError(_0x11e141,null));};exports['create']=function(_0x2ed63f,_0x151cc3){return db[_0xa757('0x28')][_0xa757('0x42')](_0x2ed63f[_0xa757('0x43')],{})[_0xa757('0x1e')](function(_0x57bf73){var _0x505cd=_0x2ed63f['user'][_0xa757('0x1f')]({'plain':!![]});if(!_0x505cd)throw new Error(_0xa757('0x44'));if(_0x505cd[_0xa757('0x45')]===_0xa757('0x46')){var _0x319988=_0x57bf73[_0xa757('0x1f')]({'plain':!![]});var _0x15bad7=_0xa757('0x20');return db[_0xa757('0x47')][_0xa757('0x41')]({'where':{'name':_0x15bad7,'userProfileId':_0x505cd[_0xa757('0x48')]},'raw':!![]})[_0xa757('0x1e')](function(_0x2367c7){if(_0x2367c7&&_0x2367c7[_0xa757('0x49')]===0x0){return db[_0xa757('0x21')][_0xa757('0x42')]({'name':_0x319988['name'],'resourceId':_0x319988['id'],'type':_0x2367c7[_0xa757('0x25')],'sectionId':_0x2367c7['id']},{})['then'](function(){return _0x57bf73;});}else{return _0x57bf73;}})[_0xa757('0x3f')](function(_0x311c25){logger[_0xa757('0x24')](_0xa757('0x4a'),_0x311c25);throw _0x311c25;});}return _0x57bf73;})['then'](respondWithResult(_0x151cc3,0xc9))[_0xa757('0x3f')](handleError(_0x151cc3,null));};exports[_0xa757('0x1d')]=function(_0x8614f9,_0x980e1){if(_0x8614f9['body']['id']){delete _0x8614f9[_0xa757('0x43')]['id'];}return db[_0xa757('0x28')][_0xa757('0x41')]({'where':{'id':_0x8614f9[_0xa757('0x40')]['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x980e1,null))[_0xa757('0x1e')](saveUpdates(_0x8614f9['body'],null))['then'](respondWithResult(_0x980e1,null))['catch'](handleError(_0x980e1,null));};exports['destroy']=function(_0x1d8742,_0x9b3779){return db[_0xa757('0x28')][_0xa757('0x41')]({'where':{'id':_0x1d8742[_0xa757('0x40')]['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x9b3779,null))['then'](removeEntity(_0x9b3779,null))[_0xa757('0x3f')](handleError(_0x9b3779,null));};exports[_0xa757('0x4b')]=function(_0x34e03f,_0x29b2f5,_0x48b578){return db[_0xa757('0x28')][_0xa757('0x4c')]({'where':{'id':_0x34e03f['params']['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x29b2f5,null))['then'](function(_0x211980){var _0x5d375c;var _0x51be6e={},_0x58633a={};_0x58633a['model']=_[_0xa757('0x2f')](db[_0xa757('0x4d')][_0xa757('0x29')]);_0x58633a[_0xa757('0x2e')]=_[_0xa757('0x2f')](_0x34e03f[_0xa757('0x2e')]);_0x58633a['filters']=_['intersection'](_0x58633a[_0xa757('0x2d')],_0x58633a[_0xa757('0x2e')]);_0x51be6e[_0xa757('0x32')]=_['intersection'](_0x58633a['model'],qs[_0xa757('0x33')](_0x34e03f[_0xa757('0x2e')][_0xa757('0x33')]));_0x51be6e[_0xa757('0x32')]=_0x51be6e[_0xa757('0x32')][_0xa757('0x34')]?_0x51be6e['attributes']:_0x58633a[_0xa757('0x2d')];if(!_0x34e03f[_0xa757('0x2e')][_0xa757('0x4e')](_0xa757('0x35'))){_0x51be6e[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x34e03f[_0xa757('0x2e')][_0xa757('0x1a')]);_0x51be6e[_0xa757('0x17')]=qs[_0xa757('0x17')](_0x34e03f['query'][_0xa757('0x17')]);}_0x51be6e['order']=qs['sort'](_0x34e03f[_0xa757('0x2e')][_0xa757('0x37')]);_0x51be6e[_0xa757('0x38')]=qs[_0xa757('0x30')](_[_0xa757('0x39')](_0x34e03f[_0xa757('0x2e')],_0x58633a[_0xa757('0x30')]));if(_0x34e03f[_0xa757('0x2e')][_0xa757('0x3a')]){_0x51be6e[_0xa757('0x38')]=_[_0xa757('0x3b')](_0x51be6e['where'],{'$or':_[_0xa757('0x27')](_0x51be6e[_0xa757('0x32')],function(_0x5f0b71){var _0x11ebb3={};_0x11ebb3[_0x5f0b71]={'$like':'%'+_0x34e03f[_0xa757('0x2e')][_0xa757('0x3a')]+'%'};return _0x11ebb3;})});}_0x51be6e[_0xa757('0x38')]=_[_0xa757('0x3b')](_0x51be6e[_0xa757('0x38')],{'mailboxuser':_0x211980['mailbox']});_0x51be6e=_[_0xa757('0x3b')]({},_0x51be6e,_0x34e03f['options']);return db[_0xa757('0x4d')][_0xa757('0x4f')](_0x51be6e)[_0xa757('0x1e')](respondWithFilteredResult(_0x29b2f5,_0x51be6e));})[_0xa757('0x3f')](handleError(_0x29b2f5,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index d0d5449..cd0f9d5 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 _0x51c1=['util','../../config/logger','api','moment','bluebird','rimraf','./voiceMail.attributes','exports','define','VoiceMail','mailbox_context','lodash'];(function(_0xbaafb8,_0x566efe){var _0x12c3a3=function(_0x4d6322){while(--_0x4d6322){_0xbaafb8['push'](_0xbaafb8['shift']());}};_0x12c3a3(++_0x566efe);}(_0x51c1,0x1a3));var _0x151c=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x51c1[_0x1d9aa0];return _0x226868;};'use strict';var _=require(_0x151c('0x0'));var util=require(_0x151c('0x1'));var logger=require(_0x151c('0x2'))(_0x151c('0x3'));var moment=require(_0x151c('0x4'));var BPromise=require(_0x151c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x151c('0x6'));var config=require('../../config/environment');var attributes=require(_0x151c('0x7'));module[_0x151c('0x8')]=function(_0x46dd4c,_0x1647c4){return _0x46dd4c[_0x151c('0x9')](_0x151c('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x151c('0xb'),'fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x72c1=['api','request-promise','rimraf','define','VoiceMail','mailbox_context','context','../../config/logger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x72c1,0xdf));var _0x172c=function(_0x412e88,_0x469eee){_0x412e88=_0x412e88-0x0;var _0x61e13c=_0x72c1[_0x412e88];return _0x61e13c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x172c('0x0'))(_0x172c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x172c('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x172c('0x3'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module['exports']=function(_0x5ef144,_0x395169){return _0x5ef144[_0x172c('0x4')](_0x172c('0x5'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x172c('0x6'),'fields':['mailbox',_0x172c('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index d6b131a..d1ffe40 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 _0x068d=['VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x27450d,_0x5a5f4f){var _0x18e762=function(_0xa0bf6b){while(--_0xa0bf6b){_0x27450d['push'](_0x27450d['shift']());}};_0x18e762(++_0x5a5f4f);}(_0x068d,0xe0));var _0xd068=function(_0x2eaf72,_0x40f131){_0x2eaf72=_0x2eaf72-0x0;var _0x4f482c=_0x068d[_0x2eaf72];return _0x4f482c;};'use strict';var _=require(_0xd068('0x0'));var util=require(_0xd068('0x1'));var moment=require(_0xd068('0x2'));var BPromise=require(_0xd068('0x3'));var rs=require(_0xd068('0x4'));var fs=require('fs');var Redis=require(_0xd068('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd068('0x6'));var logger=require(_0xd068('0x7'))(_0xd068('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd068('0x9')][_0xd068('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6f7d44,_0x4ef8eb,_0x17a1d0){return new BPromise(function(_0xc6f50,_0x4933b7){return client[_0xd068('0xb')](_0x6f7d44,_0x17a1d0)[_0xd068('0xc')](function(_0x30f1b5){logger['info'](_0xd068('0xd'),_0x4ef8eb,_0xd068('0xe'));logger[_0xd068('0xf')](_0xd068('0x10'),_0x4ef8eb,'request\x20sent',JSON[_0xd068('0x11')](_0x30f1b5));if(_0x30f1b5[_0xd068('0x12')]){if(_0x30f1b5['error'][_0xd068('0x13')]===0x1f4){logger[_0xd068('0x12')](_0xd068('0xd'),_0x4ef8eb,_0x30f1b5['error'][_0xd068('0x14')]);return _0x4933b7(_0x30f1b5[_0xd068('0x12')][_0xd068('0x14')]);}logger[_0xd068('0x12')](_0xd068('0xd'),_0x4ef8eb,_0x30f1b5[_0xd068('0x12')][_0xd068('0x14')]);return _0xc6f50(_0x30f1b5[_0xd068('0x12')][_0xd068('0x14')]);}else{logger[_0xd068('0x15')](_0xd068('0xd'),_0x4ef8eb,_0xd068('0xe'));_0xc6f50(_0x30f1b5[_0xd068('0x16')][_0xd068('0x14')]);}})[_0xd068('0x17')](function(_0x1dcca8){logger[_0xd068('0x12')]('VoiceMail,\x20%s,\x20%s',_0x4ef8eb,_0x1dcca8);_0x4933b7(_0x1dcca8);});});} \ No newline at end of file +var _0xe494=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','info','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3369fe,_0x531e63){var _0xe68a65=function(_0x1f9461){while(--_0x1f9461){_0x3369fe['push'](_0x3369fe['shift']());}};_0xe68a65(++_0x531e63);}(_0xe494,0xc1));var _0x4e49=function(_0x296eff,_0x57b7f8){_0x296eff=_0x296eff-0x0;var _0x268560=_0xe494[_0x296eff];return _0x268560;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4e49('0x0'));var BPromise=require(_0x4e49('0x1'));var rs=require(_0x4e49('0x2'));var fs=require('fs');var Redis=require(_0x4e49('0x3'));var db=require(_0x4e49('0x4'))['db'];var utils=require(_0x4e49('0x5'));var logger=require(_0x4e49('0x6'))(_0x4e49('0x7'));var config=require(_0x4e49('0x8'));var jayson=require(_0x4e49('0x9'));var client=jayson['client'][_0x4e49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4dab73,_0x567f9b,_0x1d47e1){return new BPromise(function(_0x4e336b,_0x2e8b17){return client[_0x4e49('0xb')](_0x4dab73,_0x1d47e1)[_0x4e49('0xc')](function(_0x4855dd){logger['info']('VoiceMail,\x20%s,\x20%s',_0x567f9b,_0x4e49('0xd'));logger[_0x4e49('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x567f9b,'request\x20sent',JSON[_0x4e49('0xf')](_0x4855dd));if(_0x4855dd[_0x4e49('0x10')]){if(_0x4855dd[_0x4e49('0x10')][_0x4e49('0x11')]===0x1f4){logger[_0x4e49('0x10')](_0x4e49('0x12'),_0x567f9b,_0x4855dd['error']['message']);return _0x2e8b17(_0x4855dd[_0x4e49('0x10')][_0x4e49('0x13')]);}logger[_0x4e49('0x10')](_0x4e49('0x12'),_0x567f9b,_0x4855dd[_0x4e49('0x10')]['message']);return _0x4e336b(_0x4855dd[_0x4e49('0x10')]['message']);}else{logger[_0x4e49('0x14')]('VoiceMail,\x20%s,\x20%s',_0x567f9b,_0x4e49('0xd'));_0x4e336b(_0x4855dd['result'][_0x4e49('0x13')]);}})[_0x4e49('0x15')](function(_0x3557e5){logger[_0x4e49('0x10')](_0x4e49('0x12'),_0x567f9b,_0x3557e5);_0x2e8b17(_0x3557e5);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index f26562f..92d49cb 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 _0xdfe3=['path','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','download','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x48940c,_0x34cc0a){var _0x5645c0=function(_0xe526b2){while(--_0xe526b2){_0x48940c['push'](_0x48940c['shift']());}};_0x5645c0(++_0x34cc0a);}(_0xdfe3,0x11e));var _0x3dfe=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xdfe3[_0x500419];return _0x241c1a;};'use strict';var multer=require(_0x3dfe('0x0'));var util=require(_0x3dfe('0x1'));var path=require(_0x3dfe('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3dfe('0x3'));var controller=require(_0x3dfe('0x4'));router[_0x3dfe('0x5')]('/',auth[_0x3dfe('0x6')](),controller[_0x3dfe('0x7')]);router[_0x3dfe('0x5')](_0x3dfe('0x8'),auth[_0x3dfe('0x6')](),controller[_0x3dfe('0x9')]);router[_0x3dfe('0x5')]('/:id/download',auth[_0x3dfe('0x6')](),controller[_0x3dfe('0xa')]);router[_0x3dfe('0xb')]('/',auth[_0x3dfe('0x6')](),controller[_0x3dfe('0xc')]);router[_0x3dfe('0xd')]('/:id',auth[_0x3dfe('0x6')](),controller[_0x3dfe('0xe')]);router[_0x3dfe('0xf')]('/:id',auth[_0x3dfe('0x6')](),controller[_0x3dfe('0x10')]);module[_0x3dfe('0x11')]=router; \ No newline at end of file +var _0x530b=['create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','isAuthenticated','index','get','/:id/download','post'];(function(_0x16eb11,_0x1a2251){var _0x3ae7ef=function(_0x575a01){while(--_0x575a01){_0x16eb11['push'](_0x16eb11['shift']());}};_0x3ae7ef(++_0x1a2251);}(_0x530b,0x1ab));var _0xb530=function(_0x2077c2,_0x275ab5){_0x2077c2=_0x2077c2-0x0;var _0x312f9f=_0x530b[_0x2077c2];return _0x312f9f;};'use strict';var multer=require('multer');var util=require(_0xb530('0x0'));var path=require(_0xb530('0x1'));var timeout=require(_0xb530('0x2'));var express=require(_0xb530('0x3'));var router=express['Router']();var fs_extra=require(_0xb530('0x4'));var auth=require(_0xb530('0x5'));var interaction=require(_0xb530('0x6'));var config=require('../../config/environment');var controller=require(_0xb530('0x7'));router['get']('/',auth[_0xb530('0x8')](),controller[_0xb530('0x9')]);router[_0xb530('0xa')]('/:id',auth[_0xb530('0x8')](),controller['show']);router[_0xb530('0xa')](_0xb530('0xb'),auth[_0xb530('0x8')](),controller['download']);router[_0xb530('0xc')]('/',auth['isAuthenticated'](),controller[_0xb530('0xd')]);router[_0xb530('0xe')](_0xb530('0xf'),auth['isAuthenticated'](),controller[_0xb530('0x10')]);router[_0xb530('0x11')](_0xb530('0xf'),auth[_0xb530('0x8')](),controller[_0xb530('0x12')]);module[_0xb530('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index decb25f..033eb1b 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 _0x7d7c=['STRING','BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','INTEGER'];(function(_0x19ec59,_0x299c80){var _0x37f311=function(_0x5deb91){while(--_0x5deb91){_0x19ec59['push'](_0x19ec59['shift']());}};_0x37f311(++_0x299c80);}(_0x7d7c,0x1cd));var _0xc7d7=function(_0x3b7bc5,_0x4c67b8){_0x3b7bc5=_0x3b7bc5-0x0;var _0x1a2bbb=_0x7d7c[_0x3b7bc5];return _0x1a2bbb;};'use strict';var Sequelize=require('sequelize');module[_0xc7d7('0x0')]={'name':{'type':Sequelize[_0xc7d7('0x1')],'get':function(_0x2a5dce){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xc7d7('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xc7d7('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xc7d7('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xc7d7('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xc7d7('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xc7d7('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xc7d7('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xc7d7('0x4')](_0xc7d7('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xc7d7('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xc7d7('0x3')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xc7d7('0x6')](_0xc7d7('0x7'))}}; \ No newline at end of file +var _0x5a27=['BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','INTEGER','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5a27,0xf8));var _0x75a2=function(_0xc6ceb9,_0x15e8ef){_0xc6ceb9=_0xc6ceb9-0x0;var _0x4a5123=_0x5a27[_0xc6ceb9];return _0x4a5123;};'use strict';var Sequelize=require(_0x75a2('0x0'));module['exports']={'name':{'type':Sequelize[_0x75a2('0x1')],'get':function(_0x543e0d){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x75a2('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x75a2('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x75a2('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x75a2('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x75a2('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x75a2('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x75a2('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x75a2('0x4')](_0x75a2('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x75a2('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x75a2('0x6'),'defaultValue':Sequelize[_0x75a2('0x7')](_0x75a2('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 3fdbe83..c702ff6 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 _0x4f69=['Sequelize','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','request-promise','moment','bluebird','mustache','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','../../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','destroy','error','name','send','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','catch','params','length','include','create','body','find','download','recording'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x4f69,0x1ba));var _0x94f6=function(_0x2b37b5,_0x4f677b){_0x2b37b5=_0x2b37b5-0x0;var _0x36df6d=_0x4f69[_0x2b37b5];return _0x36df6d;};'use strict';var emlformat=require(_0x94f6('0x0'));var rimraf=require(_0x94f6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x94f6('0x2'));var moment=require(_0x94f6('0x3'));var BPromise=require(_0x94f6('0x4'));var Mustache=require(_0x94f6('0x5'));var util=require(_0x94f6('0x6'));var path=require(_0x94f6('0x7'));var sox=require(_0x94f6('0x8'));var csv=require(_0x94f6('0x9'));var ejs=require(_0x94f6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x94f6('0xb'));var squel=require(_0x94f6('0xc'));var crypto=require(_0x94f6('0xd'));var jsforce=require(_0x94f6('0xe'));var deskjs=require(_0x94f6('0xf'));var toCsv=require(_0x94f6('0x9'));var querystring=require(_0x94f6('0x10'));var Papa=require(_0x94f6('0x11'));var Redis=require(_0x94f6('0x12'));var authService=require(_0x94f6('0x13'));var qs=require(_0x94f6('0x14'));var as=require(_0x94f6('0x15'));var hardwareService=require(_0x94f6('0x16'));var logger=require(_0x94f6('0x17'))(_0x94f6('0x18'));var utils=require(_0x94f6('0x19'));var config=require(_0x94f6('0x1a'));var licenseUtil=require(_0x94f6('0x1b'));var db=require(_0x94f6('0x1c'))['db'];function respondWithStatusCode(_0x2be643,_0x5bbe01){_0x5bbe01=_0x5bbe01||0xcc;return function(_0xe2d438){if(_0xe2d438){return _0x2be643[_0x94f6('0x1d')](_0x5bbe01);}return _0x2be643[_0x94f6('0x1e')](_0x5bbe01)[_0x94f6('0x1f')]();};}function respondWithResult(_0x368935,_0x343267){_0x343267=_0x343267||0xc8;return function(_0x353919){if(_0x353919){return _0x368935[_0x94f6('0x1e')](_0x343267)[_0x94f6('0x20')](_0x353919);}};}function respondWithFilteredResult(_0x122eed,_0x1c394b){return function(_0xd2e1b0){if(_0xd2e1b0){var _0x25c2e6=typeof _0x1c394b['offset']===_0x94f6('0x21')&&typeof _0x1c394b[_0x94f6('0x22')]===_0x94f6('0x21');var _0x4eedb9=_0xd2e1b0[_0x94f6('0x23')];var _0x158ae2=_0x25c2e6?0x0:_0x1c394b[_0x94f6('0x24')];var _0x504a87=_0x25c2e6?_0xd2e1b0['count']:_0x1c394b[_0x94f6('0x24')]+_0x1c394b['limit'];var _0x45ed97;if(_0x504a87>=_0x4eedb9){_0x504a87=_0x4eedb9;_0x45ed97=0xc8;}else{_0x45ed97=0xce;}_0x122eed['status'](_0x45ed97);return _0x122eed[_0x94f6('0x25')]('Content-Range',_0x158ae2+'-'+_0x504a87+'/'+_0x4eedb9)[_0x94f6('0x20')](_0xd2e1b0);}return null;};}function patchUpdates(_0x432077){return function(_0x5a6f3b){try{jsonpatch[_0x94f6('0x26')](_0x5a6f3b,_0x432077,!![]);}catch(_0x1a901b){return BPromise[_0x94f6('0x27')](_0x1a901b);}return _0x5a6f3b[_0x94f6('0x28')]();};}function saveUpdates(_0x192378,_0x2f682e){return function(_0x1809b2){if(_0x1809b2){return _0x1809b2[_0x94f6('0x29')](_0x192378)[_0x94f6('0x2a')](function(_0x497ca0){return _0x497ca0;});}return null;};}function removeEntity(_0x26a8e1,_0x1fcb3f){return function(_0x34a000){if(_0x34a000){return _0x34a000[_0x94f6('0x2b')]()[_0x94f6('0x2a')](function(){_0x26a8e1[_0x94f6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45ed2f,_0x50a439){return function(_0x196a2e){if(!_0x196a2e){_0x45ed2f[_0x94f6('0x1d')](0x194);}return _0x196a2e;};}function handleError(_0x415769,_0x3c65da){_0x3c65da=_0x3c65da||0x1f4;return function(_0x2ffb7b){logger[_0x94f6('0x2c')](_0x2ffb7b['stack']);if(_0x2ffb7b['name']){delete _0x2ffb7b[_0x94f6('0x2d')];}_0x415769[_0x94f6('0x1e')](_0x3c65da)[_0x94f6('0x2e')](_0x2ffb7b);};}exports['index']=function(_0x58e3fe,_0x5eac67){var _0x2a0e14={},_0x28b5e1={},_0x2f464b={'count':0x0,'rows':[]};var _0x3154c5=_['map'](db[_0x94f6('0x2f')][_0x94f6('0x30')],function(_0x4df011){return{'name':_0x4df011[_0x94f6('0x31')],'type':_0x4df011['type'][_0x94f6('0x32')]};});_0x28b5e1[_0x94f6('0x33')]=_[_0x94f6('0x34')](_[_0x94f6('0x35')](_0x3154c5,_0x94f6('0x2d')),['name']);_0x28b5e1[_0x94f6('0x36')]=_[_0x94f6('0x37')](_0x58e3fe[_0x94f6('0x36')]);_0x28b5e1[_0x94f6('0x38')]=_['intersection'](_0x28b5e1['model'],_0x28b5e1['query']);_0x2a0e14[_0x94f6('0x39')]=_[_0x94f6('0x3a')](_0x28b5e1[_0x94f6('0x33')],qs[_0x94f6('0x3b')](_0x58e3fe['query']['fields']));_0x2a0e14[_0x94f6('0x39')]=_0x2a0e14[_0x94f6('0x39')]['length']?_0x2a0e14[_0x94f6('0x39')]:_0x28b5e1[_0x94f6('0x33')];if(!_0x58e3fe[_0x94f6('0x36')][_0x94f6('0x3c')](_0x94f6('0x3d'))){_0x2a0e14[_0x94f6('0x22')]=qs['limit'](_0x58e3fe[_0x94f6('0x36')][_0x94f6('0x22')]);_0x2a0e14['offset']=qs[_0x94f6('0x24')](_0x58e3fe[_0x94f6('0x36')]['offset']);}_0x2a0e14[_0x94f6('0x3e')]=qs[_0x94f6('0x3f')](_0x58e3fe[_0x94f6('0x36')][_0x94f6('0x3f')]);_0x2a0e14[_0x94f6('0x40')]=qs[_0x94f6('0x38')](_[_0x94f6('0x41')](_0x58e3fe[_0x94f6('0x36')],_0x28b5e1['filters']),_0x3154c5);if(_0x58e3fe[_0x94f6('0x36')]['filter']){_0x2a0e14['where']=_[_0x94f6('0x42')](_0x2a0e14[_0x94f6('0x40')],{'$or':_[_0x94f6('0x35')](_0x3154c5,function(_0x94449b){if(_0x94449b[_0x94f6('0x43')]!==_0x94f6('0x44')){var _0x578839={};_0x578839[_0x94449b['name']]={'$like':'%'+_0x58e3fe['query']['filter']+'%'};return _0x578839;}})});}_0x2a0e14=_[_0x94f6('0x42')]({},_0x2a0e14,_0x58e3fe[_0x94f6('0x45')]);var _0x2460b8={'where':_0x2a0e14['where']};return db[_0x94f6('0x2f')][_0x94f6('0x23')](_0x2460b8)[_0x94f6('0x2a')](function(_0x545c64){_0x2f464b[_0x94f6('0x23')]=_0x545c64;if(_0x58e3fe[_0x94f6('0x36')][_0x94f6('0x46')]){_0x2a0e14['include']=[{'all':!![]}];}return db[_0x94f6('0x2f')]['findAll'](_0x2a0e14);})[_0x94f6('0x2a')](function(_0x5cdac7){_0x2f464b['rows']=_0x5cdac7;return _0x2f464b;})[_0x94f6('0x2a')](respondWithFilteredResult(_0x5eac67,_0x2a0e14))[_0x94f6('0x47')](handleError(_0x5eac67,null));};exports['show']=function(_0x2f8f53,_0x44ce05){var _0x5a2bba={'raw':!![],'where':{'id':_0x2f8f53[_0x94f6('0x48')]['id']}},_0x1fb389={};_0x1fb389[_0x94f6('0x33')]=_[_0x94f6('0x37')](db[_0x94f6('0x2f')][_0x94f6('0x30')]);_0x1fb389[_0x94f6('0x36')]=_[_0x94f6('0x37')](_0x2f8f53[_0x94f6('0x36')]);_0x1fb389['filters']=_[_0x94f6('0x3a')](_0x1fb389['model'],_0x1fb389[_0x94f6('0x36')]);_0x5a2bba[_0x94f6('0x39')]=_['intersection'](_0x1fb389[_0x94f6('0x33')],qs['fields'](_0x2f8f53[_0x94f6('0x36')][_0x94f6('0x3b')]));_0x5a2bba[_0x94f6('0x39')]=_0x5a2bba[_0x94f6('0x39')][_0x94f6('0x49')]?_0x5a2bba[_0x94f6('0x39')]:_0x1fb389[_0x94f6('0x33')];if(_0x2f8f53[_0x94f6('0x36')]['includeAll']){_0x5a2bba[_0x94f6('0x4a')]=[{'all':!![]}];}_0x5a2bba=_[_0x94f6('0x42')]({},_0x5a2bba,_0x2f8f53[_0x94f6('0x45')]);return db[_0x94f6('0x2f')]['find'](_0x5a2bba)['then'](handleEntityNotFound(_0x44ce05,null))['then'](respondWithResult(_0x44ce05,null))[_0x94f6('0x47')](handleError(_0x44ce05,null));};exports['create']=function(_0xbc2589,_0x2601a9){return db[_0x94f6('0x2f')][_0x94f6('0x4b')](_0xbc2589[_0x94f6('0x4c')],{})[_0x94f6('0x2a')](respondWithResult(_0x2601a9,0xc9))[_0x94f6('0x47')](handleError(_0x2601a9,null));};exports[_0x94f6('0x29')]=function(_0x36982b,_0x33459a){if(_0x36982b[_0x94f6('0x4c')]['id']){delete _0x36982b[_0x94f6('0x4c')]['id'];}return db[_0x94f6('0x2f')][_0x94f6('0x4d')]({'where':{'id':_0x36982b[_0x94f6('0x48')]['id']}})[_0x94f6('0x2a')](handleEntityNotFound(_0x33459a,null))[_0x94f6('0x2a')](saveUpdates(_0x36982b['body'],null))[_0x94f6('0x2a')](respondWithResult(_0x33459a,null))[_0x94f6('0x47')](handleError(_0x33459a,null));};exports[_0x94f6('0x2b')]=function(_0x30aa64,_0x3e1b7d){return db['VoiceMailMessage']['find']({'where':{'id':_0x30aa64[_0x94f6('0x48')]['id']}})[_0x94f6('0x2a')](handleEntityNotFound(_0x3e1b7d,null))[_0x94f6('0x2a')](removeEntity(_0x3e1b7d,null))[_0x94f6('0x47')](handleError(_0x3e1b7d,null));};exports[_0x94f6('0x4e')]=function(_0x236694,_0x3ce970,_0x4c0fd6){return db[_0x94f6('0x2f')][_0x94f6('0x4d')]({'where':{'id':_0x236694['params']['id']},'attributes':['id','recording','msg_id']})['then'](handleEntityNotFound(_0x3ce970,null))[_0x94f6('0x2a')](function(_0x32bbed){if(_0x32bbed){if(!_0x32bbed[_0x94f6('0x4f')]){throw new db[(_0x94f6('0x50'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x501668={'Content-Type':_0x94f6('0x51'),'Content-Disposition':_0x94f6('0x52')};if(_0x32bbed[_0x94f6('0x53')]){_0x501668[_0x94f6('0x54')]=_0x94f6('0x55')+_0x32bbed['msg_id']+_0x94f6('0x56');}_0x3ce970['set'](_0x501668);return _0x3ce970[_0x94f6('0x2e')](new Buffer(_0x32bbed[_0x94f6('0x4f')]));}})['catch'](handleError(_0x3ce970,null));}; \ No newline at end of file +var _0x6483=['VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','recording','Sequelize','audio/wav','attachment','msg_id','rimraf','request-promise','moment','bluebird','mustache','util','path','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','../../mysqldb','end','status','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','type'];(function(_0x3c9bfa,_0x1c53dc){var _0x526feb=function(_0x33e92b){while(--_0x33e92b){_0x3c9bfa['push'](_0x3c9bfa['shift']());}};_0x526feb(++_0x1c53dc);}(_0x6483,0x66));var _0x3648=function(_0x264cbc,_0x2b8b5b){_0x264cbc=_0x264cbc-0x0;var _0x34e37d=_0x6483[_0x264cbc];return _0x34e37d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3648('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3648('0x1'));var moment=require(_0x3648('0x2'));var BPromise=require(_0x3648('0x3'));var Mustache=require(_0x3648('0x4'));var util=require(_0x3648('0x5'));var path=require(_0x3648('0x6'));var sox=require(_0x3648('0x7'));var csv=require(_0x3648('0x8'));var ejs=require(_0x3648('0x9'));var fs=require('fs');var fs_extra=require(_0x3648('0xa'));var _=require('lodash');var squel=require(_0x3648('0xb'));var crypto=require(_0x3648('0xc'));var jsforce=require(_0x3648('0xd'));var deskjs=require(_0x3648('0xe'));var toCsv=require(_0x3648('0x8'));var querystring=require(_0x3648('0xf'));var Papa=require(_0x3648('0x10'));var Redis=require(_0x3648('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3648('0x12'));var as=require(_0x3648('0x13'));var hardwareService=require(_0x3648('0x14'));var logger=require(_0x3648('0x15'))(_0x3648('0x16'));var utils=require(_0x3648('0x17'));var config=require(_0x3648('0x18'));var licenseUtil=require(_0x3648('0x19'));var db=require(_0x3648('0x1a'))['db'];function respondWithStatusCode(_0x5aa0b3,_0x473bb6){_0x473bb6=_0x473bb6||0xcc;return function(_0x2aba3f){if(_0x2aba3f){return _0x5aa0b3['sendStatus'](_0x473bb6);}return _0x5aa0b3['status'](_0x473bb6)[_0x3648('0x1b')]();};}function respondWithResult(_0x501f55,_0x18af3b){_0x18af3b=_0x18af3b||0xc8;return function(_0x165bb4){if(_0x165bb4){return _0x501f55[_0x3648('0x1c')](_0x18af3b)[_0x3648('0x1d')](_0x165bb4);}};}function respondWithFilteredResult(_0x3ce28c,_0xafb530){return function(_0x120824){if(_0x120824){var _0x44bcca=typeof _0xafb530[_0x3648('0x1e')]===_0x3648('0x1f')&&typeof _0xafb530['limit']===_0x3648('0x1f');var _0x3daa41=_0x120824['count'];var _0x595b93=_0x44bcca?0x0:_0xafb530['offset'];var _0x4603ee=_0x44bcca?_0x120824[_0x3648('0x20')]:_0xafb530['offset']+_0xafb530['limit'];var _0x3360b9;if(_0x4603ee>=_0x3daa41){_0x4603ee=_0x3daa41;_0x3360b9=0xc8;}else{_0x3360b9=0xce;}_0x3ce28c['status'](_0x3360b9);return _0x3ce28c[_0x3648('0x21')]('Content-Range',_0x595b93+'-'+_0x4603ee+'/'+_0x3daa41)[_0x3648('0x1d')](_0x120824);}return null;};}function patchUpdates(_0x2b951a){return function(_0x2a3f54){try{jsonpatch[_0x3648('0x22')](_0x2a3f54,_0x2b951a,!![]);}catch(_0x3f3959){return BPromise[_0x3648('0x23')](_0x3f3959);}return _0x2a3f54[_0x3648('0x24')]();};}function saveUpdates(_0x479d11,_0x2fc020){return function(_0x4ad0d9){if(_0x4ad0d9){return _0x4ad0d9[_0x3648('0x25')](_0x479d11)[_0x3648('0x26')](function(_0x4fccf4){return _0x4fccf4;});}return null;};}function removeEntity(_0x1e34b3,_0x34b6d8){return function(_0x571eb8){if(_0x571eb8){return _0x571eb8[_0x3648('0x27')]()[_0x3648('0x26')](function(){_0x1e34b3[_0x3648('0x1c')](0xcc)[_0x3648('0x1b')]();});}};}function handleEntityNotFound(_0x5be5f1,_0x3324a7){return function(_0x89bbdf){if(!_0x89bbdf){_0x5be5f1[_0x3648('0x28')](0x194);}return _0x89bbdf;};}function handleError(_0x2e8018,_0xbe32f6){_0xbe32f6=_0xbe32f6||0x1f4;return function(_0x18b560){logger[_0x3648('0x29')](_0x18b560[_0x3648('0x2a')]);if(_0x18b560[_0x3648('0x2b')]){delete _0x18b560[_0x3648('0x2b')];}_0x2e8018['status'](_0xbe32f6)[_0x3648('0x2c')](_0x18b560);};}exports[_0x3648('0x2d')]=function(_0x2be35f,_0x13eecf){var _0x49a438={},_0x4d8176={},_0x2f1ad4={'count':0x0,'rows':[]};var _0x3c242b=_[_0x3648('0x2e')](db[_0x3648('0x2f')][_0x3648('0x30')],function(_0x2197f1){return{'name':_0x2197f1[_0x3648('0x31')],'type':_0x2197f1['type'][_0x3648('0x32')]};});_0x4d8176[_0x3648('0x33')]=_[_0x3648('0x34')](_['map'](_0x3c242b,_0x3648('0x2b')),[_0x3648('0x2b')]);_0x4d8176[_0x3648('0x35')]=_[_0x3648('0x36')](_0x2be35f[_0x3648('0x35')]);_0x4d8176['filters']=_[_0x3648('0x37')](_0x4d8176[_0x3648('0x33')],_0x4d8176[_0x3648('0x35')]);_0x49a438[_0x3648('0x38')]=_[_0x3648('0x37')](_0x4d8176[_0x3648('0x33')],qs[_0x3648('0x39')](_0x2be35f['query']['fields']));_0x49a438[_0x3648('0x38')]=_0x49a438[_0x3648('0x38')][_0x3648('0x3a')]?_0x49a438[_0x3648('0x38')]:_0x4d8176['model'];if(!_0x2be35f[_0x3648('0x35')][_0x3648('0x3b')](_0x3648('0x3c'))){_0x49a438[_0x3648('0x3d')]=qs[_0x3648('0x3d')](_0x2be35f['query']['limit']);_0x49a438[_0x3648('0x1e')]=qs[_0x3648('0x1e')](_0x2be35f['query'][_0x3648('0x1e')]);}_0x49a438['order']=qs[_0x3648('0x3e')](_0x2be35f[_0x3648('0x35')]['sort']);_0x49a438[_0x3648('0x3f')]=qs['filters'](_['pick'](_0x2be35f[_0x3648('0x35')],_0x4d8176[_0x3648('0x40')]),_0x3c242b);if(_0x2be35f[_0x3648('0x35')][_0x3648('0x41')]){_0x49a438[_0x3648('0x3f')]=_[_0x3648('0x42')](_0x49a438[_0x3648('0x3f')],{'$or':_[_0x3648('0x2e')](_0x3c242b,function(_0x355c69){if(_0x355c69[_0x3648('0x43')]!==_0x3648('0x44')){var _0x492ecc={};_0x492ecc[_0x355c69[_0x3648('0x2b')]]={'$like':'%'+_0x2be35f[_0x3648('0x35')][_0x3648('0x41')]+'%'};return _0x492ecc;}})});}_0x49a438=_[_0x3648('0x42')]({},_0x49a438,_0x2be35f[_0x3648('0x45')]);var _0x5f41b4={'where':_0x49a438[_0x3648('0x3f')]};return db[_0x3648('0x2f')][_0x3648('0x20')](_0x5f41b4)[_0x3648('0x26')](function(_0x17748a){_0x2f1ad4[_0x3648('0x20')]=_0x17748a;if(_0x2be35f[_0x3648('0x35')][_0x3648('0x46')]){_0x49a438[_0x3648('0x47')]=[{'all':!![]}];}return db[_0x3648('0x2f')][_0x3648('0x48')](_0x49a438);})[_0x3648('0x26')](function(_0x26c22e){_0x2f1ad4[_0x3648('0x49')]=_0x26c22e;return _0x2f1ad4;})[_0x3648('0x26')](respondWithFilteredResult(_0x13eecf,_0x49a438))['catch'](handleError(_0x13eecf,null));};exports[_0x3648('0x4a')]=function(_0x12b362,_0x2423a4){var _0x7e0b13={'raw':!![],'where':{'id':_0x12b362[_0x3648('0x4b')]['id']}},_0x10b443={};_0x10b443[_0x3648('0x33')]=_[_0x3648('0x36')](db[_0x3648('0x2f')][_0x3648('0x30')]);_0x10b443[_0x3648('0x35')]=_[_0x3648('0x36')](_0x12b362['query']);_0x10b443[_0x3648('0x40')]=_[_0x3648('0x37')](_0x10b443['model'],_0x10b443[_0x3648('0x35')]);_0x7e0b13['attributes']=_['intersection'](_0x10b443[_0x3648('0x33')],qs[_0x3648('0x39')](_0x12b362[_0x3648('0x35')][_0x3648('0x39')]));_0x7e0b13[_0x3648('0x38')]=_0x7e0b13[_0x3648('0x38')]['length']?_0x7e0b13[_0x3648('0x38')]:_0x10b443[_0x3648('0x33')];if(_0x12b362[_0x3648('0x35')][_0x3648('0x46')]){_0x7e0b13[_0x3648('0x47')]=[{'all':!![]}];}_0x7e0b13=_[_0x3648('0x42')]({},_0x7e0b13,_0x12b362['options']);return db['VoiceMailMessage'][_0x3648('0x4c')](_0x7e0b13)[_0x3648('0x26')](handleEntityNotFound(_0x2423a4,null))[_0x3648('0x26')](respondWithResult(_0x2423a4,null))[_0x3648('0x4d')](handleError(_0x2423a4,null));};exports[_0x3648('0x4e')]=function(_0x3ace92,_0x13a52f){return db[_0x3648('0x2f')][_0x3648('0x4e')](_0x3ace92[_0x3648('0x4f')],{})['then'](respondWithResult(_0x13a52f,0xc9))['catch'](handleError(_0x13a52f,null));};exports['update']=function(_0x58d640,_0x48a450){if(_0x58d640[_0x3648('0x4f')]['id']){delete _0x58d640[_0x3648('0x4f')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x58d640[_0x3648('0x4b')]['id']}})[_0x3648('0x26')](handleEntityNotFound(_0x48a450,null))[_0x3648('0x26')](saveUpdates(_0x58d640['body'],null))[_0x3648('0x26')](respondWithResult(_0x48a450,null))[_0x3648('0x4d')](handleError(_0x48a450,null));};exports['destroy']=function(_0x24e89,_0x114d75){return db[_0x3648('0x2f')]['find']({'where':{'id':_0x24e89[_0x3648('0x4b')]['id']}})[_0x3648('0x26')](handleEntityNotFound(_0x114d75,null))[_0x3648('0x26')](removeEntity(_0x114d75,null))[_0x3648('0x4d')](handleError(_0x114d75,null));};exports['download']=function(_0x44ddef,_0x51c2d6,_0x237749){return db[_0x3648('0x2f')][_0x3648('0x4c')]({'where':{'id':_0x44ddef[_0x3648('0x4b')]['id']},'attributes':['id',_0x3648('0x50'),'msg_id']})[_0x3648('0x26')](handleEntityNotFound(_0x51c2d6,null))[_0x3648('0x26')](function(_0x11381a){if(_0x11381a){if(!_0x11381a[_0x3648('0x50')]){throw new db[(_0x3648('0x51'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x5900af={'Content-Type':_0x3648('0x52'),'Content-Disposition':_0x3648('0x53')};if(_0x11381a[_0x3648('0x54')]){_0x5900af['Content-Disposition']='attachment;\x20filename=\x22'+_0x11381a['msg_id']+'.wav\x22';}_0x51c2d6[_0x3648('0x21')](_0x5900af);return _0x51c2d6[_0x3648('0x2c')](new Buffer(_0x11381a[_0x3648('0x50')]));}})[_0x3648('0x4d')](handleError(_0x51c2d6,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 3f13558..c8a54f4 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 _0xb28a=['exports','define','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2819cd,_0x1f7703){var _0x47874c=function(_0x523698){while(--_0x523698){_0x2819cd['push'](_0x2819cd['shift']());}};_0x47874c(++_0x1f7703);}(_0xb28a,0xc4));var _0xab28=function(_0x16db77,_0x3e3661){_0x16db77=_0x16db77-0x0;var _0xc56994=_0xb28a[_0x16db77];return _0xc56994;};'use strict';var _=require(_0xab28('0x0'));var util=require(_0xab28('0x1'));var logger=require(_0xab28('0x2'))(_0xab28('0x3'));var moment=require(_0xab28('0x4'));var BPromise=require('bluebird');var rp=require(_0xab28('0x5'));var fs=require('fs');var path=require(_0xab28('0x6'));var rimraf=require(_0xab28('0x7'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0xab28('0x8')]=function(_0x19d2ca,_0x4f4cf4){return _0x19d2ca[_0xab28('0x9')]('VoiceMailMessage',attributes,{'tableName':_0xab28('0xa'),'paranoid':![],'indexes':[{'name':_0xab28('0xb'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x5446=['dir','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages'];(function(_0x3f5c7a,_0x28a535){var _0x33d8ed=function(_0x932d39){while(--_0x932d39){_0x3f5c7a['push'](_0x3f5c7a['shift']());}};_0x33d8ed(++_0x28a535);}(_0x5446,0x1a5));var _0x6544=function(_0x2aa93b,_0x29b50b){_0x2aa93b=_0x2aa93b-0x0;var _0x1baebc=_0x5446[_0x2aa93b];return _0x1baebc;};'use strict';var _=require(_0x6544('0x0'));var util=require(_0x6544('0x1'));var logger=require(_0x6544('0x2'))(_0x6544('0x3'));var moment=require(_0x6544('0x4'));var BPromise=require('bluebird');var rp=require(_0x6544('0x5'));var fs=require('fs');var path=require(_0x6544('0x6'));var rimraf=require(_0x6544('0x7'));var config=require(_0x6544('0x8'));var attributes=require(_0x6544('0x9'));module[_0x6544('0xa')]=function(_0x5d50cb,_0x590636){return _0x5d50cb[_0x6544('0xb')](_0x6544('0xc'),attributes,{'tableName':_0x6544('0xd'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x6544('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index befcd5a..33456b5 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 _0xbc04=['../../config/environment','jayson/promise','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xbc04,0x77));var _0x4bc0=function(_0x539a16,_0x4289a4){_0x539a16=_0x539a16-0x0;var _0xc8f8b2=_0xbc04[_0x539a16];return _0xc8f8b2;};'use strict';var _=require(_0x4bc0('0x0'));var util=require('util');var moment=require(_0x4bc0('0x1'));var BPromise=require(_0x4bc0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4bc0('0x3'));var db=require(_0x4bc0('0x4'))['db'];var utils=require(_0x4bc0('0x5'));var logger=require('../../config/logger')(_0x4bc0('0x6'));var config=require(_0x4bc0('0x7'));var jayson=require(_0x4bc0('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c8706,_0x22c2bb,_0x16cb96){return new BPromise(function(_0x3178d9,_0x483e6f){return client[_0x4bc0('0x9')](_0x4c8706,_0x16cb96)['then'](function(_0x53ddd0){logger[_0x4bc0('0xa')](_0x4bc0('0xb'),_0x22c2bb,_0x4bc0('0xc'));logger[_0x4bc0('0xd')](_0x4bc0('0xe'),_0x22c2bb,_0x4bc0('0xc'),JSON[_0x4bc0('0xf')](_0x53ddd0));if(_0x53ddd0[_0x4bc0('0x10')]){if(_0x53ddd0[_0x4bc0('0x10')][_0x4bc0('0x11')]===0x1f4){logger[_0x4bc0('0x10')](_0x4bc0('0xb'),_0x22c2bb,_0x53ddd0[_0x4bc0('0x10')][_0x4bc0('0x12')]);return _0x483e6f(_0x53ddd0['error']['message']);}logger[_0x4bc0('0x10')](_0x4bc0('0xb'),_0x22c2bb,_0x53ddd0[_0x4bc0('0x10')][_0x4bc0('0x12')]);return _0x3178d9(_0x53ddd0['error'][_0x4bc0('0x12')]);}else{logger[_0x4bc0('0xa')](_0x4bc0('0xb'),_0x22c2bb,_0x4bc0('0xc'));_0x3178d9(_0x53ddd0[_0x4bc0('0x13')][_0x4bc0('0x12')]);}})[_0x4bc0('0x14')](function(_0x125255){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x22c2bb,_0x125255);_0x483e6f(_0x125255);});});} \ No newline at end of file +var _0x8c27=['randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x504585,_0xd75a59){var _0x3e38b3=function(_0x3a2bac){while(--_0x3a2bac){_0x504585['push'](_0x504585['shift']());}};_0x3e38b3(++_0xd75a59);}(_0x8c27,0x1dd));var _0x78c2=function(_0x21ed1f,_0xabbc54){_0x21ed1f=_0x21ed1f-0x0;var _0x2d8da9=_0x8c27[_0x21ed1f];return _0x2d8da9;};'use strict';var _=require(_0x78c2('0x0'));var util=require('util');var moment=require(_0x78c2('0x1'));var BPromise=require(_0x78c2('0x2'));var rs=require(_0x78c2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78c2('0x4'))['db'];var utils=require(_0x78c2('0x5'));var logger=require(_0x78c2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x78c2('0x7'));var client=jayson[_0x78c2('0x8')][_0x78c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x339a61,_0x57f732,_0x329803){return new BPromise(function(_0x5ca282,_0xf2f642){return client['request'](_0x339a61,_0x329803)['then'](function(_0x2ba136){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x57f732,_0x78c2('0xa'));logger[_0x78c2('0xb')](_0x78c2('0xc'),_0x57f732,'request\x20sent',JSON[_0x78c2('0xd')](_0x2ba136));if(_0x2ba136[_0x78c2('0xe')]){if(_0x2ba136[_0x78c2('0xe')][_0x78c2('0xf')]===0x1f4){logger[_0x78c2('0xe')](_0x78c2('0x10'),_0x57f732,_0x2ba136[_0x78c2('0xe')]['message']);return _0xf2f642(_0x2ba136[_0x78c2('0xe')][_0x78c2('0x11')]);}logger[_0x78c2('0xe')](_0x78c2('0x10'),_0x57f732,_0x2ba136[_0x78c2('0xe')][_0x78c2('0x11')]);return _0x5ca282(_0x2ba136[_0x78c2('0xe')][_0x78c2('0x11')]);}else{logger['info'](_0x78c2('0x10'),_0x57f732,_0x78c2('0xa'));_0x5ca282(_0x2ba136[_0x78c2('0x12')]['message']);}})[_0x78c2('0x13')](function(_0x37ff8f){logger[_0x78c2('0xe')](_0x78c2('0x10'),_0x57f732,_0x37ff8f);_0xf2f642(_0x37ff8f);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 6bbf3d9..efbd2d6 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 _0x5317=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','index','/:id','show','get','/:id/sounds','isAuthenticated','post','create','put','destroy','/:id/sounds/:id2','removeSound','exports','multer'];(function(_0x31dcf0,_0x4024bb){var _0xd44f84=function(_0x3d30e0){while(--_0x3d30e0){_0x31dcf0['push'](_0x31dcf0['shift']());}};_0xd44f84(++_0x4024bb);}(_0x5317,0xbf));var _0x7531=function(_0xdb9a3a,_0x4ef6f2){_0xdb9a3a=_0xdb9a3a-0x0;var _0x5e224e=_0x5317[_0xdb9a3a];return _0x5e224e;};'use strict';var multer=require(_0x7531('0x0'));var util=require(_0x7531('0x1'));var path=require(_0x7531('0x2'));var timeout=require(_0x7531('0x3'));var express=require(_0x7531('0x4'));var router=express[_0x7531('0x5')]();var fs_extra=require(_0x7531('0x6'));var auth=require(_0x7531('0x7'));var interaction=require(_0x7531('0x8'));var config=require(_0x7531('0x9'));var controller=require(_0x7531('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x7531('0xb')]);router['get'](_0x7531('0xc'),auth['isAuthenticated'](),controller[_0x7531('0xd')]);router[_0x7531('0xe')](_0x7531('0xf'),auth[_0x7531('0x10')](),controller['getSounds']);router[_0x7531('0x11')]('/',auth[_0x7531('0x10')](),controller[_0x7531('0x12')]);router[_0x7531('0x11')]('/:id/sounds',auth[_0x7531('0x10')](),controller['addSound']);router[_0x7531('0x13')](_0x7531('0xc'),auth[_0x7531('0x10')](),controller['update']);router['delete']('/:id',auth[_0x7531('0x10')](),controller[_0x7531('0x14')]);router['delete'](_0x7531('0x15'),auth['isAuthenticated'](),controller[_0x7531('0x16')]);module[_0x7531('0x17')]=router; \ No newline at end of file +var _0x4f0b=['/:id/sounds/:id2','removeSound','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','/:id/sounds','getSounds','post','create','addSound','put','/:id','update','delete'];(function(_0x265dcc,_0x1bee8c){var _0x5adb7e=function(_0x3bbc7a){while(--_0x3bbc7a){_0x265dcc['push'](_0x265dcc['shift']());}};_0x5adb7e(++_0x1bee8c);}(_0x4f0b,0x14d));var _0xb4f0=function(_0x3ad276,_0x4a804c){_0x3ad276=_0x3ad276-0x0;var _0x2e6882=_0x4f0b[_0x3ad276];return _0x2e6882;};'use strict';var multer=require(_0xb4f0('0x0'));var util=require('util');var path=require(_0xb4f0('0x1'));var timeout=require(_0xb4f0('0x2'));var express=require(_0xb4f0('0x3'));var router=express['Router']();var fs_extra=require(_0xb4f0('0x4'));var auth=require(_0xb4f0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb4f0('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0xb4f0('0x7')]('/',auth[_0xb4f0('0x8')](),controller['index']);router[_0xb4f0('0x7')]('/:id',auth[_0xb4f0('0x8')](),controller[_0xb4f0('0x9')]);router[_0xb4f0('0x7')](_0xb4f0('0xa'),auth[_0xb4f0('0x8')](),controller[_0xb4f0('0xb')]);router[_0xb4f0('0xc')]('/',auth[_0xb4f0('0x8')](),controller[_0xb4f0('0xd')]);router[_0xb4f0('0xc')](_0xb4f0('0xa'),auth[_0xb4f0('0x8')](),controller[_0xb4f0('0xe')]);router[_0xb4f0('0xf')](_0xb4f0('0x10'),auth['isAuthenticated'](),controller[_0xb4f0('0x11')]);router[_0xb4f0('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xb4f0('0x12')](_0xb4f0('0x13'),auth[_0xb4f0('0x8')](),controller[_0xb4f0('0x14')]);module[_0xb4f0('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 9451c1f..517242a 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 _0xc2df=['exports','STRING','name','custom','mp3nb','quietmp3nb','quietmp3','mp3','files','alpha','TIMESTAMP','sequelize'];(function(_0xa77b,_0x407b3b){var _0x3fdf0e=function(_0x3c64bb){while(--_0x3c64bb){_0xa77b['push'](_0xa77b['shift']());}};_0x3fdf0e(++_0x407b3b);}(_0xc2df,0xfb));var _0xfc2d=function(_0x456275,_0x4b4bd4){_0x456275=_0x456275-0x0;var _0x373e41=_0xc2df[_0x456275];return _0x373e41;};'use strict';var Sequelize=require(_0xfc2d('0x0'));module[_0xfc2d('0x1')]={'name':{'type':Sequelize[_0xfc2d('0x2')],'allowNull':![],'unique':_0xfc2d('0x3')},'mode':{'type':Sequelize['ENUM'](_0xfc2d('0x4'),'files',_0xfc2d('0x5'),_0xfc2d('0x6'),_0xfc2d('0x7'),_0xfc2d('0x8')),'allowNull':!![],'defaultValue':_0xfc2d('0x9')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xfc2d('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xfc2d('0x2')],'allowNull':!![],'defaultValue':_0xfc2d('0xa')},'format':{'type':Sequelize[_0xfc2d('0x2')],'allowNull':!![]},'stamp':{'type':_0xfc2d('0xb')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc81b=['TIMESTAMP','STRING','name','ENUM','custom','files','mp3nb','quietmp3','mp3','alpha'];(function(_0x1c1517,_0x2e8bb3){var _0x4e9308=function(_0x3f2614){while(--_0x3f2614){_0x1c1517['push'](_0x1c1517['shift']());}};_0x4e9308(++_0x2e8bb3);}(_0xc81b,0x19b));var _0xbc81=function(_0x462ff3,_0x2167f4){_0x462ff3=_0x462ff3-0x0;var _0x5755c6=_0xc81b[_0x462ff3];return _0x5755c6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbc81('0x0')],'allowNull':![],'unique':_0xbc81('0x1')},'mode':{'type':Sequelize[_0xbc81('0x2')](_0xbc81('0x3'),_0xbc81('0x4'),_0xbc81('0x5'),'quietmp3nb',_0xbc81('0x6'),_0xbc81('0x7')),'allowNull':!![],'defaultValue':_0xbc81('0x4')},'directory':{'type':Sequelize[_0xbc81('0x0')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xbc81('0x0')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xbc81('0x8')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xbc81('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 713ee0b..1e0c76d 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 _0x2582=['destroy','get','MusicOnHolds','UserProfileResource','send','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','body','find','create','sequelize','mode','files','directory','join','root','mkdirSync','user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','format','%s.%s','save_name','converted_format','server/files/moh','symlinkSync','removeSound','createdAt','getSounds','order','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then'];(function(_0x3fd051,_0x35cf6a){var _0x3b7cde=function(_0x123351){while(--_0x123351){_0x3fd051['push'](_0x3fd051['shift']());}};_0x3b7cde(++_0x35cf6a);}(_0x2582,0x129));var _0x2258=function(_0x5706fb,_0xacfe3c){_0x5706fb=_0x5706fb-0x0;var _0x21799d=_0x2582[_0x5706fb];return _0x21799d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2258('0x0'));var zipdir=require(_0x2258('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2258('0x2'));var moment=require(_0x2258('0x3'));var BPromise=require(_0x2258('0x4'));var Mustache=require(_0x2258('0x5'));var util=require(_0x2258('0x6'));var path=require(_0x2258('0x7'));var sox=require(_0x2258('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2258('0x9'));var squel=require(_0x2258('0xa'));var crypto=require(_0x2258('0xb'));var jsforce=require(_0x2258('0xc'));var deskjs=require(_0x2258('0xd'));var toCsv=require(_0x2258('0xe'));var querystring=require(_0x2258('0xf'));var Papa=require(_0x2258('0x10'));var Redis=require(_0x2258('0x11'));var authService=require(_0x2258('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2258('0x13'));var hardwareService=require(_0x2258('0x14'));var logger=require(_0x2258('0x15'))(_0x2258('0x16'));var utils=require(_0x2258('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2258('0x18'));var db=require(_0x2258('0x19'))['db'];function respondWithStatusCode(_0x1d480d,_0x98dd12){_0x98dd12=_0x98dd12||0xcc;return function(_0x4bc67e){if(_0x4bc67e){return _0x1d480d[_0x2258('0x1a')](_0x98dd12);}return _0x1d480d[_0x2258('0x1b')](_0x98dd12)[_0x2258('0x1c')]();};}function respondWithResult(_0x4342d0,_0x37436c){_0x37436c=_0x37436c||0xc8;return function(_0x206341){if(_0x206341){return _0x4342d0['status'](_0x37436c)['json'](_0x206341);}};}function respondWithFilteredResult(_0x291e68,_0x44222d){return function(_0x4c6db9){if(_0x4c6db9){var _0x1dc9ad=typeof _0x44222d[_0x2258('0x1d')]===_0x2258('0x1e')&&typeof _0x44222d[_0x2258('0x1f')]==='undefined';var _0x1fa126=_0x4c6db9[_0x2258('0x20')];var _0x3350e6=_0x1dc9ad?0x0:_0x44222d[_0x2258('0x1d')];var _0xff9e2=_0x1dc9ad?_0x4c6db9[_0x2258('0x20')]:_0x44222d['offset']+_0x44222d[_0x2258('0x1f')];var _0x9bacfb;if(_0xff9e2>=_0x1fa126){_0xff9e2=_0x1fa126;_0x9bacfb=0xc8;}else{_0x9bacfb=0xce;}_0x291e68['status'](_0x9bacfb);return _0x291e68['set'](_0x2258('0x21'),_0x3350e6+'-'+_0xff9e2+'/'+_0x1fa126)[_0x2258('0x22')](_0x4c6db9);}return null;};}function patchUpdates(_0x32e99f){return function(_0x3decca){try{jsonpatch[_0x2258('0x23')](_0x3decca,_0x32e99f,!![]);}catch(_0x326b46){return BPromise[_0x2258('0x24')](_0x326b46);}return _0x3decca['save']();};}function saveUpdates(_0x189a03,_0x26646f){return function(_0x49508e){if(_0x49508e){return _0x49508e[_0x2258('0x25')](_0x189a03)[_0x2258('0x26')](function(_0x3f29ba){return _0x3f29ba;});}return null;};}function removeEntity(_0x321b0b,_0x11f5db){return function(_0x4cf355){if(_0x4cf355){return _0x4cf355[_0x2258('0x27')]()[_0x2258('0x26')](function(){var _0x58b5d2=_0x4cf355[_0x2258('0x28')]({'plain':!![]});var _0x4ac196=_0x2258('0x29');return db[_0x2258('0x2a')][_0x2258('0x27')]({'where':{'type':_0x4ac196,'resourceId':_0x58b5d2['id']}})[_0x2258('0x26')](function(){return _0x4cf355;});})[_0x2258('0x26')](function(){_0x321b0b['status'](0xcc)[_0x2258('0x1c')]();});}};}function handleEntityNotFound(_0x49143b,_0x1df52a){return function(_0x6bec4b){if(!_0x6bec4b){_0x49143b[_0x2258('0x1a')](0x194);}return _0x6bec4b;};}function handleError(_0x48d925,_0x27f4c5){_0x27f4c5=_0x27f4c5||0x1f4;return function(_0x4d805b){logger['error'](_0x4d805b['stack']);if(_0x4d805b['name']){delete _0x4d805b['name'];}_0x48d925[_0x2258('0x1b')](_0x27f4c5)[_0x2258('0x2b')](_0x4d805b);};}exports['index']=function(_0x2c0ff4,_0xa4f53d){var _0x1f9099={},_0x3abe77={},_0xb5941d={'count':0x0,'rows':[]};var _0x3fbe67=_[_0x2258('0x2c')](db[_0x2258('0x2d')][_0x2258('0x2e')],function(_0x3a3906){return{'name':_0x3a3906[_0x2258('0x2f')],'type':_0x3a3906['type'][_0x2258('0x30')]};});_0x3abe77[_0x2258('0x31')]=_[_0x2258('0x2c')](_0x3fbe67,_0x2258('0x32'));_0x3abe77[_0x2258('0x33')]=_['keys'](_0x2c0ff4[_0x2258('0x33')]);_0x3abe77[_0x2258('0x34')]=_[_0x2258('0x35')](_0x3abe77[_0x2258('0x31')],_0x3abe77[_0x2258('0x33')]);_0x1f9099[_0x2258('0x36')]=_['intersection'](_0x3abe77[_0x2258('0x31')],qs[_0x2258('0x37')](_0x2c0ff4[_0x2258('0x33')][_0x2258('0x37')]));_0x1f9099['attributes']=_0x1f9099[_0x2258('0x36')][_0x2258('0x38')]?_0x1f9099['attributes']:_0x3abe77[_0x2258('0x31')];if(!_0x2c0ff4[_0x2258('0x33')][_0x2258('0x39')](_0x2258('0x3a'))){_0x1f9099['limit']=qs[_0x2258('0x1f')](_0x2c0ff4['query'][_0x2258('0x1f')]);_0x1f9099['offset']=qs['offset'](_0x2c0ff4[_0x2258('0x33')][_0x2258('0x1d')]);}_0x1f9099['order']=qs[_0x2258('0x3b')](_0x2c0ff4[_0x2258('0x33')][_0x2258('0x3b')]);delete _0x2c0ff4[_0x2258('0x33')][_0x2258('0x3b')];_0x1f9099[_0x2258('0x3c')]=qs[_0x2258('0x34')](_[_0x2258('0x3d')](_0x2c0ff4['query'],_0x3abe77[_0x2258('0x34')]),_0x3fbe67);if(_0x2c0ff4[_0x2258('0x33')][_0x2258('0x3e')]){_0x1f9099[_0x2258('0x3c')]=_['merge'](_0x1f9099['where'],{'$or':_[_0x2258('0x2c')](_0x3fbe67,function(_0x465892){if(_0x465892[_0x2258('0x3f')]!==_0x2258('0x40')){var _0x168f1c={};_0x168f1c[_0x465892['name']]={'$like':'%'+_0x2c0ff4['query'][_0x2258('0x3e')]+'%'};return _0x168f1c;}})});}_0x1f9099=_[_0x2258('0x41')]({},_0x1f9099,_0x2c0ff4[_0x2258('0x42')]);var _0x49a34f={'where':_0x1f9099['where']};return db[_0x2258('0x2d')]['count'](_0x49a34f)[_0x2258('0x26')](function(_0x4f1127){_0xb5941d[_0x2258('0x20')]=_0x4f1127;if(_0x2c0ff4[_0x2258('0x33')]['includeAll']){_0x1f9099[_0x2258('0x43')]=[{'all':!![]}];}return db[_0x2258('0x2d')][_0x2258('0x44')](_0x1f9099);})['then'](function(_0x14fe2b){_0xb5941d[_0x2258('0x45')]=_0x14fe2b;return _0xb5941d;})[_0x2258('0x26')](respondWithFilteredResult(_0xa4f53d,_0x1f9099))[_0x2258('0x46')](handleError(_0xa4f53d,null));};exports[_0x2258('0x47')]=function(_0x4e45ad,_0x23daf2){var _0x26ab31={'raw':![],'where':{'id':_0x4e45ad[_0x2258('0x48')]['id']}},_0x5a51a0={};_0x5a51a0['model']=_[_0x2258('0x49')](db[_0x2258('0x2d')][_0x2258('0x2e')]);_0x5a51a0[_0x2258('0x33')]=_[_0x2258('0x49')](_0x4e45ad['query']);_0x5a51a0[_0x2258('0x34')]=_[_0x2258('0x35')](_0x5a51a0[_0x2258('0x31')],_0x5a51a0[_0x2258('0x33')]);_0x26ab31[_0x2258('0x36')]=_[_0x2258('0x35')](_0x5a51a0[_0x2258('0x31')],qs[_0x2258('0x37')](_0x4e45ad['query'][_0x2258('0x37')]));_0x26ab31['attributes']=_0x26ab31[_0x2258('0x36')][_0x2258('0x38')]?_0x26ab31['attributes']:_0x5a51a0[_0x2258('0x31')];if(_0x4e45ad['query'][_0x2258('0x4a')]){_0x26ab31[_0x2258('0x43')]=[{'all':!![]}];}_0x26ab31=_[_0x2258('0x41')]({},_0x26ab31,_0x4e45ad[_0x2258('0x42')]);return db[_0x2258('0x2d')]['find'](_0x26ab31)['then'](handleEntityNotFound(_0x23daf2,null))[_0x2258('0x26')](respondWithResult(_0x23daf2,null))[_0x2258('0x46')](handleError(_0x23daf2,null));};exports[_0x2258('0x25')]=function(_0x24f8e0,_0x135389){if(_0x24f8e0[_0x2258('0x4b')]['id']){delete _0x24f8e0[_0x2258('0x4b')]['id'];}return db[_0x2258('0x2d')][_0x2258('0x4c')]({'where':{'id':_0x24f8e0[_0x2258('0x48')]['id']}})['then'](handleEntityNotFound(_0x135389,null))[_0x2258('0x26')](saveUpdates(_0x24f8e0[_0x2258('0x4b')],null))['then'](respondWithResult(_0x135389,null))[_0x2258('0x46')](handleError(_0x135389,null));};exports[_0x2258('0x4d')]=function(_0xb828e5,_0x5636fe,_0x2f5f6d){return db[_0x2258('0x4e')]['transaction'](function(_0x57babc){if(_0xb828e5['body'][_0x2258('0x4f')]===_0x2258('0x50')){_0xb828e5['body'][_0x2258('0x51')]=path[_0x2258('0x52')](config[_0x2258('0x53')],'server/files/moh',_0xb828e5[_0x2258('0x4b')][_0x2258('0x32')]);}return db[_0x2258('0x2d')][_0x2258('0x4d')](_0xb828e5['body'],{'transaction':_0x57babc})[_0x2258('0x26')](function(_0x5885ca){if(_0xb828e5[_0x2258('0x4b')][_0x2258('0x4f')]==='files'){fs[_0x2258('0x54')](_0x5885ca['directory'],parseInt('0777',0x8));}var _0x13c3da=_0xb828e5[_0x2258('0x55')]['get']({'plain':!![]});if(!_0x13c3da)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13c3da[_0x2258('0x56')]===_0x2258('0x55')){var _0x9bbedc=_0x5885ca['get']({'plain':!![]});return db[_0x2258('0x57')]['find']({'where':{'name':_0x2258('0x29'),'userProfileId':_0x13c3da['userProfileId']},'raw':!![]})[_0x2258('0x26')](function(_0x29f77b){if(_0x29f77b&&_0x29f77b[_0x2258('0x58')]===0x0){return db[_0x2258('0x2a')][_0x2258('0x4d')]({'name':_0x9bbedc[_0x2258('0x32')],'resourceId':_0x9bbedc['id'],'type':_0x29f77b[_0x2258('0x32')],'sectionId':_0x29f77b['id']},{})['then'](function(){return _0x5885ca;});}else{return _0x5885ca;}})[_0x2258('0x46')](function(_0x4e7a9a){logger[_0x2258('0x59')](_0x2258('0x5a'),_0x4e7a9a);});}return _0x5885ca;});})[_0x2258('0x26')](respondWithResult(_0x5636fe,0xc9))['catch'](handleError(_0x5636fe,null));};exports[_0x2258('0x27')]=function(_0x4595e1,_0x3c25d4,_0x4f4b65){var _0x337767;return db[_0x2258('0x2d')][_0x2258('0x4c')]({'where':{'id':_0x4595e1[_0x2258('0x48')]['id']}})[_0x2258('0x26')](function(_0xc0df56){if(_0xc0df56){return db['sequelize'][_0x2258('0x5b')](function(_0x27b747){return _0xc0df56[_0x2258('0x27')]({'transaction':_0x27b747,'raw':!![]})[_0x2258('0x26')](function(_0x2c2cc9){if(_0x2c2cc9['directory']){fs[_0x2258('0x5c')](_0x2c2cc9['directory'])[_0x2258('0x5d')](function(_0x22dad6){fs[_0x2258('0x5e')](path[_0x2258('0x52')](_0x2c2cc9[_0x2258('0x51')],_0x22dad6));});fs[_0x2258('0x5f')](_0x2c2cc9[_0x2258('0x51')]);}return _0x2c2cc9;});})[_0x2258('0x46')](function(_0x2251ae){throw new db[(_0x2258('0x60'))][(_0x2258('0x61'))](_0x2251ae[_0x2258('0x62')]);});}})[_0x2258('0x26')](handleEntityNotFound(_0x3c25d4,null))[_0x2258('0x26')](removeEntity(_0x3c25d4,null))[_0x2258('0x46')](handleError(_0x3c25d4,null));};exports[_0x2258('0x63')]=function(_0x156db7,_0x1c3ea1,_0x34383e){return db[_0x2258('0x4e')]['transaction'](function(_0x3747d1){var _0x574250;return db[_0x2258('0x2d')][_0x2258('0x4c')]({'where':{'id':_0x156db7[_0x2258('0x48')]['id']}})[_0x2258('0x26')](function(_0x3ab442){if(_0x3ab442){_0x574250=_0x3ab442;return _0x3ab442[_0x2258('0x63')](_0x156db7[_0x2258('0x4b')]['id'],{'transaction':_0x3747d1});}})['then'](function(_0x3dcf14){if(_0x3dcf14){return db[_0x2258('0x64')][_0x2258('0x65')]({'where':{'id':_0x156db7[_0x2258('0x4b')]['id']},'attributes':['id','name','save_name','converted_format','createdAt'],'raw':!![]});}})[_0x2258('0x26')](function(_0x4436d8){if(_0x4436d8){var _0x3029f0=path['join'](config[_0x2258('0x53')],'server/files/sounds/converted',util[_0x2258('0x66')](_0x2258('0x67'),path['basename'](_0x4436d8['save_name'],path['extname'](_0x4436d8[_0x2258('0x68')])),_0x4436d8[_0x2258('0x69')]));var _0x4bc8eb=path[_0x2258('0x52')](config[_0x2258('0x53')],_0x2258('0x6a'),_0x574250[_0x2258('0x32')],util['format'](_0x2258('0x67'),_0x4436d8['name'],_0x4436d8['converted_format']));fs[_0x2258('0x6b')](_0x3029f0,_0x4bc8eb);return _0x4436d8;}})[_0x2258('0x46')](function(_0x28e998){throw new db['Sequelize'][(_0x2258('0x61'))](_0x28e998[_0x2258('0x62')]);});})[_0x2258('0x26')](handleEntityNotFound(_0x1c3ea1,null))[_0x2258('0x26')](respondWithResult(_0x1c3ea1,0xc9))[_0x2258('0x46')](handleError(_0x1c3ea1,null));};exports['removeSound']=function(_0x18e907,_0x502e28,_0x3073e8){return db['sequelize']['transaction'](function(_0x3baf4a){var _0x510ebe;return db[_0x2258('0x2d')]['findOne']({'where':{'id':_0x18e907[_0x2258('0x48')]['id']}})[_0x2258('0x26')](handleEntityNotFound(_0x502e28,null))['then'](function(_0xde581b){if(_0xde581b){_0x510ebe=_0xde581b;return _0xde581b[_0x2258('0x6c')](_0x18e907[_0x2258('0x48')]['id2']);}})[_0x2258('0x26')](function(_0x2c27d6){if(_0x2c27d6){return db[_0x2258('0x64')]['findOne']({'where':{'id':_0x18e907[_0x2258('0x48')]['id2']},'attributes':['id',_0x2258('0x32'),_0x2258('0x68'),_0x2258('0x69'),_0x2258('0x6d')],'raw':!![]});}})[_0x2258('0x26')](function(_0x4f25c9){if(_0x4f25c9){fs['unlinkSync'](path[_0x2258('0x52')](_0x510ebe['directory'],util[_0x2258('0x66')]('%s.%s',_0x4f25c9[_0x2258('0x32')],_0x4f25c9['converted_format'])));return _0x4f25c9;}})['catch'](function(_0x62575d){throw new db[(_0x2258('0x60'))][(_0x2258('0x61'))](_0x62575d[_0x2258('0x62')]);});})[_0x2258('0x26')](handleEntityNotFound(_0x502e28,null))[_0x2258('0x26')](respondWithStatusCode(_0x502e28,0xcc))[_0x2258('0x46')](handleError(_0x502e28,null));};exports[_0x2258('0x6e')]=function(_0x1ca525,_0x4dd0c3,_0x2b3624){var _0xc49953={};var _0x554113={};var _0x389d5f;var _0x5110ba;return db[_0x2258('0x2d')]['findOne']({'where':{'id':_0x1ca525[_0x2258('0x48')]['id']}})[_0x2258('0x26')](handleEntityNotFound(_0x4dd0c3,null))[_0x2258('0x26')](function(_0x264c0d){if(_0x264c0d){_0x389d5f=_0x264c0d;_0x554113['model']=_[_0x2258('0x49')](db[_0x2258('0x64')][_0x2258('0x2e')]);_0x554113[_0x2258('0x33')]=_[_0x2258('0x49')](_0x1ca525['query']);_0x554113[_0x2258('0x34')]=_[_0x2258('0x35')](_0x554113[_0x2258('0x31')],_0x554113[_0x2258('0x33')]);_0xc49953[_0x2258('0x36')]=_[_0x2258('0x35')](_0x554113[_0x2258('0x31')],qs[_0x2258('0x37')](_0x1ca525['query'][_0x2258('0x37')]));_0xc49953[_0x2258('0x36')]=_0xc49953[_0x2258('0x36')][_0x2258('0x38')]?_0xc49953[_0x2258('0x36')]:_0x554113[_0x2258('0x31')];_0xc49953[_0x2258('0x6f')]=qs['sort'](_0x1ca525['query'][_0x2258('0x3b')]);_0xc49953['where']=qs['filters'](_[_0x2258('0x3d')](_0x1ca525[_0x2258('0x33')],_0x554113['filters']));if(_0x1ca525[_0x2258('0x33')][_0x2258('0x3e')]){_0xc49953['where']=_[_0x2258('0x41')](_0xc49953[_0x2258('0x3c')],{'$or':_[_0x2258('0x2c')](_0xc49953[_0x2258('0x36')],function(_0x1a14db){var _0xdc6aa2={};_0xdc6aa2[_0x1a14db]={'$like':'%'+_0x1ca525[_0x2258('0x33')][_0x2258('0x3e')]+'%'};return _0xdc6aa2;})});}_0xc49953=_[_0x2258('0x41')]({},_0xc49953,_0x1ca525[_0x2258('0x42')]);return _0x389d5f[_0x2258('0x6e')](_0xc49953);}})[_0x2258('0x26')](function(_0x2fdc04){if(_0x2fdc04){_0x5110ba=_0x2fdc04[_0x2258('0x38')];if(!_0x1ca525[_0x2258('0x33')]['hasOwnProperty']('nolimit')){_0xc49953[_0x2258('0x1f')]=qs['limit'](_0x1ca525['query'][_0x2258('0x1f')]);_0xc49953[_0x2258('0x1d')]=qs[_0x2258('0x1d')](_0x1ca525[_0x2258('0x33')][_0x2258('0x1d')]);}return _0x389d5f[_0x2258('0x6e')](_0xc49953);}})[_0x2258('0x26')](function(_0x6ad252){if(_0x6ad252){return _0x6ad252?{'count':_0x5110ba,'rows':_0x6ad252}:null;}})[_0x2258('0x26')](respondWithResult(_0x4dd0c3,null))[_0x2258('0x46')](handleError(_0x4dd0c3,null));}; \ No newline at end of file +var _0xb864=['destroy','get','MusicOnHolds','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','VoiceMusicOnHold','includeAll','include','findAll','rows','catch','keys','filters','body','find','create','files','root','server/files/moh','mode','0777','user','userProfileId','autoAssociation','UserProfileResource','params','sequelize','transaction','directory','forEach','unlinkSync','join','rmdirSync','Sequelize','message','addSound','save_name','createdAt','format','%s.%s','basename','extname','converted_format','symlinkSync','removeSound','findOne','id2','Sound','ValidationError','getSounds','pick','eml-format','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','update'];(function(_0x214293,_0x209e21){var _0x4dfa38=function(_0x290051){while(--_0x290051){_0x214293['push'](_0x214293['shift']());}};_0x4dfa38(++_0x209e21);}(_0xb864,0x180));var _0x4b86=function(_0x209bf9,_0x5f4d82){_0x209bf9=_0x209bf9-0x0;var _0x3b6165=_0xb864[_0x209bf9];return _0x3b6165;};'use strict';var emlformat=require(_0x4b86('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4b86('0x1'));var rp=require(_0x4b86('0x2'));var moment=require(_0x4b86('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4b86('0x4'));var sox=require(_0x4b86('0x5'));var csv=require(_0x4b86('0x6'));var ejs=require(_0x4b86('0x7'));var fs=require('fs');var fs_extra=require(_0x4b86('0x8'));var _=require(_0x4b86('0x9'));var squel=require(_0x4b86('0xa'));var crypto=require(_0x4b86('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4b86('0x6'));var querystring=require(_0x4b86('0xc'));var Papa=require(_0x4b86('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4b86('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b86('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4b86('0x10'));var db=require(_0x4b86('0x11'))['db'];function respondWithStatusCode(_0x22fc80,_0x1d387f){_0x1d387f=_0x1d387f||0xcc;return function(_0x12ca52){if(_0x12ca52){return _0x22fc80[_0x4b86('0x12')](_0x1d387f);}return _0x22fc80[_0x4b86('0x13')](_0x1d387f)['end']();};}function respondWithResult(_0x10a27d,_0x4eab15){_0x4eab15=_0x4eab15||0xc8;return function(_0x355220){if(_0x355220){return _0x10a27d['status'](_0x4eab15)[_0x4b86('0x14')](_0x355220);}};}function respondWithFilteredResult(_0x1ad812,_0x293714){return function(_0x2bdec7){if(_0x2bdec7){var _0x2cf1d2=typeof _0x293714[_0x4b86('0x15')]===_0x4b86('0x16')&&typeof _0x293714[_0x4b86('0x17')]===_0x4b86('0x16');var _0x226f8e=_0x2bdec7[_0x4b86('0x18')];var _0x763a7e=_0x2cf1d2?0x0:_0x293714[_0x4b86('0x15')];var _0x59a9f8=_0x2cf1d2?_0x2bdec7[_0x4b86('0x18')]:_0x293714['offset']+_0x293714[_0x4b86('0x17')];var _0x494a03;if(_0x59a9f8>=_0x226f8e){_0x59a9f8=_0x226f8e;_0x494a03=0xc8;}else{_0x494a03=0xce;}_0x1ad812[_0x4b86('0x13')](_0x494a03);return _0x1ad812['set']('Content-Range',_0x763a7e+'-'+_0x59a9f8+'/'+_0x226f8e)[_0x4b86('0x14')](_0x2bdec7);}return null;};}function patchUpdates(_0x35c5d9){return function(_0x738ae2){try{jsonpatch[_0x4b86('0x19')](_0x738ae2,_0x35c5d9,!![]);}catch(_0x2b27d0){return BPromise[_0x4b86('0x1a')](_0x2b27d0);}return _0x738ae2['save']();};}function saveUpdates(_0xdac011,_0x39a67e){return function(_0x574fed){if(_0x574fed){return _0x574fed[_0x4b86('0x1b')](_0xdac011)['then'](function(_0x2de1d7){return _0x2de1d7;});}return null;};}function removeEntity(_0x462737,_0x5c16f2){return function(_0x22e469){if(_0x22e469){return _0x22e469[_0x4b86('0x1c')]()['then'](function(){var _0x3616e9=_0x22e469[_0x4b86('0x1d')]({'plain':!![]});var _0x4cabf4=_0x4b86('0x1e');return db['UserProfileResource'][_0x4b86('0x1c')]({'where':{'type':_0x4cabf4,'resourceId':_0x3616e9['id']}})[_0x4b86('0x1f')](function(){return _0x22e469;});})[_0x4b86('0x1f')](function(){_0x462737[_0x4b86('0x13')](0xcc)[_0x4b86('0x20')]();});}};}function handleEntityNotFound(_0x1fe77b,_0x26c5e9){return function(_0xa5c849){if(!_0xa5c849){_0x1fe77b[_0x4b86('0x12')](0x194);}return _0xa5c849;};}function handleError(_0x3ea4a0,_0x555157){_0x555157=_0x555157||0x1f4;return function(_0x44b07b){logger[_0x4b86('0x21')](_0x44b07b[_0x4b86('0x22')]);if(_0x44b07b['name']){delete _0x44b07b[_0x4b86('0x23')];}_0x3ea4a0[_0x4b86('0x13')](_0x555157)[_0x4b86('0x24')](_0x44b07b);};}exports[_0x4b86('0x25')]=function(_0x1b2b63,_0x4952b1){var _0x34bf98={},_0xc1a065={},_0x1a2653={'count':0x0,'rows':[]};var _0x45754f=_[_0x4b86('0x26')](db['VoiceMusicOnHold'][_0x4b86('0x27')],function(_0x3a5498){return{'name':_0x3a5498[_0x4b86('0x28')],'type':_0x3a5498[_0x4b86('0x29')]['key']};});_0xc1a065[_0x4b86('0x2a')]=_[_0x4b86('0x26')](_0x45754f,_0x4b86('0x23'));_0xc1a065['query']=_['keys'](_0x1b2b63[_0x4b86('0x2b')]);_0xc1a065['filters']=_[_0x4b86('0x2c')](_0xc1a065[_0x4b86('0x2a')],_0xc1a065['query']);_0x34bf98[_0x4b86('0x2d')]=_[_0x4b86('0x2c')](_0xc1a065[_0x4b86('0x2a')],qs[_0x4b86('0x2e')](_0x1b2b63[_0x4b86('0x2b')][_0x4b86('0x2e')]));_0x34bf98['attributes']=_0x34bf98[_0x4b86('0x2d')][_0x4b86('0x2f')]?_0x34bf98[_0x4b86('0x2d')]:_0xc1a065[_0x4b86('0x2a')];if(!_0x1b2b63[_0x4b86('0x2b')][_0x4b86('0x30')](_0x4b86('0x31'))){_0x34bf98[_0x4b86('0x17')]=qs[_0x4b86('0x17')](_0x1b2b63[_0x4b86('0x2b')]['limit']);_0x34bf98['offset']=qs[_0x4b86('0x15')](_0x1b2b63[_0x4b86('0x2b')][_0x4b86('0x15')]);}_0x34bf98[_0x4b86('0x32')]=qs[_0x4b86('0x33')](_0x1b2b63['query'][_0x4b86('0x33')]);delete _0x1b2b63['query'][_0x4b86('0x33')];_0x34bf98['where']=qs['filters'](_['pick'](_0x1b2b63[_0x4b86('0x2b')],_0xc1a065['filters']),_0x45754f);if(_0x1b2b63[_0x4b86('0x2b')][_0x4b86('0x34')]){_0x34bf98[_0x4b86('0x35')]=_[_0x4b86('0x36')](_0x34bf98[_0x4b86('0x35')],{'$or':_[_0x4b86('0x26')](_0x45754f,function(_0x2162fe){if(_0x2162fe[_0x4b86('0x29')]!==_0x4b86('0x37')){var _0x36dd11={};_0x36dd11[_0x2162fe[_0x4b86('0x23')]]={'$like':'%'+_0x1b2b63[_0x4b86('0x2b')]['filter']+'%'};return _0x36dd11;}})});}_0x34bf98=_[_0x4b86('0x36')]({},_0x34bf98,_0x1b2b63[_0x4b86('0x38')]);var _0x26f3f3={'where':_0x34bf98['where']};return db[_0x4b86('0x39')]['count'](_0x26f3f3)[_0x4b86('0x1f')](function(_0x5d5252){_0x1a2653[_0x4b86('0x18')]=_0x5d5252;if(_0x1b2b63[_0x4b86('0x2b')][_0x4b86('0x3a')]){_0x34bf98[_0x4b86('0x3b')]=[{'all':!![]}];}return db[_0x4b86('0x39')][_0x4b86('0x3c')](_0x34bf98);})['then'](function(_0x1676a4){_0x1a2653[_0x4b86('0x3d')]=_0x1676a4;return _0x1a2653;})[_0x4b86('0x1f')](respondWithFilteredResult(_0x4952b1,_0x34bf98))[_0x4b86('0x3e')](handleError(_0x4952b1,null));};exports['show']=function(_0xa4fc42,_0x53be59){var _0x42cd3f={'raw':![],'where':{'id':_0xa4fc42['params']['id']}},_0x398737={};_0x398737[_0x4b86('0x2a')]=_['keys'](db['VoiceMusicOnHold']['rawAttributes']);_0x398737['query']=_[_0x4b86('0x3f')](_0xa4fc42[_0x4b86('0x2b')]);_0x398737[_0x4b86('0x40')]=_[_0x4b86('0x2c')](_0x398737[_0x4b86('0x2a')],_0x398737[_0x4b86('0x2b')]);_0x42cd3f['attributes']=_[_0x4b86('0x2c')](_0x398737[_0x4b86('0x2a')],qs[_0x4b86('0x2e')](_0xa4fc42[_0x4b86('0x2b')][_0x4b86('0x2e')]));_0x42cd3f[_0x4b86('0x2d')]=_0x42cd3f['attributes'][_0x4b86('0x2f')]?_0x42cd3f[_0x4b86('0x2d')]:_0x398737['model'];if(_0xa4fc42[_0x4b86('0x2b')][_0x4b86('0x3a')]){_0x42cd3f[_0x4b86('0x3b')]=[{'all':!![]}];}_0x42cd3f=_['merge']({},_0x42cd3f,_0xa4fc42[_0x4b86('0x38')]);return db['VoiceMusicOnHold']['find'](_0x42cd3f)[_0x4b86('0x1f')](handleEntityNotFound(_0x53be59,null))[_0x4b86('0x1f')](respondWithResult(_0x53be59,null))[_0x4b86('0x3e')](handleError(_0x53be59,null));};exports[_0x4b86('0x1b')]=function(_0x58b843,_0x30feda){if(_0x58b843[_0x4b86('0x41')]['id']){delete _0x58b843[_0x4b86('0x41')]['id'];}return db[_0x4b86('0x39')][_0x4b86('0x42')]({'where':{'id':_0x58b843['params']['id']}})[_0x4b86('0x1f')](handleEntityNotFound(_0x30feda,null))[_0x4b86('0x1f')](saveUpdates(_0x58b843[_0x4b86('0x41')],null))[_0x4b86('0x1f')](respondWithResult(_0x30feda,null))[_0x4b86('0x3e')](handleError(_0x30feda,null));};exports[_0x4b86('0x43')]=function(_0x395859,_0x4945b4,_0x2d0da1){return db['sequelize']['transaction'](function(_0x45c441){if(_0x395859[_0x4b86('0x41')]['mode']===_0x4b86('0x44')){_0x395859['body']['directory']=path['join'](config[_0x4b86('0x45')],_0x4b86('0x46'),_0x395859[_0x4b86('0x41')][_0x4b86('0x23')]);}return db['VoiceMusicOnHold'][_0x4b86('0x43')](_0x395859[_0x4b86('0x41')],{'transaction':_0x45c441})[_0x4b86('0x1f')](function(_0x5a940b){if(_0x395859['body'][_0x4b86('0x47')]===_0x4b86('0x44')){fs['mkdirSync'](_0x5a940b['directory'],parseInt(_0x4b86('0x48'),0x8));}var _0x34bd0f=_0x395859[_0x4b86('0x49')]['get']({'plain':!![]});if(!_0x34bd0f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x34bd0f['role']===_0x4b86('0x49')){var _0x1d09d5=_0x5a940b['get']({'plain':!![]});return db['UserProfileSection'][_0x4b86('0x42')]({'where':{'name':_0x4b86('0x1e'),'userProfileId':_0x34bd0f[_0x4b86('0x4a')]},'raw':!![]})[_0x4b86('0x1f')](function(_0x5d56d9){if(_0x5d56d9&&_0x5d56d9[_0x4b86('0x4b')]===0x0){return db[_0x4b86('0x4c')][_0x4b86('0x43')]({'name':_0x1d09d5['name'],'resourceId':_0x1d09d5['id'],'type':_0x5d56d9[_0x4b86('0x23')],'sectionId':_0x5d56d9['id']},{})[_0x4b86('0x1f')](function(){return _0x5a940b;});}else{return _0x5a940b;}})[_0x4b86('0x3e')](function(_0x4ff963){logger[_0x4b86('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ff963);});}return _0x5a940b;});})[_0x4b86('0x1f')](respondWithResult(_0x4945b4,0xc9))[_0x4b86('0x3e')](handleError(_0x4945b4,null));};exports['destroy']=function(_0x1ec0da,_0x2b59d3,_0x3e49a1){var _0x1d7147;return db[_0x4b86('0x39')][_0x4b86('0x42')]({'where':{'id':_0x1ec0da[_0x4b86('0x4d')]['id']}})[_0x4b86('0x1f')](function(_0x2f633d){if(_0x2f633d){return db[_0x4b86('0x4e')][_0x4b86('0x4f')](function(_0x227410){return _0x2f633d[_0x4b86('0x1c')]({'transaction':_0x227410,'raw':!![]})[_0x4b86('0x1f')](function(_0x31a1a3){if(_0x31a1a3[_0x4b86('0x50')]){fs['readdirSync'](_0x31a1a3['directory'])[_0x4b86('0x51')](function(_0x25e1df){fs[_0x4b86('0x52')](path[_0x4b86('0x53')](_0x31a1a3[_0x4b86('0x50')],_0x25e1df));});fs[_0x4b86('0x54')](_0x31a1a3[_0x4b86('0x50')]);}return _0x31a1a3;});})['catch'](function(_0x28f7be){throw new db[(_0x4b86('0x55'))]['ValidationError'](_0x28f7be[_0x4b86('0x56')]);});}})[_0x4b86('0x1f')](handleEntityNotFound(_0x2b59d3,null))[_0x4b86('0x1f')](removeEntity(_0x2b59d3,null))['catch'](handleError(_0x2b59d3,null));};exports[_0x4b86('0x57')]=function(_0x22645a,_0x3cc6df,_0x530715){return db[_0x4b86('0x4e')][_0x4b86('0x4f')](function(_0x16231c){var _0x3ad223;return db[_0x4b86('0x39')]['find']({'where':{'id':_0x22645a['params']['id']}})[_0x4b86('0x1f')](function(_0x35d878){if(_0x35d878){_0x3ad223=_0x35d878;return _0x35d878[_0x4b86('0x57')](_0x22645a[_0x4b86('0x41')]['id'],{'transaction':_0x16231c});}})[_0x4b86('0x1f')](function(_0x22fab4){if(_0x22fab4){return db['Sound']['findOne']({'where':{'id':_0x22645a['body']['id']},'attributes':['id',_0x4b86('0x23'),_0x4b86('0x58'),'converted_format',_0x4b86('0x59')],'raw':!![]});}})[_0x4b86('0x1f')](function(_0x2d1402){if(_0x2d1402){var _0x28810e=path[_0x4b86('0x53')](config['root'],'server/files/sounds/converted',util[_0x4b86('0x5a')](_0x4b86('0x5b'),path[_0x4b86('0x5c')](_0x2d1402[_0x4b86('0x58')],path[_0x4b86('0x5d')](_0x2d1402[_0x4b86('0x58')])),_0x2d1402[_0x4b86('0x5e')]));var _0x4b7a55=path[_0x4b86('0x53')](config[_0x4b86('0x45')],_0x4b86('0x46'),_0x3ad223[_0x4b86('0x23')],util[_0x4b86('0x5a')](_0x4b86('0x5b'),_0x2d1402[_0x4b86('0x23')],_0x2d1402[_0x4b86('0x5e')]));fs[_0x4b86('0x5f')](_0x28810e,_0x4b7a55);return _0x2d1402;}})[_0x4b86('0x3e')](function(_0xd951af){throw new db[(_0x4b86('0x55'))]['ValidationError'](_0xd951af['message']);});})[_0x4b86('0x1f')](handleEntityNotFound(_0x3cc6df,null))[_0x4b86('0x1f')](respondWithResult(_0x3cc6df,0xc9))[_0x4b86('0x3e')](handleError(_0x3cc6df,null));};exports[_0x4b86('0x60')]=function(_0xc9314c,_0xa17a1d,_0x3d3668){return db[_0x4b86('0x4e')][_0x4b86('0x4f')](function(_0x31ae62){var _0x303e22;return db[_0x4b86('0x39')][_0x4b86('0x61')]({'where':{'id':_0xc9314c[_0x4b86('0x4d')]['id']}})[_0x4b86('0x1f')](handleEntityNotFound(_0xa17a1d,null))['then'](function(_0x3136a3){if(_0x3136a3){_0x303e22=_0x3136a3;return _0x3136a3[_0x4b86('0x60')](_0xc9314c['params'][_0x4b86('0x62')]);}})[_0x4b86('0x1f')](function(_0x1e7206){if(_0x1e7206){return db[_0x4b86('0x63')]['findOne']({'where':{'id':_0xc9314c[_0x4b86('0x4d')][_0x4b86('0x62')]},'attributes':['id',_0x4b86('0x23'),_0x4b86('0x58'),_0x4b86('0x5e'),_0x4b86('0x59')],'raw':!![]});}})[_0x4b86('0x1f')](function(_0x233fe5){if(_0x233fe5){fs[_0x4b86('0x52')](path['join'](_0x303e22['directory'],util['format'](_0x4b86('0x5b'),_0x233fe5[_0x4b86('0x23')],_0x233fe5['converted_format'])));return _0x233fe5;}})[_0x4b86('0x3e')](function(_0x15dca9){throw new db[(_0x4b86('0x55'))][(_0x4b86('0x64'))](_0x15dca9[_0x4b86('0x56')]);});})['then'](handleEntityNotFound(_0xa17a1d,null))[_0x4b86('0x1f')](respondWithStatusCode(_0xa17a1d,0xcc))[_0x4b86('0x3e')](handleError(_0xa17a1d,null));};exports[_0x4b86('0x65')]=function(_0x5cbb8c,_0x32a31d,_0x33b70d){var _0xfc440={};var _0x5aa89f={};var _0x5dc889;var _0x21aadf;return db[_0x4b86('0x39')][_0x4b86('0x61')]({'where':{'id':_0x5cbb8c[_0x4b86('0x4d')]['id']}})[_0x4b86('0x1f')](handleEntityNotFound(_0x32a31d,null))[_0x4b86('0x1f')](function(_0x414c58){if(_0x414c58){_0x5dc889=_0x414c58;_0x5aa89f['model']=_[_0x4b86('0x3f')](db[_0x4b86('0x63')][_0x4b86('0x27')]);_0x5aa89f[_0x4b86('0x2b')]=_['keys'](_0x5cbb8c[_0x4b86('0x2b')]);_0x5aa89f[_0x4b86('0x40')]=_['intersection'](_0x5aa89f['model'],_0x5aa89f['query']);_0xfc440[_0x4b86('0x2d')]=_['intersection'](_0x5aa89f[_0x4b86('0x2a')],qs[_0x4b86('0x2e')](_0x5cbb8c[_0x4b86('0x2b')][_0x4b86('0x2e')]));_0xfc440['attributes']=_0xfc440[_0x4b86('0x2d')][_0x4b86('0x2f')]?_0xfc440[_0x4b86('0x2d')]:_0x5aa89f[_0x4b86('0x2a')];_0xfc440['order']=qs['sort'](_0x5cbb8c[_0x4b86('0x2b')][_0x4b86('0x33')]);_0xfc440[_0x4b86('0x35')]=qs['filters'](_[_0x4b86('0x66')](_0x5cbb8c[_0x4b86('0x2b')],_0x5aa89f[_0x4b86('0x40')]));if(_0x5cbb8c[_0x4b86('0x2b')][_0x4b86('0x34')]){_0xfc440[_0x4b86('0x35')]=_[_0x4b86('0x36')](_0xfc440[_0x4b86('0x35')],{'$or':_[_0x4b86('0x26')](_0xfc440['attributes'],function(_0x58baac){var _0x43cd40={};_0x43cd40[_0x58baac]={'$like':'%'+_0x5cbb8c['query'][_0x4b86('0x34')]+'%'};return _0x43cd40;})});}_0xfc440=_['merge']({},_0xfc440,_0x5cbb8c[_0x4b86('0x38')]);return _0x5dc889[_0x4b86('0x65')](_0xfc440);}})[_0x4b86('0x1f')](function(_0xa28a21){if(_0xa28a21){_0x21aadf=_0xa28a21[_0x4b86('0x2f')];if(!_0x5cbb8c[_0x4b86('0x2b')]['hasOwnProperty']('nolimit')){_0xfc440[_0x4b86('0x17')]=qs[_0x4b86('0x17')](_0x5cbb8c[_0x4b86('0x2b')]['limit']);_0xfc440[_0x4b86('0x15')]=qs[_0x4b86('0x15')](_0x5cbb8c['query'][_0x4b86('0x15')]);}return _0x5dc889[_0x4b86('0x65')](_0xfc440);}})['then'](function(_0x547811){if(_0x547811){return _0x547811?{'count':_0x21aadf,'rows':_0x547811}:null;}})['then'](respondWithResult(_0x32a31d,null))[_0x4b86('0x3e')](handleError(_0x32a31d,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 0d453b3..ca67ab1 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 _0x9346=['lodash','../../config/logger','moment','path','rimraf','../../config/environment','exports','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9346,0xb4));var _0x6934=function(_0x10c09a,_0x5551fe){_0x10c09a=_0x10c09a-0x0;var _0xfc1c86=_0x9346[_0x10c09a];return _0xfc1c86;};'use strict';var _=require(_0x6934('0x0'));var util=require('util');var logger=require(_0x6934('0x1'))('api');var moment=require(_0x6934('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6934('0x3'));var rimraf=require(_0x6934('0x4'));var config=require(_0x6934('0x5'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x6934('0x6')]=function(_0x3d4246,_0x442a3e){return _0x3d4246[_0x6934('0x7')](_0x6934('0x8'),attributes,{'tableName':_0x6934('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd66e=['bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','api'];(function(_0x10f462,_0xb459b7){var _0x223a47=function(_0x3b37a6){while(--_0x3b37a6){_0x10f462['push'](_0x10f462['shift']());}};_0x223a47(++_0xb459b7);}(_0xd66e,0xdf));var _0xed66=function(_0x53d2d4,_0x1f63eb){_0x53d2d4=_0x53d2d4-0x0;var _0x2128d2=_0xd66e[_0x53d2d4];return _0x2128d2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xed66('0x0'));var moment=require('moment');var BPromise=require(_0xed66('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed66('0x2'));var rimraf=require(_0xed66('0x3'));var config=require(_0xed66('0x4'));var attributes=require(_0xed66('0x5'));module[_0xed66('0x6')]=function(_0x2b7a44,_0x55b0ed){return _0x2b7a44['define']('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 4faad5f..4c3b3da 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 _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x5b11c8,_0x544ca4){var _0x275e33=function(_0xd819ad){while(--_0xd819ad){_0x5b11c8['push'](_0x5b11c8['shift']());}};_0x275e33(++_0x544ca4);}(_0xedd9,0xfc));var _0x9edd=function(_0x1e22e2,_0x7aeb09){_0x1e22e2=_0x1e22e2-0x0;var _0x345a74=_0xedd9[_0x1e22e2];return _0x345a74;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x32653e,_0x5eb435){var _0x2a2029=function(_0x4662ef){while(--_0x4662ef){_0x32653e['push'](_0x32653e['shift']());}};_0x2a2029(++_0x5eb435);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index c3720db..d46c1bc 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 _0x5395=['index','/describe','/:id','show','post','/:id/users','addAgents','/:id/teams','put','update','destroy','delete','removeAgents','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated'];(function(_0x2e9187,_0x3763f6){var _0x1fc3a8=function(_0xb30d96){while(--_0xb30d96){_0x2e9187['push'](_0x2e9187['shift']());}};_0x1fc3a8(++_0x3763f6);}(_0x5395,0x150));var _0x5539=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x5395[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x5539('0x0'));var util=require('util');var path=require(_0x5539('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5539('0x2')]();var fs_extra=require(_0x5539('0x3'));var auth=require(_0x5539('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5539('0x5'));var controller=require(_0x5539('0x6'));router[_0x5539('0x7')]('/',auth[_0x5539('0x8')](),controller[_0x5539('0x9')]);router[_0x5539('0x7')](_0x5539('0xa'),auth[_0x5539('0x8')](),controller['describe']);router[_0x5539('0x7')](_0x5539('0xb'),auth[_0x5539('0x8')](),controller[_0x5539('0xc')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x5539('0x7')]('/:id/teams',auth[_0x5539('0x8')](),controller['getTeams']);router[_0x5539('0xd')]('/',auth[_0x5539('0x8')](),controller['create']);router[_0x5539('0xd')](_0x5539('0xe'),auth[_0x5539('0x8')](),controller[_0x5539('0xf')]);router[_0x5539('0xd')](_0x5539('0x10'),auth[_0x5539('0x8')](),controller['addTeams']);router[_0x5539('0x11')](_0x5539('0xb'),auth['isAuthenticated'](),controller[_0x5539('0x12')]);router['delete'](_0x5539('0xb'),auth[_0x5539('0x8')](),controller[_0x5539('0x13')]);router[_0x5539('0x14')](_0x5539('0xe'),auth[_0x5539('0x8')](),controller[_0x5539('0x15')]);router[_0x5539('0x14')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);module[_0x5539('0x16')]=router; \ No newline at end of file +var _0x046e=['post','addAgents','addTeams','put','update','delete','destroy','removeAgents','/:id/teams','removeTeams','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','describe','/:id','show','/:id/users','getAgents','getTeams'];(function(_0x65f186,_0x5c6189){var _0x2f1122=function(_0x5895a4){while(--_0x5895a4){_0x65f186['push'](_0x65f186['shift']());}};_0x2f1122(++_0x5c6189);}(_0x046e,0x1b4));var _0xe046=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x046e[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0xe046('0x0'));var util=require('util');var path=require(_0xe046('0x1'));var timeout=require('connect-timeout');var express=require(_0xe046('0x2'));var router=express[_0xe046('0x3')]();var fs_extra=require(_0xe046('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe046('0x5'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0xe046('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe046('0x6')]('/describe',auth[_0xe046('0x7')](),controller[_0xe046('0x8')]);router['get'](_0xe046('0x9'),auth[_0xe046('0x7')](),controller[_0xe046('0xa')]);router[_0xe046('0x6')](_0xe046('0xb'),auth[_0xe046('0x7')](),controller[_0xe046('0xc')]);router[_0xe046('0x6')]('/:id/teams',auth[_0xe046('0x7')](),controller[_0xe046('0xd')]);router[_0xe046('0xe')]('/',auth[_0xe046('0x7')](),controller['create']);router[_0xe046('0xe')](_0xe046('0xb'),auth['isAuthenticated'](),controller[_0xe046('0xf')]);router[_0xe046('0xe')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe046('0x10')]);router[_0xe046('0x11')]('/:id',auth[_0xe046('0x7')](),controller[_0xe046('0x12')]);router[_0xe046('0x13')](_0xe046('0x9'),auth[_0xe046('0x7')](),controller[_0xe046('0x14')]);router[_0xe046('0x13')]('/:id/users',auth[_0xe046('0x7')](),controller[_0xe046('0x15')]);router['delete'](_0xe046('0x16'),auth[_0xe046('0x7')](),controller[_0xe046('0x17')]);module[_0xe046('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 1753fc7..fce29c1 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 _0x0639=['VIRTUAL','system-','getDataValue','sequelize','STRING'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0639,0xf3));var _0x9063=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0x0639[_0x459423];return _0x42ed14;};'use strict';var Sequelize=require(_0x9063('0x0'));module['exports']={'name':{'type':Sequelize[_0x9063('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x9063('0x2')],'get':function(_0x576f06){return _0x9063('0x3')+this[_0x9063('0x4')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xfd48=['name','VIRTUAL','system-','sequelize','exports','STRING'];(function(_0x4ea9c5,_0x2bcbc6){var _0x1fc906=function(_0x52bd3b){while(--_0x52bd3b){_0x4ea9c5['push'](_0x4ea9c5['shift']());}};_0x1fc906(++_0x2bcbc6);}(_0xfd48,0xd5));var _0x8fd4=function(_0x58d370,_0xb47dca){_0x58d370=_0x58d370-0x0;var _0x58d5d1=_0xfd48[_0x58d370];return _0x58d5d1;};'use strict';var Sequelize=require(_0x8fd4('0x0'));module[_0x8fd4('0x1')]={'name':{'type':Sequelize[_0x8fd4('0x2')],'allowNull':![],'unique':_0x8fd4('0x3')},'prefix':{'type':Sequelize[_0x8fd4('0x4')],'get':function(_0x14eb37){return _0x8fd4('0x5')+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'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 edd3281..349db55 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 _0x7708=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','VoicePrefixId','bulkCreate','prefix','push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','charAt','body','system-','findById','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','emit','getAgents','getTeams','findOne','Team','addTeams','User','Agents','online','voicePause','flatMap','each','upsert','findOrCreate','forEach','select','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','userVoicePrefix:remove','eml-format','rimraf','fast-json-patch','util','path','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/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','get','VoicePrefixes','status','error','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','intersection','includeAll','find','describe','sequelize','transaction','create','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x7708,0x188));var _0x8770=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x7708[_0x1eda20];return _0x31b953;};'use strict';var emlformat=require(_0x8770('0x0'));var rimraf=require(_0x8770('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8770('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8770('0x3'));var path=require(_0x8770('0x4'));var sox=require('sox');var csv=require(_0x8770('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8770('0x6'));var _=require(_0x8770('0x7'));var squel=require(_0x8770('0x8'));var crypto=require(_0x8770('0x9'));var jsforce=require(_0x8770('0xa'));var deskjs=require(_0x8770('0xb'));var toCsv=require(_0x8770('0x5'));var querystring=require('querystring');var Papa=require(_0x8770('0xc'));var Redis=require(_0x8770('0xd'));var authService=require(_0x8770('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8770('0xf'));var hardwareService=require(_0x8770('0x10'));var logger=require(_0x8770('0x11'))(_0x8770('0x12'));var utils=require('../../config/utils');var config=require(_0x8770('0x13'));var licenseUtil=require(_0x8770('0x14'));var db=require(_0x8770('0x15'))['db'];config['redis']=_[_0x8770('0x16')](config[_0x8770('0x17')],{'host':_0x8770('0x18'),'port':0x18eb});var socket=require(_0x8770('0x19'))(new Redis(config[_0x8770('0x17')]));require(_0x8770('0x1a'))[_0x8770('0x1b')](socket);function respondWithStatusCode(_0x12439f,_0x5514b5){_0x5514b5=_0x5514b5||0xcc;return function(_0x1d15d6){if(_0x1d15d6){return _0x12439f[_0x8770('0x1c')](_0x5514b5);}return _0x12439f['status'](_0x5514b5)[_0x8770('0x1d')]();};}function respondWithResult(_0x52254f,_0x1c8ab6){_0x1c8ab6=_0x1c8ab6||0xc8;return function(_0x526e9b){if(_0x526e9b){return _0x52254f['status'](_0x1c8ab6)['json'](_0x526e9b);}};}function respondWithFilteredResult(_0x155e83,_0x3b459a){return function(_0x17b634){if(_0x17b634){var _0xe0d611=typeof _0x3b459a['offset']==='undefined'&&typeof _0x3b459a[_0x8770('0x1e')]===_0x8770('0x1f');var _0x26cbcd=_0x17b634[_0x8770('0x20')];var _0x4d2c7e=_0xe0d611?0x0:_0x3b459a['offset'];var _0x3e1fe7=_0xe0d611?_0x17b634[_0x8770('0x20')]:_0x3b459a[_0x8770('0x21')]+_0x3b459a[_0x8770('0x1e')];var _0x582048;if(_0x3e1fe7>=_0x26cbcd){_0x3e1fe7=_0x26cbcd;_0x582048=0xc8;}else{_0x582048=0xce;}_0x155e83['status'](_0x582048);return _0x155e83[_0x8770('0x22')](_0x8770('0x23'),_0x4d2c7e+'-'+_0x3e1fe7+'/'+_0x26cbcd)[_0x8770('0x24')](_0x17b634);}return null;};}function patchUpdates(_0x2918a7){return function(_0x2760b2){try{jsonpatch[_0x8770('0x25')](_0x2760b2,_0x2918a7,!![]);}catch(_0x5819dc){return BPromise[_0x8770('0x26')](_0x5819dc);}return _0x2760b2[_0x8770('0x27')]();};}function saveUpdates(_0x4274dd,_0x2515c5){return function(_0x51cdb5){if(_0x51cdb5){return _0x51cdb5[_0x8770('0x28')](_0x4274dd)['then'](function(_0x7b4755){return _0x7b4755;});}return null;};}function removeEntity(_0x453804,_0x473d31){return function(_0x2b5f62){if(_0x2b5f62){return _0x2b5f62[_0x8770('0x29')]()[_0x8770('0x2a')](function(){var _0x293f53=_0x2b5f62[_0x8770('0x2b')]({'plain':!![]});var _0xb3f4aa=_0x8770('0x2c');return db['UserProfileResource'][_0x8770('0x29')]({'where':{'type':_0xb3f4aa,'resourceId':_0x293f53['id']}})[_0x8770('0x2a')](function(){return _0x2b5f62;});})[_0x8770('0x2a')](function(){_0x453804[_0x8770('0x2d')](0xcc)[_0x8770('0x1d')]();});}};}function handleEntityNotFound(_0x200a82,_0x5ae7b8){return function(_0x4b284b){if(!_0x4b284b){_0x200a82[_0x8770('0x1c')](0x194);}return _0x4b284b;};}function handleError(_0x11de6e,_0x22f0b0){_0x22f0b0=_0x22f0b0||0x1f4;return function(_0x365080){logger[_0x8770('0x2e')](_0x365080['stack']);if(_0x365080['name']){delete _0x365080[_0x8770('0x2f')];}_0x11de6e[_0x8770('0x2d')](_0x22f0b0)[_0x8770('0x30')](_0x365080);};}exports[_0x8770('0x31')]=function(_0x5cb4ec,_0x2f4e44){var _0x501741={},_0x5743cb={},_0x20095d={'count':0x0,'rows':[]};var _0x4f8182=_[_0x8770('0x32')](db[_0x8770('0x33')][_0x8770('0x34')],function(_0x3ae4a9){return{'name':_0x3ae4a9[_0x8770('0x35')],'type':_0x3ae4a9[_0x8770('0x36')][_0x8770('0x37')]};});_0x5743cb[_0x8770('0x38')]=_[_0x8770('0x32')](_0x4f8182,'name');_0x5743cb[_0x8770('0x39')]=_[_0x8770('0x3a')](_0x5cb4ec[_0x8770('0x39')]);_0x5743cb['filters']=_['intersection'](_0x5743cb[_0x8770('0x38')],_0x5743cb[_0x8770('0x39')]);_0x501741[_0x8770('0x3b')]=_['intersection'](_0x5743cb[_0x8770('0x38')],qs['fields'](_0x5cb4ec[_0x8770('0x39')][_0x8770('0x3c')]));_0x501741[_0x8770('0x3b')]=_0x501741[_0x8770('0x3b')][_0x8770('0x3d')]?_0x501741[_0x8770('0x3b')]:_0x5743cb[_0x8770('0x38')];if(!_0x5cb4ec[_0x8770('0x39')][_0x8770('0x3e')](_0x8770('0x3f'))){_0x501741['limit']=qs[_0x8770('0x1e')](_0x5cb4ec[_0x8770('0x39')][_0x8770('0x1e')]);_0x501741['offset']=qs[_0x8770('0x21')](_0x5cb4ec[_0x8770('0x39')][_0x8770('0x21')]);}_0x501741[_0x8770('0x40')]=qs[_0x8770('0x41')](_0x5cb4ec[_0x8770('0x39')]['sort']);_0x501741[_0x8770('0x42')]=qs['filters'](_[_0x8770('0x43')](_0x5cb4ec['query'],_0x5743cb[_0x8770('0x44')]),_0x4f8182);if(_0x5cb4ec[_0x8770('0x39')][_0x8770('0x45')]){_0x501741['where']=_[_0x8770('0x46')](_0x501741[_0x8770('0x42')],{'$or':_[_0x8770('0x32')](_0x4f8182,function(_0x94343f){if(_0x94343f[_0x8770('0x36')]!==_0x8770('0x47')){var _0x5b4fdd={};_0x5b4fdd[_0x94343f[_0x8770('0x2f')]]={'$like':'%'+_0x5cb4ec['query']['filter']+'%'};return _0x5b4fdd;}})});}_0x501741=_[_0x8770('0x46')]({},_0x501741,_0x5cb4ec[_0x8770('0x48')]);var _0x2e4bda={'where':_0x501741[_0x8770('0x42')]};return db[_0x8770('0x33')]['count'](_0x2e4bda)[_0x8770('0x2a')](function(_0x26ae1b){_0x20095d['count']=_0x26ae1b;if(_0x5cb4ec[_0x8770('0x39')]['includeAll']){_0x501741[_0x8770('0x49')]=[{'all':!![]}];}return db[_0x8770('0x33')][_0x8770('0x4a')](_0x501741);})[_0x8770('0x2a')](function(_0x29dae5){_0x20095d[_0x8770('0x4b')]=_0x29dae5;return _0x20095d;})[_0x8770('0x2a')](respondWithFilteredResult(_0x2f4e44,_0x501741))[_0x8770('0x4c')](handleError(_0x2f4e44,null));};exports[_0x8770('0x4d')]=function(_0x120bc4,_0x3192fc){var _0x5c1818={'raw':![],'where':{'id':_0x120bc4[_0x8770('0x4e')]['id']}},_0x92e802={};_0x92e802[_0x8770('0x38')]=_[_0x8770('0x3a')](db[_0x8770('0x33')][_0x8770('0x34')]);_0x92e802['query']=_[_0x8770('0x3a')](_0x120bc4[_0x8770('0x39')]);_0x92e802[_0x8770('0x44')]=_[_0x8770('0x4f')](_0x92e802[_0x8770('0x38')],_0x92e802[_0x8770('0x39')]);_0x5c1818[_0x8770('0x3b')]=_[_0x8770('0x4f')](_0x92e802['model'],qs[_0x8770('0x3c')](_0x120bc4[_0x8770('0x39')][_0x8770('0x3c')]));_0x5c1818[_0x8770('0x3b')]=_0x5c1818[_0x8770('0x3b')]['length']?_0x5c1818['attributes']:_0x92e802[_0x8770('0x38')];if(_0x120bc4['query'][_0x8770('0x50')]){_0x5c1818['include']=[{'all':!![]}];}_0x5c1818=_['merge']({},_0x5c1818,_0x120bc4[_0x8770('0x48')]);return db[_0x8770('0x33')][_0x8770('0x51')](_0x5c1818)[_0x8770('0x2a')](handleEntityNotFound(_0x3192fc,null))['then'](respondWithResult(_0x3192fc,null))[_0x8770('0x4c')](handleError(_0x3192fc,null));};exports[_0x8770('0x29')]=function(_0x598aaa,_0x4d8bde){return db[_0x8770('0x33')][_0x8770('0x51')]({'where':{'id':_0x598aaa[_0x8770('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4d8bde,null))[_0x8770('0x2a')](removeEntity(_0x4d8bde,null))['catch'](handleError(_0x4d8bde,null));};exports[_0x8770('0x52')]=function(_0x3841bb,_0x39cdb4){return db['VoicePrefix'][_0x8770('0x52')]()['then'](respondWithResult(_0x39cdb4,null))['catch'](handleError(_0x39cdb4,null));};exports['create']=function(_0x242361,_0x42ea2d){var _0x416e7b;return db[_0x8770('0x53')][_0x8770('0x54')](function(_0x1df5cd){return db['VoicePrefix'][_0x8770('0x55')](_0x242361['body'],{'transaction':_0x1df5cd})[_0x8770('0x2a')](function(_0x3bcccc){_0x416e7b=_0x3bcccc[_0x8770('0x2b')]({'plain':!![]});return db[_0x8770('0x56')]['find']({'where':{'id':_0x416e7b[_0x8770('0x57')]},'raw':!![]})[_0x8770('0x2a')](function(_0x4c0a3f){return createVoicePrefixExtensions(_0x416e7b,_0x4c0a3f,_0x1df5cd);});});})['then'](function(){var _0x552cab=_0x242361['user'][_0x8770('0x2b')]({'plain':!![]});if(!_0x552cab)throw new Error(_0x8770('0x58'));if(_0x552cab['role']===_0x8770('0x59')){var _0x38b68f=_0x416e7b;return db[_0x8770('0x5a')][_0x8770('0x51')]({'where':{'name':_0x8770('0x2c'),'userProfileId':_0x552cab[_0x8770('0x5b')]},'raw':!![]})[_0x8770('0x2a')](function(_0xc2f9d9){if(_0xc2f9d9&&_0xc2f9d9[_0x8770('0x5c')]===0x0){return db[_0x8770('0x5d')][_0x8770('0x55')]({'name':_0x38b68f['name'],'resourceId':_0x38b68f['id'],'type':_0xc2f9d9[_0x8770('0x2f')],'sectionId':_0xc2f9d9['id']},{})[_0x8770('0x2a')](function(){return _0x416e7b;});}else{return _0x416e7b;}})[_0x8770('0x4c')](function(_0x593b06){logger[_0x8770('0x2e')](_0x8770('0x5e'),_0x593b06);throw _0x593b06;});}return _0x416e7b;})[_0x8770('0x2a')](respondWithResult(_0x42ea2d,null))['catch'](handleError(_0x42ea2d,null));};function Extension(_0x2aecc0,_0xbe9c4c,_0x5b1548,_0x3a2070){this['context']=_0x8770('0x5f');this[_0x8770('0x60')]=_0x2aecc0;this['app']=_0x5b1548;this[_0x8770('0x36')]=_0x8770('0x61');this[_0x8770('0x62')]=_0x8770('0x63');this[_0x8770('0x64')]=_0xbe9c4c;this[_0x8770('0x65')]=_0x3a2070;}function createVoicePrefixExtensions(_0x36606f,_0x39c69b,_0x535041){return new BPromise(function(_0x1a67b5,_0x18a31d){var _0x5cd7a1=new Extension(formatPrefixName(_0x36606f['prefix']),0x1,_0x8770('0x66'),'Voice\x20Prefix');_0x5cd7a1[_0x8770('0x67')]=_0x36606f['id'];return db[_0x8770('0x56')]['create'](_0x5cd7a1,{'transaction':_0x535041})[_0x8770('0x2a')](function(_0x339d70){var _0x4419cb=_0x339d70[_0x8770('0x2b')]({'plain':!![]});var _0x2c6044=_[_0x8770('0x32')](addVoicePrefixExtensions(_0x36606f,_0x39c69b),function(_0x28f71b){_0x28f71b[_0x8770('0x57')]=_0x4419cb['id'];_0x28f71b[_0x8770('0x67')]=_0x36606f['id'];return _0x28f71b;});return db[_0x8770('0x56')][_0x8770('0x68')](_0x2c6044,{'transaction':_0x535041})[_0x8770('0x2a')](function(_0x1dcb75){if(!_0x1dcb75){return _0x18a31d('Extensions\x20creation\x20failed');}else{return _0x1a67b5(_0x1dcb75);}})[_0x8770('0x4c')](function(_0x1a3cae){return _0x18a31d(_0x1a3cae);});});;});};function addVoicePrefixExtensions(_0x31c098,_0x219473){var _0x45d1cb=[];var _0x6c24f7=formatPrefixName(_0x31c098[_0x8770('0x69')]);_0x45d1cb[_0x8770('0x6a')](new Extension(_0x6c24f7,0x2,_0x8770('0x6b'),'CDR(prefix)='+_0x31c098[_0x8770('0x2f')]));if(_0x31c098[_0x8770('0x6c')]){_0x45d1cb[_0x8770('0x6a')](new Extension(_0x6c24f7,0x3,'Set',_0x8770('0x6d')+_0x31c098[_0x8770('0x6c')]));}else{_0x45d1cb['push'](new Extension(_0x6c24f7,0x3,_0x8770('0x66'),_0x8770('0x6e')));}_0x45d1cb[_0x8770('0x6a')](new Extension(_0x6c24f7,0x4,_0x8770('0x6f'),_0x219473[_0x8770('0x70')]+','+'${EXTEN:'+(0x8+_0x31c098[_0x8770('0x2f')]['length'])+'}'+','+0x1));return _0x45d1cb;}function formatPrefixName(_0x2a45c8){var _0x43a87c='_';for(var _0x272862=0x0;_0x272862<_0x2a45c8[_0x8770('0x3d')];_0x272862++){if(_0x2a45c8[_0x8770('0x71')](_0x272862)=='-'){_0x43a87c+=_0x2a45c8[_0x8770('0x71')](_0x272862);}else{_0x43a87c+='['+_0x2a45c8[_0x8770('0x71')](_0x272862)+']';}}_0x43a87c+='.';return _0x43a87c;}exports[_0x8770('0x28')]=function(_0x896947,_0x54c34c,_0x15b77c){var _0x3fca1c=_0x896947[_0x8770('0x72')];_0x3fca1c[_0x8770('0x69')]=_0x8770('0x73')+_0x3fca1c[_0x8770('0x2f')]+'-';return db[_0x8770('0x53')][_0x8770('0x54')](function(_0x3ad340){return db['VoicePrefix']['update'](_0x3fca1c,{'where':{'id':_0x3fca1c['id']},'transaction':_0x3ad340})[_0x8770('0x2a')](function(){return db['VoiceExtension'][_0x8770('0x29')]({'where':{'VoicePrefixId':_0x3fca1c['id']},'transaction':_0x3ad340})['then'](function(){return db['VoiceExtension']['find']({'where':{'id':_0x3fca1c[_0x8770('0x57')]},'raw':!![]})[_0x8770('0x2a')](function(_0x405272){return createVoicePrefixExtensions(_0x3fca1c,_0x405272,_0x3ad340);});});});})[_0x8770('0x2a')](function(){return db[_0x8770('0x33')][_0x8770('0x74')](_0x3fca1c['id']);})[_0x8770('0x2a')](respondWithResult(_0x54c34c,null))[_0x8770('0x4c')](handleError(_0x54c34c,null));};exports[_0x8770('0x75')]=function(_0x2eebb9,_0x1bbd08,_0x1ef47a){return db[_0x8770('0x33')][_0x8770('0x51')]({'where':{'id':_0x2eebb9[_0x8770('0x4e')]['id']}})[_0x8770('0x2a')](handleEntityNotFound(_0x1bbd08,null))['then'](function(_0x304539){if(_0x304539){return _0x304539[_0x8770('0x75')](_0x2eebb9[_0x8770('0x72')][_0x8770('0x76')],_[_0x8770('0x77')](_0x2eebb9[_0x8770('0x72')],[_0x8770('0x76'),'id'])||{})[_0x8770('0x78')](function(_0x2ab10c){for(var _0x2669df=0x0;_0x2669df<_0x2eebb9[_0x8770('0x72')][_0x8770('0x76')][_0x8770('0x3d')];_0x2669df+=0x1){socket['emit'](_0x8770('0x79'),{'UserId':Number(_0x2eebb9['body'][_0x8770('0x76')][_0x2669df]),'VoicePrefixId':Number(_0x2eebb9[_0x8770('0x4e')]['id'])});}return _0x2ab10c;});}})['then'](respondWithResult(_0x1bbd08,null))[_0x8770('0x4c')](handleError(_0x1bbd08,null));};exports[_0x8770('0x7a')]=function(_0x3ebea6,_0x3b1a55,_0x1b3b5d){return db[_0x8770('0x33')][_0x8770('0x51')]({'where':{'id':_0x3ebea6['params']['id']}})[_0x8770('0x2a')](handleEntityNotFound(_0x3b1a55,null))[_0x8770('0x2a')](function(_0xf5ef52){if(_0xf5ef52){return _0xf5ef52['removeAgents'](_0x3ebea6[_0x8770('0x39')][_0x8770('0x76')])[_0x8770('0x2a')](function(){if(_[_0x8770('0x7b')](_0x3ebea6[_0x8770('0x39')][_0x8770('0x76')])){for(var _0x45c5be=0x0;_0x45c5be<_0x3ebea6[_0x8770('0x39')][_0x8770('0x76')][_0x8770('0x3d')];_0x45c5be+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x3ebea6[_0x8770('0x39')][_0x8770('0x76')][_0x45c5be]),'VoicePrefixId':Number(_0x3ebea6[_0x8770('0x4e')]['id'])});}}else{socket[_0x8770('0x7c')]('userVoicePrefix:remove',{'UserId':Number(_0x3ebea6['query'][_0x8770('0x76')]),'VoicePrefixId':Number(_0x3ebea6['params']['id'])});}});}})[_0x8770('0x2a')](respondWithStatusCode(_0x3b1a55,null))['catch'](handleError(_0x3b1a55,null));};exports[_0x8770('0x7d')]=function(_0xb6193a,_0x41344a,_0x54dfea){var _0x16bef8={};var _0x4925f8={};var _0x5b2f00;var _0x15abe5;return db[_0x8770('0x33')]['findOne']({'where':{'id':_0xb6193a[_0x8770('0x4e')]['id']}})[_0x8770('0x2a')](handleEntityNotFound(_0x41344a,null))['then'](function(_0x344a1c){if(_0x344a1c){_0x5b2f00=_0x344a1c;_0x4925f8['model']=_[_0x8770('0x3a')](db['User']['rawAttributes']);_0x4925f8[_0x8770('0x39')]=_[_0x8770('0x3a')](_0xb6193a['query']);_0x4925f8['filters']=_[_0x8770('0x4f')](_0x4925f8[_0x8770('0x38')],_0x4925f8[_0x8770('0x39')]);_0x16bef8[_0x8770('0x3b')]=_['intersection'](_0x4925f8[_0x8770('0x38')],qs[_0x8770('0x3c')](_0xb6193a['query'][_0x8770('0x3c')]));_0x16bef8[_0x8770('0x3b')]=_0x16bef8[_0x8770('0x3b')]['length']?_0x16bef8[_0x8770('0x3b')]:_0x4925f8['model'];_0x16bef8[_0x8770('0x40')]=qs['sort'](_0xb6193a[_0x8770('0x39')][_0x8770('0x41')]);_0x16bef8[_0x8770('0x42')]=qs['filters'](_[_0x8770('0x43')](_0xb6193a['query'],_0x4925f8[_0x8770('0x44')]));if(_0xb6193a['query'][_0x8770('0x45')]){_0x16bef8[_0x8770('0x42')]=_[_0x8770('0x46')](_0x16bef8[_0x8770('0x42')],{'$or':_['map'](_0x16bef8[_0x8770('0x3b')],function(_0x4a699b){var _0x4478d0={};_0x4478d0[_0x4a699b]={'$like':'%'+_0xb6193a[_0x8770('0x39')][_0x8770('0x45')]+'%'};return _0x4478d0;})});}_0x16bef8=_[_0x8770('0x46')]({},_0x16bef8,_0xb6193a[_0x8770('0x48')]);return _0x5b2f00['getAgents'](_0x16bef8);}})[_0x8770('0x2a')](function(_0x5dcc26){if(_0x5dcc26){_0x15abe5=_0x5dcc26[_0x8770('0x3d')];if(!_0xb6193a[_0x8770('0x39')][_0x8770('0x3e')]('nolimit')){_0x16bef8['limit']=qs['limit'](_0xb6193a[_0x8770('0x39')][_0x8770('0x1e')]);_0x16bef8['offset']=qs[_0x8770('0x21')](_0xb6193a[_0x8770('0x39')][_0x8770('0x21')]);}return _0x5b2f00[_0x8770('0x7d')](_0x16bef8);}})[_0x8770('0x2a')](function(_0x541502){if(_0x541502){return _0x541502?{'count':_0x15abe5,'rows':_0x541502}:null;}})[_0x8770('0x2a')](respondWithResult(_0x41344a,null))['catch'](handleError(_0x41344a,null));};exports[_0x8770('0x7e')]=function(_0x1e2964,_0xb0bc70,_0x97f28){var _0x225353={};var _0x459715={};var _0x2c0dc3;var _0x47ee22;return db['VoicePrefix'][_0x8770('0x7f')]({'where':{'id':_0x1e2964[_0x8770('0x4e')]['id']}})[_0x8770('0x2a')](handleEntityNotFound(_0xb0bc70,null))[_0x8770('0x2a')](function(_0x5b9da7){if(_0x5b9da7){_0x2c0dc3=_0x5b9da7;_0x459715[_0x8770('0x38')]=_[_0x8770('0x3a')](db[_0x8770('0x80')]['rawAttributes']);_0x459715[_0x8770('0x39')]=_[_0x8770('0x3a')](_0x1e2964[_0x8770('0x39')]);_0x459715[_0x8770('0x44')]=_[_0x8770('0x4f')](_0x459715[_0x8770('0x38')],_0x459715[_0x8770('0x39')]);_0x225353['attributes']=_[_0x8770('0x4f')](_0x459715[_0x8770('0x38')],qs[_0x8770('0x3c')](_0x1e2964[_0x8770('0x39')][_0x8770('0x3c')]));_0x225353[_0x8770('0x3b')]=_0x225353[_0x8770('0x3b')][_0x8770('0x3d')]?_0x225353[_0x8770('0x3b')]:_0x459715[_0x8770('0x38')];_0x225353['order']=qs[_0x8770('0x41')](_0x1e2964[_0x8770('0x39')][_0x8770('0x41')]);_0x225353['where']=qs['filters'](_[_0x8770('0x43')](_0x1e2964[_0x8770('0x39')],_0x459715[_0x8770('0x44')]));if(_0x1e2964[_0x8770('0x39')][_0x8770('0x45')]){_0x225353[_0x8770('0x42')]=_[_0x8770('0x46')](_0x225353[_0x8770('0x42')],{'$or':_[_0x8770('0x32')](_0x225353[_0x8770('0x3b')],function(_0x1e8091){var _0x19f98a={};_0x19f98a[_0x1e8091]={'$like':'%'+_0x1e2964[_0x8770('0x39')]['filter']+'%'};return _0x19f98a;})});}_0x225353=_[_0x8770('0x46')]({},_0x225353,_0x1e2964[_0x8770('0x48')]);return _0x2c0dc3[_0x8770('0x7e')](_0x225353);}})[_0x8770('0x2a')](function(_0x1703b8){if(_0x1703b8){_0x47ee22=_0x1703b8['length'];if(!_0x1e2964[_0x8770('0x39')]['hasOwnProperty'](_0x8770('0x3f'))){_0x225353[_0x8770('0x1e')]=qs[_0x8770('0x1e')](_0x1e2964[_0x8770('0x39')][_0x8770('0x1e')]);_0x225353[_0x8770('0x21')]=qs[_0x8770('0x21')](_0x1e2964[_0x8770('0x39')]['offset']);}return _0x2c0dc3['getTeams'](_0x225353);}})['then'](function(_0x1e16f5){if(_0x1e16f5){return _0x1e16f5?{'count':_0x47ee22,'rows':_0x1e16f5}:null;}})[_0x8770('0x2a')](respondWithResult(_0xb0bc70,null))[_0x8770('0x4c')](handleError(_0xb0bc70,null));};exports[_0x8770('0x81')]=function(_0x58e7d1,_0x2696c9,_0x1a6fef){var _0x16056d=_0x58e7d1[_0x8770('0x72')][_0x8770('0x76')];var _0x3d7f89;return db[_0x8770('0x80')][_0x8770('0x4a')]({'where':{'id':_0x16056d},'attributes':['id'],'include':[{'model':db[_0x8770('0x82')],'as':_0x8770('0x83'),'attributes':['id','name',_0x8770('0x84'),_0x8770('0x85'),'interface'],'raw':!![]}]})[_0x8770('0x2a')](function(_0x3f6b63){if(_0x3f6b63){_0x3d7f89=_0x3f6b63;var _0x503fa9=_[_0x8770('0x86')](_0x3f6b63,function(_0x1a1496){var _0x56b6cb=_0x1a1496[_0x8770('0x2b')]({'plain':!![]});return _0x56b6cb[_0x8770('0x83')];});return db[_0x8770('0x33')]['find']({'where':{'id':_0x58e7d1[_0x8770('0x4e')]['id']}})[_0x8770('0x2a')](function(_0x3272d9){return db[_0x8770('0x53')]['transaction'](function(_0x1b9673){return _0x3272d9[_0x8770('0x81')](_0x16056d,{'transaction':_0x1b9673})['then'](function(){return BPromise[_0x8770('0x87')](_0x3d7f89,function(_0x3b4c87){return db['TeamVoicePrefix'][_0x8770('0x88')]({'TeamId':_0x3b4c87['id'],'VoicePrefixId':_0x58e7d1[_0x8770('0x4e')]['id']},{'transaction':_0x1b9673});});})[_0x8770('0x2a')](function(){return BPromise[_0x8770('0x87')](_0x503fa9,function(_0x21b355){return db['UserVoicePrefix'][_0x8770('0x89')]({'where':{'UserId':_0x21b355['id'],'VoicePrefixId':_0x58e7d1['params']['id']},'transaction':_0x1b9673});});})['then'](function(){_0x503fa9[_0x8770('0x8a')](function(_0x355360){socket[_0x8770('0x7c')](_0x8770('0x79'),{'UserId':_0x355360['id'],'VoicePrefixId':_0x3272d9['id']});});});});});}})['then'](respondWithStatusCode(_0x2696c9,null))[_0x8770('0x4c')](handleError(_0x2696c9,null));};exports['removeTeams']=function(_0x4a723c,_0x479d58,_0x59cc6e){return db[_0x8770('0x80')]['findAll']({'where':{'id':_0x4a723c[_0x8770('0x39')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8770('0x83'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x479d58,null))[_0x8770('0x2a')](function(_0x11891f){var _0x445dee=_['map'](_0x11891f,'id');var _0x568b87=[];var _0x458762=[];var _0x3bd770=squel[_0x8770('0x8b')]();_0x3bd770[_0x8770('0x8c')](_0x8770('0x8d'))['from'](_0x8770('0x8e'),'tq')[_0x8770('0x8f')](_0x8770('0x90'),'ut',_0x8770('0x91'))[_0x8770('0x42')](_0x8770('0x92'),_0x4a723c[_0x8770('0x4e')]['id']);for(var _0x38238a=0x0;_0x38238a<_0x11891f[_0x8770('0x3d')];_0x38238a+=0x1){let _0x6de941=_0x11891f[_0x38238a];for(var _0x592fef=0x0;_0x592fef<_0x6de941[_0x8770('0x83')][_0x8770('0x3d')];_0x592fef+=0x1){let _0x49c415=_0x6de941[_0x8770('0x83')][_0x592fef];var _0x3bb644=_0x3bd770[_0x8770('0x93')]();_0x3bb644['where'](_0x8770('0x94'),_0x49c415['id']);_0x458762['push'](db[_0x8770('0x53')][_0x8770('0x39')](_0x3bb644[_0x8770('0x95')](),{'type':db['sequelize'][_0x8770('0x96')][_0x8770('0x97')]})[_0x8770('0x2a')](function(_0x5ded0a){if(_0x5ded0a['length']===0x1){return _0x49c415['id'];}else{var _0x36f842=_[_0x8770('0x98')](_[_0x8770('0x32')](_0x5ded0a,_0x8770('0x99')),function(_0x30b589){return _[_0x8770('0x9a')](_0x445dee,_0x30b589);});if(_0x36f842){return _0x49c415['id'];}}}));}}return BPromise[_0x8770('0x9b')](_0x458762)[_0x8770('0x2a')](function(_0x377cfb){_0x568b87=_(_0x568b87)[_0x8770('0x9c')](_0x377cfb)[_0x8770('0x9d')]()[_0x8770('0x9e')]();return db[_0x8770('0x33')][_0x8770('0x51')]({'where':{'id':_0x4a723c[_0x8770('0x4e')]['id']}})[_0x8770('0x2a')](function(_0x4cadd5){return db[_0x8770('0x53')][_0x8770('0x54')](function(_0x1ac69f){return _0x4cadd5[_0x8770('0x9f')](_0x4a723c['query'][_0x8770('0x76')],{'transaction':_0x1ac69f})['then'](function(){if(!_[_0x8770('0xa0')](_0x568b87)){return _0x4cadd5[_0x8770('0x7a')](_0x568b87,{'transaction':_0x1ac69f});}})['then'](function(){_0x568b87['forEach'](function(_0x4203d2){socket[_0x8770('0x7c')](_0x8770('0xa1'),{'UserId':_0x4203d2,'VoicePrefixId':_0x4cadd5['id']});});});});});});})['then'](respondWithStatusCode(_0x479d58,null))[_0x8770('0x4c')](handleError(_0x479d58,null));}; \ No newline at end of file +var _0xfef3=['../../mysqldb','defaults','redis','localhost','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','VoicePrefixes','then','error','stack','name','index','map','VoicePrefix','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','describe','create','sequelize','transaction','body','get','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','pick','getTeams','hasOwnProperty','Team','Agents','online','interface','flatMap','each','TeamVoicePrefix','upsert','findOrCreate','forEach','select','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','all','union','value','isEmpty','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x285e35,_0x5e6ebd){var _0x169f37=function(_0x2e4484){while(--_0x2e4484){_0x285e35['push'](_0x285e35['shift']());}};_0x169f37(++_0x5e6ebd);}(_0xfef3,0x118));var _0x3fef=function(_0x953b57,_0x11dd4e){_0x953b57=_0x953b57-0x0;var _0x258479=_0xfef3[_0x953b57];return _0x258479;};'use strict';var emlformat=require(_0x3fef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fef('0x2'));var moment=require(_0x3fef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3fef('0x4'));var util=require(_0x3fef('0x5'));var path=require('path');var sox=require(_0x3fef('0x6'));var csv=require(_0x3fef('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fef('0x8'));var _=require(_0x3fef('0x9'));var squel=require(_0x3fef('0xa'));var crypto=require(_0x3fef('0xb'));var jsforce=require(_0x3fef('0xc'));var deskjs=require(_0x3fef('0xd'));var toCsv=require(_0x3fef('0x7'));var querystring=require(_0x3fef('0xe'));var Papa=require(_0x3fef('0xf'));var Redis=require(_0x3fef('0x10'));var authService=require(_0x3fef('0x11'));var qs=require(_0x3fef('0x12'));var as=require(_0x3fef('0x13'));var hardwareService=require(_0x3fef('0x14'));var logger=require('../../config/logger')(_0x3fef('0x15'));var utils=require(_0x3fef('0x16'));var config=require(_0x3fef('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3fef('0x18'))['db'];config['redis']=_[_0x3fef('0x19')](config[_0x3fef('0x1a')],{'host':_0x3fef('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3fef('0x1a')]));require('./voicePrefix.socket')[_0x3fef('0x1c')](socket);function respondWithStatusCode(_0x14c053,_0x56a65d){_0x56a65d=_0x56a65d||0xcc;return function(_0x2dec1b){if(_0x2dec1b){return _0x14c053[_0x3fef('0x1d')](_0x56a65d);}return _0x14c053[_0x3fef('0x1e')](_0x56a65d)[_0x3fef('0x1f')]();};}function respondWithResult(_0x395df0,_0x2af1ba){_0x2af1ba=_0x2af1ba||0xc8;return function(_0x5c899f){if(_0x5c899f){return _0x395df0[_0x3fef('0x1e')](_0x2af1ba)[_0x3fef('0x20')](_0x5c899f);}};}function respondWithFilteredResult(_0x1ec282,_0x3f2997){return function(_0x1613ad){if(_0x1613ad){var _0xaa0ae3=typeof _0x3f2997['offset']===_0x3fef('0x21')&&typeof _0x3f2997[_0x3fef('0x22')]==='undefined';var _0x2c7f36=_0x1613ad[_0x3fef('0x23')];var _0x42e095=_0xaa0ae3?0x0:_0x3f2997[_0x3fef('0x24')];var _0x245332=_0xaa0ae3?_0x1613ad[_0x3fef('0x23')]:_0x3f2997[_0x3fef('0x24')]+_0x3f2997[_0x3fef('0x22')];var _0x124e7c;if(_0x245332>=_0x2c7f36){_0x245332=_0x2c7f36;_0x124e7c=0xc8;}else{_0x124e7c=0xce;}_0x1ec282[_0x3fef('0x1e')](_0x124e7c);return _0x1ec282[_0x3fef('0x25')](_0x3fef('0x26'),_0x42e095+'-'+_0x245332+'/'+_0x2c7f36)[_0x3fef('0x20')](_0x1613ad);}return null;};}function patchUpdates(_0x39a8ea){return function(_0x433a3e){try{jsonpatch['apply'](_0x433a3e,_0x39a8ea,!![]);}catch(_0x5b56de){return BPromise['reject'](_0x5b56de);}return _0x433a3e[_0x3fef('0x27')]();};}function saveUpdates(_0x3ba38d,_0xa16dc){return function(_0x5f047c){if(_0x5f047c){return _0x5f047c[_0x3fef('0x28')](_0x3ba38d)['then'](function(_0x45464b){return _0x45464b;});}return null;};}function removeEntity(_0x2c0848,_0x64d3e6){return function(_0xf2b269){if(_0xf2b269){return _0xf2b269[_0x3fef('0x29')]()['then'](function(){var _0x4b4dee=_0xf2b269['get']({'plain':!![]});var _0x121ff0=_0x3fef('0x2a');return db['UserProfileResource'][_0x3fef('0x29')]({'where':{'type':_0x121ff0,'resourceId':_0x4b4dee['id']}})[_0x3fef('0x2b')](function(){return _0xf2b269;});})['then'](function(){_0x2c0848[_0x3fef('0x1e')](0xcc)[_0x3fef('0x1f')]();});}};}function handleEntityNotFound(_0xf892bb,_0x2b73fb){return function(_0x3a1a0a){if(!_0x3a1a0a){_0xf892bb[_0x3fef('0x1d')](0x194);}return _0x3a1a0a;};}function handleError(_0x20abb6,_0x4a632c){_0x4a632c=_0x4a632c||0x1f4;return function(_0x34576a){logger[_0x3fef('0x2c')](_0x34576a[_0x3fef('0x2d')]);if(_0x34576a[_0x3fef('0x2e')]){delete _0x34576a['name'];}_0x20abb6[_0x3fef('0x1e')](_0x4a632c)['send'](_0x34576a);};}exports[_0x3fef('0x2f')]=function(_0x3c4483,_0x16009a){var _0x1136b3={},_0x10b803={},_0x464763={'count':0x0,'rows':[]};var _0x355c03=_[_0x3fef('0x30')](db[_0x3fef('0x31')][_0x3fef('0x32')],function(_0x4f1061){return{'name':_0x4f1061['fieldName'],'type':_0x4f1061[_0x3fef('0x33')]['key']};});_0x10b803[_0x3fef('0x34')]=_[_0x3fef('0x30')](_0x355c03,_0x3fef('0x2e'));_0x10b803[_0x3fef('0x35')]=_[_0x3fef('0x36')](_0x3c4483[_0x3fef('0x35')]);_0x10b803[_0x3fef('0x37')]=_[_0x3fef('0x38')](_0x10b803[_0x3fef('0x34')],_0x10b803[_0x3fef('0x35')]);_0x1136b3[_0x3fef('0x39')]=_[_0x3fef('0x38')](_0x10b803[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x3c4483['query'][_0x3fef('0x3a')]));_0x1136b3[_0x3fef('0x39')]=_0x1136b3[_0x3fef('0x39')][_0x3fef('0x3b')]?_0x1136b3[_0x3fef('0x39')]:_0x10b803[_0x3fef('0x34')];if(!_0x3c4483['query']['hasOwnProperty'](_0x3fef('0x3c'))){_0x1136b3[_0x3fef('0x22')]=qs[_0x3fef('0x22')](_0x3c4483[_0x3fef('0x35')][_0x3fef('0x22')]);_0x1136b3[_0x3fef('0x24')]=qs[_0x3fef('0x24')](_0x3c4483[_0x3fef('0x35')][_0x3fef('0x24')]);}_0x1136b3[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x3c4483['query'][_0x3fef('0x3e')]);_0x1136b3[_0x3fef('0x3f')]=qs['filters'](_['pick'](_0x3c4483[_0x3fef('0x35')],_0x10b803[_0x3fef('0x37')]),_0x355c03);if(_0x3c4483[_0x3fef('0x35')][_0x3fef('0x40')]){_0x1136b3[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0x1136b3[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x30')](_0x355c03,function(_0x577ab8){if(_0x577ab8[_0x3fef('0x33')]!==_0x3fef('0x42')){var _0x2859db={};_0x2859db[_0x577ab8[_0x3fef('0x2e')]]={'$like':'%'+_0x3c4483[_0x3fef('0x35')][_0x3fef('0x40')]+'%'};return _0x2859db;}})});}_0x1136b3=_[_0x3fef('0x41')]({},_0x1136b3,_0x3c4483[_0x3fef('0x43')]);var _0x3df52b={'where':_0x1136b3[_0x3fef('0x3f')]};return db[_0x3fef('0x31')][_0x3fef('0x23')](_0x3df52b)[_0x3fef('0x2b')](function(_0x15d2c7){_0x464763[_0x3fef('0x23')]=_0x15d2c7;if(_0x3c4483['query'][_0x3fef('0x44')]){_0x1136b3[_0x3fef('0x45')]=[{'all':!![]}];}return db[_0x3fef('0x31')][_0x3fef('0x46')](_0x1136b3);})[_0x3fef('0x2b')](function(_0x33b145){_0x464763['rows']=_0x33b145;return _0x464763;})[_0x3fef('0x2b')](respondWithFilteredResult(_0x16009a,_0x1136b3))['catch'](handleError(_0x16009a,null));};exports[_0x3fef('0x47')]=function(_0x40a206,_0x59e3b0){var _0xa1a53d={'raw':![],'where':{'id':_0x40a206[_0x3fef('0x48')]['id']}},_0x4e662c={};_0x4e662c[_0x3fef('0x34')]=_[_0x3fef('0x36')](db[_0x3fef('0x31')][_0x3fef('0x32')]);_0x4e662c[_0x3fef('0x35')]=_[_0x3fef('0x36')](_0x40a206[_0x3fef('0x35')]);_0x4e662c[_0x3fef('0x37')]=_[_0x3fef('0x38')](_0x4e662c[_0x3fef('0x34')],_0x4e662c[_0x3fef('0x35')]);_0xa1a53d[_0x3fef('0x39')]=_['intersection'](_0x4e662c[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x40a206['query'][_0x3fef('0x3a')]));_0xa1a53d[_0x3fef('0x39')]=_0xa1a53d[_0x3fef('0x39')]['length']?_0xa1a53d[_0x3fef('0x39')]:_0x4e662c[_0x3fef('0x34')];if(_0x40a206['query'][_0x3fef('0x44')]){_0xa1a53d['include']=[{'all':!![]}];}_0xa1a53d=_['merge']({},_0xa1a53d,_0x40a206[_0x3fef('0x43')]);return db['VoicePrefix'][_0x3fef('0x49')](_0xa1a53d)[_0x3fef('0x2b')](handleEntityNotFound(_0x59e3b0,null))['then'](respondWithResult(_0x59e3b0,null))[_0x3fef('0x4a')](handleError(_0x59e3b0,null));};exports[_0x3fef('0x29')]=function(_0x2f8bb2,_0x5902b1){return db[_0x3fef('0x31')][_0x3fef('0x49')]({'where':{'id':_0x2f8bb2[_0x3fef('0x48')]['id']}})['then'](handleEntityNotFound(_0x5902b1,null))[_0x3fef('0x2b')](removeEntity(_0x5902b1,null))[_0x3fef('0x4a')](handleError(_0x5902b1,null));};exports[_0x3fef('0x4b')]=function(_0x6a5321,_0x3ae6a7){return db['VoicePrefix'][_0x3fef('0x4b')]()[_0x3fef('0x2b')](respondWithResult(_0x3ae6a7,null))[_0x3fef('0x4a')](handleError(_0x3ae6a7,null));};exports[_0x3fef('0x4c')]=function(_0x3dc5b5,_0x15be93){var _0x3f9d35;return db[_0x3fef('0x4d')][_0x3fef('0x4e')](function(_0x4862a5){return db['VoicePrefix'][_0x3fef('0x4c')](_0x3dc5b5[_0x3fef('0x4f')],{'transaction':_0x4862a5})[_0x3fef('0x2b')](function(_0x29c619){_0x3f9d35=_0x29c619[_0x3fef('0x50')]({'plain':!![]});return db[_0x3fef('0x51')][_0x3fef('0x49')]({'where':{'id':_0x3f9d35[_0x3fef('0x52')]},'raw':!![]})[_0x3fef('0x2b')](function(_0x36e054){return createVoicePrefixExtensions(_0x3f9d35,_0x36e054,_0x4862a5);});});})[_0x3fef('0x2b')](function(){var _0x109fac=_0x3dc5b5['user'][_0x3fef('0x50')]({'plain':!![]});if(!_0x109fac)throw new Error(_0x3fef('0x53'));if(_0x109fac[_0x3fef('0x54')]===_0x3fef('0x55')){var _0x5b0415=_0x3f9d35;return db[_0x3fef('0x56')][_0x3fef('0x49')]({'where':{'name':_0x3fef('0x2a'),'userProfileId':_0x109fac[_0x3fef('0x57')]},'raw':!![]})['then'](function(_0x189d48){if(_0x189d48&&_0x189d48[_0x3fef('0x58')]===0x0){return db[_0x3fef('0x59')]['create']({'name':_0x5b0415['name'],'resourceId':_0x5b0415['id'],'type':_0x189d48[_0x3fef('0x2e')],'sectionId':_0x189d48['id']},{})[_0x3fef('0x2b')](function(){return _0x3f9d35;});}else{return _0x3f9d35;}})[_0x3fef('0x4a')](function(_0x3370ef){logger['error'](_0x3fef('0x5a'),_0x3370ef);throw _0x3370ef;});}return _0x3f9d35;})['then'](respondWithResult(_0x15be93,null))[_0x3fef('0x4a')](handleError(_0x15be93,null));};function Extension(_0x48a329,_0x43b311,_0x4cc6de,_0x155fcb){this[_0x3fef('0x5b')]=_0x3fef('0x5c');this['exten']=_0x48a329;this['app']=_0x4cc6de;this[_0x3fef('0x33')]=_0x3fef('0x5d');this[_0x3fef('0x5e')]=_0x3fef('0x5f');this[_0x3fef('0x60')]=_0x43b311;this[_0x3fef('0x61')]=_0x155fcb;}function createVoicePrefixExtensions(_0x1095b6,_0x2b9a5e,_0x5493a8){return new BPromise(function(_0x12ffca,_0x4b6d74){var _0x5ec4e7=new Extension(formatPrefixName(_0x1095b6[_0x3fef('0x62')]),0x1,_0x3fef('0x63'),_0x3fef('0x64'));_0x5ec4e7[_0x3fef('0x65')]=_0x1095b6['id'];return db[_0x3fef('0x51')][_0x3fef('0x4c')](_0x5ec4e7,{'transaction':_0x5493a8})[_0x3fef('0x2b')](function(_0x187c0f){var _0x62e2c4=_0x187c0f['get']({'plain':!![]});var _0x2d36fd=_['map'](addVoicePrefixExtensions(_0x1095b6,_0x2b9a5e),function(_0xc01327){_0xc01327[_0x3fef('0x52')]=_0x62e2c4['id'];_0xc01327[_0x3fef('0x65')]=_0x1095b6['id'];return _0xc01327;});return db[_0x3fef('0x51')][_0x3fef('0x66')](_0x2d36fd,{'transaction':_0x5493a8})[_0x3fef('0x2b')](function(_0x4a4631){if(!_0x4a4631){return _0x4b6d74(_0x3fef('0x67'));}else{return _0x12ffca(_0x4a4631);}})[_0x3fef('0x4a')](function(_0x3e98fb){return _0x4b6d74(_0x3e98fb);});});;});};function addVoicePrefixExtensions(_0x200d07,_0x6cc4a3){var _0x40bd7e=[];var _0x10b869=formatPrefixName(_0x200d07[_0x3fef('0x62')]);_0x40bd7e[_0x3fef('0x68')](new Extension(_0x10b869,0x2,_0x3fef('0x69'),_0x3fef('0x6a')+_0x200d07['name']));if(_0x200d07[_0x3fef('0x6b')]){_0x40bd7e['push'](new Extension(_0x10b869,0x3,'Set','PREFIX-CALLERIDALL='+_0x200d07[_0x3fef('0x6b')]));}else{_0x40bd7e['push'](new Extension(_0x10b869,0x3,_0x3fef('0x63'),_0x3fef('0x6c')));}_0x40bd7e[_0x3fef('0x68')](new Extension(_0x10b869,0x4,'goto',_0x6cc4a3[_0x3fef('0x5b')]+','+'${EXTEN:'+(0x8+_0x200d07[_0x3fef('0x2e')][_0x3fef('0x3b')])+'}'+','+0x1));return _0x40bd7e;}function formatPrefixName(_0x51ea04){var _0x1d0ae0='_';for(var _0x458583=0x0;_0x458583<_0x51ea04[_0x3fef('0x3b')];_0x458583++){if(_0x51ea04[_0x3fef('0x6d')](_0x458583)=='-'){_0x1d0ae0+=_0x51ea04[_0x3fef('0x6d')](_0x458583);}else{_0x1d0ae0+='['+_0x51ea04[_0x3fef('0x6d')](_0x458583)+']';}}_0x1d0ae0+='.';return _0x1d0ae0;}exports[_0x3fef('0x28')]=function(_0x1362ce,_0x4fde10,_0x25467e){var _0x410951=_0x1362ce[_0x3fef('0x4f')];_0x410951[_0x3fef('0x62')]=_0x3fef('0x6e')+_0x410951[_0x3fef('0x2e')]+'-';return db[_0x3fef('0x4d')][_0x3fef('0x4e')](function(_0xaff567){return db[_0x3fef('0x31')][_0x3fef('0x28')](_0x410951,{'where':{'id':_0x410951['id']},'transaction':_0xaff567})[_0x3fef('0x2b')](function(){return db[_0x3fef('0x51')][_0x3fef('0x29')]({'where':{'VoicePrefixId':_0x410951['id']},'transaction':_0xaff567})['then'](function(){return db[_0x3fef('0x51')][_0x3fef('0x49')]({'where':{'id':_0x410951[_0x3fef('0x52')]},'raw':!![]})['then'](function(_0x5e430a){return createVoicePrefixExtensions(_0x410951,_0x5e430a,_0xaff567);});});});})['then'](function(){return db[_0x3fef('0x31')][_0x3fef('0x6f')](_0x410951['id']);})[_0x3fef('0x2b')](respondWithResult(_0x4fde10,null))[_0x3fef('0x4a')](handleError(_0x4fde10,null));};exports['addAgents']=function(_0x441f1f,_0x17856b,_0x2f9b5f){return db[_0x3fef('0x31')]['find']({'where':{'id':_0x441f1f[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](handleEntityNotFound(_0x17856b,null))[_0x3fef('0x2b')](function(_0xf80bab){if(_0xf80bab){return _0xf80bab[_0x3fef('0x70')](_0x441f1f['body'][_0x3fef('0x71')],_['omit'](_0x441f1f[_0x3fef('0x4f')],['ids','id'])||{})[_0x3fef('0x72')](function(_0x13b272){for(var _0x2948c4=0x0;_0x2948c4<_0x441f1f[_0x3fef('0x4f')][_0x3fef('0x71')][_0x3fef('0x3b')];_0x2948c4+=0x1){socket[_0x3fef('0x73')](_0x3fef('0x74'),{'UserId':Number(_0x441f1f[_0x3fef('0x4f')]['ids'][_0x2948c4]),'VoicePrefixId':Number(_0x441f1f[_0x3fef('0x48')]['id'])});}return _0x13b272;});}})[_0x3fef('0x2b')](respondWithResult(_0x17856b,null))[_0x3fef('0x4a')](handleError(_0x17856b,null));};exports[_0x3fef('0x75')]=function(_0x4d8a00,_0x766e5d,_0x244d0b){return db[_0x3fef('0x31')][_0x3fef('0x49')]({'where':{'id':_0x4d8a00[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](handleEntityNotFound(_0x766e5d,null))['then'](function(_0x34aecb){if(_0x34aecb){return _0x34aecb[_0x3fef('0x75')](_0x4d8a00[_0x3fef('0x35')][_0x3fef('0x71')])[_0x3fef('0x2b')](function(){if(_[_0x3fef('0x76')](_0x4d8a00['query'][_0x3fef('0x71')])){for(var _0x414bfe=0x0;_0x414bfe<_0x4d8a00[_0x3fef('0x35')][_0x3fef('0x71')][_0x3fef('0x3b')];_0x414bfe+=0x1){socket['emit'](_0x3fef('0x77'),{'UserId':Number(_0x4d8a00[_0x3fef('0x35')][_0x3fef('0x71')][_0x414bfe]),'VoicePrefixId':Number(_0x4d8a00['params']['id'])});}}else{socket[_0x3fef('0x73')](_0x3fef('0x77'),{'UserId':Number(_0x4d8a00[_0x3fef('0x35')]['ids']),'VoicePrefixId':Number(_0x4d8a00['params']['id'])});}});}})[_0x3fef('0x2b')](respondWithStatusCode(_0x766e5d,null))[_0x3fef('0x4a')](handleError(_0x766e5d,null));};exports[_0x3fef('0x78')]=function(_0x25914c,_0x573323,_0x169b33){var _0x1361d2={};var _0x29b668={};var _0x5bf8b7;var _0x1cddf6;return db[_0x3fef('0x31')][_0x3fef('0x79')]({'where':{'id':_0x25914c[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](handleEntityNotFound(_0x573323,null))[_0x3fef('0x2b')](function(_0x277f65){if(_0x277f65){_0x5bf8b7=_0x277f65;_0x29b668['model']=_['keys'](db[_0x3fef('0x7a')]['rawAttributes']);_0x29b668[_0x3fef('0x35')]=_[_0x3fef('0x36')](_0x25914c[_0x3fef('0x35')]);_0x29b668['filters']=_[_0x3fef('0x38')](_0x29b668['model'],_0x29b668[_0x3fef('0x35')]);_0x1361d2['attributes']=_['intersection'](_0x29b668['model'],qs[_0x3fef('0x3a')](_0x25914c[_0x3fef('0x35')][_0x3fef('0x3a')]));_0x1361d2[_0x3fef('0x39')]=_0x1361d2[_0x3fef('0x39')][_0x3fef('0x3b')]?_0x1361d2[_0x3fef('0x39')]:_0x29b668['model'];_0x1361d2[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x25914c[_0x3fef('0x35')]['sort']);_0x1361d2[_0x3fef('0x3f')]=qs[_0x3fef('0x37')](_[_0x3fef('0x7b')](_0x25914c[_0x3fef('0x35')],_0x29b668['filters']));if(_0x25914c[_0x3fef('0x35')]['filter']){_0x1361d2[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0x1361d2[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x30')](_0x1361d2[_0x3fef('0x39')],function(_0x1804a5){var _0x3100c3={};_0x3100c3[_0x1804a5]={'$like':'%'+_0x25914c[_0x3fef('0x35')]['filter']+'%'};return _0x3100c3;})});}_0x1361d2=_[_0x3fef('0x41')]({},_0x1361d2,_0x25914c['options']);return _0x5bf8b7['getAgents'](_0x1361d2);}})[_0x3fef('0x2b')](function(_0x1b9cdc){if(_0x1b9cdc){_0x1cddf6=_0x1b9cdc[_0x3fef('0x3b')];if(!_0x25914c[_0x3fef('0x35')]['hasOwnProperty'](_0x3fef('0x3c'))){_0x1361d2[_0x3fef('0x22')]=qs[_0x3fef('0x22')](_0x25914c[_0x3fef('0x35')]['limit']);_0x1361d2[_0x3fef('0x24')]=qs[_0x3fef('0x24')](_0x25914c[_0x3fef('0x35')][_0x3fef('0x24')]);}return _0x5bf8b7[_0x3fef('0x78')](_0x1361d2);}})['then'](function(_0x27fd0b){if(_0x27fd0b){return _0x27fd0b?{'count':_0x1cddf6,'rows':_0x27fd0b}:null;}})[_0x3fef('0x2b')](respondWithResult(_0x573323,null))[_0x3fef('0x4a')](handleError(_0x573323,null));};exports[_0x3fef('0x7c')]=function(_0x14e142,_0x5894f5,_0xe6a6b7){var _0x26b1c0={};var _0x2000b2={};var _0x44310b;var _0x400fff;return db['VoicePrefix'][_0x3fef('0x79')]({'where':{'id':_0x14e142[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](handleEntityNotFound(_0x5894f5,null))[_0x3fef('0x2b')](function(_0x1a5f47){if(_0x1a5f47){_0x44310b=_0x1a5f47;_0x2000b2[_0x3fef('0x34')]=_['keys'](db['Team']['rawAttributes']);_0x2000b2['query']=_['keys'](_0x14e142[_0x3fef('0x35')]);_0x2000b2[_0x3fef('0x37')]=_[_0x3fef('0x38')](_0x2000b2[_0x3fef('0x34')],_0x2000b2[_0x3fef('0x35')]);_0x26b1c0['attributes']=_[_0x3fef('0x38')](_0x2000b2[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x14e142[_0x3fef('0x35')][_0x3fef('0x3a')]));_0x26b1c0[_0x3fef('0x39')]=_0x26b1c0[_0x3fef('0x39')]['length']?_0x26b1c0[_0x3fef('0x39')]:_0x2000b2['model'];_0x26b1c0[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x14e142[_0x3fef('0x35')][_0x3fef('0x3e')]);_0x26b1c0[_0x3fef('0x3f')]=qs[_0x3fef('0x37')](_[_0x3fef('0x7b')](_0x14e142['query'],_0x2000b2['filters']));if(_0x14e142['query']['filter']){_0x26b1c0[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0x26b1c0[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x30')](_0x26b1c0[_0x3fef('0x39')],function(_0x580a23){var _0x8d6d0e={};_0x8d6d0e[_0x580a23]={'$like':'%'+_0x14e142[_0x3fef('0x35')][_0x3fef('0x40')]+'%'};return _0x8d6d0e;})});}_0x26b1c0=_['merge']({},_0x26b1c0,_0x14e142[_0x3fef('0x43')]);return _0x44310b[_0x3fef('0x7c')](_0x26b1c0);}})['then'](function(_0x59654f){if(_0x59654f){_0x400fff=_0x59654f[_0x3fef('0x3b')];if(!_0x14e142['query'][_0x3fef('0x7d')](_0x3fef('0x3c'))){_0x26b1c0['limit']=qs[_0x3fef('0x22')](_0x14e142[_0x3fef('0x35')][_0x3fef('0x22')]);_0x26b1c0['offset']=qs[_0x3fef('0x24')](_0x14e142[_0x3fef('0x35')]['offset']);}return _0x44310b[_0x3fef('0x7c')](_0x26b1c0);}})[_0x3fef('0x2b')](function(_0xb08e2c){if(_0xb08e2c){return _0xb08e2c?{'count':_0x400fff,'rows':_0xb08e2c}:null;}})[_0x3fef('0x2b')](respondWithResult(_0x5894f5,null))['catch'](handleError(_0x5894f5,null));};exports['addTeams']=function(_0x91a872,_0x5ce3d8,_0x15cc4f){var _0x11a3d3=_0x91a872[_0x3fef('0x4f')][_0x3fef('0x71')];var _0x4e4a3c;return db[_0x3fef('0x7e')][_0x3fef('0x46')]({'where':{'id':_0x11a3d3},'attributes':['id'],'include':[{'model':db[_0x3fef('0x7a')],'as':_0x3fef('0x7f'),'attributes':['id','name',_0x3fef('0x80'),'voicePause',_0x3fef('0x81')],'raw':!![]}]})[_0x3fef('0x2b')](function(_0x578303){if(_0x578303){_0x4e4a3c=_0x578303;var _0x4c575a=_[_0x3fef('0x82')](_0x578303,function(_0xee8848){var _0x5089f2=_0xee8848[_0x3fef('0x50')]({'plain':!![]});return _0x5089f2[_0x3fef('0x7f')];});return db['VoicePrefix']['find']({'where':{'id':_0x91a872[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](function(_0x5e5b34){return db[_0x3fef('0x4d')][_0x3fef('0x4e')](function(_0x14c4bb){return _0x5e5b34['addTeams'](_0x11a3d3,{'transaction':_0x14c4bb})[_0x3fef('0x2b')](function(){return BPromise[_0x3fef('0x83')](_0x4e4a3c,function(_0x349180){return db[_0x3fef('0x84')][_0x3fef('0x85')]({'TeamId':_0x349180['id'],'VoicePrefixId':_0x91a872['params']['id']},{'transaction':_0x14c4bb});});})[_0x3fef('0x2b')](function(){return BPromise[_0x3fef('0x83')](_0x4c575a,function(_0x45ab57){return db['UserVoicePrefix'][_0x3fef('0x86')]({'where':{'UserId':_0x45ab57['id'],'VoicePrefixId':_0x91a872['params']['id']},'transaction':_0x14c4bb});});})['then'](function(){_0x4c575a[_0x3fef('0x87')](function(_0x1d43ba){socket['emit'](_0x3fef('0x74'),{'UserId':_0x1d43ba['id'],'VoicePrefixId':_0x5e5b34['id']});});});});});}})[_0x3fef('0x2b')](respondWithStatusCode(_0x5ce3d8,null))['catch'](handleError(_0x5ce3d8,null));};exports['removeTeams']=function(_0x373a45,_0x1a792b,_0x34e182){return db['Team'][_0x3fef('0x46')]({'where':{'id':_0x373a45[_0x3fef('0x35')][_0x3fef('0x71')]},'attributes':['id'],'include':[{'model':db[_0x3fef('0x7a')],'as':_0x3fef('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x3fef('0x2b')](handleEntityNotFound(_0x1a792b,null))[_0x3fef('0x2b')](function(_0x114585){var _0x4725dd=_[_0x3fef('0x30')](_0x114585,'id');var _0x3b9285=[];var _0x550ba3=[];var _0x778837=squel[_0x3fef('0x88')]();_0x778837[_0x3fef('0x89')](_0x3fef('0x8a'))['from'](_0x3fef('0x8b'),'tq')[_0x3fef('0x8c')](_0x3fef('0x8d'),'ut',_0x3fef('0x8e'))['where']('VoicePrefixId\x20=\x20?',_0x373a45[_0x3fef('0x48')]['id']);for(var _0x9110ca=0x0;_0x9110ca<_0x114585[_0x3fef('0x3b')];_0x9110ca+=0x1){let _0x2bb28c=_0x114585[_0x9110ca];for(var _0x99fa04=0x0;_0x99fa04<_0x2bb28c['Agents'][_0x3fef('0x3b')];_0x99fa04+=0x1){let _0x2aa67e=_0x2bb28c['Agents'][_0x99fa04];var _0x541b46=_0x778837[_0x3fef('0x8f')]();_0x541b46[_0x3fef('0x3f')](_0x3fef('0x90'),_0x2aa67e['id']);_0x550ba3[_0x3fef('0x68')](db[_0x3fef('0x4d')][_0x3fef('0x35')](_0x541b46['toString'](),{'type':db['sequelize'][_0x3fef('0x91')]['SELECT']})[_0x3fef('0x2b')](function(_0x18afc9){if(_0x18afc9[_0x3fef('0x3b')]===0x1){return _0x2aa67e['id'];}else{var _0x5b6489=_[_0x3fef('0x92')](_[_0x3fef('0x30')](_0x18afc9,_0x3fef('0x93')),function(_0x259fc1){return _['includes'](_0x4725dd,_0x259fc1);});if(_0x5b6489){return _0x2aa67e['id'];}}}));}}return BPromise[_0x3fef('0x94')](_0x550ba3)[_0x3fef('0x2b')](function(_0x37b1a3){_0x3b9285=_(_0x3b9285)[_0x3fef('0x95')](_0x37b1a3)['compact']()[_0x3fef('0x96')]();return db[_0x3fef('0x31')][_0x3fef('0x49')]({'where':{'id':_0x373a45[_0x3fef('0x48')]['id']}})[_0x3fef('0x2b')](function(_0x446bab){return db[_0x3fef('0x4d')][_0x3fef('0x4e')](function(_0x2eddc5){return _0x446bab['removeTeams'](_0x373a45['query'][_0x3fef('0x71')],{'transaction':_0x2eddc5})[_0x3fef('0x2b')](function(){if(!_[_0x3fef('0x97')](_0x3b9285)){return _0x446bab[_0x3fef('0x75')](_0x3b9285,{'transaction':_0x2eddc5});}})['then'](function(){_0x3b9285[_0x3fef('0x87')](function(_0x2e642d){socket[_0x3fef('0x73')]('userVoicePrefix:remove',{'UserId':_0x2e642d,'VoicePrefixId':_0x446bab['id']});});});});});});})[_0x3fef('0x2b')](respondWithStatusCode(_0x1a792b,null))['catch'](handleError(_0x1a792b,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 6fcb672..647123a 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 _0x643d=['emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners','update'];(function(_0x4668a6,_0x4e8a1f){var _0x23215d=function(_0x4f4cfc){while(--_0x4f4cfc){_0x4668a6['push'](_0x4668a6['shift']());}};_0x23215d(++_0x4e8a1f);}(_0x643d,0xbb));var _0xd643=function(_0x4e690f,_0x375bc4){_0x4e690f=_0x4e690f-0x0;var _0x23f962=_0x643d[_0x4e690f];return _0x23f962;};'use strict';var EventEmitter=require(_0xd643('0x0'));var VoicePrefix=require(_0xd643('0x1'))['db'][_0xd643('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xd643('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd643('0x4'),'afterDestroy':'remove'};function emitEvent(_0x294109){return function(_0x4011b2,_0x36e33a,_0x16014a){VoicePrefixEvents[_0xd643('0x5')](_0x294109+':'+_0x4011b2['id'],_0x4011b2);VoicePrefixEvents['emit'](_0x294109,_0x4011b2);_0x16014a(null);};}for(var e in events){if(events[_0xd643('0x6')](e)){var event=events[e];VoicePrefix[_0xd643('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x179e=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x179e,0x1b0));var _0xe179=function(_0x19ab8d,_0x88a91e){_0x19ab8d=_0x19ab8d-0x0;var _0x280e19=_0x179e[_0x19ab8d];return _0x280e19;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xe179('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xe179('0x1')](0x0);var events={'afterCreate':_0xe179('0x2'),'afterUpdate':_0xe179('0x3'),'afterDestroy':'remove'};function emitEvent(_0x10ed74){return function(_0x5deb5a,_0x2ce467,_0x4b115e){VoicePrefixEvents['emit'](_0x10ed74+':'+_0x5deb5a['id'],_0x5deb5a);VoicePrefixEvents[_0xe179('0x4')](_0x10ed74,_0x5deb5a);_0x4b115e(null);};}for(var e in events){if(events[_0xe179('0x5')](e)){var event=events[e];VoicePrefix['hook'](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 4237d88..3b92e20 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 _0x2b90=['VoicePrefix','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b90,0x1da));var _0x02b9=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x2b90[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x02b9('0x0'))(_0x02b9('0x1'));var moment=require(_0x02b9('0x2'));var BPromise=require(_0x02b9('0x3'));var rp=require(_0x02b9('0x4'));var fs=require('fs');var path=require(_0x02b9('0x5'));var rimraf=require(_0x02b9('0x6'));var config=require(_0x02b9('0x7'));var attributes=require('./voicePrefix.attributes');module[_0x02b9('0x8')]=function(_0x2cfee7,_0x4ec817){return _0x2cfee7[_0x02b9('0x9')](_0x02b9('0xa'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc7ec=['./voicePrefix.attributes','exports','define','voice_prefixes','lodash','util','api','moment','bluebird','../../config/environment'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xc7ec,0x112));var _0xcc7e=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0xc7ec[_0x504df1];return _0x1063b5;};'use strict';var _=require(_0xcc7e('0x0'));var util=require(_0xcc7e('0x1'));var logger=require('../../config/logger')(_0xcc7e('0x2'));var moment=require(_0xcc7e('0x3'));var BPromise=require(_0xcc7e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcc7e('0x5'));var attributes=require(_0xcc7e('0x6'));module[_0xcc7e('0x7')]=function(_0xd60561,_0x2caf5c){return _0xd60561[_0xcc7e('0x8')]('VoicePrefix',attributes,{'tableName':_0xcc7e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 4be07c1..ff7b3f9 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 _0x8561=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','redis','localhost','then','info','request\x20sent','debug','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','util','moment','randomstring'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8561,0x1b2));var _0x1856=function(_0x518e12,_0x3491ad){_0x518e12=_0x518e12-0x0;var _0x1da7ff=_0x8561[_0x518e12];return _0x1da7ff;};'use strict';var _=require('lodash');var util=require(_0x1856('0x0'));var moment=require(_0x1856('0x1'));var BPromise=require('bluebird');var rs=require(_0x1856('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1856('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1856('0x4'))('rpc');var config=require(_0x1856('0x5'));var jayson=require(_0x1856('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x1856('0x7')]=_['defaults'](config['redis'],{'host':_0x1856('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x1bfad8,_0x3e47b3,_0x510505){return new BPromise(function(_0x55fe85,_0x97f276){return client['request'](_0x1bfad8,_0x510505)[_0x1856('0x9')](function(_0x584a8e){logger[_0x1856('0xa')]('VoicePrefix,\x20%s,\x20%s',_0x3e47b3,_0x1856('0xb'));logger[_0x1856('0xc')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x3e47b3,_0x1856('0xb'),JSON[_0x1856('0xd')](_0x584a8e));if(_0x584a8e[_0x1856('0xe')]){if(_0x584a8e['error'][_0x1856('0xf')]===0x1f4){logger[_0x1856('0xe')](_0x1856('0x10'),_0x3e47b3,_0x584a8e['error'][_0x1856('0x11')]);return _0x97f276(_0x584a8e[_0x1856('0xe')][_0x1856('0x11')]);}logger[_0x1856('0xe')](_0x1856('0x10'),_0x3e47b3,_0x584a8e[_0x1856('0xe')][_0x1856('0x11')]);return _0x55fe85(_0x584a8e['error']['message']);}else{logger[_0x1856('0xa')]('VoicePrefix,\x20%s,\x20%s',_0x3e47b3,'request\x20sent');_0x55fe85(_0x584a8e[_0x1856('0x12')][_0x1856('0x11')]);}})['catch'](function(_0x4f5381){logger[_0x1856('0xe')](_0x1856('0x10'),_0x3e47b3,_0x4f5381);_0x97f276(_0x4f5381);});});} \ No newline at end of file +var _0x4991=['localhost','socket.io-emitter','./voicePrefix.socket','then','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','VoicePrefix,\x20%s,\x20%s','info','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x4a04de,_0x2e342c){var _0xbbe018=function(_0x39639c){while(--_0x39639c){_0x4a04de['push'](_0x4a04de['shift']());}};_0xbbe018(++_0x2e342c);}(_0x4991,0xf7));var _0x1499=function(_0x28e4f2,_0x4e041b){_0x28e4f2=_0x28e4f2-0x0;var _0x40402f=_0x4991[_0x28e4f2];return _0x40402f;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var moment=require(_0x1499('0x1'));var BPromise=require('bluebird');var rs=require(_0x1499('0x2'));var fs=require('fs');var Redis=require(_0x1499('0x3'));var db=require(_0x1499('0x4'))['db'];var utils=require(_0x1499('0x5'));var logger=require(_0x1499('0x6'))(_0x1499('0x7'));var config=require(_0x1499('0x8'));var jayson=require(_0x1499('0x9'));var client=jayson['client'][_0x1499('0xa')]({'port':0x232a});config[_0x1499('0xb')]=_[_0x1499('0xc')](config[_0x1499('0xb')],{'host':_0x1499('0xd'),'port':0x18eb});var socket=require(_0x1499('0xe'))(new Redis(config[_0x1499('0xb')]));require(_0x1499('0xf'))['register'](socket);function respondWithRpcPromise(_0x16e8ad,_0x36a053,_0x575251){return new BPromise(function(_0x2a4816,_0x352180){return client['request'](_0x16e8ad,_0x575251)[_0x1499('0x10')](function(_0x2867b1){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x36a053,'request\x20sent');logger[_0x1499('0x11')](_0x1499('0x12'),_0x36a053,_0x1499('0x13'),JSON[_0x1499('0x14')](_0x2867b1));if(_0x2867b1[_0x1499('0x15')]){if(_0x2867b1['error']['code']===0x1f4){logger[_0x1499('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x36a053,_0x2867b1[_0x1499('0x15')][_0x1499('0x16')]);return _0x352180(_0x2867b1[_0x1499('0x15')][_0x1499('0x16')]);}logger['error'](_0x1499('0x17'),_0x36a053,_0x2867b1[_0x1499('0x15')]['message']);return _0x2a4816(_0x2867b1[_0x1499('0x15')][_0x1499('0x16')]);}else{logger[_0x1499('0x18')](_0x1499('0x17'),_0x36a053,_0x1499('0x13'));_0x2a4816(_0x2867b1[_0x1499('0x19')]['message']);}})['catch'](function(_0x5bcb5f){logger[_0x1499('0x15')](_0x1499('0x17'),_0x36a053,_0x5bcb5f);_0x352180(_0x5bcb5f);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index f349115..9c8d880 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 _0x2572=['length','voicePrefix:','./voicePrefix.events','save','remove','update','emit','removeListener','register'];(function(_0x5bd4f6,_0xf4e45c){var _0x33a165=function(_0x37eef6){while(--_0x37eef6){_0x5bd4f6['push'](_0x5bd4f6['shift']());}};_0x33a165(++_0xf4e45c);}(_0x2572,0x110));var _0x2257=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x2572[_0x28947d];return _0x12d2ee;};'use strict';var VoicePrefixEvents=require(_0x2257('0x0'));var events=[_0x2257('0x1'),_0x2257('0x2'),_0x2257('0x3')];function createListener(_0x2682b5,_0x9a1f42){return function(_0x1b6556){_0x9a1f42[_0x2257('0x4')](_0x2682b5,_0x1b6556);};}function removeListener(_0x2e2640,_0x5bb654){return function(){VoicePrefixEvents[_0x2257('0x5')](_0x2e2640,_0x5bb654);};}exports[_0x2257('0x6')]=function(_0x43ffe5){for(var _0xa5bd9=0x0,_0x26b2c6=events[_0x2257('0x7')];_0xa5bd9<_0x26b2c6;_0xa5bd9++){var _0x74aec6=events[_0xa5bd9];var _0x380460=createListener(_0x2257('0x8')+_0x74aec6,_0x43ffe5);VoicePrefixEvents['on'](_0x74aec6,_0x380460);}}; \ No newline at end of file +var _0x152f=['emit','register','length','voicePrefix:','./voicePrefix.events','save','remove','update'];(function(_0x42a36f,_0x285170){var _0x2decd1=function(_0x4117f8){while(--_0x4117f8){_0x42a36f['push'](_0x42a36f['shift']());}};_0x2decd1(++_0x285170);}(_0x152f,0x144));var _0xf152=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x152f[_0x3054be];return _0x3df150;};'use strict';var VoicePrefixEvents=require(_0xf152('0x0'));var events=[_0xf152('0x1'),_0xf152('0x2'),_0xf152('0x3')];function createListener(_0x2f10f5,_0x5d5893){return function(_0x2d77c1){_0x5d5893[_0xf152('0x4')](_0x2f10f5,_0x2d77c1);};}function removeListener(_0x40c14a,_0x303e32){return function(){VoicePrefixEvents['removeListener'](_0x40c14a,_0x303e32);};}exports[_0xf152('0x5')]=function(_0x542973){for(var _0xa9deff=0x0,_0x504fb6=events[_0xf152('0x6')];_0xa9deff<_0x504fb6;_0xa9deff++){var _0x5ec158=events[_0xa9deff];var _0x5206b3=createListener(_0xf152('0x7')+_0x5ec158,_0x542973);VoicePrefixEvents['on'](_0x5ec158,_0x5206b3);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index f797ecf..adb3430 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xb10b,0x12a));var _0xbb10=function(_0x565f9b,_0x3697c0){_0x565f9b=_0x565f9b-0x0;var _0x1a27f9=_0xb10b[_0x565f9b];return _0x1a27f9;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x3d1607,_0xe64b2c){var _0x544cda=function(_0x3b72fa){while(--_0x3b72fa){_0x3d1607['push'](_0x3d1607['shift']());}};_0x544cda(++_0xe64b2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 950f866..4ecdf47 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 _0x97c6=['mandatoryDisposition','sequelize','STRING','name','inbound','default','ENUM','leastrecent','fewestcalls','random','rrmemory','wrandom','setDataValue','strategy','getDataValue','type','dialMethod','outbound','booked','roundrobin','includes','INTEGER','yes','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','power','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x43e529,_0x1e8d9c){var _0x47c744=function(_0x117e1e){while(--_0x117e1e){_0x43e529['push'](_0x43e529['shift']());}};_0x47c744(++_0x1e8d9c);}(_0x97c6,0x1aa));var _0x697c=function(_0x37d3f3,_0xca010f){_0x37d3f3=_0x37d3f3-0x0;var _0x185c9c=_0x97c6[_0x37d3f3];return _0x185c9c;};'use strict';var Sequelize=require(_0x697c('0x0'));module['exports']={'name':{'type':Sequelize[_0x697c('0x1')],'allowNull':![],'unique':_0x697c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound','outbound'),'allowNull':![],'defaultValue':_0x697c('0x3')},'musiconhold':{'type':Sequelize[_0x697c('0x1')],'defaultValue':_0x697c('0x4')},'announce':{'type':Sequelize[_0x697c('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x697c('0x5')]('rr','ringall',_0x697c('0x6'),_0x697c('0x7'),_0x697c('0x8'),_0x697c('0x9'),'linear',_0x697c('0xa'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x47975f){this[_0x697c('0xb')](_0x697c('0xc'),_0x47975f?_0x47975f:_0x697c('0x9'));},'get':function(){var _0x54d814=this[_0x697c('0xd')](_0x697c('0xe'));var _0x9dfeac=this[_0x697c('0xd')](_0x697c('0xf'));var _0x1f7dd7=this['getDataValue'](_0x697c('0xc'));if(_0x54d814===_0x697c('0x10')){if(_0x9dfeac==='preview'){return null;}if(_0x9dfeac===_0x697c('0x11')&&!['rrmemory',_0x697c('0x12')][_0x697c('0x13')](_0x1f7dd7)){this['setDataValue']('strategy',_0x697c('0x9'));}}return _0x1f7dd7;}},'servicelevel':{'type':Sequelize[_0x697c('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x697c('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x697c('0x14')](0xb)},'timeout':{'type':Sequelize[_0x697c('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x697c('0x1')]},'weight':{'type':Sequelize[_0x697c('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x697c('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x697c('0x5')](_0x697c('0x15'),'no'),'defaultValue':_0x697c('0x15')},'autopause':{'type':Sequelize[_0x697c('0x5')]('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x697c('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x697c('0x5')](_0x697c('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x697c('0x5')](_0x697c('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x697c('0x5')](_0x697c('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x697c('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x697c('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x697c('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x697c('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x697c('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x697c('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x697c('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x697c('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x697c('0x5')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x697c('0x15'),'no'),'defaultValue':_0x697c('0x15')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x697c('0x15'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x697c('0x5')](_0x697c('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x697c('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x697c('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x697c('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x697c('0x1')]},'queue_youarenext':{'type':Sequelize[_0x697c('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x697c('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x697c('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x697c('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x697c('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x697c('0x1')]},'queue_quantity1':{'type':Sequelize[_0x697c('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x697c('0x1')]},'queue_less_than':{'type':Sequelize[_0x697c('0x1')]},'periodic_announce':{'type':Sequelize[_0x697c('0x16')],'set':function(_0x7e3ad4){this['setDataValue'](_0x697c('0x17'),_0x7e3ad4?_0x7e3ad4[_0x697c('0x18')](','):[]);},'get':function(){return this['getDataValue'](_0x697c('0x17'))?this[_0x697c('0xd')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0x697c('0x1')],'defaultValue':_0x697c('0x15'),'set':function(_0x3cf562){this[_0x697c('0xb')](_0x697c('0x19'),_0x3cf562?_0x3cf562[_0x697c('0x18')](','):undefined);},'get':function(){return this[_0x697c('0xd')](_0x697c('0x19'))?this[_0x697c('0xd')]('joinempty')[_0x697c('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x697c('0x1')],'defaultValue':'no','set':function(_0x7832de){this[_0x697c('0xb')](_0x697c('0x1b'),_0x7832de?_0x7832de['join'](','):undefined);},'get':function(){return this[_0x697c('0xd')](_0x697c('0x1b'))?this[_0x697c('0xd')](_0x697c('0x1b'))[_0x697c('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x697c('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x697c('0x5')](_0x697c('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x697c('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x697c('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x697c('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x697c('0x1c')],'defaultValue':0x0,'set':function(_0x48c1f){this[_0x697c('0xb')](_0x697c('0x1d'),_0x48c1f);if(_0x48c1f){if(this[_0x697c('0xd')]('wrapuptime')<0x2){this[_0x697c('0xb')](_0x697c('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x697c('0x1c')],'defaultValue':0x0,'comment':_0x697c('0x1f')},'dialMethod':{'type':Sequelize[_0x697c('0x5')](_0x697c('0x20'),'progressive',_0x697c('0x21'),'predictive',_0x697c('0x11')),'defaultValue':_0x697c('0x22'),'comment':_0x697c('0x23')},'dialLimitChannel':{'type':Sequelize[_0x697c('0x14')](0x4)[_0x697c('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x697c('0x25')},'dialLimitQueue':{'type':Sequelize[_0x697c('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x697c('0x26')},'dialPowerLevel':{'type':Sequelize[_0x697c('0x27')](0x2)[_0x697c('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x697c('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x697c('0x5')](_0x697c('0x29'),_0x697c('0x2a')),'defaultValue':_0x697c('0x2a'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x697c('0x27')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x697c('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x697c('0x14')](0x3)[_0x697c('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x697c('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x697c('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x697c('0x2d')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x697c('0x2e'),'comment':_0x697c('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x697c('0x30')},'dialQueueProject':{'type':Sequelize[_0x697c('0x1')],'comment':_0x697c('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x697c('0x14')](0x3)[_0x697c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x697c('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x697c('0x14')](0x5)[_0x697c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x697c('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x697c('0x14')](0x3)[_0x697c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x697c('0x34')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x697c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x697c('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x697c('0x14')](0x3)[_0x697c('0x24')],'defaultValue':0x3,'comment':_0x697c('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x697c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x697c('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x697c('0x37')},'dialTimezone':{'type':Sequelize[_0x697c('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x697c('0x1')],'defaultValue':_0x697c('0x38')},'dialPrefix':{'type':Sequelize[_0x697c('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x697c('0x5')]('always',_0x697c('0x39'),_0x697c('0x3a')),'defaultValue':_0x697c('0x3b')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x697c('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0x697c('0x14')](0x9)[_0x697c('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x697c('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x697c('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x697c('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x697c('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x697c('0x14')](0x9)[_0x697c('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x697c('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0x697c('0x14')](0x9)[_0x697c('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x697c('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x697c('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x697c('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x697c('0x14')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x697c('0x42')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x697c('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x697c('0x43')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x697c('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x697c('0x44')},'dialRecallMeTimeout':{'type':Sequelize[_0x697c('0x14')](0x5)[_0x697c('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x697c('0x45')},'dialRecallInQueue':{'type':Sequelize[_0x697c('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x697c('0x46')),'defaultValue':_0x697c('0x47')},'dialQueueProject2':{'type':Sequelize[_0x697c('0x1')],'comment':_0x697c('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x697c('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x697c('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x697c('0x48')},'dialCutDigit':{'type':Sequelize[_0x697c('0x14')](0x3)[_0x697c('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x697c('0x49')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x697c('0x14')](0x3)[_0x697c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x697c('0x4a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x697c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x697c('0x4b')},'dialDropMaxRetry':{'type':Sequelize[_0x697c('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x697c('0x4c')},'dialDropRetryFrequency':{'type':Sequelize[_0x697c('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x697c('0x14')](0x3)[_0x697c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x697c('0x4d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x697c('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x697c('0x4e')},'dialMachineMaxRetry':{'type':Sequelize[_0x697c('0x14')](0x3)[_0x697c('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x697c('0x4f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x697c('0x14')](0x5)[_0x697c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x697c('0x50')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x697c('0x14')](0x5)[_0x697c('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x697c('0x51')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x697c('0x52')},'mandatoryDisposition':{'type':Sequelize[_0x697c('0x1c')],'defaultValue':![],'comment':_0x697c('0x53'),'set':function(_0x4cd390){if(!_0x4cd390)this[_0x697c('0xb')]('mandatoryDispositionPauseId',null);this[_0x697c('0xb')](_0x697c('0x54'),_0x4cd390);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x697c('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x697c('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x697c('0x1c')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x697c('0x14')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x95a1=['Active/Disactive\x20Campaign','progressive','Dial\x20Method.','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\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\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','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\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)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','ENUM','inbound','outbound','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','type','dialMethod','preview','booked','includes','INTEGER','yes','once','TEXT','periodic_announce','join','getDataValue','split','joinempty','leavewhenempty','BOOLEAN'];(function(_0x36c5ca,_0x37648f){var _0x4532cc=function(_0x13c21f){while(--_0x13c21f){_0x36c5ca['push'](_0x36c5ca['shift']());}};_0x4532cc(++_0x37648f);}(_0x95a1,0x118));var _0x195a=function(_0x2783a7,_0x1df894){_0x2783a7=_0x2783a7-0x0;var _0x1cb990=_0x95a1[_0x2783a7];return _0x1cb990;};'use strict';var Sequelize=require('sequelize');module[_0x195a('0x0')]={'name':{'type':Sequelize[_0x195a('0x1')],'allowNull':![],'unique':_0x195a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x195a('0x3')](_0x195a('0x4'),_0x195a('0x5')),'allowNull':![],'defaultValue':_0x195a('0x4')},'musiconhold':{'type':Sequelize[_0x195a('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x195a('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x195a('0x3')]('rr',_0x195a('0x6'),_0x195a('0x7'),_0x195a('0x8'),_0x195a('0x9'),_0x195a('0xa'),_0x195a('0xb'),_0x195a('0xc'),_0x195a('0xd')),'allowNull':![],'defaultValue':'ringall','set':function(_0x32b4b8){this[_0x195a('0xe')](_0x195a('0xf'),_0x32b4b8?_0x32b4b8:_0x195a('0xa'));},'get':function(){var _0xc131fc=this['getDataValue'](_0x195a('0x10'));var _0x281661=this['getDataValue'](_0x195a('0x11'));var _0x2c2551=this['getDataValue'](_0x195a('0xf'));if(_0xc131fc===_0x195a('0x5')){if(_0x281661===_0x195a('0x12')){return null;}if(_0x281661===_0x195a('0x13')&&![_0x195a('0xa'),'roundrobin'][_0x195a('0x14')](_0x2c2551)){this[_0x195a('0xe')](_0x195a('0xf'),_0x195a('0xa'));}}return _0x2c2551;}},'servicelevel':{'type':Sequelize[_0x195a('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x195a('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x195a('0x15')](0xb)},'timeout':{'type':Sequelize[_0x195a('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x195a('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x195a('0x1')]},'weight':{'type':Sequelize[_0x195a('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x195a('0x3')](_0x195a('0x16'),'no'),'defaultValue':_0x195a('0x16')},'autopause':{'type':Sequelize[_0x195a('0x3')]('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x195a('0x3')](_0x195a('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x195a('0x3')](_0x195a('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x195a('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x195a('0x3')](_0x195a('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x195a('0x3')](_0x195a('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x195a('0x3')](_0x195a('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x195a('0x3')](_0x195a('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x195a('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x195a('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x195a('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x195a('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x195a('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x195a('0x3')](_0x195a('0x16'),'no'),'defaultValue':_0x195a('0x16')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x195a('0x16'),'no',_0x195a('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x195a('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x195a('0x3')](_0x195a('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x195a('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x195a('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x195a('0x1')]},'queue_youarenext':{'type':Sequelize[_0x195a('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x195a('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x195a('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x195a('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x195a('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x195a('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x195a('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x195a('0x1')]},'queue_quantity2':{'type':Sequelize[_0x195a('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x195a('0x1')]},'queue_less_than':{'type':Sequelize[_0x195a('0x1')]},'periodic_announce':{'type':Sequelize[_0x195a('0x18')],'set':function(_0x465110){this[_0x195a('0xe')](_0x195a('0x19'),_0x465110?_0x465110[_0x195a('0x1a')](','):[]);},'get':function(){return this[_0x195a('0x1b')](_0x195a('0x19'))?this[_0x195a('0x1b')](_0x195a('0x19'))[_0x195a('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x195a('0x1')],'defaultValue':_0x195a('0x16'),'set':function(_0x4911e4){this[_0x195a('0xe')]('joinempty',_0x4911e4?_0x4911e4['join'](','):undefined);},'get':function(){return this[_0x195a('0x1b')](_0x195a('0x1d'))?this['getDataValue'](_0x195a('0x1d'))[_0x195a('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x195a('0x1')],'defaultValue':'no','set':function(_0x1b42a3){this[_0x195a('0xe')]('leavewhenempty',_0x1b42a3?_0x1b42a3[_0x195a('0x1a')](','):undefined);},'get':function(){return this[_0x195a('0x1b')](_0x195a('0x1e'))?this[_0x195a('0x1b')](_0x195a('0x1e'))[_0x195a('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x195a('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x195a('0x3')](_0x195a('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x195a('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x195a('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x1ffe49){this[_0x195a('0xe')]('acw',_0x1ffe49);if(_0x1ffe49){if(this[_0x195a('0x1b')]('wrapuptime')<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x195a('0x1f')],'defaultValue':0x0,'comment':_0x195a('0x20')},'dialMethod':{'type':Sequelize['ENUM'](_0x195a('0x12'),_0x195a('0x21'),'power','predictive',_0x195a('0x13')),'defaultValue':'progressive','comment':_0x195a('0x22')},'dialLimitChannel':{'type':Sequelize[_0x195a('0x15')](0x4)[_0x195a('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x195a('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x195a('0x24')](0x2)[_0x195a('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x195a('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x195a('0x3')](_0x195a('0x26'),_0x195a('0x27')),'defaultValue':'dropRate','comment':_0x195a('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x195a('0x24')](0x2)[_0x195a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x195a('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x195a('0x15')](0x3)[_0x195a('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x195a('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x195a('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x195a('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x195a('0x15')](0x3)[_0x195a('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x195a('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x195a('0x1')],'defaultValue':'tTxX','comment':_0x195a('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x195a('0x15')](0x3)[_0x195a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x195a('0x2d')},'dialQueueProject':{'type':Sequelize[_0x195a('0x1')],'comment':_0x195a('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x195a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x195a('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x195a('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x195a('0x15')](0x3)[_0x195a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x195a('0x15')](0x5)[_0x195a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x195a('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x195a('0x15')](0x3)[_0x195a('0x23')],'defaultValue':0x3,'comment':_0x195a('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x195a('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x195a('0x32')},'dialGlobalMaxRetry':{'type':Sequelize[_0x195a('0x15')](0x3)[_0x195a('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x195a('0x33')},'dialTimezone':{'type':Sequelize[_0x195a('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x195a('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x195a('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x195a('0x3')](_0x195a('0x34'),_0x195a('0x35'),_0x195a('0x36')),'defaultValue':_0x195a('0x34')},'dialAMDActive':{'type':Sequelize[_0x195a('0x1f')],'defaultValue':0x0,'comment':_0x195a('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0x195a('0x15')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x195a('0x15')](0x9)[_0x195a('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x195a('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x195a('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x195a('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x195a('0x15')](0x9)[_0x195a('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x195a('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x195a('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x195a('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x195a('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x195a('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x195a('0x15')](0x5)[_0x195a('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x195a('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x195a('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x195a('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x195a('0x15')](0x5)[_0x195a('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x195a('0x3f')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x195a('0x40'),_0x195a('0x41')),'defaultValue':_0x195a('0x40')},'dialQueueProject2':{'type':Sequelize[_0x195a('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x195a('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x195a('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x195a('0x15')](0x3)[_0x195a('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x195a('0x42')},'dialCutDigit':{'type':Sequelize[_0x195a('0x15')](0x3)[_0x195a('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x195a('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x195a('0x15')](0x5)[_0x195a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x195a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x195a('0x15')](0x5)[_0x195a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x195a('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x195a('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x195a('0x45')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x195a('0x15')](0x5)[_0x195a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x195a('0x46')},'dialMachineMaxRetry':{'type':Sequelize[_0x195a('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x195a('0x47')},'dialMachineRetryFrequency':{'type':Sequelize[_0x195a('0x15')](0x5)[_0x195a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x195a('0x48')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x195a('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x195a('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x195a('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x195a('0x15')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x195a('0x4b'),'set':function(_0x4c6c34){if(!_0x4c6c34)this[_0x195a('0xe')](_0x195a('0x4c'),null);this['setDataValue'](_0x195a('0x4d'),_0x4c6c34);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x195a('0x15')](0x3)[_0x195a('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x195a('0x15')](0x3)[_0x195a('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x195a('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x195a('0x15')](0x3)[_0x195a('0x23')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 49360a6..f420473 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 _0x7fbe=['send','VoiceQueue','rawAttributes','fieldName','key','where','include','query','findAll','rows','catch','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','inbound','outbound','update','getHoppers','findOne','hasOwnProperty','nolimit','order','sort','VoiceQueueId','CmHopper','CmHopperHistory','pick','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','forEach','penalty','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','interface','format','SIP/%s','voicePause','userVoiceQueue:save','removeTeams','ids','User','select','field','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','transaction','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','emit','online','isNil','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','cm_contacts','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','get','VoiceQueues','QueueCampaigns','filter','map','value','type','name','sendStatus','error'];(function(_0x292a0b,_0x3b2a29){var _0x2f3ccc=function(_0x337cff){while(--_0x337cff){_0x292a0b['push'](_0x292a0b['shift']());}};_0x2f3ccc(++_0x3b2a29);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x56e5a4,_0x3378ff){_0x56e5a4=_0x56e5a4-0x0;var _0x446855=_0x7fbe[_0x56e5a4];return _0x446855;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xe7fb('0x0'));var _=require(_0xe7fb('0x1'));var squel=require(_0xe7fb('0x2'));var Redis=require(_0xe7fb('0x3'));var qs=require(_0xe7fb('0x4'));var logger=require(_0xe7fb('0x5'))(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var db=require(_0xe7fb('0x8'))['db'];config[_0xe7fb('0x9')]=_[_0xe7fb('0xa')](config[_0xe7fb('0x9')],{'host':_0xe7fb('0xb'),'port':0x18eb});var socket=require(_0xe7fb('0xc'))(new Redis(config['redis']));require(_0xe7fb('0xd'))[_0xe7fb('0xe')](socket);function respondWithStatusCode(_0x1d0741,_0x190a7a){_0x190a7a=_0x190a7a||0xcc;return function(_0x4ba197){if(_0x4ba197){return _0x1d0741['sendStatus'](_0x190a7a);}return _0x1d0741[_0xe7fb('0xf')](_0x190a7a)[_0xe7fb('0x10')]();};}function respondWithResult(_0x41a514,_0x348a73){_0x348a73=_0x348a73||0xc8;return function(_0x2a2223){if(_0x2a2223){return _0x41a514[_0xe7fb('0xf')](_0x348a73)[_0xe7fb('0x11')](_0x2a2223);}};}function respondWithFilteredResult(_0x3c07f3,_0x325035){return function(_0x2fe8ab){if(_0x2fe8ab){var _0x2437d4=typeof _0x325035[_0xe7fb('0x12')]===_0xe7fb('0x13')&&typeof _0x325035[_0xe7fb('0x14')]===_0xe7fb('0x13');var _0x598729=_0x2fe8ab[_0xe7fb('0x15')];var _0x2225e5=_0x2437d4?0x0:_0x325035['offset'];var _0x30015a=_0x2437d4?_0x2fe8ab[_0xe7fb('0x15')]:_0x325035['offset']+_0x325035[_0xe7fb('0x14')];var _0x559129;if(_0x30015a>=_0x598729){_0x30015a=_0x598729;_0x559129=0xc8;}else{_0x559129=0xce;}_0x3c07f3[_0xe7fb('0xf')](_0x559129);return _0x3c07f3[_0xe7fb('0x16')](_0xe7fb('0x17'),_0x2225e5+'-'+_0x30015a+'/'+_0x598729)[_0xe7fb('0x11')](_0x2fe8ab);}return null;};}function saveUpdates(_0x562262){return function(_0x892b0f){if(_0x892b0f){return _0x892b0f['update'](_0x562262)[_0xe7fb('0x18')](function(_0x546463){return _0x546463;});}return null;};}function removeEntity(_0x1e77fd){return function(_0x4708f7){if(_0x4708f7){return _0x4708f7[_0xe7fb('0x19')]()[_0xe7fb('0x18')](function(){var _0x5df1a1=_0x4708f7[_0xe7fb('0x1a')]({'plain':!![]});var _0x5d1c87=[{'name':_0xe7fb('0x1b'),'value':'inbound','ignore':![]},{'name':_0xe7fb('0x1c'),'value':'outbound','ignore':![]}];var _0xa5af01=_(_0x5d1c87)[_0xe7fb('0x1d')]('ignore')[_0xe7fb('0x1e')](_0xe7fb('0x1f'))[_0xe7fb('0x1f')]();if(_['includes'](_0xa5af01,_0x5df1a1[_0xe7fb('0x20')])){return;}var _0x469ead=_['find'](_0x5d1c87,['value',_0x5df1a1['type']])[_0xe7fb('0x21')];return db['UserProfileResource']['destroy']({'where':{'type':_0x469ead,'resourceId':_0x5df1a1['id']}})[_0xe7fb('0x18')](function(){return _0x4708f7;});})[_0xe7fb('0x18')](function(){_0x1e77fd[_0xe7fb('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6c930){return function(_0x2b69c4){if(!_0x2b69c4){_0x6c930[_0xe7fb('0x22')](0x194);}return _0x2b69c4;};}function handleError(_0x1ceed8,_0x392d75){_0x392d75=_0x392d75||0x1f4;return function(_0x16237a){logger[_0xe7fb('0x23')](_0x16237a['stack']);if(_0x16237a['name']){delete _0x16237a[_0xe7fb('0x21')];}_0x1ceed8[_0xe7fb('0xf')](_0x392d75)[_0xe7fb('0x24')](_0x16237a);};}exports['index']=function(_0xb1f2f4,_0x251807){var _0xd3fffe={};var _0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x1e')](db[_0xe7fb('0x25')][_0xe7fb('0x26')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x27')],'type':_0x4ce993[_0xe7fb('0x20')][_0xe7fb('0x28')]};});_0xd3fffe=qs['getOptions'](_0x219554,_0xb1f2f4);var _0x517d70={'where':_0xd3fffe[_0xe7fb('0x29')]};return db['VoiceQueue'][_0xe7fb('0x15')](_0x517d70)[_0xe7fb('0x18')](function(_0xe49053){_0x5f265f[_0xe7fb('0x15')]=_0xe49053;_0xd3fffe['include']=qs[_0xe7fb('0x2a')](_0xb1f2f4[_0xe7fb('0x2b')]);return db[_0xe7fb('0x25')][_0xe7fb('0x2c')](_0xd3fffe);})[_0xe7fb('0x18')](function(_0x480819){_0x5f265f[_0xe7fb('0x2d')]=_0x480819;return _0x5f265f;})[_0xe7fb('0x18')](respondWithFilteredResult(_0x251807,_0xd3fffe))[_0xe7fb('0x2e')](handleError(_0x251807,null));};exports[_0xe7fb('0x2f')]=function(_0x46f430,_0x25e925){var _0x1bc72d={'raw':![],'where':{'id':_0x46f430[_0xe7fb('0x30')]['id']}},_0x147eb1={};_0x147eb1['model']=_[_0xe7fb('0x31')](db[_0xe7fb('0x25')][_0xe7fb('0x26')]);_0x147eb1['query']=_[_0xe7fb('0x31')](_0x46f430[_0xe7fb('0x2b')]);_0x147eb1[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x147eb1[_0xe7fb('0x34')],_0x147eb1[_0xe7fb('0x2b')]);_0x1bc72d[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x147eb1[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x46f430[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x1bc72d[_0xe7fb('0x35')]=_0x1bc72d[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x1bc72d[_0xe7fb('0x35')]:_0x147eb1[_0xe7fb('0x34')];if(_0x46f430[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x1bc72d['include']=[{'all':!![]}];}_0x1bc72d=_[_0xe7fb('0x39')]({},_0x1bc72d,_0x46f430[_0xe7fb('0x3a')]);return db[_0xe7fb('0x25')][_0xe7fb('0x3b')](_0x1bc72d)['then'](handleEntityNotFound(_0x25e925,null))[_0xe7fb('0x18')](respondWithResult(_0x25e925,null))[_0xe7fb('0x2e')](handleError(_0x25e925,null));};exports[_0xe7fb('0x3c')]=function(_0x413a13,_0x49fe9d){return db[_0xe7fb('0x25')][_0xe7fb('0x3c')](_0x413a13[_0xe7fb('0x3d')],{})[_0xe7fb('0x18')](function(_0x468d16){var _0xb729fc=_0x413a13['user'][_0xe7fb('0x1a')]({'plain':!![]});if(!_0xb729fc)throw new Error(_0xe7fb('0x3e'));if(_0xb729fc[_0xe7fb('0x3f')]==='user'){var _0x36a341=_0x468d16[_0xe7fb('0x1a')]({'plain':!![]});var _0x5d42ac=[{'name':'VoiceQueues','value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x900d67=_[_0xe7fb('0x3b')](_0x5d42ac,[_0xe7fb('0x1f'),_0x36a341['type']])[_0xe7fb('0x21')];return db['UserProfileSection'][_0xe7fb('0x3b')]({'where':{'name':_0x900d67,'userProfileId':_0xb729fc[_0xe7fb('0x40')]},'raw':!![]})['then'](function(_0x108a16){if(_0x108a16&&_0x108a16[_0xe7fb('0x41')]===0x0){return db[_0xe7fb('0x42')][_0xe7fb('0x3c')]({'name':_0x36a341['name'],'resourceId':_0x36a341['id'],'type':_0x108a16[_0xe7fb('0x21')],'sectionId':_0x108a16['id']},{})[_0xe7fb('0x18')](function(){return _0x468d16;});}else{return _0x468d16;}})[_0xe7fb('0x2e')](function(_0x56a84f){logger[_0xe7fb('0x23')](_0xe7fb('0x43'),_0x56a84f);throw _0x56a84f;});}return _0x468d16;})[_0xe7fb('0x18')](respondWithResult(_0x49fe9d,0xc9))[_0xe7fb('0x2e')](handleError(_0x49fe9d,null));};exports[_0xe7fb('0x44')]=function(_0x5a1ce1,_0x2eb999){var _0x4df4aa={'where':{'id':_0x5a1ce1[_0xe7fb('0x30')]['id']}},_0x2c72dd={};_0x2c72dd[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x25')]['rawAttributes']);_0x4df4aa[_0xe7fb('0x35')]=_['intersection'](_0x2c72dd['model'],qs[_0xe7fb('0x36')](_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x4df4aa['attributes']=_0x4df4aa[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x4df4aa['attributes']:_0x2c72dd['model'];if(_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x4df4aa[_0xe7fb('0x2a')]=[{'all':!![]}];}_0x4df4aa=_[_0xe7fb('0x39')]({},_0x4df4aa,_0x5a1ce1[_0xe7fb('0x3a')]);return db[_0xe7fb('0x25')][_0xe7fb('0x3b')](_0x4df4aa)[_0xe7fb('0x18')](handleEntityNotFound(_0x2eb999,null))['then'](function(_0x925a5e){if(_0x925a5e){var _0x5cc28f=_0x925a5e[_0xe7fb('0x1a')]({'plain':!![]});_0x5cc28f=qs[_0xe7fb('0x45')](_0x5cc28f,['id','createdAt',_0xe7fb('0x46')]);_0x5a1ce1['body']=_[_0xe7fb('0x45')](_0x5a1ce1['body'],['id',_0xe7fb('0x47'),'updatedAt']);return db[_0xe7fb('0x25')]['create'](_[_0xe7fb('0x39')](_0x5cc28f,_0x5a1ce1[_0xe7fb('0x3d')]),{'include':_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x38')]?[{'all':!![]}]:undefined})[_0xe7fb('0x18')](function(_0x2f959d){var _0x2f4760=_0x5a1ce1['user']['get']({'plain':!![]});if(!_0x2f4760)throw new Error(_0xe7fb('0x3e'));if(_0x2f4760['role']==='user'){var _0x4c3eb7=_0x2f959d['get']({'plain':!![]});var _0x539252=[{'name':_0xe7fb('0x1b'),'value':_0xe7fb('0x48')},{'name':_0xe7fb('0x1c'),'value':_0xe7fb('0x49')}];var _0x59c92d=_[_0xe7fb('0x3b')](_0x539252,[_0xe7fb('0x1f'),_0x4c3eb7[_0xe7fb('0x20')]])['name'];return db['UserProfileSection'][_0xe7fb('0x3b')]({'where':{'name':_0x59c92d,'userProfileId':_0x2f4760[_0xe7fb('0x40')]},'raw':!![]})[_0xe7fb('0x18')](function(_0x4f4ba3){if(_0x4f4ba3&&_0x4f4ba3[_0xe7fb('0x41')]===0x0){return db[_0xe7fb('0x42')][_0xe7fb('0x3c')]({'name':_0x4c3eb7[_0xe7fb('0x21')],'resourceId':_0x4c3eb7['id'],'type':_0x4f4ba3['name'],'sectionId':_0x4f4ba3['id']},{})['then'](function(){return _0x2f959d;});}else{return _0x2f959d;}})[_0xe7fb('0x2e')](function(_0x3104c2){logger[_0xe7fb('0x23')](_0xe7fb('0x43'),_0x3104c2);throw _0x3104c2;});}return _0x2f959d;});}})[_0xe7fb('0x18')](respondWithResult(_0x2eb999,0xc9))['catch'](handleError(_0x2eb999,null));};exports[_0xe7fb('0x4a')]=function(_0x349a2a,_0x23755b){if(_0x349a2a['body']['id']){delete _0x349a2a['body']['id'];}return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x349a2a[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x23755b,null))[_0xe7fb('0x18')](saveUpdates(_0x349a2a[_0xe7fb('0x3d')],null))['then'](respondWithResult(_0x23755b,null))[_0xe7fb('0x2e')](handleError(_0x23755b,null));};exports[_0xe7fb('0x19')]=function(_0x2cd4e5,_0x1aef59){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x2cd4e5['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x1aef59,null))['then'](removeEntity(_0x1aef59,null))[_0xe7fb('0x2e')](handleError(_0x1aef59,null));};exports[_0xe7fb('0x4b')]=function(_0x116c7e,_0x1b24fd){var _0x5925e6={'raw':![],'where':{}};var _0x47ac92={};var _0x2789a4={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x116c7e[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x1b24fd,null))['then'](function(_0x4096d4){if(_0x4096d4){_0x47ac92['model']=_[_0xe7fb('0x31')](db['CmHopper']['rawAttributes']);_0x47ac92[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x116c7e[_0xe7fb('0x2b')]);_0x47ac92['filters']=_[_0xe7fb('0x33')](_0x47ac92[_0xe7fb('0x34')],_0x47ac92[_0xe7fb('0x2b')]);_0x5925e6[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x47ac92['model'],qs[_0xe7fb('0x36')](_0x116c7e[_0xe7fb('0x2b')]['fields']));_0x5925e6[_0xe7fb('0x35')]=_0x5925e6[_0xe7fb('0x35')]['length']?_0x5925e6[_0xe7fb('0x35')]:_0x47ac92['model'];if(!_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x5925e6['limit']=qs[_0xe7fb('0x14')](_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x5925e6[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}_0x5925e6[_0xe7fb('0x4f')]=qs['sort'](_0x116c7e['query'][_0xe7fb('0x50')]);_0x5925e6[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_['pick'](_0x116c7e['query'],_0x47ac92[_0xe7fb('0x32')]));_0x5925e6[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x4096d4['id'];if(_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x5925e6[_0xe7fb('0x29')]=_[_0xe7fb('0x39')](_0x5925e6[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x5925e6[_0xe7fb('0x35')],function(_0x1ff5e7){var _0xf423ab={};_0xf423ab[_0x1ff5e7]={'$like':'%'+_0x116c7e[_0xe7fb('0x2b')]['filter']+'%'};return _0xf423ab;})});}_0x5925e6=_['merge']({},_0x5925e6,_0x116c7e[_0xe7fb('0x3a')]);return db[_0xe7fb('0x52')][_0xe7fb('0x15')]({'where':_0x5925e6[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x562493){_0x2789a4[_0xe7fb('0x15')]=_0x562493;if(_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x5925e6[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x52')][_0xe7fb('0x2c')](_0x5925e6);})[_0xe7fb('0x18')](function(_0x1e6256){_0x2789a4[_0xe7fb('0x2d')]=_0x1e6256;return _0x2789a4;});}})['then'](respondWithFilteredResult(_0x1b24fd,_0x5925e6))[_0xe7fb('0x2e')](handleError(_0x1b24fd,null));};exports['getHopperHistories']=function(_0x279663,_0x2f13f2){var _0x2a2079={'raw':!![],'where':{}};var _0x31c159={};var _0x318d06={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x279663[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x2f13f2,null))[_0xe7fb('0x18')](function(_0x15d881){if(_0x15d881){_0x31c159[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x53')][_0xe7fb('0x26')]);_0x31c159[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x279663[_0xe7fb('0x2b')]);_0x31c159[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x31c159['model'],_0x31c159['query']);_0x2a2079['attributes']=_[_0xe7fb('0x33')](_0x31c159[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x279663[_0xe7fb('0x2b')]['fields']));_0x2a2079[_0xe7fb('0x35')]=_0x2a2079[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x2a2079[_0xe7fb('0x35')]:_0x31c159['model'];if(!_0x279663[_0xe7fb('0x2b')]['hasOwnProperty'](_0xe7fb('0x4e'))){_0x2a2079[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x2a2079['offset']=qs[_0xe7fb('0x12')](_0x279663['query'][_0xe7fb('0x12')]);}_0x2a2079['order']=qs[_0xe7fb('0x50')](_0x279663[_0xe7fb('0x2b')]['sort']);_0x2a2079[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x279663[_0xe7fb('0x2b')],_0x31c159['filters']));_0x2a2079[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x15d881['id'];if(_0x279663[_0xe7fb('0x2b')]['filter']){_0x2a2079[_0xe7fb('0x29')]=_['merge'](_0x2a2079['where'],{'$or':_['map'](_0x2a2079[_0xe7fb('0x35')],function(_0x27019a){var _0x4a8a65={};_0x4a8a65[_0x27019a]={'$like':'%'+_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x4a8a65;})});}_0x2a2079=_[_0xe7fb('0x39')]({},_0x2a2079,_0x279663[_0xe7fb('0x3a')]);return db[_0xe7fb('0x53')][_0xe7fb('0x15')]({'where':_0x2a2079[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x42190e){_0x318d06[_0xe7fb('0x15')]=_0x42190e;if(_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x2a2079[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x53')][_0xe7fb('0x2c')](_0x2a2079);})[_0xe7fb('0x18')](function(_0x3c5bd9){_0x318d06[_0xe7fb('0x2d')]=_0x3c5bd9;return _0x318d06;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x2f13f2,_0x2a2079))[_0xe7fb('0x2e')](handleError(_0x2f13f2,null));};exports['getHopperFinals']=function(_0x47568c,_0x185ac0){var _0xc3958f={'raw':!![],'where':{}};var _0x1b8fdb={};var _0x19fe06={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x47568c['params']['id']}})['then'](handleEntityNotFound(_0x185ac0,null))[_0xe7fb('0x18')](function(_0x4e1865){if(_0x4e1865){_0x1b8fdb[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db['CmHopperFinal'][_0xe7fb('0x26')]);_0x1b8fdb[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x47568c[_0xe7fb('0x2b')]);_0x1b8fdb[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x1b8fdb['model'],_0x1b8fdb[_0xe7fb('0x2b')]);_0xc3958f[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x1b8fdb[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x47568c[_0xe7fb('0x2b')]['fields']));_0xc3958f['attributes']=_0xc3958f['attributes'][_0xe7fb('0x37')]?_0xc3958f[_0xe7fb('0x35')]:_0x1b8fdb[_0xe7fb('0x34')];if(!_0x47568c['query'][_0xe7fb('0x4d')]('nolimit')){_0xc3958f[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0xc3958f['offset']=qs[_0xe7fb('0x12')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}_0xc3958f[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0xc3958f[_0xe7fb('0x29')]=qs['filters'](_['pick'](_0x47568c[_0xe7fb('0x2b')],_0x1b8fdb['filters']));_0xc3958f[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x4e1865['id'];if(_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0xc3958f['where']=_['merge'](_0xc3958f[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0xc3958f['attributes'],function(_0x21cb12){var _0x431d21={};_0x431d21[_0x21cb12]={'$like':'%'+_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x431d21;})});}_0xc3958f=_[_0xe7fb('0x39')]({},_0xc3958f,_0x47568c[_0xe7fb('0x3a')]);return db['CmHopperFinal'][_0xe7fb('0x15')]({'where':_0xc3958f[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x2607b9){_0x19fe06[_0xe7fb('0x15')]=_0x2607b9;if(_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0xc3958f[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x55')][_0xe7fb('0x2c')](_0xc3958f);})[_0xe7fb('0x18')](function(_0x3b1a90){_0x19fe06[_0xe7fb('0x2d')]=_0x3b1a90;return _0x19fe06;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x185ac0,_0xc3958f))[_0xe7fb('0x2e')](handleError(_0x185ac0,null));};exports[_0xe7fb('0x56')]=function(_0x27c100,_0x19e86f){var _0x4b4cf6={'raw':!![],'where':{}};var _0x173d85={};var _0xa1368a={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x27c100['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x19e86f,null))[_0xe7fb('0x18')](function(_0x4ca09c){if(_0x4ca09c){_0x173d85[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x57')]['rawAttributes']);_0x173d85[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x27c100['query']);_0x173d85['filters']=_[_0xe7fb('0x33')](_0x173d85[_0xe7fb('0x34')],_0x173d85[_0xe7fb('0x2b')]);_0x4b4cf6[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x173d85[_0xe7fb('0x34')],qs['fields'](_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x4b4cf6[_0xe7fb('0x35')]=_0x4b4cf6['attributes'][_0xe7fb('0x37')]?_0x4b4cf6[_0xe7fb('0x35')]:_0x173d85[_0xe7fb('0x34')];if(!_0x27c100[_0xe7fb('0x2b')]['hasOwnProperty'](_0xe7fb('0x4e'))){_0x4b4cf6[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x27c100['query'][_0xe7fb('0x14')]);_0x4b4cf6[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x27c100[_0xe7fb('0x2b')]['offset']);}_0x4b4cf6[_0xe7fb('0x4f')]=qs['sort'](_0x27c100[_0xe7fb('0x2b')]['sort']);_0x4b4cf6[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_['pick'](_0x27c100['query'],_0x173d85[_0xe7fb('0x32')]));_0x4b4cf6['where'][_0xe7fb('0x51')]=_0x4ca09c['id'];if(_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x4b4cf6[_0xe7fb('0x29')]=_['merge'](_0x4b4cf6[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x4b4cf6[_0xe7fb('0x35')],function(_0x27a822){var _0x5505e5={};_0x5505e5[_0x27a822]={'$like':'%'+_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x5505e5;})});}_0x4b4cf6=_[_0xe7fb('0x39')]({},_0x4b4cf6,_0x27c100[_0xe7fb('0x3a')]);return db[_0xe7fb('0x57')]['count']({'where':_0x4b4cf6[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x54233){_0xa1368a[_0xe7fb('0x15')]=_0x54233;if(_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x4b4cf6[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x57')][_0xe7fb('0x2c')](_0x4b4cf6);})['then'](function(_0x795e32){_0xa1368a[_0xe7fb('0x2d')]=_0x795e32;return _0xa1368a;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x19e86f,_0x4b4cf6))[_0xe7fb('0x2e')](handleError(_0x19e86f,null));};exports[_0xe7fb('0x58')]=function(_0x16f2b1,_0x3a8154){var _0x51335c={};var _0x4f4772={};var _0x4ef7b4;var _0x1bcee7;return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x16f2b1['params']['id']}})['then'](handleEntityNotFound(_0x3a8154,null))[_0xe7fb('0x18')](function(_0x5bd869){if(_0x5bd869){_0x4ef7b4=_0x5bd869;_0x4f4772[_0xe7fb('0x34')]=_['keys'](db[_0xe7fb('0x59')][_0xe7fb('0x26')]);_0x4f4772[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x16f2b1[_0xe7fb('0x2b')]);_0x4f4772[_0xe7fb('0x32')]=_['intersection'](_0x4f4772[_0xe7fb('0x34')],_0x4f4772[_0xe7fb('0x2b')]);_0x51335c[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x4f4772[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x16f2b1[_0xe7fb('0x2b')]['fields']));_0x51335c[_0xe7fb('0x35')]=_0x51335c[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x51335c[_0xe7fb('0x35')]:_0x4f4772['model'];_0x51335c[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x51335c[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x16f2b1['query'],_0x4f4772['filters']));if(_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x51335c['where']=_[_0xe7fb('0x39')](_0x51335c['where'],{'$or':_[_0xe7fb('0x1e')](_0x51335c[_0xe7fb('0x35')],function(_0x220d72){var _0x5ea91d={};_0x5ea91d[_0x220d72]={'$like':'%'+_0x16f2b1['query'][_0xe7fb('0x1d')]+'%'};return _0x5ea91d;})});}_0x51335c=_['merge']({},_0x51335c,_0x16f2b1['options']);return _0x4ef7b4[_0xe7fb('0x58')](_0x51335c);}})[_0xe7fb('0x18')](function(_0x3b073e){if(_0x3b073e){_0x1bcee7=_0x3b073e[_0xe7fb('0x37')];if(!_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x51335c[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x51335c[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x4ef7b4[_0xe7fb('0x58')](_0x51335c);}})[_0xe7fb('0x18')](function(_0x249d6f){if(_0x249d6f){return _0x249d6f?{'count':_0x1bcee7,'rows':_0x249d6f}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x3a8154,null))['catch'](handleError(_0x3a8154,null));};exports[_0xe7fb('0x5a')]=function(_0x19ebe2,_0x3406ed){var _0x1631cc=_0x19ebe2['body'][_0xe7fb('0x5b')];var _0x21ee89=_[_0xe7fb('0x1e')](_0x1631cc,'id');return db[_0xe7fb('0x59')][_0xe7fb('0x2c')]({'where':{'id':_0x21ee89},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe7fb('0x21'),'online','voicePause','interface'],'raw':!![]}]})[_0xe7fb('0x18')](function(_0x5a97c8){if(_0x5a97c8){var _0x503ae2=_['flatMap'](_0x5a97c8,function(_0x2ccf71){var _0x35be16=_0x2ccf71[_0xe7fb('0x1a')]({'plain':!![]});_0x35be16[_0xe7fb('0x5c')][_0xe7fb('0x5d')](function(_0x1db971){_0x1db971['penalty']=_['find'](_0x1631cc,{'id':_0x35be16['id']})[_0xe7fb('0x5e')];});return _0x35be16['Agents'];});return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x19ebe2[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(_0x3891ed){return db[_0xe7fb('0x5f')]['transaction'](function(_0x4aa499){return _0x3891ed[_0xe7fb('0x5a')](_0x21ee89,{'transaction':_0x4aa499})[_0xe7fb('0x18')](function(){return BPromise[_0xe7fb('0x60')](_0x1631cc,function(_0x7a7a6b){return db[_0xe7fb('0x61')][_0xe7fb('0x62')]({'TeamId':_0x7a7a6b['id'],'VoiceQueueId':_0x19ebe2['params']['id'],'penalty':_0x7a7a6b[_0xe7fb('0x5e')]},{'transaction':_0x4aa499});});})[_0xe7fb('0x18')](function(){return BPromise[_0xe7fb('0x60')](_0x503ae2,function(_0x33d638){return db[_0xe7fb('0x63')]['findOrCreate']({'where':{'UserId':_0x33d638['id'],'VoiceQueueId':_0x19ebe2[_0xe7fb('0x30')]['id']},'defaults':{'penalty':_0x33d638[_0xe7fb('0x5e')]},'transaction':_0x4aa499});});})[_0xe7fb('0x18')](function(){return BPromise['each'](_['filter'](_0x503ae2,{'online':!![]}),function(_0x5d30ef){return db[_0xe7fb('0x64')]['upsert']({'membername':_0x5d30ef['name'],'UserId':_0x5d30ef['id'],'queue_name':_0x3891ed[_0xe7fb('0x21')],'VoiceQueueId':_0x3891ed['id'],'interface':_['isNil'](_0x5d30ef[_0xe7fb('0x65')])?util[_0xe7fb('0x66')](_0xe7fb('0x67'),_0x5d30ef[_0xe7fb('0x21')]):_0x5d30ef[_0xe7fb('0x65')],'paused':_0x5d30ef[_0xe7fb('0x68')]||![],'penalty':_0x5d30ef[_0xe7fb('0x5e')]},{'transaction':_0x4aa499});});})['then'](function(){_0x503ae2[_0xe7fb('0x5d')](function(_0x16e9d4){socket['emit'](_0xe7fb('0x69'),{'UserId':_0x16e9d4['id'],'VoiceQueueId':_0x3891ed['id']});});});});});}})[_0xe7fb('0x18')](respondWithStatusCode(_0x3406ed,null))[_0xe7fb('0x2e')](handleError(_0x3406ed,null));};exports[_0xe7fb('0x6a')]=function(_0x366acb,_0x4d2c92){return db['Team'][_0xe7fb('0x2c')]({'where':{'id':_0x366acb[_0xe7fb('0x2b')][_0xe7fb('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xe7fb('0x6c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe7fb('0x18')](handleEntityNotFound(_0x4d2c92,null))[_0xe7fb('0x18')](function(_0x2e276c){var _0x4efcdc=_[_0xe7fb('0x1e')](_0x2e276c,'id');var _0x146fc9=[];var _0x470718=[];var _0x55048c=squel[_0xe7fb('0x6d')]();_0x55048c[_0xe7fb('0x6e')]('tq.TeamId')[_0xe7fb('0x6f')](_0xe7fb('0x70'),'tq')['join'](_0xe7fb('0x71'),'ut',_0xe7fb('0x72'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x366acb[_0xe7fb('0x30')]['id']);for(var _0x5d9b58=0x0;_0x5d9b58<_0x2e276c['length'];_0x5d9b58+=0x1){let _0x5986f1=_0x2e276c[_0x5d9b58];for(var _0x23ec12=0x0;_0x23ec12<_0x5986f1[_0xe7fb('0x5c')][_0xe7fb('0x37')];_0x23ec12+=0x1){let _0x36be03=_0x5986f1['Agents'][_0x23ec12];var _0x29de1e=_0x55048c[_0xe7fb('0x44')]();_0x29de1e['where']('ut.UserId\x20=\x20?',_0x36be03['id']);_0x470718[_0xe7fb('0x74')](db[_0xe7fb('0x5f')][_0xe7fb('0x2b')](_0x29de1e[_0xe7fb('0x75')](),{'type':db[_0xe7fb('0x5f')]['QueryTypes'][_0xe7fb('0x76')]})[_0xe7fb('0x18')](function(_0xe52155){if(_0xe52155['length']===0x1){return _0x36be03['id'];}else{var _0x20b1fc=_[_0xe7fb('0x77')](_['map'](_0xe52155,_0xe7fb('0x78')),function(_0x6ec6b6){return _[_0xe7fb('0x79')](_0x4efcdc,_0x6ec6b6);});if(_0x20b1fc){return _0x36be03['id'];}}}));}}return BPromise[_0xe7fb('0x7a')](_0x470718)['then'](function(_0x4ed327){_0x146fc9=_(_0x146fc9)[_0xe7fb('0x7b')](_0x4ed327)[_0xe7fb('0x7c')]()[_0xe7fb('0x1f')]();return db['VoiceQueue'][_0xe7fb('0x3b')]({'where':{'id':_0x366acb[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(_0x49fb4b){return db[_0xe7fb('0x5f')][_0xe7fb('0x7d')](function(_0x362fe1){return _0x49fb4b['removeTeams'](_0x366acb[_0xe7fb('0x2b')][_0xe7fb('0x6b')],{'transaction':_0x362fe1})[_0xe7fb('0x18')](function(){if(!_[_0xe7fb('0x7e')](_0x146fc9)){return _0x49fb4b[_0xe7fb('0x7f')](_0x146fc9,{'transaction':_0x362fe1})[_0xe7fb('0x18')](function(){return db[_0xe7fb('0x64')][_0xe7fb('0x19')]({'where':{'VoiceQueueId':_0x366acb['params']['id'],'UserId':_0x146fc9},'transaction':_0x362fe1});});}})[_0xe7fb('0x18')](function(){_0x146fc9[_0xe7fb('0x5d')](function(_0x5dadac){socket['emit'](_0xe7fb('0x80'),{'UserId':_0x5dadac,'VoiceQueueId':_0x49fb4b['id']});});});});});});})[_0xe7fb('0x18')](respondWithStatusCode(_0x4d2c92,null))[_0xe7fb('0x2e')](handleError(_0x4d2c92,null));};exports[_0xe7fb('0x81')]=function(_0x4b58de,_0x4386ea){var _0x41c771,_0x489c9d;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x4b58de[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x4386ea,null))[_0xe7fb('0x18')](function(_0x39fef6){if(_0x39fef6){_0x489c9d=_0x39fef6;return _0x39fef6[_0xe7fb('0x81')](_0x4b58de['body'][_0xe7fb('0x6b')],_['omit'](_0x4b58de[_0xe7fb('0x3d')],['ids','id'])||{})['spread'](function(_0x260067){for(var _0xed4af4=0x0;_0xed4af4<_0x4b58de[_0xe7fb('0x3d')][_0xe7fb('0x6b')][_0xe7fb('0x37')];_0xed4af4+=0x1){socket[_0xe7fb('0x82')](_0xe7fb('0x69'),{'UserId':Number(_0x4b58de['body'][_0xe7fb('0x6b')][_0xed4af4]),'VoiceQueueId':Number(_0x4b58de[_0xe7fb('0x30')]['id'])});}return _0x260067;});}})[_0xe7fb('0x18')](function(_0x19a7ec){_0x41c771=_0x19a7ec||[];if(_0x489c9d){return db[_0xe7fb('0x6c')][_0xe7fb('0x2c')]({'where':{'id':_0x4b58de[_0xe7fb('0x3d')]['ids']},'attributes':['id',_0xe7fb('0x21'),_0xe7fb('0x83'),_0xe7fb('0x68'),'interface'],'raw':!![]});}})[_0xe7fb('0x18')](function(_0x52c758){if(!_['isEmpty'](_0x52c758)){var _0x4930c6=[];for(var _0x1a3d44=0x0;_0x1a3d44<_0x52c758[_0xe7fb('0x37')];_0x1a3d44++){if(_0x52c758[_0x1a3d44]['online']){_0x4930c6[_0xe7fb('0x74')](db[_0xe7fb('0x64')]['upsert']({'membername':_0x52c758[_0x1a3d44]['name'],'UserId':_0x52c758[_0x1a3d44]['id'],'queue_name':_0x489c9d[_0xe7fb('0x21')],'VoiceQueueId':_0x489c9d['id'],'interface':_[_0xe7fb('0x84')](_0x52c758[_0x1a3d44][_0xe7fb('0x65')])?util['format'](_0xe7fb('0x67'),_0x52c758[_0x1a3d44][_0xe7fb('0x21')]):_0x52c758[_0x1a3d44]['interface'],'paused':_0x52c758[_0x1a3d44]['voicePause']||![],'penalty':_0x4b58de[_0xe7fb('0x3d')]['penalty']||0x0}));}}return BPromise['all'](_0x4930c6);}})['then'](function(){return _0x41c771;})[_0xe7fb('0x18')](respondWithResult(_0x4386ea,null))[_0xe7fb('0x2e')](handleError(_0x4386ea,null));};exports['removeAgents']=function(_0x35b5ad,_0x55c935){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x35b5ad[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x55c935,null))[_0xe7fb('0x18')](function(_0x4736bf){if(_0x4736bf){return _0x4736bf[_0xe7fb('0x7f')](_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')])[_0xe7fb('0x18')](function(){if(_[_0xe7fb('0x85')](_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')])){for(var _0x5744a8=0x0;_0x5744a8<_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')]['length'];_0x5744a8+=0x1){socket['emit'](_0xe7fb('0x80'),{'UserId':Number(_0x35b5ad['query'][_0xe7fb('0x6b')][_0x5744a8]),'VoiceQueueId':Number(_0x35b5ad[_0xe7fb('0x30')]['id'])});}}else{socket[_0xe7fb('0x82')](_0xe7fb('0x80'),{'UserId':Number(_0x35b5ad[_0xe7fb('0x2b')]['ids']),'VoiceQueueId':Number(_0x35b5ad['params']['id'])});}});}})[_0xe7fb('0x18')](function(_0x27b153){return db[_0xe7fb('0x64')][_0xe7fb('0x19')]({'where':{'VoiceQueueId':_0x35b5ad[_0xe7fb('0x30')]['id'],'UserId':_0x35b5ad['query'][_0xe7fb('0x6b')]}})['then'](function(){return _0x27b153;});})[_0xe7fb('0x18')](respondWithStatusCode(_0x55c935,null))[_0xe7fb('0x2e')](handleError(_0x55c935,null));};exports['getAgents']=function(_0x5d0f05,_0x519e35){var _0x16ae95={};var _0xb1a3fa={};var _0x59e676;var _0x577895;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x5d0f05['params']['id']}})['then'](handleEntityNotFound(_0x519e35,null))[_0xe7fb('0x18')](function(_0xe1613c){if(_0xe1613c){_0x59e676=_0xe1613c;_0xb1a3fa[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db['User'][_0xe7fb('0x26')]);_0xb1a3fa[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x5d0f05[_0xe7fb('0x2b')]);_0xb1a3fa[_0xe7fb('0x32')]=_['intersection'](_0xb1a3fa['model'],_0xb1a3fa[_0xe7fb('0x2b')]);_0x16ae95[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0xb1a3fa[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x5d0f05['query'][_0xe7fb('0x36')]));_0x16ae95['attributes']=_0x16ae95['attributes'][_0xe7fb('0x37')]?_0x16ae95[_0xe7fb('0x35')]:_0xb1a3fa[_0xe7fb('0x34')];_0x16ae95[_0xe7fb('0x4f')]=qs['sort'](_0x5d0f05[_0xe7fb('0x2b')]['sort']);_0x16ae95['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x5d0f05[_0xe7fb('0x2b')],_0xb1a3fa[_0xe7fb('0x32')]));if(_0x5d0f05[_0xe7fb('0x2b')]['filter']){_0x16ae95['where']=_[_0xe7fb('0x39')](_0x16ae95['where'],{'$or':_['map'](_0x16ae95[_0xe7fb('0x35')],function(_0x5763dd){var _0x4cab2f={};_0x4cab2f[_0x5763dd]={'$like':'%'+_0x5d0f05[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x4cab2f;})});}_0x16ae95=_[_0xe7fb('0x39')]({},_0x16ae95,_0x5d0f05[_0xe7fb('0x3a')]);return _0x59e676[_0xe7fb('0x86')](_0x16ae95);}})['then'](function(_0xcf6d2){if(_0xcf6d2){_0x577895=_0xcf6d2['length'];if(!_0x5d0f05['query'][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x16ae95[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x5d0f05[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x16ae95[_0xe7fb('0x12')]=qs['offset'](_0x5d0f05['query'][_0xe7fb('0x12')]);}return _0x59e676['getAgents'](_0x16ae95);}})[_0xe7fb('0x18')](function(_0x51ff1e){if(_0x51ff1e){return _0x51ff1e?{'count':_0x577895,'rows':_0x51ff1e}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x519e35,null))['catch'](handleError(_0x519e35,null));};exports[_0xe7fb('0x87')]=function(_0x4407ee,_0x56869b){var _0x2139e3={};var _0x2e0e13={};var _0x23e1db;var _0x2a2fa6;return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x4407ee[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x56869b,null))[_0xe7fb('0x18')](function(_0x454ef0){if(_0x454ef0){_0x23e1db=_0x454ef0;_0x2e0e13['model']=_[_0xe7fb('0x31')](db[_0xe7fb('0x64')][_0xe7fb('0x26')]);_0x2e0e13[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x4407ee[_0xe7fb('0x2b')]);_0x2e0e13[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x2e0e13[_0xe7fb('0x34')],_0x2e0e13[_0xe7fb('0x2b')]);_0x2139e3[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x2e0e13[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x4407ee[_0xe7fb('0x2b')]['fields']));_0x2139e3['attributes']=_0x2139e3[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x2139e3[_0xe7fb('0x35')]:_0x2e0e13[_0xe7fb('0x34')];_0x2139e3[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x2139e3['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x4407ee[_0xe7fb('0x2b')],_0x2e0e13[_0xe7fb('0x32')]));if(_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x2139e3['where']=_[_0xe7fb('0x39')](_0x2139e3[_0xe7fb('0x29')],{'$or':_['map'](_0x2139e3[_0xe7fb('0x35')],function(_0x5dde83){var _0x21d86e={};_0x21d86e[_0x5dde83]={'$like':'%'+_0x4407ee['query'][_0xe7fb('0x1d')]+'%'};return _0x21d86e;})});}_0x2139e3=_[_0xe7fb('0x39')]({},_0x2139e3,_0x4407ee['options']);return _0x23e1db[_0xe7fb('0x87')](_0x2139e3);}})[_0xe7fb('0x18')](function(_0x5892cd){if(_0x5892cd){_0x2a2fa6=_0x5892cd['length'];if(!_0x4407ee['query']['hasOwnProperty'](_0xe7fb('0x4e'))){_0x2139e3[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x2139e3[_0xe7fb('0x12')]=qs['offset'](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x23e1db[_0xe7fb('0x87')](_0x2139e3);}})['then'](function(_0x3c56ad){return _0x3c56ad?{'count':_0x2a2fa6,'rows':_0x3c56ad}:null;})['then'](respondWithResult(_0x56869b,null))[_0xe7fb('0x2e')](handleError(_0x56869b,null));};exports['getLists']=function(_0x4880a7,_0x27669f){var _0x3d8b9a={};var _0x3503ac={};var _0x413843;var _0x55ce0f;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x4880a7[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x27669f,null))[_0xe7fb('0x18')](function(_0x21d9b0){if(_0x21d9b0){_0x413843=_0x21d9b0;_0x3503ac[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x88')][_0xe7fb('0x26')]);_0x3503ac[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x4880a7[_0xe7fb('0x2b')]);_0x3503ac[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x3503ac[_0xe7fb('0x34')],_0x3503ac[_0xe7fb('0x2b')]);_0x3d8b9a['attributes']=_[_0xe7fb('0x33')](_0x3503ac[_0xe7fb('0x34')],qs['fields'](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x3d8b9a[_0xe7fb('0x35')]=_0x3d8b9a['attributes'][_0xe7fb('0x37')]?_0x3d8b9a[_0xe7fb('0x35')]:_0x3503ac[_0xe7fb('0x34')];_0x3d8b9a[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x4880a7[_0xe7fb('0x2b')]['sort']);_0x3d8b9a[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x4880a7['query'],_0x3503ac[_0xe7fb('0x32')]));if(_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x3d8b9a[_0xe7fb('0x29')]=_['merge'](_0x3d8b9a[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x3d8b9a[_0xe7fb('0x35')],function(_0x39ffed){var _0x47e833={};_0x47e833[_0x39ffed]={'$like':'%'+_0x4880a7['query'][_0xe7fb('0x1d')]+'%'};return _0x47e833;})});}_0x3d8b9a=_[_0xe7fb('0x39')]({},_0x3d8b9a,_0x4880a7[_0xe7fb('0x3a')]);return _0x413843[_0xe7fb('0x89')](_0x3d8b9a);}})['then'](function(_0x57750a){if(_0x57750a){_0x55ce0f=_0x57750a[_0xe7fb('0x37')];if(!_0x4880a7['query'][_0xe7fb('0x4d')]('nolimit')){_0x3d8b9a[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x3d8b9a[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x413843[_0xe7fb('0x89')](_0x3d8b9a);}})[_0xe7fb('0x18')](function(_0x14014d){if(_0x14014d){return _0x14014d?{'count':_0x55ce0f,'rows':_0x14014d}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x27669f,null))[_0xe7fb('0x2e')](handleError(_0x27669f,null));};exports[_0xe7fb('0x8a')]=function(_0x4d9a76,_0x23a49e){var _0x30651f=moment()[_0xe7fb('0x66')](_0xe7fb('0x8b'));var _0x582862,_0x5b6da5;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x4d9a76[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x23a49e,null))['then'](function(_0x4e09d8){if(_0x4e09d8){_0x5b6da5=_0x4e09d8;return _0x4e09d8[_0xe7fb('0x8a')](_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x6b')],_[_0xe7fb('0x45')](_0x4d9a76[_0xe7fb('0x3d')],[_0xe7fb('0x6b'),'id'])||{});}return null;})[_0xe7fb('0x8c')](function(_0x2e2167){var _0xd7f440;_0x582862=_0x2e2167||[];var _0xc8055f=[];if(_0x2e2167){for(var _0x45b449=0x0;_0x45b449<_0x2e2167['length'];_0x45b449+=0x1){var _0x366c06=_0x2e2167[_0x45b449][_0xe7fb('0x1a')]({'plain':!![]});_0x5b6da5[_0xe7fb('0x8d')]=_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x8d')]?_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x8d')]:_0x5b6da5[_0xe7fb('0x8d')];switch(_0x5b6da5['dialCheckDuplicateType']){case _0xe7fb('0x8e'):_0xd7f440=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0x91'))['fromQuery']([_0xe7fb('0x92'),_0xe7fb('0x93'),_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()['field'](_0xe7fb('0x92'),_0xe7fb('0x92'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))['field']('id',_0xe7fb('0x94'))[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))[_0xe7fb('0x6e')](_0x4d9a76[_0xe7fb('0x30')]['id']['toString'](),'VoiceQueueId')[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27','createdAt')['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')]('cm_contacts')[_0xe7fb('0x29')](_0xe7fb('0x97'))['where'](_0xe7fb('0x98'),_0x366c06['CmListId'][_0xe7fb('0x75')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xe7fb('0x29')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xe7fb('0x6e')](_0xe7fb('0x99'))['from'](_0xe7fb('0x9a'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x4d9a76[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')]()))[_0xe7fb('0x29')](_0xe7fb('0x9b'),squel['select']()['field'](_0xe7fb('0x9c'))['from']('cm_hopper')[_0xe7fb('0x29')]('VoiceQueueId\x20=\x20?',_0x4d9a76['params']['id'][_0xe7fb('0x75')]())))['toString']();break;case _0xe7fb('0x9d'):_0xd7f440=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0x91'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),'scheduledAt',_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0x92'),_0xe7fb('0x92'))['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))[_0xe7fb('0x6e')]('id',_0xe7fb('0x94'))[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))['field'](_0x4d9a76['params']['id']['toString'](),_0xe7fb('0x51'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))['where'](_0xe7fb('0x97'))[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x366c06['CmListId']['toString']())[_0xe7fb('0x29')](_0xe7fb('0xa0'))[_0xe7fb('0x29')](_0xe7fb('0x9b'),squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0x9c'))['from'](_0xe7fb('0x91'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x4d9a76['params']['id'][_0xe7fb('0x75')]())))['toString']();break;default:_0xd7f440=squel[_0xe7fb('0x8f')]()['into'](_0xe7fb('0x91'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),_0xe7fb('0x93'),_0xe7fb('0x94'),'ListId',_0xe7fb('0x51'),'createdAt','updatedAt'],squel['select']()[_0xe7fb('0x6e')]('phone','phone')['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))[_0xe7fb('0x6e')]('id','ContactId')[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')]['toString'](),_0xe7fb('0x95'))['field'](_0x4d9a76[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')](),_0xe7fb('0x51'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))['where'](_0xe7fb('0x97'))[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x366c06[_0xe7fb('0x96')]['toString']())[_0xe7fb('0x29')](_0xe7fb('0xa0')))['toString']();}_0xc8055f['push'](db[_0xe7fb('0x5f')]['query'](_0xd7f440));}return BPromise[_0xe7fb('0x7a')](_0xc8055f);}})[_0xe7fb('0x18')](function(){var _0x20b22f=[];var _0x2e22c1=squel[_0xe7fb('0x8f')]()['into'](_0xe7fb('0xa1'))['fromQuery']([_0xe7fb('0xa2'),_0xe7fb('0x92'),_0xe7fb('0xa3'),'createdAt',_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0xa4'))[_0xe7fb('0x6e')]('ci.item')[_0xe7fb('0x6e')](_0xe7fb('0xa5'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0xa6'),'ci')[_0xe7fb('0xa7')]('cm_hopper','h',_0xe7fb('0xa8'))[_0xe7fb('0x29')]('h.scheduledat=?',_0x30651f)[_0xe7fb('0x29')]('ci.ItemClass=?',_0xe7fb('0xa9')))[_0xe7fb('0x75')]();_0x20b22f[_0xe7fb('0x74')](db[_0xe7fb('0x5f')][_0xe7fb('0x2b')](_0x2e22c1));return BPromise[_0xe7fb('0x7a')](_0x20b22f);})[_0xe7fb('0x18')](function(){return _0x582862;})['then'](respondWithResult(_0x23a49e,null))[_0xe7fb('0x2e')](handleError(_0x23a49e,null));};exports[_0xe7fb('0xaa')]=function(_0x3c04f4,_0x290cc3){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x3c04f4['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x290cc3,null))[_0xe7fb('0x18')](function(_0x3ed48f){if(_0x3ed48f){return _0x3ed48f['removeLists'](_0x3c04f4[_0xe7fb('0x2b')][_0xe7fb('0x6b')]);}})[_0xe7fb('0x18')](function(_0x2eeff4){if(_0x2eeff4){return db[_0xe7fb('0x52')]['destroy']({'where':{'ListId':_0x3c04f4[_0xe7fb('0x2b')][_0xe7fb('0x6b')],'VoiceQueueId':_0x3c04f4[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(){return _0x2eeff4;});}})[_0xe7fb('0x18')](respondWithStatusCode(_0x290cc3,null))[_0xe7fb('0x2e')](handleError(_0x290cc3,null));};exports[_0xe7fb('0xab')]=function(_0xcaad94,_0x5b88bd){var _0x143dbb={};var _0x715444={};var _0x92a316;var _0x30a834;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0xcaad94[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x5b88bd,null))[_0xe7fb('0x18')](function(_0x1b1818){if(_0x1b1818){_0x92a316=_0x1b1818;_0x715444[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x88')][_0xe7fb('0x26')]);_0x715444[_0xe7fb('0x2b')]=_['keys'](_0xcaad94[_0xe7fb('0x2b')]);_0x715444[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x715444[_0xe7fb('0x34')],_0x715444[_0xe7fb('0x2b')]);_0x143dbb['attributes']=_[_0xe7fb('0x33')](_0x715444[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0xcaad94['query']['fields']));_0x143dbb[_0xe7fb('0x35')]=_0x143dbb[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x143dbb[_0xe7fb('0x35')]:_0x715444['model'];_0x143dbb[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x143dbb['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0xcaad94['query'],_0x715444[_0xe7fb('0x32')]));if(_0xcaad94[_0xe7fb('0x2b')]['filter']){_0x143dbb['where']=_[_0xe7fb('0x39')](_0x143dbb[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x143dbb['attributes'],function(_0x3b2375){var _0x170347={};_0x170347[_0x3b2375]={'$like':'%'+_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x170347;})});}_0x143dbb=_['merge']({},_0x143dbb,_0xcaad94[_0xe7fb('0x3a')]);return _0x92a316[_0xe7fb('0xab')](_0x143dbb);}})[_0xe7fb('0x18')](function(_0x2a984e){if(_0x2a984e){_0x30a834=_0x2a984e[_0xe7fb('0x37')];if(!_0xcaad94[_0xe7fb('0x2b')]['hasOwnProperty']('nolimit')){_0x143dbb[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x143dbb[_0xe7fb('0x12')]=qs['offset'](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x92a316[_0xe7fb('0xab')](_0x143dbb);}})[_0xe7fb('0x18')](function(_0x286382){if(_0x286382){return _0x286382?{'count':_0x30a834,'rows':_0x286382}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x5b88bd,null))[_0xe7fb('0x2e')](handleError(_0x5b88bd,null));};exports[_0xe7fb('0xac')]=function(_0x325c7b,_0x38472b){var _0x1a33f8;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x325c7b[_0xe7fb('0x30')]['id']}})['then'](handleEntityNotFound(_0x38472b,null))[_0xe7fb('0x18')](function(_0x291a8d){if(_0x291a8d){return _0x291a8d['addBlackLists'](_0x325c7b[_0xe7fb('0x3d')]['ids'],_[_0xe7fb('0x45')](_0x325c7b[_0xe7fb('0x3d')],[_0xe7fb('0x6b'),'id'])||{});}return null;})[_0xe7fb('0x8c')](function(_0x3ade81){var _0x1b9ea2;_0x1a33f8=_0x3ade81||[];var _0x418561=[];if(_0x3ade81){for(var _0x3ec66a=0x0;_0x3ec66a<_0x3ade81[_0xe7fb('0x37')];_0x3ec66a+=0x1){var _0x1c76a1=_0x3ade81[_0x3ec66a][_0xe7fb('0x1a')]({'plain':!![]});_0x1b9ea2=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0xad'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')]('phone',_0xe7fb('0x92'))[_0xe7fb('0x6e')]('id',_0xe7fb('0x94'))['field'](_0x1c76a1[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))[_0xe7fb('0x6e')](_0x325c7b[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')](),'VoiceQueueId')[_0xe7fb('0x6e')](_0xe7fb('0xae'),_0xe7fb('0x47'))[_0xe7fb('0x6e')]('NOW()',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))[_0xe7fb('0x29')]('deletedAt\x20IS\x20NULL')[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x1c76a1[_0xe7fb('0x96')][_0xe7fb('0x75')]())[_0xe7fb('0x29')](_0xe7fb('0xa0')))['toString']();_0x418561[_0xe7fb('0x74')](db[_0xe7fb('0x5f')]['query'](_0x1b9ea2));}return BPromise[_0xe7fb('0x7a')](_0x418561);}})[_0xe7fb('0x18')](function(){return _0x1a33f8;})['then'](respondWithResult(_0x38472b,null))[_0xe7fb('0x2e')](handleError(_0x38472b,null));};exports['removeBlackLists']=function(_0x127051,_0x4d9376){return db[_0xe7fb('0x25')]['find']({'where':{'id':_0x127051['params']['id']}})['then'](handleEntityNotFound(_0x4d9376,null))['then'](function(_0x547d29){if(_0x547d29){return _0x547d29[_0xe7fb('0xaf')](_0x127051[_0xe7fb('0x2b')]['ids']);}})[_0xe7fb('0x18')](function(_0x5c0baf){if(_0x5c0baf){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x127051['query'][_0xe7fb('0x6b')],'VoiceQueueId':_0x127051[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(){return _0x5c0baf;});}})['then'](respondWithStatusCode(_0x4d9376,null))[_0xe7fb('0x2e')](handleError(_0x4d9376,null));}; \ No newline at end of file +var _0x008c=['deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','cm_hopper','onlyIfOpen','into','fromQuery','COALESCE(phone,\x27\x27)','all','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','moment','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','json','offset','undefined','count','set','Content-Range','then','inbound','map','value','includes','type','UserProfileResource','destroy','status','send','index','VoiceQueue','rawAttributes','key','getOptions','where','include','query','findAll','rows','catch','show','params','keys','filters','model','intersection','fields','attributes','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','VoiceQueues','QueueCampaigns','outbound','name','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','body','createdAt','updatedAt','autoAssociation','getHoppers','findOne','CmHopper','length','hasOwnProperty','nolimit','limit','sort','pick','VoiceQueueId','filter','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','upsert','isNil','interface','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','User','select','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','union','compact','removeAgents','userVoiceQueue:remove','addAgents','spread','emit','isEmpty','UserVoiceQueueRt','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','phone','scheduledAt','ContactId','ListId','field','CmListId','toString','cm_contacts'];(function(_0x272aa8,_0x1ecd7c){var _0x1ebd25=function(_0x2f426a){while(--_0x2f426a){_0x272aa8['push'](_0x272aa8['shift']());}};_0x1ebd25(++_0x1ecd7c);}(_0x008c,0x188));var _0xc008=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0x008c[_0x1dfa63];return _0x26f2a9;};'use strict';var moment=require(_0xc008('0x0'));var BPromise=require(_0xc008('0x1'));var util=require(_0xc008('0x2'));var _=require(_0xc008('0x3'));var squel=require(_0xc008('0x4'));var Redis=require('ioredis');var qs=require(_0xc008('0x5'));var logger=require(_0xc008('0x6'))(_0xc008('0x7'));var config=require(_0xc008('0x8'));var db=require(_0xc008('0x9'))['db'];config[_0xc008('0xa')]=_[_0xc008('0xb')](config[_0xc008('0xa')],{'host':_0xc008('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc008('0xa')]));require('./voiceQueue.socket')[_0xc008('0xd')](socket);function respondWithStatusCode(_0x5b64f8,_0x52041f){_0x52041f=_0x52041f||0xcc;return function(_0x27830d){if(_0x27830d){return _0x5b64f8[_0xc008('0xe')](_0x52041f);}return _0x5b64f8['status'](_0x52041f)['end']();};}function respondWithResult(_0x543eb8,_0x1eacfa){_0x1eacfa=_0x1eacfa||0xc8;return function(_0xc881aa){if(_0xc881aa){return _0x543eb8['status'](_0x1eacfa)[_0xc008('0xf')](_0xc881aa);}};}function respondWithFilteredResult(_0x332fd4,_0x2ea200){return function(_0x2a5b4e){if(_0x2a5b4e){var _0x9ffa93=typeof _0x2ea200[_0xc008('0x10')]===_0xc008('0x11')&&typeof _0x2ea200['limit']==='undefined';var _0x33f44c=_0x2a5b4e['count'];var _0x25e13f=_0x9ffa93?0x0:_0x2ea200[_0xc008('0x10')];var _0x2073ef=_0x9ffa93?_0x2a5b4e[_0xc008('0x12')]:_0x2ea200[_0xc008('0x10')]+_0x2ea200['limit'];var _0x5e894e;if(_0x2073ef>=_0x33f44c){_0x2073ef=_0x33f44c;_0x5e894e=0xc8;}else{_0x5e894e=0xce;}_0x332fd4['status'](_0x5e894e);return _0x332fd4[_0xc008('0x13')](_0xc008('0x14'),_0x25e13f+'-'+_0x2073ef+'/'+_0x33f44c)[_0xc008('0xf')](_0x2a5b4e);}return null;};}function saveUpdates(_0x3eb12a){return function(_0x4fe771){if(_0x4fe771){return _0x4fe771['update'](_0x3eb12a)['then'](function(_0x5c2668){return _0x5c2668;});}return null;};}function removeEntity(_0x46042b){return function(_0x462af5){if(_0x462af5){return _0x462af5['destroy']()[_0xc008('0x15')](function(){var _0x5906e6=_0x462af5['get']({'plain':!![]});var _0x543e5d=[{'name':'VoiceQueues','value':_0xc008('0x16'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x590a71=_(_0x543e5d)['filter']('ignore')[_0xc008('0x17')](_0xc008('0x18'))[_0xc008('0x18')]();if(_[_0xc008('0x19')](_0x590a71,_0x5906e6[_0xc008('0x1a')])){return;}var _0x110128=_['find'](_0x543e5d,[_0xc008('0x18'),_0x5906e6['type']])['name'];return db[_0xc008('0x1b')][_0xc008('0x1c')]({'where':{'type':_0x110128,'resourceId':_0x5906e6['id']}})[_0xc008('0x15')](function(){return _0x462af5;});})[_0xc008('0x15')](function(){_0x46042b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de1e9){return function(_0x3f7b07){if(!_0x3f7b07){_0x5de1e9[_0xc008('0xe')](0x194);}return _0x3f7b07;};}function handleError(_0x92c582,_0x2e31c2){_0x2e31c2=_0x2e31c2||0x1f4;return function(_0x5bebd9){logger['error'](_0x5bebd9['stack']);if(_0x5bebd9['name']){delete _0x5bebd9['name'];}_0x92c582[_0xc008('0x1d')](_0x2e31c2)[_0xc008('0x1e')](_0x5bebd9);};}exports[_0xc008('0x1f')]=function(_0x529961,_0x24c14c){var _0x32390d={};var _0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x20')][_0xc008('0x21')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x22')]};});_0x32390d=qs[_0xc008('0x23')](_0x2a7d4f,_0x529961);var _0xf831f2={'where':_0x32390d[_0xc008('0x24')]};return db[_0xc008('0x20')][_0xc008('0x12')](_0xf831f2)[_0xc008('0x15')](function(_0x22d8e8){_0x209591[_0xc008('0x12')]=_0x22d8e8;_0x32390d[_0xc008('0x25')]=qs[_0xc008('0x25')](_0x529961[_0xc008('0x26')]);return db['VoiceQueue'][_0xc008('0x27')](_0x32390d);})[_0xc008('0x15')](function(_0x499754){_0x209591[_0xc008('0x28')]=_0x499754;return _0x209591;})[_0xc008('0x15')](respondWithFilteredResult(_0x24c14c,_0x32390d))[_0xc008('0x29')](handleError(_0x24c14c,null));};exports[_0xc008('0x2a')]=function(_0xd0e05a,_0x3cd878){var _0x7cfbc5={'raw':![],'where':{'id':_0xd0e05a[_0xc008('0x2b')]['id']}},_0x470e79={};_0x470e79['model']=_[_0xc008('0x2c')](db[_0xc008('0x20')][_0xc008('0x21')]);_0x470e79[_0xc008('0x26')]=_[_0xc008('0x2c')](_0xd0e05a[_0xc008('0x26')]);_0x470e79[_0xc008('0x2d')]=_['intersection'](_0x470e79[_0xc008('0x2e')],_0x470e79[_0xc008('0x26')]);_0x7cfbc5['attributes']=_[_0xc008('0x2f')](_0x470e79[_0xc008('0x2e')],qs['fields'](_0xd0e05a[_0xc008('0x26')][_0xc008('0x30')]));_0x7cfbc5[_0xc008('0x31')]=_0x7cfbc5['attributes']['length']?_0x7cfbc5['attributes']:_0x470e79[_0xc008('0x2e')];if(_0xd0e05a['query'][_0xc008('0x32')]){_0x7cfbc5[_0xc008('0x25')]=[{'all':!![]}];}_0x7cfbc5=_[_0xc008('0x33')]({},_0x7cfbc5,_0xd0e05a[_0xc008('0x34')]);return db[_0xc008('0x20')][_0xc008('0x35')](_0x7cfbc5)[_0xc008('0x15')](handleEntityNotFound(_0x3cd878,null))[_0xc008('0x15')](respondWithResult(_0x3cd878,null))[_0xc008('0x29')](handleError(_0x3cd878,null));};exports[_0xc008('0x36')]=function(_0x3ebb83,_0xdfca2e){return db[_0xc008('0x20')][_0xc008('0x36')](_0x3ebb83['body'],{})[_0xc008('0x15')](function(_0x23c4db){var _0x30b7df=_0x3ebb83[_0xc008('0x37')]['get']({'plain':!![]});if(!_0x30b7df)throw new Error(_0xc008('0x38'));if(_0x30b7df[_0xc008('0x39')]===_0xc008('0x37')){var _0x36e7ae=_0x23c4db[_0xc008('0x3a')]({'plain':!![]});var _0x5706bb=[{'name':_0xc008('0x3b'),'value':_0xc008('0x16')},{'name':_0xc008('0x3c'),'value':_0xc008('0x3d')}];var _0x7279e8=_['find'](_0x5706bb,[_0xc008('0x18'),_0x36e7ae[_0xc008('0x1a')]])[_0xc008('0x3e')];return db[_0xc008('0x3f')]['find']({'where':{'name':_0x7279e8,'userProfileId':_0x30b7df[_0xc008('0x40')]},'raw':!![]})[_0xc008('0x15')](function(_0x351d5c){if(_0x351d5c&&_0x351d5c['autoAssociation']===0x0){return db[_0xc008('0x1b')]['create']({'name':_0x36e7ae[_0xc008('0x3e')],'resourceId':_0x36e7ae['id'],'type':_0x351d5c['name'],'sectionId':_0x351d5c['id']},{})[_0xc008('0x15')](function(){return _0x23c4db;});}else{return _0x23c4db;}})[_0xc008('0x29')](function(_0x5a5d85){logger[_0xc008('0x41')](_0xc008('0x42'),_0x5a5d85);throw _0x5a5d85;});}return _0x23c4db;})[_0xc008('0x15')](respondWithResult(_0xdfca2e,0xc9))['catch'](handleError(_0xdfca2e,null));};exports[_0xc008('0x43')]=function(_0x2a9b5c,_0x200469){var _0x44fc5d={'where':{'id':_0x2a9b5c[_0xc008('0x2b')]['id']}},_0x347629={};_0x347629['model']=_['keys'](db['VoiceQueue'][_0xc008('0x21')]);_0x44fc5d[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x347629[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x2a9b5c[_0xc008('0x26')][_0xc008('0x30')]));_0x44fc5d[_0xc008('0x31')]=_0x44fc5d['attributes']['length']?_0x44fc5d['attributes']:_0x347629[_0xc008('0x2e')];if(_0x2a9b5c[_0xc008('0x26')][_0xc008('0x32')]){_0x44fc5d['include']=[{'all':!![]}];}_0x44fc5d=_[_0xc008('0x33')]({},_0x44fc5d,_0x2a9b5c[_0xc008('0x34')]);return db[_0xc008('0x20')][_0xc008('0x35')](_0x44fc5d)[_0xc008('0x15')](handleEntityNotFound(_0x200469,null))[_0xc008('0x15')](function(_0x17ec90){if(_0x17ec90){var _0x405e87=_0x17ec90[_0xc008('0x3a')]({'plain':!![]});_0x405e87=qs[_0xc008('0x44')](_0x405e87,['id','createdAt','updatedAt']);_0x2a9b5c[_0xc008('0x45')]=_['omit'](_0x2a9b5c[_0xc008('0x45')],['id',_0xc008('0x46'),_0xc008('0x47')]);return db['VoiceQueue'][_0xc008('0x36')](_[_0xc008('0x33')](_0x405e87,_0x2a9b5c[_0xc008('0x45')]),{'include':_0x2a9b5c[_0xc008('0x26')][_0xc008('0x32')]?[{'all':!![]}]:undefined})['then'](function(_0x3a7b3b){var _0x27b022=_0x2a9b5c['user'][_0xc008('0x3a')]({'plain':!![]});if(!_0x27b022)throw new Error(_0xc008('0x38'));if(_0x27b022['role']==='user'){var _0x2df905=_0x3a7b3b[_0xc008('0x3a')]({'plain':!![]});var _0x20947b=[{'name':_0xc008('0x3b'),'value':_0xc008('0x16')},{'name':'QueueCampaigns','value':'outbound'}];var _0x34b72a=_['find'](_0x20947b,[_0xc008('0x18'),_0x2df905[_0xc008('0x1a')]])[_0xc008('0x3e')];return db[_0xc008('0x3f')][_0xc008('0x35')]({'where':{'name':_0x34b72a,'userProfileId':_0x27b022[_0xc008('0x40')]},'raw':!![]})['then'](function(_0x2ea742){if(_0x2ea742&&_0x2ea742[_0xc008('0x48')]===0x0){return db[_0xc008('0x1b')][_0xc008('0x36')]({'name':_0x2df905[_0xc008('0x3e')],'resourceId':_0x2df905['id'],'type':_0x2ea742['name'],'sectionId':_0x2ea742['id']},{})[_0xc008('0x15')](function(){return _0x3a7b3b;});}else{return _0x3a7b3b;}})['catch'](function(_0x535e6e){logger['error'](_0xc008('0x42'),_0x535e6e);throw _0x535e6e;});}return _0x3a7b3b;});}})[_0xc008('0x15')](respondWithResult(_0x200469,0xc9))[_0xc008('0x29')](handleError(_0x200469,null));};exports['update']=function(_0x3aeeab,_0x2d8361){if(_0x3aeeab[_0xc008('0x45')]['id']){delete _0x3aeeab['body']['id'];}return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x3aeeab[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x2d8361,null))['then'](saveUpdates(_0x3aeeab[_0xc008('0x45')],null))['then'](respondWithResult(_0x2d8361,null))[_0xc008('0x29')](handleError(_0x2d8361,null));};exports[_0xc008('0x1c')]=function(_0x2ae14e,_0x943c91){return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x2ae14e['params']['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x943c91,null))['then'](removeEntity(_0x943c91,null))['catch'](handleError(_0x943c91,null));};exports[_0xc008('0x49')]=function(_0x30aa1e,_0x56e755){var _0xb1befa={'raw':![],'where':{}};var _0xb8ba7={};var _0x3e373e={'count':0x0,'rows':[]};return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x30aa1e[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x56e755,null))['then'](function(_0x16e052){if(_0x16e052){_0xb8ba7[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x4b')][_0xc008('0x21')]);_0xb8ba7[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x30aa1e[_0xc008('0x26')]);_0xb8ba7[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0xb8ba7[_0xc008('0x2e')],_0xb8ba7[_0xc008('0x26')]);_0xb1befa[_0xc008('0x31')]=_[_0xc008('0x2f')](_0xb8ba7['model'],qs[_0xc008('0x30')](_0x30aa1e[_0xc008('0x26')][_0xc008('0x30')]));_0xb1befa['attributes']=_0xb1befa[_0xc008('0x31')][_0xc008('0x4c')]?_0xb1befa['attributes']:_0xb8ba7['model'];if(!_0x30aa1e[_0xc008('0x26')][_0xc008('0x4d')](_0xc008('0x4e'))){_0xb1befa[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x30aa1e[_0xc008('0x26')][_0xc008('0x4f')]);_0xb1befa[_0xc008('0x10')]=qs[_0xc008('0x10')](_0x30aa1e[_0xc008('0x26')][_0xc008('0x10')]);}_0xb1befa['order']=qs[_0xc008('0x50')](_0x30aa1e[_0xc008('0x26')][_0xc008('0x50')]);_0xb1befa[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x30aa1e['query'],_0xb8ba7[_0xc008('0x2d')]));_0xb1befa[_0xc008('0x24')][_0xc008('0x52')]=_0x16e052['id'];if(_0x30aa1e['query'][_0xc008('0x53')]){_0xb1befa[_0xc008('0x24')]=_[_0xc008('0x33')](_0xb1befa['where'],{'$or':_[_0xc008('0x17')](_0xb1befa['attributes'],function(_0x50ee03){var _0xee7a85={};_0xee7a85[_0x50ee03]={'$like':'%'+_0x30aa1e[_0xc008('0x26')][_0xc008('0x53')]+'%'};return _0xee7a85;})});}_0xb1befa=_[_0xc008('0x33')]({},_0xb1befa,_0x30aa1e['options']);return db[_0xc008('0x4b')][_0xc008('0x12')]({'where':_0xb1befa['where']})[_0xc008('0x15')](function(_0x5233bb){_0x3e373e[_0xc008('0x12')]=_0x5233bb;if(_0x30aa1e['query'][_0xc008('0x32')]){_0xb1befa['include']=[{'all':!![]}];}return db[_0xc008('0x4b')][_0xc008('0x27')](_0xb1befa);})[_0xc008('0x15')](function(_0x47337b){_0x3e373e['rows']=_0x47337b;return _0x3e373e;});}})[_0xc008('0x15')](respondWithFilteredResult(_0x56e755,_0xb1befa))[_0xc008('0x29')](handleError(_0x56e755,null));};exports[_0xc008('0x54')]=function(_0x1d49db,_0x321500){var _0x13ef78={'raw':!![],'where':{}};var _0xd9e3fd={};var _0x3b46e4={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xc008('0x4a')]({'where':{'id':_0x1d49db['params']['id']}})['then'](handleEntityNotFound(_0x321500,null))['then'](function(_0x406ead){if(_0x406ead){_0xd9e3fd[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x55')][_0xc008('0x21')]);_0xd9e3fd[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x1d49db[_0xc008('0x26')]);_0xd9e3fd[_0xc008('0x2d')]=_['intersection'](_0xd9e3fd[_0xc008('0x2e')],_0xd9e3fd[_0xc008('0x26')]);_0x13ef78[_0xc008('0x31')]=_[_0xc008('0x2f')](_0xd9e3fd[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x1d49db[_0xc008('0x26')][_0xc008('0x30')]));_0x13ef78[_0xc008('0x31')]=_0x13ef78[_0xc008('0x31')][_0xc008('0x4c')]?_0x13ef78[_0xc008('0x31')]:_0xd9e3fd['model'];if(!_0x1d49db['query'][_0xc008('0x4d')](_0xc008('0x4e'))){_0x13ef78[_0xc008('0x4f')]=qs['limit'](_0x1d49db[_0xc008('0x26')][_0xc008('0x4f')]);_0x13ef78['offset']=qs['offset'](_0x1d49db['query'][_0xc008('0x10')]);}_0x13ef78[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x1d49db[_0xc008('0x26')][_0xc008('0x50')]);_0x13ef78[_0xc008('0x24')]=qs[_0xc008('0x2d')](_[_0xc008('0x51')](_0x1d49db[_0xc008('0x26')],_0xd9e3fd[_0xc008('0x2d')]));_0x13ef78['where']['VoiceQueueId']=_0x406ead['id'];if(_0x1d49db[_0xc008('0x26')][_0xc008('0x53')]){_0x13ef78[_0xc008('0x24')]=_[_0xc008('0x33')](_0x13ef78[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x13ef78['attributes'],function(_0x5794fe){var _0x68372f={};_0x68372f[_0x5794fe]={'$like':'%'+_0x1d49db[_0xc008('0x26')][_0xc008('0x53')]+'%'};return _0x68372f;})});}_0x13ef78=_['merge']({},_0x13ef78,_0x1d49db['options']);return db['CmHopperHistory']['count']({'where':_0x13ef78['where']})['then'](function(_0x276de2){_0x3b46e4['count']=_0x276de2;if(_0x1d49db[_0xc008('0x26')]['includeAll']){_0x13ef78[_0xc008('0x25')]=[{'all':!![]}];}return db[_0xc008('0x55')][_0xc008('0x27')](_0x13ef78);})['then'](function(_0x58f348){_0x3b46e4[_0xc008('0x28')]=_0x58f348;return _0x3b46e4;});}})['then'](respondWithFilteredResult(_0x321500,_0x13ef78))[_0xc008('0x29')](handleError(_0x321500,null));};exports[_0xc008('0x57')]=function(_0x544519,_0x7b7246){var _0x4db90b={'raw':!![],'where':{}};var _0x554cf4={};var _0x23bece={'count':0x0,'rows':[]};return db[_0xc008('0x20')]['findOne']({'where':{'id':_0x544519[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x7b7246,null))[_0xc008('0x15')](function(_0x4bd290){if(_0x4bd290){_0x554cf4[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x58')][_0xc008('0x21')]);_0x554cf4[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x544519['query']);_0x554cf4[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x554cf4[_0xc008('0x2e')],_0x554cf4['query']);_0x4db90b[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x554cf4[_0xc008('0x2e')],qs['fields'](_0x544519['query']['fields']));_0x4db90b[_0xc008('0x31')]=_0x4db90b[_0xc008('0x31')][_0xc008('0x4c')]?_0x4db90b[_0xc008('0x31')]:_0x554cf4[_0xc008('0x2e')];if(!_0x544519[_0xc008('0x26')][_0xc008('0x4d')](_0xc008('0x4e'))){_0x4db90b['limit']=qs[_0xc008('0x4f')](_0x544519[_0xc008('0x26')]['limit']);_0x4db90b['offset']=qs[_0xc008('0x10')](_0x544519[_0xc008('0x26')][_0xc008('0x10')]);}_0x4db90b[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x544519['query'][_0xc008('0x50')]);_0x4db90b[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x544519[_0xc008('0x26')],_0x554cf4[_0xc008('0x2d')]));_0x4db90b[_0xc008('0x24')]['VoiceQueueId']=_0x4bd290['id'];if(_0x544519[_0xc008('0x26')][_0xc008('0x53')]){_0x4db90b[_0xc008('0x24')]=_[_0xc008('0x33')](_0x4db90b['where'],{'$or':_[_0xc008('0x17')](_0x4db90b[_0xc008('0x31')],function(_0x57cf19){var _0x555e8a={};_0x555e8a[_0x57cf19]={'$like':'%'+_0x544519[_0xc008('0x26')]['filter']+'%'};return _0x555e8a;})});}_0x4db90b=_[_0xc008('0x33')]({},_0x4db90b,_0x544519[_0xc008('0x34')]);return db['CmHopperFinal'][_0xc008('0x12')]({'where':_0x4db90b[_0xc008('0x24')]})[_0xc008('0x15')](function(_0xbe42a2){_0x23bece[_0xc008('0x12')]=_0xbe42a2;if(_0x544519[_0xc008('0x26')][_0xc008('0x32')]){_0x4db90b[_0xc008('0x25')]=[{'all':!![]}];}return db[_0xc008('0x58')][_0xc008('0x27')](_0x4db90b);})['then'](function(_0x49e6d5){_0x23bece[_0xc008('0x28')]=_0x49e6d5;return _0x23bece;});}})[_0xc008('0x15')](respondWithFilteredResult(_0x7b7246,_0x4db90b))['catch'](handleError(_0x7b7246,null));};exports[_0xc008('0x59')]=function(_0x1bdaa9,_0x698d5c){var _0x5f1e48={'raw':!![],'where':{}};var _0x303cdd={};var _0x38239a={'count':0x0,'rows':[]};return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x1bdaa9[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x698d5c,null))[_0xc008('0x15')](function(_0x5bd010){if(_0x5bd010){_0x303cdd[_0xc008('0x2e')]=_['keys'](db[_0xc008('0x5a')][_0xc008('0x21')]);_0x303cdd[_0xc008('0x26')]=_['keys'](_0x1bdaa9[_0xc008('0x26')]);_0x303cdd[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x303cdd[_0xc008('0x2e')],_0x303cdd[_0xc008('0x26')]);_0x5f1e48[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x303cdd[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x1bdaa9[_0xc008('0x26')]['fields']));_0x5f1e48[_0xc008('0x31')]=_0x5f1e48[_0xc008('0x31')][_0xc008('0x4c')]?_0x5f1e48[_0xc008('0x31')]:_0x303cdd[_0xc008('0x2e')];if(!_0x1bdaa9['query'][_0xc008('0x4d')](_0xc008('0x4e'))){_0x5f1e48[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x1bdaa9[_0xc008('0x26')][_0xc008('0x4f')]);_0x5f1e48[_0xc008('0x10')]=qs[_0xc008('0x10')](_0x1bdaa9[_0xc008('0x26')][_0xc008('0x10')]);}_0x5f1e48[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x1bdaa9[_0xc008('0x26')][_0xc008('0x50')]);_0x5f1e48[_0xc008('0x24')]=qs['filters'](_['pick'](_0x1bdaa9[_0xc008('0x26')],_0x303cdd[_0xc008('0x2d')]));_0x5f1e48[_0xc008('0x24')][_0xc008('0x52')]=_0x5bd010['id'];if(_0x1bdaa9[_0xc008('0x26')][_0xc008('0x53')]){_0x5f1e48[_0xc008('0x24')]=_[_0xc008('0x33')](_0x5f1e48[_0xc008('0x24')],{'$or':_['map'](_0x5f1e48[_0xc008('0x31')],function(_0x2bbadf){var _0x54fd75={};_0x54fd75[_0x2bbadf]={'$like':'%'+_0x1bdaa9[_0xc008('0x26')][_0xc008('0x53')]+'%'};return _0x54fd75;})});}_0x5f1e48=_[_0xc008('0x33')]({},_0x5f1e48,_0x1bdaa9[_0xc008('0x34')]);return db[_0xc008('0x5a')][_0xc008('0x12')]({'where':_0x5f1e48['where']})[_0xc008('0x15')](function(_0x321532){_0x38239a[_0xc008('0x12')]=_0x321532;if(_0x1bdaa9[_0xc008('0x26')]['includeAll']){_0x5f1e48[_0xc008('0x25')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xc008('0x27')](_0x5f1e48);})[_0xc008('0x15')](function(_0x5b47c3){_0x38239a[_0xc008('0x28')]=_0x5b47c3;return _0x38239a;});}})['then'](respondWithFilteredResult(_0x698d5c,_0x5f1e48))[_0xc008('0x29')](handleError(_0x698d5c,null));};exports['getTeams']=function(_0x5b387d,_0x5351f7){var _0x79dfea={};var _0x402b67={};var _0x48f40f;var _0x4fda8;return db[_0xc008('0x20')]['findOne']({'where':{'id':_0x5b387d[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x5351f7,null))[_0xc008('0x15')](function(_0x5843ee){if(_0x5843ee){_0x48f40f=_0x5843ee;_0x402b67[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x5b')][_0xc008('0x21')]);_0x402b67[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x5b387d[_0xc008('0x26')]);_0x402b67[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x402b67[_0xc008('0x2e')],_0x402b67[_0xc008('0x26')]);_0x79dfea['attributes']=_[_0xc008('0x2f')](_0x402b67[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x5b387d['query'][_0xc008('0x30')]));_0x79dfea[_0xc008('0x31')]=_0x79dfea[_0xc008('0x31')]['length']?_0x79dfea[_0xc008('0x31')]:_0x402b67['model'];_0x79dfea[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x5b387d[_0xc008('0x26')]['sort']);_0x79dfea[_0xc008('0x24')]=qs[_0xc008('0x2d')](_[_0xc008('0x51')](_0x5b387d[_0xc008('0x26')],_0x402b67[_0xc008('0x2d')]));if(_0x5b387d[_0xc008('0x26')][_0xc008('0x53')]){_0x79dfea['where']=_[_0xc008('0x33')](_0x79dfea[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x79dfea[_0xc008('0x31')],function(_0x5a61d6){var _0x46fba5={};_0x46fba5[_0x5a61d6]={'$like':'%'+_0x5b387d['query'][_0xc008('0x53')]+'%'};return _0x46fba5;})});}_0x79dfea=_[_0xc008('0x33')]({},_0x79dfea,_0x5b387d[_0xc008('0x34')]);return _0x48f40f[_0xc008('0x5c')](_0x79dfea);}})[_0xc008('0x15')](function(_0x9f266e){if(_0x9f266e){_0x4fda8=_0x9f266e[_0xc008('0x4c')];if(!_0x5b387d['query'][_0xc008('0x4d')](_0xc008('0x4e'))){_0x79dfea[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x5b387d['query'][_0xc008('0x4f')]);_0x79dfea['offset']=qs[_0xc008('0x10')](_0x5b387d[_0xc008('0x26')][_0xc008('0x10')]);}return _0x48f40f['getTeams'](_0x79dfea);}})['then'](function(_0x39bfc0){if(_0x39bfc0){return _0x39bfc0?{'count':_0x4fda8,'rows':_0x39bfc0}:null;}})['then'](respondWithResult(_0x5351f7,null))[_0xc008('0x29')](handleError(_0x5351f7,null));};exports[_0xc008('0x5d')]=function(_0x1c2e63,_0xaf3bed){var _0x58ae7b=_0x1c2e63[_0xc008('0x45')][_0xc008('0x5e')];var _0x537e5e=_['map'](_0x58ae7b,'id');return db[_0xc008('0x5b')][_0xc008('0x27')]({'where':{'id':_0x537e5e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc008('0x5f'),'attributes':['id',_0xc008('0x3e'),_0xc008('0x60'),_0xc008('0x61'),'interface'],'raw':!![]}]})[_0xc008('0x15')](function(_0x3721e8){if(_0x3721e8){var _0xc344a7=_[_0xc008('0x62')](_0x3721e8,function(_0x78b833){var _0x177733=_0x78b833[_0xc008('0x3a')]({'plain':!![]});_0x177733[_0xc008('0x5f')][_0xc008('0x63')](function(_0xa332b1){_0xa332b1[_0xc008('0x64')]=_[_0xc008('0x35')](_0x58ae7b,{'id':_0x177733['id']})[_0xc008('0x64')];});return _0x177733['Agents'];});return db['VoiceQueue'][_0xc008('0x35')]({'where':{'id':_0x1c2e63[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](function(_0x4447ba){return db[_0xc008('0x65')][_0xc008('0x66')](function(_0xe5d226){return _0x4447ba['addTeams'](_0x537e5e,{'transaction':_0xe5d226})['then'](function(){return BPromise[_0xc008('0x67')](_0x58ae7b,function(_0x3d33ed){return db[_0xc008('0x68')]['upsert']({'TeamId':_0x3d33ed['id'],'VoiceQueueId':_0x1c2e63[_0xc008('0x2b')]['id'],'penalty':_0x3d33ed[_0xc008('0x64')]},{'transaction':_0xe5d226});});})[_0xc008('0x15')](function(){return BPromise[_0xc008('0x67')](_0xc344a7,function(_0x156ec3){return db[_0xc008('0x69')][_0xc008('0x6a')]({'where':{'UserId':_0x156ec3['id'],'VoiceQueueId':_0x1c2e63[_0xc008('0x2b')]['id']},'defaults':{'penalty':_0x156ec3[_0xc008('0x64')]},'transaction':_0xe5d226});});})[_0xc008('0x15')](function(){return BPromise[_0xc008('0x67')](_[_0xc008('0x53')](_0xc344a7,{'online':!![]}),function(_0x4ffaa3){return db['UserVoiceQueueRt'][_0xc008('0x6b')]({'membername':_0x4ffaa3[_0xc008('0x3e')],'UserId':_0x4ffaa3['id'],'queue_name':_0x4447ba['name'],'VoiceQueueId':_0x4447ba['id'],'interface':_[_0xc008('0x6c')](_0x4ffaa3[_0xc008('0x6d')])?util[_0xc008('0x6e')](_0xc008('0x6f'),_0x4ffaa3[_0xc008('0x3e')]):_0x4ffaa3[_0xc008('0x6d')],'paused':_0x4ffaa3[_0xc008('0x61')]||![],'penalty':_0x4ffaa3[_0xc008('0x64')]},{'transaction':_0xe5d226});});})[_0xc008('0x15')](function(){_0xc344a7['forEach'](function(_0x51b305){socket['emit'](_0xc008('0x70'),{'UserId':_0x51b305['id'],'VoiceQueueId':_0x4447ba['id']});});});});});}})['then'](respondWithStatusCode(_0xaf3bed,null))[_0xc008('0x29')](handleError(_0xaf3bed,null));};exports[_0xc008('0x71')]=function(_0x2c6a48,_0x177e8e){return db[_0xc008('0x5b')][_0xc008('0x27')]({'where':{'id':_0x2c6a48[_0xc008('0x26')][_0xc008('0x72')]},'attributes':['id'],'include':[{'model':db[_0xc008('0x73')],'as':_0xc008('0x5f'),'attributes':['id'],'raw':!![]}]})[_0xc008('0x15')](handleEntityNotFound(_0x177e8e,null))[_0xc008('0x15')](function(_0x1fea74){var _0x304083=_[_0xc008('0x17')](_0x1fea74,'id');var _0x473f44=[];var _0x41d1ea=[];var _0x5c2ca1=squel[_0xc008('0x74')]();_0x5c2ca1['field'](_0xc008('0x75'))[_0xc008('0x76')](_0xc008('0x77'),'tq')['join'](_0xc008('0x78'),'ut',_0xc008('0x79'))[_0xc008('0x24')](_0xc008('0x7a'),_0x2c6a48[_0xc008('0x2b')]['id']);for(var _0x377754=0x0;_0x377754<_0x1fea74[_0xc008('0x4c')];_0x377754+=0x1){let _0x57b8da=_0x1fea74[_0x377754];for(var _0x1cad4b=0x0;_0x1cad4b<_0x57b8da[_0xc008('0x5f')][_0xc008('0x4c')];_0x1cad4b+=0x1){let _0xdb4cef=_0x57b8da['Agents'][_0x1cad4b];var _0x555e8c=_0x5c2ca1['clone']();_0x555e8c['where'](_0xc008('0x7b'),_0xdb4cef['id']);_0x41d1ea[_0xc008('0x7c')](db[_0xc008('0x65')][_0xc008('0x26')](_0x555e8c['toString'](),{'type':db[_0xc008('0x65')][_0xc008('0x7d')][_0xc008('0x7e')]})['then'](function(_0x438195){if(_0x438195['length']===0x1){return _0xdb4cef['id'];}else{var _0x3d76b7=_['every'](_[_0xc008('0x17')](_0x438195,_0xc008('0x7f')),function(_0x1aaf89){return _[_0xc008('0x19')](_0x304083,_0x1aaf89);});if(_0x3d76b7){return _0xdb4cef['id'];}}}));}}return BPromise['all'](_0x41d1ea)[_0xc008('0x15')](function(_0x19dcb7){_0x473f44=_(_0x473f44)[_0xc008('0x80')](_0x19dcb7)[_0xc008('0x81')]()[_0xc008('0x18')]();return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x2c6a48['params']['id']}})[_0xc008('0x15')](function(_0x30b6af){return db[_0xc008('0x65')]['transaction'](function(_0x5ba04f){return _0x30b6af[_0xc008('0x71')](_0x2c6a48[_0xc008('0x26')][_0xc008('0x72')],{'transaction':_0x5ba04f})[_0xc008('0x15')](function(){if(!_['isEmpty'](_0x473f44)){return _0x30b6af[_0xc008('0x82')](_0x473f44,{'transaction':_0x5ba04f})[_0xc008('0x15')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x2c6a48['params']['id'],'UserId':_0x473f44},'transaction':_0x5ba04f});});}})[_0xc008('0x15')](function(){_0x473f44['forEach'](function(_0x3744e1){socket['emit'](_0xc008('0x83'),{'UserId':_0x3744e1,'VoiceQueueId':_0x30b6af['id']});});});});});});})[_0xc008('0x15')](respondWithStatusCode(_0x177e8e,null))[_0xc008('0x29')](handleError(_0x177e8e,null));};exports[_0xc008('0x84')]=function(_0x5c24cd,_0x5effd6){var _0x23ba7e,_0x274739;return db[_0xc008('0x20')]['find']({'where':{'id':_0x5c24cd[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x5effd6,null))[_0xc008('0x15')](function(_0x272d98){if(_0x272d98){_0x274739=_0x272d98;return _0x272d98[_0xc008('0x84')](_0x5c24cd[_0xc008('0x45')][_0xc008('0x72')],_[_0xc008('0x44')](_0x5c24cd[_0xc008('0x45')],[_0xc008('0x72'),'id'])||{})[_0xc008('0x85')](function(_0x57687f){for(var _0x5ea13a=0x0;_0x5ea13a<_0x5c24cd[_0xc008('0x45')]['ids'][_0xc008('0x4c')];_0x5ea13a+=0x1){socket[_0xc008('0x86')]('userVoiceQueue:save',{'UserId':Number(_0x5c24cd['body'][_0xc008('0x72')][_0x5ea13a]),'VoiceQueueId':Number(_0x5c24cd[_0xc008('0x2b')]['id'])});}return _0x57687f;});}})[_0xc008('0x15')](function(_0x129cbf){_0x23ba7e=_0x129cbf||[];if(_0x274739){return db[_0xc008('0x73')][_0xc008('0x27')]({'where':{'id':_0x5c24cd['body'][_0xc008('0x72')]},'attributes':['id',_0xc008('0x3e'),_0xc008('0x60'),'voicePause',_0xc008('0x6d')],'raw':!![]});}})[_0xc008('0x15')](function(_0xcef0e4){if(!_[_0xc008('0x87')](_0xcef0e4)){var _0x49f92e=[];for(var _0x4ae026=0x0;_0x4ae026<_0xcef0e4[_0xc008('0x4c')];_0x4ae026++){if(_0xcef0e4[_0x4ae026]['online']){_0x49f92e[_0xc008('0x7c')](db[_0xc008('0x88')][_0xc008('0x6b')]({'membername':_0xcef0e4[_0x4ae026][_0xc008('0x3e')],'UserId':_0xcef0e4[_0x4ae026]['id'],'queue_name':_0x274739[_0xc008('0x3e')],'VoiceQueueId':_0x274739['id'],'interface':_['isNil'](_0xcef0e4[_0x4ae026]['interface'])?util[_0xc008('0x6e')](_0xc008('0x6f'),_0xcef0e4[_0x4ae026][_0xc008('0x3e')]):_0xcef0e4[_0x4ae026][_0xc008('0x6d')],'paused':_0xcef0e4[_0x4ae026][_0xc008('0x61')]||![],'penalty':_0x5c24cd[_0xc008('0x45')][_0xc008('0x64')]||0x0}));}}return BPromise['all'](_0x49f92e);}})[_0xc008('0x15')](function(){return _0x23ba7e;})[_0xc008('0x15')](respondWithResult(_0x5effd6,null))[_0xc008('0x29')](handleError(_0x5effd6,null));};exports[_0xc008('0x82')]=function(_0x1afb32,_0x1c2263){return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x1afb32[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x1c2263,null))[_0xc008('0x15')](function(_0x328284){if(_0x328284){return _0x328284['removeAgents'](_0x1afb32[_0xc008('0x26')][_0xc008('0x72')])['then'](function(){if(_[_0xc008('0x89')](_0x1afb32[_0xc008('0x26')][_0xc008('0x72')])){for(var _0x2598be=0x0;_0x2598be<_0x1afb32[_0xc008('0x26')][_0xc008('0x72')][_0xc008('0x4c')];_0x2598be+=0x1){socket[_0xc008('0x86')](_0xc008('0x83'),{'UserId':Number(_0x1afb32[_0xc008('0x26')][_0xc008('0x72')][_0x2598be]),'VoiceQueueId':Number(_0x1afb32['params']['id'])});}}else{socket[_0xc008('0x86')](_0xc008('0x83'),{'UserId':Number(_0x1afb32[_0xc008('0x26')][_0xc008('0x72')]),'VoiceQueueId':Number(_0x1afb32[_0xc008('0x2b')]['id'])});}});}})[_0xc008('0x15')](function(_0x12f5d1){return db[_0xc008('0x88')][_0xc008('0x1c')]({'where':{'VoiceQueueId':_0x1afb32[_0xc008('0x2b')]['id'],'UserId':_0x1afb32[_0xc008('0x26')][_0xc008('0x72')]}})[_0xc008('0x15')](function(){return _0x12f5d1;});})[_0xc008('0x15')](respondWithStatusCode(_0x1c2263,null))[_0xc008('0x29')](handleError(_0x1c2263,null));};exports[_0xc008('0x8a')]=function(_0x5c358b,_0x49688b){var _0x51fd86={};var _0x10778f={};var _0x237ffb;var _0x3f80f4;return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x5c358b[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x49688b,null))['then'](function(_0x3e7099){if(_0x3e7099){_0x237ffb=_0x3e7099;_0x10778f['model']=_['keys'](db[_0xc008('0x73')][_0xc008('0x21')]);_0x10778f['query']=_[_0xc008('0x2c')](_0x5c358b[_0xc008('0x26')]);_0x10778f[_0xc008('0x2d')]=_['intersection'](_0x10778f[_0xc008('0x2e')],_0x10778f[_0xc008('0x26')]);_0x51fd86[_0xc008('0x31')]=_['intersection'](_0x10778f[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x5c358b[_0xc008('0x26')][_0xc008('0x30')]));_0x51fd86[_0xc008('0x31')]=_0x51fd86[_0xc008('0x31')][_0xc008('0x4c')]?_0x51fd86[_0xc008('0x31')]:_0x10778f['model'];_0x51fd86[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x5c358b[_0xc008('0x26')][_0xc008('0x50')]);_0x51fd86[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x5c358b[_0xc008('0x26')],_0x10778f[_0xc008('0x2d')]));if(_0x5c358b[_0xc008('0x26')][_0xc008('0x53')]){_0x51fd86[_0xc008('0x24')]=_[_0xc008('0x33')](_0x51fd86[_0xc008('0x24')],{'$or':_['map'](_0x51fd86[_0xc008('0x31')],function(_0x231318){var _0x3df369={};_0x3df369[_0x231318]={'$like':'%'+_0x5c358b[_0xc008('0x26')]['filter']+'%'};return _0x3df369;})});}_0x51fd86=_['merge']({},_0x51fd86,_0x5c358b[_0xc008('0x34')]);return _0x237ffb[_0xc008('0x8a')](_0x51fd86);}})['then'](function(_0x30e433){if(_0x30e433){_0x3f80f4=_0x30e433[_0xc008('0x4c')];if(!_0x5c358b[_0xc008('0x26')][_0xc008('0x4d')](_0xc008('0x4e'))){_0x51fd86[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x5c358b['query']['limit']);_0x51fd86[_0xc008('0x10')]=qs['offset'](_0x5c358b[_0xc008('0x26')][_0xc008('0x10')]);}return _0x237ffb[_0xc008('0x8a')](_0x51fd86);}})[_0xc008('0x15')](function(_0x2ea1db){if(_0x2ea1db){return _0x2ea1db?{'count':_0x3f80f4,'rows':_0x2ea1db}:null;}})[_0xc008('0x15')](respondWithResult(_0x49688b,null))[_0xc008('0x29')](handleError(_0x49688b,null));};exports[_0xc008('0x8b')]=function(_0x367873,_0x356a82){var _0x368c1f={};var _0x4fd0ff={};var _0x22772e;var _0x39fd43;return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x367873[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x356a82,null))[_0xc008('0x15')](function(_0x506dc0){if(_0x506dc0){_0x22772e=_0x506dc0;_0x4fd0ff[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x88')]['rawAttributes']);_0x4fd0ff[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x367873[_0xc008('0x26')]);_0x4fd0ff[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x4fd0ff[_0xc008('0x2e')],_0x4fd0ff['query']);_0x368c1f['attributes']=_[_0xc008('0x2f')](_0x4fd0ff[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x367873[_0xc008('0x26')][_0xc008('0x30')]));_0x368c1f['attributes']=_0x368c1f[_0xc008('0x31')]['length']?_0x368c1f[_0xc008('0x31')]:_0x4fd0ff[_0xc008('0x2e')];_0x368c1f['order']=qs[_0xc008('0x50')](_0x367873[_0xc008('0x26')][_0xc008('0x50')]);_0x368c1f[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x367873[_0xc008('0x26')],_0x4fd0ff[_0xc008('0x2d')]));if(_0x367873[_0xc008('0x26')][_0xc008('0x53')]){_0x368c1f['where']=_[_0xc008('0x33')](_0x368c1f[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x368c1f['attributes'],function(_0x43f96e){var _0x353cd5={};_0x353cd5[_0x43f96e]={'$like':'%'+_0x367873[_0xc008('0x26')][_0xc008('0x53')]+'%'};return _0x353cd5;})});}_0x368c1f=_['merge']({},_0x368c1f,_0x367873[_0xc008('0x34')]);return _0x22772e[_0xc008('0x8b')](_0x368c1f);}})[_0xc008('0x15')](function(_0x9afcd6){if(_0x9afcd6){_0x39fd43=_0x9afcd6[_0xc008('0x4c')];if(!_0x367873['query'][_0xc008('0x4d')]('nolimit')){_0x368c1f['limit']=qs[_0xc008('0x4f')](_0x367873['query'][_0xc008('0x4f')]);_0x368c1f[_0xc008('0x10')]=qs[_0xc008('0x10')](_0x367873[_0xc008('0x26')][_0xc008('0x10')]);}return _0x22772e[_0xc008('0x8b')](_0x368c1f);}})[_0xc008('0x15')](function(_0x5e9e9c){return _0x5e9e9c?{'count':_0x39fd43,'rows':_0x5e9e9c}:null;})[_0xc008('0x15')](respondWithResult(_0x356a82,null))[_0xc008('0x29')](handleError(_0x356a82,null));};exports[_0xc008('0x8c')]=function(_0x45fe90,_0xc046ce){var _0x46fc75={};var _0x59b5b9={};var _0x3c3ead;var _0x3c8a79;return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x45fe90[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0xc046ce,null))[_0xc008('0x15')](function(_0x3aa9b4){if(_0x3aa9b4){_0x3c3ead=_0x3aa9b4;_0x59b5b9['model']=_['keys'](db[_0xc008('0x8d')][_0xc008('0x21')]);_0x59b5b9['query']=_[_0xc008('0x2c')](_0x45fe90['query']);_0x59b5b9[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x59b5b9[_0xc008('0x2e')],_0x59b5b9[_0xc008('0x26')]);_0x46fc75[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x59b5b9[_0xc008('0x2e')],qs['fields'](_0x45fe90[_0xc008('0x26')]['fields']));_0x46fc75[_0xc008('0x31')]=_0x46fc75[_0xc008('0x31')][_0xc008('0x4c')]?_0x46fc75[_0xc008('0x31')]:_0x59b5b9[_0xc008('0x2e')];_0x46fc75[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x45fe90['query'][_0xc008('0x50')]);_0x46fc75[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x45fe90[_0xc008('0x26')],_0x59b5b9[_0xc008('0x2d')]));if(_0x45fe90[_0xc008('0x26')][_0xc008('0x53')]){_0x46fc75[_0xc008('0x24')]=_['merge'](_0x46fc75[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x46fc75[_0xc008('0x31')],function(_0x3e7c19){var _0x47d263={};_0x47d263[_0x3e7c19]={'$like':'%'+_0x45fe90['query']['filter']+'%'};return _0x47d263;})});}_0x46fc75=_[_0xc008('0x33')]({},_0x46fc75,_0x45fe90[_0xc008('0x34')]);return _0x3c3ead['getLists'](_0x46fc75);}})['then'](function(_0x5035ca){if(_0x5035ca){_0x3c8a79=_0x5035ca['length'];if(!_0x45fe90[_0xc008('0x26')][_0xc008('0x4d')]('nolimit')){_0x46fc75[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x45fe90[_0xc008('0x26')][_0xc008('0x4f')]);_0x46fc75[_0xc008('0x10')]=qs['offset'](_0x45fe90['query'][_0xc008('0x10')]);}return _0x3c3ead[_0xc008('0x8c')](_0x46fc75);}})[_0xc008('0x15')](function(_0x46f9ab){if(_0x46f9ab){return _0x46f9ab?{'count':_0x3c8a79,'rows':_0x46f9ab}:null;}})[_0xc008('0x15')](respondWithResult(_0xc046ce,null))[_0xc008('0x29')](handleError(_0xc046ce,null));};exports[_0xc008('0x8e')]=function(_0x5645bb,_0x2ebe07){var _0x3d6f0d=moment()[_0xc008('0x6e')](_0xc008('0x8f'));var _0x3be328,_0x3bcf94;return db[_0xc008('0x20')]['find']({'where':{'id':_0x5645bb['params']['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x2ebe07,null))[_0xc008('0x15')](function(_0x11bcba){if(_0x11bcba){_0x3bcf94=_0x11bcba;return _0x11bcba[_0xc008('0x8e')](_0x5645bb[_0xc008('0x45')][_0xc008('0x72')],_[_0xc008('0x44')](_0x5645bb[_0xc008('0x45')],[_0xc008('0x72'),'id'])||{});}return null;})[_0xc008('0x85')](function(_0xefba5){var _0x202826;_0x3be328=_0xefba5||[];var _0x37e1f2=[];if(_0xefba5){for(var _0x5161f3=0x0;_0x5161f3<_0xefba5['length'];_0x5161f3+=0x1){var _0x43ec81=_0xefba5[_0x5161f3][_0xc008('0x3a')]({'plain':!![]});_0x3bcf94[_0xc008('0x90')]=_0x5645bb[_0xc008('0x45')][_0xc008('0x90')]?_0x5645bb[_0xc008('0x45')][_0xc008('0x90')]:_0x3bcf94['dialCheckDuplicateType'];switch(_0x3bcf94['dialCheckDuplicateType']){case'always':_0x202826=squel[_0xc008('0x91')]()['into']('cm_hopper')['fromQuery']([_0xc008('0x92'),_0xc008('0x93'),_0xc008('0x94'),_0xc008('0x95'),_0xc008('0x52'),_0xc008('0x46'),_0xc008('0x47')],squel[_0xc008('0x74')]()[_0xc008('0x96')](_0xc008('0x92'),_0xc008('0x92'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','scheduledAt')['field']('id',_0xc008('0x94'))[_0xc008('0x96')](_0x43ec81[_0xc008('0x97')][_0xc008('0x98')](),_0xc008('0x95'))[_0xc008('0x96')](_0x5645bb[_0xc008('0x2b')]['id'][_0xc008('0x98')](),'VoiceQueueId')[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','createdAt')['field']('\x27'+_0x3d6f0d+'\x27','updatedAt')['from'](_0xc008('0x99'))['where'](_0xc008('0x9a'))[_0xc008('0x24')](_0xc008('0x9b'),_0x43ec81['CmListId']['toString']())[_0xc008('0x24')](_0xc008('0x9c'))['where'](_0xc008('0x9d'),squel[_0xc008('0x74')]()[_0xc008('0x96')](_0xc008('0x9e'))[_0xc008('0x76')](_0xc008('0x9f'))[_0xc008('0x24')](_0xc008('0x7a'),_0x5645bb[_0xc008('0x2b')]['id'][_0xc008('0x98')]()))['where'](_0xc008('0x9d'),squel[_0xc008('0x74')]()['field']('COALESCE(phone,\x27\x27)')[_0xc008('0x76')](_0xc008('0xa0'))[_0xc008('0x24')]('VoiceQueueId\x20=\x20?',_0x5645bb['params']['id']['toString']())))['toString']();break;case _0xc008('0xa1'):_0x202826=squel[_0xc008('0x91')]()[_0xc008('0xa2')](_0xc008('0xa0'))[_0xc008('0xa3')]([_0xc008('0x92'),_0xc008('0x93'),'ContactId',_0xc008('0x95'),_0xc008('0x52'),_0xc008('0x46'),_0xc008('0x47')],squel[_0xc008('0x74')]()['field'](_0xc008('0x92'),_0xc008('0x92'))['field']('\x27'+_0x3d6f0d+'\x27',_0xc008('0x93'))[_0xc008('0x96')]('id',_0xc008('0x94'))[_0xc008('0x96')](_0x43ec81['CmListId'][_0xc008('0x98')](),'ListId')[_0xc008('0x96')](_0x5645bb[_0xc008('0x2b')]['id'][_0xc008('0x98')](),_0xc008('0x52'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','createdAt')[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27',_0xc008('0x47'))[_0xc008('0x76')](_0xc008('0x99'))['where'](_0xc008('0x9a'))['where']('ListId\x20=\x20?',_0x43ec81[_0xc008('0x97')][_0xc008('0x98')]())[_0xc008('0x24')]('phone\x20IS\x20NOT\x20NULL')[_0xc008('0x24')](_0xc008('0x9d'),squel['select']()[_0xc008('0x96')](_0xc008('0xa4'))['from']('cm_hopper')[_0xc008('0x24')]('VoiceQueueId\x20=\x20?',_0x5645bb['params']['id'][_0xc008('0x98')]())))['toString']();break;default:_0x202826=squel[_0xc008('0x91')]()[_0xc008('0xa2')](_0xc008('0xa0'))[_0xc008('0xa3')]([_0xc008('0x92'),'scheduledAt','ContactId',_0xc008('0x95'),'VoiceQueueId',_0xc008('0x46'),'updatedAt'],squel['select']()['field'](_0xc008('0x92'),'phone')[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27',_0xc008('0x93'))['field']('id','ContactId')[_0xc008('0x96')](_0x43ec81[_0xc008('0x97')][_0xc008('0x98')](),_0xc008('0x95'))['field'](_0x5645bb['params']['id'][_0xc008('0x98')](),'VoiceQueueId')['field']('\x27'+_0x3d6f0d+'\x27',_0xc008('0x46'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','updatedAt')['from']('cm_contacts')[_0xc008('0x24')]('deletedAt\x20IS\x20NULL')[_0xc008('0x24')](_0xc008('0x9b'),_0x43ec81[_0xc008('0x97')][_0xc008('0x98')]())[_0xc008('0x24')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x37e1f2[_0xc008('0x7c')](db[_0xc008('0x65')][_0xc008('0x26')](_0x202826));}return BPromise[_0xc008('0xa5')](_0x37e1f2);}})[_0xc008('0x15')](function(){var _0x262b79=[];var _0x15c5a2=squel[_0xc008('0x91')]()[_0xc008('0xa2')](_0xc008('0xa6'))[_0xc008('0xa3')]([_0xc008('0xa7'),'phone',_0xc008('0xa8'),_0xc008('0x46'),_0xc008('0x47')],squel[_0xc008('0x74')]()['field'](_0xc008('0xa9'))[_0xc008('0x96')](_0xc008('0xaa'))[_0xc008('0x96')](_0xc008('0xab'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27',_0xc008('0x46'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','updatedAt')[_0xc008('0x76')](_0xc008('0xac'),'ci')[_0xc008('0xad')](_0xc008('0xa0'),'h',_0xc008('0xae'))[_0xc008('0x24')](_0xc008('0xaf'),_0x3d6f0d)['where'](_0xc008('0xb0'),'PHONE'))[_0xc008('0x98')]();_0x262b79[_0xc008('0x7c')](db[_0xc008('0x65')][_0xc008('0x26')](_0x15c5a2));return BPromise[_0xc008('0xa5')](_0x262b79);})[_0xc008('0x15')](function(){return _0x3be328;})[_0xc008('0x15')](respondWithResult(_0x2ebe07,null))[_0xc008('0x29')](handleError(_0x2ebe07,null));};exports[_0xc008('0xb1')]=function(_0x471780,_0x4fae34){return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x471780[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x4fae34,null))[_0xc008('0x15')](function(_0x1cc6a6){if(_0x1cc6a6){return _0x1cc6a6[_0xc008('0xb1')](_0x471780[_0xc008('0x26')][_0xc008('0x72')]);}})[_0xc008('0x15')](function(_0x471618){if(_0x471618){return db[_0xc008('0x4b')][_0xc008('0x1c')]({'where':{'ListId':_0x471780['query'][_0xc008('0x72')],'VoiceQueueId':_0x471780['params']['id']}})[_0xc008('0x15')](function(){return _0x471618;});}})[_0xc008('0x15')](respondWithStatusCode(_0x4fae34,null))[_0xc008('0x29')](handleError(_0x4fae34,null));};exports[_0xc008('0xb2')]=function(_0x370234,_0x3ff7d2){var _0x478794={};var _0x406de6={};var _0x34cbce;var _0x337acd;return db['VoiceQueue']['findOne']({'where':{'id':_0x370234['params']['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x3ff7d2,null))[_0xc008('0x15')](function(_0x2ccfcf){if(_0x2ccfcf){_0x34cbce=_0x2ccfcf;_0x406de6[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x8d')][_0xc008('0x21')]);_0x406de6['query']=_[_0xc008('0x2c')](_0x370234[_0xc008('0x26')]);_0x406de6[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x406de6[_0xc008('0x2e')],_0x406de6['query']);_0x478794[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x406de6[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x370234[_0xc008('0x26')][_0xc008('0x30')]));_0x478794[_0xc008('0x31')]=_0x478794[_0xc008('0x31')][_0xc008('0x4c')]?_0x478794[_0xc008('0x31')]:_0x406de6[_0xc008('0x2e')];_0x478794['order']=qs[_0xc008('0x50')](_0x370234['query'][_0xc008('0x50')]);_0x478794[_0xc008('0x24')]=qs[_0xc008('0x2d')](_['pick'](_0x370234[_0xc008('0x26')],_0x406de6['filters']));if(_0x370234[_0xc008('0x26')][_0xc008('0x53')]){_0x478794[_0xc008('0x24')]=_[_0xc008('0x33')](_0x478794[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x478794[_0xc008('0x31')],function(_0x89601c){var _0x22bb2a={};_0x22bb2a[_0x89601c]={'$like':'%'+_0x370234[_0xc008('0x26')]['filter']+'%'};return _0x22bb2a;})});}_0x478794=_[_0xc008('0x33')]({},_0x478794,_0x370234['options']);return _0x34cbce['getBlackLists'](_0x478794);}})[_0xc008('0x15')](function(_0x55ad1f){if(_0x55ad1f){_0x337acd=_0x55ad1f[_0xc008('0x4c')];if(!_0x370234[_0xc008('0x26')][_0xc008('0x4d')](_0xc008('0x4e'))){_0x478794['limit']=qs[_0xc008('0x4f')](_0x370234[_0xc008('0x26')][_0xc008('0x4f')]);_0x478794[_0xc008('0x10')]=qs[_0xc008('0x10')](_0x370234['query'][_0xc008('0x10')]);}return _0x34cbce[_0xc008('0xb2')](_0x478794);}})['then'](function(_0x247e3a){if(_0x247e3a){return _0x247e3a?{'count':_0x337acd,'rows':_0x247e3a}:null;}})[_0xc008('0x15')](respondWithResult(_0x3ff7d2,null))[_0xc008('0x29')](handleError(_0x3ff7d2,null));};exports[_0xc008('0xb3')]=function(_0x252c44,_0x3b46db){var _0x482efd;return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x252c44[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x3b46db,null))[_0xc008('0x15')](function(_0x2f217e){if(_0x2f217e){return _0x2f217e[_0xc008('0xb3')](_0x252c44[_0xc008('0x45')][_0xc008('0x72')],_[_0xc008('0x44')](_0x252c44['body'],[_0xc008('0x72'),'id'])||{});}return null;})[_0xc008('0x85')](function(_0x298783){var _0xe349bd;_0x482efd=_0x298783||[];var _0x50db48=[];if(_0x298783){for(var _0x384f2f=0x0;_0x384f2f<_0x298783[_0xc008('0x4c')];_0x384f2f+=0x1){var _0x367581=_0x298783[_0x384f2f][_0xc008('0x3a')]({'plain':!![]});_0xe349bd=squel[_0xc008('0x91')]()[_0xc008('0xa2')](_0xc008('0xb4'))[_0xc008('0xa3')]([_0xc008('0x92'),_0xc008('0x94'),_0xc008('0x95'),_0xc008('0x52'),_0xc008('0x46'),_0xc008('0x47')],squel['select']()[_0xc008('0x96')](_0xc008('0x92'),_0xc008('0x92'))[_0xc008('0x96')]('id',_0xc008('0x94'))['field'](_0x367581[_0xc008('0x97')][_0xc008('0x98')](),'ListId')[_0xc008('0x96')](_0x252c44[_0xc008('0x2b')]['id']['toString'](),'VoiceQueueId')['field']('NOW()',_0xc008('0x46'))['field']('NOW()',_0xc008('0x47'))[_0xc008('0x76')](_0xc008('0x99'))['where']('deletedAt\x20IS\x20NULL')[_0xc008('0x24')](_0xc008('0x9b'),_0x367581[_0xc008('0x97')][_0xc008('0x98')]())['where'](_0xc008('0x9c')))[_0xc008('0x98')]();_0x50db48['push'](db[_0xc008('0x65')]['query'](_0xe349bd));}return BPromise['all'](_0x50db48);}})[_0xc008('0x15')](function(){return _0x482efd;})[_0xc008('0x15')](respondWithResult(_0x3b46db,null))['catch'](handleError(_0x3b46db,null));};exports['removeBlackLists']=function(_0x1e3098,_0x9b997d){return db['VoiceQueue'][_0xc008('0x35')]({'where':{'id':_0x1e3098['params']['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x9b997d,null))[_0xc008('0x15')](function(_0x1422ab){if(_0x1422ab){return _0x1422ab[_0xc008('0xb5')](_0x1e3098[_0xc008('0x26')][_0xc008('0x72')]);}})[_0xc008('0x15')](function(_0x41a8a6){if(_0x41a8a6){return db['CmHopperBlack'][_0xc008('0x1c')]({'where':{'ListId':_0x1e3098['query'][_0xc008('0x72')],'VoiceQueueId':_0x1e3098['params']['id']}})['then'](function(){return _0x41a8a6;});}})[_0xc008('0x15')](respondWithStatusCode(_0x9b997d,null))[_0xc008('0x29')](handleError(_0x9b997d,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index adda799..dcbf77d 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 _0x3874=['save','update','remove','emit','hook','exports','events','VoiceQueue','setMaxListeners'];(function(_0x44a765,_0x3c9e60){var _0x587c8e=function(_0x56c428){while(--_0x56c428){_0x44a765['push'](_0x44a765['shift']());}};_0x587c8e(++_0x3c9e60);}(_0x3874,0x1da));var _0x4387=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3874[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x4387('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x4387('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x4387('0x2')](0x0);var events={'afterCreate':_0x4387('0x3'),'afterUpdate':_0x4387('0x4'),'afterDestroy':_0x4387('0x5')};function emitEvent(_0x45d4cf){return function(_0x230ec0,_0x46418d,_0x599dc9){VoiceQueueEvents['emit'](_0x45d4cf+':'+_0x230ec0['id'],_0x230ec0);VoiceQueueEvents[_0x4387('0x6')](_0x45d4cf,_0x230ec0);_0x599dc9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x4387('0x7')](e,emitEvent(event));}}module[_0x4387('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x563e=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update'];(function(_0x3287f4,_0x131a75){var _0x4f6d7e=function(_0x431e12){while(--_0x431e12){_0x3287f4['push'](_0x3287f4['shift']());}};_0x4f6d7e(++_0x131a75);}(_0x563e,0xb8));var _0xe563=function(_0x234577,_0x3b9004){_0x234577=_0x234577-0x0;var _0x28fea6=_0x563e[_0x234577];return _0x28fea6;};'use strict';var EventEmitter=require(_0xe563('0x0'));var VoiceQueue=require(_0xe563('0x1'))['db'][_0xe563('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xe563('0x3')](0x0);var events={'afterCreate':_0xe563('0x4'),'afterUpdate':_0xe563('0x5'),'afterDestroy':_0xe563('0x6')};function emitEvent(_0x183900){return function(_0x32231d,_0x4c5669,_0x320b8b){VoiceQueueEvents[_0xe563('0x7')](_0x183900+':'+_0x32231d['id'],_0x32231d);VoiceQueueEvents[_0xe563('0x7')](_0x183900,_0x32231d);_0x320b8b(null);};}for(var e in events){if(events[_0xe563('0x8')](e)){var event=events[e];VoiceQueue[_0xe563('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index b770b2c..260ef12 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(_0xef663c,_0x401c58){var _0x451029=function(_0x1d4785){while(--_0x1d4785){_0xef663c['push'](_0xef663c['shift']());}};_0x451029(++_0x401c58);}(_0x34e8,0x12c));var _0x834e=function(_0x322379,_0x477087){_0x322379=_0x322379-0x0;var _0x2b3dfc=_0x34e8[_0x322379];return _0x2b3dfc;};'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 _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5e76c0,_0x4bfab3){var _0x102bf5=function(_0x538c17){while(--_0x538c17){_0x5e76c0['push'](_0x5e76c0['shift']());}};_0x102bf5(++_0x4bfab3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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':'voice_queues','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 c76895d..7c31e50 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 _0xdd3a=['GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','model','map','find','ShowVoiceQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch'];(function(_0x125fc7,_0x1741fd){var _0x512ba9=function(_0x29506b){while(--_0x29506b){_0x125fc7['push'](_0x125fc7['shift']());}};_0x512ba9(++_0x1741fd);}(_0xdd3a,0xfd));var _0xadd3=function(_0x28ca9d,_0x381de0){_0x28ca9d=_0x28ca9d-0x0;var _0x277981=_0xdd3a[_0x28ca9d];return _0x277981;};'use strict';var _=require('lodash');var util=require(_0xadd3('0x0'));var moment=require(_0xadd3('0x1'));var BPromise=require(_0xadd3('0x2'));var rs=require(_0xadd3('0x3'));var fs=require('fs');var Redis=require(_0xadd3('0x4'));var db=require(_0xadd3('0x5'))['db'];var utils=require(_0xadd3('0x6'));var logger=require(_0xadd3('0x7'))(_0xadd3('0x8'));var config=require(_0xadd3('0x9'));var jayson=require(_0xadd3('0xa'));var client=jayson[_0xadd3('0xb')][_0xadd3('0xc')]({'port':0x232a});config[_0xadd3('0xd')]=_[_0xadd3('0xe')](config[_0xadd3('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xadd3('0xd')]));require(_0xadd3('0xf'))[_0xadd3('0x10')](socket);function respondWithRpcPromise(_0x203175,_0x8a6f67,_0x28acca){return new BPromise(function(_0x5b0d38,_0x5b2780){return client[_0xadd3('0x11')](_0x203175,_0x28acca)[_0xadd3('0x12')](function(_0x217415){logger[_0xadd3('0x13')](_0xadd3('0x14'),_0x8a6f67,_0xadd3('0x15'));logger[_0xadd3('0x16')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x8a6f67,_0xadd3('0x15'),JSON[_0xadd3('0x17')](_0x217415));if(_0x217415[_0xadd3('0x18')]){if(_0x217415['error']['code']===0x1f4){logger[_0xadd3('0x18')](_0xadd3('0x14'),_0x8a6f67,_0x217415[_0xadd3('0x18')][_0xadd3('0x19')]);return _0x5b2780(_0x217415['error'][_0xadd3('0x19')]);}logger[_0xadd3('0x18')](_0xadd3('0x14'),_0x8a6f67,_0x217415[_0xadd3('0x18')][_0xadd3('0x19')]);return _0x5b0d38(_0x217415[_0xadd3('0x18')][_0xadd3('0x19')]);}else{logger[_0xadd3('0x13')](_0xadd3('0x14'),_0x8a6f67,_0xadd3('0x15'));_0x5b0d38(_0x217415['result'][_0xadd3('0x19')]);}})[_0xadd3('0x1a')](function(_0x1fc5d5){logger[_0xadd3('0x18')](_0xadd3('0x14'),_0x8a6f67,_0x1fc5d5);_0x5b2780(_0x1fc5d5);});});}exports[_0xadd3('0x1b')]=function(_0xc33d77){var _0x259f4a=this;return new Promise(function(_0x4b6bf5,_0xe132b2){return db[_0xadd3('0x1c')][_0xadd3('0x1d')]({'raw':_0xc33d77[_0xadd3('0x1e')]?_0xc33d77[_0xadd3('0x1e')][_0xadd3('0x1f')]===undefined?!![]:![]:!![],'where':_0xc33d77['options']?_0xc33d77[_0xadd3('0x1e')][_0xadd3('0x20')]||null:null,'attributes':_0xc33d77[_0xadd3('0x1e')]?_0xc33d77[_0xadd3('0x1e')][_0xadd3('0x21')]||null:null,'limit':_0xc33d77[_0xadd3('0x1e')]?_0xc33d77[_0xadd3('0x1e')][_0xadd3('0x22')]||null:null,'include':_0xc33d77[_0xadd3('0x1e')]?_0xc33d77['options'][_0xadd3('0x23')]?_['map'](_0xc33d77['options'][_0xadd3('0x23')],function(_0x3274be){return{'model':db[_0x3274be[_0xadd3('0x24')]],'as':_0x3274be['as'],'attributes':_0x3274be[_0xadd3('0x21')],'include':_0x3274be[_0xadd3('0x23')]?_[_0xadd3('0x25')](_0x3274be[_0xadd3('0x23')],function(_0x230714){return{'model':db[_0x230714[_0xadd3('0x24')]],'as':_0x230714['as'],'attributes':_0x230714[_0xadd3('0x21')],'include':_0x230714['include']?_[_0xadd3('0x25')](_0x230714[_0xadd3('0x23')],function(_0x5373a7){return{'model':db[_0x5373a7[_0xadd3('0x24')]],'as':_0x5373a7['as'],'attributes':_0x5373a7[_0xadd3('0x21')]};}):[]};}):[]};}):[]:[]})[_0xadd3('0x12')](function(_0x235ec5){logger[_0xadd3('0x13')](_0xadd3('0x1b'),_0xc33d77);logger[_0xadd3('0x16')](_0xadd3('0x1b'),_0xc33d77,JSON[_0xadd3('0x17')](_0x235ec5));_0x4b6bf5(_0x235ec5);})[_0xadd3('0x1a')](function(_0x46bfe3){logger['error'](_0xadd3('0x1b'),_0x46bfe3[_0xadd3('0x19')],_0xc33d77);_0xe132b2(_0x259f4a[_0xadd3('0x18')](0x1f4,_0x46bfe3['message']));});});};exports['ShowVoiceQueue']=function(_0x1fb909){var _0x3831e7=this;return new Promise(function(_0x4cff83,_0x2bf13d){return db[_0xadd3('0x1c')][_0xadd3('0x26')]({'raw':_0x1fb909[_0xadd3('0x1e')]?_0x1fb909[_0xadd3('0x1e')][_0xadd3('0x1f')]===undefined?!![]:![]:!![],'where':_0x1fb909[_0xadd3('0x1e')]?_0x1fb909[_0xadd3('0x1e')][_0xadd3('0x20')]||null:null,'attributes':_0x1fb909[_0xadd3('0x1e')]?_0x1fb909[_0xadd3('0x1e')][_0xadd3('0x21')]||null:null,'include':_0x1fb909['options']?_0x1fb909[_0xadd3('0x1e')][_0xadd3('0x23')]?_['map'](_0x1fb909[_0xadd3('0x1e')][_0xadd3('0x23')],function(_0x152c09){return{'model':db[_0x152c09[_0xadd3('0x24')]],'as':_0x152c09['as'],'attributes':_0x152c09[_0xadd3('0x21')],'include':_0x152c09['include']?_['map'](_0x152c09[_0xadd3('0x23')],function(_0x1bbc2f){return{'model':db[_0x1bbc2f[_0xadd3('0x24')]],'as':_0x1bbc2f['as'],'attributes':_0x1bbc2f[_0xadd3('0x21')],'include':_0x1bbc2f[_0xadd3('0x23')]?_['map'](_0x1bbc2f[_0xadd3('0x23')],function(_0x4388a6){return{'model':db[_0x4388a6['model']],'as':_0x4388a6['as'],'attributes':_0x4388a6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xe7e5c2){logger[_0xadd3('0x13')](_0xadd3('0x27'),_0x1fb909);logger[_0xadd3('0x16')](_0xadd3('0x27'),_0x1fb909,JSON[_0xadd3('0x17')](_0xe7e5c2));_0x4cff83(_0xe7e5c2);})[_0xadd3('0x1a')](function(_0x44042a){logger[_0xadd3('0x18')](_0xadd3('0x27'),_0x44042a[_0xadd3('0x19')],_0x1fb909);_0x2bf13d(_0x3831e7[_0xadd3('0x18')](0x1f4,_0x44042a[_0xadd3('0x19')]));});});}; \ No newline at end of file +var _0x789a=['result','GetVoiceQueue','findAll','options','attributes','limit','include','map','model','then','catch','ShowVoiceQueue','VoiceQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x789a,0x193));var _0xa789=function(_0x5e64de,_0x57c022){_0x5e64de=_0x5e64de-0x0;var _0x193075=_0x789a[_0x5e64de];return _0x193075;};'use strict';var _=require(_0xa789('0x0'));var util=require(_0xa789('0x1'));var moment=require(_0xa789('0x2'));var BPromise=require(_0xa789('0x3'));var rs=require(_0xa789('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa789('0x5'));var logger=require(_0xa789('0x6'))(_0xa789('0x7'));var config=require(_0xa789('0x8'));var jayson=require(_0xa789('0x9'));var client=jayson[_0xa789('0xa')][_0xa789('0xb')]({'port':0x232a});config['redis']=_[_0xa789('0xc')](config[_0xa789('0xd')],{'host':_0xa789('0xe'),'port':0x18eb});var socket=require(_0xa789('0xf'))(new Redis(config[_0xa789('0xd')]));require(_0xa789('0x10'))[_0xa789('0x11')](socket);function respondWithRpcPromise(_0x5c6126,_0x27edf9,_0x5252ce){return new BPromise(function(_0x316638,_0x5275d4){return client[_0xa789('0x12')](_0x5c6126,_0x5252ce)['then'](function(_0x1d2262){logger[_0xa789('0x13')](_0xa789('0x14'),_0x27edf9,_0xa789('0x15'));logger[_0xa789('0x16')](_0xa789('0x17'),_0x27edf9,_0xa789('0x15'),JSON[_0xa789('0x18')](_0x1d2262));if(_0x1d2262[_0xa789('0x19')]){if(_0x1d2262['error']['code']===0x1f4){logger['error'](_0xa789('0x14'),_0x27edf9,_0x1d2262['error'][_0xa789('0x1a')]);return _0x5275d4(_0x1d2262[_0xa789('0x19')][_0xa789('0x1a')]);}logger[_0xa789('0x19')](_0xa789('0x14'),_0x27edf9,_0x1d2262['error'][_0xa789('0x1a')]);return _0x316638(_0x1d2262[_0xa789('0x19')][_0xa789('0x1a')]);}else{logger['info'](_0xa789('0x14'),_0x27edf9,_0xa789('0x15'));_0x316638(_0x1d2262[_0xa789('0x1b')][_0xa789('0x1a')]);}})['catch'](function(_0x778b4f){logger[_0xa789('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x27edf9,_0x778b4f);_0x5275d4(_0x778b4f);});});}exports[_0xa789('0x1c')]=function(_0x4078a9){var _0x2c4200=this;return new Promise(function(_0x10eda0,_0x319d49){return db['VoiceQueue'][_0xa789('0x1d')]({'raw':_0x4078a9[_0xa789('0x1e')]?_0x4078a9[_0xa789('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4078a9[_0xa789('0x1e')]?_0x4078a9[_0xa789('0x1e')]['where']||null:null,'attributes':_0x4078a9[_0xa789('0x1e')]?_0x4078a9[_0xa789('0x1e')][_0xa789('0x1f')]||null:null,'limit':_0x4078a9['options']?_0x4078a9[_0xa789('0x1e')][_0xa789('0x20')]||null:null,'include':_0x4078a9[_0xa789('0x1e')]?_0x4078a9[_0xa789('0x1e')][_0xa789('0x21')]?_[_0xa789('0x22')](_0x4078a9[_0xa789('0x1e')][_0xa789('0x21')],function(_0x10f834){return{'model':db[_0x10f834[_0xa789('0x23')]],'as':_0x10f834['as'],'attributes':_0x10f834[_0xa789('0x1f')],'include':_0x10f834[_0xa789('0x21')]?_[_0xa789('0x22')](_0x10f834[_0xa789('0x21')],function(_0x9005ec){return{'model':db[_0x9005ec[_0xa789('0x23')]],'as':_0x9005ec['as'],'attributes':_0x9005ec[_0xa789('0x1f')],'include':_0x9005ec['include']?_[_0xa789('0x22')](_0x9005ec['include'],function(_0x4507db){return{'model':db[_0x4507db['model']],'as':_0x4507db['as'],'attributes':_0x4507db['attributes']};}):[]};}):[]};}):[]:[]})[_0xa789('0x24')](function(_0x27215c){logger[_0xa789('0x13')](_0xa789('0x1c'),_0x4078a9);logger['debug']('GetVoiceQueue',_0x4078a9,JSON[_0xa789('0x18')](_0x27215c));_0x10eda0(_0x27215c);})[_0xa789('0x25')](function(_0x4d5418){logger[_0xa789('0x19')](_0xa789('0x1c'),_0x4d5418['message'],_0x4078a9);_0x319d49(_0x2c4200[_0xa789('0x19')](0x1f4,_0x4d5418['message']));});});};exports[_0xa789('0x26')]=function(_0x596703){var _0x4f686d=this;return new Promise(function(_0x36b50c,_0x2fc335){return db[_0xa789('0x27')][_0xa789('0x28')]({'raw':_0x596703[_0xa789('0x1e')]?_0x596703['options'][_0xa789('0x29')]===undefined?!![]:![]:!![],'where':_0x596703[_0xa789('0x1e')]?_0x596703['options'][_0xa789('0x2a')]||null:null,'attributes':_0x596703['options']?_0x596703[_0xa789('0x1e')]['attributes']||null:null,'include':_0x596703[_0xa789('0x1e')]?_0x596703[_0xa789('0x1e')][_0xa789('0x21')]?_[_0xa789('0x22')](_0x596703[_0xa789('0x1e')][_0xa789('0x21')],function(_0x898e64){return{'model':db[_0x898e64[_0xa789('0x23')]],'as':_0x898e64['as'],'attributes':_0x898e64[_0xa789('0x1f')],'include':_0x898e64[_0xa789('0x21')]?_[_0xa789('0x22')](_0x898e64['include'],function(_0x1ab62f){return{'model':db[_0x1ab62f['model']],'as':_0x1ab62f['as'],'attributes':_0x1ab62f[_0xa789('0x1f')],'include':_0x1ab62f[_0xa789('0x21')]?_['map'](_0x1ab62f['include'],function(_0x12a5c4){return{'model':db[_0x12a5c4[_0xa789('0x23')]],'as':_0x12a5c4['as'],'attributes':_0x12a5c4[_0xa789('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa789('0x24')](function(_0x2b0fc6){logger['info'](_0xa789('0x26'),_0x596703);logger['debug']('ShowVoiceQueue',_0x596703,JSON['stringify'](_0x2b0fc6));_0x36b50c(_0x2b0fc6);})[_0xa789('0x25')](function(_0x2b81f8){logger[_0xa789('0x19')](_0xa789('0x26'),_0x2b81f8[_0xa789('0x1a')],_0x596703);_0x2fc335(_0x4f686d[_0xa789('0x19')](0x1f4,_0x2b81f8['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index a875a23..a0f9b8d 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 _0x8480=['emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save','update'];(function(_0x5528c3,_0x35a416){var _0x47ec1b=function(_0x54a18e){while(--_0x54a18e){_0x5528c3['push'](_0x5528c3['shift']());}};_0x47ec1b(++_0x35a416);}(_0x8480,0x155));var _0x0848=function(_0x48cac2,_0x483396){_0x48cac2=_0x48cac2-0x0;var _0xd2a59e=_0x8480[_0x48cac2];return _0xd2a59e;};'use strict';var VoiceQueueEvents=require(_0x0848('0x0'));var events=[_0x0848('0x1'),'remove',_0x0848('0x2')];function createListener(_0x7a76fe,_0x371b23){return function(_0x8aa183){_0x371b23[_0x0848('0x3')](_0x7a76fe,_0x8aa183);};}function removeListener(_0x37c844,_0x485107){return function(){VoiceQueueEvents[_0x0848('0x4')](_0x37c844,_0x485107);};}exports[_0x0848('0x5')]=function(_0x2cbb6c){for(var _0x5ad1cc=0x0,_0x2e8685=events[_0x0848('0x6')];_0x5ad1cc<_0x2e8685;_0x5ad1cc++){var _0x49bc2a=events[_0x5ad1cc];var _0x4616d9=createListener(_0x0848('0x7')+_0x49bc2a,_0x2cbb6c);VoiceQueueEvents['on'](_0x49bc2a,_0x4616d9);}}; \ No newline at end of file +var _0xd50a=['save','update','removeListener','register','length','voiceQueue:'];(function(_0x7f43a6,_0x24c634){var _0x59174f=function(_0x2da70d){while(--_0x2da70d){_0x7f43a6['push'](_0x7f43a6['shift']());}};_0x59174f(++_0x24c634);}(_0xd50a,0x114));var _0xad50=function(_0x1df5eb,_0x473088){_0x1df5eb=_0x1df5eb-0x0;var _0x506f9e=_0xd50a[_0x1df5eb];return _0x506f9e;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xad50('0x0'),'remove',_0xad50('0x1')];function createListener(_0x3e04f5,_0x1b35b6){return function(_0x36f45f){_0x1b35b6['emit'](_0x3e04f5,_0x36f45f);};}function removeListener(_0x187f64,_0x22b6c9){return function(){VoiceQueueEvents[_0xad50('0x2')](_0x187f64,_0x22b6c9);};}exports[_0xad50('0x3')]=function(_0x2a0b04){for(var _0x41b181=0x0,_0x4a7e39=events[_0xad50('0x4')];_0x41b181<_0x4a7e39;_0x41b181++){var _0x459677=events[_0x41b181];var _0x131e37=createListener(_0xad50('0x5')+_0x459677,_0x2a0b04);VoiceQueueEvents['on'](_0x459677,_0x131e37);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 4421112..250d293 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 _0x4f88=['../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4f88,0x173));var _0x84f8=function(_0x319e2e,_0x2f727f){_0x319e2e=_0x319e2e-0x0;var _0x302524=_0x4f88[_0x319e2e];return _0x302524;};'use strict';var multer=require(_0x84f8('0x0'));var util=require(_0x84f8('0x1'));var path=require(_0x84f8('0x2'));var timeout=require(_0x84f8('0x3'));var express=require('express');var router=express[_0x84f8('0x4')]();var fs_extra=require(_0x84f8('0x5'));var auth=require(_0x84f8('0x6'));var interaction=require(_0x84f8('0x7'));var config=require('../../config/environment');var controller=require(_0x84f8('0x8'));router[_0x84f8('0x9')]('/',auth[_0x84f8('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x84f8('0xb')]);router[_0x84f8('0x9')](_0x84f8('0xc'),auth['isAuthenticated'](),controller[_0x84f8('0xd')]);router[_0x84f8('0x9')](_0x84f8('0xe'),auth[_0x84f8('0xa')](),controller['show']);router[_0x84f8('0xf')]('/',auth[_0x84f8('0xa')](),controller[_0x84f8('0x10')]);router['put']('/:id',auth[_0x84f8('0xa')](),controller[_0x84f8('0x11')]);router[_0x84f8('0x12')]('/:id',auth[_0x84f8('0xa')](),controller[_0x84f8('0x13')]);module[_0x84f8('0x14')]=router; \ No newline at end of file +var _0x0a66=['update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','/index','isAuthenticated','/:id','post','create','put'];(function(_0x57b248,_0x2d5053){var _0x3a55f5=function(_0x145403){while(--_0x145403){_0x57b248['push'](_0x57b248['shift']());}};_0x3a55f5(++_0x2d5053);}(_0x0a66,0x10c));var _0x60a6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0a66[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x60a6('0x0'));var util=require(_0x60a6('0x1'));var path=require(_0x60a6('0x2'));var timeout=require(_0x60a6('0x3'));var express=require(_0x60a6('0x4'));var router=express[_0x60a6('0x5')]();var fs_extra=require(_0x60a6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x60a6('0x7'));var config=require(_0x60a6('0x8'));var controller=require(_0x60a6('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x60a6('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x60a6('0xa')](_0x60a6('0xb'),auth[_0x60a6('0xc')](),controller['getVoiceQueuesReport']);router[_0x60a6('0xa')](_0x60a6('0xd'),auth[_0x60a6('0xc')](),controller['show']);router[_0x60a6('0xe')]('/',auth[_0x60a6('0xc')](),controller[_0x60a6('0xf')]);router[_0x60a6('0x10')](_0x60a6('0xd'),auth[_0x60a6('0xc')](),controller[_0x60a6('0x11')]);router['delete']('/:id',auth[_0x60a6('0xc')](),controller[_0x60a6('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index ecfb8ee..8bc07e8 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 _0xb70d=['queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue'];(function(_0x507500,_0x2173cf){var _0x26ee67=function(_0x383e24){while(--_0x383e24){_0x507500['push'](_0x507500['shift']());}};_0x26ee67(++_0x2173cf);}(_0xb70d,0x15e));var _0xdb70=function(_0x39079d,_0x2c0855){_0x39079d=_0x39079d-0x0;var _0x5589a7=_0xb70d[_0x39079d];return _0x5589a7;};'use strict';var Sequelize=require(_0xdb70('0x0'));var moment=require(_0xdb70('0x1'));module['exports']={'type':{'type':Sequelize[_0xdb70('0x2')]},'uniqueid':{'type':Sequelize[_0xdb70('0x2')]},'calleridnum':{'type':Sequelize[_0xdb70('0x2')]},'calleridname':{'type':Sequelize[_0xdb70('0x2')]},'queue':{'type':Sequelize[_0xdb70('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xdb70('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xdb70('0x3')],'set':function(_0x1b46c6){var _0x221cfb=moment(_0x1b46c6);var _0x5fed8d=moment(this[_0xdb70('0x4')](_0xdb70('0x5')))[_0xdb70('0x6')](_0xdb70('0x7'));var _0x3dee01=_0x221cfb['diff'](_0x5fed8d,_0xdb70('0x8'));this[_0xdb70('0x9')](_0xdb70('0xa'),_0x1b46c6);this[_0xdb70('0x9')](_0xdb70('0xb'),_0x3dee01||null);}},'position':{'type':Sequelize[_0xdb70('0xc')]},'count':{'type':Sequelize[_0xdb70('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xdb70('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xdb70('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xdb70('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xdb70('0x2')],'comment':_0xdb70('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xdb70('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdb70('0x2')]},'connectedlinename':{'type':Sequelize[_0xdb70('0x2')]},'accountcode':{'type':Sequelize[_0xdb70('0x2')]},'context':{'type':Sequelize[_0xdb70('0x2')]},'exten':{'type':Sequelize[_0xdb70('0x2')]},'priority':{'type':Sequelize[_0xdb70('0x2')]},'holdtime':{'type':Sequelize[_0xdb70('0xc')]},'mohtime':{'type':Sequelize[_0xdb70('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xdb70('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xdb70('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xdb70('0x2')]},'thirdDisposition':{'type':Sequelize[_0xdb70('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6bfb=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN'];(function(_0x579fae,_0x3cea14){var _0x29d0ef=function(_0x269d10){while(--_0x269d10){_0x579fae['push'](_0x579fae['shift']());}};_0x29d0ef(++_0x3cea14);}(_0x6bfb,0x82));var _0xb6bf=function(_0x662597,_0x29b293){_0x662597=_0x662597-0x0;var _0x25d4f9=_0x6bfb[_0x662597];return _0x25d4f9;};'use strict';var Sequelize=require(_0xb6bf('0x0'));var moment=require('moment');module[_0xb6bf('0x1')]={'type':{'type':Sequelize[_0xb6bf('0x2')]},'uniqueid':{'type':Sequelize[_0xb6bf('0x2')]},'calleridnum':{'type':Sequelize[_0xb6bf('0x2')]},'calleridname':{'type':Sequelize[_0xb6bf('0x2')]},'queue':{'type':Sequelize[_0xb6bf('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xb6bf('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xb6bf('0x3')],'set':function(_0x52e8fa){var _0x47445c=moment(_0x52e8fa);var _0x5decfa=moment(this['getDataValue'](_0xb6bf('0x4')))[_0xb6bf('0x5')](_0xb6bf('0x6'));var _0x7097c7=_0x47445c[_0xb6bf('0x7')](_0x5decfa,_0xb6bf('0x8'));this[_0xb6bf('0x9')](_0xb6bf('0xa'),_0x52e8fa);this['setDataValue'](_0xb6bf('0xb'),_0x7097c7||null);}},'position':{'type':Sequelize[_0xb6bf('0xc')]},'count':{'type':Sequelize[_0xb6bf('0xc')]},'queuecallerabandon':{'type':Sequelize[_0xb6bf('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xb6bf('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xb6bf('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xb6bf('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xb6bf('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xb6bf('0x2')]},'connectedlinenum':{'type':Sequelize[_0xb6bf('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xb6bf('0x2')]},'priority':{'type':Sequelize[_0xb6bf('0x2')]},'holdtime':{'type':Sequelize[_0xb6bf('0xc')]},'mohtime':{'type':Sequelize[_0xb6bf('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb6bf('0x2')],'comment':_0xb6bf('0xf')},'transferexten':{'type':Sequelize[_0xb6bf('0x2')]},'transferuniqueid':{'type':Sequelize[_0xb6bf('0x2')]},'disposition':{'type':Sequelize[_0xb6bf('0x2')]},'secondDisposition':{'type':Sequelize[_0xb6bf('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb6bf('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xb6bf('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0xb6bf('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index a71d18f..66eeb6e 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 _0x79f1=['ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','then','error','stack','name','send','index','map','VoiceQueueReport','fieldName','type','key','model','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','fields','include','find','create','update','body','destroy','describe','getVoiceQueuesReport','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util'];(function(_0x469daa,_0x458227){var _0x1e5464=function(_0x2aa04e){while(--_0x2aa04e){_0x469daa['push'](_0x469daa['shift']());}};_0x1e5464(++_0x458227);}(_0x79f1,0x1d3));var _0x179f=function(_0x3c424f,_0x1c61c2){_0x3c424f=_0x3c424f-0x0;var _0x3fee82=_0x79f1[_0x3c424f];return _0x3fee82;};'use strict';var emlformat=require(_0x179f('0x0'));var rimraf=require(_0x179f('0x1'));var zipdir=require(_0x179f('0x2'));var jsonpatch=require(_0x179f('0x3'));var rp=require(_0x179f('0x4'));var moment=require('moment');var BPromise=require(_0x179f('0x5'));var Mustache=require('mustache');var util=require(_0x179f('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x179f('0x7'));var fs=require('fs');var fs_extra=require(_0x179f('0x8'));var _=require('lodash');var squel=require(_0x179f('0x9'));var crypto=require(_0x179f('0xa'));var jsforce=require(_0x179f('0xb'));var deskjs=require(_0x179f('0xc'));var toCsv=require(_0x179f('0xd'));var querystring=require('querystring');var Papa=require(_0x179f('0xe'));var Redis=require(_0x179f('0xf'));var authService=require(_0x179f('0x10'));var qs=require(_0x179f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x179f('0x12'));var logger=require('../../config/logger')(_0x179f('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x179f('0x14'));var db=require('../../mysqldb')['db'];config[_0x179f('0x15')]=_['defaults'](config[_0x179f('0x15')],{'host':_0x179f('0x16'),'port':0x18eb});var socket=require(_0x179f('0x17'))(new Redis(config[_0x179f('0x15')]));require(_0x179f('0x18'))[_0x179f('0x19')](socket);function respondWithStatusCode(_0x3c00fa,_0x35d785){_0x35d785=_0x35d785||0xcc;return function(_0x22e5e3){if(_0x22e5e3){return _0x3c00fa[_0x179f('0x1a')](_0x35d785);}return _0x3c00fa[_0x179f('0x1b')](_0x35d785)[_0x179f('0x1c')]();};}function respondWithResult(_0x41a13d,_0x2ef2cb){_0x2ef2cb=_0x2ef2cb||0xc8;return function(_0x29a95f){if(_0x29a95f){return _0x41a13d[_0x179f('0x1b')](_0x2ef2cb)['json'](_0x29a95f);}};}function respondWithFilteredResult(_0x3c8db3,_0x3ac514){return function(_0x408e7a){if(_0x408e7a){var _0x3f7275=typeof _0x3ac514['offset']===_0x179f('0x1d')&&typeof _0x3ac514[_0x179f('0x1e')]===_0x179f('0x1d');var _0x2f3271=_0x408e7a[_0x179f('0x1f')];var _0x44db84=_0x3f7275?0x0:_0x3ac514[_0x179f('0x20')];var _0x1561c8=_0x3f7275?_0x408e7a[_0x179f('0x1f')]:_0x3ac514[_0x179f('0x20')]+_0x3ac514[_0x179f('0x1e')];var _0x371579;if(_0x1561c8>=_0x2f3271){_0x1561c8=_0x2f3271;_0x371579=0xc8;}else{_0x371579=0xce;}_0x3c8db3[_0x179f('0x1b')](_0x371579);return _0x3c8db3[_0x179f('0x21')]('Content-Range',_0x44db84+'-'+_0x1561c8+'/'+_0x2f3271)[_0x179f('0x22')](_0x408e7a);}return null;};}function patchUpdates(_0x4359d6){return function(_0x1cfe7f){try{jsonpatch[_0x179f('0x23')](_0x1cfe7f,_0x4359d6,!![]);}catch(_0x2fba4a){return BPromise['reject'](_0x2fba4a);}return _0x1cfe7f[_0x179f('0x24')]();};}function saveUpdates(_0x5cd265,_0x4b0d0a){return function(_0x5bbfa1){if(_0x5bbfa1){return _0x5bbfa1['update'](_0x5cd265)[_0x179f('0x25')](function(_0x1f0bd7){return _0x1f0bd7;});}return null;};}function removeEntity(_0x262f52,_0x4275dd){return function(_0x2c835a){if(_0x2c835a){return _0x2c835a['destroy']()[_0x179f('0x25')](function(){_0x262f52[_0x179f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x576fb9,_0x254cfa){return function(_0x5968eb){if(!_0x5968eb){_0x576fb9[_0x179f('0x1a')](0x194);}return _0x5968eb;};}function handleError(_0x570bf8,_0x5885fb){_0x5885fb=_0x5885fb||0x1f4;return function(_0x2a7743){logger[_0x179f('0x26')](_0x2a7743[_0x179f('0x27')]);if(_0x2a7743['name']){delete _0x2a7743[_0x179f('0x28')];}_0x570bf8['status'](_0x5885fb)[_0x179f('0x29')](_0x2a7743);};}exports[_0x179f('0x2a')]=function(_0x57c7d9,_0x27e692){var _0x170d85={},_0x74f870={},_0x5dd9fe={'count':0x0,'rows':[]};var _0x323d17=_[_0x179f('0x2b')](db[_0x179f('0x2c')]['rawAttributes'],function(_0x4f04f6){return{'name':_0x4f04f6[_0x179f('0x2d')],'type':_0x4f04f6[_0x179f('0x2e')][_0x179f('0x2f')]};});_0x74f870[_0x179f('0x30')]=_[_0x179f('0x2b')](_0x323d17,_0x179f('0x28'));_0x74f870[_0x179f('0x31')]=_['keys'](_0x57c7d9[_0x179f('0x31')]);_0x74f870[_0x179f('0x32')]=_[_0x179f('0x33')](_0x74f870['model'],_0x74f870[_0x179f('0x31')]);_0x170d85[_0x179f('0x34')]=_[_0x179f('0x33')](_0x74f870[_0x179f('0x30')],qs['fields'](_0x57c7d9[_0x179f('0x31')]['fields']));_0x170d85[_0x179f('0x34')]=_0x170d85[_0x179f('0x34')][_0x179f('0x35')]?_0x170d85['attributes']:_0x74f870['model'];if(!_0x57c7d9['query']['hasOwnProperty'](_0x179f('0x36'))){_0x170d85[_0x179f('0x1e')]=qs[_0x179f('0x1e')](_0x57c7d9['query'][_0x179f('0x1e')]);_0x170d85[_0x179f('0x20')]=qs[_0x179f('0x20')](_0x57c7d9['query'][_0x179f('0x20')]);}_0x170d85[_0x179f('0x37')]=qs[_0x179f('0x38')](_0x57c7d9[_0x179f('0x31')][_0x179f('0x38')]);_0x170d85[_0x179f('0x39')]=qs[_0x179f('0x32')](_[_0x179f('0x3a')](_0x57c7d9['query'],_0x74f870[_0x179f('0x32')]),_0x323d17);if(_0x57c7d9['query'][_0x179f('0x3b')]){_0x170d85[_0x179f('0x39')]=_[_0x179f('0x3c')](_0x170d85[_0x179f('0x39')],{'$or':_[_0x179f('0x2b')](_0x323d17,function(_0x5dabd3){if(_0x5dabd3[_0x179f('0x2e')]!==_0x179f('0x3d')){var _0x4b9f59={};_0x4b9f59[_0x5dabd3[_0x179f('0x28')]]={'$like':'%'+_0x57c7d9['query'][_0x179f('0x3b')]+'%'};return _0x4b9f59;}})});}_0x170d85=_[_0x179f('0x3c')]({},_0x170d85,_0x57c7d9[_0x179f('0x3e')]);var _0x1dbe36={'where':_0x170d85[_0x179f('0x39')]};return db['VoiceQueueReport'][_0x179f('0x1f')](_0x1dbe36)[_0x179f('0x25')](function(_0x1e5b08){_0x5dd9fe[_0x179f('0x1f')]=_0x1e5b08;if(_0x57c7d9[_0x179f('0x31')]['includeAll']){_0x170d85['include']=[{'all':!![]}];}return db[_0x179f('0x2c')][_0x179f('0x3f')](_0x170d85);})['then'](function(_0x2d4f4c){_0x5dd9fe[_0x179f('0x40')]=_0x2d4f4c;return _0x5dd9fe;})[_0x179f('0x25')](respondWithFilteredResult(_0x27e692,_0x170d85))[_0x179f('0x41')](handleError(_0x27e692,null));};exports[_0x179f('0x42')]=function(_0x5b5733,_0xeb92e6){var _0x362f78={'raw':![],'where':{'id':_0x5b5733[_0x179f('0x43')]['id']}},_0x11d259={};_0x11d259['model']=_[_0x179f('0x44')](db[_0x179f('0x2c')]['rawAttributes']);_0x11d259[_0x179f('0x31')]=_[_0x179f('0x44')](_0x5b5733[_0x179f('0x31')]);_0x11d259[_0x179f('0x32')]=_[_0x179f('0x33')](_0x11d259[_0x179f('0x30')],_0x11d259[_0x179f('0x31')]);_0x362f78[_0x179f('0x34')]=_[_0x179f('0x33')](_0x11d259[_0x179f('0x30')],qs[_0x179f('0x45')](_0x5b5733[_0x179f('0x31')]['fields']));_0x362f78[_0x179f('0x34')]=_0x362f78[_0x179f('0x34')][_0x179f('0x35')]?_0x362f78[_0x179f('0x34')]:_0x11d259['model'];if(_0x5b5733[_0x179f('0x31')]['includeAll']){_0x362f78[_0x179f('0x46')]=[{'all':!![]}];}_0x362f78=_[_0x179f('0x3c')]({},_0x362f78,_0x5b5733[_0x179f('0x3e')]);return db['VoiceQueueReport'][_0x179f('0x47')](_0x362f78)[_0x179f('0x25')](handleEntityNotFound(_0xeb92e6,null))[_0x179f('0x25')](respondWithResult(_0xeb92e6,null))['catch'](handleError(_0xeb92e6,null));};exports[_0x179f('0x48')]=function(_0xb49357,_0x33481f){return db[_0x179f('0x2c')]['create'](_0xb49357['body'],{})[_0x179f('0x25')](respondWithResult(_0x33481f,0xc9))[_0x179f('0x41')](handleError(_0x33481f,null));};exports[_0x179f('0x49')]=function(_0x1d764e,_0x5d069f){if(_0x1d764e[_0x179f('0x4a')]['id']){delete _0x1d764e['body']['id'];}return db[_0x179f('0x2c')][_0x179f('0x47')]({'where':{'id':_0x1d764e['params']['id']}})[_0x179f('0x25')](handleEntityNotFound(_0x5d069f,null))[_0x179f('0x25')](saveUpdates(_0x1d764e[_0x179f('0x4a')],null))[_0x179f('0x25')](respondWithResult(_0x5d069f,null))[_0x179f('0x41')](handleError(_0x5d069f,null));};exports[_0x179f('0x4b')]=function(_0x1f0c36,_0x26d79d){return db[_0x179f('0x2c')][_0x179f('0x47')]({'where':{'id':_0x1f0c36[_0x179f('0x43')]['id']}})[_0x179f('0x25')](handleEntityNotFound(_0x26d79d,null))[_0x179f('0x25')](removeEntity(_0x26d79d,null))[_0x179f('0x41')](handleError(_0x26d79d,null));};exports[_0x179f('0x4c')]=function(_0x50a9a6,_0x5df77e){return db[_0x179f('0x2c')][_0x179f('0x4c')]()['then'](respondWithResult(_0x5df77e,null))[_0x179f('0x41')](handleError(_0x5df77e,null));};exports[_0x179f('0x4d')]=function(_0x1fb77e,_0x1ce724){var _0x2f1db5={},_0x3862c5={},_0x496b23={'count':0x0,'rows':[]};_0x3862c5[_0x179f('0x30')]=_['keys'](db['VoiceQueueReport']['rawAttributes']);_0x3862c5[_0x179f('0x31')]=_[_0x179f('0x44')](_0x1fb77e['query']);_0x3862c5['filters']=_['intersection'](_0x3862c5[_0x179f('0x30')],_0x3862c5[_0x179f('0x31')]);_0x2f1db5[_0x179f('0x34')]=_[_0x179f('0x33')](_0x3862c5[_0x179f('0x30')],qs[_0x179f('0x45')](_0x1fb77e[_0x179f('0x31')][_0x179f('0x45')]));_0x2f1db5['attributes']=_0x2f1db5[_0x179f('0x34')][_0x179f('0x35')]?_0x2f1db5['attributes']:_0x3862c5[_0x179f('0x30')];if(!_0x1fb77e['query'][_0x179f('0x4e')](_0x179f('0x36'))){_0x2f1db5['limit']=qs[_0x179f('0x1e')](_0x1fb77e['query']['limit']);_0x2f1db5['offset']=qs[_0x179f('0x20')](_0x1fb77e[_0x179f('0x31')][_0x179f('0x20')]);}_0x2f1db5[_0x179f('0x37')]=qs[_0x179f('0x38')](_0x1fb77e['query']['sort']);_0x2f1db5[_0x179f('0x39')]=qs['filters'](_[_0x179f('0x3a')](_0x1fb77e[_0x179f('0x31')],_0x3862c5[_0x179f('0x32')]));if(_0x1fb77e['query'][_0x179f('0x3b')]){_0x2f1db5[_0x179f('0x39')]=_[_0x179f('0x3c')](_0x2f1db5['where'],{'$or':_[_0x179f('0x2b')](_0x2f1db5[_0x179f('0x34')],function(_0x94899){var _0x380136={};_0x380136[_0x94899]={'$like':'%'+_0x1fb77e[_0x179f('0x31')][_0x179f('0x3b')]+'%'};return _0x380136;})});}_0x2f1db5=_[_0x179f('0x3c')]({},_0x2f1db5,_0x1fb77e[_0x179f('0x3e')]);var _0x1ef1ed={'where':_0x2f1db5['where']};return db['VoiceQueueReport'][_0x179f('0x1f')](_0x1ef1ed)[_0x179f('0x25')](function(_0x365193){_0x496b23[_0x179f('0x1f')]=_0x365193;if(_0x1fb77e[_0x179f('0x31')]['includeAll']){_0x2f1db5[_0x179f('0x46')]=[{'all':!![]}];}return db[_0x179f('0x2c')][_0x179f('0x3f')](_0x2f1db5);})[_0x179f('0x25')](function(_0x3aa962){_0x496b23[_0x179f('0x40')]=_0x3aa962;return _0x496b23;})[_0x179f('0x25')](respondWithFilteredResult(_0x1ce724,_0x2f1db5,_0x179f('0x4d')))[_0x179f('0x41')](handleError(_0x1ce724,null,_0x179f('0x4d')));}; \ No newline at end of file +var _0x94d6=['key','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','params','model','options','find','create','body','describe','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','map','VoiceQueueReport','rawAttributes','type'];(function(_0x3f4c67,_0x1a5f87){var _0x5c3777=function(_0x5b9906){while(--_0x5b9906){_0x3f4c67['push'](_0x3f4c67['shift']());}};_0x5c3777(++_0x1a5f87);}(_0x94d6,0x1f0));var _0x694d=function(_0x510e78,_0x5d69c5){_0x510e78=_0x510e78-0x0;var _0x20eff7=_0x94d6[_0x510e78];return _0x20eff7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x694d('0x0'));var zipdir=require(_0x694d('0x1'));var jsonpatch=require(_0x694d('0x2'));var rp=require(_0x694d('0x3'));var moment=require(_0x694d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x694d('0x5'));var util=require(_0x694d('0x6'));var path=require(_0x694d('0x7'));var sox=require(_0x694d('0x8'));var csv=require(_0x694d('0x9'));var ejs=require(_0x694d('0xa'));var fs=require('fs');var fs_extra=require(_0x694d('0xb'));var _=require(_0x694d('0xc'));var squel=require('squel');var crypto=require(_0x694d('0xd'));var jsforce=require(_0x694d('0xe'));var deskjs=require(_0x694d('0xf'));var toCsv=require(_0x694d('0x9'));var querystring=require(_0x694d('0x10'));var Papa=require(_0x694d('0x11'));var Redis=require(_0x694d('0x12'));var authService=require(_0x694d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x694d('0x14'));var logger=require(_0x694d('0x15'))(_0x694d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x694d('0x17'));var db=require(_0x694d('0x18'))['db'];config[_0x694d('0x19')]=_[_0x694d('0x1a')](config[_0x694d('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x694d('0x1b'))(new Redis(config['redis']));require(_0x694d('0x1c'))[_0x694d('0x1d')](socket);function respondWithStatusCode(_0x2d92a9,_0x6147aa){_0x6147aa=_0x6147aa||0xcc;return function(_0x1611e9){if(_0x1611e9){return _0x2d92a9[_0x694d('0x1e')](_0x6147aa);}return _0x2d92a9[_0x694d('0x1f')](_0x6147aa)[_0x694d('0x20')]();};}function respondWithResult(_0x559c6e,_0x15895f){_0x15895f=_0x15895f||0xc8;return function(_0x534a26){if(_0x534a26){return _0x559c6e['status'](_0x15895f)[_0x694d('0x21')](_0x534a26);}};}function respondWithFilteredResult(_0x48f5f0,_0x213fa9){return function(_0x30a84d){if(_0x30a84d){var _0x233ad3=typeof _0x213fa9[_0x694d('0x22')]===_0x694d('0x23')&&typeof _0x213fa9[_0x694d('0x24')]===_0x694d('0x23');var _0x349c55=_0x30a84d[_0x694d('0x25')];var _0x170eec=_0x233ad3?0x0:_0x213fa9[_0x694d('0x22')];var _0x4ed3b0=_0x233ad3?_0x30a84d[_0x694d('0x25')]:_0x213fa9['offset']+_0x213fa9[_0x694d('0x24')];var _0x49f9bc;if(_0x4ed3b0>=_0x349c55){_0x4ed3b0=_0x349c55;_0x49f9bc=0xc8;}else{_0x49f9bc=0xce;}_0x48f5f0[_0x694d('0x1f')](_0x49f9bc);return _0x48f5f0[_0x694d('0x26')](_0x694d('0x27'),_0x170eec+'-'+_0x4ed3b0+'/'+_0x349c55)['json'](_0x30a84d);}return null;};}function patchUpdates(_0xdb835e){return function(_0x4110fa){try{jsonpatch[_0x694d('0x28')](_0x4110fa,_0xdb835e,!![]);}catch(_0x30926a){return BPromise['reject'](_0x30926a);}return _0x4110fa['save']();};}function saveUpdates(_0x786650,_0x4742f9){return function(_0xdf07e0){if(_0xdf07e0){return _0xdf07e0[_0x694d('0x29')](_0x786650)[_0x694d('0x2a')](function(_0x46b81d){return _0x46b81d;});}return null;};}function removeEntity(_0x277b41,_0x1e729c){return function(_0x4ccac4){if(_0x4ccac4){return _0x4ccac4[_0x694d('0x2b')]()[_0x694d('0x2a')](function(){_0x277b41[_0x694d('0x1f')](0xcc)[_0x694d('0x20')]();});}};}function handleEntityNotFound(_0x3ba266,_0x286b92){return function(_0x2eab28){if(!_0x2eab28){_0x3ba266[_0x694d('0x1e')](0x194);}return _0x2eab28;};}function handleError(_0x20aeef,_0x3eb1f4){_0x3eb1f4=_0x3eb1f4||0x1f4;return function(_0x4323b0){logger['error'](_0x4323b0[_0x694d('0x2c')]);if(_0x4323b0[_0x694d('0x2d')]){delete _0x4323b0['name'];}_0x20aeef[_0x694d('0x1f')](_0x3eb1f4)['send'](_0x4323b0);};}exports['index']=function(_0x5aea9e,_0x704717){var _0x3cb595={},_0x29c106={},_0xd89248={'count':0x0,'rows':[]};var _0x16b563=_[_0x694d('0x2e')](db[_0x694d('0x2f')][_0x694d('0x30')],function(_0x36a580){return{'name':_0x36a580['fieldName'],'type':_0x36a580[_0x694d('0x31')][_0x694d('0x32')]};});_0x29c106['model']=_[_0x694d('0x2e')](_0x16b563,_0x694d('0x2d'));_0x29c106['query']=_[_0x694d('0x33')](_0x5aea9e[_0x694d('0x34')]);_0x29c106[_0x694d('0x35')]=_['intersection'](_0x29c106['model'],_0x29c106[_0x694d('0x34')]);_0x3cb595[_0x694d('0x36')]=_[_0x694d('0x37')](_0x29c106['model'],qs['fields'](_0x5aea9e['query'][_0x694d('0x38')]));_0x3cb595[_0x694d('0x36')]=_0x3cb595[_0x694d('0x36')][_0x694d('0x39')]?_0x3cb595[_0x694d('0x36')]:_0x29c106['model'];if(!_0x5aea9e[_0x694d('0x34')][_0x694d('0x3a')](_0x694d('0x3b'))){_0x3cb595[_0x694d('0x24')]=qs[_0x694d('0x24')](_0x5aea9e[_0x694d('0x34')][_0x694d('0x24')]);_0x3cb595[_0x694d('0x22')]=qs[_0x694d('0x22')](_0x5aea9e[_0x694d('0x34')][_0x694d('0x22')]);}_0x3cb595[_0x694d('0x3c')]=qs[_0x694d('0x3d')](_0x5aea9e[_0x694d('0x34')]['sort']);_0x3cb595['where']=qs['filters'](_['pick'](_0x5aea9e[_0x694d('0x34')],_0x29c106['filters']),_0x16b563);if(_0x5aea9e[_0x694d('0x34')]['filter']){_0x3cb595[_0x694d('0x3e')]=_[_0x694d('0x3f')](_0x3cb595[_0x694d('0x3e')],{'$or':_['map'](_0x16b563,function(_0x309997){if(_0x309997[_0x694d('0x31')]!==_0x694d('0x40')){var _0x965840={};_0x965840[_0x309997[_0x694d('0x2d')]]={'$like':'%'+_0x5aea9e[_0x694d('0x34')][_0x694d('0x41')]+'%'};return _0x965840;}})});}_0x3cb595=_[_0x694d('0x3f')]({},_0x3cb595,_0x5aea9e['options']);var _0x5586a7={'where':_0x3cb595[_0x694d('0x3e')]};return db[_0x694d('0x2f')]['count'](_0x5586a7)[_0x694d('0x2a')](function(_0x2e0ef6){_0xd89248[_0x694d('0x25')]=_0x2e0ef6;if(_0x5aea9e[_0x694d('0x34')][_0x694d('0x42')]){_0x3cb595[_0x694d('0x43')]=[{'all':!![]}];}return db[_0x694d('0x2f')]['findAll'](_0x3cb595);})[_0x694d('0x2a')](function(_0x461f4a){_0xd89248[_0x694d('0x44')]=_0x461f4a;return _0xd89248;})[_0x694d('0x2a')](respondWithFilteredResult(_0x704717,_0x3cb595))[_0x694d('0x45')](handleError(_0x704717,null));};exports['show']=function(_0x283c4e,_0x143869){var _0x5b3c5c={'raw':![],'where':{'id':_0x283c4e[_0x694d('0x46')]['id']}},_0x45b981={};_0x45b981[_0x694d('0x47')]=_['keys'](db[_0x694d('0x2f')][_0x694d('0x30')]);_0x45b981[_0x694d('0x34')]=_[_0x694d('0x33')](_0x283c4e[_0x694d('0x34')]);_0x45b981['filters']=_[_0x694d('0x37')](_0x45b981[_0x694d('0x47')],_0x45b981['query']);_0x5b3c5c['attributes']=_['intersection'](_0x45b981[_0x694d('0x47')],qs[_0x694d('0x38')](_0x283c4e[_0x694d('0x34')]['fields']));_0x5b3c5c[_0x694d('0x36')]=_0x5b3c5c[_0x694d('0x36')][_0x694d('0x39')]?_0x5b3c5c['attributes']:_0x45b981[_0x694d('0x47')];if(_0x283c4e[_0x694d('0x34')][_0x694d('0x42')]){_0x5b3c5c[_0x694d('0x43')]=[{'all':!![]}];}_0x5b3c5c=_[_0x694d('0x3f')]({},_0x5b3c5c,_0x283c4e[_0x694d('0x48')]);return db['VoiceQueueReport'][_0x694d('0x49')](_0x5b3c5c)[_0x694d('0x2a')](handleEntityNotFound(_0x143869,null))['then'](respondWithResult(_0x143869,null))[_0x694d('0x45')](handleError(_0x143869,null));};exports[_0x694d('0x4a')]=function(_0x449774,_0x153ab4){return db['VoiceQueueReport'][_0x694d('0x4a')](_0x449774[_0x694d('0x4b')],{})['then'](respondWithResult(_0x153ab4,0xc9))['catch'](handleError(_0x153ab4,null));};exports['update']=function(_0xaf1a1f,_0xd7f118){if(_0xaf1a1f[_0x694d('0x4b')]['id']){delete _0xaf1a1f[_0x694d('0x4b')]['id'];}return db[_0x694d('0x2f')][_0x694d('0x49')]({'where':{'id':_0xaf1a1f[_0x694d('0x46')]['id']}})['then'](handleEntityNotFound(_0xd7f118,null))[_0x694d('0x2a')](saveUpdates(_0xaf1a1f['body'],null))['then'](respondWithResult(_0xd7f118,null))[_0x694d('0x45')](handleError(_0xd7f118,null));};exports[_0x694d('0x2b')]=function(_0x16c009,_0x46f9e1){return db[_0x694d('0x2f')][_0x694d('0x49')]({'where':{'id':_0x16c009[_0x694d('0x46')]['id']}})[_0x694d('0x2a')](handleEntityNotFound(_0x46f9e1,null))[_0x694d('0x2a')](removeEntity(_0x46f9e1,null))[_0x694d('0x45')](handleError(_0x46f9e1,null));};exports[_0x694d('0x4c')]=function(_0x54acb5,_0x95dac2){return db[_0x694d('0x2f')][_0x694d('0x4c')]()[_0x694d('0x2a')](respondWithResult(_0x95dac2,null))[_0x694d('0x45')](handleError(_0x95dac2,null));};exports[_0x694d('0x4d')]=function(_0x2c6370,_0x510827){var _0x1f8adb={},_0x481285={},_0x2abfcf={'count':0x0,'rows':[]};_0x481285[_0x694d('0x47')]=_[_0x694d('0x33')](db[_0x694d('0x2f')][_0x694d('0x30')]);_0x481285['query']=_['keys'](_0x2c6370[_0x694d('0x34')]);_0x481285[_0x694d('0x35')]=_[_0x694d('0x37')](_0x481285['model'],_0x481285[_0x694d('0x34')]);_0x1f8adb['attributes']=_[_0x694d('0x37')](_0x481285[_0x694d('0x47')],qs[_0x694d('0x38')](_0x2c6370[_0x694d('0x34')]['fields']));_0x1f8adb[_0x694d('0x36')]=_0x1f8adb[_0x694d('0x36')]['length']?_0x1f8adb[_0x694d('0x36')]:_0x481285[_0x694d('0x47')];if(!_0x2c6370[_0x694d('0x34')][_0x694d('0x3a')](_0x694d('0x3b'))){_0x1f8adb['limit']=qs['limit'](_0x2c6370[_0x694d('0x34')][_0x694d('0x24')]);_0x1f8adb[_0x694d('0x22')]=qs[_0x694d('0x22')](_0x2c6370[_0x694d('0x34')]['offset']);}_0x1f8adb['order']=qs[_0x694d('0x3d')](_0x2c6370[_0x694d('0x34')][_0x694d('0x3d')]);_0x1f8adb[_0x694d('0x3e')]=qs[_0x694d('0x35')](_['pick'](_0x2c6370[_0x694d('0x34')],_0x481285[_0x694d('0x35')]));if(_0x2c6370['query'][_0x694d('0x41')]){_0x1f8adb[_0x694d('0x3e')]=_[_0x694d('0x3f')](_0x1f8adb[_0x694d('0x3e')],{'$or':_['map'](_0x1f8adb[_0x694d('0x36')],function(_0x33c012){var _0x2c737f={};_0x2c737f[_0x33c012]={'$like':'%'+_0x2c6370[_0x694d('0x34')][_0x694d('0x41')]+'%'};return _0x2c737f;})});}_0x1f8adb=_[_0x694d('0x3f')]({},_0x1f8adb,_0x2c6370[_0x694d('0x48')]);var _0xa18bc8={'where':_0x1f8adb[_0x694d('0x3e')]};return db['VoiceQueueReport'][_0x694d('0x25')](_0xa18bc8)[_0x694d('0x2a')](function(_0x587731){_0x2abfcf[_0x694d('0x25')]=_0x587731;if(_0x2c6370['query']['includeAll']){_0x1f8adb['include']=[{'all':!![]}];}return db[_0x694d('0x2f')]['findAll'](_0x1f8adb);})[_0x694d('0x2a')](function(_0x2fcd45){_0x2abfcf['rows']=_0x2fcd45;return _0x2abfcf;})[_0x694d('0x2a')](respondWithFilteredResult(_0x510827,_0x1f8adb,_0x694d('0x4d')))[_0x694d('0x45')](handleError(_0x510827,null,_0x694d('0x4d')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index a2221f6..9be3a03 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 _0x06fe=['save','update','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x4ae416,_0x285138){var _0x110d6a=function(_0x5ee008){while(--_0x5ee008){_0x4ae416['push'](_0x4ae416['shift']());}};_0x110d6a(++_0x285138);}(_0x06fe,0x146));var _0xe06f=function(_0xc81f5f,_0x181205){_0xc81f5f=_0xc81f5f-0x0;var _0x4410dc=_0x06fe[_0xc81f5f];return _0x4410dc;};'use strict';var EventEmitter=require(_0xe06f('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xe06f('0x1')](0x0);var events={'afterCreate':_0xe06f('0x2'),'afterUpdate':_0xe06f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x172eae){return function(_0x4b3767,_0x4ffc5a,_0x4764aa){VoiceQueueReportEvents[_0xe06f('0x4')](_0x172eae+':'+_0x4b3767['id'],_0x4b3767);VoiceQueueReportEvents['emit'](_0x172eae,_0x4b3767);_0x4764aa(null);};}for(var e in events){if(events[_0xe06f('0x5')](e)){var event=events[e];VoiceQueueReport[_0xe06f('0x6')](e,emitEvent(event));}}module[_0xe06f('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x2d60=['emit','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','update'];(function(_0x31f50c,_0x352037){var _0x444e35=function(_0x20d0d1){while(--_0x20d0d1){_0x31f50c['push'](_0x31f50c['shift']());}};_0x444e35(++_0x352037);}(_0x2d60,0x152));var _0x02d6=function(_0x346d99,_0x4b4159){_0x346d99=_0x346d99-0x0;var _0xed4fc=_0x2d60[_0x346d99];return _0xed4fc;};'use strict';var EventEmitter=require(_0x02d6('0x0'));var VoiceQueueReport=require(_0x02d6('0x1'))['db'][_0x02d6('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x02d6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x02d6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x14f1c9){return function(_0x4d79bb,_0x514a66,_0x5d080a){VoiceQueueReportEvents[_0x02d6('0x5')](_0x14f1c9+':'+_0x4d79bb['id'],_0x4d79bb);VoiceQueueReportEvents[_0x02d6('0x5')](_0x14f1c9,_0x4d79bb);_0x5d080a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x02d6('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 3d4d83b..b394f67 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 _0xd495=['rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x440bd5,_0x2b023c){var _0x231150=function(_0x3e56f3){while(--_0x3e56f3){_0x440bd5['push'](_0x440bd5['shift']());}};_0x231150(++_0x2b023c);}(_0xd495,0x1e9));var _0x5d49=function(_0x5cbd7b,_0x207439){_0x5cbd7b=_0x5cbd7b-0x0;var _0x3fdfb8=_0xd495[_0x5cbd7b];return _0x3fdfb8;};'use strict';var _=require(_0x5d49('0x0'));var util=require('util');var logger=require(_0x5d49('0x1'))(_0x5d49('0x2'));var moment=require(_0x5d49('0x3'));var BPromise=require(_0x5d49('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d49('0x5'));var rimraf=require(_0x5d49('0x6'));var config=require(_0x5d49('0x7'));var attributes=require(_0x5d49('0x8'));module[_0x5d49('0x9')]=function(_0x38357c,_0x337c96){return _0x38357c[_0x5d49('0xa')](_0x5d49('0xb'),attributes,{'tableName':_0x5d49('0xc'),'paranoid':![],'indexes':[{'fields':[_0x5d49('0xd')]},{'fields':[_0x5d49('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x366e=['define','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x1e8029,_0x2308a6){var _0x26bb15=function(_0xc1c790){while(--_0xc1c790){_0x1e8029['push'](_0x1e8029['shift']());}};_0x26bb15(++_0x2308a6);}(_0x366e,0x19a));var _0xe366=function(_0x3f55a9,_0x4f946c){_0x3f55a9=_0x3f55a9-0x0;var _0x14b097=_0x366e[_0x3f55a9];return _0x14b097;};'use strict';var _=require(_0xe366('0x0'));var util=require(_0xe366('0x1'));var logger=require(_0xe366('0x2'))(_0xe366('0x3'));var moment=require(_0xe366('0x4'));var BPromise=require(_0xe366('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe366('0x6'));var rimraf=require('rimraf');var config=require(_0xe366('0x7'));var attributes=require(_0xe366('0x8'));module[_0xe366('0x9')]=function(_0x1ea1e9,_0x56801d){return _0x1ea1e9[_0xe366('0xa')]('VoiceQueueReport',attributes,{'tableName':_0xe366('0xb'),'paranoid':![],'indexes':[{'fields':[_0xe366('0xc')]},{'fields':[_0xe366('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 c47730c..b7ef810 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 _0x75a6=['./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','options','raw','where','attributes','limit','map','include','model','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x317ae9,_0x2a7b3e){var _0xc2430b=function(_0x3c2652){while(--_0x3c2652){_0x317ae9['push'](_0x317ae9['shift']());}};_0xc2430b(++_0x2a7b3e);}(_0x75a6,0xd5));var _0x675a=function(_0x23ba3f,_0x421c0f){_0x23ba3f=_0x23ba3f-0x0;var _0xa5b4dd=_0x75a6[_0x23ba3f];return _0xa5b4dd;};'use strict';var _=require(_0x675a('0x0'));var util=require(_0x675a('0x1'));var moment=require(_0x675a('0x2'));var BPromise=require('bluebird');var rs=require(_0x675a('0x3'));var fs=require('fs');var Redis=require(_0x675a('0x4'));var db=require(_0x675a('0x5'))['db'];var utils=require(_0x675a('0x6'));var logger=require(_0x675a('0x7'))(_0x675a('0x8'));var config=require(_0x675a('0x9'));var jayson=require(_0x675a('0xa'));var client=jayson[_0x675a('0xb')][_0x675a('0xc')]({'port':0x232a});config['redis']=_[_0x675a('0xd')](config[_0x675a('0xe')],{'host':_0x675a('0xf'),'port':0x18eb});var socket=require(_0x675a('0x10'))(new Redis(config[_0x675a('0xe')]));require(_0x675a('0x11'))[_0x675a('0x12')](socket);function respondWithRpcPromise(_0x392207,_0x69bb7d,_0x16728b){return new BPromise(function(_0x3118ea,_0x4bad47){return client[_0x675a('0x13')](_0x392207,_0x16728b)[_0x675a('0x14')](function(_0x291852){logger[_0x675a('0x15')](_0x675a('0x16'),_0x69bb7d,_0x675a('0x17'));logger[_0x675a('0x18')](_0x675a('0x19'),_0x69bb7d,_0x675a('0x17'),JSON[_0x675a('0x1a')](_0x291852));if(_0x291852[_0x675a('0x1b')]){if(_0x291852[_0x675a('0x1b')][_0x675a('0x1c')]===0x1f4){logger[_0x675a('0x1b')](_0x675a('0x16'),_0x69bb7d,_0x291852[_0x675a('0x1b')][_0x675a('0x1d')]);return _0x4bad47(_0x291852[_0x675a('0x1b')][_0x675a('0x1d')]);}logger[_0x675a('0x1b')](_0x675a('0x16'),_0x69bb7d,_0x291852[_0x675a('0x1b')]['message']);return _0x3118ea(_0x291852['error'][_0x675a('0x1d')]);}else{logger[_0x675a('0x15')](_0x675a('0x16'),_0x69bb7d,_0x675a('0x17'));_0x3118ea(_0x291852[_0x675a('0x1e')][_0x675a('0x1d')]);}})[_0x675a('0x1f')](function(_0x3bd86f){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x69bb7d,_0x3bd86f);_0x4bad47(_0x3bd86f);});});}exports[_0x675a('0x20')]=function(_0x2e7c49){var _0x18eb83=this;return new Promise(function(_0x2c890a,_0x1afe81){return db['VoiceQueueReport']['findAll']({'raw':_0x2e7c49['options']?_0x2e7c49[_0x675a('0x21')][_0x675a('0x22')]===undefined?!![]:![]:!![],'where':_0x2e7c49[_0x675a('0x21')]?_0x2e7c49['options'][_0x675a('0x23')]||null:null,'attributes':_0x2e7c49[_0x675a('0x21')]?_0x2e7c49[_0x675a('0x21')][_0x675a('0x24')]||null:null,'limit':_0x2e7c49[_0x675a('0x21')]?_0x2e7c49[_0x675a('0x21')][_0x675a('0x25')]||null:null,'include':_0x2e7c49[_0x675a('0x21')]?_0x2e7c49[_0x675a('0x21')]['include']?_[_0x675a('0x26')](_0x2e7c49[_0x675a('0x21')][_0x675a('0x27')],function(_0x3cbe27){return{'model':db[_0x3cbe27[_0x675a('0x28')]],'as':_0x3cbe27['as'],'attributes':_0x3cbe27[_0x675a('0x24')],'include':_0x3cbe27[_0x675a('0x27')]?_['map'](_0x3cbe27[_0x675a('0x27')],function(_0x4730c4){return{'model':db[_0x4730c4[_0x675a('0x28')]],'as':_0x4730c4['as'],'attributes':_0x4730c4['attributes'],'include':_0x4730c4[_0x675a('0x27')]?_[_0x675a('0x26')](_0x4730c4[_0x675a('0x27')],function(_0x519b9e){return{'model':db[_0x519b9e[_0x675a('0x28')]],'as':_0x519b9e['as'],'attributes':_0x519b9e[_0x675a('0x24')]};}):[]};}):[]};}):[]:[]})[_0x675a('0x14')](function(_0x42bd53){logger['info'](_0x675a('0x20'),_0x2e7c49);logger[_0x675a('0x18')]('GetVoiceQueueReport',_0x2e7c49,JSON[_0x675a('0x1a')](_0x42bd53));_0x2c890a(_0x42bd53);})['catch'](function(_0x2c382b){logger['error'](_0x675a('0x20'),_0x2c382b[_0x675a('0x1d')],_0x2e7c49);_0x1afe81(_0x18eb83[_0x675a('0x1b')](0x1f4,_0x2c382b[_0x675a('0x1d')]));});});};exports[_0x675a('0x29')]=function(_0x515482){var _0x3dc5a8=this;return new Promise(function(_0xe81e7f,_0x439f98){return db[_0x675a('0x2a')][_0x675a('0x2b')](_0x515482[_0x675a('0x2c')],{'raw':_0x515482[_0x675a('0x21')]?_0x515482['options']['raw']===undefined?!![]:![]:!![]})[_0x675a('0x14')](function(_0x10617b){logger['info'](_0x675a('0x29'),_0x515482);logger[_0x675a('0x18')]('CreateVoiceQueueReport',_0x515482,JSON[_0x675a('0x1a')](_0x10617b));_0xe81e7f(_0x10617b);})[_0x675a('0x1f')](function(_0x3366e6){logger[_0x675a('0x1b')]('CreateVoiceQueueReport',_0x3366e6['message'],_0x515482);_0x439f98(_0x3dc5a8[_0x675a('0x1b')](0x1f4,_0x3366e6[_0x675a('0x1d')]));});});};exports['UpdateVoiceQueueReport']=function(_0x386dcf){var _0xfa1796=this;return new Promise(function(_0x230593,_0x491fe3){return db[_0x675a('0x2a')]['update'](_0x386dcf[_0x675a('0x2c')],{'raw':_0x386dcf[_0x675a('0x21')]?_0x386dcf['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x386dcf[_0x675a('0x21')]?_0x386dcf['options'][_0x675a('0x23')]||null:null,'attributes':_0x386dcf[_0x675a('0x21')]?_0x386dcf[_0x675a('0x21')][_0x675a('0x24')]||null:null,'limit':_0x386dcf[_0x675a('0x21')]?_0x386dcf[_0x675a('0x21')]['limit']||null:null})[_0x675a('0x14')](function(_0x350dd0){logger[_0x675a('0x15')](_0x675a('0x2d'),_0x386dcf);logger[_0x675a('0x18')]('UpdateVoiceQueueReport',_0x386dcf,JSON[_0x675a('0x1a')](_0x350dd0));_0x230593(_0x350dd0);})[_0x675a('0x1f')](function(_0x12dbaf){logger[_0x675a('0x1b')]('UpdateVoiceQueueReport',_0x12dbaf[_0x675a('0x1d')],_0x386dcf);_0x491fe3(_0xfa1796[_0x675a('0x1b')](0x1f4,_0x12dbaf['message']));});});}; \ No newline at end of file +var _0xe7a5=['request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','body','CreateVoiceQueueReport','update','UpdateVoiceQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s'];(function(_0x2bb3f6,_0x25fde0){var _0x62b339=function(_0x53e014){while(--_0x53e014){_0x2bb3f6['push'](_0x2bb3f6['shift']());}};_0x62b339(++_0x25fde0);}(_0xe7a5,0x103));var _0x5e7a=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xe7a5[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x5e7a('0x0'));var util=require('util');var moment=require(_0x5e7a('0x1'));var BPromise=require(_0x5e7a('0x2'));var rs=require(_0x5e7a('0x3'));var fs=require('fs');var Redis=require(_0x5e7a('0x4'));var db=require(_0x5e7a('0x5'))['db'];var utils=require(_0x5e7a('0x6'));var logger=require(_0x5e7a('0x7'))(_0x5e7a('0x8'));var config=require(_0x5e7a('0x9'));var jayson=require(_0x5e7a('0xa'));var client=jayson[_0x5e7a('0xb')][_0x5e7a('0xc')]({'port':0x232a});config[_0x5e7a('0xd')]=_[_0x5e7a('0xe')](config[_0x5e7a('0xd')],{'host':_0x5e7a('0xf'),'port':0x18eb});var socket=require(_0x5e7a('0x10'))(new Redis(config[_0x5e7a('0xd')]));require(_0x5e7a('0x11'))[_0x5e7a('0x12')](socket);function respondWithRpcPromise(_0x4ff3ab,_0x414cb7,_0x52ea19){return new BPromise(function(_0x2aa545,_0x31a42b){return client[_0x5e7a('0x13')](_0x4ff3ab,_0x52ea19)[_0x5e7a('0x14')](function(_0x2d7e95){logger[_0x5e7a('0x15')](_0x5e7a('0x16'),_0x414cb7,_0x5e7a('0x17'));logger[_0x5e7a('0x18')](_0x5e7a('0x19'),_0x414cb7,_0x5e7a('0x17'),JSON[_0x5e7a('0x1a')](_0x2d7e95));if(_0x2d7e95[_0x5e7a('0x1b')]){if(_0x2d7e95[_0x5e7a('0x1b')][_0x5e7a('0x1c')]===0x1f4){logger[_0x5e7a('0x1b')]('VoiceQueueReport,\x20%s,\x20%s',_0x414cb7,_0x2d7e95['error'][_0x5e7a('0x1d')]);return _0x31a42b(_0x2d7e95[_0x5e7a('0x1b')][_0x5e7a('0x1d')]);}logger[_0x5e7a('0x1b')](_0x5e7a('0x16'),_0x414cb7,_0x2d7e95[_0x5e7a('0x1b')][_0x5e7a('0x1d')]);return _0x2aa545(_0x2d7e95[_0x5e7a('0x1b')][_0x5e7a('0x1d')]);}else{logger['info'](_0x5e7a('0x16'),_0x414cb7,'request\x20sent');_0x2aa545(_0x2d7e95[_0x5e7a('0x1e')]['message']);}})[_0x5e7a('0x1f')](function(_0x52e948){logger[_0x5e7a('0x1b')]('VoiceQueueReport,\x20%s,\x20%s',_0x414cb7,_0x52e948);_0x31a42b(_0x52e948);});});}exports[_0x5e7a('0x20')]=function(_0x57e402){var _0x418b6f=this;return new Promise(function(_0x381497,_0xb27c4c){return db[_0x5e7a('0x21')][_0x5e7a('0x22')]({'raw':_0x57e402[_0x5e7a('0x23')]?_0x57e402[_0x5e7a('0x23')][_0x5e7a('0x24')]===undefined?!![]:![]:!![],'where':_0x57e402[_0x5e7a('0x23')]?_0x57e402[_0x5e7a('0x23')][_0x5e7a('0x25')]||null:null,'attributes':_0x57e402[_0x5e7a('0x23')]?_0x57e402[_0x5e7a('0x23')][_0x5e7a('0x26')]||null:null,'limit':_0x57e402[_0x5e7a('0x23')]?_0x57e402[_0x5e7a('0x23')][_0x5e7a('0x27')]||null:null,'include':_0x57e402['options']?_0x57e402['options'][_0x5e7a('0x28')]?_[_0x5e7a('0x29')](_0x57e402[_0x5e7a('0x23')][_0x5e7a('0x28')],function(_0x5eee92){return{'model':db[_0x5eee92[_0x5e7a('0x2a')]],'as':_0x5eee92['as'],'attributes':_0x5eee92[_0x5e7a('0x26')],'include':_0x5eee92['include']?_[_0x5e7a('0x29')](_0x5eee92[_0x5e7a('0x28')],function(_0x4ce331){return{'model':db[_0x4ce331['model']],'as':_0x4ce331['as'],'attributes':_0x4ce331[_0x5e7a('0x26')],'include':_0x4ce331[_0x5e7a('0x28')]?_[_0x5e7a('0x29')](_0x4ce331[_0x5e7a('0x28')],function(_0x462ac8){return{'model':db[_0x462ac8[_0x5e7a('0x2a')]],'as':_0x462ac8['as'],'attributes':_0x462ac8[_0x5e7a('0x26')]};}):[]};}):[]};}):[]:[]})[_0x5e7a('0x14')](function(_0x50d9ae){logger[_0x5e7a('0x15')]('GetVoiceQueueReport',_0x57e402);logger[_0x5e7a('0x18')](_0x5e7a('0x20'),_0x57e402,JSON[_0x5e7a('0x1a')](_0x50d9ae));_0x381497(_0x50d9ae);})[_0x5e7a('0x1f')](function(_0x47bfc7){logger[_0x5e7a('0x1b')](_0x5e7a('0x20'),_0x47bfc7[_0x5e7a('0x1d')],_0x57e402);_0xb27c4c(_0x418b6f[_0x5e7a('0x1b')](0x1f4,_0x47bfc7[_0x5e7a('0x1d')]));});});};exports['CreateVoiceQueueReport']=function(_0x339616){var _0x28d1cf=this;return new Promise(function(_0x3e9f5d,_0x58d62b){return db['VoiceQueueReport']['create'](_0x339616[_0x5e7a('0x2b')],{'raw':_0x339616['options']?_0x339616[_0x5e7a('0x23')][_0x5e7a('0x24')]===undefined?!![]:![]:!![]})[_0x5e7a('0x14')](function(_0x4f0cbe){logger[_0x5e7a('0x15')](_0x5e7a('0x2c'),_0x339616);logger['debug'](_0x5e7a('0x2c'),_0x339616,JSON[_0x5e7a('0x1a')](_0x4f0cbe));_0x3e9f5d(_0x4f0cbe);})['catch'](function(_0x14611f){logger[_0x5e7a('0x1b')](_0x5e7a('0x2c'),_0x14611f['message'],_0x339616);_0x58d62b(_0x28d1cf['error'](0x1f4,_0x14611f[_0x5e7a('0x1d')]));});});};exports['UpdateVoiceQueueReport']=function(_0x3cccd8){var _0x5366fb=this;return new Promise(function(_0x36215c,_0x51889c){return db[_0x5e7a('0x21')][_0x5e7a('0x2d')](_0x3cccd8[_0x5e7a('0x2b')],{'raw':_0x3cccd8[_0x5e7a('0x23')]?_0x3cccd8['options'][_0x5e7a('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cccd8['options']?_0x3cccd8[_0x5e7a('0x23')][_0x5e7a('0x25')]||null:null,'attributes':_0x3cccd8['options']?_0x3cccd8[_0x5e7a('0x23')][_0x5e7a('0x26')]||null:null,'limit':_0x3cccd8[_0x5e7a('0x23')]?_0x3cccd8['options'][_0x5e7a('0x27')]||null:null})[_0x5e7a('0x14')](function(_0xabbffb){logger[_0x5e7a('0x15')](_0x5e7a('0x2e'),_0x3cccd8);logger[_0x5e7a('0x18')]('UpdateVoiceQueueReport',_0x3cccd8,JSON[_0x5e7a('0x1a')](_0xabbffb));_0x36215c(_0xabbffb);})[_0x5e7a('0x1f')](function(_0x274280){logger[_0x5e7a('0x1b')](_0x5e7a('0x2e'),_0x274280[_0x5e7a('0x1d')],_0x3cccd8);_0x51889c(_0x5366fb['error'](0x1f4,_0x274280['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 40b8aca..d33b3f6 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 _0xb38e=['save','remove','update','register','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x4de1b1,_0x18c64c){var _0x639f27=function(_0x635e03){while(--_0x635e03){_0x4de1b1['push'](_0x4de1b1['shift']());}};_0x639f27(++_0x18c64c);}(_0xb38e,0xa7));var _0xeb38=function(_0x3a7a2d,_0x27f899){_0x3a7a2d=_0x3a7a2d-0x0;var _0x59b711=_0xb38e[_0x3a7a2d];return _0x59b711;};'use strict';var VoiceQueueReportEvents=require(_0xeb38('0x0'));var events=[_0xeb38('0x1'),_0xeb38('0x2'),_0xeb38('0x3')];function createListener(_0x2c099d,_0x2dbc7c){return function(_0x3b888c){_0x2dbc7c['emit'](_0x2c099d,_0x3b888c);};}function removeListener(_0x33e6e9,_0x1f150e){return function(){VoiceQueueReportEvents['removeListener'](_0x33e6e9,_0x1f150e);};}exports[_0xeb38('0x4')]=function(_0xd3e5dc){for(var _0x28e501=0x0,_0x31db8c=events['length'];_0x28e501<_0x31db8c;_0x28e501++){var _0x3003aa=events[_0x28e501];var _0x196580=createListener(_0xeb38('0x5')+_0x3003aa,_0xd3e5dc);VoiceQueueReportEvents['on'](_0x3003aa,_0x196580);}}; \ No newline at end of file +var _0x740a=['length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit'];(function(_0x441db3,_0x10f359){var _0x16c05d=function(_0x4c0d4e){while(--_0x4c0d4e){_0x441db3['push'](_0x441db3['shift']());}};_0x16c05d(++_0x10f359);}(_0x740a,0x175));var _0xa740=function(_0x371a8d,_0x1d4a5f){_0x371a8d=_0x371a8d-0x0;var _0x58c6f7=_0x740a[_0x371a8d];return _0x58c6f7;};'use strict';var VoiceQueueReportEvents=require(_0xa740('0x0'));var events=[_0xa740('0x1'),_0xa740('0x2'),_0xa740('0x3')];function createListener(_0x216cea,_0x2e7f6c){return function(_0x23caee){_0x2e7f6c[_0xa740('0x4')](_0x216cea,_0x23caee);};}function removeListener(_0x4e3da6,_0x308c48){return function(){VoiceQueueReportEvents['removeListener'](_0x4e3da6,_0x308c48);};}exports['register']=function(_0x1d3daa){for(var _0x9583c8=0x0,_0x1858d7=events[_0xa740('0x5')];_0x9583c8<_0x1858d7;_0x9583c8++){var _0x356379=events[_0x9583c8];var _0x74b3cd=createListener(_0xa740('0x6')+_0x356379,_0x1d3daa);VoiceQueueReportEvents['on'](_0x356379,_0x74b3cd);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index ee9c3ce..b64f16f 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 _0x22ef=['isAuthenticated','index','/:id','show','post','create','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get'];(function(_0x19a028,_0x161bbc){var _0x2822b0=function(_0x3596e6){while(--_0x3596e6){_0x19a028['push'](_0x19a028['shift']());}};_0x2822b0(++_0x161bbc);}(_0x22ef,0xd8));var _0xf22e=function(_0x11237a,_0x607cb3){_0x11237a=_0x11237a-0x0;var _0x1acb5b=_0x22ef[_0x11237a];return _0x1acb5b;};'use strict';var multer=require(_0xf22e('0x0'));var util=require(_0xf22e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf22e('0x2'));var router=express[_0xf22e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf22e('0x4'));var interaction=require(_0xf22e('0x5'));var config=require(_0xf22e('0x6'));var controller=require(_0xf22e('0x7'));router[_0xf22e('0x8')]('/',auth[_0xf22e('0x9')](),controller[_0xf22e('0xa')]);router[_0xf22e('0x8')](_0xf22e('0xb'),auth[_0xf22e('0x9')](),controller[_0xf22e('0xc')]);router[_0xf22e('0xd')]('/',auth[_0xf22e('0x9')](),controller[_0xf22e('0xe')]);router['put'](_0xf22e('0xb'),auth[_0xf22e('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf3ce=['Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf3ce,0x153));var _0xef3c=function(_0x1c6d44,_0x1b7780){_0x1c6d44=_0x1c6d44-0x0;var _0x49d1a7=_0xf3ce[_0x1c6d44];return _0x49d1a7;};'use strict';var multer=require(_0xef3c('0x0'));var util=require(_0xef3c('0x1'));var path=require('path');var timeout=require(_0xef3c('0x2'));var express=require('express');var router=express[_0xef3c('0x3')]();var fs_extra=require(_0xef3c('0x4'));var auth=require(_0xef3c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xef3c('0x6'));var controller=require(_0xef3c('0x7'));router[_0xef3c('0x8')]('/',auth[_0xef3c('0x9')](),controller[_0xef3c('0xa')]);router[_0xef3c('0x8')](_0xef3c('0xb'),auth['isAuthenticated'](),controller[_0xef3c('0xc')]);router['post']('/',auth[_0xef3c('0x9')](),controller[_0xef3c('0xd')]);router[_0xef3c('0xe')](_0xef3c('0xb'),auth[_0xef3c('0x9')](),controller[_0xef3c('0xf')]);router[_0xef3c('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xef3c('0x11')]);module[_0xef3c('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 1637cd0..bf347f1 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 _0x5745=['exports','STRING','DATE','literal','moment'];(function(_0x16bb22,_0x46a052){var _0x12becf=function(_0x20ddfa){while(--_0x20ddfa){_0x16bb22['push'](_0x16bb22['shift']());}};_0x12becf(++_0x46a052);}(_0x5745,0x13f));var _0x5574=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5745[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5574('0x0'));module[_0x5574('0x1')]={'time':{'type':Sequelize[_0x5574('0x2')]},'callid':{'type':Sequelize[_0x5574('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x5574('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x5574('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x5574('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x5574('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x5574('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5574('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x5574('0x4')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x3d08=['sequelize','moment','exports','STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d08,0x111));var _0x83d0=function(_0x2de60a,_0x545f3a){_0x2de60a=_0x2de60a-0x0;var _0x431e5a=_0x3d08[_0x2de60a];return _0x431e5a;};'use strict';var Sequelize=require(_0x83d0('0x0'));var moment=require(_0x83d0('0x1'));module[_0x83d0('0x2')]={'time':{'type':Sequelize[_0x83d0('0x3')]},'callid':{'type':Sequelize[_0x83d0('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x83d0('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x83d0('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x83d0('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x83d0('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x83d0('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x83d0('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x83d0('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x83d0('0x5')](_0x83d0('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index d860064..5d87144 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 _0xab20=['filters','attributes','intersection','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','update','params','destroy','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','error','stack','name','send','index','map','VoiceQueuesLog','fieldName','type','key','model','query','keys'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xab20,0xb2));var _0x0ab2=function(_0x4275a1,_0x29dffd){_0x4275a1=_0x4275a1-0x0;var _0x14b521=_0xab20[_0x4275a1];return _0x14b521;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0ab2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ab2('0x1'));var moment=require('moment');var BPromise=require(_0x0ab2('0x2'));var Mustache=require(_0x0ab2('0x3'));var util=require(_0x0ab2('0x4'));var path=require(_0x0ab2('0x5'));var sox=require(_0x0ab2('0x6'));var csv=require('to-csv');var ejs=require(_0x0ab2('0x7'));var fs=require('fs');var fs_extra=require(_0x0ab2('0x8'));var _=require('lodash');var squel=require(_0x0ab2('0x9'));var crypto=require(_0x0ab2('0xa'));var jsforce=require(_0x0ab2('0xb'));var deskjs=require(_0x0ab2('0xc'));var toCsv=require(_0x0ab2('0xd'));var querystring=require(_0x0ab2('0xe'));var Papa=require(_0x0ab2('0xf'));var Redis=require(_0x0ab2('0x10'));var authService=require(_0x0ab2('0x11'));var qs=require(_0x0ab2('0x12'));var as=require(_0x0ab2('0x13'));var hardwareService=require(_0x0ab2('0x14'));var logger=require('../../config/logger')(_0x0ab2('0x15'));var utils=require(_0x0ab2('0x16'));var config=require(_0x0ab2('0x17'));var licenseUtil=require(_0x0ab2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfb0d1b,_0x5936bd){_0x5936bd=_0x5936bd||0xcc;return function(_0x310dd1){if(_0x310dd1){return _0xfb0d1b[_0x0ab2('0x19')](_0x5936bd);}return _0xfb0d1b['status'](_0x5936bd)[_0x0ab2('0x1a')]();};}function respondWithResult(_0xadc080,_0x2b904c){_0x2b904c=_0x2b904c||0xc8;return function(_0x87b70){if(_0x87b70){return _0xadc080[_0x0ab2('0x1b')](_0x2b904c)[_0x0ab2('0x1c')](_0x87b70);}};}function respondWithFilteredResult(_0x103b84,_0x2a51a4){return function(_0x15954c){if(_0x15954c){var _0x5c7aef=typeof _0x2a51a4[_0x0ab2('0x1d')]===_0x0ab2('0x1e')&&typeof _0x2a51a4[_0x0ab2('0x1f')]==='undefined';var _0x474e4f=_0x15954c[_0x0ab2('0x20')];var _0x167e97=_0x5c7aef?0x0:_0x2a51a4['offset'];var _0x5892ec=_0x5c7aef?_0x15954c['count']:_0x2a51a4[_0x0ab2('0x1d')]+_0x2a51a4[_0x0ab2('0x1f')];var _0x396690;if(_0x5892ec>=_0x474e4f){_0x5892ec=_0x474e4f;_0x396690=0xc8;}else{_0x396690=0xce;}_0x103b84['status'](_0x396690);return _0x103b84[_0x0ab2('0x21')](_0x0ab2('0x22'),_0x167e97+'-'+_0x5892ec+'/'+_0x474e4f)[_0x0ab2('0x1c')](_0x15954c);}return null;};}function patchUpdates(_0x3e2220){return function(_0x38d6df){try{jsonpatch['apply'](_0x38d6df,_0x3e2220,!![]);}catch(_0x514600){return BPromise[_0x0ab2('0x23')](_0x514600);}return _0x38d6df['save']();};}function saveUpdates(_0x2b0dac,_0xb75061){return function(_0x5b3774){if(_0x5b3774){return _0x5b3774['update'](_0x2b0dac)['then'](function(_0x387b64){return _0x387b64;});}return null;};}function removeEntity(_0x5750c4,_0x1378e4){return function(_0x53e5f7){if(_0x53e5f7){return _0x53e5f7['destroy']()[_0x0ab2('0x24')](function(){_0x5750c4[_0x0ab2('0x1b')](0xcc)[_0x0ab2('0x1a')]();});}};}function handleEntityNotFound(_0x4ed61a,_0x160c6f){return function(_0x3cae40){if(!_0x3cae40){_0x4ed61a[_0x0ab2('0x19')](0x194);}return _0x3cae40;};}function handleError(_0x426d15,_0x59af81){_0x59af81=_0x59af81||0x1f4;return function(_0xadc61a){logger[_0x0ab2('0x25')](_0xadc61a[_0x0ab2('0x26')]);if(_0xadc61a[_0x0ab2('0x27')]){delete _0xadc61a[_0x0ab2('0x27')];}_0x426d15[_0x0ab2('0x1b')](_0x59af81)[_0x0ab2('0x28')](_0xadc61a);};}exports[_0x0ab2('0x29')]=function(_0x3a44d5,_0x335c16){var _0x5d1c01={},_0x58daff={},_0x490fef={'count':0x0,'rows':[]};var _0x51f55c=_[_0x0ab2('0x2a')](db[_0x0ab2('0x2b')]['rawAttributes'],function(_0x1a6dcb){return{'name':_0x1a6dcb[_0x0ab2('0x2c')],'type':_0x1a6dcb[_0x0ab2('0x2d')][_0x0ab2('0x2e')]};});_0x58daff[_0x0ab2('0x2f')]=_[_0x0ab2('0x2a')](_0x51f55c,_0x0ab2('0x27'));_0x58daff[_0x0ab2('0x30')]=_[_0x0ab2('0x31')](_0x3a44d5['query']);_0x58daff[_0x0ab2('0x32')]=_['intersection'](_0x58daff[_0x0ab2('0x2f')],_0x58daff['query']);_0x5d1c01[_0x0ab2('0x33')]=_[_0x0ab2('0x34')](_0x58daff[_0x0ab2('0x2f')],qs[_0x0ab2('0x35')](_0x3a44d5['query'][_0x0ab2('0x35')]));_0x5d1c01[_0x0ab2('0x33')]=_0x5d1c01[_0x0ab2('0x33')][_0x0ab2('0x36')]?_0x5d1c01['attributes']:_0x58daff[_0x0ab2('0x2f')];if(!_0x3a44d5[_0x0ab2('0x30')]['hasOwnProperty'](_0x0ab2('0x37'))){_0x5d1c01[_0x0ab2('0x1f')]=qs[_0x0ab2('0x1f')](_0x3a44d5[_0x0ab2('0x30')][_0x0ab2('0x1f')]);_0x5d1c01[_0x0ab2('0x1d')]=qs[_0x0ab2('0x1d')](_0x3a44d5['query'][_0x0ab2('0x1d')]);}_0x5d1c01['order']=qs[_0x0ab2('0x38')](_0x3a44d5['query'][_0x0ab2('0x38')]);_0x5d1c01[_0x0ab2('0x39')]=qs[_0x0ab2('0x32')](_[_0x0ab2('0x3a')](_0x3a44d5['query'],_0x58daff[_0x0ab2('0x32')]),_0x51f55c);if(_0x3a44d5[_0x0ab2('0x30')]['filter']){_0x5d1c01['where']=_[_0x0ab2('0x3b')](_0x5d1c01[_0x0ab2('0x39')],{'$or':_[_0x0ab2('0x2a')](_0x51f55c,function(_0x492c2f){if(_0x492c2f[_0x0ab2('0x2d')]!==_0x0ab2('0x3c')){var _0x5ae901={};_0x5ae901[_0x492c2f[_0x0ab2('0x27')]]={'$like':'%'+_0x3a44d5[_0x0ab2('0x30')][_0x0ab2('0x3d')]+'%'};return _0x5ae901;}})});}_0x5d1c01=_['merge']({},_0x5d1c01,_0x3a44d5[_0x0ab2('0x3e')]);var _0xfaad11={'where':_0x5d1c01[_0x0ab2('0x39')]};return db[_0x0ab2('0x2b')][_0x0ab2('0x20')](_0xfaad11)['then'](function(_0xe4e0f1){_0x490fef[_0x0ab2('0x20')]=_0xe4e0f1;if(_0x3a44d5[_0x0ab2('0x30')][_0x0ab2('0x3f')]){_0x5d1c01['include']=[{'all':!![]}];}return db[_0x0ab2('0x2b')][_0x0ab2('0x40')](_0x5d1c01);})[_0x0ab2('0x24')](function(_0x83bcce){_0x490fef[_0x0ab2('0x41')]=_0x83bcce;return _0x490fef;})['then'](respondWithFilteredResult(_0x335c16,_0x5d1c01))[_0x0ab2('0x42')](handleError(_0x335c16,null));};exports[_0x0ab2('0x43')]=function(_0x79e675,_0x210c87){var _0x25fb69={'raw':!![],'where':{'id':_0x79e675['params']['id']}},_0x23e9e1={};_0x23e9e1['model']=_[_0x0ab2('0x31')](db[_0x0ab2('0x2b')][_0x0ab2('0x44')]);_0x23e9e1[_0x0ab2('0x30')]=_[_0x0ab2('0x31')](_0x79e675[_0x0ab2('0x30')]);_0x23e9e1[_0x0ab2('0x32')]=_[_0x0ab2('0x34')](_0x23e9e1[_0x0ab2('0x2f')],_0x23e9e1['query']);_0x25fb69[_0x0ab2('0x33')]=_[_0x0ab2('0x34')](_0x23e9e1[_0x0ab2('0x2f')],qs[_0x0ab2('0x35')](_0x79e675[_0x0ab2('0x30')][_0x0ab2('0x35')]));_0x25fb69[_0x0ab2('0x33')]=_0x25fb69[_0x0ab2('0x33')][_0x0ab2('0x36')]?_0x25fb69[_0x0ab2('0x33')]:_0x23e9e1['model'];if(_0x79e675[_0x0ab2('0x30')][_0x0ab2('0x3f')]){_0x25fb69[_0x0ab2('0x45')]=[{'all':!![]}];}_0x25fb69=_[_0x0ab2('0x3b')]({},_0x25fb69,_0x79e675[_0x0ab2('0x3e')]);return db[_0x0ab2('0x2b')][_0x0ab2('0x46')](_0x25fb69)[_0x0ab2('0x24')](handleEntityNotFound(_0x210c87,null))[_0x0ab2('0x24')](respondWithResult(_0x210c87,null))[_0x0ab2('0x42')](handleError(_0x210c87,null));};exports[_0x0ab2('0x47')]=function(_0x215012,_0x5f1730){return db['VoiceQueuesLog'][_0x0ab2('0x47')](_0x215012[_0x0ab2('0x48')],{})['then'](respondWithResult(_0x5f1730,0xc9))[_0x0ab2('0x42')](handleError(_0x5f1730,null));};exports[_0x0ab2('0x49')]=function(_0x77b46,_0x2ea1b4){if(_0x77b46[_0x0ab2('0x48')]['id']){delete _0x77b46['body']['id'];}return db['VoiceQueuesLog'][_0x0ab2('0x46')]({'where':{'id':_0x77b46[_0x0ab2('0x4a')]['id']}})[_0x0ab2('0x24')](handleEntityNotFound(_0x2ea1b4,null))[_0x0ab2('0x24')](saveUpdates(_0x77b46[_0x0ab2('0x48')],null))['then'](respondWithResult(_0x2ea1b4,null))[_0x0ab2('0x42')](handleError(_0x2ea1b4,null));};exports[_0x0ab2('0x4b')]=function(_0x3dc0db,_0x4ceeb8){return db[_0x0ab2('0x2b')][_0x0ab2('0x46')]({'where':{'id':_0x3dc0db[_0x0ab2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ceeb8,null))['then'](removeEntity(_0x4ceeb8,null))['catch'](handleError(_0x4ceeb8,null));}; \ No newline at end of file +var _0xfb7c=['stack','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xfb7c,0x100));var _0xcfb7=function(_0xd520ea,_0x42bc04){_0xd520ea=_0xd520ea-0x0;var _0x378d9b=_0xfb7c[_0xd520ea];return _0x378d9b;};'use strict';var emlformat=require(_0xcfb7('0x0'));var rimraf=require(_0xcfb7('0x1'));var zipdir=require(_0xcfb7('0x2'));var jsonpatch=require(_0xcfb7('0x3'));var rp=require(_0xcfb7('0x4'));var moment=require('moment');var BPromise=require(_0xcfb7('0x5'));var Mustache=require(_0xcfb7('0x6'));var util=require(_0xcfb7('0x7'));var path=require('path');var sox=require(_0xcfb7('0x8'));var csv=require(_0xcfb7('0x9'));var ejs=require(_0xcfb7('0xa'));var fs=require('fs');var fs_extra=require(_0xcfb7('0xb'));var _=require(_0xcfb7('0xc'));var squel=require(_0xcfb7('0xd'));var crypto=require('crypto');var jsforce=require(_0xcfb7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcfb7('0x9'));var querystring=require(_0xcfb7('0xf'));var Papa=require(_0xcfb7('0x10'));var Redis=require(_0xcfb7('0x11'));var authService=require(_0xcfb7('0x12'));var qs=require(_0xcfb7('0x13'));var as=require(_0xcfb7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xcfb7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcfb7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x460fb4,_0x6e8f69){_0x6e8f69=_0x6e8f69||0xcc;return function(_0xf970ed){if(_0xf970ed){return _0x460fb4['sendStatus'](_0x6e8f69);}return _0x460fb4['status'](_0x6e8f69)[_0xcfb7('0x17')]();};}function respondWithResult(_0x1dcb07,_0x5b95e6){_0x5b95e6=_0x5b95e6||0xc8;return function(_0x2e13bd){if(_0x2e13bd){return _0x1dcb07['status'](_0x5b95e6)[_0xcfb7('0x18')](_0x2e13bd);}};}function respondWithFilteredResult(_0x339f0f,_0x146dc6){return function(_0x3a505f){if(_0x3a505f){var _0xdfa3ea=typeof _0x146dc6[_0xcfb7('0x19')]===_0xcfb7('0x1a')&&typeof _0x146dc6[_0xcfb7('0x1b')]===_0xcfb7('0x1a');var _0x1481db=_0x3a505f[_0xcfb7('0x1c')];var _0x5b173e=_0xdfa3ea?0x0:_0x146dc6[_0xcfb7('0x19')];var _0x3599a9=_0xdfa3ea?_0x3a505f['count']:_0x146dc6[_0xcfb7('0x19')]+_0x146dc6[_0xcfb7('0x1b')];var _0x3ce0a0;if(_0x3599a9>=_0x1481db){_0x3599a9=_0x1481db;_0x3ce0a0=0xc8;}else{_0x3ce0a0=0xce;}_0x339f0f[_0xcfb7('0x1d')](_0x3ce0a0);return _0x339f0f[_0xcfb7('0x1e')](_0xcfb7('0x1f'),_0x5b173e+'-'+_0x3599a9+'/'+_0x1481db)[_0xcfb7('0x18')](_0x3a505f);}return null;};}function patchUpdates(_0x2fa4a5){return function(_0x309081){try{jsonpatch[_0xcfb7('0x20')](_0x309081,_0x2fa4a5,!![]);}catch(_0x4e5513){return BPromise['reject'](_0x4e5513);}return _0x309081[_0xcfb7('0x21')]();};}function saveUpdates(_0x12a444,_0xd78e70){return function(_0x26f42c){if(_0x26f42c){return _0x26f42c[_0xcfb7('0x22')](_0x12a444)[_0xcfb7('0x23')](function(_0x20b039){return _0x20b039;});}return null;};}function removeEntity(_0x23102a,_0x57f626){return function(_0x27c1eb){if(_0x27c1eb){return _0x27c1eb['destroy']()[_0xcfb7('0x23')](function(){_0x23102a['status'](0xcc)[_0xcfb7('0x17')]();});}};}function handleEntityNotFound(_0x5604fc,_0x17e6be){return function(_0x591bd2){if(!_0x591bd2){_0x5604fc['sendStatus'](0x194);}return _0x591bd2;};}function handleError(_0x4d75e2,_0x49b3cd){_0x49b3cd=_0x49b3cd||0x1f4;return function(_0x435b2d){logger['error'](_0x435b2d[_0xcfb7('0x24')]);if(_0x435b2d['name']){delete _0x435b2d['name'];}_0x4d75e2['status'](_0x49b3cd)[_0xcfb7('0x25')](_0x435b2d);};}exports[_0xcfb7('0x26')]=function(_0x3384c4,_0x4ba3e6){var _0xf0bbd7={},_0xa771f={},_0x2ab835={'count':0x0,'rows':[]};var _0x120335=_[_0xcfb7('0x27')](db[_0xcfb7('0x28')][_0xcfb7('0x29')],function(_0x540360){return{'name':_0x540360[_0xcfb7('0x2a')],'type':_0x540360[_0xcfb7('0x2b')][_0xcfb7('0x2c')]};});_0xa771f[_0xcfb7('0x2d')]=_[_0xcfb7('0x27')](_0x120335,_0xcfb7('0x2e'));_0xa771f[_0xcfb7('0x2f')]=_[_0xcfb7('0x30')](_0x3384c4[_0xcfb7('0x2f')]);_0xa771f[_0xcfb7('0x31')]=_[_0xcfb7('0x32')](_0xa771f[_0xcfb7('0x2d')],_0xa771f[_0xcfb7('0x2f')]);_0xf0bbd7[_0xcfb7('0x33')]=_[_0xcfb7('0x32')](_0xa771f[_0xcfb7('0x2d')],qs[_0xcfb7('0x34')](_0x3384c4[_0xcfb7('0x2f')]['fields']));_0xf0bbd7[_0xcfb7('0x33')]=_0xf0bbd7[_0xcfb7('0x33')][_0xcfb7('0x35')]?_0xf0bbd7['attributes']:_0xa771f[_0xcfb7('0x2d')];if(!_0x3384c4['query'][_0xcfb7('0x36')](_0xcfb7('0x37'))){_0xf0bbd7[_0xcfb7('0x1b')]=qs[_0xcfb7('0x1b')](_0x3384c4[_0xcfb7('0x2f')][_0xcfb7('0x1b')]);_0xf0bbd7[_0xcfb7('0x19')]=qs[_0xcfb7('0x19')](_0x3384c4['query'][_0xcfb7('0x19')]);}_0xf0bbd7[_0xcfb7('0x38')]=qs[_0xcfb7('0x39')](_0x3384c4[_0xcfb7('0x2f')][_0xcfb7('0x39')]);_0xf0bbd7[_0xcfb7('0x3a')]=qs[_0xcfb7('0x31')](_[_0xcfb7('0x3b')](_0x3384c4[_0xcfb7('0x2f')],_0xa771f[_0xcfb7('0x31')]),_0x120335);if(_0x3384c4[_0xcfb7('0x2f')]['filter']){_0xf0bbd7[_0xcfb7('0x3a')]=_[_0xcfb7('0x3c')](_0xf0bbd7[_0xcfb7('0x3a')],{'$or':_['map'](_0x120335,function(_0x5c5a1c){if(_0x5c5a1c['type']!==_0xcfb7('0x3d')){var _0x7c8e04={};_0x7c8e04[_0x5c5a1c[_0xcfb7('0x2e')]]={'$like':'%'+_0x3384c4[_0xcfb7('0x2f')][_0xcfb7('0x3e')]+'%'};return _0x7c8e04;}})});}_0xf0bbd7=_['merge']({},_0xf0bbd7,_0x3384c4[_0xcfb7('0x3f')]);var _0x31999c={'where':_0xf0bbd7['where']};return db[_0xcfb7('0x28')]['count'](_0x31999c)[_0xcfb7('0x23')](function(_0x59185d){_0x2ab835[_0xcfb7('0x1c')]=_0x59185d;if(_0x3384c4['query'][_0xcfb7('0x40')]){_0xf0bbd7[_0xcfb7('0x41')]=[{'all':!![]}];}return db[_0xcfb7('0x28')]['findAll'](_0xf0bbd7);})[_0xcfb7('0x23')](function(_0x16ba97){_0x2ab835[_0xcfb7('0x42')]=_0x16ba97;return _0x2ab835;})[_0xcfb7('0x23')](respondWithFilteredResult(_0x4ba3e6,_0xf0bbd7))[_0xcfb7('0x43')](handleError(_0x4ba3e6,null));};exports['show']=function(_0x525bc0,_0x155fc0){var _0x25103f={'raw':!![],'where':{'id':_0x525bc0[_0xcfb7('0x44')]['id']}},_0x51968f={};_0x51968f[_0xcfb7('0x2d')]=_[_0xcfb7('0x30')](db[_0xcfb7('0x28')]['rawAttributes']);_0x51968f[_0xcfb7('0x2f')]=_[_0xcfb7('0x30')](_0x525bc0[_0xcfb7('0x2f')]);_0x51968f[_0xcfb7('0x31')]=_[_0xcfb7('0x32')](_0x51968f[_0xcfb7('0x2d')],_0x51968f[_0xcfb7('0x2f')]);_0x25103f['attributes']=_[_0xcfb7('0x32')](_0x51968f[_0xcfb7('0x2d')],qs[_0xcfb7('0x34')](_0x525bc0[_0xcfb7('0x2f')][_0xcfb7('0x34')]));_0x25103f[_0xcfb7('0x33')]=_0x25103f[_0xcfb7('0x33')][_0xcfb7('0x35')]?_0x25103f[_0xcfb7('0x33')]:_0x51968f[_0xcfb7('0x2d')];if(_0x525bc0[_0xcfb7('0x2f')][_0xcfb7('0x40')]){_0x25103f['include']=[{'all':!![]}];}_0x25103f=_['merge']({},_0x25103f,_0x525bc0['options']);return db[_0xcfb7('0x28')][_0xcfb7('0x45')](_0x25103f)[_0xcfb7('0x23')](handleEntityNotFound(_0x155fc0,null))['then'](respondWithResult(_0x155fc0,null))[_0xcfb7('0x43')](handleError(_0x155fc0,null));};exports[_0xcfb7('0x46')]=function(_0x3a736d,_0x34f3b1){return db[_0xcfb7('0x28')][_0xcfb7('0x46')](_0x3a736d[_0xcfb7('0x47')],{})[_0xcfb7('0x23')](respondWithResult(_0x34f3b1,0xc9))['catch'](handleError(_0x34f3b1,null));};exports[_0xcfb7('0x22')]=function(_0xac0f69,_0x473197){if(_0xac0f69[_0xcfb7('0x47')]['id']){delete _0xac0f69['body']['id'];}return db[_0xcfb7('0x28')]['find']({'where':{'id':_0xac0f69[_0xcfb7('0x44')]['id']}})[_0xcfb7('0x23')](handleEntityNotFound(_0x473197,null))[_0xcfb7('0x23')](saveUpdates(_0xac0f69['body'],null))[_0xcfb7('0x23')](respondWithResult(_0x473197,null))[_0xcfb7('0x43')](handleError(_0x473197,null));};exports[_0xcfb7('0x48')]=function(_0x390605,_0x1032fe){return db[_0xcfb7('0x28')][_0xcfb7('0x45')]({'where':{'id':_0x390605[_0xcfb7('0x44')]['id']}})['then'](handleEntityNotFound(_0x1032fe,null))[_0xcfb7('0x23')](removeEntity(_0x1032fe,null))[_0xcfb7('0x43')](handleError(_0x1032fe,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index fef8771..574f0c5 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 _0x5cc6=['rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','event_dtm','event','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x590c6d,_0x27d984){var _0x41c12f=function(_0x14aded){while(--_0x14aded){_0x590c6d['push'](_0x590c6d['shift']());}};_0x41c12f(++_0x27d984);}(_0x5cc6,0x1c1));var _0x65cc=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0x5cc6[_0x429948];return _0x35d5d1;};'use strict';var _=require(_0x65cc('0x0'));var util=require('util');var logger=require(_0x65cc('0x1'))(_0x65cc('0x2'));var moment=require(_0x65cc('0x3'));var BPromise=require(_0x65cc('0x4'));var rp=require(_0x65cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x65cc('0x6'));var config=require(_0x65cc('0x7'));var attributes=require(_0x65cc('0x8'));module['exports']=function(_0xabf5be,_0xdcd52d){return _0xabf5be[_0x65cc('0x9')](_0x65cc('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x65cc('0xb'),'fields':[_0x65cc('0xc'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x021a=['rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event','dtm','lodash','util','../../config/logger','moment','path'];(function(_0x504db2,_0x17dac6){var _0x1d79d5=function(_0x563567){while(--_0x563567){_0x504db2['push'](_0x504db2['shift']());}};_0x1d79d5(++_0x17dac6);}(_0x021a,0xff));var _0xa021=function(_0x4b9978,_0x58eb71){_0x4b9978=_0x4b9978-0x0;var _0x42f0e5=_0x021a[_0x4b9978];return _0x42f0e5;};'use strict';var _=require(_0xa021('0x0'));var util=require(_0xa021('0x1'));var logger=require(_0xa021('0x2'))('api');var moment=require(_0xa021('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa021('0x4'));var rimraf=require(_0xa021('0x5'));var config=require(_0xa021('0x6'));var attributes=require(_0xa021('0x7'));module[_0xa021('0x8')]=function(_0x36530f,_0x2bda04){return _0x36530f[_0xa021('0x9')](_0xa021('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xa021('0xb'),_0xa021('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 128266c..d92309b 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 _0x38e7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','moment'];(function(_0x57e78f,_0x1ca7d2){var _0x5e3ef9=function(_0x243f05){while(--_0x243f05){_0x57e78f['push'](_0x57e78f['shift']());}};_0x5e3ef9(++_0x1ca7d2);}(_0x38e7,0x1eb));var _0x738e=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0x38e7[_0x2891d1];return _0x486948;};'use strict';var _=require(_0x738e('0x0'));var util=require(_0x738e('0x1'));var moment=require(_0x738e('0x2'));var BPromise=require(_0x738e('0x3'));var rs=require(_0x738e('0x4'));var fs=require('fs');var Redis=require(_0x738e('0x5'));var db=require(_0x738e('0x6'))['db'];var utils=require(_0x738e('0x7'));var logger=require(_0x738e('0x8'))(_0x738e('0x9'));var config=require(_0x738e('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x282b59,_0x35db07,_0x26c0a7){return new BPromise(function(_0x287d50,_0x160926){return client[_0x738e('0xb')](_0x282b59,_0x26c0a7)[_0x738e('0xc')](function(_0x36f796){logger[_0x738e('0xd')](_0x738e('0xe'),_0x35db07,_0x738e('0xf'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x35db07,_0x738e('0xf'),JSON['stringify'](_0x36f796));if(_0x36f796[_0x738e('0x10')]){if(_0x36f796[_0x738e('0x10')]['code']===0x1f4){logger[_0x738e('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x35db07,_0x36f796[_0x738e('0x10')][_0x738e('0x11')]);return _0x160926(_0x36f796[_0x738e('0x10')][_0x738e('0x11')]);}logger[_0x738e('0x10')](_0x738e('0xe'),_0x35db07,_0x36f796['error'][_0x738e('0x11')]);return _0x287d50(_0x36f796[_0x738e('0x10')][_0x738e('0x11')]);}else{logger[_0x738e('0xd')](_0x738e('0xe'),_0x35db07,_0x738e('0xf'));_0x287d50(_0x36f796['result'][_0x738e('0x11')]);}})[_0x738e('0x12')](function(_0x4d0651){logger[_0x738e('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x35db07,_0x4d0651);_0x160926(_0x4d0651);});});} \ No newline at end of file +var _0x2227=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x11dc0f,_0x42cd6c){var _0x352369=function(_0x3f4714){while(--_0x3f4714){_0x11dc0f['push'](_0x11dc0f['shift']());}};_0x352369(++_0x42cd6c);}(_0x2227,0x147));var _0x7222=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x2227[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x7222('0x0'));var util=require(_0x7222('0x1'));var moment=require(_0x7222('0x2'));var BPromise=require('bluebird');var rs=require(_0x7222('0x3'));var fs=require('fs');var Redis=require(_0x7222('0x4'));var db=require(_0x7222('0x5'))['db'];var utils=require(_0x7222('0x6'));var logger=require(_0x7222('0x7'))(_0x7222('0x8'));var config=require(_0x7222('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7222('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x486f82,_0x45488a,_0x1985f9){return new BPromise(function(_0x1d25ac,_0x23761e){return client['request'](_0x486f82,_0x1985f9)[_0x7222('0xb')](function(_0x107d00){logger[_0x7222('0xc')](_0x7222('0xd'),_0x45488a,_0x7222('0xe'));logger[_0x7222('0xf')](_0x7222('0x10'),_0x45488a,_0x7222('0xe'),JSON[_0x7222('0x11')](_0x107d00));if(_0x107d00[_0x7222('0x12')]){if(_0x107d00[_0x7222('0x12')]['code']===0x1f4){logger[_0x7222('0x12')](_0x7222('0xd'),_0x45488a,_0x107d00[_0x7222('0x12')][_0x7222('0x13')]);return _0x23761e(_0x107d00[_0x7222('0x12')][_0x7222('0x13')]);}logger['error'](_0x7222('0xd'),_0x45488a,_0x107d00['error'][_0x7222('0x13')]);return _0x1d25ac(_0x107d00[_0x7222('0x12')][_0x7222('0x13')]);}else{logger[_0x7222('0xc')](_0x7222('0xd'),_0x45488a,_0x7222('0xe'));_0x1d25ac(_0x107d00[_0x7222('0x14')][_0x7222('0x13')]);}})[_0x7222('0x15')](function(_0x3798e6){logger[_0x7222('0x12')](_0x7222('0xd'),_0x45488a,_0x3798e6);_0x23761e(_0x3798e6);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index f1a8e84..ddce3e3 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 _0x7156=['create','/:id/transcribe','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','post'];(function(_0x4b289f,_0xc18eb0){var _0x53db94=function(_0x4ab007){while(--_0x4ab007){_0x4b289f['push'](_0x4b289f['shift']());}};_0x53db94(++_0xc18eb0);}(_0x7156,0x1e1));var _0x6715=function(_0x11b26c,_0x3b214e){_0x11b26c=_0x11b26c-0x0;var _0x1546ad=_0x7156[_0x11b26c];return _0x1546ad;};'use strict';var multer=require(_0x6715('0x0'));var util=require(_0x6715('0x1'));var path=require(_0x6715('0x2'));var timeout=require(_0x6715('0x3'));var express=require(_0x6715('0x4'));var router=express['Router']();var fs_extra=require(_0x6715('0x5'));var auth=require(_0x6715('0x6'));var interaction=require(_0x6715('0x7'));var config=require(_0x6715('0x8'));var controller=require(_0x6715('0x9'));router[_0x6715('0xa')]('/',auth[_0x6715('0xb')](),controller[_0x6715('0xc')]);router['get'](_0x6715('0xd'),auth[_0x6715('0xb')](),controller[_0x6715('0xe')]);router['get'](_0x6715('0xf'),auth[_0x6715('0xb')](),controller[_0x6715('0x10')]);router[_0x6715('0xa')](_0x6715('0x11'),auth[_0x6715('0xb')](),controller[_0x6715('0x12')]);router[_0x6715('0xa')](_0x6715('0x13'),controller[_0x6715('0x14')]);router[_0x6715('0xa')]('/:id/transcribe',auth[_0x6715('0xb')](),controller[_0x6715('0x15')]);router[_0x6715('0x16')]('/',auth[_0x6715('0xb')](),controller[_0x6715('0x17')]);router[_0x6715('0x16')](_0x6715('0x18'),auth[_0x6715('0xb')](),controller['runTranscribe']);router[_0x6715('0x19')](_0x6715('0xf'),auth[_0x6715('0xb')](),controller['update']);router['delete'](_0x6715('0xf'),auth[_0x6715('0xb')](),controller[_0x6715('0x1a')]);module[_0x6715('0x1b')]=router; \ No newline at end of file +var _0xbe0c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','create','post','runTranscribe','put','update','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe0c,0x123));var _0xcbe0=function(_0x3420bd,_0x34703d){_0x3420bd=_0x3420bd-0x0;var _0x5c7793=_0xbe0c[_0x3420bd];return _0x5c7793;};'use strict';var multer=require('multer');var util=require(_0xcbe0('0x0'));var path=require(_0xcbe0('0x1'));var timeout=require(_0xcbe0('0x2'));var express=require(_0xcbe0('0x3'));var router=express[_0xcbe0('0x4')]();var fs_extra=require(_0xcbe0('0x5'));var auth=require(_0xcbe0('0x6'));var interaction=require(_0xcbe0('0x7'));var config=require(_0xcbe0('0x8'));var controller=require(_0xcbe0('0x9'));router[_0xcbe0('0xa')]('/',auth[_0xcbe0('0xb')](),controller[_0xcbe0('0xc')]);router[_0xcbe0('0xa')](_0xcbe0('0xd'),auth[_0xcbe0('0xb')](),controller['describe']);router[_0xcbe0('0xa')](_0xcbe0('0xe'),auth['isAuthenticated'](),controller[_0xcbe0('0xf')]);router[_0xcbe0('0xa')](_0xcbe0('0x10'),auth['isAuthenticated'](),controller[_0xcbe0('0x11')]);router[_0xcbe0('0xa')](_0xcbe0('0x12'),controller[_0xcbe0('0x13')]);router[_0xcbe0('0xa')](_0xcbe0('0x14'),auth[_0xcbe0('0xb')](),controller['downloadTranscribe']);router['post']('/',auth[_0xcbe0('0xb')](),controller[_0xcbe0('0x15')]);router[_0xcbe0('0x16')](_0xcbe0('0x14'),auth[_0xcbe0('0xb')](),controller[_0xcbe0('0x17')]);router[_0xcbe0('0x18')](_0xcbe0('0xe'),auth[_0xcbe0('0xb')](),controller[_0xcbe0('0x19')]);router['delete'](_0xcbe0('0xe'),auth[_0xcbe0('0xb')](),controller['destroy']);module[_0xcbe0('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index caa08fd..c178f20 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(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 99a5312..0492e8c 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 _0x68a0=['includeAll','include','findAll','show','params','rawAttributes','create','body','catch','find','describe','download','../../components/encryptor','type','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','$and','push','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','startTranscriptionJob','basename','readFileSync','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','runTranscribe','recording','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','uuid/v4','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','VoiceRecording','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options'];(function(_0x2d3aa9,_0x501062){var _0x1c3648=function(_0x7d970a){while(--_0x7d970a){_0x2d3aa9['push'](_0x2d3aa9['shift']());}};_0x1c3648(++_0x501062);}(_0x68a0,0xf1));var _0x068a=function(_0xca41dc,_0x22936e){_0xca41dc=_0xca41dc-0x0;var _0x3e125c=_0x68a0[_0xca41dc];return _0x3e125c;};'use strict';var emlformat=require(_0x068a('0x0'));var rimraf=require(_0x068a('0x1'));var zipdir=require(_0x068a('0x2'));var jsonpatch=require(_0x068a('0x3'));var rp=require(_0x068a('0x4'));var moment=require(_0x068a('0x5'));var BPromise=require(_0x068a('0x6'));var Mustache=require(_0x068a('0x7'));var util=require(_0x068a('0x8'));var path=require(_0x068a('0x9'));var sox=require(_0x068a('0xa'));var csv=require(_0x068a('0xb'));var ejs=require(_0x068a('0xc'));var fs=require('fs');var fs_extra=require(_0x068a('0xd'));var _=require('lodash');var squel=require(_0x068a('0xe'));var crypto=require(_0x068a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x068a('0x10'));var toCsv=require(_0x068a('0xb'));var querystring=require(_0x068a('0x11'));var Papa=require(_0x068a('0x12'));var AWS=require('aws-sdk');var uuidv4=require(_0x068a('0x13'));var Redis=require('ioredis');var authService=require(_0x068a('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x068a('0x15'));var logger=require(_0x068a('0x16'))(_0x068a('0x17'));var utils=require('../../config/utils');var config=require(_0x068a('0x18'));var licenseUtil=require(_0x068a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50cc2c,_0x54fd8a){_0x54fd8a=_0x54fd8a||0xcc;return function(_0xb8fcf9){if(_0xb8fcf9){return _0x50cc2c[_0x068a('0x1a')](_0x54fd8a);}return _0x50cc2c[_0x068a('0x1b')](_0x54fd8a)[_0x068a('0x1c')]();};}function respondWithResult(_0x48f80e,_0x146957){_0x146957=_0x146957||0xc8;return function(_0x5ecadc){if(_0x5ecadc){return _0x48f80e[_0x068a('0x1b')](_0x146957)[_0x068a('0x1d')](_0x5ecadc);}};}function respondWithFilteredResult(_0x1f6441,_0x3f08c7){return function(_0x595165){if(_0x595165){var _0x4688c8=typeof _0x3f08c7[_0x068a('0x1e')]===_0x068a('0x1f')&&typeof _0x3f08c7[_0x068a('0x20')]===_0x068a('0x1f');var _0x3e6273=_0x595165[_0x068a('0x21')];var _0x41f6f3=_0x4688c8?0x0:_0x3f08c7[_0x068a('0x1e')];var _0x267088=_0x4688c8?_0x595165['count']:_0x3f08c7[_0x068a('0x1e')]+_0x3f08c7['limit'];var _0x1200f0;if(_0x267088>=_0x3e6273){_0x267088=_0x3e6273;_0x1200f0=0xc8;}else{_0x1200f0=0xce;}_0x1f6441[_0x068a('0x1b')](_0x1200f0);return _0x1f6441[_0x068a('0x22')](_0x068a('0x23'),_0x41f6f3+'-'+_0x267088+'/'+_0x3e6273)['json'](_0x595165);}return null;};}function patchUpdates(_0x5b73ed){return function(_0x31918f){try{jsonpatch[_0x068a('0x24')](_0x31918f,_0x5b73ed,!![]);}catch(_0x1d043a){return BPromise[_0x068a('0x25')](_0x1d043a);}return _0x31918f[_0x068a('0x26')]();};}function saveUpdates(_0x36130c,_0x21926b){return function(_0x147822){if(_0x147822){return _0x147822[_0x068a('0x27')](_0x36130c)[_0x068a('0x28')](function(_0x2b01b8){return _0x2b01b8;});}return null;};}function removeEntity(_0x44d1a8,_0x2c34f5){return function(_0x3901eb){if(_0x3901eb){return _0x3901eb[_0x068a('0x29')]()[_0x068a('0x28')](function(){_0x44d1a8['status'](0xcc)[_0x068a('0x1c')]();});}};}function handleEntityNotFound(_0x2c27ca,_0x1665a4){return function(_0x5afee6){if(!_0x5afee6){_0x2c27ca[_0x068a('0x1a')](0x194);}return _0x5afee6;};}function handleError(_0x38edaa,_0x471866){_0x471866=_0x471866||0x1f4;return function(_0x2865f8){logger[_0x068a('0x2a')](_0x2865f8[_0x068a('0x2b')]);if(_0x2865f8[_0x068a('0x2c')]){delete _0x2865f8[_0x068a('0x2c')];}_0x38edaa[_0x068a('0x1b')](_0x471866)[_0x068a('0x2d')](_0x2865f8);};}exports['index']=function(_0x2cf554,_0x6970c2){var _0xc9f24b={},_0x3bb88f={},_0x548019={'count':0x0,'rows':[]};var _0x469c52=_[_0x068a('0x2e')](db[_0x068a('0x2f')]['rawAttributes'],function(_0x1e93cd){return{'name':_0x1e93cd['fieldName'],'type':_0x1e93cd['type'][_0x068a('0x30')]};});_0x3bb88f[_0x068a('0x31')]=_['differenceBy'](_[_0x068a('0x2e')](_0x469c52,_0x068a('0x2c')),['format']);_0x3bb88f['query']=_[_0x068a('0x32')](_0x2cf554[_0x068a('0x33')]);_0x3bb88f[_0x068a('0x34')]=_[_0x068a('0x35')](_0x3bb88f['model'],_0x3bb88f[_0x068a('0x33')]);_0xc9f24b['attributes']=_[_0x068a('0x35')](_0x3bb88f['model'],qs[_0x068a('0x36')](_0x2cf554[_0x068a('0x33')][_0x068a('0x36')]));_0xc9f24b[_0x068a('0x37')]=_0xc9f24b[_0x068a('0x37')][_0x068a('0x38')]?_0xc9f24b[_0x068a('0x37')]:_0x3bb88f[_0x068a('0x31')];if(!_0x2cf554['query'][_0x068a('0x39')]('nolimit')){_0xc9f24b['limit']=qs['limit'](_0x2cf554[_0x068a('0x33')][_0x068a('0x20')]);_0xc9f24b['offset']=qs[_0x068a('0x1e')](_0x2cf554[_0x068a('0x33')]['offset']);}_0xc9f24b[_0x068a('0x3a')]=qs[_0x068a('0x3b')](_0x2cf554[_0x068a('0x33')][_0x068a('0x3b')]);_0xc9f24b[_0x068a('0x3c')]=qs[_0x068a('0x34')](_[_0x068a('0x3d')](_0x2cf554['query'],_0x3bb88f['filters']),_0x469c52);if(_0x2cf554[_0x068a('0x33')][_0x068a('0x3e')]){_0xc9f24b['where']=_[_0x068a('0x3f')](_0xc9f24b[_0x068a('0x3c')],{'$or':_[_0x068a('0x2e')](_0x469c52,function(_0xdbfeb){if(_0xdbfeb['type']!=='VIRTUAL'){var _0x5466a8={};_0x5466a8[_0xdbfeb[_0x068a('0x2c')]]={'$like':'%'+_0x2cf554[_0x068a('0x33')][_0x068a('0x3e')]+'%'};return _0x5466a8;}})});}_0xc9f24b=_['merge']({},_0xc9f24b,_0x2cf554[_0x068a('0x40')]);var _0x507647={'where':_0xc9f24b[_0x068a('0x3c')]};return db[_0x068a('0x2f')][_0x068a('0x21')](_0x507647)[_0x068a('0x28')](function(_0x1aff84){_0x548019[_0x068a('0x21')]=_0x1aff84;if(_0x2cf554['query'][_0x068a('0x41')]){_0xc9f24b[_0x068a('0x42')]=[{'all':!![]}];}return db[_0x068a('0x2f')][_0x068a('0x43')](_0xc9f24b);})[_0x068a('0x28')](function(_0x5ed178){_0x548019['rows']=_0x5ed178;return _0x548019;})[_0x068a('0x28')](respondWithFilteredResult(_0x6970c2,_0xc9f24b))['catch'](handleError(_0x6970c2,null));};exports[_0x068a('0x44')]=function(_0x1c55aa,_0x1b77e5){var _0x34624a={'raw':![],'where':{'id':_0x1c55aa[_0x068a('0x45')]['id']}},_0x23944c={};_0x23944c[_0x068a('0x31')]=_[_0x068a('0x32')](db[_0x068a('0x2f')][_0x068a('0x46')]);_0x23944c[_0x068a('0x33')]=_['keys'](_0x1c55aa[_0x068a('0x33')]);_0x23944c[_0x068a('0x34')]=_[_0x068a('0x35')](_0x23944c[_0x068a('0x31')],_0x23944c[_0x068a('0x33')]);_0x34624a[_0x068a('0x37')]=_[_0x068a('0x35')](_0x23944c[_0x068a('0x31')],qs['fields'](_0x1c55aa[_0x068a('0x33')][_0x068a('0x36')]));_0x34624a[_0x068a('0x37')]=_0x34624a[_0x068a('0x37')][_0x068a('0x38')]?_0x34624a[_0x068a('0x37')]:_0x23944c[_0x068a('0x31')];if(_0x1c55aa[_0x068a('0x33')]['includeAll']){_0x34624a[_0x068a('0x42')]=[{'all':!![]}];}_0x34624a=_[_0x068a('0x3f')]({},_0x34624a,_0x1c55aa[_0x068a('0x40')]);return db['VoiceRecording']['find'](_0x34624a)[_0x068a('0x28')](handleEntityNotFound(_0x1b77e5,null))[_0x068a('0x28')](respondWithResult(_0x1b77e5,null))['catch'](handleError(_0x1b77e5,null));};exports[_0x068a('0x47')]=function(_0x1afcc8,_0xc29731){return db[_0x068a('0x2f')][_0x068a('0x47')](_0x1afcc8[_0x068a('0x48')],{})[_0x068a('0x28')](respondWithResult(_0xc29731,0xc9))[_0x068a('0x49')](handleError(_0xc29731,null));};exports[_0x068a('0x27')]=function(_0x34b7a1,_0x1d2cb3){if(_0x34b7a1[_0x068a('0x48')]['id']){delete _0x34b7a1[_0x068a('0x48')]['id'];}return db[_0x068a('0x2f')][_0x068a('0x4a')]({'where':{'id':_0x34b7a1[_0x068a('0x45')]['id']}})[_0x068a('0x28')](handleEntityNotFound(_0x1d2cb3,null))[_0x068a('0x28')](saveUpdates(_0x34b7a1[_0x068a('0x48')],null))[_0x068a('0x28')](respondWithResult(_0x1d2cb3,null))[_0x068a('0x49')](handleError(_0x1d2cb3,null));};exports[_0x068a('0x4b')]=function(_0x5447d9,_0x29338b){return db['VoiceRecording'][_0x068a('0x4b')]()[_0x068a('0x28')](respondWithResult(_0x29338b,null))[_0x068a('0x49')](handleError(_0x29338b,null));};exports[_0x068a('0x4c')]=function(_0x48a83c,_0x420e6b,_0x31a41e){var _0x173110=require(_0x068a('0x4d'));var _0x5cf785=![];var _0x3cea2c={};if(_0x48a83c[_0x068a('0x33')][_0x068a('0x4e')]&&_0x48a83c['query'][_0x068a('0x4e')]===_0x068a('0x4f')){_0x3cea2c['uniqueid']=_0x48a83c[_0x068a('0x45')]['id'];}else{_0x3cea2c['id']=_0x48a83c[_0x068a('0x45')]['id'];}return db['VoiceRecording'][_0x068a('0x4a')]({'where':_0x3cea2c,'attributes':['id',_0x068a('0x50')],'raw':!![]})[_0x068a('0x28')](handleEntityNotFound(_0x420e6b,null))[_0x068a('0x28')](function(_0x3c7f2a){if(_0x3c7f2a){var _0x18be57=_0x3c7f2a[_0x068a('0x50')];var _0x24c96a=util[_0x068a('0x51')](_0x068a('0x52'),_0x18be57);if(fs[_0x068a('0x53')](_0x24c96a)){_0x5cf785=!![];return _0x173110[_0x068a('0x54')](_0x24c96a,_0x18be57,config[_0x068a('0x55')]['recording'])[_0x068a('0x28')](function(){return _0x3c7f2a;});}return _0x3c7f2a;}})['then'](function(_0x2351d4){if(_0x2351d4){var _0x28e5bf=_0x2351d4[_0x068a('0x50')];if(!fs[_0x068a('0x53')](_0x28e5bf)){throw new db[(_0x068a('0x56'))][(_0x068a('0x57'))](_0x068a('0x58'));}if(_0x2351d4[_0x068a('0x59')]){return _0x420e6b[_0x068a('0x4c')](_0x28e5bf,_0x2351d4['filename']+path[_0x068a('0x5a')](_0x28e5bf),function(){if(_0x5cf785){fs[_0x068a('0x5b')](_0x28e5bf);}});}else{return _0x420e6b[_0x068a('0x4c')](_0x28e5bf,function(_0xd21150){if(_0x5cf785){fs[_0x068a('0x5b')](_0x28e5bf);}});}}})[_0x068a('0x49')](function(_0x54e6e0){if(_0x54e6e0[_0x068a('0x5c')]===_0x068a('0x58')){_0x420e6b[_0x068a('0x1b')](0x194)[_0x068a('0x2d')](_0x068a('0x5d'));}else{return handleError(_0x420e6b,null);}});};exports[_0x068a('0x5e')]=function(_0x2f731a,_0x3ac2f9,_0x4d41e8){var _0x139805=require(_0x068a('0x4d'));var _0x1a5079=![];var _0x32f9c0={'$and':[db[_0x068a('0x5f')][_0x068a('0x3c')](db[_0x068a('0x5f')]['fn'](_0x068a('0x60'),db[_0x068a('0x5f')]['col'](_0x068a('0x4f'))),_0x2f731a[_0x068a('0x33')]['token'])]};if(_0x2f731a['query'][_0x068a('0x4e')]&&_0x2f731a[_0x068a('0x33')][_0x068a('0x4e')]===_0x068a('0x4f')){_0x32f9c0[_0x068a('0x61')][_0x068a('0x62')]({'uniqueid':_0x2f731a[_0x068a('0x45')]['id']});}else{_0x32f9c0[_0x068a('0x61')][_0x068a('0x62')]({'id':_0x2f731a[_0x068a('0x45')]['id']});}return db[_0x068a('0x2f')][_0x068a('0x4a')]({'where':_0x32f9c0,'attributes':['id',_0x068a('0x50')],'raw':!![]})[_0x068a('0x28')](handleEntityNotFound(_0x3ac2f9,null))[_0x068a('0x28')](function(_0x345ebf){if(_0x345ebf){var _0x1d797a=util['format'](_0x068a('0x52'),_0x345ebf[_0x068a('0x50')]);if(fs['existsSync'](_0x1d797a)){_0x1a5079=!![];return _0x139805[_0x068a('0x54')](_0x1d797a,_0x345ebf[_0x068a('0x50')],config[_0x068a('0x55')]['recording'])['then'](function(){return _0x345ebf;});}return _0x345ebf;}})[_0x068a('0x28')](function(_0xa4aeec){if(_0xa4aeec){if(!fs[_0x068a('0x53')](_0xa4aeec['value'])){throw new db[(_0x068a('0x56'))][(_0x068a('0x57'))]('VoiceRecording\x20not\x20found');}if(_0xa4aeec[_0x068a('0x59')]){return _0x3ac2f9[_0x068a('0x4c')](_0xa4aeec['value'],_0xa4aeec['filename']+path[_0x068a('0x5a')](_0xa4aeec[_0x068a('0x50')]),function(){if(_0x1a5079){fs['unlink'](_0xa4aeec[_0x068a('0x50')]);}});}else{return _0x3ac2f9[_0x068a('0x4c')](_0xa4aeec[_0x068a('0x50')],function(_0x2e1fca){if(_0x1a5079){fs['unlink'](_0xa4aeec[_0x068a('0x50')]);}});}}})[_0x068a('0x49')](handleError(_0x3ac2f9,null));};exports[_0x068a('0x29')]=function(_0x217838,_0x4d629e){return db[_0x068a('0x2f')][_0x068a('0x4a')]({'where':{'id':_0x217838['params']['id']}})['then'](function(_0x1fe999){if(_[_0x068a('0x63')](_0x1fe999)){throw new ReferenceError(_0x068a('0x64'));}return _0x1fe999;})['then'](function(_0x5ca555){var _0x18c1bb=_0x5ca555['value'];logger[_0x068a('0x65')](_0x068a('0x66'),_0x18c1bb);if(!_[_0x068a('0x63')](_0x5ca555['value'])&&fs[_0x068a('0x53')](_0x18c1bb)){logger['info'](_0x068a('0x67')+_0x18c1bb+_0x068a('0x68'));fs[_0x068a('0x69')](_0x18c1bb);}_0x18c1bb=_0x18c1bb+_0x068a('0x6a');if(!_[_0x068a('0x63')](_0x5ca555[_0x068a('0x50')])&&fs[_0x068a('0x53')](_0x18c1bb)){logger[_0x068a('0x65')](_0x068a('0x67')+_0x18c1bb+_0x068a('0x68'));fs[_0x068a('0x69')](_0x18c1bb);}return _0x5ca555;})[_0x068a('0x28')](function(_0x3fa434){if(!_0x3fa434)throw new InternalError();return _0x3fa434[_0x068a('0x29')]();})[_0x068a('0x28')](function(){_0x4d629e['status'](0xcc)[_0x068a('0x1c')]();})[_0x068a('0x49')](handleError(_0x4d629e,null));};function getBucketslist(_0x5fea85,_0x476665,_0x13b235){return new Promise(function(_0xc39fe8,_0x1f4767){var _0x408d53=new AWS['S3']({'accessKeyId':_0x476665,'secretAccessKey':_0x5fea85,'region':_0x13b235});_0x408d53[_0x068a('0x6b')]({},function(_0x3626ef,_0x1c5a44){if(_0x3626ef){return _0x1f4767(_0x3626ef);}else{return _0xc39fe8(_0x1c5a44);}});});}function createBucket(_0xfe9767,_0xc4e6bf,_0x1cee94,_0x597e35){return new Promise(function(_0xadf642,_0x16624f){var _0x2a2853=new AWS['S3']({'accessKeyId':_0xc4e6bf,'secretAccessKey':_0xfe9767,'region':_0x1cee94});_0x2a2853[_0x068a('0x6c')]({'Bucket':_0x597e35},function(_0x52f3d7,_0x32f90a){if(_0x52f3d7){return _0x16624f(_0x52f3d7);}else{return _0xadf642(_0x32f90a);}});});}function uploadFile(_0x19f461,_0x1773e6,_0xf25511,_0x492a99,_0x628cf,_0x5329fb){return new Promise(function(_0x1cc080,_0x3787bd){var _0x23d9fa=new AWS['S3']({'accessKeyId':_0x1773e6,'secretAccessKey':_0x19f461,'region':_0xf25511});_0x23d9fa['upload']({'Bucket':_0x492a99,'Key':_0x628cf,'Body':_0x5329fb},function(_0x47ac4e,_0x24c2f7){if(_0x47ac4e){return _0x3787bd(_0x47ac4e);}else{return _0x1cc080(_0x24c2f7);}});});}function startTranscribe(_0x553e99,_0x32cb5d,_0x4828e8,_0x59f50b,_0xa1e715,_0x462153){return new Promise(function(_0x3541d7,_0x38a24d){var _0x30c273=new AWS['TranscribeService']({'accessKeyId':_0x32cb5d,'secretAccessKey':_0x553e99,'region':_0x4828e8});_0x30c273[_0x068a('0x6d')]({'TranscriptionJobName':_0x59f50b,'LanguageCode':_0xa1e715,'Media':{'MediaFileUri':_0x462153}},function(_0x1176f2,_0x3e6231){if(_0x1176f2){return _0x38a24d(_0x1176f2);}else{return _0x3541d7(_0x3e6231);}});});}function transcribe(_0x58bb93,_0x25b42d,_0x4ce096,_0x2d7558,_0x444287,_0x2dd36e,_0x32201f){return new Promise(function(_0x15cc79,_0x4d7969){var _0x511eaf={};logger['info'](util[_0x068a('0x51')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x58bb93,_0x444287));return uploadFile(_0x25b42d,_0x4ce096,_0x2d7558,_0x444287,path[_0x068a('0x6e')](_0x2dd36e),fs[_0x068a('0x6f')](_0x2dd36e))['then'](function(_0x42af48){logger[_0x068a('0x65')](util['format']('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x58bb93,_0x444287,_0x42af48[_0x068a('0x70')]));_0x511eaf[_0x068a('0x71')]=_0x42af48[_0x068a('0x72')];_0x511eaf[_0x068a('0x73')]=_0x42af48[_0x068a('0x70')];logger[_0x068a('0x65')](util[_0x068a('0x51')](_0x068a('0x74'),_0x58bb93));return startTranscribe(_0x25b42d,_0x4ce096,_0x2d7558,uuidv4(),_0x32201f,_0x42af48[_0x068a('0x70')]);})[_0x068a('0x28')](function(_0x47da88){logger[_0x068a('0x65')](util[_0x068a('0x51')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x58bb93,_0x47da88['TranscriptionJob'][_0x068a('0x75')]));_0x511eaf[_0x068a('0x76')]=_0x47da88[_0x068a('0x77')][_0x068a('0x75')];_0x511eaf[_0x068a('0x78')]=_0x47da88[_0x068a('0x77')]['TranscriptionJobStatus'];return _0x15cc79(_0x511eaf);})['catch'](function(_0x42f6d3){return _0x4d7969(_0x42f6d3);});});}exports[_0x068a('0x79')]=function(_0x154373,_0x161138,_0x170bd9){var _0x167f63;var _0x1a95f9;var _0x4b72a8;var _0x3c3313=require(_0x068a('0x4d'));return db[_0x068a('0x2f')]['findOne']({'where':{'id':_0x154373['params']['id']}})[_0x068a('0x28')](function(_0x42e996){if(_0x42e996){var _0x144e68=util[_0x068a('0x51')]('%s.cypher',_0x42e996[_0x068a('0x50')]);if(fs[_0x068a('0x53')](_0x144e68)){cypher=!![];return _0x3c3313[_0x068a('0x54')](_0x144e68,_0x42e996[_0x068a('0x50')],config[_0x068a('0x55')][_0x068a('0x7a')])[_0x068a('0x28')](function(){return _0x42e996;});}return _0x42e996;}})['then'](function(_0x322d04){if(!_0x322d04){throw new db['Sequelize'][(_0x068a('0x57'))](_0x068a('0x7b'));}_0x1a95f9=_0x322d04;return db[_0x068a('0x7c')][_0x068a('0x7d')]({'where':{'id':0x1}});})[_0x068a('0x28')](handleEntityNotFound(_0x161138,null))[_0x068a('0x28')](function(_0x2673cd){if(_0x2673cd){_0x167f63=_0x2673cd;if(!_0x167f63[_0x068a('0x7e')]||!_0x167f63[_0x068a('0x7f')]||!_0x167f63[_0x068a('0x80')]||!_0x167f63[_0x068a('0x81')]||!_0x167f63[_0x068a('0x71')]){throw new db['Sequelize'][(_0x068a('0x57'))](_0x068a('0x82'));}if(_0x154373[_0x068a('0x48')][_0x068a('0x83')]&&(!_0x167f63[_0x068a('0x84')]||!_0x167f63[_0x068a('0x85')]||!_0x167f63[_0x068a('0x86')]||!_0x167f63['language']||!_0x167f63[_0x068a('0x71')])){throw new db[(_0x068a('0x56'))][(_0x068a('0x57'))](_0x068a('0x87'));}return db[_0x068a('0x88')][_0x068a('0x7d')]({'where':{'id':_0x167f63[_0x068a('0x7f')]}});}})['then'](function(_0x2711ee){if(!_0x2711ee){throw new db[(_0x068a('0x56'))][(_0x068a('0x57'))](_0x068a('0x89'));}if(!_0x2711ee[_0x068a('0x8a')]||!_0x2711ee[_0x068a('0x8b')]){throw new db[(_0x068a('0x56'))][(_0x068a('0x57'))](_0x068a('0x8c'));}_0x4b72a8=_0x2711ee;return getBucketslist(_0x4b72a8['data1'],_0x4b72a8[_0x068a('0x8b')],_0x167f63[_0x068a('0x80')]);})[_0x068a('0x28')](function(_0x51b50d){if(_0x51b50d&&_0x51b50d[_0x068a('0x8d')]){var _0x33d66b=_[_0x068a('0x4a')](_0x51b50d[_0x068a('0x8d')],function(_0x3d95cb){return _0x3d95cb[_0x068a('0x8e')]===_0x167f63[_0x068a('0x71')];});if(!_0x33d66b){logger[_0x068a('0x65')](util[_0x068a('0x51')](_0x068a('0x8f'),_0x154373['params']['id'],_0x167f63['bucket']));return createBucket(_0x4b72a8['data1'],_0x4b72a8[_0x068a('0x8b')],_0x167f63['transcribeRegion'],_0x167f63[_0x068a('0x71')]);}logger[_0x068a('0x65')](util['format'](_0x068a('0x90'),_0x154373['params']['id'],_0x167f63[_0x068a('0x71')]));return;}})['then'](function(_0x16b378){if(_0x1a95f9[_0x068a('0x78')]==='NEW'){return transcribe(_0x154373[_0x068a('0x45')]['id'],_0x4b72a8[_0x068a('0x8a')],_0x4b72a8[_0x068a('0x8b')],_0x167f63['transcribeRegion'],_0x167f63[_0x068a('0x71')],_0x1a95f9[_0x068a('0x50')],_0x167f63[_0x068a('0x81')]);}else{logger[_0x068a('0x65')](util[_0x068a('0x51')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x154373[_0x068a('0x45')]['id']));return{'transcribeStatus':_0x068a('0x91')};}})[_0x068a('0x28')](function(_0x236303){if(_0x236303){_0x236303[_0x068a('0x92')]=_0x154373[_0x068a('0x48')][_0x068a('0x83')];return _0x1a95f9[_0x068a('0x93')](_0x236303);}})['then'](respondWithResult(_0x161138,null))[_0x068a('0x49')](handleError(_0x161138,null));};function writeFile(_0x15efce,_0x460627){return new Promise(function(_0x4a0e95,_0x46bb3d){fs[_0x068a('0x94')](_0x460627,_0x15efce,function(_0x142443,_0x4f8b30){if(_0x142443){return _0x46bb3d(_0x142443);}else{return _0x4a0e95(_0x4f8b30);}});});}exports['downloadTranscribe']=function(_0x524a15,_0x566e12,_0x375290){return db[_0x068a('0x2f')][_0x068a('0x7d')]({'where':{'id':_0x524a15[_0x068a('0x45')]['id']}})[_0x068a('0x28')](handleEntityNotFound(_0x566e12))[_0x068a('0x28')](function(_0xeaf671){if(_0xeaf671&&_0xeaf671[_0x068a('0x95')]){var _0x35bbeb=_0xeaf671[_0x068a('0x95')];var _0x5b598b=config[_0x068a('0x96')]+_0x068a('0x97')+_0xeaf671['id']+_0x068a('0x98');if(fs[_0x068a('0x53')](_0x5b598b)){return _0x5b598b;}return writeFile(_0x35bbeb,_0x5b598b)['then'](function(){return _0x5b598b;});}else{throw new db[(_0x068a('0x56'))]['ValidationError']('Transcript\x20not\x20available');}})[_0x068a('0x28')](function(_0x27b890){return _0x566e12[_0x068a('0x4c')](_0x27b890);})['catch'](handleError(_0x566e12));}; \ No newline at end of file +var _0x3291=['limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','then','rows','catch','show','include','create','body','find','params','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','recording','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','$and','push','%s.cypher','ValidationError','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','runTranscribe','findOne','Sequelize','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','runSentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x478849,_0x50b08b){var _0x1a6c01=function(_0x5b8c6b){while(--_0x5b8c6b){_0x478849['push'](_0x478849['shift']());}};_0x1a6c01(++_0x50b08b);}(_0x3291,0x11b));var _0x1329=function(_0x5e3b77,_0x475652){_0x5e3b77=_0x5e3b77-0x0;var _0x405d3a=_0x3291[_0x5e3b77];return _0x405d3a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1329('0x0'));var zipdir=require(_0x1329('0x1'));var jsonpatch=require(_0x1329('0x2'));var rp=require(_0x1329('0x3'));var moment=require(_0x1329('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1329('0x5'));var util=require(_0x1329('0x6'));var path=require(_0x1329('0x7'));var sox=require(_0x1329('0x8'));var csv=require(_0x1329('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1329('0xa'));var _=require('lodash');var squel=require(_0x1329('0xb'));var crypto=require(_0x1329('0xc'));var jsforce=require(_0x1329('0xd'));var deskjs=require(_0x1329('0xe'));var toCsv=require(_0x1329('0x9'));var querystring=require(_0x1329('0xf'));var Papa=require(_0x1329('0x10'));var AWS=require(_0x1329('0x11'));var uuidv4=require(_0x1329('0x12'));var Redis=require(_0x1329('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1329('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1329('0x15'));var logger=require(_0x1329('0x16'))(_0x1329('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1329('0x18'));var db=require(_0x1329('0x19'))['db'];function respondWithStatusCode(_0x1b1045,_0x2208ab){_0x2208ab=_0x2208ab||0xcc;return function(_0x3212a0){if(_0x3212a0){return _0x1b1045[_0x1329('0x1a')](_0x2208ab);}return _0x1b1045[_0x1329('0x1b')](_0x2208ab)[_0x1329('0x1c')]();};}function respondWithResult(_0x175422,_0x1c8c0c){_0x1c8c0c=_0x1c8c0c||0xc8;return function(_0x5453cf){if(_0x5453cf){return _0x175422[_0x1329('0x1b')](_0x1c8c0c)[_0x1329('0x1d')](_0x5453cf);}};}function respondWithFilteredResult(_0x161d24,_0x124e99){return function(_0x43b32d){if(_0x43b32d){var _0x4b93b5=typeof _0x124e99['offset']===_0x1329('0x1e')&&typeof _0x124e99[_0x1329('0x1f')]===_0x1329('0x1e');var _0x22b791=_0x43b32d[_0x1329('0x20')];var _0x2a16da=_0x4b93b5?0x0:_0x124e99[_0x1329('0x21')];var _0x2ac809=_0x4b93b5?_0x43b32d[_0x1329('0x20')]:_0x124e99[_0x1329('0x21')]+_0x124e99[_0x1329('0x1f')];var _0x36f75a;if(_0x2ac809>=_0x22b791){_0x2ac809=_0x22b791;_0x36f75a=0xc8;}else{_0x36f75a=0xce;}_0x161d24[_0x1329('0x1b')](_0x36f75a);return _0x161d24[_0x1329('0x22')](_0x1329('0x23'),_0x2a16da+'-'+_0x2ac809+'/'+_0x22b791)['json'](_0x43b32d);}return null;};}function patchUpdates(_0x3f84dd){return function(_0x492796){try{jsonpatch[_0x1329('0x24')](_0x492796,_0x3f84dd,!![]);}catch(_0x428703){return BPromise[_0x1329('0x25')](_0x428703);}return _0x492796[_0x1329('0x26')]();};}function saveUpdates(_0x5e5391,_0x39444c){return function(_0x484215){if(_0x484215){return _0x484215[_0x1329('0x27')](_0x5e5391)['then'](function(_0x1dbbfe){return _0x1dbbfe;});}return null;};}function removeEntity(_0x3b638f,_0x43caff){return function(_0x1523d6){if(_0x1523d6){return _0x1523d6[_0x1329('0x28')]()['then'](function(){_0x3b638f[_0x1329('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45343a,_0xd16215){return function(_0x4e714e){if(!_0x4e714e){_0x45343a['sendStatus'](0x194);}return _0x4e714e;};}function handleError(_0x282497,_0x453282){_0x453282=_0x453282||0x1f4;return function(_0x19e349){logger['error'](_0x19e349[_0x1329('0x29')]);if(_0x19e349[_0x1329('0x2a')]){delete _0x19e349[_0x1329('0x2a')];}_0x282497['status'](_0x453282)[_0x1329('0x2b')](_0x19e349);};}exports[_0x1329('0x2c')]=function(_0x153a6f,_0x4a73b2){var _0x124ed1={},_0xb0628d={},_0xa8463c={'count':0x0,'rows':[]};var _0x2f64f8=_[_0x1329('0x2d')](db[_0x1329('0x2e')][_0x1329('0x2f')],function(_0x30bf8b){return{'name':_0x30bf8b[_0x1329('0x30')],'type':_0x30bf8b[_0x1329('0x31')][_0x1329('0x32')]};});_0xb0628d[_0x1329('0x33')]=_[_0x1329('0x34')](_[_0x1329('0x2d')](_0x2f64f8,_0x1329('0x2a')),[_0x1329('0x35')]);_0xb0628d['query']=_[_0x1329('0x36')](_0x153a6f['query']);_0xb0628d[_0x1329('0x37')]=_[_0x1329('0x38')](_0xb0628d['model'],_0xb0628d[_0x1329('0x39')]);_0x124ed1[_0x1329('0x3a')]=_['intersection'](_0xb0628d['model'],qs[_0x1329('0x3b')](_0x153a6f[_0x1329('0x39')]['fields']));_0x124ed1[_0x1329('0x3a')]=_0x124ed1['attributes'][_0x1329('0x3c')]?_0x124ed1[_0x1329('0x3a')]:_0xb0628d['model'];if(!_0x153a6f[_0x1329('0x39')][_0x1329('0x3d')](_0x1329('0x3e'))){_0x124ed1['limit']=qs[_0x1329('0x1f')](_0x153a6f['query'][_0x1329('0x1f')]);_0x124ed1[_0x1329('0x21')]=qs['offset'](_0x153a6f[_0x1329('0x39')]['offset']);}_0x124ed1[_0x1329('0x3f')]=qs[_0x1329('0x40')](_0x153a6f[_0x1329('0x39')][_0x1329('0x40')]);_0x124ed1[_0x1329('0x41')]=qs[_0x1329('0x37')](_['pick'](_0x153a6f[_0x1329('0x39')],_0xb0628d['filters']),_0x2f64f8);if(_0x153a6f[_0x1329('0x39')][_0x1329('0x42')]){_0x124ed1['where']=_['merge'](_0x124ed1['where'],{'$or':_[_0x1329('0x2d')](_0x2f64f8,function(_0x26557c){if(_0x26557c[_0x1329('0x31')]!==_0x1329('0x43')){var _0x3461fc={};_0x3461fc[_0x26557c['name']]={'$like':'%'+_0x153a6f[_0x1329('0x39')][_0x1329('0x42')]+'%'};return _0x3461fc;}})});}_0x124ed1=_[_0x1329('0x44')]({},_0x124ed1,_0x153a6f[_0x1329('0x45')]);var _0x42df2c={'where':_0x124ed1[_0x1329('0x41')]};return db[_0x1329('0x2e')]['count'](_0x42df2c)['then'](function(_0x1b388a){_0xa8463c[_0x1329('0x20')]=_0x1b388a;if(_0x153a6f[_0x1329('0x39')][_0x1329('0x46')]){_0x124ed1['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x1329('0x47')](_0x124ed1);})[_0x1329('0x48')](function(_0x429e3e){_0xa8463c[_0x1329('0x49')]=_0x429e3e;return _0xa8463c;})['then'](respondWithFilteredResult(_0x4a73b2,_0x124ed1))[_0x1329('0x4a')](handleError(_0x4a73b2,null));};exports[_0x1329('0x4b')]=function(_0x37be74,_0x137742){var _0x432a7e={'raw':![],'where':{'id':_0x37be74['params']['id']}},_0x2b4160={};_0x2b4160[_0x1329('0x33')]=_[_0x1329('0x36')](db['VoiceRecording'][_0x1329('0x2f')]);_0x2b4160[_0x1329('0x39')]=_[_0x1329('0x36')](_0x37be74[_0x1329('0x39')]);_0x2b4160['filters']=_['intersection'](_0x2b4160['model'],_0x2b4160[_0x1329('0x39')]);_0x432a7e[_0x1329('0x3a')]=_['intersection'](_0x2b4160[_0x1329('0x33')],qs[_0x1329('0x3b')](_0x37be74[_0x1329('0x39')][_0x1329('0x3b')]));_0x432a7e[_0x1329('0x3a')]=_0x432a7e['attributes']['length']?_0x432a7e['attributes']:_0x2b4160['model'];if(_0x37be74['query'][_0x1329('0x46')]){_0x432a7e[_0x1329('0x4c')]=[{'all':!![]}];}_0x432a7e=_['merge']({},_0x432a7e,_0x37be74[_0x1329('0x45')]);return db[_0x1329('0x2e')]['find'](_0x432a7e)['then'](handleEntityNotFound(_0x137742,null))[_0x1329('0x48')](respondWithResult(_0x137742,null))[_0x1329('0x4a')](handleError(_0x137742,null));};exports[_0x1329('0x4d')]=function(_0x1175d1,_0x379feb){return db[_0x1329('0x2e')][_0x1329('0x4d')](_0x1175d1[_0x1329('0x4e')],{})[_0x1329('0x48')](respondWithResult(_0x379feb,0xc9))[_0x1329('0x4a')](handleError(_0x379feb,null));};exports['update']=function(_0x239b4b,_0x456624){if(_0x239b4b[_0x1329('0x4e')]['id']){delete _0x239b4b[_0x1329('0x4e')]['id'];}return db[_0x1329('0x2e')][_0x1329('0x4f')]({'where':{'id':_0x239b4b[_0x1329('0x50')]['id']}})[_0x1329('0x48')](handleEntityNotFound(_0x456624,null))['then'](saveUpdates(_0x239b4b['body'],null))['then'](respondWithResult(_0x456624,null))['catch'](handleError(_0x456624,null));};exports[_0x1329('0x51')]=function(_0x152413,_0x2d145a){return db[_0x1329('0x2e')][_0x1329('0x51')]()[_0x1329('0x48')](respondWithResult(_0x2d145a,null))[_0x1329('0x4a')](handleError(_0x2d145a,null));};exports[_0x1329('0x52')]=function(_0x48fc0c,_0x566b08,_0x43e3b6){var _0x177b4c=require(_0x1329('0x53'));var _0xfd21a4=![];var _0x1aacca={};if(_0x48fc0c['query']['type']&&_0x48fc0c['query'][_0x1329('0x31')]===_0x1329('0x54')){_0x1aacca['uniqueid']=_0x48fc0c[_0x1329('0x50')]['id'];}else{_0x1aacca['id']=_0x48fc0c[_0x1329('0x50')]['id'];}return db[_0x1329('0x2e')]['find']({'where':_0x1aacca,'attributes':['id',_0x1329('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x566b08,null))[_0x1329('0x48')](function(_0x4bf735){if(_0x4bf735){var _0x348971=_0x4bf735[_0x1329('0x55')];var _0x49e338=util[_0x1329('0x35')]('%s.cypher',_0x348971);if(fs[_0x1329('0x56')](_0x49e338)){_0xfd21a4=!![];return _0x177b4c[_0x1329('0x57')](_0x49e338,_0x348971,config[_0x1329('0x58')][_0x1329('0x59')])[_0x1329('0x48')](function(){return _0x4bf735;});}return _0x4bf735;}})[_0x1329('0x48')](function(_0x333655){if(_0x333655){var _0x395ccc=_0x333655[_0x1329('0x55')];if(!fs[_0x1329('0x56')](_0x395ccc)){throw new db['Sequelize']['ValidationError'](_0x1329('0x5a'));}if(_0x333655[_0x1329('0x5b')]){return _0x566b08[_0x1329('0x52')](_0x395ccc,_0x333655[_0x1329('0x5b')]+path[_0x1329('0x5c')](_0x395ccc),function(){if(_0xfd21a4){fs[_0x1329('0x5d')](_0x395ccc);}});}else{return _0x566b08[_0x1329('0x52')](_0x395ccc,function(_0x248687){if(_0xfd21a4){fs[_0x1329('0x5d')](_0x395ccc);}});}}})[_0x1329('0x4a')](function(_0x5b762f){if(_0x5b762f[_0x1329('0x5e')]===_0x1329('0x5a')){_0x566b08[_0x1329('0x1b')](0x194)['send'](_0x1329('0x5f'));}else{return handleError(_0x566b08,null);}});};exports[_0x1329('0x60')]=function(_0x2b3391,_0x17af88,_0x2cf322){var _0x1ad8b0=require(_0x1329('0x53'));var _0x215c72=![];var _0x55ba4e={'$and':[db[_0x1329('0x61')]['where'](db['sequelize']['fn'](_0x1329('0x62'),db[_0x1329('0x61')][_0x1329('0x63')](_0x1329('0x54'))),_0x2b3391['query']['token'])]};if(_0x2b3391[_0x1329('0x39')][_0x1329('0x31')]&&_0x2b3391['query']['type']==='uniqueid'){_0x55ba4e[_0x1329('0x64')]['push']({'uniqueid':_0x2b3391[_0x1329('0x50')]['id']});}else{_0x55ba4e['$and'][_0x1329('0x65')]({'id':_0x2b3391[_0x1329('0x50')]['id']});}return db[_0x1329('0x2e')][_0x1329('0x4f')]({'where':_0x55ba4e,'attributes':['id',_0x1329('0x55')],'raw':!![]})[_0x1329('0x48')](handleEntityNotFound(_0x17af88,null))['then'](function(_0x55c49f){if(_0x55c49f){var _0x27b4dc=util['format'](_0x1329('0x66'),_0x55c49f[_0x1329('0x55')]);if(fs[_0x1329('0x56')](_0x27b4dc)){_0x215c72=!![];return _0x1ad8b0[_0x1329('0x57')](_0x27b4dc,_0x55c49f[_0x1329('0x55')],config[_0x1329('0x58')][_0x1329('0x59')])['then'](function(){return _0x55c49f;});}return _0x55c49f;}})['then'](function(_0x5ec29b){if(_0x5ec29b){if(!fs[_0x1329('0x56')](_0x5ec29b[_0x1329('0x55')])){throw new db['Sequelize'][(_0x1329('0x67'))](_0x1329('0x5a'));}if(_0x5ec29b[_0x1329('0x5b')]){return _0x17af88[_0x1329('0x52')](_0x5ec29b[_0x1329('0x55')],_0x5ec29b[_0x1329('0x5b')]+path['extname'](_0x5ec29b[_0x1329('0x55')]),function(){if(_0x215c72){fs[_0x1329('0x5d')](_0x5ec29b[_0x1329('0x55')]);}});}else{return _0x17af88[_0x1329('0x52')](_0x5ec29b['value'],function(_0x3c23bc){if(_0x215c72){fs[_0x1329('0x5d')](_0x5ec29b[_0x1329('0x55')]);}});}}})[_0x1329('0x4a')](handleError(_0x17af88,null));};exports[_0x1329('0x28')]=function(_0x5d8d44,_0x204880){return db[_0x1329('0x2e')][_0x1329('0x4f')]({'where':{'id':_0x5d8d44['params']['id']}})[_0x1329('0x48')](function(_0x4087ab){if(_[_0x1329('0x68')](_0x4087ab)){throw new ReferenceError(_0x1329('0x69'));}return _0x4087ab;})[_0x1329('0x48')](function(_0x5b0975){var _0x189b21=_0x5b0975['value'];logger['info'](_0x1329('0x6a'),_0x189b21);if(!_['isNil'](_0x5b0975[_0x1329('0x55')])&&fs[_0x1329('0x56')](_0x189b21)){logger[_0x1329('0x6b')](_0x1329('0x6c')+_0x189b21+_0x1329('0x6d'));fs[_0x1329('0x6e')](_0x189b21);}_0x189b21=_0x189b21+_0x1329('0x6f');if(!_[_0x1329('0x68')](_0x5b0975[_0x1329('0x55')])&&fs['existsSync'](_0x189b21)){logger['info'](_0x1329('0x6c')+_0x189b21+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1329('0x6e')](_0x189b21);}return _0x5b0975;})[_0x1329('0x48')](function(_0x261e6a){if(!_0x261e6a)throw new InternalError();return _0x261e6a['destroy']();})[_0x1329('0x48')](function(){_0x204880['status'](0xcc)[_0x1329('0x1c')]();})['catch'](handleError(_0x204880,null));};function getBucketslist(_0x2bc849,_0x2a7462,_0x377b19){return new Promise(function(_0x274966,_0x4eeb45){var _0x40131f=new AWS['S3']({'accessKeyId':_0x2a7462,'secretAccessKey':_0x2bc849,'region':_0x377b19});_0x40131f['listBuckets']({},function(_0x4ead77,_0x401839){if(_0x4ead77){return _0x4eeb45(_0x4ead77);}else{return _0x274966(_0x401839);}});});}function createBucket(_0x454c29,_0x25dadb,_0x4af4a6,_0x3199ab){return new Promise(function(_0x40e9e9,_0x558b40){var _0x2e8218=new AWS['S3']({'accessKeyId':_0x25dadb,'secretAccessKey':_0x454c29,'region':_0x4af4a6});_0x2e8218[_0x1329('0x70')]({'Bucket':_0x3199ab},function(_0x3fecd2,_0x3ef93b){if(_0x3fecd2){return _0x558b40(_0x3fecd2);}else{return _0x40e9e9(_0x3ef93b);}});});}function uploadFile(_0x5d3181,_0x441eef,_0x46f0b7,_0x3cd252,_0x2a6635,_0x5ae57c){return new Promise(function(_0x5fc192,_0x392417){var _0x35bfc5=new AWS['S3']({'accessKeyId':_0x441eef,'secretAccessKey':_0x5d3181,'region':_0x46f0b7});_0x35bfc5['upload']({'Bucket':_0x3cd252,'Key':_0x2a6635,'Body':_0x5ae57c},function(_0x1a4437,_0x5bef33){if(_0x1a4437){return _0x392417(_0x1a4437);}else{return _0x5fc192(_0x5bef33);}});});}function startTranscribe(_0x5e1123,_0x593735,_0x4ac938,_0x306604,_0x3737bf,_0x35f388){return new Promise(function(_0x2c9dbc,_0x5263eb){var _0x4e51bc=new AWS[(_0x1329('0x71'))]({'accessKeyId':_0x593735,'secretAccessKey':_0x5e1123,'region':_0x4ac938});_0x4e51bc[_0x1329('0x72')]({'TranscriptionJobName':_0x306604,'LanguageCode':_0x3737bf,'Media':{'MediaFileUri':_0x35f388}},function(_0x7376a1,_0x2b4699){if(_0x7376a1){return _0x5263eb(_0x7376a1);}else{return _0x2c9dbc(_0x2b4699);}});});}function transcribe(_0x2aa9e0,_0xe7322a,_0x2c4fbb,_0x5b47dc,_0x380dbf,_0x2a3e90,_0x4e90f3){return new Promise(function(_0xbdfde4,_0x5d6ae1){var _0x397efd={};logger[_0x1329('0x6b')](util['format'](_0x1329('0x73'),_0x2aa9e0,_0x380dbf));return uploadFile(_0xe7322a,_0x2c4fbb,_0x5b47dc,_0x380dbf,path[_0x1329('0x74')](_0x2a3e90),fs[_0x1329('0x75')](_0x2a3e90))['then'](function(_0x5b0ff4){logger['info'](util[_0x1329('0x35')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x2aa9e0,_0x380dbf,_0x5b0ff4[_0x1329('0x76')]));_0x397efd[_0x1329('0x77')]=_0x5b0ff4[_0x1329('0x78')];_0x397efd[_0x1329('0x79')]=_0x5b0ff4[_0x1329('0x76')];logger[_0x1329('0x6b')](util['format'](_0x1329('0x7a'),_0x2aa9e0));return startTranscribe(_0xe7322a,_0x2c4fbb,_0x5b47dc,uuidv4(),_0x4e90f3,_0x5b0ff4[_0x1329('0x76')]);})['then'](function(_0x5506b4){logger[_0x1329('0x6b')](util[_0x1329('0x35')](_0x1329('0x7b'),_0x2aa9e0,_0x5506b4['TranscriptionJob'][_0x1329('0x7c')]));_0x397efd[_0x1329('0x7d')]=_0x5506b4[_0x1329('0x7e')][_0x1329('0x7c')];_0x397efd[_0x1329('0x7f')]=_0x5506b4['TranscriptionJob']['TranscriptionJobStatus'];return _0xbdfde4(_0x397efd);})[_0x1329('0x4a')](function(_0x4fa9df){return _0x5d6ae1(_0x4fa9df);});});}exports[_0x1329('0x80')]=function(_0x231d18,_0x5ab88b,_0x466075){var _0x36d7f4;var _0x41f980;var _0x3326d9;var _0x52f217=require('../../components/encryptor');return db[_0x1329('0x2e')][_0x1329('0x81')]({'where':{'id':_0x231d18[_0x1329('0x50')]['id']}})[_0x1329('0x48')](function(_0x1ebaaf){if(_0x1ebaaf){var _0x4e53b6=util[_0x1329('0x35')](_0x1329('0x66'),_0x1ebaaf[_0x1329('0x55')]);if(fs['existsSync'](_0x4e53b6)){cypher=!![];return _0x52f217[_0x1329('0x57')](_0x4e53b6,_0x1ebaaf[_0x1329('0x55')],config['secrets'][_0x1329('0x59')])[_0x1329('0x48')](function(){return _0x1ebaaf;});}return _0x1ebaaf;}})['then'](function(_0x25d782){if(!_0x25d782){throw new db[(_0x1329('0x82'))][(_0x1329('0x67'))](_0x1329('0x83'));}_0x41f980=_0x25d782;return db[_0x1329('0x84')][_0x1329('0x81')]({'where':{'id':0x1}});})[_0x1329('0x48')](handleEntityNotFound(_0x5ab88b,null))[_0x1329('0x48')](function(_0x153a99){if(_0x153a99){_0x36d7f4=_0x153a99;if(!_0x36d7f4[_0x1329('0x85')]||!_0x36d7f4[_0x1329('0x86')]||!_0x36d7f4[_0x1329('0x87')]||!_0x36d7f4[_0x1329('0x88')]||!_0x36d7f4[_0x1329('0x77')]){throw new db['Sequelize']['ValidationError']('Transcribe\x20not\x20configured');}if(_0x231d18[_0x1329('0x4e')][_0x1329('0x89')]&&(!_0x36d7f4['sentiment']||!_0x36d7f4[_0x1329('0x8a')]||!_0x36d7f4['sentimentRegion']||!_0x36d7f4[_0x1329('0x88')]||!_0x36d7f4[_0x1329('0x77')])){throw new db['Sequelize'][(_0x1329('0x67'))](_0x1329('0x8b'));}return db[_0x1329('0x8c')][_0x1329('0x81')]({'where':{'id':_0x36d7f4[_0x1329('0x86')]}});}})[_0x1329('0x48')](function(_0x13f3f1){if(!_0x13f3f1){throw new db[(_0x1329('0x82'))][(_0x1329('0x67'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x13f3f1[_0x1329('0x8d')]||!_0x13f3f1[_0x1329('0x8e')]){throw new db['Sequelize'][(_0x1329('0x67'))](_0x1329('0x8f'));}_0x3326d9=_0x13f3f1;return getBucketslist(_0x3326d9['data1'],_0x3326d9['data2'],_0x36d7f4[_0x1329('0x87')]);})['then'](function(_0x90c488){if(_0x90c488&&_0x90c488[_0x1329('0x90')]){var _0xafa2b3=_[_0x1329('0x4f')](_0x90c488[_0x1329('0x90')],function(_0x22fad5){return _0x22fad5[_0x1329('0x91')]===_0x36d7f4[_0x1329('0x77')];});if(!_0xafa2b3){logger[_0x1329('0x6b')](util[_0x1329('0x35')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x231d18[_0x1329('0x50')]['id'],_0x36d7f4[_0x1329('0x77')]));return createBucket(_0x3326d9[_0x1329('0x8d')],_0x3326d9['data2'],_0x36d7f4['transcribeRegion'],_0x36d7f4[_0x1329('0x77')]);}logger[_0x1329('0x6b')](util[_0x1329('0x35')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x231d18[_0x1329('0x50')]['id'],_0x36d7f4[_0x1329('0x77')]));return;}})[_0x1329('0x48')](function(_0x18f886){if(_0x41f980[_0x1329('0x7f')]===_0x1329('0x92')){return transcribe(_0x231d18[_0x1329('0x50')]['id'],_0x3326d9[_0x1329('0x8d')],_0x3326d9['data2'],_0x36d7f4[_0x1329('0x87')],_0x36d7f4['bucket'],_0x41f980[_0x1329('0x55')],_0x36d7f4[_0x1329('0x88')]);}else{logger['info'](util['format'](_0x1329('0x93'),_0x231d18[_0x1329('0x50')]['id']));return{'transcribeStatus':_0x1329('0x94')};}})[_0x1329('0x48')](function(_0x5a0224){if(_0x5a0224){_0x5a0224[_0x1329('0x95')]=_0x231d18[_0x1329('0x4e')][_0x1329('0x89')];return _0x41f980[_0x1329('0x96')](_0x5a0224);}})[_0x1329('0x48')](respondWithResult(_0x5ab88b,null))[_0x1329('0x4a')](handleError(_0x5ab88b,null));};function writeFile(_0x36818e,_0x27a9c0){return new Promise(function(_0x1cb666,_0x3e8f34){fs[_0x1329('0x97')](_0x27a9c0,_0x36818e,function(_0xf0d09f,_0x235764){if(_0xf0d09f){return _0x3e8f34(_0xf0d09f);}else{return _0x1cb666(_0x235764);}});});}exports[_0x1329('0x98')]=function(_0x4e87c7,_0x1f1902,_0x28d913){return db[_0x1329('0x2e')][_0x1329('0x81')]({'where':{'id':_0x4e87c7[_0x1329('0x50')]['id']}})[_0x1329('0x48')](handleEntityNotFound(_0x1f1902))[_0x1329('0x48')](function(_0x1d6723){if(_0x1d6723&&_0x1d6723['fileText']){var _0x5b565c=_0x1d6723[_0x1329('0x99')];var _0x19ccad=config[_0x1329('0x9a')]+_0x1329('0x9b')+_0x1d6723['id']+_0x1329('0x9c');if(fs[_0x1329('0x56')](_0x19ccad)){return _0x19ccad;}return writeFile(_0x5b565c,_0x19ccad)[_0x1329('0x48')](function(){return _0x19ccad;});}else{throw new db[(_0x1329('0x82'))][(_0x1329('0x67'))]('Transcript\x20not\x20available');}})['then'](function(_0x456912){return _0x1f1902[_0x1329('0x52')](_0x456912);})['catch'](handleError(_0x1f1902));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 2ddb23a..0fa7b60 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 _0x938c=['uniqueid','transcribeStatus','./voiceRecording.attributes','exports','voice_recordings'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0x938c,0x11f));var _0xc938=function(_0x36bdb8,_0x1b2c3f){_0x36bdb8=_0x36bdb8-0x0;var _0x9ee322=_0x938c[_0x36bdb8];return _0x9ee322;};'use strict';var attributes=require(_0xc938('0x0'));module[_0xc938('0x1')]=function(_0x537ecb,_0x29f18b){return _0x537ecb['define']('VoiceRecording',attributes,{'tableName':_0xc938('0x2'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc938('0x3')]},{'name':_0xc938('0x4'),'fields':[_0xc938('0x4')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc43c=['uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording'];(function(_0x562a19,_0xd8fa22){var _0x37c8e3=function(_0x569818){while(--_0x569818){_0x562a19['push'](_0x562a19['shift']());}};_0x37c8e3(++_0xd8fa22);}(_0xc43c,0x152));var _0xcc43=function(_0x510257,_0x424d7b){_0x510257=_0x510257-0x0;var _0x129592=_0xc43c[_0x510257];return _0x129592;};'use strict';var attributes=require(_0xcc43('0x0'));module[_0xcc43('0x1')]=function(_0x41a7fe,_0x3d90f5){return _0x41a7fe[_0xcc43('0x2')](_0xcc43('0x3'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xcc43('0x4'),'fields':[_0xcc43('0x4')]},{'name':'transcribeStatus','fields':[_0xcc43('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index bf530ed..25868d6 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 _0x01d9=['error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','body','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5ba513,_0x459c3b){var _0x1132a0=function(_0x2fe943){while(--_0x2fe943){_0x5ba513['push'](_0x5ba513['shift']());}};_0x1132a0(++_0x459c3b);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c9ac8,_0x21e1d7,_0x12c39f){return new BPromise(function(_0x313f85,_0x39fc94){return client[_0x901d('0xc')](_0x6c9ac8,_0x12c39f)[_0x901d('0xd')](function(_0x15076e){logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));logger[_0x901d('0x11')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x21e1d7,_0x901d('0x10'),JSON['stringify'](_0x15076e));if(_0x15076e[_0x901d('0x12')]){if(_0x15076e[_0x901d('0x12')][_0x901d('0x13')]===0x1f4){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e['error'][_0x901d('0x14')]);return _0x39fc94(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e[_0x901d('0x12')]['message']);return _0x313f85(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}else{logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));_0x313f85(_0x15076e[_0x901d('0x15')][_0x901d('0x14')]);}})[_0x901d('0x16')](function(_0x3368fc){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x3368fc);_0x39fc94(_0x3368fc);});});}exports[_0x901d('0x17')]=function(_0x285353){var _0x403db9=this;return new Promise(function(_0x38f42b,_0x414171){return db[_0x901d('0x18')][_0x901d('0x19')](_0x285353['body'],{'raw':_0x285353[_0x901d('0x1a')]?_0x285353[_0x901d('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x285353['options']?_0x285353['options']['where']||null:null,'attributes':_0x285353[_0x901d('0x1a')]?_0x285353[_0x901d('0x1a')]['attributes']||null:null,'limit':_0x285353[_0x901d('0x1a')]?_0x285353[_0x901d('0x1a')]['limit']||null:null})[_0x901d('0xd')](function(_0x53ee69){logger[_0x901d('0xe')](_0x901d('0x17'),_0x285353);logger[_0x901d('0x11')](_0x901d('0x17'),_0x285353,JSON[_0x901d('0x1b')](_0x53ee69));_0x38f42b(_0x53ee69);})[_0x901d('0x16')](function(_0x4c1318){logger[_0x901d('0x12')](_0x901d('0x17'),_0x4c1318[_0x901d('0x14')],_0x285353);_0x414171(_0x403db9[_0x901d('0x12')](0x1f4,_0x4c1318['message']));});});};exports[_0x901d('0x1c')]=function(_0x23fd43){var _0x27f4ca=this;return new Promise(function(_0x3cbe43,_0x133bff){var _0x56e4ec=require(_0x901d('0x1d'));var _0xc52d0f;return db[_0x901d('0x1e')][_0x901d('0x1f')]({'attributes':['id',_0x901d('0x20')],'where':{'id':0x1},'raw':!![]})[_0x901d('0xd')](function(_0x48e86e){_0xc52d0f=_0x48e86e;return db[_0x901d('0x18')]['create'](_0x23fd43[_0x901d('0x21')]);})[_0x901d('0xd')](function(_0x20dbc5){if(_0xc52d0f[_0x901d('0x20')]&&fs[_0x901d('0x22')](_0x20dbc5[_0x901d('0x23')])){var _0x4137b7=util[_0x901d('0x24')](_0x901d('0x25'),_0x20dbc5[_0x901d('0x23')]);return _0x56e4ec[_0x901d('0x26')](_0x20dbc5[_0x901d('0x23')],_0x4137b7,config[_0x901d('0x27')][_0x901d('0x28')])[_0x901d('0xd')](function(){fs['unlink'](_0x20dbc5[_0x901d('0x23')]);logger[_0x901d('0xe')](_0x901d('0x29'));return _0x20dbc5;});}return _0x20dbc5;})['then'](function(_0x3f0cea){logger[_0x901d('0xe')](_0x901d('0x1c'),_0x23fd43);logger[_0x901d('0x11')](_0x901d('0x1c'),_0x23fd43,JSON[_0x901d('0x1b')](_0x3f0cea));_0x3cbe43(_0x3f0cea);})[_0x901d('0x16')](function(_0x1b8d3){logger[_0x901d('0x12')](_0x901d('0x1c'),_0x1b8d3['message'],_0x23fd43);_0x133bff(_0x27f4ca['error'](0x1f4,_0x1b8d3[_0x901d('0x14')]));});});}; \ No newline at end of file +var _0x6a55=['callRecordingEncryption','create','existsSync','value','format','encryptFile','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash','randomstring','../../config/utils','rpc','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','UpdateVoiceRecording','update','body','options','where','limit','findOne'];(function(_0xabfe7a,_0x4c3db9){var _0x411d77=function(_0x3d6f57){while(--_0x3d6f57){_0xabfe7a['push'](_0xabfe7a['shift']());}};_0x411d77(++_0x4c3db9);}(_0x6a55,0xdb));var _0x56a5=function(_0x1f16de,_0x548eb9){_0x1f16de=_0x1f16de-0x0;var _0x36cd80=_0x6a55[_0x1f16de];return _0x36cd80;};'use strict';var _=require(_0x56a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x56a5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x56a5('0x2'));var logger=require('../../config/logger')(_0x56a5('0x3'));var config=require('../../config/environment');var jayson=require(_0x56a5('0x4'));var client=jayson[_0x56a5('0x5')][_0x56a5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x293ea1,_0x444c65,_0x2272d9){return new BPromise(function(_0x2b8f57,_0x387dcb){return client['request'](_0x293ea1,_0x2272d9)[_0x56a5('0x7')](function(_0xf15490){logger[_0x56a5('0x8')](_0x56a5('0x9'),_0x444c65,_0x56a5('0xa'));logger[_0x56a5('0xb')](_0x56a5('0xc'),_0x444c65,_0x56a5('0xa'),JSON[_0x56a5('0xd')](_0xf15490));if(_0xf15490['error']){if(_0xf15490['error'][_0x56a5('0xe')]===0x1f4){logger[_0x56a5('0xf')](_0x56a5('0x9'),_0x444c65,_0xf15490[_0x56a5('0xf')][_0x56a5('0x10')]);return _0x387dcb(_0xf15490[_0x56a5('0xf')]['message']);}logger['error'](_0x56a5('0x9'),_0x444c65,_0xf15490[_0x56a5('0xf')][_0x56a5('0x10')]);return _0x2b8f57(_0xf15490[_0x56a5('0xf')][_0x56a5('0x10')]);}else{logger[_0x56a5('0x8')](_0x56a5('0x9'),_0x444c65,'request\x20sent');_0x2b8f57(_0xf15490[_0x56a5('0x11')]['message']);}})[_0x56a5('0x12')](function(_0x51d031){logger[_0x56a5('0xf')](_0x56a5('0x9'),_0x444c65,_0x51d031);_0x387dcb(_0x51d031);});});}exports[_0x56a5('0x13')]=function(_0x28fe74){var _0x1ba472=this;return new Promise(function(_0x143f3d,_0x1dddec){return db['VoiceRecording'][_0x56a5('0x14')](_0x28fe74[_0x56a5('0x15')],{'raw':_0x28fe74[_0x56a5('0x16')]?_0x28fe74[_0x56a5('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28fe74[_0x56a5('0x16')]?_0x28fe74[_0x56a5('0x16')][_0x56a5('0x17')]||null:null,'attributes':_0x28fe74[_0x56a5('0x16')]?_0x28fe74[_0x56a5('0x16')]['attributes']||null:null,'limit':_0x28fe74['options']?_0x28fe74[_0x56a5('0x16')][_0x56a5('0x18')]||null:null})['then'](function(_0x1556eb){logger[_0x56a5('0x8')](_0x56a5('0x13'),_0x28fe74);logger[_0x56a5('0xb')](_0x56a5('0x13'),_0x28fe74,JSON[_0x56a5('0xd')](_0x1556eb));_0x143f3d(_0x1556eb);})[_0x56a5('0x12')](function(_0x8431df){logger[_0x56a5('0xf')](_0x56a5('0x13'),_0x8431df[_0x56a5('0x10')],_0x28fe74);_0x1dddec(_0x1ba472[_0x56a5('0xf')](0x1f4,_0x8431df[_0x56a5('0x10')]));});});};exports['CreateVoiceRecording']=function(_0x5c76a7){var _0x2d8e68=this;return new Promise(function(_0x42cd45,_0x2706f9){var _0x43a815=require('../../components/encryptor');var _0x18e863;return db['Setting'][_0x56a5('0x19')]({'attributes':['id',_0x56a5('0x1a')],'where':{'id':0x1},'raw':!![]})[_0x56a5('0x7')](function(_0x284ee5){_0x18e863=_0x284ee5;return db['VoiceRecording'][_0x56a5('0x1b')](_0x5c76a7[_0x56a5('0x15')]);})[_0x56a5('0x7')](function(_0x51ef6f){if(_0x18e863[_0x56a5('0x1a')]&&fs[_0x56a5('0x1c')](_0x51ef6f[_0x56a5('0x1d')])){var _0x214649=util[_0x56a5('0x1e')]('%s.cypher',_0x51ef6f[_0x56a5('0x1d')]);return _0x43a815[_0x56a5('0x1f')](_0x51ef6f[_0x56a5('0x1d')],_0x214649,config[_0x56a5('0x20')][_0x56a5('0x21')])['then'](function(){fs['unlink'](_0x51ef6f[_0x56a5('0x1d')]);logger[_0x56a5('0x8')](_0x56a5('0x22'));return _0x51ef6f;});}return _0x51ef6f;})['then'](function(_0x1de021){logger[_0x56a5('0x8')]('CreateVoiceRecording',_0x5c76a7);logger['debug']('CreateVoiceRecording',_0x5c76a7,JSON['stringify'](_0x1de021));_0x42cd45(_0x1de021);})[_0x56a5('0x12')](function(_0x29c8f1){logger[_0x56a5('0xf')]('CreateVoiceRecording',_0x29c8f1[_0x56a5('0x10')],_0x5c76a7);_0x2706f9(_0x2d8e68['error'](0x1f4,_0x29c8f1[_0x56a5('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index dbe7ef3..3e3208a 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 _0x4b20=['/:id','show','post','create','update','delete','destroy','exports','multer','util','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe'];(function(_0x51a9d0,_0xbebd29){var _0x4db0ee=function(_0x1aa662){while(--_0x1aa662){_0x51a9d0['push'](_0x51a9d0['shift']());}};_0x4db0ee(++_0xbebd29);}(_0x4b20,0xbc));var _0x04b2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b20[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x04b2('0x0'));var util=require(_0x04b2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x04b2('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x04b2('0x3'));var config=require(_0x04b2('0x4'));var controller=require('./voiceTransferReport.controller');router[_0x04b2('0x5')]('/',auth['isAuthenticated'](),controller[_0x04b2('0x6')]);router[_0x04b2('0x5')](_0x04b2('0x7'),auth[_0x04b2('0x8')](),controller[_0x04b2('0x9')]);router[_0x04b2('0x5')](_0x04b2('0xa'),auth[_0x04b2('0x8')](),controller[_0x04b2('0xb')]);router[_0x04b2('0xc')]('/',auth[_0x04b2('0x8')](),controller[_0x04b2('0xd')]);router['put'](_0x04b2('0xa'),auth[_0x04b2('0x8')](),controller[_0x04b2('0xe')]);router[_0x04b2('0xf')](_0x04b2('0xa'),auth[_0x04b2('0x8')](),controller[_0x04b2('0x10')]);module[_0x04b2('0x11')]=router; \ No newline at end of file +var _0x8ede=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x410baf,_0x502507){var _0xd97439=function(_0x4bde0d){while(--_0x4bde0d){_0x410baf['push'](_0x410baf['shift']());}};_0xd97439(++_0x502507);}(_0x8ede,0x77));var _0xe8ed=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8ede[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xe8ed('0x0'));var util=require(_0xe8ed('0x1'));var path=require(_0xe8ed('0x2'));var timeout=require(_0xe8ed('0x3'));var express=require(_0xe8ed('0x4'));var router=express[_0xe8ed('0x5')]();var fs_extra=require(_0xe8ed('0x6'));var auth=require(_0xe8ed('0x7'));var interaction=require(_0xe8ed('0x8'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router[_0xe8ed('0x9')]('/',auth[_0xe8ed('0xa')](),controller[_0xe8ed('0xb')]);router[_0xe8ed('0x9')](_0xe8ed('0xc'),auth[_0xe8ed('0xa')](),controller[_0xe8ed('0xd')]);router[_0xe8ed('0x9')](_0xe8ed('0xe'),auth[_0xe8ed('0xa')](),controller[_0xe8ed('0xf')]);router['post']('/',auth[_0xe8ed('0xa')](),controller[_0xe8ed('0x10')]);router[_0xe8ed('0x11')](_0xe8ed('0xe'),auth[_0xe8ed('0xa')](),controller[_0xe8ed('0x12')]);router[_0xe8ed('0x13')](_0xe8ed('0xe'),auth[_0xe8ed('0xa')](),controller['destroy']);module[_0xe8ed('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 6f9d89f..10f26fc 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 _0xce9b=['exports','ENUM','blind','attended','STRING','Yes','sequelize','moment'];(function(_0x2ab9b1,_0x2b2cac){var _0xc6f127=function(_0x52d178){while(--_0x52d178){_0x2ab9b1['push'](_0x2ab9b1['shift']());}};_0xc6f127(++_0x2b2cac);}(_0xce9b,0xc6));var _0xbce9=function(_0x240569,_0x27389e){_0x240569=_0x240569-0x0;var _0x44da63=_0xce9b[_0x240569];return _0x44da63;};'use strict';var Sequelize=require(_0xbce9('0x0'));var moment=require(_0xbce9('0x1'));module[_0xbce9('0x2')]={'type':{'type':Sequelize[_0xbce9('0x3')](_0xbce9('0x4'),_0xbce9('0x5'))},'result':{'type':Sequelize[_0xbce9('0x6')]},'transfererchannel':{'type':Sequelize[_0xbce9('0x6')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xbce9('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0xbce9('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0xbce9('0x6')]},'transfereraccountcode':{'type':Sequelize[_0xbce9('0x6')]},'transferercontext':{'type':Sequelize[_0xbce9('0x6')]},'transfererexten':{'type':Sequelize[_0xbce9('0x6')]},'transfererlinkedid':{'type':Sequelize[_0xbce9('0x6')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xbce9('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xbce9('0x6')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xbce9('0x6')]},'transfereecontext':{'type':Sequelize[_0xbce9('0x6')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xbce9('0x3')](_0xbce9('0x7'),'No')},'context':{'type':Sequelize[_0xbce9('0x6')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1a10=['blind','attended','STRING','Yes','moment','exports'];(function(_0x324f8a,_0x25f2f8){var _0x1be8ee=function(_0x106b00){while(--_0x106b00){_0x324f8a['push'](_0x324f8a['shift']());}};_0x1be8ee(++_0x25f2f8);}(_0x1a10,0x1de));var _0x01a1=function(_0x3fb5cf,_0x2cd427){_0x3fb5cf=_0x3fb5cf-0x0;var _0x31a321=_0x1a10[_0x3fb5cf];return _0x31a321;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x01a1('0x0'));module[_0x01a1('0x1')]={'type':{'type':Sequelize['ENUM'](_0x01a1('0x2'),_0x01a1('0x3'))},'result':{'type':Sequelize[_0x01a1('0x4')]},'transfererchannel':{'type':Sequelize[_0x01a1('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x01a1('0x4')]},'transferercalleridname':{'type':Sequelize[_0x01a1('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x01a1('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x01a1('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x01a1('0x4')]},'transferercontext':{'type':Sequelize[_0x01a1('0x4')]},'transfererexten':{'type':Sequelize[_0x01a1('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x01a1('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x01a1('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x01a1('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x01a1('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x01a1('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x01a1('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0x01a1('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x01a1('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index ae1ecbe..d0eb054 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 _0xc57d=['to-csv','ejs','fs-extra','lodash','squel','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','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox'];(function(_0xce44ee,_0x387d70){var _0xf97a49=function(_0x3ceab0){while(--_0x3ceab0){_0xce44ee['push'](_0xce44ee['shift']());}};_0xf97a49(++_0x387d70);}(_0xc57d,0xe8));var _0xdc57=function(_0x39bb0e,_0x129976){_0x39bb0e=_0x39bb0e-0x0;var _0x33bf26=_0xc57d[_0x39bb0e];return _0x33bf26;};'use strict';var emlformat=require(_0xdc57('0x0'));var rimraf=require(_0xdc57('0x1'));var zipdir=require(_0xdc57('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdc57('0x3'));var Mustache=require(_0xdc57('0x4'));var util=require(_0xdc57('0x5'));var path=require(_0xdc57('0x6'));var sox=require(_0xdc57('0x7'));var csv=require(_0xdc57('0x8'));var ejs=require(_0xdc57('0x9'));var fs=require('fs');var fs_extra=require(_0xdc57('0xa'));var _=require(_0xdc57('0xb'));var squel=require(_0xdc57('0xc'));var crypto=require('crypto');var jsforce=require(_0xdc57('0xd'));var deskjs=require(_0xdc57('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdc57('0xf'));var Redis=require(_0xdc57('0x10'));var authService=require(_0xdc57('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdc57('0x12'));var hardwareService=require(_0xdc57('0x13'));var logger=require(_0xdc57('0x14'))('api');var utils=require(_0xdc57('0x15'));var config=require(_0xdc57('0x16'));var licenseUtil=require(_0xdc57('0x17'));var db=require(_0xdc57('0x18'))['db'];function respondWithStatusCode(_0x46e885,_0x1f93a8){_0x1f93a8=_0x1f93a8||0xcc;return function(_0x3067ee){if(_0x3067ee){return _0x46e885[_0xdc57('0x19')](_0x1f93a8);}return _0x46e885[_0xdc57('0x1a')](_0x1f93a8)[_0xdc57('0x1b')]();};}function respondWithResult(_0x53e0e2,_0x1ef4d9){_0x1ef4d9=_0x1ef4d9||0xc8;return function(_0x5c2013){if(_0x5c2013){return _0x53e0e2[_0xdc57('0x1a')](_0x1ef4d9)['json'](_0x5c2013);}};}function respondWithFilteredResult(_0xaf8ad4,_0xbfb282){return function(_0x1c0a2c){if(_0x1c0a2c){var _0x144d21=typeof _0xbfb282[_0xdc57('0x1c')]==='undefined'&&typeof _0xbfb282[_0xdc57('0x1d')]===_0xdc57('0x1e');var _0x2fd5c4=_0x1c0a2c[_0xdc57('0x1f')];var _0x39c3ae=_0x144d21?0x0:_0xbfb282[_0xdc57('0x1c')];var _0x4c85e6=_0x144d21?_0x1c0a2c['count']:_0xbfb282[_0xdc57('0x1c')]+_0xbfb282['limit'];var _0xb3b0b0;if(_0x4c85e6>=_0x2fd5c4){_0x4c85e6=_0x2fd5c4;_0xb3b0b0=0xc8;}else{_0xb3b0b0=0xce;}_0xaf8ad4[_0xdc57('0x1a')](_0xb3b0b0);return _0xaf8ad4['set'](_0xdc57('0x20'),_0x39c3ae+'-'+_0x4c85e6+'/'+_0x2fd5c4)[_0xdc57('0x21')](_0x1c0a2c);}return null;};}function patchUpdates(_0xe4e2a7){return function(_0x3a2917){try{jsonpatch[_0xdc57('0x22')](_0x3a2917,_0xe4e2a7,!![]);}catch(_0x4d9a5e){return BPromise[_0xdc57('0x23')](_0x4d9a5e);}return _0x3a2917[_0xdc57('0x24')]();};}function saveUpdates(_0x41b5f9,_0x17aeab){return function(_0x183187){if(_0x183187){return _0x183187[_0xdc57('0x25')](_0x41b5f9)[_0xdc57('0x26')](function(_0x48f4a7){return _0x48f4a7;});}return null;};}function removeEntity(_0x53733c,_0x4ad44e){return function(_0x16f70a){if(_0x16f70a){return _0x16f70a[_0xdc57('0x27')]()[_0xdc57('0x26')](function(){_0x53733c[_0xdc57('0x1a')](0xcc)[_0xdc57('0x1b')]();});}};}function handleEntityNotFound(_0x3f7afb,_0x32df68){return function(_0x3b68a1){if(!_0x3b68a1){_0x3f7afb['sendStatus'](0x194);}return _0x3b68a1;};}function handleError(_0x391e04,_0x368f44){_0x368f44=_0x368f44||0x1f4;return function(_0x523c1d){logger[_0xdc57('0x28')](_0x523c1d[_0xdc57('0x29')]);if(_0x523c1d[_0xdc57('0x2a')]){delete _0x523c1d[_0xdc57('0x2a')];}_0x391e04[_0xdc57('0x1a')](_0x368f44)[_0xdc57('0x2b')](_0x523c1d);};}exports[_0xdc57('0x2c')]=function(_0x449379,_0x1e66cf){var _0x147adf={},_0x456598={},_0x5d0c40={'count':0x0,'rows':[]};var _0x1a6bd4=_[_0xdc57('0x2d')](db[_0xdc57('0x2e')][_0xdc57('0x2f')],function(_0x508423){return{'name':_0x508423[_0xdc57('0x30')],'type':_0x508423[_0xdc57('0x31')][_0xdc57('0x32')]};});_0x456598['model']=_[_0xdc57('0x2d')](_0x1a6bd4,'name');_0x456598['query']=_[_0xdc57('0x33')](_0x449379[_0xdc57('0x34')]);_0x456598[_0xdc57('0x35')]=_[_0xdc57('0x36')](_0x456598[_0xdc57('0x37')],_0x456598[_0xdc57('0x34')]);_0x147adf[_0xdc57('0x38')]=_['intersection'](_0x456598[_0xdc57('0x37')],qs[_0xdc57('0x39')](_0x449379[_0xdc57('0x34')][_0xdc57('0x39')]));_0x147adf[_0xdc57('0x38')]=_0x147adf[_0xdc57('0x38')][_0xdc57('0x3a')]?_0x147adf['attributes']:_0x456598[_0xdc57('0x37')];if(!_0x449379[_0xdc57('0x34')][_0xdc57('0x3b')](_0xdc57('0x3c'))){_0x147adf['limit']=qs[_0xdc57('0x1d')](_0x449379['query'][_0xdc57('0x1d')]);_0x147adf[_0xdc57('0x1c')]=qs[_0xdc57('0x1c')](_0x449379[_0xdc57('0x34')][_0xdc57('0x1c')]);}_0x147adf[_0xdc57('0x3d')]=qs[_0xdc57('0x3e')](_0x449379[_0xdc57('0x34')]['sort']);_0x147adf['where']=qs[_0xdc57('0x35')](_[_0xdc57('0x3f')](_0x449379[_0xdc57('0x34')],_0x456598[_0xdc57('0x35')]),_0x1a6bd4);if(_0x449379['query'][_0xdc57('0x40')]){_0x147adf[_0xdc57('0x41')]=_[_0xdc57('0x42')](_0x147adf['where'],{'$or':_['map'](_0x1a6bd4,function(_0x3f10ae){if(_0x3f10ae[_0xdc57('0x31')]!==_0xdc57('0x43')){var _0x49a4b8={};_0x49a4b8[_0x3f10ae[_0xdc57('0x2a')]]={'$like':'%'+_0x449379[_0xdc57('0x34')]['filter']+'%'};return _0x49a4b8;}})});}_0x147adf=_[_0xdc57('0x42')]({},_0x147adf,_0x449379[_0xdc57('0x44')]);var _0x1afa49={'where':_0x147adf[_0xdc57('0x41')]};return db[_0xdc57('0x2e')][_0xdc57('0x1f')](_0x1afa49)['then'](function(_0x3520d9){_0x5d0c40[_0xdc57('0x1f')]=_0x3520d9;if(_0x449379[_0xdc57('0x34')][_0xdc57('0x45')]){_0x147adf[_0xdc57('0x46')]=[{'all':!![]}];}return db[_0xdc57('0x2e')][_0xdc57('0x47')](_0x147adf);})[_0xdc57('0x26')](function(_0x21a126){_0x5d0c40[_0xdc57('0x48')]=_0x21a126;return _0x5d0c40;})[_0xdc57('0x26')](respondWithFilteredResult(_0x1e66cf,_0x147adf))[_0xdc57('0x49')](handleError(_0x1e66cf,null));};exports[_0xdc57('0x4a')]=function(_0x53c7f9,_0x4da460){var _0x105b2c={'raw':!![],'where':{'id':_0x53c7f9['params']['id']}},_0x442096={};_0x442096[_0xdc57('0x37')]=_[_0xdc57('0x33')](db[_0xdc57('0x2e')]['rawAttributes']);_0x442096[_0xdc57('0x34')]=_[_0xdc57('0x33')](_0x53c7f9[_0xdc57('0x34')]);_0x442096[_0xdc57('0x35')]=_['intersection'](_0x442096['model'],_0x442096[_0xdc57('0x34')]);_0x105b2c[_0xdc57('0x38')]=_[_0xdc57('0x36')](_0x442096[_0xdc57('0x37')],qs[_0xdc57('0x39')](_0x53c7f9[_0xdc57('0x34')][_0xdc57('0x39')]));_0x105b2c[_0xdc57('0x38')]=_0x105b2c[_0xdc57('0x38')][_0xdc57('0x3a')]?_0x105b2c[_0xdc57('0x38')]:_0x442096[_0xdc57('0x37')];if(_0x53c7f9[_0xdc57('0x34')][_0xdc57('0x45')]){_0x105b2c[_0xdc57('0x46')]=[{'all':!![]}];}_0x105b2c=_[_0xdc57('0x42')]({},_0x105b2c,_0x53c7f9[_0xdc57('0x44')]);return db['VoiceTransferReport'][_0xdc57('0x4b')](_0x105b2c)['then'](handleEntityNotFound(_0x4da460,null))[_0xdc57('0x26')](respondWithResult(_0x4da460,null))['catch'](handleError(_0x4da460,null));};exports[_0xdc57('0x4c')]=function(_0x31e0f9,_0x3da81a){return db[_0xdc57('0x2e')][_0xdc57('0x4c')](_0x31e0f9['body'],{})[_0xdc57('0x26')](respondWithResult(_0x3da81a,0xc9))['catch'](handleError(_0x3da81a,null));};exports[_0xdc57('0x25')]=function(_0x524d06,_0x52adea){if(_0x524d06[_0xdc57('0x4d')]['id']){delete _0x524d06[_0xdc57('0x4d')]['id'];}return db[_0xdc57('0x2e')]['find']({'where':{'id':_0x524d06[_0xdc57('0x4e')]['id']}})[_0xdc57('0x26')](handleEntityNotFound(_0x52adea,null))[_0xdc57('0x26')](saveUpdates(_0x524d06[_0xdc57('0x4d')],null))[_0xdc57('0x26')](respondWithResult(_0x52adea,null))[_0xdc57('0x49')](handleError(_0x52adea,null));};exports['destroy']=function(_0x554e34,_0x46027c){return db[_0xdc57('0x2e')][_0xdc57('0x4b')]({'where':{'id':_0x554e34[_0xdc57('0x4e')]['id']}})[_0xdc57('0x26')](handleEntityNotFound(_0x46027c,null))[_0xdc57('0x26')](removeEntity(_0x46027c,null))[_0xdc57('0x49')](handleError(_0x46027c,null));};exports[_0xdc57('0x4f')]=function(_0x469e4c,_0x334c7c){return db[_0xdc57('0x2e')][_0xdc57('0x4f')]()[_0xdc57('0x26')](respondWithResult(_0x334c7c,null))[_0xdc57('0x49')](handleError(_0x334c7c,null));}; \ No newline at end of file +var _0x6992=['catch','create','update','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','save','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6992,0x1bc));var _0x2699=function(_0x4e9e52,_0x4de7f7){_0x4e9e52=_0x4e9e52-0x0;var _0x29a562=_0x6992[_0x4e9e52];return _0x29a562;};'use strict';var emlformat=require(_0x2699('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2699('0x1'));var jsonpatch=require(_0x2699('0x2'));var rp=require(_0x2699('0x3'));var moment=require(_0x2699('0x4'));var BPromise=require(_0x2699('0x5'));var Mustache=require(_0x2699('0x6'));var util=require(_0x2699('0x7'));var path=require(_0x2699('0x8'));var sox=require(_0x2699('0x9'));var csv=require(_0x2699('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2699('0xb'));var _=require(_0x2699('0xc'));var squel=require(_0x2699('0xd'));var crypto=require('crypto');var jsforce=require(_0x2699('0xe'));var deskjs=require(_0x2699('0xf'));var toCsv=require(_0x2699('0xa'));var querystring=require(_0x2699('0x10'));var Papa=require(_0x2699('0x11'));var Redis=require(_0x2699('0x12'));var authService=require(_0x2699('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2699('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2699('0x15'));var utils=require(_0x2699('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2699('0x17'))['db'];function respondWithStatusCode(_0x52d067,_0x35f888){_0x35f888=_0x35f888||0xcc;return function(_0x4d44af){if(_0x4d44af){return _0x52d067[_0x2699('0x18')](_0x35f888);}return _0x52d067['status'](_0x35f888)[_0x2699('0x19')]();};}function respondWithResult(_0xf2a438,_0x41be85){_0x41be85=_0x41be85||0xc8;return function(_0x41c6b8){if(_0x41c6b8){return _0xf2a438[_0x2699('0x1a')](_0x41be85)[_0x2699('0x1b')](_0x41c6b8);}};}function respondWithFilteredResult(_0x173fe3,_0x4f22d9){return function(_0x4957e7){if(_0x4957e7){var _0x11b8ff=typeof _0x4f22d9['offset']===_0x2699('0x1c')&&typeof _0x4f22d9[_0x2699('0x1d')]==='undefined';var _0x1bbdc9=_0x4957e7[_0x2699('0x1e')];var _0x10b2ad=_0x11b8ff?0x0:_0x4f22d9['offset'];var _0x127c43=_0x11b8ff?_0x4957e7[_0x2699('0x1e')]:_0x4f22d9[_0x2699('0x1f')]+_0x4f22d9['limit'];var _0x6008a3;if(_0x127c43>=_0x1bbdc9){_0x127c43=_0x1bbdc9;_0x6008a3=0xc8;}else{_0x6008a3=0xce;}_0x173fe3[_0x2699('0x1a')](_0x6008a3);return _0x173fe3['set'](_0x2699('0x20'),_0x10b2ad+'-'+_0x127c43+'/'+_0x1bbdc9)[_0x2699('0x1b')](_0x4957e7);}return null;};}function patchUpdates(_0x1e25d4){return function(_0x108955){try{jsonpatch['apply'](_0x108955,_0x1e25d4,!![]);}catch(_0x2c2c0b){return BPromise['reject'](_0x2c2c0b);}return _0x108955[_0x2699('0x21')]();};}function saveUpdates(_0x14f7c9,_0x15fcda){return function(_0x2b77fb){if(_0x2b77fb){return _0x2b77fb['update'](_0x14f7c9)[_0x2699('0x22')](function(_0x1d5d3f){return _0x1d5d3f;});}return null;};}function removeEntity(_0x3ca7f7,_0x21db5f){return function(_0x35c7a2){if(_0x35c7a2){return _0x35c7a2[_0x2699('0x23')]()[_0x2699('0x22')](function(){_0x3ca7f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f8d91,_0xdb8234){return function(_0x579fa6){if(!_0x579fa6){_0x1f8d91[_0x2699('0x18')](0x194);}return _0x579fa6;};}function handleError(_0x3d9947,_0xad4244){_0xad4244=_0xad4244||0x1f4;return function(_0x5a01cd){logger[_0x2699('0x24')](_0x5a01cd[_0x2699('0x25')]);if(_0x5a01cd[_0x2699('0x26')]){delete _0x5a01cd[_0x2699('0x26')];}_0x3d9947[_0x2699('0x1a')](_0xad4244)[_0x2699('0x27')](_0x5a01cd);};}exports[_0x2699('0x28')]=function(_0x5d236b,_0x35f0c2){var _0x2ecccf={},_0x266bba={},_0x2da9d2={'count':0x0,'rows':[]};var _0x2d86c9=_[_0x2699('0x29')](db[_0x2699('0x2a')]['rawAttributes'],function(_0x2f9136){return{'name':_0x2f9136['fieldName'],'type':_0x2f9136[_0x2699('0x2b')]['key']};});_0x266bba[_0x2699('0x2c')]=_['map'](_0x2d86c9,_0x2699('0x26'));_0x266bba[_0x2699('0x2d')]=_[_0x2699('0x2e')](_0x5d236b['query']);_0x266bba[_0x2699('0x2f')]=_[_0x2699('0x30')](_0x266bba[_0x2699('0x2c')],_0x266bba[_0x2699('0x2d')]);_0x2ecccf[_0x2699('0x31')]=_[_0x2699('0x30')](_0x266bba[_0x2699('0x2c')],qs[_0x2699('0x32')](_0x5d236b[_0x2699('0x2d')][_0x2699('0x32')]));_0x2ecccf[_0x2699('0x31')]=_0x2ecccf[_0x2699('0x31')][_0x2699('0x33')]?_0x2ecccf[_0x2699('0x31')]:_0x266bba[_0x2699('0x2c')];if(!_0x5d236b[_0x2699('0x2d')]['hasOwnProperty'](_0x2699('0x34'))){_0x2ecccf[_0x2699('0x1d')]=qs['limit'](_0x5d236b[_0x2699('0x2d')]['limit']);_0x2ecccf[_0x2699('0x1f')]=qs[_0x2699('0x1f')](_0x5d236b['query'][_0x2699('0x1f')]);}_0x2ecccf[_0x2699('0x35')]=qs[_0x2699('0x36')](_0x5d236b['query'][_0x2699('0x36')]);_0x2ecccf[_0x2699('0x37')]=qs['filters'](_['pick'](_0x5d236b[_0x2699('0x2d')],_0x266bba[_0x2699('0x2f')]),_0x2d86c9);if(_0x5d236b['query'][_0x2699('0x38')]){_0x2ecccf[_0x2699('0x37')]=_['merge'](_0x2ecccf[_0x2699('0x37')],{'$or':_['map'](_0x2d86c9,function(_0x48280f){if(_0x48280f['type']!==_0x2699('0x39')){var _0xb399b9={};_0xb399b9[_0x48280f[_0x2699('0x26')]]={'$like':'%'+_0x5d236b['query']['filter']+'%'};return _0xb399b9;}})});}_0x2ecccf=_[_0x2699('0x3a')]({},_0x2ecccf,_0x5d236b[_0x2699('0x3b')]);var _0x423289={'where':_0x2ecccf[_0x2699('0x37')]};return db['VoiceTransferReport'][_0x2699('0x1e')](_0x423289)['then'](function(_0x351b44){_0x2da9d2[_0x2699('0x1e')]=_0x351b44;if(_0x5d236b[_0x2699('0x2d')][_0x2699('0x3c')]){_0x2ecccf[_0x2699('0x3d')]=[{'all':!![]}];}return db[_0x2699('0x2a')][_0x2699('0x3e')](_0x2ecccf);})[_0x2699('0x22')](function(_0x52e67b){_0x2da9d2[_0x2699('0x3f')]=_0x52e67b;return _0x2da9d2;})['then'](respondWithFilteredResult(_0x35f0c2,_0x2ecccf))['catch'](handleError(_0x35f0c2,null));};exports[_0x2699('0x40')]=function(_0x4a8745,_0x12850c){var _0x42d4df={'raw':!![],'where':{'id':_0x4a8745[_0x2699('0x41')]['id']}},_0x2de84c={};_0x2de84c[_0x2699('0x2c')]=_[_0x2699('0x2e')](db[_0x2699('0x2a')][_0x2699('0x42')]);_0x2de84c[_0x2699('0x2d')]=_['keys'](_0x4a8745[_0x2699('0x2d')]);_0x2de84c['filters']=_[_0x2699('0x30')](_0x2de84c[_0x2699('0x2c')],_0x2de84c['query']);_0x42d4df[_0x2699('0x31')]=_[_0x2699('0x30')](_0x2de84c['model'],qs[_0x2699('0x32')](_0x4a8745[_0x2699('0x2d')][_0x2699('0x32')]));_0x42d4df[_0x2699('0x31')]=_0x42d4df[_0x2699('0x31')][_0x2699('0x33')]?_0x42d4df[_0x2699('0x31')]:_0x2de84c[_0x2699('0x2c')];if(_0x4a8745[_0x2699('0x2d')][_0x2699('0x3c')]){_0x42d4df[_0x2699('0x3d')]=[{'all':!![]}];}_0x42d4df=_['merge']({},_0x42d4df,_0x4a8745[_0x2699('0x3b')]);return db[_0x2699('0x2a')]['find'](_0x42d4df)[_0x2699('0x22')](handleEntityNotFound(_0x12850c,null))[_0x2699('0x22')](respondWithResult(_0x12850c,null))[_0x2699('0x43')](handleError(_0x12850c,null));};exports[_0x2699('0x44')]=function(_0x1cab2a,_0x47f799){return db[_0x2699('0x2a')]['create'](_0x1cab2a['body'],{})[_0x2699('0x22')](respondWithResult(_0x47f799,0xc9))[_0x2699('0x43')](handleError(_0x47f799,null));};exports[_0x2699('0x45')]=function(_0x2ed3e1,_0x2ba65a){if(_0x2ed3e1[_0x2699('0x46')]['id']){delete _0x2ed3e1[_0x2699('0x46')]['id'];}return db[_0x2699('0x2a')]['find']({'where':{'id':_0x2ed3e1['params']['id']}})['then'](handleEntityNotFound(_0x2ba65a,null))['then'](saveUpdates(_0x2ed3e1[_0x2699('0x46')],null))[_0x2699('0x22')](respondWithResult(_0x2ba65a,null))[_0x2699('0x43')](handleError(_0x2ba65a,null));};exports[_0x2699('0x23')]=function(_0x506995,_0x56556f){return db['VoiceTransferReport'][_0x2699('0x47')]({'where':{'id':_0x506995[_0x2699('0x41')]['id']}})[_0x2699('0x22')](handleEntityNotFound(_0x56556f,null))[_0x2699('0x22')](removeEntity(_0x56556f,null))[_0x2699('0x43')](handleError(_0x56556f,null));};exports[_0x2699('0x48')]=function(_0x39bed9,_0x4bc4f3){return db[_0x2699('0x2a')][_0x2699('0x48')]()[_0x2699('0x22')](respondWithResult(_0x4bc4f3,null))[_0x2699('0x43')](handleError(_0x4bc4f3,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 8ef40d3..03ed2b9 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 _0xb4ab=['../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x57aef2,_0x47f109){var _0x34dddf=function(_0x10d87a){while(--_0x10d87a){_0x57aef2['push'](_0x57aef2['shift']());}};_0x34dddf(++_0x47f109);}(_0xb4ab,0x1e6));var _0xbb4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb4ab[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xbb4a('0x0'));var util=require(_0xbb4a('0x1'));var logger=require(_0xbb4a('0x2'))('api');var moment=require(_0xbb4a('0x3'));var BPromise=require(_0xbb4a('0x4'));var rp=require(_0xbb4a('0x5'));var fs=require('fs');var path=require(_0xbb4a('0x6'));var rimraf=require(_0xbb4a('0x7'));var config=require(_0xbb4a('0x8'));var attributes=require(_0xbb4a('0x9'));module[_0xbb4a('0xa')]=function(_0x123c5f,_0x5c982a){return _0x123c5f['define'](_0xbb4a('0xb'),attributes,{'tableName':_0xbb4a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31d3=['report_call_transfer','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define'];(function(_0x59b981,_0x18ac6b){var _0x20c561=function(_0x127169){while(--_0x127169){_0x59b981['push'](_0x59b981['shift']());}};_0x20c561(++_0x18ac6b);}(_0x31d3,0xfd));var _0x331d=function(_0x54e6f5,_0x4f4e99){_0x54e6f5=_0x54e6f5-0x0;var _0x5e8794=_0x31d3[_0x54e6f5];return _0x5e8794;};'use strict';var _=require(_0x331d('0x0'));var util=require('util');var logger=require(_0x331d('0x1'))('api');var moment=require(_0x331d('0x2'));var BPromise=require(_0x331d('0x3'));var rp=require(_0x331d('0x4'));var fs=require('fs');var path=require(_0x331d('0x5'));var rimraf=require(_0x331d('0x6'));var config=require(_0x331d('0x7'));var attributes=require(_0x331d('0x8'));module[_0x331d('0x9')]=function(_0x269c85,_0x395def){return _0x269c85[_0x331d('0xa')]('VoiceTransferReport',attributes,{'tableName':_0x331d('0xb'),'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 f35012f..f394479 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 _0xe60d=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceTransferReport','create','options','raw','lodash','util'];(function(_0x490ef9,_0x3f568c){var _0xd9ac4e=function(_0x2e20d2){while(--_0x2e20d2){_0x490ef9['push'](_0x490ef9['shift']());}};_0xd9ac4e(++_0x3f568c);}(_0xe60d,0x1e4));var _0xde60=function(_0x2f7343,_0x303fe1){_0x2f7343=_0x2f7343-0x0;var _0x3f5baa=_0xe60d[_0x2f7343];return _0x3f5baa;};'use strict';var _=require(_0xde60('0x0'));var util=require(_0xde60('0x1'));var moment=require('moment');var BPromise=require(_0xde60('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde60('0x3'));var db=require(_0xde60('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xde60('0x5'))(_0xde60('0x6'));var config=require(_0xde60('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xde60('0x8')][_0xde60('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f9bf9,_0x3ecade,_0x2511ac){return new BPromise(function(_0x20d586,_0xfbc70f){return client[_0xde60('0xa')](_0x3f9bf9,_0x2511ac)[_0xde60('0xb')](function(_0x2a551d){logger['info'](_0xde60('0xc'),_0x3ecade,_0xde60('0xd'));logger[_0xde60('0xe')](_0xde60('0xf'),_0x3ecade,'request\x20sent',JSON[_0xde60('0x10')](_0x2a551d));if(_0x2a551d[_0xde60('0x11')]){if(_0x2a551d['error'][_0xde60('0x12')]===0x1f4){logger['error'](_0xde60('0xc'),_0x3ecade,_0x2a551d['error'][_0xde60('0x13')]);return _0xfbc70f(_0x2a551d[_0xde60('0x11')][_0xde60('0x13')]);}logger[_0xde60('0x11')](_0xde60('0xc'),_0x3ecade,_0x2a551d[_0xde60('0x11')][_0xde60('0x13')]);return _0x20d586(_0x2a551d[_0xde60('0x11')]['message']);}else{logger[_0xde60('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x3ecade,'request\x20sent');_0x20d586(_0x2a551d[_0xde60('0x15')]['message']);}})[_0xde60('0x16')](function(_0x2a9107){logger[_0xde60('0x11')](_0xde60('0xc'),_0x3ecade,_0x2a9107);_0xfbc70f(_0x2a9107);});});}exports[_0xde60('0x17')]=function(_0x47c299){var _0x4502dd=this;return new Promise(function(_0x1df2ab,_0x39622a){return db['VoiceTransferReport'][_0xde60('0x18')](_0x47c299['body'],{'raw':_0x47c299[_0xde60('0x19')]?_0x47c299[_0xde60('0x19')][_0xde60('0x1a')]===undefined?!![]:![]:!![]})[_0xde60('0xb')](function(_0x185e4c){logger[_0xde60('0x14')](_0xde60('0x17'),_0x47c299);logger[_0xde60('0xe')](_0xde60('0x17'),_0x47c299,JSON[_0xde60('0x10')](_0x185e4c));_0x1df2ab(_0x185e4c);})[_0xde60('0x16')](function(_0x175b4e){logger[_0xde60('0x11')](_0xde60('0x17'),_0x175b4e['message'],_0x47c299);_0x39622a(_0x4502dd[_0xde60('0x11')](0x1f4,_0x175b4e[_0xde60('0x13')]));});});}; \ No newline at end of file +var _0x4ecc=['request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','VoiceTransferReport','create','body','options','raw','then','CreateVoiceTransferReport','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x4ecc,0x101));var _0xc4ec=function(_0xfce093,_0x4e9dab){_0xfce093=_0xfce093-0x0;var _0x582743=_0x4ecc[_0xfce093];return _0x582743;};'use strict';var _=require(_0xc4ec('0x0'));var util=require(_0xc4ec('0x1'));var moment=require(_0xc4ec('0x2'));var BPromise=require(_0xc4ec('0x3'));var rs=require(_0xc4ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc4ec('0x5'));var logger=require(_0xc4ec('0x6'))('rpc');var config=require(_0xc4ec('0x7'));var jayson=require(_0xc4ec('0x8'));var client=jayson[_0xc4ec('0x9')][_0xc4ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54a8cf,_0x5a84b1,_0x4fcd34){return new BPromise(function(_0x211aeb,_0x60b535){return client[_0xc4ec('0xb')](_0x54a8cf,_0x4fcd34)['then'](function(_0x2d8e6d){logger[_0xc4ec('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x5a84b1,_0xc4ec('0xd'));logger[_0xc4ec('0xe')](_0xc4ec('0xf'),_0x5a84b1,_0xc4ec('0xd'),JSON[_0xc4ec('0x10')](_0x2d8e6d));if(_0x2d8e6d['error']){if(_0x2d8e6d[_0xc4ec('0x11')][_0xc4ec('0x12')]===0x1f4){logger[_0xc4ec('0x11')](_0xc4ec('0x13'),_0x5a84b1,_0x2d8e6d[_0xc4ec('0x11')][_0xc4ec('0x14')]);return _0x60b535(_0x2d8e6d[_0xc4ec('0x11')][_0xc4ec('0x14')]);}logger[_0xc4ec('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x5a84b1,_0x2d8e6d[_0xc4ec('0x11')][_0xc4ec('0x14')]);return _0x211aeb(_0x2d8e6d[_0xc4ec('0x11')][_0xc4ec('0x14')]);}else{logger[_0xc4ec('0xc')](_0xc4ec('0x13'),_0x5a84b1,_0xc4ec('0xd'));_0x211aeb(_0x2d8e6d[_0xc4ec('0x15')][_0xc4ec('0x14')]);}})[_0xc4ec('0x16')](function(_0xa750c1){logger[_0xc4ec('0x11')](_0xc4ec('0x13'),_0x5a84b1,_0xa750c1);_0x60b535(_0xa750c1);});});}exports['CreateVoiceTransferReport']=function(_0x2c5db7){var _0x16b766=this;return new Promise(function(_0x3947f2,_0x3cd08e){return db[_0xc4ec('0x17')][_0xc4ec('0x18')](_0x2c5db7[_0xc4ec('0x19')],{'raw':_0x2c5db7[_0xc4ec('0x1a')]?_0x2c5db7[_0xc4ec('0x1a')][_0xc4ec('0x1b')]===undefined?!![]:![]:!![]})[_0xc4ec('0x1c')](function(_0x559d2c){logger[_0xc4ec('0xc')](_0xc4ec('0x1d'),_0x2c5db7);logger['debug'](_0xc4ec('0x1d'),_0x2c5db7,JSON[_0xc4ec('0x10')](_0x559d2c));_0x3947f2(_0x559d2c);})['catch'](function(_0x1f1778){logger[_0xc4ec('0x11')](_0xc4ec('0x1d'),_0x1f1778[_0xc4ec('0x14')],_0x2c5db7);_0x3cd08e(_0x16b766[_0xc4ec('0x11')](0x1f4,_0x1f1778[_0xc4ec('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index e5520f5..43f600b 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 _0x0bb5=['unhold','/calls','calls','/transfer','exports','express','Router','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/answer','/hold','hold','/unhold'];(function(_0x834ab4,_0x260069){var _0xbeab1e=function(_0x3977aa){while(--_0x3977aa){_0x834ab4['push'](_0x834ab4['shift']());}};_0xbeab1e(++_0x260069);}(_0x0bb5,0x148));var _0x50bb=function(_0x329c04,_0x4be641){_0x329c04=_0x329c04-0x0;var _0x1c4fd3=_0x0bb5[_0x329c04];return _0x1c4fd3;};'use strict';var express=require(_0x50bb('0x0'));var router=express[_0x50bb('0x1')]();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router[_0x50bb('0x2')](_0x50bb('0x3'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0x6')]);router[_0x50bb('0x2')](_0x50bb('0x7'),auth[_0x50bb('0x4')](),auth['isWebrtcLicence'](),controller['hangup']);router[_0x50bb('0x2')](_0x50bb('0x8'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller['answer']);router['post'](_0x50bb('0x9'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0xa')]);router['post'](_0x50bb('0xb'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0xc')]);router[_0x50bb('0x2')](_0x50bb('0xd'),auth[_0x50bb('0x4')](),auth['isWebrtcLicence'](),controller[_0x50bb('0xe')]);router['post'](_0x50bb('0xf'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller['transfer']);module[_0x50bb('0x10')]=router; \ No newline at end of file +var _0x9f62=['/hangup','isAuthenticated','hangup','/answer','isWebrtcLicence','hold','/calls','/transfer','transfer','exports','Router','./webbar.controller','post','/originate','originate'];(function(_0x362af4,_0x124e9d){var _0x250752=function(_0x11f7f1){while(--_0x11f7f1){_0x362af4['push'](_0x362af4['shift']());}};_0x250752(++_0x124e9d);}(_0x9f62,0x154));var _0x29f6=function(_0x5ab2e3,_0x5ba121){_0x5ab2e3=_0x5ab2e3-0x0;var _0x387265=_0x9f62[_0x5ab2e3];return _0x387265;};'use strict';var express=require('express');var router=express[_0x29f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x29f6('0x1'));router[_0x29f6('0x2')](_0x29f6('0x3'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x29f6('0x4')]);router[_0x29f6('0x2')](_0x29f6('0x5'),auth[_0x29f6('0x6')](),auth['isWebrtcLicence'](),controller[_0x29f6('0x7')]);router[_0x29f6('0x2')](_0x29f6('0x8'),auth[_0x29f6('0x6')](),auth[_0x29f6('0x9')](),controller['answer']);router['post']('/hold',auth['isAuthenticated'](),auth[_0x29f6('0x9')](),controller[_0x29f6('0xa')]);router['post']('/unhold',auth[_0x29f6('0x6')](),auth[_0x29f6('0x9')](),controller['unhold']);router[_0x29f6('0x2')](_0x29f6('0xb'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller['calls']);router['post'](_0x29f6('0xc'),auth[_0x29f6('0x6')](),auth[_0x29f6('0x9')](),controller[_0x29f6('0xd')]);module[_0x29f6('0xe')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index de6d115..09dce07 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 _0x2750=['../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','transferNumber\x20is\x20required','info','handleError:','error','stack','name','status','send','NotFound','request','code','message','result','catch','User','agent','then','VoiceChannels','all','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','sessionId','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','filter','rows','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path'];(function(_0x27a5b8,_0x10b486){var _0x31d17e=function(_0x4e852){while(--_0x4e852){_0x27a5b8['push'](_0x27a5b8['shift']());}};_0x31d17e(++_0x10b486);}(_0x2750,0x13b));var _0x0275=function(_0x5ae687,_0x2f8196){_0x5ae687=_0x5ae687-0x0;var _0x224cf5=_0x2750[_0x5ae687];return _0x224cf5;};'use strict';var path=require(_0x0275('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x0275('0x1'))['db'];var config=require(_0x0275('0x2'));var util=require(_0x0275('0x3'));var BPromise=require(_0x0275('0x4'));var jayson=require(_0x0275('0x5'));var amiClient=jayson[_0x0275('0x6')][_0x0275('0x7')]({'port':0x232a});var logger=require(_0x0275('0x8'))(_0x0275('0x9'));var Redis=require(_0x0275('0xa'));config['redis']=_[_0x0275('0xb')](config[_0x0275('0xc')],{'host':_0x0275('0xd'),'port':0x18eb});var io=require(_0x0275('0xe'))(new Redis(config['redis']));var Schema=require(_0x0275('0xf'));var originateValidation=new Schema({'userId':{'type':_0x0275('0x10'),'required':[!![],_0x0275('0x11')]},'callNumber':{'type':'string','required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x0275('0x12')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x0275('0x10'),'required':[!![],_0x0275('0x11')]},'sessionId':{'type':_0x0275('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x0275('0x10'),'required':[!![],_0x0275('0x11')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x0275('0x10'),'required':[!![],_0x0275('0x11')]},'sessionId':{'type':_0x0275('0x12'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],_0x0275('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x0275('0x10'),'required':[!![],_0x0275('0x11')]},'sessionId':{'type':_0x0275('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x0275('0x10'),'required':[!![],_0x0275('0x11')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x0275('0x10'),'required':[!![],_0x0275('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x0275('0x11')]}});function emit(_0xaae367,_0x4a40da,_0x10dd2c){logger[_0x0275('0x14')](_0xaae367,_0x4a40da,JSON['stringify'](_0x10dd2c));io['to'](_0xaae367)['emit'](_0x4a40da,_0x10dd2c);}function handleError(_0x56e719){return function(_0x591d27){console['log'](_0x0275('0x15'),_0x591d27,_0x591d27 instanceof RangeError);logger[_0x0275('0x16')](_0x591d27[_0x0275('0x17')]);if(_0x591d27 instanceof RangeError){if(_0x591d27['name']){delete _0x591d27[_0x0275('0x18')];}_0x56e719[_0x0275('0x19')](0x194)[_0x0275('0x1a')](_0x591d27);}else{if(_0x591d27['name']){delete _0x591d27[_0x0275('0x18')];}_0x56e719[_0x0275('0x19')](0x1f4)['send'](_0x591d27);}};}function checkError(){return function(_0x4a5bc1){if(!_0x4a5bc1){throw new RangeError(_0x0275('0x1b'));}return _0x4a5bc1;};}function respondWithRpcPromise(_0xfe9f2f,_0x562c82){return new BPromise(function(_0x592a53,_0xf3b68e){var _0x5ab9e7=amiClient;return _0x5ab9e7[_0x0275('0x1c')](_0xfe9f2f,_0x562c82)['then'](function(_0x26f2c2){if(_0x26f2c2[_0x0275('0x16')]){if(_0x26f2c2['error'][_0x0275('0x1d')]===0x1f4){return _0xf3b68e(_0x26f2c2[_0x0275('0x16')][_0x0275('0x1e')]);}return _0x592a53(_0x26f2c2['error'][_0x0275('0x1e')]);}else{_0x592a53(_0x26f2c2[_0x0275('0x1f')]);}})[_0x0275('0x20')](function(_0x15813f){_0xf3b68e(_0x15813f);});});}function getAgent(_0x1a2024){return db[_0x0275('0x21')]['findOne']({'where':{'id':_0x1a2024,'role':_0x0275('0x22')}})[_0x0275('0x23')](checkError());}function getAgentCheckSession(_0x1d24b2,_0x275dac){return new BPromise(function(_0x4689a3,_0x512d26){var _0x1ffd57=respondWithRpcPromise(_0x0275('0x24'));var _0x3246ea=getAgent(_0x1d24b2);Promise[_0x0275('0x25')]([_0x1ffd57,_0x3246ea])[_0x0275('0x23')](function(_0x49e645){var _0x2d49b4=_0x49e645[0x0];var _0x287be3=_0x49e645[0x1];var _0x127bbd=_['filter'](_0x2d49b4['rows'],function(_0x3cb2d7){return _0x3cb2d7[_0x0275('0x26')]==_0x287be3['id']&&_0x3cb2d7['sessionId']==_0x275dac;});if(_0x127bbd[_0x0275('0x27')]==0x1){_0x4689a3(_0x287be3);}else{_0x512d26(new RangeError(_0x0275('0x28')+_0x275dac+_0x0275('0x29')));}});});}exports[_0x0275('0x2a')]=function(_0x5d763d,_0x24c762){logger[_0x0275('0x14')](_0x0275('0x2b'),_0x5d763d[_0x0275('0x2c')]);var _0x58da2d=originateValidation[_0x0275('0xf')](_0x5d763d['body']);if(_0x58da2d[_0x0275('0x27')]>0x0){return _0x24c762['status'](0x190)[_0x0275('0x2d')](_0x58da2d);}var _0x165157=_0x5d763d['body'][_0x0275('0x2e')];var _0x459f83=_0x5d763d[_0x0275('0x2c')][_0x0275('0x2f')];var _0x487b97=_0x5d763d[_0x0275('0x2c')][_0x0275('0x30')];var _0xbe4741=_0x5d763d[_0x0275('0x2c')][_0x0275('0x31')];return getAgent(_0x165157)['then'](function(_0x2a18c3){logger[_0x0275('0x14')](_0x0275('0x32'),_0x2a18c3[_0x0275('0x18')]);emit(util[_0x0275('0x33')](_0x0275('0x34'),_0x2a18c3[_0x0275('0x18')]),_0x0275('0x35'),{'callNumber':_0x459f83,'callerId':_0x487b97,'callbackUrl':_0xbe4741});return _0x24c762[_0x0275('0x19')](0xc8)[_0x0275('0x2d')]({'error':![],'message':_0x0275('0x36')});})['catch'](handleError(_0x24c762));};exports[_0x0275('0x37')]=function(_0xa93bae,_0xc7d2fe){logger[_0x0275('0x14')](_0x0275('0x38'),_0xa93bae[_0x0275('0x2c')]);var _0x1a2424=hangupValidation[_0x0275('0xf')](_0xa93bae[_0x0275('0x2c')]);if(_0x1a2424[_0x0275('0x27')]>0x0){return _0xc7d2fe[_0x0275('0x19')](0x190)[_0x0275('0x2d')](_0x1a2424);}var _0x32f0cf=_0xa93bae[_0x0275('0x2c')]['userId'];var _0x3c81fc=_0xa93bae[_0x0275('0x2c')]['sessionId'];return getAgent(_0x32f0cf)[_0x0275('0x23')](function(_0x76b8fa){logger[_0x0275('0x14')](_0x0275('0x32'),_0x76b8fa[_0x0275('0x18')]);emit(util[_0x0275('0x33')](_0x0275('0x34'),_0x76b8fa['name']),_0x0275('0x39'),{'sessionId':_0x3c81fc});return _0xc7d2fe[_0x0275('0x19')](0xc8)[_0x0275('0x2d')]({'error':![],'message':_0x0275('0x3a')});})['catch'](handleError(_0xc7d2fe));};exports[_0x0275('0x3b')]=function(_0x1f781b,_0x3f37cb){logger[_0x0275('0x14')]('answer\x20fired:',_0x1f781b[_0x0275('0x2c')]);var _0x52f69c=answerValidation[_0x0275('0xf')](_0x1f781b[_0x0275('0x2c')]);if(_0x52f69c[_0x0275('0x27')]>0x0){return _0x3f37cb[_0x0275('0x19')](0x190)['json'](_0x52f69c);}var _0x13c651=_0x1f781b[_0x0275('0x2c')]['userId'];var _0x1e143e=_0x1f781b[_0x0275('0x2c')][_0x0275('0x3c')];return getAgent(_0x13c651)['then'](function(_0x162327){logger[_0x0275('0x14')]('entityFound:',_0x162327[_0x0275('0x18')]);emit(util[_0x0275('0x33')](_0x0275('0x34'),_0x162327[_0x0275('0x18')]),_0x0275('0x3d'),{'sessionId':_0x1e143e});return _0x3f37cb[_0x0275('0x19')](0xc8)[_0x0275('0x2d')]({'error':![],'message':_0x0275('0x3e')});})[_0x0275('0x20')](handleError(_0x3f37cb));};exports[_0x0275('0x3f')]=function(_0x28b9ad,_0x4d6757){logger[_0x0275('0x14')](_0x0275('0x40'),_0x28b9ad[_0x0275('0x2c')]);var _0x33617b=holdValidation[_0x0275('0xf')](_0x28b9ad[_0x0275('0x2c')]);if(_0x33617b[_0x0275('0x27')]>0x0){return _0x4d6757[_0x0275('0x19')](0x190)[_0x0275('0x2d')](_0x33617b);}var _0x3ac454=_0x28b9ad[_0x0275('0x2c')]['userId'];var _0x589401=_0x28b9ad[_0x0275('0x2c')][_0x0275('0x3c')];return getAgent(_0x3ac454)[_0x0275('0x23')](function(_0x3bd019){logger[_0x0275('0x14')]('entityFound:',_0x3bd019[_0x0275('0x18')]);emit(util['format'](_0x0275('0x34'),_0x3bd019[_0x0275('0x18')]),_0x0275('0x41'),{'sessionId':_0x589401});return _0x4d6757[_0x0275('0x19')](0xc8)['json']({'error':![],'message':_0x0275('0x42')});})['catch'](handleError(_0x4d6757));};exports['unhold']=function(_0x515860,_0x28e90f){logger['info'](_0x0275('0x43'),_0x515860[_0x0275('0x2c')]);var _0x21375e=unholdValidation[_0x0275('0xf')](_0x515860[_0x0275('0x2c')]);if(_0x21375e[_0x0275('0x27')]>0x0){return _0x28e90f[_0x0275('0x19')](0x190)['json'](_0x21375e);}var _0xe6f266=_0x515860['body'][_0x0275('0x2e')];var _0x1c70ed=_0x515860[_0x0275('0x2c')][_0x0275('0x3c')];return getAgent(_0xe6f266)[_0x0275('0x23')](function(_0x4097e8){logger[_0x0275('0x14')](_0x0275('0x32'),_0x4097e8[_0x0275('0x18')]);emit(util[_0x0275('0x33')]('user:%s',_0x4097e8['name']),_0x0275('0x44'),{'sessionId':_0x1c70ed});return _0x28e90f['status'](0xc8)['json']({'error':![],'message':_0x0275('0x45')});})[_0x0275('0x20')](handleError(_0x28e90f));};exports[_0x0275('0x46')]=function(_0x39961c,_0x35994c){logger[_0x0275('0x14')]('calls\x20fired:',_0x35994c[_0x0275('0x2c')]);var _0x163ce2=callsValidation[_0x0275('0xf')](_0x39961c[_0x0275('0x2c')]);if(_0x163ce2[_0x0275('0x27')]>0x0){return _0x35994c[_0x0275('0x19')](0x190)['json'](_0x163ce2);}var _0x33556f=_0x39961c[_0x0275('0x2c')]['userId'];var _0x19d33f=respondWithRpcPromise('VoiceChannels');var _0x4f4e13=getAgent(_0x33556f);return Promise[_0x0275('0x25')]([_0x19d33f,_0x4f4e13])[_0x0275('0x23')](function(_0x3ae09e){var _0x2258f1=_0x3ae09e[0x0];var _0x7749c4=_0x3ae09e[0x1];var _0x30ad5b=_[_0x0275('0x47')](_0x2258f1[_0x0275('0x48')],function(_0x442a7a){return _0x442a7a[_0x0275('0x26')]==_0x7749c4['id'];});return _0x35994c['status'](0xc8)[_0x0275('0x2d')]({'count':_0x30ad5b[_0x0275('0x27')],'rows':_0x30ad5b});})[_0x0275('0x20')](handleError(_0x35994c));};exports['conference']=function(_0x1d408f,_0x126f05){logger['info'](_0x0275('0x49'),_0x1d408f['body']);var _0x4542b0=conferenceValidation[_0x0275('0xf')](_0x1d408f[_0x0275('0x2c')]);if(_0x4542b0[_0x0275('0x27')]>0x0){return _0x126f05['status'](0x190)[_0x0275('0x2d')](_0x4542b0);}var _0x59947e=_0x1d408f[_0x0275('0x2c')][_0x0275('0x2e')];return getAgent(_0x59947e)['then'](function(_0x29f71d){logger[_0x0275('0x14')]('entityFound:',_0x29f71d[_0x0275('0x18')]);emit(util[_0x0275('0x33')]('user:%s',_0x29f71d['name']),_0x0275('0x4a'));return _0x126f05[_0x0275('0x19')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0x0275('0x20')](handleError(_0x126f05));};exports[_0x0275('0x4b')]=function(_0x93831b,_0x14b5ab){logger[_0x0275('0x14')](_0x0275('0x4c'),_0x93831b[_0x0275('0x2c')]);var _0x2b7a93=transferValidation['validate'](_0x93831b[_0x0275('0x2c')]);if(_0x2b7a93[_0x0275('0x27')]>0x0){return _0x14b5ab[_0x0275('0x19')](0x190)[_0x0275('0x2d')](_0x2b7a93);}var _0x3e4e09=_0x93831b[_0x0275('0x2c')]['userId'];var _0x1a4b01=_0x93831b['body'][_0x0275('0x3c')];var _0x287429=_0x93831b[_0x0275('0x2c')][_0x0275('0x4d')];return getAgent(_0x3e4e09)['then'](function(_0x38d006){logger[_0x0275('0x14')](_0x0275('0x32'),_0x38d006[_0x0275('0x18')]);emit(util[_0x0275('0x33')](_0x0275('0x34'),_0x38d006[_0x0275('0x18')]),_0x0275('0x4e'),{'sessionId':_0x1a4b01,'transferNumber':_0x287429});return _0x14b5ab[_0x0275('0x19')](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x14b5ab));}; \ No newline at end of file +var _0x3667=['defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','stack','name','send','request','then','error','code','message','catch','User','agent','VoiceChannels','filter','rows','UserId','sessionId','originate\x20fired:','body','length','json','userId','callNumber','callerId','entityFound:','format','status','hangup\x20fired:','user:%s','webbar:answer','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis'];(function(_0x469d90,_0x4ddc77){var _0xb98ba5=function(_0x6979c3){while(--_0x6979c3){_0x469d90['push'](_0x469d90['shift']());}};_0xb98ba5(++_0x4ddc77);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x7366('0x0'));var fs=require('fs');var _=require(_0x7366('0x1'));var db=require(_0x7366('0x2'))['db'];var config=require(_0x7366('0x3'));var util=require(_0x7366('0x4'));var BPromise=require('bluebird');var jayson=require(_0x7366('0x5'));var amiClient=jayson[_0x7366('0x6')]['http']({'port':0x232a});var logger=require(_0x7366('0x7'))(_0x7366('0x8'));var Redis=require(_0x7366('0x9'));config[_0x7366('0xa')]=_[_0x7366('0xb')](config['redis'],{'host':_0x7366('0xc'),'port':0x18eb});var io=require(_0x7366('0xd'))(new Redis(config[_0x7366('0xa')]));var Schema=require(_0x7366('0xe'));var originateValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'callNumber':{'type':_0x7366('0x11'),'required':[!![],_0x7366('0x12')]},'callerId':{'type':_0x7366('0x11')},'callbackUrl':{'type':_0x7366('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':[!![],_0x7366('0x13')]},'transferNumber':{'type':_0x7366('0x11'),'required':[!![],_0x7366('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7366('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]}});function emit(_0x2c0422,_0xe2c87b,_0x431c01){logger[_0x7366('0x15')](_0x2c0422,_0xe2c87b,JSON[_0x7366('0x16')](_0x431c01));io['to'](_0x2c0422)[_0x7366('0x17')](_0xe2c87b,_0x431c01);}function handleError(_0x41113f){return function(_0x1a71f5){console['log'](_0x7366('0x18'),_0x1a71f5,_0x1a71f5 instanceof RangeError);logger['error'](_0x1a71f5[_0x7366('0x19')]);if(_0x1a71f5 instanceof RangeError){if(_0x1a71f5[_0x7366('0x1a')]){delete _0x1a71f5[_0x7366('0x1a')];}_0x41113f['status'](0x194)[_0x7366('0x1b')](_0x1a71f5);}else{if(_0x1a71f5[_0x7366('0x1a')]){delete _0x1a71f5[_0x7366('0x1a')];}_0x41113f['status'](0x1f4)[_0x7366('0x1b')](_0x1a71f5);}};}function checkError(){return function(_0x1946c6){if(!_0x1946c6){throw new RangeError('NotFound');}return _0x1946c6;};}function respondWithRpcPromise(_0x3bfbca,_0x411dfe){return new BPromise(function(_0xaab659,_0x1a12d2){var _0x3c30a2=amiClient;return _0x3c30a2[_0x7366('0x1c')](_0x3bfbca,_0x411dfe)[_0x7366('0x1d')](function(_0x22ed7e){if(_0x22ed7e[_0x7366('0x1e')]){if(_0x22ed7e[_0x7366('0x1e')][_0x7366('0x1f')]===0x1f4){return _0x1a12d2(_0x22ed7e[_0x7366('0x1e')][_0x7366('0x20')]);}return _0xaab659(_0x22ed7e['error'][_0x7366('0x20')]);}else{_0xaab659(_0x22ed7e['result']);}})[_0x7366('0x21')](function(_0x4ab987){_0x1a12d2(_0x4ab987);});});}function getAgent(_0x5e30fb){return db[_0x7366('0x22')]['findOne']({'where':{'id':_0x5e30fb,'role':_0x7366('0x23')}})['then'](checkError());}function getAgentCheckSession(_0x256633,_0x191177){return new BPromise(function(_0x5c37e2,_0x6d196a){var _0x565aa7=respondWithRpcPromise(_0x7366('0x24'));var _0x2b61af=getAgent(_0x256633);Promise['all']([_0x565aa7,_0x2b61af])[_0x7366('0x1d')](function(_0x507baf){var _0xc58ac7=_0x507baf[0x0];var _0x46f80f=_0x507baf[0x1];var _0x39d6ea=_[_0x7366('0x25')](_0xc58ac7[_0x7366('0x26')],function(_0x5e075c){return _0x5e075c[_0x7366('0x27')]==_0x46f80f['id']&&_0x5e075c[_0x7366('0x28')]==_0x191177;});if(_0x39d6ea['length']==0x1){_0x5c37e2(_0x46f80f);}else{_0x6d196a(new RangeError('sessionId\x20'+_0x191177+'\x20not\x20found!'));}});});}exports['originate']=function(_0x2a1d46,_0x43d487){logger[_0x7366('0x15')](_0x7366('0x29'),_0x2a1d46['body']);var _0x3ca5e6=originateValidation[_0x7366('0xe')](_0x2a1d46[_0x7366('0x2a')]);if(_0x3ca5e6[_0x7366('0x2b')]>0x0){return _0x43d487['status'](0x190)[_0x7366('0x2c')](_0x3ca5e6);}var _0x311dab=_0x2a1d46['body'][_0x7366('0x2d')];var _0x44c81e=_0x2a1d46[_0x7366('0x2a')][_0x7366('0x2e')];var _0x7779c7=_0x2a1d46[_0x7366('0x2a')][_0x7366('0x2f')];var _0x26858b=_0x2a1d46[_0x7366('0x2a')]['callbackUrl'];return getAgent(_0x311dab)[_0x7366('0x1d')](function(_0x83b879){logger['info'](_0x7366('0x30'),_0x83b879[_0x7366('0x1a')]);emit(util[_0x7366('0x31')]('user:%s',_0x83b879[_0x7366('0x1a')]),'webbar:originate',{'callNumber':_0x44c81e,'callerId':_0x7779c7,'callbackUrl':_0x26858b});return _0x43d487[_0x7366('0x32')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0x7366('0x21')](handleError(_0x43d487));};exports['hangup']=function(_0x3228b5,_0x116081){logger['info'](_0x7366('0x33'),_0x3228b5['body']);var _0x36f861=hangupValidation[_0x7366('0xe')](_0x3228b5[_0x7366('0x2a')]);if(_0x36f861[_0x7366('0x2b')]>0x0){return _0x116081['status'](0x190)[_0x7366('0x2c')](_0x36f861);}var _0x1d8be3=_0x3228b5[_0x7366('0x2a')]['userId'];var _0x487e36=_0x3228b5[_0x7366('0x2a')][_0x7366('0x28')];return getAgent(_0x1d8be3)[_0x7366('0x1d')](function(_0x18e9b1){logger[_0x7366('0x15')](_0x7366('0x30'),_0x18e9b1['name']);emit(util['format'](_0x7366('0x34'),_0x18e9b1[_0x7366('0x1a')]),'webbar:hangup',{'sessionId':_0x487e36});return _0x116081[_0x7366('0x32')](0xc8)[_0x7366('0x2c')]({'error':![],'message':'hangup\x20executed!'});})[_0x7366('0x21')](handleError(_0x116081));};exports['answer']=function(_0xafac5,_0x1834cf){logger['info']('answer\x20fired:',_0xafac5[_0x7366('0x2a')]);var _0xedc3c7=answerValidation[_0x7366('0xe')](_0xafac5[_0x7366('0x2a')]);if(_0xedc3c7['length']>0x0){return _0x1834cf[_0x7366('0x32')](0x190)[_0x7366('0x2c')](_0xedc3c7);}var _0xb9d7e4=_0xafac5[_0x7366('0x2a')][_0x7366('0x2d')];var _0x3d8c79=_0xafac5[_0x7366('0x2a')]['sessionId'];return getAgent(_0xb9d7e4)[_0x7366('0x1d')](function(_0x320fc2){logger[_0x7366('0x15')]('entityFound:',_0x320fc2[_0x7366('0x1a')]);emit(util[_0x7366('0x31')]('user:%s',_0x320fc2[_0x7366('0x1a')]),_0x7366('0x35'),{'sessionId':_0x3d8c79});return _0x1834cf[_0x7366('0x32')](0xc8)['json']({'error':![],'message':_0x7366('0x36')});})[_0x7366('0x21')](handleError(_0x1834cf));};exports[_0x7366('0x37')]=function(_0x570459,_0x37b251){logger[_0x7366('0x15')](_0x7366('0x38'),_0x570459['body']);var _0xb32e28=holdValidation[_0x7366('0xe')](_0x570459[_0x7366('0x2a')]);if(_0xb32e28[_0x7366('0x2b')]>0x0){return _0x37b251['status'](0x190)[_0x7366('0x2c')](_0xb32e28);}var _0x2d1c52=_0x570459[_0x7366('0x2a')][_0x7366('0x2d')];var _0x3cf180=_0x570459[_0x7366('0x2a')][_0x7366('0x28')];return getAgent(_0x2d1c52)[_0x7366('0x1d')](function(_0x2ad8bf){logger['info'](_0x7366('0x30'),_0x2ad8bf[_0x7366('0x1a')]);emit(util['format'](_0x7366('0x34'),_0x2ad8bf[_0x7366('0x1a')]),'webbar:hold',{'sessionId':_0x3cf180});return _0x37b251[_0x7366('0x32')](0xc8)['json']({'error':![],'message':_0x7366('0x39')});})[_0x7366('0x21')](handleError(_0x37b251));};exports[_0x7366('0x3a')]=function(_0x22026a,_0x588b31){logger[_0x7366('0x15')](_0x7366('0x3b'),_0x22026a[_0x7366('0x2a')]);var _0x46a532=unholdValidation[_0x7366('0xe')](_0x22026a[_0x7366('0x2a')]);if(_0x46a532[_0x7366('0x2b')]>0x0){return _0x588b31[_0x7366('0x32')](0x190)[_0x7366('0x2c')](_0x46a532);}var _0x336b4d=_0x22026a[_0x7366('0x2a')][_0x7366('0x2d')];var _0x5d2a2c=_0x22026a[_0x7366('0x2a')]['sessionId'];return getAgent(_0x336b4d)['then'](function(_0x1d488b){logger[_0x7366('0x15')]('entityFound:',_0x1d488b[_0x7366('0x1a')]);emit(util[_0x7366('0x31')]('user:%s',_0x1d488b['name']),_0x7366('0x3c'),{'sessionId':_0x5d2a2c});return _0x588b31['status'](0xc8)[_0x7366('0x2c')]({'error':![],'message':_0x7366('0x3d')});})['catch'](handleError(_0x588b31));};exports[_0x7366('0x3e')]=function(_0x1b3923,_0xcce4ef){logger['info'](_0x7366('0x3f'),_0xcce4ef[_0x7366('0x2a')]);var _0x2ca931=callsValidation[_0x7366('0xe')](_0x1b3923['body']);if(_0x2ca931[_0x7366('0x2b')]>0x0){return _0xcce4ef[_0x7366('0x32')](0x190)[_0x7366('0x2c')](_0x2ca931);}var _0xa15c2b=_0x1b3923[_0x7366('0x2a')]['userId'];var _0x1249a7=respondWithRpcPromise(_0x7366('0x24'));var _0x5b3160=getAgent(_0xa15c2b);return Promise[_0x7366('0x40')]([_0x1249a7,_0x5b3160])['then'](function(_0x2335cc){var _0x5cbefc=_0x2335cc[0x0];var _0x427066=_0x2335cc[0x1];var _0x16d438=_['filter'](_0x5cbefc[_0x7366('0x26')],function(_0xec468a){return _0xec468a[_0x7366('0x27')]==_0x427066['id'];});return _0xcce4ef[_0x7366('0x32')](0xc8)['json']({'count':_0x16d438['length'],'rows':_0x16d438});})[_0x7366('0x21')](handleError(_0xcce4ef));};exports['conference']=function(_0x432755,_0x14f758){logger[_0x7366('0x15')](_0x7366('0x41'),_0x432755[_0x7366('0x2a')]);var _0x3e64b7=conferenceValidation[_0x7366('0xe')](_0x432755[_0x7366('0x2a')]);if(_0x3e64b7[_0x7366('0x2b')]>0x0){return _0x14f758['status'](0x190)[_0x7366('0x2c')](_0x3e64b7);}var _0x52d254=_0x432755['body']['userId'];return getAgent(_0x52d254)[_0x7366('0x1d')](function(_0x523016){logger[_0x7366('0x15')]('entityFound:',_0x523016[_0x7366('0x1a')]);emit(util['format'](_0x7366('0x34'),_0x523016[_0x7366('0x1a')]),'webbar:conference');return _0x14f758['status'](0xc8)[_0x7366('0x2c')]({'error':![],'message':_0x7366('0x42')});})[_0x7366('0x21')](handleError(_0x14f758));};exports[_0x7366('0x43')]=function(_0x5dc9e2,_0x349bd2){logger[_0x7366('0x15')](_0x7366('0x44'),_0x5dc9e2['body']);var _0x5a9aeb=transferValidation[_0x7366('0xe')](_0x5dc9e2[_0x7366('0x2a')]);if(_0x5a9aeb[_0x7366('0x2b')]>0x0){return _0x349bd2['status'](0x190)[_0x7366('0x2c')](_0x5a9aeb);}var _0x1e121f=_0x5dc9e2[_0x7366('0x2a')][_0x7366('0x2d')];var _0x3aa57b=_0x5dc9e2[_0x7366('0x2a')][_0x7366('0x28')];var _0x38c65b=_0x5dc9e2[_0x7366('0x2a')][_0x7366('0x45')];return getAgent(_0x1e121f)[_0x7366('0x1d')](function(_0x5d5c2e){logger[_0x7366('0x15')](_0x7366('0x30'),_0x5d5c2e['name']);emit(util[_0x7366('0x31')]('user:%s',_0x5d5c2e['name']),_0x7366('0x46'),{'sessionId':_0x3aa57b,'transferNumber':_0x38c65b});return _0x349bd2[_0x7366('0x32')](0xc8)[_0x7366('0x2c')]({'error':![],'message':_0x7366('0x47')});})[_0x7366('0x21')](handleError(_0x349bd2));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 568e31d..1e2d3ff 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 _0x8351=['getAgents','/:id/applications','getApplications','post','create','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','/:id/users'];(function(_0x31e5cb,_0x2f5adf){var _0x4170df=function(_0x31c53e){while(--_0x31c53e){_0x31e5cb['push'](_0x31e5cb['shift']());}};_0x4170df(++_0x2f5adf);}(_0x8351,0x1ab));var _0x1835=function(_0x27bed4,_0xf17e71){_0x27bed4=_0x27bed4-0x0;var _0x412e9d=_0x8351[_0x27bed4];return _0x412e9d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1835('0x0'));var timeout=require(_0x1835('0x1'));var express=require('express');var router=express[_0x1835('0x2')]();var fs_extra=require(_0x1835('0x3'));var auth=require(_0x1835('0x4'));var interaction=require(_0x1835('0x5'));var config=require(_0x1835('0x6'));var controller=require(_0x1835('0x7'));router[_0x1835('0x8')]('/',auth[_0x1835('0x9')](),controller[_0x1835('0xa')]);router[_0x1835('0x8')](_0x1835('0xb'),auth[_0x1835('0x9')](),controller[_0x1835('0xc')]);router[_0x1835('0x8')](_0x1835('0xd'),auth[_0x1835('0x9')](),controller['show']);router['get'](_0x1835('0xe'),auth[_0x1835('0x9')](),controller['getDispositions']);router['get'](_0x1835('0xf'),auth[_0x1835('0x9')](),controller['getAnswers']);router[_0x1835('0x8')](_0x1835('0x10'),auth['isAuthenticated'](),controller[_0x1835('0x11')]);router['get'](_0x1835('0x12'),auth[_0x1835('0x9')](),controller[_0x1835('0x13')]);router[_0x1835('0x14')]('/',auth[_0x1835('0x9')](),controller[_0x1835('0x15')]);router[_0x1835('0x14')]('/:id/dispositions',auth[_0x1835('0x9')](),controller['addDisposition']);router['post'](_0x1835('0xf'),auth[_0x1835('0x9')](),controller[_0x1835('0x16')]);router['post'](_0x1835('0x10'),auth[_0x1835('0x9')](),controller[_0x1835('0x17')]);router[_0x1835('0x14')](_0x1835('0x12'),auth[_0x1835('0x9')](),controller[_0x1835('0x18')]);router[_0x1835('0x14')](_0x1835('0x19'),controller[_0x1835('0x1a')]);router[_0x1835('0x14')](_0x1835('0x1b'),auth[_0x1835('0x9')](),controller[_0x1835('0x1c')]);router[_0x1835('0x1d')]('/:id',auth[_0x1835('0x9')](),controller[_0x1835('0x1e')]);router[_0x1835('0x1f')](_0x1835('0xd'),auth[_0x1835('0x9')](),controller[_0x1835('0x20')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x1835('0x21')]);router['delete'](_0x1835('0xf'),auth[_0x1835('0x9')](),controller[_0x1835('0x22')]);router[_0x1835('0x1f')](_0x1835('0x10'),auth[_0x1835('0x9')](),controller[_0x1835('0x23')]);module[_0x1835('0x24')]=router; \ No newline at end of file +var _0x094e=['show','/:id/dispositions','getDispositions','/:id/canned_answers','post','create','addDisposition','addAnswer','/:id/users','addAgents','/:id/applications','addApplications','notify','/:id/send','send','update','delete','removeDispositions','removeAnswers','removeAgents','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x4c9996,_0x2873bb){var _0x1e74e2=function(_0xc88e63){while(--_0xc88e63){_0x4c9996['push'](_0x4c9996['shift']());}};_0x1e74e2(++_0x2873bb);}(_0x094e,0x114));var _0xe094=function(_0x138b4a,_0xc87913){_0x138b4a=_0x138b4a-0x0;var _0x346cab=_0x094e[_0x138b4a];return _0x346cab;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe094('0x0'));var timeout=require(_0xe094('0x1'));var express=require(_0xe094('0x2'));var router=express[_0xe094('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe094('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe094('0x5'));var controller=require(_0xe094('0x6'));router[_0xe094('0x7')]('/',auth[_0xe094('0x8')](),controller[_0xe094('0x9')]);router['get'](_0xe094('0xa'),auth[_0xe094('0x8')](),controller['describe']);router[_0xe094('0x7')](_0xe094('0xb'),auth[_0xe094('0x8')](),controller[_0xe094('0xc')]);router['get'](_0xe094('0xd'),auth[_0xe094('0x8')](),controller[_0xe094('0xe')]);router['get'](_0xe094('0xf'),auth[_0xe094('0x8')](),controller['getAnswers']);router[_0xe094('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xe094('0x7')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0xe094('0x10')]('/',auth[_0xe094('0x8')](),controller[_0xe094('0x11')]);router['post'](_0xe094('0xd'),auth['isAuthenticated'](),controller[_0xe094('0x12')]);router[_0xe094('0x10')](_0xe094('0xf'),auth[_0xe094('0x8')](),controller[_0xe094('0x13')]);router[_0xe094('0x10')](_0xe094('0x14'),auth['isAuthenticated'](),controller[_0xe094('0x15')]);router[_0xe094('0x10')](_0xe094('0x16'),auth[_0xe094('0x8')](),controller[_0xe094('0x17')]);router[_0xe094('0x10')]('/:id/notify',controller[_0xe094('0x18')]);router['post'](_0xe094('0x19'),auth['isAuthenticated'](),controller[_0xe094('0x1a')]);router['put'](_0xe094('0xb'),auth[_0xe094('0x8')](),controller[_0xe094('0x1b')]);router[_0xe094('0x1c')](_0xe094('0xb'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xe094('0xd'),auth[_0xe094('0x8')](),controller[_0xe094('0x1d')]);router[_0xe094('0x1c')](_0xe094('0xf'),auth[_0xe094('0x8')](),controller[_0xe094('0x1e')]);router[_0xe094('0x1c')](_0xe094('0x14'),auth[_0xe094('0x8')](),controller[_0xe094('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 369946f..ecd79e0 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 _0x9235=['name','generate','STRING','twilio','sinch','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','randomstring','exports'];(function(_0x1b666c,_0x157904){var _0x34c556=function(_0x5f2939){while(--_0x5f2939){_0x1b666c['push'](_0x1b666c['shift']());}};_0x34c556(++_0x157904);}(_0x9235,0x101));var _0x5923=function(_0x33ba7a,_0x36d054){_0x33ba7a=_0x33ba7a-0x0;var _0x5234e8=_0x9235[_0x33ba7a];return _0x5234e8;};'use strict';var Sequelize=require(_0x5923('0x0'));var rs=require(_0x5923('0x1'));module[_0x5923('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x5923('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x5923('0x4')]();}},'phone':{'type':Sequelize[_0x5923('0x5')]},'type':{'type':Sequelize['ENUM'](_0x5923('0x6'),_0x5923('0x7'))},'accountSid':{'type':Sequelize[_0x5923('0x5')]},'baseUrl':{'type':Sequelize[_0x5923('0x5')]},'authToken':{'type':Sequelize[_0x5923('0x5')]},'notificationTemplate':{'type':Sequelize[_0x5923('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5923('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5923('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x5923('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5923('0xa')],'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[_0x5923('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5923('0xb'),'set':function(_0x1220b3){if(!_0x1220b3){this[_0x5923('0xc')]('mandatoryDispositionPauseId',null);}this['setDataValue']('mandatoryDisposition',_0x1220b3);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3647=['STRING','name','generate','ENUM','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x3601ae,_0x2ba624){var _0x2a94fc=function(_0x3428df){while(--_0x3428df){_0x3601ae['push'](_0x3601ae['shift']());}};_0x2a94fc(++_0x2ba624);}(_0x3647,0x74));var _0x7364=function(_0x53a839,_0x47388c){_0x53a839=_0x53a839-0x0;var _0x2058bc=_0x3647[_0x53a839];return _0x2058bc;};'use strict';var Sequelize=require(_0x7364('0x0'));var rs=require(_0x7364('0x1'));module[_0x7364('0x2')]={'name':{'type':Sequelize[_0x7364('0x3')],'unique':_0x7364('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x7364('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x7364('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x7364('0x3')],'defaultValue':function(){return rs[_0x7364('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7364('0x6')]('twilio',_0x7364('0x7'))},'accountSid':{'type':Sequelize[_0x7364('0x3')]},'baseUrl':{'type':Sequelize[_0x7364('0x3')]},'authToken':{'type':Sequelize[_0x7364('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7364('0x8')],'defaultValue':function(){return _0x7364('0x9');}},'notificationSound':{'type':Sequelize[_0x7364('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7364('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7364('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7364('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7364('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7364('0xb')],'comment':_0x7364('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x7364('0xa')],'defaultValue':![],'comment':_0x7364('0xd'),'set':function(_0x545732){if(!_0x545732){this[_0x7364('0xe')](_0x7364('0xf'),null);}this['setDataValue'](_0x7364('0x10'),_0x545732);}},'description':{'type':Sequelize[_0x7364('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 939ba4c..9d1f2fa 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 _0xa8ae=['limit','count','set','reject','update','destroy','get','WhatsappAccounts','stack','name','Pause','fieldName','type','model','map','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','WhatsappAccount','includeAll','findAll','mandatoryDispositionPause','rawAttributes','keys','include','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','length','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addAgents','omit','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','send','whatsapp','Applications','account','sinch','statuses','state','read','timestamp','message_id','orderBy','asc','CmContact','ValidationError','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','whatsapp:','Body','messageId','MessageSid','notifications','isNil','Sequelize','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','contact','WhatsappInteraction','spread','interaction','applications','push','close','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','to\x20is\x20mandatory','List','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined'];(function(_0x3b950b,_0x41934a){var _0x5d6ddf=function(_0x4cda62){while(--_0x4cda62){_0x3b950b['push'](_0x3b950b['shift']());}};_0x5d6ddf(++_0x41934a);}(_0xa8ae,0x94));var _0xea8a=function(_0x277c86,_0x288ce1){_0x277c86=_0x277c86-0x0;var _0x3580d0=_0xa8ae[_0x277c86];return _0x3580d0;};'use strict';var emlformat=require(_0xea8a('0x0'));var rimraf=require(_0xea8a('0x1'));var zipdir=require(_0xea8a('0x2'));var jsonpatch=require(_0xea8a('0x3'));var rp=require(_0xea8a('0x4'));var moment=require(_0xea8a('0x5'));var BPromise=require(_0xea8a('0x6'));var Mustache=require(_0xea8a('0x7'));var util=require(_0xea8a('0x8'));var path=require('path');var sox=require(_0xea8a('0x9'));var csv=require(_0xea8a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea8a('0xb'));var squel=require(_0xea8a('0xc'));var crypto=require(_0xea8a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xea8a('0xe'));var toCsv=require(_0xea8a('0xa'));var querystring=require(_0xea8a('0xf'));var Papa=require(_0xea8a('0x10'));var Redis=require('ioredis');var authService=require(_0xea8a('0x11'));var qs=require(_0xea8a('0x12'));var as=require(_0xea8a('0x13'));var hardwareService=require(_0xea8a('0x14'));var logger=require(_0xea8a('0x15'))(_0xea8a('0x16'));var utils=require(_0xea8a('0x17'));var config=require(_0xea8a('0x18'));var licenseUtil=require(_0xea8a('0x19'));var db=require('../../mysqldb')['db'];config[_0xea8a('0x1a')]=_[_0xea8a('0x1b')](config['redis'],{'host':_0xea8a('0x1c'),'port':0x18eb});var socket=require(_0xea8a('0x1d'))(new Redis(config[_0xea8a('0x1a')]));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0xea8a('0x1e'));var client=jayson[_0xea8a('0x1f')][_0xea8a('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x37617b,_0x558db4,_0x10365f,_0xba4223){return new BPromise(function(_0x51576b,_0x1d9035){var _0x28a780=_0xba4223||client;return _0x28a780[_0xea8a('0x21')](_0x37617b,_0x10365f)[_0xea8a('0x22')](function(_0x46c1ab){logger[_0xea8a('0x23')](_0xea8a('0x24'),_0x558db4,'request\x20sent');logger[_0xea8a('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x558db4,'request\x20sent',JSON[_0xea8a('0x26')](_0x46c1ab));if(_0x46c1ab[_0xea8a('0x27')]){if(_0x46c1ab['error'][_0xea8a('0x28')]===0x1f4){logger[_0xea8a('0x27')](_0xea8a('0x24'),_0x558db4,_0x46c1ab[_0xea8a('0x27')][_0xea8a('0x29')]);return _0x1d9035(_0x46c1ab[_0xea8a('0x27')]['message']);}logger['error'](_0xea8a('0x24'),_0x558db4,_0x46c1ab[_0xea8a('0x27')][_0xea8a('0x29')]);return _0x51576b(_0x46c1ab[_0xea8a('0x27')][_0xea8a('0x29')]);}else{logger[_0xea8a('0x23')](_0xea8a('0x24'),_0x558db4,_0xea8a('0x2a'));_0x51576b(_0x46c1ab[_0xea8a('0x2b')][_0xea8a('0x29')]);}})[_0xea8a('0x2c')](function(_0x410f69){logger['error'](_0xea8a('0x24'),_0x558db4,_0x410f69);_0x1d9035(_0x410f69);});});}function respondWithStatusCode(_0x2255ca,_0x37e759){_0x37e759=_0x37e759||0xcc;return function(_0x109a88){if(_0x109a88){return _0x2255ca[_0xea8a('0x2d')](_0x37e759);}return _0x2255ca[_0xea8a('0x2e')](_0x37e759)[_0xea8a('0x2f')]();};}function respondWithResult(_0x52019f,_0x1c124d){_0x1c124d=_0x1c124d||0xc8;return function(_0x5f5c59){if(_0x5f5c59){return _0x52019f[_0xea8a('0x2e')](_0x1c124d)[_0xea8a('0x30')](_0x5f5c59);}};}function respondWithFilteredResult(_0x3ed604,_0x21a399){return function(_0xb019b2){if(_0xb019b2){var _0xe2a6f1=typeof _0x21a399[_0xea8a('0x31')]===_0xea8a('0x32')&&typeof _0x21a399[_0xea8a('0x33')]==='undefined';var _0x3cdfab=_0xb019b2[_0xea8a('0x34')];var _0x44d532=_0xe2a6f1?0x0:_0x21a399[_0xea8a('0x31')];var _0x4d8773=_0xe2a6f1?_0xb019b2['count']:_0x21a399[_0xea8a('0x31')]+_0x21a399[_0xea8a('0x33')];var _0x304f37;if(_0x4d8773>=_0x3cdfab){_0x4d8773=_0x3cdfab;_0x304f37=0xc8;}else{_0x304f37=0xce;}_0x3ed604[_0xea8a('0x2e')](_0x304f37);return _0x3ed604[_0xea8a('0x35')]('Content-Range',_0x44d532+'-'+_0x4d8773+'/'+_0x3cdfab)[_0xea8a('0x30')](_0xb019b2);}return null;};}function patchUpdates(_0x22833b){return function(_0x151f93){try{jsonpatch['apply'](_0x151f93,_0x22833b,!![]);}catch(_0x4194ce){return BPromise[_0xea8a('0x36')](_0x4194ce);}return _0x151f93['save']();};}function saveUpdates(_0x2d0585,_0xd0405f){return function(_0x3a910e){if(_0x3a910e){return _0x3a910e[_0xea8a('0x37')](_0x2d0585)['then'](function(_0x295557){return _0x295557;});}return null;};}function removeEntity(_0x74531b,_0xe67de4){return function(_0x2fb70f){if(_0x2fb70f){return _0x2fb70f[_0xea8a('0x38')]()[_0xea8a('0x22')](function(){var _0x69b4c9=_0x2fb70f[_0xea8a('0x39')]({'plain':!![]});var _0x3847e4=_0xea8a('0x3a');return db['UserProfileResource'][_0xea8a('0x38')]({'where':{'type':_0x3847e4,'resourceId':_0x69b4c9['id']}})['then'](function(){return _0x2fb70f;});})['then'](function(){_0x74531b[_0xea8a('0x2e')](0xcc)[_0xea8a('0x2f')]();});}};}function handleEntityNotFound(_0x1f593e,_0x47cd7b){return function(_0x4d01f5){if(!_0x4d01f5){_0x1f593e['sendStatus'](0x194);}return _0x4d01f5;};}function handleError(_0x6c4729,_0x464d87){_0x464d87=_0x464d87||0x1f4;return function(_0x845008){logger[_0xea8a('0x27')](_0x845008[_0xea8a('0x3b')]);if(_0x845008[_0xea8a('0x3c')]){delete _0x845008['name'];}_0x6c4729[_0xea8a('0x2e')](_0x464d87)['send'](_0x845008);};}exports['index']=function(_0x5a55b9,_0x1fe7b1){var _0xca1152={'include':[{'model':db[_0xea8a('0x3d')],'as':'mandatoryDispositionPause'}]},_0x469be2={},_0x51570c={'count':0x0,'rows':[]};var _0x339d20=_['map'](db['WhatsappAccount']['rawAttributes'],function(_0x54136d){return{'name':_0x54136d[_0xea8a('0x3e')],'type':_0x54136d[_0xea8a('0x3f')]['key']};});_0x469be2[_0xea8a('0x40')]=_[_0xea8a('0x41')](_0x339d20,_0xea8a('0x3c'));_0x469be2[_0xea8a('0x42')]=_['keys'](_0x5a55b9[_0xea8a('0x42')]);_0x469be2['filters']=_[_0xea8a('0x43')](_0x469be2[_0xea8a('0x40')],_0x469be2[_0xea8a('0x42')]);_0xca1152['attributes']=_[_0xea8a('0x43')](_0x469be2['model'],qs[_0xea8a('0x44')](_0x5a55b9[_0xea8a('0x42')]['fields']));_0xca1152[_0xea8a('0x45')]=_0xca1152[_0xea8a('0x45')]['length']?_0xca1152[_0xea8a('0x45')]:_0x469be2[_0xea8a('0x40')];if(!_0x5a55b9['query'][_0xea8a('0x46')](_0xea8a('0x47'))){_0xca1152[_0xea8a('0x33')]=qs['limit'](_0x5a55b9[_0xea8a('0x42')][_0xea8a('0x33')]);_0xca1152[_0xea8a('0x31')]=qs[_0xea8a('0x31')](_0x5a55b9[_0xea8a('0x42')][_0xea8a('0x31')]);}_0xca1152[_0xea8a('0x48')]=qs[_0xea8a('0x49')](_0x5a55b9['query']['sort']);_0xca1152[_0xea8a('0x4a')]=qs[_0xea8a('0x4b')](_['pick'](_0x5a55b9[_0xea8a('0x42')],_0x469be2[_0xea8a('0x4b')]),_0x339d20);if(_0x5a55b9[_0xea8a('0x42')][_0xea8a('0x4c')]){_0xca1152[_0xea8a('0x4a')]=_['merge'](_0xca1152[_0xea8a('0x4a')],{'$or':_[_0xea8a('0x41')](_0x339d20,function(_0x27eace){if(_0x27eace['type']!==_0xea8a('0x4d')){var _0x1820b3={};_0x1820b3[_0x27eace['name']]={'$like':'%'+_0x5a55b9[_0xea8a('0x42')][_0xea8a('0x4c')]+'%'};return _0x1820b3;}})});}_0xca1152=_[_0xea8a('0x4e')]({},_0xca1152,_0x5a55b9['options']);var _0x24da87={'where':_0xca1152[_0xea8a('0x4a')]};return db[_0xea8a('0x4f')][_0xea8a('0x34')](_0x24da87)[_0xea8a('0x22')](function(_0x2f4099){_0x51570c[_0xea8a('0x34')]=_0x2f4099;if(_0x5a55b9[_0xea8a('0x42')][_0xea8a('0x50')]){_0xca1152['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0xea8a('0x51')](_0xca1152);})[_0xea8a('0x22')](function(_0x541503){_0x51570c['rows']=_0x541503;return _0x51570c;})[_0xea8a('0x22')](respondWithFilteredResult(_0x1fe7b1,_0xca1152))[_0xea8a('0x2c')](handleError(_0x1fe7b1,null));};exports['show']=function(_0x565aac,_0x2cad73){var _0x4b6b97={'raw':![],'where':{'id':_0x565aac['params']['id']},'include':[{'model':db[_0xea8a('0x3d')],'as':_0xea8a('0x52')}]},_0x4cda20={};_0x4cda20[_0xea8a('0x40')]=_['keys'](db[_0xea8a('0x4f')][_0xea8a('0x53')]);_0x4cda20[_0xea8a('0x42')]=_[_0xea8a('0x54')](_0x565aac[_0xea8a('0x42')]);_0x4cda20[_0xea8a('0x4b')]=_[_0xea8a('0x43')](_0x4cda20[_0xea8a('0x40')],_0x4cda20[_0xea8a('0x42')]);_0x4b6b97[_0xea8a('0x45')]=_[_0xea8a('0x43')](_0x4cda20[_0xea8a('0x40')],qs['fields'](_0x565aac[_0xea8a('0x42')][_0xea8a('0x44')]));_0x4b6b97[_0xea8a('0x45')]=_0x4b6b97[_0xea8a('0x45')]['length']?_0x4b6b97[_0xea8a('0x45')]:_0x4cda20[_0xea8a('0x40')];if(_0x565aac[_0xea8a('0x42')][_0xea8a('0x50')]){_0x4b6b97[_0xea8a('0x55')]=[{'all':!![]}];}_0x4b6b97=_['merge']({},_0x4b6b97,_0x565aac[_0xea8a('0x56')]);return db[_0xea8a('0x4f')][_0xea8a('0x57')](_0x4b6b97)[_0xea8a('0x22')](handleEntityNotFound(_0x2cad73,null))[_0xea8a('0x22')](respondWithResult(_0x2cad73,null))[_0xea8a('0x2c')](handleError(_0x2cad73,null));};exports[_0xea8a('0x58')]=function(_0x3a1e5a,_0x1b9b51){return db[_0xea8a('0x4f')][_0xea8a('0x58')](_0x3a1e5a[_0xea8a('0x59')],{})[_0xea8a('0x22')](function(_0x4b8972){var _0xb46519=_0x3a1e5a[_0xea8a('0x5a')]['get']({'plain':!![]});if(!_0xb46519)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb46519[_0xea8a('0x5b')]===_0xea8a('0x5a')){var _0xd4b17a=_0x4b8972[_0xea8a('0x39')]({'plain':!![]});var _0x1da065=_0xea8a('0x3a');return db[_0xea8a('0x5c')][_0xea8a('0x57')]({'where':{'name':_0x1da065,'userProfileId':_0xb46519[_0xea8a('0x5d')]},'raw':!![]})[_0xea8a('0x22')](function(_0x104711){if(_0x104711&&_0x104711[_0xea8a('0x5e')]===0x0){return db[_0xea8a('0x5f')][_0xea8a('0x58')]({'name':_0xd4b17a[_0xea8a('0x3c')],'resourceId':_0xd4b17a['id'],'type':_0x104711[_0xea8a('0x3c')],'sectionId':_0x104711['id']},{})[_0xea8a('0x22')](function(){return _0x4b8972;});}else{return _0x4b8972;}})[_0xea8a('0x2c')](function(_0x3678dc){logger[_0xea8a('0x27')](_0xea8a('0x60'),_0x3678dc);throw _0x3678dc;});}return _0x4b8972;})[_0xea8a('0x22')](respondWithResult(_0x1b9b51,0xc9))[_0xea8a('0x2c')](handleError(_0x1b9b51,null));};exports['update']=function(_0x48edab,_0x26394e){if(_0x48edab[_0xea8a('0x59')]['id']){delete _0x48edab[_0xea8a('0x59')]['id'];}return db[_0xea8a('0x4f')][_0xea8a('0x57')]({'where':{'id':_0x48edab[_0xea8a('0x61')]['id']},'include':[{'model':db[_0xea8a('0x3d')],'as':_0xea8a('0x52')}]})[_0xea8a('0x22')](handleEntityNotFound(_0x26394e,null))[_0xea8a('0x22')](saveUpdates(_0x48edab[_0xea8a('0x59')],null))[_0xea8a('0x22')](respondWithResult(_0x26394e,null))[_0xea8a('0x2c')](handleError(_0x26394e,null));};exports[_0xea8a('0x38')]=function(_0x5d0527,_0x23d176){return db[_0xea8a('0x4f')][_0xea8a('0x57')]({'where':{'id':_0x5d0527[_0xea8a('0x61')]['id']}})[_0xea8a('0x22')](handleEntityNotFound(_0x23d176,null))[_0xea8a('0x22')](removeEntity(_0x23d176,null))[_0xea8a('0x2c')](handleError(_0x23d176,null));};exports[_0xea8a('0x62')]=function(_0x3af77f,_0x11b8fc){return db[_0xea8a('0x4f')]['describe']()[_0xea8a('0x22')](respondWithResult(_0x11b8fc,null))['catch'](handleError(_0x11b8fc,null));};exports[_0xea8a('0x63')]=function(_0x66c6cc,_0x1bf954,_0x2782ea){if(_0x66c6cc['body']['id']){delete _0x66c6cc[_0xea8a('0x59')]['id'];}return db[_0xea8a('0x4f')][_0xea8a('0x57')]({'where':{'id':_0x66c6cc[_0xea8a('0x61')]['id']}})[_0xea8a('0x22')](handleEntityNotFound(_0x1bf954,null))[_0xea8a('0x22')](function(_0x5c2e3d){if(_0x5c2e3d){_0x66c6cc[_0xea8a('0x59')][_0xea8a('0x64')]=_0x5c2e3d['id'];return db[_0xea8a('0x65')][_0xea8a('0x58')](_0x66c6cc[_0xea8a('0x59')]);}})[_0xea8a('0x22')](respondWithResult(_0x1bf954,null))[_0xea8a('0x2c')](handleError(_0x1bf954,null));};exports[_0xea8a('0x66')]=function(_0x3583e9,_0x17cd54,_0x7d7b3){var _0x20026e={'raw':![],'where':{}};var _0xeced54={};var _0x3d3dd1={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xea8a('0x67')]({'where':{'id':_0x3583e9['params']['id']}})['then'](handleEntityNotFound(_0x17cd54,null))[_0xea8a('0x22')](function(_0x46940c){if(_0x46940c){_0xeced54['model']=_[_0xea8a('0x54')](db[_0xea8a('0x65')][_0xea8a('0x53')]);_0xeced54[_0xea8a('0x42')]=_[_0xea8a('0x54')](_0x3583e9[_0xea8a('0x42')]);_0xeced54['filters']=_[_0xea8a('0x43')](_0xeced54[_0xea8a('0x40')],_0xeced54[_0xea8a('0x42')]);_0x20026e['attributes']=_[_0xea8a('0x43')](_0xeced54[_0xea8a('0x40')],qs['fields'](_0x3583e9[_0xea8a('0x42')][_0xea8a('0x44')]));_0x20026e[_0xea8a('0x45')]=_0x20026e[_0xea8a('0x45')][_0xea8a('0x68')]?_0x20026e['attributes']:_0xeced54[_0xea8a('0x40')];if(!_0x3583e9[_0xea8a('0x42')][_0xea8a('0x46')](_0xea8a('0x47'))){_0x20026e['limit']=qs[_0xea8a('0x33')](_0x3583e9[_0xea8a('0x42')]['limit']);_0x20026e[_0xea8a('0x31')]=qs[_0xea8a('0x31')](_0x3583e9[_0xea8a('0x42')][_0xea8a('0x31')]);}_0x20026e[_0xea8a('0x48')]=qs[_0xea8a('0x49')](_0x3583e9[_0xea8a('0x42')][_0xea8a('0x49')]);_0x20026e[_0xea8a('0x4a')]=qs[_0xea8a('0x4b')](_[_0xea8a('0x69')](_0x3583e9['query'],_0xeced54[_0xea8a('0x4b')]));_0x20026e[_0xea8a('0x4a')]['WhatsappAccountId']=_0x46940c['id'];if(_0x3583e9[_0xea8a('0x42')][_0xea8a('0x4c')]){_0x20026e[_0xea8a('0x4a')]=_[_0xea8a('0x4e')](_0x20026e[_0xea8a('0x4a')],{'$or':_['map'](_0x20026e[_0xea8a('0x45')],function(_0x4ad914){var _0x50176b={};_0x50176b[_0x4ad914]={'$like':'%'+_0x3583e9[_0xea8a('0x42')][_0xea8a('0x4c')]+'%'};return _0x50176b;})});}_0x20026e=_['merge']({},_0x20026e,_0x3583e9['options']);return db[_0xea8a('0x65')][_0xea8a('0x34')]({'where':_0x20026e[_0xea8a('0x4a')]})['then'](function(_0xecb678){_0x3d3dd1['count']=_0xecb678;if(_0x3583e9[_0xea8a('0x42')][_0xea8a('0x50')]){_0x20026e[_0xea8a('0x55')]=[{'all':!![]}];}return db[_0xea8a('0x65')][_0xea8a('0x51')](_0x20026e);})[_0xea8a('0x22')](function(_0x4e478f){_0x3d3dd1['rows']=_0x4e478f;return _0x3d3dd1;});}})[_0xea8a('0x22')](respondWithFilteredResult(_0x17cd54,_0x20026e))['catch'](handleError(_0x17cd54,null));};exports[_0xea8a('0x6a')]=function(_0x541740,_0x404ad9,_0x25ee82){return db['WhatsappAccount'][_0xea8a('0x57')]({'where':{'id':_0x541740[_0xea8a('0x61')]['id']}})[_0xea8a('0x22')](handleEntityNotFound(_0x404ad9,null))[_0xea8a('0x22')](function(_0x120a49){if(_0x120a49){return _0x120a49[_0xea8a('0x6a')](_0x541740['query'][_0xea8a('0x6b')]);}})[_0xea8a('0x22')](respondWithStatusCode(_0x404ad9,null))[_0xea8a('0x2c')](handleError(_0x404ad9,null));};exports[_0xea8a('0x6c')]=function(_0x2b707f,_0x1ece03,_0x170221){if(_0x2b707f[_0xea8a('0x59')]['id']){delete _0x2b707f[_0xea8a('0x59')]['id'];}return db[_0xea8a('0x4f')][_0xea8a('0x57')]({'where':{'id':_0x2b707f[_0xea8a('0x61')]['id']}})[_0xea8a('0x22')](handleEntityNotFound(_0x1ece03,null))[_0xea8a('0x22')](function(_0x52aeeb){if(_0x52aeeb){_0x2b707f[_0xea8a('0x59')]['WhatsappAccountId']=_0x52aeeb['id'];return db[_0xea8a('0x6d')]['create'](_0x2b707f[_0xea8a('0x59')]);}})[_0xea8a('0x22')](respondWithResult(_0x1ece03,null))['catch'](handleError(_0x1ece03,null));};exports[_0xea8a('0x6e')]=function(_0x530df5,_0x45db73,_0xae2669){var _0x4da7ae={'raw':![],'where':{}};var _0x1847ea={};var _0x3f5d30={'count':0x0,'rows':[]};return db[_0xea8a('0x4f')][_0xea8a('0x67')]({'where':{'id':_0x530df5[_0xea8a('0x61')]['id']}})['then'](handleEntityNotFound(_0x45db73,null))[_0xea8a('0x22')](function(_0x496c00){if(_0x496c00){_0x1847ea[_0xea8a('0x40')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x1847ea['query']=_[_0xea8a('0x54')](_0x530df5['query']);_0x1847ea[_0xea8a('0x4b')]=_[_0xea8a('0x43')](_0x1847ea[_0xea8a('0x40')],_0x1847ea['query']);_0x4da7ae[_0xea8a('0x45')]=_[_0xea8a('0x43')](_0x1847ea[_0xea8a('0x40')],qs['fields'](_0x530df5[_0xea8a('0x42')]['fields']));_0x4da7ae[_0xea8a('0x45')]=_0x4da7ae[_0xea8a('0x45')][_0xea8a('0x68')]?_0x4da7ae['attributes']:_0x1847ea[_0xea8a('0x40')];if(!_0x530df5[_0xea8a('0x42')][_0xea8a('0x46')]('nolimit')){_0x4da7ae[_0xea8a('0x33')]=qs[_0xea8a('0x33')](_0x530df5['query'][_0xea8a('0x33')]);_0x4da7ae[_0xea8a('0x31')]=qs[_0xea8a('0x31')](_0x530df5[_0xea8a('0x42')][_0xea8a('0x31')]);}_0x4da7ae[_0xea8a('0x48')]=qs['sort'](_0x530df5[_0xea8a('0x42')][_0xea8a('0x49')]);_0x4da7ae[_0xea8a('0x4a')]=qs[_0xea8a('0x4b')](_[_0xea8a('0x69')](_0x530df5[_0xea8a('0x42')],_0x1847ea['filters']));_0x4da7ae['where'][_0xea8a('0x64')]=_0x496c00['id'];if(_0x530df5[_0xea8a('0x42')][_0xea8a('0x4c')]){_0x4da7ae[_0xea8a('0x4a')]=_[_0xea8a('0x4e')](_0x4da7ae[_0xea8a('0x4a')],{'$or':_[_0xea8a('0x41')](_0x4da7ae[_0xea8a('0x45')],function(_0x529f7b){var _0x5f14be={};_0x5f14be[_0x529f7b]={'$like':'%'+_0x530df5['query'][_0xea8a('0x4c')]+'%'};return _0x5f14be;})});}_0x4da7ae=_[_0xea8a('0x4e')]({},_0x4da7ae,_0x530df5[_0xea8a('0x56')]);return db[_0xea8a('0x6d')][_0xea8a('0x34')]({'where':_0x4da7ae[_0xea8a('0x4a')]})[_0xea8a('0x22')](function(_0x44add0){_0x3f5d30['count']=_0x44add0;if(_0x530df5[_0xea8a('0x42')]['includeAll']){_0x4da7ae['include']=[{'all':!![]}];}return db[_0xea8a('0x6d')]['findAll'](_0x4da7ae);})[_0xea8a('0x22')](function(_0x5032e8){_0x3f5d30[_0xea8a('0x6f')]=_0x5032e8;return _0x3f5d30;});}})[_0xea8a('0x22')](respondWithFilteredResult(_0x45db73,_0x4da7ae))[_0xea8a('0x2c')](handleError(_0x45db73,null));};exports[_0xea8a('0x70')]=function(_0xf443ef,_0x39a182,_0x1a9dfb){return db[_0xea8a('0x4f')][_0xea8a('0x57')]({'where':{'id':_0xf443ef[_0xea8a('0x61')]['id']}})[_0xea8a('0x22')](handleEntityNotFound(_0x39a182,null))[_0xea8a('0x22')](function(_0x588dce){if(_0x588dce){return _0x588dce[_0xea8a('0x70')](_0xf443ef[_0xea8a('0x42')][_0xea8a('0x6b')]);}})[_0xea8a('0x22')](respondWithStatusCode(_0x39a182,null))[_0xea8a('0x2c')](handleError(_0x39a182,null));};exports[_0xea8a('0x71')]=function(_0x1d5829,_0xf47889,_0x2807cb){return db[_0xea8a('0x4f')][_0xea8a('0x57')]({'where':{'id':_0x1d5829[_0xea8a('0x61')]['id']}})[_0xea8a('0x22')](handleEntityNotFound(_0xf47889,null))[_0xea8a('0x22')](function(_0xaf9042){if(_0xaf9042){return _0xaf9042[_0xea8a('0x71')](_0x1d5829['body'][_0xea8a('0x6b')],_[_0xea8a('0x72')](_0x1d5829['body'],[_0xea8a('0x6b'),'id'])||{})['spread'](function(_0x5492a6){for(var _0x35eebf=0x0;_0x35eebf<_0x1d5829[_0xea8a('0x59')][_0xea8a('0x6b')][_0xea8a('0x68')];_0x35eebf+=0x1){socket['emit'](_0xea8a('0x73'),{'UserId':Number(_0x1d5829[_0xea8a('0x59')][_0xea8a('0x6b')][_0x35eebf]),'WhatsappAccountId':Number(_0x1d5829[_0xea8a('0x61')]['id'])});}return _0x5492a6;});}})[_0xea8a('0x22')](respondWithResult(_0xf47889,null))['catch'](handleError(_0xf47889,null));};exports[_0xea8a('0x74')]=function(_0x405de8,_0x3e7529,_0x296ec5){return db[_0xea8a('0x4f')][_0xea8a('0x57')]({'where':{'id':_0x405de8[_0xea8a('0x61')]['id']}})['then'](handleEntityNotFound(_0x3e7529,null))['then'](function(_0x2e7230){if(_0x2e7230){return _0x2e7230[_0xea8a('0x74')](_0x405de8[_0xea8a('0x42')]['ids'])[_0xea8a('0x22')](function(){if(_[_0xea8a('0x75')](_0x405de8[_0xea8a('0x42')][_0xea8a('0x6b')])){for(var _0x2b018d=0x0;_0x2b018d<_0x405de8[_0xea8a('0x42')][_0xea8a('0x6b')][_0xea8a('0x68')];_0x2b018d+=0x1){socket[_0xea8a('0x76')](_0xea8a('0x77'),{'UserId':Number(_0x405de8[_0xea8a('0x42')][_0xea8a('0x6b')][_0x2b018d]),'WhatsappAccountId':Number(_0x405de8[_0xea8a('0x61')]['id'])});}}else{socket[_0xea8a('0x76')](_0xea8a('0x77'),{'UserId':Number(_0x405de8[_0xea8a('0x42')][_0xea8a('0x6b')]),'WhatsappAccountId':Number(_0x405de8['params']['id'])});}});}})[_0xea8a('0x22')](respondWithStatusCode(_0x3e7529,null))[_0xea8a('0x2c')](handleError(_0x3e7529,null));};exports[_0xea8a('0x78')]=function(_0x5e7fa1,_0xd902ca,_0x52a441){var _0x4d0419={};var _0x325615={};var _0x547a16;var _0x2b96ea;return db[_0xea8a('0x4f')]['findOne']({'where':{'id':_0x5e7fa1[_0xea8a('0x61')]['id']}})[_0xea8a('0x22')](handleEntityNotFound(_0xd902ca,null))[_0xea8a('0x22')](function(_0xd4019e){if(_0xd4019e){_0x547a16=_0xd4019e;_0x325615[_0xea8a('0x40')]=_['keys'](db[_0xea8a('0x79')][_0xea8a('0x53')]);_0x325615[_0xea8a('0x42')]=_[_0xea8a('0x54')](_0x5e7fa1[_0xea8a('0x42')]);_0x325615[_0xea8a('0x4b')]=_[_0xea8a('0x43')](_0x325615[_0xea8a('0x40')],_0x325615[_0xea8a('0x42')]);_0x4d0419[_0xea8a('0x45')]=_['intersection'](_0x325615[_0xea8a('0x40')],qs[_0xea8a('0x44')](_0x5e7fa1[_0xea8a('0x42')][_0xea8a('0x44')]));_0x4d0419['attributes']=_0x4d0419[_0xea8a('0x45')][_0xea8a('0x68')]?_0x4d0419[_0xea8a('0x45')]:_0x325615[_0xea8a('0x40')];_0x4d0419[_0xea8a('0x48')]=qs['sort'](_0x5e7fa1['query'][_0xea8a('0x49')]);_0x4d0419[_0xea8a('0x4a')]=qs['filters'](_['pick'](_0x5e7fa1[_0xea8a('0x42')],_0x325615[_0xea8a('0x4b')]));if(_0x5e7fa1[_0xea8a('0x42')][_0xea8a('0x4c')]){_0x4d0419[_0xea8a('0x4a')]=_[_0xea8a('0x4e')](_0x4d0419[_0xea8a('0x4a')],{'$or':_[_0xea8a('0x41')](_0x4d0419[_0xea8a('0x45')],function(_0x561188){var _0xb25280={};_0xb25280[_0x561188]={'$like':'%'+_0x5e7fa1['query'][_0xea8a('0x4c')]+'%'};return _0xb25280;})});}_0x4d0419=_[_0xea8a('0x4e')]({},_0x4d0419,_0x5e7fa1[_0xea8a('0x56')]);return _0x547a16[_0xea8a('0x78')](_0x4d0419);}})[_0xea8a('0x22')](function(_0x5521e9){if(_0x5521e9){_0x2b96ea=_0x5521e9[_0xea8a('0x68')];if(!_0x5e7fa1[_0xea8a('0x42')][_0xea8a('0x46')](_0xea8a('0x47'))){_0x4d0419['limit']=qs[_0xea8a('0x33')](_0x5e7fa1[_0xea8a('0x42')]['limit']);_0x4d0419[_0xea8a('0x31')]=qs[_0xea8a('0x31')](_0x5e7fa1[_0xea8a('0x42')]['offset']);}return _0x547a16['getAgents'](_0x4d0419);}})['then'](function(_0x24576c){if(_0x24576c){return _0x24576c?{'count':_0x2b96ea,'rows':_0x24576c}:null;}})[_0xea8a('0x22')](respondWithResult(_0xd902ca,null))['catch'](handleError(_0xd902ca,null));};exports['addApplications']=function(_0x5dc691,_0x9fdef0){var _0x5eb57d=_0x5dc691[_0xea8a('0x61')]['id'];var _0x4539d8=_0x5dc691[_0xea8a('0x59')];var _0x3993a4=0xc8;var _0x3c418f=null;return db[_0xea8a('0x7a')][_0xea8a('0x7b')]({'isolationLevel':db[_0xea8a('0x7a')][_0xea8a('0x7c')][_0xea8a('0x7d')][_0xea8a('0x7e')]},function(_0x4bdbb2){return db[_0xea8a('0x4f')]['findOne']({'where':{'id':_0x5eb57d},'transaction':_0x4bdbb2})[_0xea8a('0x22')](function(_0x47c507){if(_0x47c507){return db[_0xea8a('0x7f')][_0xea8a('0x38')]({'where':{'WhatsappAccountId':_0x5eb57d},'transaction':_0x4bdbb2})[_0xea8a('0x22')](function(){var _0x2b22d4=_[_0xea8a('0x41')](_0x4539d8,function(_0x440213){_0x440213[_0xea8a('0x64')]=_0x5eb57d;return _0x440213;});return db[_0xea8a('0x7f')][_0xea8a('0x80')](_0x2b22d4,{'transaction':_0x4bdbb2});});}else{_0x3993a4=0x194;_0x3c418f=[];}});})[_0xea8a('0x22')](function(){if(_0x3993a4!==0x194){return db[_0xea8a('0x7f')][_0xea8a('0x81')]({'where':{'WhatsappAccountId':_0x5eb57d},'order':_0xea8a('0x82')})[_0xea8a('0x22')](function(_0x13e283){_0x3c418f=_0x13e283;});}})[_0xea8a('0x2c')](function(_0x28f049){_0x3993a4=0x1f4;logger[_0xea8a('0x27')](_0x28f049[_0xea8a('0x3b')]);if(_0x28f049[_0xea8a('0x3c')]){delete _0x28f049['name'];}_0x3c418f=_0x28f049;})[_0xea8a('0x83')](function(){if(_0x3c418f===null){_0x9fdef0[_0xea8a('0x2d')](_0x3993a4);}else{if(_0x3993a4===0x1f4){_0x9fdef0[_0xea8a('0x2e')](_0x3993a4)[_0xea8a('0x84')](_0x3c418f);}else{_0x9fdef0['status'](_0x3993a4)[_0xea8a('0x30')](_0x3c418f);}}});};exports['getApplications']=function(_0x430be9,_0x2ae6c6,_0x166d3a){var _0x150d15={};var _0xc0d2c0={};var _0x5afa42;var _0x5b506a;return db[_0xea8a('0x4f')]['findOne']({'where':{'id':_0x430be9[_0xea8a('0x61')]['id']}})[_0xea8a('0x22')](handleEntityNotFound(_0x2ae6c6,null))[_0xea8a('0x22')](function(_0x393c02){if(_0x393c02){_0x5afa42=_0x393c02;_0xc0d2c0['model']=_[_0xea8a('0x54')](db[_0xea8a('0x7f')]['rawAttributes']);_0xc0d2c0['query']=_['keys'](_0x430be9[_0xea8a('0x42')]);_0xc0d2c0[_0xea8a('0x4b')]=_['intersection'](_0xc0d2c0[_0xea8a('0x40')],_0xc0d2c0['query']);_0x150d15[_0xea8a('0x45')]=_['intersection'](_0xc0d2c0[_0xea8a('0x40')],qs['fields'](_0x430be9['query'][_0xea8a('0x44')]));_0x150d15[_0xea8a('0x45')]=_0x150d15[_0xea8a('0x45')][_0xea8a('0x68')]?_0x150d15[_0xea8a('0x45')]:_0xc0d2c0[_0xea8a('0x40')];_0x150d15[_0xea8a('0x48')]=qs[_0xea8a('0x49')](_0x430be9[_0xea8a('0x42')]['sort']);_0x150d15[_0xea8a('0x4a')]=qs['filters'](_[_0xea8a('0x69')](_0x430be9[_0xea8a('0x42')],_0xc0d2c0[_0xea8a('0x4b')]));if(_0x430be9[_0xea8a('0x42')][_0xea8a('0x4c')]){_0x150d15[_0xea8a('0x4a')]=_[_0xea8a('0x4e')](_0x150d15['where'],{'$or':_[_0xea8a('0x41')](_0x150d15[_0xea8a('0x45')],function(_0x1f789a){var _0x30958e={};_0x30958e[_0x1f789a]={'$like':'%'+_0x430be9['query'][_0xea8a('0x4c')]+'%'};return _0x30958e;})});}_0x150d15=_['merge']({},_0x150d15,_0x430be9[_0xea8a('0x56')]);return _0x5afa42['getApplications'](_0x150d15);}})[_0xea8a('0x22')](function(_0x2d0456){if(_0x2d0456){_0x5b506a=_0x2d0456[_0xea8a('0x68')];if(!_0x430be9[_0xea8a('0x42')]['hasOwnProperty'](_0xea8a('0x47'))){_0x150d15[_0xea8a('0x33')]=qs['limit'](_0x430be9[_0xea8a('0x42')]['limit']);_0x150d15['offset']=qs[_0xea8a('0x31')](_0x430be9[_0xea8a('0x42')]['offset']);}return _0x5afa42['getApplications'](_0x150d15);}})[_0xea8a('0x22')](function(_0x56b331){if(_0x56b331){return _0x56b331?{'count':_0x5b506a,'rows':_0x56b331}:null;}})[_0xea8a('0x22')](respondWithResult(_0x2ae6c6,null))['catch'](handleError(_0x2ae6c6,null));};exports['notify']=function(_0x4aadaa,_0x5f2b7d,_0x6560fa){var _0x2a70d8={'channel':_0xea8a('0x85')};var _0x37ac3c=[];var _0x42734c=[];var _0x193ff1={};return db['WhatsappAccount'][_0xea8a('0x57')]({'where':{'id':_0x4aadaa[_0xea8a('0x61')]['id']},'include':[{'model':db[_0xea8a('0x7f')],'as':_0xea8a('0x86')}]})['then'](handleEntityNotFound(_0x5f2b7d,null))['then'](function(_0x5ccb82){_0x2a70d8['account']=_0x5ccb82;if(_0x2a70d8['account']&&_0x2a70d8[_0xea8a('0x87')][_0xea8a('0x3f')]===_0xea8a('0x88')&&_0x4aadaa['body'][_0xea8a('0x89')]){if(_0x4aadaa['body']['statuses']['length']===0x0)return;if(_0x4aadaa[_0xea8a('0x59')][_0xea8a('0x89')][0x0][_0xea8a('0x8a')]!==_0xea8a('0x8b'))return;return db['WhatsappMessage'][_0xea8a('0x37')]({'read':!![],'readAt':_0x4aadaa[_0xea8a('0x59')][_0xea8a('0x89')][0x0][_0xea8a('0x8c')]},{'where':{'messageId':_0x4aadaa[_0xea8a('0x59')][_0xea8a('0x89')][0x0][_0xea8a('0x8d')]},'individualHooks':!![]})[_0xea8a('0x22')](function(_0x34adf3){return _0x5f2b7d[_0xea8a('0x2e')](0xc8)[_0xea8a('0x30')](_0x34adf3);});}_0x2a70d8['applications']=_[_0xea8a('0x8e')](_0x5ccb82[_0xea8a('0x86')],[_0xea8a('0x82')],[_0xea8a('0x8f')]);if(_0x2a70d8[_0xea8a('0x87')][_0xea8a('0x86')]){delete _0x2a70d8[_0xea8a('0x87')]['Applications'];}return db[_0xea8a('0x90')][_0xea8a('0x62')]()[_0xea8a('0x22')](function(_0x3ed181){if(!_0x3ed181){throw new db['Sequelize'][(_0xea8a('0x91'))]('no\x20available\x20attributes');}_0x37ac3c=_[_0xea8a('0x92')](_[_0xea8a('0x54')](_0x3ed181),[_0xea8a('0x93'),'updatedAt']);_0x42734c=_[_0xea8a('0x92')](_[_0xea8a('0x54')](_0x3ed181),[_0xea8a('0x93'),_0xea8a('0x94'),'CompanyId',_0xea8a('0x95')]);_0x2a70d8[_0xea8a('0x59')]={'mapKey':_0xea8a('0x96')};if(_0x2a70d8[_0xea8a('0x87')]&&_0x2a70d8[_0xea8a('0x87')]['type']===_0xea8a('0x97')){_0x2a70d8[_0xea8a('0x59')][_0xea8a('0x98')]=_0x4aadaa[_0xea8a('0x59')][_0xea8a('0x99')]['replace'](_0xea8a('0x9a'),'');_0x2a70d8[_0xea8a('0x59')]['body']=_0x4aadaa[_0xea8a('0x59')][_0xea8a('0x9b')];_0x2a70d8[_0xea8a('0x59')][_0xea8a('0x9c')]=_0x4aadaa[_0xea8a('0x59')][_0xea8a('0x9d')];}if(_0x2a70d8[_0xea8a('0x87')]&&_0x2a70d8[_0xea8a('0x87')][_0xea8a('0x3f')]===_0xea8a('0x88')){_0x2a70d8['body'][_0xea8a('0x98')]=_0x4aadaa[_0xea8a('0x59')][_0xea8a('0x9e')][0x0][_0xea8a('0x98')];_0x2a70d8[_0xea8a('0x59')]['body']=_0x4aadaa['body'][_0xea8a('0x9e')][0x0][_0xea8a('0x29')]['body'];_0x2a70d8[_0xea8a('0x59')][_0xea8a('0x9c')]=_0x4aadaa[_0xea8a('0x59')]['notifications'][0x0]['message_id'];}if(_0x2a70d8['body']['id']){delete _0x2a70d8[_0xea8a('0x59')]['id'];}if(_[_0xea8a('0x9f')](_0x2a70d8['body'][_0xea8a('0x98')])){throw new db[(_0xea8a('0xa0'))][(_0xea8a('0x91'))](_0xea8a('0xa1'));}if(_[_0xea8a('0x9f')](_0x2a70d8[_0xea8a('0x59')][_0xea8a('0x59')])||_0x2a70d8[_0xea8a('0x59')][_0xea8a('0x59')]===''){throw new db['Sequelize']['ValidationError'](_0xea8a('0xa2'));}if(_[_0xea8a('0x9f')](_0x2a70d8[_0xea8a('0x59')][_0xea8a('0xa3')])){throw new db[(_0xea8a('0xa0'))][(_0xea8a('0x91'))](_0xea8a('0xa4')+_0x42734c);}if(!_[_0xea8a('0xa5')](_0x42734c,_0x2a70d8[_0xea8a('0x59')][_0xea8a('0xa3')])){throw new db['Sequelize'][(_0xea8a('0x91'))](_0xea8a('0xa6')+_0x42734c);}_0x193ff1[_0x2a70d8[_0xea8a('0x59')][_0xea8a('0xa3')]]=_0x2a70d8['body'][_0xea8a('0x98')];return db[_0xea8a('0xa7')]['find']({'where':{'id':_0x2a70d8[_0xea8a('0x87')]['ListId']},'include':[{'model':db[_0xea8a('0x90')],'as':_0xea8a('0xa8'),'where':_0x193ff1,'limit':0x1,'order':[[_0xea8a('0x94'),_0xea8a('0xa9')]]}]});})[_0xea8a('0x22')](handleEntityNotFound(_0x5f2b7d,null))[_0xea8a('0x22')](function(_0x467614){if(_0x467614){_0x2a70d8['list']=_['omit'](_0x467614,[_0xea8a('0xa8')]);if(_0x467614['Contacts'][_0xea8a('0x68')]){return _0x467614[_0xea8a('0xa8')][0x0];}var _0x3095fb=_[_0xea8a('0x1b')](_0x2a70d8['body'],{'firstName':_0x2a70d8['body']['from'],'ListId':_0x467614['id']});_0x3095fb[_0x2a70d8[_0xea8a('0x59')][_0xea8a('0xa3')]]=_0x2a70d8[_0xea8a('0x59')]['from'];return db[_0xea8a('0x90')][_0xea8a('0x58')](_0x3095fb,{'fields':_0x37ac3c,'raw':!![]});}})['then'](handleEntityNotFound(_0x5f2b7d,null))[_0xea8a('0x22')](function(_0x2b4bc8){if(_0x2b4bc8){_0x2a70d8[_0xea8a('0xaa')]=_0x2b4bc8;var _0x3828a6={'ContactId':_0x2b4bc8['id'],'phone':_0x2a70d8[_0xea8a('0x59')][_0xea8a('0x98')],'WhatsappAccountId':_0x4aadaa[_0xea8a('0x61')]['id']};var _0x4e960e={'ContactId':_0x2b4bc8['id'],'WhatsappAccountId':_0x4aadaa['params']['id'],'closed':![]};return db[_0xea8a('0xab')][_0xea8a('0x57')]({'where':_0x4e960e})['then'](function(_0x148a03){if(_0x148a03){return[_0x148a03,![]];}return db[_0xea8a('0xab')][_0xea8a('0x58')](_0x3828a6)[_0xea8a('0x22')](function(_0x464fa6){return[_0x464fa6,!![]];});});}})[_0xea8a('0xac')](function(_0x57acb6,_0x559ae3){_0x2a70d8[_0xea8a('0xad')]=_0x57acb6[_0xea8a('0x39')]({'plain':!![]});_0x2a70d8['interaction']['created']=![];if(_0x559ae3){if(_0x2a70d8['account']['autoclose']){_0x2a70d8[_0xea8a('0xae')][_0xea8a('0xaf')]({'id':0x0,'priority':_0x2a70d8[_0xea8a('0xae')][_0xea8a('0x68')]+0x1,'app':_0xea8a('0xb0'),'appdata':'unmanaged','interval':_0xea8a('0xb1')});}_0x2a70d8[_0xea8a('0xad')]['created']=!![];}return db[_0xea8a('0xb2')]['create']({'phone':_0x2a70d8[_0xea8a('0x59')][_0xea8a('0x98')],'messageId':_0x2a70d8['body'][_0xea8a('0x9c')],'body':_0x2a70d8[_0xea8a('0x59')][_0xea8a('0x59')],'WhatsappAccountId':_0x4aadaa[_0xea8a('0x61')]['id'],'WhatsappInteractionId':_0x57acb6['id'],'direction':'in','ContactId':_0x57acb6[_0xea8a('0xb3')],'AttachmentId':_0x2a70d8[_0xea8a('0x59')][_0xea8a('0xb4')]});})[_0xea8a('0x22')](function(_0x53839a){_0x2a70d8[_0xea8a('0x29')]=_0x53839a;if(!_0x2a70d8[_0xea8a('0xad')][_0xea8a('0xb5')])return;return db[_0xea8a('0x79')][_0xea8a('0x57')]({'attributes':['id',_0xea8a('0x3c')],'where':{'id':_0x2a70d8[_0xea8a('0xad')][_0xea8a('0xb5')]}});})['then'](function(_0x41c4d0){if(_0x41c4d0){_0x2a70d8[_0xea8a('0xae')][_0xea8a('0xb6')]({'id':0x0,'priority':0x0,'app':_0xea8a('0xb7'),'appdata':_0x41c4d0[_0xea8a('0x3c')]+','+(_0x2a70d8['account']['waitForTheAssignedAgent']||0xa),'interval':_0xea8a('0xb1')});}if(!_0x2a70d8[_0xea8a('0xad')]['queueId'])return;return db['WhatsappQueue'][_0xea8a('0x57')]({'attributes':['id','name'],'where':{'id':_0x2a70d8[_0xea8a('0xad')][_0xea8a('0xb8')]}});})[_0xea8a('0x22')](function(_0x42946a){if(_0x42946a){_0x2a70d8['applications'][_0xea8a('0xb6')]({'id':0x0,'priority':0x1,'app':_0xea8a('0xb9'),'appdata':_0x42946a[_0xea8a('0x3c')]+','+(_0x2a70d8[_0xea8a('0x87')][_0xea8a('0xba')]||0x12c),'interval':_0xea8a('0xb1')});}return respondWithRpcPromise(_0xea8a('0xbb'),_0xea8a('0xbc'),_0x2a70d8);})[_0xea8a('0x22')](function(_0x98c075){if(_0x98c075){var _0x521349=0xc8;var _0x4afa1e=_0xea8a('0xbd');logger[_0xea8a('0x23')](_0xea8a('0xbe'),_0x4afa1e,_0x521349,_0xea8a('0xbf'));logger[_0xea8a('0x25')](_0xea8a('0xc0'),_0x4afa1e,_0x521349,_0xea8a('0xbf'),JSON['stringify'](_0x98c075));if(_0x2a70d8['account']['type']===_0xea8a('0x97')){return _0x5f2b7d['status'](_0x521349)[_0xea8a('0x35')](_0xea8a('0xc1'),'text/xml')[_0xea8a('0x84')](_0xea8a('0xc2'));}else{return _0x5f2b7d['status'](_0x521349)[_0xea8a('0x30')](_0x98c075);}}});})[_0xea8a('0x2c')](handleError(_0x5f2b7d,null));};exports['send']=function(_0x2263b9,_0x2f63ab,_0x361117){var _0xb0906d,_0x593418,_0x46d377;if(_[_0xea8a('0x9f')](_0x2263b9[_0xea8a('0x59')][_0xea8a('0x59')])||_0x2263b9[_0xea8a('0x59')][_0xea8a('0x59')]===''){throw new db[(_0xea8a('0xa0'))][(_0xea8a('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xea8a('0x9f')](_0x2263b9[_0xea8a('0x59')]['to'])){throw new db[(_0xea8a('0xa0'))][(_0xea8a('0x91'))](_0xea8a('0xc3'));}_0xb0906d=_0x2263b9[_0xea8a('0x59')]['to'];return db[_0xea8a('0x4f')]['find']({'where':{'id':_0x2263b9[_0xea8a('0x61')]['id']},'include':[{'model':db[_0xea8a('0xa7')],'as':_0xea8a('0xc4'),'include':[{'model':db['CmContact'],'as':_0xea8a('0xa8'),'where':{'mobile':_0xb0906d},'limit':0x1,'order':[[_0xea8a('0x94'),_0xea8a('0xa9')]]}]}]})[_0xea8a('0x22')](handleEntityNotFound(_0x2f63ab,null))[_0xea8a('0x22')](function(_0x56dfcc){if(_0x56dfcc&&_0x56dfcc['List']){_0x593418=_0x56dfcc[_0xea8a('0x39')]({'plain':!![]});if(_0x593418[_0xea8a('0xc4')]&&_0x593418['List'][_0xea8a('0xa8')][_0xea8a('0x68')]){return _0x593418[_0xea8a('0xc4')][_0xea8a('0xa8')][0x0];}return db['CmContact'][_0xea8a('0x58')](_[_0xea8a('0x1b')](_0x2263b9['body'],{'firstName':_0xb0906d,'mobile':_0xb0906d,'phone':_0xb0906d,'ListId':_0x593418['ListId']}));}})['then'](handleEntityNotFound(_0x2f63ab,null))[_0xea8a('0x22')](function(_0x2d621b){if(_0x2d621b){_0x46d377=_0x2d621b;return db[_0xea8a('0xab')]['find']({'where':{'ContactId':_0x46d377['id'],'closed':![],'WhatsappAccountId':_0x593418['id']}})[_0xea8a('0x22')](function(_0x153d80){if(_0x153d80){return[_0x153d80,![]];}return db[_0xea8a('0xab')][_0xea8a('0x58')]({'UserId':_0x2263b9[_0xea8a('0x5a')]['id'],'ContactId':_0x46d377['id'],'WhatsappAccountId':_0x593418['id'],'phone':_0xb0906d,'firstMsgDirection':'out','Messages':[_['merge'](_0x2263b9[_0xea8a('0x59')],{'read':![],'body':_0x2263b9[_0xea8a('0x59')][_0xea8a('0x59')],'phone':_0xb0906d,'WhatsappAccountId':_0x593418['id'],'UserId':_0x2263b9['user']['id'],'ContactId':_0x46d377['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xea8a('0xc5')}]})['then'](function(_0x3f9e57){return[_0x3f9e57,!![]];});});}})[_0xea8a('0xac')](function(_0x1a5ad8,_0x2b4023){if(_0x2b4023){return _0x1a5ad8;}return db[_0xea8a('0xb2')][_0xea8a('0x58')](_[_0xea8a('0x4e')](_0x2263b9[_0xea8a('0x59')],{'read':![],'body':_0x2263b9['body'][_0xea8a('0x59')],'phone':_0xb0906d,'WhatsappAccountId':_0x593418['id'],'WhatsappInteractionId':_0x1a5ad8['id'],'UserId':_0x2263b9[_0xea8a('0x5a')]['id'],'ContactId':_0x46d377['id']}))['then'](function(_0xfe241f){_0x1a5ad8[_0xea8a('0xc6')][_0xea8a('0xc5')]=[];_0x1a5ad8[_0xea8a('0xc6')]['Messages'][_0xea8a('0xaf')](_0xfe241f['dataValues']);return _0x1a5ad8;});})[_0xea8a('0x22')](respondWithResult(_0x2f63ab,null))[_0xea8a('0x2c')](handleError(_0x2f63ab,null));}; \ No newline at end of file +var _0x323a=['From','replace','messageId','MessageSid','notifications','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','defaults','contact','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','UserId','unshift','agent','waitForTheAssignedAgent','queueId','waitForTheAssignedQueue','Start','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','ListId','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','order','sort','where','filter','findAll','rows','show','length','includeAll','include','merge','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','pick','removeDispositions','ids','CannedAnswer','create','getAnswers','nolimit','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from'];(function(_0x40f07a,_0x26e44d){var _0x51006a=function(_0x280789){while(--_0x280789){_0x40f07a['push'](_0x40f07a['shift']());}};_0x51006a(++_0x26e44d);}(_0x323a,0x1b0));var _0xa323=function(_0x514ba6,_0x27815c){_0x514ba6=_0x514ba6-0x0;var _0x43d9d7=_0x323a[_0x514ba6];return _0x43d9d7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa323('0x0'));var zipdir=require(_0xa323('0x1'));var jsonpatch=require(_0xa323('0x2'));var rp=require(_0xa323('0x3'));var moment=require(_0xa323('0x4'));var BPromise=require(_0xa323('0x5'));var Mustache=require(_0xa323('0x6'));var util=require(_0xa323('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa323('0x8'));var ejs=require(_0xa323('0x9'));var fs=require('fs');var fs_extra=require(_0xa323('0xa'));var _=require(_0xa323('0xb'));var squel=require('squel');var crypto=require(_0xa323('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa323('0xd'));var toCsv=require(_0xa323('0x8'));var querystring=require('querystring');var Papa=require(_0xa323('0xe'));var Redis=require(_0xa323('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa323('0x10'));var as=require(_0xa323('0x11'));var hardwareService=require(_0xa323('0x12'));var logger=require(_0xa323('0x13'))(_0xa323('0x14'));var utils=require(_0xa323('0x15'));var config=require(_0xa323('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa323('0x17')]=_['defaults'](config[_0xa323('0x17')],{'host':_0xa323('0x18'),'port':0x18eb});var socket=require(_0xa323('0x19'))(new Redis(config[_0xa323('0x17')]));require(_0xa323('0x1a'))[_0xa323('0x1b')](socket);var jayson=require(_0xa323('0x1c'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1da154,_0x3d3a22,_0x2399cd,_0x5101b9){return new BPromise(function(_0x2f101c,_0x972f40){var _0x576933=_0x5101b9||client;return _0x576933['request'](_0x1da154,_0x2399cd)[_0xa323('0x1d')](function(_0x3d667a){logger[_0xa323('0x1e')](_0xa323('0x1f'),_0x3d3a22,_0xa323('0x20'));logger[_0xa323('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3d3a22,_0xa323('0x20'),JSON[_0xa323('0x22')](_0x3d667a));if(_0x3d667a['error']){if(_0x3d667a[_0xa323('0x23')][_0xa323('0x24')]===0x1f4){logger['error'](_0xa323('0x1f'),_0x3d3a22,_0x3d667a[_0xa323('0x23')]['message']);return _0x972f40(_0x3d667a[_0xa323('0x23')][_0xa323('0x25')]);}logger[_0xa323('0x23')](_0xa323('0x1f'),_0x3d3a22,_0x3d667a['error'][_0xa323('0x25')]);return _0x2f101c(_0x3d667a[_0xa323('0x23')][_0xa323('0x25')]);}else{logger[_0xa323('0x1e')](_0xa323('0x1f'),_0x3d3a22,_0xa323('0x20'));_0x2f101c(_0x3d667a[_0xa323('0x26')][_0xa323('0x25')]);}})[_0xa323('0x27')](function(_0x4266b6){logger[_0xa323('0x23')](_0xa323('0x1f'),_0x3d3a22,_0x4266b6);_0x972f40(_0x4266b6);});});}function respondWithStatusCode(_0xf3507f,_0x5ba371){_0x5ba371=_0x5ba371||0xcc;return function(_0x48a350){if(_0x48a350){return _0xf3507f[_0xa323('0x28')](_0x5ba371);}return _0xf3507f[_0xa323('0x29')](_0x5ba371)[_0xa323('0x2a')]();};}function respondWithResult(_0x5ac741,_0x3c6f1d){_0x3c6f1d=_0x3c6f1d||0xc8;return function(_0x14dd3d){if(_0x14dd3d){return _0x5ac741[_0xa323('0x29')](_0x3c6f1d)[_0xa323('0x2b')](_0x14dd3d);}};}function respondWithFilteredResult(_0x758dd9,_0x3c1298){return function(_0x1f032d){if(_0x1f032d){var _0x324104=typeof _0x3c1298[_0xa323('0x2c')]===_0xa323('0x2d')&&typeof _0x3c1298[_0xa323('0x2e')]==='undefined';var _0x9a56fb=_0x1f032d['count'];var _0x3a329d=_0x324104?0x0:_0x3c1298[_0xa323('0x2c')];var _0x4e5f87=_0x324104?_0x1f032d[_0xa323('0x2f')]:_0x3c1298[_0xa323('0x2c')]+_0x3c1298['limit'];var _0x399abf;if(_0x4e5f87>=_0x9a56fb){_0x4e5f87=_0x9a56fb;_0x399abf=0xc8;}else{_0x399abf=0xce;}_0x758dd9['status'](_0x399abf);return _0x758dd9[_0xa323('0x30')](_0xa323('0x31'),_0x3a329d+'-'+_0x4e5f87+'/'+_0x9a56fb)[_0xa323('0x2b')](_0x1f032d);}return null;};}function patchUpdates(_0x15e1ff){return function(_0x1bbbc1){try{jsonpatch[_0xa323('0x32')](_0x1bbbc1,_0x15e1ff,!![]);}catch(_0xd93624){return BPromise['reject'](_0xd93624);}return _0x1bbbc1[_0xa323('0x33')]();};}function saveUpdates(_0x1955da,_0x4b24be){return function(_0x48a4b6){if(_0x48a4b6){return _0x48a4b6[_0xa323('0x34')](_0x1955da)[_0xa323('0x1d')](function(_0x19bad3){return _0x19bad3;});}return null;};}function removeEntity(_0x2ee273,_0x16730c){return function(_0x50be42){if(_0x50be42){return _0x50be42[_0xa323('0x35')]()['then'](function(){var _0x4a2fae=_0x50be42[_0xa323('0x36')]({'plain':!![]});var _0xc3d59a='WhatsappAccounts';return db[_0xa323('0x37')]['destroy']({'where':{'type':_0xc3d59a,'resourceId':_0x4a2fae['id']}})[_0xa323('0x1d')](function(){return _0x50be42;});})[_0xa323('0x1d')](function(){_0x2ee273['status'](0xcc)[_0xa323('0x2a')]();});}};}function handleEntityNotFound(_0x3f4254,_0x225f4d){return function(_0x3275ab){if(!_0x3275ab){_0x3f4254[_0xa323('0x28')](0x194);}return _0x3275ab;};}function handleError(_0x537350,_0x538b40){_0x538b40=_0x538b40||0x1f4;return function(_0x5db045){logger[_0xa323('0x23')](_0x5db045[_0xa323('0x38')]);if(_0x5db045[_0xa323('0x39')]){delete _0x5db045['name'];}_0x537350['status'](_0x538b40)[_0xa323('0x3a')](_0x5db045);};}exports[_0xa323('0x3b')]=function(_0x1bf82f,_0x56cd5e){var _0x2e787b={'include':[{'model':db[_0xa323('0x3c')],'as':_0xa323('0x3d')}]},_0x1848ca={},_0x3d5aaf={'count':0x0,'rows':[]};var _0x53f711=_[_0xa323('0x3e')](db[_0xa323('0x3f')][_0xa323('0x40')],function(_0xf5a8d7){return{'name':_0xf5a8d7[_0xa323('0x41')],'type':_0xf5a8d7[_0xa323('0x42')]['key']};});_0x1848ca[_0xa323('0x43')]=_[_0xa323('0x3e')](_0x53f711,'name');_0x1848ca[_0xa323('0x44')]=_[_0xa323('0x45')](_0x1bf82f['query']);_0x1848ca[_0xa323('0x46')]=_[_0xa323('0x47')](_0x1848ca[_0xa323('0x43')],_0x1848ca[_0xa323('0x44')]);_0x2e787b[_0xa323('0x48')]=_[_0xa323('0x47')](_0x1848ca['model'],qs[_0xa323('0x49')](_0x1bf82f[_0xa323('0x44')][_0xa323('0x49')]));_0x2e787b['attributes']=_0x2e787b[_0xa323('0x48')]['length']?_0x2e787b[_0xa323('0x48')]:_0x1848ca[_0xa323('0x43')];if(!_0x1bf82f[_0xa323('0x44')]['hasOwnProperty']('nolimit')){_0x2e787b[_0xa323('0x2e')]=qs['limit'](_0x1bf82f[_0xa323('0x44')][_0xa323('0x2e')]);_0x2e787b[_0xa323('0x2c')]=qs['offset'](_0x1bf82f[_0xa323('0x44')]['offset']);}_0x2e787b[_0xa323('0x4a')]=qs[_0xa323('0x4b')](_0x1bf82f[_0xa323('0x44')][_0xa323('0x4b')]);_0x2e787b[_0xa323('0x4c')]=qs[_0xa323('0x46')](_['pick'](_0x1bf82f[_0xa323('0x44')],_0x1848ca['filters']),_0x53f711);if(_0x1bf82f[_0xa323('0x44')][_0xa323('0x4d')]){_0x2e787b[_0xa323('0x4c')]=_['merge'](_0x2e787b[_0xa323('0x4c')],{'$or':_[_0xa323('0x3e')](_0x53f711,function(_0x226aa2){if(_0x226aa2['type']!=='VIRTUAL'){var _0x89dcb1={};_0x89dcb1[_0x226aa2['name']]={'$like':'%'+_0x1bf82f[_0xa323('0x44')][_0xa323('0x4d')]+'%'};return _0x89dcb1;}})});}_0x2e787b=_['merge']({},_0x2e787b,_0x1bf82f['options']);var _0x1cfce4={'where':_0x2e787b[_0xa323('0x4c')]};return db[_0xa323('0x3f')][_0xa323('0x2f')](_0x1cfce4)[_0xa323('0x1d')](function(_0x2c3dda){_0x3d5aaf[_0xa323('0x2f')]=_0x2c3dda;if(_0x1bf82f['query']['includeAll']){_0x2e787b['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0xa323('0x4e')](_0x2e787b);})[_0xa323('0x1d')](function(_0x2c9c7b){_0x3d5aaf[_0xa323('0x4f')]=_0x2c9c7b;return _0x3d5aaf;})[_0xa323('0x1d')](respondWithFilteredResult(_0x56cd5e,_0x2e787b))['catch'](handleError(_0x56cd5e,null));};exports[_0xa323('0x50')]=function(_0xd3ca46,_0x53a375){var _0x175a6e={'raw':![],'where':{'id':_0xd3ca46['params']['id']},'include':[{'model':db[_0xa323('0x3c')],'as':_0xa323('0x3d')}]},_0x5a52e4={};_0x5a52e4[_0xa323('0x43')]=_['keys'](db[_0xa323('0x3f')][_0xa323('0x40')]);_0x5a52e4[_0xa323('0x44')]=_['keys'](_0xd3ca46['query']);_0x5a52e4[_0xa323('0x46')]=_['intersection'](_0x5a52e4[_0xa323('0x43')],_0x5a52e4[_0xa323('0x44')]);_0x175a6e[_0xa323('0x48')]=_[_0xa323('0x47')](_0x5a52e4[_0xa323('0x43')],qs[_0xa323('0x49')](_0xd3ca46[_0xa323('0x44')]['fields']));_0x175a6e[_0xa323('0x48')]=_0x175a6e['attributes'][_0xa323('0x51')]?_0x175a6e[_0xa323('0x48')]:_0x5a52e4[_0xa323('0x43')];if(_0xd3ca46[_0xa323('0x44')][_0xa323('0x52')]){_0x175a6e[_0xa323('0x53')]=[{'all':!![]}];}_0x175a6e=_[_0xa323('0x54')]({},_0x175a6e,_0xd3ca46[_0xa323('0x55')]);return db['WhatsappAccount'][_0xa323('0x56')](_0x175a6e)[_0xa323('0x1d')](handleEntityNotFound(_0x53a375,null))[_0xa323('0x1d')](respondWithResult(_0x53a375,null))[_0xa323('0x27')](handleError(_0x53a375,null));};exports['create']=function(_0x41ad25,_0x3544db){return db['WhatsappAccount']['create'](_0x41ad25[_0xa323('0x57')],{})['then'](function(_0xfc3b6a){var _0x4680ec=_0x41ad25[_0xa323('0x58')][_0xa323('0x36')]({'plain':!![]});if(!_0x4680ec)throw new Error(_0xa323('0x59'));if(_0x4680ec[_0xa323('0x5a')]===_0xa323('0x58')){var _0x51b2f0=_0xfc3b6a[_0xa323('0x36')]({'plain':!![]});var _0x577a54='WhatsappAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x577a54,'userProfileId':_0x4680ec[_0xa323('0x5b')]},'raw':!![]})[_0xa323('0x1d')](function(_0x10ea4e){if(_0x10ea4e&&_0x10ea4e[_0xa323('0x5c')]===0x0){return db[_0xa323('0x37')]['create']({'name':_0x51b2f0['name'],'resourceId':_0x51b2f0['id'],'type':_0x10ea4e[_0xa323('0x39')],'sectionId':_0x10ea4e['id']},{})[_0xa323('0x1d')](function(){return _0xfc3b6a;});}else{return _0xfc3b6a;}})['catch'](function(_0x5332d4){logger[_0xa323('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5332d4);throw _0x5332d4;});}return _0xfc3b6a;})[_0xa323('0x1d')](respondWithResult(_0x3544db,0xc9))['catch'](handleError(_0x3544db,null));};exports[_0xa323('0x34')]=function(_0x1030c9,_0x170cf7){if(_0x1030c9[_0xa323('0x57')]['id']){delete _0x1030c9[_0xa323('0x57')]['id'];}return db[_0xa323('0x3f')]['find']({'where':{'id':_0x1030c9[_0xa323('0x5d')]['id']},'include':[{'model':db[_0xa323('0x3c')],'as':'mandatoryDispositionPause'}]})[_0xa323('0x1d')](handleEntityNotFound(_0x170cf7,null))['then'](saveUpdates(_0x1030c9['body'],null))[_0xa323('0x1d')](respondWithResult(_0x170cf7,null))['catch'](handleError(_0x170cf7,null));};exports['destroy']=function(_0x3e121f,_0x1e1402){return db['WhatsappAccount']['find']({'where':{'id':_0x3e121f[_0xa323('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1e1402,null))[_0xa323('0x1d')](removeEntity(_0x1e1402,null))['catch'](handleError(_0x1e1402,null));};exports[_0xa323('0x5e')]=function(_0x4df008,_0x266dcc){return db[_0xa323('0x3f')]['describe']()[_0xa323('0x1d')](respondWithResult(_0x266dcc,null))['catch'](handleError(_0x266dcc,null));};exports[_0xa323('0x5f')]=function(_0x3ab577,_0x43df93,_0x1bc6e){if(_0x3ab577[_0xa323('0x57')]['id']){delete _0x3ab577[_0xa323('0x57')]['id'];}return db[_0xa323('0x3f')][_0xa323('0x56')]({'where':{'id':_0x3ab577['params']['id']}})[_0xa323('0x1d')](handleEntityNotFound(_0x43df93,null))['then'](function(_0x590a2e){if(_0x590a2e){_0x3ab577['body'][_0xa323('0x60')]=_0x590a2e['id'];return db[_0xa323('0x61')]['create'](_0x3ab577[_0xa323('0x57')]);}})['then'](respondWithResult(_0x43df93,null))[_0xa323('0x27')](handleError(_0x43df93,null));};exports[_0xa323('0x62')]=function(_0x3c3b0c,_0x561318,_0x48d805){var _0x260c07={'raw':![],'where':{}};var _0x6a0274={};var _0x19e99a={'count':0x0,'rows':[]};return db[_0xa323('0x3f')][_0xa323('0x63')]({'where':{'id':_0x3c3b0c[_0xa323('0x5d')]['id']}})[_0xa323('0x1d')](handleEntityNotFound(_0x561318,null))['then'](function(_0x4b3b69){if(_0x4b3b69){_0x6a0274[_0xa323('0x43')]=_[_0xa323('0x45')](db[_0xa323('0x61')][_0xa323('0x40')]);_0x6a0274['query']=_[_0xa323('0x45')](_0x3c3b0c[_0xa323('0x44')]);_0x6a0274[_0xa323('0x46')]=_[_0xa323('0x47')](_0x6a0274['model'],_0x6a0274[_0xa323('0x44')]);_0x260c07['attributes']=_[_0xa323('0x47')](_0x6a0274[_0xa323('0x43')],qs[_0xa323('0x49')](_0x3c3b0c[_0xa323('0x44')][_0xa323('0x49')]));_0x260c07[_0xa323('0x48')]=_0x260c07[_0xa323('0x48')]['length']?_0x260c07[_0xa323('0x48')]:_0x6a0274[_0xa323('0x43')];if(!_0x3c3b0c[_0xa323('0x44')][_0xa323('0x64')]('nolimit')){_0x260c07[_0xa323('0x2e')]=qs[_0xa323('0x2e')](_0x3c3b0c[_0xa323('0x44')]['limit']);_0x260c07[_0xa323('0x2c')]=qs['offset'](_0x3c3b0c[_0xa323('0x44')]['offset']);}_0x260c07[_0xa323('0x4a')]=qs[_0xa323('0x4b')](_0x3c3b0c[_0xa323('0x44')][_0xa323('0x4b')]);_0x260c07[_0xa323('0x4c')]=qs[_0xa323('0x46')](_[_0xa323('0x65')](_0x3c3b0c[_0xa323('0x44')],_0x6a0274[_0xa323('0x46')]));_0x260c07[_0xa323('0x4c')][_0xa323('0x60')]=_0x4b3b69['id'];if(_0x3c3b0c[_0xa323('0x44')][_0xa323('0x4d')]){_0x260c07[_0xa323('0x4c')]=_[_0xa323('0x54')](_0x260c07['where'],{'$or':_[_0xa323('0x3e')](_0x260c07[_0xa323('0x48')],function(_0x816fde){var _0x430adb={};_0x430adb[_0x816fde]={'$like':'%'+_0x3c3b0c['query'][_0xa323('0x4d')]+'%'};return _0x430adb;})});}_0x260c07=_[_0xa323('0x54')]({},_0x260c07,_0x3c3b0c[_0xa323('0x55')]);return db[_0xa323('0x61')]['count']({'where':_0x260c07[_0xa323('0x4c')]})[_0xa323('0x1d')](function(_0x3a2f50){_0x19e99a[_0xa323('0x2f')]=_0x3a2f50;if(_0x3c3b0c[_0xa323('0x44')][_0xa323('0x52')]){_0x260c07[_0xa323('0x53')]=[{'all':!![]}];}return db[_0xa323('0x61')][_0xa323('0x4e')](_0x260c07);})[_0xa323('0x1d')](function(_0x29d3a6){_0x19e99a[_0xa323('0x4f')]=_0x29d3a6;return _0x19e99a;});}})[_0xa323('0x1d')](respondWithFilteredResult(_0x561318,_0x260c07))[_0xa323('0x27')](handleError(_0x561318,null));};exports[_0xa323('0x66')]=function(_0x195807,_0x1464e5,_0x4ee4cf){return db[_0xa323('0x3f')][_0xa323('0x56')]({'where':{'id':_0x195807[_0xa323('0x5d')]['id']}})[_0xa323('0x1d')](handleEntityNotFound(_0x1464e5,null))['then'](function(_0x4489c2){if(_0x4489c2){return _0x4489c2[_0xa323('0x66')](_0x195807[_0xa323('0x44')][_0xa323('0x67')]);}})[_0xa323('0x1d')](respondWithStatusCode(_0x1464e5,null))['catch'](handleError(_0x1464e5,null));};exports['addAnswer']=function(_0x302dd2,_0x495d45,_0x4c2e5b){if(_0x302dd2[_0xa323('0x57')]['id']){delete _0x302dd2[_0xa323('0x57')]['id'];}return db[_0xa323('0x3f')][_0xa323('0x56')]({'where':{'id':_0x302dd2[_0xa323('0x5d')]['id']}})[_0xa323('0x1d')](handleEntityNotFound(_0x495d45,null))['then'](function(_0x4ec988){if(_0x4ec988){_0x302dd2['body'][_0xa323('0x60')]=_0x4ec988['id'];return db[_0xa323('0x68')][_0xa323('0x69')](_0x302dd2[_0xa323('0x57')]);}})[_0xa323('0x1d')](respondWithResult(_0x495d45,null))[_0xa323('0x27')](handleError(_0x495d45,null));};exports[_0xa323('0x6a')]=function(_0x25f254,_0x4a4aa7,_0x15e693){var _0x2e67db={'raw':![],'where':{}};var _0x4ed630={};var _0x493e6e={'count':0x0,'rows':[]};return db[_0xa323('0x3f')][_0xa323('0x63')]({'where':{'id':_0x25f254['params']['id']}})['then'](handleEntityNotFound(_0x4a4aa7,null))[_0xa323('0x1d')](function(_0x3810c6){if(_0x3810c6){_0x4ed630['model']=_['keys'](db[_0xa323('0x68')][_0xa323('0x40')]);_0x4ed630[_0xa323('0x44')]=_[_0xa323('0x45')](_0x25f254['query']);_0x4ed630[_0xa323('0x46')]=_['intersection'](_0x4ed630[_0xa323('0x43')],_0x4ed630[_0xa323('0x44')]);_0x2e67db[_0xa323('0x48')]=_[_0xa323('0x47')](_0x4ed630[_0xa323('0x43')],qs[_0xa323('0x49')](_0x25f254[_0xa323('0x44')]['fields']));_0x2e67db[_0xa323('0x48')]=_0x2e67db[_0xa323('0x48')]['length']?_0x2e67db['attributes']:_0x4ed630[_0xa323('0x43')];if(!_0x25f254[_0xa323('0x44')]['hasOwnProperty'](_0xa323('0x6b'))){_0x2e67db['limit']=qs[_0xa323('0x2e')](_0x25f254['query'][_0xa323('0x2e')]);_0x2e67db['offset']=qs[_0xa323('0x2c')](_0x25f254[_0xa323('0x44')]['offset']);}_0x2e67db[_0xa323('0x4a')]=qs[_0xa323('0x4b')](_0x25f254[_0xa323('0x44')]['sort']);_0x2e67db[_0xa323('0x4c')]=qs['filters'](_[_0xa323('0x65')](_0x25f254['query'],_0x4ed630[_0xa323('0x46')]));_0x2e67db[_0xa323('0x4c')][_0xa323('0x60')]=_0x3810c6['id'];if(_0x25f254[_0xa323('0x44')][_0xa323('0x4d')]){_0x2e67db[_0xa323('0x4c')]=_[_0xa323('0x54')](_0x2e67db['where'],{'$or':_[_0xa323('0x3e')](_0x2e67db[_0xa323('0x48')],function(_0x2b5975){var _0x180a67={};_0x180a67[_0x2b5975]={'$like':'%'+_0x25f254[_0xa323('0x44')][_0xa323('0x4d')]+'%'};return _0x180a67;})});}_0x2e67db=_[_0xa323('0x54')]({},_0x2e67db,_0x25f254[_0xa323('0x55')]);return db[_0xa323('0x68')][_0xa323('0x2f')]({'where':_0x2e67db[_0xa323('0x4c')]})[_0xa323('0x1d')](function(_0x312133){_0x493e6e[_0xa323('0x2f')]=_0x312133;if(_0x25f254['query'][_0xa323('0x52')]){_0x2e67db[_0xa323('0x53')]=[{'all':!![]}];}return db[_0xa323('0x68')]['findAll'](_0x2e67db);})[_0xa323('0x1d')](function(_0x2f0eae){_0x493e6e[_0xa323('0x4f')]=_0x2f0eae;return _0x493e6e;});}})['then'](respondWithFilteredResult(_0x4a4aa7,_0x2e67db))['catch'](handleError(_0x4a4aa7,null));};exports[_0xa323('0x6c')]=function(_0xac2b21,_0x5a0e85,_0xc467f2){return db[_0xa323('0x3f')][_0xa323('0x56')]({'where':{'id':_0xac2b21[_0xa323('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5a0e85,null))[_0xa323('0x1d')](function(_0x507a85){if(_0x507a85){return _0x507a85[_0xa323('0x6c')](_0xac2b21[_0xa323('0x44')]['ids']);}})[_0xa323('0x1d')](respondWithStatusCode(_0x5a0e85,null))[_0xa323('0x27')](handleError(_0x5a0e85,null));};exports['addAgents']=function(_0x3440f9,_0x27b03c,_0x34320a){return db[_0xa323('0x3f')][_0xa323('0x56')]({'where':{'id':_0x3440f9['params']['id']}})['then'](handleEntityNotFound(_0x27b03c,null))[_0xa323('0x1d')](function(_0x3176ac){if(_0x3176ac){return _0x3176ac[_0xa323('0x6d')](_0x3440f9[_0xa323('0x57')][_0xa323('0x67')],_['omit'](_0x3440f9['body'],[_0xa323('0x67'),'id'])||{})[_0xa323('0x6e')](function(_0x53a964){for(var _0x7f877c=0x0;_0x7f877c<_0x3440f9[_0xa323('0x57')][_0xa323('0x67')][_0xa323('0x51')];_0x7f877c+=0x1){socket[_0xa323('0x6f')](_0xa323('0x70'),{'UserId':Number(_0x3440f9[_0xa323('0x57')][_0xa323('0x67')][_0x7f877c]),'WhatsappAccountId':Number(_0x3440f9['params']['id'])});}return _0x53a964;});}})['then'](respondWithResult(_0x27b03c,null))['catch'](handleError(_0x27b03c,null));};exports['removeAgents']=function(_0x49df59,_0x1a0ca6,_0x528d0e){return db['WhatsappAccount'][_0xa323('0x56')]({'where':{'id':_0x49df59[_0xa323('0x5d')]['id']}})[_0xa323('0x1d')](handleEntityNotFound(_0x1a0ca6,null))[_0xa323('0x1d')](function(_0x3367bd){if(_0x3367bd){return _0x3367bd[_0xa323('0x71')](_0x49df59[_0xa323('0x44')][_0xa323('0x67')])[_0xa323('0x1d')](function(){if(_[_0xa323('0x72')](_0x49df59[_0xa323('0x44')][_0xa323('0x67')])){for(var _0x330e8c=0x0;_0x330e8c<_0x49df59[_0xa323('0x44')][_0xa323('0x67')][_0xa323('0x51')];_0x330e8c+=0x1){socket['emit'](_0xa323('0x73'),{'UserId':Number(_0x49df59[_0xa323('0x44')]['ids'][_0x330e8c]),'WhatsappAccountId':Number(_0x49df59[_0xa323('0x5d')]['id'])});}}else{socket['emit'](_0xa323('0x73'),{'UserId':Number(_0x49df59[_0xa323('0x44')]['ids']),'WhatsappAccountId':Number(_0x49df59[_0xa323('0x5d')]['id'])});}});}})[_0xa323('0x1d')](respondWithStatusCode(_0x1a0ca6,null))[_0xa323('0x27')](handleError(_0x1a0ca6,null));};exports[_0xa323('0x74')]=function(_0x1be4c5,_0x3c276c,_0x19dd98){var _0x2a7f26={};var _0x21d7dc={};var _0x30be89;var _0xdf4b56;return db[_0xa323('0x3f')][_0xa323('0x63')]({'where':{'id':_0x1be4c5[_0xa323('0x5d')]['id']}})[_0xa323('0x1d')](handleEntityNotFound(_0x3c276c,null))['then'](function(_0x4b4751){if(_0x4b4751){_0x30be89=_0x4b4751;_0x21d7dc[_0xa323('0x43')]=_[_0xa323('0x45')](db[_0xa323('0x75')][_0xa323('0x40')]);_0x21d7dc['query']=_[_0xa323('0x45')](_0x1be4c5[_0xa323('0x44')]);_0x21d7dc[_0xa323('0x46')]=_[_0xa323('0x47')](_0x21d7dc[_0xa323('0x43')],_0x21d7dc[_0xa323('0x44')]);_0x2a7f26[_0xa323('0x48')]=_[_0xa323('0x47')](_0x21d7dc['model'],qs['fields'](_0x1be4c5[_0xa323('0x44')][_0xa323('0x49')]));_0x2a7f26[_0xa323('0x48')]=_0x2a7f26['attributes'][_0xa323('0x51')]?_0x2a7f26[_0xa323('0x48')]:_0x21d7dc[_0xa323('0x43')];_0x2a7f26[_0xa323('0x4a')]=qs[_0xa323('0x4b')](_0x1be4c5[_0xa323('0x44')][_0xa323('0x4b')]);_0x2a7f26['where']=qs['filters'](_[_0xa323('0x65')](_0x1be4c5[_0xa323('0x44')],_0x21d7dc['filters']));if(_0x1be4c5[_0xa323('0x44')][_0xa323('0x4d')]){_0x2a7f26[_0xa323('0x4c')]=_[_0xa323('0x54')](_0x2a7f26[_0xa323('0x4c')],{'$or':_[_0xa323('0x3e')](_0x2a7f26[_0xa323('0x48')],function(_0x2de69e){var _0x291785={};_0x291785[_0x2de69e]={'$like':'%'+_0x1be4c5[_0xa323('0x44')][_0xa323('0x4d')]+'%'};return _0x291785;})});}_0x2a7f26=_[_0xa323('0x54')]({},_0x2a7f26,_0x1be4c5['options']);return _0x30be89[_0xa323('0x74')](_0x2a7f26);}})[_0xa323('0x1d')](function(_0x5e6e65){if(_0x5e6e65){_0xdf4b56=_0x5e6e65[_0xa323('0x51')];if(!_0x1be4c5['query'][_0xa323('0x64')](_0xa323('0x6b'))){_0x2a7f26[_0xa323('0x2e')]=qs['limit'](_0x1be4c5['query'][_0xa323('0x2e')]);_0x2a7f26[_0xa323('0x2c')]=qs['offset'](_0x1be4c5[_0xa323('0x44')][_0xa323('0x2c')]);}return _0x30be89['getAgents'](_0x2a7f26);}})['then'](function(_0x2dd4e4){if(_0x2dd4e4){return _0x2dd4e4?{'count':_0xdf4b56,'rows':_0x2dd4e4}:null;}})[_0xa323('0x1d')](respondWithResult(_0x3c276c,null))[_0xa323('0x27')](handleError(_0x3c276c,null));};exports[_0xa323('0x76')]=function(_0x2f5be6,_0x18e098){var _0x73f6e4=_0x2f5be6[_0xa323('0x5d')]['id'];var _0x5a97a3=_0x2f5be6[_0xa323('0x57')];var _0xf29524=0xc8;var _0x36bc83=null;return db['sequelize'][_0xa323('0x77')]({'isolationLevel':db[_0xa323('0x78')][_0xa323('0x79')][_0xa323('0x7a')]['READ_COMMITTED']},function(_0x25e652){return db[_0xa323('0x3f')][_0xa323('0x63')]({'where':{'id':_0x73f6e4},'transaction':_0x25e652})[_0xa323('0x1d')](function(_0x55d8cd){if(_0x55d8cd){return db[_0xa323('0x7b')][_0xa323('0x35')]({'where':{'WhatsappAccountId':_0x73f6e4},'transaction':_0x25e652})[_0xa323('0x1d')](function(){var _0x10bdc9=_[_0xa323('0x3e')](_0x5a97a3,function(_0x1e2729){_0x1e2729[_0xa323('0x60')]=_0x73f6e4;return _0x1e2729;});return db[_0xa323('0x7b')][_0xa323('0x7c')](_0x10bdc9,{'transaction':_0x25e652});});}else{_0xf29524=0x194;_0x36bc83=[];}});})[_0xa323('0x1d')](function(){if(_0xf29524!==0x194){return db[_0xa323('0x7b')][_0xa323('0x7d')]({'where':{'WhatsappAccountId':_0x73f6e4},'order':_0xa323('0x7e')})[_0xa323('0x1d')](function(_0x2fe885){_0x36bc83=_0x2fe885;});}})['catch'](function(_0x154066){_0xf29524=0x1f4;logger[_0xa323('0x23')](_0x154066[_0xa323('0x38')]);if(_0x154066['name']){delete _0x154066['name'];}_0x36bc83=_0x154066;})['finally'](function(){if(_0x36bc83===null){_0x18e098[_0xa323('0x28')](_0xf29524);}else{if(_0xf29524===0x1f4){_0x18e098['status'](_0xf29524)[_0xa323('0x3a')](_0x36bc83);}else{_0x18e098['status'](_0xf29524)[_0xa323('0x2b')](_0x36bc83);}}});};exports[_0xa323('0x7f')]=function(_0x412551,_0x5e0f65,_0x49a65a){var _0xf705d5={};var _0x14f273={};var _0x24ba2d;var _0x3f63a9;return db[_0xa323('0x3f')][_0xa323('0x63')]({'where':{'id':_0x412551[_0xa323('0x5d')]['id']}})[_0xa323('0x1d')](handleEntityNotFound(_0x5e0f65,null))[_0xa323('0x1d')](function(_0x213ff4){if(_0x213ff4){_0x24ba2d=_0x213ff4;_0x14f273[_0xa323('0x43')]=_['keys'](db[_0xa323('0x7b')][_0xa323('0x40')]);_0x14f273[_0xa323('0x44')]=_[_0xa323('0x45')](_0x412551[_0xa323('0x44')]);_0x14f273[_0xa323('0x46')]=_[_0xa323('0x47')](_0x14f273['model'],_0x14f273[_0xa323('0x44')]);_0xf705d5[_0xa323('0x48')]=_[_0xa323('0x47')](_0x14f273[_0xa323('0x43')],qs['fields'](_0x412551[_0xa323('0x44')][_0xa323('0x49')]));_0xf705d5[_0xa323('0x48')]=_0xf705d5['attributes']['length']?_0xf705d5[_0xa323('0x48')]:_0x14f273[_0xa323('0x43')];_0xf705d5[_0xa323('0x4a')]=qs[_0xa323('0x4b')](_0x412551['query'][_0xa323('0x4b')]);_0xf705d5[_0xa323('0x4c')]=qs[_0xa323('0x46')](_[_0xa323('0x65')](_0x412551[_0xa323('0x44')],_0x14f273['filters']));if(_0x412551[_0xa323('0x44')][_0xa323('0x4d')]){_0xf705d5[_0xa323('0x4c')]=_[_0xa323('0x54')](_0xf705d5[_0xa323('0x4c')],{'$or':_['map'](_0xf705d5[_0xa323('0x48')],function(_0x32052a){var _0x535015={};_0x535015[_0x32052a]={'$like':'%'+_0x412551['query'][_0xa323('0x4d')]+'%'};return _0x535015;})});}_0xf705d5=_['merge']({},_0xf705d5,_0x412551[_0xa323('0x55')]);return _0x24ba2d['getApplications'](_0xf705d5);}})[_0xa323('0x1d')](function(_0x4d5e13){if(_0x4d5e13){_0x3f63a9=_0x4d5e13[_0xa323('0x51')];if(!_0x412551[_0xa323('0x44')][_0xa323('0x64')](_0xa323('0x6b'))){_0xf705d5[_0xa323('0x2e')]=qs[_0xa323('0x2e')](_0x412551[_0xa323('0x44')]['limit']);_0xf705d5[_0xa323('0x2c')]=qs[_0xa323('0x2c')](_0x412551[_0xa323('0x44')][_0xa323('0x2c')]);}return _0x24ba2d[_0xa323('0x7f')](_0xf705d5);}})['then'](function(_0x15c99e){if(_0x15c99e){return _0x15c99e?{'count':_0x3f63a9,'rows':_0x15c99e}:null;}})[_0xa323('0x1d')](respondWithResult(_0x5e0f65,null))[_0xa323('0x27')](handleError(_0x5e0f65,null));};exports['notify']=function(_0x5f0778,_0x539d4f,_0x4f1a8a){var _0x11a59c={'channel':_0xa323('0x80')};var _0x4bdb73=[];var _0x56030c=[];var _0x46521e={};return db[_0xa323('0x3f')]['find']({'where':{'id':_0x5f0778['params']['id']},'include':[{'model':db[_0xa323('0x7b')],'as':_0xa323('0x81')}]})[_0xa323('0x1d')](handleEntityNotFound(_0x539d4f,null))[_0xa323('0x1d')](function(_0x169bfe){_0x11a59c[_0xa323('0x82')]=_0x169bfe;if(_0x11a59c['account']&&_0x11a59c['account'][_0xa323('0x42')]===_0xa323('0x83')&&_0x5f0778[_0xa323('0x57')][_0xa323('0x84')]){if(_0x5f0778[_0xa323('0x57')][_0xa323('0x84')][_0xa323('0x51')]===0x0)return;if(_0x5f0778[_0xa323('0x57')]['statuses'][0x0][_0xa323('0x85')]!==_0xa323('0x86'))return;return db[_0xa323('0x87')][_0xa323('0x34')]({'read':!![],'readAt':_0x5f0778['body']['statuses'][0x0][_0xa323('0x88')]},{'where':{'messageId':_0x5f0778[_0xa323('0x57')][_0xa323('0x84')][0x0]['message_id']},'individualHooks':!![]})[_0xa323('0x1d')](function(_0x3e4e28){return _0x539d4f[_0xa323('0x29')](0xc8)[_0xa323('0x2b')](_0x3e4e28);});}_0x11a59c[_0xa323('0x89')]=_['orderBy'](_0x169bfe[_0xa323('0x81')],[_0xa323('0x7e')],[_0xa323('0x8a')]);if(_0x11a59c[_0xa323('0x82')][_0xa323('0x81')]){delete _0x11a59c[_0xa323('0x82')][_0xa323('0x81')];}return db[_0xa323('0x8b')][_0xa323('0x5e')]()[_0xa323('0x1d')](function(_0x46b1a9){if(!_0x46b1a9){throw new db[(_0xa323('0x8c'))][(_0xa323('0x8d'))](_0xa323('0x8e'));}_0x4bdb73=_[_0xa323('0x8f')](_[_0xa323('0x45')](_0x46b1a9),[_0xa323('0x90'),_0xa323('0x91')]);_0x56030c=_['difference'](_[_0xa323('0x45')](_0x46b1a9),[_0xa323('0x90'),_0xa323('0x91'),_0xa323('0x92'),'ListId']);_0x11a59c[_0xa323('0x57')]={'mapKey':_0xa323('0x93')};if(_0x11a59c[_0xa323('0x82')]&&_0x11a59c[_0xa323('0x82')]['type']===_0xa323('0x94')){_0x11a59c[_0xa323('0x57')][_0xa323('0x95')]=_0x5f0778['body'][_0xa323('0x96')][_0xa323('0x97')]('whatsapp:','');_0x11a59c[_0xa323('0x57')][_0xa323('0x57')]=_0x5f0778[_0xa323('0x57')]['Body'];_0x11a59c[_0xa323('0x57')][_0xa323('0x98')]=_0x5f0778[_0xa323('0x57')][_0xa323('0x99')];}if(_0x11a59c['account']&&_0x11a59c[_0xa323('0x82')][_0xa323('0x42')]===_0xa323('0x83')){_0x11a59c[_0xa323('0x57')][_0xa323('0x95')]=_0x5f0778[_0xa323('0x57')][_0xa323('0x9a')][0x0][_0xa323('0x95')];_0x11a59c[_0xa323('0x57')][_0xa323('0x57')]=_0x5f0778[_0xa323('0x57')][_0xa323('0x9a')][0x0]['message'][_0xa323('0x57')];_0x11a59c[_0xa323('0x57')]['messageId']=_0x5f0778[_0xa323('0x57')][_0xa323('0x9a')][0x0]['message_id'];}if(_0x11a59c[_0xa323('0x57')]['id']){delete _0x11a59c[_0xa323('0x57')]['id'];}if(_['isNil'](_0x11a59c[_0xa323('0x57')][_0xa323('0x95')])){throw new db[(_0xa323('0x8c'))][(_0xa323('0x8d'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x11a59c[_0xa323('0x57')][_0xa323('0x57')])||_0x11a59c[_0xa323('0x57')][_0xa323('0x57')]===''){throw new db[(_0xa323('0x8c'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa323('0x9b')](_0x11a59c[_0xa323('0x57')][_0xa323('0x9c')])){throw new db[(_0xa323('0x8c'))][(_0xa323('0x8d'))](_0xa323('0x9d')+_0x56030c);}if(!_[_0xa323('0x9e')](_0x56030c,_0x11a59c[_0xa323('0x57')]['mapKey'])){throw new db[(_0xa323('0x8c'))][(_0xa323('0x8d'))](_0xa323('0x9f')+_0x56030c);}_0x46521e[_0x11a59c[_0xa323('0x57')]['mapKey']]=_0x11a59c[_0xa323('0x57')][_0xa323('0x95')];return db[_0xa323('0xa0')][_0xa323('0x56')]({'where':{'id':_0x11a59c[_0xa323('0x82')]['ListId']},'include':[{'model':db[_0xa323('0x8b')],'as':_0xa323('0xa1'),'where':_0x46521e,'limit':0x1,'order':[[_0xa323('0x91'),_0xa323('0xa2')]]}]});})[_0xa323('0x1d')](handleEntityNotFound(_0x539d4f,null))['then'](function(_0x399ec8){if(_0x399ec8){_0x11a59c[_0xa323('0xa3')]=_[_0xa323('0xa4')](_0x399ec8,[_0xa323('0xa1')]);if(_0x399ec8[_0xa323('0xa1')][_0xa323('0x51')]){return _0x399ec8[_0xa323('0xa1')][0x0];}var _0x578265=_[_0xa323('0xa5')](_0x11a59c['body'],{'firstName':_0x11a59c[_0xa323('0x57')][_0xa323('0x95')],'ListId':_0x399ec8['id']});_0x578265[_0x11a59c['body'][_0xa323('0x9c')]]=_0x11a59c[_0xa323('0x57')]['from'];return db[_0xa323('0x8b')]['create'](_0x578265,{'fields':_0x4bdb73,'raw':!![]});}})[_0xa323('0x1d')](handleEntityNotFound(_0x539d4f,null))[_0xa323('0x1d')](function(_0x39c817){if(_0x39c817){_0x11a59c[_0xa323('0xa6')]=_0x39c817;var _0x121da6={'ContactId':_0x39c817['id'],'phone':_0x11a59c[_0xa323('0x57')][_0xa323('0x95')],'WhatsappAccountId':_0x5f0778[_0xa323('0x5d')]['id']};var _0x362ee6={'ContactId':_0x39c817['id'],'WhatsappAccountId':_0x5f0778[_0xa323('0x5d')]['id'],'closed':![]};return db['WhatsappInteraction'][_0xa323('0x56')]({'where':_0x362ee6})[_0xa323('0x1d')](function(_0x3bde67){if(_0x3bde67){return[_0x3bde67,![]];}return db['WhatsappInteraction'][_0xa323('0x69')](_0x121da6)[_0xa323('0x1d')](function(_0x29f588){return[_0x29f588,!![]];});});}})['spread'](function(_0x40deb4,_0x4c3b92){_0x11a59c[_0xa323('0xa7')]=_0x40deb4['get']({'plain':!![]});_0x11a59c[_0xa323('0xa7')][_0xa323('0xa8')]=![];if(_0x4c3b92){if(_0x11a59c['account'][_0xa323('0xa9')]){_0x11a59c['applications'][_0xa323('0xaa')]({'id':0x0,'priority':_0x11a59c[_0xa323('0x89')]['length']+0x1,'app':_0xa323('0xab'),'appdata':_0xa323('0xac'),'interval':_0xa323('0xad')});}_0x11a59c['interaction']['created']=!![];}return db[_0xa323('0x87')][_0xa323('0x69')]({'phone':_0x11a59c[_0xa323('0x57')][_0xa323('0x95')],'messageId':_0x11a59c[_0xa323('0x57')]['messageId'],'body':_0x11a59c[_0xa323('0x57')][_0xa323('0x57')],'WhatsappAccountId':_0x5f0778[_0xa323('0x5d')]['id'],'WhatsappInteractionId':_0x40deb4['id'],'direction':'in','ContactId':_0x40deb4['ContactId'],'AttachmentId':_0x11a59c[_0xa323('0x57')]['AttachmentId']});})[_0xa323('0x1d')](function(_0x2e2cdf){_0x11a59c[_0xa323('0x25')]=_0x2e2cdf;if(!_0x11a59c[_0xa323('0xa7')][_0xa323('0xae')])return;return db[_0xa323('0x75')][_0xa323('0x56')]({'attributes':['id',_0xa323('0x39')],'where':{'id':_0x11a59c[_0xa323('0xa7')][_0xa323('0xae')]}});})['then'](function(_0xe0b5d5){if(_0xe0b5d5){_0x11a59c[_0xa323('0x89')][_0xa323('0xaf')]({'id':0x0,'priority':0x0,'app':_0xa323('0xb0'),'appdata':_0xe0b5d5[_0xa323('0x39')]+','+(_0x11a59c[_0xa323('0x82')][_0xa323('0xb1')]||0xa),'interval':_0xa323('0xad')});}if(!_0x11a59c[_0xa323('0xa7')][_0xa323('0xb2')])return;return db['WhatsappQueue']['find']({'attributes':['id',_0xa323('0x39')],'where':{'id':_0x11a59c[_0xa323('0xa7')][_0xa323('0xb2')]}});})[_0xa323('0x1d')](function(_0x5da289){if(_0x5da289){_0x11a59c[_0xa323('0x89')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x5da289[_0xa323('0x39')]+','+(_0x11a59c[_0xa323('0x82')][_0xa323('0xb3')]||0x12c),'interval':_0xa323('0xad')});}return respondWithRpcPromise(_0xa323('0xb4'),_0xa323('0xb5'),_0x11a59c);})[_0xa323('0x1d')](function(_0x28ab7f){if(_0x28ab7f){var _0x57b457=0xc8;var _0x253f94='receiveMessage';logger[_0xa323('0x1e')](_0xa323('0xb6'),_0x253f94,_0x57b457,_0xa323('0xb7'));logger['debug'](_0xa323('0xb8'),_0x253f94,_0x57b457,_0xa323('0xb7'),JSON[_0xa323('0x22')](_0x28ab7f));if(_0x11a59c[_0xa323('0x82')][_0xa323('0x42')]==='twilio'){return _0x539d4f[_0xa323('0x29')](_0x57b457)[_0xa323('0x30')](_0xa323('0xb9'),_0xa323('0xba'))[_0xa323('0x3a')]('\x0a');}else{return _0x539d4f[_0xa323('0x29')](_0x57b457)['json'](_0x28ab7f);}}});})[_0xa323('0x27')](handleError(_0x539d4f,null));};exports[_0xa323('0x3a')]=function(_0x28fa98,_0x4db704,_0x306bd7){var _0x1b7cd5,_0x4b3a02,_0x89c1b4;if(_[_0xa323('0x9b')](_0x28fa98[_0xa323('0x57')][_0xa323('0x57')])||_0x28fa98['body'][_0xa323('0x57')]===''){throw new db[(_0xa323('0x8c'))][(_0xa323('0x8d'))](_0xa323('0xbb'));}if(_[_0xa323('0x9b')](_0x28fa98[_0xa323('0x57')]['to'])){throw new db[(_0xa323('0x8c'))][(_0xa323('0x8d'))](_0xa323('0xbc'));}_0x1b7cd5=_0x28fa98[_0xa323('0x57')]['to'];return db[_0xa323('0x3f')][_0xa323('0x56')]({'where':{'id':_0x28fa98[_0xa323('0x5d')]['id']},'include':[{'model':db[_0xa323('0xa0')],'as':_0xa323('0xbd'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x1b7cd5},'limit':0x1,'order':[[_0xa323('0x91'),_0xa323('0xa2')]]}]}]})[_0xa323('0x1d')](handleEntityNotFound(_0x4db704,null))['then'](function(_0x3d7f5e){if(_0x3d7f5e&&_0x3d7f5e[_0xa323('0xbd')]){_0x4b3a02=_0x3d7f5e[_0xa323('0x36')]({'plain':!![]});if(_0x4b3a02[_0xa323('0xbd')]&&_0x4b3a02['List']['Contacts']['length']){return _0x4b3a02['List']['Contacts'][0x0];}return db[_0xa323('0x8b')][_0xa323('0x69')](_[_0xa323('0xa5')](_0x28fa98['body'],{'firstName':_0x1b7cd5,'mobile':_0x1b7cd5,'phone':_0x1b7cd5,'ListId':_0x4b3a02[_0xa323('0xbe')]}));}})[_0xa323('0x1d')](handleEntityNotFound(_0x4db704,null))[_0xa323('0x1d')](function(_0x2363bc){if(_0x2363bc){_0x89c1b4=_0x2363bc;return db['WhatsappInteraction'][_0xa323('0x56')]({'where':{'ContactId':_0x89c1b4['id'],'closed':![],'WhatsappAccountId':_0x4b3a02['id']}})[_0xa323('0x1d')](function(_0x14c68b){if(_0x14c68b){return[_0x14c68b,![]];}return db['WhatsappInteraction'][_0xa323('0x69')]({'UserId':_0x28fa98[_0xa323('0x58')]['id'],'ContactId':_0x89c1b4['id'],'WhatsappAccountId':_0x4b3a02['id'],'phone':_0x1b7cd5,'firstMsgDirection':_0xa323('0xbf'),'Messages':[_[_0xa323('0x54')](_0x28fa98[_0xa323('0x57')],{'read':![],'body':_0x28fa98[_0xa323('0x57')]['body'],'phone':_0x1b7cd5,'WhatsappAccountId':_0x4b3a02['id'],'UserId':_0x28fa98[_0xa323('0x58')]['id'],'ContactId':_0x89c1b4['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xa323('0xc0')}]})['then'](function(_0x230956){return[_0x230956,!![]];});});}})[_0xa323('0x6e')](function(_0x3996e1,_0x553f72){if(_0x553f72){return _0x3996e1;}return db['WhatsappMessage'][_0xa323('0x69')](_['merge'](_0x28fa98['body'],{'read':![],'body':_0x28fa98[_0xa323('0x57')][_0xa323('0x57')],'phone':_0x1b7cd5,'WhatsappAccountId':_0x4b3a02['id'],'WhatsappInteractionId':_0x3996e1['id'],'UserId':_0x28fa98[_0xa323('0x58')]['id'],'ContactId':_0x89c1b4['id']}))[_0xa323('0x1d')](function(_0x550d0c){_0x3996e1[_0xa323('0xc1')][_0xa323('0xc0')]=[];_0x3996e1[_0xa323('0xc1')][_0xa323('0xc0')][_0xa323('0xaa')](_0x550d0c[_0xa323('0xc1')]);return _0x3996e1;});})[_0xa323('0x1d')](respondWithResult(_0x4db704,null))[_0xa323('0x27')](handleError(_0x4db704,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index bdd158a..a60f93f 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 _0x5cbe=['events','WhatsappAccount','remove','emit','hasOwnProperty','exports'];(function(_0x39106e,_0x586f3d){var _0x892aec=function(_0xded1b5){while(--_0xded1b5){_0x39106e['push'](_0x39106e['shift']());}};_0x892aec(++_0x586f3d);}(_0x5cbe,0x120));var _0xe5cb=function(_0xac508,_0x55f6da){_0xac508=_0xac508-0x0;var _0x5e90c2=_0x5cbe[_0xac508];return _0x5e90c2;};'use strict';var EventEmitter=require(_0xe5cb('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xe5cb('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe5cb('0x2')};function emitEvent(_0x462d3d){return function(_0x1d6d13,_0x4c0c38,_0x26ecbb){WhatsappAccountEvents[_0xe5cb('0x3')](_0x462d3d+':'+_0x1d6d13['id'],_0x1d6d13);WhatsappAccountEvents[_0xe5cb('0x3')](_0x462d3d,_0x1d6d13);_0x26ecbb(null);};}for(var e in events){if(events[_0xe5cb('0x4')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xe5cb('0x5')]=WhatsappAccountEvents; \ No newline at end of file +var _0x1620=['exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1620,0x187));var _0x0162=function(_0x4f364f,_0xace16b){_0x4f364f=_0x4f364f-0x0;var _0x332d93=_0x1620[_0x4f364f];return _0x332d93;};'use strict';var EventEmitter=require(_0x0162('0x0'));var WhatsappAccount=require(_0x0162('0x1'))['db'][_0x0162('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x0162('0x3')](0x0);var events={'afterCreate':_0x0162('0x4'),'afterUpdate':'update','afterDestroy':_0x0162('0x5')};function emitEvent(_0x1b6c7b){return function(_0x2e42c5,_0x3d8d39,_0x35d86f){WhatsappAccountEvents[_0x0162('0x6')](_0x1b6c7b+':'+_0x2e42c5['id'],_0x2e42c5);WhatsappAccountEvents[_0x0162('0x6')](_0x1b6c7b,_0x2e42c5);_0x35d86f(null);};}for(var e in events){if(events[_0x0162('0x7')](e)){var event=events[e];WhatsappAccount[_0x0162('0x8')](e,emitEvent(event));}}module[_0x0162('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 c2fd982..b0aa1fb 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 _0xa21f=['exports','define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1afc2d,_0x1e1329){var _0x22688a=function(_0x2c6673){while(--_0x2c6673){_0x1afc2d['push'](_0x1afc2d['shift']());}};_0x22688a(++_0x1e1329);}(_0xa21f,0x7d));var _0xfa21=function(_0x4fde81,_0x2085d9){_0x4fde81=_0x4fde81-0x0;var _0x9e2360=_0xa21f[_0x4fde81];return _0x9e2360;};'use strict';var _=require(_0xfa21('0x0'));var util=require('util');var logger=require(_0xfa21('0x1'))('api');var moment=require(_0xfa21('0x2'));var BPromise=require(_0xfa21('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa21('0x4'));var rimraf=require(_0xfa21('0x5'));var config=require(_0xfa21('0x6'));var attributes=require('./whatsappAccount.attributes');module[_0xfa21('0x7')]=function(_0x2c8ea3,_0xd8f251){return _0x2c8ea3[_0xfa21('0x8')](_0xfa21('0x9'),attributes,{'tableName':_0xfa21('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5bc=['lodash','util','moment','bluebird','request-promise','rimraf','./whatsappAccount.attributes','whatsapp_accounts'];(function(_0x438bca,_0x170842){var _0x3c7723=function(_0x73abee){while(--_0x73abee){_0x438bca['push'](_0x438bca['shift']());}};_0x3c7723(++_0x170842);}(_0xb5bc,0xb0));var _0xcb5b=function(_0x546c68,_0x5c0116){_0x546c68=_0x546c68-0x0;var _0x4a2389=_0xb5bc[_0x546c68];return _0x4a2389;};'use strict';var _=require(_0xcb5b('0x0'));var util=require(_0xcb5b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcb5b('0x2'));var BPromise=require(_0xcb5b('0x3'));var rp=require(_0xcb5b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb5b('0x5'));var config=require('../../config/environment');var attributes=require(_0xcb5b('0x6'));module['exports']=function(_0x5b48c0,_0xfab715){return _0x5b48c0['define']('WhatsappAccount',attributes,{'tableName':_0xcb5b('0x7'),'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 49ebda0..ca2eddd 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 _0xb60f=['WhatsappAccount','find','options','raw','where','include','map','model','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowWhatsappAccount'];(function(_0xe121d1,_0x142b48){var _0x42d729=function(_0x36c5d3){while(--_0x36c5d3){_0xe121d1['push'](_0xe121d1['shift']());}};_0x42d729(++_0x142b48);}(_0xb60f,0xc2));var _0xfb60=function(_0x515cec,_0x747775){_0x515cec=_0x515cec-0x0;var _0x101834=_0xb60f[_0x515cec];return _0x101834;};'use strict';var _=require(_0xfb60('0x0'));var util=require(_0xfb60('0x1'));var moment=require(_0xfb60('0x2'));var BPromise=require('bluebird');var rs=require(_0xfb60('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb60('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb60('0x5'))(_0xfb60('0x6'));var config=require(_0xfb60('0x7'));var jayson=require(_0xfb60('0x8'));var client=jayson[_0xfb60('0x9')][_0xfb60('0xa')]({'port':0x232a});config[_0xfb60('0xb')]=_['defaults'](config[_0xfb60('0xb')],{'host':_0xfb60('0xc'),'port':0x18eb});var socket=require(_0xfb60('0xd'))(new Redis(config[_0xfb60('0xb')]));require(_0xfb60('0xe'))[_0xfb60('0xf')](socket);function respondWithRpcPromise(_0x374f1b,_0x52ba49,_0x2baa22){return new BPromise(function(_0x1de082,_0x561d45){return client['request'](_0x374f1b,_0x2baa22)[_0xfb60('0x10')](function(_0x59912f){logger[_0xfb60('0x11')](_0xfb60('0x12'),_0x52ba49,'request\x20sent');logger['debug'](_0xfb60('0x13'),_0x52ba49,_0xfb60('0x14'),JSON[_0xfb60('0x15')](_0x59912f));if(_0x59912f[_0xfb60('0x16')]){if(_0x59912f[_0xfb60('0x16')][_0xfb60('0x17')]===0x1f4){logger[_0xfb60('0x16')](_0xfb60('0x12'),_0x52ba49,_0x59912f[_0xfb60('0x16')][_0xfb60('0x18')]);return _0x561d45(_0x59912f['error'][_0xfb60('0x18')]);}logger[_0xfb60('0x16')](_0xfb60('0x12'),_0x52ba49,_0x59912f['error'][_0xfb60('0x18')]);return _0x1de082(_0x59912f[_0xfb60('0x16')][_0xfb60('0x18')]);}else{logger['info'](_0xfb60('0x12'),_0x52ba49,_0xfb60('0x14'));_0x1de082(_0x59912f[_0xfb60('0x19')][_0xfb60('0x18')]);}})[_0xfb60('0x1a')](function(_0x14037c){logger[_0xfb60('0x16')](_0xfb60('0x12'),_0x52ba49,_0x14037c);_0x561d45(_0x14037c);});});}exports[_0xfb60('0x1b')]=function(_0x4b4c10){var _0x49056c=this;return new Promise(function(_0xb30b41,_0x5d0bda){return db[_0xfb60('0x1c')][_0xfb60('0x1d')]({'raw':_0x4b4c10['options']?_0x4b4c10[_0xfb60('0x1e')][_0xfb60('0x1f')]===undefined?!![]:![]:!![],'where':_0x4b4c10[_0xfb60('0x1e')]?_0x4b4c10[_0xfb60('0x1e')][_0xfb60('0x20')]||null:null,'attributes':_0x4b4c10[_0xfb60('0x1e')]?_0x4b4c10[_0xfb60('0x1e')]['attributes']||null:null,'include':_0x4b4c10[_0xfb60('0x1e')]?_0x4b4c10[_0xfb60('0x1e')][_0xfb60('0x21')]?_['map'](_0x4b4c10[_0xfb60('0x1e')][_0xfb60('0x21')],function(_0x3da9e1){return{'model':db[_0x3da9e1['model']],'as':_0x3da9e1['as'],'attributes':_0x3da9e1['attributes'],'include':_0x3da9e1['include']?_[_0xfb60('0x22')](_0x3da9e1[_0xfb60('0x21')],function(_0x259ead){return{'model':db[_0x259ead[_0xfb60('0x23')]],'as':_0x259ead['as'],'attributes':_0x259ead['attributes'],'include':_0x259ead[_0xfb60('0x21')]?_[_0xfb60('0x22')](_0x259ead['include'],function(_0x2f04ce){return{'model':db[_0x2f04ce['model']],'as':_0x2f04ce['as'],'attributes':_0x2f04ce['attributes']};}):[]};}):[]};}):[]:[]})[_0xfb60('0x10')](function(_0x5e4dba){logger[_0xfb60('0x11')](_0xfb60('0x1b'),_0x4b4c10);logger[_0xfb60('0x24')]('ShowWhatsappAccount',_0x4b4c10,JSON['stringify'](_0x5e4dba));_0xb30b41(_0x5e4dba);})['catch'](function(_0x54d6a8){logger['error']('ShowWhatsappAccount',_0x54d6a8[_0xfb60('0x18')],_0x4b4c10);_0x5d0bda(_0x49056c[_0xfb60('0x16')](0x1f4,_0x54d6a8[_0xfb60('0x18')]));});});}; \ No newline at end of file +var _0xfaeb=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','ShowWhatsappAccount','find','raw','options','where','attributes','include','map'];(function(_0x2c7377,_0x32ade5){var _0x35e181=function(_0x1be1e6){while(--_0x1be1e6){_0x2c7377['push'](_0x2c7377['shift']());}};_0x35e181(++_0x32ade5);}(_0xfaeb,0x1a4));var _0xbfae=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xfaeb[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xbfae('0x0'));var util=require(_0xbfae('0x1'));var moment=require(_0xbfae('0x2'));var BPromise=require(_0xbfae('0x3'));var rs=require(_0xbfae('0x4'));var fs=require('fs');var Redis=require(_0xbfae('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbfae('0x6'));var logger=require(_0xbfae('0x7'))(_0xbfae('0x8'));var config=require(_0xbfae('0x9'));var jayson=require(_0xbfae('0xa'));var client=jayson[_0xbfae('0xb')][_0xbfae('0xc')]({'port':0x232a});config[_0xbfae('0xd')]=_[_0xbfae('0xe')](config[_0xbfae('0xd')],{'host':_0xbfae('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')[_0xbfae('0x10')](socket);function respondWithRpcPromise(_0x1cd731,_0x53e65d,_0x67cbb1){return new BPromise(function(_0x41caae,_0x4abaf8){return client[_0xbfae('0x11')](_0x1cd731,_0x67cbb1)[_0xbfae('0x12')](function(_0x13bfa9){logger[_0xbfae('0x13')](_0xbfae('0x14'),_0x53e65d,'request\x20sent');logger[_0xbfae('0x15')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x53e65d,_0xbfae('0x16'),JSON['stringify'](_0x13bfa9));if(_0x13bfa9[_0xbfae('0x17')]){if(_0x13bfa9['error'][_0xbfae('0x18')]===0x1f4){logger[_0xbfae('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x53e65d,_0x13bfa9['error'][_0xbfae('0x19')]);return _0x4abaf8(_0x13bfa9[_0xbfae('0x17')][_0xbfae('0x19')]);}logger[_0xbfae('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x53e65d,_0x13bfa9[_0xbfae('0x17')][_0xbfae('0x19')]);return _0x41caae(_0x13bfa9['error'][_0xbfae('0x19')]);}else{logger[_0xbfae('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x53e65d,'request\x20sent');_0x41caae(_0x13bfa9[_0xbfae('0x1a')][_0xbfae('0x19')]);}})[_0xbfae('0x1b')](function(_0x8c4cf4){logger[_0xbfae('0x17')](_0xbfae('0x14'),_0x53e65d,_0x8c4cf4);_0x4abaf8(_0x8c4cf4);});});}exports[_0xbfae('0x1c')]=function(_0x34bff8){var _0x2063ad=this;return new Promise(function(_0x5d53eb,_0x5ccbf4){return db['WhatsappAccount'][_0xbfae('0x1d')]({'raw':_0x34bff8['options']?_0x34bff8['options'][_0xbfae('0x1e')]===undefined?!![]:![]:!![],'where':_0x34bff8[_0xbfae('0x1f')]?_0x34bff8[_0xbfae('0x1f')][_0xbfae('0x20')]||null:null,'attributes':_0x34bff8[_0xbfae('0x1f')]?_0x34bff8[_0xbfae('0x1f')][_0xbfae('0x21')]||null:null,'include':_0x34bff8[_0xbfae('0x1f')]?_0x34bff8[_0xbfae('0x1f')][_0xbfae('0x22')]?_[_0xbfae('0x23')](_0x34bff8[_0xbfae('0x1f')][_0xbfae('0x22')],function(_0x33ca5d){return{'model':db[_0x33ca5d['model']],'as':_0x33ca5d['as'],'attributes':_0x33ca5d[_0xbfae('0x21')],'include':_0x33ca5d[_0xbfae('0x22')]?_[_0xbfae('0x23')](_0x33ca5d['include'],function(_0x444db4){return{'model':db[_0x444db4[_0xbfae('0x24')]],'as':_0x444db4['as'],'attributes':_0x444db4[_0xbfae('0x21')],'include':_0x444db4['include']?_[_0xbfae('0x23')](_0x444db4['include'],function(_0x1bdbcc){return{'model':db[_0x1bdbcc[_0xbfae('0x24')]],'as':_0x1bdbcc['as'],'attributes':_0x1bdbcc[_0xbfae('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbfae('0x12')](function(_0x22c800){logger[_0xbfae('0x13')](_0xbfae('0x1c'),_0x34bff8);logger[_0xbfae('0x15')]('ShowWhatsappAccount',_0x34bff8,JSON[_0xbfae('0x25')](_0x22c800));_0x5d53eb(_0x22c800);})['catch'](function(_0x33c71d){logger[_0xbfae('0x17')](_0xbfae('0x1c'),_0x33c71d[_0xbfae('0x19')],_0x34bff8);_0x5ccbf4(_0x2063ad[_0xbfae('0x17')](0x1f4,_0x33c71d[_0xbfae('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index e53e1a6..df9e9b7 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 _0x48c1=['update','register','length','whatsappAccount:','./whatsappAccount.events','save','remove'];(function(_0x473e3f,_0x2f0947){var _0x59399b=function(_0x26dece){while(--_0x26dece){_0x473e3f['push'](_0x473e3f['shift']());}};_0x59399b(++_0x2f0947);}(_0x48c1,0xeb));var _0x148c=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x48c1[_0x1e3671];return _0x48d5f5;};'use strict';var WhatsappAccountEvents=require(_0x148c('0x0'));var events=[_0x148c('0x1'),_0x148c('0x2'),_0x148c('0x3')];function createListener(_0x3d34c0,_0x5de3c0){return function(_0x12808c){_0x5de3c0['emit'](_0x3d34c0,_0x12808c);};}function removeListener(_0x495971,_0x3b4502){return function(){WhatsappAccountEvents['removeListener'](_0x495971,_0x3b4502);};}exports[_0x148c('0x4')]=function(_0x2bb0a8){for(var _0x5dd793=0x0,_0x33b09d=events[_0x148c('0x5')];_0x5dd793<_0x33b09d;_0x5dd793++){var _0x43fe4a=events[_0x5dd793];var _0x23c9b9=createListener(_0x148c('0x6')+_0x43fe4a,_0x2bb0a8);WhatsappAccountEvents['on'](_0x43fe4a,_0x23c9b9);}}; \ No newline at end of file +var _0x9466=['length','whatsappAccount:','./whatsappAccount.events','save','update','emit','removeListener'];(function(_0x1bd3ab,_0x352c42){var _0x37e394=function(_0x2f581d){while(--_0x2f581d){_0x1bd3ab['push'](_0x1bd3ab['shift']());}};_0x37e394(++_0x352c42);}(_0x9466,0x128));var _0x6946=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9466[_0x321bb2];return _0x9c12ed;};'use strict';var WhatsappAccountEvents=require(_0x6946('0x0'));var events=[_0x6946('0x1'),'remove',_0x6946('0x2')];function createListener(_0xad6768,_0x201e62){return function(_0x2a8762){_0x201e62[_0x6946('0x3')](_0xad6768,_0x2a8762);};}function removeListener(_0xf92e37,_0x5d5f2b){return function(){WhatsappAccountEvents[_0x6946('0x4')](_0xf92e37,_0x5d5f2b);};}exports['register']=function(_0x41bf5c){for(var _0x2742fc=0x0,_0xbc7956=events[_0x6946('0x5')];_0x2742fc<_0xbc7956;_0x2742fc++){var _0x1fc714=events[_0x2742fc];var _0x42302c=createListener(_0x6946('0x6')+_0x1fc714,_0x41bf5c);WhatsappAccountEvents['on'](_0x1fc714,_0x42302c);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 12f9d59..7a6b243 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 _0x3e37=['delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','index','get','isAuthenticated','show','post','put','/:id','update'];(function(_0x51bac9,_0x22d9dc){var _0x372026=function(_0x22d67d){while(--_0x22d67d){_0x51bac9['push'](_0x51bac9['shift']());}};_0x372026(++_0x22d9dc);}(_0x3e37,0x1f0));var _0x73e3=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x3e37[_0x49b207];return _0x2dc8fa;};'use strict';var multer=require(_0x73e3('0x0'));var util=require('util');var path=require(_0x73e3('0x1'));var timeout=require(_0x73e3('0x2'));var express=require('express');var router=express[_0x73e3('0x3')]();var fs_extra=require(_0x73e3('0x4'));var auth=require(_0x73e3('0x5'));var interaction=require(_0x73e3('0x6'));var config=require(_0x73e3('0x7'));var controller=require(_0x73e3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x73e3('0x9')]);router[_0x73e3('0xa')]('/:id',auth[_0x73e3('0xb')](),controller[_0x73e3('0xc')]);router[_0x73e3('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x73e3('0xe')](_0x73e3('0xf'),auth[_0x73e3('0xb')](),controller[_0x73e3('0x10')]);router[_0x73e3('0x11')](_0x73e3('0xf'),auth[_0x73e3('0xb')](),controller['destroy']);module[_0x73e3('0x12')]=router; \ No newline at end of file +var _0xa547=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','update','delete','destroy','util','path','connect-timeout','express','fs-extra'];(function(_0x190d0f,_0x163d30){var _0x5594c4=function(_0x461610){while(--_0x461610){_0x190d0f['push'](_0x190d0f['shift']());}};_0x5594c4(++_0x163d30);}(_0xa547,0x87));var _0x7a54=function(_0x581cf0,_0x50c8d1){_0x581cf0=_0x581cf0-0x0;var _0x2dd166=_0xa547[_0x581cf0];return _0x2dd166;};'use strict';var multer=require('multer');var util=require(_0x7a54('0x0'));var path=require(_0x7a54('0x1'));var timeout=require(_0x7a54('0x2'));var express=require(_0x7a54('0x3'));var router=express['Router']();var fs_extra=require(_0x7a54('0x4'));var auth=require(_0x7a54('0x5'));var interaction=require(_0x7a54('0x6'));var config=require(_0x7a54('0x7'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x7a54('0x8')](),controller[_0x7a54('0x9')]);router['get'](_0x7a54('0xa'),auth[_0x7a54('0x8')](),controller['show']);router['post']('/',auth[_0x7a54('0x8')](),controller['create']);router['put'](_0x7a54('0xa'),auth[_0x7a54('0x8')](),controller[_0x7a54('0xb')]);router[_0x7a54('0xc')](_0x7a54('0xa'),auth[_0x7a54('0x8')](),controller[_0x7a54('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index f1197e6..213a4d4 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 _0x2d39=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x5a5d16,_0x39b6d9){var _0x502a53=function(_0x5be70a){while(--_0x5be70a){_0x5a5d16['push'](_0x5a5d16['shift']());}};_0x502a53(++_0x39b6d9);}(_0x2d39,0x1b4));var _0x92d3=function(_0x148a20,_0xd94312){_0x148a20=_0x148a20-0x0;var _0x1dc060=_0x2d39[_0x148a20];return _0x1dc060;};'use strict';var Sequelize=require(_0x92d3('0x0'));module[_0x92d3('0x1')]={'priority':{'type':Sequelize[_0x92d3('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x92d3('0x3')],'allowNull':![],'defaultValue':_0x92d3('0x4')},'appdata':{'type':Sequelize[_0x92d3('0x5')]()},'description':{'type':Sequelize[_0x92d3('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x92d3('0x6')}}; \ No newline at end of file +var _0x96a2=['STRING','TEXT','sequelize','INTEGER'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x96a2,0xea));var _0x296a=function(_0x24147c,_0x2291c9){_0x24147c=_0x24147c-0x0;var _0x2948ea=_0x96a2[_0x24147c];return _0x2948ea;};'use strict';var Sequelize=require(_0x296a('0x0'));module['exports']={'priority':{'type':Sequelize[_0x296a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x296a('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x296a('0x3')]()},'description':{'type':Sequelize[_0x296a('0x2')]},'interval':{'type':Sequelize[_0x296a('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index ef12a27..eda5031 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 _0x9672=['type','VIRTUAL','options','WhatsappApplication','include','findAll','rows','show','includeAll','catch','create','params','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge'];(function(_0x403992,_0x40feb2){var _0x359df6=function(_0xcb2303){while(--_0xcb2303){_0x403992['push'](_0x403992['shift']());}};_0x359df6(++_0x40feb2);}(_0x9672,0xee));var _0x2967=function(_0x1b18cf,_0x2071ff){_0x1b18cf=_0x1b18cf-0x0;var _0x4df4c0=_0x9672[_0x1b18cf];return _0x4df4c0;};'use strict';var emlformat=require(_0x2967('0x0'));var rimraf=require(_0x2967('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2967('0x2'));var rp=require(_0x2967('0x3'));var moment=require(_0x2967('0x4'));var BPromise=require(_0x2967('0x5'));var Mustache=require('mustache');var util=require(_0x2967('0x6'));var path=require(_0x2967('0x7'));var sox=require(_0x2967('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2967('0x9'));var _=require(_0x2967('0xa'));var squel=require(_0x2967('0xb'));var crypto=require(_0x2967('0xc'));var jsforce=require(_0x2967('0xd'));var deskjs=require(_0x2967('0xe'));var toCsv=require(_0x2967('0xf'));var querystring=require(_0x2967('0x10'));var Papa=require('papaparse');var Redis=require(_0x2967('0x11'));var authService=require(_0x2967('0x12'));var qs=require(_0x2967('0x13'));var as=require(_0x2967('0x14'));var hardwareService=require(_0x2967('0x15'));var logger=require(_0x2967('0x16'))('api');var utils=require(_0x2967('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2967('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x207630,_0x298f58){_0x298f58=_0x298f58||0xcc;return function(_0x4d777a){if(_0x4d777a){return _0x207630[_0x2967('0x19')](_0x298f58);}return _0x207630['status'](_0x298f58)[_0x2967('0x1a')]();};}function respondWithResult(_0x313b5c,_0x3ea4b3){_0x3ea4b3=_0x3ea4b3||0xc8;return function(_0x52d5c0){if(_0x52d5c0){return _0x313b5c['status'](_0x3ea4b3)[_0x2967('0x1b')](_0x52d5c0);}};}function respondWithFilteredResult(_0x9a4e11,_0x42296c){return function(_0x4e1d34){if(_0x4e1d34){var _0x574a9f=typeof _0x42296c[_0x2967('0x1c')]===_0x2967('0x1d')&&typeof _0x42296c[_0x2967('0x1e')]===_0x2967('0x1d');var _0x50fbcb=_0x4e1d34[_0x2967('0x1f')];var _0x426fee=_0x574a9f?0x0:_0x42296c[_0x2967('0x1c')];var _0x209f45=_0x574a9f?_0x4e1d34[_0x2967('0x1f')]:_0x42296c['offset']+_0x42296c[_0x2967('0x1e')];var _0x449991;if(_0x209f45>=_0x50fbcb){_0x209f45=_0x50fbcb;_0x449991=0xc8;}else{_0x449991=0xce;}_0x9a4e11[_0x2967('0x20')](_0x449991);return _0x9a4e11[_0x2967('0x21')]('Content-Range',_0x426fee+'-'+_0x209f45+'/'+_0x50fbcb)[_0x2967('0x1b')](_0x4e1d34);}return null;};}function patchUpdates(_0x1cb5e4){return function(_0x33bb91){try{jsonpatch['apply'](_0x33bb91,_0x1cb5e4,!![]);}catch(_0x5e0e26){return BPromise[_0x2967('0x22')](_0x5e0e26);}return _0x33bb91[_0x2967('0x23')]();};}function saveUpdates(_0x258eca,_0x10788e){return function(_0x832a72){if(_0x832a72){return _0x832a72[_0x2967('0x24')](_0x258eca)[_0x2967('0x25')](function(_0x3d1040){return _0x3d1040;});}return null;};}function removeEntity(_0x46ab4a,_0x5bd687){return function(_0x436b45){if(_0x436b45){return _0x436b45[_0x2967('0x26')]()[_0x2967('0x25')](function(){_0x46ab4a[_0x2967('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42acb3,_0x4327a5){return function(_0x524ab1){if(!_0x524ab1){_0x42acb3[_0x2967('0x19')](0x194);}return _0x524ab1;};}function handleError(_0x2f9d9f,_0x2bfcd3){_0x2bfcd3=_0x2bfcd3||0x1f4;return function(_0xef5d7f){logger[_0x2967('0x27')](_0xef5d7f[_0x2967('0x28')]);if(_0xef5d7f[_0x2967('0x29')]){delete _0xef5d7f['name'];}_0x2f9d9f[_0x2967('0x20')](_0x2bfcd3)[_0x2967('0x2a')](_0xef5d7f);};}exports[_0x2967('0x2b')]=function(_0x57cee6,_0x2a04e6){var _0x30ba97={},_0x2d704d={},_0x48a49b={'count':0x0,'rows':[]};var _0x903e11=_[_0x2967('0x2c')](db['WhatsappApplication'][_0x2967('0x2d')],function(_0x45c7fd){return{'name':_0x45c7fd[_0x2967('0x2e')],'type':_0x45c7fd['type'][_0x2967('0x2f')]};});_0x2d704d[_0x2967('0x30')]=_[_0x2967('0x2c')](_0x903e11,'name');_0x2d704d[_0x2967('0x31')]=_[_0x2967('0x32')](_0x57cee6[_0x2967('0x31')]);_0x2d704d[_0x2967('0x33')]=_[_0x2967('0x34')](_0x2d704d[_0x2967('0x30')],_0x2d704d[_0x2967('0x31')]);_0x30ba97[_0x2967('0x35')]=_[_0x2967('0x34')](_0x2d704d[_0x2967('0x30')],qs[_0x2967('0x36')](_0x57cee6[_0x2967('0x31')][_0x2967('0x36')]));_0x30ba97[_0x2967('0x35')]=_0x30ba97[_0x2967('0x35')][_0x2967('0x37')]?_0x30ba97['attributes']:_0x2d704d['model'];if(!_0x57cee6[_0x2967('0x31')][_0x2967('0x38')](_0x2967('0x39'))){_0x30ba97[_0x2967('0x1e')]=qs['limit'](_0x57cee6[_0x2967('0x31')]['limit']);_0x30ba97[_0x2967('0x1c')]=qs[_0x2967('0x1c')](_0x57cee6[_0x2967('0x31')]['offset']);}_0x30ba97[_0x2967('0x3a')]=qs['sort'](_0x57cee6[_0x2967('0x31')]['sort']);_0x30ba97[_0x2967('0x3b')]=qs[_0x2967('0x33')](_['pick'](_0x57cee6[_0x2967('0x31')],_0x2d704d[_0x2967('0x33')]),_0x903e11);if(_0x57cee6[_0x2967('0x31')][_0x2967('0x3c')]){_0x30ba97[_0x2967('0x3b')]=_[_0x2967('0x3d')](_0x30ba97[_0x2967('0x3b')],{'$or':_[_0x2967('0x2c')](_0x903e11,function(_0x3f3d19){if(_0x3f3d19[_0x2967('0x3e')]!==_0x2967('0x3f')){var _0x2d39df={};_0x2d39df[_0x3f3d19[_0x2967('0x29')]]={'$like':'%'+_0x57cee6[_0x2967('0x31')][_0x2967('0x3c')]+'%'};return _0x2d39df;}})});}_0x30ba97=_[_0x2967('0x3d')]({},_0x30ba97,_0x57cee6[_0x2967('0x40')]);var _0x735670={'where':_0x30ba97[_0x2967('0x3b')]};return db[_0x2967('0x41')][_0x2967('0x1f')](_0x735670)[_0x2967('0x25')](function(_0x3366c1){_0x48a49b[_0x2967('0x1f')]=_0x3366c1;if(_0x57cee6['query']['includeAll']){_0x30ba97[_0x2967('0x42')]=[{'all':!![]}];}return db[_0x2967('0x41')][_0x2967('0x43')](_0x30ba97);})[_0x2967('0x25')](function(_0x3ce06d){_0x48a49b[_0x2967('0x44')]=_0x3ce06d;return _0x48a49b;})['then'](respondWithFilteredResult(_0x2a04e6,_0x30ba97))['catch'](handleError(_0x2a04e6,null));};exports[_0x2967('0x45')]=function(_0x5c6b8c,_0x235d39){var _0x3f4a94={'raw':!![],'where':{'id':_0x5c6b8c['params']['id']}},_0x31a35f={};_0x31a35f[_0x2967('0x30')]=_[_0x2967('0x32')](db['WhatsappApplication']['rawAttributes']);_0x31a35f[_0x2967('0x31')]=_[_0x2967('0x32')](_0x5c6b8c[_0x2967('0x31')]);_0x31a35f['filters']=_[_0x2967('0x34')](_0x31a35f[_0x2967('0x30')],_0x31a35f[_0x2967('0x31')]);_0x3f4a94[_0x2967('0x35')]=_['intersection'](_0x31a35f['model'],qs[_0x2967('0x36')](_0x5c6b8c['query'][_0x2967('0x36')]));_0x3f4a94['attributes']=_0x3f4a94['attributes'][_0x2967('0x37')]?_0x3f4a94[_0x2967('0x35')]:_0x31a35f['model'];if(_0x5c6b8c[_0x2967('0x31')][_0x2967('0x46')]){_0x3f4a94['include']=[{'all':!![]}];}_0x3f4a94=_[_0x2967('0x3d')]({},_0x3f4a94,_0x5c6b8c[_0x2967('0x40')]);return db[_0x2967('0x41')]['find'](_0x3f4a94)[_0x2967('0x25')](handleEntityNotFound(_0x235d39,null))['then'](respondWithResult(_0x235d39,null))[_0x2967('0x47')](handleError(_0x235d39,null));};exports[_0x2967('0x48')]=function(_0x420182,_0x286869){return db[_0x2967('0x41')][_0x2967('0x48')](_0x420182['body'],{})[_0x2967('0x25')](respondWithResult(_0x286869,0xc9))[_0x2967('0x47')](handleError(_0x286869,null));};exports['update']=function(_0x369128,_0x27bbac){if(_0x369128['body']['id']){delete _0x369128['body']['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x369128[_0x2967('0x49')]['id']}})[_0x2967('0x25')](handleEntityNotFound(_0x27bbac,null))['then'](saveUpdates(_0x369128[_0x2967('0x4a')],null))[_0x2967('0x25')](respondWithResult(_0x27bbac,null))[_0x2967('0x47')](handleError(_0x27bbac,null));};exports[_0x2967('0x26')]=function(_0x2fcad1,_0x304f6f){return db['WhatsappApplication']['find']({'where':{'id':_0x2fcad1[_0x2967('0x49')]['id']}})[_0x2967('0x25')](handleEntityNotFound(_0x304f6f,null))['then'](removeEntity(_0x304f6f,null))['catch'](handleError(_0x304f6f,null));}; \ No newline at end of file +var _0x8a21=['attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x51940c,_0x5c821e){var _0x169b75=function(_0x57bfe9){while(--_0x57bfe9){_0x51940c['push'](_0x51940c['shift']());}};_0x169b75(++_0x5c821e);}(_0x8a21,0x1d8));var _0x18a2=function(_0x14bb2f,_0x3c8ed0){_0x14bb2f=_0x14bb2f-0x0;var _0x5e2041=_0x8a21[_0x14bb2f];return _0x5e2041;};'use strict';var emlformat=require(_0x18a2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x18a2('0x1'));var rp=require(_0x18a2('0x2'));var moment=require(_0x18a2('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x18a2('0x4'));var path=require(_0x18a2('0x5'));var sox=require(_0x18a2('0x6'));var csv=require(_0x18a2('0x7'));var ejs=require(_0x18a2('0x8'));var fs=require('fs');var fs_extra=require(_0x18a2('0x9'));var _=require(_0x18a2('0xa'));var squel=require(_0x18a2('0xb'));var crypto=require('crypto');var jsforce=require(_0x18a2('0xc'));var deskjs=require(_0x18a2('0xd'));var toCsv=require(_0x18a2('0x7'));var querystring=require('querystring');var Papa=require(_0x18a2('0xe'));var Redis=require(_0x18a2('0xf'));var authService=require(_0x18a2('0x10'));var qs=require(_0x18a2('0x11'));var as=require(_0x18a2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x18a2('0x13'))(_0x18a2('0x14'));var utils=require('../../config/utils');var config=require(_0x18a2('0x15'));var licenseUtil=require(_0x18a2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30ee0b,_0x27e3af){_0x27e3af=_0x27e3af||0xcc;return function(_0x538947){if(_0x538947){return _0x30ee0b[_0x18a2('0x17')](_0x27e3af);}return _0x30ee0b[_0x18a2('0x18')](_0x27e3af)[_0x18a2('0x19')]();};}function respondWithResult(_0x2d03c0,_0x589277){_0x589277=_0x589277||0xc8;return function(_0x494cf1){if(_0x494cf1){return _0x2d03c0[_0x18a2('0x18')](_0x589277)['json'](_0x494cf1);}};}function respondWithFilteredResult(_0x29e733,_0x4e7f30){return function(_0x358572){if(_0x358572){var _0x3037c6=typeof _0x4e7f30[_0x18a2('0x1a')]==='undefined'&&typeof _0x4e7f30[_0x18a2('0x1b')]===_0x18a2('0x1c');var _0x13a23c=_0x358572[_0x18a2('0x1d')];var _0x22296a=_0x3037c6?0x0:_0x4e7f30['offset'];var _0x26929f=_0x3037c6?_0x358572['count']:_0x4e7f30[_0x18a2('0x1a')]+_0x4e7f30['limit'];var _0x1bb83f;if(_0x26929f>=_0x13a23c){_0x26929f=_0x13a23c;_0x1bb83f=0xc8;}else{_0x1bb83f=0xce;}_0x29e733[_0x18a2('0x18')](_0x1bb83f);return _0x29e733[_0x18a2('0x1e')](_0x18a2('0x1f'),_0x22296a+'-'+_0x26929f+'/'+_0x13a23c)[_0x18a2('0x20')](_0x358572);}return null;};}function patchUpdates(_0x227fd0){return function(_0x19a326){try{jsonpatch[_0x18a2('0x21')](_0x19a326,_0x227fd0,!![]);}catch(_0x5f3252){return BPromise[_0x18a2('0x22')](_0x5f3252);}return _0x19a326[_0x18a2('0x23')]();};}function saveUpdates(_0x3a063a,_0x5c5164){return function(_0x1ed01f){if(_0x1ed01f){return _0x1ed01f[_0x18a2('0x24')](_0x3a063a)[_0x18a2('0x25')](function(_0x3b741c){return _0x3b741c;});}return null;};}function removeEntity(_0x3fdf6c,_0x591a4c){return function(_0x5340cc){if(_0x5340cc){return _0x5340cc['destroy']()[_0x18a2('0x25')](function(){_0x3fdf6c[_0x18a2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32f573,_0x3be4db){return function(_0x531eb3){if(!_0x531eb3){_0x32f573[_0x18a2('0x17')](0x194);}return _0x531eb3;};}function handleError(_0x327d81,_0x3cecc){_0x3cecc=_0x3cecc||0x1f4;return function(_0x3689b6){logger[_0x18a2('0x26')](_0x3689b6[_0x18a2('0x27')]);if(_0x3689b6[_0x18a2('0x28')]){delete _0x3689b6[_0x18a2('0x28')];}_0x327d81[_0x18a2('0x18')](_0x3cecc)[_0x18a2('0x29')](_0x3689b6);};}exports[_0x18a2('0x2a')]=function(_0x562df1,_0x43a4f8){var _0x2df574={},_0x490410={},_0x266810={'count':0x0,'rows':[]};var _0x49f50f=_[_0x18a2('0x2b')](db[_0x18a2('0x2c')][_0x18a2('0x2d')],function(_0x56b765){return{'name':_0x56b765[_0x18a2('0x2e')],'type':_0x56b765[_0x18a2('0x2f')][_0x18a2('0x30')]};});_0x490410[_0x18a2('0x31')]=_[_0x18a2('0x2b')](_0x49f50f,'name');_0x490410[_0x18a2('0x32')]=_[_0x18a2('0x33')](_0x562df1[_0x18a2('0x32')]);_0x490410[_0x18a2('0x34')]=_['intersection'](_0x490410[_0x18a2('0x31')],_0x490410[_0x18a2('0x32')]);_0x2df574[_0x18a2('0x35')]=_[_0x18a2('0x36')](_0x490410['model'],qs[_0x18a2('0x37')](_0x562df1[_0x18a2('0x32')][_0x18a2('0x37')]));_0x2df574[_0x18a2('0x35')]=_0x2df574[_0x18a2('0x35')][_0x18a2('0x38')]?_0x2df574['attributes']:_0x490410[_0x18a2('0x31')];if(!_0x562df1[_0x18a2('0x32')][_0x18a2('0x39')](_0x18a2('0x3a'))){_0x2df574[_0x18a2('0x1b')]=qs['limit'](_0x562df1[_0x18a2('0x32')]['limit']);_0x2df574[_0x18a2('0x1a')]=qs[_0x18a2('0x1a')](_0x562df1[_0x18a2('0x32')][_0x18a2('0x1a')]);}_0x2df574['order']=qs[_0x18a2('0x3b')](_0x562df1[_0x18a2('0x32')]['sort']);_0x2df574[_0x18a2('0x3c')]=qs[_0x18a2('0x34')](_[_0x18a2('0x3d')](_0x562df1[_0x18a2('0x32')],_0x490410[_0x18a2('0x34')]),_0x49f50f);if(_0x562df1['query'][_0x18a2('0x3e')]){_0x2df574[_0x18a2('0x3c')]=_[_0x18a2('0x3f')](_0x2df574[_0x18a2('0x3c')],{'$or':_['map'](_0x49f50f,function(_0x55068a){if(_0x55068a[_0x18a2('0x2f')]!=='VIRTUAL'){var _0x345927={};_0x345927[_0x55068a[_0x18a2('0x28')]]={'$like':'%'+_0x562df1[_0x18a2('0x32')][_0x18a2('0x3e')]+'%'};return _0x345927;}})});}_0x2df574=_[_0x18a2('0x3f')]({},_0x2df574,_0x562df1[_0x18a2('0x40')]);var _0x1124db={'where':_0x2df574['where']};return db[_0x18a2('0x2c')][_0x18a2('0x1d')](_0x1124db)['then'](function(_0x1a8461){_0x266810[_0x18a2('0x1d')]=_0x1a8461;if(_0x562df1['query'][_0x18a2('0x41')]){_0x2df574[_0x18a2('0x42')]=[{'all':!![]}];}return db[_0x18a2('0x2c')][_0x18a2('0x43')](_0x2df574);})['then'](function(_0xa2953){_0x266810['rows']=_0xa2953;return _0x266810;})[_0x18a2('0x25')](respondWithFilteredResult(_0x43a4f8,_0x2df574))[_0x18a2('0x44')](handleError(_0x43a4f8,null));};exports[_0x18a2('0x45')]=function(_0x75e839,_0x3d69b7){var _0x13a032={'raw':!![],'where':{'id':_0x75e839[_0x18a2('0x46')]['id']}},_0x19d8dd={};_0x19d8dd[_0x18a2('0x31')]=_[_0x18a2('0x33')](db[_0x18a2('0x2c')]['rawAttributes']);_0x19d8dd['query']=_[_0x18a2('0x33')](_0x75e839[_0x18a2('0x32')]);_0x19d8dd[_0x18a2('0x34')]=_['intersection'](_0x19d8dd[_0x18a2('0x31')],_0x19d8dd[_0x18a2('0x32')]);_0x13a032[_0x18a2('0x35')]=_[_0x18a2('0x36')](_0x19d8dd[_0x18a2('0x31')],qs[_0x18a2('0x37')](_0x75e839[_0x18a2('0x32')][_0x18a2('0x37')]));_0x13a032[_0x18a2('0x35')]=_0x13a032[_0x18a2('0x35')][_0x18a2('0x38')]?_0x13a032[_0x18a2('0x35')]:_0x19d8dd[_0x18a2('0x31')];if(_0x75e839[_0x18a2('0x32')][_0x18a2('0x41')]){_0x13a032[_0x18a2('0x42')]=[{'all':!![]}];}_0x13a032=_[_0x18a2('0x3f')]({},_0x13a032,_0x75e839[_0x18a2('0x40')]);return db[_0x18a2('0x2c')][_0x18a2('0x47')](_0x13a032)[_0x18a2('0x25')](handleEntityNotFound(_0x3d69b7,null))['then'](respondWithResult(_0x3d69b7,null))['catch'](handleError(_0x3d69b7,null));};exports[_0x18a2('0x48')]=function(_0x57eca3,_0x592add){return db[_0x18a2('0x2c')][_0x18a2('0x48')](_0x57eca3[_0x18a2('0x49')],{})['then'](respondWithResult(_0x592add,0xc9))[_0x18a2('0x44')](handleError(_0x592add,null));};exports[_0x18a2('0x24')]=function(_0xd77e34,_0x5e9cbe){if(_0xd77e34[_0x18a2('0x49')]['id']){delete _0xd77e34['body']['id'];}return db[_0x18a2('0x2c')][_0x18a2('0x47')]({'where':{'id':_0xd77e34[_0x18a2('0x46')]['id']}})[_0x18a2('0x25')](handleEntityNotFound(_0x5e9cbe,null))[_0x18a2('0x25')](saveUpdates(_0xd77e34[_0x18a2('0x49')],null))[_0x18a2('0x25')](respondWithResult(_0x5e9cbe,null))[_0x18a2('0x44')](handleError(_0x5e9cbe,null));};exports[_0x18a2('0x4a')]=function(_0x267a41,_0x514a74){return db[_0x18a2('0x2c')][_0x18a2('0x47')]({'where':{'id':_0x267a41['params']['id']}})[_0x18a2('0x25')](handleEntityNotFound(_0x514a74,null))[_0x18a2('0x25')](removeEntity(_0x514a74,null))[_0x18a2('0x44')](handleError(_0x514a74,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 0fba920..b37e9d1 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 _0x9de3=['lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4'];(function(_0x8889c3,_0x1e3212){var _0x427dd2=function(_0x41523f){while(--_0x41523f){_0x8889c3['push'](_0x8889c3['shift']());}};_0x427dd2(++_0x1e3212);}(_0x9de3,0xea));var _0x39de=function(_0x43889e,_0x33e474){_0x43889e=_0x43889e-0x0;var _0x2b3e8f=_0x9de3[_0x43889e];return _0x2b3e8f;};'use strict';var _=require(_0x39de('0x0'));var util=require('util');var logger=require(_0x39de('0x1'))(_0x39de('0x2'));var moment=require(_0x39de('0x3'));var BPromise=require('bluebird');var rp=require(_0x39de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39de('0x5'));var config=require(_0x39de('0x6'));var attributes=require(_0x39de('0x7'));module[_0x39de('0x8')]=function(_0x529524,_0x2e8f82){return _0x529524[_0x39de('0x9')](_0x39de('0xa'),attributes,{'tableName':_0x39de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x39de('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x448b=['rimraf','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x44e7b9,_0x1a5db4){var _0x21fdd=function(_0x4cbb3c){while(--_0x4cbb3c){_0x44e7b9['push'](_0x44e7b9['shift']());}};_0x21fdd(++_0x1a5db4);}(_0x448b,0x125));var _0xb448=function(_0x4302af,_0x27ac98){_0x4302af=_0x4302af-0x0;var _0x3249c7=_0x448b[_0x4302af];return _0x3249c7;};'use strict';var _=require(_0xb448('0x0'));var util=require(_0xb448('0x1'));var logger=require(_0xb448('0x2'))(_0xb448('0x3'));var moment=require(_0xb448('0x4'));var BPromise=require(_0xb448('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb448('0x6'));var rimraf=require(_0xb448('0x7'));var config=require(_0xb448('0x8'));var attributes=require(_0xb448('0x9'));module[_0xb448('0xa')]=function(_0x276466,_0x3670cb){return _0x276466['define'](_0xb448('0xb'),attributes,{'tableName':_0xb448('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb448('0xd'),'collate':_0xb448('0xe')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 3f58925..77e1307 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 _0xeec6=['then','info','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x1ba43c,_0x5bd2e8){var _0x2f60eb=function(_0x349dff){while(--_0x349dff){_0x1ba43c['push'](_0x1ba43c['shift']());}};_0x2f60eb(++_0x5bd2e8);}(_0xeec6,0x1c2));var _0x6eec=function(_0xe5b349,_0x5f06e4){_0xe5b349=_0xe5b349-0x0;var _0x26b0ad=_0xeec6[_0xe5b349];return _0x26b0ad;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48064a,_0x5a5e47,_0x1c810e){return new BPromise(function(_0x3443c2,_0x834c2){return client['request'](_0x48064a,_0x1c810e)[_0x6eec('0xc')](function(_0x3aca38){logger[_0x6eec('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x5a5e47,'request\x20sent');logger['debug'](_0x6eec('0xe'),_0x5a5e47,_0x6eec('0xf'),JSON['stringify'](_0x3aca38));if(_0x3aca38['error']){if(_0x3aca38[_0x6eec('0x10')]['code']===0x1f4){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x834c2(_0x3aca38[_0x6eec('0x10')]['message']);}logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x3443c2(_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);}else{logger[_0x6eec('0xd')](_0x6eec('0x11'),_0x5a5e47,_0x6eec('0xf'));_0x3443c2(_0x3aca38[_0x6eec('0x13')]['message']);}})[_0x6eec('0x14')](function(_0x5f1f33){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x5f1f33);_0x834c2(_0x5f1f33);});});} \ No newline at end of file +var _0x9a19=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x36e059,_0x19ee27){var _0x52ee13=function(_0x3dbfb1){while(--_0x3dbfb1){_0x36e059['push'](_0x36e059['shift']());}};_0x52ee13(++_0x19ee27);}(_0x9a19,0x114));var _0x99a1=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x9a19[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var moment=require(_0x99a1('0x2'));var BPromise=require('bluebird');var rs=require(_0x99a1('0x3'));var fs=require('fs');var Redis=require(_0x99a1('0x4'));var db=require(_0x99a1('0x5'))['db'];var utils=require(_0x99a1('0x6'));var logger=require(_0x99a1('0x7'))(_0x99a1('0x8'));var config=require(_0x99a1('0x9'));var jayson=require(_0x99a1('0xa'));var client=jayson[_0x99a1('0xb')][_0x99a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x65045d,_0x523b9e,_0x4d2a5c){return new BPromise(function(_0x5aa6c2,_0x56f50){return client[_0x99a1('0xd')](_0x65045d,_0x4d2a5c)['then'](function(_0x5874fc){logger[_0x99a1('0xe')](_0x99a1('0xf'),_0x523b9e,_0x99a1('0x10'));logger[_0x99a1('0x11')](_0x99a1('0x12'),_0x523b9e,'request\x20sent',JSON[_0x99a1('0x13')](_0x5874fc));if(_0x5874fc[_0x99a1('0x14')]){if(_0x5874fc[_0x99a1('0x14')][_0x99a1('0x15')]===0x1f4){logger[_0x99a1('0x14')](_0x99a1('0xf'),_0x523b9e,_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);return _0x56f50(_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);}logger[_0x99a1('0x14')](_0x99a1('0xf'),_0x523b9e,_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);return _0x5aa6c2(_0x5874fc[_0x99a1('0x14')]['message']);}else{logger[_0x99a1('0xe')](_0x99a1('0xf'),_0x523b9e,_0x99a1('0x10'));_0x5aa6c2(_0x5874fc[_0x99a1('0x17')][_0x99a1('0x16')]);}})[_0x99a1('0x18')](function(_0x1ca878){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x523b9e,_0x1ca878);_0x56f50(_0x1ca878);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index ab0b5e1..809c86f 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 _0x236d=['../../components/interaction/service','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x1dccd5,_0x549202){var _0x20933c=function(_0x2d562e){while(--_0x2d562e){_0x1dccd5['push'](_0x1dccd5['shift']());}};_0x20933c(++_0x549202);}(_0x236d,0x7e));var _0xd236=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x236d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd236('0x0'));var util=require(_0xd236('0x1'));var path=require('path');var timeout=require(_0xd236('0x2'));var express=require('express');var router=express[_0xd236('0x3')]();var fs_extra=require(_0xd236('0x4'));var auth=require(_0xd236('0x5'));var interaction=require(_0xd236('0x6'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0xd236('0x7')]('/',auth[_0xd236('0x8')](),controller[_0xd236('0x9')]);router[_0xd236('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xd236('0xa')]);router[_0xd236('0x7')]('/:id',auth[_0xd236('0x8')](),controller[_0xd236('0xb')]);router['get'](_0xd236('0xc'),auth[_0xd236('0x8')](),controller[_0xd236('0xd')]);router['get'](_0xd236('0xe'),auth[_0xd236('0x8')](),controller[_0xd236('0xf')]);router['post']('/',auth[_0xd236('0x8')](),controller[_0xd236('0x10')]);router[_0xd236('0x11')](_0xd236('0xc'),auth[_0xd236('0x8')](),controller[_0xd236('0x12')]);router[_0xd236('0x11')](_0xd236('0x13'),auth[_0xd236('0x8')](),interaction[_0xd236('0x14')](_0xd236('0x15'),_0xd236('0x16')),controller[_0xd236('0x17')]);router[_0xd236('0x18')](_0xd236('0x19'),auth[_0xd236('0x8')](),interaction[_0xd236('0x14')](_0xd236('0x15'),_0xd236('0x1a')),controller[_0xd236('0x1b')]);router['delete']('/:id',auth[_0xd236('0x8')](),interaction[_0xd236('0x14')]('whatsapp',_0xd236('0x1c')),controller[_0xd236('0x1d')]);router[_0xd236('0x1e')]('/:id/tags',auth[_0xd236('0x8')](),controller[_0xd236('0x1f')]);module[_0xd236('0x20')]=router; \ No newline at end of file +var _0x1115=['get','show','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe'];(function(_0x51b72e,_0x408f4f){var _0xa108e1=function(_0x3d879c){while(--_0x3d879c){_0x51b72e['push'](_0x51b72e['shift']());}};_0xa108e1(++_0x408f4f);}(_0x1115,0x1b6));var _0x5111=function(_0x1e9bfc,_0x6a4719){_0x1e9bfc=_0x1e9bfc-0x0;var _0xaed314=_0x1115[_0x1e9bfc];return _0xaed314;};'use strict';var multer=require('multer');var util=require(_0x5111('0x0'));var path=require(_0x5111('0x1'));var timeout=require(_0x5111('0x2'));var express=require(_0x5111('0x3'));var router=express[_0x5111('0x4')]();var fs_extra=require(_0x5111('0x5'));var auth=require(_0x5111('0x6'));var interaction=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0x5111('0x9')](),controller[_0x5111('0xa')]);router['get'](_0x5111('0xb'),auth[_0x5111('0x9')](),controller['describe']);router[_0x5111('0xc')]('/:id',auth[_0x5111('0x9')](),controller[_0x5111('0xd')]);router['get']('/:id/messages',auth[_0x5111('0x9')](),controller['getMessages']);router[_0x5111('0xc')]('/:id/download',auth[_0x5111('0x9')](),controller[_0x5111('0xe')]);router[_0x5111('0xf')]('/',auth[_0x5111('0x9')](),controller[_0x5111('0x10')]);router[_0x5111('0xf')](_0x5111('0x11'),auth[_0x5111('0x9')](),controller[_0x5111('0x12')]);router[_0x5111('0xf')](_0x5111('0x13'),auth[_0x5111('0x9')](),interaction[_0x5111('0x14')](_0x5111('0x15'),_0x5111('0x16')),controller[_0x5111('0x17')]);router[_0x5111('0x18')](_0x5111('0x19'),auth['isAuthenticated'](),interaction[_0x5111('0x14')]('whatsapp','whatsappinteraction:update'),controller[_0x5111('0x1a')]);router[_0x5111('0x1b')](_0x5111('0x19'),auth['isAuthenticated'](),interaction[_0x5111('0x14')](_0x5111('0x15'),'whatsappinteraction:destroy'),controller[_0x5111('0x1c')]);router[_0x5111('0x1b')](_0x5111('0x13'),auth[_0x5111('0x9')](),controller['removeTags']);module[_0x5111('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 31e1f7f..f270ab5 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 _0x556a=['sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM','out','INTEGER'];(function(_0x52a197,_0x44116b){var _0x19fb20=function(_0x41680c){while(--_0x41680c){_0x52a197['push'](_0x52a197['shift']());}};_0x19fb20(++_0x44116b);}(_0x556a,0x1dd));var _0xa556=function(_0x2ff476,_0x45252a){_0x2ff476=_0x2ff476-0x0;var _0x3b6ae2=_0x556a[_0x2ff476];return _0x3b6ae2;};'use strict';var Sequelize=require(_0xa556('0x0'));var moment=require(_0xa556('0x1'));module[_0xa556('0x2')]={'closed':{'type':Sequelize[_0xa556('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa556('0x4')]},'disposition':{'type':Sequelize[_0xa556('0x5')]},'secondDisposition':{'type':Sequelize[_0xa556('0x5')]},'thirdDisposition':{'type':Sequelize[_0xa556('0x5')]},'note':{'type':Sequelize[_0xa556('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xa556('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xa556('0x6')]('in',_0xa556('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa556('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xa556('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa556('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xa556('0x8')]}}; \ No newline at end of file +var _0xa2cb=['moment','BOOLEAN','DATE','STRING','out','INTEGER','sequelize'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0xa2cb,0x7d));var _0xba2c=function(_0x2193cc,_0x1f9e4b){_0x2193cc=_0x2193cc-0x0;var _0x143fa4=_0xa2cb[_0x2193cc];return _0x143fa4;};'use strict';var Sequelize=require(_0xba2c('0x0'));var moment=require(_0xba2c('0x1'));module['exports']={'closed':{'type':Sequelize[_0xba2c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xba2c('0x3')]},'disposition':{'type':Sequelize[_0xba2c('0x4')]},'secondDisposition':{'type':Sequelize[_0xba2c('0x4')]},'thirdDisposition':{'type':Sequelize[_0xba2c('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xba2c('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xba2c('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xba2c('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 7bdc4d7..8e561e3 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 _0xc936=['model','attributes','fields','length','includeAll','include','merge','find','catch','create','update','body','describe','addMessage','WhatsappMessage','omit','getMessages','findOne','hasOwnProperty','nolimit','offset','order','sort','where','pick','WhatsappInteractionId','filter','map','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','ids','spread','color','whatsappInteractionTags:save','removeTags','unix','root','files','tmp','join','server','attachments','push','User','fullname','CmContact','Contact','firstName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','get','Whatsapp','Owner','N.A.','toString','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','lastName','value','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','log','unlinkSync','zip-dir','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','json','undefined','count','limit','status','Content-Range','then','destroy','name','send','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','query','user','params','keys','filters','intersection'];(function(_0x173f76,_0x20f763){var _0x47d210=function(_0x402f64){while(--_0x402f64){_0x173f76['push'](_0x173f76['shift']());}};_0x47d210(++_0x20f763);}(_0xc936,0x153));var _0x6c93=function(_0x1cb98e,_0x382787){_0x1cb98e=_0x1cb98e-0x0;var _0x4b4e40=_0xc936[_0x1cb98e];return _0x4b4e40;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x6c93('0x0'));var moment=require('moment');var BPromise=require(_0x6c93('0x1'));var util=require(_0x6c93('0x2'));var path=require(_0x6c93('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6c93('0x4'));var Redis=require(_0x6c93('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0x6c93('0x6'));var pdf=require(_0x6c93('0x7'));var logger=require('../../config/logger')('api');var config=require(_0x6c93('0x8'));var db=require(_0x6c93('0x9'))['db'];config[_0x6c93('0xa')]=_[_0x6c93('0xb')](config[_0x6c93('0xa')],{'host':_0x6c93('0xc'),'port':0x18eb});var socket=require(_0x6c93('0xd'))(new Redis(config['redis']));require(_0x6c93('0xe'))[_0x6c93('0xf')](socket);function respondWithStatusCode(_0x584e30,_0x52acbc){_0x52acbc=_0x52acbc||0xcc;return function(_0x19493b){if(_0x19493b){return _0x584e30[_0x6c93('0x10')](_0x52acbc);}return _0x584e30['status'](_0x52acbc)[_0x6c93('0x11')]();};}function respondWithResult(_0x43ce60,_0x43dcc4){_0x43dcc4=_0x43dcc4||0xc8;return function(_0x4a475f){if(_0x4a475f){return _0x43ce60['status'](_0x43dcc4)[_0x6c93('0x12')](_0x4a475f);}};}function respondWithFilteredResult(_0x9dd8ae,_0x3ca3bd){return function(_0x51ad94){if(_0x51ad94){var _0x1e010b=typeof _0x3ca3bd['offset']===_0x6c93('0x13')&&typeof _0x3ca3bd['limit']===_0x6c93('0x13');var _0x2b5152=_0x51ad94[_0x6c93('0x14')];var _0xff5b19=_0x1e010b?0x0:_0x3ca3bd['offset'];var _0x539a18=_0x1e010b?_0x51ad94[_0x6c93('0x14')]:_0x3ca3bd['offset']+_0x3ca3bd[_0x6c93('0x15')];var _0x33f020;if(_0x539a18>=_0x2b5152){_0x539a18=_0x2b5152;_0x33f020=0xc8;}else{_0x33f020=0xce;}_0x9dd8ae[_0x6c93('0x16')](_0x33f020);return _0x9dd8ae['set'](_0x6c93('0x17'),_0xff5b19+'-'+_0x539a18+'/'+_0x2b5152)[_0x6c93('0x12')](_0x51ad94);}return null;};}function saveUpdates(_0x3e58cb){return function(_0x5bcbbe){if(_0x5bcbbe){return _0x5bcbbe['update'](_0x3e58cb)[_0x6c93('0x18')](function(_0x3017c5){return _0x3017c5;});}return null;};}function removeEntity(_0x3384f4){return function(_0x43471a){if(_0x43471a){return _0x43471a[_0x6c93('0x19')]()[_0x6c93('0x18')](function(){_0x3384f4[_0x6c93('0x16')](0xcc)[_0x6c93('0x11')]();});}};}function handleEntityNotFound(_0x7be340){return function(_0x36755c){if(!_0x36755c){_0x7be340[_0x6c93('0x10')](0x194);}return _0x36755c;};}function handleError(_0xd3d046,_0x5beab3){_0x5beab3=_0x5beab3||0x1f4;return function(_0x2423e4){logger['error'](_0x2423e4['stack']);if(_0x2423e4[_0x6c93('0x1a')]){delete _0x2423e4[_0x6c93('0x1a')];}_0xd3d046['status'](_0x5beab3)[_0x6c93('0x1b')](_0x2423e4);};}exports['index']=function(_0x3d8186,_0x187d7d){var _0x3728a5={};var _0x1e56a6=_['map'](db[_0x6c93('0x1c')][_0x6c93('0x1d')],function(_0x593d7a){return{'name':_0x593d7a[_0x6c93('0x1e')],'type':_0x593d7a[_0x6c93('0x1f')][_0x6c93('0x20')]};});_0x3728a5=qs[_0x6c93('0x21')](_0x1e56a6,_0x3d8186);return interaction[_0x6c93('0x22')](_0x6c93('0x23'),_0x3d8186[_0x6c93('0x24')],_0x3d8186[_0x6c93('0x25')],_0x3728a5,_0x1e56a6)[_0x6c93('0x18')](respondWithFilteredResult(_0x187d7d,_0x3728a5))['catch'](handleError(_0x187d7d,null));};exports['show']=function(_0x8ff998,_0x39bff0){var _0x3450e0={'raw':![],'where':{'id':_0x8ff998[_0x6c93('0x26')]['id']}},_0x6663b2={};_0x6663b2['model']=_[_0x6c93('0x27')](db[_0x6c93('0x1c')]['rawAttributes']);_0x6663b2['query']=_['keys'](_0x8ff998['query']);_0x6663b2[_0x6c93('0x28')]=_[_0x6c93('0x29')](_0x6663b2[_0x6c93('0x2a')],_0x6663b2[_0x6c93('0x24')]);_0x3450e0[_0x6c93('0x2b')]=_[_0x6c93('0x29')](_0x6663b2[_0x6c93('0x2a')],qs['fields'](_0x8ff998[_0x6c93('0x24')][_0x6c93('0x2c')]));_0x3450e0['attributes']=_0x3450e0[_0x6c93('0x2b')][_0x6c93('0x2d')]?_0x3450e0[_0x6c93('0x2b')]:_0x6663b2[_0x6c93('0x2a')];if(_0x8ff998['query'][_0x6c93('0x2e')]){_0x3450e0[_0x6c93('0x2f')]=[{'all':!![]}];}_0x3450e0=_[_0x6c93('0x30')]({},_0x3450e0,_0x8ff998['options']);return db[_0x6c93('0x1c')][_0x6c93('0x31')](_0x3450e0)[_0x6c93('0x18')](handleEntityNotFound(_0x39bff0,null))['then'](respondWithResult(_0x39bff0,null))[_0x6c93('0x32')](handleError(_0x39bff0,null));};exports[_0x6c93('0x33')]=function(_0x3702b2,_0x274d4e){return db['WhatsappInteraction'][_0x6c93('0x33')](_0x3702b2['body'],{})[_0x6c93('0x18')](respondWithResult(_0x274d4e,0xc9))['catch'](handleError(_0x274d4e,null));};exports[_0x6c93('0x34')]=function(_0x2ae209,_0x2986b0){if(_0x2ae209['body']['id']){delete _0x2ae209[_0x6c93('0x35')]['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x2ae209[_0x6c93('0x26')]['id']}})[_0x6c93('0x18')](handleEntityNotFound(_0x2986b0,null))[_0x6c93('0x18')](saveUpdates(_0x2ae209[_0x6c93('0x35')],null))[_0x6c93('0x18')](respondWithResult(_0x2986b0,null))['catch'](handleError(_0x2986b0,null));};exports[_0x6c93('0x19')]=function(_0x334a74,_0x2cd6c0){return db['WhatsappInteraction'][_0x6c93('0x31')]({'where':{'id':_0x334a74[_0x6c93('0x26')]['id']}})['then'](handleEntityNotFound(_0x2cd6c0,null))[_0x6c93('0x18')](removeEntity(_0x2cd6c0,null))[_0x6c93('0x32')](handleError(_0x2cd6c0,null));};exports[_0x6c93('0x36')]=function(_0x289dba,_0x511ef5){return db[_0x6c93('0x1c')][_0x6c93('0x36')]()['then'](respondWithResult(_0x511ef5,null))[_0x6c93('0x32')](handleError(_0x511ef5,null));};exports[_0x6c93('0x37')]=function(_0xf94e42,_0x428f37){return db[_0x6c93('0x38')][_0x6c93('0x31')]({'where':{'id':_0xf94e42[_0x6c93('0x26')]['id']}})[_0x6c93('0x18')](handleEntityNotFound(_0x428f37,null))[_0x6c93('0x18')](function(_0x4ff126){if(_0x4ff126){return _0x4ff126[_0x6c93('0x37')](_0xf94e42[_0x6c93('0x35')]['ids'],_[_0x6c93('0x39')](_0xf94e42[_0x6c93('0x35')],['ids','id'])||{});}})[_0x6c93('0x18')](respondWithResult(_0x428f37,null))[_0x6c93('0x32')](handleError(_0x428f37,null));};exports[_0x6c93('0x3a')]=function(_0x16c6e0,_0x52afb8){var _0x597dd8={'raw':![],'where':{}};var _0x4aa266={};var _0x48f6cd={'count':0x0,'rows':[]};return db[_0x6c93('0x1c')][_0x6c93('0x3b')]({'where':{'id':_0x16c6e0[_0x6c93('0x26')]['id']}})[_0x6c93('0x18')](handleEntityNotFound(_0x52afb8,null))[_0x6c93('0x18')](function(_0x2ad2eb){if(_0x2ad2eb){_0x4aa266[_0x6c93('0x2a')]=_[_0x6c93('0x27')](db['WhatsappMessage'][_0x6c93('0x1d')]);_0x4aa266[_0x6c93('0x24')]=_[_0x6c93('0x27')](_0x16c6e0[_0x6c93('0x24')]);_0x4aa266[_0x6c93('0x28')]=_['intersection'](_0x4aa266[_0x6c93('0x2a')],_0x4aa266[_0x6c93('0x24')]);_0x597dd8[_0x6c93('0x2b')]=_['intersection'](_0x4aa266['model'],qs[_0x6c93('0x2c')](_0x16c6e0['query']['fields']));_0x597dd8[_0x6c93('0x2b')]=_0x597dd8[_0x6c93('0x2b')][_0x6c93('0x2d')]?_0x597dd8[_0x6c93('0x2b')]:_0x4aa266['model'];if(!_0x16c6e0[_0x6c93('0x24')][_0x6c93('0x3c')](_0x6c93('0x3d'))){_0x597dd8[_0x6c93('0x15')]=qs[_0x6c93('0x15')](_0x16c6e0['query']['limit']);_0x597dd8['offset']=qs[_0x6c93('0x3e')](_0x16c6e0[_0x6c93('0x24')][_0x6c93('0x3e')]);}_0x597dd8[_0x6c93('0x3f')]=qs[_0x6c93('0x40')](_0x16c6e0[_0x6c93('0x24')]['sort']);_0x597dd8[_0x6c93('0x41')]=qs['filters'](_[_0x6c93('0x42')](_0x16c6e0['query'],_0x4aa266[_0x6c93('0x28')]));_0x597dd8[_0x6c93('0x41')][_0x6c93('0x43')]=_0x2ad2eb['id'];if(_0x16c6e0[_0x6c93('0x24')][_0x6c93('0x44')]){_0x597dd8[_0x6c93('0x41')]=_[_0x6c93('0x30')](_0x597dd8[_0x6c93('0x41')],{'$or':_[_0x6c93('0x45')](_0x597dd8['attributes'],function(_0x281129){var _0x241186={};_0x241186[_0x281129]={'$like':'%'+_0x16c6e0[_0x6c93('0x24')]['filter']+'%'};return _0x241186;})});}if(_0x16c6e0[_0x6c93('0x24')]['$gte']){var _0x18877b=_0x16c6e0[_0x6c93('0x24')]['$gte'][_0x6c93('0x46')](',');var _0xe746b={};_0xe746b[_0x18877b[0x0]]={'$gte':moment(_0x18877b[0x1])[_0x6c93('0x47')](_0x6c93('0x48'))};_0x597dd8[_0x6c93('0x41')]=_[_0x6c93('0x30')](_0x597dd8[_0x6c93('0x41')],_0xe746b);}_0x597dd8=_['merge']({},_0x597dd8,_0x16c6e0[_0x6c93('0x49')]);return db['WhatsappMessage'][_0x6c93('0x14')]({'where':_0x597dd8['where']})[_0x6c93('0x18')](function(_0x26fec9){_0x48f6cd[_0x6c93('0x14')]=_0x26fec9;if(_0x16c6e0[_0x6c93('0x24')][_0x6c93('0x2e')]){_0x597dd8['include']=[{'all':!![]}];}return db[_0x6c93('0x38')][_0x6c93('0x22')](_0x597dd8);})[_0x6c93('0x18')](function(_0xc4552a){_0x48f6cd[_0x6c93('0x4a')]=_0xc4552a;return _0x48f6cd;});}})['then'](respondWithFilteredResult(_0x52afb8,_0x597dd8))[_0x6c93('0x32')](handleError(_0x52afb8,null));};exports[_0x6c93('0x4b')]=function(_0x116aac,_0x1fa9e9){return db[_0x6c93('0x1c')][_0x6c93('0x31')]({'where':{'id':_0x116aac['params']['id']}})[_0x6c93('0x18')](handleEntityNotFound(_0x1fa9e9,null))[_0x6c93('0x18')](function(_0x37f572){if(_0x37f572){return _0x37f572[_0x6c93('0x4c')](_0x116aac[_0x6c93('0x35')][_0x6c93('0x4d')],_[_0x6c93('0x39')](_0x116aac[_0x6c93('0x35')],[_0x6c93('0x4d'),'id'])||{})[_0x6c93('0x4e')](function(){return db['Tag'][_0x6c93('0x22')]({'attributes':['id',_0x6c93('0x1a'),_0x6c93('0x4f')],'where':{'id':_0x116aac['body'][_0x6c93('0x4d')]}});})['then'](function(_0x19c223){socket['emit'](_0x6c93('0x50'),{'id':Number(_0x116aac[_0x6c93('0x26')]['id']),'tags':_0x19c223||[]});return{'id':Number(_0x116aac[_0x6c93('0x26')]['id']),'tags':_0x19c223||[]};});}})['then'](respondWithResult(_0x1fa9e9,null))['catch'](handleError(_0x1fa9e9,null));};exports[_0x6c93('0x51')]=function(_0x59dcfd,_0x5f1bfc){return db['WhatsappInteraction'][_0x6c93('0x31')]({'where':{'id':_0x59dcfd['params']['id']}})[_0x6c93('0x18')](handleEntityNotFound(_0x5f1bfc,null))[_0x6c93('0x18')](function(_0x5a69f7){if(_0x5a69f7){return _0x5a69f7[_0x6c93('0x51')](_0x59dcfd[_0x6c93('0x24')][_0x6c93('0x4d')]);}})[_0x6c93('0x18')](respondWithStatusCode(_0x5f1bfc,null))[_0x6c93('0x32')](handleError(_0x5f1bfc,null));};exports['download']=function(_0x2bd76b,_0x5e2c3c){var _0x22d2d3=moment()[_0x6c93('0x52')]()['toString']();var _0x134460=path['join'](config[_0x6c93('0x53')],'server',_0x6c93('0x54'),_0x6c93('0x55'));var _0x230441=path[_0x6c93('0x56')](config[_0x6c93('0x53')],_0x6c93('0x57'),_0x6c93('0x54'),_0x6c93('0x58'));var _0x5a4221=path[_0x6c93('0x56')](_0x134460,_0x22d2d3);var _0x39ce7b=util['format']('transcript-%d-%s.zip',_0x2bd76b[_0x6c93('0x26')]['id'],_0x22d2d3);var _0x373476=path[_0x6c93('0x56')](_0x134460,_0x39ce7b);var _0x2ebb50=[];_0x2ebb50[_0x6c93('0x59')]({'model':db[_0x6c93('0x5a')],'as':_0x6c93('0x5a'),'attributes':['id',_0x6c93('0x5b')],'raw':!![]});_0x2ebb50[_0x6c93('0x59')]({'model':db[_0x6c93('0x5c')],'as':_0x6c93('0x5d'),'attributes':['id',_0x6c93('0x5e'),'lastName'],'raw':!![]});if(_0x2bd76b['query']['attachments']){_0x2ebb50[_0x6c93('0x59')]({'model':db[_0x6c93('0x5f')],'as':_0x6c93('0x5f'),'raw':!![]});}var _0x54f650=[{'model':db[_0x6c93('0x38')],'as':_0x6c93('0x60'),'attributes':['id',_0x6c93('0x35'),_0x6c93('0x61'),_0x6c93('0x62'),_0x6c93('0x63'),_0x6c93('0x64')],'include':_0x2ebb50}];_0x54f650['push']({'model':db[_0x6c93('0x65')],'as':_0x6c93('0x66'),'attributes':['id',_0x6c93('0x1a')]});_0x54f650[_0x6c93('0x59')]({'model':db[_0x6c93('0x5a')],'as':'Owner','attributes':['id',_0x6c93('0x5b')]});return db['WhatsappInteraction'][_0x6c93('0x31')]({'where':{'id':_0x2bd76b[_0x6c93('0x26')]['id']},'include':_0x54f650})['then'](handleEntityNotFound(_0x5e2c3c,null))['then'](function(_0x5bceaf){if(_0x5bceaf){var _0x63f83=_0x5bceaf[_0x6c93('0x67')]({'plain':!![]});fs['mkdirSync'](_0x5a4221);var _0x181545={'channel':_0x6c93('0x68'),'account':_0x63f83['Account'][_0x6c93('0x1a')],'agent':_0x63f83[_0x6c93('0x69')]?_0x63f83[_0x6c93('0x69')]['fullname']:_0x6c93('0x6a'),'createdAt':moment(_0x63f83[_0x6c93('0x61')])[_0x6c93('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6c93('0x6b')](),'closedAt':_0x63f83[_0x6c93('0x6c')]?moment(_0x63f83[_0x6c93('0x6d')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x6c93('0x6b')]():'','disposition':_0x63f83[_0x6c93('0x6e')],'messages':_(_0x63f83[_0x6c93('0x60')])[_0x6c93('0x44')]({'secret':![]})[_0x6c93('0x45')](function(_0x58961f){if(_0x58961f[_0x6c93('0x5f')]){var _0x5cede4=path[_0x6c93('0x56')](_0x230441,_0x58961f['Attachment'][_0x6c93('0x6f')]);if(fs[_0x6c93('0x70')](_0x5cede4)){fs[_0x6c93('0x71')](_0x5cede4)[_0x6c93('0x72')](fs[_0x6c93('0x73')](path['join'](_0x5a4221,_0x58961f[_0x6c93('0x5f')]['basename'])));}}return{'date':moment(_0x58961f[_0x6c93('0x61')])[_0x6c93('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6c93('0x6b')](),'sender':_0x58961f[_0x6c93('0x62')]===_0x6c93('0x74')?_0x58961f[_0x6c93('0x5a')]?_0x58961f[_0x6c93('0x5a')][_0x6c93('0x5b')]:_0x6c93('0x75'):_0x58961f[_0x6c93('0x5d')][_0x6c93('0x5e')]+(_0x58961f[_0x6c93('0x5d')][_0x6c93('0x76')]?'\x20'+_0x58961f[_0x6c93('0x5d')][_0x6c93('0x76')]:''),'body':_0x58961f[_0x6c93('0x5f')]?_0x58961f[_0x6c93('0x5f')]['basename']:_0x58961f[_0x6c93('0x35')],'direction':_0x58961f[_0x6c93('0x62')]===_0x6c93('0x74')?'A':'C','secret':_0x58961f[_0x6c93('0x63')],'read':_0x58961f[_0x6c93('0x64')],'attachment':_0x58961f[_0x6c93('0x5f')]};})[_0x6c93('0x77')]()};return ejs[_0x6c93('0x78')](path[_0x6c93('0x56')](config[_0x6c93('0x53')],_0x6c93('0x57'),'views',_0x6c93('0x79')),{'interaction':_0x181545})[_0x6c93('0x18')](function(_0x417948){var _0x6badca=path['join'](_0x5a4221,_0x6c93('0x7a')+_0x63f83['id']+'-'+_0x22d2d3+'.pdf');var _0x4f2428={'path':_0x6badca,'channel':'Whatsapp','interactionId':_0x63f83['id']};return pdf[_0x6c93('0x7b')](_0x417948,_0x4f2428);})['then'](function(){return new BPromise(function(_0x3df6d1,_0x80581){zipdir(_0x5a4221,{'saveTo':_0x373476},function(_0x3259a3,_0x45357f){if(_0x3259a3)return _0x80581(_0x3259a3);return _0x3df6d1(_0x45357f);});})['then'](function(){return new BPromise(function(_0x56935d,_0x2c07c6){rimraf(_0x5a4221,function(_0x3968e7){if(_0x3968e7)_0x2c07c6(_0x3968e7);return _0x56935d();});});})['then'](function(){return _0x5e2c3c[_0x6c93('0x7c')](_0x373476,_0x39ce7b,function(_0x306a8b){if(_0x306a8b){console[_0x6c93('0x7d')]('err',_0x306a8b);}else{fs[_0x6c93('0x7e')](_0x373476);}});});});}else{return _0x5e2c3c['sendStatus'](0xc8);}})['catch'](handleError(_0x5e2c3c,null));}; \ No newline at end of file +var _0x1280=['push','User','fullname','CmContact','firstName','lastName','Attachment','createdAt','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','Messages','basename','existsSync','createReadStream','pipe','out','System','Contact','root','transcript-','.pdf','Whatsapp','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','./whatsappInteraction.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','destroy','end','error','stack','name','send','index','map','WhatsappInteraction','type','findAll','query','keys','intersection','model','fields','length','attributes','include','merge','find','then','catch','create','body','update','params','describe','addMessage','ids','omit','WhatsappMessage','rawAttributes','nolimit','limit','order','sort','where','pick','WhatsappInteractionId','filter','$gte','format','includeAll','rows','addTags','setTags','spread','Tag','color','whatsappInteractionTags:save','removeTags','download','toString','server','tmp','join','files','attachments','transcript-%d-%s.zip'];(function(_0x51a023,_0x40ff38){var _0x1dfe91=function(_0x19c3ac){while(--_0x19c3ac){_0x51a023['push'](_0x51a023['shift']());}};_0x1dfe91(++_0x40ff38);}(_0x1280,0x98));var _0x0128=function(_0xc45596,_0x5c410e){_0xc45596=_0xc45596-0x0;var _0x425ffe=_0x1280[_0xc45596];return _0x425ffe;};'use strict';var rimraf=require(_0x0128('0x0'));var zipdir=require(_0x0128('0x1'));var moment=require(_0x0128('0x2'));var BPromise=require(_0x0128('0x3'));var util=require('util');var path=require(_0x0128('0x4'));var ejs=require(_0x0128('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x0128('0x6'));var interaction=require(_0x0128('0x7'));var qs=require(_0x0128('0x8'));var pdf=require(_0x0128('0x9'));var logger=require(_0x0128('0xa'))(_0x0128('0xb'));var config=require('../../config/environment');var db=require(_0x0128('0xc'))['db'];config[_0x0128('0xd')]=_['defaults'](config[_0x0128('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0128('0xd')]));require(_0x0128('0xe'))[_0x0128('0xf')](socket);function respondWithStatusCode(_0x478210,_0x56172e){_0x56172e=_0x56172e||0xcc;return function(_0x2efe19){if(_0x2efe19){return _0x478210[_0x0128('0x10')](_0x56172e);}return _0x478210[_0x0128('0x11')](_0x56172e)['end']();};}function respondWithResult(_0x5bade0,_0x437567){_0x437567=_0x437567||0xc8;return function(_0x3056dc){if(_0x3056dc){return _0x5bade0[_0x0128('0x11')](_0x437567)[_0x0128('0x12')](_0x3056dc);}};}function respondWithFilteredResult(_0x3c5f18,_0x3b8a00){return function(_0x4b79f3){if(_0x4b79f3){var _0x5b74b2=typeof _0x3b8a00[_0x0128('0x13')]===_0x0128('0x14')&&typeof _0x3b8a00['limit']===_0x0128('0x14');var _0x437211=_0x4b79f3['count'];var _0xf11806=_0x5b74b2?0x0:_0x3b8a00['offset'];var _0x9412f5=_0x5b74b2?_0x4b79f3[_0x0128('0x15')]:_0x3b8a00[_0x0128('0x13')]+_0x3b8a00['limit'];var _0x562338;if(_0x9412f5>=_0x437211){_0x9412f5=_0x437211;_0x562338=0xc8;}else{_0x562338=0xce;}_0x3c5f18[_0x0128('0x11')](_0x562338);return _0x3c5f18[_0x0128('0x16')](_0x0128('0x17'),_0xf11806+'-'+_0x9412f5+'/'+_0x437211)[_0x0128('0x12')](_0x4b79f3);}return null;};}function saveUpdates(_0x42ff6e){return function(_0x43504c){if(_0x43504c){return _0x43504c['update'](_0x42ff6e)['then'](function(_0x2461f4){return _0x2461f4;});}return null;};}function removeEntity(_0xf3b496){return function(_0x475b71){if(_0x475b71){return _0x475b71[_0x0128('0x18')]()['then'](function(){_0xf3b496[_0x0128('0x11')](0xcc)[_0x0128('0x19')]();});}};}function handleEntityNotFound(_0x5ecc67){return function(_0x565609){if(!_0x565609){_0x5ecc67[_0x0128('0x10')](0x194);}return _0x565609;};}function handleError(_0x4f3042,_0x5595d5){_0x5595d5=_0x5595d5||0x1f4;return function(_0x4fb203){logger[_0x0128('0x1a')](_0x4fb203[_0x0128('0x1b')]);if(_0x4fb203[_0x0128('0x1c')]){delete _0x4fb203['name'];}_0x4f3042['status'](_0x5595d5)[_0x0128('0x1d')](_0x4fb203);};}exports[_0x0128('0x1e')]=function(_0x489764,_0x55940e){var _0x164097={};var _0x3d4a0a=_[_0x0128('0x1f')](db[_0x0128('0x20')]['rawAttributes'],function(_0x21147e){return{'name':_0x21147e['fieldName'],'type':_0x21147e[_0x0128('0x21')]['key']};});_0x164097=qs['getOptions'](_0x3d4a0a,_0x489764);return interaction[_0x0128('0x22')]('whatsapp',_0x489764[_0x0128('0x23')],_0x489764['user'],_0x164097,_0x3d4a0a)['then'](respondWithFilteredResult(_0x55940e,_0x164097))['catch'](handleError(_0x55940e,null));};exports['show']=function(_0x2aa33e,_0x1a4284){var _0x7004d3={'raw':![],'where':{'id':_0x2aa33e['params']['id']}},_0x334d16={};_0x334d16['model']=_['keys'](db[_0x0128('0x20')]['rawAttributes']);_0x334d16[_0x0128('0x23')]=_[_0x0128('0x24')](_0x2aa33e[_0x0128('0x23')]);_0x334d16['filters']=_[_0x0128('0x25')](_0x334d16['model'],_0x334d16[_0x0128('0x23')]);_0x7004d3['attributes']=_[_0x0128('0x25')](_0x334d16[_0x0128('0x26')],qs[_0x0128('0x27')](_0x2aa33e[_0x0128('0x23')][_0x0128('0x27')]));_0x7004d3['attributes']=_0x7004d3['attributes'][_0x0128('0x28')]?_0x7004d3[_0x0128('0x29')]:_0x334d16['model'];if(_0x2aa33e[_0x0128('0x23')]['includeAll']){_0x7004d3[_0x0128('0x2a')]=[{'all':!![]}];}_0x7004d3=_[_0x0128('0x2b')]({},_0x7004d3,_0x2aa33e['options']);return db[_0x0128('0x20')][_0x0128('0x2c')](_0x7004d3)[_0x0128('0x2d')](handleEntityNotFound(_0x1a4284,null))[_0x0128('0x2d')](respondWithResult(_0x1a4284,null))[_0x0128('0x2e')](handleError(_0x1a4284,null));};exports[_0x0128('0x2f')]=function(_0x37fd23,_0xb7f980){return db['WhatsappInteraction'][_0x0128('0x2f')](_0x37fd23[_0x0128('0x30')],{})[_0x0128('0x2d')](respondWithResult(_0xb7f980,0xc9))[_0x0128('0x2e')](handleError(_0xb7f980,null));};exports[_0x0128('0x31')]=function(_0xc6f6dd,_0x3177f8){if(_0xc6f6dd[_0x0128('0x30')]['id']){delete _0xc6f6dd[_0x0128('0x30')]['id'];}return db[_0x0128('0x20')][_0x0128('0x2c')]({'where':{'id':_0xc6f6dd['params']['id']}})[_0x0128('0x2d')](handleEntityNotFound(_0x3177f8,null))[_0x0128('0x2d')](saveUpdates(_0xc6f6dd[_0x0128('0x30')],null))['then'](respondWithResult(_0x3177f8,null))['catch'](handleError(_0x3177f8,null));};exports[_0x0128('0x18')]=function(_0xf3c85a,_0x25dd88){return db['WhatsappInteraction']['find']({'where':{'id':_0xf3c85a[_0x0128('0x32')]['id']}})[_0x0128('0x2d')](handleEntityNotFound(_0x25dd88,null))[_0x0128('0x2d')](removeEntity(_0x25dd88,null))[_0x0128('0x2e')](handleError(_0x25dd88,null));};exports[_0x0128('0x33')]=function(_0x147e14,_0x1692f2){return db[_0x0128('0x20')]['describe']()['then'](respondWithResult(_0x1692f2,null))[_0x0128('0x2e')](handleError(_0x1692f2,null));};exports['addMessage']=function(_0x3d28ac,_0x1c5f67){return db['WhatsappMessage'][_0x0128('0x2c')]({'where':{'id':_0x3d28ac[_0x0128('0x32')]['id']}})[_0x0128('0x2d')](handleEntityNotFound(_0x1c5f67,null))[_0x0128('0x2d')](function(_0xfa34c6){if(_0xfa34c6){return _0xfa34c6[_0x0128('0x34')](_0x3d28ac[_0x0128('0x30')][_0x0128('0x35')],_[_0x0128('0x36')](_0x3d28ac[_0x0128('0x30')],[_0x0128('0x35'),'id'])||{});}})[_0x0128('0x2d')](respondWithResult(_0x1c5f67,null))[_0x0128('0x2e')](handleError(_0x1c5f67,null));};exports['getMessages']=function(_0x424d50,_0x239223){var _0x526948={'raw':![],'where':{}};var _0x4c09a7={};var _0x37fce0={'count':0x0,'rows':[]};return db[_0x0128('0x20')]['findOne']({'where':{'id':_0x424d50['params']['id']}})['then'](handleEntityNotFound(_0x239223,null))['then'](function(_0x62171c){if(_0x62171c){_0x4c09a7['model']=_[_0x0128('0x24')](db[_0x0128('0x37')][_0x0128('0x38')]);_0x4c09a7[_0x0128('0x23')]=_[_0x0128('0x24')](_0x424d50['query']);_0x4c09a7['filters']=_[_0x0128('0x25')](_0x4c09a7[_0x0128('0x26')],_0x4c09a7[_0x0128('0x23')]);_0x526948[_0x0128('0x29')]=_[_0x0128('0x25')](_0x4c09a7['model'],qs[_0x0128('0x27')](_0x424d50[_0x0128('0x23')][_0x0128('0x27')]));_0x526948[_0x0128('0x29')]=_0x526948['attributes'][_0x0128('0x28')]?_0x526948[_0x0128('0x29')]:_0x4c09a7[_0x0128('0x26')];if(!_0x424d50[_0x0128('0x23')]['hasOwnProperty'](_0x0128('0x39'))){_0x526948[_0x0128('0x3a')]=qs[_0x0128('0x3a')](_0x424d50[_0x0128('0x23')][_0x0128('0x3a')]);_0x526948[_0x0128('0x13')]=qs[_0x0128('0x13')](_0x424d50[_0x0128('0x23')][_0x0128('0x13')]);}_0x526948[_0x0128('0x3b')]=qs[_0x0128('0x3c')](_0x424d50[_0x0128('0x23')][_0x0128('0x3c')]);_0x526948[_0x0128('0x3d')]=qs['filters'](_[_0x0128('0x3e')](_0x424d50[_0x0128('0x23')],_0x4c09a7['filters']));_0x526948[_0x0128('0x3d')][_0x0128('0x3f')]=_0x62171c['id'];if(_0x424d50['query'][_0x0128('0x40')]){_0x526948[_0x0128('0x3d')]=_[_0x0128('0x2b')](_0x526948['where'],{'$or':_[_0x0128('0x1f')](_0x526948[_0x0128('0x29')],function(_0x227053){var _0x507bf2={};_0x507bf2[_0x227053]={'$like':'%'+_0x424d50[_0x0128('0x23')][_0x0128('0x40')]+'%'};return _0x507bf2;})});}if(_0x424d50[_0x0128('0x23')][_0x0128('0x41')]){var _0x4d141b=_0x424d50[_0x0128('0x23')][_0x0128('0x41')]['split'](',');var _0x5cbde6={};_0x5cbde6[_0x4d141b[0x0]]={'$gte':moment(_0x4d141b[0x1])[_0x0128('0x42')]('YYYY-MM-DD\x20HH:mm:ss')};_0x526948[_0x0128('0x3d')]=_[_0x0128('0x2b')](_0x526948['where'],_0x5cbde6);}_0x526948=_['merge']({},_0x526948,_0x424d50['options']);return db['WhatsappMessage'][_0x0128('0x15')]({'where':_0x526948[_0x0128('0x3d')]})[_0x0128('0x2d')](function(_0x2588a0){_0x37fce0[_0x0128('0x15')]=_0x2588a0;if(_0x424d50[_0x0128('0x23')][_0x0128('0x43')]){_0x526948[_0x0128('0x2a')]=[{'all':!![]}];}return db[_0x0128('0x37')]['findAll'](_0x526948);})[_0x0128('0x2d')](function(_0x468121){_0x37fce0[_0x0128('0x44')]=_0x468121;return _0x37fce0;});}})['then'](respondWithFilteredResult(_0x239223,_0x526948))['catch'](handleError(_0x239223,null));};exports[_0x0128('0x45')]=function(_0x12530a,_0xcb3911){return db['WhatsappInteraction'][_0x0128('0x2c')]({'where':{'id':_0x12530a['params']['id']}})[_0x0128('0x2d')](handleEntityNotFound(_0xcb3911,null))[_0x0128('0x2d')](function(_0x420ee0){if(_0x420ee0){return _0x420ee0[_0x0128('0x46')](_0x12530a[_0x0128('0x30')][_0x0128('0x35')],_[_0x0128('0x36')](_0x12530a['body'],['ids','id'])||{})[_0x0128('0x47')](function(){return db[_0x0128('0x48')][_0x0128('0x22')]({'attributes':['id',_0x0128('0x1c'),_0x0128('0x49')],'where':{'id':_0x12530a[_0x0128('0x30')]['ids']}});})[_0x0128('0x2d')](function(_0x51c5d4){socket['emit'](_0x0128('0x4a'),{'id':Number(_0x12530a[_0x0128('0x32')]['id']),'tags':_0x51c5d4||[]});return{'id':Number(_0x12530a[_0x0128('0x32')]['id']),'tags':_0x51c5d4||[]};});}})[_0x0128('0x2d')](respondWithResult(_0xcb3911,null))['catch'](handleError(_0xcb3911,null));};exports[_0x0128('0x4b')]=function(_0xb33179,_0x31ec10){return db['WhatsappInteraction']['find']({'where':{'id':_0xb33179['params']['id']}})['then'](handleEntityNotFound(_0x31ec10,null))['then'](function(_0x4d4dd5){if(_0x4d4dd5){return _0x4d4dd5[_0x0128('0x4b')](_0xb33179['query'][_0x0128('0x35')]);}})[_0x0128('0x2d')](respondWithStatusCode(_0x31ec10,null))[_0x0128('0x2e')](handleError(_0x31ec10,null));};exports[_0x0128('0x4c')]=function(_0x20acc9,_0x39a035){var _0x2067fa=moment()['unix']()[_0x0128('0x4d')]();var _0x3e076f=path['join'](config['root'],_0x0128('0x4e'),'files',_0x0128('0x4f'));var _0x4a5088=path[_0x0128('0x50')](config['root'],_0x0128('0x4e'),_0x0128('0x51'),_0x0128('0x52'));var _0x267e9f=path[_0x0128('0x50')](_0x3e076f,_0x2067fa);var _0x5de5d8=util[_0x0128('0x42')](_0x0128('0x53'),_0x20acc9[_0x0128('0x32')]['id'],_0x2067fa);var _0x3953ef=path[_0x0128('0x50')](_0x3e076f,_0x5de5d8);var _0x304e14=[];_0x304e14[_0x0128('0x54')]({'model':db[_0x0128('0x55')],'as':_0x0128('0x55'),'attributes':['id',_0x0128('0x56')],'raw':!![]});_0x304e14['push']({'model':db[_0x0128('0x57')],'as':'Contact','attributes':['id',_0x0128('0x58'),_0x0128('0x59')],'raw':!![]});if(_0x20acc9[_0x0128('0x23')][_0x0128('0x52')]){_0x304e14[_0x0128('0x54')]({'model':db[_0x0128('0x5a')],'as':'Attachment','raw':!![]});}var _0x1b502e=[{'model':db[_0x0128('0x37')],'as':'Messages','attributes':['id',_0x0128('0x30'),_0x0128('0x5b'),_0x0128('0x5c'),_0x0128('0x5d'),_0x0128('0x5e')],'include':_0x304e14}];_0x1b502e[_0x0128('0x54')]({'model':db[_0x0128('0x5f')],'as':_0x0128('0x60'),'attributes':['id',_0x0128('0x1c')]});_0x1b502e[_0x0128('0x54')]({'model':db[_0x0128('0x55')],'as':_0x0128('0x61'),'attributes':['id','fullname']});return db[_0x0128('0x20')][_0x0128('0x2c')]({'where':{'id':_0x20acc9[_0x0128('0x32')]['id']},'include':_0x1b502e})[_0x0128('0x2d')](handleEntityNotFound(_0x39a035,null))[_0x0128('0x2d')](function(_0x5cbf9e){if(_0x5cbf9e){var _0x4553ad=_0x5cbf9e[_0x0128('0x62')]({'plain':!![]});fs[_0x0128('0x63')](_0x267e9f);var _0x16ee36={'channel':'Whatsapp','account':_0x4553ad[_0x0128('0x60')][_0x0128('0x1c')],'agent':_0x4553ad[_0x0128('0x61')]?_0x4553ad['Owner']['fullname']:'N.A.','createdAt':moment(_0x4553ad[_0x0128('0x5b')])[_0x0128('0x42')](_0x0128('0x64'))[_0x0128('0x4d')](),'closedAt':_0x4553ad[_0x0128('0x65')]?moment(_0x4553ad['closedAt'])[_0x0128('0x42')](_0x0128('0x64'))['toString']():'','disposition':_0x4553ad[_0x0128('0x66')],'messages':_(_0x4553ad[_0x0128('0x67')])['filter']({'secret':![]})['map'](function(_0xb930f1){if(_0xb930f1[_0x0128('0x5a')]){var _0x39b695=path[_0x0128('0x50')](_0x4a5088,_0xb930f1[_0x0128('0x5a')][_0x0128('0x68')]);if(fs[_0x0128('0x69')](_0x39b695)){fs[_0x0128('0x6a')](_0x39b695)[_0x0128('0x6b')](fs['createWriteStream'](path['join'](_0x267e9f,_0xb930f1[_0x0128('0x5a')][_0x0128('0x68')])));}}return{'date':moment(_0xb930f1[_0x0128('0x5b')])[_0x0128('0x42')](_0x0128('0x64'))[_0x0128('0x4d')](),'sender':_0xb930f1[_0x0128('0x5c')]===_0x0128('0x6c')?_0xb930f1[_0x0128('0x55')]?_0xb930f1['User'][_0x0128('0x56')]:_0x0128('0x6d'):_0xb930f1[_0x0128('0x6e')][_0x0128('0x58')]+(_0xb930f1['Contact']['lastName']?'\x20'+_0xb930f1['Contact'][_0x0128('0x59')]:''),'body':_0xb930f1[_0x0128('0x5a')]?_0xb930f1[_0x0128('0x5a')][_0x0128('0x68')]:_0xb930f1[_0x0128('0x30')],'direction':_0xb930f1['direction']===_0x0128('0x6c')?'A':'C','secret':_0xb930f1[_0x0128('0x5d')],'read':_0xb930f1[_0x0128('0x5e')],'attachment':_0xb930f1[_0x0128('0x5a')]};})['value']()};return ejs['renderFile'](path[_0x0128('0x50')](config[_0x0128('0x6f')],_0x0128('0x4e'),'views','downloadInteraction.ejs'),{'interaction':_0x16ee36})[_0x0128('0x2d')](function(_0x57ec81){var _0x42ac40=path['join'](_0x267e9f,_0x0128('0x70')+_0x4553ad['id']+'-'+_0x2067fa+_0x0128('0x71'));var _0x281bfe={'path':_0x42ac40,'channel':_0x0128('0x72'),'interactionId':_0x4553ad['id']};return pdf['createPdfFromHTML'](_0x57ec81,_0x281bfe);})['then'](function(){return new BPromise(function(_0x473afb,_0x3e9266){zipdir(_0x267e9f,{'saveTo':_0x3953ef},function(_0x98c693,_0x7b0d5a){if(_0x98c693)return _0x3e9266(_0x98c693);return _0x473afb(_0x7b0d5a);});})['then'](function(){return new BPromise(function(_0x288cac,_0x1bfb6c){rimraf(_0x267e9f,function(_0x54a8a7){if(_0x54a8a7)_0x1bfb6c(_0x54a8a7);return _0x288cac();});});})[_0x0128('0x2d')](function(){return _0x39a035['download'](_0x3953ef,_0x5de5d8,function(_0x1f0bae){if(_0x1f0bae){console[_0x0128('0x73')](_0x0128('0x74'),_0x1f0bae);}else{fs[_0x0128('0x75')](_0x3953ef);}});});});}else{return _0x39a035[_0x0128('0x10')](0xc8);}})[_0x0128('0x2e')](handleError(_0x39a035,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 26b1749..2f531f7 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 _0xe43c=['events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','then','setDataValue','map','emit','catch','hook'];(function(_0x2341d7,_0x85b43b){var _0x5d470d=function(_0xa25b9b){while(--_0xa25b9b){_0x2341d7['push'](_0x2341d7['shift']());}};_0x5d470d(++_0x85b43b);}(_0xe43c,0x180));var _0xce43=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xe43c[_0x5c2e3e];return _0x53f64a;};'use strict';var EventEmitter=require(_0xce43('0x0'));var WhatsappInteraction=require(_0xce43('0x1'))['db'][_0xce43('0x2')];var WhatsappMessage=require(_0xce43('0x1'))['db'][_0xce43('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xce43('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xce43('0x5'),'afterDestroy':'remove'};function emitEvent(_0x32b4d4){return function(_0x3753a2,_0xcec0ef,_0x3557d0){_0x3753a2['getUsers']({'attributes':['id'],'raw':!![]})[_0xce43('0x6')](function(_0x5ddbba){_0x3753a2[_0xce43('0x7')]('Users',_0x5ddbba[_0xce43('0x8')](function(_0x48b578){return{'id':_0x48b578['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x3753a2['id'],'direction':'in','read':![]},'raw':!![]});})[_0xce43('0x6')](function(_0x364f44){_0x3753a2['setDataValue']('unreadMessages',_0x364f44['length']);WhatsappInteractionEvents[_0xce43('0x9')](_0x32b4d4+':'+_0x3753a2['id'],_0x3753a2);WhatsappInteractionEvents['emit'](_0x32b4d4,_0x3753a2);_0x3557d0(null);})[_0xce43('0xa')](_0x3557d0(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xce43('0xb')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x3cfb=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','getUsers','then','Users','findAll','setDataValue','unreadMessages','length','emit','catch'];(function(_0x450e32,_0x1f4f6a){var _0x3041e0=function(_0x42bba5){while(--_0x42bba5){_0x450e32['push'](_0x450e32['shift']());}};_0x3041e0(++_0x1f4f6a);}(_0x3cfb,0x1b8));var _0xb3cf=function(_0x55db34,_0x290463){_0x55db34=_0x55db34-0x0;var _0x47fc82=_0x3cfb[_0x55db34];return _0x47fc82;};'use strict';var EventEmitter=require(_0xb3cf('0x0'));var WhatsappInteraction=require(_0xb3cf('0x1'))['db'][_0xb3cf('0x2')];var WhatsappMessage=require(_0xb3cf('0x1'))['db'][_0xb3cf('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xb3cf('0x4')](0x0);var events={'afterCreate':_0xb3cf('0x5'),'afterUpdate':_0xb3cf('0x6'),'afterDestroy':'remove'};function emitEvent(_0x4740b9){return function(_0xfc88c0,_0x19e5e5,_0x59c604){_0xfc88c0[_0xb3cf('0x7')]({'attributes':['id'],'raw':!![]})[_0xb3cf('0x8')](function(_0x42ce15){_0xfc88c0['setDataValue'](_0xb3cf('0x9'),_0x42ce15['map'](function(_0x56d606){return{'id':_0x56d606['id']};}));return WhatsappMessage[_0xb3cf('0xa')]({'where':{'WhatsappInteractionId':_0xfc88c0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb3cf('0x8')](function(_0xf60a87){_0xfc88c0[_0xb3cf('0xb')](_0xb3cf('0xc'),_0xf60a87[_0xb3cf('0xd')]);WhatsappInteractionEvents[_0xb3cf('0xe')](_0x4740b9+':'+_0xfc88c0['id'],_0xfc88c0);WhatsappInteractionEvents[_0xb3cf('0xe')](_0x4740b9,_0xfc88c0);_0x59c604(null);})[_0xb3cf('0xf')](_0x59c604(null));};}for(var e in events){if(events[_0xb3cf('0x10')](e)){var event=events[e];WhatsappInteraction[_0xb3cf('0x11')](e,emitEvent(event));}}module[_0xb3cf('0x12')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index f49aa43..5dd61fd 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 _0x51f7=['YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x51f7,0x144));var _0x751f=function(_0x1d606e,_0x438c6a){_0x1d606e=_0x1d606e-0x0;var _0x528543=_0x51f7[_0x1d606e];return _0x528543;};'use strict';var _=require('lodash');var util=require(_0x751f('0x0'));var logger=require('../../config/logger')(_0x751f('0x1'));var moment=require(_0x751f('0x2'));var BPromise=require(_0x751f('0x3'));var rp=require(_0x751f('0x4'));var fs=require('fs');var path=require(_0x751f('0x5'));var rimraf=require(_0x751f('0x6'));var config=require(_0x751f('0x7'));var attributes=require(_0x751f('0x8'));module['exports']=function(_0x5c95e5,_0x5be202){return _0x5c95e5[_0x751f('0x9')](_0x751f('0xa'),attributes,{'tableName':_0x751f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d481d,_0x793a0,_0x42cc4c){if(_0x3d481d[_0x751f('0xc')](_0x751f('0xd'))){_0x3d481d[_0x751f('0xe')]=moment()[_0x751f('0xf')](_0x751f('0x10'));}_0x42cc4c(null,_0x3d481d);}}});}; \ No newline at end of file +var _0xd382=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','WhatsappInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x582b03,_0x434568){var _0x5ba0f1=function(_0x36ff3c){while(--_0x36ff3c){_0x582b03['push'](_0x582b03['shift']());}};_0x5ba0f1(++_0x434568);}(_0xd382,0x16c));var _0x2d38=function(_0x1a5545,_0x4ad6fe){_0x1a5545=_0x1a5545-0x0;var _0x35c087=_0xd382[_0x1a5545];return _0x35c087;};'use strict';var _=require(_0x2d38('0x0'));var util=require(_0x2d38('0x1'));var logger=require(_0x2d38('0x2'))(_0x2d38('0x3'));var moment=require(_0x2d38('0x4'));var BPromise=require(_0x2d38('0x5'));var rp=require(_0x2d38('0x6'));var fs=require('fs');var path=require(_0x2d38('0x7'));var rimraf=require(_0x2d38('0x8'));var config=require(_0x2d38('0x9'));var attributes=require(_0x2d38('0xa'));module['exports']=function(_0x310114,_0x3e285b){return _0x310114['define'](_0x2d38('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x55a6e8,_0x4acf32,_0x1e626b){if(_0x55a6e8[_0x2d38('0xc')]('closed')){_0x55a6e8[_0x2d38('0xd')]=moment()[_0x2d38('0xe')](_0x2d38('0xf'));}_0x1e626b(null,_0x55a6e8);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 2e05269..00cda9b 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 _0x6004=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappInteraction','update','body','options','raw','where','attributes','limit','then','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','../../mysqldb'];(function(_0x58f6ca,_0x11b59a){var _0x162729=function(_0x446881){while(--_0x446881){_0x58f6ca['push'](_0x58f6ca['shift']());}};_0x162729(++_0x11b59a);}(_0x6004,0x129));var _0x4600=function(_0xfb333d,_0x52e280){_0xfb333d=_0xfb333d-0x0;var _0x5460ab=_0x6004[_0xfb333d];return _0x5460ab;};'use strict';var _=require(_0x4600('0x0'));var util=require(_0x4600('0x1'));var moment=require(_0x4600('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4600('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4600('0x4'))(_0x4600('0x5'));var config=require(_0x4600('0x6'));var jayson=require(_0x4600('0x7'));var client=jayson[_0x4600('0x8')][_0x4600('0x9')]({'port':0x232a});config[_0x4600('0xa')]=_[_0x4600('0xb')](config['redis'],{'host':_0x4600('0xc'),'port':0x18eb});var socket=require(_0x4600('0xd'))(new Redis(config['redis']));require(_0x4600('0xe'))[_0x4600('0xf')](socket);function respondWithRpcPromise(_0x4213e6,_0x4fd84b,_0x5c5161){return new BPromise(function(_0x1fbff0,_0x413af6){return client['request'](_0x4213e6,_0x5c5161)['then'](function(_0x498cd2){logger[_0x4600('0x10')](_0x4600('0x11'),_0x4fd84b,_0x4600('0x12'));logger[_0x4600('0x13')](_0x4600('0x14'),_0x4fd84b,_0x4600('0x12'),JSON[_0x4600('0x15')](_0x498cd2));if(_0x498cd2[_0x4600('0x16')]){if(_0x498cd2['error'][_0x4600('0x17')]===0x1f4){logger[_0x4600('0x16')](_0x4600('0x11'),_0x4fd84b,_0x498cd2[_0x4600('0x16')][_0x4600('0x18')]);return _0x413af6(_0x498cd2['error'][_0x4600('0x18')]);}logger[_0x4600('0x16')](_0x4600('0x11'),_0x4fd84b,_0x498cd2[_0x4600('0x16')][_0x4600('0x18')]);return _0x1fbff0(_0x498cd2[_0x4600('0x16')][_0x4600('0x18')]);}else{logger[_0x4600('0x10')](_0x4600('0x11'),_0x4fd84b,_0x4600('0x12'));_0x1fbff0(_0x498cd2[_0x4600('0x19')][_0x4600('0x18')]);}})[_0x4600('0x1a')](function(_0x2f1718){logger[_0x4600('0x16')](_0x4600('0x11'),_0x4fd84b,_0x2f1718);_0x413af6(_0x2f1718);});});}exports['UpdateWhatsappInteraction']=function(_0x1a332b){var _0x457a4b=this;return new Promise(function(_0x4d0b6f,_0x476099){return db[_0x4600('0x1b')][_0x4600('0x1c')](_0x1a332b[_0x4600('0x1d')],{'raw':_0x1a332b[_0x4600('0x1e')]?_0x1a332b[_0x4600('0x1e')][_0x4600('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a332b[_0x4600('0x1e')]?_0x1a332b[_0x4600('0x1e')][_0x4600('0x20')]||null:null,'attributes':_0x1a332b[_0x4600('0x1e')]?_0x1a332b['options'][_0x4600('0x21')]||null:null,'limit':_0x1a332b[_0x4600('0x1e')]?_0x1a332b[_0x4600('0x1e')][_0x4600('0x22')]||null:null})[_0x4600('0x23')](function(_0x144b7b){logger[_0x4600('0x10')](_0x4600('0x24'),_0x1a332b);logger[_0x4600('0x13')]('UpdateWhatsappInteraction',_0x1a332b,JSON[_0x4600('0x15')](_0x144b7b));_0x4d0b6f(_0x144b7b);})['catch'](function(_0x32cdb7){logger[_0x4600('0x16')](_0x4600('0x24'),_0x32cdb7[_0x4600('0x18')],_0x1a332b);_0x476099(_0x457a4b[_0x4600('0x16')](0x1f4,_0x32cdb7[_0x4600('0x18')]));});});};exports[_0x4600('0x25')]=function(_0x3c59e2){return new Promise(function(_0x50ba91,_0x91649d){return db[_0x4600('0x1b')][_0x4600('0x26')]({'where':_0x3c59e2[_0x4600('0x1e')]?_0x3c59e2['options'][_0x4600('0x20')]||null:null})[_0x4600('0x23')](function(_0x226ee3){if(_0x226ee3){return _0x226ee3[_0x4600('0x27')](_0x3c59e2[_0x4600('0x1d')][_0x4600('0x28')],_['omit'](_0x3c59e2['body'],['ids','id'])||{});}})[_0x4600('0x29')](function(_0x370ec6){logger[_0x4600('0x10')]('AddTags',_0x3c59e2);logger[_0x4600('0x13')]('AddTags',_0x3c59e2,JSON['stringify'](_0x370ec6));_0x50ba91(_0x370ec6);})[_0x4600('0x1a')](function(_0x523ca5){logger[_0x4600('0x16')](_0x4600('0x2a'),_0x523ca5[_0x4600('0x18')],_0x3c59e2);_0x91649d(_this[_0x4600('0x16')](0x1f4,_0x523ca5['message']));});});}; \ No newline at end of file +var _0x75a3=['redis','socket.io-emitter','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateWhatsappInteraction','update','body','options','raw','where','attributes','limit','debug','AddTagsToWhatsappInteraction','WhatsappInteraction','addTags','ids','omit','spread','AddTags','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x75a3,0x11a));var _0x375a=function(_0x3c8d35,_0x45372d){_0x3c8d35=_0x3c8d35-0x0;var _0x3c26bf=_0x75a3[_0x3c8d35];return _0x3c26bf;};'use strict';var _=require(_0x375a('0x0'));var util=require(_0x375a('0x1'));var moment=require(_0x375a('0x2'));var BPromise=require(_0x375a('0x3'));var rs=require(_0x375a('0x4'));var fs=require('fs');var Redis=require(_0x375a('0x5'));var db=require(_0x375a('0x6'))['db'];var utils=require(_0x375a('0x7'));var logger=require(_0x375a('0x8'))(_0x375a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x375a('0xa')][_0x375a('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x375a('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x375a('0xd'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0x375a('0xe')](socket);function respondWithRpcPromise(_0x4c43d8,_0x2d2b15,_0x1d1724){return new BPromise(function(_0x215e20,_0x3fd66b){return client['request'](_0x4c43d8,_0x1d1724)[_0x375a('0xf')](function(_0x1f0a7e){logger[_0x375a('0x10')](_0x375a('0x11'),_0x2d2b15,_0x375a('0x12'));logger['debug'](_0x375a('0x13'),_0x2d2b15,_0x375a('0x12'),JSON['stringify'](_0x1f0a7e));if(_0x1f0a7e[_0x375a('0x14')]){if(_0x1f0a7e['error'][_0x375a('0x15')]===0x1f4){logger[_0x375a('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x2d2b15,_0x1f0a7e[_0x375a('0x14')][_0x375a('0x16')]);return _0x3fd66b(_0x1f0a7e['error'][_0x375a('0x16')]);}logger[_0x375a('0x14')](_0x375a('0x11'),_0x2d2b15,_0x1f0a7e[_0x375a('0x14')][_0x375a('0x16')]);return _0x215e20(_0x1f0a7e['error']['message']);}else{logger['info'](_0x375a('0x11'),_0x2d2b15,_0x375a('0x12'));_0x215e20(_0x1f0a7e[_0x375a('0x17')][_0x375a('0x16')]);}})[_0x375a('0x18')](function(_0x46109b){logger[_0x375a('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x2d2b15,_0x46109b);_0x3fd66b(_0x46109b);});});}exports[_0x375a('0x19')]=function(_0x567934){var _0x479418=this;return new Promise(function(_0x5ad667,_0x5bfbd6){return db['WhatsappInteraction'][_0x375a('0x1a')](_0x567934[_0x375a('0x1b')],{'raw':_0x567934[_0x375a('0x1c')]?_0x567934['options'][_0x375a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x567934[_0x375a('0x1c')]?_0x567934[_0x375a('0x1c')][_0x375a('0x1e')]||null:null,'attributes':_0x567934[_0x375a('0x1c')]?_0x567934[_0x375a('0x1c')][_0x375a('0x1f')]||null:null,'limit':_0x567934[_0x375a('0x1c')]?_0x567934[_0x375a('0x1c')][_0x375a('0x20')]||null:null})[_0x375a('0xf')](function(_0x248c59){logger[_0x375a('0x10')]('UpdateWhatsappInteraction',_0x567934);logger[_0x375a('0x21')](_0x375a('0x19'),_0x567934,JSON['stringify'](_0x248c59));_0x5ad667(_0x248c59);})[_0x375a('0x18')](function(_0x124f9b){logger[_0x375a('0x14')](_0x375a('0x19'),_0x124f9b['message'],_0x567934);_0x5bfbd6(_0x479418[_0x375a('0x14')](0x1f4,_0x124f9b[_0x375a('0x16')]));});});};exports[_0x375a('0x22')]=function(_0x5a9d5a){return new Promise(function(_0x493871,_0x308e06){return db[_0x375a('0x23')]['find']({'where':_0x5a9d5a[_0x375a('0x1c')]?_0x5a9d5a[_0x375a('0x1c')][_0x375a('0x1e')]||null:null})['then'](function(_0x4c181a){if(_0x4c181a){return _0x4c181a[_0x375a('0x24')](_0x5a9d5a[_0x375a('0x1b')][_0x375a('0x25')],_[_0x375a('0x26')](_0x5a9d5a[_0x375a('0x1b')],[_0x375a('0x25'),'id'])||{});}})[_0x375a('0x27')](function(_0x436aeb){logger[_0x375a('0x10')](_0x375a('0x28'),_0x5a9d5a);logger[_0x375a('0x21')]('AddTags',_0x5a9d5a,JSON[_0x375a('0x29')](_0x436aeb));_0x493871(_0x436aeb);})[_0x375a('0x18')](function(_0x583a4f){logger[_0x375a('0x14')](_0x375a('0x28'),_0x583a4f[_0x375a('0x16')],_0x5a9d5a);_0x308e06(_this['error'](0x1f4,_0x583a4f[_0x375a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 4b21139..ee8d429 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 _0xb6df=['whatsappInteraction:','./whatsappInteraction.events','remove','update','emit','register'];(function(_0x15b516,_0x53b695){var _0x8a07eb=function(_0x255d6a){while(--_0x255d6a){_0x15b516['push'](_0x15b516['shift']());}};_0x8a07eb(++_0x53b695);}(_0xb6df,0xdf));var _0xfb6d=function(_0x9eae9a,_0x1b3032){_0x9eae9a=_0x9eae9a-0x0;var _0x2aeb25=_0xb6df[_0x9eae9a];return _0x2aeb25;};'use strict';var WhatsappInteractionEvents=require(_0xfb6d('0x0'));var events=['save',_0xfb6d('0x1'),_0xfb6d('0x2')];function createListener(_0x4d9b8a,_0x51a196){return function(_0x3051ed){_0x51a196[_0xfb6d('0x3')](_0x4d9b8a,_0x3051ed);};}function removeListener(_0x21da05,_0x5ef6f1){return function(){WhatsappInteractionEvents['removeListener'](_0x21da05,_0x5ef6f1);};}exports[_0xfb6d('0x4')]=function(_0x323dbe){for(var _0x1f3f76=0x0,_0x2ae280=events['length'];_0x1f3f76<_0x2ae280;_0x1f3f76++){var _0x2f1b71=events[_0x1f3f76];var _0x211567=createListener(_0xfb6d('0x5')+_0x2f1b71,_0x323dbe);WhatsappInteractionEvents['on'](_0x2f1b71,_0x211567);}}; \ No newline at end of file +var _0x5bc8=['./whatsappInteraction.events','remove','update','emit','removeListener','length','whatsappInteraction:'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x5bc8,0x10a));var _0x85bc=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0x5bc8[_0x4b6830];return _0x239e4a;};'use strict';var WhatsappInteractionEvents=require(_0x85bc('0x0'));var events=['save',_0x85bc('0x1'),_0x85bc('0x2')];function createListener(_0x55fe1f,_0x22fef9){return function(_0x3cd5d3){_0x22fef9[_0x85bc('0x3')](_0x55fe1f,_0x3cd5d3);};}function removeListener(_0x24d1b8,_0x4f6d4d){return function(){WhatsappInteractionEvents[_0x85bc('0x4')](_0x24d1b8,_0x4f6d4d);};}exports['register']=function(_0x2757f7){for(var _0x3beaa0=0x0,_0x1ef5ba=events[_0x85bc('0x5')];_0x3beaa0<_0x1ef5ba;_0x3beaa0++){var _0x3bfc4f=events[_0x3beaa0];var _0xd74465=createListener(_0x85bc('0x6')+_0x3bfc4f,_0x2757f7);WhatsappInteractionEvents['on'](_0x3bfc4f,_0xd74465);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 560c7e0..e1c02f0 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 _0xcf8c=['/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','/:id/accept'];(function(_0x1653b1,_0x35b7d1){var _0x3e0b17=function(_0x5f21fc){while(--_0x5f21fc){_0x1653b1['push'](_0x1653b1['shift']());}};_0x3e0b17(++_0x35b7d1);}(_0xcf8c,0x18d));var _0xccf8=function(_0x341d43,_0x94144e){_0x341d43=_0x341d43-0x0;var _0x31c733=_0xcf8c[_0x341d43];return _0x31c733;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xccf8('0x0'));var timeout=require(_0xccf8('0x1'));var express=require(_0xccf8('0x2'));var router=express[_0xccf8('0x3')]();var fs_extra=require(_0xccf8('0x4'));var auth=require(_0xccf8('0x5'));var interaction=require(_0xccf8('0x6'));var config=require(_0xccf8('0x7'));var controller=require(_0xccf8('0x8'));router[_0xccf8('0x9')]('/',auth[_0xccf8('0xa')](),controller[_0xccf8('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xccf8('0x9')](_0xccf8('0xc'),auth[_0xccf8('0xa')](),controller[_0xccf8('0xd')]);router[_0xccf8('0xe')]('/',auth[_0xccf8('0xa')](),interaction[_0xccf8('0xf')](_0xccf8('0x10'),_0xccf8('0x11')),controller[_0xccf8('0x12')]);router[_0xccf8('0xe')](_0xccf8('0x13'),controller[_0xccf8('0x14')]);router['put']('/:id',auth[_0xccf8('0xa')](),controller['update']);router[_0xccf8('0x15')](_0xccf8('0x16'),auth[_0xccf8('0xa')](),controller['accept']);router[_0xccf8('0x15')](_0xccf8('0x17'),auth['isAuthenticated'](),controller[_0xccf8('0x18')]);router[_0xccf8('0x19')](_0xccf8('0xc'),auth[_0xccf8('0xa')](),controller[_0xccf8('0x1a')]);module[_0xccf8('0x1b')]=router; \ No newline at end of file +var _0x06f6=['create','post','/:id/status','status','put','/:id/accept','accept','reject','destroy','exports','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','tracked','whatsapp'];(function(_0x470f3a,_0xf569dc){var _0x3083e4=function(_0x3ca3e5){while(--_0x3ca3e5){_0x470f3a['push'](_0x470f3a['shift']());}};_0x3083e4(++_0xf569dc);}(_0x06f6,0x82));var _0x606f=function(_0x4a754d,_0x321a91){_0x4a754d=_0x4a754d-0x0;var _0x465c45=_0x06f6[_0x4a754d];return _0x465c45;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x606f('0x0'));var timeout=require('connect-timeout');var express=require(_0x606f('0x1'));var router=express['Router']();var fs_extra=require(_0x606f('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x606f('0x3'));var config=require(_0x606f('0x4'));var controller=require('./whatsappMessage.controller');router[_0x606f('0x5')]('/',auth['isAuthenticated'](),controller[_0x606f('0x6')]);router[_0x606f('0x5')](_0x606f('0x7'),auth[_0x606f('0x8')](),controller[_0x606f('0x9')]);router['get'](_0x606f('0xa'),auth[_0x606f('0x8')](),controller[_0x606f('0xb')]);router['post']('/',auth[_0x606f('0x8')](),interaction[_0x606f('0xc')](_0x606f('0xd'),'whatsappmessage:create'),controller[_0x606f('0xe')]);router[_0x606f('0xf')](_0x606f('0x10'),controller[_0x606f('0x11')]);router[_0x606f('0x12')]('/:id',auth[_0x606f('0x8')](),controller['update']);router[_0x606f('0x12')](_0x606f('0x13'),auth[_0x606f('0x8')](),controller[_0x606f('0x14')]);router[_0x606f('0x12')]('/:id/reject',auth[_0x606f('0x8')](),controller[_0x606f('0x15')]);router['delete']('/:id',auth[_0x606f('0x8')](),controller[_0x606f('0x16')]);module[_0x606f('0x17')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 690d3af..1ff1fac 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 _0xf24e=['BOOLEAN','TEXT','medium','ENUM','out','STRING'];(function(_0x298e98,_0x3afa39){var _0x38161c=function(_0x499762){while(--_0x499762){_0x298e98['push'](_0x298e98['shift']());}};_0x38161c(++_0x3afa39);}(_0xf24e,0x110));var _0xef24=function(_0x46cf00,_0x457a43){_0x46cf00=_0x46cf00-0x0;var _0x3974dc=_0xf24e[_0x46cf00];return _0x3974dc;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xef24('0x0')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xef24('0x1')]('in',_0xef24('0x2')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xef24('0x3')](0xbe)},'phone':{'type':Sequelize[_0xef24('0x3')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xef24('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xef24('0x3')]},'providerResponse':{'type':Sequelize[_0xef24('0x5')]}}; \ No newline at end of file +var _0xaf2d=['STRING','DATE','exports','BOOLEAN','ENUM','out'];(function(_0x4f1075,_0x51e906){var _0x2ec65c=function(_0x454730){while(--_0x454730){_0x4f1075['push'](_0x4f1075['shift']());}};_0x2ec65c(++_0x51e906);}(_0xaf2d,0xbc));var _0xdaf2=function(_0x34c1a9,_0x3a89d7){_0x34c1a9=_0x34c1a9-0x0;var _0xb3c7a6=_0xaf2d[_0x34c1a9];return _0xb3c7a6;};'use strict';var Sequelize=require('sequelize');module[_0xdaf2('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xdaf2('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdaf2('0x2')]('in',_0xdaf2('0x3')),'defaultValue':_0xdaf2('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xdaf2('0x4')]},'readAt':{'type':Sequelize[_0xdaf2('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xdaf2('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index ab709b6..9f6ef44 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 _0x6d80=['result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','WhatsappMessage','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','update','body','params','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','WhatsappInteractionId','isNil','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','WhatsappInteraction','RejectMessage','rejectMessage','QueryTypes','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5aa43c,_0x5487ae){var _0x255e99=function(_0x19c889){while(--_0x19c889){_0x5aa43c['push'](_0x5aa43c['shift']());}};_0x255e99(++_0x5487ae);}(_0x6d80,0x178));var _0x06d8=function(_0x35398a,_0x2954ce){_0x35398a=_0x35398a-0x0;var _0x402376=_0x6d80[_0x35398a];return _0x402376;};'use strict';var emlformat=require(_0x06d8('0x0'));var rimraf=require(_0x06d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x06d8('0x2'));var BPromise=require(_0x06d8('0x3'));var Mustache=require(_0x06d8('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x06d8('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06d8('0x6'));var _=require(_0x06d8('0x7'));var squel=require(_0x06d8('0x8'));var crypto=require(_0x06d8('0x9'));var jsforce=require(_0x06d8('0xa'));var deskjs=require(_0x06d8('0xb'));var toCsv=require(_0x06d8('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x06d8('0xc'));var authService=require(_0x06d8('0xd'));var qs=require(_0x06d8('0xe'));var as=require(_0x06d8('0xf'));var hardwareService=require(_0x06d8('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x06d8('0x11'));var db=require(_0x06d8('0x12'))['db'];config[_0x06d8('0x13')]=_[_0x06d8('0x14')](config[_0x06d8('0x13')],{'host':_0x06d8('0x15'),'port':0x18eb});var socket=require(_0x06d8('0x16'))(new Redis(config[_0x06d8('0x13')]));require('./whatsappMessage.socket')[_0x06d8('0x17')](socket);var jayson=require(_0x06d8('0x18'));var client=jayson[_0x06d8('0x19')][_0x06d8('0x1a')]({'port':0x232c});var client9002=jayson[_0x06d8('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28eed9,_0x2c6c18,_0x20bd88,_0x2d2e0f){return new BPromise(function(_0x1ab397,_0x5c5b6d){var _0x342ea9=_0x2d2e0f||client;return _0x342ea9[_0x06d8('0x1b')](_0x28eed9,_0x20bd88)[_0x06d8('0x1c')](function(_0x50e55a){logger[_0x06d8('0x1d')](_0x06d8('0x1e'),_0x2c6c18,_0x06d8('0x1f'));logger[_0x06d8('0x20')](_0x06d8('0x21'),_0x2c6c18,_0x06d8('0x1f'),JSON[_0x06d8('0x22')](_0x50e55a));if(_0x50e55a[_0x06d8('0x23')]){if(_0x50e55a[_0x06d8('0x23')][_0x06d8('0x24')]===0x1f4){logger[_0x06d8('0x23')](_0x06d8('0x1e'),_0x2c6c18,_0x50e55a[_0x06d8('0x23')]['message']);return _0x5c5b6d(_0x50e55a[_0x06d8('0x23')]['message']);}logger['error'](_0x06d8('0x1e'),_0x2c6c18,_0x50e55a[_0x06d8('0x23')][_0x06d8('0x25')]);return _0x1ab397(_0x50e55a['error'][_0x06d8('0x25')]);}else{logger[_0x06d8('0x1d')](_0x06d8('0x1e'),_0x2c6c18,_0x06d8('0x1f'));_0x1ab397(_0x50e55a[_0x06d8('0x26')][_0x06d8('0x25')]);}})['catch'](function(_0x3f7265){logger[_0x06d8('0x23')](_0x06d8('0x1e'),_0x2c6c18,_0x3f7265);_0x5c5b6d(_0x3f7265);});});}function respondWithStatusCode(_0x50a7a6,_0x2606e8){_0x2606e8=_0x2606e8||0xcc;return function(_0x197a60){if(_0x197a60){return _0x50a7a6[_0x06d8('0x27')](_0x2606e8);}return _0x50a7a6[_0x06d8('0x28')](_0x2606e8)[_0x06d8('0x29')]();};}function respondWithResult(_0x18c995,_0x22f6d7){_0x22f6d7=_0x22f6d7||0xc8;return function(_0x1ed25b){if(_0x1ed25b){return _0x18c995['status'](_0x22f6d7)[_0x06d8('0x2a')](_0x1ed25b);}};}function respondWithFilteredResult(_0x175f13,_0x340da5){return function(_0x21873d){if(_0x21873d){var _0xb77217=typeof _0x340da5[_0x06d8('0x2b')]===_0x06d8('0x2c')&&typeof _0x340da5[_0x06d8('0x2d')]===_0x06d8('0x2c');var _0x25e7af=_0x21873d[_0x06d8('0x2e')];var _0x2a2e19=_0xb77217?0x0:_0x340da5[_0x06d8('0x2b')];var _0x44b2e0=_0xb77217?_0x21873d[_0x06d8('0x2e')]:_0x340da5['offset']+_0x340da5['limit'];var _0x5381b4;if(_0x44b2e0>=_0x25e7af){_0x44b2e0=_0x25e7af;_0x5381b4=0xc8;}else{_0x5381b4=0xce;}_0x175f13['status'](_0x5381b4);return _0x175f13[_0x06d8('0x2f')](_0x06d8('0x30'),_0x2a2e19+'-'+_0x44b2e0+'/'+_0x25e7af)[_0x06d8('0x2a')](_0x21873d);}return null;};}function patchUpdates(_0x52ef43){return function(_0x2e47b5){try{jsonpatch[_0x06d8('0x31')](_0x2e47b5,_0x52ef43,!![]);}catch(_0x4acf1a){return BPromise[_0x06d8('0x32')](_0x4acf1a);}return _0x2e47b5[_0x06d8('0x33')]();};}function saveUpdates(_0x372cce,_0x486ed3){return function(_0x2982e9){if(_0x2982e9){return _0x2982e9['update'](_0x372cce)[_0x06d8('0x1c')](function(_0x18a06f){return _0x18a06f;});}return null;};}function removeEntity(_0x4f9631,_0x31176d){return function(_0x5d6403){if(_0x5d6403){return _0x5d6403[_0x06d8('0x34')]()[_0x06d8('0x1c')](function(){_0x4f9631['status'](0xcc)[_0x06d8('0x29')]();});}};}function handleEntityNotFound(_0x1bf4f9,_0x56613e){return function(_0x4845d7){if(!_0x4845d7){_0x1bf4f9['sendStatus'](0x194);}return _0x4845d7;};}function handleError(_0xf3e61c,_0x42b567){_0x42b567=_0x42b567||0x1f4;return function(_0xa8617f){logger[_0x06d8('0x23')](_0xa8617f[_0x06d8('0x35')]);if(_0xa8617f[_0x06d8('0x36')]){delete _0xa8617f['name'];}_0xf3e61c[_0x06d8('0x28')](_0x42b567)[_0x06d8('0x37')](_0xa8617f);};}exports[_0x06d8('0x38')]=function(_0x3cdc9a,_0x568e35){var _0x467da0={},_0x1a1a88={},_0x2e7a3e={'count':0x0,'rows':[]};var _0x1da9be=_[_0x06d8('0x39')](db[_0x06d8('0x3a')]['rawAttributes'],function(_0x4bfb6e){return{'name':_0x4bfb6e['fieldName'],'type':_0x4bfb6e[_0x06d8('0x3b')]['key']};});_0x1a1a88[_0x06d8('0x3c')]=_[_0x06d8('0x39')](_0x1da9be,_0x06d8('0x36'));_0x1a1a88[_0x06d8('0x3d')]=_[_0x06d8('0x3e')](_0x3cdc9a['query']);_0x1a1a88['filters']=_[_0x06d8('0x3f')](_0x1a1a88['model'],_0x1a1a88[_0x06d8('0x3d')]);_0x467da0['attributes']=_['intersection'](_0x1a1a88[_0x06d8('0x3c')],qs[_0x06d8('0x40')](_0x3cdc9a[_0x06d8('0x3d')][_0x06d8('0x40')]));_0x467da0['attributes']=_0x467da0[_0x06d8('0x41')][_0x06d8('0x42')]?_0x467da0[_0x06d8('0x41')]:_0x1a1a88[_0x06d8('0x3c')];if(!_0x3cdc9a[_0x06d8('0x3d')][_0x06d8('0x43')]('nolimit')){_0x467da0[_0x06d8('0x2d')]=qs[_0x06d8('0x2d')](_0x3cdc9a[_0x06d8('0x3d')][_0x06d8('0x2d')]);_0x467da0['offset']=qs[_0x06d8('0x2b')](_0x3cdc9a[_0x06d8('0x3d')][_0x06d8('0x2b')]);}_0x467da0[_0x06d8('0x44')]=qs[_0x06d8('0x45')](_0x3cdc9a['query'][_0x06d8('0x45')]);_0x467da0[_0x06d8('0x46')]=qs[_0x06d8('0x47')](_['pick'](_0x3cdc9a[_0x06d8('0x3d')],_0x1a1a88[_0x06d8('0x47')]),_0x1da9be);if(_0x3cdc9a[_0x06d8('0x3d')]['filter']){_0x467da0[_0x06d8('0x46')]=_[_0x06d8('0x48')](_0x467da0['where'],{'$or':_['map'](_0x1da9be,function(_0x23837c){if(_0x23837c['type']!==_0x06d8('0x49')){var _0x3978e0={};_0x3978e0[_0x23837c[_0x06d8('0x36')]]={'$like':'%'+_0x3cdc9a[_0x06d8('0x3d')]['filter']+'%'};return _0x3978e0;}})});}_0x467da0=_[_0x06d8('0x48')]({},_0x467da0,_0x3cdc9a[_0x06d8('0x4a')]);var _0x222ca3={'where':_0x467da0['where']};return db[_0x06d8('0x3a')]['count'](_0x222ca3)[_0x06d8('0x1c')](function(_0xb714ec){_0x2e7a3e[_0x06d8('0x2e')]=_0xb714ec;if(_0x3cdc9a[_0x06d8('0x3d')][_0x06d8('0x4b')]){_0x467da0[_0x06d8('0x4c')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x06d8('0x4d')](_0x467da0);})[_0x06d8('0x1c')](function(_0x2cf3bb){_0x2e7a3e['rows']=_0x2cf3bb;return _0x2e7a3e;})[_0x06d8('0x1c')](respondWithFilteredResult(_0x568e35,_0x467da0))[_0x06d8('0x4e')](handleError(_0x568e35,null));};exports[_0x06d8('0x4f')]=function(_0x492fa6,_0x1e7dd5){var _0x3ef47e={'raw':!![],'where':{'id':_0x492fa6['params']['id']}},_0x212372={};_0x212372[_0x06d8('0x3c')]=_[_0x06d8('0x3e')](db['WhatsappMessage'][_0x06d8('0x50')]);_0x212372[_0x06d8('0x3d')]=_[_0x06d8('0x3e')](_0x492fa6[_0x06d8('0x3d')]);_0x212372[_0x06d8('0x47')]=_['intersection'](_0x212372[_0x06d8('0x3c')],_0x212372[_0x06d8('0x3d')]);_0x3ef47e[_0x06d8('0x41')]=_[_0x06d8('0x3f')](_0x212372[_0x06d8('0x3c')],qs[_0x06d8('0x40')](_0x492fa6['query']['fields']));_0x3ef47e['attributes']=_0x3ef47e[_0x06d8('0x41')][_0x06d8('0x42')]?_0x3ef47e[_0x06d8('0x41')]:_0x212372[_0x06d8('0x3c')];if(_0x492fa6[_0x06d8('0x3d')]['includeAll']){_0x3ef47e['include']=[{'all':!![]}];}_0x3ef47e=_['merge']({},_0x3ef47e,_0x492fa6[_0x06d8('0x4a')]);return db[_0x06d8('0x3a')][_0x06d8('0x51')](_0x3ef47e)[_0x06d8('0x1c')](handleEntityNotFound(_0x1e7dd5,null))[_0x06d8('0x1c')](respondWithResult(_0x1e7dd5,null))[_0x06d8('0x4e')](handleError(_0x1e7dd5,null));};exports[_0x06d8('0x52')]=function(_0x9d6231,_0x2b530a){return db[_0x06d8('0x3a')][_0x06d8('0x52')](_0x9d6231['body'],{})[_0x06d8('0x1c')](respondWithResult(_0x2b530a,0xc9))[_0x06d8('0x4e')](handleError(_0x2b530a,null));};exports[_0x06d8('0x53')]=function(_0xc7a2d3,_0x1a1d6d){if(_0xc7a2d3[_0x06d8('0x54')]['id']){delete _0xc7a2d3['body']['id'];}return db[_0x06d8('0x3a')][_0x06d8('0x51')]({'where':{'id':_0xc7a2d3[_0x06d8('0x55')]['id']}})[_0x06d8('0x1c')](handleEntityNotFound(_0x1a1d6d,null))['then'](saveUpdates(_0xc7a2d3[_0x06d8('0x54')],null))['then'](respondWithResult(_0x1a1d6d,null))['catch'](handleError(_0x1a1d6d,null));};exports[_0x06d8('0x34')]=function(_0x7a389,_0x28523a){return db['WhatsappMessage'][_0x06d8('0x51')]({'where':{'id':_0x7a389[_0x06d8('0x55')]['id']}})['then'](handleEntityNotFound(_0x28523a,null))[_0x06d8('0x1c')](removeEntity(_0x28523a,null))[_0x06d8('0x4e')](handleError(_0x28523a,null));};exports[_0x06d8('0x56')]=function(_0x4f6b4d,_0x13e540){return db[_0x06d8('0x3a')][_0x06d8('0x56')]()[_0x06d8('0x1c')](respondWithResult(_0x13e540,null))['catch'](handleError(_0x13e540,null));};var interaction_log=require(_0x06d8('0x57'))(_0x06d8('0x58'));exports[_0x06d8('0x59')]=function(_0x15d8eb,_0x5d1082,_0x17da8c){var _0x43e32e={'agent':{},'channel':_0x06d8('0x5a')};if(_0x15d8eb[_0x06d8('0x54')]['id']){delete _0x15d8eb['body']['id'];}_0x15d8eb[_0x06d8('0x54')][_0x06d8('0x5b')]=!![];_0x15d8eb['body'][_0x06d8('0x5c')]=moment()['format'](_0x06d8('0x5d'));_0x15d8eb['body']['UserId']=_0x15d8eb[_0x06d8('0x54')]['UserId']||_0x15d8eb[_0x06d8('0x5e')]['id'];_0x43e32e[_0x06d8('0x5f')]['id']=_0x15d8eb[_0x06d8('0x54')][_0x06d8('0x60')];return db['WhatsappMessage'][_0x06d8('0x51')]({'where':{'id':_0x15d8eb[_0x06d8('0x55')]['id'],'UserId':null}})[_0x06d8('0x1c')](handleEntityNotFound(_0x5d1082,null))[_0x06d8('0x1c')](saveUpdates(_0x15d8eb[_0x06d8('0x54')],null))[_0x06d8('0x1c')](function(_0x450708){if(_0x450708){_0x43e32e[_0x06d8('0x25')]=_0x450708[_0x06d8('0x61')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x450708[_0x06d8('0x62')]}});}return null;})[_0x06d8('0x1c')](handleEntityNotFound(_0x5d1082,null))[_0x06d8('0x1c')](function(_0x2830d4){if(_0x2830d4){return _0x2830d4[_0x06d8('0x53')]({'UserId':_0x15d8eb[_0x06d8('0x54')][_0x06d8('0x60')],'read1stAt':_[_0x06d8('0x63')](_0x2830d4[_0x06d8('0x64')])?moment()[_0x06d8('0x65')](_0x06d8('0x5d')):undefined});}return null;})['then'](function(_0x380fbe){if(_0x380fbe){_0x43e32e[_0x06d8('0x66')]=_0x380fbe[_0x06d8('0x61')]({'plain':!![]});interaction_log['info'](_0x06d8('0x67'),_0x15d8eb[_0x06d8('0x5e')]['id'],_0x15d8eb[_0x06d8('0x5e')][_0x06d8('0x36')],_0x15d8eb['user'][_0x06d8('0x68')],_0x43e32e[_0x06d8('0x66')]['id'],_0x15d8eb[_0x06d8('0x54')]?JSON[_0x06d8('0x22')](_0x15d8eb['body']):_0x06d8('0x69'));return respondWithRpcPromise(_0x06d8('0x6a'),'acceptMessage',_0x43e32e);}return null;})['then'](function(_0x3d88cd){var _0x177c6e=_0x06d8('0x6b')+_0x3d88cd['message'][_0x06d8('0x6c')];return db[_0x06d8('0x6d')]['query'](_0x177c6e,{'type':db[_0x06d8('0x6e')]['QueryTypes']['SELECT'],'raw':!![]})[_0x06d8('0x1c')](function(_0xbe6989){return _0xbe6989;});})[_0x06d8('0x1c')](function(_0x15b74e){if(_0x15b74e){_0x43e32e[_0x06d8('0x25')][_0x06d8('0x6f')]=_0x15b74e[0x0];if(!_0x15d8eb[_0x06d8('0x54')][_0x06d8('0x60')])return;return db[_0x06d8('0x70')][_0x06d8('0x51')]({'where':{'id':_0x15d8eb[_0x06d8('0x54')][_0x06d8('0x60')],'role':'agent'},'attributes':['id',_0x06d8('0x36'),_0x06d8('0x71'),_0x06d8('0x72'),_0x06d8('0x73')],'raw':!![]});}return null;})[_0x06d8('0x1c')](function(_0x59b4f2){if(!_0x59b4f2)return null;_0x43e32e[_0x06d8('0x25')][_0x06d8('0x5f')]=_0x59b4f2;return _0x43e32e;})[_0x06d8('0x1c')](function(_0x5dbdd){if(_0x5dbdd){if(_0x15d8eb['body'][_0x06d8('0x74')]){_0x43e32e['message'][_0x06d8('0x75')]=util[_0x06d8('0x65')](_0x06d8('0x76'),_0x15d8eb['user'][_0x06d8('0x36')]);_0x43e32e['message']['channel']=_0x43e32e[_0x06d8('0x77')];_0x43e32e['message'][_0x06d8('0x78')]=_0x43e32e['channel'];_0x43e32e[_0x06d8('0x25')][_0x06d8('0x79')]=_0x06d8('0x59');return respondWithRpcPromise(_0x06d8('0x7a'),_0x06d8('0x7a'),{'event':_0x06d8('0x7b'),'message':_0x43e32e[_0x06d8('0x25')]},client9002)[_0x06d8('0x1c')](function(){return _0x43e32e;});}return _0x43e32e;}return null;})[_0x06d8('0x1c')](respondWithResult(_0x5d1082,null))[_0x06d8('0x4e')](handleError(_0x5d1082,null));};var interaction_log=require(_0x06d8('0x57'))(_0x06d8('0x58'));exports[_0x06d8('0x32')]=function(_0x31748b,_0xb1975f,_0x5417f8){var _0x3ba214={'agent':{},'channel':_0x06d8('0x5a')};if(_0x31748b[_0x06d8('0x54')]['id']){delete _0x31748b[_0x06d8('0x54')]['id'];}_0x31748b['body'][_0x06d8('0x60')]=_0x31748b[_0x06d8('0x54')][_0x06d8('0x60')]||_0x31748b[_0x06d8('0x5e')]['id'];_0x3ba214[_0x06d8('0x5f')]['id']=_0x31748b['body']['UserId'];return db['WhatsappMessage']['find']({'where':{'id':_0x31748b[_0x06d8('0x55')]['id'],'UserId':null}})[_0x06d8('0x1c')](handleEntityNotFound(_0xb1975f,null))[_0x06d8('0x1c')](function(_0x540fae){if(_0x540fae){_0x3ba214['message']=_0x540fae[_0x06d8('0x61')]({'plain':!![]});return db[_0x06d8('0x7c')][_0x06d8('0x51')]({'where':{'id':_0x540fae['WhatsappInteractionId']}});}return null;})[_0x06d8('0x1c')](handleEntityNotFound(_0xb1975f,null))[_0x06d8('0x1c')](function(_0x30d6f2){if(_0x30d6f2){_0x3ba214['interaction']=_0x30d6f2[_0x06d8('0x61')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x31748b['user']['id'],_0x31748b[_0x06d8('0x5e')]['name'],_0x31748b[_0x06d8('0x5e')]['role'],_0x3ba214[_0x06d8('0x66')]['id'],_0x31748b[_0x06d8('0x54')]?JSON[_0x06d8('0x22')](_0x31748b[_0x06d8('0x54')]):_0x06d8('0x69'));return respondWithRpcPromise(_0x06d8('0x7d'),_0x06d8('0x7e'),_0x3ba214);}return null;})['then'](function(_0x763b33){var _0x8844f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x763b33[_0x06d8('0x25')][_0x06d8('0x6c')];return db[_0x06d8('0x6d')][_0x06d8('0x3d')](_0x8844f,{'type':db[_0x06d8('0x6e')][_0x06d8('0x7f')]['SELECT'],'raw':!![]})[_0x06d8('0x1c')](function(_0x362027){return _0x362027;});})['then'](function(_0x2aa10a){if(_0x2aa10a){_0x3ba214['message']['contact']=_0x2aa10a[0x0];if(!_0x31748b[_0x06d8('0x54')][_0x06d8('0x60')])return;return db[_0x06d8('0x70')][_0x06d8('0x51')]({'where':{'id':_0x31748b[_0x06d8('0x54')]['UserId'],'role':'agent'},'attributes':['id',_0x06d8('0x36'),_0x06d8('0x71'),_0x06d8('0x72'),_0x06d8('0x73')],'raw':!![]});}return null;})[_0x06d8('0x1c')](function(_0x12f229){if(!_0x12f229)return null;_0x3ba214[_0x06d8('0x25')][_0x06d8('0x5f')]=_0x12f229;return _0x3ba214;})[_0x06d8('0x1c')](function(_0x3fdf1a){if(_0x3fdf1a){_0x3fdf1a['message'][_0x06d8('0x75')]=util['format'](_0x06d8('0x76'),_0x31748b[_0x06d8('0x5e')][_0x06d8('0x36')]);_0x3fdf1a['message']['channel']=_0x3ba214['channel'];_0x3fdf1a[_0x06d8('0x25')][_0x06d8('0x78')]=_0x3ba214[_0x06d8('0x77')];_0x3fdf1a[_0x06d8('0x25')]['event']=_0x06d8('0x32');respondWithRpcPromise('EventManager',_0x06d8('0x7a'),{'event':_0x06d8('0x80'),'message':_0x3fdf1a[_0x06d8('0x25')]},client9002);return _0x3ba214;}return null;})[_0x06d8('0x1c')](respondWithResult(_0xb1975f,null))[_0x06d8('0x4e')](handleError(_0xb1975f,null));};exports[_0x06d8('0x28')]=function(_0xad45fe,_0x499a8b,_0x16254c){if(_0xad45fe[_0x06d8('0x54')]['id']){delete _0xad45fe[_0x06d8('0x54')]['id'];}var _0x4bd0af;return db['WhatsappMessage'][_0x06d8('0x51')]({'where':{'id':_0xad45fe['params']['id']}})[_0x06d8('0x1c')](handleEntityNotFound(_0x499a8b,null))[_0x06d8('0x1c')](function(_0xb8ddb5){if(_0xb8ddb5){_0x4bd0af=_0xb8ddb5;return db[_0x06d8('0x81')][_0x06d8('0x51')]({'where':{'id':_0xb8ddb5['WhatsappAccountId']}});}})[_0x06d8('0x1c')](handleEntityNotFound(_0x499a8b,null))['then'](function(_0xad146){if(_0xad146){logger[_0x06d8('0x20')](_0x06d8('0x82'),_0x06d8('0x28'),_0x06d8('0x83'),_0xad146['type'],util[_0x06d8('0x84')](_0xad45fe[_0x06d8('0x54')],{'showHidden':![],'depth':null}));switch(_0xad146[_0x06d8('0x3b')]){case _0x06d8('0x85'):if(_0xad45fe[_0x06d8('0x54')]['MessageSid']&&_0xad45fe[_0x06d8('0x54')][_0x06d8('0x86')]===_0x4bd0af[_0x06d8('0x87')]&&_0xad45fe[_0x06d8('0x54')][_0x06d8('0x88')]&&_0xad45fe['body'][_0x06d8('0x88')]===_0x06d8('0x5b')){return _0x4bd0af[_0x06d8('0x53')]({'read':!![]});}else{logger[_0x06d8('0x23')](_0x06d8('0x89'),_0x06d8('0x28'),_0x06d8('0x85'),util[_0x06d8('0x84')](_0xad45fe['body'],{'showHidden':![],'depth':null}));}break;}return _0x4bd0af;}})[_0x06d8('0x1c')](respondWithResult(_0x499a8b,null))[_0x06d8('0x4e')](handleError(_0x499a8b,null));}; \ No newline at end of file +var _0x31c3=['EventManager','acceptmessage','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','QueryTypes','User','email','interface','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','request','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','map','WhatsappMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','params','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteractionId','isNil','interaction','user','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','fullname','internal','manual','SIP/%s','channel','motionChannel','event'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x31c3,0x1b3));var _0x331c=function(_0x28a4f1,_0x2e2f7c){_0x28a4f1=_0x28a4f1-0x0;var _0x37bf29=_0x31c3[_0x28a4f1];return _0x37bf29;};'use strict';var emlformat=require(_0x331c('0x0'));var rimraf=require(_0x331c('0x1'));var zipdir=require(_0x331c('0x2'));var jsonpatch=require(_0x331c('0x3'));var rp=require(_0x331c('0x4'));var moment=require(_0x331c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x331c('0x6'));var util=require('util');var path=require(_0x331c('0x7'));var sox=require(_0x331c('0x8'));var csv=require('to-csv');var ejs=require(_0x331c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x331c('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x331c('0xb'));var toCsv=require(_0x331c('0xc'));var querystring=require('querystring');var Papa=require(_0x331c('0xd'));var Redis=require(_0x331c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x331c('0xf'));var as=require(_0x331c('0x10'));var hardwareService=require(_0x331c('0x11'));var logger=require(_0x331c('0x12'))(_0x331c('0x13'));var utils=require('../../config/utils');var config=require(_0x331c('0x14'));var licenseUtil=require(_0x331c('0x15'));var db=require(_0x331c('0x16'))['db'];config[_0x331c('0x17')]=_[_0x331c('0x18')](config['redis'],{'host':_0x331c('0x19'),'port':0x18eb});var socket=require(_0x331c('0x1a'))(new Redis(config[_0x331c('0x17')]));require(_0x331c('0x1b'))[_0x331c('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x331c('0x1d')][_0x331c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2ddae6,_0xa2c944,_0x4fa5ee,_0x11f7f3){return new BPromise(function(_0x4c8723,_0x4ea0a5){var _0x2ffa8e=_0x11f7f3||client;return _0x2ffa8e[_0x331c('0x1f')](_0x2ddae6,_0x4fa5ee)['then'](function(_0x59092d){logger['info'](_0x331c('0x20'),_0xa2c944,_0x331c('0x21'));logger[_0x331c('0x22')](_0x331c('0x23'),_0xa2c944,_0x331c('0x21'),JSON[_0x331c('0x24')](_0x59092d));if(_0x59092d[_0x331c('0x25')]){if(_0x59092d[_0x331c('0x25')][_0x331c('0x26')]===0x1f4){logger['error'](_0x331c('0x20'),_0xa2c944,_0x59092d[_0x331c('0x25')]['message']);return _0x4ea0a5(_0x59092d[_0x331c('0x25')]['message']);}logger[_0x331c('0x25')](_0x331c('0x20'),_0xa2c944,_0x59092d[_0x331c('0x25')][_0x331c('0x27')]);return _0x4c8723(_0x59092d[_0x331c('0x25')][_0x331c('0x27')]);}else{logger[_0x331c('0x28')](_0x331c('0x20'),_0xa2c944,_0x331c('0x21'));_0x4c8723(_0x59092d[_0x331c('0x29')][_0x331c('0x27')]);}})[_0x331c('0x2a')](function(_0xc82409){logger['error'](_0x331c('0x20'),_0xa2c944,_0xc82409);_0x4ea0a5(_0xc82409);});});}function respondWithStatusCode(_0x22e68b,_0x428fbb){_0x428fbb=_0x428fbb||0xcc;return function(_0x5d3c21){if(_0x5d3c21){return _0x22e68b[_0x331c('0x2b')](_0x428fbb);}return _0x22e68b['status'](_0x428fbb)[_0x331c('0x2c')]();};}function respondWithResult(_0x39fd28,_0x350f4c){_0x350f4c=_0x350f4c||0xc8;return function(_0x58bcad){if(_0x58bcad){return _0x39fd28['status'](_0x350f4c)[_0x331c('0x2d')](_0x58bcad);}};}function respondWithFilteredResult(_0x42cc9c,_0x1f6cf4){return function(_0x43ab0a){if(_0x43ab0a){var _0x107192=typeof _0x1f6cf4['offset']===_0x331c('0x2e')&&typeof _0x1f6cf4[_0x331c('0x2f')]===_0x331c('0x2e');var _0x1e7dca=_0x43ab0a[_0x331c('0x30')];var _0x552385=_0x107192?0x0:_0x1f6cf4[_0x331c('0x31')];var _0x45fcdf=_0x107192?_0x43ab0a['count']:_0x1f6cf4[_0x331c('0x31')]+_0x1f6cf4[_0x331c('0x2f')];var _0x278d83;if(_0x45fcdf>=_0x1e7dca){_0x45fcdf=_0x1e7dca;_0x278d83=0xc8;}else{_0x278d83=0xce;}_0x42cc9c[_0x331c('0x32')](_0x278d83);return _0x42cc9c[_0x331c('0x33')](_0x331c('0x34'),_0x552385+'-'+_0x45fcdf+'/'+_0x1e7dca)[_0x331c('0x2d')](_0x43ab0a);}return null;};}function patchUpdates(_0x562685){return function(_0xc838ea){try{jsonpatch[_0x331c('0x35')](_0xc838ea,_0x562685,!![]);}catch(_0x54cc5a){return BPromise[_0x331c('0x36')](_0x54cc5a);}return _0xc838ea[_0x331c('0x37')]();};}function saveUpdates(_0x59155b,_0x291ffe){return function(_0x57f6ae){if(_0x57f6ae){return _0x57f6ae[_0x331c('0x38')](_0x59155b)[_0x331c('0x39')](function(_0x3d37ce){return _0x3d37ce;});}return null;};}function removeEntity(_0x138c6a,_0x5dfcb3){return function(_0x260e6c){if(_0x260e6c){return _0x260e6c[_0x331c('0x3a')]()[_0x331c('0x39')](function(){_0x138c6a[_0x331c('0x32')](0xcc)[_0x331c('0x2c')]();});}};}function handleEntityNotFound(_0x434d94,_0x5b21b4){return function(_0x2eda19){if(!_0x2eda19){_0x434d94['sendStatus'](0x194);}return _0x2eda19;};}function handleError(_0xa16ccd,_0x447274){_0x447274=_0x447274||0x1f4;return function(_0x4b1d23){logger[_0x331c('0x25')](_0x4b1d23[_0x331c('0x3b')]);if(_0x4b1d23['name']){delete _0x4b1d23[_0x331c('0x3c')];}_0xa16ccd['status'](_0x447274)['send'](_0x4b1d23);};}exports['index']=function(_0x5f1dd2,_0x3496e7){var _0x2a5b2d={},_0x2912cc={},_0x52981d={'count':0x0,'rows':[]};var _0x1c2078=_[_0x331c('0x3d')](db[_0x331c('0x3e')][_0x331c('0x3f')],function(_0x471353){return{'name':_0x471353['fieldName'],'type':_0x471353['type']['key']};});_0x2912cc[_0x331c('0x40')]=_['map'](_0x1c2078,_0x331c('0x3c'));_0x2912cc['query']=_[_0x331c('0x41')](_0x5f1dd2[_0x331c('0x42')]);_0x2912cc[_0x331c('0x43')]=_[_0x331c('0x44')](_0x2912cc[_0x331c('0x40')],_0x2912cc['query']);_0x2a5b2d[_0x331c('0x45')]=_['intersection'](_0x2912cc['model'],qs[_0x331c('0x46')](_0x5f1dd2[_0x331c('0x42')][_0x331c('0x46')]));_0x2a5b2d[_0x331c('0x45')]=_0x2a5b2d['attributes'][_0x331c('0x47')]?_0x2a5b2d['attributes']:_0x2912cc[_0x331c('0x40')];if(!_0x5f1dd2[_0x331c('0x42')]['hasOwnProperty'](_0x331c('0x48'))){_0x2a5b2d['limit']=qs['limit'](_0x5f1dd2[_0x331c('0x42')][_0x331c('0x2f')]);_0x2a5b2d[_0x331c('0x31')]=qs['offset'](_0x5f1dd2['query'][_0x331c('0x31')]);}_0x2a5b2d[_0x331c('0x49')]=qs['sort'](_0x5f1dd2[_0x331c('0x42')][_0x331c('0x4a')]);_0x2a5b2d[_0x331c('0x4b')]=qs[_0x331c('0x43')](_[_0x331c('0x4c')](_0x5f1dd2[_0x331c('0x42')],_0x2912cc['filters']),_0x1c2078);if(_0x5f1dd2[_0x331c('0x42')][_0x331c('0x4d')]){_0x2a5b2d[_0x331c('0x4b')]=_['merge'](_0x2a5b2d[_0x331c('0x4b')],{'$or':_[_0x331c('0x3d')](_0x1c2078,function(_0x22be88){if(_0x22be88[_0x331c('0x4e')]!==_0x331c('0x4f')){var _0x11ade6={};_0x11ade6[_0x22be88[_0x331c('0x3c')]]={'$like':'%'+_0x5f1dd2[_0x331c('0x42')][_0x331c('0x4d')]+'%'};return _0x11ade6;}})});}_0x2a5b2d=_[_0x331c('0x50')]({},_0x2a5b2d,_0x5f1dd2[_0x331c('0x51')]);var _0x25d201={'where':_0x2a5b2d['where']};return db[_0x331c('0x3e')]['count'](_0x25d201)[_0x331c('0x39')](function(_0x4a84e5){_0x52981d['count']=_0x4a84e5;if(_0x5f1dd2[_0x331c('0x42')][_0x331c('0x52')]){_0x2a5b2d['include']=[{'all':!![]}];}return db[_0x331c('0x3e')][_0x331c('0x53')](_0x2a5b2d);})[_0x331c('0x39')](function(_0x28ba6c){_0x52981d[_0x331c('0x54')]=_0x28ba6c;return _0x52981d;})[_0x331c('0x39')](respondWithFilteredResult(_0x3496e7,_0x2a5b2d))[_0x331c('0x2a')](handleError(_0x3496e7,null));};exports['show']=function(_0x4ec102,_0x3b47ae){var _0x11fd73={'raw':!![],'where':{'id':_0x4ec102[_0x331c('0x55')]['id']}},_0x1d55dd={};_0x1d55dd[_0x331c('0x40')]=_[_0x331c('0x41')](db[_0x331c('0x3e')][_0x331c('0x3f')]);_0x1d55dd[_0x331c('0x42')]=_[_0x331c('0x41')](_0x4ec102[_0x331c('0x42')]);_0x1d55dd['filters']=_['intersection'](_0x1d55dd['model'],_0x1d55dd[_0x331c('0x42')]);_0x11fd73[_0x331c('0x45')]=_[_0x331c('0x44')](_0x1d55dd[_0x331c('0x40')],qs['fields'](_0x4ec102[_0x331c('0x42')][_0x331c('0x46')]));_0x11fd73[_0x331c('0x45')]=_0x11fd73['attributes'][_0x331c('0x47')]?_0x11fd73[_0x331c('0x45')]:_0x1d55dd[_0x331c('0x40')];if(_0x4ec102[_0x331c('0x42')][_0x331c('0x52')]){_0x11fd73['include']=[{'all':!![]}];}_0x11fd73=_[_0x331c('0x50')]({},_0x11fd73,_0x4ec102['options']);return db[_0x331c('0x3e')][_0x331c('0x56')](_0x11fd73)[_0x331c('0x39')](handleEntityNotFound(_0x3b47ae,null))['then'](respondWithResult(_0x3b47ae,null))[_0x331c('0x2a')](handleError(_0x3b47ae,null));};exports[_0x331c('0x57')]=function(_0x5c4d41,_0x3e952c){return db[_0x331c('0x3e')][_0x331c('0x57')](_0x5c4d41['body'],{})['then'](respondWithResult(_0x3e952c,0xc9))[_0x331c('0x2a')](handleError(_0x3e952c,null));};exports[_0x331c('0x38')]=function(_0x2b260d,_0x3d5f40){if(_0x2b260d[_0x331c('0x58')]['id']){delete _0x2b260d[_0x331c('0x58')]['id'];}return db['WhatsappMessage'][_0x331c('0x56')]({'where':{'id':_0x2b260d[_0x331c('0x55')]['id']}})[_0x331c('0x39')](handleEntityNotFound(_0x3d5f40,null))[_0x331c('0x39')](saveUpdates(_0x2b260d['body'],null))[_0x331c('0x39')](respondWithResult(_0x3d5f40,null))[_0x331c('0x2a')](handleError(_0x3d5f40,null));};exports[_0x331c('0x3a')]=function(_0x3dfb4b,_0x3d01ca){return db[_0x331c('0x3e')][_0x331c('0x56')]({'where':{'id':_0x3dfb4b['params']['id']}})[_0x331c('0x39')](handleEntityNotFound(_0x3d01ca,null))[_0x331c('0x39')](removeEntity(_0x3d01ca,null))['catch'](handleError(_0x3d01ca,null));};exports[_0x331c('0x59')]=function(_0x5c525a,_0x3b1d95){return db[_0x331c('0x3e')][_0x331c('0x59')]()[_0x331c('0x39')](respondWithResult(_0x3b1d95,null))[_0x331c('0x2a')](handleError(_0x3b1d95,null));};var interaction_log=require(_0x331c('0x12'))(_0x331c('0x5a'));exports[_0x331c('0x5b')]=function(_0x53e517,_0x50b07c,_0x357589){var _0x18afef={'agent':{},'channel':_0x331c('0x5c')};if(_0x53e517[_0x331c('0x58')]['id']){delete _0x53e517[_0x331c('0x58')]['id'];}_0x53e517[_0x331c('0x58')][_0x331c('0x5d')]=!![];_0x53e517['body'][_0x331c('0x5e')]=moment()[_0x331c('0x5f')](_0x331c('0x60'));_0x53e517[_0x331c('0x58')]['UserId']=_0x53e517[_0x331c('0x58')][_0x331c('0x61')]||_0x53e517['user']['id'];_0x18afef[_0x331c('0x62')]['id']=_0x53e517[_0x331c('0x58')][_0x331c('0x61')];return db['WhatsappMessage'][_0x331c('0x56')]({'where':{'id':_0x53e517[_0x331c('0x55')]['id'],'UserId':null}})[_0x331c('0x39')](handleEntityNotFound(_0x50b07c,null))[_0x331c('0x39')](saveUpdates(_0x53e517[_0x331c('0x58')],null))[_0x331c('0x39')](function(_0xfca8e){if(_0xfca8e){_0x18afef[_0x331c('0x27')]=_0xfca8e[_0x331c('0x63')]({'plain':!![]});return db['WhatsappInteraction'][_0x331c('0x56')]({'where':{'id':_0xfca8e[_0x331c('0x64')]}});}return null;})[_0x331c('0x39')](handleEntityNotFound(_0x50b07c,null))[_0x331c('0x39')](function(_0x4860f7){if(_0x4860f7){return _0x4860f7[_0x331c('0x38')]({'UserId':_0x53e517[_0x331c('0x58')][_0x331c('0x61')],'read1stAt':_[_0x331c('0x65')](_0x4860f7['read1stAt'])?moment()[_0x331c('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x3311fa){if(_0x3311fa){_0x18afef[_0x331c('0x66')]=_0x3311fa[_0x331c('0x63')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x53e517[_0x331c('0x67')]['id'],_0x53e517[_0x331c('0x67')][_0x331c('0x3c')],_0x53e517[_0x331c('0x67')]['role'],_0x18afef[_0x331c('0x66')]['id'],_0x53e517[_0x331c('0x58')]?JSON[_0x331c('0x24')](_0x53e517[_0x331c('0x58')]):'null');return respondWithRpcPromise('AcceptMessage',_0x331c('0x68'),_0x18afef);}return null;})[_0x331c('0x39')](function(_0x473619){var _0xd2edcb=_0x331c('0x69')+_0x473619['message'][_0x331c('0x6a')];return db['sequelize']['query'](_0xd2edcb,{'type':db[_0x331c('0x6b')]['QueryTypes'][_0x331c('0x6c')],'raw':!![]})[_0x331c('0x39')](function(_0x472701){return _0x472701;});})['then'](function(_0xdac51a){if(_0xdac51a){_0x18afef[_0x331c('0x27')][_0x331c('0x6d')]=_0xdac51a[0x0];if(!_0x53e517[_0x331c('0x58')]['UserId'])return;return db['User']['find']({'where':{'id':_0x53e517['body'][_0x331c('0x61')],'role':_0x331c('0x62')},'attributes':['id',_0x331c('0x3c'),_0x331c('0x6e'),'email',_0x331c('0x6f')],'raw':!![]});}return null;})[_0x331c('0x39')](function(_0x543ac4){if(!_0x543ac4)return null;_0x18afef[_0x331c('0x27')][_0x331c('0x62')]=_0x543ac4;return _0x18afef;})[_0x331c('0x39')](function(_0x252ae2){if(_0x252ae2){if(_0x53e517[_0x331c('0x58')][_0x331c('0x70')]){_0x18afef[_0x331c('0x27')]['interface']=util['format'](_0x331c('0x71'),_0x53e517['user']['name']);_0x18afef[_0x331c('0x27')]['channel']=_0x18afef[_0x331c('0x72')];_0x18afef[_0x331c('0x27')][_0x331c('0x73')]=_0x18afef[_0x331c('0x72')];_0x18afef[_0x331c('0x27')][_0x331c('0x74')]=_0x331c('0x5b');return respondWithRpcPromise(_0x331c('0x75'),'EventManager',{'event':_0x331c('0x76'),'message':_0x18afef[_0x331c('0x27')]},client9002)[_0x331c('0x39')](function(){return _0x18afef;});}return _0x18afef;}return null;})[_0x331c('0x39')](respondWithResult(_0x50b07c,null))[_0x331c('0x2a')](handleError(_0x50b07c,null));};var interaction_log=require(_0x331c('0x12'))(_0x331c('0x5a'));exports[_0x331c('0x36')]=function(_0x4d148f,_0x2924f7,_0x1fcde6){var _0xadd635={'agent':{},'channel':_0x331c('0x5c')};if(_0x4d148f['body']['id']){delete _0x4d148f[_0x331c('0x58')]['id'];}_0x4d148f[_0x331c('0x58')]['UserId']=_0x4d148f[_0x331c('0x58')]['UserId']||_0x4d148f[_0x331c('0x67')]['id'];_0xadd635[_0x331c('0x62')]['id']=_0x4d148f['body'][_0x331c('0x61')];return db[_0x331c('0x3e')][_0x331c('0x56')]({'where':{'id':_0x4d148f[_0x331c('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2924f7,null))['then'](function(_0xa7bf17){if(_0xa7bf17){_0xadd635['message']=_0xa7bf17[_0x331c('0x63')]({'plain':!![]});return db[_0x331c('0x77')]['find']({'where':{'id':_0xa7bf17[_0x331c('0x64')]}});}return null;})[_0x331c('0x39')](handleEntityNotFound(_0x2924f7,null))[_0x331c('0x39')](function(_0x28fa1a){if(_0x28fa1a){_0xadd635[_0x331c('0x66')]=_0x28fa1a['get']({'plain':!![]});interaction_log[_0x331c('0x28')](_0x331c('0x78'),_0x4d148f[_0x331c('0x67')]['id'],_0x4d148f['user']['name'],_0x4d148f[_0x331c('0x67')][_0x331c('0x79')],_0xadd635['interaction']['id'],_0x4d148f['body']?JSON[_0x331c('0x24')](_0x4d148f[_0x331c('0x58')]):_0x331c('0x7a'));return respondWithRpcPromise(_0x331c('0x7b'),'rejectMessage',_0xadd635);}return null;})['then'](function(_0x267529){var _0x1e9ea3=_0x331c('0x69')+_0x267529[_0x331c('0x27')][_0x331c('0x6a')];return db['sequelize'][_0x331c('0x42')](_0x1e9ea3,{'type':db['Sequelize'][_0x331c('0x7c')]['SELECT'],'raw':!![]})[_0x331c('0x39')](function(_0x110e3c){return _0x110e3c;});})[_0x331c('0x39')](function(_0x1d1308){if(_0x1d1308){_0xadd635[_0x331c('0x27')][_0x331c('0x6d')]=_0x1d1308[0x0];if(!_0x4d148f[_0x331c('0x58')][_0x331c('0x61')])return;return db[_0x331c('0x7d')][_0x331c('0x56')]({'where':{'id':_0x4d148f[_0x331c('0x58')][_0x331c('0x61')],'role':_0x331c('0x62')},'attributes':['id',_0x331c('0x3c'),'fullname',_0x331c('0x7e'),_0x331c('0x6f')],'raw':!![]});}return null;})[_0x331c('0x39')](function(_0x51d200){if(!_0x51d200)return null;_0xadd635['message'][_0x331c('0x62')]=_0x51d200;return _0xadd635;})['then'](function(_0x115209){if(_0x115209){_0x115209['message'][_0x331c('0x7f')]=util['format']('SIP/%s',_0x4d148f[_0x331c('0x67')][_0x331c('0x3c')]);_0x115209[_0x331c('0x27')][_0x331c('0x72')]=_0xadd635[_0x331c('0x72')];_0x115209[_0x331c('0x27')]['motionChannel']=_0xadd635[_0x331c('0x72')];_0x115209[_0x331c('0x27')][_0x331c('0x74')]=_0x331c('0x36');respondWithRpcPromise('EventManager',_0x331c('0x75'),{'event':_0x331c('0x80'),'message':_0x115209[_0x331c('0x27')]},client9002);return _0xadd635;}return null;})[_0x331c('0x39')](respondWithResult(_0x2924f7,null))[_0x331c('0x2a')](handleError(_0x2924f7,null));};exports[_0x331c('0x32')]=function(_0x5a7f9a,_0x34f3d3,_0x400fa1){if(_0x5a7f9a[_0x331c('0x58')]['id']){delete _0x5a7f9a[_0x331c('0x58')]['id'];}var _0xf55b64;return db['WhatsappMessage'][_0x331c('0x56')]({'where':{'id':_0x5a7f9a[_0x331c('0x55')]['id']}})['then'](handleEntityNotFound(_0x34f3d3,null))['then'](function(_0x2e221d){if(_0x2e221d){_0xf55b64=_0x2e221d;return db[_0x331c('0x81')][_0x331c('0x56')]({'where':{'id':_0x2e221d['WhatsappAccountId']}});}})[_0x331c('0x39')](handleEntityNotFound(_0x34f3d3,null))[_0x331c('0x39')](function(_0x22476e){if(_0x22476e){logger[_0x331c('0x22')](_0x331c('0x82'),_0x331c('0x32'),_0x331c('0x83'),_0x22476e['type'],util[_0x331c('0x84')](_0x5a7f9a[_0x331c('0x58')],{'showHidden':![],'depth':null}));switch(_0x22476e['type']){case _0x331c('0x85'):if(_0x5a7f9a[_0x331c('0x58')][_0x331c('0x86')]&&_0x5a7f9a[_0x331c('0x58')][_0x331c('0x86')]===_0xf55b64[_0x331c('0x87')]&&_0x5a7f9a[_0x331c('0x58')][_0x331c('0x88')]&&_0x5a7f9a[_0x331c('0x58')][_0x331c('0x88')]===_0x331c('0x5d')){return _0xf55b64[_0x331c('0x38')]({'read':!![]});}else{logger[_0x331c('0x25')](_0x331c('0x89'),_0x331c('0x32'),_0x331c('0x85'),util[_0x331c('0x84')](_0x5a7f9a[_0x331c('0x58')],{'showHidden':![],'depth':null}));}break;}return _0xf55b64;}})['then'](respondWithResult(_0x34f3d3,null))['catch'](handleError(_0x34f3d3,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 460c33f..ea4c225 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 _0xa478=['hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x30780d,_0xd0e29f){var _0x170b26=function(_0xd04147){while(--_0xd04147){_0x30780d['push'](_0x30780d['shift']());}};_0x170b26(++_0xd0e29f);}(_0xa478,0x136));var _0x8a47=function(_0x596c43,_0x28647a){_0x596c43=_0x596c43-0x0;var _0x4e1315=_0xa478[_0x596c43];return _0x4e1315;};'use strict';var EventEmitter=require(_0x8a47('0x0'));var WhatsappMessage=require(_0x8a47('0x1'))['db'][_0x8a47('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x8a47('0x3')](0x0);var events={'afterCreate':_0x8a47('0x4'),'afterUpdate':_0x8a47('0x5'),'afterDestroy':_0x8a47('0x6')};function emitEvent(_0x37a882){return function(_0x2b3110,_0x256550,_0x6e2ab5){WhatsappMessageEvents[_0x8a47('0x7')](_0x37a882+':'+_0x2b3110['id'],_0x2b3110);WhatsappMessageEvents['emit'](_0x37a882,_0x2b3110);_0x6e2ab5(null);};}for(var e in events){if(events[_0x8a47('0x8')](e)){var event=events[e];WhatsappMessage[_0x8a47('0x9')](e,emitEvent(event));}}module[_0x8a47('0xa')]=WhatsappMessageEvents; \ No newline at end of file +var _0x13f6=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x42a716,_0x52aaaf){var _0x534d7a=function(_0x354cf9){while(--_0x354cf9){_0x42a716['push'](_0x42a716['shift']());}};_0x534d7a(++_0x52aaaf);}(_0x13f6,0x124));var _0x613f=function(_0x2a518f,_0x3fff40){_0x2a518f=_0x2a518f-0x0;var _0xb1d1f8=_0x13f6[_0x2a518f];return _0xb1d1f8;};'use strict';var EventEmitter=require(_0x613f('0x0'));var WhatsappMessage=require(_0x613f('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x613f('0x2'),'afterUpdate':_0x613f('0x3'),'afterDestroy':_0x613f('0x4')};function emitEvent(_0x5414ff){return function(_0x179f6e,_0x1e01e3,_0x20af2f){WhatsappMessageEvents['emit'](_0x5414ff+':'+_0x179f6e['id'],_0x179f6e);WhatsappMessageEvents[_0x613f('0x5')](_0x5414ff,_0x179f6e);_0x20af2f(null);};}for(var e in events){if(events[_0x613f('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 52e44c9..a1e4434 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 _0xdada=['then','update','createdAt','catch','error','out','WhatsappAccount','find','WhatsappAccountId','type','accountSid','phone','authToken','create','body','whatsapp:','remote','/status?token=','token','sid','afterCreate','twilio','WhatsappMessage,\x20%s,\x20%s,\x20%s','sinch','baseUrl','/messages/','text','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','node-fetch','rimraf','./whatsappMessage.attributes','define','whatsapp_messages','messageId','fti_whatsapp_messages','get','direction','toLowerCase','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdada,0x1a2));var _0xadad=function(_0x5ae4fc,_0xb953b3){_0x5ae4fc=_0x5ae4fc-0x0;var _0x44fdae=_0xdada[_0x5ae4fc];return _0x44fdae;};'use strict';var _=require(_0xadad('0x0'));var util=require(_0xadad('0x1'));var logger=require(_0xadad('0x2'))('api');var moment=require(_0xadad('0x3'));var BPromise=require(_0xadad('0x4'));var rp=require(_0xadad('0x5'));var fetch=require(_0xadad('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xadad('0x7'));var config=require('../../config/environment');var attributes=require(_0xadad('0x8'));module['exports']=function(_0xaf273,_0x2ab0f4){return _0xaf273[_0xadad('0x9')]('WhatsappMessage',attributes,{'tableName':_0xadad('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xadad('0xb')]},{'name':_0xadad('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a8ff7,_0x228cb8,_0x3fc077){var _0x3663ea=_0xaf273['models'];var _0x33a940=_0x2a8ff7[_0xadad('0xd')]({'plain':!![]});if(_0x33a940[_0xadad('0xe')][_0xadad('0xf')]()==='in'||_0x33a940[_0xadad('0xe')][_0xadad('0xf')]()==='out'&&!_0x33a940[_0xadad('0x10')]&&!_[_0xadad('0x11')](_0x33a940[_0xadad('0x12')])){_0x3663ea[_0xadad('0x13')][_0xadad('0x14')]({'where':{'id':_0x33a940[_0xadad('0x15')]}})[_0xadad('0x16')](function(_0x29c742){if(_0x29c742){_0x29c742[_0xadad('0x17')]({'lastMsgAt':_0x33a940[_0xadad('0x18')],'lastMsgDirection':_0x33a940[_0xadad('0xe')]['toLowerCase']()});}})[_0xadad('0x19')](function(_0x228322){console[_0xadad('0x1a')](_0x228322);});}if(_0x33a940[_0xadad('0xe')]===_0xadad('0x1b')&&!_0x33a940['secret']){var _0x515eef;_0x3663ea[_0xadad('0x1c')][_0xadad('0x1d')]({'where':{'id':_0x33a940[_0xadad('0x1e')]},'raw':!![]})[_0xadad('0x16')](function(_0x1098cf){_0x515eef=_0x1098cf;if(_0x515eef&&_0x515eef[_0xadad('0x1f')]){switch(_0x515eef[_0xadad('0x1f')]){case'twilio':var _0x34961e=require('twilio');if(_0x515eef[_0xadad('0x20')]&&_0x515eef['authToken']&&_0x515eef[_0xadad('0x21')]){var _0x15f959=new _0x34961e(_0x515eef[_0xadad('0x20')],_0x515eef[_0xadad('0x22')]);_0x15f959['messages'][_0xadad('0x23')]({'body':_0x33a940[_0xadad('0x24')],'to':_0xadad('0x25')+_0x33a940[_0xadad('0x21')],'from':_0xadad('0x25')+_0x515eef[_0xadad('0x21')],'statusCallback':_0x515eef[_0xadad('0x26')]+'/api/whatsapp/messages/'+_0x33a940['id']+_0xadad('0x27')+_0x515eef[_0xadad('0x28')]})['then'](function(_0x1600f0){if(_0x1600f0[_0xadad('0x29')]){return _0x2a8ff7['update']({'messageId':_0x1600f0['sid']});}})['catch'](function(_0x2ebb9a){logger[_0xadad('0x1a')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xadad('0x2a'),_0xadad('0x2b'),util['inspect'](_0x2ebb9a,{'showHidden':![],'depth':null}));});}else{logger[_0xadad('0x1a')](_0xadad('0x2c'),_0xadad('0x2a'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xadad('0x2d'):var _0x2ee8e1=_0x515eef[_0xadad('0x20')];var _0x405226=_0x515eef[_0xadad('0x22')];var _0x5c8659=_0x515eef[_0xadad('0x2e')]+'/whatsapp/v1/'+_0x2ee8e1+_0xadad('0x2f');var _0x28a8ea={'to':[_0x33a940[_0xadad('0x21')]],'message':{'type':_0xadad('0x30'),'text':_0x33a940[_0xadad('0x24')]}};var _0x45ba96={'method':'POST','uri':_0x5c8659,'headers':{'Authorization':'Bearer\x20'+_0x405226,'Content-Type':'application/json'},'body':_0x28a8ea,'json':!![]};rp(_0x45ba96)[_0xadad('0x16')](function(_0x589e57){if(_0x589e57['statuses'][0x0]['message_id']){return _0x2a8ff7[_0xadad('0x17')]({'messageId':_0x589e57[_0xadad('0x31')][0x0]['message_id']});}})[_0xadad('0x19')](function(_0x27a545){logger[_0xadad('0x32')](_0xadad('0x33'),_0x27a545);});break;}}})[_0xadad('0x34')](function(){_0x3fc077();});}else{_0x3fc077();}}},'charset':_0xadad('0x35'),'collate':_0xadad('0x36')});}; \ No newline at end of file +var _0xe06c=['direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','error','WhatsappAccount','find','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','Bearer\x20','application/json','message_id','err','finally','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','node-fetch','path','rimraf','./whatsappMessage.attributes','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe06c,0x99));var _0xce06=function(_0x59d12e,_0x1128ff){_0x59d12e=_0x59d12e-0x0;var _0x2f5ee4=_0xe06c[_0x59d12e];return _0x2f5ee4;};'use strict';var _=require(_0xce06('0x0'));var util=require(_0xce06('0x1'));var logger=require(_0xce06('0x2'))(_0xce06('0x3'));var moment=require(_0xce06('0x4'));var BPromise=require('bluebird');var rp=require(_0xce06('0x5'));var fetch=require(_0xce06('0x6'));var fs=require('fs');var path=require(_0xce06('0x7'));var rimraf=require(_0xce06('0x8'));var config=require('../../config/environment');var attributes=require(_0xce06('0x9'));module['exports']=function(_0x307f23,_0x33c19f){return _0x307f23[_0xce06('0xa')](_0xce06('0xb'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xce06('0xc')]},{'name':_0xce06('0xd'),'fields':[_0xce06('0xe')],'type':_0xce06('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x586128,_0x329c16,_0x3b76ad){var _0x5ba3f8=_0x307f23[_0xce06('0x10')];var _0x38695a=_0x586128[_0xce06('0x11')]({'plain':!![]});if(_0x38695a[_0xce06('0x12')]['toLowerCase']()==='in'||_0x38695a[_0xce06('0x12')][_0xce06('0x13')]()===_0xce06('0x14')&&!_0x38695a[_0xce06('0x15')]&&!_[_0xce06('0x16')](_0x38695a[_0xce06('0x17')])){_0x5ba3f8[_0xce06('0x18')][_0xce06('0x19')]({'where':{'id':_0x38695a[_0xce06('0x1a')]}})[_0xce06('0x1b')](function(_0x16bdf5){if(_0x16bdf5){_0x16bdf5[_0xce06('0x1c')]({'lastMsgAt':_0x38695a['createdAt'],'lastMsgDirection':_0x38695a[_0xce06('0x12')][_0xce06('0x13')]()});}})['catch'](function(_0x30328f){console[_0xce06('0x1d')](_0x30328f);});}if(_0x38695a[_0xce06('0x12')]===_0xce06('0x14')&&!_0x38695a[_0xce06('0x15')]){var _0x32cea0;_0x5ba3f8[_0xce06('0x1e')][_0xce06('0x1f')]({'where':{'id':_0x38695a['WhatsappAccountId']},'raw':!![]})[_0xce06('0x1b')](function(_0x343a7f){_0x32cea0=_0x343a7f;if(_0x32cea0&&_0x32cea0[_0xce06('0x20')]){switch(_0x32cea0[_0xce06('0x20')]){case _0xce06('0x21'):var _0x3c9036=require(_0xce06('0x21'));if(_0x32cea0[_0xce06('0x22')]&&_0x32cea0[_0xce06('0x23')]&&_0x32cea0[_0xce06('0x24')]){var _0x5a6c46=new _0x3c9036(_0x32cea0['accountSid'],_0x32cea0[_0xce06('0x23')]);_0x5a6c46[_0xce06('0x25')][_0xce06('0x26')]({'body':_0x38695a[_0xce06('0xe')],'to':'whatsapp:'+_0x38695a[_0xce06('0x24')],'from':_0xce06('0x27')+_0x32cea0[_0xce06('0x24')],'statusCallback':_0x32cea0[_0xce06('0x28')]+_0xce06('0x29')+_0x38695a['id']+_0xce06('0x2a')+_0x32cea0['token']})[_0xce06('0x1b')](function(_0x45e817){if(_0x45e817[_0xce06('0x2b')]){return _0x586128[_0xce06('0x1c')]({'messageId':_0x45e817['sid']});}})[_0xce06('0x2c')](function(_0x242804){logger['error'](_0xce06('0x2d'),_0xce06('0x2e'),_0xce06('0x21'),util['inspect'](_0x242804,{'showHidden':![],'depth':null}));});}else{logger[_0xce06('0x1d')](_0xce06('0x2d'),_0xce06('0x2e'),'twilio',_0xce06('0x2f'));}break;case _0xce06('0x30'):var _0x409aa1=_0x32cea0[_0xce06('0x22')];var _0x46e3c5=_0x32cea0['authToken'];var _0xd2b2ee=_0x32cea0['baseUrl']+_0xce06('0x31')+_0x409aa1+_0xce06('0x32');var _0xee859b={'to':[_0x38695a[_0xce06('0x24')]],'message':{'type':'text','text':_0x38695a[_0xce06('0xe')]}};var _0x4bccbe={'method':'POST','uri':_0xd2b2ee,'headers':{'Authorization':_0xce06('0x33')+_0x46e3c5,'Content-Type':_0xce06('0x34')},'body':_0xee859b,'json':!![]};rp(_0x4bccbe)[_0xce06('0x1b')](function(_0x49e068){if(_0x49e068['statuses'][0x0][_0xce06('0x35')]){return _0x586128[_0xce06('0x1c')]({'messageId':_0x49e068['statuses'][0x0][_0xce06('0x35')]});}})[_0xce06('0x2c')](function(_0x33c133){logger[_0xce06('0x36')]('WhatsappMessage,\x20%s',_0x33c133);});break;}}})[_0xce06('0x37')](function(){_0x3b76ad();});}else{_0x3b76ad();}}},'charset':_0xce06('0x38'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index d9e6694..96308c6 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 _0xc570=['rpc','jayson/promise','client','redis','defaults','localhost','./whatsappMessage.socket','register','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x24a66a,_0xba9d6f){var _0x19a92e=function(_0xeb083a){while(--_0xeb083a){_0x24a66a['push'](_0x24a66a['shift']());}};_0x19a92e(++_0xba9d6f);}(_0xc570,0x179));var _0x0c57=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xc570[_0x28947d];return _0x12d2ee;};'use strict';var _=require('lodash');var util=require(_0x0c57('0x0'));var moment=require(_0x0c57('0x1'));var BPromise=require(_0x0c57('0x2'));var rs=require(_0x0c57('0x3'));var fs=require('fs');var Redis=require(_0x0c57('0x4'));var db=require(_0x0c57('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c57('0x6'))(_0x0c57('0x7'));var config=require('../../config/environment');var jayson=require(_0x0c57('0x8'));var client=jayson[_0x0c57('0x9')]['http']({'port':0x232a});config[_0x0c57('0xa')]=_[_0x0c57('0xb')](config[_0x0c57('0xa')],{'host':_0x0c57('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0c57('0xa')]));require(_0x0c57('0xd'))[_0x0c57('0xe')](socket);function respondWithRpcPromise(_0x319291,_0x50378b,_0x3ee5d7){return new BPromise(function(_0x3b0355,_0x4c8868){return client['request'](_0x319291,_0x3ee5d7)['then'](function(_0x23e949){logger[_0x0c57('0xf')](_0x0c57('0x10'),_0x50378b,_0x0c57('0x11'));logger[_0x0c57('0x12')](_0x0c57('0x13'),_0x50378b,_0x0c57('0x11'),JSON[_0x0c57('0x14')](_0x23e949));if(_0x23e949[_0x0c57('0x15')]){if(_0x23e949[_0x0c57('0x15')]['code']===0x1f4){logger[_0x0c57('0x15')](_0x0c57('0x10'),_0x50378b,_0x23e949[_0x0c57('0x15')][_0x0c57('0x16')]);return _0x4c8868(_0x23e949['error'][_0x0c57('0x16')]);}logger[_0x0c57('0x15')](_0x0c57('0x10'),_0x50378b,_0x23e949[_0x0c57('0x15')]['message']);return _0x3b0355(_0x23e949[_0x0c57('0x15')]['message']);}else{logger[_0x0c57('0xf')](_0x0c57('0x10'),_0x50378b,_0x0c57('0x11'));_0x3b0355(_0x23e949[_0x0c57('0x17')][_0x0c57('0x16')]);}})[_0x0c57('0x18')](function(_0x1b2dfa){logger[_0x0c57('0x15')](_0x0c57('0x10'),_0x50378b,_0x1b2dfa);_0x4c8868(_0x1b2dfa);});});}exports[_0x0c57('0x19')]=function(_0x563737){var _0x390900=this;return new Promise(function(_0x107818,_0x4b9f66){return db[_0x0c57('0x1a')][_0x0c57('0x1b')](_0x563737[_0x0c57('0x1c')],{'raw':_0x563737[_0x0c57('0x1d')]?_0x563737[_0x0c57('0x1d')][_0x0c57('0x1e')]===undefined?!![]:![]:!![]})[_0x0c57('0x1f')](function(_0x3835ae){logger[_0x0c57('0xf')](_0x0c57('0x19'),_0x563737);logger[_0x0c57('0x12')](_0x0c57('0x19'),_0x563737,JSON['stringify'](_0x3835ae));_0x107818(_0x3835ae);})[_0x0c57('0x18')](function(_0x4a8eaf){logger[_0x0c57('0x15')]('CreateWhatsappMessage',_0x4a8eaf[_0x0c57('0x16')],_0x563737);_0x4b9f66(_0x390900[_0x0c57('0x15')](0x1f4,_0x4a8eaf[_0x0c57('0x16')]));});});}; \ No newline at end of file +var _0x130a=['client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','debug','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x309bf6,_0x143ad7){var _0x57ac26=function(_0x275138){while(--_0x275138){_0x309bf6['push'](_0x309bf6['shift']());}};_0x57ac26(++_0x143ad7);}(_0x130a,0x89));var _0xa130=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x130a[_0x213518];return _0x1baf75;};'use strict';var _=require(_0xa130('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa130('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa130('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa130('0x3'));var logger=require(_0xa130('0x4'))(_0xa130('0x5'));var config=require(_0xa130('0x6'));var jayson=require(_0xa130('0x7'));var client=jayson[_0xa130('0x8')][_0xa130('0x9')]({'port':0x232a});config[_0xa130('0xa')]=_[_0xa130('0xb')](config[_0xa130('0xa')],{'host':_0xa130('0xc'),'port':0x18eb});var socket=require(_0xa130('0xd'))(new Redis(config[_0xa130('0xa')]));require(_0xa130('0xe'))[_0xa130('0xf')](socket);function respondWithRpcPromise(_0x3e5512,_0x30e9c3,_0x53c769){return new BPromise(function(_0x53a5d3,_0x4661ba){return client['request'](_0x3e5512,_0x53c769)[_0xa130('0x10')](function(_0x220b54){logger['info'](_0xa130('0x11'),_0x30e9c3,'request\x20sent');logger['debug'](_0xa130('0x12'),_0x30e9c3,'request\x20sent',JSON[_0xa130('0x13')](_0x220b54));if(_0x220b54[_0xa130('0x14')]){if(_0x220b54[_0xa130('0x14')]['code']===0x1f4){logger[_0xa130('0x14')](_0xa130('0x11'),_0x30e9c3,_0x220b54[_0xa130('0x14')][_0xa130('0x15')]);return _0x4661ba(_0x220b54[_0xa130('0x14')][_0xa130('0x15')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x30e9c3,_0x220b54[_0xa130('0x14')][_0xa130('0x15')]);return _0x53a5d3(_0x220b54[_0xa130('0x14')][_0xa130('0x15')]);}else{logger['info'](_0xa130('0x11'),_0x30e9c3,'request\x20sent');_0x53a5d3(_0x220b54[_0xa130('0x16')][_0xa130('0x15')]);}})[_0xa130('0x17')](function(_0x36c1d5){logger[_0xa130('0x14')](_0xa130('0x11'),_0x30e9c3,_0x36c1d5);_0x4661ba(_0x36c1d5);});});}exports[_0xa130('0x18')]=function(_0x3e9cc7){var _0x3cb0d6=this;return new Promise(function(_0x2c0f45,_0x2ea8cd){return db[_0xa130('0x19')][_0xa130('0x1a')](_0x3e9cc7['body'],{'raw':_0x3e9cc7[_0xa130('0x1b')]?_0x3e9cc7['options']['raw']===undefined?!![]:![]:!![]})[_0xa130('0x10')](function(_0x15a3f0){logger['info']('CreateWhatsappMessage',_0x3e9cc7);logger[_0xa130('0x1c')](_0xa130('0x18'),_0x3e9cc7,JSON[_0xa130('0x13')](_0x15a3f0));_0x2c0f45(_0x15a3f0);})[_0xa130('0x17')](function(_0x2f92da){logger['error'](_0xa130('0x18'),_0x2f92da[_0xa130('0x15')],_0x3e9cc7);_0x2ea8cd(_0x3cb0d6['error'](0x1f4,_0x2f92da[_0xa130('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 1316513..8bb8576 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 _0x7de7=['save','remove','update','removeListener','register','whatsappMessage:','./whatsappMessage.events'];(function(_0xe65ac8,_0x2691be){var _0x202ba1=function(_0x4af6ff){while(--_0x4af6ff){_0xe65ac8['push'](_0xe65ac8['shift']());}};_0x202ba1(++_0x2691be);}(_0x7de7,0x1db));var _0x77de=function(_0x37a7c6,_0x3a84b6){_0x37a7c6=_0x37a7c6-0x0;var _0x539905=_0x7de7[_0x37a7c6];return _0x539905;};'use strict';var WhatsappMessageEvents=require(_0x77de('0x0'));var events=[_0x77de('0x1'),_0x77de('0x2'),_0x77de('0x3')];function createListener(_0x587cb1,_0x5e91be){return function(_0x110840){_0x5e91be['emit'](_0x587cb1,_0x110840);};}function removeListener(_0x2967a4,_0x57e976){return function(){WhatsappMessageEvents[_0x77de('0x4')](_0x2967a4,_0x57e976);};}exports[_0x77de('0x5')]=function(_0x13a3fb){for(var _0x1c0730=0x0,_0x599079=events['length'];_0x1c0730<_0x599079;_0x1c0730++){var _0x5828dd=events[_0x1c0730];var _0x532e8d=createListener(_0x77de('0x6')+_0x5828dd,_0x13a3fb);WhatsappMessageEvents['on'](_0x5828dd,_0x532e8d);}}; \ No newline at end of file +var _0x2baa=['removeListener','length','whatsappMessage:','./whatsappMessage.events','save','remove','update','emit'];(function(_0x14877f,_0x38d519){var _0x3b7d1b=function(_0x18faca){while(--_0x18faca){_0x14877f['push'](_0x14877f['shift']());}};_0x3b7d1b(++_0x38d519);}(_0x2baa,0xb3));var _0xa2ba=function(_0x478686,_0x5423a8){_0x478686=_0x478686-0x0;var _0x5f3263=_0x2baa[_0x478686];return _0x5f3263;};'use strict';var WhatsappMessageEvents=require(_0xa2ba('0x0'));var events=[_0xa2ba('0x1'),_0xa2ba('0x2'),_0xa2ba('0x3')];function createListener(_0x17c6b7,_0x49acc5){return function(_0x50a625){_0x49acc5[_0xa2ba('0x4')](_0x17c6b7,_0x50a625);};}function removeListener(_0x45826b,_0x95233c){return function(){WhatsappMessageEvents[_0xa2ba('0x5')](_0x45826b,_0x95233c);};}exports['register']=function(_0x10ab1b){for(var _0x21fa29=0x0,_0x535b93=events[_0xa2ba('0x6')];_0x21fa29<_0x535b93;_0x21fa29++){var _0xe14db2=events[_0x21fa29];var _0xa49225=createListener(_0xa2ba('0x7')+_0xe14db2,_0x10ab1b);WhatsappMessageEvents['on'](_0xe14db2,_0xa49225);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 1c64f0f..af63f14 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 _0x0e10=['/:id/users','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','addTeams'];(function(_0x31c0c5,_0x81af2f){var _0xe40826=function(_0x9448f){while(--_0x9448f){_0x31c0c5['push'](_0x31c0c5['shift']());}};_0xe40826(++_0x81af2f);}(_0x0e10,0x7c));var _0x00e1=function(_0x114dc6,_0x4a4718){_0x114dc6=_0x114dc6-0x0;var _0x369c5f=_0x0e10[_0x114dc6];return _0x369c5f;};'use strict';var multer=require(_0x00e1('0x0'));var util=require(_0x00e1('0x1'));var path=require('path');var timeout=require(_0x00e1('0x2'));var express=require(_0x00e1('0x3'));var router=express[_0x00e1('0x4')]();var fs_extra=require(_0x00e1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x00e1('0x6'));var config=require('../../config/environment');var controller=require(_0x00e1('0x7'));router[_0x00e1('0x8')]('/',auth[_0x00e1('0x9')](),controller[_0x00e1('0xa')]);router[_0x00e1('0x8')](_0x00e1('0xb'),auth[_0x00e1('0x9')](),controller[_0x00e1('0xc')]);router[_0x00e1('0x8')](_0x00e1('0xd'),auth[_0x00e1('0x9')](),controller[_0x00e1('0xe')]);router['get'](_0x00e1('0xf'),auth[_0x00e1('0x9')](),controller[_0x00e1('0x10')]);router[_0x00e1('0x8')](_0x00e1('0x11'),auth[_0x00e1('0x9')](),controller[_0x00e1('0x12')]);router['get']('/:id/users',auth[_0x00e1('0x9')](),controller[_0x00e1('0x13')]);router['post']('/',auth[_0x00e1('0x9')](),controller['create']);router['post'](_0x00e1('0x11'),auth['isAuthenticated'](),controller[_0x00e1('0x14')]);router['post'](_0x00e1('0x15'),auth[_0x00e1('0x9')](),controller[_0x00e1('0x16')]);router[_0x00e1('0x17')](_0x00e1('0xd'),auth['isAuthenticated'](),controller[_0x00e1('0x18')]);router[_0x00e1('0x19')]('/:id',auth[_0x00e1('0x9')](),controller[_0x00e1('0x1a')]);router[_0x00e1('0x19')](_0x00e1('0x11'),auth[_0x00e1('0x9')](),controller[_0x00e1('0x1b')]);router[_0x00e1('0x19')](_0x00e1('0x15'),auth[_0x00e1('0x9')](),controller['removeAgents']);module[_0x00e1('0x1c')]=router; \ No newline at end of file +var _0xe321=['show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','addTeams','post','put','/:id','delete','removeTeams','exports','util','path','connect-timeout','fs-extra','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x39ad08,_0x464868){var _0x35eed6=function(_0x1c8e4b){while(--_0x1c8e4b){_0x39ad08['push'](_0x39ad08['shift']());}};_0x35eed6(++_0x464868);}(_0xe321,0x194));var _0x1e32=function(_0x38025e,_0x4e6a39){_0x38025e=_0x38025e-0x0;var _0x234e22=_0xe321[_0x38025e];return _0x234e22;};'use strict';var multer=require('multer');var util=require(_0x1e32('0x0'));var path=require(_0x1e32('0x1'));var timeout=require(_0x1e32('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1e32('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1e32('0x4'));var controller=require(_0x1e32('0x5'));router[_0x1e32('0x6')]('/',auth[_0x1e32('0x7')](),controller[_0x1e32('0x8')]);router[_0x1e32('0x6')](_0x1e32('0x9'),auth[_0x1e32('0x7')](),controller['describe']);router[_0x1e32('0x6')]('/:id',auth[_0x1e32('0x7')](),controller[_0x1e32('0xa')]);router['get']('/:id/members',auth[_0x1e32('0x7')](),controller[_0x1e32('0xb')]);router['get'](_0x1e32('0xc'),auth[_0x1e32('0x7')](),controller[_0x1e32('0xd')]);router[_0x1e32('0x6')](_0x1e32('0xe'),auth['isAuthenticated'](),controller[_0x1e32('0xf')]);router['post']('/',auth[_0x1e32('0x7')](),controller['create']);router['post'](_0x1e32('0xc'),auth[_0x1e32('0x7')](),controller[_0x1e32('0x10')]);router[_0x1e32('0x11')](_0x1e32('0xe'),auth[_0x1e32('0x7')](),controller['addAgents']);router[_0x1e32('0x12')](_0x1e32('0x13'),auth[_0x1e32('0x7')](),controller['update']);router[_0x1e32('0x14')](_0x1e32('0x13'),auth[_0x1e32('0x7')](),controller['destroy']);router[_0x1e32('0x14')](_0x1e32('0xc'),auth[_0x1e32('0x7')](),controller[_0x1e32('0x15')]);router[_0x1e32('0x14')](_0x1e32('0xe'),auth[_0x1e32('0x7')](),controller['removeAgents']);module[_0x1e32('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 5865381..ac3f42e 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 _0x37b4=['roundrobin','sequelize','STRING','name','INTEGER','rrmemory','beepall'];(function(_0x4e738a,_0x516ef5){var _0x101899=function(_0x36c932){while(--_0x36c932){_0x4e738a['push'](_0x4e738a['shift']());}};_0x101899(++_0x516ef5);}(_0x37b4,0xef));var _0x437b=function(_0x2abffd,_0x760487){_0x2abffd=_0x2abffd-0x0;var _0xe147d4=_0x37b4[_0x2abffd];return _0xe147d4;};'use strict';var Sequelize=require(_0x437b('0x0'));module['exports']={'name':{'type':Sequelize[_0x437b('0x1')],'unique':_0x437b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x437b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x437b('0x4'),_0x437b('0x5'),_0x437b('0x6'))},'description':{'type':Sequelize[_0x437b('0x1')]}}; \ No newline at end of file +var _0xc678=['INTEGER','rrmemory','beepall','roundrobin','STRING','name'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xc678,0x1b4));var _0x8c67=function(_0x290fc8,_0x15830b){_0x290fc8=_0x290fc8-0x0;var _0x9ad393=_0xc678[_0x290fc8];return _0x9ad393;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8c67('0x0')],'unique':_0x8c67('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x8c67('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8c67('0x3'),_0x8c67('0x4'),_0x8c67('0x5'))},'description':{'type':Sequelize[_0x8c67('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index f228e06..41271f7 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 _0x8fa4=['role','WhatsappQueues','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserWhatsappQueue','hasOwnProperty','order','sort','pick','filter','findAll','User','agent','whatsappPause','createdAt','rows','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','nolimit','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','limit','undefined','count','offset','Content-Range','update','then','destroy','UserProfileResource','error','name','index','map','WhatsappQueue','rawAttributes','getOptions','where','include','query','catch','show','params','keys','filters','intersection','attributes','model','fields','length','merge','options','create','user','get'];(function(_0x479509,_0x1daf8a){var _0x382da8=function(_0x39d77c){while(--_0x39d77c){_0x479509['push'](_0x479509['shift']());}};_0x382da8(++_0x1daf8a);}(_0x8fa4,0xbc));var _0x48fa=function(_0x3721c8,_0x7c23e2){_0x3721c8=_0x3721c8-0x0;var _0x5abc2a=_0x8fa4[_0x3721c8];return _0x5abc2a;};'use strict';var BPromise=require(_0x48fa('0x0'));var util=require('util');var _=require(_0x48fa('0x1'));var squel=require('squel');var Redis=require(_0x48fa('0x2'));var qs=require(_0x48fa('0x3'));var logger=require(_0x48fa('0x4'))(_0x48fa('0x5'));var config=require(_0x48fa('0x6'));var db=require(_0x48fa('0x7'))['db'];config[_0x48fa('0x8')]=_[_0x48fa('0x9')](config['redis'],{'host':_0x48fa('0xa'),'port':0x18eb});var socket=require(_0x48fa('0xb'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x48fa('0xc')](socket);function respondWithStatusCode(_0x147be8,_0x3eae84){_0x3eae84=_0x3eae84||0xcc;return function(_0x83953b){if(_0x83953b){return _0x147be8[_0x48fa('0xd')](_0x3eae84);}return _0x147be8[_0x48fa('0xe')](_0x3eae84)[_0x48fa('0xf')]();};}function respondWithResult(_0x240793,_0x5eb0c8){_0x5eb0c8=_0x5eb0c8||0xc8;return function(_0x35e35d){if(_0x35e35d){return _0x240793[_0x48fa('0xe')](_0x5eb0c8)['json'](_0x35e35d);}};}function respondWithFilteredResult(_0x3052fa,_0x555584){return function(_0x5aa4d5){if(_0x5aa4d5){var _0x24a153=typeof _0x555584['offset']==='undefined'&&typeof _0x555584[_0x48fa('0x10')]===_0x48fa('0x11');var _0x10ffe3=_0x5aa4d5[_0x48fa('0x12')];var _0x36bda0=_0x24a153?0x0:_0x555584[_0x48fa('0x13')];var _0x4f5d69=_0x24a153?_0x5aa4d5[_0x48fa('0x12')]:_0x555584[_0x48fa('0x13')]+_0x555584['limit'];var _0x2052be;if(_0x4f5d69>=_0x10ffe3){_0x4f5d69=_0x10ffe3;_0x2052be=0xc8;}else{_0x2052be=0xce;}_0x3052fa[_0x48fa('0xe')](_0x2052be);return _0x3052fa['set'](_0x48fa('0x14'),_0x36bda0+'-'+_0x4f5d69+'/'+_0x10ffe3)['json'](_0x5aa4d5);}return null;};}function saveUpdates(_0x41a282){return function(_0x2207d9){if(_0x2207d9){return _0x2207d9[_0x48fa('0x15')](_0x41a282)[_0x48fa('0x16')](function(_0x523187){return _0x523187;});}return null;};}function removeEntity(_0x27f234){return function(_0x4955a0){if(_0x4955a0){return _0x4955a0[_0x48fa('0x17')]()[_0x48fa('0x16')](function(){var _0x34bead=_0x4955a0['get']({'plain':!![]});var _0x1a7a1f='WhatsappQueues';return db[_0x48fa('0x18')][_0x48fa('0x17')]({'where':{'type':_0x1a7a1f,'resourceId':_0x34bead['id']}})[_0x48fa('0x16')](function(){return _0x4955a0;});})[_0x48fa('0x16')](function(){_0x27f234[_0x48fa('0xe')](0xcc)[_0x48fa('0xf')]();});}};}function handleEntityNotFound(_0x1a0992){return function(_0x52c849){if(!_0x52c849){_0x1a0992[_0x48fa('0xd')](0x194);}return _0x52c849;};}function handleError(_0x55ae15,_0x2e0b74){_0x2e0b74=_0x2e0b74||0x1f4;return function(_0x28bb17){logger[_0x48fa('0x19')](_0x28bb17['stack']);if(_0x28bb17['name']){delete _0x28bb17[_0x48fa('0x1a')];}_0x55ae15[_0x48fa('0xe')](_0x2e0b74)['send'](_0x28bb17);};}exports[_0x48fa('0x1b')]=function(_0x4eede9,_0x122a78){var _0x357fa6={};var _0x1a08b3={'count':0x0,'rows':[]};var _0x5dbf5d=_[_0x48fa('0x1c')](db[_0x48fa('0x1d')][_0x48fa('0x1e')],function(_0x5542ca){return{'name':_0x5542ca['fieldName'],'type':_0x5542ca['type']['key']};});_0x357fa6=qs[_0x48fa('0x1f')](_0x5dbf5d,_0x4eede9);var _0x3f539f={'where':_0x357fa6[_0x48fa('0x20')]};return db['WhatsappQueue'][_0x48fa('0x12')](_0x3f539f)[_0x48fa('0x16')](function(_0x18c2d7){_0x1a08b3['count']=_0x18c2d7;_0x357fa6[_0x48fa('0x21')]=qs[_0x48fa('0x21')](_0x4eede9[_0x48fa('0x22')]);return db[_0x48fa('0x1d')]['findAll'](_0x357fa6);})[_0x48fa('0x16')](function(_0x74dc5f){_0x1a08b3['rows']=_0x74dc5f;return _0x1a08b3;})[_0x48fa('0x16')](respondWithFilteredResult(_0x122a78,_0x357fa6))[_0x48fa('0x23')](handleError(_0x122a78,null));};exports[_0x48fa('0x24')]=function(_0x132ca7,_0x3ec813){var _0x139daa={'raw':!![],'where':{'id':_0x132ca7[_0x48fa('0x25')]['id']}},_0x516a8d={};_0x516a8d['model']=_[_0x48fa('0x26')](db[_0x48fa('0x1d')][_0x48fa('0x1e')]);_0x516a8d[_0x48fa('0x22')]=_['keys'](_0x132ca7[_0x48fa('0x22')]);_0x516a8d[_0x48fa('0x27')]=_[_0x48fa('0x28')](_0x516a8d['model'],_0x516a8d[_0x48fa('0x22')]);_0x139daa[_0x48fa('0x29')]=_[_0x48fa('0x28')](_0x516a8d[_0x48fa('0x2a')],qs[_0x48fa('0x2b')](_0x132ca7[_0x48fa('0x22')][_0x48fa('0x2b')]));_0x139daa[_0x48fa('0x29')]=_0x139daa['attributes'][_0x48fa('0x2c')]?_0x139daa[_0x48fa('0x29')]:_0x516a8d[_0x48fa('0x2a')];if(_0x132ca7['query']['includeAll']){_0x139daa['include']=[{'all':!![]}];}_0x139daa=_[_0x48fa('0x2d')]({},_0x139daa,_0x132ca7[_0x48fa('0x2e')]);return db[_0x48fa('0x1d')]['find'](_0x139daa)[_0x48fa('0x16')](handleEntityNotFound(_0x3ec813,null))[_0x48fa('0x16')](respondWithResult(_0x3ec813,null))[_0x48fa('0x23')](handleError(_0x3ec813,null));};exports['create']=function(_0x430cd0,_0x25d3d9){return db[_0x48fa('0x1d')][_0x48fa('0x2f')](_0x430cd0['body'],{})[_0x48fa('0x16')](function(_0x1b0b5a){var _0x1f5497=_0x430cd0[_0x48fa('0x30')][_0x48fa('0x31')]({'plain':!![]});if(!_0x1f5497)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f5497[_0x48fa('0x32')]===_0x48fa('0x30')){var _0x5be912=_0x1b0b5a[_0x48fa('0x31')]({'plain':!![]});var _0xa54b28=_0x48fa('0x33');return db[_0x48fa('0x34')][_0x48fa('0x35')]({'where':{'name':_0xa54b28,'userProfileId':_0x1f5497[_0x48fa('0x36')]},'raw':!![]})[_0x48fa('0x16')](function(_0x14ed61){if(_0x14ed61&&_0x14ed61[_0x48fa('0x37')]===0x0){return db[_0x48fa('0x18')][_0x48fa('0x2f')]({'name':_0x5be912[_0x48fa('0x1a')],'resourceId':_0x5be912['id'],'type':_0x14ed61[_0x48fa('0x1a')],'sectionId':_0x14ed61['id']},{})[_0x48fa('0x16')](function(){return _0x1b0b5a;});}else{return _0x1b0b5a;}})[_0x48fa('0x23')](function(_0x23a1de){logger[_0x48fa('0x19')](_0x48fa('0x38'),_0x23a1de);throw _0x23a1de;});}return _0x1b0b5a;})['then'](respondWithResult(_0x25d3d9,0xc9))[_0x48fa('0x23')](handleError(_0x25d3d9,null));};exports[_0x48fa('0x15')]=function(_0x15cd82,_0x2422c1){if(_0x15cd82[_0x48fa('0x39')]['id']){delete _0x15cd82[_0x48fa('0x39')]['id'];}return db[_0x48fa('0x1d')][_0x48fa('0x35')]({'where':{'id':_0x15cd82[_0x48fa('0x25')]['id']}})['then'](handleEntityNotFound(_0x2422c1,null))[_0x48fa('0x16')](saveUpdates(_0x15cd82[_0x48fa('0x39')],null))[_0x48fa('0x16')](respondWithResult(_0x2422c1,null))[_0x48fa('0x23')](handleError(_0x2422c1,null));};exports[_0x48fa('0x17')]=function(_0x41d61c,_0x1c1f4b){return db[_0x48fa('0x1d')][_0x48fa('0x35')]({'where':{'id':_0x41d61c[_0x48fa('0x25')]['id']}})[_0x48fa('0x16')](handleEntityNotFound(_0x1c1f4b,null))['then'](removeEntity(_0x1c1f4b,null))[_0x48fa('0x23')](handleError(_0x1c1f4b,null));};exports[_0x48fa('0x3a')]=function(_0x26eec6,_0x3e839a){return db[_0x48fa('0x1d')][_0x48fa('0x3a')]()[_0x48fa('0x16')](respondWithResult(_0x3e839a,null))[_0x48fa('0x23')](handleError(_0x3e839a,null));};exports[_0x48fa('0x3b')]=function(_0x267678,_0x36fea2){var _0x454600={'raw':!![],'where':{}},_0x100579={},_0x2f2c3f;return db[_0x48fa('0x1d')]['findOne']({'where':{'id':_0x267678[_0x48fa('0x25')]['id']}})['then'](handleEntityNotFound(_0x36fea2,null))[_0x48fa('0x16')](function(_0x14c35c){if(_0x14c35c){_0x2f2c3f=_0x14c35c['get']({'plain':!![]});_0x100579[_0x48fa('0x2a')]=_[_0x48fa('0x26')](db[_0x48fa('0x3c')]['rawAttributes']);_0x100579[_0x48fa('0x22')]=_[_0x48fa('0x26')](_0x267678[_0x48fa('0x22')]);_0x100579['filters']=_['intersection'](_0x100579[_0x48fa('0x2a')],_0x100579[_0x48fa('0x22')]);_0x454600[_0x48fa('0x29')]=_['intersection'](_0x100579['model'],qs[_0x48fa('0x2b')](_0x267678[_0x48fa('0x22')][_0x48fa('0x2b')]));_0x454600[_0x48fa('0x29')]=_0x454600[_0x48fa('0x29')][_0x48fa('0x2c')]?_0x454600['attributes']:_0x100579['model'];if(!_0x267678[_0x48fa('0x22')][_0x48fa('0x3d')]('nolimit')){_0x454600['limit']=qs[_0x48fa('0x10')](_0x267678[_0x48fa('0x22')]['limit']);_0x454600[_0x48fa('0x13')]=qs['offset'](_0x267678[_0x48fa('0x22')][_0x48fa('0x13')]);}_0x454600[_0x48fa('0x3e')]=qs[_0x48fa('0x3f')](_0x267678[_0x48fa('0x22')]['sort']);_0x454600[_0x48fa('0x20')]=qs[_0x48fa('0x27')](_[_0x48fa('0x40')](_0x267678[_0x48fa('0x22')],_0x100579[_0x48fa('0x27')]));_0x454600[_0x48fa('0x20')]['WhatsappQueueId']=_0x14c35c['id'];if(_0x267678[_0x48fa('0x22')][_0x48fa('0x41')]){_0x454600['where']=_[_0x48fa('0x2d')](_0x454600[_0x48fa('0x20')],{'$or':_[_0x48fa('0x1c')](_0x454600['attributes'],function(_0x1f86fa){var _0x3e4316={};_0x3e4316[_0x1f86fa]={'$like':'%'+_0x267678['query'][_0x48fa('0x41')]+'%'};return _0x3e4316;})});}_0x454600=_[_0x48fa('0x2d')]({},_0x454600,_0x267678['options']);return db['UserWhatsappQueue'][_0x48fa('0x42')](_0x454600);}})[_0x48fa('0x16')](function(_0x1736ea){if(_0x1736ea){return db[_0x48fa('0x43')]['findAndCountAll']({'where':{'id':_['map'](_0x1736ea,'UserId'),'role':_0x48fa('0x44')},'attributes':['id','name',_0x48fa('0x45'),'updatedAt',_0x48fa('0x46')]});}})[_0x48fa('0x16')](function(_0x187752){if(_0x187752){return{'count':_0x187752[_0x48fa('0x12')],'rows':_[_0x48fa('0x1c')](_0x187752[_0x48fa('0x47')],function(_0x5cb726){return{'membername':_0x5cb726[_0x48fa('0x1a')],'UserId':_0x5cb726['id'],'queue_name':_0x2f2c3f[_0x48fa('0x1a')],'WhatsappQueueId':_0x2f2c3f['id'],'interface':util['format']('%s/%s',_0x48fa('0x48'),_0x5cb726[_0x48fa('0x1a')]),'penalty':0x0,'paused':_0x5cb726['whatsappPause'],'createdAt':_0x5cb726[_0x48fa('0x46')],'updatedAt':_0x5cb726[_0x48fa('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x48fa('0x16')](respondWithFilteredResult(_0x36fea2,_0x454600))['catch'](handleError(_0x36fea2,null));};exports[_0x48fa('0x4a')]=function(_0x58e301,_0x36d018){var _0xdc3651={};var _0x52fb1d={};var _0x4859c5;var _0x193f64;return db[_0x48fa('0x1d')][_0x48fa('0x4b')]({'where':{'id':_0x58e301[_0x48fa('0x25')]['id']}})[_0x48fa('0x16')](handleEntityNotFound(_0x36d018,null))['then'](function(_0x2c763b){if(_0x2c763b){_0x4859c5=_0x2c763b;_0x52fb1d['model']=_['keys'](db[_0x48fa('0x4c')][_0x48fa('0x1e')]);_0x52fb1d[_0x48fa('0x22')]=_[_0x48fa('0x26')](_0x58e301['query']);_0x52fb1d[_0x48fa('0x27')]=_[_0x48fa('0x28')](_0x52fb1d[_0x48fa('0x2a')],_0x52fb1d[_0x48fa('0x22')]);_0xdc3651['attributes']=_['intersection'](_0x52fb1d[_0x48fa('0x2a')],qs[_0x48fa('0x2b')](_0x58e301['query'][_0x48fa('0x2b')]));_0xdc3651[_0x48fa('0x29')]=_0xdc3651[_0x48fa('0x29')][_0x48fa('0x2c')]?_0xdc3651[_0x48fa('0x29')]:_0x52fb1d[_0x48fa('0x2a')];_0xdc3651[_0x48fa('0x3e')]=qs['sort'](_0x58e301[_0x48fa('0x22')][_0x48fa('0x3f')]);_0xdc3651[_0x48fa('0x20')]=qs['filters'](_[_0x48fa('0x40')](_0x58e301['query'],_0x52fb1d[_0x48fa('0x27')]));if(_0x58e301['query'][_0x48fa('0x41')]){_0xdc3651[_0x48fa('0x20')]=_['merge'](_0xdc3651[_0x48fa('0x20')],{'$or':_[_0x48fa('0x1c')](_0xdc3651[_0x48fa('0x29')],function(_0x30c49d){var _0x5a325f={};_0x5a325f[_0x30c49d]={'$like':'%'+_0x58e301[_0x48fa('0x22')][_0x48fa('0x41')]+'%'};return _0x5a325f;})});}_0xdc3651=_['merge']({},_0xdc3651,_0x58e301[_0x48fa('0x2e')]);return _0x4859c5[_0x48fa('0x4a')](_0xdc3651);}})[_0x48fa('0x16')](function(_0x4961b4){if(_0x4961b4){_0x193f64=_0x4961b4[_0x48fa('0x2c')];if(!_0x58e301[_0x48fa('0x22')][_0x48fa('0x3d')]('nolimit')){_0xdc3651[_0x48fa('0x10')]=qs[_0x48fa('0x10')](_0x58e301['query']['limit']);_0xdc3651[_0x48fa('0x13')]=qs[_0x48fa('0x13')](_0x58e301[_0x48fa('0x22')][_0x48fa('0x13')]);}return _0x4859c5[_0x48fa('0x4a')](_0xdc3651);}})['then'](function(_0x43da43){if(_0x43da43){return _0x43da43?{'count':_0x193f64,'rows':_0x43da43}:null;}})[_0x48fa('0x16')](respondWithResult(_0x36d018,null))[_0x48fa('0x23')](handleError(_0x36d018,null));};exports[_0x48fa('0x4d')]=function(_0x5ec415,_0x5a6557){var _0x44da2a=_0x5ec415['body'][_0x48fa('0x4e')];return db[_0x48fa('0x4c')][_0x48fa('0x42')]({'where':{'id':_0x44da2a},'attributes':['id'],'include':[{'model':db[_0x48fa('0x43')],'as':_0x48fa('0x4f'),'attributes':['id','name',_0x48fa('0x50'),_0x48fa('0x51'),'interface'],'raw':!![]}]})['then'](function(_0x5571d9){if(_0x5571d9){var _0x9fdf2a=_['flatMap'](_0x5571d9,function(_0x4af39a){var _0x48e2af=_0x4af39a[_0x48fa('0x31')]({'plain':!![]});return _0x48e2af[_0x48fa('0x4f')];});return db['WhatsappQueue'][_0x48fa('0x35')]({'where':{'id':_0x5ec415['params']['id']}})['then'](function(_0x592b41){return db[_0x48fa('0x52')][_0x48fa('0x53')](function(_0x306856){return _0x592b41[_0x48fa('0x4d')](_0x44da2a,{'transaction':_0x306856})[_0x48fa('0x16')](function(){return BPromise[_0x48fa('0x54')](_0x9fdf2a,function(_0x2aeccb){return db[_0x48fa('0x3c')][_0x48fa('0x55')]({'where':{'UserId':_0x2aeccb['id'],'WhatsappQueueId':_0x5ec415['params']['id']},'transaction':_0x306856});});})[_0x48fa('0x16')](function(){_0x9fdf2a[_0x48fa('0x56')](function(_0x4de5de){socket[_0x48fa('0x57')](_0x48fa('0x58'),{'UserId':_0x4de5de['id'],'WhatsappQueueId':_0x592b41['id']});});});});});}})['then'](respondWithStatusCode(_0x5a6557,null))['catch'](handleError(_0x5a6557,null));};exports['removeTeams']=function(_0x4a7fe6,_0x3c7cad){return db[_0x48fa('0x4c')][_0x48fa('0x42')]({'where':{'id':_0x4a7fe6[_0x48fa('0x22')][_0x48fa('0x4e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x48fa('0x4f'),'attributes':['id'],'raw':!![]}]})[_0x48fa('0x16')](handleEntityNotFound(_0x3c7cad,null))[_0x48fa('0x16')](function(_0xe29233){var _0x2e7aa8=_['map'](_0xe29233,'id');var _0x34cf9d=[];var _0x5a88e7=[];var _0x4a7999=squel[_0x48fa('0x59')]();_0x4a7999[_0x48fa('0x5a')](_0x48fa('0x5b'))[_0x48fa('0x5c')](_0x48fa('0x5d'),'tq')[_0x48fa('0x5e')](_0x48fa('0x5f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x48fa('0x20')](_0x48fa('0x60'),_0x4a7fe6['params']['id']);for(var _0x1b3572=0x0;_0x1b3572<_0xe29233[_0x48fa('0x2c')];_0x1b3572+=0x1){let _0x305100=_0xe29233[_0x1b3572];for(var _0xf3e248=0x0;_0xf3e248<_0x305100[_0x48fa('0x4f')]['length'];_0xf3e248+=0x1){let _0x34cbf3=_0x305100[_0x48fa('0x4f')][_0xf3e248];var _0xfce380=_0x4a7999[_0x48fa('0x61')]();_0xfce380[_0x48fa('0x20')](_0x48fa('0x62'),_0x34cbf3['id']);_0x5a88e7[_0x48fa('0x63')](db[_0x48fa('0x52')][_0x48fa('0x22')](_0xfce380[_0x48fa('0x64')](),{'type':db['sequelize']['QueryTypes'][_0x48fa('0x65')]})[_0x48fa('0x16')](function(_0x16abb4){if(_0x16abb4[_0x48fa('0x2c')]===0x1){return _0x34cbf3['id'];}else{var _0x10ad98=_[_0x48fa('0x66')](_[_0x48fa('0x1c')](_0x16abb4,_0x48fa('0x67')),function(_0x14b365){return _[_0x48fa('0x68')](_0x2e7aa8,_0x14b365);});if(_0x10ad98){return _0x34cbf3['id'];}}}));}}return BPromise[_0x48fa('0x69')](_0x5a88e7)[_0x48fa('0x16')](function(_0x5567b0){_0x34cf9d=_(_0x34cf9d)[_0x48fa('0x6a')](_0x5567b0)[_0x48fa('0x6b')]()[_0x48fa('0x6c')]();return db[_0x48fa('0x1d')][_0x48fa('0x35')]({'where':{'id':_0x4a7fe6[_0x48fa('0x25')]['id']}})[_0x48fa('0x16')](function(_0xa88073){return db[_0x48fa('0x52')]['transaction'](function(_0x19838e){return _0xa88073[_0x48fa('0x6d')](_0x4a7fe6[_0x48fa('0x22')][_0x48fa('0x4e')],{'transaction':_0x19838e})[_0x48fa('0x16')](function(){if(!_[_0x48fa('0x6e')](_0x34cf9d)){return _0xa88073[_0x48fa('0x6f')](_0x34cf9d,{'transaction':_0x19838e});}})['then'](function(){_0x34cf9d[_0x48fa('0x56')](function(_0x345549){socket[_0x48fa('0x57')]('userWhatsappQueue:remove',{'UserId':_0x345549,'WhatsappQueueId':_0xa88073['id']});});});});});});})[_0x48fa('0x16')](respondWithStatusCode(_0x3c7cad,null))[_0x48fa('0x23')](handleError(_0x3c7cad,null));};exports[_0x48fa('0x70')]=function(_0x23e979,_0x5149c6){return db['WhatsappQueue'][_0x48fa('0x35')]({'where':{'id':_0x23e979[_0x48fa('0x25')]['id']}})['then'](handleEntityNotFound(_0x5149c6,null))[_0x48fa('0x16')](function(_0x20153c){if(_0x20153c){return _0x20153c['addAgents'](_0x23e979['body'][_0x48fa('0x4e')],_[_0x48fa('0x71')](_0x23e979[_0x48fa('0x39')],[_0x48fa('0x4e'),'id'])||{})[_0x48fa('0x72')](function(_0x515e5c){for(var _0x38065a=0x0;_0x38065a<_0x23e979[_0x48fa('0x39')]['ids']['length'];_0x38065a+=0x1){socket[_0x48fa('0x57')]('userWhatsappQueue:save',{'UserId':Number(_0x23e979['body'][_0x48fa('0x4e')][_0x38065a]),'WhatsappQueueId':Number(_0x23e979[_0x48fa('0x25')]['id'])});}return _0x515e5c;});}})[_0x48fa('0x16')](respondWithResult(_0x5149c6,null))['catch'](handleError(_0x5149c6,null));};exports[_0x48fa('0x6f')]=function(_0x5bc716,_0x3dac8d){return db[_0x48fa('0x1d')]['find']({'where':{'id':_0x5bc716[_0x48fa('0x25')]['id']}})[_0x48fa('0x16')](handleEntityNotFound(_0x3dac8d,null))[_0x48fa('0x16')](function(_0x4ce88a){if(_0x4ce88a){return _0x4ce88a['removeAgents'](_0x5bc716[_0x48fa('0x22')][_0x48fa('0x4e')])[_0x48fa('0x16')](function(){if(_[_0x48fa('0x73')](_0x5bc716['query'][_0x48fa('0x4e')])){for(var _0x3fc495=0x0;_0x3fc495<_0x5bc716[_0x48fa('0x22')][_0x48fa('0x4e')]['length'];_0x3fc495+=0x1){socket[_0x48fa('0x57')](_0x48fa('0x74'),{'UserId':Number(_0x5bc716['query']['ids'][_0x3fc495]),'WhatsappQueueId':Number(_0x5bc716[_0x48fa('0x25')]['id'])});}}else{socket[_0x48fa('0x57')](_0x48fa('0x74'),{'UserId':Number(_0x5bc716[_0x48fa('0x22')][_0x48fa('0x4e')]),'WhatsappQueueId':Number(_0x5bc716[_0x48fa('0x25')]['id'])});}});}})['then'](respondWithStatusCode(_0x3dac8d,null))[_0x48fa('0x23')](handleError(_0x3dac8d,null));};exports[_0x48fa('0x75')]=function(_0x5c2880,_0x5a6704){var _0x20c6a9={};var _0x3d26df={};var _0x4418c9;var _0x39c410;return db[_0x48fa('0x1d')][_0x48fa('0x4b')]({'where':{'id':_0x5c2880[_0x48fa('0x25')]['id']}})[_0x48fa('0x16')](handleEntityNotFound(_0x5a6704,null))[_0x48fa('0x16')](function(_0x552eb0){if(_0x552eb0){_0x4418c9=_0x552eb0;_0x3d26df[_0x48fa('0x2a')]=_['keys'](db[_0x48fa('0x43')]['rawAttributes']);_0x3d26df[_0x48fa('0x22')]=_[_0x48fa('0x26')](_0x5c2880[_0x48fa('0x22')]);_0x3d26df[_0x48fa('0x27')]=_[_0x48fa('0x28')](_0x3d26df[_0x48fa('0x2a')],_0x3d26df['query']);_0x20c6a9['attributes']=_[_0x48fa('0x28')](_0x3d26df[_0x48fa('0x2a')],qs['fields'](_0x5c2880[_0x48fa('0x22')][_0x48fa('0x2b')]));_0x20c6a9['attributes']=_0x20c6a9['attributes']['length']?_0x20c6a9[_0x48fa('0x29')]:_0x3d26df[_0x48fa('0x2a')];_0x20c6a9['order']=qs[_0x48fa('0x3f')](_0x5c2880[_0x48fa('0x22')][_0x48fa('0x3f')]);_0x20c6a9[_0x48fa('0x20')]=qs['filters'](_['pick'](_0x5c2880[_0x48fa('0x22')],_0x3d26df[_0x48fa('0x27')]));if(_0x5c2880[_0x48fa('0x22')]['filter']){_0x20c6a9[_0x48fa('0x20')]=_[_0x48fa('0x2d')](_0x20c6a9[_0x48fa('0x20')],{'$or':_['map'](_0x20c6a9['attributes'],function(_0x39dfd8){var _0x5cb95a={};_0x5cb95a[_0x39dfd8]={'$like':'%'+_0x5c2880[_0x48fa('0x22')][_0x48fa('0x41')]+'%'};return _0x5cb95a;})});}_0x20c6a9=_[_0x48fa('0x2d')]({},_0x20c6a9,_0x5c2880['options']);return _0x4418c9[_0x48fa('0x75')](_0x20c6a9);}})[_0x48fa('0x16')](function(_0x1cd451){if(_0x1cd451){_0x39c410=_0x1cd451['length'];if(!_0x5c2880['query'][_0x48fa('0x3d')](_0x48fa('0x76'))){_0x20c6a9[_0x48fa('0x10')]=qs[_0x48fa('0x10')](_0x5c2880['query'][_0x48fa('0x10')]);_0x20c6a9[_0x48fa('0x13')]=qs['offset'](_0x5c2880[_0x48fa('0x22')][_0x48fa('0x13')]);}return _0x4418c9['getAgents'](_0x20c6a9);}})[_0x48fa('0x16')](function(_0x58a4bd){if(_0x58a4bd){return _0x58a4bd?{'count':_0x39c410,'rows':_0x58a4bd}:null;}})['then'](respondWithResult(_0x5a6704,null))[_0x48fa('0x23')](handleError(_0x5a6704,null));}; \ No newline at end of file +var _0xf274=['filters','intersection','fields','attributes','length','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','UserWhatsappQueue','hasOwnProperty','nolimit','order','sort','pick','WhatsappQueueId','filter','options','User','UserId','agent','whatsappPause','updatedAt','createdAt','count','%s/%s','getTeams','Team','ids','online','interface','flatMap','Agents','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeAgents','userWhatsappQueue:remove','addAgents','omit','userWhatsappQueue:save','findOne','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','limit','update','then','get','WhatsappQueues','UserProfileResource','end','error','stack','name','send','map','rawAttributes','type','key','getOptions','where','WhatsappQueue','include','query','findAll','rows','catch','show','params','model','keys'];(function(_0xe45c54,_0x1324f2){var _0x5373e7=function(_0x25f026){while(--_0x25f026){_0xe45c54['push'](_0xe45c54['shift']());}};_0x5373e7(++_0x1324f2);}(_0xf274,0x139));var _0x4f27=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xf274[_0x2aea9e];return _0x430b92;};'use strict';var BPromise=require('bluebird');var util=require(_0x4f27('0x0'));var _=require(_0x4f27('0x1'));var squel=require(_0x4f27('0x2'));var Redis=require(_0x4f27('0x3'));var qs=require(_0x4f27('0x4'));var logger=require(_0x4f27('0x5'))(_0x4f27('0x6'));var config=require(_0x4f27('0x7'));var db=require(_0x4f27('0x8'))['db'];config[_0x4f27('0x9')]=_[_0x4f27('0xa')](config['redis'],{'host':_0x4f27('0xb'),'port':0x18eb});var socket=require(_0x4f27('0xc'))(new Redis(config['redis']));require(_0x4f27('0xd'))[_0x4f27('0xe')](socket);function respondWithStatusCode(_0x40eb25,_0x430996){_0x430996=_0x430996||0xcc;return function(_0x11c58d){if(_0x11c58d){return _0x40eb25[_0x4f27('0xf')](_0x430996);}return _0x40eb25[_0x4f27('0x10')](_0x430996)['end']();};}function respondWithResult(_0x2edef9,_0x1242f5){_0x1242f5=_0x1242f5||0xc8;return function(_0xcd2a56){if(_0xcd2a56){return _0x2edef9[_0x4f27('0x10')](_0x1242f5)[_0x4f27('0x11')](_0xcd2a56);}};}function respondWithFilteredResult(_0x25c56a,_0x5d1128){return function(_0x295c52){if(_0x295c52){var _0x20a843=typeof _0x5d1128[_0x4f27('0x12')]===_0x4f27('0x13')&&typeof _0x5d1128[_0x4f27('0x14')]===_0x4f27('0x13');var _0x17cfb1=_0x295c52['count'];var _0x553007=_0x20a843?0x0:_0x5d1128[_0x4f27('0x12')];var _0x11d633=_0x20a843?_0x295c52['count']:_0x5d1128[_0x4f27('0x12')]+_0x5d1128['limit'];var _0xaed7f4;if(_0x11d633>=_0x17cfb1){_0x11d633=_0x17cfb1;_0xaed7f4=0xc8;}else{_0xaed7f4=0xce;}_0x25c56a['status'](_0xaed7f4);return _0x25c56a['set']('Content-Range',_0x553007+'-'+_0x11d633+'/'+_0x17cfb1)[_0x4f27('0x11')](_0x295c52);}return null;};}function saveUpdates(_0x2d3944){return function(_0x3788a9){if(_0x3788a9){return _0x3788a9[_0x4f27('0x15')](_0x2d3944)[_0x4f27('0x16')](function(_0x26668e){return _0x26668e;});}return null;};}function removeEntity(_0x2d532c){return function(_0x37d9b4){if(_0x37d9b4){return _0x37d9b4['destroy']()['then'](function(){var _0x87a5cb=_0x37d9b4[_0x4f27('0x17')]({'plain':!![]});var _0x45d139=_0x4f27('0x18');return db[_0x4f27('0x19')]['destroy']({'where':{'type':_0x45d139,'resourceId':_0x87a5cb['id']}})[_0x4f27('0x16')](function(){return _0x37d9b4;});})[_0x4f27('0x16')](function(){_0x2d532c[_0x4f27('0x10')](0xcc)[_0x4f27('0x1a')]();});}};}function handleEntityNotFound(_0xdfb92c){return function(_0x170888){if(!_0x170888){_0xdfb92c[_0x4f27('0xf')](0x194);}return _0x170888;};}function handleError(_0x339c29,_0x5e051f){_0x5e051f=_0x5e051f||0x1f4;return function(_0x319b01){logger[_0x4f27('0x1b')](_0x319b01[_0x4f27('0x1c')]);if(_0x319b01['name']){delete _0x319b01[_0x4f27('0x1d')];}_0x339c29[_0x4f27('0x10')](_0x5e051f)[_0x4f27('0x1e')](_0x319b01);};}exports['index']=function(_0x47134c,_0xef289c){var _0x1b8d80={};var _0x3e923d={'count':0x0,'rows':[]};var _0x55d4f8=_[_0x4f27('0x1f')](db['WhatsappQueue'][_0x4f27('0x20')],function(_0x214b55){return{'name':_0x214b55['fieldName'],'type':_0x214b55[_0x4f27('0x21')][_0x4f27('0x22')]};});_0x1b8d80=qs[_0x4f27('0x23')](_0x55d4f8,_0x47134c);var _0x3c4e38={'where':_0x1b8d80[_0x4f27('0x24')]};return db[_0x4f27('0x25')]['count'](_0x3c4e38)[_0x4f27('0x16')](function(_0x400f43){_0x3e923d['count']=_0x400f43;_0x1b8d80[_0x4f27('0x26')]=qs[_0x4f27('0x26')](_0x47134c[_0x4f27('0x27')]);return db[_0x4f27('0x25')][_0x4f27('0x28')](_0x1b8d80);})['then'](function(_0x685ceb){_0x3e923d[_0x4f27('0x29')]=_0x685ceb;return _0x3e923d;})[_0x4f27('0x16')](respondWithFilteredResult(_0xef289c,_0x1b8d80))[_0x4f27('0x2a')](handleError(_0xef289c,null));};exports[_0x4f27('0x2b')]=function(_0x1b4bd1,_0x155c0b){var _0x1d2547={'raw':!![],'where':{'id':_0x1b4bd1[_0x4f27('0x2c')]['id']}},_0x3233f0={};_0x3233f0[_0x4f27('0x2d')]=_['keys'](db[_0x4f27('0x25')][_0x4f27('0x20')]);_0x3233f0[_0x4f27('0x27')]=_[_0x4f27('0x2e')](_0x1b4bd1[_0x4f27('0x27')]);_0x3233f0[_0x4f27('0x2f')]=_[_0x4f27('0x30')](_0x3233f0['model'],_0x3233f0[_0x4f27('0x27')]);_0x1d2547['attributes']=_[_0x4f27('0x30')](_0x3233f0[_0x4f27('0x2d')],qs['fields'](_0x1b4bd1[_0x4f27('0x27')][_0x4f27('0x31')]));_0x1d2547[_0x4f27('0x32')]=_0x1d2547[_0x4f27('0x32')][_0x4f27('0x33')]?_0x1d2547[_0x4f27('0x32')]:_0x3233f0['model'];if(_0x1b4bd1[_0x4f27('0x27')]['includeAll']){_0x1d2547[_0x4f27('0x26')]=[{'all':!![]}];}_0x1d2547=_[_0x4f27('0x34')]({},_0x1d2547,_0x1b4bd1['options']);return db[_0x4f27('0x25')][_0x4f27('0x35')](_0x1d2547)['then'](handleEntityNotFound(_0x155c0b,null))[_0x4f27('0x16')](respondWithResult(_0x155c0b,null))[_0x4f27('0x2a')](handleError(_0x155c0b,null));};exports[_0x4f27('0x36')]=function(_0xf00ae1,_0x40a306){return db[_0x4f27('0x25')][_0x4f27('0x36')](_0xf00ae1[_0x4f27('0x37')],{})['then'](function(_0x502476){var _0x2d0f61=_0xf00ae1[_0x4f27('0x38')]['get']({'plain':!![]});if(!_0x2d0f61)throw new Error(_0x4f27('0x39'));if(_0x2d0f61[_0x4f27('0x3a')]==='user'){var _0x41925f=_0x502476[_0x4f27('0x17')]({'plain':!![]});var _0x218885=_0x4f27('0x18');return db[_0x4f27('0x3b')]['find']({'where':{'name':_0x218885,'userProfileId':_0x2d0f61[_0x4f27('0x3c')]},'raw':!![]})[_0x4f27('0x16')](function(_0x190f85){if(_0x190f85&&_0x190f85[_0x4f27('0x3d')]===0x0){return db[_0x4f27('0x19')][_0x4f27('0x36')]({'name':_0x41925f[_0x4f27('0x1d')],'resourceId':_0x41925f['id'],'type':_0x190f85[_0x4f27('0x1d')],'sectionId':_0x190f85['id']},{})['then'](function(){return _0x502476;});}else{return _0x502476;}})[_0x4f27('0x2a')](function(_0x38ad92){logger[_0x4f27('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38ad92);throw _0x38ad92;});}return _0x502476;})['then'](respondWithResult(_0x40a306,0xc9))[_0x4f27('0x2a')](handleError(_0x40a306,null));};exports['update']=function(_0x454a3d,_0x534e15){if(_0x454a3d[_0x4f27('0x37')]['id']){delete _0x454a3d['body']['id'];}return db[_0x4f27('0x25')]['find']({'where':{'id':_0x454a3d['params']['id']}})['then'](handleEntityNotFound(_0x534e15,null))[_0x4f27('0x16')](saveUpdates(_0x454a3d[_0x4f27('0x37')],null))[_0x4f27('0x16')](respondWithResult(_0x534e15,null))[_0x4f27('0x2a')](handleError(_0x534e15,null));};exports['destroy']=function(_0x167dae,_0x55e7d5){return db[_0x4f27('0x25')][_0x4f27('0x35')]({'where':{'id':_0x167dae['params']['id']}})['then'](handleEntityNotFound(_0x55e7d5,null))['then'](removeEntity(_0x55e7d5,null))[_0x4f27('0x2a')](handleError(_0x55e7d5,null));};exports[_0x4f27('0x3e')]=function(_0x574256,_0x5f3de6){return db[_0x4f27('0x25')]['describe']()[_0x4f27('0x16')](respondWithResult(_0x5f3de6,null))[_0x4f27('0x2a')](handleError(_0x5f3de6,null));};exports[_0x4f27('0x3f')]=function(_0x4af239,_0x1c86ae){var _0x4d37d1={'raw':!![],'where':{}},_0x419758={},_0x1f13b1;return db['WhatsappQueue']['findOne']({'where':{'id':_0x4af239[_0x4f27('0x2c')]['id']}})[_0x4f27('0x16')](handleEntityNotFound(_0x1c86ae,null))[_0x4f27('0x16')](function(_0x343126){if(_0x343126){_0x1f13b1=_0x343126[_0x4f27('0x17')]({'plain':!![]});_0x419758[_0x4f27('0x2d')]=_[_0x4f27('0x2e')](db[_0x4f27('0x40')][_0x4f27('0x20')]);_0x419758[_0x4f27('0x27')]=_[_0x4f27('0x2e')](_0x4af239[_0x4f27('0x27')]);_0x419758[_0x4f27('0x2f')]=_['intersection'](_0x419758[_0x4f27('0x2d')],_0x419758[_0x4f27('0x27')]);_0x4d37d1[_0x4f27('0x32')]=_[_0x4f27('0x30')](_0x419758[_0x4f27('0x2d')],qs[_0x4f27('0x31')](_0x4af239[_0x4f27('0x27')][_0x4f27('0x31')]));_0x4d37d1[_0x4f27('0x32')]=_0x4d37d1[_0x4f27('0x32')][_0x4f27('0x33')]?_0x4d37d1['attributes']:_0x419758['model'];if(!_0x4af239[_0x4f27('0x27')][_0x4f27('0x41')](_0x4f27('0x42'))){_0x4d37d1[_0x4f27('0x14')]=qs[_0x4f27('0x14')](_0x4af239[_0x4f27('0x27')][_0x4f27('0x14')]);_0x4d37d1[_0x4f27('0x12')]=qs[_0x4f27('0x12')](_0x4af239[_0x4f27('0x27')][_0x4f27('0x12')]);}_0x4d37d1[_0x4f27('0x43')]=qs[_0x4f27('0x44')](_0x4af239[_0x4f27('0x27')][_0x4f27('0x44')]);_0x4d37d1[_0x4f27('0x24')]=qs[_0x4f27('0x2f')](_[_0x4f27('0x45')](_0x4af239['query'],_0x419758[_0x4f27('0x2f')]));_0x4d37d1[_0x4f27('0x24')][_0x4f27('0x46')]=_0x343126['id'];if(_0x4af239[_0x4f27('0x27')][_0x4f27('0x47')]){_0x4d37d1['where']=_[_0x4f27('0x34')](_0x4d37d1['where'],{'$or':_[_0x4f27('0x1f')](_0x4d37d1[_0x4f27('0x32')],function(_0x47e7d6){var _0x11d9aa={};_0x11d9aa[_0x47e7d6]={'$like':'%'+_0x4af239['query']['filter']+'%'};return _0x11d9aa;})});}_0x4d37d1=_[_0x4f27('0x34')]({},_0x4d37d1,_0x4af239[_0x4f27('0x48')]);return db[_0x4f27('0x40')][_0x4f27('0x28')](_0x4d37d1);}})['then'](function(_0x5cbf7e){if(_0x5cbf7e){return db[_0x4f27('0x49')]['findAndCountAll']({'where':{'id':_[_0x4f27('0x1f')](_0x5cbf7e,_0x4f27('0x4a')),'role':_0x4f27('0x4b')},'attributes':['id',_0x4f27('0x1d'),_0x4f27('0x4c'),_0x4f27('0x4d'),_0x4f27('0x4e')]});}})['then'](function(_0x2d992d){if(_0x2d992d){return{'count':_0x2d992d[_0x4f27('0x4f')],'rows':_[_0x4f27('0x1f')](_0x2d992d[_0x4f27('0x29')],function(_0x75caa0){return{'membername':_0x75caa0[_0x4f27('0x1d')],'UserId':_0x75caa0['id'],'queue_name':_0x1f13b1[_0x4f27('0x1d')],'WhatsappQueueId':_0x1f13b1['id'],'interface':util['format'](_0x4f27('0x50'),'SIP',_0x75caa0['name']),'penalty':0x0,'paused':_0x75caa0['whatsappPause'],'createdAt':_0x75caa0[_0x4f27('0x4e')],'updatedAt':_0x75caa0[_0x4f27('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4f27('0x16')](respondWithFilteredResult(_0x1c86ae,_0x4d37d1))['catch'](handleError(_0x1c86ae,null));};exports[_0x4f27('0x51')]=function(_0xcae908,_0x4fab99){var _0x91d9ab={};var _0x3566cb={};var _0x48a3ce;var _0x489443;return db[_0x4f27('0x25')]['findOne']({'where':{'id':_0xcae908[_0x4f27('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4fab99,null))[_0x4f27('0x16')](function(_0x8fef7d){if(_0x8fef7d){_0x48a3ce=_0x8fef7d;_0x3566cb[_0x4f27('0x2d')]=_[_0x4f27('0x2e')](db[_0x4f27('0x52')][_0x4f27('0x20')]);_0x3566cb[_0x4f27('0x27')]=_[_0x4f27('0x2e')](_0xcae908['query']);_0x3566cb[_0x4f27('0x2f')]=_[_0x4f27('0x30')](_0x3566cb[_0x4f27('0x2d')],_0x3566cb[_0x4f27('0x27')]);_0x91d9ab[_0x4f27('0x32')]=_[_0x4f27('0x30')](_0x3566cb['model'],qs[_0x4f27('0x31')](_0xcae908[_0x4f27('0x27')][_0x4f27('0x31')]));_0x91d9ab[_0x4f27('0x32')]=_0x91d9ab[_0x4f27('0x32')][_0x4f27('0x33')]?_0x91d9ab[_0x4f27('0x32')]:_0x3566cb[_0x4f27('0x2d')];_0x91d9ab[_0x4f27('0x43')]=qs[_0x4f27('0x44')](_0xcae908[_0x4f27('0x27')][_0x4f27('0x44')]);_0x91d9ab[_0x4f27('0x24')]=qs[_0x4f27('0x2f')](_[_0x4f27('0x45')](_0xcae908[_0x4f27('0x27')],_0x3566cb[_0x4f27('0x2f')]));if(_0xcae908[_0x4f27('0x27')][_0x4f27('0x47')]){_0x91d9ab[_0x4f27('0x24')]=_[_0x4f27('0x34')](_0x91d9ab[_0x4f27('0x24')],{'$or':_[_0x4f27('0x1f')](_0x91d9ab['attributes'],function(_0x3895da){var _0x2c603e={};_0x2c603e[_0x3895da]={'$like':'%'+_0xcae908[_0x4f27('0x27')][_0x4f27('0x47')]+'%'};return _0x2c603e;})});}_0x91d9ab=_[_0x4f27('0x34')]({},_0x91d9ab,_0xcae908['options']);return _0x48a3ce[_0x4f27('0x51')](_0x91d9ab);}})[_0x4f27('0x16')](function(_0x74f01){if(_0x74f01){_0x489443=_0x74f01[_0x4f27('0x33')];if(!_0xcae908[_0x4f27('0x27')]['hasOwnProperty'](_0x4f27('0x42'))){_0x91d9ab[_0x4f27('0x14')]=qs['limit'](_0xcae908['query'][_0x4f27('0x14')]);_0x91d9ab[_0x4f27('0x12')]=qs[_0x4f27('0x12')](_0xcae908[_0x4f27('0x27')][_0x4f27('0x12')]);}return _0x48a3ce[_0x4f27('0x51')](_0x91d9ab);}})['then'](function(_0x675a79){if(_0x675a79){return _0x675a79?{'count':_0x489443,'rows':_0x675a79}:null;}})[_0x4f27('0x16')](respondWithResult(_0x4fab99,null))[_0x4f27('0x2a')](handleError(_0x4fab99,null));};exports['addTeams']=function(_0x284ef8,_0x14c761){var _0x216e72=_0x284ef8[_0x4f27('0x37')][_0x4f27('0x53')];return db[_0x4f27('0x52')][_0x4f27('0x28')]({'where':{'id':_0x216e72},'attributes':['id'],'include':[{'model':db[_0x4f27('0x49')],'as':'Agents','attributes':['id','name',_0x4f27('0x54'),'voicePause',_0x4f27('0x55')],'raw':!![]}]})[_0x4f27('0x16')](function(_0x1ee24d){if(_0x1ee24d){var _0x1e6f5a=_[_0x4f27('0x56')](_0x1ee24d,function(_0x442d2f){var _0x4cd429=_0x442d2f['get']({'plain':!![]});return _0x4cd429[_0x4f27('0x57')];});return db['WhatsappQueue'][_0x4f27('0x35')]({'where':{'id':_0x284ef8['params']['id']}})['then'](function(_0x43fe62){return db['sequelize'][_0x4f27('0x58')](function(_0x398c76){return _0x43fe62[_0x4f27('0x59')](_0x216e72,{'transaction':_0x398c76})[_0x4f27('0x16')](function(){return BPromise[_0x4f27('0x5a')](_0x1e6f5a,function(_0x497837){return db['UserWhatsappQueue'][_0x4f27('0x5b')]({'where':{'UserId':_0x497837['id'],'WhatsappQueueId':_0x284ef8[_0x4f27('0x2c')]['id']},'transaction':_0x398c76});});})['then'](function(){_0x1e6f5a[_0x4f27('0x5c')](function(_0x249f18){socket[_0x4f27('0x5d')]('userWhatsappQueue:save',{'UserId':_0x249f18['id'],'WhatsappQueueId':_0x43fe62['id']});});});});});}})['then'](respondWithStatusCode(_0x14c761,null))['catch'](handleError(_0x14c761,null));};exports[_0x4f27('0x5e')]=function(_0x289f40,_0x46b514){return db[_0x4f27('0x52')][_0x4f27('0x28')]({'where':{'id':_0x289f40['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x4f27('0x49')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4f27('0x16')](handleEntityNotFound(_0x46b514,null))[_0x4f27('0x16')](function(_0x2ca391){var _0x32e63c=_['map'](_0x2ca391,'id');var _0x539853=[];var _0x18df35=[];var _0x50cd35=squel[_0x4f27('0x5f')]();_0x50cd35[_0x4f27('0x60')]('tq.TeamId')[_0x4f27('0x61')](_0x4f27('0x62'),'tq')['join'](_0x4f27('0x63'),'ut',_0x4f27('0x64'))[_0x4f27('0x24')]('WhatsappQueueId\x20=\x20?',_0x289f40[_0x4f27('0x2c')]['id']);for(var _0x124e89=0x0;_0x124e89<_0x2ca391[_0x4f27('0x33')];_0x124e89+=0x1){let _0x1de8b7=_0x2ca391[_0x124e89];for(var _0x38a7b0=0x0;_0x38a7b0<_0x1de8b7['Agents'][_0x4f27('0x33')];_0x38a7b0+=0x1){let _0x4b1bd5=_0x1de8b7[_0x4f27('0x57')][_0x38a7b0];var _0x2af07d=_0x50cd35['clone']();_0x2af07d['where'](_0x4f27('0x65'),_0x4b1bd5['id']);_0x18df35[_0x4f27('0x66')](db[_0x4f27('0x67')]['query'](_0x2af07d[_0x4f27('0x68')](),{'type':db[_0x4f27('0x67')][_0x4f27('0x69')][_0x4f27('0x6a')]})[_0x4f27('0x16')](function(_0xf52e8){if(_0xf52e8[_0x4f27('0x33')]===0x1){return _0x4b1bd5['id'];}else{var _0x14edfb=_[_0x4f27('0x6b')](_[_0x4f27('0x1f')](_0xf52e8,_0x4f27('0x6c')),function(_0x29977d){return _[_0x4f27('0x6d')](_0x32e63c,_0x29977d);});if(_0x14edfb){return _0x4b1bd5['id'];}}}));}}return BPromise['all'](_0x18df35)[_0x4f27('0x16')](function(_0x58a74d){_0x539853=_(_0x539853)[_0x4f27('0x6e')](_0x58a74d)[_0x4f27('0x6f')]()[_0x4f27('0x70')]();return db[_0x4f27('0x25')][_0x4f27('0x35')]({'where':{'id':_0x289f40[_0x4f27('0x2c')]['id']}})[_0x4f27('0x16')](function(_0x257759){return db['sequelize'][_0x4f27('0x58')](function(_0x3b1ff1){return _0x257759[_0x4f27('0x5e')](_0x289f40[_0x4f27('0x27')][_0x4f27('0x53')],{'transaction':_0x3b1ff1})[_0x4f27('0x16')](function(){if(!_['isEmpty'](_0x539853)){return _0x257759[_0x4f27('0x71')](_0x539853,{'transaction':_0x3b1ff1});}})[_0x4f27('0x16')](function(){_0x539853[_0x4f27('0x5c')](function(_0x55740c){socket[_0x4f27('0x5d')](_0x4f27('0x72'),{'UserId':_0x55740c,'WhatsappQueueId':_0x257759['id']});});});});});});})[_0x4f27('0x16')](respondWithStatusCode(_0x46b514,null))[_0x4f27('0x2a')](handleError(_0x46b514,null));};exports[_0x4f27('0x73')]=function(_0x546c5a,_0x12db39){return db['WhatsappQueue'][_0x4f27('0x35')]({'where':{'id':_0x546c5a['params']['id']}})['then'](handleEntityNotFound(_0x12db39,null))['then'](function(_0x294e14){if(_0x294e14){return _0x294e14[_0x4f27('0x73')](_0x546c5a[_0x4f27('0x37')][_0x4f27('0x53')],_[_0x4f27('0x74')](_0x546c5a[_0x4f27('0x37')],[_0x4f27('0x53'),'id'])||{})['spread'](function(_0x10622d){for(var _0x2684b8=0x0;_0x2684b8<_0x546c5a['body'][_0x4f27('0x53')]['length'];_0x2684b8+=0x1){socket['emit'](_0x4f27('0x75'),{'UserId':Number(_0x546c5a[_0x4f27('0x37')][_0x4f27('0x53')][_0x2684b8]),'WhatsappQueueId':Number(_0x546c5a[_0x4f27('0x2c')]['id'])});}return _0x10622d;});}})['then'](respondWithResult(_0x12db39,null))[_0x4f27('0x2a')](handleError(_0x12db39,null));};exports[_0x4f27('0x71')]=function(_0x2f1bfb,_0x25b4de){return db[_0x4f27('0x25')][_0x4f27('0x35')]({'where':{'id':_0x2f1bfb[_0x4f27('0x2c')]['id']}})['then'](handleEntityNotFound(_0x25b4de,null))['then'](function(_0x3e0758){if(_0x3e0758){return _0x3e0758[_0x4f27('0x71')](_0x2f1bfb[_0x4f27('0x27')][_0x4f27('0x53')])['then'](function(){if(_['isArray'](_0x2f1bfb[_0x4f27('0x27')][_0x4f27('0x53')])){for(var _0x49e5b9=0x0;_0x49e5b9<_0x2f1bfb['query'][_0x4f27('0x53')][_0x4f27('0x33')];_0x49e5b9+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x2f1bfb['query'][_0x4f27('0x53')][_0x49e5b9]),'WhatsappQueueId':Number(_0x2f1bfb['params']['id'])});}}else{socket[_0x4f27('0x5d')]('userWhatsappQueue:remove',{'UserId':Number(_0x2f1bfb[_0x4f27('0x27')]['ids']),'WhatsappQueueId':Number(_0x2f1bfb['params']['id'])});}});}})[_0x4f27('0x16')](respondWithStatusCode(_0x25b4de,null))[_0x4f27('0x2a')](handleError(_0x25b4de,null));};exports['getAgents']=function(_0x130a79,_0x9766a5){var _0x4d0af2={};var _0x2f34e5={};var _0x459fae;var _0x18fa1c;return db[_0x4f27('0x25')][_0x4f27('0x76')]({'where':{'id':_0x130a79['params']['id']}})['then'](handleEntityNotFound(_0x9766a5,null))['then'](function(_0x400620){if(_0x400620){_0x459fae=_0x400620;_0x2f34e5[_0x4f27('0x2d')]=_[_0x4f27('0x2e')](db['User']['rawAttributes']);_0x2f34e5['query']=_[_0x4f27('0x2e')](_0x130a79[_0x4f27('0x27')]);_0x2f34e5[_0x4f27('0x2f')]=_[_0x4f27('0x30')](_0x2f34e5[_0x4f27('0x2d')],_0x2f34e5[_0x4f27('0x27')]);_0x4d0af2[_0x4f27('0x32')]=_['intersection'](_0x2f34e5[_0x4f27('0x2d')],qs['fields'](_0x130a79[_0x4f27('0x27')][_0x4f27('0x31')]));_0x4d0af2['attributes']=_0x4d0af2['attributes'][_0x4f27('0x33')]?_0x4d0af2[_0x4f27('0x32')]:_0x2f34e5[_0x4f27('0x2d')];_0x4d0af2[_0x4f27('0x43')]=qs[_0x4f27('0x44')](_0x130a79[_0x4f27('0x27')]['sort']);_0x4d0af2[_0x4f27('0x24')]=qs[_0x4f27('0x2f')](_['pick'](_0x130a79[_0x4f27('0x27')],_0x2f34e5[_0x4f27('0x2f')]));if(_0x130a79['query'][_0x4f27('0x47')]){_0x4d0af2[_0x4f27('0x24')]=_[_0x4f27('0x34')](_0x4d0af2[_0x4f27('0x24')],{'$or':_[_0x4f27('0x1f')](_0x4d0af2[_0x4f27('0x32')],function(_0xf96dec){var _0xc93663={};_0xc93663[_0xf96dec]={'$like':'%'+_0x130a79['query'][_0x4f27('0x47')]+'%'};return _0xc93663;})});}_0x4d0af2=_[_0x4f27('0x34')]({},_0x4d0af2,_0x130a79['options']);return _0x459fae[_0x4f27('0x77')](_0x4d0af2);}})[_0x4f27('0x16')](function(_0x3a19d5){if(_0x3a19d5){_0x18fa1c=_0x3a19d5[_0x4f27('0x33')];if(!_0x130a79[_0x4f27('0x27')]['hasOwnProperty'](_0x4f27('0x42'))){_0x4d0af2[_0x4f27('0x14')]=qs[_0x4f27('0x14')](_0x130a79[_0x4f27('0x27')][_0x4f27('0x14')]);_0x4d0af2['offset']=qs[_0x4f27('0x12')](_0x130a79[_0x4f27('0x27')][_0x4f27('0x12')]);}return _0x459fae[_0x4f27('0x77')](_0x4d0af2);}})[_0x4f27('0x16')](function(_0x42dc98){if(_0x42dc98){return _0x42dc98?{'count':_0x18fa1c,'rows':_0x42dc98}:null;}})[_0x4f27('0x16')](respondWithResult(_0x9766a5,null))[_0x4f27('0x2a')](handleError(_0x9766a5,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index b54d5e5..5051c26 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 _0x6bcf=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x1b99b6,_0x22c487){var _0x2882c7=function(_0x4b11be){while(--_0x4b11be){_0x1b99b6['push'](_0x1b99b6['shift']());}};_0x2882c7(++_0x22c487);}(_0x6bcf,0x117));var _0xf6bc=function(_0x3a185d,_0x17b91){_0x3a185d=_0x3a185d-0x0;var _0x2c454e=_0x6bcf[_0x3a185d];return _0x2c454e;};'use strict';var EventEmitter=require(_0xf6bc('0x0'));var WhatsappQueue=require(_0xf6bc('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xf6bc('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf6bc('0x3'),'afterDestroy':_0xf6bc('0x4')};function emitEvent(_0x312c24){return function(_0x45a3d0,_0x5eb673,_0x2fd3b2){WhatsappQueueEvents['emit'](_0x312c24+':'+_0x45a3d0['id'],_0x45a3d0);WhatsappQueueEvents[_0xf6bc('0x5')](_0x312c24,_0x45a3d0);_0x2fd3b2(null);};}for(var e in events){if(events[_0xf6bc('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xf6bc('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0x4f5b=['hook','../../mysqldb','WhatsappQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x4a8d88,_0x1945ce){var _0xafb736=function(_0x1673a3){while(--_0x1673a3){_0x4a8d88['push'](_0x4a8d88['shift']());}};_0xafb736(++_0x1945ce);}(_0x4f5b,0x141));var _0xb4f5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4f5b[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xb4f5('0x0'))['db'][_0xb4f5('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb4f5('0x2'),'afterUpdate':_0xb4f5('0x3'),'afterDestroy':_0xb4f5('0x4')};function emitEvent(_0x5cf325){return function(_0x101c62,_0x26de98,_0x397ab5){WhatsappQueueEvents['emit'](_0x5cf325+':'+_0x101c62['id'],_0x101c62);WhatsappQueueEvents[_0xb4f5('0x5')](_0x5cf325,_0x101c62);_0x397ab5(null);};}for(var e in events){if(events[_0xb4f5('0x6')](e)){var event=events[e];WhatsappQueue[_0xb4f5('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 5eaf699..5754b41 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 _0x0552=['define','WhatsappQueue','whatsapp_queues','lodash','util','moment','request-promise','path','../../config/environment','./whatsappQueue.attributes','exports'];(function(_0x179dd1,_0x37cc40){var _0x4d4b4c=function(_0x19eae6){while(--_0x19eae6){_0x179dd1['push'](_0x179dd1['shift']());}};_0x4d4b4c(++_0x37cc40);}(_0x0552,0x179));var _0x2055=function(_0xb3b56c,_0x3f8ec1){_0xb3b56c=_0xb3b56c-0x0;var _0x25680d=_0x0552[_0xb3b56c];return _0x25680d;};'use strict';var _=require(_0x2055('0x0'));var util=require(_0x2055('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2055('0x2'));var BPromise=require('bluebird');var rp=require(_0x2055('0x3'));var fs=require('fs');var path=require(_0x2055('0x4'));var rimraf=require('rimraf');var config=require(_0x2055('0x5'));var attributes=require(_0x2055('0x6'));module[_0x2055('0x7')]=function(_0xa005eb,_0xb3e86a){return _0xa005eb[_0x2055('0x8')](_0x2055('0x9'),attributes,{'tableName':_0x2055('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b1b=['api','moment','request-promise','path','rimraf','../../config/environment','exports','WhatsappQueue','util','../../config/logger'];(function(_0x35450e,_0x1ad7b3){var _0xfbb741=function(_0x254135){while(--_0x254135){_0x35450e['push'](_0x35450e['shift']());}};_0xfbb741(++_0x1ad7b3);}(_0x1b1b,0xd0));var _0xb1b1=function(_0x5d685d,_0x5f5d84){_0x5d685d=_0x5d685d-0x0;var _0x20304d=_0x1b1b[_0x5d685d];return _0x20304d;};'use strict';var _=require('lodash');var util=require(_0xb1b1('0x0'));var logger=require(_0xb1b1('0x1'))(_0xb1b1('0x2'));var moment=require(_0xb1b1('0x3'));var BPromise=require('bluebird');var rp=require(_0xb1b1('0x4'));var fs=require('fs');var path=require(_0xb1b1('0x5'));var rimraf=require(_0xb1b1('0x6'));var config=require(_0xb1b1('0x7'));var attributes=require('./whatsappQueue.attributes');module[_0xb1b1('0x8')]=function(_0x5721c0,_0x283433){return _0x5721c0['define'](_0xb1b1('0x9'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 363d914..5e9782b 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 _0xfba3=['info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','include','map','model','debug','ShowWhatsappQueue','util','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','./whatsappQueue.socket','register','request','then'];(function(_0x2461a0,_0x26167f){var _0x2fadbd=function(_0x493f1b){while(--_0x493f1b){_0x2461a0['push'](_0x2461a0['shift']());}};_0x2fadbd(++_0x26167f);}(_0xfba3,0x18a));var _0x3fba=function(_0x239619,_0x23bf6e){_0x239619=_0x239619-0x0;var _0x3a4192=_0xfba3[_0x239619];return _0x3a4192;};'use strict';var _=require('lodash');var util=require(_0x3fba('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3fba('0x1'));var fs=require('fs');var Redis=require(_0x3fba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3fba('0x3'));var logger=require(_0x3fba('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3fba('0x5'));var client=jayson['client'][_0x3fba('0x6')]({'port':0x232a});config[_0x3fba('0x7')]=_[_0x3fba('0x8')](config[_0x3fba('0x7')],{'host':_0x3fba('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3fba('0x7')]));require(_0x3fba('0xa'))[_0x3fba('0xb')](socket);function respondWithRpcPromise(_0x4d4ab0,_0xdf860f,_0x3c1990){return new BPromise(function(_0x35debe,_0xf6a4cc){return client[_0x3fba('0xc')](_0x4d4ab0,_0x3c1990)[_0x3fba('0xd')](function(_0xf43dd4){logger[_0x3fba('0xe')](_0x3fba('0xf'),_0xdf860f,_0x3fba('0x10'));logger['debug'](_0x3fba('0x11'),_0xdf860f,_0x3fba('0x10'),JSON[_0x3fba('0x12')](_0xf43dd4));if(_0xf43dd4[_0x3fba('0x13')]){if(_0xf43dd4[_0x3fba('0x13')][_0x3fba('0x14')]===0x1f4){logger[_0x3fba('0x13')](_0x3fba('0xf'),_0xdf860f,_0xf43dd4['error']['message']);return _0xf6a4cc(_0xf43dd4[_0x3fba('0x13')][_0x3fba('0x15')]);}logger[_0x3fba('0x13')](_0x3fba('0xf'),_0xdf860f,_0xf43dd4['error'][_0x3fba('0x15')]);return _0x35debe(_0xf43dd4[_0x3fba('0x13')]['message']);}else{logger[_0x3fba('0xe')]('WhatsappQueue,\x20%s,\x20%s',_0xdf860f,'request\x20sent');_0x35debe(_0xf43dd4['result']['message']);}})[_0x3fba('0x16')](function(_0x2438cf){logger[_0x3fba('0x13')](_0x3fba('0xf'),_0xdf860f,_0x2438cf);_0xf6a4cc(_0x2438cf);});});}exports[_0x3fba('0x17')]=function(_0x4bdf41){var _0x4f8690=this;return new Promise(function(_0x8fcf66,_0x361eb8){return db[_0x3fba('0x18')]['findAll']({'raw':_0x4bdf41['options']?_0x4bdf41[_0x3fba('0x19')][_0x3fba('0x1a')]===undefined?!![]:![]:!![],'where':_0x4bdf41[_0x3fba('0x19')]?_0x4bdf41[_0x3fba('0x19')][_0x3fba('0x1b')]||null:null,'attributes':_0x4bdf41[_0x3fba('0x19')]?_0x4bdf41[_0x3fba('0x19')][_0x3fba('0x1c')]||null:null,'limit':_0x4bdf41['options']?_0x4bdf41[_0x3fba('0x19')]['limit']||null:null,'include':_0x4bdf41['options']?_0x4bdf41[_0x3fba('0x19')][_0x3fba('0x1d')]?_[_0x3fba('0x1e')](_0x4bdf41[_0x3fba('0x19')][_0x3fba('0x1d')],function(_0x34b465){return{'model':db[_0x34b465[_0x3fba('0x1f')]],'as':_0x34b465['as'],'attributes':_0x34b465[_0x3fba('0x1c')],'include':_0x34b465[_0x3fba('0x1d')]?_['map'](_0x34b465[_0x3fba('0x1d')],function(_0x337092){return{'model':db[_0x337092[_0x3fba('0x1f')]],'as':_0x337092['as'],'attributes':_0x337092[_0x3fba('0x1c')],'include':_0x337092[_0x3fba('0x1d')]?_[_0x3fba('0x1e')](_0x337092[_0x3fba('0x1d')],function(_0x382cf5){return{'model':db[_0x382cf5[_0x3fba('0x1f')]],'as':_0x382cf5['as'],'attributes':_0x382cf5[_0x3fba('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3fba('0xd')](function(_0x1e1d63){logger[_0x3fba('0xe')](_0x3fba('0x17'),_0x4bdf41);logger[_0x3fba('0x20')]('GetWhatsappQueue',_0x4bdf41,JSON[_0x3fba('0x12')](_0x1e1d63));_0x8fcf66(_0x1e1d63);})[_0x3fba('0x16')](function(_0x8d7de5){logger[_0x3fba('0x13')](_0x3fba('0x17'),_0x8d7de5[_0x3fba('0x15')],_0x4bdf41);_0x361eb8(_0x4f8690['error'](0x1f4,_0x8d7de5['message']));});});};exports[_0x3fba('0x21')]=function(_0x397fc2){var _0x4583ec=this;return new Promise(function(_0x2597e6,_0x2895d7){return db[_0x3fba('0x18')]['find']({'raw':_0x397fc2['options']?_0x397fc2[_0x3fba('0x19')][_0x3fba('0x1a')]===undefined?!![]:![]:!![],'where':_0x397fc2[_0x3fba('0x19')]?_0x397fc2[_0x3fba('0x19')][_0x3fba('0x1b')]||null:null,'attributes':_0x397fc2[_0x3fba('0x19')]?_0x397fc2[_0x3fba('0x19')][_0x3fba('0x1c')]||null:null,'include':_0x397fc2['options']?_0x397fc2['options']['include']?_['map'](_0x397fc2[_0x3fba('0x19')][_0x3fba('0x1d')],function(_0x546e47){return{'model':db[_0x546e47[_0x3fba('0x1f')]],'as':_0x546e47['as'],'attributes':_0x546e47[_0x3fba('0x1c')],'include':_0x546e47['include']?_['map'](_0x546e47[_0x3fba('0x1d')],function(_0x2831d0){return{'model':db[_0x2831d0[_0x3fba('0x1f')]],'as':_0x2831d0['as'],'attributes':_0x2831d0[_0x3fba('0x1c')],'include':_0x2831d0[_0x3fba('0x1d')]?_[_0x3fba('0x1e')](_0x2831d0[_0x3fba('0x1d')],function(_0xb14b56){return{'model':db[_0xb14b56['model']],'as':_0xb14b56['as'],'attributes':_0xb14b56[_0x3fba('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3fba('0xd')](function(_0x5a8d20){logger[_0x3fba('0xe')]('ShowWhatsappQueue',_0x397fc2);logger[_0x3fba('0x20')](_0x3fba('0x21'),_0x397fc2,JSON[_0x3fba('0x12')](_0x5a8d20));_0x2597e6(_0x5a8d20);})[_0x3fba('0x16')](function(_0x41ec54){logger[_0x3fba('0x13')](_0x3fba('0x21'),_0x41ec54['message'],_0x397fc2);_0x2895d7(_0x4583ec[_0x3fba('0x13')](0x1f4,_0x41ec54[_0x3fba('0x15')]));});});}; \ No newline at end of file +var _0x71ad=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','WhatsappQueue','findAll','options','raw','where','attributes','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','find','lodash','util','moment','bluebird'];(function(_0x2f833f,_0x340e0c){var _0x5b78a0=function(_0x19b747){while(--_0x19b747){_0x2f833f['push'](_0x2f833f['shift']());}};_0x5b78a0(++_0x340e0c);}(_0x71ad,0x144));var _0xd71a=function(_0x549fcf,_0x266daa){_0x549fcf=_0x549fcf-0x0;var _0x47158c=_0x71ad[_0x549fcf];return _0x47158c;};'use strict';var _=require(_0xd71a('0x0'));var util=require(_0xd71a('0x1'));var moment=require(_0xd71a('0x2'));var BPromise=require(_0xd71a('0x3'));var rs=require(_0xd71a('0x4'));var fs=require('fs');var Redis=require(_0xd71a('0x5'));var db=require(_0xd71a('0x6'))['db'];var utils=require(_0xd71a('0x7'));var logger=require('../../config/logger')(_0xd71a('0x8'));var config=require(_0xd71a('0x9'));var jayson=require(_0xd71a('0xa'));var client=jayson[_0xd71a('0xb')][_0xd71a('0xc')]({'port':0x232a});config[_0xd71a('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd71a('0xe'))(new Redis(config['redis']));require(_0xd71a('0xf'))[_0xd71a('0x10')](socket);function respondWithRpcPromise(_0x490461,_0x1fa4df,_0x45c2fb){return new BPromise(function(_0x53e507,_0x339994){return client[_0xd71a('0x11')](_0x490461,_0x45c2fb)[_0xd71a('0x12')](function(_0x213e51){logger[_0xd71a('0x13')](_0xd71a('0x14'),_0x1fa4df,_0xd71a('0x15'));logger[_0xd71a('0x16')](_0xd71a('0x17'),_0x1fa4df,_0xd71a('0x15'),JSON[_0xd71a('0x18')](_0x213e51));if(_0x213e51[_0xd71a('0x19')]){if(_0x213e51[_0xd71a('0x19')][_0xd71a('0x1a')]===0x1f4){logger[_0xd71a('0x19')](_0xd71a('0x14'),_0x1fa4df,_0x213e51[_0xd71a('0x19')]['message']);return _0x339994(_0x213e51['error']['message']);}logger[_0xd71a('0x19')](_0xd71a('0x14'),_0x1fa4df,_0x213e51[_0xd71a('0x19')][_0xd71a('0x1b')]);return _0x53e507(_0x213e51[_0xd71a('0x19')][_0xd71a('0x1b')]);}else{logger[_0xd71a('0x13')](_0xd71a('0x14'),_0x1fa4df,_0xd71a('0x15'));_0x53e507(_0x213e51['result'][_0xd71a('0x1b')]);}})[_0xd71a('0x1c')](function(_0x234479){logger[_0xd71a('0x19')](_0xd71a('0x14'),_0x1fa4df,_0x234479);_0x339994(_0x234479);});});}exports['GetWhatsappQueue']=function(_0x4da502){var _0x4eb1f4=this;return new Promise(function(_0x4041c3,_0x14db3b){return db[_0xd71a('0x1d')][_0xd71a('0x1e')]({'raw':_0x4da502[_0xd71a('0x1f')]?_0x4da502[_0xd71a('0x1f')][_0xd71a('0x20')]===undefined?!![]:![]:!![],'where':_0x4da502[_0xd71a('0x1f')]?_0x4da502[_0xd71a('0x1f')][_0xd71a('0x21')]||null:null,'attributes':_0x4da502[_0xd71a('0x1f')]?_0x4da502[_0xd71a('0x1f')][_0xd71a('0x22')]||null:null,'limit':_0x4da502['options']?_0x4da502[_0xd71a('0x1f')]['limit']||null:null,'include':_0x4da502[_0xd71a('0x1f')]?_0x4da502[_0xd71a('0x1f')][_0xd71a('0x23')]?_[_0xd71a('0x24')](_0x4da502[_0xd71a('0x1f')]['include'],function(_0x120b6d){return{'model':db[_0x120b6d[_0xd71a('0x25')]],'as':_0x120b6d['as'],'attributes':_0x120b6d[_0xd71a('0x22')],'include':_0x120b6d[_0xd71a('0x23')]?_[_0xd71a('0x24')](_0x120b6d[_0xd71a('0x23')],function(_0x278a8d){return{'model':db[_0x278a8d['model']],'as':_0x278a8d['as'],'attributes':_0x278a8d['attributes'],'include':_0x278a8d[_0xd71a('0x23')]?_['map'](_0x278a8d[_0xd71a('0x23')],function(_0x2af311){return{'model':db[_0x2af311[_0xd71a('0x25')]],'as':_0x2af311['as'],'attributes':_0x2af311[_0xd71a('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd71a('0x12')](function(_0x44e650){logger[_0xd71a('0x13')](_0xd71a('0x26'),_0x4da502);logger[_0xd71a('0x16')]('GetWhatsappQueue',_0x4da502,JSON[_0xd71a('0x18')](_0x44e650));_0x4041c3(_0x44e650);})[_0xd71a('0x1c')](function(_0x20715d){logger[_0xd71a('0x19')](_0xd71a('0x26'),_0x20715d[_0xd71a('0x1b')],_0x4da502);_0x14db3b(_0x4eb1f4[_0xd71a('0x19')](0x1f4,_0x20715d['message']));});});};exports[_0xd71a('0x27')]=function(_0xb79cad){var _0x1e1096=this;return new Promise(function(_0x5f24dc,_0x222af9){return db[_0xd71a('0x1d')][_0xd71a('0x28')]({'raw':_0xb79cad[_0xd71a('0x1f')]?_0xb79cad[_0xd71a('0x1f')][_0xd71a('0x20')]===undefined?!![]:![]:!![],'where':_0xb79cad[_0xd71a('0x1f')]?_0xb79cad[_0xd71a('0x1f')][_0xd71a('0x21')]||null:null,'attributes':_0xb79cad[_0xd71a('0x1f')]?_0xb79cad[_0xd71a('0x1f')][_0xd71a('0x22')]||null:null,'include':_0xb79cad[_0xd71a('0x1f')]?_0xb79cad[_0xd71a('0x1f')][_0xd71a('0x23')]?_['map'](_0xb79cad[_0xd71a('0x1f')][_0xd71a('0x23')],function(_0x14edde){return{'model':db[_0x14edde['model']],'as':_0x14edde['as'],'attributes':_0x14edde[_0xd71a('0x22')],'include':_0x14edde[_0xd71a('0x23')]?_['map'](_0x14edde[_0xd71a('0x23')],function(_0x50cf61){return{'model':db[_0x50cf61[_0xd71a('0x25')]],'as':_0x50cf61['as'],'attributes':_0x50cf61[_0xd71a('0x22')],'include':_0x50cf61['include']?_[_0xd71a('0x24')](_0x50cf61['include'],function(_0x2495f2){return{'model':db[_0x2495f2['model']],'as':_0x2495f2['as'],'attributes':_0x2495f2['attributes']};}):[]};}):[]};}):[]:[]})[_0xd71a('0x12')](function(_0x3ae37c){logger[_0xd71a('0x13')]('ShowWhatsappQueue',_0xb79cad);logger['debug'](_0xd71a('0x27'),_0xb79cad,JSON['stringify'](_0x3ae37c));_0x5f24dc(_0x3ae37c);})[_0xd71a('0x1c')](function(_0x1a65e5){logger[_0xd71a('0x19')](_0xd71a('0x27'),_0x1a65e5[_0xd71a('0x1b')],_0xb79cad);_0x222af9(_0x1e1096['error'](0x1f4,_0x1a65e5[_0xd71a('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index d7c9615..2f97dc2 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 _0xc680=['save','remove','update','removeListener','length','whatsappQueue:'];(function(_0x4f3021,_0x15bf04){var _0xd62bcd=function(_0x18ec51){while(--_0x18ec51){_0x4f3021['push'](_0x4f3021['shift']());}};_0xd62bcd(++_0x15bf04);}(_0xc680,0x96));var _0x0c68=function(_0x3dfe7b,_0x4e3475){_0x3dfe7b=_0x3dfe7b-0x0;var _0x147717=_0xc680[_0x3dfe7b];return _0x147717;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x0c68('0x0'),_0x0c68('0x1'),_0x0c68('0x2')];function createListener(_0xfd165c,_0x2c6974){return function(_0x5bdd87){_0x2c6974['emit'](_0xfd165c,_0x5bdd87);};}function removeListener(_0x11c49e,_0x24be68){return function(){WhatsappQueueEvents[_0x0c68('0x3')](_0x11c49e,_0x24be68);};}exports['register']=function(_0x204af0){for(var _0x1d7c9b=0x0,_0x58e733=events[_0x0c68('0x4')];_0x1d7c9b<_0x58e733;_0x1d7c9b++){var _0x2e03eb=events[_0x1d7c9b];var _0x51523e=createListener(_0x0c68('0x5')+_0x2e03eb,_0x204af0);WhatsappQueueEvents['on'](_0x2e03eb,_0x51523e);}}; \ No newline at end of file +var _0x1e07=['whatsappQueue:','save','remove','removeListener','length'];(function(_0x25653d,_0x19e9d6){var _0x426255=function(_0x48e765){while(--_0x48e765){_0x25653d['push'](_0x25653d['shift']());}};_0x426255(++_0x19e9d6);}(_0x1e07,0x6a));var _0x71e0=function(_0x2a73f5,_0x8dd359){_0x2a73f5=_0x2a73f5-0x0;var _0x547545=_0x1e07[_0x2a73f5];return _0x547545;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x71e0('0x0'),_0x71e0('0x1'),'update'];function createListener(_0x4f4577,_0x3df802){return function(_0x8dc923){_0x3df802['emit'](_0x4f4577,_0x8dc923);};}function removeListener(_0x2ac902,_0x5a6fe8){return function(){WhatsappQueueEvents[_0x71e0('0x2')](_0x2ac902,_0x5a6fe8);};}exports['register']=function(_0x2c0656){for(var _0x4f8d16=0x0,_0x4fbc58=events[_0x71e0('0x3')];_0x4f8d16<_0x4fbc58;_0x4f8d16++){var _0x2b46be=events[_0x4f8d16];var _0xc559d=createListener(_0x71e0('0x4')+_0x2b46be,_0x2c0656);WhatsappQueueEvents['on'](_0x2b46be,_0xc559d);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 8effb08..e0eff03 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 _0x59ca=['put','update','delete','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x38ca9c,_0x11abbf){var _0x443f43=function(_0x3a0eea){while(--_0x3a0eea){_0x38ca9c['push'](_0x38ca9c['shift']());}};_0x443f43(++_0x11abbf);}(_0x59ca,0x16a));var _0xa59c=function(_0x19d753,_0x5691b6){_0x19d753=_0x19d753-0x0;var _0xac78c5=_0x59ca[_0x19d753];return _0xac78c5;};'use strict';var multer=require(_0xa59c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa59c('0x1'));var router=express[_0xa59c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa59c('0x3'));var interaction=require(_0xa59c('0x4'));var config=require(_0xa59c('0x5'));var controller=require(_0xa59c('0x6'));router[_0xa59c('0x7')]('/',auth[_0xa59c('0x8')](),controller[_0xa59c('0x9')]);router['get'](_0xa59c('0xa'),auth['isAuthenticated'](),controller[_0xa59c('0xb')]);router[_0xa59c('0x7')](_0xa59c('0xc'),auth[_0xa59c('0x8')](),controller[_0xa59c('0xd')]);router[_0xa59c('0xe')]('/',auth['isAuthenticated'](),controller[_0xa59c('0xf')]);router[_0xa59c('0x10')](_0xa59c('0xc'),auth[_0xa59c('0x8')](),controller[_0xa59c('0x11')]);router[_0xa59c('0x12')]('/:id',auth[_0xa59c('0x8')](),controller[_0xa59c('0x13')]);module[_0xa59c('0x14')]=router; \ No newline at end of file +var _0xd962=['show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','/describe','isAuthenticated','describe','/:id'];(function(_0x3be41d,_0x249341){var _0x2f0828=function(_0x3eae70){while(--_0x3eae70){_0x3be41d['push'](_0x3be41d['shift']());}};_0x2f0828(++_0x249341);}(_0xd962,0x1a6));var _0x2d96=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xd962[_0x58dc25];return _0x21b0a7;};'use strict';var multer=require('multer');var util=require(_0x2d96('0x0'));var path=require(_0x2d96('0x1'));var timeout=require(_0x2d96('0x2'));var express=require(_0x2d96('0x3'));var router=express[_0x2d96('0x4')]();var fs_extra=require(_0x2d96('0x5'));var auth=require(_0x2d96('0x6'));var interaction=require(_0x2d96('0x7'));var config=require(_0x2d96('0x8'));var controller=require(_0x2d96('0x9'));router[_0x2d96('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2d96('0xa')](_0x2d96('0xb'),auth[_0x2d96('0xc')](),controller[_0x2d96('0xd')]);router[_0x2d96('0xa')](_0x2d96('0xe'),auth[_0x2d96('0xc')](),controller[_0x2d96('0xf')]);router[_0x2d96('0x10')]('/',auth[_0x2d96('0xc')](),controller[_0x2d96('0x11')]);router[_0x2d96('0x12')](_0x2d96('0xe'),auth['isAuthenticated'](),controller[_0x2d96('0x13')]);router[_0x2d96('0x14')](_0x2d96('0xe'),auth[_0x2d96('0xc')](),controller[_0x2d96('0x15')]);module[_0x2d96('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 20926e6..dd0aa3c 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 _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x2bb4b0,_0x4057da){var _0xa9d999=function(_0x426e62){while(--_0x426e62){_0x2bb4b0['push'](_0x2bb4b0['shift']());}};_0xa9d999(++_0x4057da);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x175601,_0x3e15d3){var _0x6062b9=function(_0x1a5ba1){while(--_0x1a5ba1){_0x175601['push'](_0x175601['shift']());}};_0x6062b9(++_0x3e15d3);}(_0x7a54,0x106));var _0x47a5=function(_0x58f4d4,_0x627289){_0x58f4d4=_0x58f4d4-0x0;var _0x4d524e=_0x7a54[_0x58f4d4];return _0x4d524e;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index e37d506..1e90f1f 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 _0xed3c=['../../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','end','error','stack','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','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'];(function(_0xea246d,_0x5d49dd){var _0x50ec9a=function(_0x882213){while(--_0x882213){_0xea246d['push'](_0xea246d['shift']());}};_0x50ec9a(++_0x5d49dd);}(_0xed3c,0x1a6));var _0xced3=function(_0x14e8d3,_0x67e3a){_0x14e8d3=_0x14e8d3-0x0;var _0x1f565b=_0xed3c[_0x14e8d3];return _0x1f565b;};'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(){_0x559fa2['status'](0xcc)[_0xced3('0x23')]();});}};}function handleEntityNotFound(_0x23f92b,_0x4fc285){return function(_0x3fb4f9){if(!_0x3fb4f9){_0x23f92b['sendStatus'](0x194);}return _0x3fb4f9;};}function handleError(_0x1dcc52,_0x4123ba){_0x4123ba=_0x4123ba||0x1f4;return function(_0x3b728d){logger[_0xced3('0x24')](_0x3b728d[_0xced3('0x25')]);if(_0x3b728d['name']){delete _0x3b728d['name'];}_0x1dcc52[_0xced3('0x17')](_0x4123ba)['send'](_0x3b728d);};}exports[_0xced3('0x26')]=function(_0x1e6923,_0x4a8e85){var _0x3db664={},_0x4024fa={},_0x196956={'count':0x0,'rows':[]};var _0x1032d6=_[_0xced3('0x27')](db[_0xced3('0x28')][_0xced3('0x29')],function(_0x41d003){return{'name':_0x41d003[_0xced3('0x2a')],'type':_0x41d003['type'][_0xced3('0x2b')]};});_0x4024fa[_0xced3('0x2c')]=_[_0xced3('0x27')](_0x1032d6,_0xced3('0x2d'));_0x4024fa[_0xced3('0x2e')]=_[_0xced3('0x2f')](_0x1e6923[_0xced3('0x2e')]);_0x4024fa[_0xced3('0x30')]=_[_0xced3('0x31')](_0x4024fa[_0xced3('0x2c')],_0x4024fa[_0xced3('0x2e')]);_0x3db664[_0xced3('0x32')]=_[_0xced3('0x31')](_0x4024fa[_0xced3('0x2c')],qs[_0xced3('0x33')](_0x1e6923[_0xced3('0x2e')][_0xced3('0x33')]));_0x3db664[_0xced3('0x32')]=_0x3db664[_0xced3('0x32')][_0xced3('0x34')]?_0x3db664[_0xced3('0x32')]:_0x4024fa['model'];if(!_0x1e6923[_0xced3('0x2e')]['hasOwnProperty'](_0xced3('0x35'))){_0x3db664[_0xced3('0x1a')]=qs[_0xced3('0x1a')](_0x1e6923[_0xced3('0x2e')][_0xced3('0x1a')]);_0x3db664[_0xced3('0x1c')]=qs[_0xced3('0x1c')](_0x1e6923[_0xced3('0x2e')][_0xced3('0x1c')]);}_0x3db664[_0xced3('0x36')]=qs['sort'](_0x1e6923[_0xced3('0x2e')][_0xced3('0x37')]);_0x3db664['where']=qs[_0xced3('0x30')](_[_0xced3('0x38')](_0x1e6923[_0xced3('0x2e')],_0x4024fa['filters']),_0x1032d6);if(_0x1e6923['query'][_0xced3('0x39')]){_0x3db664['where']=_[_0xced3('0x3a')](_0x3db664[_0xced3('0x3b')],{'$or':_['map'](_0x1032d6,function(_0x180b65){if(_0x180b65[_0xced3('0x3c')]!==_0xced3('0x3d')){var _0x58b344={};_0x58b344[_0x180b65[_0xced3('0x2d')]]={'$like':'%'+_0x1e6923['query']['filter']+'%'};return _0x58b344;}})});}_0x3db664=_[_0xced3('0x3a')]({},_0x3db664,_0x1e6923[_0xced3('0x3e')]);var _0x217bff={'where':_0x3db664['where']};return db[_0xced3('0x28')][_0xced3('0x1b')](_0x217bff)[_0xced3('0x21')](function(_0x28626b){_0x196956[_0xced3('0x1b')]=_0x28626b;if(_0x1e6923[_0xced3('0x2e')][_0xced3('0x3f')]){_0x3db664[_0xced3('0x40')]=[{'all':!![]}];}return db[_0xced3('0x28')][_0xced3('0x41')](_0x3db664);})[_0xced3('0x21')](function(_0x38855f){_0x196956[_0xced3('0x42')]=_0x38855f;return _0x196956;})[_0xced3('0x21')](respondWithFilteredResult(_0x4a8e85,_0x3db664))[_0xced3('0x43')](handleError(_0x4a8e85,null));};exports['show']=function(_0x4279a3,_0x2ec0ad){var _0x44ff72={'raw':!![],'where':{'id':_0x4279a3[_0xced3('0x44')]['id']}},_0x1a6c1f={};_0x1a6c1f[_0xced3('0x2c')]=_[_0xced3('0x2f')](db[_0xced3('0x28')][_0xced3('0x29')]);_0x1a6c1f['query']=_[_0xced3('0x2f')](_0x4279a3['query']);_0x1a6c1f[_0xced3('0x30')]=_[_0xced3('0x31')](_0x1a6c1f[_0xced3('0x2c')],_0x1a6c1f['query']);_0x44ff72[_0xced3('0x32')]=_[_0xced3('0x31')](_0x1a6c1f[_0xced3('0x2c')],qs[_0xced3('0x33')](_0x4279a3['query'][_0xced3('0x33')]));_0x44ff72[_0xced3('0x32')]=_0x44ff72[_0xced3('0x32')][_0xced3('0x34')]?_0x44ff72[_0xced3('0x32')]:_0x1a6c1f['model'];if(_0x4279a3[_0xced3('0x2e')][_0xced3('0x3f')]){_0x44ff72[_0xced3('0x40')]=[{'all':!![]}];}_0x44ff72=_[_0xced3('0x3a')]({},_0x44ff72,_0x4279a3[_0xced3('0x3e')]);return db[_0xced3('0x28')][_0xced3('0x45')](_0x44ff72)['then'](handleEntityNotFound(_0x2ec0ad,null))[_0xced3('0x21')](respondWithResult(_0x2ec0ad,null))[_0xced3('0x43')](handleError(_0x2ec0ad,null));};exports['create']=function(_0x569c3d,_0x140df2){return db['WhatsappQueueReport'][_0xced3('0x46')](_0x569c3d[_0xced3('0x47')],{})[_0xced3('0x21')](respondWithResult(_0x140df2,0xc9))[_0xced3('0x43')](handleError(_0x140df2,null));};exports[_0xced3('0x20')]=function(_0x1b3396,_0x3700ed){if(_0x1b3396[_0xced3('0x47')]['id']){delete _0x1b3396[_0xced3('0x47')]['id'];}return db['WhatsappQueueReport'][_0xced3('0x45')]({'where':{'id':_0x1b3396[_0xced3('0x44')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x3700ed,null))[_0xced3('0x21')](saveUpdates(_0x1b3396[_0xced3('0x47')],null))[_0xced3('0x21')](respondWithResult(_0x3700ed,null))['catch'](handleError(_0x3700ed,null));};exports[_0xced3('0x22')]=function(_0x629ecf,_0x74f70){return db[_0xced3('0x28')][_0xced3('0x45')]({'where':{'id':_0x629ecf[_0xced3('0x44')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x74f70,null))[_0xced3('0x21')](removeEntity(_0x74f70,null))[_0xced3('0x43')](handleError(_0x74f70,null));};exports[_0xced3('0x48')]=function(_0x257ff0,_0x3e2a19){return db['WhatsappQueueReport'][_0xced3('0x48')]()['then'](respondWithResult(_0x3e2a19,null))[_0xced3('0x43')](handleError(_0x3e2a19,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(_0x5d5b95,_0x397591){var _0x27bb1e=function(_0x38ed91){while(--_0x38ed91){_0x5d5b95['push'](_0x5d5b95['shift']());}};_0x27bb1e(++_0x397591);}(_0xb03e,0x1eb));var _0xeb03=function(_0x12612d,_0x4ba767){_0x12612d=_0x12612d-0x0;var _0x91786b=_0xb03e[_0x12612d];return _0x91786b;};'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 722e23e..7198333 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 _0x63b9=['./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2f65e6,_0x40ea61){var _0x26c6f8=function(_0x5d0bcc){while(--_0x5d0bcc){_0x2f65e6['push'](_0x2f65e6['shift']());}};_0x26c6f8(++_0x40ea61);}(_0x63b9,0xfc));var _0x963b=function(_0x24491d,_0x2ca89d){_0x24491d=_0x24491d-0x0;var _0xfc5d6d=_0x63b9[_0x24491d];return _0xfc5d6d;};'use strict';var _=require(_0x963b('0x0'));var util=require('util');var logger=require(_0x963b('0x1'))('api');var moment=require(_0x963b('0x2'));var BPromise=require(_0x963b('0x3'));var rp=require(_0x963b('0x4'));var fs=require('fs');var path=require(_0x963b('0x5'));var rimraf=require(_0x963b('0x6'));var config=require(_0x963b('0x7'));var attributes=require(_0x963b('0x8'));module['exports']=function(_0x5705b7,_0x1b48fa){return _0x5705b7[_0x963b('0x9')](_0x963b('0xa'),attributes,{'tableName':_0x963b('0xb'),'paranoid':![],'indexes':[{'name':_0x963b('0xc'),'fields':[_0x963b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf7fc=['../../config/logger','api','path','rimraf','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util'];(function(_0x379799,_0x4ccf16){var _0x46e431=function(_0x34bd4d){while(--_0x34bd4d){_0x379799['push'](_0x379799['shift']());}};_0x46e431(++_0x4ccf16);}(_0xf7fc,0xae));var _0xcf7f=function(_0x50cfe1,_0x467bdb){_0x50cfe1=_0x50cfe1-0x0;var _0x696d51=_0xf7fc[_0x50cfe1];return _0x696d51;};'use strict';var _=require(_0xcf7f('0x0'));var util=require(_0xcf7f('0x1'));var logger=require(_0xcf7f('0x2'))(_0xcf7f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf7f('0x4'));var rimraf=require(_0xcf7f('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0xcf7f('0x6')]=function(_0x3a1f2a,_0x51851f){return _0x3a1f2a[_0xcf7f('0x7')](_0xcf7f('0x8'),attributes,{'tableName':_0xcf7f('0x9'),'paranoid':![],'indexes':[{'name':_0xcf7f('0xa'),'fields':[_0xcf7f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 0f5762e..199b238 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 _0xaefc=['attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','WhatsappQueueReport','body','options','raw','CreateWhatsappQueueReport','debug','UpdateWhatsappQueueReport','update','where'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xaefc,0xe9));var _0xcaef=function(_0xeabe35,_0x6c5569){_0xeabe35=_0xeabe35-0x0;var _0x376831=_0xaefc[_0xeabe35];return _0x376831;};'use strict';var _=require(_0xcaef('0x0'));var util=require(_0xcaef('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcaef('0x2'));var fs=require('fs');var Redis=require(_0xcaef('0x3'));var db=require(_0xcaef('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcaef('0x5'))(_0xcaef('0x6'));var config=require(_0xcaef('0x7'));var jayson=require(_0xcaef('0x8'));var client=jayson[_0xcaef('0x9')][_0xcaef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5452d1,_0x189fe1,_0x2dc529){return new BPromise(function(_0x58a340,_0x5b0ac2){return client[_0xcaef('0xb')](_0x5452d1,_0x2dc529)[_0xcaef('0xc')](function(_0x3e8266){logger[_0xcaef('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x189fe1,_0xcaef('0xe'));logger['debug'](_0xcaef('0xf'),_0x189fe1,_0xcaef('0xe'),JSON[_0xcaef('0x10')](_0x3e8266));if(_0x3e8266[_0xcaef('0x11')]){if(_0x3e8266['error']['code']===0x1f4){logger['error'](_0xcaef('0x12'),_0x189fe1,_0x3e8266[_0xcaef('0x11')][_0xcaef('0x13')]);return _0x5b0ac2(_0x3e8266[_0xcaef('0x11')][_0xcaef('0x13')]);}logger[_0xcaef('0x11')](_0xcaef('0x12'),_0x189fe1,_0x3e8266['error']['message']);return _0x58a340(_0x3e8266['error'][_0xcaef('0x13')]);}else{logger[_0xcaef('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x189fe1,'request\x20sent');_0x58a340(_0x3e8266[_0xcaef('0x14')][_0xcaef('0x13')]);}})[_0xcaef('0x15')](function(_0x4e052e){logger[_0xcaef('0x11')](_0xcaef('0x12'),_0x189fe1,_0x4e052e);_0x5b0ac2(_0x4e052e);});});}exports['CreateWhatsappQueueReport']=function(_0x272c8c){var _0x5599a1=this;return new Promise(function(_0x22100f,_0x560d25){return db[_0xcaef('0x16')]['create'](_0x272c8c[_0xcaef('0x17')],{'raw':_0x272c8c[_0xcaef('0x18')]?_0x272c8c[_0xcaef('0x18')][_0xcaef('0x19')]===undefined?!![]:![]:!![]})[_0xcaef('0xc')](function(_0x4a477e){logger[_0xcaef('0xd')](_0xcaef('0x1a'),_0x272c8c);logger[_0xcaef('0x1b')](_0xcaef('0x1a'),_0x272c8c,JSON[_0xcaef('0x10')](_0x4a477e));_0x22100f(_0x4a477e);})[_0xcaef('0x15')](function(_0x3ed082){logger['error'](_0xcaef('0x1a'),_0x3ed082[_0xcaef('0x13')],_0x272c8c);_0x560d25(_0x5599a1[_0xcaef('0x11')](0x1f4,_0x3ed082[_0xcaef('0x13')]));});});};exports[_0xcaef('0x1c')]=function(_0x3707b0){var _0x319aa8=this;return new Promise(function(_0x28afcb,_0x208f4f){return db[_0xcaef('0x16')][_0xcaef('0x1d')](_0x3707b0[_0xcaef('0x17')],{'raw':_0x3707b0['options']?_0x3707b0['options'][_0xcaef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3707b0[_0xcaef('0x18')]?_0x3707b0[_0xcaef('0x18')][_0xcaef('0x1e')]||null:null,'attributes':_0x3707b0[_0xcaef('0x18')]?_0x3707b0[_0xcaef('0x18')][_0xcaef('0x1f')]||null:null,'limit':_0x3707b0[_0xcaef('0x18')]?_0x3707b0[_0xcaef('0x18')][_0xcaef('0x20')]||null:null})[_0xcaef('0xc')](function(_0x303204){logger[_0xcaef('0xd')](_0xcaef('0x1c'),_0x3707b0);logger[_0xcaef('0x1b')](_0xcaef('0x1c'),_0x3707b0,JSON[_0xcaef('0x10')](_0x303204));_0x28afcb(_0x303204);})[_0xcaef('0x15')](function(_0x360f32){logger[_0xcaef('0x11')](_0xcaef('0x1c'),_0x360f32[_0xcaef('0x13')],_0x3707b0);_0x208f4f(_0x319aa8['error'](0x1f4,_0x360f32[_0xcaef('0x13')]));});});}; \ No newline at end of file +var _0xedce=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','WhatsappQueueReport','body','options','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','attributes','limit','lodash','util','moment','randomstring','ioredis'];(function(_0x2755aa,_0x25ccbb){var _0x3d08f3=function(_0xc22a58){while(--_0xc22a58){_0x2755aa['push'](_0x2755aa['shift']());}};_0x3d08f3(++_0x25ccbb);}(_0xedce,0x1ea));var _0xeedc=function(_0x6f5538,_0x167476){_0x6f5538=_0x6f5538-0x0;var _0x4b67a7=_0xedce[_0x6f5538];return _0x4b67a7;};'use strict';var _=require(_0xeedc('0x0'));var util=require(_0xeedc('0x1'));var moment=require(_0xeedc('0x2'));var BPromise=require('bluebird');var rs=require(_0xeedc('0x3'));var fs=require('fs');var Redis=require(_0xeedc('0x4'));var db=require(_0xeedc('0x5'))['db'];var utils=require(_0xeedc('0x6'));var logger=require(_0xeedc('0x7'))(_0xeedc('0x8'));var config=require(_0xeedc('0x9'));var jayson=require(_0xeedc('0xa'));var client=jayson[_0xeedc('0xb')][_0xeedc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d55e3,_0x4f3af0,_0x52fdb7){return new BPromise(function(_0x14677d,_0x5968ca){return client['request'](_0x2d55e3,_0x52fdb7)[_0xeedc('0xd')](function(_0x1a9812){logger[_0xeedc('0xe')](_0xeedc('0xf'),_0x4f3af0,'request\x20sent');logger[_0xeedc('0x10')](_0xeedc('0x11'),_0x4f3af0,_0xeedc('0x12'),JSON[_0xeedc('0x13')](_0x1a9812));if(_0x1a9812[_0xeedc('0x14')]){if(_0x1a9812['error'][_0xeedc('0x15')]===0x1f4){logger[_0xeedc('0x14')](_0xeedc('0xf'),_0x4f3af0,_0x1a9812[_0xeedc('0x14')][_0xeedc('0x16')]);return _0x5968ca(_0x1a9812[_0xeedc('0x14')]['message']);}logger[_0xeedc('0x14')](_0xeedc('0xf'),_0x4f3af0,_0x1a9812[_0xeedc('0x14')][_0xeedc('0x16')]);return _0x14677d(_0x1a9812[_0xeedc('0x14')]['message']);}else{logger[_0xeedc('0xe')](_0xeedc('0xf'),_0x4f3af0,_0xeedc('0x12'));_0x14677d(_0x1a9812[_0xeedc('0x17')][_0xeedc('0x16')]);}})[_0xeedc('0x18')](function(_0x3799c6){logger['error'](_0xeedc('0xf'),_0x4f3af0,_0x3799c6);_0x5968ca(_0x3799c6);});});}exports['CreateWhatsappQueueReport']=function(_0x3badc0){var _0x5dbfb4=this;return new Promise(function(_0x1ec91,_0x3573fe){return db[_0xeedc('0x19')]['create'](_0x3badc0[_0xeedc('0x1a')],{'raw':_0x3badc0[_0xeedc('0x1b')]?_0x3badc0['options']['raw']===undefined?!![]:![]:!![]})[_0xeedc('0xd')](function(_0x54f0ad){logger[_0xeedc('0xe')](_0xeedc('0x1c'),_0x3badc0);logger['debug']('CreateWhatsappQueueReport',_0x3badc0,JSON[_0xeedc('0x13')](_0x54f0ad));_0x1ec91(_0x54f0ad);})[_0xeedc('0x18')](function(_0x7e41c3){logger[_0xeedc('0x14')](_0xeedc('0x1c'),_0x7e41c3[_0xeedc('0x16')],_0x3badc0);_0x3573fe(_0x5dbfb4[_0xeedc('0x14')](0x1f4,_0x7e41c3[_0xeedc('0x16')]));});});};exports[_0xeedc('0x1d')]=function(_0xeb46a3){var _0x4ba0e2=this;return new Promise(function(_0x1e1d60,_0x2e959e){return db[_0xeedc('0x19')][_0xeedc('0x1e')](_0xeb46a3[_0xeedc('0x1a')],{'raw':_0xeb46a3[_0xeedc('0x1b')]?_0xeb46a3[_0xeedc('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xeb46a3[_0xeedc('0x1b')]?_0xeb46a3['options']['where']||null:null,'attributes':_0xeb46a3[_0xeedc('0x1b')]?_0xeb46a3[_0xeedc('0x1b')][_0xeedc('0x1f')]||null:null,'limit':_0xeb46a3[_0xeedc('0x1b')]?_0xeb46a3['options'][_0xeedc('0x20')]||null:null})[_0xeedc('0xd')](function(_0xc808e4){logger['info'](_0xeedc('0x1d'),_0xeb46a3);logger[_0xeedc('0x10')](_0xeedc('0x1d'),_0xeb46a3,JSON['stringify'](_0xc808e4));_0x1e1d60(_0xc808e4);})[_0xeedc('0x18')](function(_0x474bc5){logger['error'](_0xeedc('0x1d'),_0x474bc5[_0xeedc('0x16')],_0xeb46a3);_0x2e959e(_0x4ba0e2[_0xeedc('0x14')](0x1f4,_0x474bc5[_0xeedc('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 6ee6d56..281f5bf 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 _0xe88d=['show','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','describe','/:id'];(function(_0x814193,_0x16ac4b){var _0x52b48c=function(_0x31b013){while(--_0x31b013){_0x814193['push'](_0x814193['shift']());}};_0x52b48c(++_0x16ac4b);}(_0xe88d,0x1ac));var _0xde88=function(_0x8c8176,_0x5360a1){_0x8c8176=_0x8c8176-0x0;var _0x4dc47b=_0xe88d[_0x8c8176];return _0x4dc47b;};'use strict';var multer=require(_0xde88('0x0'));var util=require('util');var path=require(_0xde88('0x1'));var timeout=require('connect-timeout');var express=require(_0xde88('0x2'));var router=express[_0xde88('0x3')]();var fs_extra=require(_0xde88('0x4'));var auth=require(_0xde88('0x5'));var interaction=require(_0xde88('0x6'));var config=require(_0xde88('0x7'));var controller=require(_0xde88('0x8'));router[_0xde88('0x9')]('/',auth[_0xde88('0xa')](),controller['index']);router[_0xde88('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xde88('0xb')]);router['get'](_0xde88('0xc'),auth['isAuthenticated'](),controller[_0xde88('0xd')]);router[_0xde88('0xe')]('/',auth['isAuthenticated'](),controller[_0xde88('0xf')]);router[_0xde88('0x10')](_0xde88('0xc'),auth[_0xde88('0xa')](),controller[_0xde88('0x11')]);router[_0xde88('0x12')](_0xde88('0xc'),auth['isAuthenticated'](),controller[_0xde88('0x13')]);module[_0xde88('0x14')]=router; \ No newline at end of file +var _0x394b=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','/:id','destroy','exports'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x394b,0x13b));var _0xb394=function(_0xe9d4d3,_0x16f2d0){_0xe9d4d3=_0xe9d4d3-0x0;var _0x4746c1=_0x394b[_0xe9d4d3];return _0x4746c1;};'use strict';var multer=require('multer');var util=require(_0xb394('0x0'));var path=require(_0xb394('0x1'));var timeout=require(_0xb394('0x2'));var express=require('express');var router=express[_0xb394('0x3')]();var fs_extra=require(_0xb394('0x4'));var auth=require(_0xb394('0x5'));var interaction=require(_0xb394('0x6'));var config=require('../../config/environment');var controller=require(_0xb394('0x7'));router[_0xb394('0x8')]('/',auth[_0xb394('0x9')](),controller[_0xb394('0xa')]);router['get'](_0xb394('0xb'),auth[_0xb394('0x9')](),controller[_0xb394('0xc')]);router['get']('/:id',auth[_0xb394('0x9')](),controller[_0xb394('0xd')]);router[_0xb394('0xe')]('/',auth[_0xb394('0x9')](),controller[_0xb394('0xf')]);router[_0xb394('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xb394('0x11')]);router['delete'](_0xb394('0x12'),auth[_0xb394('0x9')](),controller[_0xb394('0x13')]);module[_0xb394('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 5124f4c..279aafb 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 _0x9512=['STRING','ENUM','account','agent','queue','sequelize','exports'];(function(_0x73ff2d,_0xd5594e){var _0x2c60ed=function(_0x39a12b){while(--_0x39a12b){_0x73ff2d['push'](_0x73ff2d['shift']());}};_0x2c60ed(++_0xd5594e);}(_0x9512,0x75));var _0x2951=function(_0x239eaf,_0x1968b4){_0x239eaf=_0x239eaf-0x0;var _0x8863f7=_0x9512[_0x239eaf];return _0x8863f7;};'use strict';var Sequelize=require(_0x2951('0x0'));module[_0x2951('0x1')]={'uniqueid':{'type':Sequelize[_0x2951('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2951('0x3')](_0x2951('0x4'),_0x2951('0x5'),_0x2951('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xfa4d=['sequelize','exports','ENUM','DATE'];(function(_0x449da3,_0x43835a){var _0x4a7fc6=function(_0x1a0d74){while(--_0x1a0d74){_0x449da3['push'](_0x449da3['shift']());}};_0x4a7fc6(++_0x43835a);}(_0xfa4d,0x90));var _0xdfa4=function(_0x1731e2,_0x1783ca){_0x1731e2=_0x1731e2-0x0;var _0x162258=_0xfa4d[_0x1731e2];return _0x162258;};'use strict';var Sequelize=require(_0xdfa4('0x0'));module[_0xdfa4('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xdfa4('0x2')]('account','agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xdfa4('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 2139641..79ad3b8 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 _0xfd49=['sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','WhatsappTransferReport','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5998db,_0x2b1da9){var _0x19d106=function(_0x2025a6){while(--_0x2025a6){_0x5998db['push'](_0x5998db['shift']());}};_0x19d106(++_0x2b1da9);}(_0xfd49,0x91));var _0x9fd4=function(_0x3b2ebd,_0x5da4e9){_0x3b2ebd=_0x3b2ebd-0x0;var _0x4389ec=_0xfd49[_0x3b2ebd];return _0x4389ec;};'use strict';var emlformat=require(_0x9fd4('0x0'));var rimraf=require(_0x9fd4('0x1'));var zipdir=require(_0x9fd4('0x2'));var jsonpatch=require(_0x9fd4('0x3'));var rp=require(_0x9fd4('0x4'));var moment=require(_0x9fd4('0x5'));var BPromise=require(_0x9fd4('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9fd4('0x7'));var csv=require('to-csv');var ejs=require(_0x9fd4('0x8'));var fs=require('fs');var fs_extra=require(_0x9fd4('0x9'));var _=require(_0x9fd4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9fd4('0xb'));var deskjs=require(_0x9fd4('0xc'));var toCsv=require(_0x9fd4('0xd'));var querystring=require(_0x9fd4('0xe'));var Papa=require(_0x9fd4('0xf'));var Redis=require('ioredis');var authService=require(_0x9fd4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9fd4('0x11'));var hardwareService=require(_0x9fd4('0x12'));var logger=require(_0x9fd4('0x13'))(_0x9fd4('0x14'));var utils=require(_0x9fd4('0x15'));var config=require(_0x9fd4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9fd4('0x17'))['db'];function respondWithStatusCode(_0x38b74c,_0xf84889){_0xf84889=_0xf84889||0xcc;return function(_0xe60b80){if(_0xe60b80){return _0x38b74c[_0x9fd4('0x18')](_0xf84889);}return _0x38b74c[_0x9fd4('0x19')](_0xf84889)['end']();};}function respondWithResult(_0x13cb49,_0x174e62){_0x174e62=_0x174e62||0xc8;return function(_0x3c1f2f){if(_0x3c1f2f){return _0x13cb49[_0x9fd4('0x19')](_0x174e62)[_0x9fd4('0x1a')](_0x3c1f2f);}};}function respondWithFilteredResult(_0xcf63f0,_0x239e19){return function(_0x2b32ec){if(_0x2b32ec){var _0x27bd8c=typeof _0x239e19[_0x9fd4('0x1b')]===_0x9fd4('0x1c')&&typeof _0x239e19['limit']===_0x9fd4('0x1c');var _0x2cc401=_0x2b32ec[_0x9fd4('0x1d')];var _0x19d13d=_0x27bd8c?0x0:_0x239e19['offset'];var _0x211a37=_0x27bd8c?_0x2b32ec[_0x9fd4('0x1d')]:_0x239e19[_0x9fd4('0x1b')]+_0x239e19[_0x9fd4('0x1e')];var _0x37856c;if(_0x211a37>=_0x2cc401){_0x211a37=_0x2cc401;_0x37856c=0xc8;}else{_0x37856c=0xce;}_0xcf63f0[_0x9fd4('0x19')](_0x37856c);return _0xcf63f0[_0x9fd4('0x1f')]('Content-Range',_0x19d13d+'-'+_0x211a37+'/'+_0x2cc401)['json'](_0x2b32ec);}return null;};}function patchUpdates(_0x234261){return function(_0x24df2f){try{jsonpatch[_0x9fd4('0x20')](_0x24df2f,_0x234261,!![]);}catch(_0x25c1e2){return BPromise[_0x9fd4('0x21')](_0x25c1e2);}return _0x24df2f[_0x9fd4('0x22')]();};}function saveUpdates(_0x1dc639,_0x15c13e){return function(_0xf6b2d3){if(_0xf6b2d3){return _0xf6b2d3['update'](_0x1dc639)[_0x9fd4('0x23')](function(_0x12da8d){return _0x12da8d;});}return null;};}function removeEntity(_0x614cfe,_0x2e81ee){return function(_0x2eb06b){if(_0x2eb06b){return _0x2eb06b[_0x9fd4('0x24')]()['then'](function(){_0x614cfe[_0x9fd4('0x19')](0xcc)[_0x9fd4('0x25')]();});}};}function handleEntityNotFound(_0x5c42f4,_0x229652){return function(_0x5a7562){if(!_0x5a7562){_0x5c42f4[_0x9fd4('0x18')](0x194);}return _0x5a7562;};}function handleError(_0x2d13e4,_0x164bd3){_0x164bd3=_0x164bd3||0x1f4;return function(_0x51fa11){logger[_0x9fd4('0x26')](_0x51fa11[_0x9fd4('0x27')]);if(_0x51fa11[_0x9fd4('0x28')]){delete _0x51fa11['name'];}_0x2d13e4['status'](_0x164bd3)[_0x9fd4('0x29')](_0x51fa11);};}exports[_0x9fd4('0x2a')]=function(_0xaa536,_0x47cb45){var _0x54135d={},_0x5b33fd={},_0x4575e5={'count':0x0,'rows':[]};var _0x1dbcbb=_[_0x9fd4('0x2b')](db['WhatsappTransferReport'][_0x9fd4('0x2c')],function(_0x45f7ab){return{'name':_0x45f7ab[_0x9fd4('0x2d')],'type':_0x45f7ab[_0x9fd4('0x2e')][_0x9fd4('0x2f')]};});_0x5b33fd[_0x9fd4('0x30')]=_[_0x9fd4('0x2b')](_0x1dbcbb,_0x9fd4('0x28'));_0x5b33fd[_0x9fd4('0x31')]=_[_0x9fd4('0x32')](_0xaa536[_0x9fd4('0x31')]);_0x5b33fd[_0x9fd4('0x33')]=_[_0x9fd4('0x34')](_0x5b33fd['model'],_0x5b33fd[_0x9fd4('0x31')]);_0x54135d[_0x9fd4('0x35')]=_['intersection'](_0x5b33fd['model'],qs['fields'](_0xaa536['query'][_0x9fd4('0x36')]));_0x54135d[_0x9fd4('0x35')]=_0x54135d[_0x9fd4('0x35')][_0x9fd4('0x37')]?_0x54135d['attributes']:_0x5b33fd['model'];if(!_0xaa536[_0x9fd4('0x31')]['hasOwnProperty'](_0x9fd4('0x38'))){_0x54135d[_0x9fd4('0x1e')]=qs[_0x9fd4('0x1e')](_0xaa536[_0x9fd4('0x31')]['limit']);_0x54135d['offset']=qs[_0x9fd4('0x1b')](_0xaa536[_0x9fd4('0x31')][_0x9fd4('0x1b')]);}_0x54135d[_0x9fd4('0x39')]=qs[_0x9fd4('0x3a')](_0xaa536[_0x9fd4('0x31')]['sort']);_0x54135d[_0x9fd4('0x3b')]=qs[_0x9fd4('0x33')](_[_0x9fd4('0x3c')](_0xaa536[_0x9fd4('0x31')],_0x5b33fd[_0x9fd4('0x33')]),_0x1dbcbb);if(_0xaa536[_0x9fd4('0x31')]['filter']){_0x54135d[_0x9fd4('0x3b')]=_[_0x9fd4('0x3d')](_0x54135d[_0x9fd4('0x3b')],{'$or':_[_0x9fd4('0x2b')](_0x1dbcbb,function(_0x2316b2){if(_0x2316b2[_0x9fd4('0x2e')]!==_0x9fd4('0x3e')){var _0x37571f={};_0x37571f[_0x2316b2['name']]={'$like':'%'+_0xaa536[_0x9fd4('0x31')][_0x9fd4('0x3f')]+'%'};return _0x37571f;}})});}_0x54135d=_[_0x9fd4('0x3d')]({},_0x54135d,_0xaa536[_0x9fd4('0x40')]);var _0xa88769={'where':_0x54135d[_0x9fd4('0x3b')]};return db['WhatsappTransferReport'][_0x9fd4('0x1d')](_0xa88769)[_0x9fd4('0x23')](function(_0x3d974a){_0x4575e5[_0x9fd4('0x1d')]=_0x3d974a;if(_0xaa536[_0x9fd4('0x31')]['includeAll']){_0x54135d[_0x9fd4('0x41')]=[{'all':!![]}];}return db[_0x9fd4('0x42')][_0x9fd4('0x43')](_0x54135d);})[_0x9fd4('0x23')](function(_0x3b150f){_0x4575e5[_0x9fd4('0x44')]=_0x3b150f;return _0x4575e5;})[_0x9fd4('0x23')](respondWithFilteredResult(_0x47cb45,_0x54135d))[_0x9fd4('0x45')](handleError(_0x47cb45,null));};exports[_0x9fd4('0x46')]=function(_0x271c69,_0x3d93de){var _0x8a6cf8={'raw':!![],'where':{'id':_0x271c69[_0x9fd4('0x47')]['id']}},_0x2dc032={};_0x2dc032['model']=_[_0x9fd4('0x32')](db[_0x9fd4('0x42')][_0x9fd4('0x2c')]);_0x2dc032[_0x9fd4('0x31')]=_[_0x9fd4('0x32')](_0x271c69['query']);_0x2dc032['filters']=_[_0x9fd4('0x34')](_0x2dc032[_0x9fd4('0x30')],_0x2dc032[_0x9fd4('0x31')]);_0x8a6cf8[_0x9fd4('0x35')]=_[_0x9fd4('0x34')](_0x2dc032[_0x9fd4('0x30')],qs[_0x9fd4('0x36')](_0x271c69[_0x9fd4('0x31')]['fields']));_0x8a6cf8['attributes']=_0x8a6cf8['attributes'][_0x9fd4('0x37')]?_0x8a6cf8['attributes']:_0x2dc032['model'];if(_0x271c69[_0x9fd4('0x31')]['includeAll']){_0x8a6cf8[_0x9fd4('0x41')]=[{'all':!![]}];}_0x8a6cf8=_[_0x9fd4('0x3d')]({},_0x8a6cf8,_0x271c69[_0x9fd4('0x40')]);return db[_0x9fd4('0x42')]['find'](_0x8a6cf8)['then'](handleEntityNotFound(_0x3d93de,null))[_0x9fd4('0x23')](respondWithResult(_0x3d93de,null))['catch'](handleError(_0x3d93de,null));};exports[_0x9fd4('0x48')]=function(_0x310b78,_0x5eb604){return db['WhatsappTransferReport']['create'](_0x310b78['body'],{})[_0x9fd4('0x23')](respondWithResult(_0x5eb604,0xc9))[_0x9fd4('0x45')](handleError(_0x5eb604,null));};exports['update']=function(_0xe55da3,_0x569c09){if(_0xe55da3[_0x9fd4('0x49')]['id']){delete _0xe55da3[_0x9fd4('0x49')]['id'];}return db['WhatsappTransferReport'][_0x9fd4('0x4a')]({'where':{'id':_0xe55da3[_0x9fd4('0x47')]['id']}})[_0x9fd4('0x23')](handleEntityNotFound(_0x569c09,null))[_0x9fd4('0x23')](saveUpdates(_0xe55da3[_0x9fd4('0x49')],null))[_0x9fd4('0x23')](respondWithResult(_0x569c09,null))[_0x9fd4('0x45')](handleError(_0x569c09,null));};exports[_0x9fd4('0x24')]=function(_0x1a26b6,_0x15d7da){return db['WhatsappTransferReport'][_0x9fd4('0x4a')]({'where':{'id':_0x1a26b6[_0x9fd4('0x47')]['id']}})[_0x9fd4('0x23')](handleEntityNotFound(_0x15d7da,null))[_0x9fd4('0x23')](removeEntity(_0x15d7da,null))[_0x9fd4('0x45')](handleError(_0x15d7da,null));};exports[_0x9fd4('0x4b')]=function(_0x255095,_0xf26c79){return db[_0x9fd4('0x42')]['describe']()[_0x9fd4('0x23')](respondWithResult(_0xf26c79,null))[_0x9fd4('0x45')](handleError(_0xf26c79,null));}; \ No newline at end of file +var _0x316b=['order','sort','where','pick','filter','merge','map','WhatsappTransferReport','rows','catch','show','rawAttributes','include','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','set','apply','reject','save','update','then','end','stack','name','send','index','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset'];(function(_0x472378,_0x327f94){var _0x4c1e48=function(_0x300b1c){while(--_0x300b1c){_0x472378['push'](_0x472378['shift']());}};_0x4c1e48(++_0x327f94);}(_0x316b,0x17e));var _0xb316=function(_0x5db99b,_0xdee23a){_0x5db99b=_0x5db99b-0x0;var _0x4b2d0e=_0x316b[_0x5db99b];return _0x4b2d0e;};'use strict';var emlformat=require(_0xb316('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb316('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb316('0x2'));var moment=require(_0xb316('0x3'));var BPromise=require(_0xb316('0x4'));var Mustache=require(_0xb316('0x5'));var util=require(_0xb316('0x6'));var path=require(_0xb316('0x7'));var sox=require(_0xb316('0x8'));var csv=require('to-csv');var ejs=require(_0xb316('0x9'));var fs=require('fs');var fs_extra=require(_0xb316('0xa'));var _=require(_0xb316('0xb'));var squel=require(_0xb316('0xc'));var crypto=require('crypto');var jsforce=require(_0xb316('0xd'));var deskjs=require(_0xb316('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb316('0xf'));var Papa=require(_0xb316('0x10'));var Redis=require(_0xb316('0x11'));var authService=require(_0xb316('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb316('0x13'));var hardwareService=require(_0xb316('0x14'));var logger=require(_0xb316('0x15'))(_0xb316('0x16'));var utils=require(_0xb316('0x17'));var config=require(_0xb316('0x18'));var licenseUtil=require(_0xb316('0x19'));var db=require(_0xb316('0x1a'))['db'];function respondWithStatusCode(_0x1c96cc,_0x3f45df){_0x3f45df=_0x3f45df||0xcc;return function(_0x5bbf73){if(_0x5bbf73){return _0x1c96cc[_0xb316('0x1b')](_0x3f45df);}return _0x1c96cc[_0xb316('0x1c')](_0x3f45df)['end']();};}function respondWithResult(_0x451ef6,_0x9aa523){_0x9aa523=_0x9aa523||0xc8;return function(_0x2e4583){if(_0x2e4583){return _0x451ef6[_0xb316('0x1c')](_0x9aa523)['json'](_0x2e4583);}};}function respondWithFilteredResult(_0xf00fc6,_0x19df6a){return function(_0x47d482){if(_0x47d482){var _0x4a1e93=typeof _0x19df6a['offset']===_0xb316('0x1d')&&typeof _0x19df6a['limit']===_0xb316('0x1d');var _0x58d965=_0x47d482['count'];var _0x1463cd=_0x4a1e93?0x0:_0x19df6a['offset'];var _0x54c716=_0x4a1e93?_0x47d482[_0xb316('0x1e')]:_0x19df6a['offset']+_0x19df6a['limit'];var _0x1fc163;if(_0x54c716>=_0x58d965){_0x54c716=_0x58d965;_0x1fc163=0xc8;}else{_0x1fc163=0xce;}_0xf00fc6[_0xb316('0x1c')](_0x1fc163);return _0xf00fc6[_0xb316('0x1f')]('Content-Range',_0x1463cd+'-'+_0x54c716+'/'+_0x58d965)['json'](_0x47d482);}return null;};}function patchUpdates(_0x3f0c08){return function(_0x2b1698){try{jsonpatch[_0xb316('0x20')](_0x2b1698,_0x3f0c08,!![]);}catch(_0x1d9e14){return BPromise[_0xb316('0x21')](_0x1d9e14);}return _0x2b1698[_0xb316('0x22')]();};}function saveUpdates(_0x4c5d06,_0x222375){return function(_0x5d65b6){if(_0x5d65b6){return _0x5d65b6[_0xb316('0x23')](_0x4c5d06)[_0xb316('0x24')](function(_0x515cb5){return _0x515cb5;});}return null;};}function removeEntity(_0x5f069e,_0x55fa58){return function(_0x32cbf2){if(_0x32cbf2){return _0x32cbf2['destroy']()[_0xb316('0x24')](function(){_0x5f069e[_0xb316('0x1c')](0xcc)[_0xb316('0x25')]();});}};}function handleEntityNotFound(_0x199511,_0x401bbf){return function(_0x2ddcf8){if(!_0x2ddcf8){_0x199511[_0xb316('0x1b')](0x194);}return _0x2ddcf8;};}function handleError(_0x25ffc5,_0x28c908){_0x28c908=_0x28c908||0x1f4;return function(_0x15c137){logger['error'](_0x15c137[_0xb316('0x26')]);if(_0x15c137['name']){delete _0x15c137[_0xb316('0x27')];}_0x25ffc5[_0xb316('0x1c')](_0x28c908)[_0xb316('0x28')](_0x15c137);};}exports[_0xb316('0x29')]=function(_0x1dc996,_0x4be4fe){var _0x35493a={},_0x4fe16d={},_0x23fe76={'count':0x0,'rows':[]};var _0x59c63f=_['map'](db['WhatsappTransferReport']['rawAttributes'],function(_0xd071f9){return{'name':_0xd071f9['fieldName'],'type':_0xd071f9[_0xb316('0x2a')][_0xb316('0x2b')]};});_0x4fe16d[_0xb316('0x2c')]=_['map'](_0x59c63f,'name');_0x4fe16d[_0xb316('0x2d')]=_[_0xb316('0x2e')](_0x1dc996[_0xb316('0x2d')]);_0x4fe16d[_0xb316('0x2f')]=_[_0xb316('0x30')](_0x4fe16d[_0xb316('0x2c')],_0x4fe16d[_0xb316('0x2d')]);_0x35493a[_0xb316('0x31')]=_[_0xb316('0x30')](_0x4fe16d['model'],qs[_0xb316('0x32')](_0x1dc996[_0xb316('0x2d')]['fields']));_0x35493a[_0xb316('0x31')]=_0x35493a[_0xb316('0x31')][_0xb316('0x33')]?_0x35493a['attributes']:_0x4fe16d[_0xb316('0x2c')];if(!_0x1dc996[_0xb316('0x2d')][_0xb316('0x34')](_0xb316('0x35'))){_0x35493a['limit']=qs[_0xb316('0x36')](_0x1dc996['query'][_0xb316('0x36')]);_0x35493a[_0xb316('0x37')]=qs['offset'](_0x1dc996[_0xb316('0x2d')]['offset']);}_0x35493a[_0xb316('0x38')]=qs[_0xb316('0x39')](_0x1dc996[_0xb316('0x2d')][_0xb316('0x39')]);_0x35493a[_0xb316('0x3a')]=qs[_0xb316('0x2f')](_[_0xb316('0x3b')](_0x1dc996[_0xb316('0x2d')],_0x4fe16d[_0xb316('0x2f')]),_0x59c63f);if(_0x1dc996[_0xb316('0x2d')][_0xb316('0x3c')]){_0x35493a[_0xb316('0x3a')]=_[_0xb316('0x3d')](_0x35493a['where'],{'$or':_[_0xb316('0x3e')](_0x59c63f,function(_0x37b86a){if(_0x37b86a[_0xb316('0x2a')]!=='VIRTUAL'){var _0x355864={};_0x355864[_0x37b86a[_0xb316('0x27')]]={'$like':'%'+_0x1dc996['query'][_0xb316('0x3c')]+'%'};return _0x355864;}})});}_0x35493a=_[_0xb316('0x3d')]({},_0x35493a,_0x1dc996['options']);var _0x590aa0={'where':_0x35493a[_0xb316('0x3a')]};return db[_0xb316('0x3f')]['count'](_0x590aa0)['then'](function(_0x4aa4c7){_0x23fe76['count']=_0x4aa4c7;if(_0x1dc996[_0xb316('0x2d')]['includeAll']){_0x35493a['include']=[{'all':!![]}];}return db[_0xb316('0x3f')]['findAll'](_0x35493a);})[_0xb316('0x24')](function(_0x21d6cd){_0x23fe76[_0xb316('0x40')]=_0x21d6cd;return _0x23fe76;})[_0xb316('0x24')](respondWithFilteredResult(_0x4be4fe,_0x35493a))[_0xb316('0x41')](handleError(_0x4be4fe,null));};exports[_0xb316('0x42')]=function(_0x455c47,_0x524fc1){var _0x417c7f={'raw':!![],'where':{'id':_0x455c47['params']['id']}},_0x442243={};_0x442243['model']=_[_0xb316('0x2e')](db[_0xb316('0x3f')][_0xb316('0x43')]);_0x442243[_0xb316('0x2d')]=_[_0xb316('0x2e')](_0x455c47[_0xb316('0x2d')]);_0x442243[_0xb316('0x2f')]=_['intersection'](_0x442243[_0xb316('0x2c')],_0x442243[_0xb316('0x2d')]);_0x417c7f['attributes']=_[_0xb316('0x30')](_0x442243[_0xb316('0x2c')],qs['fields'](_0x455c47['query'][_0xb316('0x32')]));_0x417c7f[_0xb316('0x31')]=_0x417c7f['attributes'][_0xb316('0x33')]?_0x417c7f[_0xb316('0x31')]:_0x442243[_0xb316('0x2c')];if(_0x455c47[_0xb316('0x2d')]['includeAll']){_0x417c7f[_0xb316('0x44')]=[{'all':!![]}];}_0x417c7f=_[_0xb316('0x3d')]({},_0x417c7f,_0x455c47['options']);return db[_0xb316('0x3f')][_0xb316('0x45')](_0x417c7f)[_0xb316('0x24')](handleEntityNotFound(_0x524fc1,null))[_0xb316('0x24')](respondWithResult(_0x524fc1,null))[_0xb316('0x41')](handleError(_0x524fc1,null));};exports[_0xb316('0x46')]=function(_0xa15adb,_0xe94df0){return db['WhatsappTransferReport']['create'](_0xa15adb[_0xb316('0x47')],{})[_0xb316('0x24')](respondWithResult(_0xe94df0,0xc9))[_0xb316('0x41')](handleError(_0xe94df0,null));};exports['update']=function(_0x2427fb,_0x4f04ff){if(_0x2427fb[_0xb316('0x47')]['id']){delete _0x2427fb[_0xb316('0x47')]['id'];}return db[_0xb316('0x3f')]['find']({'where':{'id':_0x2427fb[_0xb316('0x48')]['id']}})[_0xb316('0x24')](handleEntityNotFound(_0x4f04ff,null))[_0xb316('0x24')](saveUpdates(_0x2427fb[_0xb316('0x47')],null))[_0xb316('0x24')](respondWithResult(_0x4f04ff,null))[_0xb316('0x41')](handleError(_0x4f04ff,null));};exports['destroy']=function(_0x17683a,_0x5abf6c){return db[_0xb316('0x3f')][_0xb316('0x45')]({'where':{'id':_0x17683a[_0xb316('0x48')]['id']}})[_0xb316('0x24')](handleEntityNotFound(_0x5abf6c,null))['then'](removeEntity(_0x5abf6c,null))[_0xb316('0x41')](handleError(_0x5abf6c,null));};exports['describe']=function(_0x50f9f3,_0xf79311){return db[_0xb316('0x3f')]['describe']()[_0xb316('0x24')](respondWithResult(_0xf79311,null))[_0xb316('0x41')](handleError(_0xf79311,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 1aa2bb2..5637f23 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 _0xd207=['report_whatsapp_transfer','lodash','../../config/logger','api','bluebird','path','rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport'];(function(_0x1580f7,_0xf2b31c){var _0x2a5b4f=function(_0x3e8173){while(--_0x3e8173){_0x1580f7['push'](_0x1580f7['shift']());}};_0x2a5b4f(++_0xf2b31c);}(_0xd207,0xb1));var _0x7d20=function(_0x362b61,_0x16393c){_0x362b61=_0x362b61-0x0;var _0x3e047a=_0xd207[_0x362b61];return _0x3e047a;};'use strict';var _=require(_0x7d20('0x0'));var util=require('util');var logger=require(_0x7d20('0x1'))(_0x7d20('0x2'));var moment=require('moment');var BPromise=require(_0x7d20('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d20('0x4'));var rimraf=require(_0x7d20('0x5'));var config=require('../../config/environment');var attributes=require(_0x7d20('0x6'));module[_0x7d20('0x7')]=function(_0x5a166f,_0x3c17e5){return _0x5a166f[_0x7d20('0x8')](_0x7d20('0x9'),attributes,{'tableName':_0x7d20('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x99ce=['bluebird','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x55944d,_0x3195f0){var _0x494a5b=function(_0x314ed3){while(--_0x314ed3){_0x55944d['push'](_0x55944d['shift']());}};_0x494a5b(++_0x3195f0);}(_0x99ce,0x8b));var _0xe99c=function(_0x2891c3,_0x4caed3){_0x2891c3=_0x2891c3-0x0;var _0x17690a=_0x99ce[_0x2891c3];return _0x17690a;};'use strict';var _=require(_0xe99c('0x0'));var util=require('util');var logger=require(_0xe99c('0x1'))(_0xe99c('0x2'));var moment=require(_0xe99c('0x3'));var BPromise=require(_0xe99c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe99c('0x5'));var attributes=require('./whatsappTransferReport.attributes');module[_0xe99c('0x6')]=function(_0x5f4d51,_0x1dec76){return _0x5f4d51[_0xe99c('0x7')](_0xe99c('0x8'),attributes,{'tableName':_0xe99c('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe99c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 547199e..79d2bc1 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 _0x0ec7=['info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x0ec7,0xbb));var _0x70ec=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0ec7[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x70ec('0x0'));var BPromise=require(_0x70ec('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x70ec('0x2'))['db'];var utils=require(_0x70ec('0x3'));var logger=require(_0x70ec('0x4'))(_0x70ec('0x5'));var config=require(_0x70ec('0x6'));var jayson=require(_0x70ec('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4aa9a4,_0x4d60bc,_0x36ea45){return new BPromise(function(_0x10e63c,_0x493c51){return client['request'](_0x4aa9a4,_0x36ea45)['then'](function(_0x2f70b0){logger[_0x70ec('0x8')](_0x70ec('0x9'),_0x4d60bc,_0x70ec('0xa'));logger[_0x70ec('0xb')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x4d60bc,'request\x20sent',JSON[_0x70ec('0xc')](_0x2f70b0));if(_0x2f70b0[_0x70ec('0xd')]){if(_0x2f70b0['error']['code']===0x1f4){logger[_0x70ec('0xd')](_0x70ec('0x9'),_0x4d60bc,_0x2f70b0[_0x70ec('0xd')][_0x70ec('0xe')]);return _0x493c51(_0x2f70b0[_0x70ec('0xd')]['message']);}logger['error'](_0x70ec('0x9'),_0x4d60bc,_0x2f70b0[_0x70ec('0xd')]['message']);return _0x10e63c(_0x2f70b0['error']['message']);}else{logger['info'](_0x70ec('0x9'),_0x4d60bc,'request\x20sent');_0x10e63c(_0x2f70b0['result'][_0x70ec('0xe')]);}})['catch'](function(_0x3f66f2){logger[_0x70ec('0xd')](_0x70ec('0x9'),_0x4d60bc,_0x3f66f2);_0x493c51(_0x3f66f2);});});} \ No newline at end of file +var _0xc80c=['WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info'];(function(_0x285795,_0x4c4175){var _0x1f56f1=function(_0x2bb787){while(--_0x2bb787){_0x285795['push'](_0x285795['shift']());}};_0x1f56f1(++_0x4c4175);}(_0xc80c,0x13d));var _0xcc80=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xc80c[_0x5cb1af];return _0x8d7940;};'use strict';var _=require(_0xcc80('0x0'));var util=require('util');var moment=require(_0xcc80('0x1'));var BPromise=require(_0xcc80('0x2'));var rs=require(_0xcc80('0x3'));var fs=require('fs');var Redis=require(_0xcc80('0x4'));var db=require(_0xcc80('0x5'))['db'];var utils=require(_0xcc80('0x6'));var logger=require(_0xcc80('0x7'))('rpc');var config=require(_0xcc80('0x8'));var jayson=require(_0xcc80('0x9'));var client=jayson[_0xcc80('0xa')][_0xcc80('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57ce16,_0x5043fd,_0x4956b8){return new BPromise(function(_0xc8e27c,_0x239f28){return client['request'](_0x57ce16,_0x4956b8)['then'](function(_0xba352a){logger[_0xcc80('0xc')](_0xcc80('0xd'),_0x5043fd,_0xcc80('0xe'));logger[_0xcc80('0xf')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x5043fd,_0xcc80('0xe'),JSON[_0xcc80('0x10')](_0xba352a));if(_0xba352a[_0xcc80('0x11')]){if(_0xba352a['error'][_0xcc80('0x12')]===0x1f4){logger[_0xcc80('0x11')](_0xcc80('0xd'),_0x5043fd,_0xba352a[_0xcc80('0x11')][_0xcc80('0x13')]);return _0x239f28(_0xba352a[_0xcc80('0x11')][_0xcc80('0x13')]);}logger['error'](_0xcc80('0xd'),_0x5043fd,_0xba352a[_0xcc80('0x11')][_0xcc80('0x13')]);return _0xc8e27c(_0xba352a[_0xcc80('0x11')][_0xcc80('0x13')]);}else{logger[_0xcc80('0xc')](_0xcc80('0xd'),_0x5043fd,'request\x20sent');_0xc8e27c(_0xba352a[_0xcc80('0x14')]['message']);}})[_0xcc80('0x15')](function(_0x30de9d){logger[_0xcc80('0x11')](_0xcc80('0xd'),_0x5043fd,_0x30de9d);_0x239f28(_0x30de9d);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index e3d6c70..f77c5d2 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3cd8=['sync','then','seedDB','default','listen','info','start','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','Offline\x20apps:','join','None','log','App\x20Ready!','catch','error','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cd8,0x150));var _0x83cd=function(_0x24e2a3,_0x534875){_0x24e2a3=_0x24e2a3-0x0;var _0x3e82f4=_0x3cd8[_0x24e2a3];return _0x3e82f4;};'use strict';var _=require(_0x83cd('0x0'));var db=require(_0x83cd('0x1'))['db'];var seedDb=require(_0x83cd('0x2'));var checkLicense=require(_0x83cd('0x3'));var rpc=require(_0x83cd('0x4'));var config=require(_0x83cd('0x5'));var logger=require(_0x83cd('0x6'))(_0x83cd('0x7'));var pm2=require('./config/pm2');var pm2Config=require(_0x83cd('0x8'));var schedule=require(_0x83cd('0x9'));var chat=require(_0x83cd('0xa'));var whatsapp=require(_0x83cd('0xb'));var transcribe=require(_0x83cd('0xc'));var provider=require(_0x83cd('0xd'));function main(){return db[_0x83cd('0xe')][_0x83cd('0xf')]()[_0x83cd('0x10')](function(){if(config[_0x83cd('0x11')]){return seedDb[_0x83cd('0x12')]();}})[_0x83cd('0x10')](function(){return checkLicense[_0x83cd('0x12')]();})[_0x83cd('0x10')](function(){return rpc[_0x83cd('0x13')]();})[_0x83cd('0x10')](function(_0x1f05f1){logger[_0x83cd('0x14')](_0x1f05f1);return chat[_0x83cd('0x15')]();})[_0x83cd('0x10')](function(){return whatsapp['start']();})[_0x83cd('0x10')](function(){return schedule[_0x83cd('0x15')]();})[_0x83cd('0x10')](function(){return transcribe[_0x83cd('0x15')]();})[_0x83cd('0x10')](function(){return provider[_0x83cd('0x15')]();})[_0x83cd('0x10')](function(_0x1af3f1){logger['info'](_0x1af3f1);return pm2[_0x83cd('0x15')](pm2Config);})[_0x83cd('0x10')](function(_0x2d330d){var _0x28dccb=_0x2d330d[_0x83cd('0x16')](function(_0x385166){return typeof _0x385166['exitCode']==='number'&&_0x385166[_0x83cd('0x17')]>=0x0;});if(_0x28dccb[_0x83cd('0x18')]>0x0){throw new Error(_0x28dccb[_0x83cd('0x18')]+_0x83cd('0x19')+_[_0x83cd('0x1a')](_0x28dccb,function(_0x3d6303){return'\x22'+_0x3d6303[_0x83cd('0x1b')][_0x83cd('0x1c')]+'\x22';}));}logger['info'](_0x83cd('0x1d'),_['map'](_[_0x83cd('0x16')](_0x2d330d,{'status':_0x83cd('0x1e')}),_0x83cd('0x1c'))['join']());logger['info'](_0x83cd('0x1f'),_['map'](_[_0x83cd('0x16')](_0x2d330d,function(_0x6bb0f4){return _0x6bb0f4['status']!==_0x83cd('0x1e');}),_0x83cd('0x1c'))[_0x83cd('0x20')]()||_0x83cd('0x21'));console[_0x83cd('0x22')](_0x83cd('0x23'));})[_0x83cd('0x24')](function(_0x2a9f21){console['log']('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x2a9f21);logger[_0x83cd('0x25')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x2a9f21);process[_0x83cd('0x26')](0x1);});}main(); \ No newline at end of file +var _0x5b20=['None','App\x20Ready!','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','seedDB','default','listen','info','start','filter','number','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','status'];(function(_0x193dad,_0x38d83d){var _0x5eafa4=function(_0x117c44){while(--_0x117c44){_0x193dad['push'](_0x193dad['shift']());}};_0x5eafa4(++_0x38d83d);}(_0x5b20,0x86));var _0x05b2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5b20[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x05b2('0x0'));var db=require(_0x05b2('0x1'))['db'];var seedDb=require(_0x05b2('0x2'));var checkLicense=require(_0x05b2('0x3'));var rpc=require(_0x05b2('0x4'));var config=require(_0x05b2('0x5'));var logger=require(_0x05b2('0x6'))(_0x05b2('0x7'));var pm2=require(_0x05b2('0x8'));var pm2Config=require(_0x05b2('0x9'));var schedule=require(_0x05b2('0xa'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x05b2('0xb'));var transcribe=require(_0x05b2('0xc'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x05b2('0xd')][_0x05b2('0xe')]()[_0x05b2('0xf')](function(){if(config[_0x05b2('0x10')]){return seedDb[_0x05b2('0x11')]();}})[_0x05b2('0xf')](function(){return checkLicense[_0x05b2('0x11')]();})[_0x05b2('0xf')](function(){return rpc[_0x05b2('0x12')]();})[_0x05b2('0xf')](function(_0x9a7fd7){logger[_0x05b2('0x13')](_0x9a7fd7);return chat[_0x05b2('0x14')]();})[_0x05b2('0xf')](function(){return whatsapp[_0x05b2('0x14')]();})[_0x05b2('0xf')](function(){return schedule['start']();})[_0x05b2('0xf')](function(){return transcribe[_0x05b2('0x14')]();})[_0x05b2('0xf')](function(){return provider[_0x05b2('0x14')]();})['then'](function(_0x1339ad){logger[_0x05b2('0x13')](_0x1339ad);return pm2[_0x05b2('0x14')](pm2Config);})['then'](function(_0x4e5c5d){var _0x961aca=_0x4e5c5d[_0x05b2('0x15')](function(_0x4d6d7e){return typeof _0x4d6d7e['exitCode']===_0x05b2('0x16')&&_0x4d6d7e[_0x05b2('0x17')]>=0x0;});if(_0x961aca[_0x05b2('0x18')]>0x0){throw new Error(_0x961aca[_0x05b2('0x18')]+_0x05b2('0x19')+_[_0x05b2('0x1a')](_0x961aca,function(_0x290cce){return'\x22'+_0x290cce[_0x05b2('0x1b')][_0x05b2('0x1c')]+'\x22';}));}logger[_0x05b2('0x13')](_0x05b2('0x1d'),_[_0x05b2('0x1a')](_[_0x05b2('0x15')](_0x4e5c5d,{'status':_0x05b2('0x1e')}),_0x05b2('0x1c'))[_0x05b2('0x1f')]());logger['info'](_0x05b2('0x20'),_[_0x05b2('0x1a')](_[_0x05b2('0x15')](_0x4e5c5d,function(_0x41bea5){return _0x41bea5[_0x05b2('0x21')]!==_0x05b2('0x1e');}),_0x05b2('0x1c'))['join']()||_0x05b2('0x22'));console['log'](_0x05b2('0x23'));})[_0x05b2('0x24')](function(_0x4b2eac){console[_0x05b2('0x25')](_0x05b2('0x26'),_0x4b2eac);logger[_0x05b2('0x27')](_0x05b2('0x28'),_0x4b2eac);process[_0x05b2('0x29')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 4b639d4..75bc4ac 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 _0xb10b=['split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','length','splice','unshift','encryptString','secret','session','options','promisify','verify','toString','hex','floor','now','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','role','fullname','name','internal','email','userpic','permissions','md5secret','mailPause','faxPause','smsPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','status','unmanaged','Unmanaged.','Forbidden.','catch','headers','startsWith','authorization','User','find','authenticate','json','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','then','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb10b,0x12a));var _0xbb10=function(_0x257841,_0x389b4d){_0x257841=_0x257841-0x0;var _0x1b87ed=_0xb10b[_0x257841];return _0x1b87ed;};'use strict';var db=require(_0xbb10('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xbb10('0x1'));var licenseUtil=require(_0xbb10('0x2'));var encryptor=require(_0xbb10('0x3'));var _=require('lodash');var jwt=require(_0xbb10('0x4'));var expressJwt=require(_0xbb10('0x5'));var compose=require(_0xbb10('0x6'));var basicAuth=require(_0xbb10('0x7'));var crypto=require(_0xbb10('0x8'));var BPromise=require(_0xbb10('0x9'));var util=require('util');var moment=require(_0xbb10('0xa'));var validateJwt=expressJwt({'secret':config[_0xbb10('0xb')]['session']});var userAttributes=['id',_0xbb10('0xc'),_0xbb10('0xd'),_0xbb10('0xe'),_0xbb10('0xf'),_0xbb10('0x10'),_0xbb10('0x11'),_0xbb10('0x12'),_0xbb10('0x13'),'voicePause','chatPause',_0xbb10('0x14'),_0xbb10('0x15'),_0xbb10('0x16'),'openchannelPause',_0xbb10('0x17'),'showWebBar',_0xbb10('0x18'),_0xbb10('0x19'),_0xbb10('0x1a'),_0xbb10('0x1b'),_0xbb10('0x1c'),_0xbb10('0x1d'),'phoneBarAutoAnswer',_0xbb10('0x1e'),_0xbb10('0x1f'),_0xbb10('0x20'),_0xbb10('0x21'),_0xbb10('0x22'),_0xbb10('0x23'),_0xbb10('0x24'),_0xbb10('0x25'),_0xbb10('0x26'),_0xbb10('0x27'),'interface',_0xbb10('0x28'),_0xbb10('0x29'),_0xbb10('0x2a'),_0xbb10('0x2b'),_0xbb10('0x2c'),_0xbb10('0x2d'),_0xbb10('0x2e'),_0xbb10('0x2f'),_0xbb10('0x30'),_0xbb10('0x31'),'chatAutoanswerDelay',_0xbb10('0x32'),_0xbb10('0x33'),_0xbb10('0x34'),_0xbb10('0x35'),_0xbb10('0x36'),_0xbb10('0x37'),'faxAutoanswer',_0xbb10('0x38'),_0xbb10('0x39'),'whatsappAutoanswerDelay','messengerSoundNotification'];exports[_0xbb10('0x3a')]=function(){return this[_0xbb10('0x3b')](!![])[_0xbb10('0x3c')](function(_0x317da4,_0x445761,_0x1824b7){if(_0x317da4[_0xbb10('0x3d')]){_0x1824b7();}else{return db[_0xbb10('0x3e')][_0xbb10('0x3f')]({'where':{'id':_0x317da4[_0xbb10('0x40')]['id']},'attributes':['id',_0xbb10('0x41'),_0xbb10('0x42')],'raw':!![]})['then'](function(_0x4fedac){if(_0x4fedac&&_0x4fedac['closed']){return _0x445761[_0xbb10('0x43')](_0x4fedac[_0xbb10('0x42')]===_0xbb10('0x44')?0x195:0x193)['json']({'message':_0x4fedac[_0xbb10('0x42')]===_0xbb10('0x44')?_0xbb10('0x45'):_0xbb10('0x46')});}else{_0x1824b7();}})[_0xbb10('0x47')](function(_0x20d946){_0x1824b7(_0x20d946);});}});};exports[_0xbb10('0x3b')]=function isAuthenticated(_0x4aabb9){return compose()[_0xbb10('0x3c')](function(_0x21ac54,_0xfc3595,_0x2e0249){var _0x1d30aa;if(_0x21ac54[_0xbb10('0x48')]['authorization']){if(_[_0xbb10('0x49')](_0x21ac54['headers'][_0xbb10('0x4a')],'Basic')){var _0x16ad2a=basicAuth(_0x21ac54);db[_0xbb10('0x4b')][_0xbb10('0x4c')]({'where':{'name':_0x16ad2a['name']}})['then'](function(_0x4c3744){if(!_0x4c3744||!_0x4c3744[_0xbb10('0x4d')](_0x16ad2a['pass'])){return _0xfc3595[_0xbb10('0x43')](0x191)[_0xbb10('0x4e')]({'message':_0xbb10('0x4f')});}_0x21ac54[_0xbb10('0x3d')]={'id':_0x4c3744['id']};_0x2e0249();})[_0xbb10('0x47')](function(_0x138bc6){_0x2e0249(_0x138bc6);});}else if(_[_0xbb10('0x49')](_0x21ac54['headers'][_0xbb10('0x4a')],_0xbb10('0x50'))){validateJwt(_0x21ac54,_0xfc3595,_0x2e0249);}else{if(_0x4aabb9){_0x2e0249();}else{return _0xfc3595[_0xbb10('0x43')](0x193)[_0xbb10('0x4e')]({'message':_0xbb10('0x51')});}}}else if(_0x21ac54[_0xbb10('0x52')][_0xbb10('0x53')]){try{var _0x10202c={'audience':hardwareConf[_0xbb10('0x54')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x21ac54[_0xbb10('0x52')][_0xbb10('0x53')],_0x10202c)[_0xbb10('0x55')](function(_0x3c3c45){return db['User'][_0xbb10('0x4c')]({'where':{'id':_0x3c3c45['sub']}})['then'](function(_0x3eb3cc){_0x1d30aa=_0x3eb3cc;return db[_0xbb10('0x56')][_0xbb10('0x3f')]({'where':{'id':0x1},'attributes':[_0xbb10('0x57'),_0xbb10('0x58')],'raw':!![]});})[_0xbb10('0x55')](function(_0x547062){if(!_0x1d30aa||!_[_0xbb10('0x59')](_0x1d30aa[_0xbb10('0x5a')],_0x3c3c45['nonce'])){return _0xfc3595['status'](0x191)['json']({'message':_0xbb10('0x5b')});}if(_0x1d30aa[_0xbb10('0x5c')]){return _0xfc3595[_0xbb10('0x43')](0x191)['json']({'message':_0xbb10('0x5d')});}if(_0x1d30aa[_0xbb10('0x5e')]){if(_0x547062[_0xbb10('0x58')]>0x0){if(moment(_0x1d30aa['blockedAt'])[_0xbb10('0x5f')](_0x547062[_0xbb10('0x58')],_0xbb10('0x60'))>moment()){return _0xfc3595[_0xbb10('0x43')](0x191)['json']({'message':_0xbb10('0x5d')});}}else{return _0xfc3595[_0xbb10('0x43')](0x191)['json']({'message':_0xbb10('0x5d')});}}_0x21ac54[_0xbb10('0x3d')]={'id':_0x1d30aa['id']};_0x2e0249();});})[_0xbb10('0x47')](function(){return _0xfc3595[_0xbb10('0x43')](0x191)[_0xbb10('0x4e')]({'message':_0xbb10('0x5d')});});}catch(_0x5f3d67){_0x2e0249(_0x5f3d67);}}else if(_0x4aabb9){_0x2e0249();}else{return _0xfc3595[_0xbb10('0x43')](0x193)[_0xbb10('0x4e')]({'message':_0xbb10('0x51')});}})[_0xbb10('0x3c')](function(_0x4943d9,_0x3fff6c,_0x331751){if(_0x4943d9[_0xbb10('0x3d')]){db[_0xbb10('0x4b')]['find']({'where':{'id':_0x4943d9[_0xbb10('0x3d')]['id']},'attributes':userAttributes})[_0xbb10('0x55')](function(_0x54ac18){if(!_0x54ac18){return _0x3fff6c['status'](0x194)[_0xbb10('0x4e')]({'message':'User\x20not\x20found.'});}_0x4943d9[_0xbb10('0x3d')]=_0x54ac18;_0x331751();})[_0xbb10('0x47')](function(_0x4c66d8){_0x331751(_0x4c66d8);});}else if(_0x4aabb9){_0x331751();}else{return _0x3fff6c[_0xbb10('0x43')](0x194)[_0xbb10('0x4e')]({'message':_0xbb10('0x61')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xbb10('0x3c')](function(_0xebd70c,_0x3b9fdf,_0x32b729){return licenseUtil[_0xbb10('0x62')]()[_0xbb10('0x55')](function(_0x190781){if(_0x190781[_0xbb10('0x63')]){_0x32b729();}else{return _0x3b9fdf[_0xbb10('0x43')](0x193)[_0xbb10('0x4e')]({'message':_0xbb10('0x64')});}})[_0xbb10('0x47')](function(_0x4d30d6){_0x32b729(_0x4d30d6);});});};exports[_0xbb10('0x65')]=function isWebrtcLicence(){return compose()[_0xbb10('0x3c')](function(_0x4a1248,_0x14e1cb,_0x2f5027){return licenseUtil[_0xbb10('0x62')]()[_0xbb10('0x55')](function(_0x41ea91){if(_0x41ea91[_0xbb10('0x66')]){_0x2f5027();}else{return _0x14e1cb[_0xbb10('0x43')](0x193)['json']({'message':'Forbidden'});}})[_0xbb10('0x47')](function(_0x76a208){_0x2f5027(_0x76a208);});});};exports[_0xbb10('0x67')]=function(_0x57d2c0,_0x5f0c12,_0x3cd6f3){_0x57d2c0[_0xbb10('0x67')]=!![];return _0x3cd6f3();};exports[_0xbb10('0x68')]=function signToken(_0xf820fe){return signJwt(_0xf820fe);};exports[_0xbb10('0x69')]=function(_0x22b315,_0x2f2552){if(!_0x22b315[_0xbb10('0x3d')]){return _0x2f2552[_0xbb10('0x43')](0x194)[_0xbb10('0x4e')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x5eafac={'payload':{'id':_0x22b315[_0xbb10('0x3d')]['id'],'role':_0x22b315[_0xbb10('0x3d')][_0xbb10('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5eafac)[_0xbb10('0x55')](function(_0x36aa7d){_0x2f2552[_0xbb10('0x6a')](_0xbb10('0x6b'),_0x36aa7d);_0x2f2552[_0xbb10('0x6c')](_0xbb10('0x6d'));})[_0xbb10('0x47')](function(_0x19ca3e){return _0x2f2552[_0xbb10('0x43')](0x1f4)[_0xbb10('0x6e')](_0x19ca3e);});};exports[_0xbb10('0x6f')]=function(_0x1d15f4){if(_['isNil'](_0x1d15f4[_0xbb10('0x5a')])||_['isNil'](_0x1d15f4[_0xbb10('0x70')])){return null;}else{return createJwt(_0x1d15f4);}};exports[_0xbb10('0x71')]=function(_0x1ffe20){_0x1ffe20[_0xbb10('0x5a')]=generateNonce();_0x1ffe20[_0xbb10('0x70')]=generateIssuedAt();return createJwt(_0x1ffe20);};exports[_0xbb10('0x72')]=function(_0x2e3326,_0x44eec1){var _0x180400=_0x2e3326[_0xbb10('0x52')][_0xbb10('0x53')];if(_0x180400){var _0x1c2dce={'nonce':_0x44eec1[_0xbb10('0x5a')],'iat':_0x44eec1[_0xbb10('0x70')],'audience':hardwareConf[_0xbb10('0x54')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x180400,_0x1c2dce)[_0xbb10('0x55')](function(){return generateApiKey(_0x44eec1);});}else{throw{'message':_0xbb10('0x73')};}};exports[_0xbb10('0x74')]=function(_0x4ce8e7){var _0xbffa3c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xbffa3c[_0xbb10('0x75')](_0x4ce8e7))throw new db['Sequelize'][(_0xbb10('0x76'))](_0xbb10('0x77'));return;};exports[_0xbb10('0x78')]=function(_0x14fed3,_0x432728,_0x22de7f){var _0x175872=encryptor[_0xbb10('0x79')](_0x432728)[_0xbb10('0x7a')](',');for(var _0x40c4fb=0x0;_0x40c4fb<_0x22de7f;_0x40c4fb++){if(!_0x175872[_0x40c4fb])break;if(_0x14fed3[_0xbb10('0x7b')]()===_0x175872[_0x40c4fb][_0xbb10('0x7b')]()){var _0x16932f=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x22de7f);if(_0x22de7f===0x1){_0x16932f=_0xbb10('0x7c');}throw new db[(_0xbb10('0x7d'))][(_0xbb10('0x76'))](_0x16932f);}}return;};exports[_0xbb10('0x7e')]=function(_0x5573bb,_0x506498){var _0x79411e=_0x506498?encryptor[_0xbb10('0x79')](_0x506498)[_0xbb10('0x7a')](','):[];if(_0x79411e[_0xbb10('0x7f')]===0x5){_0x79411e[_0xbb10('0x80')](-0x1,0x1);}_0x79411e[_0xbb10('0x81')](_0x5573bb);return encryptor[_0xbb10('0x82')](_0x79411e['join'](','));};function signJwt(_0x117e84){var _0x216cff=BPromise['promisify'](jwt['sign'],{'context':jwt});var _0x5a231f=_0x117e84[_0xbb10('0x83')]||config[_0xbb10('0xb')][_0xbb10('0x84')];return new BPromise(function(_0x5bd1c0,_0x4e6e7c){_0x216cff(_0x117e84['payload'],_0x5a231f,_0x117e84[_0xbb10('0x85')])[_0xbb10('0x55')](function(_0x45167a){_0x5bd1c0(_0x45167a);})['catch'](function(_0xa1bbd9){_0x4e6e7c(_0xa1bbd9);});});}function verifyJwt(_0x13131c,_0x5a6538,_0x4a560c){var _0x27d7b9=BPromise[_0xbb10('0x86')](jwt[_0xbb10('0x87')],{'context':jwt});var _0x237246=_0x4a560c||config['secrets'][_0xbb10('0x84')];return new BPromise(function(_0xec48ac,_0xa7179d){_0x27d7b9(_0x13131c,_0x237246,_0x5a6538)['then'](function(_0x402a01){_0xec48ac(_0x402a01);})[_0xbb10('0x47')](function(_0x3e3617){_0xa7179d(_0x3e3617);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xbb10('0x88')](_0xbb10('0x89'));}function generateIssuedAt(){return Math[_0xbb10('0x8a')](Date[_0xbb10('0x8b')]()/0x3e8)['toString']();}function createJwt(_0x251417){var _0x258e55={'payload':{'iat':_0x251417[_0xbb10('0x70')],'nonce':_0x251417[_0xbb10('0x5a')]},'options':{'algorithm':'HS512','subject':_0x251417['id'][_0xbb10('0x88')](),'issuer':hardwareConf[_0xbb10('0x54')](),'audience':hardwareConf[_0xbb10('0x54')]()}};return signJwt(_0x258e55)[_0xbb10('0x55')](function(_0x12f750){return{'iat':_0x251417[_0xbb10('0x70')],'nonce':_0x251417[_0xbb10('0x5a')],'token':_0x12f750};});} \ No newline at end of file +var _0xe511=['phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','closed','disposition','then','unmanaged','json','Unmanaged.','headers','authorization','Basic','User','find','authenticate','pass','status','Wrong\x20credentials.','catch','startsWith','Unknown\x20authorization\x20format','apikey','getUuid','findOne','allowedLoginAttempts','blockDuration','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isWebrtcLicence','getLicense','isMiddleware','setTokenCookie','role','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','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\x20last\x20one.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','encryptString','join','promisify','sign','secret','session','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/util','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','fullname','name','userpic','permissions','md5secret','voicePause','chatPause','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires'];(function(_0x3da795,_0x1f32ed){var _0x47cde2=function(_0x52e120){while(--_0x52e120){_0x3da795['push'](_0x3da795['shift']());}};_0x47cde2(++_0x1f32ed);}(_0xe511,0x16f));var _0x1e51=function(_0x1d116e,_0x54956c){_0x1d116e=_0x1d116e-0x0;var _0x3f4710=_0xe511[_0x1d116e];return _0x3f4710;};'use strict';var db=require(_0x1e51('0x0'))['db'];var config=require(_0x1e51('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x1e51('0x2'));var encryptor=require('../encryptor');var _=require(_0x1e51('0x3'));var jwt=require(_0x1e51('0x4'));var expressJwt=require('express-jwt');var compose=require(_0x1e51('0x5'));var basicAuth=require(_0x1e51('0x6'));var crypto=require(_0x1e51('0x7'));var BPromise=require(_0x1e51('0x8'));var util=require('util');var moment=require(_0x1e51('0x9'));var validateJwt=expressJwt({'secret':config[_0x1e51('0xa')]['session']});var userAttributes=['id','role',_0x1e51('0xb'),_0x1e51('0xc'),'internal','email',_0x1e51('0xd'),_0x1e51('0xe'),_0x1e51('0xf'),_0x1e51('0x10'),_0x1e51('0x11'),_0x1e51('0x12'),'faxPause',_0x1e51('0x13'),_0x1e51('0x14'),_0x1e51('0x15'),_0x1e51('0x16'),_0x1e51('0x17'),_0x1e51('0x18'),'crudPermissions',_0x1e51('0x19'),_0x1e51('0x1a'),_0x1e51('0x1b'),_0x1e51('0x1c'),_0x1e51('0x1d'),_0x1e51('0x1e'),_0x1e51('0x1f'),_0x1e51('0x20'),_0x1e51('0x21'),_0x1e51('0x22'),'phoneBarPrefixRequired',_0x1e51('0x23'),_0x1e51('0x24'),_0x1e51('0x25'),'interface',_0x1e51('0x26'),'privacyEnabled','settingsEnabled',_0x1e51('0x27'),_0x1e51('0x28'),_0x1e51('0x29'),_0x1e51('0x2a'),_0x1e51('0x2b'),_0x1e51('0x2c'),'chatAutoanswer',_0x1e51('0x2d'),'emailAutoanswer',_0x1e51('0x2e'),_0x1e51('0x2f'),_0x1e51('0x30'),_0x1e51('0x31'),'openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer',_0x1e51('0x32'),'messengerSoundNotification'];exports[_0x1e51('0x33')]=function(){return this[_0x1e51('0x34')](!![])[_0x1e51('0x35')](function(_0x13240f,_0x23c85a,_0xf9298){if(_0x13240f[_0x1e51('0x36')]){_0xf9298();}else{return db[_0x1e51('0x37')]['findOne']({'where':{'id':_0x13240f['params']['id']},'attributes':['id',_0x1e51('0x38'),_0x1e51('0x39')],'raw':!![]})[_0x1e51('0x3a')](function(_0x1386db){if(_0x1386db&&_0x1386db['closed']){return _0x23c85a['status'](_0x1386db['disposition']===_0x1e51('0x3b')?0x195:0x193)[_0x1e51('0x3c')]({'message':_0x1386db[_0x1e51('0x39')]==='unmanaged'?_0x1e51('0x3d'):'Forbidden.'});}else{_0xf9298();}})['catch'](function(_0x3349f0){_0xf9298(_0x3349f0);});}});};exports['isAuthenticated']=function isAuthenticated(_0x170ec6){return compose()[_0x1e51('0x35')](function(_0x56722f,_0x3e6ef2,_0x10ee23){var _0x71c7af;if(_0x56722f[_0x1e51('0x3e')]['authorization']){if(_['startsWith'](_0x56722f['headers'][_0x1e51('0x3f')],_0x1e51('0x40'))){var _0x1ba84a=basicAuth(_0x56722f);db[_0x1e51('0x41')][_0x1e51('0x42')]({'where':{'name':_0x1ba84a[_0x1e51('0xc')]}})[_0x1e51('0x3a')](function(_0x34701c){if(!_0x34701c||!_0x34701c[_0x1e51('0x43')](_0x1ba84a[_0x1e51('0x44')])){return _0x3e6ef2[_0x1e51('0x45')](0x191)['json']({'message':_0x1e51('0x46')});}_0x56722f[_0x1e51('0x36')]={'id':_0x34701c['id']};_0x10ee23();})[_0x1e51('0x47')](function(_0x12da89){_0x10ee23(_0x12da89);});}else if(_[_0x1e51('0x48')](_0x56722f['headers'][_0x1e51('0x3f')],'Bearer')){validateJwt(_0x56722f,_0x3e6ef2,_0x10ee23);}else{if(_0x170ec6){_0x10ee23();}else{return _0x3e6ef2[_0x1e51('0x45')](0x193)[_0x1e51('0x3c')]({'message':_0x1e51('0x49')});}}}else if(_0x56722f['query'][_0x1e51('0x4a')]){try{var _0x58f8b1={'audience':hardwareConf[_0x1e51('0x4b')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x56722f['query'][_0x1e51('0x4a')],_0x58f8b1)[_0x1e51('0x3a')](function(_0x45313e){return db['User'][_0x1e51('0x42')]({'where':{'id':_0x45313e['sub']}})[_0x1e51('0x3a')](function(_0x2df269){_0x71c7af=_0x2df269;return db['Setting'][_0x1e51('0x4c')]({'where':{'id':0x1},'attributes':[_0x1e51('0x4d'),_0x1e51('0x4e')],'raw':!![]});})[_0x1e51('0x3a')](function(_0x146c44){if(!_0x71c7af||!_[_0x1e51('0x4f')](_0x71c7af['apiKeyNonce'],_0x45313e['nonce'])){return _0x3e6ef2[_0x1e51('0x45')](0x191)['json']({'message':_0x1e51('0x50')});}if(_0x71c7af[_0x1e51('0x51')]){return _0x3e6ef2[_0x1e51('0x45')](0x191)[_0x1e51('0x3c')]({'message':_0x1e51('0x52')});}if(_0x71c7af[_0x1e51('0x53')]){if(_0x146c44[_0x1e51('0x4e')]>0x0){if(moment(_0x71c7af[_0x1e51('0x54')])[_0x1e51('0x55')](_0x146c44[_0x1e51('0x4e')],_0x1e51('0x56'))>moment()){return _0x3e6ef2['status'](0x191)[_0x1e51('0x3c')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x3e6ef2[_0x1e51('0x45')](0x191)[_0x1e51('0x3c')]({'message':_0x1e51('0x52')});}}_0x56722f[_0x1e51('0x36')]={'id':_0x71c7af['id']};_0x10ee23();});})[_0x1e51('0x47')](function(){return _0x3e6ef2[_0x1e51('0x45')](0x191)[_0x1e51('0x3c')]({'message':_0x1e51('0x52')});});}catch(_0x121048){_0x10ee23(_0x121048);}}else if(_0x170ec6){_0x10ee23();}else{return _0x3e6ef2[_0x1e51('0x45')](0x193)[_0x1e51('0x3c')]({'message':'Unknown\x20authorization\x20format'});}})['use'](function(_0x13da51,_0x8bb476,_0x3be495){if(_0x13da51[_0x1e51('0x36')]){db[_0x1e51('0x41')][_0x1e51('0x42')]({'where':{'id':_0x13da51[_0x1e51('0x36')]['id']},'attributes':userAttributes})[_0x1e51('0x3a')](function(_0x5a6340){if(!_0x5a6340){return _0x8bb476[_0x1e51('0x45')](0x194)[_0x1e51('0x3c')]({'message':_0x1e51('0x57')});}_0x13da51[_0x1e51('0x36')]=_0x5a6340;_0x3be495();})[_0x1e51('0x47')](function(_0x2131fb){_0x3be495(_0x2131fb);});}else if(_0x170ec6){_0x3be495();}else{return _0x8bb476[_0x1e51('0x45')](0x194)['json']({'message':_0x1e51('0x58')});}});};exports[_0x1e51('0x59')]=function canUpdate(){return compose()['use'](function(_0xfd6521,_0x38e4a7,_0x2b7a25){return licenseUtil['getLicense']()[_0x1e51('0x3a')](function(_0x2ab15a){if(_0x2ab15a[_0x1e51('0x5a')]){_0x2b7a25();}else{return _0x38e4a7[_0x1e51('0x45')](0x193)[_0x1e51('0x3c')]({'message':_0x1e51('0x5b')});}})[_0x1e51('0x47')](function(_0x10f423){_0x2b7a25(_0x10f423);});});};exports[_0x1e51('0x5c')]=function isWebrtcLicence(){return compose()['use'](function(_0x132625,_0x22a898,_0x4b5fa7){return licenseUtil[_0x1e51('0x5d')]()[_0x1e51('0x3a')](function(_0x139e9f){if(_0x139e9f['webrtc']){_0x4b5fa7();}else{return _0x22a898[_0x1e51('0x45')](0x193)[_0x1e51('0x3c')]({'message':_0x1e51('0x5b')});}})['catch'](function(_0x2e9ee2){_0x4b5fa7(_0x2e9ee2);});});};exports['isMiddleware']=function(_0x581f7a,_0x54688b,_0x169e6c){_0x581f7a[_0x1e51('0x5e')]=!![];return _0x169e6c();};exports['signToken']=function signToken(_0x5c81f5){return signJwt(_0x5c81f5);};exports[_0x1e51('0x5f')]=function(_0x7ffc42,_0x2a43dd){if(!_0x7ffc42[_0x1e51('0x36')]){return _0x2a43dd[_0x1e51('0x45')](0x194)[_0x1e51('0x3c')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x43a92b={'payload':{'id':_0x7ffc42['user']['id'],'role':_0x7ffc42[_0x1e51('0x36')][_0x1e51('0x60')]},'options':{'expiresIn':0x15180}};return signJwt(_0x43a92b)['then'](function(_0x5ea040){_0x2a43dd['cookie'](_0x1e51('0x61'),_0x5ea040);_0x2a43dd[_0x1e51('0x62')](_0x1e51('0x63'));})['catch'](function(_0x2fdee1){return _0x2a43dd[_0x1e51('0x45')](0x1f4)[_0x1e51('0x64')](_0x2fdee1);});};exports[_0x1e51('0x65')]=function(_0x1ccb55){if(_[_0x1e51('0x66')](_0x1ccb55[_0x1e51('0x67')])||_[_0x1e51('0x66')](_0x1ccb55['apiKeyIat'])){return null;}else{return createJwt(_0x1ccb55);}};exports[_0x1e51('0x68')]=function(_0x7c5f61){_0x7c5f61[_0x1e51('0x67')]=generateNonce();_0x7c5f61[_0x1e51('0x69')]=generateIssuedAt();return createJwt(_0x7c5f61);};exports[_0x1e51('0x6a')]=function(_0x2a88db,_0x5ba6c2){var _0x23ccb5=_0x2a88db['query']['apikey'];if(_0x23ccb5){var _0x4807b9={'nonce':_0x5ba6c2[_0x1e51('0x67')],'iat':_0x5ba6c2[_0x1e51('0x69')],'audience':hardwareConf[_0x1e51('0x4b')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x23ccb5,_0x4807b9)[_0x1e51('0x3a')](function(){return generateApiKey(_0x5ba6c2);});}else{throw{'message':_0x1e51('0x6b')};}};exports[_0x1e51('0x6c')]=function(_0x4f4946){var _0x41385c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x41385c[_0x1e51('0x6d')](_0x4f4946))throw new db[(_0x1e51('0x6e'))]['ValidationError'](_0x1e51('0x6f'));return;};exports[_0x1e51('0x70')]=function(_0x175aa0,_0x30ee67,_0x666ae9){var _0x218273=encryptor[_0x1e51('0x71')](_0x30ee67)[_0x1e51('0x72')](',');for(var _0x517f51=0x0;_0x517f51<_0x666ae9;_0x517f51++){if(!_0x218273[_0x517f51])break;if(_0x175aa0[_0x1e51('0x73')]()===_0x218273[_0x517f51][_0x1e51('0x73')]()){var _0x48848f=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x666ae9);if(_0x666ae9===0x1){_0x48848f=_0x1e51('0x74');}throw new db[(_0x1e51('0x6e'))][(_0x1e51('0x75'))](_0x48848f);}}return;};exports[_0x1e51('0x76')]=function(_0x18e9d1,_0x3c322c){var _0x45b649=_0x3c322c?encryptor[_0x1e51('0x71')](_0x3c322c)[_0x1e51('0x72')](','):[];if(_0x45b649['length']===0x5){_0x45b649['splice'](-0x1,0x1);}_0x45b649['unshift'](_0x18e9d1);return encryptor[_0x1e51('0x77')](_0x45b649[_0x1e51('0x78')](','));};function signJwt(_0x50c202){var _0x4e1fa8=BPromise[_0x1e51('0x79')](jwt[_0x1e51('0x7a')],{'context':jwt});var _0x50b5c0=_0x50c202[_0x1e51('0x7b')]||config[_0x1e51('0xa')][_0x1e51('0x7c')];return new BPromise(function(_0x3e4073,_0x1cf3a3){_0x4e1fa8(_0x50c202[_0x1e51('0x7d')],_0x50b5c0,_0x50c202[_0x1e51('0x7e')])[_0x1e51('0x3a')](function(_0x207d4d){_0x3e4073(_0x207d4d);})[_0x1e51('0x47')](function(_0x486ebd){_0x1cf3a3(_0x486ebd);});});}function verifyJwt(_0x178baf,_0x2f5bf1,_0x3657a2){var _0x402bbd=BPromise[_0x1e51('0x79')](jwt[_0x1e51('0x7f')],{'context':jwt});var _0x47cc50=_0x3657a2||config['secrets'][_0x1e51('0x7c')];return new BPromise(function(_0x1b0459,_0x19ec72){_0x402bbd(_0x178baf,_0x47cc50,_0x2f5bf1)[_0x1e51('0x3a')](function(_0x52a439){_0x1b0459(_0x52a439);})['catch'](function(_0x5db283){_0x19ec72(_0x5db283);});});}function generateNonce(){return crypto[_0x1e51('0x80')](0x10)[_0x1e51('0x81')](_0x1e51('0x82'));}function generateIssuedAt(){return Math[_0x1e51('0x83')](Date[_0x1e51('0x84')]()/0x3e8)['toString']();}function createJwt(_0x16350b){var _0x3f9cea={'payload':{'iat':_0x16350b[_0x1e51('0x69')],'nonce':_0x16350b['apiKeyNonce']},'options':{'algorithm':_0x1e51('0x85'),'subject':_0x16350b['id'][_0x1e51('0x81')](),'issuer':hardwareConf[_0x1e51('0x4b')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x3f9cea)[_0x1e51('0x3a')](function(_0x37b7c6){return{'iat':_0x16350b['apiKeyIat'],'nonce':_0x16350b['apiKeyNonce'],'token':_0x37b7c6};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index f44442b..220622a 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 _0xe17e=['lodash','./sql-utils','../../mysqldb','findAll','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','fields','where','tags','skip','checkListsRestrictions','countFilteredContacts','count','User','buildContactsQuery','clause','CmContact','keys','startsWith','cf_','map','CmCustomField','slice','all','fieldType','type','catch'];(function(_0x2f8aa8,_0x1409c1){var _0x4158c0=function(_0x1617f9){while(--_0x1617f9){_0x2f8aa8['push'](_0x2f8aa8['shift']());}};_0x4158c0(++_0x1409c1);}(_0xe17e,0xd9));var _0xee17=function(_0xa5c8fd,_0x4d0a13){_0xa5c8fd=_0xa5c8fd-0x0;var _0x53067a=_0xe17e[_0xa5c8fd];return _0x53067a;};'use strict';var _=require(_0xee17('0x0'));var sqlUtils=require(_0xee17('0x1'));var db=require(_0xee17('0x2'))['db'];exports[_0xee17('0x3')]=function(_0x2f1c9c,_0x18f7e8,_0x24d7db,_0xf75d63){var _0x6e390a={'count':0x0,'rows':[]};var _0x4aaecc=sqlUtils['skipContactsQuery'](_0x18f7e8,_0x2f1c9c);if(_0x4aaecc){return Promise[_0xee17('0x4')](_0x6e390a);}var _0x391d2c=sqlUtils[_0xee17('0x5')]();var _0x5b8787={};var _0x9698eb=![];var _0x35acc6=![];return Promise[_0xee17('0x4')]()[_0xee17('0x6')](function(){if(_0x2f1c9c[_0xee17('0x7')]){return sqlUtils[_0xee17('0x8')](_0x2f1c9c[_0xee17('0x7')],_0xf75d63);}else{return sqlUtils[_0xee17('0x9')](_0x2f1c9c,_0xf75d63);}})[_0xee17('0x6')](function(_0x4058da){_0x391d2c['where'](_0x4058da['default']);_0x391d2c['where'](_0x4058da[_0xee17('0xa')]);_0x391d2c[_0xee17('0xb')](_0x4058da['filter']);_0x391d2c[_0xee17('0xb')](_0x4058da['user']['clause']);_0x5b8787=_0x4058da[_0xee17('0xc')];_0x35acc6=_0x4058da['user'][_0xee17('0xd')];return sqlUtils[_0xee17('0xe')](_0x18f7e8,_0x2f1c9c,_0x35acc6);})['then'](function(_0x5cab5b){_0x391d2c[_0xee17('0xb')](_0x5cab5b);var _0xd13eae=_0x2f1c9c[_0xee17('0x7')]?_0x5b8787['ids']:_0x2f1c9c['tag'];_0x9698eb=_0xd13eae?!![]:![];return sqlUtils[_0xee17('0xf')](_0x391d2c,_0xd13eae);})[_0xee17('0x6')](function(_0x1f115a){_0x6e390a[_0xee17('0x10')]=_0x1f115a;if(_0x6e390a[_0xee17('0x10')]===0x0){return;}if(_0x2f1c9c[_0xee17('0x11')]){_0x35acc6=!![];}return sqlUtils[_0xee17('0x12')](_0x391d2c,_0x2f1c9c[_0xee17('0xa')],_0x24d7db,_0x9698eb,_0x5b8787[_0xee17('0x13')],_0x35acc6);})[_0xee17('0x6')](function(_0x291bc2){if(!_0x291bc2){return[];}return sqlUtils['getFilteredContacts'](_0x291bc2,_0x2f1c9c,_0x24d7db);})[_0xee17('0x6')](function(_0x33bd08){_0x6e390a['rows']=_0x33bd08;return _0x6e390a;})['catch'](function(_0x5d568f){throw _0x5d568f;});};exports['describe']=function(){var _0x52c7ac={};var _0x52ea55=[];return db[_0xee17('0x14')]['describe']()[_0xee17('0x6')](function(_0x57a9ff){_0x52c7ac=_0x57a9ff;var _0x353d99=Object[_0xee17('0x15')](_0x52c7ac)['filter'](function(_0x29a170){return _[_0xee17('0x16')](_0x29a170,_0xee17('0x17'))?_0x29a170:undefined;});var _0x4c3da3=_0x353d99[_0xee17('0x18')](function(_0x3639b1){return db[_0xee17('0x19')]['findOne']({'where':{'id':_0x3639b1[_0xee17('0x1a')](0x3)},'raw':!![]});});return Promise[_0xee17('0x1b')](_0x4c3da3);})[_0xee17('0x6')](function(_0x2ed2a8){for(var _0x378047=0x0;_0x378047<_0x2ed2a8['length'];_0x378047++){if(_0x2ed2a8[_0x378047]){var _0x354994=_0xee17('0x17')+_0x2ed2a8[_0x378047]['id'];_0x52c7ac[_0x354994][_0xee17('0x1c')]=_0x2ed2a8[_0x378047][_0xee17('0x1d')];}}_0x52ea55=_[_0xee17('0x18')](Object[_0xee17('0x15')](_0x52c7ac),function(_0x5d2079){return{'name':_0x5d2079,'type':_0x52c7ac[_0x5d2079]['type']};});return _0x52ea55;})[_0xee17('0x1e')](function(_0x15254f){throw _0x15254f;});}; \ No newline at end of file +var _0x9b06=['slice','all','length','fieldType','type','map','lodash','./sql-utils','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','fields','user','clause','tags','checkListsRestrictions','tag','count','buildContactsQuery','getFilteredContacts','rows','catch','CmContact','describe','keys','filter','startsWith','cf_','CmCustomField'];(function(_0x3c51bc,_0x1a6282){var _0x4c96e0=function(_0x58b774){while(--_0x58b774){_0x3c51bc['push'](_0x3c51bc['shift']());}};_0x4c96e0(++_0x1a6282);}(_0x9b06,0x141));var _0x69b0=function(_0x53169f,_0x4a70c4){_0x53169f=_0x53169f-0x0;var _0x32554b=_0x9b06[_0x53169f];return _0x32554b;};'use strict';var _=require(_0x69b0('0x0'));var sqlUtils=require(_0x69b0('0x1'));var db=require(_0x69b0('0x2'))['db'];exports['findAll']=function(_0x2a3831,_0x122a38,_0x1801e3,_0x35543a){var _0x11e3ea={'count':0x0,'rows':[]};var _0x30fcd9=sqlUtils[_0x69b0('0x3')](_0x122a38,_0x2a3831);if(_0x30fcd9){return Promise[_0x69b0('0x4')](_0x11e3ea);}var _0x389697=sqlUtils[_0x69b0('0x5')]();var _0x1fe37c={};var _0x3cea38=![];var _0x53a99b=![];return Promise[_0x69b0('0x4')]()[_0x69b0('0x6')](function(){if(_0x2a3831[_0x69b0('0x7')]){return sqlUtils[_0x69b0('0x8')](_0x2a3831[_0x69b0('0x7')],_0x35543a);}else{return sqlUtils[_0x69b0('0x9')](_0x2a3831,_0x35543a);}})[_0x69b0('0x6')](function(_0x4aa7e1){_0x389697[_0x69b0('0xa')](_0x4aa7e1['default']);_0x389697[_0x69b0('0xa')](_0x4aa7e1[_0x69b0('0xb')]);_0x389697['where'](_0x4aa7e1['filter']);_0x389697['where'](_0x4aa7e1[_0x69b0('0xc')][_0x69b0('0xd')]);_0x1fe37c=_0x4aa7e1[_0x69b0('0xe')];_0x53a99b=_0x4aa7e1[_0x69b0('0xc')]['skip'];return sqlUtils[_0x69b0('0xf')](_0x122a38,_0x2a3831,_0x53a99b);})[_0x69b0('0x6')](function(_0x40bd7d){_0x389697[_0x69b0('0xa')](_0x40bd7d);var _0x5c8eb6=_0x2a3831[_0x69b0('0x7')]?_0x1fe37c['ids']:_0x2a3831[_0x69b0('0x10')];_0x3cea38=_0x5c8eb6?!![]:![];return sqlUtils['countFilteredContacts'](_0x389697,_0x5c8eb6);})[_0x69b0('0x6')](function(_0x71d16a){_0x11e3ea[_0x69b0('0x11')]=_0x71d16a;if(_0x11e3ea['count']===0x0){return;}if(_0x2a3831['User']){_0x53a99b=!![];}return sqlUtils[_0x69b0('0x12')](_0x389697,_0x2a3831[_0x69b0('0xb')],_0x1801e3,_0x3cea38,_0x1fe37c[_0x69b0('0xd')],_0x53a99b);})[_0x69b0('0x6')](function(_0x149bf7){if(!_0x149bf7){return[];}return sqlUtils[_0x69b0('0x13')](_0x149bf7,_0x2a3831,_0x1801e3);})[_0x69b0('0x6')](function(_0x2d601f){_0x11e3ea[_0x69b0('0x14')]=_0x2d601f;return _0x11e3ea;})[_0x69b0('0x15')](function(_0x269d65){throw _0x269d65;});};exports['describe']=function(){var _0xfcde5={};var _0x19210c=[];return db[_0x69b0('0x16')][_0x69b0('0x17')]()[_0x69b0('0x6')](function(_0x284ac9){_0xfcde5=_0x284ac9;var _0x329551=Object[_0x69b0('0x18')](_0xfcde5)[_0x69b0('0x19')](function(_0x9dbfd9){return _[_0x69b0('0x1a')](_0x9dbfd9,_0x69b0('0x1b'))?_0x9dbfd9:undefined;});var _0x306725=_0x329551['map'](function(_0x2aab65){return db[_0x69b0('0x1c')]['findOne']({'where':{'id':_0x2aab65[_0x69b0('0x1d')](0x3)},'raw':!![]});});return Promise[_0x69b0('0x1e')](_0x306725);})[_0x69b0('0x6')](function(_0x5e2c94){for(var _0x2af12b=0x0;_0x2af12b<_0x5e2c94[_0x69b0('0x1f')];_0x2af12b++){if(_0x5e2c94[_0x2af12b]){var _0x2b5a3e=_0x69b0('0x1b')+_0x5e2c94[_0x2af12b]['id'];_0xfcde5[_0x2b5a3e][_0x69b0('0x20')]=_0x5e2c94[_0x2af12b][_0x69b0('0x21')];}}_0x19210c=_[_0x69b0('0x22')](Object['keys'](_0xfcde5),function(_0x4bb60d){return{'name':_0x4bb60d,'type':_0xfcde5[_0x4bb60d][_0x69b0('0x21')]};});return _0x19210c;})['catch'](function(_0x28bdb9){throw _0x28bdb9;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index e2a0870..b879bac 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 _0xa37d=['value','start','end','Tag','map','tags','clause','user','and','keys','some','Contact','User','length','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','filter','search','role','getLists','c.ListId\x20IS\x20NULL','c.id','limit','offset','group','subqry.id','having','order','DESC','subqry.','findAll','color','Sequelize','QueryTypes','sequelize','toString','TagIds','split','Tags','COUNT(*)','isEmpty','t.id\x20IN\x20?','SELECT','query','lodash','squel','../parsers/qs','../../mysqldb','agent','ListId','autocomplete','true','select','from','cm_contacts','where','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','CompanyId','createdAt','updatedAt','push','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','parseSearch','conditions','name','field','dateOfBirth','fieldType','DATE','buildExpression','type','default','text'];(function(_0x4fe0d3,_0x14d67f){var _0x165327=function(_0x25c309){while(--_0x25c309){_0x4fe0d3['push'](_0x4fe0d3['shift']());}};_0x165327(++_0x14d67f);}(_0xa37d,0x1d9));var _0xda37=function(_0x23a33f,_0x413c03){_0x23a33f=_0x23a33f-0x0;var _0x56e720=_0xa37d[_0x23a33f];return _0x56e720;};'use strict';var _=require(_0xda37('0x0'));var squel=require(_0xda37('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0xda37('0x2'));var utils=require('../interaction/utils');var db=require(_0xda37('0x3'))['db'];function skipContactsQuery(_0x18732c,_0x435ad0){var _0x42f9f9=![];if(_0x18732c['role']===_0xda37('0x4')&&!_0x435ad0['search']&&!_0x435ad0[_0xda37('0x5')]&&_0x435ad0[_0xda37('0x6')]!==_0xda37('0x7')){_0x42f9f9=!![];}return _0x42f9f9;}function getContactsSubquery(){return squel[_0xda37('0x8')]()[_0xda37('0x9')](_0xda37('0xa'),'c')[_0xda37('0xb')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x41e445,_0x32929f){var _0x237bed=_0x32929f?'c':_0xda37('0xc');_0x41e445[_0xda37('0xd')](_0xda37('0xe'),'uc',_0xda37('0xf')+_0x237bed+_0xda37('0x10'))[_0xda37('0xd')](_0xda37('0x11'),'ct',_0xda37('0x12')+_0x237bed+_0xda37('0x10'))[_0xda37('0xd')](_0xda37('0x13'),'t',_0xda37('0x14'));return _0x41e445;}function addFieldsToQuery(_0x1617bd,_0x2f7ebe,_0x2c73f4,_0x16f60e,_0x41e939){var _0x381e5d=_0x41e939?'c':_0xda37('0xc');if(!_0x2f7ebe){_0x2f7ebe=['id',_0xda37('0x15'),_0xda37('0x16'),_0xda37('0x17'),_0xda37('0x18'),_0xda37('0x19'),_0xda37('0x1a'),_0xda37('0x5'),_0xda37('0x1b'),_0xda37('0x1c'),_0xda37('0x1d'),'deletedAt','TagIds'];}else if(!_0x2f7ebe['includes']('id')){_0x2f7ebe[_0xda37('0x1e')]('id');}var _0x4eab3e=_0x2c73f4&&_0x41e939||!_0x2c73f4&&!_0x41e939;if(_0x16f60e){_0x4eab3e=_0x16f60e&&_0x41e939||!_0x16f60e&&!_0x41e939;}_0x2f7ebe['forEach'](function(_0x1a0903){if(_0x1a0903==='TagIds'){if(_0x4eab3e){_0x1617bd['field'](_0xda37('0x1f'),_0x1a0903);}else if(_0x2c73f4||_0x16f60e){_0x1617bd['field'](_0x381e5d+'.'+_0x1a0903);}}else{_0x1617bd['field'](_0x381e5d+'.'+_0x1a0903);}});return _0x1617bd;}function getSqlClauses(){var _0x40d598={'default':squel[_0xda37('0x20')](),'fields':squel[_0xda37('0x20')](),'filter':squel['expr'](),'tags':{'clause':squel[_0xda37('0x20')](),'ids':null},'user':{'clause':squel[_0xda37('0x20')](),'skip':![]}};return _0x40d598;}function parseTagParameter(_0x5dc7d8){var _0x1e5210=squel[_0xda37('0x20')]();if(_0x5dc7d8){var _0x1e7e72=utils[_0xda37('0x21')](_0x5dc7d8);_0x1e7e72[_0xda37('0x22')](function(_0x4e0c9b){_0x1e5210['or'](_0xda37('0x23'),'%,'+_0x4e0c9b+',%');});}return _0x1e5210;}function parseSearchFilter(_0x25cf1e){var _0x3bdb0b=squel[_0xda37('0x20')]();if(_0x25cf1e){var _0x423e21=_0x25cf1e[_0xda37('0x24')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x423e21['split']('\x20')['length']>0x1){_0x3bdb0b['or'](_0xda37('0x25'),qs[_0xda37('0x26')](_0x423e21,!![]),null);}else{if(qs['isNumeric'](_0x423e21)){_0x3bdb0b['or'](_0xda37('0x27'),_0x423e21+'%');_0x3bdb0b['or'](_0xda37('0x28'),_0x423e21+'%');_0x3bdb0b['or'](_0xda37('0x29'),_0x423e21+'%');_0x3bdb0b['or'](_0xda37('0x2a'),_0x423e21+'%');}else if(qs[_0xda37('0x2b')](_0x423e21)){_0x3bdb0b['or'](_0xda37('0x2c'),_0x423e21+'%');}else{_0x3bdb0b['or'](_0xda37('0x2d'),'%'+_0x423e21+'%');_0x3bdb0b['or']('c.lastName\x20LIKE\x20?','%'+_0x423e21+'%');_0x3bdb0b['or'](_0xda37('0x2c'),'%'+_0x423e21+'%');}}}return _0x3bdb0b;}function parseAdvancedSearchFilter(_0x48157e,_0x58c3e7){var _0x286f47=getSqlClauses();var _0x858fdd=as[_0xda37('0x2e')](_0x48157e);var _0x327b34=_0x858fdd['sqlOperator'];for(var _0x1ae84a=0x0;_0x1ae84a<_0x858fdd[_0xda37('0x2f')]['length'];_0x1ae84a++){var _0x28d644=_0x858fdd[_0xda37('0x2f')][_0x1ae84a];var _0x3bea2e='c';var _0x1f6856=_['find'](_0x58c3e7,[_0xda37('0x30'),_0x28d644[_0xda37('0x31')]]);if(_0x1f6856){if(_0x28d644['field']===_0xda37('0x32')||_0x1f6856[_0xda37('0x33')]==='datetime'){_0x28d644['castTo']=_0xda37('0x34');}var _0x5527d9=as[_0xda37('0x35')](_0x3bea2e,_0x1f6856[_0xda37('0x36')],_0x28d644);_0x286f47[_0xda37('0x37')][_0x327b34](_0x5527d9[_0xda37('0x38')],_0x5527d9[_0xda37('0x39')][_0xda37('0x3a')],_0x5527d9['value'][_0xda37('0x3b')]);}else{if(_0x28d644[_0xda37('0x31')]===_0xda37('0x3c')){var _0x2521f9=_0x28d644['value']['split'](',')[_0xda37('0x3d')](function(_0x20937c){return Number(_0x20937c);});var _0x2c7415=parseTagParameter(_0x2521f9);_0x286f47[_0xda37('0x3e')][_0xda37('0x3f')]['and'](_0x2c7415);_0x286f47['tags']['ids']=_0x2521f9;}else if(_0x28d644[_0xda37('0x31')]==='User'){_0x286f47[_0xda37('0x40')][_0xda37('0x3f')][_0xda37('0x41')]('uc.UserId\x20=\x20?',_0x28d644['value']);_0x286f47['user']['skip']=!![];}}}return _0x286f47;}function parseModelFields(_0x163a7c,_0x32b0ba){var _0xfbd9f0=squel[_0xda37('0x20')]();var _0x4fcc79=_(_0x163a7c)[_0xda37('0x42')]()['map'](function(_0xb6372a){return _[_0xda37('0x43')](_0x32b0ba,[_0xda37('0x30'),_0xb6372a])?_0xb6372a:undefined;})['compact']()[_0xda37('0x39')]();if(_0x163a7c[_0xda37('0x44')]){_0x4fcc79['push'](_0xda37('0x44'));}if(_0x163a7c[_0xda37('0x45')]){_0x4fcc79[_0xda37('0x1e')]('User');}if(_0x4fcc79[_0xda37('0x46')]>0x0){_0x4fcc79[_0xda37('0x22')](function(_0x3ba8cb){if(_0x3ba8cb===_0xda37('0x5')){_0xfbd9f0[_0xda37('0x41')](_0xda37('0x47'),[][_0xda37('0x48')](_0x163a7c[_0x3ba8cb]));}else if(_0x3ba8cb===_0xda37('0x44')){var _0x2fba68='%'+_0x163a7c[_0x3ba8cb]+'%';_0xfbd9f0[_0xda37('0x41')](_0xda37('0x49'),_0x2fba68);}else if(_0x3ba8cb===_0xda37('0x45')){_0xfbd9f0['and']('uc.UserId\x20=\x20?',_0x163a7c[_0x3ba8cb]);}else{_0xfbd9f0[_0xda37('0x41')]('c.'+_0x3ba8cb+_0xda37('0x4a'),_0x163a7c[_0x3ba8cb]);}});}return _0xfbd9f0;}function parseQueryParameters(_0x4bab95,_0x45c206){var _0x513f02=getSqlClauses();return Promise[_0xda37('0x4b')]()['then'](function(){return parseModelFields(_0x4bab95,_0x45c206);})[_0xda37('0x4c')](function(_0x264902){_0x513f02[_0xda37('0x4d')][_0xda37('0x41')](_0x264902);return parseTagParameter(_0x4bab95['tag']);})['then'](function(_0x231f14){_0x513f02[_0xda37('0x3e')][_0xda37('0x3f')][_0xda37('0x41')](_0x231f14);return parseSearchFilter(_0x4bab95[_0xda37('0x4e')]);})[_0xda37('0x4c')](function(_0x8d8ffc){_0x513f02['filter']=_0x8d8ffc;return _0x513f02;});}function checkListsRestrictions(_0x3e7ae1,_0x545a93,_0x5a019e){var _0x3755df=squel[_0xda37('0x20')]();return Promise[_0xda37('0x4b')]()[_0xda37('0x4c')](function(){if(_0x545a93[_0xda37('0x4f')]&&_0x3e7ae1[_0xda37('0x50')]==='agent'&&!_0x5a019e){return _0x3e7ae1[_0xda37('0x51')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0xfb217e){if(_0xfb217e){if(_0xfb217e[_0xda37('0x46')]===0x0){_0x3755df['and'](_0xda37('0x52'));}else{_0x3755df['and']('c.ListId\x20IN\x20?',_[_0xda37('0x3d')](_0xfb217e,'id'));}}})[_0xda37('0x4c')](function(){return _0x3755df;});}function buildContactsQuery(_0x183d93,_0x3d9fee,_0x4fcce3,_0x22461e,_0x21430f,_0x5c7e18){if(_0x3d9fee){_0x3d9fee=_0x4fcce3['attributes'];}_0x183d93=addFieldsToQuery(_0x183d93,_0x3d9fee,_0x22461e,_0x5c7e18,!![]);var _0xb53853=squel['select']();_0xb53853=addFieldsToQuery(_0xb53853,_0x3d9fee,_0x22461e,_0x5c7e18,![]);if(_0x22461e||_0x5c7e18){_0x183d93=applyJoinClauses(_0x183d93,!![]);_0x183d93['group'](_0xda37('0x53'));if(_0x4fcce3[_0xda37('0x54')]){_0xb53853[_0xda37('0x54')](_0x4fcce3[_0xda37('0x54')]);}if(_0x4fcce3['offset']){_0xb53853[_0xda37('0x55')](_0x4fcce3[_0xda37('0x55')]);}}else{_0xb53853=applyJoinClauses(_0xb53853,![]);_0xb53853[_0xda37('0x56')](_0xda37('0x57'));if(_0x4fcce3[_0xda37('0x54')]){_0x183d93[_0xda37('0x54')](_0x4fcce3[_0xda37('0x54')]);}if(_0x4fcce3['offset']){_0x183d93[_0xda37('0x55')](_0x4fcce3[_0xda37('0x55')]);}}_0xb53853[_0xda37('0x58')](_0x21430f);if(_0x4fcce3[_0xda37('0x59')]){_0x4fcce3[_0xda37('0x59')]['forEach'](function(_0x5b1206){_0x183d93[_0xda37('0x59')]('c.'+_0x5b1206[0x0],_0x5b1206[0x1]===_0xda37('0x5a')?![]:!![]);_0xb53853[_0xda37('0x59')](_0xda37('0x5b')+_0x5b1206[0x0],_0x5b1206[0x1]===_0xda37('0x5a')?![]:!![]);});}_0xb53853[_0xda37('0x9')](_0x183d93,_0xda37('0xc'));return _0xb53853;}function getFilteredContacts(_0x310066){var _0x41688d=[];return db[_0xda37('0x3c')][_0xda37('0x5c')]({'attributes':['id','name',_0xda37('0x5d')],'raw':!![]})[_0xda37('0x4c')](function(_0x47e33c){_0x41688d=_['keyBy'](_0x47e33c,'id');var _0x18a81f={'type':db[_0xda37('0x5e')][_0xda37('0x5f')]['SELECT'],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xda37('0x60')]['query'](_0x310066[_0xda37('0x61')](),_0x18a81f);})[_0xda37('0x4c')](function(_0x4c03de){_0x4c03de['forEach'](function(_0xb1ad97){if(_0xb1ad97['TagIds']){_0xb1ad97['Tags']=[];_0xb1ad97[_0xda37('0x62')][_0xda37('0x63')](',')[_0xda37('0x22')](function(_0x1d97a5){_0xb1ad97[_0xda37('0x64')][_0xda37('0x1e')](_0x41688d[_0x1d97a5]);});}delete _0xb1ad97['TagIds'];});return _0x4c03de;});}function countFilteredContacts(_0x61a0f4,_0x4740db){var _0x27c7b5=_0x61a0f4['clone']();_0x27c7b5[_0xda37('0x31')](_0xda37('0x65'));_0x27c7b5=applyJoinClauses(_0x27c7b5,!![]);_0x61a0f4[_0xda37('0x56')](_0xda37('0x53'));var _0x267e41=utils[_0xda37('0x21')](_0x4740db);if(!_[_0xda37('0x66')](_0x267e41)){_0x27c7b5[_0xda37('0xb')](_0xda37('0x67'),_0x267e41);}var _0x25ee67={'type':db[_0xda37('0x5e')][_0xda37('0x5f')][_0xda37('0x68')],'raw':!![]};return db['sequelize'][_0xda37('0x69')](_0x27c7b5[_0xda37('0x61')](),_0x25ee67)[_0xda37('0x4c')](function(_0x5ccde2){return _0x5ccde2[0x0][_0xda37('0x65')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x4ccb=['phone','mobile','fax','email','createdAt','updatedAt','TagIds','includes','push','forEach','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','default','start','value','end','Tag','map','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','agent','getLists','c.ListId\x20IS\x20NULL','attributes','c.id','limit','offset','group','subqry.id','having','order','DESC','findAll','color','keyBy','QueryTypes','SELECT','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','search','ListId','autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x4ccb,0x1ae));var _0xb4cc=function(_0x385e12,_0x2a293b){_0x385e12=_0x385e12-0x0;var _0x1b23be=_0x4ccb[_0x385e12];return _0x1b23be;};'use strict';var _=require(_0xb4cc('0x0'));var squel=require(_0xb4cc('0x1'));var as=require(_0xb4cc('0x2'));var qs=require(_0xb4cc('0x3'));var utils=require(_0xb4cc('0x4'));var db=require(_0xb4cc('0x5'))['db'];function skipContactsQuery(_0x507228,_0x5d6830){var _0x12d388=![];if(_0x507228[_0xb4cc('0x6')]==='agent'&&!_0x5d6830[_0xb4cc('0x7')]&&!_0x5d6830[_0xb4cc('0x8')]&&_0x5d6830[_0xb4cc('0x9')]!==_0xb4cc('0xa')){_0x12d388=!![];}return _0x12d388;}function getContactsSubquery(){return squel[_0xb4cc('0xb')]()[_0xb4cc('0xc')](_0xb4cc('0xd'),'c')[_0xb4cc('0xe')](_0xb4cc('0xf'));}function applyJoinClauses(_0x4818a6,_0xb388e7){var _0x49389d=_0xb388e7?'c':_0xb4cc('0x10');_0x4818a6['left_join'](_0xb4cc('0x11'),'uc',_0xb4cc('0x12')+_0x49389d+_0xb4cc('0x13'))[_0xb4cc('0x14')](_0xb4cc('0x15'),'ct','ct.CmContactId\x20=\x20'+_0x49389d+_0xb4cc('0x13'))[_0xb4cc('0x14')](_0xb4cc('0x16'),'t',_0xb4cc('0x17'));return _0x4818a6;}function addFieldsToQuery(_0x4a202a,_0x271950,_0x500b53,_0x202085,_0xcc0bc5){var _0x4fc16e=_0xcc0bc5?'c':_0xb4cc('0x10');if(!_0x271950){_0x271950=['id',_0xb4cc('0x18'),_0xb4cc('0x19'),_0xb4cc('0x1a'),_0xb4cc('0x1b'),_0xb4cc('0x1c'),_0xb4cc('0x1d'),_0xb4cc('0x8'),'CompanyId',_0xb4cc('0x1e'),_0xb4cc('0x1f'),'deletedAt',_0xb4cc('0x20')];}else if(!_0x271950[_0xb4cc('0x21')]('id')){_0x271950[_0xb4cc('0x22')]('id');}var _0x24c449=_0x500b53&&_0xcc0bc5||!_0x500b53&&!_0xcc0bc5;if(_0x202085){_0x24c449=_0x202085&&_0xcc0bc5||!_0x202085&&!_0xcc0bc5;}_0x271950[_0xb4cc('0x23')](function(_0x345c52){if(_0x345c52===_0xb4cc('0x20')){if(_0x24c449){_0x4a202a[_0xb4cc('0x24')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x345c52);}else if(_0x500b53||_0x202085){_0x4a202a[_0xb4cc('0x24')](_0x4fc16e+'.'+_0x345c52);}}else{_0x4a202a['field'](_0x4fc16e+'.'+_0x345c52);}});return _0x4a202a;}function getSqlClauses(){var _0x181fd9={'default':squel[_0xb4cc('0x25')](),'fields':squel[_0xb4cc('0x25')](),'filter':squel[_0xb4cc('0x25')](),'tags':{'clause':squel[_0xb4cc('0x25')](),'ids':null},'user':{'clause':squel[_0xb4cc('0x25')](),'skip':![]}};return _0x181fd9;}function parseTagParameter(_0x13355c){var _0x12edb7=squel[_0xb4cc('0x25')]();if(_0x13355c){var _0x4de092=utils[_0xb4cc('0x26')](_0x13355c);_0x4de092['forEach'](function(_0xb319ce){_0x12edb7['or'](_0xb4cc('0x27'),'%,'+_0xb319ce+',%');});}return _0x12edb7;}function parseSearchFilter(_0x391691){var _0x483873=squel[_0xb4cc('0x25')]();if(_0x391691){var _0x1b323b=_0x391691[_0xb4cc('0x28')]('\x5c','\x5c\x5c')[_0xb4cc('0x28')](/'/g,'\x27\x27');if(_0x1b323b[_0xb4cc('0x29')]('\x20')[_0xb4cc('0x2a')]>0x1){_0x483873['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb4cc('0x2b')](_0x1b323b,!![]),null);}else{if(qs[_0xb4cc('0x2c')](_0x1b323b)){_0x483873['or'](_0xb4cc('0x2d'),_0x1b323b+'%');_0x483873['or'](_0xb4cc('0x2e'),_0x1b323b+'%');_0x483873['or']('c.mobile\x20LIKE\x20?',_0x1b323b+'%');_0x483873['or'](_0xb4cc('0x2f'),_0x1b323b+'%');}else if(qs[_0xb4cc('0x30')](_0x1b323b)){_0x483873['or'](_0xb4cc('0x31'),_0x1b323b+'%');}else{_0x483873['or'](_0xb4cc('0x32'),'%'+_0x1b323b+'%');_0x483873['or'](_0xb4cc('0x33'),'%'+_0x1b323b+'%');_0x483873['or'](_0xb4cc('0x31'),'%'+_0x1b323b+'%');}}}return _0x483873;}function parseAdvancedSearchFilter(_0xe2b132,_0x37a5d1){var _0x53e4f8=getSqlClauses();var _0x5a0dc7=as[_0xb4cc('0x34')](_0xe2b132);var _0x15e84d=_0x5a0dc7[_0xb4cc('0x35')];for(var _0x3ac9b1=0x0;_0x3ac9b1<_0x5a0dc7[_0xb4cc('0x36')][_0xb4cc('0x2a')];_0x3ac9b1++){var _0x3835f9=_0x5a0dc7[_0xb4cc('0x36')][_0x3ac9b1];var _0x22393e='c';var _0x2232ec=_['find'](_0x37a5d1,[_0xb4cc('0x37'),_0x3835f9['field']]);if(_0x2232ec){if(_0x3835f9[_0xb4cc('0x24')]===_0xb4cc('0x38')||_0x2232ec[_0xb4cc('0x39')]===_0xb4cc('0x3a')){_0x3835f9[_0xb4cc('0x3b')]=_0xb4cc('0x3c');}var _0x553a4f=as[_0xb4cc('0x3d')](_0x22393e,_0x2232ec['type'],_0x3835f9);_0x53e4f8[_0xb4cc('0x3e')][_0x15e84d](_0x553a4f['text'],_0x553a4f['value'][_0xb4cc('0x3f')],_0x553a4f[_0xb4cc('0x40')][_0xb4cc('0x41')]);}else{if(_0x3835f9[_0xb4cc('0x24')]===_0xb4cc('0x42')){var _0x18701f=_0x3835f9[_0xb4cc('0x40')][_0xb4cc('0x29')](',')[_0xb4cc('0x43')](function(_0x5bbd3c){return Number(_0x5bbd3c);});var _0x504d15=parseTagParameter(_0x18701f);_0x53e4f8[_0xb4cc('0x44')][_0xb4cc('0x45')][_0xb4cc('0x46')](_0x504d15);_0x53e4f8[_0xb4cc('0x44')][_0xb4cc('0x47')]=_0x18701f;}else if(_0x3835f9['field']===_0xb4cc('0x48')){_0x53e4f8[_0xb4cc('0x49')][_0xb4cc('0x45')][_0xb4cc('0x46')](_0xb4cc('0x4a'),_0x3835f9[_0xb4cc('0x40')]);_0x53e4f8[_0xb4cc('0x49')][_0xb4cc('0x4b')]=!![];}}}return _0x53e4f8;}function parseModelFields(_0x58b508,_0x233d0a){var _0x29ff5b=squel['expr']();var _0x4dc50c=_(_0x58b508)[_0xb4cc('0x4c')]()[_0xb4cc('0x43')](function(_0x3670c4){return _[_0xb4cc('0x4d')](_0x233d0a,[_0xb4cc('0x37'),_0x3670c4])?_0x3670c4:undefined;})[_0xb4cc('0x4e')]()[_0xb4cc('0x40')]();if(_0x58b508[_0xb4cc('0x4f')]){_0x4dc50c[_0xb4cc('0x22')](_0xb4cc('0x4f'));}if(_0x58b508['User']){_0x4dc50c[_0xb4cc('0x22')](_0xb4cc('0x48'));}if(_0x4dc50c[_0xb4cc('0x2a')]>0x0){_0x4dc50c[_0xb4cc('0x23')](function(_0x42144d){if(_0x42144d===_0xb4cc('0x8')){_0x29ff5b[_0xb4cc('0x46')]('c.ListId\x20IN\x20?',[][_0xb4cc('0x50')](_0x58b508[_0x42144d]));}else if(_0x42144d===_0xb4cc('0x4f')){var _0x4a68df='%'+_0x58b508[_0x42144d]+'%';_0x29ff5b[_0xb4cc('0x46')](_0xb4cc('0x51'),_0x4a68df);}else if(_0x42144d===_0xb4cc('0x48')){_0x29ff5b[_0xb4cc('0x46')](_0xb4cc('0x4a'),_0x58b508[_0x42144d]);}else{_0x29ff5b[_0xb4cc('0x46')]('c.'+_0x42144d+_0xb4cc('0x52'),_0x58b508[_0x42144d]);}});}return _0x29ff5b;}function parseQueryParameters(_0x136259,_0x10b04e){var _0x11962d=getSqlClauses();return Promise[_0xb4cc('0x53')]()[_0xb4cc('0x54')](function(){return parseModelFields(_0x136259,_0x10b04e);})[_0xb4cc('0x54')](function(_0x195369){_0x11962d[_0xb4cc('0x55')][_0xb4cc('0x46')](_0x195369);return parseTagParameter(_0x136259[_0xb4cc('0x56')]);})['then'](function(_0x2297ee){_0x11962d[_0xb4cc('0x44')]['clause'][_0xb4cc('0x46')](_0x2297ee);return parseSearchFilter(_0x136259[_0xb4cc('0x57')]);})[_0xb4cc('0x54')](function(_0x3e17df){_0x11962d[_0xb4cc('0x57')]=_0x3e17df;return _0x11962d;});}function checkListsRestrictions(_0x1afb6e,_0x534032,_0x433e58){var _0x386bd8=squel[_0xb4cc('0x25')]();return Promise[_0xb4cc('0x53')]()[_0xb4cc('0x54')](function(){if(_0x534032[_0xb4cc('0x7')]&&_0x1afb6e['role']===_0xb4cc('0x58')&&!_0x433e58){return _0x1afb6e[_0xb4cc('0x59')]({'attributes':['id'],'raw':!![]});}})[_0xb4cc('0x54')](function(_0x39dc5e){if(_0x39dc5e){if(_0x39dc5e[_0xb4cc('0x2a')]===0x0){_0x386bd8[_0xb4cc('0x46')](_0xb4cc('0x5a'));}else{_0x386bd8[_0xb4cc('0x46')]('c.ListId\x20IN\x20?',_[_0xb4cc('0x43')](_0x39dc5e,'id'));}}})[_0xb4cc('0x54')](function(){return _0x386bd8;});}function buildContactsQuery(_0x3a1ff1,_0x24609b,_0x119524,_0x28c37a,_0x5f2ba6,_0x1539b2){if(_0x24609b){_0x24609b=_0x119524[_0xb4cc('0x5b')];}_0x3a1ff1=addFieldsToQuery(_0x3a1ff1,_0x24609b,_0x28c37a,_0x1539b2,!![]);var _0x1734e7=squel[_0xb4cc('0xb')]();_0x1734e7=addFieldsToQuery(_0x1734e7,_0x24609b,_0x28c37a,_0x1539b2,![]);if(_0x28c37a||_0x1539b2){_0x3a1ff1=applyJoinClauses(_0x3a1ff1,!![]);_0x3a1ff1['group'](_0xb4cc('0x5c'));if(_0x119524['limit']){_0x1734e7[_0xb4cc('0x5d')](_0x119524[_0xb4cc('0x5d')]);}if(_0x119524[_0xb4cc('0x5e')]){_0x1734e7[_0xb4cc('0x5e')](_0x119524['offset']);}}else{_0x1734e7=applyJoinClauses(_0x1734e7,![]);_0x1734e7[_0xb4cc('0x5f')](_0xb4cc('0x60'));if(_0x119524['limit']){_0x3a1ff1[_0xb4cc('0x5d')](_0x119524[_0xb4cc('0x5d')]);}if(_0x119524[_0xb4cc('0x5e')]){_0x3a1ff1[_0xb4cc('0x5e')](_0x119524['offset']);}}_0x1734e7[_0xb4cc('0x61')](_0x5f2ba6);if(_0x119524[_0xb4cc('0x62')]){_0x119524[_0xb4cc('0x62')][_0xb4cc('0x23')](function(_0x1e7d06){_0x3a1ff1[_0xb4cc('0x62')]('c.'+_0x1e7d06[0x0],_0x1e7d06[0x1]==='DESC'?![]:!![]);_0x1734e7[_0xb4cc('0x62')]('subqry.'+_0x1e7d06[0x0],_0x1e7d06[0x1]===_0xb4cc('0x63')?![]:!![]);});}_0x1734e7[_0xb4cc('0xc')](_0x3a1ff1,_0xb4cc('0x10'));return _0x1734e7;}function getFilteredContacts(_0x4ca272){var _0x1a4646=[];return db[_0xb4cc('0x42')][_0xb4cc('0x64')]({'attributes':['id','name',_0xb4cc('0x65')],'raw':!![]})['then'](function(_0x199b27){_0x1a4646=_[_0xb4cc('0x66')](_0x199b27,'id');var _0x47fe64={'type':db['Sequelize'][_0xb4cc('0x67')][_0xb4cc('0x68')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xb4cc('0x69')][_0xb4cc('0x6a')](_0x4ca272[_0xb4cc('0x6b')](),_0x47fe64);})[_0xb4cc('0x54')](function(_0x3c07c1){_0x3c07c1['forEach'](function(_0xe0f475){if(_0xe0f475[_0xb4cc('0x20')]){_0xe0f475[_0xb4cc('0x6c')]=[];_0xe0f475[_0xb4cc('0x20')][_0xb4cc('0x29')](',')[_0xb4cc('0x23')](function(_0x1a119c){_0xe0f475[_0xb4cc('0x6c')][_0xb4cc('0x22')](_0x1a4646[_0x1a119c]);});}delete _0xe0f475[_0xb4cc('0x20')];});return _0x3c07c1;});}function countFilteredContacts(_0x294fcb,_0x50d44a){var _0x1e2a75=_0x294fcb[_0xb4cc('0x6d')]();_0x1e2a75[_0xb4cc('0x24')](_0xb4cc('0x6e'));_0x1e2a75=applyJoinClauses(_0x1e2a75,!![]);_0x294fcb['group'](_0xb4cc('0x5c'));var _0x5cdc76=utils[_0xb4cc('0x26')](_0x50d44a);if(!_[_0xb4cc('0x6f')](_0x5cdc76)){_0x1e2a75[_0xb4cc('0xe')](_0xb4cc('0x70'),_0x5cdc76);}var _0x2abd0c={'type':db[_0xb4cc('0x71')][_0xb4cc('0x67')][_0xb4cc('0x68')],'raw':!![]};return db[_0xb4cc('0x69')][_0xb4cc('0x6a')](_0x1e2a75[_0xb4cc('0x6b')](),_0x2abd0c)[_0xb4cc('0x54')](function(_0x539bb0){return _0x539bb0[0x0][_0xb4cc('0x6e')];});}module['exports']={'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 28ae136..8f665ab 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 _0x103a=['update','binary','write','end','final','close','unlink','decryptFile','createDecipher','secret','base64','decryptString','utf8','crypto','bluebird','lodash','../../config/logger','secrets','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','data'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x103a,0xed));var _0xa103=function(_0x59566d,_0x3640b7){_0x59566d=_0x59566d-0x0;var _0x139267=_0x103a[_0x59566d];return _0x139267;};'use strict';var crypto=require(_0xa103('0x0'));var fs=require('fs');var BPromise=require(_0xa103('0x1'));var _=require(_0xa103('0x2'));var config=require('../../config/environment');var logger=require(_0xa103('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xa103('0x4')]['session'],'algorithm':_0xa103('0x5')};const fileOptions={'algorithm':'aes192'};if(config[_0xa103('0x6')]&&config['encrypt'][_0xa103('0x7')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xa103('0x7')]);if(isSupported){fileOptions['algorithm']=config[_0xa103('0x6')][_0xa103('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xa103('0x8')](',\x20');logger[_0xa103('0x9')](config[_0xa103('0x6')][_0xa103('0x7')],_0xa103('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x1efc53){return AES_SUPPORTED_RX['test'](_0x1efc53);}function getSupportedCiphers(){return crypto[_0xa103('0xb')]()[_0xa103('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x3b5fb0){return getSupportedCiphers()[_0xa103('0xd')](_0x3b5fb0)>-0x1;}function combineOptions(_0x3d0305){var _0x273e51={};for(var _0x46889a in fileOptions){if(fileOptions[_0xa103('0xe')](_0x46889a)){_0x273e51[_0x46889a]=fileOptions[_0x46889a];}}if(_0x3d0305){for(var _0x433f17 in _0x3d0305){if(_0x3d0305[_0xa103('0xe')](_0x433f17)){_0x273e51[_0x433f17]=_0x3d0305[_0x433f17];}}}return _0x273e51;}exports['encryptFile']=function(_0x5261f2,_0x447578,_0x4d266f,_0x600110){return new BPromise(function(_0x566a3c,_0x23f6db){_0x600110=combineOptions(_0x600110);var _0x592901=new Buffer(_0x4d266f);var _0x208cb0=fs[_0xa103('0xf')](_0x5261f2);var _0x2eb9f4=fs[_0xa103('0x10')](_0x447578);var _0x2610c3=crypto[_0xa103('0x11')](_0x600110[_0xa103('0x7')],_0x592901);_0x208cb0['on'](_0xa103('0x12'),function(_0x10b5ee){var _0xd0ee63=new Buffer(_0x2610c3[_0xa103('0x13')](_0x10b5ee),_0xa103('0x14'));_0x2eb9f4[_0xa103('0x15')](_0xd0ee63);});_0x208cb0['on'](_0xa103('0x16'),function(){try{var _0x42965d=new Buffer(_0x2610c3[_0xa103('0x17')]('binary'),_0xa103('0x14'));_0x2eb9f4[_0xa103('0x15')](_0x42965d);_0x2eb9f4[_0xa103('0x16')]();_0x2eb9f4['on'](_0xa103('0x18'),function(){return _0x566a3c(_0x447578);});}catch(_0x2188c8){fs[_0xa103('0x19')](_0x447578);return _0x23f6db(_0x2188c8);}});});};exports[_0xa103('0x1a')]=function(_0x2f22c7,_0x23498d,_0x4cbe41,_0x2524b6){return new BPromise(function(_0x505d6a,_0x5d4f83){_0x2524b6=combineOptions(_0x2524b6);var _0x5351b3=new Buffer(_0x4cbe41);var _0x582d40=fs[_0xa103('0xf')](_0x2f22c7);var _0x595e41=fs[_0xa103('0x10')](_0x23498d);var _0x2107ed=crypto[_0xa103('0x1b')](_0x2524b6[_0xa103('0x7')],_0x5351b3);_0x582d40['on'](_0xa103('0x12'),function(_0x51605b){var _0x3343e8=new Buffer(_0x2107ed[_0xa103('0x13')](_0x51605b),_0xa103('0x14'));_0x595e41[_0xa103('0x15')](_0x3343e8);});_0x582d40['on'](_0xa103('0x16'),function(){try{var _0x1bb360=new Buffer(_0x2107ed[_0xa103('0x17')](_0xa103('0x14')),_0xa103('0x14'));_0x595e41[_0xa103('0x15')](_0x1bb360);_0x595e41['end']();_0x595e41['on']('close',function(){return _0x505d6a(_0x23498d);});}catch(_0x52b2e3){fs[_0xa103('0x19')](_0x23498d);return _0x5d4f83(_0x52b2e3);}});});};exports['encryptString']=function(_0x5b5d50,_0x53a4ff,_0xc80331){var _0x56a5d2=_0xc80331||stringOptions['algorithm'];var _0x45b915=_0x53a4ff||stringOptions[_0xa103('0x1c')];var _0x5b076a=crypto[_0xa103('0x11')](_0x56a5d2,_0x45b915);var _0x2970b7=_0x5b076a[_0xa103('0x13')](_0x5b5d50,'utf8',_0xa103('0x1d'));_0x2970b7+=_0x5b076a[_0xa103('0x17')](_0xa103('0x1d'));return _0x2970b7;};exports[_0xa103('0x1e')]=function(_0x4c7d26,_0x36c789,_0x1af431){var _0x5b9e16=_0x1af431||stringOptions[_0xa103('0x7')];var _0x50e6a5=_0x36c789||stringOptions[_0xa103('0x1c')];var _0x4a607f=crypto['createDecipher'](_0x5b9e16,_0x50e6a5);var _0x4eb39f=_0x4a607f[_0xa103('0x13')](_0x4c7d26,'base64','utf8');_0x4eb39f+=_0x4a607f[_0xa103('0x17')](_0xa103('0x1f'));return _0x4eb39f;}; \ No newline at end of file +var _0x5058=['data','final','close','encryptString','secret','utf8','base64','decryptString','crypto','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','binary','write','end','unlink','decryptFile','createDecipher'];(function(_0x1bba6c,_0x1f94cf){var _0x415735=function(_0x3ef30d){while(--_0x3ef30d){_0x1bba6c['push'](_0x1bba6c['shift']());}};_0x415735(++_0x1f94cf);}(_0x5058,0xd4));var _0x8505=function(_0x492535,_0x46524a){_0x492535=_0x492535-0x0;var _0x256620=_0x5058[_0x492535];return _0x256620;};'use strict';var crypto=require(_0x8505('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x8505('0x1'));var config=require(_0x8505('0x2'));var logger=require(_0x8505('0x3'))(_0x8505('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x8505('0x5')][_0x8505('0x6')],'algorithm':_0x8505('0x7')};const fileOptions={'algorithm':_0x8505('0x8')};if(config['encrypt']&&config[_0x8505('0x9')][_0x8505('0xa')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x8505('0xa')]);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0x8505('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x8505('0xb')](',\x20');logger['error'](config['encrypt'][_0x8505('0xa')],_0x8505('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x55eac6){return AES_SUPPORTED_RX[_0x8505('0xd')](_0x55eac6);}function getSupportedCiphers(){return crypto[_0x8505('0xe')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x88a1e9){return getSupportedCiphers()['indexOf'](_0x88a1e9)>-0x1;}function combineOptions(_0xdb660e){var _0xbf8198={};for(var _0x3159cd in fileOptions){if(fileOptions[_0x8505('0xf')](_0x3159cd)){_0xbf8198[_0x3159cd]=fileOptions[_0x3159cd];}}if(_0xdb660e){for(var _0x4c0c5d in _0xdb660e){if(_0xdb660e[_0x8505('0xf')](_0x4c0c5d)){_0xbf8198[_0x4c0c5d]=_0xdb660e[_0x4c0c5d];}}}return _0xbf8198;}exports[_0x8505('0x10')]=function(_0x152f9f,_0xad6b22,_0x4caf50,_0x391de0){return new BPromise(function(_0x2b04f0,_0x2fcdba){_0x391de0=combineOptions(_0x391de0);var _0x5b5b1e=new Buffer(_0x4caf50);var _0x11f3f3=fs[_0x8505('0x11')](_0x152f9f);var _0x4dbb9d=fs[_0x8505('0x12')](_0xad6b22);var _0x3e9d48=crypto[_0x8505('0x13')](_0x391de0[_0x8505('0xa')],_0x5b5b1e);_0x11f3f3['on']('data',function(_0x522d22){var _0x2d61c3=new Buffer(_0x3e9d48['update'](_0x522d22),_0x8505('0x14'));_0x4dbb9d[_0x8505('0x15')](_0x2d61c3);});_0x11f3f3['on'](_0x8505('0x16'),function(){try{var _0x2b7bb3=new Buffer(_0x3e9d48['final']('binary'),_0x8505('0x14'));_0x4dbb9d[_0x8505('0x15')](_0x2b7bb3);_0x4dbb9d['end']();_0x4dbb9d['on']('close',function(){return _0x2b04f0(_0xad6b22);});}catch(_0x25ef35){fs[_0x8505('0x17')](_0xad6b22);return _0x2fcdba(_0x25ef35);}});});};exports[_0x8505('0x18')]=function(_0x27fb43,_0x4934a8,_0x51b048,_0x155eb0){return new BPromise(function(_0x53f779,_0xe54a30){_0x155eb0=combineOptions(_0x155eb0);var _0x1620a7=new Buffer(_0x51b048);var _0x285a6a=fs[_0x8505('0x11')](_0x27fb43);var _0x120105=fs[_0x8505('0x12')](_0x4934a8);var _0x1f795a=crypto[_0x8505('0x19')](_0x155eb0[_0x8505('0xa')],_0x1620a7);_0x285a6a['on'](_0x8505('0x1a'),function(_0x297431){var _0x543f2d=new Buffer(_0x1f795a['update'](_0x297431),_0x8505('0x14'));_0x120105[_0x8505('0x15')](_0x543f2d);});_0x285a6a['on'](_0x8505('0x16'),function(){try{var _0x7b68eb=new Buffer(_0x1f795a[_0x8505('0x1b')](_0x8505('0x14')),_0x8505('0x14'));_0x120105[_0x8505('0x15')](_0x7b68eb);_0x120105[_0x8505('0x16')]();_0x120105['on'](_0x8505('0x1c'),function(){return _0x53f779(_0x4934a8);});}catch(_0x4462ed){fs[_0x8505('0x17')](_0x4934a8);return _0xe54a30(_0x4462ed);}});});};exports[_0x8505('0x1d')]=function(_0x38ea87,_0x5e848c,_0x387821){var _0x3bb90f=_0x387821||stringOptions['algorithm'];var _0x505152=_0x5e848c||stringOptions[_0x8505('0x1e')];var _0x4b303e=crypto[_0x8505('0x13')](_0x3bb90f,_0x505152);var _0x36b2a5=_0x4b303e['update'](_0x38ea87,_0x8505('0x1f'),_0x8505('0x20'));_0x36b2a5+=_0x4b303e[_0x8505('0x1b')](_0x8505('0x20'));return _0x36b2a5;};exports[_0x8505('0x21')]=function(_0x28800a,_0x4c455c,_0x2e2069){var _0x418ead=_0x2e2069||stringOptions[_0x8505('0xa')];var _0xd2080b=_0x4c455c||stringOptions[_0x8505('0x1e')];var _0x4dc265=crypto[_0x8505('0x19')](_0x418ead,_0xd2080b);var _0x1d1272=_0x4dc265['update'](_0x28800a,'base64',_0x8505('0x1f'));_0x1d1272+=_0x4dc265['final'](_0x8505('0x1f'));return _0x1d1272;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 364b8c6..ee12b82 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 _0xab47=['CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','length','existsSync','mkdirSync','join','%s%d.%s','csv','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x4c32c0,_0x5aa4a8){var _0x24dd01=function(_0x5721f4){while(--_0x5721f4){_0x4c32c0['push'](_0x4c32c0['shift']());}};_0x24dd01(++_0x5aa4a8);}(_0xab47,0x82));var _0x7ab4=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0xab47[_0x37cc52];return _0x2b4a90;};'use strict';var util=require(_0x7ab4('0x0'));var path=require(_0x7ab4('0x1'));var _=require('lodash');var csv=require(_0x7ab4('0x2'));var fs=require('fs');var BPromise=require(_0x7ab4('0x3'));var zipdir=require(_0x7ab4('0x4'));var rimraf=require('rimraf');var db=require(_0x7ab4('0x5'))['db'];var dbH=require('../../mysqldb')[_0x7ab4('0x6')];var logger=require(_0x7ab4('0x7'))(_0x7ab4('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x7ab4('0x9')][0x2]);var QUERY=process[_0x7ab4('0x9')][0x3];var PATH=process[_0x7ab4('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x42f606,_0x6ba6f3){var _0x2679e5={'status':_0x42f606};var _0x5219fa={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x6ba6f3){_0x2679e5[_0x7ab4('0xa')]=_0x6ba6f3;}return db[_0x7ab4('0xb')]['update'](_0x2679e5,_0x5219fa);}function main(){var _0x7754ff=0x1388;var _0x256fed;logger['info'](util[_0x7ab4('0xc')](_0x7ab4('0xd'),EXTRACTED_REPORT_ID,_0x7ab4('0xe')));return db[_0x7ab4('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7ab4('0x10'),_0x7ab4('0x11')]})[_0x7ab4('0x12')](function(_0x4a528e){if(_0x4a528e){_0x256fed=_0x4a528e;_0x7754ff=_0x256fed['splitSizeCsv']||0x1388;}})[_0x7ab4('0x12')](function(){return dbH[_0x7ab4('0x13')][_0x7ab4('0x14')](util[_0x7ab4('0xc')](_0x7ab4('0x15'),QUERY),{'type':dbH[_0x7ab4('0x13')][_0x7ab4('0x16')][_0x7ab4('0x17')]});})[_0x7ab4('0x12')](function(_0x1b183d){if(!_0x1b183d[0x0][_0x7ab4('0x18')]){return analyticExtractedReport(_0x7ab4('0x19'));}var _0x1bebc6=[];var _0x3f0284=0x0;if(_0x256fed[_0x7ab4('0x10')]){if(_0x1b183d&&_0x1b183d['length']){var _0x8424cf=_[_0x7ab4('0x1a')](_0x1b183d[0x0][_0x7ab4('0x18')]/_0x7754ff);var _0x24dd1e=Number[_0x7ab4('0x1b')](_0x1b183d[0x0][_0x7ab4('0x18')]/_0x7754ff)?_0x1b183d[0x0][_0x7ab4('0x18')]%_0x7754ff:0x0;_0x8424cf[_0x7ab4('0x1c')](function(_0x3056e3){if(_0x3056e3>0x0){_0x3f0284+=_0x7754ff;}_0x1bebc6[_0x7ab4('0x1d')](dbH['sequelize'][_0x7ab4('0x14')](util[_0x7ab4('0xc')](_0x7ab4('0x1e'),QUERY,_0x7754ff,_0x3f0284),{'type':dbH['sequelize'][_0x7ab4('0x16')][_0x7ab4('0x17')]}));});if(_0x24dd1e>0x0){_0x3f0284+=_0x7754ff;_0x1bebc6[_0x7ab4('0x1d')](dbH[_0x7ab4('0x13')][_0x7ab4('0x14')](util[_0x7ab4('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x24dd1e,_0x3f0284),{'type':dbH[_0x7ab4('0x13')]['QueryTypes'][_0x7ab4('0x17')]}));}}}else{_0x1bebc6[_0x7ab4('0x1d')](dbH[_0x7ab4('0x13')][_0x7ab4('0x14')](QUERY,{'type':dbH[_0x7ab4('0x13')][_0x7ab4('0x16')][_0x7ab4('0x17')]}));}var _0x42fec2=path[_0x7ab4('0x1f')](PATH);var _0x4ad1b4=path['basename'](PATH,'.csv');var _0x223884=_0x256fed['split']&&_0x1bebc6[_0x7ab4('0x20')]>0x1;var _0x29f30f=[];if(!fs[_0x7ab4('0x21')](path['join'](_0x42fec2,_0x4ad1b4))&&_0x223884){fs[_0x7ab4('0x22')](path[_0x7ab4('0x23')](_0x42fec2,_0x4ad1b4));}return BPromise['each'](_0x1bebc6,function(_0x1a5bb3){_0x29f30f['push'](_0x1a5bb3);})['then'](function(){for(var _0x2d3097=0x0;_0x2d3097<_0x29f30f[_0x7ab4('0x20')];_0x2d3097+=0x1){var _0x3f253c;var _0x51f105=_0x29f30f[_0x2d3097];if(_0x223884){_0x3f253c=path[_0x7ab4('0x23')](_0x42fec2,_0x4ad1b4,util[_0x7ab4('0xc')](_0x7ab4('0x24'),_0x4ad1b4,_0x2d3097,_0x7ab4('0x25')));}else{_0x3f253c=path[_0x7ab4('0x23')](_0x42fec2,util[_0x7ab4('0xc')](_0x7ab4('0x26'),_0x4ad1b4,_0x7ab4('0x25')));}fs['writeFileSync'](_0x3f253c,csv(_0x51f105));}})['then'](function(){if(_0x223884){return new Promise(function(_0x3b1d30){zipdir(path[_0x7ab4('0x23')](_0x42fec2,_0x4ad1b4),{'saveTo':path[_0x7ab4('0x23')](_0x42fec2,util['format'](_0x7ab4('0x26'),_0x4ad1b4,_0x7ab4('0x27')))},function(_0x4140ff,_0x3f4df2){rimraf(path[_0x7ab4('0x23')](_0x42fec2,_0x4ad1b4),function(){});_0x3b1d30(_0x7ab4('0x28'));});});}})[_0x7ab4('0x12')](function(){logger[_0x7ab4('0x29')](util[_0x7ab4('0xc')](_0x7ab4('0x2a'),EXTRACTED_REPORT_ID,_0x7ab4('0xe')));return analyticExtractedReport(_0x7ab4('0x2b'),_0x223884?util[_0x7ab4('0xc')](_0x7ab4('0x26'),_0x4ad1b4,_0x223884?_0x7ab4('0x27'):_0x7ab4('0x25')):null);});})['catch'](function(_0x1e9f35){logger[_0x7ab4('0x29')](util[_0x7ab4('0xc')](_0x7ab4('0x2c'),EXTRACTED_REPORT_ID,_0x7ab4('0xe')),util[_0x7ab4('0x2d')](_0x1e9f35,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7ab4('0x2e'));})['finally'](function(){process[_0x7ab4('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x1770=['zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','splitSizeCsv','then','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','%s.%s','csv','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','exit','util','path','lodash','to-csv','bluebird'];(function(_0x9dbe0e,_0x1db9b4){var _0x2b1daa=function(_0x43377b){while(--_0x43377b){_0x9dbe0e['push'](_0x9dbe0e['shift']());}};_0x2b1daa(++_0x1db9b4);}(_0x1770,0x97));var _0x0177=function(_0x3917e8,_0x503bd3){_0x3917e8=_0x3917e8-0x0;var _0x308e64=_0x1770[_0x3917e8];return _0x308e64;};'use strict';var util=require(_0x0177('0x0'));var path=require(_0x0177('0x1'));var _=require(_0x0177('0x2'));var csv=require(_0x0177('0x3'));var fs=require('fs');var BPromise=require(_0x0177('0x4'));var zipdir=require(_0x0177('0x5'));var rimraf=require(_0x0177('0x6'));var db=require(_0x0177('0x7'))['db'];var dbH=require(_0x0177('0x7'))[_0x0177('0x8')];var logger=require(_0x0177('0x9'))(_0x0177('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x0177('0xb')][0x2]);var QUERY=process[_0x0177('0xb')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3827ce,_0x5528aa){var _0x24337f={'status':_0x3827ce};var _0x4ce087={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5528aa){_0x24337f[_0x0177('0xc')]=_0x5528aa;}return db[_0x0177('0xd')][_0x0177('0xe')](_0x24337f,_0x4ce087);}function main(){var _0x35ca74=0x1388;var _0x153796;logger[_0x0177('0xf')](util['format'](_0x0177('0x10'),EXTRACTED_REPORT_ID,_0x0177('0x11')));return db['Setting'][_0x0177('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0177('0x13'),_0x0177('0x14')]})[_0x0177('0x15')](function(_0xaf8886){if(_0xaf8886){_0x153796=_0xaf8886;_0x35ca74=_0x153796[_0x0177('0x14')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x0177('0x16')](util[_0x0177('0x17')](_0x0177('0x18'),QUERY),{'type':dbH[_0x0177('0x19')][_0x0177('0x1a')][_0x0177('0x1b')]});})[_0x0177('0x15')](function(_0x591772){if(!_0x591772[0x0][_0x0177('0x1c')]){return analyticExtractedReport(_0x0177('0x1d'));}var _0x4f99c1=[];var _0xf6248c=0x0;if(_0x153796[_0x0177('0x13')]){if(_0x591772&&_0x591772[_0x0177('0x1e')]){var _0x4fac6a=_[_0x0177('0x1f')](_0x591772[0x0][_0x0177('0x1c')]/_0x35ca74);var _0xecd577=Number[_0x0177('0x20')](_0x591772[0x0]['num']/_0x35ca74)?_0x591772[0x0][_0x0177('0x1c')]%_0x35ca74:0x0;_0x4fac6a[_0x0177('0x21')](function(_0x1ac544){if(_0x1ac544>0x0){_0xf6248c+=_0x35ca74;}_0x4f99c1[_0x0177('0x22')](dbH[_0x0177('0x19')]['query'](util[_0x0177('0x17')](_0x0177('0x23'),QUERY,_0x35ca74,_0xf6248c),{'type':dbH['sequelize'][_0x0177('0x1a')][_0x0177('0x1b')]}));});if(_0xecd577>0x0){_0xf6248c+=_0x35ca74;_0x4f99c1[_0x0177('0x22')](dbH[_0x0177('0x19')][_0x0177('0x16')](util[_0x0177('0x17')](_0x0177('0x23'),QUERY,_0xecd577,_0xf6248c),{'type':dbH[_0x0177('0x19')][_0x0177('0x1a')][_0x0177('0x1b')]}));}}}else{_0x4f99c1[_0x0177('0x22')](dbH[_0x0177('0x19')][_0x0177('0x16')](QUERY,{'type':dbH[_0x0177('0x19')][_0x0177('0x1a')][_0x0177('0x1b')]}));}var _0x5f0008=path[_0x0177('0x24')](PATH);var _0x81bfd8=path[_0x0177('0x25')](PATH,_0x0177('0x26'));var _0x3aefb4=_0x153796['split']&&_0x4f99c1[_0x0177('0x1e')]>0x1;var _0x34fb56=[];if(!fs[_0x0177('0x27')](path[_0x0177('0x28')](_0x5f0008,_0x81bfd8))&&_0x3aefb4){fs[_0x0177('0x29')](path[_0x0177('0x28')](_0x5f0008,_0x81bfd8));}return BPromise['each'](_0x4f99c1,function(_0x2331e0){_0x34fb56[_0x0177('0x22')](_0x2331e0);})['then'](function(){for(var _0x42097a=0x0;_0x42097a<_0x34fb56[_0x0177('0x1e')];_0x42097a+=0x1){var _0x47f461;var _0x327ff0=_0x34fb56[_0x42097a];if(_0x3aefb4){_0x47f461=path['join'](_0x5f0008,_0x81bfd8,util[_0x0177('0x17')]('%s%d.%s',_0x81bfd8,_0x42097a,'csv'));}else{_0x47f461=path['join'](_0x5f0008,util[_0x0177('0x17')](_0x0177('0x2a'),_0x81bfd8,_0x0177('0x2b')));}fs[_0x0177('0x2c')](_0x47f461,csv(_0x327ff0));}})[_0x0177('0x15')](function(){if(_0x3aefb4){return new Promise(function(_0x1719b9){zipdir(path[_0x0177('0x28')](_0x5f0008,_0x81bfd8),{'saveTo':path[_0x0177('0x28')](_0x5f0008,util[_0x0177('0x17')](_0x0177('0x2a'),_0x81bfd8,_0x0177('0x2d')))},function(_0x125560,_0xd32f57){rimraf(path[_0x0177('0x28')](_0x5f0008,_0x81bfd8),function(){});_0x1719b9('zip\x20finished');});});}})['then'](function(){logger[_0x0177('0xf')](util[_0x0177('0x17')](_0x0177('0x2e'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x0177('0x2f'),_0x3aefb4?util[_0x0177('0x17')](_0x0177('0x2a'),_0x81bfd8,_0x3aefb4?_0x0177('0x2d'):'csv'):null);});})[_0x0177('0x30')](function(_0x3017fb){logger['info'](util[_0x0177('0x17')](_0x0177('0x31'),EXTRACTED_REPORT_ID,_0x0177('0x11')),util[_0x0177('0x32')](_0x3017fb,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x0177('0x33')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 584b7f9..53a6848 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 _0x0ac9=['interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','pipe','createWriteStream','finish','error','end','catch','lodash','util','path','moment','html-to-pdfmake','rimraf','jsdom','window','bluebird','../../mysqldb','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','update','map','tableHeader','pick','toString','fill','length','body','concat','chunk','forEach','push','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','format','endDate','header','pageBreak','before','margin','footer','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','range','isInteger','sequelize','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','query','dirname','basename','.pdf','join','mkdirSync','each','then','%s%d.%s','pdf','all','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d'];(function(_0x542d43,_0x581432){var _0x3fb854=function(_0x4a6e45){while(--_0x4a6e45){_0x542d43['push'](_0x542d43['shift']());}};_0x3fb854(++_0x581432);}(_0x0ac9,0x16e));var _0x90ac=function(_0x17784a,_0x42fe44){_0x17784a=_0x17784a-0x0;var _0x41aded=_0x0ac9[_0x17784a];return _0x41aded;};'use strict';var _=require(_0x90ac('0x0'));var fs=require('fs');var util=require(_0x90ac('0x1'));var path=require(_0x90ac('0x2'));var moment=require(_0x90ac('0x3'));var htmlToPdfmake=require(_0x90ac('0x4'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0x90ac('0x5'));var JSDOM=require(_0x90ac('0x6'))['JSDOM'];var window=new JSDOM('')[_0x90ac('0x7')];var BPromise=require(_0x90ac('0x8'));var db=require(_0x90ac('0x9'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x90ac('0xa')][0x2]);var QUERY=process[_0x90ac('0xa')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x90ac('0xa')][0x5];var FORMAT=_0x90ac('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x128f35,_0x2d5a36){var _0xff3305={'status':_0x128f35};var _0x3d4822={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2d5a36){_0xff3305['savename']=_0x2d5a36;}return db['AnalyticExtractedReport'][_0x90ac('0xc')](_0xff3305,_0x3d4822);}function getHeaders(_0xfae3c3){return _[_0x90ac('0xd')](_0xfae3c3,function(_0x57c0a6){return{'text':_0x57c0a6,'style':_0x90ac('0xe')};});}function getRows(_0xb11182,_0xb7a652){return _[_0x90ac('0xd')](_0xb7a652,function(_0x427e6a){return _(_0x427e6a)[_0x90ac('0xf')](_0xb11182)[_0x90ac('0xd')](function(_0x2fa993){return _0x2fa993?_[_0x90ac('0x10')](_0x2fa993):'';})['value']();});}function createTable(_0x58cfe7,_0x2bcca8){var _0x238dc5={'widths':_[_0x90ac('0x11')](Array(_0x58cfe7[_0x90ac('0x12')]),0x91),'heights':function(_0x142b15){return _0x142b15===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5bdd0b=getHeaders(_0x58cfe7);_0x238dc5[_0x90ac('0x13')]['push'](_0x5bdd0b);var _0x354004=getRows(_0x58cfe7,_0x2bcca8);_0x238dc5[_0x90ac('0x13')]=_0x238dc5['body'][_0x90ac('0x14')](_0x354004);return _0x238dc5;}function createTables(_0xe9fda8){var _0x11aec6=[];var _0x43b6af=_[_0x90ac('0x15')](Object['keys'](_0xe9fda8[0x0]),0x5);_0x43b6af[_0x90ac('0x16')](function(_0x311420){_0x11aec6[_0x90ac('0x17')](createTable(_0x311420,_0xe9fda8));});return _0x11aec6;}function getPDFDocDefinition(_0x19580d){var _0x5a4a0d=util['format'](_0x90ac('0x18'),NAME,EXTRACTED_REPORT[_0x90ac('0x19')],moment(EXTRACTED_REPORT['startDate'])[_0x90ac('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x90ac('0x1b')])['format'](FORMAT));var _0x19e46f=[];for(var _0x3cbe5f=0x0;_0x3cbe5f<_0x19580d[_0x90ac('0x12')];_0x3cbe5f++){var _0x4fe318=[];if(_0x3cbe5f===0x0){_0x4fe318[_0x90ac('0x17')]({'text':_0x5a4a0d,'style':_0x90ac('0x1c')});}var _0x40b5d3={'table':_0x19580d[_0x3cbe5f]};if(_0x3cbe5f>0x0){_0x40b5d3[_0x90ac('0x1d')]=_0x90ac('0x1e');_0x40b5d3[_0x90ac('0x1f')]=[0x0,0x46,0x0,0x0];}_0x4fe318[_0x90ac('0x17')](_0x40b5d3);_0x19e46f['push'](_0x4fe318);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x19e46f,'footer':function(_0x385536,_0x18fdbe){return{'text':_0x385536['toString']()+'\x20/\x20'+_0x18fdbe,'style':_0x90ac('0x20')};},'defaultStyle':{'font':_0x90ac('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x90ac('0x22')},'footer':{'alignment':_0x90ac('0x23'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x7c5d2a){var _0x4c750e=0x1388;var _0x435460;if(!_0x7c5d2a[0x0][_0x90ac('0x24')]){return analyticExtractedReport(_0x90ac('0x25'));}return db[_0x90ac('0x26')][_0x90ac('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x90ac('0x28'),_0x90ac('0x29')]})['then'](function(_0x3dfdf3){if(_0x3dfdf3){_0x435460=_0x3dfdf3;_0x4c750e=_0x435460[_0x90ac('0x29')]||0x3e8;}})['then'](function(){var _0x5bee46=[];var _0x1ab8a7=0x0;if(_0x435460['split']){if(_0x7c5d2a&&_0x7c5d2a[_0x90ac('0x12')]){var _0x439b4d=_[_0x90ac('0x2a')](_0x7c5d2a[0x0][_0x90ac('0x24')]/_0x4c750e);var _0x5089ed=Number[_0x90ac('0x2b')](_0x7c5d2a[0x0][_0x90ac('0x24')]/_0x4c750e)?_0x7c5d2a[0x0][_0x90ac('0x24')]%_0x4c750e:0x0;_0x439b4d['forEach'](function(_0x3571fd){if(_0x3571fd>0x0){_0x1ab8a7+=_0x4c750e;}_0x5bee46[_0x90ac('0x17')](dbH['sequelize']['query'](util[_0x90ac('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4c750e,_0x1ab8a7),{'type':dbH[_0x90ac('0x2c')]['QueryTypes'][_0x90ac('0x2d')]}));});if(_0x5089ed>0x0){_0x1ab8a7+=_0x4c750e;_0x5bee46[_0x90ac('0x17')](dbH[_0x90ac('0x2c')]['query'](util[_0x90ac('0x1a')](_0x90ac('0x2e'),QUERY,_0x5089ed,_0x1ab8a7),{'type':dbH[_0x90ac('0x2c')][_0x90ac('0x2f')][_0x90ac('0x2d')]}));}}}else{_0x5bee46[_0x90ac('0x17')](dbH['sequelize'][_0x90ac('0x30')](QUERY,{'type':dbH[_0x90ac('0x2c')][_0x90ac('0x2f')][_0x90ac('0x2d')]}));}var _0x515cf9=path[_0x90ac('0x31')](PATH);var _0x14a2d5=path[_0x90ac('0x32')](PATH,_0x90ac('0x33'));var _0x249c1c=_0x435460[_0x90ac('0x28')]&&_0x5bee46['length']>0x1;var _0x41e30e=[];if(!fs['existsSync'](path[_0x90ac('0x34')](_0x515cf9,_0x14a2d5))&&_0x249c1c){fs[_0x90ac('0x35')](path['join'](_0x515cf9,_0x14a2d5));}return BPromise[_0x90ac('0x36')](_0x5bee46,function(_0x3aa181){_0x41e30e[_0x90ac('0x17')](_0x3aa181);})[_0x90ac('0x37')](function(){var _0x5c4691=[];for(var _0x9619eb=0x0;_0x9619eb<_0x41e30e[_0x90ac('0x12')];_0x9619eb+=0x1){var _0x29e918=_0x41e30e[_0x9619eb];var _0x3bbc47=createTables(_['flatten'](_0x29e918));var _0x4a1f89;var _0x37c342=getPDFDocDefinition(_0x3bbc47);var _0x200a6c=getPDFPrinter();var _0x2850ac=_0x200a6c['createPdfKitDocument'](_0x37c342);if(_0x249c1c){_0x4a1f89=path[_0x90ac('0x34')](_0x515cf9,_0x14a2d5,util[_0x90ac('0x1a')](_0x90ac('0x38'),_0x14a2d5,_0x9619eb,_0x90ac('0x39')));}else{_0x4a1f89=path['join'](_0x515cf9,util[_0x90ac('0x1a')]('%s.%s',_0x14a2d5,'pdf'));}_0x5c4691[_0x90ac('0x17')](writePDFDocument(_0x2850ac,_0x4a1f89));}return Promise[_0x90ac('0x3a')](_0x5c4691);})[_0x90ac('0x37')](function(){if(_0x249c1c){return new Promise(function(_0x1d6379){zipdir(path[_0x90ac('0x34')](_0x515cf9,_0x14a2d5),{'saveTo':path[_0x90ac('0x34')](_0x515cf9,util[_0x90ac('0x1a')](_0x90ac('0x3b'),_0x14a2d5,_0x90ac('0x3c')))},function(){rimraf(path[_0x90ac('0x34')](_0x515cf9,_0x14a2d5),function(){});_0x1d6379(_0x90ac('0x3d'));});});}})[_0x90ac('0x37')](function(){if(!_0x249c1c)return;rimraf(path[_0x90ac('0x34')](_0x515cf9,_0x14a2d5),function(){});})['then'](function(){logger[_0x90ac('0x3e')](util[_0x90ac('0x1a')](_0x90ac('0x3f'),EXTRACTED_REPORT_ID,_0x90ac('0x40')));return analyticExtractedReport(_0x90ac('0x41'),_0x249c1c?util[_0x90ac('0x1a')](_0x90ac('0x3b'),_0x14a2d5,_0x249c1c?_0x90ac('0x3c'):_0x90ac('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x90ac('0x3e')](util['format'](_0x90ac('0x42'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x90ac('0x43')][_0x90ac('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x90ac('0x37')](function(_0x333888){EXTRACTED_REPORT=_0x333888;return dbH[_0x90ac('0x2c')][_0x90ac('0x30')](util[_0x90ac('0x1a')](_0x90ac('0x45'),QUERY),{'type':dbH[_0x90ac('0x2c')][_0x90ac('0x2f')][_0x90ac('0x2d')]});})[_0x90ac('0x37')](extractReport)['catch'](function(_0x282252){logger[_0x90ac('0x3e')](util[_0x90ac('0x1a')](_0x90ac('0x46'),EXTRACTED_REPORT_ID,_0x90ac('0x40')),util[_0x90ac('0x47')](_0x282252,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x90ac('0x48'));})['finally'](function(){process[_0x90ac('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x27e942=new PdfPrinter({'Arial':{'normal':__dirname+_0x90ac('0x4a'),'bold':__dirname+_0x90ac('0x4b'),'italics':__dirname+_0x90ac('0x4c'),'bolditalics':__dirname+_0x90ac('0x4d')}});return _0x27e942;}function getPDFDocDefinitionFromHTML(_0x387ccd,_0x1083b7){var _0x313ca1=util[_0x90ac('0x1a')](_0x90ac('0x4e'),_0x1083b7['channel'],_0x1083b7[_0x90ac('0x4f')]);var _0x1a29e8=moment()[_0x90ac('0x1a')](_0x90ac('0x50'))[_0x90ac('0x10')]();var _0x1c1a88=htmlToPdfmake(_0x387ccd,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1c1a88],'defaultStyle':{'font':_0x90ac('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x90ac('0x51'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x90ac('0x51'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x90ac('0x51')}},'header':function(){return[{'text':_0x90ac('0x52'),'style':_0x90ac('0x1c')}];},'footer':function(_0x8eb1f5,_0x35b74c){return[{'text':util[_0x90ac('0x1a')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x313ca1,_0x8eb1f5,_0x35b74c,_0x1a29e8),'style':'footer'}];}};}function writePDFDocument(_0x1de529,_0x51c191){return new Promise(function(_0x64aae3,_0xe70d96){var _0x533be3=_0x1de529[_0x90ac('0x53')](fs[_0x90ac('0x54')](_0x51c191));_0x533be3['on'](_0x90ac('0x55'),function(){_0x64aae3(_0x90ac('0x55'));});_0x533be3['on'](_0x90ac('0x56'),function(_0x108a73){_0xe70d96(_0x108a73);});_0x1de529[_0x90ac('0x57')]();});}exports['createPdfFromHTML']=function(_0x51f157,_0x4520af){var _0xfd06d=getPDFPrinter();var _0x5db7da=getPDFDocDefinitionFromHTML(_0x51f157,_0x4520af);var _0x1113cf=_0xfd06d['createPdfKitDocument'](_0x5db7da);return writePDFDocument(_0x1113cf,_0x4520af[_0x90ac('0x2')])[_0x90ac('0x58')](function(_0x150a51){throw _0x150a51;});}; \ No newline at end of file +var _0xfe52=['MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','update','map','pick','toString','value','fill','length','body','concat','chunk','keys','forEach','push','format','name','startDate','endDate','header','pageBreak','before','margin','landscape','footer','Arial','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','mkdirSync','join','each','flatten','createPdfKitDocument','pdf','%s.%s','all','zip','zip\x20finished','info','PDF','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','pipe','createWriteStream','finish','error','createPdfFromHTML','lodash','path','moment','pdfmake/src/printer','zip-dir','JSDOM','window','../../mysqldb','../../config/logger','analytics','argv'];(function(_0xeb73fb,_0x227320){var _0x103c60=function(_0x1dc137){while(--_0x1dc137){_0xeb73fb['push'](_0xeb73fb['shift']());}};_0x103c60(++_0x227320);}(_0xfe52,0xf4));var _0x2fe5=function(_0x18d2c7,_0x4dd25d){_0x18d2c7=_0x18d2c7-0x0;var _0x33622c=_0xfe52[_0x18d2c7];return _0x33622c;};'use strict';var _=require(_0x2fe5('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x2fe5('0x1'));var moment=require(_0x2fe5('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x2fe5('0x3'));var zipdir=require(_0x2fe5('0x4'));var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0x2fe5('0x5')];var window=new JSDOM('')[_0x2fe5('0x6')];var BPromise=require('bluebird');var db=require(_0x2fe5('0x7'))['db'];var dbH=require(_0x2fe5('0x7'))['dbH'];var logger=require(_0x2fe5('0x8'))(_0x2fe5('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x2fe5('0xa')][0x3];var PATH=process[_0x2fe5('0xa')][0x4];var NAME=process[_0x2fe5('0xa')][0x5];var FORMAT=_0x2fe5('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x17617a,_0xf0243a){var _0x580b79={'status':_0x17617a};var _0x37131e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xf0243a){_0x580b79['savename']=_0xf0243a;}return db['AnalyticExtractedReport'][_0x2fe5('0xc')](_0x580b79,_0x37131e);}function getHeaders(_0x5bd0f3){return _[_0x2fe5('0xd')](_0x5bd0f3,function(_0x484cb5){return{'text':_0x484cb5,'style':'tableHeader'};});}function getRows(_0x42b682,_0x24ff4a){return _[_0x2fe5('0xd')](_0x24ff4a,function(_0x339655){return _(_0x339655)[_0x2fe5('0xe')](_0x42b682)[_0x2fe5('0xd')](function(_0x482a5c){return _0x482a5c?_[_0x2fe5('0xf')](_0x482a5c):'';})[_0x2fe5('0x10')]();});}function createTable(_0x4bbd23,_0x5e35f1){var _0x4478a3={'widths':_[_0x2fe5('0x11')](Array(_0x4bbd23[_0x2fe5('0x12')]),0x91),'heights':function(_0x1b247f){return _0x1b247f===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4b0c90=getHeaders(_0x4bbd23);_0x4478a3[_0x2fe5('0x13')]['push'](_0x4b0c90);var _0x3051a5=getRows(_0x4bbd23,_0x5e35f1);_0x4478a3[_0x2fe5('0x13')]=_0x4478a3[_0x2fe5('0x13')][_0x2fe5('0x14')](_0x3051a5);return _0x4478a3;}function createTables(_0x4b48ff){var _0x11d2e0=[];var _0x370ee4=_[_0x2fe5('0x15')](Object[_0x2fe5('0x16')](_0x4b48ff[0x0]),0x5);_0x370ee4[_0x2fe5('0x17')](function(_0x15494c){_0x11d2e0[_0x2fe5('0x18')](createTable(_0x15494c,_0x4b48ff));});return _0x11d2e0;}function getPDFDocDefinition(_0x505520){var _0x37907d=util[_0x2fe5('0x19')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x2fe5('0x1a')],moment(EXTRACTED_REPORT[_0x2fe5('0x1b')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x2fe5('0x1c')])[_0x2fe5('0x19')](FORMAT));var _0x49a722=[];for(var _0x3faf0d=0x0;_0x3faf0d<_0x505520[_0x2fe5('0x12')];_0x3faf0d++){var _0x5b7b3=[];if(_0x3faf0d===0x0){_0x5b7b3[_0x2fe5('0x18')]({'text':_0x37907d,'style':_0x2fe5('0x1d')});}var _0x256298={'table':_0x505520[_0x3faf0d]};if(_0x3faf0d>0x0){_0x256298[_0x2fe5('0x1e')]=_0x2fe5('0x1f');_0x256298[_0x2fe5('0x20')]=[0x0,0x46,0x0,0x0];}_0x5b7b3[_0x2fe5('0x18')](_0x256298);_0x49a722[_0x2fe5('0x18')](_0x5b7b3);}return{'pageSize':'A4','pageOrientation':_0x2fe5('0x21'),'content':_0x49a722,'footer':function(_0x49ac07,_0x253938){return{'text':_0x49ac07[_0x2fe5('0xf')]()+'\x20/\x20'+_0x253938,'style':_0x2fe5('0x22')};},'defaultStyle':{'font':_0x2fe5('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x2fe5('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x13c360){var _0x414c11=0x1388;var _0x45d626;if(!_0x13c360[0x0][_0x2fe5('0x25')]){return analyticExtractedReport(_0x2fe5('0x26'));}return db[_0x2fe5('0x27')][_0x2fe5('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2fe5('0x29'),_0x2fe5('0x2a')]})[_0x2fe5('0x2b')](function(_0x576961){if(_0x576961){_0x45d626=_0x576961;_0x414c11=_0x45d626[_0x2fe5('0x2a')]||0x3e8;}})[_0x2fe5('0x2b')](function(){var _0x325e25=[];var _0x1073f3=0x0;if(_0x45d626[_0x2fe5('0x29')]){if(_0x13c360&&_0x13c360[_0x2fe5('0x12')]){var _0x417a62=_[_0x2fe5('0x2c')](_0x13c360[0x0]['num']/_0x414c11);var _0x866627=Number[_0x2fe5('0x2d')](_0x13c360[0x0]['num']/_0x414c11)?_0x13c360[0x0]['num']%_0x414c11:0x0;_0x417a62['forEach'](function(_0x103f08){if(_0x103f08>0x0){_0x1073f3+=_0x414c11;}_0x325e25[_0x2fe5('0x18')](dbH[_0x2fe5('0x2e')][_0x2fe5('0x2f')](util[_0x2fe5('0x19')](_0x2fe5('0x30'),QUERY,_0x414c11,_0x1073f3),{'type':dbH['sequelize'][_0x2fe5('0x31')][_0x2fe5('0x32')]}));});if(_0x866627>0x0){_0x1073f3+=_0x414c11;_0x325e25[_0x2fe5('0x18')](dbH['sequelize'][_0x2fe5('0x2f')](util[_0x2fe5('0x19')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x866627,_0x1073f3),{'type':dbH['sequelize'][_0x2fe5('0x31')][_0x2fe5('0x32')]}));}}}else{_0x325e25[_0x2fe5('0x18')](dbH[_0x2fe5('0x2e')][_0x2fe5('0x2f')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x2fe5('0x32')]}));}var _0x21200b=path[_0x2fe5('0x33')](PATH);var _0x246eba=path[_0x2fe5('0x34')](PATH,_0x2fe5('0x35'));var _0x4a0eb0=_0x45d626['split']&&_0x325e25[_0x2fe5('0x12')]>0x1;var _0x2423fd=[];if(!fs['existsSync'](path['join'](_0x21200b,_0x246eba))&&_0x4a0eb0){fs[_0x2fe5('0x36')](path[_0x2fe5('0x37')](_0x21200b,_0x246eba));}return BPromise[_0x2fe5('0x38')](_0x325e25,function(_0x16b478){_0x2423fd['push'](_0x16b478);})[_0x2fe5('0x2b')](function(){var _0x26f900=[];for(var _0x441761=0x0;_0x441761<_0x2423fd[_0x2fe5('0x12')];_0x441761+=0x1){var _0x35d1a4=_0x2423fd[_0x441761];var _0x5c248b=createTables(_[_0x2fe5('0x39')](_0x35d1a4));var _0x59fcfa;var _0x59a9b1=getPDFDocDefinition(_0x5c248b);var _0x5b48d9=getPDFPrinter();var _0x4a4542=_0x5b48d9[_0x2fe5('0x3a')](_0x59a9b1);if(_0x4a0eb0){_0x59fcfa=path['join'](_0x21200b,_0x246eba,util[_0x2fe5('0x19')]('%s%d.%s',_0x246eba,_0x441761,_0x2fe5('0x3b')));}else{_0x59fcfa=path['join'](_0x21200b,util['format'](_0x2fe5('0x3c'),_0x246eba,'pdf'));}_0x26f900[_0x2fe5('0x18')](writePDFDocument(_0x4a4542,_0x59fcfa));}return Promise[_0x2fe5('0x3d')](_0x26f900);})[_0x2fe5('0x2b')](function(){if(_0x4a0eb0){return new Promise(function(_0x52a84c){zipdir(path[_0x2fe5('0x37')](_0x21200b,_0x246eba),{'saveTo':path['join'](_0x21200b,util[_0x2fe5('0x19')](_0x2fe5('0x3c'),_0x246eba,_0x2fe5('0x3e')))},function(){rimraf(path['join'](_0x21200b,_0x246eba),function(){});_0x52a84c(_0x2fe5('0x3f'));});});}})['then'](function(){if(!_0x4a0eb0)return;rimraf(path[_0x2fe5('0x37')](_0x21200b,_0x246eba),function(){});})['then'](function(){logger[_0x2fe5('0x40')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x2fe5('0x41')));return analyticExtractedReport('Completed',_0x4a0eb0?util[_0x2fe5('0x19')](_0x2fe5('0x3c'),_0x246eba,_0x4a0eb0?_0x2fe5('0x3e'):_0x2fe5('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x2fe5('0x19')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2fe5('0x41')));return db[_0x2fe5('0x42')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1a703d){EXTRACTED_REPORT=_0x1a703d;return dbH[_0x2fe5('0x2e')][_0x2fe5('0x2f')](util[_0x2fe5('0x19')](_0x2fe5('0x43'),QUERY),{'type':dbH[_0x2fe5('0x2e')][_0x2fe5('0x31')]['SELECT']});})[_0x2fe5('0x2b')](extractReport)[_0x2fe5('0x44')](function(_0x1c32cb){logger[_0x2fe5('0x40')](util['format'](_0x2fe5('0x45'),EXTRACTED_REPORT_ID,_0x2fe5('0x41')),util['inspect'](_0x1c32cb,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x2fe5('0x46')](function(){process[_0x2fe5('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x8fbd86=new PdfPrinter({'Arial':{'normal':__dirname+_0x2fe5('0x48'),'bold':__dirname+_0x2fe5('0x49'),'italics':__dirname+_0x2fe5('0x4a'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x8fbd86;}function getPDFDocDefinitionFromHTML(_0x4c1cc2,_0x24191e){var _0x2974cb=util[_0x2fe5('0x19')](_0x2fe5('0x4b'),_0x24191e[_0x2fe5('0x4c')],_0x24191e[_0x2fe5('0x4d')]);var _0x32be92=moment()[_0x2fe5('0x19')](_0x2fe5('0x4e'))['toString']();var _0x55a4be=htmlToPdfmake(_0x4c1cc2,{'window':window,'tableAutoSize':!![]});return{'content':[_0x55a4be],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x2fe5('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x2fe5('0x4f')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x2fe5('0x1d')}];},'footer':function(_0x1600c9,_0xff0a10){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x2974cb,_0x1600c9,_0xff0a10,_0x32be92),'style':_0x2fe5('0x22')}];}};}function writePDFDocument(_0x33057d,_0x3413d3){return new Promise(function(_0xc39c75,_0x17e085){var _0x26cc32=_0x33057d[_0x2fe5('0x50')](fs[_0x2fe5('0x51')](_0x3413d3));_0x26cc32['on'](_0x2fe5('0x52'),function(){_0xc39c75(_0x2fe5('0x52'));});_0x26cc32['on'](_0x2fe5('0x53'),function(_0x51da5b){_0x17e085(_0x51da5b);});_0x33057d['end']();});}exports[_0x2fe5('0x54')]=function(_0x2afea9,_0x4fa220){var _0x53531d=getPDFPrinter();var _0x26372d=getPDFDocDefinitionFromHTML(_0x2afea9,_0x4fa220);var _0x321b81=_0x53531d[_0x2fe5('0x3a')](_0x26372d);return writePDFDocument(_0x321b81,_0x4fa220['path'])[_0x2fe5('0x44')](function(_0xa58f0d){throw _0xa58f0d;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index cb42a26..fec7730 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 _0x85e5=['Completed','xlsx','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','json2xls','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','info','format','Setting','find','split','splitSizeXlsx','sequelize','query','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','then','%s%d.%s','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX'];(function(_0x2d08b1,_0xfe9659){var _0x190183=function(_0xaef69d){while(--_0xaef69d){_0x2d08b1['push'](_0x2d08b1['shift']());}};_0x190183(++_0xfe9659);}(_0x85e5,0xc7));var _0x585e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x85e5[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x585e('0x0'));var path=require(_0x585e('0x1'));var _=require(_0x585e('0x2'));var fs=require('fs');var json2xls=require(_0x585e('0x3'));var BPromise=require(_0x585e('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x585e('0x5'))['db'];var dbH=require(_0x585e('0x5'))[_0x585e('0x6')];var logger=require(_0x585e('0x7'))(_0x585e('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x585e('0x9')][0x3];var PATH=process[_0x585e('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x121c1d,_0x4c605d){var _0x338f81={'status':_0x121c1d};var _0x18dcdf={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4c605d){_0x338f81[_0x585e('0xa')]=_0x4c605d;}return db['AnalyticExtractedReport']['update'](_0x338f81,_0x18dcdf);}function main(){var _0x49ad38=0x1388;var _0x3c5ff6;logger[_0x585e('0xb')](util[_0x585e('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0x585e('0xd')][_0x585e('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x585e('0xf'),_0x585e('0x10')]})['then'](function(_0x5caf8c){if(_0x5caf8c){_0x3c5ff6=_0x5caf8c;_0x49ad38=_0x3c5ff6[_0x585e('0x10')]||0x1388;}})['then'](function(){return dbH[_0x585e('0x11')][_0x585e('0x12')](util[_0x585e('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x585e('0x11')][_0x585e('0x13')][_0x585e('0x14')]});})['then'](function(_0x102cc3){if(!_0x102cc3[0x0][_0x585e('0x15')]){return analyticExtractedReport(_0x585e('0x16'));}var _0x3093a4=[];var _0x53ca15=0x0;if(_0x3c5ff6[_0x585e('0xf')]){if(_0x102cc3&&_0x102cc3[_0x585e('0x17')]){var _0x14236f=_[_0x585e('0x18')](_0x102cc3[0x0][_0x585e('0x15')]/_0x49ad38);var _0x41d4e8=Number[_0x585e('0x19')](_0x102cc3[0x0][_0x585e('0x15')]/_0x49ad38)?_0x102cc3[0x0]['num']%_0x49ad38:0x0;_0x14236f[_0x585e('0x1a')](function(_0x195162){if(_0x195162>0x0){_0x53ca15+=_0x49ad38;}_0x3093a4[_0x585e('0x1b')](dbH[_0x585e('0x11')][_0x585e('0x12')](util[_0x585e('0xc')](_0x585e('0x1c'),QUERY,_0x49ad38,_0x53ca15),{'type':dbH['sequelize'][_0x585e('0x13')][_0x585e('0x14')]}));});if(_0x41d4e8>0x0){_0x53ca15+=_0x49ad38;_0x3093a4[_0x585e('0x1b')](dbH[_0x585e('0x11')]['query'](util[_0x585e('0xc')](_0x585e('0x1c'),QUERY,_0x41d4e8,_0x53ca15),{'type':dbH[_0x585e('0x11')]['QueryTypes'][_0x585e('0x14')]}));}}}else{_0x3093a4[_0x585e('0x1b')](dbH[_0x585e('0x11')][_0x585e('0x12')](QUERY,{'type':dbH[_0x585e('0x11')][_0x585e('0x13')][_0x585e('0x14')]}));}var _0x2e942a=path[_0x585e('0x1d')](PATH);var _0xada229=path[_0x585e('0x1e')](PATH,_0x585e('0x1f'));var _0x2913ec=_0x3c5ff6[_0x585e('0xf')]&&_0x3093a4[_0x585e('0x17')]>0x1;var _0x7aa54=[];if(!fs[_0x585e('0x20')](path[_0x585e('0x21')](_0x2e942a,_0xada229))&&_0x2913ec){fs['mkdirSync'](path[_0x585e('0x21')](_0x2e942a,_0xada229));}return BPromise['each'](_0x3093a4,function(_0x16391b){_0x7aa54[_0x585e('0x1b')](_0x16391b);})[_0x585e('0x22')](function(){for(var _0x4369ad=0x0;_0x4369ad<_0x7aa54[_0x585e('0x17')];_0x4369ad+=0x1){var _0x291919;var _0x522320=_0x7aa54[_0x4369ad];if(_0x2913ec){_0x291919=path[_0x585e('0x21')](_0x2e942a,_0xada229,util[_0x585e('0xc')](_0x585e('0x23'),_0xada229,_0x4369ad,'xlsx'));}else{_0x291919=path[_0x585e('0x21')](_0x2e942a,util[_0x585e('0xc')](_0x585e('0x24'),_0xada229,'xlsx'));}fs['writeFileSync'](_0x291919,json2xls(_0x522320),'binary');}})[_0x585e('0x22')](function(){if(_0x2913ec){return new Promise(function(_0x8ab82d){zipdir(path[_0x585e('0x21')](_0x2e942a,_0xada229),{'saveTo':path[_0x585e('0x21')](_0x2e942a,util[_0x585e('0xc')](_0x585e('0x24'),_0xada229,_0x585e('0x25')))},function(_0x27d9b2,_0x1081a3){rimraf(path['join'](_0x2e942a,_0xada229),function(){});_0x8ab82d(_0x585e('0x26'));});});}})[_0x585e('0x22')](function(){logger[_0x585e('0xb')](util[_0x585e('0xc')](_0x585e('0x27'),EXTRACTED_REPORT_ID,_0x585e('0x28')));return analyticExtractedReport(_0x585e('0x29'),_0x2913ec?util['format'](_0x585e('0x24'),_0xada229,_0x2913ec?_0x585e('0x25'):_0x585e('0x2a')):null);});})[_0x585e('0x2b')](function(_0x3e43a4){logger['info'](util[_0x585e('0xc')](_0x585e('0x2c'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x585e('0x2d')](_0x3e43a4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x585e('0x2e'));})[_0x585e('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xa801=['then','sequelize','QueryTypes','num','Empty','split','range','isInteger','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','basename','length','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','path','json2xls','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','splitSizeXlsx'];(function(_0x1a4dad,_0x47fa8c){var _0x42ca9e=function(_0x39304f){while(--_0x39304f){_0x1a4dad['push'](_0x1a4dad['shift']());}};_0x42ca9e(++_0x47fa8c);}(_0xa801,0x138));var _0x1a80=function(_0x4d3a15,_0x386cd7){_0x4d3a15=_0x4d3a15-0x0;var _0x5c6c31=_0xa801[_0x4d3a15];return _0x5c6c31;};'use strict';var util=require('util');var path=require(_0x1a80('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x1a80('0x1'));var BPromise=require(_0x1a80('0x2'));var zipdir=require(_0x1a80('0x3'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x1a80('0x4'))[_0x1a80('0x5')];var logger=require(_0x1a80('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x1a80('0x7')][0x2]);var QUERY=process[_0x1a80('0x7')][0x3];var PATH=process[_0x1a80('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5485ce,_0x244ca3){var _0x9890c7={'status':_0x5485ce};var _0x13cbd9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x244ca3){_0x9890c7[_0x1a80('0x8')]=_0x244ca3;}return db[_0x1a80('0x9')][_0x1a80('0xa')](_0x9890c7,_0x13cbd9);}function main(){var _0x5889a6=0x1388;var _0x3528df;logger[_0x1a80('0xb')](util[_0x1a80('0xc')](_0x1a80('0xd'),EXTRACTED_REPORT_ID,_0x1a80('0xe')));return db['Setting'][_0x1a80('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x1a80('0x10')]})[_0x1a80('0x11')](function(_0x16a5cd){if(_0x16a5cd){_0x3528df=_0x16a5cd;_0x5889a6=_0x3528df[_0x1a80('0x10')]||0x1388;}})[_0x1a80('0x11')](function(){return dbH[_0x1a80('0x12')]['query'](util[_0x1a80('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x1a80('0x13')]['SELECT']});})[_0x1a80('0x11')](function(_0x4a217b){if(!_0x4a217b[0x0][_0x1a80('0x14')]){return analyticExtractedReport(_0x1a80('0x15'));}var _0x44f707=[];var _0x2ee5f9=0x0;if(_0x3528df[_0x1a80('0x16')]){if(_0x4a217b&&_0x4a217b['length']){var _0x51a477=_[_0x1a80('0x17')](_0x4a217b[0x0][_0x1a80('0x14')]/_0x5889a6);var _0x2f984a=Number[_0x1a80('0x18')](_0x4a217b[0x0][_0x1a80('0x14')]/_0x5889a6)?_0x4a217b[0x0][_0x1a80('0x14')]%_0x5889a6:0x0;_0x51a477['forEach'](function(_0xd2a35a){if(_0xd2a35a>0x0){_0x2ee5f9+=_0x5889a6;}_0x44f707[_0x1a80('0x19')](dbH['sequelize'][_0x1a80('0x1a')](util[_0x1a80('0xc')](_0x1a80('0x1b'),QUERY,_0x5889a6,_0x2ee5f9),{'type':dbH[_0x1a80('0x12')][_0x1a80('0x13')]['SELECT']}));});if(_0x2f984a>0x0){_0x2ee5f9+=_0x5889a6;_0x44f707['push'](dbH[_0x1a80('0x12')]['query'](util[_0x1a80('0xc')](_0x1a80('0x1b'),QUERY,_0x2f984a,_0x2ee5f9),{'type':dbH[_0x1a80('0x12')][_0x1a80('0x13')][_0x1a80('0x1c')]}));}}}else{_0x44f707[_0x1a80('0x19')](dbH[_0x1a80('0x12')]['query'](QUERY,{'type':dbH[_0x1a80('0x12')][_0x1a80('0x13')][_0x1a80('0x1c')]}));}var _0x3b8f57=path['dirname'](PATH);var _0xc79b8c=path[_0x1a80('0x1d')](PATH,'.xlsx');var _0x4e7163=_0x3528df[_0x1a80('0x16')]&&_0x44f707[_0x1a80('0x1e')]>0x1;var _0xa79e6b=[];if(!fs[_0x1a80('0x1f')](path[_0x1a80('0x20')](_0x3b8f57,_0xc79b8c))&&_0x4e7163){fs[_0x1a80('0x21')](path['join'](_0x3b8f57,_0xc79b8c));}return BPromise[_0x1a80('0x22')](_0x44f707,function(_0x218caa){_0xa79e6b['push'](_0x218caa);})[_0x1a80('0x11')](function(){for(var _0x40a7b8=0x0;_0x40a7b8<_0xa79e6b[_0x1a80('0x1e')];_0x40a7b8+=0x1){var _0x5ee05b;var _0x3ad372=_0xa79e6b[_0x40a7b8];if(_0x4e7163){_0x5ee05b=path[_0x1a80('0x20')](_0x3b8f57,_0xc79b8c,util['format'](_0x1a80('0x23'),_0xc79b8c,_0x40a7b8,_0x1a80('0x24')));}else{_0x5ee05b=path[_0x1a80('0x20')](_0x3b8f57,util[_0x1a80('0xc')](_0x1a80('0x25'),_0xc79b8c,'xlsx'));}fs[_0x1a80('0x26')](_0x5ee05b,json2xls(_0x3ad372),'binary');}})[_0x1a80('0x11')](function(){if(_0x4e7163){return new Promise(function(_0x3605bb){zipdir(path['join'](_0x3b8f57,_0xc79b8c),{'saveTo':path[_0x1a80('0x20')](_0x3b8f57,util[_0x1a80('0xc')](_0x1a80('0x25'),_0xc79b8c,_0x1a80('0x27')))},function(_0x54d6af,_0x2e2951){rimraf(path[_0x1a80('0x20')](_0x3b8f57,_0xc79b8c),function(){});_0x3605bb('zip\x20finished');});});}})[_0x1a80('0x11')](function(){logger['info'](util['format'](_0x1a80('0x28'),EXTRACTED_REPORT_ID,_0x1a80('0xe')));return analyticExtractedReport('Completed',_0x4e7163?util[_0x1a80('0xc')](_0x1a80('0x25'),_0xc79b8c,_0x4e7163?_0x1a80('0x27'):'xlsx'):null);});})[_0x1a80('0x29')](function(_0x373d74){logger['info'](util[_0x1a80('0xc')](_0x1a80('0x2a'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x1a80('0x2b')](_0x373d74,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1a80('0x2c'));})[_0x1a80('0x2d')](function(){process[_0x1a80('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 6f48835..2d5c2f0 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 _0x2b08=['context','VoiceExtensionId','inbound','push','outbound','CDR(destination)=','cutdigits','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','catch','lodash','util','models','Interval','findAll','intervals','VoiceExtension','IntervalId','then','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','priority','extensions','extension','type','Set','format','CDR(type)=%s'];(function(_0x658e8b,_0x24aac6){var _0x56fcfe=function(_0x1a71aa){while(--_0x1a71aa){_0x658e8b['push'](_0x658e8b['shift']());}};_0x56fcfe(++_0x24aac6);}(_0x2b08,0x74));var _0x82b0=function(_0x426db6,_0x1657f0){_0x426db6=_0x426db6-0x0;var _0x3c9db9=_0x2b08[_0x426db6];return _0x3c9db9;};'use strict';var _=require(_0x82b0('0x0'));var util=require(_0x82b0('0x1'));function rewrite(_0x4aa597,_0x315867){var _0x2c31e3=this;return _0x4aa597[_0x82b0('0x2')][_0x82b0('0x3')][_0x82b0('0x4')]({'raw':!![]})['then'](function(_0x2dda92){_0x2c31e3[_0x82b0('0x5')]=_0x2dda92;return _0x4aa597[_0x82b0('0x2')][_0x82b0('0x6')]['findAll']({'where':{'IntervalId':_0x315867[_0x82b0('0x7')]},'raw':!![]});})[_0x82b0('0x8')](function(_0x3680e7){return _0x4aa597[_0x82b0('0x2')]['VoiceExtension'][_0x82b0('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0x82b0('0x9')](_0x3680e7,_0x82b0('0xa')))}},'order':[{'raw':_0x82b0('0xb')}],'raw':!![]});})[_0x82b0('0x8')](function(_0x622607){var _0x3409ff=_['filter'](_0x622607,{'priority':'1'});var _0x4e2c6f=_[_0x82b0('0xc')](_0x622607,{'isApp':0x1});var _0x591a4f=_[_0x82b0('0xd')](_0x4e2c6f,_0x82b0('0xa'));var _0x494d45=['queue',_0x82b0('0xe')];var _0x1d13e3=[];var _0x3c1244=[];for(var _0x4df82b in _0x591a4f){if(_0x591a4f['hasOwnProperty'](_0x4df82b)){_0x2c31e3[_0x82b0('0xf')]=0x2;_0x2c31e3[_0x82b0('0x10')]=[];_0x2c31e3[_0x82b0('0x11')]=_['find'](_0x3409ff,{'exten':_0x591a4f[_0x4df82b][0x0][_0x82b0('0xa')]});_0x2c31e3[_0x82b0('0x10')]['push']({'type':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x12')],'app':_0x82b0('0x13'),'appdata':util[_0x82b0('0x14')](_0x82b0('0x15'),_0x591a4f[_0x4df82b][0x0]['type']),'context':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x16')],'exten':_0x591a4f[_0x4df82b][0x0][_0x82b0('0xa')],'priority':_0x2c31e3['priority']++,'VoiceExtensionId':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x17')]});if(_0x591a4f[_0x4df82b][0x0][_0x82b0('0x12')]===_0x82b0('0x18')){_0x2c31e3[_0x82b0('0x10')][_0x82b0('0x19')]({'type':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x12')],'app':_0x82b0('0x13'),'appdata':'CDR(routeid)='+_0x591a4f[_0x4df82b][0x0][_0x82b0('0x17')],'context':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x16')],'exten':_0x591a4f[_0x4df82b][0x0][_0x82b0('0xa')],'priority':_0x2c31e3[_0x82b0('0xf')]++,'VoiceExtensionId':_0x591a4f[_0x4df82b][0x0]['VoiceExtensionId']});}else if(_0x591a4f[_0x4df82b][0x0][_0x82b0('0x12')]===_0x82b0('0x1a')){if(_0x2c31e3[_0x82b0('0x11')]){_0x2c31e3[_0x82b0('0x10')]['push']({'type':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x12')],'app':_0x82b0('0x13'),'appdata':_0x82b0('0x1b')+(_0x2c31e3[_0x82b0('0x11')][_0x82b0('0x1c')]?'${EXTEN:'+_0x2c31e3['extension'][_0x82b0('0x1c')]+'}':'${EXTEN}'),'context':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x16')],'exten':_0x591a4f[_0x4df82b][0x0][_0x82b0('0xa')],'priority':_0x2c31e3[_0x82b0('0xf')]++,'VoiceExtensionId':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x17')]});}_0x2c31e3['extensions'][_0x82b0('0x19')]({'type':_0x591a4f[_0x4df82b][0x0]['type'],'app':_0x82b0('0x13'),'appdata':_0x82b0('0x1d')+_0x591a4f[_0x4df82b][0x0][_0x82b0('0x17')],'context':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x16')],'exten':_0x591a4f[_0x4df82b][0x0][_0x82b0('0xa')],'priority':_0x2c31e3['priority']++,'VoiceExtensionId':_0x591a4f[_0x4df82b][0x0]['VoiceExtensionId']});var _0x2f36d1=_0x2c31e3[_0x82b0('0xf')]++;_0x2c31e3[_0x82b0('0x10')][_0x82b0('0x19')]({'type':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x12')],'app':'ExecIf','appdata':_0x82b0('0x1e')+(_0x2f36d1+0x2)+_0x82b0('0x1f')+(_0x2f36d1+0x1)+')','context':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x16')],'exten':_0x591a4f[_0x4df82b][0x0][_0x82b0('0xa')],'priority':_0x2f36d1,'VoiceExtensionId':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x17')]});if(_0x2c31e3[_0x82b0('0x11')]){_0x2c31e3[_0x82b0('0x10')][_0x82b0('0x19')]({'type':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x12')],'app':_0x82b0('0x13'),'appdata':_0x2c31e3['extension'][_0x82b0('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x2c31e3[_0x82b0('0x11')][_0x82b0('0x1c')]+'}':_0x82b0('0x20'),'context':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x16')],'exten':_0x591a4f[_0x4df82b][0x0][_0x82b0('0xa')],'priority':_0x2c31e3[_0x82b0('0xf')]++,'VoiceExtensionId':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x17')]});}_0x2c31e3['extensions']['push']({'type':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x12')],'app':'Set','appdata':'outboundrouteid='+_0x591a4f[_0x4df82b][0x0][_0x82b0('0x17')],'context':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x16')],'exten':_0x591a4f[_0x4df82b][0x0][_0x82b0('0xa')],'priority':_0x2c31e3[_0x82b0('0xf')]++,'VoiceExtensionId':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x17')]});if(_0x2c31e3[_0x82b0('0x11')]&&_0x2c31e3[_0x82b0('0x11')][_0x82b0('0x21')](_0x82b0('0x22'))&&_0x2c31e3[_0x82b0('0x11')][_0x82b0('0x22')]!==_0x82b0('0x23')){_0x2c31e3['extensions'][_0x82b0('0x19')]({'type':_0x591a4f[_0x4df82b][0x0]['type'],'app':'Set','appdata':_0x82b0('0x24'),'context':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x16')],'exten':_0x591a4f[_0x4df82b][0x0]['exten'],'priority':_0x2c31e3[_0x82b0('0xf')]++,'VoiceExtensionId':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x17')]});_0x2c31e3['extensions'][_0x82b0('0x19')]({'type':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x12')],'app':_0x82b0('0x13'),'appdata':_0x82b0('0x25')+_0x2c31e3[_0x82b0('0x11')][_0x82b0('0x22')]||_0x82b0('0x26'),'context':_0x591a4f[_0x4df82b][0x0]['context'],'exten':_0x591a4f[_0x4df82b][0x0][_0x82b0('0xa')],'priority':_0x2c31e3[_0x82b0('0xf')]++,'VoiceExtensionId':_0x591a4f[_0x4df82b][0x0]['VoiceExtensionId']});}}_0x2c31e3[_0x82b0('0x10')][_0x82b0('0x19')]({'type':_0x591a4f[_0x4df82b][0x0]['type'],'app':'Set','appdata':_0x82b0('0x27'),'context':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x16')],'exten':_0x591a4f[_0x4df82b][0x0][_0x82b0('0xa')],'priority':_0x2c31e3[_0x82b0('0xf')]++,'VoiceExtensionId':_0x591a4f[_0x4df82b][0x0]['VoiceExtensionId']});_0x2c31e3['extensions'][_0x82b0('0x19')]({'type':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x12')],'app':_0x82b0('0x13'),'appdata':_0x82b0('0x28'),'context':_0x591a4f[_0x4df82b][0x0]['context'],'exten':_0x591a4f[_0x4df82b][0x0]['exten'],'priority':_0x2c31e3[_0x82b0('0xf')]++,'VoiceExtensionId':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x17')]});_0x2c31e3[_0x82b0('0x10')]['push']({'type':_0x591a4f[_0x4df82b][0x0]['type'],'app':_0x82b0('0x13'),'appdata':'MONITOR_OPTIONS=ab','context':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x16')],'exten':_0x591a4f[_0x4df82b][0x0][_0x82b0('0xa')],'priority':_0x2c31e3[_0x82b0('0xf')]++,'VoiceExtensionId':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x17')]});for(var _0xad60f9=0x0,_0x323e2a=0x0;_0xad60f9<_0x591a4f[_0x4df82b][_0x82b0('0x29')];_0xad60f9+=0x1,_0x323e2a=0x0){var _0x426e82=_0x591a4f[_0x4df82b][_0xad60f9];if(_0x426e82[_0x82b0('0x12')]){_0x426e82['type']=_0x426e82[_0x82b0('0x12')]['toLowerCase']();}var _0x493334=[];var _0x320c37=[];delete _0x426e82['id'];delete _0x426e82['createdAt'];delete _0x426e82[_0x82b0('0x2a')];var _0x3b1333=_0x426e82[_0x82b0('0x2b')]!==_0x82b0('0x2c')?[_0x426e82['interval']]:_0x426e82[_0x82b0('0x7')]?_[_0x82b0('0x9')](_[_0x82b0('0xc')](_0x2c31e3['intervals'],{'IntervalId':_0x426e82[_0x82b0('0x7')]}),_0x82b0('0x2b')):[];if(_0x426e82[_0x82b0('0x21')](_0x82b0('0x2d'))){if(_0x426e82[_0x82b0('0x2d')]&&_0x426e82['tag']!=='--'){_0x493334[_0x82b0('0x19')]({'type':_0x426e82['type'],'app':_0x82b0('0x13'),'appdata':_0x82b0('0x2e')+_0x426e82['tag'],'context':_0x426e82['context'],'exten':_0x426e82['exten'],'priority':_0x3b1333[_0x82b0('0x29')]+_0x2c31e3[_0x82b0('0xf')]+_0x323e2a++,'VoiceExtensionId':_0x426e82['VoiceExtensionId']});}}if(_0x426e82[_0x82b0('0x12')]===_0x82b0('0x1a')&&_0x426e82[_0x82b0('0x21')](_0x82b0('0x2f'))){if(_0x426e82[_0x82b0('0x2f')]){_0x493334[_0x82b0('0x19')]({'type':_0x426e82[_0x82b0('0x12')],'app':_0x82b0('0x30'),'appdata':_0x82b0('0x31')+_0x426e82['callerID']+')','context':_0x426e82['context'],'exten':_0x426e82[_0x82b0('0xa')],'priority':_0x3b1333[_0x82b0('0x29')]+_0x2c31e3[_0x82b0('0xf')]+_0x323e2a++,'VoiceExtensionId':_0x426e82['VoiceExtensionId']});}else{_0x493334['push']({'type':_0x426e82[_0x82b0('0x12')],'app':_0x82b0('0x30'),'appdata':_0x82b0('0x32'),'context':_0x426e82[_0x82b0('0x16')],'exten':_0x426e82[_0x82b0('0xa')],'priority':_0x3b1333[_0x82b0('0x29')]+_0x2c31e3[_0x82b0('0xf')]+_0x323e2a++,'VoiceExtensionId':_0x426e82[_0x82b0('0x17')]});}}if(_0x426e82[_0x82b0('0x21')](_0x82b0('0x33'))){if(_0x494d45[_0x82b0('0x34')](_0x426e82[_0x82b0('0x35')][_0x82b0('0x36')]())>=0x0&&_0x426e82[_0x82b0('0x37')]!==_0x82b0('0x38')){if(_0x426e82['answer']){_0x493334[_0x82b0('0x19')]({'type':_0x426e82[_0x82b0('0x12')],'app':_0x82b0('0x30'),'appdata':_0x82b0('0x39'),'context':_0x426e82['context'],'exten':_0x426e82[_0x82b0('0xa')],'priority':_0x3b1333['length']+_0x2c31e3[_0x82b0('0xf')]+_0x323e2a++,'VoiceExtensionId':_0x426e82[_0x82b0('0x17')]});_0x493334[_0x82b0('0x19')]({'type':_0x426e82[_0x82b0('0x12')],'app':_0x82b0('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x426e82[_0x82b0('0x16')],'exten':_0x426e82[_0x82b0('0xa')],'priority':_0x3b1333[_0x82b0('0x29')]+_0x2c31e3[_0x82b0('0xf')]+_0x323e2a++,'VoiceExtensionId':_0x426e82[_0x82b0('0x17')]});}else{_0x493334['push']({'type':_0x426e82[_0x82b0('0x12')],'app':_0x82b0('0x30'),'appdata':_0x82b0('0x3a'),'context':_0x426e82['context'],'exten':_0x426e82['exten'],'priority':_0x3b1333[_0x82b0('0x29')]+_0x2c31e3['priority']+_0x323e2a++,'VoiceExtensionId':_0x426e82[_0x82b0('0x17')]});_0x493334['push']({'type':_0x426e82[_0x82b0('0x12')],'app':'Set','appdata':_0x82b0('0x3b'),'context':_0x426e82[_0x82b0('0x16')],'exten':_0x426e82[_0x82b0('0xa')],'priority':_0x3b1333[_0x82b0('0x29')]+_0x2c31e3[_0x82b0('0xf')]+_0x323e2a++,'VoiceExtensionId':_0x426e82[_0x82b0('0x17')]});}}}for(var _0x3f08ef=0x0;_0x3f08ef<_0x3b1333['length'];_0x3f08ef+=0x1){var _0x3f0c2f=_0x2c31e3['priority']+_0x3b1333[_0x82b0('0x29')];var _0x2bd4d7=_0x3f08ef===_0x3b1333[_0x82b0('0x29')]-0x1?_0x2c31e3['priority']+_0x493334[_0x82b0('0x29')]+_0x320c37[_0x82b0('0x29')]+0x2:_0x2c31e3[_0x82b0('0xf')]+_0x3f08ef+0x1;_0x493334[_0x82b0('0x3c')](_0x3f08ef,0x0,{'type':_0x426e82[_0x82b0('0x12')],'app':_0x82b0('0x3d'),'appdata':_0x3b1333[_0x3f08ef]+'?'+_0x426e82[_0x82b0('0x16')]+_0x82b0('0x3e')+_0x3f0c2f+':'+_0x426e82[_0x82b0('0x16')]+',${EXTEN},'+_0x2bd4d7,'exten':_0x426e82[_0x82b0('0xa')],'context':_0x426e82['context'],'priority':_0x2c31e3[_0x82b0('0xf')]+_0x3f08ef,'VoiceExtensionId':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x17')]});}_0x426e82[_0x82b0('0xf')]=_0x493334[_0x82b0('0x29')]?_[_0x82b0('0x3f')](_0x493334)['priority']+0x1:_0x2c31e3[_0x82b0('0xf')];_0x2c31e3[_0x82b0('0xf')]=(_0x320c37[_0x82b0('0x29')]?_[_0x82b0('0x3f')](_0x320c37)[_0x82b0('0xf')]:_0x426e82['priority'])+0x1;_0x2c31e3[_0x82b0('0x10')]=_[_0x82b0('0x40')](_0x2c31e3[_0x82b0('0x10')],_0x493334,[_0x426e82],_0x320c37);}_0x2c31e3[_0x82b0('0x10')][_0x82b0('0x19')]({'type':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x12')],'app':'Hangup','exten':_0x591a4f[_0x4df82b][0x0][_0x82b0('0xa')],'context':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x16')],'priority':_0x2c31e3[_0x82b0('0xf')],'VoiceExtensionId':_0x591a4f[_0x4df82b][0x0][_0x82b0('0x17')]});_0x1d13e3['push'](_0x591a4f[_0x4df82b][0x0][_0x82b0('0x17')]);_0x3c1244=_[_0x82b0('0x40')](_0x3c1244,_0x2c31e3[_0x82b0('0x10')]);}}return _0x4aa597[_0x82b0('0x41')](function(_0x40182c){return _0x4aa597['models'][_0x82b0('0x6')][_0x82b0('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x1d13e3}},'transaction':_0x40182c})[_0x82b0('0x8')](function(_0x8276ce){return _0x4aa597[_0x82b0('0x2')][_0x82b0('0x6')][_0x82b0('0x43')](_['sortBy'](_0x3c1244,_0x82b0('0xf')),{'transaction':_0x40182c});});});})[_0x82b0('0x44')](function(_0x58a7f8){console['error'](_0x58a7f8);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x95f7=['GotoIfTime',',${EXTEN},','concat','Hangup','transaction','destroy','bulkCreate','error','rewrite','models','Interval','findAll','then','VoiceExtension','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','hasOwnProperty','priority','extension','extensions','push','type','Set','format','context','VoiceExtensionId','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','interval','*,*,*,*','map','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1'];(function(_0xafbc04,_0x393fba){var _0x1121f2=function(_0x5ea4a8){while(--_0x5ea4a8){_0xafbc04['push'](_0xafbc04['shift']());}};_0x1121f2(++_0x393fba);}(_0x95f7,0x93));var _0x795f=function(_0x5afedd,_0x51d757){_0x5afedd=_0x5afedd-0x0;var _0x3e7bc3=_0x95f7[_0x5afedd];return _0x3e7bc3;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x1561ea,_0x2bed11){var _0x260922=this;return _0x1561ea[_0x795f('0x0')][_0x795f('0x1')][_0x795f('0x2')]({'raw':!![]})[_0x795f('0x3')](function(_0x2c577b){_0x260922['intervals']=_0x2c577b;return _0x1561ea[_0x795f('0x0')][_0x795f('0x4')][_0x795f('0x2')]({'where':{'IntervalId':_0x2bed11[_0x795f('0x5')]},'raw':!![]});})[_0x795f('0x3')](function(_0x477cab){return _0x1561ea[_0x795f('0x0')]['VoiceExtension'][_0x795f('0x2')]({'where':{'exten':{'$in':_[_0x795f('0x6')](_['map'](_0x477cab,_0x795f('0x7')))}},'order':[{'raw':_0x795f('0x8')}],'raw':!![]});})[_0x795f('0x3')](function(_0x1d9229){var _0x17aed0=_[_0x795f('0x9')](_0x1d9229,{'priority':'1'});var _0x57dbb5=_[_0x795f('0x9')](_0x1d9229,{'isApp':0x1});var _0x3fdb76=_[_0x795f('0xa')](_0x57dbb5,_0x795f('0x7'));var _0xcf9b0e=[_0x795f('0xb'),'playback'];var _0x5a00b8=[];var _0x28efea=[];for(var _0x106dee in _0x3fdb76){if(_0x3fdb76[_0x795f('0xc')](_0x106dee)){_0x260922[_0x795f('0xd')]=0x2;_0x260922['extensions']=[];_0x260922[_0x795f('0xe')]=_['find'](_0x17aed0,{'exten':_0x3fdb76[_0x106dee][0x0]['exten']});_0x260922[_0x795f('0xf')][_0x795f('0x10')]({'type':_0x3fdb76[_0x106dee][0x0][_0x795f('0x11')],'app':_0x795f('0x12'),'appdata':util[_0x795f('0x13')]('CDR(type)=%s',_0x3fdb76[_0x106dee][0x0]['type']),'context':_0x3fdb76[_0x106dee][0x0][_0x795f('0x14')],'exten':_0x3fdb76[_0x106dee][0x0][_0x795f('0x7')],'priority':_0x260922['priority']++,'VoiceExtensionId':_0x3fdb76[_0x106dee][0x0][_0x795f('0x15')]});if(_0x3fdb76[_0x106dee][0x0][_0x795f('0x11')]==='inbound'){_0x260922[_0x795f('0xf')][_0x795f('0x10')]({'type':_0x3fdb76[_0x106dee][0x0]['type'],'app':_0x795f('0x12'),'appdata':_0x795f('0x16')+_0x3fdb76[_0x106dee][0x0][_0x795f('0x15')],'context':_0x3fdb76[_0x106dee][0x0][_0x795f('0x14')],'exten':_0x3fdb76[_0x106dee][0x0]['exten'],'priority':_0x260922[_0x795f('0xd')]++,'VoiceExtensionId':_0x3fdb76[_0x106dee][0x0][_0x795f('0x15')]});}else if(_0x3fdb76[_0x106dee][0x0]['type']===_0x795f('0x17')){if(_0x260922['extension']){_0x260922['extensions'][_0x795f('0x10')]({'type':_0x3fdb76[_0x106dee][0x0][_0x795f('0x11')],'app':_0x795f('0x12'),'appdata':_0x795f('0x18')+(_0x260922[_0x795f('0xe')][_0x795f('0x19')]?_0x795f('0x1a')+_0x260922[_0x795f('0xe')]['cutdigits']+'}':_0x795f('0x1b')),'context':_0x3fdb76[_0x106dee][0x0][_0x795f('0x14')],'exten':_0x3fdb76[_0x106dee][0x0][_0x795f('0x7')],'priority':_0x260922['priority']++,'VoiceExtensionId':_0x3fdb76[_0x106dee][0x0]['VoiceExtensionId']});}_0x260922['extensions'][_0x795f('0x10')]({'type':_0x3fdb76[_0x106dee][0x0][_0x795f('0x11')],'app':_0x795f('0x12'),'appdata':_0x795f('0x16')+_0x3fdb76[_0x106dee][0x0][_0x795f('0x15')],'context':_0x3fdb76[_0x106dee][0x0][_0x795f('0x14')],'exten':_0x3fdb76[_0x106dee][0x0][_0x795f('0x7')],'priority':_0x260922[_0x795f('0xd')]++,'VoiceExtensionId':_0x3fdb76[_0x106dee][0x0][_0x795f('0x15')]});var _0x4f8764=_0x260922[_0x795f('0xd')]++;_0x260922[_0x795f('0xf')]['push']({'type':_0x3fdb76[_0x106dee][0x0][_0x795f('0x11')],'app':_0x795f('0x1c'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4f8764+0x2)+_0x795f('0x1d')+(_0x4f8764+0x1)+')','context':_0x3fdb76[_0x106dee][0x0][_0x795f('0x14')],'exten':_0x3fdb76[_0x106dee][0x0]['exten'],'priority':_0x4f8764,'VoiceExtensionId':_0x3fdb76[_0x106dee][0x0][_0x795f('0x15')]});if(_0x260922[_0x795f('0xe')]){_0x260922['extensions'][_0x795f('0x10')]({'type':_0x3fdb76[_0x106dee][0x0][_0x795f('0x11')],'app':'Set','appdata':_0x260922[_0x795f('0xe')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x260922[_0x795f('0xe')][_0x795f('0x19')]+'}':_0x795f('0x1e'),'context':_0x3fdb76[_0x106dee][0x0][_0x795f('0x14')],'exten':_0x3fdb76[_0x106dee][0x0][_0x795f('0x7')],'priority':_0x260922[_0x795f('0xd')]++,'VoiceExtensionId':_0x3fdb76[_0x106dee][0x0]['VoiceExtensionId']});}_0x260922[_0x795f('0xf')][_0x795f('0x10')]({'type':_0x3fdb76[_0x106dee][0x0][_0x795f('0x11')],'app':'Set','appdata':_0x795f('0x1f')+_0x3fdb76[_0x106dee][0x0][_0x795f('0x15')],'context':_0x3fdb76[_0x106dee][0x0][_0x795f('0x14')],'exten':_0x3fdb76[_0x106dee][0x0][_0x795f('0x7')],'priority':_0x260922[_0x795f('0xd')]++,'VoiceExtensionId':_0x3fdb76[_0x106dee][0x0][_0x795f('0x15')]});if(_0x260922['extension']&&_0x260922['extension'][_0x795f('0xc')]('recordingFormat')&&_0x260922[_0x795f('0xe')][_0x795f('0x20')]!==_0x795f('0x21')){_0x260922[_0x795f('0xf')]['push']({'type':_0x3fdb76[_0x106dee][0x0][_0x795f('0x11')],'app':_0x795f('0x12'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3fdb76[_0x106dee][0x0][_0x795f('0x14')],'exten':_0x3fdb76[_0x106dee][0x0][_0x795f('0x7')],'priority':_0x260922[_0x795f('0xd')]++,'VoiceExtensionId':_0x3fdb76[_0x106dee][0x0]['VoiceExtensionId']});_0x260922[_0x795f('0xf')][_0x795f('0x10')]({'type':_0x3fdb76[_0x106dee][0x0][_0x795f('0x11')],'app':_0x795f('0x12'),'appdata':_0x795f('0x22')+_0x260922[_0x795f('0xe')][_0x795f('0x20')]||_0x795f('0x23'),'context':_0x3fdb76[_0x106dee][0x0][_0x795f('0x14')],'exten':_0x3fdb76[_0x106dee][0x0][_0x795f('0x7')],'priority':_0x260922[_0x795f('0xd')]++,'VoiceExtensionId':_0x3fdb76[_0x106dee][0x0]['VoiceExtensionId']});}}_0x260922[_0x795f('0xf')][_0x795f('0x10')]({'type':_0x3fdb76[_0x106dee][0x0][_0x795f('0x11')],'app':_0x795f('0x12'),'appdata':_0x795f('0x24'),'context':_0x3fdb76[_0x106dee][0x0][_0x795f('0x14')],'exten':_0x3fdb76[_0x106dee][0x0][_0x795f('0x7')],'priority':_0x260922[_0x795f('0xd')]++,'VoiceExtensionId':_0x3fdb76[_0x106dee][0x0]['VoiceExtensionId']});_0x260922['extensions'][_0x795f('0x10')]({'type':_0x3fdb76[_0x106dee][0x0][_0x795f('0x11')],'app':_0x795f('0x12'),'appdata':_0x795f('0x25'),'context':_0x3fdb76[_0x106dee][0x0]['context'],'exten':_0x3fdb76[_0x106dee][0x0][_0x795f('0x7')],'priority':_0x260922[_0x795f('0xd')]++,'VoiceExtensionId':_0x3fdb76[_0x106dee][0x0][_0x795f('0x15')]});_0x260922['extensions'][_0x795f('0x10')]({'type':_0x3fdb76[_0x106dee][0x0][_0x795f('0x11')],'app':_0x795f('0x12'),'appdata':_0x795f('0x26'),'context':_0x3fdb76[_0x106dee][0x0][_0x795f('0x14')],'exten':_0x3fdb76[_0x106dee][0x0][_0x795f('0x7')],'priority':_0x260922[_0x795f('0xd')]++,'VoiceExtensionId':_0x3fdb76[_0x106dee][0x0][_0x795f('0x15')]});for(var _0x446ed0=0x0,_0x5cae7b=0x0;_0x446ed0<_0x3fdb76[_0x106dee][_0x795f('0x27')];_0x446ed0+=0x1,_0x5cae7b=0x0){var _0x44e568=_0x3fdb76[_0x106dee][_0x446ed0];if(_0x44e568[_0x795f('0x11')]){_0x44e568[_0x795f('0x11')]=_0x44e568[_0x795f('0x11')]['toLowerCase']();}var _0x1f5aff=[];var _0x572687=[];delete _0x44e568['id'];delete _0x44e568[_0x795f('0x28')];delete _0x44e568['updatedAt'];var _0x551acc=_0x44e568[_0x795f('0x29')]!==_0x795f('0x2a')?[_0x44e568[_0x795f('0x29')]]:_0x44e568[_0x795f('0x5')]?_[_0x795f('0x2b')](_['filter'](_0x260922[_0x795f('0x2c')],{'IntervalId':_0x44e568[_0x795f('0x5')]}),_0x795f('0x29')):[];if(_0x44e568[_0x795f('0xc')](_0x795f('0x2d'))){if(_0x44e568[_0x795f('0x2d')]&&_0x44e568[_0x795f('0x2d')]!=='--'){_0x1f5aff[_0x795f('0x10')]({'type':_0x44e568[_0x795f('0x11')],'app':_0x795f('0x12'),'appdata':_0x795f('0x2e')+_0x44e568[_0x795f('0x2d')],'context':_0x44e568[_0x795f('0x14')],'exten':_0x44e568[_0x795f('0x7')],'priority':_0x551acc['length']+_0x260922['priority']+_0x5cae7b++,'VoiceExtensionId':_0x44e568[_0x795f('0x15')]});}}if(_0x44e568[_0x795f('0x11')]===_0x795f('0x17')&&_0x44e568[_0x795f('0xc')](_0x795f('0x2f'))){if(_0x44e568[_0x795f('0x2f')]){_0x1f5aff[_0x795f('0x10')]({'type':_0x44e568[_0x795f('0x11')],'app':_0x795f('0x1c'),'appdata':_0x795f('0x30')+_0x44e568[_0x795f('0x2f')]+')','context':_0x44e568[_0x795f('0x14')],'exten':_0x44e568[_0x795f('0x7')],'priority':_0x551acc[_0x795f('0x27')]+_0x260922[_0x795f('0xd')]+_0x5cae7b++,'VoiceExtensionId':_0x44e568[_0x795f('0x15')]});}else{_0x1f5aff[_0x795f('0x10')]({'type':_0x44e568[_0x795f('0x11')],'app':_0x795f('0x1c'),'appdata':_0x795f('0x31'),'context':_0x44e568[_0x795f('0x14')],'exten':_0x44e568[_0x795f('0x7')],'priority':_0x551acc[_0x795f('0x27')]+_0x260922[_0x795f('0xd')]+_0x5cae7b++,'VoiceExtensionId':_0x44e568[_0x795f('0x15')]});}}if(_0x44e568[_0x795f('0xc')](_0x795f('0x32'))){if(_0xcf9b0e[_0x795f('0x33')](_0x44e568[_0x795f('0x34')][_0x795f('0x35')]())>=0x0&&_0x44e568[_0x795f('0x36')]!==_0x795f('0x37')){if(_0x44e568[_0x795f('0x32')]){_0x1f5aff[_0x795f('0x10')]({'type':_0x44e568[_0x795f('0x11')],'app':'ExecIf','appdata':_0x795f('0x38'),'context':_0x44e568[_0x795f('0x14')],'exten':_0x44e568[_0x795f('0x7')],'priority':_0x551acc[_0x795f('0x27')]+_0x260922[_0x795f('0xd')]+_0x5cae7b++,'VoiceExtensionId':_0x44e568[_0x795f('0x15')]});_0x1f5aff[_0x795f('0x10')]({'type':_0x44e568[_0x795f('0x11')],'app':_0x795f('0x12'),'appdata':_0x795f('0x39'),'context':_0x44e568[_0x795f('0x14')],'exten':_0x44e568[_0x795f('0x7')],'priority':_0x551acc[_0x795f('0x27')]+_0x260922['priority']+_0x5cae7b++,'VoiceExtensionId':_0x44e568[_0x795f('0x15')]});}else{_0x1f5aff[_0x795f('0x10')]({'type':_0x44e568[_0x795f('0x11')],'app':_0x795f('0x1c'),'appdata':_0x795f('0x3a'),'context':_0x44e568[_0x795f('0x14')],'exten':_0x44e568[_0x795f('0x7')],'priority':_0x551acc['length']+_0x260922[_0x795f('0xd')]+_0x5cae7b++,'VoiceExtensionId':_0x44e568[_0x795f('0x15')]});_0x1f5aff[_0x795f('0x10')]({'type':_0x44e568[_0x795f('0x11')],'app':_0x795f('0x12'),'appdata':_0x795f('0x3b'),'context':_0x44e568[_0x795f('0x14')],'exten':_0x44e568[_0x795f('0x7')],'priority':_0x551acc[_0x795f('0x27')]+_0x260922['priority']+_0x5cae7b++,'VoiceExtensionId':_0x44e568[_0x795f('0x15')]});}}}for(var _0xc9a200=0x0;_0xc9a200<_0x551acc[_0x795f('0x27')];_0xc9a200+=0x1){var _0x54fad7=_0x260922[_0x795f('0xd')]+_0x551acc['length'];var _0xe4366b=_0xc9a200===_0x551acc['length']-0x1?_0x260922[_0x795f('0xd')]+_0x1f5aff['length']+_0x572687['length']+0x2:_0x260922[_0x795f('0xd')]+_0xc9a200+0x1;_0x1f5aff['splice'](_0xc9a200,0x0,{'type':_0x44e568[_0x795f('0x11')],'app':_0x795f('0x3c'),'appdata':_0x551acc[_0xc9a200]+'?'+_0x44e568[_0x795f('0x14')]+',${EXTEN},'+_0x54fad7+':'+_0x44e568[_0x795f('0x14')]+_0x795f('0x3d')+_0xe4366b,'exten':_0x44e568[_0x795f('0x7')],'context':_0x44e568[_0x795f('0x14')],'priority':_0x260922[_0x795f('0xd')]+_0xc9a200,'VoiceExtensionId':_0x3fdb76[_0x106dee][0x0][_0x795f('0x15')]});}_0x44e568[_0x795f('0xd')]=_0x1f5aff[_0x795f('0x27')]?_['last'](_0x1f5aff)[_0x795f('0xd')]+0x1:_0x260922[_0x795f('0xd')];_0x260922[_0x795f('0xd')]=(_0x572687[_0x795f('0x27')]?_['last'](_0x572687)[_0x795f('0xd')]:_0x44e568[_0x795f('0xd')])+0x1;_0x260922['extensions']=_[_0x795f('0x3e')](_0x260922[_0x795f('0xf')],_0x1f5aff,[_0x44e568],_0x572687);}_0x260922[_0x795f('0xf')][_0x795f('0x10')]({'type':_0x3fdb76[_0x106dee][0x0][_0x795f('0x11')],'app':_0x795f('0x3f'),'exten':_0x3fdb76[_0x106dee][0x0][_0x795f('0x7')],'context':_0x3fdb76[_0x106dee][0x0][_0x795f('0x14')],'priority':_0x260922[_0x795f('0xd')],'VoiceExtensionId':_0x3fdb76[_0x106dee][0x0]['VoiceExtensionId']});_0x5a00b8['push'](_0x3fdb76[_0x106dee][0x0][_0x795f('0x15')]);_0x28efea=_[_0x795f('0x3e')](_0x28efea,_0x260922[_0x795f('0xf')]);}}return _0x1561ea[_0x795f('0x40')](function(_0x5a035a){return _0x1561ea['models'][_0x795f('0x4')][_0x795f('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x5a00b8}},'transaction':_0x5a035a})['then'](function(_0x3c76eb){return _0x1561ea['models'][_0x795f('0x4')][_0x795f('0x42')](_['sortBy'](_0x28efea,_0x795f('0xd')),{'transaction':_0x5a035a});});});})['catch'](function(_0x44a3a2){console[_0x795f('0x43')](_0x44a3a2);});}exports[_0x795f('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index bb5cd70..b5d18b5 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 _0x4e88=['resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CmContact','parse','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','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','join','data','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','create','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','fromQuery','scheduledAt','ContactId','createdAt','select','field','phone','toString','NOW()','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','id\x20IN\x20?','str','calleridnum','\x20=\x20?','cm_hopper_black','phone\x20IS\x20NOT\x20NULL','findAll','outbound','CmList','Lists','then','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','VoiceQueue','BlackLists','get','Campaign','CampaignId','all','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume'];(function(_0x62ab3d,_0x495bfc){var _0x2d338c=function(_0x217b47){while(--_0x217b47){_0x62ab3d['push'](_0x62ab3d['shift']());}};_0x2d338c(++_0x495bfc);}(_0x4e88,0xe6));var _0x84e8=function(_0x212949,_0x2ce6e1){_0x212949=_0x212949-0x0;var _0x552ecd=_0x4e88[_0x212949];return _0x552ecd;};'use strict';var BPromise=require(_0x84e8('0x0'));var util=require('util');var _=require(_0x84e8('0x1'));var fs=require('fs');var squel=require(_0x84e8('0x2'));var Papa=require(_0x84e8('0x3'));var Redis=require(_0x84e8('0x4'));var db=require(_0x84e8('0x5'))['db'];var config=require(_0x84e8('0x6'));var logger=require(_0x84e8('0x7'))(_0x84e8('0x8'));config[_0x84e8('0x9')]=_[_0x84e8('0xa')](config[_0x84e8('0x9')],{'host':_0x84e8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x84e8('0x9')]));require(_0x84e8('0xc'))['register'](socket);try{if(!process[_0x84e8('0xd')][0x2]||process['argv'][0x2]===_0x84e8('0xe')||process[_0x84e8('0xd')][0x2]===_0x84e8('0xf')){throw new Error(_0x84e8('0x10'));}var FILEPATH=process[_0x84e8('0xd')][0x2];if(!process['argv'][0x3]||process[_0x84e8('0xd')][0x3]==='undefined'||process[_0x84e8('0xd')][0x3]===_0x84e8('0xf')||!process[_0x84e8('0xd')][0x4]||process['argv'][0x4]===_0x84e8('0xe')||process[_0x84e8('0xd')][0x4]==='null'){throw new Error(_0x84e8('0x11'));}var FIELDS=_[_0x84e8('0x12')](process[_0x84e8('0xd')][0x3][_0x84e8('0x13')](','),process['argv'][0x4][_0x84e8('0x13')](','));if(!process['argv'][0x5]||process[_0x84e8('0xd')][0x5]==='undefined'||process[_0x84e8('0xd')][0x5]===_0x84e8('0xf')){throw new Error(_0x84e8('0x14'));}var LISTID=process[_0x84e8('0xd')][0x5];var COMPANYID=process[_0x84e8('0xd')][0x6]&&process[_0x84e8('0xd')][0x6]!==_0x84e8('0xe')&&process[_0x84e8('0xd')][0x6]!==_0x84e8('0xf')?process[_0x84e8('0xd')][0x6]:null;var DUPLICATES=process[_0x84e8('0xd')][0x7]&&process['argv'][0x7]!==_0x84e8('0xe')&&process[_0x84e8('0xd')][0x7]!==_0x84e8('0xf')?process['argv'][0x7]:null;if(!process[_0x84e8('0xd')][0x8]||process[_0x84e8('0xd')][0x8]===_0x84e8('0xe')||process[_0x84e8('0xd')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x84e8('0xd')][0x8];}catch(_0x128858){logger['error'](_0x128858);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(_0x1a7619,_0x4724df,_0x43d494,_0x2eefcf){var _0x5f2b1c={'message':_0x4724df};_0x5f2b1c[_0x1a7619]=!![];if(_0x43d494){_0x5f2b1c[_0x84e8('0x15')]=_0x43d494;}if(_0x2eefcf){_0x5f2b1c['index']=_0x2eefcf;}return _0x5f2b1c;}function isEmail(_0x447575){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))*$/[_0x84e8('0x16')](_0x447575);}function checkRow(_0x4373f9,_0x1c9257,_0x5bcc8f){return new BPromise(function(_0x4ee0c8,_0x35eb65){if(_[_0x84e8('0x17')](_0x4373f9)){return _0x35eb65(handleCheckRowError(_0x84e8('0x18'),_0x84e8('0x19'),null,_0x5bcc8f));}if(_0x4373f9[_0x84e8('0x1a')]&&_0x4373f9['errors'][_0x84e8('0x1b')]){var _0x571e94=_[_0x84e8('0x1c')](_0x4373f9[_0x84e8('0x1a')],_0x84e8('0x1d'))[_0x84e8('0x1e')](';');return _0x35eb65(handleCheckRowError('error',_0x571e94,null,_0x5bcc8f));}var _0x47a165={};for(var _0xc03932 in FIELDS){if(FIELDS['hasOwnProperty'](_0xc03932)&&FIELDS[_0xc03932]){_0x47a165[_0xc03932]=_0x4373f9[_0x84e8('0x1f')][0x0][FIELDS[_0xc03932]]||_0x4373f9[_0x84e8('0x1f')][0x0]['\ufeff'+FIELDS[_0xc03932]];}}if(!_0x47a165['firstName']){return _0x35eb65(handleCheckRowError(_0x84e8('0x18'),_0x84e8('0x20'),null,_0x5bcc8f));}if(!_0x47a165['phone']){return _0x35eb65(handleCheckRowError('error',_0x84e8('0x21'),null,_0x5bcc8f));}if(_0x47a165[_0x84e8('0x22')]){var _0x11e512=moment(_0x47a165[_0x84e8('0x22')],_0x84e8('0x23'));if(!_0x11e512[_0x84e8('0x24')]()){return _0x35eb65(handleCheckRowError(_0x84e8('0x18'),_0x84e8('0x25'),null,_0x5bcc8f));}}if(_0x47a165['email']){if(!isEmail(_0x47a165[_0x84e8('0x26')])){return _0x35eb65(handleCheckRowError(_0x84e8('0x18'),_0x84e8('0x27'),null,_0x5bcc8f));}}_0x47a165[_0x84e8('0x28')]=LISTID;_0x47a165['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x84e8('0x1b')]&&_0x1c9257){var _0xc78474={};for(var _0x4006d8=0x0,_0x33e411=DUPLICATES['length'];_0x4006d8<_0x33e411;_0x4006d8+=0x1){_0xc78474[DUPLICATES[_0x4006d8]]=_0x47a165[DUPLICATES[_0x4006d8]];}var _0x4fefdb=_[_0x84e8('0x29')](_0x1c9257,_0xc78474);if(_0x4fefdb){return _0x35eb65(handleCheckRowError(_0x84e8('0x2a'),'Duplicate\x20Contact',_0x4fefdb,_0x5bcc8f));}}return db['CmContact'][_0x84e8('0x2b')](_0x47a165,{'raw':!![],'hooks':![],'fields':_['keys'](_0x47a165)})['then'](function(_0x5f5719){if(DUPLICATES&&DUPLICATES[_0x84e8('0x1b')]&&_0x1c9257){_0x1c9257[_0x84e8('0x2c')](_[_0x84e8('0x2d')](_0x47a165,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5f5719['id'];return _0x4ee0c8();})[_0x84e8('0x2e')](function(_0x311c4d){return _0x35eb65(handleCheckRowError(_0x84e8('0x18'),_0x84e8('0x2f')+(_0x311c4d[_0x84e8('0x1d')]||JSON[_0x84e8('0x30')](_0x311c4d)),null,_0x5bcc8f));});});}function checkHopper(){function _0x75dbd8(){return function(_0x4e3526){logger[_0x84e8('0x18')](_0x84e8('0x31'),_0x84e8('0x32'),util[_0x84e8('0x33')](_0x4e3526,{'showHidden':![],'depth':null}));};}var _0x45a762=function(_0x23afe1,_0x52d3e5){var _0x263659=squel[_0x84e8('0x34')]()[_0x84e8('0x35')]('cm_hopper')[_0x84e8('0x36')](['phone',_0x84e8('0x37'),_0x84e8('0x38'),_0x84e8('0x28'),_0x52d3e5,_0x84e8('0x39'),'updatedAt'],squel[_0x84e8('0x3a')]()[_0x84e8('0x3b')](_0x84e8('0x3c'),_0x84e8('0x3c'))[_0x84e8('0x3b')]('NOW()',_0x84e8('0x37'))[_0x84e8('0x3b')]('id',_0x84e8('0x38'))['field'](LISTID['toString'](),_0x84e8('0x28'))[_0x84e8('0x3b')](_0x23afe1['id'][_0x84e8('0x3d')](),_0x52d3e5)['field'](_0x84e8('0x3e'),_0x84e8('0x39'))['field']('NOW()',_0x84e8('0x3f'))[_0x84e8('0x40')](_0x84e8('0x41'))[_0x84e8('0x42')](_0x84e8('0x43'))[_0x84e8('0x42')](_0x84e8('0x44'),LISTID[_0x84e8('0x3d')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x84e8('0x42')](_0x84e8('0x45'),squel['select']()[_0x84e8('0x3b')]('phone')[_0x84e8('0x40')](_0x84e8('0x46'))[_0x84e8('0x42')](_0x52d3e5+'\x20=\x20?',_0x23afe1['id'][_0x84e8('0x3d')]())))[_0x84e8('0x3d')]();return _0x263659;};var _0x37873a=function(_0x1eb7f2,_0x285dcc){var _0x3eb302=squel['insert']()['into'](_0x84e8('0x46'))[_0x84e8('0x36')]([_0x84e8('0x3c'),_0x84e8('0x37'),_0x84e8('0x38'),_0x84e8('0x28'),_0x285dcc,_0x84e8('0x39'),_0x84e8('0x3f')],squel[_0x84e8('0x3a')]()['field'](_0x84e8('0x3c'),_0x84e8('0x3c'))['field'](_0x84e8('0x3e'),_0x84e8('0x37'))[_0x84e8('0x3b')]('id',_0x84e8('0x38'))[_0x84e8('0x3b')](LISTID[_0x84e8('0x3d')](),_0x84e8('0x28'))[_0x84e8('0x3b')](_0x1eb7f2['id'][_0x84e8('0x3d')](),_0x285dcc)['field'](_0x84e8('0x3e'),_0x84e8('0x39'))[_0x84e8('0x3b')](_0x84e8('0x3e'),_0x84e8('0x3f'))[_0x84e8('0x40')](_0x84e8('0x41'))[_0x84e8('0x42')](_0x84e8('0x43'))[_0x84e8('0x42')](_0x84e8('0x44'),LISTID[_0x84e8('0x3d')]())['where'](_0x84e8('0x47'),squel[_0x84e8('0x48')](hopperContacts))[_0x84e8('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x84e8('0x42')](_0x84e8('0x45'),squel[_0x84e8('0x3a')]()[_0x84e8('0x3b')](_0x84e8('0x49'))[_0x84e8('0x40')]('cm_hopper_final')[_0x84e8('0x42')](_0x285dcc+_0x84e8('0x4a'),_0x1eb7f2['id'][_0x84e8('0x3d')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x84e8('0x3c'))[_0x84e8('0x40')](_0x84e8('0x46'))[_0x84e8('0x42')](_0x285dcc+_0x84e8('0x4a'),_0x1eb7f2['id'][_0x84e8('0x3d')]())))['toString']();return _0x3eb302;};function _0x1d874c(_0x58549c,_0x456519){var _0xfee932=squel['insert']()[_0x84e8('0x35')](_0x84e8('0x46'))['fromQuery'](['phone','scheduledAt',_0x84e8('0x38'),'ListId',_0x456519,'createdAt','updatedAt'],squel[_0x84e8('0x3a')]()[_0x84e8('0x3b')]('phone','phone')[_0x84e8('0x3b')](_0x84e8('0x3e'),_0x84e8('0x37'))['field']('id',_0x84e8('0x38'))[_0x84e8('0x3b')](LISTID[_0x84e8('0x3d')](),_0x84e8('0x28'))[_0x84e8('0x3b')](_0x58549c['id'][_0x84e8('0x3d')](),_0x456519)['field'](_0x84e8('0x3e'),_0x84e8('0x39'))['field'](_0x84e8('0x3e'),_0x84e8('0x3f'))[_0x84e8('0x40')]('cm_contacts')[_0x84e8('0x42')](_0x84e8('0x43'))[_0x84e8('0x42')](_0x84e8('0x44'),LISTID[_0x84e8('0x3d')]())['where'](_0x84e8('0x47'),squel[_0x84e8('0x48')](hopperContacts))[_0x84e8('0x42')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0xfee932;}function _0x3ec268(_0x1f7c22,_0x212222){var _0x3eabd5=squel[_0x84e8('0x34')]()[_0x84e8('0x35')](_0x84e8('0x4b'))[_0x84e8('0x36')]([_0x84e8('0x3c'),_0x84e8('0x38'),_0x84e8('0x28'),_0x212222,'createdAt',_0x84e8('0x3f')],squel['select']()[_0x84e8('0x3b')](_0x84e8('0x3c'),_0x84e8('0x3c'))[_0x84e8('0x3b')]('id',_0x84e8('0x38'))[_0x84e8('0x3b')](LISTID[_0x84e8('0x3d')](),_0x84e8('0x28'))[_0x84e8('0x3b')](_0x1f7c22['id']['toString'](),_0x212222)[_0x84e8('0x3b')](_0x84e8('0x3e'),'createdAt')[_0x84e8('0x3b')]('NOW()',_0x84e8('0x3f'))[_0x84e8('0x40')](_0x84e8('0x41'))['where'](_0x84e8('0x43'))[_0x84e8('0x42')](_0x84e8('0x44'),LISTID[_0x84e8('0x3d')]())[_0x84e8('0x42')](_0x84e8('0x47'),squel[_0x84e8('0x48')](hopperContacts))[_0x84e8('0x42')](_0x84e8('0x4c')))['toString']();return _0x3eabd5;}return db['VoiceQueue'][_0x84e8('0x4d')]({'where':{'type':_0x84e8('0x4e')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x84e8('0x4f')],'as':_0x84e8('0x50'),'where':{'id':LISTID}}]})[_0x84e8('0x51')](function(_0x4cb6b2){var _0x527659=[];if(_0x4cb6b2){var _0x3ea617;for(var _0x4a1af0=0x0,_0x114a5a;_0x4a1af0<_0x4cb6b2[_0x84e8('0x1b')];_0x4a1af0+=0x1){_0x114a5a=_0x4cb6b2[_0x4a1af0]['get']({'plain':!![]});switch(_0x114a5a[_0x84e8('0x52')]){case _0x84e8('0x53'):_0x527659[_0x84e8('0x2c')](db[_0x84e8('0x54')][_0x84e8('0x55')](_0x37873a(_0x114a5a,_0x84e8('0x56')))[_0x84e8('0x51')](function(){})[_0x84e8('0x2e')](_0x75dbd8()));break;case _0x84e8('0x57'):_0x527659[_0x84e8('0x2c')](db[_0x84e8('0x54')][_0x84e8('0x55')](_0x45a762(_0x114a5a,_0x84e8('0x56')))['then'](function(){})[_0x84e8('0x2e')](_0x75dbd8()));break;default:_0x527659['push'](db[_0x84e8('0x54')]['query'](_0x1d874c(_0x114a5a,_0x84e8('0x56')))['then'](function(){})[_0x84e8('0x2e')](_0x75dbd8()));}}}return _0x527659;})['all']()[_0x84e8('0x51')](function(){return db[_0x84e8('0x58')][_0x84e8('0x4d')]({'where':{'type':_0x84e8('0x4e')},'attributes':['id'],'include':[{'model':db[_0x84e8('0x4f')],'as':_0x84e8('0x59'),'where':{'id':LISTID}}]})[_0x84e8('0x51')](function(_0x1ca788){var _0x4b4eaf=[];if(_0x1ca788){var _0x2e3825;for(var _0x24fcd1=0x0,_0x2a7169;_0x24fcd1<_0x1ca788[_0x84e8('0x1b')];_0x24fcd1+=0x1){_0x2a7169=_0x1ca788[_0x24fcd1][_0x84e8('0x5a')]({'plain':!![]});_0x4b4eaf[_0x84e8('0x2c')](db['sequelize'][_0x84e8('0x55')](_0x3ec268(_0x2a7169,'VoiceQueueId'))[_0x84e8('0x51')](function(){})[_0x84e8('0x2e')](_0x75dbd8()));}}return _0x4b4eaf;})['all']();})[_0x84e8('0x51')](function(){return db[_0x84e8('0x5b')][_0x84e8('0x4d')]({'attributes':['id',_0x84e8('0x52')],'include':[{'model':db['CmList'],'as':_0x84e8('0x50'),'where':{'id':LISTID}}]})[_0x84e8('0x51')](function(_0xe1d109){var _0x402c6f=[];if(_0xe1d109){for(var _0x5b8979=0x0,_0x315337;_0x5b8979<_0xe1d109[_0x84e8('0x1b')];_0x5b8979+=0x1){_0x315337=_0xe1d109[_0x5b8979][_0x84e8('0x5a')]({'plain':!![]});switch(_0x315337[_0x84e8('0x52')]){case'always':_0x402c6f['push'](db[_0x84e8('0x54')][_0x84e8('0x55')](_0x37873a(_0x315337,_0x84e8('0x5c')))['then'](function(){})[_0x84e8('0x2e')](_0x75dbd8()));break;case'onlyIfOpen':_0x402c6f[_0x84e8('0x2c')](db[_0x84e8('0x54')][_0x84e8('0x55')](_0x45a762(_0x315337,'CampaignId'))[_0x84e8('0x51')](function(){})[_0x84e8('0x2e')](_0x75dbd8()));break;default:_0x402c6f[_0x84e8('0x2c')](db[_0x84e8('0x54')][_0x84e8('0x55')](_0x1d874c(_0x315337,'CampaignId'))['then'](function(){})['catch'](_0x75dbd8()));}}}return _0x402c6f;})['all']();})[_0x84e8('0x51')](function(){return db[_0x84e8('0x5b')][_0x84e8('0x4d')]({'attributes':['id'],'include':[{'model':db[_0x84e8('0x4f')],'as':_0x84e8('0x59'),'where':{'id':LISTID}}]})[_0x84e8('0x51')](function(_0x177dd1){var _0x261f78=[];if(_0x177dd1){for(var _0x1dcf27=0x0,_0x4d9789;_0x1dcf27<_0x177dd1[_0x84e8('0x1b')];_0x1dcf27+=0x1){_0x4d9789=_0x177dd1[_0x1dcf27]['get']({'plain':!![]});_0x261f78[_0x84e8('0x2c')](db[_0x84e8('0x54')][_0x84e8('0x55')](_0x3ec268(_0x4d9789,_0x84e8('0x5c')))[_0x84e8('0x51')](function(){})['catch'](_0x75dbd8()));}}return _0x261f78;})[_0x84e8('0x5d')]();})[_0x84e8('0x2e')](function(_0x2da297){logger[_0x84e8('0x18')]('cmContact,\x20%s,\x20%s',_0x84e8('0x5e'),_0x2da297[_0x84e8('0x1d')]);});}var processPromises=function(_0x4867d1){return BPromise['all'](promises)[_0x84e8('0x51')](function(_0x5eb9b1){})[_0x84e8('0x2e')](function(_0x494775){logger['error'](_0x84e8('0x5f'),JSON['stringify'](_0x494775));})[_0x84e8('0x60')](function(){socket[_0x84e8('0x61')](_0x84e8('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4867d1){return _0x4867d1[_0x84e8('0x63')]();}});};var endCsv=function(){return BPromise[_0x84e8('0x64')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x84e8('0x61')](_0x84e8('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x84e8('0x65')](FILEPATH);}catch(_0x4aa49c){logger[_0x84e8('0x18')](_0x84e8('0x66'),JSON[_0x84e8('0x30')](_0x4aa49c));}finally{process[_0x84e8('0x67')](0x0);}});};process['on'](_0x84e8('0x68'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x84e8('0x64')]()[_0x84e8('0x51')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x84e8('0x69')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x84e8('0x51')](function(_0xc1f1d0){var _0x187dc9=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x84e8('0x6a')](_0x187dc9,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4652c5,_0x32ff98){total+=0x1;var _0x13db1a=total;promises['push'](checkRow(_0x4652c5,_0xc1f1d0,_0x13db1a)['then'](function(){success+=0x1;})[_0x84e8('0x2e')](function(_0x517d05){if(_0x517d05['error']){errors+=0x1;delete _0x517d05[_0x84e8('0x18')];}else if(_0x517d05[_0x84e8('0x2a')]){duplicates+=0x1;delete _0x517d05['duplicate'];}rows[_0x84e8('0x2c')](_0x517d05);}));if(total%0xc8===0x0){_0x32ff98['pause']();return processPromises(_0x32ff98);}},'complete':function(){return processPromises()[_0x84e8('0x51')](function(){logger['info'](_0x84e8('0x6b'));endCsv();});},'error':function(_0x509274,_0x3f2109){logger['info'](_0x84e8('0x6c'),JSON[_0x84e8('0x30')](_0x509274));endCsv();}});})['catch'](function(_0x273b1e){logger[_0x84e8('0x18')](_0x84e8('0x6d'),JSON[_0x84e8('0x30')](_0x273b1e));});}main(); \ No newline at end of file +var _0x4a0c=['info','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','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','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ListId\x20=\x20?','str','phone\x20IS\x20NOT\x20NULL','id\x20IN\x20?','cm_hopper_black','findAll','outbound','Lists','then','dialCheckDuplicateType','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','VoiceQueue','CmList','BlackLists','get','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','resolve','contact:csv_','unlinkSync','SIGINT'];(function(_0x4d3900,_0x40ea57){var _0xe734d1=function(_0x3aaee2){while(--_0x3aaee2){_0x4d3900['push'](_0x4d3900['shift']());}};_0xe734d1(++_0x40ea57);}(_0x4a0c,0x1b6));var _0xc4a0=function(_0x4898cb,_0x4f8f4b){_0x4898cb=_0x4898cb-0x0;var _0x3da1b6=_0x4a0c[_0x4898cb];return _0x3da1b6;};'use strict';var BPromise=require('bluebird');var util=require(_0xc4a0('0x0'));var _=require(_0xc4a0('0x1'));var fs=require('fs');var squel=require(_0xc4a0('0x2'));var Papa=require(_0xc4a0('0x3'));var Redis=require(_0xc4a0('0x4'));var db=require(_0xc4a0('0x5'))['db'];var config=require(_0xc4a0('0x6'));var logger=require(_0xc4a0('0x7'))(_0xc4a0('0x8'));config[_0xc4a0('0x9')]=_['defaults'](config[_0xc4a0('0x9')],{'host':_0xc4a0('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc4a0('0x9')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process['argv'][0x2]||process[_0xc4a0('0xb')][0x2]===_0xc4a0('0xc')||process[_0xc4a0('0xb')][0x2]===_0xc4a0('0xd')){throw new Error(_0xc4a0('0xe'));}var FILEPATH=process[_0xc4a0('0xb')][0x2];if(!process['argv'][0x3]||process['argv'][0x3]===_0xc4a0('0xc')||process['argv'][0x3]===_0xc4a0('0xd')||!process[_0xc4a0('0xb')][0x4]||process[_0xc4a0('0xb')][0x4]===_0xc4a0('0xc')||process[_0xc4a0('0xb')][0x4]==='null'){throw new Error(_0xc4a0('0xf'));}var FIELDS=_[_0xc4a0('0x10')](process[_0xc4a0('0xb')][0x3][_0xc4a0('0x11')](','),process[_0xc4a0('0xb')][0x4][_0xc4a0('0x11')](','));if(!process[_0xc4a0('0xb')][0x5]||process[_0xc4a0('0xb')][0x5]===_0xc4a0('0xc')||process[_0xc4a0('0xb')][0x5]===_0xc4a0('0xd')){throw new Error(_0xc4a0('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xc4a0('0xb')][0x6]&&process['argv'][0x6]!==_0xc4a0('0xc')&&process['argv'][0x6]!=='null'?process[_0xc4a0('0xb')][0x6]:null;var DUPLICATES=process[_0xc4a0('0xb')][0x7]&&process[_0xc4a0('0xb')][0x7]!==_0xc4a0('0xc')&&process['argv'][0x7]!==_0xc4a0('0xd')?process[_0xc4a0('0xb')][0x7]:null;if(!process['argv'][0x8]||process[_0xc4a0('0xb')][0x8]===_0xc4a0('0xc')||process['argv'][0x8]===_0xc4a0('0xd')){throw new Error(_0xc4a0('0x13'));}var SOCKET_TIMESTAMP=process[_0xc4a0('0xb')][0x8];}catch(_0x489a20){logger[_0xc4a0('0x14')](_0x489a20);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(_0x4615bd,_0x53a7af,_0x1e2e45,_0x15c387){var _0x138ad1={'message':_0x53a7af};_0x138ad1[_0x4615bd]=!![];if(_0x1e2e45){_0x138ad1[_0xc4a0('0x15')]=_0x1e2e45;}if(_0x15c387){_0x138ad1[_0xc4a0('0x16')]=_0x15c387;}return _0x138ad1;}function isEmail(_0x325c05){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))*$/[_0xc4a0('0x17')](_0x325c05);}function checkRow(_0x4e15e3,_0x578202,_0xb8a6){return new BPromise(function(_0x442a0e,_0x2fc07a){if(_[_0xc4a0('0x18')](_0x4e15e3)){return _0x2fc07a(handleCheckRowError('error',_0xc4a0('0x19'),null,_0xb8a6));}if(_0x4e15e3[_0xc4a0('0x1a')]&&_0x4e15e3[_0xc4a0('0x1a')][_0xc4a0('0x1b')]){var _0x3dc8f0=_[_0xc4a0('0x1c')](_0x4e15e3['errors'],_0xc4a0('0x1d'))[_0xc4a0('0x1e')](';');return _0x2fc07a(handleCheckRowError(_0xc4a0('0x14'),_0x3dc8f0,null,_0xb8a6));}var _0x4b4496={};for(var _0x5197e5 in FIELDS){if(FIELDS['hasOwnProperty'](_0x5197e5)&&FIELDS[_0x5197e5]){_0x4b4496[_0x5197e5]=_0x4e15e3[_0xc4a0('0x1f')][0x0][FIELDS[_0x5197e5]]||_0x4e15e3[_0xc4a0('0x1f')][0x0]['\ufeff'+FIELDS[_0x5197e5]];}}if(!_0x4b4496[_0xc4a0('0x20')]){return _0x2fc07a(handleCheckRowError(_0xc4a0('0x14'),_0xc4a0('0x21'),null,_0xb8a6));}if(!_0x4b4496[_0xc4a0('0x22')]){return _0x2fc07a(handleCheckRowError('error',_0xc4a0('0x23'),null,_0xb8a6));}if(_0x4b4496['birthDate']){var _0x43d567=moment(_0x4b4496[_0xc4a0('0x24')],_0xc4a0('0x25'));if(!_0x43d567[_0xc4a0('0x26')]()){return _0x2fc07a(handleCheckRowError(_0xc4a0('0x14'),_0xc4a0('0x27'),null,_0xb8a6));}}if(_0x4b4496['email']){if(!isEmail(_0x4b4496[_0xc4a0('0x28')])){return _0x2fc07a(handleCheckRowError(_0xc4a0('0x14'),_0xc4a0('0x29'),null,_0xb8a6));}}_0x4b4496[_0xc4a0('0x2a')]=LISTID;_0x4b4496['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x578202){var _0x4130ce={};for(var _0x2700d6=0x0,_0x54371c=DUPLICATES[_0xc4a0('0x1b')];_0x2700d6<_0x54371c;_0x2700d6+=0x1){_0x4130ce[DUPLICATES[_0x2700d6]]=_0x4b4496[DUPLICATES[_0x2700d6]];}var _0x179d2d=_[_0xc4a0('0x2b')](_0x578202,_0x4130ce);if(_0x179d2d){return _0x2fc07a(handleCheckRowError(_0xc4a0('0x2c'),_0xc4a0('0x2d'),_0x179d2d,_0xb8a6));}}return db[_0xc4a0('0x2e')][_0xc4a0('0x2f')](_0x4b4496,{'raw':!![],'hooks':![],'fields':_[_0xc4a0('0x30')](_0x4b4496)})['then'](function(_0x36b503){if(DUPLICATES&&DUPLICATES['length']&&_0x578202){_0x578202[_0xc4a0('0x31')](_[_0xc4a0('0x32')](_0x4b4496,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x36b503['id'];return _0x442a0e();})[_0xc4a0('0x33')](function(_0x286db6){return _0x2fc07a(handleCheckRowError(_0xc4a0('0x14'),_0xc4a0('0x34')+(_0x286db6['message']||JSON[_0xc4a0('0x35')](_0x286db6)),null,_0xb8a6));});});}function checkHopper(){function _0x59d968(){return function(_0x27185b){logger[_0xc4a0('0x14')](_0xc4a0('0x36'),'checkHopper',util['inspect'](_0x27185b,{'showHidden':![],'depth':null}));};}var _0x47310d=function(_0x564f06,_0x1c31fd){var _0x16c848=squel[_0xc4a0('0x37')]()[_0xc4a0('0x38')](_0xc4a0('0x39'))[_0xc4a0('0x3a')]([_0xc4a0('0x22'),_0xc4a0('0x3b'),_0xc4a0('0x3c'),_0xc4a0('0x2a'),_0x1c31fd,_0xc4a0('0x3d'),_0xc4a0('0x3e')],squel[_0xc4a0('0x3f')]()[_0xc4a0('0x40')](_0xc4a0('0x22'),_0xc4a0('0x22'))['field'](_0xc4a0('0x41'),'scheduledAt')[_0xc4a0('0x40')]('id',_0xc4a0('0x3c'))[_0xc4a0('0x40')](LISTID[_0xc4a0('0x42')](),_0xc4a0('0x2a'))['field'](_0x564f06['id'][_0xc4a0('0x42')](),_0x1c31fd)[_0xc4a0('0x40')](_0xc4a0('0x41'),_0xc4a0('0x3d'))[_0xc4a0('0x40')](_0xc4a0('0x41'),_0xc4a0('0x3e'))[_0xc4a0('0x43')](_0xc4a0('0x44'))[_0xc4a0('0x45')](_0xc4a0('0x46'))[_0xc4a0('0x45')]('ListId\x20=\x20?',LISTID[_0xc4a0('0x42')]())[_0xc4a0('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0xc4a0('0x45')](_0xc4a0('0x47'),squel[_0xc4a0('0x3f')]()[_0xc4a0('0x40')](_0xc4a0('0x22'))[_0xc4a0('0x43')](_0xc4a0('0x39'))[_0xc4a0('0x45')](_0x1c31fd+_0xc4a0('0x48'),_0x564f06['id'][_0xc4a0('0x42')]())))[_0xc4a0('0x42')]();return _0x16c848;};var _0x7c7040=function(_0x1c5219,_0x1d50ed){var _0x26179c=squel[_0xc4a0('0x37')]()[_0xc4a0('0x38')]('cm_hopper')['fromQuery']([_0xc4a0('0x22'),_0xc4a0('0x3b'),_0xc4a0('0x3c'),_0xc4a0('0x2a'),_0x1d50ed,_0xc4a0('0x3d'),'updatedAt'],squel['select']()[_0xc4a0('0x40')]('phone',_0xc4a0('0x22'))[_0xc4a0('0x40')](_0xc4a0('0x41'),_0xc4a0('0x3b'))[_0xc4a0('0x40')]('id',_0xc4a0('0x3c'))[_0xc4a0('0x40')](LISTID['toString'](),_0xc4a0('0x2a'))['field'](_0x1c5219['id'][_0xc4a0('0x42')](),_0x1d50ed)[_0xc4a0('0x40')](_0xc4a0('0x41'),'createdAt')[_0xc4a0('0x40')](_0xc4a0('0x41'),_0xc4a0('0x3e'))[_0xc4a0('0x43')](_0xc4a0('0x44'))[_0xc4a0('0x45')](_0xc4a0('0x46'))[_0xc4a0('0x45')](_0xc4a0('0x49'),LISTID[_0xc4a0('0x42')]())[_0xc4a0('0x45')]('id\x20IN\x20?',squel[_0xc4a0('0x4a')](hopperContacts))['where'](_0xc4a0('0x4b'))[_0xc4a0('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc4a0('0x3f')]()[_0xc4a0('0x40')]('calleridnum')[_0xc4a0('0x43')]('cm_hopper_final')['where'](_0x1d50ed+'\x20=\x20?',_0x1c5219['id'][_0xc4a0('0x42')]()))[_0xc4a0('0x45')](_0xc4a0('0x47'),squel['select']()['field'](_0xc4a0('0x22'))[_0xc4a0('0x43')](_0xc4a0('0x39'))[_0xc4a0('0x45')](_0x1d50ed+_0xc4a0('0x48'),_0x1c5219['id'][_0xc4a0('0x42')]())))[_0xc4a0('0x42')]();return _0x26179c;};function _0x53441d(_0x5a061f,_0x4456e5){var _0x3efe9b=squel[_0xc4a0('0x37')]()[_0xc4a0('0x38')]('cm_hopper')[_0xc4a0('0x3a')]([_0xc4a0('0x22'),'scheduledAt',_0xc4a0('0x3c'),_0xc4a0('0x2a'),_0x4456e5,_0xc4a0('0x3d'),_0xc4a0('0x3e')],squel[_0xc4a0('0x3f')]()[_0xc4a0('0x40')](_0xc4a0('0x22'),_0xc4a0('0x22'))[_0xc4a0('0x40')]('NOW()',_0xc4a0('0x3b'))[_0xc4a0('0x40')]('id',_0xc4a0('0x3c'))[_0xc4a0('0x40')](LISTID[_0xc4a0('0x42')](),'ListId')['field'](_0x5a061f['id'][_0xc4a0('0x42')](),_0x4456e5)[_0xc4a0('0x40')](_0xc4a0('0x41'),'createdAt')[_0xc4a0('0x40')](_0xc4a0('0x41'),_0xc4a0('0x3e'))[_0xc4a0('0x43')](_0xc4a0('0x44'))['where']('deletedAt\x20IS\x20NULL')[_0xc4a0('0x45')]('ListId\x20=\x20?',LISTID['toString']())[_0xc4a0('0x45')](_0xc4a0('0x4c'),squel[_0xc4a0('0x4a')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x3efe9b;}function _0x1c9a44(_0x39c501,_0x1dfda7){var _0x58bf14=squel[_0xc4a0('0x37')]()[_0xc4a0('0x38')](_0xc4a0('0x4d'))[_0xc4a0('0x3a')]([_0xc4a0('0x22'),_0xc4a0('0x3c'),_0xc4a0('0x2a'),_0x1dfda7,_0xc4a0('0x3d'),_0xc4a0('0x3e')],squel['select']()[_0xc4a0('0x40')](_0xc4a0('0x22'),_0xc4a0('0x22'))[_0xc4a0('0x40')]('id',_0xc4a0('0x3c'))[_0xc4a0('0x40')](LISTID[_0xc4a0('0x42')](),'ListId')['field'](_0x39c501['id'][_0xc4a0('0x42')](),_0x1dfda7)[_0xc4a0('0x40')](_0xc4a0('0x41'),_0xc4a0('0x3d'))[_0xc4a0('0x40')](_0xc4a0('0x41'),_0xc4a0('0x3e'))[_0xc4a0('0x43')](_0xc4a0('0x44'))[_0xc4a0('0x45')](_0xc4a0('0x46'))[_0xc4a0('0x45')](_0xc4a0('0x49'),LISTID[_0xc4a0('0x42')]())[_0xc4a0('0x45')](_0xc4a0('0x4c'),squel[_0xc4a0('0x4a')](hopperContacts))['where'](_0xc4a0('0x4b')))[_0xc4a0('0x42')]();return _0x58bf14;}return db['VoiceQueue'][_0xc4a0('0x4e')]({'where':{'type':_0xc4a0('0x4f')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0xc4a0('0x50'),'where':{'id':LISTID}}]})[_0xc4a0('0x51')](function(_0x4aa95c){var _0x515f1a=[];if(_0x4aa95c){var _0x1d7c39;for(var _0x78630e=0x0,_0x591a1d;_0x78630e<_0x4aa95c[_0xc4a0('0x1b')];_0x78630e+=0x1){_0x591a1d=_0x4aa95c[_0x78630e]['get']({'plain':!![]});switch(_0x591a1d[_0xc4a0('0x52')]){case _0xc4a0('0x53'):_0x515f1a[_0xc4a0('0x31')](db['sequelize'][_0xc4a0('0x54')](_0x7c7040(_0x591a1d,_0xc4a0('0x55')))['then'](function(){})[_0xc4a0('0x33')](_0x59d968()));break;case _0xc4a0('0x56'):_0x515f1a[_0xc4a0('0x31')](db[_0xc4a0('0x57')][_0xc4a0('0x54')](_0x47310d(_0x591a1d,_0xc4a0('0x55')))['then'](function(){})['catch'](_0x59d968()));break;default:_0x515f1a[_0xc4a0('0x31')](db[_0xc4a0('0x57')]['query'](_0x53441d(_0x591a1d,_0xc4a0('0x55')))[_0xc4a0('0x51')](function(){})['catch'](_0x59d968()));}}}return _0x515f1a;})[_0xc4a0('0x58')]()[_0xc4a0('0x51')](function(){return db[_0xc4a0('0x59')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xc4a0('0x5a')],'as':_0xc4a0('0x5b'),'where':{'id':LISTID}}]})[_0xc4a0('0x51')](function(_0x5a7371){var _0x462364=[];if(_0x5a7371){var _0x386849;for(var _0x5dec2c=0x0,_0x465fef;_0x5dec2c<_0x5a7371[_0xc4a0('0x1b')];_0x5dec2c+=0x1){_0x465fef=_0x5a7371[_0x5dec2c][_0xc4a0('0x5c')]({'plain':!![]});_0x462364['push'](db[_0xc4a0('0x57')][_0xc4a0('0x54')](_0x1c9a44(_0x465fef,'VoiceQueueId'))[_0xc4a0('0x51')](function(){})[_0xc4a0('0x33')](_0x59d968()));}}return _0x462364;})[_0xc4a0('0x58')]();})[_0xc4a0('0x51')](function(){return db[_0xc4a0('0x5d')][_0xc4a0('0x4e')]({'attributes':['id',_0xc4a0('0x52')],'include':[{'model':db[_0xc4a0('0x5a')],'as':_0xc4a0('0x50'),'where':{'id':LISTID}}]})[_0xc4a0('0x51')](function(_0xb30ba4){var _0x5f275b=[];if(_0xb30ba4){for(var _0x5a4cef=0x0,_0x58a177;_0x5a4cef<_0xb30ba4[_0xc4a0('0x1b')];_0x5a4cef+=0x1){_0x58a177=_0xb30ba4[_0x5a4cef][_0xc4a0('0x5c')]({'plain':!![]});switch(_0x58a177[_0xc4a0('0x52')]){case'always':_0x5f275b[_0xc4a0('0x31')](db['sequelize'][_0xc4a0('0x54')](_0x7c7040(_0x58a177,_0xc4a0('0x5e')))[_0xc4a0('0x51')](function(){})[_0xc4a0('0x33')](_0x59d968()));break;case'onlyIfOpen':_0x5f275b[_0xc4a0('0x31')](db[_0xc4a0('0x57')][_0xc4a0('0x54')](_0x47310d(_0x58a177,_0xc4a0('0x5e')))[_0xc4a0('0x51')](function(){})[_0xc4a0('0x33')](_0x59d968()));break;default:_0x5f275b[_0xc4a0('0x31')](db[_0xc4a0('0x57')][_0xc4a0('0x54')](_0x53441d(_0x58a177,_0xc4a0('0x5e')))[_0xc4a0('0x51')](function(){})[_0xc4a0('0x33')](_0x59d968()));}}}return _0x5f275b;})[_0xc4a0('0x58')]();})[_0xc4a0('0x51')](function(){return db['Campaign'][_0xc4a0('0x4e')]({'attributes':['id'],'include':[{'model':db[_0xc4a0('0x5a')],'as':_0xc4a0('0x5b'),'where':{'id':LISTID}}]})[_0xc4a0('0x51')](function(_0xeadfb5){var _0x3ce309=[];if(_0xeadfb5){for(var _0x449710=0x0,_0x1e53b6;_0x449710<_0xeadfb5[_0xc4a0('0x1b')];_0x449710+=0x1){_0x1e53b6=_0xeadfb5[_0x449710]['get']({'plain':!![]});_0x3ce309['push'](db['sequelize'][_0xc4a0('0x54')](_0x1c9a44(_0x1e53b6,'CampaignId'))[_0xc4a0('0x51')](function(){})[_0xc4a0('0x33')](_0x59d968()));}}return _0x3ce309;})[_0xc4a0('0x58')]();})[_0xc4a0('0x33')](function(_0x347c07){logger['error'](_0xc4a0('0x5f'),_0xc4a0('0x60'),_0x347c07['message']);});}var processPromises=function(_0x5ae27c){return BPromise[_0xc4a0('0x58')](promises)[_0xc4a0('0x51')](function(_0x4816a3){})[_0xc4a0('0x33')](function(_0x5eba17){logger['error'](_0xc4a0('0x61'),JSON[_0xc4a0('0x35')](_0x5eba17));})['finally'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5ae27c){return _0x5ae27c['resume']();}});};var endCsv=function(){return BPromise[_0xc4a0('0x62')]()[_0xc4a0('0x51')](function(){if(hopperContacts){return checkHopper();}})[_0xc4a0('0x51')](function(){socket['emit'](_0xc4a0('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xc4a0('0x64')](FILEPATH);}catch(_0x409535){logger[_0xc4a0('0x14')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xc4a0('0x35')](_0x409535));}finally{process['exit'](0x0);}});};process['on'](_0xc4a0('0x65'),function(){logger[_0xc4a0('0x66')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xc4a0('0x62')]()[_0xc4a0('0x51')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xc4a0('0x11')](',');return db[_0xc4a0('0x2e')][_0xc4a0('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xc4a0('0x51')](function(_0x4b3f3e){var _0x5475b2=fs[_0xc4a0('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xc4a0('0x68')](_0x5475b2,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1052a6,_0x44121c){total+=0x1;var _0x22f3a5=total;promises['push'](checkRow(_0x1052a6,_0x4b3f3e,_0x22f3a5)['then'](function(){success+=0x1;})[_0xc4a0('0x33')](function(_0x57011f){if(_0x57011f[_0xc4a0('0x14')]){errors+=0x1;delete _0x57011f['error'];}else if(_0x57011f[_0xc4a0('0x2c')]){duplicates+=0x1;delete _0x57011f[_0xc4a0('0x2c')];}rows[_0xc4a0('0x31')](_0x57011f);}));if(total%0xc8===0x0){_0x44121c[_0xc4a0('0x69')]();return processPromises(_0x44121c);}},'complete':function(){return processPromises()[_0xc4a0('0x51')](function(){logger[_0xc4a0('0x66')](_0xc4a0('0x6a'));endCsv();});},'error':function(_0x8a6652,_0x3250f6){logger[_0xc4a0('0x66')](_0xc4a0('0x6b'),JSON[_0xc4a0('0x35')](_0x8a6652));endCsv();}});})[_0xc4a0('0x33')](function(_0x3928a9){logger[_0xc4a0('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xc4a0('0x35')](_0x3928a9));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index bd3438f..fe3f5c4 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 _0x7fa6=['cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','scheduledAt','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','error','message','exit','code','sequelize','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists.CmListId=','query','catch','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','spread','isNil','set','dialTimezone','main','stringify','send','start','binding','clone','socket_timestamp','root','.csv','includes','header','ContactItemType','name','writeFileSync','parse','data','errors','find','_description','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','isNumber','email','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','hasOwnProperty','trim','itemTypeId','description','SystemRow','rows','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','voice_queues_has_cm_lists','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','server/files/tmp','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','util','moment','squel','ioredis','../../../config/environment','import','defaults','redis','socket.io-emitter','format','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','length','push','all','split','then','filter','findOne','CmContactHasItem','update','create','PHONE','inserted','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','phone','ContactId','ListId','createdAt','updatedAt','priority','recallme','fields','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_hopper_black','cm_contacts','cm_contacts.ListId\x20=\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','scheduledat','UserId','\x22onlyIfOpen\x22','toString'];(function(_0x5ca47b,_0x1734e0){var _0x398fab=function(_0x3b3429){while(--_0x3b3429){_0x5ca47b['push'](_0x5ca47b['shift']());}};_0x398fab(++_0x1734e0);}(_0x7fa6,0x1e2));var _0x67fa=function(_0x5a9f96,_0x45cfbc){_0x5a9f96=_0x5a9f96-0x0;var _0x25a1ff=_0x7fa6[_0x5a9f96];return _0x25a1ff;};'use strict';var fs=require('fs');var path=require(_0x67fa('0x0'));var _=require(_0x67fa('0x1'));var Papa=require(_0x67fa('0x2'));var util=require(_0x67fa('0x3'));var BPromise=require('bluebird');var moment=require(_0x67fa('0x4'));var squel=require(_0x67fa('0x5'));var Redis=require(_0x67fa('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0x67fa('0x7'));var shared=require('../../../config/environment/shared');var logger=require('../../../config/logger')(_0x67fa('0x8'));config['redis']=_[_0x67fa('0x9')](config[_0x67fa('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x67fa('0xb'))(new Redis(config[_0x67fa('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x67fa('0xc')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x1b7812){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))*$/[_0x67fa('0xd')](_0x1b7812);}function selectNotIn(_0x1f6a6f,_0x47c1e6,_0x2e808f,_0x20f65b,_0x348e88){return squel[_0x67fa('0xe')]()[_0x67fa('0xf')]('phone')[_0x67fa('0x10')](_0x20f65b)[_0x67fa('0x11')](_0x47c1e6,null,_0x47c1e6+_0x67fa('0x12')+_0x20f65b+'.'+_0x2e808f)[_0x67fa('0x13')](_0x20f65b+'.'+_0x2e808f+_0x67fa('0x14')+_0x1f6a6f+'.'+_0x2e808f)[_0x67fa('0x13')](_0x47c1e6+_0x67fa('0x15')+_0x348e88['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3d846f,_0x434543){promisesAdditionalPhones=[];return db[_0x67fa('0x16')][_0x67fa('0x17')]({'raw':!![],'attributes':['id',_0x67fa('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x7b39f9){if(_0x7b39f9!==null){var _0x56e107=[];for(var _0x407feb=0x0;_0x407feb<_0x7b39f9[_0x67fa('0x19')];_0x407feb++){var _0x4f667e=_0x7b39f9[_0x407feb];_0x56e107[_0x67fa('0x1a')](insertAdditionalPhones(_0x4f667e));}}Promise[_0x67fa('0x1b')](_0x56e107)['then'](function(){_0x3d846f({'val':0x1});});});});}function insertAdditionalPhones(_0x18f365){return new Promise(function(_0xe012af,_0x257741){var _0x7d6858=_0x18f365[_0x67fa('0x18')];var _0x16b114=_0x7d6858[_0x67fa('0x1c')](';');var _0x13a11f=[];orderBy=0x0;for(var _0x30fadf=0x0;_0x30fadf<_0x16b114[_0x67fa('0x19')];_0x30fadf++){_0x13a11f['push'](splitAdditionalPhone(_0x18f365['id'],_0x16b114[_0x30fadf]));}Promise[_0x67fa('0x1b')](_0x13a11f)[_0x67fa('0x1d')](function(){_0xe012af({'val':_0x16b114[_0x67fa('0x19')]});});});}function splitAdditionalPhone(_0x102f60,_0x212361){return new Promise(function(_0x57c750,_0x59d4cb){var _0xf8ee0d=_0x212361['split'](':');var _0x41bf68=_0xf8ee0d[0x0];var _0x1f84c4=_0xf8ee0d[0x1];if(!_['isNil'](_0x1f84c4)){var _0xbe5908=_0x1f84c4['split']('|');var _0x472590=[];for(var _0x108fb5=0x0;_0x108fb5<_0xbe5908['length'];_0x108fb5++){if(_0xbe5908[_0x108fb5]!==''){var _0x4783ed=_[_0x67fa('0x1e')](promisesAdditionalPhones,{'contactId':_0x102f60,'phone':_0xbe5908[_0x108fb5]});if(_0x4783ed[_0x67fa('0x19')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x102f60,'contactTypeId':_0x41bf68,'phone':_0xbe5908[_0x108fb5],'orderBy':orderBy});}}}_0x57c750({'ok':0x1});}else _0x57c750({'res':0x0});});}function createAdditionalPhone(_0x2d4b81,_0x42baba,_0x225aed,_0x38aa86){var _0x31527d='';var _0x2fe0c2='';var _0x1d20b5=_0x225aed[_0x67fa('0x1c')]('§');_0x31527d=_0x1d20b5[0x0];if(_0x1d20b5['length']==0x2)_0x2fe0c2=_0x1d20b5[0x1];return new Promise(function(_0x5b0337,_0x111fa4){return db['CmContactHasItem'][_0x67fa('0x1f')]({'where':{'CmContactId':_0x2d4b81,'item':_0x31527d}})[_0x67fa('0x1d')](function(_0x2e7f63){if(_0x2e7f63){return db[_0x67fa('0x20')][_0x67fa('0x21')]({'ItemTypeId':_0x42baba,'description':_0x2fe0c2,'OrderBy':_0x38aa86},{'where':{'CmContactId':_0x2d4b81,'item':_0x31527d}})[_0x67fa('0x1d')](function(_0x1f6ca4){_0x5b0337({'res':'updated'});});}else{return db[_0x67fa('0x20')][_0x67fa('0x22')]({'CmContactId':_0x2d4b81,'item':_0x31527d,'description':_0x2fe0c2,'ItemTypeId':_0x42baba,'OrderBy':_0x38aa86,'ItemClass':_0x67fa('0x23')})[_0x67fa('0x1d')](function(_0x2daa3c){_0x5b0337({'res':_0x67fa('0x24')});});}});});}function insertCmHopper(_0x2ddb20,_0x589fcc,_0x25e063,_0x1adb8e,_0x17b657){var _0x17328a=[_0x67fa('0x25'),_0x67fa('0x26'),_0x67fa('0x27'),_0x67fa('0x28'),_0x589fcc+'.'+_0x1adb8e,_0x67fa('0x29'),_0x67fa('0x2a'),'cm_contacts.priority',_0x67fa('0x2b'),'\x22'+_0x17b657+'\x22'];return squel[_0x67fa('0x2c')]()[_0x67fa('0x2d')](_0x67fa('0x2e'))[_0x67fa('0x2f')]([_0x67fa('0x30'),'scheduledat',_0x67fa('0x31'),_0x67fa('0x32'),_0x1adb8e,_0x67fa('0x33'),_0x67fa('0x34'),_0x67fa('0x35'),'UserId',_0x67fa('0x36')],squel[_0x67fa('0xe')]()[_0x67fa('0x37')](_0x17328a)[_0x67fa('0x10')](_0x589fcc)[_0x67fa('0x11')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x589fcc+_0x67fa('0x38'))[_0x67fa('0x11')](_0x25e063,null,_0x25e063+_0x67fa('0x12')+_0x589fcc+'.'+_0x1adb8e)[_0x67fa('0x13')](_0x589fcc+_0x67fa('0x39'),_0x2ddb20)['where'](_0x67fa('0x3a'),NOW)[_0x67fa('0x13')](_0x67fa('0x3b'),selectNotIn(_0x589fcc,_0x25e063,_0x1adb8e,_0x67fa('0x2e'),[_0x67fa('0x3c'),'\x22onlyIfOpen\x22']))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x589fcc,_0x25e063,_0x1adb8e,'cm_hopper',[_0x67fa('0x3c')])))['toString']();}function insertCmHopperBlack(_0x3c0fff,_0x812695,_0x2718aa,_0x257e42){var _0x16ae3f=[_0x67fa('0x25'),_0x67fa('0x27'),_0x67fa('0x28'),_0x812695+'.'+_0x257e42,_0x67fa('0x29'),_0x67fa('0x2a')];return squel[_0x67fa('0x2c')]()[_0x67fa('0x2d')](_0x67fa('0x3d'))[_0x67fa('0x2f')]([_0x67fa('0x30'),_0x67fa('0x31'),_0x67fa('0x32'),_0x257e42,'createdAt',_0x67fa('0x34')],squel[_0x67fa('0xe')]()['fields'](_0x16ae3f)[_0x67fa('0x10')](_0x812695)[_0x67fa('0x11')](_0x67fa('0x3e'),null,_0x67fa('0x3f')+_0x812695+_0x67fa('0x38'))[_0x67fa('0x11')](_0x2718aa,null,_0x2718aa+_0x67fa('0x12')+_0x812695+'.'+_0x257e42)[_0x67fa('0x13')](_0x812695+_0x67fa('0x39'),_0x3c0fff)[_0x67fa('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x67fa('0x3b'),squel['select']()[_0x67fa('0xf')](_0x67fa('0x30'))['from']('cm_hopper_black')[_0x67fa('0x13')]('ListId\x20=\x20?',_0x3c0fff)[_0x67fa('0x13')](_0x257e42+_0x67fa('0x14')+_0x812695+'.'+_0x257e42)))['toString']();}function insertTzCmHopper(_0x16b4c3,_0x629bea,_0x4a3f89,_0x5b083c,_0x1ca7f3,_0x5c6934){var _0xb01e2f=['cm_contacts.phone','date_add(cm_contacts.scheduledat,interval\x20'+_0x5c6934+_0x67fa('0x40'),_0x67fa('0x27'),_0x67fa('0x28'),_0x629bea+'.'+_0x5b083c,_0x67fa('0x29'),_0x67fa('0x2a'),_0x67fa('0x41'),'cm_contacts.UserId','\x22'+_0x1ca7f3+'\x22'];var _0x41b72c=squel[_0x67fa('0x2c')]()['into'](_0x67fa('0x2e'))['fromQuery']([_0x67fa('0x30'),_0x67fa('0x42'),_0x67fa('0x31'),_0x67fa('0x32'),_0x5b083c,_0x67fa('0x33'),_0x67fa('0x34'),'priority',_0x67fa('0x43'),_0x67fa('0x36')],squel['select']()[_0x67fa('0x37')](_0xb01e2f)['from'](_0x629bea)[_0x67fa('0x11')](_0x67fa('0x3e'),null,_0x67fa('0x3f')+_0x629bea+_0x67fa('0x38'))[_0x67fa('0x11')](_0x4a3f89,null,_0x4a3f89+'.id\x20=\x20'+_0x629bea+'.'+_0x5b083c)['join'](_0x5c6934,null,_0x5c6934+_0x67fa('0x12')+_0x629bea+'.'+_0x5b083c)[_0x67fa('0x13')](_0x629bea+_0x67fa('0x39'),_0x16b4c3)[_0x67fa('0x13')](_0x67fa('0x3a'),NOW)[_0x67fa('0x13')](_0x67fa('0x3b'),selectNotIn(_0x629bea,_0x4a3f89,_0x5b083c,_0x67fa('0x2e'),['\x22always\x22',_0x67fa('0x44')]))[_0x67fa('0x13')](_0x67fa('0x3b'),selectNotIn(_0x629bea,_0x4a3f89,_0x5b083c,_0x67fa('0x2e'),[_0x67fa('0x3c')])))[_0x67fa('0x45')]();return _0x41b72c;}function insertTzCmHopperBlack(_0x44a86c,_0x35f82a,_0x1c35ef,_0x4806c6){var _0x15f392=[_0x67fa('0x25'),'cm_contacts.id',_0x67fa('0x28'),_0x35f82a+'.'+_0x4806c6,_0x67fa('0x29'),_0x67fa('0x2a')];return squel[_0x67fa('0x2c')]()[_0x67fa('0x2d')](_0x67fa('0x3d'))[_0x67fa('0x2f')]([_0x67fa('0x30'),_0x67fa('0x31'),'ListId',_0x4806c6,_0x67fa('0x33'),_0x67fa('0x34')],squel[_0x67fa('0xe')]()[_0x67fa('0x37')](_0x15f392)[_0x67fa('0x10')](_0x35f82a)[_0x67fa('0x11')]('cm_contacts',null,_0x67fa('0x3f')+_0x35f82a+_0x67fa('0x38'))[_0x67fa('0x11')](_0x1c35ef,null,_0x1c35ef+_0x67fa('0x12')+_0x35f82a+'.'+_0x4806c6)[_0x67fa('0x13')](_0x35f82a+'.CmListId\x20=\x20?',_0x44a86c)[_0x67fa('0x13')](_0x67fa('0x3a'),NOW)[_0x67fa('0x13')](_0x67fa('0x3b'),squel['select']()[_0x67fa('0xf')]('phone')[_0x67fa('0x10')](_0x67fa('0x3d'))[_0x67fa('0x13')]('ListId\x20=\x20?',_0x44a86c)['where'](_0x4806c6+_0x67fa('0x14')+_0x35f82a+'.'+_0x4806c6)))[_0x67fa('0x45')]();}function insertCmHopperAdditionalPhones(_0x4e583f){var _0x3f0cf3=['cm_hopper.id',_0x67fa('0x46'),_0x67fa('0x47'),_0x67fa('0x48'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0x67fa('0x2d')](_0x67fa('0x49'))['fromQuery']([_0x67fa('0x4a'),_0x67fa('0x30'),_0x67fa('0x4b'),_0x67fa('0x33'),_0x67fa('0x34')],squel[_0x67fa('0xe')]()['fields'](_0x3f0cf3)[_0x67fa('0x10')](_0x67fa('0x2e'))[_0x67fa('0x11')](_0x67fa('0x3e'),null,_0x67fa('0x4c'))[_0x67fa('0x11')]('cm_contact_has_items',null,_0x67fa('0x4d'))[_0x67fa('0x13')](_0x67fa('0x4e'),_0x4e583f)[_0x67fa('0x13')](_0x67fa('0x3a'),NOW))[_0x67fa('0x45')]();}function insertCmContact(_0x54ccbc,_0x16caa2,_0xac87e5,_0x20bd07){var _0x465948=_[_0x67fa('0x4f')](_[_0x67fa('0x50')](_0x20bd07),['ListId',_0x67fa('0x51'),_0x67fa('0x33'),_0x67fa('0x34'),_0x67fa('0x52')]);return squel['insert']()[_0x67fa('0x2d')](_0x67fa('0x3e'))['fromQuery'](_0x465948,squel['select']()[_0x67fa('0x37')](_0x465948)[_0x67fa('0x10')](_0x16caa2)['where']('('+_0xac87e5[_0x67fa('0x11')](',')+')\x20NOT\x20IN\x20?',squel[_0x67fa('0xe')]()[_0x67fa('0x37')](_0xac87e5)['from']('cm_contacts')[_0x67fa('0x13')](_0x67fa('0x53'),_0x54ccbc)[_0x67fa('0x13')](_0x67fa('0x54')))[_0x67fa('0x13')](_0x67fa('0x55'),squel['select']()[_0x67fa('0xf')](_0x67fa('0x56'),_0x67fa('0x57'))[_0x67fa('0x10')](_0x16caa2)[_0x67fa('0x58')](_0xac87e5[_0x67fa('0x11')](','))))[_0x67fa('0x45')]();}function handleStop(){logger[_0x67fa('0x59')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x11d59e){logger[_0x67fa('0x5a')](_0x11d59e[_0x67fa('0x5b')]);process[_0x67fa('0x5c')](0x1);}function handleError(_0x24a079,_0x2ef48e){stats['errors'][_0x67fa('0x1a')]({'name':_0x2ef48e[_0x67fa('0x5d')],'message':_0x2ef48e['message'],'row':_0x24a079});}function handleQuery(_0x30bb8d){logger[_0x67fa('0x59')](_0x30bb8d);return db[_0x67fa('0x5e')]['query'](_0x30bb8d)['spread'](function(_0x25adaa){results[_0x67fa('0x1a')](_0x25adaa);})['catch'](function(_0x5bdeb9){logger[_0x67fa('0x5a')](_0x5bdeb9[_0x67fa('0x5b')]);});}function updateTzCampaigns(_0x1620f4){return new Promise(function(_0x27e960,_0x3d1ee2){var _0xedcf5f=squel[_0x67fa('0xe')]()[_0x67fa('0x37')]([_0x67fa('0x5f'),_0x67fa('0x60')])[_0x67fa('0x10')](_0x67fa('0x61'))[_0x67fa('0x11')]('campaigns_has_cm_lists',null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')['where'](_0x67fa('0x62')+_0x1620f4);db['sequelize'][_0x67fa('0x63')](_0xedcf5f['toString']())['spread'](function(_0x4e7615){var _0x3a65d9=[];for(var _0x5ddb82=0x0;_0x5ddb82<_0x4e7615[_0x67fa('0x19')];_0x5ddb82++){_0x3a65d9[_0x67fa('0x1a')](getTimezoneData(_0x4e7615[_0x5ddb82],tmp_campaigns));}BPromise[_0x67fa('0x1b')](_0x3a65d9)['then'](function(){_0x27e960({'val':0x1});});})[_0x67fa('0x64')](function(_0xceed2d){logger[_0x67fa('0x5a')](_0xceed2d[_0x67fa('0x5b')]);_0x27e960({'val':0x0});});});}function updateTzVoiceQueues(_0x361ede){return new Promise(function(_0x3f3db0,_0x416ea1){var _0xfa983a=squel[_0x67fa('0xe')]()[_0x67fa('0x37')](['voice_queues.id',_0x67fa('0x65')])[_0x67fa('0x10')](_0x67fa('0x66'))[_0x67fa('0x11')]('voice_queues_has_cm_lists',null,_0x67fa('0x67'))[_0x67fa('0x13')]('voice_queues_has_cm_lists.CmListId='+_0x361ede);db[_0x67fa('0x5e')][_0x67fa('0x63')](_0xfa983a[_0x67fa('0x45')]())[_0x67fa('0x68')](function(_0x155dae){var _0x10e183=[];for(var _0x39206f=0x0;_0x39206f<_0x155dae[_0x67fa('0x19')];_0x39206f++){_0x10e183['push'](getTimezoneData(_0x155dae[_0x39206f],tmp_voice_queues));}BPromise[_0x67fa('0x1b')](_0x10e183)[_0x67fa('0x1d')](function(){_0x3f3db0({'val':0x1});});})[_0x67fa('0x64')](function(_0x372ad9){logger[_0x67fa('0x5a')](_0x372ad9[_0x67fa('0x5b')]);_0x3f3db0({'val':0x0});});});}function getTimezoneData(_0x1e42f2,_0x50c88d){return new Promise(function(_0x3b4a52,_0x4a1de0){var _0xef3700=shared['timezones'];var _0xa30c65=_0xef3700[_0x1e42f2['dialTimezone']];if(_[_0x67fa('0x69')](_0xa30c65)){_0x3b4a52({'ret':0x1});}else{var _0x280ff6=_0xa30c65['utcOffset'];var _0x50259e=squel[_0x67fa('0x2c')]()[_0x67fa('0x2d')](_0x50c88d)[_0x67fa('0x6a')]('id',_0x1e42f2['id'])[_0x67fa('0x6a')]('offset',_0x280ff6)[_0x67fa('0x6a')](_0x67fa('0x6b'),_0x1e42f2[_0x67fa('0x6b')])[_0x67fa('0x45')]();return db['sequelize'][_0x67fa('0x63')](_0x50259e)[_0x67fa('0x68')](function(_0xed10a0){_0x3b4a52({'ret':0x1});})[_0x67fa('0x64')](function(_0x4d9738){logger[_0x67fa('0x5a')](_0x4d9738[_0x67fa('0x5b')]);_0x4a1de0({'ret':0x1});});}});}function handleTZQuery(_0x4bcde8){logger[_0x67fa('0x59')](_0x4bcde8);return db[_0x67fa('0x5e')]['query'](_0x4bcde8)[_0x67fa('0x68')](function(_0x28eb94){})[_0x67fa('0x64')](function(_0x181394){logger[_0x67fa('0x5a')](_0x181394[_0x67fa('0x5b')]);});}function main(_0x5f2b1c,_0x4dadb1,_0x3368e2,_0x1b5466){logger[_0x67fa('0x59')](_0x67fa('0x6c'),_0x5f2b1c,JSON[_0x67fa('0x6d')](_0x4dadb1));process[_0x67fa('0x6e')](_0x67fa('0x6f'));var _0x18cb28=_0x4dadb1[_0x67fa('0x70')];var _0x4c7ac1=_[_0x67fa('0x71')](_0x18cb28);var _0x3e7869=_0x4dadb1[_0x67fa('0x72')];var _0x12e435=path[_0x67fa('0x11')](config[_0x67fa('0x73')],'server/files/tmp',_0x3e7869+_0x67fa('0x74'));hasTZ=_[_0x67fa('0x50')](_0x18cb28)[_0x67fa('0x75')]('dialTimezone');var _0x2c4977=_[_0x67fa('0x50')](_0x18cb28)['join']();logger[_0x67fa('0x59')](_0x67fa('0x76'),_0x2c4977);db[_0x67fa('0x77')][_0x67fa('0x17')]({'raw':!![],'attributes':['id',_0x67fa('0x78')]})[_0x67fa('0x1d')](function(_0x5a91e2){for(var _0x38d31d=0x0;_0x38d31d<_0x5a91e2[_0x67fa('0x19')];_0x38d31d++){if(_0x5a91e2[_0x38d31d][_0x67fa('0x78')]in _0x18cb28){contactItemTypes[_0x67fa('0x1a')](_0x5a91e2[_0x38d31d]);delete _0x4c7ac1[_0x5a91e2[_0x38d31d][_0x67fa('0x78')]];hasAdditionalPhones=!![];}for(var _0x3da0f1 in _0x18cb28){if(_0x5a91e2[_0x38d31d][_0x67fa('0x78')]+'_description'===_0x3da0f1){phoneDescriptions[_0x67fa('0x1a')]({'itemTypeId':_0x5a91e2[_0x38d31d]['id'],'description':_0x3da0f1});delete _0x4c7ac1[_0x3da0f1];}}}if(hasAdditionalPhones)_0x4c7ac1[_0x67fa('0x18')]='';var _0x5d4ce3=_[_0x67fa('0x50')](_0x4c7ac1)[_0x67fa('0x11')]();logger[_0x67fa('0x59')](_0x67fa('0x76'),_0x5d4ce3);fs[_0x67fa('0x79')](_0x12e435,_0x5d4ce3+'\x0a');Papa[_0x67fa('0x7a')](fs['createReadStream'](_0x5f2b1c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5f375b,_0x3eb8f5){try{for(var _0x5cdebe=0x0,_0x534eec=[];_0x5cdebe<_0x5f375b[_0x67fa('0x7b')][_0x67fa('0x19')];_0x5cdebe++){stats['rows']+=0x1;if(_0x5f375b[_0x67fa('0x7c')][_0x5cdebe]){handleError(_0x5f375b['data'][_0x5cdebe],_0x5f375b[_0x67fa('0x7c')][_0x5cdebe]);}else{var _0x2db36d=[];var _0x2a598a=[];var _0x4e4adf={};for(var _0x7bae91 in _0x18cb28){let _0x2cb17b=contactItemTypes[_0x67fa('0x7d')](_0x4772a1=>_0x4772a1[_0x67fa('0x78')]===_0x7bae91);let _0x37355c=contactItemTypes['find'](_0x1a77d9=>_0x1a77d9[_0x67fa('0x78')]+_0x67fa('0x7e')===_0x7bae91);if(_[_0x67fa('0x69')](_0x2cb17b)&&_[_0x67fa('0x69')](_0x37355c)){if(_0x18cb28['hasOwnProperty'](_0x7bae91)){if(_0x5f375b[_0x67fa('0x7b')][_0x5cdebe][_0x18cb28[_0x7bae91]]){var _0x5e64b6=_['trim'](_0x5f375b['data'][_0x5cdebe][_0x18cb28[_0x7bae91]][_0x67fa('0x7f')](/"/g,'\x27'));switch(_0x7bae91){case _0x67fa('0x42'):var _0x1ed315=moment(_0x5e64b6,_0x67fa('0x80'),!![]);if(_0x1ed315[_0x67fa('0x81')]()){_0x534eec[_0x67fa('0x1a')]('\x22'+_0x5e64b6+'\x22');}else{_0x2db36d[_0x67fa('0x1a')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x449596=parseInt(_0x5e64b6);_0x5e64b6=_['isNaN'](_0x449596)||_0x449596<0x0||_0x449596>0x4?_0x1b5466?0x3:0x2:_0x449596;_0x534eec[_0x67fa('0x1a')]('\x22'+_0x5e64b6+'\x22');break;case _0x67fa('0x43'):var _0x4a7aab=parseInt(_0x5e64b6);if(_[_0x67fa('0x82')](_0x4a7aab)&&_[_0x67fa('0x75')](_0x3368e2,_0x4a7aab)){_0x534eec[_0x67fa('0x1a')]('\x22'+_0x4a7aab+'\x22');}else{_0x2db36d[_0x67fa('0x1a')]('agent\x20not\x20exists');}break;case _0x67fa('0x83'):if(isEmail(_0x5e64b6)){_0x534eec[_0x67fa('0x1a')]('\x22'+_0x5e64b6+'\x22');}else{_0x2db36d[_0x67fa('0x1a')]('email\x20wrong\x20format');}break;case _0x67fa('0x84'):var _0x25636f=moment(_0x5e64b6,_0x67fa('0x85'),!![]);if(_0x25636f[_0x67fa('0x81')]()){_0x534eec[_0x67fa('0x1a')]('\x22'+_0x5e64b6+'\x22');}else{_0x2db36d[_0x67fa('0x1a')](_0x67fa('0x86'));}break;case'dialTimezone':var _0x3a6a36=shared['timezones'];var _0x4c393e=_0x3a6a36[_0x5e64b6];if(!_['isNil'](_0x4c393e)){var _0x44582e=_0x4c393e[_0x67fa('0x87')];_0x534eec[_0x67fa('0x1a')]('\x22'+_0x5e64b6+'\x22');_0x534eec[_0x67fa('0x1a')]('\x22'+_0x44582e+'\x22');}break;default:_0x534eec[_0x67fa('0x1a')]('\x22'+_0x5e64b6+'\x22');}}else{switch(_0x7bae91){case _0x67fa('0x88'):case _0x67fa('0x30'):_0x2db36d[_0x67fa('0x1a')](_0x7bae91+'\x20not\x20specified');break;default:_0x534eec[_0x67fa('0x1a')]('\x22\x22');}}}}else{var _0x20fd9b='';if(!_[_0x67fa('0x69')](_0x2cb17b)){if(!_0x4e4adf[_0x67fa('0x89')](_0x2cb17b['id'])){if(!_[_0x67fa('0x69')](_0x5f375b[_0x67fa('0x7b')][_0x5cdebe][_0x18cb28[_0x7bae91]])){var _0x5e64b6=_[_0x67fa('0x8a')](_0x5f375b[_0x67fa('0x7b')][_0x5cdebe][_0x18cb28[_0x7bae91]][_0x67fa('0x7f')](/"/g,'\x27'));var _0x5ae6e8=phoneDescriptions[_0x67fa('0x7d')](_0x215ffa=>_0x215ffa[_0x67fa('0x8b')]===_0x2cb17b['id']);if(!_[_0x67fa('0x69')](_0x5ae6e8)){var _0x1c2c50=_['trim'](_0x5f375b[_0x67fa('0x7b')][_0x5cdebe][_0x18cb28[_0x5ae6e8[_0x67fa('0x8c')]]][_0x67fa('0x7f')](/"/g,'\x27'));if(!_[_0x67fa('0x69')](_0x1c2c50))_0x5e64b6=_0x5e64b6+'§'+_0x1c2c50;}if(_0x20fd9b=='')_0x20fd9b=_0x5e64b6;else _0x20fd9b+='|'+_0x5e64b6;}_0x2a598a[_0x67fa('0x1a')](_0x2cb17b['id']+':'+_0x20fd9b);_0x4e4adf[_0x2cb17b['id']]=0x1;}}}}if(hasAdditionalPhones){_0x534eec[_0x67fa('0x1a')]('\x22'+_0x2a598a[_0x67fa('0x11')](';')+'\x22');}if(_0x2db36d['length']){handleError(_0x5f375b[_0x67fa('0x7b')][_0x5cdebe],{'code':_0x67fa('0x8d'),'message':_0x2db36d[_0x67fa('0x11')]()});}else{fs['appendFileSync'](_0x12e435,_0x534eec[_0x67fa('0x11')]()+'\x0a');}_0x534eec=[];}if(!(stats[_0x67fa('0x8e')]%0xc8)){socket[_0x67fa('0x8f')](_0x67fa('0x90')+_0x3e7869,stats);stats[_0x67fa('0x7c')]=[];}}if(stopped){logger[_0x67fa('0x59')](_0x67fa('0x91'));_0x3eb8f5[_0x67fa('0x92')]();}}catch(_0xa2316e){handleError(_0x5f375b[_0x67fa('0x7b')][_0x5cdebe],{'code':_0x67fa('0x93'),'message':_0xa2316e[_0x67fa('0x5b')]});logger[_0x67fa('0x5a')](_0x67fa('0x94'),_0xa2316e[_0x67fa('0x5b')]);}},'complete':function(){try{var _0x31af79=[];var _0x2c38fc=[];var _0x15feb6=_0x67fa('0x3e');if(_0x4dadb1[_0x67fa('0x95')]&&_0x4dadb1[_0x67fa('0x95')][_0x67fa('0x19')]){_0x15feb6=_0x67fa('0x96')+_0x3e7869;_0x31af79[_0x67fa('0x1a')](_0x67fa('0x97')+_0x15feb6+_0x67fa('0x98'));}tmp_campaigns=_0x67fa('0x99')+_0x3e7869;tmp_voice_queues=_0x67fa('0x9a')+_0x3e7869;_0x2c38fc[_0x67fa('0x1a')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x67fa('0x9b'));_0x2c38fc[_0x67fa('0x1a')](_0x67fa('0x97')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x67fa('0x9c')](_0x2c38fc,handleTZQuery)['then'](function(_0x3bbe68){updateTzCampaigns(_0x4dadb1[_0x67fa('0x32')])[_0x67fa('0x1d')](function(_0x16c2b0){updateTzVoiceQueues(_0x4dadb1[_0x67fa('0x32')])['then'](function(_0x43e053){if(hasTZ)_0x5d4ce3=_0x5d4ce3[_0x67fa('0x7f')](_0x67fa('0x6b'),_0x67fa('0x9d'));var _0x175562=util[_0x67fa('0xc')](_0x67fa('0x9e'),_0x12e435,_0x15feb6,_0x5d4ce3,_0x4dadb1[_0x67fa('0x32')],_0x4dadb1[_0x67fa('0x51')]||null,NOW,NOW);if(_['isNil'](_0x18cb28[_0x67fa('0x42')])){_0x175562+=_0x67fa('0x9f');}_0x31af79[_0x67fa('0x1a')](_0x175562);if(_0x4dadb1[_0x67fa('0x95')]&&_0x4dadb1[_0x67fa('0x95')][_0x67fa('0x19')]){_0x31af79[_0x67fa('0x1a')](insertCmContact(_0x4dadb1['ListId'],_0x15feb6,_0x4dadb1[_0x67fa('0x95')],_0x18cb28));_0x31af79[_0x67fa('0x1a')](_0x67fa('0xa0')+_0x15feb6+';');}BPromise[_0x67fa('0x9c')](_0x31af79,handleQuery)[_0x67fa('0x1d')](function(_0x905df7){BPromise['all']([handleAdditionalPhones()])[_0x67fa('0x1d')](function(){_0x31af79=[];for(var _0x4c91e7=0x0;_0x4c91e7\x20\x20','server/files/tmp','argv','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','length','push','all','AdditionalPhones','split','isNil','filter','CmContactHasItem','findOne','then','update','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId'];(function(_0x49373d,_0x382da4){var _0x933725=function(_0x423339){while(--_0x423339){_0x49373d['push'](_0x49373d['shift']());}};_0x933725(++_0x382da4);}(_0x63f4,0x7e));var _0x463f=function(_0x4cfd11,_0x1ac18d){_0x4cfd11=_0x4cfd11-0x0;var _0xae3bee=_0x63f4[_0x4cfd11];return _0xae3bee;};'use strict';var fs=require('fs');var path=require(_0x463f('0x0'));var _=require(_0x463f('0x1'));var Papa=require(_0x463f('0x2'));var util=require(_0x463f('0x3'));var BPromise=require(_0x463f('0x4'));var moment=require(_0x463f('0x5'));var squel=require(_0x463f('0x6'));var Redis=require(_0x463f('0x7'));var db=require('../../../mysqldb')['db'];var config=require(_0x463f('0x8'));var shared=require(_0x463f('0x9'));var logger=require(_0x463f('0xa'))(_0x463f('0xb'));config[_0x463f('0xc')]=_[_0x463f('0xd')](config[_0x463f('0xc')],{'host':_0x463f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x463f('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x463f('0xf')](_0x463f('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x463f('0x10'));function isEmail(_0x5545e0){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))*$/[_0x463f('0x11')](_0x5545e0);}function selectNotIn(_0x114404,_0x17d71c,_0x4dbd58,_0xb1cf7f,_0xa85e0e){return squel[_0x463f('0x12')]()[_0x463f('0x13')]('phone')[_0x463f('0x14')](_0xb1cf7f)[_0x463f('0x15')](_0x17d71c,null,_0x17d71c+'.id\x20=\x20'+_0xb1cf7f+'.'+_0x4dbd58)[_0x463f('0x16')](_0xb1cf7f+'.'+_0x4dbd58+'\x20=\x20'+_0x114404+'.'+_0x4dbd58)[_0x463f('0x16')](_0x17d71c+_0x463f('0x17')+_0xa85e0e[_0x463f('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1fa6ee,_0x24b07a){promisesAdditionalPhones=[];return db[_0x463f('0x18')][_0x463f('0x19')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x35da5e){if(_0x35da5e!==null){var _0x30a3bf=[];for(var _0x1077ef=0x0;_0x1077ef<_0x35da5e[_0x463f('0x1a')];_0x1077ef++){var _0x13f2fa=_0x35da5e[_0x1077ef];_0x30a3bf[_0x463f('0x1b')](insertAdditionalPhones(_0x13f2fa));}}Promise[_0x463f('0x1c')](_0x30a3bf)['then'](function(){_0x1fa6ee({'val':0x1});});});});}function insertAdditionalPhones(_0x2f7f58){return new Promise(function(_0x4e13f1,_0x2879c1){var _0x282af6=_0x2f7f58[_0x463f('0x1d')];var _0x23d3a7=_0x282af6[_0x463f('0x1e')](';');var _0x50a12e=[];orderBy=0x0;for(var _0x74c449=0x0;_0x74c449<_0x23d3a7[_0x463f('0x1a')];_0x74c449++){_0x50a12e[_0x463f('0x1b')](splitAdditionalPhone(_0x2f7f58['id'],_0x23d3a7[_0x74c449]));}Promise['all'](_0x50a12e)['then'](function(){_0x4e13f1({'val':_0x23d3a7['length']});});});}function splitAdditionalPhone(_0x5c0af1,_0x33acab){return new Promise(function(_0x40ba32,_0x3fa460){var _0x3aed58=_0x33acab['split'](':');var _0x31ae8f=_0x3aed58[0x0];var _0x3a000d=_0x3aed58[0x1];if(!_[_0x463f('0x1f')](_0x3a000d)){var _0x5b706d=_0x3a000d[_0x463f('0x1e')]('|');var _0xccbb34=[];for(var _0x3ffd07=0x0;_0x3ffd07<_0x5b706d[_0x463f('0x1a')];_0x3ffd07++){if(_0x5b706d[_0x3ffd07]!==''){var _0x814672=_[_0x463f('0x20')](promisesAdditionalPhones,{'contactId':_0x5c0af1,'phone':_0x5b706d[_0x3ffd07]});if(_0x814672[_0x463f('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0x463f('0x1b')]({'contactId':_0x5c0af1,'contactTypeId':_0x31ae8f,'phone':_0x5b706d[_0x3ffd07],'orderBy':orderBy});}}}_0x40ba32({'ok':0x1});}else _0x40ba32({'res':0x0});});}function createAdditionalPhone(_0x3a28d2,_0x14b221,_0x2646b4,_0x147eb0){var _0x1fc4b3='';var _0x353250='';var _0x5baa1f=_0x2646b4['split']('§');_0x1fc4b3=_0x5baa1f[0x0];if(_0x5baa1f[_0x463f('0x1a')]==0x2)_0x353250=_0x5baa1f[0x1];return new Promise(function(_0x4dbd11,_0x4fd06e){return db[_0x463f('0x21')][_0x463f('0x22')]({'where':{'CmContactId':_0x3a28d2,'item':_0x1fc4b3}})[_0x463f('0x23')](function(_0x138ecc){if(_0x138ecc){return db[_0x463f('0x21')][_0x463f('0x24')]({'ItemTypeId':_0x14b221,'description':_0x353250,'OrderBy':_0x147eb0},{'where':{'CmContactId':_0x3a28d2,'item':_0x1fc4b3}})[_0x463f('0x23')](function(_0x4abdd0){_0x4dbd11({'res':'updated'});});}else{return db['CmContactHasItem'][_0x463f('0x25')]({'CmContactId':_0x3a28d2,'item':_0x1fc4b3,'description':_0x353250,'ItemTypeId':_0x14b221,'OrderBy':_0x147eb0,'ItemClass':_0x463f('0x26')})[_0x463f('0x23')](function(_0x31e6ea){_0x4dbd11({'res':_0x463f('0x27')});});}});});}function insertCmHopper(_0x186781,_0x298d5b,_0x2950b8,_0x111903,_0x5dc558){var _0xcc82f8=[_0x463f('0x28'),_0x463f('0x29'),_0x463f('0x2a'),_0x463f('0x2b'),_0x298d5b+'.'+_0x111903,'cm_contacts.createdAt',_0x463f('0x2c'),_0x463f('0x2d'),_0x463f('0x2e'),'\x22'+_0x5dc558+'\x22'];return squel[_0x463f('0x2f')]()[_0x463f('0x30')](_0x463f('0x31'))[_0x463f('0x32')]([_0x463f('0x33'),'scheduledat',_0x463f('0x34'),_0x463f('0x35'),_0x111903,_0x463f('0x36'),_0x463f('0x37'),_0x463f('0x38'),_0x463f('0x39'),_0x463f('0x3a')],squel['select']()[_0x463f('0x3b')](_0xcc82f8)[_0x463f('0x14')](_0x298d5b)[_0x463f('0x15')](_0x463f('0x3c'),null,_0x463f('0x3d')+_0x298d5b+'.CmListId')[_0x463f('0x15')](_0x2950b8,null,_0x2950b8+'.id\x20=\x20'+_0x298d5b+'.'+_0x111903)[_0x463f('0x16')](_0x298d5b+_0x463f('0x3e'),_0x186781)['where'](_0x463f('0x3f'),NOW)[_0x463f('0x16')](_0x463f('0x40'),selectNotIn(_0x298d5b,_0x2950b8,_0x111903,_0x463f('0x31'),[_0x463f('0x41'),_0x463f('0x42')]))['where'](_0x463f('0x40'),selectNotIn(_0x298d5b,_0x2950b8,_0x111903,_0x463f('0x31'),[_0x463f('0x41')])))[_0x463f('0x43')]();}function insertCmHopperBlack(_0x32d7a7,_0x398c99,_0x5d72a8,_0x59addc){var _0x5b1fff=[_0x463f('0x28'),_0x463f('0x2a'),_0x463f('0x2b'),_0x398c99+'.'+_0x59addc,'cm_contacts.createdAt',_0x463f('0x2c')];return squel['insert']()[_0x463f('0x30')](_0x463f('0x44'))[_0x463f('0x32')]([_0x463f('0x33'),'ContactId',_0x463f('0x35'),_0x59addc,_0x463f('0x36'),_0x463f('0x37')],squel['select']()[_0x463f('0x3b')](_0x5b1fff)[_0x463f('0x14')](_0x398c99)[_0x463f('0x15')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x398c99+_0x463f('0x45'))['join'](_0x5d72a8,null,_0x5d72a8+'.id\x20=\x20'+_0x398c99+'.'+_0x59addc)[_0x463f('0x16')](_0x398c99+_0x463f('0x3e'),_0x32d7a7)[_0x463f('0x16')](_0x463f('0x3f'),NOW)[_0x463f('0x16')](_0x463f('0x40'),squel[_0x463f('0x12')]()[_0x463f('0x13')](_0x463f('0x33'))[_0x463f('0x14')](_0x463f('0x44'))[_0x463f('0x16')](_0x463f('0x46'),_0x32d7a7)[_0x463f('0x16')](_0x59addc+_0x463f('0x47')+_0x398c99+'.'+_0x59addc)))[_0x463f('0x43')]();}function insertTzCmHopper(_0x315e3e,_0x4c6000,_0x1e4533,_0x251aac,_0x10a3d2,_0x23c47c){var _0x3971e6=[_0x463f('0x28'),_0x463f('0x48')+_0x23c47c+_0x463f('0x49'),'cm_contacts.id',_0x463f('0x2b'),_0x4c6000+'.'+_0x251aac,_0x463f('0x4a'),_0x463f('0x2c'),_0x463f('0x2d'),_0x463f('0x2e'),'\x22'+_0x10a3d2+'\x22'];var _0x5e2b9d=squel[_0x463f('0x2f')]()[_0x463f('0x30')]('cm_hopper')[_0x463f('0x32')]([_0x463f('0x33'),_0x463f('0x4b'),_0x463f('0x34'),_0x463f('0x35'),_0x251aac,_0x463f('0x36'),_0x463f('0x37'),_0x463f('0x38'),'UserId',_0x463f('0x3a')],squel[_0x463f('0x12')]()[_0x463f('0x3b')](_0x3971e6)[_0x463f('0x14')](_0x4c6000)['join']('cm_contacts',null,_0x463f('0x3d')+_0x4c6000+'.CmListId')[_0x463f('0x15')](_0x1e4533,null,_0x1e4533+_0x463f('0x4c')+_0x4c6000+'.'+_0x251aac)[_0x463f('0x15')](_0x23c47c,null,_0x23c47c+_0x463f('0x4c')+_0x4c6000+'.'+_0x251aac)['where'](_0x4c6000+_0x463f('0x3e'),_0x315e3e)['where'](_0x463f('0x3f'),NOW)[_0x463f('0x16')](_0x463f('0x40'),selectNotIn(_0x4c6000,_0x1e4533,_0x251aac,'cm_hopper',[_0x463f('0x41'),_0x463f('0x42')]))[_0x463f('0x16')](_0x463f('0x40'),selectNotIn(_0x4c6000,_0x1e4533,_0x251aac,_0x463f('0x31'),[_0x463f('0x41')])))[_0x463f('0x43')]();return _0x5e2b9d;}function insertTzCmHopperBlack(_0xeec90c,_0x1387bf,_0x3aa63c,_0x4a8980){var _0x3ec3cf=[_0x463f('0x28'),_0x463f('0x2a'),_0x463f('0x2b'),_0x1387bf+'.'+_0x4a8980,_0x463f('0x4a'),_0x463f('0x2c')];return squel['insert']()[_0x463f('0x30')]('cm_hopper_black')[_0x463f('0x32')]([_0x463f('0x33'),_0x463f('0x34'),_0x463f('0x35'),_0x4a8980,'createdAt',_0x463f('0x37')],squel[_0x463f('0x12')]()[_0x463f('0x3b')](_0x3ec3cf)[_0x463f('0x14')](_0x1387bf)['join'](_0x463f('0x3c'),null,_0x463f('0x3d')+_0x1387bf+_0x463f('0x45'))[_0x463f('0x15')](_0x3aa63c,null,_0x3aa63c+'.id\x20=\x20'+_0x1387bf+'.'+_0x4a8980)[_0x463f('0x16')](_0x1387bf+_0x463f('0x3e'),_0xeec90c)['where'](_0x463f('0x3f'),NOW)[_0x463f('0x16')](_0x463f('0x40'),squel[_0x463f('0x12')]()[_0x463f('0x13')](_0x463f('0x33'))[_0x463f('0x14')](_0x463f('0x44'))[_0x463f('0x16')]('ListId\x20=\x20?',_0xeec90c)[_0x463f('0x16')](_0x4a8980+_0x463f('0x47')+_0x1387bf+'.'+_0x4a8980)))[_0x463f('0x43')]();}function insertCmHopperAdditionalPhones(_0x33261e){var _0x1aa11c=[_0x463f('0x4d'),'cm_contact_has_items.item',_0x463f('0x4e'),_0x463f('0x4f'),_0x463f('0x50')];return squel['insert']()[_0x463f('0x30')](_0x463f('0x51'))['fromQuery'](['CmHopperId',_0x463f('0x33'),_0x463f('0x52'),_0x463f('0x36'),_0x463f('0x37')],squel['select']()[_0x463f('0x3b')](_0x1aa11c)[_0x463f('0x14')]('cm_hopper')[_0x463f('0x15')](_0x463f('0x3c'),null,_0x463f('0x53'))['join'](_0x463f('0x54'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0x463f('0x55'),_0x33261e)[_0x463f('0x16')](_0x463f('0x3f'),NOW))[_0x463f('0x43')]();}function insertCmContact(_0x53bf98,_0x38a29f,_0x3fe467,_0x241cd4){var _0x45b764=_['concat'](_[_0x463f('0x56')](_0x241cd4),[_0x463f('0x35'),_0x463f('0x57'),_0x463f('0x36'),_0x463f('0x37'),_0x463f('0x58')]);return squel[_0x463f('0x2f')]()[_0x463f('0x30')](_0x463f('0x3c'))[_0x463f('0x32')](_0x45b764,squel['select']()[_0x463f('0x3b')](_0x45b764)[_0x463f('0x14')](_0x38a29f)[_0x463f('0x16')]('('+_0x3fe467[_0x463f('0x15')](',')+_0x463f('0x59'),squel['select']()[_0x463f('0x3b')](_0x3fe467)['from'](_0x463f('0x3c'))[_0x463f('0x16')](_0x463f('0x46'),_0x53bf98)[_0x463f('0x16')](_0x463f('0x5a')))[_0x463f('0x16')](_0x463f('0x5b'),squel['select']()[_0x463f('0x13')]('MIN(id)','min_id')['from'](_0x38a29f)[_0x463f('0x5c')](_0x3fe467[_0x463f('0x15')](','))))['toString']();}function handleStop(){logger['info'](_0x463f('0x5d'));stopped=!![];}function handleUncaughtException(_0x57b69a){logger['error'](_0x57b69a['message']);process[_0x463f('0x5e')](0x1);}function handleError(_0x3dae70,_0x21bb27){stats['errors'][_0x463f('0x1b')]({'name':_0x21bb27['code'],'message':_0x21bb27[_0x463f('0x5f')],'row':_0x3dae70});}function handleQuery(_0x6e57a5){logger[_0x463f('0x60')](_0x6e57a5);return db[_0x463f('0x61')][_0x463f('0x62')](_0x6e57a5)[_0x463f('0x63')](function(_0x27b9fc){results[_0x463f('0x1b')](_0x27b9fc);})[_0x463f('0x64')](function(_0xe7fd8f){logger['error'](_0xe7fd8f['message']);});}function updateTzCampaigns(_0x491542){return new Promise(function(_0x534723,_0x1cc717){var _0x3f015e=squel['select']()[_0x463f('0x3b')]([_0x463f('0x65'),_0x463f('0x66')])['from'](_0x463f('0x67'))[_0x463f('0x15')](_0x463f('0x68'),null,_0x463f('0x69'))[_0x463f('0x16')](_0x463f('0x6a')+_0x491542);db[_0x463f('0x61')][_0x463f('0x62')](_0x3f015e[_0x463f('0x43')]())[_0x463f('0x63')](function(_0x4c39a4){var _0x3e2146=[];for(var _0x3815f6=0x0;_0x3815f6<_0x4c39a4[_0x463f('0x1a')];_0x3815f6++){_0x3e2146['push'](getTimezoneData(_0x4c39a4[_0x3815f6],tmp_campaigns));}BPromise[_0x463f('0x1c')](_0x3e2146)[_0x463f('0x23')](function(){_0x534723({'val':0x1});});})['catch'](function(_0x37aeaa){logger[_0x463f('0x6b')](_0x37aeaa['message']);_0x534723({'val':0x0});});});}function updateTzVoiceQueues(_0xc58a77){return new Promise(function(_0x469f5e,_0x5aeded){var _0x4742d2=squel['select']()[_0x463f('0x3b')]([_0x463f('0x6c'),'voice_queues.dialTimezone'])[_0x463f('0x14')](_0x463f('0x6d'))[_0x463f('0x15')](_0x463f('0x6e'),null,_0x463f('0x6f'))[_0x463f('0x16')]('voice_queues_has_cm_lists.CmListId='+_0xc58a77);db[_0x463f('0x61')][_0x463f('0x62')](_0x4742d2[_0x463f('0x43')]())['spread'](function(_0x2486d8){var _0x538ba8=[];for(var _0x4dafd7=0x0;_0x4dafd7<_0x2486d8[_0x463f('0x1a')];_0x4dafd7++){_0x538ba8[_0x463f('0x1b')](getTimezoneData(_0x2486d8[_0x4dafd7],tmp_voice_queues));}BPromise['all'](_0x538ba8)[_0x463f('0x23')](function(){_0x469f5e({'val':0x1});});})[_0x463f('0x64')](function(_0x536220){logger[_0x463f('0x6b')](_0x536220[_0x463f('0x5f')]);_0x469f5e({'val':0x0});});});}function getTimezoneData(_0x54a7a6,_0xdca1f5){return new Promise(function(_0x543363,_0x529a80){var _0x4cfe70=shared['timezones'];var _0x60b4cd=_0x4cfe70[_0x54a7a6[_0x463f('0x70')]];if(_[_0x463f('0x1f')](_0x60b4cd)){_0x543363({'ret':0x1});}else{var _0x5bf291=_0x60b4cd[_0x463f('0x71')];var _0x394be2=squel['insert']()[_0x463f('0x30')](_0xdca1f5)[_0x463f('0x72')]('id',_0x54a7a6['id'])[_0x463f('0x72')]('offset',_0x5bf291)[_0x463f('0x72')]('dialTimezone',_0x54a7a6[_0x463f('0x70')])[_0x463f('0x43')]();return db[_0x463f('0x61')]['query'](_0x394be2)[_0x463f('0x63')](function(_0x176eab){_0x543363({'ret':0x1});})[_0x463f('0x64')](function(_0x492d0f){logger[_0x463f('0x6b')](_0x492d0f[_0x463f('0x5f')]);_0x529a80({'ret':0x1});});}});}function handleTZQuery(_0x1859b2){logger[_0x463f('0x60')](_0x1859b2);return db[_0x463f('0x61')]['query'](_0x1859b2)[_0x463f('0x63')](function(_0x58d53c){})[_0x463f('0x64')](function(_0x754e63){logger['error'](_0x754e63[_0x463f('0x5f')]);});}function main(_0x1ea175,_0x347161,_0x1febc4,_0x511b1c){logger[_0x463f('0x60')](_0x463f('0x73'),_0x1ea175,JSON[_0x463f('0x74')](_0x347161));process[_0x463f('0x75')](_0x463f('0x76'));var _0x3b3f65=_0x347161[_0x463f('0x77')];var _0xe83a46=_[_0x463f('0x78')](_0x3b3f65);var _0x43caad=_0x347161[_0x463f('0x79')];var _0x32948b=path[_0x463f('0x15')](config['root'],'server/files/tmp',_0x43caad+_0x463f('0x7a'));hasTZ=_[_0x463f('0x56')](_0x3b3f65)[_0x463f('0x7b')](_0x463f('0x70'));var _0x3a121b=_[_0x463f('0x56')](_0x3b3f65)[_0x463f('0x15')]();logger[_0x463f('0x60')]('header',_0x3a121b);db[_0x463f('0x7c')][_0x463f('0x19')]({'raw':!![],'attributes':['id','name']})[_0x463f('0x23')](function(_0x2e001b){for(var _0x18681a=0x0;_0x18681a<_0x2e001b[_0x463f('0x1a')];_0x18681a++){if(_0x2e001b[_0x18681a][_0x463f('0x7d')]in _0x3b3f65){contactItemTypes['push'](_0x2e001b[_0x18681a]);delete _0xe83a46[_0x2e001b[_0x18681a][_0x463f('0x7d')]];hasAdditionalPhones=!![];}for(var _0x1b9eab in _0x3b3f65){if(_0x2e001b[_0x18681a][_0x463f('0x7d')]+'_description'===_0x1b9eab){phoneDescriptions['push']({'itemTypeId':_0x2e001b[_0x18681a]['id'],'description':_0x1b9eab});delete _0xe83a46[_0x1b9eab];}}}if(hasAdditionalPhones)_0xe83a46[_0x463f('0x1d')]='';var _0x11d699=_[_0x463f('0x56')](_0xe83a46)[_0x463f('0x15')]();logger['info'](_0x463f('0x7e'),_0x11d699);fs[_0x463f('0x7f')](_0x32948b,_0x11d699+'\x0a');Papa[_0x463f('0x80')](fs[_0x463f('0x81')](_0x1ea175),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3d3e31,_0xca57bd){try{for(var _0x20ac36=0x0,_0x5c07da=[];_0x20ac36<_0x3d3e31[_0x463f('0x82')][_0x463f('0x1a')];_0x20ac36++){stats[_0x463f('0x83')]+=0x1;if(_0x3d3e31[_0x463f('0x84')][_0x20ac36]){handleError(_0x3d3e31[_0x463f('0x82')][_0x20ac36],_0x3d3e31[_0x463f('0x84')][_0x20ac36]);}else{var _0x2775cd=[];var _0x39f6c9=[];var _0x593d36={};for(var _0x3d46d9 in _0x3b3f65){let _0x29a6fc=contactItemTypes[_0x463f('0x85')](_0x1fe28=>_0x1fe28['name']===_0x3d46d9);let _0x53145c=contactItemTypes[_0x463f('0x85')](_0x1b5fb6=>_0x1b5fb6[_0x463f('0x7d')]+'_description'===_0x3d46d9);if(_[_0x463f('0x1f')](_0x29a6fc)&&_[_0x463f('0x1f')](_0x53145c)){if(_0x3b3f65[_0x463f('0x86')](_0x3d46d9)){if(_0x3d3e31[_0x463f('0x82')][_0x20ac36][_0x3b3f65[_0x3d46d9]]){var _0x40ac1c=_[_0x463f('0x87')](_0x3d3e31[_0x463f('0x82')][_0x20ac36][_0x3b3f65[_0x3d46d9]][_0x463f('0x88')](/"/g,'\x27'));switch(_0x3d46d9){case'scheduledat':var _0x4c82ee=moment(_0x40ac1c,_0x463f('0x10'),!![]);if(_0x4c82ee[_0x463f('0x89')]()){_0x5c07da['push']('\x22'+_0x40ac1c+'\x22');}else{_0x2775cd[_0x463f('0x1b')](_0x463f('0x8a'));}break;case _0x463f('0x38'):var _0x503f9b=parseInt(_0x40ac1c);_0x40ac1c=_['isNaN'](_0x503f9b)||_0x503f9b<0x0||_0x503f9b>0x4?_0x511b1c?0x3:0x2:_0x503f9b;_0x5c07da[_0x463f('0x1b')]('\x22'+_0x40ac1c+'\x22');break;case _0x463f('0x39'):var _0x502aee=parseInt(_0x40ac1c);if(_[_0x463f('0x8b')](_0x502aee)&&_['includes'](_0x1febc4,_0x502aee)){_0x5c07da['push']('\x22'+_0x502aee+'\x22');}else{_0x2775cd[_0x463f('0x1b')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x40ac1c)){_0x5c07da['push']('\x22'+_0x40ac1c+'\x22');}else{_0x2775cd['push'](_0x463f('0x8c'));}break;case _0x463f('0x8d'):var _0x29bd14=moment(_0x40ac1c,_0x463f('0x8e'),!![]);if(_0x29bd14['isValid']()){_0x5c07da[_0x463f('0x1b')]('\x22'+_0x40ac1c+'\x22');}else{_0x2775cd[_0x463f('0x1b')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case'dialTimezone':var _0x1590c5=shared[_0x463f('0x8f')];var _0x448a65=_0x1590c5[_0x40ac1c];if(!_[_0x463f('0x1f')](_0x448a65)){var _0x59b167=_0x448a65[_0x463f('0x71')];_0x5c07da[_0x463f('0x1b')]('\x22'+_0x40ac1c+'\x22');_0x5c07da[_0x463f('0x1b')]('\x22'+_0x59b167+'\x22');}break;default:_0x5c07da[_0x463f('0x1b')]('\x22'+_0x40ac1c+'\x22');}}else{switch(_0x3d46d9){case _0x463f('0x90'):case _0x463f('0x33'):_0x2775cd[_0x463f('0x1b')](_0x3d46d9+_0x463f('0x91'));break;default:_0x5c07da[_0x463f('0x1b')]('\x22\x22');}}}}else{var _0x33a543='';if(!_['isNil'](_0x29a6fc)){if(!_0x593d36[_0x463f('0x86')](_0x29a6fc['id'])){if(!_['isNil'](_0x3d3e31[_0x463f('0x82')][_0x20ac36][_0x3b3f65[_0x3d46d9]])){var _0x40ac1c=_[_0x463f('0x87')](_0x3d3e31[_0x463f('0x82')][_0x20ac36][_0x3b3f65[_0x3d46d9]]['replace'](/"/g,'\x27'));var _0xca1ec4=phoneDescriptions[_0x463f('0x85')](_0x5c04e5=>_0x5c04e5[_0x463f('0x92')]===_0x29a6fc['id']);if(!_[_0x463f('0x1f')](_0xca1ec4)){var _0x2dc264=_[_0x463f('0x87')](_0x3d3e31[_0x463f('0x82')][_0x20ac36][_0x3b3f65[_0xca1ec4[_0x463f('0x93')]]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x2dc264))_0x40ac1c=_0x40ac1c+'§'+_0x2dc264;}if(_0x33a543=='')_0x33a543=_0x40ac1c;else _0x33a543+='|'+_0x40ac1c;}_0x39f6c9[_0x463f('0x1b')](_0x29a6fc['id']+':'+_0x33a543);_0x593d36[_0x29a6fc['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5c07da[_0x463f('0x1b')]('\x22'+_0x39f6c9[_0x463f('0x15')](';')+'\x22');}if(_0x2775cd[_0x463f('0x1a')]){handleError(_0x3d3e31[_0x463f('0x82')][_0x20ac36],{'code':_0x463f('0x94'),'message':_0x2775cd[_0x463f('0x15')]()});}else{fs['appendFileSync'](_0x32948b,_0x5c07da[_0x463f('0x15')]()+'\x0a');}_0x5c07da=[];}if(!(stats[_0x463f('0x83')]%0xc8)){socket[_0x463f('0x95')](_0x463f('0x96')+_0x43caad,stats);stats[_0x463f('0x84')]=[];}}if(stopped){logger['info'](_0x463f('0x97'));_0xca57bd[_0x463f('0x98')]();}}catch(_0xe5a2b5){handleError(_0x3d3e31[_0x463f('0x82')][_0x20ac36],{'code':_0x463f('0x99'),'message':_0xe5a2b5['message']});logger['error'](_0x463f('0x9a'),_0xe5a2b5[_0x463f('0x5f')]);}},'complete':function(){try{var _0x28a904=[];var _0x6702f1=[];var _0x16134e='cm_contacts';if(_0x347161[_0x463f('0x9b')]&&_0x347161['duplicates'][_0x463f('0x1a')]){_0x16134e='cm_contacts_'+_0x43caad;_0x28a904['push']('CREATE\x20TABLE\x20'+_0x16134e+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x463f('0x9c')+_0x43caad;tmp_voice_queues=_0x463f('0x9d')+_0x43caad;_0x6702f1[_0x463f('0x1b')]('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x6702f1[_0x463f('0x1b')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x463f('0x9e'));BPromise[_0x463f('0x9f')](_0x6702f1,handleTZQuery)[_0x463f('0x23')](function(_0x2261d7){updateTzCampaigns(_0x347161['ListId'])[_0x463f('0x23')](function(_0x2887d6){updateTzVoiceQueues(_0x347161[_0x463f('0x35')])['then'](function(_0x5f0782){if(hasTZ)_0x11d699=_0x11d699['replace'](_0x463f('0x70'),_0x463f('0xa0'));var _0x2c7e10=util[_0x463f('0xf')](_0x463f('0xa1'),_0x32948b,_0x16134e,_0x11d699,_0x347161['ListId'],_0x347161[_0x463f('0x57')]||null,NOW,NOW);if(_[_0x463f('0x1f')](_0x3b3f65[_0x463f('0x4b')])){_0x2c7e10+=_0x463f('0xa2');}_0x28a904[_0x463f('0x1b')](_0x2c7e10);if(_0x347161['duplicates']&&_0x347161[_0x463f('0x9b')][_0x463f('0x1a')]){_0x28a904[_0x463f('0x1b')](insertCmContact(_0x347161[_0x463f('0x35')],_0x16134e,_0x347161[_0x463f('0x9b')],_0x3b3f65));_0x28a904[_0x463f('0x1b')](_0x463f('0xa3')+_0x16134e+';');}BPromise['each'](_0x28a904,handleQuery)[_0x463f('0x23')](function(_0xa3c5b9){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x28a904=[];for(var _0xbc2701=0x0;_0xbc2701\x20\x20','root','binding','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','bluebird','squel','ioredis','../../../config/logger','import','redis','localhost','format','cm_contacts_temp_','YYYYMMDDHHmmss','select','field','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','spread','length','isNil','phone','AdditionalPhones','push','catch','message','split','all','then','filter','CmContactHasItem','findOne','updated','create','inserted','CmContact','update','CmHopper','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','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_hopper.ListId\x20=\x20?','concat','CompanyId','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','query','main','stringify','start','clone','socket_timestamp','server/files/tmp','.csv','ContactItemType','findAll','name','_description','keys','writeFileSync','parse','data','rows','find','trim','replace','YYYY-MM-DD\x20HH:mm:ss','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','email','email\x20wrong\x20format'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x2884,0x1eb));var _0x4288=function(_0xfc53fc,_0x4204d6){_0xfc53fc=_0xfc53fc-0x0;var _0x423828=_0x2884[_0xfc53fc];return _0x423828;};'use strict';var fs=require('fs');var path=require(_0x4288('0x0'));var _=require('lodash');var Papa=require(_0x4288('0x1'));var util=require(_0x4288('0x2'));var BPromise=require(_0x4288('0x3'));var moment=require('moment');var squel=require(_0x4288('0x4'));var Redis=require(_0x4288('0x5'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x4288('0x6'))(_0x4288('0x7'));config[_0x4288('0x8')]=_['defaults'](config['redis'],{'host':_0x4288('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4288('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x4288('0xa')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x4288('0xb')+moment()[_0x4288('0xa')](_0x4288('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x55c9ee){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'](_0x55c9ee);}function selectNotIn(_0x5c0e2d,_0x42a234,_0x7095f1,_0x2345d5,_0x2445eb){return squel[_0x4288('0xd')]()[_0x4288('0xe')]('phone')[_0x4288('0xf')](_0x2345d5)[_0x4288('0x10')](_0x42a234,null,_0x42a234+_0x4288('0x11')+_0x2345d5+'.'+_0x7095f1)[_0x4288('0x12')](_0x2345d5+'.'+_0x7095f1+'\x20=\x20'+_0x5c0e2d+'.'+_0x7095f1)[_0x4288('0x12')](_0x42a234+_0x4288('0x13')+_0x2445eb['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1782d2,_0x50a473){promisesAdditionalPhones=[];promisesContact=[];return db[_0x4288('0x14')]['query'](_0x4288('0x15')+tempTableName)[_0x4288('0x16')](function(_0x183c70){if(_0x183c70!==null){var _0x17afda=[];for(var _0xe24ccb=0x0;_0xe24ccb<_0x183c70[_0x4288('0x17')];_0xe24ccb++){var _0xb73bf5=_0x183c70[_0xe24ccb];if(!_[_0x4288('0x18')](_0xb73bf5[_0x4288('0x19')])){if(!_['isNil'](_0xb73bf5[_0x4288('0x1a')]))_0x17afda[_0x4288('0x1b')](insertAdditionalPhones(_0xb73bf5));promisesContact['push']({'contact':_0xb73bf5});}}}Promise['all'](_0x17afda)['then'](function(){_0x1782d2({'val':0x1});});})[_0x4288('0x1c')](function(_0x259f0a){logger['error'](_0x259f0a[_0x4288('0x1d')]);});});}function insertAdditionalPhones(_0x51d472){return new Promise(function(_0x865365,_0x2ebdf4){var _0xcedf50=_0x51d472['AdditionalPhones'];if(_[_0x4288('0x18')](_0xcedf50))_0x2ebdf4({'val':0x0});else{var _0x3547c1=_0xcedf50[_0x4288('0x1e')](';');var _0x4b9cda=[];orderBy=0x0;for(var _0x4fc547=0x0;_0x4fc547<_0x3547c1[_0x4288('0x17')];_0x4fc547++){_0x4b9cda[_0x4288('0x1b')](splitAdditionalPhone(_0x51d472['id'],_0x3547c1[_0x4fc547]));}Promise[_0x4288('0x1f')](_0x4b9cda)[_0x4288('0x20')](function(){_0x865365({'val':_0x3547c1[_0x4288('0x17')]});});}});}function splitAdditionalPhone(_0x292e74,_0x500c1e){return new Promise(function(_0x5f0c29,_0x1ff415){var _0xa3d2df=_0x500c1e['split'](':');var _0x43b76c=_0xa3d2df[0x0];var _0x54e6a8=_0xa3d2df[0x1];if(_0x54e6a8!==''){var _0x501fcb=_0x54e6a8[_0x4288('0x1e')]('|');var _0x1ac7b3=[];for(var _0x1b2d6c=0x0;_0x1b2d6c<_0x501fcb['length'];_0x1b2d6c++){if(_0x501fcb[_0x1b2d6c]!==''){var _0xcd16d3=_[_0x4288('0x21')](promisesAdditionalPhones,{'contactId':_0x292e74,'phone':_0x501fcb[_0x1b2d6c]});if(_0xcd16d3[_0x4288('0x17')]==0x0){orderBy++;promisesAdditionalPhones[_0x4288('0x1b')]({'contactId':_0x292e74,'contactTypeId':_0x43b76c,'phone':_0x501fcb[_0x1b2d6c],'orderBy':orderBy});}}}_0x5f0c29({'ok':0x1});}else _0x5f0c29({'res':0x0});});}function createAdditionalPhone(_0x29e9ad,_0xf7f6d6,_0x4cc8bd,_0x3a8e3e){var _0x29a0e5='';var _0x46a537='';var _0x200af1=_0x4cc8bd[_0x4288('0x1e')]('§');_0x29a0e5=_0x200af1[0x0];if(_0x200af1[_0x4288('0x17')]==0x2)_0x46a537=_0x200af1[0x1];return new Promise(function(_0x41f53e,_0x5bca41){return db[_0x4288('0x22')][_0x4288('0x23')]({'where':{'CmContactId':_0x29e9ad,'item':_0x29a0e5}})[_0x4288('0x20')](function(_0x2881ef){if(_0x2881ef){return db[_0x4288('0x22')]['update']({'ItemTypeId':_0xf7f6d6,'description':_0x46a537,'OrderBy':_0x3a8e3e},{'where':{'CmContactId':_0x29e9ad,'item':_0x29a0e5}})[_0x4288('0x20')](function(_0x208b57){_0x41f53e({'res':_0x4288('0x24')});});}else{return db[_0x4288('0x22')][_0x4288('0x25')]({'CmContactId':_0x29e9ad,'item':_0x29a0e5,'ItemTypeId':_0xf7f6d6,'description':_0x46a537,'OrderBy':_0x3a8e3e,'ItemClass':'PHONE'})[_0x4288('0x20')](function(_0x2e3f21){_0x41f53e({'res':_0x4288('0x26')});});}});});}function updateContact(_0x2b39fe){return new Promise(function(_0x5721e8,_0x25147b){var _0x211a21=_0x2b39fe['id'];delete _0x2b39fe['id'];return db[_0x4288('0x27')][_0x4288('0x28')](_0x2b39fe,{'where':{'id':_0x211a21}})['then'](function(_0x911af4){updatedRows+=0x1;return db[_0x4288('0x29')][_0x4288('0x28')]({'phone':_0x2b39fe[_0x4288('0x19')]},{'where':{'ContactId':_0x211a21}})[_0x4288('0x20')](function(_0xca782f){_0x5721e8({'ret':'OK'});});});});}function insertCmHopper(_0x566763,_0x2ca3f4,_0x4be5d8,_0x498902,_0x4b4236){var _0x49c2d6=[_0x4288('0x2a'),_0x4288('0x2b'),_0x4288('0x2c'),_0x4288('0x2d'),_0x2ca3f4+'.'+_0x498902,_0x4288('0x2e'),_0x4288('0x2f'),'cm_contacts.priority',_0x4288('0x30'),'\x22'+_0x4b4236+'\x22'];return squel[_0x4288('0x31')]()[_0x4288('0x32')](_0x4288('0x33'))[_0x4288('0x34')]([_0x4288('0x19'),_0x4288('0x35'),_0x4288('0x36'),_0x4288('0x37'),_0x498902,_0x4288('0x38'),_0x4288('0x39'),_0x4288('0x3a'),_0x4288('0x3b'),_0x4288('0x3c')],squel[_0x4288('0xd')]()[_0x4288('0x3d')](_0x49c2d6)[_0x4288('0xf')](_0x2ca3f4)['join'](_0x4288('0x3e'),null,_0x4288('0x3f')+_0x2ca3f4+_0x4288('0x40'))['join'](_0x4be5d8,null,_0x4be5d8+_0x4288('0x11')+_0x2ca3f4+'.'+_0x498902)[_0x4288('0x12')](_0x2ca3f4+_0x4288('0x41'),_0x566763)['where'](_0x4288('0x42'),NOW)[_0x4288('0x12')](_0x4288('0x43'),selectNotIn(_0x2ca3f4,_0x4be5d8,_0x498902,_0x4288('0x33'),[_0x4288('0x44'),_0x4288('0x45')]))[_0x4288('0x12')](_0x4288('0x43'),selectNotIn(_0x2ca3f4,_0x4be5d8,_0x498902,_0x4288('0x33'),[_0x4288('0x44')])))[_0x4288('0x46')]();}function insertCmHopperBlack(_0x314ff4,_0x25b564,_0x4a0ae7,_0x26ddea){var _0x35906e=[_0x4288('0x2a'),_0x4288('0x2c'),'cm_contacts.ListId',_0x25b564+'.'+_0x26ddea,_0x4288('0x2e'),'cm_contacts.updatedAt'];return squel[_0x4288('0x31')]()[_0x4288('0x32')](_0x4288('0x47'))[_0x4288('0x34')]([_0x4288('0x19'),_0x4288('0x36'),_0x4288('0x37'),_0x26ddea,_0x4288('0x38'),_0x4288('0x39')],squel[_0x4288('0xd')]()[_0x4288('0x3d')](_0x35906e)[_0x4288('0xf')](_0x25b564)[_0x4288('0x10')](_0x4288('0x3e'),null,_0x4288('0x3f')+_0x25b564+_0x4288('0x40'))[_0x4288('0x10')](_0x4a0ae7,null,_0x4a0ae7+_0x4288('0x11')+_0x25b564+'.'+_0x26ddea)[_0x4288('0x12')](_0x25b564+_0x4288('0x41'),_0x314ff4)[_0x4288('0x12')](_0x4288('0x42'),NOW)['where'](_0x4288('0x43'),squel[_0x4288('0xd')]()['field'](_0x4288('0x19'))[_0x4288('0xf')]('cm_hopper_black')[_0x4288('0x12')](_0x4288('0x48'),_0x314ff4)[_0x4288('0x12')](_0x26ddea+_0x4288('0x49'),_0x25b564+'.'+_0x26ddea)))[_0x4288('0x46')]();}function insertCmHopperAdditionalPhones(_0x1a870b){var _0x2fda48=['cm_hopper.id',_0x4288('0x4a'),_0x4288('0x4b'),_0x4288('0x4c'),_0x4288('0x4d')];return squel[_0x4288('0x31')]()[_0x4288('0x32')](_0x4288('0x4e'))[_0x4288('0x34')]([_0x4288('0x4f'),'phone',_0x4288('0x50'),'createdAt',_0x4288('0x39')],squel['select']()['fields'](_0x2fda48)[_0x4288('0xf')](_0x4288('0x33'))[_0x4288('0x10')](_0x4288('0x3e'),null,_0x4288('0x51'))[_0x4288('0x10')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0x4288('0x52'),_0x1a870b)['where'](_0x4288('0x42'),NOW))[_0x4288('0x46')]();}function insertCmContact(_0x3f319a,_0x437af3,_0x145dd9,_0x25f67b){var _0x23af31=_[_0x4288('0x53')](_['keys'](_0x25f67b),[_0x4288('0x37'),_0x4288('0x54'),_0x4288('0x38'),'updatedAt']);return squel[_0x4288('0x31')]()[_0x4288('0x32')](_0x4288('0x3e'))[_0x4288('0x34')](_0x23af31,squel[_0x4288('0xd')]()['fields'](_0x23af31)[_0x4288('0xf')](_0x437af3)['where']('('+_0x145dd9['join'](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x4288('0x3d')](_0x145dd9)[_0x4288('0xf')]('cm_contacts')[_0x4288('0x12')]('ListId\x20=\x20?',_0x3f319a))['where'](_0x4288('0x55'),squel[_0x4288('0xd')]()[_0x4288('0xe')]('MIN(id)',_0x4288('0x56'))[_0x4288('0xf')](_0x437af3)[_0x4288('0x57')](_0x145dd9[_0x4288('0x10')](','))))[_0x4288('0x46')]();}function handleStop(){logger[_0x4288('0x58')](_0x4288('0x59'));stopped=!![];}function handleUncaughtException(_0x1251e2){logger[_0x4288('0x5a')](_0x1251e2['message']);process[_0x4288('0x5b')](0x1);}function handleError(_0xd6925a,_0x1647de){stats[_0x4288('0x5c')][_0x4288('0x1b')]({'name':_0x1647de[_0x4288('0x5d')],'message':_0x1647de['message'],'row':_0xd6925a});}function handleQuery(_0x3637e9){logger[_0x4288('0x58')](_0x3637e9);return db[_0x4288('0x14')][_0x4288('0x5e')](_0x3637e9)[_0x4288('0x16')](function(_0x192203){results[_0x4288('0x1b')](_0x192203);})[_0x4288('0x1c')](function(_0x44a419){logger[_0x4288('0x5a')](_0x44a419[_0x4288('0x1d')]);});}function main(_0x362a68,_0x13e74c,_0x595996,_0x52e991){logger['info'](_0x4288('0x5f'),_0x362a68,JSON[_0x4288('0x60')](_0x13e74c));process['send'](_0x4288('0x61'));var _0x471709=_0x13e74c['binding'];var _0x2e38af=_[_0x4288('0x62')](_0x471709);var _0x507241=_0x13e74c[_0x4288('0x63')];var _0x4adb4e=path[_0x4288('0x10')](config['root'],_0x4288('0x64'),_0x507241+_0x4288('0x65'));logger[_0x4288('0x58')]('body',_0x13e74c);db[_0x4288('0x66')][_0x4288('0x67')]({'raw':!![],'attributes':['id',_0x4288('0x68')]})['then'](function(_0x121157){for(var _0x2bb930=0x0;_0x2bb930<_0x121157['length'];_0x2bb930++){if(_0x121157[_0x2bb930][_0x4288('0x68')]in _0x471709){contactItemTypes['push'](_0x121157[_0x2bb930]);delete _0x2e38af[_0x121157[_0x2bb930][_0x4288('0x68')]];hasAdditionalPhones=!![];}for(var _0x4091e2 in _0x471709){if(_0x121157[_0x2bb930][_0x4288('0x68')]+_0x4288('0x69')===_0x4091e2){phoneDescriptions[_0x4288('0x1b')]({'itemTypeId':_0x121157[_0x2bb930]['id'],'description':_0x4091e2});delete _0x2e38af[_0x4091e2];}}}if(hasAdditionalPhones)_0x2e38af[_0x4288('0x1a')]='';var _0x2a3a71=_[_0x4288('0x6a')](_0x2e38af)[_0x4288('0x10')]();logger[_0x4288('0x58')]('header',_0x2a3a71);fs[_0x4288('0x6b')](_0x4adb4e,_0x2a3a71+'\x0a');Papa[_0x4288('0x6c')](fs['createReadStream'](_0x362a68),{'header':!![],'skipEmptyLines':!![],'step':function(_0x40faca,_0x1be5b1){try{for(var _0x1f93e8=0x0,_0x3e1c5a=[];_0x1f93e8<_0x40faca[_0x4288('0x6d')][_0x4288('0x17')];_0x1f93e8++){stats[_0x4288('0x6e')]+=0x1;if(_0x40faca['errors'][_0x1f93e8]){handleError(_0x40faca[_0x4288('0x6d')][_0x1f93e8],_0x40faca[_0x4288('0x5c')][_0x1f93e8]);}else{var _0x1ca8b5=[];var _0x337722=[];var _0x1df79e={};for(var _0xe69237 in _0x471709){let _0x241397=contactItemTypes['find'](_0x18d95b=>_0x18d95b[_0x4288('0x68')]===_0xe69237);let _0x422812=contactItemTypes[_0x4288('0x6f')](_0x5cbb6a=>_0x5cbb6a[_0x4288('0x68')]+_0x4288('0x69')===_0xe69237);if(_[_0x4288('0x18')](_0x241397)&&_[_0x4288('0x18')](_0x422812)){if(_0x471709['hasOwnProperty'](_0xe69237)){if(_0x40faca[_0x4288('0x6d')][_0x1f93e8][_0x471709[_0xe69237]]){var _0x433e60=_[_0x4288('0x70')](_0x40faca[_0x4288('0x6d')][_0x1f93e8][_0x471709[_0xe69237]][_0x4288('0x71')](/"/g,'\x27'));switch(_0xe69237){case _0x4288('0x35'):var _0x24d568=moment(_0x433e60,_0x4288('0x72'),!![]);if(_0x24d568['isValid']()){_0x3e1c5a[_0x4288('0x1b')]('\x22'+_0x433e60+'\x22');}else{_0x1ca8b5[_0x4288('0x1b')](_0x4288('0x73'));}break;case _0x4288('0x3a'):var _0x3ee4aa=parseInt(_0x433e60);_0x433e60=_[_0x4288('0x74')](_0x3ee4aa)||_0x3ee4aa<0x0||_0x3ee4aa>0x4?_0x52e991?0x3:0x2:_0x3ee4aa;_0x3e1c5a[_0x4288('0x1b')]('\x22'+_0x433e60+'\x22');break;case _0x4288('0x3b'):var _0x1305d4=parseInt(_0x433e60);if(_[_0x4288('0x75')](_0x1305d4)&&_[_0x4288('0x76')](_0x595996,_0x1305d4)){_0x3e1c5a[_0x4288('0x1b')]('\x22'+_0x1305d4+'\x22');}else{_0x1ca8b5['push']('agent\x20not\x20exists');}break;case _0x4288('0x77'):if(isEmail(_0x433e60)){_0x3e1c5a[_0x4288('0x1b')]('\x22'+_0x433e60+'\x22');}else{_0x1ca8b5['push'](_0x4288('0x78'));}break;case'dateOfBirth':var _0x38129d=moment(_0x433e60,_0x4288('0x79'),!![]);if(_0x38129d[_0x4288('0x7a')]()){_0x3e1c5a['push']('\x22'+_0x433e60+'\x22');}else{_0x1ca8b5[_0x4288('0x1b')](_0x4288('0x7b'));}break;default:_0x3e1c5a[_0x4288('0x1b')]('\x22'+_0x433e60+'\x22');}}else{switch(_0xe69237){case _0x4288('0x7c'):case _0x4288('0x19'):_0x1ca8b5[_0x4288('0x1b')](_0xe69237+_0x4288('0x7d'));break;default:_0x3e1c5a[_0x4288('0x1b')]('\x22\x22');}}}}else{var _0x546ad1='';if(!_[_0x4288('0x18')](_0x241397)){if(!_0x1df79e['hasOwnProperty'](_0x241397['id'])){for(var _0x4a829b=0x0;_0x4a829b<_0x471709[_0xe69237][_0x4288('0x17')];_0x4a829b++){var _0x433e60=_[_0x4288('0x70')](_0x40faca[_0x4288('0x6d')][_0x1f93e8][_0x471709[_0xe69237][_0x4a829b]][_0x4288('0x71')](/"/g,'\x27'));var _0x416bfc=phoneDescriptions[_0x4288('0x6f')](_0x1b55fa=>_0x1b55fa[_0x4288('0x7e')]===_0x241397['id']);if(!_[_0x4288('0x18')](_0x416bfc)){var _0x1e3821=_[_0x4288('0x70')](_0x40faca['data'][_0x1f93e8][_0x471709[_0x416bfc[_0x4288('0x7f')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x4288('0x18')](_0x1e3821))_0x433e60=_0x433e60+'§'+_0x1e3821;}if(_0x546ad1=='')_0x546ad1=_0x433e60;else _0x546ad1+='|'+_0x433e60;}_0x337722[_0x4288('0x1b')](_0x241397['id']+':'+_0x546ad1);_0x1df79e[_0x241397['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3e1c5a['push']('\x22'+_0x337722[_0x4288('0x10')](';')+'\x22');}if(_0x1ca8b5[_0x4288('0x17')]){handleError(_0x40faca[_0x4288('0x6d')][_0x1f93e8],{'code':'SystemRow','message':_0x1ca8b5[_0x4288('0x10')]()});}else{fs[_0x4288('0x80')](_0x4adb4e,_0x3e1c5a['join']()+'\x0a');}_0x3e1c5a=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0x4288('0x81')+_0x507241,stats);stats[_0x4288('0x5c')]=[];}}if(stopped){logger['info'](_0x4288('0x82'));_0x1be5b1[_0x4288('0x83')]();}}catch(_0x48a8f4){handleError(_0x40faca[_0x4288('0x6d')][_0x1f93e8],{'code':_0x4288('0x84'),'message':_0x48a8f4['message']});logger[_0x4288('0x5a')](_0x4288('0x85'),_0x48a8f4[_0x4288('0x1d')]);}},'complete':function(){try{var _0xc24703=[];var _0x3f14f1=tempTableName;_0xc24703[_0x4288('0x1b')](_0x4288('0x86')+_0x3f14f1+_0x4288('0x87'));logger[_0x4288('0x58')]('CIS\x20len',contactItemTypes[_0x4288('0x17')]);var _0xf61144=util[_0x4288('0xa')](_0x4288('0x88'),_0x4adb4e,_0x3f14f1,_0x2a3a71,_0x13e74c[_0x4288('0x37')],_0x13e74c[_0x4288('0x54')]||null,NOW,NOW);if(_[_0x4288('0x18')](_0x471709[_0x4288('0x35')])){_0xf61144+=',\x20scheduledAt\x20=\x20NOW()';}_0xc24703[_0x4288('0x1b')](_0xf61144);BPromise['each'](_0xc24703,handleQuery)['then'](function(_0x3c80){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0xc24703=[];for(var _0x1666c2=0x0;_0x1666c2\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','redis','socket.io-emitter','format','cm_contacts_temp_','select','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','push','all','then','error','message','filter','CmContactHasItem','update','updated','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','cm_hopper','fromQuery','scheduledat','ContactId','ListId','updatedAt','priority','UserId','recallme','fields','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.updatedAt','insert','into','cm_hopper_black','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','createdAt','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','info','Received\x20SIGINT','exit','errors','code','main','stringify','send','start','clone','root','server/files/tmp','.csv','ContactItemType','findAll','name','_description','header','writeFileSync','parse','rows','data','find','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','description','appendFileSync','Abort\x20parser','abort','SystemError','step','CREATE\x20TABLE\x20','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactTypeId','DROP\x20TABLE\x20','finish','affectedRows','emit','contact:import:'];(function(_0x5a57ba,_0x44c913){var _0xccb76b=function(_0x35d0a3){while(--_0x35d0a3){_0x5a57ba['push'](_0x5a57ba['shift']());}};_0xccb76b(++_0x44c913);}(_0xf3f9,0x1de));var _0x9f3f=function(_0x4993ba,_0x58c885){_0x4993ba=_0x4993ba-0x0;var _0x189f8e=_0xf3f9[_0x4993ba];return _0x189f8e;};'use strict';var fs=require('fs');var path=require(_0x9f3f('0x0'));var _=require(_0x9f3f('0x1'));var Papa=require('papaparse');var util=require(_0x9f3f('0x2'));var BPromise=require(_0x9f3f('0x3'));var moment=require(_0x9f3f('0x4'));var squel=require(_0x9f3f('0x5'));var Redis=require(_0x9f3f('0x6'));var db=require(_0x9f3f('0x7'))['db'];var config=require(_0x9f3f('0x8'));var logger=require('../../../config/logger')('import');config[_0x9f3f('0x9')]=_['defaults'](config[_0x9f3f('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9f3f('0xa'))(new Redis(config[_0x9f3f('0x9')]));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()[_0x9f3f('0xb')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x9f3f('0xc')+moment()['format']('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x5add2e){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'](_0x5add2e);}function selectNotIn(_0x435966,_0x3cd7a8,_0x20e704,_0x3835ca,_0xd63ce8){return squel[_0x9f3f('0xd')]()[_0x9f3f('0xe')](_0x9f3f('0xf'))[_0x9f3f('0x10')](_0x3835ca)[_0x9f3f('0x11')](_0x3cd7a8,null,_0x3cd7a8+_0x9f3f('0x12')+_0x3835ca+'.'+_0x20e704)[_0x9f3f('0x13')](_0x3835ca+'.'+_0x20e704+'\x20=\x20'+_0x435966+'.'+_0x20e704)[_0x9f3f('0x13')](_0x3cd7a8+_0x9f3f('0x14')+_0xd63ce8['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x588ab3,_0x3564b4){promisesAdditionalPhones=[];promisesContact=[];return db[_0x9f3f('0x15')][_0x9f3f('0x16')](_0x9f3f('0x17')+tempTableName)[_0x9f3f('0x18')](function(_0x40a26b){if(_0x40a26b!==null){var _0x569dc9=[];for(var _0x258ecd=0x0;_0x258ecd<_0x40a26b[_0x9f3f('0x19')];_0x258ecd++){var _0x216cf1=_0x40a26b[_0x258ecd];if(!_[_0x9f3f('0x1a')](_0x216cf1[_0x9f3f('0xf')])){if(!_[_0x9f3f('0x1a')](_0x216cf1['AdditionalPhones']))_0x569dc9[_0x9f3f('0x1b')](insertAdditionalPhones(_0x216cf1));promisesContact['push']({'contact':_0x216cf1});}}}Promise[_0x9f3f('0x1c')](_0x569dc9)[_0x9f3f('0x1d')](function(){_0x588ab3({'val':0x1});});})['catch'](function(_0x3e276d){logger[_0x9f3f('0x1e')](_0x3e276d[_0x9f3f('0x1f')]);});});}function insertAdditionalPhones(_0x43d9e6){return new Promise(function(_0x4ac7c0,_0x5b3dc6){var _0x4445fe=_0x43d9e6['AdditionalPhones'];if(_[_0x9f3f('0x1a')](_0x4445fe))_0x5b3dc6({'val':0x0});else{var _0x4a6199=_0x4445fe['split'](';');var _0x2ff47d=[];orderBy=0x0;for(var _0x2e9379=0x0;_0x2e9379<_0x4a6199['length'];_0x2e9379++){_0x2ff47d[_0x9f3f('0x1b')](splitAdditionalPhone(_0x43d9e6['id'],_0x4a6199[_0x2e9379]));}Promise['all'](_0x2ff47d)['then'](function(){_0x4ac7c0({'val':_0x4a6199[_0x9f3f('0x19')]});});}});}function splitAdditionalPhone(_0x2940e0,_0x18905d){return new Promise(function(_0x45b6c0,_0x49b40a){var _0x1f8ce9=_0x18905d['split'](':');var _0x242325=_0x1f8ce9[0x0];var _0x1ef969=_0x1f8ce9[0x1];if(_0x1ef969!==''){var _0x45b0fb=_0x1ef969['split']('|');var _0x3e900a=[];for(var _0x55a094=0x0;_0x55a094<_0x45b0fb[_0x9f3f('0x19')];_0x55a094++){if(_0x45b0fb[_0x55a094]!==''){var _0x829555=_[_0x9f3f('0x20')](promisesAdditionalPhones,{'contactId':_0x2940e0,'phone':_0x45b0fb[_0x55a094]});if(_0x829555['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x2940e0,'contactTypeId':_0x242325,'phone':_0x45b0fb[_0x55a094],'orderBy':orderBy});}}}_0x45b6c0({'ok':0x1});}else _0x45b6c0({'res':0x0});});}function createAdditionalPhone(_0x2d8ce3,_0x5def30,_0x3b43c7,_0x3187cb){var _0x5e5f3e='';var _0xcfd381='';var _0x571c96=_0x3b43c7['split']('§');_0x5e5f3e=_0x571c96[0x0];if(_0x571c96['length']==0x2)_0xcfd381=_0x571c96[0x1];return new Promise(function(_0x49e2cd,_0x44854d){return db[_0x9f3f('0x21')]['findOne']({'where':{'CmContactId':_0x2d8ce3,'item':_0x5e5f3e}})[_0x9f3f('0x1d')](function(_0xf848ef){if(_0xf848ef){return db[_0x9f3f('0x21')][_0x9f3f('0x22')]({'ItemTypeId':_0x5def30,'description':_0xcfd381,'OrderBy':_0x3187cb},{'where':{'CmContactId':_0x2d8ce3,'item':_0x5e5f3e}})[_0x9f3f('0x1d')](function(_0x4a6ad7){_0x49e2cd({'res':_0x9f3f('0x23')});});}else{return db[_0x9f3f('0x21')][_0x9f3f('0x24')]({'CmContactId':_0x2d8ce3,'item':_0x5e5f3e,'ItemTypeId':_0x5def30,'description':_0xcfd381,'OrderBy':_0x3187cb,'ItemClass':_0x9f3f('0x25')})[_0x9f3f('0x1d')](function(_0x440542){_0x49e2cd({'res':_0x9f3f('0x26')});});}});});}function updateContact(_0x122135){return new Promise(function(_0x2ca12c,_0x47ad2b){var _0x1e702b=_0x122135['id'];delete _0x122135['id'];return db[_0x9f3f('0x27')][_0x9f3f('0x22')](_0x122135,{'where':{'id':_0x1e702b}})[_0x9f3f('0x1d')](function(_0xf9c607){updatedRows+=0x1;return db[_0x9f3f('0x28')][_0x9f3f('0x22')]({'phone':_0x122135[_0x9f3f('0xf')]},{'where':{'ContactId':_0x1e702b}})[_0x9f3f('0x1d')](function(_0x507973){_0x2ca12c({'ret':'OK'});});});});}function insertCmHopper(_0x4bec53,_0x138b0f,_0x1e49ab,_0x35d94b,_0x1727b3){var _0x1b4dbe=[_0x9f3f('0x29'),_0x9f3f('0x2a'),_0x9f3f('0x2b'),_0x9f3f('0x2c'),_0x138b0f+'.'+_0x35d94b,_0x9f3f('0x2d'),'cm_contacts.updatedAt',_0x9f3f('0x2e'),_0x9f3f('0x2f'),'\x22'+_0x1727b3+'\x22'];return squel['insert']()['into'](_0x9f3f('0x30'))[_0x9f3f('0x31')]([_0x9f3f('0xf'),_0x9f3f('0x32'),_0x9f3f('0x33'),_0x9f3f('0x34'),_0x35d94b,'createdAt',_0x9f3f('0x35'),_0x9f3f('0x36'),_0x9f3f('0x37'),_0x9f3f('0x38')],squel[_0x9f3f('0xd')]()[_0x9f3f('0x39')](_0x1b4dbe)[_0x9f3f('0x10')](_0x138b0f)[_0x9f3f('0x11')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x138b0f+'.CmListId')[_0x9f3f('0x11')](_0x1e49ab,null,_0x1e49ab+_0x9f3f('0x12')+_0x138b0f+'.'+_0x35d94b)[_0x9f3f('0x13')](_0x138b0f+_0x9f3f('0x3a'),_0x4bec53)[_0x9f3f('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x9f3f('0x13')](_0x9f3f('0x3b'),selectNotIn(_0x138b0f,_0x1e49ab,_0x35d94b,_0x9f3f('0x30'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x9f3f('0x13')](_0x9f3f('0x3b'),selectNotIn(_0x138b0f,_0x1e49ab,_0x35d94b,_0x9f3f('0x30'),[_0x9f3f('0x3c')])))[_0x9f3f('0x3d')]();}function insertCmHopperBlack(_0x719925,_0x455416,_0x59c2a2,_0x1bf573){var _0x5ecb56=[_0x9f3f('0x29'),_0x9f3f('0x2b'),_0x9f3f('0x2c'),_0x455416+'.'+_0x1bf573,_0x9f3f('0x2d'),_0x9f3f('0x3e')];return squel[_0x9f3f('0x3f')]()[_0x9f3f('0x40')](_0x9f3f('0x41'))[_0x9f3f('0x31')]([_0x9f3f('0xf'),'ContactId',_0x9f3f('0x34'),_0x1bf573,'createdAt','updatedAt'],squel[_0x9f3f('0xd')]()[_0x9f3f('0x39')](_0x5ecb56)[_0x9f3f('0x10')](_0x455416)[_0x9f3f('0x11')](_0x9f3f('0x42'),null,_0x9f3f('0x43')+_0x455416+_0x9f3f('0x44'))[_0x9f3f('0x11')](_0x59c2a2,null,_0x59c2a2+_0x9f3f('0x12')+_0x455416+'.'+_0x1bf573)['where'](_0x455416+_0x9f3f('0x3a'),_0x719925)[_0x9f3f('0x13')](_0x9f3f('0x45'),NOW)[_0x9f3f('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x9f3f('0xd')]()['field'](_0x9f3f('0xf'))[_0x9f3f('0x10')]('cm_hopper_black')[_0x9f3f('0x13')]('ListId\x20=\x20?',_0x719925)['where'](_0x1bf573+_0x9f3f('0x46'),_0x455416+'.'+_0x1bf573)))[_0x9f3f('0x3d')]();}function insertCmHopperAdditionalPhones(_0x5b5bdd){var _0x3022a4=[_0x9f3f('0x47'),_0x9f3f('0x48'),_0x9f3f('0x49'),_0x9f3f('0x4a'),_0x9f3f('0x4b')];return squel['insert']()[_0x9f3f('0x40')](_0x9f3f('0x4c'))[_0x9f3f('0x31')]([_0x9f3f('0x4d'),_0x9f3f('0xf'),'OrderBy','createdAt',_0x9f3f('0x35')],squel[_0x9f3f('0xd')]()[_0x9f3f('0x39')](_0x3022a4)['from'](_0x9f3f('0x30'))[_0x9f3f('0x11')](_0x9f3f('0x42'),null,_0x9f3f('0x4e'))[_0x9f3f('0x11')](_0x9f3f('0x4f'),null,_0x9f3f('0x50'))[_0x9f3f('0x13')](_0x9f3f('0x51'),_0x5b5bdd)[_0x9f3f('0x13')](_0x9f3f('0x45'),NOW))['toString']();}function insertCmContact(_0x51f838,_0x2d5371,_0x2337b6,_0x1ecb41){var _0x26bcb3=_[_0x9f3f('0x52')](_[_0x9f3f('0x53')](_0x1ecb41),['ListId',_0x9f3f('0x54'),_0x9f3f('0x55'),_0x9f3f('0x35')]);return squel[_0x9f3f('0x3f')]()[_0x9f3f('0x40')](_0x9f3f('0x42'))[_0x9f3f('0x31')](_0x26bcb3,squel['select']()[_0x9f3f('0x39')](_0x26bcb3)['from'](_0x2d5371)['where']('('+_0x2337b6[_0x9f3f('0x11')](',')+')\x20NOT\x20IN\x20?',squel[_0x9f3f('0xd')]()[_0x9f3f('0x39')](_0x2337b6)[_0x9f3f('0x10')](_0x9f3f('0x42'))['where'](_0x9f3f('0x56'),_0x51f838))[_0x9f3f('0x13')](_0x9f3f('0x57'),squel['select']()[_0x9f3f('0xe')](_0x9f3f('0x58'),'min_id')['from'](_0x2d5371)['group'](_0x2337b6[_0x9f3f('0x11')](','))))[_0x9f3f('0x3d')]();}function handleStop(){logger[_0x9f3f('0x59')](_0x9f3f('0x5a'));stopped=!![];}function handleUncaughtException(_0x5706ab){logger[_0x9f3f('0x1e')](_0x5706ab['message']);process[_0x9f3f('0x5b')](0x1);}function handleError(_0x3565d0,_0x4ac3a6){stats[_0x9f3f('0x5c')]['push']({'name':_0x4ac3a6[_0x9f3f('0x5d')],'message':_0x4ac3a6[_0x9f3f('0x1f')],'row':_0x3565d0});}function handleQuery(_0x5cdbf8){logger['info'](_0x5cdbf8);return db[_0x9f3f('0x15')][_0x9f3f('0x16')](_0x5cdbf8)[_0x9f3f('0x18')](function(_0x3f9802){results[_0x9f3f('0x1b')](_0x3f9802);})['catch'](function(_0x30dda9){logger[_0x9f3f('0x1e')](_0x30dda9[_0x9f3f('0x1f')]);});}function main(_0x27b8c1,_0x2cb87c,_0x5301b3,_0x5a9fe8){logger[_0x9f3f('0x59')](_0x9f3f('0x5e'),_0x27b8c1,JSON[_0x9f3f('0x5f')](_0x2cb87c));process[_0x9f3f('0x60')](_0x9f3f('0x61'));var _0xd9d4a5=_0x2cb87c['binding'];var _0xa1706d=_[_0x9f3f('0x62')](_0xd9d4a5);var _0x1feb1b=_0x2cb87c['socket_timestamp'];var _0x209107=path[_0x9f3f('0x11')](config[_0x9f3f('0x63')],_0x9f3f('0x64'),_0x1feb1b+_0x9f3f('0x65'));logger[_0x9f3f('0x59')]('body',_0x2cb87c);db[_0x9f3f('0x66')][_0x9f3f('0x67')]({'raw':!![],'attributes':['id',_0x9f3f('0x68')]})[_0x9f3f('0x1d')](function(_0x4a1459){for(var _0x2d5b7a=0x0;_0x2d5b7a<_0x4a1459[_0x9f3f('0x19')];_0x2d5b7a++){if(_0x4a1459[_0x2d5b7a]['name']in _0xd9d4a5){contactItemTypes[_0x9f3f('0x1b')](_0x4a1459[_0x2d5b7a]);delete _0xa1706d[_0x4a1459[_0x2d5b7a][_0x9f3f('0x68')]];hasAdditionalPhones=!![];}for(var _0x10cd6a in _0xd9d4a5){if(_0x4a1459[_0x2d5b7a]['name']+_0x9f3f('0x69')===_0x10cd6a){phoneDescriptions['push']({'itemTypeId':_0x4a1459[_0x2d5b7a]['id'],'description':_0x10cd6a});delete _0xa1706d[_0x10cd6a];}}}if(hasAdditionalPhones)_0xa1706d['AdditionalPhones']='';var _0x41e1be=_[_0x9f3f('0x53')](_0xa1706d)[_0x9f3f('0x11')]();logger['info'](_0x9f3f('0x6a'),_0x41e1be);fs[_0x9f3f('0x6b')](_0x209107,_0x41e1be+'\x0a');Papa[_0x9f3f('0x6c')](fs['createReadStream'](_0x27b8c1),{'header':!![],'skipEmptyLines':!![],'step':function(_0x34d553,_0x23c57f){try{for(var _0x3a3f35=0x0,_0x45ed6d=[];_0x3a3f35<_0x34d553['data'][_0x9f3f('0x19')];_0x3a3f35++){stats[_0x9f3f('0x6d')]+=0x1;if(_0x34d553['errors'][_0x3a3f35]){handleError(_0x34d553[_0x9f3f('0x6e')][_0x3a3f35],_0x34d553['errors'][_0x3a3f35]);}else{var _0x3292de=[];var _0x386db2=[];var _0xfee06d={};for(var _0x27dfed in _0xd9d4a5){let _0x49490d=contactItemTypes[_0x9f3f('0x6f')](_0x5b5e85=>_0x5b5e85[_0x9f3f('0x68')]===_0x27dfed);let _0x12ebc1=contactItemTypes['find'](_0x131790=>_0x131790[_0x9f3f('0x68')]+_0x9f3f('0x69')===_0x27dfed);if(_[_0x9f3f('0x1a')](_0x49490d)&&_[_0x9f3f('0x1a')](_0x12ebc1)){if(_0xd9d4a5[_0x9f3f('0x70')](_0x27dfed)){if(_0x34d553[_0x9f3f('0x6e')][_0x3a3f35][_0xd9d4a5[_0x27dfed]]){var _0x5b90c6=_[_0x9f3f('0x71')](_0x34d553[_0x9f3f('0x6e')][_0x3a3f35][_0xd9d4a5[_0x27dfed]][_0x9f3f('0x72')](/"/g,'\x27'));switch(_0x27dfed){case _0x9f3f('0x32'):var _0x346802=moment(_0x5b90c6,_0x9f3f('0x73'),!![]);if(_0x346802['isValid']()){_0x45ed6d[_0x9f3f('0x1b')]('\x22'+_0x5b90c6+'\x22');}else{_0x3292de[_0x9f3f('0x1b')](_0x9f3f('0x74'));}break;case'priority':var _0x2028a2=parseInt(_0x5b90c6);_0x5b90c6=_[_0x9f3f('0x75')](_0x2028a2)||_0x2028a2<0x0||_0x2028a2>0x4?_0x5a9fe8?0x3:0x2:_0x2028a2;_0x45ed6d['push']('\x22'+_0x5b90c6+'\x22');break;case _0x9f3f('0x37'):var _0x19d1f7=parseInt(_0x5b90c6);if(_['isNumber'](_0x19d1f7)&&_['includes'](_0x5301b3,_0x19d1f7)){_0x45ed6d[_0x9f3f('0x1b')]('\x22'+_0x19d1f7+'\x22');}else{_0x3292de['push']('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x5b90c6)){_0x45ed6d[_0x9f3f('0x1b')]('\x22'+_0x5b90c6+'\x22');}else{_0x3292de[_0x9f3f('0x1b')](_0x9f3f('0x76'));}break;case _0x9f3f('0x77'):var _0x10cc5d=moment(_0x5b90c6,_0x9f3f('0x78'),!![]);if(_0x10cc5d['isValid']()){_0x45ed6d['push']('\x22'+_0x5b90c6+'\x22');}else{_0x3292de[_0x9f3f('0x1b')](_0x9f3f('0x79'));}break;default:_0x45ed6d[_0x9f3f('0x1b')]('\x22'+_0x5b90c6+'\x22');}}else{switch(_0x27dfed){case _0x9f3f('0x7a'):case _0x9f3f('0xf'):_0x3292de[_0x9f3f('0x1b')](_0x27dfed+_0x9f3f('0x7b'));break;default:_0x45ed6d[_0x9f3f('0x1b')]('\x22\x22');}}}}else{var _0x1a8983='';if(!_[_0x9f3f('0x1a')](_0x49490d)){if(!_0xfee06d[_0x9f3f('0x70')](_0x49490d['id'])){for(var _0x1adad9=0x0;_0x1adad9<_0xd9d4a5[_0x27dfed]['length'];_0x1adad9++){var _0x5b90c6=_[_0x9f3f('0x71')](_0x34d553[_0x9f3f('0x6e')][_0x3a3f35][_0xd9d4a5[_0x27dfed][_0x1adad9]][_0x9f3f('0x72')](/"/g,'\x27'));var _0x2ee8a0=phoneDescriptions[_0x9f3f('0x6f')](_0x814737=>_0x814737['itemTypeId']===_0x49490d['id']);if(!_[_0x9f3f('0x1a')](_0x2ee8a0)){var _0x14dbd7=_['trim'](_0x34d553[_0x9f3f('0x6e')][_0x3a3f35][_0xd9d4a5[_0x2ee8a0[_0x9f3f('0x7c')]][0x0]][_0x9f3f('0x72')](/"/g,'\x27'));if(!_[_0x9f3f('0x1a')](_0x14dbd7))_0x5b90c6=_0x5b90c6+'§'+_0x14dbd7;}if(_0x1a8983=='')_0x1a8983=_0x5b90c6;else _0x1a8983+='|'+_0x5b90c6;}_0x386db2[_0x9f3f('0x1b')](_0x49490d['id']+':'+_0x1a8983);_0xfee06d[_0x49490d['id']]=0x1;}}}}if(hasAdditionalPhones){_0x45ed6d[_0x9f3f('0x1b')]('\x22'+_0x386db2[_0x9f3f('0x11')](';')+'\x22');}if(_0x3292de[_0x9f3f('0x19')]){handleError(_0x34d553[_0x9f3f('0x6e')][_0x3a3f35],{'code':'SystemRow','message':_0x3292de[_0x9f3f('0x11')]()});}else{fs[_0x9f3f('0x7d')](_0x209107,_0x45ed6d[_0x9f3f('0x11')]()+'\x0a');}_0x45ed6d=[];}if(!(stats[_0x9f3f('0x6d')]%0xc8)){socket['emit']('contact:import:'+_0x1feb1b,stats);stats[_0x9f3f('0x5c')]=[];}}if(stopped){logger[_0x9f3f('0x59')](_0x9f3f('0x7e'));_0x23c57f[_0x9f3f('0x7f')]();}}catch(_0x49e528){handleError(_0x34d553[_0x9f3f('0x6e')][_0x3a3f35],{'code':_0x9f3f('0x80'),'message':_0x49e528[_0x9f3f('0x1f')]});logger['error'](_0x9f3f('0x81'),_0x49e528['message']);}},'complete':function(){try{var _0x256251=[];var _0x2fb46d=tempTableName;_0x256251[_0x9f3f('0x1b')](_0x9f3f('0x82')+_0x2fb46d+'\x20LIKE\x20cm_contacts;');logger[_0x9f3f('0x59')](_0x9f3f('0x83'),contactItemTypes[_0x9f3f('0x19')]);var _0x3ac699=util[_0x9f3f('0xb')](_0x9f3f('0x84'),_0x209107,_0x2fb46d,_0x41e1be,_0x2cb87c['ListId'],_0x2cb87c['CompanyId']||null,NOW,NOW);if(_['isNil'](_0xd9d4a5['scheduledat'])){_0x3ac699+=_0x9f3f('0x85');}_0x256251[_0x9f3f('0x1b')](_0x3ac699);BPromise[_0x9f3f('0x86')](_0x256251,handleQuery)[_0x9f3f('0x1d')](function(_0x32947f){BPromise[_0x9f3f('0x1c')]([handleAdditionalPhones()])[_0x9f3f('0x1d')](function(){_0x256251=[];for(var _0x57751c=0x0;_0x57751c\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.closedAt','i.attach','i.subject','i.ContactId','i.MailAccountId','i.UserId','openchannel','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','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','squel','../parsers/advancedSearch','updateInteraction','./utils','../../mysqldb','getAccountFK','role','search','select','field','name','color','from','tools_tags','getInteractionFK','_interactions','u.id','u.fullname','left_join','u.id\x20=\x20ui.UserId','length','where','ui.','\x20IN\x20?','map','getInteractionsTables','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace'];(function(_0x5f3935,_0x20709f){var _0x123718=function(_0x5c3a40){while(--_0x5c3a40){_0x5f3935['push'](_0x5f3935['shift']());}};_0x123718(++_0x20709f);}(_0xb61e,0x1b5));var _0xeb61=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xb61e[_0x2bf141];return _0x48277b;};'use strict';var _=require('lodash');var squel=require(_0xeb61('0x0'));var as=require(_0xeb61('0x1'));var qs=require('../parsers/qs');var updateInteraction=require('./update-interaction')[_0xeb61('0x2')];var utils=require(_0xeb61('0x3'));var db=require(_0xeb61('0x4'))['db'];function skipInteractionsQuery(_0x4b9265,_0x2b07cd,_0x4c99ca){var _0x3ba495=![];var _0x285d6e=utils[_0xeb61('0x5')](_0x4b9265);if(_0x2b07cd[_0xeb61('0x6')]==='agent'&&!_0x4c99ca[_0xeb61('0x7')]&&!_0x4c99ca[_0x285d6e]){_0x3ba495=!![];}return _0x3ba495;}function getTagsQuery(){return squel[_0xeb61('0x8')]()[_0xeb61('0x9')]('id')[_0xeb61('0x9')](_0xeb61('0xa'))[_0xeb61('0x9')](_0xeb61('0xb'))[_0xeb61('0xc')](_0xeb61('0xd'));}function getUsersQuery(_0x206276,_0x7ad443){var _0x361761=utils[_0xeb61('0xe')](_0x206276);var _0x2e95e6='user_has_'+_0x206276+_0xeb61('0xf');var _0x34e6e6=squel['select']()['field'](_0xeb61('0x10'))['field'](_0xeb61('0x11'))[_0xeb61('0x9')]('ui.'+_0x361761)[_0xeb61('0xc')](_0x2e95e6,'ui')[_0xeb61('0x12')]('users','u',_0xeb61('0x13'));if(_0x7ad443[_0xeb61('0x14')]>0x0){_0x34e6e6[_0xeb61('0x15')](_0xeb61('0x16')+_0x361761+_0xeb61('0x17'),_[_0xeb61('0x18')](_0x7ad443,'id'));}return _0x34e6e6;}function getInteractionsQuery(_0x25f317){var _0x30e469=utils[_0xeb61('0x19')](_0x25f317);var _0x16af48=utils[_0xeb61('0x5')](_0x25f317);var _0x1a002d=utils['getInteractionFK'](_0x25f317);return squel[_0xeb61('0x8')]()[_0xeb61('0xc')](_0x30e469['interactions'],'i')[_0xeb61('0x12')]('cm_contacts','c',_0xeb61('0x1a'))[_0xeb61('0x12')]('users','o','o.id\x20=\x20i.UserId')[_0xeb61('0x12')](_0x30e469[_0xeb61('0x1b')],'a',_0xeb61('0x1c')+_0x16af48)[_0xeb61('0x12')](_0x30e469[_0xeb61('0x1d')],'me',_0xeb61('0x1e')+_0x1a002d+_0xeb61('0x1f'))[_0xeb61('0x12')](_0x30e469[_0xeb61('0x20')],'it',_0xeb61('0x21')+_0x1a002d+_0xeb61('0x1f'))[_0xeb61('0x12')]('tools_tags','t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0xcfaf44={'body':squel[_0xeb61('0x22')](),'contact':squel[_0xeb61('0x22')](),'default':squel[_0xeb61('0x22')](),'fields':squel[_0xeb61('0x22')](),'filter':squel[_0xeb61('0x22')](),'read':squel['expr'](),'tags':{'clause':squel[_0xeb61('0x22')](),'ids':null},'user':squel[_0xeb61('0x22')]()};return _0xcfaf44;}function parseTagParameter(_0x8ee778){var _0x18d723=squel[_0xeb61('0x22')]();if(_0x8ee778){var _0xdf0f4c=utils[_0xeb61('0x23')](_0x8ee778);_0xdf0f4c[_0xeb61('0x24')](function(_0x546817){_0x18d723['or'](_0xeb61('0x25'),'%,'+_0x546817+',%');});}return _0x18d723;}function parseReadParameter(_0x154044){var _0x2dfed4='';if(_0x154044){_0x2dfed4=_0xeb61('0x26');if(_0x154044==='1'){_0x2dfed4=_0x2dfed4[_0xeb61('0x27')](_0xeb61('0x28'),'=');}else{_0x2dfed4=_0x2dfed4[_0xeb61('0x27')]('{OPERATOR}','>');}}return _0x2dfed4;}function parseSearchFilter(_0x12af4e,_0x4af4ce){var _0x16a7a3=squel['expr']();if(_0x4af4ce){var _0x575277=_0x4af4ce['replace']('\x5c','\x5c\x5c')[_0xeb61('0x27')](/'/g,'\x27\x27');if(qs[_0xeb61('0x29')](_0x575277)){_0x16a7a3['or'](_0xeb61('0x2a'),_0x575277+'%');if([_0xeb61('0x2b'),_0xeb61('0x2c')][_0xeb61('0x2d')](_0x12af4e)){_0x16a7a3['or']('i.phone\x20LIKE\x20?',_0x575277+'%');}else if(_0x12af4e===_0xeb61('0x2e')){_0x16a7a3['or'](_0xeb61('0x2f'),_0x575277+'%');}else if(_0x12af4e==='openchannel'){_0x16a7a3['or'](_0xeb61('0x30'),_0x575277+'%');}}else if(_0x12af4e===_0xeb61('0x31')&&qs['isEmail'](_0x575277)){_0x16a7a3['or']('c.email\x20LIKE\x20?',_0x575277+'%');}else{if(_0x12af4e===_0xeb61('0x31')){_0x16a7a3['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x575277,!![]))['or'](_0xeb61('0x32'),qs[_0xeb61('0x33')](_0x575277));}else if(_0x12af4e!==_0xeb61('0x2e')){_0x16a7a3['or'](_0xeb61('0x34'),qs[_0xeb61('0x33')](_0x575277));}_0x16a7a3['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x575277,!![]),null);}}return _0x16a7a3;}function parseAdvancedSearchFilter(_0x17ebdb,_0x258801){var _0xc87289=getSqlClauses();var _0x362af0=as['parseSearch'](_0x17ebdb);var _0x5cfc62=_0x362af0[_0xeb61('0x35')];for(var _0x1bcafa=0x0;_0x1bcafa<_0x362af0[_0xeb61('0x36')][_0xeb61('0x14')];_0x1bcafa++){var _0x250b0f=_0x362af0[_0xeb61('0x36')][_0x1bcafa];var _0x2db95e='i';var _0x29ef62=_[_0xeb61('0x37')](_0x258801,[_0xeb61('0xa'),_0x250b0f[_0xeb61('0x9')]]);if(_0x29ef62){var _0xd8bc22=as[_0xeb61('0x38')](_0x2db95e,_0x29ef62[_0xeb61('0x39')],_0x250b0f);_0xc87289['default'][_0x5cfc62](_0xd8bc22['text'],_0xd8bc22[_0xeb61('0x3a')][_0xeb61('0x3b')],_0xd8bc22[_0xeb61('0x3a')]['end']);}else{switch(_0x250b0f[_0xeb61('0x9')]){case'unreadMessages':var _0x2ae4d2=parseReadParameter(_0x250b0f[_0xeb61('0x3a')]);_0xc87289[_0xeb61('0x3c')][_0xeb61('0x3d')](_0x2ae4d2);break;case _0xeb61('0x3e'):if(_0x250b0f[_0xeb61('0x3f')]===_0xeb61('0x40')){if(_0x250b0f['value']['split']('\x20')[_0xeb61('0x14')]>0x1){_0xc87289[_0xeb61('0x41')][_0x5cfc62](_0xeb61('0x42'),qs[_0xeb61('0x33')](_0x250b0f[_0xeb61('0x3a')],!![]),null);}else{var _0x287510='%'+_0x250b0f['value']+'%';_0xc87289['contact'][_0x5cfc62]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x287510,_0x287510,_0x287510);}}else{_0x29ef62=_[_0xeb61('0x37')](_0x258801,['name','ContactId']);_0x250b0f['field']=_0xeb61('0x43');_0xd8bc22=as[_0xeb61('0x38')](_0x2db95e,_0x29ef62[_0xeb61('0x39')],_0x250b0f);_0xc87289['contact'][_0x5cfc62](_0xd8bc22[_0xeb61('0x44')],_0xd8bc22[_0xeb61('0x3a')][_0xeb61('0x3b')],_0xd8bc22['value'][_0xeb61('0x45')]);}break;case _0xeb61('0x46'):var _0x1594fe=_0x250b0f['value']['split'](',')[_0xeb61('0x18')](function(_0x37b29b){return Number(_0x37b29b);});var _0x262df9=parseTagParameter(_0x1594fe);_0xc87289[_0xeb61('0x47')][_0xeb61('0x48')][_0xeb61('0x3d')](_0x262df9);_0xc87289['tags']['ids']=_0x1594fe;break;case'User':if(_0x250b0f[_0xeb61('0x3f')]===_0xeb61('0x40')){_0xc87289[_0xeb61('0x49')][_0x5cfc62](_0xeb61('0x4a'),'%'+_0x250b0f[_0xeb61('0x3a')]+'%',null);}else{_0x29ef62=_[_0xeb61('0x37')](_0x258801,[_0xeb61('0xa'),'UserId']);_0x250b0f[_0xeb61('0x9')]=_0xeb61('0x4b');_0xd8bc22=as[_0xeb61('0x38')](_0x2db95e,_0x29ef62[_0xeb61('0x39')],_0x250b0f);_0xc87289[_0xeb61('0x49')][_0x5cfc62](_0xd8bc22[_0xeb61('0x44')],_0xd8bc22['value'][_0xeb61('0x3b')],_0xd8bc22[_0xeb61('0x3a')][_0xeb61('0x45')]);}break;case _0xeb61('0x4c'):case _0xeb61('0x4d'):_0xd8bc22=as[_0xeb61('0x38')]('me',null,_0x250b0f);_0xc87289[_0xeb61('0x4c')][_0x5cfc62](_0xd8bc22[_0xeb61('0x44')],_0xd8bc22[_0xeb61('0x3a')][_0xeb61('0x3b')],_0xd8bc22[_0xeb61('0x3a')][_0xeb61('0x45')]);break;}}}return _0xc87289;}function parseModelFields(_0x2178d3,_0x5aac3b,_0x3c227f){var _0x426048=utils['getAccountFK'](_0x2178d3);var _0x2771ca=squel['expr']();var _0xd9cb84=_(_0x5aac3b)[_0xeb61('0x4e')]()['map'](function(_0xad2a34){return _[_0xeb61('0x4f')](_0x3c227f,['name',_0xad2a34])?_0xad2a34:undefined;})[_0xeb61('0x50')]()[_0xeb61('0x3a')]();if(_0xd9cb84[_0xeb61('0x14')]>0x0){_0xd9cb84['forEach'](function(_0x40790d){if(_0x40790d===_0x426048){_0x2771ca[_0xeb61('0x3d')]('i.'+_0x426048+_0xeb61('0x17'),[][_0xeb61('0x51')](_0x5aac3b[_0x40790d]));}else if(_0x40790d===_0xeb61('0x52')){var _0x1e6d01=JSON[_0xeb61('0x53')](_0x5aac3b[_0x40790d])['$gte'];var _0xe196f3=JSON[_0xeb61('0x53')](_0x5aac3b[_0x40790d])[_0xeb61('0x54')];_0x2771ca[_0xeb61('0x3d')](_0xeb61('0x55'),_0x1e6d01,_0xe196f3);}else{if(_0x5aac3b[_0x40790d]==='null'){_0x2771ca[_0xeb61('0x3d')]('i.'+_0x40790d+_0xeb61('0x56'));}else{_0x2771ca[_0xeb61('0x3d')]('i.'+_0x40790d+'\x20=\x20?',_0x5aac3b[_0x40790d]);}}});}return _0x2771ca;}function parseQueryParameters(_0x108e73,_0x2ab0be,_0x2e554a){var _0x166118=getSqlClauses();return Promise[_0xeb61('0x57')]()[_0xeb61('0x58')](function(){return parseModelFields(_0x108e73,_0x2ab0be,_0x2e554a);})[_0xeb61('0x58')](function(_0x3c6af8){_0x166118[_0xeb61('0x59')][_0xeb61('0x3d')](_0x3c6af8);return parseReadParameter(_0x2ab0be[_0xeb61('0x3c')]);})[_0xeb61('0x58')](function(_0x50c73e){_0x166118[_0xeb61('0x3c')]['and'](_0x50c73e);return parseTagParameter(_0x2ab0be[_0xeb61('0x5a')]);})[_0xeb61('0x58')](function(_0x8e2bf0){_0x166118[_0xeb61('0x47')][_0xeb61('0x48')]['and'](_0x8e2bf0);return parseSearchFilter(_0x108e73,_0x2ab0be[_0xeb61('0x5b')]);})['then'](function(_0x262cdf){_0x166118[_0xeb61('0x5b')]=_0x262cdf;return _0x166118;});}function checkAccountsRestrictions(_0x2847a1,_0x218d13,_0x129764){var _0x4a7c3c=utils[_0xeb61('0x5')](_0x2847a1);var _0x2ea85e='get'+_[_0xeb61('0x5c')](_0x2847a1)+(_0x2847a1===_0xeb61('0x5d')?_0xeb61('0x5e'):'Accounts');var _0x32f28d=squel['expr']();return Promise[_0xeb61('0x57')]()[_0xeb61('0x58')](function(){if(_0x129764[_0xeb61('0x7')]&&_0x218d13[_0xeb61('0x6')]===_0xeb61('0x5f')){return _0x218d13[_0x2ea85e]({'attributes':['id'],'raw':!![]});}})[_0xeb61('0x58')](function(_0x1a9c96){if(_0x1a9c96){if(_0x1a9c96[_0xeb61('0x14')]===0x0){_0x32f28d[_0xeb61('0x3d')]('i.'+_0x4a7c3c+_0xeb61('0x56'));}else{_0x32f28d[_0xeb61('0x3d')]('i.'+_0x4a7c3c+_0xeb61('0x17'),_[_0xeb61('0x18')](_0x1a9c96,'id'));}}else if(!_0x129764[_0x4a7c3c]){_0x32f28d['and']('i.'+_0x4a7c3c+_0xeb61('0x60'));}})['then'](function(){return _0x32f28d;});}function getClosedOrderClause(_0x4b743a,_0x4877f2){var _0x4f353d='';var _0x587967=[_0xeb61('0x61'),_0xeb61('0x62'),_0xeb61('0x63')];if(_0x4b743a===_0xeb61('0x31')){_0x587967[_0xeb61('0x64')](_0xeb61('0x65'));}if(_0x4877f2[_0xeb61('0x66')]==='0'&&_0x4b743a===_0xeb61('0x31')){_0x4f353d=_0xeb61('0x65');}else{if(_0x4877f2['closed']==='1'){_0x587967['shift']();}_0x4f353d=_0xeb61('0x67')+_0x587967[_0xeb61('0x68')](',\x20')+')';}return _0x4f353d;}function getFilteredInteractions(_0x3da613,_0x17373c,_0x3d0b5a,_0x88ca82){var _0x1cdfc7=utils[_0xeb61('0xe')](_0x3da613);var _0x24610f=_[_0xeb61('0x5c')](_0x3da613)+_0xeb61('0x69');var _0xa3de47=[];var _0x2b0d92=getTagsQuery();var _0x40a71d={'type':db[_0xeb61('0x6a')][_0xeb61('0x6b')][_0xeb61('0x6c')],'raw':!![]};var _0x132613=[];var _0x114b03=[];return db[_0xeb61('0x6d')][_0xeb61('0x6e')](_0x2b0d92[_0xeb61('0x6f')](),_0x40a71d)[_0xeb61('0x58')](function(_0xbc1b43){_0xa3de47=_[_0xeb61('0x70')](_0xbc1b43,'id');_0x40a71d=_[_0xeb61('0x71')](_0x40a71d,{'model':db[_0x24610f],'mapToModel':!![],'nest':!![]});if(_0x3d0b5a[_0xeb61('0x59')]){_0x88ca82[_0xeb61('0x72')][_0xeb61('0x24')](function(_0x19c9ac){_0x17373c[_0xeb61('0x9')]('i.'+_0x19c9ac);});}else{_0x17373c[_0xeb61('0x9')](_0xeb61('0x73'),_0xeb61('0x74'));_0x17373c['field'](_0xeb61('0x75'),_0xeb61('0x76'));_0x17373c[_0xeb61('0x9')](_0xeb61('0x77'),_0xeb61('0x78'));if(_0x3da613===_0xeb61('0x31')){_0x17373c['field'](_0xeb61('0x79'),'Account.email');_0x17373c[_0xeb61('0x9')](_0xeb61('0x7a'),_0xeb61('0x7b'));_0x17373c[_0xeb61('0x9')]('i.id');_0x17373c[_0xeb61('0x9')](_0xeb61('0x7c'));_0x17373c[_0xeb61('0x9')](_0xeb61('0x7d'));_0x17373c[_0xeb61('0x9')]('i.closed');_0x17373c[_0xeb61('0x9')](_0xeb61('0x7e'));_0x17373c[_0xeb61('0x9')](_0xeb61('0x7f'));_0x17373c[_0xeb61('0x9')]('i.lastMsgAt');_0x17373c[_0xeb61('0x9')]('i.lastMsgDirection');_0x17373c[_0xeb61('0x9')](_0xeb61('0x80'));_0x17373c[_0xeb61('0x9')](_0xeb61('0x63'));_0x17373c[_0xeb61('0x9')]('i.secondDisposition');_0x17373c['field']('i.thirdDisposition');_0x17373c[_0xeb61('0x9')](_0xeb61('0x65'));_0x17373c[_0xeb61('0x9')]('i.to');_0x17373c[_0xeb61('0x9')](_0xeb61('0x81'));_0x17373c[_0xeb61('0x9')](_0xeb61('0x82'));_0x17373c[_0xeb61('0x9')](_0xeb61('0x83'));}else if(_0x3da613===_0xeb61('0x84')){_0x17373c['field'](_0xeb61('0x85'),_0xeb61('0x7b'));}else{_0x17373c[_0xeb61('0x9')](_0xeb61('0x86'),_0xeb61('0x7b'));}if(_0x3da613!==_0xeb61('0x31')){_0x17373c[_0xeb61('0x9')](_0xeb61('0x87'));}_0x17373c['field']('c.firstName',_0xeb61('0x88'));_0x17373c[_0xeb61('0x9')]('c.lastName',_0xeb61('0x89'));_0x17373c[_0xeb61('0x9')](_0xeb61('0x8a'),'Contact.email');_0x17373c[_0xeb61('0x9')](_0xeb61('0x8b'),'Contact.phone');_0x17373c['field'](_0xeb61('0x8c'),_0xeb61('0x8d'));_0x17373c[_0xeb61('0x9')](_0xeb61('0x8e'),_0xeb61('0x8f'));_0x17373c[_0xeb61('0x9')](_0xeb61('0x90'),_0xeb61('0x91'));_0x17373c[_0xeb61('0x9')]('o.internal',_0xeb61('0x92'));_0x17373c[_0xeb61('0x9')](_0xeb61('0x93'),_0xeb61('0x94'));}if(_0x88ca82[_0xeb61('0x95')]){_0x17373c[_0xeb61('0x95')](_0x88ca82[_0xeb61('0x95')]);}if(_0x88ca82[_0xeb61('0x96')]){_0x17373c[_0xeb61('0x96')](_0x88ca82[_0xeb61('0x96')]);}return db[_0xeb61('0x6d')]['query'](_0x17373c[_0xeb61('0x6f')](),_0x40a71d);})[_0xeb61('0x58')](function(_0xf7af3a){_0x132613=_0xf7af3a;var _0x45c854=getUsersQuery(_0x3da613,_0x132613);return db[_0xeb61('0x6d')][_0xeb61('0x6e')](_0x45c854['toString'](),_0x40a71d);})['then'](function(_0x4a7c9d){_0x114b03=_[_0xeb61('0x97')](_0x4a7c9d,_0x1cdfc7);if(_0x3da613===_0xeb61('0x31')){return db[_0xeb61('0x98')]['findOne']({'attributes':[_0xeb61('0x99')],'raw':!![]});}})[_0xeb61('0x58')](function(_0x47389e){var _0x2c85ea=_0x47389e?_0x47389e[_0xeb61('0x99')]:undefined;var _0x5c86e6=_0x132613[_0xeb61('0x18')](function(_0x5f4a5a){return updateInteraction(_0x5f4a5a,_0xa3de47,_0x114b03,_0x2c85ea);});return Promise[_0xeb61('0x9a')](_0x5c86e6);});}function countFilteredInteractions(_0x507c8d,_0x4a2101){var _0x1a4eea=_0x507c8d[_0xeb61('0x9b')]();_0x1a4eea[_0xeb61('0x9')](_0xeb61('0x9c'));_0x1a4eea[_0xeb61('0x9')](_0xeb61('0x73'),'unreadMessages');var _0x594bd1=utils[_0xeb61('0x23')](_0x4a2101);if(!_[_0xeb61('0x9d')](_0x594bd1)){_0x1a4eea[_0xeb61('0x15')](_0xeb61('0x9e'),_0x594bd1);}var _0x5b65a1={'type':db['Sequelize'][_0xeb61('0x6b')][_0xeb61('0x6c')],'raw':!![]};return db['sequelize'][_0xeb61('0x6e')](_0x1a4eea[_0xeb61('0x6f')](),_0x5b65a1);}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 _0xf940=['parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','fields','then','tag','filter','getAccountFK','get','chat','Websites','search','agent','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','capitalize','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.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.updatedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.thirdDisposition','i.ContactId','i.MailAccountId','i.UserId','openchannel','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.*','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','isEmpty','exports','lodash','squel','./update-interaction','updateInteraction','./utils','../../mysqldb','role','select','field','name','color','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','from','left_join','u.id\x20=\x20ui.UserId','length','where','ui.','\x20IN\x20?','map','getInteractionsTables','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','i.phone\x20LIKE\x20?','fax','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)','sqlOperator','conditions','find','buildExpression','default','value','unreadMessages','read','and','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','start','tags','clause','ids','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','plainBody','keys','some','compact','forEach','createdAt'];(function(_0x2fbb34,_0x358b15){var _0x26914a=function(_0x240fc1){while(--_0x240fc1){_0x2fbb34['push'](_0x2fbb34['shift']());}};_0x26914a(++_0x358b15);}(_0xf940,0x199));var _0x0f94=function(_0x412ae3,_0x41f36d){_0x412ae3=_0x412ae3-0x0;var _0x54c755=_0xf940[_0x412ae3];return _0x54c755;};'use strict';var _=require(_0x0f94('0x0'));var squel=require(_0x0f94('0x1'));var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require(_0x0f94('0x2'))[_0x0f94('0x3')];var utils=require(_0x0f94('0x4'));var db=require(_0x0f94('0x5'))['db'];function skipInteractionsQuery(_0xd9fc43,_0x216f2a,_0x1cda71){var _0x2a146b=![];var _0x52d269=utils['getAccountFK'](_0xd9fc43);if(_0x216f2a[_0x0f94('0x6')]==='agent'&&!_0x1cda71['search']&&!_0x1cda71[_0x52d269]){_0x2a146b=!![];}return _0x2a146b;}function getTagsQuery(){return squel[_0x0f94('0x7')]()[_0x0f94('0x8')]('id')[_0x0f94('0x8')](_0x0f94('0x9'))[_0x0f94('0x8')](_0x0f94('0xa'))['from'](_0x0f94('0xb'));}function getUsersQuery(_0x411079,_0x4337df){var _0x9bd103=utils[_0x0f94('0xc')](_0x411079);var _0x196c43=_0x0f94('0xd')+_0x411079+_0x0f94('0xe');var _0x1e0d9d=squel['select']()['field'](_0x0f94('0xf'))[_0x0f94('0x8')](_0x0f94('0x10'))[_0x0f94('0x8')]('ui.'+_0x9bd103)[_0x0f94('0x11')](_0x196c43,'ui')[_0x0f94('0x12')]('users','u',_0x0f94('0x13'));if(_0x4337df[_0x0f94('0x14')]>0x0){_0x1e0d9d[_0x0f94('0x15')](_0x0f94('0x16')+_0x9bd103+_0x0f94('0x17'),_[_0x0f94('0x18')](_0x4337df,'id'));}return _0x1e0d9d;}function getInteractionsQuery(_0x1732d3){var _0x375fc5=utils[_0x0f94('0x19')](_0x1732d3);var _0x303d90=utils['getAccountFK'](_0x1732d3);var _0x2cdd4f=utils[_0x0f94('0xc')](_0x1732d3);return squel['select']()[_0x0f94('0x11')](_0x375fc5[_0x0f94('0x1a')],'i')[_0x0f94('0x12')]('cm_contacts','c',_0x0f94('0x1b'))['left_join'](_0x0f94('0x1c'),'o',_0x0f94('0x1d'))[_0x0f94('0x12')](_0x375fc5[_0x0f94('0x1e')],'a',_0x0f94('0x1f')+_0x303d90)['left_join'](_0x375fc5[_0x0f94('0x20')],'me','me.'+_0x2cdd4f+_0x0f94('0x21'))['left_join'](_0x375fc5[_0x0f94('0x22')],'it',_0x0f94('0x23')+_0x2cdd4f+'\x20=\x20i.id')[_0x0f94('0x12')](_0x0f94('0xb'),'t',_0x0f94('0x24'));}function getSqlClauses(){var _0x2c71cc={'body':squel['expr'](),'contact':squel['expr'](),'default':squel[_0x0f94('0x25')](),'fields':squel[_0x0f94('0x25')](),'filter':squel['expr'](),'read':squel[_0x0f94('0x25')](),'tags':{'clause':squel[_0x0f94('0x25')](),'ids':null},'user':squel['expr']()};return _0x2c71cc;}function parseTagParameter(_0x162028){var _0x37afdf=squel[_0x0f94('0x25')]();if(_0x162028){var _0x43280c=utils[_0x0f94('0x26')](_0x162028);_0x43280c['forEach'](function(_0xf704f7){_0x37afdf['or'](_0x0f94('0x27'),'%,'+_0xf704f7+',%');});}return _0x37afdf;}function parseReadParameter(_0xddc979){var _0x207a08='';if(_0xddc979){_0x207a08='unreadMessages\x20{OPERATOR}\x200';if(_0xddc979==='1'){_0x207a08=_0x207a08[_0x0f94('0x28')](_0x0f94('0x29'),'=');}else{_0x207a08=_0x207a08[_0x0f94('0x28')]('{OPERATOR}','>');}}return _0x207a08;}function parseSearchFilter(_0x12bb51,_0x18dd7f){var _0x1c62d2=squel[_0x0f94('0x25')]();if(_0x18dd7f){var _0x3ed8be=_0x18dd7f[_0x0f94('0x28')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3ed8be)){_0x1c62d2['or'](_0x0f94('0x2a'),_0x3ed8be+'%');if([_0x0f94('0x2b'),_0x0f94('0x2c')]['includes'](_0x12bb51)){_0x1c62d2['or'](_0x0f94('0x2d'),_0x3ed8be+'%');}else if(_0x12bb51===_0x0f94('0x2e')){_0x1c62d2['or']('i.fax\x20LIKE\x20?',_0x3ed8be+'%');}else if(_0x12bb51==='openchannel'){_0x1c62d2['or'](_0x0f94('0x2f'),_0x3ed8be+'%');}}else if(_0x12bb51===_0x0f94('0x30')&&qs['isEmail'](_0x3ed8be)){_0x1c62d2['or'](_0x0f94('0x31'),_0x3ed8be+'%');}else{if(_0x12bb51==='mail'){_0x1c62d2['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0f94('0x32')](_0x3ed8be,!![]))['or'](_0x0f94('0x33'),qs[_0x0f94('0x32')](_0x3ed8be));}else if(_0x12bb51!==_0x0f94('0x2e')){_0x1c62d2['or'](_0x0f94('0x34'),qs[_0x0f94('0x32')](_0x3ed8be));}_0x1c62d2['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0f94('0x32')](_0x3ed8be,!![]),null);}}return _0x1c62d2;}function parseAdvancedSearchFilter(_0x260d78,_0x2d25bc){var _0x16971e=getSqlClauses();var _0xb7feb9=as['parseSearch'](_0x260d78);var _0x210eef=_0xb7feb9[_0x0f94('0x35')];for(var _0x499194=0x0;_0x499194<_0xb7feb9[_0x0f94('0x36')][_0x0f94('0x14')];_0x499194++){var _0x4ee837=_0xb7feb9[_0x0f94('0x36')][_0x499194];var _0x54dd26='i';var _0x42f177=_[_0x0f94('0x37')](_0x2d25bc,['name',_0x4ee837[_0x0f94('0x8')]]);if(_0x42f177){var _0x7f4ba1=as[_0x0f94('0x38')](_0x54dd26,_0x42f177['type'],_0x4ee837);_0x16971e[_0x0f94('0x39')][_0x210eef](_0x7f4ba1['text'],_0x7f4ba1[_0x0f94('0x3a')]['start'],_0x7f4ba1['value']['end']);}else{switch(_0x4ee837[_0x0f94('0x8')]){case _0x0f94('0x3b'):var _0x373bf3=parseReadParameter(_0x4ee837[_0x0f94('0x3a')]);_0x16971e[_0x0f94('0x3c')][_0x0f94('0x3d')](_0x373bf3);break;case _0x0f94('0x3e'):if(_0x4ee837[_0x0f94('0x3f')]===_0x0f94('0x40')){if(_0x4ee837[_0x0f94('0x3a')][_0x0f94('0x41')]('\x20')['length']>0x1){_0x16971e['contact'][_0x210eef](_0x0f94('0x42'),qs[_0x0f94('0x32')](_0x4ee837[_0x0f94('0x3a')],!![]),null);}else{var _0x1759e2='%'+_0x4ee837[_0x0f94('0x3a')]+'%';_0x16971e[_0x0f94('0x43')][_0x210eef](_0x0f94('0x44'),_0x1759e2,_0x1759e2,_0x1759e2);}}else{_0x42f177=_[_0x0f94('0x37')](_0x2d25bc,[_0x0f94('0x9'),_0x0f94('0x45')]);_0x4ee837['field']=_0x0f94('0x45');_0x7f4ba1=as[_0x0f94('0x38')](_0x54dd26,_0x42f177[_0x0f94('0x46')],_0x4ee837);_0x16971e['contact'][_0x210eef](_0x7f4ba1['text'],_0x7f4ba1[_0x0f94('0x3a')][_0x0f94('0x47')],_0x7f4ba1[_0x0f94('0x3a')]['end']);}break;case'Tag':var _0xae4109=_0x4ee837[_0x0f94('0x3a')][_0x0f94('0x41')](',')[_0x0f94('0x18')](function(_0x503202){return Number(_0x503202);});var _0x5d1b92=parseTagParameter(_0xae4109);_0x16971e[_0x0f94('0x48')][_0x0f94('0x49')]['and'](_0x5d1b92);_0x16971e['tags'][_0x0f94('0x4a')]=_0xae4109;break;case'User':if(_0x4ee837[_0x0f94('0x3f')]==='$substring'){_0x16971e[_0x0f94('0x4b')][_0x210eef](_0x0f94('0x4c'),'%'+_0x4ee837[_0x0f94('0x3a')]+'%',null);}else{_0x42f177=_[_0x0f94('0x37')](_0x2d25bc,[_0x0f94('0x9'),_0x0f94('0x4d')]);_0x4ee837[_0x0f94('0x8')]=_0x0f94('0x4d');_0x7f4ba1=as[_0x0f94('0x38')](_0x54dd26,_0x42f177[_0x0f94('0x46')],_0x4ee837);_0x16971e[_0x0f94('0x4b')][_0x210eef](_0x7f4ba1[_0x0f94('0x4e')],_0x7f4ba1['value'][_0x0f94('0x47')],_0x7f4ba1[_0x0f94('0x3a')]['end']);}break;case _0x0f94('0x4f'):case _0x0f94('0x50'):_0x7f4ba1=as[_0x0f94('0x38')]('me',null,_0x4ee837);_0x16971e[_0x0f94('0x4f')][_0x210eef](_0x7f4ba1['text'],_0x7f4ba1[_0x0f94('0x3a')]['start'],_0x7f4ba1[_0x0f94('0x3a')]['end']);break;}}}return _0x16971e;}function parseModelFields(_0x3267e5,_0x157196,_0x1d64f6){var _0x38cbc0=utils['getAccountFK'](_0x3267e5);var _0x18d7c2=squel[_0x0f94('0x25')]();var _0x26872e=_(_0x157196)[_0x0f94('0x51')]()['map'](function(_0x3c1923){return _[_0x0f94('0x52')](_0x1d64f6,[_0x0f94('0x9'),_0x3c1923])?_0x3c1923:undefined;})[_0x0f94('0x53')]()['value']();if(_0x26872e[_0x0f94('0x14')]>0x0){_0x26872e[_0x0f94('0x54')](function(_0x5d3c27){if(_0x5d3c27===_0x38cbc0){_0x18d7c2[_0x0f94('0x3d')]('i.'+_0x38cbc0+_0x0f94('0x17'),[]['concat'](_0x157196[_0x5d3c27]));}else if(_0x5d3c27===_0x0f94('0x55')){var _0x35ec5d=JSON[_0x0f94('0x56')](_0x157196[_0x5d3c27])[_0x0f94('0x57')];var _0x93b983=JSON[_0x0f94('0x56')](_0x157196[_0x5d3c27])[_0x0f94('0x58')];_0x18d7c2[_0x0f94('0x3d')](_0x0f94('0x59'),_0x35ec5d,_0x93b983);}else{if(_0x157196[_0x5d3c27]===_0x0f94('0x5a')){_0x18d7c2['and']('i.'+_0x5d3c27+_0x0f94('0x5b'));}else{_0x18d7c2[_0x0f94('0x3d')]('i.'+_0x5d3c27+_0x0f94('0x5c'),_0x157196[_0x5d3c27]);}}});}return _0x18d7c2;}function parseQueryParameters(_0x5ca1d0,_0x5d9f16,_0x1e021b){var _0x5ac0b7=getSqlClauses();return Promise[_0x0f94('0x5d')]()['then'](function(){return parseModelFields(_0x5ca1d0,_0x5d9f16,_0x1e021b);})['then'](function(_0x249ec6){_0x5ac0b7[_0x0f94('0x5e')][_0x0f94('0x3d')](_0x249ec6);return parseReadParameter(_0x5d9f16[_0x0f94('0x3c')]);})[_0x0f94('0x5f')](function(_0xa12755){_0x5ac0b7[_0x0f94('0x3c')][_0x0f94('0x3d')](_0xa12755);return parseTagParameter(_0x5d9f16[_0x0f94('0x60')]);})[_0x0f94('0x5f')](function(_0x2ce53e){_0x5ac0b7['tags'][_0x0f94('0x49')]['and'](_0x2ce53e);return parseSearchFilter(_0x5ca1d0,_0x5d9f16[_0x0f94('0x61')]);})[_0x0f94('0x5f')](function(_0xc2e554){_0x5ac0b7[_0x0f94('0x61')]=_0xc2e554;return _0x5ac0b7;});}function checkAccountsRestrictions(_0x1159c8,_0x145678,_0x318618){var _0x214ba5=utils[_0x0f94('0x62')](_0x1159c8);var _0x2e19f9=_0x0f94('0x63')+_['capitalize'](_0x1159c8)+(_0x1159c8===_0x0f94('0x64')?_0x0f94('0x65'):'Accounts');var _0x5621b0=squel[_0x0f94('0x25')]();return Promise[_0x0f94('0x5d')]()['then'](function(){if(_0x318618[_0x0f94('0x66')]&&_0x145678['role']===_0x0f94('0x67')){return _0x145678[_0x2e19f9]({'attributes':['id'],'raw':!![]});}})[_0x0f94('0x5f')](function(_0x58cc56){if(_0x58cc56){if(_0x58cc56['length']===0x0){_0x5621b0[_0x0f94('0x3d')]('i.'+_0x214ba5+'\x20IS\x20NULL');}else{_0x5621b0[_0x0f94('0x3d')]('i.'+_0x214ba5+'\x20IN\x20?',_[_0x0f94('0x18')](_0x58cc56,'id'));}}else if(!_0x318618[_0x214ba5]){_0x5621b0[_0x0f94('0x3d')]('i.'+_0x214ba5+_0x0f94('0x68'));}})[_0x0f94('0x5f')](function(){return _0x5621b0;});}function getClosedOrderClause(_0x239c15,_0x200930){var _0x5e8575='';var _0x281975=['i.thirdDisposition',_0x0f94('0x69'),_0x0f94('0x6a')];if(_0x239c15===_0x0f94('0x30')){_0x281975['unshift'](_0x0f94('0x6b'));}if(_0x200930[_0x0f94('0x6c')]==='0'&&_0x239c15===_0x0f94('0x30')){_0x5e8575=_0x0f94('0x6b');}else{if(_0x200930[_0x0f94('0x6c')]==='1'){_0x281975[_0x0f94('0x6d')]();}_0x5e8575=_0x0f94('0x6e')+_0x281975['join'](',\x20')+')';}return _0x5e8575;}function getFilteredInteractions(_0x4e1c86,_0x40be43,_0x2dfcb3,_0x221688){var _0xb62fc1=utils[_0x0f94('0xc')](_0x4e1c86);var _0x540578=_[_0x0f94('0x6f')](_0x4e1c86)+_0x0f94('0x70');var _0x4ee9fe=[];var _0x1dc3a7=getTagsQuery();var _0x134d74={'type':db[_0x0f94('0x71')][_0x0f94('0x72')][_0x0f94('0x73')],'raw':!![]};var _0xd46b35=[];var _0x57dd78=[];return db[_0x0f94('0x74')][_0x0f94('0x75')](_0x1dc3a7[_0x0f94('0x76')](),_0x134d74)[_0x0f94('0x5f')](function(_0x20cafe){_0x4ee9fe=_[_0x0f94('0x77')](_0x20cafe,'id');_0x134d74=_[_0x0f94('0x78')](_0x134d74,{'model':db[_0x540578],'mapToModel':!![],'nest':!![]});if(_0x2dfcb3[_0x0f94('0x5e')]){_0x221688[_0x0f94('0x79')][_0x0f94('0x54')](function(_0x1a1e85){_0x40be43['field']('i.'+_0x1a1e85);});}else{_0x40be43['field'](_0x0f94('0x7a'),_0x0f94('0x3b'));_0x40be43[_0x0f94('0x8')](_0x0f94('0x7b'),'Account.key');_0x40be43[_0x0f94('0x8')](_0x0f94('0x7c'),'Account.mandatoryDisposition');if(_0x4e1c86===_0x0f94('0x30')){_0x40be43[_0x0f94('0x8')](_0x0f94('0x7d'),_0x0f94('0x7e'));_0x40be43['field'](_0x0f94('0x7f'),'contactName');_0x40be43['field']('i.id');_0x40be43[_0x0f94('0x8')]('i.createdAt');_0x40be43[_0x0f94('0x8')](_0x0f94('0x80'));_0x40be43[_0x0f94('0x8')]('i.closed');_0x40be43[_0x0f94('0x8')]('i.closedAt');_0x40be43[_0x0f94('0x8')](_0x0f94('0x81'));_0x40be43['field'](_0x0f94('0x82'));_0x40be43[_0x0f94('0x8')](_0x0f94('0x83'));_0x40be43[_0x0f94('0x8')](_0x0f94('0x84'));_0x40be43[_0x0f94('0x8')]('i.disposition');_0x40be43[_0x0f94('0x8')]('i.secondDisposition');_0x40be43[_0x0f94('0x8')](_0x0f94('0x85'));_0x40be43[_0x0f94('0x8')](_0x0f94('0x6b'));_0x40be43[_0x0f94('0x8')]('i.to');_0x40be43[_0x0f94('0x8')](_0x0f94('0x86'));_0x40be43['field'](_0x0f94('0x87'));_0x40be43[_0x0f94('0x8')](_0x0f94('0x88'));}else if(_0x4e1c86===_0x0f94('0x89')){_0x40be43[_0x0f94('0x8')](_0x0f94('0x8a'),_0x0f94('0x8b'));}else{_0x40be43[_0x0f94('0x8')]('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',_0x0f94('0x8b'));}if(_0x4e1c86!==_0x0f94('0x30')){_0x40be43[_0x0f94('0x8')](_0x0f94('0x8c'));}_0x40be43[_0x0f94('0x8')]('c.firstName',_0x0f94('0x8d'));_0x40be43[_0x0f94('0x8')](_0x0f94('0x8e'),'Contact.lastName');_0x40be43['field']('c.email',_0x0f94('0x8f'));_0x40be43[_0x0f94('0x8')](_0x0f94('0x90'),_0x0f94('0x91'));_0x40be43[_0x0f94('0x8')](_0x0f94('0x92'),_0x0f94('0x93'));_0x40be43['field'](_0x0f94('0x94'),_0x0f94('0x95'));_0x40be43[_0x0f94('0x8')](_0x0f94('0x96'),_0x0f94('0x97'));_0x40be43['field'](_0x0f94('0x98'),'Owner.internal');_0x40be43['field'](_0x0f94('0x99'),_0x0f94('0x9a'));}if(_0x221688['limit']){_0x40be43[_0x0f94('0x9b')](_0x221688[_0x0f94('0x9b')]);}if(_0x221688[_0x0f94('0x9c')]){_0x40be43[_0x0f94('0x9c')](_0x221688['offset']);}return db[_0x0f94('0x74')][_0x0f94('0x75')](_0x40be43['toString'](),_0x134d74);})[_0x0f94('0x5f')](function(_0x2b6659){_0xd46b35=_0x2b6659;var _0x4b48d6=getUsersQuery(_0x4e1c86,_0xd46b35);return db[_0x0f94('0x74')]['query'](_0x4b48d6[_0x0f94('0x76')](),_0x134d74);})['then'](function(_0x2d21ae){_0x57dd78=_[_0x0f94('0x9d')](_0x2d21ae,_0xb62fc1);if(_0x4e1c86===_0x0f94('0x30')){return db[_0x0f94('0x9e')][_0x0f94('0x9f')]({'attributes':['enableEmailPreview'],'raw':!![]});}})['then'](function(_0x8a6cf4){var _0xaed24d=_0x8a6cf4?_0x8a6cf4[_0x0f94('0xa0')]:undefined;var _0x457b2d=_0xd46b35[_0x0f94('0x18')](function(_0x912424){return updateInteraction(_0x912424,_0x4ee9fe,_0x57dd78,_0xaed24d);});return Promise[_0x0f94('0xa1')](_0x457b2d);});}function countFilteredInteractions(_0x2fb2f8,_0x3f7ca6){var _0x2ce252=_0x2fb2f8[_0x0f94('0xa2')]();_0x2ce252[_0x0f94('0x8')]('COUNT(*)');_0x2ce252[_0x0f94('0x8')](_0x0f94('0x7a'),_0x0f94('0x3b'));var _0x3e6dd4=utils[_0x0f94('0x26')](_0x3f7ca6);if(!_[_0x0f94('0xa3')](_0x3e6dd4)){_0x2ce252[_0x0f94('0x15')]('t.id\x20IN\x20?',_0x3e6dd4);}var _0x56fe78={'type':db[_0x0f94('0x71')]['QueryTypes'][_0x0f94('0x73')],'raw':!![]};return db[_0x0f94('0x74')][_0x0f94('0x75')](_0x2ce252[_0x0f94('0x76')](),_0x56fe78);}module[_0x0f94('0xa4')]={'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 d8f93e3..523b7f5 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 _0x8c59=['waiting','talking','unmanaged','total','closed','disposition','abandoned','UserId','MailMessage','findOne','plainBody','-id','then','trimStart','catch','updateInteraction','Users','Tags','TagIds','../../mysqldb','map','fullname','split'];(function(_0x4d55ba,_0x5c7178){var _0x1e3f74=function(_0x320ed4){while(--_0x320ed4){_0x4d55ba['push'](_0x4d55ba['shift']());}};_0x1e3f74(++_0x5c7178);}(_0x8c59,0x110));var _0x98c5=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x8c59[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');var db=require(_0x98c5('0x0'))['db'];function getInteractionUsers(_0x473dc3,_0x535556){return new Promise(function(_0x2d71a4,_0x29a7d8){try{var _0x511238=[];if(_0x535556[_0x473dc3]){_0x511238=_0x535556[_0x473dc3][_0x98c5('0x1')](function(_0x7f77e7){return{'id':_0x7f77e7['id'],'fullname':_0x7f77e7[_0x98c5('0x2')]};});}return _0x2d71a4(_0x511238);}catch(_0x5682ff){_0x29a7d8(_0x5682ff);}});}function getInteractionTags(_0x4577a0,_0x51f398){var _0x458310=[];if(_0x4577a0){_0x4577a0[_0x98c5('0x3')](',')['forEach'](function(_0x5e6b52){_0x458310['push'](_0x51f398[_0x5e6b52]);});}return _0x458310;}function updateWaitingCounter(_0x49ae16){if(_0x49ae16[_0x98c5('0x4')]){_0x49ae16[_0x98c5('0x4')]-=0x1;}}function updateInteractionCounters(_0x1b6c40){_0x1b6c40[_0x98c5('0x4')]=0x0;_0x1b6c40[_0x98c5('0x5')]=0x0;_0x1b6c40['answered']=0x0;_0x1b6c40[_0x98c5('0x6')]=0x0;_0x1b6c40['abandoned']=0x0;_0x1b6c40[_0x98c5('0x7')]=0x0;if(_0x1b6c40[_0x98c5('0x8')]){if(_0x1b6c40[_0x98c5('0x9')]===_0x98c5('0xa')){_0x1b6c40[_0x98c5('0xa')]+=0x1;updateWaitingCounter(_0x1b6c40);}if(_0x1b6c40[_0x98c5('0xb')]){_0x1b6c40['answered']+=0x1;if(_0x1b6c40['talking']){_0x1b6c40[_0x98c5('0x5')]-=0x1;}}else{if(_0x1b6c40[_0x98c5('0x9')]){_0x1b6c40[_0x98c5('0x6')]+=0x1;updateWaitingCounter(_0x1b6c40);}}}else{if(!_0x1b6c40[_0x98c5('0xb')]){_0x1b6c40['waiting']+=0x1;}if(_0x1b6c40[_0x98c5('0xb')]){_0x1b6c40[_0x98c5('0x5')]+=0x1;updateWaitingCounter(_0x1b6c40);}}_0x1b6c40[_0x98c5('0x7')]+=0x1;return _0x1b6c40;}function getLastMessageText(_0x429ecf){return db[_0x98c5('0xc')][_0x98c5('0xd')]({'where':{'$and':[{'MailInteractionId':_0x429ecf['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x98c5('0xe')],'order':_0x98c5('0xf'),'raw':!![]})[_0x98c5('0x10')](function(_0x3e7397){if(_0x3e7397&&_0x3e7397[_0x98c5('0xe')]){_0x429ecf['lastMsgText']=_[_0x98c5('0x11')](_0x3e7397[_0x98c5('0xe')]);}return _0x429ecf;})[_0x98c5('0x12')](function(_0x29a55a){throw _0x29a55a;});}exports[_0x98c5('0x13')]=function(_0x26314d,_0x4adefa,_0x3cfcd5,_0x1c123f){return new Promise(function(_0x27ec6b,_0x38a900){return getInteractionUsers(_0x26314d['id'],_0x3cfcd5)['then'](function(_0x282773){_0x26314d[_0x98c5('0x14')]=_0x282773;return getInteractionTags(_0x26314d['TagIds'],_0x4adefa);})[_0x98c5('0x10')](function(_0xe5c532){_0x26314d[_0x98c5('0x15')]=_0xe5c532;delete _0x26314d[_0x98c5('0x16')];return updateInteractionCounters(_0x26314d);})[_0x98c5('0x10')](function(_0x50ee67){if(_0x1c123f){return getLastMessageText(_0x50ee67);}else{return _0x50ee67;}})[_0x98c5('0x10')](function(_0xbf39d2){_0x27ec6b(_0xbf39d2);})[_0x98c5('0x12')](function(_0x21ca43){_0x38a900(_0x21ca43);});});}; \ No newline at end of file +var _0x3299=['abandoned','total','disposition','answered','talking','unmanaged','UserId','MailMessage','findOne','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','TagIds','Tags','lodash','../../mysqldb','fullname','split','push','waiting'];(function(_0x3353f3,_0x189c73){var _0x2c268c=function(_0x478936){while(--_0x478936){_0x3353f3['push'](_0x3353f3['shift']());}};_0x2c268c(++_0x189c73);}(_0x3299,0x132));var _0x9329=function(_0x1ce3a5,_0x419465){_0x1ce3a5=_0x1ce3a5-0x0;var _0x539169=_0x3299[_0x1ce3a5];return _0x539169;};'use strict';var _=require(_0x9329('0x0'));var db=require(_0x9329('0x1'))['db'];function getInteractionUsers(_0x1be45f,_0x4f8e3e){return new Promise(function(_0x1e1aae,_0xc63001){try{var _0x937286=[];if(_0x4f8e3e[_0x1be45f]){_0x937286=_0x4f8e3e[_0x1be45f]['map'](function(_0x33f8b5){return{'id':_0x33f8b5['id'],'fullname':_0x33f8b5[_0x9329('0x2')]};});}return _0x1e1aae(_0x937286);}catch(_0x31d1f3){_0xc63001(_0x31d1f3);}});}function getInteractionTags(_0x218a67,_0x13d6cb){var _0x3e7560=[];if(_0x218a67){_0x218a67[_0x9329('0x3')](',')['forEach'](function(_0x45c81f){_0x3e7560[_0x9329('0x4')](_0x13d6cb[_0x45c81f]);});}return _0x3e7560;}function updateWaitingCounter(_0x3c3260){if(_0x3c3260[_0x9329('0x5')]){_0x3c3260[_0x9329('0x5')]-=0x1;}}function updateInteractionCounters(_0x43475b){_0x43475b['waiting']=0x0;_0x43475b['talking']=0x0;_0x43475b['answered']=0x0;_0x43475b['unmanaged']=0x0;_0x43475b[_0x9329('0x6')]=0x0;_0x43475b[_0x9329('0x7')]=0x0;if(_0x43475b['closed']){if(_0x43475b[_0x9329('0x8')]==='abandoned'){_0x43475b['abandoned']+=0x1;updateWaitingCounter(_0x43475b);}if(_0x43475b['UserId']){_0x43475b[_0x9329('0x9')]+=0x1;if(_0x43475b['talking']){_0x43475b[_0x9329('0xa')]-=0x1;}}else{if(_0x43475b['disposition']){_0x43475b[_0x9329('0xb')]+=0x1;updateWaitingCounter(_0x43475b);}}}else{if(!_0x43475b[_0x9329('0xc')]){_0x43475b[_0x9329('0x5')]+=0x1;}if(_0x43475b[_0x9329('0xc')]){_0x43475b['talking']+=0x1;updateWaitingCounter(_0x43475b);}}_0x43475b[_0x9329('0x7')]+=0x1;return _0x43475b;}function getLastMessageText(_0x42cf74){return db[_0x9329('0xd')][_0x9329('0xe')]({'where':{'$and':[{'MailInteractionId':_0x42cf74['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x9329('0xf')],'order':_0x9329('0x10'),'raw':!![]})[_0x9329('0x11')](function(_0x49a63a){if(_0x49a63a&&_0x49a63a[_0x9329('0xf')]){_0x42cf74[_0x9329('0x12')]=_[_0x9329('0x13')](_0x49a63a['plainBody']);}return _0x42cf74;})[_0x9329('0x14')](function(_0x3ea1ec){throw _0x3ea1ec;});}exports[_0x9329('0x15')]=function(_0x459a5b,_0x8af71,_0x14f075,_0xce7bff){return new Promise(function(_0x3dd9ed,_0x797f68){return getInteractionUsers(_0x459a5b['id'],_0x14f075)['then'](function(_0xb8c3b3){_0x459a5b['Users']=_0xb8c3b3;return getInteractionTags(_0x459a5b[_0x9329('0x16')],_0x8af71);})[_0x9329('0x11')](function(_0x1ebf5e){_0x459a5b[_0x9329('0x17')]=_0x1ebf5e;delete _0x459a5b['TagIds'];return updateInteractionCounters(_0x459a5b);})[_0x9329('0x11')](function(_0x144738){if(_0xce7bff){return getLastMessageText(_0x144738);}else{return _0x144738;}})[_0x9329('0x11')](function(_0x29f735){_0x3dd9ed(_0x29f735);})[_0x9329('0x14')](function(_0x2d1246){_0x797f68(_0x2d1246);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 8b75347..084f1f0 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 _0x1aa1=['stringify','null','Interaction','findOne','update','then','info','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','InteractionId','upperFirst','unknown','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x1aa1,0x18d));var _0x11aa=function(_0xc418e3,_0x27abf1){_0xc418e3=_0xc418e3-0x0;var _0x263cd5=_0x1aa1[_0xc418e3];return _0x263cd5;};'use strict';var _=require(_0x11aa('0x0'));var db=require(_0x11aa('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x11aa('0x2')),'mail':require(_0x11aa('0x3'))(_0x11aa('0x4')),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x11aa('0x3'))('sms-interactions'),'chat':require(_0x11aa('0x3'))(_0x11aa('0x5')),'whatsapp':require(_0x11aa('0x3'))(_0x11aa('0x6'))};function getAccountFK(_0x4a2fe5){return _[_0x11aa('0x7')](_0x4a2fe5)+(_0x4a2fe5===_0x11aa('0x8')?_0x11aa('0x9'):'Account')+'Id';}function getInteractionFK(_0x28852a){return _[_0x11aa('0x7')](_0x28852a)+_0x11aa('0xa');}function getInteractionId(_0x43478d,_0x53ef1f,_0x1f0552){if(_0x43478d&&_0x43478d[_[_0x11aa('0xb')](_0x1f0552)+_0x11aa('0xa')]){return _0x43478d[_[_0x11aa('0xb')](_0x1f0552)+'InteractionId'];}else if(_0x43478d&&_0x43478d['id']){return _0x43478d['id'];}else if(_0x53ef1f&&_0x53ef1f['id']){return _0x53ef1f['id'];}else{return _0x11aa('0xc');}}function getInteractionsTables(_0x7ccac8){return{'accounts':_0x7ccac8+'_'+(_0x7ccac8==='chat'?'websites':_0x11aa('0xd')),'interactions':_0x7ccac8+_0x11aa('0xe'),'interactionsTags':_0x7ccac8+_0x11aa('0xf'),'messages':_0x7ccac8+_0x11aa('0x10'),'userInteractions':_0x11aa('0x11')+_0x7ccac8+_0x11aa('0xe')};}function getSelectedTags(_0x30a886){var _0x48d3b5=[];if(_0x30a886){_0x48d3b5=Array[_0x11aa('0x12')](_0x30a886)?_0x30a886:[_0x30a886];}return _0x48d3b5;}function log(_0x422281,_0x16687e,_0x19f59e,_0x3a9e73,_0x669c98,_0x2c23b5){loggers[_0x669c98[_0x11aa('0x13')]()][_0x422281](_0x11aa('0x14'),_0x2c23b5[_0x11aa('0x15')](),_0x16687e?_0x16687e['id']:null,_0x16687e?_0x16687e[_0x11aa('0x16')]:null,_0x16687e?_0x16687e['role']:null,getInteractionId(_0x19f59e,_0x3a9e73,_0x669c98),_0x19f59e?JSON[_0x11aa('0x17')](_0x19f59e):_0x11aa('0x18'));}function updateUser(_0x458c0b,_0x5de889,_0x3bb563,_0x5db27c,_0x31cbfd){db[_[_0x11aa('0xb')](_0x5db27c)+_0x11aa('0x19')][_0x11aa('0x1a')]({'where':{'id':getInteractionId(_0x5de889,_0x3bb563,_0x5db27c)}})['then'](function(_0x1f8d82){if(_0x1f8d82){return _0x1f8d82[_0x11aa('0x1b')]({'UserId':_0x458c0b?_0x458c0b['id']:null});}})[_0x11aa('0x1c')](function(_0x26d759){if(_0x26d759){log(_0x11aa('0x1d'),_0x458c0b,_0x5de889,_0x3bb563,_0x5db27c,_0x31cbfd);}})['catch'](function(){log('error',_0x458c0b,_0x5de889,_0x3bb563,_0x5db27c,_0x31cbfd);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x55fe=['toUpperCase','name','stringify','null','findOne','info','catch','error','exports','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','Account','capitalize','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x3b3a91,_0x28edcc){var _0x4e0a78=function(_0x4dd445){while(--_0x4dd445){_0x3b3a91['push'](_0x3b3a91['shift']());}};_0x4e0a78(++_0x28edcc);}(_0x55fe,0x1e5));var _0xe55f=function(_0x585e75,_0x462817){_0x585e75=_0x585e75-0x0;var _0x5c9e8f=_0x55fe[_0x585e75];return _0x5c9e8f;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xe55f('0x0'))(_0xe55f('0x1')),'mail':require(_0xe55f('0x0'))(_0xe55f('0x2')),'fax':require('../../config/logger')(_0xe55f('0x3')),'sms':require(_0xe55f('0x0'))(_0xe55f('0x4')),'chat':require(_0xe55f('0x0'))('chat-interactions'),'whatsapp':require(_0xe55f('0x0'))('whatsapp-interactions')};function getAccountFK(_0x47996d){return _['capitalize'](_0x47996d)+(_0x47996d==='chat'?'Website':_0xe55f('0x5'))+'Id';}function getInteractionFK(_0x2fd45c){return _[_0xe55f('0x6')](_0x2fd45c)+_0xe55f('0x7');}function getInteractionId(_0xc44601,_0x4fbf9a,_0x274604){if(_0xc44601&&_0xc44601[_[_0xe55f('0x8')](_0x274604)+'InteractionId']){return _0xc44601[_['upperFirst'](_0x274604)+_0xe55f('0x7')];}else if(_0xc44601&&_0xc44601['id']){return _0xc44601['id'];}else if(_0x4fbf9a&&_0x4fbf9a['id']){return _0x4fbf9a['id'];}else{return _0xe55f('0x9');}}function getInteractionsTables(_0xef8069){return{'accounts':_0xef8069+'_'+(_0xef8069==='chat'?_0xe55f('0xa'):_0xe55f('0xb')),'interactions':_0xef8069+_0xe55f('0xc'),'interactionsTags':_0xef8069+_0xe55f('0xd'),'messages':_0xef8069+_0xe55f('0xe'),'userInteractions':_0xe55f('0xf')+_0xef8069+_0xe55f('0xc')};}function getSelectedTags(_0x43e180){var _0x2754bf=[];if(_0x43e180){_0x2754bf=Array[_0xe55f('0x10')](_0x43e180)?_0x43e180:[_0x43e180];}return _0x2754bf;}function log(_0x3b9315,_0x1d0af2,_0x1379c3,_0x439bc2,_0x2b7a5f,_0xf6e858){loggers[_0x2b7a5f[_0xe55f('0x11')]()][_0x3b9315](_0xe55f('0x12'),_0xf6e858[_0xe55f('0x13')](),_0x1d0af2?_0x1d0af2['id']:null,_0x1d0af2?_0x1d0af2[_0xe55f('0x14')]:null,_0x1d0af2?_0x1d0af2['role']:null,getInteractionId(_0x1379c3,_0x439bc2,_0x2b7a5f),_0x1379c3?JSON[_0xe55f('0x15')](_0x1379c3):_0xe55f('0x16'));}function updateUser(_0x1f9aae,_0x521b56,_0x5e5285,_0x245a39,_0xa1f1c6){db[_[_0xe55f('0x8')](_0x245a39)+'Interaction'][_0xe55f('0x17')]({'where':{'id':getInteractionId(_0x521b56,_0x5e5285,_0x245a39)}})['then'](function(_0x534ce0){if(_0x534ce0){return _0x534ce0['update']({'UserId':_0x1f9aae?_0x1f9aae['id']:null});}})['then'](function(_0x52a744){if(_0x52a744){log(_0xe55f('0x18'),_0x1f9aae,_0x521b56,_0x5e5285,_0x245a39,_0xa1f1c6);}})[_0xe55f('0x19')](function(){log(_0xe55f('0x1a'),_0x1f9aae,_0x521b56,_0x5e5285,_0x245a39,_0xa1f1c6);});}module[_0xe55f('0x1b')]={'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 69f727a..5cab634 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 _0x0d25=['user','crypto','util','composable-middleware','data1','license','split','createDecipher','aes-256-ctr','format','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin'];(function(_0x5e76d6,_0x1f92d2){var _0x375326=function(_0x4eec07){while(--_0x4eec07){_0x5e76d6['push'](_0x5e76d6['shift']());}};_0x375326(++_0x1f92d2);}(_0x0d25,0x97));var _0x50d2=function(_0x3df9dd,_0x26f5cd){_0x3df9dd=_0x3df9dd-0x0;var _0x4f11e4=_0x0d25[_0x3df9dd];return _0x4f11e4;};'use strict';var crypto=require(_0x50d2('0x0'));var util=require(_0x50d2('0x1'));var compose=require(_0x50d2('0x2'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x11d1d7,_0xc668c5){if(_0x11d1d7&&_0xc668c5){if(_0xc668c5[_0x50d2('0x3')]&&_0xc668c5[_0x50d2('0x4')]){var _0x55004b=_0xc668c5[_0x50d2('0x3')];var _0x3ccb1f=_0xc668c5[_0x50d2('0x4')];var _0x5140f6=_0x55004b[_0x50d2('0x5')]('-')[0x4];var _0x859419=_0x55004b['split']('-')[0x0];var _0x30f393=crypto[_0x50d2('0x6')](_0x50d2('0x7'),util[_0x50d2('0x8')]('%s:%s:%s',_0x5140f6,_0x55004b,_0x859419));var _0x1ee541=_0x30f393['update'](_0x3ccb1f,'base64',_0x50d2('0x9'));_0x1ee541+=_0x30f393[_0x50d2('0xa')]('utf8');var _0x471c06=JSON[_0x50d2('0xb')](_0x1ee541);return _0x471c06[_0x50d2('0xc')](_0x11d1d7)?_0x471c06[_0x11d1d7]:null;}}return null;}function isLimit(_0x522c50,_0x9253ce,_0x4a5b93,_0x1c061b){var _0x2fa5c1=_0x9253ce;return compose()[_0x50d2('0xd')](function(_0x53ad22,_0x17da54,_0x24234b){return db[_0x50d2('0xe')][_0x50d2('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x50d2('0x10')](function(_0x4af80b){var _0xc92f53=getValueFromLicense(_0x522c50,_0x4af80b);return _0xc92f53?_0xc92f53:_0x2fa5c1;})[_0x50d2('0x10')](function(_0x39ce99){_0x2fa5c1=_0x39ce99;return _0x4a5b93[_0x50d2('0x11')](_0x1c061b);})[_0x50d2('0x10')](function(_0x3af317){if(_0x3af317>=_0x2fa5c1){return _0x17da54['status'](0x193)[_0x50d2('0x12')]({'message':util['format'](_0x50d2('0x13'),_0x522c50)});}_0x24234b();})[_0x50d2('0x14')](function(_0x8e0b91){_0x24234b(_0x8e0b91);});});}function isUserLimit(){return isLimit(_0x50d2('0x15'),0x1,db[_0x50d2('0x16')],{'where':{'$or':[{'role':_0x50d2('0x17')},{'role':_0x50d2('0x18')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0xa5d1=['split','createDecipher','format','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','use','findOne','count','status','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license'];(function(_0x384043,_0x1de41e){var _0x4908f0=function(_0x2cbc79){while(--_0x2cbc79){_0x384043['push'](_0x384043['shift']());}};_0x4908f0(++_0x1de41e);}(_0xa5d1,0xfd));var _0x1a5d=function(_0x1d52df,_0x20e2ea){_0x1d52df=_0x1d52df-0x0;var _0x2265c9=_0xa5d1[_0x1d52df];return _0x2265c9;};'use strict';var crypto=require(_0x1a5d('0x0'));var util=require(_0x1a5d('0x1'));var compose=require(_0x1a5d('0x2'));var db=require(_0x1a5d('0x3'))['db'];var config=require(_0x1a5d('0x4'));function getValueFromLicense(_0x3247fd,_0x51effb){if(_0x3247fd&&_0x51effb){if(_0x51effb[_0x1a5d('0x5')]&&_0x51effb[_0x1a5d('0x6')]){var _0x50fe0a=_0x51effb[_0x1a5d('0x5')];var _0x37f614=_0x51effb['license'];var _0x26bade=_0x50fe0a['split']('-')[0x4];var _0xaebe27=_0x50fe0a[_0x1a5d('0x7')]('-')[0x0];var _0x3cb644=crypto[_0x1a5d('0x8')]('aes-256-ctr',util[_0x1a5d('0x9')](_0x1a5d('0xa'),_0x26bade,_0x50fe0a,_0xaebe27));var _0x2bdfbd=_0x3cb644[_0x1a5d('0xb')](_0x37f614,_0x1a5d('0xc'),_0x1a5d('0xd'));_0x2bdfbd+=_0x3cb644['final'](_0x1a5d('0xd'));var _0x2c3e63=JSON[_0x1a5d('0xe')](_0x2bdfbd);return _0x2c3e63[_0x1a5d('0xf')](_0x3247fd)?_0x2c3e63[_0x3247fd]:null;}}return null;}function isLimit(_0x3f61c3,_0x493d73,_0x250500,_0x12f8ec){var _0x1d431c=_0x493d73;return compose()[_0x1a5d('0x10')](function(_0x4358e6,_0x14a77a,_0x4e5810){return db['License'][_0x1a5d('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x5dc885){var _0x1e01c5=getValueFromLicense(_0x3f61c3,_0x5dc885);return _0x1e01c5?_0x1e01c5:_0x1d431c;})['then'](function(_0x5c8473){_0x1d431c=_0x5c8473;return _0x250500[_0x1a5d('0x12')](_0x12f8ec);})['then'](function(_0x56812b){if(_0x56812b>=_0x1d431c){return _0x14a77a[_0x1a5d('0x13')](0x193)['json']({'message':util[_0x1a5d('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x3f61c3)});}_0x4e5810();})[_0x1a5d('0x14')](function(_0x2503b1){_0x4e5810(_0x2503b1);});});}function isUserLimit(){return isLimit(_0x1a5d('0x15'),0x1,db[_0x1a5d('0x16')],{'where':{'$or':[{'role':_0x1a5d('0x17')},{'role':_0x1a5d('0x18')}]}});}exports[_0x1a5d('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index dbf02ad..902e734 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 _0x812c=['$between','value','includes','$gt','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','$ne','\x20OR\x20','field','\x20IS\x20NULL)','$in','$notIn','=\x20?','<>\x20?','$startsWith','$endsWith','$lt','<\x20?','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','shift','pop','DATE','utcOffset','add','hours','minutes','seconds','lodash','moment','parseSearch','startsWith','and','replace','[$and]','[$or]','split','forEach','match','filter','conditions','push','buildExpression','operator','$eq'];(function(_0x42991d,_0x48b22a){var _0x20b6dd=function(_0x175685){while(--_0x175685){_0x42991d['push'](_0x42991d['shift']());}};_0x20b6dd(++_0x48b22a);}(_0x812c,0x139));var _0xc812=function(_0x5e9693,_0x1eb992){_0x5e9693=_0x5e9693-0x0;var _0x5163e8=_0x812c[_0x5e9693];return _0x5163e8;};'use strict';var _=require(_0xc812('0x0'));var moment=require(_0xc812('0x1'));exports[_0xc812('0x2')]=function(_0x392b54){var _0x4f5a39={'conditions':[]};_0x4f5a39['sqlOperator']=_[_0xc812('0x3')](_0x392b54,'[$or]')?'or':_0xc812('0x4');var _0x39884c=_0x392b54[_0xc812('0x5')](_0xc812('0x6'),'')['replace'](_0xc812('0x7'),'')[_0xc812('0x8')]('||');for(var _0xa6de35=0x0;_0xa6de35<_0x39884c['length'];_0xa6de35++){var _0x3d01cc=_0x39884c[_0xa6de35][_0xc812('0x8')](':=');var _0xdf1b60=_0x3d01cc[0x0];var _0x9c10be=_0x3d01cc['slice'](0x1);_0x9c10be[_0xc812('0x9')](function(_0x1d1fdc){var _0xa486a=_0x1d1fdc[_0xc812('0x8')]('[')['shift']();var _0x25423f=_0x1d1fdc[_0xc812('0xa')](/\[(.*?)\]/g);_0x25423f[_0xc812('0x9')](function(_0x301be2){var _0x4ab921=_0x301be2[_0xc812('0x8')]('[')[_0xc812('0xb')](function(_0x2d3764){return _0x2d3764['indexOf'](']')>-0x1;})['map'](function(_0x545da6){return _0x545da6[_0xc812('0x8')](']')[0x0];})[0x0];_0x4f5a39[_0xc812('0xc')][_0xc812('0xd')]({'field':_0xdf1b60,'operator':_0xa486a,'value':_0x4ab921});});});}return _0x4f5a39;};exports[_0xc812('0xe')]=function(_0x203204,_0x43adff,_0x4045a6){var _0x12e66e={};if(_0x43adff==='DATE'){if(_0x4045a6[_0xc812('0xf')]===_0xc812('0x10')){_0x4045a6[_0xc812('0xf')]=_0xc812('0x11');_0x4045a6[_0xc812('0x12')]+=','+_0x4045a6[_0xc812('0x12')];}else if(_[_0xc812('0x13')]([_0xc812('0x14'),_0xc812('0x15')],_0x4045a6[_0xc812('0xf')])){_0x4045a6[_0xc812('0x12')]=moment(_0x4045a6[_0xc812('0x12')])['add'](0x1,_0xc812('0x16'))[_0xc812('0x17')](_0xc812('0x18'));}}if(_0x4045a6[_0xc812('0x19')]){_0x43adff=_0x4045a6['castTo'];_0x12e66e[_0xc812('0x1a')]=_0xc812('0x1b')+_0x203204+'.'+_0x4045a6['field']+_0xc812('0x1c')+_0x4045a6[_0xc812('0x19')]+')\x20'+parseOperator(_0x4045a6['operator']);}else{_0x12e66e[_0xc812('0x1a')]=_0x203204+'.'+_0x4045a6['field']+'\x20'+parseOperator(_0x4045a6[_0xc812('0xf')]);}if(_[_0xc812('0x13')]([_0xc812('0x1d'),'$notIn'],_0x4045a6[_0xc812('0xf')]))_0x12e66e['text']='('+_0x12e66e[_0xc812('0x1a')]+_0xc812('0x1e')+_0x203204+'.'+_0x4045a6[_0xc812('0x1f')]+_0xc812('0x20');_0x12e66e[_0xc812('0x12')]=parseValue(_0x43adff,_0x4045a6[_0xc812('0xf')],_0x4045a6['value']);return _0x12e66e;};function parseOperator(_0x174fa0){var _0x39a940;switch(_0x174fa0){case _0xc812('0x21'):_0x39a940='IN\x20?';break;case _0xc812('0x22'):_0x39a940='NOT\x20IN\x20?';break;case _0xc812('0x10'):_0x39a940=_0xc812('0x23');break;case _0xc812('0x1d'):_0x39a940=_0xc812('0x24');break;case'$substring':case _0xc812('0x25'):case _0xc812('0x26'):_0x39a940='LIKE\x20?';break;case _0xc812('0x27'):_0x39a940=_0xc812('0x28');break;case'$gt':_0x39a940=_0xc812('0x29');break;case _0xc812('0x15'):_0x39a940='<=\x20?';break;case _0xc812('0x2a'):_0x39a940=_0xc812('0x2b');break;case _0xc812('0x11'):_0x39a940=_0xc812('0x2c');break;}return _0x39a940;}function parseValue(_0x53cec0,_0x2d1d97,_0x59cdc4){var _0x1ffa40={'start':undefined,'end':undefined};switch(_0x2d1d97){case'$in':case _0xc812('0x22'):_0x1ffa40[_0xc812('0x2d')]=_0x59cdc4[_0xc812('0x8')](',');break;case _0xc812('0x2e'):_0x1ffa40['start']='%'+_0x59cdc4+'%';break;case _0xc812('0x25'):_0x1ffa40[_0xc812('0x2d')]=_0x59cdc4+'%';break;case _0xc812('0x26'):_0x1ffa40[_0xc812('0x2d')]='%'+_0x59cdc4;break;case _0xc812('0x11'):var _0x6e8daa=_0x59cdc4[_0xc812('0x8')](',');var _0x59cdc4=_0x6e8daa[_0xc812('0x2f')]();var _0x10222b=_0x6e8daa[_0xc812('0x30')]();if(_0x53cec0===_0xc812('0x31')){_0x59cdc4=moment(_0x59cdc4)[_0xc812('0x32')](0x0,!![])[_0xc812('0x17')]();_0x10222b=moment(_0x10222b)[_0xc812('0x32')](0x0,!![])[_0xc812('0x33')](0x17,_0xc812('0x34'))[_0xc812('0x33')](0x3b,_0xc812('0x35'))[_0xc812('0x33')](0x3b,_0xc812('0x36'))['format']();}_0x1ffa40={'start':_0x59cdc4,'end':_0x10222b};break;default:_0x1ffa40[_0xc812('0x2d')]=_0x59cdc4;break;}return _0x1ffa40;} \ No newline at end of file +var _0x55f8=['IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$lte','<=\x20?','$gte','$between','BETWEEN\x20?\x20AND\x20?','$in','start','utcOffset','hours','minutes','seconds','lodash','parseSearch','startsWith','and','replace','[$or]','length','slice','forEach','split','shift','match','indexOf','map','conditions','buildExpression','DATE','operator','$eq','value','$gt','add','days','format','castTo','text','\x20AS\x20','includes','$ne','$notIn','\x20OR\x20','field'];(function(_0x48aad4,_0x4a029c){var _0x3ef8dc=function(_0x17ee25){while(--_0x17ee25){_0x48aad4['push'](_0x48aad4['shift']());}};_0x3ef8dc(++_0x4a029c);}(_0x55f8,0xe9));var _0x855f=function(_0xedd299,_0x324f86){_0xedd299=_0xedd299-0x0;var _0x3b125d=_0x55f8[_0xedd299];return _0x3b125d;};'use strict';var _=require(_0x855f('0x0'));var moment=require('moment');exports[_0x855f('0x1')]=function(_0x452b71){var _0x987b25={'conditions':[]};_0x987b25['sqlOperator']=_[_0x855f('0x2')](_0x452b71,'[$or]')?'or':_0x855f('0x3');var _0x318c07=_0x452b71[_0x855f('0x4')]('[$and]','')[_0x855f('0x4')](_0x855f('0x5'),'')['split']('||');for(var _0x359b16=0x0;_0x359b16<_0x318c07[_0x855f('0x6')];_0x359b16++){var _0x35dac6=_0x318c07[_0x359b16]['split'](':=');var _0x2a948f=_0x35dac6[0x0];var _0x3a86eb=_0x35dac6[_0x855f('0x7')](0x1);_0x3a86eb[_0x855f('0x8')](function(_0x12a015){var _0x3b2763=_0x12a015[_0x855f('0x9')]('[')[_0x855f('0xa')]();var _0x1e75d2=_0x12a015[_0x855f('0xb')](/\[(.*?)\]/g);_0x1e75d2[_0x855f('0x8')](function(_0x4cef9b){var _0x5c9653=_0x4cef9b[_0x855f('0x9')]('[')['filter'](function(_0x300e28){return _0x300e28[_0x855f('0xc')](']')>-0x1;})[_0x855f('0xd')](function(_0xe4d012){return _0xe4d012[_0x855f('0x9')](']')[0x0];})[0x0];_0x987b25[_0x855f('0xe')]['push']({'field':_0x2a948f,'operator':_0x3b2763,'value':_0x5c9653});});});}return _0x987b25;};exports[_0x855f('0xf')]=function(_0x8a6369,_0x481ca6,_0x250177){var _0x2513df={};if(_0x481ca6===_0x855f('0x10')){if(_0x250177[_0x855f('0x11')]===_0x855f('0x12')){_0x250177[_0x855f('0x11')]='$between';_0x250177[_0x855f('0x13')]+=','+_0x250177[_0x855f('0x13')];}else if(_['includes']([_0x855f('0x14'),'$lte'],_0x250177[_0x855f('0x11')])){_0x250177[_0x855f('0x13')]=moment(_0x250177[_0x855f('0x13')])[_0x855f('0x15')](0x1,_0x855f('0x16'))[_0x855f('0x17')]('YYYY-MM-DD');}}if(_0x250177[_0x855f('0x18')]){_0x481ca6=_0x250177[_0x855f('0x18')];_0x2513df[_0x855f('0x19')]='CAST('+_0x8a6369+'.'+_0x250177['field']+_0x855f('0x1a')+_0x250177[_0x855f('0x18')]+')\x20'+parseOperator(_0x250177[_0x855f('0x11')]);}else{_0x2513df[_0x855f('0x19')]=_0x8a6369+'.'+_0x250177['field']+'\x20'+parseOperator(_0x250177[_0x855f('0x11')]);}if(_[_0x855f('0x1b')]([_0x855f('0x1c'),_0x855f('0x1d')],_0x250177[_0x855f('0x11')]))_0x2513df[_0x855f('0x19')]='('+_0x2513df['text']+_0x855f('0x1e')+_0x8a6369+'.'+_0x250177[_0x855f('0x1f')]+'\x20IS\x20NULL)';_0x2513df[_0x855f('0x13')]=parseValue(_0x481ca6,_0x250177['operator'],_0x250177[_0x855f('0x13')]);return _0x2513df;};function parseOperator(_0xc47116){var _0x217a30;switch(_0xc47116){case'$in':_0x217a30=_0x855f('0x20');break;case _0x855f('0x1d'):_0x217a30=_0x855f('0x21');break;case _0x855f('0x12'):_0x217a30='=\x20?';break;case _0x855f('0x1c'):_0x217a30=_0x855f('0x22');break;case _0x855f('0x23'):case _0x855f('0x24'):case _0x855f('0x25'):_0x217a30=_0x855f('0x26');break;case _0x855f('0x27'):_0x217a30=_0x855f('0x28');break;case _0x855f('0x14'):_0x217a30=_0x855f('0x29');break;case _0x855f('0x2a'):_0x217a30=_0x855f('0x2b');break;case _0x855f('0x2c'):_0x217a30='>=\x20?';break;case _0x855f('0x2d'):_0x217a30=_0x855f('0x2e');break;}return _0x217a30;}function parseValue(_0x6390fa,_0x56a83c,_0x386f82){var _0x5cc194={'start':undefined,'end':undefined};switch(_0x56a83c){case _0x855f('0x2f'):case _0x855f('0x1d'):_0x5cc194[_0x855f('0x30')]=_0x386f82['split'](',');break;case _0x855f('0x23'):_0x5cc194['start']='%'+_0x386f82+'%';break;case _0x855f('0x24'):_0x5cc194[_0x855f('0x30')]=_0x386f82+'%';break;case _0x855f('0x25'):_0x5cc194[_0x855f('0x30')]='%'+_0x386f82;break;case _0x855f('0x2d'):var _0x128a7f=_0x386f82[_0x855f('0x9')](',');var _0x386f82=_0x128a7f['shift']();var _0x3bc369=_0x128a7f['pop']();if(_0x6390fa===_0x855f('0x10')){_0x386f82=moment(_0x386f82)[_0x855f('0x31')](0x0,!![])[_0x855f('0x17')]();_0x3bc369=moment(_0x3bc369)[_0x855f('0x31')](0x0,!![])[_0x855f('0x15')](0x17,_0x855f('0x32'))[_0x855f('0x15')](0x3b,_0x855f('0x33'))[_0x855f('0x15')](0x3b,_0x855f('0x34'))['format']();}_0x5cc194={'start':_0x386f82,'end':_0x3bc369};break;default:_0x5cc194['start']=_0x386f82;break;}return _0x5cc194;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 71d8f80..e993c08 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 _0xaa90=['col','lower','options','include','includeAll','lodash','moment','../../mysqldb','keys','includes','parse','alias','fields','split','filters','forOwn','find','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','substr','cast','ASC','omit','isEmpty','length','isObject','isString','unset','hasOwnProperty','match','^[+]?[0-9]*$','isEmail','\x22{EXPR}\x22','{EXPR}','replace','push','join','getOptions','query','$id','model','intersection','attributes','nolimit','order','pick','filter','columns','value','where','merge','VIRTUAL'];(function(_0x57803f,_0x86d2bc){var _0xdb136b=function(_0x51a5ac){while(--_0x51a5ac){_0x57803f['push'](_0x57803f['shift']());}};_0xdb136b(++_0x86d2bc);}(_0xaa90,0xce));var _0x0aa9=function(_0x3e7e49,_0x5cbd1c){_0x3e7e49=_0x3e7e49-0x0;var _0x25cf39=_0xaa90[_0x3e7e49];return _0x25cf39;};'use strict';var _=require(_0x0aa9('0x0'));var sequelize=require('sequelize');var moment=require(_0x0aa9('0x1'));var db=require(_0x0aa9('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x483349){var _0x397546=['ne'];try{var _0x184f44=JSON['parse'](_0x483349);var _0x539bdf=Object[_0x0aa9('0x3')](_0x184f44)[0x0];return _0x397546[_0x0aa9('0x4')](_0x539bdf);}catch(_0x195396){return![];}}function getOperatorValue(_0x3bfb47){var _0x1028bc=JSON['parse'](_0x3bfb47);var _0xd2c021=Object[_0x0aa9('0x3')](_0x1028bc)[0x0];var _0x37c2a1=_0x1028bc[_0xd2c021];return{['$'+_0xd2c021]:_0x37c2a1};}function parseIncludeModel(_0x357da0){var _0x513d89=JSON[_0x0aa9('0x5')](_0x357da0);return{'model':db[_0x513d89['model']],'as':_0x513d89[_0x0aa9('0x6')],'attributes':_0x513d89[_0x0aa9('0x7')],'raw':_0x513d89['raw']};}exports[_0x0aa9('0x7')]=function(_0x473867){var _0x18ff3e=null;if(_0x473867){_0x18ff3e=_0x473867[_0x0aa9('0x8')](',');}return _0x18ff3e;};exports[_0x0aa9('0x9')]=function(_0x10fb71,_0xc3ec12){var _0x59614b={};if(!_['isEmpty'](_0x10fb71)){_[_0x0aa9('0xa')](_0x10fb71,function(_0x221646,_0x44c310){try{if(_0xc3ec12){var _0x9a2b79=_[_0x0aa9('0xb')](_0xc3ec12,{'name':_0x44c310})||{};if(hasSequelizeOperator(_0x221646)){_0x59614b[_0x44c310]=getOperatorValue(_0x221646);}else if(_0x9a2b79[_0x0aa9('0xc')]===_0x0aa9('0xd')&&_[_0x0aa9('0xe')](_0x221646)){var _0x558ce8=JSON[_0x0aa9('0x5')](_0x221646);var _0x1afc90={'$gte':moment(moment(_0x558ce8[_0x0aa9('0xf')])['format'](_0x0aa9('0x10')))[_0x0aa9('0x11')]()[_0x0aa9('0x12')](),'$lte':moment(moment(_0x558ce8[_0x0aa9('0x13')])[_0x0aa9('0x12')]('YYYY-MM-DD'))['utc']()['subtract'](0x1,'s')[_0x0aa9('0x12')]()};_0x59614b[_0x44c310]=_0x1afc90;}else if(_0x9a2b79[_0x0aa9('0x14')]===_0x0aa9('0x15')){_0x59614b[_0x44c310]=_0x221646;}else{_0x59614b[_0x44c310]=_[_0x0aa9('0x16')](_0x221646)?_0x221646:JSON[_0x0aa9('0x5')](_0x221646);}}else{_0x59614b[_0x44c310]=_['isArray'](_0x221646)?_0x221646:JSON[_0x0aa9('0x5')](_0x221646);}}catch(_0x3de6c1){_0x59614b[_0x44c310]=_0x221646[_0x0aa9('0x8')](',');}});}return _0x59614b;};exports[_0x0aa9('0x17')]=function(_0x2b402c){_0x2b402c=parseInt(_0x2b402c,0xa);if(!_0x2b402c||_0x2b402c<0x0){_0x2b402c=LIMIT_VALUE;}return _0x2b402c;};exports[_0x0aa9('0x18')]=function(_0x41bd31){_0x41bd31=parseInt(_0x41bd31,0xa);if(!_0x41bd31||_0x41bd31<0x0){_0x41bd31=0x0;}return _0x41bd31;};exports[_0x0aa9('0x19')]=function(_0x5c797c){var _0x582689,_0x5bdda3=null;if(_0x5c797c){_0x582689=_0x5c797c[_0x0aa9('0x8')](',');_0x5bdda3=_[_0x0aa9('0x1a')](_0x582689,function(_0x135952){if(_0x135952[_0x0aa9('0x1b')]('-')===0x0){return[_0x135952===_0x0aa9('0x1c')?sequelize['cast'](sequelize['col'](_0x0aa9('0x1c')),'unsigned'):_0x135952[_0x0aa9('0x1d')](0x1),'DESC'];}else{return[_0x135952===_0x0aa9('0x1c')?sequelize[_0x0aa9('0x1e')](sequelize['col'](_0x0aa9('0x1c')),'unsigned'):_0x135952,_0x0aa9('0x1f')];}});}return _0x5bdda3;};exports[_0x0aa9('0x20')]=function(_0xe08bbd,_0xc82fd8){if(_[_0x0aa9('0x21')](_0xe08bbd)){return _0xe08bbd;}if(_[_0x0aa9('0x16')](_0xe08bbd)){for(var _0x1300df=0x0;_0x1300df<_0xe08bbd[_0x0aa9('0x22')];_0x1300df+=0x1){_0xe08bbd[_0x1300df]=this[_0x0aa9('0x20')](_0xe08bbd[_0x1300df],_0xc82fd8);}return _0xe08bbd;}if(!_[_0x0aa9('0x23')](_0xe08bbd)){return _0xe08bbd;}if(_[_0x0aa9('0x24')](_0xc82fd8)){_0xc82fd8=[_0xc82fd8];}if(!_[_0x0aa9('0x16')](_0xc82fd8)){return _0xe08bbd;}for(var _0x31e9d4=0x0;_0x31e9d4<_0xc82fd8[_0x0aa9('0x22')];_0x31e9d4+=0x1){_[_0x0aa9('0x25')](_0xe08bbd,_0xc82fd8[_0x31e9d4]);}for(var _0x166c5c in _0xe08bbd){if(_0xe08bbd[_0x0aa9('0x26')](_0x166c5c)){_0xe08bbd[_0x166c5c]=this[_0x0aa9('0x20')](_0xe08bbd[_0x166c5c],_0xc82fd8);}}return _0xe08bbd;};exports['isNumeric']=function(_0x55c465){return _0x55c465[_0x0aa9('0x27')](RegExp(_0x0aa9('0x28')))?!![]:![];};exports[_0x0aa9('0x29')]=function(_0x16a357){return _0x16a357[_0x0aa9('0x27')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x5603ce,_0x357316){var _0x12d588=[];var _0x5c281e=/[ `!@#$%^&*()_\-?~]/;var _0x31a46a=_0x357316?_0x0aa9('0x2a'):_0x0aa9('0x2b');_0x5603ce[_0x0aa9('0x8')](/[ ,]+/)['forEach'](function(_0x341095){_0x341095=_0x341095[_0x0aa9('0x2c')](/([^:]")"+/g,'$1');_0x341095='+'+_0x341095+'*';var _0xb5f76d=_0x341095[_0x0aa9('0x27')](_0x5c281e);if(_0xb5f76d){_0x341095='\x22'+_0x341095+'\x22';}_0x12d588[_0x0aa9('0x2d')](_0x341095);});_0x31a46a=_0x31a46a[_0x0aa9('0x2c')](_0x0aa9('0x2b'),_0x12d588[_0x0aa9('0x2e')]('\x20'));return _0x31a46a;};exports[_0x0aa9('0x2f')]=function(_0x3ded12,_0x3cc5c2,_0x389ba2){var _0x1cc018={},_0x5db10b={};if(_0x3cc5c2[_0x0aa9('0x30')][_0x0aa9('0x31')]){_0x3cc5c2[_0x0aa9('0x30')]['id']=_0x3cc5c2[_0x0aa9('0x30')][_0x0aa9('0x31')];delete _0x3cc5c2[_0x0aa9('0x30')]['$id'];}_0x1cc018[_0x0aa9('0x32')]=_[_0x0aa9('0x1a')](_0x3ded12,'name');_0x1cc018[_0x0aa9('0x30')]=_[_0x0aa9('0x3')](_0x3cc5c2[_0x0aa9('0x30')]);_0x1cc018[_0x0aa9('0x9')]=_[_0x0aa9('0x33')](_0x1cc018[_0x0aa9('0x32')],_0x1cc018[_0x0aa9('0x30')]);_0x5db10b[_0x0aa9('0x34')]=_[_0x0aa9('0x33')](_0x1cc018[_0x0aa9('0x32')],this[_0x0aa9('0x7')](_0x3cc5c2['query'][_0x0aa9('0x7')]));_0x5db10b[_0x0aa9('0x34')]=_0x5db10b[_0x0aa9('0x34')][_0x0aa9('0x22')]?_0x5db10b['attributes']:_0x1cc018[_0x0aa9('0x32')];if(!_0x3cc5c2[_0x0aa9('0x30')][_0x0aa9('0x26')](_0x0aa9('0x35'))){_0x5db10b[_0x0aa9('0x17')]=this[_0x0aa9('0x17')](_0x3cc5c2['query'][_0x0aa9('0x17')]);_0x5db10b[_0x0aa9('0x18')]=this[_0x0aa9('0x18')](_0x3cc5c2[_0x0aa9('0x30')]['offset']);}_0x5db10b[_0x0aa9('0x36')]=this['sort'](_0x3cc5c2[_0x0aa9('0x30')][_0x0aa9('0x19')]);_0x5db10b['where']=this[_0x0aa9('0x9')](_[_0x0aa9('0x37')](_0x3cc5c2['query'],_0x1cc018[_0x0aa9('0x9')]),_0x3ded12);if(_0x3cc5c2[_0x0aa9('0x30')][_0x0aa9('0x38')]){var _0x29966d=_0x3ded12;var _0x32a748=_0x3cc5c2[_0x0aa9('0x30')]['filter'];if(typeof _0x32a748==='object'){_0x29966d=_[_0x0aa9('0x38')](_0x3ded12,function(_0xea1bdf){return _[_0x0aa9('0x4')](_0x32a748[_0x0aa9('0x39')],_0xea1bdf['name']);});_0x32a748=_0x32a748[_0x0aa9('0x3a')];}_0x5db10b[_0x0aa9('0x3b')]=_[_0x0aa9('0x3c')](_0x5db10b['where'],{'$or':_['map'](_0x29966d,function(_0x4ccf22){if(_0x4ccf22[_0x0aa9('0xc')]!==_0x0aa9('0x3d')){if(_0x389ba2){return sequelize[_0x0aa9('0x3b')](sequelize['fn']('lower',sequelize[_0x0aa9('0x3e')](_0x4ccf22[_0x0aa9('0x14')])),{'$like':sequelize['fn'](_0x0aa9('0x3f'),'%'+_0x3cc5c2['query']['filter']+'%')});}else{var _0x42ac97={};_0x42ac97[_0x4ccf22[_0x0aa9('0x14')]]={'$like':'%'+_0x3cc5c2[_0x0aa9('0x30')][_0x0aa9('0x38')]+'%'};return _0x42ac97;}}})});}_0x5db10b=_['merge']({},_0x5db10b,_0x3cc5c2[_0x0aa9('0x40')]);return _0x5db10b;};exports[_0x0aa9('0x41')]=function(_0xfc82b0){var _0x156ee5=[];if(_0xfc82b0[_0x0aa9('0x42')]){_0x156ee5[_0x0aa9('0x2d')]({'all':!![]});}else if(_0xfc82b0[_0x0aa9('0x41')]){if(Array[_0x0aa9('0x16')](_0xfc82b0['include'])){_0x156ee5=Object['keys'](_0xfc82b0[_0x0aa9('0x41')])['map'](function(_0x3e1d46){return parseIncludeModel(_0xfc82b0[_0x0aa9('0x41')][_0x3e1d46]);});}else{var _0x1aefd5=parseIncludeModel(_0xfc82b0[_0x0aa9('0x41')]);_0x156ee5[_0x0aa9('0x2d')](_0x1aefd5);}}return _0x156ee5;}; \ No newline at end of file +var _0xecd9=['filters','isEmpty','forOwn','find','type','isPlainObject','$gte','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','limit','sort','split','map','indexOf','priority','cast','col','unsigned','substr','ASC','length','omit','isObject','isString','unset','isNumeric','match','getFullTextValue','\x22{EXPR}\x22','{EXPR}','getOptions','query','$id','intersection','attributes','hasOwnProperty','offset','order','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','include','includeAll','push','lodash','sequelize','moment','../../mysqldb','parse','keys','includes','model','alias','fields','raw'];(function(_0x11c477,_0xdf0497){var _0x3682d9=function(_0x3e34a7){while(--_0x3e34a7){_0x11c477['push'](_0x11c477['shift']());}};_0x3682d9(++_0xdf0497);}(_0xecd9,0x13f));var _0x9ecd=function(_0x464dc8,_0x5b62ef){_0x464dc8=_0x464dc8-0x0;var _0x3b16b5=_0xecd9[_0x464dc8];return _0x3b16b5;};'use strict';var _=require(_0x9ecd('0x0'));var sequelize=require(_0x9ecd('0x1'));var moment=require(_0x9ecd('0x2'));var db=require(_0x9ecd('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x8cd66){var _0x1bb616=['ne'];try{var _0x20c114=JSON[_0x9ecd('0x4')](_0x8cd66);var _0x4abf6e=Object[_0x9ecd('0x5')](_0x20c114)[0x0];return _0x1bb616[_0x9ecd('0x6')](_0x4abf6e);}catch(_0x1e5d57){return![];}}function getOperatorValue(_0x3106a4){var _0x18346c=JSON['parse'](_0x3106a4);var _0x887b47=Object[_0x9ecd('0x5')](_0x18346c)[0x0];var _0x387020=_0x18346c[_0x887b47];return{['$'+_0x887b47]:_0x387020};}function parseIncludeModel(_0x3a2d40){var _0x398305=JSON[_0x9ecd('0x4')](_0x3a2d40);return{'model':db[_0x398305[_0x9ecd('0x7')]],'as':_0x398305[_0x9ecd('0x8')],'attributes':_0x398305[_0x9ecd('0x9')],'raw':_0x398305[_0x9ecd('0xa')]};}exports[_0x9ecd('0x9')]=function(_0x2362a2){var _0x4dc5ea=null;if(_0x2362a2){_0x4dc5ea=_0x2362a2['split'](',');}return _0x4dc5ea;};exports[_0x9ecd('0xb')]=function(_0x4ae43f,_0x2684b8){var _0x6420de={};if(!_[_0x9ecd('0xc')](_0x4ae43f)){_[_0x9ecd('0xd')](_0x4ae43f,function(_0x4ed277,_0x5ff91c){try{if(_0x2684b8){var _0x2907e8=_[_0x9ecd('0xe')](_0x2684b8,{'name':_0x5ff91c})||{};if(hasSequelizeOperator(_0x4ed277)){_0x6420de[_0x5ff91c]=getOperatorValue(_0x4ed277);}else if(_0x2907e8[_0x9ecd('0xf')]==='DATE'&&_[_0x9ecd('0x10')](_0x4ed277)){var _0x11dce2=JSON[_0x9ecd('0x4')](_0x4ed277);var _0x54a721={'$gte':moment(moment(_0x11dce2[_0x9ecd('0x11')])[_0x9ecd('0x12')](_0x9ecd('0x13')))[_0x9ecd('0x14')]()[_0x9ecd('0x12')](),'$lte':moment(moment(_0x11dce2['$lte'])[_0x9ecd('0x12')](_0x9ecd('0x13')))[_0x9ecd('0x14')]()[_0x9ecd('0x15')](0x1,'s')[_0x9ecd('0x12')]()};_0x6420de[_0x5ff91c]=_0x54a721;}else if(_0x2907e8[_0x9ecd('0x16')]===_0x9ecd('0x17')){_0x6420de[_0x5ff91c]=_0x4ed277;}else{_0x6420de[_0x5ff91c]=_[_0x9ecd('0x18')](_0x4ed277)?_0x4ed277:JSON[_0x9ecd('0x4')](_0x4ed277);}}else{_0x6420de[_0x5ff91c]=_[_0x9ecd('0x18')](_0x4ed277)?_0x4ed277:JSON[_0x9ecd('0x4')](_0x4ed277);}}catch(_0x161cb1){_0x6420de[_0x5ff91c]=_0x4ed277['split'](',');}});}return _0x6420de;};exports[_0x9ecd('0x19')]=function(_0x188965){_0x188965=parseInt(_0x188965,0xa);if(!_0x188965||_0x188965<0x0){_0x188965=LIMIT_VALUE;}return _0x188965;};exports['offset']=function(_0x1dc65c){_0x1dc65c=parseInt(_0x1dc65c,0xa);if(!_0x1dc65c||_0x1dc65c<0x0){_0x1dc65c=0x0;}return _0x1dc65c;};exports[_0x9ecd('0x1a')]=function(_0x10028d){var _0x55f680,_0x1b8dbc=null;if(_0x10028d){_0x55f680=_0x10028d[_0x9ecd('0x1b')](',');_0x1b8dbc=_[_0x9ecd('0x1c')](_0x55f680,function(_0x275a94){if(_0x275a94[_0x9ecd('0x1d')]('-')===0x0){return[_0x275a94===_0x9ecd('0x1e')?sequelize[_0x9ecd('0x1f')](sequelize[_0x9ecd('0x20')]('priority'),_0x9ecd('0x21')):_0x275a94[_0x9ecd('0x22')](0x1),'DESC'];}else{return[_0x275a94===_0x9ecd('0x1e')?sequelize[_0x9ecd('0x1f')](sequelize[_0x9ecd('0x20')](_0x9ecd('0x1e')),'unsigned'):_0x275a94,_0x9ecd('0x23')];}});}return _0x1b8dbc;};exports['omit']=function(_0x54d9ae,_0x1df783){if(_[_0x9ecd('0xc')](_0x54d9ae)){return _0x54d9ae;}if(_[_0x9ecd('0x18')](_0x54d9ae)){for(var _0xdc0a5b=0x0;_0xdc0a5b<_0x54d9ae[_0x9ecd('0x24')];_0xdc0a5b+=0x1){_0x54d9ae[_0xdc0a5b]=this[_0x9ecd('0x25')](_0x54d9ae[_0xdc0a5b],_0x1df783);}return _0x54d9ae;}if(!_[_0x9ecd('0x26')](_0x54d9ae)){return _0x54d9ae;}if(_[_0x9ecd('0x27')](_0x1df783)){_0x1df783=[_0x1df783];}if(!_[_0x9ecd('0x18')](_0x1df783)){return _0x54d9ae;}for(var _0x5b7e6d=0x0;_0x5b7e6d<_0x1df783[_0x9ecd('0x24')];_0x5b7e6d+=0x1){_[_0x9ecd('0x28')](_0x54d9ae,_0x1df783[_0x5b7e6d]);}for(var _0x33b293 in _0x54d9ae){if(_0x54d9ae['hasOwnProperty'](_0x33b293)){_0x54d9ae[_0x33b293]=this[_0x9ecd('0x25')](_0x54d9ae[_0x33b293],_0x1df783);}}return _0x54d9ae;};exports[_0x9ecd('0x29')]=function(_0x1aef6e){return _0x1aef6e[_0x9ecd('0x2a')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x49b229){return _0x49b229[_0x9ecd('0x2a')](/^\S+@\S+$/)?!![]:![];};exports[_0x9ecd('0x2b')]=function(_0x51b6fb,_0x35e9b6){var _0x5e7fde=[];var _0x28f965=/[ `!@#$%^&*()_\-?~]/;var _0x5d3dae=_0x35e9b6?_0x9ecd('0x2c'):_0x9ecd('0x2d');_0x51b6fb['split'](/[ ,]+/)['forEach'](function(_0x29b0ed){_0x29b0ed=_0x29b0ed['replace'](/([^:]")"+/g,'$1');_0x29b0ed='+'+_0x29b0ed+'*';var _0x1b5383=_0x29b0ed[_0x9ecd('0x2a')](_0x28f965);if(_0x1b5383){_0x29b0ed='\x22'+_0x29b0ed+'\x22';}_0x5e7fde['push'](_0x29b0ed);});_0x5d3dae=_0x5d3dae['replace']('{EXPR}',_0x5e7fde['join']('\x20'));return _0x5d3dae;};exports[_0x9ecd('0x2e')]=function(_0x467f99,_0x2a1f12,_0x5bcdae){var _0xcdb832={},_0x5231b0={};if(_0x2a1f12[_0x9ecd('0x2f')][_0x9ecd('0x30')]){_0x2a1f12[_0x9ecd('0x2f')]['id']=_0x2a1f12[_0x9ecd('0x2f')][_0x9ecd('0x30')];delete _0x2a1f12[_0x9ecd('0x2f')][_0x9ecd('0x30')];}_0xcdb832['model']=_['map'](_0x467f99,_0x9ecd('0x16'));_0xcdb832['query']=_[_0x9ecd('0x5')](_0x2a1f12[_0x9ecd('0x2f')]);_0xcdb832[_0x9ecd('0xb')]=_[_0x9ecd('0x31')](_0xcdb832[_0x9ecd('0x7')],_0xcdb832['query']);_0x5231b0[_0x9ecd('0x32')]=_[_0x9ecd('0x31')](_0xcdb832[_0x9ecd('0x7')],this[_0x9ecd('0x9')](_0x2a1f12[_0x9ecd('0x2f')][_0x9ecd('0x9')]));_0x5231b0[_0x9ecd('0x32')]=_0x5231b0[_0x9ecd('0x32')][_0x9ecd('0x24')]?_0x5231b0['attributes']:_0xcdb832[_0x9ecd('0x7')];if(!_0x2a1f12[_0x9ecd('0x2f')][_0x9ecd('0x33')]('nolimit')){_0x5231b0[_0x9ecd('0x19')]=this[_0x9ecd('0x19')](_0x2a1f12[_0x9ecd('0x2f')][_0x9ecd('0x19')]);_0x5231b0['offset']=this[_0x9ecd('0x34')](_0x2a1f12[_0x9ecd('0x2f')][_0x9ecd('0x34')]);}_0x5231b0[_0x9ecd('0x35')]=this['sort'](_0x2a1f12[_0x9ecd('0x2f')]['sort']);_0x5231b0[_0x9ecd('0x36')]=this['filters'](_[_0x9ecd('0x37')](_0x2a1f12['query'],_0xcdb832['filters']),_0x467f99);if(_0x2a1f12[_0x9ecd('0x2f')][_0x9ecd('0x38')]){var _0x13cfb1=_0x467f99;var _0x5edc13=_0x2a1f12[_0x9ecd('0x2f')][_0x9ecd('0x38')];if(typeof _0x5edc13===_0x9ecd('0x39')){_0x13cfb1=_[_0x9ecd('0x38')](_0x467f99,function(_0x42f32b){return _[_0x9ecd('0x6')](_0x5edc13[_0x9ecd('0x3a')],_0x42f32b['name']);});_0x5edc13=_0x5edc13[_0x9ecd('0x3b')];}_0x5231b0[_0x9ecd('0x36')]=_[_0x9ecd('0x3c')](_0x5231b0[_0x9ecd('0x36')],{'$or':_[_0x9ecd('0x1c')](_0x13cfb1,function(_0x310f3b){if(_0x310f3b[_0x9ecd('0xf')]!==_0x9ecd('0x3d')){if(_0x5bcdae){return sequelize[_0x9ecd('0x36')](sequelize['fn']('lower',sequelize[_0x9ecd('0x20')](_0x310f3b['name'])),{'$like':sequelize['fn'](_0x9ecd('0x3e'),'%'+_0x2a1f12[_0x9ecd('0x2f')][_0x9ecd('0x38')]+'%')});}else{var _0xec1294={};_0xec1294[_0x310f3b['name']]={'$like':'%'+_0x2a1f12[_0x9ecd('0x2f')]['filter']+'%'};return _0xec1294;}}})});}_0x5231b0=_['merge']({},_0x5231b0,_0x2a1f12['options']);return _0x5231b0;};exports[_0x9ecd('0x3f')]=function(_0x2f020e){var _0x5ddcd4=[];if(_0x2f020e[_0x9ecd('0x40')]){_0x5ddcd4[_0x9ecd('0x41')]({'all':!![]});}else if(_0x2f020e['include']){if(Array[_0x9ecd('0x18')](_0x2f020e[_0x9ecd('0x3f')])){_0x5ddcd4=Object['keys'](_0x2f020e['include'])[_0x9ecd('0x1c')](function(_0x4b9a16){return parseIncludeModel(_0x2f020e[_0x9ecd('0x3f')][_0x4b9a16]);});}else{var _0x5b8315=parseIncludeModel(_0x2f020e[_0x9ecd('0x3f')]);_0x5ddcd4[_0x9ecd('0x41')](_0x5b8315);}}return _0x5ddcd4;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 60de2ae..7fc0775 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 _0x31f0=['mailStatus','openchannelStatus','smsStatus','whatsappStatus','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','busy','isArray','map','findOne','all','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','faxPause','mailPause','openchannelPause','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','startsWith','DESC','ASC','getUpdatedSortOptions','fullname,internal','internal','indexOf','sort','pauseType','toLowerCase','sortAgentsByStatus','userpic','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','chatStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','online','omit','pick','role','lastLoginAt','faxStatus','openchannelStatusTime','voiceStatusTime','whatsappStatusTime','faxCapacity','openchannelCurrentCapacity','destconnectedlinenum','onhold','getRealtimeAgentsQueryFields','lodash','../../mysqldb','http','client','chatPause','smsPause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','voicePause','pause','chatStatus'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0x31f0,0xb7));var _0x031f=function(_0x4a9223,_0x91dda9){_0x4a9223=_0x4a9223-0x0;var _0x5b8aa4=_0x31f0[_0x4a9223];return _0x5b8aa4;};'use strict';var _=require(_0x031f('0x0'));var jayson=require('jayson/promise');var db=require(_0x031f('0x1'))['db'];var amiClient=jayson['client'][_0x031f('0x2')]({'port':0x232a});var routingClient=jayson[_0x031f('0x3')][_0x031f('0x2')]({'port':0x232c});function isAgentPaused(_0xf20620,_0x526a45){var _0x3c0612=[_0xf20620[_0x031f('0x4')],_0xf20620['faxPause'],_0xf20620['mailPause'],_0xf20620['openchannelPause'],_0xf20620[_0x031f('0x5')],_0xf20620['voicePause'],_0xf20620[_0x031f('0x6')]];if(!_0x526a45)return _[_0x031f('0x7')](_0x3c0612);var _0x2569b6=_[_0x031f('0x8')](_0x3c0612);return _0x2569b6['length']>0x0&&_0x2569b6[_0x031f('0x9')]<_0x3c0612[_0x031f('0x9')]?!![]:![];}function isIdle(_0x327f11){return _0x327f11===_0x031f('0xa')||_0x327f11===_0x031f('0xb')||_0x327f11===_0x031f('0xc')||_0x327f11===_0x031f('0xd')||_[_0x031f('0xe')](_0x327f11);}function isAgentIdle(_0x4df318){if(_0x4df318[_0x031f('0xf')]!==_0x031f('0xa')&&_0x4df318[_0x031f('0x10')]){_0x4df318[_0x031f('0xf')]=_0x031f('0x11');return![];}return _[_0x031f('0x7')]([_0x4df318[_0x031f('0x12')],_0x4df318['faxStatus'],_0x4df318[_0x031f('0x13')],_0x4df318[_0x031f('0x14')],_0x4df318[_0x031f('0x15')],_0x4df318[_0x031f('0xf')],_0x4df318[_0x031f('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request']('Agents',{})[_0x031f('0x17')](function(_0x3a10aa){if(_0x3a10aa[_0x031f('0x18')]){throw new Error(_0x031f('0x19'));}var _0x5196b1=_0x3a10aa[_0x031f('0x1a')];return routingClient[_0x031f('0x1b')]('Agents',{})[_0x031f('0x17')](function(_0x535e70){if(_0x535e70[_0x031f('0x18')]){throw new Error(_0x031f('0x1c'));}var _0x563bc8=_0x535e70[_0x031f('0x1a')];return _[_0x031f('0x1d')]({},_0x5196b1,_0x563bc8);});})[_0x031f('0x1e')](function(_0x1b76d6){throw _0x1b76d6;});}exports[_0x031f('0x1f')]=getRealtimeAgents;function getAgentStatus(_0xf76f1b){var _0x345bde=_0x031f('0xb');if(isAgentPaused(_0xf76f1b))_0x345bde='pause';else if(isAgentPaused(_0xf76f1b,!![]))_0x345bde=_0x031f('0x20');else if(isAgentIdle(_0xf76f1b))_0x345bde=_0x031f('0xa');else _0x345bde=_0x031f('0x21');return _0x345bde;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x5c4184,_0xa11a2b){var _0x4d0f92=_[_0x031f('0x22')](_0x5c4184)?_0x5c4184:[_0x5c4184];var _0x57f6c4=_['startCase'](_0xa11a2b)+'Queue';var _0x971691=_[_0x031f('0x23')](_0x4d0f92,function(_0x2920cd){return db[_0x57f6c4][_0x031f('0x24')]({'where':{'id':_0x2920cd}})['then'](function(_0x374b65){if(!_0x374b65)return[];return _0x374b65['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x031f('0x25')](_0x971691)[_0x031f('0x17')](function(_0xfa77b1){var _0x567666=_(_0xfa77b1)[_0x031f('0x26')]()[_0x031f('0x23')]('id')['uniq']()[_0x031f('0x27')]();return _0x567666;});}exports[_0x031f('0x28')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x2403e9,_0x5395ea,_0xa308b){try{if(_0x5395ea[_0x031f('0x9')]>0x0){_0x2403e9=_0x2403e9[_0x031f('0x8')](function(_0xaf5bea){return _0x5395ea[_0x031f('0x29')](_0xaf5bea['id']);});}var _0x301bd2=_0x2403e9['filter'](function(_0x1f62eb){var _0xab24ad=_0x031f('0x21');if(isAgentIdle(_0x1f62eb)){_0xab24ad=_0x031f('0xa');}return _0xab24ad===_0xa308b;});return _[_0x031f('0x23')](_0x301bd2,'id');}catch(_0x2d24f0){throw _0x2d24f0;}}exports[_0x031f('0x2a')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x87dc07,_0x2034ac,_0xfc4a89){return Promise[_0x031f('0x2b')]()['then'](function(){if(_0x2034ac[_0x031f('0x9')]>0x0){_0x87dc07=_0x87dc07[_0x031f('0x8')](function(_0xb3a6bd){return _0x2034ac[_0x031f('0x29')](_0xb3a6bd['id']);});}return _0x87dc07;})[_0x031f('0x17')](function(){return db[_0x031f('0x2c')][_0x031f('0x2d')]({'attributes':['id',_0x031f('0x2e'),_0x031f('0x2f'),_0x031f('0x4'),_0x031f('0x30'),_0x031f('0x31'),_0x031f('0x32'),'smsPause',_0x031f('0x10'),_0x031f('0x6'),'pauseType'],'where':{'id':{'$in':_[_0x031f('0x23')](_0x87dc07,'id')}},'raw':!![]});})[_0x031f('0x17')](function(_0x4ec696){return _0x4ec696[_0x031f('0x23')](function(_0x22e486){var _0x41750a=_[_0x031f('0x33')](_0x87dc07,['id',_0x22e486['id']]);var _0x4b5c42=filterAgentAttributes(_0x41750a);_['merge'](_0x22e486,_0x4b5c42);_0x22e486[_0x031f('0x34')]=getAgentStatus(_0x22e486);return _0x22e486;});})['then'](function(_0x43ab76){var _0x2aa0aa=sortAgentsByStatus(_0x43ab76,_0xfc4a89);return _[_0x031f('0x23')](_0x2aa0aa,'id');})['catch'](function(_0x5c33c5){throw _0x5c33c5;});}exports[_0x031f('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x5ed480){var _0x57b9c8={'fields':[],'order':null};var _0x2d489a=_0x5ed480[_0x031f('0x36')](',');_0x57b9c8[_0x031f('0x37')]=_[_0x031f('0x8')](_0x2d489a,function(_0x11c03c){if(!_0x11c03c[_0x031f('0x29')](_0x031f('0x34'))){return!![];}_0x57b9c8['order']=_[_0x031f('0x38')](_0x11c03c,'-')?_0x031f('0x39'):_0x031f('0x3a');return![];});return _0x57b9c8;}exports[_0x031f('0x3b')]=getUpdatedSortOptions;function validateSortParameter(_0x58daa2){if(!_0x58daa2){_0x58daa2=_0x031f('0x3c');}if(_0x58daa2[_0x031f('0x29')](_0x031f('0x2f'))&&!_0x58daa2['includes'](_0x031f('0x3d'))){var _0x3b504c=_0x58daa2['substring'](0x0,_0x58daa2[_0x031f('0x3e')](_0x031f('0x2f')));_0x58daa2+=','+_0x3b504c+'internal';}return _0x58daa2;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x178135,_0x1d85bb){var _0x9efbc4=_0x178135[_0x031f('0x3f')](function(_0x2691b7,_0xf0fb95){if(_0x2691b7[_0x031f('0x34')]===_0xf0fb95['globalStatus']){if(_0x2691b7[_0x031f('0x34')]===_0x031f('0x11')){if(_0x1d85bb==='DESC'){return(_0x2691b7[_0x031f('0x40')]||'')<(_0xf0fb95['pauseType']||'')||_0x2691b7[_0x031f('0x2f')][_0x031f('0x41')]()>_0xf0fb95['fullname'][_0x031f('0x41')]()?0x1:-0x1;}else{return(_0x2691b7[_0x031f('0x40')]||'')<(_0xf0fb95[_0x031f('0x40')]||'')||_0x2691b7['fullname'][_0x031f('0x41')]()>_0xf0fb95[_0x031f('0x2f')][_0x031f('0x41')]()?-0x1:0x1;}}else{if(_0x1d85bb===_0x031f('0x39')){return _0x2691b7[_0x031f('0x2f')][_0x031f('0x41')]()<_0xf0fb95[_0x031f('0x2f')][_0x031f('0x41')]()?0x1:-0x1;}else{return _0x2691b7[_0x031f('0x2f')]['toLowerCase']()<_0xf0fb95[_0x031f('0x2f')][_0x031f('0x41')]()?-0x1:0x1;}}}else{if(_0x1d85bb===_0x031f('0x39')){return _0x2691b7[_0x031f('0x34')]<_0xf0fb95[_0x031f('0x34')]?0x1:-0x1;}else{return _0x2691b7[_0x031f('0x34')]<_0xf0fb95[_0x031f('0x34')]?-0x1:0x1;}}});return _0x9efbc4;}exports[_0x031f('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x3411f1){var _0x5f033b=[_0x031f('0x43'),'online','lastLoginAt',_0x031f('0x44'),_0x031f('0x40'),_0x031f('0x44'),_0x031f('0x3d'),_0x031f('0x45'),'chatPause',_0x031f('0x32'),_0x031f('0x31'),_0x031f('0x5'),'whatsappPause',_0x031f('0x30'),_0x031f('0x10'),_0x031f('0x46'),_0x031f('0x47'),_0x031f('0x48'),_0x031f('0x49'),'whatsappCapacity','faxCapacity',_0x031f('0x4a'),'openchannelCurrentCapacity',_0x031f('0x4b'),_0x031f('0x4c'),'whatsappCurrentCapacity',_0x031f('0x4d'),'chatStatus','openchannelStatus',_0x031f('0x13'),'smsStatus',_0x031f('0x16'),'faxStatus',_0x031f('0xf'),_0x031f('0x4e'),'openchannelStatusTime',_0x031f('0x4f'),_0x031f('0x50'),'whatsappStatusTime',_0x031f('0x51'),'voiceStatusTime',_0x031f('0x52'),'destconnectedlinenum',_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x56')];var _0x691a68=['chatPause',_0x031f('0x32'),'mailPause',_0x031f('0x5'),_0x031f('0x6'),'faxPause',_0x031f('0x10'),_0x031f('0x57')];var _0x510d17=_(_0x3411f1)[_0x031f('0x58')](_0x691a68)[_0x031f('0x59')](_0x5f033b)[_0x031f('0x27')]();return _0x510d17;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x031f('0x2e'),'fullname',_0x031f('0x5a'),'internal',_0x031f('0x57'),'globalStatus',_0x031f('0x43'),_0x031f('0x5b'),'pauseType','lastPauseAt',_0x031f('0x30'),_0x031f('0x4'),'mailPause',_0x031f('0x32'),_0x031f('0x5'),_0x031f('0x10'),_0x031f('0x6'),_0x031f('0x12'),_0x031f('0x5c'),_0x031f('0x13'),_0x031f('0x14'),'smsStatus',_0x031f('0xf'),_0x031f('0x16'),_0x031f('0x4e'),'faxStatusTime',_0x031f('0x4f'),_0x031f('0x5d'),'smsStatusTime',_0x031f('0x5e'),_0x031f('0x5f'),_0x031f('0x46'),_0x031f('0x60'),'mailCapacity','openchannelCapacity','smsCapacity','whatsappCapacity',_0x031f('0x4a'),_0x031f('0x4d'),'mailCurrentCapacity',_0x031f('0x61'),_0x031f('0x4c'),'whatsappCurrentCapacity',_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x62'),_0x031f('0x63'),_0x031f('0x52'),_0x031f('0x56'),_0x031f('0x53')];}exports[_0x031f('0x64')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0xdc97=['openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','value','filterAgentAttributes','role','userpic','voiceStatusTime','mailCapacity','phoneBarEnableScreenRecordingByAgent','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','http','chatPause','faxPause','mailPause','smsPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','pause','faxStatus','mailStatus','openchannelStatus','smsStatus','voiceStatus','whatsappStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','isArray','Queue','map','findOne','uniq','getAgentIdsByQueues','includes','resolve','name','openchannelPause','voicePause','whatsappPause','pauseType','find','getSortedAgentsIdsByStatus','split','fields','globalStatus','order','startsWith','DESC','ASC','fullname,internal','fullname','internal','substring','indexOf','toLowerCase','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus'];(function(_0x32ce61,_0x2ba733){var _0x28eded=function(_0x34db11){while(--_0x34db11){_0x32ce61['push'](_0x32ce61['shift']());}};_0x28eded(++_0x2ba733);}(_0xdc97,0x13b));var _0x7dc9=function(_0x499412,_0x1b4d5f){_0x499412=_0x499412-0x0;var _0x55e776=_0xdc97[_0x499412];return _0x55e776;};'use strict';var _=require(_0x7dc9('0x0'));var jayson=require(_0x7dc9('0x1'));var db=require(_0x7dc9('0x2'))['db'];var amiClient=jayson['client'][_0x7dc9('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x7dc9('0x3')]({'port':0x232c});function isAgentPaused(_0x2b86da,_0x478a95){var _0x2a77c1=[_0x2b86da[_0x7dc9('0x4')],_0x2b86da[_0x7dc9('0x5')],_0x2b86da[_0x7dc9('0x6')],_0x2b86da['openchannelPause'],_0x2b86da[_0x7dc9('0x7')],_0x2b86da['voicePause'],_0x2b86da['whatsappPause']];if(!_0x478a95)return _[_0x7dc9('0x8')](_0x2a77c1);var _0x23737d=_[_0x7dc9('0x9')](_0x2a77c1);return _0x23737d[_0x7dc9('0xa')]>0x0&&_0x23737d[_0x7dc9('0xa')]<_0x2a77c1['length']?!![]:![];}function isIdle(_0xb2fa2a){return _0xb2fa2a===_0x7dc9('0xb')||_0xb2fa2a===_0x7dc9('0xc')||_0xb2fa2a===_0x7dc9('0xd')||_0xb2fa2a===_0x7dc9('0xe')||_[_0x7dc9('0xf')](_0xb2fa2a);}function isAgentIdle(_0x1e336a){if(_0x1e336a['voiceStatus']!=='idle'&&_0x1e336a['voicePause']){_0x1e336a['voiceStatus']=_0x7dc9('0x10');return![];}return _[_0x7dc9('0x8')]([_0x1e336a['chatStatus'],_0x1e336a[_0x7dc9('0x11')],_0x1e336a[_0x7dc9('0x12')],_0x1e336a[_0x7dc9('0x13')],_0x1e336a[_0x7dc9('0x14')],_0x1e336a[_0x7dc9('0x15')],_0x1e336a[_0x7dc9('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x7dc9('0x17'),{})[_0x7dc9('0x18')](function(_0x1b0aa1){if(_0x1b0aa1[_0x7dc9('0x19')]){throw new Error(_0x7dc9('0x1a'));}var _0xbe0437=_0x1b0aa1[_0x7dc9('0x1b')];return routingClient[_0x7dc9('0x1c')](_0x7dc9('0x17'),{})['then'](function(_0x22577e){if(_0x22577e['error']){throw new Error(_0x7dc9('0x1d'));}var _0x1cc237=_0x22577e['result'];return _[_0x7dc9('0x1e')]({},_0xbe0437,_0x1cc237);});})[_0x7dc9('0x1f')](function(_0x12f08d){throw _0x12f08d;});}exports[_0x7dc9('0x20')]=getRealtimeAgents;function getAgentStatus(_0x43ec33){var _0x184bfd=_0x7dc9('0xc');if(isAgentPaused(_0x43ec33))_0x184bfd=_0x7dc9('0x10');else if(isAgentPaused(_0x43ec33,!![]))_0x184bfd=_0x7dc9('0x21');else if(isAgentIdle(_0x43ec33))_0x184bfd=_0x7dc9('0xb');else _0x184bfd='busy';return _0x184bfd;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x12954f,_0x5981e2){var _0x596e0f=_[_0x7dc9('0x22')](_0x12954f)?_0x12954f:[_0x12954f];var _0x27f7fa=_['startCase'](_0x5981e2)+_0x7dc9('0x23');var _0x43d31f=_[_0x7dc9('0x24')](_0x596e0f,function(_0x4906b1){return db[_0x27f7fa][_0x7dc9('0x25')]({'where':{'id':_0x4906b1}})[_0x7dc9('0x18')](function(_0xf95336){if(!_0xf95336)return[];return _0xf95336['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x43d31f)['then'](function(_0x25b383){var _0x32d032=_(_0x25b383)['flatten']()['map']('id')[_0x7dc9('0x26')]()['value']();return _0x32d032;});}exports[_0x7dc9('0x27')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1c690b,_0x3a74a0,_0x3e4102){try{if(_0x3a74a0[_0x7dc9('0xa')]>0x0){_0x1c690b=_0x1c690b[_0x7dc9('0x9')](function(_0x236d42){return _0x3a74a0[_0x7dc9('0x28')](_0x236d42['id']);});}var _0x1fcf0e=_0x1c690b[_0x7dc9('0x9')](function(_0x14083d){var _0x2a456c='busy';if(isAgentIdle(_0x14083d)){_0x2a456c='idle';}return _0x2a456c===_0x3e4102;});return _['map'](_0x1fcf0e,'id');}catch(_0x49a4a5){throw _0x49a4a5;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x553a03,_0x58c4e8,_0x59f5d8){return Promise[_0x7dc9('0x29')]()[_0x7dc9('0x18')](function(){if(_0x58c4e8[_0x7dc9('0xa')]>0x0){_0x553a03=_0x553a03[_0x7dc9('0x9')](function(_0x3300ff){return _0x58c4e8[_0x7dc9('0x28')](_0x3300ff['id']);});}return _0x553a03;})['then'](function(){return db['User']['findAll']({'attributes':['id',_0x7dc9('0x2a'),'fullname',_0x7dc9('0x4'),_0x7dc9('0x5'),_0x7dc9('0x6'),_0x7dc9('0x2b'),_0x7dc9('0x7'),_0x7dc9('0x2c'),_0x7dc9('0x2d'),_0x7dc9('0x2e')],'where':{'id':{'$in':_['map'](_0x553a03,'id')}},'raw':!![]});})[_0x7dc9('0x18')](function(_0x4cdec4){return _0x4cdec4[_0x7dc9('0x24')](function(_0x16431a){var _0x3dc8e0=_[_0x7dc9('0x2f')](_0x553a03,['id',_0x16431a['id']]);var _0x48d9b2=filterAgentAttributes(_0x3dc8e0);_[_0x7dc9('0x1e')](_0x16431a,_0x48d9b2);_0x16431a['globalStatus']=getAgentStatus(_0x16431a);return _0x16431a;});})[_0x7dc9('0x18')](function(_0x4f47af){var _0x590bed=sortAgentsByStatus(_0x4f47af,_0x59f5d8);return _[_0x7dc9('0x24')](_0x590bed,'id');})[_0x7dc9('0x1f')](function(_0x21e036){throw _0x21e036;});}exports[_0x7dc9('0x30')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x5dac5b){var _0x9376a5={'fields':[],'order':null};var _0x183d87=_0x5dac5b[_0x7dc9('0x31')](',');_0x9376a5[_0x7dc9('0x32')]=_[_0x7dc9('0x9')](_0x183d87,function(_0x21faa6){if(!_0x21faa6[_0x7dc9('0x28')](_0x7dc9('0x33'))){return!![];}_0x9376a5[_0x7dc9('0x34')]=_[_0x7dc9('0x35')](_0x21faa6,'-')?_0x7dc9('0x36'):_0x7dc9('0x37');return![];});return _0x9376a5;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x34b5c9){if(!_0x34b5c9){_0x34b5c9=_0x7dc9('0x38');}if(_0x34b5c9[_0x7dc9('0x28')](_0x7dc9('0x39'))&&!_0x34b5c9['includes'](_0x7dc9('0x3a'))){var _0x89db0e=_0x34b5c9[_0x7dc9('0x3b')](0x0,_0x34b5c9[_0x7dc9('0x3c')](_0x7dc9('0x39')));_0x34b5c9+=','+_0x89db0e+_0x7dc9('0x3a');}return _0x34b5c9;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x553230,_0x3ef9fd){var _0x36a965=_0x553230['sort'](function(_0x3a705c,_0x4a37ec){if(_0x3a705c[_0x7dc9('0x33')]===_0x4a37ec[_0x7dc9('0x33')]){if(_0x3a705c[_0x7dc9('0x33')]==='pause'){if(_0x3ef9fd===_0x7dc9('0x36')){return(_0x3a705c[_0x7dc9('0x2e')]||'')<(_0x4a37ec[_0x7dc9('0x2e')]||'')||_0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()>_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?0x1:-0x1;}else{return(_0x3a705c['pauseType']||'')<(_0x4a37ec[_0x7dc9('0x2e')]||'')||_0x3a705c['fullname']['toLowerCase']()>_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?-0x1:0x1;}}else{if(_0x3ef9fd===_0x7dc9('0x36')){return _0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()<_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?0x1:-0x1;}else{return _0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()<_0x4a37ec['fullname'][_0x7dc9('0x3d')]()?-0x1:0x1;}}}else{if(_0x3ef9fd===_0x7dc9('0x36')){return _0x3a705c[_0x7dc9('0x33')]<_0x4a37ec[_0x7dc9('0x33')]?0x1:-0x1;}else{return _0x3a705c[_0x7dc9('0x33')]<_0x4a37ec[_0x7dc9('0x33')]?-0x1:0x1;}}});return _0x36a965;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x3774cb){var _0x42e110=['userpic',_0x7dc9('0x3e'),_0x7dc9('0x3f'),_0x7dc9('0x40'),'pauseType',_0x7dc9('0x40'),'internal','address',_0x7dc9('0x4'),_0x7dc9('0x2b'),_0x7dc9('0x6'),'smsPause','whatsappPause',_0x7dc9('0x5'),'voicePause',_0x7dc9('0x41'),_0x7dc9('0x42'),'mailCapacity',_0x7dc9('0x43'),_0x7dc9('0x44'),_0x7dc9('0x45'),_0x7dc9('0x46'),_0x7dc9('0x47'),_0x7dc9('0x48'),_0x7dc9('0x49'),_0x7dc9('0x4a'),_0x7dc9('0x4b'),_0x7dc9('0x4c'),_0x7dc9('0x13'),_0x7dc9('0x12'),_0x7dc9('0x14'),'whatsappStatus',_0x7dc9('0x11'),'voiceStatus','chatStatusTime',_0x7dc9('0x4d'),_0x7dc9('0x4e'),_0x7dc9('0x4f'),_0x7dc9('0x50'),_0x7dc9('0x51'),'voiceStatusTime',_0x7dc9('0x52'),_0x7dc9('0x53'),_0x7dc9('0x54'),'phoneBarEnableScreenRecordingByAgent',_0x7dc9('0x55'),_0x7dc9('0x56')];var _0x2cf133=[_0x7dc9('0x4'),_0x7dc9('0x2b'),_0x7dc9('0x6'),'smsPause',_0x7dc9('0x2d'),_0x7dc9('0x5'),_0x7dc9('0x2c'),_0x7dc9('0x3e')];var _0x877a67=_(_0x3774cb)[_0x7dc9('0x57')](_0x2cf133)[_0x7dc9('0x58')](_0x42e110)[_0x7dc9('0x59')]();return _0x877a67;}exports[_0x7dc9('0x5a')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x7dc9('0x2a'),_0x7dc9('0x39'),_0x7dc9('0x5b'),'internal',_0x7dc9('0x3e'),_0x7dc9('0x33'),_0x7dc9('0x5c'),_0x7dc9('0x3f'),_0x7dc9('0x2e'),'lastPauseAt',_0x7dc9('0x5'),_0x7dc9('0x4'),_0x7dc9('0x6'),_0x7dc9('0x2b'),_0x7dc9('0x7'),_0x7dc9('0x2c'),'whatsappPause','chatStatus','faxStatus',_0x7dc9('0x12'),_0x7dc9('0x13'),_0x7dc9('0x14'),_0x7dc9('0x15'),'whatsappStatus','chatStatusTime',_0x7dc9('0x51'),_0x7dc9('0x4e'),_0x7dc9('0x4d'),_0x7dc9('0x4f'),_0x7dc9('0x5d'),_0x7dc9('0x50'),_0x7dc9('0x41'),'faxCapacity',_0x7dc9('0x5e'),_0x7dc9('0x42'),_0x7dc9('0x43'),_0x7dc9('0x44'),_0x7dc9('0x46'),'faxCurrentCapacity',_0x7dc9('0x48'),_0x7dc9('0x47'),_0x7dc9('0x49'),_0x7dc9('0x4a'),_0x7dc9('0x5f'),_0x7dc9('0x55'),_0x7dc9('0x53'),_0x7dc9('0x60'),_0x7dc9('0x52'),_0x7dc9('0x56'),_0x7dc9('0x54')];}exports[_0x7dc9('0x61')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 8096bf5..e96e0f4 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14ce=['paused','waiting','inUse','invalid','loggedInDb','onHold','ringing','ringInUse','pTalking','originated','message','statusMessage','dialActive','dialMethod','Trunk','startProgressive','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','getRealtimeQueues','inbound','outbound','concat','map','get','loggedIn','talking','busy','pick','initializeQueues','lodash','jayson/promise','util','http','available'];(function(_0x342b3f,_0x4d0778){var _0x31b67a=function(_0x1333ff){while(--_0x1333ff){_0x342b3f['push'](_0x342b3f['shift']());}};_0x31b67a(++_0x4d0778);}(_0x14ce,0x85));var _0xe14c=function(_0xcbf67f,_0xfd718d){_0xcbf67f=_0xcbf67f-0x0;var _0xd2cf0=_0x14ce[_0xcbf67f];return _0xd2cf0;};'use strict';var _=require(_0xe14c('0x0'));var jayson=require(_0xe14c('0x1'));var util=require(_0xe14c('0x2'));var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson['client'][_0xe14c('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xe14c('0x4'),'loggedIn',_0xe14c('0x5'),_0xe14c('0x6')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0xe14c('0x7'),_0xe14c('0x8'),_0xe14c('0x9'),'notInUse',_0xe14c('0xa'),_0xe14c('0xb'),_0xe14c('0xc'),'talking','unavailable','unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xe14c('0xd'),_0xe14c('0xe'),_0xe14c('0xf'),_0xe14c('0x10'),_0xe14c('0x11'),_0xe14c('0x12'),_0xe14c('0x13'),'startPredictive',_0xe14c('0x14'),'erlangCalls','erlangCallToSecond',_0xe14c('0x15'),_0xe14c('0x16'),_0xe14c('0x17'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable',_0xe14c('0x18'),'predictiveIntervalAnsweredCalls',_0xe14c('0x19'),'predictiveIntervalDroppedCallsCallersExit',_0xe14c('0x1a'),_0xe14c('0x1b')];function getRealtimeQueues(_0x1ab4e7,_0xcdb500){var _0x26646a=_0xcdb500===_0xe14c('0x1c')?amiClient:routingClient;return _0x26646a[_0xe14c('0x1d')](_[_0xe14c('0x1e')](_0xcdb500)+_0xe14c('0x1f'),_0x1ab4e7)[_0xe14c('0x20')](function(_0x4897c9){if(_0x4897c9['error'])throw new Error(util[_0xe14c('0x21')](_0xe14c('0x22'),_0xcdb500));return _0x4897c9['result'];})['catch'](function(_0xbbbef7){throw _0xbbbef7;});}exports[_0xe14c('0x23')]=getRealtimeQueues;function initializeQueues(_0x192593,_0xf23b0e,_0x2f758f,_0x382f20){var _0x236a5e=DEFAULT_QUEUE_ATTRIBUTES;if(_0x2f758f===_0xe14c('0x1c')){if(_0x382f20===_0xe14c('0x24')){_0x236a5e=_0x236a5e['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x382f20===_0xe14c('0x25')){_0x236a5e=_0x236a5e[_0xe14c('0x26')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x192593[_0xe14c('0x27')](function(_0x141034){var _0x46b00a=_0x141034[_0xe14c('0x28')]({'plain':!![]});_0x46b00a[_0xe14c('0x5')]=0x0;_0x46b00a[_0xe14c('0x9')]=0x0;_0x46b00a[_0xe14c('0x29')]=0x0;_0x46b00a[_0xe14c('0x4')]=0x0;_0x46b00a['waiting']=0x0;if(_0x2f758f===_0xe14c('0x1c')){_0x46b00a[_0xe14c('0x2a')]=0x0;_0x46b00a[_0xe14c('0x2b')]=0x0;if(_0x382f20==='outbound'){_0x46b00a[_0xe14c('0xd')]=0x0;_0x46b00a['originated']=0x0;}}var _0x385043=_['find'](_0xf23b0e,['id',_0x46b00a['id']]);if(_0x385043){_['merge'](_0x46b00a,_[_0xe14c('0x2c')](_0x385043,_0x236a5e));}return _0x46b00a;});}exports[_0xe14c('0x2d')]=initializeQueues; \ No newline at end of file +var _0xe715=['unknown','originated','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','concat','outbound','map','get','loggedInDb','find','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','paused','waiting','busy','inUse','invalid','notInUse','onHold','ringing','ringInUse','talking','unavailable'];(function(_0x5c50d4,_0x4ae316){var _0x5c05ed=function(_0x5e6f44){while(--_0x5e6f44){_0x5c50d4['push'](_0x5c50d4['shift']());}};_0x5c05ed(++_0x4ae316);}(_0xe715,0x1b1));var _0x5e71=function(_0x4d1fd2,_0x56e25a){_0x4d1fd2=_0x4d1fd2-0x0;var _0x148bcc=_0xe715[_0x4d1fd2];return _0x148bcc;};'use strict';var _=require(_0x5e71('0x0'));var jayson=require(_0x5e71('0x1'));var util=require(_0x5e71('0x2'));var amiClient=jayson[_0x5e71('0x3')][_0x5e71('0x4')]({'port':0x232a});var routingClient=jayson[_0x5e71('0x3')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x5e71('0x5'),'loggedIn',_0x5e71('0x6'),_0x5e71('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0x5e71('0x8'),_0x5e71('0x9'),_0x5e71('0xa'),'loggedInDb',_0x5e71('0xb'),_0x5e71('0xc'),_0x5e71('0xd'),_0x5e71('0xe'),_0x5e71('0xf'),_0x5e71('0x10'),_0x5e71('0x11')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0x5e71('0x12'),'message',_0x5e71('0x13'),_0x5e71('0x14'),_0x5e71('0x15'),_0x5e71('0x16'),_0x5e71('0x17'),_0x5e71('0x18'),'erlangCalls',_0x5e71('0x19'),_0x5e71('0x1a'),_0x5e71('0x1b'),_0x5e71('0x1c'),'dialPredictiveIntervalMaxThreshold',_0x5e71('0x1d'),_0x5e71('0x1e'),_0x5e71('0x1f'),_0x5e71('0x20'),_0x5e71('0x21'),_0x5e71('0x22'),_0x5e71('0x23'),_0x5e71('0x24')];function getRealtimeQueues(_0x5bb21c,_0x24d81e){var _0x373245=_0x24d81e===_0x5e71('0x25')?amiClient:routingClient;return _0x373245['request'](_['startCase'](_0x24d81e)+'Queues',_0x5bb21c)['then'](function(_0x345e3d){if(_0x345e3d['error'])throw new Error(util[_0x5e71('0x26')](_0x5e71('0x27'),_0x24d81e));return _0x345e3d[_0x5e71('0x28')];})[_0x5e71('0x29')](function(_0x2c31fd){throw _0x2c31fd;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x298c62,_0x5ec8bc,_0x461f25,_0xa8861d){var _0x49bd19=DEFAULT_QUEUE_ATTRIBUTES;if(_0x461f25===_0x5e71('0x25')){if(_0xa8861d==='inbound'){_0x49bd19=_0x49bd19[_0x5e71('0x2a')](VOICE_QUEUE_ATTRIBUTES);}else if(_0xa8861d===_0x5e71('0x2b')){_0x49bd19=_0x49bd19[_0x5e71('0x2a')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x298c62[_0x5e71('0x2c')](function(_0x281128){var _0x395eef=_0x281128[_0x5e71('0x2d')]({'plain':!![]});_0x395eef[_0x5e71('0x6')]=0x0;_0x395eef[_0x5e71('0x2e')]=0x0;_0x395eef['loggedIn']=0x0;_0x395eef[_0x5e71('0x5')]=0x0;_0x395eef[_0x5e71('0x7')]=0x0;if(_0x461f25===_0x5e71('0x25')){_0x395eef['talking']=0x0;_0x395eef[_0x5e71('0x8')]=0x0;if(_0xa8861d==='outbound'){_0x395eef['pTalking']=0x0;_0x395eef['originated']=0x0;}}var _0x4b13c8=_[_0x5e71('0x2f')](_0x5ec8bc,['id',_0x395eef['id']]);if(_0x4b13c8){_['merge'](_0x395eef,_[_0x5e71('0x30')](_0x4b13c8,_0x49bd19));}return _0x395eef;});}exports[_0x5e71('0x31')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index eb38341..6dc75db 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(_0x539533,_0x59b89b){var _0x3942f3=function(_0x3b386c){while(--_0x3b386c){_0x539533['push'](_0x539533['shift']());}};_0x3942f3(++_0x59b89b);}(_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(_0x746739,_0x289561){var _0x4b7447=function(_0x3435f2){while(--_0x3435f2){_0x746739['push'](_0x746739['shift']());}};_0x4b7447(++_0x289561);}(_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 diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 2a369e2..aa346f3 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 _0x2e6a=['mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','model','join','createHash','update','digest','hex','getUuid','platform','licenseToken','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','md5','substring','lodash','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','length','family','IPv4','internal','concat','head'];(function(_0xf7a563,_0x4dd2ba){var _0x1226f5=function(_0x496b5a){while(--_0x496b5a){_0xf7a563['push'](_0xf7a563['shift']());}};_0x1226f5(++_0x4dd2ba);}(_0x2e6a,0x1ad));var _0xa2e6=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x2e6a[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0xa2e6('0x0'));var os=require('os');var crypto=require(_0xa2e6('0x1'));var machine=require(_0xa2e6('0x2'));var exec=require(_0xa2e6('0x3'))['execSync'];var config=require(_0xa2e6('0x4'));function getInterfaces(){var _0x5b4206=[];var _0x38b0dd=os[_0xa2e6('0x5')]();var _0x2d9630=_[_0xa2e6('0x6')](_['keys'](_0x38b0dd));for(var _0xd512c2=0x0;_0xd512c2<_0x2d9630[_0xa2e6('0x7')];_0xd512c2++){var _0x376686=_0x38b0dd[_0x2d9630[_0xd512c2]]['filter'](function(_0x1cebd6){return _0x1cebd6[_0xa2e6('0x8')]===_0xa2e6('0x9')&&_0x1cebd6[_0xa2e6('0xa')]===![];});_0x5b4206=_0x5b4206[_0xa2e6('0xb')](_0x376686);}return _0x5b4206;}function getFirstInterface(){var _0x8de95a=_[_0xa2e6('0xc')](getInterfaces());return{'macAddress':_0x8de95a&&_0x8de95a[_0xa2e6('0xd')]?_0x8de95a[_0xa2e6('0xd')]:_0xa2e6('0xe'),'ipAddress':_0x8de95a&&_0x8de95a[_0xa2e6('0xf')]?_0x8de95a[_0xa2e6('0xf')]:_0xa2e6('0x10')};}exports[_0xa2e6('0x11')]=getFirstInterface;function getCPUhash(){var _0x45bcb0=_[_0xa2e6('0x6')](os['cpus']()['map'](function(_0x4e7b28){return _0x4e7b28[_0xa2e6('0x12')];}))[_0xa2e6('0x13')](':');return crypto[_0xa2e6('0x14')]('md5')[_0xa2e6('0x15')](_0x45bcb0)[_0xa2e6('0x16')](_0xa2e6('0x17'));}exports[_0xa2e6('0x18')]=function(){var _0x2cc85b=os[_0xa2e6('0x19')]();var _0x48d90c=/[0-9a-f-]{36}/;if(config[_0xa2e6('0x1a')]&&_0x48d90c['test'](config[_0xa2e6('0x1a')])){return config[_0xa2e6('0x1a')];}else if(_0x2cc85b==='win32'){return exec(_0xa2e6('0x1b'),{'encoding':_0xa2e6('0x1c')})[_0xa2e6('0x1d')]('\x0d\x0a','');}else{var _0x4c6620=getFirstInterface();var _0xfb66ed=getCPUhash();var _0x357e6e=_0xfb66ed+'|'+os[_0xa2e6('0x1e')]()+'|'+_0x4c6620['macAddress']+'|'+_0x4c6620[_0xa2e6('0x1f')];var _0x196648=crypto[_0xa2e6('0x14')](_0xa2e6('0x20'))[_0xa2e6('0x15')](_0x357e6e)['digest']('hex');return _0x196648[_0xa2e6('0x21')](0x0,0x8)+'-'+_0x196648['substring'](0x8,0xc)+'-'+_0x196648['substring'](0xc,0x10)+'-'+_0x196648[_0xa2e6('0x21')](0x10,0x14)+'-'+_0x196648[_0xa2e6('0x21')](0x14);}}; \ No newline at end of file +var _0x97d8=['head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','join','createHash','md5','update','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','digest','substring','lodash','crypto','execSync','orderBy','keys','filter','concat'];(function(_0x4808ee,_0x5e1d72){var _0x23ed56=function(_0x515b9f){while(--_0x515b9f){_0x4808ee['push'](_0x4808ee['shift']());}};_0x23ed56(++_0x5e1d72);}(_0x97d8,0x179));var _0x897d=function(_0x16471e,_0x396b5f){_0x16471e=_0x16471e-0x0;var _0x12eb63=_0x97d8[_0x16471e];return _0x12eb63;};'use strict';var _=require(_0x897d('0x0'));var os=require('os');var crypto=require(_0x897d('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0x897d('0x2')];var config=require('../environment');function getInterfaces(){var _0x1862cb=[];var _0x448eaf=os['networkInterfaces']();var _0x1f01e3=_[_0x897d('0x3')](_[_0x897d('0x4')](_0x448eaf));for(var _0x406eec=0x0;_0x406eec<_0x1f01e3['length'];_0x406eec++){var _0x2cf743=_0x448eaf[_0x1f01e3[_0x406eec]][_0x897d('0x5')](function(_0x420ee5){return _0x420ee5['family']==='IPv4'&&_0x420ee5['internal']===![];});_0x1862cb=_0x1862cb[_0x897d('0x6')](_0x2cf743);}return _0x1862cb;}function getFirstInterface(){var _0x64369d=_[_0x897d('0x7')](getInterfaces());return{'macAddress':_0x64369d&&_0x64369d[_0x897d('0x8')]?_0x64369d[_0x897d('0x8')]:_0x897d('0x9'),'ipAddress':_0x64369d&&_0x64369d[_0x897d('0xa')]?_0x64369d[_0x897d('0xa')]:_0x897d('0xb')};}exports[_0x897d('0xc')]=getFirstInterface;function getCPUhash(){var _0x3011f3=_['orderBy'](os[_0x897d('0xd')]()[_0x897d('0xe')](function(_0x292416){return _0x292416['model'];}))[_0x897d('0xf')](':');return crypto[_0x897d('0x10')](_0x897d('0x11'))[_0x897d('0x12')](_0x3011f3)['digest'](_0x897d('0x13'));}exports[_0x897d('0x14')]=function(){var _0x469570=os[_0x897d('0x15')]();var _0x16e5c5=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x16e5c5['test'](config[_0x897d('0x16')])){return config['licenseToken'];}else if(_0x469570===_0x897d('0x17')){return exec(_0x897d('0x18'),{'encoding':_0x897d('0x19')})[_0x897d('0x1a')]('\x0d\x0a','');}else{var _0x53faae=getFirstInterface();var _0x4e5dc5=getCPUhash();var _0x4ea011=_0x4e5dc5+'|'+os[_0x897d('0x1b')]()+'|'+_0x53faae[_0x897d('0x1c')]+'|'+_0x53faae[_0x897d('0x1d')];var _0x1326e6=crypto[_0x897d('0x10')]('md5')[_0x897d('0x12')](_0x4ea011)[_0x897d('0x1e')]('hex');return _0x1326e6['substring'](0x0,0x8)+'-'+_0x1326e6[_0x897d('0x1f')](0x8,0xc)+'-'+_0x1326e6[_0x897d('0x1f')](0xc,0x10)+'-'+_0x1326e6[_0x897d('0x1f')](0x10,0x14)+'-'+_0x1326e6[_0x897d('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 81db008..0077845 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 _0x3323=['THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','default','util','moment','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','info'];(function(_0x17ad87,_0x20dd28){var _0x5a1145=function(_0xed8c79){while(--_0xed8c79){_0x17ad87['push'](_0x17ad87['shift']());}};_0x5a1145(++_0x20dd28);}(_0x3323,0x1f4));var _0x3332=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x3323[_0xdea41a];return _0x15d0d8;};'use strict';var util=require(_0x3332('0x0'));var moment=require(_0x3332('0x1'));var rp=require(_0x3332('0x2'));var BPromise=require(_0x3332('0x3'));var pkginfo=require('pkginfo')(module,_0x3332('0x4'));var db=require(_0x3332('0x5'))['db'];var encryptor=require(_0x3332('0x6'));var hardware=require('./hardware');var logger=require(_0x3332('0x7'))(_0x3332('0x8'));var HOST=_0x3332('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1d8110){return new BPromise(function(_0xcc3f65,_0x2f14be){var _0xc342e3=util[_0x3332('0xa')](_0x3332('0xb'),HOST,_0x1d8110,module['exports']['version']);if(oldToken){_0xc342e3=util[_0x3332('0xa')](_0x3332('0xc'),HOST,_0x1d8110,module['exports'][_0x3332('0x4')],oldToken);}var _0x3ac097={'uri':_0xc342e3,'method':_0x3332('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x3ac097)[_0x3332('0xe')](function(_0x34ef04){_0xcc3f65(_0x34ef04);})[_0x3332('0xf')](function(_0x25ff3b){_0x2f14be(_0x25ff3b);});});}function manageLicense(_0x5b529c,_0x1ee698){var _0x1b7208=_0x1ee698[_0x3332('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x1b7208[_0x3332('0x11')]!==_0x5b529c&&!_0x1b7208[_0x3332('0x12')]){oldToken=_0x1b7208['data1'];}httpRequest(_0x5b529c)[_0x3332('0xe')](function(_0x16d49b){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x16d49b['active']){isOldTokenSent=![];if(!_0x1b7208[_0x3332('0x8')]&&_0x1b7208['license']!=_0x16d49b[_0x3332('0x8')]||_0x1b7208[_0x3332('0x8')]&&_0x1b7208[_0x3332('0x12')]){logger[_0x3332('0x13')](_0x3332('0x14'));}if(_0x1b7208[_0x3332('0x8')]&&!_0x1b7208[_0x3332('0x12')]&&_0x1b7208[_0x3332('0x8')]!=_0x16d49b[_0x3332('0x8')]){logger['info'](_0x3332('0x15'));}if(_0x1b7208[_0x3332('0x8')]&&!_0x1b7208[_0x3332('0x12')]&&_0x1b7208[_0x3332('0x8')]==_0x16d49b[_0x3332('0x8')]){return _0x1ee698;}return _0x1ee698[_0x3332('0x16')]({'data1':_0x5b529c,'data2':null,'license':_0x16d49b[_0x3332('0x8')]});}else{if(_0x16d49b['license']||_0x1b7208[_0x3332('0x8')]){if(!_0x1b7208[_0x3332('0x12')]){if(_0x1b7208['data1']==_0x5b529c){GRAY_PERIOD_REASON=_0x3332('0x17');logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0x3332('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1b7208[_0x3332('0x11')],_0x5b529c);}logger[_0x3332('0x13')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x3332('0x18')](),moment()[_0x3332('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x1ee698['update']({'data2':encryptor[_0x3332('0x19')](moment()['format'](_0x3332('0x1a')))});}else{if(moment()[_0x3332('0x1b')](encryptor[_0x3332('0x1c')](_0x1b7208[_0x3332('0x12')]),_0x3332('0x1d'))>DAYS){logger[_0x3332('0x13')](_0x3332('0x1e'),moment()[_0x3332('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x1ee698[_0x3332('0x16')]({'data1':_0x5b529c,'data2':null,'license':null});}}}else{if(_0x1b7208[_0x3332('0x11')]!=_0x5b529c){logger[_0x3332('0x13')](_0x3332('0x1f'),_0x1b7208['data1'],_0x5b529c);return _0x1ee698[_0x3332('0x16')]({'data1':_0x5b529c,'data2':null,'license':null});}}}return _0x1ee698;})[_0x3332('0xe')](function(_0x437dd9){_0x1ee698=_0x437dd9;})['catch'](function(_0x5b1032){logger[_0x3332('0x20')](_0x5b1032[_0x3332('0x21')]);})[_0x3332('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x3332('0x23')](),_0x1ee698);},TIME);});}function defaultLicense(){var _0x1fe0e9=hardware['getUuid']();if(_0x1fe0e9){return db[_0x3332('0x24')][_0x3332('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x1fe0e9}})[_0x3332('0x26')](function(_0x33d5f6,_0x2a3043){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x1fe0e9);manageLicense(_0x1fe0e9,_0x33d5f6);})[_0x3332('0xf')](function(_0x330583){logger[_0x3332('0x20')](_0x330583['message']);});}}exports[_0x3332('0x27')]=defaultLicense; \ No newline at end of file +var _0xc72c=['./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor'];(function(_0x4f8dfa,_0x4d56b9){var _0x76c650=function(_0x2b8f70){while(--_0x2b8f70){_0x4f8dfa['push'](_0x4f8dfa['shift']());}};_0x76c650(++_0x4d56b9);}(_0xc72c,0x173));var _0xcc72=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xc72c[_0x4b055c];return _0x4b62bb;};'use strict';var util=require('util');var moment=require(_0xcc72('0x0'));var rp=require(_0xcc72('0x1'));var BPromise=require(_0xcc72('0x2'));var pkginfo=require(_0xcc72('0x3'))(module,_0xcc72('0x4'));var db=require(_0xcc72('0x5'))['db'];var encryptor=require(_0xcc72('0x6'));var hardware=require(_0xcc72('0x7'));var logger=require(_0xcc72('0x8'))(_0xcc72('0x9'));var HOST=_0xcc72('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x29d1a9){return new BPromise(function(_0xab708b,_0x3f7417){var _0x216c02=util[_0xcc72('0xb')](_0xcc72('0xc'),HOST,_0x29d1a9,module[_0xcc72('0xd')][_0xcc72('0x4')]);if(oldToken){_0x216c02=util[_0xcc72('0xb')](_0xcc72('0xe'),HOST,_0x29d1a9,module[_0xcc72('0xd')][_0xcc72('0x4')],oldToken);}var _0x31cea4={'uri':_0x216c02,'method':_0xcc72('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x31cea4)[_0xcc72('0x10')](function(_0x282c97){_0xab708b(_0x282c97);})[_0xcc72('0x11')](function(_0x16df30){_0x3f7417(_0x16df30);});});}function manageLicense(_0x47005a,_0x3154b7){var _0x2abb40=_0x3154b7[_0xcc72('0x12')]({'plain':!![]});if(!isOldTokenSent&&_0x2abb40[_0xcc72('0x13')]!==_0x47005a&&!_0x2abb40[_0xcc72('0x14')]){oldToken=_0x2abb40[_0xcc72('0x13')];}httpRequest(_0x47005a)[_0xcc72('0x10')](function(_0x5deb33){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5deb33[_0xcc72('0x15')]){isOldTokenSent=![];if(!_0x2abb40['license']&&_0x2abb40[_0xcc72('0x9')]!=_0x5deb33[_0xcc72('0x9')]||_0x2abb40[_0xcc72('0x9')]&&_0x2abb40['data2']){logger[_0xcc72('0x16')](_0xcc72('0x17'));}if(_0x2abb40[_0xcc72('0x9')]&&!_0x2abb40[_0xcc72('0x14')]&&_0x2abb40[_0xcc72('0x9')]!=_0x5deb33[_0xcc72('0x9')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x2abb40[_0xcc72('0x9')]&&!_0x2abb40[_0xcc72('0x14')]&&_0x2abb40['license']==_0x5deb33['license']){return _0x3154b7;}return _0x3154b7[_0xcc72('0x18')]({'data1':_0x47005a,'data2':null,'license':_0x5deb33[_0xcc72('0x9')]});}else{if(_0x5deb33[_0xcc72('0x9')]||_0x2abb40['license']){if(!_0x2abb40[_0xcc72('0x14')]){if(_0x2abb40[_0xcc72('0x13')]==_0x47005a){GRAY_PERIOD_REASON=_0xcc72('0x19');logger[_0xcc72('0x16')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0xcc72('0x16')](_0xcc72('0x1a'),_0x2abb40[_0xcc72('0x13')],_0x47005a);}logger[_0xcc72('0x16')](_0xcc72('0x1b'),GRAY_PERIOD_REASON[_0xcc72('0x1c')](),moment()['format'](_0xcc72('0x1d')));return _0x3154b7[_0xcc72('0x18')]({'data2':encryptor['encryptString'](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xcc72('0x1e')](encryptor[_0xcc72('0x1f')](_0x2abb40[_0xcc72('0x14')]),_0xcc72('0x20'))>DAYS){logger['info'](_0xcc72('0x21'),moment()[_0xcc72('0xb')](_0xcc72('0x1d')));isOldTokenSent=![];return _0x3154b7['update']({'data1':_0x47005a,'data2':null,'license':null});}}}else{if(_0x2abb40[_0xcc72('0x13')]!=_0x47005a){logger[_0xcc72('0x16')](_0xcc72('0x1a'),_0x2abb40['data1'],_0x47005a);return _0x3154b7[_0xcc72('0x18')]({'data1':_0x47005a,'data2':null,'license':null});}}}return _0x3154b7;})[_0xcc72('0x10')](function(_0x7657f8){_0x3154b7=_0x7657f8;})[_0xcc72('0x11')](function(_0x54037a){logger[_0xcc72('0x22')](_0x54037a['message']);})[_0xcc72('0x23')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x3154b7);},TIME);});}function defaultLicense(){var _0x24e6e1=hardware[_0xcc72('0x24')]();if(_0x24e6e1){return db[_0xcc72('0x25')][_0xcc72('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x24e6e1}})['spread'](function(_0x37f65d,_0x3245e3){logger['info'](_0xcc72('0x27'),_0x24e6e1);manageLicense(_0x24e6e1,_0x37f65d);})['catch'](function(_0x105d6a){logger[_0xcc72('0x22')](_0x105d6a[_0xcc72('0x28')]);});}}exports[_0xcc72('0x29')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 5f5f51f..9e48de0 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 _0x951b=['License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','bluebird','./hardware','../../components/encryptor','../../mysqldb','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','grayReason','disabled','message','User','findAll','role','sequelize','COUNT','col','admin','telephone','users','telephones','forEach','count','user'];(function(_0x12c3ce,_0x54d4bc){var _0x497bee=function(_0x4b6dae){while(--_0x4b6dae){_0x12c3ce['push'](_0x12c3ce['shift']());}};_0x497bee(++_0x54d4bc);}(_0x951b,0xee));var _0xb951=function(_0x59f82c,_0x2138e8){_0x59f82c=_0x59f82c-0x0;var _0x1ee2bd=_0x951b[_0x59f82c];return _0x1ee2bd;};'use strict';var util=require(_0xb951('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0xb951('0x1'));var hardware=require(_0xb951('0x2'));var encryptor=require(_0xb951('0x3'));var db=require(_0xb951('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xb951('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb951('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xb951('0x7'),'machineUuid':hardware[_0xb951('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x151e44){return new BPromise(function(_0x3230a5,_0x59c9c6){return db[_0xb951('0x8')][_0xb951('0x9')](_[_0xb951('0xa')](_0x151e44,{'raw':!![],'where':{'id':0x1}}))[_0xb951('0xb')](function(_0x76dcbb){return checkLicense(_0x76dcbb,null);})[_0xb951('0xb')](function(_0x401bca){_0x3230a5(_0x401bca);return;})[_0xb951('0xc')](function(_0x41b862){_0x59c9c6(_0x41b862);});});}function checkLicense(_0x566dc7,_0xa167fd){if(!_0x566dc7){demoLicense[_0xb951('0xd')]=_0x566dc7[_0xb951('0xe')];return demoLicense;}try{var _0xe26e5c=_0xa167fd||_0x566dc7['license'];if(_[_0xb951('0xf')](_0xe26e5c)){throw new Error(_0xb951('0x10'));}var _0x1ea0e3=_0x566dc7[_0xb951('0xe')];var _0x1e722c=_0x566dc7['data2'];var _0x29b5af=_0x1ea0e3[_0xb951('0x11')]('-')[0x4];var _0x222095=_0x1ea0e3[_0xb951('0x11')]('-')[0x0];var _0x450341=encryptor[_0xb951('0x12')](_0xe26e5c,util[_0xb951('0x13')](_0xb951('0x14'),_0x29b5af,_0x1ea0e3,_0x222095));var _0x4708c3=JSON[_0xb951('0x15')](_0x450341);_0x4708c3[_0xb951('0x16')]=![];_0x4708c3[_0xb951('0xd')]=_0x1ea0e3;_0x4708c3[_0xb951('0x17')]=hardware[_0xb951('0x5')]();if(_0x1e722c){var _0x2822fb=encryptor[_0xb951('0x12')](_0x1e722c);_0x4708c3[_0xb951('0x18')]=_0x2822fb;_0x4708c3[_0xb951('0x19')]=moment(_0x2822fb)[_0xb951('0x1a')](0x7,_0xb951('0x1b'))[_0xb951('0x13')]();_0x4708c3[_0xb951('0x1c')]=_0x4708c3[_0xb951('0xd')]!=_0x4708c3[_0xb951('0x17')]?'changed':_0xb951('0x1d');}return _0x4708c3;}catch(_0x2d9a5b){breakingLicense[_0xb951('0xd')]=_0x566dc7[_0xb951('0xe')];breakingLicense[_0xb951('0x1e')]=_0x2d9a5b[_0xb951('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x113f37,_0x33457a){getLicense()[_0xb951('0xb')](function(_0x4e73e4){return db[_0xb951('0x1f')][_0xb951('0x20')]({'attributes':[_0xb951('0x21'),[db[_0xb951('0x22')]['fn'](_0xb951('0x23'),db['sequelize'][_0xb951('0x24')](_0xb951('0x21'))),'count']],'group':_0xb951('0x21'),'where':{'role':{'$or':[_0xb951('0x25'),'user',_0xb951('0x26')]}},'raw':!![]})[_0xb951('0xb')](function(_0x2770da){var _0x1d1ba4={'user':_0x4e73e4[_0xb951('0x27')]||0x0,'telephone':_0x4e73e4[_0xb951('0x28')]||0x0};_0x2770da[_0xb951('0x29')](function(_0x4bcb5b){var _0x1a09e1=_0x4bcb5b[_0xb951('0x21')]===_0xb951('0x25')?'user':_0x4bcb5b[_0xb951('0x21')];_0x1d1ba4[_0x1a09e1]-=_0x4bcb5b[_0xb951('0x2a')];if(_0x1d1ba4[_0x1a09e1]<0x0)_0x1d1ba4[_0x1a09e1]=0x0;});_0x113f37(_0x1d1ba4);return;});})[_0xb951('0xc')](function(_0x683652){_0x33457a(_0x683652);});});}function checkUserLimits(_0x2d09f3){return new BPromise(function(_0x34ecb1,_0x4b8154){getLimits()[_0xb951('0xb')](function(_0x340a4e){var _0x24ddb3=_['pick'](_['countBy'](_0x2d09f3,_0xb951('0x21')),['admin','user',_0xb951('0x26')]);var _0x1bc0a3=(_0x24ddb3[_0xb951('0x25')]||0x0)+(_0x24ddb3[_0xb951('0x2b')]||0x0);var _0x50a88e=_0x24ddb3[_0xb951('0x26')]||0x0;if(_0x1bc0a3>_0x340a4e[_0xb951('0x2b')])return _0x4b8154(_0xb951('0x2c'));if(_0x50a88e>_0x340a4e[_0xb951('0x26')])return _0x4b8154(_0xb951('0x2d'));return _0x34ecb1();})[_0xb951('0xc')](function(_0x10a801){_0x4b8154(_0x10a801);});});}module[_0xb951('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x5637=['license','data2','split','decryptString','%s:%s:%s','parse','demo','machineUuid','gray','add','days','format','grayReason','disabled','message','User','findAll','role','sequelize','col','count','admin','user','telephone','telephones','forEach','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','then','catch','uuid','data1'];(function(_0x574262,_0x48fca1){var _0xa7627=function(_0x80efb3){while(--_0x80efb3){_0x574262['push'](_0x574262['shift']());}};_0xa7627(++_0x48fca1);}(_0x5637,0x167));var _0x7563=function(_0x495494,_0x44f210){_0x495494=_0x495494-0x0;var _0x12cf4b=_0x5637[_0x495494];return _0x12cf4b;};'use strict';var util=require(_0x7563('0x0'));var _=require(_0x7563('0x1'));var moment=require(_0x7563('0x2'));var BPromise=require(_0x7563('0x3'));var hardware=require(_0x7563('0x4'));var encryptor=require(_0x7563('0x5'));var db=require(_0x7563('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7563('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x7563('0x8'),'machineUuid':hardware[_0x7563('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7563('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x7563('0xa'),'machineUuid':hardware[_0x7563('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2bf580){return new BPromise(function(_0x213d2a,_0x1a3541){return db[_0x7563('0xb')][_0x7563('0xc')](_['defaults'](_0x2bf580,{'raw':!![],'where':{'id':0x1}}))[_0x7563('0xd')](function(_0x11d8b3){return checkLicense(_0x11d8b3,null);})[_0x7563('0xd')](function(_0x41f1af){_0x213d2a(_0x41f1af);return;})[_0x7563('0xe')](function(_0x1eec05){_0x1a3541(_0x1eec05);});});}function checkLicense(_0x605e01,_0x359ee6){if(!_0x605e01){demoLicense[_0x7563('0xf')]=_0x605e01[_0x7563('0x10')];return demoLicense;}try{var _0x5c124c=_0x359ee6||_0x605e01[_0x7563('0x11')];if(_['isEmpty'](_0x5c124c)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x255420=_0x605e01['data1'];var _0x5a3002=_0x605e01[_0x7563('0x12')];var _0x4ea476=_0x255420['split']('-')[0x4];var _0x3d9aba=_0x255420[_0x7563('0x13')]('-')[0x0];var _0x34284b=encryptor[_0x7563('0x14')](_0x5c124c,util['format'](_0x7563('0x15'),_0x4ea476,_0x255420,_0x3d9aba));var _0x55025a=JSON[_0x7563('0x16')](_0x34284b);_0x55025a[_0x7563('0x17')]=![];_0x55025a['uuid']=_0x255420;_0x55025a[_0x7563('0x18')]=hardware[_0x7563('0x9')]();if(_0x5a3002){var _0x46ab8f=encryptor[_0x7563('0x14')](_0x5a3002);_0x55025a[_0x7563('0x19')]=_0x46ab8f;_0x55025a['deadline']=moment(_0x46ab8f)[_0x7563('0x1a')](0x7,_0x7563('0x1b'))[_0x7563('0x1c')]();_0x55025a[_0x7563('0x1d')]=_0x55025a[_0x7563('0xf')]!=_0x55025a['machineUuid']?'changed':_0x7563('0x1e');}return _0x55025a;}catch(_0x272ba9){breakingLicense[_0x7563('0xf')]=_0x605e01[_0x7563('0x10')];breakingLicense[_0x7563('0x1f')]=_0x272ba9['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4f172d,_0xb29a87){getLicense()['then'](function(_0x25e962){return db[_0x7563('0x20')][_0x7563('0x21')]({'attributes':[_0x7563('0x22'),[db[_0x7563('0x23')]['fn']('COUNT',db[_0x7563('0x23')][_0x7563('0x24')]('role')),_0x7563('0x25')]],'group':_0x7563('0x22'),'where':{'role':{'$or':[_0x7563('0x26'),_0x7563('0x27'),_0x7563('0x28')]}},'raw':!![]})[_0x7563('0xd')](function(_0xff5ee0){var _0x55e7ad={'user':_0x25e962['users']||0x0,'telephone':_0x25e962[_0x7563('0x29')]||0x0};_0xff5ee0[_0x7563('0x2a')](function(_0x45ddba){var _0x1198c2=_0x45ddba[_0x7563('0x22')]==='admin'?_0x7563('0x27'):_0x45ddba[_0x7563('0x22')];_0x55e7ad[_0x1198c2]-=_0x45ddba['count'];if(_0x55e7ad[_0x1198c2]<0x0)_0x55e7ad[_0x1198c2]=0x0;});_0x4f172d(_0x55e7ad);return;});})[_0x7563('0xe')](function(_0x5a7a62){_0xb29a87(_0x5a7a62);});});}function checkUserLimits(_0x4d998b){return new BPromise(function(_0x538084,_0x7f6bb9){getLimits()[_0x7563('0xd')](function(_0x4ae678){var _0x28d625=_['pick'](_[_0x7563('0x2b')](_0x4d998b,_0x7563('0x22')),[_0x7563('0x26'),_0x7563('0x27'),'telephone']);var _0x456e48=(_0x28d625['admin']||0x0)+(_0x28d625['user']||0x0);var _0x6fbbed=_0x28d625[_0x7563('0x28')]||0x0;if(_0x456e48>_0x4ae678[_0x7563('0x27')])return _0x7f6bb9(_0x7563('0x2c'));if(_0x6fbbed>_0x4ae678[_0x7563('0x28')])return _0x7f6bb9(_0x7563('0x2d'));return _0x538084();})[_0x7563('0xe')](function(_0x537b3c){_0x7f6bb9(_0x537b3c);});});}module[_0x7563('0x2e')]={'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 3cf7d2e..9d359ac 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 _0x2032=['app-id','http://localhost:9000','myappanuglar-secret'];(function(_0x402841,_0xac053d){var _0x3ec0f8=function(_0x1164bf){while(--_0x1164bf){_0x402841['push'](_0x402841['shift']());}};_0x3ec0f8(++_0xac053d);}(_0x2032,0xd9));var _0x2203=function(_0x5964e2,_0xc3f01f){_0x5964e2=_0x5964e2-0x0;var _0x3ff6d0=_0x2032[_0x5964e2];return _0x3ff6d0;};'use strict';module['exports']={'DOMAIN':_0x2203('0x0'),'SESSION_SECRET':_0x2203('0x1'),'GOOGLE_ID':_0x2203('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x8f4c=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x2f3e19,_0x3a1085){var _0x34d059=function(_0x4da5cc){while(--_0x4da5cc){_0x2f3e19['push'](_0x2f3e19['shift']());}};_0x34d059(++_0x3a1085);}(_0x8f4c,0x113));var _0xc8f4=function(_0x1062e3,_0x49349e){_0x1062e3=_0x1062e3-0x0;var _0x92e616=_0x8f4c[_0x1062e3];return _0x92e616;};'use strict';module[_0xc8f4('0x0')]={'DOMAIN':_0xc8f4('0x1'),'SESSION_SECRET':_0xc8f4('0x2'),'GOOGLE_ID':_0xc8f4('0x3'),'GOOGLE_SECRET':_0xc8f4('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 4a59c7c..83456be 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x682c=['../utils/loggers','exports'];(function(_0x898f06,_0x216aab){var _0x50262b=function(_0x24576e){while(--_0x24576e){_0x898f06['push'](_0x898f06['shift']());}};_0x50262b(++_0x216aab);}(_0x682c,0x14a));var _0xc682=function(_0x1125ed,_0x14a1a5){_0x1125ed=_0x1125ed-0x0;var _0x2999e1=_0x682c[_0x1125ed];return _0x2999e1;};'use strict';var fileLogger=require(_0xc682('0x0'))['fileLogger'];module[_0xc682('0x1')]=fileLogger; \ No newline at end of file +var _0x9e0e=['../utils/loggers','fileLogger','exports'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0x9e0e,0xb1));var _0xe9e0=function(_0x3be62b,_0x15c45f){_0x3be62b=_0x3be62b-0x0;var _0x774a0a=_0x9e0e[_0x3be62b];return _0x774a0a;};'use strict';var fileLogger=require(_0xe9e0('0x0'))[_0xe9e0('0x1')];module[_0xe9e0('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 700729d..0081f46 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 _0x5e93=['../../services/agi/index.js','email','../../services/routing/index.js','xdr','../../config/environment','join','root','express','ami','../../services/ami/index.js'];(function(_0x5e3628,_0x5a938c){var _0xf2f373=function(_0xf5a5d8){while(--_0xf5a5d8){_0x5e3628['push'](_0x5e3628['shift']());}};_0xf2f373(++_0x5a938c);}(_0x5e93,0x1da));var _0x35e9=function(_0x307841,_0x274e89){_0x307841=_0x307841-0x0;var _0x57130b=_0x5e93[_0x307841];return _0x57130b;};'use strict';var path=require('path');var cfg=require(_0x35e9('0x0'));var env={'NODE_PATH':path['resolve'](path[_0x35e9('0x1')](cfg[_0x35e9('0x2')],'legacy-libs'))};var pm2config={'apps':[{'name':_0x35e9('0x3'),'script':path['join'](__dirname,'../../services/express/index.js'),'env':env},{'name':_0x35e9('0x4'),'script':path['join'](__dirname,_0x35e9('0x5')),'env':env},{'name':'agi','script':path['join'](__dirname,_0x35e9('0x6')),'env':env},{'name':_0x35e9('0x7'),'script':path[_0x35e9('0x1')](__dirname,'../../services/email/index.js'),'env':env},{'name':'routing','script':path[_0x35e9('0x1')](__dirname,_0x35e9('0x8')),'env':env},{'name':_0x35e9('0x9'),'script':path['join'](__dirname,'../../services/xdr/index.js'),'env':env}]};module['exports']=pm2config; \ No newline at end of file +var _0x1579=['email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','path','../../config/environment','resolve','express','join','ami','../../services/ami/index.js','../../services/agi/index.js'];(function(_0xbc7ea,_0x4d3f90){var _0xadc703=function(_0x8309cf){while(--_0x8309cf){_0xbc7ea['push'](_0xbc7ea['shift']());}};_0xadc703(++_0x4d3f90);}(_0x1579,0x17e));var _0x9157=function(_0x104cce,_0x194517){_0x104cce=_0x104cce-0x0;var _0x4a63f1=_0x1579[_0x104cce];return _0x4a63f1;};'use strict';var path=require(_0x9157('0x0'));var cfg=require(_0x9157('0x1'));var env={'NODE_PATH':path[_0x9157('0x2')](path['join'](cfg['root'],'legacy-libs'))};var pm2config={'apps':[{'name':_0x9157('0x3'),'script':path[_0x9157('0x4')](__dirname,'../../services/express/index.js'),'env':env},{'name':_0x9157('0x5'),'script':path['join'](__dirname,_0x9157('0x6')),'env':env},{'name':'agi','script':path[_0x9157('0x4')](__dirname,_0x9157('0x7')),'env':env},{'name':_0x9157('0x8'),'script':path[_0x9157('0x4')](__dirname,_0x9157('0x9')),'env':env},{'name':_0x9157('0xa'),'script':path[_0x9157('0x4')](__dirname,_0x9157('0xb')),'env':env},{'name':'xdr','script':path[_0x9157('0x4')](__dirname,_0x9157('0xc')),'env':env}]};module['exports']=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 8d42fce..df632ca 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 _0xa9db=['dump','saved','bluebird','./config','connected','start','disconnect','then','restart','list','describe','delete'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa9db,0x182));var _0xba9d=function(_0x152aac,_0x22f4a6){_0x152aac=_0x152aac-0x0;var _0x16412e=_0xa9db[_0x152aac];return _0x16412e;};'use strict';var pm2=require('pm2');var BPromise=require(_0xba9d('0x0'));var config=require(_0xba9d('0x1'));function connect(){return new BPromise(function(_0x257c79,_0x55d3ce){return pm2['connect'](function(_0x491c4){if(_0x491c4){return _0x55d3ce(_0x491c4);}return _0x257c79(_0xba9d('0x2'));});});};exports['start']=function(_0x52ae7e){return connect()['then'](function(){return new BPromise(function(_0x4816c7,_0x4393e7){return pm2[_0xba9d('0x3')](_0x52ae7e,function(_0x278e17,_0xac96c3){if(_0x278e17){return _0x4393e7(_0x278e17);}pm2[_0xba9d('0x4')]();return _0x4816c7(_0xac96c3);});});});};exports['stop']=function(_0x532941){return connect()[_0xba9d('0x5')](function(){return new BPromise(function(_0x27afd5,_0x290626){return pm2['stop'](_0x532941,function(_0x3073de,_0x5cfeb4){if(_0x3073de){return _0x290626(_0x3073de);}pm2[_0xba9d('0x4')]();return _0x27afd5(_0x5cfeb4);});});});};exports[_0xba9d('0x6')]=function(_0x5e9687){return connect()[_0xba9d('0x5')](function(){return new BPromise(function(_0x3f7664,_0x5dcff1){return pm2['restart'](_0x5e9687,function(_0x423888,_0x35a53d){if(_0x423888){return _0x5dcff1(_0x423888);}pm2[_0xba9d('0x4')]();return _0x3f7664(_0x35a53d);});});});};exports[_0xba9d('0x7')]=function(){return connect()[_0xba9d('0x5')](function(){return new BPromise(function(_0x13a9e0,_0x27869d){return pm2[_0xba9d('0x7')](function(_0x317412,_0x16f3d6){if(_0x317412){return _0x27869d(_0x317412);}pm2[_0xba9d('0x4')]();return _0x13a9e0(_0x16f3d6);});});});};exports['describe']=function(_0x4b2beb){return connect()[_0xba9d('0x5')](function(){return new BPromise(function(_0x3bf367,_0x4a9cf2){return pm2[_0xba9d('0x8')](_0x4b2beb,function(_0x5c8312,_0x42583c){if(_0x5c8312){return _0x4a9cf2(_0x5c8312);}pm2[_0xba9d('0x4')]();return _0x3bf367(_0x42583c);});});});};exports['delete']=function(_0x2511f5){return connect()['then'](function(){return new BPromise(function(_0x264864,_0x21727a){return pm2[_0xba9d('0x9')](_0x2511f5,function(_0x143fbf,_0x307f02){if(_0x143fbf){return _0x21727a(_0x143fbf);}pm2['disconnect']();return _0x264864(_0x307f02);});});});};exports[_0xba9d('0xa')]=function(){return connect()[_0xba9d('0x5')](function(){return new BPromise(function(_0xe17cf5,_0x1ee696){return pm2['dump'](function(_0x4fb9f3){if(_0x4fb9f3){return _0x1ee696(_0x4fb9f3);}return _0xe17cf5(_0xba9d('0xb'));});});});}; \ No newline at end of file +var _0x5d32=['describe','delete','dump','saved','./config','connect','start','then','disconnect','stop','restart','list'];(function(_0x43ee4,_0x32976e){var _0x361c65=function(_0x255b9d){while(--_0x255b9d){_0x43ee4['push'](_0x43ee4['shift']());}};_0x361c65(++_0x32976e);}(_0x5d32,0x160));var _0x25d3=function(_0x223a99,_0x1ddaff){_0x223a99=_0x223a99-0x0;var _0x5a2346=_0x5d32[_0x223a99];return _0x5a2346;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x25d3('0x0'));function connect(){return new BPromise(function(_0xe32c36,_0x16bd83){return pm2[_0x25d3('0x1')](function(_0xe4b2f9){if(_0xe4b2f9){return _0x16bd83(_0xe4b2f9);}return _0xe32c36('connected');});});};exports[_0x25d3('0x2')]=function(_0x53e5c9){return connect()[_0x25d3('0x3')](function(){return new BPromise(function(_0x340978,_0x34829f){return pm2[_0x25d3('0x2')](_0x53e5c9,function(_0x2f3acb,_0x3f8407){if(_0x2f3acb){return _0x34829f(_0x2f3acb);}pm2[_0x25d3('0x4')]();return _0x340978(_0x3f8407);});});});};exports[_0x25d3('0x5')]=function(_0x31508e){return connect()[_0x25d3('0x3')](function(){return new BPromise(function(_0x567e95,_0x272324){return pm2[_0x25d3('0x5')](_0x31508e,function(_0x52b357,_0x5a0de8){if(_0x52b357){return _0x272324(_0x52b357);}pm2[_0x25d3('0x4')]();return _0x567e95(_0x5a0de8);});});});};exports[_0x25d3('0x6')]=function(_0x3b7a11){return connect()[_0x25d3('0x3')](function(){return new BPromise(function(_0x190719,_0x53f2ec){return pm2[_0x25d3('0x6')](_0x3b7a11,function(_0x3b4699,_0x3d5131){if(_0x3b4699){return _0x53f2ec(_0x3b4699);}pm2[_0x25d3('0x4')]();return _0x190719(_0x3d5131);});});});};exports[_0x25d3('0x7')]=function(){return connect()[_0x25d3('0x3')](function(){return new BPromise(function(_0x1cf5db,_0x21f712){return pm2[_0x25d3('0x7')](function(_0x4fc161,_0x5de791){if(_0x4fc161){return _0x21f712(_0x4fc161);}pm2[_0x25d3('0x4')]();return _0x1cf5db(_0x5de791);});});});};exports['describe']=function(_0x562187){return connect()[_0x25d3('0x3')](function(){return new BPromise(function(_0x162397,_0x1461a0){return pm2[_0x25d3('0x8')](_0x562187,function(_0x48bf0e,_0x95b43c){if(_0x48bf0e){return _0x1461a0(_0x48bf0e);}pm2['disconnect']();return _0x162397(_0x95b43c);});});});};exports[_0x25d3('0x9')]=function(_0x3a445c){return connect()['then'](function(){return new BPromise(function(_0x546afd,_0x24372c){return pm2[_0x25d3('0x9')](_0x3a445c,function(_0xd88db5,_0x72ac76){if(_0xd88db5){return _0x24372c(_0xd88db5);}pm2['disconnect']();return _0x546afd(_0x72ac76);});});});};exports[_0x25d3('0xa')]=function(){return connect()[_0x25d3('0x3')](function(){return new BPromise(function(_0x1eecd,_0x3574d7){return pm2[_0x25d3('0xa')](function(_0x502863){if(_0x502863){return _0x3574d7(_0x502863);}return _0x1eecd(_0x25d3('0xb'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 46ad719..4afffb2 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 _0x4a1e=['chatTimeout','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','util','../../config/environment','../logger','schedule','redis','defaults','socket.io-emitter','then','ChatInteraction','findAll','subtract'];(function(_0x2d6e0e,_0x9fa0ed){var _0x53ce70=function(_0x27104a){while(--_0x27104a){_0x2d6e0e['push'](_0x2d6e0e['shift']());}};_0x53ce70(++_0x9fa0ed);}(_0x4a1e,0x153));var _0xe4a1=function(_0x4629ee,_0x5802d8){_0x4629ee=_0x4629ee-0x0;var _0x47fb5b=_0x4a1e[_0x4629ee];return _0x47fb5b;};'use strict';var _=require(_0xe4a1('0x0'));var moment=require('moment');var Redis=require(_0xe4a1('0x1'));var util=require(_0xe4a1('0x2'));var config=require(_0xe4a1('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xe4a1('0x4'))(_0xe4a1('0x5'));config[_0xe4a1('0x6')]=_[_0xe4a1('0x7')](config[_0xe4a1('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xe4a1('0x8'))(new Redis(config[_0xe4a1('0x6')]));function closeInteractions(){var _0x1b0ca4=0x0;var _0x1ef6d5=[];return db['Setting']['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xe4a1('0x9')](function(_0x3290bd){_0x1b0ca4=_0x3290bd['chatTimeout'];if(_0x1b0ca4){return db[_0xe4a1('0xa')][_0xe4a1('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe4a1('0xc')](_0x3290bd[_0xe4a1('0xd')],_0xe4a1('0xe'))}}});}else{return[];}})[_0xe4a1('0x9')](function(_0x265a27){if(_0x265a27&&_0x265a27['length']){_0x1ef6d5=_[_0xe4a1('0xf')](_0x265a27||[],'id');logger[_0xe4a1('0x10')](_0xe4a1('0x11'),_0x1ef6d5[_0xe4a1('0x12')]());return db['ChatInteraction'][_0xe4a1('0x13')]({'closeReason':_0xe4a1('0x14'),'disposition':_0xe4a1('0x15'),'closed':!![],'closedAt':moment()['format'](_0xe4a1('0x16'))},{'where':{'id':_0x1ef6d5}});}})['then'](function(){if(_0x1ef6d5&&_0x1ef6d5[_0xe4a1('0x17')]){logger[_0xe4a1('0x10')](_0xe4a1('0x18'),_0x1ef6d5[_0xe4a1('0x12')]());for(var _0x2d4f50=0x0;_0x2d4f50<_0x1ef6d5['length'];_0x2d4f50++){io[_0xe4a1('0x19')](_0xe4a1('0x1a'),{'id':_0x1ef6d5[_0x2d4f50],'closed':!![]});}}})[_0xe4a1('0x1b')](function(_0x3cf50c){logger[_0xe4a1('0x1c')](_0xe4a1('0x1d'),_0x3cf50c?util[_0xe4a1('0x1e')](_0x3cf50c,{'showHidden':![],'depth':null}):'');});}exports[_0xe4a1('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x86bf=['defaults','localhost','socket.io-emitter','then','chatTimeout','ChatInteraction','findAll','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis'];(function(_0x598190,_0x546573){var _0x23e811=function(_0x9ba10){while(--_0x9ba10){_0x598190['push'](_0x598190['shift']());}};_0x23e811(++_0x546573);}(_0x86bf,0x1b1));var _0xf86b=function(_0x5b2cbd,_0x373c54){_0x5b2cbd=_0x5b2cbd-0x0;var _0x5c7784=_0x86bf[_0x5b2cbd];return _0x5c7784;};'use strict';var _=require(_0xf86b('0x0'));var moment=require(_0xf86b('0x1'));var Redis=require(_0xf86b('0x2'));var util=require(_0xf86b('0x3'));var config=require(_0xf86b('0x4'));var db=require(_0xf86b('0x5'))['db'];var logger=require(_0xf86b('0x6'))(_0xf86b('0x7'));config[_0xf86b('0x8')]=_[_0xf86b('0x9')](config[_0xf86b('0x8')],{'host':_0xf86b('0xa'),'port':0x18eb});var io=require(_0xf86b('0xb'))(new Redis(config['redis']));function closeInteractions(){var _0x11f3f9=0x0;var _0x32ef4f=[];return db['Setting']['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xf86b('0xc')](function(_0x5aafde){_0x11f3f9=_0x5aafde[_0xf86b('0xd')];if(_0x11f3f9){return db[_0xf86b('0xe')][_0xf86b('0xf')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x5aafde[_0xf86b('0xd')],_0xf86b('0x10'))}}});}else{return[];}})[_0xf86b('0xc')](function(_0x44d429){if(_0x44d429&&_0x44d429[_0xf86b('0x11')]){_0x32ef4f=_['map'](_0x44d429||[],'id');logger[_0xf86b('0x12')](_0xf86b('0x13'),_0x32ef4f[_0xf86b('0x14')]());return db[_0xf86b('0xe')][_0xf86b('0x15')]({'closeReason':_0xf86b('0x16'),'disposition':_0xf86b('0x17'),'closed':!![],'closedAt':moment()[_0xf86b('0x18')](_0xf86b('0x19'))},{'where':{'id':_0x32ef4f}});}})[_0xf86b('0xc')](function(){if(_0x32ef4f&&_0x32ef4f['length']){logger[_0xf86b('0x12')](_0xf86b('0x1a'),_0x32ef4f[_0xf86b('0x14')]());for(var _0x37eeac=0x0;_0x37eeac<_0x32ef4f['length'];_0x37eeac++){io[_0xf86b('0x1b')](_0xf86b('0x1c'),{'id':_0x32ef4f[_0x37eeac],'closed':!![]});}}})[_0xf86b('0x1d')](function(_0x5714c8){logger[_0xf86b('0x1e')](_0xf86b('0x1f'),_0x5714c8?util[_0xf86b('0x20')](_0x5714c8,{'showHidden':![],'depth':null}):'');});}exports[_0xf86b('0x21')]=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 1560014..d4b907a 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 _0x217f=['../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x3b3750,_0x28f3b8){var _0x1b9e8b=function(_0xaf75c3){while(--_0xaf75c3){_0x3b3750['push'](_0x3b3750['shift']());}};_0x1b9e8b(++_0x28f3b8);}(_0x217f,0x105));var _0xf217=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x217f[_0x321bb2];return _0x9c12ed;};'use strict';function start(){var _0x30cdcb=require(_0xf217('0x0'));return _0x30cdcb['startAllRefreshIntervals']();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x6d50=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x1d94bc,_0xa7ed66){var _0x47a921=function(_0x3684ab){while(--_0x3684ab){_0x1d94bc['push'](_0x1d94bc['shift']());}};_0x47a921(++_0xa7ed66);}(_0x6d50,0x196));var _0x06d5=function(_0x5b1e47,_0x84916f){_0x5b1e47=_0x5b1e47-0x0;var _0xcee567=_0x6d50[_0x5b1e47];return _0xcee567;};'use strict';function start(){var _0x1fc4e=require(_0x06d5('0x0'));return _0x1fc4e[_0x06d5('0x1')]();}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 6c42355..b030b0b 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 _0x1f28=['existsSync','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','error','email\x20sent','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','keys','jobs','map','toString','difference','length','exists','stop','deleteJob','toRun','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update','update\x20cron','run','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','zip'];(function(_0x3e820a,_0x291ff4){var _0x498495=function(_0xbc504a){while(--_0xbc504a){_0x3e820a['push'](_0x3e820a['shift']());}};_0x498495(++_0x291ff4);}(_0x1f28,0x1db));var _0x81f2=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1f28[_0x19950b];return _0x3c6b41;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0x81f2('0x0'));var moment=require(_0x81f2('0x1'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x81f2('0x2'));var BPromise=require(_0x81f2('0x3'));var logger=require(_0x81f2('0x4'))(_0x81f2('0x5'));var db=require(_0x81f2('0x6'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x81f2('0x7'));var client=jayson[_0x81f2('0x8')][_0x81f2('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x281772,_0x51511b){return function(){logger[_0x81f2('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x281772[_0x81f2('0xb')]);var _0x522fca=!![];var _0x283926=_0x281772['MailAccount'][_0x81f2('0xc')]();var _0x45274e={'account':_0x283926,'message':{'from':util[_0x81f2('0xd')](_0x81f2('0xe'),_0x281772[_0x81f2('0xf')][_0x81f2('0x10')],_0x281772[_0x81f2('0xf')][_0x81f2('0xb')]||_0x281772[_0x81f2('0xf')][_0x81f2('0x11')][_0x81f2('0x12')]),'to':_0x281772[_0x81f2('0xb')],'cc':_0x281772['cc'],'bcc':_0x281772[_0x81f2('0x13')],'subject':util[_0x81f2('0xd')](_0x81f2('0x14'),_0x51511b[_0x81f2('0x10')],_0x281772[_0x81f2('0x15')],_0x281772[_0x81f2('0x16')])}};var _0x357f2f=path[_0x81f2('0x17')](__dirname,_0x81f2('0x18'));var _0x48a1a2=_0x51511b[_0x81f2('0x19')];var _0x1b1656=util[_0x81f2('0xd')](_0x81f2('0x1a'),path[_0x81f2('0x1b')](_0x51511b[_0x81f2('0x19')],path['extname'](_0x51511b[_0x81f2('0x19')])),_0x81f2('0x1c'));var _0x16b880=path['join'](_0x357f2f,_0x48a1a2);var _0x3b62d4=path[_0x81f2('0x17')](_0x357f2f,_0x1b1656);if(fs[_0x81f2('0x1d')](_0x16b880)){_0x51511b['status']='Sent';_0x45274e[_0x81f2('0x1e')][_0x81f2('0x1f')]=[{'filename':_0x48a1a2,'path':_0x16b880}];_0x45274e[_0x81f2('0x1e')]['text']=util[_0x81f2('0xd')](_0x81f2('0x20'),JSON[_0x81f2('0x21')](_0x51511b,null,0x2));}else if(fs[_0x81f2('0x1d')](_0x3b62d4)){_0x51511b[_0x81f2('0x22')]='Sent';_0x45274e[_0x81f2('0x1e')][_0x81f2('0x1f')]=[{'filename':_0x1b1656,'path':_0x3b62d4}];}else{_0x45274e[_0x81f2('0x1e')][_0x81f2('0x23')]=_0x81f2('0x24');if(!_0x281772[_0x81f2('0x25')]){_0x522fca=![];logger['info'](_0x81f2('0x26'));}}if(_0x522fca){return client['request'](_0x81f2('0x27'),_0x45274e)['then'](function(_0x7665f7){if(_0x7665f7[_0x81f2('0x28')]){return logger['error']('error\x20mail',JSON[_0x81f2('0x21')](_0x7665f7));}return logger[_0x81f2('0xa')](_0x81f2('0x29'));})[_0x81f2('0x2a')](function(_0x47e081){return logger[_0x81f2('0x28')](_0x81f2('0x2b'),JSON[_0x81f2('0x21')](_0x47e081));});}};}function handleError(){return function(_0x1c9df2){return logger[_0x81f2('0x28')](JSON[_0x81f2('0x21')](_0x1c9df2));};}function handleResult(_0x53640f){return function(_0x5003c4){logger[_0x81f2('0xa')](_0x81f2('0x2c'),JSON[_0x81f2('0x21')](_0x5003c4));if(_0x53640f[_0x81f2('0xf')]&&_0x53640f[_0x81f2('0xf')][_0x81f2('0x11')]&&!_[_0x81f2('0x2d')](_0x53640f['email'])){setTimeout(handleSendEmail(_0x53640f,_0x5003c4),0x3c*0x3e8);}};}function handleJob(_0x4d8f7c){return function(){try{if(_['isNil'](_0x4d8f7c[_0x81f2('0x15')])){return logger[_0x81f2('0xa')](_0x81f2('0x2e'));}if(_['isNil'](_0x4d8f7c[_0x81f2('0x16')])){return logger[_0x81f2('0xa')](_0x81f2('0x2f'));}var _0x4ab604={'startDate':moment()[_0x81f2('0x30')](_0x4d8f7c[_0x81f2('0x15')],_0x4d8f7c[_0x81f2('0x16')])[_0x81f2('0xd')](_0x81f2('0x31')),'endDate':moment()['format'](_0x81f2('0x31')),'type':_0x81f2('0x32'),'output':_0x4d8f7c['output'],'name':_0x4d8f7c[_0x81f2('0x10')]};if(!_['isNil'](_0x4d8f7c[_0x81f2('0x33')])){logger[_0x81f2('0xa')](_0x81f2('0x34'),_0x4d8f7c['DefaultReportId']);return analyticDefaultReportController[_0x81f2('0x35')]({'id':_0x4d8f7c[_0x81f2('0x33')]},_0x4ab604)[_0x81f2('0x36')](handleResult(_0x4d8f7c))[_0x81f2('0x2a')](handleError());}if(!_[_0x81f2('0x2d')](_0x4d8f7c[_0x81f2('0x37')])){logger[_0x81f2('0xa')](_0x81f2('0x38'),_0x4d8f7c[_0x81f2('0x37')]);return analyticCustomReportController['runReport']({'id':_0x4d8f7c[_0x81f2('0x37')]},_0x4ab604)[_0x81f2('0x36')](handleResult(_0x4d8f7c))[_0x81f2('0x2a')](handleError());}}catch(_0x4d60d5){logger[_0x81f2('0x28')](JSON[_0x81f2('0x21')](_0x4d60d5));}return logger[_0x81f2('0xa')](_0x81f2('0x39'));};}function getJobs(_0x399d18){var _0x1d2575={};if(_0x399d18){_0x1d2575['id']=_0x399d18;}return db['Schedule'][_0x81f2('0x3a')]({'where':_0x1d2575,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0x81f2('0xb')],'include':[{'model':db[_0x81f2('0x3b')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]}]})[_0x81f2('0x36')](function(_0x23e2f8){var _0x4aa3a7=_[_0x81f2('0x3c')](manager[_0x81f2('0x3d')]);var _0x4e510e=_[_0x81f2('0x3e')](_0x23e2f8,function(_0x5ad435){return _0x5ad435['id'][_0x81f2('0x3f')]();});var _0xd1fadb=_['keyBy'](_0x23e2f8,function(_0x52dd99){return _0x52dd99['id'][_0x81f2('0x3f')]();});var _0x1bab23=_0x399d18?_0x4e510e:_[_0x81f2('0x40')](_0x4e510e,_0x4aa3a7);var _0x43f3a9=_['intersection'](_0x4e510e,_0x4aa3a7);var _0x4b334d=_[_0x81f2('0x40')](_0x4aa3a7,_0x4e510e);var _0x3b2aa3;var _0x5d32c2;for(_0x3b2aa3=0x0;_0x3b2aa3<_0x4b334d[_0x81f2('0x41')]&&!_0x399d18;_0x3b2aa3+=0x1){_0x5d32c2=_0x4b334d[_0x3b2aa3][_0x81f2('0x3f')]();if(manager[_0x81f2('0x42')](_0x5d32c2)){manager[_0x81f2('0x43')](_0x5d32c2);manager[_0x81f2('0x44')](_0x5d32c2);logger['info']('delete\x20cron',_0x5d32c2);}}logger[_0x81f2('0xa')](_0x81f2('0x45'),JSON[_0x81f2('0x21')](_0x1bab23));for(_0x3b2aa3=0x0;_0x3b2aa3<_0x1bab23[_0x81f2('0x41')];_0x3b2aa3+=0x1){_0x5d32c2=_0x1bab23[_0x3b2aa3]['toString']();logger[_0x81f2('0xa')]('index',_0x5d32c2);if(_0x399d18){logger[_0x81f2('0xa')](_0x81f2('0x46'),_0x399d18);logger[_0x81f2('0xa')](JSON[_0x81f2('0x21')](_0xd1fadb[_0x5d32c2]));BPromise[_0x81f2('0x47')]()[_0x81f2('0x36')](handleJob(_0xd1fadb[_0x5d32c2]));logger[_0x81f2('0xa')](_0x81f2('0x48'),_0xd1fadb[_0x5d32c2]['name'],_0xd1fadb[_0x5d32c2]['cron']);}else if(_0xd1fadb[_0x5d32c2][_0x81f2('0x49')]&&_0xd1fadb[_0x5d32c2]['active']&&moment()[_0x81f2('0x4a')](_0xd1fadb[_0x5d32c2][_0x81f2('0x4b')],_0xd1fadb[_0x5d32c2][_0x81f2('0x4c')])){manager[_0x81f2('0x4d')](_0x5d32c2,_0xd1fadb[_0x5d32c2][_0x81f2('0x49')],handleJob(_0xd1fadb[_0x5d32c2]));manager[_0x81f2('0x4e')](_0x5d32c2);logger[_0x81f2('0xa')](_0x81f2('0x4f'),_0xd1fadb[_0x5d32c2][_0x81f2('0x10')],_0xd1fadb[_0x5d32c2][_0x81f2('0x49')]);}else if(manager[_0x81f2('0x42')](_0x5d32c2)){manager[_0x81f2('0x43')](_0x5d32c2);manager[_0x81f2('0x44')](_0x5d32c2);logger['info'](_0x81f2('0x50'),_0xd1fadb[_0x5d32c2][_0x81f2('0x10')],_0xd1fadb[_0x5d32c2][_0x81f2('0x49')]);}}for(_0x3b2aa3=0x0,_0x5d32c2;_0x3b2aa3<_0x43f3a9['length']&&!_0x399d18;_0x3b2aa3+=0x1){_0x5d32c2=_0x43f3a9[_0x3b2aa3]['toString']();if(manager[_0x81f2('0x42')](_0x5d32c2)){if(_0xd1fadb[_0x5d32c2]['cron']&&_0xd1fadb[_0x5d32c2]['active']&&moment()[_0x81f2('0x4a')](_0xd1fadb[_0x5d32c2][_0x81f2('0x4b')],_0xd1fadb[_0x5d32c2][_0x81f2('0x4c')])){manager[_0x81f2('0x51')](_0x5d32c2,_0xd1fadb[_0x5d32c2][_0x81f2('0x49')],handleJob(_0xd1fadb[_0x5d32c2]));logger[_0x81f2('0xa')](_0x81f2('0x52'),_0xd1fadb[_0x5d32c2]['name'],_0xd1fadb[_0x5d32c2][_0x81f2('0x49')]);}else{manager[_0x81f2('0x43')](_0x5d32c2);manager[_0x81f2('0x44')](_0x5d32c2);logger[_0x81f2('0xa')](_0x81f2('0x50'),_0xd1fadb[_0x5d32c2][_0x81f2('0x10')],_0xd1fadb[_0x5d32c2][_0x81f2('0x49')]);}}}})[_0x81f2('0x2a')](function(_0x363477){logger[_0x81f2('0x28')](JSON[_0x81f2('0x21')](_0x363477));});}exports[_0x81f2('0x53')]=function(_0x4af818){return getJobs(_0x4af818);};exports[_0x81f2('0x4e')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x0f82=['user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','message','attachments','stringify','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','deleteJob','toRun','my\x20id','run\x20job','cron','isBetween','start','add\x20cron','stop','stop\x20cron','startAt','endAt','update','update\x20cron','run','util','path','lodash','cron-job-manager','jayson/promise','bluebird','../logger','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'];(function(_0x1850d5,_0x3b49bb){var _0x481479=function(_0x5a4823){while(--_0x5a4823){_0x1850d5['push'](_0x1850d5['shift']());}};_0x481479(++_0x3b49bb);}(_0x0f82,0x9b));var _0x20f8=function(_0x3af4ba,_0x22b29e){_0x3af4ba=_0x3af4ba-0x0;var _0x44a185=_0x0f82[_0x3af4ba];return _0x44a185;};'use strict';var fs=require('fs');var util=require(_0x20f8('0x0'));var path=require(_0x20f8('0x1'));var _=require(_0x20f8('0x2'));var moment=require('moment');var CronJobManager=require(_0x20f8('0x3'));var jayson=require(_0x20f8('0x4'));var BPromise=require(_0x20f8('0x5'));var logger=require(_0x20f8('0x6'))(_0x20f8('0x7'));var db=require(_0x20f8('0x8'))['db'];var analyticCustomReportController=require(_0x20f8('0x9'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x20f8('0xa')][_0x20f8('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x56e4b4,_0x689849){return function(){logger[_0x20f8('0xc')](_0x20f8('0xd'),_0x56e4b4[_0x20f8('0xe')]);var _0x3d4c7f=!![];var _0x26a7c5=_0x56e4b4[_0x20f8('0xf')][_0x20f8('0x10')]();var _0x15fdc7={'account':_0x26a7c5,'message':{'from':util[_0x20f8('0x11')](_0x20f8('0x12'),_0x56e4b4[_0x20f8('0xf')][_0x20f8('0x13')],_0x56e4b4['MailAccount']['email']||_0x56e4b4['MailAccount'][_0x20f8('0x14')][_0x20f8('0x15')]),'to':_0x56e4b4['email'],'cc':_0x56e4b4['cc'],'bcc':_0x56e4b4[_0x20f8('0x16')],'subject':util[_0x20f8('0x11')](_0x20f8('0x17'),_0x689849['name'],_0x56e4b4[_0x20f8('0x18')],_0x56e4b4[_0x20f8('0x19')])}};var _0x1d4ab2=path[_0x20f8('0x1a')](__dirname,_0x20f8('0x1b'));var _0x52d80c=_0x689849[_0x20f8('0x1c')];var _0x1e0cd3=util[_0x20f8('0x11')](_0x20f8('0x1d'),path[_0x20f8('0x1e')](_0x689849[_0x20f8('0x1c')],path[_0x20f8('0x1f')](_0x689849[_0x20f8('0x1c')])),_0x20f8('0x20'));var _0x668b9b=path[_0x20f8('0x1a')](_0x1d4ab2,_0x52d80c);var _0x27b362=path[_0x20f8('0x1a')](_0x1d4ab2,_0x1e0cd3);if(fs[_0x20f8('0x21')](_0x668b9b)){_0x689849[_0x20f8('0x22')]='Sent';_0x15fdc7[_0x20f8('0x23')][_0x20f8('0x24')]=[{'filename':_0x52d80c,'path':_0x668b9b}];_0x15fdc7[_0x20f8('0x23')]['text']=util[_0x20f8('0x11')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x20f8('0x25')](_0x689849,null,0x2));}else if(fs[_0x20f8('0x21')](_0x27b362)){_0x689849[_0x20f8('0x22')]=_0x20f8('0x26');_0x15fdc7[_0x20f8('0x23')]['attachments']=[{'filename':_0x1e0cd3,'path':_0x27b362}];}else{_0x15fdc7[_0x20f8('0x23')]['text']=_0x20f8('0x27');if(!_0x56e4b4['sendIfEmpty']){_0x3d4c7f=![];logger['info'](_0x20f8('0x28'));}}if(_0x3d4c7f){return client[_0x20f8('0x29')](_0x20f8('0x2a'),_0x15fdc7)[_0x20f8('0x2b')](function(_0x38494a){if(_0x38494a['error']){return logger[_0x20f8('0x2c')](_0x20f8('0x2d'),JSON['stringify'](_0x38494a));}return logger['info']('email\x20sent');})[_0x20f8('0x2e')](function(_0x345cd3){return logger[_0x20f8('0x2c')](_0x20f8('0x2d'),JSON[_0x20f8('0x25')](_0x345cd3));});}};}function handleError(){return function(_0x427e6f){return logger[_0x20f8('0x2c')](JSON[_0x20f8('0x25')](_0x427e6f));};}function handleResult(_0x58303b){return function(_0x4bdeb8){logger[_0x20f8('0xc')](_0x20f8('0x2f'),JSON[_0x20f8('0x25')](_0x4bdeb8));if(_0x58303b[_0x20f8('0xf')]&&_0x58303b[_0x20f8('0xf')][_0x20f8('0x14')]&&!_[_0x20f8('0x30')](_0x58303b[_0x20f8('0xe')])){setTimeout(handleSendEmail(_0x58303b,_0x4bdeb8),0x3c*0x3e8);}};}function handleJob(_0x44e2e8){return function(){try{if(_[_0x20f8('0x30')](_0x44e2e8[_0x20f8('0x18')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x44e2e8['subtractUnit'])){return logger['info'](_0x20f8('0x31'));}var _0x1bfffb={'startDate':moment()[_0x20f8('0x32')](_0x44e2e8['subtractNumber'],_0x44e2e8[_0x20f8('0x19')])[_0x20f8('0x11')](_0x20f8('0x33')),'endDate':moment()[_0x20f8('0x11')](_0x20f8('0x33')),'type':_0x20f8('0x34'),'output':_0x44e2e8[_0x20f8('0x35')],'name':_0x44e2e8['name']};if(!_[_0x20f8('0x30')](_0x44e2e8['DefaultReportId'])){logger[_0x20f8('0xc')](_0x20f8('0x36'),_0x44e2e8[_0x20f8('0x37')]);return analyticDefaultReportController[_0x20f8('0x38')]({'id':_0x44e2e8[_0x20f8('0x37')]},_0x1bfffb)['then'](handleResult(_0x44e2e8))[_0x20f8('0x2e')](handleError());}if(!_[_0x20f8('0x30')](_0x44e2e8[_0x20f8('0x39')])){logger[_0x20f8('0xc')](_0x20f8('0x3a'),_0x44e2e8[_0x20f8('0x39')]);return analyticCustomReportController[_0x20f8('0x38')]({'id':_0x44e2e8[_0x20f8('0x39')]},_0x1bfffb)[_0x20f8('0x2b')](handleResult(_0x44e2e8))[_0x20f8('0x2e')](handleError());}}catch(_0x1951e9){logger['error'](JSON['stringify'](_0x1951e9));}return logger[_0x20f8('0xc')](_0x20f8('0x3b'));};}function getJobs(_0x2f64e7){var _0x1e89e0={};if(_0x2f64e7){_0x1e89e0['id']=_0x2f64e7;}return db[_0x20f8('0x3c')][_0x20f8('0x3d')]({'where':_0x1e89e0,'include':[{'model':db['MailAccount'],'attributes':['id',_0x20f8('0x13'),_0x20f8('0xe')],'include':[{'model':db[_0x20f8('0x3e')],'as':_0x20f8('0x14'),'include':[{'model':db[_0x20f8('0x3f')],'as':_0x20f8('0x3f')}]}]}]})[_0x20f8('0x2b')](function(_0x3d1320){var _0x377949=_[_0x20f8('0x40')](manager[_0x20f8('0x41')]);var _0x1689f=_[_0x20f8('0x42')](_0x3d1320,function(_0x1d7f73){return _0x1d7f73['id'][_0x20f8('0x43')]();});var _0x3aae0a=_[_0x20f8('0x44')](_0x3d1320,function(_0x1a686e){return _0x1a686e['id'][_0x20f8('0x43')]();});var _0x4c760f=_0x2f64e7?_0x1689f:_[_0x20f8('0x45')](_0x1689f,_0x377949);var _0x101858=_[_0x20f8('0x46')](_0x1689f,_0x377949);var _0x287268=_[_0x20f8('0x45')](_0x377949,_0x1689f);var _0x32866f;var _0x14e73a;for(_0x32866f=0x0;_0x32866f<_0x287268[_0x20f8('0x47')]&&!_0x2f64e7;_0x32866f+=0x1){_0x14e73a=_0x287268[_0x32866f][_0x20f8('0x43')]();if(manager[_0x20f8('0x48')](_0x14e73a)){manager['stop'](_0x14e73a);manager[_0x20f8('0x49')](_0x14e73a);logger[_0x20f8('0xc')]('delete\x20cron',_0x14e73a);}}logger['info'](_0x20f8('0x4a'),JSON[_0x20f8('0x25')](_0x4c760f));for(_0x32866f=0x0;_0x32866f<_0x4c760f[_0x20f8('0x47')];_0x32866f+=0x1){_0x14e73a=_0x4c760f[_0x32866f][_0x20f8('0x43')]();logger[_0x20f8('0xc')]('index',_0x14e73a);if(_0x2f64e7){logger[_0x20f8('0xc')](_0x20f8('0x4b'),_0x2f64e7);logger['info'](JSON[_0x20f8('0x25')](_0x3aae0a[_0x14e73a]));BPromise['resolve']()[_0x20f8('0x2b')](handleJob(_0x3aae0a[_0x14e73a]));logger['info'](_0x20f8('0x4c'),_0x3aae0a[_0x14e73a]['name'],_0x3aae0a[_0x14e73a][_0x20f8('0x4d')]);}else if(_0x3aae0a[_0x14e73a][_0x20f8('0x4d')]&&_0x3aae0a[_0x14e73a]['active']&&moment()[_0x20f8('0x4e')](_0x3aae0a[_0x14e73a]['startAt'],_0x3aae0a[_0x14e73a]['endAt'])){manager['add'](_0x14e73a,_0x3aae0a[_0x14e73a][_0x20f8('0x4d')],handleJob(_0x3aae0a[_0x14e73a]));manager[_0x20f8('0x4f')](_0x14e73a);logger[_0x20f8('0xc')](_0x20f8('0x50'),_0x3aae0a[_0x14e73a][_0x20f8('0x13')],_0x3aae0a[_0x14e73a][_0x20f8('0x4d')]);}else if(manager[_0x20f8('0x48')](_0x14e73a)){manager[_0x20f8('0x51')](_0x14e73a);manager['deleteJob'](_0x14e73a);logger[_0x20f8('0xc')](_0x20f8('0x52'),_0x3aae0a[_0x14e73a][_0x20f8('0x13')],_0x3aae0a[_0x14e73a][_0x20f8('0x4d')]);}}for(_0x32866f=0x0,_0x14e73a;_0x32866f<_0x101858[_0x20f8('0x47')]&&!_0x2f64e7;_0x32866f+=0x1){_0x14e73a=_0x101858[_0x32866f]['toString']();if(manager[_0x20f8('0x48')](_0x14e73a)){if(_0x3aae0a[_0x14e73a][_0x20f8('0x4d')]&&_0x3aae0a[_0x14e73a]['active']&&moment()[_0x20f8('0x4e')](_0x3aae0a[_0x14e73a][_0x20f8('0x53')],_0x3aae0a[_0x14e73a][_0x20f8('0x54')])){manager[_0x20f8('0x55')](_0x14e73a,_0x3aae0a[_0x14e73a][_0x20f8('0x4d')],handleJob(_0x3aae0a[_0x14e73a]));logger['info'](_0x20f8('0x56'),_0x3aae0a[_0x14e73a][_0x20f8('0x13')],_0x3aae0a[_0x14e73a][_0x20f8('0x4d')]);}else{manager[_0x20f8('0x51')](_0x14e73a);manager[_0x20f8('0x49')](_0x14e73a);logger[_0x20f8('0xc')](_0x20f8('0x52'),_0x3aae0a[_0x14e73a][_0x20f8('0x13')],_0x3aae0a[_0x14e73a]['cron']);}}}})[_0x20f8('0x2e')](function(_0x67923){logger[_0x20f8('0x2c')](JSON[_0x20f8('0x25')](_0x67923));});}exports[_0x20f8('0x57')]=function(_0x456a92){return getJobs(_0x456a92);};exports[_0x20f8('0x4f')]=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 2144716..f68713e 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 _0x915a=['Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20configured','update','Mixed','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','push','all','start','lodash','aws-sdk','request-promise','util','bluebird','../../config/logger','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','sentiment','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve'];(function(_0x22d1b9,_0x5c2aac){var _0x23126e=function(_0x3a6cfe){while(--_0x3a6cfe){_0x22d1b9['push'](_0x22d1b9['shift']());}};_0x23126e(++_0x5c2aac);}(_0x915a,0x1d2));var _0xa915=function(_0x44e377,_0x44d89f){_0x44e377=_0x44e377-0x0;var _0x58a854=_0x915a[_0x44e377];return _0x58a854;};var _=require(_0xa915('0x0'));var AWS=require(_0xa915('0x1'));var rp=require(_0xa915('0x2'));var util=require(_0xa915('0x3'));var BPromise=require(_0xa915('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0xa915('0x5'))('transcribe');function getTranscriptionJob(_0x59bc2b,_0x1106ee,_0x422023,_0xf654ba){return new Promise(function(_0xb6900c,_0x1ed01d){var _0x3f5e00=new AWS['TranscribeService']({'accessKeyId':_0x1106ee,'secretAccessKey':_0x59bc2b,'region':_0x422023});_0x3f5e00['getTranscriptionJob']({'TranscriptionJobName':_0xf654ba},function(_0x3f5b1b,_0x43bfc9){if(_0x3f5b1b){return _0x1ed01d(_0x3f5b1b);}else{return _0xb6900c(_0x43bfc9);}});});}function sentiment(_0x173267,_0x450ff2,_0x5cfcec,_0x549502,_0x17efe8){return new Promise(function(_0x5d38c9,_0x2cdc8b){var _0x47a886=new AWS[(_0xa915('0x6'))]({'accessKeyId':_0x450ff2,'secretAccessKey':_0x173267,'region':_0x5cfcec});_0x47a886[_0xa915('0x7')]({'Text':_0x549502,'LanguageCode':_0x17efe8[_0xa915('0x8')](0x0,0x2)},function(_0x152286,_0x523c96){if(_0x152286){return _0x2cdc8b(_0x152286);}else{return _0x5d38c9(_0x523c96);}});});}function checkTranscribeJob(_0x54facc,_0x3edd93,_0x5d7c09){var _0x274f4d;return new BPromise(function(_0x563972,_0xb897e2){logger[_0xa915('0x9')](util[_0xa915('0xa')](_0xa915('0xb'),_0x54facc['id'],_0x54facc[_0xa915('0xc')]));return getTranscriptionJob(_0x5d7c09[_0xa915('0xd')],_0x5d7c09['data2'],_0x3edd93[_0xa915('0xe')],_0x54facc[_0xa915('0xc')])[_0xa915('0xf')](function(_0x590be6){logger[_0xa915('0x9')](util[_0xa915('0xa')](_0xa915('0x10'),_0x54facc['id'],_0x54facc[_0xa915('0xc')],_0x590be6[_0xa915('0x11')][_0xa915('0x12')]));if(!_0x54facc[_0xa915('0x13')]){switch(_0x590be6[_0xa915('0x11')][_0xa915('0x12')]){case _0xa915('0x14'):var _0xb0d073={'transcribeStatus':_0x590be6['TranscriptionJob'][_0xa915('0x12')],'fileUri':_0x590be6['TranscriptionJob'][_0xa915('0x15')][_0xa915('0x16')]};logger[_0xa915('0x9')](util[_0xa915('0xa')](_0xa915('0x17'),_0x54facc['id']));return rp({'uri':_0x590be6['TranscriptionJob'][_0xa915('0x15')][_0xa915('0x16')],'json':!![]})[_0xa915('0xf')](function(_0x3d94d1){logger[_0xa915('0x9')](util[_0xa915('0xa')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x54facc['id']));if(_0x3d94d1&&_0x3d94d1[_0xa915('0x18')]&&_0x3d94d1[_0xa915('0x18')][_0xa915('0x19')]&&_0x3d94d1[_0xa915('0x18')]['transcripts']['length']){_0xb0d073[_0xa915('0x13')]='';for(var _0x58eb14=0x0;_0x58eb14<_0x3d94d1[_0xa915('0x18')][_0xa915('0x19')][_0xa915('0x1a')];_0x58eb14++){_0xb0d073[_0xa915('0x13')]+=_0x3d94d1[_0xa915('0x18')][_0xa915('0x19')][_0x58eb14][_0xa915('0x1b')]+'';}}return _0x54facc['update'](_0xb0d073);})[_0xa915('0xf')](function(){logger[_0xa915('0x9')](util['format'](_0xa915('0x1c'),_0x54facc['id']));if(!_0x54facc[_0xa915('0x1d')]){throw new db[(_0xa915('0x1e'))][(_0xa915('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x3edd93[_0xa915('0x20')]||!_0x3edd93[_0xa915('0x21')]||!_0x3edd93['sentimentRegion']||!_0x3edd93[_0xa915('0x22')]||!_0x3edd93[_0xa915('0x23')]){throw new db[(_0xa915('0x1e'))][(_0xa915('0x1f'))](_0xa915('0x24'));}if(!_0xb0d073[_0xa915('0x13')]){throw new Error('Transcript\x20not\x20available');}if(_0x3edd93[_0xa915('0x21')]===_0x5d7c09['id']){return _0x5d7c09;}else{return db[_0xa915('0x25')][_0xa915('0x26')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xa915('0xf')](function(_0x31b8b7){if(!_0x31b8b7){throw new db[(_0xa915('0x1e'))]['ValidationError'](_0xa915('0x27'));}if(!_0x31b8b7[_0xa915('0xd')]||!_0x31b8b7[_0xa915('0x28')]){throw new db[(_0xa915('0x1e'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x274f4d=_0x31b8b7;logger[_0xa915('0x9')](util[_0xa915('0xa')](_0xa915('0x29'),_0x54facc['id']));return sentiment(_0x274f4d['data1'],_0x274f4d[_0xa915('0x28')],_0x3edd93['sentimentRegion'],_0xb0d073[_0xa915('0x13')],_0x3edd93[_0xa915('0x22')]);})[_0xa915('0xf')](function(_0x2c738a){logger[_0xa915('0x9')](util[_0xa915('0xa')](_0xa915('0x2a'),_0x54facc['id']));return _0x54facc['update']({'sentiment':_0x2c738a[_0xa915('0x2b')],'sPositive':_0x2c738a[_0xa915('0x2c')][_0xa915('0x2d')],'sNegative':_0x2c738a[_0xa915('0x2c')][_0xa915('0x2e')],'sMixed':_0x2c738a[_0xa915('0x2c')]['Mixed'],'sNeutral':_0x2c738a[_0xa915('0x2c')][_0xa915('0x2f')]});})[_0xa915('0xf')](function(){logger[_0xa915('0x9')](util[_0xa915('0xa')](_0xa915('0x1c'),_0x54facc['id']));_0x563972();});case _0xa915('0x30'):return _0x54facc['update']({'transcribeStatus':'FAILED','failureReason':_0x590be6['TranscriptionJob'][_0xa915('0x31')]})[_0xa915('0xf')](function(){logger[_0xa915('0x9')](util[_0xa915('0xa')](_0xa915('0x1c'),_0x54facc['id']));_0x563972();});default:logger[_0xa915('0x9')](util[_0xa915('0xa')](_0xa915('0x32'),_0x54facc['id']));break;}}else{return BPromise[_0xa915('0x33')]()[_0xa915('0xf')](function(){if(!_0x54facc[_0xa915('0x1d')]){throw new db[(_0xa915('0x1e'))][(_0xa915('0x1f'))](_0xa915('0x34'));}if(!_0x3edd93[_0xa915('0x20')]||!_0x3edd93['sentimentAccountId']||!_0x3edd93[_0xa915('0x35')]||!_0x3edd93[_0xa915('0x22')]||!_0x3edd93[_0xa915('0x23')]){throw new db[(_0xa915('0x1e'))][(_0xa915('0x1f'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x54facc[_0xa915('0x13')]){throw new Error(_0xa915('0x36'));}if(_0x3edd93[_0xa915('0x21')]===_0x5d7c09['id']){return _0x5d7c09;}else{return db[_0xa915('0x25')]['findOne']({'where':{'id':_settings[_0xa915('0x21')]}});}})[_0xa915('0xf')](function(_0x389719){if(!_0x389719){throw new db[(_0xa915('0x1e'))][(_0xa915('0x1f'))](_0xa915('0x27'));}if(!_0x389719[_0xa915('0xd')]||!_0x389719[_0xa915('0x28')]){throw new db['Sequelize'][(_0xa915('0x1f'))](_0xa915('0x37'));}_0x274f4d=_0x389719;logger[_0xa915('0x9')](util[_0xa915('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x54facc['id']));return sentiment(_0x274f4d[_0xa915('0xd')],_0x274f4d['data2'],_0x3edd93[_0xa915('0x35')],_0x54facc[_0xa915('0x13')],_0x3edd93['language']);})[_0xa915('0xf')](function(_0x50fb06){logger['info'](util[_0xa915('0xa')](_0xa915('0x2a'),_0x54facc['id']));return _0x54facc[_0xa915('0x38')]({'sentiment':_0x50fb06[_0xa915('0x2b')],'sPositive':_0x50fb06[_0xa915('0x2c')][_0xa915('0x2d')],'sNegative':_0x50fb06['SentimentScore'][_0xa915('0x2e')],'sMixed':_0x50fb06[_0xa915('0x2c')][_0xa915('0x39')],'sNeutral':_0x50fb06[_0xa915('0x2c')][_0xa915('0x2f')],'transcribeStatus':_0xa915('0x14')});})[_0xa915('0xf')](function(){logger[_0xa915('0x9')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x54facc['id']));_0x563972();});}})[_0xa915('0x3a')](function(_0x3d9461){if(_0x3d9461){if(!_0x3d9461[_0xa915('0x3b')]||_0x3d9461[_0xa915('0x3b')]!==_0xa915('0x3c')){logger[_0xa915('0x3d')](util['format'](_0xa915('0x3e'),_0x54facc['id']),util[_0xa915('0x3f')](_0x3d9461,{'showHidden':![],'depth':null}));}}_0x563972();});});}function checkTranscribe(){var _0x1c9bbd;var _0xb1526e;var _0x285313;return db[_0xa915('0x40')][_0xa915('0x41')]({'where':{'transcribeStatus':_0xa915('0x42')}})['then'](function(_0x367e6f){if(!_0x367e6f||!_0x367e6f[_0xa915('0x1a')]){throw new db[(_0xa915('0x1e'))][(_0xa915('0x1f'))](_0xa915('0x43'));}_0x1c9bbd=_0x367e6f;return db[_0xa915('0x44')][_0xa915('0x26')]({'where':{'id':0x1}});})[_0xa915('0xf')](function(_0x2a8f00){if(!_0x2a8f00){throw new db[(_0xa915('0x1e'))]['ValidationError']('Settings\x20not\x20available');}_0xb1526e=_0x2a8f00;if(!_0xb1526e['transcribe']||!_0xb1526e[_0xa915('0x45')]||!_0xb1526e[_0xa915('0xe')]||!_0xb1526e[_0xa915('0x22')]||!_0xb1526e[_0xa915('0x23')]){throw new db['Sequelize'][(_0xa915('0x1f'))](_0xa915('0x46'));}return db[_0xa915('0x25')][_0xa915('0x26')]({'where':{'id':_0xb1526e[_0xa915('0x45')]}});})[_0xa915('0xf')](function(_0x1fb931){if(!_0x1fb931){throw new db['Sequelize'][(_0xa915('0x1f'))](_0xa915('0x27'));}if(!_0x1fb931[_0xa915('0xd')]||!_0x1fb931[_0xa915('0x28')]){throw new db[(_0xa915('0x1e'))]['ValidationError'](_0xa915('0x37'));}_0x285313=_0x1fb931;var _0x5d15ba=[];_0x1c9bbd['forEach'](function(_0x4c6f0d){_0x5d15ba[_0xa915('0x47')](checkTranscribeJob(_0x4c6f0d,_0xb1526e,_0x285313));});return BPromise[_0xa915('0x48')](_0x5d15ba);})[_0xa915('0x3a')](function(_0x34f13b){if(_0x34f13b){if(!_0x34f13b['name']||_0x34f13b[_0xa915('0x3b')]!==_0xa915('0x3c')){logger[_0xa915('0x3d')](util[_0xa915('0x3f')](_0x34f13b,{'showHidden':![],'depth':null}));}}});}exports[_0xa915('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x85f8=['Transcribe\x20not\x20configured','forEach','error','inspect','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','fileText','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Neutral','FAILED','resolve','sentiment','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Positive','Negative','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','findAll','IN_PROGRESS','transcribeAccountId'];(function(_0x58d568,_0x160d58){var _0x37a056=function(_0x47c2f6){while(--_0x47c2f6){_0x58d568['push'](_0x58d568['shift']());}};_0x37a056(++_0x160d58);}(_0x85f8,0xd7));var _0x885f=function(_0x2698c2,_0x220e63){_0x2698c2=_0x2698c2-0x0;var _0x4f6a44=_0x85f8[_0x2698c2];return _0x4f6a44;};var _=require(_0x885f('0x0'));var AWS=require(_0x885f('0x1'));var rp=require(_0x885f('0x2'));var util=require(_0x885f('0x3'));var BPromise=require(_0x885f('0x4'));var db=require(_0x885f('0x5'))['db'];var logger=require(_0x885f('0x6'))(_0x885f('0x7'));function getTranscriptionJob(_0x48a882,_0x315de4,_0x42dc60,_0x135a23){return new Promise(function(_0x52404d,_0x3800c6){var _0x270c84=new AWS[(_0x885f('0x8'))]({'accessKeyId':_0x315de4,'secretAccessKey':_0x48a882,'region':_0x42dc60});_0x270c84[_0x885f('0x9')]({'TranscriptionJobName':_0x135a23},function(_0x35e2be,_0x188593){if(_0x35e2be){return _0x3800c6(_0x35e2be);}else{return _0x52404d(_0x188593);}});});}function sentiment(_0x9c0173,_0x34eae5,_0xece628,_0x646478,_0x8186f1){return new Promise(function(_0x2309c7,_0x329097){var _0x10b6e4=new AWS['Comprehend']({'accessKeyId':_0x34eae5,'secretAccessKey':_0x9c0173,'region':_0xece628});_0x10b6e4[_0x885f('0xa')]({'Text':_0x646478,'LanguageCode':_0x8186f1[_0x885f('0xb')](0x0,0x2)},function(_0x703f50,_0x415a7e){if(_0x703f50){return _0x329097(_0x703f50);}else{return _0x2309c7(_0x415a7e);}});});}function checkTranscribeJob(_0x4e657c,_0x49000e,_0x5c117b){var _0x3608ac;return new BPromise(function(_0x1c2f90,_0x2a6d54){logger['info'](util[_0x885f('0xc')](_0x885f('0xd'),_0x4e657c['id'],_0x4e657c[_0x885f('0xe')]));return getTranscriptionJob(_0x5c117b[_0x885f('0xf')],_0x5c117b[_0x885f('0x10')],_0x49000e[_0x885f('0x11')],_0x4e657c[_0x885f('0xe')])['then'](function(_0x3d9ba8){logger[_0x885f('0x12')](util[_0x885f('0xc')](_0x885f('0x13'),_0x4e657c['id'],_0x4e657c[_0x885f('0xe')],_0x3d9ba8[_0x885f('0x14')][_0x885f('0x15')]));if(!_0x4e657c['fileText']){switch(_0x3d9ba8[_0x885f('0x14')]['TranscriptionJobStatus']){case _0x885f('0x16'):var _0x2dd552={'transcribeStatus':_0x3d9ba8[_0x885f('0x14')]['TranscriptionJobStatus'],'fileUri':_0x3d9ba8['TranscriptionJob'][_0x885f('0x17')][_0x885f('0x18')]};logger['info'](util[_0x885f('0xc')](_0x885f('0x19'),_0x4e657c['id']));return rp({'uri':_0x3d9ba8[_0x885f('0x14')]['Transcript'][_0x885f('0x18')],'json':!![]})[_0x885f('0x1a')](function(_0x53cd9f){logger[_0x885f('0x12')](util[_0x885f('0xc')](_0x885f('0x1b'),_0x4e657c['id']));if(_0x53cd9f&&_0x53cd9f[_0x885f('0x1c')]&&_0x53cd9f[_0x885f('0x1c')]['transcripts']&&_0x53cd9f[_0x885f('0x1c')]['transcripts'][_0x885f('0x1d')]){_0x2dd552[_0x885f('0x1e')]='';for(var _0x59da94=0x0;_0x59da94<_0x53cd9f[_0x885f('0x1c')]['transcripts']['length'];_0x59da94++){_0x2dd552[_0x885f('0x1e')]+=_0x53cd9f[_0x885f('0x1c')][_0x885f('0x1f')][_0x59da94][_0x885f('0x20')]+'';}}return _0x4e657c[_0x885f('0x21')](_0x2dd552);})[_0x885f('0x1a')](function(){logger['info'](util[_0x885f('0xc')](_0x885f('0x22'),_0x4e657c['id']));if(!_0x4e657c['tempSentiment']){throw new db[(_0x885f('0x23'))][(_0x885f('0x24'))](_0x885f('0x25'));}if(!_0x49000e['sentiment']||!_0x49000e[_0x885f('0x26')]||!_0x49000e[_0x885f('0x27')]||!_0x49000e[_0x885f('0x28')]||!_0x49000e[_0x885f('0x29')]){throw new db[(_0x885f('0x23'))][(_0x885f('0x24'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2dd552[_0x885f('0x1e')]){throw new Error(_0x885f('0x2a'));}if(_0x49000e[_0x885f('0x26')]===_0x5c117b['id']){return _0x5c117b;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0x885f('0x26')]}});}})[_0x885f('0x1a')](function(_0x3e6493){if(!_0x3e6493){throw new db[(_0x885f('0x23'))][(_0x885f('0x24'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3e6493['data1']||!_0x3e6493['data2']){throw new db['Sequelize'][(_0x885f('0x24'))](_0x885f('0x2b'));}_0x3608ac=_0x3e6493;logger[_0x885f('0x12')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4e657c['id']));return sentiment(_0x3608ac[_0x885f('0xf')],_0x3608ac[_0x885f('0x10')],_0x49000e[_0x885f('0x27')],_0x2dd552[_0x885f('0x1e')],_0x49000e[_0x885f('0x28')]);})[_0x885f('0x1a')](function(_0xf41700){logger[_0x885f('0x12')](util[_0x885f('0xc')](_0x885f('0x2c'),_0x4e657c['id']));return _0x4e657c[_0x885f('0x21')]({'sentiment':_0xf41700[_0x885f('0x2d')],'sPositive':_0xf41700['SentimentScore']['Positive'],'sNegative':_0xf41700[_0x885f('0x2e')]['Negative'],'sMixed':_0xf41700[_0x885f('0x2e')]['Mixed'],'sNeutral':_0xf41700['SentimentScore'][_0x885f('0x2f')]});})['then'](function(){logger[_0x885f('0x12')](util[_0x885f('0xc')](_0x885f('0x22'),_0x4e657c['id']));_0x1c2f90();});case _0x885f('0x30'):return _0x4e657c['update']({'transcribeStatus':_0x885f('0x30'),'failureReason':_0x3d9ba8[_0x885f('0x14')]['FailureReason']})[_0x885f('0x1a')](function(){logger[_0x885f('0x12')](util[_0x885f('0xc')](_0x885f('0x22'),_0x4e657c['id']));_0x1c2f90();});default:logger[_0x885f('0x12')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x4e657c['id']));break;}}else{return BPromise[_0x885f('0x31')]()['then'](function(){if(!_0x4e657c['tempSentiment']){throw new db[(_0x885f('0x23'))][(_0x885f('0x24'))](_0x885f('0x25'));}if(!_0x49000e[_0x885f('0x32')]||!_0x49000e[_0x885f('0x26')]||!_0x49000e[_0x885f('0x27')]||!_0x49000e[_0x885f('0x28')]||!_0x49000e[_0x885f('0x29')]){throw new db[(_0x885f('0x23'))]['ValidationError'](_0x885f('0x33'));}if(!_0x4e657c[_0x885f('0x1e')]){throw new Error(_0x885f('0x2a'));}if(_0x49000e[_0x885f('0x26')]===_0x5c117b['id']){return _0x5c117b;}else{return db[_0x885f('0x34')][_0x885f('0x35')]({'where':{'id':_settings[_0x885f('0x26')]}});}})['then'](function(_0x289c94){if(!_0x289c94){throw new db[(_0x885f('0x23'))]['ValidationError'](_0x885f('0x36'));}if(!_0x289c94[_0x885f('0xf')]||!_0x289c94[_0x885f('0x10')]){throw new db['Sequelize'][(_0x885f('0x24'))](_0x885f('0x2b'));}_0x3608ac=_0x289c94;logger['info'](util[_0x885f('0xc')](_0x885f('0x37'),_0x4e657c['id']));return sentiment(_0x3608ac['data1'],_0x3608ac[_0x885f('0x10')],_0x49000e[_0x885f('0x27')],_0x4e657c[_0x885f('0x1e')],_0x49000e[_0x885f('0x28')]);})['then'](function(_0x38d746){logger[_0x885f('0x12')](util[_0x885f('0xc')](_0x885f('0x2c'),_0x4e657c['id']));return _0x4e657c['update']({'sentiment':_0x38d746['Sentiment'],'sPositive':_0x38d746[_0x885f('0x2e')][_0x885f('0x38')],'sNegative':_0x38d746[_0x885f('0x2e')][_0x885f('0x39')],'sMixed':_0x38d746['SentimentScore']['Mixed'],'sNeutral':_0x38d746[_0x885f('0x2e')][_0x885f('0x2f')],'transcribeStatus':_0x885f('0x16')});})[_0x885f('0x1a')](function(){logger[_0x885f('0x12')](util['format'](_0x885f('0x22'),_0x4e657c['id']));_0x1c2f90();});}})[_0x885f('0x3a')](function(_0x3827fa){if(_0x3827fa){if(!_0x3827fa[_0x885f('0x3b')]||_0x3827fa[_0x885f('0x3b')]!==_0x885f('0x3c')){logger['error'](util[_0x885f('0xc')](_0x885f('0x3d'),_0x4e657c['id']),util['inspect'](_0x3827fa,{'showHidden':![],'depth':null}));}}_0x1c2f90();});});}function checkTranscribe(){var _0x39745c;var _0x3c5a5b;var _0x5123c9;return db['VoiceRecording'][_0x885f('0x3e')]({'where':{'transcribeStatus':_0x885f('0x3f')}})['then'](function(_0x30f5a8){if(!_0x30f5a8||!_0x30f5a8[_0x885f('0x1d')]){throw new db['Sequelize'][(_0x885f('0x24'))]('No\x20transcribe\x20job\x20to\x20check');}_0x39745c=_0x30f5a8;return db['Setting']['findOne']({'where':{'id':0x1}});})['then'](function(_0x4c3d54){if(!_0x4c3d54){throw new db[(_0x885f('0x23'))][(_0x885f('0x24'))]('Settings\x20not\x20available');}_0x3c5a5b=_0x4c3d54;if(!_0x3c5a5b[_0x885f('0x7')]||!_0x3c5a5b[_0x885f('0x40')]||!_0x3c5a5b[_0x885f('0x11')]||!_0x3c5a5b['language']||!_0x3c5a5b[_0x885f('0x29')]){throw new db[(_0x885f('0x23'))][(_0x885f('0x24'))](_0x885f('0x41'));}return db['CloudProvider'][_0x885f('0x35')]({'where':{'id':_0x3c5a5b['transcribeAccountId']}});})['then'](function(_0x1bcf60){if(!_0x1bcf60){throw new db[(_0x885f('0x23'))]['ValidationError'](_0x885f('0x36'));}if(!_0x1bcf60['data1']||!_0x1bcf60[_0x885f('0x10')]){throw new db[(_0x885f('0x23'))][(_0x885f('0x24'))]('Cloud\x20Provider\x20not\x20configured');}_0x5123c9=_0x1bcf60;var _0xf84aca=[];_0x39745c[_0x885f('0x42')](function(_0x3e374c){_0xf84aca['push'](checkTranscribeJob(_0x3e374c,_0x3c5a5b,_0x5123c9));});return BPromise['all'](_0xf84aca);})[_0x885f('0x3a')](function(_0x523b65){if(_0x523b65){if(!_0x523b65[_0x885f('0x3b')]||_0x523b65[_0x885f('0x3b')]!=='SequelizeValidationError'){logger[_0x885f('0x43')](util[_0x885f('0x44')](_0x523b65,{'showHidden':![],'depth':null}));}}});}exports[_0x885f('0x45')]=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 c71035e..7cf2023 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 _0x6725=['[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','WhatsappInteraction','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error'];(function(_0x40771f,_0x2c8a4c){var _0xaad4d8=function(_0x52b44b){while(--_0x52b44b){_0x40771f['push'](_0x40771f['shift']());}};_0xaad4d8(++_0x2c8a4c);}(_0x6725,0x1e3));var _0x5672=function(_0x4e3798,_0x54b816){_0x4e3798=_0x4e3798-0x0;var _0x1f2648=_0x6725[_0x4e3798];return _0x1f2648;};'use strict';var _=require(_0x5672('0x0'));var moment=require(_0x5672('0x1'));var Redis=require('ioredis');var util=require(_0x5672('0x2'));var config=require(_0x5672('0x3'));var db=require(_0x5672('0x4'))['db'];var logger=require(_0x5672('0x5'))(_0x5672('0x6'));config[_0x5672('0x7')]=_[_0x5672('0x8')](config[_0x5672('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x5672('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x126d66=[];return db[_0x5672('0xa')]['findAll']({'raw':!![],'attributes':['id',_0x5672('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x5672('0xc')](0x18,_0x5672('0xd'))}}})[_0x5672('0xe')](function(_0x2b811e){if(_0x2b811e&&_0x2b811e[_0x5672('0xf')]){_0x126d66=_[_0x5672('0x10')](_0x2b811e||[],'id');logger[_0x5672('0x11')](_0x5672('0x12'),_0x126d66[_0x5672('0x13')]());return db[_0x5672('0xa')][_0x5672('0x14')]({'closeReason':_0x5672('0x15'),'disposition':_0x5672('0x16'),'closed':!![],'closedAt':moment()[_0x5672('0x17')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x126d66}});}})['then'](function(){if(_0x126d66&&_0x126d66[_0x5672('0xf')]){logger[_0x5672('0x11')](_0x5672('0x18'),_0x126d66[_0x5672('0x13')]());for(var _0x482dfb=0x0;_0x482dfb<_0x126d66[_0x5672('0xf')];_0x482dfb++){io[_0x5672('0x19')](_0x5672('0x1a'),{'id':_0x126d66[_0x482dfb],'closed':!![]});}}})[_0x5672('0x1b')](function(_0x7eeec7){logger[_0x5672('0x1c')](_0x5672('0x1d'),_0x7eeec7?util[_0x5672('0x1e')](_0x7eeec7,{'showHidden':![],'depth':null}):'');});}exports[_0x5672('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x9c9c=['WhatsappInteraction','lastMsgAt','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb','../logger','redis','defaults','socket.io-emitter'];(function(_0x3ea679,_0x2fa313){var _0xbe054b=function(_0xcd2434){while(--_0xcd2434){_0x3ea679['push'](_0x3ea679['shift']());}};_0xbe054b(++_0x2fa313);}(_0x9c9c,0x1e4));var _0xc9c9=function(_0x160182,_0x4cf21a){_0x160182=_0x160182-0x0;var _0x1c1e78=_0x9c9c[_0x160182];return _0x1c1e78;};'use strict';var _=require(_0xc9c9('0x0'));var moment=require(_0xc9c9('0x1'));var Redis=require(_0xc9c9('0x2'));var util=require(_0xc9c9('0x3'));var config=require('../../config/environment');var db=require(_0xc9c9('0x4'))['db'];var logger=require(_0xc9c9('0x5'))('schedule');config[_0xc9c9('0x6')]=_[_0xc9c9('0x7')](config[_0xc9c9('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xc9c9('0x8'))(new Redis(config[_0xc9c9('0x6')]));function closeInteractions(){var _0x20a169=[];return db[_0xc9c9('0x9')]['findAll']({'raw':!![],'attributes':['id',_0xc9c9('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xc9c9('0xb')](0x18,_0xc9c9('0xc'))}}})[_0xc9c9('0xd')](function(_0x45b5be){if(_0x45b5be&&_0x45b5be['length']){_0x20a169=_[_0xc9c9('0xe')](_0x45b5be||[],'id');logger[_0xc9c9('0xf')](_0xc9c9('0x10'),_0x20a169[_0xc9c9('0x11')]());return db[_0xc9c9('0x9')][_0xc9c9('0x12')]({'closeReason':_0xc9c9('0x13'),'disposition':_0xc9c9('0x14'),'closed':!![],'closedAt':moment()[_0xc9c9('0x15')](_0xc9c9('0x16'))},{'where':{'id':_0x20a169}});}})[_0xc9c9('0xd')](function(){if(_0x20a169&&_0x20a169['length']){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x20a169[_0xc9c9('0x11')]());for(var _0x3040c7=0x0;_0x3040c7<_0x20a169[_0xc9c9('0x17')];_0x3040c7++){io[_0xc9c9('0x18')]('whatsappInteraction:update',{'id':_0x20a169[_0x3040c7],'closed':!![]});}}})['catch'](function(_0xf9cff5){logger[_0xc9c9('0x19')](_0xc9c9('0x1a'),_0xf9cff5?util[_0xc9c9('0x1b')](_0xf9cff5,{'showHidden':![],'depth':null}):'');});}exports[_0xc9c9('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 e7c86de..86c9036 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64f8=['Biondo','innocenzo.biondo','@xcally.com','now','destroy','bulkCreate','finished\x20populating','contacts1','CmHopper','then','hopper1','CmContact','log','contacts2','push','Innocenzo'];(function(_0xe455e7,_0x29fb65){var _0xfc683e=function(_0x10ee38){while(--_0x10ee38){_0xe455e7['push'](_0xe455e7['shift']());}};_0xfc683e(++_0x29fb65);}(_0x64f8,0x16e));var _0x864f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x64f8[_0xa464c9];return _0x3d73c4;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x864f('0x0')]({'id':i,'firstName':_0x864f('0x1')+i,'lastName':_0x864f('0x2')+i,'phone':0xf879fb460+i,'email':_0x864f('0x3')+i+_0x864f('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x864f('0x0')]({'id':i,'active':![],'scheduledat':Date[_0x864f('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x864f('0x5')](),'updatedAt':Date[_0x864f('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x864f('0x1')+i,'lastName':_0x864f('0x2')+i,'phone':0xf879fb460+i,'email':_0x864f('0x3')+i+_0x864f('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x864f('0x0')]({'id':i,'active':![],'scheduledat':Date[_0x864f('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x864f('0x5')]()});}db['CmContact'][_0x864f('0x6')]({'where':{}})['then'](function(){return db['CmContact'][_0x864f('0x7')](contacts);})['then'](function(){console['log'](_0x864f('0x8'),_0x864f('0x9'));return db[_0x864f('0xa')][_0x864f('0x6')]({'where':{}});})['then'](function(){return db[_0x864f('0xa')]['bulkCreate'](hopper);})[_0x864f('0xb')](function(){console['log']('finished\x20populating',_0x864f('0xc'));return db[_0x864f('0xd')][_0x864f('0x7')](contacts2);})['then'](function(){console[_0x864f('0xe')](_0x864f('0x8'),_0x864f('0xf'));return db['CmHopper'][_0x864f('0x7')](hopper2);})[_0x864f('0xb')](function(){console[_0x864f('0xe')](_0x864f('0x8'),'hopper2');})['catch'](function(_0x3aa052){console[_0x864f('0xe')](_0x3aa052);}); \ No newline at end of file +var _0x321a=['then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','destroy','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact'];(function(_0x3f57f7,_0x3fcc14){var _0x47e390=function(_0x2fc6a6){while(--_0x2fc6a6){_0x3f57f7['push'](_0x3f57f7['shift']());}};_0x47e390(++_0x3fcc14);}(_0x321a,0x10f));var _0xa321=function(_0x47d54a,_0x1e96b5){_0x47d54a=_0x47d54a-0x0;var _0xe6da4b=_0x321a[_0x47d54a];return _0xe6da4b;};'use strict';var util=require(_0xa321('0x0'));var db=require(_0xa321('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xa321('0x2')]({'id':i,'firstName':_0xa321('0x3')+i,'lastName':_0xa321('0x4')+i,'phone':0xf879fb460+i,'email':_0xa321('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa321('0x6')](),'updatedAt':Date[_0xa321('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xa321('0x3')+i,'lastName':_0xa321('0x4')+i,'phone':0xf879fb460+i,'email':_0xa321('0x5')+i+_0xa321('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xa321('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xa321('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa321('0x6')](),'updatedAt':Date[_0xa321('0x6')]()});}db[_0xa321('0x8')]['destroy']({'where':{}})[_0xa321('0x9')](function(){return db[_0xa321('0x8')][_0xa321('0xa')](contacts);})['then'](function(){console[_0xa321('0xb')](_0xa321('0xc'),_0xa321('0xd'));return db[_0xa321('0xe')][_0xa321('0xf')]({'where':{}});})['then'](function(){return db['CmHopper'][_0xa321('0xa')](hopper);})[_0xa321('0x9')](function(){console[_0xa321('0xb')](_0xa321('0xc'),_0xa321('0x10'));return db[_0xa321('0x8')][_0xa321('0xa')](contacts2);})[_0xa321('0x9')](function(){console[_0xa321('0xb')](_0xa321('0xc'),_0xa321('0x11'));return db[_0xa321('0xe')][_0xa321('0xa')](hopper2);})['then'](function(){console['log'](_0xa321('0xc'),_0xa321('0x12'));})[_0xa321('0x13')](function(_0x48ec36){console['log'](_0x48ec36);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 71fef55..a3ec8d1 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef19=['format','%s%s','agent','%s%s@xcally.com','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','User','bulkCreate','then','log','add\x20user','catch','../mysqldb'];(function(_0xdb3a79,_0xc46ef9){var _0x1bd5a4=function(_0x16e64a){while(--_0x16e64a){_0xdb3a79['push'](_0xdb3a79['shift']());}};_0x1bd5a4(++_0xc46ef9);}(_0xef19,0x131));var _0x9ef1=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0xef19[_0x11a55c];return _0x26c390;};'use strict';var util=require('util');var db=require(_0x9ef1('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x9ef1('0x1')](_0x9ef1('0x2'),'agent',i),'fullname':util[_0x9ef1('0x1')](_0x9ef1('0x2'),_0x9ef1('0x3'),i),'email':util[_0x9ef1('0x1')](_0x9ef1('0x4'),_0x9ef1('0x3'),i),'role':_0x9ef1('0x3'),'password':'password','internal':0xfa0+i,'type':'friend','transport':[_0x9ef1('0x5'),'ws',_0x9ef1('0x6')],'disallow':['all'],'allow':[_0x9ef1('0x7')],'defaultuser':util[_0x9ef1('0x1')](_0x9ef1('0x2'),_0x9ef1('0x3'),i),'encryption':'yes','avpf':_0x9ef1('0x8'),'force_avp':_0x9ef1('0x8'),'icesupport':_0x9ef1('0x8'),'dtlsenable':_0x9ef1('0x8'),'dtlsverify':'no','dtlscertfile':_0x9ef1('0x9'),'dtlsprivatekey':_0x9ef1('0xa'),'dtlssetup':'actpass','callerid':util[_0x9ef1('0x1')]('\x22%s\x22\x20<%s>',util[_0x9ef1('0x1')](_0x9ef1('0x2'),_0x9ef1('0x3'),i),0xfa0+i)});}db[_0x9ef1('0xb')][_0x9ef1('0xc')](users)[_0x9ef1('0xd')](function(){console[_0x9ef1('0xe')](_0x9ef1('0xf'));})[_0x9ef1('0x10')](function(_0x191f56){console['log'](_0x191f56);}); \ No newline at end of file +var _0xc963=['actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user','util','../mysqldb','push','format','%s%s','agent','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc963,0x1e9));var _0x3c96=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xc963[_0x173441];return _0x2423a8;};'use strict';var util=require(_0x3c96('0x0'));var db=require(_0x3c96('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x3c96('0x2')]({'name':util[_0x3c96('0x3')](_0x3c96('0x4'),_0x3c96('0x5'),i),'fullname':util[_0x3c96('0x3')](_0x3c96('0x4'),_0x3c96('0x5'),i),'email':util[_0x3c96('0x3')]('%s%s@xcally.com',_0x3c96('0x5'),i),'role':_0x3c96('0x5'),'password':_0x3c96('0x6'),'internal':0xfa0+i,'type':_0x3c96('0x7'),'transport':[_0x3c96('0x8'),'ws',_0x3c96('0x9')],'disallow':[_0x3c96('0xa')],'allow':[_0x3c96('0xb')],'defaultuser':util[_0x3c96('0x3')](_0x3c96('0x4'),'agent',i),'encryption':_0x3c96('0xc'),'avpf':_0x3c96('0xc'),'force_avp':_0x3c96('0xc'),'icesupport':_0x3c96('0xc'),'dtlsenable':_0x3c96('0xc'),'dtlsverify':'no','dtlscertfile':_0x3c96('0xd'),'dtlsprivatekey':_0x3c96('0xe'),'dtlssetup':_0x3c96('0xf'),'callerid':util[_0x3c96('0x3')](_0x3c96('0x10'),util['format'](_0x3c96('0x4'),'agent',i),0xfa0+i)});}db[_0x3c96('0x11')]['bulkCreate'](users)[_0x3c96('0x12')](function(){console[_0x3c96('0x13')](_0x3c96('0x14'));})['catch'](function(_0x544204){console['log'](_0x544204);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index ad3944f..9bd1e13 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94d4=['%s:queue:%s','Agents','length','handshake','find','userProfileId','query','ChatInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','ChatQueues','OpenchannelQueues','OpenchannelQueue','Trunk','getVoiceQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','telephone:%s','leave','ChatInteractions','removeChatInteractions','removeMailInteractions','emit','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','request','connectedAt','disconnect','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','./environment','name','User','role','agent','telephone','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','format'];(function(_0x15724a,_0x51e0ca){var _0x170151=function(_0x2d9435){while(--_0x2d9435){_0x15724a['push'](_0x15724a['shift']());}};_0x170151(++_0x51e0ca);}(_0x94d4,0xa5));var _0x494d=function(_0x5eae0c,_0x36d39b){_0x5eae0c=_0x5eae0c-0x0;var _0x1695ed=_0x94d4[_0x5eae0c];return _0x1695ed;};'use strict';var _=require(_0x494d('0x0'));var util=require(_0x494d('0x1'));var BPromise=require('bluebird');var db=require(_0x494d('0x2'))['db'];var config=require(_0x494d('0x3'));var queryQueues={'attributes':['id',_0x494d('0x4')],'include':[{'as':'Agents','model':db[_0x494d('0x5')],'attributes':['id',_0x494d('0x4'),_0x494d('0x6')],'raw':!![],'where':{'role':_0x494d('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x494d('0x4')],'where':{'role':_0x494d('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x494d('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x494d('0x9')],'where':{'type':_0x494d('0xa')}};function getAssociatedResources(_0x5408b3,_0x4c3e5f,_0x456fe8){return db[_0x494d('0xb')]['findOne']({'where':{'name':_0x5408b3,'userProfileId':_0x4c3e5f},'raw':!![]})[_0x494d('0xc')](function(_0x28bff7){if(_0x28bff7){if(_0x28bff7[_0x494d('0xd')]){switch(_0x5408b3){case _0x494d('0xe'):case'ChatQueues':case _0x494d('0xf'):case _0x494d('0x10'):case'MailQueues':case'OpenchannelQueues':case'WhatsappQueues':return db[_0x456fe8][_0x494d('0x11')](queryQueues);case _0x494d('0x12'):return db[_0x456fe8][_0x494d('0x11')](queryTelephones);case _0x494d('0x13'):return db[_0x456fe8][_0x494d('0x11')](queryTrunks);case _0x494d('0x14'):return db[_0x456fe8][_0x494d('0x11')](queryCampaigns);}}else{return db[_0x494d('0x15')][_0x494d('0x11')]({'attributes':[_0x494d('0x16')],'where':{'sectionId':_0x28bff7['id']},'raw':!![]})[_0x494d('0xc')](function(_0x5c2c67){if(_0x5c2c67){var _0x22f04f={'where':{'id':_[_0x494d('0x17')](_0x5c2c67,_0x494d('0x16'))},'raw':!![]};switch(_0x456fe8){case _0x494d('0x5'):_0x22f04f[_0x494d('0x18')][_0x494d('0x6')]=_0x494d('0x8');break;case _0x494d('0x19'):_0x22f04f[_0x494d('0x18')][_0x494d('0x9')]=_0x494d('0xa');break;}return db[_0x456fe8][_0x494d('0x11')](_0x22f04f);}else{return[];}});}}else{return[];}})[_0x494d('0xc')](function(_0x23997d){return _0x23997d;});}function joinOrLeaveQueues(_0x20dd3d,_0x3e4be3,_0x134632,_0x5bf90b){_0x20dd3d[_0x3e4be3](util[_0x494d('0x1a')](_0x494d('0x1b'),_0x134632,_0x5bf90b[_0x494d('0x4')]));if(_0x5bf90b[_0x494d('0x1c')]){for(var _0x4c2731=0x0;_0x4c2731<_0x5bf90b['Agents'][_0x494d('0x1d')];_0x4c2731+=0x1){_0x20dd3d[_0x3e4be3](util[_0x494d('0x1a')]('user:%s',_0x5bf90b['Agents'][_0x4c2731][_0x494d('0x4')]));}}}function joinOrLeave(_0x5b9c64,_0x1dec57,_0x52f26d){var _0x2be6f0;if(_0x5b9c64[_0x494d('0x1e')]['query']['id']){db[_0x494d('0x5')][_0x494d('0x1f')]({'attributes':['id',_0x494d('0x4'),_0x494d('0x6'),_0x494d('0x20')],'where':{'id':_0x5b9c64['handshake'][_0x494d('0x21')]['id']},'include':[{'model':db[_0x494d('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x494d('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x494d('0x24')],'as':_0x494d('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x494d('0x26')],'as':_0x494d('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x494d('0x28')],'as':_0x494d('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x494d('0x2a')],'as':_0x494d('0x2b'),'attributes':['id'],'raw':!![]}]})[_0x494d('0xc')](function(_0x1a8d4b){if(_0x1a8d4b){_0x2be6f0=_0x1a8d4b;_0x5b9c64[_0x1dec57](util[_0x494d('0x1a')](_0x494d('0x2c'),_0x1a8d4b['name']));var _0x220dd8=[];switch(_0x1a8d4b[_0x494d('0x6')]){case _0x494d('0x2d'):_0x5b9c64[_0x1dec57](_0x494d('0x2e'));_0x5b9c64[_0x1dec57](_0x494d('0x2f'));if(queryQueues[_0x494d('0x30')](_0x494d('0x31'))){delete queryQueues[_0x494d('0x31')];}_0x220dd8[_0x494d('0x32')](db[_0x494d('0x33')]['findAll'](queryQueues));_0x220dd8[_0x494d('0x32')](db[_0x494d('0x34')]['findAll'](queryQueues));_0x220dd8[_0x494d('0x32')](db[_0x494d('0x35')]['findAll'](queryQueues));_0x220dd8['push'](db[_0x494d('0x36')]['findAll'](queryQueues));_0x220dd8[_0x494d('0x32')](db[_0x494d('0x37')][_0x494d('0x11')](queryQueues));_0x220dd8[_0x494d('0x32')](db['OpenchannelQueue']['findAll'](queryQueues));_0x220dd8[_0x494d('0x32')](db[_0x494d('0x38')][_0x494d('0x11')](queryQueues));_0x220dd8['push'](db['User'][_0x494d('0x11')](queryTelephones));_0x220dd8[_0x494d('0x32')](db['Trunk'][_0x494d('0x11')](queryTrunks));_0x220dd8[_0x494d('0x32')](db[_0x494d('0x19')]['findAll'](queryCampaigns));_0x220dd8['push'](db['User'][_0x494d('0x11')](queryAgents));break;case'user':_0x5b9c64[_0x1dec57]('voice:inbound');_0x5b9c64[_0x1dec57](_0x494d('0x2f'));_0x220dd8[_0x494d('0x32')](getAssociatedResources(_0x494d('0xe'),_0x1a8d4b[_0x494d('0x20')],_0x494d('0x33')));_0x220dd8['push'](getAssociatedResources(_0x494d('0x39'),_0x1a8d4b[_0x494d('0x20')],_0x494d('0x34')));_0x220dd8[_0x494d('0x32')](getAssociatedResources(_0x494d('0xf'),_0x1a8d4b['userProfileId'],_0x494d('0x35')));_0x220dd8[_0x494d('0x32')](getAssociatedResources('SmsQueues',_0x1a8d4b[_0x494d('0x20')],_0x494d('0x36')));_0x220dd8[_0x494d('0x32')](getAssociatedResources('MailQueues',_0x1a8d4b[_0x494d('0x20')],_0x494d('0x37')));_0x220dd8['push'](getAssociatedResources(_0x494d('0x3a'),_0x1a8d4b[_0x494d('0x20')],_0x494d('0x3b')));_0x220dd8['push'](getAssociatedResources('WhatsappQueues',_0x1a8d4b[_0x494d('0x20')],'WhatsappQueue'));_0x220dd8[_0x494d('0x32')](getAssociatedResources(_0x494d('0x12'),_0x1a8d4b[_0x494d('0x20')],'User'));_0x220dd8[_0x494d('0x32')](getAssociatedResources(_0x494d('0x13'),_0x1a8d4b['userProfileId'],_0x494d('0x3c')));_0x220dd8[_0x494d('0x32')](getAssociatedResources('IvrCampaigns',_0x1a8d4b[_0x494d('0x20')],_0x494d('0x19')));_0x220dd8['push'](db[_0x494d('0x5')][_0x494d('0x11')](queryAgents));break;case _0x494d('0x7'):_0x5b9c64[_0x1dec57](_0x494d('0x2e'));_0x5b9c64[_0x1dec57]('voice:outbound');_0x220dd8[_0x494d('0x32')](_0x1a8d4b[_0x494d('0x3d')]({'attributes':['id',_0x494d('0x4')]}));_0x220dd8[_0x494d('0x32')](_0x1a8d4b['getChatQueues']({'attributes':['id','name']}));_0x220dd8[_0x494d('0x32')](_0x1a8d4b[_0x494d('0x3e')]({'attributes':['id','name']}));_0x220dd8[_0x494d('0x32')](_0x1a8d4b[_0x494d('0x3f')]({'attributes':['id',_0x494d('0x4')]}));_0x220dd8['push'](_0x1a8d4b['getMailQueues']({'attributes':['id',_0x494d('0x4')]}));_0x220dd8[_0x494d('0x32')](_0x1a8d4b[_0x494d('0x40')]({'attributes':['id',_0x494d('0x4')]}));_0x220dd8[_0x494d('0x32')](_0x1a8d4b[_0x494d('0x41')]({'attributes':['id',_0x494d('0x4')]}));break;}return BPromise[_0x494d('0x42')](_0x220dd8);}})[_0x494d('0xc')](function(_0xcc60c2){if(_0xcc60c2&&_0xcc60c2[_0x494d('0x1d')]){for(var _0x30a1eb=0x0;_0x30a1eb<_0xcc60c2['length'];_0x30a1eb+=0x1){for(var _0x37c49d=0x0;_0x37c49d<_0xcc60c2[_0x30a1eb][_0x494d('0x1d')];_0x37c49d+=0x1){switch(_0x30a1eb){case 0x0:joinOrLeaveQueues(_0x5b9c64,_0x1dec57,_0x494d('0x43'),_0xcc60c2[_0x30a1eb][_0x37c49d]);break;case 0x1:joinOrLeaveQueues(_0x5b9c64,_0x1dec57,_0x494d('0x44'),_0xcc60c2[_0x30a1eb][_0x37c49d]);break;case 0x2:joinOrLeaveQueues(_0x5b9c64,_0x1dec57,_0x494d('0x45'),_0xcc60c2[_0x30a1eb][_0x37c49d]);break;case 0x3:joinOrLeaveQueues(_0x5b9c64,_0x1dec57,_0x494d('0x46'),_0xcc60c2[_0x30a1eb][_0x37c49d]);break;case 0x4:joinOrLeaveQueues(_0x5b9c64,_0x1dec57,_0x494d('0x47'),_0xcc60c2[_0x30a1eb][_0x37c49d]);break;case 0x5:joinOrLeaveQueues(_0x5b9c64,_0x1dec57,_0x494d('0x48'),_0xcc60c2[_0x30a1eb][_0x37c49d]);break;case 0x6:joinOrLeaveQueues(_0x5b9c64,_0x1dec57,'whatsapp',_0xcc60c2[_0x30a1eb][_0x37c49d]);break;case 0x7:if(_0x2be6f0[_0x494d('0x6')]!==_0x494d('0x7'))_0x5b9c64[_0x1dec57](util[_0x494d('0x1a')](_0x494d('0x49'),_0xcc60c2[_0x30a1eb][_0x37c49d][_0x494d('0x4')]));break;case 0x8:if(_0x2be6f0['role']!=='agent')_0x5b9c64[_0x1dec57](util[_0x494d('0x1a')]('trunk:%s',_0xcc60c2[_0x30a1eb][_0x37c49d][_0x494d('0x4')]));break;case 0x9:if(_0x2be6f0[_0x494d('0x6')]!==_0x494d('0x7'))_0x5b9c64[_0x1dec57](util[_0x494d('0x1a')]('campaign:%s:%s',_0xcc60c2[_0x30a1eb][_0x37c49d][_0x494d('0x9')],_0xcc60c2[_0x30a1eb][_0x37c49d][_0x494d('0x4')]));break;case 0xa:_0x5b9c64[_0x1dec57](util['format'](_0x494d('0x2c'),_0xcc60c2[_0x30a1eb][_0x37c49d][_0x494d('0x4')]));break;}}}}})[_0x494d('0xc')](function(){if(_0x1dec57===_0x494d('0x4a')){var _0x2d3a26=_[_0x494d('0x17')](_0x2be6f0[_0x494d('0x4b')],'id');return _0x2be6f0[_0x494d('0x4c')](_0x2d3a26)['then'](function(){for(var _0x5c07b5=0x0;_0x5c07b5<_0x2d3a26[_0x494d('0x1d')];_0x5c07b5+=0x1){_0x52f26d['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x2d3a26[_0x5c07b5]),'UserId':Number(_0x2be6f0['id'])});}});}})[_0x494d('0xc')](function(){if(_0x1dec57===_0x494d('0x4a')){var _0x338a66=_[_0x494d('0x17')](_0x2be6f0[_0x494d('0x23')],'id');return _0x2be6f0[_0x494d('0x4d')](_0x338a66)['then'](function(){for(var _0xdd869e=0x0;_0xdd869e<_0x338a66[_0x494d('0x1d')];_0xdd869e+=0x1){_0x52f26d[_0x494d('0x4e')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x338a66[_0xdd869e]),'UserId':Number(_0x2be6f0['id'])});}});}})[_0x494d('0xc')](function(){if(_0x1dec57===_0x494d('0x4a')){var _0x596628=_[_0x494d('0x17')](_0x2be6f0[_0x494d('0x25')],'id');return _0x2be6f0[_0x494d('0x4f')](_0x596628)[_0x494d('0xc')](function(){for(var _0x4bc5e5=0x0;_0x4bc5e5<_0x596628['length'];_0x4bc5e5+=0x1){_0x52f26d[_0x494d('0x4e')](_0x494d('0x50'),{'FaxInteractionId':Number(_0x596628[_0x4bc5e5]),'UserId':Number(_0x2be6f0['id'])});}});}})[_0x494d('0xc')](function(){if(_0x1dec57===_0x494d('0x4a')){var _0x538f07=_[_0x494d('0x17')](_0x2be6f0[_0x494d('0x27')],'id');return _0x2be6f0[_0x494d('0x51')](_0x538f07)['then'](function(){for(var _0x421198=0x0;_0x421198<_0x538f07['length'];_0x421198+=0x1){_0x52f26d[_0x494d('0x4e')](_0x494d('0x52'),{'SmsInteractionId':Number(_0x538f07[_0x421198]),'UserId':Number(_0x2be6f0['id'])});}});}})['then'](function(){if(_0x1dec57===_0x494d('0x4a')){var _0x1d4d86=_[_0x494d('0x17')](_0x2be6f0[_0x494d('0x29')],'id');return _0x2be6f0['removeOpenchannelInteractions'](_0x1d4d86)[_0x494d('0xc')](function(){for(var _0x3beb37=0x0;_0x3beb37<_0x1d4d86[_0x494d('0x1d')];_0x3beb37+=0x1){_0x52f26d[_0x494d('0x4e')](_0x494d('0x53'),{'OpenchannelInteractionId':Number(_0x1d4d86[_0x3beb37]),'UserId':Number(_0x2be6f0['id'])});}});}})['then'](function(){if(_0x1dec57===_0x494d('0x4a')){var _0x8304b5=_[_0x494d('0x17')](_0x2be6f0[_0x494d('0x2b')],'id');return _0x2be6f0[_0x494d('0x54')](_0x8304b5)[_0x494d('0xc')](function(){for(var _0x1c12a0=0x0;_0x1c12a0<_0x8304b5[_0x494d('0x1d')];_0x1c12a0+=0x1){_0x52f26d[_0x494d('0x4e')](_0x494d('0x55'),{'WhatsappInteractionId':Number(_0x8304b5[_0x1c12a0]),'UserId':Number(_0x2be6f0['id'])});}});}})[_0x494d('0x56')](function(_0x17c800){_0x5b9c64[_0x494d('0x57')](_0x17c800);});}}function onDisconnect(_0x30f2a0,_0x20dc78){joinOrLeave(_0x30f2a0,_0x494d('0x4a'),_0x20dc78);}function onConnect(_0x532e21){joinOrLeave(_0x532e21,_0x494d('0x58'));}exports[_0x494d('0x59')]=function(_0x44e182){_0x44e182['on'](_0x494d('0x5a'),function(_0x330233){_0x330233['setMaxListeners'](0x0);_0x330233['address']=_0x330233[_0x494d('0x5b')][_0x494d('0x5a')]['remoteAddress']+':'+_0x330233[_0x494d('0x5b')]['connection']['remotePort'];_0x330233[_0x494d('0x5c')]=new Date();_0x330233[_0x494d('0x57')]=function(_0x8e3bf1){console[_0x494d('0x57')]('SocketIO\x20'+_0x330233['nsp']['name']+'['+_0x330233['address']+']',_0x8e3bf1);};_0x330233['on'](_0x494d('0x5d'),function(){onDisconnect(_0x330233,_0x44e182);_0x330233['log'](_0x494d('0x5e'));});onConnect(_0x330233);_0x330233[_0x494d('0x57')](_0x494d('0x5f'));});}; \ No newline at end of file +var _0x9e54=['voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','setMaxListeners','address','connection','remoteAddress','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','resourceId','map','Campaign','where','format','%s:queue:%s','length','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','admin','voice:outbound','hasOwnProperty','include','push','ChatQueue','Trunk','voice:inbound','VoiceQueue','FaxQueues','FaxQueue','MailQueues','MailQueue','getVoiceQueues','getChatQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all'];(function(_0x1c518f,_0x2c503f){var _0x5e73f4=function(_0x492d90){while(--_0x492d90){_0x1c518f['push'](_0x1c518f['shift']());}};_0x5e73f4(++_0x2c503f);}(_0x9e54,0x88));var _0x49e5=function(_0x5121f7,_0x189f9c){_0x5121f7=_0x5121f7-0x0;var _0x26fdf8=_0x9e54[_0x5121f7];return _0x26fdf8;};'use strict';var _=require(_0x49e5('0x0'));var util=require(_0x49e5('0x1'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x49e5('0x2')],'include':[{'as':_0x49e5('0x3'),'model':db[_0x49e5('0x4')],'attributes':['id','name',_0x49e5('0x5')],'raw':!![],'where':{'role':_0x49e5('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x49e5('0x7')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x49e5('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x49e5('0x8')],'where':{'type':_0x49e5('0x9')}};function getAssociatedResources(_0x4302ff,_0x4b0a31,_0x51bcbc){return db[_0x49e5('0xa')]['findOne']({'where':{'name':_0x4302ff,'userProfileId':_0x4b0a31},'raw':!![]})[_0x49e5('0xb')](function(_0x22aec5){if(_0x22aec5){if(_0x22aec5[_0x49e5('0xc')]){switch(_0x4302ff){case _0x49e5('0xd'):case _0x49e5('0xe'):case'FaxQueues':case _0x49e5('0xf'):case'MailQueues':case _0x49e5('0x10'):case _0x49e5('0x11'):return db[_0x51bcbc][_0x49e5('0x12')](queryQueues);case _0x49e5('0x13'):return db[_0x51bcbc][_0x49e5('0x12')](queryTelephones);case'Trunks':return db[_0x51bcbc]['findAll'](queryTrunks);case _0x49e5('0x14'):return db[_0x51bcbc][_0x49e5('0x12')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':[_0x49e5('0x15')],'where':{'sectionId':_0x22aec5['id']},'raw':!![]})['then'](function(_0x351a87){if(_0x351a87){var _0x5024e9={'where':{'id':_[_0x49e5('0x16')](_0x351a87,_0x49e5('0x15'))},'raw':!![]};switch(_0x51bcbc){case _0x49e5('0x4'):_0x5024e9['where'][_0x49e5('0x5')]=_0x49e5('0x7');break;case _0x49e5('0x17'):_0x5024e9[_0x49e5('0x18')][_0x49e5('0x8')]=_0x49e5('0x9');break;}return db[_0x51bcbc][_0x49e5('0x12')](_0x5024e9);}else{return[];}});}}else{return[];}})['then'](function(_0xcd5944){return _0xcd5944;});}function joinOrLeaveQueues(_0x200a4e,_0x52fade,_0x2370ad,_0x5b13ed){_0x200a4e[_0x52fade](util[_0x49e5('0x19')](_0x49e5('0x1a'),_0x2370ad,_0x5b13ed['name']));if(_0x5b13ed[_0x49e5('0x3')]){for(var _0x41c6d0=0x0;_0x41c6d0<_0x5b13ed[_0x49e5('0x3')][_0x49e5('0x1b')];_0x41c6d0+=0x1){_0x200a4e[_0x52fade](util[_0x49e5('0x19')](_0x49e5('0x1c'),_0x5b13ed['Agents'][_0x41c6d0][_0x49e5('0x2')]));}}}function joinOrLeave(_0x5c3062,_0x3f2f6b,_0x227615){var _0x1033ed;if(_0x5c3062[_0x49e5('0x1d')][_0x49e5('0x1e')]['id']){db[_0x49e5('0x4')]['find']({'attributes':['id','name',_0x49e5('0x5'),_0x49e5('0x1f')],'where':{'id':_0x5c3062['handshake'][_0x49e5('0x1e')]['id']},'include':[{'model':db[_0x49e5('0x20')],'as':_0x49e5('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x49e5('0x22')],'as':_0x49e5('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x49e5('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x49e5('0x25')],'as':_0x49e5('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x49e5('0x27')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x49e5('0x28')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x49e5('0xb')](function(_0x46a5be){if(_0x46a5be){_0x1033ed=_0x46a5be;_0x5c3062[_0x3f2f6b](util['format']('user:%s',_0x46a5be[_0x49e5('0x2')]));var _0x3e7f05=[];switch(_0x46a5be['role']){case _0x49e5('0x29'):_0x5c3062[_0x3f2f6b]('voice:inbound');_0x5c3062[_0x3f2f6b](_0x49e5('0x2a'));if(queryQueues[_0x49e5('0x2b')](_0x49e5('0x2c'))){delete queryQueues[_0x49e5('0x2c')];}_0x3e7f05[_0x49e5('0x2d')](db['VoiceQueue'][_0x49e5('0x12')](queryQueues));_0x3e7f05[_0x49e5('0x2d')](db[_0x49e5('0x2e')][_0x49e5('0x12')](queryQueues));_0x3e7f05[_0x49e5('0x2d')](db['FaxQueue'][_0x49e5('0x12')](queryQueues));_0x3e7f05[_0x49e5('0x2d')](db['SmsQueue'][_0x49e5('0x12')](queryQueues));_0x3e7f05['push'](db['MailQueue'][_0x49e5('0x12')](queryQueues));_0x3e7f05[_0x49e5('0x2d')](db['OpenchannelQueue']['findAll'](queryQueues));_0x3e7f05[_0x49e5('0x2d')](db['WhatsappQueue'][_0x49e5('0x12')](queryQueues));_0x3e7f05[_0x49e5('0x2d')](db[_0x49e5('0x4')][_0x49e5('0x12')](queryTelephones));_0x3e7f05[_0x49e5('0x2d')](db[_0x49e5('0x2f')][_0x49e5('0x12')](queryTrunks));_0x3e7f05[_0x49e5('0x2d')](db[_0x49e5('0x17')][_0x49e5('0x12')](queryCampaigns));_0x3e7f05['push'](db[_0x49e5('0x4')]['findAll'](queryAgents));break;case'user':_0x5c3062[_0x3f2f6b](_0x49e5('0x30'));_0x5c3062[_0x3f2f6b](_0x49e5('0x2a'));_0x3e7f05[_0x49e5('0x2d')](getAssociatedResources(_0x49e5('0xd'),_0x46a5be[_0x49e5('0x1f')],_0x49e5('0x31')));_0x3e7f05[_0x49e5('0x2d')](getAssociatedResources(_0x49e5('0xe'),_0x46a5be[_0x49e5('0x1f')],_0x49e5('0x2e')));_0x3e7f05[_0x49e5('0x2d')](getAssociatedResources(_0x49e5('0x32'),_0x46a5be[_0x49e5('0x1f')],_0x49e5('0x33')));_0x3e7f05[_0x49e5('0x2d')](getAssociatedResources('SmsQueues',_0x46a5be[_0x49e5('0x1f')],'SmsQueue'));_0x3e7f05[_0x49e5('0x2d')](getAssociatedResources(_0x49e5('0x34'),_0x46a5be['userProfileId'],_0x49e5('0x35')));_0x3e7f05[_0x49e5('0x2d')](getAssociatedResources('OpenchannelQueues',_0x46a5be[_0x49e5('0x1f')],'OpenchannelQueue'));_0x3e7f05[_0x49e5('0x2d')](getAssociatedResources(_0x49e5('0x11'),_0x46a5be[_0x49e5('0x1f')],'WhatsappQueue'));_0x3e7f05[_0x49e5('0x2d')](getAssociatedResources(_0x49e5('0x13'),_0x46a5be[_0x49e5('0x1f')],'User'));_0x3e7f05[_0x49e5('0x2d')](getAssociatedResources('Trunks',_0x46a5be[_0x49e5('0x1f')],'Trunk'));_0x3e7f05[_0x49e5('0x2d')](getAssociatedResources(_0x49e5('0x14'),_0x46a5be[_0x49e5('0x1f')],_0x49e5('0x17')));_0x3e7f05[_0x49e5('0x2d')](db[_0x49e5('0x4')][_0x49e5('0x12')](queryAgents));break;case _0x49e5('0x6'):_0x5c3062[_0x3f2f6b](_0x49e5('0x30'));_0x5c3062[_0x3f2f6b](_0x49e5('0x2a'));_0x3e7f05['push'](_0x46a5be[_0x49e5('0x36')]({'attributes':['id',_0x49e5('0x2')]}));_0x3e7f05['push'](_0x46a5be[_0x49e5('0x37')]({'attributes':['id',_0x49e5('0x2')]}));_0x3e7f05[_0x49e5('0x2d')](_0x46a5be['getFaxQueues']({'attributes':['id',_0x49e5('0x2')]}));_0x3e7f05[_0x49e5('0x2d')](_0x46a5be['getSmsQueues']({'attributes':['id',_0x49e5('0x2')]}));_0x3e7f05[_0x49e5('0x2d')](_0x46a5be[_0x49e5('0x38')]({'attributes':['id','name']}));_0x3e7f05[_0x49e5('0x2d')](_0x46a5be[_0x49e5('0x39')]({'attributes':['id',_0x49e5('0x2')]}));_0x3e7f05[_0x49e5('0x2d')](_0x46a5be[_0x49e5('0x3a')]({'attributes':['id',_0x49e5('0x2')]}));break;}return BPromise[_0x49e5('0x3b')](_0x3e7f05);}})[_0x49e5('0xb')](function(_0x565aad){if(_0x565aad&&_0x565aad[_0x49e5('0x1b')]){for(var _0x18e4d2=0x0;_0x18e4d2<_0x565aad[_0x49e5('0x1b')];_0x18e4d2+=0x1){for(var _0xa4ef20=0x0;_0xa4ef20<_0x565aad[_0x18e4d2][_0x49e5('0x1b')];_0xa4ef20+=0x1){switch(_0x18e4d2){case 0x0:joinOrLeaveQueues(_0x5c3062,_0x3f2f6b,_0x49e5('0x3c'),_0x565aad[_0x18e4d2][_0xa4ef20]);break;case 0x1:joinOrLeaveQueues(_0x5c3062,_0x3f2f6b,_0x49e5('0x3d'),_0x565aad[_0x18e4d2][_0xa4ef20]);break;case 0x2:joinOrLeaveQueues(_0x5c3062,_0x3f2f6b,_0x49e5('0x3e'),_0x565aad[_0x18e4d2][_0xa4ef20]);break;case 0x3:joinOrLeaveQueues(_0x5c3062,_0x3f2f6b,_0x49e5('0x3f'),_0x565aad[_0x18e4d2][_0xa4ef20]);break;case 0x4:joinOrLeaveQueues(_0x5c3062,_0x3f2f6b,_0x49e5('0x40'),_0x565aad[_0x18e4d2][_0xa4ef20]);break;case 0x5:joinOrLeaveQueues(_0x5c3062,_0x3f2f6b,_0x49e5('0x41'),_0x565aad[_0x18e4d2][_0xa4ef20]);break;case 0x6:joinOrLeaveQueues(_0x5c3062,_0x3f2f6b,_0x49e5('0x42'),_0x565aad[_0x18e4d2][_0xa4ef20]);break;case 0x7:if(_0x1033ed[_0x49e5('0x5')]!=='agent')_0x5c3062[_0x3f2f6b](util[_0x49e5('0x19')](_0x49e5('0x43'),_0x565aad[_0x18e4d2][_0xa4ef20][_0x49e5('0x2')]));break;case 0x8:if(_0x1033ed[_0x49e5('0x5')]!=='agent')_0x5c3062[_0x3f2f6b](util[_0x49e5('0x19')](_0x49e5('0x44'),_0x565aad[_0x18e4d2][_0xa4ef20][_0x49e5('0x2')]));break;case 0x9:if(_0x1033ed[_0x49e5('0x5')]!=='agent')_0x5c3062[_0x3f2f6b](util[_0x49e5('0x19')](_0x49e5('0x45'),_0x565aad[_0x18e4d2][_0xa4ef20][_0x49e5('0x8')],_0x565aad[_0x18e4d2][_0xa4ef20][_0x49e5('0x2')]));break;case 0xa:_0x5c3062[_0x3f2f6b](util['format'](_0x49e5('0x1c'),_0x565aad[_0x18e4d2][_0xa4ef20][_0x49e5('0x2')]));break;}}}}})[_0x49e5('0xb')](function(){if(_0x3f2f6b===_0x49e5('0x46')){var _0x21ae65=_['map'](_0x1033ed[_0x49e5('0x21')],'id');return _0x1033ed[_0x49e5('0x47')](_0x21ae65)[_0x49e5('0xb')](function(){for(var _0x1a7c5b=0x0;_0x1a7c5b<_0x21ae65[_0x49e5('0x1b')];_0x1a7c5b+=0x1){_0x227615[_0x49e5('0x48')](_0x49e5('0x49'),{'ChatInteractionId':Number(_0x21ae65[_0x1a7c5b]),'UserId':Number(_0x1033ed['id'])});}});}})[_0x49e5('0xb')](function(){if(_0x3f2f6b==='leave'){var _0x57f568=_['map'](_0x1033ed[_0x49e5('0x23')],'id');return _0x1033ed['removeMailInteractions'](_0x57f568)[_0x49e5('0xb')](function(){for(var _0x1d551b=0x0;_0x1d551b<_0x57f568['length'];_0x1d551b+=0x1){_0x227615[_0x49e5('0x48')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x57f568[_0x1d551b]),'UserId':Number(_0x1033ed['id'])});}});}})[_0x49e5('0xb')](function(){if(_0x3f2f6b===_0x49e5('0x46')){var _0x28758a=_[_0x49e5('0x16')](_0x1033ed[_0x49e5('0x4a')],'id');return _0x1033ed[_0x49e5('0x4b')](_0x28758a)[_0x49e5('0xb')](function(){for(var _0x5ea366=0x0;_0x5ea366<_0x28758a[_0x49e5('0x1b')];_0x5ea366+=0x1){_0x227615[_0x49e5('0x48')](_0x49e5('0x4c'),{'FaxInteractionId':Number(_0x28758a[_0x5ea366]),'UserId':Number(_0x1033ed['id'])});}});}})[_0x49e5('0xb')](function(){if(_0x3f2f6b===_0x49e5('0x46')){var _0x531e57=_[_0x49e5('0x16')](_0x1033ed[_0x49e5('0x26')],'id');return _0x1033ed['removeSmsInteractions'](_0x531e57)['then'](function(){for(var _0x5bace8=0x0;_0x5bace8<_0x531e57['length'];_0x5bace8+=0x1){_0x227615['emit'](_0x49e5('0x4d'),{'SmsInteractionId':Number(_0x531e57[_0x5bace8]),'UserId':Number(_0x1033ed['id'])});}});}})[_0x49e5('0xb')](function(){if(_0x3f2f6b===_0x49e5('0x46')){var _0x322b77=_['map'](_0x1033ed[_0x49e5('0x4e')],'id');return _0x1033ed[_0x49e5('0x4f')](_0x322b77)[_0x49e5('0xb')](function(){for(var _0x426a2c=0x0;_0x426a2c<_0x322b77[_0x49e5('0x1b')];_0x426a2c+=0x1){_0x227615['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x322b77[_0x426a2c]),'UserId':Number(_0x1033ed['id'])});}});}})['then'](function(){if(_0x3f2f6b==='leave'){var _0x5b1309=_[_0x49e5('0x16')](_0x1033ed['WhatsappInteractions'],'id');return _0x1033ed[_0x49e5('0x50')](_0x5b1309)[_0x49e5('0xb')](function(){for(var _0x1092f4=0x0;_0x1092f4<_0x5b1309[_0x49e5('0x1b')];_0x1092f4+=0x1){_0x227615[_0x49e5('0x48')](_0x49e5('0x51'),{'WhatsappInteractionId':Number(_0x5b1309[_0x1092f4]),'UserId':Number(_0x1033ed['id'])});}});}})[_0x49e5('0x52')](function(_0x1dc82e){_0x5c3062[_0x49e5('0x53')](_0x1dc82e);});}}function onDisconnect(_0x13841d,_0x2428bd){joinOrLeave(_0x13841d,_0x49e5('0x46'),_0x2428bd);}function onConnect(_0x13c2b3){joinOrLeave(_0x13c2b3,_0x49e5('0x54'));}exports[_0x49e5('0x55')]=function(_0x5be97b){_0x5be97b['on']('connection',function(_0x3175a3){_0x3175a3[_0x49e5('0x56')](0x0);_0x3175a3[_0x49e5('0x57')]=_0x3175a3['request'][_0x49e5('0x58')][_0x49e5('0x59')]+':'+_0x3175a3[_0x49e5('0x5a')]['connection'][_0x49e5('0x5b')];_0x3175a3[_0x49e5('0x5c')]=new Date();_0x3175a3[_0x49e5('0x53')]=function(_0x22d122){console[_0x49e5('0x53')](_0x49e5('0x5d')+_0x3175a3[_0x49e5('0x5e')][_0x49e5('0x2')]+'['+_0x3175a3['address']+']',_0x22d122);};_0x3175a3['on'](_0x49e5('0x5f'),function(){onDisconnect(_0x3175a3,_0x5be97b);_0x3175a3[_0x49e5('0x53')](_0x49e5('0x60'));});onConnect(_0x3175a3);_0x3175a3[_0x49e5('0x53')](_0x49e5('0x61'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 0ba6794..12e0933 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 _0xc0d7=['changed','closed','substatus','find','fullname','email','internal','default','length','model','hook','callback','condition','../logger','triggers','client','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','OpenchannelInteraction','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','event','direction','resolve','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','UserId','interface','format','SIP/%s','incomingmessage','outgoingmessage','AfterCreateMessage','offlineMessage','opened','query','contact','name','agent'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc0d7,0x97));var _0x7c0d=function(_0x33072c,_0x297b90){_0x33072c=_0x33072c-0x0;var _0x4af8c4=_0xc0d7[_0x33072c];return _0x4af8c4;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var logger=require(_0x7c0d('0x0'))(_0x7c0d('0x1'));var client=jayson[_0x7c0d('0x2')]['http']({'port':0x232a});var triggers=[{'channel':_0x7c0d('0x3'),'model':_0x7c0d('0x4'),'event':_0x7c0d('0x5'),'condition':_0x7c0d('0x6'),'callback':afterCreate},{'channel':_0x7c0d('0x3'),'model':_0x7c0d('0x4'),'event':_0x7c0d('0x7'),'condition':_0x7c0d('0x8'),'callback':afterUpdate},{'channel':_0x7c0d('0x3'),'model':_0x7c0d('0x9'),'event':_0x7c0d('0x5'),'condition':_0x7c0d('0xa'),'callback':afterCreateMessage},{'channel':'Chat','model':_0x7c0d('0xb'),'event':'afterCreate','condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x7c0d('0xc'),'event':_0x7c0d('0x5'),'condition':_0x7c0d('0x6'),'callback':afterCreate},{'channel':'Sms','model':_0x7c0d('0xc'),'event':'afterUpdate','condition':_0x7c0d('0x8'),'callback':afterUpdate},{'channel':'Sms','model':_0x7c0d('0xd'),'event':_0x7c0d('0x5'),'condition':_0x7c0d('0xa'),'callback':afterCreateMessage},{'channel':_0x7c0d('0xe'),'model':_0x7c0d('0xf'),'event':_0x7c0d('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x7c0d('0xe'),'model':'WhatsappInteraction','event':_0x7c0d('0x7'),'condition':_0x7c0d('0x8'),'callback':afterUpdate},{'channel':_0x7c0d('0xe'),'model':'WhatsappMessage','event':'afterCreate','condition':_0x7c0d('0xa'),'callback':afterCreateMessage},{'channel':_0x7c0d('0x10'),'model':_0x7c0d('0x11'),'event':'afterCreate','condition':_0x7c0d('0x6'),'callback':afterCreate},{'channel':_0x7c0d('0x10'),'model':_0x7c0d('0x11'),'event':_0x7c0d('0x7'),'condition':_0x7c0d('0x8'),'callback':afterUpdate},{'channel':'Fax','model':_0x7c0d('0x12'),'event':_0x7c0d('0x5'),'condition':_0x7c0d('0xa'),'callback':afterCreateMessage},{'channel':_0x7c0d('0x13'),'model':_0x7c0d('0x14'),'event':'afterCreate','condition':_0x7c0d('0x6'),'callback':afterCreate},{'channel':_0x7c0d('0x13'),'model':'MailInteraction','event':_0x7c0d('0x7'),'condition':_0x7c0d('0x8'),'callback':afterUpdate},{'channel':_0x7c0d('0x13'),'model':'MailMessage','event':_0x7c0d('0x5'),'condition':_0x7c0d('0xa'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x7c0d('0x15'),'event':_0x7c0d('0x5'),'condition':_0x7c0d('0x6'),'callback':afterCreate},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0x7c0d('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0x7c0d('0x16'),'event':'afterCreate','condition':_0x7c0d('0xa'),'callback':afterCreateMessage}];function request(_0x2fed76){return client['request'](_0x7c0d('0x17'),_0x2fed76)[_0x7c0d('0x18')](function(_0x173b46){logger[_0x7c0d('0x19')](_0x7c0d('0x1a'),'EventManager',_0x173b46);if(_0x173b46[_0x7c0d('0x1b')]){if(_0x173b46[_0x7c0d('0x1b')][_0x7c0d('0x1c')]===0x1f4){logger[_0x7c0d('0x1b')](_0x7c0d('0x1a'),_0x7c0d('0x17'),_0x173b46[_0x7c0d('0x1b')]);}}})[_0x7c0d('0x1d')](function(_0x2353fa){logger[_0x7c0d('0x1b')]('Trigger,\x20%s',_0x7c0d('0x17'),_0x2353fa);});}function afterCreateMessage(_0x635155){return function(_0x16f58a){_0x16f58a=_0x16f58a[_0x7c0d('0x1e')]({'plain':!![]});_0x16f58a[_0x7c0d('0x1f')]=_0x635155;_0x16f58a[_0x7c0d('0x20')]=_0x635155;_0x16f58a[_0x7c0d('0x21')]=_0x16f58a[_0x7c0d('0x22')];Promise[_0x7c0d('0x23')]()[_0x7c0d('0x18')](function(){if(typeof _0x16f58a['ContactId']===_0x7c0d('0x24'))return null;var _0x4249d0=_0x7c0d('0x25')+_0x16f58a[_0x7c0d('0x26')];return db[_0x7c0d('0x27')]['query'](_0x4249d0,{'type':db[_0x7c0d('0x28')][_0x7c0d('0x29')][_0x7c0d('0x2a')],'raw':!![]});})[_0x7c0d('0x18')](function(_0x373978){if(_0x373978){_0x16f58a['contact']=_0x373978[0x0];}if(typeof _0x16f58a[_0x7c0d('0x2b')]===_0x7c0d('0x24'))return;return getAgent(_0x16f58a[_0x7c0d('0x2b')]);})[_0x7c0d('0x18')](function(_0x132dae){if(_0x132dae){_0x16f58a[_0x7c0d('0x2c')]=util[_0x7c0d('0x2d')](_0x7c0d('0x2e'),_0x132dae['name']);_0x16f58a['agent']=_0x132dae;_0x16f58a[_0x7c0d('0x1f')]=_0x635155;return request({'event':_0x7c0d('0x2f'),'message':_0x16f58a});}else{return request({'event':_0x7c0d('0x30'),'message':_0x16f58a});}})[_0x7c0d('0x1d')](function(_0x57167c){logger[_0x7c0d('0x1b')](_0x7c0d('0x1a'),_0x7c0d('0x31'),_0x57167c);});};}function afterCreateOfflineMessage(_0x282e19){return function(_0x23678f){_0x23678f=_0x23678f['get']({'plain':!![]});_0x23678f[_0x7c0d('0x1f')]=_0x282e19;_0x23678f[_0x7c0d('0x20')]=_0x282e19;_0x23678f[_0x7c0d('0x21')]=_0x7c0d('0x32');return request({'event':_0x23678f[_0x7c0d('0x21')],'message':_0x23678f});};}function afterCreate(_0x12b1d8,_0x2de109){return function(_0x1c97c9){_0x1c97c9=_0x1c97c9[_0x7c0d('0x1e')]({'plain':!![]});_0x1c97c9[_0x7c0d('0x1f')]=_0x12b1d8;_0x1c97c9['motionChannel']=_0x12b1d8;_0x1c97c9['event']=_0x7c0d('0x33');Promise[_0x7c0d('0x23')]()[_0x7c0d('0x18')](function(){var _0x553807='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1c97c9[_0x7c0d('0x26')];return db[_0x7c0d('0x27')][_0x7c0d('0x34')](_0x553807,{'type':db[_0x7c0d('0x28')][_0x7c0d('0x29')]['SELECT'],'raw':!![]});})['then'](function(_0xb4f673){if(_0xb4f673){_0x1c97c9[_0x7c0d('0x35')]=_0xb4f673[0x0];}if(typeof _0x1c97c9['UserId']==='undefined')return;return getAgent(_0x1c97c9['UserId']);})[_0x7c0d('0x18')](function(_0x1ba08e){if(_0x1ba08e){_0x1c97c9['interface']=util[_0x7c0d('0x2d')]('SIP/%s',_0x1ba08e[_0x7c0d('0x36')]);_0x1c97c9[_0x7c0d('0x37')]=_0x1ba08e;}return request({'event':_0x2de109,'message':_0x1c97c9});})[_0x7c0d('0x1d')](function(_0x3bc20b){logger[_0x7c0d('0x1b')]('Trigger,\x20%s','AfterCreate',_0x3bc20b);});};}function afterUpdate(_0x11fdcc){return function(_0x3142d4){var _0x2c57ab=_0x3142d4[_0x7c0d('0x38')](_0x7c0d('0x39'))&&_0x3142d4[_0x7c0d('0x39')];var _0x217521=_0x3142d4[_0x7c0d('0x38')](_0x7c0d('0x3a'));if(_0x2c57ab||_0x217521){var _0x42c750=_0x2c57ab?_0x7c0d('0x8'):_0x7c0d('0x3a');var _0x31a205=_0x3142d4[_0x7c0d('0x1e')]({'plain':!![]});_0x31a205[_0x7c0d('0x1f')]=_0x11fdcc;_0x31a205[_0x7c0d('0x20')]=_0x11fdcc;_0x31a205['event']=_0x2c57ab?_0x7c0d('0x39'):_0x7c0d('0x3a');var _0x77311d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x31a205[_0x7c0d('0x26')];return db[_0x7c0d('0x27')]['query'](_0x77311d,{'type':db[_0x7c0d('0x28')][_0x7c0d('0x29')][_0x7c0d('0x2a')],'raw':!![]})['then'](function(_0x564439){if(_0x564439){_0x31a205[_0x7c0d('0x35')]=_0x564439[0x0];}if(typeof _0x31a205['UserId']===_0x7c0d('0x24'))return;return getAgent(_0x31a205[_0x7c0d('0x2b')]);})['then'](function(_0x4ed40b){if(_0x4ed40b){_0x31a205['interface']=util[_0x7c0d('0x2d')](_0x7c0d('0x2e'),_0x4ed40b[_0x7c0d('0x36')]);_0x31a205['agent']=_0x4ed40b;}return request({'event':_0x42c750,'message':_0x31a205});})[_0x7c0d('0x1d')](function(_0x136169){logger[_0x7c0d('0x1b')]('Trigger,\x20%s','AfterUpdate',_0x136169);});}};}function getAgent(_0x2d1ffc){return db['User'][_0x7c0d('0x3b')]({'where':{'id':_0x2d1ffc},'attributes':['id',_0x7c0d('0x36'),_0x7c0d('0x3c'),_0x7c0d('0x3d'),_0x7c0d('0x3e')],'raw':!![]})[_0x7c0d('0x18')](function(_0xe98c42){return _0xe98c42;});}exports[_0x7c0d('0x3f')]=function(){for(var _0x1306b2=0x0;_0x1306b2=_0x5a6009[_0x75a3('0x11')]){throw Error(_0x75a3('0x12'));}_0xf84442(_0x4da836);})[_0x75a3('0x13')](function(_0x49fab5){_0x43df02(_0x49fab5);});});}; \ No newline at end of file +var _0xa82d=['getLicense','role','User','agent','then','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','sms','whatsapp','isValidChannel','toLowerCase','clearBlockUser','isUndefined','blockedAt','updateAttributes'];(function(_0x505675,_0x34bef5){var _0x40c8e7=function(_0x55b42d){while(--_0x55b42d){_0x505675['push'](_0x505675['shift']());}};_0x40c8e7(++_0x34bef5);}(_0xa82d,0xcc));var _0xda82=function(_0x1e8d60,_0x4664e3){_0x1e8d60=_0x1e8d60-0x0;var _0x138568=_0xa82d[_0x1e8d60];return _0x138568;};'use strict';var _=require(_0xda82('0x0'));var BPromise=require(_0xda82('0x1'));var db=require(_0xda82('0x2'))['db'];var util=require(_0xda82('0x3'));var channels=[_0xda82('0x4'),_0xda82('0x5'),_0xda82('0x6'),_0xda82('0x7'),_0xda82('0x8'),_0xda82('0x9'),'openchannel'];exports['getChannels']=function(){return channels;};exports[_0xda82('0xa')]=function(_0x9bbc17){_0x9bbc17=_0x9bbc17[_0xda82('0xb')]();return _['includes'](channels,_0x9bbc17);};exports[_0xda82('0xc')]=function(_0x490391,_0xbb5d9c,_0x4492c3,_0x8a4f2f){var _0x3b324f={'loginAttempts':_0xbb5d9c,'blocked':_0x4492c3};if(!_[_0xda82('0xd')](_0x8a4f2f)){_0x3b324f[_0xda82('0xe')]=_0x8a4f2f;}return _0x490391[_0xda82('0xf')](_0x3b324f);};exports[_0xda82('0x10')]=function(_0x5ecd00){return new BPromise(function(_0xe17e32,_0x24b8a2){var _0x55f670=0x0;if(_0x5ecd00[_0xda82('0x11')]!=='agent'){_0xe17e32(_0x5ecd00);}db[_0xda82('0x12')]['count']({'where':{'role':_0xda82('0x13'),'online':!![],'id':{'$ne':_0x5ecd00['id']}}})[_0xda82('0x14')](function(_0x32743d){_0x55f670=_0x32743d;return util[_0xda82('0x10')]();})[_0xda82('0x14')](function(_0x431ab5){if(_0x431ab5&&_0x431ab5['agents']&&_0x55f670>=_0x431ab5['agents']){throw Error(_0xda82('0x15'));}_0xe17e32(_0x5ecd00);})['catch'](function(_0x15053e){_0x24b8a2(_0x15053e);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index f6a73bc..128575e 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error','statusMessage','status','send','exports','../config/logger','message','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found'];(function(_0x58bb6f,_0xf54527){var _0x31dbae=function(_0x1b597a){while(--_0x1b597a){_0x58bb6f['push'](_0x58bb6f['shift']());}};_0x31dbae(++_0xf54527);}(_0xadb5,0xad));var _0x5adb=function(_0x2427d8,_0x2a3caf){_0x2427d8=_0x2427d8-0x0;var _0x2dc96e=_0xadb5[_0x2427d8];return _0x2dc96e;};'use strict';var util=require('util');var logger=require(_0x5adb('0x0'))('api');var APIError=function(_0x3d6340,_0x38f67f){this[_0x5adb('0x1')]=_0x3d6340||'Internal\x20Server\x20Error';this[_0x5adb('0x2')]=_0x38f67f||_0x5adb('0x3');util[_0x5adb('0x4')](APIError,Error);};var APIBadRequestError=function(_0x4cb1d1){this[_0x5adb('0x1')]=_0x4cb1d1||_0x5adb('0x5');this[_0x5adb('0x2')]=_0x5adb('0x5');util[_0x5adb('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x353885){this[_0x5adb('0x1')]=_0x353885||_0x5adb('0x6');this[_0x5adb('0x2')]=_0x5adb('0x7');util[_0x5adb('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x336bad){this[_0x5adb('0x1')]=_0x336bad||_0x5adb('0x8');this['name']='Out\x20Of\x20Interval';util[_0x5adb('0x4')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x1ea238){switch(_0x1ea238){case _0x5adb('0x5'):return 0x190;case'Forbidden',_0x5adb('0x9'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x2a0b70){if(_0x2a0b70==='Out\x20Of\x20Interval')return _0x2a0b70;return null;}function handleError(_0x8cfcc6){return function(_0x39a0b3){logger[_0x5adb('0xa')](_0x39a0b3['stack']);var _0x2a545b=getStatusCode(_0x39a0b3[_0x5adb('0x2')]);var _0xf82f72=getCustomStatusMessage(_0x39a0b3['name']);if(_0x39a0b3[_0x5adb('0x2')])delete _0x39a0b3['name'];if(_0xf82f72)_0x8cfcc6[_0x5adb('0xb')]=_0xf82f72;return _0x8cfcc6[_0x5adb('0xc')](_0x2a545b)[_0x5adb('0xd')](_0x39a0b3);};}module[_0x5adb('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xc4aa=['stack','statusMessage','status','exports','util','../config/logger','api','message','inherits','Bad\x20Request','name','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error'];(function(_0x176d10,_0x594d26){var _0x3f47dd=function(_0x1e8324){while(--_0x1e8324){_0x176d10['push'](_0x176d10['shift']());}};_0x3f47dd(++_0x594d26);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xc4aa[_0x50a0c2];return _0x5ebadd;};'use strict';var util=require(_0xac4a('0x0'));var logger=require(_0xac4a('0x1'))(_0xac4a('0x2'));var APIError=function(_0x351dd5,_0x275161){this[_0xac4a('0x3')]=_0x351dd5||'Internal\x20Server\x20Error';this['name']=_0x275161||'Error';util[_0xac4a('0x4')](APIError,Error);};var APIBadRequestError=function(_0x15b967){this[_0xac4a('0x3')]=_0x15b967||_0xac4a('0x5');this[_0xac4a('0x6')]=_0xac4a('0x5');util[_0xac4a('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x10525b){this['message']=_0x10525b||'Entity\x20not\x20found';this[_0xac4a('0x6')]=_0xac4a('0x7');util[_0xac4a('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x4f4146){this[_0xac4a('0x3')]=_0x4f4146||_0xac4a('0x8');this[_0xac4a('0x6')]='Out\x20Of\x20Interval';util[_0xac4a('0x4')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x488e3c){switch(_0x488e3c){case _0xac4a('0x5'):return 0x190;case'Forbidden',_0xac4a('0x9'):return 0x193;case _0xac4a('0x7'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x24291d){if(_0x24291d==='Out\x20Of\x20Interval')return _0x24291d;return null;}function handleError(_0x21a79){return function(_0x68424a){logger[_0xac4a('0xa')](_0x68424a[_0xac4a('0xb')]);var _0x1b4313=getStatusCode(_0x68424a[_0xac4a('0x6')]);var _0x34bc01=getCustomStatusMessage(_0x68424a[_0xac4a('0x6')]);if(_0x68424a[_0xac4a('0x6')])delete _0x68424a[_0xac4a('0x6')];if(_0x34bc01)_0x21a79[_0xac4a('0xc')]=_0x34bc01;return _0x21a79[_0xac4a('0xd')](_0x1b4313)['send'](_0x68424a);};}module[_0xac4a('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index d0796ab..d5a1713 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9d6=['render','json','send','exports','404','status'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0xa9d6,0x1ef));var _0x6a9d=function(_0x22206b,_0x28f001){_0x22206b=_0x22206b-0x0;var _0x5e97f9=_0xa9d6[_0x22206b];return _0x5e97f9;};'use strict';module[_0x6a9d('0x0')][0x194]=function pageNotFound(_0x474daf,_0x1a2c80){var _0x1731d8=_0x6a9d('0x1');var _0x3e2efe=0x194;var _0x13cdb4={'status':_0x3e2efe};_0x1a2c80[_0x6a9d('0x2')](_0x13cdb4[_0x6a9d('0x2')]);_0x1a2c80[_0x6a9d('0x3')](_0x1731d8,{},function(_0x10d4e4,_0x1c303c){if(_0x10d4e4){return _0x1a2c80['status'](_0x13cdb4[_0x6a9d('0x2')])[_0x6a9d('0x4')](_0x13cdb4);}_0x1a2c80[_0x6a9d('0x5')](_0x1c303c);});}; \ No newline at end of file +var _0x081f=['exports','404','status','render','send'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x081f,0x14a));var _0xf081=function(_0xc69f39,_0x2ce0cf){_0xc69f39=_0xc69f39-0x0;var _0x93be41=_0x081f[_0xc69f39];return _0x93be41;};'use strict';module[_0xf081('0x0')][0x194]=function pageNotFound(_0x4fba9f,_0x5ee566){var _0x2d8a65=_0xf081('0x1');var _0x37e2e0=0x194;var _0x431cfc={'status':_0x37e2e0};_0x5ee566[_0xf081('0x2')](_0x431cfc['status']);_0x5ee566[_0xf081('0x3')](_0x2d8a65,{},function(_0x2fe076,_0x5389fc){if(_0x2fe076){return _0x5ee566['status'](_0x431cfc[_0xf081('0x2')])['json'](_0x431cfc);}_0x5ee566[_0xf081('0x4')](_0x5389fc);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index d1d257d..6ba186d 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','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','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x52096b,_0x20bab4){var _0x2b1cc7=function(_0x3f7021){while(--_0x3f7021){_0x52096b['push'](_0x52096b['shift']());}};_0x2b1cc7(++_0x20bab4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','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','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x277af0,_0x1f0361){var _0x43bd7c=function(_0x3ad480){while(--_0x3ad480){_0x277af0['push'](_0x277af0['shift']());}};_0x43bd7c(++_0x1f0361);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index dc1aae3..934afdc 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05b0=['./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/messages','/api/teams','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/logs','static','join','root','/apidoc','/www','/demo','/snippet','3.5.0','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','./errors','./config/environment','setupLoggers','./api/client-side-logs','then','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','/api/voice/mohs','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/sms/accounts','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./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/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations'];(function(_0x23be51,_0xc02a1b){var _0x47a26d=function(_0xa92395){while(--_0xa92395){_0x23be51['push'](_0x23be51['shift']());}};_0x47a26d(++_0xc02a1b);}(_0x05b0,0x188));var _0x005b=function(_0x249365,_0x2287b0){_0x249365=_0x249365-0x0;var _0x8360e7=_0x05b0[_0x249365];return _0x8360e7;};'use strict';var path=require('path');var express=require('express');var errors=require(_0x005b('0x0'));var config=require(_0x005b('0x1'));var setupLoggers=require('./utils/client-side-logger')[_0x005b('0x2')];var clientSideLogs=require(_0x005b('0x3'));exports['default']=function(_0x342d08){return setupLoggers(_0x342d08)[_0x005b('0x4')](function(){_0x342d08['use'](_0x005b('0x5'),require(_0x005b('0x6')));_0x342d08[_0x005b('0x7')](_0x005b('0x8'),require(_0x005b('0x9')));_0x342d08[_0x005b('0x7')](_0x005b('0xa'),require('./api/voiceContext'));_0x342d08[_0x005b('0x7')](_0x005b('0xb'),require('./api/voiceExtension'));_0x342d08['use'](_0x005b('0xc'),require('./api/voiceMusicOnHold'));_0x342d08['use']('/api/voice/queues',require(_0x005b('0xd')));_0x342d08[_0x005b('0x7')]('/api/voice/recordings',require(_0x005b('0xe')));_0x342d08[_0x005b('0x7')](_0x005b('0xf'),require(_0x005b('0x10')));_0x342d08[_0x005b('0x7')](_0x005b('0x11'),require(_0x005b('0x12')));_0x342d08['use']('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x342d08[_0x005b('0x7')]('/api/voice/calls/reports',require(_0x005b('0x13')));_0x342d08['use'](_0x005b('0x14'),require(_0x005b('0x15')));_0x342d08[_0x005b('0x7')](_0x005b('0x16'),require(_0x005b('0x17')));_0x342d08['use'](_0x005b('0x18'),require(_0x005b('0x19')));_0x342d08[_0x005b('0x7')]('/api/members/reports',require(_0x005b('0x1a')));_0x342d08[_0x005b('0x7')]('/api/trunks',require(_0x005b('0x1b')));_0x342d08[_0x005b('0x7')](_0x005b('0x1c'),require(_0x005b('0x1d')));_0x342d08[_0x005b('0x7')]('/api/mail/out_servers',require(_0x005b('0x1e')));_0x342d08[_0x005b('0x7')]('/api/mail/accounts',require(_0x005b('0x1f')));_0x342d08[_0x005b('0x7')](_0x005b('0x20'),require('./api/mailQueue'));_0x342d08[_0x005b('0x7')](_0x005b('0x21'),require(_0x005b('0x22')));_0x342d08[_0x005b('0x7')](_0x005b('0x23'),require(_0x005b('0x24')));_0x342d08['use'](_0x005b('0x25'),require(_0x005b('0x26')));_0x342d08[_0x005b('0x7')]('/api/mail/applications',require(_0x005b('0x27')));_0x342d08['use'](_0x005b('0x28'),require('./api/mailQueueReport'));_0x342d08['use'](_0x005b('0x29'),require(_0x005b('0x2a')));_0x342d08[_0x005b('0x7')](_0x005b('0x2b'),require(_0x005b('0x2c')));_0x342d08[_0x005b('0x7')](_0x005b('0x2d'),require(_0x005b('0x2e')));_0x342d08['use'](_0x005b('0x2f'),require(_0x005b('0x30')));_0x342d08[_0x005b('0x7')](_0x005b('0x31'),require(_0x005b('0x32')));_0x342d08[_0x005b('0x7')](_0x005b('0x33'),require('./api/faxMessage'));_0x342d08[_0x005b('0x7')](_0x005b('0x34'),require(_0x005b('0x35')));_0x342d08[_0x005b('0x7')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x342d08[_0x005b('0x7')](_0x005b('0x36'),require('./api/smsAccount'));_0x342d08['use'](_0x005b('0x37'),require('./api/smsApplication'));_0x342d08[_0x005b('0x7')](_0x005b('0x38'),require(_0x005b('0x39')));_0x342d08['use']('/api/sms/messages',require(_0x005b('0x3a')));_0x342d08[_0x005b('0x7')](_0x005b('0x3b'),require('./api/smsQueue'));_0x342d08['use'](_0x005b('0x3c'),require(_0x005b('0x3d')));_0x342d08['use'](_0x005b('0x3e'),require('./api/openchannelApplication'));_0x342d08[_0x005b('0x7')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x342d08[_0x005b('0x7')](_0x005b('0x3f'),require(_0x005b('0x40')));_0x342d08[_0x005b('0x7')](_0x005b('0x41'),require('./api/openchannelQueue'));_0x342d08['use'](_0x005b('0x42'),require(_0x005b('0x43')));_0x342d08[_0x005b('0x7')](_0x005b('0x44'),require(_0x005b('0x45')));_0x342d08[_0x005b('0x7')]('/api/chat/applications',require(_0x005b('0x46')));_0x342d08[_0x005b('0x7')](_0x005b('0x47'),require('./api/chatInteraction'));_0x342d08[_0x005b('0x7')](_0x005b('0x48'),require(_0x005b('0x49')));_0x342d08[_0x005b('0x7')](_0x005b('0x4a'),require(_0x005b('0x4b')));_0x342d08[_0x005b('0x7')](_0x005b('0x4c'),require(_0x005b('0x4d')));_0x342d08[_0x005b('0x7')]('/api/chat/groups',require(_0x005b('0x4e')));_0x342d08[_0x005b('0x7')]('/api/chat/proactive_actions',require(_0x005b('0x4f')));_0x342d08[_0x005b('0x7')](_0x005b('0x50'),require(_0x005b('0x51')));_0x342d08['use'](_0x005b('0x52'),require(_0x005b('0x53')));_0x342d08['use'](_0x005b('0x54'),require(_0x005b('0x55')));_0x342d08[_0x005b('0x7')](_0x005b('0x56'),require(_0x005b('0x57')));_0x342d08['use']('/api/cm/hopper_final',require(_0x005b('0x58')));_0x342d08[_0x005b('0x7')](_0x005b('0x59'),require(_0x005b('0x5a')));_0x342d08[_0x005b('0x7')]('/api/cm/custom_fields',require(_0x005b('0x5b')));_0x342d08[_0x005b('0x7')](_0x005b('0x5c'),require(_0x005b('0x5d')));_0x342d08[_0x005b('0x7')](_0x005b('0x5e'),require('./api/automation'));_0x342d08[_0x005b('0x7')]('/api/canned_answers',require(_0x005b('0x5f')));_0x342d08[_0x005b('0x7')]('/api/dispositions',require(_0x005b('0x60')));_0x342d08[_0x005b('0x7')](_0x005b('0x61'),require(_0x005b('0x62')));_0x342d08['use'](_0x005b('0x63'),require(_0x005b('0x64')));_0x342d08[_0x005b('0x7')](_0x005b('0x65'),require(_0x005b('0x66')));_0x342d08[_0x005b('0x7')](_0x005b('0x67'),require(_0x005b('0x68')));_0x342d08[_0x005b('0x7')]('/api/voiceQueuesLog',require(_0x005b('0x69')));_0x342d08[_0x005b('0x7')](_0x005b('0x6a'),require(_0x005b('0x6b')));_0x342d08[_0x005b('0x7')]('/api/sounds',require(_0x005b('0x6c')));_0x342d08[_0x005b('0x7')](_0x005b('0x6d'),require('./api/tag'));_0x342d08[_0x005b('0x7')]('/api/contact_item_types',require('./api/contactItemType'));_0x342d08['use']('/api/cm_contact_has_items',require(_0x005b('0x6e')));_0x342d08[_0x005b('0x7')](_0x005b('0x6f'),require(_0x005b('0x70')));_0x342d08['use'](_0x005b('0x71'),require(_0x005b('0x72')));_0x342d08['use'](_0x005b('0x73'),require(_0x005b('0x74')));_0x342d08[_0x005b('0x7')](_0x005b('0x75'),require(_0x005b('0x76')));_0x342d08['use'](_0x005b('0x77'),require(_0x005b('0x78')));_0x342d08[_0x005b('0x7')](_0x005b('0x79'),require(_0x005b('0x7a')));_0x342d08[_0x005b('0x7')]('/api/analytics/custom_reports',require(_0x005b('0x7b')));_0x342d08[_0x005b('0x7')](_0x005b('0x7c'),require(_0x005b('0x7d')));_0x342d08[_0x005b('0x7')](_0x005b('0x7e'),require('./api/analyticExtractedReport'));_0x342d08[_0x005b('0x7')](_0x005b('0x7f'),require('./api/analyticMetric'));_0x342d08['use'](_0x005b('0x80'),require(_0x005b('0x81')));_0x342d08[_0x005b('0x7')](_0x005b('0x82'),require(_0x005b('0x83')));_0x342d08[_0x005b('0x7')](_0x005b('0x84'),require('./api/intSalesforceAccount'));_0x342d08[_0x005b('0x7')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x342d08[_0x005b('0x7')](_0x005b('0x85'),require(_0x005b('0x86')));_0x342d08['use'](_0x005b('0x87'),require(_0x005b('0x88')));_0x342d08[_0x005b('0x7')]('/api/integrations/sugarcrm/configurations',require(_0x005b('0x89')));_0x342d08['use'](_0x005b('0x8a'),require(_0x005b('0x8b')));_0x342d08['use'](_0x005b('0x8c'),require(_0x005b('0x8d')));_0x342d08[_0x005b('0x7')](_0x005b('0x8e'),require(_0x005b('0x8f')));_0x342d08[_0x005b('0x7')]('/api/integrations/desk/fields',require(_0x005b('0x90')));_0x342d08[_0x005b('0x7')](_0x005b('0x91'),require(_0x005b('0x92')));_0x342d08[_0x005b('0x7')](_0x005b('0x93'),require('./api/intZohoConfiguration'));_0x342d08[_0x005b('0x7')]('/api/integrations/zoho/fields',require(_0x005b('0x94')));_0x342d08[_0x005b('0x7')](_0x005b('0x95'),require(_0x005b('0x96')));_0x342d08[_0x005b('0x7')](_0x005b('0x97'),require(_0x005b('0x98')));_0x342d08[_0x005b('0x7')](_0x005b('0x99'),require(_0x005b('0x9a')));_0x342d08[_0x005b('0x7')](_0x005b('0x9b'),require(_0x005b('0x9c')));_0x342d08[_0x005b('0x7')](_0x005b('0x9d'),require('./api/intFreshdeskConfiguration'));_0x342d08[_0x005b('0x7')](_0x005b('0x9e'),require(_0x005b('0x9f')));_0x342d08[_0x005b('0x7')](_0x005b('0xa0'),require(_0x005b('0xa1')));_0x342d08[_0x005b('0x7')]('/api/integrations/vtiger/configurations',require(_0x005b('0xa2')));_0x342d08['use'](_0x005b('0xa3'),require('./api/intVtigerField'));_0x342d08[_0x005b('0x7')](_0x005b('0xa4'),require('./api/intServicenowAccount'));_0x342d08[_0x005b('0x7')](_0x005b('0xa5'),require(_0x005b('0xa6')));_0x342d08[_0x005b('0x7')](_0x005b('0xa7'),require(_0x005b('0xa8')));_0x342d08[_0x005b('0x7')](_0x005b('0xa9'),require(_0x005b('0xaa')));_0x342d08[_0x005b('0x7')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x342d08[_0x005b('0x7')](_0x005b('0xab'),require(_0x005b('0xac')));_0x342d08[_0x005b('0x7')](_0x005b('0xad'),require(_0x005b('0xae')));_0x342d08[_0x005b('0x7')](_0x005b('0xaf'),require(_0x005b('0xb0')));_0x342d08[_0x005b('0x7')](_0x005b('0xb1'),require(_0x005b('0xb2')));_0x342d08[_0x005b('0x7')]('/api/networks',require(_0x005b('0xb3')));_0x342d08[_0x005b('0x7')]('/api/chat/reports/queue',require(_0x005b('0xb4')));_0x342d08[_0x005b('0x7')](_0x005b('0xb5'),require(_0x005b('0xb6')));_0x342d08[_0x005b('0x7')](_0x005b('0xb7'),require(_0x005b('0xb8')));_0x342d08[_0x005b('0x7')](_0x005b('0xb9'),require('./api/jscriptyQuestionReport'));_0x342d08[_0x005b('0x7')](_0x005b('0xba'),require(_0x005b('0xbb')));_0x342d08[_0x005b('0x7')](_0x005b('0xbc'),require(_0x005b('0xbd')));_0x342d08[_0x005b('0x7')](_0x005b('0xbe'),require(_0x005b('0xbf')));_0x342d08[_0x005b('0x7')](_0x005b('0xc0'),require(_0x005b('0xc1')));_0x342d08[_0x005b('0x7')]('/api/jscripty/projects',require(_0x005b('0xc2')));_0x342d08['use'](_0x005b('0xc3'),require('./api/setting'));_0x342d08[_0x005b('0x7')](_0x005b('0xc4'),require(_0x005b('0xc5')));_0x342d08[_0x005b('0x7')](_0x005b('0xc6'),require(_0x005b('0xc7')));_0x342d08[_0x005b('0x7')]('/api/square/recordings',require('./api/squareRecording'));_0x342d08[_0x005b('0x7')](_0x005b('0xc8'),require('./api/squareMessage'));_0x342d08[_0x005b('0x7')](_0x005b('0xc9'),require('./api/team'));_0x342d08[_0x005b('0x7')]('/api/license',require(_0x005b('0xca')));_0x342d08['use'](_0x005b('0xcb'),require(_0x005b('0xcc')));_0x342d08['use'](_0x005b('0xcd'),require(_0x005b('0xce')));_0x342d08[_0x005b('0x7')](_0x005b('0xcf'),require(_0x005b('0xd0')));_0x342d08[_0x005b('0x7')](_0x005b('0xd1'),require('./api/plugin'));_0x342d08[_0x005b('0x7')](_0x005b('0xd2'),require(_0x005b('0xd3')));_0x342d08[_0x005b('0x7')](_0x005b('0xd4'),require(_0x005b('0xd5')));_0x342d08[_0x005b('0x7')](_0x005b('0xd6'),require(_0x005b('0xd7')));_0x342d08[_0x005b('0x7')](_0x005b('0xd8'),require(_0x005b('0xd9')));_0x342d08[_0x005b('0x7')](_0x005b('0xda'),require('./api/smsTransferReport'));_0x342d08['use'](_0x005b('0xdb'),require(_0x005b('0xdc')));_0x342d08['use']('/api/voice/prefixes',require(_0x005b('0xdd')));_0x342d08[_0x005b('0x7')](_0x005b('0xde'),require(_0x005b('0xdf')));_0x342d08[_0x005b('0x7')](_0x005b('0xe0'),require(_0x005b('0xe1')));_0x342d08[_0x005b('0x7')](_0x005b('0xe2'),require(_0x005b('0xe3')));_0x342d08['use'](_0x005b('0xe4'),require('./api/userNotification'));_0x342d08[_0x005b('0x7')](_0x005b('0xe5'),require(_0x005b('0xe6')));_0x342d08['use'](_0x005b('0xe7'),require(_0x005b('0xe8')));_0x342d08[_0x005b('0x7')](_0x005b('0xe9'),require(_0x005b('0xea')));_0x342d08[_0x005b('0x7')](_0x005b('0xeb'),require('./api/whatsappMessage'));_0x342d08[_0x005b('0x7')]('/api/whatsapp/reports/queue',require(_0x005b('0xec')));_0x342d08[_0x005b('0x7')]('/api/whatsapp/reports/transfer',require(_0x005b('0xed')));_0x342d08[_0x005b('0x7')](_0x005b('0xee'),require(_0x005b('0xef')));_0x342d08[_0x005b('0x7')](_0x005b('0xf0'),require(_0x005b('0xf1')));_0x342d08[_0x005b('0x7')](_0x005b('0xf2'),require(_0x005b('0xf3')));_0x342d08[_0x005b('0x7')](_0x005b('0xf4'),require('./api/user-setting'));_0x342d08[_0x005b('0x7')](_0x005b('0xf5'),require(_0x005b('0xf6')));_0x342d08[_0x005b('0x7')](_0x005b('0xf7'),require(_0x005b('0xf8')));_0x342d08[_0x005b('0x7')](_0x005b('0xf9'),require(_0x005b('0xfa')));_0x342d08[_0x005b('0x7')](_0x005b('0xfb'),require(_0x005b('0xfc')));_0x342d08[_0x005b('0x7')](_0x005b('0xfd'),require('./api/rpc'));_0x342d08['use'](_0x005b('0xfe'),require('./api/version'));_0x342d08[_0x005b('0x7')](_0x005b('0xff'),require(_0x005b('0x100')));_0x342d08[_0x005b('0x7')](_0x005b('0x101'),require(_0x005b('0x102')));_0x342d08['use']('/api/webbar',require('./api/webbar'));_0x342d08[_0x005b('0x7')](_0x005b('0x103'),clientSideLogs);_0x342d08['use']('/apidoc',express[_0x005b('0x104')](path[_0x005b('0x105')](config[_0x005b('0x106')],_0x005b('0x107'))));_0x342d08[_0x005b('0x7')](_0x005b('0x108'),express[_0x005b('0x104')](path[_0x005b('0x105')](config[_0x005b('0x106')],'/www')));_0x342d08[_0x005b('0x7')]('/demo',express[_0x005b('0x104')](path[_0x005b('0x105')](config[_0x005b('0x106')],_0x005b('0x109'))));_0x342d08[_0x005b('0x7')](_0x005b('0x10a'),express[_0x005b('0x104')](path[_0x005b('0x105')](config['root'],'snippet',_0x005b('0x10b'))));_0x342d08[_0x005b('0x7')]('/plugins',express[_0x005b('0x104')](path['join'](config[_0x005b('0x106')],'/server/files/plugins')));_0x342d08[_0x005b('0x10c')](_0x005b('0x10d'))['get'](errors[0x194]);_0x342d08[_0x005b('0x10c')]('/*')[_0x005b('0x10e')](function(_0x5ddfee,_0xa0a519){_0xa0a519[_0x005b('0x10f')](path['resolve'](_0x342d08[_0x005b('0x10e')]('appPath')+'/index.html'));});return _0x342d08;});}; \ No newline at end of file +var _0x4711=['./api/client-side-logs','use','/api/users','./api/user','/api/voice/chanspy','/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/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxApplication','/api/fax/interactions','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./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/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','./api/realtime','./api/user-setting','/api/auth/local','/api/auth/activedirectory','./api/authActiveDirectory','/api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.5.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4711,0x10c));var _0x1471=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4711[_0x321bb2];return _0x9c12ed;};'use strict';var path=require(_0x1471('0x0'));var express=require(_0x1471('0x1'));var errors=require(_0x1471('0x2'));var config=require(_0x1471('0x3'));var setupLoggers=require(_0x1471('0x4'))[_0x1471('0x5')];var clientSideLogs=require(_0x1471('0x6'));exports['default']=function(_0x39bce4){return setupLoggers(_0x39bce4)['then'](function(){_0x39bce4[_0x1471('0x7')](_0x1471('0x8'),require(_0x1471('0x9')));_0x39bce4[_0x1471('0x7')](_0x1471('0xa'),require('./api/voiceChanSpy'));_0x39bce4[_0x1471('0x7')](_0x1471('0xb'),require(_0x1471('0xc')));_0x39bce4[_0x1471('0x7')](_0x1471('0xd'),require('./api/voiceExtension'));_0x39bce4['use'](_0x1471('0xe'),require(_0x1471('0xf')));_0x39bce4[_0x1471('0x7')](_0x1471('0x10'),require(_0x1471('0x11')));_0x39bce4[_0x1471('0x7')](_0x1471('0x12'),require(_0x1471('0x13')));_0x39bce4['use'](_0x1471('0x14'),require(_0x1471('0x15')));_0x39bce4[_0x1471('0x7')](_0x1471('0x16'),require(_0x1471('0x17')));_0x39bce4['use'](_0x1471('0x18'),require(_0x1471('0x19')));_0x39bce4[_0x1471('0x7')]('/api/voice/calls/reports',require(_0x1471('0x1a')));_0x39bce4[_0x1471('0x7')](_0x1471('0x1b'),require(_0x1471('0x1c')));_0x39bce4[_0x1471('0x7')](_0x1471('0x1d'),require(_0x1471('0x1e')));_0x39bce4[_0x1471('0x7')](_0x1471('0x1f'),require(_0x1471('0x20')));_0x39bce4[_0x1471('0x7')]('/api/members/reports',require(_0x1471('0x21')));_0x39bce4[_0x1471('0x7')](_0x1471('0x22'),require(_0x1471('0x23')));_0x39bce4[_0x1471('0x7')](_0x1471('0x24'),require(_0x1471('0x25')));_0x39bce4[_0x1471('0x7')]('/api/mail/out_servers',require(_0x1471('0x26')));_0x39bce4[_0x1471('0x7')](_0x1471('0x27'),require(_0x1471('0x28')));_0x39bce4[_0x1471('0x7')](_0x1471('0x29'),require(_0x1471('0x2a')));_0x39bce4[_0x1471('0x7')](_0x1471('0x2b'),require(_0x1471('0x2c')));_0x39bce4[_0x1471('0x7')](_0x1471('0x2d'),require(_0x1471('0x2e')));_0x39bce4[_0x1471('0x7')]('/api/mail/messages',require(_0x1471('0x2f')));_0x39bce4[_0x1471('0x7')]('/api/mail/applications',require(_0x1471('0x30')));_0x39bce4[_0x1471('0x7')](_0x1471('0x31'),require(_0x1471('0x32')));_0x39bce4['use']('/api/dashboards',require(_0x1471('0x33')));_0x39bce4[_0x1471('0x7')](_0x1471('0x34'),require(_0x1471('0x35')));_0x39bce4[_0x1471('0x7')](_0x1471('0x36'),require('./api/faxAccount'));_0x39bce4[_0x1471('0x7')]('/api/fax/applications',require(_0x1471('0x37')));_0x39bce4[_0x1471('0x7')](_0x1471('0x38'),require('./api/faxInteraction'));_0x39bce4['use'](_0x1471('0x39'),require('./api/faxMessage'));_0x39bce4['use'](_0x1471('0x3a'),require(_0x1471('0x3b')));_0x39bce4[_0x1471('0x7')](_0x1471('0x3c'),require(_0x1471('0x3d')));_0x39bce4[_0x1471('0x7')]('/api/sms/accounts',require(_0x1471('0x3e')));_0x39bce4[_0x1471('0x7')](_0x1471('0x3f'),require(_0x1471('0x40')));_0x39bce4[_0x1471('0x7')](_0x1471('0x41'),require('./api/smsInteraction'));_0x39bce4[_0x1471('0x7')](_0x1471('0x42'),require(_0x1471('0x43')));_0x39bce4[_0x1471('0x7')](_0x1471('0x44'),require('./api/smsQueue'));_0x39bce4[_0x1471('0x7')](_0x1471('0x45'),require('./api/openchannelAccount'));_0x39bce4[_0x1471('0x7')](_0x1471('0x46'),require(_0x1471('0x47')));_0x39bce4[_0x1471('0x7')](_0x1471('0x48'),require(_0x1471('0x49')));_0x39bce4[_0x1471('0x7')]('/api/openchannel/messages',require(_0x1471('0x4a')));_0x39bce4[_0x1471('0x7')]('/api/openchannel/queues',require(_0x1471('0x4b')));_0x39bce4['use'](_0x1471('0x4c'),require(_0x1471('0x4d')));_0x39bce4[_0x1471('0x7')](_0x1471('0x4e'),require('./api/openchannelQueueReport'));_0x39bce4[_0x1471('0x7')]('/api/chat/applications',require(_0x1471('0x4f')));_0x39bce4['use'](_0x1471('0x50'),require('./api/chatInteraction'));_0x39bce4[_0x1471('0x7')](_0x1471('0x51'),require(_0x1471('0x52')));_0x39bce4[_0x1471('0x7')]('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x39bce4[_0x1471('0x7')](_0x1471('0x53'),require(_0x1471('0x54')));_0x39bce4[_0x1471('0x7')](_0x1471('0x55'),require('./api/chatGroup'));_0x39bce4[_0x1471('0x7')](_0x1471('0x56'),require(_0x1471('0x57')));_0x39bce4[_0x1471('0x7')]('/api/cm/companies',require(_0x1471('0x58')));_0x39bce4[_0x1471('0x7')](_0x1471('0x59'),require(_0x1471('0x5a')));_0x39bce4['use']('/api/cm/hopper',require(_0x1471('0x5b')));_0x39bce4[_0x1471('0x7')](_0x1471('0x5c'),require('./api/cmHopperBlack'));_0x39bce4[_0x1471('0x7')](_0x1471('0x5d'),require(_0x1471('0x5e')));_0x39bce4[_0x1471('0x7')]('/api/cm/hopper_history',require(_0x1471('0x5f')));_0x39bce4['use'](_0x1471('0x60'),require(_0x1471('0x61')));_0x39bce4[_0x1471('0x7')](_0x1471('0x62'),require(_0x1471('0x63')));_0x39bce4[_0x1471('0x7')](_0x1471('0x64'),require('./api/automation'));_0x39bce4['use']('/api/canned_answers',require('./api/cannedAnswer'));_0x39bce4[_0x1471('0x7')]('/api/dispositions',require(_0x1471('0x65')));_0x39bce4['use'](_0x1471('0x66'),require(_0x1471('0x67')));_0x39bce4['use'](_0x1471('0x68'),require(_0x1471('0x69')));_0x39bce4[_0x1471('0x7')](_0x1471('0x6a'),require(_0x1471('0x6b')));_0x39bce4[_0x1471('0x7')](_0x1471('0x6c'),require(_0x1471('0x6d')));_0x39bce4['use']('/api/voiceQueuesLog',require(_0x1471('0x6e')));_0x39bce4[_0x1471('0x7')](_0x1471('0x6f'),require(_0x1471('0x70')));_0x39bce4[_0x1471('0x7')](_0x1471('0x71'),require(_0x1471('0x72')));_0x39bce4[_0x1471('0x7')](_0x1471('0x73'),require(_0x1471('0x74')));_0x39bce4[_0x1471('0x7')](_0x1471('0x75'),require(_0x1471('0x76')));_0x39bce4[_0x1471('0x7')](_0x1471('0x77'),require(_0x1471('0x78')));_0x39bce4['use'](_0x1471('0x79'),require(_0x1471('0x7a')));_0x39bce4[_0x1471('0x7')](_0x1471('0x7b'),require(_0x1471('0x7c')));_0x39bce4['use'](_0x1471('0x7d'),require(_0x1471('0x7e')));_0x39bce4[_0x1471('0x7')](_0x1471('0x7f'),require(_0x1471('0x80')));_0x39bce4['use'](_0x1471('0x81'),require(_0x1471('0x82')));_0x39bce4[_0x1471('0x7')]('/api/integrations/reports',require(_0x1471('0x83')));_0x39bce4[_0x1471('0x7')]('/api/analytics/custom_reports',require(_0x1471('0x84')));_0x39bce4[_0x1471('0x7')](_0x1471('0x85'),require(_0x1471('0x86')));_0x39bce4['use']('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x39bce4[_0x1471('0x7')](_0x1471('0x87'),require(_0x1471('0x88')));_0x39bce4[_0x1471('0x7')](_0x1471('0x89'),require(_0x1471('0x8a')));_0x39bce4['use'](_0x1471('0x8b'),require('./api/analyticTreeReport'));_0x39bce4[_0x1471('0x7')](_0x1471('0x8c'),require(_0x1471('0x8d')));_0x39bce4[_0x1471('0x7')](_0x1471('0x8e'),require('./api/intSalesforceConfiguration'));_0x39bce4[_0x1471('0x7')](_0x1471('0x8f'),require('./api/intSalesforceField'));_0x39bce4[_0x1471('0x7')](_0x1471('0x90'),require('./api/intSugarcrmAccount'));_0x39bce4[_0x1471('0x7')](_0x1471('0x91'),require(_0x1471('0x92')));_0x39bce4[_0x1471('0x7')](_0x1471('0x93'),require(_0x1471('0x94')));_0x39bce4['use'](_0x1471('0x95'),require('./api/intDeskAccount'));_0x39bce4['use'](_0x1471('0x96'),require('./api/intDeskConfiguration'));_0x39bce4[_0x1471('0x7')](_0x1471('0x97'),require(_0x1471('0x98')));_0x39bce4[_0x1471('0x7')](_0x1471('0x99'),require(_0x1471('0x9a')));_0x39bce4[_0x1471('0x7')](_0x1471('0x9b'),require(_0x1471('0x9c')));_0x39bce4[_0x1471('0x7')](_0x1471('0x9d'),require('./api/intZohoField'));_0x39bce4[_0x1471('0x7')](_0x1471('0x9e'),require(_0x1471('0x9f')));_0x39bce4[_0x1471('0x7')]('/api/integrations/zendesk/configurations',require(_0x1471('0xa0')));_0x39bce4[_0x1471('0x7')](_0x1471('0xa1'),require(_0x1471('0xa2')));_0x39bce4['use']('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x39bce4[_0x1471('0x7')]('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x39bce4[_0x1471('0x7')](_0x1471('0xa3'),require(_0x1471('0xa4')));_0x39bce4['use']('/api/integrations/vtiger/accounts',require(_0x1471('0xa5')));_0x39bce4[_0x1471('0x7')]('/api/integrations/vtiger/configurations',require(_0x1471('0xa6')));_0x39bce4[_0x1471('0x7')](_0x1471('0xa7'),require(_0x1471('0xa8')));_0x39bce4[_0x1471('0x7')]('/api/integrations/servicenow/accounts',require(_0x1471('0xa9')));_0x39bce4[_0x1471('0x7')](_0x1471('0xaa'),require(_0x1471('0xab')));_0x39bce4[_0x1471('0x7')](_0x1471('0xac'),require(_0x1471('0xad')));_0x39bce4[_0x1471('0x7')](_0x1471('0xae'),require('./api/intDynamics365Account'));_0x39bce4['use'](_0x1471('0xaf'),require(_0x1471('0xb0')));_0x39bce4[_0x1471('0x7')](_0x1471('0xb1'),require(_0x1471('0xb2')));_0x39bce4[_0x1471('0x7')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x39bce4[_0x1471('0x7')](_0x1471('0xb3'),require(_0x1471('0xb4')));_0x39bce4['use'](_0x1471('0xb5'),require(_0x1471('0xb6')));_0x39bce4[_0x1471('0x7')](_0x1471('0xb7'),require(_0x1471('0xb8')));_0x39bce4['use'](_0x1471('0xb9'),require(_0x1471('0xba')));_0x39bce4[_0x1471('0x7')](_0x1471('0xbb'),require(_0x1471('0xbc')));_0x39bce4[_0x1471('0x7')](_0x1471('0xbd'),require(_0x1471('0xbe')));_0x39bce4[_0x1471('0x7')](_0x1471('0xbf'),require(_0x1471('0xc0')));_0x39bce4[_0x1471('0x7')](_0x1471('0xc1'),require(_0x1471('0xc2')));_0x39bce4[_0x1471('0x7')](_0x1471('0xc3'),require(_0x1471('0xc4')));_0x39bce4['use'](_0x1471('0xc5'),require(_0x1471('0xc6')));_0x39bce4['use'](_0x1471('0xc7'),require(_0x1471('0xc8')));_0x39bce4[_0x1471('0x7')](_0x1471('0xc9'),require(_0x1471('0xca')));_0x39bce4[_0x1471('0x7')](_0x1471('0xcb'),require(_0x1471('0xcc')));_0x39bce4[_0x1471('0x7')]('/api/square/odbc',require(_0x1471('0xcd')));_0x39bce4['use'](_0x1471('0xce'),require(_0x1471('0xcf')));_0x39bce4[_0x1471('0x7')](_0x1471('0xd0'),require(_0x1471('0xd1')));_0x39bce4['use'](_0x1471('0xd2'),require('./api/squareMessage'));_0x39bce4[_0x1471('0x7')]('/api/teams',require('./api/team'));_0x39bce4[_0x1471('0x7')](_0x1471('0xd3'),require(_0x1471('0xd4')));_0x39bce4['use'](_0x1471('0xd5'),require(_0x1471('0xd6')));_0x39bce4[_0x1471('0x7')](_0x1471('0xd7'),require('./api/migration'));_0x39bce4['use'](_0x1471('0xd8'),require('./api/attachment'));_0x39bce4[_0x1471('0x7')](_0x1471('0xd9'),require(_0x1471('0xda')));_0x39bce4[_0x1471('0x7')](_0x1471('0xdb'),require('./api/mailTransferReport'));_0x39bce4[_0x1471('0x7')]('/api/chat/reports/transfer',require(_0x1471('0xdc')));_0x39bce4[_0x1471('0x7')]('/api/fax/reports/transfer',require(_0x1471('0xdd')));_0x39bce4[_0x1471('0x7')](_0x1471('0xde'),require('./api/openchannelTransferReport'));_0x39bce4[_0x1471('0x7')](_0x1471('0xdf'),require(_0x1471('0xe0')));_0x39bce4[_0x1471('0x7')](_0x1471('0xe1'),require(_0x1471('0xe2')));_0x39bce4[_0x1471('0x7')](_0x1471('0xe3'),require(_0x1471('0xe4')));_0x39bce4['use'](_0x1471('0xe5'),require(_0x1471('0xe6')));_0x39bce4['use'](_0x1471('0xe7'),require('./api/userProfileSection'));_0x39bce4['use'](_0x1471('0xe8'),require('./api/userProfileResource'));_0x39bce4[_0x1471('0x7')](_0x1471('0xe9'),require('./api/userNotification'));_0x39bce4[_0x1471('0x7')](_0x1471('0xea'),require(_0x1471('0xeb')));_0x39bce4['use'](_0x1471('0xec'),require('./api/whatsappApplication'));_0x39bce4[_0x1471('0x7')](_0x1471('0xed'),require(_0x1471('0xee')));_0x39bce4[_0x1471('0x7')](_0x1471('0xef'),require('./api/whatsappMessage'));_0x39bce4[_0x1471('0x7')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x39bce4[_0x1471('0x7')](_0x1471('0xf0'),require(_0x1471('0xf1')));_0x39bce4[_0x1471('0x7')](_0x1471('0xf2'),require('./api/whatsappQueue'));_0x39bce4[_0x1471('0x7')](_0x1471('0xf3'),require(_0x1471('0xf4')));_0x39bce4['use']('/api/realtime',require(_0x1471('0xf5')));_0x39bce4[_0x1471('0x7')]('/api/user-settings',require(_0x1471('0xf6')));_0x39bce4[_0x1471('0x7')](_0x1471('0xf7'),require('./api/authLocal'));_0x39bce4[_0x1471('0x7')]('/api/auth/google',require('./api/authGoogle'));_0x39bce4['use'](_0x1471('0xf8'),require(_0x1471('0xf9')));_0x39bce4[_0x1471('0x7')]('/api/jira',require('./api/jira'));_0x39bce4[_0x1471('0x7')](_0x1471('0xfa'),require('./api/rpc'));_0x39bce4['use']('/api/version',require(_0x1471('0xfb')));_0x39bce4[_0x1471('0x7')](_0x1471('0xfc'),require(_0x1471('0xfd')));_0x39bce4[_0x1471('0x7')](_0x1471('0xfe'),require(_0x1471('0xff')));_0x39bce4[_0x1471('0x7')]('/api/webbar',require(_0x1471('0x100')));_0x39bce4[_0x1471('0x7')]('/api/logs',clientSideLogs);_0x39bce4[_0x1471('0x7')](_0x1471('0x101'),express[_0x1471('0x102')](path[_0x1471('0x103')](config[_0x1471('0x104')],_0x1471('0x101'))));_0x39bce4[_0x1471('0x7')](_0x1471('0x105'),express[_0x1471('0x102')](path[_0x1471('0x103')](config[_0x1471('0x104')],'/www')));_0x39bce4['use'](_0x1471('0x106'),express['static'](path[_0x1471('0x103')](config[_0x1471('0x104')],_0x1471('0x106'))));_0x39bce4['use'](_0x1471('0x107'),express[_0x1471('0x102')](path[_0x1471('0x103')](config['root'],_0x1471('0x108'),_0x1471('0x109'))));_0x39bce4['use'](_0x1471('0x10a'),express[_0x1471('0x102')](path[_0x1471('0x103')](config['root'],_0x1471('0x10b'))));_0x39bce4[_0x1471('0x10c')](_0x1471('0x10d'))[_0x1471('0x10e')](errors[0x194]);_0x39bce4[_0x1471('0x10c')]('/*')['get'](function(_0x11328b,_0x87d4ef){_0x87d4ef[_0x1471('0x10f')](path['resolve'](_0x39bce4[_0x1471('0x10e')](_0x1471('0x110'))+_0x1471('0x111')));});return _0x39bce4;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index d3623c6..81df0da 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac8f=['../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.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/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc'];(function(_0x65625b,_0x73e088){var _0x140f13=function(_0x1c3a28){while(--_0x1c3a28){_0x65625b['push'](_0x65625b['shift']());}};_0x140f13(++_0x73e088);}(_0xac8f,0x1d6));var _0xfac8=function(_0x4afac5,_0x1ab4ed){_0x4afac5=_0x4afac5-0x0;var _0x2404b3=_0xac8f[_0x4afac5];return _0x2404b3;};'use strict';var jayson=require(_0xfac8('0x0'));var _=require(_0xfac8('0x1'));var config=require(_0xfac8('0x2'));exports[_0xfac8('0x3')]=function(){return new Promise(function(_0x38a145,_0xa1b2b0){var _0x133ae3={};_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x5')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x6')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x7')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x8')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x9')));_0x133ae3=_['merge'](_0x133ae3,require(_0xfac8('0xa')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0xb')));_0x133ae3=_['merge'](_0x133ae3,require(_0xfac8('0xc')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0xd')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require('../api/trunk/trunk.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0xe')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0xf')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x10')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x11')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require('../api/mailQueue/mailQueue.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require('../api/mailInteraction/mailInteraction.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x12')));_0x133ae3=_['merge'](_0x133ae3,require('../api/mailApplication/mailApplication.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x13')));_0x133ae3=_['merge'](_0x133ae3,require(_0xfac8('0x14')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x15')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x16')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x17')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x18')));_0x133ae3=_['merge'](_0x133ae3,require(_0xfac8('0x19')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x1a')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x1b')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x1c')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require('../api/smsQueue/smsQueue.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x1d')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x1e')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x1f')));_0x133ae3=_['merge'](_0x133ae3,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x20')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require('../api/chatMessage/chatMessage.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x21')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x22')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require('../api/cmHopper/cmHopper.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x23')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x24')));_0x133ae3=_['merge'](_0x133ae3,require(_0xfac8('0x25')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x26')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x27')));_0x133ae3=_['merge'](_0x133ae3,require('../api/pause/pause.rpc'));_0x133ae3=_['merge'](_0x133ae3,require(_0xfac8('0x28')));_0x133ae3=_['merge'](_0x133ae3,require(_0xfac8('0x29')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x2a')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x2b')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require('../api/variable/variable.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x133ae3=_['merge'](_0x133ae3,require(_0xfac8('0x2c')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x2d')));_0x133ae3=_['merge'](_0x133ae3,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x2e')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x2f')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x30')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x31')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x32')));_0x133ae3=_['merge'](_0x133ae3,require('../api/squareReport/squareReport.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x33')));_0x133ae3=_['merge'](_0x133ae3,require(_0xfac8('0x34')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x35')));_0x133ae3=_['merge'](_0x133ae3,require(_0xfac8('0x36')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x37')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x38')));_0x133ae3=_['merge'](_0x133ae3,require(_0xfac8('0x39')));_0x133ae3=_['merge'](_0x133ae3,require('../api/plugin/plugin.rpc'));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x3a')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x3b')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x3c')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x3d')));_0x133ae3=_[_0xfac8('0x4')](_0x133ae3,require(_0xfac8('0x3e')));var _0x415a8a=jayson[_0xfac8('0x3f')](_0x133ae3)['http']();var _0x380da3=config[_0xfac8('0x40')]['port']||config[_0xfac8('0x41')]+0x1;var _0xf810e2=config[_0xfac8('0x40')]['ip']||'localhost';_0x415a8a['on']('error',function(_0x920cc3){return _0xa1b2b0(_0x920cc3);});_0x415a8a[_0xfac8('0x3')](_0x380da3,_0xf810e2,function(){console['log'](_0xfac8('0x42'),_0xf810e2,_0x380da3);require(_0xfac8('0x43'))[_0xfac8('0x44')]();return _0x38a145('RPC\x20listening\x20on\x20'+_0xf810e2+':'+_0x380da3);});});}; \ No newline at end of file +var _0xc12c=['../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc12c,0xb3));var _0xcc12=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xc12c[_0x5ddb1c];return _0x354adc;};'use strict';var jayson=require(_0xcc12('0x0'));var _=require('lodash');var config=require(_0xcc12('0x1'));exports[_0xcc12('0x2')]=function(){return new Promise(function(_0x16eee4,_0x468301){var _0x2a97b9={};_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x4')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x5')));_0x2a97b9=_['merge'](_0x2a97b9,require(_0xcc12('0x6')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x7')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x8')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x9')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0xa')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0xb')));_0x2a97b9=_['merge'](_0x2a97b9,require(_0xcc12('0xc')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0xd')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0xe')));_0x2a97b9=_['merge'](_0x2a97b9,require('../api/mailServerIn/mailServerIn.rpc'));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0xf')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/mailQueue/mailQueue.rpc'));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x10')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/mailMessage/mailMessage.rpc'));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x11')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x12')));_0x2a97b9=_['merge'](_0x2a97b9,require(_0xcc12('0x13')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/faxInteraction/faxInteraction.rpc'));_0x2a97b9=_['merge'](_0x2a97b9,require(_0xcc12('0x14')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x15')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x16')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x17')));_0x2a97b9=_['merge'](_0x2a97b9,require('../api/smsInteraction/smsInteraction.rpc'));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x18')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x19')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x1a')));_0x2a97b9=_['merge'](_0x2a97b9,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x2a97b9=_['merge'](_0x2a97b9,require(_0xcc12('0x1b')));_0x2a97b9=_['merge'](_0x2a97b9,require(_0xcc12('0x1c')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x1d')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x1e')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x1f')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x20')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/cmHopper/cmHopper.rpc'));_0x2a97b9=_['merge'](_0x2a97b9,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x21')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x2a97b9=_['merge'](_0x2a97b9,require(_0xcc12('0x22')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x23')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x24')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x25')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x26')));_0x2a97b9=_['merge'](_0x2a97b9,require(_0xcc12('0x27')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x28')));_0x2a97b9=_['merge'](_0x2a97b9,require(_0xcc12('0x29')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x2a')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x2b')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x2c')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x2d')));_0x2a97b9=_['merge'](_0x2a97b9,require(_0xcc12('0x2e')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x2f')));_0x2a97b9=_['merge'](_0x2a97b9,require(_0xcc12('0x30')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x31')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x32')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x33')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/squareOdbc/squareOdbc.rpc'));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x34')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x35')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/squareMessage/squareMessage.rpc'));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x36')));_0x2a97b9=_['merge'](_0x2a97b9,require(_0xcc12('0x37')));_0x2a97b9=_['merge'](_0x2a97b9,require(_0xcc12('0x38')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x39')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x3a')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require(_0xcc12('0x3b')));_0x2a97b9=_[_0xcc12('0x3')](_0x2a97b9,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x4cac42=jayson[_0xcc12('0x3c')](_0x2a97b9)[_0xcc12('0x3d')]();var _0xd26d65=config[_0xcc12('0x3e')][_0xcc12('0x3f')]||config[_0xcc12('0x3f')]+0x1;var _0x532bd4=config[_0xcc12('0x3e')]['ip']||_0xcc12('0x40');_0x4cac42['on'](_0xcc12('0x41'),function(_0x50f4f4){return _0x468301(_0x50f4f4);});_0x4cac42[_0xcc12('0x2')](_0xd26d65,_0x532bd4,function(){console[_0xcc12('0x42')](_0xcc12('0x43'),_0x532bd4,_0xd26d65);require(_0xcc12('0x44'))['default']();return _0x16eee4(_0xcc12('0x45')+_0x532bd4+':'+_0xd26d65);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 5db18f3..c88548a 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 _0xa59a=['extension','setExtension','setPriority','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./error','call','setEncoding','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','timeout','pipe','write','destroy','inherits','prototype','sendRequest','command','answer','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','continueAt'];(function(_0x259dbe,_0x1cb9f4){var _0x2e0f46=function(_0x4c7823){while(--_0x4c7823){_0x259dbe['push'](_0x259dbe['shift']());}};_0x2e0f46(++_0x1cb9f4);}(_0xa59a,0x1d2));var _0xaa59=function(_0x2a22a5,_0x15ffe5){_0x2a22a5=_0x2a22a5-0x0;var _0x2b9450=_0xa59a[_0x2a22a5];return _0x2b9450;};'use strict';var util=require(_0xaa59('0x0'));var _=require(_0xaa59('0x1'));var EventEmitter=require(_0xaa59('0x2'))[_0xaa59('0x3')];var AGIReply=require('./reply');var AGIError=require(_0xaa59('0x4'));function AGIChannel(_0x2305fe){var _0x4999d9=this,_0x44d41f=new AGIReply(),_0x38bbae=![],_0x57f84e={};EventEmitter[_0xaa59('0x5')](_0x4999d9);_0x2305fe[_0xaa59('0x6')]('utf8');_0x2305fe['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x44d41f[_0xaa59('0x6')](_0xaa59('0x7'));_0x44d41f['on'](_0xaa59('0x8'),function(_0x5505c2){for(var _0x43cee1 in _0x5505c2){_0x4999d9[_0x43cee1]=_0x5505c2[_0x43cee1];}_0x4999d9[_0xaa59('0x9')](_0xaa59('0xa'));});_0x44d41f['on'](_0xaa59('0xb'),function(_0xdeb176){if(_0xdeb176[_0xaa59('0xc')]()==_0xaa59('0xd')){_0x4999d9[_0xaa59('0x9')](_0xaa59('0xd'));return;}if(_0xdeb176[_0xaa59('0xe')](0x0,0xb)==_0xaa59('0xf')){_0x38bbae=!![];}if(_0x38bbae){_0x57f84e['rx']+=_0xdeb176+'\x0a';if(_0xdeb176['search'](_0xaa59('0x10'))!=-0x1){_0x38bbae=![];}}else{_0x57f84e['rx']=_0xdeb176;}if(_0x38bbae){return;}if(typeof _0x57f84e['cb']==_0xaa59('0x11')){var _0x35bcfb=_0x57f84e['rx'][_0xaa59('0xe')](0x0,0x3),_0x3a87fb=null,_0x5be068=null;_0x35bcfb=parseInt(_0x35bcfb);if(isNaN(_0x35bcfb)){_0x57f84e['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xaa59('0x12')});return;}if(_0x35bcfb!=0xc8){_0x57f84e['cb'](null,{'code':_0x35bcfb,'result':-0x1,'extra':'KO'});return;}_0x3a87fb=_0x57f84e['rx'][_0xaa59('0xe')](0x4)['replace']('result=','');if(_0x3a87fb[_0xaa59('0x13')]('\x20')!=-0x1){_0x3a87fb=_0x3a87fb[_0xaa59('0x14')](0x0,_0x3a87fb[_0xaa59('0x13')]('\x20'));}if(_[_0xaa59('0x15')](_0x3a87fb,'-1')){_0x3a87fb=parseInt(_0x3a87fb);}_0x5be068=_0x57f84e['rx'][_0xaa59('0x16')]('\x20');if(_0x5be068[_0xaa59('0x17')]==0x3){_0x5be068=_0x5be068[0x2]['substring'](0x1,_0x5be068[0x2][_0xaa59('0x17')]-0x1);}else if(_0x5be068[_0xaa59('0x17')]>0x3){var _0x3c0f1f=/\((.+)\)/;var _0x227e8e=_0x57f84e['rx']['match'](_0x3c0f1f);if(_0x227e8e){_0x5be068=_0x227e8e[0x1];}else{_0x5be068=null;}}else{_0x5be068=null;}_0x57f84e['cb'](null,{'code':_0x35bcfb,'result':_0x3a87fb,'extra':_0x5be068});}});_0x2305fe['on']('error',function(_0x1f03e6){_0x4999d9[_0xaa59('0x9')](_0xaa59('0x18'),new AGIError(_0xaa59('0x19'),_0x1f03e6[_0xaa59('0x1a')]));});_0x2305fe['on']('close',function(){_0x4999d9[_0xaa59('0x9')](_0xaa59('0x1b'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x2305fe['on'](_0xaa59('0x1c'),function(){_0x4999d9[_0xaa59('0x9')]('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x2305fe['destroy']();});_0x2305fe[_0xaa59('0x1d')](_0x44d41f);this['command']=function(_0x15e402,_0x5b8547){var _0x15e402=_0x15e402||'',_0x5b8547=typeof _0x5b8547==_0xaa59('0x11')?_0x5b8547:new Function();_0x57f84e={'tx':_0x15e402,'rx':'','cb':_0x5b8547};_0x2305fe[_0xaa59('0x1e')](_0x15e402+'\x0a');},this[_0xaa59('0x1b')]=function(){_0x2305fe[_0xaa59('0x1f')]();};}util[_0xaa59('0x20')](AGIChannel,EventEmitter);AGIChannel[_0xaa59('0x21')][_0xaa59('0x22')]=function(_0x3d7a74){return this[_0xaa59('0x23')]['sync'](this,_0x3d7a74);};AGIChannel['prototype'][_0xaa59('0x24')]=function(){return this['sendRequest']('ANSWER');};AGIChannel['prototype']['getData']=function(_0xfd9b23,_0x521b1c,_0x1caf1d){_0xfd9b23=_0xfd9b23===undefined?_0xaa59('0x25'):_0xfd9b23;_0x521b1c=_0x521b1c===undefined?'5':_0x521b1c;_0x1caf1d=_0x1caf1d===undefined?'1':_0x1caf1d;return this[_0xaa59('0x22')](util[_0xaa59('0x26')](_0xaa59('0x27'),_0xfd9b23,_0x521b1c*0x3e8,_0x1caf1d));};AGIChannel[_0xaa59('0x21')][_0xaa59('0x28')]=function(_0x461b72){_0x461b72=_0x461b72||'NO\x20MESSAGE';return this[_0xaa59('0x22')](util[_0xaa59('0x26')](_0xaa59('0x29'),_0x461b72));};AGIChannel['prototype'][_0xaa59('0x2a')]=function(_0x2b718d,_0x4ed2a3){if(_[_0xaa59('0x2b')](_0x4ed2a3)){return this['sendRequest'](util[_0xaa59('0x26')]('EXEC\x20%s\x20%s',_0x2b718d,_0x4ed2a3[_0xaa59('0x2c')](',')));}return this[_0xaa59('0x22')](util['format'](_0xaa59('0x2d'),_0x2b718d,_0x4ed2a3));};AGIChannel[_0xaa59('0x21')][_0xaa59('0x2e')]=function(_0xe34779){return this['sendRequest'](util['format'](_0xaa59('0x2f'),_0xe34779));};AGIChannel[_0xaa59('0x21')]['setExtension']=function(_0x59b6ae){return this['sendRequest'](util[_0xaa59('0x26')](_0xaa59('0x30'),_0x59b6ae));};AGIChannel['prototype']['setPriority']=function(_0x411000){return this['sendRequest'](util[_0xaa59('0x26')](_0xaa59('0x31'),_0x411000));};AGIChannel[_0xaa59('0x21')][_0xaa59('0xd')]=function(){return this[_0xaa59('0x22')](_0xaa59('0x32'));};AGIChannel[_0xaa59('0x21')][_0xaa59('0x33')]=function(_0x3bb1c7,_0x49180b){var _0x33b16d=_[_0xaa59('0x34')](_0x49180b)||_['isNumber'](_0x49180b)?_0x49180b['toString']():_0x49180b;return this['sendRequest'](util[_0xaa59('0x26')](_0xaa59('0x35'),_0x3bb1c7,_0x33b16d?_0x33b16d['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xaa59('0x36')]=function(_0x35baf9,_0x45ba46){return this[_0xaa59('0x22')](util[_0xaa59('0x26')](_0xaa59('0x37'),_0x35baf9,_0x45ba46));};AGIChannel[_0xaa59('0x21')][_0xaa59('0x38')]=function(_0x304a21,_0x403007){return this[_0xaa59('0x22')](util[_0xaa59('0x26')]('SAY\x20DIGITS\x20%s\x20%s',_0x304a21,_0x403007));};AGIChannel[_0xaa59('0x21')][_0xaa59('0x39')]=function(_0x49377b,_0x1cbb26){return this[_0xaa59('0x22')](util[_0xaa59('0x26')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x49377b,_0x1cbb26));};AGIChannel[_0xaa59('0x21')][_0xaa59('0x3a')]=function(_0x4fa16c,_0x3b6857,_0x465945){_0x3b6857=_0x3b6857||this[_0xaa59('0x3b')];_0x465945=_0x465945||0x1;this['setContext'](_0x4fa16c);this[_0xaa59('0x3c')](_0x3b6857);this[_0xaa59('0x3d')](_0x465945);return this[_0xaa59('0x28')](util[_0xaa59('0x26')](_0xaa59('0x3e'),_0x4fa16c,_0x3b6857,_0x465945));};AGIChannel[_0xaa59('0x21')]['getVariable']=function(_0x163c1f){return this['sendRequest'](util[_0xaa59('0x26')](_0xaa59('0x3f'),_0x163c1f));};AGIChannel[_0xaa59('0x21')][_0xaa59('0x40')]=function(_0x402f39,_0x503ef1,_0x36c298,_0x363103,_0x2e2402,_0x1d4fff){_0x503ef1=_0x503ef1||_0xaa59('0x41');_0x36c298=_0x36c298||'';_0x363103=_0x363103===undefined?-0x1:_0x363103==='-1'?-0x1:_0x363103*0x3e8;_0x2e2402=_0x2e2402===undefined?'':'s='+_0x2e2402;_0x1d4fff=_0x1d4fff?_0xaa59('0x42'):'';return this[_0xaa59('0x22')](util[_0xaa59('0x26')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x402f39,_0x503ef1,_0x36c298,_0x363103,_0x1d4fff,_0x2e2402));};AGIChannel[_0xaa59('0x21')]['streamFile']=function(_0x3c41d9,_0x26f983){_0x26f983=_0x26f983||'';return this[_0xaa59('0x22')](util[_0xaa59('0x26')](_0xaa59('0x43'),_0x3c41d9,_0x26f983));};AGIChannel[_0xaa59('0x21')][_0xaa59('0x44')]=function(_0x2579bd){return this[_0xaa59('0x2a')](_0xaa59('0x45'),_0x2579bd);};AGIChannel['prototype'][_0xaa59('0x46')]=function(_0xcb0740){return this[_0xaa59('0x2a')](_0xaa59('0x47'),_0xcb0740);};AGIChannel['prototype'][_0xaa59('0x18')]=function(_0x1d9b2d,_0xd72493){this[_0xaa59('0x28')](util[_0xaa59('0x26')](_0xaa59('0x48'),_0x1d9b2d['id'],_0x1d9b2d[_0xaa59('0x49')],_0xd72493));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xaa59('0x4a')]=AGIChannel; \ No newline at end of file +var _0xe1d1=['sendRequest','ANSWER','getData','beep','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','HANGUP','isNumber','toString','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','extension','setContext','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','EventEmitter','./reply','./error','call','setEncoding','utf8','headers','emit','line','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','result=','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','write','prototype','command','sync'];(function(_0xa04ad4,_0x168721){var _0x2dbc34=function(_0x17018b){while(--_0x17018b){_0xa04ad4['push'](_0xa04ad4['shift']());}};_0x2dbc34(++_0x168721);}(_0xe1d1,0x131));var _0x1e1d=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xe1d1[_0x22b68a];return _0x1ac67a;};'use strict';var util=require(_0x1e1d('0x0'));var _=require(_0x1e1d('0x1'));var EventEmitter=require('events')[_0x1e1d('0x2')];var AGIReply=require(_0x1e1d('0x3'));var AGIError=require(_0x1e1d('0x4'));function AGIChannel(_0x1568c1){var _0x543765=this,_0x22b1e4=new AGIReply(),_0x463159=![],_0x1c8bfa={};EventEmitter[_0x1e1d('0x5')](_0x543765);_0x1568c1[_0x1e1d('0x6')](_0x1e1d('0x7'));_0x1568c1['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x22b1e4[_0x1e1d('0x6')](_0x1e1d('0x7'));_0x22b1e4['on'](_0x1e1d('0x8'),function(_0x3691a7){for(var _0x43277f in _0x3691a7){_0x543765[_0x43277f]=_0x3691a7[_0x43277f];}_0x543765[_0x1e1d('0x9')]('ready');});_0x22b1e4['on'](_0x1e1d('0xa'),function(_0x446c8a){if(_0x446c8a[_0x1e1d('0xb')]()==_0x1e1d('0xc')){_0x543765[_0x1e1d('0x9')](_0x1e1d('0xc'));return;}if(_0x446c8a[_0x1e1d('0xd')](0x0,0xb)=='520-Invalid'){_0x463159=!![];}if(_0x463159){_0x1c8bfa['rx']+=_0x446c8a+'\x0a';if(_0x446c8a[_0x1e1d('0xe')](_0x1e1d('0xf'))!=-0x1){_0x463159=![];}}else{_0x1c8bfa['rx']=_0x446c8a;}if(_0x463159){return;}if(typeof _0x1c8bfa['cb']==_0x1e1d('0x10')){var _0x1c209d=_0x1c8bfa['rx'][_0x1e1d('0xd')](0x0,0x3),_0x37fd79=null,_0x5b5449=null;_0x1c209d=parseInt(_0x1c209d);if(isNaN(_0x1c209d)){_0x1c8bfa['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1e1d('0x11')});return;}if(_0x1c209d!=0xc8){_0x1c8bfa['cb'](null,{'code':_0x1c209d,'result':-0x1,'extra':'KO'});return;}_0x37fd79=_0x1c8bfa['rx'][_0x1e1d('0xd')](0x4)['replace'](_0x1e1d('0x12'),'');if(_0x37fd79[_0x1e1d('0x13')]('\x20')!=-0x1){_0x37fd79=_0x37fd79[_0x1e1d('0x14')](0x0,_0x37fd79[_0x1e1d('0x13')]('\x20'));}if(_[_0x1e1d('0x15')](_0x37fd79,'-1')){_0x37fd79=parseInt(_0x37fd79);}_0x5b5449=_0x1c8bfa['rx']['split']('\x20');if(_0x5b5449[_0x1e1d('0x16')]==0x3){_0x5b5449=_0x5b5449[0x2][_0x1e1d('0xd')](0x1,_0x5b5449[0x2][_0x1e1d('0x16')]-0x1);}else if(_0x5b5449[_0x1e1d('0x16')]>0x3){var _0x2139f2=/\((.+)\)/;var _0x34f061=_0x1c8bfa['rx'][_0x1e1d('0x17')](_0x2139f2);if(_0x34f061){_0x5b5449=_0x34f061[0x1];}else{_0x5b5449=null;}}else{_0x5b5449=null;}_0x1c8bfa['cb'](null,{'code':_0x1c209d,'result':_0x37fd79,'extra':_0x5b5449});}});_0x1568c1['on'](_0x1e1d('0x18'),function(_0x48d79f){_0x543765[_0x1e1d('0x9')]('error',new AGIError(_0x1e1d('0x19'),_0x48d79f['code']));});_0x1568c1['on'](_0x1e1d('0x1a'),function(){_0x543765[_0x1e1d('0x9')](_0x1e1d('0x1a'),new AGIError(_0x1e1d('0x1b')));});_0x1568c1['on'](_0x1e1d('0x1c'),function(){_0x543765['emit'](_0x1e1d('0x1c'),new AGIError(_0x1e1d('0x1d')));_0x1568c1[_0x1e1d('0x1e')]();});_0x1568c1['pipe'](_0x22b1e4);this['command']=function(_0x747fc7,_0x24b1bb){var _0x747fc7=_0x747fc7||'',_0x24b1bb=typeof _0x24b1bb==_0x1e1d('0x10')?_0x24b1bb:new Function();_0x1c8bfa={'tx':_0x747fc7,'rx':'','cb':_0x24b1bb};_0x1568c1[_0x1e1d('0x1f')](_0x747fc7+'\x0a');},this[_0x1e1d('0x1a')]=function(){_0x1568c1[_0x1e1d('0x1e')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x1e1d('0x20')]['sendRequest']=function(_0x5f05f1){return this[_0x1e1d('0x21')][_0x1e1d('0x22')](this,_0x5f05f1);};AGIChannel['prototype']['answer']=function(){return this[_0x1e1d('0x23')](_0x1e1d('0x24'));};AGIChannel['prototype'][_0x1e1d('0x25')]=function(_0x17122f,_0xdc69ee,_0x4427e9){_0x17122f=_0x17122f===undefined?_0x1e1d('0x26'):_0x17122f;_0xdc69ee=_0xdc69ee===undefined?'5':_0xdc69ee;_0x4427e9=_0x4427e9===undefined?'1':_0x4427e9;return this[_0x1e1d('0x23')](util[_0x1e1d('0x27')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x17122f,_0xdc69ee*0x3e8,_0x4427e9));};AGIChannel[_0x1e1d('0x20')][_0x1e1d('0x28')]=function(_0x3f93b8){_0x3f93b8=_0x3f93b8||_0x1e1d('0x29');return this['sendRequest'](util['format'](_0x1e1d('0x2a'),_0x3f93b8));};AGIChannel[_0x1e1d('0x20')][_0x1e1d('0x2b')]=function(_0x57cd79,_0x2ddcc2){if(_['isArray'](_0x2ddcc2)){return this[_0x1e1d('0x23')](util[_0x1e1d('0x27')](_0x1e1d('0x2c'),_0x57cd79,_0x2ddcc2[_0x1e1d('0x2d')](',')));}return this[_0x1e1d('0x23')](util[_0x1e1d('0x27')](_0x1e1d('0x2c'),_0x57cd79,_0x2ddcc2));};AGIChannel['prototype']['setContext']=function(_0x1e5937){return this['sendRequest'](util['format'](_0x1e1d('0x2e'),_0x1e5937));};AGIChannel[_0x1e1d('0x20')][_0x1e1d('0x2f')]=function(_0x517036){return this[_0x1e1d('0x23')](util[_0x1e1d('0x27')](_0x1e1d('0x30'),_0x517036));};AGIChannel['prototype']['setPriority']=function(_0x1db528){return this[_0x1e1d('0x23')](util[_0x1e1d('0x27')]('SET\x20PRIORITY\x20%s',_0x1db528));};AGIChannel['prototype'][_0x1e1d('0xc')]=function(){return this[_0x1e1d('0x23')](_0x1e1d('0x31'));};AGIChannel[_0x1e1d('0x20')]['setVariable']=function(_0x13c72c,_0x48e67d){var _0x2fa92e=_['isBoolean'](_0x48e67d)||_[_0x1e1d('0x32')](_0x48e67d)?_0x48e67d[_0x1e1d('0x33')]():_0x48e67d;return this[_0x1e1d('0x23')](util[_0x1e1d('0x27')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x13c72c,_0x2fa92e?_0x2fa92e[_0x1e1d('0x33')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1e1d('0x20')]['sayNumber']=function(_0x3917b2,_0x2cd83d){return this[_0x1e1d('0x23')](util[_0x1e1d('0x27')]('SAY\x20NUMBER\x20%s\x20%s',_0x3917b2,_0x2cd83d));};AGIChannel['prototype']['sayDigits']=function(_0x2dbd33,_0x25394b){return this['sendRequest'](util[_0x1e1d('0x27')](_0x1e1d('0x34'),_0x2dbd33,_0x25394b));};AGIChannel[_0x1e1d('0x20')][_0x1e1d('0x35')]=function(_0x5a0def,_0x1b83b8){return this[_0x1e1d('0x23')](util[_0x1e1d('0x27')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x5a0def,_0x1b83b8));};AGIChannel[_0x1e1d('0x20')]['continueAt']=function(_0x15bc60,_0x85dd20,_0x57187b){_0x85dd20=_0x85dd20||this[_0x1e1d('0x36')];_0x57187b=_0x57187b||0x1;this[_0x1e1d('0x37')](_0x15bc60);this[_0x1e1d('0x2f')](_0x85dd20);this[_0x1e1d('0x38')](_0x57187b);return this[_0x1e1d('0x28')](util['format'](_0x1e1d('0x39'),_0x15bc60,_0x85dd20,_0x57187b));};AGIChannel['prototype'][_0x1e1d('0x3a')]=function(_0x2f4d6d){return this[_0x1e1d('0x23')](util[_0x1e1d('0x27')]('GET\x20VARIABLE\x20\x22%s\x22',_0x2f4d6d));};AGIChannel['prototype'][_0x1e1d('0x3b')]=function(_0x226b95,_0x2f587b,_0xf61600,_0xb9ad40,_0x568dc2,_0x253448){_0x2f587b=_0x2f587b||'wav';_0xf61600=_0xf61600||'';_0xb9ad40=_0xb9ad40===undefined?-0x1:_0xb9ad40==='-1'?-0x1:_0xb9ad40*0x3e8;_0x568dc2=_0x568dc2===undefined?'':'s='+_0x568dc2;_0x253448=_0x253448?_0x1e1d('0x3c'):'';return this[_0x1e1d('0x23')](util[_0x1e1d('0x27')](_0x1e1d('0x3d'),_0x226b95,_0x2f587b,_0xf61600,_0xb9ad40,_0x253448,_0x568dc2));};AGIChannel[_0x1e1d('0x20')][_0x1e1d('0x3e')]=function(_0x183cf6,_0x276131){_0x276131=_0x276131||'';return this[_0x1e1d('0x23')](util[_0x1e1d('0x27')](_0x1e1d('0x3f'),_0x183cf6,_0x276131));};AGIChannel[_0x1e1d('0x20')][_0x1e1d('0x40')]=function(_0x929180){return this[_0x1e1d('0x2b')]('AGI',_0x929180);};AGIChannel['prototype']['wait']=function(_0x110195){return this[_0x1e1d('0x2b')](_0x1e1d('0x41'),_0x110195);};AGIChannel['prototype']['error']=function(_0x1cbb97,_0x4c7bc4){this[_0x1e1d('0x28')](util[_0x1e1d('0x27')](_0x1e1d('0x42'),_0x1cbb97['id'],_0x1cbb97['label'],_0x4c7bc4));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1e1d('0x43')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 714eb3b..d8b1310 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 _0xdd04=['Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','format','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.'];(function(_0xd4c6a6,_0x5ce042){var _0x3f9046=function(_0x246a9f){while(--_0x246a9f){_0xd4c6a6['push'](_0xd4c6a6['shift']());}};_0x3f9046(++_0x5ce042);}(_0xdd04,0x138));var _0x4dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd04[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x4dd0('0x0'));var error={'E_AGI_UNDEFINED':_0x4dd0('0x1'),'E_AGI_ARGUMENT_PORT':_0x4dd0('0x2'),'E_AGI_SERVER_ERROR':_0x4dd0('0x3'),'E_AGI_SERVER_CLOSE':_0x4dd0('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x4dd0('0x5'),'E_AGI_SOCKET_ERROR':_0x4dd0('0x6'),'E_AGI_SOCKET_CLOSE':_0x4dd0('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x4dd0('0x8'),'E_AGI_COMMAND_EMPTY':_0x4dd0('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x4dd0('0xa'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x31bfcc){var _0x31bfcc=_0x31bfcc||null,_0x42e5e0=_0x42e5e0||[],_0x4d7ba8=0x1,_0x4faecf='';if(!error[_0x31bfcc]){_0x31bfcc='E_AGI_UNDEFINED';}_0x42e5e0[_0x4dd0('0xb')](error[_0x31bfcc]);while(arguments[_0x4d7ba8]){_0x42e5e0[_0x4dd0('0xb')](arguments[_0x4d7ba8]);_0x4d7ba8++;}_0x4faecf=util[_0x4dd0('0xc')]['apply'](util,_0x42e5e0);this[_0x4dd0('0xd')]=_0x4faecf;this[_0x4dd0('0xe')]=_0x31bfcc;}module[_0x4dd0('0xf')]=AGIError; \ No newline at end of file +var _0xb309=['format','apply','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xb309,0xc0));var _0x9b30=function(_0x525db0,_0x5ae06e){_0x525db0=_0x525db0-0x0;var _0x42b945=_0xb309[_0x525db0];return _0x42b945;};'use strict';var util=require(_0x9b30('0x0'));var error={'E_AGI_UNDEFINED':_0x9b30('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x9b30('0x2'),'E_AGI_SERVER_CLOSE':_0x9b30('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x9b30('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x9b30('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x9b30('0x6'),'E_AGI_COMMAND_EMPTY':_0x9b30('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x9b30('0x8'),'E_AGI_IVR_ENTRY':_0x9b30('0x9')};function AGIError(_0x203372){var _0x203372=_0x203372||null,_0x31b4fa=_0x31b4fa||[],_0x4caabc=0x1,_0x2fc948='';if(!error[_0x203372]){_0x203372=_0x9b30('0xa');}_0x31b4fa[_0x9b30('0xb')](error[_0x203372]);while(arguments[_0x4caabc]){_0x31b4fa[_0x9b30('0xb')](arguments[_0x4caabc]);_0x4caabc++;}_0x2fc948=util[_0x9b30('0xc')][_0x9b30('0xd')](util,_0x31b4fa);this[_0x9b30('0xe')]=_0x2fc948;this[_0x9b30('0xf')]=_0x203372;}module[_0x9b30('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 0b68b27..a7464cc 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 _0x2ba0=['EventEmitter','ioredis','./error','redis','defaults','agi','emit','error','E_AGI_SERVER_ERROR','message','parse','projectUpdate','lodash','events'];(function(_0x2b787f,_0x33f950){var _0x19d0a9=function(_0x136c46){while(--_0x136c46){_0x2b787f['push'](_0x2b787f['shift']());}};_0x19d0a9(++_0x33f950);}(_0x2ba0,0x178));var _0x02ba=function(_0x332500,_0x246243){_0x332500=_0x332500-0x0;var _0x47041f=_0x2ba0[_0x332500];return _0x47041f;};'use strict';var _=require(_0x02ba('0x0'));var EventEmitter=require(_0x02ba('0x1'))[_0x02ba('0x2')];var Redis=require(_0x02ba('0x3'));var AGIError=require(_0x02ba('0x4'));var config=require('../../config/environment');config[_0x02ba('0x5')]=_[_0x02ba('0x6')](config[_0x02ba('0x5')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x02ba('0x5')]);sub['subscribe'](_0x02ba('0x7'),function(_0x418613){if(_0x418613)return eventEmitter[_0x02ba('0x8')](_0x02ba('0x9'),new AGIError(_0x02ba('0xa'),_0x418613));});sub['on'](_0x02ba('0xb'),function(_0x3db6af,_0x523cca){if(_0x3db6af!==_0x02ba('0x7'))return;try{var _0x1099e6=JSON[_0x02ba('0xc')](_0x523cca);eventEmitter[_0x02ba('0x8')](_0x02ba('0xd'),_0x1099e6);}catch(_0x51bdbf){eventEmitter[_0x02ba('0x8')](_0x02ba('0x9'),new AGIError(_0x02ba('0xa'),_0x51bdbf));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x00c5=['events','EventEmitter','ioredis','./error','defaults','redis','localhost','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','parse','projectUpdate','exports','lodash'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0x00c5,0x1bf));var _0x500c=function(_0x59aa53,_0x2d6e0a){_0x59aa53=_0x59aa53-0x0;var _0x2df7b6=_0x00c5[_0x59aa53];return _0x2df7b6;};'use strict';var _=require(_0x500c('0x0'));var EventEmitter=require(_0x500c('0x1'))[_0x500c('0x2')];var Redis=require(_0x500c('0x3'));var AGIError=require(_0x500c('0x4'));var config=require('../../config/environment');config['redis']=_[_0x500c('0x5')](config[_0x500c('0x6')],{'host':_0x500c('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x500c('0x6')]);sub[_0x500c('0x8')](_0x500c('0x9'),function(_0x36a5b6){if(_0x36a5b6)return eventEmitter[_0x500c('0xa')](_0x500c('0xb'),new AGIError(_0x500c('0xc'),_0x36a5b6));});sub['on']('message',function(_0x50d90f,_0x416ccf){if(_0x50d90f!==_0x500c('0x9'))return;try{var _0x5cbc6a=JSON[_0x500c('0xd')](_0x416ccf);eventEmitter[_0x500c('0xa')](_0x500c('0xe'),_0x5cbc6a);}catch(_0x5db3d6){eventEmitter['emit'](_0x500c('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0x5db3d6));}});module[_0x500c('0xf')]={'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 a53b807..3356f50 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 _0xcb33=['vswitch','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getdigits','getsecretdigits','vertices','edges','addVertex','prototype','addEdge','numberOfEdges','size','getVertex','traverseBFS','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','split','target','default','agicommand','invalid'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xcb33,0x1c8));var _0x3cb3=function(_0x5420b7,_0x11c501){_0x5420b7=_0x5420b7-0x0;var _0x1914b6=_0xcb33[_0x5420b7];return _0x1914b6;};'use strict';var _=require(_0x3cb3('0x0'));var logger=require(_0x3cb3('0x1'))('agi');var verticesWithRetry=[_0x3cb3('0x2'),_0x3cb3('0x3'),_0x3cb3('0x4')];var Graph=function(){this[_0x3cb3('0x5')]={};this[_0x3cb3('0x6')]={};this['numberOfEdges']=0x0;};Graph['prototype'][_0x3cb3('0x7')]=function(_0xa77e54){this[_0x3cb3('0x5')][_0xa77e54['id']]=_0xa77e54;this[_0x3cb3('0x6')][_0xa77e54['id']]=[];};Graph[_0x3cb3('0x8')][_0x3cb3('0x9')]=function(_0x527834,_0x169eca,_0x24a1c2){this[_0x3cb3('0x6')][_0x527834]['push']({'target':_0x169eca,'condition':_0x24a1c2});this[_0x3cb3('0xa')]+=0x1;};Graph['prototype']['size']=function(){return _[_0x3cb3('0xb')](this[_0x3cb3('0x5')]);};Graph[_0x3cb3('0x8')]['relations']=function(){return this[_0x3cb3('0xa')];};Graph[_0x3cb3('0x8')][_0x3cb3('0xc')]=function(_0xc6a324){return this['vertices'][_0xc6a324];};Graph[_0x3cb3('0x8')][_0x3cb3('0xd')]=function(_0x490579,_0x3c4e49){if(!this['vertices'][_0x490579]){return logger[_0x3cb3('0xe')](_0x3cb3('0xf'));}var _0x35192c=_0x3c4e49(this[_0x3cb3('0x5')][_0x490579]);if(!_0x35192c){return logger[_0x3cb3('0xe')]('stop\x20traverse');}if(this[_0x3cb3('0x6')][_0x490579][_0x3cb3('0x10')]===0x0){return logger['info'](_0x3cb3('0x11'));}for(var _0x2c3547=0x0,_0x15518b=[],_0x257581=![];_0x2c3547\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','timeout','evtHangup','find','production','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','listening','connection','close','lodash','syncho','../../config/logger','agi','../../config/license/util','./events','defaults','127.0.0.1','projectUpdate','nextTick','stack','findIndex','error','log'];(function(_0x389b9f,_0x3c5e04){var _0x3fa3c6=function(_0x537e78){while(--_0x537e78){_0x389b9f['push'](_0x389b9f['shift']());}};_0x3fa3c6(++_0x3c5e04);}(_0x1838,0x17a));var _0x8183=function(_0x53a9ca,_0x2f536c){_0x53a9ca=_0x53a9ca-0x0;var _0x2822e5=_0x1838[_0x53a9ca];return _0x2822e5;};'use strict';var _=require(_0x8183('0x0'));var syncho=require(_0x8183('0x1'));var util=require('util');var config=require('../../config/environment');var logger=require(_0x8183('0x2'))(_0x8183('0x3'));var utilLicense=require(_0x8183('0x4'));var rpc=require('./rpc');var Project=require('./project');var AGIEmitter=require(_0x8183('0x5'))['EventEmitter'];var projects=[];config[_0x8183('0x3')]=_[_0x8183('0x6')](config[_0x8183('0x3')],{'ip':_0x8183('0x7'),'port':0x11dd});AGIEmitter['on'](_0x8183('0x8'),projectUpdateHandler);function connectionHandler(_0x5f02d6){process[_0x8183('0x9')](function(){syncho(function(){try{setChannelVariables(_0x5f02d6);agiHandler(_0x5f02d6);}catch(_0x11a669){logger['error'](_0x11a669[_0x8183('0xa')]);}});});}function projectUpdateHandler(_0x4393dc){try{var _0xbb3d2f=_[_0x8183('0xb')](projects,['id',_0x4393dc['id']]);if(_0xbb3d2f>-0x1){if(_0x4393dc['deleted']===!![]){projects['splice'](_0xbb3d2f,0x1);}else{projects[_0xbb3d2f]=_0x4393dc;}}else{projects['push'](_0x4393dc);}}catch(_0x4330b5){logger[_0x8183('0xc')](_0x4330b5[_0x8183('0xa')]);}}function listeningHandler(){console[_0x8183('0xd')](_0x8183('0xe'),config['agi']['port']);logger['info'](util[_0x8183('0xf')](_0x8183('0x10'),config[_0x8183('0x3')]['ip'],config[_0x8183('0x3')][_0x8183('0x11')]));}function errorHandler(_0x357951){if(_0x357951&&_0x357951[_0x8183('0x12')]&&_0x357951[_0x8183('0x13')]){logger[_0x8183('0xc')](util[_0x8183('0xf')](_0x8183('0x14'),_0x357951[_0x8183('0x12')],_0x357951['message']));}else{logger[_0x8183('0xc')](util[_0x8183('0xf')](_0x8183('0x15'),_0x357951[_0x8183('0xa')]));}}function closeHandler(){logger[_0x8183('0x16')](util['format'](_0x8183('0x17'),this[_0x8183('0x18')],this[_0x8183('0x19')],this['callerid'],this['dnid'],this[_0x8183('0x1a')]));try{createSquareReport(this);}catch(_0x3ce2bb){logger[_0x8183('0xc')](_0x3ce2bb[_0x8183('0xa')]);}}function timeoutHandler(){logger[_0x8183('0x16')](util[_0x8183('0xf')](_0x8183('0x1b'),this[_0x8183('0x18')],this[_0x8183('0x19')],this[_0x8183('0x1c')],this[_0x8183('0x1d')],this[_0x8183('0x1a')]));}function hangupHandler(){logger[_0x8183('0x16')](util['format'](_0x8183('0x1e'),this[_0x8183('0x18')],this[_0x8183('0x19')],this['callerid'],this['dnid'],this[_0x8183('0x1a')]));this['evtHangup']=!![];}function createSquareReport(_0x1b6b2c,_0x4489af){rpc[_0x8183('0x1f')](_0x1b6b2c)[_0x8183('0x20')](function(_0x4f51c7){if(_0x4489af){_0x4489af(null,_0x4f51c7);}})[_0x8183('0x21')](function(_0x2259fe){if(_0x4489af){_0x4489af(null,_0x2259fe);}});}function setChannelVariables(_0x29361a){for(var _0x10b2ce in _0x29361a){if(_0x29361a[_0x8183('0x22')](_0x10b2ce)){if(_0x10b2ce[_0x8183('0x23')](_0x8183('0x24'))===0x0){_0x29361a[_0x10b2ce[_0x8183('0x25')](0x4)]=_0x29361a[_0x10b2ce];delete _0x29361a[_0x10b2ce];}}}}function agiHandler(_0x426c8a){logger[_0x8183('0x26')](_0x8183('0x27'),JSON[_0x8183('0x28')](_0x426c8a,null,0x2));logger[_0x8183('0x16')](util[_0x8183('0xf')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x426c8a['arg_1'],_0x426c8a[_0x8183('0x19')],_0x426c8a['callerid'],_0x426c8a[_0x8183('0x1d')],_0x426c8a[_0x8183('0x1a')]));_0x426c8a['on'](_0x8183('0xc'),errorHandler);_0x426c8a['on']('close',closeHandler);_0x426c8a['on'](_0x8183('0x29'),timeoutHandler);_0x426c8a[_0x8183('0x2a')]=![];_0x426c8a['on']('hangup',hangupHandler);var _0x42cbe7=_[_0x8183('0x2b')](projects,[_0x8183('0x12'),_0x426c8a[_0x8183('0x18')]]);if(!_0x42cbe7)return Project['handleNotFound'](_0x426c8a);if(!_0x42cbe7[_0x8183('0x2c')])return Project['handleUnpublished'](_0x426c8a);return Project[_0x8183('0x2d')](_0x42cbe7,_0x426c8a);}function main(){var _0x199b5d;return utilLicense[_0x8183('0x2e')]()[_0x8183('0x20')](function(_0x3e31bd){if(!_0x3e31bd)return;if(_0x3e31bd['voice']){if(_0x3e31bd[_0x8183('0x2f')]&&_0x3e31bd[_0x8183('0x2f')]>0x0){logger[_0x8183('0x16')](util[_0x8183('0xf')]('[LICENSE]\x20CHANNELS:\x20%s',_0x3e31bd[_0x8183('0x2f')]));_0x199b5d=_0x3e31bd['callysquare'];}else{logger[_0x8183('0x16')](_0x8183('0x30'));}}else{logger[_0x8183('0x16')](_0x8183('0x31'));_0x199b5d=-0x1;}})[_0x8183('0x20')](function(){return Project[_0x8183('0x32')]();})['then'](function(_0x1e45ee){projects=_0x1e45ee;return;})[_0x8183('0x21')](function(_0x4aa4d6){logger[_0x8183('0xc')](_0x8183('0x33'),_0x4aa4d6['stack']);})[_0x8183('0x34')](function(){var _0x34773c=require('./server')(config['agi'][_0x8183('0x11')],config['agi']['ip'],_0x199b5d);_0x34773c['on'](_0x8183('0xc'),errorHandler);_0x34773c['on'](_0x8183('0x35'),listeningHandler);_0x34773c['on'](_0x8183('0x36'),connectionHandler);_0x34773c['on'](_0x8183('0x37'),closeHandler);});}main(); \ No newline at end of file +var _0x3d88=['[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','catch','indexOf','agi_','debug','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','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','[LICENSE]','finally','listening','connection','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','projectUpdate','nextTick','error','findIndex','deleted','splice','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','message','[%s]\x20%s','name'];(function(_0x5826da,_0x4ffb7f){var _0x127236=function(_0x5c2f74){while(--_0x5c2f74){_0x5826da['push'](_0x5826da['shift']());}};_0x127236(++_0x4ffb7f);}(_0x3d88,0x143));var _0x83d8=function(_0x40422e,_0x35a465){_0x40422e=_0x40422e-0x0;var _0x19a7ab=_0x3d88[_0x40422e];return _0x19a7ab;};'use strict';var _=require('lodash');var syncho=require(_0x83d8('0x0'));var util=require(_0x83d8('0x1'));var config=require(_0x83d8('0x2'));var logger=require(_0x83d8('0x3'))(_0x83d8('0x4'));var utilLicense=require(_0x83d8('0x5'));var rpc=require(_0x83d8('0x6'));var Project=require(_0x83d8('0x7'));var AGIEmitter=require(_0x83d8('0x8'))[_0x83d8('0x9')];var projects=[];config[_0x83d8('0x4')]=_['defaults'](config[_0x83d8('0x4')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x83d8('0xa'),projectUpdateHandler);function connectionHandler(_0x5405dd){process[_0x83d8('0xb')](function(){syncho(function(){try{setChannelVariables(_0x5405dd);agiHandler(_0x5405dd);}catch(_0x3a93f1){logger[_0x83d8('0xc')](_0x3a93f1['stack']);}});});}function projectUpdateHandler(_0x10ae58){try{var _0x3a0cf4=_[_0x83d8('0xd')](projects,['id',_0x10ae58['id']]);if(_0x3a0cf4>-0x1){if(_0x10ae58[_0x83d8('0xe')]===!![]){projects[_0x83d8('0xf')](_0x3a0cf4,0x1);}else{projects[_0x3a0cf4]=_0x10ae58;}}else{projects['push'](_0x10ae58);}}catch(_0x165eea){logger[_0x83d8('0xc')](_0x165eea[_0x83d8('0x10')]);}}function listeningHandler(){console[_0x83d8('0x11')](_0x83d8('0x12'),config[_0x83d8('0x4')][_0x83d8('0x13')]);logger[_0x83d8('0x14')](util[_0x83d8('0x15')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x83d8('0x4')]['ip'],config[_0x83d8('0x4')][_0x83d8('0x13')]));}function errorHandler(_0x5991f8){if(_0x5991f8&&_0x5991f8['name']&&_0x5991f8[_0x83d8('0x16')]){logger[_0x83d8('0xc')](util[_0x83d8('0x15')](_0x83d8('0x17'),_0x5991f8[_0x83d8('0x18')],_0x5991f8[_0x83d8('0x16')]));}else{logger[_0x83d8('0xc')](util[_0x83d8('0x15')](_0x83d8('0x19'),_0x5991f8['stack']));}}function closeHandler(){logger[_0x83d8('0x14')](util[_0x83d8('0x15')](_0x83d8('0x1a'),this[_0x83d8('0x1b')],this[_0x83d8('0x1c')],this[_0x83d8('0x1d')],this[_0x83d8('0x1e')],this['uniqueid']));try{createSquareReport(this);}catch(_0x4b3da6){logger[_0x83d8('0xc')](_0x4b3da6[_0x83d8('0x10')]);}}function timeoutHandler(){logger['info'](util[_0x83d8('0x15')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x83d8('0x1c')],this[_0x83d8('0x1d')],this[_0x83d8('0x1e')],this[_0x83d8('0x1f')]));}function hangupHandler(){logger[_0x83d8('0x14')](util[_0x83d8('0x15')](_0x83d8('0x20'),this[_0x83d8('0x1b')],this[_0x83d8('0x1c')],this[_0x83d8('0x1d')],this[_0x83d8('0x1e')],this[_0x83d8('0x1f')]));this['evtHangup']=!![];}function createSquareReport(_0x5a7840,_0x4348e7){rpc[_0x83d8('0x21')](_0x5a7840)[_0x83d8('0x22')](function(_0x11dce8){if(_0x4348e7){_0x4348e7(null,_0x11dce8);}})[_0x83d8('0x23')](function(_0xaec731){if(_0x4348e7){_0x4348e7(null,_0xaec731);}});}function setChannelVariables(_0x35fbc8){for(var _0x2a0d7a in _0x35fbc8){if(_0x35fbc8['hasOwnProperty'](_0x2a0d7a)){if(_0x2a0d7a[_0x83d8('0x24')](_0x83d8('0x25'))===0x0){_0x35fbc8[_0x2a0d7a['substring'](0x4)]=_0x35fbc8[_0x2a0d7a];delete _0x35fbc8[_0x2a0d7a];}}}}function agiHandler(_0x490277){logger[_0x83d8('0x26')](_0x83d8('0x27'),JSON[_0x83d8('0x28')](_0x490277,null,0x2));logger[_0x83d8('0x14')](util[_0x83d8('0x15')](_0x83d8('0x29'),_0x490277[_0x83d8('0x1b')],_0x490277['calleridname'],_0x490277[_0x83d8('0x1d')],_0x490277[_0x83d8('0x1e')],_0x490277[_0x83d8('0x1f')]));_0x490277['on'](_0x83d8('0xc'),errorHandler);_0x490277['on'](_0x83d8('0x2a'),closeHandler);_0x490277['on']('timeout',timeoutHandler);_0x490277['evtHangup']=![];_0x490277['on']('hangup',hangupHandler);var _0x3a8618=_[_0x83d8('0x2b')](projects,[_0x83d8('0x18'),_0x490277['arg_1']]);if(!_0x3a8618)return Project[_0x83d8('0x2c')](_0x490277);if(!_0x3a8618[_0x83d8('0x2d')])return Project[_0x83d8('0x2e')](_0x490277);return Project[_0x83d8('0x2f')](_0x3a8618,_0x490277);}function main(){var _0xedc924;return utilLicense[_0x83d8('0x30')]()[_0x83d8('0x22')](function(_0x458aec){if(!_0x458aec)return;if(_0x458aec[_0x83d8('0x31')]){if(_0x458aec[_0x83d8('0x32')]&&_0x458aec[_0x83d8('0x32')]>0x0){logger[_0x83d8('0x14')](util[_0x83d8('0x15')](_0x83d8('0x33'),_0x458aec[_0x83d8('0x32')]));_0xedc924=_0x458aec[_0x83d8('0x32')];}else{logger['info'](_0x83d8('0x34'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0xedc924=-0x1;}})['then'](function(){return Project[_0x83d8('0x35')]();})['then'](function(_0x5671dc){projects=_0x5671dc;return;})['catch'](function(_0x1413ba){logger[_0x83d8('0xc')](_0x83d8('0x36'),_0x1413ba[_0x83d8('0x10')]);})[_0x83d8('0x37')](function(){var _0x4534eb=require('./server')(config['agi'][_0x83d8('0x13')],config['agi']['ip'],_0xedc924);_0x4534eb['on'](_0x83d8('0xc'),errorHandler);_0x4534eb['on'](_0x83d8('0x38'),listeningHandler);_0x4534eb['on'](_0x83d8('0x39'),connectionHandler);_0x4534eb['on'](_0x83d8('0x2a'),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 1e88a3f..4218197 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 _0x78b3=['result','sendMailMessage','SendMail','bluebird','client','request','then','message'];(function(_0x4c14d9,_0x1e419a){var _0x1a8166=function(_0x279fe9){while(--_0x279fe9){_0x4c14d9['push'](_0x4c14d9['shift']());}};_0x1a8166(++_0x1e419a);}(_0x78b3,0x1db));var _0x378b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78b3[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x378b('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x378b('0x1')]['http']({'port':0x232b});function request(_0x513b4f,_0x598206){return new BPromise(function(_0x1c5bd7,_0x231e44){return client[_0x378b('0x2')](_0x513b4f,_0x598206)[_0x378b('0x3')](function(_0x2c4218){if(_0x2c4218['error']){return _0x231e44(_0x2c4218['error'][_0x378b('0x4')]);}else{return _0x1c5bd7(_0x2c4218[_0x378b('0x5')]);}})['catch'](function(_0x24e0bf){return _0x231e44(_0x24e0bf);});});}exports[_0x378b('0x6')]=function(_0x170b86,_0x24af58){return request(_0x378b('0x7'),{'account':_0x170b86,'message':_0x24af58});}; \ No newline at end of file +var _0xabfa=['error','message','result','catch','SendMail','bluebird','client','http','request'];(function(_0x148928,_0x362a1c){var _0x242e40=function(_0xdb1b8e){while(--_0xdb1b8e){_0x148928['push'](_0x148928['shift']());}};_0x242e40(++_0x362a1c);}(_0xabfa,0xd4));var _0xaabf=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xabfa[_0x5f1391];return _0x50ebe3;};'use strict';var BPromise=require(_0xaabf('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xaabf('0x1')][_0xaabf('0x2')]({'port':0x232b});function request(_0x2b9dfb,_0x1c6737){return new BPromise(function(_0x1ec1a7,_0x14575a){return client[_0xaabf('0x3')](_0x2b9dfb,_0x1c6737)['then'](function(_0xcd78d6){if(_0xcd78d6[_0xaabf('0x4')]){return _0x14575a(_0xcd78d6['error'][_0xaabf('0x5')]);}else{return _0x1ec1a7(_0xcd78d6[_0xaabf('0x6')]);}})[_0xaabf('0x7')](function(_0x1c30ab){return _0x14575a(_0x1c30ab);});});}exports['sendMailMessage']=function(_0xc59f74,_0x3cec93){return request(_0xaabf('0x8'),{'account':_0xc59f74,'message':_0x3cec93});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index b3cde4b..219498a 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 _0x3258=['start','debug','stringify','joinAt','format','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','uniqueid','traverseBFS','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','lodash','xml2json','util','../../config/logger','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','length','source','addEdge','target','value','mxGraphModel','root'];(function(_0x31802b,_0x1619ce){var _0x49a75e=function(_0x4bfa9a){while(--_0x4bfa9a){_0x31802b['push'](_0x31802b['shift']());}};_0x49a75e(++_0x1619ce);}(_0x3258,0x19e));var _0x8325=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3258[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8325('0x0'));var moment=require('moment');var parser=require(_0x8325('0x1'));var util=require(_0x8325('0x2'));var logger=require(_0x8325('0x3'))('agi');var rpc=require(_0x8325('0x4'));var mailRpc=require(_0x8325('0x5'));var Graph=require(_0x8325('0x6'));var Vertices=require(_0x8325('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x8325('0x8')]()[_0x8325('0x9')](function(_0x7dcfc7){logger[_0x8325('0xa')](_0x8325('0xb'),_0x7dcfc7['stack']);return[];});}function addVertex(_0xed36bf,_0x205f0d,_0x3b2904){_0x205f0d[_0x8325('0xc')]=_0x3b2904;if(_0x205f0d[_0x8325('0xd')]('retry')){_0x205f0d[_0x8325('0xe')]=parseInt(_0x205f0d[_0x8325('0xf')],0xa);}_0xed36bf[_0x8325('0x10')](_[_0x8325('0x11')](_0x205f0d,_0x8325('0x12')));}function initGraph(_0x4b810a,_0x48e57d){var _0x4a0064=new Graph();for(var _0x3d3b16 in _0x4b810a){if(_0x4b810a['hasOwnProperty'](_0x3d3b16)){if(_[_0x8325('0x13')](_0x4b810a[_0x3d3b16])){for(var _0x172011=0x0;_0x172011<_0x4b810a[_0x3d3b16]['length'];_0x172011+=0x1){addVertex(_0x4a0064,_0x4b810a[_0x3d3b16][_0x172011],_0x3d3b16);}}else{addVertex(_0x4a0064,_0x4b810a[_0x3d3b16],_0x3d3b16);}}}for(var _0x239feb=0x0;_0x239feb<_0x48e57d[_0x8325('0x14')];_0x239feb+=0x1){if(_0x48e57d[_0x239feb][_0x8325('0x15')]&&_0x48e57d[_0x239feb]['target']){_0x4a0064[_0x8325('0x16')](_0x48e57d[_0x239feb][_0x8325('0x15')],_0x48e57d[_0x239feb][_0x8325('0x17')],_0x48e57d[_0x239feb][_0x8325('0x18')]);}}return _0x4a0064;}function getRoot(_0x5d61ec){return parser['toJson'](_0x5d61ec,{'object':!![]})[_0x8325('0x19')][_0x8325('0x1a')];}function inspect(_0x58f081){return util['inspect'](_0x58f081,{'showHidden':![],'depth':null});}function initialize(_0x270917,_0xfda83a){var _0x358658=getRoot(_0x270917['production']);if(!_0x358658||!_0x358658[_0x8325('0x1b')])return;var _0x1aac6d,_0x57f1c5,_0x25cf4b;logger[_0x8325('0x1c')](_0x8325('0x1a'),JSON[_0x8325('0x1d')](_0x358658,null,0x2));_0xfda83a[_0x8325('0x1e')]=moment()[_0x8325('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');_0x1aac6d=initGraph(_['omit'](_0x358658,_0x8325('0x12')),_0x358658['mxCell']);_0x57f1c5=new Vertices(_0xfda83a,rpc,mailRpc);logger[_0x8325('0x20')](util[_0x8325('0x1f')](_0x8325('0x21'),_0xfda83a[_0x8325('0x22')],_0xfda83a[_0x8325('0x23')],_0xfda83a['callerid'],_0xfda83a[_0x8325('0x24')],_0xfda83a['uniqueid']));_0x1aac6d['traverseBFS'](_0x358658[_0x8325('0x1b')]['id'],function(_0x38fb98){try{_0x38fb98=_0x57f1c5[_0x8325('0x25')](_0x38fb98);logger[_0x8325('0x1c')]('vertex',JSON[_0x8325('0x1d')](_0x38fb98,null,0x2));if(_0x38fb98[_0x8325('0xc')]===_0x8325('0x26')){logger['info'](_0x8325('0x27'));_0xfda83a[_0x8325('0x28')]=_0x38fb98[_0x8325('0x28')]||_0xfda83a['context'];_0xfda83a[_0x8325('0x29')]=_0x38fb98['extension'];_0xfda83a[_0x8325('0x2a')]=_0x38fb98['priority']?_0x38fb98[_0x8325('0x2a')]-0x1:0x1;return null;}else if(_0x38fb98&&_0x57f1c5[_0x38fb98[_0x8325('0xc')]]){_0x25cf4b=_0x57f1c5[_0x38fb98['agicommand']](_0x38fb98);logger[_0x8325('0x20')](_0x8325('0x2b'),JSON['stringify'](_0x25cf4b,null,0x2));if(_0x25cf4b&&_0x25cf4b[_0x8325('0x2c')]===AGI_CODE_SUCCESS&&_0x25cf4b[_0x8325('0x2d')]!==AGI_RESULT_ERROR&&!_0xfda83a[_0x8325('0x2e')]){logger[_0x8325('0x1c')](_0x8325('0x2b'),inspect(_0x25cf4b));return _[_0x8325('0x2f')](_0x25cf4b[_0x8325('0x2d')])?null:_0x25cf4b[_0x8325('0x2d')][_0x8325('0x30')]();}else{logger['error'](_0x8325('0x2b'),inspect(_0x25cf4b));return null;}}else{logger[_0x8325('0xa')](_0x8325('0x31'));return null;}}catch(_0x3a9d3b){logger[_0x8325('0xa')](_0x3a9d3b[_0x8325('0x32')]);return null;}});if(_0x358658[_0x8325('0x33')]){logger['info'](util[_0x8325('0x1f')](_0x8325('0x34'),_0xfda83a[_0x8325('0x22')],_0xfda83a['calleridname'],_0xfda83a[_0x8325('0x35')],_0xfda83a[_0x8325('0x24')],_0xfda83a[_0x8325('0x36')]));_0x1aac6d[_0x8325('0x37')](_0x358658[_0x8325('0x33')]['id'],function(_0x1f7d30){try{_0x1f7d30=_0x57f1c5[_0x8325('0x25')](_0x1f7d30);logger[_0x8325('0x1c')](_0x8325('0x38'),JSON[_0x8325('0x1d')](_0x1f7d30,null,0x2));if(_0x1f7d30&&_0x57f1c5[_0x1f7d30[_0x8325('0xc')]]){_0x25cf4b=_0x57f1c5[_0x1f7d30[_0x8325('0xc')]](_0x1f7d30);if(_0x25cf4b){logger[_0x8325('0x1c')](_0x8325('0x2b'),inspect(_0x25cf4b));return _[_0x8325('0x2f')](_0x25cf4b[_0x8325('0x2d')])?null:_0x25cf4b[_0x8325('0x2d')][_0x8325('0x30')]();}else{logger[_0x8325('0xa')]('response',inspect(_0x25cf4b));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x9e3061){logger[_0x8325('0xa')](_0x9e3061['stack']);return null;}});}logger['info'](util[_0x8325('0x1f')](_0x8325('0x39'),_0xfda83a[_0x8325('0x22')],_0xfda83a['calleridname'],_0xfda83a[_0x8325('0x35')],_0xfda83a[_0x8325('0x24')],_0xfda83a[_0x8325('0x36')]));logger[_0x8325('0x20')](util[_0x8325('0x1f')](_0x8325('0x3a'),_0xfda83a[_0x8325('0x28')],_0xfda83a[_0x8325('0x29')],parseInt(_0xfda83a[_0x8325('0x2a')],0xa)+0x1));_0xfda83a[_0x8325('0x3b')](_0xfda83a[_0x8325('0x28')],_0xfda83a[_0x8325('0x29')],parseInt(_0xfda83a[_0x8325('0x2a')],0xa)+0x1);_0xfda83a[_0x8325('0x3c')]();}function handleNotFound(_0x39784d){logger[_0x8325('0xa')](util[_0x8325('0x1f')](_0x8325('0x3d'),_0x39784d[_0x8325('0x22')]));_0x39784d['continueAt'](_0x39784d[_0x8325('0x28')],_0x39784d[_0x8325('0x29')],parseInt(_0x39784d[_0x8325('0x2a')],0xa)+0x1);_0x39784d[_0x8325('0x3c')]();}function handleUnpublished(_0xda4c2e){logger[_0x8325('0xa')](util[_0x8325('0x1f')](_0x8325('0x3e'),_0xda4c2e['arg_1']));_0xda4c2e[_0x8325('0x3b')](_0xda4c2e[_0x8325('0x28')],_0xda4c2e[_0x8325('0x29')],parseInt(_0xda4c2e[_0x8325('0x2a')],0xa)+0x1);_0xda4c2e[_0x8325('0x3c')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xb362=['callerid','dnid','traverseBFS','start','clear','vertex','context','extension','priority','response','stringify','code','isUndefined','result','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','exports','moment','xml2json','util','../../config/logger','./rpc','./mailRpc','./graph','./vertices','error','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','value','mxGraphModel','root','inspect','production','debug','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','omit','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname'];(function(_0x874967,_0x34965d){var _0x3a0ef1=function(_0x38a0c0){while(--_0x38a0c0){_0x874967['push'](_0x874967['shift']());}};_0x3a0ef1(++_0x34965d);}(_0xb362,0x1ad));var _0x2b36=function(_0x569d5d,_0x57a548){_0x569d5d=_0x569d5d-0x0;var _0x55cf15=_0xb362[_0x569d5d];return _0x55cf15;};'use strict';var _=require('lodash');var moment=require(_0x2b36('0x0'));var parser=require(_0x2b36('0x1'));var util=require(_0x2b36('0x2'));var logger=require(_0x2b36('0x3'))('agi');var rpc=require(_0x2b36('0x4'));var mailRpc=require(_0x2b36('0x5'));var Graph=require(_0x2b36('0x6'));var Vertices=require(_0x2b36('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()['catch'](function(_0x38586e){logger[_0x2b36('0x8')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x38586e[_0x2b36('0x9')]);return[];});}function addVertex(_0x1d6589,_0x4bfa61,_0x25af6b){_0x4bfa61[_0x2b36('0xa')]=_0x25af6b;if(_0x4bfa61[_0x2b36('0xb')](_0x2b36('0xc'))){_0x4bfa61[_0x2b36('0xd')]=parseInt(_0x4bfa61['retry'],0xa);}_0x1d6589[_0x2b36('0xe')](_['omit'](_0x4bfa61,_0x2b36('0xf')));}function initGraph(_0xc05edf,_0x4077c5){var _0x573d79=new Graph();for(var _0x12ea4f in _0xc05edf){if(_0xc05edf[_0x2b36('0xb')](_0x12ea4f)){if(_[_0x2b36('0x10')](_0xc05edf[_0x12ea4f])){for(var _0x6d35cf=0x0;_0x6d35cf<_0xc05edf[_0x12ea4f][_0x2b36('0x11')];_0x6d35cf+=0x1){addVertex(_0x573d79,_0xc05edf[_0x12ea4f][_0x6d35cf],_0x12ea4f);}}else{addVertex(_0x573d79,_0xc05edf[_0x12ea4f],_0x12ea4f);}}}for(var _0x444c28=0x0;_0x444c28<_0x4077c5[_0x2b36('0x11')];_0x444c28+=0x1){if(_0x4077c5[_0x444c28][_0x2b36('0x12')]&&_0x4077c5[_0x444c28][_0x2b36('0x13')]){_0x573d79[_0x2b36('0x14')](_0x4077c5[_0x444c28][_0x2b36('0x12')],_0x4077c5[_0x444c28][_0x2b36('0x13')],_0x4077c5[_0x444c28][_0x2b36('0x15')]);}}return _0x573d79;}function getRoot(_0x45afe0){return parser['toJson'](_0x45afe0,{'object':!![]})[_0x2b36('0x16')][_0x2b36('0x17')];}function inspect(_0x1b54e5){return util[_0x2b36('0x18')](_0x1b54e5,{'showHidden':![],'depth':null});}function initialize(_0x39850d,_0x53a6f5){var _0x1977ac=getRoot(_0x39850d[_0x2b36('0x19')]);if(!_0x1977ac||!_0x1977ac['start'])return;var _0x1cd535,_0x358d6e,_0x25b2b6;logger[_0x2b36('0x1a')](_0x2b36('0x17'),JSON['stringify'](_0x1977ac,null,0x2));_0x53a6f5[_0x2b36('0x1b')]=moment()[_0x2b36('0x1c')](_0x2b36('0x1d'));_0x1cd535=initGraph(_[_0x2b36('0x1e')](_0x1977ac,_0x2b36('0xf')),_0x1977ac['mxCell']);_0x358d6e=new Vertices(_0x53a6f5,rpc,mailRpc);logger[_0x2b36('0x1f')](util['format'](_0x2b36('0x20'),_0x53a6f5[_0x2b36('0x21')],_0x53a6f5[_0x2b36('0x22')],_0x53a6f5[_0x2b36('0x23')],_0x53a6f5[_0x2b36('0x24')],_0x53a6f5['uniqueid']));_0x1cd535[_0x2b36('0x25')](_0x1977ac[_0x2b36('0x26')]['id'],function(_0x3d8e78){try{_0x3d8e78=_0x358d6e[_0x2b36('0x27')](_0x3d8e78);logger[_0x2b36('0x1a')](_0x2b36('0x28'),JSON['stringify'](_0x3d8e78,null,0x2));if(_0x3d8e78['agicommand']==='gotoc'){logger[_0x2b36('0x1f')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x53a6f5['context']=_0x3d8e78[_0x2b36('0x29')]||_0x53a6f5['context'];_0x53a6f5['extension']=_0x3d8e78[_0x2b36('0x2a')];_0x53a6f5[_0x2b36('0x2b')]=_0x3d8e78[_0x2b36('0x2b')]?_0x3d8e78[_0x2b36('0x2b')]-0x1:0x1;return null;}else if(_0x3d8e78&&_0x358d6e[_0x3d8e78['agicommand']]){_0x25b2b6=_0x358d6e[_0x3d8e78[_0x2b36('0xa')]](_0x3d8e78);logger['info'](_0x2b36('0x2c'),JSON[_0x2b36('0x2d')](_0x25b2b6,null,0x2));if(_0x25b2b6&&_0x25b2b6[_0x2b36('0x2e')]===AGI_CODE_SUCCESS&&_0x25b2b6['result']!==AGI_RESULT_ERROR&&!_0x53a6f5['evtHangup']){logger['debug'](_0x2b36('0x2c'),inspect(_0x25b2b6));return _[_0x2b36('0x2f')](_0x25b2b6[_0x2b36('0x30')])?null:_0x25b2b6[_0x2b36('0x30')]['toString']();}else{logger[_0x2b36('0x8')](_0x2b36('0x2c'),inspect(_0x25b2b6));return null;}}else{logger[_0x2b36('0x8')](_0x2b36('0x31'));return null;}}catch(_0x1d80c5){logger[_0x2b36('0x8')](_0x1d80c5[_0x2b36('0x9')]);return null;}});if(_0x1977ac[_0x2b36('0x32')]){logger[_0x2b36('0x1f')](util[_0x2b36('0x1c')](_0x2b36('0x33'),_0x53a6f5['arg_1'],_0x53a6f5['calleridname'],_0x53a6f5[_0x2b36('0x23')],_0x53a6f5[_0x2b36('0x24')],_0x53a6f5[_0x2b36('0x34')]));_0x1cd535[_0x2b36('0x25')](_0x1977ac[_0x2b36('0x32')]['id'],function(_0x1e2871){try{_0x1e2871=_0x358d6e['clear'](_0x1e2871);logger['debug'](_0x2b36('0x28'),JSON[_0x2b36('0x2d')](_0x1e2871,null,0x2));if(_0x1e2871&&_0x358d6e[_0x1e2871[_0x2b36('0xa')]]){_0x25b2b6=_0x358d6e[_0x1e2871[_0x2b36('0xa')]](_0x1e2871);if(_0x25b2b6){logger['debug'](_0x2b36('0x2c'),inspect(_0x25b2b6));return _[_0x2b36('0x2f')](_0x25b2b6[_0x2b36('0x30')])?null:_0x25b2b6[_0x2b36('0x30')][_0x2b36('0x35')]();}else{logger[_0x2b36('0x8')](_0x2b36('0x2c'),inspect(_0x25b2b6));return null;}}else{logger[_0x2b36('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x1804eb){logger['error'](_0x1804eb['stack']);return null;}});}logger[_0x2b36('0x1f')](util[_0x2b36('0x1c')](_0x2b36('0x36'),_0x53a6f5[_0x2b36('0x21')],_0x53a6f5[_0x2b36('0x22')],_0x53a6f5[_0x2b36('0x23')],_0x53a6f5['dnid'],_0x53a6f5['uniqueid']));logger[_0x2b36('0x1f')](util[_0x2b36('0x1c')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x53a6f5[_0x2b36('0x29')],_0x53a6f5[_0x2b36('0x2a')],parseInt(_0x53a6f5['priority'],0xa)+0x1));_0x53a6f5[_0x2b36('0x37')](_0x53a6f5['context'],_0x53a6f5[_0x2b36('0x2a')],parseInt(_0x53a6f5[_0x2b36('0x2b')],0xa)+0x1);_0x53a6f5[_0x2b36('0x38')]();}function handleNotFound(_0x24e76c){logger[_0x2b36('0x8')](util['format']('Project\x20%s\x20not\x20found',_0x24e76c[_0x2b36('0x21')]));_0x24e76c[_0x2b36('0x37')](_0x24e76c['context'],_0x24e76c[_0x2b36('0x2a')],parseInt(_0x24e76c[_0x2b36('0x2b')],0xa)+0x1);_0x24e76c[_0x2b36('0x38')]();}function handleUnpublished(_0x5d33ad){logger[_0x2b36('0x8')](util[_0x2b36('0x1c')]('Project\x20%s\x20not\x20published',_0x5d33ad[_0x2b36('0x21')]));_0x5d33ad['continueAt'](_0x5d33ad['context'],_0x5d33ad[_0x2b36('0x2a')],parseInt(_0x5d33ad[_0x2b36('0x2b')],0xa)+0x1);_0x5d33ad[_0x2b36('0x38')]();}module[_0x2b36('0x39')]={'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 afac642..418e73d 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 _0x6324=['split','trim','slice','length','emit','headers','substring','line','exports','stream','call','_localBuffer','_inBody','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf'];(function(_0xe3bbea,_0x3ae4d3){var _0x18713d=function(_0x453117){while(--_0x453117){_0xe3bbea['push'](_0xe3bbea['shift']());}};_0x18713d(++_0x3ae4d3);}(_0x6324,0x13b));var _0x4632=function(_0x143fd9,_0x36d5d6){_0x143fd9=_0x143fd9-0x0;var _0x18f011=_0x6324[_0x143fd9];return _0x18f011;};'use strict';var util=require('util');var Transform=require(_0x4632('0x0'))['Transform'];function AGIReply(_0x5f590f){Transform[_0x4632('0x1')](this,_0x5f590f);this[_0x4632('0x2')]='';this[_0x4632('0x3')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x4632('0x4')][_0x4632('0x5')]=function(_0x38e25a,_0x294fd1,_0x39d265){var _0xa77962='\x0a',_0x4a7800=['\x0a\x0a',_0x4632('0x6')],_0x3f467c=-0x1,_0x4a8368=-0x1,_0x17e6bd='',_0x27d214=0x0,_0x5e9ffc='',_0x4567bf='';this['_localBuffer']+=_0x38e25a[_0x4632('0x7')]();_0x5e9ffc=this['_localBuffer'];if(!this['_inBody']){_0x27d214=0x0;while(_0x4a7800[_0x27d214]){while((_0x4a8368=_0x5e9ffc[_0x4632('0x8')](_0x4a7800[_0x27d214]))!=-0x1){_0x17e6bd=_0x4a7800[_0x27d214];_0x4567bf=_0x5e9ffc['substring'](0x0,_0x4a8368);_0x5e9ffc=_0x5e9ffc['substring'](_0x4a8368+_0x17e6bd['length']);var _0xb788d=_0x4567bf[_0x4632('0x9')](_0xa77962),_0x249b43=0x0,_0x2c3306={},_0x38e49c='',_0x5a8874='',_0x1b68f8=-0x1;while(_0xb788d[_0x249b43]){_0x1b68f8=_0xb788d[_0x249b43][_0x4632('0x8')](':');if(_0x1b68f8!=-0x1){_0x38e49c=_0xb788d[_0x249b43]['slice'](0x0,_0x1b68f8)[_0x4632('0xa')]();_0x5a8874=_0xb788d[_0x249b43][_0x4632('0xb')](_0x1b68f8+0x1)[_0x4632('0xa')]();if(_0x38e49c[_0x4632('0xc')]>0x0){_0x2c3306[_0x38e49c]=_0x5a8874;}}else{}_0x249b43++;}this[_0x4632('0xd')](_0x4632('0xe'),_0x2c3306);this[_0x4632('0x3')]=!![];}_0x27d214++;}this['_localBuffer']=_0x5e9ffc;}else{while((_0x3f467c=_0x5e9ffc[_0x4632('0x8')](_0xa77962))!=-0x1){_0x4567bf=_0x5e9ffc[_0x4632('0xf')](0x0,_0x3f467c);this[_0x4632('0xd')](_0x4632('0x10'),_0x4567bf);_0x5e9ffc=_0x5e9ffc[_0x4632('0xf')](_0x3f467c+_0xa77962[_0x4632('0xc')]);}this[_0x4632('0x2')]=_0x5e9ffc;}_0x39d265();};module[_0x4632('0x11')]=AGIReply; \ No newline at end of file +var _0xc5bd=['emit','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','substring','length','split','slice','trim','headers','indexOf'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc5bd,0x9a));var _0xdc5b=function(_0x528220,_0x55e56c){_0x528220=_0x528220-0x0;var _0x2a2416=_0xc5bd[_0x528220];return _0x2a2416;};'use strict';var util=require(_0xdc5b('0x0'));var Transform=require(_0xdc5b('0x1'))[_0xdc5b('0x2')];function AGIReply(_0x182c54){Transform[_0xdc5b('0x3')](this,_0x182c54);this[_0xdc5b('0x4')]='';this[_0xdc5b('0x5')]=![];}util[_0xdc5b('0x6')](AGIReply,Transform);AGIReply[_0xdc5b('0x7')][_0xdc5b('0x8')]=function(_0x4df9bd,_0x234963,_0x5962ce){var _0x4cb21f='\x0a',_0x305200=['\x0a\x0a',_0xdc5b('0x9')],_0x19341e=-0x1,_0x491e54=-0x1,_0x4ae255='',_0x2a4d6e=0x0,_0x1b2782='',_0x234730='';this[_0xdc5b('0x4')]+=_0x4df9bd['toString']();_0x1b2782=this[_0xdc5b('0x4')];if(!this[_0xdc5b('0x5')]){_0x2a4d6e=0x0;while(_0x305200[_0x2a4d6e]){while((_0x491e54=_0x1b2782['indexOf'](_0x305200[_0x2a4d6e]))!=-0x1){_0x4ae255=_0x305200[_0x2a4d6e];_0x234730=_0x1b2782[_0xdc5b('0xa')](0x0,_0x491e54);_0x1b2782=_0x1b2782['substring'](_0x491e54+_0x4ae255[_0xdc5b('0xb')]);var _0x38750e=_0x234730[_0xdc5b('0xc')](_0x4cb21f),_0x38a79e=0x0,_0x4975ca={},_0x3839be='',_0x210508='',_0x4211c8=-0x1;while(_0x38750e[_0x38a79e]){_0x4211c8=_0x38750e[_0x38a79e]['indexOf'](':');if(_0x4211c8!=-0x1){_0x3839be=_0x38750e[_0x38a79e][_0xdc5b('0xd')](0x0,_0x4211c8)['trim']();_0x210508=_0x38750e[_0x38a79e]['slice'](_0x4211c8+0x1)[_0xdc5b('0xe')]();if(_0x3839be[_0xdc5b('0xb')]>0x0){_0x4975ca[_0x3839be]=_0x210508;}}else{}_0x38a79e++;}this['emit'](_0xdc5b('0xf'),_0x4975ca);this[_0xdc5b('0x5')]=!![];}_0x2a4d6e++;}this[_0xdc5b('0x4')]=_0x1b2782;}else{while((_0x19341e=_0x1b2782[_0xdc5b('0x10')](_0x4cb21f))!=-0x1){_0x234730=_0x1b2782['substring'](0x0,_0x19341e);this[_0xdc5b('0x11')]('line',_0x234730);_0x1b2782=_0x1b2782['substring'](_0x19341e+_0x4cb21f['length']);}this['_localBuffer']=_0x1b2782;}_0x5962ce();};module[_0xdc5b('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index e169fe1..2b7a447 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 _0x4c4e=['agentUnpause','UnpauseUser','lodash','jayson/promise','client','http','then','error','message','result','catch','getSquareProjects','GetSquareProjects','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','name','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','merge','arg_2','format','createSquareMessage','createCmContact','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser'];(function(_0x4cb629,_0x40e7ab){var _0x3044ed=function(_0x187575){while(--_0x187575){_0x4cb629['push'](_0x4cb629['shift']());}};_0x3044ed(++_0x40e7ab);}(_0x4c4e,0x152));var _0xe4c4=function(_0x270a79,_0x415cbb){_0x270a79=_0x270a79-0x0;var _0x40df00=_0x4c4e[_0x270a79];return _0x40df00;};'use strict';var _=require(_0xe4c4('0x0'));var moment=require('moment');var jayson=require(_0xe4c4('0x1'));var client=jayson[_0xe4c4('0x2')][_0xe4c4('0x3')]({'port':0x2329});function request(_0x58c8f6,_0x1b6c91){return new Promise(function(_0x7d7655,_0x1a4483){return client['request'](_0x58c8f6,_0x1b6c91)[_0xe4c4('0x4')](function(_0x533a68){if(_0x533a68[_0xe4c4('0x5')]){return _0x1a4483(_0x533a68[_0xe4c4('0x5')][_0xe4c4('0x6')]);}else{return _0x7d7655(_0x533a68[_0xe4c4('0x7')]);}})[_0xe4c4('0x8')](function(_0x329d29){return _0x1a4483(_0x329d29);});});}exports[_0xe4c4('0x9')]=function(){return request(_0xe4c4('0xa'),{'options':{'raw':![],'attributes':['id','name','production']}});};exports[_0xe4c4('0xb')]=function(_0x6f2545){return request(_0xe4c4('0xc'),{'options':{'raw':![],'where':{'name':_0x6f2545},'attributes':[_0xe4c4('0xd')]}});};exports[_0xe4c4('0xe')]=function(_0x2f4d5f){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x2f4d5f},'include':[{'model':_0xe4c4('0xf'),'as':_0xe4c4('0x10'),'include':[{'model':_0xe4c4('0x11'),'as':_0xe4c4('0x11')}]}],'attributes':['id','name',_0xe4c4('0x12')],'smtp':!![]}});};exports[_0xe4c4('0x13')]=function(_0x515056){return request(_0xe4c4('0xc'),{'options':{'where':{'id':_0x515056},'attributes':[_0xe4c4('0x14')]}});};exports['getVoiceQueueById']=function(_0x42ce9e){return request(_0xe4c4('0x15'),{'options':{'where':{'id':_0x42ce9e},'attributes':['name']}});};exports[_0xe4c4('0x16')]=function(_0x465c9b){return request(_0xe4c4('0x17'),{'options':{'where':{'id':_0x465c9b},'attributes':[_0xe4c4('0x14')]}});};exports[_0xe4c4('0x18')]=function(_0x882be2){return request(_0xe4c4('0x19'),{'options':{'where':{'id':_0x882be2},'attributes':[_0xe4c4('0x1a')]}});};exports[_0xe4c4('0x1b')]=function(_0x36b10c){return request(_0xe4c4('0x1c'),{'options':{'where':{'id':_0x36b10c},'attributes':[_0xe4c4('0x14')]}});};exports[_0xe4c4('0x1d')]=function(_0x43a9ce){return request(_0xe4c4('0x1e'),{'options':{'where':{'phone':_0x43a9ce['phone']},'attributes':['id']}});};exports[_0xe4c4('0x1f')]=function(_0x24f946){return request(_0xe4c4('0x20'),{'options':{'where':{'id':_0x24f946},'attributes':[_0xe4c4('0x14')]}});};exports['getSoundById']=function(_0x3d5856){return request(_0xe4c4('0x21'),{'options':{'where':{'id':_0x3d5856},'attributes':[_0xe4c4('0x22')]}});};exports[_0xe4c4('0x23')]=function(_0x2c5aea){return request(_0xe4c4('0x24'),{'options':{'raw':![],'where':{'id':_0x2c5aea},'include':[{'model':_0xe4c4('0x25'),'as':_0xe4c4('0x26')}]}});};exports[_0xe4c4('0x27')]=function(_0x1a7690){return request(_0xe4c4('0x28'),{'options':{'where':{'id':_0x1a7690},'attributes':['id',_0xe4c4('0x14')]}});};exports[_0xe4c4('0x29')]=function(_0x1db719){return request(_0xe4c4('0x2a'),{'body':_0x1db719});};exports['createSquareDetailsReport']=function(_0x49cadc){return request(_0xe4c4('0x2b'),{'body':_0x49cadc});};exports['createSquareReport']=function(_0xf6024d){return request('CreateSquareReport',{'body':_[_0xe4c4('0x2c')](_0xf6024d,{'project_name':_0xf6024d['arg_1'],'prev_project_name':_0xf6024d[_0xe4c4('0x2d')]||'','is_subproject':_0xf6024d['arg_2']?!![]:![],'leaveAt':moment()[_0xe4c4('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x4cea1f){return request('CreateSquareRecording',{'body':_0x4cea1f});};exports[_0xe4c4('0x2f')]=function(_0x48cfe0){return request('CreateSquareMessage',{'body':_0x48cfe0});};exports[_0xe4c4('0x30')]=function(_0x11deab){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x11deab['phone'],'ListId':_0x11deab[_0xe4c4('0x31')]}}})[_0xe4c4('0x4')](function(_0x4aa6c1){if(_0x4aa6c1){return _0x4aa6c1;}return request(_0xe4c4('0x32'),{'body':_0x11deab});});};exports[_0xe4c4('0x33')]=function(_0x3f60fc){return request('ShowPause',{'options':{'where':{'id':_0x3f60fc},'attributes':['name']}});};exports[_0xe4c4('0x34')]=function(_0x2c5652,_0x12bde8){return request(_0xe4c4('0x35'),{'body':{'interface':_0x12bde8},'options':{'where':_0x2c5652}});};exports['agentPause']=function(_0x49c913,_0x1731c8,_0x2e4282){return request('PauseUser',{'body':{'type':_0x1731c8,'uniqueid':_0x2e4282},'options':{'where':_0x49c913}});};exports[_0xe4c4('0x36')]=function(_0x1ad3e6){return request(_0xe4c4('0x37'),{'body':{},'options':{'where':_0x1ad3e6}});};exports['agentLogout']=function(_0x137f40){return request('LogoutUser',{'body':{},'options':{'where':_0x137f40}});}; \ No newline at end of file +var _0x45ea=['ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','ShowSound','save_name','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSquareDetailsReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ShowPause','LoginUser','agentPause','UnpauseUser','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','getSquareProjects','GetSquareProjects','name','production','ShowSquareProject','getMailAccountById','MailServerOut','CloudProvider','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0x45ea,0x1f0));var _0xa45e=function(_0x4145e6,_0x32a3a9){_0x4145e6=_0x4145e6-0x0;var _0x1968a9=_0x45ea[_0x4145e6];return _0x1968a9;};'use strict';var _=require(_0xa45e('0x0'));var moment=require(_0xa45e('0x1'));var jayson=require(_0xa45e('0x2'));var client=jayson[_0xa45e('0x3')][_0xa45e('0x4')]({'port':0x2329});function request(_0x2ae182,_0x2e2968){return new Promise(function(_0x3dc05b,_0x43da76){return client[_0xa45e('0x5')](_0x2ae182,_0x2e2968)[_0xa45e('0x6')](function(_0x5f2447){if(_0x5f2447[_0xa45e('0x7')]){return _0x43da76(_0x5f2447[_0xa45e('0x7')]['message']);}else{return _0x3dc05b(_0x5f2447['result']);}})['catch'](function(_0x40befe){return _0x43da76(_0x40befe);});});}exports[_0xa45e('0x8')]=function(){return request(_0xa45e('0x9'),{'options':{'raw':![],'attributes':['id',_0xa45e('0xa'),_0xa45e('0xb')]}});};exports['getSquareProject']=function(_0x506435){return request(_0xa45e('0xc'),{'options':{'raw':![],'where':{'name':_0x506435},'attributes':[_0xa45e('0xb')]}});};exports[_0xa45e('0xd')]=function(_0x2c0c37){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x2c0c37},'include':[{'model':_0xa45e('0xe'),'as':'Smtp','include':[{'model':_0xa45e('0xf'),'as':_0xa45e('0xf')}]}],'attributes':['id','name','email'],'smtp':!![]}});};exports[_0xa45e('0x10')]=function(_0x5bfe00){return request(_0xa45e('0xc'),{'options':{'where':{'id':_0x5bfe00},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x4f36f8){return request(_0xa45e('0x11'),{'options':{'where':{'id':_0x4f36f8},'attributes':['name']}});};exports[_0xa45e('0x12')]=function(_0x2fbd46){return request(_0xa45e('0x13'),{'options':{'where':{'id':_0x2fbd46},'attributes':[_0xa45e('0xa')]}});};exports[_0xa45e('0x14')]=function(_0x5323d0){return request(_0xa45e('0x15'),{'options':{'where':{'id':_0x5323d0},'attributes':[_0xa45e('0x16')]}});};exports[_0xa45e('0x17')]=function(_0x326ed4){return request(_0xa45e('0x18'),{'options':{'where':{'id':_0x326ed4},'attributes':['name']}});};exports[_0xa45e('0x19')]=function(_0x8e85c1){return request(_0xa45e('0x1a'),{'options':{'where':{'phone':_0x8e85c1[_0xa45e('0x1b')]},'attributes':['id']}});};exports[_0xa45e('0x1c')]=function(_0x3901c9){return request(_0xa45e('0x1d'),{'options':{'where':{'id':_0x3901c9},'attributes':[_0xa45e('0xa')]}});};exports['getSoundById']=function(_0x14e2db){return request(_0xa45e('0x1e'),{'options':{'where':{'id':_0x14e2db},'attributes':[_0xa45e('0x1f')]}});};exports['getIntervalById']=function(_0x50f7c4){return request(_0xa45e('0x20'),{'options':{'raw':![],'where':{'id':_0x50f7c4},'include':[{'model':'Interval','as':_0xa45e('0x21')}]}});};exports[_0xa45e('0x22')]=function(_0x26c7b1){return request(_0xa45e('0x23'),{'options':{'where':{'id':_0x26c7b1},'attributes':['id',_0xa45e('0xa')]}});};exports['createSmsMessage']=function(_0x107d9c){return request('CreateSmsMessage',{'body':_0x107d9c});};exports[_0xa45e('0x24')]=function(_0x2f77b7){return request('CreateSquareDetailsReport',{'body':_0x2f77b7});};exports['createSquareReport']=function(_0x2f6f75){return request('CreateSquareReport',{'body':_[_0xa45e('0x25')](_0x2f6f75,{'project_name':_0x2f6f75[_0xa45e('0x26')],'prev_project_name':_0x2f6f75[_0xa45e('0x27')]||'','is_subproject':_0x2f6f75['arg_2']?!![]:![],'leaveAt':moment()['format'](_0xa45e('0x28'))})});};exports[_0xa45e('0x29')]=function(_0x228ec8){return request(_0xa45e('0x2a'),{'body':_0x228ec8});};exports[_0xa45e('0x2b')]=function(_0x49142d){return request(_0xa45e('0x2c'),{'body':_0x49142d});};exports[_0xa45e('0x2d')]=function(_0x5e2a58){return request(_0xa45e('0x2e'),{'options':{'raw':![],'where':{'phone':_0x5e2a58['phone'],'ListId':_0x5e2a58['ListId']}}})[_0xa45e('0x6')](function(_0xacc140){if(_0xacc140){return _0xacc140;}return request('CreateCmContact',{'body':_0x5e2a58});});};exports['getPauseById']=function(_0x203687){return request(_0xa45e('0x2f'),{'options':{'where':{'id':_0x203687},'attributes':[_0xa45e('0xa')]}});};exports['agentLogin']=function(_0x118a82,_0x4683a0){return request(_0xa45e('0x30'),{'body':{'interface':_0x4683a0},'options':{'where':_0x118a82}});};exports[_0xa45e('0x31')]=function(_0x49ee26,_0x45248a,_0xf92852){return request('PauseUser',{'body':{'type':_0x45248a,'uniqueid':_0xf92852},'options':{'where':_0x49ee26}});};exports['agentUnpause']=function(_0x1d23a){return request(_0xa45e('0x32'),{'body':{},'options':{'where':_0x1d23a}});};exports['agentLogout']=function(_0x3597c7){return request(_0xa45e('0x33'),{'body':{},'options':{'where':_0x3597c7}});}; \ 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 9d3c5a7..afada95 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 _0xef17=['exports','./polly','./lex'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xef17,0x136));var _0x7ef1=function(_0x357c48,_0x1a3baa){_0x357c48=_0x357c48-0x0;var _0x25d6c8=_0xef17[_0x357c48];return _0x25d6c8;};var polly=require(_0x7ef1('0x0'));var lex=require(_0x7ef1('0x1'));module[_0x7ef1('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xd9a8=['./polly','./lex','exports'];(function(_0x5c9d48,_0x5a7b85){var _0x29d9f2=function(_0x36eecb){while(--_0x36eecb){_0x5c9d48['push'](_0x5c9d48['shift']());}};_0x29d9f2(++_0x5a7b85);}(_0xd9a8,0xc3));var _0x8d9a=function(_0x56fdc4,_0x28f981){_0x56fdc4=_0x56fdc4-0x0;var _0xd0a374=_0xd9a8[_0x56fdc4];return _0xd0a374;};var polly=require(_0x8d9a('0x0'));var lex=require(_0x8d9a('0x1'));module[_0x8d9a('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 5cd7054..2a1f5da 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 _0x96cc=['./lib/api'];(function(_0x3a8463,_0x5ee154){var _0x192086=function(_0x4c2438){while(--_0x4c2438){_0x3a8463['push'](_0x3a8463['shift']());}};_0x192086(++_0x5ee154);}(_0x96cc,0x16c));var _0xc96c=function(_0x5b9d3a,_0x1f1842){_0x5b9d3a=_0x5b9d3a-0x0;var _0x383375=_0x96cc[_0x5b9d3a];return _0x383375;};'use strict';var lex=require(_0xc96c('0x0'));module['exports']=function(_0x15025f,_0x5f11f2,_0x30bf8a,_0x3e7a95,_0x107043,_0x421701){return lex(_0x15025f,_0x5f11f2,_0x30bf8a,_0x3e7a95,_0x107043,_0x421701);}; \ No newline at end of file +var _0x91a7=['exports'];(function(_0x36f80c,_0x443cdc){var _0x28b842=function(_0x56e478){while(--_0x56e478){_0x36f80c['push'](_0x36f80c['shift']());}};_0x28b842(++_0x443cdc);}(_0x91a7,0xe7));var _0x791a=function(_0x4b8caa,_0x265688){_0x4b8caa=_0x4b8caa-0x0;var _0x4c600e=_0x91a7[_0x4b8caa];return _0x4c600e;};'use strict';var lex=require('./lib/api');module[_0x791a('0x0')]=function(_0x3d6eab,_0x268862,_0x5d2796,_0x415994,_0x5b6f78,_0x2f6392){return lex(_0x3d6eab,_0x268862,_0x5d2796,_0x415994,_0x5b6f78,_0x2f6392);}; \ 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 799dd46..7a2b92a 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(_0x33c997,_0x58cd74){var _0x36c8e6=function(_0x12efcd){while(--_0x12efcd){_0x33c997['push'](_0x33c997['shift']());}};_0x36c8e6(++_0x58cd74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x4d5971,_0x8364f7){var _0x36737a=function(_0x46057d){while(--_0x46057d){_0x4d5971['push'](_0x4d5971['shift']());}};_0x36737a(++_0x8364f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 b5b137b..b241094 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 _0x200c=['./lib/api'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x200c,0x72));var _0xc200=function(_0x5e237c,_0x344f29){_0x5e237c=_0x5e237c-0x0;var _0x3d2228=_0x200c[_0x5e237c];return _0x3d2228;};'use strict';var polly=require(_0xc200('0x0'));module['exports']=function(_0x3ccb17,_0x58ce78,_0x1dc9c,_0x28f539,_0x2b6daa,_0x4387e0,_0x52c4fb){return polly(_0x3ccb17,_0x58ce78,_0x1dc9c,_0x28f539,_0x2b6daa,_0x4387e0,_0x52c4fb);}; \ No newline at end of file +var _0xf85b=['./lib/api','exports'];(function(_0x33d790,_0x140560){var _0x4da041=function(_0x3b088a){while(--_0x3b088a){_0x33d790['push'](_0x33d790['shift']());}};_0x4da041(++_0x140560);}(_0xf85b,0x92));var _0xbf85=function(_0x55b43f,_0x572a16){_0x55b43f=_0x55b43f-0x0;var _0x47ee5b=_0xf85b[_0x55b43f];return _0x47ee5b;};'use strict';var polly=require(_0xbf85('0x0'));module[_0xbf85('0x1')]=function(_0x578a87,_0x1ca13a,_0x152a3d,_0x4ac969,_0xacdd52,_0x7b7f3e,_0x3c7968){return polly(_0x578a87,_0x1ca13a,_0x152a3d,_0x4ac969,_0xacdd52,_0x7b7f3e,_0x3c7968);}; \ 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 02504d1..570c0a2 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 _0x6d69=['mp3','path','randomstring','synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x1c5b6e,_0x4a9820){var _0x109efa=function(_0x5e8615){while(--_0x5e8615){_0x1c5b6e['push'](_0x1c5b6e['shift']());}};_0x109efa(++_0x4a9820);}(_0x6d69,0x173));var _0x96d6=function(_0x2ad1b6,_0x4ecf4b){_0x2ad1b6=_0x2ad1b6-0x0;var _0x1b0b6=_0x6d69[_0x2ad1b6];return _0x1b0b6;};'use strict';var fs=require('fs');var path=require(_0x96d6('0x0'));var BPromise=require('bluebird');var rs=require(_0x96d6('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x559126,_0x3a56b0,_0x3f7a00){return new BPromise(function(_0xedce50,_0x43fcd0){_0x559126[_0x96d6('0x2')](_0x3a56b0,function(_0x1f95bf,_0xbffcad){if(_0x1f95bf){_0x43fcd0(_0x1f95bf);}else if(_0xbffcad){if(_0xbffcad[_0x96d6('0x3')]instanceof Buffer){fs[_0x96d6('0x4')](_0x3f7a00,_0xbffcad['AudioStream'],function(_0x3ddfdc){if(_0x3ddfdc){_0x43fcd0(_0x3ddfdc);}else{_0xedce50();}});}else{_0x43fcd0(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x43fcd0(new Error(_0x96d6('0x5')));}});});}module[_0x96d6('0x6')]=function(_0x26a706,_0x5c9880,_0x3509aa,_0xa8d5b6,_0x41fdb0,_0x38c51d,_0x2487d2){var _0xab340c=new AWS[(_0x96d6('0x7'))]({'accessKeyId':_0x26a706,'secretAccessKey':_0x5c9880,'region':_0x3509aa});var _0x5e88aa={'Text':_0x41fdb0,'TextType':_0x38c51d||_0x96d6('0x8'),'OutputFormat':_0x96d6('0x9'),'VoiceId':_0xa8d5b6};return pollyResult(_0xab340c,_0x5e88aa,_0x2487d2);}; \ No newline at end of file +var _0x73a1=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','bluebird','randomstring','AudioStream','writeFile'];(function(_0x5e0a32,_0x55260c){var _0xe922a3=function(_0x3d3d90){while(--_0x3d3d90){_0x5e0a32['push'](_0x5e0a32['shift']());}};_0xe922a3(++_0x55260c);}(_0x73a1,0x1b4));var _0x173a=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0x73a1[_0x1602ef];return _0x5870ee;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x173a('0x0'));var rs=require(_0x173a('0x1'));var AWS=require('aws-sdk');function pollyResult(_0xbac9b1,_0x1261c9,_0x1486b4){return new BPromise(function(_0x4abed6,_0x343f4a){_0xbac9b1['synthesizeSpeech'](_0x1261c9,function(_0x4bc2b0,_0x254ec6){if(_0x4bc2b0){_0x343f4a(_0x4bc2b0);}else if(_0x254ec6){if(_0x254ec6[_0x173a('0x2')]instanceof Buffer){fs[_0x173a('0x3')](_0x1486b4,_0x254ec6[_0x173a('0x2')],function(_0x4c5414){if(_0x4c5414){_0x343f4a(_0x4c5414);}else{_0x4abed6();}});}else{_0x343f4a(new Error(_0x173a('0x4')));}}else{_0x343f4a(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x510108,_0x4ee472,_0x4f4490,_0x228556,_0x3bf5d1,_0x2121bf,_0x90d3d1){var _0x59bb5e=new AWS[(_0x173a('0x5'))]({'accessKeyId':_0x510108,'secretAccessKey':_0x4ee472,'region':_0x4f4490});var _0x58c54c={'Text':_0x3bf5d1,'TextType':_0x2121bf||_0x173a('0x6'),'OutputFormat':_0x173a('0x7'),'VoiceId':_0x228556};return pollyResult(_0x59bb5e,_0x58c54c,_0x90d3d1);}; \ 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 2182d29..5f47a2c 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 _0x21d3=['./lib/api','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x21d3,0xb8));var _0x321d=function(_0x4fa3b3,_0x478148){_0x4fa3b3=_0x4fa3b3-0x0;var _0x381715=_0x21d3[_0x4fa3b3];return _0x381715;};'use strict';var asr=require(_0x321d('0x0'));module[_0x321d('0x1')]=function(_0x42aea9,_0x1bb7f6,_0x68a73c,_0x301ed8){return asr(_0x42aea9,_0x1bb7f6,_0x68a73c);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x1df57e,_0x5f4f76,_0x1bc50b,_0x4418a7){return asr(_0x1df57e,_0x5f4f76,_0x1bc50b);}; \ 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 26a99af..3128a3e 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 _0x12fd=['8000','url','bluebird','https://speech.googleapis.com','exports','string','length','key\x20should\x20be\x20a\x20string','undefined','readFileSync','base64','LINEAR16'];(function(_0x180904,_0x4aa968){var _0x3c2d32=function(_0x58a603){while(--_0x58a603){_0x180904['push'](_0x180904['shift']());}};_0x3c2d32(++_0x4aa968);}(_0x12fd,0x199));var _0xd12f=function(_0x3ad4a6,_0x4d0a33){_0x3ad4a6=_0x3ad4a6-0x0;var _0x6b7dd9=_0x12fd[_0x3ad4a6];return _0x6b7dd9;};'use strict';var url=require(_0xd12f('0x0'));var BPromise=require(_0xd12f('0x1'));var fs=require('fs');var host=_0xd12f('0x2');module[_0xd12f('0x3')]=function(_0x18abfb,_0x48fb45,_0x1e72a3){return new BPromise(function(_0x37f6b4,_0x13efed){var _0x239bf2;if(typeof _0x18abfb!==_0xd12f('0x4')||_0x18abfb[_0xd12f('0x5')]===0x0){return _0x13efed('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x48fb45!==_0xd12f('0x4')||_0x48fb45['length']===0x0){return _0x13efed(_0xd12f('0x6'));}if(typeof _0x1e72a3!==_0xd12f('0x7')&&(typeof _0x1e72a3!==_0xd12f('0x4')||_0x1e72a3[_0xd12f('0x5')]===0x0)){return _0x13efed('lang\x20should\x20be\x20a\x20string');}try{_0x239bf2=fs[_0xd12f('0x8')](_0x18abfb)['toString'](_0xd12f('0x9'));}catch(_0x5108a9){return _0x13efed(_0x5108a9);}return _0x37f6b4({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x48fb45,'body':{'config':{'encoding':_0xd12f('0xa'),'sampleRateHertz':_0xd12f('0xb'),'languageCode':_0x1e72a3},'audio':{'content':_0x239bf2}},'json':!![]});});}; \ No newline at end of file +var _0x195e=['base64','POST','/v1/speech:recognize?key=','8000','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined'];(function(_0xcc69c5,_0x5b35b2){var _0x14ec59=function(_0x4377ec){while(--_0x4377ec){_0xcc69c5['push'](_0xcc69c5['shift']());}};_0x14ec59(++_0x5b35b2);}(_0x195e,0xfb));var _0xe195=function(_0x1d9775,_0x405124){_0x1d9775=_0x1d9775-0x0;var _0x14991a=_0x195e[_0x1d9775];return _0x14991a;};'use strict';var url=require(_0xe195('0x0'));var BPromise=require(_0xe195('0x1'));var fs=require('fs');var host=_0xe195('0x2');module[_0xe195('0x3')]=function(_0x40fe4d,_0x3975a9,_0x31ca3b){return new BPromise(function(_0x4064fd,_0x2243e9){var _0x30011c;if(typeof _0x40fe4d!==_0xe195('0x4')||_0x40fe4d[_0xe195('0x5')]===0x0){return _0x2243e9(_0xe195('0x6'));}if(typeof _0x3975a9!=='string'||_0x3975a9[_0xe195('0x5')]===0x0){return _0x2243e9(_0xe195('0x7'));}if(typeof _0x31ca3b!==_0xe195('0x8')&&(typeof _0x31ca3b!==_0xe195('0x4')||_0x31ca3b[_0xe195('0x5')]===0x0)){return _0x2243e9('lang\x20should\x20be\x20a\x20string');}try{_0x30011c=fs['readFileSync'](_0x40fe4d)['toString'](_0xe195('0x9'));}catch(_0x3a7b4e){return _0x2243e9(_0x3a7b4e);}return _0x4064fd({'method':_0xe195('0xa'),'uri':host+_0xe195('0xb')+_0x3975a9,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xe195('0xc'),'languageCode':_0x31ca3b},'audio':{'content':_0x30011c}},'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 539d29c..cf05306 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 _0x8a44=['./asr'];(function(_0x512f81,_0x4a7986){var _0xa15099=function(_0x1f7371){while(--_0x1f7371){_0x512f81['push'](_0x512f81['shift']());}};_0xa15099(++_0x4a7986);}(_0x8a44,0xae));var _0x48a4=function(_0x2f1500,_0x2ee567){_0x2f1500=_0x2f1500-0x0;var _0xc71493=_0x8a44[_0x2f1500];return _0xc71493;};var asr=require(_0x48a4('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xe7ad=['exports'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0xe7ad,0xf6));var _0xde7a=function(_0x3fa261,_0x17b454){_0x3fa261=_0x3fa261-0x0;var _0x3b449c=_0xe7ad[_0x3fa261];return _0x3b449c;};var asr=require('./asr');module[_0xde7a('0x0')]={'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 741d546..fc3a551 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 _0x895a=['../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','close','error','unlink','download\x20error','end','data','transcode','error\x20convert','start','tmp','generate','writeFileSync','base64','then','chmodSync','777','split','readFileSync','googleCloudTTS','ssml','input','voice','MP3','text:synthesize','POST','.mp3','from','resolve','.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','stringify','jQ1olc','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','googleASR','asr','uri','alternatives','transcript','join','results','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','message','googleDialogflow','textRequest','source','result','resolvedQuery','action','speech','score','code','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','fields','diagnosticInfo','end_conversation','boolValue','fulfillmentText','intent','name','languageCode','responseId','intentDetectionConfidence','Tilde\x20ASR\x20confidence','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','channelData','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./tilde'];(function(_0x28833e,_0xdf7fd0){var _0x21d852=function(_0x1e0d17){while(--_0x1e0d17){_0x28833e['push'](_0x28833e['shift']());}};_0x21d852(++_0xdf7fd0);}(_0x895a,0xec));var _0xa895=function(_0x425d71,_0x13dac4){_0x425d71=_0x425d71-0x0;var _0x48b8f0=_0x895a[_0x425d71];return _0x48b8f0;};'use strict';var apiai=require(_0xa895('0x0'));var BPromise=require(_0xa895('0x1'));var dialogflow=require(_0xa895('0x2'));var fs=require('fs');var http=require(_0xa895('0x3'));var https=require(_0xa895('0x4'));var md5=require(_0xa895('0x5'));var path=require(_0xa895('0x6'));var querystring=require(_0xa895('0x7'));var rp=require(_0xa895('0x8'));var rs=require(_0xa895('0x9'));var sox=require(_0xa895('0xa'));var tts=require(_0xa895('0xb'));var urlParse=require(_0xa895('0xc'))[_0xa895('0xd')];var util=require(_0xa895('0xe'));var aws=require('./aws');var google=require('./google');var sestek=require('./sestek');var tilde=require(_0xa895('0xf'));var logger=require(_0xa895('0x10'))(_0xa895('0x11'));var ISPEECH_API=_0xa895('0x12');function downloadFile(_0x55c3d0,_0x51b74f){return new BPromise(function(_0x34341d,_0x1e3500){var _0x6224da=urlParse(_0x55c3d0);var _0x470496=_0x6224da[_0xa895('0x13')]==='https:'?https:http;var _0x496e76={'host':_0x6224da[_0xa895('0x14')],'path':_0x6224da[_0xa895('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x470496[_0xa895('0x15')](_0x496e76,function(_0x154c02){if(_0x154c02[_0xa895('0x16')]!==0xc8){logger['error'](_0xa895('0x17')+_0x55c3d0+_0xa895('0x18')+_0x154c02['statusCode']+'\x20('+_0x154c02['statusMessage']+')');_0x1e3500(new Error(_0xa895('0x17')+_0x55c3d0+_0xa895('0x18')+_0x154c02['statusCode']+'\x20('+_0x154c02[_0xa895('0x19')]+')'));return;}var _0x5752a0=fs[_0xa895('0x1a')](_0x51b74f);_0x5752a0['on'](_0xa895('0x1b'),function(){logger[_0xa895('0x1c')]('finish\x20download\x20file');_0x5752a0[_0xa895('0x1d')](_0x34341d);});_0x5752a0['on'](_0xa895('0x1e'),function(_0x26057a){fs[_0xa895('0x1f')](_0x51b74f);logger['error'](_0xa895('0x20'),_0x26057a);_0x1e3500(_0x26057a);});_0x154c02['pipe'](_0x5752a0);})['on'](_0xa895('0x1e'),function(_0x17d94d){logger[_0xa895('0x1e')](_0x17d94d);_0x1e3500(_0x17d94d);})[_0xa895('0x21')]();});}function uploadFile(_0x250906){return new BPromise(function(_0x51bbc8,_0x82ffc9){var _0x568947=urlParse(_0x250906);var _0x3fdc95=_0x568947[_0xa895('0x13')]==='https:'?https:http;var _0x441a84={'host':_0x568947[_0xa895('0x14')],'path':_0x568947[_0xa895('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x3fdc95[_0xa895('0x15')](_0x441a84,function(_0x2a439a){if(_0x2a439a[_0xa895('0x16')]!==0xc8){_0x82ffc9(new Error(_0xa895('0x17')+_0x250906+'\x20failed,\x20status\x20code\x20=\x20'+_0x2a439a[_0xa895('0x16')]+'\x20('+_0x2a439a[_0xa895('0x19')]+')'));return;}var _0x324001='';_0x2a439a['on'](_0xa895('0x22'),function(_0x1e75ee){_0x324001+=_0x1e75ee;});_0x2a439a['on'](_0xa895('0x21'),function(){_0x51bbc8(_0x324001);});})['on']('error',function(_0x32ac42){_0x82ffc9(_0x32ac42);})['end']();});}function convertFile(_0x43231d,_0x4de097){return new BPromise(function(_0x256f82,_0x43280b){var _0x2eb055=sox[_0xa895('0x23')](_0x43231d,_0x4de097,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2eb055['on'](_0xa895('0x1e'),function(_0x4bc370){logger[_0xa895('0x1e')](_0xa895('0x24'),_0x4bc370);_0x43280b(_0x4bc370);});_0x2eb055['on']('end',function(){logger[_0xa895('0x1c')]('finish\x20to\x20convert');_0x256f82();});_0x2eb055[_0xa895('0x25')]();});}function base64Decode(_0x32773d,_0x819942){var _0xbfa0ab=path['resolve'](__dirname,_0xa895('0x26'),rs[_0xa895('0x27')](0x4)+'.wav');fs[_0xa895('0x28')](_0xbfa0ab,_0x32773d,_0xa895('0x29'));return convertFile(_0xbfa0ab,_0x819942)[_0xa895('0x2a')](function(){try{fs[_0xa895('0x1f')](_0xbfa0ab);fs[_0xa895('0x2b')](_0x819942,_0xa895('0x2c'));}catch(_0x1b544c){logger[_0xa895('0x1e')](_0x1b544c);}return _0x819942[_0xa895('0x2d')]('.')[0x0];});}function base64Encode(_0x16aee9){var _0x51517c=fs[_0xa895('0x2e')](_0x16aee9);return new Buffer(_0x51517c)['toString'](_0xa895('0x29'));}exports[_0xa895('0x2f')]=function(_0x403e8b,_0x36768d,_0x651565,_0x41d34f,_0x2da87b,_0x6a1405){var _0x8e0f0e,_0x9eb3e1;var _0x38af75='https://texttospeech.googleapis.com/v1/';var _0x55e4bc='?key='+_0x403e8b;var _0x360ac1={};if(_0x36768d===_0xa895('0x30')){_0x360ac1['input']={'ssml':_0x651565};}else{_0x360ac1[_0xa895('0x31')]={'text':_0x651565};};_0x360ac1[_0xa895('0x32')]={'languageCode':_0x41d34f,'ssmlGender':_0x2da87b};_0x360ac1['audioConfig']={'audioEncoding':_0xa895('0x33'),'sampleRateHertz':0x1f40};var _0x24a6c7={'url':_0x38af75+_0xa895('0x34')+_0x55e4bc,'method':_0xa895('0x35'),'json':!![],'body':_0x360ac1};return rp(_0x24a6c7)[_0xa895('0x2a')](function(_0x1b076b){return new BPromise(function(_0x512943,_0x28ea1f){_0x8e0f0e=path['resolve'](__dirname,_0xa895('0x26'),rs[_0xa895('0x27')](0x4)+_0xa895('0x36'));var _0x61006b=Buffer[_0xa895('0x37')](_0x1b076b['audioContent'],_0xa895('0x29'));return fs['writeFile'](_0x8e0f0e,_0x61006b,function(_0x3246f7){_0x28ea1f(_0x3246f7);},function(_0x32c9ba){fs[_0xa895('0x2b')](_0x8e0f0e,_0xa895('0x2c'));_0x512943(_0x32c9ba);});});})[_0xa895('0x2a')](function(_0x1cace1){_0x9eb3e1=path[_0xa895('0x38')](__dirname,_0xa895('0x26'),rs[_0xa895('0x27')](0x4)+_0xa895('0x39'));return convertFile(_0x8e0f0e,_0x9eb3e1);})[_0xa895('0x2a')](function(){try{fs[_0xa895('0x1f')](_0x8e0f0e);fs[_0xa895('0x2b')](_0x9eb3e1,_0xa895('0x2c'));}catch(_0x5cb0d0){logger['error'](_0x5cb0d0);}logger['info'](_0xa895('0x3a'),_0x9eb3e1[_0xa895('0x2d')]('.')[0x0]);return _0x9eb3e1[_0xa895('0x2d')]('.')[0x0];});};exports[_0xa895('0x3b')]=function(_0x21feb1,_0x338560){var _0x3a0c43=_0xa895('0x3c');var _0x4a5dd6,_0x2d1339;var _0x45414c;var _0x162a48={'encoding':_0xa895('0x3d'),'method':_0xa895('0x35'),'timeout':0x2710,'url':_0x3a0c43,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON[_0xa895('0x3e')]([[[_0xa895('0x3f'),JSON[_0xa895('0x3e')]([_0x21feb1,_0x338560||'en',![],'null']),null,'generic']]]))};return rp(_0x162a48)[_0xa895('0x2a')](function(_0x273b3b){try{_0x45414c=eval(_0x273b3b[_0xa895('0x40')](0x5))[0x0][0x2];}catch(_0xeb11ec){throw new Error(_0xa895('0x41')+_0x273b3b[_0xa895('0x22')]);}if(!_0x45414c){if(_0x21feb1[_0xa895('0x42')]>0xc8){throw new Error(_0xa895('0x43'));}else{throw new Error(_0xa895('0x44')+_0x338560+'\x22\x20might\x20not\x20exist');}}try{_0x45414c=eval(_0x45414c)[0x0];}catch(_0x473bd2){throw new Error(_0xa895('0x41')+res[_0xa895('0x22')]);}const _0x35f2eb=_0x45414c;_0x4a5dd6=path['resolve'](__dirname,_0xa895('0x26'),rs[_0xa895('0x27')](0x4)+_0xa895('0x36'));fs[_0xa895('0x28')](_0x4a5dd6,_0x45414c,{'encoding':_0xa895('0x29')});_0x2d1339=path[_0xa895('0x38')](__dirname,'tmp',rs[_0xa895('0x27')](0x4)+_0xa895('0x39'));return convertFile(_0x4a5dd6,_0x2d1339);})[_0xa895('0x2a')](function(){try{fs[_0xa895('0x1f')](_0x4a5dd6);fs[_0xa895('0x2b')](_0x2d1339,_0xa895('0x2c'));}catch(_0x14d67a){logger[_0xa895('0x1e')](_0x14d67a);}logger['info'](_0xa895('0x45'),_0x2d1339[_0xa895('0x2d')]('.')[0x0]);return _0x2d1339[_0xa895('0x2d')]('.')[0x0];});};exports[_0xa895('0x46')]=function(_0x128a6e,_0x4ff011,_0x5e055f){return google[_0xa895('0x47')](_0x128a6e,_0x4ff011,_0x5e055f)[_0xa895('0x2a')](function(_0x6c111a){logger['info'](_0x6c111a[_0xa895('0x48')]);return rp(_0x6c111a);})[_0xa895('0x2a')](function(_0x8a3a44){var _0x4f49ad='';var _0x1e8a30=0x0;try{fs[_0xa895('0x1f')](_0x128a6e);}catch(_0x578558){logger[_0xa895('0x1e')](_0x578558);}if(_0x8a3a44&&_0x8a3a44['results']){_0x4f49ad=_0x8a3a44['results']['map'](function(_0x48223b){return _0x48223b&&_0x48223b[_0xa895('0x49')][0x0]&&_0x48223b['alternatives'][0x0][_0xa895('0x4a')]?_0x48223b['alternatives'][0x0][_0xa895('0x4a')]:'';})[_0xa895('0x4b')]('\x0a');_0x1e8a30=_0x8a3a44[_0xa895('0x4c')][_0xa895('0x4d')](function(_0x1fab5f){return _0x1fab5f&&_0x1fab5f[_0xa895('0x49')][0x0]&&_0x1fab5f[_0xa895('0x49')][0x0][_0xa895('0x4e')]?_0x1fab5f[_0xa895('0x49')][0x0][_0xa895('0x4e')]:0x0;})[_0xa895('0x4b')]('\x0a');}logger[_0xa895('0x1c')](_0xa895('0x4f'),_0x4f49ad);logger[_0xa895('0x1c')](_0xa895('0x50'),_0x1e8a30);return{'transcript':_0x4f49ad,'confidence':_0x1e8a30};})[_0xa895('0x51')](function(_0x7b9211){logger['error']('[%s]\x20%s:%s',_0x7b9211[_0xa895('0x16')],_0x7b9211['name'],_0x7b9211[_0xa895('0x52')]);});};exports[_0xa895('0x53')]=function(_0x1a06d6,_0x22a449,_0x2c152c,_0x3f1ac9){var _0x5854e3=apiai(_0x22a449,{'language':_0x3f1ac9||'en'});return _0x5854e3[_0xa895('0x54')](_0x2c152c,{'sessionId':md5(_0x1a06d6)})[_0xa895('0x2a')](function(_0x1a76d8){logger[_0xa895('0x1c')](JSON[_0xa895('0x3e')](_0x1a76d8));return{'source':_0x1a76d8['result'][_0xa895('0x55')],'resolvedQuery':_0x1a76d8[_0xa895('0x56')][_0xa895('0x57')],'action':_0x1a76d8[_0xa895('0x56')][_0xa895('0x58')],'actionIncomplete':_0x1a76d8[_0xa895('0x56')]['actionIncomplete'],'speech':_0x1a76d8[_0xa895('0x56')]['fulfillment'][_0xa895('0x59')],'score':_0x1a76d8['result'][_0xa895('0x5a')],'statusCode':_0x1a76d8['status'][_0xa895('0x5b')],'endConversation':_0x1a76d8[_0xa895('0x56')][_0xa895('0x5c')][_0xa895('0x5d')]||![],'isFallbackIntent':_0x1a76d8['result'][_0xa895('0x5c')]['isFallbackIntent']};});};exports[_0xa895('0x5e')]=function(_0x16fc2d,_0x198393,_0x2a7fcd,_0x15482f,_0x416404,_0x3e0700){var _0xe439fb=_0x15482f[_0xa895('0x5f')](/\\n/g,'\x0a');var _0x4cdb0b={'credentials':{'private_key':_0xe439fb,'client_email':_0x2a7fcd}};var _0x4bffa1=new dialogflow[(_0xa895('0x60'))](_0x4cdb0b);var _0x4d7b72=_0x4bffa1[_0xa895('0x61')](_0x198393,md5(_0x16fc2d));var _0x4e9728={'session':_0x4d7b72,'queryInput':{'text':{'text':_0x416404,'languageCode':_0x3e0700}}};return _0x4bffa1[_0xa895('0x62')](_0x4e9728)[_0xa895('0x2a')](function(_0x38411b){if(_0x38411b&&_0x38411b['length']){logger['info'](_0xa895('0x63'),JSON[_0xa895('0x3e')](_0x38411b));var _0x2fafae=_0x38411b[0x0];if(_0x2fafae){var _0x4b9d45={'action':_0x2fafae[_0xa895('0x64')][_0xa895('0x58')],'allRequiredParamsPresent':_0x2fafae[_0xa895('0x64')][_0xa895('0x65')],'endConversation':_0x2fafae[_0xa895('0x64')]['diagnosticInfo']&&_0x2fafae['queryResult']['diagnosticInfo'][_0xa895('0x66')]?_0x2fafae['queryResult'][_0xa895('0x67')][_0xa895('0x66')][_0xa895('0x68')][_0xa895('0x69')]:![],'fulfillmentText':_0x2fafae['queryResult'][_0xa895('0x6a')],'intentName':_0x2fafae[_0xa895('0x64')][_0xa895('0x6b')][_0xa895('0x6c')],'intentDisplayName':_0x2fafae[_0xa895('0x64')][_0xa895('0x6b')]['displayName'],'isFallbackIntent':_0x2fafae[_0xa895('0x64')][_0xa895('0x6b')]['isFallback'],'languageCode':_0x2fafae[_0xa895('0x64')][_0xa895('0x6d')],'queryText':_0x2fafae[_0xa895('0x64')]['queryText'],'responseId':_0x2fafae[_0xa895('0x6e')],'score':_0x2fafae[_0xa895('0x64')][_0xa895('0x6f')],'speech':_0x2fafae[_0xa895('0x64')]['fulfillmentText'],'providerResponse':JSON[_0xa895('0x3e')](_0x38411b)};return _0x4b9d45;}}});};exports['tildeASR']=function(_0xaca94c,_0x48b6a2,_0x45bdc6,_0x45ef7e){return tilde['asr'](_0xaca94c,_0x48b6a2,_0x45bdc6,_0x45ef7e)[_0xa895('0x2a')](function(_0x15cba6){try{fs['unlink'](_0xaca94c);}catch(_0x21922a){logger[_0xa895('0x1e')](_0x21922a);}logger[_0xa895('0x1c')]('Tilde\x20ASR\x20transcription',_0x15cba6['transcript']);logger[_0xa895('0x1c')](_0xa895('0x70'),_0x15cba6[_0xa895('0x4e')]);return _0x15cba6;});};exports['awsPolly']=function(_0x2c1be0,_0x5a6e06,_0x2a3524,_0x46bcfe,_0x5f360f,_0x141138){var _0x44280b=path[_0xa895('0x38')](__dirname,'tmp',rs['generate'](0x4)+_0xa895('0x36'));var _0x3065a9;return aws[_0xa895('0x71')](_0x2c1be0,_0x5a6e06,_0x2a3524,_0x46bcfe,_0x5f360f,_0x141138,_0x44280b)['then'](function(){_0x3065a9=path[_0xa895('0x38')](__dirname,_0xa895('0x26'),rs[_0xa895('0x27')](0x4)+_0xa895('0x39'));return convertFile(_0x44280b,_0x3065a9);})[_0xa895('0x2a')](function(){try{fs[_0xa895('0x1f')](_0x44280b);fs[_0xa895('0x2b')](_0x3065a9,_0xa895('0x2c'));}catch(_0x20e2e1){logger[_0xa895('0x1e')](_0x20e2e1);}return _0x3065a9[_0xa895('0x2d')]('.')[0x0];});};exports[_0xa895('0x72')]=function(_0x209cc7,_0x5bd23d,_0x30110a,_0xeabcfc,_0x2d94ce,_0x2eb875){return aws['lex'](_0x209cc7,_0x5bd23d,_0x30110a,_0xeabcfc,_0x2d94ce,_0x2eb875)[_0xa895('0x2a')](function(_0x25fc4a){logger[_0xa895('0x1c')](JSON[_0xa895('0x3e')](_0x25fc4a));return _0x25fc4a;});};exports[_0xa895('0x73')]=function(_0x826f4e,_0x11e7d9,_0x5bce42,_0x1dbb8f){var _0x653f78=util[_0xa895('0x74')](_0xa895('0x75'),ISPEECH_API,_0x826f4e,encodeURIComponent(_0x11e7d9),_0x5bce42,_0x1dbb8f);var _0x151ccf=path[_0xa895('0x38')](__dirname,_0xa895('0x26'),rs[_0xa895('0x27')](0x4)+_0xa895('0x36'));var _0x4f7c8d;return downloadFile(_0x653f78,_0x151ccf)[_0xa895('0x2a')](function(){_0x4f7c8d=path['resolve'](__dirname,_0xa895('0x26'),rs[_0xa895('0x27')](0x4)+_0xa895('0x39'));return convertFile(_0x151ccf,_0x4f7c8d);})[_0xa895('0x2a')](function(){try{fs[_0xa895('0x1f')](_0x151ccf);fs[_0xa895('0x2b')](_0x4f7c8d,_0xa895('0x2c'));}catch(_0x534277){logger['error'](_0x534277);}return _0x4f7c8d[_0xa895('0x2d')]('.')[0x0];});};exports[_0xa895('0x76')]=function(_0x35b823,_0x117d18,_0x2830d6,_0x114257){var _0x460eb3=util['format'](_0xa895('0x77'),ISPEECH_API,_0x117d18,_0x2830d6,base64Encode(_0x35b823),_0x114257?util[_0xa895('0x74')]('model=%s',encodeURIComponent(_0x114257)):_0xa895('0x78'));return uploadFile(_0x460eb3)[_0xa895('0x2a')](function(_0x40d076){return querystring['parse'](_0x40d076);});};exports['sestekNDA']=function(_0x538233,_0x2c9450){return sestek['nda'](_0x538233,_0x2c9450)[_0xa895('0x2a')](function(_0x2fc6ac){logger[_0xa895('0x1c')](JSON[_0xa895('0x3e')](_0x2fc6ac));var _0x8fb3cf={'speech':_0x2fc6ac['text'],'action':_0x2fc6ac[_0xa895('0x79')]?_0x2fc6ac[_0xa895('0x79')]['CustomAction']:undefined,'actiondata':_0x2fc6ac['channelData']?_0x2fc6ac[_0xa895('0x79')][_0xa895('0x7a')]:undefined};if(_0x2fc6ac[_0xa895('0x79')]&&_0x2fc6ac[_0xa895('0x79')][_0xa895('0x7b')]){return base64Decode(_0x2fc6ac[_0xa895('0x79')][_0xa895('0x7b')][_0xa895('0x7c')],path['resolve'](__dirname,_0xa895('0x26'),rs['generate'](0x4)+'.wav'))[_0xa895('0x2a')](function(_0x475f58){_0x8fb3cf[_0xa895('0x7d')]=_0x475f58;return _0x8fb3cf;});}return _0x8fb3cf;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x05e7=['metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','boolValue','intent','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','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','sestekNDA','nda','text','channelData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','md5','path','request-promise','randomstring','sox','google-tts-api','parse','util','./google','./sestek','./tilde','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','error','end','https:','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','777','readFileSync','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','chmodSync','split','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','score','code'];(function(_0x28f1de,_0x355054){var _0x5b5dad=function(_0x399b72){while(--_0x399b72){_0x28f1de['push'](_0x28f1de['shift']());}};_0x5b5dad(++_0x355054);}(_0x05e7,0x1b8));var _0x705e=function(_0x42d2d7,_0x4ef813){_0x42d2d7=_0x42d2d7-0x0;var _0x2d9798=_0x05e7[_0x42d2d7];return _0x2d9798;};'use strict';var apiai=require(_0x705e('0x0'));var BPromise=require(_0x705e('0x1'));var dialogflow=require(_0x705e('0x2'));var fs=require('fs');var http=require(_0x705e('0x3'));var https=require('https');var md5=require(_0x705e('0x4'));var path=require(_0x705e('0x5'));var querystring=require('querystring');var rp=require(_0x705e('0x6'));var rs=require(_0x705e('0x7'));var sox=require(_0x705e('0x8'));var tts=require(_0x705e('0x9'));var urlParse=require('url')[_0x705e('0xa')];var util=require(_0x705e('0xb'));var aws=require('./aws');var google=require(_0x705e('0xc'));var sestek=require(_0x705e('0xd'));var tilde=require(_0x705e('0xe'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x705e('0xf');function downloadFile(_0x10abce,_0x473e18){return new BPromise(function(_0x27fba5,_0x476639){var _0x105ae=urlParse(_0x10abce);var _0x281375=_0x105ae[_0x705e('0x10')]==='https:'?https:http;var _0xaa04e4={'host':_0x105ae[_0x705e('0x11')],'path':_0x105ae[_0x705e('0x5')],'headers':{'user-agent':_0x705e('0x12')}};_0x281375[_0x705e('0x13')](_0xaa04e4,function(_0x2eb6ac){if(_0x2eb6ac[_0x705e('0x14')]!==0xc8){logger['error'](_0x705e('0x15')+_0x10abce+_0x705e('0x16')+_0x2eb6ac[_0x705e('0x14')]+'\x20('+_0x2eb6ac[_0x705e('0x17')]+')');_0x476639(new Error('request\x20to\x20'+_0x10abce+_0x705e('0x16')+_0x2eb6ac['statusCode']+'\x20('+_0x2eb6ac['statusMessage']+')'));return;}var _0x2e95a2=fs[_0x705e('0x18')](_0x473e18);_0x2e95a2['on'](_0x705e('0x19'),function(){logger[_0x705e('0x1a')](_0x705e('0x1b'));_0x2e95a2[_0x705e('0x1c')](_0x27fba5);});_0x2e95a2['on']('error',function(_0x51f447){fs[_0x705e('0x1d')](_0x473e18);logger['error'](_0x705e('0x1e'),_0x51f447);_0x476639(_0x51f447);});_0x2eb6ac[_0x705e('0x1f')](_0x2e95a2);})['on'](_0x705e('0x20'),function(_0x3497b6){logger[_0x705e('0x20')](_0x3497b6);_0x476639(_0x3497b6);})[_0x705e('0x21')]();});}function uploadFile(_0x334833){return new BPromise(function(_0x2a86c5,_0x155b04){var _0x3ae087=urlParse(_0x334833);var _0x26e75d=_0x3ae087['protocol']===_0x705e('0x22')?https:http;var _0x28e2c8={'host':_0x3ae087['host'],'path':_0x3ae087[_0x705e('0x5')],'headers':{'user-agent':_0x705e('0x12')}};_0x26e75d[_0x705e('0x13')](_0x28e2c8,function(_0x247e8c){if(_0x247e8c[_0x705e('0x14')]!==0xc8){_0x155b04(new Error(_0x705e('0x15')+_0x334833+_0x705e('0x16')+_0x247e8c[_0x705e('0x14')]+'\x20('+_0x247e8c[_0x705e('0x17')]+')'));return;}var _0x207b69='';_0x247e8c['on']('data',function(_0x2a3156){_0x207b69+=_0x2a3156;});_0x247e8c['on'](_0x705e('0x21'),function(){_0x2a86c5(_0x207b69);});})['on'](_0x705e('0x20'),function(_0x140518){_0x155b04(_0x140518);})[_0x705e('0x21')]();});}function convertFile(_0x1e5008,_0x26ae8a){return new BPromise(function(_0x46a58d,_0x18673a){var _0x4eaf7b=sox[_0x705e('0x23')](_0x1e5008,_0x26ae8a,{'sampleRate':0x1f40,'format':_0x705e('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4eaf7b['on'](_0x705e('0x20'),function(_0x132620){logger[_0x705e('0x20')](_0x705e('0x25'),_0x132620);_0x18673a(_0x132620);});_0x4eaf7b['on'](_0x705e('0x21'),function(){logger['info'](_0x705e('0x26'));_0x46a58d();});_0x4eaf7b[_0x705e('0x27')]();});}function base64Decode(_0x19d57b,_0x301605){var _0x438766=path[_0x705e('0x28')](__dirname,_0x705e('0x29'),rs[_0x705e('0x2a')](0x4)+_0x705e('0x2b'));fs[_0x705e('0x2c')](_0x438766,_0x19d57b,_0x705e('0x2d'));return convertFile(_0x438766,_0x301605)[_0x705e('0x2e')](function(){try{fs[_0x705e('0x1d')](_0x438766);fs['chmodSync'](_0x301605,_0x705e('0x2f'));}catch(_0x3f8f1c){logger[_0x705e('0x20')](_0x3f8f1c);}return _0x301605['split']('.')[0x0];});}function base64Encode(_0x20451d){var _0x9e2764=fs[_0x705e('0x30')](_0x20451d);return new Buffer(_0x9e2764)['toString']('base64');}exports['googleCloudTTS']=function(_0x4a32a1,_0x464d6a,_0x4cf1f3,_0x1b2a38,_0x5223ae,_0x3ff477){var _0x4d5832,_0x14e451;var _0x4057ee='https://texttospeech.googleapis.com/v1/';var _0x42d688=_0x705e('0x31')+_0x4a32a1;var _0x4c3b02={};if(_0x464d6a==='ssml'){_0x4c3b02[_0x705e('0x32')]={'ssml':_0x4cf1f3};}else{_0x4c3b02['input']={'text':_0x4cf1f3};};_0x4c3b02[_0x705e('0x33')]={'languageCode':_0x1b2a38,'ssmlGender':_0x5223ae};_0x4c3b02[_0x705e('0x34')]={'audioEncoding':_0x705e('0x35'),'sampleRateHertz':0x1f40};var _0x1f2134={'url':_0x4057ee+_0x705e('0x36')+_0x42d688,'method':_0x705e('0x37'),'json':!![],'body':_0x4c3b02};return rp(_0x1f2134)[_0x705e('0x2e')](function(_0x252a5e){return new BPromise(function(_0x51e28c,_0x3d0e32){_0x4d5832=path[_0x705e('0x28')](__dirname,'tmp',rs[_0x705e('0x2a')](0x4)+_0x705e('0x38'));var _0x1d325d=Buffer[_0x705e('0x39')](_0x252a5e[_0x705e('0x3a')],_0x705e('0x2d'));return fs[_0x705e('0x3b')](_0x4d5832,_0x1d325d,function(_0x582c4b){_0x3d0e32(_0x582c4b);},function(_0x5e7dca){fs[_0x705e('0x3c')](_0x4d5832,_0x705e('0x2f'));_0x51e28c(_0x5e7dca);});});})[_0x705e('0x2e')](function(_0x14e713){_0x14e451=path[_0x705e('0x28')](__dirname,_0x705e('0x29'),rs['generate'](0x4)+_0x705e('0x2b'));return convertFile(_0x4d5832,_0x14e451);})[_0x705e('0x2e')](function(){try{fs[_0x705e('0x1d')](_0x4d5832);fs[_0x705e('0x3c')](_0x14e451,'777');}catch(_0x437a34){logger[_0x705e('0x20')](_0x437a34);}logger[_0x705e('0x1a')]('googleCloudTTS\x20path',_0x14e451[_0x705e('0x3d')]('.')[0x0]);return _0x14e451[_0x705e('0x3d')]('.')[0x0];});};exports[_0x705e('0x3e')]=function(_0x326512,_0x38bd17){var _0x5cca62='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x628d1b,_0x5f248a;var _0x1dd1ef;var _0x2e291b={'encoding':_0x705e('0x3f'),'method':'POST','timeout':0x2710,'url':_0x5cca62,'headers':{'Content-Type':_0x705e('0x40')},'body':_0x705e('0x41')+encodeURIComponent(JSON[_0x705e('0x42')]([[[_0x705e('0x43'),JSON[_0x705e('0x42')]([_0x326512,_0x38bd17||'en',![],_0x705e('0x44')]),null,_0x705e('0x45')]]]))};return rp(_0x2e291b)[_0x705e('0x2e')](function(_0x92337b){try{_0x1dd1ef=eval(_0x92337b['slice'](0x5))[0x0][0x2];}catch(_0x4ab887){throw new Error(_0x705e('0x46')+_0x92337b[_0x705e('0x47')]);}if(!_0x1dd1ef){if(_0x326512[_0x705e('0x48')]>0xc8){throw new Error(_0x705e('0x49'));}else{throw new Error(_0x705e('0x4a')+_0x38bd17+_0x705e('0x4b'));}}try{_0x1dd1ef=eval(_0x1dd1ef)[0x0];}catch(_0x5890d9){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x705e('0x47')]);}const _0x1154b3=_0x1dd1ef;_0x628d1b=path['resolve'](__dirname,_0x705e('0x29'),rs['generate'](0x4)+_0x705e('0x38'));fs[_0x705e('0x2c')](_0x628d1b,_0x1dd1ef,{'encoding':_0x705e('0x2d')});_0x5f248a=path[_0x705e('0x28')](__dirname,'tmp',rs[_0x705e('0x2a')](0x4)+_0x705e('0x2b'));return convertFile(_0x628d1b,_0x5f248a);})['then'](function(){try{fs[_0x705e('0x1d')](_0x628d1b);fs['chmodSync'](_0x5f248a,'777');}catch(_0xde71f7){logger[_0x705e('0x20')](_0xde71f7);}logger[_0x705e('0x1a')]('goggleTTS\x20path',_0x5f248a[_0x705e('0x3d')]('.')[0x0]);return _0x5f248a['split']('.')[0x0];});};exports[_0x705e('0x4c')]=function(_0x81a7fd,_0x14e528,_0x2bcf5f){return google[_0x705e('0x4d')](_0x81a7fd,_0x14e528,_0x2bcf5f)[_0x705e('0x2e')](function(_0x19fb39){logger['info'](_0x19fb39[_0x705e('0x4e')]);return rp(_0x19fb39);})[_0x705e('0x2e')](function(_0x5755c3){var _0x1a2a94='';var _0x4a4a60=0x0;try{fs[_0x705e('0x1d')](_0x81a7fd);}catch(_0x5e5853){logger[_0x705e('0x20')](_0x5e5853);}if(_0x5755c3&&_0x5755c3[_0x705e('0x4f')]){_0x1a2a94=_0x5755c3[_0x705e('0x4f')][_0x705e('0x50')](function(_0x2efccc){return _0x2efccc&&_0x2efccc['alternatives'][0x0]&&_0x2efccc[_0x705e('0x51')][0x0][_0x705e('0x52')]?_0x2efccc[_0x705e('0x51')][0x0]['transcript']:'';})[_0x705e('0x53')]('\x0a');_0x4a4a60=_0x5755c3[_0x705e('0x4f')]['map'](function(_0x57e0be){return _0x57e0be&&_0x57e0be[_0x705e('0x51')][0x0]&&_0x57e0be[_0x705e('0x51')][0x0]['confidence']?_0x57e0be[_0x705e('0x51')][0x0][_0x705e('0x54')]:0x0;})[_0x705e('0x53')]('\x0a');}logger[_0x705e('0x1a')](_0x705e('0x55'),_0x1a2a94);logger[_0x705e('0x1a')]('googleASR\x20confidence',_0x4a4a60);return{'transcript':_0x1a2a94,'confidence':_0x4a4a60};})[_0x705e('0x56')](function(_0x5d4d9d){logger[_0x705e('0x20')](_0x705e('0x57'),_0x5d4d9d[_0x705e('0x14')],_0x5d4d9d[_0x705e('0x58')],_0x5d4d9d[_0x705e('0x59')]);});};exports[_0x705e('0x5a')]=function(_0x5a1de8,_0x4ae221,_0x488432,_0x50faad){var _0x53df62=apiai(_0x4ae221,{'language':_0x50faad||'en'});return _0x53df62[_0x705e('0x5b')](_0x488432,{'sessionId':md5(_0x5a1de8)})[_0x705e('0x2e')](function(_0x1f257c){logger[_0x705e('0x1a')](JSON[_0x705e('0x42')](_0x1f257c));return{'source':_0x1f257c['result'][_0x705e('0x5c')],'resolvedQuery':_0x1f257c[_0x705e('0x5d')][_0x705e('0x5e')],'action':_0x1f257c[_0x705e('0x5d')][_0x705e('0x5f')],'actionIncomplete':_0x1f257c['result'][_0x705e('0x60')],'speech':_0x1f257c[_0x705e('0x5d')][_0x705e('0x61')]['speech'],'score':_0x1f257c['result'][_0x705e('0x62')],'statusCode':_0x1f257c['status'][_0x705e('0x63')],'endConversation':_0x1f257c[_0x705e('0x5d')][_0x705e('0x64')][_0x705e('0x65')]||![],'isFallbackIntent':_0x1f257c['result'][_0x705e('0x64')][_0x705e('0x66')]};});};exports[_0x705e('0x67')]=function(_0x301402,_0x5a7273,_0x2e83e4,_0x31f9e9,_0x293a7e,_0x22b4ce){var _0x443a10=_0x31f9e9[_0x705e('0x68')](/\\n/g,'\x0a');var _0x4c9e85={'credentials':{'private_key':_0x443a10,'client_email':_0x2e83e4}};var _0x312ef7=new dialogflow[(_0x705e('0x69'))](_0x4c9e85);var _0x1b6235=_0x312ef7[_0x705e('0x6a')](_0x5a7273,md5(_0x301402));var _0x12fa8e={'session':_0x1b6235,'queryInput':{'text':{'text':_0x293a7e,'languageCode':_0x22b4ce}}};return _0x312ef7[_0x705e('0x6b')](_0x12fa8e)[_0x705e('0x2e')](function(_0x2b9813){if(_0x2b9813&&_0x2b9813['length']){logger[_0x705e('0x1a')](_0x705e('0x6c'),JSON[_0x705e('0x42')](_0x2b9813));var _0x4b9d85=_0x2b9813[0x0];if(_0x4b9d85){var _0x38fd9f={'action':_0x4b9d85[_0x705e('0x6d')][_0x705e('0x5f')],'allRequiredParamsPresent':_0x4b9d85[_0x705e('0x6d')]['allRequiredParamsPresent'],'endConversation':_0x4b9d85['queryResult'][_0x705e('0x6e')]&&_0x4b9d85[_0x705e('0x6d')][_0x705e('0x6e')][_0x705e('0x6f')]?_0x4b9d85['queryResult'][_0x705e('0x6e')][_0x705e('0x6f')]['end_conversation'][_0x705e('0x70')]:![],'fulfillmentText':_0x4b9d85[_0x705e('0x6d')]['fulfillmentText'],'intentName':_0x4b9d85[_0x705e('0x6d')]['intent'][_0x705e('0x58')],'intentDisplayName':_0x4b9d85['queryResult'][_0x705e('0x71')]['displayName'],'isFallbackIntent':_0x4b9d85[_0x705e('0x6d')]['intent'][_0x705e('0x72')],'languageCode':_0x4b9d85[_0x705e('0x6d')][_0x705e('0x73')],'queryText':_0x4b9d85[_0x705e('0x6d')]['queryText'],'responseId':_0x4b9d85[_0x705e('0x74')],'score':_0x4b9d85[_0x705e('0x6d')][_0x705e('0x75')],'speech':_0x4b9d85['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x705e('0x42')](_0x2b9813)};return _0x38fd9f;}}});};exports[_0x705e('0x76')]=function(_0x4f65d8,_0x3b8c80,_0x3317bd,_0x19003d){return tilde[_0x705e('0x4d')](_0x4f65d8,_0x3b8c80,_0x3317bd,_0x19003d)[_0x705e('0x2e')](function(_0x26b467){try{fs['unlink'](_0x4f65d8);}catch(_0x26ab93){logger[_0x705e('0x20')](_0x26ab93);}logger[_0x705e('0x1a')](_0x705e('0x77'),_0x26b467['transcript']);logger[_0x705e('0x1a')](_0x705e('0x78'),_0x26b467['confidence']);return _0x26b467;});};exports['awsPolly']=function(_0x300084,_0x2c6291,_0xbeebbc,_0x33fad6,_0x1c49f4,_0x34c0f7){var _0x74a276=path[_0x705e('0x28')](__dirname,_0x705e('0x29'),rs[_0x705e('0x2a')](0x4)+_0x705e('0x38'));var _0x169e52;return aws[_0x705e('0x79')](_0x300084,_0x2c6291,_0xbeebbc,_0x33fad6,_0x1c49f4,_0x34c0f7,_0x74a276)[_0x705e('0x2e')](function(){_0x169e52=path['resolve'](__dirname,'tmp',rs[_0x705e('0x2a')](0x4)+_0x705e('0x2b'));return convertFile(_0x74a276,_0x169e52);})[_0x705e('0x2e')](function(){try{fs[_0x705e('0x1d')](_0x74a276);fs['chmodSync'](_0x169e52,_0x705e('0x2f'));}catch(_0x192d5f){logger[_0x705e('0x20')](_0x192d5f);}return _0x169e52[_0x705e('0x3d')]('.')[0x0];});};exports[_0x705e('0x7a')]=function(_0x353fe5,_0x80aeea,_0x4db41b,_0x45c5a6,_0xe834ee,_0x4dc306){return aws['lex'](_0x353fe5,_0x80aeea,_0x4db41b,_0x45c5a6,_0xe834ee,_0x4dc306)['then'](function(_0x2739ca){logger['info'](JSON['stringify'](_0x2739ca));return _0x2739ca;});};exports['ispeechTTS']=function(_0x59c84e,_0x36fe24,_0x34b2af,_0x35d622){var _0x47a102=util[_0x705e('0x7b')](_0x705e('0x7c'),ISPEECH_API,_0x59c84e,encodeURIComponent(_0x36fe24),_0x34b2af,_0x35d622);var _0x221c57=path[_0x705e('0x28')](__dirname,_0x705e('0x29'),rs['generate'](0x4)+_0x705e('0x38'));var _0x29f25b;return downloadFile(_0x47a102,_0x221c57)[_0x705e('0x2e')](function(){_0x29f25b=path['resolve'](__dirname,_0x705e('0x29'),rs['generate'](0x4)+_0x705e('0x2b'));return convertFile(_0x221c57,_0x29f25b);})[_0x705e('0x2e')](function(){try{fs[_0x705e('0x1d')](_0x221c57);fs[_0x705e('0x3c')](_0x29f25b,_0x705e('0x2f'));}catch(_0x336160){logger[_0x705e('0x20')](_0x336160);}return _0x29f25b[_0x705e('0x3d')]('.')[0x0];});};exports[_0x705e('0x7d')]=function(_0x49ca2a,_0x46e9b3,_0x4c2e5f,_0x21e2ea){var _0xba4d42=util['format'](_0x705e('0x7e'),ISPEECH_API,_0x46e9b3,_0x4c2e5f,base64Encode(_0x49ca2a),_0x21e2ea?util[_0x705e('0x7b')]('model=%s',encodeURIComponent(_0x21e2ea)):'freeform=3');return uploadFile(_0xba4d42)[_0x705e('0x2e')](function(_0x1b6501){return querystring[_0x705e('0xa')](_0x1b6501);});};exports[_0x705e('0x7f')]=function(_0x28c76c,_0x21a5d3){return sestek[_0x705e('0x80')](_0x28c76c,_0x21a5d3)['then'](function(_0xf33c44){logger[_0x705e('0x1a')](JSON[_0x705e('0x42')](_0xf33c44));var _0x19306f={'speech':_0xf33c44[_0x705e('0x81')],'action':_0xf33c44[_0x705e('0x82')]?_0xf33c44[_0x705e('0x82')]['CustomAction']:undefined,'actiondata':_0xf33c44[_0x705e('0x82')]?_0xf33c44['channelData']['CustomActionData']:undefined};if(_0xf33c44[_0x705e('0x82')]&&_0xf33c44['channelData'][_0x705e('0x83')]){return base64Decode(_0xf33c44[_0x705e('0x82')][_0x705e('0x83')][_0x705e('0x84')],path[_0x705e('0x28')](__dirname,_0x705e('0x29'),rs[_0x705e('0x2a')](0x4)+_0x705e('0x2b')))[_0x705e('0x2e')](function(_0x418521){_0x19306f[_0x705e('0x85')]=_0x418521;return _0x19306f;});}return _0x19306f;});};exports[_0x705e('0x86')]=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 792c284..315b1a7 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 _0x2c38=['exports'];(function(_0x1d50cb,_0x510d46){var _0x524df7=function(_0x4fbc25){while(--_0x4fbc25){_0x1d50cb['push'](_0x1d50cb['shift']());}};_0x524df7(++_0x510d46);}(_0x2c38,0x9f));var _0x82c3=function(_0xaad24a,_0x1c7172){_0xaad24a=_0xaad24a-0x0;var _0x32df5b=_0x2c38[_0xaad24a];return _0x32df5b;};var nda=require('./nda');module[_0x82c3('0x0')]={'nda':nda}; \ No newline at end of file +var _0xfb20=['exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xfb20,0xb3));var _0x0fb2=function(_0x5df033,_0x29458b){_0x5df033=_0x5df033-0x0;var _0x445829=_0xfb20[_0x5df033];return _0x445829;};var nda=require('./nda');module[_0x0fb2('0x0')]={'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 7c4ba8b..e19f6cc 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 _0x6ae2=['../../../../../config/logger','agi','exports','POST','ndauth_url','/token','password','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','calleridname','extension','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ae2,0x1ed));var _0x26ae=function(_0xa5e2c3,_0x558055){_0xa5e2c3=_0xa5e2c3-0x0;var _0x259720=_0x6ae2[_0xa5e2c3];return _0x259720;};'use strict';var rp=require(_0x26ae('0x0'));var url=require(_0x26ae('0x1'));var logger=require(_0x26ae('0x2'))(_0x26ae('0x3'));module[_0x26ae('0x4')]=function(_0x13dbf4,_0xde8ef3){var _0x281760={'method':_0x26ae('0x5'),'uri':url['resolve'](_0xde8ef3[_0x26ae('0x6')],_0x26ae('0x7')),'form':{'grant_type':'password','username':_0xde8ef3['username'],'password':_0xde8ef3[_0x26ae('0x8')]},'json':!![]};return rp(_0x281760)[_0x26ae('0x9')](function(_0x473907){var _0x151de3={'method':_0x26ae('0x5'),'uri':url[_0x26ae('0xa')](_0xde8ef3[_0x26ae('0xb')],_0x26ae('0xc')),'body':{'type':_0xde8ef3[_0x26ae('0xd')]||_0x26ae('0xe'),'channelId':_0x26ae('0xf'),'conversation':{'id':_0x13dbf4[_0x26ae('0x10')]},'from':{'id':_0x13dbf4['callerid'],'name':_0x13dbf4[_0x26ae('0x11')]},'recipient':{'id':_0x13dbf4['dnid'],'name':_0x13dbf4[_0x26ae('0x12')]},'text':_0xde8ef3['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x473907[_0x26ae('0x13')]},'json':!![]};if(_0xde8ef3[_0x26ae('0x14')]){_0x151de3[_0x26ae('0x15')][_0x26ae('0x16')][_0x26ae('0x17')]=_0xde8ef3[_0x26ae('0x14')];}if(_0xde8ef3[_0x26ae('0x18')]=='1'){_0x151de3[_0x26ae('0x15')][_0x26ae('0x16')][_0x26ae('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x26ae('0x1a')};}if(_0xde8ef3[_0x26ae('0x1b')]){_0x151de3['body'][_0x26ae('0x16')][_0x26ae('0x1c')]=_0xde8ef3['custom_action'];if(_0xde8ef3[_0x26ae('0x1d')]){_0x151de3[_0x26ae('0x15')][_0x26ae('0x16')][_0x26ae('0x1e')]=_0xde8ef3[_0x26ae('0x1d')];}}logger[_0x26ae('0x1f')](JSON[_0x26ae('0x20')](_0x151de3));return rp(_0x151de3);});}; \ No newline at end of file +var _0x6f7a=['resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','dnid','text','Bearer\x20','access_token','project','channelData','ndagenerate_audio','body','AudioOutputSettings','custom_action','CustomAction','CustomActionData','custom_action_data','request-promise','url','../../../../../config/logger','agi','POST'];(function(_0x1df906,_0x30b9c7){var _0x556219=function(_0x23342e){while(--_0x23342e){_0x1df906['push'](_0x1df906['shift']());}};_0x556219(++_0x30b9c7);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x1287e5,_0x2329b6){_0x1287e5=_0x1287e5-0x0;var _0x59745b=_0x6f7a[_0x1287e5];return _0x59745b;};'use strict';var rp=require(_0xa6f7('0x0'));var url=require(_0xa6f7('0x1'));var logger=require(_0xa6f7('0x2'))(_0xa6f7('0x3'));module['exports']=function(_0x93614a,_0x407de3){var _0x12ecb8={'method':_0xa6f7('0x4'),'uri':url[_0xa6f7('0x5')](_0x407de3[_0xa6f7('0x6')],_0xa6f7('0x7')),'form':{'grant_type':_0xa6f7('0x8'),'username':_0x407de3[_0xa6f7('0x9')],'password':_0x407de3[_0xa6f7('0x8')]},'json':!![]};return rp(_0x12ecb8)[_0xa6f7('0xa')](function(_0x481a8c){var _0x4b4f9e={'method':_0xa6f7('0x4'),'uri':url[_0xa6f7('0x5')](_0x407de3[_0xa6f7('0xb')],_0xa6f7('0xc')),'body':{'type':_0x407de3[_0xa6f7('0xd')]||'message','channelId':'Nda','conversation':{'id':_0x93614a[_0xa6f7('0xe')]},'from':{'id':_0x93614a[_0xa6f7('0xf')],'name':_0x93614a['calleridname']},'recipient':{'id':_0x93614a[_0xa6f7('0x10')],'name':_0x93614a['extension']},'text':_0x407de3[_0xa6f7('0x11')],'channelData':{}},'headers':{'Authorization':_0xa6f7('0x12')+_0x481a8c[_0xa6f7('0x13')]},'json':!![]};if(_0x407de3[_0xa6f7('0x14')]){_0x4b4f9e['body'][_0xa6f7('0x15')]['ProjectName']=_0x407de3[_0xa6f7('0x14')];}if(_0x407de3[_0xa6f7('0x16')]=='1'){_0x4b4f9e[_0xa6f7('0x17')]['channelData'][_0xa6f7('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x407de3[_0xa6f7('0x19')]){_0x4b4f9e['body'][_0xa6f7('0x15')][_0xa6f7('0x1a')]=_0x407de3[_0xa6f7('0x19')];if(_0x407de3['custom_action_data']){_0x4b4f9e[_0xa6f7('0x17')][_0xa6f7('0x15')][_0xa6f7('0x1b')]=_0x407de3[_0xa6f7('0x1c')];}}logger['info'](JSON['stringify'](_0x4b4f9e));return rp(_0x4b4f9e);});}; \ 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 0a0a004..6a894b1 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 _0x99f8=['exports'];(function(_0x1f8552,_0x19b637){var _0x4ab5e3=function(_0x338bc6){while(--_0x338bc6){_0x1f8552['push'](_0x1f8552['shift']());}};_0x4ab5e3(++_0x19b637);}(_0x99f8,0xb7));var _0x899f=function(_0x284506,_0x26c9d4){_0x284506=_0x284506-0x0;var _0x2bbac3=_0x99f8[_0x284506];return _0x2bbac3;};'use strict';var asr=require('./lib/api');module[_0x899f('0x0')]=function(_0x231a71,_0x4beb5c,_0x5ce54f,_0x2adce6){return asr(_0x231a71,_0x4beb5c,_0x5ce54f,_0x2adce6);}; \ No newline at end of file +var _0xf03a=['exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf03a,0x1a0));var _0xaf03=function(_0x1a6ecf,_0x593da1){_0x1a6ecf=_0x1a6ecf-0x0;var _0x4a0183=_0xf03a[_0x1a6ecf];return _0x4a0183;};'use strict';var asr=require('./lib/api');module[_0xaf03('0x0')]=function(_0x116ce0,_0x389761,_0x435fc6,_0x555bdb){return asr(_0x116ce0,_0x389761,_0x435fc6,_0x555bdb);}; \ 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 a30dd77..0984d71 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 _0x5e8f=['sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','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'];(function(_0x3b882d,_0x2ba62a){var _0x48986e=function(_0x1de87){while(--_0x1de87){_0x3b882d['push'](_0x3b882d['shift']());}};_0x48986e(++_0x2ba62a);}(_0x5e8f,0x95));var _0xf5e8=function(_0x19d350,_0x3c843f){_0x19d350=_0x19d350-0x0;var _0x3bfc8d=_0x5e8f[_0x19d350];return _0x3bfc8d;};'use strict';var BPromise=require(_0xf5e8('0x0'));var _=require(_0xf5e8('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf5e8('0x2'));var crypto=require(_0xf5e8('0x3'));var logger=require(_0xf5e8('0x4'))(_0xf5e8('0x5'));module['exports']=function(_0x3491e6,_0x461204,_0x1b0adb,_0x5f5b8a){return new BPromise(function(_0x40352a,_0x15accc){logger[_0xf5e8('0x6')](_0xf5e8('0x7'),_0x5f5b8a||_0xf5e8('0x8'));var _0x4a599c=new WebSocket(_0x5f5b8a||_0xf5e8('0x8'),{'perMessageDeflate':![]});var _0x7d006a='';var _0x4ce653='0';var _0x5b1119='1';var _0x550bec=_0xf5e8('0x9');function _0x47b744(_0x4d7d0c){var _0x2a986d=crypto[_0xf5e8('0xa')](_0xf5e8('0xb'));_0x2a986d[_0xf5e8('0xc')](_0x4d7d0c);return _0x2a986d['digest'](_0xf5e8('0xd'));}function _0x5dd8ff(){try{logger['info'](_0xf5e8('0xe'));var _0x490586=moment()[_0xf5e8('0xf')]();var _0x483780=_0x47b744(_0x490586+_0x461204+_0x1b0adb);_0x4a599c[_0xf5e8('0x10')](JSON[_0xf5e8('0x11')]({'appID':_0x461204,'timestamp':_0x490586,'appKey':_0x483780}));var _0x4633d4=fs[_0xf5e8('0x12')](_0x3491e6);_0x4633d4['on'](_0xf5e8('0x13'),function(_0x1ffc6f){_0x4a599c['send'](_0x1ffc6f);});_0x4633d4['on'](_0xf5e8('0x14'),function(){_0x4a599c[_0xf5e8('0x10')](_0xf5e8('0x15'));});}catch(_0x28d7d8){logger[_0xf5e8('0x16')](_0xf5e8('0x17'),JSON['stringify'](_0x28d7d8));_0x4a599c[_0xf5e8('0x18')]();}}function _0x1befaf(_0x2f2e2f){try{if(_0x2f2e2f){var _0x4966a1=JSON[_0xf5e8('0x19')](_0x2f2e2f);switch(_0x4966a1[_0xf5e8('0x1a')]){case 0x0:if(_0x4966a1[_0xf5e8('0x1b')]){if(_0x4966a1[_0xf5e8('0x1b')][_0xf5e8('0x1c')]){logger[_0xf5e8('0x6')](_0xf5e8('0x1d'),JSON[_0xf5e8('0x11')](_0x4966a1[_0xf5e8('0x1b')][_0xf5e8('0x1e')]));_0x7d006a=_0x4966a1['result'][_0xf5e8('0x1e')][0x0][_0xf5e8('0x1f')];_0x4ce653=_0x4966a1[_0xf5e8('0x1b')][_0xf5e8('0x1e')][0x0]['likelihood'];_0x5b1119='0';_0x550bec=_0xf5e8('0x20');_0x4a599c['terminate']();}}break;case 0x1:logger[_0xf5e8('0x6')](_0xf5e8('0x9'));_0x5b1119='1';_0x550bec=_0xf5e8('0x9');break;case 0x2:logger[_0xf5e8('0x6')](_0xf5e8('0x21'));_0x5b1119='2';_0x550bec=_0xf5e8('0x21');break;case 0x9:logger['info'](_0xf5e8('0x22'));_0x5b1119='9';_0x550bec=_0xf5e8('0x22');break;case 0xa:logger[_0xf5e8('0x6')](_0xf5e8('0x23'));_0x5b1119='10';_0x550bec=_0xf5e8('0x23');break;case 0xb:logger[_0xf5e8('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x5b1119='11';_0x550bec='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x3fa532){logger[_0xf5e8('0x16')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xf5e8('0x11')](_0x3fa532));_0x4a599c[_0xf5e8('0x18')]();}}function _0x55d5ae(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x40352a({'transcript':_0x7d006a,'confidence':_0x4ce653,'status':_0x5b1119,'status_message':_0x550bec});}function _0x48bc49(_0x169567){logger[_0xf5e8('0x16')](_0xf5e8('0x24'));if(!_[_0xf5e8('0x25')](_0x169567)){logger[_0xf5e8('0x16')](_[_0xf5e8('0x26')](_0x169567)?JSON['stringify'](_0x169567):_0x169567);}}_0x4a599c['on']('open',_0x5dd8ff);_0x4a599c['on'](_0xf5e8('0x27'),_0x1befaf);_0x4a599c['on'](_0xf5e8('0x14'),_0x55d5ae);_0x4a599c['on'](_0xf5e8('0x16'),_0x48bc49);});}; \ No newline at end of file +var _0x9209=['isNil','isObject','open','message','bluebird','lodash','moment','../../../../../../config/logger','agi','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','update','digest','hex','unix','send','stringify','createReadStream','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','hypotheses','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket'];(function(_0x355de0,_0x3e1d21){var _0xad0de2=function(_0x5ac42d){while(--_0x5ac42d){_0x355de0['push'](_0x355de0['shift']());}};_0xad0de2(++_0x3e1d21);}(_0x9209,0x10e));var _0x9920=function(_0x235b40,_0x178561){_0x235b40=_0x235b40-0x0;var _0x17b2ae=_0x9209[_0x235b40];return _0x17b2ae;};'use strict';var BPromise=require(_0x9920('0x0'));var _=require(_0x9920('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x9920('0x2'));var crypto=require('crypto');var logger=require(_0x9920('0x3'))(_0x9920('0x4'));module['exports']=function(_0x48eabe,_0x10b97a,_0x35299a,_0xd0d0de){return new BPromise(function(_0x29534e,_0x764c8b){logger[_0x9920('0x5')](_0x9920('0x6'),_0xd0d0de||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x159070=new WebSocket(_0xd0d0de||_0x9920('0x7'),{'perMessageDeflate':![]});var _0x35587a='';var _0x1227a6='0';var _0x21fb28='1';var _0x1c9e59=_0x9920('0x8');function _0x54fa9d(_0x261561){var _0x155331=crypto[_0x9920('0x9')](_0x9920('0xa'));_0x155331[_0x9920('0xb')](_0x261561);return _0x155331[_0x9920('0xc')](_0x9920('0xd'));}function _0x45022c(){try{logger[_0x9920('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x1cd66a=moment()[_0x9920('0xe')]();var _0x514759=_0x54fa9d(_0x1cd66a+_0x10b97a+_0x35299a);_0x159070[_0x9920('0xf')](JSON[_0x9920('0x10')]({'appID':_0x10b97a,'timestamp':_0x1cd66a,'appKey':_0x514759}));var _0x1da807=fs[_0x9920('0x11')](_0x48eabe);_0x1da807['on']('data',function(_0x125936){_0x159070['send'](_0x125936);});_0x1da807['on'](_0x9920('0x12'),function(){_0x159070[_0x9920('0xf')](_0x9920('0x13'));});}catch(_0x159e39){logger['error'](_0x9920('0x14'),JSON[_0x9920('0x10')](_0x159e39));_0x159070[_0x9920('0x15')]();}}function _0x23ad64(_0x1c8e83){try{if(_0x1c8e83){var _0x5954c0=JSON[_0x9920('0x16')](_0x1c8e83);switch(_0x5954c0['status']){case 0x0:if(_0x5954c0[_0x9920('0x17')]){if(_0x5954c0[_0x9920('0x17')][_0x9920('0x18')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0x9920('0x10')](_0x5954c0[_0x9920('0x17')][_0x9920('0x19')]));_0x35587a=_0x5954c0[_0x9920('0x17')][_0x9920('0x19')][0x0]['transcript'];_0x1227a6=_0x5954c0[_0x9920('0x17')]['hypotheses'][0x0][_0x9920('0x1a')];_0x21fb28='0';_0x1c9e59='Success.';_0x159070['terminate']();}}break;case 0x1:logger[_0x9920('0x5')](_0x9920('0x8'));_0x21fb28='1';_0x1c9e59=_0x9920('0x8');break;case 0x2:logger[_0x9920('0x5')](_0x9920('0x1b'));_0x21fb28='2';_0x1c9e59=_0x9920('0x1b');break;case 0x9:logger[_0x9920('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x21fb28='9';_0x1c9e59=_0x9920('0x1c');break;case 0xa:logger[_0x9920('0x5')](_0x9920('0x1d'));_0x21fb28='10';_0x1c9e59=_0x9920('0x1d');break;case 0xb:logger[_0x9920('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x21fb28='11';_0x1c9e59='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x470fbc){logger[_0x9920('0x1e')](_0x9920('0x1f'),JSON[_0x9920('0x10')](_0x470fbc));_0x159070[_0x9920('0x15')]();}}function _0x1d1131(){logger['info'](_0x9920('0x20'));_0x29534e({'transcript':_0x35587a,'confidence':_0x1227a6,'status':_0x21fb28,'status_message':_0x1c9e59});}function _0x4b9ef7(_0x376a61){logger[_0x9920('0x1e')](_0x9920('0x21'));if(!_[_0x9920('0x22')](_0x376a61)){logger[_0x9920('0x1e')](_[_0x9920('0x23')](_0x376a61)?JSON[_0x9920('0x10')](_0x376a61):_0x376a61);}}_0x159070['on'](_0x9920('0x24'),_0x45022c);_0x159070['on'](_0x9920('0x25'),_0x23ad64);_0x159070['on'](_0x9920('0x12'),_0x1d1131);_0x159070['on']('error',_0x4b9ef7);});}; \ 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 806f57c..f91447a 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 _0x77f2=['./asr','exports'];(function(_0x519b37,_0x555419){var _0x196bc9=function(_0x1f9418){while(--_0x1f9418){_0x519b37['push'](_0x519b37['shift']());}};_0x196bc9(++_0x555419);}(_0x77f2,0x1e4));var _0x277f=function(_0x33fcbb,_0x291d0f){_0x33fcbb=_0x33fcbb-0x0;var _0x2efe40=_0x77f2[_0x33fcbb];return _0x2efe40;};var asr=require(_0x277f('0x0'));module[_0x277f('0x1')]={'asr':asr}; \ No newline at end of file +var _0x7f63=['exports','./asr'];(function(_0x592dcd,_0x369200){var _0x2888c0=function(_0x12e96){while(--_0x12e96){_0x592dcd['push'](_0x592dcd['shift']());}};_0x2888c0(++_0x369200);}(_0x7f63,0x1eb));var _0x37f6=function(_0x5e9d69,_0x5c493b){_0x5e9d69=_0x5e9d69-0x0;var _0x12916b=_0x7f63[_0x5e9d69];return _0x12916b;};var asr=require(_0x37f6('0x0'));module[_0x37f6('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index c9a97f6..5619255 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x1d3577,_0x17a32e){var _0x277d9a=function(_0x4b4144){while(--_0x4b4144){_0x1d3577['push'](_0x1d3577['shift']());}};_0x277d9a(++_0x17a32e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0xe706,0xa3));var _0x6e70=function(_0xbd4254,_0x31c08b){_0xbd4254=_0xbd4254-0x0;var _0x46c0f3=_0xe706[_0xbd4254];return _0x46c0f3;};'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 diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 7486ee8..121d665 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 _0x0c02=['TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','condition','no\x20condition\x20configured','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\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','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','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','response','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','agentPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','getVoiceQueue','indexOf','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','user','bcc','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','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','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Trying\x20Google\x20TTS\x20%s','googleTTS','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','channel','rpc','mailRpc','getVariableById','then','name','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','prototype','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','interval','map','Intervals','%s/sounds/converted/%s','error','info','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','context','extension','accountcode','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','callback','scheduledAt','toString','callback_priority','getPause','agent','agentUnpause','agentLogout','internal','format','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','result','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','exec','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','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','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','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','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','getdigits','retry','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','%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','wav'];(function(_0x39d920,_0xd8e8eb){var _0x59c75c=function(_0xf1eeef){while(--_0xf1eeef){_0x39d920['push'](_0x39d920['shift']());}};_0x59c75c(++_0xd8e8eb);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x20c0('0x0'));var sh=require(_0x20c0('0x1'));var odbc=require('odbc')();var rs=require(_0x20c0('0x2'));var moment=require(_0x20c0('0x3'));var Mustache=require(_0x20c0('0x4'));var rp=require(_0x20c0('0x5'));var logger=require(_0x20c0('0x6'))(_0x20c0('0x7'));var config=require(_0x20c0('0x8'));var scripts=require(_0x20c0('0x9'));var FILES_PATH=_0x20c0('0xa');var recursiveMapAttributes=[_0x20c0('0xb'),'rawBody'];var verticesWithRetry=['menu','getdigits','getsecretdigits'];var AGIVertices=function(_0x1e35e2,_0x276e9b,_0xcdc174){this[_0x20c0('0xc')]=_0x1e35e2;this[_0x20c0('0xd')]=_0x276e9b;this[_0x20c0('0xe')]=_0xcdc174;};AGIVertices['prototype']['getVariable']=function(_0x52eb0d,_0x578592){this['rpc'][_0x20c0('0xf')](_0x52eb0d)[_0x20c0('0x10')](function(_0x2ecab9){_0x578592(null,_0x2ecab9?_0x2ecab9[_0x20c0('0x11')]:![]);})['catch'](function(_0x56fa09){_0x578592(_0x56fa09);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x34a930,_0xfc2d9c){this[_0x20c0('0xd')][_0x20c0('0x12')](_0x34a930)[_0x20c0('0x10')](function(_0x1e6662){_0xfc2d9c(null,_0x1e6662?_0x1e6662[_0x20c0('0x11')]:![]);})[_0x20c0('0x13')](function(_0x280aff){_0xfc2d9c(_0x280aff);});};AGIVertices['prototype'][_0x20c0('0x14')]=function(_0xc78626,_0x1a708e){this[_0x20c0('0xd')][_0x20c0('0x15')](_0xc78626)[_0x20c0('0x10')](function(_0x5d6d18){_0x1a708e(null,_0x5d6d18?_0x5d6d18['name']:![]);})['catch'](function(_0x10a921){_0x1a708e(_0x10a921);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x17')]=function(_0x43a885,_0x5b3725){this[_0x20c0('0xd')][_0x20c0('0x18')](_0x43a885)[_0x20c0('0x10')](function(_0x5851eb){_0x5b3725(null,_0x5851eb?_0x5851eb['dsn']:![]);})[_0x20c0('0x13')](function(_0x108973){_0x5b3725(_0x108973);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x19')]=function(_0x36ed49,_0x53d8e8){this[_0x20c0('0xd')][_0x20c0('0x1a')](_0x36ed49)[_0x20c0('0x10')](function(_0x8a887a){_0x53d8e8(null,_0x8a887a?_0x8a887a['name']:![]);})[_0x20c0('0x13')](function(_0x3e545c){_0x53d8e8(_0x3e545c);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x1b')]=function(_0x44642a,_0x41ab51){this[_0x20c0('0xd')]['getTrunkById'](_0x44642a)[_0x20c0('0x10')](function(_0x595d94){_0x41ab51(null,_0x595d94?_0x595d94[_0x20c0('0x11')]:![]);})[_0x20c0('0x13')](function(_0x11da5a){_0x41ab51(_0x11da5a);});};AGIVertices[_0x20c0('0x16')]['getSound']=function(_0x4e0cbb,_0x3012d5){var _0x198bdd=this;this[_0x20c0('0xd')]['getSoundById'](_0x4e0cbb)[_0x20c0('0x10')](function(_0x25592b){_0x3012d5(null,_0x25592b?_0x198bdd[_0x20c0('0x1c')](_0x25592b[_0x20c0('0x1d')]):![]);})['catch'](function(_0x49b738){_0x3012d5(_0x49b738);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x1e')]=function(_0x3edc22,_0xe961ad){this[_0x20c0('0xd')][_0x20c0('0x1f')](_0x3edc22)[_0x20c0('0x10')](function(_0x40c0a7){_0xe961ad(null,_0x40c0a7?_0x40c0a7:![]);})[_0x20c0('0x13')](function(_0x191ad8){_0xe961ad(_0x191ad8);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x20')]=function(_0x1fef93,_0x45fa64,_0x55ede5){this[_0x20c0('0xe')][_0x20c0('0x20')](_0x1fef93,_0x45fa64)[_0x20c0('0x10')](function(){_0x55ede5(null);})[_0x20c0('0x13')](function(_0x59406e){_0x55ede5(_0x59406e);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x21')]=function(_0x355db9,_0x1ba29e){this[_0x20c0('0xd')]['getIntervalById'](_0x355db9)[_0x20c0('0x10')](function(_0x538595){if(_0x538595){if(_0x538595['IntervalId']){_0x1ba29e(null,[_0x538595[_0x20c0('0x22')]]);}else{_0x1ba29e(null,_[_0x20c0('0x23')](_0x538595[_0x20c0('0x24')],_0x20c0('0x22')));}}else{_0x1ba29e(null,![]);}})[_0x20c0('0x13')](function(_0x39fd84){_0x1ba29e(_0x39fd84);});};AGIVertices[_0x20c0('0x16')]['getSoundPath']=function(_0x5f4cc9){return util['format'](_0x20c0('0x25'),FILES_PATH,_0x5f4cc9);};AGIVertices[_0x20c0('0x16')]['getQueryOdbc']=function(_0x346a04,_0x20d6f3,_0x550d2c){odbc['open'](_0x346a04,function(_0x700675){if(_0x700675){logger[_0x20c0('0x26')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x700675);_0x550d2c(_0x700675);}else{logger[_0x20c0('0x27')]('ODBC\x20connection\x20successfully');odbc[_0x20c0('0x28')](_0x20d6f3,function(_0x31bf03,_0xcaa484){if(_0x31bf03){logger[_0x20c0('0x27')]('Error\x20executing\x20query\x20%s',_0x20d6f3);_0x550d2c(_0x31bf03);}else{logger[_0x20c0('0x27')](_0x20c0('0x29'),_0x20d6f3);odbc[_0x20c0('0x2a')](function(_0x415b41){if(_0x415b41){logger[_0x20c0('0x26')](_0x20c0('0x2b'),_0x415b41);}_0x550d2c(null,_0xcaa484);});}});}});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x2c')]=function(_0x57bb71,_0x52664c){this['rpc'][_0x20c0('0x2d')](_0x57bb71)['then'](function(_0x438a22){_0x52664c(null,_0x438a22?_0x438a22:![]);})[_0x20c0('0x13')](function(_0x88863){_0x52664c(_0x88863);});};AGIVertices[_0x20c0('0x16')]['createSmsMessage']=function(_0x178d92,_0x5bf7b8){this['rpc'][_0x20c0('0x2e')](_0x178d92)[_0x20c0('0x10')](function(_0x456d28){_0x5bf7b8(null,_0x456d28);})[_0x20c0('0x13')](function(_0x5c06c4){_0x5bf7b8(_0x5c06c4);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x2f')]=function(_0x39852a,_0x1ef892,_0x4df560){this[_0x20c0('0xd')][_0x20c0('0x2f')]({'uniqueid':this['channel'][_0x20c0('0x30')],'node':_0x39852a[_0x20c0('0x31')],'application':_0x39852a[_0x20c0('0x32')],'data':_0x1ef892||null,'project_name':this['channel'][_0x20c0('0x33')],'callerid':this['channel']['callerid']})['then'](function(_0x36ccf2){if(_0x4df560){_0x4df560(null,_0x36ccf2);}})['catch'](function(_0x12945c){if(_0x4df560){_0x4df560(_0x12945c);}});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x34')]=function(_0x3e5c62,_0x15f299,_0x2c95a4,_0x267f97){this['rpc'][_0x20c0('0x34')]({'uniqueid':this[_0x20c0('0xc')][_0x20c0('0x30')],'callerid':this[_0x20c0('0xc')][_0x20c0('0x35')],'calleridname':this[_0x20c0('0xc')]['calleridname'],'context':this['channel'][_0x20c0('0x36')],'extension':this[_0x20c0('0xc')][_0x20c0('0x37')],'priority':this['channel']['priority'],'accountcode':this[_0x20c0('0xc')][_0x20c0('0x38')],'dnid':this[_0x20c0('0xc')]['dnid'],'projectName':this[_0x20c0('0xc')][_0x20c0('0x33')],'saveName':_0x15f299,'filename':_0x3e5c62['file']||_0x15f299,'savePath':_0x2c95a4})['then'](function(_0x3fb4f1){_0x267f97(null,_0x3fb4f1);})['catch'](function(_0xdd2a3b){_0x267f97(_0xdd2a3b);});};AGIVertices['prototype'][_0x20c0('0x39')]=function(_0x425953,_0x5dd76d,_0x555e5a,_0x18810f,_0x149376){this[_0x20c0('0xd')][_0x20c0('0x39')]({'uniqueid':this[_0x20c0('0xc')][_0x20c0('0x30')],'body':_0x425953,'direction':_0x5dd76d,'providerName':_0x555e5a,'providerResponse':_0x18810f})[_0x20c0('0x10')](function(_0x20faa2){if(_0x149376){_0x149376(null,_0x20faa2);}})['catch'](function(_0x24b5f5){if(_0x149376){_0x149376(_0x24b5f5);}});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x3a')]=function(_0xe50137,_0x2c3404){this['rpc']['createCmContact']({'firstName':_[_0x20c0('0x3b')](_0xe50137[_0x20c0('0x11')])||_[_0x20c0('0x3c')](_0xe50137[_0x20c0('0x11')])?_0x20c0('0x3d')+Math[_0x20c0('0x3e')]():_0xe50137[_0x20c0('0x11')],'lastName':_['isEmpty'](_0xe50137['lastName'])||_[_0x20c0('0x3c')](_0xe50137[_0x20c0('0x3f')])?null:_0xe50137[_0x20c0('0x3f')],'phone':_0xe50137['phone'],'ListId':_0xe50137[_0x20c0('0x40')],'scheduledat':_0xe50137['scheduledAt'],'callbackUniqueid':this[_0x20c0('0xc')][_0x20c0('0x30')],'tags':_0x20c0('0x41'),'description':'Callback\x20scheduled\x20at\x20'+_0xe50137[_0x20c0('0x42')][_0x20c0('0x43')](),'priority':_0xe50137[_0x20c0('0x44')]})[_0x20c0('0x10')](function(_0x1e62e3){_0x2c3404(null,_0x1e62e3);})['catch'](function(_0xe7a292){_0x2c3404(_0xe7a292);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x45')]=function(_0x1aafc3,_0x57f482){this[_0x20c0('0xd')]['getPauseById'](_0x1aafc3)[_0x20c0('0x10')](function(_0x5d40c9){_0x57f482(null,_0x5d40c9?_0x5d40c9[_0x20c0('0x11')]:![]);})[_0x20c0('0x13')](function(_0x2cf512){_0x57f482(_0x2cf512);});};AGIVertices[_0x20c0('0x16')]['agentPause']=function(_0x371cbb,_0xcd87e8,_0x1e1c4b){var _0x12f2d2={'role':_0x20c0('0x46')};_0x12f2d2[_0x371cbb]=this[_0x20c0('0xc')][_0x20c0('0x35')];this[_0x20c0('0xd')]['agentPause'](_0x12f2d2,_0xcd87e8,this[_0x20c0('0xc')][_0x20c0('0x30')])[_0x20c0('0x10')](function(_0x56e1f6){_0x1e1c4b(null,_[_0x20c0('0x3c')](_0x56e1f6)?![]:!![]);})[_0x20c0('0x13')](function(_0x57ca28){logger[_0x20c0('0x26')](_0x57ca28);_0x1e1c4b(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x5ee9cf,_0x558d5c){var _0x13093a={'role':_0x20c0('0x46')};_0x13093a[_0x5ee9cf]=this[_0x20c0('0xc')][_0x20c0('0x35')];this[_0x20c0('0xd')][_0x20c0('0x47')](_0x13093a)[_0x20c0('0x10')](function(_0x247dee){_0x558d5c(null,_[_0x20c0('0x3c')](_0x247dee)?![]:!![]);})['catch'](function(_0x32d445){logger[_0x20c0('0x26')](_0x32d445);_0x558d5c(null,![]);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x48')]=function(_0x2fd893,_0x189c6b){var _0x788e01={'role':_0x20c0('0x46')};_0x788e01[_0x2fd893]=this[_0x20c0('0xc')][_0x20c0('0x35')];this['rpc'][_0x20c0('0x48')](_0x788e01)[_0x20c0('0x10')](function(_0x1ae801){_0x189c6b(null,_[_0x20c0('0x3c')](_0x1ae801)?![]:!![]);})['catch'](function(_0x488e79){logger[_0x20c0('0x26')](_0x488e79);_0x189c6b(null,![]);});};AGIVertices[_0x20c0('0x16')]['agentLogin']=function(_0x2222eb,_0x4bc360){var _0x12080a={'role':_0x20c0('0x46')};_0x12080a[_0x2222eb]=this[_0x20c0('0xc')]['callerid'];var _0x59c854=_0x2222eb!=_0x20c0('0x49')?util[_0x20c0('0x4a')](_0x20c0('0x4b'),_0x20c0('0x4c'),this['channel']['callerid']):undefined;this['rpc'][_0x20c0('0x4d')](_0x12080a,_0x59c854)[_0x20c0('0x10')](function(_0x3c0b96){_0x4bc360(null,_['isNil'](_0x3c0b96)?![]:!![]);})['catch'](function(_0x21dbbf){logger[_0x20c0('0x26')](_0x21dbbf);_0x4bc360(null,![]);});};AGIVertices['prototype'][_0x20c0('0x4e')]=function(_0x57d80e,_0x4b2199){sh['exec'](_[_0x20c0('0x4f')](_0x57d80e),function(_0x4bb071,_0x2d7c27){var _0x4f2868=_0x2d7c27[_0x20c0('0x50')](/(\r\n|\n|\r)/gm,'');_0x4b2199(null,_0x4f2868);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x51')]=function(_0x47efdb,_0x589b56){scripts[_0x20c0('0x51')](_0x47efdb[_0x20c0('0x52')],_0x47efdb[_0x20c0('0x53')]||_0x20c0('0x54'),_0x47efdb['text'],_0x47efdb['languageCode']||_0x20c0('0x55'),_0x47efdb[_0x20c0('0x56')]||_0x20c0('0x57'),_0x47efdb[_0x20c0('0x58')]||'MP3')[_0x20c0('0x10')](function(_0x15a774){_0x589b56(null,_0x15a774);})[_0x20c0('0x13')](function(_0x4c83c0){_0x589b56(_0x4c83c0);});};AGIVertices['prototype']['googleTTS']=function(_0x39a28e,_0xe3c380){scripts['googleTTS'](_0x39a28e['text'],_0x39a28e[_0x20c0('0x59')]||'en',0x1)['then'](function(_0x5c0d59){_0xe3c380(null,_0x5c0d59);})[_0x20c0('0x13')](function(_0x45ca41){_0xe3c380(_0x45ca41);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x5a')]=function(_0x261212,_0x45f1ad){var _0x15c42e={'uri':_0x261212[_0x20c0('0x5b')],'method':_0x261212[_0x20c0('0x5c')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x261212[_0x20c0('0x5d')])===_0x20c0('0x5e')&&parseInt(_0x261212['timeout'])>=0x1?parseInt(_0x261212[_0x20c0('0x5d')])*0x3e8:0x5*0x3e8};if(_[_0x20c0('0x5f')]([_0x20c0('0x60'),_0x20c0('0x61')],_0x15c42e['method'][_0x20c0('0x62')]())){try{_0x15c42e[_0x20c0('0x63')]=_0x261212[_0x20c0('0x64')]?JSON[_0x20c0('0x65')](_0x261212[_0x20c0('0x64')]):{};}catch(_0x1566ce){logger[_0x20c0('0x26')](_0x20c0('0x66'),_0x1566ce);}}try{_0x15c42e[_0x20c0('0x67')]=_0x261212[_0x20c0('0xb')]?JSON[_0x20c0('0x65')](_0x261212[_0x20c0('0xb')]):{};}catch(_0x1d4e3d){logger[_0x20c0('0x26')](_0x20c0('0x68'),_0x1d4e3d);}if(_0x261212[_0x20c0('0x69')]){try{var _0x39bb39=require(_0x261212[_0x20c0('0x69')])[_0x20c0('0x6a')](this,_0x15c42e);_0x15c42e[_0x20c0('0x6b')]=Mustache[_0x20c0('0x6c')](_0x261212['url'],_0x39bb39,{},['$$','$$']);if(_0x15c42e['headers']){_0x15c42e[_0x20c0('0x67')]=JSON[_0x20c0('0x65')](Mustache[_0x20c0('0x6c')](JSON[_0x20c0('0x6d')](_0x15c42e['headers']),_0x39bb39,{},['$$','$$']));}if(_0x15c42e[_0x20c0('0x63')]){_0x15c42e[_0x20c0('0x63')]=JSON[_0x20c0('0x65')](Mustache['render'](JSON['stringify'](_0x15c42e[_0x20c0('0x63')]),_0x39bb39,{},['$$','$$']));}}catch(_0x38cef7){logger[_0x20c0('0x26')](_0x20c0('0x6e'),_0x38cef7);}}rp(_0x15c42e)['then'](function(_0x525a83){var _0xe08378={'statusCode':_0x525a83[_0x20c0('0x6f')]||0xc8,'statusMessage':_0x525a83[_0x20c0('0x70')]||'OK','headers':_0x525a83[_0x20c0('0x67')]||{},'body':_0x525a83[_0x20c0('0x63')]||{}};_0x45f1ad(null,_0xe08378);})[_0x20c0('0x13')](function(_0x563134){var _0x3c8744={'statusCode':_0x563134[_0x20c0('0x6f')]||0x1f4,'statusMessage':_0x563134['message']||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x563134[_0x20c0('0x71')]['headers']||{},'body':_0x563134[_0x20c0('0x71')][_0x20c0('0x63')]||{}};_0x45f1ad(null,_0x3c8744);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x72')]=function(_0x1f2408,_0x415137){scripts[_0x20c0('0x72')](this[_0x20c0('0xc')]['uniqueid'],_0x1f2408[_0x20c0('0x73')],_0x1f2408[_0x20c0('0x54')],_0x1f2408[_0x20c0('0x74')]||'en')[_0x20c0('0x10')](function(_0x540174){_0x415137(null,_0x540174);})['catch'](function(_0x5c28ad){_0x415137(_0x5c28ad);});};AGIVertices['prototype'][_0x20c0('0x75')]=function(_0x13c005,_0x4bb5df){scripts['googleDialogflowV2'](this[_0x20c0('0xc')]['uniqueid'],_0x13c005['dialogflowV2_project_id'],_0x13c005[_0x20c0('0x76')],_0x13c005[_0x20c0('0x77')],_0x13c005[_0x20c0('0x54')],_0x13c005[_0x20c0('0x78')]||'en')[_0x20c0('0x10')](function(_0x5d9308){_0x4bb5df(null,_0x5d9308);})[_0x20c0('0x13')](function(_0x3f5330){_0x4bb5df(_0x3f5330);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x79')]=function(_0xc7b414,_0x219940){scripts['sestekNDA'](this[_0x20c0('0xc')],_0xc7b414)[_0x20c0('0x10')](function(_0x57fc4b){_0x219940(null,_0x57fc4b);})[_0x20c0('0x13')](function(_0x159309){_0x219940(_0x159309);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x7a')]=function(_0x221018,_0x3ca6fc){scripts[_0x20c0('0x7a')](_0x221018[_0x20c0('0x73')],_0x221018[_0x20c0('0x54')],_0x221018[_0x20c0('0x7b')]||'en-US',_0x221018[_0x20c0('0x7c')])[_0x20c0('0x10')](function(_0x33e6c9){_0x3ca6fc(null,_0x33e6c9);})[_0x20c0('0x13')](function(_0x152f19){_0x3ca6fc(_0x152f19);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x7d')]=function(_0x23b6e8,_0x582ec4,_0x8c369f){scripts[_0x20c0('0x7d')](_0x582ec4,_0x23b6e8[_0x20c0('0x73')],_0x23b6e8[_0x20c0('0x7e')]||_0x20c0('0x55'),this[_0x20c0('0x7f')](_0x23b6e8[_0x20c0('0x80')])?_0x23b6e8[_0x20c0('0x80')]:undefined)['then'](function(_0x4c670c){_0x8c369f(null,_0x4c670c);})[_0x20c0('0x13')](function(_0x1d9116){_0x8c369f(_0x1d9116);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x81')]=function(_0x44add1,_0x59b9ee){scripts[_0x20c0('0x81')](_0x44add1[_0x20c0('0x82')],_0x44add1['aws_secret_access_key'],_0x44add1[_0x20c0('0x83')],_0x44add1[_0x20c0('0x84')]||_0x20c0('0x85'),_0x44add1[_0x20c0('0x54')],_0x44add1[_0x20c0('0x86')]||_0x20c0('0x54'))[_0x20c0('0x10')](function(_0x20b90a){_0x59b9ee(null,_0x20b90a);})['catch'](function(_0x2833f3){_0x59b9ee(_0x2833f3);});};AGIVertices['prototype'][_0x20c0('0x87')]=function(_0x3ec63a,_0x3747b1){scripts[_0x20c0('0x87')](this[_0x20c0('0xc')][_0x20c0('0x30')],_0x3ec63a['aws_access_key_id'],_0x3ec63a[_0x20c0('0x88')],_0x3ec63a[_0x20c0('0x89')],_0x3ec63a['text'],_0x3ec63a[_0x20c0('0x8a')])[_0x20c0('0x10')](function(_0x28c5ea){_0x3747b1(null,_0x28c5ea);})['catch'](function(_0x5e9d54){_0x3747b1(_0x5e9d54);});};AGIVertices[_0x20c0('0x16')][_0x20c0('0x8b')]=function(_0x16f70e,_0x223ede,_0x597b32){scripts[_0x20c0('0x8b')](_0x223ede,_0x16f70e[_0x20c0('0x73')],_0x16f70e[_0x20c0('0x8c')]||'en-US')[_0x20c0('0x10')](function(_0x1deed5){_0x597b32(null,_0x1deed5);})['catch'](function(_0x46423a){_0x597b32(_0x46423a);});};AGIVertices['prototype'][_0x20c0('0x8d')]=function(_0x193489,_0x280ce0,_0x485db3){scripts['tildeASR'](_0x280ce0,_0x193489[_0x20c0('0x8e')],_0x193489[_0x20c0('0x8f')],_0x193489[_0x20c0('0x6b')])[_0x20c0('0x10')](function(_0x2321a7){_0x485db3(null,_0x2321a7);})[_0x20c0('0x13')](function(_0x16341d){_0x485db3(_0x16341d);});};AGIVertices[_0x20c0('0x16')]['clear']=function(_0x5860ca){var _0x15b0c6=_[_0x20c0('0x5f')](verticesWithRetry,_0x5860ca[_0x20c0('0x32')])?_0x5860ca:_[_0x20c0('0x90')](_0x5860ca);for(var _0x16a426 in _0x15b0c6){if(_0x15b0c6[_0x20c0('0x91')](_0x16a426)){if(_0x15b0c6[_0x16a426]&&_[_0x20c0('0x92')](_0x15b0c6[_0x16a426])){if(_[_0x20c0('0x5f')](recursiveMapAttributes,_0x16a426)){_0x15b0c6[_0x16a426]=this[_0x20c0('0x93')](_0x15b0c6[_0x16a426]);}else{_0x15b0c6[_0x16a426]=this[_0x20c0('0x94')](_0x15b0c6[_0x16a426]);}}}}return _0x15b0c6;};AGIVertices[_0x20c0('0x16')]['recursiveNodeIndex']=function(_0x4c243e){for(var _0x4d1d09 in _0x4c243e){if(_0x4c243e[_0x20c0('0x91')](_0x4d1d09)){if(_[_0x20c0('0x95')](_0x4c243e[_0x4d1d09])){this[_0x20c0('0x96')](_0x4c243e[_0x4d1d09]);}else if(_['isArray'](_0x4c243e[_0x4d1d09])){for(var _0x177a33=0x0;_0x177a33<_0x4c243e[_0x4d1d09][_0x20c0('0x97')];_0x177a33++){this[_0x20c0('0x96')](_0x4c243e[_0x4d1d09][_0x177a33]);}}else if(_['isString'](_0x4c243e[_0x4d1d09])){_0x4c243e[_0x4d1d09]=this[_0x20c0('0x94')](_0x4c243e[_0x4d1d09]);}}}};AGIVertices[_0x20c0('0x16')][_0x20c0('0x98')]=function(_0x32cab3,_0x485997){for(var _0x12463d in _0x32cab3){if(_0x32cab3[_0x20c0('0x91')](_0x12463d)){if(_[_0x20c0('0x95')](_0x32cab3[_0x12463d])){if(!_[_0x20c0('0x3b')](_0x32cab3[_0x12463d])){this[_0x20c0('0x98')](_0x32cab3[_0x12463d],util[_0x20c0('0x4a')](_0x20c0('0x99'),_0x485997,_0x12463d));}}else if(_['isArray'](_0x32cab3[_0x12463d])){for(var _0x35ee82=0x0;_0x35ee82<_0x32cab3[_0x12463d][_0x20c0('0x97')];_0x35ee82++){this[_0x20c0('0x98')](_0x32cab3[_0x12463d][_0x35ee82],util[_0x20c0('0x4a')](_0x20c0('0x99'),_0x485997,_0x12463d+'['+_0x35ee82+']'));}}else{if(!_['isNil'](_0x32cab3[_0x12463d])){this[_0x20c0('0xc')][_0x20c0('0x9a')](util[_0x20c0('0x4a')](_0x20c0('0x99'),_0x485997,_0x12463d),_0x32cab3[_0x12463d]);}}}}};AGIVertices[_0x20c0('0x16')][_0x20c0('0x93')]=function(_0x43a157){try{var _0x1c1023=JSON[_0x20c0('0x65')](_0x43a157);this[_0x20c0('0x96')](_0x1c1023);return JSON[_0x20c0('0x6d')](_0x1c1023);}catch(_0x554f70){return this['replaceAllVariables'](_0x43a157);}};AGIVertices[_0x20c0('0x16')][_0x20c0('0x94')]=function(_0x49373f){var _0x41eadc=_0x49373f[_0x20c0('0x9b')]('{');for(var _0x518983=0x1;_0x518983<_0x41eadc[_0x20c0('0x97')];_0x518983+=0x1){var _0x5ef019=_0x41eadc[_0x518983][_0x20c0('0x9b')]('}');if(_0x5ef019[_0x20c0('0x97')]>0x1){_0x49373f=_0x49373f[_0x20c0('0x9c')]('{'+_0x5ef019[0x0]+'}',this[_0x20c0('0xc')][_0x20c0('0x9d')](_0x5ef019[0x0])[_0x20c0('0x9e')]||_0x5ef019[0x0]);}}if(_0x41eadc[_0x20c0('0x97')]===0x1){return _0x49373f['toString']();}return this[_0x20c0('0x94')](_0x49373f);};AGIVertices[_0x20c0('0x16')][_0x20c0('0x9f')]=function(_0x297a3e,_0x4d7b8f){var _0xaf0fe0=this[_0x20c0('0xc')][_0x20c0('0x9d')](_0x297a3e);if(_0xaf0fe0['result']===-0x1){return _0xaf0fe0;}logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0xa0'),_0x4d7b8f,_0xaf0fe0[_0x20c0('0x9e')]));return this['channel'][_0x20c0('0x9a')](_0x4d7b8f,_0xaf0fe0[_0x20c0('0x9e')]);};AGIVertices[_0x20c0('0x16')][_0x20c0('0x7f')]=function(_0x21a582){return _0x21a582&&_0x21a582!=='0'&&_0x21a582!=='-1'&&_0x21a582!=='';};AGIVertices[_0x20c0('0x16')][_0x20c0('0xa1')]=function(_0x306a52){this['createSquareDetailsReport'][_0x20c0('0x6a')](this,_0x306a52,'-');_0x306a52['retry']=_0x306a52[_0x20c0('0xa1')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x20c0('0x16')][_0x20c0('0xa2')]=function(_0x258898){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0xa3'),_0x258898['label']));if(!this[_0x20c0('0x7f')](_0x258898[_0x20c0('0x54')])){return this[_0x20c0('0xc')]['noop'](_0x20c0('0xa4'));}var _0x25e11c='\x22'+_0x258898[_0x20c0('0x54')]+'\x22';if(this[_0x20c0('0x7f')](_0x258898['options'])){_0x25e11c+=','+_0x258898['options'];}var _0x5c6483=this[_0x20c0('0xc')]['exec'](_0x20c0('0xa5'),_0x25e11c);if(_0x5c6483[_0x20c0('0xa6')]===-0x1){return _0x5c6483;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xa8'),_0x25e11c));};AGIVertices[_0x20c0('0x16')][_0x20c0('0xa9')]=function(_0x5a7afb){logger['info'](util[_0x20c0('0x4a')](_0x20c0('0xaa'),_0x5a7afb[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x5a7afb[_0x20c0('0xab')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xac'));}var _0x534840=_0x5a7afb[_0x20c0('0xab')];if(this[_0x20c0('0x7f')](_0x5a7afb[_0x20c0('0x71')])){_0x534840+=','+_0x5a7afb[_0x20c0('0x71')];}var _0x4f9060=this[_0x20c0('0xc')][_0x20c0('0xad')](_0x20c0('0xae'),_0x534840);if(_0x4f9060[_0x20c0('0xa6')]===-0x1){return _0x4f9060;}var _0x385673=this[_0x20c0('0x9f')](_0x20c0('0xaf'),_0x20c0('0xb0'));if(_0x385673[_0x20c0('0xa6')]===-0x1){return _0x385673;}var _0x52e18b=this[_0x20c0('0x9f')](_0x20c0('0xb1'),'MRCP_RECOG_TRANSCRIPT');if(_0x52e18b[_0x20c0('0xa6')]===-0x1){return _0x52e18b;}var _0x518162=this['getAndSetVariable'](_0x20c0('0xb2'),_0x20c0('0xb3'));if(_0x518162[_0x20c0('0xa6')]===-0x1){return _0x518162;}return this['channel'][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x534840));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x7')]=function(_0x4a7aaa){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0xb4'),_0x4a7aaa[_0x20c0('0x31')]));return this[_0x20c0('0xc')][_0x20c0('0x7')]([_0x4a7aaa[_0x20c0('0xb5')],_0x4a7aaa[_0x20c0('0xb6')]]);};AGIVertices[_0x20c0('0x16')][_0x20c0('0xb7')]=function(_0xe175a5){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0xb8'),_0xe175a5[_0x20c0('0x31')]));if(this[_0x20c0('0x7f')](_0xe175a5[_0x20c0('0x5d')])){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0xb9'),_0xe175a5[_0x20c0('0x5d')]));var _0x613d7=this[_0x20c0('0xc')][_0x20c0('0xba')](_0xe175a5[_0x20c0('0x5d')]);if(_0x613d7[_0x20c0('0xa6')]===-0x1){return _0x613d7;}}return this['channel'][_0x20c0('0xb7')]();};AGIVertices['prototype'][_0x20c0('0x41')]=function(_0x328a3a){logger['info'](util[_0x20c0('0x4a')](_0x20c0('0xbb'),_0x328a3a[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x328a3a[_0x20c0('0x40')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x328a3a,_0x20c0('0xbc'));}_0x328a3a[_0x20c0('0x42')]=moment();if(this[_0x20c0('0x7f')](_0x328a3a[_0x20c0('0xbd')])){_0x328a3a['scheduledAt']=moment()[_0x20c0('0xbe')](_0x328a3a[_0x20c0('0xbd')],_0x20c0('0xbf'));}if(!this[_0x20c0('0x7f')](_0x328a3a[_0x20c0('0x44')])){_0x328a3a[_0x20c0('0x44')]=0x2;}this['createCmContact']['sync'](this,_0x328a3a);return this[_0x20c0('0xc')][_0x20c0('0xa7')](util['format'](_0x20c0('0xc0'),_0x328a3a[_0x20c0('0xc1')],_0x328a3a[_0x20c0('0x40')],_0x328a3a[_0x20c0('0x42')]));};AGIVertices[_0x20c0('0x16')][_0x20c0('0xc2')]=function(_0x1c5cd0){logger['info'](util[_0x20c0('0x4a')](_0x20c0('0xc3'),_0x1c5cd0[_0x20c0('0x31')]));var _0x11acd2=this[_0x20c0('0xc')]['exec'](_0x1c5cd0[_0x20c0('0xc4')],_0x1c5cd0[_0x20c0('0x71')]);if(_0x11acd2['result']===-0x1){return _0x11acd2;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xc5'),_0x1c5cd0['application'],_0x1c5cd0[_0x20c0('0x71')]));};AGIVertices[_0x20c0('0x16')]['lumenvoxtts']=function(_0x58ca8e){logger['info'](util[_0x20c0('0x4a')](_0x20c0('0xc6'),_0x58ca8e[_0x20c0('0x31')]));if(!this['isConfigured'](_0x58ca8e[_0x20c0('0x54')])){return this['channel']['noop'](_0x20c0('0xa4'));}var _0x5879e1='\x22'+_0x58ca8e['text']+'\x22';if(this['isConfigured'](_0x58ca8e[_0x20c0('0x71')])){_0x5879e1+=','+_0x58ca8e[_0x20c0('0x71')];}var _0x429542=this[_0x20c0('0xc')][_0x20c0('0xad')](_0x20c0('0xa5'),_0x5879e1);if(_0x429542[_0x20c0('0xa6')]===-0x1){return _0x429542;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5879e1));};AGIVertices[_0x20c0('0x16')][_0x20c0('0xc7')]=function(_0x209be0){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0xc8'),_0x209be0['label']));if(!this[_0x20c0('0x7f')](_0x209be0[_0x20c0('0x54')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')]('no\x20text\x20configured');}var _0x52549c='\x22'+_0x209be0[_0x20c0('0x54')]+'\x22';if(this[_0x20c0('0x7f')](_0x209be0[_0x20c0('0x71')])){_0x52549c+=','+_0x209be0[_0x20c0('0x71')];}var _0x2704d=this['channel'][_0x20c0('0xad')](_0x20c0('0xa5'),_0x52549c);if(_0x2704d[_0x20c0('0xa6')]===-0x1){return _0x2704d;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xa8'),_0x52549c));};AGIVertices[_0x20c0('0x16')]['lumenvoxasr']=function(_0x425457){logger[_0x20c0('0x27')](util['format'](_0x20c0('0xc9'),_0x425457[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x425457[_0x20c0('0xab')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xac'));}var _0x2fa4e2=_0x425457[_0x20c0('0xab')];if(this[_0x20c0('0x7f')](_0x425457[_0x20c0('0x71')])){_0x2fa4e2+=','+_0x425457[_0x20c0('0x71')];}var _0x20e787=this[_0x20c0('0xc')][_0x20c0('0xad')](_0x20c0('0xae'),_0x2fa4e2);if(_0x20e787[_0x20c0('0xa6')]===-0x1){return _0x20e787;}var _0x59c0e5=this[_0x20c0('0x9f')](_0x20c0('0xaf'),_0x20c0('0xca'));if(_0x59c0e5[_0x20c0('0xa6')]===-0x1){return _0x59c0e5;}var _0x5f55be=this[_0x20c0('0x9f')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x5f55be['result']===-0x1){return _0x5f55be;}var _0x4fdd6f=this[_0x20c0('0x9f')]('RECOG_INSTANCE()',_0x20c0('0xcb'));if(_0x4fdd6f['result']===-0x1){return _0x4fdd6f;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xcc'),_0x2fa4e2));};AGIVertices[_0x20c0('0x16')][_0x20c0('0xcd')]=function(_0x21737b){logger[_0x20c0('0x27')](util['format'](_0x20c0('0xce'),_0x21737b['label']));if(!this[_0x20c0('0x7f')](_0x21737b[_0x20c0('0xab')])){return this['channel'][_0x20c0('0xa7')](_0x20c0('0xac'));}var _0x2a27b7=_0x21737b['grammar'];if(this[_0x20c0('0x7f')](_0x21737b[_0x20c0('0x71')])){_0x2a27b7+=','+_0x21737b['options'];}var _0x49f305=this['channel'][_0x20c0('0xad')](_0x20c0('0xae'),_0x2a27b7);if(_0x49f305['result']===-0x1){return _0x49f305;}var _0x313c2f=this[_0x20c0('0x9f')](_0x20c0('0xaf'),_0x20c0('0xcf'));if(_0x313c2f[_0x20c0('0xa6')]===-0x1){return _0x313c2f;}var _0x18710d=this[_0x20c0('0x9f')](_0x20c0('0xb1'),_0x20c0('0xd0'));if(_0x18710d[_0x20c0('0xa6')]===-0x1){return _0x18710d;}var _0x345cfa=this['getAndSetVariable'](_0x20c0('0xb2'),_0x20c0('0xd1'));if(_0x345cfa[_0x20c0('0xa6')]===-0x1){return _0x345cfa;}return this['channel'][_0x20c0('0xa7')](util['format'](_0x20c0('0xcc'),_0x2a27b7));};AGIVertices[_0x20c0('0x16')][_0x20c0('0xd2')]=function(_0xefb28d){logger[_0x20c0('0x27')](util['format'](_0x20c0('0xd3'),_0xefb28d[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0xefb28d[_0x20c0('0xd4')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0xefb28d,'no\x20database\x20selected');}var _0xef71a7=this[_0x20c0('0x17')][_0x20c0('0x6a')](this,_0xefb28d['odbc_id']);if(!_0xef71a7){return this[_0x20c0('0xc')]['error'](_0xefb28d,_0x20c0('0xd5'));}if(!this['isConfigured'](_0xefb28d['query'])){return this['channel'][_0x20c0('0x26')](_0xefb28d,_0x20c0('0xd6'));}var _0x55d6d6=_0xefb28d[_0x20c0('0x28')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x20c0('0xc')]['noop'](util[_0x20c0('0x4a')]('query:\x20%s',_0x55d6d6));var _0x32e47c=this['getQueryOdbc'][_0x20c0('0x6a')](this,_0xef71a7,_0x55d6d6);this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0xefb28d,_0x55d6d6);if(!this['isConfigured'](_0xefb28d[_0x20c0('0xd7')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xd8'));}var _0x33ff42=this[_0x20c0('0x9d')]['sync'](this,_0xefb28d['variable_id']);if(!_0x33ff42){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0xefb28d,_0x20c0('0xd9'));}var _0x3efe75=this;_0x32e47c[_0x20c0('0xda')](function(_0x59d4ff,_0x50dfcf){Object[_0x20c0('0xdb')](_0x59d4ff)[_0x20c0('0xda')](function(_0x34f819){_0x3efe75[_0x20c0('0xc')]['setVariable'](util['format'](_0x20c0('0xdc'),_0x33ff42,_0x50dfcf,_0x34f819),_0x59d4ff[_0x34f819]);});});this['channel'][_0x20c0('0x9a')](util['format'](_0x20c0('0xdd'),_0x33ff42),_0x32e47c[_0x20c0('0x97')]);return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xde'),_0x33ff42));};AGIVertices[_0x20c0('0x16')][_0x20c0('0xdf')]=function(_0x12be6e){logger[_0x20c0('0xe0')](util[_0x20c0('0x4a')](_0x20c0('0xe1'),_0x12be6e[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x12be6e[_0x20c0('0xe2')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x12be6e,'no\x20user\x20selected');}var _0x29ef07=this[_0x20c0('0x19')]['sync'](this,_0x12be6e[_0x20c0('0xe2')]);if(!_0x29ef07){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x12be6e,_0x20c0('0xe3'));}var _0x294b9e=this['channel'][_0x20c0('0xad')](_0x20c0('0xe4'),[util[_0x20c0('0x4a')]('SIP/%s',_0x29ef07),_0x12be6e[_0x20c0('0x5d')],_0x12be6e[_0x20c0('0xe5')],_0x12be6e[_0x20c0('0x5b')]]);if(_0x294b9e[_0x20c0('0xa6')]===-0x1){return _0x294b9e;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xe6'),'DIAL'));};AGIVertices[_0x20c0('0x16')][_0x20c0('0xe7')]=function(_0x37f3f8){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0xe8'),_0x37f3f8[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x37f3f8[_0x20c0('0x73')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x37f3f8[_0x20c0('0x54')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')]('no\x20text\x20configured');}this[_0x20c0('0xc')][_0x20c0('0xe9')]=!![];this[_0x20c0('0x2f')](_0x37f3f8);this[_0x20c0('0x39')](_0x37f3f8[_0x20c0('0x54')],'in','','');this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xea'),_0x37f3f8['text']));var _0x5a0381=this[_0x20c0('0x72')][_0x20c0('0x6a')](this,_0x37f3f8);if(_0x5a0381){for(var _0x2ecd26 in _0x5a0381){if(_0x5a0381['hasOwnProperty'](_0x2ecd26)){this[_0x20c0('0xc')][_0x20c0('0x9a')](util[_0x20c0('0x4a')](_0x20c0('0xeb'),_0x2ecd26['toUpperCase']()),_0x5a0381[_0x2ecd26]);}}this[_0x20c0('0x39')](_0x5a0381[_0x20c0('0xec')],_0x20c0('0xed'),_0x20c0('0xe7'),'');return this[_0x20c0('0xc')][_0x20c0('0xa7')](util['format']('Dialogflow\x20Result\x20%s',_0x5a0381['speech']));}return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x37f3f8,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x20c0('0x16')]['dialogflowV2']=function(_0x12491f){logger['info'](util[_0x20c0('0x4a')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x12491f['label']));if(!this[_0x20c0('0x7f')](_0x12491f[_0x20c0('0xee')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xef'));}if(!this['isConfigured'](_0x12491f['client_email'])){return this['channel'][_0x20c0('0xa7')](_0x20c0('0xf0'));}if(!this[_0x20c0('0x7f')](_0x12491f[_0x20c0('0x77')])){return this['channel'][_0x20c0('0xa7')](_0x20c0('0xf1'));}if(!this['isConfigured'](_0x12491f[_0x20c0('0x78')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xf2'));}if(!this[_0x20c0('0x7f')](_0x12491f[_0x20c0('0x54')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xa4'));}this[_0x20c0('0xc')][_0x20c0('0xe9')]=!![];this[_0x20c0('0x2f')](_0x12491f);this[_0x20c0('0x39')](_0x12491f[_0x20c0('0x54')],'in','','');this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xf3'),_0x12491f[_0x20c0('0x54')]));var _0x2302e2=this['googleDialogflowV2'][_0x20c0('0x6a')](this,_0x12491f);if(_0x2302e2){for(var _0x3d6a26 in _0x2302e2){if(_0x2302e2[_0x20c0('0x91')](_0x3d6a26)){if(_0x3d6a26!==_0x20c0('0xf4')){this['channel'][_0x20c0('0x9a')](util[_0x20c0('0x4a')](_0x20c0('0xeb'),_0x3d6a26[_0x20c0('0x62')]()),_0x2302e2[_0x3d6a26]);}}}this['createSquareMessage'](_0x2302e2[_0x20c0('0xec')],'out',_0x20c0('0xf5'),_0x2302e2[_0x20c0('0xf4')]);return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('DialogflowV2\x20Result\x20%s',_0x2302e2[_0x20c0('0xec')]));}return this['channel'][_0x20c0('0x26')](_0x12491f,_0x20c0('0xf6'));};AGIVertices['prototype'][_0x20c0('0xf7')]=function(_0x3477ad){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0xf8'),_0x3477ad['label']));if(!this[_0x20c0('0x7f')](_0x3477ad[_0x20c0('0xf9')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xfa'));}if(!this[_0x20c0('0x7f')](_0x3477ad['username'])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xfb'));}if(!this[_0x20c0('0x7f')](_0x3477ad[_0x20c0('0xfc')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xfd'));}if(!this[_0x20c0('0x7f')](_0x3477ad[_0x20c0('0xfe')])){return this[_0x20c0('0xc')]['noop']('no\x20text\x20configured');}this[_0x20c0('0xc')]['bot']=!![];this[_0x20c0('0x2f')](_0x3477ad);this[_0x20c0('0x39')](_0x3477ad[_0x20c0('0x54')],'in','','');this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xff'),_0x3477ad[_0x20c0('0x54')]));var _0x36df58=this[_0x20c0('0x79')][_0x20c0('0x6a')](this,_0x3477ad);if(_0x36df58){for(var _0x4b916d in _0x36df58){if(_0x36df58[_0x20c0('0x91')](_0x4b916d)){this[_0x20c0('0xc')]['setVariable'](util['format']('SESTEK_NDA_%s',_0x4b916d[_0x20c0('0x62')]()),_0x36df58[_0x4b916d]);}}this[_0x20c0('0x39')](_0x36df58[_0x20c0('0xec')],_0x20c0('0xed'),_0x20c0('0xf7'),'');if(_0x36df58[_0x20c0('0x100')]){this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x101'),_0x36df58['audiofile']));var _0x255879=this[_0x20c0('0xc')][_0x20c0('0x102')](_0x36df58[_0x20c0('0x100')]);try{fs['unlink'](_0x36df58[_0x20c0('0x100')]+_0x20c0('0x103'));}catch(_0x480dc3){logger['error'](_0x480dc3);}return _0x255879;}else{return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('SestekNDA\x20Result\x20%s',_0x36df58[_0x20c0('0xec')]));}}return this['channel'][_0x20c0('0x26')](_0x3477ad,_0x20c0('0x104'));};AGIVertices[_0x20c0('0x16')]['end']=function(_0x363c68){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x105'),_0x363c68[_0x20c0('0x31')]));return this['channel'][_0x20c0('0xa7')](_0x20c0('0x106'));};AGIVertices['prototype'][_0x20c0('0x107')]=function(_0x19d920){logger['info'](util[_0x20c0('0x4a')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x19d920[_0x20c0('0x31')]));var _0x5071b1='';if(_0x19d920[_0x20c0('0x108')]){if(!this[_0x20c0('0x7f')](_0x19d920['trunk_id'])){return this['channel']['error'](_0x19d920,_0x20c0('0x109'));}else{var _0x3ddec0=parseInt(_0x19d920['trunk_id'],0xa);if(isNaN(_0x3ddec0)){_0x5071b1=_0x19d920['trunk_id'];}else{_0x5071b1=this[_0x20c0('0x1b')][_0x20c0('0x6a')](this,_0x19d920[_0x20c0('0x108')]);if(!_0x5071b1){return this[_0x20c0('0xc')]['error'](_0x19d920,_0x20c0('0x10a'));}}}}else if(_0x19d920[_0x20c0('0x10b')]){_0x5071b1=_0x19d920['trunk_name'];}else{return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x19d920,_0x20c0('0x109'));}var _0x48f9b7=this[_0x20c0('0xc')][_0x20c0('0xad')](_0x20c0('0xe4'),[util[_0x20c0('0x4a')](_0x20c0('0x10c'),_0x5071b1,_0x19d920[_0x20c0('0xc1')]),_0x19d920['timeout'],_0x19d920['opts'],_0x19d920[_0x20c0('0x5b')]]);if(_0x48f9b7[_0x20c0('0xa6')]===-0x1){return _0x48f9b7;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xe6'),_0x20c0('0xe4')));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x10d')]=function(_0x191987){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x191987['label']));return this['channel'][_0x20c0('0xa7')]('finally');};AGIVertices[_0x20c0('0x16')][_0x20c0('0x10e')]=function(_0x14ee0d){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x14ee0d[_0x20c0('0x31')]));if(_0x14ee0d[_0x20c0('0x10f')]===0x0){return this['maxRetry'](_0x14ee0d);}_0x14ee0d['retry']-=0x1;if(!this[_0x20c0('0x7f')](_0x14ee0d[_0x20c0('0x110')])){return this['channel'][_0x20c0('0x26')](_0x14ee0d,_0x20c0('0x111'));}var _0x10812b=this[_0x20c0('0x112')][_0x20c0('0x6a')](this,_0x14ee0d[_0x20c0('0x110')]);if(!_0x10812b){return this['channel'][_0x20c0('0x26')](_0x14ee0d,_0x20c0('0x113'));}if(!this[_0x20c0('0x7f')](_0x14ee0d[_0x20c0('0xd7')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x20c0('0xd8'));}var _0x413740=this['channel'][_0x20c0('0x114')](_0x10812b,_0x14ee0d['response'],_0x14ee0d['maxdigit']);var _0x5d2eb1=_0x413740[_0x20c0('0xa6')]?_0x413740['result'][_0x20c0('0x43')]():'';logger[_0x20c0('0x27')](_0x20c0('0x115'),JSON['stringify'](_0x413740));if(_0x413740['result']===-0x1){this[_0x20c0('0x2f')]['sync'](this,_0x14ee0d,_0x5d2eb1);return _0x413740;}else if(_0x413740[_0x20c0('0x9e')]===_0x20c0('0x5d')){_0x413740[_0x20c0('0xa6')]=_0x5d2eb1['length']>=parseInt(_0x14ee0d[_0x20c0('0x116')])?'x':'i';}else{_0x413740[_0x20c0('0xa6')]=_0x5d2eb1[_0x20c0('0x97')]>=parseInt(_0x14ee0d[_0x20c0('0x116')])&&_0x5d2eb1[_0x20c0('0x97')]<=parseInt(_0x14ee0d[_0x20c0('0x117')])?'x':'i';}var _0x18657e=this['getVariable']['sync'](this,_0x14ee0d[_0x20c0('0xd7')]);if(!_0x18657e){return this['channel']['error'](_0x14ee0d,_0x20c0('0xd9'));}this[_0x20c0('0xc')][_0x20c0('0x9a')](_0x18657e,_0x5d2eb1);if(this[_0x20c0('0x7f')](_0x14ee0d['hiddendigitsnum'])){var _0x438284=parseInt(_0x14ee0d[_0x20c0('0x118')],0xa);var _0x594a02=rs[_0x20c0('0x119')]({'charset':'*','length':_0x438284});var _0x18c9a4=_0x5d2eb1[_0x20c0('0x97')];if(_0x18c9a4>0x0){if(_0x18c9a4>_0x438284){this[_0x20c0('0x2f')]['sync'](this,_0x14ee0d,_0x14ee0d[_0x20c0('0x11a')]===_0x20c0('0x11b')?_0x594a02+_0x5d2eb1[_0x20c0('0x11c')](_0x438284):_0x5d2eb1[_0x20c0('0x11c')](0x0,_0x18c9a4-_0x438284)+_0x594a02);}else{this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0x14ee0d,rs[_0x20c0('0x119')]({'charset':'*','length':_0x18c9a4}));}}else{this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0x14ee0d,'');}}else{this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0x14ee0d,_0x5d2eb1);}return _0x413740;};AGIVertices[_0x20c0('0x16')][_0x20c0('0x11d')]=function(_0x152a3f){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x11e'),_0x152a3f['label']));return this[_0x20c0('0x10e')](_0x152a3f);};AGIVertices[_0x20c0('0x16')][_0x20c0('0x11f')]=function(_0x228cb5){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x120'),_0x228cb5[_0x20c0('0x31')]));this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0x228cb5,_0x228cb5[_0x20c0('0x121')]);return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x122'),_0x228cb5[_0x20c0('0x121')]));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x123')]=function(_0x3f75ec){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x124'),_0x3f75ec[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x3f75ec[_0x20c0('0x82')])||!this[_0x20c0('0x7f')](_0x3f75ec[_0x20c0('0x88')])){return this['channel']['noop'](_0x20c0('0x125'));}if(!this['isConfigured'](_0x3f75ec[_0x20c0('0x54')])){return this['channel']['noop'](_0x20c0('0xa4'));}this['channel'][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x126'),_0x3f75ec['text']));var _0x409ba4=this['awsPolly'][_0x20c0('0x6a')](this,_0x3f75ec);if(_0x409ba4){this[_0x20c0('0xc')][_0x20c0('0xa7')](util['format'](_0x20c0('0x127'),_0x409ba4));var _0x2cce60=this[_0x20c0('0xc')][_0x20c0('0x102')](_0x409ba4);try{fs[_0x20c0('0x128')](_0x409ba4+_0x20c0('0x103'));}catch(_0x4933ed){logger[_0x20c0('0x26')](_0x4933ed);}return _0x2cce60;}return this[_0x20c0('0xc')]['error'](_0x3f75ec,_0x20c0('0x129'));};AGIVertices['prototype'][_0x20c0('0x12a')]=function(_0x5a0086){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x12b'),_0x5a0086[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x5a0086['aws_access_key_id'])||!this[_0x20c0('0x7f')](_0x5a0086[_0x20c0('0x88')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x20c0('0x7f')](_0x5a0086[_0x20c0('0x8a')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x12c'));}if(!this[_0x20c0('0x7f')](_0x5a0086[_0x20c0('0x54')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xa4'));}this[_0x20c0('0xc')][_0x20c0('0xe9')]=!![];this[_0x20c0('0x2f')](_0x5a0086);this[_0x20c0('0x39')](_0x5a0086[_0x20c0('0x54')],'in','','');this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x12d'),_0x5a0086['text']));var _0x39d59a=this[_0x20c0('0x87')][_0x20c0('0x6a')](this,_0x5a0086);if(_0x39d59a){for(var _0x416b29 in _0x39d59a){if(_0x39d59a[_0x20c0('0x91')](_0x416b29)&&_[_0x20c0('0x92')](_0x39d59a[_0x416b29])){this[_0x20c0('0xc')][_0x20c0('0x9a')](util['format'](_0x20c0('0x12e'),_0x416b29[_0x20c0('0x62')]()),_0x39d59a[_0x416b29]);}}if(_[_0x20c0('0x3c')](_0x39d59a[_0x20c0('0x12f')])){return this['channel'][_0x20c0('0xa7')](_0x20c0('0x130'));}else{this['createSquareMessage'](_0x39d59a[_0x20c0('0x12f')],_0x20c0('0xed'),'amazonlex','');return this['channel'][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x131'),_0x39d59a[_0x20c0('0x12f')]));}}return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x5a0086,_0x20c0('0x132'));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x133')]=function(_0x35d0f5){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x134'),_0x35d0f5['label'],_0x35d0f5[_0x20c0('0x5d')]));if(!this['isConfigured'](_0x35d0f5[_0x20c0('0x73')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x135'));}var _0x2dd5f8='wav';var _0x19d5ad=util['format'](_0x20c0('0x136'),FILES_PATH,rs[_0x20c0('0x119')](0x4));var _0x1309e2=util[_0x20c0('0x4a')]('%s.%s',_0x19d5ad,_0x2dd5f8);var _0x42e95d=!![];if(_0x35d0f5[_0x20c0('0x137')]===_0x20c0('0x138')){_0x42e95d=![];}var _0x44c23d=this[_0x20c0('0xc')][_0x20c0('0x139')](_0x19d5ad,_0x2dd5f8,_0x35d0f5[_0x20c0('0x13a')],_0x35d0f5[_0x20c0('0x5d')],undefined,_0x42e95d);if(_0x44c23d[_0x20c0('0xa6')]!==-0x1){this['channel'][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x13b'),_0x1309e2));var _0x343341=this[_0x20c0('0x8b')][_0x20c0('0x6a')](this,_0x35d0f5,_0x1309e2);if(_0x343341){for(var _0x3753a0 in _0x343341){if(_0x343341[_0x20c0('0x91')](_0x3753a0)){this[_0x20c0('0xc')][_0x20c0('0x9a')](util['format']('GOOGLE_ASR_%s',_0x3753a0[_0x20c0('0x62')]()),_0x343341[_0x3753a0]);}}return this['channel'][_0x20c0('0xa7')](util['format'](_0x20c0('0x13c'),JSON[_0x20c0('0x6d')](_0x343341)));}}return _0x44c23d;};AGIVertices[_0x20c0('0x16')][_0x20c0('0x13d')]=function(_0x1229ce){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x13e'),_0x1229ce[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x1229ce[_0x20c0('0x8e')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x13f'));}if(!this[_0x20c0('0x7f')](_0x1229ce[_0x20c0('0x8f')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x140'));}var _0x5896f4=_0x20c0('0x141');var _0x369c08=util[_0x20c0('0x4a')]('%s/recordings/%s',FILES_PATH,rs[_0x20c0('0x119')](0x4));var _0x2b5038=util['format'](_0x20c0('0x99'),_0x369c08,_0x5896f4);var _0x5d1e4c=!![];if(_0x1229ce[_0x20c0('0x137')]===_0x20c0('0x138')){_0x5d1e4c=![];}var _0x45c7d3=this[_0x20c0('0xc')]['recordFile'](_0x369c08,_0x5896f4,_0x1229ce[_0x20c0('0x13a')],_0x1229ce[_0x20c0('0x5d')],undefined,_0x5d1e4c);if(_0x45c7d3[_0x20c0('0xa6')]!==-0x1){this['channel']['noop'](util['format']('tilde\x20%s\x20file\x20created',_0x2b5038));var _0x260f37=this[_0x20c0('0x8d')][_0x20c0('0x6a')](this,_0x1229ce,_0x2b5038);if(_0x260f37){for(var _0x52ee9e in _0x260f37){if(_0x260f37['hasOwnProperty'](_0x52ee9e)){this[_0x20c0('0xc')][_0x20c0('0x9a')](util[_0x20c0('0x4a')](_0x20c0('0x142'),_0x52ee9e[_0x20c0('0x62')]()),_0x260f37[_0x52ee9e]);}}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x143'),JSON['stringify'](_0x260f37)));}}return _0x45c7d3;};AGIVertices[_0x20c0('0x16')][_0x20c0('0x144')]=function(_0x22d20d){logger['info'](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x22d20d[_0x20c0('0x31')]));return this[_0x20c0('0xc')][_0x20c0('0x145')](_0x22d20d['context'],_0x22d20d[_0x20c0('0x37')],_0x22d20d['priority']);};AGIVertices['prototype'][_0x20c0('0x146')]=function(_0x3aa080){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x3aa080['label']));if(!this['isConfigured'](_0x3aa080[_0x20c0('0x147')])){return this[_0x20c0('0xc')]['error'](_0x3aa080,_0x20c0('0x148'));}try{var _0x1c73bb=eval(_0x3aa080[_0x20c0('0x147')])?_0x20c0('0x149'):_0x20c0('0x14a');this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x14b'),_0x3aa080['condition'],_0x1c73bb));return{'code':0xc8,'result':_0x1c73bb};}catch(_0x5aa61e){return{'code':0xc8,'result':_0x20c0('0x14a')};}};AGIVertices[_0x20c0('0x16')]['gotoiftime']=function(_0x170250){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x14c'),_0x170250[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x170250[_0x20c0('0x14d')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x170250,_0x20c0('0x14e'));}var _0x5e6287=this['getIntervals']['sync'](this,_0x170250[_0x20c0('0x14d')]);if(!_0x5e6287){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x170250,_0x20c0('0x14f'));}for(var _0x2bc733=0x0;_0x2bc733<_0x5e6287[_0x20c0('0x97')];_0x2bc733+=0x1){var _0x100164=this['channel'][_0x20c0('0x9d')](util[_0x20c0('0x4a')](_0x20c0('0x150'),_0x5e6287[_0x2bc733]));if(_0x100164['result']===-0x1){return _0x100164;}logger['info'](util['format'](_0x20c0('0x151'),_0x5e6287[_0x2bc733],_0x100164[_0x20c0('0x9e')]));if(_0x100164[_0x20c0('0x9e')]===_0x20c0('0x149')){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x151'),_0x5e6287[_0x2bc733],'true'));this['channel'][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x151'),_0x5e6287[_0x2bc733],_0x20c0('0x149')));return{'code':0xc8,'result':_0x20c0('0x149')};}else{logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('IFTIME\x20%s\x20%s',_0x5e6287[_0x2bc733],_0x20c0('0x14a')));this['channel'][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('IFTIME\x20%s\x20%s',_0x5e6287[_0x2bc733],_0x20c0('0x14a')));}}return{'code':0xc8,'result':_0x20c0('0x14a')};};AGIVertices[_0x20c0('0x16')][_0x20c0('0x152')]=function(_0x319c82){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x319c82[_0x20c0('0x31')]));return this[_0x20c0('0xc')]['hangup']();};AGIVertices['prototype']['ispeechasr']=function(_0x4ed9a8){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x153'),_0x4ed9a8['label']));if(!this[_0x20c0('0x7f')](_0x4ed9a8[_0x20c0('0x73')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')]('no\x20key\x20configured');}var _0xf684f2=_0x20c0('0x141');var _0x379477=util[_0x20c0('0x4a')](_0x20c0('0x136'),FILES_PATH,rs['generate'](0x4));var _0x316f0a=util[_0x20c0('0x4a')](_0x20c0('0x99'),_0x379477,_0xf684f2);var _0x110797=!![];if(_0x4ed9a8['beep']==='NOBEEP'){_0x110797=![];}var _0x27ebd2=this[_0x20c0('0xc')]['recordFile'](_0x379477,_0xf684f2,_0x4ed9a8['intKey'],_0x4ed9a8[_0x20c0('0x5d')],undefined,_0x110797);if(_0x27ebd2[_0x20c0('0xa6')]!==-0x1){this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x154'),_0x316f0a));var _0xb995e5=this['ispeechASR']['sync'](this,_0x4ed9a8,_0x316f0a);if(_0xb995e5){for(var _0x250e4d in _0xb995e5){if(_0xb995e5['hasOwnProperty'](_0x250e4d)){this['channel'][_0x20c0('0x9a')](util[_0x20c0('0x4a')](_0x20c0('0x155'),_0x250e4d[_0x20c0('0x62')]()),_0xb995e5[_0x250e4d]);}}return this[_0x20c0('0xc')]['noop'](util[_0x20c0('0x4a')](_0x20c0('0x156'),JSON[_0x20c0('0x6d')](_0xb995e5)));}}return _0x27ebd2;};AGIVertices['prototype']['ispeechtts']=function(_0x15c6c3){logger['info'](util[_0x20c0('0x4a')](_0x20c0('0x157'),_0x15c6c3[_0x20c0('0x31')]));if(!this['isConfigured'](_0x15c6c3[_0x20c0('0x73')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x135'));}if(!this[_0x20c0('0x7f')](_0x15c6c3[_0x20c0('0x54')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xa4'));}this[_0x20c0('0xc')]['noop'](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x15c6c3[_0x20c0('0x54')]));var _0x4de334=this[_0x20c0('0x7a')][_0x20c0('0x6a')](this,_0x15c6c3);if(_0x4de334){this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x154'),_0x4de334));var _0x2403e2=this[_0x20c0('0xc')]['streamFile'](_0x4de334,_0x15c6c3[_0x20c0('0x13a')]);try{fs['unlink'](_0x4de334+'.wav');}catch(_0x131cdf){logger['error'](_0x131cdf);}return _0x2403e2;}return this['channel'][_0x20c0('0x26')](_0x15c6c3,_0x20c0('0x158'));};AGIVertices['prototype'][_0x20c0('0x159')]=function(_0x1c995b){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x15a'),_0x1c995b[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x1c995b[_0x20c0('0x15b')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x1c995b,_0x20c0('0x15c'));}logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x20c0('0xc')][_0x20c0('0x35')],_0x1c995b['findBy']));var _0x2c773c=this[_0x20c0('0x4d')][_0x20c0('0x6a')](this,_0x1c995b[_0x20c0('0x15b')]);if(_0x2c773c){logger['info'](util[_0x20c0('0x4a')](_0x20c0('0x15d'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0x1c995b[_0x20c0('0x15b')]));this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x20c0('0x35')],_0x1c995b['findBy']));return{'code':0xc8,'result':_0x20c0('0x15e')};}else{logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x15f'),this['channel'][_0x20c0('0x35')],_0x1c995b[_0x20c0('0x15b')]));this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x20c0('0xc')][_0x20c0('0x35')],_0x1c995b[_0x20c0('0x15b')]));return{'code':0xc8,'result':_0x20c0('0x160')};}};AGIVertices['prototype']['logout']=function(_0x3c9a79){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x161'),_0x3c9a79[_0x20c0('0x31')]));if(!this['isConfigured'](_0x3c9a79[_0x20c0('0x15b')])){return this['channel'][_0x20c0('0x26')](_0x3c9a79,'no\x20find\x20by\x20configured');}logger['info'](util[_0x20c0('0x4a')](_0x20c0('0x162'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0x3c9a79['findBy']));var _0x46cb2f=this[_0x20c0('0x48')][_0x20c0('0x6a')](this,_0x3c9a79[_0x20c0('0x15b')]);if(_0x46cb2f){logger[_0x20c0('0x27')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x20c0('0x35')],_0x3c9a79[_0x20c0('0x15b')]));this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x15d'),this['channel']['callerid'],_0x3c9a79['findBy']));return{'code':0xc8,'result':_0x20c0('0x15e')};}else{logger['info'](util['format'](_0x20c0('0x15f'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0x3c9a79[_0x20c0('0x15b')]));this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x15f'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0x3c9a79[_0x20c0('0x15b')]));return{'code':0xc8,'result':_0x20c0('0x160')};}};AGIVertices[_0x20c0('0x16')][_0x20c0('0x163')]=function(_0x3acde3){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x164'),_0x3acde3[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x3acde3[_0x20c0('0x165')])){return this['channel'][_0x20c0('0x26')](_0x3acde3,'no\x20operation\x20configured');}this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x166'),_0x3acde3[_0x20c0('0x165')]));var _0x34ba7a=eval(_0x3acde3[_0x20c0('0x165')]);if(!this[_0x20c0('0x7f')](_0x3acde3['variable_id'])){return this[_0x20c0('0xc')]['noop'](_0x20c0('0xd8'));}var _0x5b27f7=this[_0x20c0('0x9d')][_0x20c0('0x6a')](this,_0x3acde3['variable_id']);if(!_0x5b27f7){return this['channel'][_0x20c0('0x26')](_0x3acde3,_0x20c0('0xd9'));}if(_[_0x20c0('0x167')](_0x34ba7a)){var _0x3eabfd=this;_0x34ba7a['forEach'](function(_0x2ad78a,_0x519258){_0x3eabfd[_0x20c0('0xc')][_0x20c0('0x9a')](util[_0x20c0('0x4a')](_0x20c0('0x168'),_0x5b27f7,_0x519258),_0x2ad78a);});return this[_0x20c0('0xc')]['noop'](util[_0x20c0('0x4a')](_0x20c0('0x169'),_0x5b27f7));}else{return this['channel'][_0x20c0('0x9a')](_0x5b27f7,_0x34ba7a);}};AGIVertices['prototype']['menu']=function(_0x1d75af){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x1d75af[_0x20c0('0x31')]));if(_0x1d75af['retry']===0x0){return this['maxRetry'](_0x1d75af);}_0x1d75af[_0x20c0('0x10f')]-=0x1;if(!this[_0x20c0('0x7f')](_0x1d75af[_0x20c0('0x110')])){return this['channel'][_0x20c0('0x26')](_0x1d75af,_0x20c0('0x111'));}var _0x4dc355=this[_0x20c0('0x112')]['sync'](this,_0x1d75af[_0x20c0('0x110')]);if(!_0x4dc355){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x1d75af,_0x20c0('0x113'));}var _0x1ff8a5=this['channel'][_0x20c0('0x114')](_0x4dc355,_0x1d75af[_0x20c0('0x16a')],_0x1d75af['digit']);var _0x474bcc=_0x1ff8a5['result'];if(_0x1ff8a5[_0x20c0('0xa6')]===-0x1){this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0x1d75af,'-1');return _0x1ff8a5;}else if(_0x1ff8a5[_0x20c0('0x9e')]===_0x20c0('0x5d')){_0x1ff8a5['result']=_0x1ff8a5[_0x20c0('0xa6')][_0x20c0('0x97')]>0x0?_0x1ff8a5['result']:'t';}else if(_[_0x20c0('0x3b')](_0x1ff8a5[_0x20c0('0xa6')])){_0x1ff8a5[_0x20c0('0xa6')]='#';_0x474bcc='#';}if(!this['isConfigured'](_0x1d75af[_0x20c0('0xd7')])){this[_0x20c0('0xc')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x237d52=this[_0x20c0('0x9d')][_0x20c0('0x6a')](this,_0x1d75af['variable_id']);if(!_0x237d52){return this[_0x20c0('0xc')]['error'](_0x1d75af,_0x20c0('0xd9'));}this[_0x20c0('0xc')][_0x20c0('0x9a')](_0x237d52,_0x474bcc);}this['createSquareDetailsReport'][_0x20c0('0x6a')](this,_0x1d75af,_0x474bcc);return _0x1ff8a5;};AGIVertices[_0x20c0('0x16')][_0x20c0('0xa7')]=function(_0x432f7a){logger[_0x20c0('0x27')](util['format'](_0x20c0('0x16b'),_0x432f7a[_0x20c0('0x31')]));return this[_0x20c0('0xc')]['noop'](_0x432f7a['output']||_0x432f7a['label']);};AGIVertices[_0x20c0('0x16')][_0x20c0('0x16c')]=function(_0x15014c){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x16d'),_0x15014c['label']));if(!this[_0x20c0('0x7f')](_0x15014c[_0x20c0('0x15b')])){return this[_0x20c0('0xc')]['error'](_0x15014c,_0x20c0('0x15c'));}logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x162'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0x15014c['findBy']));var _0x22eb47=this[_0x20c0('0x45')]['sync'](this,_0x15014c[_0x20c0('0x16e')]);var _0xc91f48=this[_0x20c0('0x16f')][_0x20c0('0x6a')](this,_0x15014c[_0x20c0('0x15b')],_0x22eb47);if(_0xc91f48){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x15d'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0x15014c[_0x20c0('0x15b')]));this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x15d'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0x15014c[_0x20c0('0x15b')]));return{'code':0xc8,'result':_0x20c0('0x15e')};}else{logger[_0x20c0('0x27')](util['format'](_0x20c0('0x15f'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0x15014c[_0x20c0('0x15b')]));this[_0x20c0('0xc')]['noop'](util[_0x20c0('0x4a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x20c0('0xc')]['callerid'],_0x15014c['findBy']));return{'code':0xc8,'result':_0x20c0('0x160')};}};AGIVertices[_0x20c0('0x16')][_0x20c0('0x170')]=function(_0x53cf76){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x171'),_0x53cf76['label']));if(!this[_0x20c0('0x7f')](_0x53cf76[_0x20c0('0x110')])){return this['channel']['error'](_0x53cf76,_0x20c0('0x111'));}var _0x59bb6a=this[_0x20c0('0x112')]['sync'](this,_0x53cf76[_0x20c0('0x110')]);if(!_0x59bb6a){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x53cf76,_0x20c0('0x113'));}var _0x16414d=this[_0x20c0('0xc')]['exec'](_0x20c0('0x172'),[_0x59bb6a,_0x53cf76[_0x20c0('0xe5')]]);if(_0x16414d['result']===-0x1){return _0x16414d;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xc5'),_0x20c0('0x172'),_0x59bb6a));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x173')]=function(_0x5e0ad6){logger['info'](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x5e0ad6[_0x20c0('0x31')]));if(!this['isConfigured'](_0x5e0ad6[_0x20c0('0x174')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x5e0ad6,_0x20c0('0x175'));}var _0x49d65a='';var _0xe21f5d=parseInt(_0x5e0ad6['queue_id'],0xa);if(isNaN(_0xe21f5d)){_0x49d65a=_0x5e0ad6[_0x20c0('0x174')];}else{_0x49d65a=this[_0x20c0('0x176')][_0x20c0('0x6a')](this,_0x5e0ad6['queue_id']);if(!_0x49d65a){return this['channel']['error'](_0x5e0ad6,'no\x20queue\x20found');}}var _0x28ecfa='';if(this[_0x20c0('0x7f')](_0x5e0ad6[_0x20c0('0x110')])){var _0x20a651=this[_0x20c0('0x112')][_0x20c0('0x6a')](this,_0x5e0ad6[_0x20c0('0x110')]);if(_0x20a651){_0x28ecfa=_0x20a651;}}this['createSquareDetailsReport'][_0x20c0('0x6a')](this,_0x5e0ad6,_0x49d65a);if(_0x5e0ad6[_0x20c0('0xe5')]['indexOf']('x')<0x0){_0x5e0ad6[_0x20c0('0xe5')]+='x';}if(_0x5e0ad6[_0x20c0('0xe5')][_0x20c0('0x177')]('X')<0x0){_0x5e0ad6[_0x20c0('0xe5')]+='X';}this[_0x20c0('0xc')][_0x20c0('0x9a')]('XMCS-QUEUE',_0x49d65a?_0x49d65a['toLowerCase']():'');var _0x236c45=this[_0x20c0('0xc')]['exec']('QUEUE',[_0x49d65a,_0x5e0ad6[_0x20c0('0xe5')],_0x5e0ad6[_0x20c0('0x5b')],_0x28ecfa,_0x5e0ad6[_0x20c0('0x5d')],_0x5e0ad6['agi'],_0x5e0ad6[_0x20c0('0x178')],_0x5e0ad6['gosub'],'',_0x5e0ad6[_0x20c0('0x179')]]);if(_0x236c45[_0x20c0('0xa6')]===-0x1){return _0x236c45;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('Executed\x20command\x20%s\x20%s','QUEUE',_0x49d65a));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x17a')]=function(_0x4867f9){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x17b'),_0x4867f9[_0x20c0('0x31')]));var _0x12d38a=_0x4867f9[_0x20c0('0x17c')]||_0x20c0('0x141');var _0x1794da=util['format'](_0x20c0('0x17d'),this['channel'][_0x20c0('0x30')],rs[_0x20c0('0x119')](0x5));var _0x41900a=util[_0x20c0('0x4a')](_0x20c0('0x17e'),FILES_PATH,_0x1794da,_0x12d38a);var _0x2805c3=util['format'](_0x20c0('0x136'),FILES_PATH,_0x1794da);this[_0x20c0('0x34')][_0x20c0('0x6a')](this,_0x4867f9,_0x1794da,_0x41900a);this['channel'][_0x20c0('0x9a')](_0x20c0('0x17f'),_0x1794da);logger[_0x20c0('0x27')](_0x20c0('0x180'),_0x2805c3,_0x12d38a,_0x4867f9[_0x20c0('0x181')],_0x4867f9[_0x20c0('0x5d')]);return this[_0x20c0('0xc')][_0x20c0('0x139')](_0x2805c3,_0x12d38a,_0x4867f9[_0x20c0('0x181')],_0x4867f9['timeout'],undefined,!![]);};AGIVertices[_0x20c0('0x16')]['restapi']=function(_0x344e17){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x344e17['label']));if(!this[_0x20c0('0x7f')](_0x344e17[_0x20c0('0x5b')])){return this['channel'][_0x20c0('0xa7')](_0x20c0('0x182'));}var _0x4a8813=this[_0x20c0('0x5a')]['sync'](this,_0x344e17);logger['info'](util[_0x20c0('0x4a')](_0x20c0('0x183'),util[_0x20c0('0x184')](_0x4a8813,{'showHidden':![],'depth':null})));if(!this[_0x20c0('0x7f')](_0x344e17[_0x20c0('0xd7')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x185'));}var _0x2ddfdf=this[_0x20c0('0x9d')][_0x20c0('0x6a')](this,_0x344e17['variable_id']);if(!_0x2ddfdf){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x344e17,_0x20c0('0xd9'));}this[_0x20c0('0xc')][_0x20c0('0x9a')](util[_0x20c0('0x4a')](_0x20c0('0x186'),_0x2ddfdf),_0x4a8813[_0x20c0('0x6f')]?_0x4a8813[_0x20c0('0x6f')]:'200');this['channel']['setVariable'](util[_0x20c0('0x4a')](_0x20c0('0x187'),_0x2ddfdf),_0x4a8813[_0x20c0('0x70')]?_0x4a8813[_0x20c0('0x70')]:'OK');if(_0x4a8813[_0x20c0('0x63')]){try{this[_0x20c0('0x98')](_0x4a8813[_0x20c0('0x63')],_0x2ddfdf);}catch(_0x253934){logger['error'](util[_0x20c0('0x4a')](_0x20c0('0x188'),_0x2ddfdf));}}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xde'),_0x2ddfdf));};AGIVertices[_0x20c0('0x16')]['saydigits']=function(_0x305bcf){logger['info'](util[_0x20c0('0x4a')](_0x20c0('0x189'),_0x305bcf['label']));return this[_0x20c0('0xc')][_0x20c0('0x18a')](_0x305bcf['digits']['replace'](/\s+/g,''),_0x305bcf[_0x20c0('0x181')]);};AGIVertices[_0x20c0('0x16')][_0x20c0('0x18b')]=function(_0x36f272){logger[_0x20c0('0x27')](util['format'](_0x20c0('0x18c'),_0x36f272['label']));return this[_0x20c0('0xc')][_0x20c0('0x18d')](_0x36f272[_0x20c0('0x5e')][_0x20c0('0x50')](/\s+/g,''),_0x36f272[_0x20c0('0x181')]);};AGIVertices[_0x20c0('0x16')][_0x20c0('0x18e')]=function(_0x3586f8){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x18f'),_0x3586f8[_0x20c0('0x31')]));return this[_0x20c0('0xc')]['sayPhonetic'](_0x3586f8[_0x20c0('0x54')],_0x3586f8['escape_digits']);};AGIVertices['prototype']['sendMail']=function(_0x579554){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x579554[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x579554[_0x20c0('0x190')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x191'));}var _0x5776a5=this[_0x20c0('0x1e')][_0x20c0('0x6a')](this,_0x579554[_0x20c0('0x190')]);if(!_0x5776a5||!_0x5776a5[_0x20c0('0x192')]){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x579554,_0x20c0('0x193'));}var _0x300925={'from':util[_0x20c0('0x4a')]('\x22%s\x22\x20<%s>',_0x5776a5[_0x20c0('0x11')],_0x5776a5[_0x20c0('0x194')]||_0x5776a5[_0x20c0('0x192')][_0x20c0('0x195')]),'to':_0x579554['to']||'','cc':_0x579554['cc']||'','bcc':_0x579554[_0x20c0('0x196')]||'','subject':_0x579554['subject'],'html':_0x579554['text'],'text':_0x579554[_0x20c0('0x54')]};if(this[_0x20c0('0x7f')](_0x579554[_0x20c0('0x197')])){}logger['debug'](_0x20c0('0x198'),JSON[_0x20c0('0x6d')](_0x300925));this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0x579554,_0x579554[_0x20c0('0x190')]);this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0x199'),_0x5776a5[_0x20c0('0x11')]));this[_0x20c0('0x20')]['sync'](this,_0x5776a5['smtpOptions'],_0x300925);return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x19a'));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x19b')]=function(_0x283200){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x19c'),_0x283200[_0x20c0('0x31')]));return this['channel'][_0x20c0('0xa7')](_0x20c0('0x19d'));};AGIVertices['prototype'][_0x20c0('0x19e')]=function(_0xd519c3){logger['info'](util[_0x20c0('0x4a')](_0x20c0('0x19f'),_0xd519c3[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0xd519c3['sms_account_id'])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x1a0'));}var _0x57b6c7=this[_0x20c0('0x2c')][_0x20c0('0x6a')](this,_0xd519c3[_0x20c0('0x1a1')]);if(!_0x57b6c7){return this[_0x20c0('0xc')]['error'](_0xd519c3,_0x20c0('0x1a2'));}var _0x117ae7={'body':_0xd519c3[_0x20c0('0x1a3')],'phone':_0xd519c3['to']||'','SmsAccountId':_0x57b6c7['id']};logger[_0x20c0('0xe0')](_0x20c0('0x1a4'),JSON[_0x20c0('0x6d')](_0x117ae7));this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0xd519c3,_0xd519c3[_0x20c0('0x1a1')]);this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x57b6c7[_0x20c0('0x11')]));this[_0x20c0('0x2e')][_0x20c0('0x6a')](this,_0x117ae7);return this[_0x20c0('0xc')][_0x20c0('0xa7')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x20c0('0x16')]['set']=function(_0x5f10e7){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x1a5'),_0x5f10e7[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x5f10e7[_0x20c0('0xd7')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x5f10e7,_0x20c0('0x1a6'));}var _0x44fdf8=this[_0x20c0('0x9d')][_0x20c0('0x6a')](this,_0x5f10e7[_0x20c0('0xd7')]);if(!_0x44fdf8){return this[_0x20c0('0xc')]['error'](_0x5f10e7,_0x20c0('0xd9'));}return this[_0x20c0('0xc')][_0x20c0('0x9a')](_0x44fdf8,_0x5f10e7[_0x20c0('0x1a7')]);};AGIVertices[_0x20c0('0x16')]['start']=function(_0x3acf09){logger['info'](util[_0x20c0('0x4a')]('Enter\x20in\x20START\x20(%s)\x20block',_0x3acf09[_0x20c0('0x31')]));this['channel'][_0x20c0('0xa7')](_0x20c0('0x1a8'));var _0x32e8ea=this[_0x20c0('0xc')]['getVariable'](_0x20c0('0x1a9'));if(!_[_0x20c0('0x3b')](_0x32e8ea[_0x20c0('0x9e')])){this[_0x20c0('0xc')][_0x20c0('0x30')]=_0x32e8ea[_0x20c0('0x9e')];}if(_0x3acf09[_0x20c0('0xb7')]===_0x20c0('0x1aa')){this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x1ab'));return this[_0x20c0('0xc')][_0x20c0('0xb7')]();}return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0x1ac'));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x1ad')]=function(_0x125957){logger[_0x20c0('0x27')](util['format'](_0x20c0('0x1ae'),_0x125957[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0x125957['project_id'])){return this['channel'][_0x20c0('0x26')](_0x125957,_0x20c0('0x1af'));}var _0x19b0c8=this[_0x20c0('0x14')]['sync'](this,_0x125957['project_id']);if(!this['isConfigured'](_0x19b0c8)){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x125957,util['format'](_0x20c0('0x1b0'),_0x125957['project_id']));}if(_0x19b0c8===this[_0x20c0('0xc')][_0x20c0('0x33')]){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x125957,_0x20c0('0x1b1'));}this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0x125957,_0x19b0c8);var _0x5492cc=this[_0x20c0('0xc')][_0x20c0('0xad')](_0x20c0('0x1b2'),util['format'](_0x20c0('0x1b3'),config[_0x20c0('0x7')]['host']||'127.0.0.1',_0x19b0c8,this[_0x20c0('0xc')][_0x20c0('0x33')]));if(_0x5492cc[_0x20c0('0xa6')]===-0x1){return _0x5492cc;}return this[_0x20c0('0xc')]['noop'](util[_0x20c0('0x4a')]('Executed\x20command\x20%s\x20%s','AGI',_0x19b0c8));};AGIVertices['prototype'][_0x20c0('0x1b4')]=function(_0x46ce47){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x46ce47['label']));var _0x1c6307=this['shellCommand'][_0x20c0('0x6a')](this,_0x46ce47[_0x20c0('0xb5')]);this[_0x20c0('0x2f')][_0x20c0('0x6a')](this,_0x46ce47,_0x46ce47[_0x20c0('0xb5')]);if(this[_0x20c0('0x7f')](_0x46ce47[_0x20c0('0xd7')])){var _0x41fc5e=this[_0x20c0('0x9d')]['sync'](this,_0x46ce47[_0x20c0('0xd7')]);if(_0x41fc5e){this[_0x20c0('0xc')]['setVariable'](_0x41fc5e,_0x1c6307);return this[_0x20c0('0xc')][_0x20c0('0xa7')](util['format'](_0x20c0('0x1b5'),_0x46ce47['command'],_0x41fc5e));}}return this['channel'][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x46ce47[_0x20c0('0xb5')]));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x1b6')]=function(_0x461470){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x1b7'),_0x461470[_0x20c0('0x31')]));_0x461470[_0x20c0('0x54')]=_0x461470[_0x20c0('0x54')][_0x20c0('0x50')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x20c0('0x7f')](_0x461470[_0x20c0('0x52')])){return this[_0x20c0('0xc')]['noop']('no\x20apiKey\x20configured');}if(!this[_0x20c0('0x7f')](_0x461470[_0x20c0('0x54')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')](_0x20c0('0xa4'));}this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x461470['text']));var _0x24e6d9=this[_0x20c0('0x51')]['sync'](this,_0x461470);if(_0x24e6d9){this[_0x20c0('0xc')]['noop'](util['format'](_0x20c0('0x1b8'),_0x24e6d9));var _0x1ce779=this[_0x20c0('0xc')]['streamFile'](_0x24e6d9);try{fs[_0x20c0('0x128')](_0x24e6d9+_0x20c0('0x103'));}catch(_0x24451f){logger[_0x20c0('0x26')](_0x24451f);}return _0x1ce779;}return this[_0x20c0('0xc')]['error'](_0x461470,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x20c0('0x16')][_0x20c0('0x1b9')]=function(_0x502e88){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x502e88['label']));_0x502e88[_0x20c0('0x54')]=_0x502e88[_0x20c0('0x54')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x20c0('0x7f')](_0x502e88[_0x20c0('0x54')])){return this[_0x20c0('0xc')][_0x20c0('0xa7')]('no\x20text\x20configured');}this[_0x20c0('0xc')]['noop'](util[_0x20c0('0x4a')](_0x20c0('0x1ba'),_0x502e88[_0x20c0('0x54')]));var _0x1bd7f3=this[_0x20c0('0x1bb')][_0x20c0('0x6a')](this,_0x502e88);if(_0x1bd7f3){this[_0x20c0('0xc')][_0x20c0('0xa7')](util['format'](_0x20c0('0x1bc'),_0x1bd7f3));var _0x22c00d=this[_0x20c0('0xc')][_0x20c0('0x102')](_0x1bd7f3);try{fs[_0x20c0('0x128')](_0x1bd7f3+_0x20c0('0x103'));}catch(_0x4f619b){logger[_0x20c0('0x26')](_0x4f619b);}return _0x22c00d;}return this[_0x20c0('0xc')][_0x20c0('0x26')](_0x502e88,_0x20c0('0x1bd'));};AGIVertices['prototype'][_0x20c0('0x1be')]=function(_0xa4a9e6){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x1bf'),_0xa4a9e6[_0x20c0('0x31')]));if(!this[_0x20c0('0x7f')](_0xa4a9e6[_0x20c0('0x15b')])){return this[_0x20c0('0xc')][_0x20c0('0x26')](_0xa4a9e6,_0x20c0('0x15c'));}logger['info'](util[_0x20c0('0x4a')](_0x20c0('0x162'),this['channel'][_0x20c0('0x35')],_0xa4a9e6[_0x20c0('0x15b')]));var _0x4a7787=this['agentUnpause'][_0x20c0('0x6a')](this,_0xa4a9e6[_0x20c0('0x15b')]);if(_0x4a7787){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x15d'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0xa4a9e6[_0x20c0('0x15b')]));this[_0x20c0('0xc')]['noop'](util['format'](_0x20c0('0x15d'),this['channel']['callerid'],_0xa4a9e6[_0x20c0('0x15b')]));return{'code':0xc8,'result':_0x20c0('0x15e')};}else{logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x15f'),this[_0x20c0('0xc')]['callerid'],_0xa4a9e6[_0x20c0('0x15b')]));this[_0x20c0('0xc')][_0x20c0('0xa7')](util['format'](_0x20c0('0x15f'),this[_0x20c0('0xc')][_0x20c0('0x35')],_0xa4a9e6[_0x20c0('0x15b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x20c0('0x16')]['voicemail']=function(_0x4cfd34){logger[_0x20c0('0x27')](util[_0x20c0('0x4a')](_0x20c0('0x1c0'),_0x4cfd34[_0x20c0('0x31')]));var _0x536c6e=this[_0x20c0('0xc')][_0x20c0('0xad')]('VOICEMAIL',[_0x4cfd34[_0x20c0('0x1c1')],_0x4cfd34[_0x20c0('0x71')]]);if(_0x536c6e[_0x20c0('0xa6')]===-0x1){return _0x536c6e;}return this[_0x20c0('0xc')][_0x20c0('0xa7')](util[_0x20c0('0x4a')](_0x20c0('0xc5'),_0x20c0('0x1c2'),_0x4cfd34['mailbox']));};AGIVertices[_0x20c0('0x16')][_0x20c0('0x1c3')]=function(_0x219600){logger[_0x20c0('0x27')](util['format'](_0x20c0('0x1c4'),_0x219600[_0x20c0('0x31')]));if(!this['isConfigured'](_0x219600[_0x20c0('0xd7')])){return this['channel'][_0x20c0('0x26')](_0x219600,_0x20c0('0x1a6'));}var _0x326bc5=this[_0x20c0('0x9d')][_0x20c0('0x6a')](this,_0x219600[_0x20c0('0xd7')]);if(!_0x326bc5){return this[_0x20c0('0xc')]['error'](_0x219600,'no\x20variable\x20found');}var _0x3fcf4c=this['channel'][_0x20c0('0x9d')](_0x326bc5);return{'code':0xc8,'result':_0x3fcf4c['extra']?_0x3fcf4c[_0x20c0('0x9e')]:'-'};};String['prototype'][_0x20c0('0x9c')]=function(_0x754cd3,_0x2552e5){return this[_0x20c0('0x9b')](_0x754cd3)['join'](_0x2552e5);};module[_0x20c0('0x1c5')]=AGIVertices; \ No newline at end of file +var _0x60c2=['no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','%s/recordings/%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','recordFile','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','%s_STATUS_CODE','200','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','email','user','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','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','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','name','catch','getVoiceQueue','then','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','getIntervalById','interval','map','Intervals','%s/sounds/converted/%s','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','priority','accountcode','dnid','file','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','format','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','audioEncoding','MP3','googleTTS','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','en-US','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','saveRestApiResult','%s.%s','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','scheduledAt','delay','add','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','odbc_id','no\x20database\x20selected','query','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','createSquareMessage','speech','out','Dialogflow\x20Result\x20%s','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','DIALOGFLOW_%s','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','phone','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','GOAL\x20%s','goalname','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','beep','TILDE_ASR_%s','gotoc','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block'];(function(_0x1cff61,_0x13199a){var _0x525309=function(_0x4bed18){while(--_0x4bed18){_0x1cff61['push'](_0x1cff61['shift']());}};_0x525309(++_0x13199a);}(_0x60c2,0x8f));var _0x260c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x60c2[_0xa464c9];return _0x3d73c4;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x260c('0x0'));var sh=require(_0x260c('0x1'));var odbc=require(_0x260c('0x2'))();var rs=require(_0x260c('0x3'));var moment=require(_0x260c('0x4'));var Mustache=require(_0x260c('0x5'));var rp=require(_0x260c('0x6'));var logger=require(_0x260c('0x7'))(_0x260c('0x8'));var config=require(_0x260c('0x9'));var scripts=require(_0x260c('0xa'));var FILES_PATH=_0x260c('0xb');var recursiveMapAttributes=['rawHeaders',_0x260c('0xc')];var verticesWithRetry=[_0x260c('0xd'),_0x260c('0xe'),_0x260c('0xf')];var AGIVertices=function(_0x4b2992,_0xb36958,_0x3cb2c9){this[_0x260c('0x10')]=_0x4b2992;this[_0x260c('0x11')]=_0xb36958;this[_0x260c('0x12')]=_0x3cb2c9;};AGIVertices[_0x260c('0x13')][_0x260c('0x14')]=function(_0x56773a,_0x2f4c2c){this[_0x260c('0x11')][_0x260c('0x15')](_0x56773a)['then'](function(_0xe6ebc){_0x2f4c2c(null,_0xe6ebc?_0xe6ebc[_0x260c('0x16')]:![]);})[_0x260c('0x17')](function(_0x5aed37){_0x2f4c2c(_0x5aed37);});};AGIVertices[_0x260c('0x13')][_0x260c('0x18')]=function(_0x43085e,_0x280270){this[_0x260c('0x11')]['getVoiceQueueById'](_0x43085e)[_0x260c('0x19')](function(_0x50ac44){_0x280270(null,_0x50ac44?_0x50ac44[_0x260c('0x16')]:![]);})[_0x260c('0x17')](function(_0x47edc1){_0x280270(_0x47edc1);});};AGIVertices[_0x260c('0x13')]['getSquareProject']=function(_0x1a9b2a,_0x27e864){this[_0x260c('0x11')][_0x260c('0x1a')](_0x1a9b2a)[_0x260c('0x19')](function(_0x1d109d){_0x27e864(null,_0x1d109d?_0x1d109d[_0x260c('0x16')]:![]);})[_0x260c('0x17')](function(_0x201e59){_0x27e864(_0x201e59);});};AGIVertices[_0x260c('0x13')][_0x260c('0x1b')]=function(_0x5a8a76,_0xd977b){this['rpc'][_0x260c('0x1c')](_0x5a8a76)[_0x260c('0x19')](function(_0x5317a8){_0xd977b(null,_0x5317a8?_0x5317a8[_0x260c('0x1d')]:![]);})[_0x260c('0x17')](function(_0x3cd55f){_0xd977b(_0x3cd55f);});};AGIVertices[_0x260c('0x13')][_0x260c('0x1e')]=function(_0x156f2b,_0x4b5b7a){this[_0x260c('0x11')][_0x260c('0x1f')](_0x156f2b)[_0x260c('0x19')](function(_0x1e7ea2){_0x4b5b7a(null,_0x1e7ea2?_0x1e7ea2['name']:![]);})[_0x260c('0x17')](function(_0x304961){_0x4b5b7a(_0x304961);});};AGIVertices[_0x260c('0x13')][_0x260c('0x20')]=function(_0x567963,_0x3b111a){this[_0x260c('0x11')][_0x260c('0x21')](_0x567963)[_0x260c('0x19')](function(_0x4cf0f9){_0x3b111a(null,_0x4cf0f9?_0x4cf0f9[_0x260c('0x16')]:![]);})[_0x260c('0x17')](function(_0x480179){_0x3b111a(_0x480179);});};AGIVertices['prototype'][_0x260c('0x22')]=function(_0x23df86,_0x43a894){var _0x21dc90=this;this[_0x260c('0x11')][_0x260c('0x23')](_0x23df86)['then'](function(_0xf1ad3e){_0x43a894(null,_0xf1ad3e?_0x21dc90[_0x260c('0x24')](_0xf1ad3e[_0x260c('0x25')]):![]);})[_0x260c('0x17')](function(_0x5993fd){_0x43a894(_0x5993fd);});};AGIVertices[_0x260c('0x13')][_0x260c('0x26')]=function(_0x523021,_0x3c505b){this[_0x260c('0x11')][_0x260c('0x27')](_0x523021)[_0x260c('0x19')](function(_0x414580){_0x3c505b(null,_0x414580?_0x414580:![]);})[_0x260c('0x17')](function(_0x32ca78){_0x3c505b(_0x32ca78);});};AGIVertices[_0x260c('0x13')]['sendMailMessage']=function(_0xce5919,_0x2dccb3,_0x5ebf4c){this[_0x260c('0x12')]['sendMailMessage'](_0xce5919,_0x2dccb3)['then'](function(){_0x5ebf4c(null);})['catch'](function(_0x1fd8aa){_0x5ebf4c(_0x1fd8aa);});};AGIVertices[_0x260c('0x13')]['getIntervals']=function(_0x329279,_0x2b3cd9){this[_0x260c('0x11')][_0x260c('0x28')](_0x329279)[_0x260c('0x19')](function(_0x141bb2){if(_0x141bb2){if(_0x141bb2['IntervalId']){_0x2b3cd9(null,[_0x141bb2[_0x260c('0x29')]]);}else{_0x2b3cd9(null,_[_0x260c('0x2a')](_0x141bb2[_0x260c('0x2b')],_0x260c('0x29')));}}else{_0x2b3cd9(null,![]);}})[_0x260c('0x17')](function(_0x220738){_0x2b3cd9(_0x220738);});};AGIVertices[_0x260c('0x13')][_0x260c('0x24')]=function(_0x41cc6e){return util['format'](_0x260c('0x2c'),FILES_PATH,_0x41cc6e);};AGIVertices['prototype']['getQueryOdbc']=function(_0x5287ee,_0x5d4e6f,_0x4e2c9f){odbc['open'](_0x5287ee,function(_0x4d54d4){if(_0x4d54d4){logger[_0x260c('0x2d')](_0x260c('0x2e'),_0x4d54d4);_0x4e2c9f(_0x4d54d4);}else{logger[_0x260c('0x2f')](_0x260c('0x30'));odbc['query'](_0x5d4e6f,function(_0x44266b,_0x401e1f){if(_0x44266b){logger['info'](_0x260c('0x31'),_0x5d4e6f);_0x4e2c9f(_0x44266b);}else{logger[_0x260c('0x2f')](_0x260c('0x32'),_0x5d4e6f);odbc[_0x260c('0x33')](function(_0x3588b1){if(_0x3588b1){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x3588b1);}_0x4e2c9f(null,_0x401e1f);});}});}});};AGIVertices[_0x260c('0x13')][_0x260c('0x34')]=function(_0x1de711,_0xf04cf1){this['rpc'][_0x260c('0x35')](_0x1de711)[_0x260c('0x19')](function(_0x265bd8){_0xf04cf1(null,_0x265bd8?_0x265bd8:![]);})[_0x260c('0x17')](function(_0x2330df){_0xf04cf1(_0x2330df);});};AGIVertices[_0x260c('0x13')][_0x260c('0x36')]=function(_0x118dfa,_0xff6d4d){this[_0x260c('0x11')][_0x260c('0x36')](_0x118dfa)[_0x260c('0x19')](function(_0x1e1ef9){_0xff6d4d(null,_0x1e1ef9);})['catch'](function(_0x50d427){_0xff6d4d(_0x50d427);});};AGIVertices[_0x260c('0x13')][_0x260c('0x37')]=function(_0xccd9c1,_0x50ed87,_0x23069e){this['rpc']['createSquareDetailsReport']({'uniqueid':this[_0x260c('0x10')]['uniqueid'],'node':_0xccd9c1[_0x260c('0x38')],'application':_0xccd9c1[_0x260c('0x39')],'data':_0x50ed87||null,'project_name':this[_0x260c('0x10')][_0x260c('0x3a')],'callerid':this['channel'][_0x260c('0x3b')]})[_0x260c('0x19')](function(_0x4a8360){if(_0x23069e){_0x23069e(null,_0x4a8360);}})[_0x260c('0x17')](function(_0x549cbe){if(_0x23069e){_0x23069e(_0x549cbe);}});};AGIVertices[_0x260c('0x13')][_0x260c('0x3c')]=function(_0x27259b,_0x5f40a7,_0x16d233,_0x1a2a04){this[_0x260c('0x11')][_0x260c('0x3c')]({'uniqueid':this[_0x260c('0x10')][_0x260c('0x3d')],'callerid':this[_0x260c('0x10')][_0x260c('0x3b')],'calleridname':this[_0x260c('0x10')][_0x260c('0x3e')],'context':this[_0x260c('0x10')][_0x260c('0x3f')],'extension':this['channel']['extension'],'priority':this[_0x260c('0x10')][_0x260c('0x40')],'accountcode':this[_0x260c('0x10')][_0x260c('0x41')],'dnid':this['channel'][_0x260c('0x42')],'projectName':this[_0x260c('0x10')][_0x260c('0x3a')],'saveName':_0x5f40a7,'filename':_0x27259b[_0x260c('0x43')]||_0x5f40a7,'savePath':_0x16d233})[_0x260c('0x19')](function(_0x1d0890){_0x1a2a04(null,_0x1d0890);})[_0x260c('0x17')](function(_0x46c85a){_0x1a2a04(_0x46c85a);});};AGIVertices[_0x260c('0x13')]['createSquareMessage']=function(_0x3b00d0,_0x9ef48e,_0x5b6407,_0xcaaa34,_0x4aa1e3){this[_0x260c('0x11')]['createSquareMessage']({'uniqueid':this['channel'][_0x260c('0x3d')],'body':_0x3b00d0,'direction':_0x9ef48e,'providerName':_0x5b6407,'providerResponse':_0xcaaa34})[_0x260c('0x19')](function(_0x300bb2){if(_0x4aa1e3){_0x4aa1e3(null,_0x300bb2);}})[_0x260c('0x17')](function(_0x6ec3dd){if(_0x4aa1e3){_0x4aa1e3(_0x6ec3dd);}});};AGIVertices[_0x260c('0x13')][_0x260c('0x44')]=function(_0x55c6a2,_0x12fbe5){this['rpc'][_0x260c('0x44')]({'firstName':_[_0x260c('0x45')](_0x55c6a2[_0x260c('0x16')])||_[_0x260c('0x46')](_0x55c6a2[_0x260c('0x16')])?_0x260c('0x47')+Math[_0x260c('0x48')]():_0x55c6a2[_0x260c('0x16')],'lastName':_['isEmpty'](_0x55c6a2[_0x260c('0x49')])||_[_0x260c('0x46')](_0x55c6a2[_0x260c('0x49')])?null:_0x55c6a2[_0x260c('0x49')],'phone':_0x55c6a2['phone'],'ListId':_0x55c6a2[_0x260c('0x4a')],'scheduledat':_0x55c6a2['scheduledAt'],'callbackUniqueid':this[_0x260c('0x10')]['uniqueid'],'tags':'callback','description':_0x260c('0x4b')+_0x55c6a2['scheduledAt'][_0x260c('0x4c')](),'priority':_0x55c6a2['callback_priority']})[_0x260c('0x19')](function(_0x6a00dc){_0x12fbe5(null,_0x6a00dc);})[_0x260c('0x17')](function(_0x1bed1f){_0x12fbe5(_0x1bed1f);});};AGIVertices[_0x260c('0x13')][_0x260c('0x4d')]=function(_0x16e5f5,_0xaa0c9d){this[_0x260c('0x11')][_0x260c('0x4e')](_0x16e5f5)['then'](function(_0x5c23e9){_0xaa0c9d(null,_0x5c23e9?_0x5c23e9['name']:![]);})['catch'](function(_0x14769f){_0xaa0c9d(_0x14769f);});};AGIVertices[_0x260c('0x13')][_0x260c('0x4f')]=function(_0x3d7e49,_0x2291f0,_0x5929b0){var _0x411010={'role':'agent'};_0x411010[_0x3d7e49]=this[_0x260c('0x10')][_0x260c('0x3b')];this['rpc'][_0x260c('0x4f')](_0x411010,_0x2291f0,this[_0x260c('0x10')][_0x260c('0x3d')])[_0x260c('0x19')](function(_0x3d8d69){_0x5929b0(null,_[_0x260c('0x46')](_0x3d8d69)?![]:!![]);})[_0x260c('0x17')](function(_0x175e96){logger[_0x260c('0x2d')](_0x175e96);_0x5929b0(null,![]);});};AGIVertices['prototype'][_0x260c('0x50')]=function(_0x597980,_0x2d9c8a){var _0x2ee3da={'role':_0x260c('0x51')};_0x2ee3da[_0x597980]=this[_0x260c('0x10')][_0x260c('0x3b')];this[_0x260c('0x11')][_0x260c('0x50')](_0x2ee3da)[_0x260c('0x19')](function(_0x4b0245){_0x2d9c8a(null,_['isNil'](_0x4b0245)?![]:!![]);})['catch'](function(_0x2452fb){logger[_0x260c('0x2d')](_0x2452fb);_0x2d9c8a(null,![]);});};AGIVertices[_0x260c('0x13')][_0x260c('0x52')]=function(_0x3882b6,_0x4ccfee){var _0x5c1952={'role':_0x260c('0x51')};_0x5c1952[_0x3882b6]=this[_0x260c('0x10')][_0x260c('0x3b')];this[_0x260c('0x11')][_0x260c('0x52')](_0x5c1952)[_0x260c('0x19')](function(_0x4fd983){_0x4ccfee(null,_[_0x260c('0x46')](_0x4fd983)?![]:!![]);})['catch'](function(_0x39ae12){logger[_0x260c('0x2d')](_0x39ae12);_0x4ccfee(null,![]);});};AGIVertices[_0x260c('0x13')][_0x260c('0x53')]=function(_0x334af3,_0xaa0322){var _0x3f5636={'role':_0x260c('0x51')};_0x3f5636[_0x334af3]=this[_0x260c('0x10')][_0x260c('0x3b')];var _0x300781=_0x334af3!='internal'?util[_0x260c('0x54')](_0x260c('0x55'),_0x260c('0x56'),this[_0x260c('0x10')][_0x260c('0x3b')]):undefined;this[_0x260c('0x11')][_0x260c('0x53')](_0x3f5636,_0x300781)[_0x260c('0x19')](function(_0x16c53a){_0xaa0322(null,_[_0x260c('0x46')](_0x16c53a)?![]:!![]);})[_0x260c('0x17')](function(_0x3acc89){logger['error'](_0x3acc89);_0xaa0322(null,![]);});};AGIVertices[_0x260c('0x13')][_0x260c('0x57')]=function(_0x4b9321,_0x36f4ef){sh[_0x260c('0x58')](_['trim'](_0x4b9321),function(_0x35b3e3,_0x257c75){var _0x497e92=_0x257c75[_0x260c('0x59')](/(\r\n|\n|\r)/gm,'');_0x36f4ef(null,_0x497e92);});};AGIVertices[_0x260c('0x13')][_0x260c('0x5a')]=function(_0x5b6929,_0x535ae3){scripts[_0x260c('0x5a')](_0x5b6929[_0x260c('0x5b')],_0x5b6929[_0x260c('0x5c')]||'text',_0x5b6929[_0x260c('0x5d')],_0x5b6929[_0x260c('0x5e')]||'en-US',_0x5b6929[_0x260c('0x5f')]||'MALE',_0x5b6929[_0x260c('0x60')]||_0x260c('0x61'))[_0x260c('0x19')](function(_0x16d196){_0x535ae3(null,_0x16d196);})['catch'](function(_0x40038a){_0x535ae3(_0x40038a);});};AGIVertices[_0x260c('0x13')][_0x260c('0x62')]=function(_0x555fab,_0x443184){scripts[_0x260c('0x62')](_0x555fab[_0x260c('0x5d')],_0x555fab['google_tts_language']||'en',0x1)[_0x260c('0x19')](function(_0x1d8b8f){_0x443184(null,_0x1d8b8f);})['catch'](function(_0xe465b7){_0x443184(_0xe465b7);});};AGIVertices[_0x260c('0x13')][_0x260c('0x63')]=function(_0x5ae38c,_0x3f376e){var _0x124ea2={'uri':_0x5ae38c[_0x260c('0x64')],'method':_0x5ae38c[_0x260c('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5ae38c[_0x260c('0x66')])===_0x260c('0x67')&&parseInt(_0x5ae38c[_0x260c('0x66')])>=0x1?parseInt(_0x5ae38c[_0x260c('0x66')])*0x3e8:0x5*0x3e8};if(_[_0x260c('0x68')]([_0x260c('0x69'),_0x260c('0x6a')],_0x124ea2['method'][_0x260c('0x6b')]())){try{_0x124ea2[_0x260c('0x6c')]=_0x5ae38c[_0x260c('0xc')]?JSON[_0x260c('0x6d')](_0x5ae38c['rawBody']):{};}catch(_0x2d041a){logger[_0x260c('0x2d')](_0x260c('0x6e'),_0x2d041a);}}try{_0x124ea2[_0x260c('0x6f')]=_0x5ae38c[_0x260c('0x70')]?JSON[_0x260c('0x6d')](_0x5ae38c['rawHeaders']):{};}catch(_0x49eb5e){logger['error'](_0x260c('0x71'),_0x49eb5e);}if(_0x5ae38c['computedVariables']){try{var _0x4314c8=require(_0x5ae38c[_0x260c('0x72')])[_0x260c('0x73')](this,_0x124ea2);_0x124ea2[_0x260c('0x74')]=Mustache[_0x260c('0x75')](_0x5ae38c['url'],_0x4314c8,{},['$$','$$']);if(_0x124ea2[_0x260c('0x6f')]){_0x124ea2[_0x260c('0x6f')]=JSON[_0x260c('0x6d')](Mustache[_0x260c('0x75')](JSON[_0x260c('0x76')](_0x124ea2['headers']),_0x4314c8,{},['$$','$$']));}if(_0x124ea2['body']){_0x124ea2[_0x260c('0x6c')]=JSON['parse'](Mustache[_0x260c('0x75')](JSON[_0x260c('0x76')](_0x124ea2['body']),_0x4314c8,{},['$$','$$']));}}catch(_0x2a069b){logger[_0x260c('0x2d')](_0x260c('0x77'),_0x2a069b);}}rp(_0x124ea2)[_0x260c('0x19')](function(_0x3d4612){var _0x305c3f={'statusCode':_0x3d4612[_0x260c('0x78')]||0xc8,'statusMessage':_0x3d4612[_0x260c('0x79')]||'OK','headers':_0x3d4612[_0x260c('0x6f')]||{},'body':_0x3d4612['body']||{}};_0x3f376e(null,_0x305c3f);})[_0x260c('0x17')](function(_0x4a9ec8){var _0x1c1df4={'statusCode':_0x4a9ec8[_0x260c('0x78')]||0x1f4,'statusMessage':_0x4a9ec8['message']||_0x260c('0x7a'),'headers':_0x4a9ec8[_0x260c('0x7b')][_0x260c('0x6f')]||{},'body':_0x4a9ec8[_0x260c('0x7b')][_0x260c('0x6c')]||{}};_0x3f376e(null,_0x1c1df4);});};AGIVertices[_0x260c('0x13')][_0x260c('0x7c')]=function(_0x11823c,_0x3b7188){scripts[_0x260c('0x7c')](this['channel'][_0x260c('0x3d')],_0x11823c[_0x260c('0x7d')],_0x11823c[_0x260c('0x5d')],_0x11823c[_0x260c('0x7e')]||'en')['then'](function(_0x40fecd){_0x3b7188(null,_0x40fecd);})['catch'](function(_0x16d3d2){_0x3b7188(_0x16d3d2);});};AGIVertices[_0x260c('0x13')][_0x260c('0x7f')]=function(_0x4b2dcc,_0x29a535){scripts[_0x260c('0x7f')](this[_0x260c('0x10')][_0x260c('0x3d')],_0x4b2dcc[_0x260c('0x80')],_0x4b2dcc['client_email'],_0x4b2dcc['private_key'],_0x4b2dcc['text'],_0x4b2dcc[_0x260c('0x81')]||'en')[_0x260c('0x19')](function(_0x4f262e){_0x29a535(null,_0x4f262e);})[_0x260c('0x17')](function(_0x123c5e){_0x29a535(_0x123c5e);});};AGIVertices[_0x260c('0x13')][_0x260c('0x82')]=function(_0x4412cf,_0x482f4e){scripts[_0x260c('0x82')](this[_0x260c('0x10')],_0x4412cf)[_0x260c('0x19')](function(_0xe738d){_0x482f4e(null,_0xe738d);})[_0x260c('0x17')](function(_0x5a4917){_0x482f4e(_0x5a4917);});};AGIVertices['prototype']['ispeechTTS']=function(_0x2ae7e2,_0x460797){scripts[_0x260c('0x83')](_0x2ae7e2['key'],_0x2ae7e2[_0x260c('0x5d')],_0x2ae7e2[_0x260c('0x84')]||'en-US',_0x2ae7e2[_0x260c('0x85')])[_0x260c('0x19')](function(_0x506a40){_0x460797(null,_0x506a40);})['catch'](function(_0x2c5f4d){_0x460797(_0x2c5f4d);});};AGIVertices[_0x260c('0x13')][_0x260c('0x86')]=function(_0x3e323d,_0x341a5d,_0x4fee88){scripts[_0x260c('0x86')](_0x341a5d,_0x3e323d['key'],_0x3e323d[_0x260c('0x87')]||_0x260c('0x88'),this[_0x260c('0x89')](_0x3e323d[_0x260c('0x8a')])?_0x3e323d[_0x260c('0x8a')]:undefined)[_0x260c('0x19')](function(_0x348fed){_0x4fee88(null,_0x348fed);})[_0x260c('0x17')](function(_0x45828f){_0x4fee88(_0x45828f);});};AGIVertices[_0x260c('0x13')]['awsPolly']=function(_0x4774cb,_0x26cf7d){scripts[_0x260c('0x8b')](_0x4774cb['aws_access_key_id'],_0x4774cb[_0x260c('0x8c')],_0x4774cb[_0x260c('0x8d')],_0x4774cb['aws_polly_voice']||_0x260c('0x8e'),_0x4774cb[_0x260c('0x5d')],_0x4774cb[_0x260c('0x8f')]||_0x260c('0x5d'))[_0x260c('0x19')](function(_0x2c8dd5){_0x26cf7d(null,_0x2c8dd5);})['catch'](function(_0x5d2019){_0x26cf7d(_0x5d2019);});};AGIVertices[_0x260c('0x13')]['awsLex']=function(_0x278acb,_0x438884){scripts[_0x260c('0x90')](this[_0x260c('0x10')][_0x260c('0x3d')],_0x278acb[_0x260c('0x91')],_0x278acb[_0x260c('0x8c')],_0x278acb[_0x260c('0x92')],_0x278acb[_0x260c('0x5d')],_0x278acb[_0x260c('0x93')])[_0x260c('0x19')](function(_0x16c1d2){_0x438884(null,_0x16c1d2);})[_0x260c('0x17')](function(_0x497015){_0x438884(_0x497015);});};AGIVertices[_0x260c('0x13')][_0x260c('0x94')]=function(_0x45439e,_0x1f5369,_0x12231a){scripts[_0x260c('0x94')](_0x1f5369,_0x45439e[_0x260c('0x7d')],_0x45439e['google_asr_language']||_0x260c('0x88'))[_0x260c('0x19')](function(_0x3e3943){_0x12231a(null,_0x3e3943);})[_0x260c('0x17')](function(_0xcba02f){_0x12231a(_0xcba02f);});};AGIVertices[_0x260c('0x13')]['tildeASR']=function(_0x2b332f,_0x102b25,_0x35eca7){scripts[_0x260c('0x95')](_0x102b25,_0x2b332f[_0x260c('0x96')],_0x2b332f[_0x260c('0x97')],_0x2b332f[_0x260c('0x74')])[_0x260c('0x19')](function(_0x56c6f7){_0x35eca7(null,_0x56c6f7);})[_0x260c('0x17')](function(_0x36e533){_0x35eca7(_0x36e533);});};AGIVertices[_0x260c('0x13')][_0x260c('0x98')]=function(_0x1cd837){var _0x5ad6e2=_[_0x260c('0x68')](verticesWithRetry,_0x1cd837[_0x260c('0x39')])?_0x1cd837:_['clone'](_0x1cd837);for(var _0x30fe31 in _0x5ad6e2){if(_0x5ad6e2[_0x260c('0x99')](_0x30fe31)){if(_0x5ad6e2[_0x30fe31]&&_['isString'](_0x5ad6e2[_0x30fe31])){if(_[_0x260c('0x68')](recursiveMapAttributes,_0x30fe31)){_0x5ad6e2[_0x30fe31]=this[_0x260c('0x9a')](_0x5ad6e2[_0x30fe31]);}else{_0x5ad6e2[_0x30fe31]=this[_0x260c('0x9b')](_0x5ad6e2[_0x30fe31]);}}}}return _0x5ad6e2;};AGIVertices[_0x260c('0x13')][_0x260c('0x9c')]=function(_0x2f7f08){for(var _0x116435 in _0x2f7f08){if(_0x2f7f08[_0x260c('0x99')](_0x116435)){if(_[_0x260c('0x9d')](_0x2f7f08[_0x116435])){this[_0x260c('0x9c')](_0x2f7f08[_0x116435]);}else if(_[_0x260c('0x9e')](_0x2f7f08[_0x116435])){for(var _0x2d7a55=0x0;_0x2d7a55<_0x2f7f08[_0x116435][_0x260c('0x9f')];_0x2d7a55++){this[_0x260c('0x9c')](_0x2f7f08[_0x116435][_0x2d7a55]);}}else if(_[_0x260c('0xa0')](_0x2f7f08[_0x116435])){_0x2f7f08[_0x116435]=this[_0x260c('0x9b')](_0x2f7f08[_0x116435]);}}}};AGIVertices[_0x260c('0x13')]['saveRestApiResult']=function(_0x241093,_0x4351c9){for(var _0x26104b in _0x241093){if(_0x241093['hasOwnProperty'](_0x26104b)){if(_['isPlainObject'](_0x241093[_0x26104b])){if(!_['isEmpty'](_0x241093[_0x26104b])){this[_0x260c('0xa1')](_0x241093[_0x26104b],util[_0x260c('0x54')](_0x260c('0xa2'),_0x4351c9,_0x26104b));}}else if(_[_0x260c('0x9e')](_0x241093[_0x26104b])){for(var _0x260f03=0x0;_0x260f03<_0x241093[_0x26104b][_0x260c('0x9f')];_0x260f03++){this[_0x260c('0xa1')](_0x241093[_0x26104b][_0x260f03],util[_0x260c('0x54')]('%s.%s',_0x4351c9,_0x26104b+'['+_0x260f03+']'));}}else{if(!_[_0x260c('0x46')](_0x241093[_0x26104b])){this[_0x260c('0x10')]['setVariable'](util[_0x260c('0x54')](_0x260c('0xa2'),_0x4351c9,_0x26104b),_0x241093[_0x26104b]);}}}}};AGIVertices[_0x260c('0x13')]['replaceObjectAllVariables']=function(_0x1e19fc){try{var _0xe93441=JSON['parse'](_0x1e19fc);this[_0x260c('0x9c')](_0xe93441);return JSON['stringify'](_0xe93441);}catch(_0x10e190){return this[_0x260c('0x9b')](_0x1e19fc);}};AGIVertices[_0x260c('0x13')][_0x260c('0x9b')]=function(_0x551f15){var _0x29a70a=_0x551f15[_0x260c('0xa3')]('{');for(var _0x162a99=0x1;_0x162a99<_0x29a70a['length'];_0x162a99+=0x1){var _0x161448=_0x29a70a[_0x162a99][_0x260c('0xa3')]('}');if(_0x161448[_0x260c('0x9f')]>0x1){_0x551f15=_0x551f15[_0x260c('0xa4')]('{'+_0x161448[0x0]+'}',this[_0x260c('0x10')][_0x260c('0x14')](_0x161448[0x0])[_0x260c('0xa5')]||_0x161448[0x0]);}}if(_0x29a70a[_0x260c('0x9f')]===0x1){return _0x551f15[_0x260c('0x4c')]();}return this[_0x260c('0x9b')](_0x551f15);};AGIVertices['prototype'][_0x260c('0xa6')]=function(_0x35c59c,_0x3475e8){var _0x382274=this['channel']['getVariable'](_0x35c59c);if(_0x382274[_0x260c('0xa7')]===-0x1){return _0x382274;}logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0xa8'),_0x3475e8,_0x382274[_0x260c('0xa5')]));return this[_0x260c('0x10')][_0x260c('0xa9')](_0x3475e8,_0x382274['extra']);};AGIVertices[_0x260c('0x13')][_0x260c('0x89')]=function(_0x1ae7e0){return _0x1ae7e0&&_0x1ae7e0!=='0'&&_0x1ae7e0!=='-1'&&_0x1ae7e0!=='';};AGIVertices['prototype']['maxRetry']=function(_0x266424){this['createSquareDetailsReport']['sync'](this,_0x266424,'-');_0x266424['retry']=_0x266424[_0x260c('0xaa')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x260c('0xab')]=function(_0xf23da6){logger[_0x260c('0x2f')](util[_0x260c('0x54')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0xf23da6['label']));if(!this[_0x260c('0x89')](_0xf23da6['text'])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0xad'));}var _0xcc7cec='\x22'+_0xf23da6[_0x260c('0x5d')]+'\x22';if(this[_0x260c('0x89')](_0xf23da6[_0x260c('0x7b')])){_0xcc7cec+=','+_0xf23da6[_0x260c('0x7b')];}var _0x34b2a7=this['channel']['exec'](_0x260c('0xae'),_0xcc7cec);if(_0x34b2a7[_0x260c('0xa7')]===-0x1){return _0x34b2a7;}return this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')]('Executed\x20command\x20MRCPSynth\x20%s',_0xcc7cec));};AGIVertices[_0x260c('0x13')]['mrcprecog']=function(_0x53b5b6){logger[_0x260c('0x2f')](util[_0x260c('0x54')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x53b5b6[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x53b5b6[_0x260c('0xaf')])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0xb0'));}var _0x2a33ea=_0x53b5b6['grammar'];if(this[_0x260c('0x89')](_0x53b5b6[_0x260c('0x7b')])){_0x2a33ea+=','+_0x53b5b6[_0x260c('0x7b')];}var _0x3c80a1=this['channel'][_0x260c('0x58')]('MRCPRecog',_0x2a33ea);if(_0x3c80a1['result']===-0x1){return _0x3c80a1;}var _0x295c96=this[_0x260c('0xa6')](_0x260c('0xb1'),'MRCP_RECOG_CONFIDENCE');if(_0x295c96[_0x260c('0xa7')]===-0x1){return _0x295c96;}var _0x255819=this[_0x260c('0xa6')]('RECOG_INPUT()',_0x260c('0xb2'));if(_0x255819[_0x260c('0xa7')]===-0x1){return _0x255819;}var _0x17447d=this['getAndSetVariable'](_0x260c('0xb3'),'MRCP_RECOG_INSTANCE');if(_0x17447d[_0x260c('0xa7')]===-0x1){return _0x17447d;}return this['channel'][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0xb4'),_0x2a33ea));};AGIVertices[_0x260c('0x13')][_0x260c('0x8')]=function(_0x5d879e){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0xb5'),_0x5d879e['label']));return this['channel']['agi']([_0x5d879e['command'],_0x5d879e[_0x260c('0xb6')]]);};AGIVertices[_0x260c('0x13')]['answer']=function(_0x4b9562){logger[_0x260c('0x2f')](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x4b9562['label']));if(this[_0x260c('0x89')](_0x4b9562[_0x260c('0x66')])){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0xb7'),_0x4b9562[_0x260c('0x66')]));var _0x4bc58a=this['channel'][_0x260c('0xb8')](_0x4b9562[_0x260c('0x66')]);if(_0x4bc58a[_0x260c('0xa7')]===-0x1){return _0x4bc58a;}}return this['channel'][_0x260c('0xb9')]();};AGIVertices[_0x260c('0x13')][_0x260c('0xba')]=function(_0x1e48e0){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0xbb'),_0x1e48e0['label']));if(!this[_0x260c('0x89')](_0x1e48e0[_0x260c('0x4a')])){return this['channel'][_0x260c('0x2d')](_0x1e48e0,_0x260c('0xbc'));}_0x1e48e0[_0x260c('0xbd')]=moment();if(this['isConfigured'](_0x1e48e0[_0x260c('0xbe')])){_0x1e48e0[_0x260c('0xbd')]=moment()[_0x260c('0xbf')](_0x1e48e0['delay'],'minutes');}if(!this[_0x260c('0x89')](_0x1e48e0[_0x260c('0xc0')])){_0x1e48e0[_0x260c('0xc0')]=0x2;}this['createCmContact'][_0x260c('0x73')](this,_0x1e48e0);return this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0xc1'),_0x1e48e0['phone'],_0x1e48e0[_0x260c('0x4a')],_0x1e48e0[_0x260c('0xbd')]));};AGIVertices['prototype'][_0x260c('0xc2')]=function(_0x283125){logger[_0x260c('0x2f')](util['format'](_0x260c('0xc3'),_0x283125[_0x260c('0x38')]));var _0x12dd6c=this['channel'][_0x260c('0x58')](_0x283125[_0x260c('0xc4')],_0x283125[_0x260c('0x7b')]);if(_0x12dd6c[_0x260c('0xa7')]===-0x1){return _0x12dd6c;}return this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')]('Executed\x20command\x20%s\x20%s',_0x283125[_0x260c('0xc4')],_0x283125['options']));};AGIVertices['prototype']['lumenvoxtts']=function(_0x250243){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0xc5'),_0x250243[_0x260c('0x38')]));if(!this['isConfigured'](_0x250243[_0x260c('0x5d')])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0xad'));}var _0x80699a='\x22'+_0x250243['text']+'\x22';if(this[_0x260c('0x89')](_0x250243['options'])){_0x80699a+=','+_0x250243['options'];}var _0x35a275=this['channel']['exec']('MRCPSynth',_0x80699a);if(_0x35a275[_0x260c('0xa7')]===-0x1){return _0x35a275;}return this[_0x260c('0x10')][_0x260c('0xac')](util['format'](_0x260c('0xc6'),_0x80699a));};AGIVertices[_0x260c('0x13')]['sestektts']=function(_0x5a0b64){logger[_0x260c('0x2f')](util[_0x260c('0x54')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5a0b64['label']));if(!this[_0x260c('0x89')](_0x5a0b64['text'])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0xad'));}var _0x225a76='\x22'+_0x5a0b64[_0x260c('0x5d')]+'\x22';if(this[_0x260c('0x89')](_0x5a0b64['options'])){_0x225a76+=','+_0x5a0b64[_0x260c('0x7b')];}var _0x53daf2=this[_0x260c('0x10')]['exec'](_0x260c('0xae'),_0x225a76);if(_0x53daf2[_0x260c('0xa7')]===-0x1){return _0x53daf2;}return this['channel'][_0x260c('0xac')](util[_0x260c('0x54')]('Executed\x20command\x20MRCPSynth\x20%s',_0x225a76));};AGIVertices['prototype'][_0x260c('0xc7')]=function(_0x2a53cb){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0xc8'),_0x2a53cb[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x2a53cb[_0x260c('0xaf')])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0xb0'));}var _0xf134c5=_0x2a53cb[_0x260c('0xaf')];if(this['isConfigured'](_0x2a53cb['options'])){_0xf134c5+=','+_0x2a53cb['options'];}var _0x50df6d=this['channel'][_0x260c('0x58')](_0x260c('0xc9'),_0xf134c5);if(_0x50df6d[_0x260c('0xa7')]===-0x1){return _0x50df6d;}var _0x1cb538=this[_0x260c('0xa6')](_0x260c('0xb1'),_0x260c('0xca'));if(_0x1cb538[_0x260c('0xa7')]===-0x1){return _0x1cb538;}var _0x47bc49=this[_0x260c('0xa6')](_0x260c('0xcb'),_0x260c('0xcc'));if(_0x47bc49[_0x260c('0xa7')]===-0x1){return _0x47bc49;}var _0x57db21=this[_0x260c('0xa6')](_0x260c('0xb3'),_0x260c('0xcd'));if(_0x57db21[_0x260c('0xa7')]===-0x1){return _0x57db21;}return this['channel'][_0x260c('0xac')](util[_0x260c('0x54')]('Executed\x20command\x20MRCPRecog\x20%s',_0xf134c5));};AGIVertices[_0x260c('0x13')]['sestekasr']=function(_0x5860c4){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0xce'),_0x5860c4[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x5860c4[_0x260c('0xaf')])){return this['channel'][_0x260c('0xac')](_0x260c('0xb0'));}var _0x200a45=_0x5860c4[_0x260c('0xaf')];if(this[_0x260c('0x89')](_0x5860c4['options'])){_0x200a45+=','+_0x5860c4[_0x260c('0x7b')];}var _0x37b43c=this['channel'][_0x260c('0x58')](_0x260c('0xc9'),_0x200a45);if(_0x37b43c[_0x260c('0xa7')]===-0x1){return _0x37b43c;}var _0x5dd081=this[_0x260c('0xa6')]('RECOG_CONFIDENCE()',_0x260c('0xcf'));if(_0x5dd081[_0x260c('0xa7')]===-0x1){return _0x5dd081;}var _0x2b4310=this[_0x260c('0xa6')](_0x260c('0xcb'),_0x260c('0xd0'));if(_0x2b4310[_0x260c('0xa7')]===-0x1){return _0x2b4310;}var _0x102602=this['getAndSetVariable'](_0x260c('0xb3'),'SESTEK_ASR_INSTANCE');if(_0x102602['result']===-0x1){return _0x102602;}return this[_0x260c('0x10')][_0x260c('0xac')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x200a45));};AGIVertices[_0x260c('0x13')][_0x260c('0xd1')]=function(_0x424eb3){logger[_0x260c('0x2f')](util[_0x260c('0x54')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x424eb3['label']));if(!this[_0x260c('0x89')](_0x424eb3[_0x260c('0xd2')])){return this['channel']['error'](_0x424eb3,_0x260c('0xd3'));}var _0x20832f=this['getSquareOdbc'][_0x260c('0x73')](this,_0x424eb3[_0x260c('0xd2')]);if(!_0x20832f){return this[_0x260c('0x10')]['error'](_0x424eb3,'no\x20odbc\x20database\x20found');}if(!this[_0x260c('0x89')](_0x424eb3[_0x260c('0xd4')])){return this['channel'][_0x260c('0x2d')](_0x424eb3,'no\x20query\x20configured');}var _0x339a5d=_0x424eb3[_0x260c('0xd4')][_0x260c('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0x260c('0x10')]['noop'](util[_0x260c('0x54')](_0x260c('0xd5'),_0x339a5d));var _0x44a7e0=this['getQueryOdbc'][_0x260c('0x73')](this,_0x20832f,_0x339a5d);this[_0x260c('0x37')][_0x260c('0x73')](this,_0x424eb3,_0x339a5d);if(!this[_0x260c('0x89')](_0x424eb3[_0x260c('0xd6')])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0xd7'));}var _0x4e72cb=this[_0x260c('0x14')][_0x260c('0x73')](this,_0x424eb3['variable_id']);if(!_0x4e72cb){return this['channel'][_0x260c('0x2d')](_0x424eb3,_0x260c('0xd8'));}var _0x5ccc48=this;_0x44a7e0[_0x260c('0xd9')](function(_0x407850,_0x5cc0a8){Object[_0x260c('0xda')](_0x407850)['forEach'](function(_0x100b2d){_0x5ccc48['channel']['setVariable'](util['format'](_0x260c('0xdb'),_0x4e72cb,_0x5cc0a8,_0x100b2d),_0x407850[_0x100b2d]);});});this[_0x260c('0x10')][_0x260c('0xa9')](util['format']('%s_ROWS_COUNT',_0x4e72cb),_0x44a7e0['length']);return this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0xdc'),_0x4e72cb));};AGIVertices[_0x260c('0x13')][_0x260c('0xdd')]=function(_0x23de0c){logger['debug'](util[_0x260c('0x54')](_0x260c('0xde'),_0x23de0c[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x23de0c[_0x260c('0xdf')])){return this[_0x260c('0x10')]['error'](_0x23de0c,_0x260c('0xe0'));}var _0xd91ea5=this[_0x260c('0x1e')][_0x260c('0x73')](this,_0x23de0c[_0x260c('0xdf')]);if(!_0xd91ea5){return this[_0x260c('0x10')][_0x260c('0x2d')](_0x23de0c,'no\x20user\x20found');}var _0x5cdb1f=this['channel']['exec'](_0x260c('0xe1'),[util['format']('SIP/%s',_0xd91ea5),_0x23de0c[_0x260c('0x66')],_0x23de0c[_0x260c('0xe2')],_0x23de0c['url']]);if(_0x5cdb1f[_0x260c('0xa7')]===-0x1){return _0x5cdb1f;}return this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0xe3'),_0x260c('0xe1')));};AGIVertices[_0x260c('0x13')][_0x260c('0xe4')]=function(_0x4c4e20){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0xe5'),_0x4c4e20[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x4c4e20[_0x260c('0x7d')])){return this[_0x260c('0x10')]['noop'](_0x260c('0xe6'));}if(!this['isConfigured'](_0x4c4e20['text'])){return this['channel']['noop'](_0x260c('0xad'));}this[_0x260c('0x10')][_0x260c('0xe7')]=!![];this[_0x260c('0x37')](_0x4c4e20);this[_0x260c('0xe8')](_0x4c4e20['text'],'in','','');this[_0x260c('0x10')][_0x260c('0xac')](util['format']('Trying\x20Dialogflow:\x20%s',_0x4c4e20[_0x260c('0x5d')]));var _0x38f3e5=this[_0x260c('0x7c')][_0x260c('0x73')](this,_0x4c4e20);if(_0x38f3e5){for(var _0x2f92b0 in _0x38f3e5){if(_0x38f3e5[_0x260c('0x99')](_0x2f92b0)){this['channel'][_0x260c('0xa9')](util[_0x260c('0x54')]('DIALOGFLOW_%s',_0x2f92b0['toUpperCase']()),_0x38f3e5[_0x2f92b0]);}}this['createSquareMessage'](_0x38f3e5[_0x260c('0xe9')],_0x260c('0xea'),'dialogflow','');return this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0xeb'),_0x38f3e5[_0x260c('0xe9')]));}return this['channel'][_0x260c('0x2d')](_0x4c4e20,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype']['dialogflowV2']=function(_0x151620){logger['info'](util[_0x260c('0x54')](_0x260c('0xec'),_0x151620[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x151620['dialogflowV2_project_id'])){return this['channel'][_0x260c('0xac')](_0x260c('0xed'));}if(!this[_0x260c('0x89')](_0x151620[_0x260c('0xee')])){return this[_0x260c('0x10')]['noop'](_0x260c('0xef'));}if(!this[_0x260c('0x89')](_0x151620[_0x260c('0xf0')])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0xf1'));}if(!this['isConfigured'](_0x151620[_0x260c('0x81')])){return this['channel']['noop'](_0x260c('0xf2'));}if(!this['isConfigured'](_0x151620['text'])){return this[_0x260c('0x10')][_0x260c('0xac')]('no\x20text\x20configured');}this[_0x260c('0x10')][_0x260c('0xe7')]=!![];this[_0x260c('0x37')](_0x151620);this[_0x260c('0xe8')](_0x151620['text'],'in','','');this[_0x260c('0x10')][_0x260c('0xac')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x151620[_0x260c('0x5d')]));var _0x3fe8c4=this[_0x260c('0x7f')][_0x260c('0x73')](this,_0x151620);if(_0x3fe8c4){for(var _0x1f3b2b in _0x3fe8c4){if(_0x3fe8c4[_0x260c('0x99')](_0x1f3b2b)){if(_0x1f3b2b!==_0x260c('0xf3')){this[_0x260c('0x10')][_0x260c('0xa9')](util['format'](_0x260c('0xf4'),_0x1f3b2b['toUpperCase']()),_0x3fe8c4[_0x1f3b2b]);}}}this[_0x260c('0xe8')](_0x3fe8c4[_0x260c('0xe9')],_0x260c('0xea'),_0x260c('0xf5'),_0x3fe8c4[_0x260c('0xf3')]);return this[_0x260c('0x10')]['noop'](util[_0x260c('0x54')](_0x260c('0xf6'),_0x3fe8c4['speech']));}return this[_0x260c('0x10')][_0x260c('0x2d')](_0x151620,_0x260c('0xf7'));};AGIVertices[_0x260c('0x13')][_0x260c('0xf8')]=function(_0x4120f8){logger[_0x260c('0x2f')](util[_0x260c('0x54')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x4120f8[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x4120f8[_0x260c('0xf9')])){return this['channel']['noop'](_0x260c('0xfa'));}if(!this['isConfigured'](_0x4120f8[_0x260c('0xfb')])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0xfc'));}if(!this[_0x260c('0x89')](_0x4120f8[_0x260c('0xfd')])){return this[_0x260c('0x10')]['noop']('no\x20password\x20configured');}if(!this['isConfigured'](_0x4120f8[_0x260c('0xfe')])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0xad'));}this['channel']['bot']=!![];this[_0x260c('0x37')](_0x4120f8);this[_0x260c('0xe8')](_0x4120f8['text'],'in','','');this[_0x260c('0x10')]['noop'](util[_0x260c('0x54')]('Trying\x20SestekNDA:\x20%s',_0x4120f8[_0x260c('0x5d')]));var _0x40b005=this[_0x260c('0x82')][_0x260c('0x73')](this,_0x4120f8);if(_0x40b005){for(var _0x2d3dcd in _0x40b005){if(_0x40b005['hasOwnProperty'](_0x2d3dcd)){this['channel']['setVariable'](util[_0x260c('0x54')](_0x260c('0xff'),_0x2d3dcd[_0x260c('0x6b')]()),_0x40b005[_0x2d3dcd]);}}this[_0x260c('0xe8')](_0x40b005['speech'],_0x260c('0xea'),'sesteknda','');if(_0x40b005[_0x260c('0x100')]){this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x101'),_0x40b005[_0x260c('0x100')]));var _0x3f1c54=this[_0x260c('0x10')][_0x260c('0x102')](_0x40b005['audiofile']);try{fs[_0x260c('0x103')](_0x40b005['audiofile']+_0x260c('0x104'));}catch(_0x5d0456){logger[_0x260c('0x2d')](_0x5d0456);}return _0x3f1c54;}else{return this['channel']['noop'](util[_0x260c('0x54')](_0x260c('0x105'),_0x40b005[_0x260c('0xe9')]));}}return this[_0x260c('0x10')][_0x260c('0x2d')](_0x4120f8,_0x260c('0x106'));};AGIVertices['prototype'][_0x260c('0x107')]=function(_0x497d2d){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x108'),_0x497d2d['label']));return this[_0x260c('0x10')]['noop'](_0x260c('0x107'));};AGIVertices[_0x260c('0x13')]['ext_dial']=function(_0x300efb){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x109'),_0x300efb[_0x260c('0x38')]));var _0x5d8d46='';if(_0x300efb[_0x260c('0x10a')]){if(!this['isConfigured'](_0x300efb[_0x260c('0x10a')])){return this[_0x260c('0x10')]['error'](_0x300efb,_0x260c('0x10b'));}else{var _0x4e1e87=parseInt(_0x300efb[_0x260c('0x10a')],0xa);if(isNaN(_0x4e1e87)){_0x5d8d46=_0x300efb[_0x260c('0x10a')];}else{_0x5d8d46=this[_0x260c('0x20')]['sync'](this,_0x300efb[_0x260c('0x10a')]);if(!_0x5d8d46){return this[_0x260c('0x10')]['error'](_0x300efb,_0x260c('0x10c'));}}}}else if(_0x300efb[_0x260c('0x10d')]){_0x5d8d46=_0x300efb[_0x260c('0x10d')];}else{return this[_0x260c('0x10')][_0x260c('0x2d')](_0x300efb,'no\x20trunk\x20selected');}var _0x551947=this['channel'][_0x260c('0x58')]('DIAL',[util['format'](_0x260c('0x10e'),_0x5d8d46,_0x300efb[_0x260c('0x10f')]),_0x300efb[_0x260c('0x66')],_0x300efb['opts'],_0x300efb[_0x260c('0x64')]]);if(_0x551947['result']===-0x1){return _0x551947;}return this[_0x260c('0x10')]['noop'](util[_0x260c('0x54')](_0x260c('0xe3'),_0x260c('0xe1')));};AGIVertices[_0x260c('0x13')]['finally']=function(_0x2c7ed7){logger[_0x260c('0x2f')](util[_0x260c('0x54')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x2c7ed7[_0x260c('0x38')]));return this['channel']['noop']('finally');};AGIVertices[_0x260c('0x13')][_0x260c('0xe')]=function(_0xc673ae){logger['info'](util['format'](_0x260c('0x110'),_0xc673ae[_0x260c('0x38')]));if(_0xc673ae[_0x260c('0x111')]===0x0){return this[_0x260c('0xaa')](_0xc673ae);}_0xc673ae[_0x260c('0x111')]-=0x1;if(!this[_0x260c('0x89')](_0xc673ae[_0x260c('0x112')])){return this[_0x260c('0x10')][_0x260c('0x2d')](_0xc673ae,_0x260c('0x113'));}var _0x11f698=this[_0x260c('0x22')][_0x260c('0x73')](this,_0xc673ae[_0x260c('0x112')]);if(!_0x11f698){return this[_0x260c('0x10')][_0x260c('0x2d')](_0xc673ae,_0x260c('0x114'));}if(!this['isConfigured'](_0xc673ae[_0x260c('0xd6')])){return this[_0x260c('0x10')][_0x260c('0x2d')](_0x260c('0xd7'));}var _0x38b9ee=this[_0x260c('0x10')][_0x260c('0x115')](_0x11f698,_0xc673ae['response'],_0xc673ae[_0x260c('0x116')]);var _0x5c86c1=_0x38b9ee['result']?_0x38b9ee[_0x260c('0xa7')][_0x260c('0x4c')]():'';logger[_0x260c('0x2f')](_0x260c('0x117'),JSON[_0x260c('0x76')](_0x38b9ee));if(_0x38b9ee[_0x260c('0xa7')]===-0x1){this[_0x260c('0x37')][_0x260c('0x73')](this,_0xc673ae,_0x5c86c1);return _0x38b9ee;}else if(_0x38b9ee['extra']==='timeout'){_0x38b9ee[_0x260c('0xa7')]=_0x5c86c1['length']>=parseInt(_0xc673ae['mindigit'])?'x':'i';}else{_0x38b9ee['result']=_0x5c86c1[_0x260c('0x9f')]>=parseInt(_0xc673ae[_0x260c('0x118')])&&_0x5c86c1[_0x260c('0x9f')]<=parseInt(_0xc673ae[_0x260c('0x116')])?'x':'i';}var _0x408eab=this['getVariable'][_0x260c('0x73')](this,_0xc673ae[_0x260c('0xd6')]);if(!_0x408eab){return this['channel'][_0x260c('0x2d')](_0xc673ae,'no\x20variable\x20found');}this[_0x260c('0x10')]['setVariable'](_0x408eab,_0x5c86c1);if(this[_0x260c('0x89')](_0xc673ae[_0x260c('0x119')])){var _0xa3e10f=parseInt(_0xc673ae[_0x260c('0x119')],0xa);var _0x325913=rs[_0x260c('0x11a')]({'charset':'*','length':_0xa3e10f});var _0x94c4b2=_0x5c86c1['length'];if(_0x94c4b2>0x0){if(_0x94c4b2>_0xa3e10f){this[_0x260c('0x37')][_0x260c('0x73')](this,_0xc673ae,_0xc673ae[_0x260c('0x11b')]===_0x260c('0x11c')?_0x325913+_0x5c86c1[_0x260c('0x11d')](_0xa3e10f):_0x5c86c1[_0x260c('0x11d')](0x0,_0x94c4b2-_0xa3e10f)+_0x325913);}else{this[_0x260c('0x37')]['sync'](this,_0xc673ae,rs[_0x260c('0x11a')]({'charset':'*','length':_0x94c4b2}));}}else{this[_0x260c('0x37')]['sync'](this,_0xc673ae,'');}}else{this[_0x260c('0x37')]['sync'](this,_0xc673ae,_0x5c86c1);}return _0x38b9ee;};AGIVertices[_0x260c('0x13')]['getsecretdigits']=function(_0x3d7c11){logger[_0x260c('0x2f')](util['format'](_0x260c('0x11e'),_0x3d7c11[_0x260c('0x38')]));return this['getdigits'](_0x3d7c11);};AGIVertices['prototype'][_0x260c('0x11f')]=function(_0x164622){logger[_0x260c('0x2f')](util[_0x260c('0x54')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x164622[_0x260c('0x38')]));this[_0x260c('0x37')][_0x260c('0x73')](this,_0x164622,_0x164622['goalname']);return this['channel'][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x120'),_0x164622[_0x260c('0x121')]));};AGIVertices[_0x260c('0x13')][_0x260c('0x122')]=function(_0x4823e4){logger['info'](util[_0x260c('0x54')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x4823e4[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x4823e4[_0x260c('0x91')])||!this[_0x260c('0x89')](_0x4823e4[_0x260c('0x8c')])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0x123'));}if(!this[_0x260c('0x89')](_0x4823e4[_0x260c('0x5d')])){return this['channel'][_0x260c('0xac')]('no\x20text\x20configured');}this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x124'),_0x4823e4[_0x260c('0x5d')]));var _0x4ac4ed=this['awsPolly'][_0x260c('0x73')](this,_0x4823e4);if(_0x4ac4ed){this['channel'][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x125'),_0x4ac4ed));var _0x1e87eb=this[_0x260c('0x10')][_0x260c('0x102')](_0x4ac4ed);try{fs[_0x260c('0x103')](_0x4ac4ed+_0x260c('0x104'));}catch(_0x4b1c3e){logger[_0x260c('0x2d')](_0x4b1c3e);}return _0x1e87eb;}return this['channel'][_0x260c('0x2d')](_0x4823e4,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x260c('0x13')][_0x260c('0x126')]=function(_0x2b7241){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x127'),_0x2b7241[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x2b7241['aws_access_key_id'])||!this[_0x260c('0x89')](_0x2b7241[_0x260c('0x8c')])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0x123'));}if(!this[_0x260c('0x89')](_0x2b7241[_0x260c('0x93')])){return this[_0x260c('0x10')]['noop'](_0x260c('0x128'));}if(!this[_0x260c('0x89')](_0x2b7241[_0x260c('0x5d')])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0xad'));}this[_0x260c('0x10')][_0x260c('0xe7')]=!![];this[_0x260c('0x37')](_0x2b7241);this[_0x260c('0xe8')](_0x2b7241[_0x260c('0x5d')],'in','','');this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')]('Trying\x20Amazon\x20Lex:\x20%s',_0x2b7241['text']));var _0x1cc069=this[_0x260c('0x90')][_0x260c('0x73')](this,_0x2b7241);if(_0x1cc069){for(var _0x564a43 in _0x1cc069){if(_0x1cc069[_0x260c('0x99')](_0x564a43)&&_[_0x260c('0xa0')](_0x1cc069[_0x564a43])){this['channel'][_0x260c('0xa9')](util[_0x260c('0x54')](_0x260c('0x129'),_0x564a43[_0x260c('0x6b')]()),_0x1cc069[_0x564a43]);}}if(_['isNil'](_0x1cc069[_0x260c('0x12a')])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0x12b'));}else{this[_0x260c('0xe8')](_0x1cc069[_0x260c('0x12a')],'out',_0x260c('0x12c'),'');return this[_0x260c('0x10')][_0x260c('0xac')](util['format'](_0x260c('0x12d'),_0x1cc069['message']));}}return this['channel'][_0x260c('0x2d')](_0x2b7241,_0x260c('0x12e'));};AGIVertices['prototype'][_0x260c('0x12f')]=function(_0x48ba13){logger['info'](util[_0x260c('0x54')](_0x260c('0x130'),_0x48ba13['label'],_0x48ba13[_0x260c('0x66')]));if(!this['isConfigured'](_0x48ba13['key'])){return this[_0x260c('0x10')]['noop']('no\x20key\x20configured');}var _0x28f0e5=_0x260c('0x131');var _0x37a0cc=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x260c('0x11a')](0x4));var _0x384353=util[_0x260c('0x54')](_0x260c('0xa2'),_0x37a0cc,_0x28f0e5);var _0x3c83ec=!![];if(_0x48ba13['beep']===_0x260c('0x132')){_0x3c83ec=![];}var _0x5416ff=this[_0x260c('0x10')]['recordFile'](_0x37a0cc,_0x28f0e5,_0x48ba13[_0x260c('0x133')],_0x48ba13[_0x260c('0x66')],undefined,_0x3c83ec);if(_0x5416ff['result']!==-0x1){this[_0x260c('0x10')][_0x260c('0xac')](util['format'](_0x260c('0x134'),_0x384353));var _0x4acbc6=this[_0x260c('0x94')][_0x260c('0x73')](this,_0x48ba13,_0x384353);if(_0x4acbc6){for(var _0x57e621 in _0x4acbc6){if(_0x4acbc6[_0x260c('0x99')](_0x57e621)){this[_0x260c('0x10')][_0x260c('0xa9')](util['format'](_0x260c('0x135'),_0x57e621[_0x260c('0x6b')]()),_0x4acbc6[_0x57e621]);}}return this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x136'),JSON[_0x260c('0x76')](_0x4acbc6)));}}return _0x5416ff;};AGIVertices[_0x260c('0x13')][_0x260c('0x137')]=function(_0x37fb92){logger[_0x260c('0x2f')](util[_0x260c('0x54')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x37fb92['label']));if(!this[_0x260c('0x89')](_0x37fb92[_0x260c('0x96')])){return this['channel'][_0x260c('0xac')](_0x260c('0x138'));}if(!this['isConfigured'](_0x37fb92[_0x260c('0x97')])){return this['channel'][_0x260c('0xac')]('no\x20appsecret\x20configured');}var _0x5b4fef=_0x260c('0x131');var _0x459714=util[_0x260c('0x54')]('%s/recordings/%s',FILES_PATH,rs[_0x260c('0x11a')](0x4));var _0x4bb6ad=util['format'](_0x260c('0xa2'),_0x459714,_0x5b4fef);var _0x2bd6f0=!![];if(_0x37fb92[_0x260c('0x139')]===_0x260c('0x132')){_0x2bd6f0=![];}var _0x1893ae=this[_0x260c('0x10')]['recordFile'](_0x459714,_0x5b4fef,_0x37fb92[_0x260c('0x133')],_0x37fb92[_0x260c('0x66')],undefined,_0x2bd6f0);if(_0x1893ae[_0x260c('0xa7')]!==-0x1){this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')]('tilde\x20%s\x20file\x20created',_0x4bb6ad));var _0x88554f=this[_0x260c('0x95')][_0x260c('0x73')](this,_0x37fb92,_0x4bb6ad);if(_0x88554f){for(var _0x342ef9 in _0x88554f){if(_0x88554f[_0x260c('0x99')](_0x342ef9)){this[_0x260c('0x10')][_0x260c('0xa9')](util[_0x260c('0x54')](_0x260c('0x13a'),_0x342ef9[_0x260c('0x6b')]()),_0x88554f[_0x342ef9]);}}return this['channel']['noop'](util[_0x260c('0x54')]('TildeASR\x20Result\x20%s',JSON[_0x260c('0x76')](_0x88554f)));}}return _0x1893ae;};AGIVertices[_0x260c('0x13')][_0x260c('0x13b')]=function(_0x2b43ef){logger[_0x260c('0x2f')](util[_0x260c('0x54')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x2b43ef[_0x260c('0x38')]));return this[_0x260c('0x10')][_0x260c('0x13c')](_0x2b43ef[_0x260c('0x3f')],_0x2b43ef[_0x260c('0x13d')],_0x2b43ef[_0x260c('0x40')]);};AGIVertices[_0x260c('0x13')][_0x260c('0x13e')]=function(_0x5a3f08){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x13f'),_0x5a3f08[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x5a3f08['condition'])){return this[_0x260c('0x10')][_0x260c('0x2d')](_0x5a3f08,_0x260c('0x140'));}try{var _0x4558d4=eval(_0x5a3f08[_0x260c('0x141')])?_0x260c('0x142'):_0x260c('0x143');this[_0x260c('0x10')]['noop'](util[_0x260c('0x54')](_0x260c('0x144'),_0x5a3f08[_0x260c('0x141')],_0x4558d4));return{'code':0xc8,'result':_0x4558d4};}catch(_0xd8358e){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x260c('0x13')][_0x260c('0x145')]=function(_0x53ca2d){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x146'),_0x53ca2d[_0x260c('0x38')]));if(!this['isConfigured'](_0x53ca2d['interval_id'])){return this['channel'][_0x260c('0x2d')](_0x53ca2d,_0x260c('0x147'));}var _0x32db08=this['getIntervals'][_0x260c('0x73')](this,_0x53ca2d['interval_id']);if(!_0x32db08){return this[_0x260c('0x10')]['error'](_0x53ca2d,_0x260c('0x148'));}for(var _0x35f68d=0x0;_0x35f68d<_0x32db08[_0x260c('0x9f')];_0x35f68d+=0x1){var _0x36d29c=this[_0x260c('0x10')][_0x260c('0x14')](util[_0x260c('0x54')]('IFTIME(%s?true:false)',_0x32db08[_0x35f68d]));if(_0x36d29c[_0x260c('0xa7')]===-0x1){return _0x36d29c;}logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x149'),_0x32db08[_0x35f68d],_0x36d29c[_0x260c('0xa5')]));if(_0x36d29c['extra']===_0x260c('0x142')){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x149'),_0x32db08[_0x35f68d],_0x260c('0x142')));this[_0x260c('0x10')]['noop'](util[_0x260c('0x54')](_0x260c('0x149'),_0x32db08[_0x35f68d],'true'));return{'code':0xc8,'result':_0x260c('0x142')};}else{logger['info'](util[_0x260c('0x54')]('IFTIME\x20%s\x20%s',_0x32db08[_0x35f68d],_0x260c('0x143')));this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x149'),_0x32db08[_0x35f68d],_0x260c('0x143')));}}return{'code':0xc8,'result':_0x260c('0x143')};};AGIVertices[_0x260c('0x13')]['hangup']=function(_0x35ea62){logger['info'](util['format'](_0x260c('0x14a'),_0x35ea62[_0x260c('0x38')]));return this[_0x260c('0x10')]['hangup']();};AGIVertices[_0x260c('0x13')][_0x260c('0x14b')]=function(_0x655ac0){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x14c'),_0x655ac0[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x655ac0[_0x260c('0x7d')])){return this['channel'][_0x260c('0xac')](_0x260c('0xe6'));}var _0x158ff8=_0x260c('0x131');var _0x57f407=util[_0x260c('0x54')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x35e41e=util[_0x260c('0x54')](_0x260c('0xa2'),_0x57f407,_0x158ff8);var _0x1cfb7d=!![];if(_0x655ac0[_0x260c('0x139')]===_0x260c('0x132')){_0x1cfb7d=![];}var _0x5d36cc=this[_0x260c('0x10')]['recordFile'](_0x57f407,_0x158ff8,_0x655ac0[_0x260c('0x133')],_0x655ac0[_0x260c('0x66')],undefined,_0x1cfb7d);if(_0x5d36cc[_0x260c('0xa7')]!==-0x1){this['channel'][_0x260c('0xac')](util['format'](_0x260c('0x14d'),_0x35e41e));var _0x498a29=this[_0x260c('0x86')][_0x260c('0x73')](this,_0x655ac0,_0x35e41e);if(_0x498a29){for(var _0xa56314 in _0x498a29){if(_0x498a29[_0x260c('0x99')](_0xa56314)){this[_0x260c('0x10')]['setVariable'](util[_0x260c('0x54')](_0x260c('0x14e'),_0xa56314[_0x260c('0x6b')]()),_0x498a29[_0xa56314]);}}return this['channel'][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x14f'),JSON[_0x260c('0x76')](_0x498a29)));}}return _0x5d36cc;};AGIVertices['prototype'][_0x260c('0x150')]=function(_0x395c9f){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x151'),_0x395c9f[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x395c9f[_0x260c('0x7d')])){return this[_0x260c('0x10')]['noop'](_0x260c('0xe6'));}if(!this[_0x260c('0x89')](_0x395c9f[_0x260c('0x5d')])){return this[_0x260c('0x10')]['noop'](_0x260c('0xad'));}this[_0x260c('0x10')][_0x260c('0xac')](util['format'](_0x260c('0x152'),_0x395c9f['text']));var _0x59cbbf=this['ispeechTTS'][_0x260c('0x73')](this,_0x395c9f);if(_0x59cbbf){this['channel'][_0x260c('0xac')](util['format'](_0x260c('0x14d'),_0x59cbbf));var _0x420a5a=this['channel'][_0x260c('0x102')](_0x59cbbf,_0x395c9f[_0x260c('0x133')]);try{fs['unlink'](_0x59cbbf+'.wav');}catch(_0x2d80a1){logger[_0x260c('0x2d')](_0x2d80a1);}return _0x420a5a;}return this[_0x260c('0x10')][_0x260c('0x2d')](_0x395c9f,_0x260c('0x153'));};AGIVertices[_0x260c('0x13')][_0x260c('0x154')]=function(_0x51c3b6){logger[_0x260c('0x2f')](util['format'](_0x260c('0x155'),_0x51c3b6[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x51c3b6['findBy'])){return this['channel']['error'](_0x51c3b6,_0x260c('0x156'));}logger[_0x260c('0x2f')](util[_0x260c('0x54')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x260c('0x3b')],_0x51c3b6['findBy']));var _0x5d0e0a=this[_0x260c('0x53')][_0x260c('0x73')](this,_0x51c3b6[_0x260c('0x157')]);if(_0x5d0e0a){logger[_0x260c('0x2f')](util[_0x260c('0x54')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x51c3b6[_0x260c('0x157')]));this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x158'),this[_0x260c('0x10')][_0x260c('0x3b')],_0x51c3b6[_0x260c('0x157')]));return{'code':0xc8,'result':_0x260c('0x159')};}else{logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x15a'),this[_0x260c('0x10')][_0x260c('0x3b')],_0x51c3b6[_0x260c('0x157')]));this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x15a'),this[_0x260c('0x10')][_0x260c('0x3b')],_0x51c3b6['findBy']));return{'code':0xc8,'result':_0x260c('0x15b')};}};AGIVertices[_0x260c('0x13')][_0x260c('0x15c')]=function(_0x2cebed){logger['info'](util[_0x260c('0x54')](_0x260c('0x15d'),_0x2cebed[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x2cebed[_0x260c('0x157')])){return this['channel'][_0x260c('0x2d')](_0x2cebed,_0x260c('0x156'));}logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x15e'),this[_0x260c('0x10')]['callerid'],_0x2cebed['findBy']));var _0xa5e0c8=this[_0x260c('0x52')][_0x260c('0x73')](this,_0x2cebed[_0x260c('0x157')]);if(_0xa5e0c8){logger[_0x260c('0x2f')](util[_0x260c('0x54')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x260c('0x10')]['callerid'],_0x2cebed[_0x260c('0x157')]));this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x158'),this[_0x260c('0x10')][_0x260c('0x3b')],_0x2cebed[_0x260c('0x157')]));return{'code':0xc8,'result':_0x260c('0x159')};}else{logger[_0x260c('0x2f')](util[_0x260c('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x260c('0x10')]['callerid'],_0x2cebed[_0x260c('0x157')]));this['channel'][_0x260c('0xac')](util[_0x260c('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x260c('0x10')][_0x260c('0x3b')],_0x2cebed[_0x260c('0x157')]));return{'code':0xc8,'result':_0x260c('0x15b')};}};AGIVertices[_0x260c('0x13')][_0x260c('0x15f')]=function(_0x587f68){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x160'),_0x587f68['label']));if(!this['isConfigured'](_0x587f68['operation'])){return this[_0x260c('0x10')][_0x260c('0x2d')](_0x587f68,_0x260c('0x161'));}this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x162'),_0x587f68[_0x260c('0x163')]));var _0x387ed8=eval(_0x587f68['operation']);if(!this[_0x260c('0x89')](_0x587f68[_0x260c('0xd6')])){return this['channel'][_0x260c('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0xcfaa42=this[_0x260c('0x14')][_0x260c('0x73')](this,_0x587f68['variable_id']);if(!_0xcfaa42){return this[_0x260c('0x10')][_0x260c('0x2d')](_0x587f68,_0x260c('0xd8'));}if(_[_0x260c('0x9e')](_0x387ed8)){var _0x5ec758=this;_0x387ed8['forEach'](function(_0x3bcc8d,_0x1593ef){_0x5ec758[_0x260c('0x10')][_0x260c('0xa9')](util[_0x260c('0x54')](_0x260c('0x164'),_0xcfaa42,_0x1593ef),_0x3bcc8d);});return this[_0x260c('0x10')]['noop'](util[_0x260c('0x54')](_0x260c('0x165'),_0xcfaa42));}else{return this[_0x260c('0x10')]['setVariable'](_0xcfaa42,_0x387ed8);}};AGIVertices[_0x260c('0x13')][_0x260c('0xd')]=function(_0x2b3afa){logger['info'](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0x2b3afa[_0x260c('0x38')]));if(_0x2b3afa[_0x260c('0x111')]===0x0){return this[_0x260c('0xaa')](_0x2b3afa);}_0x2b3afa[_0x260c('0x111')]-=0x1;if(!this[_0x260c('0x89')](_0x2b3afa[_0x260c('0x112')])){return this[_0x260c('0x10')][_0x260c('0x2d')](_0x2b3afa,'no\x20file\x20audio\x20selected');}var _0x2d1ce6=this[_0x260c('0x22')][_0x260c('0x73')](this,_0x2b3afa[_0x260c('0x112')]);if(!_0x2d1ce6){return this[_0x260c('0x10')][_0x260c('0x2d')](_0x2b3afa,_0x260c('0x114'));}var _0x3eda24=this['channel'][_0x260c('0x115')](_0x2d1ce6,_0x2b3afa[_0x260c('0x166')],_0x2b3afa[_0x260c('0x167')]);var _0x473bec=_0x3eda24['result'];if(_0x3eda24['result']===-0x1){this[_0x260c('0x37')][_0x260c('0x73')](this,_0x2b3afa,'-1');return _0x3eda24;}else if(_0x3eda24['extra']===_0x260c('0x66')){_0x3eda24['result']=_0x3eda24[_0x260c('0xa7')][_0x260c('0x9f')]>0x0?_0x3eda24[_0x260c('0xa7')]:'t';}else if(_[_0x260c('0x45')](_0x3eda24[_0x260c('0xa7')])){_0x3eda24[_0x260c('0xa7')]='#';_0x473bec='#';}if(!this['isConfigured'](_0x2b3afa[_0x260c('0xd6')])){this['channel'][_0x260c('0xac')](_0x260c('0xd7'));}else{var _0x5c66b7=this[_0x260c('0x14')][_0x260c('0x73')](this,_0x2b3afa['variable_id']);if(!_0x5c66b7){return this[_0x260c('0x10')]['error'](_0x2b3afa,_0x260c('0xd8'));}this[_0x260c('0x10')][_0x260c('0xa9')](_0x5c66b7,_0x473bec);}this['createSquareDetailsReport']['sync'](this,_0x2b3afa,_0x473bec);return _0x3eda24;};AGIVertices['prototype'][_0x260c('0xac')]=function(_0x48b36c){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x168'),_0x48b36c[_0x260c('0x38')]));return this[_0x260c('0x10')][_0x260c('0xac')](_0x48b36c[_0x260c('0x169')]||_0x48b36c['label']);};AGIVertices[_0x260c('0x13')][_0x260c('0x16a')]=function(_0x54243c){logger['info'](util[_0x260c('0x54')](_0x260c('0x16b'),_0x54243c[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x54243c[_0x260c('0x157')])){return this[_0x260c('0x10')][_0x260c('0x2d')](_0x54243c,_0x260c('0x156'));}logger[_0x260c('0x2f')](util['format'](_0x260c('0x15e'),this[_0x260c('0x10')]['callerid'],_0x54243c[_0x260c('0x157')]));var _0x3b3595=this[_0x260c('0x4d')]['sync'](this,_0x54243c[_0x260c('0x16c')]);var _0x1403b2=this[_0x260c('0x4f')][_0x260c('0x73')](this,_0x54243c[_0x260c('0x157')],_0x3b3595);if(_0x1403b2){logger['info'](util[_0x260c('0x54')](_0x260c('0x158'),this[_0x260c('0x10')][_0x260c('0x3b')],_0x54243c[_0x260c('0x157')]));this['channel'][_0x260c('0xac')](util['format'](_0x260c('0x158'),this['channel']['callerid'],_0x54243c[_0x260c('0x157')]));return{'code':0xc8,'result':_0x260c('0x159')};}else{logger[_0x260c('0x2f')](util['format'](_0x260c('0x15a'),this[_0x260c('0x10')][_0x260c('0x3b')],_0x54243c['findBy']));this['channel'][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x158'),this[_0x260c('0x10')]['callerid'],_0x54243c[_0x260c('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x260c('0x13')][_0x260c('0x16d')]=function(_0x2091a2){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x16e'),_0x2091a2[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x2091a2[_0x260c('0x112')])){return this[_0x260c('0x10')][_0x260c('0x2d')](_0x2091a2,_0x260c('0x113'));}var _0x25560d=this[_0x260c('0x22')][_0x260c('0x73')](this,_0x2091a2[_0x260c('0x112')]);if(!_0x25560d){return this[_0x260c('0x10')][_0x260c('0x2d')](_0x2091a2,_0x260c('0x114'));}var _0x38137f=this[_0x260c('0x10')]['exec'](_0x260c('0x16f'),[_0x25560d,_0x2091a2[_0x260c('0xe2')]]);if(_0x38137f[_0x260c('0xa7')]===-0x1){return _0x38137f;}return this['channel'][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x170'),'PLAYBACK',_0x25560d));};AGIVertices[_0x260c('0x13')]['queue']=function(_0x2cb9da){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x171'),_0x2cb9da[_0x260c('0x38')]));if(!this['isConfigured'](_0x2cb9da[_0x260c('0x172')])){return this[_0x260c('0x10')][_0x260c('0x2d')](_0x2cb9da,_0x260c('0x173'));}var _0x277059='';var _0xa7d0eb=parseInt(_0x2cb9da['queue_id'],0xa);if(isNaN(_0xa7d0eb)){_0x277059=_0x2cb9da[_0x260c('0x172')];}else{_0x277059=this['getVoiceQueue'][_0x260c('0x73')](this,_0x2cb9da[_0x260c('0x172')]);if(!_0x277059){return this['channel'][_0x260c('0x2d')](_0x2cb9da,_0x260c('0x174'));}}var _0x30b1e4='';if(this['isConfigured'](_0x2cb9da[_0x260c('0x112')])){var _0x1e8af0=this[_0x260c('0x22')][_0x260c('0x73')](this,_0x2cb9da[_0x260c('0x112')]);if(_0x1e8af0){_0x30b1e4=_0x1e8af0;}}this[_0x260c('0x37')][_0x260c('0x73')](this,_0x2cb9da,_0x277059);if(_0x2cb9da[_0x260c('0xe2')][_0x260c('0x175')]('x')<0x0){_0x2cb9da['opts']+='x';}if(_0x2cb9da[_0x260c('0xe2')]['indexOf']('X')<0x0){_0x2cb9da[_0x260c('0xe2')]+='X';}this[_0x260c('0x10')][_0x260c('0xa9')](_0x260c('0x176'),_0x277059?_0x277059[_0x260c('0x177')]():'');var _0x120bdd=this[_0x260c('0x10')][_0x260c('0x58')](_0x260c('0x178'),[_0x277059,_0x2cb9da[_0x260c('0xe2')],_0x2cb9da['url'],_0x30b1e4,_0x2cb9da['timeout'],_0x2cb9da[_0x260c('0x8')],_0x2cb9da['macro'],_0x2cb9da[_0x260c('0x179')],'',_0x2cb9da[_0x260c('0x17a')]]);if(_0x120bdd[_0x260c('0xa7')]===-0x1){return _0x120bdd;}return this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x170'),'QUEUE',_0x277059));};AGIVertices['prototype'][_0x260c('0x17b')]=function(_0x34ba5b){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x17c'),_0x34ba5b[_0x260c('0x38')]));var _0x5c2544=_0x34ba5b['recordingFormat']||_0x260c('0x131');var _0x633563=util[_0x260c('0x54')]('%s_%s',this[_0x260c('0x10')][_0x260c('0x3d')],rs[_0x260c('0x11a')](0x5));var _0x3855a4=util[_0x260c('0x54')](_0x260c('0x17d'),FILES_PATH,_0x633563,_0x5c2544);var _0x54dd93=util[_0x260c('0x54')](_0x260c('0x17e'),FILES_PATH,_0x633563);this['createSquareRecording'][_0x260c('0x73')](this,_0x34ba5b,_0x633563,_0x3855a4);this[_0x260c('0x10')][_0x260c('0xa9')](_0x260c('0x17f'),_0x633563);logger[_0x260c('0x2f')](_0x260c('0x180'),_0x54dd93,_0x5c2544,_0x34ba5b[_0x260c('0x181')],_0x34ba5b['timeout']);return this[_0x260c('0x10')][_0x260c('0x182')](_0x54dd93,_0x5c2544,_0x34ba5b[_0x260c('0x181')],_0x34ba5b['timeout'],undefined,!![]);};AGIVertices[_0x260c('0x13')][_0x260c('0x183')]=function(_0x31c1f1){logger[_0x260c('0x2f')](util['format'](_0x260c('0x184'),_0x31c1f1[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x31c1f1[_0x260c('0x64')])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0x185'));}var _0x43a9f1=this[_0x260c('0x63')][_0x260c('0x73')](this,_0x31c1f1);logger['info'](util[_0x260c('0x54')]('Response:',util['inspect'](_0x43a9f1,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x31c1f1['variable_id'])){return this['channel'][_0x260c('0xac')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x33623a=this['getVariable'][_0x260c('0x73')](this,_0x31c1f1[_0x260c('0xd6')]);if(!_0x33623a){return this['channel']['error'](_0x31c1f1,_0x260c('0xd8'));}this[_0x260c('0x10')][_0x260c('0xa9')](util[_0x260c('0x54')](_0x260c('0x186'),_0x33623a),_0x43a9f1[_0x260c('0x78')]?_0x43a9f1[_0x260c('0x78')]:_0x260c('0x187'));this[_0x260c('0x10')][_0x260c('0xa9')](util['format']('%s_STATUS_MESSAGE',_0x33623a),_0x43a9f1[_0x260c('0x79')]?_0x43a9f1[_0x260c('0x79')]:'OK');if(_0x43a9f1[_0x260c('0x6c')]){try{this[_0x260c('0xa1')](_0x43a9f1[_0x260c('0x6c')],_0x33623a);}catch(_0x14230c){logger[_0x260c('0x2d')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x33623a));}}return this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0xdc'),_0x33623a));};AGIVertices[_0x260c('0x13')][_0x260c('0x188')]=function(_0x5689c3){logger['info'](util[_0x260c('0x54')](_0x260c('0x189'),_0x5689c3[_0x260c('0x38')]));return this['channel'][_0x260c('0x18a')](_0x5689c3[_0x260c('0x18b')][_0x260c('0x59')](/\s+/g,''),_0x5689c3[_0x260c('0x181')]);};AGIVertices['prototype'][_0x260c('0x18c')]=function(_0x34a13a){logger['info'](util[_0x260c('0x54')](_0x260c('0x18d'),_0x34a13a[_0x260c('0x38')]));return this['channel'][_0x260c('0x18e')](_0x34a13a['number'][_0x260c('0x59')](/\s+/g,''),_0x34a13a['escape_digits']);};AGIVertices[_0x260c('0x13')][_0x260c('0x18f')]=function(_0x5ad7a8){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x190'),_0x5ad7a8[_0x260c('0x38')]));return this['channel']['sayPhonetic'](_0x5ad7a8[_0x260c('0x5d')],_0x5ad7a8[_0x260c('0x181')]);};AGIVertices[_0x260c('0x13')][_0x260c('0x191')]=function(_0x1e1eee){logger[_0x260c('0x2f')](util['format'](_0x260c('0x192'),_0x1e1eee[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x1e1eee[_0x260c('0x193')])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0x194'));}var _0x500dbf=this[_0x260c('0x26')]['sync'](this,_0x1e1eee[_0x260c('0x193')]);if(!_0x500dbf||!_0x500dbf[_0x260c('0x195')]){return this['channel'][_0x260c('0x2d')](_0x1e1eee,'no\x20mail\x20account\x20found');}var _0x391091={'from':util[_0x260c('0x54')]('\x22%s\x22\x20<%s>',_0x500dbf[_0x260c('0x16')],_0x500dbf[_0x260c('0x196')]||_0x500dbf[_0x260c('0x195')][_0x260c('0x197')]),'to':_0x1e1eee['to']||'','cc':_0x1e1eee['cc']||'','bcc':_0x1e1eee['bcc']||'','subject':_0x1e1eee['subject'],'html':_0x1e1eee[_0x260c('0x5d')],'text':_0x1e1eee[_0x260c('0x5d')]};if(this[_0x260c('0x89')](_0x1e1eee[_0x260c('0x198')])){}logger[_0x260c('0x199')](_0x260c('0x19a'),JSON[_0x260c('0x76')](_0x391091));this['createSquareDetailsReport'][_0x260c('0x73')](this,_0x1e1eee,_0x1e1eee[_0x260c('0x193')]);this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x19b'),_0x500dbf[_0x260c('0x16')]));this['sendMailMessage'][_0x260c('0x73')](this,_0x500dbf[_0x260c('0x19c')],_0x391091);return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0x19d'));};AGIVertices[_0x260c('0x13')]['sendFax']=function(_0x25ea99){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x19e'),_0x25ea99[_0x260c('0x38')]));return this[_0x260c('0x10')]['noop'](_0x260c('0x19f'));};AGIVertices['prototype'][_0x260c('0x1a0')]=function(_0x2eb183){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x1a1'),_0x2eb183['label']));if(!this[_0x260c('0x89')](_0x2eb183[_0x260c('0x1a2')])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0x1a3'));}var _0xbed888=this[_0x260c('0x34')][_0x260c('0x73')](this,_0x2eb183[_0x260c('0x1a2')]);if(!_0xbed888){return this['channel'][_0x260c('0x2d')](_0x2eb183,_0x260c('0x1a4'));}var _0x2b0338={'body':_0x2eb183[_0x260c('0x1a5')],'phone':_0x2eb183['to']||'','SmsAccountId':_0xbed888['id']};logger['debug'](_0x260c('0x1a6'),JSON[_0x260c('0x76')](_0x2b0338));this[_0x260c('0x37')][_0x260c('0x73')](this,_0x2eb183,_0x2eb183['sms_account_id']);this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0xbed888[_0x260c('0x16')]));this[_0x260c('0x36')][_0x260c('0x73')](this,_0x2b0338);return this['channel'][_0x260c('0xac')](_0x260c('0x1a7'));};AGIVertices[_0x260c('0x13')][_0x260c('0x1a8')]=function(_0x49ea50){logger['info'](util[_0x260c('0x54')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x49ea50[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x49ea50[_0x260c('0xd6')])){return this[_0x260c('0x10')][_0x260c('0x2d')](_0x49ea50,_0x260c('0x1a9'));}var _0x416429=this[_0x260c('0x14')][_0x260c('0x73')](this,_0x49ea50['variable_id']);if(!_0x416429){return this[_0x260c('0x10')]['error'](_0x49ea50,_0x260c('0xd8'));}return this['channel'][_0x260c('0xa9')](_0x416429,_0x49ea50[_0x260c('0x1aa')]);};AGIVertices[_0x260c('0x13')]['start']=function(_0x2a7fd6){logger[_0x260c('0x2f')](util['format'](_0x260c('0x1ab'),_0x2a7fd6[_0x260c('0x38')]));this[_0x260c('0x10')]['noop']('START\x20CALLY\x20SQUARE');var _0xb07d7f=this[_0x260c('0x10')][_0x260c('0x14')](_0x260c('0x1ac'));if(!_[_0x260c('0x45')](_0xb07d7f['extra'])){this[_0x260c('0x10')][_0x260c('0x3d')]=_0xb07d7f[_0x260c('0xa5')];}if(_0x2a7fd6['answer']===_0x260c('0x1ad')){this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0x1ae'));return this['channel'][_0x260c('0xb9')]();}return this['channel'][_0x260c('0xac')](_0x260c('0x1af'));};AGIVertices[_0x260c('0x13')][_0x260c('0x1b0')]=function(_0x5d248f){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x1b1'),_0x5d248f[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x5d248f[_0x260c('0x1b2')])){return this[_0x260c('0x10')][_0x260c('0x2d')](_0x5d248f,_0x260c('0x1b3'));}var _0x144913=this[_0x260c('0x1b4')][_0x260c('0x73')](this,_0x5d248f['project_id']);if(!this[_0x260c('0x89')](_0x144913)){return this[_0x260c('0x10')]['error'](_0x5d248f,util[_0x260c('0x54')](_0x260c('0x1b5'),_0x5d248f[_0x260c('0x1b2')]));}if(_0x144913===this[_0x260c('0x10')][_0x260c('0x3a')]){return this[_0x260c('0x10')]['error'](_0x5d248f,_0x260c('0x1b6'));}this['createSquareDetailsReport']['sync'](this,_0x5d248f,_0x144913);var _0x395383=this[_0x260c('0x10')]['exec'](_0x260c('0x1b7'),util[_0x260c('0x54')](_0x260c('0x1b8'),config[_0x260c('0x8')][_0x260c('0x1b9')]||_0x260c('0x1ba'),_0x144913,this[_0x260c('0x10')][_0x260c('0x3a')]));if(_0x395383[_0x260c('0xa7')]===-0x1){return _0x395383;}return this['channel']['noop'](util['format'](_0x260c('0x170'),'AGI',_0x144913));};AGIVertices[_0x260c('0x13')][_0x260c('0x1bb')]=function(_0x5974ae){logger['info'](util['format'](_0x260c('0x1bc'),_0x5974ae[_0x260c('0x38')]));var _0x445505=this['shellCommand'][_0x260c('0x73')](this,_0x5974ae[_0x260c('0x1bd')]);this[_0x260c('0x37')][_0x260c('0x73')](this,_0x5974ae,_0x5974ae['command']);if(this['isConfigured'](_0x5974ae[_0x260c('0xd6')])){var _0x4ae3a3=this[_0x260c('0x14')][_0x260c('0x73')](this,_0x5974ae[_0x260c('0xd6')]);if(_0x4ae3a3){this[_0x260c('0x10')]['setVariable'](_0x4ae3a3,_0x445505);return this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x1be'),_0x5974ae[_0x260c('0x1bd')],_0x4ae3a3));}}return this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x1bf'),_0x5974ae[_0x260c('0x1bd')]));};AGIVertices[_0x260c('0x13')][_0x260c('0x1c0')]=function(_0x29a5c6){logger['info'](util[_0x260c('0x54')](_0x260c('0x1c1'),_0x29a5c6['label']));_0x29a5c6['text']=_0x29a5c6[_0x260c('0x5d')][_0x260c('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x29a5c6[_0x260c('0x5b')])){return this['channel'][_0x260c('0xac')](_0x260c('0x1c2'));}if(!this['isConfigured'](_0x29a5c6[_0x260c('0x5d')])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0xad'));}this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x1c3'),_0x29a5c6[_0x260c('0x5d')]));var _0x3e0267=this['googleCloudTTS'][_0x260c('0x73')](this,_0x29a5c6);if(_0x3e0267){this[_0x260c('0x10')]['noop'](util['format'](_0x260c('0x1c4'),_0x3e0267));var _0x29cab1=this['channel'][_0x260c('0x102')](_0x3e0267);try{fs[_0x260c('0x103')](_0x3e0267+_0x260c('0x104'));}catch(_0x25ff92){logger[_0x260c('0x2d')](_0x25ff92);}return _0x29cab1;}return this[_0x260c('0x10')]['error'](_0x29a5c6,_0x260c('0x1c5'));};AGIVertices[_0x260c('0x13')]['tts']=function(_0x5f27ea){logger[_0x260c('0x2f')](util['format'](_0x260c('0x1c6'),_0x5f27ea[_0x260c('0x38')]));_0x5f27ea[_0x260c('0x5d')]=_0x5f27ea[_0x260c('0x5d')][_0x260c('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x5f27ea[_0x260c('0x5d')])){return this[_0x260c('0x10')][_0x260c('0xac')](_0x260c('0xad'));}this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x1c7'),_0x5f27ea[_0x260c('0x5d')]));var _0x8f820c=this[_0x260c('0x62')][_0x260c('0x73')](this,_0x5f27ea);if(_0x8f820c){this['channel'][_0x260c('0xac')](util[_0x260c('0x54')]('Google\x20TTS\x20%s\x20file\x20created',_0x8f820c));var _0x58093b=this[_0x260c('0x10')][_0x260c('0x102')](_0x8f820c);try{fs['unlink'](_0x8f820c+_0x260c('0x104'));}catch(_0x52d0bd){logger[_0x260c('0x2d')](_0x52d0bd);}return _0x58093b;}return this[_0x260c('0x10')]['error'](_0x5f27ea,_0x260c('0x1c8'));};AGIVertices[_0x260c('0x13')][_0x260c('0x1c9')]=function(_0x5cbc3d){logger[_0x260c('0x2f')](util[_0x260c('0x54')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x5cbc3d['label']));if(!this['isConfigured'](_0x5cbc3d['findBy'])){return this[_0x260c('0x10')][_0x260c('0x2d')](_0x5cbc3d,_0x260c('0x156'));}logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x15e'),this[_0x260c('0x10')][_0x260c('0x3b')],_0x5cbc3d['findBy']));var _0x2ea47f=this['agentUnpause'][_0x260c('0x73')](this,_0x5cbc3d['findBy']);if(_0x2ea47f){logger['info'](util[_0x260c('0x54')](_0x260c('0x158'),this[_0x260c('0x10')]['callerid'],_0x5cbc3d['findBy']));this[_0x260c('0x10')][_0x260c('0xac')](util[_0x260c('0x54')](_0x260c('0x158'),this[_0x260c('0x10')]['callerid'],_0x5cbc3d['findBy']));return{'code':0xc8,'result':_0x260c('0x159')};}else{logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x15a'),this['channel'][_0x260c('0x3b')],_0x5cbc3d[_0x260c('0x157')]));this['channel']['noop'](util[_0x260c('0x54')](_0x260c('0x15a'),this[_0x260c('0x10')][_0x260c('0x3b')],_0x5cbc3d[_0x260c('0x157')]));return{'code':0xc8,'result':_0x260c('0x15b')};}};AGIVertices['prototype']['voicemail']=function(_0x50890c){logger[_0x260c('0x2f')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x50890c['label']));var _0x30cce4=this[_0x260c('0x10')]['exec'](_0x260c('0x1ca'),[_0x50890c[_0x260c('0x1cb')],_0x50890c[_0x260c('0x7b')]]);if(_0x30cce4[_0x260c('0xa7')]===-0x1){return _0x30cce4;}return this[_0x260c('0x10')][_0x260c('0xac')](util['format'](_0x260c('0x170'),_0x260c('0x1ca'),_0x50890c[_0x260c('0x1cb')]));};AGIVertices[_0x260c('0x13')][_0x260c('0x1cc')]=function(_0x1421cf){logger[_0x260c('0x2f')](util[_0x260c('0x54')](_0x260c('0x1cd'),_0x1421cf[_0x260c('0x38')]));if(!this[_0x260c('0x89')](_0x1421cf['variable_id'])){return this[_0x260c('0x10')][_0x260c('0x2d')](_0x1421cf,_0x260c('0x1a9'));}var _0x53b2ea=this[_0x260c('0x14')][_0x260c('0x73')](this,_0x1421cf[_0x260c('0xd6')]);if(!_0x53b2ea){return this['channel'][_0x260c('0x2d')](_0x1421cf,'no\x20variable\x20found');}var _0x15e639=this['channel'][_0x260c('0x14')](_0x53b2ea);return{'code':0xc8,'result':_0x15e639[_0x260c('0xa5')]?_0x15e639[_0x260c('0xa5')]:'-'};};String[_0x260c('0x13')][_0x260c('0xa4')]=function(_0x3ebca8,_0x44cf72){return this[_0x260c('0xa3')](_0x3ebca8)[_0x260c('0x1ce')](_0x44cf72);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 5d2ed19..2faff2a 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 _0x8085=['stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','attended','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','exports','lodash','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','lastPauseAt','timer','uniqueid','info','catch','error','[%s][UPDATE][ERRORS:%s]','startAcw','interface','mandatoryDisposition','mandatoryDispositionPause','name','resolve','getAgent','then','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','YYYY-MM-DD\x20HH:mm:ss','queue','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8085,0x71));var _0x5808=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x8085[_0x125ff8];return _0x2d9ef;};'use strict';var _=require(_0x5808('0x0'));var moment=require('moment');var ami=require('../ami');var logger=require(_0x5808('0x1'))(_0x5808('0x2'));var RpcUser=require(_0x5808('0x3'));var RpcVoiceAgentReport=require(_0x5808('0x4'));function Acw(_0x5565fd){this['voiceQueues']=_0x5565fd[_0x5808('0x5')];this[_0x5808('0x6')]=_0x5565fd['agents'];this[_0x5808('0x7')]=_0x5565fd[_0x5808('0x7')];this[_0x5808('0x8')]={};ami['on'](_0x5808('0x9'),this[_0x5808('0xa')][_0x5808('0xb')](this));ami['on'](_0x5808('0xc'),this[_0x5808('0xd')][_0x5808('0xb')](this));ami['on'](_0x5808('0xe'),this[_0x5808('0xf')][_0x5808('0xb')](this));ami['on'](_0x5808('0x10'),this[_0x5808('0x11')][_0x5808('0xb')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x5808('0xb')](this));ami['on'](_0x5808('0x12'),this[_0x5808('0x13')][_0x5808('0xb')](this));ami['on'](_0x5808('0x14'),this[_0x5808('0x15')][_0x5808('0xb')](this));}function getDiff(_0x5dbfdd){var _0x483af0=moment()[_0x5808('0x16')](0x0);var _0x19252b=moment(_0x5dbfdd)[_0x5808('0x16')](0x0);return _0x483af0[_0x5808('0x17')](_0x19252b,_0x5808('0x18'));}Acw[_0x5808('0x19')][_0x5808('0x1a')]=function(_0x2af9da,_0x1dda8d){var _0x46dd8a=this;var _0x29785d=getDiff(_0x46dd8a['timers'][_0x2af9da][_0x5808('0x1b')]);clearTimeout(_0x46dd8a['timers'][_0x2af9da][_0x5808('0x1c')]);_0x46dd8a[_0x5808('0x7')][_0x2af9da][_0x5808('0x1c')]=![];return RpcVoiceAgentReport['update']({'acwtime':_0x29785d},_0x46dd8a[_0x5808('0x7')][_0x2af9da][_0x5808('0x1d')],_0x2af9da)['then'](function(_0x5ecc95){logger[_0x5808('0x1e')]('[%s][UPDATE][ACWTIME:%s]',_0x1dda8d,_0x29785d,_0x5ecc95);})[_0x5808('0x1f')](function(_0x3c0937){logger[_0x5808('0x20')](_0x5808('0x21'),_0x1dda8d,_0x3c0937);})['finally'](function(){delete _0x46dd8a['timers'][_0x2af9da];});};Acw[_0x5808('0x19')][_0x5808('0x22')]=function(_0x2b82c5){try{var _0x39bca3=this;var _0x409337=this[_0x5808('0x8')][_0x2b82c5][_0x5808('0x23')];var _0xe4bf7f=this[_0x5808('0x8')][_0x2b82c5]['queue'];var _0x5b5175=this[_0x5808('0x5')][_0xe4bf7f];var _0x168a67=![];var _0x5048a1='ACW';if(_0x5b5175[_0x5808('0x24')]&&_0x5b5175[_0x5808('0x25')][_0x5808('0x26')]){_0x168a67=!![];_0x5048a1=_0x5b5175['mandatoryDispositionPause']['name'];}if(!_0x39bca3[_0x5808('0x6')][_0x409337]){return Promise[_0x5808('0x27')]();}return RpcUser[_0x5808('0x28')](_0x39bca3[_0x5808('0x6')][_0x409337]['id'])[_0x5808('0x29')](function(_0x507a82){if(!_0x507a82||_0x507a82[_0x5808('0x2a')]){logger[_0x5808('0x1e')](_0x5808('0x2b'),_0x2b82c5,_0x409337,_0xe4bf7f);return;}logger[_0x5808('0x1e')](_0x5808('0x2c'),_0x2b82c5,_0x409337,_0xe4bf7f);var _0x19ac63=_0x39bca3[_0x5808('0x8')][_0x2b82c5]['attended']&&_0x39bca3['channels'][_0x2b82c5][_0x5808('0x2d')]?_0x39bca3[_0x5808('0x8')][_0x2b82c5][_0x5808('0x2d')]:_0x2b82c5;return RpcUser['savePause'](_0x39bca3[_0x5808('0x6')][_0x409337],_0x5048a1,_0x19ac63);})[_0x5808('0x29')](function(_0x269810){if(_0x168a67||!_0x269810){return;}_0x39bca3[_0x5808('0x7')][_0x409337]={};logger[_0x5808('0x1e')](_0x5808('0x2e'),_0x2b82c5,_0x39bca3['voiceQueues'][_0xe4bf7f][_0x5808('0x2f')],_0x409337,_0xe4bf7f);_0x39bca3[_0x5808('0x7')][_0x409337][_0x5808('0x1c')]=setTimeout(_0x39bca3['stopAcw']['bind'](_0x39bca3,_0x409337),_0x39bca3[_0x5808('0x5')][_0xe4bf7f]['acwTimeout']*0x3e8);_0x39bca3[_0x5808('0x7')][_0x409337][_0x5808('0x1b')]=moment()['format'](_0x5808('0x30'));_0x39bca3[_0x5808('0x7')][_0x409337]['uniqueid']=_0x2b82c5;_0x39bca3['timers'][_0x409337][_0x5808('0x31')]=_0xe4bf7f;_0x39bca3['timers'][_0x409337][_0x5808('0x1a')]=_0x39bca3['updateAcw'][_0x5808('0xb')](_0x39bca3,_0x409337,_0x2b82c5);})[_0x5808('0x1f')](function(){logger[_0x5808('0x20')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2b82c5,_0x39bca3[_0x5808('0x5')][_0xe4bf7f]['acwTimeout'],_0x409337,_0xe4bf7f);})[_0x5808('0x32')](function(){delete _0x39bca3['channels'][_0x2b82c5];});}catch(_0x5361a5){logger[_0x5808('0x20')](_0x5808('0x33'),_0x5361a5[_0x5808('0x34')]);}};Acw['prototype']['stopAcw']=function(_0x243ce3){try{var _0x2aa211=this;if(_0x2aa211['timers'][_0x243ce3]){_0x2aa211[_0x5808('0x7')][_0x243ce3][_0x5808('0x1c')]=![];var _0x375458=_0x2aa211['timers'][_0x243ce3][_0x5808('0x1d')];var _0x44327d=_0x2aa211[_0x5808('0x7')][_0x243ce3]['queue'];var _0x40f433=_0x2aa211[_0x5808('0x5')][_0x44327d]['acwTimeout'];logger['info'](_0x5808('0x35'),_0x375458,_0x243ce3);RpcUser['saveUnpause'](this[_0x5808('0x6')][_0x243ce3]);RpcVoiceAgentReport[_0x5808('0x36')]({'acwtime':_0x40f433,'agentacw':!![]},_0x375458,_0x243ce3)[_0x5808('0x29')](function(_0x1009c2){logger[_0x5808('0x1e')]('[%s][UPDATE][ACWTIME:%s]',_0x375458,_0x40f433,_0x1009c2);})['catch'](function(_0xa9d887){logger[_0x5808('0x20')](_0x5808('0x21'),_0x375458,_0xa9d887);});}else{logger['error'](_0x5808('0x37'),_0x243ce3);if(_0x2aa211[_0x5808('0x7')]){logger[_0x5808('0x1e')](_0x5808('0x38'),JSON[_0x5808('0x39')](_0x2aa211['timers']));}}}catch(_0x1130c8){logger[_0x5808('0x20')](_0x5808('0x3a'),_0x1130c8['message']);}};Acw[_0x5808('0x19')][_0x5808('0xa')]=function(_0xc62608){try{if(this['voiceQueues'][_0xc62608['queue']]&&(this[_0x5808('0x5')][_0xc62608[_0x5808('0x31')]][_0x5808('0x2')]||this[_0x5808('0x5')][_0xc62608[_0x5808('0x31')]][_0x5808('0x24')])){if(this[_0x5808('0x6')][_0xc62608[_0x5808('0x23')]]){this[_0x5808('0x8')][_0xc62608[_0x5808('0x1d')]]={'queue':_0xc62608[_0x5808('0x31')],'interface':_0xc62608[_0x5808('0x23')],'destlinkedid':_0xc62608[_0x5808('0x2d')]};}}}catch(_0x55fe35){logger['error'](_0x5808('0x3b'),_0x55fe35[_0x5808('0x34')]);}};Acw[_0x5808('0x19')][_0x5808('0x15')]=function(_0x22352f){try{if(this[_0x5808('0x5')][_0x22352f[_0x5808('0x31')]]&&(this['voiceQueues'][_0x22352f[_0x5808('0x31')]]['acw']||this[_0x5808('0x5')][_0x22352f['queue']][_0x5808('0x24')])){if(this['agents'][_0x22352f['interface']]){this['channels'][_0x22352f[_0x5808('0x1d')]]={'queue':_0x22352f[_0x5808('0x31')],'interface':_0x22352f['interface']};}}}catch(_0x46c8ed){logger[_0x5808('0x20')](_0x5808('0x3c'),_0x46c8ed['message']);}};Acw[_0x5808('0x19')]['syncHangupRequest']=function(_0x175578){try{if(this[_0x5808('0x8')][_0x175578[_0x5808('0x1d')]]&&_['isUndefined'](this[_0x5808('0x8')][_0x175578[_0x5808('0x1d')]][_0x5808('0x3d')])){logger[_0x5808('0x1e')]('[%s][HANGUP:UNIQUEID]',_0x175578[_0x5808('0x1d')]);this[_0x5808('0x22')](_0x175578[_0x5808('0x1d')]);}else if(this[_0x5808('0x8')][_0x175578[_0x5808('0x3e')]]&&_[_0x5808('0x3f')](this['channels'][_0x175578[_0x5808('0x3e')]][_0x5808('0x3d')])){logger[_0x5808('0x1e')](_0x5808('0x40'),_0x175578[_0x5808('0x3e')]);this['startAcw'](_0x175578[_0x5808('0x3e')]);}}catch(_0x1063aa){logger[_0x5808('0x20')](_0x5808('0x41'),_0x1063aa[_0x5808('0x34')]);}};Acw[_0x5808('0x19')]['syncHangup']=function(_0x170b59){try{if(this['channels'][_0x170b59[_0x5808('0x1d')]]&&this[_0x5808('0x8')][_0x170b59['uniqueid']][_0x5808('0x3d')]){logger[_0x5808('0x1e')](_0x5808('0x42'),_0x170b59['uniqueid']);this[_0x5808('0x22')](_0x170b59[_0x5808('0x1d')]);}else if(this['channels'][_0x170b59[_0x5808('0x3e')]]&&this[_0x5808('0x8')][_0x170b59['linkedid']]['attended']){logger[_0x5808('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x170b59[_0x5808('0x3e')]);this['startAcw'](_0x170b59['linkedid']);}}catch(_0x158015){logger[_0x5808('0x20')](_0x5808('0x43'),_0x158015[_0x5808('0x34')]);}};Acw[_0x5808('0x19')][_0x5808('0x44')]=function(_0x41ebf0){try{if(!_[_0x5808('0x45')](this[_0x5808('0x8')][_0x41ebf0[_0x5808('0x46')]])){this['startAcw'](_0x41ebf0['transfereeuniqueid']);if(this['channels'][_0x41ebf0[_0x5808('0x47')]]){this[_0x5808('0x8')][_0x41ebf0['secondtransfereruniqueid']][_0x5808('0x3d')]=!![];this['channels'][_0x41ebf0[_0x5808('0x48')]]=this[_0x5808('0x8')][_0x41ebf0[_0x5808('0x47')]];delete this[_0x5808('0x8')][_0x41ebf0[_0x5808('0x47')]];}}else if(!_[_0x5808('0x45')](this[_0x5808('0x8')][_0x41ebf0[_0x5808('0x48')]])){this[_0x5808('0x22')](_0x41ebf0[_0x5808('0x48')]);if(this['channels'][_0x41ebf0[_0x5808('0x49')]]){this[_0x5808('0x8')][_0x41ebf0[_0x5808('0x49')]][_0x5808('0x3d')]=!![];this[_0x5808('0x8')][_0x41ebf0[_0x5808('0x46')]]=this['channels'][_0x41ebf0['origtransfereruniqueid']];delete this['channels'][_0x41ebf0[_0x5808('0x49')]];}}}catch(_0xf4045d){logger['error'](_0x5808('0x4a'),_0xf4045d[_0x5808('0x34')]);}};Acw[_0x5808('0x19')][_0x5808('0x13')]=function(_0x1cf783){try{if(this[_0x5808('0x8')][_0x1cf783['transfereruniqueid']]){logger['info'](_0x5808('0x4b'),JSON[_0x5808('0x39')](_0x1cf783[_0x5808('0x4c')]));this[_0x5808('0x22')](_0x1cf783[_0x5808('0x4c')]);}else if(this['channels'][_0x1cf783[_0x5808('0x4d')]]){logger[_0x5808('0x1e')](_0x5808('0x4e'),JSON[_0x5808('0x39')](_0x1cf783[_0x5808('0x4d')]));this['startAcw'](_0x1cf783[_0x5808('0x4d')]);}}catch(_0x383d36){logger[_0x5808('0x20')](_0x5808('0x4f'),_0x383d36[_0x5808('0x34')]);}};Acw[_0x5808('0x19')][_0x5808('0x11')]=function(_0x192eee){try{if(this[_0x5808('0x5')][_0x192eee[_0x5808('0x31')]]&&this[_0x5808('0x5')][_0x192eee['queue']]['autopause']===_0x5808('0x50')){if(this[_0x5808('0x6')][_0x192eee[_0x5808('0x23')]]){logger['info'](_0x5808('0x51'),_0x192eee[_0x5808('0x1d')],_0x192eee['interface'],_0x192eee[_0x5808('0x31')]);return RpcUser[_0x5808('0x52')](this['agents'][_0x192eee[_0x5808('0x23')]],_0x5808('0x53'),_0x192eee[_0x5808('0x1d')]);}}}catch(_0x2a3301){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x2a3301[_0x5808('0x34')]);}};module[_0x5808('0x54')]=Acw; \ No newline at end of file +var _0xc9c3=['voiceQueues','agents','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','diff','prototype','updateAcw','timer','timers','update','uniqueid','then','info','catch','error','[%s][UPDATE][ERRORS:%s]','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','resolve','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','finally','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','message','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[ACW][syncAgentRingNoAnswer]\x20%s','../ami','acw','../rpc/user','../rpc/voiceAgentReport'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc9c3,0x96));var _0x3c9c=function(_0x1699e3,_0x49d7a9){_0x1699e3=_0x1699e3-0x0;var _0x4721ed=_0xc9c3[_0x1699e3];return _0x4721ed;};'use strict';var _=require('lodash');var moment=require('moment');var ami=require(_0x3c9c('0x0'));var logger=require('../../../config/logger')(_0x3c9c('0x1'));var RpcUser=require(_0x3c9c('0x2'));var RpcVoiceAgentReport=require(_0x3c9c('0x3'));function Acw(_0x2ec103){this[_0x3c9c('0x4')]=_0x2ec103[_0x3c9c('0x4')];this[_0x3c9c('0x5')]=_0x2ec103['agents'];this['timers']=_0x2ec103['timers'];this[_0x3c9c('0x6')]={};ami['on'](_0x3c9c('0x7'),this[_0x3c9c('0x8')][_0x3c9c('0x9')](this));ami['on'](_0x3c9c('0xa'),this[_0x3c9c('0xb')][_0x3c9c('0x9')](this));ami['on'](_0x3c9c('0xc'),this[_0x3c9c('0xd')][_0x3c9c('0x9')](this));ami['on']('agentringnoanswer',this[_0x3c9c('0xe')][_0x3c9c('0x9')](this));ami['on']('attendedtransfer',this[_0x3c9c('0xf')]['bind'](this));ami['on'](_0x3c9c('0x10'),this[_0x3c9c('0x11')][_0x3c9c('0x9')](this));ami['on'](_0x3c9c('0x12'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x4a60d9){var _0x857b1f=moment()['milliseconds'](0x0);var _0x5e8c0e=moment(_0x4a60d9)['milliseconds'](0x0);return _0x857b1f[_0x3c9c('0x13')](_0x5e8c0e,'seconds');}Acw[_0x3c9c('0x14')][_0x3c9c('0x15')]=function(_0x1f725b,_0x824e63){var _0x4a43d2=this;var _0x265cc2=getDiff(_0x4a43d2['timers'][_0x1f725b]['lastPauseAt']);clearTimeout(_0x4a43d2['timers'][_0x1f725b][_0x3c9c('0x16')]);_0x4a43d2[_0x3c9c('0x17')][_0x1f725b][_0x3c9c('0x16')]=![];return RpcVoiceAgentReport[_0x3c9c('0x18')]({'acwtime':_0x265cc2},_0x4a43d2[_0x3c9c('0x17')][_0x1f725b][_0x3c9c('0x19')],_0x1f725b)[_0x3c9c('0x1a')](function(_0x56fa79){logger[_0x3c9c('0x1b')]('[%s][UPDATE][ACWTIME:%s]',_0x824e63,_0x265cc2,_0x56fa79);})[_0x3c9c('0x1c')](function(_0x5a8502){logger[_0x3c9c('0x1d')](_0x3c9c('0x1e'),_0x824e63,_0x5a8502);})['finally'](function(){delete _0x4a43d2[_0x3c9c('0x17')][_0x1f725b];});};Acw[_0x3c9c('0x14')][_0x3c9c('0x1f')]=function(_0x50359a){try{var _0x3faad1=this;var _0x249747=this[_0x3c9c('0x6')][_0x50359a][_0x3c9c('0x20')];var _0x99548e=this[_0x3c9c('0x6')][_0x50359a][_0x3c9c('0x21')];var _0x32e4c2=this['voiceQueues'][_0x99548e];var _0x6ed08a=![];var _0x4d58b9=_0x3c9c('0x22');if(_0x32e4c2[_0x3c9c('0x23')]&&_0x32e4c2['mandatoryDispositionPause']['name']){_0x6ed08a=!![];_0x4d58b9=_0x32e4c2[_0x3c9c('0x24')][_0x3c9c('0x25')];}if(!_0x3faad1[_0x3c9c('0x5')][_0x249747]){return Promise[_0x3c9c('0x26')]();}return RpcUser['getAgent'](_0x3faad1[_0x3c9c('0x5')][_0x249747]['id'])[_0x3c9c('0x1a')](function(_0x4f69ed){if(!_0x4f69ed||_0x4f69ed[_0x3c9c('0x27')]){logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x50359a,_0x249747,_0x99548e);return;}logger[_0x3c9c('0x1b')](_0x3c9c('0x28'),_0x50359a,_0x249747,_0x99548e);var _0x333f2b=_0x3faad1[_0x3c9c('0x6')][_0x50359a][_0x3c9c('0x29')]&&_0x3faad1['channels'][_0x50359a][_0x3c9c('0x2a')]?_0x3faad1['channels'][_0x50359a][_0x3c9c('0x2a')]:_0x50359a;return RpcUser[_0x3c9c('0x2b')](_0x3faad1[_0x3c9c('0x5')][_0x249747],_0x4d58b9,_0x333f2b);})[_0x3c9c('0x1a')](function(_0x5793c1){if(_0x6ed08a||!_0x5793c1){return;}_0x3faad1[_0x3c9c('0x17')][_0x249747]={};logger[_0x3c9c('0x1b')](_0x3c9c('0x2c'),_0x50359a,_0x3faad1[_0x3c9c('0x4')][_0x99548e][_0x3c9c('0x2d')],_0x249747,_0x99548e);_0x3faad1[_0x3c9c('0x17')][_0x249747][_0x3c9c('0x16')]=setTimeout(_0x3faad1[_0x3c9c('0x2e')]['bind'](_0x3faad1,_0x249747),_0x3faad1[_0x3c9c('0x4')][_0x99548e][_0x3c9c('0x2d')]*0x3e8);_0x3faad1[_0x3c9c('0x17')][_0x249747][_0x3c9c('0x2f')]=moment()[_0x3c9c('0x30')](_0x3c9c('0x31'));_0x3faad1[_0x3c9c('0x17')][_0x249747][_0x3c9c('0x19')]=_0x50359a;_0x3faad1[_0x3c9c('0x17')][_0x249747][_0x3c9c('0x21')]=_0x99548e;_0x3faad1[_0x3c9c('0x17')][_0x249747][_0x3c9c('0x15')]=_0x3faad1[_0x3c9c('0x15')][_0x3c9c('0x9')](_0x3faad1,_0x249747,_0x50359a);})['catch'](function(){logger[_0x3c9c('0x1d')](_0x3c9c('0x2c'),_0x50359a,_0x3faad1[_0x3c9c('0x4')][_0x99548e]['acwTimeout'],_0x249747,_0x99548e);})[_0x3c9c('0x32')](function(){delete _0x3faad1[_0x3c9c('0x6')][_0x50359a];});}catch(_0x328441){logger[_0x3c9c('0x1d')]('[ACW][START]\x20%s',_0x328441['message']);}};Acw[_0x3c9c('0x14')][_0x3c9c('0x2e')]=function(_0x42d7cf){try{var _0x5a42bc=this;if(_0x5a42bc['timers'][_0x42d7cf]){_0x5a42bc[_0x3c9c('0x17')][_0x42d7cf]['timer']=![];var _0x5ace8e=_0x5a42bc[_0x3c9c('0x17')][_0x42d7cf][_0x3c9c('0x19')];var _0x228c3c=_0x5a42bc['timers'][_0x42d7cf][_0x3c9c('0x21')];var _0xe66d35=_0x5a42bc[_0x3c9c('0x4')][_0x228c3c]['acwTimeout'];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x5ace8e,_0x42d7cf);RpcUser[_0x3c9c('0x33')](this[_0x3c9c('0x5')][_0x42d7cf]);RpcVoiceAgentReport[_0x3c9c('0x18')]({'acwtime':_0xe66d35,'agentacw':!![]},_0x5ace8e,_0x42d7cf)[_0x3c9c('0x1a')](function(_0x1a2d31){logger[_0x3c9c('0x1b')]('[%s][UPDATE][ACWTIME:%s]',_0x5ace8e,_0xe66d35,_0x1a2d31);})['catch'](function(_0xf71de8){logger[_0x3c9c('0x1d')](_0x3c9c('0x1e'),_0x5ace8e,_0xf71de8);});}else{logger['error'](_0x3c9c('0x34'),_0x42d7cf);if(_0x5a42bc[_0x3c9c('0x17')]){logger[_0x3c9c('0x1b')]('[ACW][TIMERS]',JSON['stringify'](_0x5a42bc[_0x3c9c('0x17')]));}}}catch(_0xdbac2a){logger[_0x3c9c('0x1d')]('[ACW][STOP]\x20%s',_0xdbac2a[_0x3c9c('0x35')]);}};Acw[_0x3c9c('0x14')][_0x3c9c('0x8')]=function(_0x3dbfc7){try{if(this['voiceQueues'][_0x3dbfc7[_0x3c9c('0x21')]]&&(this[_0x3c9c('0x4')][_0x3dbfc7['queue']]['acw']||this[_0x3c9c('0x4')][_0x3dbfc7[_0x3c9c('0x21')]]['mandatoryDisposition'])){if(this[_0x3c9c('0x5')][_0x3dbfc7[_0x3c9c('0x20')]]){this[_0x3c9c('0x6')][_0x3dbfc7[_0x3c9c('0x19')]]={'queue':_0x3dbfc7[_0x3c9c('0x21')],'interface':_0x3dbfc7[_0x3c9c('0x20')],'destlinkedid':_0x3dbfc7['destlinkedid']};}}}catch(_0x22d892){logger[_0x3c9c('0x1d')](_0x3c9c('0x36'),_0x22d892[_0x3c9c('0x35')]);}};Acw[_0x3c9c('0x14')]['syncAgentConnectPreview']=function(_0x5ef2be){try{if(this[_0x3c9c('0x4')][_0x5ef2be[_0x3c9c('0x21')]]&&(this[_0x3c9c('0x4')][_0x5ef2be[_0x3c9c('0x21')]][_0x3c9c('0x1')]||this['voiceQueues'][_0x5ef2be[_0x3c9c('0x21')]][_0x3c9c('0x23')])){if(this[_0x3c9c('0x5')][_0x5ef2be[_0x3c9c('0x20')]]){this[_0x3c9c('0x6')][_0x5ef2be['uniqueid']]={'queue':_0x5ef2be[_0x3c9c('0x21')],'interface':_0x5ef2be[_0x3c9c('0x20')]};}}}catch(_0x1804e3){logger[_0x3c9c('0x1d')](_0x3c9c('0x37'),_0x1804e3[_0x3c9c('0x35')]);}};Acw[_0x3c9c('0x14')]['syncHangupRequest']=function(_0x260d3b){try{if(this[_0x3c9c('0x6')][_0x260d3b[_0x3c9c('0x19')]]&&_[_0x3c9c('0x38')](this[_0x3c9c('0x6')][_0x260d3b[_0x3c9c('0x19')]]['attended'])){logger[_0x3c9c('0x1b')](_0x3c9c('0x39'),_0x260d3b[_0x3c9c('0x19')]);this[_0x3c9c('0x1f')](_0x260d3b[_0x3c9c('0x19')]);}else if(this[_0x3c9c('0x6')][_0x260d3b[_0x3c9c('0x3a')]]&&_[_0x3c9c('0x38')](this[_0x3c9c('0x6')][_0x260d3b[_0x3c9c('0x3a')]][_0x3c9c('0x29')])){logger[_0x3c9c('0x1b')](_0x3c9c('0x3b'),_0x260d3b[_0x3c9c('0x3a')]);this[_0x3c9c('0x1f')](_0x260d3b[_0x3c9c('0x3a')]);}}catch(_0x4ed837){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x4ed837[_0x3c9c('0x35')]);}};Acw[_0x3c9c('0x14')][_0x3c9c('0xd')]=function(_0x20c090){try{if(this['channels'][_0x20c090[_0x3c9c('0x19')]]&&this['channels'][_0x20c090['uniqueid']][_0x3c9c('0x29')]){logger[_0x3c9c('0x1b')](_0x3c9c('0x3c'),_0x20c090[_0x3c9c('0x19')]);this[_0x3c9c('0x1f')](_0x20c090[_0x3c9c('0x19')]);}else if(this[_0x3c9c('0x6')][_0x20c090[_0x3c9c('0x3a')]]&&this[_0x3c9c('0x6')][_0x20c090['linkedid']][_0x3c9c('0x29')]){logger[_0x3c9c('0x1b')](_0x3c9c('0x3d'),_0x20c090[_0x3c9c('0x3a')]);this[_0x3c9c('0x1f')](_0x20c090[_0x3c9c('0x3a')]);}}catch(_0x356e9d){logger['error']('[ACW][syncHangup]\x20%s',_0x356e9d[_0x3c9c('0x35')]);}};Acw[_0x3c9c('0x14')][_0x3c9c('0xf')]=function(_0x7eccd0){try{if(!_[_0x3c9c('0x3e')](this[_0x3c9c('0x6')][_0x7eccd0[_0x3c9c('0x3f')]])){this[_0x3c9c('0x1f')](_0x7eccd0[_0x3c9c('0x3f')]);if(this[_0x3c9c('0x6')][_0x7eccd0[_0x3c9c('0x40')]]){this[_0x3c9c('0x6')][_0x7eccd0[_0x3c9c('0x40')]][_0x3c9c('0x29')]=!![];this['channels'][_0x7eccd0[_0x3c9c('0x41')]]=this[_0x3c9c('0x6')][_0x7eccd0[_0x3c9c('0x40')]];delete this[_0x3c9c('0x6')][_0x7eccd0[_0x3c9c('0x40')]];}}else if(!_['isNil'](this[_0x3c9c('0x6')][_0x7eccd0[_0x3c9c('0x41')]])){this['startAcw'](_0x7eccd0['transfertargetuniqueid']);if(this[_0x3c9c('0x6')][_0x7eccd0[_0x3c9c('0x42')]]){this['channels'][_0x7eccd0[_0x3c9c('0x42')]][_0x3c9c('0x29')]=!![];this[_0x3c9c('0x6')][_0x7eccd0[_0x3c9c('0x3f')]]=this[_0x3c9c('0x6')][_0x7eccd0[_0x3c9c('0x42')]];delete this[_0x3c9c('0x6')][_0x7eccd0[_0x3c9c('0x42')]];}}}catch(_0x114598){logger[_0x3c9c('0x1d')](_0x3c9c('0x43'),_0x114598['message']);}};Acw[_0x3c9c('0x14')]['syncBlindTransfer']=function(_0x4c63fc){try{if(this[_0x3c9c('0x6')][_0x4c63fc[_0x3c9c('0x44')]]){logger[_0x3c9c('0x1b')](_0x3c9c('0x45'),JSON[_0x3c9c('0x46')](_0x4c63fc[_0x3c9c('0x44')]));this[_0x3c9c('0x1f')](_0x4c63fc['transfereruniqueid']);}else if(this[_0x3c9c('0x6')][_0x4c63fc[_0x3c9c('0x47')]]){logger[_0x3c9c('0x1b')](_0x3c9c('0x48'),JSON[_0x3c9c('0x46')](_0x4c63fc['transfererlinkedid']));this['startAcw'](_0x4c63fc[_0x3c9c('0x47')]);}}catch(_0xe3249f){logger[_0x3c9c('0x1d')](_0x3c9c('0x49'),_0xe3249f[_0x3c9c('0x35')]);}};Acw[_0x3c9c('0x14')][_0x3c9c('0xe')]=function(_0x37946d){try{if(this[_0x3c9c('0x4')][_0x37946d[_0x3c9c('0x21')]]&&this[_0x3c9c('0x4')][_0x37946d[_0x3c9c('0x21')]][_0x3c9c('0x4a')]===_0x3c9c('0x4b')){if(this[_0x3c9c('0x5')][_0x37946d[_0x3c9c('0x20')]]){logger[_0x3c9c('0x1b')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x37946d[_0x3c9c('0x19')],_0x37946d['interface'],_0x37946d['queue']);return RpcUser[_0x3c9c('0x2b')](this[_0x3c9c('0x5')][_0x37946d[_0x3c9c('0x20')]],'Auto-Pause',_0x37946d[_0x3c9c('0x19')]);}}}catch(_0x237c12){logger['error'](_0x3c9c('0x4c'),_0x237c12[_0x3c9c('0x35')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 84e8121..bd8d721 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 _0xb2ed=['actionSipShowRegistry','sipshowregistry','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','port','username','asterisk','password','keepConnected','Action','promisify','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0xb2ed,0x98));var _0xdb2e=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0xb2ed[_0x28669c];return _0x4a3af6;};'use strict';var Manager=require(_0xdb2e('0x0'));var BPromise=require(_0xdb2e('0x1'));var util=require('util');var logger=require(_0xdb2e('0x2'))('ami');var config=require('../../config/environment');var ami=new Manager(config['asterisk'][_0xdb2e('0x3')],config['asterisk']['ip'],config['asterisk'][_0xdb2e('0x4')],config[_0xdb2e('0x5')][_0xdb2e('0x6')],!![]);ami[_0xdb2e('0x7')]();ami[_0xdb2e('0x8')]=BPromise[_0xdb2e('0x9')](ami['action']);function error(_0x440de1){logger['error'](util[_0xdb2e('0xa')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xdb2e('0x5')][_0xdb2e('0x4')],config[_0xdb2e('0x5')]['ip'],config[_0xdb2e('0x5')][_0xdb2e('0x3')],util['inspect'](_0x440de1,![],null)));}function close(){logger[_0xdb2e('0xb')](util[_0xdb2e('0xa')](_0xdb2e('0xc'),config['asterisk'][_0xdb2e('0x4')],config['asterisk']['ip'],config['asterisk'][_0xdb2e('0x3')]));}ami[_0xdb2e('0xd')]=function(){return function(){return ami[_0xdb2e('0x8')]({'action':_0xdb2e('0xe')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xdb2e('0x8')]({'action':'devicestatelist'});};};ami[_0xdb2e('0xf')]=function(){return function(){return ami[_0xdb2e('0x8')]({'action':'sippeerstatus'});};};ami[_0xdb2e('0x10')]=function(){return function(){return ami['Action']({'action':_0xdb2e('0x11')});};};ami[_0xdb2e('0x12')]=function(){return function(){return ami[_0xdb2e('0x8')]({'action':'coreshowchannels'});};};function connect(){logger[_0xdb2e('0x13')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xdb2e('0x5')][_0xdb2e('0x4')],config[_0xdb2e('0x5')]['ip'],config[_0xdb2e('0x5')][_0xdb2e('0x3')]));ami[_0xdb2e('0x14')](_0xdb2e('0xb'),error);ami[_0xdb2e('0x14')](_0xdb2e('0x15'),close);}ami['on']('connect',connect);ami['on'](_0xdb2e('0x16'),function(_0x3477da){logger[_0xdb2e('0x13')](util[_0xdb2e('0xa')](_0xdb2e('0x17'),config[_0xdb2e('0x5')][_0xdb2e('0x4')],config[_0xdb2e('0x5')]['ip'],config[_0xdb2e('0x5')][_0xdb2e('0x3')],util[_0xdb2e('0x18')](_0x3477da,![],null)));});ami['on'](_0xdb2e('0x19'),function(){logger[_0xdb2e('0x13')](util[_0xdb2e('0xa')](_0xdb2e('0x1a'),config['asterisk']['username'],config[_0xdb2e('0x5')]['ip'],config[_0xdb2e('0x5')][_0xdb2e('0x3')]));return Promise[_0xdb2e('0x1b')]()[_0xdb2e('0x1c')](ami[_0xdb2e('0xd')]())[_0xdb2e('0x1c')](ami[_0xdb2e('0x1d')]())['then'](ami[_0xdb2e('0xf')]())['then'](ami['actionQueueSummary']())[_0xdb2e('0x1c')](ami[_0xdb2e('0x12')]())[_0xdb2e('0x1e')](function(_0x3923cb){logger[_0xdb2e('0xb')](_0xdb2e('0x1f'),util[_0xdb2e('0x18')](_0x3923cb,{'showHidden':![],'depth':null}));});});ami['once'](_0xdb2e('0xb'),error);ami['once'](_0xdb2e('0x15'),close);module[_0xdb2e('0x20')]=ami; \ No newline at end of file +var _0xac03=['exports','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','password','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','username','once','close','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionDeviceStateList','actionCoreShowChannels','[ami.js][fullybooted]'];(function(_0x3312ca,_0xb487b6){var _0x16532a=function(_0x10831d){while(--_0x10831d){_0x3312ca['push'](_0x3312ca['shift']());}};_0x16532a(++_0xb487b6);}(_0xac03,0x198));var _0x3ac0=function(_0x148dda,_0x9200a1){_0x148dda=_0x148dda-0x0;var _0x4b0bc9=_0xac03[_0x148dda];return _0x4b0bc9;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x3ac0('0x0'));var util=require(_0x3ac0('0x1'));var logger=require(_0x3ac0('0x2'))(_0x3ac0('0x3'));var config=require(_0x3ac0('0x4'));var ami=new Manager(config[_0x3ac0('0x5')]['port'],config[_0x3ac0('0x5')]['ip'],config[_0x3ac0('0x5')]['username'],config[_0x3ac0('0x5')][_0x3ac0('0x6')],!![]);ami[_0x3ac0('0x7')]();ami[_0x3ac0('0x8')]=BPromise[_0x3ac0('0x9')](ami[_0x3ac0('0xa')]);function error(_0x576772){logger[_0x3ac0('0xb')](util[_0x3ac0('0xc')](_0x3ac0('0xd'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x3ac0('0x5')][_0x3ac0('0xe')],util[_0x3ac0('0xf')](_0x576772,![],null)));}function close(){logger[_0x3ac0('0xb')](util[_0x3ac0('0xc')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x3ac0('0x5')]['username'],config[_0x3ac0('0x5')]['ip'],config['asterisk'][_0x3ac0('0xe')]));}ami[_0x3ac0('0x10')]=function(){return function(){return ami[_0x3ac0('0x8')]({'action':_0x3ac0('0x11')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x3ac0('0x8')]({'action':_0x3ac0('0x12')});};};ami[_0x3ac0('0x13')]=function(){return function(){return ami[_0x3ac0('0x8')]({'action':_0x3ac0('0x14')});};};ami[_0x3ac0('0x15')]=function(){return function(){return ami[_0x3ac0('0x8')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x3ac0('0x8')]({'action':_0x3ac0('0x16')});};};function connect(){logger[_0x3ac0('0x17')](util[_0x3ac0('0xc')](_0x3ac0('0x18'),config['asterisk'][_0x3ac0('0x19')],config['asterisk']['ip'],config[_0x3ac0('0x5')]['port']));ami[_0x3ac0('0x1a')](_0x3ac0('0xb'),error);ami[_0x3ac0('0x1a')](_0x3ac0('0x1b'),close);}ami['on'](_0x3ac0('0x1c'),connect);ami['on'](_0x3ac0('0x1d'),function(_0x32a47f){logger[_0x3ac0('0x17')](util[_0x3ac0('0xc')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x3ac0('0x5')]['username'],config['asterisk']['ip'],config[_0x3ac0('0x5')]['port'],util[_0x3ac0('0xf')](_0x32a47f,![],null)));});ami['on'](_0x3ac0('0x1e'),function(){logger[_0x3ac0('0x17')](util['format'](_0x3ac0('0x1f'),config[_0x3ac0('0x5')][_0x3ac0('0x19')],config[_0x3ac0('0x5')]['ip'],config[_0x3ac0('0x5')][_0x3ac0('0xe')]));return Promise['resolve']()[_0x3ac0('0x20')](ami[_0x3ac0('0x10')]())[_0x3ac0('0x20')](ami[_0x3ac0('0x21')]())[_0x3ac0('0x20')](ami[_0x3ac0('0x13')]())['then'](ami[_0x3ac0('0x15')]())[_0x3ac0('0x20')](ami[_0x3ac0('0x22')]())['catch'](function(_0x436636){logger[_0x3ac0('0xb')](_0x3ac0('0x23'),util[_0x3ac0('0xf')](_0x436636,{'showHidden':![],'depth':null}));});});ami[_0x3ac0('0x1a')](_0x3ac0('0xb'),error);ami[_0x3ac0('0x1a')](_0x3ac0('0x1b'),close);module[_0x3ac0('0x24')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index ac68de9..2b67039 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 _0xf4eb=['rpc','error','message','result','exports','jayson/promise','http','request','then','debug','memberReport'];(function(_0x30fc17,_0x43b50f){var _0x38ec11=function(_0x2e5079){while(--_0x2e5079){_0x30fc17['push'](_0x30fc17['shift']());}};_0x38ec11(++_0x43b50f);}(_0xf4eb,0xec));var _0xbf4e=function(_0x534ba5,_0x445bc2){_0x534ba5=_0x534ba5-0x0;var _0x4b32c7=_0xf4eb[_0x534ba5];return _0x4b32c7;};'use strict';var jayson=require(_0xbf4e('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('ami');var client=jayson['client'][_0xbf4e('0x1')]({'port':0x2329});client['Request']=function(_0x4e7fa7,_0x2e3070){return new BPromise(function(_0x1c7606,_0x32d1d7){return client[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070)[_0xbf4e('0x3')](function(_0x2fcfed){logger[_0xbf4e('0x4')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x2e3070,_0x2fcfed);if(_0x2fcfed['error']){logger['error'](_0xbf4e('0x6'),_0xbf4e('0x5'),_0x4e7fa7,_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')],_0x2e3070);return _0x32d1d7(_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')]);}else{return _0x1c7606(_0x2fcfed[_0xbf4e('0x9')]);}})['catch'](function(_0x4d9a07){logger[_0xbf4e('0x7')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x4d9a07,_0x2e3070);return _0x32d1d7(_0x4d9a07);});});};module[_0xbf4e('0xa')]=client; \ No newline at end of file +var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x26a906,_0x3d135c){var _0x495575=function(_0x2365af){while(--_0x2365af){_0x26a906['push'](_0x26a906['shift']());}};_0x495575(++_0x3d135c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xb7e7[_0x186376];return _0x2dbdd9;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 498a774..4f9057e 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 _0x1c0c=['rrmemory','roundrobin','isNil','locked','status','stateinterface','idHopper','paused','run','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','pick','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','responsetime','getQueue','response','Success','[callProgressDetecting]\x20','syncVarSet','variable','exten','value','HANGUP','outboundAnswerAgiCallsDay','membername','emit','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD]','dialAMDActive','MACHINE','AMD','countmachineretry','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','HangupInAMD','[syncHangupInAMDIvr][createHistory]','Machine','countbusyretry','countnosuchnumberretry','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','resolve','available','talking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','length','map','user:%s','user:dialPreviewRecallReminder','[actions]','clearZombieChannels','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','checkPreviewRecallReminder','Agent','handleIvr','object','originate','voiceQueue\x20is\x20undefine','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','dialQueueOptions','dialQueueTimeout','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-CAMPAIGNID','setXMDContactVariables','Contact','Trunk','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerId','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','checkRetriveMax','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','erlangCalls','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','dialPredictiveInterval','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','milliseconds','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','emptyContact','checkIsBlackListIvr','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','getContactDialer','countReScheduled','[countReScheduled]\x20','RUNNING','[actionOriginate]\x20','checkIsBlackList','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','not_inuse','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','ivrOriginated','queueBooked','queuesSummary','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','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','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','merge','startProgressive','startProgressive\x20value\x20cleared','startPredictive','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','message','CAMPAIGN_STATUS','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','Error','stringify','active','SIP/%s','reachable','unmonitored','isTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','Action','command','indexOf','true','catch','push','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','undefined','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','power','handlePower','dialPowerLevel','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','[ifTime][promiseAll]','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','[ifTime][Action]','queue','uniqueId','uniqueid','ivr','updateOriginated','syncAgentComplete','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','getSeconds','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','verifyAdditionalPhones','dialAbandonedMaxRetry','rescheduleContact','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actions','channel','actionid','strategy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1c0c,0x133));var _0xc1c0=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x1c0c[_0xf0bcac];return _0x4e4c65;};'use strict';var util=require(_0xc1c0('0x0'));var _=require(_0xc1c0('0x1'));var uuid=require(_0xc1c0('0x2'));var moment=require(_0xc1c0('0x3'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0xc1c0('0x4'));var hopperUtils=require('./utils/hopper');var ut=require(_0xc1c0('0x5'));var config=require(_0xc1c0('0x6'));var logger=require(_0xc1c0('0x7'))(_0xc1c0('0x8'));var loggerBooked=require(_0xc1c0('0x7'))(_0xc1c0('0x9'));var loggerPredictive=require('../../../config/logger')(_0xc1c0('0xa'));var loggerPredictiveCalls=require('../../../config/logger')(_0xc1c0('0xb'));var loggerSyncQueueSummary=require(_0xc1c0('0x7'))(_0xc1c0('0xc'));var ami=require(_0xc1c0('0xd'));config[_0xc1c0('0xe')]=_[_0xc1c0('0xf')](config[_0xc1c0('0xe')],{'host':_0xc1c0('0x10'),'port':0x18eb});var io=require(_0xc1c0('0x11'))(new Redis(config[_0xc1c0('0xe')]));var cmHopper=require(_0xc1c0('0x12'));var voiceQueueRt=require(_0xc1c0('0x13'));var RpcSetting=require(_0xc1c0('0x14'));var Interval=require(_0xc1c0('0x15'));var Action=require(_0xc1c0('0x16'));var History=require(_0xc1c0('0x17'));var Final=require('./models/final');var AgentComplete=require(_0xc1c0('0x18'));var QueueCallerAbandon=require(_0xc1c0('0x19'));var Hangup=require(_0xc1c0('0x1a'));var ipAgi=process['env'][_0xc1c0('0x1b')]||_0xc1c0('0x1c');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xc1c0('0x1d')]['enqueue']=function(_0x4d903b){this[_0xc1c0('0x1e')]=this[_0xc1c0('0x1e')]?this['tail'][_0xc1c0('0x1f')](_0x4d903b):_0x4d903b();};function Dialer(_0x161761,_0x22ab07){this[_0xc1c0('0x20')]=new Sequence();this[_0xc1c0('0x21')]=_0x22ab07;this[_0xc1c0('0x22')]=_0x161761['voiceQueues'];this['campaigns']=_0x161761[_0xc1c0('0x23')];this[_0xc1c0('0x24')]=_0x161761[_0xc1c0('0x24')];this[_0xc1c0('0x25')]=_0x161761['trunks'];this['maxNumberOriginate']=config[_0xc1c0('0x26')]||0x2;this[_0xc1c0('0x27')]={};this['actions']={};this[_0xc1c0('0x28')]={};this['uniqueId']={};this['optionPredictive']={};this['startPredictive']={};this['startProgressive']={};this[_0xc1c0('0x29')]={};this[_0xc1c0('0x2a')]={};this['queueBookedRR']={};this[_0xc1c0('0x2b')]={};ami['on']('agentconnect',this[_0xc1c0('0x2c')][_0xc1c0('0x2d')](this));ami['on']('queuecallerabandon',this[_0xc1c0('0x2e')][_0xc1c0('0x2d')](this));ami['on'](_0xc1c0('0x2f'),this[_0xc1c0('0x30')][_0xc1c0('0x2d')](this));ami['on'](_0xc1c0('0x31'),this['syncAgentComplete'][_0xc1c0('0x2d')](this));ami['on'](_0xc1c0('0x32'),this['syncQueueSummary'][_0xc1c0('0x2d')](this));ami['on']('custom:queuesummarycomplete',this[_0xc1c0('0x33')]['bind'](this));ami['on'](_0xc1c0('0x34'),this[_0xc1c0('0x35')][_0xc1c0('0x2d')](this));ami['on'](_0xc1c0('0x36'),this[_0xc1c0('0x37')][_0xc1c0('0x2d')](this));ami['on'](_0xc1c0('0x38'),this['syncVarSet']['bind'](this));ami['on'](_0xc1c0('0x39'),this[_0xc1c0('0x3a')][_0xc1c0('0x2d')](this));ami['on'](_0xc1c0('0x3b'),this[_0xc1c0('0x3c')][_0xc1c0('0x2d')](this));this['loopCampaigns']();this[_0xc1c0('0x3d')]();RpcSetting[_0xc1c0('0x3e')]()[_0xc1c0('0x3f')](function(_0x16f055){previewRecallmeReminderInterval=_0x16f055['previewRecallmeReminderInterval'];});}function isNotNull(_0x602d9a){return _0x602d9a!==null&&!_['isUndefined'](_0x602d9a);}function msgResponse(_0x3f4b4b,_0x1d63b1,_0x206d83){return{'action':_0x3f4b4b,'response':_0x1d63b1,'message':_0x206d83,'stack':_0x206d83};}function emit(_0x114ac8,_0x3c4234,_0x2794db){io['to'](_0x114ac8)['emit'](_0x3c4234,_0x2794db);}function emitOutboundVoiceQueueSummary(_0x317bab){if(_0x317bab[_0xc1c0('0x40')]===_0xc1c0('0x41')){logger[_0xc1c0('0x42')](_0xc1c0('0x43'),util[_0xc1c0('0x44')](_0x317bab,{'showHidden':![],'depth':null}));emit(util[_0xc1c0('0x45')](_0xc1c0('0x46'),_0x317bab[_0xc1c0('0x47')]),_0xc1c0('0x48'),_0x317bab);}}function checkGetDataPredictive(_0x41553a){if(isNotNull(_0x41553a)&&!_['isEmpty'](_0x41553a)){loggerPredictive[_0xc1c0('0x49')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x4a'),_0x41553a[_0xc1c0('0x4b')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x41553a[_0xc1c0('0x4c')]);loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x4d'),_0x41553a[_0xc1c0('0x4e')]);loggerPredictive['info'](_0xc1c0('0x4f'),_0x41553a[_0xc1c0('0x50')]);loggerPredictive[_0xc1c0('0x49')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x41553a[_0xc1c0('0x51')]);loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x52'),_0x41553a[_0xc1c0('0x53')]);loggerPredictive['info'](_0xc1c0('0x54'));if(_0x41553a[_0xc1c0('0x4b')]>0x0){if(!_[_0xc1c0('0x55')](_0x41553a['predictiveIntervalAvgTalktime'])&&_0x41553a[_0xc1c0('0x53')]>0x0){return!![];}loggerPredictive['info'](_0xc1c0('0x56'));if(!_['isUndefined'](_0x41553a[_0xc1c0('0x51')])&&_0x41553a[_0xc1c0('0x51')]>0x0){return!![];}loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x57'));}else{loggerPredictive['info'](_0xc1c0('0x58'));}}else{loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x59'));}return![];}function mergeDataErlangB(_0x4fa027){return function(_0xe1104c){loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x5a'));loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x5b'),_0xe1104c['erlangCalls']);loggerPredictive['info'](_0xc1c0('0x5c'),_0xe1104c[_0xc1c0('0x5d')]);loggerPredictive['info'](_0xc1c0('0x5e'),_0xe1104c[_0xc1c0('0x5f')]);loggerPredictive[_0xc1c0('0x49')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xe1104c[_0xc1c0('0x60')]);loggerPredictive[_0xc1c0('0x49')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xe1104c[_0xc1c0('0x5f')]);loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x54'));_[_0xc1c0('0x61')](_0x4fa027,_0xe1104c);};}function ifInterval(_0x42986b,_0x26cd87){if(_[_0xc1c0('0x55')](_0x26cd87)){return![];}return utils['getSeconds'](undefined,_0x26cd87)<_0x42986b*0x3c;}function clearPredictiveAttributes(_0x5883fa){if(_0x5883fa[_0xc1c0('0x62')]){_0x5883fa[_0xc1c0('0x62')]=undefined;loggerPredictive[_0xc1c0('0x42')](_0x5883fa[_0xc1c0('0x47')],_0xc1c0('0x63'));}if(_0x5883fa['startPredictive']){_0x5883fa[_0xc1c0('0x64')]=undefined;loggerPredictive[_0xc1c0('0x42')](_0x5883fa[_0xc1c0('0x47')],_0xc1c0('0x65'));}if(_0x5883fa[_0xc1c0('0x66')]){clearInterval(_0x5883fa[_0xc1c0('0x66')]);_0x5883fa[_0xc1c0('0x66')]=undefined;loggerPredictive[_0xc1c0('0x42')](_0x5883fa['name'],_0xc1c0('0x67'));}}function loggerCatchPredictive(_0x597533,_0x34fa00){return function(_0x1e7779){loggerPredictive[_0xc1c0('0x68')](_0x34fa00[_0xc1c0('0x47')],_0x597533);loggerPredictive[_0xc1c0('0x68')](_0x1e7779[_0xc1c0('0x69')]);clearPredictiveAttributes(_0x34fa00);};}function loggerCatch(_0x9d330c){return function(_0xd05727){logger[_0xc1c0('0x68')](_0x9d330c,util[_0xc1c0('0x44')](_0xd05727,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x490a99,_0x5aa2e3,_0xb461ad){return function(_0x1dba3b){utils[_0xc1c0('0x6a')](_0x5aa2e3,_0xb461ad,0x0);_0x5aa2e3[_0xc1c0('0x6b')]=0x0;logger[_0xc1c0('0x68')](_0x490a99,util['inspect'](_0x1dba3b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x18f32c){return function(_0x24b8cc){if(isNotNull(_0x24b8cc)&&isNotNull(_0x24b8cc[0x0])){if(_0x24b8cc[0x0][_0xc1c0('0x6c')]>0x0){_0x18f32c['message']=utils['CAMPAIGN_STATUS'][_0xc1c0('0x6d')];logger[_0xc1c0('0x49')](_0xc1c0('0x6e')+_0x18f32c[_0xc1c0('0x47')],_0x24b8cc[0x0][_0xc1c0('0x6c')],'contacts');}else{_0x18f32c[_0xc1c0('0x6f')]=utils[_0xc1c0('0x70')][_0xc1c0('0x71')];logger[_0xc1c0('0x49')](_0xc1c0('0x72')+_0x18f32c[_0xc1c0('0x47')]);}}};}function createObjHistory(_0x5ec562,_0x5628eb,_0x54c3f7,_0x2bbcb2,_0x15ab38){_0x5ec562['message']=_0x54c3f7;var _0x4595ad=new Action(_0x5ec562,_0x5628eb);var _0xd90d4c=new History(_0x4595ad);_0xd90d4c[_0xc1c0('0x73')]=_0x2bbcb2;_0xd90d4c[_0xc1c0('0x74')]=_0x15ab38;_0xd90d4c[_0xc1c0('0x75')]=_0x4595ad[_0xc1c0('0x76')];return _0xd90d4c;}function unlockQueueStatus(_0x4ee020,_0x391123){setTimeout(function(){if(_[_0xc1c0('0x55')](_0x4ee020[_0xc1c0('0x77')])){loggerBooked[_0xc1c0('0x68')](_0xc1c0('0x78'),_0x391123);}_0x4ee020['queueStatusComplete']=!![];loggerBooked[_0xc1c0('0x49')](_0xc1c0('0x79'),_0x391123,JSON['stringify'](_['pick'](_0x4ee020,[_0xc1c0('0x47'),_0xc1c0('0x77')])));},0x1f3);}function checkInterval(_0x57f283){return function(){if(!isNotNull(_0x57f283[_0xc1c0('0x7a')])){_0x57f283['message']=utils[_0xc1c0('0x70')][_0xc1c0('0x7b')];throw _0x57f283[_0xc1c0('0x47')]+_0xc1c0('0x7c');}if(!isNotNull(_0x57f283[_0xc1c0('0x7a')][_0xc1c0('0x7d')])){_0x57f283[_0xc1c0('0x6f')]=utils[_0xc1c0('0x70')][_0xc1c0('0x7b')];throw _0x57f283[_0xc1c0('0x47')]+_0xc1c0('0x7c');}if(!isNotNull(_[_0xc1c0('0x7e')](_0x57f283[_0xc1c0('0x7a')]['Intervals']))){_0x57f283['message']=utils['CAMPAIGN_STATUS'][_0xc1c0('0x7b')];throw _0x57f283[_0xc1c0('0x47')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x5b702e){return function(){if(!utils[_0xc1c0('0x7f')](_0x5b702e)){_0x5b702e['message']=utils[_0xc1c0('0x70')][_0xc1c0('0x80')];throw _0x5b702e['name']+_0xc1c0('0x81');}};}function emitCampaignSummary(_0x9ed406){if(utils[_0xc1c0('0x82')](_0x9ed406)){emit(util['format'](_0xc1c0('0x83'),_0x9ed406[_0xc1c0('0x47')]),_0xc1c0('0x84'),_0x9ed406);}}function loggerCatchQueueSummary(_0x2b30d3,_0x404dc6){return function(_0x3670ec){clearPredictiveAttributes(_0x404dc6);emitCampaignSummary(_0x404dc6);loggerSyncQueueSummary[_0xc1c0('0x42')](_0x2b30d3,util[_0xc1c0('0x44')](_0x3670ec,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0xf480b4){if(_0xf480b4[_0xc1c0('0x85')]){if(_0xf480b4[_0xc1c0('0x86')]===0x0){_0xf480b4[_0xc1c0('0x85')]=![];_0xf480b4[_0xc1c0('0x6f')]=utils[_0xc1c0('0x70')]['INACTIVE'];loggerSyncQueueSummary[_0xc1c0('0x42')](_0xc1c0('0x87'),_0xf480b4[_0xc1c0('0x47')],_0xc1c0('0x88'));}else{_0xf480b4[_0xc1c0('0x6f')]=utils[_0xc1c0('0x70')]['DISACTIVED'];loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xf480b4['name'],_0xc1c0('0x89'));}emitCampaignSummary(_0xf480b4);}}function myreject(_0x434c39){return function(_0x50e8d6){return _0x434c39(msgResponse('[ifTime][Action]',_0xc1c0('0x8a'),JSON[_0xc1c0('0x8b')](_0x50e8d6)));};}Dialer[_0xc1c0('0x1d')]['isTrunkReachable']=function(_0xae5f2){return!_[_0xc1c0('0x55')](_0xae5f2)&&_0xae5f2&&!_[_0xc1c0('0x55')](_0xae5f2[_0xc1c0('0x47')])&&!_[_0xc1c0('0x55')](_0xae5f2[_0xc1c0('0x8c')])&&_0xae5f2['active']&&(this['trunks'][util[_0xc1c0('0x45')](_0xc1c0('0x8d'),_0xae5f2[_0xc1c0('0x47')])]['status']===_0xc1c0('0x8e')||this[_0xc1c0('0x25')][util[_0xc1c0('0x45')]('SIP/%s',_0xae5f2[_0xc1c0('0x47')])]['status']===_0xc1c0('0x8f'));};Dialer[_0xc1c0('0x1d')]['checkIsTrunkReachable']=function(_0x239ccc){var _0x4302f0=this;return function(){if(!_0x4302f0['isTrunkReachable'](_0x239ccc['Trunk'])){if(!_0x4302f0[_0xc1c0('0x90')](_0x239ccc[_0xc1c0('0x91')])){_0x239ccc[_0xc1c0('0x6f')]=utils['CAMPAIGN_STATUS'][_0xc1c0('0x92')];throw _0x239ccc[_0xc1c0('0x47')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x93')]=function(_0x68ddb7,_0x849f49,_0x45a7c9,_0x3125d4){var _0x2498d8=this;return function(){var _0xd0ea4c=!![];return _0x2498d8[_0xc1c0('0x94')](_0x68ddb7,_0x849f49,_0x45a7c9,_0x3125d4,_0xd0ea4c);};};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x95')]=function(_0x3b662d,_0x246c5a,_0x4313cc,_0x20372c){var _0x402064=this;return function(){var _0x29cf69=![];return _0x402064['ifTimeIvr'](_0x3b662d[_0xc1c0('0x7d')],_0x246c5a,_0x4313cc,_0x20372c,_0x29cf69);};};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x94')]=function(_0x2be211,_0x27be89,_0x296eba,_0x1573b9,_0x5c1961){var _0x2357be=[];return new Promise(function(_0x450674,_0x2efc84){if(!isNotNull(_0x2be211)){_0x1573b9['message']=utils[_0xc1c0('0x70')][_0xc1c0('0x7b')];return _0x2efc84(msgResponse(_0xc1c0('0x96'),_0xc1c0('0x97'),_0x296eba+_0xc1c0('0x98')));}if(_[_0xc1c0('0x7e')](_0x2be211)){_0x1573b9[_0xc1c0('0x6f')]=utils[_0xc1c0('0x70')]['EMPTY_INTERVAL'];return _0x2efc84(msgResponse('ifTime',_0xc1c0('0x97'),_0x296eba+_0xc1c0('0x99')));}if(_0x27be89&&_[_0xc1c0('0x55')](config[_0xc1c0('0x9a')][_0x27be89])){_0x1573b9[_0xc1c0('0x6f')]=utils[_0xc1c0('0x70')]['UNKNOWN_TIMEZONE'];return _0x2efc84(msgResponse('ifTime',_0xc1c0('0x97'),_0x296eba+_0xc1c0('0x9b')+_0x27be89));}if(_[_0xc1c0('0x9c')](_0x2be211)){for(var _0x21b147=0x0;_0x21b147<_0x2be211['length'];_0x21b147+=0x1){_0x2357be['push'](ami[_0xc1c0('0x9d')]({'action':_0xc1c0('0x9e'),'command':util[_0xc1c0('0x45')]('iftime\x20%s,%s',_0x2be211[_0x21b147]['interval'],!_[_0xc1c0('0x55')](config[_0xc1c0('0x9a')][_0x27be89])?_0x27be89:'')})[_0xc1c0('0x3f')](function(_0x3f1e3c){return _0x3f1e3c['content'][_0xc1c0('0x9f')](_0xc1c0('0xa0'))>=0x0;})[_0xc1c0('0xa1')](myreject(_0x2efc84)));}}else{_0x2357be[_0xc1c0('0xa2')](ami['Action']({'action':'command','command':util[_0xc1c0('0x45')]('iftime\x20%s,%s',_0x2be211,!_[_0xc1c0('0x55')](config[_0xc1c0('0x9a')][_0x27be89])?_0x27be89:'')})[_0xc1c0('0x3f')](function(_0x5c619c){return _0x5c619c['content'][_0xc1c0('0x9f')]('true')>=0x0;})[_0xc1c0('0xa1')](myreject(_0x2efc84)));}Promise[_0xc1c0('0xa3')](_0x2357be)['then'](function(_0x1f0459){var _0x35ca5f=_[_0xc1c0('0xa4')](_0x1f0459);if(_0x35ca5f){return _0x450674(_0x35ca5f);}else{_0x1573b9[_0xc1c0('0x6f')]=_0x5c1961?utils[_0xc1c0('0x70')][_0xc1c0('0xa5')]:utils[_0xc1c0('0x70')][_0xc1c0('0xa6')];return _0x2efc84(msgResponse('[ifTime][promiseAll]',_0xc1c0('0x97'),_0xc1c0('0xa7')+_0x5c1961+'\x20'+_0x296eba+_0xc1c0('0xa8')+util[_0xc1c0('0x44')](_0x2be211,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x27be89));}})[_0xc1c0('0xa1')](function(_0x498125){return _0x2efc84(msgResponse(_0xc1c0('0x96'),_0xc1c0('0x97'),JSON[_0xc1c0('0x8b')](_0x498125)));});});};Dialer[_0xc1c0('0x1d')][_0xc1c0('0xa9')]=function(){var _0x30054d=this;return cmHopper[_0xc1c0('0xaa')]({'active':![]},{'where':{'active':!![]}})[_0xc1c0('0x3f')](function(){setInterval(function(){_0x30054d[_0xc1c0('0xab')]();},0x3e8);});};Dialer[_0xc1c0('0x1d')]['syncCampaigns']=function(){var _0xf8592b=this;var _0x105799;for(var _0x241bd9 in this[_0xc1c0('0x23')]){if(typeof this[_0xc1c0('0x23')][_0x241bd9]!==_0xc1c0('0xac')){_0x105799=this[_0xc1c0('0x23')][_0x241bd9];if(utils['isIVRCampaign'](_0x105799)&&utils[_0xc1c0('0x7f')](_0x105799)){_0x105799[_0xc1c0('0x85')]=!![];Promise['resolve']()[_0xc1c0('0x3f')](checkIsIVRCampaignActive(_0x105799))[_0xc1c0('0x3f')](checkInterval(_0x105799))[_0xc1c0('0x3f')](_0xf8592b[_0xc1c0('0xad')](_0x105799))[_0xc1c0('0x3f')](_0xf8592b['checkIfTime'](_0x105799[_0xc1c0('0xae')],_0x105799[_0xc1c0('0xaf')],_0x105799['name'],_0x105799))['then'](_0xf8592b[_0xc1c0('0x95')](_0x105799[_0xc1c0('0x7a')],_0x105799['dialTimezone'],_0x105799[_0xc1c0('0x47')],_0x105799))[_0xc1c0('0x3f')](_0xf8592b[_0xc1c0('0xb0')](_0x105799))[_0xc1c0('0xa1')](loggerCatchQueueSummary(_0xc1c0('0xb1'),_0x105799));}else{notSendMessagesCampaign(_0x105799);}}}};Dialer[_0xc1c0('0x1d')][_0xc1c0('0xb2')]=function(_0x1359c0){if(_0x1359c0[_0xc1c0('0xb3')]!==_0xc1c0('0xa')){clearPredictiveAttributes(_0x1359c0);}switch(_0x1359c0[_0xc1c0('0xb3')]){case _0xc1c0('0xb4'):this['handlePower'](_0x1359c0,0x1);break;case _0xc1c0('0xb5'):this[_0xc1c0('0xb6')](_0x1359c0,_0x1359c0[_0xc1c0('0xb7')]);break;case'predictive':this[_0xc1c0('0xa')](_0x1359c0);break;case _0xc1c0('0x9'):this[_0xc1c0('0xb6')](_0x1359c0,0x1);break;default:logger[_0xc1c0('0x68')]('Queue',_0x1359c0[_0xc1c0('0x47')],'method\x20not\x20recognized');}};Dialer[_0xc1c0('0x1d')]['ifTime']=function(_0x15a335,_0x76b11b){var _0xb9e426=_0x15a335[_0xc1c0('0xaf')];var _0x4e285c=_0x76b11b?_0x15a335['dialGlobalInterval']:_0x15a335[_0xc1c0('0x7a')][_0xc1c0('0x7d')];logger[_0xc1c0('0xb8')](_0xc1c0('0xb9'),_0x4e285c,_0xb9e426,_0x15a335[_0xc1c0('0x47')],util[_0xc1c0('0x45')](_0xc1c0('0xba'),_0x15a335[_0xc1c0('0x47')],_0x15a335['id']));var _0x21f4ef=null;return Interval[_0xc1c0('0xbb')](_0x4e285c,_0xb9e426)[_0xc1c0('0x3f')](function(_0x2323c6){if(_0x2323c6===!![]){return _0x2323c6;}else{_0x15a335[_0xc1c0('0x6f')]=_0x76b11b?utils[_0xc1c0('0x70')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0xc1c0('0x70')]['OVERTIME_INTERVAL'];_0x21f4ef=msgResponse(_0xc1c0('0xbc'),_0xc1c0('0x97'),_0xc1c0('0xa7')+_0x76b11b+'\x20'+_0x15a335[_0xc1c0('0x47')]+_0xc1c0('0xa8')+util['inspect'](_0x4e285c,{'showHidden':![],'depth':null})+_0xc1c0('0xbd')+_0xb9e426);}if(_0x21f4ef!==null){logger[_0xc1c0('0xb8')](_0xc1c0('0xbe'),_0x21f4ef);_0x21f4ef[_0xc1c0('0xbf')]=_0x76b11b;throw _0x21f4ef;}})[_0xc1c0('0xa1')](function(_0x1c91cc){logger[_0xc1c0('0x68')]('AMI\x20IfTime',_0x1c91cc);throw msgResponse(_0xc1c0('0xc0'),_0xc1c0('0x8a'),util['inspect'](_0x1c91cc,{'showHidden':![],'depth':null}));});};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x2c')]=function(_0x2d5f88){if(this['voiceQueues'][_0x2d5f88[_0xc1c0('0xc1')]]){if(this[_0xc1c0('0xc2')][_0x2d5f88[_0xc1c0('0xc3')]]&&this[_0xc1c0('0xc2')][_0x2d5f88[_0xc1c0('0xc3')]][_0xc1c0('0x40')]!==_0xc1c0('0xc4')){this[_0xc1c0('0xc5')](this[_0xc1c0('0x22')][_0x2d5f88[_0xc1c0('0xc1')]]);this[_0xc1c0('0xc2')][_0x2d5f88[_0xc1c0('0xc3')]]['answertime']=moment()[_0xc1c0('0x45')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xc1c0('0x1d')][_0xc1c0('0xc6')]=function(_0x3808ea){var _0x143502=this[_0xc1c0('0xc2')][_0x3808ea[_0xc1c0('0xc3')]];if(this['voiceQueues'][_0x3808ea[_0xc1c0('0xc1')]]){if(_0x143502&&_0x143502[_0xc1c0('0x40')]!=='ivr'){delete this['uniqueId'][_0x3808ea[_0xc1c0('0xc3')]];this[_0xc1c0('0x22')][_0x3808ea[_0xc1c0('0xc1')]][_0xc1c0('0xc7')]+=0x1;var _0x595d74=new AgentComplete(_0x143502,_0x3808ea);if(_0x3808ea[_0xc1c0('0xc8')]===_0xc1c0('0xc9')){_0x595d74[_0xc1c0('0xca')]=this['voiceQueues'][_0x3808ea[_0xc1c0('0xc1')]][_0xc1c0('0xcb')]&&this[_0xc1c0('0x22')][_0x3808ea[_0xc1c0('0xc1')]][_0xc1c0('0xcc')]?moment()[_0xc1c0('0x45')](_0xc1c0('0xcd')):undefined;}hopperUtils[_0xc1c0('0xce')](_0x595d74)[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0xcf')));hopperUtils[_0xc1c0('0xd0')](_0x595d74)[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0xd1')));}}};Dialer['prototype']['syncQueueCallerAbandon']=function(_0xe6024a){var _0xc3b3ed=this[_0xc1c0('0xc2')][_0xe6024a['uniqueid']];var _0x4aacbe=this;var _0x36ca82=![];var _0x10d7ef;var _0x5d9535;if(this['voiceQueues'][_0xe6024a[_0xc1c0('0xc1')]]){if(_0xc3b3ed&&_0xc3b3ed[_0xc1c0('0x40')]!==_0xc1c0('0xc4')){delete this['uniqueId'][_0xe6024a['uniqueid']];this['updateOriginated'](this[_0xc1c0('0x22')][_0xe6024a['queue']]);_0xc3b3ed[_0xc1c0('0xd2')]=moment()[_0xc1c0('0x45')](_0xc1c0('0xcd'));var _0x4a8f9a=new QueueCallerAbandon(_0xc3b3ed,_0xe6024a);if(utils[_0xc1c0('0xd3')](_0xc3b3ed[_0xc1c0('0xd2')],_0xc3b3ed['responsetime'])>=_0xc3b3ed['dialQueueTimeout']){this['voiceQueues'][_0xe6024a['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0xe6024a[_0xc1c0('0xc1')]][_0xc1c0('0xd4')]+=0x1;this[_0xc1c0('0x22')][_0xe6024a['queue']][_0xc1c0('0xd5')]+=0x1;_0x4a8f9a['state']=0xa;_0x4a8f9a[_0xc1c0('0x74')]=_0xc1c0('0xd6');_0x4a8f9a[_0xc1c0('0xd7')]=_0xc1c0('0xd8');_0x4a8f9a[_0xc1c0('0xca')]=this[_0xc1c0('0x22')][_0xe6024a[_0xc1c0('0xc1')]]['dialQueueProject2']?moment()['format'](_0xc1c0('0xcd')):undefined;_0x4a8f9a[_0xc1c0('0xd9')]+=0x1;_0x4a8f9a[_0xc1c0('0xda')]+=0x1;_0x10d7ef=this['voiceQueues'][_0xe6024a[_0xc1c0('0xc1')]][_0xc1c0('0xdb')];_0x5d9535=this[_0xc1c0('0x22')][_0xe6024a['queue']][_0xc1c0('0xdc')];hopperUtils['verifyAdditionalPhones'](_0x4a8f9a,_0x4a8f9a[_0xc1c0('0x73')],_0xc3b3ed[_0xc1c0('0xdd')])[_0xc1c0('0x3f')](function(_0x274829){_0x36ca82=_0x274829[_0xc1c0('0xde')]==0x1;if(_0x4a8f9a[_0xc1c0('0xd9')]>=_0x4aacbe['voiceQueues'][_0xe6024a[_0xc1c0('0xc1')]][_0xc1c0('0xdf')]){_0x4aacbe[_0xc1c0('0xe0')](_0x4a8f9a,_0x274829[_0xc1c0('0xde')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x4a8f9a['countdropretry'],'scheduledat':moment()[_0xc1c0('0xe1')](_0x4aacbe[_0xc1c0('0x22')][_0xe6024a[_0xc1c0('0xc1')]][_0xc1c0('0xdb')],_0xc1c0('0xe2'))[_0xc1c0('0x45')](_0xc1c0('0xcd')),'ContactId':_0xc3b3ed[_0xc1c0('0xe3')],'ListId':_0xc3b3ed[_0xc1c0('0xe4')],'VoiceQueueId':_0xc3b3ed[_0xc1c0('0xe5')]||undefined,'CampaignId':_0xc3b3ed[_0xc1c0('0xe6')]||undefined})[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0xe7')));var _0x22aa2c=new History(_0x4a8f9a);_0x22aa2c['state']=0xa;_0x22aa2c[_0xc1c0('0x74')]=_0xc1c0('0xd6');_0x22aa2c['starttime']=moment()['format'](_0xc1c0('0xcd'));_0x22aa2c[_0xc1c0('0x75')]=_0x22aa2c[_0xc1c0('0x76')];_0x22aa2c['calleridname']=_0x4a8f9a[_0xc1c0('0xe8')];_0x22aa2c['calleridnum']=_0x4a8f9a[_0xc1c0('0xe9')];hopperUtils[_0xc1c0('0xce')](_0x22aa2c)[_0xc1c0('0xa1')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xc1c0('0x3f')](function(){if(_0x36ca82)hopperUtils[_0xc1c0('0xea')](_0x4a8f9a,_0x10d7ef,_0x5d9535)[_0xc1c0('0x3f')](function(){return 0x1;});});}else{this[_0xc1c0('0x22')][_0xe6024a['queue']][_0xc1c0('0x50')]+=0x1;this['voiceQueues'][_0xe6024a[_0xc1c0('0xc1')]][_0xc1c0('0xeb')]+=0x1;_0x4a8f9a[_0xc1c0('0x73')]=0xb;_0x4a8f9a[_0xc1c0('0x74')]=_0xc1c0('0xec');_0x4a8f9a[_0xc1c0('0xd7')]=_0xc1c0('0xed');_0x4a8f9a[_0xc1c0('0xee')]+=0x1;_0x4a8f9a[_0xc1c0('0xda')]+=0x1;_0x10d7ef=this['voiceQueues'][_0xe6024a['queue']][_0xc1c0('0xef')];_0x5d9535=this[_0xc1c0('0x22')][_0xe6024a['queue']][_0xc1c0('0xdc')];hopperUtils[_0xc1c0('0xf0')](_0x4a8f9a,_0x4a8f9a['state'],_0xc3b3ed[_0xc1c0('0xdd')])[_0xc1c0('0x3f')](function(_0x26aa7c){if(_0x4a8f9a['countabandonedretry']>=_0x4aacbe['voiceQueues'][_0xe6024a[_0xc1c0('0xc1')]][_0xc1c0('0xf1')]){_0x4aacbe[_0xc1c0('0xe0')](_0x4a8f9a,_0x26aa7c[_0xc1c0('0xde')]);}else{hopperUtils[_0xc1c0('0xf2')]({'active':![],'countabandonedretry':_0x4a8f9a[_0xc1c0('0xee')],'scheduledat':moment()[_0xc1c0('0xe1')](_0x4aacbe[_0xc1c0('0x22')][_0xe6024a[_0xc1c0('0xc1')]][_0xc1c0('0xef')],_0xc1c0('0xe2'))[_0xc1c0('0x45')](_0xc1c0('0xcd')),'ContactId':_0xc3b3ed[_0xc1c0('0xe3')],'ListId':_0xc3b3ed[_0xc1c0('0xe4')],'VoiceQueueId':_0xc3b3ed['VoiceQueueId']||undefined,'CampaignId':_0xc3b3ed['CampaignId']||undefined})[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0xf3')));var _0x3632a6=new History(_0x4a8f9a);_0x3632a6[_0xc1c0('0x73')]=0xb;_0x3632a6[_0xc1c0('0x74')]=_0xc1c0('0xec');_0x3632a6[_0xc1c0('0x76')]=moment()[_0xc1c0('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x3632a6[_0xc1c0('0x75')]=_0x3632a6[_0xc1c0('0x76')];_0x3632a6[_0xc1c0('0xe8')]=_0x4a8f9a['calleridname'];_0x3632a6[_0xc1c0('0xe9')]=_0x4a8f9a['calleridnum'];hopperUtils[_0xc1c0('0xce')](_0x3632a6)['catch'](loggerCatch(_0xc1c0('0xf4')));}})['then'](function(){if(_0x36ca82)hopperUtils[_0xc1c0('0xea')](_0x4a8f9a,_0x10d7ef,_0x5d9535)[_0xc1c0('0x3f')](function(){return 0x1;});});}}}};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x37')]=function(_0x530597){if(this[_0xc1c0('0xf5')][_0x530597[_0xc1c0('0xc3')]]){this[_0xc1c0('0xf5')][_0x530597['uniqueid']]['channel']=_0x530597[_0xc1c0('0xf6')];}if(this[_0xc1c0('0xc2')][_0x530597[_0xc1c0('0xc3')]]){this[_0xc1c0('0xc2')][_0x530597['uniqueid']][_0xc1c0('0xf6')]=_0x530597[_0xc1c0('0xf6')];}};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x3a')]=function(_0x4d34d9){if(!this[_0xc1c0('0xf5')][_0x4d34d9[_0xc1c0('0xf7')]]){return;}var _0x4c4d55=this[_0xc1c0('0x22')][this[_0xc1c0('0xf5')][_0x4d34d9['actionid']][_0xc1c0('0xc1')]][_0xc1c0('0xf8')]||_0xc1c0('0xf9');if(_0x4c4d55===_0xc1c0('0xfa')){if(this[_0xc1c0('0xf5')][_0x4d34d9['actionid']]&&_[_0xc1c0('0xfb')](this[_0xc1c0('0xf5')][_0x4d34d9[_0xc1c0('0xf7')]][_0xc1c0('0xfc')])&&_0x4d34d9[_0xc1c0('0xfd')]==='1'&&_0x4d34d9['paused']==='0'){if(this[_0xc1c0('0x24')][_0x4d34d9[_0xc1c0('0xfe')]]){if(!this['agents'][_0x4d34d9[_0xc1c0('0xfe')]][_0xc1c0('0xfc')]){this['agents'][_0x4d34d9['stateinterface']][_0xc1c0('0xfc')]=!![];this['actions'][_0x4d34d9[_0xc1c0('0xf7')]][_0xc1c0('0xfc')]=!![];this[_0xc1c0('0xf5')][_0x4d34d9[_0xc1c0('0xf7')]]['stateinterface']=_0x4d34d9[_0xc1c0('0xfe')];}}}}else if(_0x4c4d55===_0xc1c0('0xf9')){if(this[_0xc1c0('0xf5')][_0x4d34d9[_0xc1c0('0xf7')]]){if(this[_0xc1c0('0x24')][_0x4d34d9[_0xc1c0('0xfe')]]){this[_0xc1c0('0xf5')][_0x4d34d9[_0xc1c0('0xf7')]]['stateinterface']=_0x4d34d9[_0xc1c0('0xfe')];if(_[_0xc1c0('0xfb')](this[_0xc1c0('0x2a')][this[_0xc1c0('0xf5')][_0x4d34d9[_0xc1c0('0xf7')]]['queue']])){this[_0xc1c0('0x2a')][this[_0xc1c0('0xf5')][_0x4d34d9[_0xc1c0('0xf7')]]['queue']]=[];}this['queueBooked'][this[_0xc1c0('0xf5')][_0x4d34d9[_0xc1c0('0xf7')]]['queue']][_0xc1c0('0xa2')](_['merge'](_['pick'](this['actions'][_0x4d34d9[_0xc1c0('0xf7')]],[_0xc1c0('0xff'),_0xc1c0('0xfe')]),{'status':_0x4d34d9[_0xc1c0('0xfd')],'paused':_0x4d34d9[_0xc1c0('0x100')]}));}}}};Dialer['prototype']['syncQueueStatusComplete']=function(_0x587b2b){if(!this['actions'][_0x587b2b['actionid']]){return;}var _0x57db63=this;var _0x972093=this[_0xc1c0('0x22')][this['actions'][_0x587b2b[_0xc1c0('0xf7')]][_0xc1c0('0xc1')]];var _0x2853c4=_0x972093[_0xc1c0('0xf8')]||_0xc1c0('0xf9');if(_0x2853c4===_0xc1c0('0xfa')){if(this[_0xc1c0('0xf5')][_0x587b2b[_0xc1c0('0xf7')]]&&this[_0xc1c0('0xf5')][_0x587b2b['actionid']][_0xc1c0('0xfe')]){this[_0xc1c0('0x21')][_0xc1c0('0x101')](this[_0xc1c0('0xf5')][_0x587b2b[_0xc1c0('0xf7')]][_0xc1c0('0xff')],this['actions'][_0x587b2b['actionid']][_0xc1c0('0xfe')])[_0xc1c0('0xa1')](function(_0x427ad5){logger[_0xc1c0('0x68')](_0xc1c0('0x102'),util[_0xc1c0('0x44')](_0x427ad5,{'showHidden':![],'depth':null}));})[_0xc1c0('0x1f')](function(){_0x57db63[_0xc1c0('0xc5')](_0x57db63[_0xc1c0('0x22')][_0x57db63[_0xc1c0('0xf5')][_0x587b2b[_0xc1c0('0xf7')]]['queue']]);_0x57db63[_0xc1c0('0x24')][_0x57db63['actions'][_0x587b2b[_0xc1c0('0xf7')]][_0xc1c0('0xfe')]]['locked']=![];delete _0x57db63[_0xc1c0('0xf5')][_0x587b2b[_0xc1c0('0xf7')]];unlockQueueStatus(_0x972093);});}else{this[_0xc1c0('0xc5')](this[_0xc1c0('0x22')][this[_0xc1c0('0xf5')][_0x587b2b[_0xc1c0('0xf7')]]['queue']]);hopperUtils[_0xc1c0('0xf2')]({'active':![],'ContactId':this[_0xc1c0('0xf5')][_0x587b2b['actionid']][_0xc1c0('0xe3')],'ListId':this[_0xc1c0('0xf5')][_0x587b2b[_0xc1c0('0xf7')]][_0xc1c0('0xe4')],'VoiceQueueId':this[_0xc1c0('0xf5')][_0x587b2b[_0xc1c0('0xf7')]][_0xc1c0('0xe5')]||undefined,'CampaignId':this[_0xc1c0('0xf5')][_0x587b2b[_0xc1c0('0xf7')]][_0xc1c0('0xe6')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xc1c0('0xf5')][_0x587b2b[_0xc1c0('0xf7')]];unlockQueueStatus(_0x972093);}}else if(_0x2853c4==='rrmemory'){var _0x590d71;if(this[_0xc1c0('0xf5')][_0x587b2b['actionid']]&&!_['isEmpty'](this[_0xc1c0('0x2a')][this[_0xc1c0('0xf5')][_0x587b2b[_0xc1c0('0xf7')]]['queue']])){if(this[_0xc1c0('0x103')][_0x57db63[_0xc1c0('0xf5')][_0x587b2b['actionid']][_0xc1c0('0xc1')]]){this['queueBookedRR'][_0x57db63[_0xc1c0('0xf5')][_0x587b2b['actionid']][_0xc1c0('0xc1')]]=this[_0xc1c0('0x103')][this[_0xc1c0('0xf5')][_0x587b2b[_0xc1c0('0xf7')]][_0xc1c0('0xc1')]]?this[_0xc1c0('0x103')][this[_0xc1c0('0xf5')][_0x587b2b[_0xc1c0('0xf7')]][_0xc1c0('0xc1')]]:this[_0xc1c0('0x2a')][this[_0xc1c0('0xf5')][_0x587b2b[_0xc1c0('0xf7')]]['queue']]?this[_0xc1c0('0x2a')][this[_0xc1c0('0xf5')][_0x587b2b[_0xc1c0('0xf7')]][_0xc1c0('0xc1')]][_0xc1c0('0x104')]||0x0:0x0;}this['queueBooked'][this[_0xc1c0('0xf5')][_0x587b2b[_0xc1c0('0xf7')]][_0xc1c0('0xc1')]][_0xc1c0('0x104')]=this['queueBookedRR'][this[_0xc1c0('0xf5')][_0x587b2b[_0xc1c0('0xf7')]][_0xc1c0('0xc1')]];for(var _0xa1d7cd=0x0;_0xa1d7cd=_0x23ecf0[_0xc1c0('0x12a')]){_0x3873dd[_0xc1c0('0x12b')](_0x3c762d,_0x383418,_0x4b2744,'reason19\x20machine....');}else{if(_0x3c762d[_0xc1c0('0x125')]>=_0x23ecf0[_0xc1c0('0x12c')]){_0x3873dd[_0xc1c0('0x12d')](_0x3c762d,_0x383418,_0x4b2744,_0xc1c0('0x12e'));}else{hopperUtils[_0xc1c0('0xf2')]({'active':![],'countmachineretry':_0x3c762d[_0xc1c0('0x125')],'scheduledat':moment()[_0xc1c0('0xe1')](_0x23ecf0[_0xc1c0('0x12f')],_0xc1c0('0xe2'))[_0xc1c0('0x45')](_0xc1c0('0xcd')),'ContactId':_0x3c762d['ContactId'],'ListId':_0x3c762d[_0xc1c0('0xe4')],'VoiceQueueId':_0x3c762d['VoiceQueueId']||undefined,'CampaignId':_0x3c762d[_0xc1c0('0xe6')]||undefined})[_0xc1c0('0xa1')](loggerCatch('[rescheduleContact][Machine]'));_0x383418({'reschedule':0x1});}}});}if(_0x35d3a0['type']===_0xc1c0('0xc4')&&this[_0xc1c0('0x23')][_0x35d3a0['queue']][_0xc1c0('0x122')]&&_0x5d36dd[_0xc1c0('0x118')]===_0xc1c0('0x119')){delete this['uniqueId'][_0x5d36dd[_0xc1c0('0xc3')]];this[_0xc1c0('0xc5')](this['campaigns'][_0x35d3a0[_0xc1c0('0xc1')]]);_0x10bde2=new Hangup(_0x35d3a0,_0x5d36dd);_0x10bde2[_0xc1c0('0x73')]=0x12;_0x10bde2[_0xc1c0('0x74')]=_0xc1c0('0x130');_0x10bde2['membername']=_0xc1c0('0x124');ami[_0xc1c0('0x11c')]('custom:amd',ut[_0xc1c0('0x11e')](_0x10bde2,_0xc1c0('0x11f')));this['saveInDb'](_0x10bde2,_0xc1c0('0x131'),'[syncHangupInAMDIvr]');}if(_0x35d3a0[_0xc1c0('0x40')]==='ivr'&&this[_0xc1c0('0x23')][_0x35d3a0[_0xc1c0('0xc1')]][_0xc1c0('0x122')]&&_0x5d36dd[_0xc1c0('0x118')]==='MACHINE'){return new Promise(function(_0xf86949,_0x1e479a){delete _0x3873dd['uniqueId'][_0x5d36dd[_0xc1c0('0xc3')]];_0x3873dd['updateOriginated'](_0x3873dd['campaigns'][_0x35d3a0[_0xc1c0('0xc1')]]);_0x3873dd[_0xc1c0('0x23')][_0x35d3a0['queue']][_0xc1c0('0xc7')]+=0x1;_0x3873dd[_0xc1c0('0x23')][_0x35d3a0[_0xc1c0('0xc1')]][_0xc1c0('0x11a')]+=0x1;var _0x39aec6=_0x3873dd[_0xc1c0('0x23')][_0x35d3a0[_0xc1c0('0xc1')]];var _0x194003=new Hangup(_0x35d3a0,_0x5d36dd);_0x194003[_0xc1c0('0x73')]=0x13;_0x194003[_0xc1c0('0x74')]=_0xc1c0('0x132');_0x194003[_0xc1c0('0x11b')]=_0xc1c0('0x124');_0x194003['countmachineretry']+=0x1;_0x194003[_0xc1c0('0xda')]+=0x1;_0x194003[_0xc1c0('0x11f')]=!![];ami[_0xc1c0('0x11c')](_0xc1c0('0x11d'),ut['buildObj'](_0x194003,_0xc1c0('0x11f')));hopperUtils[_0xc1c0('0xce')](_0x194003)[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0x126')));if(_0x194003[_0xc1c0('0x133')]+_0x194003[_0xc1c0('0x127')]+_0x194003[_0xc1c0('0x128')]+_0x194003[_0xc1c0('0x134')]+_0x194003[_0xc1c0('0xd9')]+_0x194003[_0xc1c0('0xee')]+_0x194003[_0xc1c0('0x125')]+_0x194003[_0xc1c0('0x129')]>=_0x39aec6[_0xc1c0('0x12a')]){_0x3873dd[_0xc1c0('0x12b')](_0x194003,_0xf86949,_0x1e479a,'reason19\x20machine....');}else{if(_0x194003['countmachineretry']>=_0x39aec6[_0xc1c0('0x12c')]){_0x3873dd[_0xc1c0('0x12d')](_0x194003,_0xf86949,_0x1e479a,_0xc1c0('0x12e'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x194003[_0xc1c0('0x125')],'scheduledat':moment()[_0xc1c0('0xe1')](_0x39aec6['dialMachineRetryFrequency'],'minutes')[_0xc1c0('0x45')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x194003[_0xc1c0('0xe3')],'ListId':_0x194003[_0xc1c0('0xe4')],'VoiceQueueId':_0x194003[_0xc1c0('0xe5')]||undefined,'CampaignId':_0x194003['CampaignId']||undefined})[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0x135')));_0xf86949({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0x528054){var _0x355bef=this[_0xc1c0('0xc2')][_0x528054['uniqueid']];var _0x47a740;if(_0x355bef&&_0x355bef[_0xc1c0('0x40')]===_0xc1c0('0xc4')){delete this[_0xc1c0('0xc2')][_0x528054[_0xc1c0('0xc3')]];this[_0xc1c0('0xc5')](this[_0xc1c0('0x23')][_0x355bef[_0xc1c0('0xc1')]]);this[_0xc1c0('0x23')][_0x355bef[_0xc1c0('0xc1')]][_0xc1c0('0x136')]+=0x1;_0x47a740=new Hangup(_0x355bef,_0x528054);hopperUtils[_0xc1c0('0xce')](_0x47a740)[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0x137')));hopperUtils[_0xc1c0('0xd0')](_0x47a740)[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0x138')));}if(_0x355bef&&_0x355bef['type']!=='ivr'&&isNotNull(this[_0xc1c0('0x22')][_0x355bef[_0xc1c0('0xc1')]][_0xc1c0('0x139')])){delete this['uniqueId'][_0x528054[_0xc1c0('0xc3')]];this[_0xc1c0('0xc5')](this[_0xc1c0('0x22')][_0x355bef[_0xc1c0('0xc1')]]);this['voiceQueues'][_0x355bef[_0xc1c0('0xc1')]][_0xc1c0('0xc7')]+=0x1;this[_0xc1c0('0x22')][_0x355bef[_0xc1c0('0xc1')]][_0xc1c0('0x11a')]+=0x1;_0x47a740=new Hangup(_0x355bef,_0x528054);_0x47a740['state']=0x10;_0x47a740[_0xc1c0('0x74')]='AnswerAGI';_0x47a740[_0xc1c0('0x11b')]='AGI';hopperUtils[_0xc1c0('0xce')](_0x47a740)[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0x137')));hopperUtils[_0xc1c0('0xd0')](_0x47a740)['catch'](loggerCatch(_0xc1c0('0x138')));}if(_0x355bef&&_0x355bef[_0xc1c0('0x40')]!==_0xc1c0('0xc4')&&!isNotNull(this['voiceQueues'][_0x355bef[_0xc1c0('0xc1')]][_0xc1c0('0x139')])){delete this[_0xc1c0('0xc2')][_0x528054[_0xc1c0('0xc3')]];this[_0xc1c0('0xc5')](this['voiceQueues'][_0x355bef['queue']]);this['voiceQueues'][_0x355bef[_0xc1c0('0xc1')]][_0xc1c0('0x13a')]+=0x1;_0x47a740=new Hangup(_0x355bef,_0x528054);_0x47a740[_0xc1c0('0x73')]=0xc;_0x47a740[_0xc1c0('0x74')]=_0x528054[_0xc1c0('0x13b')];_0x47a740[_0xc1c0('0x11b')]=_0xc1c0('0x13c');hopperUtils[_0xc1c0('0xce')](_0x47a740)[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0x137')));hopperUtils[_0xc1c0('0xd0')](_0x47a740)[_0xc1c0('0xa1')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xc1c0('0x1d')][_0xc1c0('0xc')]=function(_0x25a8df){var _0x1ba71f=this;if(!_0x1ba71f[_0xc1c0('0x2b')][_0x25a8df[_0xc1c0('0x47')]]){_0x1ba71f[_0xc1c0('0x2b')][_0x25a8df[_0xc1c0('0x47')]]={'running':![]};}else if(_0x1ba71f[_0xc1c0('0x2b')][_0x25a8df[_0xc1c0('0x47')]]['running']===!![]){return;}else if(_0x1ba71f['queuesSummary'][_0x25a8df[_0xc1c0('0x47')]][_0xc1c0('0x13d')]===![]){_0x1ba71f[_0xc1c0('0x2b')][_0x25a8df[_0xc1c0('0x47')]][_0xc1c0('0x13d')]=!![];}var _0x21d0d3=_0x1ba71f[_0xc1c0('0x22')][_0x25a8df[_0xc1c0('0x47')]];var _0x2157a5=_0x21d0d3['message']!==utils[_0xc1c0('0x70')][_0xc1c0('0x80')];var _0x158e20=utils[_0xc1c0('0x13e')](_0x21d0d3);_0x21d0d3[_0xc1c0('0x13f')]=utils['getQueueCampaignStatusMessage'](_0x21d0d3,_0x1ba71f[_0xc1c0('0x25')]);Promise[_0xc1c0('0x140')]()[_0xc1c0('0x3f')](function(){if(_0x21d0d3[_0xc1c0('0x13f')]===utils['CAMPAIGN_STATUS'][_0xc1c0('0x80')]){if(_0x2157a5){clearPredictiveAttributes(_0x21d0d3);_0x25a8df[_0xc1c0('0x64')]=undefined;_0x25a8df[_0xc1c0('0x62')]=undefined;}if(_0x21d0d3['statusMessage']===utils[_0xc1c0('0x70')][_0xc1c0('0x80')]){_0x25a8df[_0xc1c0('0x141')]=0x0;_0x25a8df[_0xc1c0('0x100')]=0x0;_0x25a8df['inUse']=0x0;_0x25a8df[_0xc1c0('0x142')]=0x0;_0x25a8df['pTalking']=0x0;}}else if(_0x21d0d3[_0xc1c0('0x13f')]===utils['CAMPAIGN_STATUS'][_0xc1c0('0x143')]&&!_0x158e20){return _0x1ba71f[_0xc1c0('0x96')](_0x21d0d3,!![])[_0xc1c0('0x3f')](function(){return _0x1ba71f[_0xc1c0('0x96')](_0x21d0d3,![]);})[_0xc1c0('0x3f')](function(){return _0x1ba71f[_0xc1c0('0xb2')](_0x21d0d3);})[_0xc1c0('0xa1')](function(_0x44931a){loggerSyncQueueSummary['debug'](_0xc1c0('0x144'),util[_0xc1c0('0x44')](_0x44931a,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x21d0d3);});}else{clearPredictiveAttributes(_0x21d0d3);}})[_0xc1c0('0x3f')](function(){var _0x9b2d73=_0x25a8df[_0xc1c0('0x145')](_0x21d0d3);if(_0x9b2d73||_0x21d0d3[_0xc1c0('0x146')]){_0x21d0d3[_0xc1c0('0x146')]=![];_0x25a8df[_0xc1c0('0x147')](_0x21d0d3);Object[_0xc1c0('0x148')](_0x21d0d3,_0x25a8df);emitOutboundVoiceQueueSummary(_0x25a8df);}_0x1ba71f[_0xc1c0('0x2b')][_0x21d0d3[_0xc1c0('0x47')]]['running']=![];})[_0xc1c0('0xa1')](function(_0x26eda1){logger[_0xc1c0('0x68')](_0xc1c0('0x144'),util[_0xc1c0('0x44')](_0x26eda1,{'showHidden':![],'depth':null}));_0x1ba71f[_0xc1c0('0x2b')][_0x21d0d3['name']][_0xc1c0('0x13d')]=![];});};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x33')]=_[_0xc1c0('0x149')](function(){var _0x559d3f=_[_0xc1c0('0x14a')](this[_0xc1c0('0x22')],function(_0x1a5689){return _0x1a5689[_0xc1c0('0x14b')];});var _0x4666fb=_['filter'](this['agents'],function(_0x145af9){return _0x145af9['online']&&_0x145af9[_0xc1c0('0xfd')]==='reachable';});if(_0x559d3f[_0xc1c0('0x14c')]>0x0&&_0x4666fb[_0xc1c0('0x14c')]>0x0){return Promise['resolve']()['then'](cmHopper['handlePreviewRecallNotifications'](_[_0xc1c0('0x14d')](_0x559d3f,'id'),previewRecallmeReminderInterval,_['map'](_0x4666fb,'id')))[_0xc1c0('0x3f')](function(_0x253e01){for(var _0x2acb0d=0x0;_0x2acb0d<_0x253e01[_0xc1c0('0x14c')];_0x2acb0d++){var _0x1dd32e=_0x253e01[_0x2acb0d]['Agent'][_0xc1c0('0x47')];if(_0x1dd32e)io['to'](util[_0xc1c0('0x45')](_0xc1c0('0x14e'),_0x1dd32e))[_0xc1c0('0x11c')](_0xc1c0('0x14f'),{'hopper':_0x253e01[_0x2acb0d]});}})[_0xc1c0('0xa1')](function(_0x187c60){logger[_0xc1c0('0x68')]('checkPreviewRecallReminder',_0x187c60);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xc1c0('0x3d')]=function(){var _0x39616c=this;setInterval(function(){_0x39616c['clearZombieChannels'](_0x39616c[_0xc1c0('0xc2')],'[uniqueid]');_0x39616c['clearZombieChannels'](_0x39616c['actions'],_0xc1c0('0x150'));},0x32c8);};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x151')]=function(_0x451c09,_0x243b46){var _0x5ba60b=this;for(var _0x52ceef in _0x451c09){if(typeof _0x451c09[_0x52ceef]!==_0xc1c0('0xac')){this[_0xc1c0('0x20')]['enqueue'](function(){if(!_[_0xc1c0('0xfb')](_0x451c09[_0x52ceef])){return ami[_0xc1c0('0x9d')]({'action':_0xc1c0('0xfd'),'channel':_0x451c09[_0x52ceef][_0xc1c0('0xf6')]})[_0xc1c0('0xa1')](function(_0x54ba85){if(_0x54ba85['message']===_0xc1c0('0x152')){setTimeout(function(){if(_0x451c09[_0x52ceef]&&_0x451c09[_0x52ceef]['type']!==_0xc1c0('0xc4')){_0x5ba60b[_0xc1c0('0xc5')](_0x5ba60b[_0xc1c0('0x22')][_0x451c09[_0x52ceef][_0xc1c0('0xc1')]]);logger[_0xc1c0('0x68')](_0xc1c0('0x153'),_0x243b46,_0x52ceef,_0x451c09[_0x52ceef][_0xc1c0('0xc1')]);delete _0x451c09[_0x52ceef];}if(_0x451c09[_0x52ceef]&&_0x451c09[_0x52ceef]['type']===_0xc1c0('0xc4')){_0x5ba60b[_0xc1c0('0xc5')](_0x5ba60b[_0xc1c0('0x23')][_0x451c09[_0x52ceef][_0xc1c0('0xc1')]]);logger[_0xc1c0('0x68')](_0xc1c0('0x154'),_0x243b46,_0x52ceef,_0x451c09[_0x52ceef][_0xc1c0('0xc1')]);delete _0x451c09[_0x52ceef];}},0x2328);}});}});}}};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x155')]=function(_0x4b079a){return Promise['resolve']()['then'](voiceQueueRt[_0xc1c0('0x155')](_0x4b079a))['catch'](loggerCatch(_0xc1c0('0x156')));};Dialer[_0xc1c0('0x1d')][_0xc1c0('0xc5')]=function(_0x46bc86){if(!_[_0xc1c0('0x55')](_0x46bc86)&&_0x46bc86!==null){if(typeof _0x46bc86['originated']!=='undefined'){if(_0x46bc86[_0xc1c0('0x86')]>0x0){_0x46bc86[_0xc1c0('0x86')]-=0x1;}else{logger['error'](_0xc1c0('0x157'));}}}else{logger[_0xc1c0('0x68')](_0xc1c0('0x158'));}};Dialer[_0xc1c0('0x1d')]['loggerHandler']=function(_0x2d5ae6,_0x4381e6){var _0x1846f0=this;return function(_0x624f68){_0x1846f0['updateOriginated'](_0x4381e6);logger[_0xc1c0('0x68')](_0x2d5ae6,util[_0xc1c0('0x44')](_0x624f68,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x31b127,_0x42d6bc,_0x456558){var _0x1616a8={'state':0x19,'statedesc':_0xc1c0('0x159')};this[_0xc1c0('0xc5')](_0x42d6bc);this[_0xc1c0('0x120')](_[_0xc1c0('0x61')](_0x1616a8,_[_0xc1c0('0x108')](_0x456558,[_0xc1c0('0xe3'),_0xc1c0('0xe4'),_0xc1c0('0x15a'),'VoiceQueueId',_0xc1c0('0xe6')])),_0xc1c0('0x15b'),_0xc1c0('0x15c'));logger['error'](_0x31b127);};Dialer['prototype'][_0xc1c0('0x120')]=function(_0x1fdd17,_0x3cd074,_0x1ac8d3){hopperUtils[_0xc1c0('0xce')](_0x1fdd17)[_0xc1c0('0xa1')](loggerCatch(_0x3cd074));hopperUtils[_0xc1c0('0xd0')](_0x1fdd17)[_0xc1c0('0xa1')](loggerCatch(_0x1ac8d3));};Dialer['prototype'][_0xc1c0('0xe0')]=function(_0x270e68,_0x23de52){hopperUtils[_0xc1c0('0xce')](_0x270e68)[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0xcf')));if(_0x23de52==0x0){hopperUtils[_0xc1c0('0xd0')](_0x270e68)[_0xc1c0('0xa1')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x15d')]=function(_0x4b9591){return Promise[_0xc1c0('0x140')]()['then'](cmHopper['handlePreviewRecallNotifications'](_0x4b9591['id'],previewRecallmeReminderInterval))['then'](function(_0xc38633){for(var _0x559f86=0x0;_0x559f86<_0xc38633[_0xc1c0('0x14c')];_0x559f86++){var _0x4e928f=_0xc38633[_0x559f86][_0xc1c0('0x15e')][_0xc1c0('0x47')];if(_0x4e928f)io['to'](util[_0xc1c0('0x45')](_0xc1c0('0x14e'),_0x4e928f))[_0xc1c0('0x11c')](_0xc1c0('0x14f'),{'hopper':_0xc38633[_0x559f86]});}})['catch'](function(){});};Dialer[_0xc1c0('0x1d')]['launchHandleIvr']=function(_0x3b90e2){var _0x45bb6a=this;return function(){_0x45bb6a[_0xc1c0('0x15f')](_0x3b90e2);};};Dialer['prototype']['actionOriginate']=function(_0x42324e,_0x1e7c98){var _0x6e4b22=this;var _0x29e31f=uuid['v4']();this[_0xc1c0('0xf5')][_0x29e31f]=new Action(_0x42324e,_0x1e7c98,_0x29e31f);return new Promise(function(_0x2f2380,_0x44d2bf){if(_[_0xc1c0('0x55')](_0x42324e)&&typeof _0x42324e!==_0xc1c0('0x160')){return _0x44d2bf(msgResponse(_0xc1c0('0x161'),_0xc1c0('0x97'),_0xc1c0('0x162')));}if(_[_0xc1c0('0x55')](_0x1e7c98['phone'])||_0x1e7c98[_0xc1c0('0x163')]===null){return _0x44d2bf(msgResponse('originate',_0xc1c0('0x97'),'contact\x20is\x20undefine'));}var _0x11dd8d={'XMD-CALLERID':_0x6e4b22['actions'][_0x29e31f][_0xc1c0('0x164')](),'XMD-AGI':_0x42324e[_0xc1c0('0x139')]?util[_0xc1c0('0x45')](_0xc1c0('0x165'),ipAgi,_0x42324e['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x42324e[_0xc1c0('0xcb')]?util[_0xc1c0('0x45')](_0xc1c0('0x165'),ipAgi,_0x42324e[_0xc1c0('0xcb')]):_0xc1c0('0x166'),'XMD-QUEUE':utils[_0xc1c0('0x167')](_0x42324e)?util[_0xc1c0('0x45')]('\x22%s,%s%s,,,%s\x22',_0x42324e[_0xc1c0('0x47')],_0x42324e[_0xc1c0('0x168')]||'',_0x42324e[_0xc1c0('0xcc')]?'c':'',_0x42324e[_0xc1c0('0x169')]||0x3):_0xc1c0('0x166'),'XMD-CONTACTID':_0x1e7c98[_0xc1c0('0xe3')],'XMD-CDRTYPE':_0xc1c0('0x8'),'CALLERID(all)':_0x6e4b22[_0xc1c0('0xf5')][_0x29e31f]['getCaller'](),'XMD-AMD':_0x42324e[_0xc1c0('0x122')]?_0xc1c0('0x143'):_0xc1c0('0x166'),'XMD-DESTINATION':_0xc1c0('0x16a')};if(_0x42324e['dialAMDActive']){_0x11dd8d[_0xc1c0('0x16b')]=_0x42324e['dialAMDInitialSilence']||0x9c4;_0x11dd8d['XMD-AMDGREETING']=_0x42324e[_0xc1c0('0x16c')]||0x5dc;_0x11dd8d[_0xc1c0('0x16d')]=_0x42324e[_0xc1c0('0x16e')]||0x320;_0x11dd8d[_0xc1c0('0x16f')]=_0x42324e['dialAMDTotalAnalysisTime']||0x1388;_0x11dd8d[_0xc1c0('0x170')]=_0x42324e[_0xc1c0('0x171')]||0x64;_0x11dd8d[_0xc1c0('0x172')]=_0x42324e[_0xc1c0('0x173')]||0x32;_0x11dd8d[_0xc1c0('0x174')]=_0x42324e[_0xc1c0('0x175')]||0x3;_0x11dd8d[_0xc1c0('0x176')]=_0x42324e[_0xc1c0('0x177')]||0x100;_0x11dd8d[_0xc1c0('0x178')]=_0x42324e['dialAMDMaximumWordLength']||0x1388;}if(utils[_0xc1c0('0x167')](_0x42324e)){_0x11dd8d['XMD-VOICEQUEUEID']=_0x1e7c98['VoiceQueueId'];}else{_0x11dd8d[_0xc1c0('0x179')]=_0x1e7c98[_0xc1c0('0xe6')];}var _0x3e69ce=utils[_0xc1c0('0x17a')](_0x1e7c98[_0xc1c0('0x17b')]);Object[_0xc1c0('0x148')](_0x11dd8d,_0x3e69ce);var _0x224273=_0x6e4b22['isTrunkReachable'](_0x42324e[_0xc1c0('0x17c')])?utils['getCallerId'](_0x42324e[_0xc1c0('0x17c')][_0xc1c0('0x17d')],_0x42324e[_0xc1c0('0x17e')],_0x42324e[_0xc1c0('0x17f')]>0x0?utils['getCallerIdRandom'](_0x42324e[_0xc1c0('0x180')],_0x42324e[_0xc1c0('0x17f')]):_0x42324e['dialOriginateCallerIdNumber']):utils[_0xc1c0('0x181')](_[_0xc1c0('0xfb')](_0x42324e['TrunkBackup'])?_0x42324e['Trunk'][_0xc1c0('0x17d')]:_0x42324e[_0xc1c0('0x91')][_0xc1c0('0x17d')],_0x42324e[_0xc1c0('0x17e')],_0x42324e['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xc1c0('0x182')](_0x42324e[_0xc1c0('0x180')],_0x42324e['dialRandomLastDigitCallerIdNumber']):_0x42324e[_0xc1c0('0x180')]);if(_0x224273){_0x11dd8d[_0xc1c0('0x183')]=_0x6e4b22['actions'][_0x29e31f][_0xc1c0('0x184')]=utils[_0xc1c0('0x185')](_0x224273);_0x11dd8d['XMD-ORIGINATECALLERIDNUM']=_0x1e7c98[_0xc1c0('0x163')];}_0x42324e['variables']=_0x11dd8d;return ami[_0xc1c0('0x9d')]({'actionid':_0x29e31f,'action':_0xc1c0('0x161'),'channel':_0x6e4b22[_0xc1c0('0x90')](_0x42324e['Trunk'])?util['format'](_0xc1c0('0x186'),_0x42324e[_0xc1c0('0x17c')][_0xc1c0('0x47')],isNotNull(_0x42324e['dialPrefix'])?_0x42324e[_0xc1c0('0x187')][_0xc1c0('0x188')]()||'':'',_0x42324e[_0xc1c0('0x189')]>0x0?_0x1e7c98[_0xc1c0('0x163')][_0xc1c0('0x18a')](_0x42324e[_0xc1c0('0x189')]):_0x1e7c98[_0xc1c0('0x163')]):util[_0xc1c0('0x45')](_0xc1c0('0x186'),_['isNil'](_0x42324e[_0xc1c0('0x91')])?_0x42324e['Trunk'][_0xc1c0('0x47')]:_0x42324e['TrunkBackup'][_0xc1c0('0x47')],isNotNull(_0x42324e[_0xc1c0('0x187')])?_0x42324e['dialPrefix'][_0xc1c0('0x188')]()||'':'',_0x42324e['dialCutDigit']>0x0?_0x1e7c98[_0xc1c0('0x163')][_0xc1c0('0x18a')](_0x42324e['dialCutDigit']):_0x1e7c98[_0xc1c0('0x163')]),'callerid':_0x224273,'Exten':_0xc1c0('0x16a'),'Context':_0xc1c0('0x18b'),'Priority':'1','variable':_0x11dd8d,'timeout':(_0x42324e[_0xc1c0('0x18c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x29e31f})[_0xc1c0('0x3f')](function(_0x391799){return _0x2f2380(_0x391799);})[_0xc1c0('0xa1')](function(_0x4b9318){_0x42324e[_0xc1c0('0x18d')]+=0x1;var _0x450e2b=new History(_0x6e4b22['actions'][_0x29e31f]);logger[_0xc1c0('0x68')](util[_0xc1c0('0x45')](_0xc1c0('0x18e'),JSON[_0xc1c0('0x8b')](_0x4b9318)));_0x450e2b[_0xc1c0('0x73')]=0xe;_0x450e2b['statedesc']=_0xc1c0('0x18f');_0x450e2b['starttime']=moment()[_0xc1c0('0x45')](_0xc1c0('0xcd'));_0x450e2b['endtime']=_0x450e2b['starttime'];hopperUtils[_0xc1c0('0xce')](_0x450e2b)['catch'](loggerCatch(_0xc1c0('0x190')));_0x6e4b22[_0xc1c0('0xd0')](_0x450e2b)[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0x190')))[_0xc1c0('0x1f')](function(){delete _0x6e4b22['actions'][_0x29e31f];return _0x44d2bf(msgResponse(_0xc1c0('0x161'),_0xc1c0('0x8a'),'originate\x20action\x20Error'));});});});};Dialer[_0xc1c0('0x1d')]['checkRetriveMax']=function(_0x3db0cc,_0x1c2a6c,_0x34a3f4){var _0x77b591=new History(_0x1c2a6c);if(_0x77b591[_0xc1c0('0x133')]+_0x77b591[_0xc1c0('0x127')]+_0x77b591[_0xc1c0('0x128')]+_0x77b591[_0xc1c0('0x134')]+_0x77b591[_0xc1c0('0xd9')]+_0x77b591[_0xc1c0('0xee')]+_0x77b591['countmachineretry']+_0x77b591[_0xc1c0('0x129')]>=_0x34a3f4[_0xc1c0('0x12a')]-0x1){return!![];}switch(_0x3db0cc){case 0x3:if(_0x77b591[_0xc1c0('0x128')]>=_0x34a3f4['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0xc1c0('0xf2')]({'active':![],'countnoanswerretry':_0x77b591[_0xc1c0('0x128')]+=0x1,'scheduledat':moment()[_0xc1c0('0xe1')](_0x34a3f4[_0xc1c0('0x191')],_0xc1c0('0xe2'))[_0xc1c0('0x45')](_0xc1c0('0xcd')),'ContactId':_0x77b591[_0xc1c0('0xe3')],'ListId':_0x77b591['ListId'],'VoiceQueueId':_0x77b591[_0xc1c0('0xe5')]||undefined,'CampaignId':_0x77b591[_0xc1c0('0xe6')]||undefined})[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0x192')));break;case 0x5:if(_0x77b591['countbusyretry']>=_0x34a3f4[_0xc1c0('0x193')]-0x1){return!![];}hopperUtils[_0xc1c0('0xf2')]({'active':![],'countbusyretry':_0x77b591[_0xc1c0('0x133')]+=0x1,'scheduledat':moment()[_0xc1c0('0xe1')](_0x34a3f4[_0xc1c0('0x194')],_0xc1c0('0xe2'))[_0xc1c0('0x45')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x77b591[_0xc1c0('0xe3')],'ListId':_0x77b591[_0xc1c0('0xe4')],'VoiceQueueId':_0x77b591[_0xc1c0('0xe5')]||undefined,'CampaignId':_0x77b591[_0xc1c0('0xe6')]||undefined})[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0x195')));break;case 0x8:if(_0x77b591[_0xc1c0('0x127')]>=_0x34a3f4[_0xc1c0('0x196')]-0x1){return!![];}hopperUtils[_0xc1c0('0xf2')]({'active':![],'countcongestionretry':_0x77b591[_0xc1c0('0x127')]+=0x1,'scheduledat':moment()['add'](_0x34a3f4[_0xc1c0('0x197')],_0xc1c0('0xe2'))['format'](_0xc1c0('0xcd')),'ContactId':_0x77b591[_0xc1c0('0xe3')],'ListId':_0x77b591[_0xc1c0('0xe4')],'VoiceQueueId':_0x77b591[_0xc1c0('0xe5')]||undefined,'CampaignId':_0x77b591[_0xc1c0('0xe6')]||undefined})[_0xc1c0('0xa1')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x77b591[_0xc1c0('0x134')]>=_0x34a3f4[_0xc1c0('0x198')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x77b591[_0xc1c0('0x134')]+=0x1,'scheduledat':moment()['add'](_0x34a3f4[_0xc1c0('0x199')],_0xc1c0('0xe2'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x77b591[_0xc1c0('0xe3')],'ListId':_0x77b591[_0xc1c0('0xe4')],'VoiceQueueId':_0x77b591['VoiceQueueId']||undefined,'CampaignId':_0x77b591[_0xc1c0('0xe6')]||undefined})[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0x19a')));}break;case 0xa:if(_0x77b591[_0xc1c0('0xd9')]>=_0x34a3f4['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0xc1c0('0xf2')]({'active':![],'countdropretry':_0x77b591['countdropretry']+=0x1,'scheduledat':moment()[_0xc1c0('0xe1')](_0x34a3f4[_0xc1c0('0xdb')],_0xc1c0('0xe2'))['format'](_0xc1c0('0xcd')),'ContactId':_0x77b591[_0xc1c0('0xe3')],'ListId':_0x77b591[_0xc1c0('0xe4')],'VoiceQueueId':_0x77b591[_0xc1c0('0xe5')]||undefined,'CampaignId':_0x77b591[_0xc1c0('0xe6')]||undefined})[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0xe7')));break;case 0xb:if(_0x77b591['countabandonedretry']>=_0x34a3f4['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0xc1c0('0xf2')]({'active':![],'countabandonedretry':_0x77b591['countabandonedretry']+=0x1,'scheduledat':moment()[_0xc1c0('0xe1')](_0x34a3f4[_0xc1c0('0xef')],'minutes')[_0xc1c0('0x45')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x77b591[_0xc1c0('0xe3')],'ListId':_0x77b591[_0xc1c0('0xe4')],'VoiceQueueId':_0x77b591[_0xc1c0('0xe5')]||undefined,'CampaignId':_0x77b591[_0xc1c0('0xe6')]||undefined})[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0xf3')));break;case 0x13:if(_0x77b591['countmachineretry']>=_0x34a3f4[_0xc1c0('0x12c')]-0x1){return!![];}hopperUtils[_0xc1c0('0xf2')]({'active':![],'countmachineretry':_0x77b591[_0xc1c0('0x125')]+=0x1,'scheduledat':moment()['add'](_0x34a3f4[_0xc1c0('0x12f')],_0xc1c0('0xe2'))[_0xc1c0('0x45')](_0xc1c0('0xcd')),'ContactId':_0x77b591['ContactId'],'ListId':_0x77b591[_0xc1c0('0xe4')],'VoiceQueueId':_0x77b591[_0xc1c0('0xe5')]||undefined,'CampaignId':_0x77b591[_0xc1c0('0xe6')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x77b591[_0xc1c0('0x129')]>=_0x34a3f4[_0xc1c0('0x19b')]-0x1){return!![];}hopperUtils[_0xc1c0('0xf2')]({'active':![],'countagentrejectretry':_0x77b591[_0xc1c0('0x129')]+=0x1,'scheduledat':moment()[_0xc1c0('0xe1')](_0x34a3f4[_0xc1c0('0x19c')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x77b591[_0xc1c0('0xe3')],'ListId':_0x77b591[_0xc1c0('0xe4')],'VoiceQueueId':_0x77b591[_0xc1c0('0xe5')]||undefined,'CampaignId':_0x77b591[_0xc1c0('0xe6')]||undefined})[_0xc1c0('0xa1')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x19d')]=function(_0x256206,_0x4e426e,_0x3a49a8){var _0x282215=this;var _0x1124a5=new History(_0x256206);var _0x1e7af3=![];var _0x131344;var _0x175cb4;return new Promise(function(_0x386b15,_0x138d5c){if(_[_0xc1c0('0x55')](_0x4e426e)&&typeof _0x4e426e!=='object'){return _0x138d5c(msgResponse(_0xc1c0('0x19e'),'Failure',_0xc1c0('0x19f')));}if(_[_0xc1c0('0x55')](_0x3a49a8)&&typeof _0x3a49a8!=='object'){return _0x138d5c(msgResponse(_0xc1c0('0x19e'),_0xc1c0('0x97'),_0xc1c0('0x1a0')));}hopperUtils[_0xc1c0('0xf0')](_0x1124a5,_0x3a49a8[_0xc1c0('0xc8')],_0x4e426e)[_0xc1c0('0x3f')](function(_0x1e7365){if(_0x1e7365[_0xc1c0('0xde')]==0x1)_0x1e7af3=!![];switch(_0x3a49a8[_0xc1c0('0xc8')]){case'0':_0x4e426e[_0xc1c0('0x1a1')]+=0x1;_0x1124a5[_0xc1c0('0x73')]=0x0;_0x1124a5['statedesc']=_0xc1c0('0x1a2');_0x1124a5[_0xc1c0('0x134')]+=0x1;_0x1124a5[_0xc1c0('0xda')]+=0x1;ami[_0xc1c0('0x11c')](_0xc1c0('0x1a3'),ut[_0xc1c0('0x11e')](_0x256206,_0xc1c0('0x1a4')));_0x131344=_0x4e426e['dialNoSuchNumberRetryFrequency'];_0x175cb4=_0x4e426e[_0xc1c0('0xdc')];hopperUtils[_0xc1c0('0xce')](_0x1124a5)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x282215['checkRetriveMax'](0x0,_0x256206,_0x4e426e)&&!_0x1e7af3){if(_0x1124a5[_0xc1c0('0x134')]>=_0x4e426e['dialNoSuchNumberMaxRetry']){_0x282215['createStateFinal'](_0x1124a5,_0x386b15,_0x138d5c,'reason\x200\x20no\x20such\x20number....');}else{_0x282215['stateGlobal'](_0x1124a5,_0x386b15,_0x138d5c,_0xc1c0('0x1a5'));}}break;case'3':_0x4e426e[_0xc1c0('0x1a6')]+=0x1;_0x1124a5[_0xc1c0('0x73')]=0x3;_0x1124a5['statedesc']=_0xc1c0('0x1a7');_0x1124a5[_0xc1c0('0x128')]+=0x1;_0x1124a5[_0xc1c0('0xda')]+=0x1;var _0x130a1f=ut[_0xc1c0('0x1a8')](_0x256206,_0x4e426e);ami[_0xc1c0('0x11c')](_0xc1c0('0x1a9'),_0x130a1f);_0x131344=_0x4e426e[_0xc1c0('0x191')];_0x175cb4=_0x4e426e['callAdditionalPhoneAfterMin'];hopperUtils[_0xc1c0('0xce')](_0x1124a5)[_0xc1c0('0xa1')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x282215[_0xc1c0('0x1aa')](0x3,_0x256206,_0x4e426e)&&!_0x1e7af3){if(_0x1124a5[_0xc1c0('0x128')]>=_0x4e426e[_0xc1c0('0x1ab')]){_0x282215[_0xc1c0('0x12d')](_0x1124a5,_0x386b15,_0x138d5c,_0xc1c0('0x1ac'));}else{_0x282215[_0xc1c0('0x12b')](_0x1124a5,_0x386b15,_0x138d5c,_0xc1c0('0x1ac'));}}break;case'5':_0x4e426e[_0xc1c0('0x1ad')]+=0x1;_0x1124a5[_0xc1c0('0x73')]=0x5;_0x1124a5[_0xc1c0('0x74')]=_0xc1c0('0x1ae');_0x1124a5[_0xc1c0('0x133')]+=0x1;_0x1124a5[_0xc1c0('0xda')]+=0x1;ami[_0xc1c0('0x11c')](_0xc1c0('0x1af'),ut[_0xc1c0('0x11e')](_0x256206,'busy'));_0x131344=_0x4e426e['dialBusyRetryFrequency'];_0x175cb4=_0x4e426e[_0xc1c0('0xdc')];hopperUtils[_0xc1c0('0xce')](_0x1124a5)[_0xc1c0('0xa1')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x282215[_0xc1c0('0x1aa')](0x5,_0x256206,_0x4e426e)&&!_0x1e7af3){if(_0x1124a5[_0xc1c0('0x133')]>=_0x4e426e['dialBusyMaxRetry']){_0x282215[_0xc1c0('0x12d')](_0x1124a5,_0x386b15,_0x138d5c,_0xc1c0('0x1b0'));}else{_0x282215['stateGlobal'](_0x1124a5,_0x386b15,_0x138d5c,'reason\x205\x20busy');}}break;case'8':_0x4e426e['outboundCongestionCallsDay']+=0x1;_0x1124a5[_0xc1c0('0x73')]=0x8;_0x1124a5[_0xc1c0('0x74')]=_0xc1c0('0x1b1');_0x1124a5[_0xc1c0('0x127')]+=0x1;_0x1124a5[_0xc1c0('0xda')]+=0x1;_0x131344=_0x4e426e[_0xc1c0('0x197')];_0x175cb4=_0x4e426e[_0xc1c0('0xdc')];ami['emit'](_0xc1c0('0x1b2'),ut['buildObj'](_0x256206,_0xc1c0('0x1b3')));hopperUtils[_0xc1c0('0xce')](_0x1124a5)['catch'](loggerCatch(_0xc1c0('0x1b4')));if(_0x282215['checkRetriveMax'](0x8,_0x256206,_0x4e426e)&&!_0x1e7af3){if(_0x1124a5[_0xc1c0('0x127')]>=_0x4e426e['dialCongestionMaxRetry']){_0x282215['createStateFinal'](_0x1124a5,_0x386b15,_0x138d5c,'reason\x208\x20congestion');}else{_0x282215[_0xc1c0('0x12b')](_0x1124a5,_0x386b15,_0x138d5c,_0xc1c0('0x1b5'));}}break;case'11':_0x4e426e[_0xc1c0('0x1b6')]+=0x1;_0x1124a5[_0xc1c0('0x73')]=0xb;_0x1124a5[_0xc1c0('0x74')]='Abandoned';_0x1124a5[_0xc1c0('0xee')]+=0x1;_0x1124a5[_0xc1c0('0xda')]+=0x1;_0x131344=_0x4e426e[_0xc1c0('0xef')];_0x175cb4=_0x4e426e[_0xc1c0('0xdc')];hopperUtils[_0xc1c0('0xce')](_0x1124a5)[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0xf4')));if(_0x282215[_0xc1c0('0x1aa')](0xb,_0x256206,_0x4e426e)&&!_0x1e7af3){if(_0x1124a5['countabandonedretry']>=_0x4e426e[_0xc1c0('0xf1')]){_0x282215['createStateFinal'](_0x1124a5,_0x386b15,_0x138d5c,_0xc1c0('0x1b7'));}else{_0x282215[_0xc1c0('0x12b')](_0x1124a5,_0x386b15,_0x138d5c,_0xc1c0('0x1b7'));}}break;case'20':_0x4e426e[_0xc1c0('0x1b8')]+=0x1;_0x1124a5[_0xc1c0('0x73')]=0x14;_0x1124a5['statedesc']=_0xc1c0('0x1b9');_0x1124a5['countagentrejectretry']+=0x1;_0x1124a5[_0xc1c0('0xda')]+=0x1;_0x131344=_0x4e426e['dialAgentRejectRetryFrequency'];_0x175cb4=_0x4e426e[_0xc1c0('0xdc')];ami['emit'](_0xc1c0('0x1ba'),ut[_0xc1c0('0x11e')](_0x256206,_0xc1c0('0x1bb')));hopperUtils['createHistory'](_0x1124a5)['catch'](loggerCatch(_0xc1c0('0x1bc')));if(_0x282215['checkRetriveMax'](0x14,_0x256206,_0x4e426e)&&!_0x1e7af3){if(_0x1124a5[_0xc1c0('0x129')]>=_0x4e426e[_0xc1c0('0x19b')]){_0x282215[_0xc1c0('0x12d')](_0x1124a5,_0x386b15,_0x138d5c,_0xc1c0('0x1bd'));}else{_0x282215['stateGlobal'](_0x1124a5,_0x386b15,_0x138d5c,'reason\x2020\x20agentreject');}}break;default:_0x4e426e[_0xc1c0('0x13a')]+=0x1;_0x1124a5['state']=0xc;_0x1124a5[_0xc1c0('0x74')]=_0x3a49a8['reason'];_0x131344=_0x4e426e[_0xc1c0('0x19c')];_0x175cb4=_0x4e426e['callAdditionalPhoneAfterMin'];hopperUtils[_0xc1c0('0xce')](_0x1124a5)[_0xc1c0('0xa1')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x282215[_0xc1c0('0x1aa')](_0x3a49a8['reason'],_0x256206,_0x4e426e)&&!_0x1e7af3){if(_0x1124a5['countbusyretry']+_0x1124a5[_0xc1c0('0x127')]+_0x1124a5[_0xc1c0('0x128')]+_0x1124a5[_0xc1c0('0x134')]+_0x1124a5[_0xc1c0('0xd9')]+_0x1124a5['countabandonedretry']+_0x1124a5['countmachineretry']+_0x1124a5[_0xc1c0('0x129')]>=_0x4e426e[_0xc1c0('0x12a')]){_0x282215[_0xc1c0('0x12b')](_0x1124a5,_0x386b15,_0x138d5c,_0x3a49a8['reason']);}else{_0x282215[_0xc1c0('0x12d')](_0x1124a5,_0x386b15,_0x138d5c,_0x3a49a8[_0xc1c0('0xc8')]);}}}})[_0xc1c0('0x3f')](function(){if(_0x1e7af3){hopperUtils[_0xc1c0('0xea')](_0x1124a5,_0x131344,_0x175cb4)['then'](function(){return _0x386b15(0x1);});}});});};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x12b')]=function(_0x4beba6,_0x1d8251,_0x56f379,_0x1cac3c){var _0x1e126b=new Final(_0x4beba6);_0x1e126b[_0xc1c0('0x73')]=0xf;_0x1e126b[_0xc1c0('0x74')]=_0xc1c0('0x1be');this[_0xc1c0('0x12d')](_0x1e126b,_0x1d8251,_0x56f379,_0x1cac3c);};Dialer[_0xc1c0('0x1d')]['createStateFinal']=function(_0x99030,_0x1c9ce7,_0x236072,_0x1f28a7){hopperUtils[_0xc1c0('0xd0')](_0x99030)['then'](function(){return _0x1c9ce7(msgResponse(_0xc1c0('0x19e'),_0xc1c0('0x113'),_0x1f28a7));})[_0xc1c0('0xa1')](function(){return _0x236072(msgResponse(_0xc1c0('0x1bf'),_0xc1c0('0x97'),_0xc1c0('0x1c0')));});};Dialer[_0xc1c0('0x1d')]['predictive']=function(_0x14b96c){var _0x21574f=_0x14b96c['dialPredictiveOptimizationPercentage']/0x64;var _0x398081=_0x14b96c[_0xc1c0('0xd4')]/(_0x14b96c[_0xc1c0('0xd4')]+_0x14b96c[_0xc1c0('0xc7')]);var _0x5dd9b2=Math[_0xc1c0('0x1c1')](_0x14b96c[_0xc1c0('0x1c2')]*(_0x14b96c[_0xc1c0('0x1c3')]/0x64));var _0x3510f6=Math[_0xc1c0('0x1c1')](_0x14b96c['predictiveIntervalAvailable']*(_0x14b96c[_0xc1c0('0x1c4')]/0x64));var _0x2c28bd=_0x14b96c['available']+_0x14b96c[_0xc1c0('0x142')];var _0x4843f6=Math[_0xc1c0('0x1c5')](_0x14b96c[_0xc1c0('0x1c6')]*_0x14b96c[_0xc1c0('0x5f')]*_0x14b96c[_0xc1c0('0x1c7')]*_0x14b96c['predictiveIntervalMultiplicativeFactor']);if(_[_0xc1c0('0x55')](_0x14b96c['startProgressive'])){if(!_[_0xc1c0('0x55')](_0x14b96c[_0xc1c0('0x64')])){_0x14b96c['startPredictive']=undefined;loggerPredictive[_0xc1c0('0x68')](_0xc1c0('0x1c8'),_0xc1c0('0x1c9'));}if(!_[_0xc1c0('0x55')](_0x14b96c[_0xc1c0('0x66')])){loggerPredictive[_0xc1c0('0x68')](_0xc1c0('0x1c8'),_0xc1c0('0x1ca'));clearInterval(_0x14b96c[_0xc1c0('0x66')]);_0x14b96c[_0xc1c0('0x66')]=undefined;}_0x14b96c[_0xc1c0('0x62')]=moment()['format'](_0xc1c0('0xcd'));loggerPredictive[_0xc1c0('0x49')](_0x14b96c[_0xc1c0('0x47')],'collection\x20data\x20in\x20progressive\x20at',_0x14b96c[_0xc1c0('0x62')]);this[_0xc1c0('0xb6')](_0x14b96c,0x1);}else if(ifInterval(_0x14b96c['dialPredictiveInterval'],_0x14b96c['startProgressive'])){this[_0xc1c0('0xb6')](_0x14b96c,0x1);loggerPredictiveCalls[_0xc1c0('0x49')](_0xc1c0('0x1cb'),_0x14b96c[_0xc1c0('0x62')],_0x14b96c[_0xc1c0('0x47')]);_0x14b96c[_0xc1c0('0x1c6')]=0x0;_0x14b96c[_0xc1c0('0xd5')]=0x0;}else if(_0x21574f<_0x398081&&_0x14b96c[_0xc1c0('0x1cc')]===_0xc1c0('0x1cd')){clearPredictiveAttributes(_0x14b96c);loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x1ce'),_0xc1c0('0x1cf'),_0x398081,_0xc1c0('0x62'),_0x14b96c[_0xc1c0('0x47')]);}else if(_0x4843f6<_0x14b96c['predictiveIntervalErlangCallsDroppedCalls']&&_0x14b96c[_0xc1c0('0x1cc')]===_0xc1c0('0x1cd')){clearPredictiveAttributes(_0x14b96c);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xc1c0('0x1d0'),_0x4843f6,_0xc1c0('0x1d1'),_0x14b96c[_0xc1c0('0xd5')],'startProgressive',_0x14b96c[_0xc1c0('0x47')]);}else if(!ifInterval(_0x14b96c['dialPredictiveInterval'],_0x14b96c['startProgressive'])&&_[_0xc1c0('0x55')](_0x14b96c[_0xc1c0('0x64')])&&!_[_0xc1c0('0x55')](_0x14b96c[_0xc1c0('0x62')])){_0x14b96c[_0xc1c0('0x64')]=moment()[_0xc1c0('0x45')](_0xc1c0('0xcd'));loggerPredictive[_0xc1c0('0x49')](_0x14b96c[_0xc1c0('0x47')],_0xc1c0('0x1d2'),_0x14b96c[_0xc1c0('0x64')]);hopperUtils[_0xc1c0('0x1d3')](_0x14b96c[_0xc1c0('0x1d4')])['then'](this['getDataPredictive'](_0x14b96c))[_0xc1c0('0x3f')](mergeDataErlangB(_0x14b96c))[_0xc1c0('0x3f')](this[_0xc1c0('0x1d5')](_0x14b96c))[_0xc1c0('0xa1')](loggerCatchPredictive(_0xc1c0('0x1d6'),_0x14b96c));}else if(!ifInterval(_0x14b96c[_0xc1c0('0x1d4')],_0x14b96c[_0xc1c0('0x64')])){_0x14b96c[_0xc1c0('0xd5')]=0x0;_0x14b96c[_0xc1c0('0x64')]=moment()[_0xc1c0('0x45')](_0xc1c0('0xcd'));loggerPredictive['info'](_0x14b96c['name'],_0xc1c0('0x1d7'),_0x14b96c['startPredictive']);clearInterval(_0x14b96c[_0xc1c0('0x66')]);_0x14b96c[_0xc1c0('0x66')]=undefined;hopperUtils[_0xc1c0('0x1d3')](_0x14b96c[_0xc1c0('0x1d4')])[_0xc1c0('0x3f')](this[_0xc1c0('0x1d8')](_0x14b96c))[_0xc1c0('0x3f')](mergeDataErlangB(_0x14b96c))[_0xc1c0('0x3f')](this[_0xc1c0('0x1d5')](_0x14b96c))['catch'](loggerCatchPredictive(_0xc1c0('0x1d9'),_0x14b96c));}else if(_0x14b96c[_0xc1c0('0x1c2')]&&_0x2c28bd<_0x14b96c['predictiveIntervalAvailable']-_0x3510f6){clearPredictiveAttributes(_0x14b96c);loggerPredictive[_0xc1c0('0x49')](_0x14b96c[_0xc1c0('0x47')],_0xc1c0('0x1da'),_0x2c28bd,_0xc1c0('0x1db'),_0x14b96c['predictiveIntervalAvailable'],'-',_0x3510f6,'=',_0x14b96c[_0xc1c0('0x1c2')]-_0x3510f6,')');}else if(_0x14b96c[_0xc1c0('0x1c2')]&&_0x2c28bd>_0x14b96c['predictiveIntervalAvailable']+_0x5dd9b2){clearPredictiveAttributes(_0x14b96c);loggerPredictive[_0xc1c0('0x49')](_0x14b96c[_0xc1c0('0x47')],_0xc1c0('0x1da'),_0x2c28bd,_0xc1c0('0x1dc'),_0x14b96c['predictiveIntervalAvailable'],'+',_0x5dd9b2,'=',_0x14b96c[_0xc1c0('0x1c2')]+_0x5dd9b2,')');}};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x1d8')]=function(_0x432aec){var _0x59318e=this;return function(_0x1113a6){return new Promise(function(_0x520669,_0x213c27){_[_0xc1c0('0x61')](_0x432aec,_0x1113a6[0x0]);if(checkGetDataPredictive(_0x1113a6[0x0])){var _0x5f2fdd=_0x432aec['predictiveIntervalAvailable']=_0x432aec[_0xc1c0('0x142')]+_0x432aec[_0xc1c0('0x141')];var _0x1e9e91=_0x432aec[_0xc1c0('0x1d4')]*0x3c;var _0x486a54=_0x1113a6[0x0][_0xc1c0('0x53')]+_0x1113a6[0x0]['predictiveIntervalAvgHoldtime'];var _0x149dff=(_0x1113a6[0x0][_0xc1c0('0x4c')]+_0x1113a6[0x0][_0xc1c0('0x4e')]+_0x1113a6[0x0][_0xc1c0('0x50')])/_0x1113a6[0x0][_0xc1c0('0x4b')];_0x432aec[_0xc1c0('0x1c7')]=_0x149dff>0x0?_0x149dff:0x1;switch(_0x432aec['dialPredictiveOptimization']){case _0xc1c0('0x1cd'):var _0x521035=_0x432aec[_0xc1c0('0x1dd')]/0x64;return _0x59318e['abandonmentRate'](_0x5f2fdd,_0x1e9e91,_0x486a54,_0x149dff,_0x521035)[_0xc1c0('0x3f')](function(_0x294590){return _0x520669(_0x294590);});case'agentBusyFactor':var _0xd56c52=_0x432aec[_0xc1c0('0x1dd')]/0x64;return _0x59318e[_0xc1c0('0x1de')](_0x5f2fdd,_0x1e9e91,_0x486a54,_0x149dff,_0xd56c52)[_0xc1c0('0x3f')](function(_0x17f954){return _0x520669(_0x17f954);});default:return _0x213c27(msgResponse(_0xc1c0('0x1df'),'Failure',_0xc1c0('0x1e0')));}}else{return _0x213c27(msgResponse(_0xc1c0('0x1df'),_0xc1c0('0x97'),_0xc1c0('0x1e1')));}});};};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x1e2')]=function(_0x5d4d70){var _0x4c6ab1=this;return function(_0x3823ad){return new Promise(function(_0x44ab19,_0x445a24){_[_0xc1c0('0x61')](_0x5d4d70,_0x3823ad[0x0]);if(checkGetDataPredictive(_0x3823ad[0x0])){loggerPredictive[_0xc1c0('0x49')](JSON[_0xc1c0('0x8b')](_0x3823ad[0x0]));if(_0x5d4d70[_0xc1c0('0x1cc')]===_0xc1c0('0x1cd')){return _0x4c6ab1[_0xc1c0('0x155')](_0x5d4d70['id'])[_0xc1c0('0x3f')](function(_0x227add){var _0x30b6f4=_0x5d4d70[_0xc1c0('0x1e3')]-_0x227add[0x0][_0xc1c0('0x1e4')];var _0x27e7d3=_0x5d4d70[_0xc1c0('0x1d4')]*0x3c;var _0x145e05=_0x3823ad[0x0][_0xc1c0('0x53')]+_0x3823ad[0x0]['predictiveIntervalAvgHoldtime'];var _0x44ad7f=(_0x3823ad[0x0][_0xc1c0('0x4c')]+_0x3823ad[0x0][_0xc1c0('0x4e')]+_0x3823ad[0x0][_0xc1c0('0x50')])/_0x3823ad[0x0][_0xc1c0('0x4b')];var _0xa7e7a5=_0x5d4d70['dialPredictiveOptimizationPercentage']/0x64;_0x5d4d70[_0xc1c0('0x1e5')]=_0x227add[0x0][_0xc1c0('0x1e4')]||0x0;_0x5d4d70['predictiveIntervalHitRate']=_0x44ad7f>0x0?_0x44ad7f:0x1;return _0x4c6ab1[_0xc1c0('0x1e6')](_0x30b6f4,_0x27e7d3,_0x145e05,_0x44ad7f,_0xa7e7a5);})[_0xc1c0('0x3f')](function(_0x39c33e){return _0x44ab19(_0x39c33e);})[_0xc1c0('0xa1')](function(_0x56d66a){return _0x445a24(msgResponse(_0xc1c0('0x1e7'),'Failure',JSON[_0xc1c0('0x8b')](_0x56d66a)));});}if(_0x5d4d70[_0xc1c0('0x1cc')]==='agentBusyFactor'){return _0x4c6ab1[_0xc1c0('0x155')](_0x5d4d70['id'])['then'](function(_0x2bf620){var _0x3ef19e=_0x5d4d70[_0xc1c0('0x1e3')]-_0x2bf620[0x0][_0xc1c0('0x1e4')];var _0x4a6ee5=_0x5d4d70[_0xc1c0('0x1d4')]*0x3c;var _0xfe30b=_0x3823ad[0x0][_0xc1c0('0x53')]+_0x3823ad[0x0]['predictiveIntervalAvgHoldtime'];var _0xac4c79=(_0x3823ad[0x0][_0xc1c0('0x4c')]+_0x3823ad[0x0][_0xc1c0('0x4e')]+_0x3823ad[0x0][_0xc1c0('0x50')])/_0x3823ad[0x0]['predictiveIntervalTotalCalls'];var _0x4b3f4e=_0x5d4d70[_0xc1c0('0x1dd')]/0x64;_0x5d4d70[_0xc1c0('0x1e5')]=_0x2bf620[0x0][_0xc1c0('0x1e4')]||0x0;_0x5d4d70[_0xc1c0('0x1c7')]=_0xac4c79>0x0?_0xac4c79:0x1;return _0x4c6ab1['busyFactor'](_0x3ef19e,_0x4a6ee5,_0xfe30b,_0xac4c79,_0x4b3f4e);})['then'](function(_0xdad60e){return _0x44ab19(_0xdad60e);})[_0xc1c0('0xa1')](function(_0x2d0866){return _0x445a24(msgResponse(_0xc1c0('0x1e7'),_0xc1c0('0x97'),JSON[_0xc1c0('0x8b')](_0x2d0866)));});}}else{return _0x445a24(msgResponse(_0xc1c0('0x1df'),_0xc1c0('0x97'),_0xc1c0('0x1e1')));}});};};Dialer[_0xc1c0('0x1d')]['startMethodPredictive']=function(_0x20bb70){var _0x1f517e=this;return function(){var _0x3fa276=0x0;var _0x51d009=Math['floor'](_0x20bb70[_0xc1c0('0x5d')]*0x3e8);if(_0x51d009>0x0){_0x51d009=_0x51d009<0x64?0x64:_0x51d009;loggerPredictive[_0xc1c0('0x49')](_0x20bb70[_0xc1c0('0x47')],_0xc1c0('0x1e8'),_0x51d009,_0xc1c0('0x1e9'));_0x20bb70['handlePredictive']=setInterval(function(){_0x1f517e[_0xc1c0('0x66')](_0x20bb70);loggerPredictiveCalls[_0xc1c0('0x49')]('[handlePredictive]',_0x3fa276+=0x1);},_0x51d009);}else{loggerPredictive[_0xc1c0('0x49')](_0x20bb70[_0xc1c0('0x47')],_0xc1c0('0x1ea'));}};};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x1eb')]=function(_0x515fe3,_0x1bdc02){var _0x165638=this;return function(_0x568e2b){if(_[_0xc1c0('0x7e')](_0x568e2b)){if(_[_0xc1c0('0xfb')](_0x1bdc02['UserId'])||!_0x1bdc02[_0xc1c0('0x1ec')]){if(_0x515fe3[_0xc1c0('0xb3')]===_0xc1c0('0x9')){_0x515fe3[_0xc1c0('0x77')]=_['isUndefined'](_0x515fe3['queueStatusComplete'])?!![]:_0x515fe3[_0xc1c0('0x77')];var _0x4b8bf5=uuid['v4']();_0x165638[_0xc1c0('0xf5')][_0x4b8bf5]=new Action(_0x515fe3,_0x1bdc02,_0x4b8bf5);loggerBooked[_0xc1c0('0x49')](_0xc1c0('0x1ed'),_0x4b8bf5,_0xc1c0('0x1ee'),JSON[_0xc1c0('0x8b')](_0x515fe3[_0xc1c0('0x77')]),'Queue:\x20',_0x515fe3['name']);if(_0x515fe3[_0xc1c0('0x77')]){_0x515fe3[_0xc1c0('0x77')]=![];_0x165638[_0xc1c0('0x2a')][_0x165638[_0xc1c0('0xf5')][_0x4b8bf5][_0xc1c0('0xc1')]]=[];ami[_0xc1c0('0x9d')]({'actionid':_0x4b8bf5,'action':_0xc1c0('0x1ef'),'queue':_0x515fe3[_0xc1c0('0x47')]})['catch'](function(){_0x165638[_0xc1c0('0xc5')](_0x515fe3);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x165638[_0xc1c0('0xf5')][_0x4b8bf5][_0xc1c0('0xe3')],'ListId':_0x165638['actions'][_0x4b8bf5][_0xc1c0('0xe4')],'VoiceQueueId':_0x165638[_0xc1c0('0xf5')][_0x4b8bf5][_0xc1c0('0xe5')]||undefined,'CampaignId':_0x165638[_0xc1c0('0xf5')][_0x4b8bf5][_0xc1c0('0xe6')]||undefined})[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0x1f0')));delete _0x165638[_0xc1c0('0xf5')][_0x4b8bf5];});}else{loggerBooked['info'](_0xc1c0('0x1f1'),JSON[_0xc1c0('0x8b')](_0x515fe3[_0xc1c0('0x77')]),_0xc1c0('0x1f2'),_0x515fe3['name']);_0x165638[_0xc1c0('0xc5')](_0x515fe3);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x165638['actions'][_0x4b8bf5][_0xc1c0('0xe3')],'ListId':_0x165638[_0xc1c0('0xf5')][_0x4b8bf5][_0xc1c0('0xe4')],'VoiceQueueId':_0x165638[_0xc1c0('0xf5')][_0x4b8bf5][_0xc1c0('0xe5')]||undefined,'CampaignId':_0x165638[_0xc1c0('0xf5')][_0x4b8bf5][_0xc1c0('0xe6')]||undefined})[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0x1f0')));delete _0x165638['actions'][_0x4b8bf5];}}else{return _0x165638[_0xc1c0('0x1f3')](_0x515fe3,_0x1bdc02);}}else{if(utils['getSeconds'](undefined,_0x1bdc02[_0xc1c0('0x1f4')])<_0x515fe3[_0xc1c0('0x1f5')]*0x3c){if(_0x1bdc02[_0xc1c0('0x15e')]&&!_0x1bdc02[_0xc1c0('0x15e')][_0xc1c0('0x1f6')]){_0x165638['preview'][_0xc1c0('0x101')](_0x1bdc02['id'])['finally'](function(){_0x165638['updateOriginated'](_0x515fe3);});}else{hopperUtils['unlockContact']({'active':![]},_0x1bdc02['id'],0x1)[_0xc1c0('0x1f')](function(){_0x165638[_0xc1c0('0xc5')](_0x515fe3);});}}else{_0x515fe3[_0xc1c0('0x1f7')]+=0x1;_0x165638[_0xc1c0('0xc5')](_0x515fe3);if(_0x515fe3[_0xc1c0('0x1f8')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1bdc02['ContactId'],'ListId':_0x1bdc02['ListId'],'VoiceQueueId':_0x1bdc02[_0xc1c0('0xe5')]||undefined,'CampaignId':_0x1bdc02[_0xc1c0('0xe6')]||undefined})[_0xc1c0('0xa1')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0xc1c0('0xce')](createObjHistory(_0x515fe3,_0x1bdc02,utils['CAMPAIGN_STATUS'][_0xc1c0('0x1f9')],0x17,_0xc1c0('0x1fa')))['catch'](loggerCatch(_0xc1c0('0x1fb')));}else{_0x165638[_0xc1c0('0x120')](createObjHistory(_0x515fe3,_0x1bdc02,utils[_0xc1c0('0x70')][_0xc1c0('0x1fc')],0x16,'RecallFailedTimeout'),_0xc1c0('0x1fd'),_0xc1c0('0x1fe'));}}}}else{_0x515fe3[_0xc1c0('0x1ff')]+=0x1;_0x165638[_0xc1c0('0x120')](createObjHistory(_0x515fe3,_0x1bdc02,utils[_0xc1c0('0x70')][_0xc1c0('0x200')],0xd,'Blacklist'),_0xc1c0('0x201'),_0xc1c0('0x202'));throw _0xc1c0('0x203');}};};Dialer['prototype'][_0xc1c0('0x15f')]=function(_0x251ecc){var _0x1f7422=this;var _0x2cd875=_0x251ecc[_0xc1c0('0x204')]-_0x251ecc[_0xc1c0('0x86')];emitCampaignSummary(_0x251ecc);if(_0x2cd875>0x0&&_0x251ecc[_0xc1c0('0x6b')]==0x0){if(_0x2cd875>this['maxNumberOriginate']){_0x2cd875=this[_0xc1c0('0x26')];}_0x251ecc[_0xc1c0('0x6b')]=0x1;hopperUtils[_0xc1c0('0x205')](_0x251ecc,_0x2cd875)['then'](function(_0x4961a6){_0x251ecc['temp']=0x0;if(_0x4961a6){if(!utils[_0xc1c0('0x206')](_0x4961a6)){_0x251ecc[_0xc1c0('0x6f')]=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0xc1c0('0x49')](_0xc1c0('0x207')+_0x251ecc[_0xc1c0('0x47')]);}else{_0x251ecc['originated']+=_0x4961a6[_0xc1c0('0x14c')];_0x251ecc[_0xc1c0('0x6f')]=utils['CAMPAIGN_STATUS']['RUNNING'];for(var _0x3b6d2a=0x0;_0x3b6d2a<_0x4961a6['length'];_0x3b6d2a+=0x1){_0x251ecc['ivrTotalCallsDays']+=0x1;if(_[_0xc1c0('0xfb')](_0x4961a6[_0x3b6d2a])||_[_0xc1c0('0xfb')](_0x4961a6[_0x3b6d2a][_0xc1c0('0x17b')])||_[_0xc1c0('0xfb')](_0x4961a6[_0x3b6d2a][_0xc1c0('0x163')])){_0x1f7422[_0xc1c0('0x208')]('[actionOriginate]\x20',_0x251ecc,_0x4961a6[_0x3b6d2a]);}else{hopperUtils[_0xc1c0('0x209')](_['pick'](_0x4961a6[_0x3b6d2a],[_0xc1c0('0xe6'),'phone']))['then'](_0x1f7422['checkContactBlack'](_0x251ecc,_0x4961a6[_0x3b6d2a]))[_0xc1c0('0xa1')](_0x1f7422[_0xc1c0('0x20a')](_0xc1c0('0x20b'),_0x251ecc));}}}}})[_0xc1c0('0xa1')](loggerGetContactDialer(_0xc1c0('0x20c'),_0x251ecc,_0x2cd875));}};Dialer[_0xc1c0('0x1d')][_0xc1c0('0xb6')]=function(_0x26649b,_0x18b308){var _0x13df07=this;var _0x1aa416=[];if(_0x18b308<0x1||_0x26649b[_0xc1c0('0xb3')]===_0xc1c0('0x9')){_0x18b308=0x1;}var _0x4c6ad1=Math[_0xc1c0('0x1c5')](_0x26649b['available']*_0x18b308)-_0x26649b[_0xc1c0('0x86')];if(_0x26649b[_0xc1c0('0x20d')]>0x0){var _0x4e1306=_0x26649b[_0xc1c0('0x20d')]-_0x26649b[_0xc1c0('0x86')]-_0x26649b[_0xc1c0('0x142')]-_0x26649b[_0xc1c0('0x20e')];if(_0x4c6ad1>_0x4e1306){_0x4c6ad1=_0x4e1306;}}if(_0x4c6ad1>0x0&&_0x26649b[_0xc1c0('0x6b')]==0x0){if(_0x26649b[_0xc1c0('0xb3')]===_0xc1c0('0x9')){_0x4c6ad1=0x1;}if(_0x4c6ad1>this[_0xc1c0('0x26')]){_0x4c6ad1=this['maxNumberOriginate'];}for(var _0x5398f8 in this['agents']){if(typeof this['agents'][_0x5398f8]!==_0xc1c0('0xac')){if(this['agents'][_0x5398f8][_0xc1c0('0x73')]==='not_inuse'&&this[_0xc1c0('0x24')][_0x5398f8][_0xc1c0('0xfd')]===_0xc1c0('0x8e')){_0x1aa416[_0xc1c0('0xa2')](this['agents'][_0x5398f8]['id']);}}}_0x26649b['temp']=0x1;hopperUtils[_0xc1c0('0x20f')](_0x26649b,_0x1aa416,_0x4c6ad1)[_0xc1c0('0x3f')](function(_0xd9bdfb){_0x26649b[_0xc1c0('0x6b')]=0x0;if(_0xd9bdfb){if(!utils[_0xc1c0('0x206')](_0xd9bdfb)){hopperUtils[_0xc1c0('0x210')](_0x26649b)['then'](sendMessageReschedule(_0x26649b))[_0xc1c0('0xa1')](loggerCatch(_0xc1c0('0x211')));}else{_0x26649b[_0xc1c0('0x86')]+=_0xd9bdfb[_0xc1c0('0x14c')];_0x26649b[_0xc1c0('0x6f')]=_0x26649b[_0xc1c0('0xb3')]===_0xc1c0('0x9')?utils['CAMPAIGN_STATUS'][_0xc1c0('0x143')]:utils[_0xc1c0('0x70')][_0xc1c0('0x212')];for(var _0x235da2=0x0;_0x235da2<_0xd9bdfb[_0xc1c0('0x14c')];_0x235da2+=0x1){if(_['isNil'](_0xd9bdfb[_0x235da2])||_[_0xc1c0('0xfb')](_0xd9bdfb[_0x235da2][_0xc1c0('0x17b')])||_[_0xc1c0('0xfb')](_0xd9bdfb[_0x235da2]['phone'])){_0x13df07['emptyContact'](_0xc1c0('0x213'),_0x26649b,_0xd9bdfb[_0x235da2]);}else{hopperUtils[_0xc1c0('0x214')](_['pick'](_0xd9bdfb[_0x235da2],[_0xc1c0('0xe5'),_0xc1c0('0x163')]))[_0xc1c0('0x3f')](_0x13df07[_0xc1c0('0x1eb')](_0x26649b,_0xd9bdfb[_0x235da2]))[_0xc1c0('0xa1')](_0x13df07['loggerHandler'](_0xc1c0('0x213'),_0x26649b));}}}}})[_0xc1c0('0xa1')](loggerGetContactDialer(_0xc1c0('0x215'),_0x26649b,_0x4c6ad1));}};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x66')]=function(_0x5e712e){if(_0x5e712e[_0xc1c0('0x20d')]>0x0){var _0x397cde=_0x5e712e['dialLimitQueue']-_0x5e712e[_0xc1c0('0x86')]-_0x5e712e['talking'];if(_0x397cde>0x0&&_0x5e712e[_0xc1c0('0x6b')]==0x0){this['tryOriginatePredictive'](_0x5e712e);}else{loggerPredictiveCalls['info'](_0xc1c0('0x216'));}}else{this[_0xc1c0('0x217')](_0x5e712e);}};Dialer[_0xc1c0('0x1d')][_0xc1c0('0x217')]=function(_0x4f17b6){var _0x1f1063=this;var _0x53f084=[];_0x4f17b6[_0xc1c0('0x86')]+=0x1;for(var _0x5c4fbd in this[_0xc1c0('0x24')]){if(typeof this['agents'][_0x5c4fbd]!==_0xc1c0('0xac')){if(this[_0xc1c0('0x24')][_0x5c4fbd][_0xc1c0('0x73')]===_0xc1c0('0x218')&&this[_0xc1c0('0x24')][_0x5c4fbd]['status']===_0xc1c0('0x8e')){_0x53f084[_0xc1c0('0xa2')](this[_0xc1c0('0x24')][_0x5c4fbd]['id']);}}}_0x4f17b6[_0xc1c0('0x6b')]=0x1;return this['getContactDialer'](_0x4f17b6['id'],_0x53f084,0x1,_0x4f17b6[_0xc1c0('0x219')],_0x4f17b6)[_0xc1c0('0x3f')](function(_0x1b593a){_0x4f17b6['temp']=0x1;if(_0x1b593a){if(!utils['checkContactEmpty'](_0x1b593a)){utils[_0xc1c0('0x6a')](_0x4f17b6,0x1,0x0);return hopperUtils[_0xc1c0('0x210')](_0x4f17b6)[_0xc1c0('0x3f')](sendMessageReschedule(_0x4f17b6))[_0xc1c0('0xa1')](loggerCatch('[countReScheduled]\x20'));}else{_0x4f17b6[_0xc1c0('0x6f')]=utils['CAMPAIGN_STATUS'][_0xc1c0('0x212')];if(_[_0xc1c0('0xfb')](_0x1b593a[0x0])||_[_0xc1c0('0xfb')](_0x1b593a[0x0][_0xc1c0('0x17b')])||_[_0xc1c0('0xfb')](_0x1b593a[0x0][_0xc1c0('0x163')])){_0x1f1063[_0xc1c0('0x208')]('[actionOriginate]\x20',_0x4f17b6,_0x1b593a[0x0]);}else{return hopperUtils[_0xc1c0('0x214')](_['pick'](_0x1b593a[0x0],[_0xc1c0('0xe5'),_0xc1c0('0x163')]))[_0xc1c0('0x3f')](_0x1f1063['checkContactBlack'](_0x4f17b6,_0x1b593a[0x0]))[_0xc1c0('0xa1')](_0x1f1063[_0xc1c0('0x20a')](_0xc1c0('0x21a'),_0x4f17b6));}}}})[_0xc1c0('0xa1')](loggerGetContactDialer(_0xc1c0('0x21b'),_0x4f17b6,0x1));};Dialer[_0xc1c0('0x1d')]['abandonmentRate']=function(_0xefc63,_0x1e91c8,_0x4fca07,_0x39fa73,_0x1ef326,_0x360f28){loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x21c'));loggerPredictive['info']('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',_0xefc63);loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x21d'),_0x1e91c8);loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x21e'),_0x4fca07);loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x21f'),_0x39fa73);loggerPredictive[_0xc1c0('0x49')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ef326);loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x54'));return new Promise(function(_0x32695e,_0x409565){if(_0xefc63<=0x0||isNaN(_0xefc63)){return _0x409565(msgResponse(_0xc1c0('0x220'),'Error','m\x20=\x20'+_0xefc63));}if(_0x4fca07<=0x0||isNaN(_0x4fca07)){return _0x409565(msgResponse('[abandonmentRate]',_0xc1c0('0x8a'),_0xc1c0('0x221')+_0x4fca07));}if(_0x39fa73<=0x0||isNaN(_0x39fa73)){return _0x409565(msgResponse(_0xc1c0('0x220'),_0xc1c0('0x8a'),_0xc1c0('0x222')+_0x39fa73));}if(_0x1e91c8<=0x0||isNaN(_0x1e91c8)){return _0x409565(msgResponse(_0xc1c0('0x220'),_0xc1c0('0x8a'),_0xc1c0('0x223')+_0x1e91c8));}if(_0x1ef326<=0x0||isNaN(_0x1ef326)){return _0x409565(msgResponse(_0xc1c0('0x220'),'Error','Amax\x20=\x20'+_0x1ef326));}_0x360f28=_0x360f28||0x0;var _0x5d3026=0x1/_0x4fca07;var _0x58a0da=0x0;var _0x409f74=0x0;var _0x175e41=0x0;var _0x466765=0x0;for(var _0x267197=0x0;_0x175e41<_0x1ef326;_0x267197+=0x1){_0x409f74=_0x267197/_0x1e91c8;_0x58a0da=(_0x39fa73*_0x409f74+_0x360f28)/_0x5d3026;_0x175e41=utils['erlangb'](_0x58a0da,_0xefc63);_0x466765=_0x58a0da/_0xefc63*(0x1-utils[_0xc1c0('0x224')](_0x58a0da,_0xefc63));}return _0x32695e({'erlangCalls':_0x267197,'erlangCallToSecond':_0x1e91c8/_0x267197,'erlangAbandonmentRate':_0x175e41,'erlangBusyFactor':_0x466765});});};Dialer[_0xc1c0('0x1d')]['busyFactor']=function(_0x39a6bb,_0x3c9ec6,_0x3e2f5f,_0x28d0e5,_0x32bc5f,_0x591745){loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x225'));loggerPredictive['info'](_0xc1c0('0x226'),_0x39a6bb);loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x21d'),_0x3c9ec6);loggerPredictive[_0xc1c0('0x49')]('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',_0x3e2f5f);loggerPredictive[_0xc1c0('0x49')]('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',_0x28d0e5);loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x227'),_0x32bc5f);loggerPredictive[_0xc1c0('0x49')](_0xc1c0('0x54'));return new Promise(function(_0x38dbcb,_0x2d1e02){if(_0x39a6bb<=0x0||isNaN(_0x39a6bb)){return _0x2d1e02(msgResponse('[busyFactor]',_0xc1c0('0x8a'),_0xc1c0('0x228')+_0x39a6bb));}if(_0x3e2f5f<=0x0||isNaN(_0x3e2f5f)){return _0x2d1e02(msgResponse(_0xc1c0('0x229'),_0xc1c0('0x8a'),_0xc1c0('0x221')+_0x3e2f5f));}if(_0x28d0e5<=0x0||isNaN(_0x28d0e5)){return _0x2d1e02(msgResponse(_0xc1c0('0x229'),_0xc1c0('0x8a'),_0xc1c0('0x222')+_0x28d0e5));}if(_0x3c9ec6<=0x0||isNaN(_0x3c9ec6)){return _0x2d1e02(msgResponse('[busyFactor]',_0xc1c0('0x8a'),'interval\x20=\x20'+_0x3c9ec6));}if(_0x32bc5f<=0x0||isNaN(_0x32bc5f)){return _0x2d1e02(msgResponse(_0xc1c0('0x229'),_0xc1c0('0x8a'),_0xc1c0('0x22a')+_0x32bc5f));}_0x591745=_0x591745||0x0;var _0x10c627=0x1/_0x3e2f5f;var _0x188730=0x0;var _0x371e35=0x0;var _0x412b81=0x0;var _0x371ca8=0x0;for(var _0x14d0ec=0x0;_0x371ca8<_0x32bc5f;_0x14d0ec+=0x1){_0x371e35=_0x14d0ec/_0x3c9ec6;_0x188730=(_0x28d0e5*_0x371e35+_0x591745)/_0x10c627;_0x412b81=utils['erlangb'](_0x188730,_0x39a6bb);_0x371ca8=_0x188730/_0x39a6bb*(0x1-utils[_0xc1c0('0x224')](_0x188730,_0x39a6bb));}return _0x38dbcb({'erlangCalls':_0x14d0ec,'erlangCallToSecond':_0x3c9ec6/_0x14d0ec,'erlangAbandonmentRate':_0x412b81,'erlangBusyFactor':_0x371ca8});});};module[_0xc1c0('0x22b')]=Dialer; \ No newline at end of file +var _0xe376=['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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','\x20NOT\x20Active','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','Error','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','isTrunkReachable','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','push','Action','command','iftime\x20%s,%s','interval','true','catch','content','indexOf','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','ifTime','resetActiveCalls','syncCampaigns','isIVRCampaign','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','AMI\x20IfTime','[ifTime][Action]','queue','uniqueid','type','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','ivr','outboundAnswerCallsDay','reason','agent','agiafterat','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','getSeconds','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialQueueProject2','countdropretry','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ListId','VoiceQueueId','CampaignId','endtime','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','countglobal','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','rrmemory','roundrobin','isNil','paused','stateinterface','locked','queueBooked','idHopper','strategy','run','[Catch][Preview][syncQueueStatusComplete]','ContactId','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncOriginateResponse','getQueue','response','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','MACHINE','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','membername','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','running','INACTIVE','isPreviewCampaign','getQueueCampaignStatusMessage','resolve','statusMessage','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','assign','throttle','filter','online','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','undefined','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','UserId','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','handleIvr','actionOriginate','object','originate','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','Trunk','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','countbusyretry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','additional','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','available','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','avgHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','startMethodPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','predictiveIntervalPauses','outboundQueuePauses','erlangCallToSecond','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkContactBlack','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','[countReScheduled]\x20','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','dialOrderByScheduledAt','checkIsBlackList','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','util','uuid','ioredis','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','agentcomplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------'];(function(_0x2e44ac,_0x558ce9){var _0x47d2ca=function(_0x5c3fd5){while(--_0x5c3fd5){_0x2e44ac['push'](_0x2e44ac['shift']());}};_0x47d2ca(++_0x558ce9);}(_0xe376,0x1cc));var _0x6e37=function(_0x3382e5,_0x4bfaa8){_0x3382e5=_0x3382e5-0x0;var _0x5efe1a=_0xe376[_0x3382e5];return _0x5efe1a;};'use strict';var util=require(_0x6e37('0x0'));var _=require('lodash');var uuid=require(_0x6e37('0x1'));var moment=require('moment');var rr=require('rr');var Redis=require(_0x6e37('0x2'));var utils=require(_0x6e37('0x3'));var hopperUtils=require('./utils/hopper');var ut=require(_0x6e37('0x4'));var config=require(_0x6e37('0x5'));var logger=require(_0x6e37('0x6'))(_0x6e37('0x7'));var loggerBooked=require(_0x6e37('0x6'))(_0x6e37('0x8'));var loggerPredictive=require(_0x6e37('0x6'))(_0x6e37('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0x6e37('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require('../ami');config[_0x6e37('0xb')]=_[_0x6e37('0xc')](config[_0x6e37('0xb')],{'host':_0x6e37('0xd'),'port':0x18eb});var io=require(_0x6e37('0xe'))(new Redis(config[_0x6e37('0xb')]));var cmHopper=require(_0x6e37('0xf'));var voiceQueueRt=require(_0x6e37('0x10'));var RpcSetting=require(_0x6e37('0x11'));var Interval=require(_0x6e37('0x12'));var Action=require(_0x6e37('0x13'));var History=require(_0x6e37('0x14'));var Final=require('./models/final');var AgentComplete=require(_0x6e37('0x15'));var QueueCallerAbandon=require(_0x6e37('0x16'));var Hangup=require(_0x6e37('0x17'));var ipAgi=process[_0x6e37('0x18')]['XCALLY_IP_AGI']||_0x6e37('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x6e37('0x1a')][_0x6e37('0x1b')]=function(_0x4f785f){this[_0x6e37('0x1c')]=this[_0x6e37('0x1c')]?this[_0x6e37('0x1c')][_0x6e37('0x1d')](_0x4f785f):_0x4f785f();};function Dialer(_0x195a22,_0x2c2b75){this[_0x6e37('0x1e')]=new Sequence();this[_0x6e37('0x1f')]=_0x2c2b75;this['voiceQueues']=_0x195a22[_0x6e37('0x20')];this[_0x6e37('0x21')]=_0x195a22[_0x6e37('0x21')];this['agents']=_0x195a22[_0x6e37('0x22')];this['trunks']=_0x195a22[_0x6e37('0x23')];this[_0x6e37('0x24')]=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x6e37('0x25')]={};this[_0x6e37('0x26')]={};this[_0x6e37('0x27')]={};this[_0x6e37('0x28')]={};this[_0x6e37('0x29')]={};this[_0x6e37('0x2a')]={};this[_0x6e37('0x2b')]={};this['queueBooked']={};this[_0x6e37('0x2c')]={};this[_0x6e37('0x2d')]={};ami['on'](_0x6e37('0x2e'),this[_0x6e37('0x2f')][_0x6e37('0x30')](this));ami['on']('queuecallerabandon',this[_0x6e37('0x31')][_0x6e37('0x30')](this));ami['on'](_0x6e37('0x32'),this['syncOriginateResponse'][_0x6e37('0x30')](this));ami['on'](_0x6e37('0x33'),this['syncAgentComplete'][_0x6e37('0x30')](this));ami['on'](_0x6e37('0x34'),this[_0x6e37('0x35')]['bind'](this));ami['on'](_0x6e37('0x36'),this['syncQueueSummaryComplete'][_0x6e37('0x30')](this));ami['on'](_0x6e37('0x37'),this[_0x6e37('0x38')]['bind'](this));ami['on'](_0x6e37('0x39'),this['syncNewExten'][_0x6e37('0x30')](this));ami['on'](_0x6e37('0x3a'),this[_0x6e37('0x3b')][_0x6e37('0x30')](this));ami['on'](_0x6e37('0x3c'),this['syncQueueMember'][_0x6e37('0x30')](this));ami['on'](_0x6e37('0x3d'),this[_0x6e37('0x3e')][_0x6e37('0x30')](this));this[_0x6e37('0x3f')]();this[_0x6e37('0x40')]();RpcSetting[_0x6e37('0x41')]()[_0x6e37('0x42')](function(_0x12098f){previewRecallmeReminderInterval=_0x12098f[_0x6e37('0x43')];});}function isNotNull(_0x46187c){return _0x46187c!==null&&!_[_0x6e37('0x44')](_0x46187c);}function msgResponse(_0x1428cf,_0x1c38ac,_0xefd268){return{'action':_0x1428cf,'response':_0x1c38ac,'message':_0xefd268,'stack':_0xefd268};}function emit(_0x24fc77,_0x5c117f,_0x18f8c6){io['to'](_0x24fc77)[_0x6e37('0x45')](_0x5c117f,_0x18f8c6);}function emitOutboundVoiceQueueSummary(_0x4c8733){if(_0x4c8733['type']===_0x6e37('0x46')){logger[_0x6e37('0x47')](_0x6e37('0x48'),util[_0x6e37('0x49')](_0x4c8733,{'showHidden':![],'depth':null}));emit(util[_0x6e37('0x4a')](_0x6e37('0x4b'),_0x4c8733[_0x6e37('0x4c')]),_0x6e37('0x4d'),_0x4c8733);}}function checkGetDataPredictive(_0x775cd7){if(isNotNull(_0x775cd7)&&!_[_0x6e37('0x4e')](_0x775cd7)){loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x50'));loggerPredictive['info'](_0x6e37('0x51'),_0x775cd7[_0x6e37('0x52')]);loggerPredictive[_0x6e37('0x4f')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x775cd7[_0x6e37('0x53')]);loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x54'),_0x775cd7[_0x6e37('0x55')]);loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x56'),_0x775cd7[_0x6e37('0x57')]);loggerPredictive['info'](_0x6e37('0x58'),_0x775cd7[_0x6e37('0x59')]);loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x5a'),_0x775cd7['predictiveIntervalAvgTalktime']);loggerPredictive[_0x6e37('0x4f')]('---------------------------');if(_0x775cd7[_0x6e37('0x52')]>0x0){if(!_['isUndefined'](_0x775cd7[_0x6e37('0x5b')])&&_0x775cd7[_0x6e37('0x5b')]>0x0){return!![];}loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x5c'));if(!_['isUndefined'](_0x775cd7['predictiveIntervalAvgHoldtime'])&&_0x775cd7['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x5d'));}}else{loggerPredictive['info'](_0x6e37('0x5e'));}return![];}function mergeDataErlangB(_0x2435f1){return function(_0x3f3067){loggerPredictive['info'](_0x6e37('0x5f'));loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x60'),_0x3f3067[_0x6e37('0x61')]);loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x62'),_0x3f3067['erlangCallToSecond']);loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x63'),_0x3f3067[_0x6e37('0x64')]);loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x65'),_0x3f3067['erlangBusyFactor']);loggerPredictive[_0x6e37('0x4f')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3f3067[_0x6e37('0x64')]);loggerPredictive[_0x6e37('0x4f')]('---------------------------');_[_0x6e37('0x66')](_0x2435f1,_0x3f3067);};}function ifInterval(_0x1c9913,_0x5ed828){if(_[_0x6e37('0x44')](_0x5ed828)){return![];}return utils['getSeconds'](undefined,_0x5ed828)<_0x1c9913*0x3c;}function clearPredictiveAttributes(_0x5e5e74){if(_0x5e5e74[_0x6e37('0x2a')]){_0x5e5e74['startProgressive']=undefined;loggerPredictive[_0x6e37('0x47')](_0x5e5e74[_0x6e37('0x4c')],'startProgressive\x20value\x20cleared');}if(_0x5e5e74['startPredictive']){_0x5e5e74[_0x6e37('0x29')]=undefined;loggerPredictive[_0x6e37('0x47')](_0x5e5e74[_0x6e37('0x4c')],'startPredictive\x20value\x20cleared');}if(_0x5e5e74['handlePredictive']){clearInterval(_0x5e5e74[_0x6e37('0x67')]);_0x5e5e74['handlePredictive']=undefined;loggerPredictive[_0x6e37('0x47')](_0x5e5e74[_0x6e37('0x4c')],_0x6e37('0x68'));}}function loggerCatchPredictive(_0xb9d36c,_0x53117e){return function(_0x294120){loggerPredictive['error'](_0x53117e[_0x6e37('0x4c')],_0xb9d36c);loggerPredictive[_0x6e37('0x69')](_0x294120['stack']);clearPredictiveAttributes(_0x53117e);};}function loggerCatch(_0x54711b){return function(_0x2bb31c){logger[_0x6e37('0x69')](_0x54711b,util['inspect'](_0x2bb31c,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x541c23,_0x4c6a62,_0x5e613a){return function(_0x3533f3){utils[_0x6e37('0x6a')](_0x4c6a62,_0x5e613a,0x0);_0x4c6a62['temp']=0x0;logger[_0x6e37('0x69')](_0x541c23,util['inspect'](_0x3533f3,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4415f5){return function(_0x4899ef){if(isNotNull(_0x4899ef)&&isNotNull(_0x4899ef[0x0])){if(_0x4899ef[0x0]['contactsRescheduled']>0x0){_0x4415f5[_0x6e37('0x6b')]=utils[_0x6e37('0x6c')][_0x6e37('0x6d')];logger[_0x6e37('0x4f')](_0x6e37('0x6e')+_0x4415f5[_0x6e37('0x4c')],_0x4899ef[0x0][_0x6e37('0x6f')],_0x6e37('0x70'));}else{_0x4415f5['message']=utils[_0x6e37('0x6c')][_0x6e37('0x71')];logger[_0x6e37('0x4f')](_0x6e37('0x72')+_0x4415f5[_0x6e37('0x4c')]);}}};}function createObjHistory(_0x2c8328,_0x433261,_0x28d01e,_0x7d4a67,_0x21888f){_0x2c8328[_0x6e37('0x6b')]=_0x28d01e;var _0x5cd9fd=new Action(_0x2c8328,_0x433261);var _0x2a8895=new History(_0x5cd9fd);_0x2a8895[_0x6e37('0x73')]=_0x7d4a67;_0x2a8895[_0x6e37('0x74')]=_0x21888f;_0x2a8895['endtime']=_0x5cd9fd['starttime'];return _0x2a8895;}function unlockQueueStatus(_0x3e5120,_0x188e5d){setTimeout(function(){if(_[_0x6e37('0x44')](_0x3e5120[_0x6e37('0x75')])){loggerBooked[_0x6e37('0x69')]('[unlockQueueStatus][undefined]',_0x188e5d);}_0x3e5120[_0x6e37('0x75')]=!![];loggerBooked[_0x6e37('0x4f')](_0x6e37('0x76'),_0x188e5d,JSON[_0x6e37('0x77')](_[_0x6e37('0x78')](_0x3e5120,[_0x6e37('0x4c'),_0x6e37('0x75')])));},0x1f3);}function checkInterval(_0x31f119){return function(){if(!isNotNull(_0x31f119[_0x6e37('0x79')])){_0x31f119[_0x6e37('0x6b')]=utils[_0x6e37('0x6c')][_0x6e37('0x7a')];throw _0x31f119[_0x6e37('0x4c')]+_0x6e37('0x7b');}if(!isNotNull(_0x31f119[_0x6e37('0x79')][_0x6e37('0x7c')])){_0x31f119[_0x6e37('0x6b')]=utils['CAMPAIGN_STATUS'][_0x6e37('0x7a')];throw _0x31f119[_0x6e37('0x4c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x31f119[_0x6e37('0x79')][_0x6e37('0x7c')]))){_0x31f119[_0x6e37('0x6b')]=utils['CAMPAIGN_STATUS'][_0x6e37('0x7a')];throw _0x31f119[_0x6e37('0x4c')]+_0x6e37('0x7b');}};}function checkIsIVRCampaignActive(_0x57e38d){return function(){if(!utils[_0x6e37('0x7d')](_0x57e38d)){_0x57e38d[_0x6e37('0x6b')]=utils[_0x6e37('0x6c')]['INACTIVE'];throw _0x57e38d[_0x6e37('0x4c')]+_0x6e37('0x7e');}};}function emitCampaignSummary(_0x382dbe){if(utils['isIVRCampaign'](_0x382dbe)){emit(util[_0x6e37('0x4a')]('campaign:ivr:%s',_0x382dbe[_0x6e37('0x4c')]),_0x6e37('0x7f'),_0x382dbe);}}function loggerCatchQueueSummary(_0x1efc2d,_0x2118c2){return function(_0x58d66a){clearPredictiveAttributes(_0x2118c2);emitCampaignSummary(_0x2118c2);loggerSyncQueueSummary[_0x6e37('0x47')](_0x1efc2d,util['inspect'](_0x58d66a,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x340997){if(_0x340997[_0x6e37('0x80')]){if(_0x340997[_0x6e37('0x81')]===0x0){_0x340997[_0x6e37('0x80')]=![];_0x340997['message']=utils['CAMPAIGN_STATUS']['INACTIVE'];loggerSyncQueueSummary[_0x6e37('0x47')](_0x6e37('0x82'),_0x340997['name'],_0x6e37('0x83'));}else{_0x340997['message']=utils['CAMPAIGN_STATUS'][_0x6e37('0x84')];loggerSyncQueueSummary[_0x6e37('0x47')](_0x6e37('0x82'),_0x340997['name'],'is\x20disactive');}emitCampaignSummary(_0x340997);}}function myreject(_0x152995){return function(_0x93f230){return _0x152995(msgResponse('[ifTime][Action]',_0x6e37('0x85'),JSON[_0x6e37('0x77')](_0x93f230)));};}Dialer['prototype']['isTrunkReachable']=function(_0xd46e84){return!_[_0x6e37('0x44')](_0xd46e84)&&_0xd46e84&&!_[_0x6e37('0x44')](_0xd46e84['name'])&&!_['isUndefined'](_0xd46e84['active'])&&_0xd46e84['active']&&(this[_0x6e37('0x23')][util[_0x6e37('0x4a')](_0x6e37('0x86'),_0xd46e84['name'])][_0x6e37('0x87')]===_0x6e37('0x88')||this[_0x6e37('0x23')][util[_0x6e37('0x4a')](_0x6e37('0x86'),_0xd46e84[_0x6e37('0x4c')])][_0x6e37('0x87')]===_0x6e37('0x89'));};Dialer['prototype'][_0x6e37('0x8a')]=function(_0x3b4b30){var _0x4c47b9=this;return function(){if(!_0x4c47b9[_0x6e37('0x8b')](_0x3b4b30['Trunk'])){if(!_0x4c47b9[_0x6e37('0x8b')](_0x3b4b30['TrunkBackup'])){_0x3b4b30['message']=utils['CAMPAIGN_STATUS'][_0x6e37('0x8c')];throw _0x3b4b30[_0x6e37('0x4c')]+_0x6e37('0x8d');}}};};Dialer[_0x6e37('0x1a')][_0x6e37('0x8e')]=function(_0x111309,_0x752d67,_0x21e324,_0x3778d0){var _0x540542=this;return function(){var _0x295274=!![];return _0x540542[_0x6e37('0x8f')](_0x111309,_0x752d67,_0x21e324,_0x3778d0,_0x295274);};};Dialer[_0x6e37('0x1a')]['checkIfTimeIntervals']=function(_0x3f9a68,_0x1840ae,_0x1b7f19,_0x412e12){var _0x5abc8e=this;return function(){var _0x42ce8f=![];return _0x5abc8e[_0x6e37('0x8f')](_0x3f9a68[_0x6e37('0x7c')],_0x1840ae,_0x1b7f19,_0x412e12,_0x42ce8f);};};Dialer['prototype'][_0x6e37('0x8f')]=function(_0x1aaaa8,_0x4de8c4,_0x40f7c7,_0x16f890,_0x2bacb9){var _0xd42429=[];return new Promise(function(_0x1d28fa,_0x3b4599){if(!isNotNull(_0x1aaaa8)){_0x16f890[_0x6e37('0x6b')]=utils['CAMPAIGN_STATUS'][_0x6e37('0x7a')];return _0x3b4599(msgResponse('ifTime',_0x6e37('0x90'),_0x40f7c7+_0x6e37('0x91')));}if(_[_0x6e37('0x4e')](_0x1aaaa8)){_0x16f890[_0x6e37('0x6b')]=utils['CAMPAIGN_STATUS'][_0x6e37('0x92')];return _0x3b4599(msgResponse('ifTime','Failure',_0x40f7c7+'\x20Intervals\x20is\x20empty\x20'));}if(_0x4de8c4&&_[_0x6e37('0x44')](config[_0x6e37('0x93')][_0x4de8c4])){_0x16f890[_0x6e37('0x6b')]=utils[_0x6e37('0x6c')][_0x6e37('0x94')];return _0x3b4599(msgResponse('ifTime',_0x6e37('0x90'),_0x40f7c7+_0x6e37('0x95')+_0x4de8c4));}if(_[_0x6e37('0x96')](_0x1aaaa8)){for(var _0x2b0049=0x0;_0x2b0049<_0x1aaaa8['length'];_0x2b0049+=0x1){_0xd42429[_0x6e37('0x97')](ami[_0x6e37('0x98')]({'action':_0x6e37('0x99'),'command':util[_0x6e37('0x4a')](_0x6e37('0x9a'),_0x1aaaa8[_0x2b0049][_0x6e37('0x9b')],!_[_0x6e37('0x44')](config[_0x6e37('0x93')][_0x4de8c4])?_0x4de8c4:'')})[_0x6e37('0x42')](function(_0x15fe11){return _0x15fe11['content']['indexOf'](_0x6e37('0x9c'))>=0x0;})[_0x6e37('0x9d')](myreject(_0x3b4599)));}}else{_0xd42429[_0x6e37('0x97')](ami[_0x6e37('0x98')]({'action':_0x6e37('0x99'),'command':util['format'](_0x6e37('0x9a'),_0x1aaaa8,!_[_0x6e37('0x44')](config[_0x6e37('0x93')][_0x4de8c4])?_0x4de8c4:'')})[_0x6e37('0x42')](function(_0xe15c2c){return _0xe15c2c[_0x6e37('0x9e')][_0x6e37('0x9f')](_0x6e37('0x9c'))>=0x0;})['catch'](myreject(_0x3b4599)));}Promise[_0x6e37('0xa0')](_0xd42429)[_0x6e37('0x42')](function(_0x1e8530){var _0x1a12d4=_[_0x6e37('0xa1')](_0x1e8530);if(_0x1a12d4){return _0x1d28fa(_0x1a12d4);}else{_0x16f890[_0x6e37('0x6b')]=_0x2bacb9?utils[_0x6e37('0x6c')][_0x6e37('0xa2')]:utils['CAMPAIGN_STATUS'][_0x6e37('0xa3')];return _0x3b4599(msgResponse(_0x6e37('0xa4'),_0x6e37('0x90'),_0x6e37('0xa5')+_0x2bacb9+'\x20'+_0x40f7c7+'\x20Interval\x20is\x20overtime:\x20'+util[_0x6e37('0x49')](_0x1aaaa8,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x4de8c4));}})[_0x6e37('0x9d')](function(_0x492152){return _0x3b4599(msgResponse(_0x6e37('0xa6'),_0x6e37('0x90'),JSON[_0x6e37('0x77')](_0x492152)));});});};Dialer[_0x6e37('0x1a')][_0x6e37('0x3f')]=function(){var _0x367e2f=this;return cmHopper[_0x6e37('0xa7')]({'active':![]},{'where':{'active':!![]}})[_0x6e37('0x42')](function(){setInterval(function(){_0x367e2f[_0x6e37('0xa8')]();},0x3e8);});};Dialer['prototype']['syncCampaigns']=function(){var _0x3aff8f=this;var _0x7b8570;for(var _0xfd89bb in this[_0x6e37('0x21')]){if(typeof this[_0x6e37('0x21')][_0xfd89bb]!=='undefined'){_0x7b8570=this[_0x6e37('0x21')][_0xfd89bb];if(utils[_0x6e37('0xa9')](_0x7b8570)&&utils['isIVRCampaignActive'](_0x7b8570)){_0x7b8570[_0x6e37('0x80')]=!![];Promise['resolve']()[_0x6e37('0x42')](checkIsIVRCampaignActive(_0x7b8570))['then'](checkInterval(_0x7b8570))[_0x6e37('0x42')](_0x3aff8f['checkIsTrunkReachable'](_0x7b8570))[_0x6e37('0x42')](_0x3aff8f['checkIfTime'](_0x7b8570[_0x6e37('0xaa')],_0x7b8570[_0x6e37('0xab')],_0x7b8570[_0x6e37('0x4c')],_0x7b8570))['then'](_0x3aff8f[_0x6e37('0xac')](_0x7b8570[_0x6e37('0x79')],_0x7b8570[_0x6e37('0xab')],_0x7b8570[_0x6e37('0x4c')],_0x7b8570))[_0x6e37('0x42')](_0x3aff8f[_0x6e37('0xad')](_0x7b8570))[_0x6e37('0x9d')](loggerCatchQueueSummary(_0x6e37('0xae'),_0x7b8570));}else{notSendMessagesCampaign(_0x7b8570);}}}};Dialer[_0x6e37('0x1a')][_0x6e37('0xaf')]=function(_0x4678bd){if(_0x4678bd[_0x6e37('0xb0')]!==_0x6e37('0x9')){clearPredictiveAttributes(_0x4678bd);}switch(_0x4678bd[_0x6e37('0xb0')]){case _0x6e37('0xb1'):this[_0x6e37('0xb2')](_0x4678bd,0x1);break;case _0x6e37('0xb3'):this[_0x6e37('0xb2')](_0x4678bd,_0x4678bd[_0x6e37('0xb4')]);break;case'predictive':this[_0x6e37('0x9')](_0x4678bd);break;case _0x6e37('0x8'):this[_0x6e37('0xb2')](_0x4678bd,0x1);break;default:logger[_0x6e37('0x69')](_0x6e37('0xb5'),_0x4678bd['name'],_0x6e37('0xb6'));}};Dialer[_0x6e37('0x1a')]['ifTime']=function(_0xe3928,_0x3efb0f){var _0x199869=_0xe3928['dialTimezone'];var _0x29f0f3=_0x3efb0f?_0xe3928['dialGlobalInterval']:_0xe3928['Interval'][_0x6e37('0x7c')];logger[_0x6e37('0xb7')](_0x6e37('0xb8'),_0x29f0f3,_0x199869,_0xe3928[_0x6e37('0x4c')],util['format'](_0x6e37('0xb9'),_0xe3928[_0x6e37('0x4c')],_0xe3928['id']));var _0x23b255=null;return Interval['intervalIftime'](_0x29f0f3,_0x199869)[_0x6e37('0x42')](function(_0xd0e561){if(_0xd0e561===!![]){return _0xd0e561;}else{_0xe3928[_0x6e37('0x6b')]=_0x3efb0f?utils[_0x6e37('0x6c')][_0x6e37('0xa2')]:utils[_0x6e37('0x6c')]['OVERTIME_INTERVAL'];_0x23b255=msgResponse(_0x6e37('0xa4'),_0x6e37('0x90'),_0x6e37('0xa5')+_0x3efb0f+'\x20'+_0xe3928['name']+_0x6e37('0xba')+util[_0x6e37('0x49')](_0x29f0f3,{'showHidden':![],'depth':null})+_0x6e37('0xbb')+_0x199869);}if(_0x23b255!==null){logger[_0x6e37('0xb7')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x23b255);_0x23b255['isGlobal']=_0x3efb0f;throw _0x23b255;}})['catch'](function(_0x1618fe){logger[_0x6e37('0x69')](_0x6e37('0xbc'),_0x1618fe);throw msgResponse(_0x6e37('0xbd'),_0x6e37('0x85'),util[_0x6e37('0x49')](_0x1618fe,{'showHidden':![],'depth':null}));});};Dialer[_0x6e37('0x1a')][_0x6e37('0x2f')]=function(_0x49c9df){if(this['voiceQueues'][_0x49c9df[_0x6e37('0xbe')]]){if(this[_0x6e37('0x27')][_0x49c9df[_0x6e37('0xbf')]]&&this[_0x6e37('0x27')][_0x49c9df[_0x6e37('0xbf')]][_0x6e37('0xc0')]!=='ivr'){this[_0x6e37('0xc1')](this[_0x6e37('0x20')][_0x49c9df['queue']]);this[_0x6e37('0x27')][_0x49c9df[_0x6e37('0xbf')]][_0x6e37('0xc2')]=moment()[_0x6e37('0x4a')](_0x6e37('0xc3'));}}};Dialer[_0x6e37('0x1a')][_0x6e37('0xc4')]=function(_0x1e52d2){var _0x11a61f=this[_0x6e37('0x27')][_0x1e52d2['uniqueid']];if(this[_0x6e37('0x20')][_0x1e52d2[_0x6e37('0xbe')]]){if(_0x11a61f&&_0x11a61f[_0x6e37('0xc0')]!==_0x6e37('0xc5')){delete this[_0x6e37('0x27')][_0x1e52d2[_0x6e37('0xbf')]];this[_0x6e37('0x20')][_0x1e52d2['queue']][_0x6e37('0xc6')]+=0x1;var _0x2ae0e1=new AgentComplete(_0x11a61f,_0x1e52d2);if(_0x1e52d2[_0x6e37('0xc7')]===_0x6e37('0xc8')){_0x2ae0e1[_0x6e37('0xc9')]=this[_0x6e37('0x20')][_0x1e52d2[_0x6e37('0xbe')]]['dialQueueProject2']&&this[_0x6e37('0x20')][_0x1e52d2[_0x6e37('0xbe')]][_0x6e37('0xca')]?moment()[_0x6e37('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0x6e37('0xcb')](_0x2ae0e1)[_0x6e37('0x9d')](loggerCatch(_0x6e37('0xcc')));hopperUtils[_0x6e37('0xcd')](_0x2ae0e1)['catch'](loggerCatch(_0x6e37('0xce')));}}};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x33f628){var _0x1ba6f2=this[_0x6e37('0x27')][_0x33f628[_0x6e37('0xbf')]];var _0x2c40e1=this;var _0x312115=![];var _0x2af9e9;var _0x4f290e;if(this[_0x6e37('0x20')][_0x33f628[_0x6e37('0xbe')]]){if(_0x1ba6f2&&_0x1ba6f2[_0x6e37('0xc0')]!==_0x6e37('0xc5')){delete this[_0x6e37('0x27')][_0x33f628[_0x6e37('0xbf')]];this[_0x6e37('0xc1')](this[_0x6e37('0x20')][_0x33f628[_0x6e37('0xbe')]]);_0x1ba6f2[_0x6e37('0xcf')]=moment()[_0x6e37('0x4a')](_0x6e37('0xc3'));var _0x13a22b=new QueueCallerAbandon(_0x1ba6f2,_0x33f628);if(utils[_0x6e37('0xd0')](_0x1ba6f2[_0x6e37('0xcf')],_0x1ba6f2[_0x6e37('0xd1')])>=_0x1ba6f2[_0x6e37('0xd2')]){this[_0x6e37('0x20')][_0x33f628[_0x6e37('0xbe')]][_0x6e37('0x55')]+=0x1;this[_0x6e37('0x20')][_0x33f628[_0x6e37('0xbe')]][_0x6e37('0xd3')]+=0x1;this[_0x6e37('0x20')][_0x33f628['queue']][_0x6e37('0xd4')]+=0x1;_0x13a22b['state']=0xa;_0x13a22b[_0x6e37('0x74')]=_0x6e37('0xd5');_0x13a22b[_0x6e37('0xd6')]=_0x6e37('0xd7');_0x13a22b[_0x6e37('0xc9')]=this[_0x6e37('0x20')][_0x33f628[_0x6e37('0xbe')]][_0x6e37('0xd8')]?moment()[_0x6e37('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x13a22b[_0x6e37('0xd9')]+=0x1;_0x13a22b['countglobal']+=0x1;_0x2af9e9=this['voiceQueues'][_0x33f628[_0x6e37('0xbe')]][_0x6e37('0xda')];_0x4f290e=this['voiceQueues'][_0x33f628[_0x6e37('0xbe')]][_0x6e37('0xdb')];hopperUtils[_0x6e37('0xdc')](_0x13a22b,_0x13a22b[_0x6e37('0x73')],_0x1ba6f2[_0x6e37('0xdd')])[_0x6e37('0x42')](function(_0x250d26){_0x312115=_0x250d26['additional']==0x1;if(_0x13a22b[_0x6e37('0xd9')]>=_0x2c40e1['voiceQueues'][_0x33f628[_0x6e37('0xbe')]]['dialDropMaxRetry']){_0x2c40e1[_0x6e37('0xde')](_0x13a22b,_0x250d26['additional']);}else{hopperUtils[_0x6e37('0xdf')]({'active':![],'countdropretry':_0x13a22b['countdropretry'],'scheduledat':moment()[_0x6e37('0xe0')](_0x2c40e1['voiceQueues'][_0x33f628[_0x6e37('0xbe')]][_0x6e37('0xda')],_0x6e37('0xe1'))[_0x6e37('0x4a')](_0x6e37('0xc3')),'ContactId':_0x1ba6f2['ContactId'],'ListId':_0x1ba6f2[_0x6e37('0xe2')],'VoiceQueueId':_0x1ba6f2[_0x6e37('0xe3')]||undefined,'CampaignId':_0x1ba6f2[_0x6e37('0xe4')]||undefined})[_0x6e37('0x9d')](loggerCatch('[rescheduleContact][Drop]'));var _0x51b05e=new History(_0x13a22b);_0x51b05e[_0x6e37('0x73')]=0xa;_0x51b05e[_0x6e37('0x74')]=_0x6e37('0xd5');_0x51b05e['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x51b05e[_0x6e37('0xe5')]=_0x51b05e[_0x6e37('0xe6')];_0x51b05e[_0x6e37('0xe7')]=_0x13a22b[_0x6e37('0xe7')];_0x51b05e[_0x6e37('0xe8')]=_0x13a22b[_0x6e37('0xe8')];hopperUtils[_0x6e37('0xcb')](_0x51b05e)[_0x6e37('0x9d')](loggerCatch(_0x6e37('0xe9')));}})[_0x6e37('0x42')](function(){if(_0x312115)hopperUtils[_0x6e37('0xea')](_0x13a22b,_0x2af9e9,_0x4f290e)['then'](function(){return 0x1;});});}else{this[_0x6e37('0x20')][_0x33f628['queue']][_0x6e37('0x57')]+=0x1;this[_0x6e37('0x20')][_0x33f628[_0x6e37('0xbe')]][_0x6e37('0xeb')]+=0x1;_0x13a22b['state']=0xb;_0x13a22b[_0x6e37('0x74')]=_0x6e37('0xec');_0x13a22b[_0x6e37('0xd6')]=_0x6e37('0xed');_0x13a22b[_0x6e37('0xee')]+=0x1;_0x13a22b[_0x6e37('0xef')]+=0x1;_0x2af9e9=this[_0x6e37('0x20')][_0x33f628[_0x6e37('0xbe')]][_0x6e37('0xf0')];_0x4f290e=this[_0x6e37('0x20')][_0x33f628[_0x6e37('0xbe')]][_0x6e37('0xdb')];hopperUtils['verifyAdditionalPhones'](_0x13a22b,_0x13a22b[_0x6e37('0x73')],_0x1ba6f2['voiceQueue'])['then'](function(_0x43b124){if(_0x13a22b[_0x6e37('0xee')]>=_0x2c40e1['voiceQueues'][_0x33f628['queue']][_0x6e37('0xf1')]){_0x2c40e1['queueCallerAbandonCreateState'](_0x13a22b,_0x43b124['additional']);}else{hopperUtils[_0x6e37('0xdf')]({'active':![],'countabandonedretry':_0x13a22b[_0x6e37('0xee')],'scheduledat':moment()[_0x6e37('0xe0')](_0x2c40e1[_0x6e37('0x20')][_0x33f628['queue']][_0x6e37('0xf0')],_0x6e37('0xe1'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1ba6f2['ContactId'],'ListId':_0x1ba6f2['ListId'],'VoiceQueueId':_0x1ba6f2[_0x6e37('0xe3')]||undefined,'CampaignId':_0x1ba6f2[_0x6e37('0xe4')]||undefined})[_0x6e37('0x9d')](loggerCatch(_0x6e37('0xf2')));var _0x30e8d6=new History(_0x13a22b);_0x30e8d6[_0x6e37('0x73')]=0xb;_0x30e8d6['statedesc']=_0x6e37('0xec');_0x30e8d6['starttime']=moment()[_0x6e37('0x4a')](_0x6e37('0xc3'));_0x30e8d6[_0x6e37('0xe5')]=_0x30e8d6['starttime'];_0x30e8d6[_0x6e37('0xe7')]=_0x13a22b[_0x6e37('0xe7')];_0x30e8d6[_0x6e37('0xe8')]=_0x13a22b[_0x6e37('0xe8')];hopperUtils[_0x6e37('0xcb')](_0x30e8d6)[_0x6e37('0x9d')](loggerCatch(_0x6e37('0xf3')));}})[_0x6e37('0x42')](function(){if(_0x312115)hopperUtils['swapAdditionalPhones'](_0x13a22b,_0x2af9e9,_0x4f290e)[_0x6e37('0x42')](function(){return 0x1;});});}}}};Dialer[_0x6e37('0x1a')][_0x6e37('0xf4')]=function(_0x1096de){if(this[_0x6e37('0x25')][_0x1096de[_0x6e37('0xbf')]]){this[_0x6e37('0x25')][_0x1096de['uniqueid']][_0x6e37('0xf5')]=_0x1096de[_0x6e37('0xf5')];}if(this[_0x6e37('0x27')][_0x1096de[_0x6e37('0xbf')]]){this[_0x6e37('0x27')][_0x1096de[_0x6e37('0xbf')]][_0x6e37('0xf5')]=_0x1096de['channel'];}};Dialer[_0x6e37('0x1a')]['syncQueueMember']=function(_0x531cea){if(!this[_0x6e37('0x25')][_0x531cea[_0x6e37('0xf6')]]){return;}var _0x1e7e9b=this[_0x6e37('0x20')][this[_0x6e37('0x25')][_0x531cea['actionid']][_0x6e37('0xbe')]]['strategy']||_0x6e37('0xf7');if(_0x1e7e9b===_0x6e37('0xf8')){if(this[_0x6e37('0x25')][_0x531cea[_0x6e37('0xf6')]]&&_[_0x6e37('0xf9')](this[_0x6e37('0x25')][_0x531cea['actionid']]['locked'])&&_0x531cea[_0x6e37('0x87')]==='1'&&_0x531cea[_0x6e37('0xfa')]==='0'){if(this[_0x6e37('0x22')][_0x531cea[_0x6e37('0xfb')]]){if(!this['agents'][_0x531cea[_0x6e37('0xfb')]][_0x6e37('0xfc')]){this[_0x6e37('0x22')][_0x531cea['stateinterface']][_0x6e37('0xfc')]=!![];this[_0x6e37('0x25')][_0x531cea[_0x6e37('0xf6')]][_0x6e37('0xfc')]=!![];this['actions'][_0x531cea['actionid']]['stateinterface']=_0x531cea['stateinterface'];}}}}else if(_0x1e7e9b===_0x6e37('0xf7')){if(this[_0x6e37('0x25')][_0x531cea[_0x6e37('0xf6')]]){if(this[_0x6e37('0x22')][_0x531cea[_0x6e37('0xfb')]]){this[_0x6e37('0x25')][_0x531cea[_0x6e37('0xf6')]][_0x6e37('0xfb')]=_0x531cea[_0x6e37('0xfb')];if(_[_0x6e37('0xf9')](this[_0x6e37('0xfd')][this['actions'][_0x531cea[_0x6e37('0xf6')]][_0x6e37('0xbe')]])){this[_0x6e37('0xfd')][this[_0x6e37('0x25')][_0x531cea[_0x6e37('0xf6')]][_0x6e37('0xbe')]]=[];}this['queueBooked'][this['actions'][_0x531cea[_0x6e37('0xf6')]]['queue']][_0x6e37('0x97')](_[_0x6e37('0x66')](_[_0x6e37('0x78')](this[_0x6e37('0x25')][_0x531cea[_0x6e37('0xf6')]],[_0x6e37('0xfe'),_0x6e37('0xfb')]),{'status':_0x531cea['status'],'paused':_0x531cea['paused']}));}}}};Dialer['prototype'][_0x6e37('0x3e')]=function(_0x43688a){if(!this[_0x6e37('0x25')][_0x43688a[_0x6e37('0xf6')]]){return;}var _0x123d54=this;var _0x22329d=this[_0x6e37('0x20')][this[_0x6e37('0x25')][_0x43688a[_0x6e37('0xf6')]]['queue']];var _0x20177c=_0x22329d[_0x6e37('0xff')]||_0x6e37('0xf7');if(_0x20177c==='roundrobin'){if(this[_0x6e37('0x25')][_0x43688a[_0x6e37('0xf6')]]&&this[_0x6e37('0x25')][_0x43688a[_0x6e37('0xf6')]][_0x6e37('0xfb')]){this[_0x6e37('0x1f')][_0x6e37('0x100')](this[_0x6e37('0x25')][_0x43688a['actionid']][_0x6e37('0xfe')],this[_0x6e37('0x25')][_0x43688a['actionid']]['stateinterface'])['catch'](function(_0x34dc94){logger[_0x6e37('0x69')](_0x6e37('0x101'),util[_0x6e37('0x49')](_0x34dc94,{'showHidden':![],'depth':null}));})[_0x6e37('0x1d')](function(){_0x123d54['updateOriginated'](_0x123d54[_0x6e37('0x20')][_0x123d54[_0x6e37('0x25')][_0x43688a['actionid']][_0x6e37('0xbe')]]);_0x123d54['agents'][_0x123d54[_0x6e37('0x25')][_0x43688a[_0x6e37('0xf6')]]['stateinterface']][_0x6e37('0xfc')]=![];delete _0x123d54[_0x6e37('0x25')][_0x43688a['actionid']];unlockQueueStatus(_0x22329d);});}else{this[_0x6e37('0xc1')](this[_0x6e37('0x20')][this[_0x6e37('0x25')][_0x43688a[_0x6e37('0xf6')]][_0x6e37('0xbe')]]);hopperUtils[_0x6e37('0xdf')]({'active':![],'ContactId':this[_0x6e37('0x25')][_0x43688a[_0x6e37('0xf6')]][_0x6e37('0x102')],'ListId':this['actions'][_0x43688a[_0x6e37('0xf6')]]['ListId'],'VoiceQueueId':this[_0x6e37('0x25')][_0x43688a[_0x6e37('0xf6')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x6e37('0x25')][_0x43688a['actionid']][_0x6e37('0xe4')]||undefined})[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x103')));delete this[_0x6e37('0x25')][_0x43688a['actionid']];unlockQueueStatus(_0x22329d);}}else if(_0x20177c===_0x6e37('0xf7')){var _0x409298;if(this['actions'][_0x43688a['actionid']]&&!_['isEmpty'](this[_0x6e37('0xfd')][this[_0x6e37('0x25')][_0x43688a['actionid']]['queue']])){if(this[_0x6e37('0x2c')][_0x123d54[_0x6e37('0x25')][_0x43688a[_0x6e37('0xf6')]][_0x6e37('0xbe')]]){this[_0x6e37('0x2c')][_0x123d54[_0x6e37('0x25')][_0x43688a['actionid']][_0x6e37('0xbe')]]=this[_0x6e37('0x2c')][this[_0x6e37('0x25')][_0x43688a['actionid']][_0x6e37('0xbe')]]?this[_0x6e37('0x2c')][this[_0x6e37('0x25')][_0x43688a[_0x6e37('0xf6')]][_0x6e37('0xbe')]]:this[_0x6e37('0xfd')][this[_0x6e37('0x25')][_0x43688a[_0x6e37('0xf6')]]['queue']]?this[_0x6e37('0xfd')][this[_0x6e37('0x25')][_0x43688a[_0x6e37('0xf6')]]['queue']][_0x6e37('0x104')]||0x0:0x0;}this[_0x6e37('0xfd')][this[_0x6e37('0x25')][_0x43688a[_0x6e37('0xf6')]]['queue']][_0x6e37('0x104')]=this[_0x6e37('0x2c')][this[_0x6e37('0x25')][_0x43688a['actionid']][_0x6e37('0xbe')]];for(var _0xb0aa3d=0x0;_0xb0aa3d=_0x53b9ca[_0x6e37('0x128')]){_0x428ee4[_0x6e37('0x129')](_0x1f07b0,_0x338354,_0xd106fc,_0x6e37('0x12a'));}else{if(_0x1f07b0[_0x6e37('0x126')]>=_0x53b9ca[_0x6e37('0x12b')]){_0x428ee4[_0x6e37('0x12c')](_0x1f07b0,_0x338354,_0xd106fc,_0x6e37('0x12d'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x1f07b0[_0x6e37('0x126')],'scheduledat':moment()[_0x6e37('0xe0')](_0x53b9ca[_0x6e37('0x12e')],_0x6e37('0xe1'))['format'](_0x6e37('0xc3')),'ContactId':_0x1f07b0[_0x6e37('0x102')],'ListId':_0x1f07b0['ListId'],'VoiceQueueId':_0x1f07b0['VoiceQueueId']||undefined,'CampaignId':_0x1f07b0[_0x6e37('0xe4')]||undefined})['catch'](loggerCatch(_0x6e37('0x12f')));_0x338354({'reschedule':0x1});}}});}if(_0x514c88[_0x6e37('0xc0')]==='ivr'&&this[_0x6e37('0x21')][_0x514c88[_0x6e37('0xbe')]][_0x6e37('0x116')]&&_0x1c6ac1[_0x6e37('0x117')]===_0x6e37('0x118')){delete this['uniqueId'][_0x1c6ac1[_0x6e37('0xbf')]];this[_0x6e37('0xc1')](this['campaigns'][_0x514c88[_0x6e37('0xbe')]]);_0x481e30=new Hangup(_0x514c88,_0x1c6ac1);_0x481e30['state']=0x12;_0x481e30['statedesc']=_0x6e37('0x11a');_0x481e30['membername']=_0x6e37('0x11b');ami[_0x6e37('0x45')](_0x6e37('0x11c'),ut[_0x6e37('0x11d')](_0x481e30,'amd'));this[_0x6e37('0x11f')](_0x481e30,_0x6e37('0x130'),_0x6e37('0x131'));}if(_0x514c88[_0x6e37('0xc0')]===_0x6e37('0xc5')&&this[_0x6e37('0x21')][_0x514c88[_0x6e37('0xbe')]]['dialAMDActive']&&_0x1c6ac1[_0x6e37('0x117')]===_0x6e37('0x121')){return new Promise(function(_0x5b4860,_0x18c07c){delete _0x428ee4[_0x6e37('0x27')][_0x1c6ac1['uniqueid']];_0x428ee4[_0x6e37('0xc1')](_0x428ee4[_0x6e37('0x21')][_0x514c88[_0x6e37('0xbe')]]);_0x428ee4[_0x6e37('0x21')][_0x514c88[_0x6e37('0xbe')]][_0x6e37('0xc6')]+=0x1;_0x428ee4['campaigns'][_0x514c88[_0x6e37('0xbe')]][_0x6e37('0x119')]+=0x1;var _0x3a6cb5=_0x428ee4[_0x6e37('0x21')][_0x514c88[_0x6e37('0xbe')]];var _0x17691c=new Hangup(_0x514c88,_0x1c6ac1);_0x17691c[_0x6e37('0x73')]=0x13;_0x17691c[_0x6e37('0x74')]=_0x6e37('0x132');_0x17691c[_0x6e37('0x133')]=_0x6e37('0x11b');_0x17691c[_0x6e37('0x126')]+=0x1;_0x17691c[_0x6e37('0xef')]+=0x1;_0x17691c['amd']=!![];ami[_0x6e37('0x45')]('custom:amd',ut[_0x6e37('0x11d')](_0x17691c,_0x6e37('0x11e')));hopperUtils[_0x6e37('0xcb')](_0x17691c)[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x122')));if(_0x17691c['countbusyretry']+_0x17691c[_0x6e37('0x123')]+_0x17691c[_0x6e37('0x124')]+_0x17691c[_0x6e37('0x125')]+_0x17691c[_0x6e37('0xd9')]+_0x17691c[_0x6e37('0xee')]+_0x17691c['countmachineretry']+_0x17691c[_0x6e37('0x127')]>=_0x3a6cb5['dialGlobalMaxRetry']){_0x428ee4[_0x6e37('0x129')](_0x17691c,_0x5b4860,_0x18c07c,_0x6e37('0x12a'));}else{if(_0x17691c[_0x6e37('0x126')]>=_0x3a6cb5['dialMachineMaxRetry']){_0x428ee4['createStateFinal'](_0x17691c,_0x5b4860,_0x18c07c,_0x6e37('0x12d'));}else{hopperUtils[_0x6e37('0xdf')]({'active':![],'countmachineretry':_0x17691c[_0x6e37('0x126')],'scheduledat':moment()[_0x6e37('0xe0')](_0x3a6cb5['dialMachineRetryFrequency'],_0x6e37('0xe1'))['format'](_0x6e37('0xc3')),'ContactId':_0x17691c[_0x6e37('0x102')],'ListId':_0x17691c['ListId'],'VoiceQueueId':_0x17691c[_0x6e37('0xe3')]||undefined,'CampaignId':_0x17691c[_0x6e37('0xe4')]||undefined})[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x12f')));_0x5b4860({'reschedule':0x1});}}});}}};Dialer[_0x6e37('0x1a')]['syncHangup']=function(_0x1d450b){var _0x3267f0=this[_0x6e37('0x27')][_0x1d450b[_0x6e37('0xbf')]];var _0xc3796b;if(_0x3267f0&&_0x3267f0[_0x6e37('0xc0')]===_0x6e37('0xc5')){delete this[_0x6e37('0x27')][_0x1d450b[_0x6e37('0xbf')]];this[_0x6e37('0xc1')](this[_0x6e37('0x21')][_0x3267f0['queue']]);this[_0x6e37('0x21')][_0x3267f0['queue']][_0x6e37('0x134')]+=0x1;_0xc3796b=new Hangup(_0x3267f0,_0x1d450b);hopperUtils[_0x6e37('0xcb')](_0xc3796b)[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x135')));hopperUtils['moveContactManagedDialer'](_0xc3796b)['catch'](loggerCatch(_0x6e37('0x136')));}if(_0x3267f0&&_0x3267f0[_0x6e37('0xc0')]!==_0x6e37('0xc5')&&isNotNull(this[_0x6e37('0x20')][_0x3267f0[_0x6e37('0xbe')]][_0x6e37('0x137')])){delete this[_0x6e37('0x27')][_0x1d450b[_0x6e37('0xbf')]];this[_0x6e37('0xc1')](this[_0x6e37('0x20')][_0x3267f0[_0x6e37('0xbe')]]);this[_0x6e37('0x20')][_0x3267f0['queue']][_0x6e37('0xc6')]+=0x1;this[_0x6e37('0x20')][_0x3267f0[_0x6e37('0xbe')]][_0x6e37('0x119')]+=0x1;_0xc3796b=new Hangup(_0x3267f0,_0x1d450b);_0xc3796b['state']=0x10;_0xc3796b[_0x6e37('0x74')]=_0x6e37('0x138');_0xc3796b[_0x6e37('0x133')]=_0x6e37('0x139');hopperUtils['createHistory'](_0xc3796b)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x6e37('0xcd')](_0xc3796b)[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x136')));}if(_0x3267f0&&_0x3267f0[_0x6e37('0xc0')]!==_0x6e37('0xc5')&&!isNotNull(this['voiceQueues'][_0x3267f0[_0x6e37('0xbe')]][_0x6e37('0x137')])){delete this['uniqueId'][_0x1d450b['uniqueid']];this[_0x6e37('0xc1')](this[_0x6e37('0x20')][_0x3267f0[_0x6e37('0xbe')]]);this[_0x6e37('0x20')][_0x3267f0[_0x6e37('0xbe')]]['outboundUnknownCallsDay']+=0x1;_0xc3796b=new Hangup(_0x3267f0,_0x1d450b);_0xc3796b[_0x6e37('0x73')]=0xc;_0xc3796b[_0x6e37('0x74')]=_0x1d450b[_0x6e37('0x13a')];_0xc3796b[_0x6e37('0x133')]='Unknow';hopperUtils[_0x6e37('0xcb')](_0xc3796b)[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x135')));hopperUtils[_0x6e37('0xcd')](_0xc3796b)[_0x6e37('0x9d')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x6e37('0x1a')][_0x6e37('0x35')]=function(_0x33cd46){var _0x1b8358=this;if(!_0x1b8358[_0x6e37('0x2d')][_0x33cd46[_0x6e37('0x4c')]]){_0x1b8358['queuesSummary'][_0x33cd46['name']]={'running':![]};}else if(_0x1b8358[_0x6e37('0x2d')][_0x33cd46[_0x6e37('0x4c')]]['running']===!![]){return;}else if(_0x1b8358[_0x6e37('0x2d')][_0x33cd46[_0x6e37('0x4c')]][_0x6e37('0x13b')]===![]){_0x1b8358[_0x6e37('0x2d')][_0x33cd46[_0x6e37('0x4c')]]['running']=!![];}var _0xd38a5f=_0x1b8358[_0x6e37('0x20')][_0x33cd46['name']];var _0x47a1f0=_0xd38a5f[_0x6e37('0x6b')]!==utils['CAMPAIGN_STATUS'][_0x6e37('0x13c')];var _0x1b6541=utils[_0x6e37('0x13d')](_0xd38a5f);_0xd38a5f['statusMessage']=utils[_0x6e37('0x13e')](_0xd38a5f,_0x1b8358[_0x6e37('0x23')]);Promise[_0x6e37('0x13f')]()['then'](function(){if(_0xd38a5f[_0x6e37('0x140')]===utils[_0x6e37('0x6c')][_0x6e37('0x13c')]){if(_0x47a1f0){clearPredictiveAttributes(_0xd38a5f);_0x33cd46[_0x6e37('0x29')]=undefined;_0x33cd46[_0x6e37('0x2a')]=undefined;}if(_0xd38a5f[_0x6e37('0x140')]===utils[_0x6e37('0x6c')][_0x6e37('0x13c')]){_0x33cd46['available']=0x0;_0x33cd46['paused']=0x0;_0x33cd46[_0x6e37('0x141')]=0x0;_0x33cd46[_0x6e37('0x142')]=0x0;_0x33cd46[_0x6e37('0x143')]=0x0;}}else if(_0xd38a5f[_0x6e37('0x140')]===utils['CAMPAIGN_STATUS'][_0x6e37('0x144')]&&!_0x1b6541){return _0x1b8358['ifTime'](_0xd38a5f,!![])[_0x6e37('0x42')](function(){return _0x1b8358[_0x6e37('0xa6')](_0xd38a5f,![]);})['then'](function(){return _0x1b8358[_0x6e37('0xaf')](_0xd38a5f);})['catch'](function(_0x531d28){loggerSyncQueueSummary[_0x6e37('0x47')](_0x6e37('0x145'),util[_0x6e37('0x49')](_0x531d28,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0xd38a5f);});}else{clearPredictiveAttributes(_0xd38a5f);}})[_0x6e37('0x42')](function(){var _0x1861c4=_0x33cd46['compareToOutboundQueue'](_0xd38a5f);if(_0x1861c4||_0xd38a5f[_0x6e37('0x146')]){_0xd38a5f[_0x6e37('0x146')]=![];_0x33cd46['updateReportFromOutboundQueue'](_0xd38a5f);Object[_0x6e37('0x147')](_0xd38a5f,_0x33cd46);emitOutboundVoiceQueueSummary(_0x33cd46);}_0x1b8358['queuesSummary'][_0xd38a5f['name']][_0x6e37('0x13b')]=![];})['catch'](function(_0xb17057){logger['error'](_0x6e37('0x145'),util[_0x6e37('0x49')](_0xb17057,{'showHidden':![],'depth':null}));_0x1b8358['queuesSummary'][_0xd38a5f['name']][_0x6e37('0x13b')]=![];});};Dialer[_0x6e37('0x1a')]['syncQueueSummaryComplete']=_[_0x6e37('0x148')](function(){var _0x288eba=_[_0x6e37('0x149')](this['voiceQueues'],function(_0xd3de04){return _0xd3de04['dialPreviewRecallmeReminder'];});var _0x1464e8=_[_0x6e37('0x149')](this['agents'],function(_0x5c62cf){return _0x5c62cf[_0x6e37('0x14a')]&&_0x5c62cf[_0x6e37('0x87')]===_0x6e37('0x88');});if(_0x288eba['length']>0x0&&_0x1464e8['length']>0x0){return Promise[_0x6e37('0x13f')]()[_0x6e37('0x42')](cmHopper[_0x6e37('0x14b')](_[_0x6e37('0x14c')](_0x288eba,'id'),previewRecallmeReminderInterval,_[_0x6e37('0x14c')](_0x1464e8,'id')))['then'](function(_0x2e8236){for(var _0x4668b9=0x0;_0x4668b9<_0x2e8236[_0x6e37('0x105')];_0x4668b9++){var _0x46e968=_0x2e8236[_0x4668b9][_0x6e37('0x14d')][_0x6e37('0x4c')];if(_0x46e968)io['to'](util[_0x6e37('0x4a')](_0x6e37('0x14e'),_0x46e968))[_0x6e37('0x45')](_0x6e37('0x14f'),{'hopper':_0x2e8236[_0x4668b9]});}})['catch'](function(_0x4429bc){logger[_0x6e37('0x69')](_0x6e37('0x150'),_0x4429bc);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x6e37('0x40')]=function(){var _0x386211=this;setInterval(function(){_0x386211[_0x6e37('0x151')](_0x386211[_0x6e37('0x27')],_0x6e37('0x152'));_0x386211[_0x6e37('0x151')](_0x386211[_0x6e37('0x25')],_0x6e37('0x153'));},0x32c8);};Dialer[_0x6e37('0x1a')][_0x6e37('0x151')]=function(_0x598046,_0x5abf1b){var _0x1cb7bb=this;for(var _0x5c2c8f in _0x598046){if(typeof _0x598046[_0x5c2c8f]!==_0x6e37('0x154')){this[_0x6e37('0x1e')][_0x6e37('0x1b')](function(){if(!_[_0x6e37('0xf9')](_0x598046[_0x5c2c8f])){return ami[_0x6e37('0x98')]({'action':_0x6e37('0x87'),'channel':_0x598046[_0x5c2c8f]['channel']})['catch'](function(_0xe337e2){if(_0xe337e2['message']===_0x6e37('0x155')){setTimeout(function(){if(_0x598046[_0x5c2c8f]&&_0x598046[_0x5c2c8f][_0x6e37('0xc0')]!=='ivr'){_0x1cb7bb['updateOriginated'](_0x1cb7bb['voiceQueues'][_0x598046[_0x5c2c8f][_0x6e37('0xbe')]]);logger[_0x6e37('0x69')](_0x6e37('0x156'),_0x5abf1b,_0x5c2c8f,_0x598046[_0x5c2c8f]['queue']);delete _0x598046[_0x5c2c8f];}if(_0x598046[_0x5c2c8f]&&_0x598046[_0x5c2c8f][_0x6e37('0xc0')]===_0x6e37('0xc5')){_0x1cb7bb['updateOriginated'](_0x1cb7bb[_0x6e37('0x21')][_0x598046[_0x5c2c8f][_0x6e37('0xbe')]]);logger[_0x6e37('0x69')](_0x6e37('0x157'),_0x5abf1b,_0x5c2c8f,_0x598046[_0x5c2c8f][_0x6e37('0xbe')]);delete _0x598046[_0x5c2c8f];}},0x2328);}});}});}}};Dialer[_0x6e37('0x1a')][_0x6e37('0x158')]=function(_0x4fdef1){return Promise['resolve']()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x4fdef1))[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x159')));};Dialer[_0x6e37('0x1a')][_0x6e37('0xc1')]=function(_0x206957){if(!_[_0x6e37('0x44')](_0x206957)&&_0x206957!==null){if(typeof _0x206957[_0x6e37('0x81')]!==_0x6e37('0x154')){if(_0x206957[_0x6e37('0x81')]>0x0){_0x206957[_0x6e37('0x81')]-=0x1;}else{logger[_0x6e37('0x69')](_0x6e37('0x15a'));}}}else{logger['error'](_0x6e37('0x15b'));}};Dialer[_0x6e37('0x1a')]['loggerHandler']=function(_0x3d5a9b,_0x36a610){var _0xf4b5b9=this;return function(_0x5cd43c){_0xf4b5b9['updateOriginated'](_0x36a610);logger[_0x6e37('0x69')](_0x3d5a9b,util[_0x6e37('0x49')](_0x5cd43c,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x6e37('0x15c')]=function(_0x30637d,_0x496640,_0x3fda22){var _0x5702e6={'state':0x19,'statedesc':_0x6e37('0x15d')};this[_0x6e37('0xc1')](_0x496640);this[_0x6e37('0x11f')](_['merge'](_0x5702e6,_['pick'](_0x3fda22,[_0x6e37('0x102'),_0x6e37('0xe2'),_0x6e37('0x15e'),'VoiceQueueId','CampaignId'])),_0x6e37('0x15f'),'[emptyContact]');logger[_0x6e37('0x69')](_0x30637d);};Dialer[_0x6e37('0x1a')][_0x6e37('0x11f')]=function(_0x56a8c7,_0x40a6d7,_0x502690){hopperUtils[_0x6e37('0xcb')](_0x56a8c7)[_0x6e37('0x9d')](loggerCatch(_0x40a6d7));hopperUtils['moveContactManagedDialer'](_0x56a8c7)[_0x6e37('0x9d')](loggerCatch(_0x502690));};Dialer[_0x6e37('0x1a')][_0x6e37('0xde')]=function(_0x372785,_0x57c66f){hopperUtils[_0x6e37('0xcb')](_0x372785)[_0x6e37('0x9d')](loggerCatch(_0x6e37('0xcc')));if(_0x57c66f==0x0){hopperUtils[_0x6e37('0xcd')](_0x372785)[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x160')));}};Dialer[_0x6e37('0x1a')][_0x6e37('0x150')]=function(_0x5b152a){return Promise['resolve']()[_0x6e37('0x42')](cmHopper['handlePreviewRecallNotifications'](_0x5b152a['id'],previewRecallmeReminderInterval))[_0x6e37('0x42')](function(_0x598ae4){for(var _0x1bc5d3=0x0;_0x1bc5d3<_0x598ae4[_0x6e37('0x105')];_0x1bc5d3++){var _0x29d8ad=_0x598ae4[_0x1bc5d3][_0x6e37('0x14d')][_0x6e37('0x4c')];if(_0x29d8ad)io['to'](util[_0x6e37('0x4a')]('user:%s',_0x29d8ad))[_0x6e37('0x45')](_0x6e37('0x14f'),{'hopper':_0x598ae4[_0x1bc5d3]});}})[_0x6e37('0x9d')](function(){});};Dialer[_0x6e37('0x1a')][_0x6e37('0xad')]=function(_0x47491b){var _0x1cba91=this;return function(){_0x1cba91[_0x6e37('0x161')](_0x47491b);};};Dialer['prototype'][_0x6e37('0x162')]=function(_0x2d447a,_0x4c0d81){var _0x23c6ae=this;var _0x2724a1=uuid['v4']();this[_0x6e37('0x25')][_0x2724a1]=new Action(_0x2d447a,_0x4c0d81,_0x2724a1);return new Promise(function(_0x7a4e9f,_0x41b7bb){if(_['isUndefined'](_0x2d447a)&&typeof _0x2d447a!==_0x6e37('0x163')){return _0x41b7bb(msgResponse(_0x6e37('0x164'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0x6e37('0x44')](_0x4c0d81[_0x6e37('0x165')])||_0x4c0d81[_0x6e37('0x165')]===null){return _0x41b7bb(msgResponse(_0x6e37('0x164'),_0x6e37('0x90'),'contact\x20is\x20undefine'));}var _0x40364f={'XMD-CALLERID':_0x23c6ae['actions'][_0x2724a1][_0x6e37('0x166')](),'XMD-AGI':_0x2d447a['dialQueueProject']?util['format'](_0x6e37('0x167'),ipAgi,_0x2d447a[_0x6e37('0x137')]):_0x6e37('0x168'),'XMD-AGIAFTER':_0x2d447a[_0x6e37('0xd8')]?util[_0x6e37('0x4a')](_0x6e37('0x167'),ipAgi,_0x2d447a[_0x6e37('0xd8')]):_0x6e37('0x168'),'XMD-QUEUE':utils[_0x6e37('0x169')](_0x2d447a)?util[_0x6e37('0x4a')](_0x6e37('0x16a'),_0x2d447a['name'],_0x2d447a['dialQueueOptions']||'',_0x2d447a[_0x6e37('0xca')]?'c':'',_0x2d447a['dialQueueTimeout']||0x3):_0x6e37('0x168'),'XMD-CONTACTID':_0x4c0d81['ContactId'],'XMD-CDRTYPE':_0x6e37('0x7'),'CALLERID(all)':_0x23c6ae[_0x6e37('0x25')][_0x2724a1][_0x6e37('0x166')](),'XMD-AMD':_0x2d447a['dialAMDActive']?_0x6e37('0x144'):_0x6e37('0x168'),'XMD-DESTINATION':_0x6e37('0x115')};if(_0x2d447a['dialAMDActive']){_0x40364f[_0x6e37('0x16b')]=_0x2d447a['dialAMDInitialSilence']||0x9c4;_0x40364f[_0x6e37('0x16c')]=_0x2d447a[_0x6e37('0x16d')]||0x5dc;_0x40364f[_0x6e37('0x16e')]=_0x2d447a[_0x6e37('0x16f')]||0x320;_0x40364f[_0x6e37('0x170')]=_0x2d447a[_0x6e37('0x171')]||0x1388;_0x40364f[_0x6e37('0x172')]=_0x2d447a[_0x6e37('0x173')]||0x64;_0x40364f[_0x6e37('0x174')]=_0x2d447a['dialAMDBetweenWordsSilence']||0x32;_0x40364f[_0x6e37('0x175')]=_0x2d447a[_0x6e37('0x176')]||0x3;_0x40364f[_0x6e37('0x177')]=_0x2d447a[_0x6e37('0x178')]||0x100;_0x40364f[_0x6e37('0x179')]=_0x2d447a[_0x6e37('0x17a')]||0x1388;}if(utils['isOutboundQueue'](_0x2d447a)){_0x40364f['XMD-VOICEQUEUEID']=_0x4c0d81['VoiceQueueId'];}else{_0x40364f[_0x6e37('0x17b')]=_0x4c0d81[_0x6e37('0xe4')];}var _0x8a913e=utils[_0x6e37('0x17c')](_0x4c0d81[_0x6e37('0x17d')]);Object[_0x6e37('0x147')](_0x40364f,_0x8a913e);var _0x528f4f=_0x23c6ae['isTrunkReachable'](_0x2d447a['Trunk'])?utils[_0x6e37('0x17e')](_0x2d447a['Trunk'][_0x6e37('0x17f')],_0x2d447a[_0x6e37('0x180')],_0x2d447a[_0x6e37('0x181')]>0x0?utils[_0x6e37('0x182')](_0x2d447a[_0x6e37('0x183')],_0x2d447a[_0x6e37('0x181')]):_0x2d447a[_0x6e37('0x183')]):utils[_0x6e37('0x17e')](_['isNil'](_0x2d447a[_0x6e37('0x184')])?_0x2d447a['Trunk'][_0x6e37('0x17f')]:_0x2d447a['TrunkBackup'][_0x6e37('0x17f')],_0x2d447a[_0x6e37('0x180')],_0x2d447a[_0x6e37('0x181')]>0x0?utils[_0x6e37('0x182')](_0x2d447a[_0x6e37('0x183')],_0x2d447a['dialRandomLastDigitCallerIdNumber']):_0x2d447a[_0x6e37('0x183')]);if(_0x528f4f){_0x40364f[_0x6e37('0x185')]=_0x23c6ae['actions'][_0x2724a1][_0x6e37('0x186')]=utils['extractCalleridName'](_0x528f4f);_0x40364f[_0x6e37('0x187')]=_0x4c0d81[_0x6e37('0x165')];}_0x2d447a[_0x6e37('0x188')]=_0x40364f;return ami[_0x6e37('0x98')]({'actionid':_0x2724a1,'action':_0x6e37('0x164'),'channel':_0x23c6ae[_0x6e37('0x8b')](_0x2d447a['Trunk'])?util[_0x6e37('0x4a')](_0x6e37('0x189'),_0x2d447a[_0x6e37('0x18a')]['name'],isNotNull(_0x2d447a[_0x6e37('0x18b')])?_0x2d447a[_0x6e37('0x18b')][_0x6e37('0x18c')]()||'':'',_0x2d447a[_0x6e37('0x18d')]>0x0?_0x4c0d81[_0x6e37('0x165')][_0x6e37('0x18e')](_0x2d447a[_0x6e37('0x18d')]):_0x4c0d81[_0x6e37('0x165')]):util[_0x6e37('0x4a')]('SIP/%s/%s%s',_['isNil'](_0x2d447a[_0x6e37('0x184')])?_0x2d447a['Trunk']['name']:_0x2d447a[_0x6e37('0x184')]['name'],isNotNull(_0x2d447a[_0x6e37('0x18b')])?_0x2d447a['dialPrefix'][_0x6e37('0x18c')]()||'':'',_0x2d447a[_0x6e37('0x18d')]>0x0?_0x4c0d81[_0x6e37('0x165')][_0x6e37('0x18e')](_0x2d447a[_0x6e37('0x18d')]):_0x4c0d81[_0x6e37('0x165')]),'callerid':_0x528f4f,'Exten':'xcally-motion-dialer','Context':_0x6e37('0x18f'),'Priority':'1','variable':_0x40364f,'timeout':(_0x2d447a[_0x6e37('0x190')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2724a1})['then'](function(_0x43884e){return _0x7a4e9f(_0x43884e);})[_0x6e37('0x9d')](function(_0x242b3f){_0x2d447a[_0x6e37('0x191')]+=0x1;var _0x19846d=new History(_0x23c6ae[_0x6e37('0x25')][_0x2724a1]);logger[_0x6e37('0x69')](util[_0x6e37('0x4a')](_0x6e37('0x192'),JSON[_0x6e37('0x77')](_0x242b3f)));_0x19846d[_0x6e37('0x73')]=0xe;_0x19846d[_0x6e37('0x74')]=_0x6e37('0x193');_0x19846d[_0x6e37('0xe6')]=moment()['format'](_0x6e37('0xc3'));_0x19846d[_0x6e37('0xe5')]=_0x19846d['starttime'];hopperUtils[_0x6e37('0xcb')](_0x19846d)[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x194')));_0x23c6ae[_0x6e37('0xcd')](_0x19846d)[_0x6e37('0x9d')](loggerCatch('[originate][error]'))[_0x6e37('0x1d')](function(){delete _0x23c6ae[_0x6e37('0x25')][_0x2724a1];return _0x41b7bb(msgResponse(_0x6e37('0x164'),'Error',_0x6e37('0x195')));});});});};Dialer[_0x6e37('0x1a')][_0x6e37('0x196')]=function(_0x478406,_0x2f7c30,_0x442776){var _0x1a6425=new History(_0x2f7c30);if(_0x1a6425[_0x6e37('0x197')]+_0x1a6425[_0x6e37('0x123')]+_0x1a6425[_0x6e37('0x124')]+_0x1a6425['countnosuchnumberretry']+_0x1a6425[_0x6e37('0xd9')]+_0x1a6425[_0x6e37('0xee')]+_0x1a6425[_0x6e37('0x126')]+_0x1a6425[_0x6e37('0x127')]>=_0x442776[_0x6e37('0x128')]-0x1){return!![];}switch(_0x478406){case 0x3:if(_0x1a6425[_0x6e37('0x124')]>=_0x442776[_0x6e37('0x198')]-0x1){return!![];}hopperUtils[_0x6e37('0xdf')]({'active':![],'countnoanswerretry':_0x1a6425['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x6e37('0xe0')](_0x442776['dialNoAnswerRetryFrequency'],'minutes')[_0x6e37('0x4a')](_0x6e37('0xc3')),'ContactId':_0x1a6425[_0x6e37('0x102')],'ListId':_0x1a6425[_0x6e37('0xe2')],'VoiceQueueId':_0x1a6425[_0x6e37('0xe3')]||undefined,'CampaignId':_0x1a6425[_0x6e37('0xe4')]||undefined})[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x199')));break;case 0x5:if(_0x1a6425[_0x6e37('0x197')]>=_0x442776[_0x6e37('0x19a')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x1a6425['countbusyretry']+=0x1,'scheduledat':moment()[_0x6e37('0xe0')](_0x442776[_0x6e37('0x19b')],'minutes')[_0x6e37('0x4a')](_0x6e37('0xc3')),'ContactId':_0x1a6425[_0x6e37('0x102')],'ListId':_0x1a6425[_0x6e37('0xe2')],'VoiceQueueId':_0x1a6425[_0x6e37('0xe3')]||undefined,'CampaignId':_0x1a6425['CampaignId']||undefined})['catch'](loggerCatch(_0x6e37('0x19c')));break;case 0x8:if(_0x1a6425['countcongestionretry']>=_0x442776[_0x6e37('0x19d')]-0x1){return!![];}hopperUtils[_0x6e37('0xdf')]({'active':![],'countcongestionretry':_0x1a6425[_0x6e37('0x123')]+=0x1,'scheduledat':moment()[_0x6e37('0xe0')](_0x442776[_0x6e37('0x19e')],_0x6e37('0xe1'))[_0x6e37('0x4a')](_0x6e37('0xc3')),'ContactId':_0x1a6425[_0x6e37('0x102')],'ListId':_0x1a6425[_0x6e37('0xe2')],'VoiceQueueId':_0x1a6425['VoiceQueueId']||undefined,'CampaignId':_0x1a6425[_0x6e37('0xe4')]||undefined})[_0x6e37('0x9d')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x1a6425[_0x6e37('0x125')]>=_0x442776[_0x6e37('0x19f')]-0x1){return!![];}else{hopperUtils[_0x6e37('0xdf')]({'active':![],'countnosuchnumberretry':_0x1a6425[_0x6e37('0x125')]+=0x1,'scheduledat':moment()['add'](_0x442776[_0x6e37('0x1a0')],_0x6e37('0xe1'))['format'](_0x6e37('0xc3')),'ContactId':_0x1a6425[_0x6e37('0x102')],'ListId':_0x1a6425[_0x6e37('0xe2')],'VoiceQueueId':_0x1a6425['VoiceQueueId']||undefined,'CampaignId':_0x1a6425['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x1a6425[_0x6e37('0xd9')]>=_0x442776[_0x6e37('0x1a1')]-0x1){return!![];}hopperUtils[_0x6e37('0xdf')]({'active':![],'countdropretry':_0x1a6425['countdropretry']+=0x1,'scheduledat':moment()[_0x6e37('0xe0')](_0x442776['dialDropRetryFrequency'],_0x6e37('0xe1'))[_0x6e37('0x4a')](_0x6e37('0xc3')),'ContactId':_0x1a6425[_0x6e37('0x102')],'ListId':_0x1a6425[_0x6e37('0xe2')],'VoiceQueueId':_0x1a6425[_0x6e37('0xe3')]||undefined,'CampaignId':_0x1a6425['CampaignId']||undefined})[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x1a2')));break;case 0xb:if(_0x1a6425['countabandonedretry']>=_0x442776[_0x6e37('0xf1')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x1a6425[_0x6e37('0xee')]+=0x1,'scheduledat':moment()[_0x6e37('0xe0')](_0x442776[_0x6e37('0xf0')],'minutes')['format'](_0x6e37('0xc3')),'ContactId':_0x1a6425['ContactId'],'ListId':_0x1a6425[_0x6e37('0xe2')],'VoiceQueueId':_0x1a6425['VoiceQueueId']||undefined,'CampaignId':_0x1a6425[_0x6e37('0xe4')]||undefined})[_0x6e37('0x9d')](loggerCatch(_0x6e37('0xf2')));break;case 0x13:if(_0x1a6425['countmachineretry']>=_0x442776[_0x6e37('0x12b')]-0x1){return!![];}hopperUtils[_0x6e37('0xdf')]({'active':![],'countmachineretry':_0x1a6425[_0x6e37('0x126')]+=0x1,'scheduledat':moment()[_0x6e37('0xe0')](_0x442776['dialMachineRetryFrequency'],'minutes')[_0x6e37('0x4a')](_0x6e37('0xc3')),'ContactId':_0x1a6425[_0x6e37('0x102')],'ListId':_0x1a6425[_0x6e37('0xe2')],'VoiceQueueId':_0x1a6425[_0x6e37('0xe3')]||undefined,'CampaignId':_0x1a6425[_0x6e37('0xe4')]||undefined})[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x12f')));break;case 0x14:if(_0x1a6425[_0x6e37('0x127')]>=_0x442776[_0x6e37('0x1a3')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x1a6425[_0x6e37('0x127')]+=0x1,'scheduledat':moment()['add'](_0x442776[_0x6e37('0x1a4')],_0x6e37('0xe1'))[_0x6e37('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1a6425[_0x6e37('0x102')],'ListId':_0x1a6425['ListId'],'VoiceQueueId':_0x1a6425[_0x6e37('0xe3')]||undefined,'CampaignId':_0x1a6425['CampaignId']||undefined})[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x1a5')));break;default:return!![];}};Dialer[_0x6e37('0x1a')][_0x6e37('0x1a6')]=function(_0x15d286,_0x2742f9,_0x3ec83c){var _0x7a367=this;var _0x3d2847=new History(_0x15d286);var _0x1254a3=![];var _0x2d6f4b;var _0x392587;return new Promise(function(_0x57ab3a,_0x3eb6b1){if(_['isUndefined'](_0x2742f9)&&typeof _0x2742f9!==_0x6e37('0x163')){return _0x3eb6b1(msgResponse(_0x6e37('0x1a7'),'Failure',_0x6e37('0x1a8')));}if(_[_0x6e37('0x44')](_0x3ec83c)&&typeof _0x3ec83c!==_0x6e37('0x163')){return _0x3eb6b1(msgResponse(_0x6e37('0x1a7'),_0x6e37('0x90'),_0x6e37('0x1a9')));}hopperUtils[_0x6e37('0xdc')](_0x3d2847,_0x3ec83c[_0x6e37('0xc7')],_0x2742f9)[_0x6e37('0x42')](function(_0x2cf733){if(_0x2cf733[_0x6e37('0x1aa')]==0x1)_0x1254a3=!![];switch(_0x3ec83c['reason']){case'0':_0x2742f9[_0x6e37('0x1ab')]+=0x1;_0x3d2847['state']=0x0;_0x3d2847['statedesc']=_0x6e37('0x1ac');_0x3d2847[_0x6e37('0x125')]+=0x1;_0x3d2847['countglobal']+=0x1;ami[_0x6e37('0x45')](_0x6e37('0x1ad'),ut[_0x6e37('0x11d')](_0x15d286,_0x6e37('0x1ae')));_0x2d6f4b=_0x2742f9[_0x6e37('0x1a0')];_0x392587=_0x2742f9['callAdditionalPhoneAfterMin'];hopperUtils[_0x6e37('0xcb')](_0x3d2847)[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x122')));if(_0x7a367[_0x6e37('0x196')](0x0,_0x15d286,_0x2742f9)&&!_0x1254a3){if(_0x3d2847['countnosuchnumberretry']>=_0x2742f9[_0x6e37('0x19f')]){_0x7a367['createStateFinal'](_0x3d2847,_0x57ab3a,_0x3eb6b1,_0x6e37('0x1af'));}else{_0x7a367['stateGlobal'](_0x3d2847,_0x57ab3a,_0x3eb6b1,_0x6e37('0x1af'));}}break;case'3':_0x2742f9[_0x6e37('0x1b0')]+=0x1;_0x3d2847[_0x6e37('0x73')]=0x3;_0x3d2847[_0x6e37('0x74')]=_0x6e37('0x1b1');_0x3d2847['countnoanswerretry']+=0x1;_0x3d2847['countglobal']+=0x1;var _0x180830=ut[_0x6e37('0x1b2')](_0x15d286,_0x2742f9);ami[_0x6e37('0x45')](_0x6e37('0x1b3'),_0x180830);_0x2d6f4b=_0x2742f9['dialNoAnswerRetryFrequency'];_0x392587=_0x2742f9[_0x6e37('0xdb')];hopperUtils[_0x6e37('0xcb')](_0x3d2847)[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x1b4')));if(_0x7a367['checkRetriveMax'](0x3,_0x15d286,_0x2742f9)&&!_0x1254a3){if(_0x3d2847[_0x6e37('0x124')]>=_0x2742f9[_0x6e37('0x198')]){_0x7a367[_0x6e37('0x12c')](_0x3d2847,_0x57ab3a,_0x3eb6b1,_0x6e37('0x1b5'));}else{_0x7a367['stateGlobal'](_0x3d2847,_0x57ab3a,_0x3eb6b1,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x2742f9['outboundBusyCallsDay']+=0x1;_0x3d2847['state']=0x5;_0x3d2847[_0x6e37('0x74')]=_0x6e37('0x1b6');_0x3d2847[_0x6e37('0x197')]+=0x1;_0x3d2847[_0x6e37('0xef')]+=0x1;ami[_0x6e37('0x45')](_0x6e37('0x1b7'),ut['buildObj'](_0x15d286,_0x6e37('0x1b8')));_0x2d6f4b=_0x2742f9[_0x6e37('0x19b')];_0x392587=_0x2742f9['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x3d2847)[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x1b9')));if(_0x7a367[_0x6e37('0x196')](0x5,_0x15d286,_0x2742f9)&&!_0x1254a3){if(_0x3d2847[_0x6e37('0x197')]>=_0x2742f9[_0x6e37('0x19a')]){_0x7a367[_0x6e37('0x12c')](_0x3d2847,_0x57ab3a,_0x3eb6b1,_0x6e37('0x1ba'));}else{_0x7a367['stateGlobal'](_0x3d2847,_0x57ab3a,_0x3eb6b1,_0x6e37('0x1ba'));}}break;case'8':_0x2742f9['outboundCongestionCallsDay']+=0x1;_0x3d2847[_0x6e37('0x73')]=0x8;_0x3d2847['statedesc']='Congestion';_0x3d2847[_0x6e37('0x123')]+=0x1;_0x3d2847[_0x6e37('0xef')]+=0x1;_0x2d6f4b=_0x2742f9[_0x6e37('0x19e')];_0x392587=_0x2742f9['callAdditionalPhoneAfterMin'];ami[_0x6e37('0x45')](_0x6e37('0x1bb'),ut[_0x6e37('0x11d')](_0x15d286,_0x6e37('0x1bc')));hopperUtils[_0x6e37('0xcb')](_0x3d2847)[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x1bd')));if(_0x7a367[_0x6e37('0x196')](0x8,_0x15d286,_0x2742f9)&&!_0x1254a3){if(_0x3d2847[_0x6e37('0x123')]>=_0x2742f9[_0x6e37('0x19d')]){_0x7a367[_0x6e37('0x12c')](_0x3d2847,_0x57ab3a,_0x3eb6b1,_0x6e37('0x1be'));}else{_0x7a367[_0x6e37('0x129')](_0x3d2847,_0x57ab3a,_0x3eb6b1,_0x6e37('0x1be'));}}break;case'11':_0x2742f9[_0x6e37('0x1bf')]+=0x1;_0x3d2847[_0x6e37('0x73')]=0xb;_0x3d2847[_0x6e37('0x74')]=_0x6e37('0xec');_0x3d2847[_0x6e37('0xee')]+=0x1;_0x3d2847[_0x6e37('0xef')]+=0x1;_0x2d6f4b=_0x2742f9[_0x6e37('0xf0')];_0x392587=_0x2742f9['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x3d2847)['catch'](loggerCatch(_0x6e37('0xf3')));if(_0x7a367['checkRetriveMax'](0xb,_0x15d286,_0x2742f9)&&!_0x1254a3){if(_0x3d2847[_0x6e37('0xee')]>=_0x2742f9[_0x6e37('0xf1')]){_0x7a367[_0x6e37('0x12c')](_0x3d2847,_0x57ab3a,_0x3eb6b1,_0x6e37('0x1c0'));}else{_0x7a367['stateGlobal'](_0x3d2847,_0x57ab3a,_0x3eb6b1,_0x6e37('0x1c0'));}}break;case'20':_0x2742f9[_0x6e37('0x1c1')]+=0x1;_0x3d2847[_0x6e37('0x73')]=0x14;_0x3d2847[_0x6e37('0x74')]='AgentReject';_0x3d2847[_0x6e37('0x127')]+=0x1;_0x3d2847[_0x6e37('0xef')]+=0x1;_0x2d6f4b=_0x2742f9['dialAgentRejectRetryFrequency'];_0x392587=_0x2742f9['callAdditionalPhoneAfterMin'];ami[_0x6e37('0x45')]('custom:agentreject',ut['buildObj'](_0x15d286,'agentreject'));hopperUtils['createHistory'](_0x3d2847)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x7a367[_0x6e37('0x196')](0x14,_0x15d286,_0x2742f9)&&!_0x1254a3){if(_0x3d2847['countagentrejectretry']>=_0x2742f9[_0x6e37('0x1a3')]){_0x7a367[_0x6e37('0x12c')](_0x3d2847,_0x57ab3a,_0x3eb6b1,'reason\x2020\x20agentreject');}else{_0x7a367[_0x6e37('0x129')](_0x3d2847,_0x57ab3a,_0x3eb6b1,'reason\x2020\x20agentreject');}}break;default:_0x2742f9[_0x6e37('0x1c2')]+=0x1;_0x3d2847[_0x6e37('0x73')]=0xc;_0x3d2847[_0x6e37('0x74')]=_0x3ec83c[_0x6e37('0xc7')];_0x2d6f4b=_0x2742f9[_0x6e37('0x1a4')];_0x392587=_0x2742f9['callAdditionalPhoneAfterMin'];hopperUtils[_0x6e37('0xcb')](_0x3d2847)[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x1c3')));if(_0x7a367[_0x6e37('0x196')](_0x3ec83c[_0x6e37('0xc7')],_0x15d286,_0x2742f9)&&!_0x1254a3){if(_0x3d2847[_0x6e37('0x197')]+_0x3d2847[_0x6e37('0x123')]+_0x3d2847[_0x6e37('0x124')]+_0x3d2847[_0x6e37('0x125')]+_0x3d2847[_0x6e37('0xd9')]+_0x3d2847[_0x6e37('0xee')]+_0x3d2847[_0x6e37('0x126')]+_0x3d2847[_0x6e37('0x127')]>=_0x2742f9[_0x6e37('0x128')]){_0x7a367[_0x6e37('0x129')](_0x3d2847,_0x57ab3a,_0x3eb6b1,_0x3ec83c[_0x6e37('0xc7')]);}else{_0x7a367[_0x6e37('0x12c')](_0x3d2847,_0x57ab3a,_0x3eb6b1,_0x3ec83c[_0x6e37('0xc7')]);}}}})[_0x6e37('0x42')](function(){if(_0x1254a3){hopperUtils[_0x6e37('0xea')](_0x3d2847,_0x2d6f4b,_0x392587)[_0x6e37('0x42')](function(){return _0x57ab3a(0x1);});}});});};Dialer[_0x6e37('0x1a')][_0x6e37('0x129')]=function(_0x5b0881,_0x348ff2,_0x27bc5e,_0xe9c9c1){var _0x464da8=new Final(_0x5b0881);_0x464da8[_0x6e37('0x73')]=0xf;_0x464da8[_0x6e37('0x74')]=_0x6e37('0x1c4');this[_0x6e37('0x12c')](_0x464da8,_0x348ff2,_0x27bc5e,_0xe9c9c1);};Dialer[_0x6e37('0x1a')][_0x6e37('0x12c')]=function(_0x4cecfb,_0x8944c9,_0x3bfd36,_0x556966){hopperUtils[_0x6e37('0xcd')](_0x4cecfb)[_0x6e37('0x42')](function(){return _0x8944c9(msgResponse('[callProgressDetecting]',_0x6e37('0x1c5'),_0x556966));})['catch'](function(){return _0x3bfd36(msgResponse(_0x6e37('0x1c6'),_0x6e37('0x90'),_0x6e37('0x1c7')));});};Dialer[_0x6e37('0x1a')][_0x6e37('0x9')]=function(_0x1ea7aa){var _0x405901=_0x1ea7aa[_0x6e37('0x1c8')]/0x64;var _0x3f0dfe=_0x1ea7aa[_0x6e37('0xd3')]/(_0x1ea7aa[_0x6e37('0xd3')]+_0x1ea7aa[_0x6e37('0xc6')]);var _0x1e9a9e=Math[_0x6e37('0x1c9')](_0x1ea7aa[_0x6e37('0x1ca')]*(_0x1ea7aa['predictiveIntervalMaxThreshold']/0x64));var _0x1ba946=Math[_0x6e37('0x1c9')](_0x1ea7aa[_0x6e37('0x1ca')]*(_0x1ea7aa[_0x6e37('0x1cb')]/0x64));var _0x133ea2=_0x1ea7aa[_0x6e37('0x1cc')]+_0x1ea7aa[_0x6e37('0x142')];var _0x29d38c=Math[_0x6e37('0x1cd')](_0x1ea7aa['erlangCalls']*_0x1ea7aa[_0x6e37('0x64')]*_0x1ea7aa[_0x6e37('0x1ce')]*_0x1ea7aa[_0x6e37('0x1cf')]);if(_[_0x6e37('0x44')](_0x1ea7aa[_0x6e37('0x2a')])){if(!_[_0x6e37('0x44')](_0x1ea7aa[_0x6e37('0x29')])){_0x1ea7aa[_0x6e37('0x29')]=undefined;loggerPredictive[_0x6e37('0x69')](_0x6e37('0x1d0'),_0x6e37('0x1d1'));}if(!_[_0x6e37('0x44')](_0x1ea7aa[_0x6e37('0x67')])){loggerPredictive[_0x6e37('0x69')](_0x6e37('0x1d0'),_0x6e37('0x1d2'));clearInterval(_0x1ea7aa[_0x6e37('0x67')]);_0x1ea7aa[_0x6e37('0x67')]=undefined;}_0x1ea7aa[_0x6e37('0x2a')]=moment()[_0x6e37('0x4a')](_0x6e37('0xc3'));loggerPredictive[_0x6e37('0x4f')](_0x1ea7aa[_0x6e37('0x4c')],_0x6e37('0x1d3'),_0x1ea7aa[_0x6e37('0x2a')]);this[_0x6e37('0xb2')](_0x1ea7aa,0x1);}else if(ifInterval(_0x1ea7aa[_0x6e37('0x1d4')],_0x1ea7aa[_0x6e37('0x2a')])){this[_0x6e37('0xb2')](_0x1ea7aa,0x1);loggerPredictiveCalls[_0x6e37('0x4f')](_0x6e37('0x1d5'),_0x1ea7aa['startProgressive'],_0x1ea7aa[_0x6e37('0x4c')]);_0x1ea7aa[_0x6e37('0x61')]=0x0;_0x1ea7aa[_0x6e37('0xd4')]=0x0;}else if(_0x405901<_0x3f0dfe&&_0x1ea7aa[_0x6e37('0x1d6')]===_0x6e37('0x1d7')){clearPredictiveAttributes(_0x1ea7aa);loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x1d8'),_0x6e37('0x1d9'),_0x3f0dfe,'startProgressive',_0x1ea7aa['name']);}else if(_0x29d38c<_0x1ea7aa[_0x6e37('0xd4')]&&_0x1ea7aa[_0x6e37('0x1d6')]===_0x6e37('0x1d7')){clearPredictiveAttributes(_0x1ea7aa);loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x1da'),_0x6e37('0x1db'),_0x29d38c,'Drop\x20in\x20this\x20interval',_0x1ea7aa[_0x6e37('0xd4')],_0x6e37('0x2a'),_0x1ea7aa[_0x6e37('0x4c')]);}else if(!ifInterval(_0x1ea7aa[_0x6e37('0x1d4')],_0x1ea7aa['startProgressive'])&&_[_0x6e37('0x44')](_0x1ea7aa[_0x6e37('0x29')])&&!_[_0x6e37('0x44')](_0x1ea7aa[_0x6e37('0x2a')])){_0x1ea7aa['startPredictive']=moment()[_0x6e37('0x4a')](_0x6e37('0xc3'));loggerPredictive['info'](_0x1ea7aa['name'],'started\x20in\x20predictive\x20at',_0x1ea7aa[_0x6e37('0x29')]);hopperUtils[_0x6e37('0x1dc')](_0x1ea7aa['dialPredictiveInterval'])['then'](this[_0x6e37('0x1dd')](_0x1ea7aa))[_0x6e37('0x42')](mergeDataErlangB(_0x1ea7aa))[_0x6e37('0x42')](this['startMethodPredictive'](_0x1ea7aa))[_0x6e37('0x9d')](loggerCatchPredictive(_0x6e37('0x1de'),_0x1ea7aa));}else if(!ifInterval(_0x1ea7aa[_0x6e37('0x1d4')],_0x1ea7aa['startPredictive'])){_0x1ea7aa[_0x6e37('0xd4')]=0x0;_0x1ea7aa[_0x6e37('0x29')]=moment()[_0x6e37('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x6e37('0x4f')](_0x1ea7aa[_0x6e37('0x4c')],'recalculate\x20predictive\x20at',_0x1ea7aa['startPredictive']);clearInterval(_0x1ea7aa[_0x6e37('0x67')]);_0x1ea7aa[_0x6e37('0x67')]=undefined;hopperUtils[_0x6e37('0x1dc')](_0x1ea7aa[_0x6e37('0x1d4')])[_0x6e37('0x42')](this[_0x6e37('0x1dd')](_0x1ea7aa))['then'](mergeDataErlangB(_0x1ea7aa))['then'](this[_0x6e37('0x1df')](_0x1ea7aa))['catch'](loggerCatchPredictive(_0x6e37('0x1e0'),_0x1ea7aa));}else if(_0x1ea7aa[_0x6e37('0x1ca')]&&_0x133ea2<_0x1ea7aa[_0x6e37('0x1ca')]-_0x1ba946){clearPredictiveAttributes(_0x1ea7aa);loggerPredictive[_0x6e37('0x4f')](_0x1ea7aa[_0x6e37('0x4c')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x133ea2,_0x6e37('0x1e1'),_0x1ea7aa[_0x6e37('0x1ca')],'-',_0x1ba946,'=',_0x1ea7aa[_0x6e37('0x1ca')]-_0x1ba946,')');}else if(_0x1ea7aa[_0x6e37('0x1ca')]&&_0x133ea2>_0x1ea7aa[_0x6e37('0x1ca')]+_0x1e9a9e){clearPredictiveAttributes(_0x1ea7aa);loggerPredictive[_0x6e37('0x4f')](_0x1ea7aa[_0x6e37('0x4c')],_0x6e37('0x1e2'),_0x133ea2,_0x6e37('0x1e3'),_0x1ea7aa[_0x6e37('0x1ca')],'+',_0x1e9a9e,'=',_0x1ea7aa[_0x6e37('0x1ca')]+_0x1e9a9e,')');}};Dialer[_0x6e37('0x1a')][_0x6e37('0x1dd')]=function(_0x2d20c1){var _0x3ca6eb=this;return function(_0x547c0f){return new Promise(function(_0x3baf49,_0x4c5059){_['merge'](_0x2d20c1,_0x547c0f[0x0]);if(checkGetDataPredictive(_0x547c0f[0x0])){var _0xfbf5f7=_0x2d20c1[_0x6e37('0x1ca')]=_0x2d20c1[_0x6e37('0x142')]+_0x2d20c1[_0x6e37('0x1cc')];var _0x47a707=_0x2d20c1[_0x6e37('0x1d4')]*0x3c;var _0x4424f4=_0x547c0f[0x0][_0x6e37('0x5b')]+_0x547c0f[0x0]['predictiveIntervalAvgHoldtime'];var _0x863a12=(_0x547c0f[0x0][_0x6e37('0x53')]+_0x547c0f[0x0][_0x6e37('0x55')]+_0x547c0f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x547c0f[0x0][_0x6e37('0x52')];_0x2d20c1['predictiveIntervalHitRate']=_0x863a12>0x0?_0x863a12:0x1;switch(_0x2d20c1[_0x6e37('0x1d6')]){case'dropRate':var _0xc80389=_0x2d20c1[_0x6e37('0x1c8')]/0x64;return _0x3ca6eb[_0x6e37('0x1e4')](_0xfbf5f7,_0x47a707,_0x4424f4,_0x863a12,_0xc80389)[_0x6e37('0x42')](function(_0x2e144c){return _0x3baf49(_0x2e144c);});case _0x6e37('0x1e5'):var _0x19251e=_0x2d20c1['dialPredictiveOptimizationPercentage']/0x64;return _0x3ca6eb[_0x6e37('0x1e6')](_0xfbf5f7,_0x47a707,_0x4424f4,_0x863a12,_0x19251e)[_0x6e37('0x42')](function(_0x1c818f){return _0x3baf49(_0x1c818f);});default:return _0x4c5059(msgResponse(_0x6e37('0x1e7'),_0x6e37('0x90'),_0x6e37('0x1e8')));}}else{return _0x4c5059(msgResponse(_0x6e37('0x1e7'),_0x6e37('0x90'),'check\x20failure'));}});};};Dialer['prototype'][_0x6e37('0x1e9')]=function(_0x2e993e){var _0xcbc8a6=this;return function(_0xc2ae69){return new Promise(function(_0x51f023,_0x2a1edd){_[_0x6e37('0x66')](_0x2e993e,_0xc2ae69[0x0]);if(checkGetDataPredictive(_0xc2ae69[0x0])){loggerPredictive[_0x6e37('0x4f')](JSON[_0x6e37('0x77')](_0xc2ae69[0x0]));if(_0x2e993e[_0x6e37('0x1d6')]==='dropRate'){return _0xcbc8a6[_0x6e37('0x158')](_0x2e993e['id'])[_0x6e37('0x42')](function(_0x4d99e8){var _0x4b08d5=_0x2e993e[_0x6e37('0x1ea')]-_0x4d99e8[0x0]['outboundQueuePauses'];var _0xa16423=_0x2e993e[_0x6e37('0x1d4')]*0x3c;var _0x110278=_0xc2ae69[0x0]['predictiveIntervalAvgTalktime']+_0xc2ae69[0x0][_0x6e37('0x59')];var _0x1e1184=(_0xc2ae69[0x0][_0x6e37('0x53')]+_0xc2ae69[0x0][_0x6e37('0x55')]+_0xc2ae69[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xc2ae69[0x0][_0x6e37('0x52')];var _0x3d7bc3=_0x2e993e[_0x6e37('0x1c8')]/0x64;_0x2e993e[_0x6e37('0x1eb')]=_0x4d99e8[0x0]['outboundQueuePauses']||0x0;_0x2e993e[_0x6e37('0x1ce')]=_0x1e1184>0x0?_0x1e1184:0x1;return _0xcbc8a6[_0x6e37('0x1e4')](_0x4b08d5,_0xa16423,_0x110278,_0x1e1184,_0x3d7bc3);})[_0x6e37('0x42')](function(_0x1dc08f){return _0x51f023(_0x1dc08f);})[_0x6e37('0x9d')](function(_0x3cd5e2){return _0x2a1edd(msgResponse('[CatchErlangB]','Failure',JSON[_0x6e37('0x77')](_0x3cd5e2)));});}if(_0x2e993e[_0x6e37('0x1d6')]===_0x6e37('0x1e5')){return _0xcbc8a6['getVoiceQueueRtPauses'](_0x2e993e['id'])[_0x6e37('0x42')](function(_0xd1c3ff){var _0xc95373=_0x2e993e[_0x6e37('0x1ea')]-_0xd1c3ff[0x0]['outboundQueuePauses'];var _0x4ebc08=_0x2e993e[_0x6e37('0x1d4')]*0x3c;var _0x1e7aaf=_0xc2ae69[0x0][_0x6e37('0x5b')]+_0xc2ae69[0x0][_0x6e37('0x59')];var _0x42e22c=(_0xc2ae69[0x0][_0x6e37('0x53')]+_0xc2ae69[0x0][_0x6e37('0x55')]+_0xc2ae69[0x0][_0x6e37('0x57')])/_0xc2ae69[0x0]['predictiveIntervalTotalCalls'];var _0x399a96=_0x2e993e['dialPredictiveOptimizationPercentage']/0x64;_0x2e993e[_0x6e37('0x1eb')]=_0xd1c3ff[0x0][_0x6e37('0x1ec')]||0x0;_0x2e993e[_0x6e37('0x1ce')]=_0x42e22c>0x0?_0x42e22c:0x1;return _0xcbc8a6[_0x6e37('0x1e6')](_0xc95373,_0x4ebc08,_0x1e7aaf,_0x42e22c,_0x399a96);})[_0x6e37('0x42')](function(_0x33d5e5){return _0x51f023(_0x33d5e5);})[_0x6e37('0x9d')](function(_0x3a058c){return _0x2a1edd(msgResponse('[CatchErlangB]',_0x6e37('0x90'),JSON[_0x6e37('0x77')](_0x3a058c)));});}}else{return _0x2a1edd(msgResponse(_0x6e37('0x1e7'),'Failure','check\x20failure'));}});};};Dialer[_0x6e37('0x1a')][_0x6e37('0x1df')]=function(_0x33c3c1){var _0x46629c=this;return function(){var _0x32f887=0x0;var _0x5a29c7=Math[_0x6e37('0x1cd')](_0x33c3c1[_0x6e37('0x1ed')]*0x3e8);if(_0x5a29c7>0x0){_0x5a29c7=_0x5a29c7<0x64?0x64:_0x5a29c7;loggerPredictive[_0x6e37('0x4f')](_0x33c3c1[_0x6e37('0x4c')],_0x6e37('0x1ee'),_0x5a29c7,'milliseconds');_0x33c3c1['handlePredictive']=setInterval(function(){_0x46629c[_0x6e37('0x67')](_0x33c3c1);loggerPredictiveCalls[_0x6e37('0x4f')](_0x6e37('0x1ef'),_0x32f887+=0x1);},_0x5a29c7);}else{loggerPredictive['info'](_0x33c3c1[_0x6e37('0x4c')],_0x6e37('0x1f0'));}};};Dialer[_0x6e37('0x1a')]['checkContactBlack']=function(_0xcf2740,_0x2873d3){var _0x237b01=this;return function(_0x2bcd41){if(_['isEmpty'](_0x2bcd41)){if(_[_0x6e37('0xf9')](_0x2873d3[_0x6e37('0x15e')])||!_0x2873d3[_0x6e37('0x1f1')]){if(_0xcf2740['dialMethod']===_0x6e37('0x8')){_0xcf2740[_0x6e37('0x75')]=_['isUndefined'](_0xcf2740[_0x6e37('0x75')])?!![]:_0xcf2740[_0x6e37('0x75')];var _0x24bc95=uuid['v4']();_0x237b01['actions'][_0x24bc95]=new Action(_0xcf2740,_0x2873d3,_0x24bc95);loggerBooked[_0x6e37('0x4f')]('[booked][checkContactBlack]',_0x24bc95,_0x6e37('0x1f2'),JSON['stringify'](_0xcf2740[_0x6e37('0x75')]),_0x6e37('0x1f3'),_0xcf2740[_0x6e37('0x4c')]);if(_0xcf2740[_0x6e37('0x75')]){_0xcf2740[_0x6e37('0x75')]=![];_0x237b01[_0x6e37('0xfd')][_0x237b01['actions'][_0x24bc95][_0x6e37('0xbe')]]=[];ami[_0x6e37('0x98')]({'actionid':_0x24bc95,'action':_0x6e37('0x1f4'),'queue':_0xcf2740['name']})[_0x6e37('0x9d')](function(){_0x237b01[_0x6e37('0xc1')](_0xcf2740);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x237b01[_0x6e37('0x25')][_0x24bc95][_0x6e37('0x102')],'ListId':_0x237b01[_0x6e37('0x25')][_0x24bc95][_0x6e37('0xe2')],'VoiceQueueId':_0x237b01[_0x6e37('0x25')][_0x24bc95]['VoiceQueueId']||undefined,'CampaignId':_0x237b01[_0x6e37('0x25')][_0x24bc95][_0x6e37('0xe4')]||undefined})['catch'](loggerCatch(_0x6e37('0x1f5')));delete _0x237b01[_0x6e37('0x25')][_0x24bc95];});}else{loggerBooked[_0x6e37('0x4f')](_0x6e37('0x1f6'),JSON[_0x6e37('0x77')](_0xcf2740[_0x6e37('0x75')]),_0x6e37('0x1f3'),_0xcf2740[_0x6e37('0x4c')]);_0x237b01[_0x6e37('0xc1')](_0xcf2740);hopperUtils[_0x6e37('0xdf')]({'active':![],'ContactId':_0x237b01[_0x6e37('0x25')][_0x24bc95][_0x6e37('0x102')],'ListId':_0x237b01[_0x6e37('0x25')][_0x24bc95][_0x6e37('0xe2')],'VoiceQueueId':_0x237b01[_0x6e37('0x25')][_0x24bc95][_0x6e37('0xe3')]||undefined,'CampaignId':_0x237b01[_0x6e37('0x25')][_0x24bc95][_0x6e37('0xe4')]||undefined})['catch'](loggerCatch(_0x6e37('0x1f5')));delete _0x237b01[_0x6e37('0x25')][_0x24bc95];}}else{return _0x237b01[_0x6e37('0x162')](_0xcf2740,_0x2873d3);}}else{if(utils[_0x6e37('0xd0')](undefined,_0x2873d3[_0x6e37('0x1f7')])<_0xcf2740['dialRecallMeTimeout']*0x3c){if(_0x2873d3[_0x6e37('0x14d')]&&!_0x2873d3[_0x6e37('0x14d')][_0x6e37('0x1f8')]){_0x237b01['preview'][_0x6e37('0x100')](_0x2873d3['id'])[_0x6e37('0x1d')](function(){_0x237b01[_0x6e37('0xc1')](_0xcf2740);});}else{hopperUtils[_0x6e37('0x1f9')]({'active':![]},_0x2873d3['id'],0x1)[_0x6e37('0x1d')](function(){_0x237b01[_0x6e37('0xc1')](_0xcf2740);});}}else{_0xcf2740[_0x6e37('0x1fa')]+=0x1;_0x237b01['updateOriginated'](_0xcf2740);if(_0xcf2740[_0x6e37('0x1fb')]){hopperUtils[_0x6e37('0xdf')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2873d3['ContactId'],'ListId':_0x2873d3['ListId'],'VoiceQueueId':_0x2873d3[_0x6e37('0xe3')]||undefined,'CampaignId':_0x2873d3[_0x6e37('0xe4')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x6e37('0xcb')](createObjHistory(_0xcf2740,_0x2873d3,utils[_0x6e37('0x6c')][_0x6e37('0x1fc')],0x17,'RecallInQueue'))[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x1fd')));}else{_0x237b01[_0x6e37('0x11f')](createObjHistory(_0xcf2740,_0x2873d3,utils[_0x6e37('0x6c')]['RECALL_TIMEOUT'],0x16,_0x6e37('0x1fe')),_0x6e37('0x1ff'),_0x6e37('0x200'));}}}}else{_0xcf2740[_0x6e37('0x201')]+=0x1;_0x237b01[_0x6e37('0x11f')](createObjHistory(_0xcf2740,_0x2873d3,utils[_0x6e37('0x6c')]['BLACKLIST'],0xd,'Blacklist'),_0x6e37('0x202'),_0x6e37('0x203'));throw'inBlackList';}};};Dialer[_0x6e37('0x1a')]['handleIvr']=function(_0x533045){var _0x4a1d9f=this;var _0x31bb8c=_0x533045[_0x6e37('0x204')]-_0x533045[_0x6e37('0x81')];emitCampaignSummary(_0x533045);if(_0x31bb8c>0x0&&_0x533045[_0x6e37('0x205')]==0x0){if(_0x31bb8c>this['maxNumberOriginate']){_0x31bb8c=this[_0x6e37('0x24')];}_0x533045[_0x6e37('0x205')]=0x1;hopperUtils[_0x6e37('0x206')](_0x533045,_0x31bb8c)['then'](function(_0x55dcd7){_0x533045[_0x6e37('0x205')]=0x0;if(_0x55dcd7){if(!utils[_0x6e37('0x207')](_0x55dcd7)){_0x533045[_0x6e37('0x6b')]=utils[_0x6e37('0x6c')]['NO_AVAILABLE_CONTACTS'];logger['info'](_0x6e37('0x208')+_0x533045[_0x6e37('0x4c')]);}else{_0x533045[_0x6e37('0x81')]+=_0x55dcd7['length'];_0x533045[_0x6e37('0x6b')]=utils[_0x6e37('0x6c')][_0x6e37('0x209')];for(var _0x47faa0=0x0;_0x47faa0<_0x55dcd7[_0x6e37('0x105')];_0x47faa0+=0x1){_0x533045[_0x6e37('0x20a')]+=0x1;if(_[_0x6e37('0xf9')](_0x55dcd7[_0x47faa0])||_['isNil'](_0x55dcd7[_0x47faa0][_0x6e37('0x17d')])||_['isNil'](_0x55dcd7[_0x47faa0]['phone'])){_0x4a1d9f['emptyContact'](_0x6e37('0x20b'),_0x533045,_0x55dcd7[_0x47faa0]);}else{hopperUtils['checkIsBlackListIvr'](_[_0x6e37('0x78')](_0x55dcd7[_0x47faa0],[_0x6e37('0xe4'),'phone']))[_0x6e37('0x42')](_0x4a1d9f[_0x6e37('0x20c')](_0x533045,_0x55dcd7[_0x47faa0]))[_0x6e37('0x9d')](_0x4a1d9f[_0x6e37('0x20d')](_0x6e37('0x20e'),_0x533045));}}}}})[_0x6e37('0x9d')](loggerGetContactDialer(_0x6e37('0x20f'),_0x533045,_0x31bb8c));}};Dialer[_0x6e37('0x1a')]['handlePower']=function(_0x310e9d,_0x10268b){var _0x58723f=this;var _0x2d08ab=[];if(_0x10268b<0x1||_0x310e9d[_0x6e37('0xb0')]===_0x6e37('0x8')){_0x10268b=0x1;}var _0x55a055=Math['floor'](_0x310e9d['available']*_0x10268b)-_0x310e9d['originated'];if(_0x310e9d['dialLimitQueue']>0x0){var _0x5dacd5=_0x310e9d[_0x6e37('0x210')]-_0x310e9d[_0x6e37('0x81')]-_0x310e9d[_0x6e37('0x142')]-_0x310e9d[_0x6e37('0x143')];if(_0x55a055>_0x5dacd5){_0x55a055=_0x5dacd5;}}if(_0x55a055>0x0&&_0x310e9d[_0x6e37('0x205')]==0x0){if(_0x310e9d[_0x6e37('0xb0')]==='booked'){_0x55a055=0x1;}if(_0x55a055>this[_0x6e37('0x24')]){_0x55a055=this[_0x6e37('0x24')];}for(var _0x5c3d61 in this[_0x6e37('0x22')]){if(typeof this[_0x6e37('0x22')][_0x5c3d61]!==_0x6e37('0x154')){if(this[_0x6e37('0x22')][_0x5c3d61][_0x6e37('0x73')]===_0x6e37('0x211')&&this[_0x6e37('0x22')][_0x5c3d61]['status']==='reachable'){_0x2d08ab[_0x6e37('0x97')](this[_0x6e37('0x22')][_0x5c3d61]['id']);}}}_0x310e9d[_0x6e37('0x205')]=0x1;hopperUtils['getContactDialer'](_0x310e9d,_0x2d08ab,_0x55a055)[_0x6e37('0x42')](function(_0x1f83ba){_0x310e9d[_0x6e37('0x205')]=0x0;if(_0x1f83ba){if(!utils['checkContactEmpty'](_0x1f83ba)){hopperUtils[_0x6e37('0x212')](_0x310e9d)[_0x6e37('0x42')](sendMessageReschedule(_0x310e9d))[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x213')));}else{_0x310e9d[_0x6e37('0x81')]+=_0x1f83ba[_0x6e37('0x105')];_0x310e9d[_0x6e37('0x6b')]=_0x310e9d['dialMethod']===_0x6e37('0x8')?utils[_0x6e37('0x6c')]['ACTIVE']:utils[_0x6e37('0x6c')][_0x6e37('0x209')];for(var _0x281165=0x0;_0x281165<_0x1f83ba[_0x6e37('0x105')];_0x281165+=0x1){if(_['isNil'](_0x1f83ba[_0x281165])||_[_0x6e37('0xf9')](_0x1f83ba[_0x281165][_0x6e37('0x17d')])||_[_0x6e37('0xf9')](_0x1f83ba[_0x281165][_0x6e37('0x165')])){_0x58723f[_0x6e37('0x15c')](_0x6e37('0x20b'),_0x310e9d,_0x1f83ba[_0x281165]);}else{hopperUtils['checkIsBlackList'](_[_0x6e37('0x78')](_0x1f83ba[_0x281165],[_0x6e37('0xe3'),_0x6e37('0x165')]))[_0x6e37('0x42')](_0x58723f['checkContactBlack'](_0x310e9d,_0x1f83ba[_0x281165]))[_0x6e37('0x9d')](_0x58723f[_0x6e37('0x20d')](_0x6e37('0x20b'),_0x310e9d));}}}}})[_0x6e37('0x9d')](loggerGetContactDialer('[getContactDialer2]',_0x310e9d,_0x55a055));}};Dialer[_0x6e37('0x1a')][_0x6e37('0x67')]=function(_0x293c97){if(_0x293c97[_0x6e37('0x210')]>0x0){var _0x1b535d=_0x293c97['dialLimitQueue']-_0x293c97[_0x6e37('0x81')]-_0x293c97['talking'];if(_0x1b535d>0x0&&_0x293c97[_0x6e37('0x205')]==0x0){this[_0x6e37('0x214')](_0x293c97);}else{loggerPredictiveCalls[_0x6e37('0x4f')](_0x6e37('0x215'));}}else{this['tryOriginatePredictive'](_0x293c97);}};Dialer[_0x6e37('0x1a')][_0x6e37('0x214')]=function(_0x277c63){var _0x1b2da2=this;var _0x3a0f27=[];_0x277c63[_0x6e37('0x81')]+=0x1;for(var _0x37281 in this[_0x6e37('0x22')]){if(typeof this['agents'][_0x37281]!==_0x6e37('0x154')){if(this['agents'][_0x37281][_0x6e37('0x73')]===_0x6e37('0x211')&&this['agents'][_0x37281][_0x6e37('0x87')]==='reachable'){_0x3a0f27[_0x6e37('0x97')](this[_0x6e37('0x22')][_0x37281]['id']);}}}_0x277c63[_0x6e37('0x205')]=0x1;return this[_0x6e37('0x216')](_0x277c63['id'],_0x3a0f27,0x1,_0x277c63[_0x6e37('0x217')],_0x277c63)[_0x6e37('0x42')](function(_0x309657){_0x277c63[_0x6e37('0x205')]=0x1;if(_0x309657){if(!utils['checkContactEmpty'](_0x309657)){utils[_0x6e37('0x6a')](_0x277c63,0x1,0x0);return hopperUtils[_0x6e37('0x212')](_0x277c63)[_0x6e37('0x42')](sendMessageReschedule(_0x277c63))[_0x6e37('0x9d')](loggerCatch(_0x6e37('0x213')));}else{_0x277c63['message']=utils['CAMPAIGN_STATUS']['RUNNING'];if(_[_0x6e37('0xf9')](_0x309657[0x0])||_['isNil'](_0x309657[0x0][_0x6e37('0x17d')])||_['isNil'](_0x309657[0x0][_0x6e37('0x165')])){_0x1b2da2[_0x6e37('0x15c')](_0x6e37('0x20b'),_0x277c63,_0x309657[0x0]);}else{return hopperUtils[_0x6e37('0x218')](_[_0x6e37('0x78')](_0x309657[0x0],[_0x6e37('0xe3'),_0x6e37('0x165')]))['then'](_0x1b2da2[_0x6e37('0x20c')](_0x277c63,_0x309657[0x0]))[_0x6e37('0x9d')](_0x1b2da2[_0x6e37('0x20d')]('[actionOriginatePredictive]\x20',_0x277c63));}}}})[_0x6e37('0x9d')](loggerGetContactDialer(_0x6e37('0x219'),_0x277c63,0x1));};Dialer[_0x6e37('0x1a')]['abandonmentRate']=function(_0x2109a0,_0x196fb2,_0x3eaf53,_0x128a1f,_0xf01af,_0x405cae){loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x21a'));loggerPredictive[_0x6e37('0x4f')]('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',_0x2109a0);loggerPredictive[_0x6e37('0x4f')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x196fb2);loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x21b'),_0x3eaf53);loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x21c'),_0x128a1f);loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x21d'),_0xf01af);loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x21e'));return new Promise(function(_0x533243,_0xedfa9b){if(_0x2109a0<=0x0||isNaN(_0x2109a0)){return _0xedfa9b(msgResponse(_0x6e37('0x21f'),_0x6e37('0x85'),_0x6e37('0x220')+_0x2109a0));}if(_0x3eaf53<=0x0||isNaN(_0x3eaf53)){return _0xedfa9b(msgResponse(_0x6e37('0x21f'),_0x6e37('0x85'),_0x6e37('0x221')+_0x3eaf53));}if(_0x128a1f<=0x0||isNaN(_0x128a1f)){return _0xedfa9b(msgResponse(_0x6e37('0x21f'),_0x6e37('0x85'),_0x6e37('0x222')+_0x128a1f));}if(_0x196fb2<=0x0||isNaN(_0x196fb2)){return _0xedfa9b(msgResponse('[abandonmentRate]','Error',_0x6e37('0x223')+_0x196fb2));}if(_0xf01af<=0x0||isNaN(_0xf01af)){return _0xedfa9b(msgResponse(_0x6e37('0x21f'),_0x6e37('0x85'),_0x6e37('0x224')+_0xf01af));}_0x405cae=_0x405cae||0x0;var _0x1f8597=0x1/_0x3eaf53;var _0x986219=0x0;var _0x5abd87=0x0;var _0x17144c=0x0;var _0x223123=0x0;for(var _0x5e7d8b=0x0;_0x17144c<_0xf01af;_0x5e7d8b+=0x1){_0x5abd87=_0x5e7d8b/_0x196fb2;_0x986219=(_0x128a1f*_0x5abd87+_0x405cae)/_0x1f8597;_0x17144c=utils[_0x6e37('0x225')](_0x986219,_0x2109a0);_0x223123=_0x986219/_0x2109a0*(0x1-utils[_0x6e37('0x225')](_0x986219,_0x2109a0));}return _0x533243({'erlangCalls':_0x5e7d8b,'erlangCallToSecond':_0x196fb2/_0x5e7d8b,'erlangAbandonmentRate':_0x17144c,'erlangBusyFactor':_0x223123});});};Dialer['prototype'][_0x6e37('0x1e6')]=function(_0x2045a8,_0x4514a1,_0x5b3ba6,_0x5d27db,_0xf368e0,_0x5ed2f2){loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x226'));loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x227'),_0x2045a8);loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x228'),_0x4514a1);loggerPredictive[_0x6e37('0x4f')]('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',_0x5b3ba6);loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x21c'),_0x5d27db);loggerPredictive['info'](_0x6e37('0x229'),_0xf368e0);loggerPredictive[_0x6e37('0x4f')](_0x6e37('0x21e'));return new Promise(function(_0x5b774c,_0x53d54a){if(_0x2045a8<=0x0||isNaN(_0x2045a8)){return _0x53d54a(msgResponse(_0x6e37('0x22a'),_0x6e37('0x85'),_0x6e37('0x220')+_0x2045a8));}if(_0x5b3ba6<=0x0||isNaN(_0x5b3ba6)){return _0x53d54a(msgResponse('[busyFactor]',_0x6e37('0x85'),_0x6e37('0x221')+_0x5b3ba6));}if(_0x5d27db<=0x0||isNaN(_0x5d27db)){return _0x53d54a(msgResponse(_0x6e37('0x22a'),_0x6e37('0x85'),_0x6e37('0x222')+_0x5d27db));}if(_0x4514a1<=0x0||isNaN(_0x4514a1)){return _0x53d54a(msgResponse(_0x6e37('0x22a'),_0x6e37('0x85'),_0x6e37('0x223')+_0x4514a1));}if(_0xf368e0<=0x0||isNaN(_0xf368e0)){return _0x53d54a(msgResponse(_0x6e37('0x22a'),_0x6e37('0x85'),_0x6e37('0x22b')+_0xf368e0));}_0x5ed2f2=_0x5ed2f2||0x0;var _0x2fc89e=0x1/_0x5b3ba6;var _0x5811b9=0x0;var _0xff1414=0x0;var _0x4e894a=0x0;var _0x21fb38=0x0;for(var _0x417684=0x0;_0x21fb38<_0xf368e0;_0x417684+=0x1){_0xff1414=_0x417684/_0x4514a1;_0x5811b9=(_0x5d27db*_0xff1414+_0x5ed2f2)/_0x2fc89e;_0x4e894a=utils['erlangb'](_0x5811b9,_0x2045a8);_0x21fb38=_0x5811b9/_0x2045a8*(0x1-utils['erlangb'](_0x5811b9,_0x2045a8));}return _0x5b774c({'erlangCalls':_0x417684,'erlangCallToSecond':_0x4514a1/_0x417684,'erlangAbandonmentRate':_0x4e894a,'erlangBusyFactor':_0x21fb38});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 5d68f82..5f5a331 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83e2=['number','substring','getQueue','lodash','isNil','voiceQueue','uniqueid','name','Contact','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit'];(function(_0x4c637b,_0x326ee8){var _0x5c2e10=function(_0x2674f9){while(--_0x2674f9){_0x4c637b['push'](_0x4c637b['shift']());}};_0x5c2e10(++_0x326ee8);}(_0x83e2,0x81));var _0x283e=function(_0x14476b,_0xd1a7a4){_0x14476b=_0x14476b-0x0;var _0x24e2e8=_0x83e2[_0x14476b];return _0x24e2e8;};'use strict';var util=require('util');var _=require(_0x283e('0x0'));var moment=require('moment');function checkNameSurname(_0x2b61a6,_0x404ad3,_0x5d6a1b){var _0x1e7cc8='';if(!_[_0x283e('0x1')](_0x404ad3)&&'string'===typeof _0x404ad3){_0x1e7cc8+=_0x404ad3;}if(!_[_0x283e('0x1')](_0x5d6a1b)&&'string'===typeof _0x5d6a1b){_0x1e7cc8+='\x20'+_0x5d6a1b;}if(_0x1e7cc8!==''){return _0x1e7cc8;}return _0x2b61a6;}function Action(_0xee13a5,_0x44fe90,_0x395833){this[_0x283e('0x2')]=_0xee13a5;this[_0x283e('0x3')]=_0x395833||undefined;this[_0x283e('0x4')]=checkNameSurname(_0x44fe90[_0x283e('0x5')][_0x283e('0x6')],_0x44fe90[_0x283e('0x5')]['firstName'],_0x44fe90[_0x283e('0x5')]['lastName']);this['number']=_0x44fe90['phone'];this[_0x283e('0x7')]=_0xee13a5[_0x283e('0x4')];this[_0x283e('0x8')]=_0x44fe90[_0x283e('0x8')]||![];this[_0x283e('0x9')]=_0xee13a5['type'];this[_0x283e('0xa')]=_0xee13a5[_0x283e('0xa')]||0x3;this[_0x283e('0xb')]=_0x44fe90[_0x283e('0xb')];this[_0x283e('0xc')]=_0x44fe90['countbusyretry'];this[_0x283e('0xd')]=_0x44fe90[_0x283e('0xd')];this[_0x283e('0xe')]=_0x44fe90[_0x283e('0xe')];this[_0x283e('0xf')]=_0x44fe90[_0x283e('0xf')];this['countdropretry']=_0x44fe90[_0x283e('0x10')];this['countabandonedretry']=_0x44fe90[_0x283e('0x11')];this[_0x283e('0x12')]=_0x44fe90[_0x283e('0x12')];this[_0x283e('0x13')]=_0x44fe90['countagentrejectretry'];this[_0x283e('0x14')]=_0x44fe90[_0x283e('0x14')];this[_0x283e('0x15')]=_0x44fe90[_0x283e('0x15')];this[_0x283e('0x16')]=_0x44fe90[_0x283e('0x16')];this[_0x283e('0x17')]=_0x44fe90['VoiceQueueId'];this[_0x283e('0x18')]=_0x44fe90[_0x283e('0x18')];this['idHopper']=_0x44fe90['id'];this[_0x283e('0x19')]=_0x44fe90[_0x283e('0x5')][_0x283e('0x1a')]||'';this[_0x283e('0x1b')]=moment()[_0x283e('0x1c')](_0x283e('0x1d'));this[_0x283e('0x1e')]=_0x44fe90[_0x283e('0x1e')];this[_0x283e('0x1f')]=_0x44fe90[_0x283e('0x1f')];this[_0x283e('0x20')]=_0x44fe90[_0x283e('0x20')];this[_0x283e('0x21')]=_0x44fe90[_0x283e('0x21')];this[_0x283e('0x22')]='';this['originatecalleridname']='';}Action[_0x283e('0x23')][_0x283e('0x24')]=function(){return util[_0x283e('0x1c')](_0x283e('0x25'),this[_0x283e('0x4')],this['voiceQueue'][_0x283e('0x26')]>0x0?this[_0x283e('0x27')][_0x283e('0x28')](this[_0x283e('0x2')]['dialCutDigit']):this[_0x283e('0x27')]);};Action[_0x283e('0x23')][_0x283e('0x29')]=function(){return this['queue'];};module['exports']=Action; \ No newline at end of file +var _0x752d=['countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','dialCutDigit','number','substring','prototype','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x9b3072,_0xbf6325){var _0x589939=function(_0x390459){while(--_0x390459){_0x9b3072['push'](_0x9b3072['shift']());}};_0x589939(++_0xbf6325);}(_0x752d,0x153));var _0xd752=function(_0x691555,_0x23ec62){_0x691555=_0x691555-0x0;var _0x1bd778=_0x752d[_0x691555];return _0x1bd778;};'use strict';var util=require(_0xd752('0x0'));var _=require(_0xd752('0x1'));var moment=require(_0xd752('0x2'));function checkNameSurname(_0xb6501,_0x33fa8f,_0x533bae){var _0x1f23f0='';if(!_[_0xd752('0x3')](_0x33fa8f)&&_0xd752('0x4')===typeof _0x33fa8f){_0x1f23f0+=_0x33fa8f;}if(!_[_0xd752('0x3')](_0x533bae)&&_0xd752('0x4')===typeof _0x533bae){_0x1f23f0+='\x20'+_0x533bae;}if(_0x1f23f0!==''){return _0x1f23f0;}return _0xb6501;}function Action(_0x3ae45e,_0x40e518,_0x255df2){this[_0xd752('0x5')]=_0x3ae45e;this[_0xd752('0x6')]=_0x255df2||undefined;this[_0xd752('0x7')]=checkNameSurname(_0x40e518[_0xd752('0x8')][_0xd752('0x9')],_0x40e518['Contact'][_0xd752('0xa')],_0x40e518['Contact'][_0xd752('0xb')]);this['number']=_0x40e518['phone'];this[_0xd752('0xc')]=_0x3ae45e[_0xd752('0x7')];this[_0xd752('0xd')]=_0x40e518['active']||![];this[_0xd752('0xe')]=_0x3ae45e['type'];this[_0xd752('0xf')]=_0x3ae45e[_0xd752('0xf')]||0x3;this[_0xd752('0x10')]=_0x40e518[_0xd752('0x10')];this[_0xd752('0x11')]=_0x40e518['countbusyretry'];this[_0xd752('0x12')]=_0x40e518[_0xd752('0x12')];this['countnoanswerretry']=_0x40e518[_0xd752('0x13')];this[_0xd752('0x14')]=_0x40e518[_0xd752('0x14')];this['countdropretry']=_0x40e518['countdropretry'];this[_0xd752('0x15')]=_0x40e518[_0xd752('0x15')];this['countmachineretry']=_0x40e518[_0xd752('0x16')];this['countagentrejectretry']=_0x40e518[_0xd752('0x17')];this[_0xd752('0x18')]=_0x40e518[_0xd752('0x18')];this[_0xd752('0x19')]=_0x40e518[_0xd752('0x19')];this[_0xd752('0x1a')]=_0x40e518[_0xd752('0x1a')];this['VoiceQueueId']=_0x40e518[_0xd752('0x1b')];this[_0xd752('0x1c')]=_0x40e518['CampaignId'];this[_0xd752('0x1d')]=_0x40e518['id'];this['ContactFirstName']=_0x40e518[_0xd752('0x8')][_0xd752('0xa')]||'';this['starttime']=moment()[_0xd752('0x1e')](_0xd752('0x1f'));this[_0xd752('0x20')]=_0x40e518[_0xd752('0x20')];this['callbackuniqueid']=_0x40e518[_0xd752('0x21')];this[_0xd752('0x22')]=_0x40e518['callbackat'];this['recallme']=_0x40e518[_0xd752('0x23')];this[_0xd752('0x24')]='';this[_0xd752('0x25')]='';}Action['prototype'][_0xd752('0x26')]=function(){return util[_0xd752('0x1e')]('\x22%s\x22\x20<%s>',this[_0xd752('0x7')],this['voiceQueue'][_0xd752('0x27')]>0x0?this[_0xd752('0x28')][_0xd752('0x29')](this[_0xd752('0x5')][_0xd752('0x27')]):this[_0xd752('0x28')]);};Action[_0xd752('0x2a')][_0xd752('0x2b')]=function(){return this['queue'];};module[_0xd752('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 2d16596..3d8b2f1 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x893e=['countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','answertime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','statedesc','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x367825,_0xba445e){var _0x17e0c2=function(_0x2a16cc){while(--_0x2a16cc){_0x367825['push'](_0x367825['shift']());}};_0x17e0c2(++_0xba445e);}(_0x893e,0x1cc));var _0xe893=function(_0x35aa4f,_0x3bf80b){_0x35aa4f=_0x35aa4f-0x0;var _0x1d2f4d=_0x893e[_0x35aa4f];return _0x1d2f4d;};'use strict';var moment=require(_0xe893('0x0'));var utils=require(_0xe893('0x1'));function AgentComplete(_0x5828b7,_0x407c3f){this[_0xe893('0x2')]=0x4;this[_0xe893('0x3')]='Answer';this[_0xe893('0x4')]=_0x5828b7[_0xe893('0x4')];this[_0xe893('0x5')]=_0x5828b7[_0xe893('0x5')];this['campaigntype']=_0x5828b7[_0xe893('0x5')]===_0xe893('0x6')?_0xe893('0x7'):_0x5828b7[_0xe893('0x5')];this['countbusyretry']=_0x5828b7[_0xe893('0x8')];this[_0xe893('0x9')]=_0x5828b7['countcongestionretry'];this[_0xe893('0xa')]=_0x5828b7['countnoanswerretry'];this['countglobal']=_0x5828b7[_0xe893('0x8')]+_0x5828b7[_0xe893('0x9')]+_0x5828b7[_0xe893('0xa')]+_0x5828b7[_0xe893('0xb')]+_0x5828b7[_0xe893('0xc')]+_0x5828b7[_0xe893('0xd')]+_0x5828b7[_0xe893('0xe')]+_0x5828b7[_0xe893('0xf')];this['countnosuchnumberretry']=_0x5828b7['countnosuchnumberretry'];this[_0xe893('0xc')]=_0x5828b7[_0xe893('0xc')];this['countabandonedretry']=_0x5828b7[_0xe893('0xd')];this[_0xe893('0xe')]=_0x5828b7[_0xe893('0xe')];this[_0xe893('0xf')]=_0x5828b7[_0xe893('0xf')];this[_0xe893('0x10')]=_0x407c3f[_0xe893('0x10')];this['calleridname']=_0x5828b7[_0xe893('0x11')];this[_0xe893('0x12')]=_0x5828b7[_0xe893('0x13')];this[_0xe893('0x14')]=_0x5828b7['starttime'];this[_0xe893('0x15')]=_0x5828b7[_0xe893('0x15')];this['answertime']=_0x5828b7['answertime'];this[_0xe893('0x16')]=moment()[_0xe893('0x17')](_0xe893('0x18'));this['ringtime']=utils[_0xe893('0x19')](_0x5828b7[_0xe893('0x15')],_0x5828b7['starttime']);this[_0xe893('0x1a')]=utils[_0xe893('0x19')](_0x5828b7[_0xe893('0x1b')],_0x5828b7['responsetime']);this[_0xe893('0x1c')]=utils[_0xe893('0x19')](this[_0xe893('0x16')],_0x5828b7['answertime']);this['queue']=_0x407c3f[_0xe893('0x7')];this[_0xe893('0x1d')]=_0x407c3f[_0xe893('0x1d')];this[_0xe893('0x1e')]=_0x407c3f['reason'];this[_0xe893('0x1f')]=_0x5828b7[_0xe893('0x1f')];this['callbackuniqueid']=_0x5828b7[_0xe893('0x20')];this[_0xe893('0x21')]=_0x5828b7[_0xe893('0x21')];this[_0xe893('0x22')]=_0x5828b7[_0xe893('0x22')];this[_0xe893('0x23')]=_0x5828b7[_0xe893('0x23')];this['ListId']=_0x5828b7['ListId'];this[_0xe893('0x24')]=_0x5828b7[_0xe893('0x24')];this[_0xe893('0x25')]=_0x5828b7[_0xe893('0x25')];this[_0xe893('0x26')]=_0x5828b7[_0xe893('0x26')];this[_0xe893('0x27')]=_0x5828b7[_0xe893('0x27')]||'';this[_0xe893('0x28')]=_0x5828b7[_0xe893('0x28')]||'';this[_0xe893('0x29')]=_0x5828b7['agiafterat'];}module[_0xe893('0x2a')]=AgentComplete; \ No newline at end of file +var _0x3e03=['reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','membername'];(function(_0x582274,_0x2cbd9c){var _0x8f14d3=function(_0x1cfe08){while(--_0x1cfe08){_0x582274['push'](_0x582274['shift']());}};_0x8f14d3(++_0x2cbd9c);}(_0x3e03,0x13a));var _0x33e0=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0x3e03[_0x2d91c6];return _0x3a8d19;};'use strict';var moment=require('moment');var utils=require(_0x33e0('0x0'));function AgentComplete(_0x3075a6,_0x258354){this['state']=0x4;this['statedesc']='Answer';this[_0x33e0('0x1')]=_0x3075a6[_0x33e0('0x1')];this[_0x33e0('0x2')]=_0x3075a6['type'];this[_0x33e0('0x3')]=_0x3075a6['type']===_0x33e0('0x4')?_0x33e0('0x5'):_0x3075a6['type'];this[_0x33e0('0x6')]=_0x3075a6[_0x33e0('0x6')];this['countcongestionretry']=_0x3075a6[_0x33e0('0x7')];this[_0x33e0('0x8')]=_0x3075a6[_0x33e0('0x8')];this[_0x33e0('0x9')]=_0x3075a6[_0x33e0('0x6')]+_0x3075a6[_0x33e0('0x7')]+_0x3075a6[_0x33e0('0x8')]+_0x3075a6[_0x33e0('0xa')]+_0x3075a6[_0x33e0('0xb')]+_0x3075a6[_0x33e0('0xc')]+_0x3075a6[_0x33e0('0xd')]+_0x3075a6[_0x33e0('0xe')];this[_0x33e0('0xa')]=_0x3075a6[_0x33e0('0xa')];this[_0x33e0('0xb')]=_0x3075a6[_0x33e0('0xb')];this[_0x33e0('0xc')]=_0x3075a6[_0x33e0('0xc')];this[_0x33e0('0xd')]=_0x3075a6[_0x33e0('0xd')];this[_0x33e0('0xe')]=_0x3075a6[_0x33e0('0xe')];this[_0x33e0('0xf')]=_0x258354['uniqueid'];this[_0x33e0('0x10')]=_0x3075a6[_0x33e0('0x11')];this[_0x33e0('0x12')]=_0x3075a6[_0x33e0('0x13')];this[_0x33e0('0x14')]=_0x3075a6['starttime'];this[_0x33e0('0x15')]=_0x3075a6[_0x33e0('0x15')];this[_0x33e0('0x16')]=_0x3075a6[_0x33e0('0x16')];this[_0x33e0('0x17')]=moment()[_0x33e0('0x18')](_0x33e0('0x19'));this[_0x33e0('0x1a')]=utils[_0x33e0('0x1b')](_0x3075a6[_0x33e0('0x15')],_0x3075a6[_0x33e0('0x14')]);this[_0x33e0('0x1c')]=utils[_0x33e0('0x1b')](_0x3075a6[_0x33e0('0x16')],_0x3075a6[_0x33e0('0x15')]);this['talktime']=utils[_0x33e0('0x1b')](this[_0x33e0('0x17')],_0x3075a6[_0x33e0('0x16')]);this[_0x33e0('0x5')]=_0x258354[_0x33e0('0x5')];this[_0x33e0('0x1d')]=_0x258354['membername'];this[_0x33e0('0x1e')]=_0x258354[_0x33e0('0x1e')];this[_0x33e0('0x1f')]=_0x3075a6[_0x33e0('0x1f')];this[_0x33e0('0x20')]=_0x3075a6[_0x33e0('0x20')];this[_0x33e0('0x21')]=_0x3075a6['callbackat'];this[_0x33e0('0x22')]=_0x3075a6[_0x33e0('0x22')];this[_0x33e0('0x23')]=_0x3075a6[_0x33e0('0x23')];this[_0x33e0('0x24')]=_0x3075a6[_0x33e0('0x24')];this[_0x33e0('0x25')]=_0x3075a6[_0x33e0('0x25')];this[_0x33e0('0x26')]=_0x3075a6[_0x33e0('0x26')];this['CampaignId']=_0x3075a6[_0x33e0('0x27')];this[_0x33e0('0x28')]=_0x3075a6[_0x33e0('0x28')]||'';this[_0x33e0('0x29')]=_0x3075a6['originatecalleridname']||'';this[_0x33e0('0x2a')]=_0x3075a6[_0x33e0('0x2a')];}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 4f46fed..03cc2d3 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5442=['statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','state'];(function(_0x81e936,_0x61f95c){var _0x5dc929=function(_0x3e2e94){while(--_0x3e2e94){_0x81e936['push'](_0x81e936['shift']());}};_0x5dc929(++_0x61f95c);}(_0x5442,0x1e2));var _0x2544=function(_0xab9f3d,_0xb336fa){_0xab9f3d=_0xab9f3d-0x0;var _0x5283bf=_0x5442[_0xab9f3d];return _0x5283bf;};'use strict';function Final(_0x3de414){this[_0x2544('0x0')]=_0x3de414['uniqueid'];this[_0x2544('0x1')]=_0x3de414[_0x2544('0x1')];this[_0x2544('0x2')]=_0x3de414[_0x2544('0x2')];this[_0x2544('0x3')]=_0x3de414['type']===_0x2544('0x4')?_0x2544('0x5'):_0x3de414[_0x2544('0x2')];this[_0x2544('0x6')]=_0x3de414[_0x2544('0x6')];this[_0x2544('0x7')]=_0x3de414[_0x2544('0x7')];this[_0x2544('0x8')]=_0x3de414[_0x2544('0x8')];this['countglobal']=_0x3de414[_0x2544('0x6')]+_0x3de414[_0x2544('0x7')]+_0x3de414[_0x2544('0x8')]+_0x3de414[_0x2544('0x9')]+_0x3de414[_0x2544('0xa')]+_0x3de414[_0x2544('0xb')]+_0x3de414[_0x2544('0xc')]+_0x3de414[_0x2544('0xd')];this[_0x2544('0x9')]=_0x3de414[_0x2544('0x9')];this[_0x2544('0xa')]=_0x3de414[_0x2544('0xa')];this[_0x2544('0xb')]=_0x3de414[_0x2544('0xb')];this[_0x2544('0xc')]=_0x3de414['countmachineretry'];this[_0x2544('0xd')]=_0x3de414[_0x2544('0xd')];this['queue']=_0x3de414['queue'];this[_0x2544('0xe')]=_0x3de414[_0x2544('0xe')];this[_0x2544('0xf')]=_0x3de414[_0x2544('0xf')];this[_0x2544('0x10')]=_0x3de414[_0x2544('0x10')];this[_0x2544('0x11')]=_0x3de414[_0x2544('0x11')];this['endtime']=_0x3de414[_0x2544('0x11')];this[_0x2544('0x12')]=_0x3de414[_0x2544('0x12')]||0x0;this[_0x2544('0x13')]=_0x3de414[_0x2544('0x13')]||0x0;this['talktime']=_0x3de414['talktime']||0x0;this[_0x2544('0x14')]=_0x3de414[_0x2544('0x14')];this['callbackuniqueid']=_0x3de414[_0x2544('0x15')];this[_0x2544('0x16')]=_0x3de414[_0x2544('0x16')];this[_0x2544('0x17')]=_0x3de414['recallme'];this[_0x2544('0x18')]=_0x3de414[_0x2544('0x18')];this[_0x2544('0x19')]=_0x3de414[_0x2544('0x19')];this[_0x2544('0x1a')]=_0x3de414[_0x2544('0x1a')];this[_0x2544('0x1b')]=_0x3de414[_0x2544('0x1b')];this['CampaignId']=_0x3de414['CampaignId'];this['originatecalleridnum']=_0x3de414['originatecalleridnum']||'';this[_0x2544('0x1c')]=_0x3de414['originatecalleridname']||'';this[_0x2544('0x1d')]=_0x3de414['state'];this[_0x2544('0x1e')]=_0x3de414[_0x2544('0x1e')];}module[_0x2544('0x1f')]=Final; \ No newline at end of file +var _0x941f=['exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state'];(function(_0x41c9ed,_0x4f0042){var _0x4c47e1=function(_0x2982a9){while(--_0x2982a9){_0x41c9ed['push'](_0x41c9ed['shift']());}};_0x4c47e1(++_0x4f0042);}(_0x941f,0x6d));var _0xf941=function(_0x278ca9,_0x524f85){_0x278ca9=_0x278ca9-0x0;var _0x36c927=_0x941f[_0x278ca9];return _0x36c927;};'use strict';function Final(_0x21499b){this['uniqueid']=_0x21499b[_0xf941('0x0')];this[_0xf941('0x1')]=_0x21499b[_0xf941('0x1')];this[_0xf941('0x2')]=_0x21499b['type'];this[_0xf941('0x3')]=_0x21499b[_0xf941('0x2')]===_0xf941('0x4')?_0xf941('0x5'):_0x21499b[_0xf941('0x2')];this['countbusyretry']=_0x21499b[_0xf941('0x6')];this[_0xf941('0x7')]=_0x21499b['countcongestionretry'];this[_0xf941('0x8')]=_0x21499b[_0xf941('0x8')];this[_0xf941('0x9')]=_0x21499b['countbusyretry']+_0x21499b[_0xf941('0x7')]+_0x21499b[_0xf941('0x8')]+_0x21499b['countnosuchnumberretry']+_0x21499b[_0xf941('0xa')]+_0x21499b['countabandonedretry']+_0x21499b[_0xf941('0xb')]+_0x21499b['countagentrejectretry'];this[_0xf941('0xc')]=_0x21499b[_0xf941('0xc')];this[_0xf941('0xa')]=_0x21499b[_0xf941('0xa')];this[_0xf941('0xd')]=_0x21499b[_0xf941('0xd')];this[_0xf941('0xb')]=_0x21499b[_0xf941('0xb')];this[_0xf941('0xe')]=_0x21499b[_0xf941('0xe')];this[_0xf941('0x5')]=_0x21499b[_0xf941('0x5')];this[_0xf941('0xf')]=_0x21499b['calleridname'];this['calleridnum']=_0x21499b[_0xf941('0x10')];this[_0xf941('0x11')]=_0x21499b[_0xf941('0x11')];this['responsetime']=_0x21499b[_0xf941('0x12')];this[_0xf941('0x13')]=_0x21499b[_0xf941('0x12')];this['ringtime']=_0x21499b[_0xf941('0x14')]||0x0;this[_0xf941('0x15')]=_0x21499b['holdtime']||0x0;this['talktime']=_0x21499b[_0xf941('0x16')]||0x0;this[_0xf941('0x17')]=_0x21499b['callback'];this[_0xf941('0x18')]=_0x21499b['callbackuniqueid'];this[_0xf941('0x19')]=_0x21499b[_0xf941('0x19')];this[_0xf941('0x1a')]=_0x21499b['recallme'];this[_0xf941('0x1b')]=_0x21499b[_0xf941('0x1b')];this[_0xf941('0x1c')]=_0x21499b[_0xf941('0x1c')];this[_0xf941('0x1d')]=_0x21499b[_0xf941('0x1d')];this[_0xf941('0x1e')]=_0x21499b[_0xf941('0x1e')];this[_0xf941('0x1f')]=_0x21499b['CampaignId'];this[_0xf941('0x20')]=_0x21499b['originatecalleridnum']||'';this[_0xf941('0x21')]=_0x21499b['originatecalleridname']||'';this[_0xf941('0x22')]=_0x21499b[_0xf941('0x22')];this['statedesc']=_0x21499b['statedesc'];}module[_0xf941('0x23')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 4cb637f..31b207b 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bac=['outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','../utils','statedesc','Answer','scheduledat','type','campaigntype'];(function(_0x31bfee,_0x5e7b65){var _0x4fe58e=function(_0x52f282){while(--_0x52f282){_0x31bfee['push'](_0x31bfee['shift']());}};_0x4fe58e(++_0x5e7b65);}(_0x2bac,0x10b));var _0xc2ba=function(_0x1a4cd6,_0x2b0a04){_0x1a4cd6=_0x1a4cd6-0x0;var _0x117039=_0x2bac[_0x1a4cd6];return _0x117039;};'use strict';var moment=require('moment');var utils=require(_0xc2ba('0x0'));function Hangup(_0x43a8d1,_0x2b6379){this['state']=0x4;this[_0xc2ba('0x1')]=_0xc2ba('0x2');this['scheduledat']=_0x43a8d1[_0xc2ba('0x3')];this['type']=_0x43a8d1[_0xc2ba('0x4')];this[_0xc2ba('0x5')]=_0x43a8d1[_0xc2ba('0x4')]===_0xc2ba('0x6')?_0xc2ba('0x7'):_0x43a8d1[_0xc2ba('0x4')];this[_0xc2ba('0x8')]=_0x43a8d1[_0xc2ba('0x8')]||![];this[_0xc2ba('0x9')]=_0x43a8d1[_0xc2ba('0x9')];this['countcongestionretry']=_0x43a8d1[_0xc2ba('0xa')];this[_0xc2ba('0xb')]=_0x43a8d1[_0xc2ba('0xb')];this['countglobal']=_0x43a8d1[_0xc2ba('0x9')]+_0x43a8d1[_0xc2ba('0xa')]+_0x43a8d1[_0xc2ba('0xb')]+_0x43a8d1[_0xc2ba('0xc')]+_0x43a8d1[_0xc2ba('0xd')]+_0x43a8d1[_0xc2ba('0xe')]+_0x43a8d1['countmachineretry']+_0x43a8d1[_0xc2ba('0xf')];this['countnosuchnumberretry']=_0x43a8d1[_0xc2ba('0xc')];this[_0xc2ba('0xd')]=_0x43a8d1[_0xc2ba('0xd')];this[_0xc2ba('0xe')]=_0x43a8d1[_0xc2ba('0xe')];this[_0xc2ba('0x10')]=_0x43a8d1[_0xc2ba('0x10')];this[_0xc2ba('0xf')]=_0x43a8d1[_0xc2ba('0xf')];this['uniqueid']=_0x2b6379[_0xc2ba('0x11')];this[_0xc2ba('0x12')]=_0x43a8d1[_0xc2ba('0x13')];this[_0xc2ba('0x14')]=_0x43a8d1['number'];this[_0xc2ba('0x15')]=_0x43a8d1[_0xc2ba('0x15')];this['responsetime']=_0x43a8d1[_0xc2ba('0x16')];this[_0xc2ba('0x17')]=moment()[_0xc2ba('0x18')](_0xc2ba('0x19'));this['ringtime']=utils['getSeconds'](_0x43a8d1['responsetime'],_0x43a8d1[_0xc2ba('0x15')]);this['holdtime']=0x0;this['talktime']=utils[_0xc2ba('0x1a')](this[_0xc2ba('0x17')],_0x43a8d1['responsetime']);this[_0xc2ba('0x7')]=_0x43a8d1[_0xc2ba('0x7')];this[_0xc2ba('0x1b')]=_0xc2ba('0x1c');this[_0xc2ba('0x1d')]=_0x2b6379['cause-txt'];this[_0xc2ba('0x1e')]=_0x43a8d1[_0xc2ba('0x1e')];this[_0xc2ba('0x1f')]=_0x43a8d1[_0xc2ba('0x1f')];this[_0xc2ba('0x20')]=_0x43a8d1[_0xc2ba('0x20')];this[_0xc2ba('0x21')]=_0x43a8d1[_0xc2ba('0x21')];this[_0xc2ba('0x22')]=_0x43a8d1[_0xc2ba('0x22')];this['ListId']=_0x43a8d1[_0xc2ba('0x23')];this[_0xc2ba('0x24')]=_0x43a8d1[_0xc2ba('0x24')];this[_0xc2ba('0x25')]=_0x43a8d1[_0xc2ba('0x25')];this['CampaignId']=_0x43a8d1[_0xc2ba('0x26')];}module['exports']=Hangup; \ No newline at end of file +var _0x745e=['campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','ringtime','getSeconds','holdtime','talktime','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','../utils','state','scheduledat','type'];(function(_0xd2d54,_0x5329f7){var _0x78b113=function(_0x7d2b29){while(--_0x7d2b29){_0xd2d54['push'](_0xd2d54['shift']());}};_0x78b113(++_0x5329f7);}(_0x745e,0x144));var _0xe745=function(_0x1cf34d,_0x119eb9){_0x1cf34d=_0x1cf34d-0x0;var _0x1f1364=_0x745e[_0x1cf34d];return _0x1f1364;};'use strict';var moment=require('moment');var utils=require(_0xe745('0x0'));function Hangup(_0x658b21,_0x58b95d){this[_0xe745('0x1')]=0x4;this['statedesc']='Answer';this[_0xe745('0x2')]=_0x658b21[_0xe745('0x2')];this[_0xe745('0x3')]=_0x658b21[_0xe745('0x3')];this[_0xe745('0x4')]=_0x658b21[_0xe745('0x3')]===_0xe745('0x5')?_0xe745('0x6'):_0x658b21[_0xe745('0x3')];this[_0xe745('0x7')]=_0x658b21[_0xe745('0x7')]||![];this[_0xe745('0x8')]=_0x658b21[_0xe745('0x8')];this[_0xe745('0x9')]=_0x658b21[_0xe745('0x9')];this['countnoanswerretry']=_0x658b21[_0xe745('0xa')];this[_0xe745('0xb')]=_0x658b21['countbusyretry']+_0x658b21[_0xe745('0x9')]+_0x658b21['countnoanswerretry']+_0x658b21[_0xe745('0xc')]+_0x658b21[_0xe745('0xd')]+_0x658b21['countabandonedretry']+_0x658b21[_0xe745('0xe')]+_0x658b21['countagentrejectretry'];this[_0xe745('0xc')]=_0x658b21['countnosuchnumberretry'];this[_0xe745('0xd')]=_0x658b21[_0xe745('0xd')];this[_0xe745('0xf')]=_0x658b21[_0xe745('0xf')];this['countmachineretry']=_0x658b21[_0xe745('0xe')];this[_0xe745('0x10')]=_0x658b21[_0xe745('0x10')];this[_0xe745('0x11')]=_0x58b95d[_0xe745('0x11')];this[_0xe745('0x12')]=_0x658b21[_0xe745('0x13')];this[_0xe745('0x14')]=_0x658b21[_0xe745('0x15')];this[_0xe745('0x16')]=_0x658b21[_0xe745('0x16')];this[_0xe745('0x17')]=_0x658b21[_0xe745('0x17')];this[_0xe745('0x18')]=moment()[_0xe745('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe745('0x1a')]=utils[_0xe745('0x1b')](_0x658b21[_0xe745('0x17')],_0x658b21['starttime']);this[_0xe745('0x1c')]=0x0;this[_0xe745('0x1d')]=utils[_0xe745('0x1b')](this[_0xe745('0x18')],_0x658b21[_0xe745('0x17')]);this[_0xe745('0x6')]=_0x658b21[_0xe745('0x6')];this[_0xe745('0x1e')]=_0xe745('0x1f');this[_0xe745('0x20')]=_0x58b95d['cause-txt'];this[_0xe745('0x21')]=_0x658b21[_0xe745('0x21')];this[_0xe745('0x22')]=_0x658b21[_0xe745('0x22')];this[_0xe745('0x23')]=_0x658b21['callbackat'];this['recallme']=_0x658b21[_0xe745('0x24')];this[_0xe745('0x25')]=_0x658b21['ContactId'];this['ListId']=_0x658b21['ListId'];this['UserId']=_0x658b21[_0xe745('0x26')];this[_0xe745('0x27')]=_0x658b21[_0xe745('0x27')];this[_0xe745('0x28')]=_0x658b21[_0xe745('0x28')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 265db46..ab728c8 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb6c=['endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','starttime','responsetime'];(function(_0x4b076c,_0x3dc4bb){var _0x4d5be2=function(_0x3024a7){while(--_0x3024a7){_0x4b076c['push'](_0x4b076c['shift']());}};_0x4d5be2(++_0x3dc4bb);}(_0xeb6c,0x1a7));var _0xceb6=function(_0x15eb5b,_0x264c0c){_0x15eb5b=_0x15eb5b-0x0;var _0x5616e8=_0xeb6c[_0x15eb5b];return _0x5616e8;};'use strict';var utils=require(_0xceb6('0x0'));function History(_0x8ae4f6){this[_0xceb6('0x1')]=_0x8ae4f6[_0xceb6('0x1')];this[_0xceb6('0x2')]=_0x8ae4f6[_0xceb6('0x2')]||undefined;this['type']=_0x8ae4f6[_0xceb6('0x3')];this[_0xceb6('0x4')]=_0x8ae4f6['type']===_0xceb6('0x5')?'queue':_0x8ae4f6['type'];this[_0xceb6('0x6')]=_0x8ae4f6[_0xceb6('0x6')];this[_0xceb6('0x7')]=_0x8ae4f6[_0xceb6('0x7')];this[_0xceb6('0x8')]=_0x8ae4f6[_0xceb6('0x8')];this['countglobal']=_0x8ae4f6[_0xceb6('0x6')]+_0x8ae4f6[_0xceb6('0x7')]+_0x8ae4f6[_0xceb6('0x8')]+_0x8ae4f6[_0xceb6('0x9')]+_0x8ae4f6[_0xceb6('0xa')]+_0x8ae4f6[_0xceb6('0xb')]+_0x8ae4f6[_0xceb6('0xc')]+_0x8ae4f6[_0xceb6('0xd')];this[_0xceb6('0x9')]=_0x8ae4f6[_0xceb6('0x9')];this['countdropretry']=_0x8ae4f6[_0xceb6('0xa')];this['countabandonedretry']=_0x8ae4f6[_0xceb6('0xb')];this[_0xceb6('0xc')]=_0x8ae4f6[_0xceb6('0xc')];this['countagentrejectretry']=_0x8ae4f6[_0xceb6('0xd')];this['queue']=_0x8ae4f6[_0xceb6('0xe')];this[_0xceb6('0xf')]=_0x8ae4f6[_0xceb6('0x10')];this['calleridnum']=_0x8ae4f6['number'];this['starttime']=_0x8ae4f6[_0xceb6('0x11')];this['responsetime']=_0x8ae4f6[_0xceb6('0x12')];this[_0xceb6('0x13')]=_0x8ae4f6[_0xceb6('0x12')];this[_0xceb6('0x14')]=utils['getSeconds'](_0x8ae4f6[_0xceb6('0x12')],_0x8ae4f6['starttime']);this[_0xceb6('0x15')]=0x0;this['talktime']=0x0;this[_0xceb6('0x16')]=_0x8ae4f6[_0xceb6('0x16')];this[_0xceb6('0x17')]=_0x8ae4f6[_0xceb6('0x17')];this[_0xceb6('0x18')]=_0x8ae4f6[_0xceb6('0x18')];this[_0xceb6('0x19')]=_0x8ae4f6[_0xceb6('0x19')];this[_0xceb6('0x1a')]=_0x8ae4f6[_0xceb6('0x1a')];this['ListId']=_0x8ae4f6[_0xceb6('0x1b')];this['UserId']=_0x8ae4f6['UserId'];this['VoiceQueueId']=_0x8ae4f6[_0xceb6('0x1c')];this[_0xceb6('0x1d')]=_0x8ae4f6[_0xceb6('0x1d')];this[_0xceb6('0x1e')]=_0x8ae4f6[_0xceb6('0x1e')]||'';this[_0xceb6('0x1f')]=_0x8ae4f6[_0xceb6('0x1f')]||'';this[_0xceb6('0x20')]=_0x8ae4f6[_0xceb6('0x20')];this['statedesc']=_0x8ae4f6['statedesc'];}module[_0xceb6('0x21')]=History; \ No newline at end of file +var _0x841b=['talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime'];(function(_0x311f7d,_0x4ae78f){var _0xb5fb14=function(_0x420de7){while(--_0x420de7){_0x311f7d['push'](_0x311f7d['shift']());}};_0xb5fb14(++_0x4ae78f);}(_0x841b,0x83));var _0xb841=function(_0x5c4d15,_0x32fe23){_0x5c4d15=_0x5c4d15-0x0;var _0x1f974a=_0x841b[_0x5c4d15];return _0x1f974a;};'use strict';var utils=require(_0xb841('0x0'));function History(_0x4c18d4){this[_0xb841('0x1')]=_0x4c18d4['uniqueid'];this[_0xb841('0x2')]=_0x4c18d4[_0xb841('0x2')]||undefined;this['type']=_0x4c18d4[_0xb841('0x3')];this[_0xb841('0x4')]=_0x4c18d4[_0xb841('0x3')]==='outbound'?_0xb841('0x5'):_0x4c18d4[_0xb841('0x3')];this['countbusyretry']=_0x4c18d4['countbusyretry'];this[_0xb841('0x6')]=_0x4c18d4['countcongestionretry'];this['countnoanswerretry']=_0x4c18d4[_0xb841('0x7')];this[_0xb841('0x8')]=_0x4c18d4[_0xb841('0x9')]+_0x4c18d4[_0xb841('0x6')]+_0x4c18d4[_0xb841('0x7')]+_0x4c18d4[_0xb841('0xa')]+_0x4c18d4[_0xb841('0xb')]+_0x4c18d4['countabandonedretry']+_0x4c18d4[_0xb841('0xc')]+_0x4c18d4[_0xb841('0xd')];this[_0xb841('0xa')]=_0x4c18d4[_0xb841('0xa')];this[_0xb841('0xb')]=_0x4c18d4['countdropretry'];this['countabandonedretry']=_0x4c18d4[_0xb841('0xe')];this[_0xb841('0xc')]=_0x4c18d4[_0xb841('0xc')];this['countagentrejectretry']=_0x4c18d4[_0xb841('0xd')];this[_0xb841('0x5')]=_0x4c18d4[_0xb841('0x5')];this[_0xb841('0xf')]=_0x4c18d4[_0xb841('0x10')];this[_0xb841('0x11')]=_0x4c18d4[_0xb841('0x12')];this[_0xb841('0x13')]=_0x4c18d4[_0xb841('0x13')];this[_0xb841('0x14')]=_0x4c18d4[_0xb841('0x14')];this[_0xb841('0x15')]=_0x4c18d4[_0xb841('0x14')];this[_0xb841('0x16')]=utils[_0xb841('0x17')](_0x4c18d4[_0xb841('0x14')],_0x4c18d4['starttime']);this[_0xb841('0x18')]=0x0;this[_0xb841('0x19')]=0x0;this[_0xb841('0x1a')]=_0x4c18d4[_0xb841('0x1a')];this[_0xb841('0x1b')]=_0x4c18d4[_0xb841('0x1b')];this[_0xb841('0x1c')]=_0x4c18d4[_0xb841('0x1c')];this['recallme']=_0x4c18d4[_0xb841('0x1d')];this['ContactId']=_0x4c18d4['ContactId'];this[_0xb841('0x1e')]=_0x4c18d4[_0xb841('0x1e')];this['UserId']=_0x4c18d4[_0xb841('0x1f')];this[_0xb841('0x20')]=_0x4c18d4[_0xb841('0x20')];this[_0xb841('0x21')]=_0x4c18d4['CampaignId'];this[_0xb841('0x22')]=_0x4c18d4[_0xb841('0x22')]||'';this[_0xb841('0x23')]=_0x4c18d4['originatecalleridname']||'';this['state']=_0x4c18d4[_0xb841('0x24')];this[_0xb841('0x25')]=_0x4c18d4['statedesc'];}module[_0xb841('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index b2110c3..d7bbdc2 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7092=['connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','queue','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','talktime','membername'];(function(_0x436b6e,_0x30ccab){var _0x3fe68d=function(_0x4cc0a9){while(--_0x4cc0a9){_0x436b6e['push'](_0x436b6e['shift']());}};_0x3fe68d(++_0x30ccab);}(_0x7092,0x1ea));var _0x2709=function(_0x11dd62,_0x584ce2){_0x11dd62=_0x11dd62-0x0;var _0x123228=_0x7092[_0x11dd62];return _0x123228;};'use strict';var utils=require(_0x2709('0x0'));function QueueCallerAbandon(_0x575f68,_0x173bbc){this[_0x2709('0x1')]=_0x575f68[_0x2709('0x1')];this[_0x2709('0x2')]=_0x575f68[_0x2709('0x2')];this[_0x2709('0x3')]=_0x575f68['type']==='outbound'?_0x2709('0x4'):_0x575f68[_0x2709('0x2')];this['countbusyretry']=_0x575f68['countbusyretry'];this[_0x2709('0x5')]=_0x575f68['countcongestionretry'];this[_0x2709('0x6')]=_0x575f68[_0x2709('0x6')];this[_0x2709('0x7')]=_0x575f68['countbusyretry']+_0x575f68[_0x2709('0x5')]+_0x575f68[_0x2709('0x6')]+_0x575f68['countnosuchnumberretry']+_0x575f68[_0x2709('0x8')]+_0x575f68[_0x2709('0x9')]+_0x575f68[_0x2709('0xa')]+_0x575f68[_0x2709('0xb')];this[_0x2709('0xc')]=_0x575f68[_0x2709('0xc')];this[_0x2709('0x8')]=_0x575f68[_0x2709('0x8')];this['countabandonedretry']=_0x575f68[_0x2709('0x9')];this[_0x2709('0xa')]=_0x575f68[_0x2709('0xa')];this['countagentrejectretry']=_0x575f68['countagentrejectretry'];this[_0x2709('0xd')]=_0x173bbc[_0x2709('0xd')];this[_0x2709('0xe')]=_0x575f68[_0x2709('0xf')];this[_0x2709('0x10')]=_0x575f68['number'];this[_0x2709('0x11')]=_0x575f68['starttime'];this[_0x2709('0x12')]=_0x575f68[_0x2709('0x12')];this[_0x2709('0x13')]=_0x575f68[_0x2709('0x13')];this[_0x2709('0x14')]=_0x575f68[_0x2709('0x14')];this[_0x2709('0x15')]=this[_0x2709('0x13')];this[_0x2709('0x16')]=utils['getSeconds'](_0x575f68[_0x2709('0x12')],_0x575f68[_0x2709('0x11')]);this['holdtime']=utils[_0x2709('0x17')](this['droptime'],_0x575f68['responsetime']);this[_0x2709('0x18')]=0x0;this[_0x2709('0x4')]=_0x173bbc['queue'];this[_0x2709('0x19')]=_0x173bbc[_0x2709('0x1a')];this[_0x2709('0x1b')]=_0x173bbc[_0x2709('0x1b')];this[_0x2709('0x1c')]=_0x575f68[_0x2709('0x1c')];this[_0x2709('0x1d')]=_0x575f68['callbackuniqueid'];this[_0x2709('0x1e')]=_0x575f68['callbackat'];this[_0x2709('0x1f')]=_0x575f68['recallme'];this[_0x2709('0x20')]=_0x575f68['ContactId'];this[_0x2709('0x21')]=_0x575f68['ListId'];this[_0x2709('0x22')]=_0x575f68[_0x2709('0x22')];this[_0x2709('0x23')]=_0x575f68[_0x2709('0x23')];this['CampaignId']=_0x575f68[_0x2709('0x24')];this[_0x2709('0x25')]=_0x575f68[_0x2709('0x25')]||'';this[_0x2709('0x26')]=_0x575f68[_0x2709('0x26')]||'';this[_0x2709('0x27')]=_0x575f68['agiafterat'];this[_0x2709('0x28')]=_0x575f68[_0x2709('0x28')];this[_0x2709('0x29')]=_0x575f68['statedesc'];}module[_0x2709('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0x9ae8=['agiafterat','state','statedesc','exports','../utils','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','getSeconds','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x113daa,_0x3355d2){var _0x1fa1a1=function(_0x34a36d){while(--_0x34a36d){_0x113daa['push'](_0x113daa['shift']());}};_0x1fa1a1(++_0x3355d2);}(_0x9ae8,0x1d2));var _0x89ae=function(_0x102454,_0x55917b){_0x102454=_0x102454-0x0;var _0xd9a193=_0x9ae8[_0x102454];return _0xd9a193;};'use strict';var utils=require(_0x89ae('0x0'));function QueueCallerAbandon(_0x183695,_0x442b13){this['scheduledat']=_0x183695[_0x89ae('0x1')];this[_0x89ae('0x2')]=_0x183695[_0x89ae('0x2')];this['campaigntype']=_0x183695[_0x89ae('0x2')]===_0x89ae('0x3')?_0x89ae('0x4'):_0x183695[_0x89ae('0x2')];this[_0x89ae('0x5')]=_0x183695[_0x89ae('0x5')];this[_0x89ae('0x6')]=_0x183695['countcongestionretry'];this[_0x89ae('0x7')]=_0x183695['countnoanswerretry'];this[_0x89ae('0x8')]=_0x183695[_0x89ae('0x5')]+_0x183695[_0x89ae('0x6')]+_0x183695[_0x89ae('0x7')]+_0x183695[_0x89ae('0x9')]+_0x183695[_0x89ae('0xa')]+_0x183695[_0x89ae('0xb')]+_0x183695[_0x89ae('0xc')]+_0x183695[_0x89ae('0xd')];this[_0x89ae('0x9')]=_0x183695[_0x89ae('0x9')];this[_0x89ae('0xa')]=_0x183695[_0x89ae('0xa')];this['countabandonedretry']=_0x183695[_0x89ae('0xb')];this['countmachineretry']=_0x183695['countmachineretry'];this[_0x89ae('0xd')]=_0x183695[_0x89ae('0xd')];this['uniqueid']=_0x442b13[_0x89ae('0xe')];this[_0x89ae('0xf')]=_0x183695[_0x89ae('0x10')];this[_0x89ae('0x11')]=_0x183695[_0x89ae('0x12')];this[_0x89ae('0x13')]=_0x183695[_0x89ae('0x13')];this[_0x89ae('0x14')]=_0x183695[_0x89ae('0x14')];this[_0x89ae('0x15')]=_0x183695[_0x89ae('0x15')];this['dropreason']=_0x183695['dropreason'];this[_0x89ae('0x16')]=this[_0x89ae('0x15')];this['ringtime']=utils[_0x89ae('0x17')](_0x183695[_0x89ae('0x14')],_0x183695[_0x89ae('0x13')]);this['holdtime']=utils[_0x89ae('0x17')](this['droptime'],_0x183695[_0x89ae('0x14')]);this[_0x89ae('0x18')]=0x0;this[_0x89ae('0x4')]=_0x442b13[_0x89ae('0x4')];this['membername']=_0x442b13[_0x89ae('0x19')];this[_0x89ae('0x1a')]=_0x442b13[_0x89ae('0x1a')];this[_0x89ae('0x1b')]=_0x183695[_0x89ae('0x1b')];this['callbackuniqueid']=_0x183695[_0x89ae('0x1c')];this[_0x89ae('0x1d')]=_0x183695[_0x89ae('0x1d')];this[_0x89ae('0x1e')]=_0x183695[_0x89ae('0x1e')];this[_0x89ae('0x1f')]=_0x183695[_0x89ae('0x1f')];this[_0x89ae('0x20')]=_0x183695[_0x89ae('0x20')];this['UserId']=_0x183695[_0x89ae('0x21')];this[_0x89ae('0x22')]=_0x183695[_0x89ae('0x22')];this[_0x89ae('0x23')]=_0x183695[_0x89ae('0x23')];this['originatecalleridnum']=_0x183695[_0x89ae('0x24')]||'';this[_0x89ae('0x25')]=_0x183695[_0x89ae('0x25')]||'';this[_0x89ae('0x26')]=_0x183695[_0x89ae('0x26')];this[_0x89ae('0x27')]=_0x183695[_0x89ae('0x27')];this[_0x89ae('0x28')]=_0x183695[_0x89ae('0x28')];}module[_0x89ae('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 63fd4d2..58ea185 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5334=['[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','error','[getContactDialer]','getContactDialer','getContactDialerIvr','temp','[getContactDialerIvr]','catch','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5334,0x84));var _0x4533=function(_0x364092,_0x462cf7){_0x364092=_0x364092-0x0;var _0x1afcb4=_0x5334[_0x364092];return _0x1afcb4;};'use strict';var util=require(_0x4533('0x0'));var logger=require(_0x4533('0x1'))(_0x4533('0x2'));var cmHopper=require(_0x4533('0x3'));var cmHopperAdditionalPhone=require(_0x4533('0x4'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0x4533('0x5'));function inspectError(_0x5176b5){return util[_0x4533('0x6')](_0x5176b5,{'showHidden':![],'depth':null});}function getContactDialer(_0x11ce61,_0x5cbca4,_0x4a576a){return cmHopper['getContactDialer'](_0x11ce61['id'],_0x5cbca4,_0x4a576a,_0x11ce61[_0x4533('0x7')])['catch'](function(_0x4d89e7){_0x11ce61['temp']=0x0;logger[_0x4533('0x8')](_0x4533('0x9'),inspectError(_0x4d89e7));});}exports[_0x4533('0xa')]=getContactDialer;function getContactDialerIvr(_0x2489b6,_0x31018b){return cmHopper[_0x4533('0xb')](_0x2489b6['id'],_0x31018b,_0x2489b6[_0x4533('0x7')])['catch'](function(_0x5533){_0x2489b6[_0x4533('0xc')]=0x0;logger[_0x4533('0x8')](_0x4533('0xd'),inspectError(_0x5533));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x7b2420){return cmHopper['countReScheduled'](_0x7b2420)[_0x4533('0xe')](function(_0x439210){logger[_0x4533('0x8')](_0x4533('0xf'),inspectError(_0x439210));});}exports['countReScheduled']=countReScheduled;function rescheduleContact(_0xdd4757){return cmHopper[_0x4533('0x10')](_0xdd4757)[_0x4533('0xe')](function(_0x18d4f0){logger['error'](_0x4533('0x11'),inspectError(_0x18d4f0));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x4c703c,_0x466545,_0x34dea9){return cmHopper['unlockContact'](_0x4c703c,_0x466545,_0x34dea9)[_0x4533('0xe')](function(_0x1e6a1a){logger[_0x4533('0x8')]('[unlockContact]',inspectError(_0x1e6a1a));});}exports[_0x4533('0x12')]=unlockContact;function moveContactManagedDialer(_0x4f732e){return cmHopper[_0x4533('0x13')](_0x4f732e)[_0x4533('0xe')](function(_0x56ab4f){logger[_0x4533('0x8')]('[moveContactManagedDialer]',inspectError(_0x56ab4f));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x1c5cdd){return cmHopperBlack[_0x4533('0x14')](_0x1c5cdd)['catch'](function(_0x53fe43){logger[_0x4533('0x8')](_0x4533('0x15'),inspectError(_0x53fe43));});}exports[_0x4533('0x14')]=checkIsBlackList;function checkIsBlackListIvr(_0x1b08fa){return cmHopperBlack[_0x4533('0x16')](_0x1b08fa)[_0x4533('0xe')](function(_0x12adde){logger['error'](_0x4533('0x17'),inspectError(_0x12adde));});}exports[_0x4533('0x16')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x2901f1,_0x4aa438,_0x513011){return cmHopperAdditionalPhone[_0x4533('0x18')](_0x2901f1,_0x4aa438,_0x513011)[_0x4533('0xe')](function(_0x4c640c){logger['error'](_0x4533('0x19'),inspectError(_0x4c640c));});}exports[_0x4533('0x18')]=verifyAdditionalPhones;function swapAdditionalPhones(_0xfd9409,_0x4d8189,_0x44786f){return cmHopperAdditionalPhone[_0x4533('0x1a')](_0xfd9409,_0x4d8189,_0x44786f)[_0x4533('0xe')](function(_0x3fba67){logger[_0x4533('0x8')](_0x4533('0x1b'),inspectError(_0x3fba67));});}exports[_0x4533('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x27b653){return cmHopperHistory[_0x4533('0x1c')](_0x27b653)['catch'](function(_0x5c1e24){logger[_0x4533('0x8')]('[avgHandleTime]',inspectError(_0x5c1e24));});}exports[_0x4533('0x1c')]=avgHandleTime;function createHistory(_0x4e2b80){return cmHopperHistory[_0x4533('0x1d')](_0x4e2b80)[_0x4533('0xe')](function(_0x38706b){logger[_0x4533('0x8')](_0x4533('0x1e'),inspectError(_0x38706b));});}exports[_0x4533('0x1d')]=createHistory; \ No newline at end of file +var _0x814b=['rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','[checkIsBlackList]','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','inspect','getContactDialer','catch','error','[getContactDialer]','getContactDialerIvr','dialOrderByScheduledAt','temp','countReScheduled','[countReScheduled]'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x814b,0x1a2));var _0xb814=function(_0x33593e,_0x22ddd3){_0x33593e=_0x33593e-0x0;var _0x53db1a=_0x814b[_0x33593e];return _0x53db1a;};'use strict';var util=require(_0xb814('0x0'));var logger=require(_0xb814('0x1'))(_0xb814('0x2'));var cmHopper=require(_0xb814('0x3'));var cmHopperAdditionalPhone=require(_0xb814('0x4'));var cmHopperBlack=require(_0xb814('0x5'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x38c21a){return util[_0xb814('0x6')](_0x38c21a,{'showHidden':![],'depth':null});}function getContactDialer(_0x258866,_0x4237bc,_0x44931c){return cmHopper[_0xb814('0x7')](_0x258866['id'],_0x4237bc,_0x44931c,_0x258866['dialOrderByScheduledAt'])[_0xb814('0x8')](function(_0x2e6272){_0x258866['temp']=0x0;logger[_0xb814('0x9')](_0xb814('0xa'),inspectError(_0x2e6272));});}exports[_0xb814('0x7')]=getContactDialer;function getContactDialerIvr(_0x41166c,_0x1fea33){return cmHopper[_0xb814('0xb')](_0x41166c['id'],_0x1fea33,_0x41166c[_0xb814('0xc')])[_0xb814('0x8')](function(_0x207dbc){_0x41166c[_0xb814('0xd')]=0x0;logger[_0xb814('0x9')]('[getContactDialerIvr]',inspectError(_0x207dbc));});}exports[_0xb814('0xb')]=getContactDialerIvr;function countReScheduled(_0x56278f){return cmHopper[_0xb814('0xe')](_0x56278f)[_0xb814('0x8')](function(_0x35b10d){logger[_0xb814('0x9')](_0xb814('0xf'),inspectError(_0x35b10d));});}exports[_0xb814('0xe')]=countReScheduled;function rescheduleContact(_0x1438e7){return cmHopper[_0xb814('0x10')](_0x1438e7)[_0xb814('0x8')](function(_0x2ab627){logger[_0xb814('0x9')](_0xb814('0x11'),inspectError(_0x2ab627));});}exports[_0xb814('0x10')]=rescheduleContact;function unlockContact(_0x39bfcf,_0x303aca,_0x3a71d6){return cmHopper[_0xb814('0x12')](_0x39bfcf,_0x303aca,_0x3a71d6)[_0xb814('0x8')](function(_0x125ce2){logger[_0xb814('0x9')](_0xb814('0x13'),inspectError(_0x125ce2));});}exports['unlockContact']=unlockContact;function moveContactManagedDialer(_0x168a48){return cmHopper['moveContactManagedDialer'](_0x168a48)[_0xb814('0x8')](function(_0xfac75b){logger['error']('[moveContactManagedDialer]',inspectError(_0xfac75b));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x399b43){return cmHopperBlack['checkIsBlackList'](_0x399b43)['catch'](function(_0xb684ea){logger[_0xb814('0x9')](_0xb814('0x14'),inspectError(_0xb684ea));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0xf5b8aa){return cmHopperBlack['checkIsBlackListIvr'](_0xf5b8aa)[_0xb814('0x8')](function(_0x1808a3){logger[_0xb814('0x9')](_0xb814('0x15'),inspectError(_0x1808a3));});}exports[_0xb814('0x16')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x2bd039,_0x1f5d40,_0x594470){return cmHopperAdditionalPhone[_0xb814('0x17')](_0x2bd039,_0x1f5d40,_0x594470)['catch'](function(_0x3f81d0){logger[_0xb814('0x9')](_0xb814('0x18'),inspectError(_0x3f81d0));});}exports[_0xb814('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x1c8a2e,_0xb9e57d,_0x3d836c){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x1c8a2e,_0xb9e57d,_0x3d836c)[_0xb814('0x8')](function(_0xc0ef66){logger[_0xb814('0x9')](_0xb814('0x19'),inspectError(_0xc0ef66));});}exports[_0xb814('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x1d5965){return cmHopperHistory[_0xb814('0x1b')](_0x1d5965)[_0xb814('0x8')](function(_0x5a6291){logger[_0xb814('0x9')](_0xb814('0x1c'),inspectError(_0x5a6291));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x9008b2){return cmHopperHistory[_0xb814('0x1d')](_0x9008b2)[_0xb814('0x8')](function(_0x499f22){logger[_0xb814('0x9')](_0xb814('0x1e'),inspectError(_0x499f22));});}exports['createHistory']=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 499b567..ad275ea 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a52=['DEACTIVATED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','isPreviewCampaign','type','isOutboundQueue','isQueueCampaignActive','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','dialMethod','dialActive','message','available','loggedIn','loggedInDb','talking','pTalking','waiting','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialGlobalInterval','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','includes','status','TrunkBackup','INACTIVE','DISACTIVED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','string','format','\x22%s\x22\x20<%s>','isUndefined','\x22\x22\x20<>','getCallerId','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','checkContactEmpty','createdAt','tags','updatedAt','undefined','%s%s','toUpperCase','lodash','moment','util','../../../../config/logger','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS'];(function(_0x368414,_0x520966){var _0x1b5cfa=function(_0x42377f){while(--_0x42377f){_0x368414['push'](_0x368414['shift']());}};_0x1b5cfa(++_0x520966);}(_0x0a52,0x147));var _0x20a5=function(_0x215687,_0x39a87b){_0x215687=_0x215687-0x0;var _0x1591fc=_0x0a52[_0x215687];return _0x1591fc;};'use strict';var _=require(_0x20a5('0x0'));var moment=require(_0x20a5('0x1'));var util=require(_0x20a5('0x2'));var logger=require(_0x20a5('0x3'))('dialer');var timezones=require(_0x20a5('0x4'))[_0x20a5('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0x20a5('0x6'),'BLACKLIST':_0x20a5('0x7'),'CONTACTS_RESCHEDULED':_0x20a5('0x8'),'DEACTIVATED':_0x20a5('0x9'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0x20a5('0xa'),'INACTIVE':_0x20a5('0xb'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x20a5('0xc'),'NULL_INTERVAL':_0x20a5('0xd'),'OVERTIME_INTERVAL':_0x20a5('0xe'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x20a5('0xf'),'RECALL_TIMEOUT':_0x20a5('0x10'),'RUNNING':_0x20a5('0x11'),'UNKNOWN_TIMEZONE':_0x20a5('0x12'),'UNREACHABLE_TRUNK':_0x20a5('0x13')};exports[_0x20a5('0x14')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x313b8){return _0x313b8['dialMethod']==='preview';}exports[_0x20a5('0x15')]=isPreviewCampaign;function isIVRCampaign(_0x3bd49f){return _0x3bd49f[_0x20a5('0x16')]==='ivr';}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x45141a){return _0x45141a['type']==='outbound';}exports[_0x20a5('0x17')]=isOutboundQueue;function isQueueCampaignActive(_0x42ef3a){return _0x42ef3a['dialActive'];}exports[_0x20a5('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x24d467){return _0x24d467['active'];}exports[_0x20a5('0x19')]=isIVRCampaignActive;function getSeconds(_0x22210f,_0x2196db){var _0x3c2cc9=moment(_0x22210f)[_0x20a5('0x1a')](0x0);var _0x11e065=moment(_0x2196db)['milliseconds'](0x0);return _0x3c2cc9[_0x20a5('0x1b')](_0x11e065,_0x20a5('0x1c'));}exports[_0x20a5('0x1d')]=getSeconds;function hasQueueCampaignDataChanged(_0x3409b2,_0x3635e6){var _0x624495=![];var _0x49bdb1=_0x3409b2[_0x20a5('0x1e')]!==_0x3635e6['dialMethod']||_0x3409b2[_0x20a5('0x1f')]!==_0x3635e6['dialActive']||_0x3409b2['message']!==_0x3635e6[_0x20a5('0x20')];var _0x410e09=_0x3409b2[_0x20a5('0x21')]!==_0x3635e6[_0x20a5('0x21')]||_0x3409b2[_0x20a5('0x22')]!==_0x3635e6['loggedIn']||_0x3409b2[_0x20a5('0x23')]!==_0x3635e6[_0x20a5('0x23')]||_0x3409b2['paused']!==_0x3635e6['paused']||_0x3409b2[_0x20a5('0x24')]!==_0x3635e6[_0x20a5('0x24')]||_0x3409b2[_0x20a5('0x25')]!==_0x3635e6[_0x20a5('0x25')]||_0x3409b2[_0x20a5('0x26')]!==_0x3635e6['waiting']||_0x3409b2['inUse']!==_0x3635e6['inUse']||_0x3409b2[_0x20a5('0x27')]!==_0x3635e6[_0x20a5('0x27')];if(_0x3409b2[_0x20a5('0x28')]&&_0x3635e6[_0x20a5('0x28')]){_0x624495=_0x3409b2[_0x20a5('0x28')][_0x20a5('0x29')]!==_0x3635e6[_0x20a5('0x28')]['name']||_0x3409b2[_0x20a5('0x28')]['active']!==_0x3635e6[_0x20a5('0x28')][_0x20a5('0x2a')];}return _0x49bdb1||_0x410e09||_0x624495;}exports[_0x20a5('0x2b')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x3d1096){var _0x416388=null;var _0x2a7817=_0x3d1096['dialTimezone'];if(_['isNil'](_0x3d1096[_0x20a5('0x2c')])||_[_0x20a5('0x2d')](_0x3d1096[_0x20a5('0x2e')])||_['isNil'](_0x3d1096[_0x20a5('0x2e')][_0x20a5('0x2f')])){_0x416388=CAMPAIGN_STATUS[_0x20a5('0x30')];}else if(_[_0x20a5('0x31')](_0x3d1096[_0x20a5('0x2c')])||_[_0x20a5('0x31')](_0x3d1096[_0x20a5('0x2e')]['Intervals'])){_0x416388=CAMPAIGN_STATUS[_0x20a5('0x32')];}else if(_0x2a7817&&!timezones[_0x2a7817]){_0x416388=CAMPAIGN_STATUS[_0x20a5('0x33')];}return _0x416388;}function checkAnyValidTrunk(_0x4ea03f,_0x694bb1){var _0x8a8006=null;var _0x498260=_0x20a5('0x34');var _0x218e06=[_0x20a5('0x35'),'unmonitored'];var _0x52f1bf=!![];if(_0x4ea03f[_0x20a5('0x28')]&&_0x4ea03f['Trunk'][_0x20a5('0x2a')]){_0x498260+=_0x4ea03f[_0x20a5('0x28')][_0x20a5('0x29')];_0x8a8006=_0x694bb1[_0x498260];_0x52f1bf=_0x218e06[_0x20a5('0x36')](_0x8a8006[_0x20a5('0x37')]);}else if(_0x4ea03f[_0x20a5('0x38')]&&_0x4ea03f['TrunkBackup']['active']){_0x498260+=_0x4ea03f[_0x20a5('0x38')][_0x20a5('0x29')];_0x8a8006=_0x694bb1[_0x498260];_0x52f1bf=_0x218e06[_0x20a5('0x36')](_0x8a8006['status']);}return _0x52f1bf;}function getQueueCampaignStatusMessage(_0x21fac9,_0x2d4f24){var _0x385c0d=CAMPAIGN_STATUS[_0x20a5('0x6')];var _0x3d767b=isPreviewCampaign(_0x21fac9);if(!isQueueCampaignActive(_0x21fac9)){if(_0x3d767b){_0x385c0d=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x21fac9[_0x20a5('0x27')]===0x0&&_0x21fac9[_0x20a5('0x24')]===0x0&&_0x21fac9[_0x20a5('0x26')]===0x0&&(_0x21fac9['pTalking']||0x0)===0x0){_0x385c0d=CAMPAIGN_STATUS[_0x20a5('0x39')];}else{_0x385c0d=CAMPAIGN_STATUS[_0x20a5('0x3a')];}}}else if(_0x21fac9[_0x20a5('0x22')]===0x0){_0x385c0d=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x21fac9,_0x2d4f24)){_0x385c0d=CAMPAIGN_STATUS[_0x20a5('0x3b')];}else if(!isPreviewCampaign(_0x21fac9)){var _0x347cc8=checkAnyValidQueueCampaignInterval(_0x21fac9);if(_0x347cc8){_0x385c0d=_0x347cc8;}}return _0x385c0d;}exports[_0x20a5('0x3c')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x5a6d71){var _0x5669e1=CAMPAIGN_STATUS[_0x20a5('0x3a')];if(_0x5a6d71[_0x20a5('0x27')]===0x0&&_0x5a6d71[_0x20a5('0x24')]===0x0&&_0x5a6d71[_0x20a5('0x26')]===0x0&&(_0x5a6d71[_0x20a5('0x25')]||0x0)===0x0){_0x5669e1=CAMPAIGN_STATUS[_0x20a5('0x39')];}return _0x5669e1;}exports[_0x20a5('0x3d')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x5d611a){var _0x1ab5b5=_0x5d611a[_0x20a5('0x3e')](/"(.*?)"/);return _0x1ab5b5?_0x1ab5b5[0x1]:_0x5d611a;}exports[_0x20a5('0x3f')]=extractCalleridName;function getCallerId(_0x2fb546,_0x1321e4,_0x108e42){if(!_['isUndefined'](_0x108e42)&&typeof _0x108e42===_0x20a5('0x40')&&!_[_0x20a5('0x31')](_0x108e42)){if(!_['isUndefined'](_0x1321e4)&&typeof _0x1321e4==='string'&&!_[_0x20a5('0x31')](_0x1321e4)){return util[_0x20a5('0x41')](_0x20a5('0x42'),_0x1321e4,_0x108e42);}return util['format'](_0x20a5('0x42'),_0x108e42,_0x108e42);}if(!_[_0x20a5('0x43')](_0x2fb546)&&typeof _0x2fb546===_0x20a5('0x40')&&!_['isEmpty'](_0x2fb546)){return _0x2fb546;}return _0x20a5('0x44');}exports[_0x20a5('0x45')]=getCallerId;function getCallerIdRandom(_0x4b01e4,_0x308d9e){var _0x28b872;var _0x118498;var _0xc6527e;if(_0x308d9e<=0x0){_0x308d9e=0x1;}_0x28b872=new RegExp('\x5cw{0,'+_0x308d9e+'}$');_0x118498=Math['pow'](0xa,_0x308d9e-0x1);_0xc6527e=Math['pow'](0xa,_0x308d9e)-0x1;return util[_0x20a5('0x41')]('%s',_[_0x20a5('0x46')](_0x4b01e4,_0x28b872,_[_0x20a5('0x47')](_0x118498,_0xc6527e)[_0x20a5('0x48')]()));}exports[_0x20a5('0x49')]=getCallerIdRandom;function decrementOriginate(_0x2d7634){if(_0x2d7634['originated']&&_0x2d7634['originated']>0x0){_0x2d7634[_0x20a5('0x27')]-=0x1;}else{logger[_0x20a5('0x4a')](_0x20a5('0x4b'));}}exports[_0x20a5('0x4c')]=decrementOriginate;function checkContactEmpty(_0x13928b){return _0x13928b&&_0x13928b['length']>0x0;}exports[_0x20a5('0x4d')]=checkContactEmpty;function erlangb(_0x54034c,_0x5e32a0){if(_0x5e32a0===0x0){return 0x0;}var _0x53441a=0x1;for(var _0x274de5=0x1;_0x274de5<=_0x5e32a0;_0x274de5+=0x1){_0x53441a=0x1+_0x53441a*_0x274de5/_0x54034c;}return 0x1/_0x53441a;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0xbfd5b8,_0x4e3eed,_0x956c84){if(_0x4e3eed>_0x956c84){for(var _0x45361b=0x0;_0x45361b<_0x4e3eed-_0x956c84;_0x45361b+=0x1){decrementOriginate(_0xbfd5b8);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x1554d4){var _0xb69eed={};var _0x2cd104=['id',_0x20a5('0x4e'),'description',_0x20a5('0x4f'),_0x20a5('0x50')];if(_0x1554d4){for(var _0x95cb91 in _0x1554d4){if(typeof _0x1554d4[_0x95cb91]!==_0x20a5('0x51')){if(!_[_0x20a5('0x2d')](_0x1554d4[_0x95cb91])&&!_0x2cd104[_0x20a5('0x36')](_0x95cb91)){_0xb69eed[util[_0x20a5('0x41')](_0x20a5('0x52'),'XMD-',_0x95cb91[_0x20a5('0x53')]())]=_0x1554d4[_0x95cb91];}}}}return _0xb69eed;}exports['setXMDContactVariables']=setXMDContactVariables; \ No newline at end of file +var _0xcb66=['dialer','../../../../config/environment/shared','timezones','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RUNNING','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','type','ivr','outbound','isOutboundQueue','isQueueCampaignActive','active','milliseconds','diff','dialActive','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','NULL_INTERVAL','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','TrunkBackup','status','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','match','extractCalleridName','isUndefined','isEmpty','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','\x5cw{0,','pow','random','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactLowerLimitOriginate','description','tags','updatedAt','%s%s','XMD-','toUpperCase','setXMDContactVariables','lodash','moment','../../../../config/logger'];(function(_0xb22bde,_0x14bc70){var _0x195fb5=function(_0x1e7ba3){while(--_0x1e7ba3){_0xb22bde['push'](_0xb22bde['shift']());}};_0x195fb5(++_0x14bc70);}(_0xcb66,0x149));var _0x6cb6=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xcb66[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x6cb6('0x0'));var moment=require(_0x6cb6('0x1'));var util=require('util');var logger=require(_0x6cb6('0x2'))(_0x6cb6('0x3'));var timezones=require(_0x6cb6('0x4'))[_0x6cb6('0x5')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x6cb6('0x6'),'CONTACTS_RESCHEDULED':_0x6cb6('0x7'),'DEACTIVATED':_0x6cb6('0x8'),'DISACTIVED':_0x6cb6('0x9'),'EMPTY_INTERVAL':_0x6cb6('0xa'),'INACTIVE':_0x6cb6('0xb'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x6cb6('0xc'),'NULL_INTERVAL':_0x6cb6('0xd'),'OVERTIME_INTERVAL':_0x6cb6('0xe'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x6cb6('0xf'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':_0x6cb6('0x10'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0x6cb6('0x11')};exports[_0x6cb6('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x15d8b4){return _0x15d8b4[_0x6cb6('0x13')]==='preview';}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x46aaa6){return _0x46aaa6[_0x6cb6('0x14')]===_0x6cb6('0x15');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x53815f){return _0x53815f[_0x6cb6('0x14')]===_0x6cb6('0x16');}exports[_0x6cb6('0x17')]=isOutboundQueue;function isQueueCampaignActive(_0x5d6be7){return _0x5d6be7['dialActive'];}exports[_0x6cb6('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x490081){return _0x490081[_0x6cb6('0x19')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x125b1d,_0x3004a5){var _0x24ea59=moment(_0x125b1d)[_0x6cb6('0x1a')](0x0);var _0x2090a1=moment(_0x3004a5)[_0x6cb6('0x1a')](0x0);return _0x24ea59[_0x6cb6('0x1b')](_0x2090a1,'seconds');}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x3491a7,_0x3a1e07){var _0x4cd0cd=![];var _0x5d872a=_0x3491a7[_0x6cb6('0x13')]!==_0x3a1e07[_0x6cb6('0x13')]||_0x3491a7[_0x6cb6('0x1c')]!==_0x3a1e07[_0x6cb6('0x1c')]||_0x3491a7[_0x6cb6('0x1d')]!==_0x3a1e07[_0x6cb6('0x1d')];var _0x350330=_0x3491a7[_0x6cb6('0x1e')]!==_0x3a1e07['available']||_0x3491a7[_0x6cb6('0x1f')]!==_0x3a1e07[_0x6cb6('0x1f')]||_0x3491a7[_0x6cb6('0x20')]!==_0x3a1e07[_0x6cb6('0x20')]||_0x3491a7[_0x6cb6('0x21')]!==_0x3a1e07[_0x6cb6('0x21')]||_0x3491a7[_0x6cb6('0x22')]!==_0x3a1e07['talking']||_0x3491a7[_0x6cb6('0x23')]!==_0x3a1e07[_0x6cb6('0x23')]||_0x3491a7[_0x6cb6('0x24')]!==_0x3a1e07[_0x6cb6('0x24')]||_0x3491a7[_0x6cb6('0x25')]!==_0x3a1e07[_0x6cb6('0x25')]||_0x3491a7[_0x6cb6('0x26')]!==_0x3a1e07[_0x6cb6('0x26')];if(_0x3491a7['Trunk']&&_0x3a1e07[_0x6cb6('0x27')]){_0x4cd0cd=_0x3491a7[_0x6cb6('0x27')][_0x6cb6('0x28')]!==_0x3a1e07[_0x6cb6('0x27')]['name']||_0x3491a7[_0x6cb6('0x27')][_0x6cb6('0x19')]!==_0x3a1e07[_0x6cb6('0x27')][_0x6cb6('0x19')];}return _0x5d872a||_0x350330||_0x4cd0cd;}exports[_0x6cb6('0x29')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x2194a8){var _0x6f3345=null;var _0x4a9658=_0x2194a8[_0x6cb6('0x2a')];if(_[_0x6cb6('0x2b')](_0x2194a8[_0x6cb6('0x2c')])||_[_0x6cb6('0x2b')](_0x2194a8['Interval'])||_[_0x6cb6('0x2b')](_0x2194a8['Interval']['Intervals'])){_0x6f3345=CAMPAIGN_STATUS[_0x6cb6('0x2d')];}else if(_['isEmpty'](_0x2194a8[_0x6cb6('0x2c')])||_['isEmpty'](_0x2194a8['Interval']['Intervals'])){_0x6f3345=CAMPAIGN_STATUS[_0x6cb6('0x2e')];}else if(_0x4a9658&&!timezones[_0x4a9658]){_0x6f3345=CAMPAIGN_STATUS[_0x6cb6('0x2f')];}return _0x6f3345;}function checkAnyValidTrunk(_0x183457,_0x1c6f05){var _0x4be775=null;var _0x41b7d7=_0x6cb6('0x30');var _0x2eba05=[_0x6cb6('0x31'),_0x6cb6('0x32')];var _0x2d7eae=!![];if(_0x183457['Trunk']&&_0x183457[_0x6cb6('0x27')][_0x6cb6('0x19')]){_0x41b7d7+=_0x183457['Trunk'][_0x6cb6('0x28')];_0x4be775=_0x1c6f05[_0x41b7d7];_0x2d7eae=_0x2eba05[_0x6cb6('0x33')](_0x4be775['status']);}else if(_0x183457['TrunkBackup']&&_0x183457[_0x6cb6('0x34')][_0x6cb6('0x19')]){_0x41b7d7+=_0x183457['TrunkBackup'][_0x6cb6('0x28')];_0x4be775=_0x1c6f05[_0x41b7d7];_0x2d7eae=_0x2eba05[_0x6cb6('0x33')](_0x4be775[_0x6cb6('0x35')]);}return _0x2d7eae;}function getQueueCampaignStatusMessage(_0xaa5a00,_0x4c3254){var _0x2abbb7=CAMPAIGN_STATUS['ACTIVE'];var _0x42c23b=isPreviewCampaign(_0xaa5a00);if(!isQueueCampaignActive(_0xaa5a00)){if(_0x42c23b){_0x2abbb7=CAMPAIGN_STATUS[_0x6cb6('0x36')];}else{if(_0xaa5a00[_0x6cb6('0x26')]===0x0&&_0xaa5a00['talking']===0x0&&_0xaa5a00['waiting']===0x0&&(_0xaa5a00['pTalking']||0x0)===0x0){_0x2abbb7=CAMPAIGN_STATUS['INACTIVE'];}else{_0x2abbb7=CAMPAIGN_STATUS[_0x6cb6('0x37')];}}}else if(_0xaa5a00['loggedIn']===0x0){_0x2abbb7=CAMPAIGN_STATUS[_0x6cb6('0x38')];}else if(!checkAnyValidTrunk(_0xaa5a00,_0x4c3254)){_0x2abbb7=CAMPAIGN_STATUS[_0x6cb6('0x39')];}else if(!isPreviewCampaign(_0xaa5a00)){var _0x4d6063=checkAnyValidQueueCampaignInterval(_0xaa5a00);if(_0x4d6063){_0x2abbb7=_0x4d6063;}}return _0x2abbb7;}exports[_0x6cb6('0x3a')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x4a7100){var _0x5a4a08=CAMPAIGN_STATUS[_0x6cb6('0x37')];if(_0x4a7100[_0x6cb6('0x26')]===0x0&&_0x4a7100[_0x6cb6('0x22')]===0x0&&_0x4a7100[_0x6cb6('0x24')]===0x0&&(_0x4a7100['pTalking']||0x0)===0x0){_0x5a4a08=CAMPAIGN_STATUS[_0x6cb6('0x36')];}return _0x5a4a08;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x2afe5e){var _0x340aaf=_0x2afe5e[_0x6cb6('0x3b')](/"(.*?)"/);return _0x340aaf?_0x340aaf[0x1]:_0x2afe5e;}exports[_0x6cb6('0x3c')]=extractCalleridName;function getCallerId(_0xe264c,_0x4853d7,_0x35519b){if(!_[_0x6cb6('0x3d')](_0x35519b)&&typeof _0x35519b==='string'&&!_[_0x6cb6('0x3e')](_0x35519b)){if(!_['isUndefined'](_0x4853d7)&&typeof _0x4853d7===_0x6cb6('0x3f')&&!_['isEmpty'](_0x4853d7)){return util['format'](_0x6cb6('0x40'),_0x4853d7,_0x35519b);}return util[_0x6cb6('0x41')]('\x22%s\x22\x20<%s>',_0x35519b,_0x35519b);}if(!_[_0x6cb6('0x3d')](_0xe264c)&&typeof _0xe264c===_0x6cb6('0x3f')&&!_[_0x6cb6('0x3e')](_0xe264c)){return _0xe264c;}return _0x6cb6('0x42');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x182d2f,_0x2eea15){var _0x91d8ab;var _0x1f6994;var _0x2a6302;if(_0x2eea15<=0x0){_0x2eea15=0x1;}_0x91d8ab=new RegExp(_0x6cb6('0x43')+_0x2eea15+'}$');_0x1f6994=Math[_0x6cb6('0x44')](0xa,_0x2eea15-0x1);_0x2a6302=Math[_0x6cb6('0x44')](0xa,_0x2eea15)-0x1;return util[_0x6cb6('0x41')]('%s',_['replace'](_0x182d2f,_0x91d8ab,_[_0x6cb6('0x45')](_0x1f6994,_0x2a6302)[_0x6cb6('0x46')]()));}exports[_0x6cb6('0x47')]=getCallerIdRandom;function decrementOriginate(_0x7ffbc6){if(_0x7ffbc6[_0x6cb6('0x26')]&&_0x7ffbc6[_0x6cb6('0x26')]>0x0){_0x7ffbc6[_0x6cb6('0x26')]-=0x1;}else{logger['error'](_0x6cb6('0x48'));}}exports[_0x6cb6('0x49')]=decrementOriginate;function checkContactEmpty(_0x1d1c7d){return _0x1d1c7d&&_0x1d1c7d[_0x6cb6('0x4a')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x5234cc,_0x570d30){if(_0x570d30===0x0){return 0x0;}var _0x4c1bd5=0x1;for(var _0x55fafb=0x1;_0x55fafb<=_0x570d30;_0x55fafb+=0x1){_0x4c1bd5=0x1+_0x4c1bd5*_0x55fafb/_0x5234cc;}return 0x1/_0x4c1bd5;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x3cca02,_0x10ab3b,_0x3383c4){if(_0x10ab3b>_0x3383c4){for(var _0x5f7af6=0x0;_0x5f7af6<_0x10ab3b-_0x3383c4;_0x5f7af6+=0x1){decrementOriginate(_0x3cca02);}}}exports[_0x6cb6('0x4b')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x8f3a06){var _0x45d66c={};var _0x529371=['id','createdAt',_0x6cb6('0x4c'),_0x6cb6('0x4d'),_0x6cb6('0x4e')];if(_0x8f3a06){for(var _0x2df266 in _0x8f3a06){if(typeof _0x8f3a06[_0x2df266]!=='undefined'){if(!_[_0x6cb6('0x2b')](_0x8f3a06[_0x2df266])&&!_0x529371[_0x6cb6('0x33')](_0x2df266)){_0x45d66c[util['format'](_0x6cb6('0x4f'),_0x6cb6('0x50'),_0x2df266[_0x6cb6('0x51')]())]=_0x8f3a06[_0x2df266];}}}}return _0x45d66c;}exports[_0x6cb6('0x52')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index ee2602b..ef592ef 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(_0x5072b6,_0x300d57){var _0x213867=function(_0x10d118){while(--_0x10d118){_0x5072b6['push'](_0x5072b6['shift']());}};_0x213867(++_0x300d57);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0x5a9543,_0x1544d6){var _0x374bd5=function(_0x90291c){while(--_0x90291c){_0x5a9543['push'](_0x5a9543['shift']());}};_0x374bd5(++_0x1544d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 d790525..5bc4657 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 _0x904d=['Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','.pdf','isNil','active','SIP/%s','status','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','moment','path','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','channelstate','channelstatedesc','operation','filename','remotestationid','resolution','transferrate','calleridnum','pagestransferred','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','application/pdf','then','notify','catch','\x20notify\x20','error','\x20receiveFax\x20','stringify','merge','pick','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','dir','XMF-PATH'];(function(_0x27ccfa,_0x4885d1){var _0x2f4f2=function(_0x2463ff){while(--_0x2463ff){_0x27ccfa['push'](_0x27ccfa['shift']());}};_0x2f4f2(++_0x4885d1);}(_0x904d,0x93));var _0xd904=function(_0x4e3bd3,_0x4f9cc4){_0x4e3bd3=_0x4e3bd3-0x0;var _0x1fb687=_0x904d[_0x4e3bd3];return _0x1fb687;};'use strict';var util=require(_0xd904('0x0'));var _=require(_0xd904('0x1'));var BPromise=require(_0xd904('0x2'));var uuid=require('uuid');var moment=require(_0xd904('0x3'));var path=require(_0xd904('0x4'));var tiff2pdf=require(_0xd904('0x5'));var gs=require(_0xd904('0x6'));var logger=require('../../../config/logger')(_0xd904('0x7'));var ami=require(_0xd904('0x8'));var rpcDb=require(_0xd904('0x9'));var Channel=require(_0xd904('0xa'));var ut=require(_0xd904('0xb'));var Action=require(_0xd904('0xc'));var faxAccount=require(_0xd904('0xd'));var attachment=require('../rpc/attachment');var faxMessage=require(_0xd904('0xe'));function Fax(_0x5c53d){this['channels']={};this['faxAccounts']=_0x5c53d[_0xd904('0xf')];this['trunks']=_0x5c53d[_0xd904('0x10')];this[_0xd904('0x11')]={};ami['on'](_0xd904('0x12'),this[_0xd904('0x13')][_0xd904('0x14')](this));ami['on'](_0xd904('0x15'),this['syncVarSet'][_0xd904('0x14')](this));ami['on'](_0xd904('0x16'),this[_0xd904('0x17')][_0xd904('0x14')](this));ami['on'](_0xd904('0x18'),this[_0xd904('0x19')][_0xd904('0x14')](this));ami['on'](_0xd904('0x1a'),this[_0xd904('0x1b')][_0xd904('0x14')](this));ami['on'](_0xd904('0x1c'),this[_0xd904('0x1d')][_0xd904('0x14')](this));ami['on'](_0xd904('0x1e'),this[_0xd904('0x1f')][_0xd904('0x14')](this));ami['on'](_0xd904('0x20'),this[_0xd904('0x21')][_0xd904('0x14')](this));}Fax[_0xd904('0x22')][_0xd904('0x13')]=function(_0x37bdff){if(_0x37bdff[_0xd904('0x23')]===_0xd904('0x24')){for(var _0x2ec9db in this['faxAccounts']){if(this[_0xd904('0xf')][_0xd904('0x25')](_0x2ec9db)){if(_0x37bdff[_0xd904('0x26')]===this['faxAccounts'][_0x2ec9db][_0xd904('0x27')]){this[_0xd904('0x28')][_0x37bdff[_0xd904('0x29')]]={};this['channels'][_0x37bdff[_0xd904('0x29')]]['channel']=_0x37bdff[_0xd904('0x2a')];this[_0xd904('0x28')][_0x37bdff[_0xd904('0x29')]]['id']=this[_0xd904('0xf')][_0x2ec9db]['id'];this[_0xd904('0x28')][_0x37bdff[_0xd904('0x29')]][_0xd904('0x2b')]=this['faxAccounts'][_0x2ec9db][_0xd904('0x2b')];logger['info'](_0x37bdff['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0xd904('0x11')][_0x37bdff[_0xd904('0x29')]]){this['channels'][_0x37bdff[_0xd904('0x29')]]={};this['channels'][_0x37bdff[_0xd904('0x29')]][_0xd904('0x2a')]=_0x37bdff[_0xd904('0x2a')];logger[_0xd904('0x2c')](_0x37bdff['uniqueid'],_0xd904('0x2d'));}};Fax[_0xd904('0x22')][_0xd904('0x2e')]=function(_0x485c21){if(this[_0xd904('0x28')][_0x485c21[_0xd904('0x29')]]){for(var _0x4b6579 in _0x485c21[_0xd904('0x2f')]){if(_0x485c21[_0xd904('0x2f')]['hasOwnProperty'](_0x4b6579)){this['channels'][_0x485c21['uniqueid']][_0x4b6579]=_0x485c21[_0xd904('0x30')];}}}};Fax[_0xd904('0x22')]['syncNewState']=function(_0x17d6d7){if(this['channels'][_0x17d6d7['uniqueid']]){this[_0xd904('0x28')][_0x17d6d7[_0xd904('0x29')]]['channelstate']=_0x17d6d7[_0xd904('0x31')];this[_0xd904('0x28')][_0x17d6d7[_0xd904('0x29')]][_0xd904('0x32')]=_0x17d6d7[_0xd904('0x32')];}};Fax['prototype']['syncNewExten']=function(_0x254e4a){if(this[_0xd904('0x28')][_0x254e4a['uniqueid']]){for(var _0x313a1b in _0x254e4a[_0xd904('0x2f')]){if(_0x254e4a[_0xd904('0x2f')][_0xd904('0x25')](_0x313a1b)){this[_0xd904('0x28')][_0x254e4a[_0xd904('0x29')]][_0x313a1b]=_0x254e4a[_0xd904('0x30')];}}}};Fax[_0xd904('0x22')][_0xd904('0x1b')]=function(_0x775343){if(this[_0xd904('0x28')][_0x775343['uniqueid']]){this[_0xd904('0x28')][_0x775343[_0xd904('0x29')]][_0xd904('0x33')]=_0x775343[_0xd904('0x33')];this[_0xd904('0x28')][_0x775343[_0xd904('0x29')]]['status']=_0x775343['status'];this['channels'][_0x775343['uniqueid']][_0xd904('0x27')]=_0x775343[_0xd904('0x27')];this['channels'][_0x775343[_0xd904('0x29')]][_0xd904('0x34')]=_0x775343[_0xd904('0x34')];logger[_0xd904('0x2c')](_0x775343[_0xd904('0x29')],'\x20syncFaxStatus\x20');}};Fax['prototype']['syncReceiveFax']=function(_0x3ada38){var _0x507f8a=this;if(this[_0xd904('0x28')][_0x3ada38[_0xd904('0x29')]]){var _0x22b43e=this['channels'][_0x3ada38[_0xd904('0x29')]]['id'];this[_0xd904('0x28')][_0x3ada38[_0xd904('0x29')]]['remotestationid']=_0x3ada38[_0xd904('0x35')];this[_0xd904('0x28')][_0x3ada38[_0xd904('0x29')]]['pagestransferred']=_0x3ada38['pagestransferred'];this[_0xd904('0x28')][_0x3ada38[_0xd904('0x29')]][_0xd904('0x27')]=_0x3ada38[_0xd904('0x27')];this['channels'][_0x3ada38['uniqueid']]['resolution']=_0x3ada38[_0xd904('0x36')];this[_0xd904('0x28')][_0x3ada38[_0xd904('0x29')]]['transferrate']=_0x3ada38[_0xd904('0x37')];this[_0xd904('0x28')][_0x3ada38['uniqueid']][_0xd904('0x34')]=_0x3ada38['filename'];this[_0xd904('0x28')][_0x3ada38[_0xd904('0x29')]][_0xd904('0x38')]=_0x3ada38[_0xd904('0x38')];if(this[_0xd904('0x28')][_0x3ada38['uniqueid']][_0xd904('0x39')]>0x0){tiff2pdf(_0x3ada38[_0xd904('0x34')],_0xd904('0x3a'),function(_0x5cd640){logger[_0xd904('0x2c')](_0x3ada38[_0xd904('0x29')],_0xd904('0x3b'),_0x5cd640[_0xd904('0x3c')]);attachment['create']({'name':path[_0xd904('0x3d')](_0x3ada38[_0xd904('0x34')])[_0xd904('0x2b')],'basename':path[_0xd904('0x3d')](_0x3ada38[_0xd904('0x34')])[_0xd904('0x2b')]+'.pdf','type':_0xd904('0x3e')})[_0xd904('0x3f')](function(_0x3bff1d){faxAccount[_0xd904('0x40')](_0x22b43e,{'from':_0x3ada38[_0xd904('0x38')],'mapKey':_0xd904('0x7'),'body':path[_0xd904('0x3d')](_0x3ada38[_0xd904('0x34')])['name']+'.pdf','AttachmentId':_0x3bff1d['id']})[_0xd904('0x41')](function(_0x42d20b){logger['error'](_0x3ada38[_0xd904('0x29')],_0xd904('0x42'),JSON['stringify'](_0x42d20b));});})[_0xd904('0x41')](function(_0x5d00e3){logger[_0xd904('0x43')](_0x3ada38[_0xd904('0x29')],_0xd904('0x44'),JSON[_0xd904('0x45')](_0x5d00e3));});});}logger['info'](_0x3ada38['uniqueid'],_0xd904('0x44'));}};Fax[_0xd904('0x22')][_0xd904('0x21')]=function(_0x59275c){if(this['actions'][_0x59275c[_0xd904('0x29')]]){_[_0xd904('0x46')](this['channels'][_0x59275c['uniqueid']],_[_0xd904('0x47')](_0x59275c,[_0xd904('0x48'),_0xd904('0x49')]));}};function updateStatus(_0x752839){if(_0x752839['AttachmentId']){faxMessage[_0xd904('0x4a')](_0x752839[_0xd904('0x4b')],{'failMessage':_0xd904('0x4c')})[_0xd904('0x3f')](function(_0x3450be){ut['logger'](_0xd904('0x4d'),_0x3450be);})[_0xd904('0x41')](function(_0x1a4b3e){ut[_0xd904('0x4e')](_0xd904('0x4f'),_0x1a4b3e);});}else{ut[_0xd904('0x4e')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xd904('0x22')]['updateStatus']=function(_0xd7dab3,_0xec2bb9,_0x2133b3){var _0x2f58c4=this;var _0x497866={};if(_0xec2bb9){_0x497866={'read':_0xec2bb9};}else{_0x497866={'failMessage':_0x2133b3};}if(this[_0xd904('0x11')][_0xd7dab3][_0xd904('0x4b')]){faxMessage[_0xd904('0x4a')](this[_0xd904('0x11')][_0xd7dab3][_0xd904('0x4b')],_0x497866)['then'](function(_0xd5adb3){ut['logger'](_0xd904('0x50'),_0xd5adb3);})['catch'](function(_0x5b7b6f){ut[_0xd904('0x4e')](_0xd904('0x51'),_0x5b7b6f);})[_0xd904('0x52')](function(){delete _0x2f58c4['channels'][_0xd7dab3];delete _0x2f58c4[_0xd904('0x11')][_0xd7dab3];});}else{ut[_0xd904('0x4e')](_0xd904('0x53'));delete this[_0xd904('0x28')][_0xd7dab3];delete this[_0xd904('0x11')][_0xd7dab3];}};Fax[_0xd904('0x22')][_0xd904('0x1f')]=function(_0x5ad4c4){var _0x3a806e=this;if(this[_0xd904('0x28')][_0x5ad4c4[_0xd904('0x29')]]){if(this[_0xd904('0x11')][_0x5ad4c4[_0xd904('0x29')]]){this[_0xd904('0x28')][_0x5ad4c4[_0xd904('0x29')]]['id']=this[_0xd904('0x11')][_0x5ad4c4['uniqueid']]['id'];this[_0xd904('0x28')][_0x5ad4c4[_0xd904('0x29')]][_0xd904('0x2b')]=this[_0xd904('0x11')][_0x5ad4c4[_0xd904('0x29')]][_0xd904('0x2b')];}logger[_0xd904('0x2c')](_0x5ad4c4[_0xd904('0x29')],this['actions'][_0x5ad4c4[_0xd904('0x29')]]?'\x20hangup\x20sendFile\x20':_0xd904('0x54'),JSON[_0xd904('0x45')](this[_0xd904('0x28')][_0x5ad4c4[_0xd904('0x29')]]));if(this[_0xd904('0x11')][_0x5ad4c4[_0xd904('0x29')]]){if(this[_0xd904('0x28')][_0x5ad4c4[_0xd904('0x29')]][_0xd904('0x55')]>0x0&&this[_0xd904('0x28')][_0x5ad4c4[_0xd904('0x29')]]['faxstatus']==='SUCCESS'){this['updateStatus'](_0x5ad4c4[_0xd904('0x29')],!![]);}else{this[_0xd904('0x56')](_0x5ad4c4[_0xd904('0x29')],![],this[_0xd904('0x28')][_0x5ad4c4[_0xd904('0x29')]][_0xd904('0x57')]?_0xd904('0x58')+this[_0xd904('0x28')][_0x5ad4c4[_0xd904('0x29')]][_0xd904('0x57')]:_0xd904('0x59'));}}}};Fax[_0xd904('0x22')][_0xd904('0x5a')]=function(_0x3109e2){var _0x109225=this;return new BPromise(function(_0x24ac73,_0x34acfc){_0x109225[_0xd904('0x5b')](_0x3109e2,_0x109225[_0xd904('0xf')][_0x3109e2[_0xd904('0x5c')]])[_0xd904('0x3f')](function(_0x459d4d){ut[_0xd904('0x4e')]('[Fax][execOriginate][success]',_0x459d4d);_0x24ac73(ut['message'](_0xd904('0x5d')));})[_0xd904('0x41')](function(_0x29eed2){ut[_0xd904('0x4e')](_0xd904('0x5e'),_0x29eed2);updateStatus(_0x3109e2);_0x34acfc(ut['message'](_0xd904('0x5f')));});});};Fax[_0xd904('0x22')][_0xd904('0x60')]=function(_0x4d9b7a){var _0x67c4f3=this;return new BPromise(function(_0x9502f0,_0xc43197){var _0x205592=_0x67c4f3[_0xd904('0x61')](_0x67c4f3[_0xd904('0xf')][_0x4d9b7a[_0xd904('0x5c')]][_0xd904('0x62')],_0x4d9b7a);if(_0x205592['isValid']){_0x9502f0(ut[_0xd904('0x3c')](_0xd904('0x63')));}else{_0xc43197(ut[_0xd904('0x3c')](_0x205592['message']));}});};function originate(_0x575060,_0x1a7563,_0x3d794e){return new BPromise(function(_0x524c18,_0x376306){if(_0x3d794e){var _0x54059f=util[_0xd904('0x64')](_0xd904('0x65'),path['parse'](_0x575060[_0xd904('0x4')])['name'],_0x575060[_0xd904('0x4')]);gs['execute'](_0x54059f)['then'](function(){_0x575060[_0xd904('0x4')]=util[_0xd904('0x64')](_0xd904('0x66'),path[_0xd904('0x3d')](_0x575060[_0xd904('0x4')])[_0xd904('0x67')],path[_0xd904('0x3d')](_0x575060[_0xd904('0x4')])['name']);_0x1a7563[_0xd904('0x68')]=_0x575060[_0xd904('0x4')];ut[_0xd904('0x4e')](_0xd904('0x69'),'');ami['Action'](ut[_0xd904('0x6a')](_0x575060,_0x1a7563))[_0xd904('0x3f')](function(_0x2c3fa8){_0x524c18(_0x2c3fa8);})['catch'](function(_0x2a34d3){_0x376306(_0x2a34d3);});})[_0xd904('0x41')](function(_0x5ec74e){_0x376306(_0x5ec74e);});}else{ami[_0xd904('0x6b')](ut['variablesAction'](_0x575060,_0x1a7563))[_0xd904('0x3f')](function(_0x5d5a53){_0x524c18(_0x5d5a53);})[_0xd904('0x41')](function(_0x2fb7e3){_0x376306(_0x2fb7e3);});}});}Fax[_0xd904('0x22')][_0xd904('0x5b')]=function(_0x44cd00,_0x42d91c){var _0x3d1e2a=this;return new BPromise(function(_0x1e52ba,_0x506441){var _0x318db2=uuid['v4']();var _0x1032e3=ut[_0xd904('0x6c')](_0x44cd00,_0x42d91c);_0x3d1e2a[_0xd904('0x11')][_0x318db2]=new Action(_0x318db2,_0x42d91c,_0x44cd00);var _0x40c2cd=_0x3d1e2a[_0xd904('0x11')][_0x318db2];if(path[_0xd904('0x3d')](_0x44cd00['path'])[_0xd904('0x6d')]===_0xd904('0x6e')){originate(_0x40c2cd,_0x1032e3,!![])['then'](function(_0x1cee55){_0x1e52ba(_0x1cee55);})[_0xd904('0x41')](function(_0x54771f){_0x506441(_0x54771f);});}else{originate(_0x40c2cd,_0x1032e3,![])['then'](function(_0x2a1a1b){_0x1e52ba(_0x2a1a1b);})['catch'](function(_0x131a28){_0x506441(_0x131a28);});}});};Fax['prototype']['isTrunkReachable']=function(_0x337467){return!_['isNil'](_0x337467)&&!_[_0xd904('0x6f')](_0x337467[_0xd904('0x2b')])&&!_[_0xd904('0x6f')](_0x337467[_0xd904('0x70')])&&_0x337467[_0xd904('0x70')]&&!_[_0xd904('0x6f')](this[_0xd904('0x10')][util[_0xd904('0x64')](_0xd904('0x71'),_0x337467['name'])])&&!_[_0xd904('0x6f')](this[_0xd904('0x10')][util[_0xd904('0x64')](_0xd904('0x71'),_0x337467[_0xd904('0x2b')])][_0xd904('0x72')])&&(this[_0xd904('0x10')][util[_0xd904('0x64')](_0xd904('0x71'),_0x337467[_0xd904('0x2b')])]['status']===_0xd904('0x73')||this[_0xd904('0x10')][util[_0xd904('0x64')](_0xd904('0x71'),_0x337467[_0xd904('0x2b')])]['status']===_0xd904('0x74'));};Fax[_0xd904('0x22')][_0xd904('0x61')]=function(_0x1b2362,_0x197688){if(!this['isTrunkReachable'](_0x1b2362)){ut[_0xd904('0x4e')](_0xd904('0x75'),_[_0xd904('0x6f')](_0x1b2362)?'':_0x1b2362[_0xd904('0x2b')]+_0xd904('0x76'));return{'isValid':![],'message':_0xd904('0x77')};}if(_[_0xd904('0x6f')](_0x197688['fax'])){ut[_0xd904('0x4e')](_0xd904('0x78'),JSON[_0xd904('0x45')](_0x197688));return{'isValid':![],'message':_0xd904('0x79')};}if(_[_0xd904('0x6f')](_0x197688['path'])){ut[_0xd904('0x4e')](_0xd904('0x7a'),JSON[_0xd904('0x45')](_0x197688));return{'isValid':![],'message':_0xd904('0x7b')};}return{'isValid':!![],'message':_0xd904('0x7c')};};module[_0xd904('0x7d')]=Fax; \ No newline at end of file +var _0xef9d=['SENDING\x20FAILED','send','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','execOriginate','ext','isNil','active','SIP/%s','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./action','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','faxstatus','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','value','channelstate','channelstatedesc','variable','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','\x20notify\x20','stringify','\x20receiveFax\x20','pick','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20'];(function(_0x1194d5,_0x52458e){var _0x15284a=function(_0x2e030c){while(--_0x2e030c){_0x1194d5['push'](_0x1194d5['shift']());}};_0x15284a(++_0x52458e);}(_0xef9d,0x104));var _0xdef9=function(_0x2a1861,_0x4a8e97){_0x2a1861=_0x2a1861-0x0;var _0x5eaea1=_0xef9d[_0x2a1861];return _0x5eaea1;};'use strict';var util=require(_0xdef9('0x0'));var _=require(_0xdef9('0x1'));var BPromise=require(_0xdef9('0x2'));var uuid=require(_0xdef9('0x3'));var moment=require(_0xdef9('0x4'));var path=require(_0xdef9('0x5'));var tiff2pdf=require(_0xdef9('0x6'));var gs=require(_0xdef9('0x7'));var logger=require(_0xdef9('0x8'))(_0xdef9('0x9'));var ami=require(_0xdef9('0xa'));var rpcDb=require(_0xdef9('0xb'));var Channel=require(_0xdef9('0xc'));var ut=require('./util/util');var Action=require(_0xdef9('0xd'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xdef9('0xe'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x31ec27){this[_0xdef9('0xf')]={};this[_0xdef9('0x10')]=_0x31ec27['faxAccounts'];this[_0xdef9('0x11')]=_0x31ec27['trunks'];this[_0xdef9('0x12')]={};ami['on'](_0xdef9('0x13'),this[_0xdef9('0x14')][_0xdef9('0x15')](this));ami['on'](_0xdef9('0x16'),this[_0xdef9('0x17')][_0xdef9('0x15')](this));ami['on'](_0xdef9('0x18'),this[_0xdef9('0x19')][_0xdef9('0x15')](this));ami['on'](_0xdef9('0x1a'),this['syncNewExten'][_0xdef9('0x15')](this));ami['on'](_0xdef9('0x1b'),this['syncFaxStatus'][_0xdef9('0x15')](this));ami['on']('receivefax',this[_0xdef9('0x1c')][_0xdef9('0x15')](this));ami['on'](_0xdef9('0x1d'),this['syncHangup'][_0xdef9('0x15')](this));ami['on'](_0xdef9('0x1e'),this[_0xdef9('0x1f')][_0xdef9('0x15')](this));}Fax[_0xdef9('0x20')][_0xdef9('0x14')]=function(_0x384e73){if(_0x384e73[_0xdef9('0x21')]===_0xdef9('0x22')){for(var _0xb8aad9 in this[_0xdef9('0x10')]){if(this[_0xdef9('0x10')][_0xdef9('0x23')](_0xb8aad9)){if(_0x384e73[_0xdef9('0x24')]===this[_0xdef9('0x10')][_0xb8aad9][_0xdef9('0x25')]){this[_0xdef9('0xf')][_0x384e73[_0xdef9('0x26')]]={};this[_0xdef9('0xf')][_0x384e73[_0xdef9('0x26')]]['channel']=_0x384e73[_0xdef9('0x27')];this['channels'][_0x384e73[_0xdef9('0x26')]]['id']=this[_0xdef9('0x10')][_0xb8aad9]['id'];this[_0xdef9('0xf')][_0x384e73[_0xdef9('0x26')]][_0xdef9('0x28')]=this[_0xdef9('0x10')][_0xb8aad9][_0xdef9('0x28')];logger[_0xdef9('0x29')](_0x384e73['uniqueid'],_0xdef9('0x2a'));}}}}if(this[_0xdef9('0x12')][_0x384e73['uniqueid']]){this[_0xdef9('0xf')][_0x384e73[_0xdef9('0x26')]]={};this[_0xdef9('0xf')][_0x384e73['uniqueid']][_0xdef9('0x27')]=_0x384e73[_0xdef9('0x27')];logger[_0xdef9('0x29')](_0x384e73[_0xdef9('0x26')],_0xdef9('0x2a'));}};Fax[_0xdef9('0x20')][_0xdef9('0x17')]=function(_0xd561e6){if(this[_0xdef9('0xf')][_0xd561e6[_0xdef9('0x26')]]){for(var _0xe9a330 in _0xd561e6['variable']){if(_0xd561e6['variable'][_0xdef9('0x23')](_0xe9a330)){this[_0xdef9('0xf')][_0xd561e6[_0xdef9('0x26')]][_0xe9a330]=_0xd561e6[_0xdef9('0x2b')];}}}};Fax[_0xdef9('0x20')][_0xdef9('0x19')]=function(_0x10557f){if(this[_0xdef9('0xf')][_0x10557f[_0xdef9('0x26')]]){this['channels'][_0x10557f['uniqueid']]['channelstate']=_0x10557f[_0xdef9('0x2c')];this['channels'][_0x10557f[_0xdef9('0x26')]][_0xdef9('0x2d')]=_0x10557f[_0xdef9('0x2d')];}};Fax[_0xdef9('0x20')]['syncNewExten']=function(_0xc3e416){if(this['channels'][_0xc3e416['uniqueid']]){for(var _0xff74f1 in _0xc3e416[_0xdef9('0x2e')]){if(_0xc3e416[_0xdef9('0x2e')][_0xdef9('0x23')](_0xff74f1)){this['channels'][_0xc3e416['uniqueid']][_0xff74f1]=_0xc3e416[_0xdef9('0x2b')];}}}};Fax[_0xdef9('0x20')][_0xdef9('0x2f')]=function(_0x41b1a6){if(this['channels'][_0x41b1a6['uniqueid']]){this['channels'][_0x41b1a6[_0xdef9('0x26')]]['operation']=_0x41b1a6[_0xdef9('0x30')];this[_0xdef9('0xf')][_0x41b1a6[_0xdef9('0x26')]][_0xdef9('0x31')]=_0x41b1a6[_0xdef9('0x31')];this[_0xdef9('0xf')][_0x41b1a6['uniqueid']][_0xdef9('0x25')]=_0x41b1a6[_0xdef9('0x25')];this[_0xdef9('0xf')][_0x41b1a6[_0xdef9('0x26')]]['filename']=_0x41b1a6[_0xdef9('0x32')];logger[_0xdef9('0x29')](_0x41b1a6[_0xdef9('0x26')],_0xdef9('0x33'));}};Fax['prototype'][_0xdef9('0x1c')]=function(_0x18a4fc){var _0xea0015=this;if(this[_0xdef9('0xf')][_0x18a4fc[_0xdef9('0x26')]]){var _0x398ca1=this[_0xdef9('0xf')][_0x18a4fc[_0xdef9('0x26')]]['id'];this['channels'][_0x18a4fc[_0xdef9('0x26')]][_0xdef9('0x34')]=_0x18a4fc['remotestationid'];this[_0xdef9('0xf')][_0x18a4fc[_0xdef9('0x26')]][_0xdef9('0x35')]=_0x18a4fc[_0xdef9('0x35')];this['channels'][_0x18a4fc[_0xdef9('0x26')]][_0xdef9('0x25')]=_0x18a4fc[_0xdef9('0x25')];this[_0xdef9('0xf')][_0x18a4fc[_0xdef9('0x26')]]['resolution']=_0x18a4fc[_0xdef9('0x36')];this[_0xdef9('0xf')][_0x18a4fc[_0xdef9('0x26')]][_0xdef9('0x37')]=_0x18a4fc[_0xdef9('0x37')];this[_0xdef9('0xf')][_0x18a4fc[_0xdef9('0x26')]][_0xdef9('0x32')]=_0x18a4fc['filename'];this['channels'][_0x18a4fc[_0xdef9('0x26')]][_0xdef9('0x38')]=_0x18a4fc['calleridnum'];if(this[_0xdef9('0xf')][_0x18a4fc['uniqueid']][_0xdef9('0x35')]>0x0){tiff2pdf(_0x18a4fc['filename'],_0xdef9('0x39'),function(_0x117987){logger[_0xdef9('0x29')](_0x18a4fc['uniqueid'],_0xdef9('0x3a'),_0x117987[_0xdef9('0x3b')]);attachment[_0xdef9('0x3c')]({'name':path[_0xdef9('0x3d')](_0x18a4fc[_0xdef9('0x32')])['name'],'basename':path[_0xdef9('0x3d')](_0x18a4fc[_0xdef9('0x32')])[_0xdef9('0x28')]+_0xdef9('0x3e'),'type':_0xdef9('0x3f')})[_0xdef9('0x40')](function(_0x4e3461){faxAccount[_0xdef9('0x41')](_0x398ca1,{'from':_0x18a4fc['calleridnum'],'mapKey':_0xdef9('0x9'),'body':path[_0xdef9('0x3d')](_0x18a4fc[_0xdef9('0x32')])['name']+'.pdf','AttachmentId':_0x4e3461['id']})[_0xdef9('0x42')](function(_0x13e517){logger['error'](_0x18a4fc[_0xdef9('0x26')],_0xdef9('0x43'),JSON[_0xdef9('0x44')](_0x13e517));});})[_0xdef9('0x42')](function(_0x1732d8){logger['error'](_0x18a4fc[_0xdef9('0x26')],_0xdef9('0x45'),JSON[_0xdef9('0x44')](_0x1732d8));});});}logger[_0xdef9('0x29')](_0x18a4fc[_0xdef9('0x26')],_0xdef9('0x45'));}};Fax[_0xdef9('0x20')][_0xdef9('0x1f')]=function(_0x1ff4ea){if(this[_0xdef9('0x12')][_0x1ff4ea['uniqueid']]){_['merge'](this[_0xdef9('0xf')][_0x1ff4ea[_0xdef9('0x26')]],_[_0xdef9('0x46')](_0x1ff4ea,[_0xdef9('0x47'),_0xdef9('0x48')]));}};function updateStatus(_0x20daa2){if(_0x20daa2['AttachmentId']){faxMessage[_0xdef9('0x49')](_0x20daa2[_0xdef9('0x4a')],{'failMessage':_0xdef9('0x4b')})[_0xdef9('0x40')](function(_0x4c03d5){ut[_0xdef9('0x4c')](_0xdef9('0x4d'),_0x4c03d5);})['catch'](function(_0x46ad82){ut[_0xdef9('0x4c')]('[Fax][Message][Error][NoUpdate1]',_0x46ad82);});}else{ut[_0xdef9('0x4c')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xdef9('0x20')][_0xdef9('0x4e')]=function(_0x5c0b06,_0x38965f,_0x5d23f7){var _0x237ffb=this;var _0x246a36={};if(_0x38965f){_0x246a36={'read':_0x38965f};}else{_0x246a36={'failMessage':_0x5d23f7};}if(this[_0xdef9('0x12')][_0x5c0b06][_0xdef9('0x4a')]){faxMessage[_0xdef9('0x49')](this['actions'][_0x5c0b06][_0xdef9('0x4a')],_0x246a36)['then'](function(_0x2ee73b){ut[_0xdef9('0x4c')](_0xdef9('0x4f'),_0x2ee73b);})[_0xdef9('0x42')](function(_0x294a06){ut['logger'](_0xdef9('0x50'),_0x294a06);})['finally'](function(){delete _0x237ffb['channels'][_0x5c0b06];delete _0x237ffb['actions'][_0x5c0b06];});}else{ut[_0xdef9('0x4c')](_0xdef9('0x51'));delete this[_0xdef9('0xf')][_0x5c0b06];delete this[_0xdef9('0x12')][_0x5c0b06];}};Fax[_0xdef9('0x20')][_0xdef9('0x52')]=function(_0x1eec23){var _0xcbcaa4=this;if(this[_0xdef9('0xf')][_0x1eec23[_0xdef9('0x26')]]){if(this[_0xdef9('0x12')][_0x1eec23[_0xdef9('0x26')]]){this[_0xdef9('0xf')][_0x1eec23[_0xdef9('0x26')]]['id']=this[_0xdef9('0x12')][_0x1eec23['uniqueid']]['id'];this[_0xdef9('0xf')][_0x1eec23[_0xdef9('0x26')]]['name']=this[_0xdef9('0x12')][_0x1eec23['uniqueid']][_0xdef9('0x28')];}logger[_0xdef9('0x29')](_0x1eec23[_0xdef9('0x26')],this[_0xdef9('0x12')][_0x1eec23['uniqueid']]?'\x20hangup\x20sendFile\x20':_0xdef9('0x53'),JSON[_0xdef9('0x44')](this[_0xdef9('0xf')][_0x1eec23[_0xdef9('0x26')]]));if(this[_0xdef9('0x12')][_0x1eec23['uniqueid']]){if(this[_0xdef9('0xf')][_0x1eec23['uniqueid']][_0xdef9('0x54')]>0x0&&this[_0xdef9('0xf')][_0x1eec23['uniqueid']][_0xdef9('0x1b')]===_0xdef9('0x55')){this[_0xdef9('0x4e')](_0x1eec23[_0xdef9('0x26')],!![]);}else{this['updateStatus'](_0x1eec23['uniqueid'],![],this[_0xdef9('0xf')][_0x1eec23['uniqueid']][_0xdef9('0x56')]?_0xdef9('0x57')+this[_0xdef9('0xf')][_0x1eec23['uniqueid']][_0xdef9('0x56')]:_0xdef9('0x58'));}}}};Fax[_0xdef9('0x20')][_0xdef9('0x59')]=function(_0x3667e4){var _0x91f393=this;return new BPromise(function(_0x248975,_0x32bcbb){_0x91f393['execOriginate'](_0x3667e4,_0x91f393['faxAccounts'][_0x3667e4['FaxAccountId']])[_0xdef9('0x40')](function(_0x40923e){ut['logger'](_0xdef9('0x5a'),_0x40923e);_0x248975(ut[_0xdef9('0x3b')](_0xdef9('0x5b')));})[_0xdef9('0x42')](function(_0x2cfe0d){ut['logger'](_0xdef9('0x5c'),_0x2cfe0d);updateStatus(_0x3667e4);_0x32bcbb(ut[_0xdef9('0x3b')](_0xdef9('0x5d')));});});};Fax[_0xdef9('0x20')][_0xdef9('0x5e')]=function(_0x390cd7){var _0x598f60=this;return new BPromise(function(_0xe79606,_0xb65dff){var _0x4e055f=_0x598f60['checkTrunk'](_0x598f60['faxAccounts'][_0x390cd7['FaxAccountId']]['Trunk'],_0x390cd7);if(_0x4e055f['isValid']){_0xe79606(ut[_0xdef9('0x3b')](_0xdef9('0x5f')));}else{_0xb65dff(ut[_0xdef9('0x3b')](_0x4e055f['message']));}});};function originate(_0x147ff7,_0x32a457,_0x441d90){return new BPromise(function(_0x2c2fe2,_0x344a9b){if(_0x441d90){var _0x2d5132=util[_0xdef9('0x60')](_0xdef9('0x61'),path[_0xdef9('0x3d')](_0x147ff7[_0xdef9('0x5')])[_0xdef9('0x28')],_0x147ff7[_0xdef9('0x5')]);gs[_0xdef9('0x62')](_0x2d5132)[_0xdef9('0x40')](function(){_0x147ff7[_0xdef9('0x5')]=util[_0xdef9('0x60')]('%s/%s.tif',path['parse'](_0x147ff7['path'])[_0xdef9('0x63')],path[_0xdef9('0x3d')](_0x147ff7[_0xdef9('0x5')])[_0xdef9('0x28')]);_0x32a457[_0xdef9('0x64')]=_0x147ff7[_0xdef9('0x5')];ut[_0xdef9('0x4c')](_0xdef9('0x65'),'');ami['Action'](ut[_0xdef9('0x66')](_0x147ff7,_0x32a457))[_0xdef9('0x40')](function(_0x5a9af0){_0x2c2fe2(_0x5a9af0);})[_0xdef9('0x42')](function(_0x5ab1e3){_0x344a9b(_0x5ab1e3);});})[_0xdef9('0x42')](function(_0x327cd5){_0x344a9b(_0x327cd5);});}else{ami['Action'](ut[_0xdef9('0x66')](_0x147ff7,_0x32a457))[_0xdef9('0x40')](function(_0xb567f){_0x2c2fe2(_0xb567f);})['catch'](function(_0x59cd5b){_0x344a9b(_0x59cd5b);});}});}Fax[_0xdef9('0x20')][_0xdef9('0x67')]=function(_0x5502c9,_0x4cf478){var _0x2aa2ac=this;return new BPromise(function(_0x1f2038,_0x1bfc8c){var _0x15f6ba=uuid['v4']();var _0x3255cd=ut['addVariables'](_0x5502c9,_0x4cf478);_0x2aa2ac[_0xdef9('0x12')][_0x15f6ba]=new Action(_0x15f6ba,_0x4cf478,_0x5502c9);var _0x5e7a14=_0x2aa2ac[_0xdef9('0x12')][_0x15f6ba];if(path[_0xdef9('0x3d')](_0x5502c9[_0xdef9('0x5')])[_0xdef9('0x68')]===_0xdef9('0x3e')){originate(_0x5e7a14,_0x3255cd,!![])['then'](function(_0x50fbcf){_0x1f2038(_0x50fbcf);})[_0xdef9('0x42')](function(_0xaf3073){_0x1bfc8c(_0xaf3073);});}else{originate(_0x5e7a14,_0x3255cd,![])[_0xdef9('0x40')](function(_0x46b99c){_0x1f2038(_0x46b99c);})[_0xdef9('0x42')](function(_0x114b45){_0x1bfc8c(_0x114b45);});}});};Fax[_0xdef9('0x20')]['isTrunkReachable']=function(_0x4bd3ba){return!_[_0xdef9('0x69')](_0x4bd3ba)&&!_[_0xdef9('0x69')](_0x4bd3ba[_0xdef9('0x28')])&&!_['isNil'](_0x4bd3ba['active'])&&_0x4bd3ba[_0xdef9('0x6a')]&&!_[_0xdef9('0x69')](this[_0xdef9('0x11')][util['format'](_0xdef9('0x6b'),_0x4bd3ba[_0xdef9('0x28')])])&&!_[_0xdef9('0x69')](this[_0xdef9('0x11')][util['format'](_0xdef9('0x6b'),_0x4bd3ba['name'])][_0xdef9('0x31')])&&(this[_0xdef9('0x11')][util[_0xdef9('0x60')](_0xdef9('0x6b'),_0x4bd3ba[_0xdef9('0x28')])][_0xdef9('0x31')]==='reachable'||this[_0xdef9('0x11')][util[_0xdef9('0x60')]('SIP/%s',_0x4bd3ba[_0xdef9('0x28')])][_0xdef9('0x31')]==='unmonitored');};Fax['prototype'][_0xdef9('0x6c')]=function(_0x55598d,_0x26820a){if(!this['isTrunkReachable'](_0x55598d)){ut[_0xdef9('0x4c')](_0xdef9('0x6d'),_[_0xdef9('0x69')](_0x55598d)?'':_0x55598d[_0xdef9('0x28')]+_0xdef9('0x6e'));return{'isValid':![],'message':_0xdef9('0x6f')};}if(_['isNil'](_0x26820a[_0xdef9('0x9')])){ut[_0xdef9('0x4c')](_0xdef9('0x70'),JSON['stringify'](_0x26820a));return{'isValid':![],'message':_0xdef9('0x71')};}if(_[_0xdef9('0x69')](_0x26820a[_0xdef9('0x5')])){ut[_0xdef9('0x4c')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0xdef9('0x44')](_0x26820a));return{'isValid':![],'message':_0xdef9('0x72')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xdef9('0x73')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 3e617e0..7b94336 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 _0x2a77=['[Notify]\x20','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','resolve','notify','catch'];(function(_0x12c8e9,_0x5c65df){var _0x140ba3=function(_0x31deb5){while(--_0x31deb5){_0x12c8e9['push'](_0x12c8e9['shift']());}};_0x140ba3(++_0x5c65df);}(_0x2a77,0x173));var _0x72a7=function(_0x2440df,_0x453be8){_0x2440df=_0x2440df-0x0;var _0x1fa6fb=_0x2a77[_0x2440df];return _0x1fa6fb;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x72a7('0x0'))(_0x72a7('0x1'));var _=require(_0x72a7('0x2'));var faxAccount=require(_0x72a7('0x3'));function loggerCatch(_0x38e3f9){return function(_0x50228d){logger[_0x72a7('0x4')](_0x38e3f9,util[_0x72a7('0x5')](_0x50228d,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x418569,_0x2dbeb0){return BPromise[_0x72a7('0x6')]()['then'](faxAccount[_0x72a7('0x7')](_0x418569,_0x2dbeb0))[_0x72a7('0x8')](loggerCatch(_0x72a7('0x9')));}; \ No newline at end of file +var _0x5384=['lodash','../rpc/faxAccount','notify','resolve','then','[Notify]\x20','bluebird','../../../config/logger','preview'];(function(_0x1aa3fe,_0x27c5fa){var _0x163cee=function(_0x2a1505){while(--_0x2a1505){_0x1aa3fe['push'](_0x1aa3fe['shift']());}};_0x163cee(++_0x27c5fa);}(_0x5384,0x1d1));var _0x4538=function(_0x1444de,_0x4e2456){_0x1444de=_0x1444de-0x0;var _0x43f57b=_0x5384[_0x1444de];return _0x43f57b;};'use strict';var util=require('util');var BPromise=require(_0x4538('0x0'));var logger=require(_0x4538('0x1'))(_0x4538('0x2'));var _=require(_0x4538('0x3'));var faxAccount=require(_0x4538('0x4'));function loggerCatch(_0x1be14d){return function(_0x1252aa){logger['error'](_0x1be14d,util['inspect'](_0x1252aa,{'showHidden':![],'depth':null}));};}exports[_0x4538('0x5')]=function(_0x2097c4,_0x10a58a){return BPromise[_0x4538('0x6')]()[_0x4538('0x7')](faxAccount[_0x4538('0x5')](_0x2097c4,_0x10a58a))['catch'](loggerCatch(_0x4538('0x8')));}; \ 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 c7a89e4..2ed9247 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 _0xa0bb=['info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','bluebird','child_process','execute'];(function(_0x7b25d2,_0x2ada43){var _0x383ba5=function(_0x4a081d){while(--_0x4a081d){_0x7b25d2['push'](_0x7b25d2['shift']());}};_0x383ba5(++_0x2ada43);}(_0xa0bb,0xdc));var _0xba0b=function(_0x58a6ba,_0x3dd4c7){_0x58a6ba=_0x58a6ba-0x0;var _0x20e726=_0xa0bb[_0x58a6ba];return _0x20e726;};'use strict';var util=require(_0xba0b('0x0'));var logger=require(_0xba0b('0x1'))('fax');var BPromise=require(_0xba0b('0x2'));var exec=require(_0xba0b('0x3'))['exec'];exports[_0xba0b('0x4')]=function(_0x38af50){return new BPromise(function(_0x4d6453,_0x395f01){exec(_0x38af50,function(_0x54b332,_0x58015c,_0x3f82ba){logger[_0xba0b('0x5')](_0xba0b('0x6'),_0x58015c);if(_0x54b332){logger[_0xba0b('0x5')](_0xba0b('0x6'),_0xba0b('0x7'),util[_0xba0b('0x8')](_0x54b332,{'showHidden':![],'depth':null}),_0x58015c,_0x3f82ba);_0x395f01(_0x54b332);}_0x4d6453(_0x58015c);});});}; \ No newline at end of file +var _0xce3e=['exec','execute','info','inspect','util','../../../../config/logger','fax','child_process'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xce3e,0xfc));var _0xece3=function(_0x2f1d70,_0x14763c){_0x2f1d70=_0x2f1d70-0x0;var _0x162fc5=_0xce3e[_0x2f1d70];return _0x162fc5;};'use strict';var util=require(_0xece3('0x0'));var logger=require(_0xece3('0x1'))(_0xece3('0x2'));var BPromise=require('bluebird');var exec=require(_0xece3('0x3'))[_0xece3('0x4')];exports[_0xece3('0x5')]=function(_0x81d5f2){return new BPromise(function(_0x1a60e1,_0x1da2f4){exec(_0x81d5f2,function(_0x4e5142,_0x360960,_0x400b07){logger[_0xece3('0x6')]('Exec\x20gs',_0x360960);if(_0x4e5142){logger[_0xece3('0x6')]('Exec\x20gs','\x20Error\x20:',util[_0xece3('0x7')](_0x4e5142,{'showHidden':![],'depth':null}),_0x360960,_0x400b07);_0x1da2f4(_0x4e5142);}_0x1a60e1(_0x360960);});});}; \ 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 300a1fa..3557f9c 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 _0xc6f5=['maxrate','format','t38timeout','localstationid','originate','channel','\x22%s\x22\x20<%s>','uniqueid','lodash','moment','../../../../config/logger','fax','message','logger','inspect','addVariables','ecm','headerinfo'];(function(_0xa388a2,_0x40bde6){var _0x7ce7f6=function(_0x5a242a){while(--_0x5a242a){_0xa388a2['push'](_0xa388a2['shift']());}};_0x7ce7f6(++_0x40bde6);}(_0xc6f5,0x98));var _0x5c6f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc6f5[_0x40a045];return _0x1a687c;};'use strict';var util=require('util');var _=require(_0x5c6f('0x0'));var moment=require(_0x5c6f('0x1'));var logger=require(_0x5c6f('0x2'))(_0x5c6f('0x3'));exports[_0x5c6f('0x4')]=function(_0x1d3ef0){return{'message':_0x1d3ef0};};exports[_0x5c6f('0x5')]=function(_0x3ce67a,_0x1a8dc1){logger['info'](_0x3ce67a,util[_0x5c6f('0x6')](_0x1a8dc1,{'showHidden':![],'depth':null}));};exports[_0x5c6f('0x7')]=function(_0x1cb5d9,_0x4be2e9){var _0x45dcd7={'XMF-ECM':_0x4be2e9[_0x5c6f('0x8')],'XMF-HEADERINFO':_0x4be2e9[_0x5c6f('0x9')],'XMF-MINRATE':_0x4be2e9['minrate'],'XMF-MAXRATE':_0x4be2e9[_0x5c6f('0xa')],'XMF-MODEM':util[_0x5c6f('0xb')]('\x22%s\x22',_0x4be2e9['modem']),'XMF-GATEWAY':_0x4be2e9['gateway'],'XMF-FAXDETECT':_0x4be2e9['faxdetect'],'XMF-T38TIMEOUT':_0x4be2e9[_0x5c6f('0xc')],'XMF-LOCALSTATIONID':_0x4be2e9[_0x5c6f('0xd')],'XMF-PATH':_0x1cb5d9['path']};return _0x45dcd7;};exports['variablesAction']=function(_0x174608,_0x857eb5){return{'actionid':_0x174608['uniqueid'],'action':_0x5c6f('0xe'),'channel':_0x174608[_0x5c6f('0xf')],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util['format'](_0x5c6f('0x10'),_0x174608['headerinfo']?_0x174608[_0x5c6f('0x9')]:'',_0x174608[_0x5c6f('0xd')]),'variable':_0x857eb5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x174608[_0x5c6f('0x11')]};}; \ No newline at end of file +var _0x59f5=['inspect','addVariables','ecm','headerinfo','format','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','util','lodash','moment','../../../../config/logger','fax','message','logger'];(function(_0x86be56,_0x3c1c55){var _0x5d08ac=function(_0x136a73){while(--_0x136a73){_0x86be56['push'](_0x86be56['shift']());}};_0x5d08ac(++_0x3c1c55);}(_0x59f5,0x71));var _0x559f=function(_0x53b9ff,_0x5190d4){_0x53b9ff=_0x53b9ff-0x0;var _0xc110f0=_0x59f5[_0x53b9ff];return _0xc110f0;};'use strict';var util=require(_0x559f('0x0'));var _=require(_0x559f('0x1'));var moment=require(_0x559f('0x2'));var logger=require(_0x559f('0x3'))(_0x559f('0x4'));exports[_0x559f('0x5')]=function(_0x1d2e7f){return{'message':_0x1d2e7f};};exports[_0x559f('0x6')]=function(_0x483548,_0x1bccb5){logger['info'](_0x483548,util[_0x559f('0x7')](_0x1bccb5,{'showHidden':![],'depth':null}));};exports[_0x559f('0x8')]=function(_0x30fc8a,_0x4857ae){var _0x46783b={'XMF-ECM':_0x4857ae[_0x559f('0x9')],'XMF-HEADERINFO':_0x4857ae[_0x559f('0xa')],'XMF-MINRATE':_0x4857ae['minrate'],'XMF-MAXRATE':_0x4857ae['maxrate'],'XMF-MODEM':util[_0x559f('0xb')](_0x559f('0xc'),_0x4857ae['modem']),'XMF-GATEWAY':_0x4857ae[_0x559f('0xd')],'XMF-FAXDETECT':_0x4857ae[_0x559f('0xe')],'XMF-T38TIMEOUT':_0x4857ae[_0x559f('0xf')],'XMF-LOCALSTATIONID':_0x4857ae[_0x559f('0x10')],'XMF-PATH':_0x30fc8a[_0x559f('0x11')]};return _0x46783b;};exports[_0x559f('0x12')]=function(_0x3fc8ee,_0x18c7a2){return{'actionid':_0x3fc8ee[_0x559f('0x13')],'action':_0x559f('0x14'),'channel':_0x3fc8ee[_0x559f('0x15')],'Exten':_0x559f('0x16'),'Context':_0x559f('0x17'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x3fc8ee['headerinfo']?_0x3fc8ee[_0x559f('0xa')]:'',_0x3fc8ee[_0x559f('0x10')]),'variable':_0x18c7a2,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3fc8ee[_0x559f('0x13')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index b051433..80c8531 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 _0xa605=['getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','listen','sync','catch','[index.js][main]','inspect','util','./server','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger','get','hour','resolve','then','getAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0xa605,0x177));var _0x5a60=function(_0x1b6d49,_0x4f4d35){_0x1b6d49=_0x1b6d49-0x0;var _0xaeb1ec=_0xa605[_0x1b6d49];return _0xaeb1ec;};'use strict';var util=require(_0x5a60('0x0'));var moment=require('moment');var server=require(_0x5a60('0x1'));var Realtime=require(_0x5a60('0x2'));var Report=require(_0x5a60('0x3'));var Acw=require(_0x5a60('0x4'));var Trigger=require(_0x5a60('0x5'));var Dialer=require('./dialer');var Preview=require(_0x5a60('0x6'));var Fax=require(_0x5a60('0x7'));var user=require(_0x5a60('0x8'));var voiceQueue=require(_0x5a60('0x9'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0x5a60('0xa'));var template=require('./rpc/template');var cmHopperHistory=require(_0x5a60('0xb'));var campaign=require(_0x5a60('0xc'));var voiceExtension=require(_0x5a60('0xd'));var faxAccount=require(_0x5a60('0xe'));var zendesk=require(_0x5a60('0xf'));var salesforce=require(_0x5a60('0x10'));var sugarcrm=require(_0x5a60('0x11'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x5a60('0x12'));var zoho=require(_0x5a60('0x13'));var vtiger=require(_0x5a60('0x14'));var freshsales=require(_0x5a60('0x15'));var servicenow=require(_0x5a60('0x16'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x5a60('0x17'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x5a60('0x18')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x5a60('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x5a60('0x1a')]()[_0x5a60('0x1b')](user[_0x5a60('0x1c')]())[_0x5a60('0x1b')](realtime['initAgents']())[_0x5a60('0x1b')](user[_0x5a60('0x1d')]())['then'](realtime['initTelephones']())[_0x5a60('0x1b')](trunk[_0x5a60('0x1e')]())[_0x5a60('0x1b')](realtime[_0x5a60('0x1f')]())[_0x5a60('0x1b')](voiceQueue[_0x5a60('0x20')]())[_0x5a60('0x1b')](realtime[_0x5a60('0x21')]())[_0x5a60('0x1b')](trigger['getTriggers']())[_0x5a60('0x1b')](realtime[_0x5a60('0x22')]())[_0x5a60('0x1b')](template[_0x5a60('0x23')]())[_0x5a60('0x1b')](realtime[_0x5a60('0x24')]())[_0x5a60('0x1b')](zendesk[_0x5a60('0x25')]())['then'](realtime[_0x5a60('0x26')]())[_0x5a60('0x1b')](salesforce[_0x5a60('0x27')]())['then'](realtime[_0x5a60('0x28')]())[_0x5a60('0x1b')](sugarcrm[_0x5a60('0x29')]())[_0x5a60('0x1b')](realtime[_0x5a60('0x2a')]())[_0x5a60('0x1b')](freshdesk[_0x5a60('0x2b')]())['then'](realtime[_0x5a60('0x2c')]())['then'](desk[_0x5a60('0x2d')]())['then'](realtime[_0x5a60('0x2e')]())[_0x5a60('0x1b')](zoho[_0x5a60('0x2f')]())[_0x5a60('0x1b')](realtime[_0x5a60('0x30')]())[_0x5a60('0x1b')](vtiger[_0x5a60('0x31')]())['then'](realtime['initVtigerAccounts']())[_0x5a60('0x1b')](freshsales[_0x5a60('0x32')]())[_0x5a60('0x1b')](realtime[_0x5a60('0x33')]())[_0x5a60('0x1b')](servicenow[_0x5a60('0x34')]())[_0x5a60('0x1b')](realtime['initServicenowAccounts']())['then'](dynamics365[_0x5a60('0x35')]())[_0x5a60('0x1b')](realtime[_0x5a60('0x36')]())['then'](campaign[_0x5a60('0x37')]())[_0x5a60('0x1b')](realtime[_0x5a60('0x38')]())[_0x5a60('0x1b')](voiceExtension[_0x5a60('0x39')]())[_0x5a60('0x1b')](realtime['initVoiceExtensions']())[_0x5a60('0x1b')](faxAccount[_0x5a60('0x3a')]())[_0x5a60('0x1b')](realtime[_0x5a60('0x3b')]())['then'](function(){return realtime;});}function initParams(){return Promise['resolve']()['then'](voiceQueueReport[_0x5a60('0x3c')]())[_0x5a60('0x1b')](realtime[_0x5a60('0x3d')]())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x5a60('0x1b')](realtime[_0x5a60('0x3e')]())[_0x5a60('0x1b')](cmHopperHistory[_0x5a60('0x3f')]())[_0x5a60('0x1b')](realtime[_0x5a60('0x40')]())[_0x5a60('0x1b')](voiceCallReport[_0x5a60('0x41')]())['then'](realtime[_0x5a60('0x42')]())['catch'](function(_0x1514b9){logger[_0x5a60('0x43')]('[index.js][initParams]',util['inspect'](_0x1514b9,{'showHidden':![],'depth':null}));});}function main(){return server[_0x5a60('0x44')](realtime,preview,fax)[_0x5a60('0x1b')](function(){return initRealtime();})[_0x5a60('0x1b')](function(){return initParams();})['then'](function(){report[_0x5a60('0x45')]();setInterval(initRealtime,0x1388);})[_0x5a60('0x46')](function(_0x399f5b){logger[_0x5a60('0x43')](_0x5a60('0x47'),util[_0x5a60('0x48')](_0x399f5b,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xe725=['initFreshsalesAccounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','listen','sync','[index.js][main]','inspect','moment','./server','./realtime','./report','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getFreshsalesAccounts'];(function(_0x52d181,_0x432702){var _0x54d38f=function(_0x5e639f){while(--_0x5e639f){_0x52d181['push'](_0x52d181['shift']());}};_0x54d38f(++_0x432702);}(_0xe725,0x1ab));var _0x5e72=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe725[_0x4b369d];return _0x571a98;};'use strict';var util=require('util');var moment=require(_0x5e72('0x0'));var server=require(_0x5e72('0x1'));var Realtime=require(_0x5e72('0x2'));var Report=require(_0x5e72('0x3'));var Acw=require('./acw');var Trigger=require(_0x5e72('0x4'));var Dialer=require('./dialer');var Preview=require(_0x5e72('0x5'));var Fax=require(_0x5e72('0x6'));var user=require(_0x5e72('0x7'));var voiceQueue=require(_0x5e72('0x8'));var voiceQueueReport=require(_0x5e72('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x5e72('0xa'));var trigger=require(_0x5e72('0xb'));var template=require(_0x5e72('0xc'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x5e72('0xd'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x5e72('0xe'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x5e72('0xf'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x5e72('0x10'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x5e72('0x11'));var vtiger=require(_0x5e72('0x12'));var freshsales=require(_0x5e72('0x13'));var servicenow=require(_0x5e72('0x14'));var dynamics365=require(_0x5e72('0x15'));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(_0x5e72('0x16'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x5e72('0x17')](_0x5e72('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x5e72('0x17')](_0x5e72('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x5e72('0x19')]()[_0x5e72('0x1a')](user[_0x5e72('0x1b')]())[_0x5e72('0x1a')](realtime[_0x5e72('0x1c')]())['then'](user[_0x5e72('0x1d')]())[_0x5e72('0x1a')](realtime[_0x5e72('0x1e')]())['then'](trunk[_0x5e72('0x1f')]())[_0x5e72('0x1a')](realtime[_0x5e72('0x20')]())[_0x5e72('0x1a')](voiceQueue[_0x5e72('0x21')]())['then'](realtime[_0x5e72('0x22')]())[_0x5e72('0x1a')](trigger[_0x5e72('0x23')]())['then'](realtime[_0x5e72('0x24')]())[_0x5e72('0x1a')](template['getTemplates']())[_0x5e72('0x1a')](realtime[_0x5e72('0x25')]())[_0x5e72('0x1a')](zendesk[_0x5e72('0x26')]())[_0x5e72('0x1a')](realtime[_0x5e72('0x27')]())[_0x5e72('0x1a')](salesforce['getSalesforceAccounts']())[_0x5e72('0x1a')](realtime[_0x5e72('0x28')]())[_0x5e72('0x1a')](sugarcrm[_0x5e72('0x29')]())[_0x5e72('0x1a')](realtime[_0x5e72('0x2a')]())[_0x5e72('0x1a')](freshdesk[_0x5e72('0x2b')]())[_0x5e72('0x1a')](realtime['initFreshdeskAccounts']())['then'](desk[_0x5e72('0x2c')]())[_0x5e72('0x1a')](realtime[_0x5e72('0x2d')]())[_0x5e72('0x1a')](zoho[_0x5e72('0x2e')]())[_0x5e72('0x1a')](realtime[_0x5e72('0x2f')]())[_0x5e72('0x1a')](vtiger['getVtigerAccounts']())[_0x5e72('0x1a')](realtime['initVtigerAccounts']())['then'](freshsales[_0x5e72('0x30')]())[_0x5e72('0x1a')](realtime[_0x5e72('0x31')]())[_0x5e72('0x1a')](servicenow['getServicenowAccounts']())['then'](realtime['initServicenowAccounts']())[_0x5e72('0x1a')](dynamics365['getDynamics365Accounts']())[_0x5e72('0x1a')](realtime[_0x5e72('0x32')]())[_0x5e72('0x1a')](campaign[_0x5e72('0x33')]())['then'](realtime['initCampaigns']())[_0x5e72('0x1a')](voiceExtension[_0x5e72('0x34')]())['then'](realtime['initVoiceExtensions']())[_0x5e72('0x1a')](faxAccount[_0x5e72('0x35')]())['then'](realtime['initFaxAccounts']())[_0x5e72('0x1a')](function(){return realtime;});}function initParams(){return Promise[_0x5e72('0x19')]()[_0x5e72('0x1a')](voiceQueueReport[_0x5e72('0x36')]())[_0x5e72('0x1a')](realtime[_0x5e72('0x37')]())[_0x5e72('0x1a')](cmHopperHistory[_0x5e72('0x38')]())[_0x5e72('0x1a')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x5e72('0x39')]())[_0x5e72('0x1a')](realtime[_0x5e72('0x3a')]())[_0x5e72('0x1a')](voiceCallReport[_0x5e72('0x3b')]())[_0x5e72('0x1a')](realtime[_0x5e72('0x3c')]())[_0x5e72('0x3d')](function(_0xed6fb5){logger[_0x5e72('0x3e')](_0x5e72('0x3f'),util['inspect'](_0xed6fb5,{'showHidden':![],'depth':null}));});}function main(){return server[_0x5e72('0x40')](realtime,preview,fax)[_0x5e72('0x1a')](function(){return initRealtime();})[_0x5e72('0x1a')](function(){return initParams();})[_0x5e72('0x1a')](function(){report[_0x5e72('0x41')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x4403cb){logger[_0x5e72('0x3e')](_0x5e72('0x42'),util[_0x5e72('0x43')](_0x4403cb,{'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 6fba459..2b402b4 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 _0x771d=['fullname','state','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','statePause','onhold','stringify','format','user:%s','emit','user:ami:update','omit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode'];(function(_0xd1c75e,_0x43ef5b){var _0x480887=function(_0x23405d){while(--_0x23405d){_0xd1c75e['push'](_0xd1c75e['shift']());}};_0x480887(++_0x43ef5b);}(_0x771d,0x1e1));var _0xd771=function(_0xf5a16f,_0x46dc59){_0xf5a16f=_0xf5a16f-0x0;var _0x323341=_0x771d[_0xf5a16f];return _0x323341;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd771('0x0'));var md5=require(_0xd771('0x1'));var Redis=require(_0xd771('0x2'));var config=require(_0xd771('0x3'));config[_0xd771('0x4')]=_[_0xd771('0x5')](config['redis'],{'host':_0xd771('0x6'),'port':0x18eb});var io=require(_0xd771('0x7'))(new Redis(config[_0xd771('0x4')]));function Agent(_0x84e3f7){this['id']=_0x84e3f7['id']||0x0;this[_0xd771('0x8')]=_0x84e3f7[_0xd771('0x8')]||'';this['email']=_0x84e3f7[_0xd771('0x9')]||'';this[_0xd771('0xa')]=_0x84e3f7['accountcode']||'';this[_0xd771('0xb')]=_0x84e3f7[_0xd771('0xb')]||'';this[_0xd771('0xc')]=_0xd771('0xd');this[_0xd771('0xe')]=0x0;this[_0xd771('0xf')]='unknown';this[_0xd771('0x10')]='';this[_0xd771('0x11')]='';this[_0xd771('0x12')]='';this[_0xd771('0x13')]='';this[_0xd771('0x14')]=_0x84e3f7[_0xd771('0x14')]||![];this[_0xd771('0x15')]=_0xd771('0xd');this[_0xd771('0x16')]=0x0;this[_0xd771('0x17')]='';this[_0xd771('0x18')]='';this['onhold']=![];this[_0xd771('0x19')]=![];this[_0xd771('0x1')]='';}Agent[_0xd771('0x1a')][_0xd771('0x1b')]=function(_0x4a52f8){var _0x437cc8;if(_0x4a52f8&&_0x4a52f8[_0xd771('0xc')]){_0x437cc8=_0x4a52f8[_0xd771('0xc')][_0xd771('0x1c')]();switch(_0x437cc8){case _0xd771('0x1d'):_0x437cc8=_0xd771('0x1e');break;case'inuse':_0x437cc8='talking';break;}}if(_0x437cc8&&this[_0xd771('0x15')]!==_0x437cc8||_0x4a52f8[_0xd771('0x1f')]){this[_0xd771('0x16')]=_['toNumber'](moment()['format']('x'));}if(_0x437cc8){this['voiceStatus']=_0x437cc8;}var _0x37c060={'id':this['id'],'name':this[_0xd771('0x8')],'email':this[_0xd771('0x9')],'accountcode':this[_0xd771('0xa')],'fullname':this[_0xd771('0xb')],'state':this['state'],'stateTime':this[_0xd771('0xe')],'status':this[_0xd771('0xf')],'address':this[_0xd771('0x10')],'online':this[_0xd771('0x14')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0xd771('0x18')],'interface':this[_0xd771('0x13')],'onhold':this[_0xd771('0x20')]};var _0x33b2dc=md5(JSON[_0xd771('0x21')](_0x37c060));if(this[_0xd771('0x1')]!==_0x33b2dc){this[_0xd771('0x1')]=_0x33b2dc;io['to'](util[_0xd771('0x22')](_0xd771('0x23'),_0x37c060[_0xd771('0x8')]))[_0xd771('0x24')](_0xd771('0x25'),_[_0xd771('0x26')](_0x37c060,[_0xd771('0x14')]));io['emit'](_0xd771('0x27'),_0x37c060);}};module[_0xd771('0x28')]=Agent; \ No newline at end of file +var _0x6f77=['redis','localhost','socket.io-emitter','name','accountcode','fullname','state','stateTime','status','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','local','prototype','updateStatusRealtime','not_inuse','talking','statePause','format','email','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','stringify','user:%s','user:ami:update','omit','emit','user:presence','util','moment','md5','ioredis','../../../config/environment'];(function(_0x2d0223,_0x5f1ce4){var _0x29779a=function(_0x526225){while(--_0x526225){_0x2d0223['push'](_0x2d0223['shift']());}};_0x29779a(++_0x5f1ce4);}(_0x6f77,0x10c));var _0x76f7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6f77[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x76f7('0x0'));var moment=require(_0x76f7('0x1'));var md5=require(_0x76f7('0x2'));var Redis=require(_0x76f7('0x3'));var config=require(_0x76f7('0x4'));config[_0x76f7('0x5')]=_['defaults'](config[_0x76f7('0x5')],{'host':_0x76f7('0x6'),'port':0x18eb});var io=require(_0x76f7('0x7'))(new Redis(config[_0x76f7('0x5')]));function Agent(_0x5f1dfd){this['id']=_0x5f1dfd['id']||0x0;this[_0x76f7('0x8')]=_0x5f1dfd[_0x76f7('0x8')]||'';this['email']=_0x5f1dfd['email']||'';this['accountcode']=_0x5f1dfd[_0x76f7('0x9')]||'';this[_0x76f7('0xa')]=_0x5f1dfd[_0x76f7('0xa')]||'';this[_0x76f7('0xb')]='unknown';this[_0x76f7('0xc')]=0x0;this[_0x76f7('0xd')]=_0x76f7('0xe');this[_0x76f7('0xf')]='';this[_0x76f7('0x10')]='';this[_0x76f7('0x11')]='';this[_0x76f7('0x12')]='';this[_0x76f7('0x13')]=_0x5f1dfd[_0x76f7('0x13')]||![];this[_0x76f7('0x14')]='unknown';this[_0x76f7('0x15')]=0x0;this['voiceStatusCallerIdNumber']='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x76f7('0x16')]=![];this[_0x76f7('0x2')]='';}Agent[_0x76f7('0x17')][_0x76f7('0x18')]=function(_0x2a052f){var _0x301fd4;if(_0x2a052f&&_0x2a052f['state']){_0x301fd4=_0x2a052f[_0x76f7('0xb')]['toLowerCase']();switch(_0x301fd4){case _0x76f7('0x19'):_0x301fd4='idle';break;case'inuse':_0x301fd4=_0x76f7('0x1a');break;}}if(_0x301fd4&&this['voiceStatus']!==_0x301fd4||_0x2a052f[_0x76f7('0x1b')]){this['voiceStatusTime']=_['toNumber'](moment()[_0x76f7('0x1c')]('x'));}if(_0x301fd4){this['voiceStatus']=_0x301fd4;}var _0x2666ff={'id':this['id'],'name':this[_0x76f7('0x8')],'email':this[_0x76f7('0x1d')],'accountcode':this[_0x76f7('0x9')],'fullname':this[_0x76f7('0xa')],'state':this[_0x76f7('0xb')],'stateTime':this[_0x76f7('0xc')],'status':this[_0x76f7('0xd')],'address':this[_0x76f7('0xf')],'online':this[_0x76f7('0x13')],'voiceStatus':this[_0x76f7('0x14')],'voiceStatusTime':this[_0x76f7('0x15')],'voiceStatusCallerIdNumber':this[_0x76f7('0x1e')],'voiceStatusQueue':this[_0x76f7('0x1f')],'interface':this['interface'],'onhold':this[_0x76f7('0x20')]};var _0x196948=md5(JSON[_0x76f7('0x21')](_0x2666ff));if(this[_0x76f7('0x2')]!==_0x196948){this[_0x76f7('0x2')]=_0x196948;io['to'](util[_0x76f7('0x1c')](_0x76f7('0x22'),_0x2666ff['name']))['emit'](_0x76f7('0x23'),_[_0x76f7('0x24')](_0x2666ff,['online']));io[_0x76f7('0x25')](_0x76f7('0x26'),_0x2666ff);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 98910e8..f8929fd 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 _0xf05c=['dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence'];(function(_0x119b4b,_0x322a87){var _0x2ca4d5=function(_0x45a93e){while(--_0x45a93e){_0x119b4b['push'](_0x119b4b['shift']());}};_0x2ca4d5(++_0x322a87);}(_0xf05c,0x1a0));var _0xcf05=function(_0x2a50ad,_0x23360a){_0x2a50ad=_0x2a50ad-0x0;var _0x4a2966=_0xf05c[_0x2a50ad];return _0x4a2966;};'use strict';function Campaign(_0x189c6d){this['id']=_0x189c6d['id']||0x0;this['name']=_0x189c6d[_0xcf05('0x0')]||'';this[_0xcf05('0x1')]=_0x189c6d['type']||_0xcf05('0x2');this[_0xcf05('0x3')]=0x0;this[_0xcf05('0x4')]=0x0;this[_0xcf05('0x5')]=0x0;this[_0xcf05('0x6')]=0x0;this[_0xcf05('0x7')]='';this[_0xcf05('0x8')]=!![];this['active']=_0x189c6d['active'];this['limitCalls']=_0x189c6d[_0xcf05('0x9')];this['dialTimezone']=_0x189c6d[_0xcf05('0xa')]||null;this[_0xcf05('0xb')]=_0x189c6d['dialGlobalInterval']?_0x189c6d[_0xcf05('0xb')]:null;this[_0xcf05('0xc')]=_0x189c6d['dialOriginateCallerIdName'];this[_0xcf05('0xd')]=_0x189c6d[_0xcf05('0xd')];this['dialOriginateTimeout']=_0x189c6d[_0xcf05('0xe')]||0x1e;this[_0xcf05('0xf')]=_0x189c6d[_0xcf05('0xf')];this[_0xcf05('0x10')]=_0x189c6d[_0xcf05('0x10')];this['dialBusyMaxRetry']=_0x189c6d[_0xcf05('0x11')];this['dialBusyRetryFrequency']=_0x189c6d[_0xcf05('0x12')];this['dialNoAnswerMaxRetry']=_0x189c6d['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x189c6d[_0xcf05('0x13')];this[_0xcf05('0x14')]=_0x189c6d[_0xcf05('0x14')];this['dialNoSuchNumberMaxRetry']=_0x189c6d[_0xcf05('0x15')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x189c6d[_0xcf05('0x16')]||0x96;this[_0xcf05('0x17')]=_0x189c6d[_0xcf05('0x17')]||0x3;this['dialDropRetryFrequency']=_0x189c6d[_0xcf05('0x18')]||0x96;this[_0xcf05('0x19')]=_0x189c6d['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x189c6d[_0xcf05('0x1a')]||0x96;this['dialMachineMaxRetry']=_0x189c6d[_0xcf05('0x1b')]||0x3;this[_0xcf05('0x1c')]=_0x189c6d['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x189c6d[_0xcf05('0x1d')]||0x3;this[_0xcf05('0x1e')]=_0x189c6d[_0xcf05('0x1e')]||0x96;this[_0xcf05('0x1f')]=_0x189c6d[_0xcf05('0x1f')]||_0xcf05('0x20');this[_0xcf05('0x21')]=_0x189c6d[_0xcf05('0x21')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x189c6d[_0xcf05('0x22')]||undefined;this['dialCutDigit']=_0x189c6d[_0xcf05('0x23')]||undefined;this[_0xcf05('0x24')]=_0x189c6d['TrunkBackup']?_0x189c6d[_0xcf05('0x24')]:undefined;this['Trunk']=_0x189c6d[_0xcf05('0x25')]?_0x189c6d[_0xcf05('0x25')]:undefined;this[_0xcf05('0x26')]=_0x189c6d['Interval']?_0x189c6d['Interval']:undefined;this[_0xcf05('0x27')]=_0x189c6d[_0xcf05('0x27')]?_0x189c6d['SquareProject']:undefined;this[_0xcf05('0x28')]=_0x189c6d[_0xcf05('0x27')]?_0x189c6d[_0xcf05('0x27')][_0xcf05('0x0')]:undefined;this['dialAMDActive']=_0x189c6d[_0xcf05('0x29')]||![];this[_0xcf05('0x2a')]=_0x189c6d[_0xcf05('0x2a')];this[_0xcf05('0x2b')]=_0x189c6d[_0xcf05('0x2b')];this[_0xcf05('0x2c')]=_0x189c6d['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x189c6d[_0xcf05('0x2d')];this['dialAMDMinWordLength']=_0x189c6d['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x189c6d[_0xcf05('0x2e')];this[_0xcf05('0x2f')]=_0x189c6d[_0xcf05('0x2f')];this[_0xcf05('0x30')]=_0x189c6d[_0xcf05('0x30')];this[_0xcf05('0x31')]=_0x189c6d[_0xcf05('0x31')];}module[_0xcf05('0x32')]=Campaign; \ No newline at end of file +var _0xda33=['dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda33,0xf6));var _0x3da3=function(_0x94b019,_0x376881){_0x94b019=_0x94b019-0x0;var _0x20d950=_0xda33[_0x94b019];return _0x20d950;};'use strict';function Campaign(_0x3541c4){this['id']=_0x3541c4['id']||0x0;this[_0x3da3('0x0')]=_0x3541c4[_0x3da3('0x0')]||'';this[_0x3da3('0x1')]=_0x3541c4[_0x3da3('0x1')]||_0x3da3('0x2');this[_0x3da3('0x3')]=0x0;this[_0x3da3('0x4')]=0x0;this[_0x3da3('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0x3da3('0x6')]=!![];this['active']=_0x3541c4[_0x3da3('0x7')];this[_0x3da3('0x8')]=_0x3541c4['limitCalls'];this[_0x3da3('0x9')]=_0x3541c4['dialTimezone']||null;this[_0x3da3('0xa')]=_0x3541c4[_0x3da3('0xa')]?_0x3541c4[_0x3da3('0xa')]:null;this['dialOriginateCallerIdName']=_0x3541c4[_0x3da3('0xb')];this[_0x3da3('0xc')]=_0x3541c4[_0x3da3('0xc')];this[_0x3da3('0xd')]=_0x3541c4['dialOriginateTimeout']||0x1e;this[_0x3da3('0xe')]=_0x3541c4[_0x3da3('0xe')];this['dialCongestionRetryFrequency']=_0x3541c4['dialCongestionRetryFrequency'];this[_0x3da3('0xf')]=_0x3541c4[_0x3da3('0xf')];this[_0x3da3('0x10')]=_0x3541c4[_0x3da3('0x10')];this[_0x3da3('0x11')]=_0x3541c4[_0x3da3('0x11')];this[_0x3da3('0x12')]=_0x3541c4[_0x3da3('0x12')];this[_0x3da3('0x13')]=_0x3541c4['dialGlobalMaxRetry'];this[_0x3da3('0x14')]=_0x3541c4[_0x3da3('0x14')]||0x3;this[_0x3da3('0x15')]=_0x3541c4[_0x3da3('0x15')]||0x96;this['dialDropMaxRetry']=_0x3541c4[_0x3da3('0x16')]||0x3;this['dialDropRetryFrequency']=_0x3541c4[_0x3da3('0x17')]||0x96;this[_0x3da3('0x18')]=_0x3541c4['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x3541c4[_0x3da3('0x19')]||0x96;this[_0x3da3('0x1a')]=_0x3541c4[_0x3da3('0x1a')]||0x3;this[_0x3da3('0x1b')]=_0x3541c4[_0x3da3('0x1b')]||0x96;this[_0x3da3('0x1c')]=_0x3541c4['dialAgentRejectMaxRetry']||0x3;this[_0x3da3('0x1d')]=_0x3541c4['dialAgentRejectRetryFrequency']||0x96;this[_0x3da3('0x1e')]=_0x3541c4[_0x3da3('0x1e')]||_0x3da3('0x1f');this['dialPrefix']=_0x3541c4[_0x3da3('0x20')]||undefined;this[_0x3da3('0x21')]=_0x3541c4['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x3da3('0x22')]=_0x3541c4[_0x3da3('0x22')]||undefined;this[_0x3da3('0x23')]=_0x3541c4[_0x3da3('0x23')]?_0x3541c4[_0x3da3('0x23')]:undefined;this['Trunk']=_0x3541c4[_0x3da3('0x24')]?_0x3541c4[_0x3da3('0x24')]:undefined;this[_0x3da3('0x25')]=_0x3541c4[_0x3da3('0x25')]?_0x3541c4[_0x3da3('0x25')]:undefined;this['SquareProject']=_0x3541c4[_0x3da3('0x26')]?_0x3541c4[_0x3da3('0x26')]:undefined;this['dialQueueProject']=_0x3541c4[_0x3da3('0x26')]?_0x3541c4[_0x3da3('0x26')][_0x3da3('0x0')]:undefined;this['dialAMDActive']=_0x3541c4['dialAMDActive']||![];this[_0x3da3('0x27')]=_0x3541c4['dialAMDInitialSilence'];this[_0x3da3('0x28')]=_0x3541c4['dialAMDGreeting'];this[_0x3da3('0x29')]=_0x3541c4[_0x3da3('0x29')];this['dialAMDTotalAnalysisTime']=_0x3541c4[_0x3da3('0x2a')];this['dialAMDMinWordLength']=_0x3541c4['dialAMDMinWordLength'];this[_0x3da3('0x2b')]=_0x3541c4[_0x3da3('0x2b')];this[_0x3da3('0x2c')]=_0x3541c4[_0x3da3('0x2c')];this[_0x3da3('0x2d')]=_0x3541c4[_0x3da3('0x2d')];this[_0x3da3('0x2e')]=_0x3541c4['dialAMDMaximumWordLength'];}module[_0x3da3('0x2f')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 443fa9e..1b6e29a 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 _0x3bf0=['tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','endtime','unmanaged','lastapplication','lastdata','duration','holdtime','type'];(function(_0x3e5223,_0x5a546f){var _0x3d6444=function(_0x20a109){while(--_0x20a109){_0x3e5223['push'](_0x3e5223['shift']());}};_0x3d6444(++_0x5a546f);}(_0x3bf0,0x83));var _0x03bf=function(_0x5bc699,_0x120515){_0x5bc699=_0x5bc699-0x0;var _0x3534dc=_0x3bf0[_0x5bc699];return _0x3534dc;};'use strict';function Channel(){this[_0x03bf('0x0')]=null;this[_0x03bf('0x1')]='';this[_0x03bf('0x2')]='';this[_0x03bf('0x3')]=0x0;this[_0x03bf('0x4')]='';this[_0x03bf('0x5')]=undefined;this[_0x03bf('0x6')]=undefined;this['accountcode']=0x0;this[_0x03bf('0x7')]='';this[_0x03bf('0x8')]=0x0;this[_0x03bf('0x9')]=0x0;this[_0x03bf('0xa')]=0x0;this[_0x03bf('0xb')]=![];this['answertime']=null;this[_0x03bf('0xc')]=null;this[_0x03bf('0xd')]=![];this['abandoned']=![];this[_0x03bf('0xe')]='';this[_0x03bf('0xf')]='';this[_0x03bf('0x10')]=0x0;this['billableseconds']=0x0;this[_0x03bf('0x11')]=0x0;this[_0x03bf('0x12')]=null;this[_0x03bf('0x13')]=null;this[_0x03bf('0x14')]=null;this[_0x03bf('0x15')]=![];this[_0x03bf('0x16')]=null;this[_0x03bf('0x17')]=null;this[_0x03bf('0x18')]=[];this[_0x03bf('0x19')]=undefined;this[_0x03bf('0x1a')]=undefined;this[_0x03bf('0x1b')]=undefined;this[_0x03bf('0x1c')]=0x0;}module[_0x03bf('0x1d')]=Channel; \ No newline at end of file +var _0x6426=['channel','destinationchannel','calleridnum','calleridname','connectedlinename','accountcode','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','transferType','mohtime','starttime'];(function(_0x41f405,_0x4fdcb1){var _0x3eec23=function(_0x75fda3){while(--_0x75fda3){_0x41f405['push'](_0x41f405['shift']());}};_0x3eec23(++_0x4fdcb1);}(_0x6426,0x15b));var _0x6642=function(_0x16d18e,_0xf001a0){_0x16d18e=_0x16d18e-0x0;var _0xa82b84=_0x6426[_0x16d18e];return _0xa82b84;};'use strict';function Channel(){this[_0x6642('0x0')]=null;this[_0x6642('0x1')]='';this[_0x6642('0x2')]='';this[_0x6642('0x3')]=0x0;this[_0x6642('0x4')]='';this['connectedlinenum']=undefined;this[_0x6642('0x5')]=undefined;this[_0x6642('0x6')]=0x0;this['context']='';this[_0x6642('0x7')]=0x0;this[_0x6642('0x8')]=0x0;this[_0x6642('0x9')]=0x0;this[_0x6642('0xa')]=![];this[_0x6642('0xb')]=null;this[_0x6642('0xc')]=null;this['unmanaged']=![];this[_0x6642('0xd')]=![];this[_0x6642('0xe')]='';this[_0x6642('0xf')]='';this[_0x6642('0x10')]=0x0;this[_0x6642('0x11')]=0x0;this[_0x6642('0x12')]=0x0;this[_0x6642('0x13')]=null;this[_0x6642('0x14')]=null;this[_0x6642('0x15')]=null;this[_0x6642('0x16')]=![];this[_0x6642('0x17')]=null;this[_0x6642('0x18')]=null;this[_0x6642('0x19')]=[];this['transfercalleridnum']=undefined;this[_0x6642('0x1a')]=undefined;this[_0x6642('0x1b')]=undefined;this[_0x6642('0x1c')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 973cb87..79d1182 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 _0xf0d9=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','remoteUri','authType'];(function(_0x5c0979,_0x287854){var _0x309972=function(_0x17defd){while(--_0x17defd){_0x5c0979['push'](_0x5c0979['shift']());}};_0x309972(++_0x287854);}(_0xf0d9,0xbd));var _0x9f0d=function(_0x5e0e26,_0x11cdd6){_0x5e0e26=_0x5e0e26-0x0;var _0x175e8c=_0xf0d9[_0x5e0e26];return _0x175e8c;};'use strict';function DeskAccount(_0x14ff5b){this['id']=_0x14ff5b['id']||0x0;this[_0x9f0d('0x0')]=_0x14ff5b[_0x9f0d('0x0')]||'';this['username']=_0x14ff5b['username']||'';this[_0x9f0d('0x1')]=_0x14ff5b['remoteUri']||'';this['authType']=_0x14ff5b[_0x9f0d('0x2')]||'';this[_0x9f0d('0x3')]=_0x14ff5b[_0x9f0d('0x3')]||'';this[_0x9f0d('0x4')]=_0x14ff5b['consumerKey']||'';this[_0x9f0d('0x5')]=_0x14ff5b[_0x9f0d('0x5')]||'';this[_0x9f0d('0x6')]=_0x14ff5b[_0x9f0d('0x6')]||'';this[_0x9f0d('0x7')]=_0x14ff5b[_0x9f0d('0x7')]||'';this[_0x9f0d('0x8')]=_0x14ff5b['type']||'';this[_0x9f0d('0x9')]=_0x14ff5b[_0x9f0d('0x9')]||'';this[_0x9f0d('0xa')]=_0x14ff5b[_0x9f0d('0xa')]||{};}module[_0x9f0d('0xb')]=DeskAccount; \ No newline at end of file +var _0x9ea4=['Configurations','exports','name','username','remoteUri','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0xc2c47b,_0x17b58b){var _0x2e0fba=function(_0x311169){while(--_0x311169){_0xc2c47b['push'](_0xc2c47b['shift']());}};_0x2e0fba(++_0x17b58b);}(_0x9ea4,0x7a));var _0x49ea=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9ea4[_0x40a045];return _0x1a687c;};'use strict';function DeskAccount(_0x32afe3){this['id']=_0x32afe3['id']||0x0;this[_0x49ea('0x0')]=_0x32afe3[_0x49ea('0x0')]||'';this[_0x49ea('0x1')]=_0x32afe3[_0x49ea('0x1')]||'';this[_0x49ea('0x2')]=_0x32afe3['remoteUri']||'';this['authType']=_0x32afe3['authType']||'';this[_0x49ea('0x3')]=_0x32afe3[_0x49ea('0x3')]||'';this[_0x49ea('0x4')]=_0x32afe3[_0x49ea('0x4')]||'';this[_0x49ea('0x5')]=_0x32afe3[_0x49ea('0x5')]||'';this[_0x49ea('0x6')]=_0x32afe3[_0x49ea('0x6')]||'';this[_0x49ea('0x7')]=_0x32afe3[_0x49ea('0x7')]||'';this[_0x49ea('0x8')]=_0x32afe3['type']||'';this[_0x49ea('0x9')]=_0x32afe3[_0x49ea('0x9')]||'';this[_0x49ea('0xa')]=_0x32afe3[_0x49ea('0xa')]||{};}module[_0x49ea('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index e467716..f48ee88 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 _0xa787=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x20dcc9,_0x3926e6){var _0x55a70d=function(_0x125208){while(--_0x125208){_0x20dcc9['push'](_0x20dcc9['shift']());}};_0x55a70d(++_0x3926e6);}(_0xa787,0x1d9));var _0x7a78=function(_0x14b732,_0x1747fb){_0x14b732=_0x14b732-0x0;var _0x223586=_0xa787[_0x14b732];return _0x223586;};'use strict';function Dynamics365Account(_0x16b6ff){this['id']=_0x16b6ff['id']||0x0;this['name']=_0x16b6ff[_0x7a78('0x0')]||'';this[_0x7a78('0x1')]=_0x16b6ff[_0x7a78('0x1')]||'';this['password']=_0x16b6ff[_0x7a78('0x2')]||'';this['remoteUri']=_0x16b6ff[_0x7a78('0x3')]||'';this['tenantId']=_0x16b6ff[_0x7a78('0x4')]||'';this[_0x7a78('0x5')]=_0x16b6ff[_0x7a78('0x5')]||'';this[_0x7a78('0x6')]=_0x16b6ff[_0x7a78('0x6')]||{};this[_0x7a78('0x7')]=_0x16b6ff[_0x7a78('0x7')]||'';this['modernAuthentication']=_0x16b6ff[_0x7a78('0x8')]||![];this[_0x7a78('0x9')]=_0x16b6ff['Configurations']||{};this[_0x7a78('0xa')]=_0x16b6ff[_0x7a78('0xa')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x6e8c=['remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password'];(function(_0x5b258e,_0x4e4366){var _0x3d3d75=function(_0x13918a){while(--_0x13918a){_0x5b258e['push'](_0x5b258e['shift']());}};_0x3d3d75(++_0x4e4366);}(_0x6e8c,0x1d1));var _0xc6e8=function(_0x3ad078,_0x3a5ce1){_0x3ad078=_0x3ad078-0x0;var _0x55bfc5=_0x6e8c[_0x3ad078];return _0x55bfc5;};'use strict';function Dynamics365Account(_0x374175){this['id']=_0x374175['id']||0x0;this[_0xc6e8('0x0')]=_0x374175[_0xc6e8('0x0')]||'';this['username']=_0x374175[_0xc6e8('0x1')]||'';this[_0xc6e8('0x2')]=_0x374175[_0xc6e8('0x2')]||'';this[_0xc6e8('0x3')]=_0x374175[_0xc6e8('0x3')]||'';this[_0xc6e8('0x4')]=_0x374175[_0xc6e8('0x4')]||'';this[_0xc6e8('0x5')]=_0x374175['clientId']||'';this[_0xc6e8('0x6')]=_0x374175[_0xc6e8('0x6')]||{};this['serverUrl']=_0x374175[_0xc6e8('0x7')]||'';this[_0xc6e8('0x8')]=_0x374175['modernAuthentication']||![];this[_0xc6e8('0x9')]=_0x374175['Configurations']||{};this[_0xc6e8('0xa')]=_0x374175['CloudProvider']||{};}module[_0xc6e8('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 49265a8..06e73f0 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 _0x45c8=['description','ecm','headerinfo','localstationid','maxrate','modem','gateway','t38timeout','tech','SIP','Trunk','ListId','key','name'];(function(_0x5f5265,_0x1da901){var _0x28aa09=function(_0x3e8bd4){while(--_0x3e8bd4){_0x5f5265['push'](_0x5f5265['shift']());}};_0x28aa09(++_0x1da901);}(_0x45c8,0x8b));var _0x845c=function(_0x5b651e,_0x38d599){_0x5b651e=_0x5b651e-0x0;var _0x294f7e=_0x45c8[_0x5b651e];return _0x294f7e;};'use strict';function FaxAccount(_0x30e8a5){this['id']=_0x30e8a5['id']||0x0;this[_0x845c('0x0')]=_0x30e8a5[_0x845c('0x0')]||'';this[_0x845c('0x1')]=_0x30e8a5[_0x845c('0x1')];this[_0x845c('0x2')]=_0x30e8a5[_0x845c('0x2')];this['headerinfo']=_0x30e8a5[_0x845c('0x3')];this['localstationid']=_0x30e8a5[_0x845c('0x4')];this['minrate']=_0x30e8a5['minrate']||0x960;this[_0x845c('0x5')]=_0x30e8a5[_0x845c('0x5')]||0x3840;this[_0x845c('0x6')]=_0x30e8a5[_0x845c('0x6')]||'v17,v27,v29';this[_0x845c('0x7')]=_0x30e8a5['gateway']||'no';this['faxdetect']=_0x30e8a5['faxdetect']||'no';this[_0x845c('0x8')]=_0x30e8a5[_0x845c('0x8')]||0x1388;this[_0x845c('0x9')]=_0x30e8a5[_0x845c('0x9')]||_0x845c('0xa');this[_0x845c('0xb')]=_0x30e8a5[_0x845c('0xb')]?_0x30e8a5['Trunk']:undefined;this[_0x845c('0xc')]=_0x30e8a5['ListId'];this[_0x845c('0xd')]=_0x30e8a5[_0x845c('0xd')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x8a7b=['t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect'];(function(_0x273a53,_0x13ea44){var _0x37c39d=function(_0x147960){while(--_0x147960){_0x273a53['push'](_0x273a53['shift']());}};_0x37c39d(++_0x13ea44);}(_0x8a7b,0x181));var _0xb8a7=function(_0x2d3ab3,_0x47d90b){_0x2d3ab3=_0x2d3ab3-0x0;var _0x321f9e=_0x8a7b[_0x2d3ab3];return _0x321f9e;};'use strict';function FaxAccount(_0x19649b){this['id']=_0x19649b['id']||0x0;this[_0xb8a7('0x0')]=_0x19649b[_0xb8a7('0x0')]||'';this[_0xb8a7('0x1')]=_0x19649b['description'];this[_0xb8a7('0x2')]=_0x19649b[_0xb8a7('0x2')];this[_0xb8a7('0x3')]=_0x19649b[_0xb8a7('0x3')];this[_0xb8a7('0x4')]=_0x19649b[_0xb8a7('0x4')];this['minrate']=_0x19649b[_0xb8a7('0x5')]||0x960;this[_0xb8a7('0x6')]=_0x19649b[_0xb8a7('0x6')]||0x3840;this[_0xb8a7('0x7')]=_0x19649b['modem']||_0xb8a7('0x8');this[_0xb8a7('0x9')]=_0x19649b[_0xb8a7('0x9')]||'no';this[_0xb8a7('0xa')]=_0x19649b['faxdetect']||'no';this[_0xb8a7('0xb')]=_0x19649b[_0xb8a7('0xb')]||0x1388;this[_0xb8a7('0xc')]=_0x19649b[_0xb8a7('0xc')]||_0xb8a7('0xd');this[_0xb8a7('0xe')]=_0x19649b['Trunk']?_0x19649b[_0xb8a7('0xe')]:undefined;this[_0xb8a7('0xf')]=_0x19649b[_0xb8a7('0xf')];this[_0xb8a7('0x10')]=_0x19649b[_0xb8a7('0x10')];}module[_0xb8a7('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index ec2ea9b..0fc97e9 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 _0xfb9d=['name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x3dcd44,_0xc9392e){var _0x4eb28f=function(_0x3c1746){while(--_0x3c1746){_0x3dcd44['push'](_0x3dcd44['shift']());}};_0x4eb28f(++_0xc9392e);}(_0xfb9d,0xde));var _0xdfb9=function(_0x23b4d5,_0x2b210c){_0x23b4d5=_0x23b4d5-0x0;var _0xf3025c=_0xfb9d[_0x23b4d5];return _0xf3025c;};'use strict';function FreshdeskAccount(_0x26151b){this['id']=_0x26151b['id']||0x0;this[_0xdfb9('0x0')]=_0x26151b[_0xdfb9('0x0')]||'';this[_0xdfb9('0x1')]=_0x26151b['username']||'';this[_0xdfb9('0x2')]=_0x26151b['token']||'';this['remoteUri']=_0x26151b[_0xdfb9('0x3')]||'';this[_0xdfb9('0x4')]=_0x26151b['serverUrl']||'';this['Configurations']=_0x26151b[_0xdfb9('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xef6d=['remoteUri','serverUrl','Configurations','name','username','apiKey','token'];(function(_0x2a0724,_0x376cb2){var _0x2b5a46=function(_0x211534){while(--_0x211534){_0x2a0724['push'](_0x2a0724['shift']());}};_0x2b5a46(++_0x376cb2);}(_0xef6d,0xa4));var _0xdef6=function(_0x50b44e,_0x505c20){_0x50b44e=_0x50b44e-0x0;var _0x36e749=_0xef6d[_0x50b44e];return _0x36e749;};'use strict';function FreshdeskAccount(_0x244d0d){this['id']=_0x244d0d['id']||0x0;this[_0xdef6('0x0')]=_0x244d0d[_0xdef6('0x0')]||'';this[_0xdef6('0x1')]=_0x244d0d['username']||'';this[_0xdef6('0x2')]=_0x244d0d[_0xdef6('0x3')]||'';this[_0xdef6('0x4')]=_0x244d0d[_0xdef6('0x4')]||'';this[_0xdef6('0x5')]=_0x244d0d['serverUrl']||'';this[_0xdef6('0x6')]=_0x244d0d[_0xdef6('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 faba5ab..c4d2ac4 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 _0x27a8=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x1d7bb5,_0x2a8604){var _0x79d9f2=function(_0x3e6418){while(--_0x3e6418){_0x1d7bb5['push'](_0x1d7bb5['shift']());}};_0x79d9f2(++_0x2a8604);}(_0x27a8,0x170));var _0x827a=function(_0x24cb31,_0x1bf763){_0x24cb31=_0x24cb31-0x0;var _0x412710=_0x27a8[_0x24cb31];return _0x412710;};'use strict';function FreshsalesAccount(_0x250877){this['id']=_0x250877['id']||0x0;this['name']=_0x250877[_0x827a('0x0')]||'';this[_0x827a('0x1')]=_0x250877[_0x827a('0x1')]||'';this[_0x827a('0x2')]=_0x250877[_0x827a('0x3')]||'';this[_0x827a('0x4')]=_0x250877[_0x827a('0x4')]||'';this[_0x827a('0x5')]=_0x250877[_0x827a('0x5')]||'';this[_0x827a('0x6')]=_0x250877[_0x827a('0x6')]||{};}module[_0x827a('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x7118=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x1155a0,_0x3dce6d){var _0x9bcd27=function(_0x125680){while(--_0x125680){_0x1155a0['push'](_0x1155a0['shift']());}};_0x9bcd27(++_0x3dce6d);}(_0x7118,0x159));var _0x8711=function(_0x2f8848,_0x52e8c9){_0x2f8848=_0x2f8848-0x0;var _0x2d89be=_0x7118[_0x2f8848];return _0x2d89be;};'use strict';function FreshsalesAccount(_0x2a79a7){this['id']=_0x2a79a7['id']||0x0;this['name']=_0x2a79a7[_0x8711('0x0')]||'';this[_0x8711('0x1')]=_0x2a79a7['username']||'';this[_0x8711('0x2')]=_0x2a79a7[_0x8711('0x3')]||'';this[_0x8711('0x4')]=_0x2a79a7[_0x8711('0x4')]||'';this[_0x8711('0x5')]=_0x2a79a7[_0x8711('0x5')]||'';this[_0x8711('0x6')]=_0x2a79a7['Configurations']||{};}module[_0x8711('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 8eb39e1..ab4510f 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 _0x6cd0=['lastAssignedTo','voice','routealias','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexitAt','channel','accountcode','context','exten','priority','assigned'];(function(_0x8c2e46,_0x4ee3af){var _0x404e13=function(_0x55293e){while(--_0x55293e){_0x8c2e46['push'](_0x8c2e46['shift']());}};_0x404e13(++_0x4ee3af);}(_0x6cd0,0x1e9));var _0x06cd=function(_0x40dd68,_0x232e0d){_0x40dd68=_0x40dd68-0x0;var _0x1ccac9=_0x6cd0[_0x40dd68];return _0x1ccac9;};'use strict';function QueueReport(){this[_0x06cd('0x0')]=_0x06cd('0x1');this['uniqueid']='';this[_0x06cd('0x2')]='';this[_0x06cd('0x3')]='';this['queue']='';this[_0x06cd('0x4')]=null;this[_0x06cd('0x5')]=null;this[_0x06cd('0x6')]=0x1;this['count']=0x1;this[_0x06cd('0x7')]=![];this[_0x06cd('0x8')]=null;this[_0x06cd('0x9')]=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this[_0x06cd('0xa')]=null;this['originalposition']=0x1;this[_0x06cd('0xb')]='';this['connectedlinenum']='';this['connectedlinename']='';this[_0x06cd('0xc')]='';this[_0x06cd('0xd')]='';this[_0x06cd('0xe')]='';this[_0x06cd('0xf')]='';this['holdtime']=0x0;this[_0x06cd('0x10')]=![];this[_0x06cd('0x11')]='';this['motionChannel']=_0x06cd('0x12');this[_0x06cd('0x13')]=null;this[_0x06cd('0x14')]=0x0;this[_0x06cd('0x15')]={};}module[_0x06cd('0x16')]=QueueReport; \ No newline at end of file +var _0x4bfb=['type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','exports'];(function(_0x530bce,_0x2ce24f){var _0x4efb9e=function(_0x51d2e6){while(--_0x51d2e6){_0x530bce['push'](_0x530bce['shift']());}};_0x4efb9e(++_0x2ce24f);}(_0x4bfb,0x150));var _0xb4bf=function(_0x33c603,_0x6d0ce4){_0x33c603=_0x33c603-0x0;var _0xae96f4=_0x4bfb[_0x33c603];return _0xae96f4;};'use strict';function QueueReport(){this[_0xb4bf('0x0')]=_0xb4bf('0x1');this[_0xb4bf('0x2')]='';this[_0xb4bf('0x3')]='';this['calleridname']='';this[_0xb4bf('0x4')]='';this[_0xb4bf('0x5')]=null;this[_0xb4bf('0x6')]=null;this['position']=0x1;this['count']=0x1;this[_0xb4bf('0x7')]=![];this[_0xb4bf('0x8')]=null;this[_0xb4bf('0x9')]=![];this[_0xb4bf('0xa')]=null;this[_0xb4bf('0xb')]=![];this[_0xb4bf('0xc')]=null;this[_0xb4bf('0xd')]=0x1;this[_0xb4bf('0xe')]='';this[_0xb4bf('0xf')]='';this[_0xb4bf('0x10')]='';this[_0xb4bf('0x11')]='';this[_0xb4bf('0x12')]='';this[_0xb4bf('0x13')]='';this[_0xb4bf('0x14')]='';this[_0xb4bf('0x15')]=0x0;this[_0xb4bf('0x16')]=![];this[_0xb4bf('0x17')]='';this[_0xb4bf('0x18')]=_0xb4bf('0x19');this['routealias']=null;this[_0xb4bf('0x1a')]=0x0;this['variables']={};}module[_0xb4bf('0x1b')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index efb870f..4f7c01b 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 _0x241c=['name','username','remoteUri','password','clientId','clientSecret','type','serverUrl','Configurations'];(function(_0x188360,_0x3d93f8){var _0x1fbe6d=function(_0x3d9d32){while(--_0x3d9d32){_0x188360['push'](_0x188360['shift']());}};_0x1fbe6d(++_0x3d93f8);}(_0x241c,0xd8));var _0xc241=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x241c[_0xa464c9];return _0x3d73c4;};'use strict';function SalesforceAccount(_0x305404){this['id']=_0x305404['id']||0x0;this[_0xc241('0x0')]=_0x305404[_0xc241('0x0')]||'';this[_0xc241('0x1')]=_0x305404[_0xc241('0x1')]||'';this['remoteUri']=_0x305404[_0xc241('0x2')]||'';this[_0xc241('0x3')]=_0x305404[_0xc241('0x3')]||'';this[_0xc241('0x4')]=_0x305404[_0xc241('0x4')]||'';this[_0xc241('0x5')]=_0x305404[_0xc241('0x5')]||'';this['securityToken']=_0x305404['securityToken']||'';this[_0xc241('0x6')]=_0x305404['type']||'integrationTab';this['serverUrl']=_0x305404[_0xc241('0x7')]||'';this[_0xc241('0x8')]=_0x305404[_0xc241('0x8')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xbba6=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x27559d,_0x2ed3e3){var _0x19ad50=function(_0x279757){while(--_0x279757){_0x27559d['push'](_0x27559d['shift']());}};_0x19ad50(++_0x2ed3e3);}(_0xbba6,0x1a4));var _0x6bba=function(_0x543f7b,_0x5d4e46){_0x543f7b=_0x543f7b-0x0;var _0x12e426=_0xbba6[_0x543f7b];return _0x12e426;};'use strict';function SalesforceAccount(_0x12b571){this['id']=_0x12b571['id']||0x0;this[_0x6bba('0x0')]=_0x12b571[_0x6bba('0x0')]||'';this['username']=_0x12b571[_0x6bba('0x1')]||'';this[_0x6bba('0x2')]=_0x12b571[_0x6bba('0x2')]||'';this[_0x6bba('0x3')]=_0x12b571[_0x6bba('0x3')]||'';this[_0x6bba('0x4')]=_0x12b571[_0x6bba('0x4')]||'';this[_0x6bba('0x5')]=_0x12b571[_0x6bba('0x5')]||'';this[_0x6bba('0x6')]=_0x12b571[_0x6bba('0x6')]||'';this['type']=_0x12b571[_0x6bba('0x7')]||_0x6bba('0x8');this['serverUrl']=_0x12b571[_0x6bba('0x9')]||'';this[_0x6bba('0xa')]=_0x12b571[_0x6bba('0xa')]||{};}module[_0x6bba('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index ec0ae2e..dd3045a 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 _0x7c76=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x253ab3,_0x4868fd){var _0x2b12aa=function(_0x29e40a){while(--_0x29e40a){_0x253ab3['push'](_0x253ab3['shift']());}};_0x2b12aa(++_0x4868fd);}(_0x7c76,0xac));var _0x67c7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7c76[_0x14add3];return _0x4a174f;};'use strict';function ServicenowAccount(_0x42115e){this['id']=_0x42115e['id']||0x0;this[_0x67c7('0x0')]=_0x42115e[_0x67c7('0x0')]||'';this[_0x67c7('0x1')]=_0x42115e[_0x67c7('0x1')]||'';this[_0x67c7('0x2')]=_0x42115e[_0x67c7('0x2')]||'';this['remoteUri']=_0x42115e[_0x67c7('0x3')]||'';this[_0x67c7('0x4')]=_0x42115e[_0x67c7('0x4')]||'';this[_0x67c7('0x5')]=_0x42115e[_0x67c7('0x5')]||{};}module[_0x67c7('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x29b4=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0x29b4,0x10e));var _0x429b=function(_0x1cd9eb,_0xf75868){_0x1cd9eb=_0x1cd9eb-0x0;var _0x2db8b8=_0x29b4[_0x1cd9eb];return _0x2db8b8;};'use strict';function ServicenowAccount(_0x4e41ee){this['id']=_0x4e41ee['id']||0x0;this['name']=_0x4e41ee[_0x429b('0x0')]||'';this[_0x429b('0x1')]=_0x4e41ee[_0x429b('0x1')]||'';this['password']=_0x4e41ee[_0x429b('0x2')]||'';this[_0x429b('0x3')]=_0x4e41ee[_0x429b('0x3')]||'';this[_0x429b('0x4')]=_0x4e41ee[_0x429b('0x4')]||'';this[_0x429b('0x5')]=_0x4e41ee[_0x429b('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 03eeb03..66dff02 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 _0x1afb=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x2cfb2b,_0x30c0f1){var _0x403a5c=function(_0x23f384){while(--_0x23f384){_0x2cfb2b['push'](_0x2cfb2b['shift']());}};_0x403a5c(++_0x30c0f1);}(_0x1afb,0x1e3));var _0xb1af=function(_0x556456,_0x4e0334){_0x556456=_0x556456-0x0;var _0x162b5a=_0x1afb[_0x556456];return _0x162b5a;};'use strict';function SugarcrmAccount(_0x4bd7c7){this['id']=_0x4bd7c7['id']||0x0;this[_0xb1af('0x0')]=_0x4bd7c7['name']||'';this[_0xb1af('0x1')]=_0x4bd7c7[_0xb1af('0x1')]||'';this[_0xb1af('0x2')]=_0x4bd7c7[_0xb1af('0x2')]||'';this['remoteUri']=_0x4bd7c7[_0xb1af('0x3')]||'';this[_0xb1af('0x4')]=_0x4bd7c7['serverUrl']||'';this['Configurations']=_0x4bd7c7[_0xb1af('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x6d6b=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0xe1bed7,_0x248af8){var _0x413380=function(_0x23caab){while(--_0x23caab){_0xe1bed7['push'](_0xe1bed7['shift']());}};_0x413380(++_0x248af8);}(_0x6d6b,0x165));var _0xb6d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d6b[_0x3dd15e];return _0x231fd0;};'use strict';function SugarcrmAccount(_0x22cf31){this['id']=_0x22cf31['id']||0x0;this[_0xb6d6('0x0')]=_0x22cf31['name']||'';this[_0xb6d6('0x1')]=_0x22cf31[_0xb6d6('0x1')]||'';this[_0xb6d6('0x2')]=_0x22cf31[_0xb6d6('0x2')]||'';this['remoteUri']=_0x22cf31[_0xb6d6('0x3')]||'';this[_0xb6d6('0x4')]=_0x22cf31[_0xb6d6('0x4')]||'';this[_0xb6d6('0x5')]=_0x22cf31['Configurations']||{};}module[_0xb6d6('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 0cc7afc..c30b95f 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 _0x3c8e=['exports','name','accountcode','unknown','stateTime'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3c8e,0x65));var _0xe3c8=function(_0x5ae10e,_0x923fe4){_0x5ae10e=_0x5ae10e-0x0;var _0x4517a6=_0x3c8e[_0x5ae10e];return _0x4517a6;};'use strict';function Telephone(_0x394a27){this['id']=_0x394a27['id']||0x0;this[_0xe3c8('0x0')]=_0x394a27[_0xe3c8('0x0')]||'';this[_0xe3c8('0x1')]=_0x394a27['accountcode']||'';this['state']=_0xe3c8('0x2');this[_0xe3c8('0x3')]=0x0;this['status']='unknown';this['address']='';}module[_0xe3c8('0x4')]=Telephone; \ No newline at end of file +var _0x5eb8=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0x6714ea,_0x30829f){var _0x1fe7a0=function(_0x14aa19){while(--_0x14aa19){_0x6714ea['push'](_0x6714ea['shift']());}};_0x1fe7a0(++_0x30829f);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3861f7,_0x995b22){_0x3861f7=_0x3861f7-0x0;var _0x50879f=_0x5eb8[_0x3861f7];return _0x50879f;};'use strict';function Telephone(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||'';this[_0x85eb('0x2')]=_0x85eb('0x3');this[_0x85eb('0x4')]=0x0;this[_0x85eb('0x5')]=_0x85eb('0x3');this[_0x85eb('0x6')]='';}module[_0x85eb('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index df50026..ace17e0 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(_0x45a54f,_0x176e36){var _0x5243d8=function(_0xa9788){while(--_0xa9788){_0x45a54f['push'](_0x45a54f['shift']());}};_0x5243d8(++_0x176e36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 _0xb10b=['name','html'];(function(_0x3c2320,_0x583f9e){var _0x19ae25=function(_0x2f7d43){while(--_0x2f7d43){_0x3c2320['push'](_0x3c2320['shift']());}};_0x19ae25(++_0x583f9e);}(_0xb10b,0x12a));var _0xbb10=function(_0x45f4e9,_0x5246fd){_0x45f4e9=_0x45f4e9-0x0;var _0x559d8f=_0xb10b[_0x45f4e9];return _0x559d8f;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 4b10010..e9714fd 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 _0xda3f=['Actions','name','status','AllConditions','AnyConditions'];(function(_0x4f0783,_0x32c7c4){var _0x2f979c=function(_0x383686){while(--_0x383686){_0x4f0783['push'](_0x4f0783['shift']());}};_0x2f979c(++_0x32c7c4);}(_0xda3f,0xec));var _0xfda3=function(_0x31b381,_0x1eed84){_0x31b381=_0x31b381-0x0;var _0x24bc18=_0xda3f[_0x31b381];return _0x24bc18;};'use strict';function Trigger(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['channel']=_0x33f0ce['channel']||'voice';this[_0xfda3('0x1')]=_0x33f0ce['status']||![];this[_0xfda3('0x2')]=_0x33f0ce[_0xfda3('0x2')]||[];this['AnyConditions']=_0x33f0ce[_0xfda3('0x3')]||[];this[_0xfda3('0x4')]=_0x33f0ce['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x5af5fd,_0x4688ee){var _0x1d9ca1=function(_0x565fd5){while(--_0x565fd5){_0x5af5fd['push'](_0x5af5fd['shift']());}};_0x1d9ca1(++_0x4688ee);}(_0xda2d,0x102));var _0xdda2=function(_0x1cac8f,_0x5b508e){_0x1cac8f=_0x1cac8f-0x0;var _0x16ae30=_0xda2d[_0x1cac8f];return _0x16ae30;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 6aea8e7..cc91cbe 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 _0x4074=['defaultuser','exports','active','name','state','unknown','stateTime','registry','indexOf','split','host','port','domain','domainport','stateRegistry','registrationtime'];(function(_0x173ec0,_0x4374db){var _0xcbf53d=function(_0xa9c504){while(--_0xa9c504){_0x173ec0['push'](_0x173ec0['shift']());}};_0xcbf53d(++_0x4374db);}(_0x4074,0xf2));var _0x4407=function(_0x273dec,_0x41eecc){_0x273dec=_0x273dec-0x0;var _0x39012c=_0x4074[_0x273dec];return _0x39012c;};'use strict';function Trunk(_0x16fdd7){this['id']=_0x16fdd7['id']||0x0;this['active']=_0x16fdd7[_0x4407('0x0')]||![];this[_0x4407('0x1')]=_0x16fdd7[_0x4407('0x1')]||'';this[_0x4407('0x2')]=_0x4407('0x3');this[_0x4407('0x4')]=0x0;this['status']='unknown';this[_0x4407('0x5')]=_0x16fdd7[_0x4407('0x5')]&&_0x16fdd7['registry'][_0x4407('0x6')](':')?_0x16fdd7[_0x4407('0x5')][_0x4407('0x7')](':')[0x0]:'';this[_0x4407('0x8')]='';this[_0x4407('0x9')]='';this[_0x4407('0xa')]='';this[_0x4407('0xb')]='';this['refresh']='';this[_0x4407('0xc')]=_0x4407('0x3');this[_0x4407('0xd')]='';this['address']='';this[_0x4407('0xe')]=_0x16fdd7[_0x4407('0xe')]||'';}module[_0x4407('0xf')]=Trunk; \ No newline at end of file +var _0xb995=['active','name','state','unknown','stateTime','status','registry','indexOf','split','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports'];(function(_0x4791ee,_0x250d86){var _0x1eb3bc=function(_0x5e94f8){while(--_0x5e94f8){_0x4791ee['push'](_0x4791ee['shift']());}};_0x1eb3bc(++_0x250d86);}(_0xb995,0xd0));var _0x5b99=function(_0x4b72ee,_0x3f79e8){_0x4b72ee=_0x4b72ee-0x0;var _0x15f486=_0xb995[_0x4b72ee];return _0x15f486;};'use strict';function Trunk(_0x10024d){this['id']=_0x10024d['id']||0x0;this[_0x5b99('0x0')]=_0x10024d[_0x5b99('0x0')]||![];this[_0x5b99('0x1')]=_0x10024d['name']||'';this[_0x5b99('0x2')]=_0x5b99('0x3');this[_0x5b99('0x4')]=0x0;this[_0x5b99('0x5')]='unknown';this['registry']=_0x10024d[_0x5b99('0x6')]&&_0x10024d[_0x5b99('0x6')][_0x5b99('0x7')](':')?_0x10024d[_0x5b99('0x6')][_0x5b99('0x8')](':')[0x0]:'';this['host']='';this['port']='';this['domain']='';this[_0x5b99('0x9')]='';this[_0x5b99('0xa')]='';this[_0x5b99('0xb')]=_0x5b99('0x3');this[_0x5b99('0xc')]='';this[_0x5b99('0xd')]='';this[_0x5b99('0xe')]=_0x10024d[_0x5b99('0xe')]||'';}module[_0x5b99('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index c271f2d..e61c27d 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 _0x532e=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x10d897,_0x2d6c6d){var _0x3e591b=function(_0xb43f2a){while(--_0xb43f2a){_0x10d897['push'](_0x10d897['shift']());}};_0x3e591b(++_0x2d6c6d);}(_0x532e,0x93));var _0xe532=function(_0x4118f7,_0x457d15){_0x4118f7=_0x4118f7-0x0;var _0x342eb5=_0x532e[_0x4118f7];return _0x342eb5;};'use strict';function voiceExtension(_0x508208){this['id']=_0x508208['id']||0x0;this[_0xe532('0x0')]=_0x508208[_0xe532('0x0')]||'';this[_0xe532('0x1')]=_0x508208[_0xe532('0x1')]||_0xe532('0x2');this[_0xe532('0x3')]=_0x508208['mandatoryDisposition']||![];}module[_0xe532('0x4')]=voiceExtension; \ No newline at end of file +var _0x8c14=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x8c14,0x189));var _0x48c1=function(_0x1523b4,_0x3a0c95){_0x1523b4=_0x1523b4-0x0;var _0x5426e8=_0x8c14[_0x1523b4];return _0x5426e8;};'use strict';function voiceExtension(_0x122c53){this['id']=_0x122c53['id']||0x0;this[_0x48c1('0x0')]=_0x122c53[_0x48c1('0x0')]||'';this['recordingFormat']=_0x122c53[_0x48c1('0x1')]||_0x48c1('0x2');this[_0x48c1('0x3')]=_0x122c53[_0x48c1('0x3')]||![];}module[_0x48c1('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 e1dfac9..638ce95 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 _0xf18a=['dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','rrmemory','rrordered','wrandom','name','monitor_format','type','total','answered','sumDuration','unmanaged','abandoned','busy','inUse','invalid','loggedIn','notInUse','onHold','paused','ringing','talking','unavailable','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x1e6407,_0x57f263){var _0x5462a0=function(_0x1ab675){while(--_0x1ab675){_0x1e6407['push'](_0x1e6407['shift']());}};_0x5462a0(++_0x57f263);}(_0xf18a,0x19d));var _0xaf18=function(_0x3e18b4,_0x3ed3ba){_0x3e18b4=_0x3e18b4-0x0;var _0x54fb25=_0xf18a[_0x3e18b4];return _0x54fb25;};'use strict';var monitorFormat={'wav':_0xaf18('0x0'),'wav49':_0xaf18('0x1'),'gsm':_0xaf18('0x2')};var strategy={'fewestcalls':_0xaf18('0x3'),'leastrecent':_0xaf18('0x4'),'linear':_0xaf18('0x5'),'random':'random','ringall':'ringall','rr':'roundrobin','rrmemory':_0xaf18('0x6'),'rrordered':_0xaf18('0x7'),'wrandom':_0xaf18('0x8')};function VoiceQueue(_0x594367){this['id']=_0x594367['id']||0x0;this['name']=_0x594367[_0xaf18('0x9')]||'';this['monitor_format']=_0x594367[_0xaf18('0xa')]||'';this[_0xaf18('0xb')]=_0x594367[_0xaf18('0xb')]||'inbound';this['waiting']=0x0;this[_0xaf18('0xc')]=0x0;this[_0xaf18('0xd')]=0x0;this[_0xaf18('0xe')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0xaf18('0xf')]=0x0;this[_0xaf18('0x10')]=0x0;this['available']=0x0;this[_0xaf18('0x11')]=0x0;this[_0xaf18('0x12')]=0x0;this[_0xaf18('0x13')]=0x0;this[_0xaf18('0x14')]=0x0;this[_0xaf18('0x15')]=0x0;this[_0xaf18('0x16')]=0x0;this[_0xaf18('0x17')]=0x0;this[_0xaf18('0x18')]=0x0;this['ringInUse']=0x0;this[_0xaf18('0x19')]=0x0;this[_0xaf18('0x1a')]=0x0;this['unknown']=0x0;this[_0xaf18('0x1b')]=_0x594367[_0xaf18('0x1b')]||![];this[_0xaf18('0x1c')]=_0x594367['acwTimeout']||0xa;this[_0xaf18('0x1d')]=_0x594367['autopause']||'no';this[_0xaf18('0x1e')]=!![];this[_0xaf18('0x1f')]='';this[_0xaf18('0x20')]='';this['originated']=0x0;this[_0xaf18('0x21')]=0x0;this['dialTimezone']=_0x594367[_0xaf18('0x22')]||null;this[_0xaf18('0x23')]=_0x594367['dialGlobalInterval']?_0x594367['dialGlobalInterval']:null;this[_0xaf18('0x24')]=_0x594367[_0xaf18('0x24')];this[_0xaf18('0x25')]=_0x594367[_0xaf18('0x25')]||_0xaf18('0x26');this['dialLimitChannel']=_0x594367[_0xaf18('0x27')]||0x0;this['dialLimitQueue']=_0x594367[_0xaf18('0x28')]||0x0;this[_0xaf18('0x29')]=_0x594367[_0xaf18('0x29')]||0x1;this[_0xaf18('0x2a')]=_0x594367[_0xaf18('0x2a')]||_0xaf18('0x2b');this[_0xaf18('0x2c')]=_0x594367[_0xaf18('0x2c')]||0.03;this[_0xaf18('0x2d')]=_0x594367[_0xaf18('0x2d')]||0x258;this['dialOriginateCallerIdName']=_0x594367[_0xaf18('0x2e')]||_0xaf18('0x2f');this[_0xaf18('0x30')]=_0x594367[_0xaf18('0x30')]||_0xaf18('0x2f');this[_0xaf18('0x31')]=_0x594367[_0xaf18('0x31')]||0x1e;this[_0xaf18('0x32')]=_0x594367['dialQueueOptions']||_0xaf18('0x33');this[_0xaf18('0x34')]=_0x594367['dialQueueTimeout']||0x3;this[_0xaf18('0x35')]=_0x594367['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x594367[_0xaf18('0x36')]||0x3;this[_0xaf18('0x37')]=_0x594367[_0xaf18('0x37')]||0x96;this[_0xaf18('0x38')]=_0x594367[_0xaf18('0x38')]||0x3;this[_0xaf18('0x39')]=_0x594367[_0xaf18('0x39')]||0x96;this[_0xaf18('0x3a')]=_0x594367[_0xaf18('0x3a')]||0x3;this[_0xaf18('0x3b')]=_0x594367[_0xaf18('0x3b')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x594367[_0xaf18('0x3c')]||0x3;this[_0xaf18('0x3d')]=_0x594367[_0xaf18('0x3d')]||0x96;this['dialDropMaxRetry']=_0x594367['dialDropMaxRetry']||0x3;this[_0xaf18('0x3e')]=_0x594367[_0xaf18('0x3e')]||0x96;this[_0xaf18('0x3f')]=_0x594367[_0xaf18('0x3f')]||0x3;this['dialAbandonedRetryFrequency']=_0x594367[_0xaf18('0x40')]||0x96;this[_0xaf18('0x41')]=_0x594367[_0xaf18('0x41')]||0x3;this['dialMachineRetryFrequency']=_0x594367[_0xaf18('0x42')]||0x96;this[_0xaf18('0x43')]=_0x594367[_0xaf18('0x43')]||0x3;this[_0xaf18('0x44')]=_0x594367[_0xaf18('0x44')]||0x96;this[_0xaf18('0x45')]=_0x594367[_0xaf18('0x45')]||0x3;this[_0xaf18('0x46')]=_0x594367['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x594367[_0xaf18('0x47')]?_0x594367['Trunk']:undefined;this['TrunkBackup']=_0x594367['TrunkBackup']?_0x594367[_0xaf18('0x48')]:undefined;this[_0xaf18('0x49')]=_0x594367[_0xaf18('0x49')]||undefined;this[_0xaf18('0x4a')]=_0x594367[_0xaf18('0x4a')]?_0x594367['Interval']:undefined;this[_0xaf18('0x4b')]=_0x594367['dialOrderByScheduledAt']||_0xaf18('0x4c');this[_0xaf18('0x4d')]=_0x594367[_0xaf18('0x4d')]||undefined;this[_0xaf18('0x4e')]=_0x594367['dialCutDigit']||undefined;this[_0xaf18('0x4f')]=strategy[_0x594367['strategy']];this['queueStatusComplete']=!![];this[_0xaf18('0x50')]=_0x594367[_0xaf18('0x50')]||![];this[_0xaf18('0x51')]=_0x594367[_0xaf18('0x51')];this['dialAMDGreeting']=_0x594367['dialAMDGreeting'];this[_0xaf18('0x52')]=_0x594367['dialAMDAfterGreetingSilence'];this[_0xaf18('0x53')]=_0x594367['dialAMDTotalAnalysisTime'];this[_0xaf18('0x54')]=_0x594367[_0xaf18('0x54')];this[_0xaf18('0x55')]=_0x594367['dialAMDBetweenWordsSilence'];this[_0xaf18('0x56')]=_0x594367['dialAMDMaximumNumberOfWords'];this[_0xaf18('0x57')]=_0x594367['dialAMDSilenceThreshold'];this[_0xaf18('0x58')]=_0x594367[_0xaf18('0x58')];this[_0xaf18('0x59')]=0x0;this['pTalking']=0x0;this[_0xaf18('0x5a')]=_0x594367[_0xaf18('0x5a')];this[_0xaf18('0x5b')]=0x0;this[_0xaf18('0x5c')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xaf18('0x5d')]=0x0;this[_0xaf18('0x5e')]=0x0;this[_0xaf18('0x5f')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xaf18('0x60')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xaf18('0x61')]=0x0;this['outboundReCallsDay']=0x0;this[_0xaf18('0x62')]=0x0;this[_0xaf18('0x63')]=undefined;this[_0xaf18('0x64')]=undefined;this[_0xaf18('0x65')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xaf18('0x66')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xaf18('0x67')]=0x0;this[_0xaf18('0x68')]=0x0;this[_0xaf18('0x69')]=0x0;this[_0xaf18('0x6a')]=0x0;this[_0xaf18('0x6b')]=0x0;this[_0xaf18('0x6c')]=_0x594367['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xaf18('0x6d')]=_0x594367[_0xaf18('0x6e')]||0xa;this[_0xaf18('0x6f')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0xaf18('0x70')]=0x0;this[_0xaf18('0x71')]=0x0;this[_0xaf18('0x72')]=0x0;this['dialRecallMeTimeout']=_0x594367['dialRecallMeTimeout']||0x1e;this[_0xaf18('0x73')]=_0x594367[_0xaf18('0x73')]||![];this['dialPreviewAutoRecallMe']=!!_0x594367[_0xaf18('0x74')]||![];this[_0xaf18('0x75')]=!!_0x594367[_0xaf18('0x75')]||![];this[_0xaf18('0x76')]=_0x594367['dialQueueProject2']||undefined;this[_0xaf18('0x77')]=_0x594367['dialAgiAfterHangupClient']||![];this[_0xaf18('0x78')]=_0x594367[_0xaf18('0x78')]||![];this[_0xaf18('0xa')]=monitorFormat[_0x594367['monitor_format']]?monitorFormat[_0x594367[_0xaf18('0xa')]]:undefined;this[_0xaf18('0x79')]=_0x594367[_0xaf18('0x79')]||![];this[_0xaf18('0x7a')]=_0x594367['mandatoryDispositionPause']?_0x594367[_0xaf18('0x7a')]:undefined;this[_0xaf18('0x7b')]=![];}module[_0xaf18('0x7c')]=VoiceQueue; \ No newline at end of file +var _0xcddb=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','linear','ringall','roundrobin','rrmemory','rrordered','name','monitor_format','type','total','answered','sumDuration','sumBillable','unmanaged','abandoned','available','inUse','invalid','notInUse','onHold','ringing','ringInUse','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency'];(function(_0x26c112,_0x41e2fd){var _0x4933d8=function(_0x5d33ab){while(--_0x5d33ab){_0x26c112['push'](_0x26c112['shift']());}};_0x4933d8(++_0x41e2fd);}(_0xcddb,0x1c4));var _0xbcdd=function(_0x52f0a6,_0xa3c19f){_0x52f0a6=_0x52f0a6-0x0;var _0x2dcee6=_0xcddb[_0x52f0a6];return _0x2dcee6;};'use strict';var monitorFormat={'wav':_0xbcdd('0x0'),'wav49':_0xbcdd('0x1'),'gsm':_0xbcdd('0x2')};var strategy={'fewestcalls':'fewestcalls','leastrecent':'leastrecent','linear':_0xbcdd('0x3'),'random':'random','ringall':_0xbcdd('0x4'),'rr':_0xbcdd('0x5'),'rrmemory':_0xbcdd('0x6'),'rrordered':_0xbcdd('0x7'),'wrandom':'wrandom'};function VoiceQueue(_0x1ee9da){this['id']=_0x1ee9da['id']||0x0;this['name']=_0x1ee9da[_0xbcdd('0x8')]||'';this[_0xbcdd('0x9')]=_0x1ee9da['monitor_format']||'';this[_0xbcdd('0xa')]=_0x1ee9da[_0xbcdd('0xa')]||'inbound';this['waiting']=0x0;this[_0xbcdd('0xb')]=0x0;this[_0xbcdd('0xc')]=0x0;this[_0xbcdd('0xd')]=0x0;this['sumHoldTime']=0x0;this[_0xbcdd('0xe')]=0x0;this[_0xbcdd('0xf')]=0x0;this[_0xbcdd('0x10')]=0x0;this[_0xbcdd('0x11')]=0x0;this['busy']=0x0;this[_0xbcdd('0x12')]=0x0;this[_0xbcdd('0x13')]=0x0;this['loggedIn']=0x0;this[_0xbcdd('0x14')]=0x0;this[_0xbcdd('0x15')]=0x0;this['paused']=0x0;this[_0xbcdd('0x16')]=0x0;this[_0xbcdd('0x17')]=0x0;this['talking']=0x0;this['unavailable']=0x0;this[_0xbcdd('0x18')]=0x0;this[_0xbcdd('0x19')]=_0x1ee9da[_0xbcdd('0x19')]||![];this[_0xbcdd('0x1a')]=_0x1ee9da[_0xbcdd('0x1a')]||0xa;this['autopause']=_0x1ee9da[_0xbcdd('0x1b')]||'no';this[_0xbcdd('0x1c')]=!![];this['message']='';this[_0xbcdd('0x1d')]='';this['originated']=0x0;this[_0xbcdd('0x1e')]=0x0;this[_0xbcdd('0x1f')]=_0x1ee9da[_0xbcdd('0x1f')]||null;this[_0xbcdd('0x20')]=_0x1ee9da[_0xbcdd('0x20')]?_0x1ee9da[_0xbcdd('0x20')]:null;this[_0xbcdd('0x21')]=_0x1ee9da[_0xbcdd('0x21')];this[_0xbcdd('0x22')]=_0x1ee9da['dialMethod']||_0xbcdd('0x23');this[_0xbcdd('0x24')]=_0x1ee9da[_0xbcdd('0x24')]||0x0;this[_0xbcdd('0x25')]=_0x1ee9da[_0xbcdd('0x25')]||0x0;this[_0xbcdd('0x26')]=_0x1ee9da['dialPowerLevel']||0x1;this[_0xbcdd('0x27')]=_0x1ee9da['dialPredictiveOptimization']||_0xbcdd('0x28');this[_0xbcdd('0x29')]=_0x1ee9da[_0xbcdd('0x29')]||0.03;this[_0xbcdd('0x2a')]=_0x1ee9da['dialPredictiveInterval']||0x258;this[_0xbcdd('0x2b')]=_0x1ee9da[_0xbcdd('0x2b')]||_0xbcdd('0x2c');this[_0xbcdd('0x2d')]=_0x1ee9da['dialOriginateCallerIdNumber']||_0xbcdd('0x2c');this[_0xbcdd('0x2e')]=_0x1ee9da[_0xbcdd('0x2e')]||0x1e;this[_0xbcdd('0x2f')]=_0x1ee9da[_0xbcdd('0x2f')]||'tTxX';this[_0xbcdd('0x30')]=_0x1ee9da[_0xbcdd('0x30')]||0x3;this[_0xbcdd('0x31')]=_0x1ee9da[_0xbcdd('0x31')]||undefined;this[_0xbcdd('0x32')]=_0x1ee9da['dialCongestionMaxRetry']||0x3;this[_0xbcdd('0x33')]=_0x1ee9da[_0xbcdd('0x33')]||0x96;this['dialBusyMaxRetry']=_0x1ee9da[_0xbcdd('0x34')]||0x3;this[_0xbcdd('0x35')]=_0x1ee9da[_0xbcdd('0x35')]||0x96;this[_0xbcdd('0x36')]=_0x1ee9da[_0xbcdd('0x36')]||0x3;this['dialNoAnswerRetryFrequency']=_0x1ee9da[_0xbcdd('0x37')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x1ee9da['dialNoSuchNumberMaxRetry']||0x3;this[_0xbcdd('0x38')]=_0x1ee9da[_0xbcdd('0x38')]||0x96;this['dialDropMaxRetry']=_0x1ee9da[_0xbcdd('0x39')]||0x3;this[_0xbcdd('0x3a')]=_0x1ee9da[_0xbcdd('0x3a')]||0x96;this[_0xbcdd('0x3b')]=_0x1ee9da[_0xbcdd('0x3b')]||0x3;this[_0xbcdd('0x3c')]=_0x1ee9da[_0xbcdd('0x3c')]||0x96;this[_0xbcdd('0x3d')]=_0x1ee9da[_0xbcdd('0x3d')]||0x3;this['dialMachineRetryFrequency']=_0x1ee9da[_0xbcdd('0x3e')]||0x96;this[_0xbcdd('0x3f')]=_0x1ee9da['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x1ee9da[_0xbcdd('0x40')]||0x96;this[_0xbcdd('0x41')]=_0x1ee9da['callAdditionalPhoneAfterMin']||0x3;this[_0xbcdd('0x42')]=_0x1ee9da['dialGlobalMaxRetry']||0x4;this[_0xbcdd('0x43')]=_0x1ee9da['Trunk']?_0x1ee9da[_0xbcdd('0x43')]:undefined;this['TrunkBackup']=_0x1ee9da[_0xbcdd('0x44')]?_0x1ee9da[_0xbcdd('0x44')]:undefined;this['dialPrefix']=_0x1ee9da[_0xbcdd('0x45')]||undefined;this[_0xbcdd('0x46')]=_0x1ee9da[_0xbcdd('0x46')]?_0x1ee9da[_0xbcdd('0x46')]:undefined;this[_0xbcdd('0x47')]=_0x1ee9da['dialOrderByScheduledAt']||_0xbcdd('0x48');this['dialRandomLastDigitCallerIdNumber']=_0x1ee9da[_0xbcdd('0x49')]||undefined;this[_0xbcdd('0x4a')]=_0x1ee9da['dialCutDigit']||undefined;this['strategy']=strategy[_0x1ee9da[_0xbcdd('0x4b')]];this['queueStatusComplete']=!![];this[_0xbcdd('0x4c')]=_0x1ee9da[_0xbcdd('0x4c')]||![];this[_0xbcdd('0x4d')]=_0x1ee9da['dialAMDInitialSilence'];this[_0xbcdd('0x4e')]=_0x1ee9da[_0xbcdd('0x4e')];this[_0xbcdd('0x4f')]=_0x1ee9da[_0xbcdd('0x4f')];this[_0xbcdd('0x50')]=_0x1ee9da[_0xbcdd('0x50')];this[_0xbcdd('0x51')]=_0x1ee9da[_0xbcdd('0x51')];this[_0xbcdd('0x52')]=_0x1ee9da[_0xbcdd('0x52')];this[_0xbcdd('0x53')]=_0x1ee9da[_0xbcdd('0x53')];this['dialAMDSilenceThreshold']=_0x1ee9da[_0xbcdd('0x54')];this[_0xbcdd('0x55')]=_0x1ee9da[_0xbcdd('0x55')];this[_0xbcdd('0x56')]=0x0;this[_0xbcdd('0x57')]=0x0;this[_0xbcdd('0x58')]=_0x1ee9da['timeout'];this[_0xbcdd('0x59')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xbcdd('0x5a')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xbcdd('0x5b')]=0x0;this[_0xbcdd('0x5c')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xbcdd('0x5d')]=0x0;this[_0xbcdd('0x5e')]=0x0;this[_0xbcdd('0x5f')]=0x0;this[_0xbcdd('0x60')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0xbcdd('0x61')]=0x0;this[_0xbcdd('0x62')]=undefined;this[_0xbcdd('0x63')]=undefined;this['handlePredictive']=undefined;this[_0xbcdd('0x64')]=1.05;this[_0xbcdd('0x65')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xbcdd('0x66')]=0x0;this[_0xbcdd('0x67')]=0x0;this[_0xbcdd('0x68')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xbcdd('0x69')]=0x0;this[_0xbcdd('0x6a')]=0x0;this[_0xbcdd('0x6b')]=_0x1ee9da['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xbcdd('0x6c')]=_0x1ee9da[_0xbcdd('0x6d')]||0xa;this[_0xbcdd('0x6e')]=0x0;this[_0xbcdd('0x6f')]=0x0;this[_0xbcdd('0x70')]=0x1;this[_0xbcdd('0x71')]=0x0;this[_0xbcdd('0x72')]=0x0;this[_0xbcdd('0x73')]=0x0;this[_0xbcdd('0x74')]=0x0;this[_0xbcdd('0x75')]=_0x1ee9da[_0xbcdd('0x75')]||0x1e;this[_0xbcdd('0x76')]=_0x1ee9da['dialRecallInQueue']||![];this[_0xbcdd('0x77')]=!!_0x1ee9da['dialPreviewAutoRecallMe']||![];this[_0xbcdd('0x78')]=!!_0x1ee9da[_0xbcdd('0x78')]||![];this['dialQueueProject2']=_0x1ee9da[_0xbcdd('0x79')]||undefined;this[_0xbcdd('0x7a')]=_0x1ee9da[_0xbcdd('0x7a')]||![];this[_0xbcdd('0x7b')]=_0x1ee9da[_0xbcdd('0x7b')]||![];this['monitor_format']=monitorFormat[_0x1ee9da[_0xbcdd('0x9')]]?monitorFormat[_0x1ee9da[_0xbcdd('0x9')]]:undefined;this['mandatoryDisposition']=_0x1ee9da['mandatoryDisposition']||![];this[_0xbcdd('0x7c')]=_0x1ee9da[_0xbcdd('0x7c')]?_0x1ee9da[_0xbcdd('0x7c')]:undefined;this[_0xbcdd('0x7d')]=![];}module[_0xbcdd('0x7e')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index ec2fc0b..2e7e75b 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x044a=['length','SIP/','online','includes','status','booked','keys','queue','dialer','xcally-motion-preview','some','message','updateReportFromOutboundQueue','preview','exports','available','loggedIn','loggedInDb','paused','ringing','talking','waiting','answered','inUse','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumBillable','sumDuration','total','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','statusMessage','Trunk','name','active','prototype','createReport','loggedin','callers'];(function(_0x27f94c,_0x500be8){var _0x40b5a8=function(_0x39d948){while(--_0x39d948){_0x27f94c['push'](_0x27f94c['shift']());}};_0x40b5a8(++_0x500be8);}(_0x044a,0x173));var _0xa044=function(_0x39f38b,_0x4b75df){_0x39f38b=_0x39f38b-0x0;var _0x364c61=_0x044a[_0x39f38b];return _0x364c61;};'use strict';var INBOUND_COUNTERS=[_0xa044('0x0'),_0xa044('0x1'),_0xa044('0x2'),_0xa044('0x3'),_0xa044('0x4'),_0xa044('0x5'),_0xa044('0x6')];var OUTBOUND_COUNTERS=[_0xa044('0x0'),_0xa044('0x7'),_0xa044('0x8'),'loggedIn',_0xa044('0x2'),_0xa044('0x9'),_0xa044('0xa'),_0xa044('0xb'),'outboundBlacklistCallsDay',_0xa044('0xc'),_0xa044('0xd'),_0xa044('0xe'),_0xa044('0xf'),'outboundReCallsDay',_0xa044('0x10'),_0xa044('0x11'),_0xa044('0x3'),'pTalking',_0xa044('0x5'),_0xa044('0x12'),_0xa044('0x13'),_0xa044('0x14'),'waiting'];function VoiceQueueSummary(_0x195edf){this['id']=_0x195edf['id'];this['name']=_0x195edf['name'];this[_0xa044('0x15')]=_0x195edf[_0xa044('0x15')];this[_0xa044('0x16')]=_0x195edf[_0xa044('0x16')]||0x0;this[_0xa044('0x7')]=_0x195edf[_0xa044('0x7')]||0x0;this[_0xa044('0x0')]=_0x195edf['available']||0x0;this[_0xa044('0x17')]=_0x195edf['busy']||0x0;this[_0xa044('0x8')]=_0x195edf[_0xa044('0x8')]||0x0;this[_0xa044('0x18')]=_0x195edf[_0xa044('0x18')]||0x0;this[_0xa044('0x1')]=_0x195edf['loggedIn']||0x0;this['loggedInDb']=_0x195edf[_0xa044('0x2')]||0x0;this['onHold']=_0x195edf[_0xa044('0x19')]||0x0;this[_0xa044('0x1a')]=_0x195edf[_0xa044('0x1a')]||0x0;this[_0xa044('0x3')]=_0x195edf[_0xa044('0x3')]||0x0;this['ringing']=_0x195edf['ringing']||0x0;this['ringInUse']=_0x195edf[_0xa044('0x1b')];this[_0xa044('0x12')]=_0x195edf[_0xa044('0x12')];this['sumDuration']=_0x195edf[_0xa044('0x13')];this[_0xa044('0x1c')]=_0x195edf['sumHoldTime']||0x0;this[_0xa044('0x5')]=_0x195edf[_0xa044('0x5')]||0x0;this[_0xa044('0x14')]=_0x195edf['total']||0x0;this[_0xa044('0x1d')]=_0x195edf[_0xa044('0x1d')];this[_0xa044('0x1e')]=_0x195edf[_0xa044('0x1e')]||0x0;this[_0xa044('0x1f')]=_0x195edf[_0xa044('0x1f')]||0x0;this[_0xa044('0x20')]=_0x195edf[_0xa044('0x20')]||0x0;this[_0xa044('0x6')]=_0x195edf['waiting']||0x0;if(_0x195edf['type']===_0xa044('0x21')){this[_0xa044('0x22')]=_0x195edf[_0xa044('0x22')]||0x0;this['dialActive']=_0x195edf[_0xa044('0x23')];this[_0xa044('0x24')]=_0x195edf['dialMethod'];this[_0xa044('0x25')]=_0x195edf[_0xa044('0x25')];this['dialOriginateCallerIdNumber']=_0x195edf[_0xa044('0x26')];this[_0xa044('0x27')]=_0x195edf['dialOriginateTimeout'];this['dialPrefix']=_0x195edf['dialPrefix'];this[_0xa044('0x28')]=_0x195edf[_0xa044('0x28')];this[_0xa044('0x29')]=_0x195edf['outboundAnswerAgiCallsDay'];this[_0xa044('0xb')]=_0x195edf[_0xa044('0xb')];this['outboundBlacklistCallsDay']=_0x195edf[_0xa044('0x2a')];this['outboundBusyCallsDay']=_0x195edf['outboundBusyCallsDay'];this[_0xa044('0xd')]=_0x195edf['outboundCongestionCallsDay'];this[_0xa044('0x2b')]=_0x195edf[_0xa044('0x2b')];this[_0xa044('0x2c')]=_0x195edf[_0xa044('0x2c')];this[_0xa044('0x2d')]=_0x195edf[_0xa044('0x2d')];this['outboundNoAnswerCallsDay']=_0x195edf[_0xa044('0xe')];this[_0xa044('0xf')]=_0x195edf[_0xa044('0xf')];this[_0xa044('0x2e')]=_0x195edf['outboundOriginateFailureCallsDay'];this[_0xa044('0x2f')]=_0x195edf[_0xa044('0x2f')];this['outboundRejectCallsDay']=_0x195edf['outboundRejectCallsDay'];this[_0xa044('0x11')]=_0x195edf[_0xa044('0x11')];this['predictiveIntervalAnsweredCalls']=_0x195edf[_0xa044('0x30')];this[_0xa044('0x31')]=_0x195edf[_0xa044('0x31')];this['predictiveIntervalAvgTalktime']=_0x195edf[_0xa044('0x32')];this[_0xa044('0x33')]=_0x195edf[_0xa044('0x33')];this[_0xa044('0x34')]=_0x195edf[_0xa044('0x34')];this['predictiveIntervalErlangCalls']=_0x195edf[_0xa044('0x35')];this[_0xa044('0x36')]=_0x195edf[_0xa044('0x36')];this['predictiveIntervalHitRate']=_0x195edf[_0xa044('0x37')];this[_0xa044('0x38')]=_0x195edf['predictiveIntervalMultiplicativeFactor'];this[_0xa044('0x39')]=_0x195edf[_0xa044('0x39')];this[_0xa044('0x3a')]=_0x195edf[_0xa044('0x3a')];this[_0xa044('0x3b')]=_0x195edf[_0xa044('0x3b')];this[_0xa044('0x9')]=_0x195edf[_0xa044('0x9')];this['erlangCalls']=_0x195edf[_0xa044('0x3c')];this[_0xa044('0x3d')]=_0x195edf[_0xa044('0x3d')];this[_0xa044('0x3e')]=_0x195edf[_0xa044('0x3e')];this['erlangBusyFactor']=_0x195edf[_0xa044('0x3f')];this['startPredictive']=_0x195edf[_0xa044('0x40')];this[_0xa044('0x41')]=_0x195edf['startProgressive'];this['message']=_0x195edf['message'];this[_0xa044('0x42')]=_0x195edf[_0xa044('0x42')];}if(_0x195edf[_0xa044('0x43')]){this[_0xa044('0x43')]={'id':_0x195edf[_0xa044('0x43')]['id'],'name':_0x195edf[_0xa044('0x43')][_0xa044('0x44')],'active':_0x195edf[_0xa044('0x43')][_0xa044('0x45')],'callerid':_0x195edf[_0xa044('0x43')]['callerid']};}}VoiceQueueSummary[_0xa044('0x46')][_0xa044('0x47')]=function(_0x1e84c1,_0x7d768b,_0xde6a4c,_0x1295c0){this[_0xa044('0x2')]=0x0;this[_0xa044('0x5')]=0x0;this[_0xa044('0x3')]=0x0;this[_0xa044('0x1f')]=0x0;this['notInUse']=0x0;this['inUse']=0x0;this[_0xa044('0x17')]=0x0;this['invalid']=0x0;this[_0xa044('0x1e')]=0x0;this[_0xa044('0x4')]=0x0;this[_0xa044('0x1b')]=0x0;this[_0xa044('0x19')]=0x0;if(_0xde6a4c){if(_0xde6a4c[_0xa044('0x0')]){this[_0xa044('0x0')]=Number(_0xde6a4c['available']);}if(_0xde6a4c[_0xa044('0x48')]){this['loggedIn']=Number(_0xde6a4c[_0xa044('0x48')]);}if(_0xde6a4c[_0xa044('0x49')]){this[_0xa044('0x6')]=Number(_0xde6a4c['callers']);}}for(var _0x543e64=0x0;_0x543e64<_0x1e84c1[_0xa044('0x4a')];_0x543e64++){var _0x1e4a4f=_0x7d768b[_0xa044('0x4b')+_0x1e84c1[_0x543e64][_0xa044('0x44')]];if(_0x1e4a4f&&_0x1e4a4f[_0xa044('0x4c')]){this[_0xa044('0x2')]+=0x1;}if(_0x1e84c1[_0x543e64]['incall']==='1'){this[_0xa044('0x5')]+=0x1;}if(_0x1e84c1[_0x543e64][_0xa044('0x3')]==='1'&&!['2','7','8'][_0xa044('0x4d')](_0x1e84c1[_0x543e64][_0xa044('0x4e')])){this[_0xa044('0x3')]+=0x1;}switch(_0x1e84c1[_0x543e64][_0xa044('0x4e')]){case'0':this[_0xa044('0x1f')]+=0x1;break;case'1':this[_0xa044('0x1a')]+=0x1;break;case'2':this[_0xa044('0x8')]+=0x1;break;case'3':this[_0xa044('0x17')]+=0x1;break;case'4':this[_0xa044('0x18')]+=0x1;break;case'5':this[_0xa044('0x1e')]+=0x1;break;case'6':this[_0xa044('0x4')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0xa044('0x19')]+=0x1;break;}}if(this[_0xa044('0x24')]===_0xa044('0x4f')){var _0x228fc0=Object[_0xa044('0x50')](_0x1295c0);for(var _0x230ecf=0x0;_0x230ecf<_0x228fc0[_0xa044('0x4a')];_0x230ecf++){var _0x5c2498=_0x228fc0[_0x230ecf];var _0x57261c=_0x1295c0[_0x5c2498];if(_0x57261c[_0xa044('0x51')]===this[_0xa044('0x44')]&&_0x57261c[_0xa044('0x1d')]===_0xa044('0x52')&&_0x57261c['exten']===_0xa044('0x53')){this[_0xa044('0x5')]+=0x1;}}if(this[_0xa044('0x5')]>this[_0xa044('0x8')]){this[_0xa044('0x5')]=this[_0xa044('0x8')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xa044('0x46')]['compareToInboundQueue']=function(_0x5ad9fa){var _0x4152c7=![];if(_0x5ad9fa){_0x4152c7=INBOUND_COUNTERS[_0xa044('0x54')](function(_0x3ea870){return this[_0x3ea870]!==_0x5ad9fa[_0x3ea870];},this);}return _0x4152c7;};VoiceQueueSummary[_0xa044('0x46')]['compareToOutboundQueue']=function(_0x55f25d){var _0x4e50d5=![];var _0x26e66a=![];var _0x698e27=![];if(_0x55f25d){_0x4e50d5=this['dialMethod']!==_0x55f25d[_0xa044('0x24')]||this[_0xa044('0x23')]!==_0x55f25d['dialActive']||this['message']!==_0x55f25d[_0xa044('0x55')]||this[_0xa044('0x42')]!==_0x55f25d[_0xa044('0x42')];_0x26e66a=OUTBOUND_COUNTERS[_0xa044('0x54')](function(_0x4c91d0){return this[_0x4c91d0]!==_0x55f25d[_0x4c91d0];},this);if(this[_0xa044('0x43')]&&_0x55f25d[_0xa044('0x43')]){_0x698e27=this[_0xa044('0x43')][_0xa044('0x44')]!==_0x55f25d[_0xa044('0x43')][_0xa044('0x44')]||this[_0xa044('0x43')][_0xa044('0x45')]!==_0x55f25d[_0xa044('0x43')][_0xa044('0x45')];}}return _0x4e50d5||_0x26e66a||_0x698e27;};VoiceQueueSummary[_0xa044('0x46')][_0xa044('0x56')]=function(_0x2b6fa4){this[_0xa044('0x7')]=_0x2b6fa4[_0xa044('0x7')];this['message']=_0x2b6fa4[_0xa044('0x55')];this[_0xa044('0x42')]=_0x2b6fa4[_0xa044('0x42')];this[_0xa044('0x9')]=_0x2b6fa4[_0xa044('0x9')];this[_0xa044('0xa')]=_0x2b6fa4['outboundAbandonedCallsDay'];this[_0xa044('0xb')]=_0x2b6fa4[_0xa044('0xb')];this[_0xa044('0x2a')]=_0x2b6fa4[_0xa044('0x2a')];this[_0xa044('0xc')]=_0x2b6fa4['outboundBusyCallsDay'];this[_0xa044('0xd')]=_0x2b6fa4['outboundCongestionCallsDay'];this['outboundNoAnswerCallsDay']=_0x2b6fa4[_0xa044('0xe')];this[_0xa044('0xf')]=_0x2b6fa4['outboundNoSuchCallsDay'];this[_0xa044('0x2f')]=_0x2b6fa4[_0xa044('0x2f')];this['outboundRejectCallsDay']=_0x2b6fa4[_0xa044('0x10')];this['outboundUnknownCallsDay']=_0x2b6fa4['outboundUnknownCallsDay'];this[_0xa044('0x12')]=_0x2b6fa4['sumBillable'];this['sumDuration']=_0x2b6fa4[_0xa044('0x13')];this[_0xa044('0x14')]=_0x2b6fa4[_0xa044('0x14')];if(this['dialMethod']===_0xa044('0x57')){this[_0xa044('0x22')]=_0x2b6fa4[_0xa044('0x22')];}};module[_0xa044('0x58')]=VoiceQueueSummary; \ No newline at end of file +var _0xf987=['outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','prototype','ringInUse','loggedin','callers','length','SIP/','online','includes','status','notInUse','booked','keys','dialer','exten','compareToInboundQueue','some','active','updateReportFromOutboundQueue','preview','exports','loggedInDb','paused','talking','waiting','available','answered','inUse','loggedIn','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumDuration','total','name','strategy','abandoned','busy','invalid','onHold','ringing','sumBillable','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp'];(function(_0x20c72d,_0x52fe1c){var _0xec7469=function(_0x236667){while(--_0x236667){_0x20c72d['push'](_0x20c72d['shift']());}};_0xec7469(++_0x52fe1c);}(_0xf987,0x18a));var _0x7f98=function(_0x7c0317,_0x206d61){_0x7c0317=_0x7c0317-0x0;var _0x2acb37=_0xf987[_0x7c0317];return _0x2acb37;};'use strict';var INBOUND_COUNTERS=['available','loggedIn',_0x7f98('0x0'),_0x7f98('0x1'),'ringing',_0x7f98('0x2'),_0x7f98('0x3')];var OUTBOUND_COUNTERS=[_0x7f98('0x4'),_0x7f98('0x5'),_0x7f98('0x6'),_0x7f98('0x7'),_0x7f98('0x0'),_0x7f98('0x8'),_0x7f98('0x9'),_0x7f98('0xa'),_0x7f98('0xb'),_0x7f98('0xc'),'outboundCongestionCallsDay',_0x7f98('0xd'),_0x7f98('0xe'),_0x7f98('0xf'),_0x7f98('0x10'),_0x7f98('0x11'),'paused',_0x7f98('0x12'),'talking','sumBillable',_0x7f98('0x13'),_0x7f98('0x14'),_0x7f98('0x3')];function VoiceQueueSummary(_0x895ef2){this['id']=_0x895ef2['id'];this['name']=_0x895ef2[_0x7f98('0x15')];this['strategy']=_0x895ef2[_0x7f98('0x16')];this[_0x7f98('0x17')]=_0x895ef2[_0x7f98('0x17')]||0x0;this[_0x7f98('0x5')]=_0x895ef2[_0x7f98('0x5')]||0x0;this[_0x7f98('0x4')]=_0x895ef2[_0x7f98('0x4')]||0x0;this[_0x7f98('0x18')]=_0x895ef2[_0x7f98('0x18')]||0x0;this[_0x7f98('0x6')]=_0x895ef2[_0x7f98('0x6')]||0x0;this[_0x7f98('0x19')]=_0x895ef2['invalid']||0x0;this[_0x7f98('0x7')]=_0x895ef2['loggedIn']||0x0;this['loggedInDb']=_0x895ef2[_0x7f98('0x0')]||0x0;this[_0x7f98('0x1a')]=_0x895ef2['onHold']||0x0;this['notInUse']=_0x895ef2['notInUse']||0x0;this['paused']=_0x895ef2[_0x7f98('0x1')]||0x0;this[_0x7f98('0x1b')]=_0x895ef2['ringing']||0x0;this['ringInUse']=_0x895ef2['ringInUse'];this[_0x7f98('0x1c')]=_0x895ef2['sumBillable'];this[_0x7f98('0x13')]=_0x895ef2[_0x7f98('0x13')];this[_0x7f98('0x1d')]=_0x895ef2[_0x7f98('0x1d')]||0x0;this[_0x7f98('0x2')]=_0x895ef2[_0x7f98('0x2')]||0x0;this[_0x7f98('0x14')]=_0x895ef2[_0x7f98('0x14')]||0x0;this[_0x7f98('0x1e')]=_0x895ef2['type'];this['unavailable']=_0x895ef2[_0x7f98('0x1f')]||0x0;this['unknown']=_0x895ef2[_0x7f98('0x20')]||0x0;this[_0x7f98('0x21')]=_0x895ef2['unmanaged']||0x0;this[_0x7f98('0x3')]=_0x895ef2[_0x7f98('0x3')]||0x0;if(_0x895ef2['type']===_0x7f98('0x22')){this[_0x7f98('0x12')]=_0x895ef2[_0x7f98('0x12')]||0x0;this[_0x7f98('0x23')]=_0x895ef2[_0x7f98('0x23')];this[_0x7f98('0x24')]=_0x895ef2[_0x7f98('0x24')];this[_0x7f98('0x25')]=_0x895ef2[_0x7f98('0x25')];this[_0x7f98('0x26')]=_0x895ef2[_0x7f98('0x26')];this[_0x7f98('0x27')]=_0x895ef2[_0x7f98('0x27')];this['dialPrefix']=_0x895ef2['dialPrefix'];this[_0x7f98('0x28')]=_0x895ef2[_0x7f98('0x28')];this[_0x7f98('0x29')]=_0x895ef2[_0x7f98('0x29')];this[_0x7f98('0xa')]=_0x895ef2[_0x7f98('0xa')];this[_0x7f98('0xb')]=_0x895ef2[_0x7f98('0xb')];this[_0x7f98('0xc')]=_0x895ef2[_0x7f98('0xc')];this['outboundCongestionCallsDay']=_0x895ef2[_0x7f98('0x2a')];this[_0x7f98('0x2b')]=_0x895ef2['outboundDropCallsDayACS'];this[_0x7f98('0x2c')]=_0x895ef2[_0x7f98('0x2c')];this[_0x7f98('0x2d')]=_0x895ef2['outboundDropCallsDayTimeout'];this[_0x7f98('0xd')]=_0x895ef2['outboundNoAnswerCallsDay'];this[_0x7f98('0xe')]=_0x895ef2['outboundNoSuchCallsDay'];this[_0x7f98('0x2e')]=_0x895ef2[_0x7f98('0x2e')];this[_0x7f98('0xf')]=_0x895ef2[_0x7f98('0xf')];this[_0x7f98('0x10')]=_0x895ef2[_0x7f98('0x10')];this[_0x7f98('0x11')]=_0x895ef2['outboundUnknownCallsDay'];this['predictiveIntervalAnsweredCalls']=_0x895ef2[_0x7f98('0x2f')];this[_0x7f98('0x30')]=_0x895ef2[_0x7f98('0x30')];this[_0x7f98('0x31')]=_0x895ef2[_0x7f98('0x31')];this[_0x7f98('0x32')]=_0x895ef2[_0x7f98('0x32')];this['predictiveIntervalDroppedCallsTimeout']=_0x895ef2['predictiveIntervalDroppedCallsTimeout'];this[_0x7f98('0x33')]=_0x895ef2['predictiveIntervalErlangCalls'];this[_0x7f98('0x34')]=_0x895ef2['predictiveIntervalErlangCallsDroppedCalls'];this[_0x7f98('0x35')]=_0x895ef2[_0x7f98('0x35')];this[_0x7f98('0x36')]=_0x895ef2[_0x7f98('0x36')];this[_0x7f98('0x37')]=_0x895ef2[_0x7f98('0x37')];this[_0x7f98('0x38')]=_0x895ef2[_0x7f98('0x38')];this[_0x7f98('0x39')]=_0x895ef2[_0x7f98('0x39')];this[_0x7f98('0x8')]=_0x895ef2[_0x7f98('0x8')];this[_0x7f98('0x3a')]=_0x895ef2[_0x7f98('0x3a')];this[_0x7f98('0x3b')]=_0x895ef2[_0x7f98('0x3b')];this[_0x7f98('0x3c')]=_0x895ef2[_0x7f98('0x3c')];this[_0x7f98('0x3d')]=_0x895ef2[_0x7f98('0x3d')];this[_0x7f98('0x3e')]=_0x895ef2[_0x7f98('0x3e')];this[_0x7f98('0x3f')]=_0x895ef2['startProgressive'];this[_0x7f98('0x40')]=_0x895ef2[_0x7f98('0x40')];this[_0x7f98('0x41')]=_0x895ef2[_0x7f98('0x41')];}if(_0x895ef2['Trunk']){this['Trunk']={'id':_0x895ef2[_0x7f98('0x42')]['id'],'name':_0x895ef2[_0x7f98('0x42')]['name'],'active':_0x895ef2[_0x7f98('0x42')]['active'],'callerid':_0x895ef2['Trunk']['callerid']};}}VoiceQueueSummary[_0x7f98('0x43')]['createReport']=function(_0x2ab479,_0x4a7599,_0x43cb2a,_0x2c988a){this[_0x7f98('0x0')]=0x0;this[_0x7f98('0x2')]=0x0;this['paused']=0x0;this['unknown']=0x0;this['notInUse']=0x0;this[_0x7f98('0x6')]=0x0;this[_0x7f98('0x18')]=0x0;this['invalid']=0x0;this['unavailable']=0x0;this[_0x7f98('0x1b')]=0x0;this[_0x7f98('0x44')]=0x0;this[_0x7f98('0x1a')]=0x0;if(_0x43cb2a){if(_0x43cb2a[_0x7f98('0x4')]){this[_0x7f98('0x4')]=Number(_0x43cb2a[_0x7f98('0x4')]);}if(_0x43cb2a['loggedin']){this[_0x7f98('0x7')]=Number(_0x43cb2a[_0x7f98('0x45')]);}if(_0x43cb2a[_0x7f98('0x46')]){this[_0x7f98('0x3')]=Number(_0x43cb2a[_0x7f98('0x46')]);}}for(var _0x938ec0=0x0;_0x938ec0<_0x2ab479[_0x7f98('0x47')];_0x938ec0++){var _0x38aa91=_0x4a7599[_0x7f98('0x48')+_0x2ab479[_0x938ec0][_0x7f98('0x15')]];if(_0x38aa91&&_0x38aa91[_0x7f98('0x49')]){this[_0x7f98('0x0')]+=0x1;}if(_0x2ab479[_0x938ec0]['incall']==='1'){this['talking']+=0x1;}if(_0x2ab479[_0x938ec0]['paused']==='1'&&!['2','7','8'][_0x7f98('0x4a')](_0x2ab479[_0x938ec0][_0x7f98('0x4b')])){this['paused']+=0x1;}switch(_0x2ab479[_0x938ec0][_0x7f98('0x4b')]){case'0':this[_0x7f98('0x20')]+=0x1;break;case'1':this[_0x7f98('0x4c')]+=0x1;break;case'2':this[_0x7f98('0x6')]+=0x1;break;case'3':this[_0x7f98('0x18')]+=0x1;break;case'4':this[_0x7f98('0x19')]+=0x1;break;case'5':this[_0x7f98('0x1f')]+=0x1;break;case'6':this[_0x7f98('0x1b')]+=0x1;break;case'7':this[_0x7f98('0x44')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0x7f98('0x24')]===_0x7f98('0x4d')){var _0x170ad1=Object[_0x7f98('0x4e')](_0x2c988a);for(var _0x3396a7=0x0;_0x3396a7<_0x170ad1['length'];_0x3396a7++){var _0x414b85=_0x170ad1[_0x3396a7];var _0x2948ce=_0x2c988a[_0x414b85];if(_0x2948ce['queue']===this[_0x7f98('0x15')]&&_0x2948ce[_0x7f98('0x1e')]===_0x7f98('0x4f')&&_0x2948ce[_0x7f98('0x50')]==='xcally-motion-preview'){this[_0x7f98('0x2')]+=0x1;}}if(this['talking']>this['inUse']){this[_0x7f98('0x2')]=this[_0x7f98('0x6')];}this[_0x7f98('0x12')]=0x0;}return this;};VoiceQueueSummary[_0x7f98('0x43')][_0x7f98('0x51')]=function(_0x10f4d4){var _0xe92f6e=![];if(_0x10f4d4){_0xe92f6e=INBOUND_COUNTERS[_0x7f98('0x52')](function(_0x3b268d){return this[_0x3b268d]!==_0x10f4d4[_0x3b268d];},this);}return _0xe92f6e;};VoiceQueueSummary[_0x7f98('0x43')]['compareToOutboundQueue']=function(_0x1196b3){var _0x1453a7=![];var _0x2eabb8=![];var _0x2d4bac=![];if(_0x1196b3){_0x1453a7=this[_0x7f98('0x24')]!==_0x1196b3[_0x7f98('0x24')]||this[_0x7f98('0x23')]!==_0x1196b3[_0x7f98('0x23')]||this[_0x7f98('0x40')]!==_0x1196b3[_0x7f98('0x40')]||this[_0x7f98('0x41')]!==_0x1196b3['statusMessage'];_0x2eabb8=OUTBOUND_COUNTERS[_0x7f98('0x52')](function(_0x2d2d1a){return this[_0x2d2d1a]!==_0x1196b3[_0x2d2d1a];},this);if(this[_0x7f98('0x42')]&&_0x1196b3['Trunk']){_0x2d4bac=this['Trunk']['name']!==_0x1196b3['Trunk']['name']||this[_0x7f98('0x42')][_0x7f98('0x53')]!==_0x1196b3[_0x7f98('0x42')][_0x7f98('0x53')];}}return _0x1453a7||_0x2eabb8||_0x2d4bac;};VoiceQueueSummary['prototype'][_0x7f98('0x54')]=function(_0x10095d){this['answered']=_0x10095d[_0x7f98('0x5')];this[_0x7f98('0x40')]=_0x10095d['message'];this[_0x7f98('0x41')]=_0x10095d[_0x7f98('0x41')];this[_0x7f98('0x8')]=_0x10095d[_0x7f98('0x8')];this[_0x7f98('0x9')]=_0x10095d['outboundAbandonedCallsDay'];this['outboundAnswerCallsDay']=_0x10095d[_0x7f98('0xa')];this['outboundBlacklistCallsDay']=_0x10095d['outboundBlacklistCallsDay'];this[_0x7f98('0xc')]=_0x10095d[_0x7f98('0xc')];this['outboundCongestionCallsDay']=_0x10095d['outboundCongestionCallsDay'];this['outboundNoAnswerCallsDay']=_0x10095d['outboundNoAnswerCallsDay'];this['outboundNoSuchCallsDay']=_0x10095d[_0x7f98('0xe')];this['outboundReCallsDay']=_0x10095d['outboundReCallsDay'];this[_0x7f98('0x10')]=_0x10095d[_0x7f98('0x10')];this[_0x7f98('0x11')]=_0x10095d[_0x7f98('0x11')];this[_0x7f98('0x1c')]=_0x10095d[_0x7f98('0x1c')];this[_0x7f98('0x13')]=_0x10095d[_0x7f98('0x13')];this[_0x7f98('0x14')]=_0x10095d['total'];if(this[_0x7f98('0x24')]===_0x7f98('0x55')){this[_0x7f98('0x12')]=_0x10095d['pTalking'];}};module[_0x7f98('0x56')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 9e4ef09..8c1d715 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 _0x129d=['name','username','accessKey','remoteUri','Configurations'];(function(_0x1f5a16,_0x21a11){var _0x2c7d6c=function(_0x3e5368){while(--_0x3e5368){_0x1f5a16['push'](_0x1f5a16['shift']());}};_0x2c7d6c(++_0x21a11);}(_0x129d,0x163));var _0xd129=function(_0x2a0f3b,_0x490f21){_0x2a0f3b=_0x2a0f3b-0x0;var _0x40ab93=_0x129d[_0x2a0f3b];return _0x40ab93;};'use strict';function VtigerAccount(_0x4ce376){this['id']=_0x4ce376['id']||0x0;this[_0xd129('0x0')]=_0x4ce376[_0xd129('0x0')]||'';this[_0xd129('0x1')]=_0x4ce376['username']||'';this[_0xd129('0x2')]=_0x4ce376['accessKey']||'';this['remoteUri']=_0x4ce376[_0xd129('0x3')]||'';this['serverUrl']=_0x4ce376['serverUrl']||'';this[_0xd129('0x4')]=_0x4ce376['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x71b5=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x3ab3a3,_0x2c0ace){var _0x452d8e=function(_0x399c12){while(--_0x399c12){_0x3ab3a3['push'](_0x3ab3a3['shift']());}};_0x452d8e(++_0x2c0ace);}(_0x71b5,0x78));var _0x571b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71b5[_0x3dd15e];return _0x231fd0;};'use strict';function VtigerAccount(_0x3932c8){this['id']=_0x3932c8['id']||0x0;this['name']=_0x3932c8[_0x571b('0x0')]||'';this[_0x571b('0x1')]=_0x3932c8['username']||'';this[_0x571b('0x2')]=_0x3932c8[_0x571b('0x2')]||'';this[_0x571b('0x3')]=_0x3932c8[_0x571b('0x3')]||'';this[_0x571b('0x4')]=_0x3932c8[_0x571b('0x4')]||'';this[_0x571b('0x5')]=_0x3932c8[_0x571b('0x5')]||{};}module[_0x571b('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 9ad8272..7e8b433 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 _0x181e=['exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x181e,0x64));var _0xe181=function(_0x50f146,_0x4abe95){_0x50f146=_0x50f146-0x0;var _0x8475b8=_0x181e[_0x50f146];return _0x8475b8;};'use strict';function ZendeskAccount(_0x225b22){this['id']=_0x225b22['id']||0x0;this['name']=_0x225b22[_0xe181('0x0')]||'';this[_0xe181('0x1')]=_0x225b22[_0xe181('0x1')]||'';this[_0xe181('0x2')]=_0x225b22[_0xe181('0x2')]||'';this[_0xe181('0x3')]=_0x225b22[_0xe181('0x3')]||'';this[_0xe181('0x4')]=_0x225b22[_0xe181('0x4')]||'';this['authType']=_0x225b22[_0xe181('0x5')]||'';this['type']=_0x225b22[_0xe181('0x6')]||_0xe181('0x7');this[_0xe181('0x8')]=_0x225b22[_0xe181('0x8')]||'';this['Configurations']=_0x225b22[_0xe181('0x9')]||{};}module[_0xe181('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x1383=['integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri','authType','type'];(function(_0x10540d,_0x1d5a38){var _0x4a0ab4=function(_0x3d8bb6){while(--_0x3d8bb6){_0x10540d['push'](_0x10540d['shift']());}};_0x4a0ab4(++_0x1d5a38);}(_0x1383,0x12f));var _0x3138=function(_0x1b2edd,_0x14b5b3){_0x1b2edd=_0x1b2edd-0x0;var _0x6cc472=_0x1383[_0x1b2edd];return _0x6cc472;};'use strict';function ZendeskAccount(_0x1f63fa){this['id']=_0x1f63fa['id']||0x0;this['name']=_0x1f63fa[_0x3138('0x0')]||'';this[_0x3138('0x1')]=_0x1f63fa['username']||'';this[_0x3138('0x2')]=_0x1f63fa[_0x3138('0x2')]||'';this[_0x3138('0x3')]=_0x1f63fa[_0x3138('0x3')]||'';this[_0x3138('0x4')]=_0x1f63fa[_0x3138('0x4')]||'';this[_0x3138('0x5')]=_0x1f63fa[_0x3138('0x5')]||'';this[_0x3138('0x6')]=_0x1f63fa['type']||_0x3138('0x7');this['serverUrl']=_0x1f63fa[_0x3138('0x8')]||'';this[_0x3138('0x9')]=_0x1f63fa['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 1ec6a85..3505ebd 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 _0x9b5c=['exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x4c4ca5,_0x40318b){var _0x210119=function(_0x425a74){while(--_0x425a74){_0x4c4ca5['push'](_0x4c4ca5['shift']());}};_0x210119(++_0x40318b);}(_0x9b5c,0x9b));var _0xc9b5=function(_0x1c7b4c,_0x5b85b2){_0x1c7b4c=_0x1c7b4c-0x0;var _0x18daf6=_0x9b5c[_0x1c7b4c];return _0x18daf6;};'use strict';function ZohoAccount(_0x4d208c){this['id']=_0x4d208c['id']||0x0;this[_0xc9b5('0x0')]=_0x4d208c[_0xc9b5('0x0')]||'';this[_0xc9b5('0x1')]=_0x4d208c[_0xc9b5('0x1')]||'';this[_0xc9b5('0x2')]=_0x4d208c[_0xc9b5('0x2')]||'';this[_0xc9b5('0x3')]=_0x4d208c[_0xc9b5('0x3')]||'';this[_0xc9b5('0x4')]=_0x4d208c['clientId']||'';this[_0xc9b5('0x5')]=_0x4d208c[_0xc9b5('0x5')]||'';this[_0xc9b5('0x6')]=_0x4d208c[_0xc9b5('0x6')]||'';this[_0xc9b5('0x7')]=_0x4d208c[_0xc9b5('0x7')]||'';this[_0xc9b5('0x8')]=_0x4d208c['refreshToken']||'';this[_0xc9b5('0x9')]=_0x4d208c[_0xc9b5('0x9')]||{};}module[_0xc9b5('0xa')]=ZohoAccount; \ No newline at end of file +var _0x6667=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6667,0x17b));var _0x7666=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0x6667[_0x648163];return _0x199d4d;};'use strict';function ZohoAccount(_0x374b5e){this['id']=_0x374b5e['id']||0x0;this['name']=_0x374b5e[_0x7666('0x0')]||'';this[_0x7666('0x1')]=_0x374b5e[_0x7666('0x1')]||'';this['host']=_0x374b5e[_0x7666('0x2')]||'';this[_0x7666('0x3')]=_0x374b5e[_0x7666('0x3')]||'';this[_0x7666('0x4')]=_0x374b5e[_0x7666('0x4')]||'';this[_0x7666('0x5')]=_0x374b5e[_0x7666('0x5')]||'';this[_0x7666('0x6')]=_0x374b5e['serverUrl']||'';this[_0x7666('0x7')]=_0x374b5e[_0x7666('0x7')]||'';this[_0x7666('0x8')]=_0x374b5e['refreshToken']||'';this['Configurations']=_0x374b5e[_0x7666('0x9')]||{};}module[_0x7666('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index bcbd89d..3277961 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 _0x5b12=['active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countdropretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName'];(function(_0x16a6c3,_0x4e2fd1){var _0x227166=function(_0x5614c5){while(--_0x5614c5){_0x16a6c3['push'](_0x16a6c3['shift']());}};_0x227166(++_0x4e2fd1);}(_0x5b12,0xa3));var _0x25b1=function(_0x455687,_0xa75e91){_0x455687=_0x455687-0x0;var _0x5c3648=_0x5b12[_0x455687];return _0x5c3648;};'use strict';var util=require(_0x25b1('0x0'));var _=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));function checkNameSurname(_0x569948,_0x1c9b07,_0x5b457b){var _0x2d491e='';if(!_[_0x25b1('0x3')](_0x1c9b07)&&'string'===typeof _0x1c9b07){_0x2d491e+=_0x1c9b07;}if(!_[_0x25b1('0x3')](_0x5b457b)&&'string'===typeof _0x5b457b){_0x2d491e+='\x20'+_0x5b457b;}if(_0x2d491e!==''){return _0x2d491e;}return _0x569948;}function Action(_0x5248c2,_0x35d90b,_0x5523c9,_0x5bb95b,_0x1f715d){this[_0x25b1('0x4')]=_0x5523c9||undefined;this[_0x25b1('0x5')]=_0x5248c2['id'];this[_0x25b1('0x6')]=_0x35d90b[_0x25b1('0x7')];this[_0x25b1('0x8')]=_0x35d90b[_0x25b1('0x8')];this[_0x25b1('0x9')]='queue';this[_0x25b1('0xa')]=![];this[_0x25b1('0xb')]=_[_0x25b1('0x3')](_0x5248c2[_0x25b1('0xc')])?undefined:_0x5248c2[_0x25b1('0xc')][_0x25b1('0x7')];this[_0x25b1('0xd')]=this[_0x25b1('0xb')]?util[_0x25b1('0xe')](_0x25b1('0xf'),this[_0x25b1('0xb')]):_0x5bb95b||undefined;this[_0x25b1('0x10')]=checkNameSurname(_0x5248c2[_0x25b1('0x11')][_0x25b1('0x12')],_0x5248c2[_0x25b1('0x11')][_0x25b1('0x13')],_0x5248c2['Contact'][_0x25b1('0x14')]);this[_0x25b1('0x15')]=_0x5248c2['active']||![];this[_0x25b1('0x16')]=_0x5248c2[_0x25b1('0x12')];this[_0x25b1('0x17')]=_0x5248c2['scheduledat'];this['countbusyretry']=_0x5248c2[_0x25b1('0x18')]||0x0;this['countcongestionretry']=_0x5248c2[_0x25b1('0x19')]||0x0;this[_0x25b1('0x1a')]=_0x5248c2[_0x25b1('0x1a')]||0x0;this[_0x25b1('0x1b')]=(_0x5248c2[_0x25b1('0x18')]||0x0)+(_0x5248c2[_0x25b1('0x19')]||0x0)+(_0x5248c2[_0x25b1('0x1a')]||0x0)+(_0x5248c2[_0x25b1('0x1c')]||0x0)+(_0x5248c2['countdropretry']||0x0)+(_0x5248c2['countabandonedretry']||0x0)+(_0x5248c2[_0x25b1('0x1d')]||0x0)+(_0x5248c2['countagentrejectretry']||0x0);this[_0x25b1('0x1c')]=_0x5248c2['countnosuchnumberretry']||0x0;this[_0x25b1('0x1e')]=_0x5248c2['countdropretry']||0x0;this[_0x25b1('0x1f')]=_0x5248c2['countabandonedretry']||0x0;this[_0x25b1('0x1d')]=_0x5248c2['countmachineretry']||0x0;this['countagentrejectretry']=_0x5248c2['countagentrejectretry']||0x0;this[_0x25b1('0x20')]=_0x5248c2[_0x25b1('0x20')];this['callbackuniqueid']=_0x5248c2[_0x25b1('0x21')];this[_0x25b1('0x22')]=_0x5248c2[_0x25b1('0x22')];this[_0x25b1('0x23')]=_0x5248c2[_0x25b1('0x23')];this['ContactId']=_0x5248c2[_0x25b1('0x24')];this[_0x25b1('0x25')]=_0x5248c2[_0x25b1('0x25')];this[_0x25b1('0x26')]=_[_0x25b1('0x3')](_0x5248c2[_0x25b1('0xc')])?_0x5248c2['UserId']:_0x5248c2[_0x25b1('0xc')]['id'];this[_0x25b1('0x27')]=_0x5248c2[_0x25b1('0x27')];this['originatecalleridnum']='';this[_0x25b1('0x28')]='';}Action[_0x25b1('0x29')][_0x25b1('0x2a')]=function(){return util['format'](_0x25b1('0x2b'),this['calleridname'],this[_0x25b1('0x2c')]);};module[_0x25b1('0x2d')]=Action; \ No newline at end of file +var _0x6a95=['format','number','util','lodash','moment','isNil','string','queue','name','type','campaigntype','dialAnswer','membername','Agent','SIP/%s','calleridname','Contact','phone','firstName','lastName','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x6a95,0x1db));var _0x56a9=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x6a95[_0x5783f4];return _0x28e380;};'use strict';var util=require(_0x56a9('0x0'));var _=require(_0x56a9('0x1'));var moment=require(_0x56a9('0x2'));function checkNameSurname(_0xce37aa,_0x36f87a,_0x26e006){var _0x235917='';if(!_['isNil'](_0x36f87a)&&'string'===typeof _0x36f87a){_0x235917+=_0x36f87a;}if(!_[_0x56a9('0x3')](_0x26e006)&&_0x56a9('0x4')===typeof _0x26e006){_0x235917+='\x20'+_0x26e006;}if(_0x235917!==''){return _0x235917;}return _0xce37aa;}function Action(_0x1b42ac,_0x2eb132,_0x3c15b6,_0x365093,_0xd8aa7c){this['uniqueid']=_0x3c15b6||undefined;this['idContact']=_0x1b42ac['id'];this[_0x56a9('0x5')]=_0x2eb132[_0x56a9('0x6')];this['type']=_0x2eb132[_0x56a9('0x7')];this[_0x56a9('0x8')]=_0x56a9('0x5');this[_0x56a9('0x9')]=![];this[_0x56a9('0xa')]=_[_0x56a9('0x3')](_0x1b42ac[_0x56a9('0xb')])?undefined:_0x1b42ac[_0x56a9('0xb')][_0x56a9('0x6')];this['channelAgent']=this[_0x56a9('0xa')]?util['format'](_0x56a9('0xc'),this[_0x56a9('0xa')]):_0x365093||undefined;this[_0x56a9('0xd')]=checkNameSurname(_0x1b42ac[_0x56a9('0xe')][_0x56a9('0xf')],_0x1b42ac[_0x56a9('0xe')][_0x56a9('0x10')],_0x1b42ac[_0x56a9('0xe')][_0x56a9('0x11')]);this['active']=_0x1b42ac['active']||![];this[_0x56a9('0x12')]=_0x1b42ac[_0x56a9('0xf')];this[_0x56a9('0x13')]=_0x1b42ac[_0x56a9('0x13')];this['countbusyretry']=_0x1b42ac[_0x56a9('0x14')]||0x0;this['countcongestionretry']=_0x1b42ac['countcongestionretry']||0x0;this['countnoanswerretry']=_0x1b42ac[_0x56a9('0x15')]||0x0;this[_0x56a9('0x16')]=(_0x1b42ac[_0x56a9('0x14')]||0x0)+(_0x1b42ac[_0x56a9('0x17')]||0x0)+(_0x1b42ac[_0x56a9('0x15')]||0x0)+(_0x1b42ac[_0x56a9('0x18')]||0x0)+(_0x1b42ac[_0x56a9('0x19')]||0x0)+(_0x1b42ac[_0x56a9('0x1a')]||0x0)+(_0x1b42ac[_0x56a9('0x1b')]||0x0)+(_0x1b42ac[_0x56a9('0x1c')]||0x0);this[_0x56a9('0x18')]=_0x1b42ac[_0x56a9('0x18')]||0x0;this['countdropretry']=_0x1b42ac['countdropretry']||0x0;this[_0x56a9('0x1a')]=_0x1b42ac[_0x56a9('0x1a')]||0x0;this[_0x56a9('0x1b')]=_0x1b42ac[_0x56a9('0x1b')]||0x0;this['countagentrejectretry']=_0x1b42ac[_0x56a9('0x1c')]||0x0;this[_0x56a9('0x1d')]=_0x1b42ac[_0x56a9('0x1d')];this[_0x56a9('0x1e')]=_0x1b42ac['callbackuniqueid'];this[_0x56a9('0x1f')]=_0x1b42ac[_0x56a9('0x1f')];this[_0x56a9('0x20')]=_0x1b42ac[_0x56a9('0x20')];this[_0x56a9('0x21')]=_0x1b42ac['ContactId'];this[_0x56a9('0x22')]=_0x1b42ac[_0x56a9('0x22')];this[_0x56a9('0x23')]=_['isNil'](_0x1b42ac[_0x56a9('0xb')])?_0x1b42ac['UserId']:_0x1b42ac[_0x56a9('0xb')]['id'];this[_0x56a9('0x24')]=_0x1b42ac[_0x56a9('0x24')];this[_0x56a9('0x25')]='';this[_0x56a9('0x26')]='';}Action[_0x56a9('0x27')][_0x56a9('0x28')]=function(){return util[_0x56a9('0x29')]('\x22%s\x22\x20<%s>',this[_0x56a9('0xd')],this[_0x56a9('0x2a')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index bfd4433..267d5f9 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 _0x5046=['[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','Busy','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','isTrunkReachable','active','trunks','SIP/%s','status','execRun','unlock','unlockContact','disableContact','recallme','validateContact','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','assign','merge','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','isFailure','response','custom:agentringnoanswer','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','../dialer/utils','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','voice_queue_channel:remove','emit','sendMessageOneNotActive','originated','pTalking','available','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','\x20is\x20not\x20active','DEACTIVATED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20deactivated','syncCampaigns','clockClearZombieChannels','dialMethod','booked','clearZombieChannels','hasOwnProperty','type','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','getContactRecallMe','then','getDiff','Agent','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','loggedIn','NO_AGENTS_LOGGED','isActive','dialActive','Trunk','TrunkBackup','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','unlockAgent','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','[callProgressDetectingCustomer][logAnswer]','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','rescheduleContact','activeContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','countglobal','dialNoAnswerRetryFrequency','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','outboundCongestionCallsDay','countcongestionretry','dialCongestionRetryFrequency','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','decrementTalkink','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x5046,0x6d));var _0x6504=function(_0x4297ff,_0x512e4c){_0x4297ff=_0x4297ff-0x0;var _0x546a01=_0x5046[_0x4297ff];return _0x546a01;};'use strict';var util=require(_0x6504('0x0'));var _=require(_0x6504('0x1'));var uuid=require(_0x6504('0x2'));var moment=require(_0x6504('0x3'));var Redis=require(_0x6504('0x4'));var config=require(_0x6504('0x5'));var logger=require(_0x6504('0x6'))(_0x6504('0x7'));var loggerAction=require(_0x6504('0x6'))(_0x6504('0x8'));var ami=require('../ami');var rpcDb=require(_0x6504('0x9'));var cmHopperAdditionalPhone=require(_0x6504('0xa'));var Action=require('./action');var ut=require('./util/util');var utils=require(_0x6504('0xb'));config['redis']=_[_0x6504('0xc')](config[_0x6504('0xd')],{'host':_0x6504('0xe'),'port':0x18eb});var io=require(_0x6504('0xf'))(new Redis(config[_0x6504('0xd')]));var Sequence=function(){};Sequence[_0x6504('0x10')][_0x6504('0x11')]=function(_0x540f62){this[_0x6504('0x12')]=this[_0x6504('0x12')]?this[_0x6504('0x12')][_0x6504('0x13')](_0x540f62):_0x540f62();};function Preview(_0x28e177){this[_0x6504('0x14')]=new Sequence();this[_0x6504('0x15')]=_0x28e177[_0x6504('0x16')];this['trunks']=_0x28e177['trunks'];this[_0x6504('0x17')]={};this[_0x6504('0x18')]=_0x28e177[_0x6504('0x18')];this['clockClearZombieChannels']=0x0;ami['on'](_0x6504('0x19'),this[_0x6504('0x1a')][_0x6504('0x1b')](this));ami['on'](_0x6504('0x1c'),this[_0x6504('0x1d')][_0x6504('0x1b')](this));ami['on']('hanguprequest',this[_0x6504('0x1e')][_0x6504('0x1b')](this));ami['on'](_0x6504('0x1f'),this[_0x6504('0x20')][_0x6504('0x1b')](this));ami['on'](_0x6504('0x21'),this[_0x6504('0x22')]['bind'](this));ami['on'](_0x6504('0x23'),this['syncVarSet'][_0x6504('0x1b')](this));ami['on']('attendedtransfer',this[_0x6504('0x24')][_0x6504('0x1b')](this));ami['on']('blindtransfer',this[_0x6504('0x25')][_0x6504('0x1b')](this));this[_0x6504('0x26')](this[_0x6504('0x15')]);}function emit(_0x365738,_0xcbec8a,_0x1f7bbb){io['to'](_0x365738)['emit'](_0xcbec8a,_0x1f7bbb);}function emitVoiceQueueChannelRemove(_0x822ced){logger[_0x6504('0x27')](_0x6504('0x28'),JSON[_0x6504('0x29')](_0x822ced));emit(util[_0x6504('0x2a')](_0x6504('0x2b'),_0x822ced[_0x6504('0x2c')]),_0x6504('0x2d'),_0x822ced);io[_0x6504('0x2e')]('voice_queue_presence:remove',_0x822ced);}function notSendMessagesQueue(_0xbe2346){if(_0xbe2346[_0x6504('0x2f')]){if(_0xbe2346[_0x6504('0x30')]===0x0&&_0xbe2346[_0x6504('0x31')]===0x0){_0xbe2346[_0x6504('0x2f')]=![];_0xbe2346[_0x6504('0x32')]=0x0;_0xbe2346[_0x6504('0x33')]=0x0;_0xbe2346[_0x6504('0x34')]=utils[_0x6504('0x35')][_0x6504('0x36')];ut[_0x6504('0x37')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0xbe2346[_0x6504('0x2c')]+_0x6504('0x38'));}else{_0xbe2346[_0x6504('0x34')]=utils[_0x6504('0x35')][_0x6504('0x39')];ut[_0x6504('0x37')](_0x6504('0x3a'),_0xbe2346[_0x6504('0x2c')]+_0x6504('0x3b'));}}}Preview[_0x6504('0x10')][_0x6504('0x26')]=function(){var _0xec27e9=this;setInterval(function(){_0xec27e9['syncCampaigns']();},0x7cf);};Preview[_0x6504('0x10')][_0x6504('0x3c')]=function(){var _0x25d8b2=this['campaignsPreview'];this[_0x6504('0x3d')]+=0x1;for(var _0xc1a200 in _0x25d8b2){if(_0x25d8b2['hasOwnProperty'](_0xc1a200)&&(_0x25d8b2[_0xc1a200][_0x6504('0x3e')]===_0x6504('0x7')||_0x25d8b2[_0xc1a200][_0x6504('0x3e')]===_0x6504('0x3f'))&&_0x25d8b2[_0xc1a200]['type']==='outbound'){if(this[_0x6504('0x3d')]>0x7){this[_0x6504('0x3d')]=0x0;this[_0x6504('0x40')]();}}if(_0x25d8b2[_0x6504('0x41')](_0xc1a200)&&_0x25d8b2[_0xc1a200][_0x6504('0x3e')]===_0x6504('0x7')&&_0x25d8b2[_0xc1a200][_0x6504('0x42')]==='outbound'){if(_0x25d8b2[_0xc1a200]['dialActive']){this[_0x6504('0x43')](_0x25d8b2[_0xc1a200]);if(_0x25d8b2[_0xc1a200][_0x6504('0x44')])this[_0x6504('0x45')](_0x25d8b2[_0xc1a200]);}else{notSendMessagesQueue(_0x25d8b2[_0xc1a200]);}}}};Preview['prototype'][_0x6504('0x46')]=function(_0x2daa07){var _0x1f7df4=this;this[_0x6504('0x14')][_0x6504('0x11')](function(){if(!_[_0x6504('0x47')](_0x1f7df4[_0x6504('0x17')][_0x2daa07])){loggerAction[_0x6504('0x27')](_0x6504('0x48'),_0x2daa07,_0x6504('0x49'),_0x1f7df4['actions'][_0x2daa07][_0x6504('0x4a')],_0x6504('0x4b'),JSON['stringify'](_0x1f7df4[_0x6504('0x15')][_0x1f7df4[_0x6504('0x17')][_0x2daa07]['queue']][_0x6504('0x30')]),'pTalking:\x20',JSON['stringify'](_0x1f7df4[_0x6504('0x15')][_0x1f7df4[_0x6504('0x17')][_0x2daa07]['queue']]['pTalking']),JSON['stringify'](_0x1f7df4[_0x6504('0x17')][_0x2daa07][_0x6504('0x4c')]),JSON[_0x6504('0x29')](_[_0x6504('0x4d')](_0x1f7df4[_0x6504('0x17')][_0x2daa07],[_0x6504('0x4e'),_0x6504('0x4f'),_0x6504('0x50'),'ListId'])));return ami[_0x6504('0x51')]({'action':'status','channel':_0x1f7df4[_0x6504('0x17')][_0x2daa07][_0x6504('0x52')]})[_0x6504('0x53')](function(_0x41ef46){if(_0x41ef46[_0x6504('0x34')]===_0x6504('0x54')){setTimeout(function(){if(_0x1f7df4['actions'][_0x2daa07]){ut[_0x6504('0x55')](_0x1f7df4[_0x6504('0x15')][_0x1f7df4[_0x6504('0x17')][_0x2daa07]['queue']],_0x6504('0x56'));if(_0x1f7df4['actions'][_0x2daa07]['dialAnswer']===!![]){ut['decrementTalkink'](_0x1f7df4[_0x6504('0x15')][_0x1f7df4['actions'][_0x2daa07]['queue']],_0x6504('0x56'));ut[_0x6504('0x57')](_0x6504('0x58')+_0x2daa07,_0x1f7df4[_0x6504('0x17')][_0x2daa07][_0x6504('0x4a')]);}ut[_0x6504('0x57')](_0x6504('0x59')+_0x2daa07,_0x1f7df4[_0x6504('0x17')][_0x2daa07][_0x6504('0x4a')]);delete _0x1f7df4[_0x6504('0x17')][_0x2daa07];}},0x2328);}});}});};Preview[_0x6504('0x10')]['clearZombieChannels']=function(){var _0xa770a6=this;loggerAction[_0x6504('0x27')](_0x6504('0x5a'),_['size'](this['actions']));for(var _0x4ebd5c in this['actions']){if(_0xa770a6['actions']['hasOwnProperty'](_0x4ebd5c)){_0xa770a6[_0x6504('0x46')](_0x4ebd5c);}}};Preview['prototype'][_0x6504('0x45')]=function(_0x23d879){var _0x339b87=this;rpcDb[_0x6504('0x5b')](_0x23d879['id'],ut['agentReadyId'](this[_0x6504('0x18')]))[_0x6504('0x5c')](function(_0xac703f){if(!_[_0x6504('0x47')](_0xac703f)){for(var _0x29f5b6=0x0;_0x29f5b6<_0xac703f['length'];_0x29f5b6+=0x1){if(ut[_0x6504('0x5d')](_0xac703f[_0x29f5b6]['scheduledat'])<_0x23d879['dialRecallMeTimeout']*0x3c){if(_0xac703f[_0x29f5b6][_0x6504('0x5e')]&&!_0xac703f[_0x29f5b6]['Agent']['voicePause']){_0x339b87[_0x6504('0x5f')](_0xac703f[_0x29f5b6]['id'])[_0x6504('0x5c')](ut[_0x6504('0x60')](_0x6504('0x61')))[_0x6504('0x53')](ut[_0x6504('0x60')](_0x6504('0x61')));}else{rpcDb['disableContact'](_0xac703f[_0x29f5b6]['id']);}}else{var _0x439972=new Action(_0xac703f[_0x29f5b6],_0x23d879);_0x439972[_0x6504('0x62')]=moment()[_0x6504('0x2a')](_0x6504('0x63'));_0x23d879['outboundReCallsDay']+=0x1;ut[_0x6504('0x64')](_0x439972,0x17,_0x6504('0x65'));if(_0x23d879[_0x6504('0x66')]){rpcDb['rescheduleContactInQueue'](ut[_0x6504('0x67')](_0xac703f[_0x29f5b6]));rpcDb[_0x6504('0x68')](_0x439972,'[HistoryDialRecallInQueue][historyCatch]');}else{ut['logCustomer'](_0x439972,0x16,_0x6504('0x69'));rpcDb[_0x6504('0x68')](_0x439972,_0x6504('0x6a'));rpcDb['createCustomerFinal'](_0x439972,_0x6504('0x6a'));}}}}})[_0x6504('0x53')](ut[_0x6504('0x60')](_0x6504('0x6b')));};Preview[_0x6504('0x10')][_0x6504('0x43')]=function(_0xca1601){_0xca1601['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0xca1601[_0x6504('0x6c')])){_0xca1601[_0x6504('0x34')]=utils[_0x6504('0x35')][_0x6504('0x6d')];}else if(!ut[_0x6504('0x6e')](_0xca1601[_0x6504('0x6f')])){_0xca1601['message']=utils['CAMPAIGN_STATUS'][_0x6504('0x36')];}else if(!this['isTrunkReachable'](_0xca1601[_0x6504('0x70')])){if(!this['isTrunkReachable'](_0xca1601[_0x6504('0x71')])){_0xca1601['message']=utils[_0x6504('0x35')]['UNREACHABLE_TRUNK'];}else{_0xca1601[_0x6504('0x34')]=utils[_0x6504('0x35')]['ACTIVE'];}}else{_0xca1601[_0x6504('0x34')]=utils['CAMPAIGN_STATUS'][_0x6504('0x72')];}};Preview['prototype'][_0x6504('0x73')]=function(_0x1ffdc1,_0xf766e2,_0x3a945b){var _0xee89dc=this;var _0x2b1c65=this[_0x6504('0x17')][_0xf766e2];var _0x1cbeed=this[_0x6504('0x15')][_0x2b1c65[_0x6504('0x4a')]];var _0x3a6a01;var _0x2ed727=![];var _0x2a1ede=0x2;var _0x2ce30d=0x3;if(_0x1cbeed){switch(_0x3a945b){case'1':_0x1cbeed[_0x6504('0x74')]+=0x1;_0x2b1c65[_0x6504('0x75')]+=0x1;_0x2b1c65['countglobal']=ut[_0x6504('0x76')](_0x2b1c65);ut[_0x6504('0x64')](_0x2b1c65,0x0,_0x6504('0x77'));ami[_0x6504('0x2e')]('custom:agentnosuchnumber',ut[_0x6504('0x78')](_0x2b1c65,_0x6504('0x79')));rpcDb[_0x6504('0x68')](_0x2b1c65,'[callProgressDetectingCustomer][logNoSuch]');_0xee89dc[_0x6504('0x7a')](_0x2b1c65,'0',_0x1cbeed)[_0x6504('0x5c')](function(_0x47cc2a){_0x2ed727=_0x47cc2a[_0x6504('0x7b')]==0x1;_0x2a1ede=_0x1cbeed[_0x6504('0x7c')];_0x2ce30d=_0x1cbeed[_0x6504('0x7d')];if(!_0x2ed727){if(ut['totalGlobal'](_0x2b1c65)>=_0x1cbeed['dialGlobalMaxRetry']){_0x3a6a01=ut[_0x6504('0x7e')](_0x2b1c65,0xf,_0x6504('0x7f'));rpcDb[_0x6504('0x80')](_0x3a6a01,_0x6504('0x81'));}else{if(_0x2b1c65[_0x6504('0x75')]>=_0x1cbeed[_0x6504('0x82')]){rpcDb[_0x6504('0x80')](_0x2b1c65,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut[_0x6504('0x83')](_0x2b1c65,'countnosuchnumberretry',_0x1cbeed[_0x6504('0x7c')]),_0x2b1c65[_0x6504('0x84')],_0x2b1c65['activeContact']);}}delete this[_0x6504('0x17')][_0x1ffdc1[_0x6504('0x85')]];}else{_0x2b1c65[_0x6504('0x75')]++;logger[_0x6504('0x27')](_0x6504('0x86'),_0x2b1c65[_0x6504('0x75')]);logger[_0x6504('0x27')]('id',_0x2b1c65[_0x6504('0x87')]);_0xee89dc[_0x6504('0x88')]({'id':_0x2b1c65['idContact'],'field':{'countnosuchnumberretry':_0x2b1c65['countnosuchnumberretry']}})[_0x6504('0x5c')](function(){_0xee89dc[_0x6504('0x89')](_0x2b1c65,_0x2a1ede,_0x2ce30d)[_0x6504('0x5c')](function(){});});}});break;case _0x6504('0x8a'):var _0x6d2d24=moment()[_0x6504('0x2a')](_0x6504('0x63'));_0x2b1c65[_0x6504('0x8b')]=_0x6d2d24;_0x2b1c65[_0x6504('0x8c')]=_0x6d2d24;_0x2b1c65[_0x6504('0x4c')]=!![];_0x1cbeed['pTalking']+=0x1;logger[_0x6504('0x27')](_0x6504('0x8d'),_0x2b1c65[_0x6504('0x8e')],_0x6504('0x8f'),_0x1cbeed[_0x6504('0x2c')],_0x6504('0x90'),_0x1cbeed[_0x6504('0x31')]);ami[_0x6504('0x2e')](_0x6504('0x91'),ut[_0x6504('0x78')](_0x2b1c65,'connect',this[_0x6504('0x15')][_0x2b1c65[_0x6504('0x4a')]]));if(_0x1cbeed[_0x6504('0x92')]){ami['emit'](_0x6504('0x93'),ut[_0x6504('0x94')](_0x2b1c65));}break;case'16':ami[_0x6504('0x2e')](_0x6504('0x95'),ut[_0x6504('0x78')](_0x2b1c65,_0x6504('0x96'),this['campaignsPreview'][_0x2b1c65[_0x6504('0x4a')]]));emitVoiceQueueChannelRemove(ut[_0x6504('0x78')](_0x2b1c65,_0x6504('0x96')));_0x1cbeed[_0x6504('0x97')]+=0x1;_0x1cbeed[_0x6504('0x98')]+=0x1;_0x1cbeed[_0x6504('0x99')]+=0x1;ut['decrementTalkink'](_0x1cbeed,'[16]');_0x2b1c65['countglobal']=ut[_0x6504('0x76')](_0x2b1c65);ut[_0x6504('0x64')](_0x2b1c65,0x4,'Answer');rpcDb[_0x6504('0x68')](_0x2b1c65,_0x6504('0x9a'));rpcDb[_0x6504('0x80')](_0x2b1c65,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x2b1c65);_0x1cbeed[_0x6504('0x9b')]+=_0x2b1c65[_0x6504('0x9c')];_0x1cbeed[_0x6504('0x9d')]+=_0x2b1c65[_0x6504('0x9c')];logger[_0x6504('0x27')](_0x6504('0x9e'),_0x2b1c65['uniqueid'],_0x6504('0x8f'),_0x1cbeed['name'],_0x6504('0x90'),_0x1cbeed[_0x6504('0x31')]);delete this['actions'][_0x1ffdc1[_0x6504('0x85')]];break;case'BUSY':_0x1cbeed['outboundBusyCallsDay']+=0x1;_0x2b1c65['countbusyretry']+=0x1;_0x2b1c65['countglobal']=ut[_0x6504('0x76')](_0x2b1c65);ut[_0x6504('0x64')](_0x2b1c65,0x5,'Busy');_0x2a1ede=_0x1cbeed[_0x6504('0x9f')];_0x2ce30d=_0x1cbeed[_0x6504('0x7d')];ami[_0x6504('0x2e')](_0x6504('0xa0'),ut['buildObj'](_0x2b1c65,_0x6504('0xa1')));rpcDb[_0x6504('0x68')](_0x2b1c65,_0x6504('0xa2'));_0xee89dc['verifyAdditionalPhones'](_0x2b1c65,'5',_0x1cbeed)[_0x6504('0x5c')](function(_0x3384b9){_0x2ed727=_0x3384b9[_0x6504('0x7b')]==0x1;if(!_0x2ed727){if(ut[_0x6504('0x76')](_0x2b1c65)>=_0x1cbeed[_0x6504('0xa3')]){_0x3a6a01=ut['cloneAction'](_0x2b1c65,0xf,_0x6504('0x7f'));rpcDb[_0x6504('0x80')](_0x3a6a01,_0x6504('0xa4'));}else{if(_0x2b1c65[_0x6504('0xa5')]>=_0x1cbeed[_0x6504('0xa6')]){rpcDb[_0x6504('0x80')](_0x2b1c65,_0x6504('0xa2'));}else{rpcDb[_0x6504('0xa7')](ut[_0x6504('0x83')](_0x2b1c65,_0x6504('0xa5'),_0x1cbeed[_0x6504('0x9f')]),_0x2b1c65[_0x6504('0x84')],_0x2b1c65[_0x6504('0xa8')]);}}}else{_0x2b1c65[_0x6504('0xa5')]++;_0xee89dc[_0x6504('0x88')]({'id':_0x2b1c65[_0x6504('0x87')],'field':{'countbusyretry':_0x2b1c65[_0x6504('0xa5')]}})[_0x6504('0x5c')](function(){_0xee89dc[_0x6504('0x89')](_0x2b1c65,_0x2a1ede,_0x2ce30d)['then'](function(){});});}});break;case _0x6504('0xa9'):_0x1cbeed[_0x6504('0xaa')]+=0x1;_0x2b1c65[_0x6504('0xab')]+=0x1;_0x2b1c65[_0x6504('0xac')]=ut[_0x6504('0x76')](_0x2b1c65);ut[_0x6504('0x64')](_0x2b1c65,0x3,'NoAnswer');_0x2a1ede=_0x1cbeed[_0x6504('0xad')];_0x2ce30d=_0x1cbeed[_0x6504('0x7d')];var _0x3ddba1=ut['buildNoAnswerEventPayload'](_0x2b1c65,_0x1cbeed);ami['emit'](_0x6504('0xae'),_0x3ddba1);rpcDb[_0x6504('0x68')](_0x2b1c65,_0x6504('0xaf'));_0xee89dc[_0x6504('0x7a')](_0x2b1c65,'3',_0x1cbeed)[_0x6504('0x5c')](function(_0x8e4a93){_0x2ed727=_0x8e4a93[_0x6504('0x7b')]==0x1;if(!_0x2ed727){if(ut[_0x6504('0x76')](_0x2b1c65)>=_0x1cbeed['dialGlobalMaxRetry']){_0x3a6a01=ut[_0x6504('0x7e')](_0x2b1c65,0xf,_0x6504('0x7f'));rpcDb['createCustomerFinal'](_0x3a6a01,_0x6504('0xb0'));}else{if(_0x2b1c65[_0x6504('0xab')]>=_0x1cbeed[_0x6504('0xb1')]){rpcDb[_0x6504('0x80')](_0x2b1c65,_0x6504('0xaf'));}else{rpcDb[_0x6504('0xa7')](ut[_0x6504('0x83')](_0x2b1c65,'countnoanswerretry',_0x1cbeed['dialNoAnswerRetryFrequency']),_0x2b1c65[_0x6504('0x84')],_0x2b1c65[_0x6504('0xa8')]);}}}else{_0x2b1c65[_0x6504('0xab')]++;_0xee89dc[_0x6504('0x88')]({'id':_0x2b1c65['idContact'],'field':{'countnoanswerretry':_0x2b1c65['countnoanswerretry']}})[_0x6504('0x5c')](function(){_0xee89dc['swapAdditionalPhones'](_0x2b1c65,_0x2a1ede,_0x2ce30d)[_0x6504('0x5c')](function(){});});}});break;case'CONGESTION':_0x1cbeed[_0x6504('0xb2')]+=0x1;_0x2b1c65[_0x6504('0xb3')]+=0x1;_0x2b1c65['countglobal']=ut[_0x6504('0x76')](_0x2b1c65);ut[_0x6504('0x64')](_0x2b1c65,0x8,'Congestion');_0x2a1ede=_0x1cbeed[_0x6504('0xb4')];_0x2ce30d=_0x1cbeed['callAdditionalPhoneAfterMin'];ami[_0x6504('0x2e')]('custom:agentcongestion',ut['buildObj'](_0x2b1c65,'congestion'));rpcDb[_0x6504('0x68')](_0x2b1c65,_0x6504('0xb5'));_0xee89dc[_0x6504('0x7a')](_0x2b1c65,'8',_0x1cbeed)['then'](function(_0x54ded4){_0x2ed727=_0x54ded4[_0x6504('0x7b')]==0x1;if(!_0x2ed727){if(ut[_0x6504('0x76')](_0x2b1c65)>=_0x1cbeed['dialGlobalMaxRetry']){_0x3a6a01=ut[_0x6504('0x7e')](_0x2b1c65,0xf,_0x6504('0x7f'));rpcDb[_0x6504('0x80')](_0x3a6a01,_0x6504('0xb6'));}else{if(_0x2b1c65[_0x6504('0xb3')]>=_0x1cbeed[_0x6504('0xb7')]){rpcDb['createCustomerFinal'](_0x2b1c65,_0x6504('0xb5'));}else{rpcDb[_0x6504('0xa7')](ut[_0x6504('0x83')](_0x2b1c65,'countcongestionretry',_0x1cbeed[_0x6504('0x9f')]),_0x2b1c65[_0x6504('0x84')],_0x2b1c65[_0x6504('0xa8')]);}}}else{_0x2b1c65['countcongestionretry']++;_0xee89dc['incrementPreviewCounters']({'id':_0x2b1c65[_0x6504('0x87')],'field':{'countcongestionretry':_0x2b1c65['countcongestionretry']}})[_0x6504('0x5c')](function(){_0xee89dc[_0x6504('0x89')](_0x2b1c65,_0x2a1ede,_0x2ce30d)[_0x6504('0x5c')](function(){});});}});break;case _0x6504('0xb8'):_0x1cbeed[_0x6504('0xb9')]+=0x1;_0x2b1c65[_0x6504('0xba')]+=0x1;_0x2b1c65[_0x6504('0xac')]=ut[_0x6504('0x76')](_0x2b1c65);ut[_0x6504('0x64')](_0x2b1c65,0x14,'AgentReject');_0x2a1ede=_0x1cbeed['dialAgentRejectRetryFrequency'];_0x2ce30d=_0x1cbeed[_0x6504('0x7d')];ami['emit'](_0x6504('0xbb'),ut['buildObj'](_0x2b1c65,_0x6504('0xbc')));rpcDb[_0x6504('0x68')](_0x2b1c65,_0x6504('0xbd'));_0xee89dc[_0x6504('0x7a')](_0x2b1c65,'20',_0x1cbeed)['then'](function(_0x7ba85b){_0x2ed727=_0x7ba85b['additional']==0x1;if(!_0x2ed727){if(ut[_0x6504('0x76')](_0x2b1c65)>=_0x1cbeed[_0x6504('0xa3')]){_0x3a6a01=ut[_0x6504('0x7e')](_0x2b1c65,0x14,_0x6504('0xbe'));rpcDb[_0x6504('0x80')](_0x3a6a01,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x2b1c65[_0x6504('0xba')]>=_0x1cbeed[_0x6504('0xbf')]){rpcDb['createCustomerFinal'](_0x2b1c65,_0x6504('0xc0'));}else{rpcDb['rescheduleContact'](ut[_0x6504('0x83')](_0x2b1c65,_0x6504('0xba'),_0x1cbeed[_0x6504('0xc1')]),_0x2b1c65[_0x6504('0x84')],_0x2b1c65[_0x6504('0xa8')]);}}}else{_0x2b1c65[_0x6504('0xab')]++;_0xee89dc[_0x6504('0x88')]({'id':_0x2b1c65['idContact'],'field':{'countnoanswerretry':_0x2b1c65[_0x6504('0xab')]}})['then'](function(){_0xee89dc[_0x6504('0x89')](_0x2b1c65,_0x2a1ede,_0x2ce30d)['then'](function(){});});}});break;case _0x6504('0xc2'):_0x1cbeed[_0x6504('0xc3')]+=0x1;_0x2b1c65[_0x6504('0xc4')]+=0x1;_0x2b1c65[_0x6504('0xac')]=ut['totalGlobal'](_0x2b1c65);ut[_0x6504('0x64')](_0x2b1c65,0xb,'Abandoned');rpcDb[_0x6504('0x68')](_0x2b1c65,_0x6504('0xc5'));_0xee89dc[_0x6504('0x7a')](_0x2b1c65,'11',_0x1cbeed)[_0x6504('0x5c')](function(_0x4e22aa){_0x2ed727=_0x4e22aa[_0x6504('0x7b')]==0x1;if(!_0x2ed727){if(ut[_0x6504('0x76')](_0x2b1c65)>=_0x1cbeed[_0x6504('0xa3')]){_0x3a6a01=ut['cloneAction'](_0x2b1c65,0xf,_0x6504('0x7f'));rpcDb['createCustomerFinal'](_0x3a6a01,_0x6504('0xc5'));}else{if(_0x2b1c65[_0x6504('0xc6')]>=_0x1cbeed[_0x6504('0xc7')]){rpcDb[_0x6504('0x80')](_0x2b1c65,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x6504('0xa7')](ut[_0x6504('0x83')](_0x2b1c65,_0x6504('0xc4'),_0x1cbeed[_0x6504('0xc8')]),_0x2b1c65[_0x6504('0x84')],_0x2b1c65[_0x6504('0xa8')]);}}}else{_0x2b1c65[_0x6504('0xab')]++;_0xee89dc[_0x6504('0x88')]({'id':_0x2b1c65[_0x6504('0x87')],'field':{'countnoanswerretry':_0x2b1c65[_0x6504('0xab')]}})[_0x6504('0x5c')](function(){_0xee89dc[_0x6504('0x89')](_0x2b1c65,_0x2a1ede,_0x2ce30d)['then'](function(){});});}});break;case'18':_0x1cbeed[_0x6504('0xc9')]+=0x1;_0x2b1c65[_0x6504('0xca')]+=0x1;_0x2b1c65['countglobal']=ut[_0x6504('0x76')](_0x2b1c65);ut[_0x6504('0x64')](_0x2b1c65,0x12,_0x1ffdc1[_0x6504('0xcb')]||_0x1ffdc1[_0x6504('0xcc')]);ami[_0x6504('0x2e')]('custom:amd',ut[_0x6504('0x78')](_0x2b1c65,_0x6504('0xcd')));rpcDb[_0x6504('0x68')](_0x2b1c65,_0x6504('0xce'));_0xee89dc['verifyAdditionalPhones'](_0x2b1c65,'18',_0x1cbeed)[_0x6504('0x5c')](function(_0x5d93c9){_0x2ed727=_0x5d93c9[_0x6504('0x7b')]==0x1;if(!_0x2ed727){if(ut[_0x6504('0x76')](_0x2b1c65)>=_0x1cbeed[_0x6504('0xa3')]){_0x3a6a01=ut[_0x6504('0x7e')](_0x2b1c65,0x12,'Global');rpcDb[_0x6504('0x80')](_0x3a6a01,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x6504('0x80')](_0x2b1c65,_0x6504('0xce'));}}else{_0x2b1c65[_0x6504('0xab')]++;_0xee89dc[_0x6504('0x88')]({'id':_0x2b1c65['idContact'],'field':{'countnoanswerretry':_0x2b1c65[_0x6504('0xab')]}})[_0x6504('0x5c')](function(){_0xee89dc[_0x6504('0x89')](_0x2b1c65,_0x2a1ede,_0x2ce30d)[_0x6504('0x5c')](function(){});});}});delete this['actions'][_0x1ffdc1[_0x6504('0x85')]];break;case'19':_0x1cbeed[_0x6504('0xc9')]+=0x1;_0x2b1c65['countglobal']=ut[_0x6504('0x76')](_0x2b1c65);ut['logCustomer'](_0x2b1c65,0x13,_0x1ffdc1[_0x6504('0xcb')]||_0x1ffdc1['dialstatus']);ami[_0x6504('0x2e')]('custom:amd',ut[_0x6504('0x78')](_0x2b1c65,_0x6504('0xcd')));rpcDb['createCustomerHistory'](_0x2b1c65,_0x6504('0xcf'));_0xee89dc['verifyAdditionalPhones'](_0x2b1c65,'18',_0x1cbeed)[_0x6504('0x5c')](function(_0x4621a1){_0x2ed727=_0x4621a1['additional']==0x1;if(!_0x2ed727){if(ut[_0x6504('0x76')](_0x2b1c65)>=_0x1cbeed[_0x6504('0xa3')]){_0x3a6a01=ut[_0x6504('0x7e')](_0x2b1c65,0xf,'Global');rpcDb[_0x6504('0x80')](_0x3a6a01,_0x6504('0xcf'));}else{rpcDb[_0x6504('0x80')](_0x2b1c65,_0x6504('0xcf'));}}else{_0x2b1c65[_0x6504('0xab')]++;_0xee89dc[_0x6504('0x88')]({'id':_0x2b1c65[_0x6504('0x87')],'field':{'countnoanswerretry':_0x2b1c65[_0x6504('0xab')]}})[_0x6504('0x5c')](function(){_0xee89dc[_0x6504('0x89')](_0x2b1c65,_0x2a1ede,_0x2ce30d)[_0x6504('0x5c')](function(){});});}});delete this[_0x6504('0x17')][_0x1ffdc1['linkedid']];break;default:if(_0x2b1c65[_0x6504('0x4c')]){ut[_0x6504('0xd0')](_0x1cbeed,_0x6504('0xd1'));ut[_0x6504('0x57')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x1cbeed[_0x6504('0x2c')],_0x1ffdc1);}_0x1cbeed[_0x6504('0xc9')]+=0x1;_0x2b1c65['countglobal']=ut['totalGlobal'](_0x2b1c65);ut[_0x6504('0x64')](_0x2b1c65,0xc,_0x1ffdc1['cause-txt']||_0x1ffdc1[_0x6504('0xcc')]);_0x2a1ede=_0x1cbeed[_0x6504('0xc1')];_0x2ce30d=_0x1cbeed[_0x6504('0x7d')];rpcDb[_0x6504('0x68')](_0x2b1c65,_0x6504('0xd2'));_0xee89dc['verifyAdditionalPhones'](_0x2b1c65,'20',_0x1cbeed)[_0x6504('0x5c')](function(_0xc2dcee){_0x2ed727=_0xc2dcee[_0x6504('0x7b')]==0x1;if(!_0x2ed727){if(ut['totalGlobal'](_0x2b1c65)>=_0x1cbeed['dialGlobalMaxRetry']){_0x3a6a01=ut[_0x6504('0x7e')](_0x2b1c65,0xf,_0x6504('0x7f'));rpcDb[_0x6504('0x80')](_0x3a6a01,_0x6504('0xd3'));}else{rpcDb['createCustomerFinal'](_0x2b1c65,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x6504('0x17')][_0x1ffdc1[_0x6504('0x85')]];}else{_0xee89dc[_0x6504('0x89')](_0x2b1c65,_0x2a1ede,_0x2ce30d)[_0x6504('0x5c')](function(){});}});}if(!(_0x2b1c65[_0x6504('0x4c')]&&_0x3a945b==='16')){ut['updateOriginated'](_0x1cbeed,'[callProgressDetectingCustomer]');logger[_0x6504('0x27')](_0x6504('0xd4'),_0x2b1c65[_0x6504('0x8e')],_0x6504('0x8f'),_0x1cbeed['name'],_0x6504('0x4b'),_0x1cbeed[_0x6504('0x30')]);}if(_0x3a945b!=='ANSWER'){delete this[_0x6504('0x17')][_0x1ffdc1['linkedid']];delete this[_0x6504('0x17')][_0x1ffdc1[_0x6504('0xd5')]];}_0x1cbeed[_0x6504('0xd6')]=!![];}};Preview[_0x6504('0x10')][_0x6504('0xd7')]=function(_0xdc4c9b,_0x103ba0,_0x683d8f){if(_[_0x6504('0xd8')](_0x103ba0)&&_0x6504('0xd9')!==typeof _0x103ba0){return;}if(_[_0x6504('0xd8')](_0x683d8f)&&_0x6504('0xd9')!==typeof _0x683d8f){return;}switch(_0x683d8f[_0x6504('0xda')]){case'0':ut[_0x6504('0xdb')](_0xdc4c9b,0x0,_0x6504('0x77'));rpcDb[_0x6504('0xdc')](_0xdc4c9b,_0x6504('0xdd'));break;case'3':ut[_0x6504('0xdb')](_0xdc4c9b,0x3,_0x6504('0xde'));rpcDb[_0x6504('0xdc')](_0xdc4c9b,_0x6504('0xdf'));break;case'5':ut[_0x6504('0xdb')](_0xdc4c9b,0x5,_0x6504('0xe0'));rpcDb[_0x6504('0xdc')](_0xdc4c9b,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x6504('0xdb')](_0xdc4c9b,0x8,_0x6504('0xe1'));rpcDb[_0x6504('0xdc')](_0xdc4c9b,_0x6504('0xe2'));break;case'22':ut[_0x6504('0xdb')](_0xdc4c9b,0x16,_0x6504('0xe3'));rpcDb[_0x6504('0xdc')](_0xdc4c9b,_0x6504('0xe4'));break;default:ut[_0x6504('0xdb')](_0xdc4c9b,0xc,_0x683d8f[_0x6504('0xda')]);rpcDb[_0x6504('0xdc')](_0xdc4c9b,_0x6504('0xe2'));}ut[_0x6504('0x55')](_0x103ba0,_0x6504('0xe5'));logger[_0x6504('0x27')](_0x6504('0xe6'),_0xdc4c9b[_0x6504('0x8e')],_0x6504('0x8f'),_0x103ba0[_0x6504('0x2c')],_0x6504('0x4b'),_0x103ba0[_0x6504('0x30')]);delete this[_0x6504('0x17')][_0xdc4c9b[_0x6504('0x8e')]];};Preview[_0x6504('0x10')][_0x6504('0x7a')]=function(_0x4f0b5c,_0x110741,_0x27f3bd){return cmHopperAdditionalPhone[_0x6504('0x7a')](_0x4f0b5c,_0x110741,_0x27f3bd)[_0x6504('0x53')](logger['info']('[verifyAdditionalPhone]\x20'));};Preview[_0x6504('0x10')][_0x6504('0x89')]=function(_0x5a709d,_0x256f9e,_0x46fa7e){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x5a709d,_0x256f9e,_0x46fa7e)['catch'](logger[_0x6504('0x27')]('[swapAdditionalPhone]\x20'));};Preview[_0x6504('0x10')]['incrementPreviewCounters']=function(_0x4ef03e){return Promise[_0x6504('0xe7')]()['then'](cmHopperAdditionalPhone[_0x6504('0x88')](_0x4ef03e))['catch'](logger[_0x6504('0x27')](_0x6504('0xe8')));};Preview['prototype'][_0x6504('0xe9')]=function(_0x7d2057,_0x246df8,_0x1680ba,_0x5b099f,_0x36206e){var _0x3941c2=this;return new Promise(function(_0x19b3d6,_0x2c6d0e){if(_[_0x6504('0x47')](_0x246df8)||_[_0x6504('0x47')](_0x246df8[_0x6504('0xea')])||_[_0x6504('0x47')](_0x246df8[_0x6504('0xeb')])||_['isNil'](_0x246df8[_0x6504('0x50')])){_0x2c6d0e(ut[_0x6504('0x34')](_0x6504('0xec'),_0x5b099f,_0x36206e));return;}var _0x4ca363=uuid['v4']();var _0x4f9242=_0x3941c2['campaignsPreview'][_0x246df8[_0x6504('0x49')][_0x6504('0x2c')]];var _0x5f3adf=_0x1680ba?_0x3941c2[_0x6504('0x18')][_0x1680ba]['id']:undefined;_0x3941c2[_0x6504('0x17')][_0x4ca363]=new Action(_0x246df8,_0x4f9242,_0x4ca363,_0x1680ba,_0x5f3adf);var _0xa62745=_0x3941c2[_0x6504('0x17')][_0x4ca363];_0xa62745[_0x6504('0x84')]=_0x5b099f;_0xa62745['activeContact']=_0x36206e;_0xa62745[_0x6504('0xed')]=_0x1680ba;if(_[_0x6504('0xee')](_0x7d2057)){_0x3941c2[_0x6504('0xef')](_0xa62745,_0x4f9242,_0x246df8,_0x1680ba)[_0x6504('0x5c')](function(_0x4f8a3f){logger['info']('[Preview][execCall][success]',_0x6504('0xf0')+_0xa62745[_0x6504('0x4a')]+_0x6504('0xf1')+_0xa62745[_0x6504('0x87')],JSON[_0x6504('0x29')](_0x4f8a3f));ami[_0x6504('0x2e')](_0x6504('0xf2'),ut[_0x6504('0x78')](_0xa62745,_0x6504('0xf3'),_0x3941c2[_0x6504('0x15')][_0xa62745[_0x6504('0x4a')]]));_0x19b3d6(ut[_0x6504('0x34')](_0x6504('0xf4')));})['catch'](function(_0x5c90ff){ut[_0x6504('0x37')](_0x6504('0xf5'),_0x5c90ff);_0x2c6d0e(ut[_0x6504('0x34')](_0x6504('0xf6'),_0x5b099f,_0x36206e));});}else{_0x4f9242['outboundBlacklistCallsDay']+=0x1;ut[_0x6504('0xf7')](_0xa62745);rpcDb[_0x6504('0xf8')](_0xa62745,'[Blacklist][error]');delete _0x3941c2[_0x6504('0x17')][_0x4ca363];_0x2c6d0e(ut[_0x6504('0x34')]('Contact\x20in\x20black\x20List',_0x5b099f,_0x36206e));}});};Preview[_0x6504('0x10')][_0x6504('0xf9')]=function(_0x13985d){return!_[_0x6504('0x47')](_0x13985d)&&!_['isNil'](_0x13985d[_0x6504('0x2c')])&&!_['isNil'](_0x13985d[_0x6504('0xfa')])&&_0x13985d[_0x6504('0xfa')]&&!_['isNil'](this['trunks'][util[_0x6504('0x2a')]('SIP/%s',_0x13985d[_0x6504('0x2c')])])&&!_['isNil'](this[_0x6504('0xfb')][util['format'](_0x6504('0xfc'),_0x13985d['name'])][_0x6504('0xfd')])&&(this['trunks'][util[_0x6504('0x2a')](_0x6504('0xfc'),_0x13985d[_0x6504('0x2c')])][_0x6504('0xfd')]==='reachable'||this[_0x6504('0xfb')][util[_0x6504('0x2a')]('SIP/%s',_0x13985d['name'])][_0x6504('0xfd')]==='unmonitored');};Preview['prototype'][_0x6504('0x5f')]=function(_0x4e4740,_0xe7e3f6){return this[_0x6504('0xfe')](_0x4e4740,_0xe7e3f6)[_0x6504('0x5c')](function(_0x43370d){return _[_0x6504('0x4d')](_0x43370d,['message']);})[_0x6504('0x53')](function(_0xa882bc){if(_0xa882bc[_0x6504('0xff')]){rpcDb[_0x6504('0x100')](_0x4e4740);}if(_0xa882bc['active']){rpcDb[_0x6504('0x101')](_0x4e4740);}throw _[_0x6504('0x4d')](_0xa882bc,[_0x6504('0x34')]);});};Preview[_0x6504('0x10')][_0x6504('0xfe')]=function(_0x497684,_0x329bb5){var _0xba4d6e=this;var _0xe31e55,_0x245e21;return rpcDb['getContactPreview'](_0x497684)[_0x6504('0x5c')](function(_0x3c1d99){if(!_['isNil'](_0x3c1d99[0x0])){_0x245e21=_0x3c1d99[0x0][_0x6504('0x102')]?![]:!![];_0xe31e55=_0x3c1d99[0x0][_0x6504('0x102')]?!![]:![];_0xe31e55=_0x329bb5?!![]:_0xe31e55;}var _0x44a9e2=_0xba4d6e[_0x6504('0x103')](_0x3c1d99);if(_0x44a9e2['isValid']){rpcDb['checkIsBlackList'](_['pick'](_0x3c1d99[0x0],[_0x6504('0x50'),_0x6504('0xeb')]))[_0x6504('0x5c')](function(_0xf7f94c){_0xba4d6e['checkInBlack'](_0xf7f94c,_0x3c1d99[0x0],_0x329bb5,_0x245e21,_0xe31e55)[_0x6504('0x5c')](function(_0x3147d0){return _0x3147d0;})['catch'](function(_0x236264){throw _0x236264;});})[_0x6504('0x53')](function(_0x2b6709){ut[_0x6504('0x37')]('[Preview][checkIsBlackList]',_0x2b6709);throw ut[_0x6504('0x34')]('Call\x20unsuccessful',_0x245e21,_0xe31e55);});}else{throw ut[_0x6504('0x34')](_0x44a9e2[_0x6504('0x34')],_0x245e21,_0xe31e55);}})[_0x6504('0x53')](function(_0x4f5458){ut[_0x6504('0x37')](_0x6504('0x104'),_0x4f5458);throw ut[_0x6504('0x34')]('Call\x20unsuccessful',![],!![]);});};Preview['prototype']['validateContact']=function(_0x4b5504){if(_['isNil'](_0x4b5504)||_[_0x6504('0xee')](_0x4b5504)||!_[_0x6504('0x47')](_0x4b5504[0x0][_0x6504('0x5e')])&&_[_0x6504('0x47')](_0x4b5504[0x0]['Agent'][_0x6504('0x2c')])){ut[_0x6504('0x37')](_0x6504('0x105'),_0x4b5504);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x31ebff=this[_0x6504('0x15')][_0x4b5504[0x0][_0x6504('0x49')][_0x6504('0x2c')]];_0x31ebff[_0x6504('0x34')]=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x6504('0x47')](_0x31ebff)){ut[_0x6504('0x37')](_0x6504('0x106'),_0x31ebff);return{'isValid':![],'message':_0x6504('0x107')};}if(!this[_0x6504('0xf9')](_0x31ebff['Trunk'])){ut[_0x6504('0x37')](_0x6504('0x108'),'campaign\x20Name:\x20'+_0x31ebff[_0x6504('0x2c')]+_0x6504('0x109'));if(!this['isTrunkReachable'](_0x31ebff[_0x6504('0x71')])){ut[_0x6504('0x37')](_0x6504('0x108'),_0x31ebff[_0x6504('0x2c')]+_0x6504('0x10a'));return{'isValid':![],'message':_0x6504('0x10b')};}}if(!ut[_0x6504('0x6e')](_0x31ebff[_0x6504('0x6f')])){ut[_0x6504('0x37')](_0x6504('0x10c'),_0x31ebff[_0x6504('0x2c')]+_0x6504('0x10d'));return{'isValid':![],'message':_0x6504('0x10e')+_0x31ebff[_0x6504('0x2c')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x6504('0x10f')};};Preview[_0x6504('0x10')][_0x6504('0xef')]=function(_0xe827b,_0x25c3fd,_0x2f3bca,_0x5a3f17){var _0x455b30=this;return new Promise(function(_0x424f5a,_0x15b6c9){var _0x3db731=_0xe827b[_0x6504('0x8e')];var _0x5d2213=_0x455b30[_0x6504('0xf9')](_0x25c3fd[_0x6504('0x70')])?util[_0x6504('0x2a')](_0x6504('0x110'),_0x25c3fd['Trunk'][_0x6504('0x2c')],_[_0x6504('0x47')](_0x25c3fd['dialPrefix'])?'':_0x25c3fd[_0x6504('0x111')][_0x6504('0x112')]()||'',_0x25c3fd[_0x6504('0x113')]>0x0?_0x2f3bca[_0x6504('0xeb')][_0x6504('0x114')](_0x25c3fd[_0x6504('0x113')]):_0x2f3bca[_0x6504('0xeb')]):util[_0x6504('0x2a')](_0x6504('0x110'),_[_0x6504('0x47')](_0x25c3fd[_0x6504('0x71')])?_0x25c3fd[_0x6504('0x70')][_0x6504('0x2c')]:_0x25c3fd[_0x6504('0x71')]['name'],_['isNil'](_0x25c3fd[_0x6504('0x111')])?'':_0x25c3fd[_0x6504('0x111')][_0x6504('0x112')]()||'',_0x25c3fd[_0x6504('0x113')]>0x0?_0x2f3bca[_0x6504('0xeb')]['substring'](_0x25c3fd['dialCutDigit']):_0x2f3bca[_0x6504('0xeb')]);var _0x40dfba=_0x455b30[_0x6504('0xf9')](_0x25c3fd[_0x6504('0x70')])?ut[_0x6504('0x115')](_0x25c3fd[_0x6504('0x70')][_0x6504('0x116')],_0x25c3fd[_0x6504('0x117')],_0x25c3fd[_0x6504('0x118')]>0x0?ut[_0x6504('0x119')](_0x25c3fd[_0x6504('0x11a')],_0x25c3fd[_0x6504('0x118')]):_0x25c3fd[_0x6504('0x11a')]):ut[_0x6504('0x115')](_[_0x6504('0x47')](_0x25c3fd['TrunkBackup'])?_0x25c3fd[_0x6504('0x70')][_0x6504('0x116')]:_0x25c3fd[_0x6504('0x71')][_0x6504('0x116')],_0x25c3fd[_0x6504('0x117')],_0x25c3fd[_0x6504('0x118')]>0x0?ut[_0x6504('0x119')](_0x25c3fd[_0x6504('0x11a')],_0x25c3fd[_0x6504('0x118')]):_0x25c3fd[_0x6504('0x11a')]);if(_0x40dfba){_0xe827b[_0x6504('0x11b')]=ut['extractCalleridName'](_0x40dfba);_0xe827b[_0x6504('0x11c')]=ut[_0x6504('0x11d')](_0x40dfba);}var _0x12d6b0=ut[_0x6504('0x11e')](_0x25c3fd,_0x2f3bca,_0x5d2213,_0x40dfba,_0x3db731,_0xe827b);var _0x4cb2f2=utils['setXMDContactVariables'](_0x2f3bca[_0x6504('0xea')]);Object[_0x6504('0x11f')](_0x12d6b0,_0x4cb2f2);_[_0x6504('0x120')](_0xe827b,ut['toLowerVariables'](_0x12d6b0));_0xe827b[_0x6504('0x62')]=moment()[_0x6504('0x2a')](_0x6504('0x63'));_0x25c3fd[_0x6504('0x121')]=_0x12d6b0;var _0x41316b=ut[_0x6504('0x122')](_0xe827b,_0x25c3fd,_0x12d6b0,_0xe827b[_0x6504('0xa8')],_0x5a3f17);return ami['Action'](_0x41316b)['then'](function(_0x3263f3){_0x25c3fd[_0x6504('0x30')]+=0x1;logger[_0x6504('0x27')](_0x6504('0x123'),_0x3db731,_0x6504('0x8f'),_0x25c3fd['name'],_0x6504('0x4b'),_0x25c3fd[_0x6504('0x30')]);_0x424f5a(_0x3263f3);})[_0x6504('0x53')](function(_0x555ea8){ut['logAgent'](_0xe827b,0xe,_0x6504('0x124'));rpcDb['createAgentHistory'](_0xe827b,_0x6504('0x125'));_0x15b6c9(_0x555ea8);});});};Preview[_0x6504('0x10')][_0x6504('0x22')]=function(_0x25cae5){if(this[_0x6504('0x17')][_0x25cae5[_0x6504('0x85')]]){this[_0x6504('0x17')][_0x25cae5[_0x6504('0x85')]][_0x6504('0x52')]=_0x25cae5[_0x6504('0x52')];}};Preview['prototype'][_0x6504('0x1a')]=function(_0x540ebf){var _0x44ffb5=this;var _0x28a5bb=this[_0x6504('0x17')][_0x540ebf[_0x6504('0x126')]];if(_0x28a5bb){if(_0x28a5bb[_0x6504('0xed')]&&this['agents'][_0x28a5bb[_0x6504('0xed')]]){ut[_0x6504('0x127')](_0x28a5bb,this['agents'][_0x28a5bb[_0x6504('0xed')]]['name'],this[_0x6504('0x18')][_0x28a5bb[_0x6504('0xed')]]['id']);}var _0x21b9c8=_['clone'](_0x28a5bb);_0x21b9c8['responsetime']=moment()[_0x6504('0x2a')](_0x6504('0x63'));var _0x5293e2=_0x44ffb5[_0x6504('0x15')][_0x28a5bb[_0x6504('0x4a')]];if(ut[_0x6504('0x128')](_0x540ebf[_0x6504('0x129')])){if(_0x28a5bb[_0x6504('0x84')]){rpcDb[_0x6504('0x100')](_0x28a5bb[_0x6504('0x87')]);}if(_0x28a5bb[_0x6504('0xa8')]){rpcDb[_0x6504('0x101')](_0x28a5bb[_0x6504('0x87')]);}ami[_0x6504('0x2e')](_0x6504('0x12a'),ut[_0x6504('0x78')](_0x28a5bb,'rejected',this[_0x6504('0x15')][_0x28a5bb['queue']]));this[_0x6504('0xd7')](_0x21b9c8,_0x5293e2,_0x540ebf);}else{_0x28a5bb[_0x6504('0x62')]=moment()[_0x6504('0x2a')](_0x6504('0x63'));ut[_0x6504('0xdb')](_0x21b9c8,0x4,_0x6504('0x12b'));rpcDb['createAgentHistory'](_0x21b9c8,_0x6504('0x12c'));}}};Preview['prototype'][_0x6504('0x1d')]=function(_0x1b000b){var _0xfaeea8=this[_0x6504('0x17')][_0x1b000b['linkedid']];var _0x44b8e5;if(_0xfaeea8){_0x44b8e5=this[_0x6504('0x15')][_0xfaeea8[_0x6504('0x4a')]];logger[_0x6504('0x27')]('[syncHangup][talking]',_0x1b000b['linkedid'],_0x6504('0x8f'),_0x44b8e5[_0x6504('0x2c')],_0x6504('0x90'),_0x44b8e5[_0x6504('0x31')]);}if(this['actions'][_0x1b000b[_0x6504('0x85')]]&&_0x1b000b[_0x6504('0x85')]!==_0x1b000b[_0x6504('0x8e')]){if(_0x1b000b[_0x6504('0x12d')]==='16'&&this[_0x6504('0x17')][_0x1b000b[_0x6504('0x85')]][_0x6504('0x4c')]){this['callProgressDetectingCustomer'](_0x1b000b,_0x1b000b[_0x6504('0x85')],_0x1b000b[_0x6504('0x12d')]);}else if(this['actions'][_0x1b000b[_0x6504('0x85')]][_0x6504('0x4c')]){logger['info'](_0x6504('0x12e'),_0x1b000b[_0x6504('0x85')],_0x1b000b[_0x6504('0x12d')],_0x6504('0x8f'),_0x44b8e5[_0x6504('0x2c')],_0x6504('0x90'),_0x44b8e5[_0x6504('0x31')]);this['callProgressDetectingCustomer'](_0x1b000b,_0x1b000b['linkedid'],_0x1b000b[_0x6504('0x12d')]);}}else if(_0xfaeea8&&_[_0x6504('0x47')](_0xfaeea8[_0x6504('0x12f')])&&_0x44b8e5[_0x6504('0x130')]&&_0x1b000b[_0x6504('0x85')]===_0x1b000b['uniqueid']&&_['isNil'](_0x1b000b[_0x6504('0xda')])&&_0x1b000b[_0x6504('0x12d')]==='16'&&_0x1b000b[_0x6504('0x131')]==='6'&&_['isUndefined'](_0xfaeea8[_0x6504('0x132')])){if(_0xfaeea8[_0x6504('0x84')]){rpcDb[_0x6504('0x100')](_0xfaeea8[_0x6504('0x87')]);}if(_0xfaeea8['activeContact']){rpcDb['disableContact'](_0xfaeea8[_0x6504('0x87')]);}_0x1b000b[_0x6504('0xda')]='22';this[_0x6504('0xd7')](_0xfaeea8,_0x44b8e5,_0x1b000b);}else if(_0xfaeea8&&_0xfaeea8[_0x6504('0x132')]){if(_0x1b000b['cause']==='16'&&this['actions'][_0x1b000b[_0x6504('0x85')]][_0x6504('0x4c')]){logger[_0x6504('0x27')](_0x6504('0x133'),_0x1b000b[_0x6504('0x85')],_0x1b000b[_0x6504('0x12d')],_0x6504('0x8f'),_0x44b8e5[_0x6504('0x2c')],_0x6504('0x90'),_0x44b8e5[_0x6504('0x31')]);this[_0x6504('0x73')](_0x1b000b,_0x1b000b['linkedid'],_0x1b000b[_0x6504('0x12d')]);}else if(this[_0x6504('0x17')][_0x1b000b[_0x6504('0x85')]][_0x6504('0x4c')]){logger['info'](_0x6504('0x12e'),_0x1b000b['linkedid'],_0x1b000b['cause'],_0x6504('0x8f'),_0x44b8e5[_0x6504('0x2c')],_0x6504('0x90'),_0x44b8e5['pTalking']);this[_0x6504('0x73')](_0x1b000b,_0x1b000b[_0x6504('0x85')],_0x1b000b['cause']);}}};Preview[_0x6504('0x10')]['syncDialEnd']=function(_0x5d023c){if(this['actions'][_0x5d023c[_0x6504('0xd5')]]&&_0x5d023c[_0x6504('0xd5')]!==_0x5d023c[_0x6504('0x134')]){this[_0x6504('0x73')](_0x5d023c,_0x5d023c[_0x6504('0xd5')],_0x5d023c['dialstatus']);}};Preview['prototype'][_0x6504('0x1e')]=function(_0x506e1a){if(this['actions'][_0x506e1a[_0x6504('0x85')]]&&_0x506e1a['linkedid']!==_0x506e1a[_0x6504('0x8e')]&&!this[_0x6504('0x17')][_0x506e1a[_0x6504('0x85')]][_0x6504('0x4c')]){if(_0x506e1a['cause']==='1'){this[_0x6504('0x73')](_0x506e1a,_0x506e1a['linkedid'],_0x506e1a[_0x6504('0x12d')]);}}};Preview[_0x6504('0x10')][_0x6504('0x135')]=function(_0x384bc7,_0x5e908c,_0x56b71d){if(this['actions'][_0x384bc7]){if(_[_0x6504('0x47')](this[_0x6504('0x17')][_0x384bc7][_0x6504('0x121')])){this[_0x6504('0x17')][_0x384bc7][_0x6504('0x121')]={};}this['actions'][_0x384bc7]['variables'][_0x5e908c]=_0x56b71d;}};Preview['prototype'][_0x6504('0x136')]=function(_0x713f6f){try{if(!_[_0x6504('0x47')](_0x713f6f)){if(ut[_0x6504('0x137')](_[_0x6504('0x138')](_0x713f6f[_0x6504('0x139')])[0x0])){this[_0x6504('0x135')](_0x713f6f['uniqueid'],_['keys'](_0x713f6f[_0x6504('0x139')])[0x0],_0x713f6f[_0x6504('0x13a')]);}}}catch(_0x29a008){logger[_0x6504('0x13b')](_0x6504('0x13c'),util[_0x6504('0x13d')](_0x29a008,{'showHidden':![],'depth':null}));}};Preview[_0x6504('0x10')][_0x6504('0x24')]=function(_0x4b8368){if(_0x4b8368){if(this[_0x6504('0x17')][_0x4b8368[_0x6504('0x13e')]]){this['actions'][_0x4b8368['transfertargetlinkedid']][_0x6504('0x132')]=!![];}}};Preview['prototype'][_0x6504('0x25')]=function(_0x573371){if(_0x573371){if(this[_0x6504('0x17')][_0x573371[_0x6504('0x13f')]]){this[_0x6504('0x17')][_0x573371[_0x6504('0x13f')]][_0x6504('0x132')]=!![];}}};module[_0x6504('0x140')]=Preview; \ No newline at end of file +var _0xb9d1=['dialAgentRejectRetryFrequency','agentreject','[syncHangupRequest][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','outboundUnknownCallsDay','countmachineretry','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','Contact','VoiceQueueId','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','called','Calling','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','active','recallme','validateContact','isValid','checkIsBlackList','phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','Trunk','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','setXMDContactVariables','merge','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','channel','actionid','lookAgent','isFailure','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','callProgressDetectingCustomer','statedesc','dialQueueProject','channelstate','[syncHangup][talking][transfer]','destuniqueid','syncVarSet','filterKey','keys','addVariable','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfer','transfererlinkedid','util','lodash','uuid','moment','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','newexten','varset','attendedtransfer','blindtransfer','syncBlindTransfer','emit','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','name','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','paused','message','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','CAMPAIGN_STATUS','DEACTIVATED','\x20is\x20deactivated','loopCampaigns','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','clearZombieChannels','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','stringify','originated','dialAnswer','pick','UserId','ListId','Action','status','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','info','[action]','size','clearZombieChannel','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','then','logger2','[RecallMe]','disableContact','starttime','format','outboundReCallsDay','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','loggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','nosuchnumber','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','idContact','incrementPreviewCounters','swapAdditionalPhones','YYYY-MM-DD\x20HH:mm:ss','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','buildObj','complete','outboundAnswerCallsDay','total','answered','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','dialCongestionRetryFrequency','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','outboundRejectCallsDay','AgentReject'];(function(_0x5f1286,_0x20bf53){var _0x4b7a02=function(_0x450c64){while(--_0x450c64){_0x5f1286['push'](_0x5f1286['shift']());}};_0x4b7a02(++_0x20bf53);}(_0xb9d1,0x1cf));var _0x1b9d=function(_0x2da399,_0x19efd6){_0x2da399=_0x2da399-0x0;var _0x37025b=_0xb9d1[_0x2da399];return _0x37025b;};'use strict';var util=require(_0x1b9d('0x0'));var _=require(_0x1b9d('0x1'));var uuid=require(_0x1b9d('0x2'));var moment=require(_0x1b9d('0x3'));var Redis=require('ioredis');var config=require(_0x1b9d('0x4'));var logger=require(_0x1b9d('0x5'))(_0x1b9d('0x6'));var loggerAction=require(_0x1b9d('0x5'))(_0x1b9d('0x7'));var ami=require('../ami');var rpcDb=require(_0x1b9d('0x8'));var cmHopperAdditionalPhone=require(_0x1b9d('0x9'));var Action=require(_0x1b9d('0xa'));var ut=require(_0x1b9d('0xb'));var utils=require('../dialer/utils');config[_0x1b9d('0xc')]=_[_0x1b9d('0xd')](config[_0x1b9d('0xc')],{'host':_0x1b9d('0xe'),'port':0x18eb});var io=require(_0x1b9d('0xf'))(new Redis(config[_0x1b9d('0xc')]));var Sequence=function(){};Sequence[_0x1b9d('0x10')][_0x1b9d('0x11')]=function(_0x34055e){this[_0x1b9d('0x12')]=this[_0x1b9d('0x12')]?this[_0x1b9d('0x12')][_0x1b9d('0x13')](_0x34055e):_0x34055e();};function Preview(_0x2d8f5c){this[_0x1b9d('0x14')]=new Sequence();this[_0x1b9d('0x15')]=_0x2d8f5c[_0x1b9d('0x16')];this[_0x1b9d('0x17')]=_0x2d8f5c[_0x1b9d('0x17')];this[_0x1b9d('0x18')]={};this['agents']=_0x2d8f5c[_0x1b9d('0x19')];this[_0x1b9d('0x1a')]=0x0;ami['on']('originateresponse',this[_0x1b9d('0x1b')][_0x1b9d('0x1c')](this));ami['on'](_0x1b9d('0x1d'),this['syncHangup']['bind'](this));ami['on'](_0x1b9d('0x1e'),this[_0x1b9d('0x1f')][_0x1b9d('0x1c')](this));ami['on'](_0x1b9d('0x20'),this['syncDialEnd'][_0x1b9d('0x1c')](this));ami['on'](_0x1b9d('0x21'),this['syncNewExten'][_0x1b9d('0x1c')](this));ami['on'](_0x1b9d('0x22'),this['syncVarSet'][_0x1b9d('0x1c')](this));ami['on'](_0x1b9d('0x23'),this['syncAttendedTransfer'][_0x1b9d('0x1c')](this));ami['on'](_0x1b9d('0x24'),this[_0x1b9d('0x25')][_0x1b9d('0x1c')](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x1b4396,_0x1090fa,_0x6dc6d1){io['to'](_0x1b4396)[_0x1b9d('0x26')](_0x1090fa,_0x6dc6d1);}function emitVoiceQueueChannelRemove(_0x12c550){logger['info'](_0x1b9d('0x27'),JSON['stringify'](_0x12c550));emit(util['format'](_0x1b9d('0x28'),_0x12c550[_0x1b9d('0x29')]),_0x1b9d('0x2a'),_0x12c550);io[_0x1b9d('0x26')]('voice_queue_presence:remove',_0x12c550);}function notSendMessagesQueue(_0x28152f){if(_0x28152f[_0x1b9d('0x2b')]){if(_0x28152f['originated']===0x0&&_0x28152f[_0x1b9d('0x2c')]===0x0){_0x28152f[_0x1b9d('0x2b')]=![];_0x28152f['available']=0x0;_0x28152f[_0x1b9d('0x2d')]=0x0;_0x28152f[_0x1b9d('0x2e')]=utils['CAMPAIGN_STATUS'][_0x1b9d('0x2f')];ut[_0x1b9d('0x30')](_0x1b9d('0x31'),_0x28152f[_0x1b9d('0x29')]+_0x1b9d('0x32'));}else{_0x28152f['message']=utils[_0x1b9d('0x33')][_0x1b9d('0x34')];ut[_0x1b9d('0x30')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x28152f[_0x1b9d('0x29')]+_0x1b9d('0x35'));}}}Preview[_0x1b9d('0x10')][_0x1b9d('0x36')]=function(){var _0x194b96=this;setInterval(function(){_0x194b96['syncCampaigns']();},0x7cf);};Preview[_0x1b9d('0x10')][_0x1b9d('0x37')]=function(){var _0x34778b=this[_0x1b9d('0x15')];this[_0x1b9d('0x1a')]+=0x1;for(var _0x33b315 in _0x34778b){if(_0x34778b[_0x1b9d('0x38')](_0x33b315)&&(_0x34778b[_0x33b315][_0x1b9d('0x39')]===_0x1b9d('0x6')||_0x34778b[_0x33b315]['dialMethod']===_0x1b9d('0x3a'))&&_0x34778b[_0x33b315][_0x1b9d('0x3b')]===_0x1b9d('0x3c')){if(this[_0x1b9d('0x1a')]>0x7){this[_0x1b9d('0x1a')]=0x0;this[_0x1b9d('0x3d')]();}}if(_0x34778b[_0x1b9d('0x38')](_0x33b315)&&_0x34778b[_0x33b315]['dialMethod']===_0x1b9d('0x6')&&_0x34778b[_0x33b315][_0x1b9d('0x3b')]==='outbound'){if(_0x34778b[_0x33b315][_0x1b9d('0x3e')]){this[_0x1b9d('0x3f')](_0x34778b[_0x33b315]);if(_0x34778b[_0x33b315][_0x1b9d('0x40')])this[_0x1b9d('0x41')](_0x34778b[_0x33b315]);}else{notSendMessagesQueue(_0x34778b[_0x33b315]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x30a50a){var _0x45d01f=this;this[_0x1b9d('0x14')][_0x1b9d('0x11')](function(){if(!_[_0x1b9d('0x42')](_0x45d01f[_0x1b9d('0x18')][_0x30a50a])){loggerAction['info'](_0x1b9d('0x43'),_0x30a50a,_0x1b9d('0x44'),_0x45d01f['actions'][_0x30a50a][_0x1b9d('0x45')],_0x1b9d('0x46'),JSON[_0x1b9d('0x47')](_0x45d01f[_0x1b9d('0x15')][_0x45d01f[_0x1b9d('0x18')][_0x30a50a][_0x1b9d('0x45')]][_0x1b9d('0x48')]),'pTalking:\x20',JSON[_0x1b9d('0x47')](_0x45d01f[_0x1b9d('0x15')][_0x45d01f[_0x1b9d('0x18')][_0x30a50a][_0x1b9d('0x45')]][_0x1b9d('0x2c')]),JSON[_0x1b9d('0x47')](_0x45d01f['actions'][_0x30a50a][_0x1b9d('0x49')]),JSON[_0x1b9d('0x47')](_[_0x1b9d('0x4a')](_0x45d01f['actions'][_0x30a50a],['contactId',_0x1b9d('0x4b'),'VoiceQueueId',_0x1b9d('0x4c')])));return ami[_0x1b9d('0x4d')]({'action':_0x1b9d('0x4e'),'channel':_0x45d01f[_0x1b9d('0x18')][_0x30a50a]['channel']})[_0x1b9d('0x4f')](function(_0x371d25){if(_0x371d25[_0x1b9d('0x2e')]===_0x1b9d('0x50')){setTimeout(function(){if(_0x45d01f[_0x1b9d('0x18')][_0x30a50a]){ut[_0x1b9d('0x51')](_0x45d01f[_0x1b9d('0x15')][_0x45d01f['actions'][_0x30a50a]['queue']],'[clearZombieChannel]');if(_0x45d01f[_0x1b9d('0x18')][_0x30a50a][_0x1b9d('0x49')]===!![]){ut[_0x1b9d('0x52')](_0x45d01f[_0x1b9d('0x15')][_0x45d01f[_0x1b9d('0x18')][_0x30a50a][_0x1b9d('0x45')]],_0x1b9d('0x53'));ut[_0x1b9d('0x54')](_0x1b9d('0x55')+_0x30a50a,_0x45d01f[_0x1b9d('0x18')][_0x30a50a][_0x1b9d('0x45')]);}ut[_0x1b9d('0x54')](_0x1b9d('0x56')+_0x30a50a,_0x45d01f[_0x1b9d('0x18')][_0x30a50a][_0x1b9d('0x45')]);delete _0x45d01f[_0x1b9d('0x18')][_0x30a50a];}},0x2328);}});}});};Preview[_0x1b9d('0x10')][_0x1b9d('0x3d')]=function(){var _0x5bc584=this;loggerAction[_0x1b9d('0x57')](_0x1b9d('0x58'),_[_0x1b9d('0x59')](this[_0x1b9d('0x18')]));for(var _0x788674 in this[_0x1b9d('0x18')]){if(_0x5bc584[_0x1b9d('0x18')][_0x1b9d('0x38')](_0x788674)){_0x5bc584[_0x1b9d('0x5a')](_0x788674);}}};Preview['prototype']['recallMe']=function(_0x2969d6){var _0x11ecb0=this;rpcDb[_0x1b9d('0x5b')](_0x2969d6['id'],ut[_0x1b9d('0x5c')](this[_0x1b9d('0x19')]))['then'](function(_0x4da51d){if(!_[_0x1b9d('0x42')](_0x4da51d)){for(var _0x206d27=0x0;_0x206d27<_0x4da51d[_0x1b9d('0x5d')];_0x206d27+=0x1){if(ut[_0x1b9d('0x5e')](_0x4da51d[_0x206d27][_0x1b9d('0x5f')])<_0x2969d6[_0x1b9d('0x60')]*0x3c){if(_0x4da51d[_0x206d27][_0x1b9d('0x61')]&&!_0x4da51d[_0x206d27][_0x1b9d('0x61')]['voicePause']){_0x11ecb0[_0x1b9d('0x62')](_0x4da51d[_0x206d27]['id'])[_0x1b9d('0x63')](ut[_0x1b9d('0x64')](_0x1b9d('0x65')))[_0x1b9d('0x4f')](ut[_0x1b9d('0x64')](_0x1b9d('0x65')));}else{rpcDb[_0x1b9d('0x66')](_0x4da51d[_0x206d27]['id']);}}else{var _0x567478=new Action(_0x4da51d[_0x206d27],_0x2969d6);_0x567478[_0x1b9d('0x67')]=moment()[_0x1b9d('0x68')]('YYYY-MM-DD\x20HH:mm:ss');_0x2969d6[_0x1b9d('0x69')]+=0x1;ut['logCustomer'](_0x567478,0x17,'RecallInQueue');if(_0x2969d6[_0x1b9d('0x6a')]){rpcDb[_0x1b9d('0x6b')](ut[_0x1b9d('0x6c')](_0x4da51d[_0x206d27]));rpcDb[_0x1b9d('0x6d')](_0x567478,_0x1b9d('0x6e'));}else{ut[_0x1b9d('0x6f')](_0x567478,0x16,_0x1b9d('0x70'));rpcDb[_0x1b9d('0x6d')](_0x567478,'[HistoryRecallClose]');rpcDb[_0x1b9d('0x71')](_0x567478,_0x1b9d('0x72'));}}}}})[_0x1b9d('0x4f')](ut[_0x1b9d('0x64')](_0x1b9d('0x73')));};Preview[_0x1b9d('0x10')][_0x1b9d('0x3f')]=function(_0x454586){_0x454586[_0x1b9d('0x2b')]=!![];if(ut['IsNotLoggedIn'](_0x454586[_0x1b9d('0x74')])){_0x454586[_0x1b9d('0x2e')]=utils[_0x1b9d('0x33')][_0x1b9d('0x75')];}else if(!ut[_0x1b9d('0x76')](_0x454586['dialActive'])){_0x454586[_0x1b9d('0x2e')]=utils[_0x1b9d('0x33')][_0x1b9d('0x2f')];}else if(!this['isTrunkReachable'](_0x454586['Trunk'])){if(!this[_0x1b9d('0x77')](_0x454586['TrunkBackup'])){_0x454586['message']=utils[_0x1b9d('0x33')][_0x1b9d('0x78')];}else{_0x454586[_0x1b9d('0x2e')]=utils[_0x1b9d('0x33')]['ACTIVE'];}}else{_0x454586[_0x1b9d('0x2e')]=utils[_0x1b9d('0x33')][_0x1b9d('0x79')];}};Preview['prototype']['callProgressDetectingCustomer']=function(_0x35ff1c,_0x55236c,_0x526338){var _0x4fbcdf=this;var _0x3953c6=this['actions'][_0x55236c];var _0x3c2ac1=this[_0x1b9d('0x15')][_0x3953c6[_0x1b9d('0x45')]];var _0x3ba437;var _0x47aabd=![];var _0x13b80e=0x2;var _0x246ac2=0x3;if(_0x3c2ac1){switch(_0x526338){case'1':_0x3c2ac1['outboundNoSuchCallsDay']+=0x1;_0x3953c6[_0x1b9d('0x7a')]+=0x1;_0x3953c6[_0x1b9d('0x7b')]=ut[_0x1b9d('0x7c')](_0x3953c6);ut[_0x1b9d('0x6f')](_0x3953c6,0x0,'NoSuchNumber');ami['emit'](_0x1b9d('0x7d'),ut['buildObj'](_0x3953c6,_0x1b9d('0x7e')));rpcDb[_0x1b9d('0x6d')](_0x3953c6,'[callProgressDetectingCustomer][logNoSuch]');_0x4fbcdf[_0x1b9d('0x7f')](_0x3953c6,'0',_0x3c2ac1)['then'](function(_0x2061d3){_0x47aabd=_0x2061d3[_0x1b9d('0x80')]==0x1;_0x13b80e=_0x3c2ac1[_0x1b9d('0x81')];_0x246ac2=_0x3c2ac1[_0x1b9d('0x82')];if(!_0x47aabd){if(ut[_0x1b9d('0x7c')](_0x3953c6)>=_0x3c2ac1['dialGlobalMaxRetry']){_0x3ba437=ut[_0x1b9d('0x83')](_0x3953c6,0xf,_0x1b9d('0x84'));rpcDb[_0x1b9d('0x71')](_0x3ba437,_0x1b9d('0x85'));}else{if(_0x3953c6['countnosuchnumberretry']>=_0x3c2ac1['dialNoSuchNumberMaxRetry']){rpcDb[_0x1b9d('0x71')](_0x3953c6,_0x1b9d('0x85'));}else{rpcDb[_0x1b9d('0x86')](ut[_0x1b9d('0x87')](_0x3953c6,_0x1b9d('0x7a'),_0x3c2ac1[_0x1b9d('0x81')]),_0x3953c6[_0x1b9d('0x88')],_0x3953c6[_0x1b9d('0x89')]);}}delete this[_0x1b9d('0x18')][_0x35ff1c[_0x1b9d('0x8a')]];}else{_0x3953c6[_0x1b9d('0x7a')]++;logger[_0x1b9d('0x57')]('actioncountonusuch',_0x3953c6[_0x1b9d('0x7a')]);logger[_0x1b9d('0x57')]('id',_0x3953c6[_0x1b9d('0x8b')]);_0x4fbcdf[_0x1b9d('0x8c')]({'id':_0x3953c6[_0x1b9d('0x8b')],'field':{'countnosuchnumberretry':_0x3953c6[_0x1b9d('0x7a')]}})[_0x1b9d('0x63')](function(){_0x4fbcdf[_0x1b9d('0x8d')](_0x3953c6,_0x13b80e,_0x246ac2)[_0x1b9d('0x63')](function(){});});}});break;case'ANSWER':var _0x53f955=moment()[_0x1b9d('0x68')](_0x1b9d('0x8e'));_0x3953c6[_0x1b9d('0x8f')]=_0x53f955;_0x3953c6['answertime']=_0x53f955;_0x3953c6[_0x1b9d('0x49')]=!![];_0x3c2ac1[_0x1b9d('0x2c')]+=0x1;logger[_0x1b9d('0x57')](_0x1b9d('0x90'),_0x3953c6[_0x1b9d('0x91')],_0x1b9d('0x92'),_0x3c2ac1[_0x1b9d('0x29')],_0x1b9d('0x93'),_0x3c2ac1[_0x1b9d('0x2c')]);ami[_0x1b9d('0x26')](_0x1b9d('0x94'),ut['buildObj'](_0x3953c6,_0x1b9d('0x95'),this[_0x1b9d('0x15')][_0x3953c6[_0x1b9d('0x45')]]));if(_0x3c2ac1[_0x1b9d('0x96')]){ami[_0x1b9d('0x26')](_0x1b9d('0x97'),ut[_0x1b9d('0x98')](_0x3953c6));}break;case'16':ami['emit'](_0x1b9d('0x99'),ut[_0x1b9d('0x9a')](_0x3953c6,'complete',this['campaignsPreview'][_0x3953c6[_0x1b9d('0x45')]]));emitVoiceQueueChannelRemove(ut[_0x1b9d('0x9a')](_0x3953c6,_0x1b9d('0x9b')));_0x3c2ac1[_0x1b9d('0x9c')]+=0x1;_0x3c2ac1[_0x1b9d('0x9d')]+=0x1;_0x3c2ac1[_0x1b9d('0x9e')]+=0x1;ut[_0x1b9d('0x52')](_0x3c2ac1,'[16]');_0x3953c6['countglobal']=ut['totalGlobal'](_0x3953c6);ut[_0x1b9d('0x6f')](_0x3953c6,0x4,'Answer');rpcDb['createCustomerHistory'](_0x3953c6,_0x1b9d('0x9f'));rpcDb[_0x1b9d('0x71')](_0x3953c6,_0x1b9d('0xa0'));rpcDb['crateCustomerReportQueue'](_0x3953c6);_0x3c2ac1[_0x1b9d('0xa1')]+=_0x3953c6[_0x1b9d('0xa2')];_0x3c2ac1[_0x1b9d('0xa3')]+=_0x3953c6[_0x1b9d('0xa2')];logger[_0x1b9d('0x57')](_0x1b9d('0xa4'),_0x3953c6[_0x1b9d('0x91')],_0x1b9d('0x92'),_0x3c2ac1[_0x1b9d('0x29')],_0x1b9d('0x93'),_0x3c2ac1[_0x1b9d('0x2c')]);delete this[_0x1b9d('0x18')][_0x35ff1c[_0x1b9d('0x8a')]];break;case _0x1b9d('0xa5'):_0x3c2ac1[_0x1b9d('0xa6')]+=0x1;_0x3953c6[_0x1b9d('0xa7')]+=0x1;_0x3953c6[_0x1b9d('0x7b')]=ut['totalGlobal'](_0x3953c6);ut['logCustomer'](_0x3953c6,0x5,'Busy');_0x13b80e=_0x3c2ac1[_0x1b9d('0xa8')];_0x246ac2=_0x3c2ac1[_0x1b9d('0x82')];ami[_0x1b9d('0x26')](_0x1b9d('0xa9'),ut[_0x1b9d('0x9a')](_0x3953c6,_0x1b9d('0xaa')));rpcDb[_0x1b9d('0x6d')](_0x3953c6,_0x1b9d('0xab'));_0x4fbcdf[_0x1b9d('0x7f')](_0x3953c6,'5',_0x3c2ac1)[_0x1b9d('0x63')](function(_0x54c8e7){_0x47aabd=_0x54c8e7[_0x1b9d('0x80')]==0x1;if(!_0x47aabd){if(ut[_0x1b9d('0x7c')](_0x3953c6)>=_0x3c2ac1[_0x1b9d('0xac')]){_0x3ba437=ut[_0x1b9d('0x83')](_0x3953c6,0xf,'Global');rpcDb[_0x1b9d('0x71')](_0x3ba437,_0x1b9d('0xad'));}else{if(_0x3953c6[_0x1b9d('0xa7')]>=_0x3c2ac1[_0x1b9d('0xae')]){rpcDb[_0x1b9d('0x71')](_0x3953c6,_0x1b9d('0xab'));}else{rpcDb[_0x1b9d('0x86')](ut[_0x1b9d('0x87')](_0x3953c6,_0x1b9d('0xa7'),_0x3c2ac1[_0x1b9d('0xa8')]),_0x3953c6['unlockAgent'],_0x3953c6['activeContact']);}}}else{_0x3953c6[_0x1b9d('0xa7')]++;_0x4fbcdf['incrementPreviewCounters']({'id':_0x3953c6['idContact'],'field':{'countbusyretry':_0x3953c6[_0x1b9d('0xa7')]}})[_0x1b9d('0x63')](function(){_0x4fbcdf[_0x1b9d('0x8d')](_0x3953c6,_0x13b80e,_0x246ac2)['then'](function(){});});}});break;case _0x1b9d('0xaf'):_0x3c2ac1['outboundNoAnswerCallsDay']+=0x1;_0x3953c6[_0x1b9d('0xb0')]+=0x1;_0x3953c6[_0x1b9d('0x7b')]=ut[_0x1b9d('0x7c')](_0x3953c6);ut[_0x1b9d('0x6f')](_0x3953c6,0x3,'NoAnswer');_0x13b80e=_0x3c2ac1[_0x1b9d('0xb1')];_0x246ac2=_0x3c2ac1[_0x1b9d('0x82')];var _0x438983=ut[_0x1b9d('0xb2')](_0x3953c6,_0x3c2ac1);ami['emit'](_0x1b9d('0xb3'),_0x438983);rpcDb[_0x1b9d('0x6d')](_0x3953c6,_0x1b9d('0xb4'));_0x4fbcdf[_0x1b9d('0x7f')](_0x3953c6,'3',_0x3c2ac1)[_0x1b9d('0x63')](function(_0x319ffb){_0x47aabd=_0x319ffb['additional']==0x1;if(!_0x47aabd){if(ut[_0x1b9d('0x7c')](_0x3953c6)>=_0x3c2ac1[_0x1b9d('0xac')]){_0x3ba437=ut[_0x1b9d('0x83')](_0x3953c6,0xf,_0x1b9d('0x84'));rpcDb[_0x1b9d('0x71')](_0x3ba437,_0x1b9d('0xb5'));}else{if(_0x3953c6['countnoanswerretry']>=_0x3c2ac1[_0x1b9d('0xb6')]){rpcDb['createCustomerFinal'](_0x3953c6,_0x1b9d('0xb4'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x3953c6,_0x1b9d('0xb0'),_0x3c2ac1[_0x1b9d('0xb1')]),_0x3953c6[_0x1b9d('0x88')],_0x3953c6['activeContact']);}}}else{_0x3953c6[_0x1b9d('0xb0')]++;_0x4fbcdf['incrementPreviewCounters']({'id':_0x3953c6[_0x1b9d('0x8b')],'field':{'countnoanswerretry':_0x3953c6['countnoanswerretry']}})[_0x1b9d('0x63')](function(){_0x4fbcdf[_0x1b9d('0x8d')](_0x3953c6,_0x13b80e,_0x246ac2)['then'](function(){});});}});break;case _0x1b9d('0xb7'):_0x3c2ac1['outboundCongestionCallsDay']+=0x1;_0x3953c6[_0x1b9d('0xb8')]+=0x1;_0x3953c6[_0x1b9d('0x7b')]=ut[_0x1b9d('0x7c')](_0x3953c6);ut[_0x1b9d('0x6f')](_0x3953c6,0x8,'Congestion');_0x13b80e=_0x3c2ac1[_0x1b9d('0xb9')];_0x246ac2=_0x3c2ac1[_0x1b9d('0x82')];ami[_0x1b9d('0x26')]('custom:agentcongestion',ut[_0x1b9d('0x9a')](_0x3953c6,'congestion'));rpcDb[_0x1b9d('0x6d')](_0x3953c6,'[callProgressDetectingCustomer][logCongestion]');_0x4fbcdf['verifyAdditionalPhones'](_0x3953c6,'8',_0x3c2ac1)[_0x1b9d('0x63')](function(_0xd06a46){_0x47aabd=_0xd06a46[_0x1b9d('0x80')]==0x1;if(!_0x47aabd){if(ut[_0x1b9d('0x7c')](_0x3953c6)>=_0x3c2ac1[_0x1b9d('0xac')]){_0x3ba437=ut['cloneAction'](_0x3953c6,0xf,_0x1b9d('0x84'));rpcDb[_0x1b9d('0x71')](_0x3ba437,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x3953c6[_0x1b9d('0xb8')]>=_0x3c2ac1[_0x1b9d('0xba')]){rpcDb['createCustomerFinal'](_0x3953c6,_0x1b9d('0xbb'));}else{rpcDb[_0x1b9d('0x86')](ut['scheduledAt'](_0x3953c6,_0x1b9d('0xb8'),_0x3c2ac1['dialBusyRetryFrequency']),_0x3953c6[_0x1b9d('0x88')],_0x3953c6[_0x1b9d('0x89')]);}}}else{_0x3953c6[_0x1b9d('0xb8')]++;_0x4fbcdf['incrementPreviewCounters']({'id':_0x3953c6['idContact'],'field':{'countcongestionretry':_0x3953c6[_0x1b9d('0xb8')]}})[_0x1b9d('0x63')](function(){_0x4fbcdf[_0x1b9d('0x8d')](_0x3953c6,_0x13b80e,_0x246ac2)['then'](function(){});});}});break;case _0x1b9d('0xbc'):_0x3c2ac1[_0x1b9d('0xbd')]+=0x1;_0x3953c6['countagentrejectretry']+=0x1;_0x3953c6[_0x1b9d('0x7b')]=ut[_0x1b9d('0x7c')](_0x3953c6);ut[_0x1b9d('0x6f')](_0x3953c6,0x14,_0x1b9d('0xbe'));_0x13b80e=_0x3c2ac1[_0x1b9d('0xbf')];_0x246ac2=_0x3c2ac1[_0x1b9d('0x82')];ami[_0x1b9d('0x26')]('custom:agentreject',ut[_0x1b9d('0x9a')](_0x3953c6,_0x1b9d('0xc0')));rpcDb[_0x1b9d('0x6d')](_0x3953c6,_0x1b9d('0xc1'));_0x4fbcdf[_0x1b9d('0x7f')](_0x3953c6,'20',_0x3c2ac1)['then'](function(_0x53c8d0){_0x47aabd=_0x53c8d0[_0x1b9d('0x80')]==0x1;if(!_0x47aabd){if(ut[_0x1b9d('0x7c')](_0x3953c6)>=_0x3c2ac1[_0x1b9d('0xac')]){_0x3ba437=ut[_0x1b9d('0x83')](_0x3953c6,0x14,_0x1b9d('0xbe'));rpcDb[_0x1b9d('0x71')](_0x3ba437,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x3953c6[_0x1b9d('0xc2')]>=_0x3c2ac1[_0x1b9d('0xc3')]){rpcDb['createCustomerFinal'](_0x3953c6,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x1b9d('0x86')](ut[_0x1b9d('0x87')](_0x3953c6,_0x1b9d('0xc2'),_0x3c2ac1[_0x1b9d('0xbf')]),_0x3953c6[_0x1b9d('0x88')],_0x3953c6[_0x1b9d('0x89')]);}}}else{_0x3953c6[_0x1b9d('0xb0')]++;_0x4fbcdf['incrementPreviewCounters']({'id':_0x3953c6[_0x1b9d('0x8b')],'field':{'countnoanswerretry':_0x3953c6[_0x1b9d('0xb0')]}})[_0x1b9d('0x63')](function(){_0x4fbcdf[_0x1b9d('0x8d')](_0x3953c6,_0x13b80e,_0x246ac2)[_0x1b9d('0x63')](function(){});});}});break;case'ABANDONED':_0x3c2ac1['outboundAbandonedCallsDay']+=0x1;_0x3953c6[_0x1b9d('0xc4')]+=0x1;_0x3953c6[_0x1b9d('0x7b')]=ut['totalGlobal'](_0x3953c6);ut[_0x1b9d('0x6f')](_0x3953c6,0xb,_0x1b9d('0xc5'));rpcDb['createCustomerHistory'](_0x3953c6,_0x1b9d('0xc6'));_0x4fbcdf['verifyAdditionalPhones'](_0x3953c6,'11',_0x3c2ac1)['then'](function(_0x268089){_0x47aabd=_0x268089[_0x1b9d('0x80')]==0x1;if(!_0x47aabd){if(ut[_0x1b9d('0x7c')](_0x3953c6)>=_0x3c2ac1['dialGlobalMaxRetry']){_0x3ba437=ut[_0x1b9d('0x83')](_0x3953c6,0xf,_0x1b9d('0x84'));rpcDb[_0x1b9d('0x71')](_0x3ba437,_0x1b9d('0xc6'));}else{if(_0x3953c6[_0x1b9d('0xc7')]>=_0x3c2ac1['dialAbandonedMaxRety']){rpcDb[_0x1b9d('0x71')](_0x3953c6,_0x1b9d('0xc6'));}else{rpcDb[_0x1b9d('0x86')](ut['scheduledAt'](_0x3953c6,'countabandonedretry',_0x3c2ac1['dialAbandonedRetryFrequency']),_0x3953c6['unlockAgent'],_0x3953c6[_0x1b9d('0x89')]);}}}else{_0x3953c6[_0x1b9d('0xb0')]++;_0x4fbcdf['incrementPreviewCounters']({'id':_0x3953c6[_0x1b9d('0x8b')],'field':{'countnoanswerretry':_0x3953c6['countnoanswerretry']}})[_0x1b9d('0x63')](function(){_0x4fbcdf[_0x1b9d('0x8d')](_0x3953c6,_0x13b80e,_0x246ac2)[_0x1b9d('0x63')](function(){});});}});break;case'18':_0x3c2ac1[_0x1b9d('0xc8')]+=0x1;_0x3953c6[_0x1b9d('0xc9')]+=0x1;_0x3953c6[_0x1b9d('0x7b')]=ut[_0x1b9d('0x7c')](_0x3953c6);ut[_0x1b9d('0x6f')](_0x3953c6,0x12,_0x35ff1c['cause-txt']||_0x35ff1c['dialstatus']);ami[_0x1b9d('0x26')](_0x1b9d('0xca'),ut[_0x1b9d('0x9a')](_0x3953c6,_0x1b9d('0xcb')));rpcDb['createCustomerHistory'](_0x3953c6,'[callProgressDetectingCustomer][hangupInAMD]');_0x4fbcdf[_0x1b9d('0x7f')](_0x3953c6,'18',_0x3c2ac1)[_0x1b9d('0x63')](function(_0x58687e){_0x47aabd=_0x58687e['additional']==0x1;if(!_0x47aabd){if(ut[_0x1b9d('0x7c')](_0x3953c6)>=_0x3c2ac1['dialGlobalMaxRetry']){_0x3ba437=ut['cloneAction'](_0x3953c6,0x12,'Global');rpcDb['createCustomerFinal'](_0x3ba437,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb['createCustomerFinal'](_0x3953c6,_0x1b9d('0xcc'));}}else{_0x3953c6['countnoanswerretry']++;_0x4fbcdf['incrementPreviewCounters']({'id':_0x3953c6[_0x1b9d('0x8b')],'field':{'countnoanswerretry':_0x3953c6[_0x1b9d('0xb0')]}})['then'](function(){_0x4fbcdf['swapAdditionalPhones'](_0x3953c6,_0x13b80e,_0x246ac2)['then'](function(){});});}});delete this[_0x1b9d('0x18')][_0x35ff1c[_0x1b9d('0x8a')]];break;case'19':_0x3c2ac1[_0x1b9d('0xc8')]+=0x1;_0x3953c6[_0x1b9d('0x7b')]=ut['totalGlobal'](_0x3953c6);ut[_0x1b9d('0x6f')](_0x3953c6,0x13,_0x35ff1c[_0x1b9d('0xcd')]||_0x35ff1c['dialstatus']);ami[_0x1b9d('0x26')]('custom:amd',ut[_0x1b9d('0x9a')](_0x3953c6,_0x1b9d('0xcb')));rpcDb[_0x1b9d('0x6d')](_0x3953c6,_0x1b9d('0xce'));_0x4fbcdf[_0x1b9d('0x7f')](_0x3953c6,'18',_0x3c2ac1)[_0x1b9d('0x63')](function(_0x57f02f){_0x47aabd=_0x57f02f[_0x1b9d('0x80')]==0x1;if(!_0x47aabd){if(ut[_0x1b9d('0x7c')](_0x3953c6)>=_0x3c2ac1[_0x1b9d('0xac')]){_0x3ba437=ut[_0x1b9d('0x83')](_0x3953c6,0xf,'Global');rpcDb[_0x1b9d('0x71')](_0x3ba437,_0x1b9d('0xce'));}else{rpcDb[_0x1b9d('0x71')](_0x3953c6,_0x1b9d('0xce'));}}else{_0x3953c6['countnoanswerretry']++;_0x4fbcdf[_0x1b9d('0x8c')]({'id':_0x3953c6[_0x1b9d('0x8b')],'field':{'countnoanswerretry':_0x3953c6[_0x1b9d('0xb0')]}})[_0x1b9d('0x63')](function(){_0x4fbcdf[_0x1b9d('0x8d')](_0x3953c6,_0x13b80e,_0x246ac2)['then'](function(){});});}});delete this[_0x1b9d('0x18')][_0x35ff1c[_0x1b9d('0x8a')]];break;default:if(_0x3953c6['dialAnswer']){ut[_0x1b9d('0x52')](_0x3c2ac1,_0x1b9d('0xcf'));ut[_0x1b9d('0x54')](_0x1b9d('0xd0')+_0x3c2ac1['name'],_0x35ff1c);}_0x3c2ac1[_0x1b9d('0xc8')]+=0x1;_0x3953c6[_0x1b9d('0x7b')]=ut[_0x1b9d('0x7c')](_0x3953c6);ut[_0x1b9d('0x6f')](_0x3953c6,0xc,_0x35ff1c['cause-txt']||_0x35ff1c[_0x1b9d('0xd1')]);_0x13b80e=_0x3c2ac1[_0x1b9d('0xbf')];_0x246ac2=_0x3c2ac1['callAdditionalPhoneAfterMin'];rpcDb[_0x1b9d('0x6d')](_0x3953c6,'[callProgressDetectingCustomer][logUnknown]');_0x4fbcdf[_0x1b9d('0x7f')](_0x3953c6,'20',_0x3c2ac1)[_0x1b9d('0x63')](function(_0x129833){_0x47aabd=_0x129833[_0x1b9d('0x80')]==0x1;if(!_0x47aabd){if(ut[_0x1b9d('0x7c')](_0x3953c6)>=_0x3c2ac1['dialGlobalMaxRetry']){_0x3ba437=ut['cloneAction'](_0x3953c6,0xf,_0x1b9d('0x84'));rpcDb[_0x1b9d('0x71')](_0x3ba437,_0x1b9d('0xd2'));}else{rpcDb[_0x1b9d('0x71')](_0x3953c6,_0x1b9d('0xd2'));}delete this[_0x1b9d('0x18')][_0x35ff1c['linkedid']];}else{_0x4fbcdf['swapAdditionalPhones'](_0x3953c6,_0x13b80e,_0x246ac2)['then'](function(){});}});}if(!(_0x3953c6[_0x1b9d('0x49')]&&_0x526338==='16')){ut[_0x1b9d('0x51')](_0x3c2ac1,_0x1b9d('0xd3'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x3953c6[_0x1b9d('0x91')],'\x20Queue',_0x3c2ac1[_0x1b9d('0x29')],_0x1b9d('0x46'),_0x3c2ac1[_0x1b9d('0x48')]);}if(_0x526338!==_0x1b9d('0xd4')){delete this[_0x1b9d('0x18')][_0x35ff1c[_0x1b9d('0x8a')]];delete this[_0x1b9d('0x18')][_0x35ff1c[_0x1b9d('0xd5')]];}_0x3c2ac1['queueSummaryCountersUpdated']=!![];}};Preview['prototype'][_0x1b9d('0xd6')]=function(_0x5d224d,_0x4807e9,_0x3447bd){if(_[_0x1b9d('0xd7')](_0x4807e9)&&_0x1b9d('0xd8')!==typeof _0x4807e9){return;}if(_[_0x1b9d('0xd7')](_0x3447bd)&&_0x1b9d('0xd8')!==typeof _0x3447bd){return;}switch(_0x3447bd[_0x1b9d('0xd9')]){case'0':ut[_0x1b9d('0xda')](_0x5d224d,0x0,_0x1b9d('0xdb'));rpcDb[_0x1b9d('0xdc')](_0x5d224d,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x1b9d('0xda')](_0x5d224d,0x3,'NoAnswer');rpcDb[_0x1b9d('0xdc')](_0x5d224d,_0x1b9d('0xdd'));break;case'5':ut[_0x1b9d('0xda')](_0x5d224d,0x5,'Busy');rpcDb[_0x1b9d('0xdc')](_0x5d224d,_0x1b9d('0xde'));break;case'8':ut[_0x1b9d('0xda')](_0x5d224d,0x8,_0x1b9d('0xdf'));rpcDb['createAgentHistory'](_0x5d224d,_0x1b9d('0xe0'));break;case'22':ut['logAgent'](_0x5d224d,0x16,'AnswerAGI');rpcDb[_0x1b9d('0xdc')](_0x5d224d,_0x1b9d('0xe1'));break;default:ut[_0x1b9d('0xda')](_0x5d224d,0xc,_0x3447bd['reason']);rpcDb['createAgentHistory'](_0x5d224d,'[callProgressDetectingAgent][logCongestion]');}ut[_0x1b9d('0x51')](_0x4807e9,_0x1b9d('0xe2'));logger[_0x1b9d('0x57')](_0x1b9d('0xe3'),_0x5d224d[_0x1b9d('0x91')],_0x1b9d('0x92'),_0x4807e9[_0x1b9d('0x29')],_0x1b9d('0x46'),_0x4807e9[_0x1b9d('0x48')]);delete this[_0x1b9d('0x18')][_0x5d224d[_0x1b9d('0x91')]];};Preview[_0x1b9d('0x10')][_0x1b9d('0x7f')]=function(_0x1fbcd9,_0x1e895b,_0x36d15b){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x1fbcd9,_0x1e895b,_0x36d15b)[_0x1b9d('0x4f')](logger[_0x1b9d('0x57')](_0x1b9d('0xe4')));};Preview['prototype']['swapAdditionalPhones']=function(_0x5cff2d,_0x5952fd,_0x89bb12){return cmHopperAdditionalPhone[_0x1b9d('0x8d')](_0x5cff2d,_0x5952fd,_0x89bb12)[_0x1b9d('0x4f')](logger[_0x1b9d('0x57')](_0x1b9d('0xe5')));};Preview[_0x1b9d('0x10')][_0x1b9d('0x8c')]=function(_0x66e316){return Promise[_0x1b9d('0xe6')]()[_0x1b9d('0x63')](cmHopperAdditionalPhone[_0x1b9d('0x8c')](_0x66e316))[_0x1b9d('0x4f')](logger[_0x1b9d('0x57')](_0x1b9d('0xe7')));};Preview[_0x1b9d('0x10')]['checkInBlack']=function(_0x57b459,_0x31e66d,_0x21b9d6,_0x13359e,_0x4178cd){var _0x5fd529=this;return new Promise(function(_0x4d4162,_0x4c58b1){if(_['isNil'](_0x31e66d)||_[_0x1b9d('0x42')](_0x31e66d[_0x1b9d('0xe8')])||_[_0x1b9d('0x42')](_0x31e66d['phone'])||_[_0x1b9d('0x42')](_0x31e66d[_0x1b9d('0xe9')])){_0x4c58b1(ut[_0x1b9d('0x2e')]('Contact\x20is\x20undefined',_0x13359e,_0x4178cd));return;}var _0xee974a=uuid['v4']();var _0x1b0b8e=_0x5fd529[_0x1b9d('0x15')][_0x31e66d['Queue']['name']];var _0x310524=_0x21b9d6?_0x5fd529[_0x1b9d('0x19')][_0x21b9d6]['id']:undefined;_0x5fd529[_0x1b9d('0x18')][_0xee974a]=new Action(_0x31e66d,_0x1b0b8e,_0xee974a,_0x21b9d6,_0x310524);var _0x2a2efe=_0x5fd529[_0x1b9d('0x18')][_0xee974a];_0x2a2efe[_0x1b9d('0x88')]=_0x13359e;_0x2a2efe[_0x1b9d('0x89')]=_0x4178cd;_0x2a2efe['lookAgent']=_0x21b9d6;if(_['isEmpty'](_0x57b459)){_0x5fd529['execCall'](_0x2a2efe,_0x1b0b8e,_0x31e66d,_0x21b9d6)[_0x1b9d('0x63')](function(_0x3307ad){logger['info'](_0x1b9d('0xea'),_0x1b9d('0xeb')+_0x2a2efe['queue']+_0x1b9d('0xec')+_0x2a2efe[_0x1b9d('0x8b')],JSON['stringify'](_0x3307ad));ami['emit']('custom:agentcalled',ut[_0x1b9d('0x9a')](_0x2a2efe,_0x1b9d('0xed'),_0x5fd529[_0x1b9d('0x15')][_0x2a2efe[_0x1b9d('0x45')]]));_0x4d4162(ut[_0x1b9d('0x2e')](_0x1b9d('0xee')));})['catch'](function(_0x2fd1fb){ut[_0x1b9d('0x30')]('[Preview][execCall][failure]',_0x2fd1fb);_0x4c58b1(ut[_0x1b9d('0x2e')](_0x1b9d('0xef'),_0x13359e,_0x4178cd));});}else{_0x1b0b8e[_0x1b9d('0xf0')]+=0x1;ut[_0x1b9d('0xf1')](_0x2a2efe);rpcDb[_0x1b9d('0xf2')](_0x2a2efe,_0x1b9d('0xf3'));delete _0x5fd529[_0x1b9d('0x18')][_0xee974a];_0x4c58b1(ut[_0x1b9d('0x2e')](_0x1b9d('0xf4'),_0x13359e,_0x4178cd));}});};Preview[_0x1b9d('0x10')]['isTrunkReachable']=function(_0x23ca9c){return!_[_0x1b9d('0x42')](_0x23ca9c)&&!_[_0x1b9d('0x42')](_0x23ca9c[_0x1b9d('0x29')])&&!_[_0x1b9d('0x42')](_0x23ca9c['active'])&&_0x23ca9c['active']&&!_[_0x1b9d('0x42')](this['trunks'][util[_0x1b9d('0x68')]('SIP/%s',_0x23ca9c[_0x1b9d('0x29')])])&&!_['isNil'](this[_0x1b9d('0x17')][util[_0x1b9d('0x68')]('SIP/%s',_0x23ca9c[_0x1b9d('0x29')])][_0x1b9d('0x4e')])&&(this[_0x1b9d('0x17')][util['format'](_0x1b9d('0xf5'),_0x23ca9c['name'])]['status']===_0x1b9d('0xf6')||this[_0x1b9d('0x17')][util[_0x1b9d('0x68')](_0x1b9d('0xf5'),_0x23ca9c['name'])][_0x1b9d('0x4e')]===_0x1b9d('0xf7'));};Preview[_0x1b9d('0x10')]['run']=function(_0x1fd915,_0x2272c5){return this[_0x1b9d('0xf8')](_0x1fd915,_0x2272c5)['then'](function(_0x6b64c8){return _['pick'](_0x6b64c8,['message']);})[_0x1b9d('0x4f')](function(_0x62c84a){if(_0x62c84a[_0x1b9d('0xf9')]){rpcDb[_0x1b9d('0xfa')](_0x1fd915);}if(_0x62c84a[_0x1b9d('0xfb')]){rpcDb[_0x1b9d('0x66')](_0x1fd915);}throw _[_0x1b9d('0x4a')](_0x62c84a,[_0x1b9d('0x2e')]);});};Preview[_0x1b9d('0x10')][_0x1b9d('0xf8')]=function(_0x5cddd6,_0x34685c){var _0x250888=this;var _0x5bec2c,_0x2bd91b;return rpcDb['getContactPreview'](_0x5cddd6)['then'](function(_0x47bfe7){if(!_[_0x1b9d('0x42')](_0x47bfe7[0x0])){_0x2bd91b=_0x47bfe7[0x0]['recallme']?![]:!![];_0x5bec2c=_0x47bfe7[0x0][_0x1b9d('0xfc')]?!![]:![];_0x5bec2c=_0x34685c?!![]:_0x5bec2c;}var _0x5443d7=_0x250888[_0x1b9d('0xfd')](_0x47bfe7);if(_0x5443d7[_0x1b9d('0xfe')]){rpcDb[_0x1b9d('0xff')](_[_0x1b9d('0x4a')](_0x47bfe7[0x0],[_0x1b9d('0xe9'),_0x1b9d('0x100')]))[_0x1b9d('0x63')](function(_0x4c3ca5){_0x250888[_0x1b9d('0x101')](_0x4c3ca5,_0x47bfe7[0x0],_0x34685c,_0x2bd91b,_0x5bec2c)[_0x1b9d('0x63')](function(_0x187830){return _0x187830;})[_0x1b9d('0x4f')](function(_0x116447){throw _0x116447;});})[_0x1b9d('0x4f')](function(_0x29ee65){ut[_0x1b9d('0x30')](_0x1b9d('0x102'),_0x29ee65);throw ut[_0x1b9d('0x2e')](_0x1b9d('0x103'),_0x2bd91b,_0x5bec2c);});}else{throw ut['message'](_0x5443d7[_0x1b9d('0x2e')],_0x2bd91b,_0x5bec2c);}})[_0x1b9d('0x4f')](function(_0x475f3b){ut[_0x1b9d('0x30')](_0x1b9d('0x104'),_0x475f3b);throw ut[_0x1b9d('0x2e')]('Call\x20unsuccessful',![],!![]);});};Preview[_0x1b9d('0x10')][_0x1b9d('0xfd')]=function(_0x5b0356){if(_[_0x1b9d('0x42')](_0x5b0356)||_[_0x1b9d('0x105')](_0x5b0356)||!_['isNil'](_0x5b0356[0x0]['Agent'])&&_['isNil'](_0x5b0356[0x0][_0x1b9d('0x61')]['name'])){ut[_0x1b9d('0x30')]('[Preview][validateContact][Empty\x20Contact]',_0x5b0356);return{'isValid':![],'message':_0x1b9d('0x106')};}var _0x2d487c=this[_0x1b9d('0x15')][_0x5b0356[0x0][_0x1b9d('0x44')][_0x1b9d('0x29')]];_0x2d487c[_0x1b9d('0x2e')]=utils[_0x1b9d('0x33')][_0x1b9d('0x79')];if(_[_0x1b9d('0x42')](_0x2d487c)){ut[_0x1b9d('0x30')]('[Preview][validateContact][Empty\x20Campaign]',_0x2d487c);return{'isValid':![],'message':_0x1b9d('0x107')};}if(!this[_0x1b9d('0x77')](_0x2d487c['Trunk'])){ut[_0x1b9d('0x30')](_0x1b9d('0x108'),_0x1b9d('0x109')+_0x2d487c[_0x1b9d('0x29')]+_0x1b9d('0x10a'));if(!this[_0x1b9d('0x77')](_0x2d487c[_0x1b9d('0x10b')])){ut[_0x1b9d('0x30')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x2d487c[_0x1b9d('0x29')]+_0x1b9d('0x10c'));return{'isValid':![],'message':_0x1b9d('0x10d')};}}if(!ut['isActive'](_0x2d487c[_0x1b9d('0x3e')])){ut[_0x1b9d('0x30')](_0x1b9d('0x10e'),_0x2d487c['name']+_0x1b9d('0x10f'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x2d487c['name']+_0x1b9d('0x10f')};}return{'isValid':!![],'message':_0x1b9d('0x110')};};Preview[_0x1b9d('0x10')][_0x1b9d('0x111')]=function(_0x1460d5,_0x1e0a12,_0x458682,_0x27d515){var _0x12edc2=this;return new Promise(function(_0x341f3d,_0x17b192){var _0x4e746c=_0x1460d5[_0x1b9d('0x91')];var _0x468afc=_0x12edc2['isTrunkReachable'](_0x1e0a12[_0x1b9d('0x112')])?util[_0x1b9d('0x68')](_0x1b9d('0x113'),_0x1e0a12[_0x1b9d('0x112')][_0x1b9d('0x29')],_[_0x1b9d('0x42')](_0x1e0a12['dialPrefix'])?'':_0x1e0a12[_0x1b9d('0x114')][_0x1b9d('0x115')]()||'',_0x1e0a12[_0x1b9d('0x116')]>0x0?_0x458682['phone'][_0x1b9d('0x117')](_0x1e0a12[_0x1b9d('0x116')]):_0x458682[_0x1b9d('0x100')]):util[_0x1b9d('0x68')]('SIP/%s/%s%s',_[_0x1b9d('0x42')](_0x1e0a12['TrunkBackup'])?_0x1e0a12[_0x1b9d('0x112')]['name']:_0x1e0a12[_0x1b9d('0x10b')][_0x1b9d('0x29')],_[_0x1b9d('0x42')](_0x1e0a12[_0x1b9d('0x114')])?'':_0x1e0a12[_0x1b9d('0x114')][_0x1b9d('0x115')]()||'',_0x1e0a12['dialCutDigit']>0x0?_0x458682[_0x1b9d('0x100')][_0x1b9d('0x117')](_0x1e0a12[_0x1b9d('0x116')]):_0x458682['phone']);var _0x16dc8b=_0x12edc2[_0x1b9d('0x77')](_0x1e0a12[_0x1b9d('0x112')])?ut[_0x1b9d('0x118')](_0x1e0a12[_0x1b9d('0x112')][_0x1b9d('0x119')],_0x1e0a12[_0x1b9d('0x11a')],_0x1e0a12[_0x1b9d('0x11b')]>0x0?ut[_0x1b9d('0x11c')](_0x1e0a12[_0x1b9d('0x11d')],_0x1e0a12[_0x1b9d('0x11b')]):_0x1e0a12['dialOriginateCallerIdNumber']):ut[_0x1b9d('0x118')](_[_0x1b9d('0x42')](_0x1e0a12[_0x1b9d('0x10b')])?_0x1e0a12[_0x1b9d('0x112')][_0x1b9d('0x119')]:_0x1e0a12[_0x1b9d('0x10b')][_0x1b9d('0x119')],_0x1e0a12[_0x1b9d('0x11a')],_0x1e0a12[_0x1b9d('0x11b')]>0x0?ut['getCallerIdRandom'](_0x1e0a12[_0x1b9d('0x11d')],_0x1e0a12[_0x1b9d('0x11b')]):_0x1e0a12['dialOriginateCallerIdNumber']);if(_0x16dc8b){_0x1460d5[_0x1b9d('0x11e')]=ut['extractCalleridName'](_0x16dc8b);_0x1460d5[_0x1b9d('0x11f')]=ut[_0x1b9d('0x120')](_0x16dc8b);}var _0x1d4edb=ut['addVariables'](_0x1e0a12,_0x458682,_0x468afc,_0x16dc8b,_0x4e746c,_0x1460d5);var _0x25d4af=utils[_0x1b9d('0x121')](_0x458682[_0x1b9d('0xe8')]);Object['assign'](_0x1d4edb,_0x25d4af);_[_0x1b9d('0x122')](_0x1460d5,ut[_0x1b9d('0x123')](_0x1d4edb));_0x1460d5[_0x1b9d('0x67')]=moment()[_0x1b9d('0x68')](_0x1b9d('0x8e'));_0x1e0a12[_0x1b9d('0x124')]=_0x1d4edb;var _0x36f926=ut[_0x1b9d('0x125')](_0x1460d5,_0x1e0a12,_0x1d4edb,_0x1460d5[_0x1b9d('0x89')],_0x27d515);return ami[_0x1b9d('0x4d')](_0x36f926)[_0x1b9d('0x63')](function(_0x2f61d1){_0x1e0a12[_0x1b9d('0x48')]+=0x1;logger[_0x1b9d('0x57')](_0x1b9d('0x126'),_0x4e746c,'\x20Queue',_0x1e0a12[_0x1b9d('0x29')],_0x1b9d('0x46'),_0x1e0a12['originated']);_0x341f3d(_0x2f61d1);})[_0x1b9d('0x4f')](function(_0x851666){ut['logAgent'](_0x1460d5,0xe,_0x1b9d('0x127'));rpcDb[_0x1b9d('0xdc')](_0x1460d5,_0x1b9d('0x128'));_0x17b192(_0x851666);});});};Preview[_0x1b9d('0x10')][_0x1b9d('0x129')]=function(_0x1d983b){if(this['actions'][_0x1d983b[_0x1b9d('0x8a')]]){this['actions'][_0x1d983b[_0x1b9d('0x8a')]][_0x1b9d('0x12a')]=_0x1d983b[_0x1b9d('0x12a')];}};Preview[_0x1b9d('0x10')][_0x1b9d('0x1b')]=function(_0x5e9f96){var _0x85267a=this;var _0x3f7f50=this[_0x1b9d('0x18')][_0x5e9f96[_0x1b9d('0x12b')]];if(_0x3f7f50){if(_0x3f7f50[_0x1b9d('0x12c')]&&this[_0x1b9d('0x19')][_0x3f7f50['lookAgent']]){ut['logLookAgent'](_0x3f7f50,this[_0x1b9d('0x19')][_0x3f7f50[_0x1b9d('0x12c')]]['name'],this[_0x1b9d('0x19')][_0x3f7f50[_0x1b9d('0x12c')]]['id']);}var _0x1e5d3f=_['clone'](_0x3f7f50);_0x1e5d3f[_0x1b9d('0x8f')]=moment()[_0x1b9d('0x68')](_0x1b9d('0x8e'));var _0x554ed5=_0x85267a['campaignsPreview'][_0x3f7f50[_0x1b9d('0x45')]];if(ut[_0x1b9d('0x12d')](_0x5e9f96['response'])){if(_0x3f7f50[_0x1b9d('0x88')]){rpcDb[_0x1b9d('0xfa')](_0x3f7f50[_0x1b9d('0x8b')]);}if(_0x3f7f50[_0x1b9d('0x89')]){rpcDb[_0x1b9d('0x66')](_0x3f7f50[_0x1b9d('0x8b')]);}ami['emit']('custom:agentringnoanswer',ut[_0x1b9d('0x9a')](_0x3f7f50,_0x1b9d('0x12e'),this['campaignsPreview'][_0x3f7f50[_0x1b9d('0x45')]]));this[_0x1b9d('0xd6')](_0x1e5d3f,_0x554ed5,_0x5e9f96);}else{_0x3f7f50[_0x1b9d('0x67')]=moment()['format'](_0x1b9d('0x8e'));ut[_0x1b9d('0xda')](_0x1e5d3f,0x4,'Answer');rpcDb['createAgentHistory'](_0x1e5d3f,_0x1b9d('0x12f'));}}};Preview[_0x1b9d('0x10')][_0x1b9d('0x130')]=function(_0x4440b3){var _0xd5fe58=this[_0x1b9d('0x18')][_0x4440b3['linkedid']];var _0x59a673;if(_0xd5fe58){_0x59a673=this['campaignsPreview'][_0xd5fe58[_0x1b9d('0x45')]];logger[_0x1b9d('0x57')](_0x1b9d('0x131'),_0x4440b3[_0x1b9d('0x8a')],_0x1b9d('0x92'),_0x59a673[_0x1b9d('0x29')],_0x1b9d('0x93'),_0x59a673[_0x1b9d('0x2c')]);}if(this['actions'][_0x4440b3['linkedid']]&&_0x4440b3[_0x1b9d('0x8a')]!==_0x4440b3[_0x1b9d('0x91')]){if(_0x4440b3[_0x1b9d('0x132')]==='16'&&this['actions'][_0x4440b3[_0x1b9d('0x8a')]][_0x1b9d('0x49')]){this['callProgressDetectingCustomer'](_0x4440b3,_0x4440b3[_0x1b9d('0x8a')],_0x4440b3[_0x1b9d('0x132')]);}else if(this[_0x1b9d('0x18')][_0x4440b3[_0x1b9d('0x8a')]]['dialAnswer']){logger[_0x1b9d('0x57')](_0x1b9d('0x133'),_0x4440b3[_0x1b9d('0x8a')],_0x4440b3[_0x1b9d('0x132')],_0x1b9d('0x92'),_0x59a673['name'],_0x1b9d('0x93'),_0x59a673[_0x1b9d('0x2c')]);this[_0x1b9d('0x134')](_0x4440b3,_0x4440b3['linkedid'],_0x4440b3[_0x1b9d('0x132')]);}}else if(_0xd5fe58&&_[_0x1b9d('0x42')](_0xd5fe58[_0x1b9d('0x135')])&&_0x59a673[_0x1b9d('0x136')]&&_0x4440b3['linkedid']===_0x4440b3[_0x1b9d('0x91')]&&_[_0x1b9d('0x42')](_0x4440b3[_0x1b9d('0xd9')])&&_0x4440b3[_0x1b9d('0x132')]==='16'&&_0x4440b3[_0x1b9d('0x137')]==='6'&&_[_0x1b9d('0xd7')](_0xd5fe58['transfer'])){if(_0xd5fe58[_0x1b9d('0x88')]){rpcDb['unlockContact'](_0xd5fe58[_0x1b9d('0x8b')]);}if(_0xd5fe58[_0x1b9d('0x89')]){rpcDb['disableContact'](_0xd5fe58['idContact']);}_0x4440b3[_0x1b9d('0xd9')]='22';this[_0x1b9d('0xd6')](_0xd5fe58,_0x59a673,_0x4440b3);}else if(_0xd5fe58&&_0xd5fe58['transfer']){if(_0x4440b3[_0x1b9d('0x132')]==='16'&&this['actions'][_0x4440b3['linkedid']][_0x1b9d('0x49')]){logger['info'](_0x1b9d('0x138'),_0x4440b3[_0x1b9d('0x8a')],_0x4440b3[_0x1b9d('0x132')],_0x1b9d('0x92'),_0x59a673[_0x1b9d('0x29')],_0x1b9d('0x93'),_0x59a673['pTalking']);this[_0x1b9d('0x134')](_0x4440b3,_0x4440b3[_0x1b9d('0x8a')],_0x4440b3[_0x1b9d('0x132')]);}else if(this[_0x1b9d('0x18')][_0x4440b3[_0x1b9d('0x8a')]][_0x1b9d('0x49')]){logger[_0x1b9d('0x57')]('[syncHangup][talking][cause]',_0x4440b3['linkedid'],_0x4440b3[_0x1b9d('0x132')],_0x1b9d('0x92'),_0x59a673[_0x1b9d('0x29')],_0x1b9d('0x93'),_0x59a673['pTalking']);this[_0x1b9d('0x134')](_0x4440b3,_0x4440b3[_0x1b9d('0x8a')],_0x4440b3[_0x1b9d('0x132')]);}}};Preview[_0x1b9d('0x10')]['syncDialEnd']=function(_0x282cb2){if(this[_0x1b9d('0x18')][_0x282cb2['destlinkedid']]&&_0x282cb2['destlinkedid']!==_0x282cb2[_0x1b9d('0x139')]){this['callProgressDetectingCustomer'](_0x282cb2,_0x282cb2[_0x1b9d('0xd5')],_0x282cb2['dialstatus']);}};Preview[_0x1b9d('0x10')][_0x1b9d('0x1f')]=function(_0x3505bc){if(this[_0x1b9d('0x18')][_0x3505bc['linkedid']]&&_0x3505bc[_0x1b9d('0x8a')]!==_0x3505bc[_0x1b9d('0x91')]&&!this['actions'][_0x3505bc[_0x1b9d('0x8a')]][_0x1b9d('0x49')]){if(_0x3505bc['cause']==='1'){this['callProgressDetectingCustomer'](_0x3505bc,_0x3505bc[_0x1b9d('0x8a')],_0x3505bc[_0x1b9d('0x132')]);}}};Preview[_0x1b9d('0x10')]['addVariable']=function(_0x457ebe,_0x5b9f3f,_0xac48e4){if(this[_0x1b9d('0x18')][_0x457ebe]){if(_[_0x1b9d('0x42')](this[_0x1b9d('0x18')][_0x457ebe]['variables'])){this[_0x1b9d('0x18')][_0x457ebe][_0x1b9d('0x124')]={};}this['actions'][_0x457ebe]['variables'][_0x5b9f3f]=_0xac48e4;}};Preview[_0x1b9d('0x10')][_0x1b9d('0x13a')]=function(_0x1a1dcc){try{if(!_['isNil'](_0x1a1dcc)){if(ut[_0x1b9d('0x13b')](_[_0x1b9d('0x13c')](_0x1a1dcc['variable'])[0x0])){this[_0x1b9d('0x13d')](_0x1a1dcc[_0x1b9d('0x91')],_[_0x1b9d('0x13c')](_0x1a1dcc[_0x1b9d('0x13e')])[0x0],_0x1a1dcc[_0x1b9d('0x13f')]);}}}catch(_0xd4b9cf){logger[_0x1b9d('0x140')](_0x1b9d('0x141'),util[_0x1b9d('0x142')](_0xd4b9cf,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x1b9d('0x143')]=function(_0x5c2383){if(_0x5c2383){if(this[_0x1b9d('0x18')][_0x5c2383[_0x1b9d('0x144')]]){this['actions'][_0x5c2383[_0x1b9d('0x144')]][_0x1b9d('0x145')]=!![];}}};Preview[_0x1b9d('0x10')]['syncBlindTransfer']=function(_0x2cfec9){if(_0x2cfec9){if(this['actions'][_0x2cfec9['transfererlinkedid']]){this[_0x1b9d('0x18')][_0x2cfec9[_0x1b9d('0x146')]][_0x1b9d('0x145')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 8afd6c7..9b4b6c6 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 _0xe8ae=['endtime','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','rescheduleContact','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueReport','error','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','resolve','[getContactPreview]\x20','createHistory','createAgentHistory','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt'];(function(_0x13cf1e,_0x148ce2){var _0x5af811=function(_0x12a82e){while(--_0x12a82e){_0x13cf1e['push'](_0x13cf1e['shift']());}};_0x5af811(++_0x148ce2);}(_0xe8ae,0x1e5));var _0xee8a=function(_0xdee047,_0x69860a){_0xdee047=_0xdee047-0x0;var _0x86d285=_0xe8ae[_0xdee047];return _0x86d285;};'use strict';var util=require(_0xee8a('0x0'));var BPromise=require(_0xee8a('0x1'));var logger=require(_0xee8a('0x2'))(_0xee8a('0x3'));var cmHopper=require(_0xee8a('0x4'));var cmHopperHistory=require(_0xee8a('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xee8a('0x6'));function loggerCatch(_0x33a21c){return function(_0x176c44){logger[_0xee8a('0x7')](_0x33a21c,util['inspect'](_0x176c44,{'showHidden':![],'depth':null}));};}function create(_0x596b8b){return cmHopperHistory['createHistory'](_0x596b8b)[_0xee8a('0x8')](loggerCatch(_0xee8a('0x9')));}function createAgent(_0x45466b){return BPromise['resolve']()[_0xee8a('0xa')](agentReportPreview['createHistory'](_0x45466b))[_0xee8a('0x8')](loggerCatch(_0xee8a('0x9')));}function moveContact(_0x2c3ab9){return cmHopper[_0xee8a('0xb')](_0x2c3ab9,!![])['catch'](loggerCatch(_0xee8a('0xc')));}exports[_0xee8a('0xd')]=function(_0x14a2b7){return cmHopperBlack[_0xee8a('0xd')](_0x14a2b7)['catch'](loggerCatch(_0xee8a('0xe')));};exports['getContactPreview']=function(_0x10b824){return BPromise[_0xee8a('0xf')]()['then'](cmHopper['getContactPreview'](_0x10b824))[_0xee8a('0x8')](loggerCatch(_0xee8a('0x10')));};exports[_0xee8a('0x11')]=function(_0x17fb36,_0x41c7c8){create(_0x17fb36)[_0xee8a('0x8')](loggerCatch(_0x41c7c8));moveContact(_0x17fb36)[_0xee8a('0x8')](loggerCatch(_0x41c7c8));};exports[_0xee8a('0x12')]=function(_0x199c6d,_0x4634b3){createAgent(_0x199c6d)[_0xee8a('0x8')](loggerCatch(_0x4634b3));};exports['createCustomerHistory']=function(_0x8b9336,_0x1df6e0){create(_0x8b9336)[_0xee8a('0x8')](loggerCatch(_0x1df6e0));};exports['createCustomerFinal']=function(_0x258af3,_0x1a446f){moveContact(_0x258af3)[_0xee8a('0x8')](loggerCatch(_0x1a446f));};exports['rescheduleContact']=function(_0x12fd99,_0x24632b,_0x362f48){if(_0x24632b){_0x12fd99[_0xee8a('0x13')]=null;}if(_0x362f48){_0x12fd99['active']=![];}return cmHopper['rescheduleContact'](_0x12fd99)[_0xee8a('0x8')](loggerCatch(_0xee8a('0x14')));};exports[_0xee8a('0x15')]=function(_0x360a87){return cmHopper['countReScheduled'](_0x360a87)['catch'](loggerCatch(_0xee8a('0x16')));};exports[_0xee8a('0x17')]=function(_0x379ff7){return cmHopper[_0xee8a('0x17')]({'UserId':null},_0x379ff7,0x1)[_0xee8a('0x8')](loggerCatch(_0xee8a('0x18')));};exports['disableContact']=function(_0x3b0e30){return cmHopper['unlockContact']({'active':![]},_0x3b0e30,0x1)[_0xee8a('0x8')](loggerCatch(_0xee8a('0x19')));};exports['crateCustomerReportQueue']=function(_0x4ae118){var _0x5ce70e={};_0x5ce70e[_0xee8a('0x1a')]=_0x4ae118[_0xee8a('0x1a')];_0x5ce70e[_0xee8a('0x1b')]=_0x4ae118['uniqueid'];_0x5ce70e[_0xee8a('0x1c')]=_0x4ae118[_0xee8a('0x1c')];_0x5ce70e['calleridname']=_0x4ae118[_0xee8a('0x1d')];_0x5ce70e[_0xee8a('0x1e')]=_0x4ae118[_0xee8a('0x1e')];_0x5ce70e[_0xee8a('0x1f')]=_0x4ae118[_0xee8a('0x20')];_0x5ce70e[_0xee8a('0x21')]=_0x4ae118[_0xee8a('0x20')];_0x5ce70e['queuecallercomplete']=0x1;_0x5ce70e[_0xee8a('0x22')]=_0x4ae118[_0xee8a('0x23')];_0x5ce70e[_0xee8a('0x24')]=_0x4ae118[_0xee8a('0x25')];_0x5ce70e[_0xee8a('0x26')]='from-sip';_0x5ce70e[_0xee8a('0x27')]=_0xee8a('0x28');_0x5ce70e[_0xee8a('0x29')]=0x0;_0x5ce70e[_0xee8a('0x2a')]=0x1;_0x5ce70e[_0xee8a('0x2b')]=_0x4ae118[_0xee8a('0x25')];_0x5ce70e[_0xee8a('0x2c')]=_0xee8a('0x2d');return BPromise[_0xee8a('0xf')]()[_0xee8a('0xa')](voiceQueueReport[_0xee8a('0x2e')](_0x5ce70e))[_0xee8a('0x8')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xee8a('0x2f')]=function(_0xb1c3ed,_0x285c79){return BPromise[_0xee8a('0xf')]()[_0xee8a('0xa')](cmHopper[_0xee8a('0x2f')](_0xb1c3ed,_0x285c79))[_0xee8a('0x8')](loggerCatch(_0xee8a('0x30')));};exports[_0xee8a('0x31')]=function(_0x306ade){return cmHopper[_0xee8a('0x32')](_0x306ade,!![],!![])[_0xee8a('0x8')](loggerCatch(_0xee8a('0x33')));}; \ No newline at end of file +var _0x224f=['[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','catch','[createHistory]\x20','then','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','getContactPreview','resolve','createAgentHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create'];(function(_0x2240bc,_0xa6e316){var _0x37b4bb=function(_0x3ce22e){while(--_0x3ce22e){_0x2240bc['push'](_0x2240bc['shift']());}};_0x37b4bb(++_0xa6e316);}(_0x224f,0xe1));var _0xf224=function(_0x10d670,_0x178996){_0x10d670=_0x10d670-0x0;var _0x20d6f8=_0x224f[_0x10d670];return _0x20d6f8;};'use strict';var util=require(_0xf224('0x0'));var BPromise=require(_0xf224('0x1'));var logger=require(_0xf224('0x2'))(_0xf224('0x3'));var cmHopper=require(_0xf224('0x4'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xf224('0x5'));var agentReportPreview=require(_0xf224('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x4e424e){return function(_0xfd5aba){logger[_0xf224('0x7')](_0x4e424e,util[_0xf224('0x8')](_0xfd5aba,{'showHidden':![],'depth':null}));};}function create(_0x70e489){return cmHopperHistory['createHistory'](_0x70e489)[_0xf224('0x9')](loggerCatch(_0xf224('0xa')));}function createAgent(_0xa73788){return BPromise['resolve']()[_0xf224('0xb')](agentReportPreview[_0xf224('0xc')](_0xa73788))[_0xf224('0x9')](loggerCatch(_0xf224('0xa')));}function moveContact(_0x114977){return cmHopper[_0xf224('0xd')](_0x114977,!![])[_0xf224('0x9')](loggerCatch(_0xf224('0xe')));}exports['checkIsBlackList']=function(_0x26c342){return cmHopperBlack['checkIsBlackList'](_0x26c342)[_0xf224('0x9')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xf224('0xf')]=function(_0x5349c7){return BPromise[_0xf224('0x10')]()[_0xf224('0xb')](cmHopper[_0xf224('0xf')](_0x5349c7))[_0xf224('0x9')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x3667f4,_0x112eb3){create(_0x3667f4)[_0xf224('0x9')](loggerCatch(_0x112eb3));moveContact(_0x3667f4)[_0xf224('0x9')](loggerCatch(_0x112eb3));};exports[_0xf224('0x11')]=function(_0x1271e7,_0x43af3b){createAgent(_0x1271e7)[_0xf224('0x9')](loggerCatch(_0x43af3b));};exports['createCustomerHistory']=function(_0x2ac1cf,_0x7f8af7){create(_0x2ac1cf)['catch'](loggerCatch(_0x7f8af7));};exports[_0xf224('0x12')]=function(_0x158a7c,_0xbf72bd){moveContact(_0x158a7c)[_0xf224('0x9')](loggerCatch(_0xbf72bd));};exports['rescheduleContact']=function(_0x2e703d,_0x52f9a7,_0x462538){if(_0x52f9a7){_0x2e703d[_0xf224('0x13')]=null;}if(_0x462538){_0x2e703d[_0xf224('0x14')]=![];}return cmHopper[_0xf224('0x15')](_0x2e703d)[_0xf224('0x9')](loggerCatch(_0xf224('0x16')));};exports[_0xf224('0x17')]=function(_0xfb712b){return cmHopper[_0xf224('0x17')](_0xfb712b)[_0xf224('0x9')](loggerCatch(_0xf224('0x18')));};exports[_0xf224('0x19')]=function(_0x36ec5b){return cmHopper[_0xf224('0x19')]({'UserId':null},_0x36ec5b,0x1)[_0xf224('0x9')](loggerCatch(_0xf224('0x1a')));};exports[_0xf224('0x1b')]=function(_0x459276){return cmHopper['unlockContact']({'active':![]},_0x459276,0x1)[_0xf224('0x9')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x101c37){var _0x39d06e={};_0x39d06e[_0xf224('0x1c')]=_0x101c37[_0xf224('0x1c')];_0x39d06e['uniqueid']=_0x101c37[_0xf224('0x1d')];_0x39d06e[_0xf224('0x1e')]=_0x101c37[_0xf224('0x1e')];_0x39d06e[_0xf224('0x1f')]=_0x101c37[_0xf224('0x1f')];_0x39d06e[_0xf224('0x20')]=_0x101c37[_0xf224('0x20')];_0x39d06e[_0xf224('0x21')]=_0x101c37['answertime'];_0x39d06e[_0xf224('0x22')]=_0x101c37[_0xf224('0x23')];_0x39d06e[_0xf224('0x24')]=0x1;_0x39d06e[_0xf224('0x25')]=_0x101c37['endtime'];_0x39d06e[_0xf224('0x26')]=_0x101c37[_0xf224('0x27')];_0x39d06e[_0xf224('0x28')]=_0xf224('0x29');_0x39d06e[_0xf224('0x2a')]=_0xf224('0x2b');_0x39d06e[_0xf224('0x2c')]=0x0;_0x39d06e[_0xf224('0x2d')]=0x1;_0x39d06e[_0xf224('0x2e')]=_0x101c37[_0xf224('0x27')];_0x39d06e[_0xf224('0x2f')]=_0xf224('0x30');return BPromise[_0xf224('0x10')]()[_0xf224('0xb')](voiceQueueReport[_0xf224('0x31')](_0x39d06e))[_0xf224('0x9')](loggerCatch(_0xf224('0x32')));};exports['getContactRecallMe']=function(_0x59466d,_0x382e41){return BPromise[_0xf224('0x10')]()[_0xf224('0xb')](cmHopper[_0xf224('0x33')](_0x59466d,_0x382e41))[_0xf224('0x9')](loggerCatch(_0xf224('0x34')));};exports[_0xf224('0x35')]=function(_0x595899){return cmHopper['rescheduleContact'](_0x595899,!![],!![])[_0xf224('0x9')](loggerCatch(_0xf224('0x36')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index f5ab955..2e894df 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 _0x24ff=['campaigntype','dialAnswer','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','variables','keys','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','inspect','logger','loggerError','logger2','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','ContactId','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime','logAgent','ringtime','getSeconds','starttime','logLookAgent','membername','UserId','logCustomer','endtime','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','channelAgent','calleridnum','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','queue','agentReadyId','status','reachable','milliseconds','diff','createBody','CampaignId','filterKey','idContact'];(function(_0x2167a5,_0x388972){var _0x3a69aa=function(_0x26df22){while(--_0x26df22){_0x2167a5['push'](_0x2167a5['shift']());}};_0x3a69aa(++_0x388972);}(_0x24ff,0xb5));var _0xf24f=function(_0x14331c,_0x345e20){_0x14331c=_0x14331c-0x0;var _0x587343=_0x24ff[_0x14331c];return _0x587343;};'use strict';var util=require(_0xf24f('0x0'));var _=require(_0xf24f('0x1'));var moment=require(_0xf24f('0x2'));var logger=require('../../../../config/logger')('preview');var ipAgi=process['env'][_0xf24f('0x3')]||_0xf24f('0x4');var utils=require(_0xf24f('0x5'));exports[_0xf24f('0x6')]=function(_0x4969ca){return function(_0xdd26cb){logger['error'](_0x4969ca,util[_0xf24f('0x7')](_0xdd26cb,{'showHidden':![],'depth':null}));};};exports[_0xf24f('0x8')]=function(_0x458e05,_0x298eaf){logger['info'](_0x458e05,util[_0xf24f('0x7')](_0x298eaf,{'showHidden':![],'depth':null}));};exports[_0xf24f('0x9')]=function(_0x4eadd9,_0x2cd1f8){logger['error'](_0x4eadd9,util[_0xf24f('0x7')](_0x2cd1f8,{'showHidden':![],'depth':null}));};exports[_0xf24f('0xa')]=function(_0x134e7b){return function(_0x344c9c){logger[_0xf24f('0xb')](_0x134e7b,util[_0xf24f('0x7')](_0x344c9c,{'showHidden':![],'depth':null}));};};exports[_0xf24f('0xc')]=function(_0x25f896,_0x42e2a0,_0x543150){return{'message':_0x25f896,'unlock':_0x42e2a0,'active':_0x543150};};exports[_0xf24f('0xd')]=function(_0x44f7cd,_0x27c557,_0x3b3941){if(!_[_0xf24f('0xe')](_0x3b3941)&&_0xf24f('0xf')===typeof _0x3b3941&&!_[_0xf24f('0x10')](_0x3b3941)){if(!_[_0xf24f('0xe')](_0x27c557)&&_0xf24f('0xf')===typeof _0x27c557&&!_[_0xf24f('0x10')](_0x27c557)){return util[_0xf24f('0x11')](_0xf24f('0x12'),_0x27c557,_0x3b3941);}return util['format'](_0xf24f('0x12'),_0x3b3941,_0x3b3941);}if(!_[_0xf24f('0xe')](_0x44f7cd)&&_0xf24f('0xf')===typeof _0x44f7cd&&!_['isEmpty'](_0x44f7cd)){return _0x44f7cd;}return _0xf24f('0x13');};exports[_0xf24f('0x14')]=function(_0x3403f7){if(_[_0xf24f('0x15')](_0x3403f7)){return![];}return _0x3403f7;};exports[_0xf24f('0x16')]=function(_0xd912ff,_0x1b3ee8,_0x2ad95c,_0x1cf15a,_0x31bbb0,_0x18e90b){var _0x310fce={'XMD-QUEUE':_0x1b3ee8['Queue']?_0x1b3ee8[_0xf24f('0x17')][_0xf24f('0x18')]:'','XMD-CALLERID':_0x1cf15a,'XMD-CALLERID-PREVIEW':_0x18e90b?util[_0xf24f('0x11')](_0xf24f('0x12'),_0x18e90b[_0xf24f('0x19')],_0x18e90b['calleridnum']):_0x1cf15a,'XMD-DIALID':_0x31bbb0,'XMD-CONTACTID':_0x1b3ee8[_0xf24f('0x1a')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1cf15a,'XMD-VOICEQUEUEID':_0x1b3ee8[_0xf24f('0x1b')],'XMD-DIALCHANNEL':_0x2ad95c,'XMD-DIALTIMEOUT':_0xd912ff[_0xf24f('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xf24f('0x11')]('\x22rtTxX%s%s\x22',_0xd912ff[_0xf24f('0x1d')]?'g':'',_[_0xf24f('0x10')](_0xd912ff[_0xf24f('0x1e')])?'':_0xf24f('0x1f')),'XMD-DIALURL':_0xd912ff[_0xf24f('0x20')]||'','XMD-AGI':_0xd912ff[_0xf24f('0x21')]?util['format'](_0xf24f('0x22'),ipAgi,_0xd912ff[_0xf24f('0x21')]):_0xf24f('0x23'),'XMD-AGIAFTER':_0xd912ff[_0xf24f('0x1d')]?util[_0xf24f('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0xd912ff[_0xf24f('0x1d')]):_0xf24f('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x18e90b?_0x18e90b[_0xf24f('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x18e90b?_0x18e90b[_0xf24f('0x25')]:'','XMD-DESTINATION':_0xf24f('0x26'),'SIPADDHEADER':_0xf24f('0x27')};if(!_[_0xf24f('0x10')](_0xd912ff[_0xf24f('0x1e')])){_0x310fce[util[_0xf24f('0x11')]('%s',_0xf24f('0x28'))]=_0xd912ff[_0xf24f('0x1e')];_0x310fce[util[_0xf24f('0x11')]('%s',_0xf24f('0x29'))]=_0x31bbb0;}return _0x310fce;};exports[_0xf24f('0x2a')]=function(_0x514228){var _0x442945={};for(var _0x22d702 in _0x514228){if(_0x514228[_0xf24f('0x2b')](_0x22d702)){_0x442945[util[_0xf24f('0x11')]('%s',_[_0xf24f('0x2c')](_0x22d702))]=_0x514228[_0x22d702];}}return{'variables':_0x442945};};exports[_0xf24f('0x2d')]=function(_0x133a9e,_0x505ccd){if(!_[_0xf24f('0x15')](_0x133a9e)){if(_0x133a9e[_0xf24f('0x2b')](_0xf24f('0x2e'))){if(_0x133a9e[_0xf24f('0x2e')]>0x0){_0x133a9e[_0xf24f('0x2e')]-=0x1;}else{logger[_0xf24f('0x2f')](_0xf24f('0x30'),_0x505ccd);}}}else{logger[_0xf24f('0x2f')](_0xf24f('0x31'),_0x505ccd);}};exports[_0xf24f('0x32')]=function(_0x3e01f4){var _0x310791=moment()[_0xf24f('0x11')](_0xf24f('0x33'));_0x3e01f4[_0xf24f('0x34')]=0xd;_0x3e01f4[_0xf24f('0x35')]=_0xf24f('0x36');_0x3e01f4['starttime']=_0x310791;_0x3e01f4[_0xf24f('0x37')]=_0x310791;_0x3e01f4['endtime']=_0x310791;};exports[_0xf24f('0x38')]=function(_0x2a5ce0,_0x2ff7b0,_0x4b096e){var _0xf45521=moment()[_0xf24f('0x11')](_0xf24f('0x33'));_0x2a5ce0['state']=_0x2ff7b0;_0x2a5ce0['statedesc']=_0x4b096e;_0x2a5ce0[_0xf24f('0x37')]=_0xf45521;_0x2a5ce0[_0xf24f('0x39')]=utils[_0xf24f('0x3a')](_0x2a5ce0[_0xf24f('0x37')],_0x2a5ce0[_0xf24f('0x3b')]);};exports[_0xf24f('0x3c')]=function(_0x154834,_0xf1d6b5,_0x4c25b6){_0x154834[_0xf24f('0x3d')]=_0xf1d6b5;_0x154834[_0xf24f('0x3e')]=_0x4c25b6;};exports[_0xf24f('0x3f')]=function(_0x1c2e7e,_0x5aedc4,_0xca512c){var _0x13e984=moment()[_0xf24f('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c2e7e[_0xf24f('0x34')]=_0x5aedc4;_0x1c2e7e[_0xf24f('0x35')]=_0xca512c;_0x1c2e7e[_0xf24f('0x37')]=_0x1c2e7e['responsetime']?_0x1c2e7e['responsetime']:_0x13e984;_0x1c2e7e[_0xf24f('0x40')]=_0x1c2e7e[_0xf24f('0x40')]?_0x1c2e7e[_0xf24f('0x40')]:_0x13e984;_0x1c2e7e['ringtime']=utils['getSeconds'](_0x1c2e7e['responsetime']||0x0,_0x1c2e7e[_0xf24f('0x3b')]||0x0);_0x1c2e7e['talktime']=_0x1c2e7e[_0xf24f('0x41')]?utils[_0xf24f('0x3a')](_0x1c2e7e[_0xf24f('0x40')],_0x1c2e7e[_0xf24f('0x41')]):0x0;};exports[_0xf24f('0x42')]=function(_0x6361aa){return _0x6361aa===_0xf24f('0x43');};exports['variablesAction']=function(_0x109843,_0x46688c,_0x34cef5,_0x55c4e7,_0x5d6a97){var _0x7aa69a=_0x55c4e7?_0xf24f('0x44'):_0x109843[_0xf24f('0x19')];_0x7aa69a=_0x5d6a97?_0xf24f('0x45'):_0x7aa69a;return{'actionid':_0x109843[_0xf24f('0x46')],'action':'originate','channel':_0x109843[_0xf24f('0x47')],'callerid':util[_0xf24f('0x11')](_0xf24f('0x12'),_0x7aa69a,_0x109843[_0xf24f('0x48')]),'Exten':_0xf24f('0x26'),'Context':'from-sip','Priority':'1','variable':_0x34cef5,'timeout':(_0x46688c[_0xf24f('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x109843[_0xf24f('0x46')]};};exports[_0xf24f('0x4a')]=function(_0x5b12cc){return _0x5b12cc[_0xf24f('0x4b')]+_0x5b12cc[_0xf24f('0x4c')]+_0x5b12cc[_0xf24f('0x4d')]+_0x5b12cc['countagentrejectretry']+_0x5b12cc['countnosuchnumberretry'];};exports[_0xf24f('0x4e')]=function(_0x4c4a41){var _0x111172=_[_0xf24f('0x4f')](_0x4c4a41);_0x111172['state']=0xf;_0x111172[_0xf24f('0x35')]=_0xf24f('0x50');return _0x111172;};exports[_0xf24f('0x51')]=function(_0x58d9aa,_0x1a75dc,_0x1c86aa){var _0x1fda06={};_0x1fda06[_0x1a75dc]=_0x58d9aa[_0x1a75dc];_0x1fda06[_0xf24f('0x52')]=![];_0x1fda06[_0xf24f('0x53')]=moment()[_0xf24f('0x54')](_0x1c86aa,_0xf24f('0x55'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1fda06[_0xf24f('0x1a')]=_0x58d9aa['ContactId'];_0x1fda06['ListId']=_0x58d9aa[_0xf24f('0x56')];_0x1fda06['VoiceQueueId']=_0x58d9aa[_0xf24f('0x1b')]||undefined;return _0x1fda06;};exports[_0xf24f('0x57')]=function(_0xfc4481,_0x11949f){if(!_[_0xf24f('0x15')](_0xfc4481)){if(_0xfc4481[_0xf24f('0x58')]>0x0){_0xfc4481[_0xf24f('0x58')]-=0x1;}else{logger[_0xf24f('0x2f')](_0x11949f,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x11949f,_0xf24f('0x59'));}};exports[_0xf24f('0x5a')]=function(_0x5e80fd){if(_0x5e80fd<=0x0){return!![];}return![];};function buildObj(_0x4523a1,_0x234b5b,_0x627a31){_0x4523a1['lastevent']=_0x234b5b;_0x4523a1[_0xf24f('0x18')]=_0x4523a1['queue'];_0x4523a1[_0xf24f('0x5b')]=_0x4523a1[_0xf24f('0x47')];_0x4523a1[_0xf24f('0x5c')]=_0xf24f('0x5d');if(_0x627a31){_0x4523a1[_0xf24f('0x5e')]=_0x627a31[_0xf24f('0x5e')];}return _0x4523a1;}exports[_0xf24f('0x5f')]=buildObj;exports[_0xf24f('0x60')]=function(_0x4cf99d){var _0x30fb9a={};_0x30fb9a[_0xf24f('0x61')]=_0x4cf99d['queue'];_0x30fb9a[_0xf24f('0x5b')]=_0x4cf99d[_0xf24f('0x47')];_0x30fb9a[_0xf24f('0x46')]=_0x4cf99d[_0xf24f('0x46')];return _0x30fb9a;};exports[_0xf24f('0x62')]=function(_0xaf97c7){var _0x10408d=[];for(var _0x4b05ef in _0xaf97c7){if(_0xaf97c7[_0xf24f('0x2b')](_0x4b05ef)){if(!_['isNil'](_0xaf97c7[_0x4b05ef])&&_0xaf97c7[_0x4b05ef]['state']==='not_inuse'&&_0xaf97c7[_0x4b05ef][_0xf24f('0x63')]===_0xf24f('0x64')){_0x10408d['push'](_0xaf97c7[_0x4b05ef]['id']);}}}return _0x10408d;};exports['getDiff']=function(_0x4a5eb0){var _0x28608b=moment()[_0xf24f('0x65')](0x0);var _0x2e88dc=moment(_0x4a5eb0)['milliseconds'](0x0);return _0x28608b[_0xf24f('0x66')](_0x2e88dc,'seconds');};exports[_0xf24f('0x67')]=function(_0x10c2e3){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x10c2e3[_0xf24f('0x1a')],'ListId':_0x10c2e3[_0xf24f('0x56')],'VoiceQueueId':_0x10c2e3[_0xf24f('0x1b')]||undefined,'CampaignId':_0x10c2e3[_0xf24f('0x68')]||undefined};};exports[_0xf24f('0x69')]=function(_0x13efa7){if(_0x13efa7===_0xf24f('0x46')||_0x13efa7===_0xf24f('0x6a')||_0x13efa7===_0xf24f('0x61')||_0x13efa7==='type'||_0x13efa7===_0xf24f('0x6b')||_0x13efa7===_0xf24f('0x6c')||_0x13efa7==='membername'||_0x13efa7===_0xf24f('0x47')||_0x13efa7===_0xf24f('0x19')||_0x13efa7==='active'||_0x13efa7===_0xf24f('0x48')||_0x13efa7==='scheduledat'||_0x13efa7===_0xf24f('0x4b')||_0x13efa7===_0xf24f('0x4c')||_0x13efa7===_0xf24f('0x4d')||_0x13efa7==='countglobal'||_0x13efa7===_0xf24f('0x6d')||_0x13efa7===_0xf24f('0x6e')||_0x13efa7===_0xf24f('0x6f')||_0x13efa7===_0xf24f('0x70')||_0x13efa7===_0xf24f('0x1a')||_0x13efa7==='ListId'||_0x13efa7===_0xf24f('0x3e')||_0x13efa7===_0xf24f('0x1b')||_0x13efa7===_0xf24f('0x71')||_0x13efa7===_0xf24f('0x72')||_0x13efa7===_0xf24f('0x73')||_0x13efa7==='xmd-phone'||_0x13efa7===_0xf24f('0x74')||_0x13efa7==='xmd-dialurl'||_0x13efa7==='xmd-dialtimeout'||_0x13efa7===_0xf24f('0x75')||_0x13efa7===_0xf24f('0x76')||_0x13efa7===_0xf24f('0x77')||_0x13efa7===_0xf24f('0x78')||_0x13efa7===_0xf24f('0x79')||_0x13efa7===_0xf24f('0x7a')||_0x13efa7==='xmd-agiafter'||_0x13efa7===_0xf24f('0x7b')||_0x13efa7==='rtpaudioqos'||_0x13efa7===_0xf24f('0x7c')||_0x13efa7==='rtpaudioqosjitter'||_0x13efa7===_0xf24f('0x7d')||_0x13efa7===_0xf24f('0x7e')||_0x13efa7===_0xf24f('0x7f')||_0x13efa7===_0xf24f('0x80')||_0x13efa7==='rtpaudioqosrttbridged'||_0x13efa7===_0xf24f('0x81')||_0x13efa7==='rtpaudioqosbridged'||_0x13efa7===_0xf24f('0x82')||_0x13efa7===_0xf24f('0x7d')||_0x13efa7===_0xf24f('0x7e')||_0x13efa7===_0xf24f('0x7f')||_0x13efa7===_0xf24f('0x80')||_0x13efa7===_0xf24f('0x83')||_0x13efa7===_0xf24f('0x84')||_0x13efa7===_0xf24f('0x85')||_0x13efa7===_0xf24f('0x34')||_0x13efa7===_0xf24f('0x35')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x14c908,_0x5032fd){var _0x4b8edc,_0x4e15db,_0x14c4cf;if(_0x5032fd<=0x0){_0x5032fd=0x1;}_0x4b8edc=new RegExp(_0xf24f('0x86')+_0x5032fd+'}$');_0x4e15db=Math[_0xf24f('0x87')](0xa,_0x5032fd-0x1);_0x14c4cf=Math[_0xf24f('0x87')](0xa,_0x5032fd)-0x1;return util[_0xf24f('0x11')]('%s',_['replace'](_0x14c908,_0x4b8edc,_[_0xf24f('0x88')](_0x4e15db,_0x14c4cf)));};exports[_0xf24f('0x89')]=function(_0x4d6e4c){var _0x200ce9=_0x4d6e4c[_0xf24f('0x8a')](/"(.*?)"/);return _0x200ce9?_0x200ce9[0x1]:_0x4d6e4c;};exports[_0xf24f('0x8b')]=function(_0x110e37){var _0x2e05e4=_0x110e37[_0xf24f('0x8a')](/<(.*?)>/);return _0x2e05e4?_0x2e05e4[0x1]:_0x110e37;};function buildNoAnswerEventPayload(_0x1dc862,_0x255172){var _0x510001=buildObj(_0x1dc862,'noanswer');if(!_[_0xf24f('0x10')](_0x255172[_0xf24f('0x8c')])){Object[_0xf24f('0x8d')](_0x255172['variables'])['forEach'](function(_0x2400fb){_0x510001[_0x2400fb[_0xf24f('0x8e')]()]=_0x255172[_0xf24f('0x8c')][_0x2400fb];});}return _0x510001;}exports[_0xf24f('0x8f')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x5d0e=['countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','agentReadyId','not_inuse','status','reachable','getDiff','milliseconds','seconds','CampaignId','filterKey','idContact','type','campaigntype','calleridname','countbusyretry','countglobal','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialid','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosjitter','rtpaudioqoslossbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','error','inspect','logger','logger2','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','starttime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','originate','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countcongestionretry'];(function(_0x49f37e,_0x4d9211){var _0x3c30e6=function(_0x3b0d12){while(--_0x3b0d12){_0x49f37e['push'](_0x49f37e['shift']());}};_0x3c30e6(++_0x4d9211);}(_0x5d0e,0x16c));var _0xe5d0=function(_0x29d80e,_0x578962){_0x29d80e=_0x29d80e-0x0;var _0x1eda3f=_0x5d0e[_0x29d80e];return _0x1eda3f;};'use strict';var util=require('util');var _=require(_0xe5d0('0x0'));var moment=require(_0xe5d0('0x1'));var logger=require(_0xe5d0('0x2'))(_0xe5d0('0x3'));var ipAgi=process[_0xe5d0('0x4')][_0xe5d0('0x5')]||_0xe5d0('0x6');var utils=require('../../dialer/utils');exports['loggerCatch']=function(_0x1a9aad){return function(_0x468121){logger[_0xe5d0('0x7')](_0x1a9aad,util[_0xe5d0('0x8')](_0x468121,{'showHidden':![],'depth':null}));};};exports[_0xe5d0('0x9')]=function(_0x57d52,_0x568b25){logger['info'](_0x57d52,util['inspect'](_0x568b25,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x2a88ae,_0x1769d8){logger[_0xe5d0('0x7')](_0x2a88ae,util[_0xe5d0('0x8')](_0x1769d8,{'showHidden':![],'depth':null}));};exports[_0xe5d0('0xa')]=function(_0x1a5277){return function(_0x2ff2e6){logger[_0xe5d0('0xb')](_0x1a5277,util[_0xe5d0('0x8')](_0x2ff2e6,{'showHidden':![],'depth':null}));};};exports[_0xe5d0('0xc')]=function(_0x2cb29e,_0x174187,_0x3ca751){return{'message':_0x2cb29e,'unlock':_0x174187,'active':_0x3ca751};};exports[_0xe5d0('0xd')]=function(_0x90e998,_0x347919,_0x4724ee){if(!_[_0xe5d0('0xe')](_0x4724ee)&&_0xe5d0('0xf')===typeof _0x4724ee&&!_[_0xe5d0('0x10')](_0x4724ee)){if(!_[_0xe5d0('0xe')](_0x347919)&&_0xe5d0('0xf')===typeof _0x347919&&!_[_0xe5d0('0x10')](_0x347919)){return util[_0xe5d0('0x11')]('\x22%s\x22\x20<%s>',_0x347919,_0x4724ee);}return util[_0xe5d0('0x11')](_0xe5d0('0x12'),_0x4724ee,_0x4724ee);}if(!_[_0xe5d0('0xe')](_0x90e998)&&_0xe5d0('0xf')===typeof _0x90e998&&!_[_0xe5d0('0x10')](_0x90e998)){return _0x90e998;}return _0xe5d0('0x13');};exports[_0xe5d0('0x14')]=function(_0xc465c){if(_[_0xe5d0('0x15')](_0xc465c)){return![];}return _0xc465c;};exports[_0xe5d0('0x16')]=function(_0x514582,_0x185d44,_0x36145a,_0x54444c,_0x38ac5f,_0x31edf0){var _0x52eb30={'XMD-QUEUE':_0x185d44[_0xe5d0('0x17')]?_0x185d44[_0xe5d0('0x17')][_0xe5d0('0x18')]:'','XMD-CALLERID':_0x54444c,'XMD-CALLERID-PREVIEW':_0x31edf0?util[_0xe5d0('0x11')](_0xe5d0('0x12'),_0x31edf0['calleridname'],_0x31edf0[_0xe5d0('0x19')]):_0x54444c,'XMD-DIALID':_0x38ac5f,'XMD-CONTACTID':_0x185d44[_0xe5d0('0x1a')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x54444c,'XMD-VOICEQUEUEID':_0x185d44[_0xe5d0('0x1b')],'XMD-DIALCHANNEL':_0x36145a,'XMD-DIALTIMEOUT':_0x514582[_0xe5d0('0x1c')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xe5d0('0x1d'),_0x514582['dialQueueProject2']?'g':'',_['isEmpty'](_0x514582[_0xe5d0('0x1e')])?'':_0xe5d0('0x1f')),'XMD-DIALURL':_0x514582[_0xe5d0('0x20')]||'','XMD-AGI':_0x514582['dialQueueProject']?util[_0xe5d0('0x11')](_0xe5d0('0x21'),ipAgi,_0x514582[_0xe5d0('0x22')]):_0xe5d0('0x23'),'XMD-AGIAFTER':_0x514582[_0xe5d0('0x24')]?util[_0xe5d0('0x11')](_0xe5d0('0x21'),ipAgi,_0x514582[_0xe5d0('0x24')]):_0xe5d0('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x31edf0?_0x31edf0[_0xe5d0('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x31edf0?_0x31edf0[_0xe5d0('0x26')]:'','XMD-DESTINATION':_0xe5d0('0x27'),'SIPADDHEADER':_0xe5d0('0x28')};if(!_[_0xe5d0('0x10')](_0x514582['monitor_format'])){_0x52eb30[util[_0xe5d0('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x514582[_0xe5d0('0x1e')];_0x52eb30[util[_0xe5d0('0x11')]('%s',_0xe5d0('0x29'))]=_0x38ac5f;}return _0x52eb30;};exports[_0xe5d0('0x2a')]=function(_0x18374f){var _0x6760a3={};for(var _0x15329b in _0x18374f){if(_0x18374f[_0xe5d0('0x2b')](_0x15329b)){_0x6760a3[util[_0xe5d0('0x11')]('%s',_[_0xe5d0('0x2c')](_0x15329b))]=_0x18374f[_0x15329b];}}return{'variables':_0x6760a3};};exports[_0xe5d0('0x2d')]=function(_0x224e9e,_0x2d60d4){if(!_[_0xe5d0('0x15')](_0x224e9e)){if(_0x224e9e[_0xe5d0('0x2b')](_0xe5d0('0x2e'))){if(_0x224e9e[_0xe5d0('0x2e')]>0x0){_0x224e9e[_0xe5d0('0x2e')]-=0x1;}else{logger[_0xe5d0('0x7')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x2d60d4);}}}else{logger[_0xe5d0('0x7')](_0xe5d0('0x2f'),_0x2d60d4);}};exports[_0xe5d0('0x30')]=function(_0x55328e){var _0xb12bea=moment()[_0xe5d0('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x55328e[_0xe5d0('0x31')]=0xd;_0x55328e[_0xe5d0('0x32')]=_0xe5d0('0x33');_0x55328e['starttime']=_0xb12bea;_0x55328e[_0xe5d0('0x34')]=_0xb12bea;_0x55328e[_0xe5d0('0x35')]=_0xb12bea;};exports[_0xe5d0('0x36')]=function(_0x2e09bf,_0x339c0d,_0x2fa094){var _0x4eae95=moment()[_0xe5d0('0x11')](_0xe5d0('0x37'));_0x2e09bf[_0xe5d0('0x31')]=_0x339c0d;_0x2e09bf[_0xe5d0('0x32')]=_0x2fa094;_0x2e09bf[_0xe5d0('0x34')]=_0x4eae95;_0x2e09bf[_0xe5d0('0x38')]=utils[_0xe5d0('0x39')](_0x2e09bf[_0xe5d0('0x34')],_0x2e09bf[_0xe5d0('0x3a')]);};exports[_0xe5d0('0x3b')]=function(_0x1bc113,_0x4e4a28,_0x1cacee){_0x1bc113[_0xe5d0('0x3c')]=_0x4e4a28;_0x1bc113[_0xe5d0('0x3d')]=_0x1cacee;};exports[_0xe5d0('0x3e')]=function(_0xe90828,_0x19506b,_0x1845d1){var _0xb17bef=moment()[_0xe5d0('0x11')](_0xe5d0('0x37'));_0xe90828['state']=_0x19506b;_0xe90828[_0xe5d0('0x32')]=_0x1845d1;_0xe90828['responsetime']=_0xe90828[_0xe5d0('0x34')]?_0xe90828[_0xe5d0('0x34')]:_0xb17bef;_0xe90828[_0xe5d0('0x35')]=_0xe90828[_0xe5d0('0x35')]?_0xe90828[_0xe5d0('0x35')]:_0xb17bef;_0xe90828[_0xe5d0('0x38')]=utils['getSeconds'](_0xe90828['responsetime']||0x0,_0xe90828[_0xe5d0('0x3a')]||0x0);_0xe90828[_0xe5d0('0x3f')]=_0xe90828[_0xe5d0('0x40')]?utils[_0xe5d0('0x39')](_0xe90828[_0xe5d0('0x35')],_0xe90828[_0xe5d0('0x40')]):0x0;};exports[_0xe5d0('0x41')]=function(_0x3eff4e){return _0x3eff4e===_0xe5d0('0x42');};exports[_0xe5d0('0x43')]=function(_0x4b91ab,_0x4ef726,_0x13d44e,_0xbdbe71,_0xe0e70b){var _0x25c2d9=_0xbdbe71?_0xe5d0('0x44'):_0x4b91ab['calleridname'];_0x25c2d9=_0xe0e70b?_0xe5d0('0x45'):_0x25c2d9;return{'actionid':_0x4b91ab['uniqueid'],'action':_0xe5d0('0x46'),'channel':_0x4b91ab[_0xe5d0('0x47')],'callerid':util[_0xe5d0('0x11')](_0xe5d0('0x12'),_0x25c2d9,_0x4b91ab['calleridnum']),'Exten':_0xe5d0('0x27'),'Context':_0xe5d0('0x48'),'Priority':'1','variable':_0x13d44e,'timeout':(_0x4ef726[_0xe5d0('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4b91ab[_0xe5d0('0x4a')]};};exports[_0xe5d0('0x4b')]=function(_0x1532a1){return _0x1532a1['countbusyretry']+_0x1532a1[_0xe5d0('0x4c')]+_0x1532a1[_0xe5d0('0x4d')]+_0x1532a1[_0xe5d0('0x4e')]+_0x1532a1[_0xe5d0('0x4f')];};exports['cloneAction']=function(_0x35277c){var _0x777018=_[_0xe5d0('0x50')](_0x35277c);_0x777018[_0xe5d0('0x31')]=0xf;_0x777018[_0xe5d0('0x32')]=_0xe5d0('0x51');return _0x777018;};exports[_0xe5d0('0x52')]=function(_0x30b80a,_0x1f4f34,_0x465742){var _0x1c457c={};_0x1c457c[_0x1f4f34]=_0x30b80a[_0x1f4f34];_0x1c457c[_0xe5d0('0x53')]=![];_0x1c457c[_0xe5d0('0x54')]=moment()[_0xe5d0('0x55')](_0x465742,_0xe5d0('0x56'))[_0xe5d0('0x11')](_0xe5d0('0x37'));_0x1c457c[_0xe5d0('0x1a')]=_0x30b80a[_0xe5d0('0x1a')];_0x1c457c['ListId']=_0x30b80a[_0xe5d0('0x57')];_0x1c457c[_0xe5d0('0x1b')]=_0x30b80a[_0xe5d0('0x1b')]||undefined;return _0x1c457c;};exports[_0xe5d0('0x58')]=function(_0x1da124,_0xde835e){if(!_[_0xe5d0('0x15')](_0x1da124)){if(_0x1da124['pTalking']>0x0){_0x1da124[_0xe5d0('0x59')]-=0x1;}else{logger[_0xe5d0('0x7')](_0xde835e,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xe5d0('0x7')](_0xde835e,_0xe5d0('0x5a'));}};exports[_0xe5d0('0x5b')]=function(_0x24304c){if(_0x24304c<=0x0){return!![];}return![];};function buildObj(_0x154cb8,_0x2e056e,_0x11a3b7){_0x154cb8[_0xe5d0('0x5c')]=_0x2e056e;_0x154cb8[_0xe5d0('0x18')]=_0x154cb8[_0xe5d0('0x5d')];_0x154cb8[_0xe5d0('0x5e')]=_0x154cb8[_0xe5d0('0x47')];_0x154cb8[_0xe5d0('0x5f')]=_0xe5d0('0x60');if(_0x11a3b7){_0x154cb8[_0xe5d0('0x61')]=_0x11a3b7[_0xe5d0('0x61')];}return _0x154cb8;}exports['buildObj']=buildObj;exports['buildAcw']=function(_0x2d5de5){var _0x557ce8={};_0x557ce8[_0xe5d0('0x5d')]=_0x2d5de5[_0xe5d0('0x5d')];_0x557ce8[_0xe5d0('0x5e')]=_0x2d5de5[_0xe5d0('0x47')];_0x557ce8['uniqueid']=_0x2d5de5[_0xe5d0('0x4a')];return _0x557ce8;};exports[_0xe5d0('0x62')]=function(_0x1fd0be){var _0x78a188=[];for(var _0x468165 in _0x1fd0be){if(_0x1fd0be[_0xe5d0('0x2b')](_0x468165)){if(!_[_0xe5d0('0x15')](_0x1fd0be[_0x468165])&&_0x1fd0be[_0x468165][_0xe5d0('0x31')]===_0xe5d0('0x63')&&_0x1fd0be[_0x468165][_0xe5d0('0x64')]===_0xe5d0('0x65')){_0x78a188['push'](_0x1fd0be[_0x468165]['id']);}}}return _0x78a188;};exports[_0xe5d0('0x66')]=function(_0x384996){var _0x5ef2df=moment()[_0xe5d0('0x67')](0x0);var _0x201ca7=moment(_0x384996)[_0xe5d0('0x67')](0x0);return _0x5ef2df['diff'](_0x201ca7,_0xe5d0('0x68'));};exports['createBody']=function(_0x4ff41b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4ff41b[_0xe5d0('0x1a')],'ListId':_0x4ff41b[_0xe5d0('0x57')],'VoiceQueueId':_0x4ff41b['VoiceQueueId']||undefined,'CampaignId':_0x4ff41b[_0xe5d0('0x69')]||undefined};};exports[_0xe5d0('0x6a')]=function(_0x3a42db){if(_0x3a42db===_0xe5d0('0x4a')||_0x3a42db===_0xe5d0('0x6b')||_0x3a42db==='queue'||_0x3a42db===_0xe5d0('0x6c')||_0x3a42db===_0xe5d0('0x6d')||_0x3a42db==='dialAnswer'||_0x3a42db===_0xe5d0('0x3c')||_0x3a42db===_0xe5d0('0x47')||_0x3a42db===_0xe5d0('0x6e')||_0x3a42db==='active'||_0x3a42db===_0xe5d0('0x19')||_0x3a42db===_0xe5d0('0x54')||_0x3a42db===_0xe5d0('0x6f')||_0x3a42db===_0xe5d0('0x4c')||_0x3a42db===_0xe5d0('0x4d')||_0x3a42db===_0xe5d0('0x70')||_0x3a42db===_0xe5d0('0x71')||_0x3a42db==='callbackuniqueid'||_0x3a42db===_0xe5d0('0x72')||_0x3a42db===_0xe5d0('0x73')||_0x3a42db===_0xe5d0('0x1a')||_0x3a42db===_0xe5d0('0x57')||_0x3a42db==='UserId'||_0x3a42db==='VoiceQueueId'||_0x3a42db===_0xe5d0('0x74')||_0x3a42db===_0xe5d0('0x75')||_0x3a42db===_0xe5d0('0x76')||_0x3a42db==='xmd-phone'||_0x3a42db===_0xe5d0('0x77')||_0x3a42db===_0xe5d0('0x78')||_0x3a42db==='xmd-dialtimeout'||_0x3a42db==='xmd-dialoptions'||_0x3a42db===_0xe5d0('0x79')||_0x3a42db==='xmd-dialchannel'||_0x3a42db===_0xe5d0('0x7a')||_0x3a42db==='xmd-cdrtype'||_0x3a42db===_0xe5d0('0x7b')||_0x3a42db===_0xe5d0('0x7c')||_0x3a42db===_0xe5d0('0x7d')||_0x3a42db===_0xe5d0('0x7e')||_0x3a42db===_0xe5d0('0x7f')||_0x3a42db==='rtpaudioqosjitter'||_0x3a42db===_0xe5d0('0x80')||_0x3a42db===_0xe5d0('0x81')||_0x3a42db==='rtpaudioqoslossbridged'||_0x3a42db===_0xe5d0('0x82')||_0x3a42db==='rtpaudioqosrttbridged'||_0x3a42db===_0xe5d0('0x7e')||_0x3a42db===_0xe5d0('0x7f')||_0x3a42db===_0xe5d0('0x83')||_0x3a42db===_0xe5d0('0x80')||_0x3a42db==='rtpaudioqosloss'||_0x3a42db===_0xe5d0('0x84')||_0x3a42db===_0xe5d0('0x82')||_0x3a42db==='rtpaudioqosrttbridged'||_0x3a42db==='bridgepeer'||_0x3a42db===_0xe5d0('0x85')||_0x3a42db===_0xe5d0('0x31')||_0x3a42db===_0xe5d0('0x32')){return![];}return!![];};exports[_0xe5d0('0x86')]=function(_0x14bc47,_0x4ad903){var _0x1da84d,_0x3ca41a,_0x1a34a1;if(_0x4ad903<=0x0){_0x4ad903=0x1;}_0x1da84d=new RegExp(_0xe5d0('0x87')+_0x4ad903+'}$');_0x3ca41a=Math['pow'](0xa,_0x4ad903-0x1);_0x1a34a1=Math[_0xe5d0('0x88')](0xa,_0x4ad903)-0x1;return util[_0xe5d0('0x11')]('%s',_[_0xe5d0('0x89')](_0x14bc47,_0x1da84d,_[_0xe5d0('0x8a')](_0x3ca41a,_0x1a34a1)));};exports[_0xe5d0('0x8b')]=function(_0x590b60){var _0x40d6c8=_0x590b60['match'](/"(.*?)"/);return _0x40d6c8?_0x40d6c8[0x1]:_0x590b60;};exports['extractCalleridNumber']=function(_0x48dbf7){var _0x39019f=_0x48dbf7[_0xe5d0('0x8c')](/<(.*?)>/);return _0x39019f?_0x39019f[0x1]:_0x48dbf7;};function buildNoAnswerEventPayload(_0x1fe55c,_0x53c3ef){var _0x474e02=buildObj(_0x1fe55c,_0xe5d0('0x8d'));if(!_[_0xe5d0('0x10')](_0x53c3ef[_0xe5d0('0x8e')])){Object[_0xe5d0('0x8f')](_0x53c3ef[_0xe5d0('0x8e')])[_0xe5d0('0x90')](function(_0x4a250c){_0x474e02[_0x4a250c[_0xe5d0('0x91')]()]=_0x53c3ef[_0xe5d0('0x8e')][_0x4a250c];});}return _0x474e02;}exports[_0xe5d0('0x92')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index d1d6cf3..0d70448 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 _0x9f60=['voicequeuechannelredirect','queueadd','string','number','queueremove','queuepause','boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x9f60,0x140));var _0x09f6=function(_0x398d15,_0x82a909){_0x398d15=_0x398d15-0x0;var _0x408a9b=_0x9f60[_0x398d15];return _0x408a9b;};'use strict';exports[_0x09f6('0x0')]={'queue':{'type':_0x09f6('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x09f6('0x1'),'required':!![]},'penalty':{'type':_0x09f6('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x09f6('0x3')]={'queue':{'type':_0x09f6('0x1'),'required':!![]},'interface':{'type':_0x09f6('0x1'),'required':!![]}};exports[_0x09f6('0x4')]={'interface':{'type':_0x09f6('0x1'),'required':!![]},'paused':{'type':_0x09f6('0x5')},'reason':{'type':_0x09f6('0x1'),'required':![]}};exports[_0x09f6('0x6')]={'module':{'type':_0x09f6('0x1'),'required':![]}};exports[_0x09f6('0x7')]={'uniqueid':{'type':_0x09f6('0x1'),'required':!![]}};exports[_0x09f6('0x8')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x09f6('0x1')},'format':{'type':_0x09f6('0x1')},'mixmonitorid':{'type':_0x09f6('0x1')}};exports[_0x09f6('0x9')]={'uniqueid':{'type':_0x09f6('0x1'),'required':!![]}};exports[_0x09f6('0xa')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x09f6('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x59c2=['queueremove','string','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd','boolean'];(function(_0x4f4596,_0x5df1c2){var _0x1c1cc0=function(_0x32a1b2){while(--_0x32a1b2){_0x4f4596['push'](_0x4f4596['shift']());}};_0x1c1cc0(++_0x5df1c2);}(_0x59c2,0x103));var _0x259c=function(_0x330723,_0x8de382){_0x330723=_0x330723-0x0;var _0x60c546=_0x59c2[_0x330723];return _0x60c546;};'use strict';exports[_0x259c('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x259c('0x1'),'required':![]}};exports[_0x259c('0x2')]={'queue':{'type':_0x259c('0x3'),'required':!![]},'interface':{'type':_0x259c('0x3'),'required':!![]}};exports[_0x259c('0x4')]={'interface':{'type':_0x259c('0x3'),'required':!![]},'paused':{'type':_0x259c('0x1')},'reason':{'type':_0x259c('0x3'),'required':![]}};exports[_0x259c('0x5')]={'module':{'type':_0x259c('0x3'),'required':![]}};exports[_0x259c('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x259c('0x7')]={'uniqueid':{'type':_0x259c('0x3'),'required':!![]},'filename':{'type':_0x259c('0x3')},'format':{'type':'string'},'mixmonitorid':{'type':_0x259c('0x3')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0x259c('0x8')]={'uniqueid':{'type':_0x259c('0x3'),'required':!![]},'exten':{'type':_0x259c('0x3'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index d7da913..3e10050 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 _0xadb5=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','initTelephones','length','isUndefined','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty'];(function(_0x13c954,_0x4f0d43){var _0x4f5ed1=function(_0x4ec45d){while(--_0x4ec45d){_0x13c954['push'](_0x13c954['shift']());}};_0x4f5ed1(++_0x4f0d43);}(_0xadb5,0xad));var _0x5adb=function(_0x47aaa6,_0x2754cf){_0x47aaa6=_0x47aaa6-0x0;var _0x5a5b8f=_0xadb5[_0x47aaa6];return _0x5a5b8f;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var util=require('util');var Agent=require(_0x5adb('0x1'));var Telephone=require(_0x5adb('0x2'));var Trunk=require(_0x5adb('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5adb('0x4'));var Template=require(_0x5adb('0x5'));var Campaign=require(_0x5adb('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5adb('0x7'));var SalesforceAccount=require(_0x5adb('0x8'));var FreshdeskAccount=require(_0x5adb('0x9'));var SugarcrmAccount=require(_0x5adb('0xa'));var ZohoAccount=require(_0x5adb('0xb'));var DeskAccount=require(_0x5adb('0xc'));var VtigerAccount=require(_0x5adb('0xd'));var ServicenowAccount=require(_0x5adb('0xe'));var Dynamics365Account=require(_0x5adb('0xf'));var FreshsalesAccount=require(_0x5adb('0x10'));var FaxAccount=require(_0x5adb('0x11'));function Realtime(){this[_0x5adb('0x12')]={};this[_0x5adb('0x13')]={};this[_0x5adb('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0x5adb('0x15')]={};this[_0x5adb('0x16')]={};this[_0x5adb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x5adb('0x18')]={};this['queueChannels']={};this[_0x5adb('0x19')]={};this['timers']={};this[_0x5adb('0x1a')]={};this[_0x5adb('0x1b')]={};this[_0x5adb('0x1c')]={};this['sugarcrmAccounts']={};this[_0x5adb('0x1d')]={};this[_0x5adb('0x1e')]={};this[_0x5adb('0x1f')]={};this['vtigerAccounts']={};this[_0x5adb('0x20')]={};this['dynamics365Accounts']={};this[_0x5adb('0x21')]={};this[_0x5adb('0x22')]={};}function freeIsNotKey(_0x30614e,_0x304784,_0x1c0f97){var _0x39d24d=_[_0x5adb('0x23')](_0x30614e,function(_0x42f4c6){return _0x42f4c6[_0x1c0f97];});for(var _0xb953a6 in _0x304784){if(_0x304784['hasOwnProperty'](_0xb953a6)){if(!_0x39d24d[_0xb953a6]){delete _0x304784[_0xb953a6];}}}}function freeIsNotKeySip(_0x3fff62,_0x5de028){var _0x1d9e86=_['mapKeys'](_0x3fff62,function(_0x3ef465){return util['format']('SIP/%s',_0x3ef465[_0x5adb('0x24')]);});for(var _0x1bed20 in _0x5de028){if(_0x5de028[_0x5adb('0x25')](_0x1bed20)){if(!_0x1d9e86[_0x1bed20]){delete _0x5de028[_0x1bed20];}}}}function freeIsNotKeyAgent(_0x1fd4a7,_0x99bc6c){var _0x5af69d=_[_0x5adb('0x23')](_0x1fd4a7,function(_0x5c296e){var _0x4e9f16=_[_0x5adb('0x26')](_0x5c296e[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x5c296e[_0x5adb('0x24')]):_0x5c296e[_0x5adb('0x27')];return _0x4e9f16;});for(var _0xfd9bb9 in _0x99bc6c){if(_0x99bc6c['hasOwnProperty'](_0xfd9bb9)){if(!_0x5af69d[_0xfd9bb9]){delete _0x99bc6c[_0xfd9bb9];}}}}function clearVoiceCallReports(_0x4b1957){_0x4b1957[_0x5adb('0x2a')]=0x0;_0x4b1957[_0x5adb('0x2b')]=0x0;_0x4b1957[_0x5adb('0x2c')]=0x0;_0x4b1957[_0x5adb('0x2d')]=0x0;_0x4b1957['sumBillable']=0x0;}function clearCampaigns(_0x2fee18){if(!_[_0x5adb('0x2e')](_0x2fee18)){for(var _0x5aed76 in _0x2fee18){if(_0x2fee18[_0x5adb('0x25')](_0x5aed76)){_0x2fee18[_0x5aed76][_0x5adb('0x2f')]=0x0;_0x2fee18[_0x5aed76][_0x5adb('0x30')]=0x0;}}}}function clearVoiceQueues(_0x55b40a){if(!_[_0x5adb('0x2e')](_0x55b40a)){for(var _0xbe21b1 in _0x55b40a){if(_0x55b40a[_0x5adb('0x25')](_0xbe21b1)){_0x55b40a[_0xbe21b1][_0x5adb('0x2a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x2b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x31')]=0x0;_0x55b40a[_0xbe21b1]['abandoned']=0x0;_0x55b40a[_0xbe21b1]['sumHoldTime']=0x0;_0x55b40a[_0xbe21b1]['sumDuration']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x32')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x34')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x35')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x36')]=0x0;_0x55b40a[_0xbe21b1]['outboundNoSuchCallsDay']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x37')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x38')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x39')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3c')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3d')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3e')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3f')]=!![];}}}}Realtime['prototype'][_0x5adb('0x40')]=function(_0x4c8b2e,_0x12424d){for(var _0x20cde6 in _0x12424d){if(_0x4c8b2e['hasOwnProperty'](_0x20cde6)){_0x4c8b2e[_0x20cde6]=_0x12424d[_0x20cde6];}}};Realtime[_0x5adb('0x41')][_0x5adb('0x42')]=function(){var _0x461a39=this;return function(_0x4a3661){if(_0x4a3661){freeIsNotKeyAgent(_0x4a3661,_0x461a39[_0x5adb('0x12')]);for(var _0x14cf00=0x0,_0x4b5887={};_0x14cf00<_0x4a3661['length'];_0x14cf00+=0x1){_0x4b5887=_0x4a3661[_0x14cf00];var _0x1ed9ea=_['isNil'](_0x4b5887[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x4b5887[_0x5adb('0x24')]):_0x4b5887[_0x5adb('0x27')];if(_['isUndefined'](_0x461a39[_0x5adb('0x12')][_0x1ed9ea])){_0x461a39[_0x5adb('0x12')][_0x1ed9ea]=new Agent(_0x4b5887);}else{_0x461a39[_0x5adb('0x40')](_0x461a39['agents'][_0x1ed9ea],_0x4b5887);}}}return _0x461a39['agents'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x43')]=function(){var _0x586820=this;return function(_0x2355bc){if(_0x2355bc){freeIsNotKeySip(_0x2355bc,_0x586820['telephones']);for(var _0x199d3b=0x0,_0x58cc5d={};_0x199d3b<_0x2355bc[_0x5adb('0x44')];_0x199d3b+=0x1){_0x58cc5d=_0x2355bc[_0x199d3b];if(_['isUndefined'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')]('SIP/%s',_0x58cc5d[_0x5adb('0x24')])])){_0x586820['telephones'][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])]=new Telephone(_0x58cc5d);}else{_0x586820['mergeFromDatabase'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])],_0x58cc5d);}}}return _0x586820[_0x5adb('0x13')];};};Realtime['prototype']['initTrunks']=function(){var _0x4f491a=this;return function(_0x599999){if(_0x599999){freeIsNotKeySip(_0x599999,_0x4f491a[_0x5adb('0x14')]);for(var _0x2fbe14=0x0,_0x3a104a={};_0x2fbe14<_0x599999[_0x5adb('0x44')];_0x2fbe14+=0x1){_0x3a104a=_0x599999[_0x2fbe14];if(_[_0x5adb('0x45')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])])){_0x4f491a['trunks'][util[_0x5adb('0x28')]('SIP/%s',_0x3a104a[_0x5adb('0x24')])]=new Trunk(_0x3a104a);}else{_0x4f491a[_0x5adb('0x40')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])],_0x3a104a);}}}return _0x4f491a[_0x5adb('0x14')];};};Realtime[_0x5adb('0x41')]['initTriggers']=function(){var _0x4160ad=this;return function(_0x1a256c){if(_0x1a256c){freeIsNotKey(_0x1a256c,_0x4160ad['triggers'],'id');for(var _0x120497=0x0,_0x407a4c={};_0x120497<_0x1a256c[_0x5adb('0x44')];_0x120497+=0x1){_0x407a4c=_0x1a256c[_0x120497];if(_[_0x5adb('0x45')](_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']])){_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']]=new Trigger(_0x407a4c);}else{_0x4160ad[_0x5adb('0x40')](_0x4160ad['triggers'][_0x407a4c['id']],_0x407a4c);}}}return _0x4160ad['triggers'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x47')]=function(){var _0x1cd0a3=this;return function(_0xb79d85){if(_0xb79d85){freeIsNotKey(_0xb79d85,_0x1cd0a3['templates'],'id');for(var _0x507e48=0x0,_0xaa32e4={};_0x507e48<_0xb79d85[_0x5adb('0x44')];_0x507e48+=0x1){_0xaa32e4=_0xb79d85[_0x507e48];if(_[_0x5adb('0x45')](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']])){_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']]=new Template(_0xaa32e4);}else{_0x1cd0a3['mergeFromDatabase'](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']],_0xaa32e4);}}}return _0x1cd0a3[_0x5adb('0x16')];};};Realtime['prototype'][_0x5adb('0x48')]=function(){var _0x251f45=this;return function(_0x1cdb03){if(_0x1cdb03){freeIsNotKey(_0x1cdb03,_0x251f45[_0x5adb('0x1b')],'id');for(var _0x186bd2=0x0,_0x3a5409={};_0x186bd2<_0x1cdb03[_0x5adb('0x44')];_0x186bd2+=0x1){_0x3a5409=_0x1cdb03[_0x186bd2];if(_[_0x5adb('0x45')](_0x251f45['zendeskAccounts'][_0x3a5409['id']])){_0x251f45[_0x5adb('0x1b')][_0x3a5409['id']]=new ZendeskAccount(_0x3a5409);}else{_0x251f45['mergeFromDatabase'](_0x251f45['zendeskAccounts'][_0x3a5409['id']],_0x3a5409);}}}return _0x251f45['zendeskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x49')]=function(){var _0x207a81=this;return function(_0x4ba0b5){if(_0x4ba0b5){freeIsNotKey(_0x4ba0b5,_0x207a81[_0x5adb('0x1c')],'id');for(var _0x5cbab5=0x0,_0x177a81={};_0x5cbab5<_0x4ba0b5[_0x5adb('0x44')];_0x5cbab5+=0x1){_0x177a81=_0x4ba0b5[_0x5cbab5];if(_[_0x5adb('0x45')](_0x207a81['salesforceAccounts'][_0x177a81['id']])){_0x207a81[_0x5adb('0x1c')][_0x177a81['id']]=new SalesforceAccount(_0x177a81);}else{_0x207a81['mergeFromDatabase'](_0x207a81[_0x5adb('0x1c')][_0x177a81['id']],_0x177a81);}}}return _0x207a81[_0x5adb('0x1c')];};};Realtime['prototype'][_0x5adb('0x4a')]=function(){var _0x1ab97b=this;return function(_0x3594e3){if(_0x3594e3){freeIsNotKey(_0x3594e3,_0x1ab97b[_0x5adb('0x1d')],'id');for(var _0x372734=0x0,_0x4cb36c={};_0x372734<_0x3594e3[_0x5adb('0x44')];_0x372734+=0x1){_0x4cb36c=_0x3594e3[_0x372734];if(_[_0x5adb('0x45')](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']])){_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']]=new FreshdeskAccount(_0x4cb36c);}else{_0x1ab97b['mergeFromDatabase'](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']],_0x4cb36c);}}}return _0x1ab97b[_0x5adb('0x1d')];};};Realtime[_0x5adb('0x41')]['initZohoAccounts']=function(){var _0x2b34a8=this;return function(_0xd0e5b7){if(_0xd0e5b7){freeIsNotKey(_0xd0e5b7,_0x2b34a8[_0x5adb('0x1e')],'id');for(var _0xfd3471=0x0,_0x4f2da9={};_0xfd3471<_0xd0e5b7[_0x5adb('0x44')];_0xfd3471+=0x1){_0x4f2da9=_0xd0e5b7[_0xfd3471];if(_[_0x5adb('0x45')](_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']])){_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']]=new ZohoAccount(_0x4f2da9);}else{_0x2b34a8[_0x5adb('0x40')](_0x2b34a8['zohoAccounts'][_0x4f2da9['id']],_0x4f2da9);}}}return _0x2b34a8[_0x5adb('0x1e')];};};Realtime['prototype'][_0x5adb('0x4b')]=function(){var _0x4f7227=this;return function(_0x31ae72){if(_0x31ae72){freeIsNotKey(_0x31ae72,_0x4f7227[_0x5adb('0x1f')],'id');for(var _0x1a9358=0x0,_0x42f6d9={};_0x1a9358<_0x31ae72['length'];_0x1a9358+=0x1){_0x42f6d9=_0x31ae72[_0x1a9358];if(_[_0x5adb('0x45')](_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']])){_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']]=new DeskAccount(_0x42f6d9);}else{_0x4f7227['mergeFromDatabase'](_0x4f7227['deskAccounts'][_0x42f6d9['id']],_0x42f6d9);}}}return _0x4f7227['deskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x4c')]=function(){var _0xa5ecc0=this;return function(_0x12a146){if(_0x12a146){freeIsNotKey(_0x12a146,_0xa5ecc0[_0x5adb('0x4d')],'id');for(var _0xb06bee=0x0,_0x204b9b={};_0xb06bee<_0x12a146[_0x5adb('0x44')];_0xb06bee+=0x1){_0x204b9b=_0x12a146[_0xb06bee];if(_[_0x5adb('0x45')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']])){_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']]=new SugarcrmAccount(_0x204b9b);}else{_0xa5ecc0[_0x5adb('0x40')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']],_0x204b9b);}}}return _0xa5ecc0['sugarcrmAccounts'];};};Realtime['prototype'][_0x5adb('0x4e')]=function(){var _0x27a8e4=this;return function(_0x43cde9){if(_0x43cde9){freeIsNotKey(_0x43cde9,_0x27a8e4[_0x5adb('0x4f')],'id');for(var _0x5d7a9f=0x0,_0xfba0d5={};_0x5d7a9f<_0x43cde9[_0x5adb('0x44')];_0x5d7a9f+=0x1){_0xfba0d5=_0x43cde9[_0x5d7a9f];if(_['isUndefined'](_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']])){_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']]=new VtigerAccount(_0xfba0d5);}else{_0x27a8e4[_0x5adb('0x40')](_0x27a8e4['vtigerAccounts'][_0xfba0d5['id']],_0xfba0d5);}}}return _0x27a8e4[_0x5adb('0x4f')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x50')]=function(){var _0x30c92c=this;return function(_0x330290){if(_0x330290){freeIsNotKey(_0x330290,_0x30c92c[_0x5adb('0x20')],'id');for(var _0x513f26=0x0,_0x836b91={};_0x513f26<_0x330290[_0x5adb('0x44')];_0x513f26+=0x1){_0x836b91=_0x330290[_0x513f26];if(_[_0x5adb('0x45')](_0x30c92c['servicenowAccounts'][_0x836b91['id']])){_0x30c92c[_0x5adb('0x20')][_0x836b91['id']]=new ServicenowAccount(_0x836b91);}else{_0x30c92c[_0x5adb('0x40')](_0x30c92c[_0x5adb('0x20')][_0x836b91['id']],_0x836b91);}}}return _0x30c92c['servicenowAccounts'];};};Realtime[_0x5adb('0x41')]['initDynamics365Accounts']=function(){var _0xa8ff64=this;return function(_0x1e7e3a){if(_0x1e7e3a){freeIsNotKey(_0x1e7e3a,_0xa8ff64[_0x5adb('0x51')],'id');for(var _0x57f0a4=0x0,_0x192b1f={};_0x57f0a4<_0x1e7e3a[_0x5adb('0x44')];_0x57f0a4+=0x1){_0x192b1f=_0x1e7e3a[_0x57f0a4];if(_['isUndefined'](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']])){_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']]=new Dynamics365Account(_0x192b1f);}else{_0xa8ff64[_0x5adb('0x40')](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']],_0x192b1f);}}}return _0xa8ff64['dynamics365Accounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x52')]=function(){var _0x307f07=this;return function(_0x16716e){if(_0x16716e){freeIsNotKey(_0x16716e,_0x307f07['freshsalesAccounts'],'id');for(var _0x53a4bc=0x0,_0x304512={};_0x53a4bc<_0x16716e['length'];_0x53a4bc+=0x1){_0x304512=_0x16716e[_0x53a4bc];if(_['isUndefined'](_0x307f07['freshsalesAccounts'][_0x304512['id']])){_0x307f07[_0x5adb('0x21')][_0x304512['id']]=new FreshsalesAccount(_0x304512);}else{_0x307f07[_0x5adb('0x40')](_0x307f07['freshsalesAccounts'][_0x304512['id']],_0x304512);}}}return _0x307f07[_0x5adb('0x21')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x53')]=function(){var _0xf6ef8a=this;return function(_0x358a23){for(var _0x126e38=0x0;_0x126e38<_0x358a23[_0x5adb('0x44')];_0x126e38+=0x1){_[_0x5adb('0x54')](_0xf6ef8a['voiceQueues'][_0x358a23[_0x126e38]['name']],_0x358a23[_0x126e38]);}return _0xf6ef8a['voiceQueues'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x55')]=function(){var _0x3a0d1b=this;return function(_0x2a55a3){clearVoiceQueues(_0x3a0d1b[_0x5adb('0x56')]);if(_0x2a55a3){_0x2a55a3=_[_0x5adb('0x57')](_0x2a55a3,_0x5adb('0x58'));for(var _0x25f761 in _0x2a55a3){if(_0x2a55a3['hasOwnProperty'](_0x25f761)){for(var _0x5e55c2=0x0;_0x5e55c2<_0x2a55a3[_0x25f761][_0x5adb('0x44')];_0x5e55c2+=0x1){var _0x56df90=_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x59')];if(_0x3a0d1b[_0x5adb('0x56')][_0x56df90]){if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5a')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x31')]+=0x1;}if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5b')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x5c')]+=0x1;}_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallerjoinAt']),_0x5adb('0x5f'))||0x0;if(_0x5e55c2===_0x2a55a3[_0x25f761][_0x5adb('0x44')]-0x1){_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallercompleteAt']||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x60')]||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x61')])['diff'](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x62')]),_0x5adb('0x5f'))||0x0;_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2a')]+=0x1;if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x63')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2b')]+=0x1;_0x3a0d1b[_0x5adb('0x56')][_0x56df90]['sumBillable']+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x64')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')]),'seconds')||0x0;}}else{_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]||0x0;}}}}}}return _0x3a0d1b[_0x5adb('0x56')];};};Realtime[_0x5adb('0x41')]['initVoiceCallReports']=function(){var _0x3a9735=this;return function(_0x288e4f){clearVoiceCallReports(_0x3a9735[_0x5adb('0x17')]);if(_0x288e4f){for(var _0x3ecc56=0x0;_0x3ecc56<_0x288e4f[_0x5adb('0x44')];_0x3ecc56+=0x1){_0x3a9735['outbound'][_0x5adb('0x2a')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2d')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')];if(_0x288e4f[_0x3ecc56]['disposition']===_0x5adb('0x66')){_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2b')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2c')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')]-_0x288e4f[_0x3ecc56][_0x5adb('0x67')]||0x0;_0x3a9735['outbound'][_0x5adb('0x32')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x67')];}}}return _0x3a9735['outbound'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x68')]=function(){var _0x4fc0d5=this;return function(_0x462fa0){if(_0x462fa0){freeIsNotKey(_0x462fa0,_0x4fc0d5['campaigns'],_0x5adb('0x24'));for(var _0x268df2=0x0,_0x4a2ebc={};_0x268df2<_0x462fa0[_0x5adb('0x44')];_0x268df2+=0x1){_0x4a2ebc=_0x462fa0[_0x268df2];if(_['isUndefined'](_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]])){_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]]=new Campaign(_0x4a2ebc);}else{_0x4fc0d5[_0x5adb('0x40')](_0x4fc0d5['campaigns'][_0x4a2ebc[_0x5adb('0x24')]],_0x4a2ebc);_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]][_0x5adb('0x69')]=_0x4a2ebc['SquareProject']?_0x4a2ebc['SquareProject'][_0x5adb('0x24')]:undefined;}}}return _0x4fc0d5[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6a')]=function(){var _0x277668=this;return function(_0xc74e86){if(_0xc74e86){freeIsNotKey(_0xc74e86,_0x277668[_0x5adb('0x6b')],'id');for(var _0x514833=0x0,_0xda26cc={};_0x514833<_0xc74e86[_0x5adb('0x44')];_0x514833+=0x1){_0xda26cc=_0xc74e86[_0x514833];if(_[_0x5adb('0x45')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']])){_0x277668['voiceExtensions'][_0xda26cc['id']]=new VoiceExtension(_0xda26cc);}else{_0x277668[_0x5adb('0x40')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']],_0xda26cc);}}}return _0x277668[_0x5adb('0x6b')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6c')]=function(){var _0x188cbd=this;return function(_0x315ac6){clearCampaigns(_0x188cbd[_0x5adb('0x15')]);for(var _0x1f753e=0x0;_0x1f753e<_0x315ac6['length'];_0x1f753e+=0x1){_[_0x5adb('0x54')](_0x188cbd[_0x5adb('0x15')][_0x315ac6[_0x1f753e]['name']],_0x315ac6[_0x1f753e]);}return _0x188cbd[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6d')]=function(){var _0x3bb3fc=this;return function(_0x200221){if(_0x200221){freeIsNotKey(_0x200221,_0x3bb3fc[_0x5adb('0x22')],'id');for(var _0x450516=0x0,_0x350bb1={};_0x450516<_0x200221['length'];_0x450516+=0x1){_0x350bb1=_0x200221[_0x450516];if(_[_0x5adb('0x45')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']])){_0x3bb3fc['faxAccounts'][_0x350bb1['id']]=new FaxAccount(_0x350bb1);}else{_0x3bb3fc[_0x5adb('0x40')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']],_0x350bb1);}}}return _0x3bb3fc[_0x5adb('0x22')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x2d7a9f=this;return function(_0x328851){if(_0x328851){freeIsNotKey(_0x328851,_0x2d7a9f[_0x5adb('0x56')],'name');for(var _0x14b36f=0x0,_0x321c3a={};_0x14b36f<_0x328851[_0x5adb('0x44')];_0x14b36f+=0x1){_0x321c3a=_0x328851[_0x14b36f];if(_[_0x5adb('0x45')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]])){_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]]=new VoiceQueue(_0x321c3a);}else{_0x2d7a9f[_0x5adb('0x40')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]],_0x321c3a);}}}return _0x2d7a9f[_0x5adb('0x56')];};};module['exports']=Realtime; \ No newline at end of file +var _0x0b0e=['total','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','length','isNil','SIP/%s','isUndefined','prototype','initTelephones','initTrunks','trunks','initTriggers','initTemplates','salesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','queuecallercomplete','answered','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','lodash','util','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','name','hasOwnProperty','format','interface'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3ab928,_0x2b990b){_0x3ab928=_0x3ab928-0x0;var _0xf47692=_0x0b0e[_0x3ab928];return _0xf47692;};'use strict';var _=require(_0xe0b0('0x0'));var moment=require('moment');var util=require(_0xe0b0('0x1'));var Agent=require('../model/agent');var Telephone=require(_0xe0b0('0x2'));var Trunk=require(_0xe0b0('0x3'));var VoiceQueue=require(_0xe0b0('0x4'));var Trigger=require(_0xe0b0('0x5'));var Template=require(_0xe0b0('0x6'));var Campaign=require(_0xe0b0('0x7'));var VoiceExtension=require(_0xe0b0('0x8'));var ZendeskAccount=require(_0xe0b0('0x9'));var SalesforceAccount=require(_0xe0b0('0xa'));var FreshdeskAccount=require(_0xe0b0('0xb'));var SugarcrmAccount=require(_0xe0b0('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xe0b0('0xd'));var ServicenowAccount=require(_0xe0b0('0xe'));var Dynamics365Account=require(_0xe0b0('0xf'));var FreshsalesAccount=require(_0xe0b0('0x10'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xe0b0('0x11')]={};this[_0xe0b0('0x12')]={};this['trunks']={};this[_0xe0b0('0x13')]={};this[_0xe0b0('0x14')]={};this['campaigns']={};this[_0xe0b0('0x15')]={};this[_0xe0b0('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe0b0('0x17')]={};this['channels']={};this[_0xe0b0('0x18')]={};this[_0xe0b0('0x19')]={};this[_0xe0b0('0x1a')]={};this[_0xe0b0('0x1b')]={};this[_0xe0b0('0x1c')]={};this['salesforceAccounts']={};this[_0xe0b0('0x1d')]={};this[_0xe0b0('0x1e')]={};this[_0xe0b0('0x1f')]={};this[_0xe0b0('0x20')]={};this[_0xe0b0('0x21')]={};this['servicenowAccounts']={};this[_0xe0b0('0x22')]={};this['freshsalesAccounts']={};this[_0xe0b0('0x23')]={};}function freeIsNotKey(_0xadee6e,_0x519ae8,_0x11fdca){var _0x4a4cc0=_[_0xe0b0('0x24')](_0xadee6e,function(_0x100204){return _0x100204[_0x11fdca];});for(var _0x56bcc7 in _0x519ae8){if(_0x519ae8['hasOwnProperty'](_0x56bcc7)){if(!_0x4a4cc0[_0x56bcc7]){delete _0x519ae8[_0x56bcc7];}}}}function freeIsNotKeySip(_0x46bb44,_0x50a441){var _0x4df8da=_['mapKeys'](_0x46bb44,function(_0x1920ee){return util['format']('SIP/%s',_0x1920ee[_0xe0b0('0x25')]);});for(var _0x59dff5 in _0x50a441){if(_0x50a441[_0xe0b0('0x26')](_0x59dff5)){if(!_0x4df8da[_0x59dff5]){delete _0x50a441[_0x59dff5];}}}}function freeIsNotKeyAgent(_0x5dba2f,_0x2c84cc){var _0x1cd7c4=_[_0xe0b0('0x24')](_0x5dba2f,function(_0x310a6d){var _0x2cf6a1=_['isNil'](_0x310a6d['interface'])?util[_0xe0b0('0x27')]('SIP/%s',_0x310a6d[_0xe0b0('0x25')]):_0x310a6d[_0xe0b0('0x28')];return _0x2cf6a1;});for(var _0x513e63 in _0x2c84cc){if(_0x2c84cc[_0xe0b0('0x26')](_0x513e63)){if(!_0x1cd7c4[_0x513e63]){delete _0x2c84cc[_0x513e63];}}}}function clearVoiceCallReports(_0x503883){_0x503883[_0xe0b0('0x29')]=0x0;_0x503883['answered']=0x0;_0x503883[_0xe0b0('0x2a')]=0x0;_0x503883['sumDuration']=0x0;_0x503883[_0xe0b0('0x2b')]=0x0;}function clearCampaigns(_0x4de537){if(!_[_0xe0b0('0x2c')](_0x4de537)){for(var _0x4aafbe in _0x4de537){if(_0x4de537[_0xe0b0('0x26')](_0x4aafbe)){_0x4de537[_0x4aafbe]['ivrTotalCallsDays']=0x0;_0x4de537[_0x4aafbe][_0xe0b0('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x3c3bc2){if(!_[_0xe0b0('0x2c')](_0x3c3bc2)){for(var _0x1d91ad in _0x3c3bc2){if(_0x3c3bc2[_0xe0b0('0x26')](_0x1d91ad)){_0x3c3bc2[_0x1d91ad][_0xe0b0('0x29')]=0x0;_0x3c3bc2[_0x1d91ad]['answered']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2e')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2f')]=0x0;_0x3c3bc2[_0x1d91ad]['sumHoldTime']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x30')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2b')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x32')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x33')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x34')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x35')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundUnknownCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x36')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x37')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundBlacklistCallsDay']=0x0;_0x3c3bc2[_0x1d91ad]['outboundOriginateFailureCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x38')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x39')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3a')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3b')]=!![];}}}}Realtime['prototype'][_0xe0b0('0x3c')]=function(_0x3231fc,_0x7867c4){for(var _0x29d725 in _0x7867c4){if(_0x3231fc[_0xe0b0('0x26')](_0x29d725)){_0x3231fc[_0x29d725]=_0x7867c4[_0x29d725];}}};Realtime['prototype'][_0xe0b0('0x3d')]=function(){var _0x208945=this;return function(_0xfc51d3){if(_0xfc51d3){freeIsNotKeyAgent(_0xfc51d3,_0x208945[_0xe0b0('0x11')]);for(var _0x3575bc=0x0,_0x12eeb8={};_0x3575bc<_0xfc51d3[_0xe0b0('0x3e')];_0x3575bc+=0x1){_0x12eeb8=_0xfc51d3[_0x3575bc];var _0x20908f=_[_0xe0b0('0x3f')](_0x12eeb8[_0xe0b0('0x28')])?util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x12eeb8[_0xe0b0('0x25')]):_0x12eeb8[_0xe0b0('0x28')];if(_[_0xe0b0('0x41')](_0x208945['agents'][_0x20908f])){_0x208945[_0xe0b0('0x11')][_0x20908f]=new Agent(_0x12eeb8);}else{_0x208945[_0xe0b0('0x3c')](_0x208945[_0xe0b0('0x11')][_0x20908f],_0x12eeb8);}}}return _0x208945[_0xe0b0('0x11')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x43')]=function(){var _0x12024d=this;return function(_0x533fc7){if(_0x533fc7){freeIsNotKeySip(_0x533fc7,_0x12024d['telephones']);for(var _0x549d9a=0x0,_0x5317df={};_0x549d9a<_0x533fc7[_0xe0b0('0x3e')];_0x549d9a+=0x1){_0x5317df=_0x533fc7[_0x549d9a];if(_[_0xe0b0('0x41')](_0x12024d[_0xe0b0('0x12')][util['format'](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])])){_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')]('SIP/%s',_0x5317df[_0xe0b0('0x25')])]=new Telephone(_0x5317df);}else{_0x12024d[_0xe0b0('0x3c')](_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])],_0x5317df);}}}return _0x12024d[_0xe0b0('0x12')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x44')]=function(){var _0x54f251=this;return function(_0x3e349b){if(_0x3e349b){freeIsNotKeySip(_0x3e349b,_0x54f251['trunks']);for(var _0x34178d=0x0,_0x2d5f47={};_0x34178d<_0x3e349b[_0xe0b0('0x3e')];_0x34178d+=0x1){_0x2d5f47=_0x3e349b[_0x34178d];if(_[_0xe0b0('0x41')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])])){_0x54f251[_0xe0b0('0x45')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])]=new Trunk(_0x2d5f47);}else{_0x54f251[_0xe0b0('0x3c')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47['name'])],_0x2d5f47);}}}return _0x54f251['trunks'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x46')]=function(){var _0x56e7df=this;return function(_0x18a59d){if(_0x18a59d){freeIsNotKey(_0x18a59d,_0x56e7df[_0xe0b0('0x14')],'id');for(var _0x6bca5c=0x0,_0x1c869d={};_0x6bca5c<_0x18a59d[_0xe0b0('0x3e')];_0x6bca5c+=0x1){_0x1c869d=_0x18a59d[_0x6bca5c];if(_['isUndefined'](_0x56e7df['triggers'][_0x1c869d['id']])){_0x56e7df['triggers'][_0x1c869d['id']]=new Trigger(_0x1c869d);}else{_0x56e7df[_0xe0b0('0x3c')](_0x56e7df[_0xe0b0('0x14')][_0x1c869d['id']],_0x1c869d);}}}return _0x56e7df['triggers'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x47')]=function(){var _0x14197b=this;return function(_0x5f037d){if(_0x5f037d){freeIsNotKey(_0x5f037d,_0x14197b[_0xe0b0('0x15')],'id');for(var _0x5c6f94=0x0,_0x57d4b0={};_0x5c6f94<_0x5f037d[_0xe0b0('0x3e')];_0x5c6f94+=0x1){_0x57d4b0=_0x5f037d[_0x5c6f94];if(_[_0xe0b0('0x41')](_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']])){_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']]=new Template(_0x57d4b0);}else{_0x14197b[_0xe0b0('0x3c')](_0x14197b['templates'][_0x57d4b0['id']],_0x57d4b0);}}}return _0x14197b[_0xe0b0('0x15')];};};Realtime[_0xe0b0('0x42')]['initZendeskAccounts']=function(){var _0x50c805=this;return function(_0x5ddad1){if(_0x5ddad1){freeIsNotKey(_0x5ddad1,_0x50c805[_0xe0b0('0x1c')],'id');for(var _0x2184d3=0x0,_0x2419ce={};_0x2184d3<_0x5ddad1[_0xe0b0('0x3e')];_0x2184d3+=0x1){_0x2419ce=_0x5ddad1[_0x2184d3];if(_['isUndefined'](_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']])){_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']]=new ZendeskAccount(_0x2419ce);}else{_0x50c805['mergeFromDatabase'](_0x50c805['zendeskAccounts'][_0x2419ce['id']],_0x2419ce);}}}return _0x50c805[_0xe0b0('0x1c')];};};Realtime[_0xe0b0('0x42')]['initSalesforceAccounts']=function(){var _0x2b1917=this;return function(_0x27fd31){if(_0x27fd31){freeIsNotKey(_0x27fd31,_0x2b1917['salesforceAccounts'],'id');for(var _0x5cb2b6=0x0,_0x123ad2={};_0x5cb2b6<_0x27fd31['length'];_0x5cb2b6+=0x1){_0x123ad2=_0x27fd31[_0x5cb2b6];if(_[_0xe0b0('0x41')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']])){_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']]=new SalesforceAccount(_0x123ad2);}else{_0x2b1917[_0xe0b0('0x3c')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']],_0x123ad2);}}}return _0x2b1917[_0xe0b0('0x48')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x2ef908=this;return function(_0x5d380a){if(_0x5d380a){freeIsNotKey(_0x5d380a,_0x2ef908['freshdeskAccounts'],'id');for(var _0x249d9a=0x0,_0x222174={};_0x249d9a<_0x5d380a['length'];_0x249d9a+=0x1){_0x222174=_0x5d380a[_0x249d9a];if(_['isUndefined'](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']])){_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']]=new FreshdeskAccount(_0x222174);}else{_0x2ef908[_0xe0b0('0x3c')](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']],_0x222174);}}}return _0x2ef908[_0xe0b0('0x1e')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x49')]=function(){var _0x4ebb0f=this;return function(_0x22c7bc){if(_0x22c7bc){freeIsNotKey(_0x22c7bc,_0x4ebb0f['zohoAccounts'],'id');for(var _0x17b3d4=0x0,_0x54106c={};_0x17b3d4<_0x22c7bc['length'];_0x17b3d4+=0x1){_0x54106c=_0x22c7bc[_0x17b3d4];if(_[_0xe0b0('0x41')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']])){_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']]=new ZohoAccount(_0x54106c);}else{_0x4ebb0f[_0xe0b0('0x3c')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']],_0x54106c);}}}return _0x4ebb0f[_0xe0b0('0x1f')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4a')]=function(){var _0x2e1c9b=this;return function(_0x4e0d87){if(_0x4e0d87){freeIsNotKey(_0x4e0d87,_0x2e1c9b[_0xe0b0('0x20')],'id');for(var _0x57ccc9=0x0,_0x2b5553={};_0x57ccc9<_0x4e0d87[_0xe0b0('0x3e')];_0x57ccc9+=0x1){_0x2b5553=_0x4e0d87[_0x57ccc9];if(_[_0xe0b0('0x41')](_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']])){_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']]=new DeskAccount(_0x2b5553);}else{_0x2e1c9b[_0xe0b0('0x3c')](_0x2e1c9b['deskAccounts'][_0x2b5553['id']],_0x2b5553);}}}return _0x2e1c9b[_0xe0b0('0x20')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4b')]=function(){var _0x271445=this;return function(_0x3bb6d6){if(_0x3bb6d6){freeIsNotKey(_0x3bb6d6,_0x271445[_0xe0b0('0x1d')],'id');for(var _0x234cb7=0x0,_0x1a60d2={};_0x234cb7<_0x3bb6d6[_0xe0b0('0x3e')];_0x234cb7+=0x1){_0x1a60d2=_0x3bb6d6[_0x234cb7];if(_[_0xe0b0('0x41')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']])){_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']]=new SugarcrmAccount(_0x1a60d2);}else{_0x271445[_0xe0b0('0x3c')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']],_0x1a60d2);}}}return _0x271445[_0xe0b0('0x1d')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4c')]=function(){var _0x155738=this;return function(_0x5aa79b){if(_0x5aa79b){freeIsNotKey(_0x5aa79b,_0x155738[_0xe0b0('0x21')],'id');for(var _0xe7fbac=0x0,_0x1182dc={};_0xe7fbac<_0x5aa79b[_0xe0b0('0x3e')];_0xe7fbac+=0x1){_0x1182dc=_0x5aa79b[_0xe7fbac];if(_[_0xe0b0('0x41')](_0x155738[_0xe0b0('0x21')][_0x1182dc['id']])){_0x155738[_0xe0b0('0x21')][_0x1182dc['id']]=new VtigerAccount(_0x1182dc);}else{_0x155738['mergeFromDatabase'](_0x155738['vtigerAccounts'][_0x1182dc['id']],_0x1182dc);}}}return _0x155738[_0xe0b0('0x21')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4d')]=function(){var _0x47ecc1=this;return function(_0x117d20){if(_0x117d20){freeIsNotKey(_0x117d20,_0x47ecc1[_0xe0b0('0x4e')],'id');for(var _0x309efb=0x0,_0x3d820c={};_0x309efb<_0x117d20[_0xe0b0('0x3e')];_0x309efb+=0x1){_0x3d820c=_0x117d20[_0x309efb];if(_['isUndefined'](_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']])){_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']]=new ServicenowAccount(_0x3d820c);}else{_0x47ecc1[_0xe0b0('0x3c')](_0x47ecc1['servicenowAccounts'][_0x3d820c['id']],_0x3d820c);}}}return _0x47ecc1[_0xe0b0('0x4e')];};};Realtime[_0xe0b0('0x42')]['initDynamics365Accounts']=function(){var _0x1bd249=this;return function(_0x4c5478){if(_0x4c5478){freeIsNotKey(_0x4c5478,_0x1bd249['dynamics365Accounts'],'id');for(var _0x4474ac=0x0,_0x57b51e={};_0x4474ac<_0x4c5478['length'];_0x4474ac+=0x1){_0x57b51e=_0x4c5478[_0x4474ac];if(_[_0xe0b0('0x41')](_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']])){_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']]=new Dynamics365Account(_0x57b51e);}else{_0x1bd249[_0xe0b0('0x3c')](_0x1bd249['dynamics365Accounts'][_0x57b51e['id']],_0x57b51e);}}}return _0x1bd249[_0xe0b0('0x22')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4f')]=function(){var _0x41ec8e=this;return function(_0x1b29c){if(_0x1b29c){freeIsNotKey(_0x1b29c,_0x41ec8e[_0xe0b0('0x50')],'id');for(var _0xc5e88c=0x0,_0x224f1e={};_0xc5e88c<_0x1b29c['length'];_0xc5e88c+=0x1){_0x224f1e=_0x1b29c[_0xc5e88c];if(_['isUndefined'](_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']])){_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']]=new FreshsalesAccount(_0x224f1e);}else{_0x41ec8e[_0xe0b0('0x3c')](_0x41ec8e['freshsalesAccounts'][_0x224f1e['id']],_0x224f1e);}}}return _0x41ec8e['freshsalesAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x51')]=function(){var _0x5d7cf4=this;return function(_0x5eca3d){for(var _0x691136=0x0;_0x691136<_0x5eca3d[_0xe0b0('0x3e')];_0x691136+=0x1){_[_0xe0b0('0x52')](_0x5d7cf4[_0xe0b0('0x13')][_0x5eca3d[_0x691136][_0xe0b0('0x25')]],_0x5eca3d[_0x691136]);}return _0x5d7cf4[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x53')]=function(){var _0x51f209=this;return function(_0x1daff7){clearVoiceQueues(_0x51f209[_0xe0b0('0x13')]);if(_0x1daff7){_0x1daff7=_[_0xe0b0('0x54')](_0x1daff7,'uniqueid');for(var _0x4fbf44 in _0x1daff7){if(_0x1daff7['hasOwnProperty'](_0x4fbf44)){for(var _0x56ee83=0x0;_0x56ee83<_0x1daff7[_0x4fbf44]['length'];_0x56ee83+=0x1){var _0x567c06=_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x55')];if(_0x51f209['voiceQueues'][_0x567c06]){if(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexit']){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2e')]+=0x1;}if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x56')]){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2f')]+=0x1;}_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')])['diff'](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x58')]),_0xe0b0('0x59'))||0x0;if(_0x56ee83===_0x1daff7[_0x4fbf44][_0xe0b0('0x3e')]-0x1){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5a')]||_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5b')]||_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexitAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerjoinAt']),_0xe0b0('0x59'))||0x0;_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x29')]+=0x1;if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5d')]){_0x51f209['voiceQueues'][_0x567c06][_0xe0b0('0x5e')]+=0x1;_0x51f209[_0xe0b0('0x13')][_0x567c06]['sumBillable']+=moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallercompleteAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')]),_0xe0b0('0x59'))||0x0;}}else{_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]||0x0;}}}}}}return _0x51f209[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x5f')]=function(){var _0x5a63e6=this;return function(_0x4c512b){clearVoiceCallReports(_0x5a63e6[_0xe0b0('0x16')]);if(_0x4c512b){for(var _0x4880d5=0x0;_0x4880d5<_0x4c512b['length'];_0x4880d5+=0x1){_0x5a63e6['outbound']['total']+=0x1;_0x5a63e6[_0xe0b0('0x16')]['sumDuration']+=_0x4c512b[_0x4880d5][_0xe0b0('0x60')];if(_0x4c512b[_0x4880d5][_0xe0b0('0x61')]===_0xe0b0('0x62')){_0x5a63e6[_0xe0b0('0x16')]['answered']+=0x1;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2a')]+=_0x4c512b[_0x4880d5]['duration']-_0x4c512b[_0x4880d5][_0xe0b0('0x63')]||0x0;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2b')]+=_0x4c512b[_0x4880d5][_0xe0b0('0x63')];}}}return _0x5a63e6[_0xe0b0('0x16')];};};Realtime['prototype']['initCampaigns']=function(){var _0x55aef7=this;return function(_0x545694){if(_0x545694){freeIsNotKey(_0x545694,_0x55aef7['campaigns'],_0xe0b0('0x25'));for(var _0x567e1a=0x0,_0x3c09af={};_0x567e1a<_0x545694['length'];_0x567e1a+=0x1){_0x3c09af=_0x545694[_0x567e1a];if(_[_0xe0b0('0x41')](_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]])){_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]]=new Campaign(_0x3c09af);}else{_0x55aef7[_0xe0b0('0x3c')](_0x55aef7['campaigns'][_0x3c09af['name']],_0x3c09af);_0x55aef7['campaigns'][_0x3c09af['name']][_0xe0b0('0x65')]=_0x3c09af[_0xe0b0('0x66')]?_0x3c09af[_0xe0b0('0x66')][_0xe0b0('0x25')]:undefined;}}}return _0x55aef7[_0xe0b0('0x64')];};};Realtime['prototype'][_0xe0b0('0x67')]=function(){var _0x39a07b=this;return function(_0xf77616){if(_0xf77616){freeIsNotKey(_0xf77616,_0x39a07b[_0xe0b0('0x17')],'id');for(var _0x154e6d=0x0,_0x2a5082={};_0x154e6d<_0xf77616[_0xe0b0('0x3e')];_0x154e6d+=0x1){_0x2a5082=_0xf77616[_0x154e6d];if(_[_0xe0b0('0x41')](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']])){_0x39a07b['voiceExtensions'][_0x2a5082['id']]=new VoiceExtension(_0x2a5082);}else{_0x39a07b['mergeFromDatabase'](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']],_0x2a5082);}}}return _0x39a07b[_0xe0b0('0x17')];};};Realtime['prototype'][_0xe0b0('0x68')]=function(){var _0x4593f1=this;return function(_0x44c475){clearCampaigns(_0x4593f1[_0xe0b0('0x64')]);for(var _0x7358ce=0x0;_0x7358ce<_0x44c475[_0xe0b0('0x3e')];_0x7358ce+=0x1){_[_0xe0b0('0x52')](_0x4593f1[_0xe0b0('0x64')][_0x44c475[_0x7358ce]['name']],_0x44c475[_0x7358ce]);}return _0x4593f1['campaigns'];};};Realtime['prototype'][_0xe0b0('0x69')]=function(){var _0x90d471=this;return function(_0x5d2365){if(_0x5d2365){freeIsNotKey(_0x5d2365,_0x90d471[_0xe0b0('0x23')],'id');for(var _0x448694=0x0,_0x396eec={};_0x448694<_0x5d2365[_0xe0b0('0x3e')];_0x448694+=0x1){_0x396eec=_0x5d2365[_0x448694];if(_['isUndefined'](_0x90d471['faxAccounts'][_0x396eec['id']])){_0x90d471['faxAccounts'][_0x396eec['id']]=new FaxAccount(_0x396eec);}else{_0x90d471[_0xe0b0('0x3c')](_0x90d471[_0xe0b0('0x23')][_0x396eec['id']],_0x396eec);}}}return _0x90d471['faxAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x6a')]=function(){var _0x5547ee=this;return function(_0x576482){if(_0x576482){freeIsNotKey(_0x576482,_0x5547ee[_0xe0b0('0x13')],'name');for(var _0x251195=0x0,_0x5f06c0={};_0x251195<_0x576482[_0xe0b0('0x3e')];_0x251195+=0x1){_0x5f06c0=_0x576482[_0x251195];if(_[_0xe0b0('0x41')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]])){_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]]=new VoiceQueue(_0x5f06c0);}else{_0x5547ee[_0xe0b0('0x3c')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]],_0x5f06c0);}}}return _0x5547ee['voiceQueues'];};};module[_0xe0b0('0x6b')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index ffe6e8f..fc90887 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3dca=['mergeDBDataToRealtime','hasOwnProperty'];(function(_0xcc8575,_0x50c582){var _0x19f31f=function(_0x46cbd6){while(--_0x46cbd6){_0xcc8575['push'](_0xcc8575['shift']());}};_0x19f31f(++_0x50c582);}(_0x3dca,0x1b3));var _0xa3dc=function(_0x4c9f35,_0x2bb122){_0x4c9f35=_0x4c9f35-0x0;var _0x49d047=_0x3dca[_0x4c9f35];return _0x49d047;};'use strict';function mergeDBDataToRealtime(_0x3c9cc2,_0x8a539e){var _0x79ea1b=Object['assign']({},_0x3c9cc2);for(var _0x80361a in _0x8a539e){if(_0x79ea1b[_0xa3dc('0x0')](_0x80361a)){_0x79ea1b[_0x80361a]=_0x8a539e[_0x80361a];}}return _0x79ea1b;}exports[_0xa3dc('0x1')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x53ef=['hasOwnProperty','mergeDBDataToRealtime','assign'];(function(_0x3846dc,_0x3dd50f){var _0x3c2cae=function(_0x18d8fd){while(--_0x18d8fd){_0x3846dc['push'](_0x3846dc['shift']());}};_0x3c2cae(++_0x3dd50f);}(_0x53ef,0x131));var _0xf53e=function(_0xa2c0a3,_0x5bbac0){_0xa2c0a3=_0xa2c0a3-0x0;var _0x52c618=_0x53ef[_0xa2c0a3];return _0x52c618;};'use strict';function mergeDBDataToRealtime(_0x2e70f7,_0x39429d){var _0x5a1f8d=Object[_0xf53e('0x0')]({},_0x2e70f7);for(var _0x31df96 in _0x39429d){if(_0x5a1f8d[_0xf53e('0x1')](_0x31df96)){_0x5a1f8d[_0x31df96]=_0x39429d[_0x31df96];}}return _0x5a1f8d;}exports[_0xf53e('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 7875c13..d591bd0 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 _0x4eca=['prototype','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','voiceQueueReport','length','assigned','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','getAgentByInternal','keys','channel','split','calleridnum','outbound','internal','voiceCallReport','lastapplication','queue','from-voip-provider','callerid','context','destination','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','monitors','monitorFilename','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','substring','indexOf','phone','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones'];(function(_0x17594a,_0x3b09a5){var _0xfb5e3c=function(_0x864854){while(--_0x864854){_0x17594a['push'](_0x17594a['shift']());}};_0xfb5e3c(++_0x3b09a5);}(_0x4eca,0x14f));var _0xa4ec=function(_0xc555b2,_0x361dc7){_0xc555b2=_0xc555b2-0x0;var _0x573970=_0x4eca[_0xc555b2];return _0x573970;};'use strict';var _=require(_0xa4ec('0x0'));var moment=require(_0xa4ec('0x1'));var util=require(_0xa4ec('0x2'));var config=require(_0xa4ec('0x3'));var ami=require(_0xa4ec('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xa4ec('0x5'));var RpcVoiceDialReport=require(_0xa4ec('0x6'));var RpcMemberReport=require(_0xa4ec('0x7'));var RpcVoiceQueueReport=require(_0xa4ec('0x8'));var RpcVoiceRecording=require(_0xa4ec('0x9'));var RpcVoiceTransferReport=require(_0xa4ec('0xa'));var VoiceQueueReport=require(_0xa4ec('0xb'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xa4ec('0xc'));var VoiceDialReport=require(_0xa4ec('0xd'));var UserReport=require('./userReport');function Report(_0x4df1e3){this[_0xa4ec('0xe')]=_0x4df1e3;this[_0xa4ec('0xf')]=_0x4df1e3[_0xa4ec('0xf')];this[_0xa4ec('0x10')]=_0x4df1e3[_0xa4ec('0x10')];}Report[_0xa4ec('0x11')]['sync']=function(_0x1eed2a){var _0x201ad5=new VoiceQueueReport(this['realtime']);var _0x1c3b10=new VoiceAgentReport(this[_0xa4ec('0xe')]);var _0x4c2b5b=new VoiceDialReport(this[_0xa4ec('0xe')]);var _0x20e801=new VoiceCallReport(this['realtime']);var _0x375ca6=new UserReport(this[_0xa4ec('0xe')]);if(config[_0xa4ec('0x12')]&&config[_0xa4ec('0x12')][_0xa4ec('0x13')]){ami['on'](_0xa4ec('0x14'),this['voiceQueueReport'][_0xa4ec('0x15')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0xa4ec('0x15')](this));ami['on'](_0xa4ec('0x16'),this[_0xa4ec('0x17')][_0xa4ec('0x15')](this));ami['on'](_0xa4ec('0x18'),this[_0xa4ec('0x19')]['bind'](this));ami['on']('blindtransfer',this[_0xa4ec('0x1a')][_0xa4ec('0x15')](this));ami['on'](_0xa4ec('0x1b'),this[_0xa4ec('0x1c')][_0xa4ec('0x15')](this));}};Report[_0xa4ec('0x11')][_0xa4ec('0x1d')]=function(_0x8242f2){var _0x106457;_0x106457=_[_0xa4ec('0x1e')](this[_0xa4ec('0xf')],function(_0x16b8eb){return _0x16b8eb[_0xa4ec('0x1f')]==_0x8242f2||_0x16b8eb[_0xa4ec('0x20')]==_0x8242f2;});if(_[_0xa4ec('0x21')](_0x106457)){var _0x593245=_[_0xa4ec('0x1e')](this[_0xa4ec('0x10')],function(_0x13db8b){return _0x13db8b[_0xa4ec('0x1f')]==_0x8242f2||_0x13db8b[_0xa4ec('0x20')]==_0x8242f2;});if(_0x593245){_0x106457=_['find'](this[_0xa4ec('0xf')],function(_0x329618){return _0x329618[_0xa4ec('0x22')]==util[_0xa4ec('0x23')]('SIP/%s',_0x593245[_0xa4ec('0x20')]);});}}return _0x106457;};Report[_0xa4ec('0x11')][_0xa4ec('0x24')]=function(_0xbc710e){for(var _0x3ddbb4=0x0;_0x3ddbb4<_0xbc710e[_0xa4ec('0x25')];_0x3ddbb4+=0x1){var _0x2e8744=this[_0xa4ec('0x1d')](_0xbc710e[_0x3ddbb4]['connectedlinenum']);if(_0x2e8744){_0xbc710e[_0x3ddbb4][_0xa4ec('0x1f')]=_0x2e8744['accountcode'];_0xbc710e[_0x3ddbb4][_0xa4ec('0x26')]=!![];_0xbc710e[_0x3ddbb4]['lastAssignedTo']=_0x2e8744[_0xa4ec('0x20')];_0xbc710e[_0x3ddbb4]['interface']=_[_0xa4ec('0x21')](_0x2e8744['interface'])?util[_0xa4ec('0x23')]('SIP/%s',_0x2e8744[_0xa4ec('0x20')]):_0x2e8744['interface'];if(_0xbc710e[_0x3ddbb4][_0xa4ec('0x27')]){_0xbc710e[_0x3ddbb4]['queuecallercompleteAt']=moment()[_0xa4ec('0x23')](_0xa4ec('0x28'));}if(_0xbc710e[_0x3ddbb4][_0xa4ec('0x29')]){_0xbc710e[_0x3ddbb4]['queuecallerexitAt']=moment()[_0xa4ec('0x23')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0xbc710e[_0x3ddbb4]);}RpcVoiceQueueReport[_0xa4ec('0x2a')](_0xbc710e[_0x3ddbb4]);}};function extractCalleridNumber(_0x50ead4){var _0x34981e=_0x50ead4[_0xa4ec('0x2b')](/<(.*?)>/);return _0x34981e?_0x34981e[0x1]:_0x50ead4;}Report['prototype'][_0xa4ec('0x2c')]=function(_0x59712d){for(var _0x5480ff=0x0;_0x5480ff/);return _0xc5cc80?_0xc5cc80[0x1]:_0x27846c;}Report['prototype'][_0x5716('0x2f')]=function(_0x4a8dd9){for(var _0x2448fd=0x0;_0x2448fd',_0x3a4ed9[_0x5716('0x45')],_0x3a4ed9[_0x5716('0x34')]);}if(RpcVoiceTransferReport['transfers'][_0x3a4ed9[_0x5716('0x46')]]){var _0x1e5b27=RpcVoiceTransferReport['transfers'][_0x3a4ed9[_0x5716('0x46')]];_0x1e5b27[_0x5716('0x47')]=_0x3a4ed9['uniqueid'];RpcVoiceTransferReport[_0x5716('0x1d')](_0x1e5b27);delete RpcVoiceTransferReport[_0x5716('0x48')][_0x3a4ed9[_0x5716('0x46')]];}if(_['isNil'](_0x3a4ed9['type'])){_0x3a4ed9[_0x5716('0x49')]=this[_0x5716('0x31')](_0x3a4ed9);}if(_[_0x5716('0x21')](_0x3a4ed9[_0x5716('0x4a')])){var _0x1449a0=_0x3a4ed9['channel']['split']('-')[0x0];var _0x39b3f0=this[_0x5716('0xf')][_0x1449a0];if(!_0x39b3f0)_0x39b3f0=this['getAgentByInternal'](_0x3a4ed9[_0x5716('0x1f')]);if(_0x39b3f0){_0x3a4ed9[_0x5716('0x4a')]=_0x39b3f0['id'];_0x3a4ed9[_0x5716('0x4b')]=_0x39b3f0[_0x5716('0x20')];}}RpcVoiceCallReport[_0x5716('0x2d')](_0x3a4ed9);if(_0x3a4ed9[_0x5716('0x4c')]){for(var _0xf31256=0x0;_0xf31256<_0x3a4ed9['monitors'][_0x5716('0x23')];_0xf31256+=0x1){_0x3a4ed9[_0x5716('0x4d')]=_0x3a4ed9[_0x5716('0x4e')][_0xf31256][_0x5716('0x4f')];_0x3a4ed9['createdAt']=_0x3a4ed9[_0x5716('0x4e')][_0xf31256]['createdAt'];if(_0x3a4ed9['exten']=='xcally-motion-preview'){_0x3a4ed9[_0x5716('0x34')]=_0x3a4ed9[_0x5716('0x24')];_0x3a4ed9[_0x5716('0x45')]=_0x3a4ed9[_0x5716('0x50')];_0x3a4ed9[_0x5716('0x24')]=_0x3a4ed9[_0x5716('0x1f')];_0x3a4ed9['connectedlinename']=_0x3a4ed9[_0x5716('0x4b')];_0x3a4ed9['exten']=_0x3a4ed9['originatecalleridnum'];}else if(_0x3a4ed9[_0x5716('0x39')]==_0x5716('0x51')){_0x3a4ed9['calleridnum']=_0x3a4ed9[_0x5716('0x38')];_0x3a4ed9[_0x5716('0x39')]=_0x3a4ed9['originatecalleridnum'];}RpcVoiceRecording[_0x5716('0x2d')](_0x3a4ed9);}}};Report[_0x5716('0x11')]['voiceAgentReport']=function(_0x241ddb){if(_['isArray'](_0x241ddb)){_0x241ddb[_0x5716('0x52')](function(_0x4a925f){RpcVoiceAgentReport[_0x5716('0x2d')](_0x4a925f);});}else{RpcVoiceAgentReport[_0x5716('0x2d')](_0x241ddb);}};Report[_0x5716('0x11')][_0x5716('0x1b')]=function(_0x5be9e5){RpcVoiceDialReport['create'](_0x5be9e5);var _0x106028;var _0x2ffe5b;var _0x207431=_0x5be9e5['channel'];if(_['startsWith'](_0x207431,'Local')){_0x2ffe5b=_0x207431['substring'](_0x207431['indexOf']('/')+0x1,_0x207431['indexOf']('@'));_0x106028=_['find'](this[_0x5716('0xf')],function(_0x2d8225){return _0x2d8225[_0x5716('0x53')]==_0x2ffe5b||_0x2d8225[_0x5716('0x54')]==_0x2ffe5b||_0x2d8225[_0x5716('0x1f')]==_0x2ffe5b;});}else{_0x2ffe5b=_0x207431[_0x5716('0x55')](_0x207431[_0x5716('0x56')]('/')+0x1,_0x207431[_0x5716('0x57')]('-'));_0x106028=this[_0x5716('0x58')](_0x2ffe5b);}if(_0x106028){_0x5be9e5[_0x5716('0x27')]=_[_0x5716('0x21')](_0x106028['interface'])?util[_0x5716('0x26')]('SIP/%s',_0x106028[_0x5716('0x20')]):_0x106028['interface'];_0x5be9e5[_0x5716('0x4b')]=_0x106028[_0x5716('0x20')];_0x5be9e5['accountcode']=_0x106028[_0x5716('0x1f')];RpcMemberReport[_0x5716('0x1b')](_0x5be9e5);}};Report[_0x5716('0x11')][_0x5716('0x1d')]=function(_0x4ce558){RpcVoiceTransferReport[_0x5716('0x48')][_0x4ce558[_0x5716('0x59')]]=_0x4ce558;};Report['prototype']['attendedTransfer']=function(_0x4ccf6a){RpcVoiceTransferReport['attendedTransfer'](_0x4ccf6a);};module[_0x5716('0x5a')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 2279526..6cfba5c 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3772=['isNotNull','[userReport][registry]\x20registry:%s\x20state:%s','username','state','find','stateRegistry','merge','event','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','trunk:save','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','name','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','accountcode','peerstatus','info','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','util','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isUndefined','emit'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x3772,0xc5));var _0x2377=function(_0x1a6269,_0x5deea5){_0x1a6269=_0x1a6269-0x0;var _0x536f68=_0x3772[_0x1a6269];return _0x536f68;};'use strict';var _=require(_0x2377('0x0'));var moment=require('moment');var util=require(_0x2377('0x1'));var Redis=require('ioredis');var BPromise=require(_0x2377('0x2'));var config=require(_0x2377('0x3'));var logger=require(_0x2377('0x4'))(_0x2377('0x5'));var ami=require(_0x2377('0x6'));config[_0x2377('0x7')]=_[_0x2377('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2377('0x9'))(new Redis(config['redis']));function UserReport(_0x1f2413){this[_0x2377('0xa')]=_0x1f2413[_0x2377('0xa')];this[_0x2377('0xb')]=_0x1f2413[_0x2377('0xb')];this[_0x2377('0xc')]=_0x1f2413[_0x2377('0xc')];ami['on'](_0x2377('0xd'),this[_0x2377('0xe')]['bind'](this));ami['on']('registry',this[_0x2377('0xe')]['bind'](this));ami['on']('devicestatechange',this['syncDeviceState'][_0x2377('0xf')](this));ami['on']('peerstatus',this[_0x2377('0x10')][_0x2377('0xf')](this));return this[_0x2377('0x11')]();}function showSipRegistrations(){Promise[_0x2377('0x12')]()[_0x2377('0x13')](ami[_0x2377('0x14')]())[_0x2377('0x15')](function(_0x4da236){logger[_0x2377('0x16')](_0x2377('0x17'),util[_0x2377('0x18')](_0x4da236,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x2377('0x12')]()[_0x2377('0x13')](ami['actionDeviceStateList']())[_0x2377('0x15')](function(_0x52d3fd){logger['error'](_0x2377('0x19'),util[_0x2377('0x18')](_0x52d3fd,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x2377('0x12')]()[_0x2377('0x13')](ami[_0x2377('0x1a')]())[_0x2377('0x15')](function(_0xec6a17){logger[_0x2377('0x16')](_0x2377('0x1b'),util[_0x2377('0x18')](_0xec6a17,{'showHidden':![],'depth':null}));});}UserReport[_0x2377('0x1c')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x2377('0x12')]()[_0x2377('0x13')](showSipRegistrations())[_0x2377('0x13')](listDeviceStates())[_0x2377('0x13')](showPeersStatus());},0x32c8);};UserReport['prototype']['isNotNull']=function(_0x3400a9){return _0x3400a9!==null&&!_[_0x2377('0x1d')](_0x3400a9);};UserReport[_0x2377('0x1c')][_0x2377('0x1e')]=function(_0x4d6c7d,_0x5a1c0d,_0xb0992a){io['to'](_0x4d6c7d)['emit'](_0x5a1c0d,_0xb0992a);};UserReport[_0x2377('0x1c')][_0x2377('0xe')]=function(_0x3db968){try{if(this[_0x2377('0x1f')](_0x3db968)){logger['info'](_0x2377('0x20'),_0x3db968[_0x2377('0x21')],_0x3db968[_0x2377('0x22')]);logger['debug']('[userReport][registry]',util[_0x2377('0x18')](_0x3db968,{'showHidden':![],'depth':null}));var _0x310073=_[_0x2377('0x23')](this[_0x2377('0xa')],{'defaultuser':_0x3db968[_0x2377('0x21')]});if(_0x310073){_0x3db968[_0x2377('0x24')]=_0x3db968['state'];_[_0x2377('0x25')](_0x310073,_['omit'](_0x3db968,[_0x2377('0x26'),_0x2377('0x27'),_0x2377('0x21'),'state']));logger[_0x2377('0x28')](_0x2377('0x29'),util[_0x2377('0x18')](_0x310073,{'showHidden':![],'depth':null}));this[_0x2377('0x1e')](util[_0x2377('0x2a')](_0x2377('0x2b'),_0x310073['name']),_0x2377('0x2c'),_0x310073);}}}catch(_0x429a96){logger[_0x2377('0x16')]('[userReport][registry]',util[_0x2377('0x18')](_0x429a96,{'showHidden':![],'depth':null}));}};UserReport[_0x2377('0x1c')][_0x2377('0x2d')]=function(_0x2bc761){try{if(this[_0x2377('0x1f')](_0x2bc761)){logger['info'](_0x2377('0x2e'),_0x2bc761[_0x2377('0x2f')],_0x2bc761[_0x2377('0x22')]);logger['debug'](_0x2377('0x30'),util[_0x2377('0x18')](_0x2bc761,{'showHidden':![],'depth':null}));if(this[_0x2377('0xb')][_0x2bc761[_0x2377('0x2f')]]){if(!this[_0x2377('0xb')][_0x2bc761['device']][_0x2377('0x31')]||_0x2bc761[_0x2377('0x22')][_0x2377('0x32')]()==_0x2377('0x33')){this[_0x2377('0xb')][_0x2bc761['device']][_0x2377('0x31')]=![];if(this[_0x2377('0xb')][_0x2bc761[_0x2377('0x2f')]][_0x2377('0x22')]!==_0x2bc761[_0x2377('0x22')][_0x2377('0x32')]()){this['agents'][_0x2bc761[_0x2377('0x2f')]][_0x2377('0x34')]=_[_0x2377('0x35')](moment()[_0x2377('0x2a')]('x'));}this['agents'][_0x2bc761['device']][_0x2377('0x22')]=_0x2bc761[_0x2377('0x22')][_0x2377('0x32')]();this['agents'][_0x2bc761[_0x2377('0x2f')]][_0x2377('0x36')](_0x2bc761);}}else if(this[_0x2377('0xc')][_0x2bc761[_0x2377('0x2f')]]){if(this[_0x2377('0xc')][_0x2bc761[_0x2377('0x2f')]][_0x2377('0x22')]!==_0x2bc761[_0x2377('0x22')][_0x2377('0x32')]()){this[_0x2377('0xc')][_0x2bc761[_0x2377('0x2f')]][_0x2377('0x34')]=_[_0x2377('0x35')](moment()['format']('x'));}this[_0x2377('0xc')][_0x2bc761['device']][_0x2377('0x22')]=_0x2bc761[_0x2377('0x22')]['toLowerCase']();logger[_0x2377('0x28')](_0x2377('0x37'),util[_0x2377('0x18')](this[_0x2377('0xc')][_0x2bc761['device']],{'showHidden':![],'depth':null}));this[_0x2377('0x1e')](util[_0x2377('0x2a')](_0x2377('0x38'),this[_0x2377('0xc')][_0x2bc761[_0x2377('0x2f')]][_0x2377('0x39')]),_0x2377('0x3a'),this[_0x2377('0xc')][_0x2bc761[_0x2377('0x2f')]]);}else if(this['trunks'][_0x2bc761[_0x2377('0x2f')]]){if(this['trunks'][_0x2bc761[_0x2377('0x2f')]]['state']!==_0x2bc761[_0x2377('0x22')][_0x2377('0x32')]()){this[_0x2377('0xa')][_0x2bc761[_0x2377('0x2f')]][_0x2377('0x34')]=_['toNumber'](moment()[_0x2377('0x2a')]('x'));}this['trunks'][_0x2bc761[_0x2377('0x2f')]]['state']=_0x2bc761['state'][_0x2377('0x32')]();logger[_0x2377('0x28')](_0x2377('0x3b'),util[_0x2377('0x18')](this['trunks'][_0x2bc761[_0x2377('0x2f')]],{'showHidden':![],'depth':null}));this[_0x2377('0x1e')](util['format']('trunk:%s',this[_0x2377('0xa')][_0x2bc761[_0x2377('0x2f')]][_0x2377('0x39')]),_0x2377('0x2c'),this[_0x2377('0xa')][_0x2bc761['device']]);}else if(_[_0x2377('0x3c')](_0x2bc761['device'],_0x2377('0x3d'))){var _0xfb57f1=_0x2bc761[_0x2377('0x2f')];var _0x13ffe9=_0xfb57f1[_0x2377('0x3e')](_0xfb57f1[_0x2377('0x3f')]('/')+0x1,_0xfb57f1['indexOf']('@'));var _0x25b7f6=_[_0x2377('0x23')](this[_0x2377('0xb')],function(_0x321468){return _0x321468['mobile']==_0x13ffe9||_0x321468['phone']==_0x13ffe9||_0x321468[_0x2377('0x40')]==_0x13ffe9;});if(_0x25b7f6){if(_0x25b7f6[_0x2377('0x22')]!==_0x2bc761[_0x2377('0x22')][_0x2377('0x32')]()){_0x25b7f6['stateTime']=_[_0x2377('0x35')](moment()[_0x2377('0x2a')]('x'));}_0x25b7f6[_0x2377('0x22')]=_0x2bc761[_0x2377('0x22')][_0x2377('0x32')]();_0x25b7f6[_0x2377('0x31')]=!![];_0x25b7f6['updateStatusRealtime'](_0x2bc761);}}}}catch(_0x2f9c33){logger[_0x2377('0x16')](_0x2377('0x30'),util[_0x2377('0x18')](_0x2f9c33,{'showHidden':![],'depth':null}));}};UserReport[_0x2377('0x1c')][_0x2377('0x10')]=function(_0x3f3c7a){try{if(this[_0x2377('0x1f')](_0x3f3c7a)&&this[_0x2377('0x1f')](_0x3f3c7a[_0x2377('0x41')])){logger[_0x2377('0x42')](_0x2377('0x43'),_0x3f3c7a[_0x2377('0x44')],_0x3f3c7a[_0x2377('0x45')],_0x3f3c7a[_0x2377('0x41')]);logger[_0x2377('0x28')](_0x2377('0x46'),util[_0x2377('0x18')](_0x3f3c7a,{'showHidden':![],'depth':null}));if(this[_0x2377('0xb')][_0x3f3c7a['peer']]){if(!this[_0x2377('0xb')][_0x3f3c7a[_0x2377('0x44')]]['local']||_0x3f3c7a[_0x2377('0x41')]['toLowerCase']()==_0x2377('0x47')){this['agents'][_0x3f3c7a['peer']][_0x2377('0x31')]=![];this[_0x2377('0xb')][_0x3f3c7a[_0x2377('0x44')]][_0x2377('0x48')]=_0x3f3c7a[_0x2377('0x41')]['toLowerCase']();this[_0x2377('0xb')][_0x3f3c7a[_0x2377('0x44')]][_0x2377('0x45')]=_0x3f3c7a[_0x2377('0x45')];this[_0x2377('0xb')][_0x3f3c7a[_0x2377('0x44')]]['updateStatusRealtime'](_0x3f3c7a);}}else if(this['telephones'][_0x3f3c7a[_0x2377('0x44')]]){this[_0x2377('0xc')][_0x3f3c7a[_0x2377('0x44')]][_0x2377('0x48')]=_0x3f3c7a[_0x2377('0x41')][_0x2377('0x32')]();this[_0x2377('0xc')][_0x3f3c7a[_0x2377('0x44')]][_0x2377('0x45')]=_0x3f3c7a[_0x2377('0x45')];logger[_0x2377('0x28')](_0x2377('0x49'),util['inspect'](this[_0x2377('0xc')][_0x3f3c7a[_0x2377('0x44')]],{'showHidden':![],'depth':null}));this[_0x2377('0x1e')](util[_0x2377('0x2a')]('telephone:%s',this[_0x2377('0xc')][_0x3f3c7a[_0x2377('0x44')]][_0x2377('0x39')]),_0x2377('0x3a'),this[_0x2377('0xc')][_0x3f3c7a[_0x2377('0x44')]]);}else if(this[_0x2377('0xa')][_0x3f3c7a['peer']]){this['trunks'][_0x3f3c7a[_0x2377('0x44')]][_0x2377('0x48')]=_0x3f3c7a[_0x2377('0x41')][_0x2377('0x32')]();this[_0x2377('0xa')][_0x3f3c7a[_0x2377('0x44')]][_0x2377('0x45')]=_0x3f3c7a['address'];logger['debug'](_0x2377('0x4a'),util['inspect'](this[_0x2377('0xa')][_0x3f3c7a[_0x2377('0x44')]],{'showHidden':![],'depth':null}));this[_0x2377('0x1e')](util[_0x2377('0x2a')](_0x2377('0x2b'),this[_0x2377('0xa')][_0x3f3c7a['peer']][_0x2377('0x39')]),_0x2377('0x2c'),this[_0x2377('0xa')][_0x3f3c7a['peer']]);}}}catch(_0x17d278){logger[_0x2377('0x16')](_0x2377('0x46'),util[_0x2377('0x18')](_0x17d278,{'showHidden':![],'depth':null}));}};module[_0x2377('0x4b')]=UserReport; \ No newline at end of file +var _0xdd70=['phone','accountcode','updateStatusRealtime','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','lodash','moment','util','ioredis','bluebird','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','syncDeviceState','bind','peerstatus','syncPeerStatus','resolve','then','actionSipShowRegistry','error','[userReport][sipshowregistry]','actionDeviceStateList','catch','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','inspect','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','info','state','debug','[userReport][registry]','username','stateRegistry','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','local','toLowerCase','inuse','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','name','startsWith','Local','indexOf','find'];(function(_0x152449,_0x49f41d){var _0x5b58b2=function(_0x226c30){while(--_0x226c30){_0x152449['push'](_0x152449['shift']());}};_0x5b58b2(++_0x49f41d);}(_0xdd70,0x1e0));var _0x0dd7=function(_0x1e3bb1,_0x4408cc){_0x1e3bb1=_0x1e3bb1-0x0;var _0x443d19=_0xdd70[_0x1e3bb1];return _0x443d19;};'use strict';var _=require(_0x0dd7('0x0'));var moment=require(_0x0dd7('0x1'));var util=require(_0x0dd7('0x2'));var Redis=require(_0x0dd7('0x3'));var BPromise=require(_0x0dd7('0x4'));var config=require(_0x0dd7('0x5'));var logger=require('../../../config/logger')(_0x0dd7('0x6'));var ami=require(_0x0dd7('0x7'));config[_0x0dd7('0x8')]=_[_0x0dd7('0x9')](config[_0x0dd7('0x8')],{'host':_0x0dd7('0xa'),'port':0x18eb});var io=require(_0x0dd7('0xb'))(new Redis(config[_0x0dd7('0x8')]));function UserReport(_0x4c0b32){this[_0x0dd7('0xc')]=_0x4c0b32[_0x0dd7('0xc')];this[_0x0dd7('0xd')]=_0x4c0b32[_0x0dd7('0xd')];this[_0x0dd7('0xe')]=_0x4c0b32['telephones'];ami['on'](_0x0dd7('0xf'),this[_0x0dd7('0x10')]['bind'](this));ami['on'](_0x0dd7('0x11'),this['syncRegistry']['bind'](this));ami['on']('devicestatechange',this[_0x0dd7('0x12')][_0x0dd7('0x13')](this));ami['on'](_0x0dd7('0x14'),this[_0x0dd7('0x15')][_0x0dd7('0x13')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x0dd7('0x16')]()[_0x0dd7('0x17')](ami[_0x0dd7('0x18')]())['catch'](function(_0x30d1f5){logger[_0x0dd7('0x19')](_0x0dd7('0x1a'),util['inspect'](_0x30d1f5,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x0dd7('0x16')]()[_0x0dd7('0x17')](ami[_0x0dd7('0x1b')]())[_0x0dd7('0x1c')](function(_0x51fd25){logger[_0x0dd7('0x19')](_0x0dd7('0x1d'),util['inspect'](_0x51fd25,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x0dd7('0x17')](ami[_0x0dd7('0x1e')]())[_0x0dd7('0x1c')](function(_0x24dd3c){logger[_0x0dd7('0x19')](_0x0dd7('0x1f'),util[_0x0dd7('0x20')](_0x24dd3c,{'showHidden':![],'depth':null}));});}UserReport[_0x0dd7('0x21')][_0x0dd7('0x22')]=function(){setInterval(function(){BPromise['resolve']()[_0x0dd7('0x17')](showSipRegistrations())[_0x0dd7('0x17')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x0dd7('0x21')][_0x0dd7('0x23')]=function(_0x18e9b2){return _0x18e9b2!==null&&!_[_0x0dd7('0x24')](_0x18e9b2);};UserReport[_0x0dd7('0x21')][_0x0dd7('0x25')]=function(_0x303ae1,_0x5eecff,_0x226202){io['to'](_0x303ae1)[_0x0dd7('0x25')](_0x5eecff,_0x226202);};UserReport[_0x0dd7('0x21')]['syncRegistry']=function(_0x484f1c){try{if(this[_0x0dd7('0x23')](_0x484f1c)){logger[_0x0dd7('0x26')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x484f1c['username'],_0x484f1c[_0x0dd7('0x27')]);logger[_0x0dd7('0x28')](_0x0dd7('0x29'),util['inspect'](_0x484f1c,{'showHidden':![],'depth':null}));var _0x2634b6=_['find'](this[_0x0dd7('0xc')],{'defaultuser':_0x484f1c[_0x0dd7('0x2a')]});if(_0x2634b6){_0x484f1c[_0x0dd7('0x2b')]=_0x484f1c[_0x0dd7('0x27')];_['merge'](_0x2634b6,_[_0x0dd7('0x2c')](_0x484f1c,[_0x0dd7('0x2d'),_0x0dd7('0x2e'),_0x0dd7('0x2a'),_0x0dd7('0x27')]));logger[_0x0dd7('0x28')](_0x0dd7('0x2f'),util[_0x0dd7('0x20')](_0x2634b6,{'showHidden':![],'depth':null}));this[_0x0dd7('0x25')](util[_0x0dd7('0x30')](_0x0dd7('0x31'),_0x2634b6['name']),'trunk:save',_0x2634b6);}}}catch(_0x3fa0b0){logger[_0x0dd7('0x19')](_0x0dd7('0x29'),util[_0x0dd7('0x20')](_0x3fa0b0,{'showHidden':![],'depth':null}));}};UserReport[_0x0dd7('0x21')]['syncDeviceState']=function(_0x39f1ba){try{if(this[_0x0dd7('0x23')](_0x39f1ba)){logger[_0x0dd7('0x26')](_0x0dd7('0x32'),_0x39f1ba['device'],_0x39f1ba['state']);logger[_0x0dd7('0x28')](_0x0dd7('0x33'),util['inspect'](_0x39f1ba,{'showHidden':![],'depth':null}));if(this[_0x0dd7('0xd')][_0x39f1ba[_0x0dd7('0x34')]]){if(!this[_0x0dd7('0xd')][_0x39f1ba[_0x0dd7('0x34')]][_0x0dd7('0x35')]||_0x39f1ba[_0x0dd7('0x27')][_0x0dd7('0x36')]()==_0x0dd7('0x37')){this[_0x0dd7('0xd')][_0x39f1ba[_0x0dd7('0x34')]][_0x0dd7('0x35')]=![];if(this[_0x0dd7('0xd')][_0x39f1ba[_0x0dd7('0x34')]][_0x0dd7('0x27')]!==_0x39f1ba[_0x0dd7('0x27')][_0x0dd7('0x36')]()){this['agents'][_0x39f1ba[_0x0dd7('0x34')]][_0x0dd7('0x38')]=_[_0x0dd7('0x39')](moment()['format']('x'));}this[_0x0dd7('0xd')][_0x39f1ba[_0x0dd7('0x34')]][_0x0dd7('0x27')]=_0x39f1ba[_0x0dd7('0x27')]['toLowerCase']();this[_0x0dd7('0xd')][_0x39f1ba[_0x0dd7('0x34')]]['updateStatusRealtime'](_0x39f1ba);}}else if(this['telephones'][_0x39f1ba[_0x0dd7('0x34')]]){if(this['telephones'][_0x39f1ba[_0x0dd7('0x34')]]['state']!==_0x39f1ba[_0x0dd7('0x27')][_0x0dd7('0x36')]()){this['telephones'][_0x39f1ba[_0x0dd7('0x34')]][_0x0dd7('0x38')]=_[_0x0dd7('0x39')](moment()['format']('x'));}this[_0x0dd7('0xe')][_0x39f1ba[_0x0dd7('0x34')]][_0x0dd7('0x27')]=_0x39f1ba['state'][_0x0dd7('0x36')]();logger[_0x0dd7('0x28')](_0x0dd7('0x3a'),util[_0x0dd7('0x20')](this[_0x0dd7('0xe')][_0x39f1ba[_0x0dd7('0x34')]],{'showHidden':![],'depth':null}));this[_0x0dd7('0x25')](util[_0x0dd7('0x30')]('telephone:%s',this[_0x0dd7('0xe')][_0x39f1ba[_0x0dd7('0x34')]]['name']),_0x0dd7('0x3b'),this['telephones'][_0x39f1ba['device']]);}else if(this[_0x0dd7('0xc')][_0x39f1ba[_0x0dd7('0x34')]]){if(this[_0x0dd7('0xc')][_0x39f1ba[_0x0dd7('0x34')]][_0x0dd7('0x27')]!==_0x39f1ba[_0x0dd7('0x27')][_0x0dd7('0x36')]()){this['trunks'][_0x39f1ba['device']]['stateTime']=_[_0x0dd7('0x39')](moment()[_0x0dd7('0x30')]('x'));}this[_0x0dd7('0xc')][_0x39f1ba[_0x0dd7('0x34')]][_0x0dd7('0x27')]=_0x39f1ba[_0x0dd7('0x27')][_0x0dd7('0x36')]();logger[_0x0dd7('0x28')](_0x0dd7('0x3c'),util['inspect'](this[_0x0dd7('0xc')][_0x39f1ba[_0x0dd7('0x34')]],{'showHidden':![],'depth':null}));this[_0x0dd7('0x25')](util[_0x0dd7('0x30')](_0x0dd7('0x31'),this[_0x0dd7('0xc')][_0x39f1ba[_0x0dd7('0x34')]][_0x0dd7('0x3d')]),'trunk:save',this[_0x0dd7('0xc')][_0x39f1ba[_0x0dd7('0x34')]]);}else if(_[_0x0dd7('0x3e')](_0x39f1ba[_0x0dd7('0x34')],_0x0dd7('0x3f'))){var _0x34ac25=_0x39f1ba[_0x0dd7('0x34')];var _0x435fe9=_0x34ac25['substring'](_0x34ac25[_0x0dd7('0x40')]('/')+0x1,_0x34ac25['indexOf']('@'));var _0x14ebcc=_[_0x0dd7('0x41')](this['agents'],function(_0x50a355){return _0x50a355['mobile']==_0x435fe9||_0x50a355[_0x0dd7('0x42')]==_0x435fe9||_0x50a355[_0x0dd7('0x43')]==_0x435fe9;});if(_0x14ebcc){if(_0x14ebcc['state']!==_0x39f1ba['state']['toLowerCase']()){_0x14ebcc[_0x0dd7('0x38')]=_[_0x0dd7('0x39')](moment()['format']('x'));}_0x14ebcc[_0x0dd7('0x27')]=_0x39f1ba[_0x0dd7('0x27')][_0x0dd7('0x36')]();_0x14ebcc[_0x0dd7('0x35')]=!![];_0x14ebcc[_0x0dd7('0x44')](_0x39f1ba);}}}}catch(_0xf5a49c){logger['error'](_0x0dd7('0x33'),util['inspect'](_0xf5a49c,{'showHidden':![],'depth':null}));}};UserReport[_0x0dd7('0x21')][_0x0dd7('0x15')]=function(_0x4c141e){try{if(this['isNotNull'](_0x4c141e)&&this['isNotNull'](_0x4c141e[_0x0dd7('0x14')])){logger['info'](_0x0dd7('0x45'),_0x4c141e['peer'],_0x4c141e[_0x0dd7('0x46')],_0x4c141e[_0x0dd7('0x14')]);logger[_0x0dd7('0x28')](_0x0dd7('0x47'),util[_0x0dd7('0x20')](_0x4c141e,{'showHidden':![],'depth':null}));if(this[_0x0dd7('0xd')][_0x4c141e[_0x0dd7('0x48')]]){if(!this['agents'][_0x4c141e['peer']][_0x0dd7('0x35')]||_0x4c141e[_0x0dd7('0x14')][_0x0dd7('0x36')]()==_0x0dd7('0x49')){this['agents'][_0x4c141e[_0x0dd7('0x48')]][_0x0dd7('0x35')]=![];this['agents'][_0x4c141e[_0x0dd7('0x48')]]['status']=_0x4c141e[_0x0dd7('0x14')][_0x0dd7('0x36')]();this[_0x0dd7('0xd')][_0x4c141e['peer']]['address']=_0x4c141e[_0x0dd7('0x46')];this[_0x0dd7('0xd')][_0x4c141e[_0x0dd7('0x48')]]['updateStatusRealtime'](_0x4c141e);}}else if(this[_0x0dd7('0xe')][_0x4c141e[_0x0dd7('0x48')]]){this['telephones'][_0x4c141e[_0x0dd7('0x48')]][_0x0dd7('0x4a')]=_0x4c141e[_0x0dd7('0x14')][_0x0dd7('0x36')]();this[_0x0dd7('0xe')][_0x4c141e[_0x0dd7('0x48')]][_0x0dd7('0x46')]=_0x4c141e[_0x0dd7('0x46')];logger[_0x0dd7('0x28')](_0x0dd7('0x4b'),util['inspect'](this[_0x0dd7('0xe')][_0x4c141e[_0x0dd7('0x48')]],{'showHidden':![],'depth':null}));this[_0x0dd7('0x25')](util[_0x0dd7('0x30')](_0x0dd7('0x4c'),this[_0x0dd7('0xe')][_0x4c141e['peer']][_0x0dd7('0x3d')]),_0x0dd7('0x3b'),this[_0x0dd7('0xe')][_0x4c141e[_0x0dd7('0x48')]]);}else if(this['trunks'][_0x4c141e['peer']]){this[_0x0dd7('0xc')][_0x4c141e[_0x0dd7('0x48')]][_0x0dd7('0x4a')]=_0x4c141e['peerstatus'][_0x0dd7('0x36')]();this['trunks'][_0x4c141e[_0x0dd7('0x48')]][_0x0dd7('0x46')]=_0x4c141e['address'];logger[_0x0dd7('0x28')](_0x0dd7('0x4d'),util[_0x0dd7('0x20')](this[_0x0dd7('0xc')][_0x4c141e[_0x0dd7('0x48')]],{'showHidden':![],'depth':null}));this[_0x0dd7('0x25')](util[_0x0dd7('0x30')](_0x0dd7('0x31'),this[_0x0dd7('0xc')][_0x4c141e['peer']]['name']),'trunk:save',this[_0x0dd7('0xc')][_0x4c141e[_0x0dd7('0x48')]]);}}}catch(_0x5a0242){logger['error'](_0x0dd7('0x47'),util[_0x0dd7('0x20')](_0x5a0242,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index ae03bb9..c26786a 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0057=['rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%s][voiceAgentReport][hangup]','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/logger','../ami','defaults','socket.io-emitter','redis','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','syncVarSet','hangup','syncHangup','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','emit','prototype','isNotNull','isUndefined','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','interface','queue','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound','voice','assign','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','membername','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','holdtime','lastevent','connect','routealias','merge','pick','destconnectedlinenum','accountcode','exten','custom:agentconnect','agentcomplete','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswer','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','name','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acwtime','agentacw','omit','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','destaccountcode','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variable','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt'];(function(_0x51a901,_0x5b7078){var _0x4d7eef=function(_0x4ac8d1){while(--_0x4ac8d1){_0x51a901['push'](_0x51a901['shift']());}};_0x4d7eef(++_0x5b7078);}(_0x0057,0xbb));var _0x7005=function(_0x9669ee,_0x36835b){_0x9669ee=_0x9669ee-0x0;var _0x2d4066=_0x0057[_0x9669ee];return _0x2d4066;};'use strict';var _=require(_0x7005('0x0'));var moment=require(_0x7005('0x1'));var util=require(_0x7005('0x2'));var Redis=require(_0x7005('0x3'));var config=require('../../../config/environment');var logger=require(_0x7005('0x4'))('ami');var ami=require(_0x7005('0x5'));config['redis']=_[_0x7005('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7005('0x7'))(new Redis(config[_0x7005('0x8')]));function VoiceAgentReport(_0x172b26){this[_0x7005('0x9')]={};this[_0x7005('0xa')]=_0x172b26['channels'];this[_0x7005('0xb')]=_0x172b26[_0x7005('0xb')];this[_0x7005('0xc')]=_0x172b26[_0x7005('0xc')];this[_0x7005('0xd')]={};ami['on'](_0x7005('0xe'),this[_0x7005('0xf')][_0x7005('0x10')](this));ami['on']('agentconnect',this['syncAgentConnect'][_0x7005('0x10')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x7005('0x10')](this));ami['on'](_0x7005('0x11'),this[_0x7005('0x12')]['bind'](this));ami['on']('agentcomplete',this[_0x7005('0x13')]['bind'](this));ami['on']('varset',this[_0x7005('0x14')]['bind'](this));ami['on'](_0x7005('0x15'),this[_0x7005('0x16')][_0x7005('0x10')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0x7005('0x17'),this[_0x7005('0x18')][_0x7005('0x10')](this));ami['on'](_0x7005('0x19'),this[_0x7005('0x1a')][_0x7005('0x10')](this));ami['on'](_0x7005('0x1b'),this['syncBlindTransfer'][_0x7005('0x10')](this));}VoiceAgentReport['prototype'][_0x7005('0x1c')]=function(_0x291097,_0x50ffff,_0x29e2f7){io['to'](_0x291097)['emit'](_0x50ffff,_0x29e2f7);};VoiceAgentReport[_0x7005('0x1d')][_0x7005('0x1e')]=function(_0x1c82c4){return _0x1c82c4!==null&&!_[_0x7005('0x1f')](_0x1c82c4);};VoiceAgentReport['prototype'][_0x7005('0xf')]=function(_0x35143d){try{if(this[_0x7005('0x1e')](_0x35143d)){logger['info'](_0x7005('0x20'),_0x35143d[_0x7005('0x21')],_0x35143d['membername'],_0x35143d[_0x7005('0x22')]);logger[_0x7005('0x23')](_0x7005('0x24'),_0x35143d[_0x7005('0x21')],util[_0x7005('0x25')](_0x35143d,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x7005('0x9')][_0x35143d['uniqueid']])){this[_0x7005('0x9')][_0x35143d[_0x7005('0x21')]]={};}var _0xfa501=this[_0x7005('0xc')][_0x35143d[_0x7005('0x26')]];var _0x158087=this[_0x7005('0x9')][_0x35143d[_0x7005('0x21')]][_0x35143d[_0x7005('0x22')]];var _0xbb86f8=this['voiceQueues'][_0x35143d[_0x7005('0x27')]];var _0xb3c89d=this['variables'][_0x35143d[_0x7005('0x21')]];if(_[_0x7005('0x1f')](_0x158087)){_0x158087={'agentcalledAt':moment()['format'](_0x7005('0x28')),'lastevent':_0x7005('0x29'),'mandatoryDisposition':_0xbb86f8&&_0xbb86f8['mandatoryDisposition']?_0xbb86f8[_0x7005('0x2a')]:![],'type':_0xbb86f8&&_0xbb86f8[_0x7005('0x2b')]?_0xbb86f8[_0x7005('0x2b')]:_0x7005('0x2c'),'variables':_0xb3c89d,'motionChannel':_0x7005('0x2d')};}Object[_0x7005('0x2e')](_0x158087,_['omit'](_0x35143d,['event','privilege']));this[_0x7005('0x9')][_0x35143d[_0x7005('0x21')]][_0x35143d[_0x7005('0x22')]]=_0x158087;logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x35143d['uniqueid'],util[_0x7005('0x25')](_0x158087,{'showHidden':![],'depth':null}));ami[_0x7005('0x1c')](_0x7005('0x2f'),_0x158087);var _0x1895fb={'id':_0xfa501['id'],'calleridnum':_0x158087[_0x7005('0x30')],'queue':_0x158087[_0x7005('0x27')],'variables':_0x158087[_0x7005('0xd')],'uniqueid':_0x35143d[_0x7005('0x21')]};logger[_0x7005('0x23')](_0x7005('0x31'),_0x35143d[_0x7005('0x21')],util[_0x7005('0x25')](_0x1895fb,{'showHidden':![],'depth':null}));this[_0x7005('0x1c')](util[_0x7005('0x32')]('user:%s',_0x35143d['membername']),_0x7005('0x33'),_0x1895fb);}}catch(_0x127382){logger[_0x7005('0x34')](_0x7005('0x35'),_0x35143d[_0x7005('0x21')],util[_0x7005('0x25')](_0x127382,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7005('0x1d')][_0x7005('0x36')]=function(_0x2fe53f){try{if(this[_0x7005('0x1e')](_0x2fe53f)){if(this[_0x7005('0x9')][_0x2fe53f['uniqueid']]){for(var _0xa3face in this['channels'][_0x2fe53f['uniqueid']]){if(this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0x7005('0x37')](_0xa3face)){if(_0x2fe53f[_0x7005('0x22')]===_0xa3face){logger['info'](_0x7005('0x38'),_0x2fe53f['uniqueid'],_0x2fe53f[_0x7005('0x39')],_0x2fe53f[_0x7005('0x22')]);this['channels'][_0x2fe53f[_0x7005('0x21')]][_0xa3face][_0x7005('0x3a')]=moment()[_0x7005('0x32')](_0x7005('0x28'));this['channels'][_0x2fe53f[_0x7005('0x21')]][_0xa3face][_0x7005('0x3b')]=_0x2fe53f[_0x7005('0x3b')];this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0xa3face]['connectedlinenum']=_0x2fe53f[_0x7005('0x3c')];this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0xa3face]['destchannelstate']=_0x2fe53f[_0x7005('0x3d')];this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0xa3face]['destchannelstatedesc']=_0x2fe53f['destchannelstatedesc'];this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0xa3face][_0x7005('0x3e')]=_0x2fe53f[_0x7005('0x3e')];this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0xa3face][_0x7005('0x3f')]=_0x7005('0x40');if(this[_0x7005('0xa')][this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0xa3face]['uniqueid']]){var _0x152cb3=this['voiceChannels'][this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0xa3face][_0x7005('0x21')]]['routealias'];this['channels'][_0x2fe53f[_0x7005('0x21')]][_0xa3face][_0x7005('0x41')]=_0x152cb3;_0x2fe53f[_0x7005('0x41')]=_0x152cb3;}_[_0x7005('0x42')](this[_0x7005('0xc')][_0x2fe53f['interface']],_[_0x7005('0x43')](_0x2fe53f,[_0x7005('0x27'),_0x7005('0x44'),_0x7005('0x41')]));var _0x54848e=this[_0x7005('0xc')][_0x2fe53f[_0x7005('0x26')]];var _0x477393={'id':_0x54848e['id'],'name':_0x54848e['name'],'agentconnected':!![],'destaccountcode':_0x54848e[_0x7005('0x45')],'destconnectedlinenum':this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0x2fe53f['destuniqueid']][_0x7005('0x46')],'queue':this[_0x7005('0x9')][_0x2fe53f['uniqueid']][_0x2fe53f[_0x7005('0x22')]][_0x7005('0x27')],'routealias':this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0x2fe53f['destuniqueid']][_0x7005('0x41')],'uniqueid':this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0x2fe53f[_0x7005('0x22')]][_0x7005('0x21')]};ami[_0x7005('0x1c')](_0x7005('0x47'),this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0x2fe53f['destuniqueid']]);this[_0x7005('0x1c')](util[_0x7005('0x32')]('user:%s',_0x2fe53f[_0x7005('0x39')]),'user:agentconnect',_0x477393);}else if(!this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0xa3face]['agentringnoanswer']&&!this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0xa3face][_0x7005('0x48')]){logger[_0x7005('0x49')](_0x7005('0x4a'),_0x2fe53f[_0x7005('0x21')],this[_0x7005('0x9')][_0x2fe53f['uniqueid']][_0xa3face][_0x7005('0x39')],_0xa3face);this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0xa3face][_0x7005('0x4b')]=!![];this['channels'][_0x2fe53f['uniqueid']][_0xa3face][_0x7005('0x4c')]=moment()['format'](_0x7005('0x28'));this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0xa3face][_0x7005('0x4d')]=_0x2fe53f[_0x7005('0x22')];this[_0x7005('0x9')][_0x2fe53f['uniqueid']][_0xa3face][_0x7005('0x4e')]=_0x2fe53f['membername'];this[_0x7005('0x9')][_0x2fe53f[_0x7005('0x21')]][_0xa3face][_0x7005('0x3f')]=_0x7005('0x4f');this['channels'][_0x2fe53f['uniqueid']][_0xa3face][_0x7005('0x50')]=_0x7005('0x4f');logger[_0x7005('0x23')](_0x7005('0x51'),_0x2fe53f[_0x7005('0x21')],util[_0x7005('0x25')](this[_0x7005('0x9')][_0x2fe53f['uniqueid']][_0xa3face],{'showHidden':![],'depth':null}));ami['emit'](_0x7005('0x52'),this['channels'][_0x2fe53f['uniqueid']][_0xa3face]);}else{logger[_0x7005('0x23')](_0x7005('0x53'),_0x2fe53f['uniqueid']);}}}}}}catch(_0x569eb9){logger[_0x7005('0x34')](_0x7005('0x54'),_0x2fe53f[_0x7005('0x21')],util[_0x7005('0x25')](_0x569eb9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7005('0x1d')][_0x7005('0x55')]=function(_0x3a376c){try{if(this[_0x7005('0x1e')](_0x3a376c)){logger['debug'](_0x7005('0x56'),_0x3a376c[_0x7005('0x21')],util['inspect'](_0x3a376c,{'showHidden':![],'depth':null}));if(this[_0x7005('0x9')][_0x3a376c[_0x7005('0x21')]]&&this[_0x7005('0x9')][_0x3a376c['uniqueid']][_0x3a376c['destuniqueid']]){logger[_0x7005('0x49')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x3a376c[_0x7005('0x21')],_0x3a376c[_0x7005('0x39')],_0x3a376c['destuniqueid']);var _0x45b731=this[_0x7005('0xc')][_0x3a376c[_0x7005('0x26')]];var _0x9eb30d=this['channels'][_0x3a376c[_0x7005('0x21')]][_0x3a376c[_0x7005('0x22')]];_0x9eb30d[_0x7005('0x4b')]=!![];_0x9eb30d[_0x7005('0x4c')]=moment()['format'](_0x7005('0x28'));_0x9eb30d[_0x7005('0x3f')]='rejected';_0x9eb30d[_0x7005('0x50')]=_0x7005('0x57');var _0x5657f3={'id':_0x45b731['id'],'name':_0x45b731[_0x7005('0x58')],'queue':_0x9eb30d[_0x7005('0x27')],'uniqueid':_0x9eb30d[_0x7005('0x21')]};logger[_0x7005('0x23')](_0x7005('0x59'),_0x3a376c[_0x7005('0x21')],util[_0x7005('0x25')](_0x5657f3,{'showHidden':![],'depth':null}));this[_0x7005('0x1c')](util[_0x7005('0x32')]('user:%s',_0x45b731[_0x7005('0x58')]),_0x7005('0x5a'),_0x5657f3);ami['emit'](_0x7005('0x5b'),_0x9eb30d);this[_0x7005('0x9')][_0x3a376c['uniqueid']][_0x3a376c[_0x7005('0x22')]]=Object[_0x7005('0x2e')]({},_0x9eb30d);}}}catch(_0x1e2424){logger[_0x7005('0x34')](_0x7005('0x5c'),_0x3a376c['uniqueid'],util[_0x7005('0x25')](_0x1e2424,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7005('0x1d')]['syncQueueCallerAbandon']=function(_0x8f824e){try{if(this[_0x7005('0x1e')](_0x8f824e)){logger[_0x7005('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x8f824e['uniqueid'],util['inspect'](_0x8f824e,{'showHidden':![],'depth':null}));if(this[_0x7005('0x9')][_0x8f824e[_0x7005('0x21')]]){for(var _0x51fc6b in this[_0x7005('0x9')][_0x8f824e[_0x7005('0x21')]]){if(this[_0x7005('0x9')][_0x8f824e[_0x7005('0x21')]][_0x7005('0x37')](_0x51fc6b)&&!this[_0x7005('0x9')][_0x8f824e[_0x7005('0x21')]][_0x51fc6b][_0x7005('0x4b')]&&!this['channels'][_0x8f824e['uniqueid']][_0x51fc6b][_0x7005('0x48')]){logger[_0x7005('0x49')](_0x7005('0x5d'),_0x8f824e[_0x7005('0x21')],this['channels'][_0x8f824e[_0x7005('0x21')]][_0x51fc6b][_0x7005('0x39')],_0x51fc6b);this[_0x7005('0x9')][_0x8f824e[_0x7005('0x21')]][_0x51fc6b][_0x7005('0x4b')]=!![];this['channels'][_0x8f824e['uniqueid']][_0x51fc6b]['agentringnoanswerAt']=moment()[_0x7005('0x32')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x8f824e[_0x7005('0x21')]][_0x51fc6b]['lastevent']=_0x7005('0x5e');this['channels'][_0x8f824e[_0x7005('0x21')]][_0x51fc6b][_0x7005('0x50')]=_0x7005('0x5e');logger[_0x7005('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x8f824e['uniqueid'],util[_0x7005('0x25')](this[_0x7005('0x9')][_0x8f824e[_0x7005('0x21')]][_0x51fc6b],{'showHidden':![],'depth':null}));ami[_0x7005('0x1c')](_0x7005('0x5f'),this[_0x7005('0x9')][_0x8f824e[_0x7005('0x21')]][_0x51fc6b]);}}}}}catch(_0x186dd3){logger[_0x7005('0x34')](_0x7005('0x60'),_0x8f824e['uniqueid'],util[_0x7005('0x25')](_0x186dd3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7005('0x1d')][_0x7005('0x13')]=function(_0x4c4979){try{if(this[_0x7005('0x1e')](_0x4c4979)){logger[_0x7005('0x23')](_0x7005('0x61'),_0x4c4979[_0x7005('0x21')],util[_0x7005('0x25')](_0x4c4979,{'showHidden':![],'depth':null}));if(this[_0x7005('0x9')][_0x4c4979[_0x7005('0x21')]]){for(var _0x12c1d5 in this['channels'][_0x4c4979[_0x7005('0x21')]]){if(this[_0x7005('0x9')][_0x4c4979[_0x7005('0x21')]][_0x7005('0x37')](_0x12c1d5)){if(this['channels'][_0x4c4979['uniqueid']][_0x12c1d5][_0x7005('0x3a')]&&!this[_0x7005('0x9')][_0x4c4979[_0x7005('0x21')]][_0x12c1d5]['agentcomplete']){logger['info'](_0x7005('0x62'),_0x4c4979[_0x7005('0x21')],this['channels'][_0x4c4979[_0x7005('0x21')]][_0x12c1d5][_0x7005('0x39')],_0x12c1d5);this['channels'][_0x4c4979[_0x7005('0x21')]][_0x12c1d5]['agentcomplete']=!![];this['channels'][_0x4c4979['uniqueid']][_0x12c1d5][_0x7005('0x63')]=moment()['format'](_0x7005('0x28'));this['channels'][_0x4c4979[_0x7005('0x21')]][_0x12c1d5][_0x7005('0x3f')]=_0x7005('0x64');this[_0x7005('0x9')][_0x4c4979[_0x7005('0x21')]][_0x12c1d5][_0x7005('0x50')]=_0x4c4979[_0x7005('0x50')]==_0x7005('0x65')?_0x7005('0x66'):_0x4c4979[_0x7005('0x50')];this[_0x7005('0x9')][_0x4c4979[_0x7005('0x21')]][_0x12c1d5][_0x7005('0x67')]=_0x4c4979['talktime'];if(this[_0x7005('0xb')][_0x4c4979[_0x7005('0x27')]]&&this['voiceQueues'][_0x4c4979[_0x7005('0x27')]]['acw']){this[_0x7005('0x9')][_0x4c4979['uniqueid']][_0x12c1d5][_0x7005('0x68')]=this[_0x7005('0xb')][_0x4c4979[_0x7005('0x27')]]['acwTimeout'];this[_0x7005('0x9')][_0x4c4979[_0x7005('0x21')]][_0x12c1d5][_0x7005('0x69')]=!![];}this['agents'][_0x4c4979[_0x7005('0x26')]]=_[_0x7005('0x6a')](this['agents'][_0x4c4979[_0x7005('0x26')]],[_0x7005('0x27'),_0x7005('0x44')]);logger['debug']('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x4c4979['uniqueid'],util[_0x7005('0x25')](this[_0x7005('0x9')][_0x4c4979[_0x7005('0x21')]][_0x12c1d5],{'showHidden':![],'depth':null}));ami[_0x7005('0x1c')](_0x7005('0x6b'),this[_0x7005('0x9')][_0x4c4979[_0x7005('0x21')]][_0x12c1d5]);logger['debug'](_0x7005('0x6c'),_0x4c4979[_0x7005('0x21')],util[_0x7005('0x25')]({'id':this[_0x7005('0xc')][_0x4c4979[_0x7005('0x26')]]['id'],'destaccountcode':_0x4c4979['destaccountcode']},{'showHidden':![],'depth':null}));this[_0x7005('0x1c')](util[_0x7005('0x32')]('user:%s',_0x4c4979[_0x7005('0x39')]),_0x7005('0x6d'),{'id':this[_0x7005('0xc')][_0x4c4979[_0x7005('0x26')]]['id'],'destaccountcode':Number(_0x4c4979[_0x7005('0x6e')])});}}}}}}catch(_0x17b0c9){logger[_0x7005('0x34')](_0x7005('0x6f'),_0x4c4979[_0x7005('0x21')],util[_0x7005('0x25')](_0x17b0c9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7005('0x1d')][_0x7005('0x14')]=function(_0x2283d3){try{if(this[_0x7005('0x1e')](_0x2283d3)){logger['debug'](_0x7005('0x70'),_0x2283d3['uniqueid'],util[_0x7005('0x25')](_0x2283d3,{'showHidden':![],'depth':null}));this[_0x7005('0x71')](_0x2283d3['uniqueid'],_[_0x7005('0x72')](_0x2283d3['variable'])[0x0],_0x2283d3['value']);if(this[_0x7005('0x9')][_0x2283d3[_0x7005('0x21')]]){for(var _0x2531df in this['channels'][_0x2283d3[_0x7005('0x21')]]){if(this[_0x7005('0x9')][_0x2283d3[_0x7005('0x21')]][_0x7005('0x37')](_0x2531df)){logger[_0x7005('0x49')](_0x7005('0x73'),_0x2283d3[_0x7005('0x21')],_0x2531df,_[_0x7005('0x72')](_0x2283d3[_0x7005('0x74')])[0x0],_0x2283d3['value']);if(_[_0x7005('0x1f')](this[_0x7005('0x9')][_0x2283d3['uniqueid']][_0x2531df][_0x7005('0xd')])){this[_0x7005('0x9')][_0x2283d3[_0x7005('0x21')]][_0x2531df][_0x7005('0xd')]={};}this[_0x7005('0x9')][_0x2283d3[_0x7005('0x21')]][_0x2531df][_0x7005('0xd')]=this[_0x7005('0xd')][_0x2283d3['uniqueid']];}}}}}catch(_0xeeadc0){logger['error'](_0x7005('0x75'),_0x2283d3[_0x7005('0x21')],util['inspect'](_0xeeadc0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7005('0x1d')][_0x7005('0x71')]=function(_0x45946f,_0x30a61f,_0x2ae685){var _0x2ba0e3=[_0x7005('0x76'),_0x7005('0x77'),_0x7005('0x78'),'rtpaudioqosjitterbridged',_0x7005('0x79'),'rtpaudioqoslossbridged',_0x7005('0x7a'),_0x7005('0x7b'),_0x7005('0x7c'),_0x7005('0x7d'),'bridgepeer',_0x7005('0x7e'),_0x7005('0x7f'),_0x7005('0x80'),_0x7005('0x81'),'memberlastcall','membername',_0x7005('0x82'),_0x7005('0x83')];if(!_['isNil'](_0x30a61f)&&!_[_0x7005('0x84')](_0x2ba0e3,_0x30a61f)){if(_['isUndefined'](this['variables'][_0x45946f])){this[_0x7005('0xd')][_0x45946f]={};}this[_0x7005('0xd')][_0x45946f][_0x30a61f]=_0x2ae685;}};VoiceAgentReport[_0x7005('0x1d')][_0x7005('0x16')]=function(_0x115ad8){try{if(this[_0x7005('0x1e')](_0x115ad8)){logger[_0x7005('0x23')](_0x7005('0x85'),_0x115ad8[_0x7005('0x21')],util[_0x7005('0x25')](_0x115ad8,{'showHidden':![],'depth':null}));if(this[_0x7005('0x9')][_0x115ad8[_0x7005('0x21')]]){for(var _0x385beb in this[_0x7005('0x9')][_0x115ad8[_0x7005('0x21')]]){if(this[_0x7005('0x9')][_0x115ad8[_0x7005('0x21')]]['hasOwnProperty'](_0x385beb)){if(this[_0x7005('0x9')][_0x115ad8['uniqueid']][_0x385beb][_0x7005('0x50')]==_0x7005('0x65')&&this[_0x7005('0x9')][_0x115ad8[_0x7005('0x21')]][_0x385beb][_0x7005('0x48')]){logger['info'](_0x7005('0x86'),_0x115ad8[_0x7005('0x21')],_0x385beb);this[_0x7005('0x9')][_0x115ad8[_0x7005('0x21')]][_0x385beb][_0x7005('0x63')]=moment()[_0x7005('0x32')](_0x7005('0x28'));}}}logger[_0x7005('0x23')](_0x7005('0x87'),_0x115ad8[_0x7005('0x21')],util[_0x7005('0x25')](_[_0x7005('0x88')](this[_0x7005('0x9')][_0x115ad8['uniqueid']]),{'showHidden':![],'depth':null}));ami['emit']('custom:voiceAgentReport',_[_0x7005('0x88')](this[_0x7005('0x9')][_0x115ad8['uniqueid']]));delete this[_0x7005('0x9')][_0x115ad8['uniqueid']];}if(this['variables'][_0x115ad8[_0x7005('0x21')]]){delete this[_0x7005('0xd')][_0x115ad8[_0x7005('0x21')]];}}}catch(_0x4528a3){logger[_0x7005('0x34')](_0x7005('0x89'),_0x115ad8[_0x7005('0x21')],util[_0x7005('0x25')](_0x4528a3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7005('0x1d')][_0x7005('0x1a')]=function(_0x32dfee){try{if(this['isNotNull'](_0x32dfee)){logger['debug']('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x32dfee[_0x7005('0x21')],util['inspect'](_0x32dfee,{'showHidden':![],'depth':null}));if(this[_0x7005('0x9')][_0x32dfee[_0x7005('0x8a')]]){for(var _0x4def0b in this[_0x7005('0x9')][_0x32dfee[_0x7005('0x8a')]]){if(this[_0x7005('0x9')][_0x32dfee[_0x7005('0x8a')]][_0x7005('0x37')](_0x4def0b)){if(_0x32dfee[_0x7005('0x8b')]===_0x4def0b){logger[_0x7005('0x49')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x32dfee[_0x7005('0x21')],this[_0x7005('0x9')][_0x32dfee[_0x7005('0x8a')]][_0x4def0b][_0x7005('0x39')],_0x4def0b);var _0x41baa8=moment();this[_0x7005('0x9')][_0x32dfee[_0x7005('0x8a')]][_0x4def0b]['agentcomplete']=!![];this[_0x7005('0x9')][_0x32dfee['transfereeuniqueid']][_0x4def0b][_0x7005('0x63')]=moment()[_0x7005('0x32')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7005('0x9')][_0x32dfee[_0x7005('0x8a')]][_0x4def0b]['lastevent']=_0x7005('0x64');this[_0x7005('0x9')][_0x32dfee[_0x7005('0x8a')]][_0x4def0b][_0x7005('0x50')]=_0x7005('0x65');this[_0x7005('0x9')][_0x32dfee[_0x7005('0x8a')]][_0x4def0b]['talktime']=_0x41baa8[_0x7005('0x8c')](this['channels'][_0x32dfee[_0x7005('0x8a')]][_0x4def0b]['agentconnectAt'],_0x7005('0x8d'));}}}}if(this[_0x7005('0x9')][_0x32dfee[_0x7005('0x8e')]]){var _0x33876e=this[_0x7005('0x9')][_0x32dfee['secondtransfereruniqueid']];this[_0x7005('0x9')][_0x32dfee[_0x7005('0x8e')]]=this[_0x7005('0x9')][_0x32dfee[_0x7005('0x8a')]];this['channels'][_0x32dfee['transfereeuniqueid']]=_0x33876e;}}}catch(_0x5dce87){logger[_0x7005('0x34')]('[%s][voiceAgentReport][attendedtransfer]',_0x32dfee[_0x7005('0x21')],util[_0x7005('0x25')](_0x5dce87,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7005('0x1d')]['syncBlindTransfer']=function(_0x4adc31){try{if(this['isNotNull'](_0x4adc31)){logger[_0x7005('0x23')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x4adc31['uniqueid'],util[_0x7005('0x25')](_0x4adc31,{'showHidden':![],'depth':null}));if(this['channels'][_0x4adc31[_0x7005('0x8a')]]){for(var _0x8254e in this[_0x7005('0x9')][_0x4adc31[_0x7005('0x8a')]]){if(this[_0x7005('0x9')][_0x4adc31[_0x7005('0x8a')]][_0x7005('0x37')](_0x8254e)){if(_0x4adc31['transfereruniqueid']===_0x8254e){logger[_0x7005('0x49')](_0x7005('0x8f'),_0x4adc31[_0x7005('0x21')],this[_0x7005('0x9')][_0x4adc31[_0x7005('0x8a')]][_0x8254e][_0x7005('0x39')],_0x8254e);var _0x3e11b2=moment();this['channels'][_0x4adc31['transfereeuniqueid']][_0x8254e]['agentcomplete']=!![];this['channels'][_0x4adc31[_0x7005('0x8a')]][_0x8254e][_0x7005('0x63')]=_0x3e11b2;this[_0x7005('0x9')][_0x4adc31[_0x7005('0x8a')]][_0x8254e][_0x7005('0x3f')]='complete';this['channels'][_0x4adc31[_0x7005('0x8a')]][_0x8254e][_0x7005('0x50')]='transfer';this[_0x7005('0x9')][_0x4adc31[_0x7005('0x8a')]][_0x8254e]['talktime']=_0x3e11b2[_0x7005('0x8c')](this[_0x7005('0x9')][_0x4adc31[_0x7005('0x8a')]][_0x8254e]['agentconnectAt'],_0x7005('0x8d'));}}}}}}catch(_0x4690b6){logger[_0x7005('0x34')](_0x7005('0x90'),_0x4adc31[_0x7005('0x21')],util[_0x7005('0x25')](_0x4690b6,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x7005('0x91')]=function(_0x1a0440){var _0x4a97dc='';try{if(this[_0x7005('0x1e')](_0x1a0440)){logger[_0x7005('0x23')](_0x7005('0x92'),_0x1a0440['uniqueid'],util[_0x7005('0x25')](_0x1a0440,{'showHidden':![],'depth':null}));if(_0x1a0440[_0x7005('0x93')]){_0x4a97dc=_0x1a0440[_0x7005('0x93')][_0x7005('0x94')](0x0,_0x1a0440['channel'][_0x7005('0x95')]('-'));if(this['agents'][_0x4a97dc]){logger[_0x7005('0x49')](_0x7005('0x96'),_0x1a0440[_0x7005('0x21')],_0x4a97dc);this[_0x7005('0xc')][_0x4a97dc][_0x7005('0x97')]=!![];}}}}catch(_0x737655){logger[_0x7005('0x34')]('[%s][voiceAgentReport][musiconholdstart]',_0x1a0440[_0x7005('0x21')],util[_0x7005('0x25')](_0x737655,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7005('0x1d')][_0x7005('0x18')]=function(_0x1351cf){var _0x13e527='';try{if(this[_0x7005('0x1e')](_0x1351cf)){logger['debug'](_0x7005('0x98'),_0x1351cf[_0x7005('0x21')],util['inspect'](_0x1351cf,{'showHidden':![],'depth':null}));if(_0x1351cf['channel']){_0x13e527=_0x1351cf[_0x7005('0x93')][_0x7005('0x94')](0x0,_0x1351cf['channel'][_0x7005('0x95')]('-'));if(this['agents'][_0x13e527]){logger[_0x7005('0x49')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x1351cf[_0x7005('0x21')],_0x13e527);this[_0x7005('0xc')][_0x13e527][_0x7005('0x97')]=![];}}}}catch(_0x1b145b){logger[_0x7005('0x34')](_0x7005('0x99'),_0x1351cf[_0x7005('0x21')],util['inspect'](_0x1b145b,{'showHidden':![],'depth':null}));}};module[_0x7005('0x9a')]=VoiceAgentReport; \ No newline at end of file +var _0xdfa7=['[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','diff','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','bind','agentringnoanswer','syncAgentRingNoAnswer','agentcomplete','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','syncBlindTransfer','emit','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','inspect','channels','interface','queue','format','YYYY-MM-DD\x20HH:mm:ss','mandatoryDisposition','type','voice','assign','omit','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','routealias','merge','pick','destconnectedlinenum','name','exten','custom:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','answeredelsewheredestinationuniqueid','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','prototype','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','agentringnoanswerAt','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','isUndefined','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','agentcompleteAt','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values'];(function(_0x39e7f2,_0x233b72){var _0x3c3b2e=function(_0x505126){while(--_0x505126){_0x39e7f2['push'](_0x39e7f2['shift']());}};_0x3c3b2e(++_0x233b72);}(_0xdfa7,0x1dc));var _0x7dfa=function(_0x2b1f7c,_0xd98c2b){_0x2b1f7c=_0x2b1f7c-0x0;var _0x35cf34=_0xdfa7[_0x2b1f7c];return _0x35cf34;};'use strict';var _=require(_0x7dfa('0x0'));var moment=require(_0x7dfa('0x1'));var util=require('util');var Redis=require(_0x7dfa('0x2'));var config=require(_0x7dfa('0x3'));var logger=require(_0x7dfa('0x4'))(_0x7dfa('0x5'));var ami=require(_0x7dfa('0x6'));config[_0x7dfa('0x7')]=_[_0x7dfa('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7dfa('0x9'))(new Redis(config['redis']));function VoiceAgentReport(_0x241bda){this['channels']={};this[_0x7dfa('0xa')]=_0x241bda['channels'];this[_0x7dfa('0xb')]=_0x241bda[_0x7dfa('0xb')];this['agents']=_0x241bda[_0x7dfa('0xc')];this[_0x7dfa('0xd')]={};ami['on'](_0x7dfa('0xe'),this[_0x7dfa('0xf')]['bind'](this));ami['on'](_0x7dfa('0x10'),this['syncAgentConnect'][_0x7dfa('0x11')](this));ami['on'](_0x7dfa('0x12'),this[_0x7dfa('0x13')][_0x7dfa('0x11')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x7dfa('0x11')](this));ami['on'](_0x7dfa('0x14'),this['syncAgentComplete'][_0x7dfa('0x11')](this));ami['on']('varset',this[_0x7dfa('0x15')][_0x7dfa('0x11')](this));ami['on'](_0x7dfa('0x16'),this[_0x7dfa('0x17')]['bind'](this));ami['on'](_0x7dfa('0x18'),this[_0x7dfa('0x19')][_0x7dfa('0x11')](this));ami['on'](_0x7dfa('0x1a'),this[_0x7dfa('0x1b')][_0x7dfa('0x11')](this));ami['on']('attendedtransfer',this[_0x7dfa('0x1c')][_0x7dfa('0x11')](this));ami['on']('blindtransfer',this[_0x7dfa('0x1d')]['bind'](this));}VoiceAgentReport['prototype'][_0x7dfa('0x1e')]=function(_0x25670e,_0x2bb641,_0x1e720e){io['to'](_0x25670e)[_0x7dfa('0x1e')](_0x2bb641,_0x1e720e);};VoiceAgentReport['prototype'][_0x7dfa('0x1f')]=function(_0x3166ab){return _0x3166ab!==null&&!_['isUndefined'](_0x3166ab);};VoiceAgentReport['prototype']['syncAgentCalled']=function(_0x5f01b7){try{if(this[_0x7dfa('0x1f')](_0x5f01b7)){logger[_0x7dfa('0x20')](_0x7dfa('0x21'),_0x5f01b7['uniqueid'],_0x5f01b7[_0x7dfa('0x22')],_0x5f01b7[_0x7dfa('0x23')]);logger['debug'](_0x7dfa('0x24'),_0x5f01b7[_0x7dfa('0x25')],util[_0x7dfa('0x26')](_0x5f01b7,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['channels'][_0x5f01b7[_0x7dfa('0x25')]])){this[_0x7dfa('0x27')][_0x5f01b7[_0x7dfa('0x25')]]={};}var _0x5692e5=this['agents'][_0x5f01b7[_0x7dfa('0x28')]];var _0x1f014d=this[_0x7dfa('0x27')][_0x5f01b7[_0x7dfa('0x25')]][_0x5f01b7[_0x7dfa('0x23')]];var _0x90f050=this[_0x7dfa('0xb')][_0x5f01b7[_0x7dfa('0x29')]];var _0x1f57ee=this['variables'][_0x5f01b7[_0x7dfa('0x25')]];if(_['isUndefined'](_0x1f014d)){_0x1f014d={'agentcalledAt':moment()[_0x7dfa('0x2a')](_0x7dfa('0x2b')),'lastevent':'called','mandatoryDisposition':_0x90f050&&_0x90f050[_0x7dfa('0x2c')]?_0x90f050[_0x7dfa('0x2c')]:![],'type':_0x90f050&&_0x90f050[_0x7dfa('0x2d')]?_0x90f050[_0x7dfa('0x2d')]:'inbound','variables':_0x1f57ee,'motionChannel':_0x7dfa('0x2e')};}Object[_0x7dfa('0x2f')](_0x1f014d,_[_0x7dfa('0x30')](_0x5f01b7,['event','privilege']));this[_0x7dfa('0x27')][_0x5f01b7[_0x7dfa('0x25')]][_0x5f01b7[_0x7dfa('0x23')]]=_0x1f014d;logger[_0x7dfa('0x31')](_0x7dfa('0x32'),_0x5f01b7['uniqueid'],util[_0x7dfa('0x26')](_0x1f014d,{'showHidden':![],'depth':null}));ami[_0x7dfa('0x1e')](_0x7dfa('0x33'),_0x1f014d);var _0xdda9da={'id':_0x5692e5['id'],'calleridnum':_0x1f014d['calleridnum'],'queue':_0x1f014d[_0x7dfa('0x29')],'variables':_0x1f014d[_0x7dfa('0xd')],'uniqueid':_0x5f01b7[_0x7dfa('0x25')]};logger[_0x7dfa('0x31')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x5f01b7[_0x7dfa('0x25')],util['inspect'](_0xdda9da,{'showHidden':![],'depth':null}));this[_0x7dfa('0x1e')](util['format'](_0x7dfa('0x34'),_0x5f01b7[_0x7dfa('0x22')]),_0x7dfa('0x35'),_0xdda9da);}}catch(_0x5bc9c7){logger[_0x7dfa('0x36')](_0x7dfa('0x37'),_0x5f01b7[_0x7dfa('0x25')],util['inspect'](_0x5bc9c7,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x7dfa('0x38')]=function(_0x41ee61){try{if(this['isNotNull'](_0x41ee61)){if(this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]]){for(var _0x11be73 in this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]]){if(this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x7dfa('0x39')](_0x11be73)){if(_0x41ee61['destuniqueid']===_0x11be73){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x41ee61[_0x7dfa('0x25')],_0x41ee61[_0x7dfa('0x22')],_0x41ee61[_0x7dfa('0x23')]);this[_0x7dfa('0x27')][_0x41ee61['uniqueid']][_0x11be73][_0x7dfa('0x3a')]=moment()[_0x7dfa('0x2a')](_0x7dfa('0x2b'));this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x11be73][_0x7dfa('0x3b')]=_0x41ee61[_0x7dfa('0x3b')];this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x11be73][_0x7dfa('0x3c')]=_0x41ee61['connectedlinenum'];this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x11be73][_0x7dfa('0x3d')]=_0x41ee61[_0x7dfa('0x3d')];this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x11be73][_0x7dfa('0x3e')]=_0x41ee61[_0x7dfa('0x3e')];this['channels'][_0x41ee61[_0x7dfa('0x25')]][_0x11be73][_0x7dfa('0x3f')]=_0x41ee61['holdtime'];this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x11be73][_0x7dfa('0x40')]='connect';if(this['voiceChannels'][this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x11be73][_0x7dfa('0x25')]]){var _0x1a4949=this[_0x7dfa('0xa')][this['channels'][_0x41ee61[_0x7dfa('0x25')]][_0x11be73][_0x7dfa('0x25')]]['routealias'];this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x11be73][_0x7dfa('0x41')]=_0x1a4949;_0x41ee61['routealias']=_0x1a4949;}_[_0x7dfa('0x42')](this[_0x7dfa('0xc')][_0x41ee61['interface']],_[_0x7dfa('0x43')](_0x41ee61,[_0x7dfa('0x29'),_0x7dfa('0x44'),'routealias']));var _0x9dae3e=this['agents'][_0x41ee61[_0x7dfa('0x28')]];var _0x949488={'id':_0x9dae3e['id'],'name':_0x9dae3e[_0x7dfa('0x45')],'agentconnected':!![],'destaccountcode':_0x9dae3e['accountcode'],'destconnectedlinenum':this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x41ee61['destuniqueid']][_0x7dfa('0x46')],'queue':this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x41ee61['destuniqueid']][_0x7dfa('0x29')],'routealias':this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x41ee61['destuniqueid']][_0x7dfa('0x41')],'uniqueid':this[_0x7dfa('0x27')][_0x41ee61['uniqueid']][_0x41ee61['destuniqueid']][_0x7dfa('0x25')]};ami[_0x7dfa('0x1e')](_0x7dfa('0x47'),this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x41ee61[_0x7dfa('0x23')]]);this['emit'](util[_0x7dfa('0x2a')](_0x7dfa('0x34'),_0x41ee61[_0x7dfa('0x22')]),'user:agentconnect',_0x949488);}else if(!this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x11be73]['agentringnoanswer']&&!this['channels'][_0x41ee61[_0x7dfa('0x25')]][_0x11be73][_0x7dfa('0x14')]){logger[_0x7dfa('0x20')](_0x7dfa('0x48'),_0x41ee61[_0x7dfa('0x25')],this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x11be73][_0x7dfa('0x22')],_0x11be73);this['channels'][_0x41ee61['uniqueid']][_0x11be73][_0x7dfa('0x12')]=!![];this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x11be73]['agentringnoanswerAt']=moment()[_0x7dfa('0x2a')](_0x7dfa('0x2b'));this[_0x7dfa('0x27')][_0x41ee61['uniqueid']][_0x11be73][_0x7dfa('0x49')]=_0x41ee61['destuniqueid'];this[_0x7dfa('0x27')][_0x41ee61['uniqueid']][_0x11be73]['answeredelsewheremembername']=_0x41ee61[_0x7dfa('0x22')];this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x11be73][_0x7dfa('0x40')]=_0x7dfa('0x4a');this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x11be73][_0x7dfa('0x4b')]='answered_elsewhere';logger[_0x7dfa('0x31')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x41ee61[_0x7dfa('0x25')],util[_0x7dfa('0x26')](this['channels'][_0x41ee61['uniqueid']][_0x11be73],{'showHidden':![],'depth':null}));ami[_0x7dfa('0x1e')]('custom:agentansweredelsewhere',this[_0x7dfa('0x27')][_0x41ee61[_0x7dfa('0x25')]][_0x11be73]);}else{logger[_0x7dfa('0x31')](_0x7dfa('0x4c'),_0x41ee61['uniqueid']);}}}}}}catch(_0x343a4a){logger[_0x7dfa('0x36')]('[%s][voiceAgentReport][agentconnect]',_0x41ee61['uniqueid'],util['inspect'](_0x343a4a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7dfa('0x4d')][_0x7dfa('0x13')]=function(_0x21d196){try{if(this['isNotNull'](_0x21d196)){logger[_0x7dfa('0x31')](_0x7dfa('0x4e'),_0x21d196['uniqueid'],util[_0x7dfa('0x26')](_0x21d196,{'showHidden':![],'depth':null}));if(this[_0x7dfa('0x27')][_0x21d196['uniqueid']]&&this['channels'][_0x21d196[_0x7dfa('0x25')]][_0x21d196[_0x7dfa('0x23')]]){logger[_0x7dfa('0x20')](_0x7dfa('0x4f'),_0x21d196['uniqueid'],_0x21d196[_0x7dfa('0x22')],_0x21d196[_0x7dfa('0x23')]);var _0x1288a6=this['agents'][_0x21d196[_0x7dfa('0x28')]];var _0x3114e8=this[_0x7dfa('0x27')][_0x21d196[_0x7dfa('0x25')]][_0x21d196[_0x7dfa('0x23')]];_0x3114e8['agentringnoanswer']=!![];_0x3114e8[_0x7dfa('0x50')]=moment()[_0x7dfa('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');_0x3114e8['lastevent']=_0x7dfa('0x51');_0x3114e8[_0x7dfa('0x4b')]='rejected';var _0x1e8b87={'id':_0x1288a6['id'],'name':_0x1288a6[_0x7dfa('0x45')],'queue':_0x3114e8[_0x7dfa('0x29')],'uniqueid':_0x3114e8['uniqueid']};logger['debug'](_0x7dfa('0x52'),_0x21d196[_0x7dfa('0x25')],util[_0x7dfa('0x26')](_0x1e8b87,{'showHidden':![],'depth':null}));this[_0x7dfa('0x1e')](util[_0x7dfa('0x2a')](_0x7dfa('0x34'),_0x1288a6[_0x7dfa('0x45')]),_0x7dfa('0x53'),_0x1e8b87);ami[_0x7dfa('0x1e')](_0x7dfa('0x54'),_0x3114e8);this[_0x7dfa('0x27')][_0x21d196[_0x7dfa('0x25')]][_0x21d196[_0x7dfa('0x23')]]=Object[_0x7dfa('0x2f')]({},_0x3114e8);}}}catch(_0x514e3d){logger[_0x7dfa('0x36')]('[%s][voiceAgentReport][agentringnoanswer]',_0x21d196['uniqueid'],util[_0x7dfa('0x26')](_0x514e3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7dfa('0x4d')][_0x7dfa('0x55')]=function(_0x2a1e6e){try{if(this[_0x7dfa('0x1f')](_0x2a1e6e)){logger['debug'](_0x7dfa('0x56'),_0x2a1e6e['uniqueid'],util[_0x7dfa('0x26')](_0x2a1e6e,{'showHidden':![],'depth':null}));if(this[_0x7dfa('0x27')][_0x2a1e6e['uniqueid']]){for(var _0x8762a5 in this['channels'][_0x2a1e6e[_0x7dfa('0x25')]]){if(this[_0x7dfa('0x27')][_0x2a1e6e[_0x7dfa('0x25')]][_0x7dfa('0x39')](_0x8762a5)&&!this[_0x7dfa('0x27')][_0x2a1e6e['uniqueid']][_0x8762a5][_0x7dfa('0x12')]&&!this[_0x7dfa('0x27')][_0x2a1e6e[_0x7dfa('0x25')]][_0x8762a5]['agentcomplete']){logger[_0x7dfa('0x20')](_0x7dfa('0x57'),_0x2a1e6e[_0x7dfa('0x25')],this[_0x7dfa('0x27')][_0x2a1e6e[_0x7dfa('0x25')]][_0x8762a5][_0x7dfa('0x22')],_0x8762a5);this['channels'][_0x2a1e6e[_0x7dfa('0x25')]][_0x8762a5][_0x7dfa('0x12')]=!![];this[_0x7dfa('0x27')][_0x2a1e6e[_0x7dfa('0x25')]][_0x8762a5][_0x7dfa('0x50')]=moment()[_0x7dfa('0x2a')](_0x7dfa('0x2b'));this[_0x7dfa('0x27')][_0x2a1e6e[_0x7dfa('0x25')]][_0x8762a5]['lastevent']=_0x7dfa('0x58');this[_0x7dfa('0x27')][_0x2a1e6e['uniqueid']][_0x8762a5][_0x7dfa('0x4b')]=_0x7dfa('0x58');logger['debug'](_0x7dfa('0x59'),_0x2a1e6e[_0x7dfa('0x25')],util[_0x7dfa('0x26')](this[_0x7dfa('0x27')][_0x2a1e6e['uniqueid']][_0x8762a5],{'showHidden':![],'depth':null}));ami['emit'](_0x7dfa('0x5a'),this[_0x7dfa('0x27')][_0x2a1e6e[_0x7dfa('0x25')]][_0x8762a5]);}}}}}catch(_0x341fb5){logger['error']('[%s][voiceAgentReport][queuecallerabandon]',_0x2a1e6e[_0x7dfa('0x25')],util[_0x7dfa('0x26')](_0x341fb5,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x7dfa('0x5b')]=function(_0x5a84c6){try{if(this[_0x7dfa('0x1f')](_0x5a84c6)){logger[_0x7dfa('0x31')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x5a84c6[_0x7dfa('0x25')],util[_0x7dfa('0x26')](_0x5a84c6,{'showHidden':![],'depth':null}));if(this[_0x7dfa('0x27')][_0x5a84c6[_0x7dfa('0x25')]]){for(var _0x41b6f3 in this[_0x7dfa('0x27')][_0x5a84c6[_0x7dfa('0x25')]]){if(this[_0x7dfa('0x27')][_0x5a84c6[_0x7dfa('0x25')]]['hasOwnProperty'](_0x41b6f3)){if(this[_0x7dfa('0x27')][_0x5a84c6[_0x7dfa('0x25')]][_0x41b6f3][_0x7dfa('0x3a')]&&!this[_0x7dfa('0x27')][_0x5a84c6[_0x7dfa('0x25')]][_0x41b6f3][_0x7dfa('0x14')]){logger['info'](_0x7dfa('0x5c'),_0x5a84c6[_0x7dfa('0x25')],this[_0x7dfa('0x27')][_0x5a84c6[_0x7dfa('0x25')]][_0x41b6f3][_0x7dfa('0x22')],_0x41b6f3);this[_0x7dfa('0x27')][_0x5a84c6['uniqueid']][_0x41b6f3]['agentcomplete']=!![];this[_0x7dfa('0x27')][_0x5a84c6[_0x7dfa('0x25')]][_0x41b6f3]['agentcompleteAt']=moment()['format'](_0x7dfa('0x2b'));this['channels'][_0x5a84c6[_0x7dfa('0x25')]][_0x41b6f3][_0x7dfa('0x40')]='complete';this[_0x7dfa('0x27')][_0x5a84c6[_0x7dfa('0x25')]][_0x41b6f3]['reason']=_0x5a84c6[_0x7dfa('0x4b')]==_0x7dfa('0x5d')?_0x7dfa('0x5e'):_0x5a84c6[_0x7dfa('0x4b')];this['channels'][_0x5a84c6[_0x7dfa('0x25')]][_0x41b6f3]['talktime']=_0x5a84c6[_0x7dfa('0x5f')];if(this[_0x7dfa('0xb')][_0x5a84c6[_0x7dfa('0x29')]]&&this['voiceQueues'][_0x5a84c6[_0x7dfa('0x29')]][_0x7dfa('0x60')]){this[_0x7dfa('0x27')][_0x5a84c6[_0x7dfa('0x25')]][_0x41b6f3][_0x7dfa('0x61')]=this[_0x7dfa('0xb')][_0x5a84c6[_0x7dfa('0x29')]][_0x7dfa('0x62')];this['channels'][_0x5a84c6[_0x7dfa('0x25')]][_0x41b6f3][_0x7dfa('0x63')]=!![];}this[_0x7dfa('0xc')][_0x5a84c6[_0x7dfa('0x28')]]=_[_0x7dfa('0x30')](this['agents'][_0x5a84c6[_0x7dfa('0x28')]],[_0x7dfa('0x29'),_0x7dfa('0x44')]);logger[_0x7dfa('0x31')](_0x7dfa('0x64'),_0x5a84c6[_0x7dfa('0x25')],util[_0x7dfa('0x26')](this[_0x7dfa('0x27')][_0x5a84c6['uniqueid']][_0x41b6f3],{'showHidden':![],'depth':null}));ami[_0x7dfa('0x1e')]('custom:agentcomplete',this[_0x7dfa('0x27')][_0x5a84c6[_0x7dfa('0x25')]][_0x41b6f3]);logger[_0x7dfa('0x31')](_0x7dfa('0x65'),_0x5a84c6[_0x7dfa('0x25')],util[_0x7dfa('0x26')]({'id':this['agents'][_0x5a84c6[_0x7dfa('0x28')]]['id'],'destaccountcode':_0x5a84c6[_0x7dfa('0x66')]},{'showHidden':![],'depth':null}));this[_0x7dfa('0x1e')](util[_0x7dfa('0x2a')](_0x7dfa('0x34'),_0x5a84c6[_0x7dfa('0x22')]),_0x7dfa('0x67'),{'id':this[_0x7dfa('0xc')][_0x5a84c6['interface']]['id'],'destaccountcode':Number(_0x5a84c6[_0x7dfa('0x66')])});}}}}}}catch(_0x15c1b4){logger[_0x7dfa('0x36')](_0x7dfa('0x68'),_0x5a84c6[_0x7dfa('0x25')],util[_0x7dfa('0x26')](_0x15c1b4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7dfa('0x4d')][_0x7dfa('0x15')]=function(_0x17bc9f){try{if(this['isNotNull'](_0x17bc9f)){logger[_0x7dfa('0x31')](_0x7dfa('0x69'),_0x17bc9f[_0x7dfa('0x25')],util[_0x7dfa('0x26')](_0x17bc9f,{'showHidden':![],'depth':null}));this[_0x7dfa('0x6a')](_0x17bc9f[_0x7dfa('0x25')],_[_0x7dfa('0x6b')](_0x17bc9f['variable'])[0x0],_0x17bc9f[_0x7dfa('0x6c')]);if(this[_0x7dfa('0x27')][_0x17bc9f['uniqueid']]){for(var _0x2770f3 in this[_0x7dfa('0x27')][_0x17bc9f['uniqueid']]){if(this[_0x7dfa('0x27')][_0x17bc9f['uniqueid']][_0x7dfa('0x39')](_0x2770f3)){logger['info'](_0x7dfa('0x6d'),_0x17bc9f['uniqueid'],_0x2770f3,_[_0x7dfa('0x6b')](_0x17bc9f['variable'])[0x0],_0x17bc9f[_0x7dfa('0x6c')]);if(_['isUndefined'](this[_0x7dfa('0x27')][_0x17bc9f[_0x7dfa('0x25')]][_0x2770f3][_0x7dfa('0xd')])){this['channels'][_0x17bc9f[_0x7dfa('0x25')]][_0x2770f3][_0x7dfa('0xd')]={};}this[_0x7dfa('0x27')][_0x17bc9f[_0x7dfa('0x25')]][_0x2770f3]['variables']=this[_0x7dfa('0xd')][_0x17bc9f[_0x7dfa('0x25')]];}}}}}catch(_0x2e3d99){logger[_0x7dfa('0x36')](_0x7dfa('0x6e'),_0x17bc9f[_0x7dfa('0x25')],util[_0x7dfa('0x26')](_0x2e3d99,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0x3293b7,_0x32b929,_0x282686){var _0x269b61=[_0x7dfa('0x6f'),'rtpaudioqosbridged',_0x7dfa('0x70'),_0x7dfa('0x71'),_0x7dfa('0x72'),_0x7dfa('0x73'),_0x7dfa('0x74'),_0x7dfa('0x75'),_0x7dfa('0x76'),_0x7dfa('0x77'),'bridgepeer',_0x7dfa('0x78'),_0x7dfa('0x79'),'memberdynamic','memberinterface',_0x7dfa('0x7a'),_0x7dfa('0x22'),_0x7dfa('0x7b'),_0x7dfa('0x7c')];if(!_[_0x7dfa('0x7d')](_0x32b929)&&!_['includes'](_0x269b61,_0x32b929)){if(_[_0x7dfa('0x7e')](this['variables'][_0x3293b7])){this[_0x7dfa('0xd')][_0x3293b7]={};}this[_0x7dfa('0xd')][_0x3293b7][_0x32b929]=_0x282686;}};VoiceAgentReport[_0x7dfa('0x4d')][_0x7dfa('0x17')]=function(_0x4fbd86){try{if(this[_0x7dfa('0x1f')](_0x4fbd86)){logger[_0x7dfa('0x31')](_0x7dfa('0x7f'),_0x4fbd86[_0x7dfa('0x25')],util['inspect'](_0x4fbd86,{'showHidden':![],'depth':null}));if(this[_0x7dfa('0x27')][_0x4fbd86[_0x7dfa('0x25')]]){for(var _0x10da1a in this[_0x7dfa('0x27')][_0x4fbd86[_0x7dfa('0x25')]]){if(this[_0x7dfa('0x27')][_0x4fbd86[_0x7dfa('0x25')]][_0x7dfa('0x39')](_0x10da1a)){if(this[_0x7dfa('0x27')][_0x4fbd86[_0x7dfa('0x25')]][_0x10da1a][_0x7dfa('0x4b')]=='transfer'&&this[_0x7dfa('0x27')][_0x4fbd86['uniqueid']][_0x10da1a]['agentcomplete']){logger[_0x7dfa('0x20')](_0x7dfa('0x80'),_0x4fbd86[_0x7dfa('0x25')],_0x10da1a);this[_0x7dfa('0x27')][_0x4fbd86[_0x7dfa('0x25')]][_0x10da1a][_0x7dfa('0x81')]=moment()[_0x7dfa('0x2a')](_0x7dfa('0x2b'));}}}logger[_0x7dfa('0x31')](_0x7dfa('0x82'),_0x4fbd86[_0x7dfa('0x25')],util[_0x7dfa('0x26')](_['values'](this[_0x7dfa('0x27')][_0x4fbd86[_0x7dfa('0x25')]]),{'showHidden':![],'depth':null}));ami['emit']('custom:voiceAgentReport',_[_0x7dfa('0x83')](this['channels'][_0x4fbd86[_0x7dfa('0x25')]]));delete this[_0x7dfa('0x27')][_0x4fbd86[_0x7dfa('0x25')]];}if(this[_0x7dfa('0xd')][_0x4fbd86['uniqueid']]){delete this['variables'][_0x4fbd86[_0x7dfa('0x25')]];}}}catch(_0x24ae69){logger[_0x7dfa('0x36')]('[%s][voiceAgentReport][hangup]',_0x4fbd86['uniqueid'],util[_0x7dfa('0x26')](_0x24ae69,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7dfa('0x4d')][_0x7dfa('0x1c')]=function(_0x1ac41c){try{if(this[_0x7dfa('0x1f')](_0x1ac41c)){logger['debug'](_0x7dfa('0x84'),_0x1ac41c[_0x7dfa('0x25')],util[_0x7dfa('0x26')](_0x1ac41c,{'showHidden':![],'depth':null}));if(this['channels'][_0x1ac41c[_0x7dfa('0x85')]]){for(var _0x32d0c9 in this[_0x7dfa('0x27')][_0x1ac41c[_0x7dfa('0x85')]]){if(this['channels'][_0x1ac41c[_0x7dfa('0x85')]][_0x7dfa('0x39')](_0x32d0c9)){if(_0x1ac41c[_0x7dfa('0x86')]===_0x32d0c9){logger[_0x7dfa('0x20')](_0x7dfa('0x87'),_0x1ac41c[_0x7dfa('0x25')],this[_0x7dfa('0x27')][_0x1ac41c[_0x7dfa('0x85')]][_0x32d0c9][_0x7dfa('0x22')],_0x32d0c9);var _0x106aef=moment();this['channels'][_0x1ac41c[_0x7dfa('0x85')]][_0x32d0c9]['agentcomplete']=!![];this[_0x7dfa('0x27')][_0x1ac41c[_0x7dfa('0x85')]][_0x32d0c9][_0x7dfa('0x81')]=moment()[_0x7dfa('0x2a')](_0x7dfa('0x2b'));this[_0x7dfa('0x27')][_0x1ac41c[_0x7dfa('0x85')]][_0x32d0c9]['lastevent']=_0x7dfa('0x88');this[_0x7dfa('0x27')][_0x1ac41c[_0x7dfa('0x85')]][_0x32d0c9][_0x7dfa('0x4b')]=_0x7dfa('0x5d');this[_0x7dfa('0x27')][_0x1ac41c[_0x7dfa('0x85')]][_0x32d0c9][_0x7dfa('0x5f')]=_0x106aef['diff'](this[_0x7dfa('0x27')][_0x1ac41c[_0x7dfa('0x85')]][_0x32d0c9]['agentconnectAt'],_0x7dfa('0x89'));}}}}if(this[_0x7dfa('0x27')][_0x1ac41c[_0x7dfa('0x8a')]]){var _0x1a41c7=this[_0x7dfa('0x27')][_0x1ac41c['secondtransfereruniqueid']];this['channels'][_0x1ac41c[_0x7dfa('0x8a')]]=this[_0x7dfa('0x27')][_0x1ac41c[_0x7dfa('0x85')]];this[_0x7dfa('0x27')][_0x1ac41c[_0x7dfa('0x85')]]=_0x1a41c7;}}}catch(_0x1a8dd0){logger[_0x7dfa('0x36')]('[%s][voiceAgentReport][attendedtransfer]',_0x1ac41c['uniqueid'],util['inspect'](_0x1a8dd0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7dfa('0x4d')]['syncBlindTransfer']=function(_0xa864ed){try{if(this[_0x7dfa('0x1f')](_0xa864ed)){logger[_0x7dfa('0x31')](_0x7dfa('0x8b'),_0xa864ed[_0x7dfa('0x25')],util[_0x7dfa('0x26')](_0xa864ed,{'showHidden':![],'depth':null}));if(this[_0x7dfa('0x27')][_0xa864ed[_0x7dfa('0x85')]]){for(var _0x1ed519 in this['channels'][_0xa864ed['transfereeuniqueid']]){if(this[_0x7dfa('0x27')][_0xa864ed[_0x7dfa('0x85')]]['hasOwnProperty'](_0x1ed519)){if(_0xa864ed['transfereruniqueid']===_0x1ed519){logger[_0x7dfa('0x20')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0xa864ed[_0x7dfa('0x25')],this[_0x7dfa('0x27')][_0xa864ed[_0x7dfa('0x85')]][_0x1ed519][_0x7dfa('0x22')],_0x1ed519);var _0x4ed29f=moment();this[_0x7dfa('0x27')][_0xa864ed[_0x7dfa('0x85')]][_0x1ed519][_0x7dfa('0x14')]=!![];this['channels'][_0xa864ed[_0x7dfa('0x85')]][_0x1ed519][_0x7dfa('0x81')]=_0x4ed29f;this[_0x7dfa('0x27')][_0xa864ed['transfereeuniqueid']][_0x1ed519][_0x7dfa('0x40')]=_0x7dfa('0x88');this[_0x7dfa('0x27')][_0xa864ed[_0x7dfa('0x85')]][_0x1ed519][_0x7dfa('0x4b')]=_0x7dfa('0x5d');this['channels'][_0xa864ed[_0x7dfa('0x85')]][_0x1ed519][_0x7dfa('0x5f')]=_0x4ed29f[_0x7dfa('0x8c')](this[_0x7dfa('0x27')][_0xa864ed[_0x7dfa('0x85')]][_0x1ed519][_0x7dfa('0x3a')],_0x7dfa('0x89'));}}}}}}catch(_0x76b5b){logger[_0x7dfa('0x36')]('[%s][voiceAgentReport][blindtransfer]',_0xa864ed['uniqueid'],util[_0x7dfa('0x26')](_0x76b5b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStart']=function(_0x6a23a1){var _0x26138c='';try{if(this[_0x7dfa('0x1f')](_0x6a23a1)){logger[_0x7dfa('0x31')](_0x7dfa('0x8d'),_0x6a23a1[_0x7dfa('0x25')],util[_0x7dfa('0x26')](_0x6a23a1,{'showHidden':![],'depth':null}));if(_0x6a23a1[_0x7dfa('0x8e')]){_0x26138c=_0x6a23a1[_0x7dfa('0x8e')][_0x7dfa('0x8f')](0x0,_0x6a23a1[_0x7dfa('0x8e')][_0x7dfa('0x90')]('-'));if(this['agents'][_0x26138c]){logger[_0x7dfa('0x20')](_0x7dfa('0x91'),_0x6a23a1[_0x7dfa('0x25')],_0x26138c);this[_0x7dfa('0xc')][_0x26138c][_0x7dfa('0x92')]=!![];}}}}catch(_0x45be0c){logger[_0x7dfa('0x36')](_0x7dfa('0x93'),_0x6a23a1['uniqueid'],util['inspect'](_0x45be0c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x7dfa('0x4d')]['syncMusicOnHoldStop']=function(_0x38ebad){var _0x199e30='';try{if(this[_0x7dfa('0x1f')](_0x38ebad)){logger[_0x7dfa('0x31')](_0x7dfa('0x94'),_0x38ebad[_0x7dfa('0x25')],util[_0x7dfa('0x26')](_0x38ebad,{'showHidden':![],'depth':null}));if(_0x38ebad[_0x7dfa('0x8e')]){_0x199e30=_0x38ebad['channel'][_0x7dfa('0x8f')](0x0,_0x38ebad['channel'][_0x7dfa('0x90')]('-'));if(this[_0x7dfa('0xc')][_0x199e30]){logger[_0x7dfa('0x20')](_0x7dfa('0x95'),_0x38ebad['uniqueid'],_0x199e30);this[_0x7dfa('0xc')][_0x199e30][_0x7dfa('0x92')]=![];}}}}catch(_0x5d7333){logger[_0x7dfa('0x36')](_0x7dfa('0x96'),_0x38ebad[_0x7dfa('0x25')],util['inspect'](_0x5d7333,{'showHidden':![],'depth':null}));}};module[_0x7dfa('0x97')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 33be84f..8767975 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8760=['disposition','channelstate','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','application','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','cdr(','type','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','diff','connectedlinename','destinationchannel','toNumber','UserId','membername','answertime','holdtime','connectedlinenum','routealias','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','xmd-cdrtype','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','endtime','billableseconds','omit','user:agentcomplete','length','transferType','resolve','then','undefined','transferToInternal','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','ATTENDED','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','transfererchannel','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','../model/channel','../rpc/setting','set','queue','agi','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','defaults','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','isUndefined','emit','prototype','isNotNull','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','context','from-sip','split','exten','xcally-motion-preview','format','name','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','debug','[%s][voiceCallReport][newchannel]\x20event:','channel','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime'];(function(_0x4b0dca,_0x397e5c){var _0x38cac0=function(_0x3a6679){while(--_0x3a6679){_0x4b0dca['push'](_0x4b0dca['shift']());}};_0x38cac0(++_0x397e5c);}(_0x8760,0x80));var _0x0876=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x8760[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require('lodash');var moment=require(_0x0876('0x0'));var util=require(_0x0876('0x1'));var path=require('path');var Redis=require(_0x0876('0x2'));var config=require(_0x0876('0x3'));var logger=require(_0x0876('0x4'))('ami');var ami=require('../ami');var Channel=require(_0x0876('0x5'));var RpcSetting=require(_0x0876('0x6'));var applications=[_0x0876('0x7'),_0x0876('0x8'),_0x0876('0x9'),'dial',_0x0876('0xa'),_0x0876('0xb')];var dispositions=['NO\x20ANSWER',_0x0876('0xc'),_0x0876('0xc'),_0x0876('0xd'),'NO\x20ANSWER',_0x0876('0xd'),_0x0876('0xe'),'BUSY','FAILED','FAILED',_0x0876('0xc')];config['redis']=_[_0x0876('0xf')](config[_0x0876('0x10')],{'host':_0x0876('0x11'),'port':0x18eb});var io=require(_0x0876('0x12'))(new Redis(config[_0x0876('0x10')]));function VoiceCallReport(_0x335af1){this['channels']=_0x335af1[_0x0876('0x13')];this[_0x0876('0x14')]=_0x335af1[_0x0876('0x14')];this[_0x0876('0x15')]={};ami['on'](_0x0876('0x16'),this[_0x0876('0x17')][_0x0876('0x18')](this));ami['on'](_0x0876('0x19'),this['syncNewExten'][_0x0876('0x18')](this));ami['on']('newchannel',this['syncNewChannel'][_0x0876('0x18')](this));ami['on']('newstate',this[_0x0876('0x1a')][_0x0876('0x18')](this));ami['on'](_0x0876('0x1b'),this[_0x0876('0x1c')][_0x0876('0x18')](this));ami['on'](_0x0876('0x1d'),this[_0x0876('0x1e')][_0x0876('0x18')](this));ami['on'](_0x0876('0x1f'),this[_0x0876('0x20')][_0x0876('0x18')](this));ami['on'](_0x0876('0x21'),this['syncAttendedTransfer'][_0x0876('0x18')](this));ami['on']('blindtransfer',this[_0x0876('0x22')][_0x0876('0x18')](this));ami['on'](_0x0876('0x23'),this[_0x0876('0x24')]['bind'](this));ami['on'](_0x0876('0x25'),this[_0x0876('0x26')][_0x0876('0x18')](this));try{logger[_0x0876('0x27')](_0x0876('0x28'));ami[_0x0876('0x29')]();}catch(_0x4f0a00){logger[_0x0876('0x2a')](_0x0876('0x2b'),util[_0x0876('0x2c')](_0x4f0a00,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype']['isNotNull']=function(_0x4f0d61){return _0x4f0d61!==null&&!_[_0x0876('0x2d')](_0x4f0d61);};VoiceCallReport['prototype']['emit']=function(_0x44e8a1,_0x93fb11,_0x338163){io['to'](_0x44e8a1)[_0x0876('0x2e')](_0x93fb11,_0x338163);};VoiceCallReport[_0x0876('0x2f')][_0x0876('0x20')]=function(_0x1e8c03){try{if(this[_0x0876('0x30')](_0x1e8c03)){logger[_0x0876('0x27')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x1e8c03[_0x0876('0x31')],_0x1e8c03[_0x0876('0x32')],_0x1e8c03[_0x0876('0x33')]);logger['debug'](_0x0876('0x34'),_0x1e8c03[_0x0876('0x31')],util['inspect'](_0x1e8c03,{'showHidden':![],'depth':null}));if(_0x1e8c03['uniqueid']===_0x1e8c03[_0x0876('0x35')]){if(!_[_0x0876('0x2d')](this['channels'][_0x1e8c03[_0x0876('0x31')]])){_[_0x0876('0x36')](this['channels'][_0x1e8c03[_0x0876('0x31')]],_[_0x0876('0x37')](_0x1e8c03,_[_0x0876('0x38')](this[_0x0876('0x13')][_0x1e8c03[_0x0876('0x31')]])));}}if(_0x1e8c03[_0x0876('0x39')]===_0x0876('0x3a')){var _0x5b16df=this[_0x0876('0x14')][_0x1e8c03['channel'][_0x0876('0x3b')]('-')[0x0]];if(_0x5b16df){if(_0x1e8c03[_0x0876('0x3c')]==_0x0876('0x3d')){_0x5b16df['destconnectedlinenum']=_0x1e8c03['connectedlinenum'];this[_0x0876('0x2e')](util[_0x0876('0x3e')]('user:%s',_0x5b16df[_0x0876('0x3f')]),'user:agentconnect',{'id':_0x5b16df['id'],'destaccountcode':_0x5b16df[_0x0876('0x40')],'destconnectedlinenum':_0x1e8c03['connectedlinenum']});}}}}}catch(_0xad5904){logger[_0x0876('0x2a')](_0x0876('0x41'),_0x1e8c03[_0x0876('0x31')],util[_0x0876('0x2c')](_0xad5904,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0876('0x2f')][_0x0876('0x42')]=function(_0x381e48){try{if(this[_0x0876('0x30')](_0x381e48)){logger[_0x0876('0x43')](_0x0876('0x44'),_0x381e48[_0x0876('0x31')],util[_0x0876('0x2c')](_0x381e48,{'showHidden':![],'depth':null}));if(this[_0x0876('0x13')][_0x381e48['uniqueid']]){return;}if(_0x381e48[_0x0876('0x45')]===_0x0876('0x46')){return;}if(_0x381e48[_0x0876('0x31')]!==_0x381e48[_0x0876('0x35')]&&!this[_0x0876('0x15')][_0x381e48['linkedid']]){return;}logger[_0x0876('0x27')](_0x0876('0x47'),_0x381e48[_0x0876('0x31')],_0x381e48['context'],_0x381e48[_0x0876('0x3c')]);this['channels'][_0x381e48[_0x0876('0x31')]]=new Channel();this[_0x0876('0x13')][_0x381e48['uniqueid']][_0x0876('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0876('0x13')][_0x381e48['uniqueid']][_0x0876('0x49')]=dispositions[_['toNumber'](_0x381e48[_0x0876('0x4a')])];_[_0x0876('0x36')](this[_0x0876('0x13')][_0x381e48[_0x0876('0x31')]],_['pick'](_0x381e48,_['keys'](this[_0x0876('0x13')][_0x381e48[_0x0876('0x31')]])));if(_0x381e48[_0x0876('0x39')]===_0x0876('0x3a')){var _0x5cda8e=this['agents'][_0x381e48[_0x0876('0x45')][_0x0876('0x3b')]('-')[0x0]];if(_0x5cda8e&&typeof _0x5cda8e[_0x0876('0x4b')]==='undefined'){_0x5cda8e['destconnectedlinenum']=_0x381e48['exten'];logger[_0x0876('0x43')](_0x0876('0x4c'),_0x381e48[_0x0876('0x31')],util['inspect']({'id':_0x5cda8e['id'],'destaccountcode':_0x5cda8e['accountcode'],'destconnectedlinenum':_0x381e48[_0x0876('0x3c')]},{'showHidden':![],'depth':null}));this[_0x0876('0x2e')](util[_0x0876('0x3e')](_0x0876('0x4d'),_0x5cda8e['name']),_0x0876('0x4e'),{'id':_0x5cda8e['id'],'destaccountcode':_0x5cda8e[_0x0876('0x40')],'destconnectedlinenum':_0x381e48[_0x0876('0x3c')]});}}}}catch(_0xdd15a9){logger[_0x0876('0x2a')](_0x0876('0x4f'),_0x381e48[_0x0876('0x31')],util['inspect'](_0xdd15a9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0876('0x2f')]['syncNewExten']=function(_0x400b55){try{if(this[_0x0876('0x30')](_0x400b55)){logger[_0x0876('0x43')](_0x0876('0x50'),_0x400b55[_0x0876('0x31')],util['inspect'](_0x400b55,{'showHidden':![],'depth':null}));if(_0x400b55[_0x0876('0x45')]==='OutgoingSpoolFailed'||_0x400b55[_0x0876('0x3c')]==='h')return;if(_0x400b55[_0x0876('0x31')]===_0x400b55['linkedid']||this['blindTransfers'][_0x400b55['linkedid']]){_0x400b55['application']=_0x400b55['application']?_0x400b55['application'][_0x0876('0x51')]():undefined;_0x400b55[_0x0876('0x52')]=_0x400b55[_0x0876('0x53')]||_0x400b55['applicationdata'];if(_0x400b55['appdata']&&!_0x400b55[_0x0876('0x53')][_0x0876('0x54')](_0x0876('0x55'))&&_0x400b55[_0x0876('0x56')]!==_0x0876('0x8')){_0x400b55['applicationdata']=_0x400b55[_0x0876('0x52')][_0x0876('0x51')]();}logger[_0x0876('0x27')](_0x0876('0x57'),_0x400b55['uniqueid'],_0x400b55[_0x0876('0x56')],_0x400b55['applicationdata']);if(_[_0x0876('0x2d')](this[_0x0876('0x13')][_0x400b55[_0x0876('0x31')]])){this[_0x0876('0x13')][_0x400b55[_0x0876('0x31')]]=new Channel();this[_0x0876('0x13')][_0x400b55[_0x0876('0x31')]][_0x0876('0x48')]=_0x400b55[_0x0876('0x58')]?moment()[_0x0876('0x59')](moment['duration'](_0x400b55['duration'])['seconds'](),_0x0876('0x5a'))[_0x0876('0x3e')](_0x0876('0x5b')):moment()[_0x0876('0x3e')](_0x0876('0x5b'));this[_0x0876('0x13')][_0x400b55[_0x0876('0x31')]][_0x0876('0x49')]=_0x0876('0xd');}_[_0x0876('0x36')](this[_0x0876('0x13')][_0x400b55[_0x0876('0x31')]],_['pick'](_0x400b55,_[_0x0876('0x38')](this[_0x0876('0x13')][_0x400b55[_0x0876('0x31')]])));if(_[_0x0876('0x5c')](applications,_0x400b55['application'])){this[_0x0876('0x13')][_0x400b55[_0x0876('0x31')]][_0x0876('0x5d')]=_0x400b55[_0x0876('0x56')];this[_0x0876('0x13')][_0x400b55[_0x0876('0x31')]]['lastdata']=_0x400b55[_0x0876('0x52')];if(_0x400b55[_0x0876('0x56')]===_0x0876('0x7')&&_[_0x0876('0x54')](_0x400b55[_0x0876('0x52')][_0x0876('0x51')](),_0x0876('0x5e'))){var _0x5484e8=_0x400b55[_0x0876('0x52')]['split']('=');var _0x4336fd=_0x5484e8[0x0][_0x0876('0x51')]()['match'](/cdr\((.*)\)/);if(_0x4336fd){if(_0x4336fd[0x1]===_0x0876('0x5f')&&!_[_0x0876('0x60')](this[_0x0876('0x13')][_0x400b55[_0x0876('0x31')]][_0x4336fd[0x1]]))return;this[_0x0876('0x13')][_0x400b55[_0x0876('0x31')]][_0x4336fd[0x1]]=_0x5484e8[0x1];}}else if(_0x400b55[_0x0876('0x56')]===_0x0876('0x8')){this[_0x0876('0x13')][_0x400b55[_0x0876('0x31')]][_0x0876('0x8')]=_0x400b55[_0x0876('0x52')][_0x0876('0x3b')](',')[0x0];}}}}}catch(_0x2b98e2){logger['error'](_0x0876('0x61'),_0x400b55[_0x0876('0x31')],util['inspect'](_0x2b98e2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0876('0x2f')][_0x0876('0x1a')]=function(_0x30a235){try{if(this['isNotNull'](_0x30a235)){logger[_0x0876('0x27')](_0x0876('0x62'),_0x30a235[_0x0876('0x31')],_0x30a235[_0x0876('0x35')],_0x30a235[_0x0876('0x32')],_0x30a235[_0x0876('0x33')]);logger['debug'](_0x0876('0x63'),_0x30a235['uniqueid'],util[_0x0876('0x2c')](_0x30a235,{'showHidden':![],'depth':null}));if(_0x30a235[_0x0876('0x4a')]!=='6')return;var _0x382b19=this[_0x0876('0x14')][_0x30a235['channel']['split']('-')[0x0]];if(_0x30a235['uniqueid']!==_0x30a235[_0x0876('0x35')]){var _0x480f5c=moment();if(this[_0x0876('0x13')][_0x30a235['linkedid']]){if(!this[_0x0876('0x13')][_0x30a235[_0x0876('0x35')]][_0x0876('0x64')]){this['channels'][_0x30a235[_0x0876('0x35')]][_0x0876('0x64')]=!![];this['channels'][_0x30a235[_0x0876('0x35')]]['answertime']=_0x480f5c[_0x0876('0x3e')](_0x0876('0x5b'));if(this[_0x0876('0x13')][_0x30a235[_0x0876('0x35')]][_0x0876('0x48')]){this['channels'][_0x30a235['linkedid']]['holdtime']=_0x480f5c[_0x0876('0x65')](this[_0x0876('0x13')][_0x30a235[_0x0876('0x35')]][_0x0876('0x48')],'seconds');}}this[_0x0876('0x13')][_0x30a235['linkedid']]['linkedid']=_0x30a235[_0x0876('0x31')];if(_0x30a235[_0x0876('0x33')]!==_0x0876('0x3d')){this[_0x0876('0x13')][_0x30a235[_0x0876('0x35')]]['connectedlinenum']=_0x30a235[_0x0876('0x33')];}this[_0x0876('0x13')][_0x30a235[_0x0876('0x35')]][_0x0876('0x66')]=_0x30a235[_0x0876('0x32')];this[_0x0876('0x13')][_0x30a235['linkedid']][_0x0876('0x67')]=_0x30a235[_0x0876('0x45')];this[_0x0876('0x13')][_0x30a235[_0x0876('0x35')]]['disposition']=dispositions[_[_0x0876('0x68')](_0x30a235[_0x0876('0x4a')])];if(_0x382b19){this[_0x0876('0x13')][_0x30a235[_0x0876('0x35')]][_0x0876('0x69')]=_0x382b19['id'];this[_0x0876('0x13')][_0x30a235[_0x0876('0x35')]][_0x0876('0x6a')]=_0x382b19[_0x0876('0x3f')];}}if(this[_0x0876('0x13')][_0x30a235[_0x0876('0x31')]]){if(!this[_0x0876('0x13')][_0x30a235[_0x0876('0x31')]][_0x0876('0x64')]){this['channels'][_0x30a235[_0x0876('0x31')]][_0x0876('0x64')]=!![];this[_0x0876('0x13')][_0x30a235['uniqueid']][_0x0876('0x6b')]=_0x480f5c[_0x0876('0x3e')](_0x0876('0x5b'));if(this['channels'][_0x30a235[_0x0876('0x31')]][_0x0876('0x48')]){this[_0x0876('0x13')][_0x30a235[_0x0876('0x31')]][_0x0876('0x6c')]=_0x480f5c['diff'](this[_0x0876('0x13')][_0x30a235[_0x0876('0x31')]][_0x0876('0x48')],_0x0876('0x5a'));}}if(_0x30a235[_0x0876('0x33')]!==_0x0876('0x3d')){this[_0x0876('0x13')][_0x30a235[_0x0876('0x31')]][_0x0876('0x6d')]=_0x30a235[_0x0876('0x33')];}this[_0x0876('0x13')][_0x30a235[_0x0876('0x31')]][_0x0876('0x66')]=_0x30a235['calleridname'];this['channels'][_0x30a235[_0x0876('0x31')]][_0x0876('0x67')]=_0x30a235['channel'];this['channels'][_0x30a235[_0x0876('0x31')]][_0x0876('0x49')]=dispositions[_[_0x0876('0x68')](_0x30a235[_0x0876('0x4a')])];}}else{if(this[_0x0876('0x13')][_0x30a235[_0x0876('0x31')]]){if(_0x382b19){this['channels'][_0x30a235[_0x0876('0x31')]][_0x0876('0x69')]=_0x382b19['id'];this[_0x0876('0x13')][_0x30a235['uniqueid']][_0x0876('0x6a')]=_0x382b19[_0x0876('0x3f')];}}}if(_0x30a235[_0x0876('0x39')]===_0x0876('0x3a')){if(_0x382b19){_0x382b19[_0x0876('0x4b')]=_0x30a235[_0x0876('0x3c')];var _0x2b5ea3,_0x30102b;if(this[_0x0876('0x13')][_0x30a235[_0x0876('0x31')]]){_0x2b5ea3=this[_0x0876('0x13')][_0x30a235[_0x0876('0x31')]]['routealias'];_0x30102b=this['channels'][_0x30a235[_0x0876('0x31')]]['queue'];}else if(this[_0x0876('0x13')][_0x30a235['linkedid']]){_0x2b5ea3=this['channels'][_0x30a235[_0x0876('0x35')]]['routealias'];_0x30102b=this['channels'][_0x30a235['linkedid']][_0x0876('0x8')];}_0x382b19[_0x0876('0x8')]=_0x30102b;_0x382b19[_0x0876('0x6e')]=_0x2b5ea3;var _0x29784f={'id':_0x382b19['id'],'name':_0x382b19[_0x0876('0x3f')],'agentconnected':!![],'destaccountcode':_0x382b19['accountcode'],'destconnectedlinenum':_0x30a235[_0x0876('0x3c')],'queue':_0x30102b||undefined,'routealias':_0x2b5ea3,'uniqueid':_0x30a235[_0x0876('0x35')]};logger[_0x0876('0x43')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x30a235[_0x0876('0x31')],util[_0x0876('0x2c')](_0x29784f,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x0876('0x4d'),_0x382b19[_0x0876('0x3f')]),_0x0876('0x4e'),_0x29784f);}}}}catch(_0x394de1){logger[_0x0876('0x2a')]('[%s][voiceCallReport][newstate]',_0x30a235[_0x0876('0x31')],util['inspect'](_0x394de1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0876('0x2f')][_0x0876('0x6f')]=function(_0x2f01f3,_0x76fa8){try{if(this[_0x0876('0x13')][_0x2f01f3]){logger[_0x0876('0x27')](_0x0876('0x70'),_0x2f01f3,_0x76fa8);this[_0x0876('0x13')][_0x2f01f3][_0x0876('0x71')]=!![];if(_[_0x0876('0x72')](_0x76fa8,_0x0876('0x73'))){_0x76fa8=_0x76fa8[_0x0876('0x74')](_0x0876('0x73'),_0x0876('0x75'));}this[_0x0876('0x13')][_0x2f01f3][_0x0876('0x76')]=_0x76fa8;var _0x47142b=_[_0x0876('0x77')](this['channels'][_0x2f01f3][_0x0876('0x78')],{'filename':_0x76fa8});if(_[_0x0876('0x60')](_0x47142b)){this[_0x0876('0x13')][_0x2f01f3]['monitors']['push']({'filename':_0x76fa8,'createdAt':moment()[_0x0876('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x0876('0x79')});}}}catch(_0x2c5bf2){logger['error'](_0x0876('0x7a'),_0x2f01f3,util[_0x0876('0x2c')](_0x2c5bf2,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x0876('0x1c')]=function(_0x54432d){try{if(this['isNotNull'](_0x54432d)){logger[_0x0876('0x43')](_0x0876('0x7b'),_0x54432d[_0x0876('0x31')],util[_0x0876('0x2c')](_0x54432d,{'showHidden':![],'depth':null}));if(this[_0x0876('0x13')][_0x54432d[_0x0876('0x31')]]&&_0x54432d[_0x0876('0x45')]!=_0x0876('0x46')){if(this['isNotNull'](_0x54432d[_0x0876('0x7c')])){if(this[_0x0876('0x30')](_0x54432d[_0x0876('0x7c')][_0x0876('0x7d')])){logger[_0x0876('0x27')](_0x0876('0x7e'),_0x54432d[_0x0876('0x31')],_0x54432d[_0x0876('0x7f')]);this['syncMixMonitorFilename'](_0x54432d[_0x0876('0x31')],_0x54432d['value']);}else if(this[_0x0876('0x30')](_0x54432d[_0x0876('0x7c')]['xmd-phone'])){logger[_0x0876('0x27')](_0x0876('0x80'),_0x54432d[_0x0876('0x31')],_0x54432d['value']);this[_0x0876('0x13')][_0x54432d[_0x0876('0x31')]][_0x0876('0x33')]=_0x54432d['value'];}else if(this['isNotNull'](_0x54432d[_0x0876('0x7c')][_0x0876('0x81')])){logger[_0x0876('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x54432d[_0x0876('0x31')],_0x54432d['value']);this[_0x0876('0x13')][_0x54432d[_0x0876('0x31')]]['callerid']=_0x54432d[_0x0876('0x7f')];}else if(this[_0x0876('0x30')](_0x54432d[_0x0876('0x7c')][_0x0876('0x82')])){logger[_0x0876('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x54432d['uniqueid'],_0x54432d['value']);this['channels'][_0x54432d[_0x0876('0x31')]][_0x0876('0x5f')]=_0x54432d['value'];}else if(this[_0x0876('0x30')](_0x54432d[_0x0876('0x7c')][_0x0876('0x83')])){logger[_0x0876('0x27')](_0x0876('0x84'),_0x54432d[_0x0876('0x31')],_0x54432d[_0x0876('0x7f')][_0x0876('0x3b')](',')[0x0]);this['channels'][_0x54432d[_0x0876('0x31')]][_0x0876('0x8')]=_0x54432d[_0x0876('0x7f')][_0x0876('0x3b')](',')[0x0];}else if(this[_0x0876('0x30')](_0x54432d[_0x0876('0x7c')][_0x0876('0x85')])){logger[_0x0876('0x27')](_0x0876('0x86'),_0x54432d[_0x0876('0x31')],_0x54432d[_0x0876('0x7f')]);this[_0x0876('0x13')][_0x54432d[_0x0876('0x31')]][_0x0876('0x87')]=_0x54432d[_0x0876('0x7f')];}else if(this['isNotNull'](_0x54432d[_0x0876('0x7c')][_0x0876('0x88')])){logger[_0x0876('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x54432d[_0x0876('0x31')],_0x54432d[_0x0876('0x7f')]);this['channels'][_0x54432d[_0x0876('0x31')]][_0x0876('0x89')]=_0x54432d[_0x0876('0x7f')];}else if(this[_0x0876('0x30')](_0x54432d['variable'][_0x0876('0x8a')])){logger[_0x0876('0x27')](_0x0876('0x8b'),_0x54432d['uniqueid'],_0x54432d[_0x0876('0x7f')]);this[_0x0876('0x13')][_0x54432d[_0x0876('0x31')]][_0x0876('0x8c')]=_0x54432d[_0x0876('0x7f')];}else if(this[_0x0876('0x30')](_0x54432d[_0x0876('0x7c')][_0x0876('0x8d')])){logger[_0x0876('0x27')](_0x0876('0x8e'),_0x54432d[_0x0876('0x31')],_0x54432d['value']);this[_0x0876('0x13')][_0x54432d['uniqueid']][_0x0876('0x8')]=_0x54432d[_0x0876('0x7f')];}else if(this[_0x0876('0x30')](_0x54432d['variable'][_0x0876('0x8f')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x54432d[_0x0876('0x31')],_0x54432d[_0x0876('0x7f')]);this[_0x0876('0x13')][_0x54432d[_0x0876('0x31')]][_0x0876('0x90')]=_0x54432d[_0x0876('0x7f')];}}}else if(this['isNotNull'](_0x54432d[_0x0876('0x7c')][_0x0876('0x7d')])){if(_0x54432d['value']){var _0x3f6b5c=path[_0x0876('0x91')](_0x54432d['value'])['name'];logger[_0x0876('0x27')](_0x0876('0x7e'),_0x3f6b5c,_0x54432d[_0x0876('0x7f')]);this['syncMixMonitorFilename'](_0x3f6b5c,_0x54432d[_0x0876('0x7f')]);}}else if(this[_0x0876('0x13')][_0x54432d[_0x0876('0x35')]]){if(this['isNotNull'](_0x54432d['variable'])){if(this[_0x0876('0x30')](_0x54432d[_0x0876('0x7c')][_0x0876('0x8f')])){logger[_0x0876('0x27')](_0x0876('0x92'),_0x54432d[_0x0876('0x35')],_0x54432d['value']);this[_0x0876('0x13')][_0x54432d[_0x0876('0x35')]][_0x0876('0x93')]=_0x54432d['value'];}}}}}catch(_0x54f34f){logger[_0x0876('0x2a')](_0x0876('0x94'),_0x54432d['uniqueid'],util['inspect'](_0x54f34f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0876('0x2f')][_0x0876('0x1e')]=function(_0x3d917e){try{if(this['isNotNull'](_0x3d917e)){logger['debug'](_0x0876('0x95'),_0x3d917e[_0x0876('0x31')],util[_0x0876('0x2c')](_0x3d917e,{'showHidden':![],'depth':null}));if(this[_0x0876('0x15')][_0x3d917e['linkedid']]){if(this[_0x0876('0x13')][this['blindTransfers'][_0x3d917e[_0x0876('0x35')]][_0x0876('0x35')]]){this['channels'][this[_0x0876('0x15')][_0x3d917e[_0x0876('0x35')]][_0x0876('0x35')]][_0x0876('0x31')]=_0x3d917e[_0x0876('0x31')];this[_0x0876('0x13')][this[_0x0876('0x15')][_0x3d917e[_0x0876('0x35')]][_0x0876('0x35')]][_0x0876('0x64')]=this['channels'][_0x3d917e[_0x0876('0x31')]]['answered'];this[_0x0876('0x13')][this[_0x0876('0x15')][_0x3d917e[_0x0876('0x35')]][_0x0876('0x35')]][_0x0876('0x6b')]=this[_0x0876('0x13')][_0x3d917e[_0x0876('0x31')]][_0x0876('0x6b')];this[_0x0876('0x13')][this[_0x0876('0x15')][_0x3d917e[_0x0876('0x35')]][_0x0876('0x35')]][_0x0876('0x67')]=this[_0x0876('0x13')][this['blindTransfers'][_0x3d917e[_0x0876('0x35')]][_0x0876('0x35')]][_0x0876('0x45')];this['channels'][this[_0x0876('0x15')][_0x3d917e[_0x0876('0x35')]][_0x0876('0x35')]]['disposition']=this[_0x0876('0x13')][_0x3d917e[_0x0876('0x31')]][_0x0876('0x49')];this['channels'][_0x3d917e[_0x0876('0x31')]]=this['channels'][this[_0x0876('0x15')][_0x3d917e['linkedid']][_0x0876('0x35')]];delete this[_0x0876('0x13')][this[_0x0876('0x15')][_0x3d917e[_0x0876('0x35')]][_0x0876('0x35')]];}else if(this['channels'][this[_0x0876('0x15')][_0x3d917e['linkedid']]['uniqueid']]){this[_0x0876('0x13')][this[_0x0876('0x15')][_0x3d917e[_0x0876('0x35')]]['uniqueid']][_0x0876('0x31')]=[this[_0x0876('0x13')][this[_0x0876('0x15')][_0x3d917e['linkedid']][_0x0876('0x31')]]['linkedid'],this[_0x0876('0x13')][this['blindTransfers'][_0x3d917e[_0x0876('0x35')]][_0x0876('0x31')]][_0x0876('0x35')]=this[_0x0876('0x13')][this[_0x0876('0x15')][_0x3d917e[_0x0876('0x35')]][_0x0876('0x31')]][_0x0876('0x31')]][0x0];this['channels'][this['blindTransfers'][_0x3d917e[_0x0876('0x35')]]['uniqueid']][_0x0876('0x64')]=this[_0x0876('0x13')][_0x3d917e[_0x0876('0x31')]][_0x0876('0x64')];this['channels'][this[_0x0876('0x15')][_0x3d917e[_0x0876('0x35')]][_0x0876('0x31')]][_0x0876('0x6b')]=this[_0x0876('0x13')][_0x3d917e[_0x0876('0x31')]]['answertime'];this[_0x0876('0x13')][this[_0x0876('0x15')][_0x3d917e[_0x0876('0x35')]][_0x0876('0x31')]][_0x0876('0x67')]=this[_0x0876('0x13')][this['blindTransfers'][_0x3d917e['linkedid']]['uniqueid']]['channel'];this[_0x0876('0x13')][this[_0x0876('0x15')][_0x3d917e['linkedid']][_0x0876('0x31')]][_0x0876('0x49')]=this['channels'][_0x3d917e['uniqueid']][_0x0876('0x49')];this[_0x0876('0x13')][_0x3d917e[_0x0876('0x31')]]=this[_0x0876('0x13')][this['blindTransfers'][_0x3d917e[_0x0876('0x35')]][_0x0876('0x31')]];delete this[_0x0876('0x13')][this[_0x0876('0x15')][_0x3d917e['linkedid']][_0x0876('0x31')]];}}if(this['channels'][_0x3d917e['uniqueid']]){logger[_0x0876('0x27')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x3d917e[_0x0876('0x31')],_0x3d917e['cause-txt']);var _0x2151c1=moment();this[_0x0876('0x13')][_0x3d917e[_0x0876('0x31')]][_0x0876('0x96')]=_0x2151c1[_0x0876('0x3e')](_0x0876('0x5b'));this[_0x0876('0x13')][_0x3d917e[_0x0876('0x31')]][_0x0876('0x58')]=_0x2151c1[_0x0876('0x65')](this[_0x0876('0x13')][_0x3d917e[_0x0876('0x31')]][_0x0876('0x48')],_0x0876('0x5a'));if(this[_0x0876('0x13')][_0x3d917e[_0x0876('0x31')]]['answered']){this['channels'][_0x3d917e[_0x0876('0x31')]][_0x0876('0x97')]=_0x2151c1['diff'](this[_0x0876('0x13')][_0x3d917e[_0x0876('0x31')]][_0x0876('0x6b')],_0x0876('0x5a'));this['channels'][_0x3d917e[_0x0876('0x31')]][_0x0876('0x6c')]=this[_0x0876('0x13')][_0x3d917e[_0x0876('0x31')]]['duration']-this[_0x0876('0x13')][_0x3d917e[_0x0876('0x31')]][_0x0876('0x97')];}if(_0x3d917e[_0x0876('0x39')]===_0x0876('0x3a')){if(this[_0x0876('0x14')][_0x3d917e[_0x0876('0x45')][_0x0876('0x3b')]('-')[0x0]]){this[_0x0876('0x14')][_0x3d917e['channel'][_0x0876('0x3b')]('-')[0x0]]=_[_0x0876('0x98')](this[_0x0876('0x14')][_0x3d917e[_0x0876('0x45')][_0x0876('0x3b')]('-')[0x0]],[_0x0876('0x4b')]);logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x3d917e[_0x0876('0x31')],util[_0x0876('0x2c')]({'id':this[_0x0876('0x14')][_0x3d917e['channel'][_0x0876('0x3b')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x3d917e['channel'][_0x0876('0x3b')]('-')[0x0]][_0x0876('0x40')]},{'showHidden':![],'depth':null}));this['emit'](util['format']('user:%s',this['agents'][_0x3d917e[_0x0876('0x45')]['split']('-')[0x0]][_0x0876('0x3f')]),_0x0876('0x99'),{'id':this[_0x0876('0x14')][_0x3d917e[_0x0876('0x45')][_0x0876('0x3b')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x3d917e['channel'][_0x0876('0x3b')]('-')[0x0]][_0x0876('0x40')]});for(var _0x397cea=0x0;_0x397cea0x0?!![]:![];if(!_0x734c2f){return this[_0x2d6f('0x17')](this[_0x2d6f('0x49')]['completeEvent']);}};VoiceQueueReport[_0x2d6f('0x3a')][_0x2d6f('0x19')]=function(_0x78a4dd){var _0x466cca=this[_0x2d6f('0x49')]['id'];if(this[_0x2d6f('0x49')][_0x2d6f('0x6c')][_0x466cca]&&this['summary'][_0x2d6f('0x6c')][_0x466cca][_0x78a4dd[_0x2d6f('0x63')]]){this['summary']['queuestatus'][_0x466cca][_0x78a4dd[_0x2d6f('0x63')]][_0x2d6f('0xf')]['push'](_0x78a4dd);}};VoiceQueueReport[_0x2d6f('0x3a')][_0x2d6f('0x14')]=function(_0x34d69d){var _0x5f3492=this;try{if(this[_0x2d6f('0x5c')](_0x34d69d)&&this['isNotNull'](_0x34d69d[_0x2d6f('0x53')])){logger[_0x2d6f('0x4e')](_0x2d6f('0x70'),util[_0x2d6f('0x44')](_0x34d69d,{'showHidden':![],'depth':null}));var _0x396620=this[_0x2d6f('0x11')][_0x34d69d[_0x2d6f('0x53')]];if(_0x396620){logger[_0x2d6f('0x4e')](_0x2d6f('0x71'),_0x396620[_0x2d6f('0x66')]);this[_0x2d6f('0x49')][_0x2d6f('0x5e')][_0x396620[_0x2d6f('0x66')]]={'summaryEvent':_0x34d69d};this[_0x2d6f('0x49')][_0x2d6f('0x72')]+=0x1;return ami[_0x2d6f('0x3e')]({'action':_0x2d6f('0x6c'),'queue':_0x396620['name']})['then'](function(_0x53ba13){if(!_0x5f3492[_0x2d6f('0x49')][_0x2d6f('0x6c')][_0x34d69d[_0x2d6f('0x63')]]){_0x5f3492[_0x2d6f('0x49')][_0x2d6f('0x6c')][_0x34d69d[_0x2d6f('0x63')]]={};}_0x5f3492[_0x2d6f('0x49')][_0x2d6f('0x6c')][_0x34d69d[_0x2d6f('0x63')]][_0x53ba13[_0x2d6f('0x63')]]={'queue':_0x396620['name'],'agents':[]};})['catch'](function(_0x468fe3){throw _0x468fe3;});}}}catch(_0x497214){logger['error'](_0x2d6f('0x64'),util[_0x2d6f('0x44')](_0x497214,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d6f('0x3a')][_0x2d6f('0x17')]=function(_0x1d8eb3){if(this[_0x2d6f('0x49')][_0x2d6f('0x72')]>0x0){this['summary'][_0x2d6f('0x73')]=_0x1d8eb3;return;}logger[_0x2d6f('0x4e')](_0x2d6f('0x74'),util['inspect'](_0x1d8eb3,{'showHidden':![],'depth':null}));this[_0x2d6f('0x49')]=initializeSummary();ami[_0x2d6f('0x4c')](_0x2d6f('0x75'),{});};VoiceQueueReport['prototype'][_0x2d6f('0x1d')]=function(_0x331d94){try{if(this[_0x2d6f('0x5c')](_0x331d94)){logger[_0x2d6f('0x4e')](_0x2d6f('0x76'),_0x331d94[_0x2d6f('0x77')],util['inspect'](_0x331d94,{'showHidden':![],'depth':null}));if(_[_0x2d6f('0x5d')](this[_0x2d6f('0xd')][_0x331d94[_0x2d6f('0x77')]])){this[_0x2d6f('0xd')][_0x331d94[_0x2d6f('0x77')]]=[];}if(_[_0x2d6f('0x5d')](this[_0x2d6f('0x10')][_0x331d94[_0x2d6f('0x77')]])){this[_0x2d6f('0x10')][_0x331d94['uniqueid']]={};}var _0x27533e=new QueueReport();_0x27533e['queue']=_0x331d94[_0x2d6f('0x53')];_0x27533e[_0x2d6f('0x6d')]=this[_0x2d6f('0x11')][_0x27533e[_0x2d6f('0x53')]]&&this[_0x2d6f('0x11')][_0x27533e['queue']][_0x2d6f('0x6d')]?this[_0x2d6f('0x11')][_0x27533e[_0x2d6f('0x53')]][_0x2d6f('0x6d')]||_0x2d6f('0x59'):_0x2d6f('0x59');_0x27533e[_0x2d6f('0x78')]=moment()[_0x2d6f('0x51')](_0x2d6f('0x79'));_0x27533e['position']=_0x331d94[_0x2d6f('0x7a')];_0x27533e[_0x2d6f('0x7b')]=_0x331d94[_0x2d6f('0x7b')];_0x27533e[_0x2d6f('0x77')]=_0x331d94['uniqueid'];_0x27533e['routealias']=this[_0x2d6f('0x10')][_0x331d94[_0x2d6f('0x77')]][_0x2d6f('0x7c')];logger[_0x2d6f('0x7d')](_0x2d6f('0x7e'),_0x27533e[_0x2d6f('0x53')],_0x27533e[_0x2d6f('0x6d')]);Object['assign'](_0x27533e,_[_0x2d6f('0x7f')](_0x331d94,_[_0x2d6f('0x80')](_0x27533e)));this[_0x2d6f('0xd')][_0x331d94[_0x2d6f('0x77')]][_0x2d6f('0x81')](_0x27533e);this[_0x2d6f('0x10')][_0x331d94[_0x2d6f('0x77')]]=_0x27533e;this['emitVoiceQueueChannelSave'](_0x27533e,'queuecallerjoin');}}catch(_0x58dbb4){logger[_0x2d6f('0x42')]('[%s][voiceQueueReport][queuecallerjoin]',_0x331d94['uniqueid'],util[_0x2d6f('0x44')](_0x58dbb4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d6f('0x3a')][_0x2d6f('0x1f')]=function(_0x1f83eb){try{if(this[_0x2d6f('0x5c')](_0x1f83eb)){logger[_0x2d6f('0x4e')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1f83eb['uniqueid'],util[_0x2d6f('0x44')](_0x1f83eb,{'showHidden':![],'depth':null}));if(this[_0x2d6f('0xd')][_0x1f83eb[_0x2d6f('0x77')]]){var _0x240106=_[_0x2d6f('0x82')](this['queueReports'][_0x1f83eb['uniqueid']]);_0x240106['queuecallercomplete']=![];_0x240106['queuecallercompleteAt']=null;_0x240106['holdtime']=_0x1f83eb[_0x2d6f('0x83')];_0x240106[_0x2d6f('0x84')]=_0x1f83eb[_0x2d6f('0x84')];_0x240106[_0x2d6f('0x1e')]=!![];_0x240106[_0x2d6f('0x85')]=moment()['format'](_0x2d6f('0x79'));_0x240106[_0x2d6f('0x56')]='ABANDONED';_0x240106[_0x2d6f('0x86')]=null;logger[_0x2d6f('0x7d')](_0x2d6f('0x87'),_0x240106[_0x2d6f('0x53')],_0x240106['type']);this[_0x2d6f('0x10')][_0x1f83eb[_0x2d6f('0x77')]]=_0x240106;this['emitVoiceQueueChannelRemove'](_0x240106,'queuecallerabandon');}}}catch(_0x11cb71){logger[_0x2d6f('0x42')](_0x2d6f('0x88'),_0x1f83eb[_0x2d6f('0x77')],util['inspect'](_0x11cb71,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d6f('0x3a')][_0x2d6f('0x89')]=function(_0x14019d){try{if(this[_0x2d6f('0x5c')](_0x14019d)){logger[_0x2d6f('0x4e')]('[%s][voiceQueueReport][queuecallerleave]',_0x14019d[_0x2d6f('0x77')],util['inspect'](_0x14019d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x14019d['uniqueid']]){var _0xfa2ec0=_[_0x2d6f('0x82')](this[_0x2d6f('0xd')][_0x14019d[_0x2d6f('0x77')]]);_0xfa2ec0['queuecallerleaveAt']=moment()[_0x2d6f('0x51')](_0x2d6f('0x79'));_0xfa2ec0[_0x2d6f('0x8a')]=_0x14019d[_0x2d6f('0x8a')];_0xfa2ec0[_0x2d6f('0x8b')]=_0x14019d['connectedlinename'];logger[_0x2d6f('0x7d')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0xfa2ec0[_0x2d6f('0x53')],_0xfa2ec0[_0x2d6f('0x6d')],_0x14019d['connectedlinenum'],_0x14019d['connectedlinename']);this[_0x2d6f('0x10')][_0x14019d['uniqueid']]=_0xfa2ec0;this[_0x2d6f('0x4d')](_0xfa2ec0,_0x2d6f('0x20'));}}}catch(_0x3e0720){logger[_0x2d6f('0x42')](_0x2d6f('0x8c'),_0x14019d[_0x2d6f('0x77')],util[_0x2d6f('0x44')](_0x3e0720,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d6f('0x3a')][_0x2d6f('0x23')]=function(_0x5aa46e){try{if(this[_0x2d6f('0x5c')](_0x5aa46e)){logger[_0x2d6f('0x4e')](_0x2d6f('0x8d'),_0x5aa46e[_0x2d6f('0x77')],util[_0x2d6f('0x44')](_0x5aa46e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5aa46e[_0x2d6f('0x77')]]){var _0x2671bb=_[_0x2d6f('0x82')](this['queueReports'][_0x5aa46e['uniqueid']]);_0x2671bb['queuecallercomplete']=!![];_0x2671bb[_0x2d6f('0x56')]=_0x2d6f('0x8e');logger[_0x2d6f('0x7d')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x2671bb['queue'],_0x2671bb['type']);}}}catch(_0xbb24be){logger['error'](_0x2d6f('0x8d'),_0x5aa46e[_0x2d6f('0x77')],util[_0x2d6f('0x44')](_0xbb24be,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d6f('0x3a')][_0x2d6f('0x21')]=function(_0x550032){try{if(this[_0x2d6f('0x5c')](_0x550032)){logger['debug'](_0x2d6f('0x8f'),_0x550032[_0x2d6f('0x77')],util['inspect'](_0x550032,{'showHidden':![],'depth':null}));if(this[_0x2d6f('0xd')][_0x550032['uniqueid']]){var _0x2f3f59=_[_0x2d6f('0x82')](this['queueReports'][_0x550032['uniqueid']]);_0x2f3f59['queuecallerabandon']=![];_0x2f3f59[_0x2d6f('0x85')]=null;_0x2f3f59[_0x2d6f('0x90')]=!![];_0x2f3f59[_0x2d6f('0x86')]=_0x550032[_0x2d6f('0x91')];_0x2f3f59[_0x2d6f('0x83')]=_0x550032[_0x2d6f('0x83')];_0x2f3f59[_0x2d6f('0x39')]=!![];_0x2f3f59[_0x2d6f('0x92')]=![];_0x2f3f59[_0x2d6f('0x93')]=null;if(!_0x2f3f59[_0x2d6f('0x94')]){if(_0x550032['reason']=='transfer'){_0x2f3f59[_0x2d6f('0x56')]=_0x2d6f('0x95');logger['info'](_0x2d6f('0x96'),_0x2f3f59['queue'],_0x2f3f59['type']);}else{if(_['startsWith'](_0x550032['channel'][_0x2d6f('0x97')](),'local/')){if(this[_0x2d6f('0xd')][_0x550032[_0x2d6f('0x98')]]){var _0x46fd17=_[_0x2d6f('0x82')](this[_0x2d6f('0xd')][_0x550032[_0x2d6f('0x98')]]);_0x46fd17[_0x2d6f('0x39')]=![];_0x46fd17[_0x2d6f('0x92')]=!![];_0x46fd17[_0x2d6f('0x93')]=moment(_0x2f3f59['queuecallerjoinAt'])[_0x2d6f('0x99')](_0x550032['holdtime'],_0x2d6f('0x9a'))[_0x2d6f('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x46fd17[_0x2d6f('0x56')]=_0x2d6f('0x9b');_0x46fd17[_0x2d6f('0x94')]=!![];_0x46fd17[_0x2d6f('0x9c')]='FORWARD';_0x46fd17[_0x2d6f('0x9d')]=_0x550032[_0x2d6f('0x9e')];_0x46fd17[_0x2d6f('0x9f')]=_0x550032['uniqueid'];logger[_0x2d6f('0x7d')](_0x2d6f('0xa0'),_0x46fd17[_0x2d6f('0x53')],_0x46fd17[_0x2d6f('0x6d')]);var _0xf64aed=this['queueReports'][_0x550032[_0x2d6f('0x98')]];this[_0x2d6f('0xd')][_0x550032['linkedid']]=this[_0x2d6f('0xd')][_0x550032[_0x2d6f('0x77')]];this[_0x2d6f('0xd')][_0x550032[_0x2d6f('0x77')]]=_0xf64aed;}}else{_0x2f3f59[_0x2d6f('0x56')]=_0x2d6f('0xa1')+_0x550032[_0x2d6f('0xa2')]['toUpperCase']();logger[_0x2d6f('0x7d')](_0x2d6f('0xa3'),_0x2f3f59['queue'],_0x2f3f59['type'],_0x2f3f59[_0x2d6f('0x56')]);}}}this[_0x2d6f('0x10')][_0x550032[_0x2d6f('0x77')]]=_0x2f3f59;}}}catch(_0x35ce5a){logger[_0x2d6f('0x42')](_0x2d6f('0x8f'),_0x550032['uniqueid'],util[_0x2d6f('0x44')](_0x35ce5a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d6f('0x3a')][_0x2d6f('0x25')]=function(_0x480749){try{if(this[_0x2d6f('0x5c')](_0x480749)){logger[_0x2d6f('0x4e')]('[%s][voiceQueueReport][varset]',_0x480749[_0x2d6f('0x77')],util[_0x2d6f('0x44')](_0x480749,{'showHidden':![],'depth':null}));this[_0x2d6f('0xa4')](_0x480749[_0x2d6f('0x77')],_[_0x2d6f('0x80')](_0x480749[_0x2d6f('0xa5')])[0x0],_0x480749[_0x2d6f('0xa6')]);if(this[_0x2d6f('0xd')][_0x480749[_0x2d6f('0x77')]]){var _0x1f5ad0=_[_0x2d6f('0x82')](this[_0x2d6f('0xd')][_0x480749[_0x2d6f('0x77')]]);if(_0x1f5ad0){if(this[_0x2d6f('0x5c')](_0x480749[_0x2d6f('0xa5')])&&this[_0x2d6f('0x5c')](_0x480749[_0x2d6f('0xa5')][_0x2d6f('0x6c')])){switch(_0x480749[_0x2d6f('0xa6')]){case'CONTINUE':_0x1f5ad0[_0x2d6f('0x92')]=![];_0x1f5ad0[_0x2d6f('0x93')]=null;break;case _0x2d6f('0xa7'):_0x1f5ad0[_0x2d6f('0xa8')]=_0x2d6f('0xa9');_0x1f5ad0[_0x2d6f('0x92')]=!![];_0x1f5ad0[_0x2d6f('0x93')]=moment()[_0x2d6f('0x51')](_0x2d6f('0x79'));_0x1f5ad0[_0x2d6f('0xaa')]=moment()[_0x2d6f('0x51')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x2d6f('0x4e')](_0x2d6f('0xab'),_0x480749['uniqueid'],util['inspect'](_0x1f5ad0,{'showHidden':![],'depth':null}));ami[_0x2d6f('0x4c')]('custom:timeout',_0x1f5ad0);break;default:_0x1f5ad0[_0x2d6f('0x92')]=!![];_0x1f5ad0[_0x2d6f('0x93')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1f5ad0[_0x2d6f('0xaa')]=moment()['format'](_0x2d6f('0x79'));}_0x1f5ad0[_0x2d6f('0x1e')]=![];_0x1f5ad0[_0x2d6f('0x85')]=null;_0x1f5ad0['queuecallerexitreason']=_0x480749[_0x2d6f('0xa6')];this[_0x2d6f('0x10')][_0x480749['uniqueid']]=_0x1f5ad0;this['emitVoiceQueueChannelRemove'](_0x1f5ad0,_0x2d6f('0x24'));}else if(this[_0x2d6f('0x5c')](_0x480749['variable'])&&this[_0x2d6f('0x5c')](_0x480749[_0x2d6f('0xa5')]['queueposition'])){if(!_0x1f5ad0[_0x2d6f('0x1e')]){_0x1f5ad0['queuecallerexit']=!![];_0x1f5ad0[_0x2d6f('0x93')]=moment()[_0x2d6f('0x51')](_0x2d6f('0x79'));_0x1f5ad0[_0x2d6f('0x56')]=_0x2d6f('0xac');_0x1f5ad0[_0x2d6f('0xaa')]=moment()[_0x2d6f('0x51')](_0x2d6f('0x79'));this[_0x2d6f('0x10')][_0x480749[_0x2d6f('0x77')]]=_0x1f5ad0;}}logger[_0x2d6f('0x7d')](_0x2d6f('0xad'),_0x480749[_0x2d6f('0x77')],_0x1f5ad0[_0x2d6f('0x53')],_0x1f5ad0[_0x2d6f('0x6d')],_[_0x2d6f('0x80')](_0x480749[_0x2d6f('0xa5')])[0x0],_0x480749[_0x2d6f('0xa6')]);_0x1f5ad0[_0x2d6f('0x45')]=this[_0x2d6f('0x45')][_0x480749[_0x2d6f('0x77')]];}}}}catch(_0x4b3b2d){logger[_0x2d6f('0x42')]('[%s][voiceQueueReport][varset]',_0x480749[_0x2d6f('0x77')],util[_0x2d6f('0x44')](_0x4b3b2d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d6f('0x3a')][_0x2d6f('0xa4')]=function(_0x1d7796,_0x2831a5,_0x106737){var _0x728c4e=[_0x2d6f('0xae'),_0x2d6f('0xaf'),_0x2d6f('0xb0'),_0x2d6f('0xb1'),_0x2d6f('0xb2'),_0x2d6f('0xb3'),_0x2d6f('0xb4'),'rtpaudioqosrttbridged','sipcallid',_0x2d6f('0xb5'),_0x2d6f('0xb6'),'bridgepvtcallid',_0x2d6f('0xb7'),_0x2d6f('0xb8'),_0x2d6f('0xb9'),_0x2d6f('0xba'),'membername','memberpenalty',_0x2d6f('0xbb')];if(!_[_0x2d6f('0x3d')](_0x2831a5)&&!_['includes'](_0x728c4e,_0x2831a5)){if(_[_0x2d6f('0x5d')](this[_0x2d6f('0x45')][_0x1d7796])){this['variables'][_0x1d7796]={};}this[_0x2d6f('0x45')][_0x1d7796][_0x2831a5]=_0x106737;}};VoiceQueueReport['prototype'][_0x2d6f('0xbc')]=function(_0x3eb835,_0x4b292d,_0x4be098){try{var _0x46b2c1={};if(this[_0x2d6f('0xd')][_0x3eb835]){for(var _0x46fca0=0x0;_0x46fca00x0?!![]:![];if(!_0x422685){return this['syncQueueSummaryComplete'](this['summary'][_0x2d3f('0x6f')]);}};VoiceQueueReport['prototype'][_0x2d3f('0x19')]=function(_0x2a2005){var _0x64dbc9=this['summary']['id'];if(this[_0x2d3f('0x13')][_0x2d3f('0x63')][_0x64dbc9]&&this[_0x2d3f('0x13')][_0x2d3f('0x63')][_0x64dbc9][_0x2a2005['actionid']]){this[_0x2d3f('0x13')][_0x2d3f('0x63')][_0x64dbc9][_0x2a2005[_0x2d3f('0x62')]][_0x2d3f('0xf')][_0x2d3f('0x70')](_0x2a2005);}};VoiceQueueReport['prototype']['syncQueueSummary']=function(_0x35caa1){var _0x44efb7=this;try{if(this[_0x2d3f('0x71')](_0x35caa1)&&this[_0x2d3f('0x71')](_0x35caa1[_0x2d3f('0x53')])){logger['debug'](_0x2d3f('0x72'),util[_0x2d3f('0x42')](_0x35caa1,{'showHidden':![],'depth':null}));var _0x3a4d4a=this[_0x2d3f('0x11')][_0x35caa1[_0x2d3f('0x53')]];if(_0x3a4d4a){logger[_0x2d3f('0x4d')](_0x2d3f('0x73'),_0x3a4d4a['name']);this[_0x2d3f('0x13')][_0x2d3f('0x66')][_0x3a4d4a[_0x2d3f('0x5d')]]={'summaryEvent':_0x35caa1};this['summary']['statusRequests']+=0x1;return ami[_0x2d3f('0x5f')]({'action':_0x2d3f('0x63'),'queue':_0x3a4d4a[_0x2d3f('0x5d')]})[_0x2d3f('0x74')](function(_0x381c18){if(!_0x44efb7[_0x2d3f('0x13')][_0x2d3f('0x63')][_0x35caa1[_0x2d3f('0x62')]]){_0x44efb7[_0x2d3f('0x13')][_0x2d3f('0x63')][_0x35caa1[_0x2d3f('0x62')]]={};}_0x44efb7[_0x2d3f('0x13')][_0x2d3f('0x63')][_0x35caa1[_0x2d3f('0x62')]][_0x381c18[_0x2d3f('0x62')]]={'queue':_0x3a4d4a['name'],'agents':[]};})[_0x2d3f('0x3e')](function(_0x2aa097){throw _0x2aa097;});}}}catch(_0x43ebab){logger[_0x2d3f('0x40')]('[voiceQueueReport][queuesummary]',util[_0x2d3f('0x42')](_0x43ebab,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d3f('0xa')][_0x2d3f('0x16')]=function(_0x45b78e){if(this['summary']['statusRequests']>0x0){this[_0x2d3f('0x13')]['completeEvent']=_0x45b78e;return;}logger[_0x2d3f('0x4d')](_0x2d3f('0x75'),util[_0x2d3f('0x42')](_0x45b78e,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami[_0x2d3f('0x4b')](_0x2d3f('0x76'),{});};VoiceQueueReport[_0x2d3f('0xa')][_0x2d3f('0x1d')]=function(_0x4646f6){try{if(this[_0x2d3f('0x71')](_0x4646f6)){logger[_0x2d3f('0x4d')]('[%s][voiceQueueReport][queuecallerjoin]',_0x4646f6[_0x2d3f('0x50')],util[_0x2d3f('0x42')](_0x4646f6,{'showHidden':![],'depth':null}));if(_[_0x2d3f('0x5e')](this[_0x2d3f('0x43')][_0x4646f6[_0x2d3f('0x50')]])){this['queueReports'][_0x4646f6[_0x2d3f('0x50')]]=[];}if(_[_0x2d3f('0x5e')](this[_0x2d3f('0x10')][_0x4646f6[_0x2d3f('0x50')]])){this[_0x2d3f('0x10')][_0x4646f6['uniqueid']]={};}var _0x3703f5=new QueueReport();_0x3703f5['queue']=_0x4646f6[_0x2d3f('0x53')];_0x3703f5[_0x2d3f('0x5a')]=this[_0x2d3f('0x11')][_0x3703f5[_0x2d3f('0x53')]]&&this[_0x2d3f('0x11')][_0x3703f5[_0x2d3f('0x53')]][_0x2d3f('0x5a')]?this['voiceQueues'][_0x3703f5[_0x2d3f('0x53')]][_0x2d3f('0x5a')]||'inbound':_0x2d3f('0x5b');_0x3703f5[_0x2d3f('0x77')]=moment()[_0x2d3f('0x51')](_0x2d3f('0x78'));_0x3703f5[_0x2d3f('0x79')]=_0x4646f6[_0x2d3f('0x79')];_0x3703f5[_0x2d3f('0x7a')]=_0x4646f6[_0x2d3f('0x7a')];_0x3703f5[_0x2d3f('0x50')]=_0x4646f6[_0x2d3f('0x50')];_0x3703f5[_0x2d3f('0x7b')]=this[_0x2d3f('0x10')][_0x4646f6['uniqueid']][_0x2d3f('0x7b')];logger[_0x2d3f('0x7c')](_0x2d3f('0x7d'),_0x3703f5[_0x2d3f('0x53')],_0x3703f5[_0x2d3f('0x5a')]);Object[_0x2d3f('0x6a')](_0x3703f5,_[_0x2d3f('0x7e')](_0x4646f6,_[_0x2d3f('0x7f')](_0x3703f5)));this[_0x2d3f('0x43')][_0x4646f6['uniqueid']][_0x2d3f('0x70')](_0x3703f5);this[_0x2d3f('0x10')][_0x4646f6[_0x2d3f('0x50')]]=_0x3703f5;this[_0x2d3f('0x4c')](_0x3703f5,'queuecallerjoin');}}catch(_0x1b8816){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x4646f6[_0x2d3f('0x50')],util[_0x2d3f('0x42')](_0x1b8816,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d3f('0xa')][_0x2d3f('0x1f')]=function(_0xef8d43){try{if(this['isNotNull'](_0xef8d43)){logger[_0x2d3f('0x4d')](_0x2d3f('0x80'),_0xef8d43[_0x2d3f('0x50')],util['inspect'](_0xef8d43,{'showHidden':![],'depth':null}));if(this[_0x2d3f('0x43')][_0xef8d43[_0x2d3f('0x50')]]){var _0x39a6cf=_[_0x2d3f('0x81')](this[_0x2d3f('0x43')][_0xef8d43['uniqueid']]);_0x39a6cf[_0x2d3f('0x3a')]=![];_0x39a6cf[_0x2d3f('0x82')]=null;_0x39a6cf[_0x2d3f('0x83')]=_0xef8d43['holdtime'];_0x39a6cf[_0x2d3f('0x84')]=_0xef8d43[_0x2d3f('0x84')];_0x39a6cf[_0x2d3f('0x1e')]=!![];_0x39a6cf[_0x2d3f('0x85')]=moment()['format'](_0x2d3f('0x78'));_0x39a6cf[_0x2d3f('0x86')]=_0x2d3f('0x87');_0x39a6cf[_0x2d3f('0x88')]=null;logger['info'](_0x2d3f('0x89'),_0x39a6cf[_0x2d3f('0x53')],_0x39a6cf[_0x2d3f('0x5a')]);this['channels'][_0xef8d43['uniqueid']]=_0x39a6cf;this[_0x2d3f('0x49')](_0x39a6cf,_0x2d3f('0x1e'));}}}catch(_0x577239){logger[_0x2d3f('0x40')](_0x2d3f('0x80'),_0xef8d43[_0x2d3f('0x50')],util[_0x2d3f('0x42')](_0x577239,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d3f('0xa')]['syncQueueCallerLeave']=function(_0x3769b5){try{if(this['isNotNull'](_0x3769b5)){logger[_0x2d3f('0x4d')](_0x2d3f('0x8a'),_0x3769b5[_0x2d3f('0x50')],util[_0x2d3f('0x42')](_0x3769b5,{'showHidden':![],'depth':null}));if(this[_0x2d3f('0x43')][_0x3769b5['uniqueid']]){var _0x5143be=_[_0x2d3f('0x81')](this['queueReports'][_0x3769b5['uniqueid']]);_0x5143be[_0x2d3f('0x8b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5143be['connectedlinenum']=_0x3769b5[_0x2d3f('0x8c')];_0x5143be['connectedlinename']=_0x3769b5[_0x2d3f('0x8d')];logger[_0x2d3f('0x7c')](_0x2d3f('0x8e'),_0x5143be['queue'],_0x5143be['type'],_0x3769b5[_0x2d3f('0x8c')],_0x3769b5[_0x2d3f('0x8d')]);this['channels'][_0x3769b5['uniqueid']]=_0x5143be;this[_0x2d3f('0x4c')](_0x5143be,_0x2d3f('0x20'));}}}catch(_0x4b13db){logger[_0x2d3f('0x40')](_0x2d3f('0x8a'),_0x3769b5['uniqueid'],util[_0x2d3f('0x42')](_0x4b13db,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d3f('0xa')][_0x2d3f('0x8f')]=function(_0x1854d2){try{if(this[_0x2d3f('0x71')](_0x1854d2)){logger[_0x2d3f('0x4d')](_0x2d3f('0x90'),_0x1854d2['uniqueid'],util['inspect'](_0x1854d2,{'showHidden':![],'depth':null}));if(this[_0x2d3f('0x43')][_0x1854d2[_0x2d3f('0x50')]]){var _0x2d16b8=_[_0x2d3f('0x81')](this[_0x2d3f('0x43')][_0x1854d2[_0x2d3f('0x50')]]);_0x2d16b8['queuecallercomplete']=!![];_0x2d16b8[_0x2d3f('0x86')]=_0x2d3f('0x91');logger[_0x2d3f('0x7c')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x2d16b8['queue'],_0x2d16b8[_0x2d3f('0x5a')]);}}}catch(_0x16d641){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x1854d2[_0x2d3f('0x50')],util[_0x2d3f('0x42')](_0x16d641,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d3f('0xa')][_0x2d3f('0x22')]=function(_0x3f4a5d){try{if(this[_0x2d3f('0x71')](_0x3f4a5d)){logger[_0x2d3f('0x4d')]('[%s][voiceQueueReport][agentcomplete]',_0x3f4a5d[_0x2d3f('0x50')],util[_0x2d3f('0x42')](_0x3f4a5d,{'showHidden':![],'depth':null}));if(this[_0x2d3f('0x43')][_0x3f4a5d[_0x2d3f('0x50')]]){var _0x546308=_[_0x2d3f('0x81')](this['queueReports'][_0x3f4a5d[_0x2d3f('0x50')]]);_0x546308[_0x2d3f('0x1e')]=![];_0x546308[_0x2d3f('0x85')]=null;_0x546308[_0x2d3f('0x92')]=!![];_0x546308['lastAssignedTo']=_0x3f4a5d['membername'];_0x546308[_0x2d3f('0x83')]=_0x3f4a5d[_0x2d3f('0x83')];_0x546308[_0x2d3f('0x3a')]=!![];_0x546308[_0x2d3f('0x39')]=![];_0x546308[_0x2d3f('0x93')]=null;if(!_0x546308['transfer']){if(_0x3f4a5d['reason']=='transfer'){_0x546308['queuecallerexitreason']='COMPLETED';logger['info'](_0x2d3f('0x94'),_0x546308[_0x2d3f('0x53')],_0x546308[_0x2d3f('0x5a')]);}else{if(_[_0x2d3f('0x95')](_0x3f4a5d[_0x2d3f('0x3d')]['toLowerCase'](),_0x2d3f('0x96'))){if(this['queueReports'][_0x3f4a5d[_0x2d3f('0x97')]]){var _0x596a34=_[_0x2d3f('0x81')](this[_0x2d3f('0x43')][_0x3f4a5d['linkedid']]);_0x596a34[_0x2d3f('0x3a')]=![];_0x596a34[_0x2d3f('0x39')]=!![];_0x596a34['queuecallerexitAt']=moment(_0x546308['queuecallerjoinAt'])[_0x2d3f('0x98')](_0x3f4a5d['holdtime'],_0x2d3f('0x99'))['format'](_0x2d3f('0x78'));_0x596a34[_0x2d3f('0x86')]=_0x2d3f('0x9a');_0x596a34['transfer']=!![];_0x596a34[_0x2d3f('0x9b')]=_0x2d3f('0x9c');_0x596a34[_0x2d3f('0x9d')]=_0x3f4a5d['destexten'];_0x596a34[_0x2d3f('0x9e')]=_0x3f4a5d[_0x2d3f('0x50')];logger[_0x2d3f('0x7c')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x596a34[_0x2d3f('0x53')],_0x596a34[_0x2d3f('0x5a')]);var _0x3228f3=this[_0x2d3f('0x43')][_0x3f4a5d[_0x2d3f('0x97')]];this[_0x2d3f('0x43')][_0x3f4a5d[_0x2d3f('0x97')]]=this[_0x2d3f('0x43')][_0x3f4a5d['uniqueid']];this[_0x2d3f('0x43')][_0x3f4a5d[_0x2d3f('0x50')]]=_0x3228f3;}}else{_0x546308['queuecallerexitreason']=_0x2d3f('0x9f')+_0x3f4a5d['reason']['toUpperCase']();logger[_0x2d3f('0x7c')](_0x2d3f('0xa0'),_0x546308['queue'],_0x546308[_0x2d3f('0x5a')],_0x546308[_0x2d3f('0x86')]);}}}this['channels'][_0x3f4a5d[_0x2d3f('0x50')]]=_0x546308;}}}catch(_0x5bc9ce){logger['error'](_0x2d3f('0xa1'),_0x3f4a5d[_0x2d3f('0x50')],util[_0x2d3f('0x42')](_0x5bc9ce,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d3f('0xa')][_0x2d3f('0x25')]=function(_0x37c1f4){try{if(this[_0x2d3f('0x71')](_0x37c1f4)){logger[_0x2d3f('0x4d')]('[%s][voiceQueueReport][varset]',_0x37c1f4[_0x2d3f('0x50')],util[_0x2d3f('0x42')](_0x37c1f4,{'showHidden':![],'depth':null}));this['addVariable'](_0x37c1f4[_0x2d3f('0x50')],_[_0x2d3f('0x7f')](_0x37c1f4[_0x2d3f('0xa2')])[0x0],_0x37c1f4[_0x2d3f('0xa3')]);if(this[_0x2d3f('0x43')][_0x37c1f4[_0x2d3f('0x50')]]){var _0x2d746b=_[_0x2d3f('0x81')](this[_0x2d3f('0x43')][_0x37c1f4[_0x2d3f('0x50')]]);if(_0x2d746b){if(this[_0x2d3f('0x71')](_0x37c1f4['variable'])&&this[_0x2d3f('0x71')](_0x37c1f4['variable'][_0x2d3f('0x63')])){switch(_0x37c1f4['value']){case'CONTINUE':_0x2d746b[_0x2d3f('0x39')]=![];_0x2d746b[_0x2d3f('0x93')]=null;break;case _0x2d3f('0xa4'):_0x2d746b['lastevent']='timeout';_0x2d746b[_0x2d3f('0x39')]=!![];_0x2d746b[_0x2d3f('0x93')]=moment()['format'](_0x2d3f('0x78'));_0x2d746b['queuecallerleaveAt']=moment()[_0x2d3f('0x51')](_0x2d3f('0x78'));logger[_0x2d3f('0x4d')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x37c1f4['uniqueid'],util[_0x2d3f('0x42')](_0x2d746b,{'showHidden':![],'depth':null}));ami[_0x2d3f('0x4b')](_0x2d3f('0xa5'),_0x2d746b);break;default:_0x2d746b['queuecallerexit']=!![];_0x2d746b[_0x2d3f('0x93')]=moment()[_0x2d3f('0x51')](_0x2d3f('0x78'));_0x2d746b[_0x2d3f('0x8b')]=moment()[_0x2d3f('0x51')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2d746b['queuecallerabandon']=![];_0x2d746b[_0x2d3f('0x85')]=null;_0x2d746b[_0x2d3f('0x86')]=_0x37c1f4['value'];this['channels'][_0x37c1f4[_0x2d3f('0x50')]]=_0x2d746b;this[_0x2d3f('0x49')](_0x2d746b,'varset');}else if(this['isNotNull'](_0x37c1f4[_0x2d3f('0xa2')])&&this[_0x2d3f('0x71')](_0x37c1f4[_0x2d3f('0xa2')][_0x2d3f('0xa6')])){if(!_0x2d746b[_0x2d3f('0x1e')]){_0x2d746b[_0x2d3f('0x39')]=!![];_0x2d746b['queuecallerexitAt']=moment()[_0x2d3f('0x51')](_0x2d3f('0x78'));_0x2d746b['queuecallerexitreason']='EXITWITHKEY';_0x2d746b[_0x2d3f('0x8b')]=moment()[_0x2d3f('0x51')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2d3f('0x10')][_0x37c1f4['uniqueid']]=_0x2d746b;}}logger['info'](_0x2d3f('0xa7'),_0x37c1f4[_0x2d3f('0x50')],_0x2d746b[_0x2d3f('0x53')],_0x2d746b[_0x2d3f('0x5a')],_[_0x2d3f('0x7f')](_0x37c1f4[_0x2d3f('0xa2')])[0x0],_0x37c1f4['value']);_0x2d746b[_0x2d3f('0x45')]=this[_0x2d3f('0x45')][_0x37c1f4[_0x2d3f('0x50')]];}}}}catch(_0x58682e){logger[_0x2d3f('0x40')]('[%s][voiceQueueReport][varset]',_0x37c1f4['uniqueid'],util['inspect'](_0x58682e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d3f('0xa')][_0x2d3f('0xa8')]=function(_0x47e871,_0xd03e53,_0x47ee05){var _0x591b65=[_0x2d3f('0xa9'),_0x2d3f('0xaa'),_0x2d3f('0xab'),_0x2d3f('0xac'),_0x2d3f('0xad'),_0x2d3f('0xae'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0x2d3f('0xaf'),_0x2d3f('0xb0'),_0x2d3f('0xb1'),_0x2d3f('0xb2'),_0x2d3f('0xb3'),'memberdynamic','memberinterface',_0x2d3f('0xb4'),_0x2d3f('0xb5'),_0x2d3f('0xb6'),'memberrealtime'];if(!_['isNil'](_0xd03e53)&&!_[_0x2d3f('0xb7')](_0x591b65,_0xd03e53)){if(_[_0x2d3f('0x5e')](this[_0x2d3f('0x45')][_0x47e871])){this[_0x2d3f('0x45')][_0x47e871]={};}this[_0x2d3f('0x45')][_0x47e871][_0xd03e53]=_0x47ee05;}};VoiceQueueReport[_0x2d3f('0xa')]['handleHangup']=function(_0x53c294,_0x29e42b,_0x13dfb3){try{var _0x18161a={};if(this[_0x2d3f('0x43')][_0x53c294]){for(var _0x2c9ec6=0x0;_0x2c9ec6=0x0?moment(_0x27161c['endtime'])[_0xb22a('0x1b')](_0x27161c[_0xb22a('0x19')],_0xb22a('0xe')):null,'data1':_0xb22a('0x1c'),'data2':_0x27161c[_0xb22a('0x13')],'data3':_0x27161c[_0xb22a('0x11')],'data4':_0x27161c[_0xb22a('0x1d')]||null,'role':_0xb22a('0x1e'),'internal':_0x27161c['accountcode']?_[_0xb22a('0x14')](_0x27161c['accountcode']):undefined,'uniqueid':_0x27161c[_0xb22a('0x15')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xf1ee=['TALKING','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','starttime','endtime','outbound','dialstring','lodash','util','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','interface','format','SIP/%s'];(function(_0x1ac2ae,_0x51c85a){var _0x4b23bd=function(_0x37f36b){while(--_0x37f36b){_0x1ac2ae['push'](_0x1ac2ae['shift']());}};_0x4b23bd(++_0x51c85a);}(_0xf1ee,0x1db));var _0xef1e=function(_0x2174d1,_0x170945){_0x2174d1=_0x2174d1-0x0;var _0x519363=_0xf1ee[_0x2174d1];return _0x519363;};'use strict';var moment=require('moment');var _=require(_0xef1e('0x0'));var util=require(_0xef1e('0x1'));var client=require('../client');exports[_0xef1e('0x2')]=function(_0x395916){var _0x14262b=_0x395916['queuecallercompleteAt']||_0x395916[_0xef1e('0x3')];return client[_0xef1e('0x4')](_0xef1e('0x5'),{'body':{'channel':_0xef1e('0x6'),'membername':_0x395916[_0xef1e('0x7')],'interface':_['isNil'](_0x395916[_0xef1e('0x8')])?util[_0xef1e('0x9')](_0xef1e('0xa'),_0x395916[_0xef1e('0x7')]):_0x395916['interface'],'type':_0xef1e('0xb'),'enterAt':_0x395916['queuecallerleaveAt'],'exitAt':_0x14262b,'duration':moment(_0x14262b)[_0xef1e('0xc')](_0x395916[_0xef1e('0xd')],_0xef1e('0xe')),'data1':_0xef1e('0xf'),'data2':_0x395916[_0xef1e('0x10')],'data3':_0x395916[_0xef1e('0x11')],'data4':null,'data5':_0x395916[_0xef1e('0x12')],'role':_0xef1e('0x13'),'internal':_0x395916[_0xef1e('0x14')]?_[_0xef1e('0x15')](_0x395916[_0xef1e('0x14')]):undefined,'uniqueid':_0x395916[_0xef1e('0x16')]},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0x13736e){return client[_0xef1e('0x4')](_0xef1e('0x5'),{'body':{'channel':_0xef1e('0x6'),'membername':_0x13736e['membername'],'interface':_0x13736e[_0xef1e('0x8')],'type':_0xef1e('0xb'),'enterAt':_0x13736e[_0xef1e('0x17')],'exitAt':_0x13736e[_0xef1e('0x18')],'duration':moment(_0x13736e[_0xef1e('0x18')])[_0xef1e('0xc')](_0x13736e['starttime'],'seconds')>=0x0?moment(_0x13736e['endtime'])[_0xef1e('0xc')](_0x13736e[_0xef1e('0x17')],_0xef1e('0xe')):null,'data1':_0xef1e('0x19'),'data2':_0x13736e['accountcode'],'data3':_0x13736e[_0xef1e('0x11')],'data4':_0x13736e[_0xef1e('0x1a')]||null,'role':_0xef1e('0x13'),'internal':_0x13736e[_0xef1e('0x14')]?_[_0xef1e('0x15')](_0x13736e[_0xef1e('0x14')]):undefined,'uniqueid':_0x13736e[_0xef1e('0x16')]},'log':_0xef1e('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 54f2c7a..37e744e 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 _0x2c5b=['Request','ShowSetting','stopRecordingOnTransfer','../client'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x2c5b,0x193));var _0xb2c5=function(_0x618a3c,_0x76f867){_0x618a3c=_0x618a3c-0x0;var _0x2efd38=_0x2c5b[_0x618a3c];return _0x2efd38;};'use strict';var client=require(_0xb2c5('0x0'));exports['getSettings']=function(){return client[_0xb2c5('0x1')](_0xb2c5('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb2c5('0x3'),'previewRecallmeReminderInterval']},'log':'GetSettings'});}; \ No newline at end of file +var _0x6215=['../client','getSettings','Request','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings'];(function(_0x723288,_0x361804){var _0x45fecf=function(_0x39fbe1){while(--_0x39fbe1){_0x723288['push'](_0x723288['shift']());}};_0x45fecf(++_0x361804);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x5621('0x0'));exports[_0x5621('0x1')]=function(){return client[_0x5621('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5621('0x3'),_0x5621('0x4')]},'log':_0x5621('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 34de1e1..2a28677 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 _0x2f0c=['getTemplates','Request','name','html','../client'];(function(_0x5ca6b7,_0x1a4f32){var _0x2d7743=function(_0x569d42){while(--_0x569d42){_0x5ca6b7['push'](_0x5ca6b7['shift']());}};_0x2d7743(++_0x1a4f32);}(_0x2f0c,0x1b2));var _0xc2f0=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0x2f0c[_0x19ac6e];return _0x1cdcf3;};'use strict';var client=require(_0xc2f0('0x0'));exports[_0xc2f0('0x1')]=function(_0x5390d7){return function(_0x5cb284){return client[_0xc2f0('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xc2f0('0x3'),_0xc2f0('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x47b4=['Request','GetTemplate'];(function(_0x1d6121,_0x557ec9){var _0x23f10e=function(_0x259c44){while(--_0x259c44){_0x1d6121['push'](_0x1d6121['shift']());}};_0x23f10e(++_0x557ec9);}(_0x47b4,0x144));var _0x447b=function(_0x17e3ae,_0x1d80c4){_0x17e3ae=_0x17e3ae-0x0;var _0x4cc881=_0x47b4[_0x17e3ae];return _0x4cc881;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x4c2319){return function(_0x2ffc0b){return client[_0x447b('0x0')](_0x447b('0x1'),{'options':{'raw':!![],'attributes':['id','name','html']},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 00cffc1..0d3f48a 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 _0x07a7=['Action','action','data1','data2','data3','data4','data5','data6','data7','../client','getTriggers','Request','name','channel','status','AllConditions','field','operator','value','Condition','AnyConditions'];(function(_0x273146,_0x4c7d6b){var _0x2789dc=function(_0x421582){while(--_0x421582){_0x273146['push'](_0x273146['shift']());}};_0x2789dc(++_0x4c7d6b);}(_0x07a7,0x87));var _0x707a=function(_0x5a0e87,_0x5de9e3){_0x5a0e87=_0x5a0e87-0x0;var _0x1036ee=_0x07a7[_0x5a0e87];return _0x1036ee;};'use strict';var client=require(_0x707a('0x0'));exports[_0x707a('0x1')]=function(_0x5f4b8a){return function(_0xf77377){return client[_0x707a('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x707a('0x3'),_0x707a('0x4'),_0x707a('0x5')],'include':[{'model':'Condition','as':_0x707a('0x6'),'attributes':['id',_0x707a('0x7'),_0x707a('0x8'),_0x707a('0x9')]},{'model':_0x707a('0xa'),'as':_0x707a('0xb'),'attributes':['id',_0x707a('0x7'),_0x707a('0x8'),_0x707a('0x9')]},{'model':_0x707a('0xc'),'as':'Actions','attributes':['id',_0x707a('0xd'),_0x707a('0xe'),_0x707a('0xf'),_0x707a('0x10'),_0x707a('0x11'),_0x707a('0x12'),_0x707a('0x13'),_0x707a('0x14')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x1e07=['data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','Condition','AllConditions','field','operator','value','AnyConditions','Actions','action','data1','data2','data3'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x1e07,0x11f));var _0x71e0=function(_0xa97b39,_0x1b4719){_0xa97b39=_0xa97b39-0x0;var _0x1098be=_0x1e07[_0xa97b39];return _0x1098be;};'use strict';var client=require(_0x71e0('0x0'));exports[_0x71e0('0x1')]=function(_0x279cf2){return function(_0x1ce292){return client[_0x71e0('0x2')](_0x71e0('0x3'),{'options':{'raw':![],'attributes':['id',_0x71e0('0x4'),_0x71e0('0x5'),'status'],'include':[{'model':_0x71e0('0x6'),'as':_0x71e0('0x7'),'attributes':['id',_0x71e0('0x8'),_0x71e0('0x9'),_0x71e0('0xa')]},{'model':'Condition','as':_0x71e0('0xb'),'attributes':['id',_0x71e0('0x8'),_0x71e0('0x9'),_0x71e0('0xa')]},{'model':'Action','as':_0x71e0('0xc'),'attributes':['id',_0x71e0('0xd'),_0x71e0('0xe'),_0x71e0('0xf'),_0x71e0('0x10'),'data4','data5',_0x71e0('0x11'),_0x71e0('0x12')]}]},'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 132901a..8eb0662 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 _0x30df=['registry','defaultuser','../client','Request','GetTrunk'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x30df,0x101));var _0xf30d=function(_0x4f6e4c,_0x26d517){_0x4f6e4c=_0x4f6e4c-0x0;var _0xdbb151=_0x30df[_0x4f6e4c];return _0xdbb151;};'use strict';var client=require(_0xf30d('0x0'));exports['getTrunks']=function(_0x292dbe){return function(_0x3da656){return client[_0xf30d('0x1')](_0xf30d('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xf30d('0x3'),_0xf30d('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x6263=['../client','getTrunks','Request','name','registry','defaultuser','GetTrunk'];(function(_0xabc073,_0x372170){var _0x310e80=function(_0x3f231b){while(--_0x3f231b){_0xabc073['push'](_0xabc073['shift']());}};_0x310e80(++_0x372170);}(_0x6263,0x19d));var _0x3626=function(_0x2e0720,_0x2c3ea2){_0x2e0720=_0x2e0720-0x0;var _0xf36159=_0x6263[_0x2e0720];return _0xf36159;};'use strict';var client=require(_0x3626('0x0'));exports[_0x3626('0x1')]=function(_0x403142){return function(_0x408650){return client[_0x3626('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x3626('0x3'),_0x3626('0x4'),_0x3626('0x5')]},'log':_0x3626('0x6')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index af972b8..a9ac9ca 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 _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file +var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 007ad3f..664e332 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 _0x5fc8=['CreateVoiceAgentReport','Request','UpdateVoiceAgentReport','../client','create'];(function(_0x28d231,_0x55888a){var _0x3814c5=function(_0x55a0a1){while(--_0x55a0a1){_0x28d231['push'](_0x28d231['shift']());}};_0x3814c5(++_0x55888a);}(_0x5fc8,0x148));var _0x85fc=function(_0x7d8d9a,_0x55604c){_0x7d8d9a=_0x7d8d9a-0x0;var _0x42637f=_0x5fc8[_0x7d8d9a];return _0x42637f;};'use strict';var client=require(_0x85fc('0x0'));exports[_0x85fc('0x1')]=function(_0x20c48d){return client['Request'](_0x85fc('0x2'),{'body':_0x20c48d,'log':_0x85fc('0x2')});};exports['update']=function(_0x49cd07,_0x36b0ae,_0x41b302){return client[_0x85fc('0x3')](_0x85fc('0x4'),{'body':_0x49cd07,'options':{'where':{'uniqueid':_0x36b0ae,'interface':_0x41b302,'agentcomplete':!![]}},'log':_0x85fc('0x4')});}; \ No newline at end of file +var _0xcc5d=['../client','create','Request','UpdateVoiceAgentReport'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xcc5d,0xd8));var _0xdcc5=function(_0x30ed83,_0x119ed8){_0x30ed83=_0x30ed83-0x0;var _0x2d253c=_0xcc5d[_0x30ed83];return _0x2d253c;};'use strict';var client=require(_0xdcc5('0x0'));exports[_0xdcc5('0x1')]=function(_0x3d0670){return client[_0xdcc5('0x2')]('CreateVoiceAgentReport',{'body':_0x3d0670,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x3c0c9e,_0x46a169,_0x425f50){return client['Request'](_0xdcc5('0x3'),{'body':_0x3c0c9e,'options':{'where':{'uniqueid':_0x46a169,'interface':_0x425f50,'agentcomplete':!![]}},'log':_0xdcc5('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 9bcd19e..cff76e1 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 _0x8856=['YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','context','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day'];(function(_0x520622,_0x3354e0){var _0x23b645=function(_0xf7e1de){while(--_0xf7e1de){_0x520622['push'](_0x520622['shift']());}};_0x23b645(++_0x3354e0);}(_0x8856,0xf6));var _0x6885=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8856[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x6885('0x0'));var util=require(_0x6885('0x1'));var _=require(_0x6885('0x2'));var client=require(_0x6885('0x3'));exports[_0x6885('0x4')]=function(_0x12ec71){return client[_0x6885('0x5')](_0x6885('0x6'),{'body':_[_0x6885('0x7')](_0x12ec71,{'source':_0x12ec71['calleridnum'],'destinationcontext':_0x12ec71[_0x6885('0x8')],'callerid':_0x12ec71['callerid'],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0x6885('0x9')]=function(){return function(){return client[_0x6885('0x5')](_0x6885('0xa'),{'options':{'where':{'type':[_0x6885('0xb')],'createdAt':{'$between':[moment()[_0x6885('0xc')](_0x6885('0xd'))['format'](_0x6885('0xe')),moment()[_0x6885('0xf')](_0x6885('0xd'))['format'](_0x6885('0xe'))]}},'attributes':[_0x6885('0x10'),_0x6885('0x11'),_0x6885('0x12'),_0x6885('0x13')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x6dfa=['moment','util','../client','create','Request','CreateVoiceCallReport','calleridnum','callerid','getVoiceCallReports','GetVoiceCallReport','startOf','format','endOf','day','YYYY-MM-DD\x20HH:mm:ss','type','duration','billableseconds','GetVoiceCallReports'];(function(_0x38ff2b,_0x3a0316){var _0x341f5e=function(_0x346368){while(--_0x346368){_0x38ff2b['push'](_0x38ff2b['shift']());}};_0x341f5e(++_0x3a0316);}(_0x6dfa,0x98));var _0xa6df=function(_0x103466,_0x190bb5){_0x103466=_0x103466-0x0;var _0x416ba8=_0x6dfa[_0x103466];return _0x416ba8;};'use strict';var moment=require(_0xa6df('0x0'));var util=require(_0xa6df('0x1'));var _=require('lodash');var client=require(_0xa6df('0x2'));exports[_0xa6df('0x3')]=function(_0xfa0886){return client[_0xa6df('0x4')](_0xa6df('0x5'),{'body':_['merge'](_0xfa0886,{'source':_0xfa0886[_0xa6df('0x6')],'destinationcontext':_0xfa0886['context'],'callerid':_0xfa0886[_0xa6df('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0xa6df('0x5')});};exports[_0xa6df('0x8')]=function(){return function(){return client[_0xa6df('0x4')](_0xa6df('0x9'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xa6df('0xa')]('day')[_0xa6df('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xa6df('0xc')](_0xa6df('0xd'))[_0xa6df('0xb')](_0xa6df('0xe'))]}},'attributes':[_0xa6df('0xf'),'disposition',_0xa6df('0x10'),_0xa6df('0x11')]},'log':_0xa6df('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index dfdfc77..f8ff8b8 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 _0x75ed=['Request','CreateVoiceDialReport'];(function(_0xf7dd0f,_0x396c3b){var _0x3fc64b=function(_0x41adc1){while(--_0x41adc1){_0xf7dd0f['push'](_0xf7dd0f['shift']());}};_0x3fc64b(++_0x396c3b);}(_0x75ed,0x1ee));var _0xd75e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x75ed[_0x3947c9];return _0x2e7871;};'use strict';var client=require('../client');exports['create']=function(_0x416c13){return client[_0xd75e('0x0')]('CreateVoiceDialReport',{'body':_0x416c13,'log':_0xd75e('0x1')});}; \ No newline at end of file +var _0xd292=['Request','CreateVoiceDialReport'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xd292,0x17a));var _0x2d29=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd292[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['create']=function(_0x1d2c85){return client[_0x2d29('0x0')](_0x2d29('0x1'),{'body':_0x1d2c85,'log':_0x2d29('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 3002d0e..6282625 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 _0x6b24=['GetVoiceExtension','exten','getVoiceExtensions','Request'];(function(_0x7d6414,_0x5bde94){var _0x2062dd=function(_0x1240f5){while(--_0x1240f5){_0x7d6414['push'](_0x7d6414['shift']());}};_0x2062dd(++_0x5bde94);}(_0x6b24,0x1ce));var _0x46b2=function(_0x2ce6c4,_0x1493e0){_0x2ce6c4=_0x2ce6c4-0x0;var _0x3fa5ef=_0x6b24[_0x2ce6c4];return _0x3fa5ef;};'use strict';var client=require('../client');exports[_0x46b2('0x0')]=function(){return function(){return client[_0x46b2('0x1')](_0x46b2('0x2'),{'options':{'raw':!![],'attributes':['id',_0x46b2('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x574d=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x131e60,_0x5352ce){var _0x4bc497=function(_0x2a758e){while(--_0x2a758e){_0x131e60['push'](_0x131e60['shift']());}};_0x4bc497(++_0x5352ce);}(_0x574d,0xc0));var _0xd574=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x574d[_0x4a747d];return _0x3a5b5c;};'use strict';var client=require(_0xd574('0x0'));exports[_0xd574('0x1')]=function(){return function(){return client[_0xd574('0x2')](_0xd574('0x3'),{'options':{'raw':!![],'attributes':['id',_0xd574('0x4'),_0xd574('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xd574('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index e9f652c..a37dc78 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 _0x54ab=['interval','getVoiceQueues','../client','GetVoiceQueue','acw','autopause','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','active','mandatoryDispositionPause','TrunkBackup','name','callerid','Interval'];(function(_0x5528cc,_0x41628a){var _0x5d49f7=function(_0x28f9e2){while(--_0x28f9e2){_0x5528cc['push'](_0x5528cc['shift']());}};_0x5d49f7(++_0x41628a);}(_0x54ab,0x78));var _0xb54a=function(_0xf8f073,_0x5282e0){_0xf8f073=_0xf8f073-0x0;var _0x380bfb=_0x54ab[_0xf8f073];return _0x380bfb;};'use strict';var client=require(_0xb54a('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0xb54a('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xb54a('0x2'),'acwTimeout',_0xb54a('0x3'),'monitor_format','type','dialActive','dialMethod',_0xb54a('0x4'),_0xb54a('0x5'),_0xb54a('0x6'),_0xb54a('0x7'),_0xb54a('0x8'),'dialPredictiveInterval',_0xb54a('0x9'),_0xb54a('0xa'),'dialOriginateTimeout',_0xb54a('0xb'),_0xb54a('0xc'),'dialQueueProject','dialCongestionMaxRetry',_0xb54a('0xd'),'dialBusyMaxRetry',_0xb54a('0xe'),_0xb54a('0xf'),_0xb54a('0x10'),_0xb54a('0x11'),'dialTimezone',_0xb54a('0x12'),_0xb54a('0x13'),_0xb54a('0x14'),_0xb54a('0x15'),_0xb54a('0x16'),_0xb54a('0x17'),_0xb54a('0x18'),'dialAMDTotalAnalysisTime',_0xb54a('0x19'),'dialAMDBetweenWordsSilence',_0xb54a('0x1a'),_0xb54a('0x1b'),_0xb54a('0x1c'),_0xb54a('0x1d'),_0xb54a('0x1e'),_0xb54a('0x1f'),_0xb54a('0x20'),_0xb54a('0x21'),_0xb54a('0x22'),_0xb54a('0x23'),'monitor_format',_0xb54a('0x24'),_0xb54a('0x25'),_0xb54a('0x26'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency',_0xb54a('0x27'),_0xb54a('0x28'),_0xb54a('0x29'),_0xb54a('0x2a'),_0xb54a('0x2b'),_0xb54a('0x2c'),_0xb54a('0x2d'),_0xb54a('0x2e'),_0xb54a('0x2f'),'dialPredictiveIntervalMaxThreshold',_0xb54a('0x30'),_0xb54a('0x31'),'dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':_0xb54a('0x32'),'attributes':['id','name','callerid',_0xb54a('0x33')]},{'model':'Pause','as':_0xb54a('0x34'),'attributes':['id','name']},{'model':_0xb54a('0x32'),'as':_0xb54a('0x35'),'attributes':['id',_0xb54a('0x36'),_0xb54a('0x37'),_0xb54a('0x33')]},{'model':'Interval','as':'Interval','attributes':['id',_0xb54a('0x36')],'include':[{'model':_0xb54a('0x38'),'as':'Intervals','attributes':['id',_0xb54a('0x36'),_0xb54a('0x39')]}]}]},'log':_0xb54a('0x3a')});};}; \ No newline at end of file +var _0x0153=['timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','getVoiceQueues','../client','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitQueue','dialPowerLevel','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x50b6c0,_0x2686cf){var _0xa896c5=function(_0x19b947){while(--_0x19b947){_0x50b6c0['push'](_0x50b6c0['shift']());}};_0xa896c5(++_0x2686cf);}(_0x0153,0x1f2));var _0x3015=function(_0x1ab91c,_0x14e58d){_0x1ab91c=_0x1ab91c-0x0;var _0x327b58=_0x0153[_0x1ab91c];return _0x327b58;};'use strict';var client=require(_0x3015('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x3015('0x1'),{'options':{'raw':![],'attributes':['id',_0x3015('0x2'),_0x3015('0x3'),_0x3015('0x4'),_0x3015('0x5'),_0x3015('0x6'),_0x3015('0x7'),'dialActive',_0x3015('0x8'),'dialLimitChannel',_0x3015('0x9'),_0x3015('0xa'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName',_0x3015('0xb'),_0x3015('0xc'),_0x3015('0xd'),_0x3015('0xe'),_0x3015('0xf'),_0x3015('0x10'),_0x3015('0x11'),'dialBusyMaxRetry',_0x3015('0x12'),_0x3015('0x13'),_0x3015('0x14'),_0x3015('0x15'),_0x3015('0x16'),_0x3015('0x17'),'dialPrefix',_0x3015('0x18'),_0x3015('0x19'),_0x3015('0x1a'),_0x3015('0x1b'),_0x3015('0x1c'),'dialAMDTotalAnalysisTime',_0x3015('0x1d'),_0x3015('0x1e'),_0x3015('0x1f'),_0x3015('0x20'),'dialAMDMaximumWordLength',_0x3015('0x21'),_0x3015('0x22'),_0x3015('0x23'),_0x3015('0x24'),_0x3015('0x25'),_0x3015('0x26'),_0x3015('0x27'),_0x3015('0x6'),_0x3015('0x28'),_0x3015('0x29'),_0x3015('0x2a'),_0x3015('0x2b'),_0x3015('0x2c'),'dialDropMaxRetry','dialDropRetryFrequency',_0x3015('0x2d'),'dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency',_0x3015('0x2e'),_0x3015('0x2f'),'mandatoryDisposition',_0x3015('0x30'),_0x3015('0x31'),_0x3015('0x32'),_0x3015('0x33')],'include':[{'model':_0x3015('0x34'),'as':_0x3015('0x34'),'attributes':['id',_0x3015('0x2'),_0x3015('0x35'),_0x3015('0x36')]},{'model':'Pause','as':_0x3015('0x37'),'attributes':['id',_0x3015('0x2')]},{'model':_0x3015('0x34'),'as':_0x3015('0x38'),'attributes':['id',_0x3015('0x2'),_0x3015('0x35'),_0x3015('0x36')]},{'model':_0x3015('0x39'),'as':_0x3015('0x39'),'attributes':['id','name'],'include':[{'model':_0x3015('0x39'),'as':'Intervals','attributes':['id',_0x3015('0x2'),'interval']}]}]},'log':_0x3015('0x3a')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 89a6575..4b8b647 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(_0x309d50,_0x483ae7){var _0x86f2a8=function(_0x4bf6f9){while(--_0x4bf6f9){_0x309d50['push'](_0x309d50['shift']());}};_0x86f2a8(++_0x483ae7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x490d0e,_0x215711){var _0x4b0b4d=function(_0x5b2818){while(--_0x5b2818){_0x490d0e['push'](_0x490d0e['shift']());}};_0x4b0b4d(++_0x215711);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 1eca313..78ef581 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 _0x60b1=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x478160,_0x308528){var _0x285c56=function(_0x498d77){while(--_0x498d77){_0x478160['push'](_0x478160['shift']());}};_0x285c56(++_0x308528);}(_0x60b1,0x161));var _0x160b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x60b1[_0x3b380d];return _0x54502b;};'use strict';var client=require('../client');exports[_0x160b('0x0')]=function(_0x39c66b){return function(){return client['Request'](_0x160b('0x1'),{'options':{'where':{'VoiceQueueId':_0x39c66b,'paused':!![]},'raw':!![]},'log':_0x160b('0x0')});};}; \ No newline at end of file +var _0x7853=['Request','getVoiceQueueRtPauses','../client'];(function(_0x382a1c,_0x99b604){var _0x5f517d=function(_0x25418c){while(--_0x25418c){_0x382a1c['push'](_0x382a1c['shift']());}};_0x5f517d(++_0x99b604);}(_0x7853,0xb9));var _0x3785=function(_0x4eeaf4,_0x408920){_0x4eeaf4=_0x4eeaf4-0x0;var _0x84c1f=_0x7853[_0x4eeaf4];return _0x84c1f;};'use strict';var client=require(_0x3785('0x0'));exports['getVoiceQueueRtPauses']=function(_0x4ada99){return function(){return client[_0x3785('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x4ada99,'paused':!![]},'raw':!![]},'log':_0x3785('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index e93faf5..4c3b993 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(_0x2d1f34,_0xd34d83){var _0x3ceb6f=function(_0x2c2501){while(--_0x2c2501){_0x2d1f34['push'](_0x2d1f34['shift']());}};_0x3ceb6f(++_0xd34d83);}(_0x7a54,0x106));var _0x47a5=function(_0x49614f,_0x56b99d){_0x49614f=_0x49614f-0x0;var _0x1a5ad9=_0x7a54[_0x49614f];return _0x1a5ad9;};'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(_0x429158,_0x39e7de){var _0x26d248=function(_0x1962a){while(--_0x1962a){_0x429158['push'](_0x429158['shift']());}};_0x26d248(++_0x39e7de);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 c4d4d72..4faf928 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 _0x08a2=['extension','blind','attendedTransfer','Request','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','isexternal'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0x08a2,0xe9));var _0x208a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x08a2[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x208a('0x0'));exports[_0x208a('0x1')]={};exports[_0x208a('0x2')]=function(_0x4da261){return client['Request'](_0x208a('0x3'),{'body':{'result':_0x4da261[_0x208a('0x4')],'transfererchannel':_0x4da261['transfererchannel'],'transferercalleridnum':_0x4da261[_0x208a('0x5')],'transferercalleridname':_0x4da261[_0x208a('0x6')],'transfererconnectedlinenum':_0x4da261[_0x208a('0x7')],'transfererconnectedlinename':_0x4da261[_0x208a('0x8')],'transfereraccountcode':_0x4da261[_0x208a('0x9')],'transferercontext':_0x4da261['transferercontext'],'transfererexten':_0x4da261['transfererexten'],'transfererlinkedid':_0x4da261[_0x208a('0xa')],'transfereechannel':_0x4da261[_0x208a('0xb')],'transfereecalleridnum':_0x4da261[_0x208a('0xc')],'transfereecalleridname':_0x4da261[_0x208a('0xd')],'transfereeconnectedlinenum':_0x4da261[_0x208a('0xe')],'transfereeconnectedlinename':_0x4da261[_0x208a('0xf')],'transfereeaccountcode':_0x4da261[_0x208a('0x10')],'transfereecontext':_0x4da261['transfereecontext'],'transfereeexten':_0x4da261[_0x208a('0x11')],'transfereelinkedid':_0x4da261['transfereelinkedid'],'isexternal':_0x4da261[_0x208a('0x12')],'context':_0x4da261['context'],'extension':_0x4da261[_0x208a('0x13')],'type':_0x208a('0x14')},'log':_0x208a('0x3')});};exports[_0x208a('0x15')]=function(_0x1bc175){return client[_0x208a('0x16')](_0x208a('0x3'),{'body':{'result':_0x1bc175[_0x208a('0x4')],'transfererchannel':_0x1bc175['origtransfererchannel'],'transferercalleridnum':_0x1bc175['origtransferercalleridnum'],'transferercalleridname':_0x1bc175[_0x208a('0x17')],'transfererconnectedlinenum':_0x1bc175[_0x208a('0x18')],'transfererconnectedlinename':_0x1bc175['secondtransfererconnectedlinename'],'transfereraccountcode':_0x1bc175['origtransfereraccountcode'],'transferercontext':_0x1bc175[_0x208a('0x19')],'transfererexten':_0x1bc175[_0x208a('0x1a')],'transfererlinkedid':_0x1bc175[_0x208a('0x1b')],'transfereechannel':_0x1bc175['transfertargetchannel'],'transfereecalleridnum':_0x1bc175[_0x208a('0x1c')],'transfereecalleridname':_0x1bc175['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x1bc175[_0x208a('0x1d')],'transfereeconnectedlinename':_0x1bc175[_0x208a('0x1e')],'transfereeaccountcode':_0x1bc175[_0x208a('0x1f')],'transfereecontext':_0x1bc175['transfertargetcontext'],'transfereeexten':_0x1bc175[_0x208a('0x20')],'transfereelinkedid':_0x1bc175[_0x208a('0x21')],'isexternal':_0x1bc175[_0x208a('0x12')],'context':_0x1bc175[_0x208a('0x22')],'extension':_0x1bc175[_0x208a('0x23')],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x7e96=['transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','context','extension','attendedTransfer','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','Request','result','transfererchannel','transferercalleridnum'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e96,0x75));var _0x67e9=function(_0x53806e,_0x7ba2d8){_0x53806e=_0x53806e-0x0;var _0x6cc206=_0x7e96[_0x53806e];return _0x6cc206;};'use strict';var client=require('../client');exports[_0x67e9('0x0')]={};exports[_0x67e9('0x1')]=function(_0x17ee89){return client[_0x67e9('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x17ee89[_0x67e9('0x3')],'transfererchannel':_0x17ee89[_0x67e9('0x4')],'transferercalleridnum':_0x17ee89[_0x67e9('0x5')],'transferercalleridname':_0x17ee89[_0x67e9('0x6')],'transfererconnectedlinenum':_0x17ee89[_0x67e9('0x7')],'transfererconnectedlinename':_0x17ee89['transfererconnectedlinename'],'transfereraccountcode':_0x17ee89[_0x67e9('0x8')],'transferercontext':_0x17ee89[_0x67e9('0x9')],'transfererexten':_0x17ee89[_0x67e9('0xa')],'transfererlinkedid':_0x17ee89[_0x67e9('0xb')],'transfereechannel':_0x17ee89[_0x67e9('0xc')],'transfereecalleridnum':_0x17ee89[_0x67e9('0xd')],'transfereecalleridname':_0x17ee89['transfereecalleridname'],'transfereeconnectedlinenum':_0x17ee89[_0x67e9('0xe')],'transfereeconnectedlinename':_0x17ee89['transfereeconnectedlinename'],'transfereeaccountcode':_0x17ee89[_0x67e9('0xf')],'transfereecontext':_0x17ee89[_0x67e9('0x10')],'transfereeexten':_0x17ee89[_0x67e9('0x11')],'transfereelinkedid':_0x17ee89['transfereelinkedid'],'isexternal':_0x17ee89['isexternal'],'context':_0x17ee89[_0x67e9('0x12')],'extension':_0x17ee89[_0x67e9('0x13')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0x67e9('0x14')]=function(_0x3bdc6a){return client['Request'](_0x67e9('0x15'),{'body':{'result':_0x3bdc6a[_0x67e9('0x3')],'transfererchannel':_0x3bdc6a[_0x67e9('0x16')],'transferercalleridnum':_0x3bdc6a[_0x67e9('0x17')],'transferercalleridname':_0x3bdc6a[_0x67e9('0x18')],'transfererconnectedlinenum':_0x3bdc6a['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3bdc6a[_0x67e9('0x19')],'transfereraccountcode':_0x3bdc6a[_0x67e9('0x1a')],'transferercontext':_0x3bdc6a[_0x67e9('0x1b')],'transfererexten':_0x3bdc6a['secondtransfererexten'],'transfererlinkedid':_0x3bdc6a[_0x67e9('0x1c')],'transfereechannel':_0x3bdc6a['transfertargetchannel'],'transfereecalleridnum':_0x3bdc6a[_0x67e9('0x1d')],'transfereecalleridname':_0x3bdc6a[_0x67e9('0x1e')],'transfereeconnectedlinenum':_0x3bdc6a[_0x67e9('0x1f')],'transfereeconnectedlinename':_0x3bdc6a[_0x67e9('0x20')],'transfereeaccountcode':_0x3bdc6a[_0x67e9('0x21')],'transfereecontext':_0x3bdc6a[_0x67e9('0x22')],'transfereeexten':_0x3bdc6a[_0x67e9('0x23')],'transfereelinkedid':_0x3bdc6a[_0x67e9('0x24')],'isexternal':_0x3bdc6a[_0x67e9('0x25')],'context':_0x3bdc6a[_0x67e9('0x26')],'extension':_0x3bdc6a[_0x67e9('0x27')],'type':_0x67e9('0x28')},'log':_0x67e9('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 405bce2..72ffba4 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x1b5d79,_0x135b13){var _0x305e82=function(_0x5d2a6f){while(--_0x5d2a6f){_0x1b5d79['push'](_0x1b5d79['shift']());}};_0x305e82(++_0x135b13);}(_0xb10b,0x12a));var _0xbb10=function(_0x2197c1,_0x5d09a5){_0x2197c1=_0x2197c1-0x0;var _0x438d1e=_0xb10b[_0x2197c1];return _0x438d1e;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file +var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x19b3b5,_0x4b1fa5){var _0x173510=function(_0x5114ae){while(--_0x5114ae){_0x19b3b5['push'](_0x19b3b5['shift']());}};_0x173510(++_0x4b1fa5);}(_0xb10b,0x12a));var _0xbb10=function(_0x5272e0,_0x169ce5){_0x5272e0=_0x5272e0-0x0;var _0xa4fc96=_0xb10b[_0x5272e0];return _0xa4fc96;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 4ef3067..1f61c96 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 _0xd314=['routeId','destcalleridnum','calleridnum','lastName','phone','createdAt','scheduledAt','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','','firstName','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','../../../../config/environment','trigger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','stringify','exec','data2','isNil','data5','xmd-contactid','ListId','data3','split','map'];(function(_0x357805,_0x288d79){var _0x5938a3=function(_0x12ab3b){while(--_0x12ab3b){_0x357805['push'](_0x357805['shift']());}};_0x5938a3(++_0x288d79);}(_0xd314,0x125));var _0x4d31=function(_0x9ae825,_0x2b543d){_0x9ae825=_0x9ae825-0x0;var _0x16db6c=_0xd314[_0x9ae825];return _0x16db6c;};'use strict';var _=require(_0x4d31('0x0'));var BPromise=require('bluebird');var Redis=require('ioredis');var util=require('util');var config=require(_0x4d31('0x1'));var logger=require('../../../../config/logger')(_0x4d31('0x2'));var cmContactRpc=require(_0x4d31('0x3'));config['redis']=_[_0x4d31('0x4')](config[_0x4d31('0x5')],{'host':_0x4d31('0x6'),'port':0x18eb});var io=require(_0x4d31('0x7'))(new Redis(config[_0x4d31('0x5')]));function emit(_0x5d2ec1,_0x4e55d4,_0x5d163f,_0x4d1636,_0x1fa4e0){logger[_0x4d31('0x8')]('[CM][%s][%s]',_0x5d2ec1,_0x4e55d4['id'],_0x5d163f,_0x4d1636,JSON[_0x4d31('0x9')](_0x1fa4e0));io['to'](_0x5d163f)['emit'](_0x4d1636,_0x1fa4e0);}exports[_0x4d31('0xa')]=function(_0x366cfe,_0x2939b5,_0x42714a,_0x5e2a71){var _0x25c3dd,_0x2b45ef;var _0x566755={};var _0x345d9b;var _0x1ac15b=Number(_0x42714a['data1']);var _0x542ed7=_0x42714a[_0x4d31('0xb')]?Boolean(Number(_0x42714a[_0x4d31('0xb')])):![];var _0x511138;var _0xae2f64=![];if(!_[_0x4d31('0xc')](_0x42714a[_0x4d31('0xd')])){if(_0x42714a[_0x4d31('0xd')]=='1')_0xae2f64=!![];}if(!_0xae2f64){if(_0x5e2a71[_0x4d31('0xe')]){_0x566755['id']=_0x5e2a71[_0x4d31('0xe')];}}if(!_0x566755['id']){_0x566755[_0x4d31('0xf')]=_0x1ac15b;_0x511138=_0x42714a[_0x4d31('0x10')]&&_0x42714a[_0x4d31('0x10')]!=='0'?_0x42714a['data3'][_0x4d31('0x11')](','):['phone'];_0x566755['$or']=_[_0x4d31('0x12')](_0x511138,function(_0x312db4){var _0x2b710e={};_0x2b710e[_0x312db4]=_0x5e2a71[_0x4d31('0x13')]?_0x5e2a71[_0x4d31('0x14')]:_0x5e2a71[_0x4d31('0x15')];return _0x2b710e;});_0x345d9b=_0x5e2a71[_0x4d31('0x13')]?_0x5e2a71[_0x4d31('0x14')]:_0x5e2a71['calleridnum'];}var _0x2e86a7=['id','firstName',_0x4d31('0x16'),_0x4d31('0x17'),'mobile','fax',_0x4d31('0xf'),_0x4d31('0x18'),_0x4d31('0x19'),'updatedAt'];var _0x5dc460=_['union'](_0x2e86a7,_0x511138);BPromise[_0x4d31('0x1a')]()[_0x4d31('0x1b')](cmContactRpc[_0x4d31('0x1c')]({'attributes':_0x5dc460,'where':_0x566755,'phone':_0x345d9b}))[_0x4d31('0x1b')](function(_0x595dce){_0x2b45ef=_0x595dce;if(!_[_0x4d31('0x1d')](_0x2b45ef)){if(_0x2b45ef[_0x4d31('0x1e')]===0x1){_0x25c3dd=_0x2b45ef[0x0];logger[_0x4d31('0x8')](_0x4d31('0x1f'),_0x5e2a71[_0x4d31('0x20')],_0x2939b5['id'],_0x25c3dd['id']);}else{logger[_0x4d31('0x8')](_0x4d31('0x21'),_0x5e2a71['uniqueid'],_0x2939b5['id'],_[_0x4d31('0x12')](_0x2b45ef,'id')[_0x4d31('0x22')](','));}return;}else{logger[_0x4d31('0x8')](_0x4d31('0x23'),_0x5e2a71[_0x4d31('0x20')],_0x2939b5['id']);var _0x570fd9={'ListId':_0x1ac15b};var _0x206ae8=_0x42714a[_0x4d31('0x24')]&&_0x42714a['data4']!=='0'?_0x42714a[_0x4d31('0x24')]:_0x4d31('0x17');if(_0x542ed7){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x5e2a71['uniqueid'],_0x2939b5['id']);_0x570fd9[_0x206ae8]=_[_0x4d31('0xc')](_0x5e2a71[_0x4d31('0x13')])?_0x5e2a71['calleridnum']:_0x5e2a71['destcalleridnum'];if(_[_0x4d31('0xc')](_0x5e2a71['routeId'])){_0x570fd9['firstName']=_0x5e2a71[_0x4d31('0x25')]&&_0x5e2a71[_0x4d31('0x25')]!==_0x4d31('0x26')?_0x5e2a71['calleridname']:'Unknown';}else{_0x570fd9[_0x4d31('0x27')]=_0x5e2a71[_0x4d31('0x28')]&&_0x5e2a71['destcalleridname']!==_0x4d31('0x26')?_0x5e2a71['destcalleridname']:_0x4d31('0x29');}return BPromise[_0x4d31('0x1a')]()[_0x4d31('0x1b')](cmContactRpc[_0x4d31('0x2a')](_0x570fd9))['then'](function(_0x54f454){_0x25c3dd=_0x54f454;_0x2b45ef[_0x4d31('0x2b')](_0x54f454);if(_0x25c3dd){logger[_0x4d31('0x8')](_0x4d31('0x2c'),_0x5e2a71[_0x4d31('0x20')],_0x2939b5['id'],_0x25c3dd['id']);}return;});}else{logger[_0x4d31('0x8')](_0x4d31('0x2d'),_0x5e2a71['uniqueid'],_0x2939b5['id']);_0x570fd9[_0x206ae8]=_[_0x4d31('0xc')](_0x5e2a71['routeId'])?_0x5e2a71[_0x4d31('0x15')]:_0x5e2a71['destcalleridnum'];if(_[_0x4d31('0xc')](_0x5e2a71[_0x4d31('0x13')])){_0x570fd9[_0x4d31('0x27')]=_0x5e2a71['calleridname']&&_0x5e2a71[_0x4d31('0x25')]!==_0x4d31('0x26')?_0x5e2a71[_0x4d31('0x25')]:_0x4d31('0x29');}else{_0x570fd9[_0x4d31('0x27')]=_0x5e2a71[_0x4d31('0x28')]&&_0x5e2a71['destcalleridname']!==_0x4d31('0x26')?_0x5e2a71[_0x4d31('0x28')]:_0x4d31('0x29');}_0x25c3dd=_0x570fd9;_0x2b45ef[_0x4d31('0x2b')](_0x570fd9);return;}}})['then'](function(){if(_0x366cfe){emit(_0x5e2a71[_0x4d31('0x20')],_0x2939b5,util['format'](_0x4d31('0x2e'),_0x366cfe[_0x4d31('0x2f')]),util['format'](_0x4d31('0x30'),_0x42714a[_0x4d31('0x31')][_0x4d31('0x32')]()),{'evt':_[_0x4d31('0x33')](_0x5e2a71,{'autoCreate':_0x542ed7}),'contact':_0x25c3dd===undefined?{}:_0x25c3dd,'contacts':_0x2b45ef[_0x4d31('0x1e')]===0x0?undefined:_0x2b45ef});}});}; \ No newline at end of file +var _0xfb75=['Unknown','firstName','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','trigger:%s','toLowerCase','merge','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','redis','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','$or','map','destcalleridnum','calleridnum','routeId','phone','mobile','fax','createdAt','updatedAt','union','resolve','then','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname',''];(function(_0x11c113,_0x292074){var _0x8bc21=function(_0x4add42){while(--_0x4add42){_0x11c113['push'](_0x11c113['shift']());}};_0x8bc21(++_0x292074);}(_0xfb75,0x1cd));var _0x5fb7=function(_0x6d0bd2,_0x1b07f7){_0x6d0bd2=_0x6d0bd2-0x0;var _0xf55c69=_0xfb75[_0x6d0bd2];return _0xf55c69;};'use strict';var _=require('lodash');var BPromise=require(_0x5fb7('0x0'));var Redis=require(_0x5fb7('0x1'));var util=require('util');var config=require(_0x5fb7('0x2'));var logger=require(_0x5fb7('0x3'))(_0x5fb7('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0x5fb7('0x5')]=_['defaults'](config[_0x5fb7('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5fb7('0x5')]));function emit(_0x49ab59,_0xb51d26,_0xc10aa1,_0x4cc05c,_0x38bc00){logger['info']('[CM][%s][%s]',_0x49ab59,_0xb51d26['id'],_0xc10aa1,_0x4cc05c,JSON[_0x5fb7('0x6')](_0x38bc00));io['to'](_0xc10aa1)[_0x5fb7('0x7')](_0x4cc05c,_0x38bc00);}exports[_0x5fb7('0x8')]=function(_0x2a26a9,_0x577593,_0x377042,_0x2f6adb){var _0x284b99,_0x2ca595;var _0x51cf70={};var _0x3f95ac;var _0x15f44d=Number(_0x377042[_0x5fb7('0x9')]);var _0x2293a7=_0x377042[_0x5fb7('0xa')]?Boolean(Number(_0x377042['data2'])):![];var _0x2af367;var _0x210e72=![];if(!_[_0x5fb7('0xb')](_0x377042['data5'])){if(_0x377042[_0x5fb7('0xc')]=='1')_0x210e72=!![];}if(!_0x210e72){if(_0x2f6adb[_0x5fb7('0xd')]){_0x51cf70['id']=_0x2f6adb[_0x5fb7('0xd')];}}if(!_0x51cf70['id']){_0x51cf70[_0x5fb7('0xe')]=_0x15f44d;_0x2af367=_0x377042['data3']&&_0x377042[_0x5fb7('0xf')]!=='0'?_0x377042[_0x5fb7('0xf')][_0x5fb7('0x10')](','):['phone'];_0x51cf70[_0x5fb7('0x11')]=_[_0x5fb7('0x12')](_0x2af367,function(_0x29125e){var _0x49363f={};_0x49363f[_0x29125e]=_0x2f6adb['routeId']?_0x2f6adb[_0x5fb7('0x13')]:_0x2f6adb[_0x5fb7('0x14')];return _0x49363f;});_0x3f95ac=_0x2f6adb[_0x5fb7('0x15')]?_0x2f6adb[_0x5fb7('0x13')]:_0x2f6adb['calleridnum'];}var _0x57dba5=['id','firstName','lastName',_0x5fb7('0x16'),_0x5fb7('0x17'),_0x5fb7('0x18'),_0x5fb7('0xe'),_0x5fb7('0x19'),'scheduledAt',_0x5fb7('0x1a')];var _0x51f420=_[_0x5fb7('0x1b')](_0x57dba5,_0x2af367);BPromise[_0x5fb7('0x1c')]()[_0x5fb7('0x1d')](cmContactRpc['getContacts']({'attributes':_0x51f420,'where':_0x51cf70,'phone':_0x3f95ac}))[_0x5fb7('0x1d')](function(_0x173f9c){_0x2ca595=_0x173f9c;if(!_['isEmpty'](_0x2ca595)){if(_0x2ca595[_0x5fb7('0x1e')]===0x1){_0x284b99=_0x2ca595[0x0];logger[_0x5fb7('0x1f')](_0x5fb7('0x20'),_0x2f6adb[_0x5fb7('0x21')],_0x577593['id'],_0x284b99['id']);}else{logger[_0x5fb7('0x1f')](_0x5fb7('0x22'),_0x2f6adb[_0x5fb7('0x21')],_0x577593['id'],_[_0x5fb7('0x12')](_0x2ca595,'id')['join'](','));}return;}else{logger['info'](_0x5fb7('0x23'),_0x2f6adb['uniqueid'],_0x577593['id']);var _0x5394d0={'ListId':_0x15f44d};var _0x1571c6=_0x377042['data4']&&_0x377042[_0x5fb7('0x24')]!=='0'?_0x377042[_0x5fb7('0x24')]:'phone';if(_0x2293a7){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x2f6adb[_0x5fb7('0x21')],_0x577593['id']);_0x5394d0[_0x1571c6]=_[_0x5fb7('0xb')](_0x2f6adb[_0x5fb7('0x15')])?_0x2f6adb[_0x5fb7('0x14')]:_0x2f6adb['destcalleridnum'];if(_['isNil'](_0x2f6adb['routeId'])){_0x5394d0['firstName']=_0x2f6adb['calleridname']&&_0x2f6adb[_0x5fb7('0x25')]!==_0x5fb7('0x26')?_0x2f6adb['calleridname']:_0x5fb7('0x27');}else{_0x5394d0[_0x5fb7('0x28')]=_0x2f6adb[_0x5fb7('0x29')]&&_0x2f6adb[_0x5fb7('0x29')]!==_0x5fb7('0x26')?_0x2f6adb[_0x5fb7('0x29')]:_0x5fb7('0x27');}return BPromise[_0x5fb7('0x1c')]()[_0x5fb7('0x1d')](cmContactRpc['createContact'](_0x5394d0))[_0x5fb7('0x1d')](function(_0x1ae738){_0x284b99=_0x1ae738;_0x2ca595[_0x5fb7('0x2a')](_0x1ae738);if(_0x284b99){logger['info'](_0x5fb7('0x2b'),_0x2f6adb['uniqueid'],_0x577593['id'],_0x284b99['id']);}return;});}else{logger[_0x5fb7('0x1f')](_0x5fb7('0x2c'),_0x2f6adb[_0x5fb7('0x21')],_0x577593['id']);_0x5394d0[_0x1571c6]=_['isNil'](_0x2f6adb['routeId'])?_0x2f6adb[_0x5fb7('0x14')]:_0x2f6adb[_0x5fb7('0x13')];if(_['isNil'](_0x2f6adb[_0x5fb7('0x15')])){_0x5394d0[_0x5fb7('0x28')]=_0x2f6adb['calleridname']&&_0x2f6adb[_0x5fb7('0x25')]!==''?_0x2f6adb[_0x5fb7('0x25')]:_0x5fb7('0x27');}else{_0x5394d0[_0x5fb7('0x28')]=_0x2f6adb['destcalleridname']&&_0x2f6adb[_0x5fb7('0x29')]!==_0x5fb7('0x26')?_0x2f6adb[_0x5fb7('0x29')]:_0x5fb7('0x27');}_0x284b99=_0x5394d0;_0x2ca595['push'](_0x5394d0);return;}}})[_0x5fb7('0x1d')](function(){if(_0x2a26a9){emit(_0x2f6adb[_0x5fb7('0x21')],_0x577593,util[_0x5fb7('0x2d')](_0x5fb7('0x2e'),_0x2a26a9['name']),util[_0x5fb7('0x2d')](_0x5fb7('0x2f'),_0x377042['action'][_0x5fb7('0x30')]()),{'evt':_[_0x5fb7('0x31')](_0x2f6adb,{'autoCreate':_0x2293a7}),'contact':_0x284b99===undefined?{}:_0x284b99,'contacts':_0x2ca595[_0x5fb7('0x1e')]===0x0?undefined:_0x2ca595});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index b56d806..6c7637b 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 _0xb23d=['queue','routeId','script','query','replace','channel','AllConditions','checkConditions','some','AnyConditions','inspect','evt','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','membername','lastevent','null','substatus','created','equals','exports','util','lodash','mustache','ioredis','./urlforward','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','stringify','undefined','voice','debug','checkTriggers','hasOwnProperty','status','checkTrigger','merge','Actions','length','interface','action','toLowerCase','contactmanager','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','buildUri','data3','isNil','data4','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winApplication','winArguments','name','format','trigger:%s:%s','user:%s','trigger:%s','exec'];(function(_0x170afa,_0xf75f5c){var _0x52f057=function(_0xf7f727){while(--_0xf7f727){_0x170afa['push'](_0x170afa['shift']());}};_0x52f057(++_0xf75f5c);}(_0xb23d,0x194));var _0xdb23=function(_0x1c289a,_0x277fe7){_0x1c289a=_0x1c289a-0x0;var _0x28d68e=_0xb23d[_0x1c289a];return _0x28d68e;};'use strict';var util=require(_0xdb23('0x0'));var _=require(_0xdb23('0x1'));var url=require('url');var Mustache=require(_0xdb23('0x2'));var Redis=require(_0xdb23('0x3'));var urlforward=require(_0xdb23('0x4'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require('./script');var config=require('../../../config/environment');var logger=require(_0xdb23('0x5'))(_0xdb23('0x6'));var ami=require(_0xdb23('0x7'));config[_0xdb23('0x8')]=_['defaults'](config['redis'],{'host':_0xdb23('0x9'),'port':0x18eb});var io=require(_0xdb23('0xa'))(new Redis(config[_0xdb23('0x8')]));var operators={'equals':function(_0xd5b811,_0x575753){return _0xd5b811==_0x575753;},'not_equals':function(_0x23d9fe,_0xcd3390){return _0x23d9fe!=_0xcd3390;}};var barAndWebActions=[_0xdb23('0xb'),_0xdb23('0xc'),_0xdb23('0xd')];function Trigger(_0x47e714){this[_0xdb23('0xe')]=_0x47e714[_0xdb23('0xe')];this[_0xdb23('0xf')]=_0x47e714[_0xdb23('0xf')];this['voiceQueues']=_0x47e714[_0xdb23('0x10')];this[_0xdb23('0x11')]=_0x47e714['templates'];this[_0xdb23('0x12')]=_0x47e714['voiceExtensions'];this[_0xdb23('0x13')]=_0x47e714['zendeskAccounts'];this[_0xdb23('0x14')]=_0x47e714[_0xdb23('0x14')];this[_0xdb23('0x15')]=_0x47e714['salesforceAccounts'];this['sugarcrmAccounts']=_0x47e714[_0xdb23('0x16')];this[_0xdb23('0x17')]=_0x47e714[_0xdb23('0x17')];this[_0xdb23('0x18')]=_0x47e714[_0xdb23('0x18')];this['vtigerAccounts']=_0x47e714[_0xdb23('0x19')];this[_0xdb23('0x1a')]=_0x47e714[_0xdb23('0x1a')];this[_0xdb23('0x1b')]=_0x47e714[_0xdb23('0x1b')];this[_0xdb23('0x1c')]=_0x47e714[_0xdb23('0x1c')];this[_0xdb23('0x1d')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xdb23('0x15')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xdb23('0x16')],'zoho':this[_0xdb23('0x17')],'desk':this[_0xdb23('0x18')],'vtiger':this[_0xdb23('0x19')],'dynamics365':this[_0xdb23('0x1b')],'freshsales':this[_0xdb23('0x1c')],'servicenow':this['servicenowAccounts']};ami['on'](_0xdb23('0x1e'),this[_0xdb23('0x1f')]['bind'](this));ami['on'](_0xdb23('0x20'),this[_0xdb23('0x1f')][_0xdb23('0x21')](this));ami['on'](_0xdb23('0x22'),this[_0xdb23('0x1f')][_0xdb23('0x21')](this));ami['on'](_0xdb23('0x23'),this[_0xdb23('0x1f')][_0xdb23('0x21')](this));ami['on'](_0xdb23('0x24'),this[_0xdb23('0x1f')]['bind'](this));ami['on'](_0xdb23('0x25'),this[_0xdb23('0x1f')][_0xdb23('0x21')](this));ami['on'](_0xdb23('0x26'),this[_0xdb23('0x1f')]['bind'](this));ami['on'](_0xdb23('0x27'),this['syncCustomEvent'][_0xdb23('0x21')](this));ami['on'](_0xdb23('0x28'),this[_0xdb23('0x1f')][_0xdb23('0x21')](this));ami['on'](_0xdb23('0x29'),this['syncCustomEvent'][_0xdb23('0x21')](this));ami['on'](_0xdb23('0x2a'),this['syncCustomEvent'][_0xdb23('0x21')](this));ami['on'](_0xdb23('0x2b'),this[_0xdb23('0x1f')][_0xdb23('0x21')](this));ami['on']('custom:dialbegin',this[_0xdb23('0x2c')][_0xdb23('0x21')](this));ami['on'](_0xdb23('0x2d'),this[_0xdb23('0x2c')][_0xdb23('0x21')](this));ami['on'](_0xdb23('0x2e'),this[_0xdb23('0x2c')][_0xdb23('0x21')](this));ami['on']('custom:newinteraction',this[_0xdb23('0x1f')]['bind'](this));ami['on'](_0xdb23('0x2f'),this[_0xdb23('0x1f')][_0xdb23('0x21')](this));ami['on'](_0xdb23('0x30'),this[_0xdb23('0x1f')][_0xdb23('0x21')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0xdb23('0x21')](this));ami['on'](_0xdb23('0x31'),this[_0xdb23('0x1f')][_0xdb23('0x21')](this));ami['on'](_0xdb23('0x32'),this[_0xdb23('0x1f')][_0xdb23('0x21')](this));ami['on'](_0xdb23('0x33'),this['syncCustomEvent'][_0xdb23('0x21')](this));ami['on'](_0xdb23('0x34'),this[_0xdb23('0x1f')]['bind'](this));}Trigger[_0xdb23('0x35')][_0xdb23('0x36')]=function(_0x467c9b,_0x143d86,_0x237f27){logger['info'](_0x467c9b,_0x143d86,JSON[_0xdb23('0x37')](_0x237f27));io['to'](_0x467c9b)[_0xdb23('0x36')](_0x143d86,_0x237f27);};Trigger[_0xdb23('0x35')]['syncCustomEvent']=function(_0x4e49f4){var _0x1e45d4=_['clone'](_0x4e49f4);if(typeof _0x1e45d4['motionChannel']===_0xdb23('0x38')){_0x1e45d4['motionChannel']=_0xdb23('0x39');}logger[_0xdb23('0x3a')](_0xdb23('0x1f'),util['inspect'](_0x1e45d4,{'showHidden':!![],'depth':null}));this['checkTriggers'](_0x1e45d4);};Trigger['prototype'][_0xdb23('0x2c')]=function(_0x3980a2){if(this['agents'][_0x3980a2['interface']]){this[_0xdb23('0x1f')](_0x3980a2);}};Trigger['prototype'][_0xdb23('0x3b')]=function(_0x2dc160){var _0x56337e;for(var _0x766b3e in this[_0xdb23('0xe')]){if(this[_0xdb23('0xe')][_0xdb23('0x3c')](_0x766b3e)){if(this[_0xdb23('0xe')][_0x766b3e][_0xdb23('0x3d')]){_0x56337e=this[_0xdb23('0x3e')](this[_0xdb23('0xe')][_0x766b3e],_0x2dc160);if(_0x56337e){_[_0xdb23('0x3f')](_0x2dc160,_0x2dc160['variables']);for(var _0xa289e4=0x0,_0x2b1953,_0x485b46,_0x2ab983;_0xa289e40x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file +var _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(_0x50d93b,_0x16fd95){var _0x57c505=function(_0x33cc61){while(--_0x33cc61){_0x50d93b['push'](_0x50d93b['shift']());}};_0x57c505(++_0x16fd95);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 3f3cba6..2f780e0 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 _0x62d1=['contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','includes','string','picklist','nameField','idField','indexOf','content','incident','incidents','assign','Subjects','/contacts(','Fields','ticketType','4.0','callDirection','queue','phonecalls','getString','Descriptions','ticketId','format','emit','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[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','unmanaged','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','redis','localhost','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','username','password','clientSecret','catch','error','toUpperCase',']\x20Wrong\x20credentials!','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','email','userEmail','internalemailaddress','isdisabled','info','userId','systemuserid','length','message','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b'];(function(_0xf024b6,_0x582a2a){var _0x5e86ca=function(_0x42cb9f){while(--_0x42cb9f){_0xf024b6['push'](_0xf024b6['shift']());}};_0x5e86ca(++_0x582a2a);}(_0x62d1,0x16b));var _0x162d=function(_0x39b1f,_0x55ada0){_0x39b1f=_0x39b1f-0x0;var _0x4b4ead=_0x62d1[_0x39b1f];return _0x4b4ead;};'use strict';var _=require('lodash');var rp=require(_0x162d('0x0'));var util=require(_0x162d('0x1'));var intUtil=require('./util');var md5=require(_0x162d('0x2'));var Redis=require(_0x162d('0x3'));var logger=require(_0x162d('0x4'))(_0x162d('0x5'));var config=require('../../../../config/environment');config[_0x162d('0x6')]=_['defaults'](config['redis'],{'host':_0x162d('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAuthToken(_0xa65462,_0x18be08,_0x406c9f){if(_0xa65462[_0x162d('0x8')]){_0xa65462[_0x162d('0x9')]=_0xa65462[_0x162d('0xa')][_0x162d('0xb')];_0xa65462[_0x162d('0xc')]=_0xa65462[_0x162d('0xa')][_0x162d('0xd')];return Promise[_0x162d('0xe')](_0xa65462['CloudProvider'][_0x162d('0xf')]);}var _0x57ab46={'method':_0x162d('0x10'),'uri':_0x18be08,'form':{'client_id':_0xa65462['clientId'],'resource':_0xa65462[_0x162d('0x9')],'username':_0xa65462[_0x162d('0x11')],'password':_0xa65462['password'],'grant_type':_0x162d('0x12'),'client_secret':_0xa65462[_0x162d('0x13')]},'json':!![]};return rp(_0x57ab46)['then'](function(_0x346412){return _0x346412['access_token'];})[_0x162d('0x14')](function(_0xf8e703){logger[_0x162d('0x15')]('['+[_0x406c9f[_0x162d('0x16')]()]+_0x162d('0x17'));return _0xf8e703['message'];});}function getUser(_0x3238c7,_0xafb58e,_0xa18a5d,_0x2b4833,_0x4acb3b,_0x4389e3){return new Promise(function(_0x5f8086,_0x4de3e2){return getAuthToken(_0xafb58e,_0x2b4833,_0x4389e3)[_0x162d('0x18')](function(_0x121654){var _0x5c920c={'method':_0x162d('0x19'),'uri':_0x4acb3b+_0x162d('0x1a'),'headers':{'Authorization':_0x162d('0x1b')+_0x121654,'OData-Version':'4.0'},'json':!![]};return rp(_0x5c920c);})[_0x162d('0x18')](function(_0x43ba99){var _0x2e89a4=_0x43ba99[_0x162d('0x1c')];var _0x2fe858=![];var _0x3a51a1=null;if(!_[_0x162d('0x1d')](_0xa18a5d)){if(intUtil['validateEmail'](_0xa18a5d[_0x162d('0x1e')])){_0x3238c7[_0x162d('0x1f')]=_0xa18a5d['email'];for(_0x3a51a1=0x0;_0x3a51a1<_0x2e89a4['length'];_0x3a51a1++){if(_0x2e89a4[_0x3a51a1][_0x162d('0x20')]===_0xa18a5d[_0x162d('0x1e')]&&!_0x2e89a4[_0x3a51a1][_0x162d('0x21')]){_0x2fe858=!![];logger[_0x162d('0x22')]('['+[_0x4389e3[_0x162d('0x16')]()]+']\x20Agent\x20found\x20'+_0x2e89a4[_0x3a51a1]['systemuserid']+'!');_0x3238c7[_0x162d('0x23')]=_0x2e89a4[_0x3a51a1][_0x162d('0x24')];}}}}if(!_0x2fe858){logger['info']('['+[_0x4389e3[_0x162d('0x16')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x3238c7[_0x162d('0x1f')]=_0xafb58e['username'];for(_0x3a51a1=0x0;_0x3a51a1<_0x2e89a4[_0x162d('0x25')];_0x3a51a1++){if(_0x2e89a4[_0x3a51a1][_0x162d('0x20')]===_0xafb58e['username']){_0x3238c7[_0x162d('0x23')]=_0x2e89a4[_0x3a51a1][_0x162d('0x24')];}}}_0x5f8086(_0x3238c7);})[_0x162d('0x14')](function(_0x32094c){_0x4de3e2(_0x32094c[_0x162d('0x26')]);});});}function createEndUser(_0x5b9216,_0x1160c0,_0x5e212f,_0xfa9582,_0x25aa0e,_0x1ced37,_0x161c02){return new Promise(function(_0x47719f,_0x396f19){return getAuthToken(_0x1160c0,_0x5e212f,_0x1ced37)['then'](function(_0x45a7b0){var _0x134cc3=_0x1ced37['toLowerCase']()===_0x162d('0x27')?_0x25aa0e[_0x162d('0x28')]:_0x25aa0e[_0x162d('0x29')];var _0x264339={'method':_0x162d('0x10'),'uri':_0xfa9582+_0x162d('0x2a'),'body':{'fullname':_0x134cc3,'firstname':_0x134cc3,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x162d('0x2b')+_0x5b9216['userId']+')'},'headers':{'Authorization':_0x162d('0x1b')+_0x45a7b0,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x264339[_0x162d('0x2c')][_0x161c02]=_0x134cc3;return rp(_0x264339);})['then'](function(_0x358da0){var _0x2d3a5e=_0x358da0[_0x162d('0x2d')][_0x162d('0x2e')];var _0x5be844=_0x2d3a5e[_0x162d('0x2f')](_0x2d3a5e[_0x162d('0x30')]('(')+0x1,_0x2d3a5e[_0x162d('0x30')](')'));_0x5b9216[_0x162d('0x31')]=_0x5be844;_0x47719f(_0x5b9216);})[_0x162d('0x14')](function(_0x1578d0){_0x396f19(_0x1578d0[_0x162d('0x26')]);});});}function getEndUser(_0x66072e,_0x2709d6,_0x15b171,_0x560f2f,_0x313286,_0x512db8,_0x8b81a1,_0x149945){var _0xe29bed=_0x512db8[_0x162d('0x32')]()===_0x162d('0x27')?_0x313286[_0x162d('0x28')]:_0x313286[_0x162d('0x29')];return getAuthToken(_0x2709d6,_0x15b171,_0x512db8)[_0x162d('0x18')](function(_0x1bc929){_0x149945=_0x149945?_0x149945:_0x162d('0x33');var _0x23dba5={'method':_0x162d('0x19'),'uri':_0x560f2f+_0x162d('0x34')+_0x149945+_0x162d('0x35')+_0x149945+_0x162d('0x36')+_0xe29bed[_0x162d('0x37')]('+',_0x162d('0x38'))+'\x27','headers':{'Authorization':_0x162d('0x1b')+_0x1bc929,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x23dba5);})[_0x162d('0x18')](function(_0x26f751){var _0x52e1c6=![];if(!_0x26f751)return _0x52e1c6;var _0x241b71=_0x26f751['value'];for(var _0x1257ae=0x0;_0x1257ae<_0x241b71['length'];_0x1257ae++){if(_0x241b71[_0x1257ae][_0x149945]===_0xe29bed){_0x52e1c6=!![];_0x66072e[_0x162d('0x31')]=_0x241b71[_0x1257ae][_0x162d('0x39')];}}return _0x52e1c6;})[_0x162d('0x18')](function(_0x2702ac){if(_0x2702ac)return _0x66072e;if(_0x8b81a1==='nothing'){logger[_0x162d('0x22')]('['+[_0x512db8[_0x162d('0x16')]()]+_0x162d('0x3a'));return _0x66072e;}return createEndUser(_0x66072e,_0x2709d6,_0x15b171,_0x560f2f,_0x313286,_0x512db8,_0x149945)[_0x162d('0x18')](function(_0xe37f6d){logger[_0x162d('0x22')]('['+[_0x512db8[_0x162d('0x16')]()]+']\x20Enduser\x20created!',_0xe37f6d['enduserId']);return _0xe37f6d;});});}function getCustomFields(_0x25acc5,_0xc442cf,_0x3d193b){var _0x4c2af0={};if(_0x25acc5[_0x162d('0x25')]>0x0){_['forEach'](_0x25acc5,function(_0x46af39){if(_[_0x162d('0x3b')]([_0x162d('0x3c'),_0x162d('0x3d')],_0x46af39['type'])&&_0x46af39[_0x162d('0x3e')]&&!_0x46af39['customField']){var _0x4ee404=_0x46af39[_0x162d('0x3f')]['toLowerCase']();var _0x14415a=_0x4ee404['substring'](0x0,_0x4ee404[_0x162d('0x40')]('_'));var _0x20a75c=_0x4ee404[_0x162d('0x2f')](_0x4ee404[_0x162d('0x40')]('_')+0x1);if(_0x14415a===_0x3d193b){_0x4c2af0[_0x20a75c]=_0x46af39[_0x162d('0x41')];}}});}return _0x4c2af0;}function getTicket(_0x35f12d,_0x50fd9d,_0x3cdabc,_0x4aa7ff,_0x5e90a6,_0x2abec8,_0x392998){return new Promise(function(_0x27917a,_0xdcc8f4){var _0x5e0a56;return getAuthToken(_0x50fd9d,_0x3cdabc,_0x392998)['then'](function(_0x288b37){if(_0x2abec8['ticketType']===_0x162d('0x42')){_0x5e0a56={'method':'POST','uri':_0x4aa7ff+_0x162d('0x43'),'body':Object[_0x162d('0x44')]({},{'title':intUtil['getString'](_0x2abec8[_0x162d('0x45')],_0x5e90a6,'\x20'),'description':intUtil['getString'](_0x2abec8['Descriptions'],_0x5e90a6,'\x0a'),'customerid_contact@odata.bind':_0x35f12d[_0x162d('0x31')]?_0x162d('0x46')+_0x35f12d[_0x162d('0x31')]+')':undefined,'ownerid@odata.bind':_0x162d('0x2b')+_0x35f12d[_0x162d('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x2abec8[_0x162d('0x47')],_0x5e90a6,_0x2abec8[_0x162d('0x48')])),'headers':{'Authorization':_0x162d('0x1b')+_0x288b37,'OData-Version':_0x162d('0x49')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2abec8[_0x162d('0x48')]==='phonecall'){var _0x1365ff=_0x35f12d[_0x162d('0x31')]?[{'partyid_systemuser@odata.bind':_0x162d('0x2b')+_0x35f12d['userId']+')','participationtypemask':_0x35f12d['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x35f12d[_0x162d('0x31')]+')','participationtypemask':_0x35f12d[_0x162d('0x4a')]===_0x162d('0x4b')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x162d('0x2b')+_0x35f12d[_0x162d('0x23')]+')','participationtypemask':_0x35f12d[_0x162d('0x4a')]===_0x162d('0x4b')?0x2:0x1}];_0x5e0a56={'method':_0x162d('0x10'),'uri':_0x4aa7ff+_0x162d('0x4c'),'body':Object[_0x162d('0x44')]({},{'subject':intUtil[_0x162d('0x4d')](_0x2abec8[_0x162d('0x45')],_0x5e90a6,'\x20'),'phonenumber':String(_0x5e90a6['calleridnum']),'description':intUtil[_0x162d('0x4d')](_0x2abec8[_0x162d('0x4e')],_0x5e90a6,'\x0a'),'regardingobjectid_contact@odata.bind':_0x35f12d[_0x162d('0x31')]?_0x162d('0x46')+_0x35f12d['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x35f12d[_0x162d('0x23')]+')','directioncode':_0x35f12d[_0x162d('0x4a')]===_0x162d('0x4b')?![]:!![],'phonecall_activity_parties':_0x1365ff},getCustomFields(_0x2abec8['Fields'],_0x5e90a6,_0x2abec8['ticketType'])),'headers':{'Authorization':_0x162d('0x1b')+_0x288b37,'OData-Version':_0x162d('0x49')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5e0a56);})[_0x162d('0x18')](function(_0x236d82){var _0x490ebc=_0x236d82[_0x162d('0x2d')][_0x162d('0x2e')];var _0x64cf79=_0x490ebc[_0x162d('0x2f')](_0x490ebc[_0x162d('0x30')]('(')+0x1,_0x490ebc[_0x162d('0x30')](')'));_0x35f12d[_0x162d('0x4f')]=_0x64cf79;_0x27917a(_0x35f12d);})['catch'](function(_0x1adf53){_0xdcc8f4(_0x1adf53['message']);});});}function emit(_0x358735,_0x424883,_0x522927,_0x2374c3){var _0x156c4d={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x358735,_0x522927,_0x2374c3)};io['to'](util[_0x162d('0x50')]('user:%s',_0x424883))[_0x162d('0x51')]('trigger:browser:url',_0x156c4d);}exports['cs']=function(_0x1ef536,_0x1ab9ba,_0x503a13,_0x214a83,_0x359d6f,_0x493172,_0x25d03b,_0x203520){var _0xf77679={};_0x493172['remoteUri']=_0x493172[_0x162d('0x8')]?intUtil[_0x162d('0x52')](_0x493172[_0x162d('0xa')][_0x162d('0xb')]):intUtil[_0x162d('0x52')](_0x493172[_0x162d('0x9')]);_0x493172[_0x162d('0x53')]=intUtil[_0x162d('0x52')](_0x493172[_0x162d('0x53')]);_0xf77679[_0x162d('0x4a')]=_0x203520===_0x162d('0x4b')||_0x203520==='unmanaged'?_0x162d('0x4b'):_0x162d('0x27');var _0x481ac8=_0x493172['modernAuthentication']?util[_0x162d('0x50')](_0x162d('0x54'),_0x493172[_0x162d('0xa')][_0x162d('0xb')]):util[_0x162d('0x50')](_0x162d('0x54'),_0x493172[_0x162d('0x9')]);var _0x87eac8=util[_0x162d('0x50')](_0x162d('0x55'),_0x493172[_0x162d('0xc')]);var _0x2c1f23=util[_0x162d('0x50')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x493172[_0x162d('0x53')],_0x1ab9ba[_0x162d('0x56')],md5(_0x1ab9ba[_0x162d('0x56')]));if(_0x359d6f&&_0x359d6f['monitor_format']){logger[_0x162d('0x22')](_0x162d('0x57'),_0x162d('0x58'));_0x1ab9ba[_0x162d('0x59')]=_0x2c1f23;}else if(_0x25d03b&&_0x25d03b[_0x162d('0x5a')]&&_0x25d03b['recordingFormat']!=='none'){logger[_0x162d('0x22')](_0x162d('0x5b'),_0x162d('0x58'));_0x1ab9ba['recordingURL']=_0x2c1f23;}else{_0x1ab9ba['recordingURL']='';}return getUser(_0xf77679,_0x493172,_0x214a83,_0x87eac8,_0x481ac8,_0x203520)[_0x162d('0x18')](function(_0x8d6c8e){logger[_0x162d('0x22')]('['+_0x203520[_0x162d('0x16')]()+_0x162d('0x5c'),_0x8d6c8e[_0x162d('0x23')]);logger[_0x162d('0x22')]('['+_0x203520['toUpperCase']()+_0x162d('0x5d'),_0x8d6c8e[_0x162d('0x1f')]);return getEndUser(_0x8d6c8e,_0x493172,_0x87eac8,_0x481ac8,_0x1ab9ba,_0x203520,_0x503a13[_0x162d('0x5e')],_0x503a13[_0x162d('0x5f')]);})[_0x162d('0x18')](function(_0x4564cc){logger[_0x162d('0x22')]('['+_0x203520['toUpperCase']()+_0x162d('0x60'),_0x4564cc['enduserId']);logger[_0x162d('0x22')]('['+_0x203520[_0x162d('0x16')]()+_0x162d('0x61'),_0x1ab9ba['calleridnum']);return getTicket(_0x4564cc,_0x493172,_0x87eac8,_0x481ac8,_0x1ab9ba,_0x503a13,_0x203520);})[_0x162d('0x18')](function(_0x553db0){logger['info'](util[_0x162d('0x50')]('['+_0x203520['toUpperCase']()+_0x162d('0x62'),_0x503a13[_0x162d('0x48')],_0x553db0['ticketId']));logger['info'](util['format']('['+_0x203520[_0x162d('0x16')]()+']\x20Call\x20direction:\x20%s',_0x203520));if(_0x203520!==_0x162d('0x63')&&_0x503a13[_0x162d('0x64')]){logger[_0x162d('0x22')]('['+_0x203520['toUpperCase']()+']',_0x162d('0x65'));emit(_0x493172[_0x162d('0x9')],_0x214a83[_0x162d('0x66')],_0x503a13[_0x162d('0x48')],_0x553db0[_0x162d('0x4f')]);}})['catch'](function(_0x8fc3be){logger[_0x162d('0x15')]('['+_0x203520['toUpperCase']()+_0x162d('0x67'),_0x8fc3be[_0x162d('0x26')]);console[_0x162d('0x15')](_0x162d('0x68'),_0x8fc3be);});}; \ No newline at end of file +var _0x5cb2=[']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','error','lodash','request-promise','util','./util','md5','../../../../config/logger','redis','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','username','password','clientSecret','then','catch','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','userEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','telephone1','contacts?$select=','\x20eq\x20\x27','%2b','value','enduserId','nothing','forEach','includes','picklist','nameField','customField','idField','indexOf','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','callDirection','queue','phonecalls','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','format','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:'];(function(_0x41a810,_0x3d6e35){var _0x31206e=function(_0x550be4){while(--_0x550be4){_0x41a810['push'](_0x41a810['shift']());}};_0x31206e(++_0x3d6e35);}(_0x5cb2,0xda));var _0x25cb=function(_0x3ec1da,_0x1e36f5){_0x3ec1da=_0x3ec1da-0x0;var _0x472358=_0x5cb2[_0x3ec1da];return _0x472358;};'use strict';var _=require(_0x25cb('0x0'));var rp=require(_0x25cb('0x1'));var util=require(_0x25cb('0x2'));var intUtil=require(_0x25cb('0x3'));var md5=require(_0x25cb('0x4'));var Redis=require('ioredis');var logger=require(_0x25cb('0x5'))('dynamics365');var config=require('../../../../config/environment');config['redis']=_['defaults'](config[_0x25cb('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x25cb('0x7'))(new Redis(config[_0x25cb('0x6')]));function getAuthToken(_0x37b235,_0x3c0812,_0x4913a1){if(_0x37b235[_0x25cb('0x8')]){_0x37b235[_0x25cb('0x9')]=_0x37b235[_0x25cb('0xa')][_0x25cb('0xb')];_0x37b235[_0x25cb('0xc')]=_0x37b235[_0x25cb('0xa')][_0x25cb('0xd')];return Promise[_0x25cb('0xe')](_0x37b235[_0x25cb('0xa')][_0x25cb('0xf')]);}var _0x40a005={'method':_0x25cb('0x10'),'uri':_0x3c0812,'form':{'client_id':_0x37b235[_0x25cb('0x11')],'resource':_0x37b235['remoteUri'],'username':_0x37b235[_0x25cb('0x12')],'password':_0x37b235[_0x25cb('0x13')],'grant_type':_0x25cb('0x13'),'client_secret':_0x37b235[_0x25cb('0x14')]},'json':!![]};return rp(_0x40a005)[_0x25cb('0x15')](function(_0x2078ec){return _0x2078ec['access_token'];})[_0x25cb('0x16')](function(_0xd08487){logger['error']('['+[_0x4913a1[_0x25cb('0x17')]()]+_0x25cb('0x18'));return _0xd08487[_0x25cb('0x19')];});}function getUser(_0x152a9d,_0xb057b4,_0x497db7,_0x1eb2a0,_0x479315,_0x2757cd){return new Promise(function(_0x39c5bd,_0x40538d){return getAuthToken(_0xb057b4,_0x1eb2a0,_0x2757cd)[_0x25cb('0x15')](function(_0x427e8f){var _0x1de6bb={'method':_0x25cb('0x1a'),'uri':_0x479315+_0x25cb('0x1b'),'headers':{'Authorization':_0x25cb('0x1c')+_0x427e8f,'OData-Version':_0x25cb('0x1d')},'json':!![]};return rp(_0x1de6bb);})['then'](function(_0x4e7902){var _0x1fe83b=_0x4e7902['value'];var _0x418eab=![];var _0x526f43=null;if(!_[_0x25cb('0x1e')](_0x497db7)){if(intUtil[_0x25cb('0x1f')](_0x497db7['email'])){_0x152a9d[_0x25cb('0x20')]=_0x497db7[_0x25cb('0x21')];for(_0x526f43=0x0;_0x526f43<_0x1fe83b[_0x25cb('0x22')];_0x526f43++){if(_0x1fe83b[_0x526f43][_0x25cb('0x23')]===_0x497db7['email']&&!_0x1fe83b[_0x526f43][_0x25cb('0x24')]){_0x418eab=!![];logger[_0x25cb('0x25')]('['+[_0x2757cd[_0x25cb('0x17')]()]+_0x25cb('0x26')+_0x1fe83b[_0x526f43]['systemuserid']+'!');_0x152a9d['userId']=_0x1fe83b[_0x526f43][_0x25cb('0x27')];}}}}if(!_0x418eab){logger['info']('['+[_0x2757cd[_0x25cb('0x17')]()]+_0x25cb('0x28'));_0x152a9d[_0x25cb('0x20')]=_0xb057b4[_0x25cb('0x12')];for(_0x526f43=0x0;_0x526f43<_0x1fe83b[_0x25cb('0x22')];_0x526f43++){if(_0x1fe83b[_0x526f43][_0x25cb('0x23')]===_0xb057b4[_0x25cb('0x12')]){_0x152a9d[_0x25cb('0x29')]=_0x1fe83b[_0x526f43][_0x25cb('0x27')];}}}_0x39c5bd(_0x152a9d);})['catch'](function(_0x262b6a){_0x40538d(_0x262b6a[_0x25cb('0x19')]);});});}function createEndUser(_0x4f5921,_0xe1a6bc,_0x190964,_0x1474d7,_0x35ab94,_0x200c6f,_0x40ba58){return new Promise(function(_0x2a3416,_0x25160a){return getAuthToken(_0xe1a6bc,_0x190964,_0x200c6f)[_0x25cb('0x15')](function(_0x3e99d2){var _0x19e826=_0x200c6f[_0x25cb('0x2a')]()===_0x25cb('0x2b')?_0x35ab94[_0x25cb('0x2c')]:_0x35ab94[_0x25cb('0x2d')];var _0x11983c={'method':_0x25cb('0x10'),'uri':_0x1474d7+_0x25cb('0x2e'),'body':{'fullname':_0x19e826,'firstname':_0x19e826,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x25cb('0x2f')+_0x4f5921[_0x25cb('0x29')]+')'},'headers':{'Authorization':_0x25cb('0x1c')+_0x3e99d2,'OData-Version':_0x25cb('0x1d')},'json':!![],'resolveWithFullResponse':!![]};_0x11983c['body'][_0x40ba58]=_0x19e826;return rp(_0x11983c);})[_0x25cb('0x15')](function(_0x1cc54d){var _0x3b12cd=_0x1cc54d[_0x25cb('0x30')][_0x25cb('0x31')];var _0x38cc8f=_0x3b12cd[_0x25cb('0x32')](_0x3b12cd[_0x25cb('0x33')]('(')+0x1,_0x3b12cd[_0x25cb('0x33')](')'));_0x4f5921['enduserId']=_0x38cc8f;_0x2a3416(_0x4f5921);})[_0x25cb('0x16')](function(_0x1ee63e){_0x25160a(_0x1ee63e['message']);});});}function getEndUser(_0x2c2e63,_0x138480,_0x2ed244,_0xe7b6f8,_0x2bbc69,_0x1e3a79,_0x476ffe,_0x3f86bc){var _0x2b5b1a=_0x1e3a79['toLowerCase']()===_0x25cb('0x2b')?_0x2bbc69[_0x25cb('0x2c')]:_0x2bbc69[_0x25cb('0x2d')];return getAuthToken(_0x138480,_0x2ed244,_0x1e3a79)[_0x25cb('0x15')](function(_0x1b61b6){_0x3f86bc=_0x3f86bc?_0x3f86bc:_0x25cb('0x34');var _0x55b126={'method':'GET','uri':_0xe7b6f8+_0x25cb('0x35')+_0x3f86bc+'&$filter='+_0x3f86bc+_0x25cb('0x36')+_0x2b5b1a['replace']('+',_0x25cb('0x37'))+'\x27','headers':{'Authorization':_0x25cb('0x1c')+_0x1b61b6,'If-None-Match':null,'OData-Version':_0x25cb('0x1d')},'json':!![]};return rp(_0x55b126);})[_0x25cb('0x15')](function(_0x304469){var _0x4f410d=![];if(!_0x304469)return _0x4f410d;var _0x230344=_0x304469[_0x25cb('0x38')];for(var _0xa701f4=0x0;_0xa701f4<_0x230344[_0x25cb('0x22')];_0xa701f4++){if(_0x230344[_0xa701f4][_0x3f86bc]===_0x2b5b1a){_0x4f410d=!![];_0x2c2e63[_0x25cb('0x39')]=_0x230344[_0xa701f4]['contactid'];}}return _0x4f410d;})[_0x25cb('0x15')](function(_0x4c82e8){if(_0x4c82e8)return _0x2c2e63;if(_0x476ffe===_0x25cb('0x3a')){logger[_0x25cb('0x25')]('['+[_0x1e3a79['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x2c2e63;}return createEndUser(_0x2c2e63,_0x138480,_0x2ed244,_0xe7b6f8,_0x2bbc69,_0x1e3a79,_0x3f86bc)[_0x25cb('0x15')](function(_0x4ac254){logger[_0x25cb('0x25')]('['+[_0x1e3a79[_0x25cb('0x17')]()]+']\x20Enduser\x20created!',_0x4ac254[_0x25cb('0x39')]);return _0x4ac254;});});}function getCustomFields(_0xbbf4eb,_0x273962,_0x3b499a){var _0x16f954={};if(_0xbbf4eb['length']>0x0){_[_0x25cb('0x3b')](_0xbbf4eb,function(_0x184499){if(_[_0x25cb('0x3c')](['string',_0x25cb('0x3d')],_0x184499['type'])&&_0x184499[_0x25cb('0x3e')]&&!_0x184499[_0x25cb('0x3f')]){var _0x1bdcfd=_0x184499[_0x25cb('0x40')]['toLowerCase']();var _0x11ba01=_0x1bdcfd[_0x25cb('0x32')](0x0,_0x1bdcfd[_0x25cb('0x41')]('_'));var _0x3153cc=_0x1bdcfd[_0x25cb('0x32')](_0x1bdcfd['indexOf']('_')+0x1);if(_0x11ba01===_0x3b499a){_0x16f954[_0x3153cc]=_0x184499['content'];}}});}return _0x16f954;}function getTicket(_0x559400,_0x4386e4,_0x395df0,_0x38a4c5,_0x30eb86,_0x47c502,_0x5837c3){return new Promise(function(_0x6a09ab,_0x4ef0bd){var _0xfc724a;return getAuthToken(_0x4386e4,_0x395df0,_0x5837c3)[_0x25cb('0x15')](function(_0x4f35fe){if(_0x47c502[_0x25cb('0x42')]===_0x25cb('0x43')){_0xfc724a={'method':_0x25cb('0x10'),'uri':_0x38a4c5+_0x25cb('0x44'),'body':Object[_0x25cb('0x45')]({},{'title':intUtil[_0x25cb('0x46')](_0x47c502[_0x25cb('0x47')],_0x30eb86,'\x20'),'description':intUtil[_0x25cb('0x46')](_0x47c502[_0x25cb('0x48')],_0x30eb86,'\x0a'),'customerid_contact@odata.bind':_0x559400[_0x25cb('0x39')]?_0x25cb('0x49')+_0x559400[_0x25cb('0x39')]+')':undefined,'ownerid@odata.bind':_0x25cb('0x2f')+_0x559400[_0x25cb('0x29')]+')','caseorigincode':'1'},getCustomFields(_0x47c502[_0x25cb('0x4a')],_0x30eb86,_0x47c502[_0x25cb('0x42')])),'headers':{'Authorization':_0x25cb('0x1c')+_0x4f35fe,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x47c502[_0x25cb('0x42')]==='phonecall'){var _0x1c38f9=_0x559400[_0x25cb('0x39')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x559400['userId']+')','participationtypemask':_0x559400[_0x25cb('0x4b')]===_0x25cb('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0x25cb('0x49')+_0x559400[_0x25cb('0x39')]+')','participationtypemask':_0x559400['callDirection']===_0x25cb('0x4c')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x25cb('0x2f')+_0x559400[_0x25cb('0x29')]+')','participationtypemask':_0x559400[_0x25cb('0x4b')]===_0x25cb('0x4c')?0x2:0x1}];_0xfc724a={'method':_0x25cb('0x10'),'uri':_0x38a4c5+_0x25cb('0x4d'),'body':Object[_0x25cb('0x45')]({},{'subject':intUtil[_0x25cb('0x46')](_0x47c502[_0x25cb('0x47')],_0x30eb86,'\x20'),'phonenumber':String(_0x30eb86[_0x25cb('0x2d')]),'description':intUtil[_0x25cb('0x46')](_0x47c502[_0x25cb('0x48')],_0x30eb86,'\x0a'),'regardingobjectid_contact@odata.bind':_0x559400['enduserId']?'/contacts('+_0x559400[_0x25cb('0x39')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x559400[_0x25cb('0x29')]+')','directioncode':_0x559400[_0x25cb('0x4b')]==='queue'?![]:!![],'phonecall_activity_parties':_0x1c38f9},getCustomFields(_0x47c502[_0x25cb('0x4a')],_0x30eb86,_0x47c502[_0x25cb('0x42')])),'headers':{'Authorization':_0x25cb('0x1c')+_0x4f35fe,'OData-Version':_0x25cb('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xfc724a);})['then'](function(_0x4924cd){var _0x56aa9b=_0x4924cd['headers'][_0x25cb('0x31')];var _0x38b98b=_0x56aa9b[_0x25cb('0x32')](_0x56aa9b[_0x25cb('0x33')]('(')+0x1,_0x56aa9b[_0x25cb('0x33')](')'));_0x559400[_0x25cb('0x4e')]=_0x38b98b;_0x6a09ab(_0x559400);})['catch'](function(_0x514866){_0x4ef0bd(_0x514866[_0x25cb('0x19')]);});});}function emit(_0x285e1c,_0x1f2af3,_0x12fb9c,_0x3d2063){var _0x6406f0={'uri':util['format'](_0x25cb('0x4f'),_0x285e1c,_0x12fb9c,_0x3d2063)};io['to'](util['format'](_0x25cb('0x50'),_0x1f2af3))[_0x25cb('0x51')](_0x25cb('0x52'),_0x6406f0);}exports['cs']=function(_0x45956f,_0x535827,_0x3775ca,_0x2262f2,_0x3fa007,_0xd57b2d,_0x57a1c9,_0x24c808){var _0x1fe60c={};_0xd57b2d[_0x25cb('0x9')]=_0xd57b2d[_0x25cb('0x8')]?intUtil[_0x25cb('0x53')](_0xd57b2d[_0x25cb('0xa')][_0x25cb('0xb')]):intUtil[_0x25cb('0x53')](_0xd57b2d[_0x25cb('0x9')]);_0xd57b2d[_0x25cb('0x54')]=intUtil['stripTrailingSlash'](_0xd57b2d['serverUrl']);_0x1fe60c['callDirection']=_0x24c808==='queue'||_0x24c808===_0x25cb('0x55')?'queue':_0x25cb('0x2b');var _0x66d39c=_0xd57b2d[_0x25cb('0x8')]?util['format'](_0x25cb('0x56'),_0xd57b2d[_0x25cb('0xa')]['data7']):util[_0x25cb('0x57')](_0x25cb('0x56'),_0xd57b2d['remoteUri']);var _0x2755ef=util[_0x25cb('0x57')](_0x25cb('0x58'),_0xd57b2d[_0x25cb('0xc')]);var _0x469112=util[_0x25cb('0x57')](_0x25cb('0x59'),_0xd57b2d['serverUrl'],_0x535827[_0x25cb('0x5a')],md5(_0x535827[_0x25cb('0x5a')]));if(_0x3fa007&&_0x3fa007[_0x25cb('0x5b')]){logger[_0x25cb('0x25')](_0x25cb('0x5c'),_0x25cb('0x5d'));_0x535827[_0x25cb('0x5e')]=_0x469112;}else if(_0x57a1c9&&_0x57a1c9['recordingFormat']&&_0x57a1c9[_0x25cb('0x5f')]!==_0x25cb('0x60')){logger[_0x25cb('0x25')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x535827['recordingURL']=_0x469112;}else{_0x535827[_0x25cb('0x5e')]='';}return getUser(_0x1fe60c,_0xd57b2d,_0x2262f2,_0x2755ef,_0x66d39c,_0x24c808)[_0x25cb('0x15')](function(_0x33564f){logger[_0x25cb('0x25')]('['+_0x24c808['toUpperCase']()+_0x25cb('0x61'),_0x33564f[_0x25cb('0x29')]);logger['info']('['+_0x24c808[_0x25cb('0x17')]()+']\x20The\x20User\x20email\x20is:',_0x33564f[_0x25cb('0x20')]);return getEndUser(_0x33564f,_0xd57b2d,_0x2755ef,_0x66d39c,_0x535827,_0x24c808,_0x3775ca['moduleCreate'],_0x3775ca[_0x25cb('0x62')]);})[_0x25cb('0x15')](function(_0x359108){logger[_0x25cb('0x25')]('['+_0x24c808['toUpperCase']()+_0x25cb('0x63'),_0x359108[_0x25cb('0x39')]);logger[_0x25cb('0x25')]('['+_0x24c808[_0x25cb('0x17')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x535827[_0x25cb('0x2d')]);return getTicket(_0x359108,_0xd57b2d,_0x2755ef,_0x66d39c,_0x535827,_0x3775ca,_0x24c808);})['then'](function(_0x3ec008){logger[_0x25cb('0x25')](util[_0x25cb('0x57')]('['+_0x24c808[_0x25cb('0x17')]()+_0x25cb('0x64'),_0x3775ca[_0x25cb('0x42')],_0x3ec008[_0x25cb('0x4e')]));logger['info'](util[_0x25cb('0x57')]('['+_0x24c808['toUpperCase']()+_0x25cb('0x65'),_0x24c808));if(_0x24c808!==_0x25cb('0x55')&&_0x3775ca[_0x25cb('0x66')]){logger[_0x25cb('0x25')]('['+_0x24c808['toUpperCase']()+']',_0x25cb('0x67'));emit(_0xd57b2d[_0x25cb('0x9')],_0x2262f2['name'],_0x3775ca[_0x25cb('0x42')],_0x3ec008[_0x25cb('0x4e')]);}})[_0x25cb('0x16')](function(_0x37de17){logger['error']('['+_0x24c808[_0x25cb('0x17')]()+_0x25cb('0x68'),_0x37de17[_0x25cb('0x19')]);console[_0x25cb('0x69')]('Error\x20running\x20Dynamics365\x20integration',_0x37de17);});}; \ 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 dd38f96..dee4569 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 _0xa6ad=['[HTTP]','stringify','GET','forEach','includes','string','picklist','type','nameField','content','idField','customField','variable','variableName','push','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','unmanaged','monitor_format','lastevent','toUpperCase','lodash','md5','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','keyBy','value','%s/api/v2/tickets','POST','Ticket\x20created!','remoteUri','then','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!','%s/api/v2/contacts','Enduser\x20created.','apiKey','toString','base64','debug'];(function(_0x3d12dc,_0x2466e1){var _0x11e95f=function(_0x158cdd){while(--_0x158cdd){_0x3d12dc['push'](_0x3d12dc['shift']());}};_0x11e95f(++_0x2466e1);}(_0xa6ad,0x19b));var _0xda6a=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xa6ad[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0xda6a('0x0'));var rp=require('request-promise');var md5=require(_0xda6a('0x1'));var util=require('util');var Redis=require(_0xda6a('0x2'));var intUtil=require(_0xda6a('0x3'));var config=require('../../../../config/environment');var logger=require(_0xda6a('0x4'))('freshdesk');config['redis']=_[_0xda6a('0x5')](config[_0xda6a('0x6')],{'host':_0xda6a('0x7'),'port':0x18eb});var io=require(_0xda6a('0x8'))(new Redis(config['redis']));var headers={'Content-Type':_0xda6a('0x9'),'Accept':_0xda6a('0x9')};function emit(_0x3259c3,_0x3f852c,_0x3c3dfc){io['to'](_0x3259c3)['emit'](_0x3f852c,_0x3c3dfc);}function getTicket(_0x3ed0b1,_0x58738d,_0x2c9eda,_0x1d0e8c,_0x3f0e03){logger[_0xda6a('0xa')]('Creating\x20new\x20ticket...');var _0x348085=_[_0xda6a('0xb')]({'responder_id':_0x58738d['id'],'requester_id':_0x2c9eda['id'],'name':util[_0xda6a('0xc')](_0xda6a('0xd'),_0x3f0e03[_0xda6a('0xe')]),'phone':_0x3f0e03[_0xda6a('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xda6a('0x10')](_0x1d0e8c[_0xda6a('0x11')],_0x3f0e03,'\x20'),'description':intUtil[_0xda6a('0x10')](_0x1d0e8c[_0xda6a('0x12')],_0x3f0e03,_0xda6a('0x13')),'tags':getTags(_0x1d0e8c[_0xda6a('0x14')],_0xda6a('0x15'))},getCustomFields(_0x1d0e8c[_0xda6a('0x16')],_0x3f0e03));_0x348085[_0xda6a('0x17')]=_['mapValues'](_[_0xda6a('0x18')](_0x348085[_0xda6a('0x17')],'id'),_0xda6a('0x19'));return request({'uri':util[_0xda6a('0xc')](_0xda6a('0x1a'),_0x3ed0b1['remoteUri']),'method':_0xda6a('0x1b'),'body':_0x348085})['then'](function(_0x1cd6cd){logger[_0xda6a('0xa')](_0xda6a('0x1c'));return _0x1cd6cd;});}function getUser(_0x4678f1,_0x114e18){if(intUtil['validateEmail'](_0x114e18)){return request({'uri':util[_0xda6a('0xc')]('%s/api/v2/agents',_0x4678f1[_0xda6a('0x1d')]),'qs':{'email':_0x114e18}})[_0xda6a('0x1e')](function(_0x1788e0){if(_0x1788e0[_0xda6a('0x1f')]){logger['info'](_0xda6a('0x20'));return _[_0xda6a('0x21')](_0x1788e0,function(_0x5435a4){return _0x5435a4[_0xda6a('0x22')][_0xda6a('0x23')]===_0x114e18;});}else{logger['info'](_0xda6a('0x24'));return request({'uri':util[_0xda6a('0xc')](_0xda6a('0x25'),_0x4678f1[_0xda6a('0x1d')])})[_0xda6a('0x1e')](function(_0x301c4a){logger['info'](_0xda6a('0x26'));return _0x301c4a;});}});}else{logger[_0xda6a('0xa')](_0xda6a('0x27'));return request({'uri':util[_0xda6a('0xc')](_0xda6a('0x25'),_0x4678f1[_0xda6a('0x1d')])})[_0xda6a('0x1e')](function(_0x46c5ac){logger[_0xda6a('0xa')]('Admin\x20account\x20selected.');return _0x46c5ac;});}}function getEndUser(_0x16c469,_0x19711b,_0x18eae2){logger['info'](_0xda6a('0x28'),_0x18eae2);return request({'uri':util[_0xda6a('0xc')]('%s/api/v2/contacts',_0x16c469[_0xda6a('0x1d')]),'qs':{'phone':_0x18eae2}})['then'](function(_0x1b9f52){if(_0x1b9f52[_0xda6a('0x1f')]){logger['info'](_0xda6a('0x29'));return _[_0xda6a('0x21')](_0x1b9f52,{'phone':_0x18eae2});}else{logger[_0xda6a('0xa')](_0xda6a('0x2a'));return request({'uri':util[_0xda6a('0xc')](_0xda6a('0x2b'),_0x16c469['remoteUri']),'method':_0xda6a('0x1b'),'body':{'name':_0x19711b,'phone':_0x18eae2}})['then'](function(_0x59c752){logger['info'](_0xda6a('0x2c'));return _0x59c752;});}});}function getAuth(_0x30d327){return util[_0xda6a('0xc')]('Basic\x20%s',new Buffer(_0x30d327[_0xda6a('0x2d')]+':X')[_0xda6a('0x2e')](_0xda6a('0x2f')));}function request(_0x4500b2){logger[_0xda6a('0x30')](_0xda6a('0x31'),JSON[_0xda6a('0x32')](_0x4500b2));return rp(_[_0xda6a('0x5')](_0x4500b2,{'method':_0xda6a('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x11e486,_0x43add8){var _0x3a4a6d=[];if(_0x11e486&&_0x11e486[_0xda6a('0x1f')]>0x0){_0x3a4a6d=_['map'](_0x11e486,_0x43add8);}return _0x3a4a6d;}function getCustomFields(_0x1d4496,_0x4d73df){var _0xbafaee=[];var _0x10030a={'custom_fields':[]};if(_0x1d4496['length']>0x0){_[_0xda6a('0x34')](_0x1d4496,function(_0x1b120c){if(_[_0xda6a('0x35')]([_0xda6a('0x36'),_0xda6a('0x37')],_0x1b120c[_0xda6a('0x38')])&&_0x1b120c['nameField']&&!_0x1b120c['customField']){_0x10030a[_0x1b120c[_0xda6a('0x39')]['toLowerCase']()]=_0x1b120c[_0xda6a('0x3a')][_0xda6a('0x2e')]();}else if(_[_0xda6a('0x35')]([_0xda6a('0x36'),_0xda6a('0x37')],_0x1b120c[_0xda6a('0x38')])&&_0x1b120c[_0xda6a('0x3b')]&&_0x1b120c[_0xda6a('0x3c')]){_0x10030a['custom_fields']['push']({'id':_0x1b120c[_0xda6a('0x3b')],'value':_0x1b120c[_0xda6a('0x3a')][_0xda6a('0x2e')]()});}else if(_0x1b120c['type']===_0xda6a('0x3d')&&_0x1b120c[_0xda6a('0x3e')]&&_0x1b120c[_0xda6a('0x3b')]&&_0x1b120c[_0xda6a('0x3c')]){_0x4d73df[_0x1b120c[_0xda6a('0x3e')]]&&_0x10030a[_0xda6a('0x17')][_0xda6a('0x3f')]({'id':_0x1b120c[_0xda6a('0x3b')],'value':_0x4d73df[_0x1b120c[_0xda6a('0x3e')]][_0xda6a('0x2e')]()});}else if(_0x1b120c[_0xda6a('0x38')]==='customVariable'&&_0x1b120c['Variable']&&_0x1b120c['Variable'][_0xda6a('0x15')]&&_0x1b120c[_0xda6a('0x3b')]&&_0x1b120c[_0xda6a('0x3c')]){_0x4d73df[_0x1b120c[_0xda6a('0x40')][_0xda6a('0x15')][_0xda6a('0x41')]()]&&_0x10030a[_0xda6a('0x17')][_0xda6a('0x3f')]({'id':_0x1b120c[_0xda6a('0x3b')],'value':_0x4d73df[_0x1b120c[_0xda6a('0x40')][_0xda6a('0x15')][_0xda6a('0x41')]()][_0xda6a('0x2e')]()});}});}return _0x10030a;}exports[_0xda6a('0x42')]=function(_0x2cf97e,_0x45bdf6,_0x378e94,_0x1f48b8,_0x59698b,_0x341566){var _0x1ac6b9,_0x227e40;_0x341566[_0xda6a('0x1d')]=intUtil[_0xda6a('0x43')](_0x341566[_0xda6a('0x1d')]);_0x341566[_0xda6a('0x44')]=intUtil['stripTrailingSlash'](_0x341566[_0xda6a('0x44')]);if(_0x59698b&&_0x59698b['monitor_format']){logger[_0xda6a('0xa')](_0xda6a('0x45'),_0xda6a('0x46'));_0x45bdf6[_0xda6a('0x47')]=util[_0xda6a('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x341566[_0xda6a('0x44')],_0x45bdf6[_0xda6a('0x48')],md5(_0x45bdf6[_0xda6a('0x48')]));}else{_0x45bdf6[_0xda6a('0x47')]='';}headers[_0xda6a('0x49')]=getAuth(_0x341566);return getUser(_0x341566,_0x1f48b8[_0xda6a('0x23')])[_0xda6a('0x1e')](function(_0x2791d1){_0x1ac6b9=_0x2791d1;logger['info'](_0xda6a('0x4a'),_0x1ac6b9['id']);return getEndUser(_0x341566,_0x45bdf6[_0xda6a('0xe')],_0x45bdf6[_0xda6a('0xf')]);})[_0xda6a('0x1e')](function(_0x5e03cf){_0x227e40=_0x5e03cf;logger[_0xda6a('0xa')](_0xda6a('0x4b'),_0x227e40['id']);return getTicket(_0x341566,_0x1ac6b9,_0x227e40,_0x378e94,_0x45bdf6);})[_0xda6a('0x1e')](function(_0x497ad2){if(_0x497ad2&&_0x497ad2['id']){logger[_0xda6a('0xa')](_0xda6a('0x1c'));logger[_0xda6a('0xa')](_0xda6a('0x4c'),_0x497ad2['id']);logger[_0xda6a('0xa')](_0xda6a('0x45'),_0xda6a('0x4d'));emit(util['format'](_0xda6a('0x4e'),_0x1f48b8[_0xda6a('0x15')]),_0xda6a('0x4f'),{'uri':util[_0xda6a('0xc')](_0xda6a('0x50'),_0x341566[_0xda6a('0x1d')],_0x497ad2['id'])});}})[_0xda6a('0x51')](function(_0x5822e3){logger[_0xda6a('0x52')](_0xda6a('0x45'),JSON['stringify'](_0x5822e3));});};exports['outbound']=function(_0x1ca32e,_0x409c27,_0x4d0855,_0x2ad621,_0x40a66b,_0x207131,_0x50d807){var _0x21e591,_0x45c0ed;_0x207131['remoteUri']=intUtil['stripTrailingSlash'](_0x207131[_0xda6a('0x1d')]);_0x207131[_0xda6a('0x44')]=intUtil[_0xda6a('0x43')](_0x207131['serverUrl']);if(_0x50d807&&_0x50d807[_0xda6a('0x53')]&&_0x50d807[_0xda6a('0x53')]!=='none'){logger[_0xda6a('0xa')](_0xda6a('0x54'),_0xda6a('0x46'));_0x409c27[_0xda6a('0x47')]=util[_0xda6a('0xc')](_0xda6a('0x55'),_0x207131[_0xda6a('0x44')],_0x409c27[_0xda6a('0x48')],md5(_0x409c27[_0xda6a('0x48')]));}headers[_0xda6a('0x49')]=getAuth(_0x207131);return getUser(_0x207131,_0x2ad621[_0xda6a('0x23')])[_0xda6a('0x1e')](function(_0x5b6acf){_0x21e591=_0x5b6acf;logger[_0xda6a('0xa')](_0xda6a('0x4a'),_0x21e591['id']);return getEndUser(_0x207131,_0x409c27[_0xda6a('0x56')],_0x409c27[_0xda6a('0x57')]);})[_0xda6a('0x1e')](function(_0x1a9b0f){_0x45c0ed=_0x1a9b0f;logger[_0xda6a('0xa')](_0xda6a('0x4b'),_0x45c0ed['id']);return getTicket(_0x207131,_0x21e591,_0x45c0ed,_0x4d0855,_0x409c27);})[_0xda6a('0x1e')](function(_0x498510){if(_0x498510&&_0x498510['id']){logger[_0xda6a('0xa')]('Ticket\x20created!');logger[_0xda6a('0xa')]('The\x20Ticket\x20ID\x20is:',_0x498510['id']);logger[_0xda6a('0xa')]('[OUTBOUND]',_0xda6a('0x4d'));emit(util[_0xda6a('0xc')](_0xda6a('0x4e'),_0x2ad621['name']),_0xda6a('0x4f'),{'uri':util[_0xda6a('0xc')](_0xda6a('0x50'),_0x207131[_0xda6a('0x1d')],_0x498510['id'])});}})[_0xda6a('0x51')](function(_0xd203af){logger[_0xda6a('0x52')](_0xda6a('0x54'),JSON[_0xda6a('0x32')](_0xd203af));});};exports[_0xda6a('0x58')]=function(_0x2f11fd,_0x4e7bfd,_0x2c908d,_0x36c05b,_0x4555f2,_0x16179b){var _0x1ee2d4,_0x4c6a8d;_0x16179b['remoteUri']=intUtil['stripTrailingSlash'](_0x16179b[_0xda6a('0x1d')]);_0x16179b[_0xda6a('0x44')]=intUtil[_0xda6a('0x43')](_0x16179b[_0xda6a('0x44')]);if(_0x4555f2&&_0x4555f2[_0xda6a('0x59')]){logger[_0xda6a('0xa')]('['+_0x4e7bfd[_0xda6a('0x5a')]['toUpperCase']()+']',_0xda6a('0x46'));_0x4e7bfd['recordingURL']=util[_0xda6a('0xc')](_0xda6a('0x55'),_0x16179b[_0xda6a('0x44')],_0x4e7bfd['uniqueid'],md5(_0x4e7bfd['uniqueid']));}else{_0x4e7bfd['recordingURL']='';}headers[_0xda6a('0x49')]=getAuth(_0x16179b);return getUser(_0x16179b,'')[_0xda6a('0x1e')](function(_0x98833a){_0x1ee2d4=_0x98833a;logger[_0xda6a('0xa')](_0xda6a('0x4a'),_0x1ee2d4['id']);return getEndUser(_0x16179b,_0x4e7bfd['calleridname'],_0x4e7bfd['calleridnum']);})[_0xda6a('0x1e')](function(_0x57a9d5){_0x4c6a8d=_0x57a9d5;logger[_0xda6a('0xa')]('The\x20Enduser\x20ID\x20is:',_0x4c6a8d['id']);return getTicket(_0x16179b,_0x1ee2d4,_0x4c6a8d,_0x2c908d,_0x4e7bfd);})[_0xda6a('0x1e')](function(_0x3b3e9b){if(_0x3b3e9b){logger[_0xda6a('0xa')](_0xda6a('0x1c'));logger['info'](_0xda6a('0x4c'),_0x3b3e9b['id']);}})[_0xda6a('0x51')](function(_0x1cdf07){logger[_0xda6a('0x52')]('['+_0x4e7bfd[_0xda6a('0x5a')][_0xda6a('0x5b')]()+']',JSON[_0xda6a('0x32')](_0x1cdf07));});}; \ No newline at end of file +var _0xb777=['%s/helpdesk/tickets/%d','catch','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','lastevent','The\x20Enduser\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','Tags','name','custom_fields','remoteUri','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','POST','Enduser\x20created.','apiKey','toString','base64','[HTTP]','GET','forEach','includes','string','picklist','type','nameField','customField','content','idField','push','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xb777,0x68));var _0x7b77=function(_0x4e291f,_0x202c9){_0x4e291f=_0x4e291f-0x0;var _0x3b2d52=_0xb777[_0x4e291f];return _0x3b2d52;};'use strict';var _=require(_0x7b77('0x0'));var rp=require(_0x7b77('0x1'));var md5=require(_0x7b77('0x2'));var util=require(_0x7b77('0x3'));var Redis=require(_0x7b77('0x4'));var intUtil=require(_0x7b77('0x5'));var config=require(_0x7b77('0x6'));var logger=require('../../../../config/logger')(_0x7b77('0x7'));config[_0x7b77('0x8')]=_[_0x7b77('0x9')](config[_0x7b77('0x8')],{'host':_0x7b77('0xa'),'port':0x18eb});var io=require(_0x7b77('0xb'))(new Redis(config[_0x7b77('0x8')]));var headers={'Content-Type':_0x7b77('0xc'),'Accept':_0x7b77('0xc')};function emit(_0x5cf36e,_0x32abd8,_0x4e20c1){io['to'](_0x5cf36e)[_0x7b77('0xd')](_0x32abd8,_0x4e20c1);}function getTicket(_0x49ee4b,_0x470f23,_0x22a724,_0x5912c5,_0x1fd7ed){logger[_0x7b77('0xe')](_0x7b77('0xf'));var _0x45268b=_[_0x7b77('0x10')]({'responder_id':_0x470f23['id'],'requester_id':_0x22a724['id'],'name':util[_0x7b77('0x11')](_0x7b77('0x12'),_0x1fd7ed[_0x7b77('0x13')]),'phone':_0x1fd7ed[_0x7b77('0x14')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x5912c5['Subjects'],_0x1fd7ed,'\x20'),'description':intUtil[_0x7b77('0x15')](_0x5912c5[_0x7b77('0x16')],_0x1fd7ed,'
'),'tags':getTags(_0x5912c5[_0x7b77('0x17')],_0x7b77('0x18'))},getCustomFields(_0x5912c5['Fields'],_0x1fd7ed));_0x45268b[_0x7b77('0x19')]=_['mapValues'](_['keyBy'](_0x45268b[_0x7b77('0x19')],'id'),'value');return request({'uri':util[_0x7b77('0x11')]('%s/api/v2/tickets',_0x49ee4b[_0x7b77('0x1a')]),'method':'POST','body':_0x45268b})[_0x7b77('0x1b')](function(_0xdd6e21){logger[_0x7b77('0xe')](_0x7b77('0x1c'));return _0xdd6e21;});}function getUser(_0x1cff92,_0x308141){if(intUtil[_0x7b77('0x1d')](_0x308141)){return request({'uri':util[_0x7b77('0x11')](_0x7b77('0x1e'),_0x1cff92[_0x7b77('0x1a')]),'qs':{'email':_0x308141}})[_0x7b77('0x1b')](function(_0xd6c9dc){if(_0xd6c9dc[_0x7b77('0x1f')]){logger[_0x7b77('0xe')](_0x7b77('0x20'));return _[_0x7b77('0x21')](_0xd6c9dc,function(_0xbf543f){return _0xbf543f[_0x7b77('0x22')][_0x7b77('0x23')]===_0x308141;});}else{logger['info'](_0x7b77('0x24'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x1cff92[_0x7b77('0x1a')])})[_0x7b77('0x1b')](function(_0x352857){logger[_0x7b77('0xe')](_0x7b77('0x25'));return _0x352857;});}});}else{logger[_0x7b77('0xe')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x7b77('0x11')](_0x7b77('0x26'),_0x1cff92[_0x7b77('0x1a')])})[_0x7b77('0x1b')](function(_0x1464cc){logger[_0x7b77('0xe')]('Admin\x20account\x20selected.');return _0x1464cc;});}}function getEndUser(_0x308c1c,_0x3fb38a,_0x430dfc){logger[_0x7b77('0xe')](_0x7b77('0x27'),_0x430dfc);return request({'uri':util['format'](_0x7b77('0x28'),_0x308c1c[_0x7b77('0x1a')]),'qs':{'phone':_0x430dfc}})[_0x7b77('0x1b')](function(_0x45fb05){if(_0x45fb05[_0x7b77('0x1f')]){logger[_0x7b77('0xe')](_0x7b77('0x29'));return _['find'](_0x45fb05,{'phone':_0x430dfc});}else{logger[_0x7b77('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x7b77('0x11')](_0x7b77('0x28'),_0x308c1c['remoteUri']),'method':_0x7b77('0x2a'),'body':{'name':_0x3fb38a,'phone':_0x430dfc}})['then'](function(_0x3097df){logger[_0x7b77('0xe')](_0x7b77('0x2b'));return _0x3097df;});}});}function getAuth(_0xb5a7e6){return util[_0x7b77('0x11')]('Basic\x20%s',new Buffer(_0xb5a7e6[_0x7b77('0x2c')]+':X')[_0x7b77('0x2d')](_0x7b77('0x2e')));}function request(_0x1b1064){logger['debug'](_0x7b77('0x2f'),JSON['stringify'](_0x1b1064));return rp(_[_0x7b77('0x9')](_0x1b1064,{'method':_0x7b77('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x206e78,_0x180ed8){var _0x5f21dd=[];if(_0x206e78&&_0x206e78[_0x7b77('0x1f')]>0x0){_0x5f21dd=_['map'](_0x206e78,_0x180ed8);}return _0x5f21dd;}function getCustomFields(_0x49c63e,_0x38269e){var _0x39b789=[];var _0x1d2273={'custom_fields':[]};if(_0x49c63e[_0x7b77('0x1f')]>0x0){_[_0x7b77('0x31')](_0x49c63e,function(_0x4d9f02){if(_[_0x7b77('0x32')]([_0x7b77('0x33'),_0x7b77('0x34')],_0x4d9f02[_0x7b77('0x35')])&&_0x4d9f02[_0x7b77('0x36')]&&!_0x4d9f02[_0x7b77('0x37')]){_0x1d2273[_0x4d9f02[_0x7b77('0x36')]['toLowerCase']()]=_0x4d9f02[_0x7b77('0x38')][_0x7b77('0x2d')]();}else if(_[_0x7b77('0x32')]([_0x7b77('0x33'),'picklist'],_0x4d9f02[_0x7b77('0x35')])&&_0x4d9f02[_0x7b77('0x39')]&&_0x4d9f02[_0x7b77('0x37')]){_0x1d2273[_0x7b77('0x19')][_0x7b77('0x3a')]({'id':_0x4d9f02[_0x7b77('0x39')],'value':_0x4d9f02[_0x7b77('0x38')][_0x7b77('0x2d')]()});}else if(_0x4d9f02[_0x7b77('0x35')]===_0x7b77('0x3b')&&_0x4d9f02[_0x7b77('0x3c')]&&_0x4d9f02[_0x7b77('0x39')]&&_0x4d9f02[_0x7b77('0x37')]){_0x38269e[_0x4d9f02[_0x7b77('0x3c')]]&&_0x1d2273[_0x7b77('0x19')]['push']({'id':_0x4d9f02[_0x7b77('0x39')],'value':_0x38269e[_0x4d9f02[_0x7b77('0x3c')]]['toString']()});}else if(_0x4d9f02[_0x7b77('0x35')]===_0x7b77('0x3d')&&_0x4d9f02[_0x7b77('0x3e')]&&_0x4d9f02[_0x7b77('0x3e')][_0x7b77('0x18')]&&_0x4d9f02[_0x7b77('0x39')]&&_0x4d9f02[_0x7b77('0x37')]){_0x38269e[_0x4d9f02[_0x7b77('0x3e')][_0x7b77('0x18')][_0x7b77('0x3f')]()]&&_0x1d2273[_0x7b77('0x19')][_0x7b77('0x3a')]({'id':_0x4d9f02[_0x7b77('0x39')],'value':_0x38269e[_0x4d9f02['Variable'][_0x7b77('0x18')][_0x7b77('0x3f')]()][_0x7b77('0x2d')]()});}});}return _0x1d2273;}exports[_0x7b77('0x40')]=function(_0x58ba,_0x356802,_0x3953e8,_0x3479c6,_0x23f0b2,_0xd6b0d6){var _0x2ed906,_0x513dd4;_0xd6b0d6[_0x7b77('0x1a')]=intUtil[_0x7b77('0x41')](_0xd6b0d6[_0x7b77('0x1a')]);_0xd6b0d6[_0x7b77('0x42')]=intUtil[_0x7b77('0x41')](_0xd6b0d6['serverUrl']);if(_0x23f0b2&&_0x23f0b2[_0x7b77('0x43')]){logger[_0x7b77('0xe')](_0x7b77('0x44'),_0x7b77('0x45'));_0x356802[_0x7b77('0x46')]=util['format'](_0x7b77('0x47'),_0xd6b0d6['serverUrl'],_0x356802[_0x7b77('0x48')],md5(_0x356802[_0x7b77('0x48')]));}else{_0x356802[_0x7b77('0x46')]='';}headers[_0x7b77('0x49')]=getAuth(_0xd6b0d6);return getUser(_0xd6b0d6,_0x3479c6[_0x7b77('0x23')])[_0x7b77('0x1b')](function(_0x30d7f2){_0x2ed906=_0x30d7f2;logger[_0x7b77('0xe')]('The\x20User\x20ID\x20is:',_0x2ed906['id']);return getEndUser(_0xd6b0d6,_0x356802[_0x7b77('0x13')],_0x356802['calleridnum']);})[_0x7b77('0x1b')](function(_0x202756){_0x513dd4=_0x202756;logger[_0x7b77('0xe')]('The\x20Enduser\x20ID\x20is:',_0x513dd4['id']);return getTicket(_0xd6b0d6,_0x2ed906,_0x513dd4,_0x3953e8,_0x356802);})[_0x7b77('0x1b')](function(_0x5ec031){if(_0x5ec031&&_0x5ec031['id']){logger['info'](_0x7b77('0x1c'));logger[_0x7b77('0xe')](_0x7b77('0x4a'),_0x5ec031['id']);logger[_0x7b77('0xe')](_0x7b77('0x44'),_0x7b77('0x4b'));emit(util[_0x7b77('0x11')](_0x7b77('0x4c'),_0x3479c6[_0x7b77('0x18')]),_0x7b77('0x4d'),{'uri':util[_0x7b77('0x11')](_0x7b77('0x4e'),_0xd6b0d6[_0x7b77('0x1a')],_0x5ec031['id'])});}})[_0x7b77('0x4f')](function(_0x21f66d){logger[_0x7b77('0x50')]('[QUEUE]',JSON[_0x7b77('0x51')](_0x21f66d));});};exports[_0x7b77('0x52')]=function(_0x1a859c,_0x35965b,_0xb112fa,_0xd3fb03,_0xc22533,_0x68df9e,_0x44645d){var _0x33f7a1,_0x2e7e1a;_0x68df9e[_0x7b77('0x1a')]=intUtil['stripTrailingSlash'](_0x68df9e[_0x7b77('0x1a')]);_0x68df9e['serverUrl']=intUtil[_0x7b77('0x41')](_0x68df9e[_0x7b77('0x42')]);if(_0x44645d&&_0x44645d[_0x7b77('0x53')]&&_0x44645d[_0x7b77('0x53')]!==_0x7b77('0x54')){logger[_0x7b77('0xe')](_0x7b77('0x55'),_0x7b77('0x45'));_0x35965b['recordingURL']=util[_0x7b77('0x11')](_0x7b77('0x47'),_0x68df9e[_0x7b77('0x42')],_0x35965b['uniqueid'],md5(_0x35965b['uniqueid']));}headers[_0x7b77('0x49')]=getAuth(_0x68df9e);return getUser(_0x68df9e,_0xd3fb03['email'])[_0x7b77('0x1b')](function(_0x204e19){_0x33f7a1=_0x204e19;logger[_0x7b77('0xe')]('The\x20User\x20ID\x20is:',_0x33f7a1['id']);return getEndUser(_0x68df9e,_0x35965b[_0x7b77('0x56')],_0x35965b[_0x7b77('0x57')]);})[_0x7b77('0x1b')](function(_0x2ba4f7){_0x2e7e1a=_0x2ba4f7;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2e7e1a['id']);return getTicket(_0x68df9e,_0x33f7a1,_0x2e7e1a,_0xb112fa,_0x35965b);})[_0x7b77('0x1b')](function(_0x59fa90){if(_0x59fa90&&_0x59fa90['id']){logger[_0x7b77('0xe')](_0x7b77('0x1c'));logger[_0x7b77('0xe')](_0x7b77('0x4a'),_0x59fa90['id']);logger[_0x7b77('0xe')](_0x7b77('0x55'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7b77('0x11')]('user:%s',_0xd3fb03['name']),_0x7b77('0x4d'),{'uri':util['format'](_0x7b77('0x4e'),_0x68df9e[_0x7b77('0x1a')],_0x59fa90['id'])});}})[_0x7b77('0x4f')](function(_0x5b52a9){logger[_0x7b77('0x50')](_0x7b77('0x55'),JSON[_0x7b77('0x51')](_0x5b52a9));});};exports['unmanaged']=function(_0x1143f0,_0x1cd7c6,_0x109257,_0x276011,_0x507287,_0x3fc9a0){var _0x3eb40f,_0x12f4ed;_0x3fc9a0[_0x7b77('0x1a')]=intUtil[_0x7b77('0x41')](_0x3fc9a0[_0x7b77('0x1a')]);_0x3fc9a0['serverUrl']=intUtil[_0x7b77('0x41')](_0x3fc9a0[_0x7b77('0x42')]);if(_0x507287&&_0x507287[_0x7b77('0x43')]){logger[_0x7b77('0xe')]('['+_0x1cd7c6[_0x7b77('0x58')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1cd7c6[_0x7b77('0x46')]=util[_0x7b77('0x11')](_0x7b77('0x47'),_0x3fc9a0[_0x7b77('0x42')],_0x1cd7c6[_0x7b77('0x48')],md5(_0x1cd7c6[_0x7b77('0x48')]));}else{_0x1cd7c6[_0x7b77('0x46')]='';}headers[_0x7b77('0x49')]=getAuth(_0x3fc9a0);return getUser(_0x3fc9a0,'')['then'](function(_0x677024){_0x3eb40f=_0x677024;logger['info']('The\x20User\x20ID\x20is:',_0x3eb40f['id']);return getEndUser(_0x3fc9a0,_0x1cd7c6[_0x7b77('0x13')],_0x1cd7c6[_0x7b77('0x14')]);})[_0x7b77('0x1b')](function(_0x1b8fed){_0x12f4ed=_0x1b8fed;logger[_0x7b77('0xe')](_0x7b77('0x59'),_0x12f4ed['id']);return getTicket(_0x3fc9a0,_0x3eb40f,_0x12f4ed,_0x109257,_0x1cd7c6);})['then'](function(_0x5064d0){if(_0x5064d0){logger[_0x7b77('0xe')](_0x7b77('0x1c'));logger['info'](_0x7b77('0x4a'),_0x5064d0['id']);}})[_0x7b77('0x4f')](function(_0x581d2f){logger[_0x7b77('0x50')]('['+_0x1cd7c6[_0x7b77('0x58')][_0x7b77('0x5a')]()+']',JSON[_0x7b77('0x51')](_0x581d2f));});}; \ 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 56b2aad..672cea7 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 _0x8753=['then','users','length','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','toUpperCase','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','ticketId','task','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','callDirection','queue','unmanaged','%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','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','util','moment','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information'];(function(_0x486a8f,_0x502f25){var _0x239bc4=function(_0x273423){while(--_0x273423){_0x486a8f['push'](_0x486a8f['shift']());}};_0x239bc4(++_0x502f25);}(_0x8753,0x93));var _0x3875=function(_0x4d560b,_0x3b7bd5){_0x4d560b=_0x4d560b-0x0;var _0x272dfb=_0x8753[_0x4d560b];return _0x272dfb;};'use strict';var _=require(_0x3875('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x3875('0x1'));var moment=require(_0x3875('0x2'));var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require(_0x3875('0x3'));var config=require(_0x3875('0x4'));var logger=require(_0x3875('0x5'))('freshsales');config[_0x3875('0x6')]=_[_0x3875('0x7')](config[_0x3875('0x6')],{'host':_0x3875('0x8'),'port':0x18eb});var io=require(_0x3875('0x9'))(new Redis(config[_0x3875('0x6')]));function getAdminId(_0x4ec3c4,_0xb8a1e3,_0x59886b,_0x40a1fb){return new Promise(function(_0x4c32e8,_0x24a5e9){var _0x3c9bca=![];var _0x17d59a={'method':_0x3875('0xa'),'uri':_0x40a1fb+_0x3875('0xb'),'json':!![]};_0x17d59a[_0x3875('0xc')]=_0x59886b;logger[_0x3875('0xd')](_0x3875('0xe'));return rp(_0x17d59a)[_0x3875('0xf')](function(_0x2cff41){if(_0x2cff41){var _0x5dead3=_0x2cff41[_0x3875('0x10')];var _0x2a3d09=null;for(_0x2a3d09=0x0;_0x2a3d09<_0x5dead3[_0x3875('0x11')];_0x2a3d09++){if(_0x5dead3[_0x2a3d09]['email']===_0x4ec3c4[_0x3875('0x12')]){_0x4ec3c4['adminId']=_0x5dead3[_0x2a3d09]['id'];_0x3c9bca=!![];}}if(_0x3c9bca){logger['info'](_0x3875('0x13'),_0x4ec3c4[_0x3875('0x14')]);_0x4c32e8(_0x4ec3c4);}else{_0x24a5e9({'statusCode':0x194,'message':_0x3875('0x15')});}}else{_0x24a5e9({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x3875('0x16')](function(_0xc9887a){logger[_0x3875('0x17')]('['+[_0xb8a1e3['toUpperCase']()]+']',_0xc9887a[_0x3875('0x18')]);_0x24a5e9(_0xc9887a);});});}function getUser(_0x186afa,_0x3c6636,_0x45d0d2){return function(_0x2d84d6){return new Promise(function(_0x4d7d72,_0x2ee35f){var _0xb68cac={'method':_0x3875('0xa'),'uri':_0x45d0d2+_0x3875('0xb'),'json':!![]};_0xb68cac['headers']=_0x3c6636;logger[_0x3875('0xd')](_0x3875('0x19'));return rp(_0xb68cac)[_0x3875('0xf')](function(_0x5dc38f){if(_0x5dc38f){var _0x4bca7d=_0x5dc38f[_0x3875('0x10')];var _0x3ce0ac=![];var _0x3a4efc=null;if(_0x2d84d6[_0x3875('0x1a')]!==null){logger[_0x3875('0xd')](_0x3875('0x1b'),_0x2d84d6[_0x3875('0x1a')]);_0x2d84d6[_0x3875('0x1c')]=_0x2d84d6[_0x3875('0x1a')];for(_0x3a4efc=0x0;_0x3a4efc<_0x4bca7d['length'];_0x3a4efc++){if(_0x4bca7d[_0x3a4efc][_0x3875('0x1d')]===_0x2d84d6[_0x3875('0x1a')]){_0x3ce0ac=!![];_0x2d84d6[_0x3875('0x1e')]=_0x4bca7d[_0x3a4efc]['id'];logger[_0x3875('0xd')]('User\x20found:',_0x2d84d6[_0x3875('0x1e')]);}}}if(!_0x3ce0ac){logger[_0x3875('0xd')]('Admin\x20selected');_0x2d84d6[_0x3875('0x1c')]=_0x2d84d6[_0x3875('0x12')];_0x2d84d6[_0x3875('0x1e')]=_0x2d84d6[_0x3875('0x14')];_0x3ce0ac=!![];}if(_0x3ce0ac){_0x4d7d72(_0x2d84d6);}else{_0x2ee35f({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x2ee35f({'statusCode':0x194,'message':_0x3875('0x15')});}})[_0x3875('0x16')](function(_0x14a680){logger[_0x3875('0x17')]('['+[_0x186afa[_0x3875('0x1f')]()]+']',_0x14a680[_0x3875('0x18')]);_0x2ee35f(_0x14a680);});});};}function searchContact(_0x164e1e,_0x2fd35d,_0x193867,_0x1c68d8){return new Promise(function(_0x2456b5,_0x9607bf){var _0xb8bb28={'method':'GET','headers':_0x2fd35d,'uri':_0x164e1e+_0x3875('0x20')+_0x1c68d8+_0x3875('0x21')+_0x193867+_0x3875('0x22'),'json':!![]};rp(_0xb8bb28)[_0x3875('0xf')](function(_0x3cccc4){var _0x14c076=_[_0x3875('0x23')](_0x3cccc4[_0x3875('0x24')][_0x3875('0x24')],[_0x193867,_0x1c68d8]);_0x2456b5(_0x14c076);})[_0x3875('0x16')](function(_0x2e3e76){_0x9607bf(_0x2e3e76);});});}function getEndUser(_0x231006,_0x366fb2,_0xa97aa8){return function(_0xc51060){return new Promise(function(_0x5ba4ea,_0xed362c){logger[_0x3875('0xd')](util[_0x3875('0x25')](_0x3875('0x26'),_0xc51060[_0x3875('0x27')]));searchContact(_0xa97aa8,_0x366fb2,_0x3875('0x28'),_0xc51060[_0x3875('0x27')])[_0x3875('0xf')](function(_0x37b0b2){if(_0x37b0b2){_0xc51060[_0x3875('0x29')]=_0x37b0b2['id'];logger[_0x3875('0xd')](_0x3875('0x2a'),_0xc51060[_0x3875('0x29')]);return _0x5ba4ea(_0xc51060);}searchContact(_0xa97aa8,_0x366fb2,_0x3875('0x2b'),_0xc51060[_0x3875('0x27')])['then'](function(_0x47a4d1){if(_0x47a4d1){_0xc51060[_0x3875('0x29')]=_0x47a4d1['id'];logger[_0x3875('0xd')]('Contact\x20found\x20work_number:',_0xc51060[_0x3875('0x29')]);return _0x5ba4ea(_0xc51060);}createEndUser(_0xc51060,_0x231006,_0x366fb2,_0xa97aa8)[_0x3875('0xf')](function(_0x639648){logger['info'](_0x3875('0x2c'),_0x639648[_0x3875('0x29')]);return _0x5ba4ea(_0x639648);});});})[_0x3875('0x16')](function(_0xb2cda1){_0xed362c(_0xb2cda1);});});};}function createEndUser(_0x28793e,_0xb3a755,_0x43bad1,_0x30e3db){return new Promise(function(_0x1bae66,_0x5f16c1){var _0xea480c=moment();var _0x56e8da={'method':_0x3875('0x2d'),'uri':_0x30e3db+'/api/contacts','body':{'contact':{'last_name':_0x28793e[_0x3875('0x27')],'work_number':_0x28793e[_0x3875('0x27')],'mobile_number':_0x28793e['contactNumber'],'owner_id':_0x28793e['userId'],'created_at':_0xea480c[_0x3875('0x25')](_0x3875('0x2e'))}},'json':!![]};_0x56e8da['headers']=_0x43bad1;logger[_0x3875('0xd')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x56e8da)[_0x3875('0xf')](function(_0x34fe04){_0x28793e[_0x3875('0x29')]=_0x34fe04[_0x3875('0x2f')]['id'];_0x1bae66(_0x28793e);})[_0x3875('0x16')](function(_0x5e0ae6){logger['error']('['+[_0xb3a755[_0x3875('0x1f')]()]+']',_0x5e0ae6['message']);_0x5f16c1(_0x5e0ae6['message']);});});}function getTicket(_0x58a980,_0x5df4e9,_0x387ed8,_0x2533ff,_0x81a99a){return function(_0x486a63){logger[_0x3875('0xd')](_0x3875('0x30'));return new Promise(function(_0x4a33f7,_0x5550a2){var _0x3ef690=moment();var _0x442e7a={'method':'POST','uri':_0x387ed8+_0x3875('0x31'),'body':{'title':intUtil[_0x3875('0x32')](_0x2533ff[_0x3875('0x33')],_0x81a99a,'\x20'),'description':intUtil[_0x3875('0x32')](_0x2533ff['Descriptions'],_0x81a99a,'\x0a'),'owner_id':_0x486a63[_0x3875('0x1e')],'creater_id':_0x486a63[_0x3875('0x14')],'targetable_id':_0x486a63[_0x3875('0x29')],'targetable_type':'Contact','created_at':_0x3ef690[_0x3875('0x25')](_0x3875('0x2e')),'due_date':_0x3ef690['add'](0x1e,'m')[_0x3875('0x25')](_0x3875('0x2e'))},'json':!![]};_0x442e7a[_0x3875('0xc')]=_0x5df4e9;return rp(_0x442e7a)[_0x3875('0xf')](function(_0x5dff54){_0x486a63[_0x3875('0x34')]=_0x5dff54[_0x3875('0x35')]['id'];logger[_0x3875('0xd')]('Task\x20created:',_0x486a63[_0x3875('0x34')]);_0x4a33f7(_0x486a63);})[_0x3875('0x16')](function(_0x597fb5){logger['error']('['+[_0x58a980[_0x3875('0x1f')]()]+']',_0x597fb5[_0x3875('0x18')]);_0x5550a2(_0x597fb5['message']);});});};}function emit(_0x44afc0,_0x192eb8,_0x35f2b3){var _0x58b67e={'uri':_0x44afc0+_0x3875('0x36')+_0x35f2b3};io['to'](util[_0x3875('0x25')](_0x3875('0x37'),_0x192eb8))[_0x3875('0x38')](_0x3875('0x39'),_0x58b67e);}exports['cs']=function(_0x39efc7,_0x9ae633,_0x113cbe,_0x5ecd74,_0x346946,_0x1e3f68,_0x51c87c,_0x27a17b){var _0x1871c1={};var _0x3eed5c={'Authorization':_0x3875('0x3a')+_0x1e3f68[_0x3875('0x3b')]};_0x1e3f68[_0x3875('0x3c')]=intUtil[_0x3875('0x3d')](_0x1e3f68[_0x3875('0x3c')]);_0x1e3f68[_0x3875('0x3e')]=intUtil['stripTrailingSlash'](_0x1e3f68[_0x3875('0x3e')]);var _0x30e54c=_0x1e3f68[_0x3875('0x3c')];_0x1871c1[_0x3875('0x12')]=_0x1e3f68['username'];_0x1871c1[_0x3875('0x27')]=_0x27a17b[_0x3875('0x3f')]()===_0x3875('0x40')?_0x9ae633[_0x3875('0x41')]:_0x9ae633['calleridnum'];_0x1871c1[_0x3875('0x42')]=_0x27a17b===_0x3875('0x43')||_0x27a17b===_0x3875('0x44')?_0x3875('0x43'):_0x3875('0x40');if(_0x5ecd74){_0x1871c1['agentEmail']=_0x5ecd74[_0x3875('0x1d')];}var _0xc7ade6=util['format'](_0x3875('0x45'),_0x1e3f68['serverUrl'],_0x9ae633[_0x3875('0x46')],md5(_0x9ae633[_0x3875('0x46')]));if(_0x346946&&_0x346946['monitor_format']){logger[_0x3875('0xd')](_0x3875('0x47'),_0x3875('0x48'));_0x9ae633[_0x3875('0x49')]=_0xc7ade6;}else if(_0x51c87c&&_0x51c87c['recordingFormat']&&_0x51c87c[_0x3875('0x4a')]!==_0x3875('0x4b')){logger[_0x3875('0xd')](_0x3875('0x4c'),_0x3875('0x48'));_0x9ae633[_0x3875('0x49')]=_0xc7ade6;}else{_0x9ae633[_0x3875('0x49')]='';}return getAdminId(_0x1871c1,_0x27a17b,_0x3eed5c,_0x30e54c)['then'](getUser(_0x27a17b,_0x3eed5c,_0x30e54c))[_0x3875('0xf')](getEndUser(_0x27a17b,_0x3eed5c,_0x30e54c))[_0x3875('0xf')](getTicket(_0x27a17b,_0x3eed5c,_0x30e54c,_0x113cbe,_0x9ae633))[_0x3875('0xf')](function(_0x5e95a8){logger['info'](util[_0x3875('0x25')](_0x3875('0x4d'),_0x5e95a8[_0x3875('0x34')]));if(_0x27a17b!=='unmanaged'){logger[_0x3875('0xd')]('['+[_0x27a17b[_0x3875('0x1f')]()]+']',_0x3875('0x4e'));emit(_0x30e54c,_0x5ecd74[_0x3875('0x4f')],_0x5e95a8[_0x3875('0x29')]);}})[_0x3875('0x16')](function(_0x4dcf59){logger[_0x3875('0x17')]('['+[_0x27a17b[_0x3875('0x1f')]()]+_0x3875('0x50'),util['inspect'](_0x4dcf59,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xdad4=['redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','Getting\x20user\x20list','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','Subjects','getString','Descriptions','add','task','Task\x20created:','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshsales'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdad4,0xac));var _0x4dad=function(_0x264d4d,_0x118fb5){_0x264d4d=_0x264d4d-0x0;var _0xc917e2=_0xdad4[_0x264d4d];return _0xc917e2;};'use strict';var _=require(_0x4dad('0x0'));var rp=require(_0x4dad('0x1'));var md5=require(_0x4dad('0x2'));var util=require(_0x4dad('0x3'));var moment=require('moment');var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require(_0x4dad('0x4'));var config=require(_0x4dad('0x5'));var logger=require(_0x4dad('0x6'))(_0x4dad('0x7'));config[_0x4dad('0x8')]=_[_0x4dad('0x9')](config[_0x4dad('0x8')],{'host':_0x4dad('0xa'),'port':0x18eb});var io=require(_0x4dad('0xb'))(new Redis(config[_0x4dad('0x8')]));function getAdminId(_0x1fc15a,_0x2d2dca,_0x1061e0,_0x33c73e){return new Promise(function(_0x588175,_0x3f1cb0){var _0x24c378=![];var _0x31221c={'method':_0x4dad('0xc'),'uri':_0x33c73e+_0x4dad('0xd'),'json':!![]};_0x31221c[_0x4dad('0xe')]=_0x1061e0;logger[_0x4dad('0xf')](_0x4dad('0x10'));return rp(_0x31221c)[_0x4dad('0x11')](function(_0x2b9fb9){if(_0x2b9fb9){var _0x4cc9ba=_0x2b9fb9[_0x4dad('0x12')];var _0x114830=null;for(_0x114830=0x0;_0x114830<_0x4cc9ba[_0x4dad('0x13')];_0x114830++){if(_0x4cc9ba[_0x114830][_0x4dad('0x14')]===_0x1fc15a[_0x4dad('0x15')]){_0x1fc15a[_0x4dad('0x16')]=_0x4cc9ba[_0x114830]['id'];_0x24c378=!![];}}if(_0x24c378){logger[_0x4dad('0xf')](_0x4dad('0x17'),_0x1fc15a[_0x4dad('0x16')]);_0x588175(_0x1fc15a);}else{_0x3f1cb0({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3f1cb0({'statusCode':0x194,'message':_0x4dad('0x18')});}})[_0x4dad('0x19')](function(_0x3fd4ff){logger[_0x4dad('0x1a')]('['+[_0x2d2dca[_0x4dad('0x1b')]()]+']',_0x3fd4ff['message']);_0x3f1cb0(_0x3fd4ff);});});}function getUser(_0x3303cf,_0x16316b,_0x474d19){return function(_0x27acf4){return new Promise(function(_0x10c99b,_0x2ab769){var _0x129104={'method':_0x4dad('0xc'),'uri':_0x474d19+'/api/selector/owners','json':!![]};_0x129104[_0x4dad('0xe')]=_0x16316b;logger[_0x4dad('0xf')](_0x4dad('0x1c'));return rp(_0x129104)[_0x4dad('0x11')](function(_0x3735fa){if(_0x3735fa){var _0x41329d=_0x3735fa[_0x4dad('0x12')];var _0x27ff76=![];var _0x12c95b=null;if(_0x27acf4[_0x4dad('0x1d')]!==null){logger['info']('Getting\x20user\x20with\x20email',_0x27acf4[_0x4dad('0x1d')]);_0x27acf4[_0x4dad('0x1e')]=_0x27acf4[_0x4dad('0x1d')];for(_0x12c95b=0x0;_0x12c95b<_0x41329d[_0x4dad('0x13')];_0x12c95b++){if(_0x41329d[_0x12c95b]['email']===_0x27acf4['agentEmail']){_0x27ff76=!![];_0x27acf4[_0x4dad('0x1f')]=_0x41329d[_0x12c95b]['id'];logger['info'](_0x4dad('0x20'),_0x27acf4[_0x4dad('0x1f')]);}}}if(!_0x27ff76){logger[_0x4dad('0xf')](_0x4dad('0x21'));_0x27acf4[_0x4dad('0x1e')]=_0x27acf4[_0x4dad('0x15')];_0x27acf4['userId']=_0x27acf4[_0x4dad('0x16')];_0x27ff76=!![];}if(_0x27ff76){_0x10c99b(_0x27acf4);}else{_0x2ab769({'statusCode':0x194,'message':_0x4dad('0x18')});}}else{_0x2ab769({'statusCode':0x194,'message':_0x4dad('0x18')});}})[_0x4dad('0x19')](function(_0x307431){logger['error']('['+[_0x3303cf[_0x4dad('0x1b')]()]+']',_0x307431[_0x4dad('0x22')]);_0x2ab769(_0x307431);});});};}function searchContact(_0x18af7b,_0x2dfd42,_0xbd3eff,_0x7ea47c){return new Promise(function(_0x2f7f3a,_0x3dd88c){var _0x4831e9={'method':_0x4dad('0xc'),'headers':_0x2dfd42,'uri':_0x18af7b+_0x4dad('0x23')+_0x7ea47c+_0x4dad('0x24')+_0xbd3eff+_0x4dad('0x25'),'json':!![]};rp(_0x4831e9)[_0x4dad('0x11')](function(_0xca7eda){var _0x407a91=_[_0x4dad('0x26')](_0xca7eda[_0x4dad('0x27')][_0x4dad('0x27')],[_0xbd3eff,_0x7ea47c]);_0x2f7f3a(_0x407a91);})[_0x4dad('0x19')](function(_0x1a866d){_0x3dd88c(_0x1a866d);});});}function getEndUser(_0x6884dd,_0x351286,_0x3e7ada){return function(_0x4786de){return new Promise(function(_0x3727c8,_0x3100a4){logger['info'](util[_0x4dad('0x28')](_0x4dad('0x29'),_0x4786de[_0x4dad('0x2a')]));searchContact(_0x3e7ada,_0x351286,_0x4dad('0x2b'),_0x4786de[_0x4dad('0x2a')])['then'](function(_0x467f89){if(_0x467f89){_0x4786de[_0x4dad('0x2c')]=_0x467f89['id'];logger[_0x4dad('0xf')](_0x4dad('0x2d'),_0x4786de[_0x4dad('0x2c')]);return _0x3727c8(_0x4786de);}searchContact(_0x3e7ada,_0x351286,_0x4dad('0x2e'),_0x4786de[_0x4dad('0x2a')])['then'](function(_0xf28c04){if(_0xf28c04){_0x4786de['endUserId']=_0xf28c04['id'];logger[_0x4dad('0xf')](_0x4dad('0x2f'),_0x4786de[_0x4dad('0x2c')]);return _0x3727c8(_0x4786de);}createEndUser(_0x4786de,_0x6884dd,_0x351286,_0x3e7ada)[_0x4dad('0x11')](function(_0x34b568){logger[_0x4dad('0xf')](_0x4dad('0x30'),_0x34b568[_0x4dad('0x2c')]);return _0x3727c8(_0x34b568);});});})[_0x4dad('0x19')](function(_0x5f4bb3){_0x3100a4(_0x5f4bb3);});});};}function createEndUser(_0x32b580,_0x534d3f,_0x2514e2,_0x1668cd){return new Promise(function(_0x757185,_0x4d3a0c){var _0x39a1f9=moment();var _0x448e98={'method':_0x4dad('0x31'),'uri':_0x1668cd+_0x4dad('0x32'),'body':{'contact':{'last_name':_0x32b580[_0x4dad('0x2a')],'work_number':_0x32b580[_0x4dad('0x2a')],'mobile_number':_0x32b580[_0x4dad('0x2a')],'owner_id':_0x32b580[_0x4dad('0x1f')],'created_at':_0x39a1f9[_0x4dad('0x28')](_0x4dad('0x33'))}},'json':!![]};_0x448e98['headers']=_0x2514e2;logger[_0x4dad('0xf')](_0x4dad('0x34'));return rp(_0x448e98)[_0x4dad('0x11')](function(_0xe0857f){_0x32b580[_0x4dad('0x2c')]=_0xe0857f[_0x4dad('0x35')]['id'];_0x757185(_0x32b580);})[_0x4dad('0x19')](function(_0x16b97b){logger[_0x4dad('0x1a')]('['+[_0x534d3f[_0x4dad('0x1b')]()]+']',_0x16b97b[_0x4dad('0x22')]);_0x4d3a0c(_0x16b97b['message']);});});}function getTicket(_0x1acb03,_0x52b3fe,_0x32254b,_0x45ee26,_0x10744d){return function(_0x4fe5a5){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x38819f,_0x419b2d){var _0x240372=moment();var _0x559b4d={'method':_0x4dad('0x31'),'uri':_0x32254b+_0x4dad('0x36'),'body':{'title':intUtil['getString'](_0x45ee26[_0x4dad('0x37')],_0x10744d,'\x20'),'description':intUtil[_0x4dad('0x38')](_0x45ee26[_0x4dad('0x39')],_0x10744d,'\x0a'),'owner_id':_0x4fe5a5['userId'],'creater_id':_0x4fe5a5[_0x4dad('0x16')],'targetable_id':_0x4fe5a5['endUserId'],'targetable_type':'Contact','created_at':_0x240372[_0x4dad('0x28')](_0x4dad('0x33')),'due_date':_0x240372[_0x4dad('0x3a')](0x1e,'m')[_0x4dad('0x28')](_0x4dad('0x33'))},'json':!![]};_0x559b4d[_0x4dad('0xe')]=_0x52b3fe;return rp(_0x559b4d)[_0x4dad('0x11')](function(_0x5b69dc){_0x4fe5a5['ticketId']=_0x5b69dc[_0x4dad('0x3b')]['id'];logger[_0x4dad('0xf')](_0x4dad('0x3c'),_0x4fe5a5[_0x4dad('0x3d')]);_0x38819f(_0x4fe5a5);})[_0x4dad('0x19')](function(_0x4b64b1){logger[_0x4dad('0x1a')]('['+[_0x1acb03[_0x4dad('0x1b')]()]+']',_0x4b64b1[_0x4dad('0x22')]);_0x419b2d(_0x4b64b1[_0x4dad('0x22')]);});});};}function emit(_0x80484c,_0x2a4a3f,_0x5e57d4){var _0x5d64e8={'uri':_0x80484c+_0x4dad('0x3e')+_0x5e57d4};io['to'](util[_0x4dad('0x28')](_0x4dad('0x3f'),_0x2a4a3f))[_0x4dad('0x40')](_0x4dad('0x41'),_0x5d64e8);}exports['cs']=function(_0x3c1757,_0x24b462,_0x269d96,_0x5a2a9e,_0x2fc3d8,_0x1c3f85,_0x254fcf,_0x13d349){var _0x259dd4={};var _0x118d17={'Authorization':_0x4dad('0x42')+_0x1c3f85['apiKey']};_0x1c3f85[_0x4dad('0x43')]=intUtil[_0x4dad('0x44')](_0x1c3f85[_0x4dad('0x43')]);_0x1c3f85[_0x4dad('0x45')]=intUtil['stripTrailingSlash'](_0x1c3f85[_0x4dad('0x45')]);var _0x46a298=_0x1c3f85[_0x4dad('0x43')];_0x259dd4['adminEmail']=_0x1c3f85[_0x4dad('0x46')];_0x259dd4[_0x4dad('0x2a')]=_0x13d349[_0x4dad('0x47')]()==='outbound'?_0x24b462[_0x4dad('0x48')]:_0x24b462[_0x4dad('0x49')];_0x259dd4[_0x4dad('0x4a')]=_0x13d349===_0x4dad('0x4b')||_0x13d349==='unmanaged'?_0x4dad('0x4b'):'outbound';if(_0x5a2a9e){_0x259dd4[_0x4dad('0x1d')]=_0x5a2a9e[_0x4dad('0x14')];}var _0x41734c=util['format'](_0x4dad('0x4c'),_0x1c3f85[_0x4dad('0x45')],_0x24b462[_0x4dad('0x4d')],md5(_0x24b462['uniqueid']));if(_0x2fc3d8&&_0x2fc3d8['monitor_format']){logger['info'](_0x4dad('0x4e'),_0x4dad('0x4f'));_0x24b462['recordingURL']=_0x41734c;}else if(_0x254fcf&&_0x254fcf['recordingFormat']&&_0x254fcf[_0x4dad('0x50')]!==_0x4dad('0x51')){logger[_0x4dad('0xf')](_0x4dad('0x52'),'Recording\x20is\x20enabled!');_0x24b462[_0x4dad('0x53')]=_0x41734c;}else{_0x24b462[_0x4dad('0x53')]='';}return getAdminId(_0x259dd4,_0x13d349,_0x118d17,_0x46a298)['then'](getUser(_0x13d349,_0x118d17,_0x46a298))['then'](getEndUser(_0x13d349,_0x118d17,_0x46a298))[_0x4dad('0x11')](getTicket(_0x13d349,_0x118d17,_0x46a298,_0x269d96,_0x24b462))[_0x4dad('0x11')](function(_0x33ec02){logger[_0x4dad('0xf')](util[_0x4dad('0x28')](_0x4dad('0x54'),_0x33ec02[_0x4dad('0x3d')]));if(_0x13d349!==_0x4dad('0x55')){logger[_0x4dad('0xf')]('['+[_0x13d349[_0x4dad('0x1b')]()]+']',_0x4dad('0x56'));emit(_0x46a298,_0x5a2a9e[_0x4dad('0x57')],_0x33ec02[_0x4dad('0x2c')]);}})[_0x4dad('0x19')](function(_0x4ca87c){logger[_0x4dad('0x1a')]('['+[_0x13d349[_0x4dad('0x1b')]()]+_0x4dad('0x58'),util[_0x4dad('0x59')](_0x4ca87c,{'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 8277a67..7e88f80 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 _0x1a4a=['./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','servicenow','includes','toLowerCase','data1','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','zoho','unknown\x20integration','../../../../config/logger','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','data2','error','lodash','util','./salesforce'];(function(_0x492739,_0x4d7d80){var _0x4b668c=function(_0x1136af){while(--_0x1136af){_0x492739['push'](_0x492739['shift']());}};_0x4b668c(++_0x4d7d80);}(_0x1a4a,0x194));var _0xa1a4=function(_0xfc9c0e,_0xbcb7eb){_0xfc9c0e=_0xfc9c0e-0x0;var _0x490b03=_0x1a4a[_0xfc9c0e];return _0x490b03;};'use strict';var _=require(_0xa1a4('0x0'));var util=require(_0xa1a4('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0xa1a4('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xa1a4('0x3'));var zoho=require(_0xa1a4('0x4'));var desk=require(_0xa1a4('0x5'));var vtiger=require(_0xa1a4('0x6'));var servicenow=require(_0xa1a4('0x7'));var dynamics365=require(_0xa1a4('0x8'));var freshsales=require('./freshsales');var integrations=[_0xa1a4('0x9'),'salesforce',_0xa1a4('0xa'),_0xa1a4('0xb'),'zoho',_0xa1a4('0xc'),_0xa1a4('0xd'),_0xa1a4('0xe'),_0xa1a4('0xf'),_0xa1a4('0x10')];exports['exec']=function(_0x3c267e,_0x4478f7,_0x42893a,_0x18a21f,_0x21e944,_0x4b6c18){if(_0x42893a){if(_[_0xa1a4('0x11')](integrations,_0x3c267e['data1'][_0xa1a4('0x12')]())){try{var _0x4fe4d3=null;var _0x2080b2='';var _0x5c0ceb=_0x42893a[_0x3c267e[_0xa1a4('0x13')]['toLowerCase']()];if(_0x5c0ceb){var _0x2c051b=_0x5c0ceb[_0x3c267e['data2']];if(_0x2c051b){var _0x507bf7=_[_0xa1a4('0x14')](_0x2c051b[_0xa1a4('0x15')],{'id':parseInt(_0x3c267e['data3'],0xa)});if(_0x507bf7){if(_0x18a21f){if(_0x21e944&&_0x4478f7['queue']){_0x2080b2=_0xa1a4('0x16');}else if(_0x4478f7[_0xa1a4('0x17')]){_0x2080b2=_0xa1a4('0x18');}else{console[_0xa1a4('0x19')](_0xa1a4('0x1a'),_0x4478f7);}}else{_0x2080b2=_0xa1a4('0x1b');}switch(_0x3c267e['data1'][_0xa1a4('0x12')]()){case _0xa1a4('0x9'):zendesk[_0x2080b2](_0x3c267e,_0x4478f7,_0x507bf7,_0x18a21f,_0x21e944,_0x2c051b,_0x4b6c18);break;case _0xa1a4('0x1c'):salesforce[_0x2080b2](_0x3c267e,_0x4478f7,_0x507bf7,_0x18a21f,_0x21e944,_0x2c051b,_0x4b6c18);break;case _0xa1a4('0xa'):sugarcrm[_0x2080b2](_0x3c267e,_0x4478f7,_0x507bf7,_0x18a21f,_0x21e944,_0x2c051b,_0x4b6c18);break;case'freshdesk':freshdesk[_0x2080b2](_0x3c267e,_0x4478f7,_0x507bf7,_0x18a21f,_0x21e944,_0x2c051b,_0x4b6c18);break;case _0xa1a4('0x1d'):zoho[_0x2080b2](_0x3c267e,_0x4478f7,_0x507bf7,_0x18a21f,_0x21e944,_0x2c051b,_0x4b6c18);break;case _0xa1a4('0xc'):desk[_0x2080b2](_0x3c267e,_0x4478f7,_0x507bf7,_0x18a21f,_0x21e944,_0x2c051b,_0x4b6c18);break;case'vtiger':vtiger[_0x2080b2](_0x3c267e,_0x4478f7,_0x507bf7,_0x18a21f,_0x21e944,_0x2c051b,_0x4b6c18);break;case _0xa1a4('0xf'):freshsales['cs'](_0x3c267e,_0x4478f7,_0x507bf7,_0x18a21f,_0x21e944,_0x2c051b,_0x4b6c18,_0x2080b2);break;case _0xa1a4('0x10'):servicenow['cs'](_0x3c267e,_0x4478f7,_0x507bf7,_0x18a21f,_0x21e944,_0x2c051b,_0x4b6c18,_0x2080b2);break;case'dynamics365':dynamics365['cs'](_0x3c267e,_0x4478f7,_0x507bf7,_0x18a21f,_0x21e944,_0x2c051b,_0x4b6c18,_0x2080b2);break;default:console[_0xa1a4('0x19')](_0xa1a4('0x1e'));}}else{_0x4fe4d3=require(_0xa1a4('0x1f'))(_0x3c267e[_0xa1a4('0x13')][_0xa1a4('0x12')]());_0x4fe4d3['error']('[EXEC]',util['format'](_0xa1a4('0x20'),_0x3c267e['data1'][_0xa1a4('0x12')](),_0x3c267e['data3']));}}else{_0x4fe4d3=require(_0xa1a4('0x1f'))(_0x3c267e[_0xa1a4('0x13')]['toLowerCase']());_0x4fe4d3['error']('[EXEC]',util[_0xa1a4('0x21')](_0xa1a4('0x22'),_0x3c267e[_0xa1a4('0x13')][_0xa1a4('0x12')](),_0x3c267e[_0xa1a4('0x23')]));}}else{}}catch(_0x564dd3){console[_0xa1a4('0x24')](_0x564dd3);}}}}; \ No newline at end of file +var _0x4727=['./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','vtiger','dynamics365','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','unmanaged','salesforce','desk','freshsales','unknown\x20integration','../../../../config/logger','[EXEC]','format','error','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk'];(function(_0x578f8f,_0x175b8a){var _0xf6480=function(_0x2bc1c2){while(--_0x2bc1c2){_0x578f8f['push'](_0x578f8f['shift']());}};_0xf6480(++_0x175b8a);}(_0x4727,0x70));var _0x7472=function(_0x508a9c,_0x3297d3){_0x508a9c=_0x508a9c-0x0;var _0x18e845=_0x4727[_0x508a9c];return _0x18e845;};'use strict';var _=require(_0x7472('0x0'));var util=require(_0x7472('0x1'));var zendesk=require(_0x7472('0x2'));var salesforce=require(_0x7472('0x3'));var sugarcrm=require(_0x7472('0x4'));var freshdesk=require(_0x7472('0x5'));var zoho=require(_0x7472('0x6'));var desk=require(_0x7472('0x7'));var vtiger=require('./vtiger');var servicenow=require(_0x7472('0x8'));var dynamics365=require(_0x7472('0x9'));var freshsales=require(_0x7472('0xa'));var integrations=[_0x7472('0xb'),'salesforce',_0x7472('0xc'),_0x7472('0xd'),_0x7472('0xe'),'desk',_0x7472('0xf'),_0x7472('0x10'),'freshsales',_0x7472('0x11')];exports[_0x7472('0x12')]=function(_0x173abf,_0x1cffff,_0x3bcd62,_0xf9543a,_0x5d31ae,_0x1b8eda){if(_0x3bcd62){if(_[_0x7472('0x13')](integrations,_0x173abf[_0x7472('0x14')][_0x7472('0x15')]())){try{var _0x387de3=null;var _0xcb7198='';var _0x3744fd=_0x3bcd62[_0x173abf['data1'][_0x7472('0x15')]()];if(_0x3744fd){var _0x19e437=_0x3744fd[_0x173abf[_0x7472('0x16')]];if(_0x19e437){var _0x3750a6=_[_0x7472('0x17')](_0x19e437[_0x7472('0x18')],{'id':parseInt(_0x173abf[_0x7472('0x19')],0xa)});if(_0x3750a6){if(_0xf9543a){if(_0x5d31ae&&_0x1cffff[_0x7472('0x1a')]){_0xcb7198='queue';}else if(_0x1cffff[_0x7472('0x1b')]){_0xcb7198=_0x7472('0x1c');}else{console[_0x7472('0x1d')]('EVENT\x20UNKNOWN',_0x1cffff);}}else{_0xcb7198=_0x7472('0x1e');}switch(_0x173abf['data1'][_0x7472('0x15')]()){case _0x7472('0xb'):zendesk[_0xcb7198](_0x173abf,_0x1cffff,_0x3750a6,_0xf9543a,_0x5d31ae,_0x19e437,_0x1b8eda);break;case _0x7472('0x1f'):salesforce[_0xcb7198](_0x173abf,_0x1cffff,_0x3750a6,_0xf9543a,_0x5d31ae,_0x19e437,_0x1b8eda);break;case'sugarcrm':sugarcrm[_0xcb7198](_0x173abf,_0x1cffff,_0x3750a6,_0xf9543a,_0x5d31ae,_0x19e437,_0x1b8eda);break;case'freshdesk':freshdesk[_0xcb7198](_0x173abf,_0x1cffff,_0x3750a6,_0xf9543a,_0x5d31ae,_0x19e437,_0x1b8eda);break;case'zoho':zoho[_0xcb7198](_0x173abf,_0x1cffff,_0x3750a6,_0xf9543a,_0x5d31ae,_0x19e437,_0x1b8eda);break;case _0x7472('0x20'):desk[_0xcb7198](_0x173abf,_0x1cffff,_0x3750a6,_0xf9543a,_0x5d31ae,_0x19e437,_0x1b8eda);break;case _0x7472('0xf'):vtiger[_0xcb7198](_0x173abf,_0x1cffff,_0x3750a6,_0xf9543a,_0x5d31ae,_0x19e437,_0x1b8eda);break;case _0x7472('0x21'):freshsales['cs'](_0x173abf,_0x1cffff,_0x3750a6,_0xf9543a,_0x5d31ae,_0x19e437,_0x1b8eda,_0xcb7198);break;case'servicenow':servicenow['cs'](_0x173abf,_0x1cffff,_0x3750a6,_0xf9543a,_0x5d31ae,_0x19e437,_0x1b8eda,_0xcb7198);break;case _0x7472('0x10'):dynamics365['cs'](_0x173abf,_0x1cffff,_0x3750a6,_0xf9543a,_0x5d31ae,_0x19e437,_0x1b8eda,_0xcb7198);break;default:console[_0x7472('0x1d')](_0x7472('0x22'));}}else{_0x387de3=require(_0x7472('0x23'))(_0x173abf[_0x7472('0x14')][_0x7472('0x15')]());_0x387de3['error'](_0x7472('0x24'),util[_0x7472('0x25')]('%s\x20configuration\x20#%s\x20not\x20found',_0x173abf[_0x7472('0x14')][_0x7472('0x15')](),_0x173abf[_0x7472('0x19')]));}}else{_0x387de3=require(_0x7472('0x23'))(_0x173abf[_0x7472('0x14')][_0x7472('0x15')]());_0x387de3[_0x7472('0x26')](_0x7472('0x24'),util['format'](_0x7472('0x27'),_0x173abf[_0x7472('0x14')][_0x7472('0x15')](),_0x173abf[_0x7472('0x16')]));}}else{}}catch(_0x8c7976){console['error'](_0x8c7976);}}}}; \ 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 1317407..db3a500 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 _0x45cc=['IsReminderSet','IsRecurrence','endUserType','contact','lead','account','WhatId','Case','ContactId','leadId','info','validateEmail','sobject','User','find','execute','then','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','additionalSearchContact','merge','$or','Contact','cloneDeep','additionalSearchLead','additionalSearchAccount','Account','length','Lead','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','Company','No\x20Company','upperFirst','create','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','isNil','calleridnum','moment','md5','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','socket.io-emitter','emit','assign','getString','Descriptions','ticketType','ActivityDate','utc'];(function(_0x4b6420,_0x126201){var _0x37076f=function(_0x3ee471){while(--_0x3ee471){_0x4b6420['push'](_0x4b6420['shift']());}};_0x37076f(++_0x126201);}(_0x45cc,0x6d));var _0xc45c=function(_0x4ddef8,_0x3c78fe){_0x4ddef8=_0x4ddef8-0x0;var _0x456403=_0x45cc[_0x4ddef8];return _0x456403;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0xc45c('0x0'));var BPromise=require('bluebird');var md5=require(_0xc45c('0x1'));var jsforce=require(_0xc45c('0x2'));var util=require('util');var Redis=require(_0xc45c('0x3'));var intUtil=require(_0xc45c('0x4'));var config=require(_0xc45c('0x5'));var logger=require(_0xc45c('0x6'))(_0xc45c('0x7'));config[_0xc45c('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc45c('0x9'))(new Redis(config[_0xc45c('0x8')]));function emit(_0x4546be,_0x7676e6,_0x2e746c){io['to'](_0x4546be)[_0xc45c('0xa')](_0x7676e6,_0x2e746c);}function getTicket(_0x433e90,_0x374bde,_0x59baf3,_0x5bff45,_0x296507,_0xd819c8,_0x40d697,_0x240910){var _0x4cf761=Object[_0xc45c('0xb')]({},{'OwnerId':_0x374bde['id'],'Subject':intUtil[_0xc45c('0xc')](_0x5bff45['Subjects'],_0x296507,'\x20'),'Description':intUtil[_0xc45c('0xc')](_0x5bff45[_0xc45c('0xd')],_0x296507,'\x0a')},getCustomFields(_0xd819c8,_0x296507));if(_0x59baf3){if(_0x5bff45[_0xc45c('0xe')]==='Task'){_0x4cf761[_0xc45c('0xf')]=moment[_0xc45c('0x10')]();_0x4cf761[_0xc45c('0x11')]=![];_0x4cf761[_0xc45c('0x12')]=![];if(_0x59baf3[_0xc45c('0x13')]===_0xc45c('0x14')||_0x59baf3[_0xc45c('0x13')]===_0xc45c('0x15')){_0x4cf761['WhoId']=_0x59baf3['id'];}else if(_0x59baf3[_0xc45c('0x13')]===_0xc45c('0x16')){_0x4cf761[_0xc45c('0x17')]=_0x59baf3['id'];}}else if(_0x5bff45[_0xc45c('0xe')]===_0xc45c('0x18')){if(_0x59baf3['endUserType']==='contact'){_0x4cf761[_0xc45c('0x19')]=_0x59baf3['id'];}else if(_0x59baf3[_0xc45c('0x13')]==='account'){_0x4cf761['AccountId']=_0x59baf3['id'];}else if(_0x59baf3[_0xc45c('0x13')]===_0xc45c('0x15')&&_0x5bff45[_0xc45c('0x1a')]){_0x4cf761[_0x5bff45['leadId']]=_0x59baf3['id'];}else{logger[_0xc45c('0x1b')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x40d697['sobject'](_0x5bff45['ticketType'])['create'](_0x4cf761);}function getUser(_0x43f967,_0x30e07c,_0x3935f1){if(!_['isNil'](_0x30e07c)&&intUtil[_0xc45c('0x1c')](_0x30e07c)){var _0x44f4c9={'Email':_0x30e07c};var _0x59d664={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3935f1[_0xc45c('0x1d')](_0xc45c('0x1e'))[_0xc45c('0x1f')](_0x44f4c9,_0x59d664)[_0xc45c('0x20')]()[_0xc45c('0x21')](function(_0x5cfe0c){if(_0x5cfe0c['length']){var _0x1d9f23=_[_0xc45c('0x1f')](_0x5cfe0c,function(_0x33f0dd){return _0x33f0dd[_0xc45c('0x22')]===_0x30e07c;});if(_0x1d9f23){logger[_0xc45c('0x1b')](_0xc45c('0x23'),_0x30e07c);return BPromise['resolve']({'id':_0x1d9f23['Id'],'name':_0x1d9f23[_0xc45c('0x24')]});}}else{logger[_0xc45c('0x1b')](_0xc45c('0x25'),_0x30e07c);return _0x3935f1['identity']()[_0xc45c('0x21')](function(_0x4cd4cd){return BPromise[_0xc45c('0x26')]({'id':_0x4cd4cd[_0xc45c('0x27')],'name':_0x4cd4cd[_0xc45c('0x28')]});});}});}else{logger[_0xc45c('0x1b')](_0xc45c('0x25'),_0x30e07c);return _0x3935f1[_0xc45c('0x29')]()[_0xc45c('0x21')](function(_0x88c6e7){return BPromise[_0xc45c('0x26')]({'id':_0x88c6e7['user_id'],'name':_0x88c6e7[_0xc45c('0x28')]});});}}function getEndUser(_0x1a9846,_0x56c44e,_0x4fa882,_0x23c85b,_0x4cf459){var _0xcb744={'$or':{'Phone':_0x23c85b}};var _0x4ba803={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xc45c('0x26')]()[_0xc45c('0x21')](function(){logger[_0xc45c('0x1b')](_0xc45c('0x2a'),_0x23c85b,_0x56c44e['moduleSearch']);switch(_0x56c44e[_0xc45c('0x2b')]){case'contact_lead':var _0x58844b=_['cloneDeep'](_0xcb744);if(_0x56c44e[_0xc45c('0x2c')]){var _0x498646={};_0x498646[_0x56c44e[_0xc45c('0x2c')]]=_0x23c85b;_[_0xc45c('0x2d')](_0x58844b[_0xc45c('0x2e')],_0x498646);}return _0x4cf459[_0xc45c('0x1d')](_0xc45c('0x2f'))[_0xc45c('0x1f')](_0x58844b,_0x4ba803)['execute']()['then'](function(_0x49c9d1){if(_0x49c9d1&&_0x49c9d1['length']){return _0x49c9d1;}else{var _0x492540=_[_0xc45c('0x30')](_0xcb744);if(_0x56c44e[_0xc45c('0x31')]){var _0x4be1e4={};_0x4be1e4[_0x56c44e[_0xc45c('0x31')]]=_0x23c85b;_[_0xc45c('0x2d')](_0x492540[_0xc45c('0x2e')],_0x4be1e4);}return _0x4cf459[_0xc45c('0x1d')]('Lead')['find'](_0x492540,_0x4ba803);}});case'account_contact_lead':var _0x23d70d=_[_0xc45c('0x30')](_0xcb744);if(_0x56c44e[_0xc45c('0x32')]){var _0x498646={};_0x498646[_0x56c44e['additionalSearchAccount']]=_0x23c85b;_['merge'](_0x23d70d['$or'],_0x498646);}return _0x4cf459[_0xc45c('0x1d')](_0xc45c('0x33'))['find'](_0x23d70d,_0x4ba803)[_0xc45c('0x20')]()[_0xc45c('0x21')](function(_0x53fe18){if(_0x53fe18&&_0x53fe18[_0xc45c('0x34')]){return _0x53fe18;}else{var _0x412773=_[_0xc45c('0x30')](_0xcb744);if(_0x56c44e['additionalSearchContact']){var _0x121978={};_0x121978[_0x56c44e[_0xc45c('0x2c')]]=_0x23c85b;_[_0xc45c('0x2d')](_0x412773[_0xc45c('0x2e')],_0x121978);}return _0x4cf459[_0xc45c('0x1d')]('Contact')[_0xc45c('0x1f')](_0x412773,_0x4ba803)[_0xc45c('0x21')](function(_0x1a6230){if(_0x1a6230&&_0x1a6230[_0xc45c('0x34')]){return _0x1a6230;}else{var _0x3a0993=_[_0xc45c('0x30')](_0xcb744);if(_0x56c44e[_0xc45c('0x31')]){var _0x362656={};_0x362656[_0x56c44e['additionalSearchLead']]=_0x23c85b;_['merge'](_0x3a0993['$or'],_0x362656);}return _0x4cf459[_0xc45c('0x1d')](_0xc45c('0x35'))[_0xc45c('0x1f')](_0x3a0993,_0x4ba803);}});}});case'contact':var _0x58844b=_[_0xc45c('0x30')](_0xcb744);if(_0x56c44e['additionalSearchContact']){var _0x498646={};_0x498646[_0x56c44e[_0xc45c('0x2c')]]=_0x23c85b;_[_0xc45c('0x2d')](_0x58844b[_0xc45c('0x2e')],_0x498646);}return _0x4cf459[_0xc45c('0x1d')](_0xc45c('0x2f'))[_0xc45c('0x1f')](_0x58844b,_0x4ba803)[_0xc45c('0x20')]();case'lead':var _0x2b4f36=_[_0xc45c('0x30')](_0xcb744);if(_0x56c44e['additionalSearchLead']){var _0x498646={};_0x498646[_0x56c44e[_0xc45c('0x31')]]=_0x23c85b;_['merge'](_0x2b4f36[_0xc45c('0x2e')],_0x498646);}return _0x4cf459[_0xc45c('0x1d')]('Lead')[_0xc45c('0x1f')](_0x2b4f36,_0x4ba803);case _0xc45c('0x16'):var _0x23d70d=_[_0xc45c('0x30')](_0xcb744);if(_0x56c44e[_0xc45c('0x32')]){var _0x498646={};_0x498646[_0x56c44e[_0xc45c('0x32')]]=_0x23c85b;_['merge'](_0x23d70d[_0xc45c('0x2e')],_0x498646);}return _0x4cf459[_0xc45c('0x1d')](_0xc45c('0x33'))[_0xc45c('0x1f')](_0x23d70d,_0x4ba803);default:return null;}})[_0xc45c('0x21')](function(_0x483982){if(_0x483982&&_0x483982['length']){var _0x17a111=_[_0xc45c('0x36')](_0x483982);if(_0x17a111){return BPromise[_0xc45c('0x26')]({'id':_0x17a111['Id'],'name':_0x17a111[_0xc45c('0x24')],'phone':_0x17a111[_0xc45c('0x37')],'endUserType':_0x17a111[_0xc45c('0x38')][_0xc45c('0x39')][_0xc45c('0x3a')]()});}}})[_0xc45c('0x21')](function(_0x5096d8){if(_0x5096d8){logger[_0xc45c('0x1b')](_0xc45c('0x3b'),_0x5096d8['endUserType'],_0x23c85b);return BPromise[_0xc45c('0x26')](_0x5096d8);}else{logger[_0xc45c('0x1b')](_0xc45c('0x3c'),_0x23c85b);var _0x4352da={'Phone':_0x23c85b};if(_0x56c44e[_0xc45c('0x3d')]){if(_0x56c44e[_0xc45c('0x3d')]==='contact'){logger[_0xc45c('0x1b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x23c85b,_0x56c44e[_0xc45c('0x3d')]);_0x4352da[_0xc45c('0x3e')]=_0x4fa882!==_0xc45c('0x3f')?_0x4fa882:util['format'](_0xc45c('0x40'),_0x23c85b);}else if(_0x56c44e['moduleCreate']===_0xc45c('0x15')){logger[_0xc45c('0x1b')](_0xc45c('0x41'),_0x23c85b,_0x56c44e[_0xc45c('0x3d')]);_0x4352da[_0xc45c('0x3e')]=_0x4fa882!==_0xc45c('0x3f')?_0x4fa882:util[_0xc45c('0x42')](_0xc45c('0x40'),_0x23c85b);_0x4352da[_0xc45c('0x43')]=_0xc45c('0x44');}else if(_0x56c44e[_0xc45c('0x3d')]===_0xc45c('0x16')){logger[_0xc45c('0x1b')](_0xc45c('0x41'),_0x23c85b,_0x56c44e[_0xc45c('0x3d')]);_0x4352da[_0xc45c('0x24')]=_0x4fa882!==_0xc45c('0x3f')?_0x4fa882:util[_0xc45c('0x42')]('Caller\x20-\x20%s',_0x23c85b);}else{return null;}}return _0x4cf459['sobject'](_[_0xc45c('0x45')](_0x56c44e[_0xc45c('0x3d')]))[_0xc45c('0x46')](_0x4352da)[_0xc45c('0x21')](function(_0x1734e4){return BPromise[_0xc45c('0x26')]({'id':_0x1734e4['id'],'endUserType':_0x56c44e[_0xc45c('0x3d')]});});}});}function getCustomFields(_0x59b3cb,_0x11df38){var _0x5675f3={};if(_0x59b3cb[_0xc45c('0x34')]>0x0){_[_0xc45c('0x47')](_0x59b3cb,function(_0x4d102c){if(_[_0xc45c('0x48')]([_0xc45c('0x49'),_0xc45c('0x4a')],_0x4d102c['type'])&&_0x4d102c[_0xc45c('0x4b')]){_0x5675f3[_0x4d102c[_0xc45c('0x4b')]]=_0x4d102c[_0xc45c('0x4c')][_0xc45c('0x4d')]();}else if(_0x4d102c['type']===_0xc45c('0x4e')&&_0x4d102c[_0xc45c('0x4f')]&&_0x4d102c[_0xc45c('0x4b')]){_0x11df38[_0x4d102c['variableName']]&&(_0x5675f3[_0x4d102c[_0xc45c('0x4b')]]=_0x11df38[_0x4d102c['variableName']][_0xc45c('0x4d')]());}else if(_0x4d102c[_0xc45c('0x39')]===_0xc45c('0x50')&&_0x4d102c[_0xc45c('0x51')]&&_0x4d102c[_0xc45c('0x51')][_0xc45c('0x52')]&&_0x4d102c[_0xc45c('0x4b')]){_0x11df38[_0x4d102c[_0xc45c('0x51')][_0xc45c('0x52')][_0xc45c('0x3a')]()]&&(_0x5675f3[_0x4d102c[_0xc45c('0x4b')]]=_0x11df38[_0x4d102c[_0xc45c('0x51')][_0xc45c('0x52')][_0xc45c('0x3a')]()][_0xc45c('0x4d')]());}});}return _0x5675f3;}function getConnection(_0x47c804){var _0x45f081=_0x47c804[_0xc45c('0x53')][_0xc45c('0x54')](_0x47c804['securityToken']);var _0x109a5a=new jsforce[(_0xc45c('0x55'))]({'oauth2':{'loginUrl':_0x47c804[_0xc45c('0x56')]||_0xc45c('0x57'),'clientId':_0x47c804[_0xc45c('0x58')],'clientSecret':_0x47c804['clientSecret']}});return _0x109a5a[_0xc45c('0x59')](_0x47c804['username'],_0x45f081)['then'](function(){logger[_0xc45c('0x1b')](_0xc45c('0x5a'));return _0x109a5a;});}exports[_0xc45c('0x5b')]=function(_0xb3c32a,_0x3ab334,_0x2dd1ef,_0x532df1,_0x57223f,_0x1dccdd){var _0x31b6ca,_0x48d513,_0x2cbae7,_0x250b9c;_0x1dccdd[_0xc45c('0x5c')]=intUtil[_0xc45c('0x5d')](_0x1dccdd[_0xc45c('0x5c')]);_0x1dccdd[_0xc45c('0x56')]=intUtil[_0xc45c('0x5d')](_0x1dccdd[_0xc45c('0x56')]);if(_0x57223f&&_0x57223f['monitor_format']){logger[_0xc45c('0x1b')](_0xc45c('0x5e'),'Recording\x20is\x20enabled!');_0x3ab334['recordingURL']=util[_0xc45c('0x42')](_0xc45c('0x5f'),_0x1dccdd['serverUrl'],_0x3ab334['uniqueid'],md5(_0x3ab334[_0xc45c('0x60')]));}else{_0x3ab334['recordingURL']='';}return getConnection(_0x1dccdd)[_0xc45c('0x21')](function(_0x12766d){_0x250b9c=_0x12766d;return getUser(_0x1dccdd,_0x532df1[_0xc45c('0x61')],_0x250b9c);})[_0xc45c('0x21')](function(_0x4fe7c7){_0x31b6ca=_0x4fe7c7;return getEndUser(_0x1dccdd,_0x2dd1ef,_0x3ab334[_0xc45c('0x62')],_0x3ab334['calleridnum'],_0x250b9c);})[_0xc45c('0x21')](function(_0x433695){_0x48d513=_0x433695;return getTicket(_0x1dccdd,_0x31b6ca,_0x48d513,_0x2dd1ef,_0x3ab334,_0x2dd1ef[_0xc45c('0x63')],_0x250b9c,'queue');})['then'](function(_0x4061dc){_0x2cbae7=_0x4061dc;logger[_0xc45c('0x1b')](_0xc45c('0x64'),_0x2cbae7['id']);logger[_0xc45c('0x1b')](_0xc45c('0x65'),_0x2cbae7['id'],_0x532df1[_0xc45c('0x52')],_0x1dccdd['type']);switch(_0x1dccdd['type']){case'integrationTab':emit(util[_0xc45c('0x42')](_0xc45c('0x66'),_0x532df1[_0xc45c('0x52')]),_0xc45c('0x67'),{'recordId':_0x2cbae7['id']});break;case _0xc45c('0x68'):emit(util[_0xc45c('0x42')](_0xc45c('0x66'),_0x532df1[_0xc45c('0x52')]),_0xc45c('0x69'),{'uri':util[_0xc45c('0x42')](_0xc45c('0x6a'),_0x250b9c[_0xc45c('0x6b')],_0x2cbae7['id'])});break;default:logger['error'](_0xc45c('0x6c'));}})[_0xc45c('0x6d')](function(_0x5bd2d6){logger[_0xc45c('0x6e')](_0xc45c('0x5e'),_0x5bd2d6);});};exports['outbound']=function(_0x173678,_0x1fbdfe,_0x26d6a9,_0x1de188,_0x2cb4da,_0x1cf790,_0x12c972){var _0x1c5e7a,_0x2e84ab,_0x254288,_0x496561;_0x1cf790[_0xc45c('0x5c')]=intUtil[_0xc45c('0x5d')](_0x1cf790['serverUrl']);_0x1cf790[_0xc45c('0x56')]=intUtil[_0xc45c('0x5d')](_0x1cf790['remoteUri']);if(_0x12c972&&_0x12c972['recordingFormat']&&_0x12c972[_0xc45c('0x6f')]!=='none'){logger[_0xc45c('0x1b')](_0xc45c('0x70'),_0xc45c('0x71'));_0x1fbdfe[_0xc45c('0x72')]=util[_0xc45c('0x42')](_0xc45c('0x5f'),_0x1cf790[_0xc45c('0x5c')],_0x1fbdfe[_0xc45c('0x60')],md5(_0x1fbdfe['uniqueid']));}return getConnection(_0x1cf790)[_0xc45c('0x21')](function(_0x3a7de0){_0x496561=_0x3a7de0;return getUser(_0x1cf790,_0x1de188['email'],_0x496561);})[_0xc45c('0x21')](function(_0x2b686a){_0x1c5e7a=_0x2b686a;return getEndUser(_0x1cf790,_0x26d6a9,_0x1fbdfe['destcalleridname'],_0x1fbdfe[_0xc45c('0x73')],_0x496561);})[_0xc45c('0x21')](function(_0x12c822){_0x2e84ab=_0x12c822;return getTicket(_0x1cf790,_0x1c5e7a,_0x2e84ab,_0x26d6a9,_0x1fbdfe,_0x26d6a9[_0xc45c('0x63')],_0x496561,_0xc45c('0x74'));})['then'](function(_0x133d9b){_0x254288=_0x133d9b;logger[_0xc45c('0x1b')](_0xc45c('0x75'),_0x254288['id']);logger[_0xc45c('0x1b')](_0xc45c('0x76'),_0x254288['id'],_0x1de188[_0xc45c('0x52')],_0x1cf790[_0xc45c('0x39')]);switch(_0x1cf790[_0xc45c('0x39')]){case _0xc45c('0x77'):emit(util[_0xc45c('0x42')](_0xc45c('0x66'),_0x1de188[_0xc45c('0x52')]),'trigger:salesforce:display',{'recordId':_0x254288['id']});break;case'newTab':emit(util[_0xc45c('0x42')](_0xc45c('0x66'),_0x1de188[_0xc45c('0x52')]),_0xc45c('0x69'),{'uri':util[_0xc45c('0x42')](_0xc45c('0x6a'),_0x496561[_0xc45c('0x6b')],_0x254288['id'])});break;default:logger[_0xc45c('0x6e')]('[OUTBOUND]',_0xc45c('0x78'));}})[_0xc45c('0x6d')](function(_0x147ec4){logger[_0xc45c('0x6e')]('[OUTBOUND]',_0x147ec4);});};exports[_0xc45c('0x79')]=function(_0x454525,_0x328be6,_0x381bac,_0x33fbdb,_0x214161,_0x346336){var _0x50b433,_0x543757,_0x38ba5e,_0x288312;_0x346336[_0xc45c('0x5c')]=intUtil[_0xc45c('0x5d')](_0x346336[_0xc45c('0x5c')]);_0x346336[_0xc45c('0x56')]=intUtil[_0xc45c('0x5d')](_0x346336[_0xc45c('0x56')]);if(_0x214161&&_0x214161['monitor_format']){logger[_0xc45c('0x1b')]('['+_0x328be6[_0xc45c('0x7a')][_0xc45c('0x7b')]()+']','Recording\x20is\x20enabled!');_0x328be6['recordingURL']=util[_0xc45c('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x346336['serverUrl'],_0x328be6[_0xc45c('0x60')],md5(_0x328be6[_0xc45c('0x60')]));}else{_0x328be6[_0xc45c('0x72')]='';}return getConnection(_0x346336)[_0xc45c('0x21')](function(_0x5a251a){_0x288312=_0x5a251a;if(!_[_0xc45c('0x7c')](_0x33fbdb)){return getUser(_0x346336,_0x33fbdb[_0xc45c('0x52')],_0x288312);}else{return getUser(_0x346336,null,_0x288312);}})[_0xc45c('0x21')](function(_0x1a7433){_0x50b433=_0x1a7433;return getEndUser(_0x346336,_0x381bac,_0x328be6['calleridname'],_0x328be6[_0xc45c('0x7d')],_0x288312);})['then'](function(_0x59ee5e){_0x543757=_0x59ee5e;return getTicket(_0x346336,_0x50b433,_0x543757,_0x381bac,_0x328be6,_0x381bac[_0xc45c('0x63')],_0x288312);})['then'](function(_0x9e9179){_0x38ba5e=_0x9e9179;logger['info']('['+_0x328be6[_0xc45c('0x7a')]['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0x38ba5e['id']);logger[_0xc45c('0x1b')]('['+_0x328be6[_0xc45c('0x7a')][_0xc45c('0x7b')]()+']\x20Integration\x20account\x20type\x20%s.',_0x346336[_0xc45c('0x39')]);})['catch'](function(_0x7c8180){logger[_0xc45c('0x6e')]('['+_0x328be6[_0xc45c('0x7a')][_0xc45c('0x7b')]()+']',_0x7c8180);});}; \ No newline at end of file +var _0x84dd=['[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','[QUEUE]','outbound','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase','calleridname','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','localhost','socket.io-emitter','redis','emit','assign','getString','Task','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','WhatId','Case','ContactId','account','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','ticketType','isNil','validateEmail','User','find','execute','length','Email','Agent\x20%s\x20found.','Name','then','resolve','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','create','forEach','includes','string','picklist','idField','variableName','toString','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','serverUrl','stripTrailingSlash','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','queue','[QUEUE]\x20Ticket\x20%s\x20created'];(function(_0x5598d1,_0x103636){var _0x1f2d90=function(_0xe57132){while(--_0xe57132){_0x5598d1['push'](_0x5598d1['shift']());}};_0x1f2d90(++_0x103636);}(_0x84dd,0x113));var _0xd84d=function(_0x562117,_0xe4ef84){_0x562117=_0x562117-0x0;var _0x546bc9=_0x84dd[_0x562117];return _0x546bc9;};'use strict';var _=require('lodash');var rp=require(_0xd84d('0x0'));var moment=require(_0xd84d('0x1'));var BPromise=require(_0xd84d('0x2'));var md5=require(_0xd84d('0x3'));var jsforce=require('jsforce');var util=require(_0xd84d('0x4'));var Redis=require(_0xd84d('0x5'));var intUtil=require(_0xd84d('0x6'));var config=require(_0xd84d('0x7'));var logger=require(_0xd84d('0x8'))(_0xd84d('0x9'));config['redis']=_[_0xd84d('0xa')](config['redis'],{'host':_0xd84d('0xb'),'port':0x18eb});var io=require(_0xd84d('0xc'))(new Redis(config[_0xd84d('0xd')]));function emit(_0x59945a,_0x3bd26d,_0x469ce1){io['to'](_0x59945a)[_0xd84d('0xe')](_0x3bd26d,_0x469ce1);}function getTicket(_0xf1b08,_0x49fe5c,_0x7e8e60,_0x453168,_0x4a2be5,_0x33fcf5,_0x1677ea,_0x1da39b){var _0x11d318=Object[_0xd84d('0xf')]({},{'OwnerId':_0x49fe5c['id'],'Subject':intUtil[_0xd84d('0x10')](_0x453168['Subjects'],_0x4a2be5,'\x20'),'Description':intUtil[_0xd84d('0x10')](_0x453168['Descriptions'],_0x4a2be5,'\x0a')},getCustomFields(_0x33fcf5,_0x4a2be5));if(_0x7e8e60){if(_0x453168['ticketType']===_0xd84d('0x11')){_0x11d318['ActivityDate']=moment[_0xd84d('0x12')]();_0x11d318[_0xd84d('0x13')]=![];_0x11d318[_0xd84d('0x14')]=![];if(_0x7e8e60[_0xd84d('0x15')]===_0xd84d('0x16')||_0x7e8e60[_0xd84d('0x15')]===_0xd84d('0x17')){_0x11d318[_0xd84d('0x18')]=_0x7e8e60['id'];}else if(_0x7e8e60['endUserType']==='account'){_0x11d318[_0xd84d('0x19')]=_0x7e8e60['id'];}}else if(_0x453168['ticketType']===_0xd84d('0x1a')){if(_0x7e8e60[_0xd84d('0x15')]===_0xd84d('0x16')){_0x11d318[_0xd84d('0x1b')]=_0x7e8e60['id'];}else if(_0x7e8e60[_0xd84d('0x15')]===_0xd84d('0x1c')){_0x11d318['AccountId']=_0x7e8e60['id'];}else if(_0x7e8e60[_0xd84d('0x15')]==='lead'&&_0x453168['leadId']){_0x11d318[_0x453168[_0xd84d('0x1d')]]=_0x7e8e60['id'];}else{logger[_0xd84d('0x1e')](_0xd84d('0x1f'));}}}return _0x1677ea[_0xd84d('0x20')](_0x453168[_0xd84d('0x21')])['create'](_0x11d318);}function getUser(_0x33f348,_0x3dff0a,_0x3b696b){if(!_[_0xd84d('0x22')](_0x3dff0a)&&intUtil[_0xd84d('0x23')](_0x3dff0a)){var _0xf04708={'Email':_0x3dff0a};var _0x56ef0d={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3b696b[_0xd84d('0x20')](_0xd84d('0x24'))[_0xd84d('0x25')](_0xf04708,_0x56ef0d)[_0xd84d('0x26')]()['then'](function(_0x6bc8e7){if(_0x6bc8e7[_0xd84d('0x27')]){var _0x1a98a4=_[_0xd84d('0x25')](_0x6bc8e7,function(_0x1233a5){return _0x1233a5[_0xd84d('0x28')]===_0x3dff0a;});if(_0x1a98a4){logger[_0xd84d('0x1e')](_0xd84d('0x29'),_0x3dff0a);return BPromise['resolve']({'id':_0x1a98a4['Id'],'name':_0x1a98a4[_0xd84d('0x2a')]});}}else{logger[_0xd84d('0x1e')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3dff0a);return _0x3b696b['identity']()[_0xd84d('0x2b')](function(_0x6e58f4){return BPromise[_0xd84d('0x2c')]({'id':_0x6e58f4[_0xd84d('0x2d')],'name':_0x6e58f4[_0xd84d('0x2e')]});});}});}else{logger['info'](_0xd84d('0x2f'),_0x3dff0a);return _0x3b696b['identity']()[_0xd84d('0x2b')](function(_0x17479c){return BPromise[_0xd84d('0x2c')]({'id':_0x17479c[_0xd84d('0x2d')],'name':_0x17479c[_0xd84d('0x2e')]});});}}function getEndUser(_0x428f4d,_0xd4b57e,_0x1ab13b,_0x50fa6d,_0xe5a89){var _0x46a2b5={'$or':{'Phone':_0x50fa6d}};var _0x1be6eb={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xd84d('0x2c')]()[_0xd84d('0x2b')](function(){logger[_0xd84d('0x1e')](_0xd84d('0x30'),_0x50fa6d,_0xd4b57e[_0xd84d('0x31')]);switch(_0xd4b57e[_0xd84d('0x31')]){case'contact_lead':var _0x335380=_[_0xd84d('0x32')](_0x46a2b5);if(_0xd4b57e[_0xd84d('0x33')]){var _0x1c5ab3={};_0x1c5ab3[_0xd4b57e[_0xd84d('0x33')]]=_0x50fa6d;_[_0xd84d('0x34')](_0x335380[_0xd84d('0x35')],_0x1c5ab3);}return _0xe5a89[_0xd84d('0x20')]('Contact')[_0xd84d('0x25')](_0x335380,_0x1be6eb)[_0xd84d('0x26')]()[_0xd84d('0x2b')](function(_0x10f628){if(_0x10f628&&_0x10f628[_0xd84d('0x27')]){return _0x10f628;}else{var _0x3e069a=_[_0xd84d('0x32')](_0x46a2b5);if(_0xd4b57e[_0xd84d('0x36')]){var _0x39371={};_0x39371[_0xd4b57e[_0xd84d('0x36')]]=_0x50fa6d;_[_0xd84d('0x34')](_0x3e069a[_0xd84d('0x35')],_0x39371);}return _0xe5a89['sobject'](_0xd84d('0x37'))['find'](_0x3e069a,_0x1be6eb);}});case _0xd84d('0x38'):var _0x4dea0f=_[_0xd84d('0x32')](_0x46a2b5);if(_0xd4b57e[_0xd84d('0x39')]){var _0x1c5ab3={};_0x1c5ab3[_0xd4b57e['additionalSearchAccount']]=_0x50fa6d;_[_0xd84d('0x34')](_0x4dea0f[_0xd84d('0x35')],_0x1c5ab3);}return _0xe5a89['sobject'](_0xd84d('0x3a'))['find'](_0x4dea0f,_0x1be6eb)[_0xd84d('0x26')]()[_0xd84d('0x2b')](function(_0x19b4f7){if(_0x19b4f7&&_0x19b4f7[_0xd84d('0x27')]){return _0x19b4f7;}else{var _0x169662=_[_0xd84d('0x32')](_0x46a2b5);if(_0xd4b57e[_0xd84d('0x33')]){var _0x3a8d88={};_0x3a8d88[_0xd4b57e[_0xd84d('0x33')]]=_0x50fa6d;_['merge'](_0x169662[_0xd84d('0x35')],_0x3a8d88);}return _0xe5a89[_0xd84d('0x20')](_0xd84d('0x3b'))[_0xd84d('0x25')](_0x169662,_0x1be6eb)[_0xd84d('0x2b')](function(_0x407bdf){if(_0x407bdf&&_0x407bdf[_0xd84d('0x27')]){return _0x407bdf;}else{var _0x20bf54=_[_0xd84d('0x32')](_0x46a2b5);if(_0xd4b57e['additionalSearchLead']){var _0x85c289={};_0x85c289[_0xd4b57e[_0xd84d('0x36')]]=_0x50fa6d;_[_0xd84d('0x34')](_0x20bf54[_0xd84d('0x35')],_0x85c289);}return _0xe5a89[_0xd84d('0x20')]('Lead')[_0xd84d('0x25')](_0x20bf54,_0x1be6eb);}});}});case _0xd84d('0x16'):var _0x335380=_[_0xd84d('0x32')](_0x46a2b5);if(_0xd4b57e[_0xd84d('0x33')]){var _0x1c5ab3={};_0x1c5ab3[_0xd4b57e[_0xd84d('0x33')]]=_0x50fa6d;_['merge'](_0x335380[_0xd84d('0x35')],_0x1c5ab3);}return _0xe5a89[_0xd84d('0x20')](_0xd84d('0x3b'))['find'](_0x335380,_0x1be6eb)[_0xd84d('0x26')]();case _0xd84d('0x17'):var _0x2ab9e8=_[_0xd84d('0x32')](_0x46a2b5);if(_0xd4b57e[_0xd84d('0x36')]){var _0x1c5ab3={};_0x1c5ab3[_0xd4b57e[_0xd84d('0x36')]]=_0x50fa6d;_[_0xd84d('0x34')](_0x2ab9e8[_0xd84d('0x35')],_0x1c5ab3);}return _0xe5a89[_0xd84d('0x20')](_0xd84d('0x37'))[_0xd84d('0x25')](_0x2ab9e8,_0x1be6eb);case _0xd84d('0x1c'):var _0x4dea0f=_['cloneDeep'](_0x46a2b5);if(_0xd4b57e['additionalSearchAccount']){var _0x1c5ab3={};_0x1c5ab3[_0xd4b57e[_0xd84d('0x39')]]=_0x50fa6d;_[_0xd84d('0x34')](_0x4dea0f[_0xd84d('0x35')],_0x1c5ab3);}return _0xe5a89['sobject']('Account')[_0xd84d('0x25')](_0x4dea0f,_0x1be6eb);default:return null;}})[_0xd84d('0x2b')](function(_0x9a7be5){if(_0x9a7be5&&_0x9a7be5[_0xd84d('0x27')]){var _0x1d55ba=_[_0xd84d('0x3c')](_0x9a7be5);if(_0x1d55ba){return BPromise[_0xd84d('0x2c')]({'id':_0x1d55ba['Id'],'name':_0x1d55ba[_0xd84d('0x2a')],'phone':_0x1d55ba[_0xd84d('0x3d')],'endUserType':_0x1d55ba['attributes'][_0xd84d('0x3e')][_0xd84d('0x3f')]()});}}})[_0xd84d('0x2b')](function(_0x5760fd){if(_0x5760fd){logger['info'](_0xd84d('0x40'),_0x5760fd['endUserType'],_0x50fa6d);return BPromise[_0xd84d('0x2c')](_0x5760fd);}else{logger[_0xd84d('0x1e')](_0xd84d('0x41'),_0x50fa6d);var _0x1d6705={'Phone':_0x50fa6d};if(_0xd4b57e[_0xd84d('0x42')]){if(_0xd4b57e[_0xd84d('0x42')]===_0xd84d('0x16')){logger['info'](_0xd84d('0x43'),_0x50fa6d,_0xd4b57e[_0xd84d('0x42')]);_0x1d6705[_0xd84d('0x44')]=_0x1ab13b!==_0xd84d('0x45')?_0x1ab13b:util[_0xd84d('0x46')](_0xd84d('0x47'),_0x50fa6d);}else if(_0xd4b57e[_0xd84d('0x42')]==='lead'){logger[_0xd84d('0x1e')](_0xd84d('0x43'),_0x50fa6d,_0xd4b57e[_0xd84d('0x42')]);_0x1d6705[_0xd84d('0x44')]=_0x1ab13b!==_0xd84d('0x45')?_0x1ab13b:util[_0xd84d('0x46')](_0xd84d('0x47'),_0x50fa6d);_0x1d6705[_0xd84d('0x48')]=_0xd84d('0x49');}else if(_0xd4b57e[_0xd84d('0x42')]===_0xd84d('0x1c')){logger['info'](_0xd84d('0x43'),_0x50fa6d,_0xd4b57e[_0xd84d('0x42')]);_0x1d6705[_0xd84d('0x2a')]=_0x1ab13b!==_0xd84d('0x45')?_0x1ab13b:util[_0xd84d('0x46')](_0xd84d('0x47'),_0x50fa6d);}else{return null;}}return _0xe5a89[_0xd84d('0x20')](_[_0xd84d('0x4a')](_0xd4b57e[_0xd84d('0x42')]))[_0xd84d('0x4b')](_0x1d6705)[_0xd84d('0x2b')](function(_0x1e1efb){return BPromise[_0xd84d('0x2c')]({'id':_0x1e1efb['id'],'endUserType':_0xd4b57e['moduleCreate']});});}});}function getCustomFields(_0x131b52,_0x153f9a){var _0x53087f={};if(_0x131b52[_0xd84d('0x27')]>0x0){_[_0xd84d('0x4c')](_0x131b52,function(_0x46594b){if(_[_0xd84d('0x4d')]([_0xd84d('0x4e'),_0xd84d('0x4f')],_0x46594b[_0xd84d('0x3e')])&&_0x46594b[_0xd84d('0x50')]){_0x53087f[_0x46594b[_0xd84d('0x50')]]=_0x46594b['content']['toString']();}else if(_0x46594b['type']==='variable'&&_0x46594b[_0xd84d('0x51')]&&_0x46594b[_0xd84d('0x50')]){_0x153f9a[_0x46594b[_0xd84d('0x51')]]&&(_0x53087f[_0x46594b[_0xd84d('0x50')]]=_0x153f9a[_0x46594b[_0xd84d('0x51')]][_0xd84d('0x52')]());}else if(_0x46594b['type']==='customVariable'&&_0x46594b['Variable']&&_0x46594b['Variable']['name']&&_0x46594b[_0xd84d('0x50')]){_0x153f9a[_0x46594b[_0xd84d('0x53')][_0xd84d('0x54')][_0xd84d('0x3f')]()]&&(_0x53087f[_0x46594b[_0xd84d('0x50')]]=_0x153f9a[_0x46594b[_0xd84d('0x53')][_0xd84d('0x54')]['toLowerCase']()][_0xd84d('0x52')]());}});}return _0x53087f;}function getConnection(_0x1add9c){var _0x35a15c=_0x1add9c['password'][_0xd84d('0x55')](_0x1add9c[_0xd84d('0x56')]);var _0x275295=new jsforce[(_0xd84d('0x57'))]({'oauth2':{'loginUrl':_0x1add9c[_0xd84d('0x58')]||_0xd84d('0x59'),'clientId':_0x1add9c[_0xd84d('0x5a')],'clientSecret':_0x1add9c[_0xd84d('0x5b')]}});return _0x275295[_0xd84d('0x5c')](_0x1add9c['username'],_0x35a15c)[_0xd84d('0x2b')](function(){logger[_0xd84d('0x1e')]('Connection\x20established.');return _0x275295;});}exports['queue']=function(_0x1f5d83,_0x288ab7,_0x2436c4,_0x3f884d,_0x33324a,_0x5075f4){var _0x44c7d1,_0x4a9a66,_0x5d2e8e,_0x44a783;_0x5075f4[_0xd84d('0x5d')]=intUtil[_0xd84d('0x5e')](_0x5075f4[_0xd84d('0x5d')]);_0x5075f4['remoteUri']=intUtil['stripTrailingSlash'](_0x5075f4['remoteUri']);if(_0x33324a&&_0x33324a['monitor_format']){logger[_0xd84d('0x1e')]('[QUEUE]','Recording\x20is\x20enabled!');_0x288ab7['recordingURL']=util['format'](_0xd84d('0x5f'),_0x5075f4[_0xd84d('0x5d')],_0x288ab7[_0xd84d('0x60')],md5(_0x288ab7[_0xd84d('0x60')]));}else{_0x288ab7['recordingURL']='';}return getConnection(_0x5075f4)['then'](function(_0x5d829b){_0x44a783=_0x5d829b;return getUser(_0x5075f4,_0x3f884d['email'],_0x44a783);})[_0xd84d('0x2b')](function(_0x520c46){_0x44c7d1=_0x520c46;return getEndUser(_0x5075f4,_0x2436c4,_0x288ab7['calleridname'],_0x288ab7[_0xd84d('0x61')],_0x44a783);})[_0xd84d('0x2b')](function(_0xb6fed0){_0x4a9a66=_0xb6fed0;return getTicket(_0x5075f4,_0x44c7d1,_0x4a9a66,_0x2436c4,_0x288ab7,_0x2436c4['Fields'],_0x44a783,_0xd84d('0x62'));})['then'](function(_0x59af58){_0x5d2e8e=_0x59af58;logger[_0xd84d('0x1e')](_0xd84d('0x63'),_0x5d2e8e['id']);logger[_0xd84d('0x1e')](_0xd84d('0x64'),_0x5d2e8e['id'],_0x3f884d[_0xd84d('0x54')],_0x5075f4[_0xd84d('0x3e')]);switch(_0x5075f4[_0xd84d('0x3e')]){case _0xd84d('0x65'):emit(util[_0xd84d('0x46')](_0xd84d('0x66'),_0x3f884d[_0xd84d('0x54')]),_0xd84d('0x67'),{'recordId':_0x5d2e8e['id']});break;case'newTab':emit(util[_0xd84d('0x46')](_0xd84d('0x66'),_0x3f884d[_0xd84d('0x54')]),_0xd84d('0x68'),{'uri':util[_0xd84d('0x46')](_0xd84d('0x69'),_0x44a783[_0xd84d('0x6a')],_0x5d2e8e['id'])});break;default:logger['error'](_0xd84d('0x6b'));}})[_0xd84d('0x6c')](function(_0x8bc07a){logger[_0xd84d('0x6d')](_0xd84d('0x6e'),_0x8bc07a);});};exports[_0xd84d('0x6f')]=function(_0x5c0c91,_0x3043e3,_0x3b9e32,_0x2e9510,_0xa7f9f1,_0x678142,_0x585931){var _0x494964,_0x108f09,_0x226607,_0xfd4b6f;_0x678142[_0xd84d('0x5d')]=intUtil[_0xd84d('0x5e')](_0x678142[_0xd84d('0x5d')]);_0x678142[_0xd84d('0x58')]=intUtil[_0xd84d('0x5e')](_0x678142[_0xd84d('0x58')]);if(_0x585931&&_0x585931['recordingFormat']&&_0x585931['recordingFormat']!=='none'){logger[_0xd84d('0x1e')](_0xd84d('0x70'),_0xd84d('0x71'));_0x3043e3[_0xd84d('0x72')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x678142[_0xd84d('0x5d')],_0x3043e3[_0xd84d('0x60')],md5(_0x3043e3[_0xd84d('0x60')]));}return getConnection(_0x678142)['then'](function(_0x4ac5e1){_0xfd4b6f=_0x4ac5e1;return getUser(_0x678142,_0x2e9510['email'],_0xfd4b6f);})[_0xd84d('0x2b')](function(_0x4aea36){_0x494964=_0x4aea36;return getEndUser(_0x678142,_0x3b9e32,_0x3043e3[_0xd84d('0x73')],_0x3043e3[_0xd84d('0x74')],_0xfd4b6f);})[_0xd84d('0x2b')](function(_0x20cbfd){_0x108f09=_0x20cbfd;return getTicket(_0x678142,_0x494964,_0x108f09,_0x3b9e32,_0x3043e3,_0x3b9e32['Fields'],_0xfd4b6f,_0xd84d('0x6f'));})[_0xd84d('0x2b')](function(_0x545d39){_0x226607=_0x545d39;logger[_0xd84d('0x1e')](_0xd84d('0x75'),_0x226607['id']);logger[_0xd84d('0x1e')](_0xd84d('0x76'),_0x226607['id'],_0x2e9510[_0xd84d('0x54')],_0x678142[_0xd84d('0x3e')]);switch(_0x678142[_0xd84d('0x3e')]){case _0xd84d('0x65'):emit(util[_0xd84d('0x46')](_0xd84d('0x66'),_0x2e9510[_0xd84d('0x54')]),_0xd84d('0x67'),{'recordId':_0x226607['id']});break;case'newTab':emit(util[_0xd84d('0x46')](_0xd84d('0x66'),_0x2e9510[_0xd84d('0x54')]),_0xd84d('0x68'),{'uri':util['format'](_0xd84d('0x69'),_0xfd4b6f[_0xd84d('0x6a')],_0x226607['id'])});break;default:logger[_0xd84d('0x6d')](_0xd84d('0x70'),_0xd84d('0x77'));}})[_0xd84d('0x6c')](function(_0xf86092){logger['error']('[OUTBOUND]',_0xf86092);});};exports[_0xd84d('0x78')]=function(_0x1ce1c6,_0x3c004a,_0x1cbc5f,_0x126a63,_0x3035b1,_0xfb1922){var _0x419a9d,_0x32b4b6,_0x21e142,_0x4aaa44;_0xfb1922[_0xd84d('0x5d')]=intUtil[_0xd84d('0x5e')](_0xfb1922[_0xd84d('0x5d')]);_0xfb1922[_0xd84d('0x58')]=intUtil['stripTrailingSlash'](_0xfb1922[_0xd84d('0x58')]);if(_0x3035b1&&_0x3035b1[_0xd84d('0x79')]){logger[_0xd84d('0x1e')]('['+_0x3c004a[_0xd84d('0x7a')][_0xd84d('0x7b')]()+']',_0xd84d('0x71'));_0x3c004a['recordingURL']=util['format'](_0xd84d('0x5f'),_0xfb1922[_0xd84d('0x5d')],_0x3c004a[_0xd84d('0x60')],md5(_0x3c004a[_0xd84d('0x60')]));}else{_0x3c004a[_0xd84d('0x72')]='';}return getConnection(_0xfb1922)[_0xd84d('0x2b')](function(_0x54726e){_0x4aaa44=_0x54726e;if(!_[_0xd84d('0x22')](_0x126a63)){return getUser(_0xfb1922,_0x126a63['name'],_0x4aaa44);}else{return getUser(_0xfb1922,null,_0x4aaa44);}})[_0xd84d('0x2b')](function(_0x2ea4de){_0x419a9d=_0x2ea4de;return getEndUser(_0xfb1922,_0x1cbc5f,_0x3c004a[_0xd84d('0x7c')],_0x3c004a[_0xd84d('0x61')],_0x4aaa44);})[_0xd84d('0x2b')](function(_0x551749){_0x32b4b6=_0x551749;return getTicket(_0xfb1922,_0x419a9d,_0x32b4b6,_0x1cbc5f,_0x3c004a,_0x1cbc5f['Fields'],_0x4aaa44);})[_0xd84d('0x2b')](function(_0x24c3e1){_0x21e142=_0x24c3e1;logger[_0xd84d('0x1e')]('['+_0x3c004a[_0xd84d('0x7a')][_0xd84d('0x7b')]()+']\x20Ticket\x20%s\x20created.',_0x21e142['id']);logger['info']('['+_0x3c004a['lastevent']['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0xfb1922[_0xd84d('0x3e')]);})[_0xd84d('0x6c')](function(_0x1dd764){logger[_0xd84d('0x6d')]('['+_0x3c004a[_0xd84d('0x7a')][_0xd84d('0x7b')]()+']',_0x1dd764);});}; \ 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 8b90b8a..c7a425d 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 _0x8329=['all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','format','%s/api/now/table/','isNil','email','outbound','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','info','catch','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','picklist','type','nameField','customField','toLowerCase','toString','string','idField','content','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','POST','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','label_entry','incident','forEach','push'];(function(_0xc6123,_0x1bb2cd){var _0x3c8677=function(_0x5c03d2){while(--_0x5c03d2){_0xc6123['push'](_0xc6123['shift']());}};_0x3c8677(++_0x1bb2cd);}(_0x8329,0x16f));var _0x9832=function(_0x2b23a8,_0x306b7f){_0x2b23a8=_0x2b23a8-0x0;var _0xf15b68=_0x8329[_0x2b23a8];return _0xf15b68;};'use strict';var _=require(_0x9832('0x0'));var Promise=require(_0x9832('0x1'));var rp=require(_0x9832('0x2'));var util=require(_0x9832('0x3'));var md5=require('md5');var Redis=require(_0x9832('0x4'));var intUtil=require('./util');var config=require(_0x9832('0x5'));var logger=require(_0x9832('0x6'))(_0x9832('0x7'));config['redis']=_[_0x9832('0x8')](config[_0x9832('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x9832('0xa'))(new Redis(config[_0x9832('0x9')]));function getAdminUser(_0x563b17,_0x243463,_0x40ecc2,_0x57d136,_0x168aeb,_0x67145b){return new Promise(function(_0x3f36a7,_0x264ea6){var _0x4012a6={'method':_0x9832('0xb'),'uri':_0x57d136+_0x9832('0xc')+'&'+_0x168aeb+'&'+_0x67145b,'auth':_0x243463,'json':!![]};return rp(_0x4012a6)['then'](function(_0x1ecc84){if(_0x1ecc84[_0x9832('0xd')][_0x9832('0xe')]>0x0){_0x40ecc2[_0x9832('0xf')]=_0x1ecc84[_0x9832('0xd')][0x0][_0x9832('0x10')];}logger[_0x9832('0x11')]('['+[_0x563b17['toUpperCase']()]+'],\x20getAdminUser\x20crm',_0x40ecc2);_0x3f36a7(_0x40ecc2);})[_0x9832('0x12')](function(_0x199d43){logger[_0x9832('0x13')]('['+[_0x563b17[_0x9832('0x14')]()]+']',_0x199d43[_0x9832('0x15')]);_0x264ea6(_0x199d43['message']);});});}function getUser(_0x37b7bb,_0x590012,_0x565506,_0xb9db34,_0x3366f0){return function(_0x2e5944){logger['info']('['+[_0x37b7bb[_0x9832('0x14')]()]+_0x9832('0x16'),_0x2e5944);return new Promise(function(_0x11d791,_0x1a64d6){if(intUtil[_0x9832('0x17')](_0x2e5944[_0x9832('0x18')])){var _0x3e3e0c={'method':_0x9832('0xb'),'uri':_0x565506+_0x9832('0x19')+_0x2e5944[_0x9832('0x18')]+'&'+_0xb9db34+'&'+_0x3366f0,'auth':_0x590012,'json':!![]};logger[_0x9832('0x11')]('['+[_0x37b7bb[_0x9832('0x14')]()]+_0x9832('0x1a'),_0x3e3e0c);return rp(_0x3e3e0c)[_0x9832('0x1b')](function(_0x3e9bf9){logger['info']('['+[_0x37b7bb['toUpperCase']()]+_0x9832('0x1c'),_0x3e9bf9);if(_0x3e9bf9[_0x9832('0xd')]['length']>0x0&&String(_0x3e9bf9[_0x9832('0xd')][0x0][_0x9832('0x1d')])===_0x9832('0x1e')){_0x2e5944[_0x9832('0x1f')]=_0x3e9bf9[_0x9832('0xd')][0x0][_0x9832('0x10')];}else{_0x2e5944[_0x9832('0x1f')]=_0x2e5944[_0x9832('0xf')];_0x2e5944[_0x9832('0x18')]=_0x2e5944[_0x9832('0x20')];}logger[_0x9832('0x11')]('['+[_0x37b7bb['toUpperCase']()]+_0x9832('0x21'),_0x2e5944);_0x11d791(_0x2e5944);})['catch'](function(_0x33ac6e){logger['error']('['+[_0x37b7bb[_0x9832('0x14')]()]+']',_0x33ac6e[_0x9832('0x15')]);_0x1a64d6(_0x33ac6e[_0x9832('0x15')]);});}else{logger[_0x9832('0x11')]('['+[_0x37b7bb['toUpperCase']()]+_0x9832('0x22'));_0x2e5944[_0x9832('0x1f')]=_0x2e5944[_0x9832('0xf')];_0x2e5944[_0x9832('0x18')]=_0x2e5944[_0x9832('0x20')];_0x11d791(_0x2e5944);}});};}function createEndUser(_0x1d5c56,_0x4e1458,_0x18d077,_0xf18595,_0x3f8202){logger[_0x9832('0x11')]('['+[_0x1d5c56[_0x9832('0x14')]()]+_0x9832('0x23'),_0x18d077);return new Promise(function(_0x1f40a6,_0x59b29d){var _0x1ae1c0={'method':'POST','uri':_0xf18595+_0x9832('0x24')+_0x3f8202,'body':{'user_name':_0x18d077[_0x9832('0x25')],'roles':_0x9832('0x26'),'first_name':_0x18d077['endUserNumber'],'active':_0x9832('0x1e'),'date_format':_0x9832('0x27'),'phone':_0x18d077[_0x9832('0x25')]},'auth':_0x4e1458,'json':!![]};return rp(_0x1ae1c0)[_0x9832('0x1b')](function(_0x5e22db){logger[_0x9832('0x11')]('['+[_0x1d5c56['toUpperCase']()]+_0x9832('0x28'),_0x5e22db[_0x9832('0xd')]);_0x18d077[_0x9832('0x29')]=_0x5e22db[_0x9832('0xd')][_0x9832('0x10')];_0x1f40a6(_0x18d077);})[_0x9832('0x12')](function(_0x3e97d9){logger[_0x9832('0x13')]('['+[_0x1d5c56[_0x9832('0x14')]()]+']',_0x3e97d9[_0x9832('0x15')]);_0x59b29d(_0x3e97d9[_0x9832('0x15')]);});});}function getEndUser(_0x326091,_0x4ed9df,_0x2db079,_0x5e1911,_0x1fff98){return function(_0x4bfc40){logger[_0x9832('0x11')]('['+[_0x326091[_0x9832('0x14')]()]+_0x9832('0x2a'),_0x4bfc40);return new Promise(function(_0x42754f,_0x353a31){var _0x29882e={'method':'GET','uri':_0x2db079+_0x9832('0x2b')+_0x4bfc40[_0x9832('0x25')]+'&'+_0x5e1911+'&'+_0x1fff98,'auth':_0x4ed9df,'json':!![]};return rp(_0x29882e)[_0x9832('0x1b')](function(_0x47ec59){if(_0x47ec59['result'][_0x9832('0xe')]>0x0){_0x4bfc40[_0x9832('0x29')]=_0x47ec59[_0x9832('0xd')][0x0][_0x9832('0x10')];logger[_0x9832('0x11')]('['+[_0x326091[_0x9832('0x14')]()]+_0x9832('0x2c'),_0x4bfc40);_0x42754f(_0x4bfc40);}else{return createEndUser(_0x326091,_0x4ed9df,_0x4bfc40,_0x2db079,_0x5e1911)[_0x9832('0x1b')](function(_0x4b1277){logger[_0x9832('0x11')]('['+[_0x326091['toUpperCase']()]+_0x9832('0x2d'),_0x4b1277);_0x42754f(_0x4b1277);});}})['catch'](function(_0x4fa23a){logger[_0x9832('0x13')]('['+[_0x326091[_0x9832('0x14')]()]+']',_0x4fa23a['message']);_0x353a31(_0x4fa23a[_0x9832('0x15')]);});});};}function getCustomFields(_0x44e315,_0x10ae91){var _0xc4b0ad={};if(_0x44e315[_0x9832('0xe')]>0x0){_['forEach'](_0x44e315,function(_0x4c0d18){if(_[_0x9832('0x2e')](['string',_0x9832('0x2f')],_0x4c0d18[_0x9832('0x30')])&&_0x4c0d18[_0x9832('0x31')]&&!_0x4c0d18[_0x9832('0x32')]){_0xc4b0ad[_0x4c0d18['nameField'][_0x9832('0x33')]()]=_0x4c0d18['content'][_0x9832('0x34')]();}else if(_[_0x9832('0x2e')]([_0x9832('0x35'),_0x9832('0x2f')],_0x4c0d18[_0x9832('0x30')])&&_0x4c0d18[_0x9832('0x36')]&&_0x4c0d18['customField']){_0xc4b0ad[_0x4c0d18['idField']['toLowerCase']()]=_0x4c0d18[_0x9832('0x37')][_0x9832('0x34')]();}else if(_0x4c0d18[_0x9832('0x30')]===_0x9832('0x38')&&_0x4c0d18[_0x9832('0x39')]&&_0x4c0d18['idField']&&_0x4c0d18[_0x9832('0x32')]){_0xc4b0ad[_0x4c0d18['idField'][_0x9832('0x33')]()]=_0x10ae91[_0x4c0d18['variableName']][_0x9832('0x34')]();}else if(_0x4c0d18['type']===_0x9832('0x3a')&&_0x4c0d18['Variable']&&_0x4c0d18[_0x9832('0x3b')]['name']&&_0x4c0d18[_0x9832('0x36')]&&_0x4c0d18[_0x9832('0x32')]){_0xc4b0ad[_0x4c0d18[_0x9832('0x36')][_0x9832('0x33')]()]=_0x10ae91[_0x4c0d18[_0x9832('0x3b')][_0x9832('0x3c')][_0x9832('0x33')]()]['toString']();}});}return _0xc4b0ad;}function getTicket(_0x4bc8f6,_0x566021,_0x3e2455,_0x2494b1,_0x4a4a58,_0x503e9b){return function(_0x4fedb8){logger[_0x9832('0x11')]('['+[_0x4bc8f6['toUpperCase']()]+_0x9832('0x3d'),_0x4fedb8);return new Promise(function(_0x53406c,_0x5607a8){var _0x3490aa=_0x4bc8f6[_0x9832('0x33')]()==='outbound'?_0x4fedb8[_0x9832('0x1f')]:_0x4fedb8[_0x9832('0x29')];var _0x2cbf52={'method':_0x9832('0x3e'),'uri':_0x3e2455+'incident'+'?'+_0x503e9b,'body':Object[_0x9832('0x3f')]({},{'active':_0x9832('0x1e'),'caller_id':_0x3490aa,'assigned_to':_0x4fedb8['userId'],'short_description':intUtil[_0x9832('0x40')](_0x2494b1[_0x9832('0x41')],_0x4a4a58,'\x20'),'description':intUtil[_0x9832('0x40')](_0x2494b1[_0x9832('0x42')],_0x4a4a58,'\x0a')},getCustomFields(_0x2494b1[_0x9832('0x43')],_0x4a4a58)),'auth':_0x566021,'json':!![]};return rp(_0x2cbf52)[_0x9832('0x1b')](function(_0x277666){logger[_0x9832('0x11')]('['+[_0x4bc8f6['toUpperCase']()]+_0x9832('0x44'),_0x277666[_0x9832('0xd')]);_0x4fedb8[_0x9832('0x45')]=_0x277666[_0x9832('0xd')][_0x9832('0x10')];_0x4fedb8[_0x9832('0x46')]=_0x277666[_0x9832('0xd')][_0x9832('0x47')];logger[_0x9832('0x11')]('['+[_0x4bc8f6[_0x9832('0x14')]()]+']\x20getTicket\x20crm',_0x4fedb8);_0x53406c(_0x4fedb8);})[_0x9832('0x12')](function(_0x5cf696){logger[_0x9832('0x13')]('['+[_0x4bc8f6[_0x9832('0x14')]()]+']',_0x5cf696[_0x9832('0x15')]);_0x5607a8(_0x5cf696[_0x9832('0x15')]);});});};}function createRemoteTag(_0xddc1b9,_0x390a24,_0x46293a,_0x496a21){return new Promise(function(_0x5c1b9e,_0x54d11a){var _0x3918ab={'method':_0x9832('0x3e'),'uri':_0x46293a+_0x9832('0x48')+'?'+_0x496a21,'body':{'short_description':_0xddc1b9,'global':!![],'active':!![],'name':_0xddc1b9},'auth':_0x390a24,'json':!![]};return rp(_0x3918ab)['then'](function(_0x2d57a6){var _0xb5a1da=_0x2d57a6['result'][_0x9832('0x10')];_0x5c1b9e(_0xb5a1da);});});}function getRemoteTag(_0x31e55d,_0x19e038,_0x3f793b,_0x588608,_0x18c8a3){return new Promise(function(_0x4037de,_0x48a94e){var _0x47b1d6={'method':_0x9832('0xb'),'uri':_0x3f793b+_0x9832('0x48')+'?sysparm_query=name%3D'+_0x31e55d+'&'+_0x588608,'auth':_0x19e038,'json':!![]};return rp(_0x47b1d6)[_0x9832('0x1b')](function(_0x15ace8){if(_0x15ace8['result']['length']>0x0){var _0x5d2103=_0x15ace8[_0x9832('0xd')][0x0][_0x9832('0x10')];_0x4037de(_0x5d2103);}else{return createRemoteTag(_0x31e55d,_0x19e038,_0x3f793b,_0x588608)[_0x9832('0x1b')](function(_0x455d91){_0x4037de(_0x455d91);});}});});}function assignTagToIncident(_0x2e7074,_0x36b3b9,_0x260146,_0x5062ca,_0x2cb80e){return new Promise(function(_0x1a6b6e,_0x430360){var _0x5d975f={'method':_0x9832('0x3e'),'uri':_0x260146+_0x9832('0x49')+'?'+_0x2cb80e,'body':{'label':_0x2e7074,'table':_0x9832('0x4a'),'id_type':'Incident','table_key':_0x5062ca[_0x9832('0x45')],'title':'Incident\x20-\x20'+_0x5062ca[_0x9832('0x46')],'id_display':_0x5062ca[_0x9832('0x46')]},'auth':_0x36b3b9,'json':!![]};return rp(_0x5d975f)[_0x9832('0x1b')](function(_0x319ae2){_0x1a6b6e();})['catch'](function(){_0x1a6b6e();});});}function manageTags(_0x16ac4a,_0x1f676f,_0x814f21,_0x5374b4,_0x1939ae,_0x3cf106,_0x501227){return new Promise(function(_0x4cac93,_0x40a20c){var _0x3ec922=[];_0x1f676f[_0x9832('0x4b')](function(_0x41f4d8){_0x3ec922[_0x9832('0x4c')](getRemoteTag(_0x41f4d8,_0x814f21,_0x5374b4,_0x3cf106,_0x501227));});return Promise[_0x9832('0x4d')](_0x3ec922)['then'](function(_0x3b6a0e){if(_0x3b6a0e[_0x9832('0xe')]){logger[_0x9832('0x11')]('['+[_0x16ac4a[_0x9832('0x14')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x3b6a0e);var _0x1b19aa=[];_0x3b6a0e[_0x9832('0x4b')](function(_0x29c01c){_0x1b19aa[_0x9832('0x4c')](assignTagToIncident(_0x29c01c,_0x814f21,_0x5374b4,_0x1939ae,_0x3cf106));});return Promise[_0x9832('0x4d')](_0x1b19aa)[_0x9832('0x1b')](function(){_0x4cac93();})['catch'](function(){_0x4cac93();});}else{_0x4cac93();}});});}function getTags(_0x543f37,_0x4140de,_0x2cc604,_0x3770fa,_0x5dbca9,_0x2526de){return function(_0x8fed47){return new Promise(function(_0x38da18,_0xe7fae5){var _0x50d2ab=[];var _0x115815=_0x3770fa[_0x9832('0x4e')];if(_0x115815&&_0x115815[_0x9832('0xe')]>0x0){_0x50d2ab=_[_0x9832('0x4f')](_0x115815,_0x9832('0x3c'));}if(_0x50d2ab['length']>0x0){return manageTags(_0x543f37,_0x50d2ab,_0x4140de,_0x2cc604,_0x8fed47,_0x5dbca9,_0x2526de)[_0x9832('0x1b')](function(){_0x38da18(_0x8fed47);});}else{_0x38da18(_0x8fed47);}});};}function emit(_0x955b9a,_0xaae488,_0x5c2c7f){var _0x4343f4=_0x9832('0x50')+_0x9832('0x51')+_0x9832('0x52')+'%255EORDERBYDESCnumber';var _0x4e6c44={'uri':_0x955b9a+_0x9832('0x53')+_0x5c2c7f+_0x4343f4};io['to'](util['format']('user:%s',_0xaae488))[_0x9832('0x54')](_0x9832('0x55'),_0x4e6c44);}exports['cs']=function(_0x414401,_0x3ec8ff,_0x58102c,_0x5475d8,_0xbdeecf,_0x511fec,_0x10db66,_0x42b358){var _0x562715={};var _0x541594={'user':_0x511fec['username'],'pass':_0x511fec[_0x9832('0x56')]};var _0x2d7c78=_0x9832('0x57');var _0x5a4858=_0x9832('0x58');_0x511fec[_0x9832('0x59')]=intUtil['stripTrailingSlash'](_0x511fec[_0x9832('0x59')]);_0x511fec['serverUrl']=intUtil['stripTrailingSlash'](_0x511fec[_0x9832('0x5a')]);var _0x2ef79a=util[_0x9832('0x5b')](_0x9832('0x5c'),_0x511fec[_0x9832('0x59')]);_0x562715[_0x9832('0x18')]=!_[_0x9832('0x5d')](_0x5475d8)?_0x5475d8[_0x9832('0x5e')]:null;_0x562715['adminEmail']=_0x511fec[_0x9832('0x5e')];_0x562715[_0x9832('0x25')]=_0x42b358[_0x9832('0x33')]()===_0x9832('0x5f')?_0x3ec8ff['destcalleridnum']:_0x3ec8ff['calleridnum'];_0x562715['callDirection']=_0x42b358===_0x9832('0x60')||_0x42b358===_0x9832('0x61')?_0x9832('0x60'):_0x9832('0x5f');var _0x3409e5=util[_0x9832('0x5b')](_0x9832('0x62'),_0x511fec[_0x9832('0x5a')],_0x3ec8ff[_0x9832('0x63')],md5(_0x3ec8ff['uniqueid']));if(_0xbdeecf&&_0xbdeecf[_0x9832('0x64')]){logger['info']('[QUEUE]',_0x9832('0x65'));_0x3ec8ff['recordingURL']=_0x3409e5;}else if(_0x10db66&&_0x10db66['recordingFormat']&&_0x10db66[_0x9832('0x66')]!==_0x9832('0x67')){logger['info'](_0x9832('0x68'),_0x9832('0x65'));_0x3ec8ff[_0x9832('0x69')]=_0x3409e5;}else{_0x3ec8ff['recordingURL']='';}return getAdminUser(_0x42b358,_0x541594,_0x562715,_0x2ef79a,_0x5a4858,_0x2d7c78)[_0x9832('0x1b')](getUser(_0x42b358,_0x541594,_0x2ef79a,_0x5a4858,_0x2d7c78))[_0x9832('0x1b')](getEndUser(_0x42b358,_0x541594,_0x2ef79a,_0x5a4858,_0x2d7c78))[_0x9832('0x1b')](getTicket(_0x42b358,_0x541594,_0x2ef79a,_0x58102c,_0x3ec8ff,_0x5a4858))[_0x9832('0x1b')](function(_0x335dd3){logger[_0x9832('0x11')](util[_0x9832('0x5b')](_0x9832('0x6a'),_0x335dd3[_0x9832('0x45')]));logger['info'](util[_0x9832('0x5b')](_0x9832('0x6b'),_0x42b358));if(_0x42b358!=='unmanaged'){logger[_0x9832('0x11')]('['+[_0x42b358[_0x9832('0x14')]()]+']',_0x9832('0x6c'));emit(_0x511fec[_0x9832('0x59')],_0x5475d8[_0x9832('0x3c')],_0x335dd3[_0x9832('0x45')]);}})[_0x9832('0x12')](function(_0x426ccd){logger[_0x9832('0x13')]('['+[_0x42b358[_0x9832('0x14')]()]+_0x9832('0x6d'),util[_0x9832('0x6e')](_0x426ccd,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xfe07=['true','sys_id','adminId','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','userId','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','endUserId','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','idField','content','variableName','Variable','name','outbound','incident','assign','getString','Descriptions','Fields','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','push','all','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','inspect','bluebird','util','md5','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','info','toUpperCase','error','message','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xfe07,0x17e));var _0x7fe0=function(_0x3e4cac,_0x4c86d3){_0x3e4cac=_0x3e4cac-0x0;var _0x176be9=_0xfe07[_0x3e4cac];return _0x176be9;};'use strict';var _=require('lodash');var Promise=require(_0x7fe0('0x0'));var rp=require('request-promise');var util=require(_0x7fe0('0x1'));var md5=require(_0x7fe0('0x2'));var Redis=require(_0x7fe0('0x3'));var intUtil=require(_0x7fe0('0x4'));var config=require('../../../../config/environment');var logger=require(_0x7fe0('0x5'))('servicenow');config[_0x7fe0('0x6')]=_[_0x7fe0('0x7')](config[_0x7fe0('0x6')],{'host':_0x7fe0('0x8'),'port':0x18eb});var io=require(_0x7fe0('0x9'))(new Redis(config[_0x7fe0('0x6')]));function getAdminUser(_0x2d0008,_0x15dfbd,_0x395a8b,_0x1da6ce,_0x41c334,_0x53467b){return new Promise(function(_0x3d5815,_0x2e176a){var _0x55ba28={'method':_0x7fe0('0xa'),'uri':_0x1da6ce+_0x7fe0('0xb')+'&'+_0x41c334+'&'+_0x53467b,'auth':_0x15dfbd,'json':!![]};return rp(_0x55ba28)['then'](function(_0x50d09b){if(_0x50d09b[_0x7fe0('0xc')][_0x7fe0('0xd')]>0x0){_0x395a8b['adminId']=_0x50d09b[_0x7fe0('0xc')][0x0]['sys_id'];}logger[_0x7fe0('0xe')]('['+[_0x2d0008[_0x7fe0('0xf')]()]+'],\x20getAdminUser\x20crm',_0x395a8b);_0x3d5815(_0x395a8b);})['catch'](function(_0x275638){logger[_0x7fe0('0x10')]('['+[_0x2d0008['toUpperCase']()]+']',_0x275638[_0x7fe0('0x11')]);_0x2e176a(_0x275638[_0x7fe0('0x11')]);});});}function getUser(_0x5e8fc3,_0x519054,_0x1232e4,_0x3d4c23,_0x37ff0b){return function(_0x4cf4f7){logger[_0x7fe0('0xe')]('['+[_0x5e8fc3[_0x7fe0('0xf')]()]+_0x7fe0('0x12'),_0x4cf4f7);return new Promise(function(_0xb36d05,_0x571071){if(intUtil[_0x7fe0('0x13')](_0x4cf4f7['userEmail'])){var _0x8e52f2={'method':'GET','uri':_0x1232e4+_0x7fe0('0x14')+_0x4cf4f7[_0x7fe0('0x15')]+'&'+_0x3d4c23+'&'+_0x37ff0b,'auth':_0x519054,'json':!![]};logger['info']('['+[_0x5e8fc3[_0x7fe0('0xf')]()]+_0x7fe0('0x16'),_0x8e52f2);return rp(_0x8e52f2)[_0x7fe0('0x17')](function(_0x37ca6f){logger[_0x7fe0('0xe')]('['+[_0x5e8fc3['toUpperCase']()]+_0x7fe0('0x18'),_0x37ca6f);if(_0x37ca6f[_0x7fe0('0xc')][_0x7fe0('0xd')]>0x0&&String(_0x37ca6f[_0x7fe0('0xc')][0x0][_0x7fe0('0x19')])===_0x7fe0('0x1a')){_0x4cf4f7['userId']=_0x37ca6f[_0x7fe0('0xc')][0x0][_0x7fe0('0x1b')];}else{_0x4cf4f7['userId']=_0x4cf4f7[_0x7fe0('0x1c')];_0x4cf4f7[_0x7fe0('0x15')]=_0x4cf4f7[_0x7fe0('0x1d')];}logger[_0x7fe0('0xe')]('['+[_0x5e8fc3[_0x7fe0('0xf')]()]+_0x7fe0('0x1e'),_0x4cf4f7);_0xb36d05(_0x4cf4f7);})[_0x7fe0('0x1f')](function(_0x3439ff){logger['error']('['+[_0x5e8fc3[_0x7fe0('0xf')]()]+']',_0x3439ff['message']);_0x571071(_0x3439ff['message']);});}else{logger[_0x7fe0('0xe')]('['+[_0x5e8fc3[_0x7fe0('0xf')]()]+_0x7fe0('0x20'));_0x4cf4f7[_0x7fe0('0x21')]=_0x4cf4f7[_0x7fe0('0x1c')];_0x4cf4f7[_0x7fe0('0x15')]=_0x4cf4f7[_0x7fe0('0x1d')];_0xb36d05(_0x4cf4f7);}});};}function createEndUser(_0x29b40f,_0x4b0386,_0x57a6e1,_0x34acfe,_0x4d290d){logger[_0x7fe0('0xe')]('['+[_0x29b40f[_0x7fe0('0xf')]()]+_0x7fe0('0x22'),_0x57a6e1);return new Promise(function(_0x3f5b50,_0x205eaf){var _0x39fdb3={'method':_0x7fe0('0x23'),'uri':_0x34acfe+_0x7fe0('0x24')+_0x4d290d,'body':{'user_name':_0x57a6e1[_0x7fe0('0x25')],'roles':_0x7fe0('0x26'),'first_name':_0x57a6e1[_0x7fe0('0x25')],'active':_0x7fe0('0x1a'),'date_format':_0x7fe0('0x27'),'phone':_0x57a6e1['endUserNumber']},'auth':_0x4b0386,'json':!![]};return rp(_0x39fdb3)[_0x7fe0('0x17')](function(_0x4a2704){logger[_0x7fe0('0xe')]('['+[_0x29b40f[_0x7fe0('0xf')]()]+'],\x20EndUser\x20schema',_0x4a2704[_0x7fe0('0xc')]);_0x57a6e1[_0x7fe0('0x28')]=_0x4a2704[_0x7fe0('0xc')][_0x7fe0('0x1b')];_0x3f5b50(_0x57a6e1);})[_0x7fe0('0x1f')](function(_0x527cea){logger[_0x7fe0('0x10')]('['+[_0x29b40f[_0x7fe0('0xf')]()]+']',_0x527cea[_0x7fe0('0x11')]);_0x205eaf(_0x527cea[_0x7fe0('0x11')]);});});}function getEndUser(_0x54d557,_0x101980,_0x2a242c,_0x3aab45,_0x32ef52){return function(_0x2bceec){logger['info']('['+[_0x54d557['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x2bceec);return new Promise(function(_0x1dd5ae,_0x27ca41){var _0x1c1761={'method':_0x7fe0('0xa'),'uri':_0x2a242c+_0x7fe0('0x29')+_0x2bceec[_0x7fe0('0x25')]+'&'+_0x3aab45+'&'+_0x32ef52,'auth':_0x101980,'json':!![]};return rp(_0x1c1761)[_0x7fe0('0x17')](function(_0x38ea00){if(_0x38ea00[_0x7fe0('0xc')][_0x7fe0('0xd')]>0x0){_0x2bceec['endUserId']=_0x38ea00[_0x7fe0('0xc')][0x0][_0x7fe0('0x1b')];logger[_0x7fe0('0xe')]('['+[_0x54d557['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x2bceec);_0x1dd5ae(_0x2bceec);}else{return createEndUser(_0x54d557,_0x101980,_0x2bceec,_0x2a242c,_0x3aab45)[_0x7fe0('0x17')](function(_0x1333bf){logger['info']('['+[_0x54d557[_0x7fe0('0xf')]()]+_0x7fe0('0x2a'),_0x1333bf);_0x1dd5ae(_0x1333bf);});}})[_0x7fe0('0x1f')](function(_0x724c66){logger['error']('['+[_0x54d557[_0x7fe0('0xf')]()]+']',_0x724c66[_0x7fe0('0x11')]);_0x27ca41(_0x724c66[_0x7fe0('0x11')]);});});};}function getCustomFields(_0xe32937,_0x312219){var _0x5b3a7d={};if(_0xe32937[_0x7fe0('0xd')]>0x0){_[_0x7fe0('0x2b')](_0xe32937,function(_0x20f3b1){if(_[_0x7fe0('0x2c')]([_0x7fe0('0x2d'),_0x7fe0('0x2e')],_0x20f3b1[_0x7fe0('0x2f')])&&_0x20f3b1[_0x7fe0('0x30')]&&!_0x20f3b1[_0x7fe0('0x31')]){_0x5b3a7d[_0x20f3b1[_0x7fe0('0x30')][_0x7fe0('0x32')]()]=_0x20f3b1['content']['toString']();}else if(_['includes'](['string',_0x7fe0('0x2e')],_0x20f3b1[_0x7fe0('0x2f')])&&_0x20f3b1[_0x7fe0('0x33')]&&_0x20f3b1[_0x7fe0('0x31')]){_0x5b3a7d[_0x20f3b1['idField']['toLowerCase']()]=_0x20f3b1[_0x7fe0('0x34')]['toString']();}else if(_0x20f3b1[_0x7fe0('0x2f')]==='variable'&&_0x20f3b1[_0x7fe0('0x35')]&&_0x20f3b1['idField']&&_0x20f3b1[_0x7fe0('0x31')]){_0x5b3a7d[_0x20f3b1[_0x7fe0('0x33')][_0x7fe0('0x32')]()]=_0x312219[_0x20f3b1['variableName']]['toString']();}else if(_0x20f3b1[_0x7fe0('0x2f')]==='customVariable'&&_0x20f3b1[_0x7fe0('0x36')]&&_0x20f3b1[_0x7fe0('0x36')]['name']&&_0x20f3b1[_0x7fe0('0x33')]&&_0x20f3b1[_0x7fe0('0x31')]){_0x5b3a7d[_0x20f3b1[_0x7fe0('0x33')]['toLowerCase']()]=_0x312219[_0x20f3b1[_0x7fe0('0x36')][_0x7fe0('0x37')][_0x7fe0('0x32')]()]['toString']();}});}return _0x5b3a7d;}function getTicket(_0x468731,_0x254e35,_0x1dc3df,_0x46894d,_0x426b84,_0x173a79){return function(_0x421939){logger[_0x7fe0('0xe')]('['+[_0x468731[_0x7fe0('0xf')]()]+']\x20getTicket\x20input\x20crm',_0x421939);return new Promise(function(_0x499bbf,_0x2e992e){var _0x1befbf=_0x468731[_0x7fe0('0x32')]()===_0x7fe0('0x38')?_0x421939[_0x7fe0('0x21')]:_0x421939[_0x7fe0('0x28')];var _0x2a7630={'method':_0x7fe0('0x23'),'uri':_0x1dc3df+_0x7fe0('0x39')+'?'+_0x173a79,'body':Object[_0x7fe0('0x3a')]({},{'active':_0x7fe0('0x1a'),'caller_id':_0x1befbf,'assigned_to':_0x421939[_0x7fe0('0x21')],'short_description':intUtil['getString'](_0x46894d['Subjects'],_0x426b84,'\x20'),'description':intUtil[_0x7fe0('0x3b')](_0x46894d[_0x7fe0('0x3c')],_0x426b84,'\x0a')},getCustomFields(_0x46894d[_0x7fe0('0x3d')],_0x426b84)),'auth':_0x254e35,'json':!![]};return rp(_0x2a7630)['then'](function(_0x5dd451){logger['info']('['+[_0x468731[_0x7fe0('0xf')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x5dd451[_0x7fe0('0xc')]);_0x421939[_0x7fe0('0x3e')]=_0x5dd451['result']['sys_id'];_0x421939[_0x7fe0('0x3f')]=_0x5dd451[_0x7fe0('0xc')][_0x7fe0('0x40')];logger['info']('['+[_0x468731[_0x7fe0('0xf')]()]+']\x20getTicket\x20crm',_0x421939);_0x499bbf(_0x421939);})[_0x7fe0('0x1f')](function(_0x1a7341){logger[_0x7fe0('0x10')]('['+[_0x468731['toUpperCase']()]+']',_0x1a7341[_0x7fe0('0x11')]);_0x2e992e(_0x1a7341[_0x7fe0('0x11')]);});});};}function createRemoteTag(_0x2a02f8,_0x524776,_0x2fb1e4,_0x197d62){return new Promise(function(_0x465628,_0x22d50b){var _0x426917={'method':_0x7fe0('0x23'),'uri':_0x2fb1e4+'label'+'?'+_0x197d62,'body':{'short_description':_0x2a02f8,'global':!![],'active':!![],'name':_0x2a02f8},'auth':_0x524776,'json':!![]};return rp(_0x426917)[_0x7fe0('0x17')](function(_0x4d5388){var _0x5483bf=_0x4d5388[_0x7fe0('0xc')][_0x7fe0('0x1b')];_0x465628(_0x5483bf);});});}function getRemoteTag(_0x1dae83,_0x5edcb2,_0x8576ac,_0x4e3c25,_0xd58c12){return new Promise(function(_0x4c6ab9,_0x52bb86){var _0xbf9c9c={'method':_0x7fe0('0xa'),'uri':_0x8576ac+_0x7fe0('0x41')+_0x7fe0('0x42')+_0x1dae83+'&'+_0x4e3c25,'auth':_0x5edcb2,'json':!![]};return rp(_0xbf9c9c)['then'](function(_0x53f961){if(_0x53f961[_0x7fe0('0xc')][_0x7fe0('0xd')]>0x0){var _0x3cfe0c=_0x53f961[_0x7fe0('0xc')][0x0]['sys_id'];_0x4c6ab9(_0x3cfe0c);}else{return createRemoteTag(_0x1dae83,_0x5edcb2,_0x8576ac,_0x4e3c25)[_0x7fe0('0x17')](function(_0x53011e){_0x4c6ab9(_0x53011e);});}});});}function assignTagToIncident(_0x586d72,_0x150d2f,_0x1348fc,_0x1a76e7,_0x562581){return new Promise(function(_0x2c6bcb,_0x2bd2bd){var _0x16faa2={'method':_0x7fe0('0x23'),'uri':_0x1348fc+_0x7fe0('0x43')+'?'+_0x562581,'body':{'label':_0x586d72,'table':_0x7fe0('0x39'),'id_type':_0x7fe0('0x44'),'table_key':_0x1a76e7['ticketId'],'title':'Incident\x20-\x20'+_0x1a76e7[_0x7fe0('0x3f')],'id_display':_0x1a76e7['ticketNumber']},'auth':_0x150d2f,'json':!![]};return rp(_0x16faa2)[_0x7fe0('0x17')](function(_0x5d8557){_0x2c6bcb();})['catch'](function(){_0x2c6bcb();});});}function manageTags(_0x4f1696,_0x95a756,_0x42e306,_0x5f4357,_0x230f1a,_0x432501,_0x5979b1){return new Promise(function(_0x2123b0,_0x48853b){var _0xd77c39=[];_0x95a756[_0x7fe0('0x2b')](function(_0x122b3e){_0xd77c39[_0x7fe0('0x45')](getRemoteTag(_0x122b3e,_0x42e306,_0x5f4357,_0x432501,_0x5979b1));});return Promise[_0x7fe0('0x46')](_0xd77c39)[_0x7fe0('0x17')](function(_0x3f1976){if(_0x3f1976[_0x7fe0('0xd')]){logger[_0x7fe0('0xe')]('['+[_0x4f1696[_0x7fe0('0xf')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x3f1976);var _0x441a46=[];_0x3f1976['forEach'](function(_0x41515d){_0x441a46['push'](assignTagToIncident(_0x41515d,_0x42e306,_0x5f4357,_0x230f1a,_0x432501));});return Promise[_0x7fe0('0x46')](_0x441a46)[_0x7fe0('0x17')](function(){_0x2123b0();})[_0x7fe0('0x1f')](function(){_0x2123b0();});}else{_0x2123b0();}});});}function getTags(_0x3e33d4,_0x1f0c45,_0x1024cc,_0x595ae6,_0x1c25ac,_0x331256){return function(_0x4016ff){return new Promise(function(_0x3f8088,_0x37fb9b){var _0x53fc97=[];var _0x345052=_0x595ae6[_0x7fe0('0x47')];if(_0x345052&&_0x345052[_0x7fe0('0xd')]>0x0){_0x53fc97=_['map'](_0x345052,_0x7fe0('0x37'));}if(_0x53fc97[_0x7fe0('0xd')]>0x0){return manageTags(_0x3e33d4,_0x53fc97,_0x1f0c45,_0x1024cc,_0x4016ff,_0x1c25ac,_0x331256)[_0x7fe0('0x17')](function(){_0x3f8088(_0x4016ff);});}else{_0x3f8088(_0x4016ff);}});};}function emit(_0x57778b,_0x1904de,_0x3153fb){var _0x53e27f='%26sysparm_record_target%3Dincident'+_0x7fe0('0x48')+_0x7fe0('0x49')+_0x7fe0('0x4a');var _0x460822={'uri':_0x57778b+_0x7fe0('0x4b')+_0x3153fb+_0x53e27f};io['to'](util[_0x7fe0('0x4c')]('user:%s',_0x1904de))['emit'](_0x7fe0('0x4d'),_0x460822);}exports['cs']=function(_0x58d639,_0x4dcdb8,_0xc60908,_0x4d85a4,_0x8f04f4,_0x33bcc9,_0xef62ec,_0x5c1fe4){var _0x21886c={};var _0x55632a={'user':_0x33bcc9[_0x7fe0('0x4e')],'pass':_0x33bcc9[_0x7fe0('0x4f')]};var _0x4779b9=_0x7fe0('0x50');var _0x41220e=_0x7fe0('0x51');_0x33bcc9[_0x7fe0('0x52')]=intUtil[_0x7fe0('0x53')](_0x33bcc9[_0x7fe0('0x52')]);_0x33bcc9[_0x7fe0('0x54')]=intUtil[_0x7fe0('0x53')](_0x33bcc9['serverUrl']);var _0x4937bc=util[_0x7fe0('0x4c')](_0x7fe0('0x55'),_0x33bcc9['remoteUri']);_0x21886c[_0x7fe0('0x15')]=!_[_0x7fe0('0x56')](_0x4d85a4)?_0x4d85a4[_0x7fe0('0x57')]:null;_0x21886c['adminEmail']=_0x33bcc9['email'];_0x21886c[_0x7fe0('0x25')]=_0x5c1fe4[_0x7fe0('0x32')]()===_0x7fe0('0x38')?_0x4dcdb8[_0x7fe0('0x58')]:_0x4dcdb8[_0x7fe0('0x59')];_0x21886c[_0x7fe0('0x5a')]=_0x5c1fe4==='queue'||_0x5c1fe4===_0x7fe0('0x5b')?'queue':_0x7fe0('0x38');var _0x18c069=util[_0x7fe0('0x4c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x33bcc9[_0x7fe0('0x54')],_0x4dcdb8[_0x7fe0('0x5c')],md5(_0x4dcdb8[_0x7fe0('0x5c')]));if(_0x8f04f4&&_0x8f04f4[_0x7fe0('0x5d')]){logger['info'](_0x7fe0('0x5e'),_0x7fe0('0x5f'));_0x4dcdb8['recordingURL']=_0x18c069;}else if(_0xef62ec&&_0xef62ec['recordingFormat']&&_0xef62ec['recordingFormat']!==_0x7fe0('0x60')){logger[_0x7fe0('0xe')](_0x7fe0('0x61'),'Recording\x20is\x20enabled!');_0x4dcdb8[_0x7fe0('0x62')]=_0x18c069;}else{_0x4dcdb8[_0x7fe0('0x62')]='';}return getAdminUser(_0x5c1fe4,_0x55632a,_0x21886c,_0x4937bc,_0x41220e,_0x4779b9)[_0x7fe0('0x17')](getUser(_0x5c1fe4,_0x55632a,_0x4937bc,_0x41220e,_0x4779b9))[_0x7fe0('0x17')](getEndUser(_0x5c1fe4,_0x55632a,_0x4937bc,_0x41220e,_0x4779b9))['then'](getTicket(_0x5c1fe4,_0x55632a,_0x4937bc,_0xc60908,_0x4dcdb8,_0x41220e))[_0x7fe0('0x17')](function(_0x23c7ed){logger[_0x7fe0('0xe')](util[_0x7fe0('0x4c')](_0x7fe0('0x63'),_0x23c7ed[_0x7fe0('0x3e')]));logger[_0x7fe0('0xe')](util[_0x7fe0('0x4c')](_0x7fe0('0x64'),_0x5c1fe4));if(_0x5c1fe4!==_0x7fe0('0x5b')){logger[_0x7fe0('0xe')]('['+[_0x5c1fe4[_0x7fe0('0xf')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x33bcc9[_0x7fe0('0x52')],_0x4d85a4['name'],_0x23c7ed[_0x7fe0('0x3e')]);}})['catch'](function(_0x36f503){logger[_0x7fe0('0x10')]('['+[_0x5c1fe4[_0x7fe0('0xf')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x7fe0('0x65')](_0x36f503,{'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 2e84f81..8193632 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 _0x86c9=['lastevent','toUpperCase','users','lodash','request-promise','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','description','Descriptions','date_start','toISOString','slice','replace','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','push','idField','variableName','set_entry','JSON','Calls','apiKey','base64','get_server_info','isNil','get_entry_list','stringify','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','merge','type','string','nameField','customField','toLowerCase','toString','custom_fields','content','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','queue','remoteUri','stripTrailingSlash','serverUrl','uri','[QUEUE]','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Ticket\x20ID\x20is:','contacts','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','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','Fields','Outbound','Ticket\x20created!','version','%s/service/v4_1/rest.php','monitor_format'];(function(_0x53aa30,_0x200d34){var _0x1eaaad=function(_0x5283b3){while(--_0x5283b3){_0x53aa30['push'](_0x53aa30['shift']());}};_0x1eaaad(++_0x200d34);}(_0x86c9,0xf3));var _0x986c=function(_0x438541,_0x2010b6){_0x438541=_0x438541-0x0;var _0x117749=_0x86c9[_0x438541];return _0x117749;};'use strict';var _=require(_0x986c('0x0'));var rp=require(_0x986c('0x1'));var BPromise=require(_0x986c('0x2'));var md5=require(_0x986c('0x3'));var util=require(_0x986c('0x4'));var Redis=require('ioredis');var intUtil=require(_0x986c('0x5'));var config=require(_0x986c('0x6'));var logger=require(_0x986c('0x7'))('sugarcrm');config[_0x986c('0x8')]=_[_0x986c('0x9')](config[_0x986c('0x8')],{'host':_0x986c('0xa'),'port':0x18eb});var io=require(_0x986c('0xb'))(new Redis(config['redis']));var def={'method':_0x986c('0xc'),'json':!![]};function emit(_0x16696b,_0x31c31d,_0x431dd7){io['to'](_0x16696b)[_0x986c('0xd')](_0x31c31d,_0x431dd7);}function getTicket(_0x29cd33,_0x15dcc9,_0x50b404,_0x3f45d6,_0x3a8a52,_0x16aa01,_0x66b2f6,_0x3461e0){logger[_0x986c('0xe')](_0x986c('0xf'));var _0x1a03ac=new Date();var _0x55d7c5=[{'name':_0x986c('0x10'),'value':intUtil[_0x986c('0x11')](_0x3f45d6[_0x986c('0x12')],_0x3a8a52,'\x20')},{'name':'assigned_user_id','value':_0x15dcc9['id']},{'name':'created_by','value':_0x15dcc9['id']},{'name':_0x986c('0x13'),'value':intUtil[_0x986c('0x11')](_0x3f45d6[_0x986c('0x14')],_0x3a8a52,'\x0a')},{'name':_0x986c('0x15'),'value':_0x1a03ac[_0x986c('0x16')]()[_0x986c('0x17')](0x0,0x13)[_0x986c('0x18')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x986c('0x19'),'value':_0x50b404['id']},{'name':_0x986c('0x1a'),'value':_0x986c('0x1b')},{'name':_0x986c('0x1c'),'value':_0x50b404[_0x986c('0x10')]},{'name':_0x986c('0x1d'),'value':_0x3461e0}];if(_0x16aa01[_0x986c('0x1e')]){_[_0x986c('0x1f')](_0x16aa01,function(_0x9fd189){if(_0x3a8a52[_0x9fd189['variableName']]){_0x55d7c5[_0x986c('0x20')]({'name':_0x9fd189[_0x986c('0x21')],'value':_0x3a8a52[_0x9fd189[_0x986c('0x22')]]});}});}return request({'form':{'method':_0x986c('0x23'),'input_type':_0x986c('0x24'),'response_type':_0x986c('0x24'),'rest_data':JSON['stringify']({'session':_0x66b2f6['id'],'module_name':_0x986c('0x25'),'name_value_list':_0x55d7c5})}});}function getAuth(_0x2ada3e){return util['format']('Basic\x20%s',new Buffer(_0x2ada3e[_0x986c('0x26')]+':X')['toString'](_0x986c('0x27')));}function getServerInfo(_0xc5a0b7){return request({'form':{'method':_0x986c('0x28'),'input_type':_0x986c('0x24'),'response_type':_0x986c('0x24'),'rest_data':JSON['stringify']({'session':_0xc5a0b7['id']})}});}function getUser(_0x2c1c0f,_0x2bc1e9,_0x56327d){if(!_[_0x986c('0x29')](_0x2bc1e9)){logger[_0x986c('0xe')]('Getting\x20agent\x20with\x20name',_0x2bc1e9);return request({'form':{'method':_0x986c('0x2a'),'input_type':_0x986c('0x24'),'response_type':_0x986c('0x24'),'rest_data':JSON[_0x986c('0x2b')]({'session':_0x56327d['id'],'module_name':_0x986c('0x2c'),'query':util[_0x986c('0x2d')](_0x986c('0x2e'),_0x2bc1e9),'order_by':'','offset':'0','select_fields':['id',_0x986c('0x10'),_0x986c('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x986c('0x30')](function(_0x1736bc){if(_0x1736bc[_0x986c('0x31')][_0x986c('0x1e')]){var _0x1bed7b=_['find'](_0x1736bc[_0x986c('0x31')],function(_0x4e0944){return _0x4e0944[_0x986c('0x32')][_0x986c('0x2f')][_0x986c('0x33')]===_0x2bc1e9;});if(_0x1bed7b){logger['info'](_0x986c('0x34'));return BPromise[_0x986c('0x35')]({'id':_0x1bed7b[_0x986c('0x32')]['id'][_0x986c('0x33')],'name':_0x1bed7b[_0x986c('0x32')]['name'][_0x986c('0x33')]});}}logger['info'](_0x986c('0x36'));return BPromise['resolve']({'id':_0x56327d[_0x986c('0x32')]['user_id'][_0x986c('0x33')],'name':_0x56327d[_0x986c('0x32')][_0x986c('0x2f')][_0x986c('0x33')]});});}else{logger[_0x986c('0xe')](_0x986c('0x37'));return BPromise[_0x986c('0x35')]({'id':_0x56327d[_0x986c('0x32')][_0x986c('0x38')][_0x986c('0x33')],'name':_0x56327d[_0x986c('0x32')][_0x986c('0x2f')][_0x986c('0x33')]});}}function getEndUser(_0x379a72,_0x55eaf8,_0x5b1b8f,_0x3c0855){logger[_0x986c('0xe')]('Searching\x20enduser\x20with\x20phone',_0x5b1b8f);return request({'form':{'method':'get_entry_list','input_type':_0x986c('0x24'),'response_type':_0x986c('0x24'),'rest_data':JSON[_0x986c('0x2b')]({'session':_0x3c0855['id'],'module_name':'Contacts','query':util['format'](_0x986c('0x39'),_0x5b1b8f),'order_by':'','offset':'0','select_fields':['id','name',_0x986c('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x986c('0x30')](function(_0x168c95){if(_0x168c95[_0x986c('0x31')][_0x986c('0x1e')]){var _0x40d610=_[_0x986c('0x3b')](_0x168c95[_0x986c('0x31')],function(_0x3bb517){return _0x3bb517[_0x986c('0x32')]['phone_home'][_0x986c('0x33')]===_0x5b1b8f;});if(_0x40d610){logger[_0x986c('0xe')]('Enduser\x20found!');return BPromise[_0x986c('0x35')]({'id':_0x40d610[_0x986c('0x32')]['id'][_0x986c('0x33')],'name':_0x40d610[_0x986c('0x32')]['name'][_0x986c('0x33')],'phone':_0x40d610[_0x986c('0x32')]['phone_home'][_0x986c('0x33')]});}}else{logger[_0x986c('0xe')](_0x986c('0x3c'));return request({'form':{'method':_0x986c('0x23'),'input_type':_0x986c('0x24'),'response_type':_0x986c('0x24'),'rest_data':JSON[_0x986c('0x2b')]({'session':_0x3c0855['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x55eaf8!==_0x986c('0x3d')?_0x55eaf8:util[_0x986c('0x2d')](_0x986c('0x3e'),_0x5b1b8f)},{'name':_0x986c('0x3a'),'value':_0x5b1b8f}]})}})[_0x986c('0x30')](function(_0x21647f){logger['info'](_0x986c('0x3f'));return BPromise[_0x986c('0x35')]({'id':_0x21647f['id'],'name':_0x21647f[_0x986c('0x31')][_0x986c('0x40')][_0x986c('0x33')],'phone':_0x21647f[_0x986c('0x31')]['phone_home'][_0x986c('0x33')]});});}});}function request(_0x7e0601){logger[_0x986c('0x41')](_0x986c('0x42'),JSON['stringify'](_0x7e0601));return rp(_[_0x986c('0x43')](def,_0x7e0601));}function getTags(_0x20113f,_0x2e3652){var _0x263f7d=[];if(_0x20113f&&_0x20113f[_0x986c('0x1e')]>0x0){_0x263f7d=_['map'](_0x20113f,_0x2e3652);}return _0x263f7d;}function getCustomFields(_0x145dc2,_0x21db9e){var _0x293d57=[];var _0x3f66ea={'custom_fields':[]};if(_0x145dc2[_0x986c('0x1e')]>0x0){_[_0x986c('0x1f')](_0x145dc2,function(_0x3a6d5f){if(_0x3a6d5f[_0x986c('0x44')]===_0x986c('0x45')&&_0x3a6d5f[_0x986c('0x46')]&&!_0x3a6d5f[_0x986c('0x47')]){_0x3f66ea[_0x3a6d5f['nameField'][_0x986c('0x48')]()]=_0x3a6d5f['content'][_0x986c('0x49')]();}else if(_0x3a6d5f['type']===_0x986c('0x45')&&_0x3a6d5f['idField']&&_0x3a6d5f[_0x986c('0x47')]){_0x3f66ea[_0x986c('0x4a')][_0x986c('0x20')]({'id':_0x3a6d5f[_0x986c('0x21')],'value':_0x3a6d5f[_0x986c('0x4b')]['toString']()});}else if(_0x3a6d5f[_0x986c('0x44')]===_0x986c('0x4c')&&_0x3a6d5f[_0x986c('0x22')]&&_0x3a6d5f['idField']&&_0x3a6d5f[_0x986c('0x47')]){_0x21db9e[_0x3a6d5f[_0x986c('0x22')]]&&_0x3f66ea[_0x986c('0x4a')][_0x986c('0x20')]({'id':_0x3a6d5f[_0x986c('0x21')],'value':_0x21db9e[_0x3a6d5f[_0x986c('0x22')]][_0x986c('0x49')]()});}else if(_0x3a6d5f[_0x986c('0x44')]===_0x986c('0x4d')&&_0x3a6d5f[_0x986c('0x4e')]&&_0x3a6d5f[_0x986c('0x4e')][_0x986c('0x10')]&&_0x3a6d5f[_0x986c('0x21')]&&_0x3a6d5f[_0x986c('0x47')]){_0x21db9e[_0x3a6d5f[_0x986c('0x4e')][_0x986c('0x10')][_0x986c('0x48')]()]&&_0x3f66ea['custom_fields'][_0x986c('0x20')]({'id':_0x3a6d5f['idField'],'value':_0x21db9e[_0x3a6d5f[_0x986c('0x4e')][_0x986c('0x10')][_0x986c('0x48')]()][_0x986c('0x49')]()});}});}return _0x3f66ea;}function getConnection(_0x3784fb){return request({'method':'POST','form':{'method':_0x986c('0x4f'),'input_type':_0x986c('0x24'),'response_type':_0x986c('0x24'),'rest_data':JSON[_0x986c('0x2b')]({'user_auth':{'user_name':_0x3784fb[_0x986c('0x50')],'password':_0x3784fb[_0x986c('0x51')],'encryption':_0x986c('0x52')},'application':_0x986c('0x53')})}})[_0x986c('0x30')](function(_0x11166e){var _0x188e7d=_0x11166e;if(_0x188e7d['id']){def['sessionID']=_0x188e7d['id'];return BPromise[_0x986c('0x35')](_0x188e7d);}else{throw new Error(util[_0x986c('0x2d')]('Account\x20%d\x20is\x20not\x20valid',_0x3784fb['id']));}});}function setRelationship(_0x88070d,_0x42d20d,_0x2d7da0,_0x48328f){return request({'form':{'method':'set_relationship','input_type':_0x986c('0x24'),'response_type':_0x986c('0x24'),'rest_data':JSON[_0x986c('0x2b')]({'session':_0x88070d['id'],'module_name':_0x986c('0x25'),'module_id':_0x2d7da0['id'],'link_field_name':_0x48328f,'related_ids':[_0x42d20d['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x986c('0x54')]=function(_0x72800b,_0x537072,_0x3bbbd9,_0x521b76,_0x4a073b,_0x4555ee){var _0x3abfa7,_0x1082ca,_0x3d7096,_0x301b20;_0x4555ee[_0x986c('0x55')]=intUtil[_0x986c('0x56')](_0x4555ee[_0x986c('0x55')]);_0x4555ee[_0x986c('0x57')]=intUtil['stripTrailingSlash'](_0x4555ee[_0x986c('0x57')]);def[_0x986c('0x58')]=util[_0x986c('0x2d')]('%s/service/v4_1/rest.php',_0x4555ee[_0x986c('0x55')]);if(_0x4a073b&&_0x4a073b['monitor_format']){logger[_0x986c('0xe')](_0x986c('0x59'),'Recording\x20is\x20enabled!');_0x537072['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4555ee['serverUrl'],_0x537072[_0x986c('0x5a')],md5(_0x537072['uniqueid']));}else{_0x537072['recordingURL']='';}return getConnection(_0x4555ee)[_0x986c('0x30')](function(_0x254462){_0x301b20=_0x254462;return getUser(_0x4555ee,_0x521b76[_0x986c('0x10')],_0x301b20);})[_0x986c('0x30')](function(_0x595eac){_0x3abfa7=_0x595eac;logger[_0x986c('0xe')](_0x986c('0x5b'),_0x3abfa7['id']);return getEndUser(_0x4555ee,_0x537072[_0x986c('0x5c')],_0x537072[_0x986c('0x5d')],_0x301b20);})[_0x986c('0x30')](function(_0x57fdad){_0x1082ca=_0x57fdad;logger[_0x986c('0xe')](_0x986c('0x5e'),_0x1082ca['id']);return getTicket(_0x4555ee,_0x3abfa7,_0x1082ca,_0x3bbbd9,_0x537072,_0x3bbbd9['Fields'],_0x301b20,_0x986c('0x5f'));})[_0x986c('0x30')](function(_0x90cd6c){_0x3d7096=_0x90cd6c;logger[_0x986c('0xe')]('Ticket\x20created!');logger[_0x986c('0xe')](_0x986c('0x60'),_0x3d7096['id']);return setRelationship(_0x301b20,_0x3abfa7,_0x3d7096,'users');})[_0x986c('0x30')](function(){return setRelationship(_0x301b20,_0x1082ca,_0x3d7096,_0x986c('0x61'));})[_0x986c('0x30')](function(){return getServerInfo(_0x301b20);})[_0x986c('0x30')](function(_0x32a2a1){var _0x1c9f41=parseInt(_0x32a2a1['version'][_0x986c('0x62')](0x0));var _0x233b1f=util[_0x986c('0x2d')](_0x986c('0x63'),_0x4555ee[_0x986c('0x55')],_0x3d7096['id']);if(_0x1c9f41>0x6){_0x233b1f=util[_0x986c('0x2d')](_0x986c('0x64'),_0x4555ee[_0x986c('0x55')],_0x3d7096['id']);}logger[_0x986c('0xe')](_0x986c('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x986c('0x65'),_0x521b76[_0x986c('0x10')]),_0x986c('0x66'),{'uri':_0x233b1f});})[_0x986c('0x67')](function(_0x1d1af2){logger[_0x986c('0x68')](_0x986c('0x59'),JSON[_0x986c('0x2b')](_0x1d1af2));});};exports['outbound']=function(_0x488eac,_0x258637,_0x17b93b,_0x77c031,_0x462a4d,_0x276939,_0x5a47a3){var _0x15c82c,_0x50dced,_0x3cd14a,_0x568621;_0x276939[_0x986c('0x55')]=intUtil[_0x986c('0x56')](_0x276939[_0x986c('0x55')]);_0x276939[_0x986c('0x57')]=intUtil[_0x986c('0x56')](_0x276939[_0x986c('0x57')]);def[_0x986c('0x58')]=util['format']('%s/service/v4_1/rest.php',_0x276939[_0x986c('0x55')]);if(_0x5a47a3&&_0x5a47a3[_0x986c('0x69')]&&_0x5a47a3[_0x986c('0x69')]!=='none'){logger[_0x986c('0xe')](_0x986c('0x6a'),_0x986c('0x6b'));_0x258637[_0x986c('0x6c')]=util['format'](_0x986c('0x6d'),_0x276939[_0x986c('0x57')],_0x258637[_0x986c('0x5a')],md5(_0x258637['uniqueid']));}return getConnection(_0x276939)[_0x986c('0x30')](function(_0x4d0d45){_0x568621=_0x4d0d45;return getUser(_0x276939,_0x77c031[_0x986c('0x10')],_0x568621);})[_0x986c('0x30')](function(_0x2a78b4){_0x15c82c=_0x2a78b4;logger[_0x986c('0xe')](_0x986c('0x5b'),_0x15c82c['id']);return getEndUser(_0x276939,_0x258637['destcalleridname'],_0x258637[_0x986c('0x6e')],_0x568621);})[_0x986c('0x30')](function(_0x232936){_0x50dced=_0x232936;logger[_0x986c('0xe')](_0x986c('0x5e'),_0x50dced['id']);return getTicket(_0x276939,_0x15c82c,_0x50dced,_0x17b93b,_0x258637,_0x17b93b[_0x986c('0x6f')],_0x568621,_0x986c('0x70'));})[_0x986c('0x30')](function(_0x134340){_0x3cd14a=_0x134340;logger[_0x986c('0xe')](_0x986c('0x71'));logger[_0x986c('0xe')](_0x986c('0x60'),_0x3cd14a['id']);return setRelationship(_0x568621,_0x15c82c,_0x3cd14a,'users');})[_0x986c('0x30')](function(){return setRelationship(_0x568621,_0x50dced,_0x3cd14a,_0x986c('0x61'));})[_0x986c('0x30')](function(){return getServerInfo(_0x568621);})[_0x986c('0x30')](function(_0x591756){var _0xa07f60=parseInt(_0x591756[_0x986c('0x72')]['charAt'](0x0));var _0x24a624=util[_0x986c('0x2d')](_0x986c('0x63'),_0x276939['remoteUri'],_0x3cd14a['id']);if(_0xa07f60>0x6){_0x24a624=util[_0x986c('0x2d')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x276939[_0x986c('0x55')],_0x3cd14a['id']);}logger[_0x986c('0xe')](_0x986c('0x6a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x986c('0x2d')](_0x986c('0x65'),_0x77c031[_0x986c('0x10')]),'trigger:browser:url',{'uri':_0x24a624});})[_0x986c('0x67')](function(_0x16a5ce){logger[_0x986c('0x68')](_0x986c('0x6a'),JSON[_0x986c('0x2b')](_0x16a5ce));});};exports['unmanaged']=function(_0x43ac59,_0x709c1,_0x437947,_0x49649e,_0x4d74db,_0x5f1d85){var _0xd961b8,_0x1f053e,_0x5e8ee5,_0x40dbcf;_0x5f1d85[_0x986c('0x55')]=intUtil['stripTrailingSlash'](_0x5f1d85[_0x986c('0x55')]);_0x5f1d85[_0x986c('0x57')]=intUtil[_0x986c('0x56')](_0x5f1d85['serverUrl']);def[_0x986c('0x58')]=util[_0x986c('0x2d')](_0x986c('0x73'),_0x5f1d85[_0x986c('0x55')]);if(_0x4d74db&&_0x4d74db[_0x986c('0x74')]){logger[_0x986c('0xe')]('['+_0x709c1[_0x986c('0x75')][_0x986c('0x76')]()+']','Recording\x20is\x20enabled!');_0x709c1[_0x986c('0x6c')]=util['format'](_0x986c('0x6d'),_0x5f1d85[_0x986c('0x57')],_0x709c1[_0x986c('0x5a')],md5(_0x709c1[_0x986c('0x5a')]));}else{_0x709c1[_0x986c('0x6c')]='';}return getConnection(_0x5f1d85)[_0x986c('0x30')](function(_0x45e29f){_0x40dbcf=_0x45e29f;if(!_['isNil'](_0x49649e)){return getUser(_0x5f1d85,_0x49649e['name'],_0x40dbcf);}else{return getUser(_0x5f1d85,null,_0x40dbcf);}})['then'](function(_0x3db09b){_0xd961b8=_0x3db09b;logger['info']('The\x20User\x20ID\x20is:',_0xd961b8['id']);return getEndUser(_0x5f1d85,_0x709c1['calleridname'],_0x709c1[_0x986c('0x5d')],_0x40dbcf);})['then'](function(_0x5e6699){_0x1f053e=_0x5e6699;logger[_0x986c('0xe')]('The\x20Enduser\x20ID\x20is:',_0x1f053e['id']);return getTicket(_0x5f1d85,_0xd961b8,_0x1f053e,_0x437947,_0x709c1,_0x437947['Fields'],_0x40dbcf,_0x986c('0x5f'));})[_0x986c('0x30')](function(_0x5a6ada){_0x5e8ee5=_0x5a6ada;logger[_0x986c('0xe')](_0x986c('0x71'));logger[_0x986c('0xe')]('The\x20Ticket\x20ID\x20is:',_0x5e8ee5['id']);return setRelationship(_0x40dbcf,_0xd961b8,_0x5e8ee5,_0x986c('0x77'));})[_0x986c('0x30')](function(){return setRelationship(_0x40dbcf,_0x1f053e,_0x5e8ee5,'contacts');})[_0x986c('0x30')](function(){return getServerInfo(_0x40dbcf);})['catch'](function(_0x404ed6){logger[_0x986c('0x68')]('['+_0x709c1[_0x986c('0x75')][_0x986c('0x76')]()+']',JSON['stringify'](_0x404ed6));});}; \ No newline at end of file +var _0x2b04=['../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','created_by','description','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','format','Basic\x20%s','apiKey','toString','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','resolve','value','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\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','first_name','merge','map','type','string','customField','nameField','content','custom_fields','variable','customVariable','Variable','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','Outbound','charAt','user:%s','unmanaged','lastevent','toUpperCase','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment'];(function(_0x3d5df9,_0x5b3623){var _0x50ba39=function(_0x3c0de0){while(--_0x3c0de0){_0x3d5df9['push'](_0x3d5df9['shift']());}};_0x50ba39(++_0x5b3623);}(_0x2b04,0x170));var _0x42b0=function(_0x25899d,_0x47b723){_0x25899d=_0x25899d-0x0;var _0x2dcd2f=_0x2b04[_0x25899d];return _0x2dcd2f;};'use strict';var _=require('lodash');var rp=require(_0x42b0('0x0'));var BPromise=require(_0x42b0('0x1'));var md5=require(_0x42b0('0x2'));var util=require(_0x42b0('0x3'));var Redis=require(_0x42b0('0x4'));var intUtil=require(_0x42b0('0x5'));var config=require(_0x42b0('0x6'));var logger=require(_0x42b0('0x7'))(_0x42b0('0x8'));config[_0x42b0('0x9')]=_[_0x42b0('0xa')](config[_0x42b0('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x42b0('0xb'))(new Redis(config[_0x42b0('0x9')]));var def={'method':_0x42b0('0xc'),'json':!![]};function emit(_0x5cc61c,_0x489aa6,_0xf97afa){io['to'](_0x5cc61c)[_0x42b0('0xd')](_0x489aa6,_0xf97afa);}function getTicket(_0x5250e2,_0x100d11,_0x57857e,_0xfaf756,_0x3c9380,_0x25eb45,_0xab8b39,_0x246e35){logger[_0x42b0('0xe')](_0x42b0('0xf'));var _0x3fc7aa=new Date();var _0x45f915=[{'name':_0x42b0('0x10'),'value':intUtil['getString'](_0xfaf756[_0x42b0('0x11')],_0x3c9380,'\x20')},{'name':_0x42b0('0x12'),'value':_0x100d11['id']},{'name':_0x42b0('0x13'),'value':_0x100d11['id']},{'name':_0x42b0('0x14'),'value':intUtil['getString'](_0xfaf756['Descriptions'],_0x3c9380,'\x0a')},{'name':_0x42b0('0x15'),'value':_0x3fc7aa[_0x42b0('0x16')]()[_0x42b0('0x17')](0x0,0x13)[_0x42b0('0x18')]('T','\x20')},{'name':_0x42b0('0x19'),'value':'0'},{'name':_0x42b0('0x1a'),'value':'15'},{'name':'parent_id','value':_0x57857e['id']},{'name':_0x42b0('0x1b'),'value':_0x42b0('0x1c')},{'name':_0x42b0('0x1d'),'value':_0x57857e['name']},{'name':_0x42b0('0x1e'),'value':_0x246e35}];if(_0x25eb45[_0x42b0('0x1f')]){_[_0x42b0('0x20')](_0x25eb45,function(_0x103b0a){if(_0x3c9380[_0x103b0a[_0x42b0('0x21')]]){_0x45f915[_0x42b0('0x22')]({'name':_0x103b0a[_0x42b0('0x23')],'value':_0x3c9380[_0x103b0a[_0x42b0('0x21')]]});}});}return request({'form':{'method':_0x42b0('0x24'),'input_type':_0x42b0('0x25'),'response_type':'JSON','rest_data':JSON[_0x42b0('0x26')]({'session':_0xab8b39['id'],'module_name':'Calls','name_value_list':_0x45f915})}});}function getAuth(_0x467d7a){return util[_0x42b0('0x27')](_0x42b0('0x28'),new Buffer(_0x467d7a[_0x42b0('0x29')]+':X')[_0x42b0('0x2a')]('base64'));}function getServerInfo(_0x50b31e){return request({'form':{'method':_0x42b0('0x2b'),'input_type':'JSON','response_type':_0x42b0('0x25'),'rest_data':JSON['stringify']({'session':_0x50b31e['id']})}});}function getUser(_0x312cfb,_0x1e5c71,_0x3a4d31){if(!_[_0x42b0('0x2c')](_0x1e5c71)){logger['info'](_0x42b0('0x2d'),_0x1e5c71);return request({'form':{'method':_0x42b0('0x2e'),'input_type':_0x42b0('0x25'),'response_type':_0x42b0('0x25'),'rest_data':JSON[_0x42b0('0x26')]({'session':_0x3a4d31['id'],'module_name':'Employees','query':util[_0x42b0('0x27')](_0x42b0('0x2f'),_0x1e5c71),'order_by':'','offset':'0','select_fields':['id',_0x42b0('0x10'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x42b0('0x30')](function(_0x223c89){if(_0x223c89[_0x42b0('0x31')]['length']){var _0x11596a=_[_0x42b0('0x32')](_0x223c89['entry_list'],function(_0x31757c){return _0x31757c[_0x42b0('0x33')][_0x42b0('0x34')]['value']===_0x1e5c71;});if(_0x11596a){logger['info']('Agent\x20found!');return BPromise[_0x42b0('0x35')]({'id':_0x11596a[_0x42b0('0x33')]['id'][_0x42b0('0x36')],'name':_0x11596a[_0x42b0('0x33')][_0x42b0('0x10')][_0x42b0('0x36')]});}}logger[_0x42b0('0xe')](_0x42b0('0x37'));return BPromise[_0x42b0('0x35')]({'id':_0x3a4d31[_0x42b0('0x33')]['user_id'][_0x42b0('0x36')],'name':_0x3a4d31[_0x42b0('0x33')]['user_name'][_0x42b0('0x36')]});});}else{logger['info'](_0x42b0('0x38'));return BPromise[_0x42b0('0x35')]({'id':_0x3a4d31['name_value_list'][_0x42b0('0x39')][_0x42b0('0x36')],'name':_0x3a4d31[_0x42b0('0x33')]['user_name']['value']});}}function getEndUser(_0x17e7af,_0x337d8b,_0x1fbdff,_0x27ec16){logger[_0x42b0('0xe')](_0x42b0('0x3a'),_0x1fbdff);return request({'form':{'method':_0x42b0('0x2e'),'input_type':_0x42b0('0x25'),'response_type':_0x42b0('0x25'),'rest_data':JSON['stringify']({'session':_0x27ec16['id'],'module_name':_0x42b0('0x1c'),'query':util[_0x42b0('0x27')](_0x42b0('0x3b'),_0x1fbdff),'order_by':'','offset':'0','select_fields':['id',_0x42b0('0x10'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x42b0('0x30')](function(_0x5d39be){if(_0x5d39be[_0x42b0('0x31')][_0x42b0('0x1f')]){var _0x199f82=_['find'](_0x5d39be[_0x42b0('0x31')],function(_0x1b508a){return _0x1b508a[_0x42b0('0x33')][_0x42b0('0x3c')][_0x42b0('0x36')]===_0x1fbdff;});if(_0x199f82){logger[_0x42b0('0xe')]('Enduser\x20found!');return BPromise[_0x42b0('0x35')]({'id':_0x199f82['name_value_list']['id'][_0x42b0('0x36')],'name':_0x199f82[_0x42b0('0x33')][_0x42b0('0x10')][_0x42b0('0x36')],'phone':_0x199f82['name_value_list'][_0x42b0('0x3c')][_0x42b0('0x36')]});}}else{logger[_0x42b0('0xe')](_0x42b0('0x3d'));return request({'form':{'method':_0x42b0('0x24'),'input_type':_0x42b0('0x25'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x27ec16['id'],'module_name':_0x42b0('0x1c'),'name_value_list':[{'name':'first_name','value':_0x337d8b!==''?_0x337d8b:util[_0x42b0('0x27')](_0x42b0('0x3e'),_0x1fbdff)},{'name':_0x42b0('0x3c'),'value':_0x1fbdff}]})}})['then'](function(_0x20a5b5){logger[_0x42b0('0xe')](_0x42b0('0x3f'));return BPromise[_0x42b0('0x35')]({'id':_0x20a5b5['id'],'name':_0x20a5b5[_0x42b0('0x31')][_0x42b0('0x40')][_0x42b0('0x36')],'phone':_0x20a5b5['entry_list']['phone_home']['value']});});}});}function request(_0x4db144){logger['debug']('[HTTP]',JSON[_0x42b0('0x26')](_0x4db144));return rp(_[_0x42b0('0x41')](def,_0x4db144));}function getTags(_0x1bec38,_0x14c948){var _0x166b3e=[];if(_0x1bec38&&_0x1bec38[_0x42b0('0x1f')]>0x0){_0x166b3e=_[_0x42b0('0x42')](_0x1bec38,_0x14c948);}return _0x166b3e;}function getCustomFields(_0x138ce2,_0x4c15a5){var _0x12447d=[];var _0x4c5933={'custom_fields':[]};if(_0x138ce2[_0x42b0('0x1f')]>0x0){_[_0x42b0('0x20')](_0x138ce2,function(_0x137e50){if(_0x137e50[_0x42b0('0x43')]===_0x42b0('0x44')&&_0x137e50['nameField']&&!_0x137e50[_0x42b0('0x45')]){_0x4c5933[_0x137e50[_0x42b0('0x46')]['toLowerCase']()]=_0x137e50[_0x42b0('0x47')]['toString']();}else if(_0x137e50[_0x42b0('0x43')]===_0x42b0('0x44')&&_0x137e50[_0x42b0('0x23')]&&_0x137e50[_0x42b0('0x45')]){_0x4c5933[_0x42b0('0x48')][_0x42b0('0x22')]({'id':_0x137e50[_0x42b0('0x23')],'value':_0x137e50[_0x42b0('0x47')][_0x42b0('0x2a')]()});}else if(_0x137e50['type']===_0x42b0('0x49')&&_0x137e50[_0x42b0('0x21')]&&_0x137e50[_0x42b0('0x23')]&&_0x137e50['customField']){_0x4c15a5[_0x137e50[_0x42b0('0x21')]]&&_0x4c5933[_0x42b0('0x48')][_0x42b0('0x22')]({'id':_0x137e50['idField'],'value':_0x4c15a5[_0x137e50['variableName']][_0x42b0('0x2a')]()});}else if(_0x137e50['type']===_0x42b0('0x4a')&&_0x137e50['Variable']&&_0x137e50[_0x42b0('0x4b')]['name']&&_0x137e50[_0x42b0('0x23')]&&_0x137e50[_0x42b0('0x45')]){_0x4c15a5[_0x137e50[_0x42b0('0x4b')][_0x42b0('0x10')][_0x42b0('0x4c')]()]&&_0x4c5933['custom_fields'][_0x42b0('0x22')]({'id':_0x137e50[_0x42b0('0x23')],'value':_0x4c15a5[_0x137e50[_0x42b0('0x4b')]['name']['toLowerCase']()][_0x42b0('0x2a')]()});}});}return _0x4c5933;}function getConnection(_0x380777){return request({'method':_0x42b0('0xc'),'form':{'method':_0x42b0('0x4d'),'input_type':_0x42b0('0x25'),'response_type':'JSON','rest_data':JSON[_0x42b0('0x26')]({'user_auth':{'user_name':_0x380777[_0x42b0('0x4e')],'password':_0x380777[_0x42b0('0x4f')],'encryption':_0x42b0('0x50')},'application':_0x42b0('0x51')})}})[_0x42b0('0x30')](function(_0xb4417c){var _0x3509c8=_0xb4417c;if(_0x3509c8['id']){def[_0x42b0('0x52')]=_0x3509c8['id'];return BPromise['resolve'](_0x3509c8);}else{throw new Error(util[_0x42b0('0x27')](_0x42b0('0x53'),_0x380777['id']));}});}function setRelationship(_0x26fa13,_0x28df06,_0x22aff8,_0x46101a){return request({'form':{'method':_0x42b0('0x54'),'input_type':_0x42b0('0x25'),'response_type':_0x42b0('0x25'),'rest_data':JSON['stringify']({'session':_0x26fa13['id'],'module_name':_0x42b0('0x55'),'module_id':_0x22aff8['id'],'link_field_name':_0x46101a,'related_ids':[_0x28df06['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x42b0('0x56')]=function(_0x451f57,_0x4a7091,_0x25ce53,_0x461c9c,_0x5d148f,_0x30a9d7){var _0x390f1b,_0x171fa3,_0x4a091c,_0x21da95;_0x30a9d7[_0x42b0('0x57')]=intUtil['stripTrailingSlash'](_0x30a9d7[_0x42b0('0x57')]);_0x30a9d7[_0x42b0('0x58')]=intUtil[_0x42b0('0x59')](_0x30a9d7[_0x42b0('0x58')]);def[_0x42b0('0x5a')]=util['format'](_0x42b0('0x5b'),_0x30a9d7[_0x42b0('0x57')]);if(_0x5d148f&&_0x5d148f[_0x42b0('0x5c')]){logger[_0x42b0('0xe')](_0x42b0('0x5d'),_0x42b0('0x5e'));_0x4a7091[_0x42b0('0x5f')]=util[_0x42b0('0x27')](_0x42b0('0x60'),_0x30a9d7[_0x42b0('0x58')],_0x4a7091[_0x42b0('0x61')],md5(_0x4a7091[_0x42b0('0x61')]));}else{_0x4a7091[_0x42b0('0x5f')]='';}return getConnection(_0x30a9d7)['then'](function(_0x470170){_0x21da95=_0x470170;return getUser(_0x30a9d7,_0x461c9c[_0x42b0('0x10')],_0x21da95);})['then'](function(_0x259c45){_0x390f1b=_0x259c45;logger['info'](_0x42b0('0x62'),_0x390f1b['id']);return getEndUser(_0x30a9d7,_0x4a7091[_0x42b0('0x63')],_0x4a7091[_0x42b0('0x64')],_0x21da95);})[_0x42b0('0x30')](function(_0xb4321d){_0x171fa3=_0xb4321d;logger['info'](_0x42b0('0x65'),_0x171fa3['id']);return getTicket(_0x30a9d7,_0x390f1b,_0x171fa3,_0x25ce53,_0x4a7091,_0x25ce53[_0x42b0('0x66')],_0x21da95,_0x42b0('0x67'));})[_0x42b0('0x30')](function(_0x212321){_0x4a091c=_0x212321;logger[_0x42b0('0xe')](_0x42b0('0x68'));logger[_0x42b0('0xe')](_0x42b0('0x69'),_0x4a091c['id']);return setRelationship(_0x21da95,_0x390f1b,_0x4a091c,_0x42b0('0x6a'));})[_0x42b0('0x30')](function(){return setRelationship(_0x21da95,_0x171fa3,_0x4a091c,_0x42b0('0x6b'));})[_0x42b0('0x30')](function(){return getServerInfo(_0x21da95);})[_0x42b0('0x30')](function(_0x1397ca){var _0x1bf71d=parseInt(_0x1397ca[_0x42b0('0x6c')]['charAt'](0x0));var _0xaf6c04=util[_0x42b0('0x27')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x30a9d7[_0x42b0('0x57')],_0x4a091c['id']);if(_0x1bf71d>0x6){_0xaf6c04=util[_0x42b0('0x27')](_0x42b0('0x6d'),_0x30a9d7[_0x42b0('0x57')],_0x4a091c['id']);}logger[_0x42b0('0xe')](_0x42b0('0x5d'),_0x42b0('0x6e'));emit(util[_0x42b0('0x27')]('user:%s',_0x461c9c[_0x42b0('0x10')]),_0x42b0('0x6f'),{'uri':_0xaf6c04});})[_0x42b0('0x70')](function(_0x47e621){logger[_0x42b0('0x71')]('[QUEUE]',JSON[_0x42b0('0x26')](_0x47e621));});};exports[_0x42b0('0x72')]=function(_0xe07e07,_0x760357,_0x230474,_0x5ef4df,_0x4bda53,_0x4f3eb4,_0x3ced59){var _0x40a0eb,_0x565e5c,_0x13ff6b,_0xd91e92;_0x4f3eb4[_0x42b0('0x57')]=intUtil[_0x42b0('0x59')](_0x4f3eb4[_0x42b0('0x57')]);_0x4f3eb4['serverUrl']=intUtil[_0x42b0('0x59')](_0x4f3eb4['serverUrl']);def[_0x42b0('0x5a')]=util['format'](_0x42b0('0x5b'),_0x4f3eb4['remoteUri']);if(_0x3ced59&&_0x3ced59[_0x42b0('0x73')]&&_0x3ced59[_0x42b0('0x73')]!==_0x42b0('0x74')){logger['info'](_0x42b0('0x75'),_0x42b0('0x5e'));_0x760357[_0x42b0('0x5f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4f3eb4[_0x42b0('0x58')],_0x760357[_0x42b0('0x61')],md5(_0x760357[_0x42b0('0x61')]));}return getConnection(_0x4f3eb4)[_0x42b0('0x30')](function(_0x4b62f9){_0xd91e92=_0x4b62f9;return getUser(_0x4f3eb4,_0x5ef4df['name'],_0xd91e92);})[_0x42b0('0x30')](function(_0x1794da){_0x40a0eb=_0x1794da;logger[_0x42b0('0xe')](_0x42b0('0x62'),_0x40a0eb['id']);return getEndUser(_0x4f3eb4,_0x760357[_0x42b0('0x76')],_0x760357['destcalleridnum'],_0xd91e92);})['then'](function(_0xc1faa){_0x565e5c=_0xc1faa;logger[_0x42b0('0xe')](_0x42b0('0x65'),_0x565e5c['id']);return getTicket(_0x4f3eb4,_0x40a0eb,_0x565e5c,_0x230474,_0x760357,_0x230474[_0x42b0('0x66')],_0xd91e92,_0x42b0('0x77'));})['then'](function(_0x2b7695){_0x13ff6b=_0x2b7695;logger[_0x42b0('0xe')](_0x42b0('0x68'));logger[_0x42b0('0xe')](_0x42b0('0x69'),_0x13ff6b['id']);return setRelationship(_0xd91e92,_0x40a0eb,_0x13ff6b,_0x42b0('0x6a'));})['then'](function(){return setRelationship(_0xd91e92,_0x565e5c,_0x13ff6b,_0x42b0('0x6b'));})[_0x42b0('0x30')](function(){return getServerInfo(_0xd91e92);})[_0x42b0('0x30')](function(_0x10aea8){var _0x4b2c14=parseInt(_0x10aea8['version'][_0x42b0('0x78')](0x0));var _0x7ca705=util[_0x42b0('0x27')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4f3eb4['remoteUri'],_0x13ff6b['id']);if(_0x4b2c14>0x6){_0x7ca705=util['format'](_0x42b0('0x6d'),_0x4f3eb4[_0x42b0('0x57')],_0x13ff6b['id']);}logger[_0x42b0('0xe')]('[OUTBOUND]',_0x42b0('0x6e'));emit(util[_0x42b0('0x27')](_0x42b0('0x79'),_0x5ef4df[_0x42b0('0x10')]),'trigger:browser:url',{'uri':_0x7ca705});})[_0x42b0('0x70')](function(_0x4a7e12){logger[_0x42b0('0x71')](_0x42b0('0x75'),JSON['stringify'](_0x4a7e12));});};exports[_0x42b0('0x7a')]=function(_0xe4e119,_0x403646,_0x5b4a6,_0x33cbfc,_0x5cd77d,_0x37770b){var _0x13db23,_0x127726,_0x2d2c2c,_0xc59e42;_0x37770b[_0x42b0('0x57')]=intUtil['stripTrailingSlash'](_0x37770b[_0x42b0('0x57')]);_0x37770b['serverUrl']=intUtil[_0x42b0('0x59')](_0x37770b[_0x42b0('0x58')]);def[_0x42b0('0x5a')]=util[_0x42b0('0x27')](_0x42b0('0x5b'),_0x37770b['remoteUri']);if(_0x5cd77d&&_0x5cd77d['monitor_format']){logger[_0x42b0('0xe')]('['+_0x403646[_0x42b0('0x7b')][_0x42b0('0x7c')]()+']',_0x42b0('0x5e'));_0x403646[_0x42b0('0x5f')]=util[_0x42b0('0x27')](_0x42b0('0x60'),_0x37770b['serverUrl'],_0x403646['uniqueid'],md5(_0x403646['uniqueid']));}else{_0x403646[_0x42b0('0x5f')]='';}return getConnection(_0x37770b)[_0x42b0('0x30')](function(_0x53dbb9){_0xc59e42=_0x53dbb9;if(!_[_0x42b0('0x2c')](_0x33cbfc)){return getUser(_0x37770b,_0x33cbfc['name'],_0xc59e42);}else{return getUser(_0x37770b,null,_0xc59e42);}})[_0x42b0('0x30')](function(_0x3d8a3e){_0x13db23=_0x3d8a3e;logger[_0x42b0('0xe')](_0x42b0('0x62'),_0x13db23['id']);return getEndUser(_0x37770b,_0x403646[_0x42b0('0x63')],_0x403646[_0x42b0('0x64')],_0xc59e42);})[_0x42b0('0x30')](function(_0x220828){_0x127726=_0x220828;logger[_0x42b0('0xe')](_0x42b0('0x65'),_0x127726['id']);return getTicket(_0x37770b,_0x13db23,_0x127726,_0x5b4a6,_0x403646,_0x5b4a6[_0x42b0('0x66')],_0xc59e42,_0x42b0('0x67'));})[_0x42b0('0x30')](function(_0x369d67){_0x2d2c2c=_0x369d67;logger[_0x42b0('0xe')](_0x42b0('0x68'));logger[_0x42b0('0xe')](_0x42b0('0x69'),_0x2d2c2c['id']);return setRelationship(_0xc59e42,_0x13db23,_0x2d2c2c,_0x42b0('0x6a'));})['then'](function(){return setRelationship(_0xc59e42,_0x127726,_0x2d2c2c,'contacts');})[_0x42b0('0x30')](function(){return getServerInfo(_0xc59e42);})[_0x42b0('0x70')](function(_0x5a06ac){logger['error']('['+_0x403646[_0x42b0('0x7b')][_0x42b0('0x7c')]()+']',JSON[_0x42b0('0x26')](_0x5a06ac));});}; \ 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 ea55291..68e01bc 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 _0xe9eb=['variable','variableName','toString','Variable','name','toLowerCase','keyValue','string','key','format','%s:\x20%s','keyContent','keyType','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','length','sortBy','push','type'];(function(_0x3480f2,_0x4947fa){var _0x1e4899=function(_0x4a884f){while(--_0x4a884f){_0x3480f2['push'](_0x3480f2['shift']());}};_0x1e4899(++_0x4947fa);}(_0xe9eb,0x1bc));var _0xbe9e=function(_0x4fde63,_0x2bce00){_0x4fde63=_0x4fde63-0x0;var _0x240318=_0xe9eb[_0x4fde63];return _0x240318;};'use strict';var _=require(_0xbe9e('0x0'));var util=require(_0xbe9e('0x1'));exports['getString']=function(_0x132b21,_0x5dc2ac,_0x2cd7ce){var _0x4bc636=[];if(_0x132b21[_0xbe9e('0x2')]>0x0){var _0x15dd27=_[_0xbe9e('0x3')](_0x132b21,['id']);for(var _0x5e3014=0x0;_0x5e3014<_0x15dd27[_0xbe9e('0x2')];_0x5e3014++){var _0x45126e=_0x15dd27[_0x5e3014];if(_0x45126e['type']==='string'){_0x4bc636[_0xbe9e('0x4')](_0x45126e['content']);}else if(_0x45126e[_0xbe9e('0x5')]===_0xbe9e('0x6')&&_0x45126e[_0xbe9e('0x7')]){_0x5dc2ac[_0x45126e[_0xbe9e('0x7')]]&&_0x4bc636['push'](_0x5dc2ac[_0x45126e['variableName']][_0xbe9e('0x8')]());}else if(_0x45126e[_0xbe9e('0x5')]==='customVariable'&&_0x45126e[_0xbe9e('0x9')]&&_0x45126e[_0xbe9e('0x9')][_0xbe9e('0xa')]){_0x5dc2ac[_0x45126e[_0xbe9e('0x9')][_0xbe9e('0xa')][_0xbe9e('0xb')]()]&&_0x4bc636[_0xbe9e('0x4')](_0x5dc2ac[_0x45126e[_0xbe9e('0x9')][_0xbe9e('0xa')][_0xbe9e('0xb')]()][_0xbe9e('0x8')]());}else if(_0x45126e[_0xbe9e('0x5')]===_0xbe9e('0xc')){if(_0x45126e['keyType']===_0xbe9e('0xd')&&_0x45126e[_0xbe9e('0xe')]){_0x4bc636['push'](util[_0xbe9e('0xf')](_0xbe9e('0x10'),_0x45126e[_0xbe9e('0xe')],_0x45126e[_0xbe9e('0x11')]));}else if(_0x45126e[_0xbe9e('0x12')]===_0xbe9e('0x6')&&_0x45126e[_0xbe9e('0x7')]&&_0x45126e[_0xbe9e('0xe')]){_0x5dc2ac[_0x45126e[_0xbe9e('0x7')]]&&_0x4bc636[_0xbe9e('0x4')](util[_0xbe9e('0xf')](_0xbe9e('0x10'),_0x45126e['key'],_0x5dc2ac[_0x45126e[_0xbe9e('0x7')]]));}else if(_0x45126e[_0xbe9e('0x12')]==='customVariable'&&_0x45126e[_0xbe9e('0x9')]&&_0x45126e[_0xbe9e('0x9')][_0xbe9e('0xa')]&&_0x45126e[_0xbe9e('0xe')]){_0x5dc2ac[_0x45126e[_0xbe9e('0x9')][_0xbe9e('0xa')][_0xbe9e('0xb')]()]&&_0x4bc636[_0xbe9e('0x4')](util[_0xbe9e('0xf')](_0xbe9e('0x10'),_0x45126e[_0xbe9e('0xe')],_0x5dc2ac[_0x45126e[_0xbe9e('0x9')][_0xbe9e('0xa')]['toLowerCase']()]));}}}}return _0x4bc636['join'](_0x2cd7ce);};exports[_0xbe9e('0x13')]=function(_0x77e561){var _0x5cf801=_0x77e561['slice'](-0x1);if(_0x5cf801==='/'){_0x77e561=_0x77e561[_0xbe9e('0x14')](0x0,_0x77e561[_0xbe9e('0x15')](_0x5cf801));}return _0x77e561;};exports[_0xbe9e('0x16')]=function(_0x1f4fdc){if(!_[_0xbe9e('0x17')](_0x1f4fdc)&&_0x1f4fdc!==''){var _0x5142d6=/^(([^<>()\[\]\\.,;:\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 _0x5142d6[_0xbe9e('0x18')](String(_0x1f4fdc)[_0xbe9e('0xb')]());}else{return![];}}; \ No newline at end of file +var _0xb110=['customVariable','Variable','name','toLowerCase','keyType','key','format','%s:\x20%s','join','slice','substring','lastIndexOf','validateEmail','isNil','test','getString','sortBy','length','type','string','push','variable','variableName','toString'];(function(_0x4de06c,_0x152888){var _0x440f58=function(_0x2093e4){while(--_0x2093e4){_0x4de06c['push'](_0x4de06c['shift']());}};_0x440f58(++_0x152888);}(_0xb110,0x1a7));var _0x0b11=function(_0x2b97a8,_0x2a384d){_0x2b97a8=_0x2b97a8-0x0;var _0x2c8b76=_0xb110[_0x2b97a8];return _0x2c8b76;};'use strict';var _=require('lodash');var util=require('util');exports[_0x0b11('0x0')]=function(_0x6aa97e,_0x25fa25,_0x19ecd7){var _0x2716a6=[];if(_0x6aa97e['length']>0x0){var _0x539030=_[_0x0b11('0x1')](_0x6aa97e,['id']);for(var _0x11adb4=0x0;_0x11adb4<_0x539030[_0x0b11('0x2')];_0x11adb4++){var _0x28138e=_0x539030[_0x11adb4];if(_0x28138e[_0x0b11('0x3')]===_0x0b11('0x4')){_0x2716a6[_0x0b11('0x5')](_0x28138e['content']);}else if(_0x28138e[_0x0b11('0x3')]===_0x0b11('0x6')&&_0x28138e[_0x0b11('0x7')]){_0x25fa25[_0x28138e[_0x0b11('0x7')]]&&_0x2716a6[_0x0b11('0x5')](_0x25fa25[_0x28138e[_0x0b11('0x7')]][_0x0b11('0x8')]());}else if(_0x28138e[_0x0b11('0x3')]===_0x0b11('0x9')&&_0x28138e[_0x0b11('0xa')]&&_0x28138e[_0x0b11('0xa')][_0x0b11('0xb')]){_0x25fa25[_0x28138e['Variable'][_0x0b11('0xb')][_0x0b11('0xc')]()]&&_0x2716a6['push'](_0x25fa25[_0x28138e[_0x0b11('0xa')][_0x0b11('0xb')]['toLowerCase']()]['toString']());}else if(_0x28138e[_0x0b11('0x3')]==='keyValue'){if(_0x28138e[_0x0b11('0xd')]==='string'&&_0x28138e[_0x0b11('0xe')]){_0x2716a6[_0x0b11('0x5')](util[_0x0b11('0xf')](_0x0b11('0x10'),_0x28138e[_0x0b11('0xe')],_0x28138e['keyContent']));}else if(_0x28138e['keyType']===_0x0b11('0x6')&&_0x28138e[_0x0b11('0x7')]&&_0x28138e[_0x0b11('0xe')]){_0x25fa25[_0x28138e[_0x0b11('0x7')]]&&_0x2716a6[_0x0b11('0x5')](util[_0x0b11('0xf')]('%s:\x20%s',_0x28138e['key'],_0x25fa25[_0x28138e[_0x0b11('0x7')]]));}else if(_0x28138e[_0x0b11('0xd')]===_0x0b11('0x9')&&_0x28138e[_0x0b11('0xa')]&&_0x28138e['Variable'][_0x0b11('0xb')]&&_0x28138e['key']){_0x25fa25[_0x28138e[_0x0b11('0xa')][_0x0b11('0xb')][_0x0b11('0xc')]()]&&_0x2716a6[_0x0b11('0x5')](util['format'](_0x0b11('0x10'),_0x28138e[_0x0b11('0xe')],_0x25fa25[_0x28138e[_0x0b11('0xa')][_0x0b11('0xb')]['toLowerCase']()]));}}}}return _0x2716a6[_0x0b11('0x11')](_0x19ecd7);};exports['stripTrailingSlash']=function(_0x27b31d){var _0x3391b9=_0x27b31d[_0x0b11('0x12')](-0x1);if(_0x3391b9==='/'){_0x27b31d=_0x27b31d[_0x0b11('0x13')](0x0,_0x27b31d[_0x0b11('0x14')](_0x3391b9));}return _0x27b31d;};exports[_0x0b11('0x15')]=function(_0x31b35a){if(!_[_0x0b11('0x16')](_0x31b35a)&&_0x31b35a!==''){var _0x4d8f63=/^(([^<>()\[\]\\.,;:\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 _0x4d8f63[_0x0b11('0x17')](String(_0x31b35a)[_0x0b11('0xc')]());}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 c8ef25f..357ce09 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 _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','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!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x157bf3,_0x9ae112){var _0x552d07=function(_0x58fd1a){while(--_0x58fd1a){_0x157bf3['push'](_0x157bf3['shift']());}};_0x552d07(++_0x9ae112);}(_0x34e8,0x12c));var _0x834e=function(_0x430746,_0xaba622){_0x430746=_0x430746-0x0;var _0x515d9c=_0x34e8[_0x430746];return _0x515d9c;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','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!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x2a2dd3,_0x1ef449){var _0x3680fe=function(_0x245932){while(--_0x245932){_0x2a2dd3['push'](_0x2a2dd3['shift']());}};_0x3680fe(++_0x1ef449);}(_0x34e8,0x12c));var _0x834e=function(_0x243d45,_0x58ef17){_0x243d45=_0x243d45-0x0;var _0x5ebfb6=_0x34e8[_0x243d45];return _0x5ebfb6;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ 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 069bcbb..72ea44b 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 _0x7727=['%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','token','Basic\x20%s','toString','base64','debug','stringify','includes','string','picklist','type','nameField','customField','idField','push','content','variable','variableName','customVariable','Variable','custom_fields','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','lastevent','toUpperCase','request-promise','md5','util','ioredis','../../../../config/logger','zendesk','redis','localhost','application/json','info','Creating\x20new\x20ticket...','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','format','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!'];(function(_0x10345e,_0x4f4ff4){var _0x19e40a=function(_0x23b7b1){while(--_0x23b7b1){_0x10345e['push'](_0x10345e['shift']());}};_0x19e40a(++_0x4f4ff4);}(_0x7727,0xa8));var _0x7772=function(_0x3fe393,_0x234a3a){_0x3fe393=_0x3fe393-0x0;var _0x534d14=_0x7727[_0x3fe393];return _0x534d14;};'use strict';var _=require('lodash');var rp=require(_0x7772('0x0'));var md5=require(_0x7772('0x1'));var util=require(_0x7772('0x2'));var Redis=require(_0x7772('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x7772('0x4'))(_0x7772('0x5'));config[_0x7772('0x6')]=_['defaults'](config[_0x7772('0x6')],{'host':_0x7772('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x11be49,_0x1a8773,_0xaae4aa){io['to'](_0x11be49)['emit'](_0x1a8773,_0xaae4aa);}var headers={'Content-Type':_0x7772('0x8'),'Accept':_0x7772('0x8')};function getTicket(_0x25d51e,_0x150dc8,_0x1450a9,_0x2af163,_0x136fa3){logger[_0x7772('0x9')](_0x7772('0xa'));return request({'uri':util['format']('%s/tickets.json',_0x25d51e[_0x7772('0xb')]),'method':_0x7772('0xc'),'body':{'ticket':_['merge']({'requester_id':_0x1450a9['id'],'submitter_id':_0x150dc8?_0x150dc8['id']:undefined,'assignee_id':_0x150dc8?_0x150dc8['id']:undefined,'tags':getTags(_0x2af163[_0x7772('0xd')],_0x7772('0xe')),'subject':intUtil[_0x7772('0xf')](_0x2af163[_0x7772('0x10')],_0x136fa3,'\x20'),'description':intUtil[_0x7772('0xf')](_0x2af163[_0x7772('0x11')],_0x136fa3,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x2af163[_0x7772('0x11')],_0x136fa3,'\x0a')}},getCustomFields(_0x2af163[_0x7772('0x12')],_0x136fa3))}})[_0x7772('0x13')](function(_0x50dea1){logger['info'](_0x7772('0x14'));return _0x50dea1[_0x7772('0x15')];});}function getUser(_0x9d9652,_0x3d7cc5){if(intUtil[_0x7772('0x16')](_0x3d7cc5)){logger[_0x7772('0x9')]('Getting\x20agent\x20with\x20email',_0x3d7cc5);return request({'uri':util['format']('%s/search.json',_0x9d9652[_0x7772('0xb')]),'qs':{'query':util[_0x7772('0x17')](_0x7772('0x18'),_0x3d7cc5)}})[_0x7772('0x13')](function(_0x502bf6){if(_0x502bf6[_0x7772('0x19')]){logger[_0x7772('0x9')](_0x7772('0x1a'));return _['find'](_0x502bf6[_0x7772('0x1b')],{'email':_0x3d7cc5,'role':_0x7772('0x1c')});}else{logger[_0x7772('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x7772('0x17')]('%s/users/me.json',_0x9d9652[_0x7772('0xb')])})['then'](function(_0x5cd355){logger[_0x7772('0x9')](_0x7772('0x1d'));return _0x5cd355[_0x7772('0x1e')];});}});}else{logger[_0x7772('0x9')](_0x7772('0x1f'));return request({'uri':util[_0x7772('0x17')](_0x7772('0x20'),_0x9d9652[_0x7772('0xb')])})['then'](function(_0x3065d9){logger[_0x7772('0x9')](_0x7772('0x1d'));return _0x3065d9[_0x7772('0x1e')];});}}function getEndUser(_0x43fcda,_0x2bdbda,_0x2bd81d){logger[_0x7772('0x9')](_0x7772('0x21'),_0x2bd81d);return request({'uri':util[_0x7772('0x17')](_0x7772('0x22'),_0x43fcda[_0x7772('0xb')]),'qs':{'query':util[_0x7772('0x17')](_0x7772('0x23'),_0x2bd81d)}})[_0x7772('0x13')](function(_0x448037){var _0x3c4888;if(_0x448037[_0x7772('0x1b')][_0x7772('0x24')]){_0x448037[_0x7772('0x1b')]=_[_0x7772('0x25')](_0x448037[_0x7772('0x1b')],{'suspended':![],'role':_0x7772('0x26')});if(_0x448037[_0x7772('0x1b')][_0x7772('0x24')]){_0x3c4888=_[_0x7772('0x27')](_0x448037[_0x7772('0x1b')]);}}if(_0x3c4888){logger['info'](_0x7772('0x28'));return _0x3c4888;}else{logger['info'](_0x7772('0x29'));return request({'uri':util[_0x7772('0x17')](_0x7772('0x2a'),_0x43fcda[_0x7772('0xb')]),'method':'POST','body':{'user':{'role':_0x7772('0x26'),'name':util[_0x7772('0x17')](_0x7772('0x2b'),_0x2bdbda||_0x2bd81d),'phone':_0x2bd81d}}})[_0x7772('0x13')](function(_0x4a88ab){logger['info'](_0x7772('0x2c'));return _0x4a88ab[_0x7772('0x1e')];});}});}function getAuth(_0x144e37){var _0x1a715c;if(_0x144e37[_0x7772('0x2d')]==='password'){_0x1a715c=util[_0x7772('0x17')]('%s:%s',_0x144e37['username'],_0x144e37[_0x7772('0x2e')]);}else if(_0x144e37['authType']==='token'){_0x1a715c=util[_0x7772('0x17')]('%s/token:%s',_0x144e37['username'],_0x144e37[_0x7772('0x2f')]);}return util['format'](_0x7772('0x30'),new Buffer(_0x1a715c)[_0x7772('0x31')](_0x7772('0x32')));}function request(_0x532656){logger[_0x7772('0x33')]('[HTTP]',JSON[_0x7772('0x34')](_0x532656));return rp(_['defaults'](_0x532656,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5c7ef9,_0x3f3783){var _0x21d540=[];if(_0x5c7ef9&&_0x5c7ef9['length']>0x0){_0x21d540=_['map'](_0x5c7ef9,_0x3f3783);}return _0x21d540;}function getCustomFields(_0x2248a7,_0x576da7){var _0x3b8a64=[];var _0x28a807={'custom_fields':[]};if(_0x2248a7[_0x7772('0x24')]>0x0){_['forEach'](_0x2248a7,function(_0x2a78d4){if(_[_0x7772('0x35')]([_0x7772('0x36'),_0x7772('0x37')],_0x2a78d4[_0x7772('0x38')])&&_0x2a78d4[_0x7772('0x39')]&&!_0x2a78d4[_0x7772('0x3a')]){_0x28a807[_0x2a78d4[_0x7772('0x39')]['toLowerCase']()]=_0x2a78d4['content'][_0x7772('0x31')]();}else if(_[_0x7772('0x35')]([_0x7772('0x36'),_0x7772('0x37')],_0x2a78d4['type'])&&_0x2a78d4[_0x7772('0x3b')]&&_0x2a78d4[_0x7772('0x3a')]){_0x28a807['custom_fields'][_0x7772('0x3c')]({'id':_0x2a78d4[_0x7772('0x3b')],'value':_0x2a78d4[_0x7772('0x3d')]['toString']()});}else if(_0x2a78d4[_0x7772('0x38')]===_0x7772('0x3e')&&_0x2a78d4['variableName']&&_0x2a78d4[_0x7772('0x3b')]&&_0x2a78d4[_0x7772('0x3a')]){_0x576da7[_0x2a78d4[_0x7772('0x3f')]]&&_0x28a807['custom_fields'][_0x7772('0x3c')]({'id':_0x2a78d4['idField'],'value':_0x576da7[_0x2a78d4[_0x7772('0x3f')]][_0x7772('0x31')]()});}else if(_0x2a78d4[_0x7772('0x38')]===_0x7772('0x40')&&_0x2a78d4[_0x7772('0x41')]&&_0x2a78d4[_0x7772('0x41')][_0x7772('0xe')]&&_0x2a78d4[_0x7772('0x3b')]&&_0x2a78d4[_0x7772('0x3a')]){_0x576da7[_0x2a78d4[_0x7772('0x41')][_0x7772('0xe')]['toLowerCase']()]&&_0x28a807[_0x7772('0x42')]['push']({'id':_0x2a78d4[_0x7772('0x3b')],'value':_0x576da7[_0x2a78d4['Variable']['name']['toLowerCase']()][_0x7772('0x31')]()});}});}return _0x28a807;}exports[_0x7772('0x43')]=function(_0x564262,_0x459f9e,_0x4686f2,_0x3dce09,_0x2c3739,_0x2e665c){var _0x1caddd,_0x3b6065;_0x2e665c['remoteUri']=intUtil[_0x7772('0x44')](_0x2e665c['remoteUri']);_0x2e665c[_0x7772('0x45')]=intUtil[_0x7772('0x44')](_0x2e665c[_0x7772('0x45')]);if(_0x2c3739&&_0x2c3739[_0x7772('0x46')]){logger[_0x7772('0x9')](_0x7772('0x47'),_0x7772('0x48'));_0x459f9e[_0x7772('0x49')]=util[_0x7772('0x17')](_0x7772('0x4a'),_0x2e665c[_0x7772('0x45')],_0x459f9e['uniqueid'],md5(_0x459f9e[_0x7772('0x4b')]));}else{_0x459f9e[_0x7772('0x49')]='';}headers[_0x7772('0x4c')]=getAuth(_0x2e665c);return getUser(_0x2e665c,_0x3dce09[_0x7772('0x4d')])[_0x7772('0x13')](function(_0x172e0c){_0x1caddd=_0x172e0c;logger['info']('The\x20User\x20ID\x20is:',_0x1caddd['id']);return getEndUser(_0x2e665c,_0x459f9e['calleridname'],_0x459f9e[_0x7772('0x4e')]);})[_0x7772('0x13')](function(_0x14f383){_0x3b6065=_0x14f383;logger[_0x7772('0x9')](_0x7772('0x4f'),_0x3b6065['id']);return getTicket(_0x2e665c,_0x1caddd,_0x3b6065,_0x4686f2,_0x459f9e);})['then'](function(_0x4c17ee){if(_0x4c17ee){logger[_0x7772('0x9')](_0x7772('0x50'),_0x4c17ee['id']);switch(_0x2e665c['type']){case _0x7772('0x51'):logger[_0x7772('0x9')](_0x7772('0x47'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x7772('0x17')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x2e665c[_0x7772('0xb')],_0x1caddd['id'],_0x4c17ee['id']),'method':'POST'});case'newTab':logger[_0x7772('0x9')](_0x7772('0x47'),_0x7772('0x52'));emit(util['format'](_0x7772('0x53'),_0x3dce09[_0x7772('0xe')]),_0x7772('0x54'),{'uri':util[_0x7772('0x17')]('%s/agent/tickets/%s',_0x2e665c[_0x7772('0xb')][_0x7772('0x55')](_0x7772('0x56'),''),_0x4c17ee['id'])});break;default:logger[_0x7772('0x57')](_0x7772('0x47'),_0x7772('0x58'));}}})[_0x7772('0x59')](function(_0x2f2132){logger[_0x7772('0x57')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x2f2132,{'showHidden':!![],'depth':null}));});};exports[_0x7772('0x5a')]=function(_0x5a610e,_0x2e753b,_0x241a5d,_0x2faff8,_0x1248d9,_0x2677e8,_0x2295e9){var _0x347293,_0x38d6be;_0x2677e8[_0x7772('0xb')]=intUtil['stripTrailingSlash'](_0x2677e8[_0x7772('0xb')]);_0x2677e8['serverUrl']=intUtil[_0x7772('0x44')](_0x2677e8[_0x7772('0x45')]);if(_0x2295e9&&_0x2295e9[_0x7772('0x5b')]&&_0x2295e9[_0x7772('0x5b')]!==_0x7772('0x5c')){logger['info'](_0x7772('0x5d'),'Recording\x20is\x20enabled!');_0x2e753b[_0x7772('0x49')]=util[_0x7772('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2677e8[_0x7772('0x45')],_0x2e753b[_0x7772('0x4b')],md5(_0x2e753b['uniqueid']));}headers[_0x7772('0x4c')]=getAuth(_0x2677e8);return getUser(_0x2677e8,_0x2faff8[_0x7772('0x4d')])[_0x7772('0x13')](function(_0x374a04){_0x347293=_0x374a04;logger[_0x7772('0x9')](_0x7772('0x5e'),_0x347293['id']);return getEndUser(_0x2677e8,_0x2e753b[_0x7772('0x5f')],_0x2e753b[_0x7772('0x60')]);})[_0x7772('0x13')](function(_0x1c8f58){_0x38d6be=_0x1c8f58;logger[_0x7772('0x9')](_0x7772('0x4f'),_0x38d6be['id']);return getTicket(_0x2677e8,_0x347293,_0x38d6be,_0x241a5d,_0x2e753b);})['then'](function(_0x3e5266){if(_0x3e5266){logger[_0x7772('0x9')](_0x7772('0x50'),_0x3e5266['id']);switch(_0x2677e8[_0x7772('0x38')]){case _0x7772('0x51'):logger[_0x7772('0x9')]('[OUTBOUND]',_0x7772('0x61'));return request({'uri':util['format'](_0x7772('0x62'),_0x2677e8[_0x7772('0xb')],_0x347293['id'],_0x3e5266['id']),'method':'POST'});case _0x7772('0x63'):logger[_0x7772('0x9')](_0x7772('0x5d'),_0x7772('0x52'));emit(util[_0x7772('0x17')](_0x7772('0x53'),_0x2faff8['name']),_0x7772('0x54'),{'uri':util[_0x7772('0x17')](_0x7772('0x64'),_0x2677e8[_0x7772('0xb')][_0x7772('0x55')](_0x7772('0x56'),''),_0x3e5266['id'])});break;default:logger[_0x7772('0x57')](_0x7772('0x5d'),_0x7772('0x58'));}}})['catch'](function(_0x2432bd){logger['error'](_0x7772('0x65'),util[_0x7772('0x66')](_0x2432bd,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x3145cd,_0x52f35f,_0x78a434,_0x41f871,_0x43bc63,_0x374614){var _0x4f6647,_0x4328f5;_0x374614[_0x7772('0xb')]=intUtil[_0x7772('0x44')](_0x374614[_0x7772('0xb')]);_0x374614['serverUrl']=intUtil[_0x7772('0x44')](_0x374614[_0x7772('0x45')]);if(_0x43bc63&&_0x43bc63['monitor_format']){logger['info']('['+_0x52f35f[_0x7772('0x67')][_0x7772('0x68')]()+']','Recording\x20is\x20enabled!');_0x52f35f[_0x7772('0x49')]=util[_0x7772('0x17')](_0x7772('0x4a'),_0x374614[_0x7772('0x45')],_0x52f35f[_0x7772('0x4b')],md5(_0x52f35f[_0x7772('0x4b')]));}else{_0x52f35f['recordingURL']='';}headers[_0x7772('0x4c')]=getAuth(_0x374614);return getUser(_0x374614)[_0x7772('0x13')](function(_0x4c482c){_0x4f6647=_0x4c482c;logger[_0x7772('0x9')](_0x7772('0x5e'),_0x4f6647['id']);return getEndUser(_0x374614,_0x52f35f['calleridname'],_0x52f35f[_0x7772('0x4e')]);})[_0x7772('0x13')](function(_0x4a2071){_0x4328f5=_0x4a2071;logger[_0x7772('0x9')]('The\x20Enduser\x20ID\x20is:',_0x4328f5['id']);return getTicket(_0x374614,_0x4f6647,_0x4328f5,_0x78a434,_0x52f35f);})[_0x7772('0x13')](function(_0x32672a){if(_0x32672a){logger[_0x7772('0x9')](_0x7772('0x50'),_0x32672a['id']);}})['catch'](function(_0x4cee4b){logger[_0x7772('0x57')]('['+_0x52f35f[_0x7772('0x67')][_0x7772('0x68')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x7772('0x66')](_0x4cee4b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3185=['type','nameField','customField','toLowerCase','content','picklist','idField','push','toString','variable','variableName','custom_fields','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','trigger:browser:url','%s/agent/tickets/%s','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridname','The\x20Ticket\x20ID\x20is:','lodash','request-promise','util','ioredis','./util','../../../../config/environment','zendesk','redis','localhost','emit','info','Creating\x20new\x20ticket...','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','results','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','authType','%s:%s','username','password','%s/token:%s','token','base64','debug','stringify','GET','map','includes','string'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x3185,0x181));var _0x5318=function(_0xf01f3c,_0x4d0065){_0xf01f3c=_0xf01f3c-0x0;var _0x37fe54=_0x3185[_0xf01f3c];return _0x37fe54;};'use strict';var _=require(_0x5318('0x0'));var rp=require(_0x5318('0x1'));var md5=require('md5');var util=require(_0x5318('0x2'));var Redis=require(_0x5318('0x3'));var intUtil=require(_0x5318('0x4'));var config=require(_0x5318('0x5'));var logger=require('../../../../config/logger')(_0x5318('0x6'));config[_0x5318('0x7')]=_['defaults'](config[_0x5318('0x7')],{'host':_0x5318('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x386274,_0x4a124c,_0x8312c5){io['to'](_0x386274)[_0x5318('0x9')](_0x4a124c,_0x8312c5);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0xfd3423,_0x2651fa,_0x1b6414,_0x58ec1c,_0x5997c5){logger[_0x5318('0xa')](_0x5318('0xb'));return request({'uri':util['format']('%s/tickets.json',_0xfd3423[_0x5318('0xc')]),'method':_0x5318('0xd'),'body':{'ticket':_[_0x5318('0xe')]({'requester_id':_0x1b6414['id'],'submitter_id':_0x2651fa?_0x2651fa['id']:undefined,'assignee_id':_0x2651fa?_0x2651fa['id']:undefined,'tags':getTags(_0x58ec1c[_0x5318('0xf')],_0x5318('0x10')),'subject':intUtil[_0x5318('0x11')](_0x58ec1c[_0x5318('0x12')],_0x5997c5,'\x20'),'description':intUtil[_0x5318('0x11')](_0x58ec1c[_0x5318('0x13')],_0x5997c5,'\x0a'),'comment':{'public':![],'body':intUtil[_0x5318('0x11')](_0x58ec1c[_0x5318('0x13')],_0x5997c5,'\x0a')}},getCustomFields(_0x58ec1c[_0x5318('0x14')],_0x5997c5))}})[_0x5318('0x15')](function(_0x5e9c77){logger[_0x5318('0xa')](_0x5318('0x16'));return _0x5e9c77[_0x5318('0x17')];});}function getUser(_0x32b9dc,_0x37c699){if(intUtil[_0x5318('0x18')](_0x37c699)){logger[_0x5318('0xa')](_0x5318('0x19'),_0x37c699);return request({'uri':util[_0x5318('0x1a')](_0x5318('0x1b'),_0x32b9dc[_0x5318('0xc')]),'qs':{'query':util[_0x5318('0x1a')](_0x5318('0x1c'),_0x37c699)}})['then'](function(_0x4f0a18){if(_0x4f0a18[_0x5318('0x1d')]){logger['info'](_0x5318('0x1e'));return _[_0x5318('0x1f')](_0x4f0a18['results'],{'email':_0x37c699,'role':_0x5318('0x20')});}else{logger[_0x5318('0xa')](_0x5318('0x21'));return request({'uri':util[_0x5318('0x1a')](_0x5318('0x22'),_0x32b9dc[_0x5318('0xc')])})[_0x5318('0x15')](function(_0x2dc09c){logger[_0x5318('0xa')](_0x5318('0x23'));return _0x2dc09c[_0x5318('0x24')];});}});}else{logger[_0x5318('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x5318('0x1a')](_0x5318('0x22'),_0x32b9dc[_0x5318('0xc')])})[_0x5318('0x15')](function(_0x563c61){logger[_0x5318('0xa')](_0x5318('0x23'));return _0x563c61['user'];});}}function getEndUser(_0x24cdc8,_0x113080,_0x5a811e){logger[_0x5318('0xa')](_0x5318('0x25'),_0x5a811e);return request({'uri':util[_0x5318('0x1a')](_0x5318('0x1b'),_0x24cdc8['remoteUri']),'qs':{'query':util[_0x5318('0x1a')](_0x5318('0x26'),_0x5a811e)}})[_0x5318('0x15')](function(_0x401ad6){var _0x449cff;if(_0x401ad6['results'][_0x5318('0x27')]){_0x401ad6['results']=_[_0x5318('0x28')](_0x401ad6[_0x5318('0x29')],{'suspended':![],'role':'end-user'});if(_0x401ad6[_0x5318('0x29')][_0x5318('0x27')]){_0x449cff=_[_0x5318('0x2a')](_0x401ad6['results']);}}if(_0x449cff){logger[_0x5318('0xa')](_0x5318('0x2b'));return _0x449cff;}else{logger['info'](_0x5318('0x2c'));return request({'uri':util[_0x5318('0x1a')]('%s/users.json',_0x24cdc8['remoteUri']),'method':_0x5318('0xd'),'body':{'user':{'role':'end-user','name':util[_0x5318('0x1a')](_0x5318('0x2d'),_0x113080||_0x5a811e),'phone':_0x5a811e}}})['then'](function(_0x486cdd){logger[_0x5318('0xa')]('Enduser\x20created.');return _0x486cdd[_0x5318('0x24')];});}});}function getAuth(_0x2b23a4){var _0x29fbfe;if(_0x2b23a4[_0x5318('0x2e')]==='password'){_0x29fbfe=util[_0x5318('0x1a')](_0x5318('0x2f'),_0x2b23a4[_0x5318('0x30')],_0x2b23a4[_0x5318('0x31')]);}else if(_0x2b23a4[_0x5318('0x2e')]==='token'){_0x29fbfe=util[_0x5318('0x1a')](_0x5318('0x32'),_0x2b23a4[_0x5318('0x30')],_0x2b23a4[_0x5318('0x33')]);}return util[_0x5318('0x1a')]('Basic\x20%s',new Buffer(_0x29fbfe)['toString'](_0x5318('0x34')));}function request(_0x6f0084){logger[_0x5318('0x35')]('[HTTP]',JSON[_0x5318('0x36')](_0x6f0084));return rp(_['defaults'](_0x6f0084,{'method':_0x5318('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x10f063,_0x3aeb27){var _0x26294a=[];if(_0x10f063&&_0x10f063[_0x5318('0x27')]>0x0){_0x26294a=_[_0x5318('0x38')](_0x10f063,_0x3aeb27);}return _0x26294a;}function getCustomFields(_0x39ded6,_0x307368){var _0xc82d94=[];var _0x260f7f={'custom_fields':[]};if(_0x39ded6['length']>0x0){_['forEach'](_0x39ded6,function(_0x1fba22){if(_[_0x5318('0x39')]([_0x5318('0x3a'),'picklist'],_0x1fba22[_0x5318('0x3b')])&&_0x1fba22[_0x5318('0x3c')]&&!_0x1fba22[_0x5318('0x3d')]){_0x260f7f[_0x1fba22[_0x5318('0x3c')][_0x5318('0x3e')]()]=_0x1fba22[_0x5318('0x3f')]['toString']();}else if(_[_0x5318('0x39')](['string',_0x5318('0x40')],_0x1fba22[_0x5318('0x3b')])&&_0x1fba22[_0x5318('0x41')]&&_0x1fba22[_0x5318('0x3d')]){_0x260f7f['custom_fields'][_0x5318('0x42')]({'id':_0x1fba22[_0x5318('0x41')],'value':_0x1fba22[_0x5318('0x3f')][_0x5318('0x43')]()});}else if(_0x1fba22[_0x5318('0x3b')]===_0x5318('0x44')&&_0x1fba22[_0x5318('0x45')]&&_0x1fba22[_0x5318('0x41')]&&_0x1fba22['customField']){_0x307368[_0x1fba22['variableName']]&&_0x260f7f[_0x5318('0x46')][_0x5318('0x42')]({'id':_0x1fba22[_0x5318('0x41')],'value':_0x307368[_0x1fba22[_0x5318('0x45')]][_0x5318('0x43')]()});}else if(_0x1fba22[_0x5318('0x3b')]===_0x5318('0x47')&&_0x1fba22[_0x5318('0x48')]&&_0x1fba22[_0x5318('0x48')][_0x5318('0x10')]&&_0x1fba22[_0x5318('0x41')]&&_0x1fba22[_0x5318('0x3d')]){_0x307368[_0x1fba22[_0x5318('0x48')][_0x5318('0x10')][_0x5318('0x3e')]()]&&_0x260f7f[_0x5318('0x46')][_0x5318('0x42')]({'id':_0x1fba22[_0x5318('0x41')],'value':_0x307368[_0x1fba22[_0x5318('0x48')][_0x5318('0x10')]['toLowerCase']()]['toString']()});}});}return _0x260f7f;}exports[_0x5318('0x49')]=function(_0xff52e0,_0x1a47b9,_0xaf09a1,_0x78cc64,_0x2b58d2,_0x15fdba){var _0x3d8a50,_0x22dce2;_0x15fdba['remoteUri']=intUtil[_0x5318('0x4a')](_0x15fdba[_0x5318('0xc')]);_0x15fdba['serverUrl']=intUtil[_0x5318('0x4a')](_0x15fdba[_0x5318('0x4b')]);if(_0x2b58d2&&_0x2b58d2[_0x5318('0x4c')]){logger[_0x5318('0xa')](_0x5318('0x4d'),_0x5318('0x4e'));_0x1a47b9[_0x5318('0x4f')]=util[_0x5318('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x15fdba[_0x5318('0x4b')],_0x1a47b9[_0x5318('0x50')],md5(_0x1a47b9[_0x5318('0x50')]));}else{_0x1a47b9[_0x5318('0x4f')]='';}headers[_0x5318('0x51')]=getAuth(_0x15fdba);return getUser(_0x15fdba,_0x78cc64['email'])[_0x5318('0x15')](function(_0x1bf06e){_0x3d8a50=_0x1bf06e;logger[_0x5318('0xa')](_0x5318('0x52'),_0x3d8a50['id']);return getEndUser(_0x15fdba,_0x1a47b9['calleridname'],_0x1a47b9[_0x5318('0x53')]);})[_0x5318('0x15')](function(_0x1e9e48){_0x22dce2=_0x1e9e48;logger[_0x5318('0xa')]('The\x20Enduser\x20ID\x20is:',_0x22dce2['id']);return getTicket(_0x15fdba,_0x3d8a50,_0x22dce2,_0xaf09a1,_0x1a47b9);})[_0x5318('0x15')](function(_0x2aa0ca){if(_0x2aa0ca){logger['info']('The\x20Ticket\x20ID\x20is:',_0x2aa0ca['id']);switch(_0x15fdba[_0x5318('0x3b')]){case _0x5318('0x54'):logger[_0x5318('0xa')]('[QUEUE]',_0x5318('0x55'));return request({'uri':util[_0x5318('0x1a')](_0x5318('0x56'),_0x15fdba[_0x5318('0xc')],_0x3d8a50['id'],_0x2aa0ca['id']),'method':_0x5318('0xd')});case _0x5318('0x57'):logger[_0x5318('0xa')]('[QUEUE]',_0x5318('0x58'));emit(util[_0x5318('0x1a')](_0x5318('0x59'),_0x78cc64[_0x5318('0x10')]),'trigger:browser:url',{'uri':util[_0x5318('0x1a')]('%s/agent/tickets/%s',_0x15fdba[_0x5318('0xc')]['replace'](_0x5318('0x5a'),''),_0x2aa0ca['id'])});break;default:logger[_0x5318('0x5b')]('[QUEUE]',_0x5318('0x5c'));}}})[_0x5318('0x5d')](function(_0x205c93){logger[_0x5318('0x5b')](_0x5318('0x5e'),util[_0x5318('0x5f')](_0x205c93,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x2d73cb,_0x430c79,_0x358ee5,_0xf33788,_0x37bb11,_0x169ab0,_0x944b92){var _0x406774,_0x468263;_0x169ab0[_0x5318('0xc')]=intUtil['stripTrailingSlash'](_0x169ab0[_0x5318('0xc')]);_0x169ab0[_0x5318('0x4b')]=intUtil[_0x5318('0x4a')](_0x169ab0[_0x5318('0x4b')]);if(_0x944b92&&_0x944b92[_0x5318('0x60')]&&_0x944b92[_0x5318('0x60')]!==_0x5318('0x61')){logger[_0x5318('0xa')](_0x5318('0x62'),_0x5318('0x4e'));_0x430c79[_0x5318('0x4f')]=util[_0x5318('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x169ab0['serverUrl'],_0x430c79[_0x5318('0x50')],md5(_0x430c79[_0x5318('0x50')]));}headers[_0x5318('0x51')]=getAuth(_0x169ab0);return getUser(_0x169ab0,_0xf33788['email'])[_0x5318('0x15')](function(_0x53d36a){_0x406774=_0x53d36a;logger[_0x5318('0xa')](_0x5318('0x52'),_0x406774['id']);return getEndUser(_0x169ab0,_0x430c79[_0x5318('0x63')],_0x430c79['destcalleridnum']);})[_0x5318('0x15')](function(_0x39465a){_0x468263=_0x39465a;logger[_0x5318('0xa')](_0x5318('0x64'),_0x468263['id']);return getTicket(_0x169ab0,_0x406774,_0x468263,_0x358ee5,_0x430c79);})[_0x5318('0x15')](function(_0x390f3b){if(_0x390f3b){logger[_0x5318('0xa')]('The\x20Ticket\x20ID\x20is:',_0x390f3b['id']);switch(_0x169ab0[_0x5318('0x3b')]){case'integrationTab':logger[_0x5318('0xa')](_0x5318('0x62'),_0x5318('0x55'));return request({'uri':util[_0x5318('0x1a')](_0x5318('0x56'),_0x169ab0[_0x5318('0xc')],_0x406774['id'],_0x390f3b['id']),'method':_0x5318('0xd')});case _0x5318('0x57'):logger['info'](_0x5318('0x62'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x5318('0x59'),_0xf33788[_0x5318('0x10')]),_0x5318('0x65'),{'uri':util['format'](_0x5318('0x66'),_0x169ab0['remoteUri'][_0x5318('0x67')](_0x5318('0x5a'),''),_0x390f3b['id'])});break;default:logger[_0x5318('0x5b')](_0x5318('0x62'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x5318('0x5d')](function(_0x5dacad){logger[_0x5318('0x5b')](_0x5318('0x68'),util[_0x5318('0x5f')](_0x5dacad,{'showHidden':!![],'depth':null}));});};exports[_0x5318('0x69')]=function(_0x56e598,_0x3478e0,_0x128a5a,_0x62d487,_0x2b5c55,_0x356824){var _0x34be57,_0x2c6c72;_0x356824[_0x5318('0xc')]=intUtil['stripTrailingSlash'](_0x356824[_0x5318('0xc')]);_0x356824[_0x5318('0x4b')]=intUtil[_0x5318('0x4a')](_0x356824[_0x5318('0x4b')]);if(_0x2b5c55&&_0x2b5c55['monitor_format']){logger[_0x5318('0xa')]('['+_0x3478e0[_0x5318('0x6a')][_0x5318('0x6b')]()+']',_0x5318('0x4e'));_0x3478e0[_0x5318('0x4f')]=util[_0x5318('0x1a')](_0x5318('0x6c'),_0x356824[_0x5318('0x4b')],_0x3478e0[_0x5318('0x50')],md5(_0x3478e0[_0x5318('0x50')]));}else{_0x3478e0['recordingURL']='';}headers[_0x5318('0x51')]=getAuth(_0x356824);return getUser(_0x356824)['then'](function(_0x267c3e){_0x34be57=_0x267c3e;logger[_0x5318('0xa')](_0x5318('0x52'),_0x34be57['id']);return getEndUser(_0x356824,_0x3478e0[_0x5318('0x6d')],_0x3478e0[_0x5318('0x53')]);})[_0x5318('0x15')](function(_0x2556bb){_0x2c6c72=_0x2556bb;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2c6c72['id']);return getTicket(_0x356824,_0x34be57,_0x2c6c72,_0x128a5a,_0x3478e0);})[_0x5318('0x15')](function(_0x4b8f1b){if(_0x4b8f1b){logger['info'](_0x5318('0x6e'),_0x4b8f1b['id']);}})[_0x5318('0x5d')](function(_0x5e4f01){logger[_0x5318('0x5b')]('['+_0x3478e0[_0x5318('0x6a')][_0x5318('0x6b')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x5318('0x5f')](_0x5e4f01,{'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 a1adb5a..9c495a0 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 _0x9336=['refreshToken','clientId','clientSecret','then','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','last_name','data','code','log','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Owner','profile','role','first_name','Subject','Subjects','Description','First_Name','Last_Name','What_Id','Full_Name','$se_module','talktime','Call_Duration','utc','endtime','YYYY-MM-DDTHH:mm:ss','diff','format','mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','POST','SUCCESS','Call\x20created!','err','queue','host','stripTrailingSlash','[QUEUE]','recordingURL','serverUrl','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','calleridnum','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','monitor_format','toUpperCase','com','calleridname','The\x20Call\x20ID\x20is:','lodash','request-promise','md5','util','moment','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','socket.io-emitter','stringify','length','forEach','includes','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token'];(function(_0x2e5a3f,_0x165893){var _0x10b64e=function(_0x103e0f){while(--_0x103e0f){_0x2e5a3f['push'](_0x2e5a3f['shift']());}};_0x10b64e(++_0x165893);}(_0x9336,0x1a5));var _0x6933=function(_0x27a7ef,_0x535ca6){_0x27a7ef=_0x27a7ef-0x0;var _0x304c0a=_0x9336[_0x27a7ef];return _0x304c0a;};'use strict';var _=require(_0x6933('0x0'));var rp=require(_0x6933('0x1'));var md5=require(_0x6933('0x2'));var util=require(_0x6933('0x3'));var intUtil=require('./util');var moment=require(_0x6933('0x4'));var Redis=require(_0x6933('0x5'));var BPromise=require(_0x6933('0x6'));var config=require(_0x6933('0x7'));var logger=require('../../../../config/logger')(_0x6933('0x8'));config[_0x6933('0x9')]=_[_0x6933('0xa')](config[_0x6933('0x9')],{'host':_0x6933('0xb'),'port':0x18eb});var io=require(_0x6933('0xc'))(new Redis(config[_0x6933('0x9')]));function emit(_0x3ed9b2,_0x3b7df7,_0x518632){io['to'](_0x3ed9b2)['emit'](_0x3b7df7,_0x518632);}function request(_0x498384){logger['debug']('[HTTP]',JSON[_0x6933('0xd')](_0x498384));return rp(_0x498384);}function getCustomFields(_0x215fab,_0x20e72e){var _0x40860d={};if(_0x215fab[_0x6933('0xe')]>0x0){_[_0x6933('0xf')](_0x215fab,function(_0x126237){if(_[_0x6933('0x10')](['string',_0x6933('0x11')],_0x126237[_0x6933('0x12')])&&_0x126237['idField']){_0x40860d[_0x126237[_0x6933('0x13')]]=_0x126237['content'][_0x6933('0x14')]();}else if(_0x126237[_0x6933('0x12')]===_0x6933('0x15')&&_0x126237[_0x6933('0x16')]&&_0x126237[_0x6933('0x13')]&&_0x20e72e[_0x126237[_0x6933('0x16')]]){_0x40860d[_0x126237[_0x6933('0x13')]]=_0x20e72e[_0x126237[_0x6933('0x16')]][_0x6933('0x14')]();}else if(_0x126237['type']===_0x6933('0x17')&&_0x126237['Variable']&&_0x126237[_0x6933('0x18')]['name']&&_0x126237[_0x6933('0x13')]&&_0x20e72e[_0x126237[_0x6933('0x18')][_0x6933('0x19')][_0x6933('0x1a')]()]){_0x40860d[_0x126237['idField']]=_0x20e72e[_0x126237['Variable'][_0x6933('0x19')][_0x6933('0x1a')]()][_0x6933('0x14')]();}});}return _0x40860d;}function getName(_0x5cf56a){if(_0x5cf56a[_0x6933('0x1b')]('\x20')>0x0){var _0xf5db1e=_0x5cf56a[_0x6933('0x1c')](/ (.+)/);if(_0xf5db1e[0x1]){return _0xf5db1e;}}return[_0x5cf56a,_0x5cf56a];}var accountsTokens={};function getAccessToken(_0xc62c42){return new Promise(function(_0xbd8a1e,_0x5ac92c){if(!_[_0x6933('0x1d')](accountsTokens[_0xc62c42['id']])&&!_['isNil'](accountsTokens[_0xc62c42['id']][_0x6933('0x1e')])){if(moment()[_0x6933('0x1f')](accountsTokens[_0xc62c42['id']]['expires_in'])){_0xbd8a1e(accountsTokens[_0xc62c42['id']][_0x6933('0x1e')]);}}var _0x3ffdce;switch(_0xc62c42[_0x6933('0x20')]){case'US':_0x3ffdce=_0x6933('0x21');break;case'AU':_0x3ffdce=_0x6933('0x22');break;case'EU':_0x3ffdce=_0x6933('0x23');break;case'IN':_0x3ffdce=_0x6933('0x24');break;case'CN':_0x3ffdce='https://accounts.zoho.com.cn';break;default:_0x3ffdce=_0x6933('0x23');break;}var _0x658304={'method':'POST','uri':_0x3ffdce+_0x6933('0x25'),'qs':{'refresh_token':_0xc62c42[_0x6933('0x26')],'client_id':_0xc62c42[_0x6933('0x27')],'client_secret':_0xc62c42[_0x6933('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x658304)[_0x6933('0x29')](function(_0x5db5d3){accountsTokens[_0xc62c42['id']]={'access_token':_0x5db5d3[_0x6933('0x1e')],'expires_in':moment()['add'](_0x5db5d3[_0x6933('0x2a')],_0x6933('0x2b'))};_0xbd8a1e(_0x5db5d3['access_token']);})[_0x6933('0x2c')](function(_0x185bd6){logger[_0x6933('0x2d')](_0x6933('0x2e'),_0x185bd6[_0x6933('0x2f')]);_0x5ac92c(_0x185bd6);});});}function getUser(_0x27ab48,_0x5d31db,_0x525d21,_0x345a54){logger[_0x6933('0x30')](_0x6933('0x31'));return request({'method':_0x6933('0x32'),'uri':util['format'](_0x6933('0x33'),_0x5d31db),'qs':{'type':_0x6933('0x34')},'headers':{'Authorization':_0x6933('0x35')+_0x27ab48},'json':!![]})[_0x6933('0x29')](function(_0x477103){if(_0x477103[_0x6933('0x36')]){var _0x9ef507=-0x1;if(_['isArrayLikeObject'](_0x477103[_0x6933('0x36')])){if(!_[_0x6933('0x1d')](_0x345a54)){_0x9ef507=_[_0x6933('0x37')](_0x477103[_0x6933('0x36')],function(_0x517d83){return _0x517d83[_0x6933('0x38')]===_0x345a54;});}if(_0x9ef507>=0x0){logger[_0x6933('0x30')](_0x6933('0x39'));}else{logger[_0x6933('0x30')](_0x6933('0x3a'));_0x9ef507=_[_0x6933('0x37')](_0x477103['users'],function(_0x148357){return _0x148357['profile'][_0x6933('0x19')]===_0x6933('0x3b');});}return _0x477103[_0x6933('0x36')][_0x9ef507];}else{if(_0x477103[_0x6933('0x3c')]['profile'][_0x6933('0x19')]===_0x6933('0x3b')){logger[_0x6933('0x30')](_0x6933('0x3a'));user=_0x477103[_0x6933('0x3c')];return user;}else{logger[_0x6933('0x2d')](_0x6933('0x3d'),JSON[_0x6933('0xd')](_0x477103));throw new Error(_0x6933('0x3e')+JSON['stringify'](_0x477103));}}}else{logger[_0x6933('0x2d')](_0x6933('0x3d'),JSON[_0x6933('0xd')](_0x477103));throw new Error(_0x6933('0x3e')+JSON[_0x6933('0xd')](_0x477103));}})['catch'](function(_0x3347f9){console['error'](_0x3347f9);});}function getZohoUser(_0x24c10e,_0x20c3ee){return new BPromise(function(_0x55603f,_0x373d7c){request(_0x24c10e)[_0x6933('0x29')](function(_0x941c47){var _0x27fe33=null;if(_0x941c47){_0x27fe33=_0x941c47['data'][0x0];_0x27fe33[_0x6933('0x3f')]=_0x20c3ee;}_0x55603f(_0x27fe33);})['catch'](function(_0x49a938){_0x373d7c(_0x49a938);});});}function createEndUser(_0x5e3b7c,_0x5e2d9a,_0x29f6dc,_0x5d8cd,_0x4339bb,_0x2ecf4d){var _0x29f6dc=getName(_0x29f6dc);return request({'method':'POST','uri':_0x6933('0x40')+_0x5e2d9a+_0x6933('0x41')+_[_0x6933('0x42')](_0x2ecf4d[_0x6933('0x43')])+'s','body':{'data':[{'Last_Name':_0x29f6dc[0x1],'First_Name':_0x29f6dc[0x0],'Phone':_0x5d8cd,'Owner':{'name':!_[_0x6933('0x1d')](_0x4339bb['role'][_0x6933('0x19')])?_0x4339bb['role'][_0x6933('0x19')]:!_['isNil'](_0x4339bb['first_name'])?_0x4339bb['first_name']+'\x20'+_0x4339bb[_0x6933('0x44')]:_0x4339bb[_0x6933('0x44')],'id':_0x4339bb['id']}}]},'headers':{'Authorization':_0x6933('0x35')+_0x5e3b7c},'json':!![]})[_0x6933('0x29')](function(_0x240cf0){if(_0x240cf0&&_0x240cf0[_0x6933('0x45')][0x0][_0x6933('0x46')]==='SUCCESS'){var _0x2786d8=_0x240cf0[_0x6933('0x45')][0x0]['details'];_0x2786d8[_0x6933('0x3f')]=_[_0x6933('0x42')](_0x2ecf4d[_0x6933('0x43')])+'s';return _0x2786d8;}logger[_0x6933('0x2d')](_0x6933('0x3d'),JSON[_0x6933('0xd')](data));throw new Error('Error:\x20'+JSON[_0x6933('0xd')](data));})[_0x6933('0x2c')](function(_0xdacdf2){console[_0x6933('0x47')](_0x6933('0x48'),_0xdacdf2);});}function getEndUser(_0x37d0f7,_0x34cb0e,_0x295b74,_0x10b51f,_0x4c6148,_0x42f296,_0x23a610){var _0x5cd8b0={'method':_0x6933('0x32'),'uri':'','headers':{'Authorization':_0x6933('0x35')+_0x37d0f7},'json':!![]};switch(_0x23a610[_0x6933('0x49')]){case'contact_lead':_0x5cd8b0[_0x6933('0x4a')]=_0x6933('0x40')+_0x34cb0e+_0x6933('0x4b')+_0x4c6148+'))';return getZohoUser(_0x5cd8b0,_0x6933('0x4c'))[_0x6933('0x29')](function(_0x3cb20c){if(_0x3cb20c)return _0x3cb20c;_0x5cd8b0['uri']=_0x6933('0x40')+_0x34cb0e+_0x6933('0x4d')+_0x4c6148+'))';return getZohoUser(_0x5cd8b0,_0x6933('0x4e'))[_0x6933('0x29')](function(_0x92770){if(_0x92770)return _0x92770;if(_0x23a610['moduleCreate']!=_0x6933('0x4f')){return createEndUser(_0x37d0f7,_0x34cb0e,_0x10b51f,_0x4c6148,_0x42f296,_0x23a610);}else{return{};}});});break;case _0x6933('0x50'):_0x5cd8b0[_0x6933('0x4a')]=_0x6933('0x40')+_0x34cb0e+_0x6933('0x4b')+_0x4c6148+'))';return getZohoUser(_0x5cd8b0,_0x6933('0x4c'))[_0x6933('0x29')](function(_0x163ad5){if(_0x163ad5)return _0x163ad5;if(_0x23a610[_0x6933('0x43')]!='nothing'){return createEndUser(_0x37d0f7,_0x34cb0e,_0x10b51f,_0x4c6148,_0x42f296,_0x23a610);}else{return{};}});break;case _0x6933('0x51'):_0x5cd8b0[_0x6933('0x4a')]=_0x6933('0x40')+_0x34cb0e+_0x6933('0x4d')+_0x4c6148+'))';return getZohoUser(_0x5cd8b0,'Leads')[_0x6933('0x29')](function(_0x122f85){if(_0x122f85)return _0x122f85;if(_0x23a610[_0x6933('0x43')]!=_0x6933('0x4f')){return createEndUser(_0x37d0f7,_0x34cb0e,_0x10b51f,_0x4c6148,_0x42f296,_0x23a610);}else{return{};}});break;}}function getCall(_0x5296a8,_0x27fe76,_0x1ae3f0,_0x4c5ea8,_0x2a351f,_0x27b971,_0xe72b07,_0x54439a){logger[_0x6933('0x30')]('Creating\x20new\x20call...');var _0x3acef4={};_0x3acef4[_0x6933('0x52')]={'name':!_[_0x6933('0x1d')](_0x4c5ea8['role']['name'])&&!_[_0x6933('0x1d')](_0x4c5ea8[_0x6933('0x53')][_0x6933('0x19')])&&_0x4c5ea8[_0x6933('0x53')][_0x6933('0x19')]==='administrator'?_0x4c5ea8[_0x6933('0x54')][_0x6933('0x19')]:!_[_0x6933('0x1d')](_0x4c5ea8['first_name'])?_0x4c5ea8[_0x6933('0x55')]+'\x20'+_0x4c5ea8[_0x6933('0x44')]:_0x4c5ea8[_0x6933('0x44')],'id':_0x4c5ea8['id']};_0x3acef4[_0x6933('0x56')]=intUtil['getString'](_0x27b971[_0x6933('0x57')],_0xe72b07,'\x20');_0x3acef4[_0x6933('0x58')]=intUtil['getString'](_0x27b971['Descriptions'],_0xe72b07,'\x0a');if(_0x2a351f[_0x6933('0x3f')]==='Contacts'){_0x3acef4['Who_Id']={'name':!_[_0x6933('0x1d')](_0x2a351f['Full_Name'])?_0x2a351f['Full_Name']:!_[_0x6933('0x1d')](_0x2a351f[_0x6933('0x59')])?_0x2a351f[_0x6933('0x59')]+'\x20'+_0x2a351f[_0x6933('0x5a')]:_0x2a351f[_0x6933('0x5a')],'id':_0x2a351f['id']};}if(_0x2a351f[_0x6933('0x3f')]===_0x6933('0x4e')){_0x3acef4[_0x6933('0x5b')]={'name':!_['isNil'](_0x2a351f[_0x6933('0x5c')])?_0x2a351f[_0x6933('0x5c')]:!_[_0x6933('0x1d')](_0x2a351f[_0x6933('0x59')])?_0x2a351f[_0x6933('0x59')]+'\x20'+_0x2a351f[_0x6933('0x5a')]:_0x2a351f[_0x6933('0x5a')],'id':_0x2a351f['id']};_0x3acef4[_0x6933('0x5d')]=_[_0x6933('0x42')](_0x2a351f[_0x6933('0x3f')]);}if(_0xe72b07[_0x6933('0x5e')]){_0x3acef4[_0x6933('0x5f')]=moment[_0x6933('0x60')](parseInt(_0xe72b07[_0x6933('0x5e')])*0x3e8)['format']('mm:ss');}else if(_0xe72b07['answertime']&&_0xe72b07[_0x6933('0x61')]){_0x3acef4[_0x6933('0x5f')]=moment[_0x6933('0x60')](moment(_0xe72b07['endtime'],_0x6933('0x62'))[_0x6933('0x63')](moment(_0xe72b07['starttime'],_0x6933('0x62'))))[_0x6933('0x64')](_0x6933('0x65'));}switch(_0xe72b07[_0x6933('0x66')]){case _0x6933('0x67'):_0x3acef4[_0x6933('0x68')]=_0x6933('0x69');break;case _0x6933('0x6a'):case _0x6933('0x6b'):_0x3acef4['Call_Result']=_0x6933('0x6c');break;case'rejected':_0x3acef4[_0x6933('0x68')]=_0x6933('0x6d');break;case _0x6933('0x6e'):_0x3acef4[_0x6933('0x68')]=_0x6933('0x6f');break;case _0x6933('0x70'):_0x3acef4['Call_Result']='Timeout';default:}_0x3acef4[_0x6933('0x71')]=(_0x54439a===_0x6933('0x72')?moment(_0xe72b07[_0x6933('0x73')])[_0x6933('0x64')](_0x6933('0x62')):moment(_0xe72b07[_0x6933('0x74')])[_0x6933('0x64')](_0x6933('0x62')))||moment()[_0x6933('0x64')]('YYYY-MM-DDTHH:mm:ss');_0x3acef4[_0x6933('0x75')]=_0x54439a||_0x6933('0x76');_0x3acef4=_[_0x6933('0x77')](_0x3acef4,getCustomFields(_0x27b971[_0x6933('0x78')],_0xe72b07));return request({'method':_0x6933('0x79'),'uri':'https://www.zohoapis.'+_0x27fe76+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5296a8},'body':{'data':[_0x3acef4]},'json':!![]})[_0x6933('0x29')](function(_0x1e7e27){if(_0x1e7e27&&_0x1e7e27['data'][0x0][_0x6933('0x46')]===_0x6933('0x7a')){logger[_0x6933('0x30')](_0x6933('0x7b'));return{'id':_0x1e7e27[_0x6933('0x45')][0x0]['details']['id']};}})['catch'](function(_0x44f99e){logger[_0x6933('0x30')](_0x6933('0x7c'),_0x44f99e[_0x6933('0x2f')]);console[_0x6933('0x47')](_0x6933('0x7c'),_0x44f99e);});}exports[_0x6933('0x7d')]=function(_0x107901,_0xf6a516,_0x4c57d0,_0x2fc20b,_0x361ddf,_0x3c193c){var _0xa25e3c,_0x1651a1,_0x608e6;_0x3c193c[_0x6933('0x7e')]=intUtil[_0x6933('0x7f')](_0x3c193c[_0x6933('0x7e')]);_0x3c193c['serverUrl']=intUtil[_0x6933('0x7f')](_0x3c193c['serverUrl']);if(_0x361ddf&&_0x361ddf['monitor_format']){logger[_0x6933('0x30')](_0x6933('0x80'),'Recording\x20is\x20enabled!');_0xf6a516[_0x6933('0x81')]=_0x3c193c[_0x6933('0x82')]+_0x6933('0x83')+_0xf6a516[_0x6933('0x84')]+_0x6933('0x85')+md5(_0xf6a516[_0x6933('0x84')]);}else{_0xf6a516[_0x6933('0x81')]='';}var _0x4a2f9f=_0x3c193c[_0x6933('0x7e')]===_0x6933('0x86')?'eu':'com';return getAccessToken(_0x3c193c)['then'](function(_0x5f45cf){_0x608e6=_0x5f45cf;return getUser(_0x608e6,_0x4a2f9f,_0x3c193c,_0x2fc20b[_0x6933('0x38')]);})[_0x6933('0x29')](function(_0x5a557f){_0xa25e3c=_0x5a557f;logger[_0x6933('0x30')](_0x6933('0x87'),_0xa25e3c['id']);return getEndUser(_0x608e6,_0x4a2f9f,_0x3c193c,_0xf6a516['calleridname'],_0xf6a516[_0x6933('0x88')],_0xa25e3c,_0x4c57d0);})[_0x6933('0x29')](function(_0xed7c71){_0x1651a1=_0xed7c71;return getCall(_0x608e6,_0x4a2f9f,_0x3c193c,_0xa25e3c,_0x1651a1,_0x4c57d0,_0xf6a516,_0x6933('0x76'));})[_0x6933('0x29')](function(_0x192b88){if(_0x192b88){logger[_0x6933('0x30')]('The\x20Call\x20ID\x20is:',_0x192b88['id']);logger[_0x6933('0x30')](_0x6933('0x80'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x6933('0x89'),_0x2fc20b[_0x6933('0x19')]),_0x6933('0x8a'),{'uri':_0x6933('0x8b')+_0x3c193c[_0x6933('0x7e')]+_0x6933('0x8c')+_0x192b88['id']});}})[_0x6933('0x2c')](function(_0x5d6c82){logger[_0x6933('0x2d')](_0x6933('0x80'),JSON[_0x6933('0xd')](_0x5d6c82));});};exports[_0x6933('0x72')]=function(_0x2f2c42,_0x3364eb,_0x3650ad,_0x52937b,_0x28fabb,_0x34c9ad,_0x29c00c){var _0x39dfea,_0xa002cd,_0x3230e3;_0x34c9ad[_0x6933('0x7e')]=intUtil['stripTrailingSlash'](_0x34c9ad[_0x6933('0x7e')]);_0x34c9ad[_0x6933('0x82')]=intUtil[_0x6933('0x7f')](_0x34c9ad[_0x6933('0x82')]);if(_0x29c00c&&_0x29c00c[_0x6933('0x8d')]&&_0x29c00c[_0x6933('0x8d')]!=='none'){logger[_0x6933('0x30')](_0x6933('0x8e'),_0x6933('0x8f'));_0x3364eb[_0x6933('0x81')]=_0x34c9ad[_0x6933('0x82')]+_0x6933('0x83')+_0x3364eb[_0x6933('0x84')]+'/downloads?type=uniqueid&token='+md5(_0x3364eb['uniqueid']);}var _0x227474=_0x34c9ad['host']===_0x6933('0x86')?'eu':'com';return getAccessToken(_0x34c9ad)[_0x6933('0x29')](function(_0x4658c6){_0x3230e3=_0x4658c6;return getUser(_0x3230e3,_0x227474,_0x34c9ad,_0x52937b[_0x6933('0x38')]);})[_0x6933('0x29')](function(_0xbb2f4b){_0x39dfea=_0xbb2f4b;logger[_0x6933('0x30')](_0x6933('0x87'),_0x39dfea['id']);return getEndUser(_0x3230e3,_0x227474,_0x34c9ad,_0x3364eb[_0x6933('0x90')],_0x3364eb[_0x6933('0x91')],_0x39dfea,_0x3650ad);})[_0x6933('0x29')](function(_0x1668bc){_0xa002cd=_0x1668bc;return getCall(_0x3230e3,_0x227474,_0x34c9ad,_0x39dfea,_0xa002cd,_0x3650ad,_0x3364eb,_0x6933('0x92'));})['then'](function(_0x282275){if(_0x282275){logger['info']('The\x20Call\x20ID\x20is:',_0x282275['id']);logger[_0x6933('0x30')](_0x6933('0x8e'),_0x6933('0x93'));emit(util[_0x6933('0x64')]('user:%s',_0x52937b['name']),_0x6933('0x8a'),{'uri':'https://crm.'+_0x34c9ad['host']+_0x6933('0x8c')+_0x282275['id']});}})[_0x6933('0x2c')](function(_0xb7666b){logger[_0x6933('0x2d')](_0x6933('0x8e'),JSON[_0x6933('0xd')](_0xb7666b));});};exports['unmanaged']=function(_0x5a1a30,_0x21cf44,_0x471e7e,_0x4adcea,_0x49ba7f,_0x1fd334){var _0x476a62,_0x2b436b,_0x5701c9;_0x1fd334[_0x6933('0x7e')]=intUtil['stripTrailingSlash'](_0x1fd334['host']);_0x1fd334['serverUrl']=intUtil[_0x6933('0x7f')](_0x1fd334[_0x6933('0x82')]);if(_0x49ba7f&&_0x49ba7f[_0x6933('0x94')]){logger[_0x6933('0x30')]('['+_0x21cf44['lastevent'][_0x6933('0x95')]()+']','Recording\x20is\x20enabled!');_0x21cf44[_0x6933('0x81')]=_0x1fd334['serverUrl']+_0x6933('0x83')+_0x21cf44[_0x6933('0x84')]+'/downloads?type=uniqueid&token='+md5(_0x21cf44[_0x6933('0x84')]);}else{_0x21cf44[_0x6933('0x81')]='';}var _0x409dd5=_0x1fd334[_0x6933('0x7e')]===_0x6933('0x86')?'eu':_0x6933('0x96');return getAccessToken(_0x1fd334)[_0x6933('0x29')](function(_0x46590a){_0x5701c9=_0x46590a;return getUser(_0x5701c9,_0x409dd5,_0x1fd334);})[_0x6933('0x29')](function(_0x22b958){_0x476a62=_0x22b958;logger[_0x6933('0x30')]('The\x20User\x20ID\x20is:',_0x476a62['id']);return getEndUser(_0x5701c9,_0x409dd5,_0x1fd334,_0x21cf44[_0x6933('0x97')],_0x21cf44[_0x6933('0x88')],_0x476a62,_0x471e7e);})[_0x6933('0x29')](function(_0x5dba5a){_0x2b436b=_0x5dba5a;return getCall(_0x5701c9,_0x409dd5,_0x1fd334,_0x476a62,_0x2b436b,_0x471e7e,_0x21cf44,_0x6933('0x76'));})[_0x6933('0x29')](function(_0x2f01ee){if(_0x2f01ee){logger[_0x6933('0x30')](_0x6933('0x98'),_0x2f01ee['id']);}})['catch'](function(_0x496e84){logger[_0x6933('0x2d')]('['+_0x21cf44[_0x6933('0x66')]['toUpperCase']()+']',JSON[_0x6933('0xd')](_0x496e84));});}; \ No newline at end of file +var _0x3f49=['Variable','name','isNil','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','format','ActiveUsers','then','isArrayLikeObject','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','profile','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','SUCCESS','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','administrator','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','details','err','queue','host','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','serverUrl','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','zoho.eu','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','user:%s','/crm/EntityInfo.do?module=Calls&id=','lastevent','toUpperCase','lodash','request-promise','util','./util','moment','bluebird','../../../../config/environment','redis','defaults','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','variable','variableName','toString','customVariable'];(function(_0x481e32,_0x56ed98){var _0x5df6fb=function(_0x48375a){while(--_0x48375a){_0x481e32['push'](_0x481e32['shift']());}};_0x5df6fb(++_0x56ed98);}(_0x3f49,0x11f));var _0x93f4=function(_0x5d5793,_0x45a6f8){_0x5d5793=_0x5d5793-0x0;var _0x571838=_0x3f49[_0x5d5793];return _0x571838;};'use strict';var _=require(_0x93f4('0x0'));var rp=require(_0x93f4('0x1'));var md5=require('md5');var util=require(_0x93f4('0x2'));var intUtil=require(_0x93f4('0x3'));var moment=require(_0x93f4('0x4'));var Redis=require('ioredis');var BPromise=require(_0x93f4('0x5'));var config=require(_0x93f4('0x6'));var logger=require('../../../../config/logger')('zoho');config[_0x93f4('0x7')]=_[_0x93f4('0x8')](config[_0x93f4('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x93f4('0x9'))(new Redis(config['redis']));function emit(_0x144f31,_0x5e5b4d,_0x17b4fd){io['to'](_0x144f31)[_0x93f4('0xa')](_0x5e5b4d,_0x17b4fd);}function request(_0x325984){logger[_0x93f4('0xb')](_0x93f4('0xc'),JSON[_0x93f4('0xd')](_0x325984));return rp(_0x325984);}function getCustomFields(_0x4a7b76,_0x506b51){var _0x2c9257={};if(_0x4a7b76[_0x93f4('0xe')]>0x0){_[_0x93f4('0xf')](_0x4a7b76,function(_0x45e6e1){if(_[_0x93f4('0x10')]([_0x93f4('0x11'),_0x93f4('0x12')],_0x45e6e1[_0x93f4('0x13')])&&_0x45e6e1['idField']){_0x2c9257[_0x45e6e1[_0x93f4('0x14')]]=_0x45e6e1['content']['toString']();}else if(_0x45e6e1[_0x93f4('0x13')]===_0x93f4('0x15')&&_0x45e6e1[_0x93f4('0x16')]&&_0x45e6e1['idField']&&_0x506b51[_0x45e6e1['variableName']]){_0x2c9257[_0x45e6e1[_0x93f4('0x14')]]=_0x506b51[_0x45e6e1[_0x93f4('0x16')]][_0x93f4('0x17')]();}else if(_0x45e6e1['type']===_0x93f4('0x18')&&_0x45e6e1[_0x93f4('0x19')]&&_0x45e6e1['Variable'][_0x93f4('0x1a')]&&_0x45e6e1['idField']&&_0x506b51[_0x45e6e1['Variable'][_0x93f4('0x1a')]['toLowerCase']()]){_0x2c9257[_0x45e6e1[_0x93f4('0x14')]]=_0x506b51[_0x45e6e1['Variable']['name']['toLowerCase']()][_0x93f4('0x17')]();}});}return _0x2c9257;}function getName(_0x2cd6a6){if(_0x2cd6a6['indexOf']('\x20')>0x0){var _0x1ef4b3=_0x2cd6a6['split'](/ (.+)/);if(_0x1ef4b3[0x1]){return _0x1ef4b3;}}return[_0x2cd6a6,_0x2cd6a6];}var accountsTokens={};function getAccessToken(_0x3ead08){return new Promise(function(_0x3182d6,_0xfb95e3){if(!_[_0x93f4('0x1b')](accountsTokens[_0x3ead08['id']])&&!_['isNil'](accountsTokens[_0x3ead08['id']]['access_token'])){if(moment()[_0x93f4('0x1c')](accountsTokens[_0x3ead08['id']][_0x93f4('0x1d')])){_0x3182d6(accountsTokens[_0x3ead08['id']]['access_token']);}}var _0x58f8fd;switch(_0x3ead08['zone']){case'US':_0x58f8fd=_0x93f4('0x1e');break;case'AU':_0x58f8fd=_0x93f4('0x1f');break;case'EU':_0x58f8fd=_0x93f4('0x20');break;case'IN':_0x58f8fd='https://accounts.zoho.in';break;case'CN':_0x58f8fd=_0x93f4('0x21');break;default:_0x58f8fd='https://accounts.zoho.eu';break;}var _0x20e337={'method':_0x93f4('0x22'),'uri':_0x58f8fd+'/oauth/v2/token','qs':{'refresh_token':_0x3ead08[_0x93f4('0x23')],'client_id':_0x3ead08[_0x93f4('0x24')],'client_secret':_0x3ead08[_0x93f4('0x25')],'grant_type':_0x93f4('0x26')},'json':!![]};return rp(_0x20e337)['then'](function(_0x454b5b){accountsTokens[_0x3ead08['id']]={'access_token':_0x454b5b[_0x93f4('0x27')],'expires_in':moment()[_0x93f4('0x28')](_0x454b5b[_0x93f4('0x1d')],'seconds')};_0x3182d6(_0x454b5b[_0x93f4('0x27')]);})[_0x93f4('0x29')](function(_0x30606b){logger[_0x93f4('0x2a')](_0x93f4('0x2b'),_0x30606b[_0x93f4('0x2c')]);_0xfb95e3(_0x30606b);});});}function getUser(_0x47776e,_0x2fce95,_0x501c27,_0x1fff66){logger[_0x93f4('0x2d')]('Search\x20user');return request({'method':'GET','uri':util[_0x93f4('0x2e')]('https://www.zohoapis.%s/crm/v2/users',_0x2fce95),'qs':{'type':_0x93f4('0x2f')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x47776e},'json':!![]})[_0x93f4('0x30')](function(_0x4ba18d){if(_0x4ba18d['users']){var _0x277267=-0x1;if(_[_0x93f4('0x31')](_0x4ba18d[_0x93f4('0x32')])){if(!_['isNil'](_0x1fff66)){_0x277267=_[_0x93f4('0x33')](_0x4ba18d[_0x93f4('0x32')],function(_0x19fa20){return _0x19fa20[_0x93f4('0x34')]===_0x1fff66;});}if(_0x277267>=0x0){logger[_0x93f4('0x2d')](_0x93f4('0x35'));}else{logger[_0x93f4('0x2d')](_0x93f4('0x36'));_0x277267=_['findIndex'](_0x4ba18d[_0x93f4('0x32')],function(_0x311875){return _0x311875['profile'][_0x93f4('0x1a')]===_0x93f4('0x37');});}return _0x4ba18d['users'][_0x277267];}else{if(_0x4ba18d['user'][_0x93f4('0x38')][_0x93f4('0x1a')]===_0x93f4('0x37')){logger[_0x93f4('0x2d')](_0x93f4('0x36'));user=_0x4ba18d[_0x93f4('0x39')];return user;}else{logger[_0x93f4('0x2a')](_0x93f4('0x3a'),JSON[_0x93f4('0xd')](_0x4ba18d));throw new Error(_0x93f4('0x3b')+JSON[_0x93f4('0xd')](_0x4ba18d));}}}else{logger[_0x93f4('0x2a')](_0x93f4('0x3a'),JSON[_0x93f4('0xd')](_0x4ba18d));throw new Error(_0x93f4('0x3b')+JSON[_0x93f4('0xd')](_0x4ba18d));}})[_0x93f4('0x29')](function(_0x31468d){console['error'](_0x31468d);});}function getZohoUser(_0x3eb431,_0x4c0f9f){return new BPromise(function(_0x3d3a19,_0x3c3056){request(_0x3eb431)[_0x93f4('0x30')](function(_0x135712){var _0x44c9a5=null;if(_0x135712){_0x44c9a5=_0x135712[_0x93f4('0x3c')][0x0];_0x44c9a5[_0x93f4('0x3d')]=_0x4c0f9f;}_0x3d3a19(_0x44c9a5);})[_0x93f4('0x29')](function(_0x12007e){_0x3c3056(_0x12007e);});});}function createEndUser(_0x11b716,_0x20b814,_0x1cff88,_0x1fdf49,_0x36482e,_0x2e527c){var _0x1cff88=getName(_0x1cff88);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x20b814+_0x93f4('0x3e')+_[_0x93f4('0x3f')](_0x2e527c[_0x93f4('0x40')])+'s','body':{'data':[{'Last_Name':_0x1cff88[0x1],'First_Name':_0x1cff88[0x0],'Phone':_0x1fdf49,'Owner':{'name':!_[_0x93f4('0x1b')](_0x36482e['role'][_0x93f4('0x1a')])?_0x36482e[_0x93f4('0x41')][_0x93f4('0x1a')]:!_[_0x93f4('0x1b')](_0x36482e[_0x93f4('0x42')])?_0x36482e[_0x93f4('0x42')]+'\x20'+_0x36482e[_0x93f4('0x43')]:_0x36482e[_0x93f4('0x43')],'id':_0x36482e['id']}}]},'headers':{'Authorization':_0x93f4('0x44')+_0x11b716},'json':!![]})[_0x93f4('0x30')](function(_0x56329b){if(_0x56329b&&_0x56329b[_0x93f4('0x3c')][0x0]['code']===_0x93f4('0x45')){var _0x1135ca=_0x56329b[_0x93f4('0x3c')][0x0]['details'];_0x1135ca[_0x93f4('0x3d')]=_[_0x93f4('0x3f')](_0x2e527c[_0x93f4('0x40')])+'s';return _0x1135ca;}logger[_0x93f4('0x2a')]('The\x20failing\x20result\x20is',JSON[_0x93f4('0xd')](data));throw new Error(_0x93f4('0x46')+JSON[_0x93f4('0xd')](data));})['catch'](function(_0x44410d){console[_0x93f4('0x47')](_0x93f4('0x48'),_0x44410d);});}function getEndUser(_0x32e941,_0x446d62,_0x1c121c,_0x266967,_0x7b0d18,_0x1131e1,_0x330a99){var _0x19b1a5={'method':_0x93f4('0x49'),'uri':'','headers':{'Authorization':_0x93f4('0x44')+_0x32e941},'json':!![]};switch(_0x330a99[_0x93f4('0x4a')]){case _0x93f4('0x4b'):_0x19b1a5['uri']=_0x93f4('0x4c')+_0x446d62+_0x93f4('0x4d')+_0x7b0d18+'))';return getZohoUser(_0x19b1a5,_0x93f4('0x4e'))[_0x93f4('0x30')](function(_0x248bdf){if(_0x248bdf)return _0x248bdf;_0x19b1a5[_0x93f4('0x4f')]='https://www.zohoapis.'+_0x446d62+_0x93f4('0x50')+_0x7b0d18+'))';return getZohoUser(_0x19b1a5,_0x93f4('0x51'))['then'](function(_0x171439){if(_0x171439)return _0x171439;if(_0x330a99[_0x93f4('0x40')]!=_0x93f4('0x52')){return createEndUser(_0x32e941,_0x446d62,_0x266967,_0x7b0d18,_0x1131e1,_0x330a99);}else{return{};}});});break;case _0x93f4('0x53'):_0x19b1a5['uri']=_0x93f4('0x4c')+_0x446d62+_0x93f4('0x4d')+_0x7b0d18+'))';return getZohoUser(_0x19b1a5,_0x93f4('0x4e'))['then'](function(_0x2d4270){if(_0x2d4270)return _0x2d4270;if(_0x330a99[_0x93f4('0x40')]!=_0x93f4('0x52')){return createEndUser(_0x32e941,_0x446d62,_0x266967,_0x7b0d18,_0x1131e1,_0x330a99);}else{return{};}});break;case _0x93f4('0x54'):_0x19b1a5['uri']='https://www.zohoapis.'+_0x446d62+_0x93f4('0x50')+_0x7b0d18+'))';return getZohoUser(_0x19b1a5,_0x93f4('0x51'))[_0x93f4('0x30')](function(_0x3247cf){if(_0x3247cf)return _0x3247cf;if(_0x330a99[_0x93f4('0x40')]!=_0x93f4('0x52')){return createEndUser(_0x32e941,_0x446d62,_0x266967,_0x7b0d18,_0x1131e1,_0x330a99);}else{return{};}});break;}}function getCall(_0x340f19,_0x58535f,_0x2cb1d3,_0xe3ca3d,_0x917aa3,_0x458323,_0x247f0b,_0x340d52){logger[_0x93f4('0x2d')](_0x93f4('0x55'));var _0x523c95={};_0x523c95['Owner']={'name':!_['isNil'](_0xe3ca3d[_0x93f4('0x41')][_0x93f4('0x1a')])&&!_[_0x93f4('0x1b')](_0xe3ca3d[_0x93f4('0x38')]['name'])&&_0xe3ca3d[_0x93f4('0x38')][_0x93f4('0x1a')]===_0x93f4('0x56')?_0xe3ca3d[_0x93f4('0x41')][_0x93f4('0x1a')]:!_['isNil'](_0xe3ca3d[_0x93f4('0x42')])?_0xe3ca3d[_0x93f4('0x42')]+'\x20'+_0xe3ca3d[_0x93f4('0x43')]:_0xe3ca3d['last_name'],'id':_0xe3ca3d['id']};_0x523c95['Subject']=intUtil[_0x93f4('0x57')](_0x458323['Subjects'],_0x247f0b,'\x20');_0x523c95[_0x93f4('0x58')]=intUtil[_0x93f4('0x57')](_0x458323[_0x93f4('0x59')],_0x247f0b,'\x0a');if(_0x917aa3[_0x93f4('0x3d')]===_0x93f4('0x4e')){_0x523c95[_0x93f4('0x5a')]={'name':!_[_0x93f4('0x1b')](_0x917aa3[_0x93f4('0x5b')])?_0x917aa3[_0x93f4('0x5b')]:!_[_0x93f4('0x1b')](_0x917aa3[_0x93f4('0x5c')])?_0x917aa3[_0x93f4('0x5c')]+'\x20'+_0x917aa3[_0x93f4('0x5d')]:_0x917aa3[_0x93f4('0x5d')],'id':_0x917aa3['id']};}if(_0x917aa3[_0x93f4('0x3d')]==='Leads'){_0x523c95[_0x93f4('0x5e')]={'name':!_[_0x93f4('0x1b')](_0x917aa3[_0x93f4('0x5b')])?_0x917aa3[_0x93f4('0x5b')]:!_[_0x93f4('0x1b')](_0x917aa3[_0x93f4('0x5c')])?_0x917aa3[_0x93f4('0x5c')]+'\x20'+_0x917aa3[_0x93f4('0x5d')]:_0x917aa3[_0x93f4('0x5d')],'id':_0x917aa3['id']};_0x523c95['$se_module']=_[_0x93f4('0x3f')](_0x917aa3[_0x93f4('0x3d')]);}if(_0x247f0b[_0x93f4('0x5f')]){_0x523c95[_0x93f4('0x60')]=moment[_0x93f4('0x61')](parseInt(_0x247f0b[_0x93f4('0x5f')])*0x3e8)[_0x93f4('0x2e')](_0x93f4('0x62'));}else if(_0x247f0b[_0x93f4('0x63')]&&_0x247f0b[_0x93f4('0x64')]){_0x523c95[_0x93f4('0x60')]=moment[_0x93f4('0x61')](moment(_0x247f0b[_0x93f4('0x64')],_0x93f4('0x65'))[_0x93f4('0x66')](moment(_0x247f0b[_0x93f4('0x67')],_0x93f4('0x65'))))[_0x93f4('0x2e')](_0x93f4('0x62'));}switch(_0x247f0b['lastevent']){case _0x93f4('0x68'):_0x523c95[_0x93f4('0x69')]=_0x93f4('0x6a');break;case _0x93f4('0x6b'):case'connect':_0x523c95[_0x93f4('0x69')]=_0x93f4('0x6c');break;case _0x93f4('0x6d'):_0x523c95[_0x93f4('0x69')]=_0x93f4('0x6e');break;case _0x93f4('0x6f'):_0x523c95[_0x93f4('0x69')]=_0x93f4('0x70');break;case _0x93f4('0x71'):_0x523c95[_0x93f4('0x69')]=_0x93f4('0x72');default:}_0x523c95[_0x93f4('0x73')]=(_0x340d52===_0x93f4('0x74')?moment(_0x247f0b[_0x93f4('0x67')])[_0x93f4('0x2e')](_0x93f4('0x65')):moment(_0x247f0b[_0x93f4('0x75')])['format'](_0x93f4('0x65')))||moment()[_0x93f4('0x2e')]('YYYY-MM-DDTHH:mm:ss');_0x523c95[_0x93f4('0x76')]=_0x340d52||_0x93f4('0x77');_0x523c95=_[_0x93f4('0x78')](_0x523c95,getCustomFields(_0x458323[_0x93f4('0x79')],_0x247f0b));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x58535f+_0x93f4('0x7a'),'headers':{'Authorization':_0x93f4('0x44')+_0x340f19},'body':{'data':[_0x523c95]},'json':!![]})[_0x93f4('0x30')](function(_0x49d3fb){if(_0x49d3fb&&_0x49d3fb['data'][0x0]['code']===_0x93f4('0x45')){logger[_0x93f4('0x2d')](_0x93f4('0x7b'));return{'id':_0x49d3fb[_0x93f4('0x3c')][0x0][_0x93f4('0x7c')]['id']};}})[_0x93f4('0x29')](function(_0x3c8e2b){logger[_0x93f4('0x2d')]('err',_0x3c8e2b[_0x93f4('0x2c')]);console['log'](_0x93f4('0x7d'),_0x3c8e2b);});}exports[_0x93f4('0x7e')]=function(_0x227b33,_0x233bfb,_0x16d908,_0x2253c1,_0x33954e,_0xc56381){var _0x2cb299,_0x223fed,_0x18543a;_0xc56381[_0x93f4('0x7f')]=intUtil[_0x93f4('0x80')](_0xc56381[_0x93f4('0x7f')]);_0xc56381['serverUrl']=intUtil[_0x93f4('0x80')](_0xc56381['serverUrl']);if(_0x33954e&&_0x33954e[_0x93f4('0x81')]){logger[_0x93f4('0x2d')](_0x93f4('0x82'),_0x93f4('0x83'));_0x233bfb[_0x93f4('0x84')]=_0xc56381['serverUrl']+'/api/voice/recordings/'+_0x233bfb[_0x93f4('0x85')]+_0x93f4('0x86')+md5(_0x233bfb[_0x93f4('0x85')]);}else{_0x233bfb['recordingURL']='';}var _0x2b95e4=_0xc56381[_0x93f4('0x7f')]==='zoho.eu'?'eu':_0x93f4('0x87');return getAccessToken(_0xc56381)[_0x93f4('0x30')](function(_0x4f2847){_0x18543a=_0x4f2847;return getUser(_0x18543a,_0x2b95e4,_0xc56381,_0x2253c1[_0x93f4('0x34')]);})['then'](function(_0x76ea77){_0x2cb299=_0x76ea77;logger[_0x93f4('0x2d')]('The\x20User\x20ID\x20is:',_0x2cb299['id']);return getEndUser(_0x18543a,_0x2b95e4,_0xc56381,_0x233bfb[_0x93f4('0x88')],_0x233bfb[_0x93f4('0x89')],_0x2cb299,_0x16d908);})['then'](function(_0x1d1a53){_0x223fed=_0x1d1a53;return getCall(_0x18543a,_0x2b95e4,_0xc56381,_0x2cb299,_0x223fed,_0x16d908,_0x233bfb,_0x93f4('0x77'));})['then'](function(_0x3d10b8){if(_0x3d10b8){logger[_0x93f4('0x2d')](_0x93f4('0x8a'),_0x3d10b8['id']);logger['info'](_0x93f4('0x82'),_0x93f4('0x8b'));emit(util[_0x93f4('0x2e')]('user:%s',_0x2253c1[_0x93f4('0x1a')]),_0x93f4('0x8c'),{'uri':_0x93f4('0x8d')+_0xc56381['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x3d10b8['id']});}})[_0x93f4('0x29')](function(_0x16df63){logger[_0x93f4('0x2a')](_0x93f4('0x82'),JSON[_0x93f4('0xd')](_0x16df63));});};exports[_0x93f4('0x74')]=function(_0x48a0eb,_0x7cabb6,_0x57c19a,_0x1f44f9,_0x77539,_0xe720c2,_0x4fe789){var _0x2ac436,_0x110c32,_0x59bef8;_0xe720c2[_0x93f4('0x7f')]=intUtil[_0x93f4('0x80')](_0xe720c2[_0x93f4('0x7f')]);_0xe720c2[_0x93f4('0x8e')]=intUtil[_0x93f4('0x80')](_0xe720c2[_0x93f4('0x8e')]);if(_0x4fe789&&_0x4fe789[_0x93f4('0x8f')]&&_0x4fe789[_0x93f4('0x8f')]!==_0x93f4('0x90')){logger['info'](_0x93f4('0x91'),'Recording\x20is\x20enabled!');_0x7cabb6['recordingURL']=_0xe720c2[_0x93f4('0x8e')]+_0x93f4('0x92')+_0x7cabb6[_0x93f4('0x85')]+'/downloads?type=uniqueid&token='+md5(_0x7cabb6[_0x93f4('0x85')]);}var _0x1a016e=_0xe720c2['host']===_0x93f4('0x93')?'eu':_0x93f4('0x87');return getAccessToken(_0xe720c2)[_0x93f4('0x30')](function(_0x53290e){_0x59bef8=_0x53290e;return getUser(_0x59bef8,_0x1a016e,_0xe720c2,_0x1f44f9[_0x93f4('0x34')]);})[_0x93f4('0x30')](function(_0x583909){_0x2ac436=_0x583909;logger[_0x93f4('0x2d')](_0x93f4('0x94'),_0x2ac436['id']);return getEndUser(_0x59bef8,_0x1a016e,_0xe720c2,_0x7cabb6[_0x93f4('0x95')],_0x7cabb6[_0x93f4('0x96')],_0x2ac436,_0x57c19a);})['then'](function(_0x38ef38){_0x110c32=_0x38ef38;return getCall(_0x59bef8,_0x1a016e,_0xe720c2,_0x2ac436,_0x110c32,_0x57c19a,_0x7cabb6,_0x93f4('0x97'));})[_0x93f4('0x30')](function(_0x21ebcc){if(_0x21ebcc){logger['info'](_0x93f4('0x8a'),_0x21ebcc['id']);logger[_0x93f4('0x2d')](_0x93f4('0x91'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x93f4('0x98'),_0x1f44f9['name']),_0x93f4('0x8c'),{'uri':_0x93f4('0x8d')+_0xe720c2[_0x93f4('0x7f')]+_0x93f4('0x99')+_0x21ebcc['id']});}})['catch'](function(_0x317306){logger[_0x93f4('0x2a')](_0x93f4('0x91'),JSON[_0x93f4('0xd')](_0x317306));});};exports['unmanaged']=function(_0x4ceeee,_0x173518,_0x5e922c,_0x5dec58,_0x71055e,_0x9f32a1){var _0x62b4c5,_0x3f0bc7,_0xa80270;_0x9f32a1[_0x93f4('0x7f')]=intUtil[_0x93f4('0x80')](_0x9f32a1[_0x93f4('0x7f')]);_0x9f32a1['serverUrl']=intUtil[_0x93f4('0x80')](_0x9f32a1[_0x93f4('0x8e')]);if(_0x71055e&&_0x71055e[_0x93f4('0x81')]){logger[_0x93f4('0x2d')]('['+_0x173518[_0x93f4('0x9a')]['toUpperCase']()+']',_0x93f4('0x83'));_0x173518[_0x93f4('0x84')]=_0x9f32a1['serverUrl']+'/api/voice/recordings/'+_0x173518[_0x93f4('0x85')]+_0x93f4('0x86')+md5(_0x173518[_0x93f4('0x85')]);}else{_0x173518[_0x93f4('0x84')]='';}var _0x10e670=_0x9f32a1[_0x93f4('0x7f')]===_0x93f4('0x93')?'eu':_0x93f4('0x87');return getAccessToken(_0x9f32a1)[_0x93f4('0x30')](function(_0x2da735){_0xa80270=_0x2da735;return getUser(_0xa80270,_0x10e670,_0x9f32a1);})['then'](function(_0x47079a){_0x62b4c5=_0x47079a;logger[_0x93f4('0x2d')](_0x93f4('0x94'),_0x62b4c5['id']);return getEndUser(_0xa80270,_0x10e670,_0x9f32a1,_0x173518[_0x93f4('0x88')],_0x173518['calleridnum'],_0x62b4c5,_0x5e922c);})['then'](function(_0x3d3771){_0x3f0bc7=_0x3d3771;return getCall(_0xa80270,_0x10e670,_0x9f32a1,_0x62b4c5,_0x3f0bc7,_0x5e922c,_0x173518,'Inbound');})[_0x93f4('0x30')](function(_0x281390){if(_0x281390){logger[_0x93f4('0x2d')](_0x93f4('0x8a'),_0x281390['id']);}})[_0x93f4('0x29')](function(_0x27c7fa){logger[_0x93f4('0x2a')]('['+_0x173518['lastevent'][_0x93f4('0x9b')]()+']',JSON[_0x93f4('0xd')](_0x27c7fa));});}; \ 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 74b536b..8e98cf8 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 _0x1225=['data2','Script','data3','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','trigger'];(function(_0x2a03d5,_0x318ac3){var _0x4204e5=function(_0x53a977){while(--_0x53a977){_0x2a03d5['push'](_0x2a03d5['shift']());}};_0x4204e5(++_0x318ac3);}(_0x1225,0x125));var _0x5122=function(_0x55cbf2,_0x484501){_0x55cbf2=_0x55cbf2-0x0;var _0x38410f=_0x1225[_0x55cbf2];return _0x38410f;};'use strict';var util=require(_0x5122('0x0'));var sh=require(_0x5122('0x1'));var Mustache=require('mustache');var logger=require(_0x5122('0x2'))(_0x5122('0x3'));exports['exec']=function(_0x9422c0,_0xc6c1e){var _0x496324=_0x9422c0['data2']?_0x9422c0[_0x5122('0x4')]:_0x5122('0x5');var _0x234df4=_0x9422c0[_0x5122('0x6')]?Mustache['render'](_0x9422c0[_0x5122('0x6')],_0xc6c1e):_0xc6c1e;sh['exec'](_0x234df4,function(_0x4ef970,_0x29bed4,_0xacc77d){if(_0x4ef970!==0x0){logger[_0x5122('0x7')](util['format'](_0x5122('0x8'),_0x496324,_0x234df4,_0x4ef970,_0xacc77d));}else{logger['info'](util[_0x5122('0x9')](_0x5122('0xa'),_0x496324,_0x234df4,_0x29bed4));}});}; \ No newline at end of file +var _0x1e5e=['mustache','../../../../config/logger','trigger','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs'];(function(_0x92724b,_0x18e7d6){var _0x12e4f5=function(_0x406734){while(--_0x406734){_0x92724b['push'](_0x92724b['shift']());}};_0x12e4f5(++_0x18e7d6);}(_0x1e5e,0x178));var _0xe1e5=function(_0x8a3d6a,_0x5570b1){_0x8a3d6a=_0x8a3d6a-0x0;var _0x1c6468=_0x1e5e[_0x8a3d6a];return _0x1c6468;};'use strict';var util=require(_0xe1e5('0x0'));var sh=require(_0xe1e5('0x1'));var Mustache=require(_0xe1e5('0x2'));var logger=require(_0xe1e5('0x3'))(_0xe1e5('0x4'));exports[_0xe1e5('0x5')]=function(_0x3bfa6c,_0x583310){var _0x2f5a2f=_0x3bfa6c[_0xe1e5('0x6')]?_0x3bfa6c['data2']:_0xe1e5('0x7');var _0x1118ea=_0x3bfa6c[_0xe1e5('0x8')]?Mustache[_0xe1e5('0x9')](_0x3bfa6c[_0xe1e5('0x8')],_0x583310):_0x583310;sh[_0xe1e5('0x5')](_0x1118ea,function(_0x9dbdbd,_0x2199a2,_0x57596c){if(_0x9dbdbd!==0x0){logger[_0xe1e5('0xa')](util[_0xe1e5('0xb')](_0xe1e5('0xc'),_0x2f5a2f,_0x1118ea,_0x9dbdbd,_0x57596c));}else{logger[_0xe1e5('0xd')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x2f5a2f,_0x1118ea,_0x2199a2));}});}; \ 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 50b5807..2ad1280 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 _0x2afb=['body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','isNil','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','../../../../config/logger','exec','data1','toUpperCase','render','data5','number','headers','data6','parse','error','stack','GET','DELETE','PUT','data7'];(function(_0x18b7dd,_0x49771a){var _0x59bccc=function(_0x2a56fc){while(--_0x2a56fc){_0x18b7dd['push'](_0x18b7dd['shift']());}};_0x59bccc(++_0x49771a);}(_0x2afb,0x67));var _0xb2af=function(_0x2383bc,_0x2d5ec9){_0x2383bc=_0x2383bc-0x0;var _0x283573=_0x2afb[_0x2383bc];return _0x283573;};'use strict';var rp=require(_0xb2af('0x0'));var util=require('util');var _=require('lodash');var Mustache=require('mustache');var logger=require(_0xb2af('0x1'))('trigger');exports[_0xb2af('0x2')]=function(_0x41b573,_0x35fd18){var _0x4453ca,_0x29051d;var _0x4d600b={'method':_0x41b573[_0xb2af('0x3')][_0xb2af('0x4')](),'uri':Mustache[_0xb2af('0x5')](_0x41b573['data2'],_0x35fd18),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x41b573[_0xb2af('0x6')])===_0xb2af('0x7')&&parseInt(_0x41b573[_0xb2af('0x6')])>=0x1&&parseInt(_0x41b573[_0xb2af('0x6')])<=0xa?parseInt(_0x41b573['data5'])*0x3e8:0x5*0x3e8};try{_0x4d600b[_0xb2af('0x8')]=_0x41b573[_0xb2af('0x9')]?JSON[_0xb2af('0xa')](Mustache[_0xb2af('0x5')](_0x41b573[_0xb2af('0x9')],_0x35fd18)):{};}catch(_0x5f141e){logger[_0xb2af('0xb')](_0x5f141e[_0xb2af('0xc')]);}switch(_0x41b573[_0xb2af('0x3')][_0xb2af('0x4')]()){case _0xb2af('0xd'):case _0xb2af('0xe'):_0x4453ca=null;_0x4d600b['qs']=_0x35fd18;break;case'POST':case _0xb2af('0xf'):if(_0x41b573['data7']){try{_0x4453ca=JSON[_0xb2af('0xa')](Mustache[_0xb2af('0x5')](_0x41b573[_0xb2af('0x10')],_0x35fd18));_0x4d600b[_0xb2af('0x11')]=_0x4453ca;}catch(_0x2a9f37){logger[_0xb2af('0xb')](_0x2a9f37[_0xb2af('0xc')]);logger[_0xb2af('0xb')](_0xb2af('0x12'));}}else{_0x4453ca=_0x35fd18;_0x4d600b['body']=_0x4453ca;}break;}logger['info'](util[_0xb2af('0x13')](_0xb2af('0x14'),_0x41b573[_0xb2af('0x3')],_0x41b573[_0xb2af('0x15')],JSON[_0xb2af('0x16')](_0x4d600b)));rp(_0x4d600b)['then'](function(_0x4aa06c){_0x4453ca=!_[_0xb2af('0x17')](_0x4453ca)?',\x20request\x20body:\x20'+_0x4453ca:'';_0x29051d=typeof _0x4aa06c['body']===_0xb2af('0x18')?JSON[_0xb2af('0x16')](_0x4aa06c[_0xb2af('0x11')]):_0x4aa06c[_0xb2af('0x11')];logger[_0xb2af('0x19')](util[_0xb2af('0x13')](_0xb2af('0x1a'),_0x41b573[_0xb2af('0x3')],_0x41b573[_0xb2af('0x15')],_0x4aa06c['statusCode'],_0x29051d));})['catch'](function(_0x39fd2e){logger['error'](util[_0xb2af('0x13')](_0xb2af('0x1b'),_0x41b573['data1'],_0x41b573[_0xb2af('0x15')],_0x39fd2e['statusCode'],_0x39fd2e[_0xb2af('0x1c')],_0x39fd2e[_0xb2af('0x1d')]));});}; \ No newline at end of file +var _0xdef7=['GET','POST','PUT','data7','body','info','format','data1','stringify','then','isNil',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','toUpperCase','data2','data5','headers','data6','parse','render','error','stack'];(function(_0x3dc1c6,_0x8529a1){var _0x3c82ce=function(_0x5212d1){while(--_0x5212d1){_0x3dc1c6['push'](_0x3dc1c6['shift']());}};_0x3c82ce(++_0x8529a1);}(_0xdef7,0x111));var _0x7def=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdef7[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x7def('0x0'));var util=require(_0x7def('0x1'));var _=require(_0x7def('0x2'));var Mustache=require(_0x7def('0x3'));var logger=require(_0x7def('0x4'))(_0x7def('0x5'));exports['exec']=function(_0x22e6c8,_0x384026){var _0x199534,_0x3cde92;var _0x3c584a={'method':_0x22e6c8['data1'][_0x7def('0x6')](),'uri':Mustache['render'](_0x22e6c8[_0x7def('0x7')],_0x384026),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x22e6c8[_0x7def('0x8')])==='number'&&parseInt(_0x22e6c8[_0x7def('0x8')])>=0x1&&parseInt(_0x22e6c8[_0x7def('0x8')])<=0xa?parseInt(_0x22e6c8['data5'])*0x3e8:0x5*0x3e8};try{_0x3c584a[_0x7def('0x9')]=_0x22e6c8[_0x7def('0xa')]?JSON[_0x7def('0xb')](Mustache[_0x7def('0xc')](_0x22e6c8[_0x7def('0xa')],_0x384026)):{};}catch(_0x3db017){logger[_0x7def('0xd')](_0x3db017[_0x7def('0xe')]);}switch(_0x22e6c8['data1'][_0x7def('0x6')]()){case _0x7def('0xf'):case'DELETE':_0x199534=null;_0x3c584a['qs']=_0x384026;break;case _0x7def('0x10'):case _0x7def('0x11'):if(_0x22e6c8[_0x7def('0x12')]){try{_0x199534=JSON[_0x7def('0xb')](Mustache[_0x7def('0xc')](_0x22e6c8[_0x7def('0x12')],_0x384026));_0x3c584a[_0x7def('0x13')]=_0x199534;}catch(_0x17acae){logger[_0x7def('0xd')](_0x17acae[_0x7def('0xe')]);logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x199534=_0x384026;_0x3c584a[_0x7def('0x13')]=_0x199534;}break;}logger[_0x7def('0x14')](util[_0x7def('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x22e6c8[_0x7def('0x16')],_0x22e6c8[_0x7def('0x7')],JSON[_0x7def('0x17')](_0x3c584a)));rp(_0x3c584a)[_0x7def('0x18')](function(_0x34527c){_0x199534=!_[_0x7def('0x19')](_0x199534)?_0x7def('0x1a')+_0x199534:'';_0x3cde92=typeof _0x34527c[_0x7def('0x13')]==='object'?JSON[_0x7def('0x17')](_0x34527c['body']):_0x34527c[_0x7def('0x13')];logger[_0x7def('0x14')](util['format'](_0x7def('0x1b'),_0x22e6c8[_0x7def('0x16')],_0x22e6c8[_0x7def('0x7')],_0x34527c[_0x7def('0x1c')],_0x3cde92));})[_0x7def('0x1d')](function(_0x397a91){logger[_0x7def('0xd')](util[_0x7def('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x22e6c8[_0x7def('0x16')],_0x22e6c8[_0x7def('0x7')],_0x397a91[_0x7def('0x1c')],_0x397a91[_0x7def('0x1e')],_0x397a91[_0x7def('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 23b48aa..b3d5634 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 _0xd44d=['exports','bluebird','../../config/logger','routing','client','http','Request','request','then','error','rpc','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd44d,0x6d));var _0xdd44=function(_0xc6c869,_0x4d7a28){_0xc6c869=_0xc6c869-0x0;var _0x1c9948=_0xd44d[_0xc6c869];return _0x1c9948;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xdd44('0x0'));var logger=require(_0xdd44('0x1'))(_0xdd44('0x2'));var client=jayson[_0xdd44('0x3')][_0xdd44('0x4')]({'port':0x2329});client[_0xdd44('0x5')]=function(_0x2f7f82,_0x877bcc){return new BPromise(function(_0x5e685e,_0xc1a8f4){return client[_0xdd44('0x6')](_0x2f7f82,_0x877bcc)[_0xdd44('0x7')](function(_0x4e5bc1){logger['debug']('rpc','routing',_0x2f7f82,_0x877bcc,_0x4e5bc1);if(_0x4e5bc1[_0xdd44('0x8')]){logger[_0xdd44('0x8')](_0xdd44('0x9'),_0xdd44('0x2'),_0x2f7f82,_0x4e5bc1[_0xdd44('0x8')]['message'],_0x877bcc);return _0xc1a8f4(_0x4e5bc1[_0xdd44('0x8')]['message']);}else{return _0x5e685e(_0x4e5bc1['result']);}})[_0xdd44('0xa')](function(_0x56f7a2){logger[_0xdd44('0x8')](_0xdd44('0x9'),_0xdd44('0x2'),_0x2f7f82,_0x56f7a2,_0x877bcc);return _0xc1a8f4(_0x56f7a2);});});};module[_0xdd44('0xb')]=client; \ No newline at end of file +var _0x2a96=['client','Request','request','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0xfb2622,_0x5310b4){var _0x58c89e=function(_0x57a982){while(--_0x57a982){_0xfb2622['push'](_0xfb2622['shift']());}};_0x58c89e(++_0x5310b4);}(_0x2a96,0xdc));var _0x62a9=function(_0x2bfd4f,_0x1bbf2c){_0x2bfd4f=_0x2bfd4f-0x0;var _0x341849=_0x2a96[_0x2bfd4f];return _0x341849;};'use strict';var jayson=require(_0x62a9('0x0'));var BPromise=require(_0x62a9('0x1'));var logger=require(_0x62a9('0x2'))(_0x62a9('0x3'));var client=jayson[_0x62a9('0x4')]['http']({'port':0x2329});client[_0x62a9('0x5')]=function(_0x412918,_0x4ca446){return new BPromise(function(_0x386d46,_0x2a7910){return client[_0x62a9('0x6')](_0x412918,_0x4ca446)['then'](function(_0x11e94b){logger[_0x62a9('0x7')](_0x62a9('0x8'),'routing',_0x412918,_0x4ca446,_0x11e94b);if(_0x11e94b['error']){logger[_0x62a9('0x9')](_0x62a9('0x8'),_0x62a9('0x3'),_0x412918,_0x11e94b[_0x62a9('0x9')][_0x62a9('0xa')],_0x4ca446);return _0x2a7910(_0x11e94b[_0x62a9('0x9')][_0x62a9('0xa')]);}else{return _0x386d46(_0x11e94b[_0x62a9('0xb')]);}})[_0x62a9('0xc')](function(_0x5e2576){logger[_0x62a9('0x9')]('rpc',_0x62a9('0x3'),_0x412918,_0x5e2576,_0x4ca446);return _0x2a7910(_0x5e2576);});});};module[_0x62a9('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 7e7b00b..2517e30 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 _0xf2ba=['../../config/logger','resolve','then','getMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','error','./server','./realtime','./rpc/mailAccount','./rpc/setting'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2ba,0xdd));var _0xaf2b=function(_0x542e14,_0x5dfd4b){_0x542e14=_0x542e14-0x0;var _0xe3bbb=_0xf2ba[_0x542e14];return _0xe3bbb;};'use strict';var server=require(_0xaf2b('0x0'));var Realtime=require(_0xaf2b('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xaf2b('0x2'));var setting=require(_0xaf2b('0x3'));var logger=require(_0xaf2b('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xaf2b('0x5')]()[_0xaf2b('0x6')](mailAccount[_0xaf2b('0x7')]())[_0xaf2b('0x6')](realtime['initMailAccounts']())[_0xaf2b('0x6')](function(){email[_0xaf2b('0x8')](realtime[_0xaf2b('0x9')]);return realtime;});}function main(){return server[_0xaf2b('0xa')](realtime,email)[_0xaf2b('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0xaf2b('0xb')]();})['then'](function(_0x18d02c){return setInterval(initRealtime,_0x18d02c[_0xaf2b('0xc')]*0x3e8);})[_0xaf2b('0xd')](function(_0xc3b28f){logger[_0xaf2b('0xe')]('Email\x20service\x20initialization',_0xc3b28f);});}main(); \ No newline at end of file +var _0x6c34=['./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./rpc/mailAccount'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x6c34,0xd5));var _0x46c3=function(_0xc161b6,_0x3cf018){_0xc161b6=_0xc161b6-0x0;var _0x2c5765=_0x6c34[_0xc161b6];return _0x2c5765;};'use strict';var server=require(_0x46c3('0x0'));var Realtime=require(_0x46c3('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x46c3('0x2'));var setting=require(_0x46c3('0x3'));var logger=require(_0x46c3('0x4'))(_0x46c3('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x46c3('0x6')]()[_0x46c3('0x7')](mailAccount[_0x46c3('0x8')]())['then'](realtime[_0x46c3('0x9')]())['then'](function(){email[_0x46c3('0xa')](realtime[_0x46c3('0xb')]);return realtime;});}function main(){return server[_0x46c3('0xc')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0x46c3('0xd')]();})['then'](function(_0x43d191){return setInterval(initRealtime,_0x43d191[_0x46c3('0xe')]*0x3e8);})[_0x46c3('0xf')](function(_0x1737bf){logger[_0x46c3('0x10')](_0x46c3('0x11'),_0x1737bf);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index f54c724..91e0c73 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 _0x0710=['service','provider','box','handleImapBox','bind','handleImapEmail','end','disabled','connected','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','handleImapEnd','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','error','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','defaults','socket.io-emitter','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','isNil','stringify','refresh','hasOwnProperty'];(function(_0x381432,_0xe67bc0){var _0x3471ac=function(_0x4aa9a9){while(--_0x4aa9a9){_0x381432['push'](_0x381432['shift']());}};_0x3471ac(++_0xe67bc0);}(_0x0710,0xc4));var _0x0071=function(_0x3694ea,_0x1ee8e6){_0x3694ea=_0x3694ea-0x0;var _0x1409c3=_0x0710[_0x3694ea];return _0x1409c3;};'use strict';var _=require(_0x0071('0x0'));var moment=require(_0x0071('0x1'));var BPromise=require(_0x0071('0x2'));var md5=require(_0x0071('0x3'));var Redis=require(_0x0071('0x4'));var config=require('../../../config/environment');var logger=require(_0x0071('0x5'))(_0x0071('0x6'));config[_0x0071('0x7')]=_[_0x0071('0x8')](config[_0x0071('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x0071('0x9'))(new Redis(config[_0x0071('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x0071('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x32d7a5){logger[_0x0071('0xb')](_0x0071('0xc'));this['mailAccounts']=_0x32d7a5[_0x0071('0xd')];this[_0x0071('0xe')]={};this[_0x0071('0xf')]=new EmailSmtp();}EmailChannel[_0x0071('0x10')][_0x0071('0x11')]=function(_0x4bb30a){var _0x7ce2f1=this[_0x0071('0xd')][_0x4bb30a];var _0x5b11da={'id':_0x7ce2f1['id'],'name':_0x7ce2f1[_0x0071('0x12')],'key':_0x7ce2f1[_0x0071('0x13')],'active':_0x7ce2f1[_0x0071('0x14')],'Imap':{'status':_0x7ce2f1[_0x0071('0x15')][_0x0071('0x16')],'messageStatus':_0x7ce2f1[_0x0071('0x15')][_0x0071('0x17')],'total':_0x7ce2f1[_0x0071('0x15')]['total']}};if(_[_0x0071('0x18')](md5Accounts[_0x4bb30a])){md5Accounts[_0x4bb30a]={};}var _0x287e7c=md5(JSON[_0x0071('0x19')](_0x5b11da));if(md5Accounts[_0x4bb30a][_0x0071('0x3')]!==_0x287e7c){md5Accounts[_0x4bb30a]['md5']=_0x287e7c;io[_0x0071('0x11')]('mailAccount:update',_0x5b11da);}};EmailChannel[_0x0071('0x10')][_0x0071('0x1a')]=function(_0x2717d6){for(var _0xbffa34 in _0x2717d6){if(_0x2717d6[_0x0071('0x1b')](_0xbffa34)){if(_0x2717d6[_0xbffa34][_0x0071('0x15')]&&_0x2717d6[_0xbffa34]['active']){var _0x276949=_0x2717d6[_0xbffa34][_0x0071('0x15')];if(!_0x276949[_0x0071('0x1c')]&&_0x2717d6[_0xbffa34][_0x0071('0x1d')]!=='custom')_0x276949['service']=_0x2717d6[_0xbffa34]['provider'];if(!this[_0x0071('0xe')]['hasOwnProperty'](_0x276949['id'])){this[_0x0071('0xe')][_0x276949['id']]=new EmailImap(_0x276949,_0x2717d6[_0xbffa34][_0x0071('0x6')]);this[_0x0071('0xe')][_0x276949['id']]['on'](_0x0071('0x1e'),this[_0x0071('0x1f')][_0x0071('0x20')](this,_0xbffa34));this[_0x0071('0xe')][_0x276949['id']]['on'](_0x0071('0x6'),this[_0x0071('0x21')][_0x0071('0x20')](this,_0xbffa34));this[_0x0071('0xe')][_0x276949['id']]['on'](_0x0071('0x22'),this['handleImapEnd'][_0x0071('0x20')](this,_0xbffa34));this[_0x0071('0xe')][_0x276949['id']]['on']('error',this['handleImapError']['bind'](this,_0xbffa34));}}else{if(_[_0x0071('0x18')](this[_0x0071('0xd')][_0xbffa34][_0x0071('0x15')])){this['mailAccounts'][_0xbffa34][_0x0071('0x15')]={};}this['mailAccounts'][_0xbffa34][_0x0071('0x15')][_0x0071('0x16')]=_0x0071('0x23');this['mailAccounts'][_0xbffa34][_0x0071('0x15')][_0x0071('0x17')]='';this[_0x0071('0x11')](_0xbffa34);}}}};EmailChannel['prototype'][_0x0071('0x1f')]=function(_0x5906ad,_0x393498){if(this[_0x0071('0xd')][_0x5906ad]){this[_0x0071('0xd')][_0x5906ad]['Imap'][_0x0071('0x16')]=_0x0071('0x24');this[_0x0071('0xd')][_0x5906ad]['Imap']['messageStatus']=_0x393498[_0x0071('0x12')];if(_0x393498[_0x0071('0x25')]){this[_0x0071('0xd')][_0x5906ad]['Imap'][_0x0071('0x26')]=_0x393498[_0x0071('0x25')][_0x0071('0x26')];}return this['emit'](_0x5906ad);}};EmailChannel['prototype']['handleImapEmail']=function(_0x3e4dec,_0x5ab4cd){logger[_0x0071('0xb')](_0x0071('0x27'),_0x5ab4cd['firstName'],_0x5ab4cd[_0x0071('0x28')],_0x5ab4cd[_0x0071('0x29')],_0x3e4dec);if(this[_0x0071('0xd')][_0x3e4dec]){return mailAccount[_0x0071('0x2a')](_0x3e4dec,_0x5ab4cd)[_0x0071('0x2b')](function(_0x1ed80f){if(_0x1ed80f){logger[_0x0071('0xb')](_0x0071('0x2c'));}})[_0x0071('0x2d')](function(_0x4724b6){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0x4724b6));});}};EmailChannel['prototype'][_0x0071('0x2e')]=function(_0x1cc8c1){if(this[_0x0071('0xd')][_0x1cc8c1]&&this[_0x0071('0xd')][_0x1cc8c1][_0x0071('0x15')]){if(this[_0x0071('0xe')][this[_0x0071('0xd')][_0x1cc8c1][_0x0071('0x15')]['id']]){delete this[_0x0071('0xe')][this[_0x0071('0xd')][_0x1cc8c1][_0x0071('0x15')]['id']];}this[_0x0071('0xd')][_0x1cc8c1][_0x0071('0x15')][_0x0071('0x2f')]=moment();this[_0x0071('0x11')](_0x1cc8c1);}};EmailChannel[_0x0071('0x10')][_0x0071('0x30')]=function(_0x331a3f,_0x249eb1){if(this['mailAccounts'][_0x331a3f]){this['mailAccounts'][_0x331a3f]['Imap'][_0x0071('0x16')]='error';this[_0x0071('0xd')][_0x331a3f][_0x0071('0x15')][_0x0071('0x17')]=_0x249eb1;return this[_0x0071('0x11')](_0x331a3f);}};EmailChannel[_0x0071('0x10')][_0x0071('0x31')]=function(_0x3439cb,_0x5b64c1){return this[_0x0071('0xf')][_0x0071('0x32')](_0x3439cb,_0x5b64c1);};EmailChannel[_0x0071('0x10')][_0x0071('0x33')]=function(_0x2f026f){var _0x46fe87=this;if(this[_0x0071('0xd')][_0x2f026f['id']]){if(_[_0x0071('0x18')](this[_0x0071('0xd')][_0x2f026f['id']][_0x0071('0x34')])){this['mailAccounts'][_0x2f026f['id']]['Smtp']={};}this[_0x0071('0xd')][_0x2f026f['id']][_0x0071('0x34')][_0x0071('0x2f')]=moment();return new BPromise(function(_0x2d5b98,_0x4750fc){return _0x46fe87[_0x0071('0xf')]['verify'](_0x2f026f)[_0x0071('0x2b')](function(_0x3ad12b){_0x46fe87[_0x0071('0xd')][_0x2f026f['id']][_0x0071('0x34')][_0x0071('0x16')]='verified';_0x46fe87[_0x0071('0xd')][_0x2f026f['id']]['Smtp'][_0x0071('0x17')]='';_0x46fe87[_0x0071('0x11')](_0x2f026f['id']);_0x2d5b98(_0x3ad12b);})[_0x0071('0x2d')](function(_0x1bdb2c){_0x46fe87[_0x0071('0xd')][_0x2f026f['id']][_0x0071('0x34')][_0x0071('0x16')]=_0x0071('0x35');_0x46fe87[_0x0071('0xd')][_0x2f026f['id']]['Smtp'][_0x0071('0x17')]=_0x1bdb2c;_0x46fe87[_0x0071('0x11')](_0x2f026f['id']);_0x4750fc(_0x1bdb2c);});});}return this[_0x0071('0xf')][_0x0071('0x36')](_0x2f026f);};module[_0x0071('0x37')]=EmailChannel; \ No newline at end of file +var _0xc4cc=['redis','localhost','socket.io-emitter','./imap','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','status','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','handleImapBox','messages','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','verifySmtp','Smtp','verify','verified','exports','lodash','bluebird','md5','../../../config/environment','../../../config/logger','email','defaults'];(function(_0x1d76bc,_0x5c3f6c){var _0x1fb204=function(_0x5ce771){while(--_0x5ce771){_0x1d76bc['push'](_0x1d76bc['shift']());}};_0x1fb204(++_0x5c3f6c);}(_0xc4cc,0xd9));var _0xcc4c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc4cc[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xcc4c('0x0'));var moment=require('moment');var BPromise=require(_0xcc4c('0x1'));var md5=require(_0xcc4c('0x2'));var Redis=require('ioredis');var config=require(_0xcc4c('0x3'));var logger=require(_0xcc4c('0x4'))(_0xcc4c('0x5'));config['redis']=_[_0xcc4c('0x6')](config[_0xcc4c('0x7')],{'host':_0xcc4c('0x8'),'port':0x18eb});var io=require(_0xcc4c('0x9'))(new Redis(config[_0xcc4c('0x7')]));var EmailImap=require(_0xcc4c('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x1fc361){logger[_0xcc4c('0xb')](_0xcc4c('0xc'));this[_0xcc4c('0xd')]=_0x1fc361[_0xcc4c('0xd')];this[_0xcc4c('0xe')]={};this[_0xcc4c('0xf')]=new EmailSmtp();}EmailChannel[_0xcc4c('0x10')][_0xcc4c('0x11')]=function(_0x40ceab){var _0x18fa87=this[_0xcc4c('0xd')][_0x40ceab];var _0x39afd2={'id':_0x18fa87['id'],'name':_0x18fa87[_0xcc4c('0x12')],'key':_0x18fa87[_0xcc4c('0x13')],'active':_0x18fa87[_0xcc4c('0x14')],'Imap':{'status':_0x18fa87['Imap'][_0xcc4c('0x15')],'messageStatus':_0x18fa87[_0xcc4c('0x16')][_0xcc4c('0x17')],'total':_0x18fa87[_0xcc4c('0x16')][_0xcc4c('0x18')]}};if(_[_0xcc4c('0x19')](md5Accounts[_0x40ceab])){md5Accounts[_0x40ceab]={};}var _0x191e77=md5(JSON[_0xcc4c('0x1a')](_0x39afd2));if(md5Accounts[_0x40ceab][_0xcc4c('0x2')]!==_0x191e77){md5Accounts[_0x40ceab][_0xcc4c('0x2')]=_0x191e77;io[_0xcc4c('0x11')](_0xcc4c('0x1b'),_0x39afd2);}};EmailChannel[_0xcc4c('0x10')][_0xcc4c('0x1c')]=function(_0x2e9e47){for(var _0x55d20b in _0x2e9e47){if(_0x2e9e47[_0xcc4c('0x1d')](_0x55d20b)){if(_0x2e9e47[_0x55d20b][_0xcc4c('0x16')]&&_0x2e9e47[_0x55d20b][_0xcc4c('0x14')]){var _0x2b87a5=_0x2e9e47[_0x55d20b][_0xcc4c('0x16')];if(!_0x2b87a5[_0xcc4c('0x1e')]&&_0x2e9e47[_0x55d20b][_0xcc4c('0x1f')]!=='custom')_0x2b87a5[_0xcc4c('0x1e')]=_0x2e9e47[_0x55d20b][_0xcc4c('0x1f')];if(!this[_0xcc4c('0xe')][_0xcc4c('0x1d')](_0x2b87a5['id'])){this[_0xcc4c('0xe')][_0x2b87a5['id']]=new EmailImap(_0x2b87a5,_0x2e9e47[_0x55d20b][_0xcc4c('0x5')]);this[_0xcc4c('0xe')][_0x2b87a5['id']]['on'](_0xcc4c('0x20'),this['handleImapBox'][_0xcc4c('0x21')](this,_0x55d20b));this[_0xcc4c('0xe')][_0x2b87a5['id']]['on'](_0xcc4c('0x5'),this[_0xcc4c('0x22')][_0xcc4c('0x21')](this,_0x55d20b));this[_0xcc4c('0xe')][_0x2b87a5['id']]['on'](_0xcc4c('0x23'),this[_0xcc4c('0x24')][_0xcc4c('0x21')](this,_0x55d20b));this[_0xcc4c('0xe')][_0x2b87a5['id']]['on'](_0xcc4c('0x25'),this[_0xcc4c('0x26')][_0xcc4c('0x21')](this,_0x55d20b));}}else{if(_[_0xcc4c('0x19')](this[_0xcc4c('0xd')][_0x55d20b]['Imap'])){this[_0xcc4c('0xd')][_0x55d20b][_0xcc4c('0x16')]={};}this[_0xcc4c('0xd')][_0x55d20b][_0xcc4c('0x16')][_0xcc4c('0x15')]=_0xcc4c('0x27');this['mailAccounts'][_0x55d20b][_0xcc4c('0x16')][_0xcc4c('0x17')]='';this[_0xcc4c('0x11')](_0x55d20b);}}}};EmailChannel['prototype'][_0xcc4c('0x28')]=function(_0x41de11,_0x5ce52f){if(this[_0xcc4c('0xd')][_0x41de11]){this[_0xcc4c('0xd')][_0x41de11][_0xcc4c('0x16')][_0xcc4c('0x15')]='connected';this[_0xcc4c('0xd')][_0x41de11]['Imap'][_0xcc4c('0x17')]=_0x5ce52f[_0xcc4c('0x12')];if(_0x5ce52f[_0xcc4c('0x29')]){this[_0xcc4c('0xd')][_0x41de11][_0xcc4c('0x16')][_0xcc4c('0x18')]=_0x5ce52f['messages']['total'];}return this[_0xcc4c('0x11')](_0x41de11);}};EmailChannel[_0xcc4c('0x10')]['handleImapEmail']=function(_0x53d6dd,_0x114510){logger[_0xcc4c('0xb')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x114510[_0xcc4c('0x2a')],_0x114510['lastName'],_0x114510[_0xcc4c('0x2b')],_0x53d6dd);if(this[_0xcc4c('0xd')][_0x53d6dd]){return mailAccount[_0xcc4c('0x2c')](_0x53d6dd,_0x114510)[_0xcc4c('0x2d')](function(_0x302eab){if(_0x302eab){logger[_0xcc4c('0xb')](_0xcc4c('0x2e'));}})[_0xcc4c('0x2f')](function(_0x432ea8){logger[_0xcc4c('0x25')](_0xcc4c('0x30'),JSON[_0xcc4c('0x1a')](_0x432ea8));});}};EmailChannel['prototype'][_0xcc4c('0x24')]=function(_0x5cb77f){if(this[_0xcc4c('0xd')][_0x5cb77f]&&this[_0xcc4c('0xd')][_0x5cb77f][_0xcc4c('0x16')]){if(this[_0xcc4c('0xe')][this['mailAccounts'][_0x5cb77f][_0xcc4c('0x16')]['id']]){delete this['imapAccounts'][this[_0xcc4c('0xd')][_0x5cb77f][_0xcc4c('0x16')]['id']];}this[_0xcc4c('0xd')][_0x5cb77f][_0xcc4c('0x16')][_0xcc4c('0x31')]=moment();this[_0xcc4c('0x11')](_0x5cb77f);}};EmailChannel[_0xcc4c('0x10')][_0xcc4c('0x26')]=function(_0x46f7a8,_0x1853f2){if(this[_0xcc4c('0xd')][_0x46f7a8]){this[_0xcc4c('0xd')][_0x46f7a8][_0xcc4c('0x16')][_0xcc4c('0x15')]=_0xcc4c('0x25');this[_0xcc4c('0xd')][_0x46f7a8][_0xcc4c('0x16')][_0xcc4c('0x17')]=_0x1853f2;return this[_0xcc4c('0x11')](_0x46f7a8);}};EmailChannel[_0xcc4c('0x10')]['sendMail']=function(_0x3a6501,_0x1f72c5){return this['smtp'][_0xcc4c('0x32')](_0x3a6501,_0x1f72c5);};EmailChannel[_0xcc4c('0x10')][_0xcc4c('0x33')]=function(_0x11c82f){var _0x3eb727=this;if(this[_0xcc4c('0xd')][_0x11c82f['id']]){if(_[_0xcc4c('0x19')](this[_0xcc4c('0xd')][_0x11c82f['id']]['Smtp'])){this[_0xcc4c('0xd')][_0x11c82f['id']][_0xcc4c('0x34')]={};}this[_0xcc4c('0xd')][_0x11c82f['id']]['Smtp'][_0xcc4c('0x31')]=moment();return new BPromise(function(_0x200786,_0xcdbb85){return _0x3eb727['smtp'][_0xcc4c('0x35')](_0x11c82f)['then'](function(_0x50db0f){_0x3eb727[_0xcc4c('0xd')][_0x11c82f['id']]['Smtp'][_0xcc4c('0x15')]=_0xcc4c('0x36');_0x3eb727[_0xcc4c('0xd')][_0x11c82f['id']]['Smtp']['messageStatus']='';_0x3eb727[_0xcc4c('0x11')](_0x11c82f['id']);_0x200786(_0x50db0f);})[_0xcc4c('0x2f')](function(_0x4d45ab){_0x3eb727['mailAccounts'][_0x11c82f['id']][_0xcc4c('0x34')][_0xcc4c('0x15')]='error';_0x3eb727['mailAccounts'][_0x11c82f['id']]['Smtp'][_0xcc4c('0x17')]=_0x4d45ab;_0x3eb727[_0xcc4c('0x11')](_0x11c82f['id']);_0xcdbb85(_0x4d45ab);});});}return this[_0xcc4c('0xf')][_0xcc4c('0x35')](_0x11c82f);};module[_0xcc4c('0x37')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 6f3ed79..334f48a 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 _0x42c0=['imap','simpleParser','EventEmitter','./utils','mailbox','account','getAccount','once','ready','handleReady','bind','end','handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','data5','password','authentication','host','port','required','openBox','handleOpenBox','box','handleCloseBox','readUnseen','search','handleReadUnseen','length','fetch','handleFetchMessage','error','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','emit','email','textCode','hasOwnProperty','upperFirst','exports','lodash','util'];(function(_0xfdd33f,_0x9cf83e){var _0x5e0c4c=function(_0x4854a3){while(--_0x4854a3){_0xfdd33f['push'](_0xfdd33f['shift']());}};_0x5e0c4c(++_0x9cf83e);}(_0x42c0,0x72));var _0x042c=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x42c0[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x042c('0x0'));var util=require(_0x042c('0x1'));var Imap=require(_0x042c('0x2'));var simpleParser=require('mailparser')[_0x042c('0x3')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require('events')[_0x042c('0x4')];var utils=require(_0x042c('0x5'));var logger=require('../../../config/logger')('email');function EmailImap(_0x563d9e,_0x457ec9){this[_0x042c('0x6')]=_0x563d9e[_0x042c('0x6')];this[_0x042c('0x7')]=this[_0x042c('0x8')](_0x563d9e,_0x457ec9);this[_0x042c('0x2')]=new Imap(this['account']);this[_0x042c('0x2')][_0x042c('0x9')](_0x042c('0xa'),this[_0x042c('0xb')][_0x042c('0xc')](this));this[_0x042c('0x2')][_0x042c('0x9')](_0x042c('0xd'),this[_0x042c('0xe')][_0x042c('0xc')](this));this['imap']['on']('error',this[_0x042c('0xf')][_0x042c('0xc')](this));this['imap'][_0x042c('0x10')]();}util[_0x042c('0x11')](EmailImap,EventEmitter);EmailImap[_0x042c('0x12')][_0x042c('0x8')]=function(_0x56351e,_0x1c9fac){var _0x337c7d={'connTimeout':_0x56351e['connTimeout']?_0x56351e[_0x042c('0x13')]*0x3e8:0x2710,'authTimeout':_0x56351e[_0x042c('0x14')]?_0x56351e[_0x042c('0x14')]*0x3e8:0x1388};if(_0x56351e[_0x042c('0x15')]){_0x337c7d['user']=_0x56351e[_0x042c('0x16')];if(_0x56351e[_0x042c('0x17')]){_0x337c7d[_0x042c('0x18')]=utils[_0x042c('0x19')](_0x56351e['CloudProvider'][_0x042c('0x1a')],_0x56351e[_0x042c('0x16')]);}else{_0x337c7d[_0x042c('0x1b')]=_0x56351e[_0x042c('0x1b')];}}else{if(_0x56351e[_0x042c('0x1c')]){_0x337c7d[_0x042c('0x16')]=_0x56351e[_0x042c('0x16')];_0x337c7d['password']=_0x56351e['password'];}}_0x337c7d['email']=_0x1c9fac||_0x56351e['user']||'anonymous@xcally.com';_0x337c7d[_0x042c('0x1d')]=_0x56351e[_0x042c('0x1d')];_0x337c7d[_0x042c('0x1e')]=_0x56351e[_0x042c('0x1e')]||0x3e1;if(_0x56351e['tls']){_0x337c7d['tls']=!![];}else{_0x337c7d['tls']=![];_0x337c7d['autotls']=_0x042c('0x1f');}return _0x337c7d;};EmailImap[_0x042c('0x12')][_0x042c('0xb')]=function(){this[_0x042c('0x2')][_0x042c('0x20')](this[_0x042c('0x6')],![],this[_0x042c('0x21')][_0x042c('0xc')](this));};EmailImap[_0x042c('0x12')][_0x042c('0x21')]=function(_0x5330dc,_0x39c808){if(_0x5330dc){this[_0x042c('0xf')](_0x5330dc,!![]);}else{this['emit'](_0x042c('0x22'),_0x39c808);this['readUnseen']();}};EmailImap[_0x042c('0x12')][_0x042c('0x23')]=function(_0x475787){if(_0x475787){this[_0x042c('0xf')](_0x475787,!![]);}else{this[_0x042c('0x2')][_0x042c('0xd')]();}};EmailImap['prototype'][_0x042c('0x24')]=function(){this[_0x042c('0x2')][_0x042c('0x25')](['UNSEEN'],this[_0x042c('0x26')][_0x042c('0xc')](this));};EmailImap[_0x042c('0x12')]['handleReadUnseen']=function(_0x582bae,_0x33dec5){if(_0x582bae){this[_0x042c('0xf')](_0x582bae,!![]);}else{if(_0x33dec5[_0x042c('0x27')]){try{var _0x3829ff=this['imap'][_0x042c('0x28')](_0x33dec5,{'bodies':'','markSeen':!![]});_0x3829ff['on']('message',this[_0x042c('0x29')]['bind'](this));_0x3829ff[_0x042c('0x9')](_0x042c('0x2a'),this['handleFetchError']['bind'](this));_0x3829ff[_0x042c('0x9')](_0x042c('0xd'),this[_0x042c('0x2b')]['bind'](this));}catch(_0x1d3c38){logger['error'](_0x1d3c38);}}else{this['imap'][_0x042c('0x2c')](!![],this[_0x042c('0x23')][_0x042c('0xc')](this));}}};EmailImap[_0x042c('0x12')]['handleFetchMessage']=function(_0x426d3d){_0x426d3d['on'](_0x042c('0x2d'),this[_0x042c('0x2e')][_0x042c('0xc')](this));_0x426d3d['once'](_0x042c('0x2f'),this['handleMessageAttributes'][_0x042c('0xc')](this));_0x426d3d['once'](_0x042c('0xd'),this[_0x042c('0x30')]['bind'](this));};EmailImap[_0x042c('0x12')][_0x042c('0x2e')]=function(_0x1e14a1){simpleParser(_0x1e14a1,{'Iconv':Iconv},this[_0x042c('0x31')][_0x042c('0xc')](this));};EmailImap[_0x042c('0x12')][_0x042c('0x32')]=function(){};EmailImap[_0x042c('0x12')][_0x042c('0x30')]=function(){};EmailImap['prototype'][_0x042c('0x31')]=function(_0x5304ac,_0x3c3dfa){if(_0x5304ac){logger['error'](_0x5304ac);}else{var _0x958ca4=this;utils[_0x042c('0x33')](this[_0x042c('0x7')],_0x3c3dfa,function(_0x2d5882){_0x958ca4[_0x042c('0x34')](_0x042c('0x35'),_0x2d5882);});}};EmailImap['prototype'][_0x042c('0x2b')]=function(){this[_0x042c('0x2')][_0x042c('0x2c')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x042c('0x12')]['handleFetchError']=function(_0x5542fa){this['handleError'](_0x5542fa);this[_0x042c('0x2')][_0x042c('0x2c')](!![],this[_0x042c('0x23')][_0x042c('0xc')](this));};EmailImap[_0x042c('0x12')][_0x042c('0xe')]=function(){this[_0x042c('0x34')](_0x042c('0xd'));};EmailImap['prototype'][_0x042c('0xf')]=function(_0x3320cc,_0x3fb02d){logger[_0x042c('0x2a')](_0x042c('0xf'),this[_0x042c('0x7')][_0x042c('0x35')],JSON['stringify'](_0x3320cc));var _0x34ef0f='';if(_0x3320cc){if(_0x3320cc[_0x042c('0x36')]){_0x34ef0f=_0x3320cc[_0x042c('0x36')];}else{for(var _0x4b2f48 in _0x3320cc){if(_0x3320cc[_0x042c('0x37')](_0x4b2f48)){_0x34ef0f+=_[_0x042c('0x38')](_0x4b2f48)+':\x20'+_0x3320cc[_0x4b2f48]+'\x0a';}}}}if(_0x3fb02d){this[_0x042c('0x2')][_0x042c('0xd')]();}else{this[_0x042c('0x34')]('error',_0x34ef0f);this[_0x042c('0x34')](_0x042c('0xd'));}};module[_0x042c('0x39')]=EmailImap; \ No newline at end of file +var _0x7d3f=['lodash','util','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','getAccount','imap','ready','handleReady','bind','once','end','handleEnd','error','handleError','inherits','connTimeout','authTimeout','user','generateXOAuth2Token','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','prototype','openBox','handleOpenBox','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','handleCloseBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','account','textCode','hasOwnProperty','upperFirst'];(function(_0x319e1c,_0x3b4634){var _0x49c88d=function(_0x4574cb){while(--_0x4574cb){_0x319e1c['push'](_0x319e1c['shift']());}};_0x49c88d(++_0x3b4634);}(_0x7d3f,0x16e));var _0xf7d3=function(_0x39ffd1,_0x299703){_0x39ffd1=_0x39ffd1-0x0;var _0x31267e=_0x7d3f[_0x39ffd1];return _0x31267e;};'use strict';var _=require(_0xf7d3('0x0'));var util=require(_0xf7d3('0x1'));var Imap=require('imap');var simpleParser=require(_0xf7d3('0x2'))[_0xf7d3('0x3')];var Iconv=require(_0xf7d3('0x4'))[_0xf7d3('0x5')];var EventEmitter=require(_0xf7d3('0x6'))[_0xf7d3('0x7')];var utils=require(_0xf7d3('0x8'));var logger=require(_0xf7d3('0x9'))(_0xf7d3('0xa'));function EmailImap(_0x3bb1d9,_0x5cd8ca){this['mailbox']=_0x3bb1d9[_0xf7d3('0xb')];this['account']=this[_0xf7d3('0xc')](_0x3bb1d9,_0x5cd8ca);this[_0xf7d3('0xd')]=new Imap(this['account']);this['imap']['once'](_0xf7d3('0xe'),this[_0xf7d3('0xf')][_0xf7d3('0x10')](this));this[_0xf7d3('0xd')][_0xf7d3('0x11')](_0xf7d3('0x12'),this[_0xf7d3('0x13')][_0xf7d3('0x10')](this));this['imap']['on'](_0xf7d3('0x14'),this[_0xf7d3('0x15')][_0xf7d3('0x10')](this));this[_0xf7d3('0xd')]['connect']();}util[_0xf7d3('0x16')](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x957ae9,_0x52df94){var _0x20954c={'connTimeout':_0x957ae9[_0xf7d3('0x17')]?_0x957ae9[_0xf7d3('0x17')]*0x3e8:0x2710,'authTimeout':_0x957ae9[_0xf7d3('0x18')]?_0x957ae9['authTimeout']*0x3e8:0x1388};if(_0x957ae9['service']){_0x20954c[_0xf7d3('0x19')]=_0x957ae9[_0xf7d3('0x19')];if(_0x957ae9['modernAuthentication']){_0x20954c['xoauth2']=utils[_0xf7d3('0x1a')](_0x957ae9['CloudProvider'][_0xf7d3('0x1b')],_0x957ae9['user']);}else{_0x20954c[_0xf7d3('0x1c')]=_0x957ae9[_0xf7d3('0x1c')];}}else{if(_0x957ae9[_0xf7d3('0x1d')]){_0x20954c[_0xf7d3('0x19')]=_0x957ae9['user'];_0x20954c['password']=_0x957ae9['password'];}}_0x20954c[_0xf7d3('0xa')]=_0x52df94||_0x957ae9[_0xf7d3('0x19')]||_0xf7d3('0x1e');_0x20954c[_0xf7d3('0x1f')]=_0x957ae9[_0xf7d3('0x1f')];_0x20954c[_0xf7d3('0x20')]=_0x957ae9[_0xf7d3('0x20')]||0x3e1;if(_0x957ae9[_0xf7d3('0x21')]){_0x20954c[_0xf7d3('0x21')]=!![];}else{_0x20954c[_0xf7d3('0x21')]=![];_0x20954c[_0xf7d3('0x22')]=_0xf7d3('0x23');}return _0x20954c;};EmailImap[_0xf7d3('0x24')][_0xf7d3('0xf')]=function(){this[_0xf7d3('0xd')][_0xf7d3('0x25')](this[_0xf7d3('0xb')],![],this[_0xf7d3('0x26')][_0xf7d3('0x10')](this));};EmailImap[_0xf7d3('0x24')][_0xf7d3('0x26')]=function(_0x5edb4d,_0x412538){if(_0x5edb4d){this[_0xf7d3('0x15')](_0x5edb4d,!![]);}else{this[_0xf7d3('0x27')](_0xf7d3('0x28'),_0x412538);this['readUnseen']();}};EmailImap['prototype']['handleCloseBox']=function(_0xe6a9cc){if(_0xe6a9cc){this['handleError'](_0xe6a9cc,!![]);}else{this[_0xf7d3('0xd')]['end']();}};EmailImap['prototype'][_0xf7d3('0x29')]=function(){this[_0xf7d3('0xd')][_0xf7d3('0x2a')]([_0xf7d3('0x2b')],this['handleReadUnseen'][_0xf7d3('0x10')](this));};EmailImap[_0xf7d3('0x24')][_0xf7d3('0x2c')]=function(_0x3d20bb,_0x186fdb){if(_0x3d20bb){this['handleError'](_0x3d20bb,!![]);}else{if(_0x186fdb[_0xf7d3('0x2d')]){try{var _0x1f5e2d=this[_0xf7d3('0xd')][_0xf7d3('0x2e')](_0x186fdb,{'bodies':'','markSeen':!![]});_0x1f5e2d['on']('message',this[_0xf7d3('0x2f')][_0xf7d3('0x10')](this));_0x1f5e2d[_0xf7d3('0x11')]('error',this[_0xf7d3('0x30')][_0xf7d3('0x10')](this));_0x1f5e2d[_0xf7d3('0x11')](_0xf7d3('0x12'),this[_0xf7d3('0x31')][_0xf7d3('0x10')](this));}catch(_0x327747){logger[_0xf7d3('0x14')](_0x327747);}}else{this[_0xf7d3('0xd')]['closeBox'](!![],this[_0xf7d3('0x32')][_0xf7d3('0x10')](this));}}};EmailImap['prototype'][_0xf7d3('0x2f')]=function(_0x1ba6d4){_0x1ba6d4['on'](_0xf7d3('0x33'),this[_0xf7d3('0x34')][_0xf7d3('0x10')](this));_0x1ba6d4[_0xf7d3('0x11')]('attributes',this[_0xf7d3('0x35')][_0xf7d3('0x10')](this));_0x1ba6d4[_0xf7d3('0x11')]('end',this[_0xf7d3('0x36')][_0xf7d3('0x10')](this));};EmailImap[_0xf7d3('0x24')][_0xf7d3('0x34')]=function(_0x25538c){simpleParser(_0x25538c,{'Iconv':Iconv},this[_0xf7d3('0x37')]['bind'](this));};EmailImap[_0xf7d3('0x24')][_0xf7d3('0x35')]=function(){};EmailImap[_0xf7d3('0x24')][_0xf7d3('0x36')]=function(){};EmailImap[_0xf7d3('0x24')]['handleSimpleParser']=function(_0x36d66f,_0x3f83a1){if(_0x36d66f){logger[_0xf7d3('0x14')](_0x36d66f);}else{var _0x3c7ac4=this;utils[_0xf7d3('0x38')](this[_0xf7d3('0x39')],_0x3f83a1,function(_0x1d15b7){_0x3c7ac4[_0xf7d3('0x27')](_0xf7d3('0xa'),_0x1d15b7);});}};EmailImap['prototype']['handleFetchEnd']=function(){this['imap']['closeBox'](!![],this[_0xf7d3('0x32')][_0xf7d3('0x10')](this));};EmailImap[_0xf7d3('0x24')][_0xf7d3('0x30')]=function(_0x39bbd2){this[_0xf7d3('0x15')](_0x39bbd2);this['imap']['closeBox'](!![],this[_0xf7d3('0x32')][_0xf7d3('0x10')](this));};EmailImap[_0xf7d3('0x24')]['handleEnd']=function(){this[_0xf7d3('0x27')](_0xf7d3('0x12'));};EmailImap[_0xf7d3('0x24')][_0xf7d3('0x15')]=function(_0x31cb5c,_0x3ca57c){logger['error'](_0xf7d3('0x15'),this['account'][_0xf7d3('0xa')],JSON['stringify'](_0x31cb5c));var _0x394f08='';if(_0x31cb5c){if(_0x31cb5c[_0xf7d3('0x3a')]){_0x394f08=_0x31cb5c['textCode'];}else{for(var _0x47e826 in _0x31cb5c){if(_0x31cb5c[_0xf7d3('0x3b')](_0x47e826)){_0x394f08+=_[_0xf7d3('0x3c')](_0x47e826)+':\x20'+_0x31cb5c[_0x47e826]+'\x0a';}}}}if(_0x3ca57c){this[_0xf7d3('0xd')][_0xf7d3('0x12')]();}else{this[_0xf7d3('0x27')]('error',_0x394f08);this[_0xf7d3('0x27')](_0xf7d3('0x12'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index e5c829f..d570243 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 _0x2a52=['Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','use','compile','sendMail','toString','verify','createTransport'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2a52,0x6e));var _0x22a5=function(_0x4d5bfc,_0xf49134){_0x4d5bfc=_0x4d5bfc-0x0;var _0x531d31=_0x2a52[_0x4d5bfc];return _0x531d31;};'use strict';var nodemailer=require(_0x22a5('0x0'));var inlineBase64=require(_0x22a5('0x1'));function EmailSmtp(){}EmailSmtp[_0x22a5('0x2')][_0x22a5('0x3')]=function(_0x352051,_0x1e6c16){return new Promise(function(_0x3e1488,_0x2ef413){var _0x414570=nodemailer['createTransport'](_0x352051);_0x414570[_0x22a5('0x4')](_0x22a5('0x5'),inlineBase64());_0x414570[_0x22a5('0x6')](_0x1e6c16,function(_0x2019b1,_0x26a2cd){if(_0x2019b1){_0x2ef413(_0x2019b1[_0x22a5('0x7')]());}else{_0x3e1488(_0x26a2cd);}});});};EmailSmtp[_0x22a5('0x2')][_0x22a5('0x8')]=function(_0x44d795){return new Promise(function(_0x15ae50,_0x1ded9f){var _0x5123d3=nodemailer[_0x22a5('0x9')](_0x44d795);_0x5123d3[_0x22a5('0x8')](function(_0x248bb7,_0x48276b){if(_0x248bb7){_0x1ded9f(_0x248bb7[_0x22a5('0x7')]());}else{if(_0x48276b){_0x15ae50(_0x48276b);}else{_0x1ded9f(_0x22a5('0xa'));}}});});};module[_0x22a5('0xb')]=EmailSmtp; \ No newline at end of file +var _0xdfd5=['compile','sendMail','toString','prototype','verify','nodemailer','nodemailer-plugin-inline-base64','send','createTransport','use'];(function(_0x5e1dde,_0x428b0e){var _0x48d9a7=function(_0x1556fc){while(--_0x1556fc){_0x5e1dde['push'](_0x5e1dde['shift']());}};_0x48d9a7(++_0x428b0e);}(_0xdfd5,0x1ef));var _0x5dfd=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0xdfd5[_0x58547b];return _0x1d3fd2;};'use strict';var nodemailer=require(_0x5dfd('0x0'));var inlineBase64=require(_0x5dfd('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x5dfd('0x2')]=function(_0x17e04b,_0x41d91d){return new Promise(function(_0x4f826d,_0x163781){var _0x41ca71=nodemailer[_0x5dfd('0x3')](_0x17e04b);_0x41ca71[_0x5dfd('0x4')](_0x5dfd('0x5'),inlineBase64());_0x41ca71[_0x5dfd('0x6')](_0x41d91d,function(_0x3ce818,_0x421597){if(_0x3ce818){_0x163781(_0x3ce818[_0x5dfd('0x7')]());}else{_0x4f826d(_0x421597);}});});};EmailSmtp[_0x5dfd('0x8')][_0x5dfd('0x9')]=function(_0x3f9af4){return new Promise(function(_0x350d49,_0x3541b3){var _0xfcc832=nodemailer[_0x5dfd('0x3')](_0x3f9af4);_0xfcc832[_0x5dfd('0x9')](function(_0x5d00d3,_0x4a1997){if(_0x5d00d3){_0x3541b3(_0x5d00d3[_0x5dfd('0x7')]());}else{if(_0x4a1997){_0x350d49(_0x4a1997);}else{_0x3541b3('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index e9b14df..dd05dcc 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 _0xad5f=['Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','line','isAutoreply','parser','from','subject','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','BodyHTML','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','join','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','substring','indexOf','split','length','slice','Anonymous','isEmpty','html','test','replace','includes','\x20[Attachment:\x20','body','message','originTo','originCc','bcc','attach','type','attachment-','format','root','writeFileSync','content','headerLines'];(function(_0x1939ca,_0x226241){var _0x2404b5=function(_0x83dfb2){while(--_0x83dfb2){_0x1939ca['push'](_0x1939ca['shift']());}};_0x2404b5(++_0x226241);}(_0xad5f,0x13f));var _0xfad5=function(_0x111311,_0x1e2f69){_0x111311=_0x111311-0x0;var _0x4cef39=_0xad5f[_0x111311];return _0x4cef39;};'use strict';var _=require(_0xfad5('0x0'));var moment=require(_0xfad5('0x1'));var random=require(_0xfad5('0x2'));var fs=require('fs');var path=require(_0xfad5('0x3'));var util=require(_0xfad5('0x4'));var tnef=require(_0xfad5('0x5'));var logger=require('../../../config/logger')(_0xfad5('0x6'));var config=require(_0xfad5('0x7'));function getAddress(_0x1d5aef){var _0x23682e=_[_0xfad5('0x8')](_0x1d5aef['value']);return _0x23682e&&_0x23682e[_0xfad5('0x9')]?_0x23682e[_0xfad5('0x9')]:_0xfad5('0xa')+random[_0xfad5('0xb')](0x6)+_0xfad5('0xc');}function getFirstName(_0x398354){var _0x3b8b7c=_[_0xfad5('0x8')](_0x398354[_0xfad5('0xd')]);if(_0x3b8b7c&&_0x3b8b7c['name']){if(_0x3b8b7c[_0xfad5('0xe')]==_0x3b8b7c[_0xfad5('0x9')]){return _0x3b8b7c['name'][_0xfad5('0xf')](0x0,_0x3b8b7c['name'][_0xfad5('0x10')]('@'));}var _0x3f95f4=_0x3b8b7c[_0xfad5('0xe')][_0xfad5('0x11')](/\s+/);return _0x3f95f4[_0xfad5('0x12')]>0x1?_0x3f95f4[_0xfad5('0x13')](0x0,-0x1)['join']('\x20'):_0x3b8b7c[_0xfad5('0xe')];}return _0xfad5('0x14');}function getLastName(_0xbc8187){var _0x34c9e5=_[_0xfad5('0x8')](_0xbc8187['value']);if(_0x34c9e5&&_0x34c9e5['name']){var _0x4dc19b=_0x34c9e5['name'][_0xfad5('0x11')](/\s+/);return _0x4dc19b[_0xfad5('0x12')]>0x1?_0x4dc19b['pop']():'';}return'';}function getMails(_0x238928,_0x303e7e){var _0x3d5a4c='';for(var _0x247753=0x0;_0x247753<_0x303e7e[_0xfad5('0xd')][_0xfad5('0x12')];_0x247753+=0x1){if(_0x303e7e['value'][_0x247753][_0xfad5('0x9')]!==_0x238928){if(!_[_0xfad5('0x15')](_0x3d5a4c)){_0x3d5a4c+=',';}_0x3d5a4c+=_0x303e7e[_0xfad5('0xd')][_0x247753][_0xfad5('0xe')]||_0x303e7e[_0xfad5('0xd')][_0x247753][_0xfad5('0x9')]||'';_0x3d5a4c+='\x20<';_0x3d5a4c+=_0x303e7e[_0xfad5('0xd')][_0x247753][_0xfad5('0x9')]?_0x303e7e[_0xfad5('0xd')][_0x247753]['address']:_0xfad5('0xa')+random['generate'](0x6)+_0xfad5('0xc');_0x3d5a4c+='>';}}return _0x3d5a4c;}function parseEmail(_0x1606d6,_0x5596c4,_0x3963ea){if(_0x5596c4[_0xfad5('0x16')]){var _0x3d9591=/)<[^<]*)*<\/script>/gi;while(_0x3d9591[_0xfad5('0x17')](_0x5596c4[_0xfad5('0x16')])){_0x5596c4['html']=_0x5596c4['html'][_0xfad5('0x18')](_0x3d9591,'');}if(_0x5596c4[_0xfad5('0x16')][_0xfad5('0x19')](_0xfad5('0x1a'))){var _0x395b18=[];_0x5596c4[_0xfad5('0x1b')][_0xfad5('0x1c')](_0x27ed34=>{_0x395b18[_0xfad5('0x1d')](_0x27ed34[_0xfad5('0x1e')]);});var _0x122cb9=/]+>/g;var _0x333d32=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x768b3b=_0x5596c4[_0xfad5('0x16')][_0xfad5('0x18')](_0x333d32,'_SRC');var _0x51b8cf=_0x768b3b[_0xfad5('0x18')](_0x122cb9,_0xfad5('0x1f'));for(let _0xb4c184=0x0;_0xb4c184<_0x395b18[_0xfad5('0x12')];_0xb4c184++){var _0x145baf=_0x51b8cf[_0xfad5('0x18')](_0xfad5('0x1f'),_0xfad5('0x20')+_0x395b18[_0xb4c184]+'\x20]');_0x51b8cf=_0x145baf;}_0x5596c4['html']=_0x51b8cf;}_0x3963ea[_0xfad5('0x21')]=_0x5596c4[_0xfad5('0x16')];}else{_0x3963ea[_0xfad5('0x21')]=_0x5596c4['textAsHtml'];}if(_0x3963ea[_0xfad5('0x21')]){_0x3963ea[_0xfad5('0x21')]=_0x3963ea[_0xfad5('0x21')][_0xfad5('0x18')](/0x0){var _0x187e44=[_0xfad5('0x2e'),_0xfad5('0x2f'),'Precedence:\x20auto_reply'];for(var _0x9906a=0x0;_0x9906a<_0x5596c4[_0xfad5('0x2d')][_0xfad5('0x12')];_0x9906a++){var _0x4878be=_[_0xfad5('0x10')](_0x187e44,_0x5596c4[_0xfad5('0x2d')][_0x9906a][_0xfad5('0x30')]);if(_0x4878be>=0x0){_0x3963ea[_0xfad5('0x31')]=!![];}}}return _0x3963ea;}exports[_0xfad5('0x32')]=function(_0x1ef500,_0x52f0f1,_0x52140f){var _0x45dd0a={'from':getAddress(_0x52f0f1[_0xfad5('0x33')]),'firstName':getFirstName(_0x52f0f1[_0xfad5('0x33')]),'lastName':getLastName(_0x52f0f1['from']),'mapKey':'email','message':{'from':getMails(_0x1ef500[_0xfad5('0x6')],_0x52f0f1[_0xfad5('0x33')]),'to':_0x1ef500[_0xfad5('0x6')],'cc':'','subject':_0x52f0f1[_0xfad5('0x34')]||'','messageId':_0x52f0f1['messageId'],'inReplyTo':_0x52f0f1[_0xfad5('0x35')],'sentAt':moment(_0x52f0f1[_0xfad5('0x36')])[_0xfad5('0x29')](_0xfad5('0x37')),'attach':![],'attachments':[]}};if(!_0x52f0f1['html']&&!_0x52f0f1[_0xfad5('0x38')]){var _0x4d304f=_['filter'](_0x52f0f1['attachments'],{'contentType':'application/ms-tnef'});if(_0x4d304f[_0xfad5('0x12')]){logger[_0xfad5('0x39')](util[_0xfad5('0x29')](_0xfad5('0x3a'),_0x52f0f1[_0xfad5('0x3b')]));tnef[_0xfad5('0x3c')](_[_0xfad5('0x3d')](_0x4d304f)[_0xfad5('0x2c')],function(_0x1d6146,_0xb26d9f){if(_0xb26d9f){_0x52f0f1[_0xfad5('0x16')]=_0xb26d9f[_0xfad5('0x3e')]||'

Empty\x20message

';if(_0xb26d9f[_0xfad5('0x3f')]){for(var _0x181967=0x0;_0x181967<_0xb26d9f[_0xfad5('0x3f')][_0xfad5('0x12')];_0x181967++){var _0x32ec1a=_0xb26d9f[_0xfad5('0x3f')][_0x181967];_0x45dd0a[_0xfad5('0x22')][_0xfad5('0x1b')][_0xfad5('0x1d')]({'filename':_0x32ec1a[_0xfad5('0x40')],'content':Buffer['from'](_0x32ec1a[_0xfad5('0x41')])});}}}_0x52140f(parseEmail(_0x1ef500,_0x52f0f1,_0x45dd0a));});}else{_0x52f0f1['html']='

Empty\x20message

';_0x52140f(parseEmail(_0x1ef500,_0x52f0f1,_0x45dd0a));}}else{_0x52140f(parseEmail(_0x1ef500,_0x52f0f1,_0x45dd0a));}};exports[_0xfad5('0x42')]=function(_0x240e97,_0x43161c){var _0x42d757=[_0xfad5('0x43')+(_0x43161c||''),_0xfad5('0x44')+_0x240e97,'',''];return Buffer[_0xfad5('0x33')](_0x42d757[_0xfad5('0x45')](''),_0xfad5('0x46'))[_0xfad5('0x47')](_0xfad5('0x48'));}; \ No newline at end of file +var _0x72eb=['root','server/files/attachments/','writeFileSync','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','first','content','BodyHTML','Attachments','Title','Data','

Empty\x20message

','generateXOAuth2Token','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','util','email','../../../config/environment','head','anonymous','@xcally.com','value','name','address','substring','indexOf','split','length','slice','Anonymous','isEmpty','generate','html','replace','includes','','body','textAsHtml','message','originTo','originCc','bcc','type','attachment-','format','%s-%s','now','join'];(function(_0x44f0a1,_0x457d11){var _0x4af42e=function(_0x15fcbf){while(--_0x15fcbf){_0x44f0a1['push'](_0x44f0a1['shift']());}};_0x4af42e(++_0x457d11);}(_0x72eb,0x66));var _0xb72e=function(_0x27ffb7,_0x24bfd1){_0x27ffb7=_0x27ffb7-0x0;var _0x529475=_0x72eb[_0x27ffb7];return _0x529475;};'use strict';var _=require(_0xb72e('0x0'));var moment=require(_0xb72e('0x1'));var random=require(_0xb72e('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xb72e('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0xb72e('0x4'));var config=require(_0xb72e('0x5'));function getAddress(_0x4961f6){var _0x5980f1=_[_0xb72e('0x6')](_0x4961f6['value']);return _0x5980f1&&_0x5980f1['address']?_0x5980f1['address']:_0xb72e('0x7')+random['generate'](0x6)+_0xb72e('0x8');}function getFirstName(_0x1e4824){var _0x25d7ee=_[_0xb72e('0x6')](_0x1e4824[_0xb72e('0x9')]);if(_0x25d7ee&&_0x25d7ee[_0xb72e('0xa')]){if(_0x25d7ee[_0xb72e('0xa')]==_0x25d7ee[_0xb72e('0xb')]){return _0x25d7ee['name'][_0xb72e('0xc')](0x0,_0x25d7ee['name'][_0xb72e('0xd')]('@'));}var _0x53aeb8=_0x25d7ee[_0xb72e('0xa')][_0xb72e('0xe')](/\s+/);return _0x53aeb8[_0xb72e('0xf')]>0x1?_0x53aeb8[_0xb72e('0x10')](0x0,-0x1)['join']('\x20'):_0x25d7ee[_0xb72e('0xa')];}return _0xb72e('0x11');}function getLastName(_0x581a43){var _0x20896f=_[_0xb72e('0x6')](_0x581a43[_0xb72e('0x9')]);if(_0x20896f&&_0x20896f['name']){var _0x335bd0=_0x20896f[_0xb72e('0xa')]['split'](/\s+/);return _0x335bd0[_0xb72e('0xf')]>0x1?_0x335bd0['pop']():'';}return'';}function getMails(_0x3bbcfe,_0x16779e){var _0x278f40='';for(var _0xf03046=0x0;_0xf03046<_0x16779e[_0xb72e('0x9')][_0xb72e('0xf')];_0xf03046+=0x1){if(_0x16779e[_0xb72e('0x9')][_0xf03046][_0xb72e('0xb')]!==_0x3bbcfe){if(!_[_0xb72e('0x12')](_0x278f40)){_0x278f40+=',';}_0x278f40+=_0x16779e[_0xb72e('0x9')][_0xf03046][_0xb72e('0xa')]||_0x16779e[_0xb72e('0x9')][_0xf03046][_0xb72e('0xb')]||'';_0x278f40+='\x20<';_0x278f40+=_0x16779e[_0xb72e('0x9')][_0xf03046][_0xb72e('0xb')]?_0x16779e['value'][_0xf03046]['address']:_0xb72e('0x7')+random[_0xb72e('0x13')](0x6)+_0xb72e('0x8');_0x278f40+='>';}}return _0x278f40;}function parseEmail(_0x34a701,_0x203e78,_0x3381e0){if(_0x203e78[_0xb72e('0x14')]){var _0x1fa383=/)<[^<]*)*<\/script>/gi;while(_0x1fa383['test'](_0x203e78['html'])){_0x203e78['html']=_0x203e78['html'][_0xb72e('0x15')](_0x1fa383,'');}if(_0x203e78[_0xb72e('0x14')][_0xb72e('0x16')](_0xb72e('0x17'))){var _0x48bd44=[];_0x203e78[_0xb72e('0x18')][_0xb72e('0x19')](_0x1c6ced=>{_0x48bd44[_0xb72e('0x1a')](_0x1c6ced[_0xb72e('0x1b')]);});var _0xfc7120=/]+>/g;var _0x2b8698=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x133827=_0x203e78[_0xb72e('0x14')][_0xb72e('0x15')](_0x2b8698,'_SRC');var _0x1a68d0=_0x133827['replace'](_0xfc7120,'_IMG');for(let _0x10f7ec=0x0;_0x10f7ec<_0x48bd44[_0xb72e('0xf')];_0x10f7ec++){var _0x21e14f=_0x1a68d0['replace'](_0xb72e('0x1c'),'\x20[Attachment:\x20'+_0x48bd44[_0x10f7ec]+_0xb72e('0x1d'));_0x1a68d0=_0x21e14f;}_0x203e78[_0xb72e('0x14')]=_0x1a68d0;}_0x3381e0[_0xb72e('0x1e')]=_0x203e78[_0xb72e('0x14')];}else{_0x3381e0[_0xb72e('0x1e')]=_0x203e78[_0xb72e('0x1f')];}if(_0x3381e0[_0xb72e('0x1e')]){_0x3381e0[_0xb72e('0x1e')]=_0x3381e0['body'][_0xb72e('0x15')](/0x0){var _0x45ffea=[_0xb72e('0x2f'),_0xb72e('0x30'),'Precedence:\x20auto_reply'];for(var _0x4b28c1=0x0;_0x4b28c1<_0x203e78[_0xb72e('0x2e')][_0xb72e('0xf')];_0x4b28c1++){var _0x5b5270=_[_0xb72e('0xd')](_0x45ffea,_0x203e78[_0xb72e('0x2e')][_0x4b28c1]['line']);if(_0x5b5270>=0x0){_0x3381e0[_0xb72e('0x31')]=!![];}}}return _0x3381e0;}exports[_0xb72e('0x32')]=function(_0x53734c,_0x1bda5e,_0x4449b2){var _0xc64afb={'from':getAddress(_0x1bda5e['from']),'firstName':getFirstName(_0x1bda5e[_0xb72e('0x33')]),'lastName':getLastName(_0x1bda5e['from']),'mapKey':_0xb72e('0x4'),'message':{'from':getMails(_0x53734c[_0xb72e('0x4')],_0x1bda5e[_0xb72e('0x33')]),'to':_0x53734c[_0xb72e('0x4')],'cc':'','subject':_0x1bda5e[_0xb72e('0x34')]||'','messageId':_0x1bda5e[_0xb72e('0x35')],'inReplyTo':_0x1bda5e[_0xb72e('0x36')],'sentAt':moment(_0x1bda5e[_0xb72e('0x37')])[_0xb72e('0x26')](_0xb72e('0x38')),'attach':![],'attachments':[]}};if(!_0x1bda5e[_0xb72e('0x14')]&&!_0x1bda5e[_0xb72e('0x1f')]){var _0x2f2e41=_[_0xb72e('0x39')](_0x1bda5e[_0xb72e('0x18')],{'contentType':_0xb72e('0x3a')});if(_0x2f2e41[_0xb72e('0xf')]){logger[_0xb72e('0x3b')](util[_0xb72e('0x26')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x1bda5e[_0xb72e('0x35')]));tnef['parseBuffer'](_[_0xb72e('0x3c')](_0x2f2e41)[_0xb72e('0x3d')],function(_0x100e7b,_0x5ebf2f){if(_0x5ebf2f){_0x1bda5e[_0xb72e('0x14')]=_0x5ebf2f[_0xb72e('0x3e')]||'

Empty\x20message

';if(_0x5ebf2f['Attachments']){for(var _0x1cf30b=0x0;_0x1cf30b<_0x5ebf2f[_0xb72e('0x3f')]['length'];_0x1cf30b++){var _0x4b9c0a=_0x5ebf2f['Attachments'][_0x1cf30b];_0xc64afb[_0xb72e('0x20')]['attachments'][_0xb72e('0x1a')]({'filename':_0x4b9c0a[_0xb72e('0x40')],'content':Buffer[_0xb72e('0x33')](_0x4b9c0a[_0xb72e('0x41')])});}}}_0x4449b2(parseEmail(_0x53734c,_0x1bda5e,_0xc64afb));});}else{_0x1bda5e[_0xb72e('0x14')]=_0xb72e('0x42');_0x4449b2(parseEmail(_0x53734c,_0x1bda5e,_0xc64afb));}}else{_0x4449b2(parseEmail(_0x53734c,_0x1bda5e,_0xc64afb));}};exports[_0xb72e('0x43')]=function(_0x3c923b,_0x35886b){var _0x7794b3=['user='+(_0x35886b||''),_0xb72e('0x44')+_0x3c923b,'',''];return Buffer[_0xb72e('0x33')](_0x7794b3['join'](''),_0xb72e('0x45'))[_0xb72e('0x46')](_0xb72e('0x47'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 772c939..1ce530a 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 _0x910e=['Smtp','exports','name','key','SERV','active','Imap'];(function(_0x4d5721,_0x3333c9){var _0xe85884=function(_0x1870ca){while(--_0x1870ca){_0x4d5721['push'](_0x4d5721['shift']());}};_0xe85884(++_0x3333c9);}(_0x910e,0x9c));var _0xe910=function(_0x3f6a37,_0x277703){_0x3f6a37=_0x3f6a37-0x0;var _0x47f4a6=_0x910e[_0x3f6a37];return _0x47f4a6;};'use strict';var _=require('lodash');function MailAccount(_0x594636){this['id']=_0x594636['id']||0x0;this['name']=_0x594636[_0xe910('0x0')]||'Service';this[_0xe910('0x1')]=_0x594636['key']||_0xe910('0x2');this[_0xe910('0x3')]=_0x594636['active']||![];this['Imap']=_0x594636[_0xe910('0x4')]||[];this[_0xe910('0x5')]=_0x594636[_0xe910('0x5')]||[];}module[_0xe910('0x6')]=MailAccount; \ No newline at end of file +var _0xc892=['Smtp','exports','lodash','name','Service','key','SERV','active','Imap'];(function(_0x128443,_0x2fe025){var _0x1a4ce1=function(_0x12d72c){while(--_0x12d72c){_0x128443['push'](_0x128443['shift']());}};_0x1a4ce1(++_0x2fe025);}(_0xc892,0xec));var _0x2c89=function(_0x12cfae,_0x28b391){_0x12cfae=_0x12cfae-0x0;var _0x2fd710=_0xc892[_0x12cfae];return _0x2fd710;};'use strict';var _=require(_0x2c89('0x0'));function MailAccount(_0x5f106){this['id']=_0x5f106['id']||0x0;this[_0x2c89('0x1')]=_0x5f106[_0x2c89('0x1')]||_0x2c89('0x2');this[_0x2c89('0x3')]=_0x5f106['key']||_0x2c89('0x4');this[_0x2c89('0x5')]=_0x5f106['active']||![];this['Imap']=_0x5f106[_0x2c89('0x6')]||[];this['Smtp']=_0x5f106[_0x2c89('0x7')]||[];}module[_0x2c89('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 94b8ede..e3c6dcf 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 _0x6dd6=['mapKeys','hasOwnProperty','mergeFromDatabase','initMailAccounts','merge','exports','lodash','../model/mailAccount','mailAccounts'];(function(_0x3cd3c7,_0x1ed8d6){var _0x1a883a=function(_0x1b33b4){while(--_0x1b33b4){_0x3cd3c7['push'](_0x3cd3c7['shift']());}};_0x1a883a(++_0x1ed8d6);}(_0x6dd6,0xde));var _0x66dd=function(_0x1a3ca2,_0xe144e7){_0x1a3ca2=_0x1a3ca2-0x0;var _0x30ea08=_0x6dd6[_0x1a3ca2];return _0x30ea08;};'use strict';var _=require(_0x66dd('0x0'));var MailAccount=require(_0x66dd('0x1'));var Realtime=function(){this[_0x66dd('0x2')]={};};function freeIsNotKey(_0x2b89f7,_0x4ca0b8,_0x3f9b93){var _0xecd877=_[_0x66dd('0x3')](_0x2b89f7,function(_0x4493b3,_0x536988){return _0x4493b3[_0x3f9b93];});for(var _0x198e1a in _0x4ca0b8){if(_0x4ca0b8[_0x66dd('0x4')](_0x198e1a)){if(!_0xecd877[_0x198e1a]){delete _0x4ca0b8[_0x198e1a];}}}}Realtime['prototype'][_0x66dd('0x5')]=function(_0x4e224c,_0x1e95d9){for(var _0x384e90 in _0x1e95d9){if(_0x4e224c[_0x66dd('0x4')](_0x384e90)){_0x4e224c[_0x384e90]=_0x1e95d9[_0x384e90];}}};Realtime['prototype'][_0x66dd('0x6')]=function(){var _0x4ee495=this;return function(_0x20ce9b){if(_0x20ce9b){freeIsNotKey(_0x20ce9b,_0x4ee495[_0x66dd('0x2')],'id');for(var _0x21aed7=0x0,_0x3a4504={},_0x3ffe4d={};_0x21aed7<_0x20ce9b['length'];_0x21aed7+=0x1){_0x3a4504=_0x20ce9b[_0x21aed7];if(_['isUndefined'](_0x4ee495[_0x66dd('0x2')][_0x3a4504['id']])){_0x4ee495[_0x66dd('0x2')][_0x3a4504['id']]=new MailAccount(_0x3a4504);}else{_[_0x66dd('0x7')](_0x4ee495['mailAccounts'][_0x3a4504['id']],_0x3a4504);}}}return _0x4ee495[_0x66dd('0x2')];};};module[_0x66dd('0x8')]=Realtime; \ No newline at end of file +var _0x429c=['prototype','mergeFromDatabase','hasOwnProperty','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys'];(function(_0x1e9eb7,_0x40dc75){var _0x4a4f25=function(_0xe0fcf1){while(--_0xe0fcf1){_0x1e9eb7['push'](_0x1e9eb7['shift']());}};_0x4a4f25(++_0x40dc75);}(_0x429c,0xec));var _0xc429=function(_0x17fe20,_0x1d9aad){_0x17fe20=_0x17fe20-0x0;var _0x2dd8a1=_0x429c[_0x17fe20];return _0x2dd8a1;};'use strict';var _=require(_0xc429('0x0'));var MailAccount=require(_0xc429('0x1'));var Realtime=function(){this[_0xc429('0x2')]={};};function freeIsNotKey(_0xe54b98,_0x10a7e8,_0x24fd3f){var _0x26f1fb=_[_0xc429('0x3')](_0xe54b98,function(_0x4d6eda,_0x1d8a0e){return _0x4d6eda[_0x24fd3f];});for(var _0x43da49 in _0x10a7e8){if(_0x10a7e8['hasOwnProperty'](_0x43da49)){if(!_0x26f1fb[_0x43da49]){delete _0x10a7e8[_0x43da49];}}}}Realtime[_0xc429('0x4')][_0xc429('0x5')]=function(_0x121475,_0x12ea77){for(var _0x30e1b3 in _0x12ea77){if(_0x121475[_0xc429('0x6')](_0x30e1b3)){_0x121475[_0x30e1b3]=_0x12ea77[_0x30e1b3];}}};Realtime[_0xc429('0x4')]['initMailAccounts']=function(){var _0x111c72=this;return function(_0x5e141e){if(_0x5e141e){freeIsNotKey(_0x5e141e,_0x111c72[_0xc429('0x2')],'id');for(var _0x51a5ae=0x0,_0x39897b={},_0x51a436={};_0x51a5ae<_0x5e141e['length'];_0x51a5ae+=0x1){_0x39897b=_0x5e141e[_0x51a5ae];if(_[_0xc429('0x7')](_0x111c72[_0xc429('0x2')][_0x39897b['id']])){_0x111c72[_0xc429('0x2')][_0x39897b['id']]=new MailAccount(_0x39897b);}else{_[_0xc429('0x8')](_0x111c72[_0xc429('0x2')][_0x39897b['id']],_0x39897b);}}}return _0x111c72['mailAccounts'];};};module[_0xc429('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 4919e4b..da7f14e 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 _0x1156=['service','active','ListId','TemplateId','MailServerIn','Imap','name','type','data5','CloudProvider','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','provider'];(function(_0x1c486b,_0x1b36f8){var _0x55fa00=function(_0x4b3008){while(--_0x4b3008){_0x1c486b['push'](_0x1c486b['shift']());}};_0x55fa00(++_0x1b36f8);}(_0x1156,0x93));var _0x6115=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x1156[_0x4bb66f];return _0xf2772f;};'use strict';var client=require(_0x6115('0x0'));exports[_0x6115('0x1')]=function(){return function(){return client[_0x6115('0x2')](_0x6115('0x3'),{'options':{'attributes':['id','name',_0x6115('0x4'),_0x6115('0x5'),'email',_0x6115('0x6'),'key',_0x6115('0x7'),_0x6115('0x8')],'raw':![],'include':[{'model':_0x6115('0x9'),'as':_0x6115('0xa'),'include':[{'model':'CloudProvider','attributes':['id',_0x6115('0xb'),_0x6115('0x5'),_0x6115('0xc'),_0x6115('0xd')],'as':_0x6115('0xe')}]},{'model':'MailServerOut','as':_0x6115('0xf'),'include':[{'model':_0x6115('0xe'),'attributes':['id',_0x6115('0xb'),_0x6115('0x5'),'type',_0x6115('0xd')],'as':_0x6115('0xe')}]}]},'log':_0x6115('0x10')});};};exports[_0x6115('0x11')]=function(_0x285ebd,_0xc2d1a4){return client[_0x6115('0x2')](_0x6115('0x12'),{'account':{'id':_0x285ebd},'body':_0xc2d1a4,'log':_0x6115('0x12')});}; \ No newline at end of file +var _0x7add=['email','key','ListId','Imap','service','data5','CloudProvider','MailServerOut','type','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','name','provider'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7add,0x72));var _0xd7ad=function(_0x5d7eed,_0x2431b4){_0x5d7eed=_0x5d7eed-0x0;var _0x401d15=_0x7add[_0x5d7eed];return _0x401d15;};'use strict';var client=require(_0xd7ad('0x0'));exports[_0xd7ad('0x1')]=function(){return function(){return client[_0xd7ad('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0xd7ad('0x3'),_0xd7ad('0x4'),'service',_0xd7ad('0x5'),'active',_0xd7ad('0x6'),_0xd7ad('0x7'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0xd7ad('0x8'),'include':[{'model':'CloudProvider','attributes':['id','name',_0xd7ad('0x9'),'type',_0xd7ad('0xa')],'as':_0xd7ad('0xb')}]},{'model':_0xd7ad('0xc'),'as':'Smtp','include':[{'model':_0xd7ad('0xb'),'attributes':['id',_0xd7ad('0x3'),'service',_0xd7ad('0xd'),_0xd7ad('0xa')],'as':'CloudProvider'}]}]},'log':_0xd7ad('0xe')});};};exports[_0xd7ad('0xf')]=function(_0x1ee2e6,_0x509d1f){return client['Request'](_0xd7ad('0x10'),{'account':{'id':_0x1ee2e6},'body':_0x509d1f,'log':_0xd7ad('0x10')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index eee7a83..d010f50 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 _0xb70a=['GetSettings','../client','getSettings','Request','loginMailFrequency'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0xb70a,0x1be));var _0xab70=function(_0x375f1f,_0x4eb45b){_0x375f1f=_0x375f1f-0x0;var _0x30b8d7=_0xb70a[_0x375f1f];return _0x30b8d7;};'use strict';var client=require(_0xab70('0x0'));exports[_0xab70('0x1')]=function(){return client[_0xab70('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xab70('0x3')]},'log':_0xab70('0x4')});}; \ No newline at end of file +var _0x02d4=['GetSettings','getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x22ee91,_0x4e861e){var _0x53ec82=function(_0x4b93d1){while(--_0x4b93d1){_0x22ee91['push'](_0x22ee91['shift']());}};_0x53ec82(++_0x4e861e);}(_0x02d4,0x128));var _0x402d=function(_0x3b4e1c,_0x2da144){_0x3b4e1c=_0x3b4e1c-0x0;var _0x1c71a7=_0x02d4[_0x3b4e1c];return _0x1c71a7;};'use strict';var client=require('../client');exports[_0x402d('0x0')]=function(){return client[_0x402d('0x1')](_0x402d('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x402d('0x3')]},'log':_0x402d('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index c49f9e7..e229b95 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 d4e4823..73ce413 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 _0x9fda=['../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','express','sticky-session','ioredis','../../config/environment','timeout','listen','port','polling','redis','defaults','localhost','socket.io-redis','../../config/socketio','default'];(function(_0x454d0f,_0x3c72b0){var _0x54973d=function(_0x9e07e1){while(--_0x9e07e1){_0x454d0f['push'](_0x454d0f['shift']());}};_0x54973d(++_0x3c72b0);}(_0x9fda,0x64));var _0xa9fd=function(_0x209a65,_0x1671b4){_0x209a65=_0x209a65-0x0;var _0x21db9c=_0x9fda[_0x209a65];return _0x21db9c;};'use strict';var _=require('lodash');var http=require('http');var express=require(_0xa9fd('0x0'));var sticky=require(_0xa9fd('0x1'));var Redis=require(_0xa9fd('0x2'));var config=require(_0xa9fd('0x3'));var app=express();var server=http['createServer'](app);server[_0xa9fd('0x4')]=0xdbba0;if(sticky[_0xa9fd('0x5')](server,config[_0xa9fd('0x6')])){var socketio=require('socket.io')(server,{'transports':['websocket',_0xa9fd('0x7')]});config[_0xa9fd('0x8')]=_[_0xa9fd('0x9')](config[_0xa9fd('0x8')],{'host':_0xa9fd('0xa'),'port':0x18eb});socketio['adapter'](require(_0xa9fd('0xb'))({'pubClient':new Redis(config[_0xa9fd('0x8')]),'subClient':new Redis(config[_0xa9fd('0x8')])}));require('../../config/triggers')['default']();require(_0xa9fd('0xc'))[_0xa9fd('0xd')](socketio);require(_0xa9fd('0xe'))[_0xa9fd('0xd')](app);require('../../routes')[_0xa9fd('0xd')](app);}else{server[_0xa9fd('0xf')](_0xa9fd('0x10'),function(){console[_0xa9fd('0x11')](_0xa9fd('0x12'),config['port']);});}exports=module['exports']=app; \ No newline at end of file +var _0x4c72=['default','../../config/socketio','../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','redis','defaults','adapter','socket.io-redis','../../config/triggers'];(function(_0x76d2fb,_0x189cbf){var _0x2101b3=function(_0x1b84d5){while(--_0x1b84d5){_0x76d2fb['push'](_0x76d2fb['shift']());}};_0x2101b3(++_0x189cbf);}(_0x4c72,0x17e));var _0x24c7=function(_0x46a278,_0x2ab5e4){_0x46a278=_0x46a278-0x0;var _0x5df13b=_0x4c72[_0x46a278];return _0x5df13b;};'use strict';var _=require('lodash');var http=require(_0x24c7('0x0'));var express=require(_0x24c7('0x1'));var sticky=require(_0x24c7('0x2'));var Redis=require(_0x24c7('0x3'));var config=require(_0x24c7('0x4'));var app=express();var server=http[_0x24c7('0x5')](app);server[_0x24c7('0x6')]=0xdbba0;if(sticky[_0x24c7('0x7')](server,config[_0x24c7('0x8')])){var socketio=require('socket.io')(server,{'transports':['websocket','polling']});config[_0x24c7('0x9')]=_[_0x24c7('0xa')](config[_0x24c7('0x9')],{'host':'localhost','port':0x18eb});socketio[_0x24c7('0xb')](require(_0x24c7('0xc'))({'pubClient':new Redis(config[_0x24c7('0x9')]),'subClient':new Redis(config[_0x24c7('0x9')])}));require(_0x24c7('0xd'))[_0x24c7('0xe')]();require(_0x24c7('0xf'))[_0x24c7('0xe')](socketio);require(_0x24c7('0x10'))[_0x24c7('0xe')](app);require('../../routes')[_0x24c7('0xe')](app);}else{server[_0x24c7('0x11')](_0x24c7('0x12'),function(){console[_0x24c7('0x13')](_0x24c7('0x14'),config[_0x24c7('0x8')]);});}exports=module[_0x24c7('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 559406d..a854ddb 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 _0x751a=['request','then','debug','rpc','message','error','result','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request'];(function(_0x41d02a,_0x355e19){var _0x4c3983=function(_0x4802a7){while(--_0x4802a7){_0x41d02a['push'](_0x41d02a['shift']());}};_0x4c3983(++_0x355e19);}(_0x751a,0x18e));var _0xa751=function(_0x473463,_0x21da73){_0x473463=_0x473463-0x0;var _0x42f406=_0x751a[_0x473463];return _0x42f406;};'use strict';var jayson=require(_0xa751('0x0'));var BPromise=require(_0xa751('0x1'));var logger=require(_0xa751('0x2'))(_0xa751('0x3'));var client=jayson[_0xa751('0x4')][_0xa751('0x5')]({'port':0x2329});client[_0xa751('0x6')]=function(_0x4e58f0,_0x1ec2cb){return new BPromise(function(_0x5c828a,_0x1878b0){return client[_0xa751('0x7')](_0x4e58f0,_0x1ec2cb)[_0xa751('0x8')](function(_0x20ed38){logger[_0xa751('0x9')](_0xa751('0xa'),'routing',_0x4e58f0,_0x1ec2cb,_0x20ed38);if(_0x20ed38['error']){logger['error'](_0xa751('0xa'),'routing',_0x4e58f0,_0x20ed38['error'][_0xa751('0xb')],_0x1ec2cb);return _0x1878b0(_0x20ed38[_0xa751('0xc')]['message']);}else{return _0x5c828a(_0x20ed38[_0xa751('0xd')]);}})['catch'](function(_0x39ae54){logger[_0xa751('0xc')](_0xa751('0xa'),_0xa751('0x3'),_0x4e58f0,_0x39ae54,_0x1ec2cb);return _0x1878b0(_0x39ae54);});});};module[_0xa751('0xe')]=client; \ No newline at end of file +var _0x323e=['http','Request','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client'];(function(_0x2ca005,_0x139781){var _0x1ab0b1=function(_0x8bcce1){while(--_0x8bcce1){_0x2ca005['push'](_0x2ca005['shift']());}};_0x1ab0b1(++_0x139781);}(_0x323e,0x14b));var _0xe323=function(_0x1ac8dd,_0x36b525){_0x1ac8dd=_0x1ac8dd-0x0;var _0x269fcc=_0x323e[_0x1ac8dd];return _0x269fcc;};'use strict';var jayson=require(_0xe323('0x0'));var BPromise=require(_0xe323('0x1'));var logger=require(_0xe323('0x2'))(_0xe323('0x3'));var client=jayson[_0xe323('0x4')][_0xe323('0x5')]({'port':0x2329});client[_0xe323('0x6')]=function(_0x436f42,_0x4a4560){return new BPromise(function(_0x4eded6,_0x403049){return client[_0xe323('0x7')](_0x436f42,_0x4a4560)[_0xe323('0x8')](function(_0x3be398){logger[_0xe323('0x9')](_0xe323('0xa'),_0xe323('0x3'),_0x436f42,_0x4a4560,_0x3be398);if(_0x3be398['error']){logger[_0xe323('0xb')](_0xe323('0xa'),_0xe323('0x3'),_0x436f42,_0x3be398[_0xe323('0xb')]['message'],_0x4a4560);return _0x403049(_0x3be398[_0xe323('0xb')][_0xe323('0xc')]);}else{return _0x4eded6(_0x3be398[_0xe323('0xd')]);}})[_0xe323('0xe')](function(_0x155793){logger[_0xe323('0xb')]('rpc',_0xe323('0x3'),_0x436f42,_0x155793,_0x4a4560);return _0x403049(_0x155793);});});};module[_0xe323('0xf')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 073a5a1..ebdec8b 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 _0x2cc7=['then','getAgents','initAgents','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve'];(function(_0x20d694,_0x1100fe){var _0x23b7ca=function(_0xfcc998){while(--_0xfcc998){_0x20d694['push'](_0x20d694['shift']());}};_0x23b7ca(++_0x1100fe);}(_0x2cc7,0x117));var _0x72cc=function(_0x19c668,_0x5900d9){_0x19c668=_0x19c668-0x0;var _0x4a446c=_0x2cc7[_0x19c668];return _0x4a446c;};'use strict';var BPromise=require(_0x72cc('0x0'));var server=require(_0x72cc('0x1'));var Realtime=require(_0x72cc('0x2'));var user=require(_0x72cc('0x3'));var interval=require(_0x72cc('0x4'));var openchannelQueue=require(_0x72cc('0x5'));var chatQueue=require(_0x72cc('0x6'));var smsQueue=require(_0x72cc('0x7'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x72cc('0x8'));var whatsappQueue=require(_0x72cc('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x72cc('0xa')]()[_0x72cc('0xb')](user[_0x72cc('0xc')]())[_0x72cc('0xb')](realtime[_0x72cc('0xd')]())[_0x72cc('0xb')](interval['getIntervals']())[_0x72cc('0xb')](realtime[_0x72cc('0xe')]())[_0x72cc('0xb')](openchannelQueue[_0x72cc('0xf')]())[_0x72cc('0xb')](realtime['initOpenchannelQueues']())['then'](chatQueue[_0x72cc('0x10')]())[_0x72cc('0xb')](realtime[_0x72cc('0x11')]())[_0x72cc('0xb')](smsQueue[_0x72cc('0x12')]())[_0x72cc('0xb')](realtime[_0x72cc('0x13')]())[_0x72cc('0xb')](mailQueue[_0x72cc('0x14')]())['then'](realtime[_0x72cc('0x15')]())[_0x72cc('0xb')](faxQueue[_0x72cc('0x16')]())[_0x72cc('0xb')](realtime[_0x72cc('0x17')]())[_0x72cc('0xb')](whatsappQueue[_0x72cc('0x18')]())[_0x72cc('0xb')](realtime[_0x72cc('0x19')]())['then'](function(){return realtime;});}function main(){return server[_0x72cc('0x1a')](realtime)['then'](function(_0x50b478){return initRealtime();})[_0x72cc('0xb')](function(_0x5d59c4){return setInterval(initRealtime,0x1388);})[_0x72cc('0x1b')](function(_0x50faf1){console[_0x72cc('0x1c')](_0x50faf1);});}main(); \ No newline at end of file +var _0x0d39=['initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','initAgents','getIntervals','then','initIntervals','getOpenchannelQueues','getChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0d39,0x13d));var _0x90d3=function(_0x64bea6,_0x46d676){_0x64bea6=_0x64bea6-0x0;var _0x103a8f=_0x0d39[_0x64bea6];return _0x103a8f;};'use strict';var BPromise=require(_0x90d3('0x0'));var server=require(_0x90d3('0x1'));var Realtime=require(_0x90d3('0x2'));var user=require(_0x90d3('0x3'));var interval=require(_0x90d3('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x90d3('0x5'));var smsQueue=require(_0x90d3('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x90d3('0x7'));var whatsappQueue=require(_0x90d3('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x90d3('0x9')]()['then'](user['getAgents']())['then'](realtime[_0x90d3('0xa')]())['then'](interval[_0x90d3('0xb')]())[_0x90d3('0xc')](realtime[_0x90d3('0xd')]())['then'](openchannelQueue[_0x90d3('0xe')]())[_0x90d3('0xc')](realtime['initOpenchannelQueues']())[_0x90d3('0xc')](chatQueue[_0x90d3('0xf')]())[_0x90d3('0xc')](realtime['initChatQueues']())[_0x90d3('0xc')](smsQueue[_0x90d3('0x10')]())[_0x90d3('0xc')](realtime[_0x90d3('0x11')]())[_0x90d3('0xc')](mailQueue[_0x90d3('0x12')]())[_0x90d3('0xc')](realtime[_0x90d3('0x13')]())['then'](faxQueue[_0x90d3('0x14')]())[_0x90d3('0xc')](realtime[_0x90d3('0x15')]())[_0x90d3('0xc')](whatsappQueue[_0x90d3('0x16')]())['then'](realtime['initWhatsappQueues']())[_0x90d3('0xc')](function(){return realtime;});}function main(){return server[_0x90d3('0x17')](realtime)[_0x90d3('0xc')](function(_0x549055){return initRealtime();})[_0x90d3('0xc')](function(_0x541fc1){return setInterval(initRealtime,0x1388);})[_0x90d3('0x18')](function(_0x5e84aa){console[_0x90d3('0x19')](_0x5e84aa);});}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 d80a68b..2ebb161 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 _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x4274de,_0x1de9a3){var _0x16edcf=function(_0x4be015){while(--_0x4be015){_0x4274de['push'](_0x4274de['shift']());}};_0x16edcf(++_0x1de9a3);}(_0x7a54,0x106));var _0x47a5=function(_0x171963,_0x30ec97){_0x171963=_0x171963-0x0;var _0x2b8585=_0x7a54[_0x171963];return _0x2b8585;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file +var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x46ef1d,_0x24926){var _0x49ce69=function(_0x5db4fc){while(--_0x5db4fc){_0x46ef1d['push'](_0x46ef1d['shift']());}};_0x49ce69(++_0x24926);}(_0x814b,0x1a2));var _0xb814=function(_0x5da63e,_0x4d3503){_0x5da63e=_0x5da63e-0x0;var _0x442aca=_0x814b[_0x5da63e];return _0x442aca;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};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 84af792..c35c5b7 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 _0x8d39=['catch','sendMailMessage','SendMail','jayson/promise','client','http','then','error','result'];(function(_0x253946,_0x1c8d56){var _0x198cd6=function(_0x502fa3){while(--_0x502fa3){_0x253946['push'](_0x253946['shift']());}};_0x198cd6(++_0x1c8d56);}(_0x8d39,0x123));var _0x98d3=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x8d39[_0x5f0089];return _0x193892;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x98d3('0x0'));var client=jayson[_0x98d3('0x1')][_0x98d3('0x2')]({'port':0x232b});function request(_0x822e69,_0x3961dc){return new BPromise(function(_0x3b828d,_0x4cdbb4){return client['request'](_0x822e69,_0x3961dc)[_0x98d3('0x3')](function(_0x1eb3bd){if(_0x1eb3bd[_0x98d3('0x4')]){return _0x4cdbb4(_0x1eb3bd[_0x98d3('0x4')]['message']);}else{return _0x3b828d(_0x1eb3bd[_0x98d3('0x5')]);}})[_0x98d3('0x6')](function(_0x28e79e){return _0x4cdbb4(_0x28e79e);});});}exports[_0x98d3('0x7')]=function(_0x56528a,_0x4434c1){return request(_0x98d3('0x8'),{'account':_0x56528a,'message':_0x4434c1});}; \ No newline at end of file +var _0xe339=['then','error','message','result','SendMail','bluebird','jayson/promise','http'];(function(_0x286771,_0x47ea70){var _0x23b2b3=function(_0x128d64){while(--_0x128d64){_0x286771['push'](_0x286771['shift']());}};_0x23b2b3(++_0x47ea70);}(_0xe339,0xfd));var _0x9e33=function(_0xdfcf22,_0x322509){_0xdfcf22=_0xdfcf22-0x0;var _0x59b62f=_0xe339[_0xdfcf22];return _0x59b62f;};'use strict';var BPromise=require(_0x9e33('0x0'));var jayson=require(_0x9e33('0x1'));var client=jayson['client'][_0x9e33('0x2')]({'port':0x232b});function request(_0x468a29,_0x3db8ad){return new BPromise(function(_0x102bcb,_0x52e84f){return client['request'](_0x468a29,_0x3db8ad)[_0x9e33('0x3')](function(_0x28bea5){if(_0x28bea5[_0x9e33('0x4')]){return _0x52e84f(_0x28bea5[_0x9e33('0x4')][_0x9e33('0x5')]);}else{return _0x102bcb(_0x28bea5[_0x9e33('0x6')]);}})['catch'](function(_0x357347){return _0x52e84f(_0x357347);});});}exports['sendMailMessage']=function(_0x54bafa,_0x468c01){return request(_0x9e33('0x7'),{'account':_0x54bafa,'message':_0x468c01});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index cb8cd04..cb4cb9d 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 _0x1893=['getChannelStatus','CurrentCapacity','Capacity','working','idle','updateRealtime','mail','chat','openchannel','fax','sms','Status','StatusTime','toNumber','format','chatCurrentCapacity','faxStatusTime','smsCapacity','whatsappStatus','whatsappCurrentCapacity','chatWaitingInteractions','smsWaitingInteractions','stringify','emit','omit','exports','moment','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','prototype'];(function(_0x323795,_0x229a4d){var _0x59466b=function(_0x1cd9bc){while(--_0x1cd9bc){_0x323795['push'](_0x323795['shift']());}};_0x59466b(++_0x229a4d);}(_0x1893,0xa2));var _0x3189=function(_0x51f5f7,_0x4e1492){_0x51f5f7=_0x51f5f7-0x0;var _0x6afaa=_0x1893[_0x51f5f7];return _0x6afaa;};'use strict';var _=require('lodash');var md5=require('md5');var moment=require(_0x3189('0x0'));var Redis=require(_0x3189('0x1'));var config=require(_0x3189('0x2'));config[_0x3189('0x3')]=_[_0x3189('0x4')](config[_0x3189('0x3')],{'host':_0x3189('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3189('0x3')]));function Agent(_0x4faebf){this['id']=_0x4faebf['id']||0x0;this[_0x3189('0x6')]=_0x4faebf[_0x3189('0x6')]||'';this[_0x3189('0x7')]=_0x4faebf[_0x3189('0x7')]||!![];this[_0x3189('0x8')]=_0x4faebf[_0x3189('0x8')]||![];this['chatPause']=_0x4faebf[_0x3189('0x9')]||![];this['mailPause']=_0x4faebf[_0x3189('0xa')]||![];this['faxPause']=_0x4faebf[_0x3189('0xb')]||![];this[_0x3189('0xc')]=_0x4faebf[_0x3189('0xc')]||![];this[_0x3189('0xd')]=_0x4faebf['openchannelPause']||![];this[_0x3189('0xe')]=_0x3189('0xf');this[_0x3189('0x10')]=0x0;this[_0x3189('0x11')]=_0x4faebf[_0x3189('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x3189('0x12')]=_0x3189('0xf');this[_0x3189('0x13')]=0x0;this[_0x3189('0x14')]=_0x4faebf[_0x3189('0x14')]||0x0;this[_0x3189('0x15')]=0x0;this[_0x3189('0x16')]=_0x3189('0xf');this['faxStatusTime']=0x0;this[_0x3189('0x17')]=_0x4faebf[_0x3189('0x17')]||0x0;this[_0x3189('0x18')]=0x0;this[_0x3189('0x19')]='unknown';this[_0x3189('0x1a')]=0x0;this['smsCapacity']=_0x4faebf['smsCapacity']||0x0;this[_0x3189('0x1b')]=0x0;this['whatsappStatus']=_0x3189('0xf');this[_0x3189('0x1c')]=0x0;this[_0x3189('0x1d')]=_0x4faebf[_0x3189('0x1d')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x3189('0x1e')]=_0x3189('0xf');this[_0x3189('0x1f')]=0x0;this['openchannelCapacity']=_0x4faebf[_0x3189('0x20')]||0x0;this[_0x3189('0x21')]=0x0;this[_0x3189('0x22')]=![];this[_0x3189('0x23')]=undefined;this[_0x3189('0x24')]='';this['chatWaitingInteractions']={};this[_0x3189('0x25')]={};this[_0x3189('0x26')]={};this[_0x3189('0x27')]={};this['smsWaitingInteractions']={};this[_0x3189('0x28')]={};this['updateRealtime']();}Agent[_0x3189('0x29')][_0x3189('0x2a')]=function(_0x200f16){if(this[_0x200f16+_0x3189('0x2b')]>0x0){if(this[_0x200f16+_0x3189('0x2c')]>0x0&&this[_0x200f16+_0x3189('0x2b')]>=this[_0x200f16+'Capacity']){return'maxcapacity';}else{return _0x3189('0x2d');}}else{return _0x3189('0x2e');}};Agent[_0x3189('0x29')][_0x3189('0x2f')]=function(){var _0x103de4=[_0x3189('0x30'),_0x3189('0x31'),_0x3189('0x32'),_0x3189('0x33'),_0x3189('0x34'),'whatsapp'];for(var _0x4c4a5e=0x0;_0x4c4a5e<_0x103de4['length'];_0x4c4a5e+=0x1){var _0x2a8308=this[_0x3189('0x2a')](_0x103de4[_0x4c4a5e]);if(this[_0x103de4[_0x4c4a5e]+_0x3189('0x35')]!==_0x2a8308){this[_0x103de4[_0x4c4a5e]+_0x3189('0x36')]=_[_0x3189('0x37')](moment()[_0x3189('0x38')]('x'));}this[_0x103de4[_0x4c4a5e]+'Status']=_0x2a8308;}var _0x1ab94b={'id':this['id'],'name':this[_0x3189('0x6')],'online':this['online'],'voicePause':this[_0x3189('0x8')],'chatPause':this[_0x3189('0x9')],'mailPause':this[_0x3189('0xa')],'smsPause':this['smsPause'],'faxPause':this[_0x3189('0xb')],'openchannelPause':this[_0x3189('0xd')],'chatStatus':this[_0x3189('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x3189('0x11')],'chatCurrentCapacity':this[_0x3189('0x39')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x3189('0x13')],'mailCapacity':this[_0x3189('0x14')],'mailCurrentCapacity':this[_0x3189('0x15')],'faxStatus':this[_0x3189('0x16')],'faxStatusTime':this[_0x3189('0x3a')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x3189('0x19')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x3189('0x3b')],'smsCurrentCapacity':this[_0x3189('0x1b')],'whatsappStatus':this[_0x3189('0x3c')],'whatsappStatusTime':this[_0x3189('0x1c')],'whatsappCapacity':this[_0x3189('0x1d')],'whatsappCurrentCapacity':this[_0x3189('0x3d')],'openchannelStatus':this[_0x3189('0x1e')],'openchannelStatusTime':this[_0x3189('0x1f')],'openchannelCapacity':this[_0x3189('0x20')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x3189('0x22')],'busyQueue':this[_0x3189('0x23')],'chatWaitingInteractions':this[_0x3189('0x3e')],'faxWaitingInteractions':this[_0x3189('0x25')],'mailWaitingInteractions':this[_0x3189('0x26')],'openchannelWaitingInteractions':this[_0x3189('0x27')],'smsWaitingInteractions':this[_0x3189('0x3f')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x5b3312=md5(JSON[_0x3189('0x40')](_0x1ab94b));if(this['md5']!==_0x5b3312){this[_0x3189('0x24')]=_0x5b3312;io[_0x3189('0x41')]('user:routing:update',_[_0x3189('0x42')](_0x1ab94b,[_0x3189('0x7')]));}};module[_0x3189('0x43')]=Agent; \ No newline at end of file +var _0x8ace=['unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','whatsapp','toNumber','format','Status','mailStatus','faxCurrentCapacity','openchannelStatusTime','busyQueue','openchannelWaitingInteractions','whatsappWaitingInteractions','stringify','emit','user:routing:update','omit','lodash','md5','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus'];(function(_0x31a8fd,_0x54190e){var _0x3dad1f=function(_0x581f56){while(--_0x581f56){_0x31a8fd['push'](_0x31a8fd['shift']());}};_0x3dad1f(++_0x54190e);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x3a2e49,_0x21ebea){_0x3a2e49=_0x3a2e49-0x0;var _0x257140=_0x8ace[_0x3a2e49];return _0x257140;};'use strict';var _=require(_0xe8ac('0x0'));var md5=require(_0xe8ac('0x1'));var moment=require(_0xe8ac('0x2'));var Redis=require(_0xe8ac('0x3'));var config=require(_0xe8ac('0x4'));config[_0xe8ac('0x5')]=_[_0xe8ac('0x6')](config[_0xe8ac('0x5')],{'host':_0xe8ac('0x7'),'port':0x18eb});var io=require(_0xe8ac('0x8'))(new Redis(config[_0xe8ac('0x5')]));function Agent(_0x224fc8){this['id']=_0x224fc8['id']||0x0;this[_0xe8ac('0x9')]=_0x224fc8[_0xe8ac('0x9')]||'';this['online']=_0x224fc8[_0xe8ac('0xa')]||!![];this[_0xe8ac('0xb')]=_0x224fc8['voicePause']||![];this['chatPause']=_0x224fc8[_0xe8ac('0xc')]||![];this['mailPause']=_0x224fc8[_0xe8ac('0xd')]||![];this[_0xe8ac('0xe')]=_0x224fc8[_0xe8ac('0xe')]||![];this[_0xe8ac('0xf')]=_0x224fc8[_0xe8ac('0xf')]||![];this[_0xe8ac('0x10')]=_0x224fc8['openchannelPause']||![];this[_0xe8ac('0x11')]=_0xe8ac('0x12');this[_0xe8ac('0x13')]=0x0;this['chatCapacity']=_0x224fc8[_0xe8ac('0x14')]||0x0;this[_0xe8ac('0x15')]=0x0;this['mailStatus']=_0xe8ac('0x12');this[_0xe8ac('0x16')]=0x0;this[_0xe8ac('0x17')]=_0x224fc8[_0xe8ac('0x17')]||0x0;this[_0xe8ac('0x18')]=0x0;this[_0xe8ac('0x19')]=_0xe8ac('0x12');this[_0xe8ac('0x1a')]=0x0;this[_0xe8ac('0x1b')]=_0x224fc8[_0xe8ac('0x1b')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xe8ac('0x1c')]=_0xe8ac('0x12');this['smsStatusTime']=0x0;this[_0xe8ac('0x1d')]=_0x224fc8[_0xe8ac('0x1d')]||0x0;this[_0xe8ac('0x1e')]=0x0;this[_0xe8ac('0x1f')]=_0xe8ac('0x12');this[_0xe8ac('0x20')]=0x0;this['whatsappCapacity']=_0x224fc8['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this[_0xe8ac('0x21')]=_0xe8ac('0x12');this['openchannelStatusTime']=0x0;this[_0xe8ac('0x22')]=_0x224fc8['openchannelCapacity']||0x0;this[_0xe8ac('0x23')]=0x0;this[_0xe8ac('0x24')]=![];this['busyQueue']=undefined;this[_0xe8ac('0x1')]='';this[_0xe8ac('0x25')]={};this[_0xe8ac('0x26')]={};this[_0xe8ac('0x27')]={};this['openchannelWaitingInteractions']={};this[_0xe8ac('0x28')]={};this['whatsappWaitingInteractions']={};this[_0xe8ac('0x29')]();}Agent[_0xe8ac('0x2a')][_0xe8ac('0x2b')]=function(_0x252440){if(this[_0x252440+_0xe8ac('0x2c')]>0x0){if(this[_0x252440+_0xe8ac('0x2d')]>0x0&&this[_0x252440+_0xe8ac('0x2c')]>=this[_0x252440+'Capacity']){return _0xe8ac('0x2e');}else{return _0xe8ac('0x2f');}}else{return _0xe8ac('0x30');}};Agent[_0xe8ac('0x2a')][_0xe8ac('0x29')]=function(){var _0x3a92e1=[_0xe8ac('0x31'),_0xe8ac('0x32'),_0xe8ac('0x33'),'fax','sms',_0xe8ac('0x34')];for(var _0xbef18f=0x0;_0xbef18f<_0x3a92e1['length'];_0xbef18f+=0x1){var _0x2a78c6=this[_0xe8ac('0x2b')](_0x3a92e1[_0xbef18f]);if(this[_0x3a92e1[_0xbef18f]+'Status']!==_0x2a78c6){this[_0x3a92e1[_0xbef18f]+'StatusTime']=_[_0xe8ac('0x35')](moment()[_0xe8ac('0x36')]('x'));}this[_0x3a92e1[_0xbef18f]+_0xe8ac('0x37')]=_0x2a78c6;}var _0x5d7562={'id':this['id'],'name':this[_0xe8ac('0x9')],'online':this[_0xe8ac('0xa')],'voicePause':this[_0xe8ac('0xb')],'chatPause':this['chatPause'],'mailPause':this[_0xe8ac('0xd')],'smsPause':this['smsPause'],'faxPause':this[_0xe8ac('0xe')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xe8ac('0x15')],'mailStatus':this[_0xe8ac('0x38')],'mailStatusTime':this[_0xe8ac('0x16')],'mailCapacity':this[_0xe8ac('0x17')],'mailCurrentCapacity':this[_0xe8ac('0x18')],'faxStatus':this[_0xe8ac('0x19')],'faxStatusTime':this[_0xe8ac('0x1a')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xe8ac('0x39')],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xe8ac('0x1e')],'whatsappStatus':this[_0xe8ac('0x1f')],'whatsappStatusTime':this[_0xe8ac('0x20')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xe8ac('0x21')],'openchannelStatusTime':this[_0xe8ac('0x3a')],'openchannelCapacity':this[_0xe8ac('0x22')],'openchannelCurrentCapacity':this[_0xe8ac('0x23')],'busy':this['busy'],'busyQueue':this[_0xe8ac('0x3b')],'chatWaitingInteractions':this[_0xe8ac('0x25')],'faxWaitingInteractions':this[_0xe8ac('0x26')],'mailWaitingInteractions':this[_0xe8ac('0x27')],'openchannelWaitingInteractions':this[_0xe8ac('0x3c')],'smsWaitingInteractions':this[_0xe8ac('0x28')],'whatsappWaitingInteractions':this[_0xe8ac('0x3d')]};var _0x55a3a4=md5(JSON[_0xe8ac('0x3e')](_0x5d7562));if(this[_0xe8ac('0x1')]!==_0x55a3a4){this['md5']=_0x55a3a4;io[_0xe8ac('0x3f')](_0xe8ac('0x40'),_[_0xe8ac('0x41')](_0x5d7562,[_0xe8ac('0xa')]));}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 65e4a0a..d51a1b5 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 _0x8bdc=['paused','length','chatPause','available','stringify','format','chat:queue:%s','chat_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','_rr','map','loggedIn'];(function(_0xc3badb,_0x30c81d){var _0x4d2f67=function(_0x355731){while(--_0x355731){_0xc3badb['push'](_0xc3badb['shift']());}};_0x4d2f67(++_0x30c81d);}(_0x8bdc,0x10d));var _0xc8bd=function(_0x2ae6f4,_0x171725){_0x2ae6f4=_0x2ae6f4-0x0;var _0x3d6907=_0x8bdc[_0x2ae6f4];return _0x3d6907;};'use strict';var _=require(_0xc8bd('0x0'));var md5=require('md5');var util=require(_0xc8bd('0x1'));var Redis=require(_0xc8bd('0x2'));var config=require(_0xc8bd('0x3'));config[_0xc8bd('0x4')]=_[_0xc8bd('0x5')](config[_0xc8bd('0x4')],{'host':_0xc8bd('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc8bd('0x4')]));function ChatQueue(_0x1b60a6){this['id']=_0x1b60a6['id']||0x0;this[_0xc8bd('0x7')]=_0x1b60a6[_0xc8bd('0x7')]||'';this[_0xc8bd('0x8')]=_0x1b60a6['timeout']||0xa;this['strategy']=_0x1b60a6[_0xc8bd('0x9')]||_0xc8bd('0xa');this[_0xc8bd('0xb')]=_0x1b60a6[_0xc8bd('0xb')];this[_0xc8bd('0xc')]={};this[_0xc8bd('0xd')]=0x0;this[_0xc8bd('0xe')]='';this['updateRouting']();this[_0xc8bd('0xf')]();}ChatQueue[_0xc8bd('0x10')][_0xc8bd('0x11')]=function(){var _0x4311e1=this[_0xc8bd('0xc')][_0xc8bd('0x12')];this[_0xc8bd('0xc')]=_[_0xc8bd('0x13')](this[_0xc8bd('0xb')],'id');this['mapAgentsId']['_rr']=_0x4311e1;};ChatQueue[_0xc8bd('0x10')][_0xc8bd('0xf')]=function(){this[_0xc8bd('0x14')]=0x0;this[_0xc8bd('0x15')]=0x0;for(var _0x4fc65e=0x0;_0x4fc65e=0x0?this[_0xc8bd('0x18')]:0x0;var _0x59c663={'id':this['id'],'available':this['available'],'loggedIn':this[_0xc8bd('0x14')],'name':this[_0xc8bd('0x7')],'paused':this[_0xc8bd('0x15')],'waiting':this['waiting']};var _0x36e912=md5(JSON[_0xc8bd('0x19')](_0x59c663));if(this[_0xc8bd('0xe')]!==_0x36e912){this['md5']=_0x36e912;io['to'](util[_0xc8bd('0x1a')](_0xc8bd('0x1b'),_0x59c663[_0xc8bd('0x7')]))['emit'](_0xc8bd('0x1c'),_0x59c663);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x3b1c=['Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','online','chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0x3b1c,0xc8));var _0xc3b1=function(_0x4a015d,_0x275d13){_0x4a015d=_0x4a015d-0x0;var _0x17a87c=_0x3b1c[_0x4a015d];return _0x17a87c;};'use strict';var _=require(_0xc3b1('0x0'));var md5=require(_0xc3b1('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xc3b1('0x2'));config[_0xc3b1('0x3')]=_['defaults'](config[_0xc3b1('0x3')],{'host':_0xc3b1('0x4'),'port':0x18eb});var io=require(_0xc3b1('0x5'))(new Redis(config[_0xc3b1('0x3')]));function ChatQueue(_0x1fa721){this['id']=_0x1fa721['id']||0x0;this[_0xc3b1('0x6')]=_0x1fa721['name']||'';this[_0xc3b1('0x7')]=_0x1fa721['timeout']||0xa;this[_0xc3b1('0x8')]=_0x1fa721['strategy']||_0xc3b1('0x9');this[_0xc3b1('0xa')]=_0x1fa721[_0xc3b1('0xa')];this[_0xc3b1('0xb')]={};this[_0xc3b1('0xc')]=0x0;this[_0xc3b1('0x1')]='';this['updateRouting']();this[_0xc3b1('0xd')]();}ChatQueue[_0xc3b1('0xe')][_0xc3b1('0xf')]=function(){var _0x33073e=this[_0xc3b1('0xb')][_0xc3b1('0x10')];this[_0xc3b1('0xb')]=_[_0xc3b1('0x11')](this[_0xc3b1('0xa')],'id');this['mapAgentsId'][_0xc3b1('0x10')]=_0x33073e;};ChatQueue[_0xc3b1('0xe')][_0xc3b1('0xd')]=function(){this[_0xc3b1('0x12')]=0x0;this[_0xc3b1('0x13')]=0x0;for(var _0x12995f=0x0;_0x12995f=0x0?this[_0xc3b1('0x17')]:0x0;var _0x50dcc8={'id':this['id'],'available':this[_0xc3b1('0x17')],'loggedIn':this[_0xc3b1('0x12')],'name':this[_0xc3b1('0x6')],'paused':this[_0xc3b1('0x13')],'waiting':this['waiting']};var _0x287f6c=md5(JSON[_0xc3b1('0x18')](_0x50dcc8));if(this[_0xc3b1('0x1')]!==_0x287f6c){this['md5']=_0x287f6c;io['to'](util[_0xc3b1('0x19')](_0xc3b1('0x1a'),_0x50dcc8[_0xc3b1('0x6')]))[_0xc3b1('0x1b')](_0xc3b1('0x1c'),_0x50dcc8);}};module[_0xc3b1('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 14d1ed3..c791d09 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 _0xa2ef=['prototype','updateRouting','_rr','map','updateRealtime','paused','online','faxPause','available','loggedIn','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xa2ef,0x188));var _0xfa2e=function(_0x466d81,_0x5afd36){_0x466d81=_0x466d81-0x0;var _0x35cff4=_0xa2ef[_0x466d81];return _0x35cff4;};'use strict';var _=require(_0xfa2e('0x0'));var md5=require(_0xfa2e('0x1'));var util=require('util');var Redis=require(_0xfa2e('0x2'));var config=require(_0xfa2e('0x3'));config[_0xfa2e('0x4')]=_[_0xfa2e('0x5')](config[_0xfa2e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xfa2e('0x6'))(new Redis(config['redis']));function FaxQueue(_0x4f7d31){this['id']=_0x4f7d31['id']||0x0;this[_0xfa2e('0x7')]=_0x4f7d31['name']||'';this[_0xfa2e('0x8')]=_0x4f7d31[_0xfa2e('0x8')]||0xa;this[_0xfa2e('0x9')]=_0x4f7d31[_0xfa2e('0x9')]||'beepall';this[_0xfa2e('0xa')]=_0x4f7d31['Agents'];this[_0xfa2e('0xb')]={};this[_0xfa2e('0xc')]=0x0;this[_0xfa2e('0x1')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0xfa2e('0xd')][_0xfa2e('0xe')]=function(){var _0x23a547=this[_0xfa2e('0xb')][_0xfa2e('0xf')];this[_0xfa2e('0xb')]=_[_0xfa2e('0x10')](this[_0xfa2e('0xa')],'id');this['mapAgentsId'][_0xfa2e('0xf')]=_0x23a547;};FaxQueue['prototype'][_0xfa2e('0x11')]=function(){this['loggedIn']=0x0;this[_0xfa2e('0x12')]=0x0;for(var _0x5cd613=0x0;_0x5cd613=0x0?this['available']:0x0;var _0x1f89c8={'id':this['id'],'available':this['available'],'loggedIn':this[_0xfa2e('0x16')],'name':this['name'],'paused':this[_0xfa2e('0x12')],'waiting':this[_0xfa2e('0xc')]};var _0x29b9e8=md5(JSON['stringify'](_0x1f89c8));if(this[_0xfa2e('0x1')]!==_0x29b9e8){this[_0xfa2e('0x1')]=_0x29b9e8;io['to'](util['format'](_0xfa2e('0x17'),_0x1f89c8[_0xfa2e('0x7')]))[_0xfa2e('0x18')](_0xfa2e('0x19'),_0x1f89c8);}};module[_0xfa2e('0x1a')]=FaxQueue; \ No newline at end of file +var _0xb36c=['_rr','map','loggedIn','paused','length','faxPause','available','stringify','format','fax:queue:%s','fax_queue:save','exports','lodash','ioredis','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xb36c,0x78));var _0xcb36=function(_0x11f613,_0x381915){_0x11f613=_0x11f613-0x0;var _0x465b25=_0xb36c[_0x11f613];return _0x465b25;};'use strict';var _=require(_0xcb36('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xcb36('0x1'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xcb36('0x2')],{'host':_0xcb36('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcb36('0x2')]));function FaxQueue(_0x343b3c){this['id']=_0x343b3c['id']||0x0;this[_0xcb36('0x4')]=_0x343b3c['name']||'';this[_0xcb36('0x5')]=_0x343b3c[_0xcb36('0x5')]||0xa;this[_0xcb36('0x6')]=_0x343b3c[_0xcb36('0x6')]||_0xcb36('0x7');this[_0xcb36('0x8')]=_0x343b3c[_0xcb36('0x8')];this[_0xcb36('0x9')]={};this[_0xcb36('0xa')]=0x0;this[_0xcb36('0xb')]='';this[_0xcb36('0xc')]();this[_0xcb36('0xd')]();}FaxQueue[_0xcb36('0xe')]['updateRouting']=function(){var _0xa8a070=this[_0xcb36('0x9')][_0xcb36('0xf')];this[_0xcb36('0x9')]=_[_0xcb36('0x10')](this[_0xcb36('0x8')],'id');this[_0xcb36('0x9')][_0xcb36('0xf')]=_0xa8a070;};FaxQueue['prototype'][_0xcb36('0xd')]=function(){this[_0xcb36('0x11')]=0x0;this[_0xcb36('0x12')]=0x0;for(var _0x5bc083=0x0;_0x5bc083=0x0?this[_0xcb36('0x15')]:0x0;var _0x38cf34={'id':this['id'],'available':this[_0xcb36('0x15')],'loggedIn':this[_0xcb36('0x11')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x34cafa=md5(JSON[_0xcb36('0x16')](_0x38cf34));if(this['md5']!==_0x34cafa){this[_0xcb36('0xb')]=_0x34cafa;io['to'](util[_0xcb36('0x17')](_0xcb36('0x18'),_0x38cf34['name']))['emit'](_0xcb36('0x19'),_0x38cf34);}};module[_0xcb36('0x1a')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 8dcef8d..b0eec66 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 _0xfb28=['name','Intervals','exports'];(function(_0x2cc550,_0x568d5a){var _0x3494b1=function(_0x1f846d){while(--_0x1f846d){_0x2cc550['push'](_0x2cc550['shift']());}};_0x3494b1(++_0x568d5a);}(_0xfb28,0xe1));var _0x8fb2=function(_0x332d64,_0x50e2f2){_0x332d64=_0x332d64-0x0;var _0x7bebb7=_0xfb28[_0x332d64];return _0x7bebb7;};'use strict';function Interval(_0x56eccf){this['id']=_0x56eccf['id']||0x0;this[_0x8fb2('0x0')]=_0x56eccf[_0x8fb2('0x0')]||'';this['Intervals']=_0x56eccf[_0x8fb2('0x1')]||{};}module[_0x8fb2('0x2')]=Interval; \ No newline at end of file +var _0xae6a=['name','Intervals','exports'];(function(_0x2251c9,_0x1df6e4){var _0x5cacca=function(_0x5df40f){while(--_0x5df40f){_0x2251c9['push'](_0x2251c9['shift']());}};_0x5cacca(++_0x1df6e4);}(_0xae6a,0x6f));var _0xaae6=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xae6a[_0x465a0c];return _0x1e202e;};'use strict';function Interval(_0x18ec0a){this['id']=_0x18ec0a['id']||0x0;this[_0xaae6('0x0')]=_0x18ec0a['name']||'';this[_0xaae6('0x1')]=_0x18ec0a[_0xaae6('0x1')]||{};}module[_0xaae6('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 17da167..37f4c6d 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 _0xd52b=['waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x576424,_0x1a61bc){var _0x5362a3=function(_0x38e8fd){while(--_0x38e8fd){_0x576424['push'](_0x576424['shift']());}};_0x5362a3(++_0x1a61bc);}(_0xd52b,0x144));var _0xbd52=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xd52b[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xbd52('0x0'));var md5=require(_0xbd52('0x1'));var util=require(_0xbd52('0x2'));var Redis=require(_0xbd52('0x3'));var config=require('../../../config/environment');config[_0xbd52('0x4')]=_['defaults'](config[_0xbd52('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xbd52('0x5'))(new Redis(config[_0xbd52('0x4')]));function MailQueue(_0x405efa){this['id']=_0x405efa['id']||0x0;this['name']=_0x405efa[_0xbd52('0x6')]||'';this[_0xbd52('0x7')]=_0x405efa['timeout']||0xa;this[_0xbd52('0x8')]=_0x405efa[_0xbd52('0x8')]||_0xbd52('0x9');this[_0xbd52('0xa')]=_0x405efa[_0xbd52('0xa')];this[_0xbd52('0xb')]={};this[_0xbd52('0xc')]=0x0;this[_0xbd52('0x1')]='';this[_0xbd52('0xd')]();this[_0xbd52('0xe')]();}MailQueue[_0xbd52('0xf')]['updateRouting']=function(){var _0x39ba23=this[_0xbd52('0xb')][_0xbd52('0x10')];this[_0xbd52('0xb')]=_['map'](this[_0xbd52('0xa')],'id');this[_0xbd52('0xb')][_0xbd52('0x10')]=_0x39ba23;};MailQueue[_0xbd52('0xf')][_0xbd52('0xe')]=function(){this[_0xbd52('0x11')]=0x0;this[_0xbd52('0x12')]=0x0;for(var _0x2cef50=0x0;_0x2cef50=0x0?this[_0xbd52('0x15')]:0x0;var _0x10387c={'id':this['id'],'available':this[_0xbd52('0x15')],'loggedIn':this[_0xbd52('0x11')],'name':this[_0xbd52('0x6')],'paused':this[_0xbd52('0x12')],'waiting':this[_0xbd52('0xc')]};var _0x54230c=md5(JSON[_0xbd52('0x16')](_0x10387c));if(this['md5']!==_0x54230c){this[_0xbd52('0x1')]=_0x54230c;io['to'](util[_0xbd52('0x17')](_0xbd52('0x18'),_0x10387c[_0xbd52('0x6')]))[_0xbd52('0x19')](_0xbd52('0x1a'),_0x10387c);}};module[_0xbd52('0x1b')]=MailQueue; \ No newline at end of file +var _0xae35=['length','online','available','mail:queue:%s','emit','mail_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0xae35,0xe7));var _0x5ae3=function(_0x3db1b0,_0xd53830){_0x3db1b0=_0x3db1b0-0x0;var _0x20d4d6=_0xae35[_0x3db1b0];return _0x20d4d6;};'use strict';var _=require(_0x5ae3('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x5ae3('0x1'));var config=require(_0x5ae3('0x2'));config[_0x5ae3('0x3')]=_[_0x5ae3('0x4')](config[_0x5ae3('0x3')],{'host':_0x5ae3('0x5'),'port':0x18eb});var io=require(_0x5ae3('0x6'))(new Redis(config['redis']));function MailQueue(_0x5a5be2){this['id']=_0x5a5be2['id']||0x0;this[_0x5ae3('0x7')]=_0x5a5be2[_0x5ae3('0x7')]||'';this['timeout']=_0x5a5be2[_0x5ae3('0x8')]||0xa;this[_0x5ae3('0x9')]=_0x5a5be2[_0x5ae3('0x9')]||_0x5ae3('0xa');this[_0x5ae3('0xb')]=_0x5a5be2[_0x5ae3('0xb')];this[_0x5ae3('0xc')]={};this[_0x5ae3('0xd')]=0x0;this[_0x5ae3('0xe')]='';this[_0x5ae3('0xf')]();this['updateRealtime']();}MailQueue[_0x5ae3('0x10')][_0x5ae3('0xf')]=function(){var _0x2a7001=this['mapAgentsId'][_0x5ae3('0x11')];this[_0x5ae3('0xc')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0x5ae3('0x11')]=_0x2a7001;};MailQueue[_0x5ae3('0x10')][_0x5ae3('0x12')]=function(){this[_0x5ae3('0x13')]=0x0;this[_0x5ae3('0x14')]=0x0;for(var _0x386d11=0x0;_0x386d11=0x0?this[_0x5ae3('0x17')]:0x0;var _0x2bc463={'id':this['id'],'available':this[_0x5ae3('0x17')],'loggedIn':this[_0x5ae3('0x13')],'name':this[_0x5ae3('0x7')],'paused':this[_0x5ae3('0x14')],'waiting':this['waiting']};var _0x5e6e13=md5(JSON['stringify'](_0x2bc463));if(this[_0x5ae3('0xe')]!==_0x5e6e13){this[_0x5ae3('0xe')]=_0x5e6e13;io['to'](util['format'](_0x5ae3('0x18'),_0x2bc463[_0x5ae3('0x7')]))[_0x5ae3('0x19')](_0x5ae3('0x1a'),_0x2bc463);}};module[_0x5ae3('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 356d545..abd9e01 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 _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xc4aa[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x58c053,_0x51c43f){var _0xe1079=function(_0x172345){while(--_0x172345){_0x58c053['push'](_0x58c053['shift']());}};_0xe1079(++_0x51c43f);}(_0xadb5,0xad));var _0x5adb=function(_0x4c3c48,_0x1035d2){_0x4c3c48=_0x4c3c48-0x0;var _0x187fda=_0xadb5[_0x4c3c48];return _0x187fda;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index f86ac5c..3d2e9e3 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 _0x18a9=['waiting','md5','updateRouting','prototype','map','_rr','updateRealtime','paused','online','loggedIn','smsPause','available','stringify','format','sms:queue:%s','emit','exports','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x302226,_0x1d0ebf){var _0x1e33dd=function(_0xe083cc){while(--_0xe083cc){_0x302226['push'](_0x302226['shift']());}};_0x1e33dd(++_0x1d0ebf);}(_0x18a9,0x15b));var _0x918a=function(_0x12dc05,_0x55988f){_0x12dc05=_0x12dc05-0x0;var _0x4489cc=_0x18a9[_0x12dc05];return _0x4489cc;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x918a('0x0'));var Redis=require(_0x918a('0x1'));var config=require(_0x918a('0x2'));config[_0x918a('0x3')]=_[_0x918a('0x4')](config[_0x918a('0x3')],{'host':_0x918a('0x5'),'port':0x18eb});var io=require(_0x918a('0x6'))(new Redis(config[_0x918a('0x3')]));function SmsQueue(_0x2d243c){this['id']=_0x2d243c['id']||0x0;this[_0x918a('0x7')]=_0x2d243c[_0x918a('0x7')]||'';this['timeout']=_0x2d243c[_0x918a('0x8')]||0xa;this[_0x918a('0x9')]=_0x2d243c['strategy']||_0x918a('0xa');this[_0x918a('0xb')]=_0x2d243c[_0x918a('0xb')];this[_0x918a('0xc')]={};this[_0x918a('0xd')]=0x0;this[_0x918a('0xe')]='';this[_0x918a('0xf')]();this['updateRealtime']();}SmsQueue[_0x918a('0x10')][_0x918a('0xf')]=function(){var _0xc7bdb0=this[_0x918a('0xc')]['_rr'];this[_0x918a('0xc')]=_[_0x918a('0x11')](this['Agents'],'id');this[_0x918a('0xc')][_0x918a('0x12')]=_0xc7bdb0;};SmsQueue[_0x918a('0x10')][_0x918a('0x13')]=function(){this['loggedIn']=0x0;this[_0x918a('0x14')]=0x0;for(var _0x55c90e=0x0;_0x55c90e=0x0?this['available']:0x0;var _0x199eb1={'id':this['id'],'available':this[_0x918a('0x18')],'loggedIn':this[_0x918a('0x16')],'name':this[_0x918a('0x7')],'paused':this['paused'],'waiting':this[_0x918a('0xd')]};var _0x200737=md5(JSON[_0x918a('0x19')](_0x199eb1));if(this[_0x918a('0xe')]!==_0x200737){this[_0x918a('0xe')]=_0x200737;io['to'](util[_0x918a('0x1a')](_0x918a('0x1b'),_0x199eb1['name']))[_0x918a('0x1c')]('sms_queue:save',_0x199eb1);}};module[_0x918a('0x1d')]=SmsQueue; \ No newline at end of file +var _0x9b67=['redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','sms:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults'];(function(_0x304909,_0x2e58d2){var _0x2f3037=function(_0x399f9e){while(--_0x399f9e){_0x304909['push'](_0x304909['shift']());}};_0x2f3037(++_0x2e58d2);}(_0x9b67,0xf6));var _0x79b6=function(_0xf1ea9f,_0x389ec4){_0xf1ea9f=_0xf1ea9f-0x0;var _0x3213b0=_0x9b67[_0xf1ea9f];return _0x3213b0;};'use strict';var _=require(_0x79b6('0x0'));var md5=require(_0x79b6('0x1'));var util=require(_0x79b6('0x2'));var Redis=require(_0x79b6('0x3'));var config=require(_0x79b6('0x4'));config['redis']=_[_0x79b6('0x5')](config[_0x79b6('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x79b6('0x6')]));function SmsQueue(_0x174768){this['id']=_0x174768['id']||0x0;this[_0x79b6('0x7')]=_0x174768[_0x79b6('0x7')]||'';this[_0x79b6('0x8')]=_0x174768[_0x79b6('0x8')]||0xa;this[_0x79b6('0x9')]=_0x174768['strategy']||_0x79b6('0xa');this[_0x79b6('0xb')]=_0x174768[_0x79b6('0xb')];this[_0x79b6('0xc')]={};this[_0x79b6('0xd')]=0x0;this['md5']='';this[_0x79b6('0xe')]();this[_0x79b6('0xf')]();}SmsQueue[_0x79b6('0x10')][_0x79b6('0xe')]=function(){var _0x58a98b=this['mapAgentsId'][_0x79b6('0x11')];this[_0x79b6('0xc')]=_[_0x79b6('0x12')](this['Agents'],'id');this[_0x79b6('0xc')][_0x79b6('0x11')]=_0x58a98b;};SmsQueue[_0x79b6('0x10')][_0x79b6('0xf')]=function(){this[_0x79b6('0x13')]=0x0;this[_0x79b6('0x14')]=0x0;for(var _0x19d5b2=0x0;_0x19d5b2=0x0?this[_0x79b6('0x17')]:0x0;var _0x3123b8={'id':this['id'],'available':this[_0x79b6('0x17')],'loggedIn':this[_0x79b6('0x13')],'name':this[_0x79b6('0x7')],'paused':this[_0x79b6('0x14')],'waiting':this[_0x79b6('0xd')]};var _0x52a70f=md5(JSON[_0x79b6('0x18')](_0x3123b8));if(this['md5']!==_0x52a70f){this[_0x79b6('0x1')]=_0x52a70f;io['to'](util['format'](_0x79b6('0x19'),_0x3123b8[_0x79b6('0x7')]))[_0x79b6('0x1a')]('sms_queue:save',_0x3123b8);}};module[_0x79b6('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 1e6b400..c50991a 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 _0x60c4=['../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','map','_rr','prototype','loggedIn','paused','length','online','whatsappPause','available','format','whatsapp:queue:%s','whatsapp_queue:save','md5','util'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x60c4,0x6a));var _0x460c=function(_0x3060ac,_0x1f2b4f){_0x3060ac=_0x3060ac-0x0;var _0x17a1ff=_0x60c4[_0x3060ac];return _0x17a1ff;};'use strict';var _=require('lodash');var md5=require(_0x460c('0x0'));var util=require(_0x460c('0x1'));var Redis=require('ioredis');var config=require(_0x460c('0x2'));config['redis']=_[_0x460c('0x3')](config[_0x460c('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x460c('0x5'))(new Redis(config[_0x460c('0x4')]));function WhatsappQueue(_0x4fac9b){this['id']=_0x4fac9b['id']||0x0;this[_0x460c('0x6')]=_0x4fac9b[_0x460c('0x6')]||'';this[_0x460c('0x7')]=_0x4fac9b[_0x460c('0x7')]||0xa;this['strategy']=_0x4fac9b[_0x460c('0x8')]||_0x460c('0x9');this[_0x460c('0xa')]=_0x4fac9b['Agents'];this[_0x460c('0xb')]={};this[_0x460c('0xc')]=0x0;this[_0x460c('0x0')]='';this['updateRouting']();this[_0x460c('0xd')]();}WhatsappQueue['prototype'][_0x460c('0xe')]=function(){var _0x277391=this[_0x460c('0xb')]['_rr'];this[_0x460c('0xb')]=_[_0x460c('0xf')](this['Agents'],'id');this['mapAgentsId'][_0x460c('0x10')]=_0x277391;};WhatsappQueue[_0x460c('0x11')]['updateRealtime']=function(){this[_0x460c('0x12')]=0x0;this[_0x460c('0x13')]=0x0;for(var _0x5ae11e=0x0;_0x5ae11e=0x0?this['available']:0x0;var _0x53da7b={'id':this['id'],'available':this[_0x460c('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x460c('0x6')],'paused':this[_0x460c('0x13')],'waiting':this[_0x460c('0xc')]};var _0x59c7dc=md5(JSON['stringify'](_0x53da7b));if(this['md5']!==_0x59c7dc){this[_0x460c('0x0')]=_0x59c7dc;io['to'](util[_0x460c('0x18')](_0x460c('0x19'),_0x53da7b[_0x460c('0x6')]))['emit'](_0x460c('0x1a'),_0x53da7b);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0xb3cf=['waiting','md5','updateRouting','_rr','prototype','paused','length','online','whatsappPause','available','loggedIn','format','whatsapp:queue:%s','whatsapp_queue:save','lodash','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0xd2fc1e,_0x5d5aea){var _0x57e2fd=function(_0x400c84){while(--_0x400c84){_0xd2fc1e['push'](_0xd2fc1e['shift']());}};_0x57e2fd(++_0x5d5aea);}(_0xb3cf,0x194));var _0xfb3c=function(_0x3d2c81,_0x34c55f){_0x3d2c81=_0x3d2c81-0x0;var _0xdb2328=_0xb3cf[_0x3d2c81];return _0xdb2328;};'use strict';var _=require(_0xfb3c('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0xfb3c('0x1'));config[_0xfb3c('0x2')]=_[_0xfb3c('0x3')](config['redis'],{'host':_0xfb3c('0x4'),'port':0x18eb});var io=require(_0xfb3c('0x5'))(new Redis(config[_0xfb3c('0x2')]));function WhatsappQueue(_0x30e6d9){this['id']=_0x30e6d9['id']||0x0;this[_0xfb3c('0x6')]=_0x30e6d9['name']||'';this['timeout']=_0x30e6d9[_0xfb3c('0x7')]||0xa;this['strategy']=_0x30e6d9[_0xfb3c('0x8')]||_0xfb3c('0x9');this['Agents']=_0x30e6d9[_0xfb3c('0xa')];this[_0xfb3c('0xb')]={};this[_0xfb3c('0xc')]=0x0;this[_0xfb3c('0xd')]='';this[_0xfb3c('0xe')]();this['updateRealtime']();}WhatsappQueue['prototype'][_0xfb3c('0xe')]=function(){var _0x5d9e74=this[_0xfb3c('0xb')]['_rr'];this[_0xfb3c('0xb')]=_['map'](this[_0xfb3c('0xa')],'id');this['mapAgentsId'][_0xfb3c('0xf')]=_0x5d9e74;};WhatsappQueue[_0xfb3c('0x10')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xfb3c('0x11')]=0x0;for(var _0xca6e5d=0x0;_0xca6e5d=0x0?this[_0xfb3c('0x15')]:0x0;var _0x25c07d={'id':this['id'],'available':this['available'],'loggedIn':this[_0xfb3c('0x16')],'name':this[_0xfb3c('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x33a4c6=md5(JSON['stringify'](_0x25c07d));if(this['md5']!==_0x33a4c6){this['md5']=_0x33a4c6;io['to'](util[_0xfb3c('0x17')](_0xfb3c('0x18'),_0x25c07d[_0xfb3c('0x6')]))['emit'](_0xfb3c('0x19'),_0x25c07d);}};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 cad9233..9c2f0ed 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(_0x27866f,_0x3b0399){var _0xa14ace=function(_0x23e461){while(--_0x23e461){_0x27866f['push'](_0x27866f['shift']());}};_0xa14ace(++_0x3b0399);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ee6bc,_0x4025bb){_0x3ee6bc=_0x3ee6bc-0x0;var _0x5bda78=_0xb10b[_0x3ee6bc];return _0x5bda78;};'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(_0x4c8185,_0x3a1b3f){var _0x438196=function(_0x565c47){while(--_0x565c47){_0x4c8185['push'](_0x4c8185['shift']());}};_0x438196(++_0x3a1b3f);}(_0xb10b,0x12a));var _0xbb10=function(_0x42183e,_0x3b3353){_0x42183e=_0x42183e-0x0;var _0x4c1315=_0xb10b[_0x42183e];return _0x4c1315;};'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 27e947c..9fb068b 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 _0x1cea=['Request','UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x53bcc3,_0x364374){var _0x47c959=function(_0x40ef7d){while(--_0x40ef7d){_0x53bcc3['push'](_0x53bcc3['shift']());}};_0x47c959(++_0x364374);}(_0x1cea,0x11d));var _0xa1ce=function(_0x1ee62e,_0x159bb2){_0x1ee62e=_0x1ee62e-0x0;var _0x27c6c8=_0x1cea[_0x1ee62e];return _0x27c6c8;};'use strict';var client=require(_0xa1ce('0x0'));exports[_0xa1ce('0x1')]=function(_0x21e015,_0x3d10a8){return client[_0xa1ce('0x2')](_0xa1ce('0x3'),{'body':_0x3d10a8,'options':{'where':{'id':_0x21e015}},'log':_0xa1ce('0x4')});};exports['addTags']=function(_0x3b5b91,_0x1ac6bb){return client[_0xa1ce('0x2')](_0xa1ce('0x5'),{'body':_0x1ac6bb,'options':{'where':{'id':_0x3b5b91}},'log':_0xa1ce('0x6')});}; \ No newline at end of file +var _0x1312=['AddTagsToChatInteraction','../client','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x13f308,_0x2715c4){var _0x486485=function(_0x385b8e){while(--_0x385b8e){_0x13f308['push'](_0x13f308['shift']());}};_0x486485(++_0x2715c4);}(_0x1312,0x18c));var _0x2131=function(_0x8fb035,_0x217b6d){_0x8fb035=_0x8fb035-0x0;var _0x3a678d=_0x1312[_0x8fb035];return _0x3a678d;};'use strict';var client=require(_0x2131('0x0'));exports['update']=function(_0x3ce708,_0x41ae89){return client['Request'](_0x2131('0x1'),{'body':_0x41ae89,'options':{'where':{'id':_0x3ce708}},'log':_0x2131('0x2')});};exports[_0x2131('0x3')]=function(_0x382cfe,_0x1acd61){return client['Request'](_0x2131('0x4'),{'body':_0x1acd61,'options':{'where':{'id':_0x382cfe}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 1959224..30d00e1 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 _0x95c5=['CreateChatMessage','createChatMessage','../client','Request'];(function(_0x22a7ea,_0x17784b){var _0x2f8421=function(_0x16d105){while(--_0x16d105){_0x22a7ea['push'](_0x22a7ea['shift']());}};_0x2f8421(++_0x17784b);}(_0x95c5,0x1aa));var _0x595c=function(_0x1e05c1,_0x3cffa3){_0x1e05c1=_0x1e05c1-0x0;var _0x15f1ca=_0x95c5[_0x1e05c1];return _0x15f1ca;};'use strict';var client=require(_0x595c('0x0'));exports['create']=function(_0x342bae){return client[_0x595c('0x1')](_0x595c('0x2'),{'body':_0x342bae,'log':_0x595c('0x3')});}; \ No newline at end of file +var _0x9368=['Request','createChatMessage','../client'];(function(_0x236572,_0x5eec3f){var _0x479a92=function(_0x3401d8){while(--_0x3401d8){_0x236572['push'](_0x236572['shift']());}};_0x479a92(++_0x5eec3f);}(_0x9368,0x14c));var _0x8936=function(_0x74892f,_0x1e981b){_0x74892f=_0x74892f-0x0;var _0x10ee61=_0x9368[_0x74892f];return _0x10ee61;};'use strict';var client=require(_0x8936('0x0'));exports['create']=function(_0x231265){return client[_0x8936('0x1')]('CreateChatMessage',{'body':_0x231265,'log':_0x8936('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index d8e9925..2ac8fe8 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 _0x374c=['getChatQueues','Request','GetChatQueue','name','timeout','User','online'];(function(_0x3ff0f0,_0x5523bf){var _0x5dc82a=function(_0x14d26d){while(--_0x14d26d){_0x3ff0f0['push'](_0x3ff0f0['shift']());}};_0x5dc82a(++_0x5523bf);}(_0x374c,0x1e3));var _0xc374=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x374c[_0x297fd3];return _0x2af381;};'use strict';var client=require('../client');exports[_0xc374('0x0')]=function(){return function(){return client[_0xc374('0x1')](_0xc374('0x2'),{'options':{'raw':![],'attributes':['id',_0xc374('0x3'),_0xc374('0x4'),'strategy'],'include':[{'model':_0xc374('0x5'),'as':'Agents','attributes':['id',_0xc374('0x3'),_0xc374('0x6'),'chatPause']}]},'log':_0xc374('0x0')});};}; \ No newline at end of file +var _0x3c17=['chatPause','../client','Request','name','timeout','strategy','Agents','online'];(function(_0x26a321,_0x70520f){var _0x13f00b=function(_0x385870){while(--_0x385870){_0x26a321['push'](_0x26a321['shift']());}};_0x13f00b(++_0x70520f);}(_0x3c17,0x1a1));var _0x73c1=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x3c17[_0xbca1b1];return _0x4e1686;};'use strict';var client=require(_0x73c1('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x73c1('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x73c1('0x2'),_0x73c1('0x3'),_0x73c1('0x4')],'include':[{'model':'User','as':_0x73c1('0x5'),'attributes':['id',_0x73c1('0x2'),_0x73c1('0x6'),_0x73c1('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index fd6e676..ea59acd 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 _0x5cd8=['DESC','../client','Request','CreateChatQueueReport','UpdateChatQueueReport'];(function(_0xab0e3b,_0x5dfbda){var _0x43fd16=function(_0x56b5f9){while(--_0x56b5f9){_0xab0e3b['push'](_0xab0e3b['shift']());}};_0x43fd16(++_0x5dfbda);}(_0x5cd8,0x1d2));var _0x85cd=function(_0x49d80b,_0xcc7d9a){_0x49d80b=_0x49d80b-0x0;var _0x554048=_0x5cd8[_0x49d80b];return _0x554048;};'use strict';var client=require(_0x85cd('0x0'));exports['create']=function(_0x24bfe8){return client[_0x85cd('0x1')](_0x85cd('0x2'),{'body':_0x24bfe8,'log':_0x85cd('0x2')});};exports['update']=function(_0x3cbaa9,_0x4a286b){return client[_0x85cd('0x1')](_0x85cd('0x3'),{'body':_0x4a286b,'options':{'where':{'uniqueid':_0x3cbaa9},'order':[['id',_0x85cd('0x4')]],'limit':0x1},'log':_0x85cd('0x3')});}; \ No newline at end of file +var _0x919e=['Request','UpdateChatQueueReport','DESC','../client','create','CreateChatQueueReport'];(function(_0x5811a2,_0x30404b){var _0x5b7646=function(_0x2911fc){while(--_0x2911fc){_0x5811a2['push'](_0x5811a2['shift']());}};_0x5b7646(++_0x30404b);}(_0x919e,0x1d7));var _0xe919=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x919e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xe919('0x0'));exports[_0xe919('0x1')]=function(_0x24d2f4){return client['Request'](_0xe919('0x2'),{'body':_0x24d2f4,'log':'CreateChatQueueReport'});};exports['update']=function(_0x455cff,_0x3a1192){return client[_0xe919('0x3')](_0xe919('0x4'),{'body':_0x3a1192,'options':{'where':{'uniqueid':_0x455cff},'order':[['id',_0xe919('0x5')]],'limit':0x1},'log':_0xe919('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 61dc1ef..20c0042 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x1d570f,_0x3f54d3){var _0x40efdc=function(_0x1530b8){while(--_0x1530b8){_0x1d570f['push'](_0x1d570f['shift']());}};_0x40efdc(++_0x3f54d3);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x7a54,0x106));var _0x47a5=function(_0x5c6b1e,_0x1c87f4){_0x5c6b1e=_0x5c6b1e-0x0;var _0x153c11=_0x7a54[_0x5c6b1e];return _0x153c11;};'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 diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index a21308f..951052f 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 _0xc887=['CreateFaxMessage','../client'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xc887,0x167));var _0x7c88=function(_0x5cb69b,_0x40c4e1){_0x5cb69b=_0x5cb69b-0x0;var _0xb0b123=_0xc887[_0x5cb69b];return _0xb0b123;};'use strict';var client=require(_0x7c88('0x0'));exports['create']=function(_0x32e035){return client['Request'](_0x7c88('0x1'),{'body':_0x32e035,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x32b7=['createFaxMessage','create'];(function(_0x4e42ab,_0x49c468){var _0x2235b1=function(_0x40c77d){while(--_0x40c77d){_0x4e42ab['push'](_0x4e42ab['shift']());}};_0x2235b1(++_0x49c468);}(_0x32b7,0x1f1));var _0x732b=function(_0x2ec243,_0x12c231){_0x2ec243=_0x2ec243-0x0;var _0x3b0759=_0x32b7[_0x2ec243];return _0x3b0759;};'use strict';var client=require('../client');exports[_0x732b('0x0')]=function(_0x1957bf){return client['Request']('CreateFaxMessage',{'body':_0x1957bf,'log':_0x732b('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 9e880c4..67201e7 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 _0xe127=['online','faxPause','getFaxQueues','../client','Request','GetFaxQueue','timeout','Agents','name'];(function(_0x4a0a55,_0x3a12d0){var _0x5ade0a=function(_0x409a99){while(--_0x409a99){_0x4a0a55['push'](_0x4a0a55['shift']());}};_0x5ade0a(++_0x3a12d0);}(_0xe127,0xe4));var _0x7e12=function(_0x1ef3c9,_0x4bf10c){_0x1ef3c9=_0x1ef3c9-0x0;var _0x324021=_0xe127[_0x1ef3c9];return _0x324021;};'use strict';var client=require(_0x7e12('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x7e12('0x1')](_0x7e12('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x7e12('0x3'),'strategy'],'include':[{'model':'User','as':_0x7e12('0x4'),'attributes':['id',_0x7e12('0x5'),_0x7e12('0x6'),_0x7e12('0x7')]}]},'log':_0x7e12('0x8')});};}; \ No newline at end of file +var _0x10c4=['online','faxPause','Request','GetFaxQueue','name','timeout','strategy','User','Agents'];(function(_0x49471c,_0x4643b5){var _0x39836b=function(_0x2b2080){while(--_0x2b2080){_0x49471c['push'](_0x49471c['shift']());}};_0x39836b(++_0x4643b5);}(_0x10c4,0xad));var _0x410c=function(_0x35ec8e,_0x4e481e){_0x35ec8e=_0x35ec8e-0x0;var _0x52888a=_0x10c4[_0x35ec8e];return _0x52888a;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0x410c('0x0')](_0x410c('0x1'),{'options':{'raw':![],'attributes':['id',_0x410c('0x2'),_0x410c('0x3'),_0x410c('0x4')],'include':[{'model':_0x410c('0x5'),'as':_0x410c('0x6'),'attributes':['id',_0x410c('0x2'),_0x410c('0x7'),_0x410c('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 69d6ffa..a9eb6ae 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 _0x5fcb=['update','Request','UpdateFaxQueueReport','../client','create','CreateFaxQueueReport'];(function(_0x331f7f,_0x5c10b9){var _0xfa9d24=function(_0x135d9a){while(--_0x135d9a){_0x331f7f['push'](_0x331f7f['shift']());}};_0xfa9d24(++_0x5c10b9);}(_0x5fcb,0x141));var _0xb5fc=function(_0x143a2e,_0x8079bf){_0x143a2e=_0x143a2e-0x0;var _0x213235=_0x5fcb[_0x143a2e];return _0x213235;};'use strict';var client=require(_0xb5fc('0x0'));exports[_0xb5fc('0x1')]=function(_0x292761){return client['Request'](_0xb5fc('0x2'),{'body':_0x292761,'log':_0xb5fc('0x2')});};exports[_0xb5fc('0x3')]=function(_0x130e3a,_0x12515d){return client[_0xb5fc('0x4')](_0xb5fc('0x5'),{'body':_0x12515d,'options':{'where':{'uniqueid':_0x130e3a},'order':[['id','DESC']],'limit':0x1},'log':_0xb5fc('0x5')});}; \ No newline at end of file +var _0x7649=['../client','create','CreateFaxQueueReport','update','Request','UpdateFaxQueueReport','DESC'];(function(_0x42e63d,_0x4adedd){var _0x220aae=function(_0x32f2d5){while(--_0x32f2d5){_0x42e63d['push'](_0x42e63d['shift']());}};_0x220aae(++_0x4adedd);}(_0x7649,0x11f));var _0x9764=function(_0x419f54,_0x305359){_0x419f54=_0x419f54-0x0;var _0x332554=_0x7649[_0x419f54];return _0x332554;};'use strict';var client=require(_0x9764('0x0'));exports[_0x9764('0x1')]=function(_0x2a13d3){return client['Request'](_0x9764('0x2'),{'body':_0x2a13d3,'log':'CreateFaxQueueReport'});};exports[_0x9764('0x3')]=function(_0x7b6aa6,_0x1527b5){return client[_0x9764('0x4')](_0x9764('0x5'),{'body':_0x1527b5,'options':{'where':{'uniqueid':_0x7b6aa6},'order':[['id',_0x9764('0x6')]],'limit':0x1},'log':_0x9764('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 2fc339d..ee83f5c 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 _0x1ce2=['Interval','Intervals','getIntervals','Request','GetInterval','name'];(function(_0x522ae8,_0x3b637e){var _0x3189b9=function(_0x3115d4){while(--_0x3115d4){_0x522ae8['push'](_0x522ae8['shift']());}};_0x3189b9(++_0x3b637e);}(_0x1ce2,0x98));var _0x21ce=function(_0x1d8262,_0x48fdcb){_0x1d8262=_0x1d8262-0x0;var _0x4353e0=_0x1ce2[_0x1d8262];return _0x4353e0;};'use strict';var client=require('../client');exports[_0x21ce('0x0')]=function(){return function(){return client[_0x21ce('0x1')](_0x21ce('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x21ce('0x3')],'include':[{'model':_0x21ce('0x4'),'as':_0x21ce('0x5'),'attributes':['id',_0x21ce('0x3'),'interval']}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x1122=['../client','GetInterval','Interval','name'];(function(_0x39474b,_0x493865){var _0x38b92b=function(_0x218c43){while(--_0x218c43){_0x39474b['push'](_0x39474b['shift']());}};_0x38b92b(++_0x493865);}(_0x1122,0x1c0));var _0x2112=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1122[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x2112('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0x2112('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x2112('0x2'),'as':'Intervals','attributes':['id',_0x2112('0x3'),'interval']}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index e205311..72ec2be 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 _0x7096=['AddTagsToMailInteraction','addTagsToChatInteraction','update','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x73b1cd,_0x176535){var _0x243426=function(_0x1ee7c0){while(--_0x1ee7c0){_0x73b1cd['push'](_0x73b1cd['shift']());}};_0x243426(++_0x176535);}(_0x7096,0x10c));var _0x6709=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x7096[_0x134c2e];return _0x2825db;};'use strict';var client=require('../client');exports[_0x6709('0x0')]=function(_0x5035b7,_0x253760){return client['Request'](_0x6709('0x1'),{'body':_0x253760,'options':{'where':{'id':_0x5035b7}},'log':_0x6709('0x2')});};exports[_0x6709('0x3')]=function(_0xccdcb5,_0x3cd087){return client[_0x6709('0x4')](_0x6709('0x5'),{'body':_0x3cd087,'options':{'where':{'id':_0xccdcb5}},'log':_0x6709('0x6')});}; \ No newline at end of file +var _0xb03e=['addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction'];(function(_0x37ead0,_0x11cead){var _0x2dc949=function(_0x3609aa){while(--_0x3609aa){_0x37ead0['push'](_0x37ead0['shift']());}};_0x2dc949(++_0x11cead);}(_0xb03e,0x1eb));var _0xeb03=function(_0x26bde2,_0x57ba58){_0x26bde2=_0x26bde2-0x0;var _0x217819=_0xb03e[_0x26bde2];return _0x217819;};'use strict';var client=require('../client');exports[_0xeb03('0x0')]=function(_0x399504,_0x868905){return client[_0xeb03('0x1')](_0xeb03('0x2'),{'body':_0x868905,'options':{'where':{'id':_0x399504}},'log':_0xeb03('0x3')});};exports[_0xeb03('0x4')]=function(_0x1fe650,_0x474450){return client[_0xeb03('0x1')](_0xeb03('0x5'),{'body':_0x474450,'options':{'where':{'id':_0x1fe650}},'log':_0xeb03('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index cb6efff..fbadf7c 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 _0x5193=['createMailMessage','create','Request','CreateMailMessage'];(function(_0xbbe8da,_0x49a528){var _0x4780ec=function(_0x3a29c6){while(--_0x3a29c6){_0xbbe8da['push'](_0xbbe8da['shift']());}};_0x4780ec(++_0x49a528);}(_0x5193,0x12d));var _0x3519=function(_0x38051c,_0x2661de){_0x38051c=_0x38051c-0x0;var _0x1e351e=_0x5193[_0x38051c];return _0x1e351e;};'use strict';var client=require('../client');exports[_0x3519('0x0')]=function(_0x275e3b){return client[_0x3519('0x1')](_0x3519('0x2'),{'body':_0x275e3b,'log':_0x3519('0x3')});}; \ No newline at end of file +var _0x1637=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x583aa3,_0x16854){var _0x37a92c=function(_0x1a6259){while(--_0x1a6259){_0x583aa3['push'](_0x583aa3['shift']());}};_0x37a92c(++_0x16854);}(_0x1637,0x1cd));var _0x7163=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0x1637[_0x3e3bee];return _0x3ae14c;};'use strict';var client=require(_0x7163('0x0'));exports[_0x7163('0x1')]=function(_0xe2df2e){return client[_0x7163('0x2')](_0x7163('0x3'),{'body':_0xe2df2e,'log':_0x7163('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index abff697..a9a4f56 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 _0xb236=['getMailQueues','Request','GetMailQueue','timeout','strategy','User','Agents','name','online','mailPause','../client'];(function(_0x2cf385,_0x216ba0){var _0x2dd7a9=function(_0x5a0c1a){while(--_0x5a0c1a){_0x2cf385['push'](_0x2cf385['shift']());}};_0x2dd7a9(++_0x216ba0);}(_0xb236,0x149));var _0x6b23=function(_0x3b5c35,_0x500576){_0x3b5c35=_0x3b5c35-0x0;var _0x1ac0ab=_0xb236[_0x3b5c35];return _0x1ac0ab;};'use strict';var client=require(_0x6b23('0x0'));exports[_0x6b23('0x1')]=function(){return function(){return client[_0x6b23('0x2')](_0x6b23('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x6b23('0x4'),_0x6b23('0x5')],'include':[{'model':_0x6b23('0x6'),'as':_0x6b23('0x7'),'attributes':['id',_0x6b23('0x8'),_0x6b23('0x9'),_0x6b23('0xa')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xbf57=['GetMailQueue','name','timeout','User','Agents','mailPause','getMailQueues'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0xbf57,0x1bf));var _0x7bf5=function(_0xdac383,_0x505d99){_0xdac383=_0xdac383-0x0;var _0x3e783d=_0xbf57[_0xdac383];return _0x3e783d;};'use strict';var client=require('../client');exports[_0x7bf5('0x0')]=function(){return function(){return client['Request'](_0x7bf5('0x1'),{'options':{'raw':![],'attributes':['id',_0x7bf5('0x2'),_0x7bf5('0x3'),'strategy'],'include':[{'model':_0x7bf5('0x4'),'as':_0x7bf5('0x5'),'attributes':['id','name','online',_0x7bf5('0x6')]}]},'log':_0x7bf5('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index ceddbf9..2402420 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 _0xa531=['CreateMailQueueReport','update','Request','UpdateMailQueueReport','DESC','../client'];(function(_0x43ce4f,_0x2b70d5){var _0x54dde7=function(_0x3d364e){while(--_0x3d364e){_0x43ce4f['push'](_0x43ce4f['shift']());}};_0x54dde7(++_0x2b70d5);}(_0xa531,0x137));var _0x1a53=function(_0x49db71,_0x11757d){_0x49db71=_0x49db71-0x0;var _0x1cf32a=_0xa531[_0x49db71];return _0x1cf32a;};'use strict';var client=require(_0x1a53('0x0'));exports['create']=function(_0x7d849){return client['Request'](_0x1a53('0x1'),{'body':_0x7d849,'log':_0x1a53('0x1')});};exports[_0x1a53('0x2')]=function(_0x29b920,_0x54bf24){return client[_0x1a53('0x3')](_0x1a53('0x4'),{'body':_0x54bf24,'options':{'where':{'uniqueid':_0x29b920},'order':[['id',_0x1a53('0x5')]],'limit':0x1},'log':_0x1a53('0x4')});}; \ No newline at end of file +var _0x95ee=['create','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x1c2d28,_0x30f2fd){var _0x10c008=function(_0x371230){while(--_0x371230){_0x1c2d28['push'](_0x1c2d28['shift']());}};_0x10c008(++_0x30f2fd);}(_0x95ee,0x197));var _0xe95e=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x95ee[_0x40220a];return _0x3903cc;};'use strict';var client=require(_0xe95e('0x0'));exports[_0xe95e('0x1')]=function(_0x44d169){return client['Request']('CreateMailQueueReport',{'body':_0x44d169,'log':_0xe95e('0x2')});};exports[_0xe95e('0x3')]=function(_0x56f163,_0x40095b){return client['Request'](_0xe95e('0x4'),{'body':_0x40095b,'options':{'where':{'uniqueid':_0x56f163},'order':[['id',_0xe95e('0x5')]],'limit':0x1},'log':_0xe95e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 5c07277..90a951a 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 _0xda44=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xda44,0x1be));var _0x4da4=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xda44[_0x513aa5];return _0x1a1a7c;};'use strict';var client=require(_0x4da4('0x0'));exports[_0x4da4('0x1')]=function(_0x1e43a1,_0x3c80f9){return client[_0x4da4('0x2')](_0x4da4('0x3'),{'body':_0x3c80f9,'options':{'where':{'id':_0x1e43a1}},'log':_0x4da4('0x4')});};exports[_0x4da4('0x5')]=function(_0x1a657c,_0x4fe1ee){return client[_0x4da4('0x2')](_0x4da4('0x6'),{'body':_0x4fe1ee,'options':{'where':{'id':_0x1a657c}},'log':_0x4da4('0x7')});}; \ No newline at end of file +var _0xf756=['AddTagsToOpenchannelInteraction','../client','update','Request','addTags'];(function(_0x67b338,_0x3287b4){var _0x3fffb5=function(_0x28cf1f){while(--_0x28cf1f){_0x67b338['push'](_0x67b338['shift']());}};_0x3fffb5(++_0x3287b4);}(_0xf756,0x19b));var _0x6f75=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf756[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x6f75('0x0'));exports[_0x6f75('0x1')]=function(_0x5aa983,_0x1d0a87){return client[_0x6f75('0x2')]('UpdateOpenchannelInteraction',{'body':_0x1d0a87,'options':{'where':{'id':_0x5aa983}},'log':'updateOpenchannelInteraction'});};exports[_0x6f75('0x3')]=function(_0x31fff1,_0x35f96e){return client[_0x6f75('0x2')](_0x6f75('0x4'),{'body':_0x35f96e,'options':{'where':{'id':_0x31fff1}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 29b20c0..fd99147 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 _0xe39d=['createOpenchannelMessage','../client','create'];(function(_0x2bfd54,_0x50ab56){var _0x711287=function(_0xed54a6){while(--_0xed54a6){_0x2bfd54['push'](_0x2bfd54['shift']());}};_0x711287(++_0x50ab56);}(_0xe39d,0x127));var _0xde39=function(_0x3954e8,_0x75dd6c){_0x3954e8=_0x3954e8-0x0;var _0xc135af=_0xe39d[_0x3954e8];return _0xc135af;};'use strict';var client=require(_0xde39('0x0'));exports[_0xde39('0x1')]=function(_0x207db7){return client['Request']('CreateOpenchannelMessage',{'body':_0x207db7,'log':_0xde39('0x2')});}; \ No newline at end of file +var _0x7595=['CreateOpenchannelMessage'];(function(_0x3812fa,_0x30de51){var _0x55d12e=function(_0x2d9c99){while(--_0x2d9c99){_0x3812fa['push'](_0x3812fa['shift']());}};_0x55d12e(++_0x30de51);}(_0x7595,0x12a));var _0x5759=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0x7595[_0x35fb56];return _0x2fd52c;};'use strict';var client=require('../client');exports['create']=function(_0x52241a){return client['Request'](_0x5759('0x0'),{'body':_0x52241a,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index a0cedb5..2c7efe7 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 _0xa34f=['Request','GetOpenchannelQueue','name','timeout','online','getOpenchannelQueues'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa34f,0x65));var _0xfa34=function(_0xa20b00,_0x2159b8){_0xa20b00=_0xa20b00-0x0;var _0x16c001=_0xa34f[_0xa20b00];return _0x16c001;};'use strict';var client=require('../client');exports[_0xfa34('0x0')]=function(){return function(){return client[_0xfa34('0x1')](_0xfa34('0x2'),{'options':{'raw':![],'attributes':['id',_0xfa34('0x3'),_0xfa34('0x4'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0xfa34('0x3'),_0xfa34('0x5'),'openchannelPause']}]},'log':_0xfa34('0x0')});};}; \ No newline at end of file +var _0x42c6=['openchannelPause','getOpenchannelQueues','name','User','Agents','online'];(function(_0xe98411,_0x23fd48){var _0x435820=function(_0x41286c){while(--_0x41286c){_0xe98411['push'](_0xe98411['shift']());}};_0x435820(++_0x23fd48);}(_0x42c6,0x15e));var _0x642c=function(_0x4ac428,_0x17265b){_0x4ac428=_0x4ac428-0x0;var _0x2f6fe5=_0x42c6[_0x4ac428];return _0x2f6fe5;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x642c('0x0'),'timeout','strategy'],'include':[{'model':_0x642c('0x1'),'as':_0x642c('0x2'),'attributes':['id','name',_0x642c('0x3'),_0x642c('0x4')]}]},'log':_0x642c('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 4506b6c..929b83f 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 _0xc3d4=['DESC','../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x279397,_0x34e495){var _0xbbb575=function(_0x58cc9c){while(--_0x58cc9c){_0x279397['push'](_0x279397['shift']());}};_0xbbb575(++_0x34e495);}(_0xc3d4,0xd3));var _0x4c3d=function(_0x395619,_0x1e0cef){_0x395619=_0x395619-0x0;var _0x561a46=_0xc3d4[_0x395619];return _0x561a46;};'use strict';var client=require(_0x4c3d('0x0'));exports[_0x4c3d('0x1')]=function(_0xa53994){return client[_0x4c3d('0x2')]('CreateOpenchannelQueueReport',{'body':_0xa53994,'log':_0x4c3d('0x3')});};exports[_0x4c3d('0x4')]=function(_0x3dc2bd,_0x2d0e45){return client['Request'](_0x4c3d('0x5'),{'body':_0x2d0e45,'options':{'where':{'uniqueid':_0x3dc2bd},'order':[['id',_0x4c3d('0x6')]],'limit':0x1},'log':_0x4c3d('0x5')});}; \ No newline at end of file +var _0x7317=['update','Request','UpdateOpenchannelQueueReport','DESC','../client','create','CreateOpenchannelQueueReport'];(function(_0x3665bc,_0x4e48c6){var _0x204063=function(_0x1f0926){while(--_0x1f0926){_0x3665bc['push'](_0x3665bc['shift']());}};_0x204063(++_0x4e48c6);}(_0x7317,0xac));var _0x7731=function(_0x233b1f,_0x21f403){_0x233b1f=_0x233b1f-0x0;var _0x4e6157=_0x7317[_0x233b1f];return _0x4e6157;};'use strict';var client=require(_0x7731('0x0'));exports[_0x7731('0x1')]=function(_0x1528e7){return client['Request'](_0x7731('0x2'),{'body':_0x1528e7,'log':_0x7731('0x2')});};exports[_0x7731('0x3')]=function(_0x399b77,_0x523fce){return client[_0x7731('0x4')](_0x7731('0x5'),{'body':_0x523fce,'options':{'where':{'uniqueid':_0x399b77},'order':[['id',_0x7731('0x6')]],'limit':0x1},'log':_0x7731('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 151b0e3..c584da0 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 _0xe647=['update','Request','UpdateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0xed91ce,_0x51709b){var _0x56885a=function(_0x1e2c8e){while(--_0x1e2c8e){_0xed91ce['push'](_0xed91ce['shift']());}};_0x56885a(++_0x51709b);}(_0xe647,0x16d));var _0x7e64=function(_0x2e8113,_0x4c482d){_0x2e8113=_0x2e8113-0x0;var _0xbacf18=_0xe647[_0x2e8113];return _0xbacf18;};'use strict';var client=require(_0x7e64('0x0'));exports[_0x7e64('0x1')]=function(_0x54aaab,_0x41d99f){return client[_0x7e64('0x2')](_0x7e64('0x3'),{'body':_0x41d99f,'options':{'where':{'id':_0x54aaab}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x7ed710,_0x2e00b0){return client[_0x7e64('0x2')](_0x7e64('0x4'),{'body':_0x2e00b0,'options':{'where':{'id':_0x7ed710}},'log':_0x7e64('0x5')});}; \ No newline at end of file +var _0xe94a=['update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x113e32,_0x5339f0){var _0x4ff939=function(_0x2be9ca){while(--_0x2be9ca){_0x113e32['push'](_0x113e32['shift']());}};_0x4ff939(++_0x5339f0);}(_0xe94a,0x1c7));var _0xae94=function(_0x27a3cb,_0x4af597){_0x27a3cb=_0x27a3cb-0x0;var _0x54ff38=_0xe94a[_0x27a3cb];return _0x54ff38;};'use strict';var client=require(_0xae94('0x0'));exports[_0xae94('0x1')]=function(_0x1735f9,_0x59a458){return client[_0xae94('0x2')](_0xae94('0x3'),{'body':_0x59a458,'options':{'where':{'id':_0x1735f9}},'log':_0xae94('0x4')});};exports[_0xae94('0x5')]=function(_0x3bf666,_0xf48ae1){return client['Request'](_0xae94('0x6'),{'body':_0xf48ae1,'options':{'where':{'id':_0x3bf666}},'log':_0xae94('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index b1fa8bd..0d897e3 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 _0xa75b=['CreateSmsMessage','create'];(function(_0x1fd907,_0x593e1c){var _0x2eb25f=function(_0x33bb32){while(--_0x33bb32){_0x1fd907['push'](_0x1fd907['shift']());}};_0x2eb25f(++_0x593e1c);}(_0xa75b,0x177));var _0xba75=function(_0x703017,_0x22a477){_0x703017=_0x703017-0x0;var _0x106832=_0xa75b[_0x703017];return _0x106832;};'use strict';var client=require('../client');exports[_0xba75('0x0')]=function(_0x2ec6eb){return client['Request'](_0xba75('0x1'),{'body':_0x2ec6eb,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x7178=['create','createSmsMessage'];(function(_0x368ef3,_0x54adfc){var _0x3d1a93=function(_0x52b9e3){while(--_0x52b9e3){_0x368ef3['push'](_0x368ef3['shift']());}};_0x3d1a93(++_0x54adfc);}(_0x7178,0x100));var _0x8717=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7178[_0xfae23b];return _0x200640;};'use strict';var client=require('../client');exports[_0x8717('0x0')]=function(_0x377f3b){return client['Request']('CreateSmsMessage',{'body':_0x377f3b,'log':_0x8717('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index c944998..e5909e4 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 _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x479746,_0x574758){var _0x36d2aa=function(_0x27e29d){while(--_0x27e29d){_0x479746['push'](_0x479746['shift']());}};_0x36d2aa(++_0x574758);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x25b608,_0x534ba2){var _0x2fb820=function(_0x38e035){while(--_0x38e035){_0x25b608['push'](_0x25b608['shift']());}};_0x2fb820(++_0x534ba2);}(_0xe706,0xa3));var _0x6e70=function(_0xfcc0e,_0x1da886){_0xfcc0e=_0xfcc0e-0x0;var _0x32bb2e=_0xe706[_0xfcc0e];return _0x32bb2e;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index a897213..d8ce0de 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 _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x5930a1,_0x2b525c){var _0x231d49=function(_0x43c61c){while(--_0x43c61c){_0x5930a1['push'](_0x5930a1['shift']());}};_0x231d49(++_0x2b525c);}(_0x55ca,0x126));var _0xa55c=function(_0x403115,_0x2d6d03){_0x403115=_0x403115-0x0;var _0x596ef3=_0x55ca[_0x403115];return _0x596ef3;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x1e27fa,_0x2444ee){var _0x407cf7=function(_0x500c53){while(--_0x500c53){_0x1e27fa['push'](_0x1e27fa['shift']());}};_0x407cf7(++_0x2444ee);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index a4a164d..f987c0c 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(_0x17cadc,_0xcebfdd){var _0x24778e=function(_0x6900b6){while(--_0x6900b6){_0x17cadc['push'](_0x17cadc['shift']());}};_0x24778e(++_0xcebfdd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x52e0d6,_0x549b83){var _0x4c15dd=function(_0x5a8735){while(--_0x5a8735){_0x52e0d6['push'](_0x52e0d6['shift']());}};_0x4c15dd(++_0x549b83);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 2ac3bde..117b550 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 _0x2675=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','Request','UpdateWhatsappInteraction'];(function(_0x5b04d9,_0x1d5956){var _0x1230f1=function(_0xe3e12b){while(--_0xe3e12b){_0x5b04d9['push'](_0x5b04d9['shift']());}};_0x1230f1(++_0x1d5956);}(_0x2675,0x75));var _0x5267=function(_0x1a89ec,_0x50ea99){_0x1a89ec=_0x1a89ec-0x0;var _0x8c9db=_0x2675[_0x1a89ec];return _0x8c9db;};'use strict';var client=require(_0x5267('0x0'));exports['update']=function(_0x53e71f,_0x4f8fae){return client[_0x5267('0x1')](_0x5267('0x2'),{'body':_0x4f8fae,'options':{'where':{'id':_0x53e71f}},'log':'updateWhatsappInteraction'});};exports[_0x5267('0x3')]=function(_0x36bdf0,_0x4e2548){return client[_0x5267('0x1')](_0x5267('0x4'),{'body':_0x4e2548,'options':{'where':{'id':_0x36bdf0}},'log':_0x5267('0x5')});}; \ No newline at end of file +var _0xd2f5=['../client','Request','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x4e5c3a,_0x46ea14){var _0x5eec96=function(_0x354d06){while(--_0x354d06){_0x4e5c3a['push'](_0x4e5c3a['shift']());}};_0x5eec96(++_0x46ea14);}(_0xd2f5,0x144));var _0x5d2f=function(_0x4b3845,_0x20f3d0){_0x4b3845=_0x4b3845-0x0;var _0x4caaac=_0xd2f5[_0x4b3845];return _0x4caaac;};'use strict';var client=require(_0x5d2f('0x0'));exports['update']=function(_0x194209,_0x58ee4e){return client[_0x5d2f('0x1')]('UpdateWhatsappInteraction',{'body':_0x58ee4e,'options':{'where':{'id':_0x194209}},'log':_0x5d2f('0x2')});};exports[_0x5d2f('0x3')]=function(_0x102911,_0xc7102b){return client[_0x5d2f('0x1')](_0x5d2f('0x4'),{'body':_0xc7102b,'options':{'where':{'id':_0x102911}},'log':_0x5d2f('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 5333681..8b332a7 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 _0x8bbb=['Request','createWhatsappMessage','../client','create'];(function(_0x2dccaa,_0x17d83f){var _0x5b22c6=function(_0x379972){while(--_0x379972){_0x2dccaa['push'](_0x2dccaa['shift']());}};_0x5b22c6(++_0x17d83f);}(_0x8bbb,0x13a));var _0xb8bb=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0x8bbb[_0x152678];return _0x311a9;};'use strict';var client=require(_0xb8bb('0x0'));exports[_0xb8bb('0x1')]=function(_0x3352a2){return client[_0xb8bb('0x2')]('CreateWhatsappMessage',{'body':_0x3352a2,'log':_0xb8bb('0x3')});}; \ No newline at end of file +var _0x4e5f=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x1abf98,_0x58231b){var _0x2dceac=function(_0x4d5973){while(--_0x4d5973){_0x1abf98['push'](_0x1abf98['shift']());}};_0x2dceac(++_0x58231b);}(_0x4e5f,0x17b));var _0xf4e5=function(_0x3e8f0e,_0x598653){_0x3e8f0e=_0x3e8f0e-0x0;var _0x121c4e=_0x4e5f[_0x3e8f0e];return _0x121c4e;};'use strict';var client=require(_0xf4e5('0x0'));exports[_0xf4e5('0x1')]=function(_0x2b5973){return client[_0xf4e5('0x2')](_0xf4e5('0x3'),{'body':_0x2b5973,'log':_0xf4e5('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 23a527c..2d2293a 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 _0x95a3=['User','name','online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','timeout','strategy'];(function(_0x4fe2d7,_0x22d656){var _0x175f83=function(_0x190795){while(--_0x190795){_0x4fe2d7['push'](_0x4fe2d7['shift']());}};_0x175f83(++_0x22d656);}(_0x95a3,0x94));var _0x395a=function(_0x3ae1fa,_0x58373c){_0x3ae1fa=_0x3ae1fa-0x0;var _0xac10bb=_0x95a3[_0x3ae1fa];return _0xac10bb;};'use strict';var client=require(_0x395a('0x0'));exports[_0x395a('0x1')]=function(){return function(){return client['Request'](_0x395a('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x395a('0x3'),_0x395a('0x4')],'include':[{'model':_0x395a('0x5'),'as':'Agents','attributes':['id',_0x395a('0x6'),_0x395a('0x7'),_0x395a('0x8')]}]},'log':_0x395a('0x1')});};}; \ No newline at end of file +var _0x8cd1=['strategy','User','Agents','online','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8cd1,0x1a0));var _0x18cd=function(_0x3e4f71,_0x2046d5){_0x3e4f71=_0x3e4f71-0x0;var _0x16ee0a=_0x8cd1[_0x3e4f71];return _0x16ee0a;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0x18cd('0x0')](_0x18cd('0x1'),{'options':{'raw':![],'attributes':['id',_0x18cd('0x2'),_0x18cd('0x3'),_0x18cd('0x4')],'include':[{'model':_0x18cd('0x5'),'as':_0x18cd('0x6'),'attributes':['id','name',_0x18cd('0x7'),_0x18cd('0x8')]}]},'log':_0x18cd('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 2ae6a74..57e7cd3 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 _0xa298=['Request','UpdateWhatsappQueueReport','DESC','../client','create','CreateWhatsappQueueReport','update'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa298,0x199));var _0x8a29=function(_0x1d90db,_0x3ea753){_0x1d90db=_0x1d90db-0x0;var _0x49e4b9=_0xa298[_0x1d90db];return _0x49e4b9;};'use strict';var client=require(_0x8a29('0x0'));exports[_0x8a29('0x1')]=function(_0x114606){return client['Request'](_0x8a29('0x2'),{'body':_0x114606,'log':_0x8a29('0x2')});};exports[_0x8a29('0x3')]=function(_0x37b9f9,_0x1d7967){return client[_0x8a29('0x4')](_0x8a29('0x5'),{'body':_0x1d7967,'options':{'where':{'uniqueid':_0x37b9f9},'order':[['id',_0x8a29('0x6')]],'limit':0x1},'log':_0x8a29('0x5')});}; \ No newline at end of file +var _0x6fcf=['DESC','../client','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport'];(function(_0x201bb4,_0x4a8e4d){var _0x595f43=function(_0x1cf2e0){while(--_0x1cf2e0){_0x201bb4['push'](_0x201bb4['shift']());}};_0x595f43(++_0x4a8e4d);}(_0x6fcf,0x1d7));var _0xf6fc=function(_0x2c2a81,_0x1d63e5){_0x2c2a81=_0x2c2a81-0x0;var _0x4e337c=_0x6fcf[_0x2c2a81];return _0x4e337c;};'use strict';var client=require(_0xf6fc('0x0'));exports['create']=function(_0x2c2134){return client[_0xf6fc('0x1')](_0xf6fc('0x2'),{'body':_0x2c2134,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x3956cf,_0xca32a1){return client[_0xf6fc('0x1')](_0xf6fc('0x3'),{'body':_0xca32a1,'options':{'where':{'uniqueid':_0x3956cf},'order':[['id',_0xf6fc('0x4')]],'limit':0x1},'log':_0xf6fc('0x3')});}; \ 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 983ef22..38c6876 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 _0xe191=['[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','stop','timeout','atimeout','channel','format','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','error','log'];(function(_0x416faa,_0x158ab4){var _0x300f66=function(_0x178544){while(--_0x178544){_0x416faa['push'](_0x416faa['shift']());}};_0x300f66(++_0x158ab4);}(_0xe191,0x98));var _0x1e19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe191[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x1e19('0x0'));var _=require(_0x1e19('0x1'));var util=require(_0x1e19('0x2'));var seqqueue=require(_0x1e19('0x3'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x1e19('0x4'));var queue=schema({'name':{'type':_0x1e19('0x5'),'required':!![],'message':_0x1e19('0x6')},'timeout':{'type':'number','message':_0x1e19('0x7')}});function writeLog(_0x4ab435,_0xbdda,_0x4bfdc1){return logger[_0x1e19('0x8')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x4ab435,_0xbdda[_0x1e19('0x9')],_0x4bfdc1));}function handleFindAgent(_0xd0e526){return function(_0x30dc58){return _0x30dc58['name'][_0x1e19('0xa')]()===_0xd0e526[_0x1e19('0xa')]();};}exports[_0x1e19('0xb')]=function(_0x856fd9,_0x29f8b4,_0x2c33e1,_0x176910){return function(_0x1b2783){try{var _0x3ffdec={'name':_0x29f8b4[0x0],'timeout':_0x29f8b4[0x1]};var _0xf818b3=queue[_0x1e19('0x0')](_0x3ffdec,{'typecast':!![]});if(_0xf818b3[_0x1e19('0xc')]){logger['error'](_0x1e19('0xd'),_0x856fd9,_['map'](_0xf818b3,'message')['join'](',\x20'));_0x1b2783[_0x1e19('0xe')]();}else{var _0x2c8dc3=_['find'](_0x2c33e1['agents'],handleFindAgent(_0x3ffdec[_0x1e19('0x9')]));if(_0x2c8dc3){var _0x2bcf9c=(_0x3ffdec[_0x1e19('0xf')]||0xa)*0x3e8;var _0x328a66,_0x3fd50a;var _0x4960ac=seqqueue['createQueue'](_0x2bcf9c);_0x4960ac['id']=_0x856fd9;_0x4960ac[_0x1e19('0x10')]=_0x2bcf9c;_0x4960ac[_0x1e19('0x11')]=_0x176910[_0x1e19('0x11')];writeLog(_0x856fd9,_0x2c8dc3,util[_0x1e19('0x12')]('START:%s',_0x2bcf9c));_0x2c33e1[_0x1e19('0x13')][_0x856fd9]['on']('end',function(){logger[_0x1e19('0x8')](_0x1e19('0x14'),_0x856fd9);clearTimeout(_0x3fd50a);_0x3fd50a=undefined;_0x4960ac['close']();if(_0x2c33e1['rules'][_0x856fd9]){delete _0x2c33e1[_0x1e19('0x13')][_0x856fd9];}_0x1b2783[_0x1e19('0xe')]();});_0x2c33e1[_0x1e19('0x13')][_0x856fd9]['on'](_0x1e19('0x15'),function(){if(_0x2c33e1[_0x1e19('0x13')][_0x856fd9]){delete _0x2c33e1[_0x1e19('0x13')][_0x856fd9];}});_0x3fd50a=setTimeout(function(){logger[_0x1e19('0x8')](_0x1e19('0x16'),_0x856fd9);clearTimeout(_0x3fd50a);_0x4960ac[_0x1e19('0x17')]();_0x1b2783[_0x1e19('0x18')]();},_0x2bcf9c);strategy[_0x1e19('0x19')](_0x4960ac,_0x2c8dc3,_0x2c33e1,_0x176910);}else{logger[_0x1e19('0x1a')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x856fd9,_0x3ffdec[_0x1e19('0x9')]);_0x1b2783[_0x1e19('0xe')]();}}}catch(_0x274dcc){console[_0x1e19('0x1b')](_0x274dcc);logger[_0x1e19('0x1a')](_0x1e19('0x1c'),_0x856fd9,_0x274dcc[_0x1e19('0x1d')]);_0x1b2783[_0x1e19('0xe')]();}};}; \ No newline at end of file +var _0xbbc0=['rules','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','../../../../config/logger','routing','./strategy','string','format','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','end','info'];(function(_0x39da6a,_0x47dca5){var _0x5b1809=function(_0x8a2fb5){while(--_0x8a2fb5){_0x39da6a['push'](_0x39da6a['shift']());}};_0x5b1809(++_0x47dca5);}(_0xbbc0,0x79));var _0x0bbc=function(_0x2f1311,_0x1c38c3){_0x2f1311=_0x2f1311-0x0;var _0x3eec53=_0xbbc0[_0x2f1311];return _0x3eec53;};'use strict';var schema=require(_0x0bbc('0x0'));var _=require(_0x0bbc('0x1'));var util=require(_0x0bbc('0x2'));var seqqueue=require(_0x0bbc('0x3'));var logger=require(_0x0bbc('0x4'))(_0x0bbc('0x5'));var strategy=require(_0x0bbc('0x6'));var queue=schema({'name':{'type':_0x0bbc('0x7'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x5b45be,_0x5071a3,_0x14772a){return logger['info'](util[_0x0bbc('0x8')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5b45be,_0x5071a3[_0x0bbc('0x9')],_0x14772a));}function handleFindAgent(_0x5beee4){return function(_0x7ca160){return _0x7ca160[_0x0bbc('0x9')][_0x0bbc('0xa')]()===_0x5beee4[_0x0bbc('0xa')]();};}exports[_0x0bbc('0xb')]=function(_0x2ffbae,_0x1370ef,_0x1bcf50,_0x4333e3){return function(_0x4e2cb2){try{var _0x42d9cc={'name':_0x1370ef[0x0],'timeout':_0x1370ef[0x1]};var _0x16d837=queue[_0x0bbc('0x0')](_0x42d9cc,{'typecast':!![]});if(_0x16d837[_0x0bbc('0xc')]){logger[_0x0bbc('0xd')](_0x0bbc('0xe'),_0x2ffbae,_['map'](_0x16d837,_0x0bbc('0xf'))[_0x0bbc('0x10')](',\x20'));_0x4e2cb2[_0x0bbc('0x11')]();}else{var _0x1a5af9=_[_0x0bbc('0x12')](_0x1bcf50[_0x0bbc('0x13')],handleFindAgent(_0x42d9cc[_0x0bbc('0x9')]));if(_0x1a5af9){var _0x5b6902=(_0x42d9cc[_0x0bbc('0x14')]||0xa)*0x3e8;var _0x1f5f9d,_0x5846e3;var _0x2489ad=seqqueue[_0x0bbc('0x15')](_0x5b6902);_0x2489ad['id']=_0x2ffbae;_0x2489ad[_0x0bbc('0x16')]=_0x5b6902;_0x2489ad[_0x0bbc('0x17')]=_0x4333e3['channel'];writeLog(_0x2ffbae,_0x1a5af9,util[_0x0bbc('0x8')](_0x0bbc('0x18'),_0x5b6902));_0x1bcf50['rules'][_0x2ffbae]['on'](_0x0bbc('0x19'),function(){logger[_0x0bbc('0x1a')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x2ffbae);clearTimeout(_0x5846e3);_0x5846e3=undefined;_0x2489ad['close']();if(_0x1bcf50['rules'][_0x2ffbae]){delete _0x1bcf50[_0x0bbc('0x1b')][_0x2ffbae];}_0x4e2cb2['stop']();});_0x1bcf50[_0x0bbc('0x1b')][_0x2ffbae]['on'](_0x0bbc('0x1c'),function(){if(_0x1bcf50[_0x0bbc('0x1b')][_0x2ffbae]){delete _0x1bcf50['rules'][_0x2ffbae];}});_0x5846e3=setTimeout(function(){logger[_0x0bbc('0x1a')](_0x0bbc('0x1d'),_0x2ffbae);clearTimeout(_0x5846e3);_0x2489ad[_0x0bbc('0x1e')]();_0x4e2cb2[_0x0bbc('0x1f')]();},_0x5b6902);strategy[_0x0bbc('0x20')](_0x2489ad,_0x1a5af9,_0x1bcf50,_0x4333e3);}else{logger[_0x0bbc('0xd')](_0x0bbc('0x21'),_0x2ffbae,_0x42d9cc[_0x0bbc('0x9')]);_0x4e2cb2[_0x0bbc('0x11')]();}}}catch(_0x36794f){console[_0x0bbc('0x22')](_0x36794f);logger[_0x0bbc('0xd')](_0x0bbc('0x23'),_0x2ffbae,_0x36794f[_0x0bbc('0x24')]);_0x4e2cb2['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 62b0259..5a0ce50 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 _0x8388=['error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','providerName','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','interaction','created','isEmpty','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s'];(function(_0x508819,_0x5b8588){var _0x6668b7=function(_0x143512){while(--_0x143512){_0x508819['push'](_0x508819['shift']());}};_0x6668b7(++_0x5b8588);}(_0x8388,0xd2));var _0x8838=function(_0x1b91c7,_0x539acd){_0x1b91c7=_0x1b91c7-0x0;var _0xbbe014=_0x8388[_0x1b91c7];return _0xbbe014;};'use strict';var _=require(_0x8838('0x0'));var moment=require(_0x8838('0x1'));var AWS=require(_0x8838('0x2'));var utils=require(_0x8838('0x3'));var logger=require(_0x8838('0x4'))(_0x8838('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x8838('0x6')),'faxMessage':require(_0x8838('0x7')),'whatsappMessage':require(_0x8838('0x8'))};exports['consequence']=function(_0x5c6181,_0x46b209){return function(_0x30a617){try{if(!_[_0x8838('0x9')](this['interaction'][_0x8838('0xa')])){logger[_0x8838('0xb')]('[%s][AMAZONLEX]\x20%s',_0x5c6181,_0x8838('0xc'));return _0x30a617[_0x8838('0xd')]();}var _0x3a7adb={'ContactId':this[_0x8838('0xe')]['id'],'sentAt':moment()[_0x8838('0xf')](_0x8838('0x10')),'direction':'out'};if(this[_0x8838('0x11')]===_0x8838('0x12')||this[_0x8838('0x11')]===_0x8838('0x13')){_0x3a7adb[_0x8838('0x14')]=this['interaction'][_0x8838('0x14')];}var _0x286b32=this[_0x8838('0x11')];if(_0x286b32===_0x8838('0x15')){_0x3a7adb[_0x8838('0x16')]=this['account']['id'];}else{_0x3a7adb[_[_0x8838('0x17')](_0x286b32)+_0x8838('0x18')]=this[_0x8838('0x19')]['id'];}_0x3a7adb[_[_0x8838('0x17')](_0x286b32)+'InteractionId']=this[_0x8838('0x1a')]['id'];if(this[_0x8838('0x1a')][_0x8838('0x1b')]){var _0x4ea970=_0x46b209[0x4];if(!_[_0x8838('0x1c')](_0x4ea970)){_0x3a7adb[_0x8838('0x1d')]=utils[_0x8838('0x1e')](_0x4ea970,this);return rpc[_0x286b32+_0x8838('0x1f')][_0x8838('0x20')](_0x3a7adb)[_0x8838('0x21')](function(_0x5bd745){logger[_0x8838('0xb')](_0x8838('0x22'),_0x5c6181,_0x3a7adb[_0x8838('0x1d')]);})['catch'](function(_0x438782){logger[_0x8838('0x23')](_0x8838('0x22'),_0x5c6181,JSON[_0x8838('0x24')](_0x438782));})[_0x8838('0x25')](function(){logger[_0x8838('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5c6181);_0x30a617[_0x8838('0x26')]();});}else{logger[_0x8838('0xb')](_0x8838('0x27'),_0x5c6181);_0x30a617[_0x8838('0x26')]();}}else{var _0x5f349f=this;var _0x643877=new AWS[(_0x8838('0x28'))]({'accessKeyId':_0x46b209[0x0],'secretAccessKey':_0x46b209[0x1],'region':_0x46b209[0x2]});var _0x363b0c={'botAlias':_0x8838('0x29'),'botName':_0x46b209[0x3],'inputText':this[_0x8838('0x2a')][_0x8838('0x1d')],'userId':this['channel']+':'+this['interaction']['id'][_0x8838('0x2b')]()};_0x643877[_0x8838('0x2c')](_0x363b0c,function(_0x56792c,_0x3fc8ca){if(_0x56792c){logger[_0x8838('0x23')](_0x8838('0x22'),_0x5c6181,_0x56792c['message']);_0x30a617['next']();}else if(_0x3fc8ca&&_0x3fc8ca['message']){_0x5f349f[_0x8838('0x1d')]['amazonlex']=_0x3fc8ca;_0x3a7adb[_0x8838('0x1d')]=_0x3fc8ca['message'];_0x3a7adb[_0x8838('0x2d')]='amazonlex';_0x3a7adb[_0x8838('0x2e')]=JSON[_0x8838('0x24')](_0x3fc8ca);return rpc[_0x286b32+_0x8838('0x1f')][_0x8838('0x20')](_0x3a7adb)['then'](function(_0x3de831){logger[_0x8838('0xb')](_0x8838('0x22'),_0x5c6181,_0x3a7adb[_0x8838('0x1d')]);if(_0x3fc8ca[_0x8838('0x2f')]==_0x8838('0x30')){_0x30a617[_0x8838('0xd')]();}else{_0x30a617['stop']();}})['catch'](function(_0x474c68){logger[_0x8838('0x23')](_0x8838('0x22'),_0x5c6181,JSON[_0x8838('0x24')](_0x474c68));_0x30a617[_0x8838('0xd')]();});}else{_0x30a617[_0x8838('0xd')]();}});}}catch(_0x121a1c){logger[_0x8838('0x23')](_0x8838('0x22'),_0x5c6181,JSON['stringify'](_0x121a1c));_0x30a617[_0x8838('0x26')]();}};}; \ No newline at end of file +var _0x932b=['interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','error','amazonlex','providerName','Failed','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x932b,0x1cc));var _0xb932=function(_0x7abcd6,_0x36548c){_0x7abcd6=_0x7abcd6-0x0;var _0x329aea=_0x932b[_0x7abcd6];return _0x329aea;};'use strict';var _=require(_0xb932('0x0'));var moment=require('moment');var AWS=require(_0xb932('0x1'));var utils=require(_0xb932('0x2'));var logger=require(_0xb932('0x3'))(_0xb932('0x4'));var rpc={'chatMessage':require(_0xb932('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xb932('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb932('0x7')),'whatsappMessage':require(_0xb932('0x8'))};exports[_0xb932('0x9')]=function(_0x30a1c9,_0x2bcf3d){return function(_0x3419a4){try{if(!_['isNil'](this[_0xb932('0xa')]['UserId'])){logger[_0xb932('0xb')](_0xb932('0xc'),_0x30a1c9,_0xb932('0xd'));return _0x3419a4[_0xb932('0xe')]();}var _0x1d157b={'ContactId':this[_0xb932('0xf')]['id'],'sentAt':moment()[_0xb932('0x10')](_0xb932('0x11')),'direction':_0xb932('0x12')};if(this[_0xb932('0x13')]===_0xb932('0x14')||this['channel']===_0xb932('0x15')){_0x1d157b[_0xb932('0x16')]=this['interaction'][_0xb932('0x16')];}var _0x1a2ade=this[_0xb932('0x13')];if(_0x1a2ade==='chat'){_0x1d157b['ChatWebsiteId']=this[_0xb932('0x17')]['id'];}else{_0x1d157b[_[_0xb932('0x18')](_0x1a2ade)+_0xb932('0x19')]=this['account']['id'];}_0x1d157b[_[_0xb932('0x18')](_0x1a2ade)+'InteractionId']=this[_0xb932('0xa')]['id'];if(this[_0xb932('0xa')][_0xb932('0x1a')]){var _0x4be39f=_0x2bcf3d[0x4];if(!_[_0xb932('0x1b')](_0x4be39f)){_0x1d157b[_0xb932('0x1c')]=utils[_0xb932('0x1d')](_0x4be39f,this);return rpc[_0x1a2ade+_0xb932('0x1e')][_0xb932('0x1f')](_0x1d157b)[_0xb932('0x20')](function(_0x244ac0){logger['info']('[%s][AMAZONLEX]\x20%s',_0x30a1c9,_0x1d157b[_0xb932('0x1c')]);})[_0xb932('0x21')](function(_0x11b325){logger['error'](_0xb932('0xc'),_0x30a1c9,JSON[_0xb932('0x22')](_0x11b325));})[_0xb932('0x23')](function(){logger[_0xb932('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x30a1c9);_0x3419a4[_0xb932('0x24')]();});}else{logger[_0xb932('0xb')](_0xb932('0x25'),_0x30a1c9);_0x3419a4['stop']();}}else{var _0x14034f=this;var _0x2484cd=new AWS[(_0xb932('0x26'))]({'accessKeyId':_0x2bcf3d[0x0],'secretAccessKey':_0x2bcf3d[0x1],'region':_0x2bcf3d[0x2]});var _0x1bbe88={'botAlias':_0xb932('0x27'),'botName':_0x2bcf3d[0x3],'inputText':this[_0xb932('0x28')][_0xb932('0x1c')],'userId':this['channel']+':'+this[_0xb932('0xa')]['id'][_0xb932('0x29')]()};_0x2484cd[_0xb932('0x2a')](_0x1bbe88,function(_0x471b94,_0x478666){if(_0x471b94){logger[_0xb932('0x2b')](_0xb932('0xc'),_0x30a1c9,_0x471b94[_0xb932('0x28')]);_0x3419a4[_0xb932('0xe')]();}else if(_0x478666&&_0x478666[_0xb932('0x28')]){_0x14034f[_0xb932('0x1c')][_0xb932('0x2c')]=_0x478666;_0x1d157b['body']=_0x478666[_0xb932('0x28')];_0x1d157b[_0xb932('0x2d')]=_0xb932('0x2c');_0x1d157b['providerResponse']=JSON[_0xb932('0x22')](_0x478666);return rpc[_0x1a2ade+_0xb932('0x1e')][_0xb932('0x1f')](_0x1d157b)[_0xb932('0x20')](function(_0x306cf5){logger[_0xb932('0xb')](_0xb932('0xc'),_0x30a1c9,_0x1d157b[_0xb932('0x1c')]);if(_0x478666['dialogState']==_0xb932('0x2e')){_0x3419a4['next']();}else{_0x3419a4['stop']();}})[_0xb932('0x21')](function(_0x20b7dc){logger[_0xb932('0x2b')](_0xb932('0xc'),_0x30a1c9,JSON[_0xb932('0x22')](_0x20b7dc));_0x3419a4[_0xb932('0xe')]();});}else{_0x3419a4['next']();}});}}catch(_0xd634a9){logger['error'](_0xb932('0xc'),_0x30a1c9,JSON[_0xb932('0x22')](_0xd634a9));_0x3419a4[_0xb932('0x24')]();}};}; \ 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 8de2eb8..1f60480 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 _0x82ad=['auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','update','[%s][AUTOREPLY]\x20%s','resolve','Interaction','stop','lodash','moment','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','chat','account','AccountId','upperFirst','InteractionId','Message','messageId','html','','replace','','headers','auto-replied','All'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x82ad,0x120));var _0xd82a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x82ad[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd82a('0x0'));var moment=require(_0xd82a('0x1'));var utils=require('./utils');var logger=require(_0xd82a('0x2'))(_0xd82a('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xd82a('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xd82a('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xd82a('0x6')),'mailInteraction':require(_0xd82a('0x7')),'smsInteraction':require(_0xd82a('0x8')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xd82a('0x9'))};var mailRpc=require(_0xd82a('0xa'));exports[_0xd82a('0xb')]=function(_0x273175,_0xca847b,_0x44fa95,_0x4eaad0){return function(_0x27f24c){try{var _0x151e63=this[_0xd82a('0xc')];if(_0x151e63===_0xd82a('0xd')&&_0x4eaad0['body'][_0xd82a('0xe')]){logger[_0xd82a('0xf')]('[%s][AUTOREPLY]\x20%s',_0x273175,_0xd82a('0x10'));return _0x27f24c[_0xd82a('0x11')]();}if(_0xca847b[0x0]==='1'&&(_[_0xd82a('0x12')](this[_0xd82a('0x13')]['created'])||!this[_0xd82a('0x13')]['created'])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x273175,_0xd82a('0x14'));return _0x27f24c['next']();}if(_0xca847b[0x0]==='2'&&this[_0xd82a('0x13')][_0xd82a('0x15')]){logger[_0xd82a('0xf')](_0xd82a('0x16'),_0x273175,_0xd82a('0x17'));return _0x27f24c[_0xd82a('0x11')]();}var _0x4e1058={'ContactId':this[_0xd82a('0x18')]['id'],'sentAt':moment()[_0xd82a('0x19')](_0xd82a('0x1a')),'direction':_0xd82a('0x1b')};if(this[_0xd82a('0xc')]===_0xd82a('0xd')){_0x4e1058['body']=utils['getMustacheRender'](_0xca847b[0x2],this);}else{_0x4e1058[_0xd82a('0x1c')]=utils[_0xd82a('0x1d')](_0xca847b[0x1],this);}if(this[_0xd82a('0x1e')]){_0x4e1058['to']=this[_0xd82a('0x1e')][_0xd82a('0x1f')]||'';if(this['channel']===_0xd82a('0xd')&&_0xca847b[0x1]==='1'){_0x4e1058['cc']=this[_0xd82a('0x1e')]['cc']||'';}_0x4e1058[_0xd82a('0x1f')]=this[_0xd82a('0x1e')]['to']||'';_0x4e1058[_0xd82a('0x20')]=this['message'][_0xd82a('0x20')]||'';_0x4e1058[_0xd82a('0x21')]=!![];if(this[_0xd82a('0x1e')]['subject']){_0x4e1058[_0xd82a('0x22')]='';_0x4e1058['subject']+=_['startsWith'](this[_0xd82a('0x1e')][_0xd82a('0x22')],_0xd82a('0x23'))?'':_0xd82a('0x24');_0x4e1058[_0xd82a('0x22')]+=this[_0xd82a('0x1e')][_0xd82a('0x22')];}}if(this[_0xd82a('0xc')]===_0xd82a('0x25')){_0x4e1058['ChatWebsiteId']=this[_0xd82a('0x26')]['id'];}else{_0x4e1058[_['upperFirst'](this[_0xd82a('0xc')])+_0xd82a('0x27')]=this[_0xd82a('0x26')]['id'];}_0x4e1058[_[_0xd82a('0x28')](this[_0xd82a('0xc')])+_0xd82a('0x29')]=this['interaction']['id'];var _0xb23f54=this[_0xd82a('0x13')];if(rpc[this[_0xd82a('0xc')]+_0xd82a('0x2a')]){if(this[_0xd82a('0xc')]===_0xd82a('0xd')){_0x4e1058['inReplyTo']=this[_0xd82a('0x1e')][_0xd82a('0x2b')];_0x4e1058[_0xd82a('0x2c')]=_0xd82a('0x2d')+_[_0xd82a('0x2e')](_0x4e1058['body'],_0xd82a('0x2f'),'','replace','';_0x37c160['headers']={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x7a65('0x33'),'Precedence':_0x7a65('0x34')};return mailRpc[_0x7a65('0x35')](this['account'][_0x7a65('0x36')],_0x37c160)[_0x7a65('0x37')](function(_0x33fc2e){logger[_0x7a65('0x15')](_0x7a65('0x38'),_0x282a45);_0x37c160[_0x7a65('0x2e')]=_0x33fc2e[_0x7a65('0x22')][_0x7a65('0x2e')];return rpc[_0x4d1adb+_0x7a65('0x2c')]['create'](_0x37c160);})['then'](function(_0x24aca5){logger[_0x7a65('0x15')](_0x7a65('0x16'),_0x282a45,JSON[_0x7a65('0x39')](_0x24aca5));})[_0x7a65('0x3a')](function(_0x28ffcc){logger['error'](_0x7a65('0x3b'),_0x282a45,JSON['stringify'](_0x28ffcc));})['finally'](function(){Promise[_0x7a65('0x3c')]()[_0x7a65('0x37')](function(){if(_0x1622dd[0x0]!=='2'||_0x3d965a[_0x7a65('0x3d')])return;return rpc[_0x4d1adb+'Interaction'][_0x7a65('0x3e')](_0x3d965a['id'],{'autoreplyExecuted':!![]})[_0x7a65('0x37')](function(_0x4350cf){logger['info'](_0x7a65('0x3f'),_0x282a45,JSON[_0x7a65('0x39')](_0x4350cf));})[_0x7a65('0x3a')](function(_0x2b35e4){logger[_0x7a65('0x40')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x282a45,JSON[_0x7a65('0x39')](_0x2b35e4));});})[_0x7a65('0x37')](function(){_0x5dfeb2['next']();});});}else{return rpc[this[_0x7a65('0x11')]+_0x7a65('0x2c')][_0x7a65('0x41')](_0x37c160)[_0x7a65('0x37')](function(){logger[_0x7a65('0x15')](_0x7a65('0x16'),_0x282a45,_0x37c160[_0x7a65('0x13')]);})['catch'](function(_0x5625a5){logger[_0x7a65('0x40')](_0x7a65('0x16'),_0x282a45,JSON[_0x7a65('0x39')](_0x5625a5));})[_0x7a65('0x42')](function(){Promise[_0x7a65('0x3c')]()[_0x7a65('0x37')](function(){if(_0x1622dd[0x0]!=='2'||_0x3d965a[_0x7a65('0x3d')])return;return rpc[_0x4d1adb+_0x7a65('0x43')][_0x7a65('0x3e')](_0x3d965a['id'],{'autoreplyExecuted':!![]})[_0x7a65('0x37')](function(_0x548108){logger[_0x7a65('0x15')](_0x7a65('0x3f'),_0x282a45,JSON['stringify'](_0x548108));})[_0x7a65('0x3a')](function(_0x304668){logger[_0x7a65('0x40')](_0x7a65('0x44'),_0x282a45,JSON[_0x7a65('0x39')](_0x304668));});})[_0x7a65('0x37')](function(){_0x5dfeb2[_0x7a65('0x18')]();});});}}}catch(_0x349572){logger[_0x7a65('0x40')](_0x7a65('0x16'),_0x282a45,JSON[_0x7a65('0x39')](_0x349572));_0x5dfeb2['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index b69651e..e97c143 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b77=['channel','Interaction','update','then','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','../../../../config/logger','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system'];(function(_0x50fafa,_0x50e6cc){var _0x563c1f=function(_0x260f22){while(--_0x260f22){_0x50fafa['push'](_0x50fafa['shift']());}};_0x563c1f(++_0x50e6cc);}(_0x3b77,0x192));var _0x73b7=function(_0x198f32,_0x4877d4){_0x198f32=_0x198f32-0x0;var _0x22ec57=_0x3b77[_0x198f32];return _0x22ec57;};'use strict';var moment=require('moment');var logger=require(_0x73b7('0x0'))('routing');var rpc={'chatInteraction':require(_0x73b7('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x73b7('0x2')),'mailInteraction':require(_0x73b7('0x3')),'faxInteraction':require(_0x73b7('0x4')),'whatsappInteraction':require(_0x73b7('0x5'))};exports[_0x73b7('0x6')]=function(_0x45ada8,_0x4bfaf3,_0x1ca6b0,_0x1c19cb){return function(_0x49b59b){try{logger[_0x73b7('0x7')](_0x73b7('0x8'),_0x45ada8,_0x4bfaf3[0x0]);var _0x467997={'closed':0x1,'closedAt':moment()[_0x73b7('0x9')](_0x73b7('0xa')),'closeReason':_0x73b7('0xb'),'disposition':_0x4bfaf3[0x0]};if(rpc[_0x1c19cb[_0x73b7('0xc')]+_0x73b7('0xd')]){rpc[_0x1c19cb[_0x73b7('0xc')]+_0x73b7('0xd')][_0x73b7('0xe')](_0x1c19cb['interaction']['id'],_0x467997)[_0x73b7('0xf')](function(_0x28d460){logger[_0x73b7('0x7')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x45ada8,_0x1c19cb[_0x73b7('0x10')]['id']);})[_0x73b7('0x11')](function(_0x1fa64c){logger[_0x73b7('0x12')](_0x73b7('0x13'),_0x45ada8,JSON[_0x73b7('0x14')](_0x1fa64c));})[_0x73b7('0x15')](function(){_0x49b59b[_0x73b7('0x16')]();});}}catch(_0x731dcd){logger['error'](_0x73b7('0x13'),_0x45ada8,JSON['stringify'](_0x731dcd));_0x49b59b[_0x73b7('0x16')]();}};}; \ No newline at end of file +var _0x13e2=['channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','stringify','finally','stop','error','[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system'];(function(_0x17e417,_0x365167){var _0x15ec52=function(_0x4b3566){while(--_0x4b3566){_0x17e417['push'](_0x17e417['shift']());}};_0x15ec52(++_0x365167);}(_0x13e2,0x83));var _0x213e=function(_0x249184,_0x1f1575){_0x249184=_0x249184-0x0;var _0x3624a0=_0x13e2[_0x249184];return _0x3624a0;};'use strict';var moment=require(_0x213e('0x0'));var logger=require(_0x213e('0x1'))(_0x213e('0x2'));var rpc={'chatInteraction':require(_0x213e('0x3')),'openchannelInteraction':require(_0x213e('0x4')),'smsInteraction':require(_0x213e('0x5')),'mailInteraction':require(_0x213e('0x6')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x213e('0x7'))};exports['consequence']=function(_0x436068,_0xda1b7b,_0x112c90,_0x35b533){return function(_0x644d6a){try{logger[_0x213e('0x8')](_0x213e('0x9'),_0x436068,_0xda1b7b[0x0]);var _0x2f6992={'closed':0x1,'closedAt':moment()[_0x213e('0xa')](_0x213e('0xb')),'closeReason':_0x213e('0xc'),'disposition':_0xda1b7b[0x0]};if(rpc[_0x35b533['channel']+'Interaction']){rpc[_0x35b533[_0x213e('0xd')]+_0x213e('0xe')][_0x213e('0xf')](_0x35b533[_0x213e('0x10')]['id'],_0x2f6992)['then'](function(_0x8169b5){logger['info'](_0x213e('0x11'),_0x436068,_0x35b533[_0x213e('0x10')]['id']);})[_0x213e('0x12')](function(_0x5b3b35){logger['error']('[%s][CLOSE]\x20%s',_0x436068,JSON[_0x213e('0x13')](_0x5b3b35));})[_0x213e('0x14')](function(){_0x644d6a[_0x213e('0x15')]();});}}catch(_0x22484d){logger[_0x213e('0x16')](_0x213e('0x17'),_0x436068,JSON[_0x213e('0x13')](_0x22484d));_0x644d6a[_0x213e('0x15')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index e7fb1a1..553f783 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d87=['moment','apiai-promise','md5','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','body','Message','create','then','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','fulfillment','speech','providerName','providerResponse','result','endConversation','catch'];(function(_0x16f584,_0x59daab){var _0x2a4101=function(_0x839fb5){while(--_0x839fb5){_0x16f584['push'](_0x16f584['shift']());}};_0x2a4101(++_0x59daab);}(_0x4d87,0xf0));var _0x74d8=function(_0x5aa266,_0x1bb584){_0x5aa266=_0x5aa266-0x0;var _0x21f1a8=_0x4d87[_0x5aa266];return _0x21f1a8;};'use strict';var _=require('lodash');var moment=require(_0x74d8('0x0'));var apiai=require(_0x74d8('0x1'));var md5=require(_0x74d8('0x2'));var utils=require('./utils');var logger=require(_0x74d8('0x3'))(_0x74d8('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x74d8('0x5')),'smsMessage':require(_0x74d8('0x6')),'faxMessage':require(_0x74d8('0x7')),'whatsappMessage':require(_0x74d8('0x8'))};exports['consequence']=function(_0x50965b,_0x54c5f6){return function(_0x4149ee){try{if(!_[_0x74d8('0x9')](this[_0x74d8('0xa')][_0x74d8('0xb')])){logger[_0x74d8('0xc')](_0x74d8('0xd'),_0x50965b,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4149ee[_0x74d8('0xe')]();}var _0xbf5ea1={'ContactId':this[_0x74d8('0xf')]['id'],'sentAt':moment()[_0x74d8('0x10')](_0x74d8('0x11')),'direction':_0x74d8('0x12')};if(this[_0x74d8('0x13')]===_0x74d8('0x14')||this[_0x74d8('0x13')]==='whatsapp'){_0xbf5ea1[_0x74d8('0x15')]=this[_0x74d8('0xa')]['phone'];}var _0x373fff=this[_0x74d8('0x13')];if(_0x373fff===_0x74d8('0x16')){_0xbf5ea1[_0x74d8('0x17')]=this[_0x74d8('0x18')]['id'];}else{_0xbf5ea1[_['upperFirst'](_0x373fff)+'AccountId']=this['account']['id'];}_0xbf5ea1[_[_0x74d8('0x19')](_0x373fff)+_0x74d8('0x1a')]=this[_0x74d8('0xa')]['id'];if(this[_0x74d8('0xa')][_0x74d8('0x1b')]){var _0x469148=_0x54c5f6[0x2];if(!_['isEmpty'](_0x469148)){_0xbf5ea1[_0x74d8('0x1c')]=utils['getMustacheRender'](_0x469148,this);return rpc[_0x373fff+_0x74d8('0x1d')][_0x74d8('0x1e')](_0xbf5ea1)[_0x74d8('0x1f')](function(_0x3f6a7b){logger[_0x74d8('0xc')](_0x74d8('0xd'),_0x50965b,_0xbf5ea1[_0x74d8('0x1c')]);})['catch'](function(_0x2146f5){logger[_0x74d8('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x50965b,JSON[_0x74d8('0x21')](_0x2146f5));})[_0x74d8('0x22')](function(){logger[_0x74d8('0xc')](_0x74d8('0x23'),_0x50965b);_0x4149ee[_0x74d8('0x24')]();});}else{logger[_0x74d8('0xc')](_0x74d8('0x25'),_0x50965b);_0x4149ee[_0x74d8('0x24')]();}}else{var _0x39626b=this;var _0x423a6a=apiai(_0x54c5f6[0x0],{'language':_0x54c5f6[0x1]||'en'});return _0x423a6a[_0x74d8('0x26')](this[_0x74d8('0x27')][_0x74d8('0x1c')],{'sessionId':md5(this[_0x74d8('0xa')]['id'])})[_0x74d8('0x1f')](function(_0x5dbf6a){_0x39626b[_0x74d8('0x1c')][_0x74d8('0x28')]=_0x5dbf6a;_0xbf5ea1[_0x74d8('0x1c')]=_0x5dbf6a['result'][_0x74d8('0x29')][_0x74d8('0x2a')];_0xbf5ea1[_0x74d8('0x2b')]=_0x74d8('0x28');_0xbf5ea1[_0x74d8('0x2c')]=JSON[_0x74d8('0x21')](_0x5dbf6a);return rpc[_0x373fff+_0x74d8('0x1d')][_0x74d8('0x1e')](_0xbf5ea1)[_0x74d8('0x1f')](function(_0x2e8e5a){logger[_0x74d8('0xc')]('[%s][DIALOGFLOW]\x20%s',_0x50965b,_0xbf5ea1[_0x74d8('0x1c')]);if(_0x5dbf6a[_0x74d8('0x2d')]['metadata'][_0x74d8('0x2e')]){_0x4149ee[_0x74d8('0xe')]();}else{_0x4149ee[_0x74d8('0x24')]();}})[_0x74d8('0x2f')](function(_0x5dc370){logger[_0x74d8('0x20')](_0x74d8('0xd'),_0x50965b,JSON[_0x74d8('0x21')](_0x5dc370));_0x4149ee[_0x74d8('0xe')]();});})['catch'](function(_0x2b6f84){logger[_0x74d8('0x20')](_0x74d8('0xd'),_0x50965b,_0x2b6f84[_0x74d8('0x27')]);_0x4149ee['next']();});}}catch(_0x18c6a2){logger[_0x74d8('0x20')](_0x74d8('0xd'),_0x50965b,JSON['stringify'](_0x18c6a2));_0x4149ee[_0x74d8('0x24')]();}};}; \ No newline at end of file +var _0x5bc1=['upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','providerName','providerResponse','metadata','endConversation','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account'];(function(_0x405a20,_0x5f2f77){var _0x45265a=function(_0x58b030){while(--_0x58b030){_0x405a20['push'](_0x405a20['shift']());}};_0x45265a(++_0x5f2f77);}(_0x5bc1,0xb5));var _0x15bc=function(_0x1c445a,_0xea7543){_0x1c445a=_0x1c445a-0x0;var _0x33e4ad=_0x5bc1[_0x1c445a];return _0x33e4ad;};'use strict';var _=require('lodash');var moment=require(_0x15bc('0x0'));var apiai=require(_0x15bc('0x1'));var md5=require(_0x15bc('0x2'));var utils=require(_0x15bc('0x3'));var logger=require(_0x15bc('0x4'))(_0x15bc('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x15bc('0x6')),'smsMessage':require(_0x15bc('0x7')),'faxMessage':require(_0x15bc('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x15bc('0x9')]=function(_0x483c6d,_0x344121){return function(_0x3eff99){try{if(!_[_0x15bc('0xa')](this[_0x15bc('0xb')][_0x15bc('0xc')])){logger[_0x15bc('0xd')](_0x15bc('0xe'),_0x483c6d,_0x15bc('0xf'));return _0x3eff99[_0x15bc('0x10')]();}var _0x37302c={'ContactId':this['contact']['id'],'sentAt':moment()[_0x15bc('0x11')](_0x15bc('0x12')),'direction':_0x15bc('0x13')};if(this['channel']===_0x15bc('0x14')||this[_0x15bc('0x15')]===_0x15bc('0x16')){_0x37302c[_0x15bc('0x17')]=this['interaction'][_0x15bc('0x17')];}var _0x19b43b=this[_0x15bc('0x15')];if(_0x19b43b===_0x15bc('0x18')){_0x37302c[_0x15bc('0x19')]=this[_0x15bc('0x1a')]['id'];}else{_0x37302c[_[_0x15bc('0x1b')](_0x19b43b)+_0x15bc('0x1c')]=this[_0x15bc('0x1a')]['id'];}_0x37302c[_[_0x15bc('0x1b')](_0x19b43b)+_0x15bc('0x1d')]=this[_0x15bc('0xb')]['id'];if(this[_0x15bc('0xb')][_0x15bc('0x1e')]){var _0x5599a2=_0x344121[0x2];if(!_[_0x15bc('0x1f')](_0x5599a2)){_0x37302c[_0x15bc('0x20')]=utils[_0x15bc('0x21')](_0x5599a2,this);return rpc[_0x19b43b+_0x15bc('0x22')][_0x15bc('0x23')](_0x37302c)[_0x15bc('0x24')](function(_0x395438){logger[_0x15bc('0xd')](_0x15bc('0xe'),_0x483c6d,_0x37302c[_0x15bc('0x20')]);})[_0x15bc('0x25')](function(_0x4c132c){logger[_0x15bc('0x26')]('[%s][DIALOGFLOW]\x20%s',_0x483c6d,JSON[_0x15bc('0x27')](_0x4c132c));})['finally'](function(){logger[_0x15bc('0xd')](_0x15bc('0x28'),_0x483c6d);_0x3eff99[_0x15bc('0x29')]();});}else{logger['info'](_0x15bc('0x2a'),_0x483c6d);_0x3eff99['stop']();}}else{var _0x31ed06=this;var _0x2bebcc=apiai(_0x344121[0x0],{'language':_0x344121[0x1]||'en'});return _0x2bebcc[_0x15bc('0x2b')](this[_0x15bc('0x2c')][_0x15bc('0x20')],{'sessionId':md5(this[_0x15bc('0xb')]['id'])})[_0x15bc('0x24')](function(_0x424020){_0x31ed06['body'][_0x15bc('0x2d')]=_0x424020;_0x37302c[_0x15bc('0x20')]=_0x424020[_0x15bc('0x2e')][_0x15bc('0x2f')]['speech'];_0x37302c[_0x15bc('0x30')]=_0x15bc('0x2d');_0x37302c[_0x15bc('0x31')]=JSON[_0x15bc('0x27')](_0x424020);return rpc[_0x19b43b+_0x15bc('0x22')]['create'](_0x37302c)[_0x15bc('0x24')](function(_0x5f3985){logger[_0x15bc('0xd')](_0x15bc('0xe'),_0x483c6d,_0x37302c[_0x15bc('0x20')]);if(_0x424020[_0x15bc('0x2e')][_0x15bc('0x32')][_0x15bc('0x33')]){_0x3eff99[_0x15bc('0x10')]();}else{_0x3eff99[_0x15bc('0x29')]();}})['catch'](function(_0x4146ab){logger[_0x15bc('0x26')](_0x15bc('0xe'),_0x483c6d,JSON[_0x15bc('0x27')](_0x4146ab));_0x3eff99[_0x15bc('0x10')]();});})[_0x15bc('0x25')](function(_0x181e37){logger[_0x15bc('0x26')](_0x15bc('0xe'),_0x483c6d,_0x181e37[_0x15bc('0x2c')]);_0x3eff99['next']();});}}catch(_0x48c5e5){logger['error'](_0x15bc('0xe'),_0x483c6d,JSON[_0x15bc('0x27')](_0x48c5e5));_0x3eff99['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 80d7808..0b8a1b9 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15e1=['[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','fulfillmentText','push','stack','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','body','Message','then','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','interaction','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','finally','info','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x15e1,0xae));var _0x115e=function(_0x43e713,_0x4d7958){_0x43e713=_0x43e713-0x0;var _0xb19e79=_0x15e1[_0x43e713];return _0xb19e79;};'use strict';var _=require('lodash');var dialogflow=require(_0x115e('0x0'));var md5=require(_0x115e('0x1'));var moment=require(_0x115e('0x2'));var Promise=require(_0x115e('0x3'));var logger=require(_0x115e('0x4'))(_0x115e('0x5'));var utils=require(_0x115e('0x6'));var rpc={'chatMessage':require(_0x115e('0x7')),'openchannelMessage':require(_0x115e('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x115e('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x115e('0xa'))};function createMessage(_0x36417d,_0x486265,_0x42fc7c,_0x2fe4b3){return new Promise(function(_0x514062,_0x14a71f){var _0x5af33d=_['clone'](_0x42fc7c);_0x5af33d[_0x115e('0xb')]=_0x2fe4b3;return rpc[_0x486265+_0x115e('0xc')]['create'](_0x5af33d)[_0x115e('0xd')](function(){logger['info'](_0x115e('0xe'),_0x36417d,_0x5af33d[_0x115e('0xb')]);_0x514062();})[_0x115e('0xf')](function(_0x982d6d){logger[_0x115e('0x10')](_0x115e('0xe'),_0x36417d,JSON[_0x115e('0x11')](_0x982d6d));_0x14a71f(_0x982d6d);});});}exports[_0x115e('0x12')]=function(_0x90d5f3,_0x522ac9){return function(_0x521495){try{if(!_[_0x115e('0x13')](this['interaction']['UserId'])){logger['info'](_0x115e('0xe'),_0x90d5f3,_0x115e('0x14'));return _0x521495[_0x115e('0x15')]();}var _0x22bc4f={'ContactId':this[_0x115e('0x16')]['id'],'sentAt':moment()['format'](_0x115e('0x17')),'direction':_0x115e('0x18')};if(this['channel']===_0x115e('0x19')||this[_0x115e('0x1a')]===_0x115e('0x1b')){_0x22bc4f[_0x115e('0x1c')]=this[_0x115e('0x1d')]['phone'];}var _0x45da19=this['channel'];if(_0x45da19==='chat'){_0x22bc4f[_0x115e('0x1e')]=this[_0x115e('0x1f')]['id'];}else{_0x22bc4f[_[_0x115e('0x20')](_0x45da19)+_0x115e('0x21')]=this[_0x115e('0x1f')]['id'];}_0x22bc4f[_['upperFirst'](_0x45da19)+_0x115e('0x22')]=this['interaction']['id'];if(this[_0x115e('0x1d')][_0x115e('0x23')]){var _0x4e2c7c=_0x522ac9[0x4];if(!_[_0x115e('0x24')](_0x4e2c7c)){_0x22bc4f['body']=utils[_0x115e('0x25')](_0x4e2c7c,this);return rpc[_0x45da19+_0x115e('0xc')]['create'](_0x22bc4f)[_0x115e('0xd')](function(_0x362b1a){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x90d5f3,_0x22bc4f['body']);})['catch'](function(_0x108389){logger[_0x115e('0x10')](_0x115e('0xe'),_0x90d5f3,JSON[_0x115e('0x11')](_0x108389));})[_0x115e('0x26')](function(){logger[_0x115e('0x27')](_0x115e('0x28'),_0x90d5f3);_0x521495[_0x115e('0x29')]();});}else{logger['info'](_0x115e('0x2a'),_0x90d5f3);_0x521495[_0x115e('0x29')]();}}else{var _0x1ee0f9=this;var _0x28763d=_0x522ac9[0x2][_0x115e('0x2b')](/\\n/g,'\x0a');var _0x3143e5={'credentials':{'private_key':_0x28763d,'client_email':_0x522ac9[0x1]}};var _0x514f79=new dialogflow[(_0x115e('0x2c'))](_0x3143e5);var _0x544c49=_0x514f79[_0x115e('0x2d')](_0x522ac9[0x0],md5(_0x1ee0f9[_0x115e('0x1d')]['id']));var _0x503188={'session':_0x544c49,'queryInput':{'text':{'text':_0x1ee0f9[_0x115e('0x2e')][_0x115e('0xb')],'languageCode':_0x522ac9[0x3]||'en'}}};return _0x514f79[_0x115e('0x2f')](_0x503188)[_0x115e('0xd')](function(_0x57d8d6){if(_0x57d8d6&&_0x57d8d6[_0x115e('0x30')]){_0x1ee0f9[_0x115e('0xb')][_0x115e('0x31')]=_0x57d8d6;var _0x84ec30=_0x57d8d6[0x0];var _0x530d16=_0x84ec30[_0x115e('0x32')][_0x115e('0x33')]&&_0x84ec30[_0x115e('0x32')][_0x115e('0x33')][_0x115e('0x34')]?_0x84ec30[_0x115e('0x32')][_0x115e('0x33')]['fields'][_0x115e('0x35')]['boolValue']:![];_0x1ee0f9[_0x115e('0xb')][_0x115e('0x36')]=_0x84ec30[_0x115e('0x32')]['action'];_0x1ee0f9[_0x115e('0xb')][_0x115e('0x37')]=_0x84ec30[_0x115e('0x32')][_0x115e('0x38')];_0x1ee0f9['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x84ec30['queryResult'][_0x115e('0x33')]&&_0x84ec30[_0x115e('0x32')][_0x115e('0x33')][_0x115e('0x34')]?_0x84ec30[_0x115e('0x32')]['diagnosticInfo'][_0x115e('0x34')]['end_conversation']['boolValue']:![];_0x1ee0f9[_0x115e('0xb')][_0x115e('0x39')]=_0x84ec30['queryResult'][_0x115e('0x3a')]['name'];_0x1ee0f9[_0x115e('0xb')][_0x115e('0x3b')]=_0x84ec30[_0x115e('0x32')][_0x115e('0x3a')][_0x115e('0x3c')];_0x1ee0f9[_0x115e('0xb')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x84ec30[_0x115e('0x32')]['intent'][_0x115e('0x3d')];_0x1ee0f9[_0x115e('0xb')][_0x115e('0x3e')]=_0x84ec30['queryResult'][_0x115e('0x3f')];_0x1ee0f9[_0x115e('0xb')][_0x115e('0x40')]=_0x84ec30[_0x115e('0x32')][_0x115e('0x41')];_0x1ee0f9[_0x115e('0xb')][_0x115e('0x42')]=_0x84ec30[_0x115e('0x32')][_0x115e('0x43')];_0x22bc4f['providerName']=_0x115e('0x31');_0x22bc4f[_0x115e('0x44')]=JSON[_0x115e('0x11')](_0x57d8d6);var _0x3c0333=[];for(var _0x2f8be1=0x0;_0x2f8be1<_0x57d8d6['length'];_0x2f8be1++){var _0x21a5b3=_0x57d8d6[_0x2f8be1];if(_0x21a5b3&&_0x21a5b3[_0x115e('0x32')]&&_0x21a5b3[_0x115e('0x32')][_0x115e('0x45')]){_0x3c0333[_0x115e('0x46')](createMessage(_0x90d5f3,_0x45da19,_0x22bc4f,_0x21a5b3[_0x115e('0x32')][_0x115e('0x45')]));}}return Promise['all'](_0x3c0333)['then'](function(){if(_0x530d16){_0x521495['next']();}else{_0x521495[_0x115e('0x29')]();}})[_0x115e('0xf')](function(_0x93aa7c){logger[_0x115e('0x10')](_0x115e('0xe'),_0x90d5f3,JSON[_0x115e('0x11')](_0x93aa7c));_0x521495[_0x115e('0x15')]();});}})['catch'](function(_0x1e3f14){logger[_0x115e('0x10')](_0x115e('0xe'),_0x90d5f3,_0x1e3f14[_0x115e('0x2e')],_0x1e3f14[_0x115e('0x47')]);_0x521495[_0x115e('0x15')]();});}}catch(_0x1f07d8){logger[_0x115e('0x10')](_0x115e('0xe'),_0x90d5f3,JSON[_0x115e('0x11')](_0x1f07d8));_0x521495[_0x115e('0x29')]();}};}; \ No newline at end of file +var _0x8d6f=['out','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','getMustacheRender','Message','create','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','detectIntent','length','queryResult','fields','diagnosticInfo','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','fulfillmentText','push','all','message','stack','lodash','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2eb09e,_0x2834be){var _0x50a51b=function(_0x2dbd57){while(--_0x2dbd57){_0x2eb09e['push'](_0x2eb09e['shift']());}};_0x50a51b(++_0x2834be);}(_0x8d6f,0x1a2));var _0xf8d6=function(_0x4e5930,_0x3d9b63){_0x4e5930=_0x4e5930-0x0;var _0x498d5b=_0x8d6f[_0x4e5930];return _0x498d5b;};'use strict';var _=require(_0xf8d6('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require(_0xf8d6('0x1'));var Promise=require(_0xf8d6('0x2'));var logger=require(_0xf8d6('0x3'))(_0xf8d6('0x4'));var utils=require(_0xf8d6('0x5'));var rpc={'chatMessage':require(_0xf8d6('0x6')),'openchannelMessage':require(_0xf8d6('0x7')),'mailMessage':require(_0xf8d6('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf8d6('0x9')),'whatsappMessage':require(_0xf8d6('0xa'))};function createMessage(_0xe9e320,_0x29cb72,_0x4ba0ca,_0x39e610){return new Promise(function(_0x3d3626,_0x37fb70){var _0x44eafb=_['clone'](_0x4ba0ca);_0x44eafb[_0xf8d6('0xb')]=_0x39e610;return rpc[_0x29cb72+'Message']['create'](_0x44eafb)[_0xf8d6('0xc')](function(){logger[_0xf8d6('0xd')](_0xf8d6('0xe'),_0xe9e320,_0x44eafb[_0xf8d6('0xb')]);_0x3d3626();})[_0xf8d6('0xf')](function(_0x534574){logger[_0xf8d6('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0xe9e320,JSON[_0xf8d6('0x11')](_0x534574));_0x37fb70(_0x534574);});});}exports[_0xf8d6('0x12')]=function(_0x1473bf,_0x31855e){return function(_0x38256a){try{if(!_[_0xf8d6('0x13')](this['interaction'][_0xf8d6('0x14')])){logger['info'](_0xf8d6('0xe'),_0x1473bf,_0xf8d6('0x15'));return _0x38256a[_0xf8d6('0x16')]();}var _0x5edf27={'ContactId':this[_0xf8d6('0x17')]['id'],'sentAt':moment()[_0xf8d6('0x18')](_0xf8d6('0x19')),'direction':_0xf8d6('0x1a')};if(this[_0xf8d6('0x1b')]==='sms'||this['channel']===_0xf8d6('0x1c')){_0x5edf27[_0xf8d6('0x1d')]=this[_0xf8d6('0x1e')][_0xf8d6('0x1d')];}var _0x16253c=this['channel'];if(_0x16253c===_0xf8d6('0x1f')){_0x5edf27[_0xf8d6('0x20')]=this[_0xf8d6('0x21')]['id'];}else{_0x5edf27[_['upperFirst'](_0x16253c)+_0xf8d6('0x22')]=this['account']['id'];}_0x5edf27[_[_0xf8d6('0x23')](_0x16253c)+_0xf8d6('0x24')]=this[_0xf8d6('0x1e')]['id'];if(this[_0xf8d6('0x1e')]['created']){var _0x5bd03a=_0x31855e[0x4];if(!_['isEmpty'](_0x5bd03a)){_0x5edf27[_0xf8d6('0xb')]=utils[_0xf8d6('0x25')](_0x5bd03a,this);return rpc[_0x16253c+_0xf8d6('0x26')][_0xf8d6('0x27')](_0x5edf27)[_0xf8d6('0xc')](function(_0x1dd4b2){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x1473bf,_0x5edf27[_0xf8d6('0xb')]);})[_0xf8d6('0xf')](function(_0x1890f1){logger['error'](_0xf8d6('0xe'),_0x1473bf,JSON[_0xf8d6('0x11')](_0x1890f1));})[_0xf8d6('0x28')](function(){logger['info'](_0xf8d6('0x29'),_0x1473bf);_0x38256a[_0xf8d6('0x2a')]();});}else{logger[_0xf8d6('0xd')](_0xf8d6('0x2b'),_0x1473bf);_0x38256a[_0xf8d6('0x2a')]();}}else{var _0x4e7856=this;var _0x46a6e8=_0x31855e[0x2][_0xf8d6('0x2c')](/\\n/g,'\x0a');var _0x2cb4f4={'credentials':{'private_key':_0x46a6e8,'client_email':_0x31855e[0x1]}};var _0x3a2efa=new dialogflow[(_0xf8d6('0x2d'))](_0x2cb4f4);var _0x2334d3=_0x3a2efa['sessionPath'](_0x31855e[0x0],md5(_0x4e7856[_0xf8d6('0x1e')]['id']));var _0x4a4f94={'session':_0x2334d3,'queryInput':{'text':{'text':_0x4e7856['message']['body'],'languageCode':_0x31855e[0x3]||'en'}}};return _0x3a2efa[_0xf8d6('0x2e')](_0x4a4f94)[_0xf8d6('0xc')](function(_0x6612a8){if(_0x6612a8&&_0x6612a8[_0xf8d6('0x2f')]){_0x4e7856[_0xf8d6('0xb')]['dialogflowV2']=_0x6612a8;var _0x148f0b=_0x6612a8[0x0];var _0x2f8669=_0x148f0b['queryResult']['diagnosticInfo']&&_0x148f0b[_0xf8d6('0x30')]['diagnosticInfo'][_0xf8d6('0x31')]?_0x148f0b[_0xf8d6('0x30')][_0xf8d6('0x32')][_0xf8d6('0x31')][_0xf8d6('0x33')][_0xf8d6('0x34')]:![];_0x4e7856[_0xf8d6('0xb')][_0xf8d6('0x35')]=_0x148f0b[_0xf8d6('0x30')][_0xf8d6('0x36')];_0x4e7856['body'][_0xf8d6('0x37')]=_0x148f0b['queryResult']['allRequiredParamsPresent'];_0x4e7856[_0xf8d6('0xb')][_0xf8d6('0x38')]=_0x148f0b['queryResult'][_0xf8d6('0x32')]&&_0x148f0b['queryResult'][_0xf8d6('0x32')][_0xf8d6('0x31')]?_0x148f0b[_0xf8d6('0x30')][_0xf8d6('0x32')][_0xf8d6('0x31')][_0xf8d6('0x33')][_0xf8d6('0x34')]:![];_0x4e7856['body'][_0xf8d6('0x39')]=_0x148f0b['queryResult']['intent'][_0xf8d6('0x3a')];_0x4e7856[_0xf8d6('0xb')][_0xf8d6('0x3b')]=_0x148f0b[_0xf8d6('0x30')][_0xf8d6('0x3c')][_0xf8d6('0x3d')];_0x4e7856[_0xf8d6('0xb')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x148f0b['queryResult'][_0xf8d6('0x3c')]['isFallback'];_0x4e7856[_0xf8d6('0xb')][_0xf8d6('0x3e')]=_0x148f0b[_0xf8d6('0x30')]['languageCode'];_0x4e7856['body'][_0xf8d6('0x3f')]=_0x148f0b[_0xf8d6('0x30')]['queryText'];_0x4e7856['body'][_0xf8d6('0x40')]=_0x148f0b[_0xf8d6('0x30')][_0xf8d6('0x41')];_0x5edf27[_0xf8d6('0x42')]=_0xf8d6('0x43');_0x5edf27[_0xf8d6('0x44')]=JSON['stringify'](_0x6612a8);var _0x5d6481=[];for(var _0x4efeab=0x0;_0x4efeab<_0x6612a8['length'];_0x4efeab++){var _0x30741d=_0x6612a8[_0x4efeab];if(_0x30741d&&_0x30741d['queryResult']&&_0x30741d[_0xf8d6('0x30')][_0xf8d6('0x45')]){_0x5d6481[_0xf8d6('0x46')](createMessage(_0x1473bf,_0x16253c,_0x5edf27,_0x30741d[_0xf8d6('0x30')][_0xf8d6('0x45')]));}}return Promise[_0xf8d6('0x47')](_0x5d6481)[_0xf8d6('0xc')](function(){if(_0x2f8669){_0x38256a[_0xf8d6('0x16')]();}else{_0x38256a[_0xf8d6('0x2a')]();}})[_0xf8d6('0xf')](function(_0x1f8cf6){logger[_0xf8d6('0x10')](_0xf8d6('0xe'),_0x1473bf,JSON['stringify'](_0x1f8cf6));_0x38256a[_0xf8d6('0x16')]();});}})[_0xf8d6('0xf')](function(_0x1eee3d){logger[_0xf8d6('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x1473bf,_0x1eee3d[_0xf8d6('0x48')],_0x1eee3d[_0xf8d6('0x49')]);_0x38256a[_0xf8d6('0x16')]();});}}catch(_0x4ff6a1){logger[_0xf8d6('0x10')](_0xf8d6('0xe'),_0x1473bf,JSON['stringify'](_0x4ff6a1));_0x38256a[_0xf8d6('0x2a')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 2b23485..0b8260c 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e83=['error','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length'];(function(_0x23d823,_0x352c47){var _0x12745c=function(_0x3124a1){while(--_0x3124a1){_0x23d823['push'](_0x23d823['shift']());}};_0x12745c(++_0x352c47);}(_0x2e83,0xd3));var _0x32e8=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x2e83[_0x18ab2a];return _0x16dcee;};'use strict';var schema=require(_0x32e8('0x0'));var _=require(_0x32e8('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x32e8('0x2'));var logger=require('../../../../config/logger')(_0x32e8('0x3'));var gotoif=schema({'condition':{'type':_0x32e8('0x4'),'required':!![],'message':_0x32e8('0x5')},'priorityTrue':{'type':_0x32e8('0x6'),'message':_0x32e8('0x7')},'priorityFalse':{'type':_0x32e8('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x32e8('0x8')]=function(_0x1c8381,_0x404c29){return function(_0x114741){try{var _0x141fb6={'condition':htmlToText[_0x32e8('0x9')](utils[_0x32e8('0xa')](_0x404c29[0x0],this),{'wordwrap':![]})[_0x32e8('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x404c29[0x1],'priorityFalse':_0x404c29[0x2]};var _0x26f5aa=gotoif[_0x32e8('0x0')](_0x141fb6,{'typecast':!![]});if(_0x26f5aa[_0x32e8('0xc')]){logger[_0x32e8('0xd')](_0x32e8('0xe'),_0x1c8381,_['map'](_0x26f5aa,_0x32e8('0xf'))[_0x32e8('0x10')](',\x20'));_0x114741[_0x32e8('0x11')]();}else{try{var _0x5b5449=eval('('+_0x141fb6[_0x32e8('0x12')]+')');var _0x4c734e=_0x5b5449?_0x141fb6[_0x32e8('0x13')]:_0x141fb6[_0x32e8('0x14')];logger[_0x32e8('0x15')](_0x32e8('0x16'),_0x1c8381,_0x141fb6[_0x32e8('0x12')],_0x5b5449,_0x4c734e||_0x32e8('0x17'));if(_0x4c734e){var _0x3537f7=_['findIndex'](_0x114741[_0x32e8('0x18')](),{'p':_0x4c734e});if(_0x3537f7>=0x0){logger[_0x32e8('0x15')](_0x32e8('0x19'),_0x1c8381,_0x4c734e||_0x32e8('0x17'),_0x3537f7);_0x114741['next'](_0x3537f7);}else{logger[_0x32e8('0x15')](_0x32e8('0x1a'),_0x1c8381,_0x4c734e||_0x32e8('0x17'));_0x114741[_0x32e8('0x11')]();}}else{_0x114741[_0x32e8('0x17')]();}}catch(_0x27a6bb){logger[_0x32e8('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x1c8381,_0x27a6bb[_0x32e8('0xf')]);_0x114741[_0x32e8('0x11')]();}}}catch(_0x21db55){logger[_0x32e8('0xd')]('[%s][GOTOIF]\x20%s',_0x1c8381,JSON[_0x32e8('0x1b')](_0x21db55));_0x114741[_0x32e8('0x11')]();}};}; \ No newline at end of file +var _0x1173=['[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','lodash','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info'];(function(_0x27d811,_0x46515d){var _0x3242fb=function(_0x59fa6e){while(--_0x59fa6e){_0x27d811['push'](_0x27d811['shift']());}};_0x3242fb(++_0x46515d);}(_0x1173,0x12b));var _0x3117=function(_0x19b6d1,_0x6abacf){_0x19b6d1=_0x19b6d1-0x0;var _0x429f71=_0x1173[_0x19b6d1];return _0x429f71;};'use strict';var schema=require('validate');var _=require(_0x3117('0x0'));var htmlToText=require('html-to-text');var utils=require(_0x3117('0x1'));var logger=require(_0x3117('0x2'))(_0x3117('0x3'));var gotoif=schema({'condition':{'type':_0x3117('0x4'),'required':!![],'message':_0x3117('0x5')},'priorityTrue':{'type':_0x3117('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':_0x3117('0x7')}});exports[_0x3117('0x8')]=function(_0x29fcc3,_0x5b7536){return function(_0x3df2c1){try{var _0xdfdeea={'condition':htmlToText['fromString'](utils[_0x3117('0x9')](_0x5b7536[0x0],this),{'wordwrap':![]})[_0x3117('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5b7536[0x1],'priorityFalse':_0x5b7536[0x2]};var _0x9bf38d=gotoif['validate'](_0xdfdeea,{'typecast':!![]});if(_0x9bf38d[_0x3117('0xb')]){logger[_0x3117('0xc')](_0x3117('0xd'),_0x29fcc3,_[_0x3117('0xe')](_0x9bf38d,'message')[_0x3117('0xf')](',\x20'));_0x3df2c1[_0x3117('0x10')]();}else{try{var _0x3a0614=eval('('+_0xdfdeea[_0x3117('0x11')]+')');var _0x5997e0=_0x3a0614?_0xdfdeea[_0x3117('0x12')]:_0xdfdeea[_0x3117('0x13')];logger['info'](_0x3117('0x14'),_0x29fcc3,_0xdfdeea['condition'],_0x3a0614,_0x5997e0||_0x3117('0x15'));if(_0x5997e0){var _0x23cf40=_[_0x3117('0x16')](_0x3df2c1[_0x3117('0x17')](),{'p':_0x5997e0});if(_0x23cf40>=0x0){logger[_0x3117('0x18')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x29fcc3,_0x5997e0||'next',_0x23cf40);_0x3df2c1['next'](_0x23cf40);}else{logger[_0x3117('0x18')](_0x3117('0x19'),_0x29fcc3,_0x5997e0||_0x3117('0x15'));_0x3df2c1[_0x3117('0x10')]();}}else{_0x3df2c1['next']();}}catch(_0x59c61d){logger[_0x3117('0xc')](_0x3117('0x1a'),_0x29fcc3,_0x59c61d['message']);_0x3df2c1[_0x3117('0x10')]();}}}catch(_0x13ad53){logger[_0x3117('0xc')]('[%s][GOTOIF]\x20%s',_0x29fcc3,JSON['stringify'](_0x13ad53));_0x3df2c1[_0x3117('0x10')]();}};}; \ 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 25dc64f..26fe8a5 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 _0x3673=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','error','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20%s','stringify','lodash','../../../../config/logger','routing','number'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x3673,0x1ea));var _0x3367=function(_0x547add,_0x387042){_0x547add=_0x547add-0x0;var _0x2ed1f3=_0x3673[_0x547add];return _0x2ed1f3;};'use strict';var schema=require('validate');var _=require(_0x3367('0x0'));var logger=require(_0x3367('0x1'))(_0x3367('0x2'));var gotop=schema({'priority':{'type':_0x3367('0x3'),'required':!![],'message':_0x3367('0x4')}});exports[_0x3367('0x5')]=function(_0x1841f0,_0x2d6f70){return function(_0x2cc139){try{var _0x421994={'priority':_0x2d6f70[0x0]};var _0x416537=gotop[_0x3367('0x6')](_0x421994,{'typecast':!![]});if(_0x416537['length']){logger[_0x3367('0x7')]('[%s][GOTOP]\x20%s',_0x1841f0,_[_0x3367('0x8')](_0x416537,_0x3367('0x9'))[_0x3367('0xa')](',\x20'));_0x2cc139[_0x3367('0xb')]();}else{logger[_0x3367('0xc')](_0x3367('0xd'),_0x1841f0,_0x421994['priority']);if(_0x421994[_0x3367('0xe')]){var _0x1a8d8a=_['findIndex'](_0x2cc139['rules'](),{'p':_0x421994[_0x3367('0xe')]});if(_0x1a8d8a>=0x0){logger[_0x3367('0xc')](_0x3367('0xf'),_0x1841f0,_0x421994[_0x3367('0xe')]||_0x3367('0x10'),_0x1a8d8a);_0x2cc139['next'](_0x1a8d8a);}else{logger[_0x3367('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x1841f0,_0x421994[_0x3367('0xe')]||_0x3367('0x10'));_0x2cc139[_0x3367('0xb')]();}}else{_0x2cc139['next']();}}}catch(_0x39b23b){logger[_0x3367('0x7')](_0x3367('0x11'),_0x1841f0,JSON[_0x3367('0x12')](_0x39b23b));_0x2cc139['stop']();}};}; \ No newline at end of file +var _0x6ec4=['priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','stringify','validate','lodash','routing','number','length','error','[%s][GOTOP]\x20%s','map','message','join','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0x30016d,_0x390bbd){var _0xafa3ad=function(_0x5ab060){while(--_0x5ab060){_0x30016d['push'](_0x30016d['shift']());}};_0xafa3ad(++_0x390bbd);}(_0x6ec4,0x1e2));var _0x46ec=function(_0x373279,_0x498af0){_0x373279=_0x373279-0x0;var _0x13e6a0=_0x6ec4[_0x373279];return _0x13e6a0;};'use strict';var schema=require(_0x46ec('0x0'));var _=require(_0x46ec('0x1'));var logger=require('../../../../config/logger')(_0x46ec('0x2'));var gotop=schema({'priority':{'type':_0x46ec('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x54f3fd,_0x15384b){return function(_0x69d783){try{var _0x529b2b={'priority':_0x15384b[0x0]};var _0x2cdb0b=gotop[_0x46ec('0x0')](_0x529b2b,{'typecast':!![]});if(_0x2cdb0b[_0x46ec('0x4')]){logger[_0x46ec('0x5')](_0x46ec('0x6'),_0x54f3fd,_[_0x46ec('0x7')](_0x2cdb0b,_0x46ec('0x8'))[_0x46ec('0x9')](',\x20'));_0x69d783['stop']();}else{logger[_0x46ec('0xa')](_0x46ec('0xb'),_0x54f3fd,_0x529b2b[_0x46ec('0xc')]);if(_0x529b2b['priority']){var _0x1aa54c=_[_0x46ec('0xd')](_0x69d783[_0x46ec('0xe')](),{'p':_0x529b2b['priority']});if(_0x1aa54c>=0x0){logger[_0x46ec('0xa')](_0x46ec('0xf'),_0x54f3fd,_0x529b2b[_0x46ec('0xc')]||'next',_0x1aa54c);_0x69d783[_0x46ec('0x10')](_0x1aa54c);}else{logger[_0x46ec('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x54f3fd,_0x529b2b[_0x46ec('0xc')]||'next');_0x69d783[_0x46ec('0x11')]();}}else{_0x69d783[_0x46ec('0x10')]();}}}catch(_0x5dfa1c){logger[_0x46ec('0x5')]('[%s][GOTOP]\x20%s',_0x54f3fd,JSON[_0x46ec('0x12')](_0x5dfa1c));_0x69d783[_0x46ec('0x11')]();}};}; \ 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 f8a3c2b..655899c 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 _0x285b=['interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','catch','error','stop','lodash','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','chat','upperFirst','AccountId','account'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x285b,0x171));var _0xb285=function(_0x34e29f,_0x48ab3b){_0x34e29f=_0x34e29f-0x0;var _0x5ed32b=_0x285b[_0x34e29f];return _0x5ed32b;};'use strict';var _=require(_0xb285('0x0'));var utils=require('./utils');var logger=require(_0xb285('0x1'))(_0xb285('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xb285('0x3')),'mailMessage':require(_0xb285('0x4')),'smsMessage':require(_0xb285('0x5')),'faxMessage':require(_0xb285('0x6')),'whatsappMessage':require(_0xb285('0x7'))};exports[_0xb285('0x8')]=function(_0x2a221d,_0xe785ea){return function(_0x333dfb){try{var _0x3fdca3={'body':utils['getMustacheRender'](_0xe785ea[0x0],this),'ContactId':this[_0xb285('0x9')]['id']};if(this[_0xb285('0xa')]===_0xb285('0xb')){_0x3fdca3['ChatWebsiteId']=this['account']['id'];}else{_0x3fdca3[_[_0xb285('0xc')](this[_0xb285('0xa')])+_0xb285('0xd')]=this[_0xb285('0xe')]['id'];}_0x3fdca3[_['upperFirst'](this[_0xb285('0xa')])+'InteractionId']=this[_0xb285('0xf')]['id'];if(rpc[this[_0xb285('0xa')]+_0xb285('0x10')]){return rpc[this[_0xb285('0xa')]+_0xb285('0x10')][_0xb285('0x11')](_0x3fdca3)[_0xb285('0x12')](function(_0x19b745){logger[_0xb285('0x13')](_0xb285('0x14'),_0x2a221d,_0x3fdca3['body']);_0x333dfb['next']();})[_0xb285('0x15')](function(_0x21b84e){logger[_0xb285('0x16')](_0xb285('0x14'),_0x2a221d,JSON['stringify'](_0x21b84e));_0x333dfb[_0xb285('0x17')]();});}}catch(_0x3f104a){logger[_0xb285('0x16')](_0xb285('0x14'),_0x2a221d,JSON['stringify'](_0x3f104a));_0x333dfb[_0xb285('0x17')]();}};}; \ No newline at end of file +var _0x8e6d=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','contact','channel','ChatWebsiteId','AccountId','account','upperFirst','interaction','Message','info','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger','routing'];(function(_0x280ebb,_0x28fa28){var _0x3a0652=function(_0x54e99c){while(--_0x54e99c){_0x280ebb['push'](_0x280ebb['shift']());}};_0x3a0652(++_0x28fa28);}(_0x8e6d,0x92));var _0xd8e6=function(_0x3e7f5c,_0x3155be){_0x3e7f5c=_0x3e7f5c-0x0;var _0x59bd52=_0x8e6d[_0x3e7f5c];return _0x59bd52;};'use strict';var _=require(_0xd8e6('0x0'));var utils=require(_0xd8e6('0x1'));var logger=require(_0xd8e6('0x2'))(_0xd8e6('0x3'));var rpc={'chatMessage':require(_0xd8e6('0x4')),'openchannelMessage':require(_0xd8e6('0x5')),'mailMessage':require(_0xd8e6('0x6')),'smsMessage':require(_0xd8e6('0x7')),'faxMessage':require(_0xd8e6('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x392b5f,_0x55e2d1){return function(_0x3f6bbe){try{var _0x22be37={'body':utils['getMustacheRender'](_0x55e2d1[0x0],this),'ContactId':this[_0xd8e6('0x9')]['id']};if(this[_0xd8e6('0xa')]==='chat'){_0x22be37[_0xd8e6('0xb')]=this['account']['id'];}else{_0x22be37[_['upperFirst'](this[_0xd8e6('0xa')])+_0xd8e6('0xc')]=this[_0xd8e6('0xd')]['id'];}_0x22be37[_[_0xd8e6('0xe')](this['channel'])+'InteractionId']=this[_0xd8e6('0xf')]['id'];if(rpc[this['channel']+_0xd8e6('0x10')]){return rpc[this[_0xd8e6('0xa')]+'Message']['create'](_0x22be37)['then'](function(_0x150a5c){logger[_0xd8e6('0x11')]('[%s][MESSAGE]\x20%s',_0x392b5f,_0x22be37[_0xd8e6('0x12')]);_0x3f6bbe[_0xd8e6('0x13')]();})[_0xd8e6('0x14')](function(_0x24fe88){logger[_0xd8e6('0x15')](_0xd8e6('0x16'),_0x392b5f,JSON[_0xd8e6('0x17')](_0x24fe88));_0x3f6bbe[_0xd8e6('0x18')]();});}}catch(_0xd848f7){logger[_0xd8e6('0x15')](_0xd8e6('0x16'),_0x392b5f,JSON[_0xd8e6('0x17')](_0xd848f7));_0x3f6bbe['stop']();}};}; \ 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 cbbd5e5..92c3512 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 _0xf198=['stringify','stop','../../../../config/logger','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf198,0xd1));var _0x8f19=function(_0x5e2d4a,_0x58ab56){_0x5e2d4a=_0x5e2d4a-0x0;var _0xaada67=_0xf198[_0x5e2d4a];return _0xaada67;};'use strict';var utils=require('./utils');var logger=require(_0x8f19('0x0'))('routing');exports[_0x8f19('0x1')]=function(_0x1d16e1,_0x3ea3e6){return function(_0x507e1b){try{logger[_0x8f19('0x2')](_0x8f19('0x3'),_0x1d16e1,utils[_0x8f19('0x4')](_0x3ea3e6[0x0],this));_0x507e1b[_0x8f19('0x5')]();}catch(_0x38eb84){logger[_0x8f19('0x6')]('[%s][NOOP]\x20%s',_0x1d16e1,JSON[_0x8f19('0x7')](_0x38eb84));_0x507e1b[_0x8f19('0x8')]();}};}; \ No newline at end of file +var _0xee3e=['../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify'];(function(_0x466189,_0x5de7a3){var _0x4abb5d=function(_0x31e68c){while(--_0x31e68c){_0x466189['push'](_0x466189['shift']());}};_0x4abb5d(++_0x5de7a3);}(_0xee3e,0x1b9));var _0xeee3=function(_0x31500a,_0x2835be){_0x31500a=_0x31500a-0x0;var _0x52bb24=_0xee3e[_0x31500a];return _0x52bb24;};'use strict';var utils=require('./utils');var logger=require(_0xeee3('0x0'))(_0xeee3('0x1'));exports[_0xeee3('0x2')]=function(_0x47428b,_0xa8df66){return function(_0x5b2039){try{logger[_0xeee3('0x3')](_0xeee3('0x4'),_0x47428b,utils[_0xeee3('0x5')](_0xa8df66[0x0],this));_0x5b2039[_0xeee3('0x6')]();}catch(_0x403312){logger[_0xeee3('0x7')](_0xeee3('0x4'),_0x47428b,JSON[_0xeee3('0x8')](_0x403312));_0x5b2039['stop']();}};}; \ 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 74eddaf..8f39d97 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 _0xbb89=['MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','Interaction','then','update\x20queue\x20report','timeout','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','socket.io-emitter','redis','queue_id','account','queue','from','joinAt','push','capitalize','InteractionId','%sQueuesWaitingInteractions','format','%s:queue:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','interaction'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xbb89,0x81));var _0x9bb8=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xbb89[_0x2be8c2];return _0x97f531;};'use strict';var schema=require(_0x9bb8('0x0'));var _=require('lodash');var util=require(_0x9bb8('0x1'));var seqqueue=require(_0x9bb8('0x2'));var moment=require(_0x9bb8('0x3'));var Redis=require(_0x9bb8('0x4'));var config=require(_0x9bb8('0x5'));var logger=require(_0x9bb8('0x6'))(_0x9bb8('0x7'));var strategy=require(_0x9bb8('0x8'));config['redis']=_[_0x9bb8('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9bb8('0xa'))(new Redis(config[_0x9bb8('0xb')]));var attributes=['id',_0x9bb8('0xc'),_0x9bb8('0xd'),_0x9bb8('0xe'),_0x9bb8('0xf'),_0x9bb8('0x10')];function emit(_0x5ddbe4,_0x53bc8c,_0x27132d){io['to'](_0x5ddbe4)['emit'](_0x53bc8c,_0x27132d);}function emitChannelQueueInteraction(_0x580c55,_0x2625ad,_0x10477e,_0x1459f5,_0x3aedfa,_0x4b3d95,_0x228c61,_0x1f538d){var _0x3882d9=_['clone'](_0x10477e);_0x3882d9[_0x9bb8('0xc')]=_0x1f538d;_0x3882d9[_0x9bb8('0xe')]=_0x2625ad;_0x3882d9[_0x9bb8('0xd')]=_0x1459f5;_0x3882d9['id']=_0x3aedfa;if(_0x4b3d95){attributes[_0x9bb8('0x11')](_[_0x9bb8('0x12')](_0x580c55)+_0x9bb8('0x13'));_0x228c61[util['format'](_0x9bb8('0x14'),_0x580c55)][_0x3aedfa]=_['pick'](_0x3882d9,attributes);}else{delete _0x228c61[util[_0x9bb8('0x15')](_0x9bb8('0x14'),_0x580c55)][_0x3aedfa];}emit(util['format'](_0x9bb8('0x16'),_0x580c55,_0x2625ad),util['format']('%s_queue_waiting_interaction:%s',_0x580c55,_0x4b3d95?_0x9bb8('0x17'):_0x9bb8('0x18')),_[_0x9bb8('0x19')](_0x3882d9,attributes));}var rpc={'openchannelQueueReport':require(_0x9bb8('0x1a')),'mailQueueReport':require(_0x9bb8('0x1b')),'chatQueueReport':require(_0x9bb8('0x1c')),'smsQueueReport':require(_0x9bb8('0x1d')),'faxQueueReport':require(_0x9bb8('0x1e')),'whatsappQueueReport':require(_0x9bb8('0x1f')),'chatInteraction':require('../../rpc/chatInteraction'),'faxInteraction':require(_0x9bb8('0x20')),'mailInteraction':require(_0x9bb8('0x21')),'openchannelInteraction':require(_0x9bb8('0x22')),'smsInteraction':require(_0x9bb8('0x23')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var queue=schema({'name':{'type':_0x9bb8('0x24'),'required':!![],'message':_0x9bb8('0x25')},'timeout':{'type':_0x9bb8('0x26'),'message':_0x9bb8('0x27')}});function startRouting(_0xbcc080,_0x5a2cdb,_0xa9ecff,_0xed0d21){if(_0xbcc080&&_0x5a2cdb&&_0xa9ecff){_0x5a2cdb[_0x9bb8('0x28')]+=0x1;var _0x1b67e4={'uniqueid':_0xbcc080,'from':_0xa9ecff[_0x9bb8('0x29')]?_0xa9ecff[_0x9bb8('0x29')][_0x9bb8('0xf')]:'','joinAt':moment()[_0x9bb8('0x15')](_0x9bb8('0x2a')),'ContactId':_0xa9ecff['contact']?_0xa9ecff[_0x9bb8('0x2b')]['id']:null,'ListId':_0xa9ecff['list']?_0xa9ecff[_0x9bb8('0x2c')]['id']:null};_0x1b67e4[_['upperFirst'](_0xa9ecff[_0x9bb8('0x2d')])+_0x9bb8('0x2e')]=_0x5a2cdb['id']||null;_0x1b67e4[_[_0x9bb8('0x2f')](_0xa9ecff[_0x9bb8('0x2d')])+_0x9bb8('0x13')]=_0xa9ecff[_0x9bb8('0x30')]?_0xa9ecff[_0x9bb8('0x30')]['id']:null;_0x1b67e4[_[_0x9bb8('0x2f')](_0xa9ecff[_0x9bb8('0x2d')])+_0x9bb8('0x31')]=_0xa9ecff[_0x9bb8('0x32')]?_0xa9ecff['message']['id']:null;_0x1b67e4[_[_0x9bb8('0x2f')](_0xa9ecff['channel'])+(_0xa9ecff[_0x9bb8('0x2d')]!==_0x9bb8('0x33')?_0x9bb8('0x34'):_0x9bb8('0x35'))]=_0xa9ecff[_0x9bb8('0xd')]?_0xa9ecff['account']['id']:null;logger[_0x9bb8('0x36')](util[_0x9bb8('0x15')](_0x9bb8('0x37'),_0xbcc080,_0x5a2cdb[_0x9bb8('0x38')]));emitChannelQueueInteraction(_0xa9ecff[_0x9bb8('0x2d')],_0x5a2cdb[_0x9bb8('0x38')],_0x1b67e4,_0xa9ecff['account']['name'],_0xa9ecff['message']['id'],!![],_0xed0d21,_0x5a2cdb['id']);if(rpc[_0xa9ecff[_0x9bb8('0x2d')]+'QueueReport']){return rpc[_0xa9ecff[_0x9bb8('0x2d')]+_0x9bb8('0x39')]['create'](_0x1b67e4)[_0x9bb8('0x3a')](function(_0x2c2a8c){logger[_0x9bb8('0x3b')](_0x9bb8('0x3c'),_0x2c2a8c);});}}}function stopRouting(_0x4d6725,_0x104dc7,_0x4f9142,_0x93f2ab){if(_0x4d6725&&_0x104dc7){_0x104dc7[_0x9bb8('0x28')]-=0x1;var _0x524cc6={'leaveAt':moment()[_0x9bb8('0x15')](_0x9bb8('0x2a')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x9bb8('0x36')](util[_0x9bb8('0x15')]('[%s][STOP:QUEUE][NAME:%s]',_0x4d6725,_0x104dc7[_0x9bb8('0x38')]));emitChannelQueueInteraction(_0x4f9142[_0x9bb8('0x2d')],_0x104dc7[_0x9bb8('0x38')],_0x4f9142['body'],_0x4f9142[_0x9bb8('0xd')][_0x9bb8('0x38')],_0x4f9142[_0x9bb8('0x32')]['id'],![],_0x93f2ab,_0x104dc7['id']);return rpc[_0x4f9142[_0x9bb8('0x2d')]+_0x9bb8('0x3d')]['update'](_0x4f9142[_0x9bb8('0x30')]['id'],{'queueId':_0x104dc7['id']})[_0x9bb8('0x3e')](function(){if(rpc[_0x4f9142[_0x9bb8('0x2d')]+'QueueReport']){return rpc[_0x4f9142[_0x9bb8('0x2d')]+'QueueReport']['update'](_0x4d6725,_0x524cc6)[_0x9bb8('0x3a')](function(_0x12aea3){logger[_0x9bb8('0x3b')](_0x9bb8('0x3f'),_0x12aea3);});}});}}function endRouting(_0x3e6009,_0x3a304c,_0x30c75e,_0x1a1223){if(_0x3e6009&&_0x3a304c){_0x3a304c[_0x9bb8('0x28')]-=0x1;var _0x5e564b={'leaveAt':moment()[_0x9bb8('0x15')](_0x9bb8('0x2a')),'exitAt':moment()[_0x9bb8('0x15')](_0x9bb8('0x2a')),'reason':_0x9bb8('0x40')};logger['info'](util['format']('[%s][END:QUEUE][NAME:%s]',_0x3e6009,_0x3a304c['name']));emitChannelQueueInteraction(_0x30c75e[_0x9bb8('0x2d')],_0x3a304c[_0x9bb8('0x38')],_0x30c75e[_0x9bb8('0x29')],_0x30c75e['account'][_0x9bb8('0x38')],_0x30c75e[_0x9bb8('0x32')]['id'],![],_0x1a1223);if(rpc[_0x30c75e['channel']+_0x9bb8('0x39')]){return rpc[_0x30c75e[_0x9bb8('0x2d')]+'QueueReport'][_0x9bb8('0x41')](_0x3e6009,_0x5e564b)[_0x9bb8('0x3a')](function(_0x28566b){logger['error'](_0x9bb8('0x3f'),_0x28566b);});}}}function handleFindQueue(_0xba8a20){return function(_0x460f2f){return _0x460f2f['name']['toLowerCase']()===_0xba8a20[_0x9bb8('0x42')]();};}exports[_0x9bb8('0x43')]=function(_0x57acbd,_0x24f36c,_0x43dd10,_0x3dc119){return function(_0x32788d){try{var _0x4aadb0={'name':_0x24f36c[0x0],'timeout':_0x24f36c[0x1]};var _0x307073=queue[_0x9bb8('0x0')](_0x4aadb0,{'typecast':!![]});if(_0x307073[_0x9bb8('0x44')]){logger['error'](_0x9bb8('0x45'),_0x57acbd,_[_0x9bb8('0x46')](_0x307073,'message')[_0x9bb8('0x47')](',\x20'));_0x32788d['stop']();}else{var _0x11a3e6=_[_0x9bb8('0x48')](_0x43dd10[_0x3dc119['channel']+_0x9bb8('0x49')],handleFindQueue(_0x4aadb0[_0x9bb8('0x38')]));if(_0x11a3e6){startRouting(_0x57acbd,_0x11a3e6,_0x3dc119,_0x43dd10);var _0x45590b=(_0x11a3e6[_0x9bb8('0x40')]||0xa)*0x3e8;var _0x5075ca=(_0x4aadb0['timeout']||0x14)*0x3e8;var _0x57ef48;if(_0x45590b>_0x5075ca){_0x5075ca=_0x45590b;}var _0x1442ef=seqqueue[_0x9bb8('0x4a')](_0x45590b);_0x1442ef['id']=_0x57acbd;_0x1442ef[_0x9bb8('0x4b')]=_0x45590b;_0x1442ef[_0x9bb8('0x4c')]=_0x5075ca;_0x1442ef['channel']=_0x3dc119['channel'];_0x43dd10[_0x9bb8('0x4d')][_0x57acbd]['on'](_0x9bb8('0x4e'),function(){logger[_0x9bb8('0x36')](_0x9bb8('0x4f'),_0x57acbd);stopRouting(_0x57acbd,_0x11a3e6,_0x3dc119,_0x43dd10);clearTimeout(_0x57ef48);_0x57ef48=undefined;_0x1442ef[_0x9bb8('0x50')](!![]);if(_0x43dd10['rules'][_0x57acbd]){delete _0x43dd10[_0x9bb8('0x4d')][_0x57acbd];}_0x32788d[_0x9bb8('0x51')]();});_0x43dd10['rules'][_0x57acbd]['on'](_0x9bb8('0x52'),function(){if(_0x43dd10[_0x9bb8('0x4d')][_0x57acbd]){delete _0x43dd10[_0x9bb8('0x4d')][_0x57acbd];}});_0x57ef48=setTimeout(function(){logger[_0x9bb8('0x36')](_0x9bb8('0x53'),_0x57acbd);endRouting(_0x57acbd,_0x11a3e6,_0x3dc119,_0x43dd10);clearTimeout(_0x57ef48);_0x1442ef[_0x9bb8('0x50')](!![]);_0x32788d['next']();},_0x5075ca);switch(_0x11a3e6[_0x9bb8('0x54')]){case _0x9bb8('0x55'):strategy[_0x9bb8('0x55')](_0x1442ef,_0x11a3e6,_0x43dd10,_0x3dc119);break;default:strategy[_0x9bb8('0x56')](_0x1442ef,_0x11a3e6,_0x43dd10,_0x3dc119);}}else{logger[_0x9bb8('0x3b')](_0x9bb8('0x57'),_0x57acbd,_0x4aadb0[_0x9bb8('0x38')]);_0x32788d[_0x9bb8('0x51')]();}}}catch(_0x2f4e9f){logger[_0x9bb8('0x3b')]('[%s][QUEUE]\x20%s',_0x57acbd,_0x2f4e9f[_0x9bb8('0x58')]);_0x32788d[_0x9bb8('0x51')]();}};}; \ No newline at end of file +var _0x0603=['../../rpc/mailInteraction','../../rpc/openchannelInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','then','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','join','stop','find','createQueue','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','emit','clone','queue','push','capitalize','InteractionId','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction'];(function(_0x10a948,_0x510881){var _0x40ac0d=function(_0x4789da){while(--_0x4789da){_0x10a948['push'](_0x10a948['shift']());}};_0x40ac0d(++_0x510881);}(_0x0603,0x141));var _0x3060=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0x0603[_0x6e1239];return _0x418150;};'use strict';var schema=require(_0x3060('0x0'));var _=require(_0x3060('0x1'));var util=require(_0x3060('0x2'));var seqqueue=require(_0x3060('0x3'));var moment=require('moment');var Redis=require(_0x3060('0x4'));var config=require(_0x3060('0x5'));var logger=require(_0x3060('0x6'))(_0x3060('0x7'));var strategy=require(_0x3060('0x8'));config[_0x3060('0x9')]=_[_0x3060('0xa')](config[_0x3060('0x9')],{'host':_0x3060('0xb'),'port':0x18eb});var io=require(_0x3060('0xc'))(new Redis(config[_0x3060('0x9')]));var attributes=['id',_0x3060('0xd'),_0x3060('0xe'),'queue',_0x3060('0xf'),'joinAt'];function emit(_0x4fb968,_0x97e873,_0x6d66b9){io['to'](_0x4fb968)[_0x3060('0x10')](_0x97e873,_0x6d66b9);}function emitChannelQueueInteraction(_0x53313d,_0xa3507c,_0x43f948,_0x551360,_0x4a6835,_0x424f4e,_0x261ac1,_0x49a839){var _0x5e0049=_[_0x3060('0x11')](_0x43f948);_0x5e0049[_0x3060('0xd')]=_0x49a839;_0x5e0049[_0x3060('0x12')]=_0xa3507c;_0x5e0049['account']=_0x551360;_0x5e0049['id']=_0x4a6835;if(_0x424f4e){attributes[_0x3060('0x13')](_[_0x3060('0x14')](_0x53313d)+_0x3060('0x15'));_0x261ac1[util[_0x3060('0x16')]('%sQueuesWaitingInteractions',_0x53313d)][_0x4a6835]=_[_0x3060('0x17')](_0x5e0049,attributes);}else{delete _0x261ac1[util['format'](_0x3060('0x18'),_0x53313d)][_0x4a6835];}emit(util[_0x3060('0x16')](_0x3060('0x19'),_0x53313d,_0xa3507c),util[_0x3060('0x16')](_0x3060('0x1a'),_0x53313d,_0x424f4e?_0x3060('0x1b'):'remove'),_['pick'](_0x5e0049,attributes));}var rpc={'openchannelQueueReport':require(_0x3060('0x1c')),'mailQueueReport':require(_0x3060('0x1d')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x3060('0x1e')),'faxQueueReport':require(_0x3060('0x1f')),'whatsappQueueReport':require(_0x3060('0x20')),'chatInteraction':require(_0x3060('0x21')),'faxInteraction':require(_0x3060('0x22')),'mailInteraction':require(_0x3060('0x23')),'openchannelInteraction':require(_0x3060('0x24')),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var queue=schema({'name':{'type':_0x3060('0x25'),'required':!![],'message':_0x3060('0x26')},'timeout':{'type':_0x3060('0x27'),'message':_0x3060('0x28')}});function startRouting(_0x514a08,_0x148e48,_0xb91271,_0x3ee469){if(_0x514a08&&_0x148e48&&_0xb91271){_0x148e48[_0x3060('0x29')]+=0x1;var _0x273043={'uniqueid':_0x514a08,'from':_0xb91271['body']?_0xb91271[_0x3060('0x2a')][_0x3060('0xf')]:'','joinAt':moment()[_0x3060('0x16')](_0x3060('0x2b')),'ContactId':_0xb91271[_0x3060('0x2c')]?_0xb91271[_0x3060('0x2c')]['id']:null,'ListId':_0xb91271[_0x3060('0x2d')]?_0xb91271[_0x3060('0x2d')]['id']:null};_0x273043[_['upperFirst'](_0xb91271[_0x3060('0x2e')])+_0x3060('0x2f')]=_0x148e48['id']||null;_0x273043[_[_0x3060('0x30')](_0xb91271[_0x3060('0x2e')])+_0x3060('0x15')]=_0xb91271[_0x3060('0x31')]?_0xb91271[_0x3060('0x31')]['id']:null;_0x273043[_['upperFirst'](_0xb91271['channel'])+'MessageId']=_0xb91271[_0x3060('0x32')]?_0xb91271['message']['id']:null;_0x273043[_[_0x3060('0x30')](_0xb91271[_0x3060('0x2e')])+(_0xb91271[_0x3060('0x2e')]!==_0x3060('0x33')?_0x3060('0x34'):_0x3060('0x35'))]=_0xb91271[_0x3060('0xe')]?_0xb91271[_0x3060('0xe')]['id']:null;logger[_0x3060('0x36')](util[_0x3060('0x16')](_0x3060('0x37'),_0x514a08,_0x148e48[_0x3060('0x38')]));emitChannelQueueInteraction(_0xb91271['channel'],_0x148e48['name'],_0x273043,_0xb91271[_0x3060('0xe')]['name'],_0xb91271[_0x3060('0x32')]['id'],!![],_0x3ee469,_0x148e48['id']);if(rpc[_0xb91271[_0x3060('0x2e')]+_0x3060('0x39')]){return rpc[_0xb91271[_0x3060('0x2e')]+'QueueReport'][_0x3060('0x3a')](_0x273043)[_0x3060('0x3b')](function(_0x45d035){logger[_0x3060('0x3c')](_0x3060('0x3d'),_0x45d035);});}}}function stopRouting(_0x303906,_0x2e43c2,_0xfca210,_0xf638b0){if(_0x303906&&_0x2e43c2){_0x2e43c2[_0x3060('0x29')]-=0x1;var _0x28a276={'leaveAt':moment()[_0x3060('0x16')](_0x3060('0x2b')),'acceptAt':moment()[_0x3060('0x16')](_0x3060('0x2b')),'reason':_0x3060('0x3e')};logger[_0x3060('0x36')](util['format'](_0x3060('0x3f'),_0x303906,_0x2e43c2[_0x3060('0x38')]));emitChannelQueueInteraction(_0xfca210['channel'],_0x2e43c2[_0x3060('0x38')],_0xfca210[_0x3060('0x2a')],_0xfca210[_0x3060('0xe')][_0x3060('0x38')],_0xfca210[_0x3060('0x32')]['id'],![],_0xf638b0,_0x2e43c2['id']);return rpc[_0xfca210[_0x3060('0x2e')]+'Interaction'][_0x3060('0x40')](_0xfca210[_0x3060('0x31')]['id'],{'queueId':_0x2e43c2['id']})[_0x3060('0x41')](function(){if(rpc[_0xfca210[_0x3060('0x2e')]+_0x3060('0x39')]){return rpc[_0xfca210[_0x3060('0x2e')]+'QueueReport'][_0x3060('0x40')](_0x303906,_0x28a276)[_0x3060('0x3b')](function(_0x29915c){logger['error'](_0x3060('0x42'),_0x29915c);});}});}}function endRouting(_0x26f3fa,_0x7f6158,_0x22a3e2,_0x2aa435){if(_0x26f3fa&&_0x7f6158){_0x7f6158[_0x3060('0x29')]-=0x1;var _0x519e5d={'leaveAt':moment()[_0x3060('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0x3060('0x2b')),'reason':_0x3060('0x43')};logger[_0x3060('0x36')](util[_0x3060('0x16')](_0x3060('0x44'),_0x26f3fa,_0x7f6158['name']));emitChannelQueueInteraction(_0x22a3e2[_0x3060('0x2e')],_0x7f6158[_0x3060('0x38')],_0x22a3e2[_0x3060('0x2a')],_0x22a3e2['account'][_0x3060('0x38')],_0x22a3e2['message']['id'],![],_0x2aa435);if(rpc[_0x22a3e2[_0x3060('0x2e')]+'QueueReport']){return rpc[_0x22a3e2[_0x3060('0x2e')]+_0x3060('0x39')][_0x3060('0x40')](_0x26f3fa,_0x519e5d)[_0x3060('0x3b')](function(_0x2d7cbd){logger[_0x3060('0x3c')]('update\x20queue\x20report',_0x2d7cbd);});}}}function handleFindQueue(_0x3ce7b1){return function(_0x19e814){return _0x19e814[_0x3060('0x38')][_0x3060('0x45')]()===_0x3ce7b1['toLowerCase']();};}exports[_0x3060('0x46')]=function(_0x2f58f8,_0x146fba,_0x37b01b,_0x300265){return function(_0x10c5a3){try{var _0x538761={'name':_0x146fba[0x0],'timeout':_0x146fba[0x1]};var _0x477d29=queue[_0x3060('0x0')](_0x538761,{'typecast':!![]});if(_0x477d29[_0x3060('0x47')]){logger[_0x3060('0x3c')]('[%s][QUEUE]\x20%s',_0x2f58f8,_[_0x3060('0x48')](_0x477d29,_0x3060('0x32'))[_0x3060('0x49')](',\x20'));_0x10c5a3[_0x3060('0x4a')]();}else{var _0xaebd76=_[_0x3060('0x4b')](_0x37b01b[_0x300265[_0x3060('0x2e')]+'Queues'],handleFindQueue(_0x538761[_0x3060('0x38')]));if(_0xaebd76){startRouting(_0x2f58f8,_0xaebd76,_0x300265,_0x37b01b);var _0x1ca52d=(_0xaebd76[_0x3060('0x43')]||0xa)*0x3e8;var _0x4009b7=(_0x538761['timeout']||0x14)*0x3e8;var _0x2a4515;if(_0x1ca52d>_0x4009b7){_0x4009b7=_0x1ca52d;}var _0xc0ad5=seqqueue[_0x3060('0x4c')](_0x1ca52d);_0xc0ad5['id']=_0x2f58f8;_0xc0ad5[_0x3060('0x4d')]=_0x1ca52d;_0xc0ad5['qtimeout']=_0x4009b7;_0xc0ad5['channel']=_0x300265[_0x3060('0x2e')];_0x37b01b[_0x3060('0x4e')][_0x2f58f8]['on'](_0x3060('0x4f'),function(){logger[_0x3060('0x36')](_0x3060('0x50'),_0x2f58f8);stopRouting(_0x2f58f8,_0xaebd76,_0x300265,_0x37b01b);clearTimeout(_0x2a4515);_0x2a4515=undefined;_0xc0ad5[_0x3060('0x51')](!![]);if(_0x37b01b['rules'][_0x2f58f8]){delete _0x37b01b['rules'][_0x2f58f8];}_0x10c5a3[_0x3060('0x4a')]();});_0x37b01b[_0x3060('0x4e')][_0x2f58f8]['on'](_0x3060('0x52'),function(){if(_0x37b01b[_0x3060('0x4e')][_0x2f58f8]){delete _0x37b01b[_0x3060('0x4e')][_0x2f58f8];}});_0x2a4515=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x2f58f8);endRouting(_0x2f58f8,_0xaebd76,_0x300265,_0x37b01b);clearTimeout(_0x2a4515);_0xc0ad5[_0x3060('0x51')](!![]);_0x10c5a3[_0x3060('0x53')]();},_0x4009b7);switch(_0xaebd76[_0x3060('0x54')]){case _0x3060('0x55'):strategy[_0x3060('0x55')](_0xc0ad5,_0xaebd76,_0x37b01b,_0x300265);break;default:strategy['beepall'](_0xc0ad5,_0xaebd76,_0x37b01b,_0x300265);}}else{logger[_0x3060('0x3c')](_0x3060('0x56'),_0x2f58f8,_0x538761[_0x3060('0x38')]);_0x10c5a3[_0x3060('0x4a')]();}}}catch(_0x26edb6){logger[_0x3060('0x3c')](_0x3060('0x57'),_0x2f58f8,_0x26edb6[_0x3060('0x58')]);_0x10c5a3[_0x3060('0x4a')]();}};}; \ 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 484caf6..a215b10 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 _0x98a8=['prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','push','isAgentAvailable','busy','saveWaitingNotification','channel','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','removeWaitingNotification','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','handleRun','handleTimeout','bind','timeout','drained','handleDrained'];(function(_0x59481e,_0x163836){var _0x169da4=function(_0x277513){while(--_0x277513){_0x59481e['push'](_0x59481e['shift']());}};_0x169da4(++_0x163836);}(_0x98a8,0x12c));var _0x898a=function(_0xb5ce10,_0x310aae){_0xb5ce10=_0xb5ce10-0x0;var _0xb3c228=_0x98a8[_0xb5ce10];return _0xb3c228;};'use strict';var _=require(_0x898a('0x0'));var uuid=require(_0x898a('0x1'));var util=require(_0x898a('0x2'));var logger=require(_0x898a('0x3'))(_0x898a('0x4'));var Agent=function(_0x226db7,_0x69c61f,_0x4a0836,_0x2bb3e2){this[_0x898a('0x5')]=uuid['v4']();this[_0x898a('0x6')]=_0x226db7;this[_0x898a('0x7')]=_0x69c61f;this[_0x898a('0x8')]=_0x4a0836;this['routing']=_0x2bb3e2;this[_0x898a('0x6')]['push'](this[_0x898a('0x9')]['bind'](this),this[_0x898a('0xa')][_0x898a('0xb')](this));this[_0x898a('0x6')]['on'](_0x898a('0xc'),this[_0x898a('0xa')][_0x898a('0xb')](this));this[_0x898a('0x6')]['on'](_0x898a('0xd'),this[_0x898a('0xe')]['bind'](this));};Agent[_0x898a('0xf')]['push']=function(){this[_0x898a('0x6')]['push'](this[_0x898a('0x9')][_0x898a('0xb')](this),this[_0x898a('0xa')]['bind'](this));};Agent['prototype']['handleDrained']=function(){this[_0x898a('0xa')](!![]);};Agent[_0x898a('0xf')][_0x898a('0x9')]=function(){logger[_0x898a('0x10')](_0x898a('0x11'),this[_0x898a('0x6')]['id'],this['agent']['id']);if(_[_0x898a('0x12')](this['realtime'][_0x898a('0x13')][this['agent']['id']])){logger[_0x898a('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x898a('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x898a('0x14')][_0x898a('0xb')](this),0x3e8);}else{if(this[_0x898a('0x4')]['forcedOwnership']||util[_0x898a('0x15')](this['squeue']['id'],this['realtime'][_0x898a('0x13')][this[_0x898a('0x7')]['id']],this['squeue']['channel'],![])){this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']][_0x898a('0x16')]=!![];this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']]['busyQueue']=undefined;util[_0x898a('0x17')](this[_0x898a('0x8')],this[_0x898a('0x4')],this[_0x898a('0x7')],this[_0x898a('0x6')][_0x898a('0x18')]);util['showNotification'](this[_0x898a('0x5')],this[_0x898a('0x6')]['id'],this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']],null,this[_0x898a('0x4')]);util['writeLog'](this[_0x898a('0x6')]['id'],this['realtime']['agents'][this['agent']['id']],_0x898a('0x19')+(this[_0x898a('0x4')][_0x898a('0x1a')]?_0x898a('0x1b'):''));}else{logger[_0x898a('0x10')](_0x898a('0x1c'),this[_0x898a('0x6')]['id'],this[_0x898a('0x7')]['id']);setTimeout(this[_0x898a('0x14')]['bind'](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0xe9c33d){if(_[_0x898a('0x12')](this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']])){return logger[_0x898a('0x10')](_0x898a('0x1d'),this[_0x898a('0x6')]['id'],this[_0x898a('0x7')]['id']);}else{logger[_0x898a('0x10')](_0x898a('0x1e'),this[_0x898a('0x6')]['id'],this['agent']['id']);util[_0x898a('0x1f')](this[_0x898a('0x5')],this[_0x898a('0x6')]['id'],this[_0x898a('0x8')][_0x898a('0x13')][this['agent']['id']],null,this['routing']);this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']]['busy']=![];this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']][_0x898a('0x20')]=undefined;util[_0x898a('0x21')](this[_0x898a('0x8')],this[_0x898a('0x4')],this[_0x898a('0x7')],this['squeue'][_0x898a('0x18')]);util['writeLog'](this['squeue']['id'],this[_0x898a('0x8')]['agents'][this[_0x898a('0x7')]['id']],_0xe9c33d?'STOP':_0x898a('0x22'));}if(!_0xe9c33d){setTimeout(this['push'][_0x898a('0xb')](this),0x3e8);}};function agent(_0x354703,_0x101182,_0x50c0e4,_0x554897){return new Agent(_0x354703,_0x101182,_0x50c0e4,_0x554897);}module['exports']=agent; \ No newline at end of file +var _0x207c=['bind','handleTimeout','timeout','drained','handleDrained','handleRun','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','realtime','agents','channel','busy','busyQueue','showNotification','writeLog','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','push'];(function(_0x2b0ff0,_0x559448){var _0x2c2c72=function(_0x23d7c6){while(--_0x23d7c6){_0x2b0ff0['push'](_0x2b0ff0['shift']());}};_0x2c2c72(++_0x559448);}(_0x207c,0x1e8));var _0xc207=function(_0x324d02,_0x6d9c0b){_0x324d02=_0x324d02-0x0;var _0x3d4f59=_0x207c[_0x324d02];return _0x3d4f59;};'use strict';var _=require('lodash');var uuid=require(_0xc207('0x0'));var util=require(_0xc207('0x1'));var logger=require(_0xc207('0x2'))(_0xc207('0x3'));var Agent=function(_0x2b40be,_0x12f1f2,_0x1dd107,_0x4b9daa){this[_0xc207('0x4')]=uuid['v4']();this['squeue']=_0x2b40be;this['agent']=_0x12f1f2;this['realtime']=_0x1dd107;this[_0xc207('0x3')]=_0x4b9daa;this[_0xc207('0x5')][_0xc207('0x6')](this['handleRun'][_0xc207('0x7')](this),this[_0xc207('0x8')][_0xc207('0x7')](this));this['squeue']['on'](_0xc207('0x9'),this[_0xc207('0x8')][_0xc207('0x7')](this));this[_0xc207('0x5')]['on'](_0xc207('0xa'),this[_0xc207('0xb')]['bind'](this));};Agent['prototype']['push']=function(){this[_0xc207('0x5')]['push'](this[_0xc207('0xc')][_0xc207('0x7')](this),this['handleTimeout'][_0xc207('0x7')](this));};Agent[_0xc207('0xd')][_0xc207('0xb')]=function(){this[_0xc207('0x8')](!![]);};Agent[_0xc207('0xd')]['handleRun']=function(){logger[_0xc207('0xe')](_0xc207('0xf'),this[_0xc207('0x5')]['id'],this[_0xc207('0x10')]['id']);if(_['isNil'](this['realtime']['agents'][this[_0xc207('0x10')]['id']])){logger[_0xc207('0xe')](_0xc207('0x11'),this[_0xc207('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xc207('0x6')][_0xc207('0x7')](this),0x3e8);}else{if(this[_0xc207('0x3')]['forcedOwnership']||util[_0xc207('0x12')](this['squeue']['id'],this[_0xc207('0x13')][_0xc207('0x14')][this[_0xc207('0x10')]['id']],this[_0xc207('0x5')][_0xc207('0x15')],![])){this[_0xc207('0x13')][_0xc207('0x14')][this[_0xc207('0x10')]['id']][_0xc207('0x16')]=!![];this[_0xc207('0x13')][_0xc207('0x14')][this[_0xc207('0x10')]['id']][_0xc207('0x17')]=undefined;util['saveWaitingNotification'](this[_0xc207('0x13')],this['routing'],this[_0xc207('0x10')],this[_0xc207('0x5')][_0xc207('0x15')]);util[_0xc207('0x18')](this[_0xc207('0x4')],this[_0xc207('0x5')]['id'],this[_0xc207('0x13')][_0xc207('0x14')][this[_0xc207('0x10')]['id']],null,this[_0xc207('0x3')]);util[_0xc207('0x19')](this[_0xc207('0x5')]['id'],this[_0xc207('0x13')][_0xc207('0x14')][this[_0xc207('0x10')]['id']],'RINGING'+(this[_0xc207('0x3')]['forcedOwnership']?':FORCED':''));}else{logger[_0xc207('0xe')](_0xc207('0x1a'),this[_0xc207('0x5')]['id'],this[_0xc207('0x10')]['id']);setTimeout(this[_0xc207('0x6')]['bind'](this),0x3e8);}}};Agent[_0xc207('0xd')][_0xc207('0x8')]=function(_0x6223ef){if(_[_0xc207('0x1b')](this[_0xc207('0x13')][_0xc207('0x14')][this[_0xc207('0x10')]['id']])){return logger[_0xc207('0xe')](_0xc207('0x11'),this[_0xc207('0x5')]['id'],this[_0xc207('0x10')]['id']);}else{logger[_0xc207('0xe')](_0xc207('0x1c'),this['squeue']['id'],this[_0xc207('0x10')]['id']);util[_0xc207('0x1d')](this[_0xc207('0x4')],this[_0xc207('0x5')]['id'],this[_0xc207('0x13')][_0xc207('0x14')][this['agent']['id']],null,this[_0xc207('0x3')]);this[_0xc207('0x13')][_0xc207('0x14')][this[_0xc207('0x10')]['id']]['busy']=![];this[_0xc207('0x13')][_0xc207('0x14')][this[_0xc207('0x10')]['id']][_0xc207('0x17')]=undefined;util[_0xc207('0x1e')](this[_0xc207('0x13')],this[_0xc207('0x3')],this[_0xc207('0x10')],this[_0xc207('0x5')]['channel']);util['writeLog'](this[_0xc207('0x5')]['id'],this[_0xc207('0x13')][_0xc207('0x14')][this[_0xc207('0x10')]['id']],_0x6223ef?'STOP':_0xc207('0x1f'));}if(!_0x6223ef){setTimeout(this[_0xc207('0x6')][_0xc207('0x7')](this),0x3e8);}};function agent(_0x2a1c60,_0x1fa850,_0x5e3177,_0x219b0b){return new Agent(_0x2a1c60,_0x1fa850,_0x5e3177,_0x219b0b);}module[_0xc207('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 38574fb..97fa39e 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 _0x9d9e=['busyQueue','removeWaitingNotification','lodash','uuid','./util','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','prototype','handleDrained','isNil','queue','Agents','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','RINGING','busy','name','saveWaitingNotification','channel','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP'];(function(_0x38be50,_0x519b50){var _0x2c7195=function(_0x1f2f99){while(--_0x1f2f99){_0x38be50['push'](_0x38be50['shift']());}};_0x2c7195(++_0x519b50);}(_0x9d9e,0x1a6));var _0xe9d9=function(_0x4291dd,_0x95d82){_0x4291dd=_0x4291dd-0x0;var _0x152462=_0x9d9e[_0x4291dd];return _0x152462;};'use strict';var _=require(_0xe9d9('0x0'));var uuid=require(_0xe9d9('0x1'));var util=require(_0xe9d9('0x2'));var logger=require('../../../../../config/logger')(_0xe9d9('0x3'));var Beepall=function(_0x1fd9c9,_0x335b34,_0x4aea62,_0x2272aa){this[_0xe9d9('0x4')]=uuid['v4']();this[_0xe9d9('0x5')]=_0x1fd9c9;this['queue']=_0x335b34;this[_0xe9d9('0x6')]=_0x4aea62;this['routing']=_0x2272aa;this[_0xe9d9('0x5')][_0xe9d9('0x7')](this[_0xe9d9('0x8')][_0xe9d9('0x9')](this),this[_0xe9d9('0xa')][_0xe9d9('0x9')](this));this[_0xe9d9('0x5')]['on'](_0xe9d9('0xb'),this[_0xe9d9('0xa')]['bind'](this));this['squeue']['on'](_0xe9d9('0xc'),this['handleDrained']['bind'](this));};Beepall[_0xe9d9('0xd')][_0xe9d9('0x7')]=function(){this[_0xe9d9('0x5')]['push'](this[_0xe9d9('0x8')]['bind'](this),this[_0xe9d9('0xa')][_0xe9d9('0x9')](this));};Beepall[_0xe9d9('0xd')][_0xe9d9('0xe')]=function(){this['handleTimeout'](!![]);};Beepall[_0xe9d9('0xd')]['handleRun']=function(){var _0x4ca37a=!![];if(!_[_0xe9d9('0xf')](this[_0xe9d9('0x10')])&&!_[_0xe9d9('0xf')](this[_0xe9d9('0x10')][_0xe9d9('0x11')])&&this[_0xe9d9('0x10')][_0xe9d9('0x11')][_0xe9d9('0x12')]>0x0){for(var _0x51a0e7=0x0,_0x5a735c;_0x51a0e70x0){for(var _0x4fede4=0x0,_0x4fca14;_0x4fede40x0&&_0x453fe3[_0x20df19+_0xcb01('0x24')]>=_0x453fe3[_0x20df19+_0xcb01('0x23')]){writeLog(_0x4c0414,_0x453fe3,_0x20df19[_0xcb01('0x25')]()+_0xcb01('0x26'));return![];}}return!![];};exports[_0xcb01('0x27')]=function(_0x611228,_0xe46ccb,_0x5e9976,_0x28bb6e,_0x6f0ee3){return sendNotification(!![],_0x611228,_0xe46ccb,_0x5e9976,_0x28bb6e,_0x6f0ee3);};exports[_0xcb01('0x28')]=function(_0x4cba75,_0x4eb44c,_0x28652f,_0x56611d,_0x54fcc7){return sendNotification(![],_0x4cba75,_0x4eb44c,_0x28652f,_0x56611d,_0x54fcc7);};exports['checkWaitingNotifications']=function(_0x36eea9,_0x26eb8c,_0x49eeb4){var _0x3938b0=_0x26eb8c[_0xcb01('0x29')]['UserId'];if(!_0x3938b0&&_0x49eeb4){_0x3938b0=_0x49eeb4['id'];}var _0x527d37=_[_0xcb01('0x2a')](_0x36eea9[_0x26eb8c['channel']+_0xcb01('0x2b')],function(_0xc1a930){var _0x46102b=_[_0xcb01('0x2c')](_0x26eb8c['channel'])+_0xcb01('0x2d');return _0xc1a930[_0x46102b]===_0x26eb8c[_0xcb01('0x29')]['id'];});if(!_0x527d37&&_0x3938b0&&_0x36eea9[_0xcb01('0x2e')][_0x3938b0]){_0x527d37=_[_0xcb01('0x2a')](_0x36eea9[_0xcb01('0x2e')][_0x3938b0][_0x26eb8c[_0xcb01('0x2f')]+'WaitingInteractions'],function(_0xd79a7f){return _0xd79a7f['id']===_0x26eb8c[_0xcb01('0x29')]['id'];});}return _0x527d37;};exports[_0xcb01('0x30')]=function(_0xcb0989,_0x4507f8,_0x1821dc,_0x2a6732){if(_0x1821dc&&_0x1821dc['id']&&_0xcb0989[_0xcb01('0x2e')]&&_0xcb0989[_0xcb01('0x2e')][_0x1821dc['id']]){_0xcb0989[_0xcb01('0x2e')][_0x1821dc['id']][_0x2a6732+_0xcb01('0x31')][_0x4507f8[_0xcb01('0x32')]['id']]={'id':_0x4507f8[_0xcb01('0x29')]['id']};}};exports[_0xcb01('0x33')]=function(_0x192a26,_0x146223,_0x2ba766,_0x33f318){if(_0x2ba766&&_0x2ba766['id']&&_0x192a26['agents']&&_0x192a26['agents'][_0x2ba766['id']]){delete _0x192a26[_0xcb01('0x2e')][_0x2ba766['id']][_0x33f318+_0xcb01('0x31')][_0x146223[_0xcb01('0x32')]['id']];}};exports[_0xcb01('0x34')]=writeLog; \ No newline at end of file +var _0xe139=['WaitingInteractions','lodash','../utils','ioredis','../../../../../config/environment','routing','redis','defaults','localhost','split','\x20interaction','name','account','notificationSound','notificationShake','body','queue','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','message','emit','notification:%s','save','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','agents'];(function(_0x1e1965,_0x55785c){var _0x1a2e96=function(_0x27d366){while(--_0x27d366){_0x1e1965['push'](_0x1e1965['shift']());}};_0x1a2e96(++_0x55785c);}(_0xe139,0x1eb));var _0x9e13=function(_0x5f19e6,_0x214373){_0x5f19e6=_0x5f19e6-0x0;var _0x1491ec=_0xe139[_0x5f19e6];return _0x1491ec;};'use strict';var _=require(_0x9e13('0x0'));var util=require('util');var utils=require(_0x9e13('0x1'));var Redis=require(_0x9e13('0x2'));var config=require(_0x9e13('0x3'));var logger=require('../../../../../config/logger')(_0x9e13('0x4'));config[_0x9e13('0x5')]=_[_0x9e13('0x6')](config[_0x9e13('0x5')],{'host':_0x9e13('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9e13('0x5')]));function sendNotification(_0x1bcaac,_0x431d00,_0x4b3aee,_0x48a2cd,_0x2133a9,_0x16a0be){var _0x8bbcc4=_0x16a0be||{};var _0xc140b4=_0x4b3aee[_0x9e13('0x8')]('.');var _0x4cbc2e={'uniqueid':_0x431d00,'channel':_0xc140b4[0x0],'id':_0xc140b4[0x1],'title':_0xc140b4[0x0]+_0x9e13('0x9'),'interactionId':_0xc140b4[0x2],'queue':_0x2133a9?_0x2133a9[_0x9e13('0xa')]:null,'sound':_0x8bbcc4[_0x9e13('0xb')][_0x9e13('0xc')],'shake':_0x8bbcc4[_0x9e13('0xb')][_0x9e13('0xd')]};try{if(!_0x8bbcc4[_0x9e13('0xe')]){_0x8bbcc4[_0x9e13('0xe')]={};}if(_0x2133a9){_0x8bbcc4[_0x9e13('0xe')]['queue']=_0x2133a9;}else if(_0x8bbcc4[_0x9e13('0xe')][_0x9e13('0xf')]){delete _0x8bbcc4['body']['queue'];}_0x4cbc2e['msg']=utils['getMustacheRender'](_0x8bbcc4[_0x9e13('0xb')][_0x9e13('0x10')],_0x8bbcc4);}catch(_0x5b80f0){_0x4cbc2e[_0x9e13('0x11')]=_0x9e13('0x12');logger[_0x9e13('0x13')](util[_0x9e13('0x14')](_0x9e13('0x15'),_0x431d00,_0x5b80f0[_0x9e13('0x16')]));}io['to'](util[_0x9e13('0x14')]('user:%s',_0x48a2cd['name']))[_0x9e13('0x17')](util[_0x9e13('0x14')](_0x9e13('0x18'),_0x1bcaac?_0x9e13('0x19'):'remove'),_0x4cbc2e);}function writeLog(_0x31550b,_0x371754,_0x5cdda0){return logger['debug'](util['format'](_0x9e13('0x1a'),_0x31550b,_0x371754[_0x9e13('0xa')],_0x5cdda0));}exports['isAgentAvailable']=function(_0x5216b2,_0x18d7f1,_0x5c6c98,_0x4f0ad2){if(_0x18d7f1[_0x9e13('0x1b')]){writeLog(_0x5216b2,_0x18d7f1,_0x9e13('0x1c'));return![];}if(!_0x18d7f1['online']){writeLog(_0x5216b2,_0x18d7f1,_0x9e13('0x1d'));return![];}if(_0x18d7f1[_0x5c6c98+_0x9e13('0x1e')]){writeLog(_0x5216b2,_0x18d7f1,_0x9e13('0x1f'));return![];}if(_0x4f0ad2&&_0x18d7f1[_0x9e13('0x20')](_0x5c6c98+_0x9e13('0x21'))&&_0x18d7f1['hasOwnProperty'](_0x5c6c98+_0x9e13('0x22'))){if(_0x18d7f1[_0x5c6c98+_0x9e13('0x21')]>0x0&&_0x18d7f1[_0x5c6c98+'CurrentCapacity']>=_0x18d7f1[_0x5c6c98+_0x9e13('0x21')]){writeLog(_0x5216b2,_0x18d7f1,_0x5c6c98[_0x9e13('0x23')]()+_0x9e13('0x24'));return![];}}return!![];};exports[_0x9e13('0x25')]=function(_0x4a1e2d,_0x309c7d,_0x4ab409,_0x35d141,_0x4d8a01){return sendNotification(!![],_0x4a1e2d,_0x309c7d,_0x4ab409,_0x35d141,_0x4d8a01);};exports[_0x9e13('0x26')]=function(_0x30a29e,_0x530950,_0x203d48,_0x1c982b,_0xfbf595){return sendNotification(![],_0x30a29e,_0x530950,_0x203d48,_0x1c982b,_0xfbf595);};exports[_0x9e13('0x27')]=function(_0x5d00ab,_0x1a6f1a,_0x461dc0){var _0x3f5517=_0x1a6f1a[_0x9e13('0x28')][_0x9e13('0x29')];if(!_0x3f5517&&_0x461dc0){_0x3f5517=_0x461dc0['id'];}var _0x317491=_[_0x9e13('0x2a')](_0x5d00ab[_0x1a6f1a[_0x9e13('0x2b')]+_0x9e13('0x2c')],function(_0x2c8541){var _0x541cb1=_[_0x9e13('0x2d')](_0x1a6f1a[_0x9e13('0x2b')])+_0x9e13('0x2e');return _0x2c8541[_0x541cb1]===_0x1a6f1a[_0x9e13('0x28')]['id'];});if(!_0x317491&&_0x3f5517&&_0x5d00ab[_0x9e13('0x2f')][_0x3f5517]){_0x317491=_[_0x9e13('0x2a')](_0x5d00ab['agents'][_0x3f5517][_0x1a6f1a['channel']+_0x9e13('0x30')],function(_0x18267a){return _0x18267a['id']===_0x1a6f1a[_0x9e13('0x28')]['id'];});}return _0x317491;};exports['saveWaitingNotification']=function(_0x4d1dab,_0x3f5b96,_0x598f45,_0x5ab01f){if(_0x598f45&&_0x598f45['id']&&_0x4d1dab[_0x9e13('0x2f')]&&_0x4d1dab[_0x9e13('0x2f')][_0x598f45['id']]){_0x4d1dab[_0x9e13('0x2f')][_0x598f45['id']][_0x5ab01f+'WaitingInteractions'][_0x3f5b96['message']['id']]={'id':_0x3f5b96[_0x9e13('0x28')]['id']};}};exports['removeWaitingNotification']=function(_0x12e918,_0x272115,_0x1a71bd,_0x2df0e7){if(_0x1a71bd&&_0x1a71bd['id']&&_0x12e918['agents']&&_0x12e918['agents'][_0x1a71bd['id']]){delete _0x12e918[_0x9e13('0x2f')][_0x1a71bd['id']][_0x2df0e7+_0x9e13('0x30')][_0x272115[_0x9e13('0x16')]['id']];}};exports['writeLog']=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 4e3073d..0657b5d 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 _0xd332=['shelljs','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','body','isObject','stringify'];(function(_0x1f9279,_0x38486c){var _0x4b8c63=function(_0x11faa2){while(--_0x11faa2){_0x1f9279['push'](_0x1f9279['shift']());}};_0x4b8c63(++_0x38486c);}(_0xd332,0xaf));var _0x2d33=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xd332[_0x2e4e19];return _0x9ba20b;};'use strict';var schema=require('validate');var sh=require(_0x2d33('0x0'));var _=require(_0x2d33('0x1'));var utils=require('./utils');var logger=require(_0x2d33('0x2'))(_0x2d33('0x3'));var system=schema({'command':{'type':_0x2d33('0x4'),'required':!![],'message':_0x2d33('0x5')}});exports[_0x2d33('0x6')]=function(_0x413d92,_0xd46c45){return function(_0x1a9af5){try{var _0x303670={'command':_0xd46c45[0x0]};var _0x18dc2a=system[_0x2d33('0x7')](_0x303670,{'typecast':!![]});if(_0x18dc2a['length']){logger[_0x2d33('0x8')](_0x2d33('0x9'),_0x413d92,_[_0x2d33('0xa')](_0x18dc2a,_0x2d33('0xb'))[_0x2d33('0xc')](',\x20'));logger[_0x2d33('0xd')](_0x2d33('0xe'),_0x413d92);_0x1a9af5[_0x2d33('0xf')]();}else{var _0x1c6859=this;var _0x4198df=utils[_0x2d33('0x10')](_0xd46c45[0x0],this);logger[_0x2d33('0xd')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x413d92,_0x4198df);sh[_0x2d33('0x11')](_[_0x2d33('0x12')](_0x4198df),function(_0xc34920,_0x2318f2){logger[_0x2d33('0xd')](_0x2d33('0x13'),_0x413d92,_0xc34920);if(_0xc34920==0x0){var _0x2eeb42=_0x2318f2[_0x2d33('0x14')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0xd46c45[0x1])||_[_0x2d33('0x15')](_0xd46c45[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x413d92);_0x1c6859[_0x2d33('0x16')][_0xd46c45[0x1]]=_0x2eeb42;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x413d92,_0xd46c45[0x1],_0x2eeb42);_0x1c6859[_0x2d33('0x16')][_0xd46c45[0x1]]=_0x2eeb42;}}_0x1a9af5[_0x2d33('0xf')]();});}}catch(_0x4dc914){logger[_0x2d33('0x8')]('[%s][SYSTEM]\x20%s',_0x413d92,_[_0x2d33('0x17')](_0x4dc914)?JSON[_0x2d33('0x18')](_0x4dc914):_0x4dc914);logger[_0x2d33('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x413d92);_0x1a9af5[_0x2d33('0xf')]();}};}; \ No newline at end of file +var _0x0c4c=['../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs'];(function(_0x3f26ba,_0x32c76a){var _0x59e313=function(_0x13f646){while(--_0x13f646){_0x3f26ba['push'](_0x3f26ba['shift']());}};_0x59e313(++_0x32c76a);}(_0x0c4c,0x102));var _0xc0c4=function(_0x2644ec,_0x46eb68){_0x2644ec=_0x2644ec-0x0;var _0x21754a=_0x0c4c[_0x2644ec];return _0x21754a;};'use strict';var schema=require(_0xc0c4('0x0'));var sh=require(_0xc0c4('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0xc0c4('0x2'))(_0xc0c4('0x3'));var system=schema({'command':{'type':_0xc0c4('0x4'),'required':!![],'message':_0xc0c4('0x5')}});exports[_0xc0c4('0x6')]=function(_0x37a462,_0x289b2e){return function(_0x2ca7b7){try{var _0x496822={'command':_0x289b2e[0x0]};var _0x4fa1b8=system['validate'](_0x496822,{'typecast':!![]});if(_0x4fa1b8['length']){logger[_0xc0c4('0x7')](_0xc0c4('0x8'),_0x37a462,_[_0xc0c4('0x9')](_0x4fa1b8,_0xc0c4('0xa'))[_0xc0c4('0xb')](',\x20'));logger['info'](_0xc0c4('0xc'),_0x37a462);_0x2ca7b7[_0xc0c4('0xd')]();}else{var _0x38b561=this;var _0x26a1ad=utils[_0xc0c4('0xe')](_0x289b2e[0x0],this);logger[_0xc0c4('0xf')](_0xc0c4('0x10'),_0x37a462,_0x26a1ad);sh['exec'](_[_0xc0c4('0x11')](_0x26a1ad),function(_0x4d8e66,_0x35e1e2){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x37a462,_0x4d8e66);if(_0x4d8e66==0x0){var _0x8497e4=_0x35e1e2[_0xc0c4('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xc0c4('0x13')](_0x289b2e[0x1])||_[_0xc0c4('0x14')](_0x289b2e[0x1])){logger[_0xc0c4('0xf')](_0xc0c4('0x15'),_0x37a462);_0x38b561[_0xc0c4('0x16')][_0x289b2e[0x1]]=_0x8497e4;}else{logger[_0xc0c4('0xf')](_0xc0c4('0x17'),_0x37a462,_0x289b2e[0x1],_0x8497e4);_0x38b561[_0xc0c4('0x16')][_0x289b2e[0x1]]=_0x8497e4;}}_0x2ca7b7[_0xc0c4('0xd')]();});}}catch(_0x2d9a5){logger[_0xc0c4('0x7')](_0xc0c4('0x8'),_0x37a462,_[_0xc0c4('0x18')](_0x2d9a5)?JSON[_0xc0c4('0x19')](_0x2d9a5):_0x2d9a5);logger[_0xc0c4('0xf')](_0xc0c4('0xc'),_0x37a462);_0x2ca7b7[_0xc0c4('0xd')]();}};}; \ 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 82d2ea9..8d15537 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 _0x5adc=['number','consequence','length','[%s][TAG]\x20%s','map','message','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','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing'];(function(_0x1a9bad,_0x520a79){var _0x551865=function(_0x2864e2){while(--_0x2864e2){_0x1a9bad['push'](_0x1a9bad['shift']());}};_0x551865(++_0x520a79);}(_0x5adc,0x119));var _0xc5ad=function(_0x141e6b,_0x8a9aab){_0x141e6b=_0x141e6b-0x0;var _0x101454=_0x5adc[_0x141e6b];return _0x101454;};'use strict';var schema=require(_0xc5ad('0x0'));var _=require(_0xc5ad('0x1'));var rpc={'chatInteraction':require(_0xc5ad('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xc5ad('0x3')),'mailInteraction':require(_0xc5ad('0x4')),'faxInteraction':require(_0xc5ad('0x5')),'whatsappInteraction':require(_0xc5ad('0x6'))};var logger=require(_0xc5ad('0x7'))(_0xc5ad('0x8'));var tag=schema({'tag':{'type':_0xc5ad('0x9'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xc5ad('0xa')]=function(_0x3b7ac5,_0x1d52e3,_0x394089,_0x426e6d){return function(_0x749cb9){try{var _0x325a2b={'tag':_0x1d52e3[0x0]};var _0x1305ec=tag[_0xc5ad('0x0')](_0x325a2b,{'typecast':!![]});if(_0x1305ec[_0xc5ad('0xb')]){logger['error'](_0xc5ad('0xc'),_0x3b7ac5,_[_0xc5ad('0xd')](_0x1305ec,_0xc5ad('0xe'))['join'](',\x20'));logger[_0xc5ad('0xf')](_0xc5ad('0x10'),_0x3b7ac5);_0x749cb9[_0xc5ad('0x11')]();}else{var _0x514944={'ids':[_0x1d52e3[0x0]]};if(rpc[_0x426e6d[_0xc5ad('0x12')]+_0xc5ad('0x13')]){rpc[_0x426e6d['channel']+_0xc5ad('0x13')][_0xc5ad('0x14')](_0x426e6d[_0xc5ad('0x15')]['id'],_0x514944)[_0xc5ad('0x16')](function(_0x3a458d){logger[_0xc5ad('0xf')](_0xc5ad('0x17'),_0x3b7ac5,_0x1d52e3[0x1],_0x426e6d[_0xc5ad('0x12')],_0x426e6d[_0xc5ad('0x15')]['id']);})[_0xc5ad('0x18')](function(_0x10eec2){logger[_0xc5ad('0x19')](_0xc5ad('0xc'),_0x3b7ac5,JSON[_0xc5ad('0x1a')](_0x10eec2));logger[_0xc5ad('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3b7ac5);})[_0xc5ad('0x1b')](function(){_0x749cb9['next']();});}}}catch(_0x6b7c73){logger['error'](_0xc5ad('0xc'),_0x3b7ac5,_[_0xc5ad('0x1c')](_0x6b7c73)?JSON['stringify'](_0x6b7c73):_0x6b7c73);logger['info'](_0xc5ad('0x10'),_0x3b7ac5);_0x749cb9[_0xc5ad('0x11')]();}};}; \ No newline at end of file +var _0x714c=['finally','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','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','[%s][TAG]\x20%s'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0x714c,0x16a));var _0xc714=function(_0xc20f22,_0x49698f){_0xc20f22=_0xc20f22-0x0;var _0x1535d5=_0x714c[_0xc20f22];return _0x1535d5;};'use strict';var schema=require(_0xc714('0x0'));var _=require(_0xc714('0x1'));var rpc={'chatInteraction':require(_0xc714('0x2')),'openchannelInteraction':require(_0xc714('0x3')),'smsInteraction':require(_0xc714('0x4')),'mailInteraction':require(_0xc714('0x5')),'faxInteraction':require(_0xc714('0x6')),'whatsappInteraction':require(_0xc714('0x7'))};var logger=require(_0xc714('0x8'))(_0xc714('0x9'));var tag=schema({'tag':{'type':_0xc714('0xa'),'required':!![],'message':_0xc714('0xb')}});exports[_0xc714('0xc')]=function(_0x3a2da8,_0x4b45be,_0x172985,_0x590d8e){return function(_0x5b9d9f){try{var _0x3ae650={'tag':_0x4b45be[0x0]};var _0x173563=tag['validate'](_0x3ae650,{'typecast':!![]});if(_0x173563[_0xc714('0xd')]){logger[_0xc714('0xe')]('[%s][TAG]\x20%s',_0x3a2da8,_[_0xc714('0xf')](_0x173563,_0xc714('0x10'))[_0xc714('0x11')](',\x20'));logger[_0xc714('0x12')](_0xc714('0x13'),_0x3a2da8);_0x5b9d9f[_0xc714('0x14')]();}else{var _0x3859d1={'ids':[_0x4b45be[0x0]]};if(rpc[_0x590d8e['channel']+'Interaction']){rpc[_0x590d8e[_0xc714('0x15')]+_0xc714('0x16')][_0xc714('0x17')](_0x590d8e[_0xc714('0x18')]['id'],_0x3859d1)[_0xc714('0x19')](function(_0x36ff0d){logger[_0xc714('0x12')](_0xc714('0x1a'),_0x3a2da8,_0x4b45be[0x1],_0x590d8e[_0xc714('0x15')],_0x590d8e['interaction']['id']);})['catch'](function(_0x50bd02){logger[_0xc714('0xe')](_0xc714('0x1b'),_0x3a2da8,JSON['stringify'](_0x50bd02));logger[_0xc714('0x12')](_0xc714('0x13'),_0x3a2da8);})[_0xc714('0x1c')](function(){_0x5b9d9f[_0xc714('0x14')]();});}}}catch(_0x38e724){logger['error'](_0xc714('0x1b'),_0x3a2da8,_['isObject'](_0x38e724)?JSON[_0xc714('0x1d')](_0x38e724):_0x38e724);logger[_0xc714('0x12')](_0xc714('0x13'),_0x3a2da8);_0x5b9d9f[_0xc714('0x14')]();}};}; \ 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 96cdbd8..8ea8c8c 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 _0x89f5=['&serviceId=','&sessionId=','&data=','info','stop','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','consequence','replace','push','?params=','urlOnRing','jsonrpc','2.0','method','params','stringify','utf8','POST','application/json-rpc','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId='];(function(_0x1deb72,_0x3f6338){var _0x18bbdf=function(_0x1b4b9b){while(--_0x1b4b9b){_0x1deb72['push'](_0x1deb72['shift']());}};_0x18bbdf(++_0x3f6338);}(_0x89f5,0x1e6));var _0x589f=function(_0x2da0d6,_0x135efb){_0x2da0d6=_0x2da0d6-0x0;var _0x5de53f=_0x89f5[_0x2da0d6];return _0x5de53f;};'use strict';var rp=require(_0x589f('0x0'));var logger=require(_0x589f('0x1'))('routing');var _=require('lodash');var arr=[];exports[_0x589f('0x2')]=function(_0x3f1df7,_0x2a0975){return function(_0x1d4d6c){var _0x1ef1b8=_0x2a0975[0xa];var _0x2cc71a=_0x2a0975[0xb];var _0x12c906=_0x2a0975[0xc];var _0x2bd1be=_0x2a0975[0xd];var _0x240c04=_0x2a0975[0xe];var _0x404dc0=_0x2a0975[0xf][_0x589f('0x3')](/\n/g,'\x20-\x20');var _0x1a5ce5=_0x2a0975[0x10][_0x589f('0x3')](/\n/g,'\x20');if(!arr['includes'](_0x2cc71a)){arr[_0x589f('0x4')](_0x2cc71a);var _0x3c99ba=_0x2a0975[0x3];var _0xcf3fa8=_0x2a0975[0x4];var _0x3c98c5=_0x2a0975[0x1];var _0x10b6b1=_0x2a0975[0x0];var _0x5954f2={};_0x5954f2['urlOnAnswer']=_0x2a0975[0x8]+_0x589f('0x5')+_0x12c906+'|'+_0x1ef1b8+'|'+_0x2bd1be+'|'+_0x2cc71a+'|'+_0x240c04;_0x5954f2[_0x589f('0x6')]=_0x2a0975[0x7]+_0x589f('0x5')+_0x12c906+'|'+_0x1ef1b8+'|'+_0x2bd1be+'|'+_0x2cc71a+'|'+_0x240c04+'|'+_0x404dc0+'|'+_0x1a5ce5;_0x5954f2['title']=_0x2a0975[0x9];var _0xbec777={};_0xbec777[_0x589f('0x7')]=_0x589f('0x8');_0xbec777[_0x589f('0x9')]='login';var _0x398f68=[];_0x398f68[_0x589f('0x4')](_0x2a0975[0x2]);_0x398f68[_0x589f('0x4')](_0x2a0975[0x5]);_0x398f68[_0x589f('0x4')](_0x2a0975[0x6]);_0xbec777[_0x589f('0xa')]=_0x398f68;_0xbec777['id']=0x1;var _0x12e59c=JSON[_0x589f('0xb')](_0xbec777);var _0x772659={'encoding':_0x589f('0xc'),'method':_0x589f('0xd'),'timeout':0x2710,'url':_0x3c99ba,'headers':{'Content-Type':_0x589f('0xe')},'body':_0x12e59c};return rp(_0x772659)['then'](function(_0x3ad584){const _0x1494bb=JSON['parse'](_0x3ad584);if(!_0x1494bb['result'][_0x589f('0xf')]){throw new Error(_0x589f('0x10'));}var _0x50d7a9=_0x2cc71a;var _0x3ba071=_0x589f('0x11')+_0x3c98c5+_0x589f('0x12')+_0x10b6b1+_0x589f('0x13')+_0x50d7a9+_0x589f('0x14')+JSON['stringify'](_0x5954f2);var _0x2d635e=_0xcf3fa8+'?'+_0x3ba071;return rp(_0x2d635e);})['then'](function(_0x1098f1){logger[_0x589f('0x15')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x3f1df7,_0x1098f1);_0x1d4d6c[_0x589f('0x16')]();})['catch'](function(_0x435e45){logger[_0x589f('0x17')](_0x589f('0x18'),_0x3f1df7,_[_0x589f('0x19')](_0x435e45)?JSON[_0x589f('0xb')](_0x435e45):_0x435e45);_0x1d4d6c['stop']();});}else{logger[_0x589f('0x15')](_0x589f('0x1a'),_0x3f1df7);_0x1d4d6c[_0x589f('0x1b')]();}};}; \ No newline at end of file +var _0x27d0=['\x20-\x20','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','method','params','stringify','POST','application/json-rpc','then','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','lodash','replace'];(function(_0x51d59d,_0x1a3233){var _0x49687a=function(_0x504abf){while(--_0x504abf){_0x51d59d['push'](_0x51d59d['shift']());}};_0x49687a(++_0x1a3233);}(_0x27d0,0x6c));var _0x027d=function(_0xc926b7,_0xa6e261){_0xc926b7=_0xc926b7-0x0;var _0x30aff8=_0x27d0[_0xc926b7];return _0x30aff8;};'use strict';var rp=require('request-promise');var logger=require(_0x027d('0x0'))(_0x027d('0x1'));var _=require(_0x027d('0x2'));var arr=[];exports['consequence']=function(_0x5ea018,_0x2a79ac){return function(_0x24123a){var _0x39a3c3=_0x2a79ac[0xa];var _0x6cdbb6=_0x2a79ac[0xb];var _0x464829=_0x2a79ac[0xc];var _0x12dc5e=_0x2a79ac[0xd];var _0x4dd7d3=_0x2a79ac[0xe];var _0x3890a0=_0x2a79ac[0xf][_0x027d('0x3')](/\n/g,_0x027d('0x4'));var _0x470c44=_0x2a79ac[0x10][_0x027d('0x3')](/\n/g,'\x20');if(!arr['includes'](_0x6cdbb6)){arr[_0x027d('0x5')](_0x6cdbb6);var _0x225b99=_0x2a79ac[0x3];var _0xf6e611=_0x2a79ac[0x4];var _0x267622=_0x2a79ac[0x1];var _0x833510=_0x2a79ac[0x0];var _0x545fd5={};_0x545fd5[_0x027d('0x6')]=_0x2a79ac[0x8]+_0x027d('0x7')+_0x464829+'|'+_0x39a3c3+'|'+_0x12dc5e+'|'+_0x6cdbb6+'|'+_0x4dd7d3;_0x545fd5[_0x027d('0x8')]=_0x2a79ac[0x7]+_0x027d('0x7')+_0x464829+'|'+_0x39a3c3+'|'+_0x12dc5e+'|'+_0x6cdbb6+'|'+_0x4dd7d3+'|'+_0x3890a0+'|'+_0x470c44;_0x545fd5[_0x027d('0x9')]=_0x2a79ac[0x9];var _0x47bdb4={};_0x47bdb4[_0x027d('0xa')]='2.0';_0x47bdb4[_0x027d('0xb')]='login';var _0x2c89f8=[];_0x2c89f8[_0x027d('0x5')](_0x2a79ac[0x2]);_0x2c89f8[_0x027d('0x5')](_0x2a79ac[0x5]);_0x2c89f8[_0x027d('0x5')](_0x2a79ac[0x6]);_0x47bdb4[_0x027d('0xc')]=_0x2c89f8;_0x47bdb4['id']=0x1;var _0x2cfde6=JSON[_0x027d('0xd')](_0x47bdb4);var _0x2c5bc0={'encoding':'utf8','method':_0x027d('0xe'),'timeout':0x2710,'url':_0x225b99,'headers':{'Content-Type':_0x027d('0xf')},'body':_0x2cfde6};return rp(_0x2c5bc0)[_0x027d('0x10')](function(_0x26f317){const _0x320672=JSON['parse'](_0x26f317);if(!_0x320672['result'][_0x027d('0x11')]){throw new Error(_0x027d('0x12'));}var _0x436bd3=_0x6cdbb6;var _0xb2b23e=_0x027d('0x13')+_0x267622+_0x027d('0x14')+_0x833510+_0x027d('0x15')+_0x436bd3+_0x027d('0x16')+JSON[_0x027d('0xd')](_0x545fd5);var _0x24dcd4=_0xf6e611+'?'+_0xb2b23e;return rp(_0x24dcd4);})[_0x027d('0x10')](function(_0x56718f){logger['info'](_0x027d('0x17'),_0x5ea018,_0x56718f);_0x24123a[_0x027d('0x18')]();})['catch'](function(_0x359771){logger['error'](_0x027d('0x19'),_0x5ea018,_['isObject'](_0x359771)?JSON[_0x027d('0xd')](_0x359771):_0x359771);_0x24123a[_0x027d('0x18')]();});}else{logger['info'](_0x027d('0x1a'),_0x5ea018);_0x24123a[_0x027d('0x1b')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index d42bcaa..2ce7889 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(_0x219427,_0x48f425){var _0x2fb6cf=function(_0x5b7e86){while(--_0x5b7e86){_0x219427['push'](_0x219427['shift']());}};_0x2fb6cf(++_0x48f425);}(_0xe706,0xa3));var _0x6e70=function(_0x37a45b,_0x1056ef){_0x37a45b=_0x37a45b-0x0;var _0x35f3bb=_0xe706[_0x37a45b];return _0x35f3bb;};'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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x253c77,_0x7e4395){var _0x1a34d6=function(_0x3c8e24){while(--_0x3c8e24){_0x253c77['push'](_0x253c77['shift']());}};_0x1a34d6(++_0x7e4395);}(_0xe706,0xa3));var _0x6e70=function(_0x1ca6a4,_0x2a7743){_0x1ca6a4=_0x1ca6a4-0x0;var _0x105953=_0xe706[_0x1ca6a4];return _0x105953;};'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 diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index cf0b1dd..2133b05 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 _0x2c91=['error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','CurrentCapacity','capacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','paused','mailQueues','name','openchannelQueues','smsQueues','faxQueues','waiting','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','format','%s:%s:%s','./interval','condition','./applications/','priority','info','Push\x20new\x20rule','intervals','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','stringify','matchPath','emit','Skipped\x20routing\x20for\x20%s','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0x2c91,0x158));var _0x12c9=function(_0x260c0a,_0x1fd40e){_0x260c0a=_0x260c0a-0x0;var _0x3e66aa=_0x2c91[_0x260c0a];return _0x3e66aa;};'use strict';var _=require(_0x12c9('0x0'));var util=require(_0x12c9('0x1'));var path=require(_0x12c9('0x2'));var fs=require('fs');var jayson=require(_0x12c9('0x3'));var BPromise=require(_0x12c9('0x4'));var utils=require(_0x12c9('0x5'));var sUtils=require(_0x12c9('0x6'));var logger=require(_0x12c9('0x7'))('routing');var rpc={'openchannelQueueReport':require(_0x12c9('0x8')),'mailQueueReport':require(_0x12c9('0x9')),'chatQueueReport':require(_0x12c9('0xa')),'smsQueueReport':require(_0x12c9('0xb')),'faxQueueReport':require(_0x12c9('0xc')),'whatsappQueueReport':require(_0x12c9('0xd'))};var RuleEngine=require(_0x12c9('0xe'));function getId(_0x55c40a,_0x283633,_0x2cbffe){return util['format'](_0x12c9('0xf'),_0x55c40a,_0x283633||0x0,_0x2cbffe||0x0);}function getIntervals(_0x397004,_0x4fa1de){var _0x6addcf=[];if(!_[_0x12c9('0x10')](_0x4fa1de['IntervalId'])&&!_[_0x12c9('0x10')](_0x397004[_0x4fa1de[_0x12c9('0x11')]])&&!_['isNil'](_0x397004[_0x4fa1de[_0x12c9('0x11')]][_0x12c9('0x12')])){_0x6addcf=_[_0x12c9('0x13')](_0x397004[_0x4fa1de[_0x12c9('0x11')]][_0x12c9('0x12')],_0x12c9('0x14'));}else if(!_['isNil'](_0x4fa1de[_0x12c9('0x14')])){_0x6addcf=[_0x4fa1de[_0x12c9('0x14')]];}return _0x6addcf;}exports[_0x12c9('0x15')]=function(_0x4d0388){_0x4d0388['rules']={};return new BPromise(function(_0x490854,_0x4e20b0){var _0x57b3a6={'Start':function(_0x9fa35){var _0x4e4cbf=this;return new Promise(function(_0x3a83b4,_0x4460d5){if(_0x9fa35){try{var _0x1d7716=[];var _0x146506=getId(_0x9fa35[_0x12c9('0x16')],_0x9fa35['message']?_0x9fa35[_0x12c9('0x17')]['id']:0x0,_0x9fa35[_0x12c9('0x18')]?_0x9fa35[_0x12c9('0x18')]['id']:0x0);var _0x38c12e=sUtils[_0x12c9('0x19')](_0x4d0388,_0x9fa35);if(_0x9fa35[_0x12c9('0x1a')]||!_0x38c12e&&_0x9fa35[_0x12c9('0x1b')]&&_[_0x12c9('0x1c')](_0x9fa35['applications'])&&_0x9fa35[_0x12c9('0x1b')]['length']){for(var _0x38ba03=0x0;_0x38ba03<_0x9fa35[_0x12c9('0x1b')][_0x12c9('0x1d')];_0x38ba03+=0x1){var _0x17675e=_0x9fa35[_0x12c9('0x1b')][_0x38ba03];if(fs['existsSync'](path[_0x12c9('0x1e')](__dirname,_0x12c9('0x1b'),_0x17675e[_0x12c9('0x1f')]+_0x12c9('0x20')))){var _0x370126=[];switch(_0x17675e[_0x12c9('0x1f')][_0x12c9('0x21')]()){case _0x12c9('0x22'):var _0x210a77=_0x17675e[_0x12c9('0x23')][_0x12c9('0x24')](',');if(_0x9fa35['channel']===_0x12c9('0x25')){_0x370126[_0x12c9('0x26')](_0x210a77[0x0]);_0x370126[_0x12c9('0x26')](_0x210a77[0x1]);_0x370126[_0x12c9('0x26')](_0x210a77[_0x12c9('0x27')](0x2,_0x210a77[_0x12c9('0x1d')])[_0x12c9('0x1e')](','));}else{_0x370126[_0x12c9('0x26')](_0x210a77[0x0]);_0x370126[_0x12c9('0x26')](_0x210a77[_0x12c9('0x27')](0x1,_0x210a77[_0x12c9('0x1d')])[_0x12c9('0x1e')](','));}break;case _0x12c9('0x28'):var _0x2224ce=_0x17675e[_0x12c9('0x23')][_0x12c9('0x24')](',');_0x370126[_0x12c9('0x26')](_0x2224ce[0x0]);_0x370126[_0x12c9('0x26')](_0x2224ce[0x1]);_0x370126[_0x12c9('0x26')](_0x2224ce[_0x12c9('0x27')](0x2,_0x2224ce['length'])[_0x12c9('0x1e')](','));break;case _0x12c9('0x29'):var _0x125154=_0x17675e[_0x12c9('0x23')][_0x12c9('0x24')](',');_0x370126[_0x12c9('0x26')](_0x125154[0x0]);_0x370126[_0x12c9('0x26')](_0x125154[0x1]);_0x370126['push'](_0x125154[0x2]);_0x370126[_0x12c9('0x26')](_0x125154[0x3]);_0x370126[_0x12c9('0x26')](_0x125154[_0x12c9('0x27')](0x4,_0x125154[_0x12c9('0x1d')])[_0x12c9('0x1e')](','));break;case'amazonlex':var _0x238239=_0x17675e['appdata'][_0x12c9('0x24')](',');_0x370126[_0x12c9('0x26')](_0x238239[0x0]);_0x370126[_0x12c9('0x26')](_0x238239[0x1]);_0x370126[_0x12c9('0x26')](_0x238239[0x2]);_0x370126[_0x12c9('0x26')](_0x238239[0x3]);_0x370126[_0x12c9('0x26')](_0x238239[_0x12c9('0x27')](0x4,_0x238239[_0x12c9('0x1d')])[_0x12c9('0x1e')](','));break;case'message':_0x370126['push'](_0x17675e[_0x12c9('0x23')]);break;case _0x12c9('0x2a'):_0x370126[_0x12c9('0x26')](_0x17675e[_0x12c9('0x2b')]);_0x370126[_0x12c9('0x26')](_0x17675e[_0x12c9('0x23')]);break;case _0x12c9('0x2c'):var _0x5bec7a=utils[_0x12c9('0x2d')](_0x9fa35[_0x12c9('0x2e')][_0x12c9('0x2f')],_0x9fa35);var _0x49958b=_0x17675e[_0x12c9('0x23')][_0x12c9('0x24')](',');_0x370126['push'](_0x49958b[0x0]);_0x370126[_0x12c9('0x26')](_0x49958b[0x1]);_0x370126[_0x12c9('0x26')](_0x49958b[0x2]);_0x370126[_0x12c9('0x26')](_0x49958b[0x3]);_0x370126['push'](_0x49958b[0x4]);_0x370126[_0x12c9('0x26')](_0x49958b[0x5]);_0x370126[_0x12c9('0x26')](_0x49958b[0x6]);_0x370126[_0x12c9('0x26')](_0x49958b[0x7]);_0x370126[_0x12c9('0x26')](_0x49958b[0x8]);_0x370126[_0x12c9('0x26')](_0x49958b[0x9]);_0x370126[_0x12c9('0x26')](_0x49958b[0xa]);_0x370126[_0x12c9('0x26')](_0x9fa35[_0x12c9('0x18')]['id']);_0x370126[_0x12c9('0x26')](_0x9fa35[_0x12c9('0x17')]['id']);_0x370126['push'](_0x17675e[_0x12c9('0x30')]);_0x370126[_0x12c9('0x26')](_0x9fa35[_0x12c9('0x18')][_0x12c9('0x31')]);_0x370126[_0x12c9('0x26')](_0x9fa35['body'][_0x12c9('0x32')]);_0x370126['push'](_0x5bec7a);break;default:_0x370126=_[_0x12c9('0x10')](_0x17675e[_0x12c9('0x23')])?[]:_0x17675e[_0x12c9('0x23')]['split'](',');}var _0x4c4324={'id':util[_0x12c9('0x33')](_0x12c9('0x34'),_0x146506,_0x17675e['id'],_0x17675e[_0x12c9('0x1f')]),'condition':require(_0x12c9('0x35'))[_0x12c9('0x36')](_0x146506,getIntervals(_0x4d0388['intervals'],_0x17675e),_0x4d0388),'consequence':require(_0x12c9('0x37')+_0x17675e[_0x12c9('0x1f')])['consequence'](_0x146506,_0x370126,_0x4d0388,_0x9fa35),'p':_0x17675e[_0x12c9('0x38')]||0x0};logger[_0x12c9('0x39')](_0x12c9('0x3a'),_0x4c4324['id'],'on\x20interval',getIntervals(_0x4d0388[_0x12c9('0x3b')],_0x17675e)[_0x12c9('0x1e')]('\x20|\x20'));_0x1d7716[_0x12c9('0x26')](_0x4c4324);}else{logger[_0x12c9('0x3c')](_0x12c9('0x3d'),path[_0x12c9('0x1e')](__dirname,_0x12c9('0x1b'),_0x17675e[_0x12c9('0x1f')]+_0x12c9('0x20')));}}_0x4d0388['rules'][_0x146506]=new RuleEngine(_0x1d7716);_0x4d0388[_0x12c9('0x3e')][_0x146506][_0x12c9('0x3f')](_0x9fa35,function(_0x49a9a1){logger[_0x12c9('0x39')](_0x12c9('0x40'),JSON[_0x12c9('0x41')](_0x49a9a1[_0x12c9('0x42')]));if(_0x4d0388[_0x12c9('0x3e')][_0x146506]){_0x4d0388[_0x12c9('0x3e')][_0x146506][_0x12c9('0x43')]('complete');}});return _0x3a83b4({'code':0xc8,'message':_0x9fa35});}else{if(_0x38c12e){logger[_0x12c9('0x39')](util['format'](_0x12c9('0x44'),_0x146506));}else{logger['info']('No\x20applications\x20to\x20execute');}return _0x3a83b4({'code':0xc8,'message':_0x9fa35});}}catch(_0x5a1281){logger[_0x12c9('0x3c')](_0x5a1281['stack']);return _0x4460d5(_0x4e4cbf[_0x12c9('0x3c')](0x1f4,_0x5a1281));}}return _0x4460d5(_0x12c9('0x45'));});},'AcceptMessage':function(_0x2e3fee){var _0x44ef48=this;return new Promise(function(_0x443570,_0x2a482f){if(_0x2e3fee[_0x12c9('0x46')]&&_0x2e3fee['agent']['id']){if(_0x4d0388[_0x12c9('0x47')][_0x2e3fee[_0x12c9('0x46')]['id']]){_0x4d0388[_0x12c9('0x47')][_0x2e3fee[_0x12c9('0x46')]['id']]['busy']=![];_0x4d0388[_0x12c9('0x47')][_0x2e3fee['agent']['id']][_0x12c9('0x48')]=undefined;}}if(_0x2e3fee[_0x12c9('0x17')]&&_0x2e3fee[_0x12c9('0x17')]['id']){try{var _0x1dcdea=getId(_0x2e3fee['channel'],_0x2e3fee[_0x12c9('0x17')]?_0x2e3fee[_0x12c9('0x17')]['id']:0x0,_0x2e3fee[_0x12c9('0x18')]?_0x2e3fee['interaction']['id']:0x0);if(_0x4d0388[_0x12c9('0x3e')][_0x1dcdea]){_0x4d0388['rules'][_0x1dcdea][_0x12c9('0x43')](_0x12c9('0x49'));if(rpc[_0x2e3fee['channel']+'QueueReport']){rpc[_0x2e3fee['channel']+_0x12c9('0x4a')][_0x12c9('0x4b')](_0x1dcdea,{'UserId':_0x2e3fee[_0x12c9('0x17')]['UserId']})['catch'](function(){logger[_0x12c9('0x3c')](_0x12c9('0x4c'));});}}return _0x443570({'code':0xc8,'message':_0x2e3fee});}catch(_0x5b8695){logger[_0x12c9('0x3c')](_0x5b8695[_0x12c9('0x4d')]);return _0x2a482f(_0x44ef48[_0x12c9('0x3c')](0x1f4,_0x5b8695));}}logger[_0x12c9('0x3c')](_0x12c9('0x4e'));return _0x2a482f(_0x44ef48[_0x12c9('0x3c')](0x1f4,_0x12c9('0x4e')));});},'RejectMessage':function(_0x434ab3){var _0x5a9bcc=this;return new Promise(function(_0x45eda7,_0x3ba110){if(_0x434ab3[_0x12c9('0x46')]&&_0x434ab3[_0x12c9('0x46')]['id']){try{if(_0x4d0388[_0x12c9('0x47')][_0x434ab3['agent']['id']]){_0x4d0388['agents'][_0x434ab3[_0x12c9('0x46')]['id']]['busy']=![];_0x4d0388['agents'][_0x434ab3[_0x12c9('0x46')]['id']][_0x12c9('0x48')]=undefined;}return _0x45eda7({'code':0xc8,'message':_0x434ab3});}catch(_0x494c33){logger[_0x12c9('0x3c')](_0x494c33[_0x12c9('0x4d')]);return _0x3ba110(_0x5a9bcc[_0x12c9('0x3c')](0x1f4,_0x494c33));}}logger[_0x12c9('0x3c')](_0x12c9('0x4e'));return _0x3ba110(_0x5a9bcc[_0x12c9('0x3c')](0x1f4,_0x12c9('0x4e')));});},'AbandonInteraction':function(_0xd7f3c2){var _0x2662d7=this;return new Promise(function(_0x22b7c2,_0x7cbae8){if(_0xd7f3c2[_0x12c9('0x16')]&&_0xd7f3c2[_0x12c9('0x18')]&&_0xd7f3c2[_0x12c9('0x18')]['id']){try{var _0x422411=getId(_0xd7f3c2[_0x12c9('0x16')],_0xd7f3c2['message']?_0xd7f3c2[_0x12c9('0x17')]['id']:0x0,_0xd7f3c2[_0x12c9('0x18')]?_0xd7f3c2[_0x12c9('0x18')]['id']:0x0);if(_0x4d0388[_0x12c9('0x3e')][_0x422411]){_0x4d0388[_0x12c9('0x3e')][_0x422411][_0x12c9('0x43')](_0x12c9('0x49'));}return _0x22b7c2({'code':0xc8,'message':_0xd7f3c2});}catch(_0xae69aa){logger[_0x12c9('0x3c')](_0xae69aa[_0x12c9('0x4d')]);return _0x7cbae8(_0x2662d7['error'](0x1f4,_0xae69aa));}}logger[_0x12c9('0x3c')]('message\x20is\x20empty');return _0x7cbae8(_0x2662d7[_0x12c9('0x3c')](0x1f4,_0x12c9('0x4e')));});},'AgentCapacity':function(_0x34cf97){var _0x4493a5=this;return new Promise(function(_0x4f1ba2,_0xdd8c25){if(_0x4d0388[_0x12c9('0x47')][_0x12c9('0x4f')](_0x34cf97['id'])){for(var _0x1c3edc in _0x34cf97['capacity']){if(_0x34cf97['capacity']['hasOwnProperty'](_0x1c3edc)){if(_0x4d0388[_0x12c9('0x47')][_0x34cf97['id']][_0x12c9('0x4f')](_0x1c3edc+_0x12c9('0x50'))){_0x4d0388[_0x12c9('0x47')][_0x34cf97['id']][_0x1c3edc+_0x12c9('0x50')]=parseInt(_0x34cf97[_0x12c9('0x51')][_0x1c3edc],0xa);}}}_0x4d0388['agents'][_0x34cf97['id']][_0x12c9('0x52')]();return _0x4f1ba2({'code':0xc8,'message':_0x4d0388[_0x12c9('0x47')][_0x34cf97['id']]});}else{return _0xdd8c25(_0x4493a5[_0x12c9('0x3c')](0x1f4,_0x12c9('0x53')));}});},'Agents':function(_0x1fe4b6){return new Promise(function(_0x2d4b49){var _0x12b71c=_[_0x12c9('0x54')](_0x4d0388['agents']);if(_0x1fe4b6&&_0x1fe4b6['id']){var _0xf85ec8=_[_0x12c9('0x55')](_0x12b71c,function(_0x3441f8){return _0x3441f8['id']===_0x1fe4b6['id'];});_0x2d4b49(_0xf85ec8);}else{_0x2d4b49({'count':_0x12b71c[_0x12c9('0x1d')],'rows':_0x12b71c});}});},'ChatQueues':function(){return new Promise(function(_0x4779d3){var _0x35a689=[];for(var _0x2d042e in _0x4d0388['chatQueues']){if(_0x4d0388[_0x12c9('0x56')][_0x12c9('0x4f')](_0x2d042e)){var _0x2e41e1=_0x4d0388[_0x12c9('0x56')][_0x2d042e];var _0x31eba1={'id':_0x2e41e1['id'],'available':_0x2e41e1[_0x12c9('0x57')],'loggedIn':_0x2e41e1[_0x12c9('0x58')],'name':_0x2e41e1['name'],'paused':_0x2e41e1[_0x12c9('0x59')],'waiting':_0x2e41e1['waiting']};_0x35a689['push'](_0x31eba1);}}_0x4779d3({'count':_0x35a689[_0x12c9('0x1d')],'rows':_0x35a689});});},'MailQueues':function(){return new Promise(function(_0x39ce7b){var _0x57e31a=[];for(var _0x1f84e7 in _0x4d0388['mailQueues']){if(_0x4d0388[_0x12c9('0x5a')][_0x12c9('0x4f')](_0x1f84e7)){var _0x10cec1=_0x4d0388[_0x12c9('0x5a')][_0x1f84e7];var _0x589648={'id':_0x10cec1['id'],'available':_0x10cec1[_0x12c9('0x57')],'loggedIn':_0x10cec1[_0x12c9('0x58')],'name':_0x10cec1[_0x12c9('0x5b')],'paused':_0x10cec1[_0x12c9('0x59')],'waiting':_0x10cec1['waiting']};_0x57e31a[_0x12c9('0x26')](_0x589648);}}_0x39ce7b({'count':_0x57e31a[_0x12c9('0x1d')],'rows':_0x57e31a});});},'OpenchannelQueues':function(){return new Promise(function(_0x25cdc8){var _0x4b1072=[];for(var _0x12dfd4 in _0x4d0388[_0x12c9('0x5c')]){if(_0x4d0388['openchannelQueues'][_0x12c9('0x4f')](_0x12dfd4)){var _0x2917db=_0x4d0388[_0x12c9('0x5c')][_0x12dfd4];var _0xe915d7={'id':_0x2917db['id'],'available':_0x2917db[_0x12c9('0x57')],'loggedIn':_0x2917db['loggedIn'],'name':_0x2917db[_0x12c9('0x5b')],'paused':_0x2917db['paused'],'waiting':_0x2917db['waiting']};_0x4b1072[_0x12c9('0x26')](_0xe915d7);}}_0x25cdc8({'count':_0x4b1072[_0x12c9('0x1d')],'rows':_0x4b1072});});},'SmsQueues':function(){return new Promise(function(_0x55c11f){var _0x5f1d23=[];for(var _0x5e4cf0 in _0x4d0388[_0x12c9('0x5d')]){if(_0x4d0388[_0x12c9('0x5d')]['hasOwnProperty'](_0x5e4cf0)){var _0x3c1c8a=_0x4d0388[_0x12c9('0x5d')][_0x5e4cf0];var _0x3f201a={'id':_0x3c1c8a['id'],'available':_0x3c1c8a['available'],'loggedIn':_0x3c1c8a[_0x12c9('0x58')],'name':_0x3c1c8a['name'],'paused':_0x3c1c8a[_0x12c9('0x59')],'waiting':_0x3c1c8a['waiting']};_0x5f1d23[_0x12c9('0x26')](_0x3f201a);}}_0x55c11f({'count':_0x5f1d23[_0x12c9('0x1d')],'rows':_0x5f1d23});});},'FaxQueues':function(){return new Promise(function(_0x2857ca){var _0x13bea6=[];for(var _0x467b66 in _0x4d0388['faxQueues']){if(_0x4d0388[_0x12c9('0x5e')][_0x12c9('0x4f')](_0x467b66)){var _0x53945c=_0x4d0388['faxQueues'][_0x467b66];var _0x1dce7a={'id':_0x53945c['id'],'available':_0x53945c[_0x12c9('0x57')],'loggedIn':_0x53945c[_0x12c9('0x58')],'name':_0x53945c[_0x12c9('0x5b')],'paused':_0x53945c[_0x12c9('0x59')],'waiting':_0x53945c[_0x12c9('0x5f')]};_0x13bea6[_0x12c9('0x26')](_0x1dce7a);}}_0x2857ca({'count':_0x13bea6[_0x12c9('0x1d')],'rows':_0x13bea6});});},'WhatsappQueues':function(){return new Promise(function(_0xb58388){var _0x5b031a=[];for(var _0x31c845 in _0x4d0388[_0x12c9('0x60')]){if(_0x4d0388[_0x12c9('0x60')]['hasOwnProperty'](_0x31c845)){var _0x55579c=_0x4d0388['whatsappQueues'][_0x31c845];var _0x193550={'id':_0x55579c['id'],'available':_0x55579c[_0x12c9('0x57')],'loggedIn':_0x55579c[_0x12c9('0x58')],'name':_0x55579c['name'],'paused':_0x55579c[_0x12c9('0x59')],'waiting':_0x55579c['waiting']};_0x5b031a[_0x12c9('0x26')](_0x193550);}}_0xb58388({'count':_0x5b031a[_0x12c9('0x1d')],'rows':_0x5b031a});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x3dff8e){var _0x2f9fe6=_[_0x12c9('0x54')](_0x4d0388['chatQueuesWaitingInteractions']);_0x3dff8e({'count':_0x2f9fe6[_0x12c9('0x1d')],'rows':_0x2f9fe6});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x3c80e7){var _0x57b87a=_[_0x12c9('0x54')](_0x4d0388[_0x12c9('0x61')]);_0x3c80e7({'count':_0x57b87a[_0x12c9('0x1d')],'rows':_0x57b87a});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x2fb544){var _0x3dc0e3=_[_0x12c9('0x54')](_0x4d0388[_0x12c9('0x62')]);_0x2fb544({'count':_0x3dc0e3['length'],'rows':_0x3dc0e3});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x4d33b0){var _0x58fd5c=_[_0x12c9('0x54')](_0x4d0388['smsQueuesWaitingInteractions']);_0x4d33b0({'count':_0x58fd5c[_0x12c9('0x1d')],'rows':_0x58fd5c});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x48fde3){var _0x4d9e4b=_[_0x12c9('0x54')](_0x4d0388['faxQueuesWaitingInteractions']);_0x48fde3({'count':_0x4d9e4b[_0x12c9('0x1d')],'rows':_0x4d9e4b});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1027d7){var _0x47a0c2=_[_0x12c9('0x54')](_0x4d0388[_0x12c9('0x63')]);_0x1027d7({'count':_0x47a0c2[_0x12c9('0x1d')],'rows':_0x47a0c2});});}};var _0x35a087=jayson[_0x12c9('0x64')](_0x57b3a6)[_0x12c9('0x65')]();_0x35a087['on'](_0x12c9('0x3c'),function(_0x3979b8){logger[_0x12c9('0x3c')](JSON['stringify'](_0x3979b8));return _0x4e20b0(_0x3979b8);});_0x35a087[_0x12c9('0x15')](0x232c,_0x12c9('0x66'),function(){console[_0x12c9('0x67')](_0x12c9('0x68'),0x232c);return _0x490854('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xfa9f=['info','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','stack','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','paused','waiting','mailQueues','openchannelQueues','name','smsQueues','loggedIn','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','./applications/utils','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','transfer','isArray','applications','length','existsSync','join','app','.js','appdata','split','push','slice','dialogflow','amazonlex','tag','TagId','tvox','account','ChatWebsiteId','ContactId','format','./interval','condition','consequence','priority'];(function(_0x8fff19,_0x53ffde){var _0x13557f=function(_0x437616){while(--_0x437616){_0x8fff19['push'](_0x8fff19['shift']());}};_0x13557f(++_0x53ffde);}(_0xfa9f,0x93));var _0xffa9=function(_0x43de22,_0x1eced6){_0x43de22=_0x43de22-0x0;var _0x4b15ee=_0xfa9f[_0x43de22];return _0x4b15ee;};'use strict';var _=require('lodash');var util=require(_0xffa9('0x0'));var path=require(_0xffa9('0x1'));var fs=require('fs');var jayson=require(_0xffa9('0x2'));var BPromise=require(_0xffa9('0x3'));var utils=require(_0xffa9('0x4'));var sUtils=require('./applications/strategy/util');var logger=require(_0xffa9('0x5'))('routing');var rpc={'openchannelQueueReport':require(_0xffa9('0x6')),'mailQueueReport':require(_0xffa9('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xffa9('0x8')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0xffa9('0x9'));function getId(_0x1fe931,_0x249501,_0x13c3d0){return util['format'](_0xffa9('0xa'),_0x1fe931,_0x249501||0x0,_0x13c3d0||0x0);}function getIntervals(_0x1685c7,_0x387e98){var _0x3a7a1a=[];if(!_[_0xffa9('0xb')](_0x387e98[_0xffa9('0xc')])&&!_[_0xffa9('0xb')](_0x1685c7[_0x387e98[_0xffa9('0xc')]])&&!_[_0xffa9('0xb')](_0x1685c7[_0x387e98[_0xffa9('0xc')]][_0xffa9('0xd')])){_0x3a7a1a=_['map'](_0x1685c7[_0x387e98[_0xffa9('0xc')]][_0xffa9('0xd')],_0xffa9('0xe'));}else if(!_[_0xffa9('0xb')](_0x387e98[_0xffa9('0xe')])){_0x3a7a1a=[_0x387e98[_0xffa9('0xe')]];}return _0x3a7a1a;}exports[_0xffa9('0xf')]=function(_0x3242de){_0x3242de[_0xffa9('0x10')]={};return new BPromise(function(_0x3dd57f,_0x5812d0){var _0x42205d={'Start':function(_0x53401b){var _0x6e09fe=this;return new Promise(function(_0x13bee9,_0x54cae8){if(_0x53401b){try{var _0x7ad8ba=[];var _0x2eacc0=getId(_0x53401b[_0xffa9('0x11')],_0x53401b['message']?_0x53401b[_0xffa9('0x12')]['id']:0x0,_0x53401b[_0xffa9('0x13')]?_0x53401b[_0xffa9('0x13')]['id']:0x0);var _0x2e87a8=sUtils['checkWaitingNotifications'](_0x3242de,_0x53401b);if(_0x53401b[_0xffa9('0x14')]||!_0x2e87a8&&_0x53401b['applications']&&_[_0xffa9('0x15')](_0x53401b[_0xffa9('0x16')])&&_0x53401b[_0xffa9('0x16')][_0xffa9('0x17')]){for(var _0x6b709e=0x0;_0x6b709e<_0x53401b[_0xffa9('0x16')]['length'];_0x6b709e+=0x1){var _0x11fe72=_0x53401b[_0xffa9('0x16')][_0x6b709e];if(fs[_0xffa9('0x18')](path[_0xffa9('0x19')](__dirname,_0xffa9('0x16'),_0x11fe72[_0xffa9('0x1a')]+_0xffa9('0x1b')))){var _0x24218a=[];switch(_0x11fe72[_0xffa9('0x1a')]['toLowerCase']()){case'autoreply':var _0x30c13b=_0x11fe72[_0xffa9('0x1c')][_0xffa9('0x1d')](',');if(_0x53401b['channel']==='mail'){_0x24218a[_0xffa9('0x1e')](_0x30c13b[0x0]);_0x24218a[_0xffa9('0x1e')](_0x30c13b[0x1]);_0x24218a[_0xffa9('0x1e')](_0x30c13b['slice'](0x2,_0x30c13b['length'])[_0xffa9('0x19')](','));}else{_0x24218a['push'](_0x30c13b[0x0]);_0x24218a[_0xffa9('0x1e')](_0x30c13b[_0xffa9('0x1f')](0x1,_0x30c13b[_0xffa9('0x17')])[_0xffa9('0x19')](','));}break;case _0xffa9('0x20'):var _0x1aa814=_0x11fe72[_0xffa9('0x1c')]['split'](',');_0x24218a[_0xffa9('0x1e')](_0x1aa814[0x0]);_0x24218a[_0xffa9('0x1e')](_0x1aa814[0x1]);_0x24218a[_0xffa9('0x1e')](_0x1aa814[_0xffa9('0x1f')](0x2,_0x1aa814[_0xffa9('0x17')])[_0xffa9('0x19')](','));break;case'dialogflowv2':var _0x57d08d=_0x11fe72[_0xffa9('0x1c')][_0xffa9('0x1d')](',');_0x24218a[_0xffa9('0x1e')](_0x57d08d[0x0]);_0x24218a[_0xffa9('0x1e')](_0x57d08d[0x1]);_0x24218a[_0xffa9('0x1e')](_0x57d08d[0x2]);_0x24218a[_0xffa9('0x1e')](_0x57d08d[0x3]);_0x24218a[_0xffa9('0x1e')](_0x57d08d[_0xffa9('0x1f')](0x4,_0x57d08d[_0xffa9('0x17')])['join'](','));break;case _0xffa9('0x21'):var _0x2f0d64=_0x11fe72[_0xffa9('0x1c')]['split'](',');_0x24218a[_0xffa9('0x1e')](_0x2f0d64[0x0]);_0x24218a[_0xffa9('0x1e')](_0x2f0d64[0x1]);_0x24218a[_0xffa9('0x1e')](_0x2f0d64[0x2]);_0x24218a['push'](_0x2f0d64[0x3]);_0x24218a[_0xffa9('0x1e')](_0x2f0d64[_0xffa9('0x1f')](0x4,_0x2f0d64[_0xffa9('0x17')])['join'](','));break;case _0xffa9('0x12'):_0x24218a['push'](_0x11fe72['appdata']);break;case _0xffa9('0x22'):_0x24218a['push'](_0x11fe72[_0xffa9('0x23')]);_0x24218a[_0xffa9('0x1e')](_0x11fe72[_0xffa9('0x1c')]);break;case _0xffa9('0x24'):var _0x2f7cce=utils['getMustacheRender'](_0x53401b[_0xffa9('0x25')]['notificationTemplate'],_0x53401b);var _0x4e9dad=_0x11fe72[_0xffa9('0x1c')]['split'](',');_0x24218a[_0xffa9('0x1e')](_0x4e9dad[0x0]);_0x24218a[_0xffa9('0x1e')](_0x4e9dad[0x1]);_0x24218a['push'](_0x4e9dad[0x2]);_0x24218a['push'](_0x4e9dad[0x3]);_0x24218a[_0xffa9('0x1e')](_0x4e9dad[0x4]);_0x24218a['push'](_0x4e9dad[0x5]);_0x24218a[_0xffa9('0x1e')](_0x4e9dad[0x6]);_0x24218a[_0xffa9('0x1e')](_0x4e9dad[0x7]);_0x24218a['push'](_0x4e9dad[0x8]);_0x24218a['push'](_0x4e9dad[0x9]);_0x24218a['push'](_0x4e9dad[0xa]);_0x24218a['push'](_0x53401b[_0xffa9('0x13')]['id']);_0x24218a[_0xffa9('0x1e')](_0x53401b[_0xffa9('0x12')]['id']);_0x24218a['push'](_0x11fe72[_0xffa9('0x26')]);_0x24218a[_0xffa9('0x1e')](_0x53401b[_0xffa9('0x13')][_0xffa9('0x27')]);_0x24218a[_0xffa9('0x1e')](_0x53401b['body']['body']);_0x24218a[_0xffa9('0x1e')](_0x2f7cce);break;default:_0x24218a=_[_0xffa9('0xb')](_0x11fe72[_0xffa9('0x1c')])?[]:_0x11fe72[_0xffa9('0x1c')]['split'](',');}var _0x25af54={'id':util[_0xffa9('0x28')]('%s:%s:%s',_0x2eacc0,_0x11fe72['id'],_0x11fe72[_0xffa9('0x1a')]),'condition':require(_0xffa9('0x29'))[_0xffa9('0x2a')](_0x2eacc0,getIntervals(_0x3242de['intervals'],_0x11fe72),_0x3242de),'consequence':require('./applications/'+_0x11fe72[_0xffa9('0x1a')])[_0xffa9('0x2b')](_0x2eacc0,_0x24218a,_0x3242de,_0x53401b),'p':_0x11fe72[_0xffa9('0x2c')]||0x0};logger[_0xffa9('0x2d')]('Push\x20new\x20rule',_0x25af54['id'],_0xffa9('0x2e'),getIntervals(_0x3242de[_0xffa9('0x2f')],_0x11fe72)[_0xffa9('0x19')](_0xffa9('0x30')));_0x7ad8ba[_0xffa9('0x1e')](_0x25af54);}else{logger[_0xffa9('0x31')](_0xffa9('0x32'),path[_0xffa9('0x19')](__dirname,_0xffa9('0x16'),_0x11fe72[_0xffa9('0x1a')]+_0xffa9('0x1b')));}}_0x3242de[_0xffa9('0x10')][_0x2eacc0]=new RuleEngine(_0x7ad8ba);_0x3242de[_0xffa9('0x10')][_0x2eacc0][_0xffa9('0x33')](_0x53401b,function(_0x3587ff){logger['info']('Applications\x20executed',JSON[_0xffa9('0x34')](_0x3587ff[_0xffa9('0x35')]));if(_0x3242de[_0xffa9('0x10')][_0x2eacc0]){_0x3242de[_0xffa9('0x10')][_0x2eacc0][_0xffa9('0x36')](_0xffa9('0x37'));}});return _0x13bee9({'code':0xc8,'message':_0x53401b});}else{if(_0x2e87a8){logger['info'](util[_0xffa9('0x28')](_0xffa9('0x38'),_0x2eacc0));}else{logger['info']('No\x20applications\x20to\x20execute');}return _0x13bee9({'code':0xc8,'message':_0x53401b});}}catch(_0x271ad1){logger[_0xffa9('0x31')](_0x271ad1[_0xffa9('0x39')]);return _0x54cae8(_0x6e09fe['error'](0x1f4,_0x271ad1));}}return _0x54cae8('routing\x20is\x20empty');});},'AcceptMessage':function(_0x5ad793){var _0x22c3a5=this;return new Promise(function(_0x37be15,_0x10539b){if(_0x5ad793[_0xffa9('0x3a')]&&_0x5ad793[_0xffa9('0x3a')]['id']){if(_0x3242de[_0xffa9('0x3b')][_0x5ad793[_0xffa9('0x3a')]['id']]){_0x3242de['agents'][_0x5ad793[_0xffa9('0x3a')]['id']][_0xffa9('0x3c')]=![];_0x3242de[_0xffa9('0x3b')][_0x5ad793[_0xffa9('0x3a')]['id']][_0xffa9('0x3d')]=undefined;}}if(_0x5ad793[_0xffa9('0x12')]&&_0x5ad793['message']['id']){try{var _0xd4cab8=getId(_0x5ad793['channel'],_0x5ad793[_0xffa9('0x12')]?_0x5ad793[_0xffa9('0x12')]['id']:0x0,_0x5ad793[_0xffa9('0x13')]?_0x5ad793[_0xffa9('0x13')]['id']:0x0);if(_0x3242de[_0xffa9('0x10')][_0xd4cab8]){_0x3242de[_0xffa9('0x10')][_0xd4cab8]['emit']('end');if(rpc[_0x5ad793['channel']+_0xffa9('0x3e')]){rpc[_0x5ad793[_0xffa9('0x11')]+'QueueReport'][_0xffa9('0x3f')](_0xd4cab8,{'UserId':_0x5ad793[_0xffa9('0x12')][_0xffa9('0x40')]})[_0xffa9('0x41')](function(){logger[_0xffa9('0x31')](_0xffa9('0x42'));});}}return _0x37be15({'code':0xc8,'message':_0x5ad793});}catch(_0x28bdc0){logger[_0xffa9('0x31')](_0x28bdc0[_0xffa9('0x39')]);return _0x10539b(_0x22c3a5[_0xffa9('0x31')](0x1f4,_0x28bdc0));}}logger['error'](_0xffa9('0x43'));return _0x10539b(_0x22c3a5[_0xffa9('0x31')](0x1f4,_0xffa9('0x43')));});},'RejectMessage':function(_0x3c3529){var _0x5b6325=this;return new Promise(function(_0xd878f2,_0x1bc6b0){if(_0x3c3529[_0xffa9('0x3a')]&&_0x3c3529['agent']['id']){try{if(_0x3242de[_0xffa9('0x3b')][_0x3c3529[_0xffa9('0x3a')]['id']]){_0x3242de['agents'][_0x3c3529['agent']['id']][_0xffa9('0x3c')]=![];_0x3242de[_0xffa9('0x3b')][_0x3c3529[_0xffa9('0x3a')]['id']][_0xffa9('0x3d')]=undefined;}return _0xd878f2({'code':0xc8,'message':_0x3c3529});}catch(_0x8949b1){logger['error'](_0x8949b1['stack']);return _0x1bc6b0(_0x5b6325['error'](0x1f4,_0x8949b1));}}logger[_0xffa9('0x31')](_0xffa9('0x43'));return _0x1bc6b0(_0x5b6325[_0xffa9('0x31')](0x1f4,_0xffa9('0x43')));});},'AbandonInteraction':function(_0x15df7c){var _0x25f8d5=this;return new Promise(function(_0x51d6e8,_0x9529a1){if(_0x15df7c[_0xffa9('0x11')]&&_0x15df7c[_0xffa9('0x13')]&&_0x15df7c[_0xffa9('0x13')]['id']){try{var _0x549ca0=getId(_0x15df7c[_0xffa9('0x11')],_0x15df7c[_0xffa9('0x12')]?_0x15df7c[_0xffa9('0x12')]['id']:0x0,_0x15df7c[_0xffa9('0x13')]?_0x15df7c[_0xffa9('0x13')]['id']:0x0);if(_0x3242de[_0xffa9('0x10')][_0x549ca0]){_0x3242de[_0xffa9('0x10')][_0x549ca0][_0xffa9('0x36')]('end');}return _0x51d6e8({'code':0xc8,'message':_0x15df7c});}catch(_0x6b5e1b){logger[_0xffa9('0x31')](_0x6b5e1b[_0xffa9('0x39')]);return _0x9529a1(_0x25f8d5[_0xffa9('0x31')](0x1f4,_0x6b5e1b));}}logger[_0xffa9('0x31')](_0xffa9('0x43'));return _0x9529a1(_0x25f8d5[_0xffa9('0x31')](0x1f4,_0xffa9('0x43')));});},'AgentCapacity':function(_0x559e86){var _0x428b42=this;return new Promise(function(_0x4802f3,_0x1a5357){if(_0x3242de[_0xffa9('0x3b')][_0xffa9('0x44')](_0x559e86['id'])){for(var _0x11be7e in _0x559e86['capacity']){if(_0x559e86[_0xffa9('0x45')][_0xffa9('0x44')](_0x11be7e)){if(_0x3242de[_0xffa9('0x3b')][_0x559e86['id']]['hasOwnProperty'](_0x11be7e+_0xffa9('0x46'))){_0x3242de[_0xffa9('0x3b')][_0x559e86['id']][_0x11be7e+_0xffa9('0x46')]=parseInt(_0x559e86[_0xffa9('0x45')][_0x11be7e],0xa);}}}_0x3242de['agents'][_0x559e86['id']][_0xffa9('0x47')]();return _0x4802f3({'code':0xc8,'message':_0x3242de[_0xffa9('0x3b')][_0x559e86['id']]});}else{return _0x1a5357(_0x428b42['error'](0x1f4,_0xffa9('0x48')));}});},'Agents':function(_0x16c785){return new Promise(function(_0x477514){var _0x3bf36e=_[_0xffa9('0x49')](_0x3242de[_0xffa9('0x3b')]);if(_0x16c785&&_0x16c785['id']){var _0x55d8f2=_[_0xffa9('0x4a')](_0x3bf36e,function(_0x3ba6ea){return _0x3ba6ea['id']===_0x16c785['id'];});_0x477514(_0x55d8f2);}else{_0x477514({'count':_0x3bf36e[_0xffa9('0x17')],'rows':_0x3bf36e});}});},'ChatQueues':function(){return new Promise(function(_0x5284bb){var _0x6c71fc=[];for(var _0x256928 in _0x3242de[_0xffa9('0x4b')]){if(_0x3242de[_0xffa9('0x4b')]['hasOwnProperty'](_0x256928)){var _0x2304ed=_0x3242de['chatQueues'][_0x256928];var _0x4e6c2e={'id':_0x2304ed['id'],'available':_0x2304ed[_0xffa9('0x4c')],'loggedIn':_0x2304ed['loggedIn'],'name':_0x2304ed['name'],'paused':_0x2304ed[_0xffa9('0x4d')],'waiting':_0x2304ed[_0xffa9('0x4e')]};_0x6c71fc[_0xffa9('0x1e')](_0x4e6c2e);}}_0x5284bb({'count':_0x6c71fc[_0xffa9('0x17')],'rows':_0x6c71fc});});},'MailQueues':function(){return new Promise(function(_0x252908){var _0x4633c5=[];for(var _0x24ec67 in _0x3242de[_0xffa9('0x4f')]){if(_0x3242de[_0xffa9('0x4f')]['hasOwnProperty'](_0x24ec67)){var _0x1a0899=_0x3242de[_0xffa9('0x4f')][_0x24ec67];var _0x273a1f={'id':_0x1a0899['id'],'available':_0x1a0899['available'],'loggedIn':_0x1a0899['loggedIn'],'name':_0x1a0899['name'],'paused':_0x1a0899[_0xffa9('0x4d')],'waiting':_0x1a0899['waiting']};_0x4633c5[_0xffa9('0x1e')](_0x273a1f);}}_0x252908({'count':_0x4633c5[_0xffa9('0x17')],'rows':_0x4633c5});});},'OpenchannelQueues':function(){return new Promise(function(_0x4b4f89){var _0x3bb184=[];for(var _0x1f329a in _0x3242de[_0xffa9('0x50')]){if(_0x3242de['openchannelQueues'][_0xffa9('0x44')](_0x1f329a)){var _0x5ec6f9=_0x3242de[_0xffa9('0x50')][_0x1f329a];var _0x1992e2={'id':_0x5ec6f9['id'],'available':_0x5ec6f9['available'],'loggedIn':_0x5ec6f9['loggedIn'],'name':_0x5ec6f9[_0xffa9('0x51')],'paused':_0x5ec6f9[_0xffa9('0x4d')],'waiting':_0x5ec6f9[_0xffa9('0x4e')]};_0x3bb184['push'](_0x1992e2);}}_0x4b4f89({'count':_0x3bb184[_0xffa9('0x17')],'rows':_0x3bb184});});},'SmsQueues':function(){return new Promise(function(_0x3da2a7){var _0x5e5a55=[];for(var _0x4858a3 in _0x3242de['smsQueues']){if(_0x3242de[_0xffa9('0x52')][_0xffa9('0x44')](_0x4858a3)){var _0xd29863=_0x3242de[_0xffa9('0x52')][_0x4858a3];var _0x59368c={'id':_0xd29863['id'],'available':_0xd29863[_0xffa9('0x4c')],'loggedIn':_0xd29863[_0xffa9('0x53')],'name':_0xd29863[_0xffa9('0x51')],'paused':_0xd29863['paused'],'waiting':_0xd29863[_0xffa9('0x4e')]};_0x5e5a55[_0xffa9('0x1e')](_0x59368c);}}_0x3da2a7({'count':_0x5e5a55['length'],'rows':_0x5e5a55});});},'FaxQueues':function(){return new Promise(function(_0x565fd3){var _0x8cef5b=[];for(var _0x56477b in _0x3242de[_0xffa9('0x54')]){if(_0x3242de['faxQueues']['hasOwnProperty'](_0x56477b)){var _0x8fd557=_0x3242de[_0xffa9('0x54')][_0x56477b];var _0x4a5efe={'id':_0x8fd557['id'],'available':_0x8fd557['available'],'loggedIn':_0x8fd557['loggedIn'],'name':_0x8fd557[_0xffa9('0x51')],'paused':_0x8fd557[_0xffa9('0x4d')],'waiting':_0x8fd557[_0xffa9('0x4e')]};_0x8cef5b[_0xffa9('0x1e')](_0x4a5efe);}}_0x565fd3({'count':_0x8cef5b[_0xffa9('0x17')],'rows':_0x8cef5b});});},'WhatsappQueues':function(){return new Promise(function(_0x4529a9){var _0x28e85d=[];for(var _0x42bb40 in _0x3242de[_0xffa9('0x55')]){if(_0x3242de[_0xffa9('0x55')][_0xffa9('0x44')](_0x42bb40)){var _0x1a8d7b=_0x3242de[_0xffa9('0x55')][_0x42bb40];var _0x31dea3={'id':_0x1a8d7b['id'],'available':_0x1a8d7b[_0xffa9('0x4c')],'loggedIn':_0x1a8d7b[_0xffa9('0x53')],'name':_0x1a8d7b[_0xffa9('0x51')],'paused':_0x1a8d7b[_0xffa9('0x4d')],'waiting':_0x1a8d7b[_0xffa9('0x4e')]};_0x28e85d[_0xffa9('0x1e')](_0x31dea3);}}_0x4529a9({'count':_0x28e85d[_0xffa9('0x17')],'rows':_0x28e85d});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x19099a){var _0x1bea28=_[_0xffa9('0x49')](_0x3242de[_0xffa9('0x56')]);_0x19099a({'count':_0x1bea28[_0xffa9('0x17')],'rows':_0x1bea28});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x597814){var _0x2f8513=_[_0xffa9('0x49')](_0x3242de[_0xffa9('0x57')]);_0x597814({'count':_0x2f8513['length'],'rows':_0x2f8513});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xbd570e){var _0x2ce378=_[_0xffa9('0x49')](_0x3242de[_0xffa9('0x58')]);_0xbd570e({'count':_0x2ce378[_0xffa9('0x17')],'rows':_0x2ce378});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2d04a5){var _0x2cd851=_[_0xffa9('0x49')](_0x3242de[_0xffa9('0x59')]);_0x2d04a5({'count':_0x2cd851['length'],'rows':_0x2cd851});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0xd9bec6){var _0x13f580=_[_0xffa9('0x49')](_0x3242de[_0xffa9('0x5a')]);_0xd9bec6({'count':_0x13f580[_0xffa9('0x17')],'rows':_0x13f580});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0xd4f1d6){var _0x3c78ef=_[_0xffa9('0x49')](_0x3242de[_0xffa9('0x5b')]);_0xd4f1d6({'count':_0x3c78ef[_0xffa9('0x17')],'rows':_0x3c78ef});});}};var _0x162932=jayson[_0xffa9('0x5c')](_0x42205d)['http']();_0x162932['on'](_0xffa9('0x31'),function(_0x584143){logger[_0xffa9('0x31')](JSON['stringify'](_0x584143));return _0x5812d0(_0x584143);});_0x162932['listen'](0x232c,'127.0.0.1',function(){console[_0xffa9('0x5d')](_0xffa9('0x5e'),0x232c);return _0x3dd57f(_0xffa9('0x5f')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 71cb2e7..7238c01 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 _0xf197=['[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','../../../utils/iftime','iftime','condition','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','map'];(function(_0x49a0b9,_0x1ba116){var _0xb99d61=function(_0x53956b){while(--_0x53956b){_0x49a0b9['push'](_0x49a0b9['shift']());}};_0xb99d61(++_0x1ba116);}(_0xf197,0x130));var _0x7f19=function(_0x4b82e0,_0x5e51cd){_0x4b82e0=_0x4b82e0-0x0;var _0x2bfbe1=_0xf197[_0x4b82e0];return _0x2bfbe1;};'use strict';var _=require(_0x7f19('0x0'));var iftime=require(_0x7f19('0x1'))[_0x7f19('0x2')];var logger=require('../../../config/logger')('routing');exports[_0x7f19('0x3')]=function(_0x5a184b,_0x4b7af0,_0x5715b0){return function(_0x152a30){if(_0x5715b0['rules']&&!_0x5715b0['rules'][_0x5a184b]){logger[_0x7f19('0x4')](_0x7f19('0x5'),_0x5a184b);return _0x152a30[_0x7f19('0x6')]();}var _0x1851e3=_0x4b7af0[_0x7f19('0x7')](function(_0x2ebbfb){return iftime(_0x2ebbfb);});var _0x3c349c=_['some'](_0x1851e3);if(_0x3c349c){logger[_0x7f19('0x4')](_0x7f19('0x8'),_0x5a184b,_0x4b7af0[_0x7f19('0x9')]('\x20|\x20'),_0x3c349c);_0x152a30[_0x7f19('0xa')](_0x3c349c);}else{logger[_0x7f19('0x4')](_0x7f19('0xb'),_0x5a184b,_0x4b7af0[_0x7f19('0x9')]('\x20|\x20'));_0x152a30[_0x7f19('0x6')]();}};}; \ No newline at end of file +var _0x1737=['map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','\x20|\x20','when','join','stop','lodash','../../../utils/iftime','iftime','../../../config/logger','routing','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED'];(function(_0x546834,_0xaeadca){var _0x37dd9d=function(_0x2fea42){while(--_0x2fea42){_0x546834['push'](_0x546834['shift']());}};_0x37dd9d(++_0xaeadca);}(_0x1737,0x187));var _0x7173=function(_0x5947ff,_0x41d6d6){_0x5947ff=_0x5947ff-0x0;var _0x5bf313=_0x1737[_0x5947ff];return _0x5bf313;};'use strict';var _=require(_0x7173('0x0'));var iftime=require(_0x7173('0x1'))[_0x7173('0x2')];var logger=require(_0x7173('0x3'))(_0x7173('0x4'));exports[_0x7173('0x5')]=function(_0x4a8080,_0x5d783c,_0x5c8861){return function(_0x528c22){if(_0x5c8861[_0x7173('0x6')]&&!_0x5c8861['rules'][_0x4a8080]){logger[_0x7173('0x7')](_0x7173('0x8'),_0x4a8080);return _0x528c22['stop']();}var _0x21a74d=_0x5d783c[_0x7173('0x9')](function(_0x2f18ac){return iftime(_0x2f18ac);});var _0x162db4=_[_0x7173('0xa')](_0x21a74d);if(_0x162db4){logger[_0x7173('0x7')](_0x7173('0xb'),_0x4a8080,_0x5d783c['join'](_0x7173('0xc')),_0x162db4);_0x528c22[_0x7173('0xd')](_0x162db4);}else{logger['info']('[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s',_0x4a8080,_0x5d783c[_0x7173('0xe')](_0x7173('0xc')));_0x528c22[_0x7173('0xf')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 2cf3c22..3bc1c65 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 _0x8f59=['transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','connectedlinename','format','membername','error','agentringnoanswer','[%s][agents][agentringnoanswer]','agentringnoanswerAt','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]'];(function(_0x188b36,_0x1d37d3){var _0x5472fc=function(_0x15d877){while(--_0x15d877){_0x188b36['push'](_0x188b36['shift']());}};_0x5472fc(++_0x1d37d3);}(_0x8f59,0x11d));var _0x98f5=function(_0x5c3dec,_0x3f1541){_0x5c3dec=_0x5c3dec-0x0;var _0x4e875f=_0x8f59[_0x5c3dec];return _0x4e875f;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var utils=require(_0x98f5('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xe809bb,_0x1d9fb3){utils[_0x98f5('0x3')](util['format'](_0x98f5('0x4'),_0xe809bb[_0x98f5('0x5')],_0xe809bb[_0x98f5('0x6')],_0xe809bb[_0x98f5('0x7')],_0xe809bb['membername'],_0xe809bb[_0x98f5('0x8')],_0xe809bb[_0x98f5('0x9')],_0xe809bb[_0x98f5('0xa')],_0xe809bb['lastevent']));if(_0xe809bb['queue']){utils[_0x98f5('0xb')](_0xe809bb[_0x98f5('0x7')])[_0x98f5('0xc')](function(_0x53493e){if(_0x53493e){_0xe809bb[_0x98f5('0xd')]=_0x53493e[_0x98f5('0xd')];_0xe809bb[_0x98f5('0xe')]=_0xe809bb[_0x98f5('0xf')]?_0x53493e['acw']:![];_0xe809bb[_0x98f5('0x10')]=_0xe809bb['agentacw']?_0x53493e['acwTimeout']:0x0;}utils[_0x98f5('0x11')](_0x98f5('0x12'),_0xe809bb);});}else{utils['request'](_0x98f5('0x12'),_0xe809bb);}if(_0x1d9fb3){delete transfers[_0xe809bb[_0x98f5('0x5')]];}else{delete agents[_0xe809bb[_0x98f5('0x13')]];}}exports[_0x98f5('0x14')]=function(_0x3286f7){try{utils[_0x98f5('0x15')](util['format'](_0x98f5('0x16'),_0x3286f7[_0x98f5('0x5')]),_0x3286f7);agents[_0x3286f7['destuniqueid']]=_0x3286f7;agents[_0x3286f7[_0x98f5('0x13')]][_0x98f5('0x17')]=utils[_0x98f5('0x18')]();agents[_0x3286f7['destuniqueid']][_0x98f5('0x19')]=_0x98f5('0x1a');agents[_0x3286f7[_0x98f5('0x13')]]['connectedlinenum']=null;agents[_0x3286f7[_0x98f5('0x13')]][_0x98f5('0x1b')]=null;utils['info'](util[_0x98f5('0x1c')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x3286f7[_0x98f5('0x5')],agents[_0x3286f7[_0x98f5('0x13')]][_0x98f5('0x1d')],_0x3286f7[_0x98f5('0x13')]));}catch(_0xd6f409){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x16'),_0x3286f7['uniqueid']),_0xd6f409);}};exports[_0x98f5('0x1f')]=function(_0x191f23){try{if(!_['isNil'](agents[_0x191f23[_0x98f5('0x13')]])){utils[_0x98f5('0x15')](util[_0x98f5('0x1c')](_0x98f5('0x20'),_0x191f23[_0x98f5('0x5')]),_0x191f23);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x191f23[_0x98f5('0x5')],agents[_0x191f23['destuniqueid']][_0x98f5('0x1d')],_0x191f23['destuniqueid']));agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x1f')]=!![];agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x21')]=utils[_0x98f5('0x18')]();agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x19')]='timeout';agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x22')]='timeout';agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x23')]=_0x191f23[_0x98f5('0x24')]?parseInt(_0x191f23[_0x98f5('0x24')])/0x3e8:0x0;agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x25')]=0x0;unanswered[_0x98f5('0x26')](_0x191f23[_0x98f5('0x13')]);}}catch(_0x576c4b){utils['error'](util[_0x98f5('0x1c')](_0x98f5('0x20'),_0x191f23[_0x98f5('0x5')]),_0x576c4b);}};exports[_0x98f5('0x27')]=function(_0x15bf92){try{_[_0x98f5('0x28')](agents,function(_0x5e9d73,_0x29e1f5){if(_0x5e9d73[_0x98f5('0x5')]==_0x15bf92[_0x98f5('0x5')]&&!_[_0x98f5('0x29')](unanswered,_0x5e9d73[_0x98f5('0x13')])){utils[_0x98f5('0x15')](util['format'](_0x98f5('0x2a'),_0x15bf92[_0x98f5('0x5')]),_0x15bf92);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x15bf92[_0x98f5('0x5')],_0x5e9d73[_0x98f5('0x1d')],_0x5e9d73[_0x98f5('0x13')]));_0x5e9d73[_0x98f5('0x1f')]=!![];_0x5e9d73[_0x98f5('0x21')]=utils[_0x98f5('0x18')]();_0x5e9d73[_0x98f5('0x19')]=_0x98f5('0x2b');_0x5e9d73[_0x98f5('0x22')]=_0x98f5('0x2b');_0x5e9d73[_0x98f5('0x23')]=_0x15bf92[_0x98f5('0x23')];_0x5e9d73[_0x98f5('0x25')]=0x0;writeDB(_0x5e9d73);}});}catch(_0xe4a944){utils[_0x98f5('0x1e')](util[_0x98f5('0x1c')](_0x98f5('0x2a'),_0x15bf92[_0x98f5('0x5')]),_0xe4a944);}};exports[_0x98f5('0x2c')]=function(_0x39d935){try{if(agents[_0x39d935['destuniqueid']]){utils[_0x98f5('0x15')](util['format']('[%s][agents][agentconnect]',_0x39d935[_0x98f5('0x5')]),_0x39d935);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')](_0x98f5('0x2d'),_0x39d935['uniqueid'],agents[_0x39d935[_0x98f5('0x13')]][_0x98f5('0x1d')],_0x39d935[_0x98f5('0x13')]));agents[_0x39d935['destuniqueid']][_0x98f5('0x2e')]=utils[_0x98f5('0x18')]();agents[_0x39d935['destuniqueid']][_0x98f5('0xa')]=_0x39d935[_0x98f5('0xa')];agents[_0x39d935[_0x98f5('0x13')]]['connectedlinename']=_0x39d935[_0x98f5('0x1b')];agents[_0x39d935[_0x98f5('0x13')]][_0x98f5('0x23')]=_0x39d935[_0x98f5('0x24')];agents[_0x39d935[_0x98f5('0x13')]]['lastevent']='connect';_[_0x98f5('0x28')](agents,function(_0x14faf2,_0x33e6e2){if(_0x14faf2[_0x98f5('0x13')]!=_0x39d935[_0x98f5('0x13')]&&_0x14faf2[_0x98f5('0x5')]==_0x39d935['uniqueid']){_0x14faf2['talktime']=0x0;_0x14faf2[_0x98f5('0x23')]=_0x39d935[_0x98f5('0x24')];_0x14faf2[_0x98f5('0x1f')]=!![];_0x14faf2[_0x98f5('0x21')]=utils['now']();_0x14faf2['lastevent']=_0x98f5('0x2f');_0x14faf2[_0x98f5('0x22')]=_0x98f5('0x2f');_0x14faf2[_0x98f5('0x30')]=_0x39d935['destuniqueid'];_0x14faf2['answeredelsewheremembername']=_0x39d935[_0x98f5('0x1d')];writeDB(_0x14faf2);}});}}catch(_0x3a191f){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x31'),_0x39d935['uniqueid']),_0x3a191f);}};exports[_0x98f5('0xf')]=function(_0x4ff7b0){try{if(!_[_0x98f5('0x32')](agents[_0x4ff7b0[_0x98f5('0x13')]])){utils[_0x98f5('0x15')](util['format'](_0x98f5('0x33'),_0x4ff7b0[_0x98f5('0x5')]),_0x4ff7b0);utils['info'](util[_0x98f5('0x1c')](_0x98f5('0x34'),_0x4ff7b0['uniqueid'],agents[_0x4ff7b0[_0x98f5('0x13')]]['membername'],_0x4ff7b0[_0x98f5('0x13')]));agents[_0x4ff7b0[_0x98f5('0x13')]]['agentcomplete']=!![];agents[_0x4ff7b0['destuniqueid']]['agentcompleteAt']=utils['now']();agents[_0x4ff7b0[_0x98f5('0x13')]]['talktime']=utils[_0x98f5('0x35')](agents[_0x4ff7b0[_0x98f5('0x13')]][_0x98f5('0x36')],agents[_0x4ff7b0[_0x98f5('0x13')]][_0x98f5('0x2e')]);agents[_0x4ff7b0[_0x98f5('0x13')]]['reason']=_0x4ff7b0[_0x98f5('0x22')];agents[_0x4ff7b0[_0x98f5('0x13')]][_0x98f5('0x19')]=_0x98f5('0x37');writeDB(agents[_0x4ff7b0[_0x98f5('0x13')]]);}}catch(_0x459649){utils['error'](util[_0x98f5('0x1c')](_0x98f5('0x33'),_0x4ff7b0[_0x98f5('0x5')]),_0x459649);}};exports[_0x98f5('0x38')]=function(_0x4a0cda){try{if(!_[_0x98f5('0x32')](agents[_0x4a0cda[_0x98f5('0x39')]])){utils[_0x98f5('0x15')](util[_0x98f5('0x1c')](_0x98f5('0x3a'),_0x4a0cda['uniqueid']),_0x4a0cda);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x4a0cda[_0x98f5('0x5')],agents[_0x4a0cda['transfereruniqueid']][_0x98f5('0x1d')],agents[_0x4a0cda['transfereruniqueid']][_0x98f5('0x5')]));agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x3b')]=!![];agents[_0x4a0cda['transfereruniqueid']][_0x98f5('0x3c')]=_0x98f5('0x3d');agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x3e')]=_0x4a0cda[_0x98f5('0x3f')];agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x40')]=agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x5')];}}catch(_0x2e48a1){utils[_0x98f5('0x1e')](util[_0x98f5('0x1c')](_0x98f5('0x3a'),_0x4a0cda[_0x98f5('0x5')]),_0x2e48a1);}};exports[_0x98f5('0x41')]=function(_0x1289a7){try{utils[_0x98f5('0x15')](util['format'](_0x98f5('0x42'),_0x1289a7[_0x98f5('0x43')]),_0x1289a7);if(_0x1289a7[_0x98f5('0x43')]==_0x1289a7[_0x98f5('0x44')]){if(!_[_0x98f5('0x32')](agents[_0x1289a7[_0x98f5('0x45')]])){utils['info'](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x1289a7[_0x98f5('0x43')],agents[_0x1289a7[_0x98f5('0x45')]][_0x98f5('0x1d')]));agents[_0x1289a7[_0x98f5('0x45')]]['transfer']=!![];agents[_0x1289a7[_0x98f5('0x45')]]['transfertype']=_0x98f5('0x46');agents[_0x1289a7['secondtransfereruniqueid']]['transferexten']=_0x1289a7[_0x98f5('0x47')];agents[_0x1289a7[_0x98f5('0x45')]][_0x98f5('0x40')]=_0x1289a7['origtransfereruniqueid'];}if(_0x1289a7['transfereeuniqueid']&&agents[_0x1289a7[_0x98f5('0x48')]]){agents[_0x1289a7[_0x98f5('0x48')]]['agententerreason']=0x1;transfers[_0x1289a7[_0x98f5('0x48')]]=_[_0x98f5('0x49')](agents[_0x1289a7['transfereeuniqueid']]);transfers[_0x1289a7[_0x98f5('0x48')]][_0x98f5('0x9')]=agents[_0x1289a7[_0x98f5('0x45')]]['calleridnum'];transfers[_0x1289a7[_0x98f5('0x48')]][_0x98f5('0x4a')]=agents[_0x1289a7[_0x98f5('0x45')]][_0x98f5('0x4a')];transfers[_0x1289a7[_0x98f5('0x48')]][_0x98f5('0x17')]=utils[_0x98f5('0x18')]();transfers[_0x1289a7['transfereeuniqueid']][_0x98f5('0x2e')]=utils[_0x98f5('0x18')]();transfers[_0x1289a7[_0x98f5('0x48')]]['holdtime']=0x0;transfers[_0x1289a7['transfereeuniqueid']][_0x98f5('0x4b')]=0x2;}}else if(_0x1289a7[_0x98f5('0x45')]==_0x1289a7['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x1289a7['origtransfereruniqueid']])){utils['info'](util[_0x98f5('0x1c')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x1289a7[_0x98f5('0x43')],agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x1d')]));agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x3b')]=!![];agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x3c')]=_0x98f5('0x46');agents[_0x1289a7['origtransfereruniqueid']]['transferexten']=_0x1289a7[_0x98f5('0x4c')];agents[_0x1289a7['origtransfereruniqueid']][_0x98f5('0x40')]=_0x1289a7[_0x98f5('0x45')];}if(_0x1289a7[_0x98f5('0x4d')]&&agents[_0x1289a7['transfertargetuniqueid']]){agents[_0x1289a7[_0x98f5('0x4d')]]['agententerreason']=0x1;transfers[_0x1289a7['transfertargetuniqueid']]=_['clone'](agents[_0x1289a7[_0x98f5('0x4d')]]);transfers[_0x1289a7['transfertargetuniqueid']][_0x98f5('0x9')]=agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x9')];transfers[_0x1289a7['transfertargetuniqueid']]['calleridname']=agents[_0x1289a7['origtransfereruniqueid']][_0x98f5('0x4a')];transfers[_0x1289a7[_0x98f5('0x4d')]]['agentcalledAt']=utils['now']();transfers[_0x1289a7[_0x98f5('0x4d')]][_0x98f5('0x2e')]=utils[_0x98f5('0x18')]();transfers[_0x1289a7[_0x98f5('0x4d')]][_0x98f5('0x23')]=0x0;transfers[_0x1289a7[_0x98f5('0x4d')]][_0x98f5('0x4b')]=0x2;}}}catch(_0x1cc6e3){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x42'),_0x1289a7[_0x98f5('0x43')]),_0x1cc6e3);}};exports[_0x98f5('0x4e')]=function(_0xb64efb){try{utils['debug'](util[_0x98f5('0x1c')](_0x98f5('0x4f'),_0xb64efb[_0x98f5('0x5')]),_0xb64efb);if(agents[_0xb64efb['uniqueid']]&&agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')]==='timeout'){if(_0xb64efb[_0x98f5('0x50')]==='21'){agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')]='rejected';agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]=_0x98f5('0x51');}utils[_0x98f5('0x3')](util[_0x98f5('0x1c')](_0x98f5('0x52'),_0xb64efb[_0x98f5('0x5')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x1d')],agents[_0xb64efb['uniqueid']][_0x98f5('0x22')],agents[_0xb64efb['uniqueid']][_0x98f5('0x19')]));writeDB(agents[_0xb64efb[_0x98f5('0x5')]]);var _0x3bb728=unanswered[_0x98f5('0x53')](_0xb64efb['uniqueid']);if(_0x3bb728>-0x1){unanswered[_0x98f5('0x54')](_0x3bb728,0x1);}}if(transfers[_0xb64efb[_0x98f5('0x5')]]){transfers[_0xb64efb['uniqueid']][_0x98f5('0xf')]=!![];transfers[_0xb64efb['uniqueid']][_0x98f5('0x36')]=utils[_0x98f5('0x18')]();transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x25')]=utils['diffTime'](transfers[_0xb64efb['uniqueid']][_0x98f5('0x36')],transfers[_0xb64efb[_0x98f5('0x5')]]['agentconnectAt']);transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')]=_0x98f5('0x55');transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]=_0x98f5('0x37');utils[_0x98f5('0x3')](util[_0x98f5('0x1c')](_0x98f5('0x52'),_0xb64efb[_0x98f5('0x5')],transfers[_0xb64efb[_0x98f5('0x5')]]['membername'],transfers[_0xb64efb['uniqueid']][_0x98f5('0x22')],transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]));writeDB(transfers[_0xb64efb['uniqueid']],!![]);}if(agents[_0xb64efb[_0x98f5('0x5')]]&&agents[_0xb64efb[_0x98f5('0x5')]]['agentconnectAt']){agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0xf')]=!![];agents[_0xb64efb['uniqueid']]['agentcompleteAt']=utils['now']();agents[_0xb64efb['uniqueid']][_0x98f5('0x25')]=utils[_0x98f5('0x35')](agents[_0xb64efb['uniqueid']][_0x98f5('0x36')],agents[_0xb64efb[_0x98f5('0x5')]]['agentconnectAt']);agents[_0xb64efb[_0x98f5('0x5')]]['reason']=agents[_0xb64efb['uniqueid']][_0x98f5('0x3b')]?_0x98f5('0x3b'):_0x98f5('0x55');agents[_0xb64efb[_0x98f5('0x5')]]['lastevent']=_0x98f5('0x37');utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xb64efb[_0x98f5('0x5')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x1d')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]));writeDB(agents[_0xb64efb[_0x98f5('0x5')]]);}}catch(_0x1a3a76){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x4f'),_0xb64efb[_0x98f5('0x5')]),_0x1a3a76);}}; \ No newline at end of file +var _0xe706=['then','type','agentacw','agentcomplete','acw','acwtime','CreateVoiceAgentReport','request','destuniqueid','agentcalled','debug','now','called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','transferexten','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfertargetuniqueid','agentcalledAt','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName'];(function(_0x86d8b5,_0x1c170c){var _0x488b42=function(_0x5a3401){while(--_0x5a3401){_0x86d8b5['push'](_0x86d8b5['shift']());}};_0x488b42(++_0x1c170c);}(_0xe706,0xa3));var _0x6e70=function(_0x6287b6,_0x5682e7){_0x6287b6=_0x6287b6-0x0;var _0x5d6be4=_0xe706[_0x6287b6];return _0x5d6be4;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var utils=require(_0x6e70('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5e8446,_0x2cae77){utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x5'),_0x5e8446[_0x6e70('0x6')],_0x5e8446[_0x6e70('0x7')],_0x5e8446[_0x6e70('0x8')],_0x5e8446[_0x6e70('0x9')],_0x5e8446[_0x6e70('0xa')],_0x5e8446[_0x6e70('0xb')],_0x5e8446[_0x6e70('0xc')],_0x5e8446[_0x6e70('0xd')]));if(_0x5e8446[_0x6e70('0x8')]){utils[_0x6e70('0xe')](_0x5e8446[_0x6e70('0x8')])[_0x6e70('0xf')](function(_0x954545){if(_0x954545){_0x5e8446[_0x6e70('0x10')]=_0x954545[_0x6e70('0x10')];_0x5e8446[_0x6e70('0x11')]=_0x5e8446[_0x6e70('0x12')]?_0x954545[_0x6e70('0x13')]:![];_0x5e8446[_0x6e70('0x14')]=_0x5e8446[_0x6e70('0x11')]?_0x954545['acwTimeout']:0x0;}utils['request'](_0x6e70('0x15'),_0x5e8446);});}else{utils[_0x6e70('0x16')](_0x6e70('0x15'),_0x5e8446);}if(_0x2cae77){delete transfers[_0x5e8446[_0x6e70('0x6')]];}else{delete agents[_0x5e8446[_0x6e70('0x17')]];}}exports[_0x6e70('0x18')]=function(_0xa1eb74){try{utils[_0x6e70('0x19')](util['format']('[%s][agents][agentcalled]',_0xa1eb74['uniqueid']),_0xa1eb74);agents[_0xa1eb74[_0x6e70('0x17')]]=_0xa1eb74;agents[_0xa1eb74['destuniqueid']]['agentcalledAt']=utils[_0x6e70('0x1a')]();agents[_0xa1eb74[_0x6e70('0x17')]]['lastevent']=_0x6e70('0x1b');agents[_0xa1eb74['destuniqueid']][_0x6e70('0xc')]=null;agents[_0xa1eb74[_0x6e70('0x17')]]['connectedlinename']=null;utils['info'](util[_0x6e70('0x4')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0xa1eb74[_0x6e70('0x6')],agents[_0xa1eb74[_0x6e70('0x17')]]['membername'],_0xa1eb74['destuniqueid']));}catch(_0xc238ba){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x1d'),_0xa1eb74[_0x6e70('0x6')]),_0xc238ba);}};exports[_0x6e70('0x1e')]=function(_0x1b2453){try{if(!_[_0x6e70('0x1f')](agents[_0x1b2453[_0x6e70('0x17')]])){utils[_0x6e70('0x19')](util['format'](_0x6e70('0x20'),_0x1b2453[_0x6e70('0x6')]),_0x1b2453);utils[_0x6e70('0x3')](util['format'](_0x6e70('0x21'),_0x1b2453[_0x6e70('0x6')],agents[_0x1b2453[_0x6e70('0x17')]]['membername'],_0x1b2453[_0x6e70('0x17')]));agents[_0x1b2453['destuniqueid']]['agentringnoanswer']=!![];agents[_0x1b2453['destuniqueid']][_0x6e70('0x22')]=utils[_0x6e70('0x1a')]();agents[_0x1b2453['destuniqueid']][_0x6e70('0xd')]=_0x6e70('0x23');agents[_0x1b2453['destuniqueid']][_0x6e70('0x24')]=_0x6e70('0x23');agents[_0x1b2453[_0x6e70('0x17')]]['holdtime']=_0x1b2453['ringtime']?parseInt(_0x1b2453[_0x6e70('0x25')])/0x3e8:0x0;agents[_0x1b2453[_0x6e70('0x17')]][_0x6e70('0x26')]=0x0;unanswered[_0x6e70('0x27')](_0x1b2453[_0x6e70('0x17')]);}}catch(_0x5d772a){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x20'),_0x1b2453[_0x6e70('0x6')]),_0x5d772a);}};exports[_0x6e70('0x28')]=function(_0x20a225){try{_[_0x6e70('0x29')](agents,function(_0x24114a,_0x3a0821){if(_0x24114a[_0x6e70('0x6')]==_0x20a225['uniqueid']&&!_[_0x6e70('0x2a')](unanswered,_0x24114a['destuniqueid'])){utils[_0x6e70('0x19')](util['format'](_0x6e70('0x2b'),_0x20a225[_0x6e70('0x6')]),_0x20a225);utils[_0x6e70('0x3')](util['format'](_0x6e70('0x2c'),_0x20a225[_0x6e70('0x6')],_0x24114a['membername'],_0x24114a[_0x6e70('0x17')]));_0x24114a[_0x6e70('0x1e')]=!![];_0x24114a['agentringnoanswerAt']=utils[_0x6e70('0x1a')]();_0x24114a[_0x6e70('0xd')]=_0x6e70('0x2d');_0x24114a[_0x6e70('0x24')]=_0x6e70('0x2d');_0x24114a[_0x6e70('0x2e')]=_0x20a225[_0x6e70('0x2e')];_0x24114a[_0x6e70('0x26')]=0x0;writeDB(_0x24114a);}});}catch(_0xf146fd){utils[_0x6e70('0x1c')](util['format'](_0x6e70('0x2b'),_0x20a225['uniqueid']),_0xf146fd);}};exports[_0x6e70('0x2f')]=function(_0x3222a2){try{if(agents[_0x3222a2[_0x6e70('0x17')]]){utils[_0x6e70('0x19')](util[_0x6e70('0x4')](_0x6e70('0x30'),_0x3222a2[_0x6e70('0x6')]),_0x3222a2);utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x31'),_0x3222a2[_0x6e70('0x6')],agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0x9')],_0x3222a2['destuniqueid']));agents[_0x3222a2['destuniqueid']]['agentconnectAt']=utils[_0x6e70('0x1a')]();agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0xc')]=_0x3222a2[_0x6e70('0xc')];agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0x32')]=_0x3222a2['connectedlinename'];agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0x2e')]=_0x3222a2[_0x6e70('0x25')];agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0xd')]=_0x6e70('0x33');_[_0x6e70('0x29')](agents,function(_0x16fc7d,_0x5be100){if(_0x16fc7d[_0x6e70('0x17')]!=_0x3222a2[_0x6e70('0x17')]&&_0x16fc7d[_0x6e70('0x6')]==_0x3222a2[_0x6e70('0x6')]){_0x16fc7d[_0x6e70('0x26')]=0x0;_0x16fc7d[_0x6e70('0x2e')]=_0x3222a2[_0x6e70('0x25')];_0x16fc7d['agentringnoanswer']=!![];_0x16fc7d['agentringnoanswerAt']=utils['now']();_0x16fc7d[_0x6e70('0xd')]=_0x6e70('0x34');_0x16fc7d[_0x6e70('0x24')]=_0x6e70('0x34');_0x16fc7d[_0x6e70('0x35')]=_0x3222a2['destuniqueid'];_0x16fc7d[_0x6e70('0x36')]=_0x3222a2[_0x6e70('0x9')];writeDB(_0x16fc7d);}});}}catch(_0x2a2aca){utils['error'](util['format']('[%s][agents][agentconnect]',_0x3222a2[_0x6e70('0x6')]),_0x2a2aca);}};exports['agentcomplete']=function(_0x42f49a){try{if(!_[_0x6e70('0x1f')](agents[_0x42f49a[_0x6e70('0x17')]])){utils[_0x6e70('0x19')](util['format'](_0x6e70('0x37'),_0x42f49a['uniqueid']),_0x42f49a);utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x38'),_0x42f49a[_0x6e70('0x6')],agents[_0x42f49a['destuniqueid']][_0x6e70('0x9')],_0x42f49a[_0x6e70('0x17')]));agents[_0x42f49a[_0x6e70('0x17')]][_0x6e70('0x12')]=!![];agents[_0x42f49a[_0x6e70('0x17')]][_0x6e70('0x39')]=utils[_0x6e70('0x1a')]();agents[_0x42f49a['destuniqueid']][_0x6e70('0x26')]=utils[_0x6e70('0x3a')](agents[_0x42f49a[_0x6e70('0x17')]][_0x6e70('0x39')],agents[_0x42f49a[_0x6e70('0x17')]][_0x6e70('0x3b')]);agents[_0x42f49a[_0x6e70('0x17')]]['reason']=_0x42f49a[_0x6e70('0x24')];agents[_0x42f49a['destuniqueid']][_0x6e70('0xd')]=_0x6e70('0x3c');writeDB(agents[_0x42f49a['destuniqueid']]);}}catch(_0x53efc3){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x37'),_0x42f49a['uniqueid']),_0x53efc3);}};exports['blindtransfer']=function(_0x238ebb){try{if(!_[_0x6e70('0x1f')](agents[_0x238ebb[_0x6e70('0x3d')]])){utils[_0x6e70('0x19')](util[_0x6e70('0x4')](_0x6e70('0x3e'),_0x238ebb['uniqueid']),_0x238ebb);utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x3f'),_0x238ebb[_0x6e70('0x6')],agents[_0x238ebb[_0x6e70('0x3d')]]['membername'],agents[_0x238ebb['transfereruniqueid']][_0x6e70('0x6')]));agents[_0x238ebb[_0x6e70('0x3d')]][_0x6e70('0x40')]=!![];agents[_0x238ebb[_0x6e70('0x3d')]][_0x6e70('0x41')]='blind';agents[_0x238ebb[_0x6e70('0x3d')]][_0x6e70('0x42')]=_0x238ebb[_0x6e70('0x43')];agents[_0x238ebb[_0x6e70('0x3d')]][_0x6e70('0x44')]=agents[_0x238ebb['transfereruniqueid']][_0x6e70('0x6')];}}catch(_0x1dd242){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x3e'),_0x238ebb[_0x6e70('0x6')]),_0x1dd242);}};exports['attendedtransfer']=function(_0x40e7c6){try{utils[_0x6e70('0x19')](util['format'](_0x6e70('0x45'),_0x40e7c6[_0x6e70('0x46')]),_0x40e7c6);if(_0x40e7c6['origtransfereruniqueid']==_0x40e7c6[_0x6e70('0x47')]){if(!_[_0x6e70('0x1f')](agents[_0x40e7c6[_0x6e70('0x48')]])){utils[_0x6e70('0x3')](util[_0x6e70('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x40e7c6[_0x6e70('0x46')],agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x9')]));agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x40')]=!![];agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x41')]=_0x6e70('0x49');agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x42')]=_0x40e7c6[_0x6e70('0x4a')];agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x44')]=_0x40e7c6[_0x6e70('0x46')];}if(_0x40e7c6[_0x6e70('0x4b')]&&agents[_0x40e7c6[_0x6e70('0x4b')]]){agents[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0x4c')]=0x1;transfers[_0x40e7c6[_0x6e70('0x4b')]]=_[_0x6e70('0x4d')](agents[_0x40e7c6['transfereeuniqueid']]);transfers[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0xb')]=agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0xb')];transfers[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0x4e')]=agents[_0x40e7c6['secondtransfereruniqueid']][_0x6e70('0x4e')];transfers[_0x40e7c6[_0x6e70('0x4b')]]['agentcalledAt']=utils[_0x6e70('0x1a')]();transfers[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0x3b')]=utils['now']();transfers[_0x40e7c6['transfereeuniqueid']][_0x6e70('0x2e')]=0x0;transfers[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0x4c')]=0x2;}}else if(_0x40e7c6[_0x6e70('0x48')]==_0x40e7c6[_0x6e70('0x4f')]){if(!_[_0x6e70('0x1f')](agents[_0x40e7c6[_0x6e70('0x46')]])){utils['info'](util['format'](_0x6e70('0x50'),_0x40e7c6[_0x6e70('0x46')],agents[_0x40e7c6[_0x6e70('0x46')]][_0x6e70('0x9')]));agents[_0x40e7c6['origtransfereruniqueid']]['transfer']=!![];agents[_0x40e7c6[_0x6e70('0x46')]][_0x6e70('0x41')]='ATTENDED';agents[_0x40e7c6['origtransfereruniqueid']][_0x6e70('0x42')]=_0x40e7c6['secondtransfererexten'];agents[_0x40e7c6[_0x6e70('0x46')]][_0x6e70('0x44')]=_0x40e7c6[_0x6e70('0x48')];}if(_0x40e7c6[_0x6e70('0x51')]&&agents[_0x40e7c6[_0x6e70('0x51')]]){agents[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0x4c')]=0x1;transfers[_0x40e7c6[_0x6e70('0x51')]]=_['clone'](agents[_0x40e7c6[_0x6e70('0x51')]]);transfers[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0xb')]=agents[_0x40e7c6[_0x6e70('0x46')]][_0x6e70('0xb')];transfers[_0x40e7c6['transfertargetuniqueid']]['calleridname']=agents[_0x40e7c6['origtransfereruniqueid']][_0x6e70('0x4e')];transfers[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0x52')]=utils['now']();transfers[_0x40e7c6['transfertargetuniqueid']][_0x6e70('0x3b')]=utils[_0x6e70('0x1a')]();transfers[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0x2e')]=0x0;transfers[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0x4c')]=0x2;}}}catch(_0x5eb6f0){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x45'),_0x40e7c6[_0x6e70('0x46')]),_0x5eb6f0);}};exports['hangup']=function(_0xce964b){try{utils['debug'](util['format'](_0x6e70('0x53'),_0xce964b[_0x6e70('0x6')]),_0xce964b);if(agents[_0xce964b[_0x6e70('0x6')]]&&agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')]===_0x6e70('0x23')){if(_0xce964b['cause']==='21'){agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')]=_0x6e70('0x54');agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0xd')]=_0x6e70('0x54');}utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x55'),_0xce964b[_0x6e70('0x6')],agents[_0xce964b['uniqueid']][_0x6e70('0x9')],agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')],agents[_0xce964b['uniqueid']]['lastevent']));writeDB(agents[_0xce964b[_0x6e70('0x6')]]);var _0x18ecf0=unanswered[_0x6e70('0x56')](_0xce964b[_0x6e70('0x6')]);if(_0x18ecf0>-0x1){unanswered[_0x6e70('0x57')](_0x18ecf0,0x1);}}if(transfers[_0xce964b['uniqueid']]){transfers[_0xce964b['uniqueid']][_0x6e70('0x12')]=!![];transfers[_0xce964b[_0x6e70('0x6')]]['agentcompleteAt']=utils[_0x6e70('0x1a')]();transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x26')]=utils[_0x6e70('0x3a')](transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x39')],transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x3b')]);transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')]=_0x6e70('0x58');transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0xd')]=_0x6e70('0x3c');utils['info'](util['format'](_0x6e70('0x55'),_0xce964b['uniqueid'],transfers[_0xce964b[_0x6e70('0x6')]]['membername'],transfers[_0xce964b['uniqueid']][_0x6e70('0x24')],transfers[_0xce964b['uniqueid']]['lastevent']));writeDB(transfers[_0xce964b[_0x6e70('0x6')]],!![]);}if(agents[_0xce964b[_0x6e70('0x6')]]&&agents[_0xce964b[_0x6e70('0x6')]]['agentconnectAt']){agents[_0xce964b['uniqueid']]['agentcomplete']=!![];agents[_0xce964b[_0x6e70('0x6')]]['agentcompleteAt']=utils[_0x6e70('0x1a')]();agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x26')]=utils[_0x6e70('0x3a')](agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x39')],agents[_0xce964b[_0x6e70('0x6')]]['agentconnectAt']);agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')]=agents[_0xce964b[_0x6e70('0x6')]]['transfer']?_0x6e70('0x40'):_0x6e70('0x58');agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0xd')]=_0x6e70('0x3c');utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x55'),_0xce964b[_0x6e70('0x6')],agents[_0xce964b['uniqueid']][_0x6e70('0x9')],agents[_0xce964b[_0x6e70('0x6')]]['reason'],agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0xd')]));writeDB(agents[_0xce964b['uniqueid']]);}}catch(_0x596d71){utils[_0x6e70('0x1c')](util['format'](_0x6e70('0x53'),_0xce964b['uniqueid']),_0x596d71);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 06d83da..edced82 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 _0x3036=['newstate','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','isNil','destinationchannel','answertime','disposition','toNumber','[%s][calls][newstate]','hangup','debug','callerid','calleridname','cause-txt','endtime','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','value','xmd-phone','[%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','Queue','lastdata','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','substring','lastIndexOf','includes','execif','gotoif','lastapplication','util','FAILED','NO\x20ANSWER','ANSWERED','BUSY','info','format','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','uniqueid','linkedid','channel','context','exten','now','DOCUMENTATION','error'];(function(_0x41098a,_0x427be8){var _0x14cdc0=function(_0x424737){while(--_0x424737){_0x41098a['push'](_0x41098a['shift']());}};_0x14cdc0(++_0x427be8);}(_0x3036,0xb1));var _0x6303=function(_0x2a032d,_0x21eaea){_0x2a032d=_0x2a032d-0x0;var _0x1f349f=_0x3036[_0x2a032d];return _0x1f349f;};'use strict';var _=require('lodash');var util=require(_0x6303('0x0'));var utils=require('./utils');var dispositions=['NO\x20ANSWER',_0x6303('0x1'),'FAILED','NO\x20ANSWER',_0x6303('0x2'),_0x6303('0x2'),_0x6303('0x3'),_0x6303('0x4'),_0x6303('0x1'),_0x6303('0x1'),'FAILED'];var channels={};function writeDB(_0x50e2a3){utils[_0x6303('0x5')](util[_0x6303('0x6')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x50e2a3['uniqueid'],_0x50e2a3['channel'],_0x50e2a3[_0x6303('0x7')],_0x50e2a3[_0x6303('0x8')],_0x50e2a3[_0x6303('0x9')],_0x50e2a3[_0x6303('0xa')],_0x50e2a3[_0x6303('0xb')],_0x50e2a3[_0x6303('0xc')]));if(_0x50e2a3[_0x6303('0xd')]){utils[_0x6303('0xe')](_0x50e2a3[_0x6303('0xd')])[_0x6303('0xf')](function(_0x33c0e5){if(_0x33c0e5){_0x50e2a3[_0x6303('0x10')]=_0x33c0e5['id'];}utils['request'](_0x6303('0x11'),_0x50e2a3);});}else{utils[_0x6303('0x12')](_0x6303('0x11'),_0x50e2a3);}if(channels[_0x50e2a3[_0x6303('0x13')]]){delete channels[_0x50e2a3[_0x6303('0x13')]];}}exports['newchannel']=function(_0x237030){try{utils['debug'](util[_0x6303('0x6')]('[%s][calls][newchannel]',_0x237030['uniqueid']),_0x237030);if(_0x237030[_0x6303('0x13')]==_0x237030[_0x6303('0x14')]&&_0x237030[_0x6303('0x15')]!='OutgoingSpoolFailed'){utils[_0x6303('0x5')](util[_0x6303('0x6')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x237030[_0x6303('0x13')],_0x237030[_0x6303('0x16')],_0x237030['exten']));channels[_0x237030[_0x6303('0x13')]]={'uniqueid':_0x237030[_0x6303('0x13')],'accountcode':_0x237030[_0x6303('0xd')],'source':_0x237030[_0x6303('0xa')],'destination':_0x237030[_0x6303('0x17')],'destinationcontext':_0x237030[_0x6303('0x16')],'channel':_0x237030[_0x6303('0x15')],'starttime':utils[_0x6303('0x18')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x6303('0x19')};}}catch(_0x2a26f2){utils[_0x6303('0x1a')](util[_0x6303('0x6')]('[%s][calls][newchannel]',_0x237030[_0x6303('0x13')]),_0x2a26f2);}};exports[_0x6303('0x1b')]=function(_0x5ae47e){try{utils['debug'](util[_0x6303('0x6')]('[%s][calls][newstate]',_0x5ae47e['uniqueid']),_0x5ae47e);if(!_['isNil'](channels[_0x5ae47e[_0x6303('0x13')]])&&_0x5ae47e[_0x6303('0x1c')]==0x6){utils[_0x6303('0x5')](util[_0x6303('0x6')](_0x6303('0x1d'),_0x5ae47e[_0x6303('0x13')],_0x5ae47e[_0x6303('0x16')],_0x5ae47e[_0x6303('0x15')]));if(_['isNil'](channels[_0x5ae47e[_0x6303('0x13')]][_0x6303('0x1e')])){channels[_0x5ae47e[_0x6303('0x13')]][_0x6303('0x1e')]=utils['now']();}}else if(!_[_0x6303('0x1f')](channels[_0x5ae47e[_0x6303('0x14')]])&&_0x5ae47e['channelstate']==0x6&&_0x5ae47e[_0x6303('0x16')]!='transfer'){utils[_0x6303('0x5')](util['format']('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x5ae47e[_0x6303('0x13')],_0x5ae47e['linkedid'],_0x5ae47e[_0x6303('0x16')],_0x5ae47e[_0x6303('0x15')]));channels[_0x5ae47e[_0x6303('0x14')]][_0x6303('0xd')]=_0x5ae47e[_0x6303('0xd')];channels[_0x5ae47e[_0x6303('0x14')]][_0x6303('0x20')]=_0x5ae47e[_0x6303('0x15')];if(_[_0x6303('0x1f')](channels[_0x5ae47e[_0x6303('0x14')]]['answertime'])){channels[_0x5ae47e[_0x6303('0x14')]][_0x6303('0x21')]=utils['now']();}channels[_0x5ae47e[_0x6303('0x14')]][_0x6303('0x22')]=dispositions[_[_0x6303('0x23')](_0x5ae47e['channelstate'])]||_0x6303('0x3');}}catch(_0x336b41){utils[_0x6303('0x1a')](util[_0x6303('0x6')](_0x6303('0x24'),_0x5ae47e[_0x6303('0x13')]),_0x336b41);}};exports[_0x6303('0x25')]=function(_0x59aa47){try{if(!_['isNil'](channels[_0x59aa47[_0x6303('0x13')]])){utils[_0x6303('0x26')](util[_0x6303('0x6')]('[%s][calls][hangup]',_0x59aa47[_0x6303('0x13')]),_0x59aa47);if(_[_0x6303('0x1f')](channels[_0x59aa47[_0x6303('0x13')]][_0x6303('0x27')])){channels[_0x59aa47[_0x6303('0x13')]]['callerid']=_0x59aa47[_0x6303('0x28')]+'\x20<'+_0x59aa47['calleridnum']+'>';}utils[_0x6303('0x5')](util[_0x6303('0x6')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x59aa47['uniqueid'],channels[_0x59aa47['uniqueid']][_0x6303('0x27')],_0x59aa47[_0x6303('0x29')]));channels[_0x59aa47[_0x6303('0x13')]][_0x6303('0x2a')]=utils[_0x6303('0x18')]();channels[_0x59aa47['uniqueid']]['duration']=utils[_0x6303('0x2b')](channels[_0x59aa47[_0x6303('0x13')]]['endtime'],channels[_0x59aa47[_0x6303('0x13')]][_0x6303('0x2c')]);channels[_0x59aa47[_0x6303('0x13')]][_0x6303('0x2d')]=channels[_0x59aa47['uniqueid']]['answertime']?utils[_0x6303('0x2b')](channels[_0x59aa47[_0x6303('0x13')]][_0x6303('0x2a')],channels[_0x59aa47[_0x6303('0x13')]][_0x6303('0x21')]):0x0;writeDB(channels[_0x59aa47[_0x6303('0x13')]]);}}catch(_0x324db3){utils[_0x6303('0x1a')](util['format'](_0x6303('0x2e'),_0x59aa47[_0x6303('0x13')]),_0x324db3);}};exports[_0x6303('0x2f')]=function(_0xc28ec2){try{if(!_[_0x6303('0x1f')](channels[_0xc28ec2['localtwolinkedid']])){utils[_0x6303('0x26')](util['format'](_0x6303('0x30'),_0xc28ec2[_0x6303('0x31')]),_0xc28ec2);if(channels[_0xc28ec2['localtwolinkedid']]['channel']==_0xc28ec2[_0x6303('0x32')]){utils[_0x6303('0x5')](util['format'](_0x6303('0x33'),_0xc28ec2[_0x6303('0x31')],_0xc28ec2[_0x6303('0x34')],_0xc28ec2[_0x6303('0x35')]));channels[_0xc28ec2[_0x6303('0x34')]][_0x6303('0x20')]=_0xc28ec2['secondtransfererchannel'];channels[_0xc28ec2['localtwolinkedid']][_0x6303('0x36')]=_0x6303('0x37');}else if(channels[_0xc28ec2['localtwolinkedid']][_0x6303('0x15')]=_0xc28ec2[_0x6303('0x38')]){utils[_0x6303('0x5')](util[_0x6303('0x6')](_0x6303('0x33'),_0xc28ec2[_0x6303('0x31')],_0xc28ec2[_0x6303('0x34')],_0xc28ec2[_0x6303('0x39')]));channels[_0xc28ec2[_0x6303('0x34')]]['destinationchannel']=_0xc28ec2[_0x6303('0x39')];channels[_0xc28ec2['localtwolinkedid']][_0x6303('0x36')]=_0x6303('0x37');}}}catch(_0xb83bdb){utils[_0x6303('0x1a')](util[_0x6303('0x6')]('[%s][calls][attendedtransfer]',_0xc28ec2[_0x6303('0x31')]),_0xb83bdb);}};exports[_0x6303('0x3a')]=function(_0x299a4e){try{if(!_[_0x6303('0x1f')](channels[_0x299a4e['uniqueid']])){utils[_0x6303('0x26')](util['format'](_0x6303('0x3b'),_0x299a4e['uniqueid']),_0x299a4e);channels[_0x299a4e[_0x6303('0x13')]][_0x6303('0x3c')]=utils['now']();utils[_0x6303('0x5')](util[_0x6303('0x6')](_0x6303('0x3d'),_0x299a4e[_0x6303('0x13')],channels[_0x299a4e['uniqueid']][_0x6303('0x3c')]));}}catch(_0x1894b1){utils[_0x6303('0x1a')](util[_0x6303('0x6')](_0x6303('0x3b'),_0x299a4e[_0x6303('0x13')]),_0x1894b1);}};exports[_0x6303('0x3e')]=function(_0x4c5506){try{if(!_[_0x6303('0x1f')](channels[_0x4c5506['uniqueid']])){utils['debug'](util['format'](_0x6303('0x3f'),_0x4c5506[_0x6303('0x13')]),_0x4c5506);if(!_[_0x6303('0x1f')](channels[_0x4c5506[_0x6303('0x13')]][_0x6303('0x3c')])){channels[_0x4c5506[_0x6303('0x13')]][_0x6303('0x40')]+=utils[_0x6303('0x2b')](utils[_0x6303('0x18')](),channels[_0x4c5506[_0x6303('0x13')]][_0x6303('0x3c')]);utils[_0x6303('0x5')](util[_0x6303('0x6')](_0x6303('0x41'),_0x4c5506[_0x6303('0x13')],channels[_0x4c5506[_0x6303('0x13')]][_0x6303('0x40')]));delete channels[_0x4c5506[_0x6303('0x13')]][_0x6303('0x3c')];}}}catch(_0x3d8568){utils[_0x6303('0x1a')](util[_0x6303('0x6')](_0x6303('0x3f'),_0x4c5506[_0x6303('0x13')]),_0x3d8568);}};exports[_0x6303('0x42')]=function(_0x165faf){try{if(!_[_0x6303('0x1f')](channels[_0x165faf[_0x6303('0x13')]])){utils[_0x6303('0x26')](util[_0x6303('0x6')](_0x6303('0x43'),_0x165faf[_0x6303('0x13')]),_0x165faf);if(!_[_0x6303('0x1f')](_0x165faf[_0x6303('0x44')]['xmd-originatecalleridnum'])){utils[_0x6303('0x5')](util[_0x6303('0x6')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x165faf[_0x6303('0x13')],_0x165faf[_0x6303('0x45')]));channels[_0x165faf[_0x6303('0x13')]]['source']=_0x165faf['value'];}if(!_['isNil'](_0x165faf['variable'][_0x6303('0x46')])){utils['info'](util['format'](_0x6303('0x47'),_0x165faf[_0x6303('0x13')],_0x165faf[_0x6303('0x45')]));channels[_0x165faf[_0x6303('0x13')]][_0x6303('0x48')]=_0x165faf[_0x6303('0x45')];channels[_0x165faf['uniqueid']][_0x6303('0x27')]='\x22'+_0x165faf[_0x6303('0x45')]+_0x6303('0x49')+_0x165faf[_0x6303('0x45')]+'>';}if(!_[_0x6303('0x1f')](_0x165faf['variable'][_0x6303('0x4a')])||!_[_0x6303('0x1f')](_0x165faf['variable'][_0x6303('0x4b')])){utils[_0x6303('0x5')](util[_0x6303('0x6')](_0x6303('0x4c'),_0x165faf[_0x6303('0x13')],!_['isNil'](_0x165faf[_0x6303('0x44')][_0x6303('0x4a')])?_0x6303('0x4a'):_0x6303('0x4b'),_0x165faf['value']));channels[_0x165faf[_0x6303('0x13')]][_0x6303('0x27')]=_0x165faf[_0x6303('0x45')];}if(!_['isNil'](_0x165faf[_0x6303('0x44')][_0x6303('0x4d')])||!_[_0x6303('0x1f')](_0x165faf[_0x6303('0x44')]['xmcs-queue'])){utils[_0x6303('0x5')](util[_0x6303('0x6')](_0x6303('0x4c'),_0x165faf['uniqueid'],!_['isNil'](_0x165faf['variable']['xmd-queue'])?_0x6303('0x4d'):_0x6303('0x4e'),_0x165faf[_0x6303('0x45')]));channels[_0x165faf[_0x6303('0x13')]]['lastapplication']=_0x6303('0x4f');channels[_0x165faf[_0x6303('0x13')]][_0x6303('0x50')]=_0x165faf['value'];channels[_0x165faf[_0x6303('0x13')]][_0x6303('0x7')]=!![];}if(!_['isNil'](_0x165faf['variable']['xmd-contactid'])){utils['info'](util[_0x6303('0x6')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x165faf[_0x6303('0x13')],_0x165faf['value']));channels[_0x165faf[_0x6303('0x13')]][_0x6303('0x51')]=_0x165faf[_0x6303('0x45')];}if(!_[_0x6303('0x1f')](_0x165faf['variable'][_0x6303('0x52')])){utils[_0x6303('0x5')](util['format'](_0x6303('0x53'),_0x165faf[_0x6303('0x13')],_0x165faf[_0x6303('0x45')]));channels[_0x165faf['uniqueid']][_0x6303('0x54')]=_0x165faf[_0x6303('0x45')];}if(!_[_0x6303('0x1f')](_0x165faf[_0x6303('0x44')][_0x6303('0x55')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x165faf[_0x6303('0x13')],_0x165faf[_0x6303('0x45')]));channels[_0x165faf[_0x6303('0x13')]][_0x6303('0x56')]=_0x165faf[_0x6303('0x45')];}if(!_[_0x6303('0x1f')](_0x165faf[_0x6303('0x44')]['sipcallid'])){utils[_0x6303('0x5')](util[_0x6303('0x6')](_0x6303('0x57'),_0x165faf[_0x6303('0x13')],_0x165faf[_0x6303('0x45')]));channels[_0x165faf[_0x6303('0x13')]]['sipcallid']=_0x165faf[_0x6303('0x45')];}}}catch(_0x39ff83){utils[_0x6303('0x1a')](util[_0x6303('0x6')]('[%s][calls][varset]',_0x165faf[_0x6303('0x13')]),_0x39ff83);}};exports[_0x6303('0x58')]=function(_0x18d075){try{if(!_['isNil'](channels[_0x18d075['uniqueid']])){utils[_0x6303('0x26')](util[_0x6303('0x6')](_0x6303('0x59'),_0x18d075[_0x6303('0x13')]),_0x18d075);utils['info'](util['format'](_0x6303('0x5a'),_0x18d075[_0x6303('0x13')],_0x18d075[_0x6303('0x5b')],_0x18d075[_0x6303('0x5c')]));if(_0x18d075[_0x6303('0x5b')][_0x6303('0x5d')]()==_0x6303('0x5e')&&_[_0x6303('0x5f')](_0x18d075[_0x6303('0x5c')][_0x6303('0x5d')](),'cdr')){var _0x5583b8=_0x18d075[_0x6303('0x5c')]['split']('=');var _0x5bd814=_0x5583b8[0x0][_0x6303('0x60')](_0x5583b8[0x0][_0x6303('0x61')]('(')+0x1,_0x5583b8[0x0]['lastIndexOf'](')'));var _0x332153=_0x5583b8[0x1];channels[_0x18d075['uniqueid']][_0x5bd814]=_0x332153;}if(!_[_0x6303('0x62')](['hangup','noop',_0x6303('0x63'),'set',_0x6303('0x64')],_0x18d075['application']['toLowerCase']())){channels[_0x18d075[_0x6303('0x13')]][_0x6303('0x65')]=_0x18d075[_0x6303('0x5b')];channels[_0x18d075[_0x6303('0x13')]][_0x6303('0x50')]=_0x18d075['appdata'];}}}catch(_0x2e41f7){utils[_0x6303('0x1a')](util[_0x6303('0x6')](_0x6303('0x59'),_0x18d075[_0x6303('0x13')]),_0x2e41f7);}}; \ No newline at end of file +var _0xe8f5=['lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','DOCUMENTATION','error','newstate','debug','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][newstate]','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','diffTime','starttime','billableseconds','attendedtransfer','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','Queue','lastdata','queue','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','lastIndexOf','noop','execif','set','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','uniqueid','channel','interface','calleridnum'];(function(_0x46b58b,_0x40a0b8){var _0x2dcb82=function(_0x3f08f7){while(--_0x3f08f7){_0x46b58b['push'](_0x46b58b['shift']());}};_0x2dcb82(++_0x40a0b8);}(_0xe8f5,0x1f3));var _0x5e8f=function(_0x395e55,_0x121520){_0x395e55=_0x395e55-0x0;var _0x1ab1d1=_0xe8f5[_0x395e55];return _0x1ab1d1;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x5e8f('0x0'));var dispositions=[_0x5e8f('0x1'),_0x5e8f('0x2'),'FAILED','NO\x20ANSWER','NO\x20ANSWER',_0x5e8f('0x1'),_0x5e8f('0x3'),_0x5e8f('0x4'),'FAILED',_0x5e8f('0x2'),_0x5e8f('0x2')];var channels={};function writeDB(_0x46df60){utils[_0x5e8f('0x5')](util[_0x5e8f('0x6')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x46df60[_0x5e8f('0x7')],_0x46df60[_0x5e8f('0x8')],_0x46df60['queue'],_0x46df60['membername'],_0x46df60[_0x5e8f('0x9')],_0x46df60[_0x5e8f('0xa')],_0x46df60['connectedlinenum'],_0x46df60[_0x5e8f('0xb')]));if(_0x46df60[_0x5e8f('0xc')]){utils[_0x5e8f('0xd')](_0x46df60[_0x5e8f('0xc')])[_0x5e8f('0xe')](function(_0x512acc){if(_0x512acc){_0x46df60[_0x5e8f('0xf')]=_0x512acc['id'];}utils['request'](_0x5e8f('0x10'),_0x46df60);});}else{utils[_0x5e8f('0x11')](_0x5e8f('0x10'),_0x46df60);}if(channels[_0x46df60[_0x5e8f('0x7')]]){delete channels[_0x46df60[_0x5e8f('0x7')]];}}exports['newchannel']=function(_0x19a771){try{utils['debug'](util[_0x5e8f('0x6')](_0x5e8f('0x12'),_0x19a771['uniqueid']),_0x19a771);if(_0x19a771[_0x5e8f('0x7')]==_0x19a771[_0x5e8f('0x13')]&&_0x19a771[_0x5e8f('0x8')]!=_0x5e8f('0x14')){utils['info'](util[_0x5e8f('0x6')](_0x5e8f('0x15'),_0x19a771['uniqueid'],_0x19a771['context'],_0x19a771['exten']));channels[_0x19a771[_0x5e8f('0x7')]]={'uniqueid':_0x19a771[_0x5e8f('0x7')],'accountcode':_0x19a771[_0x5e8f('0xc')],'source':_0x19a771['calleridnum'],'destination':_0x19a771[_0x5e8f('0x16')],'destinationcontext':_0x19a771[_0x5e8f('0x17')],'channel':_0x19a771['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x5e8f('0x1'),'amaflags':_0x5e8f('0x18')};}}catch(_0x35b52c){utils[_0x5e8f('0x19')](util[_0x5e8f('0x6')](_0x5e8f('0x12'),_0x19a771['uniqueid']),_0x35b52c);}};exports[_0x5e8f('0x1a')]=function(_0x1221b7){try{utils[_0x5e8f('0x1b')](util[_0x5e8f('0x6')]('[%s][calls][newstate]',_0x1221b7[_0x5e8f('0x7')]),_0x1221b7);if(!_[_0x5e8f('0x1c')](channels[_0x1221b7[_0x5e8f('0x7')]])&&_0x1221b7[_0x5e8f('0x1d')]==0x6){utils['info'](util['format'](_0x5e8f('0x1e'),_0x1221b7[_0x5e8f('0x7')],_0x1221b7['context'],_0x1221b7['channel']));if(_[_0x5e8f('0x1c')](channels[_0x1221b7[_0x5e8f('0x7')]][_0x5e8f('0x1f')])){channels[_0x1221b7[_0x5e8f('0x7')]][_0x5e8f('0x1f')]=utils[_0x5e8f('0x20')]();}}else if(!_[_0x5e8f('0x1c')](channels[_0x1221b7[_0x5e8f('0x13')]])&&_0x1221b7[_0x5e8f('0x1d')]==0x6&&_0x1221b7[_0x5e8f('0x17')]!=_0x5e8f('0x21')){utils[_0x5e8f('0x5')](util[_0x5e8f('0x6')](_0x5e8f('0x22'),_0x1221b7[_0x5e8f('0x7')],_0x1221b7[_0x5e8f('0x13')],_0x1221b7[_0x5e8f('0x17')],_0x1221b7['channel']));channels[_0x1221b7[_0x5e8f('0x13')]]['accountcode']=_0x1221b7[_0x5e8f('0xc')];channels[_0x1221b7['linkedid']][_0x5e8f('0x23')]=_0x1221b7['channel'];if(_[_0x5e8f('0x1c')](channels[_0x1221b7[_0x5e8f('0x13')]][_0x5e8f('0x24')])){channels[_0x1221b7['linkedid']][_0x5e8f('0x24')]=utils['now']();}channels[_0x1221b7[_0x5e8f('0x13')]][_0x5e8f('0x25')]=dispositions[_[_0x5e8f('0x26')](_0x1221b7[_0x5e8f('0x1d')])]||_0x5e8f('0x3');}}catch(_0x4bb09e){utils[_0x5e8f('0x19')](util['format'](_0x5e8f('0x27'),_0x1221b7[_0x5e8f('0x7')]),_0x4bb09e);}};exports[_0x5e8f('0x28')]=function(_0x2219b7){try{if(!_[_0x5e8f('0x1c')](channels[_0x2219b7[_0x5e8f('0x7')]])){utils['debug'](util[_0x5e8f('0x6')]('[%s][calls][hangup]',_0x2219b7[_0x5e8f('0x7')]),_0x2219b7);if(_[_0x5e8f('0x1c')](channels[_0x2219b7[_0x5e8f('0x7')]][_0x5e8f('0x29')])){channels[_0x2219b7[_0x5e8f('0x7')]]['callerid']=_0x2219b7[_0x5e8f('0x2a')]+'\x20<'+_0x2219b7[_0x5e8f('0xa')]+'>';}utils[_0x5e8f('0x5')](util[_0x5e8f('0x6')](_0x5e8f('0x2b'),_0x2219b7[_0x5e8f('0x7')],channels[_0x2219b7[_0x5e8f('0x7')]][_0x5e8f('0x29')],_0x2219b7[_0x5e8f('0x2c')]));channels[_0x2219b7['uniqueid']][_0x5e8f('0x2d')]=utils[_0x5e8f('0x20')]();channels[_0x2219b7[_0x5e8f('0x7')]]['duration']=utils[_0x5e8f('0x2e')](channels[_0x2219b7[_0x5e8f('0x7')]][_0x5e8f('0x2d')],channels[_0x2219b7['uniqueid']][_0x5e8f('0x2f')]);channels[_0x2219b7[_0x5e8f('0x7')]][_0x5e8f('0x30')]=channels[_0x2219b7[_0x5e8f('0x7')]]['answertime']?utils['diffTime'](channels[_0x2219b7[_0x5e8f('0x7')]][_0x5e8f('0x2d')],channels[_0x2219b7[_0x5e8f('0x7')]][_0x5e8f('0x24')]):0x0;writeDB(channels[_0x2219b7[_0x5e8f('0x7')]]);}}catch(_0x4964c3){utils[_0x5e8f('0x19')](util[_0x5e8f('0x6')]('[%s][calls][hangup]',_0x2219b7[_0x5e8f('0x7')]),_0x4964c3);}};exports[_0x5e8f('0x31')]=function(_0x40f557){try{if(!_[_0x5e8f('0x1c')](channels[_0x40f557['localtwolinkedid']])){utils['debug'](util['format']('[%s][calls][attendedtransfer]',_0x40f557[_0x5e8f('0x32')]),_0x40f557);if(channels[_0x40f557[_0x5e8f('0x33')]]['channel']==_0x40f557[_0x5e8f('0x34')]){utils[_0x5e8f('0x5')](util['format'](_0x5e8f('0x35'),_0x40f557[_0x5e8f('0x32')],_0x40f557[_0x5e8f('0x33')],_0x40f557[_0x5e8f('0x36')]));channels[_0x40f557[_0x5e8f('0x33')]][_0x5e8f('0x23')]=_0x40f557['secondtransfererchannel'];channels[_0x40f557[_0x5e8f('0x33')]][_0x5e8f('0x37')]=_0x5e8f('0x38');}else if(channels[_0x40f557[_0x5e8f('0x33')]][_0x5e8f('0x8')]=_0x40f557[_0x5e8f('0x39')]){utils[_0x5e8f('0x5')](util['format'](_0x5e8f('0x35'),_0x40f557[_0x5e8f('0x32')],_0x40f557[_0x5e8f('0x33')],_0x40f557[_0x5e8f('0x3a')]));channels[_0x40f557[_0x5e8f('0x33')]][_0x5e8f('0x23')]=_0x40f557[_0x5e8f('0x3a')];channels[_0x40f557['localtwolinkedid']][_0x5e8f('0x37')]=_0x5e8f('0x38');}}}catch(_0x392083){utils[_0x5e8f('0x19')](util[_0x5e8f('0x6')]('[%s][calls][attendedtransfer]',_0x40f557[_0x5e8f('0x32')]),_0x392083);}};exports[_0x5e8f('0x3b')]=function(_0x3a7fa5){try{if(!_[_0x5e8f('0x1c')](channels[_0x3a7fa5[_0x5e8f('0x7')]])){utils['debug'](util[_0x5e8f('0x6')]('[%s][calls][musiconholdstart]',_0x3a7fa5[_0x5e8f('0x7')]),_0x3a7fa5);channels[_0x3a7fa5[_0x5e8f('0x7')]][_0x5e8f('0x3c')]=utils[_0x5e8f('0x20')]();utils[_0x5e8f('0x5')](util[_0x5e8f('0x6')](_0x5e8f('0x3d'),_0x3a7fa5[_0x5e8f('0x7')],channels[_0x3a7fa5[_0x5e8f('0x7')]]['musiconholdstartAt']));}}catch(_0x21788c){utils[_0x5e8f('0x19')](util[_0x5e8f('0x6')](_0x5e8f('0x3e'),_0x3a7fa5['uniqueid']),_0x21788c);}};exports[_0x5e8f('0x3f')]=function(_0x5e94e6){try{if(!_[_0x5e8f('0x1c')](channels[_0x5e94e6[_0x5e8f('0x7')]])){utils[_0x5e8f('0x1b')](util[_0x5e8f('0x6')](_0x5e8f('0x40'),_0x5e94e6[_0x5e8f('0x7')]),_0x5e94e6);if(!_[_0x5e8f('0x1c')](channels[_0x5e94e6[_0x5e8f('0x7')]][_0x5e8f('0x3c')])){channels[_0x5e94e6['uniqueid']][_0x5e8f('0x41')]+=utils['diffTime'](utils['now'](),channels[_0x5e94e6[_0x5e8f('0x7')]]['musiconholdstartAt']);utils[_0x5e8f('0x5')](util[_0x5e8f('0x6')](_0x5e8f('0x42'),_0x5e94e6['uniqueid'],channels[_0x5e94e6['uniqueid']][_0x5e8f('0x41')]));delete channels[_0x5e94e6[_0x5e8f('0x7')]][_0x5e8f('0x3c')];}}}catch(_0x163e8c){utils[_0x5e8f('0x19')](util[_0x5e8f('0x6')](_0x5e8f('0x40'),_0x5e94e6[_0x5e8f('0x7')]),_0x163e8c);}};exports[_0x5e8f('0x43')]=function(_0x5ce7da){try{if(!_[_0x5e8f('0x1c')](channels[_0x5ce7da['uniqueid']])){utils[_0x5e8f('0x1b')](util[_0x5e8f('0x6')](_0x5e8f('0x44'),_0x5ce7da[_0x5e8f('0x7')]),_0x5ce7da);if(!_[_0x5e8f('0x1c')](_0x5ce7da[_0x5e8f('0x45')][_0x5e8f('0x46')])){utils[_0x5e8f('0x5')](util['format'](_0x5e8f('0x47'),_0x5ce7da[_0x5e8f('0x7')],_0x5ce7da['value']));channels[_0x5ce7da[_0x5e8f('0x7')]]['source']=_0x5ce7da[_0x5e8f('0x48')];}if(!_['isNil'](_0x5ce7da['variable']['xmd-phone'])){utils[_0x5e8f('0x5')](util[_0x5e8f('0x6')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x5ce7da['uniqueid'],_0x5ce7da[_0x5e8f('0x48')]));channels[_0x5ce7da[_0x5e8f('0x7')]]['destination']=_0x5ce7da['value'];channels[_0x5ce7da[_0x5e8f('0x7')]][_0x5e8f('0x29')]='\x22'+_0x5ce7da[_0x5e8f('0x48')]+_0x5e8f('0x49')+_0x5ce7da['value']+'>';}if(!_[_0x5e8f('0x1c')](_0x5ce7da[_0x5e8f('0x45')][_0x5e8f('0x4a')])||!_[_0x5e8f('0x1c')](_0x5ce7da['variable'][_0x5e8f('0x4b')])){utils[_0x5e8f('0x5')](util[_0x5e8f('0x6')](_0x5e8f('0x4c'),_0x5ce7da[_0x5e8f('0x7')],!_['isNil'](_0x5ce7da['variable']['xmd-callerid-preview'])?'xmd-callerid-preview':_0x5e8f('0x4b'),_0x5ce7da[_0x5e8f('0x48')]));channels[_0x5ce7da[_0x5e8f('0x7')]]['callerid']=_0x5ce7da[_0x5e8f('0x48')];}if(!_['isNil'](_0x5ce7da[_0x5e8f('0x45')][_0x5e8f('0x4d')])||!_[_0x5e8f('0x1c')](_0x5ce7da[_0x5e8f('0x45')]['xmcs-queue'])){utils['info'](util[_0x5e8f('0x6')](_0x5e8f('0x4c'),_0x5ce7da[_0x5e8f('0x7')],!_[_0x5e8f('0x1c')](_0x5ce7da[_0x5e8f('0x45')][_0x5e8f('0x4d')])?_0x5e8f('0x4d'):_0x5e8f('0x4e'),_0x5ce7da[_0x5e8f('0x48')]));channels[_0x5ce7da[_0x5e8f('0x7')]]['lastapplication']=_0x5e8f('0x4f');channels[_0x5ce7da['uniqueid']][_0x5e8f('0x50')]=_0x5ce7da[_0x5e8f('0x48')];channels[_0x5ce7da[_0x5e8f('0x7')]][_0x5e8f('0x51')]=!![];}if(!_[_0x5e8f('0x1c')](_0x5ce7da[_0x5e8f('0x45')]['xmd-contactid'])){utils['info'](util[_0x5e8f('0x6')](_0x5e8f('0x52'),_0x5ce7da['uniqueid'],_0x5ce7da[_0x5e8f('0x48')]));channels[_0x5ce7da[_0x5e8f('0x7')]][_0x5e8f('0x53')]=_0x5ce7da[_0x5e8f('0x48')];}if(!_[_0x5e8f('0x1c')](_0x5ce7da[_0x5e8f('0x45')][_0x5e8f('0x54')])){utils[_0x5e8f('0x5')](util['format'](_0x5e8f('0x55'),_0x5ce7da['uniqueid'],_0x5ce7da[_0x5e8f('0x48')]));channels[_0x5ce7da[_0x5e8f('0x7')]]['type']=_0x5ce7da[_0x5e8f('0x48')];}if(!_[_0x5e8f('0x1c')](_0x5ce7da['variable'][_0x5e8f('0x56')])){utils['info'](util[_0x5e8f('0x6')](_0x5e8f('0x57'),_0x5ce7da[_0x5e8f('0x7')],_0x5ce7da[_0x5e8f('0x48')]));channels[_0x5ce7da[_0x5e8f('0x7')]][_0x5e8f('0x58')]=_0x5ce7da[_0x5e8f('0x48')];}if(!_[_0x5e8f('0x1c')](_0x5ce7da[_0x5e8f('0x45')]['sipcallid'])){utils[_0x5e8f('0x5')](util[_0x5e8f('0x6')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x5ce7da[_0x5e8f('0x7')],_0x5ce7da[_0x5e8f('0x48')]));channels[_0x5ce7da[_0x5e8f('0x7')]][_0x5e8f('0x59')]=_0x5ce7da['value'];}}}catch(_0x368301){utils[_0x5e8f('0x19')](util['format']('[%s][calls][varset]',_0x5ce7da[_0x5e8f('0x7')]),_0x368301);}};exports[_0x5e8f('0x5a')]=function(_0x26c3e0){try{if(!_[_0x5e8f('0x1c')](channels[_0x26c3e0[_0x5e8f('0x7')]])){utils[_0x5e8f('0x1b')](util[_0x5e8f('0x6')](_0x5e8f('0x5b'),_0x26c3e0[_0x5e8f('0x7')]),_0x26c3e0);utils[_0x5e8f('0x5')](util[_0x5e8f('0x6')](_0x5e8f('0x5c'),_0x26c3e0[_0x5e8f('0x7')],_0x26c3e0[_0x5e8f('0x5d')],_0x26c3e0[_0x5e8f('0x5e')]));if(_0x26c3e0[_0x5e8f('0x5d')][_0x5e8f('0x5f')]()=='set'&&_[_0x5e8f('0x60')](_0x26c3e0[_0x5e8f('0x5e')][_0x5e8f('0x5f')](),_0x5e8f('0x61'))){var _0x5dd791=_0x26c3e0['appdata']['split']('=');var _0x189cec=_0x5dd791[0x0]['substring'](_0x5dd791[0x0][_0x5e8f('0x62')]('(')+0x1,_0x5dd791[0x0][_0x5e8f('0x62')](')'));var _0x158955=_0x5dd791[0x1];channels[_0x26c3e0['uniqueid']][_0x189cec]=_0x158955;}if(!_['includes']([_0x5e8f('0x28'),_0x5e8f('0x63'),_0x5e8f('0x64'),_0x5e8f('0x65'),'gotoif'],_0x26c3e0[_0x5e8f('0x5d')][_0x5e8f('0x5f')]())){channels[_0x26c3e0['uniqueid']]['lastapplication']=_0x26c3e0[_0x5e8f('0x5d')];channels[_0x26c3e0[_0x5e8f('0x7')]][_0x5e8f('0x50')]=_0x26c3e0['appdata'];}}}catch(_0x1ec3ca){utils[_0x5e8f('0x19')](util[_0x5e8f('0x6')](_0x5e8f('0x5b'),_0x26c3e0[_0x5e8f('0x7')]),_0x1ec3ca);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 1bb5aa7..1afaa8d 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 _0x1bd8=['shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','managerevent','./utils','info','[core]\x20connected'];(function(_0x2a688b,_0x4d5f27){var _0x28625d=function(_0x47a32a){while(--_0x47a32a){_0x2a688b['push'](_0x2a688b['shift']());}};_0x28625d(++_0x4d5f27);}(_0x1bd8,0xfa));var _0x81bd=function(_0x100713,_0x149c3f){_0x100713=_0x100713-0x0;var _0x48beff=_0x1bd8[_0x100713];return _0x48beff;};'use strict';var utils=require(_0x81bd('0x0'));exports['connect']=function(){utils[_0x81bd('0x1')](_0x81bd('0x2'));};exports[_0x81bd('0x3')]=function(){utils[_0x81bd('0x1')](_0x81bd('0x4'));};exports[_0x81bd('0x5')]=function(){utils[_0x81bd('0x1')](_0x81bd('0x6'));};exports['error']=function(_0x58f8cb){utils[_0x81bd('0x7')](_0x81bd('0x8'),_0x58f8cb);};exports[_0x81bd('0x9')]=function(){utils[_0x81bd('0x1')]('[core]\x20close');};exports[_0x81bd('0xa')]=function(_0x42e0eb){}; \ No newline at end of file +var _0xe33c=['managerevent','connect','[core]\x20connected','shutdown','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x5d3dbf,_0x3aa316){var _0x196187=function(_0x25dac0){while(--_0x25dac0){_0x5d3dbf['push'](_0x5d3dbf['shift']());}};_0x196187(++_0x3aa316);}(_0xe33c,0xbc));var _0xce33=function(_0x185209,_0x46b18e){_0x185209=_0x185209-0x0;var _0x450c54=_0xe33c[_0x185209];return _0x450c54;};'use strict';var utils=require('./utils');exports[_0xce33('0x0')]=function(){utils['info'](_0xce33('0x1'));};exports[_0xce33('0x2')]=function(){utils[_0xce33('0x3')](_0xce33('0x4'));};exports[_0xce33('0x5')]=function(){utils[_0xce33('0x3')](_0xce33('0x6'));};exports[_0xce33('0x7')]=function(_0x345c9f){utils[_0xce33('0x7')](_0xce33('0x8'),_0x345c9f);};exports[_0xce33('0x9')]=function(){utils['info']('[core]\x20close');};exports[_0xce33('0xa')]=function(_0x1f7838){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 787b7c9..17ffc1a 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 _0x95fb=['starttime','now','lastevent','dialend','[%s][dials][dialend]','ANSWER','assign','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','cause-txt','diffTime','endtime','holdtime','billableseconds','[%s][dials][hangup]','lodash','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','error','varset','isNil','variable','outboundrouteid','value','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]'];(function(_0x1d930e,_0x20d8b8){var _0x5bbd66=function(_0x3c7488){while(--_0x3c7488){_0x1d930e['push'](_0x1d930e['shift']());}};_0x5bbd66(++_0x20d8b8);}(_0x95fb,0x1f2));var _0xb95f=function(_0x3740c3,_0x38e529){_0x3740c3=_0x3740c3-0x0;var _0x2c4749=_0x95fb[_0x3740c3];return _0x2c4749;};'use strict';var _=require(_0xb95f('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x5a55d3){utils[_0xb95f('0x1')](util[_0xb95f('0x2')](_0xb95f('0x3'),_0x5a55d3['uniqueid'],_0x5a55d3[_0xb95f('0x4')],_0x5a55d3[_0xb95f('0x5')],_0x5a55d3['calleridnum'],_0x5a55d3[_0xb95f('0x6')],_0x5a55d3[_0xb95f('0x7')]));utils[_0xb95f('0x8')](_0xb95f('0x9'),_0x5a55d3);delete dials[_0x5a55d3[_0xb95f('0xa')]];}exports[_0xb95f('0xb')]=function(_0x2e0463){try{utils[_0xb95f('0xc')](util['format'](_0xb95f('0xd'),_0x2e0463['uniqueid']),_0x2e0463);utils[_0xb95f('0x1')](util[_0xb95f('0x2')](_0xb95f('0xe'),_0x2e0463[_0xb95f('0xa')],_0x2e0463[_0xb95f('0xf')],_0x2e0463[_0xb95f('0x10')]));if(_0x2e0463[_0xb95f('0xf')][_0xb95f('0x11')]()==_0xb95f('0x12')&&_[_0xb95f('0x13')](_0x2e0463[_0xb95f('0x10')]['toLowerCase'](),_0xb95f('0x14'))){var _0x4390bf=_0x2e0463['appdata']['split']('=');dials[_0x2e0463[_0xb95f('0xa')]]={'routeId':_0x4390bf[0x1]};}}catch(_0x1882cb){utils[_0xb95f('0x15')](util[_0xb95f('0x2')](_0xb95f('0xd'),_0x2e0463[_0xb95f('0xa')]),_0x1882cb);}};exports[_0xb95f('0x16')]=function(_0x142c3d){try{utils['debug'](util[_0xb95f('0x2')]('[%s][dials][varset]',_0x142c3d['uniqueid']),_0x142c3d);if(!_[_0xb95f('0x17')](_0x142c3d[_0xb95f('0x18')][_0xb95f('0x19')])){utils[_0xb95f('0x1')](util[_0xb95f('0x2')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x142c3d[_0xb95f('0xa')],_0x142c3d['value']));dials[_0x142c3d['uniqueid']]={'routeId':_0x142c3d[_0xb95f('0x1a')]};}}catch(_0x5c07f3){utils[_0xb95f('0x15')](util[_0xb95f('0x2')](_0xb95f('0x1b'),_0x142c3d[_0xb95f('0xa')]),_0x5c07f3);}};exports[_0xb95f('0x1c')]=function(_0x41aa03){try{if(!_[_0xb95f('0x17')](dials[_0x41aa03['uniqueid']])){utils['debug'](util[_0xb95f('0x2')](_0xb95f('0x1d'),_0x41aa03[_0xb95f('0xa')]),_0x41aa03);dials[_0x41aa03[_0xb95f('0xa')]]=_['assign'](dials[_0x41aa03[_0xb95f('0xa')]],_0x41aa03);dials[_0x41aa03['uniqueid']][_0xb95f('0x1e')]=utils[_0xb95f('0x1f')]();dials[_0x41aa03[_0xb95f('0xa')]][_0xb95f('0x20')]='called';utils['info'](util[_0xb95f('0x2')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x41aa03[_0xb95f('0xa')],dials[_0x41aa03[_0xb95f('0xa')]][_0xb95f('0x1e')]));}}catch(_0x5cc04a){utils[_0xb95f('0x15')](util[_0xb95f('0x2')](_0xb95f('0x1d'),_0x41aa03['uniqueid']),_0x5cc04a);}};exports[_0xb95f('0x21')]=function(_0x51ad9a){try{if(!_[_0xb95f('0x17')](dials[_0x51ad9a[_0xb95f('0xa')]])){utils[_0xb95f('0xc')](util['format'](_0xb95f('0x22'),_0x51ad9a['uniqueid']),_0x51ad9a);dials[_0x51ad9a[_0xb95f('0xa')]]['dialstatus']=_0x51ad9a[_0xb95f('0x7')];if(_0x51ad9a[_0xb95f('0x7')]==_0xb95f('0x23')){dials[_0x51ad9a[_0xb95f('0xa')]]=_[_0xb95f('0x24')](dials[_0x51ad9a[_0xb95f('0xa')]],_0x51ad9a);dials[_0x51ad9a[_0xb95f('0xa')]]['answertime']=utils[_0xb95f('0x1f')]();dials[_0x51ad9a['uniqueid']][_0xb95f('0x20')]=_0xb95f('0x25');utils[_0xb95f('0x1')](util[_0xb95f('0x2')](_0xb95f('0x26'),_0x51ad9a['uniqueid'],_0x51ad9a[_0xb95f('0x7')],dials[_0x51ad9a[_0xb95f('0xa')]][_0xb95f('0x27')]));}else{utils[_0xb95f('0x1')](util[_0xb95f('0x2')]('[%s][dials][dialend]\x20dialstatus:%s',_0x51ad9a[_0xb95f('0xa')],_0x51ad9a[_0xb95f('0x7')]));}}}catch(_0x5f3ad3){utils[_0xb95f('0x15')](util[_0xb95f('0x2')](_0xb95f('0x22'),_0x51ad9a[_0xb95f('0xa')]),_0x5f3ad3);}};exports['hangup']=function(_0x1e8b44){try{if(!_['isNil'](dials[_0x1e8b44['uniqueid']])){utils['debug'](util['format']('[%s][dials][hangup]',_0x1e8b44[_0xb95f('0xa')]),_0x1e8b44);utils[_0xb95f('0x1')](util[_0xb95f('0x2')](_0xb95f('0x28'),_0x1e8b44[_0xb95f('0xa')],_0x1e8b44[_0xb95f('0x29')],_0x1e8b44['calleridname'],_0x1e8b44[_0xb95f('0x2a')]));dials[_0x1e8b44[_0xb95f('0xa')]]=_[_0xb95f('0x24')](dials[_0x1e8b44['uniqueid']],{'endtime':utils[_0xb95f('0x1f')](),'lastevent':'complete'});dials[_0x1e8b44[_0xb95f('0xa')]]['duration']=utils[_0xb95f('0x2b')](dials[_0x1e8b44[_0xb95f('0xa')]][_0xb95f('0x2c')],dials[_0x1e8b44[_0xb95f('0xa')]][_0xb95f('0x1e')]);dials[_0x1e8b44[_0xb95f('0xa')]][_0xb95f('0x2d')]=utils[_0xb95f('0x2b')](dials[_0x1e8b44[_0xb95f('0xa')]][_0xb95f('0x27')]||dials[_0x1e8b44[_0xb95f('0xa')]]['endtime'],dials[_0x1e8b44[_0xb95f('0xa')]][_0xb95f('0x1e')]);dials[_0x1e8b44[_0xb95f('0xa')]][_0xb95f('0x2e')]=dials[_0x1e8b44[_0xb95f('0xa')]][_0xb95f('0x27')]?utils[_0xb95f('0x2b')](dials[_0x1e8b44['uniqueid']]['endtime'],dials[_0x1e8b44[_0xb95f('0xa')]]['answertime']):0x0;writeDB(dials[_0x1e8b44['uniqueid']]);}}catch(_0x32b0f7){utils[_0xb95f('0x15')](util['format'](_0xb95f('0x2f'),_0x1e8b44[_0xb95f('0xa')]),_0x32b0f7);}}; \ No newline at end of file +var _0xfca5=['[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','dialstatus','request','CreateVoiceDialReport','newexten','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','[%s][dials][newexten]','varset','debug','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','assign','starttime','lastevent','called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup'];(function(_0x3c37c4,_0x4c4258){var _0x319c7b=function(_0x3b6d8f){while(--_0x3b6d8f){_0x3c37c4['push'](_0x3c37c4['shift']());}};_0x319c7b(++_0x4c4258);}(_0xfca5,0x1d4));var _0x5fca=function(_0x36f47c,_0x38ef4d){_0x36f47c=_0x36f47c-0x0;var _0x296c55=_0xfca5[_0x36f47c];return _0x296c55;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x5fca('0x0'));var dials={};function writeDB(_0x13fa13){utils[_0x5fca('0x1')](util[_0x5fca('0x2')](_0x5fca('0x3'),_0x13fa13[_0x5fca('0x4')],_0x13fa13[_0x5fca('0x5')],_0x13fa13['dialstring'],_0x13fa13[_0x5fca('0x6')],_0x13fa13['connectedlinenum'],_0x13fa13[_0x5fca('0x7')]));utils[_0x5fca('0x8')](_0x5fca('0x9'),_0x13fa13);delete dials[_0x13fa13[_0x5fca('0x4')]];}exports[_0x5fca('0xa')]=function(_0x4416ec){try{utils['debug'](util['format']('[%s][dials][newexten]',_0x4416ec[_0x5fca('0x4')]),_0x4416ec);utils[_0x5fca('0x1')](util[_0x5fca('0x2')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x4416ec[_0x5fca('0x4')],_0x4416ec[_0x5fca('0xb')],_0x4416ec[_0x5fca('0xc')]));if(_0x4416ec['application'][_0x5fca('0xd')]()==_0x5fca('0xe')&&_[_0x5fca('0xf')](_0x4416ec[_0x5fca('0xc')][_0x5fca('0xd')](),_0x5fca('0x10'))){var _0x14c079=_0x4416ec[_0x5fca('0xc')][_0x5fca('0x11')]('=');dials[_0x4416ec[_0x5fca('0x4')]]={'routeId':_0x14c079[0x1]};}}catch(_0x3c1e16){utils['error'](util[_0x5fca('0x2')](_0x5fca('0x12'),_0x4416ec[_0x5fca('0x4')]),_0x3c1e16);}};exports[_0x5fca('0x13')]=function(_0x163526){try{utils[_0x5fca('0x14')](util[_0x5fca('0x2')]('[%s][dials][varset]',_0x163526[_0x5fca('0x4')]),_0x163526);if(!_[_0x5fca('0x15')](_0x163526[_0x5fca('0x16')][_0x5fca('0x17')])){utils[_0x5fca('0x1')](util[_0x5fca('0x2')](_0x5fca('0x18'),_0x163526[_0x5fca('0x4')],_0x163526[_0x5fca('0x19')]));dials[_0x163526['uniqueid']]={'routeId':_0x163526[_0x5fca('0x19')]};}}catch(_0x48c92b){utils[_0x5fca('0x1a')](util[_0x5fca('0x2')]('[%s][dials][varset]',_0x163526[_0x5fca('0x4')]),_0x48c92b);}};exports[_0x5fca('0x1b')]=function(_0x1be448){try{if(!_[_0x5fca('0x15')](dials[_0x1be448[_0x5fca('0x4')]])){utils[_0x5fca('0x14')](util[_0x5fca('0x2')]('[%s][dials][dialbegin]',_0x1be448[_0x5fca('0x4')]),_0x1be448);dials[_0x1be448['uniqueid']]=_[_0x5fca('0x1c')](dials[_0x1be448[_0x5fca('0x4')]],_0x1be448);dials[_0x1be448[_0x5fca('0x4')]][_0x5fca('0x1d')]=utils['now']();dials[_0x1be448[_0x5fca('0x4')]][_0x5fca('0x1e')]=_0x5fca('0x1f');utils[_0x5fca('0x1')](util[_0x5fca('0x2')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x1be448[_0x5fca('0x4')],dials[_0x1be448[_0x5fca('0x4')]]['starttime']));}}catch(_0x18db29){utils[_0x5fca('0x1a')](util['format'](_0x5fca('0x20'),_0x1be448[_0x5fca('0x4')]),_0x18db29);}};exports[_0x5fca('0x21')]=function(_0x4cbf38){try{if(!_[_0x5fca('0x15')](dials[_0x4cbf38['uniqueid']])){utils['debug'](util[_0x5fca('0x2')](_0x5fca('0x22'),_0x4cbf38['uniqueid']),_0x4cbf38);dials[_0x4cbf38[_0x5fca('0x4')]][_0x5fca('0x7')]=_0x4cbf38['dialstatus'];if(_0x4cbf38[_0x5fca('0x7')]==_0x5fca('0x23')){dials[_0x4cbf38['uniqueid']]=_[_0x5fca('0x1c')](dials[_0x4cbf38[_0x5fca('0x4')]],_0x4cbf38);dials[_0x4cbf38[_0x5fca('0x4')]][_0x5fca('0x24')]=utils[_0x5fca('0x25')]();dials[_0x4cbf38[_0x5fca('0x4')]]['lastevent']=_0x5fca('0x26');utils[_0x5fca('0x1')](util['format'](_0x5fca('0x27'),_0x4cbf38[_0x5fca('0x4')],_0x4cbf38['dialstatus'],dials[_0x4cbf38['uniqueid']][_0x5fca('0x24')]));}else{utils['info'](util['format'](_0x5fca('0x28'),_0x4cbf38[_0x5fca('0x4')],_0x4cbf38[_0x5fca('0x7')]));}}}catch(_0xd096ef){utils[_0x5fca('0x1a')](util[_0x5fca('0x2')](_0x5fca('0x22'),_0x4cbf38['uniqueid']),_0xd096ef);}};exports[_0x5fca('0x29')]=function(_0x2e7586){try{if(!_[_0x5fca('0x15')](dials[_0x2e7586[_0x5fca('0x4')]])){utils['debug'](util[_0x5fca('0x2')](_0x5fca('0x2a'),_0x2e7586['uniqueid']),_0x2e7586);utils['info'](util[_0x5fca('0x2')](_0x5fca('0x2b'),_0x2e7586[_0x5fca('0x4')],_0x2e7586[_0x5fca('0x6')],_0x2e7586[_0x5fca('0x2c')],_0x2e7586[_0x5fca('0x2d')]));dials[_0x2e7586[_0x5fca('0x4')]]=_['assign'](dials[_0x2e7586['uniqueid']],{'endtime':utils['now'](),'lastevent':_0x5fca('0x2e')});dials[_0x2e7586[_0x5fca('0x4')]][_0x5fca('0x2f')]=utils[_0x5fca('0x30')](dials[_0x2e7586['uniqueid']][_0x5fca('0x31')],dials[_0x2e7586['uniqueid']][_0x5fca('0x1d')]);dials[_0x2e7586[_0x5fca('0x4')]][_0x5fca('0x32')]=utils[_0x5fca('0x30')](dials[_0x2e7586['uniqueid']]['answertime']||dials[_0x2e7586[_0x5fca('0x4')]]['endtime'],dials[_0x2e7586['uniqueid']]['starttime']);dials[_0x2e7586[_0x5fca('0x4')]]['billableseconds']=dials[_0x2e7586['uniqueid']][_0x5fca('0x24')]?utils[_0x5fca('0x30')](dials[_0x2e7586['uniqueid']][_0x5fca('0x31')],dials[_0x2e7586[_0x5fca('0x4')]][_0x5fca('0x24')]):0x0;writeDB(dials[_0x2e7586[_0x5fca('0x4')]]);}}catch(_0x3894eb){utils[_0x5fca('0x1a')](util[_0x5fca('0x2')](_0x5fca('0x2a'),_0x2e7586['uniqueid']),_0x3894eb);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 0d60b32..c0003dd 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 _0x9f24=['queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][blindtransfer]','blindtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','util','xdr','disabled','env','local','asterisk','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','[%s][index][devicestatechange]','device','format','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','debug','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','[%s][index][agentcomplete]','agentcomplete'];(function(_0x264c55,_0x50c37b){var _0x393565=function(_0x4a65f7){while(--_0x4a65f7){_0x264c55['push'](_0x264c55['shift']());}};_0x393565(++_0x50c37b);}(_0x9f24,0x64));var _0x49f2=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0x9f24[_0x44268d];return _0x4be92d;};var AsteriskManager=require('asterisk-manager');var config=require(_0x49f2('0x0'));var utils=require(_0x49f2('0x1'));var util=require(_0x49f2('0x2'));var isXDREnabled=config[_0x49f2('0x3')]&&config[_0x49f2('0x3')][_0x49f2('0x4')]?!config['xdr']['disabled']:!![];var isProduction=config[_0x49f2('0x5')]==='production'||![];var isLocalAsterisk=config[_0x49f2('0x3')]&&config[_0x49f2('0x3')][_0x49f2('0x6')]===!![]||![];var ami=new AsteriskManager(config['asterisk']['port'],config[_0x49f2('0x7')]['ip'],config[_0x49f2('0x7')]['username'],config[_0x49f2('0x7')][_0x49f2('0x8')],!![]);ami[_0x49f2('0x9')]();if(!isXDREnabled){utils[_0x49f2('0xa')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x49f2('0xa')](_0x49f2('0xb'));}else{var agents=require(_0x49f2('0xc'));var calls=require(_0x49f2('0xd'));var queues=require(_0x49f2('0xe'));var recordings=require(_0x49f2('0xf'));var members=require(_0x49f2('0x10'));var dials=require(_0x49f2('0x11'));var transfers=require('./transfers.controller');var core=require(_0x49f2('0x12'));ami['on'](_0x49f2('0x13'),core[_0x49f2('0x13')]);ami['on'](_0x49f2('0x14'),core[_0x49f2('0x14')]);ami['on'](_0x49f2('0x15'),core[_0x49f2('0x15')]);ami['on'](_0x49f2('0x16'),core[_0x49f2('0x16')]);ami['on'](_0x49f2('0x17'),core[_0x49f2('0x17')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0x49f2('0x18'),function(_0x536541){try{utils['debug'](util['format'](_0x49f2('0x19'),_0x536541[_0x49f2('0x1a')]),_0x536541);members['devicestatechange'](_0x536541);}catch(_0xe64f4f){utils['error'](util[_0x49f2('0x1b')](_0x49f2('0x19'),_0x536541[_0x49f2('0x1a')]),_0xe64f4f);}});ami['on'](_0x49f2('0x1c'),function(_0x269c55){try{utils['debug'](util['format'](_0x49f2('0x1d'),_0x269c55[_0x49f2('0x1e')]),_0x269c55);agents[_0x49f2('0x1c')](_0x269c55);}catch(_0x4c52db){utils['error'](util[_0x49f2('0x1b')]('[%s][index][agentcalled]',_0x269c55[_0x49f2('0x1e')]),_0x4c52db);}});ami['on'](_0x49f2('0x1f'),function(_0x327e55){try{utils[_0x49f2('0x20')](util[_0x49f2('0x1b')]('[%s][index][agentringnoanswer]',_0x327e55[_0x49f2('0x1e')]),_0x327e55);agents[_0x49f2('0x1f')](_0x327e55);}catch(_0x5bca06){utils['error'](util[_0x49f2('0x1b')](_0x49f2('0x21'),_0x327e55[_0x49f2('0x1e')]),_0x5bca06);}});ami['on']('agentconnect',function(_0x5178c4){try{utils[_0x49f2('0x20')](util['format'](_0x49f2('0x22'),_0x5178c4[_0x49f2('0x1e')]),_0x5178c4);agents[_0x49f2('0x23')](_0x5178c4);queues[_0x49f2('0x23')](_0x5178c4);}catch(_0x4887ee){utils['error'](util[_0x49f2('0x1b')](_0x49f2('0x22'),_0x5178c4[_0x49f2('0x1e')]),_0x4887ee);}});ami['on']('agentcomplete',function(_0x247327){try{utils[_0x49f2('0x20')](util['format'](_0x49f2('0x24'),_0x247327['uniqueid']),_0x247327);agents[_0x49f2('0x25')](_0x247327);queues['agentcomplete'](_0x247327);members[_0x49f2('0x25')](_0x247327);}catch(_0x2eeb11){utils[_0x49f2('0x16')](util[_0x49f2('0x1b')](_0x49f2('0x24'),_0x247327[_0x49f2('0x1e')]),_0x2eeb11);}});ami['on'](_0x49f2('0x26'),function(_0x6aaa46){try{utils['debug'](util[_0x49f2('0x1b')]('[%s][index][queuecallerabandon]',_0x6aaa46[_0x49f2('0x1e')]),_0x6aaa46);agents[_0x49f2('0x26')](_0x6aaa46);queues[_0x49f2('0x26')](_0x6aaa46);}catch(_0x17ef7b){utils[_0x49f2('0x16')](util[_0x49f2('0x1b')](_0x49f2('0x27'),_0x6aaa46[_0x49f2('0x1e')]),_0x17ef7b);}});ami['on']('queuecallerjoin',function(_0x575b9f){try{utils['debug'](util['format']('[%s][index][queuecallerjoin]',_0x575b9f['uniqueid']),_0x575b9f);queues[_0x49f2('0x28')](_0x575b9f);recordings[_0x49f2('0x28')](_0x575b9f);}catch(_0x95cb35){utils['error'](util[_0x49f2('0x1b')](_0x49f2('0x29'),_0x575b9f[_0x49f2('0x1e')]),_0x95cb35);}});ami['on'](_0x49f2('0x2a'),function(_0x3e3e7a){try{utils[_0x49f2('0x20')](util[_0x49f2('0x1b')](_0x49f2('0x2b'),_0x3e3e7a[_0x49f2('0x1e')]),_0x3e3e7a);queues[_0x49f2('0x2a')](_0x3e3e7a);}catch(_0x389f5f){utils[_0x49f2('0x16')](util['format'](_0x49f2('0x2b'),_0x3e3e7a[_0x49f2('0x1e')]),_0x389f5f);}});ami['on']('musiconholdstart',function(_0x396c3f){try{utils[_0x49f2('0x20')](util[_0x49f2('0x1b')](_0x49f2('0x2c'),_0x396c3f[_0x49f2('0x1e')]),_0x396c3f);queues[_0x49f2('0x2d')](_0x396c3f);calls['musiconholdstart'](_0x396c3f);}catch(_0x3d8058){utils[_0x49f2('0x16')](util[_0x49f2('0x1b')]('[%s][index][musiconholdstart]',_0x396c3f[_0x49f2('0x1e')]),_0x3d8058);}});ami['on']('musiconholdstop',function(_0x210696){try{utils[_0x49f2('0x20')](util[_0x49f2('0x1b')](_0x49f2('0x2e'),_0x210696[_0x49f2('0x1e')]),_0x210696);queues[_0x49f2('0x2f')](_0x210696);calls['musiconholdstop'](_0x210696);}catch(_0x3c3eb7){utils['error'](util['format'](_0x49f2('0x2e'),_0x210696[_0x49f2('0x1e')]),_0x3c3eb7);}});ami['on'](_0x49f2('0x30'),function(_0x4ade99){try{utils[_0x49f2('0x20')](util['format'](_0x49f2('0x31'),_0x4ade99[_0x49f2('0x1e')]),_0x4ade99);calls['newstate'](_0x4ade99);recordings['newstate'](_0x4ade99);}catch(_0x5d1a4f){utils['error'](util[_0x49f2('0x1b')](_0x49f2('0x31'),_0x4ade99['uniqueid']),_0x5d1a4f);}});ami['on']('hangup',function(_0xba17da){try{utils[_0x49f2('0x20')](util[_0x49f2('0x1b')]('[%s][index][hangup]',_0xba17da[_0x49f2('0x1e')]),_0xba17da);calls[_0x49f2('0x32')](_0xba17da);recordings[_0x49f2('0x32')](_0xba17da);dials['hangup'](_0xba17da);agents[_0x49f2('0x32')](_0xba17da);queues['hangup'](_0xba17da);}catch(_0x233061){utils[_0x49f2('0x16')](util['format'](_0x49f2('0x33'),_0xba17da[_0x49f2('0x1e')]),_0x233061);}});ami['on'](_0x49f2('0x34'),function(_0x2cf45a){try{utils[_0x49f2('0x20')](util[_0x49f2('0x1b')]('[%s][index][cdr]',_0x2cf45a[_0x49f2('0x1e')]),_0x2cf45a);members[_0x49f2('0x34')](_0x2cf45a);}catch(_0x1f6194){utils[_0x49f2('0x16')](util['format']('[%s][index][cdr]',_0x2cf45a[_0x49f2('0x1e')]),_0x1f6194);}});ami['on']('blindtransfer',function(_0x9b5eb6){try{utils[_0x49f2('0x20')](util[_0x49f2('0x1b')](_0x49f2('0x35'),_0x9b5eb6[_0x49f2('0x1e')]),_0x9b5eb6);queues[_0x49f2('0x36')](_0x9b5eb6);agents['blindtransfer'](_0x9b5eb6);transfers[_0x49f2('0x36')](_0x9b5eb6);}catch(_0x2144fe){utils[_0x49f2('0x16')](util[_0x49f2('0x1b')](_0x49f2('0x35'),_0x9b5eb6['uniqueid']),_0x2144fe);}});ami['on']('attendedtransfer',function(_0x33438c){try{utils[_0x49f2('0x20')](util[_0x49f2('0x1b')](_0x49f2('0x37'),_0x33438c[_0x49f2('0x38')]),_0x33438c);queues[_0x49f2('0x39')](_0x33438c);transfers[_0x49f2('0x39')](_0x33438c);agents[_0x49f2('0x39')](_0x33438c);calls['attendedtransfer'](_0x33438c);}catch(_0xf90e73){utils[_0x49f2('0x16')](util['format'](_0x49f2('0x37'),_0x33438c[_0x49f2('0x38')]),_0xf90e73);}});ami['on']('varset',function(_0x455044){try{utils[_0x49f2('0x20')](util[_0x49f2('0x1b')](_0x49f2('0x3a'),_0x455044[_0x49f2('0x1e')]),_0x455044);queues[_0x49f2('0x3b')](_0x455044);recordings[_0x49f2('0x3b')](_0x455044);calls['varset'](_0x455044);dials[_0x49f2('0x3b')](_0x455044);}catch(_0x199351){utils['error'](util[_0x49f2('0x1b')](_0x49f2('0x3a'),_0x455044[_0x49f2('0x1e')]),_0x199351);}});ami['on'](_0x49f2('0x3c'),function(_0x14f828){try{utils[_0x49f2('0x20')](util[_0x49f2('0x1b')]('[%s][index][newexten]',_0x14f828[_0x49f2('0x1e')]),_0x14f828);calls[_0x49f2('0x3c')](_0x14f828);recordings[_0x49f2('0x3c')](_0x14f828);dials['newexten'](_0x14f828);}catch(_0x3e12aa){utils['error'](util[_0x49f2('0x1b')](_0x49f2('0x3d'),_0x14f828[_0x49f2('0x1e')]),_0x3e12aa);}});ami['on'](_0x49f2('0x3e'),function(_0x3aab13){try{utils['debug'](util[_0x49f2('0x1b')](_0x49f2('0x3f'),_0x3aab13['uniqueid']),_0x3aab13);calls[_0x49f2('0x3e')](_0x3aab13);recordings[_0x49f2('0x3e')](_0x3aab13);}catch(_0x56319b){utils[_0x49f2('0x16')](util[_0x49f2('0x1b')](_0x49f2('0x3f'),_0x3aab13['uniqueid']),_0x56319b);}});ami['on'](_0x49f2('0x40'),function(_0x85ebe1){try{utils['debug'](util[_0x49f2('0x1b')](_0x49f2('0x41'),_0x85ebe1[_0x49f2('0x1e')]),_0x85ebe1);dials[_0x49f2('0x40')](_0x85ebe1);}catch(_0x3fc0b9){utils['error'](util[_0x49f2('0x1b')](_0x49f2('0x42'),_0x85ebe1[_0x49f2('0x1e')]),_0x3fc0b9);}});ami['on'](_0x49f2('0x43'),function(_0x55cbc3){try{utils[_0x49f2('0x20')](util[_0x49f2('0x1b')](_0x49f2('0x44'),_0x55cbc3[_0x49f2('0x1e')]),_0x55cbc3);dials[_0x49f2('0x43')](_0x55cbc3);}catch(_0x15afd5){utils[_0x49f2('0x16')](util[_0x49f2('0x1b')](_0x49f2('0x44'),_0x55cbc3[_0x49f2('0x1e')]),_0x15afd5);}});} \ No newline at end of file +var _0xb30c=['hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','xdr','disabled','production','asterisk','password','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate'];(function(_0x5b0a0c,_0x587d12){var _0x3350f=function(_0x5f042a){while(--_0x5f042a){_0x5b0a0c['push'](_0x5b0a0c['shift']());}};_0x3350f(++_0x587d12);}(_0xb30c,0x122));var _0xcb30=function(_0xeb86bc,_0x48600e){_0xeb86bc=_0xeb86bc-0x0;var _0x4c53f1=_0xb30c[_0xeb86bc];return _0x4c53f1;};var AsteriskManager=require(_0xcb30('0x0'));var config=require(_0xcb30('0x1'));var utils=require(_0xcb30('0x2'));var util=require('util');var isXDREnabled=config[_0xcb30('0x3')]&&config['xdr']['disabled']?!config['xdr'][_0xcb30('0x4')]:!![];var isProduction=config['env']===_0xcb30('0x5')||![];var isLocalAsterisk=config['xdr']&&config['xdr']['local']===!![]||![];var ami=new AsteriskManager(config[_0xcb30('0x6')]['port'],config[_0xcb30('0x6')]['ip'],config[_0xcb30('0x6')]['username'],config[_0xcb30('0x6')][_0xcb30('0x7')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0xcb30('0x8')](_0xcb30('0x9'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xcb30('0x8')](_0xcb30('0xa'));}else{var agents=require(_0xcb30('0xb'));var calls=require('./calls.controller');var queues=require(_0xcb30('0xc'));var recordings=require(_0xcb30('0xd'));var members=require(_0xcb30('0xe'));var dials=require(_0xcb30('0xf'));var transfers=require(_0xcb30('0x10'));var core=require(_0xcb30('0x11'));ami['on'](_0xcb30('0x12'),core[_0xcb30('0x12')]);ami['on'](_0xcb30('0x13'),core[_0xcb30('0x13')]);ami['on'](_0xcb30('0x14'),core[_0xcb30('0x14')]);ami['on'](_0xcb30('0x15'),core[_0xcb30('0x15')]);ami['on'](_0xcb30('0x16'),core[_0xcb30('0x16')]);ami['on']('managerevent',core[_0xcb30('0x17')]);ami['on'](_0xcb30('0x18'),function(_0x44c440){try{utils[_0xcb30('0x19')](util[_0xcb30('0x1a')](_0xcb30('0x1b'),_0x44c440['device']),_0x44c440);members[_0xcb30('0x18')](_0x44c440);}catch(_0x41cfd4){utils[_0xcb30('0x15')](util[_0xcb30('0x1a')](_0xcb30('0x1b'),_0x44c440[_0xcb30('0x1c')]),_0x41cfd4);}});ami['on']('agentcalled',function(_0x4c18c9){try{utils[_0xcb30('0x19')](util[_0xcb30('0x1a')](_0xcb30('0x1d'),_0x4c18c9[_0xcb30('0x1e')]),_0x4c18c9);agents[_0xcb30('0x1f')](_0x4c18c9);}catch(_0x4e1e1b){utils[_0xcb30('0x15')](util[_0xcb30('0x1a')](_0xcb30('0x1d'),_0x4c18c9[_0xcb30('0x1e')]),_0x4e1e1b);}});ami['on'](_0xcb30('0x20'),function(_0x1f0973){try{utils[_0xcb30('0x19')](util[_0xcb30('0x1a')]('[%s][index][agentringnoanswer]',_0x1f0973[_0xcb30('0x1e')]),_0x1f0973);agents[_0xcb30('0x20')](_0x1f0973);}catch(_0x90f0e2){utils[_0xcb30('0x15')](util[_0xcb30('0x1a')](_0xcb30('0x21'),_0x1f0973[_0xcb30('0x1e')]),_0x90f0e2);}});ami['on']('agentconnect',function(_0x55423a){try{utils['debug'](util['format']('[%s][index][agentconnect]',_0x55423a['uniqueid']),_0x55423a);agents['agentconnect'](_0x55423a);queues[_0xcb30('0x22')](_0x55423a);}catch(_0x34fc2e){utils[_0xcb30('0x15')](util['format'](_0xcb30('0x23'),_0x55423a[_0xcb30('0x1e')]),_0x34fc2e);}});ami['on'](_0xcb30('0x24'),function(_0x2a8554){try{utils[_0xcb30('0x19')](util['format'](_0xcb30('0x25'),_0x2a8554[_0xcb30('0x1e')]),_0x2a8554);agents[_0xcb30('0x24')](_0x2a8554);queues[_0xcb30('0x24')](_0x2a8554);members[_0xcb30('0x24')](_0x2a8554);}catch(_0x2ae713){utils['error'](util['format'](_0xcb30('0x25'),_0x2a8554[_0xcb30('0x1e')]),_0x2ae713);}});ami['on']('queuecallerabandon',function(_0x2382f1){try{utils[_0xcb30('0x19')](util['format'](_0xcb30('0x26'),_0x2382f1[_0xcb30('0x1e')]),_0x2382f1);agents[_0xcb30('0x27')](_0x2382f1);queues[_0xcb30('0x27')](_0x2382f1);}catch(_0x3ad5df){utils[_0xcb30('0x15')](util[_0xcb30('0x1a')](_0xcb30('0x26'),_0x2382f1[_0xcb30('0x1e')]),_0x3ad5df);}});ami['on'](_0xcb30('0x28'),function(_0x13cbec){try{utils['debug'](util[_0xcb30('0x1a')](_0xcb30('0x29'),_0x13cbec[_0xcb30('0x1e')]),_0x13cbec);queues[_0xcb30('0x28')](_0x13cbec);recordings[_0xcb30('0x28')](_0x13cbec);}catch(_0x5dd6b5){utils[_0xcb30('0x15')](util[_0xcb30('0x1a')](_0xcb30('0x29'),_0x13cbec[_0xcb30('0x1e')]),_0x5dd6b5);}});ami['on'](_0xcb30('0x2a'),function(_0x4274a1){try{utils['debug'](util['format'](_0xcb30('0x2b'),_0x4274a1['uniqueid']),_0x4274a1);queues[_0xcb30('0x2a')](_0x4274a1);}catch(_0x1b3281){utils['error'](util[_0xcb30('0x1a')]('[%s][index][queuecallerleave]',_0x4274a1[_0xcb30('0x1e')]),_0x1b3281);}});ami['on'](_0xcb30('0x2c'),function(_0x4812c3){try{utils['debug'](util[_0xcb30('0x1a')](_0xcb30('0x2d'),_0x4812c3[_0xcb30('0x1e')]),_0x4812c3);queues[_0xcb30('0x2c')](_0x4812c3);calls[_0xcb30('0x2c')](_0x4812c3);}catch(_0xea5577){utils['error'](util['format'](_0xcb30('0x2d'),_0x4812c3[_0xcb30('0x1e')]),_0xea5577);}});ami['on'](_0xcb30('0x2e'),function(_0x5b94ea){try{utils['debug'](util[_0xcb30('0x1a')](_0xcb30('0x2f'),_0x5b94ea[_0xcb30('0x1e')]),_0x5b94ea);queues[_0xcb30('0x2e')](_0x5b94ea);calls[_0xcb30('0x2e')](_0x5b94ea);}catch(_0x4b9c4e){utils['error'](util[_0xcb30('0x1a')](_0xcb30('0x2f'),_0x5b94ea[_0xcb30('0x1e')]),_0x4b9c4e);}});ami['on']('newstate',function(_0x2f2df1){try{utils['debug'](util['format'](_0xcb30('0x30'),_0x2f2df1[_0xcb30('0x1e')]),_0x2f2df1);calls['newstate'](_0x2f2df1);recordings[_0xcb30('0x31')](_0x2f2df1);}catch(_0x1a4c33){utils[_0xcb30('0x15')](util['format'](_0xcb30('0x30'),_0x2f2df1[_0xcb30('0x1e')]),_0x1a4c33);}});ami['on'](_0xcb30('0x32'),function(_0x4e0a4a){try{utils[_0xcb30('0x19')](util[_0xcb30('0x1a')]('[%s][index][hangup]',_0x4e0a4a[_0xcb30('0x1e')]),_0x4e0a4a);calls['hangup'](_0x4e0a4a);recordings['hangup'](_0x4e0a4a);dials[_0xcb30('0x32')](_0x4e0a4a);agents[_0xcb30('0x32')](_0x4e0a4a);queues[_0xcb30('0x32')](_0x4e0a4a);}catch(_0x44b2ae){utils[_0xcb30('0x15')](util[_0xcb30('0x1a')](_0xcb30('0x33'),_0x4e0a4a['uniqueid']),_0x44b2ae);}});ami['on'](_0xcb30('0x34'),function(_0x293913){try{utils[_0xcb30('0x19')](util[_0xcb30('0x1a')](_0xcb30('0x35'),_0x293913[_0xcb30('0x1e')]),_0x293913);members[_0xcb30('0x34')](_0x293913);}catch(_0x3c5aef){utils[_0xcb30('0x15')](util[_0xcb30('0x1a')]('[%s][index][cdr]',_0x293913[_0xcb30('0x1e')]),_0x3c5aef);}});ami['on'](_0xcb30('0x36'),function(_0x545418){try{utils[_0xcb30('0x19')](util[_0xcb30('0x1a')]('[%s][index][blindtransfer]',_0x545418[_0xcb30('0x1e')]),_0x545418);queues[_0xcb30('0x36')](_0x545418);agents['blindtransfer'](_0x545418);transfers['blindtransfer'](_0x545418);}catch(_0x373c0f){utils[_0xcb30('0x15')](util[_0xcb30('0x1a')]('[%s][index][blindtransfer]',_0x545418[_0xcb30('0x1e')]),_0x373c0f);}});ami['on']('attendedtransfer',function(_0x375736){try{utils[_0xcb30('0x19')](util[_0xcb30('0x1a')](_0xcb30('0x37'),_0x375736[_0xcb30('0x38')]),_0x375736);queues['attendedtransfer'](_0x375736);transfers[_0xcb30('0x39')](_0x375736);agents[_0xcb30('0x39')](_0x375736);calls[_0xcb30('0x39')](_0x375736);}catch(_0x5c9cb1){utils[_0xcb30('0x15')](util[_0xcb30('0x1a')](_0xcb30('0x37'),_0x375736[_0xcb30('0x38')]),_0x5c9cb1);}});ami['on']('varset',function(_0x250798){try{utils[_0xcb30('0x19')](util[_0xcb30('0x1a')](_0xcb30('0x3a'),_0x250798[_0xcb30('0x1e')]),_0x250798);queues[_0xcb30('0x3b')](_0x250798);recordings['varset'](_0x250798);calls[_0xcb30('0x3b')](_0x250798);dials[_0xcb30('0x3b')](_0x250798);}catch(_0x32dca9){utils[_0xcb30('0x15')](util[_0xcb30('0x1a')](_0xcb30('0x3a'),_0x250798['uniqueid']),_0x32dca9);}});ami['on'](_0xcb30('0x3c'),function(_0x1b155a){try{utils['debug'](util[_0xcb30('0x1a')](_0xcb30('0x3d'),_0x1b155a[_0xcb30('0x1e')]),_0x1b155a);calls[_0xcb30('0x3c')](_0x1b155a);recordings['newexten'](_0x1b155a);dials[_0xcb30('0x3c')](_0x1b155a);}catch(_0x367693){utils[_0xcb30('0x15')](util[_0xcb30('0x1a')]('[%s][index][newexten]',_0x1b155a[_0xcb30('0x1e')]),_0x367693);}});ami['on'](_0xcb30('0x3e'),function(_0x5067d6){try{utils[_0xcb30('0x19')](util[_0xcb30('0x1a')](_0xcb30('0x3f'),_0x5067d6[_0xcb30('0x1e')]),_0x5067d6);calls[_0xcb30('0x3e')](_0x5067d6);recordings[_0xcb30('0x3e')](_0x5067d6);}catch(_0x33715d){utils['error'](util['format']('[%s][index][newchannel]',_0x5067d6[_0xcb30('0x1e')]),_0x33715d);}});ami['on']('dialbegin',function(_0x13e7d1){try{utils[_0xcb30('0x19')](util[_0xcb30('0x1a')](_0xcb30('0x40'),_0x13e7d1[_0xcb30('0x1e')]),_0x13e7d1);dials[_0xcb30('0x41')](_0x13e7d1);}catch(_0x27c17c){utils[_0xcb30('0x15')](util[_0xcb30('0x1a')]('[%s]dialbegin',_0x13e7d1[_0xcb30('0x1e')]),_0x27c17c);}});ami['on'](_0xcb30('0x42'),function(_0x2db58f){try{utils[_0xcb30('0x19')](util[_0xcb30('0x1a')](_0xcb30('0x43'),_0x2db58f[_0xcb30('0x1e')]),_0x2db58f);dials['dialend'](_0x2db58f);}catch(_0x2528c3){utils[_0xcb30('0x15')](util[_0xcb30('0x1a')]('[%s][index][dialend]',_0x2db58f[_0xcb30('0x1e')]),_0x2528c3);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index be21822..815db79 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 _0xfa47=['request','CreateMemberReport','getUserByName','split','name','catch','format','[%s][members][writeDB]','some','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','TALKING','now','agent','NOT_INUSE','exitAt','duration','diffTime','enterAt','error','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','isNil','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','then','internal'];(function(_0x4aac97,_0x3513f6){var _0x1ba475=function(_0x221528){while(--_0x221528){_0x4aac97['push'](_0x4aac97['shift']());}};_0x1ba475(++_0x3513f6);}(_0xfa47,0x91));var _0x7fa4=function(_0x5e2152,_0x172f3d){_0x5e2152=_0x5e2152-0x0;var _0x5ddcf6=_0xfa47[_0x5e2152];return _0x5ddcf6;};'use strict';var _=require(_0x7fa4('0x0'));var util=require(_0x7fa4('0x1'));var utils=require('./utils');var members={};var exclude=[_0x7fa4('0x2'),_0x7fa4('0x3')];function writeDB(_0x343d51){utils[_0x7fa4('0x4')](util['format'](_0x7fa4('0x5'),_0x343d51[_0x7fa4('0x6')],_0x343d51[_0x7fa4('0x7')],_0x343d51[_0x7fa4('0x8')],_0x343d51[_0x7fa4('0x9')],_0x343d51[_0x7fa4('0xa')],_0x343d51[_0x7fa4('0xb')]));if(_0x343d51[_0x7fa4('0x7')]){utils['getUserByInterface'](_0x343d51[_0x7fa4('0x7')])[_0x7fa4('0xc')](function(_0x445ff5){if(_0x445ff5){_0x343d51[_0x7fa4('0xa')]=_0x445ff5['name'];_0x343d51['internal']=_0x445ff5[_0x7fa4('0xd')];utils[_0x7fa4('0xe')](_0x7fa4('0xf'),_0x343d51);}else{utils[_0x7fa4('0x10')](_0x343d51[_0x7fa4('0x7')][_0x7fa4('0x11')]('/')[0x1])[_0x7fa4('0xc')](function(_0x5a921d){if(_0x5a921d){_0x343d51[_0x7fa4('0xa')]=_0x5a921d[_0x7fa4('0x12')];_0x343d51['internal']=_0x5a921d[_0x7fa4('0xd')];utils[_0x7fa4('0xe')]('CreateMemberReport',_0x343d51);}});}})[_0x7fa4('0x13')](function(_0x2329bb){utils['error'](util[_0x7fa4('0x14')](_0x7fa4('0x15'),_0x343d51[_0x7fa4('0x6')]),_0x2329bb);});}delete members[_0x343d51[_0x7fa4('0x7')]];}function startsWith(_0x4f6c1a,_0x498bc2){return _[_0x7fa4('0x16')](_0x4f6c1a,function(_0x420bfa){return _[_0x7fa4('0x17')](_0x498bc2,_0x420bfa);});}exports['devicestatechange']=function(_0x284534){try{utils[_0x7fa4('0x18')](util[_0x7fa4('0x14')](_0x7fa4('0x19'),members[_0x284534[_0x7fa4('0x1a')]]?members[_0x284534[_0x7fa4('0x1a')]][_0x7fa4('0x6')]:_0x284534['device']),_0x284534);utils[_0x7fa4('0x4')](util['format'](_0x7fa4('0x1b'),members[_0x284534[_0x7fa4('0x1a')]]?members[_0x284534[_0x7fa4('0x1a')]][_0x7fa4('0x6')]:_0x284534[_0x7fa4('0x1a')],_0x284534[_0x7fa4('0x1c')],_0x284534[_0x7fa4('0x1a')]));switch(_0x284534[_0x7fa4('0x1c')]){case _0x7fa4('0x1d'):case'BUSY':if(!startsWith(exclude,_0x284534[_0x7fa4('0x1a')])){members[_0x284534[_0x7fa4('0x1a')]]={'channel':_0x7fa4('0x1e'),'interface':_0x284534[_0x7fa4('0x1a')],'type':_0x7fa4('0x1f'),'enterAt':utils[_0x7fa4('0x20')](),'role':_0x7fa4('0x21')};}break;case _0x7fa4('0x22'):if(!_['isNil'](members[_0x284534['device']])){members[_0x284534[_0x7fa4('0x1a')]][_0x7fa4('0x23')]=utils['now']();members[_0x284534[_0x7fa4('0x1a')]][_0x7fa4('0x24')]=utils[_0x7fa4('0x25')](members[_0x284534[_0x7fa4('0x1a')]][_0x7fa4('0x23')],members[_0x284534['device']][_0x7fa4('0x26')]);if(members[_0x284534['device']][_0x7fa4('0x6')]){writeDB(members[_0x284534[_0x7fa4('0x1a')]]);}}break;default:break;}}catch(_0x293424){utils[_0x7fa4('0x27')](util[_0x7fa4('0x14')](_0x7fa4('0x19'),members[_0x284534[_0x7fa4('0x1a')]]?members[_0x284534[_0x7fa4('0x1a')]][_0x7fa4('0x6')]:_0x284534[_0x7fa4('0x1a')]),_0x293424);}};exports[_0x7fa4('0x28')]=function(_0x19b1ef){try{if(!_['isNil'](members[_0x19b1ef['interface']])){utils[_0x7fa4('0x18')](util[_0x7fa4('0x14')](_0x7fa4('0x29'),_0x19b1ef[_0x7fa4('0x6')]),_0x19b1ef);utils['info'](util['format'](_0x7fa4('0x2a'),_0x19b1ef[_0x7fa4('0x6')],_0x19b1ef[_0x7fa4('0x7')],_0x19b1ef[_0x7fa4('0x2b')]));members[_0x19b1ef['interface']]=_[_0x7fa4('0x2c')](members[_0x19b1ef[_0x7fa4('0x7')]],{'data4':_0x19b1ef[_0x7fa4('0x2b')],'uniqueid':_0x19b1ef[_0x7fa4('0x6')]});}}catch(_0x4209dd){utils[_0x7fa4('0x27')](util[_0x7fa4('0x14')](_0x7fa4('0x29'),_0x19b1ef[_0x7fa4('0x6')]),_0x4209dd);}};exports[_0x7fa4('0x2d')]=function(_0x20d547){try{utils[_0x7fa4('0x18')](util['format'](_0x7fa4('0x2e'),_0x20d547[_0x7fa4('0x6')]),_0x20d547);if(_0x20d547[_0x7fa4('0x8')]){var _0x478cd0=_0x20d547['channel'][_0x7fa4('0x11')]('-')[0x0];if(!_[_0x7fa4('0x2f')](members[_0x478cd0])){members[_0x478cd0]=_[_0x7fa4('0x2c')](members[_0x478cd0],{'data1':members[_0x478cd0][_0x7fa4('0x30')]||_0x20d547[_0x7fa4('0xb')],'data2':members[_0x478cd0][_0x7fa4('0x9')]||_0x20d547[_0x7fa4('0x31')],'data3':members[_0x478cd0][_0x7fa4('0x32')]||_0x20d547[_0x7fa4('0x33')],'uniqueid':members[_0x478cd0][_0x7fa4('0x6')]||_0x20d547['uniqueid']});utils['info'](util[_0x7fa4('0x14')](_0x7fa4('0x34'),_0x20d547['uniqueid'],members[_0x478cd0][_0x7fa4('0x30')],members[_0x478cd0]['data2'],members[_0x478cd0][_0x7fa4('0x32')]));if(members[_0x478cd0][_0x7fa4('0x23')]){writeDB(members[_0x478cd0]);}}}if(_0x20d547['destinationchannel']){var _0x934f97=_0x20d547['destinationchannel'][_0x7fa4('0x11')]('-')[0x0];if(!_[_0x7fa4('0x2f')](members[_0x934f97])){members[_0x934f97]=_[_0x7fa4('0x2c')](members[_0x934f97],{'data1':members[_0x934f97][_0x7fa4('0x30')]||_0x20d547['type'],'data2':members[_0x934f97][_0x7fa4('0x9')]||_0x20d547[_0x7fa4('0x31')],'data3':members[_0x934f97][_0x7fa4('0x32')]||_0x20d547[_0x7fa4('0x33')],'uniqueid':members[_0x934f97][_0x7fa4('0x6')]||_0x20d547['uniqueid']});utils[_0x7fa4('0x4')](util[_0x7fa4('0x14')](_0x7fa4('0x34'),_0x20d547[_0x7fa4('0x6')],members[_0x934f97][_0x7fa4('0x30')],members[_0x934f97][_0x7fa4('0x9')],members[_0x934f97]['data3']));if(members[_0x934f97][_0x7fa4('0x23')]){writeDB(members[_0x934f97]);}}}}catch(_0x326dc0){utils[_0x7fa4('0x27')](util[_0x7fa4('0x14')](_0x7fa4('0x2e'),_0x20d547['uniqueid']),_0x326dc0);}}; \ No newline at end of file +var _0xed1c=['devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data1','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','type','interface','then','internal','request','CreateMemberReport','getUserByName','split','membername','catch','error','[%s][members][writeDB]','some','startsWith'];(function(_0xd7715,_0x2f22c5){var _0x53a43e=function(_0xc7c1c7){while(--_0xc7c1c7){_0xd7715['push'](_0xd7715['shift']());}};_0x53a43e(++_0x2f22c5);}(_0xed1c,0xf5));var _0xced1=function(_0x1e11c7,_0x53ee08){_0x1e11c7=_0x1e11c7-0x0;var _0x309172=_0xed1c[_0x1e11c7];return _0x309172;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var utils=require(_0xced1('0x2'));var members={};var exclude=[_0xced1('0x3'),_0xced1('0x4')];function writeDB(_0x133c77){utils[_0xced1('0x5')](util[_0xced1('0x6')](_0xced1('0x7'),_0x133c77[_0xced1('0x8')],_0x133c77['interface'],_0x133c77[_0xced1('0x9')],_0x133c77[_0xced1('0xa')],_0x133c77['membername'],_0x133c77[_0xced1('0xb')]));if(_0x133c77[_0xced1('0xc')]){utils['getUserByInterface'](_0x133c77[_0xced1('0xc')])[_0xced1('0xd')](function(_0xa6dbda){if(_0xa6dbda){_0x133c77['membername']=_0xa6dbda['name'];_0x133c77[_0xced1('0xe')]=_0xa6dbda[_0xced1('0xe')];utils[_0xced1('0xf')](_0xced1('0x10'),_0x133c77);}else{utils[_0xced1('0x11')](_0x133c77['interface'][_0xced1('0x12')]('/')[0x1])[_0xced1('0xd')](function(_0x76593e){if(_0x76593e){_0x133c77[_0xced1('0x13')]=_0x76593e['name'];_0x133c77[_0xced1('0xe')]=_0x76593e[_0xced1('0xe')];utils[_0xced1('0xf')](_0xced1('0x10'),_0x133c77);}});}})[_0xced1('0x14')](function(_0x2ba0ad){utils[_0xced1('0x15')](util[_0xced1('0x6')](_0xced1('0x16'),_0x133c77[_0xced1('0x8')]),_0x2ba0ad);});}delete members[_0x133c77[_0xced1('0xc')]];}function startsWith(_0x487de1,_0x1f2f86){return _[_0xced1('0x17')](_0x487de1,function(_0x1bb554){return _[_0xced1('0x18')](_0x1f2f86,_0x1bb554);});}exports[_0xced1('0x19')]=function(_0x53512f){try{utils[_0xced1('0x1a')](util[_0xced1('0x6')](_0xced1('0x1b'),members[_0x53512f[_0xced1('0x1c')]]?members[_0x53512f[_0xced1('0x1c')]][_0xced1('0x8')]:_0x53512f[_0xced1('0x1c')]),_0x53512f);utils[_0xced1('0x5')](util[_0xced1('0x6')](_0xced1('0x1d'),members[_0x53512f[_0xced1('0x1c')]]?members[_0x53512f['device']]['uniqueid']:_0x53512f[_0xced1('0x1c')],_0x53512f[_0xced1('0x1e')],_0x53512f[_0xced1('0x1c')]));switch(_0x53512f[_0xced1('0x1e')]){case _0xced1('0x1f'):case _0xced1('0x20'):if(!startsWith(exclude,_0x53512f[_0xced1('0x1c')])){members[_0x53512f[_0xced1('0x1c')]]={'channel':_0xced1('0x21'),'interface':_0x53512f[_0xced1('0x1c')],'type':_0xced1('0x22'),'enterAt':utils[_0xced1('0x23')](),'role':_0xced1('0x24')};}break;case _0xced1('0x25'):if(!_[_0xced1('0x26')](members[_0x53512f['device']])){members[_0x53512f['device']][_0xced1('0x27')]=utils[_0xced1('0x23')]();members[_0x53512f[_0xced1('0x1c')]][_0xced1('0x28')]=utils[_0xced1('0x29')](members[_0x53512f['device']]['exitAt'],members[_0x53512f[_0xced1('0x1c')]][_0xced1('0x2a')]);if(members[_0x53512f[_0xced1('0x1c')]]['uniqueid']){writeDB(members[_0x53512f[_0xced1('0x1c')]]);}}break;default:break;}}catch(_0x4f7b8f){utils[_0xced1('0x15')](util['format'](_0xced1('0x1b'),members[_0x53512f[_0xced1('0x1c')]]?members[_0x53512f[_0xced1('0x1c')]][_0xced1('0x8')]:_0x53512f['device']),_0x4f7b8f);}};exports['agentcomplete']=function(_0x536877){try{if(!_['isNil'](members[_0x536877[_0xced1('0xc')]])){utils[_0xced1('0x1a')](util[_0xced1('0x6')](_0xced1('0x2b'),_0x536877['uniqueid']),_0x536877);utils[_0xced1('0x5')](util[_0xced1('0x6')](_0xced1('0x2c'),_0x536877[_0xced1('0x8')],_0x536877[_0xced1('0xc')],_0x536877[_0xced1('0x2d')]));members[_0x536877[_0xced1('0xc')]]=_[_0xced1('0x2e')](members[_0x536877[_0xced1('0xc')]],{'data4':_0x536877[_0xced1('0x2d')],'uniqueid':_0x536877[_0xced1('0x8')]});}}catch(_0x109567){utils[_0xced1('0x15')](util[_0xced1('0x6')]('[%s][members][agentcomplete]',_0x536877[_0xced1('0x8')]),_0x109567);}};exports[_0xced1('0x2f')]=function(_0x2d7d31){try{utils[_0xced1('0x1a')](util[_0xced1('0x6')]('[%s][members][cdr]',_0x2d7d31[_0xced1('0x8')]),_0x2d7d31);if(_0x2d7d31[_0xced1('0x9')]){var _0x48e942=_0x2d7d31[_0xced1('0x9')][_0xced1('0x12')]('-')[0x0];if(!_[_0xced1('0x26')](members[_0x48e942])){members[_0x48e942]=_[_0xced1('0x2e')](members[_0x48e942],{'data1':members[_0x48e942]['data1']||_0x2d7d31[_0xced1('0xb')],'data2':members[_0x48e942][_0xced1('0xa')]||_0x2d7d31[_0xced1('0x30')],'data3':members[_0x48e942][_0xced1('0x31')]||_0x2d7d31[_0xced1('0x32')],'uniqueid':members[_0x48e942][_0xced1('0x8')]||_0x2d7d31['uniqueid']});utils[_0xced1('0x5')](util[_0xced1('0x6')](_0xced1('0x33'),_0x2d7d31[_0xced1('0x8')],members[_0x48e942]['data1'],members[_0x48e942][_0xced1('0xa')],members[_0x48e942][_0xced1('0x31')]));if(members[_0x48e942]['exitAt']){writeDB(members[_0x48e942]);}}}if(_0x2d7d31[_0xced1('0x34')]){var _0x306ae3=_0x2d7d31['destinationchannel']['split']('-')[0x0];if(!_['isNil'](members[_0x306ae3])){members[_0x306ae3]=_[_0xced1('0x2e')](members[_0x306ae3],{'data1':members[_0x306ae3]['data1']||_0x2d7d31['type'],'data2':members[_0x306ae3]['data2']||_0x2d7d31[_0xced1('0x30')],'data3':members[_0x306ae3]['data3']||_0x2d7d31[_0xced1('0x32')],'uniqueid':members[_0x306ae3][_0xced1('0x8')]||_0x2d7d31[_0xced1('0x8')]});utils[_0xced1('0x5')](util['format'](_0xced1('0x33'),_0x2d7d31['uniqueid'],members[_0x306ae3][_0xced1('0x35')],members[_0x306ae3][_0xced1('0xa')],members[_0x306ae3][_0xced1('0x31')]));if(members[_0x306ae3][_0xced1('0x27')]){writeDB(members[_0x306ae3]);}}}}catch(_0xce6642){utils[_0xced1('0x15')](util['format']('[%s][members][cdr]',_0x2d7d31['uniqueid']),_0xce6642);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index e3ca02c..618bbc9 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 _0x576b=['transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertype','transfertargetlinkedid','[%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]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup','isNil','queuecallerleaveAt','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','[%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]','queuecallerexitAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','membername','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','BLIND','extension','transferuniqueid','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER'];(function(_0x38bfaa,_0x3df878){var _0x8cc158=function(_0x34847b){while(--_0x34847b){_0x38bfaa['push'](_0x38bfaa['shift']());}};_0x8cc158(++_0x3df878);}(_0x576b,0x81));var _0xb576=function(_0xd9fdef,_0x44671c){_0xd9fdef=_0xd9fdef-0x0;var _0x4c0e12=_0x576b[_0xd9fdef];return _0x4c0e12;};'use strict';var _=require(_0xb576('0x0'));var util=require(_0xb576('0x1'));var utils=require(_0xb576('0x2'));var queues={};function writeDB(_0xabab03){utils[_0xb576('0x3')](util['format'](_0xb576('0x4'),_0xabab03[_0xb576('0x5')],_0xabab03[_0xb576('0x6')],_0xabab03['queue'],_0xabab03[_0xb576('0x7')],_0xabab03['calleridnum'],_0xabab03[_0xb576('0x8')],_0xabab03[_0xb576('0x9')]));if(_0xabab03[_0xb576('0xa')]){utils[_0xb576('0xb')](_0xabab03[_0xb576('0xa')])[_0xb576('0xc')](function(_0x12c514){if(_0x12c514){_0xabab03[_0xb576('0xd')]=_0x12c514[_0xb576('0xd')];}utils[_0xb576('0xe')](_0xb576('0xf'),_0xabab03);});}else{utils[_0xb576('0xe')](_0xb576('0xf'),_0xabab03);}if(_0xabab03[_0xb576('0x10')]){delete queues[_0xabab03[_0xb576('0x10')]];}else{delete queues[_0xabab03['uniqueid']];}}exports['queuecallerjoin']=function(_0x1895b8){try{utils[_0xb576('0x11')](util['format'](_0xb576('0x12'),_0x1895b8[_0xb576('0x5')]),_0x1895b8);utils[_0xb576('0x3')](util[_0xb576('0x13')](_0xb576('0x14'),_0x1895b8[_0xb576('0x5')],_0x1895b8['queue'],_0x1895b8['position']));queues[_0x1895b8[_0xb576('0x5')]]=_[_0xb576('0x15')](_0x1895b8,{'originalposition':_0x1895b8[_0xb576('0x16')],'queuecallerjoinAt':utils[_0xb576('0x17')](),'mohtime':0x0});}catch(_0x5588fd){utils[_0xb576('0x18')](util[_0xb576('0x13')](_0xb576('0x12'),_0x1895b8[_0xb576('0x5')]),_0x5588fd);}};exports[_0xb576('0x19')]=function(_0x11481d){try{if(!_[_0xb576('0x1a')](queues[_0x11481d[_0xb576('0x5')]])){utils[_0xb576('0x11')](util[_0xb576('0x13')]('[%s][queues][hangup]',_0x11481d[_0xb576('0x5')]),_0x11481d);if(queues[_0x11481d[_0xb576('0x5')]][_0xb576('0x1b')]){if(!queues[_0x11481d['uniqueid']]['queuecallerabandon']&&!queues[_0x11481d['uniqueid']][_0xb576('0x1c')]){queues[_0x11481d[_0xb576('0x5')]]['queuecallercomplete']=!![];queues[_0x11481d['uniqueid']][_0xb576('0x1d')]=utils[_0xb576('0x17')]();queues[_0x11481d[_0xb576('0x5')]][_0xb576('0x9')]=_0xb576('0x1e');}utils[_0xb576('0x3')](util[_0xb576('0x13')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x11481d[_0xb576('0x5')],queues[_0x11481d[_0xb576('0x5')]][_0xb576('0x1f')],queues[_0x11481d['uniqueid']][_0xb576('0x9')]));writeDB(queues[_0x11481d[_0xb576('0x5')]]);}else if(queues[_0x11481d[_0xb576('0x5')]][_0xb576('0x10')]){utils[_0xb576('0x3')](util[_0xb576('0x13')](_0xb576('0x20'),_0x11481d['uniqueid'],queues[_0x11481d['uniqueid']]['name'],queues[_0x11481d[_0xb576('0x5')]]['transfereduniqueid']));queues[queues[_0x11481d[_0xb576('0x5')]][_0xb576('0x10')]]=queues[_0x11481d[_0xb576('0x5')]];queues[queues[_0x11481d['uniqueid']][_0xb576('0x10')]][_0xb576('0x21')]=0x2;delete queues[_0x11481d['uniqueid']];}}}catch(_0x4cd4a7){utils[_0xb576('0x18')](util[_0xb576('0x13')](_0xb576('0x22'),_0x11481d[_0xb576('0x5')]),_0x4cd4a7);}};exports[_0xb576('0x23')]=function(_0x3f482a){try{utils[_0xb576('0x11')](util['format'](_0xb576('0x24'),_0x3f482a[_0xb576('0x5')]),_0x3f482a);if(!_[_0xb576('0x1a')](_0x3f482a[_0xb576('0x25')][_0xb576('0x26')])&&_0x3f482a[_0xb576('0x27')][_0xb576('0x28')]()!==_0xb576('0x29')){if(!_[_0xb576('0x1a')](queues[_0x3f482a[_0xb576('0x5')]])){queues[_0x3f482a[_0xb576('0x5')]][_0xb576('0x2a')]=![];queues[_0x3f482a['uniqueid']][_0xb576('0x2b')]=null;queues[_0x3f482a['uniqueid']][_0xb576('0x1c')]=!![];queues[_0x3f482a['uniqueid']]['queuecallerexitAt']=utils[_0xb576('0x17')]();queues[_0x3f482a[_0xb576('0x5')]][_0xb576('0x9')]=_0x3f482a[_0xb576('0x27')]['toUpperCase']();utils[_0xb576('0x3')](util[_0xb576('0x13')](_0xb576('0x2c'),_0x3f482a[_0xb576('0x5')],queues[_0x3f482a[_0xb576('0x5')]][_0xb576('0x1f')],_0x3f482a[_0xb576('0x27')],queues[_0x3f482a[_0xb576('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x3f482a[_0xb576('0x5')]]);}}else if(!_[_0xb576('0x1a')](_0x3f482a[_0xb576('0x25')][_0xb576('0x2d')])){if(!_[_0xb576('0x1a')](queues[_0x3f482a['uniqueid']])&&!queues[_0x3f482a['uniqueid']][_0xb576('0x2a')]){queues[_0x3f482a[_0xb576('0x5')]][_0xb576('0x2a')]=![];queues[_0x3f482a[_0xb576('0x5')]]['queuecallerabandonAt']=null;queues[_0x3f482a['uniqueid']]['queuecallerexit']=!![];queues[_0x3f482a['uniqueid']]['queuecallerexitAt']=utils[_0xb576('0x17')]();queues[_0x3f482a[_0xb576('0x5')]][_0xb576('0x9')]=_0xb576('0x2e');utils[_0xb576('0x3')](util[_0xb576('0x13')](_0xb576('0x2f'),_0x3f482a['uniqueid'],queues[_0x3f482a[_0xb576('0x5')]][_0xb576('0x1f')],_0x3f482a[_0xb576('0x27')],queues[_0x3f482a[_0xb576('0x5')]][_0xb576('0x9')]));}}}catch(_0x2c75a3){utils[_0xb576('0x18')](util[_0xb576('0x13')]('[%s][queues][varset]',_0x3f482a[_0xb576('0x5')]),_0x2c75a3);}};exports['queuecallerabandon']=function(_0x110641){try{if(!_['isNil'](queues[_0x110641[_0xb576('0x5')]])){utils[_0xb576('0x11')](util[_0xb576('0x13')](_0xb576('0x30'),_0x110641[_0xb576('0x5')]),_0x110641);queues[_0x110641[_0xb576('0x5')]]['queuecallerexit']=![];queues[_0x110641['uniqueid']][_0xb576('0x31')]=null;queues[_0x110641['uniqueid']]['queuecallerabandon']=!![];queues[_0x110641[_0xb576('0x5')]][_0xb576('0x2b')]=utils[_0xb576('0x17')]();queues[_0x110641[_0xb576('0x5')]]['queuecallerexitreason']=_0xb576('0x32');utils['info'](util[_0xb576('0x13')](_0xb576('0x33'),_0x110641[_0xb576('0x5')],queues[_0x110641[_0xb576('0x5')]][_0xb576('0x1f')],queues[_0x110641['uniqueid']][_0xb576('0x9')]));}}catch(_0x399ee1){utils[_0xb576('0x18')](util[_0xb576('0x13')](_0xb576('0x30'),_0x110641['uniqueid']),_0x399ee1);}};exports[_0xb576('0x34')]=function(_0x50c097){try{if(!_[_0xb576('0x1a')](queues[_0x50c097[_0xb576('0x5')]])){utils[_0xb576('0x11')](util['format']('[%s][queues][queuecallerleave]',_0x50c097[_0xb576('0x5')]),_0x50c097);utils[_0xb576('0x3')](util['format'](_0xb576('0x35'),_0x50c097['uniqueid'],queues[_0x50c097[_0xb576('0x5')]]['name'],_0x50c097[_0xb576('0x36')],_0x50c097[_0xb576('0x37')]));queues[_0x50c097[_0xb576('0x5')]][_0xb576('0x34')]=!![];queues[_0x50c097['uniqueid']][_0xb576('0x1b')]=utils[_0xb576('0x17')]();queues[_0x50c097['uniqueid']]['holdtime']=utils[_0xb576('0x38')](queues[_0x50c097[_0xb576('0x5')]]['queuecallerleaveAt'],queues[_0x50c097[_0xb576('0x5')]][_0xb576('0x39')]);queues[_0x50c097[_0xb576('0x5')]][_0xb576('0x16')]=_0x50c097['position'];queues[_0x50c097[_0xb576('0x5')]][_0xb576('0x3a')]=_0x50c097[_0xb576('0x3a')];queues[_0x50c097[_0xb576('0x5')]][_0xb576('0x36')]=_0x50c097[_0xb576('0x36')];queues[_0x50c097['uniqueid']][_0xb576('0x37')]=_0x50c097[_0xb576('0x37')];}}catch(_0x341e60){utils[_0xb576('0x18')](util[_0xb576('0x13')](_0xb576('0x3b'),_0x50c097['uniqueid']),_0x341e60);}};exports[_0xb576('0x3c')]=function(_0x327335){try{if(!_[_0xb576('0x1a')](queues[_0x327335[_0xb576('0x5')]])){utils[_0xb576('0x11')](util[_0xb576('0x13')](_0xb576('0x3d'),_0x327335[_0xb576('0x5')]),_0x327335);utils[_0xb576('0x3')](util[_0xb576('0x13')](_0xb576('0x3e'),_0x327335[_0xb576('0x5')],queues[_0x327335[_0xb576('0x5')]]['name'],_0x327335['membername'],_0x327335[_0xb576('0x3f')]));queues[_0x327335[_0xb576('0x5')]]['queuecallerabandon']=![];queues[_0x327335[_0xb576('0x5')]][_0xb576('0x2a')]=![];queues[_0x327335[_0xb576('0x5')]]['queuecallerabandonAt']=null;queues[_0x327335['uniqueid']][_0xb576('0x1c')]=![];queues[_0x327335[_0xb576('0x5')]][_0xb576('0x9')]=null;queues[_0x327335[_0xb576('0x5')]][_0xb576('0x31')]=null;queues[_0x327335[_0xb576('0x5')]][_0xb576('0x40')]=!![];queues[_0x327335[_0xb576('0x5')]][_0xb576('0x8')]=_0x327335['destaccountcode'];queues[_0x327335[_0xb576('0x5')]][_0xb576('0x7')]=_0x327335[_0xb576('0x41')];}}catch(_0x3003f6){utils['error'](util[_0xb576('0x13')](_0xb576('0x3d'),_0x327335[_0xb576('0x5')]),_0x3003f6);}};exports['agentcomplete']=function(_0x44b692){try{if(!_[_0xb576('0x1a')](queues[_0x44b692['uniqueid']])){if(queues[_0x44b692['uniqueid']]['queuecallerleaveAt']){utils['debug'](util[_0xb576('0x13')](_0xb576('0x42'),_0x44b692[_0xb576('0x5')]),_0x44b692);queues[_0x44b692[_0xb576('0x5')]][_0xb576('0x2a')]=![];queues[_0x44b692[_0xb576('0x5')]]['queuecallerabandon']=![];queues[_0x44b692['uniqueid']][_0xb576('0x2b')]=null;queues[_0x44b692[_0xb576('0x5')]][_0xb576('0x1c')]=![];queues[_0x44b692[_0xb576('0x5')]][_0xb576('0x31')]=null;queues[_0x44b692['uniqueid']][_0xb576('0x40')]=!![];queues[_0x44b692[_0xb576('0x5')]][_0xb576('0x7')]=_0x44b692[_0xb576('0x41')];queues[_0x44b692[_0xb576('0x5')]][_0xb576('0x43')]=!![];queues[_0x44b692[_0xb576('0x5')]][_0xb576('0x1d')]=utils[_0xb576('0x17')]();if(_0x44b692[_0xb576('0x44')]==_0xb576('0x45')){if(!queues[_0x44b692['uniqueid']][_0xb576('0x45')]){queues[_0x44b692[_0xb576('0x5')]]['queuecallerexitreason']=_0xb576('0x46');}}else{queues[_0x44b692[_0xb576('0x5')]][_0xb576('0x9')]=_0xb576('0x47')+_0x44b692['reason']['toUpperCase']();}utils[_0xb576('0x3')](util['format'](_0xb576('0x48'),_0x44b692[_0xb576('0x5')],queues[_0x44b692[_0xb576('0x5')]]['name'],_0x44b692[_0xb576('0x41')],queues[_0x44b692[_0xb576('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x44b692[_0xb576('0x5')]]);}}}catch(_0x19b317){utils[_0xb576('0x18')](util[_0xb576('0x13')](_0xb576('0x42'),_0x44b692[_0xb576('0x5')]),_0x19b317);}};exports['blindtransfer']=function(_0x29877e){try{if(!_[_0xb576('0x1a')](queues[_0x29877e[_0xb576('0x49')]])){utils[_0xb576('0x11')](util[_0xb576('0x13')]('[%s][queues][blindtransfer]',_0x29877e['uniqueid']),_0x29877e);queues[_0x29877e[_0xb576('0x49')]][_0xb576('0x45')]=!![];queues[_0x29877e[_0xb576('0x49')]]['transfertype']=_0xb576('0x4a');queues[_0x29877e[_0xb576('0x49')]]['transferexten']=_0x29877e[_0xb576('0x4b')];queues[_0x29877e[_0xb576('0x49')]][_0xb576('0x4c')]=_0x29877e[_0xb576('0x49')];queues[_0x29877e['transfereeuniqueid']][_0xb576('0x9')]='BLINDTRANSFER';utils['info'](util[_0xb576('0x13')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x29877e[_0xb576('0x5')],queues[_0x29877e[_0xb576('0x49')]][_0xb576('0x1f')],_0x29877e[_0xb576('0x49')],_0x29877e[_0xb576('0x4b')]));}}catch(_0x445e79){utils[_0xb576('0x18')](util[_0xb576('0x13')](_0xb576('0x4d'),_0x29877e['uniqueid']),_0x445e79);}};exports[_0xb576('0x4e')]=function(_0x4ca02b){try{utils[_0xb576('0x11')](util['format'](_0xb576('0x4f'),_0x4ca02b[_0xb576('0x50')]),_0x4ca02b);if(_0x4ca02b[_0xb576('0x50')]==_0x4ca02b[_0xb576('0x51')]){if(!_[_0xb576('0x1a')](queues[_0x4ca02b[_0xb576('0x52')]])){utils[_0xb576('0x3')](util[_0xb576('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x4ca02b[_0xb576('0x50')],queues[_0x4ca02b['secondtransfererlinkedid']][_0xb576('0x1f')],_0x4ca02b[_0xb576('0x53')]));queues[_0x4ca02b[_0xb576('0x52')]]['transfer']=!![];queues[_0x4ca02b['secondtransfererlinkedid']]['transfertype']=_0xb576('0x54');queues[_0x4ca02b[_0xb576('0x52')]][_0xb576('0x55')]=_0x4ca02b['origtransfererexten'];queues[_0x4ca02b['secondtransfererlinkedid']][_0xb576('0x4c')]=_0x4ca02b[_0xb576('0x50')];queues[_0x4ca02b[_0xb576('0x52')]]['queuecallerexitreason']=_0xb576('0x56');}if(!_['isNil'](queues[_0x4ca02b[_0xb576('0x51')]])){if(_0x4ca02b[_0xb576('0x57')]&&queues[_0x4ca02b['transfereelinkedid']]){queues[_0x4ca02b['transfereelinkedid']][_0xb576('0x21')]=0x1;queues[_0x4ca02b[_0xb576('0x49')]]=_[_0xb576('0x58')](queues[_0x4ca02b[_0xb576('0x57')]]);queues[_0x4ca02b['transfereeuniqueid']][_0xb576('0x10')]=_0x4ca02b[_0xb576('0x59')];queues[_0x4ca02b[_0xb576('0x49')]][_0xb576('0x21')]=0x2;queues[_0x4ca02b['transfereeuniqueid']][_0xb576('0x5a')]=queues[_0x4ca02b[_0xb576('0x52')]][_0xb576('0x5a')];queues[_0x4ca02b[_0xb576('0x49')]][_0xb576('0x5b')]=queues[_0x4ca02b[_0xb576('0x52')]][_0xb576('0x5b')];queues[_0x4ca02b[_0xb576('0x49')]][_0xb576('0x39')]=utils['now']();queues[_0x4ca02b[_0xb576('0x49')]][_0xb576('0x1b')]=utils[_0xb576('0x17')]();queues[_0x4ca02b[_0xb576('0x49')]][_0xb576('0x5c')]=0x0;queues[_0x4ca02b[_0xb576('0x49')]][_0xb576('0x5d')]=0x0;utils[_0xb576('0x3')](util['format'](_0xb576('0x5e'),_0x4ca02b[_0xb576('0x50')],queues[_0x4ca02b[_0xb576('0x49')]]['name'],queues[_0x4ca02b[_0xb576('0x49')]][_0xb576('0x5a')],queues[_0x4ca02b[_0xb576('0x49')]][_0xb576('0x5b')]));}else{utils[_0xb576('0x3')](util[_0xb576('0x13')](_0xb576('0x5f'),_0x4ca02b['origtransfereruniqueid'],queues[_0x4ca02b[_0xb576('0x51')]][_0xb576('0x1f')],_0x4ca02b[_0xb576('0x52')]));queues[_0x4ca02b[_0xb576('0x51')]][_0xb576('0x10')]=_0x4ca02b[_0xb576('0x52')];}}}else if(_0x4ca02b[_0xb576('0x60')]==_0x4ca02b[_0xb576('0x52')]){if(!_['isNil'](queues[_0x4ca02b[_0xb576('0x51')]])){utils[_0xb576('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x4ca02b[_0xb576('0x50')],queues[_0x4ca02b['origtransfererlinkedid']][_0xb576('0x1f')],_0x4ca02b[_0xb576('0x60')],_0x4ca02b[_0xb576('0x61')]));queues[_0x4ca02b['origtransfererlinkedid']][_0xb576('0x45')]=!![];queues[_0x4ca02b[_0xb576('0x51')]][_0xb576('0x62')]=_0xb576('0x54');queues[_0x4ca02b[_0xb576('0x51')]][_0xb576('0x55')]=_0x4ca02b[_0xb576('0x61')];queues[_0x4ca02b[_0xb576('0x51')]][_0xb576('0x4c')]=_0x4ca02b[_0xb576('0x60')];queues[_0x4ca02b[_0xb576('0x51')]][_0xb576('0x9')]='ATTENDEDTRANSFER';}if(!_[_0xb576('0x1a')](queues[_0x4ca02b[_0xb576('0x52')]])){if(_0x4ca02b['transfertargetlinkedid']&&queues[_0x4ca02b['transfertargetlinkedid']]){queues[_0x4ca02b[_0xb576('0x63')]][_0xb576('0x21')]=0x1;queues[_0x4ca02b[_0xb576('0x59')]]=_['clone'](queues[_0x4ca02b[_0xb576('0x63')]]);queues[_0x4ca02b[_0xb576('0x59')]][_0xb576('0x10')]=_0x4ca02b[_0xb576('0x59')];queues[_0x4ca02b[_0xb576('0x59')]][_0xb576('0x21')]=0x2;queues[_0x4ca02b[_0xb576('0x59')]][_0xb576('0x5a')]=queues[_0x4ca02b['origtransfererlinkedid']]['calleridnum'];queues[_0x4ca02b['transfertargetuniqueid']][_0xb576('0x5b')]=queues[_0x4ca02b[_0xb576('0x51')]][_0xb576('0x5b')];queues[_0x4ca02b[_0xb576('0x59')]][_0xb576('0x39')]=utils[_0xb576('0x17')]();queues[_0x4ca02b[_0xb576('0x59')]][_0xb576('0x1b')]=utils['now']();queues[_0x4ca02b['transfertargetuniqueid']][_0xb576('0x5c')]=0x0;queues[_0x4ca02b['transfertargetuniqueid']][_0xb576('0x5d')]=0x0;utils[_0xb576('0x3')](util[_0xb576('0x13')](_0xb576('0x64'),_0x4ca02b[_0xb576('0x50')],queues[_0x4ca02b[_0xb576('0x59')]][_0xb576('0x1f')],queues[_0x4ca02b[_0xb576('0x59')]][_0xb576('0x10')],queues[_0x4ca02b[_0xb576('0x59')]][_0xb576('0x5a')],queues[_0x4ca02b['transfertargetuniqueid']][_0xb576('0x5b')]));}else{utils['info'](util[_0xb576('0x13')](_0xb576('0x5f'),_0x4ca02b[_0xb576('0x50')],queues[_0x4ca02b[_0xb576('0x52')]][_0xb576('0x1f')],_0x4ca02b[_0xb576('0x51')]));queues[_0x4ca02b[_0xb576('0x52')]][_0xb576('0x10')]=_0x4ca02b[_0xb576('0x51')];}}}}catch(_0x33c45a){utils[_0xb576('0x18')](util[_0xb576('0x13')](_0xb576('0x4f'),_0x4ca02b[_0xb576('0x50')]),_0x33c45a);}};exports[_0xb576('0x65')]=function(_0x236af4){try{if(!_[_0xb576('0x1a')](queues[_0x236af4['uniqueid']])){utils[_0xb576('0x11')](util['format'](_0xb576('0x66'),_0x236af4['uniqueid']),_0x236af4);queues[_0x236af4['uniqueid']][_0xb576('0x67')]=utils['now']();utils[_0xb576('0x3')](util[_0xb576('0x13')](_0xb576('0x68'),_0x236af4[_0xb576('0x5')],queues[_0x236af4[_0xb576('0x5')]][_0xb576('0x1f')],queues[_0x236af4[_0xb576('0x5')]][_0xb576('0x67')]));}}catch(_0x37f118){utils[_0xb576('0x18')](util[_0xb576('0x13')](_0xb576('0x66'),_0x236af4[_0xb576('0x5')]),_0x37f118);}};exports[_0xb576('0x69')]=function(_0x463571){try{if(!_[_0xb576('0x1a')](queues[_0x463571[_0xb576('0x5')]])){if(!_[_0xb576('0x1a')](queues[_0x463571[_0xb576('0x5')]]['musiconholdstartAt'])){utils['debug'](util[_0xb576('0x13')](_0xb576('0x6a'),_0x463571['uniqueid']),_0x463571);queues[_0x463571[_0xb576('0x5')]][_0xb576('0x5d')]+=utils[_0xb576('0x38')](utils[_0xb576('0x17')](),queues[_0x463571[_0xb576('0x5')]][_0xb576('0x67')]);utils[_0xb576('0x3')](util['format'](_0xb576('0x6b'),_0x463571['uniqueid'],queues[_0x463571[_0xb576('0x5')]][_0xb576('0x1f')],queues[_0x463571[_0xb576('0x5')]]['mohtime']));delete queues[_0x463571[_0xb576('0x5')]][_0xb576('0x67')];}}}catch(_0x2669fc){utils[_0xb576('0x18')](util['format']('[%s][queues][musiconholdstop]',_0x463571[_0xb576('0x5')]),_0x2669fc);}}; \ No newline at end of file +var _0xba21=['queue','calleridnum','accountcode','queuecallerexitreason','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','debug','queuecallerabandon','queuecallercompleteAt','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','queuecallerabandonAt','queuecallerexitAt','info','queueposition','queuecallerexit','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','[%s][queues][agentconnect]','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','[%s][queues][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','origtransfererlinkedid','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel'];(function(_0x2d111b,_0x1b2b07){var _0x224f1d=function(_0x308381){while(--_0x308381){_0x2d111b['push'](_0x2d111b['shift']());}};_0x224f1d(++_0x1b2b07);}(_0xba21,0xc5));var _0x1ba2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xba21[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x1ba2('0x0'));var queues={};function writeDB(_0x26be62){utils['info'](util[_0x1ba2('0x1')](_0x1ba2('0x2'),_0x26be62[_0x1ba2('0x3')],_0x26be62[_0x1ba2('0x4')],_0x26be62[_0x1ba2('0x5')],_0x26be62['lastAssignedTo'],_0x26be62[_0x1ba2('0x6')],_0x26be62[_0x1ba2('0x7')],_0x26be62[_0x1ba2('0x8')]));if(_0x26be62[_0x1ba2('0x5')]){utils['getVoiceQueueByName'](_0x26be62[_0x1ba2('0x5')])['then'](function(_0x9f1e8c){if(_0x9f1e8c){_0x26be62[_0x1ba2('0x9')]=_0x9f1e8c['type'];}utils[_0x1ba2('0xa')](_0x1ba2('0xb'),_0x26be62);});}else{utils['request'](_0x1ba2('0xb'),_0x26be62);}if(_0x26be62['transfereduniqueid']){delete queues[_0x26be62[_0x1ba2('0xc')]];}else{delete queues[_0x26be62[_0x1ba2('0x3')]];}}exports[_0x1ba2('0xd')]=function(_0x540f16){try{utils['debug'](util[_0x1ba2('0x1')]('[%s][queues][queuecallerjoin]',_0x540f16[_0x1ba2('0x3')]),_0x540f16);utils['info'](util[_0x1ba2('0x1')](_0x1ba2('0xe'),_0x540f16['uniqueid'],_0x540f16[_0x1ba2('0x5')],_0x540f16[_0x1ba2('0xf')]));queues[_0x540f16[_0x1ba2('0x3')]]=_['assign'](_0x540f16,{'originalposition':_0x540f16[_0x1ba2('0xf')],'queuecallerjoinAt':utils[_0x1ba2('0x10')](),'mohtime':0x0});}catch(_0x3963ee){utils[_0x1ba2('0x11')](util[_0x1ba2('0x1')](_0x1ba2('0x12'),_0x540f16[_0x1ba2('0x3')]),_0x3963ee);}};exports[_0x1ba2('0x13')]=function(_0xd0d7de){try{if(!_[_0x1ba2('0x14')](queues[_0xd0d7de['uniqueid']])){utils[_0x1ba2('0x15')](util[_0x1ba2('0x1')]('[%s][queues][hangup]',_0xd0d7de['uniqueid']),_0xd0d7de);if(queues[_0xd0d7de['uniqueid']]['queuecallerleaveAt']){if(!queues[_0xd0d7de[_0x1ba2('0x3')]][_0x1ba2('0x16')]&&!queues[_0xd0d7de['uniqueid']]['queuecallerexit']){queues[_0xd0d7de[_0x1ba2('0x3')]]['queuecallercomplete']=!![];queues[_0xd0d7de[_0x1ba2('0x3')]][_0x1ba2('0x17')]=utils[_0x1ba2('0x10')]();queues[_0xd0d7de[_0x1ba2('0x3')]]['queuecallerexitreason']=_0x1ba2('0x18');}utils['info'](util[_0x1ba2('0x1')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0xd0d7de[_0x1ba2('0x3')],queues[_0xd0d7de['uniqueid']][_0x1ba2('0x19')],queues[_0xd0d7de[_0x1ba2('0x3')]][_0x1ba2('0x8')]));writeDB(queues[_0xd0d7de[_0x1ba2('0x3')]]);}else if(queues[_0xd0d7de['uniqueid']]['transfereduniqueid']){utils['info'](util[_0x1ba2('0x1')](_0x1ba2('0x1a'),_0xd0d7de['uniqueid'],queues[_0xd0d7de[_0x1ba2('0x3')]][_0x1ba2('0x19')],queues[_0xd0d7de[_0x1ba2('0x3')]][_0x1ba2('0xc')]));queues[queues[_0xd0d7de[_0x1ba2('0x3')]][_0x1ba2('0xc')]]=queues[_0xd0d7de[_0x1ba2('0x3')]];queues[queues[_0xd0d7de[_0x1ba2('0x3')]][_0x1ba2('0xc')]][_0x1ba2('0x1b')]=0x2;delete queues[_0xd0d7de[_0x1ba2('0x3')]];}}}catch(_0x45270e){utils['error'](util[_0x1ba2('0x1')](_0x1ba2('0x1c'),_0xd0d7de[_0x1ba2('0x3')]),_0x45270e);}};exports[_0x1ba2('0x1d')]=function(_0x2f53df){try{utils[_0x1ba2('0x15')](util['format'](_0x1ba2('0x1e'),_0x2f53df[_0x1ba2('0x3')]),_0x2f53df);if(!_[_0x1ba2('0x14')](_0x2f53df[_0x1ba2('0x1f')][_0x1ba2('0x20')])&&_0x2f53df[_0x1ba2('0x21')][_0x1ba2('0x22')]()!=='CONTINUE'){if(!_[_0x1ba2('0x14')](queues[_0x2f53df[_0x1ba2('0x3')]])){queues[_0x2f53df[_0x1ba2('0x3')]][_0x1ba2('0x16')]=![];queues[_0x2f53df[_0x1ba2('0x3')]][_0x1ba2('0x23')]=null;queues[_0x2f53df['uniqueid']]['queuecallerexit']=!![];queues[_0x2f53df['uniqueid']][_0x1ba2('0x24')]=utils[_0x1ba2('0x10')]();queues[_0x2f53df['uniqueid']][_0x1ba2('0x8')]=_0x2f53df[_0x1ba2('0x21')][_0x1ba2('0x22')]();utils[_0x1ba2('0x25')](util[_0x1ba2('0x1')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x2f53df[_0x1ba2('0x3')],queues[_0x2f53df['uniqueid']][_0x1ba2('0x19')],_0x2f53df[_0x1ba2('0x21')],queues[_0x2f53df[_0x1ba2('0x3')]][_0x1ba2('0x8')]));writeDB(queues[_0x2f53df[_0x1ba2('0x3')]]);}}else if(!_[_0x1ba2('0x14')](_0x2f53df['variable'][_0x1ba2('0x26')])){if(!_['isNil'](queues[_0x2f53df[_0x1ba2('0x3')]])&&!queues[_0x2f53df[_0x1ba2('0x3')]][_0x1ba2('0x16')]){queues[_0x2f53df[_0x1ba2('0x3')]][_0x1ba2('0x16')]=![];queues[_0x2f53df['uniqueid']][_0x1ba2('0x23')]=null;queues[_0x2f53df['uniqueid']][_0x1ba2('0x27')]=!![];queues[_0x2f53df[_0x1ba2('0x3')]]['queuecallerexitAt']=utils[_0x1ba2('0x10')]();queues[_0x2f53df[_0x1ba2('0x3')]][_0x1ba2('0x8')]=_0x1ba2('0x28');utils[_0x1ba2('0x25')](util[_0x1ba2('0x1')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x2f53df[_0x1ba2('0x3')],queues[_0x2f53df['uniqueid']][_0x1ba2('0x19')],_0x2f53df['value'],queues[_0x2f53df[_0x1ba2('0x3')]]['queuecallerexitreason']));}}}catch(_0x18d133){utils[_0x1ba2('0x11')](util[_0x1ba2('0x1')]('[%s][queues][varset]',_0x2f53df['uniqueid']),_0x18d133);}};exports[_0x1ba2('0x16')]=function(_0x46ec49){try{if(!_[_0x1ba2('0x14')](queues[_0x46ec49[_0x1ba2('0x3')]])){utils[_0x1ba2('0x15')](util[_0x1ba2('0x1')](_0x1ba2('0x29'),_0x46ec49['uniqueid']),_0x46ec49);queues[_0x46ec49[_0x1ba2('0x3')]][_0x1ba2('0x27')]=![];queues[_0x46ec49[_0x1ba2('0x3')]]['queuecallerexitAt']=null;queues[_0x46ec49[_0x1ba2('0x3')]]['queuecallerabandon']=!![];queues[_0x46ec49[_0x1ba2('0x3')]][_0x1ba2('0x23')]=utils[_0x1ba2('0x10')]();queues[_0x46ec49[_0x1ba2('0x3')]][_0x1ba2('0x8')]=_0x1ba2('0x2a');utils['info'](util[_0x1ba2('0x1')](_0x1ba2('0x2b'),_0x46ec49[_0x1ba2('0x3')],queues[_0x46ec49[_0x1ba2('0x3')]]['name'],queues[_0x46ec49[_0x1ba2('0x3')]][_0x1ba2('0x8')]));}}catch(_0x1574b6){utils[_0x1ba2('0x11')](util[_0x1ba2('0x1')]('[%s][queues][queuecallerabandon]',_0x46ec49['uniqueid']),_0x1574b6);}};exports[_0x1ba2('0x2c')]=function(_0x4983c2){try{if(!_['isNil'](queues[_0x4983c2['uniqueid']])){utils['debug'](util[_0x1ba2('0x1')](_0x1ba2('0x2d'),_0x4983c2[_0x1ba2('0x3')]),_0x4983c2);utils[_0x1ba2('0x25')](util[_0x1ba2('0x1')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x4983c2[_0x1ba2('0x3')],queues[_0x4983c2[_0x1ba2('0x3')]][_0x1ba2('0x19')],_0x4983c2[_0x1ba2('0x2e')],_0x4983c2[_0x1ba2('0x2f')]));queues[_0x4983c2[_0x1ba2('0x3')]]['queuecallerleave']=!![];queues[_0x4983c2['uniqueid']]['queuecallerleaveAt']=utils[_0x1ba2('0x10')]();queues[_0x4983c2[_0x1ba2('0x3')]][_0x1ba2('0x30')]=utils[_0x1ba2('0x31')](queues[_0x4983c2[_0x1ba2('0x3')]]['queuecallerleaveAt'],queues[_0x4983c2[_0x1ba2('0x3')]][_0x1ba2('0x32')]);queues[_0x4983c2[_0x1ba2('0x3')]][_0x1ba2('0xf')]=_0x4983c2[_0x1ba2('0xf')];queues[_0x4983c2[_0x1ba2('0x3')]]['count']=_0x4983c2[_0x1ba2('0x33')];queues[_0x4983c2[_0x1ba2('0x3')]][_0x1ba2('0x2e')]=_0x4983c2[_0x1ba2('0x2e')];queues[_0x4983c2[_0x1ba2('0x3')]][_0x1ba2('0x2f')]=_0x4983c2['connectedlinename'];}}catch(_0x50f1d7){utils[_0x1ba2('0x11')](util[_0x1ba2('0x1')](_0x1ba2('0x2d'),_0x4983c2[_0x1ba2('0x3')]),_0x50f1d7);}};exports[_0x1ba2('0x34')]=function(_0x184eac){try{if(!_[_0x1ba2('0x14')](queues[_0x184eac[_0x1ba2('0x3')]])){utils[_0x1ba2('0x15')](util[_0x1ba2('0x1')]('[%s][queues][agentconnect]',_0x184eac[_0x1ba2('0x3')]),_0x184eac);utils[_0x1ba2('0x25')](util['format'](_0x1ba2('0x35'),_0x184eac[_0x1ba2('0x3')],queues[_0x184eac[_0x1ba2('0x3')]]['name'],_0x184eac[_0x1ba2('0x36')],_0x184eac[_0x1ba2('0x37')]));queues[_0x184eac[_0x1ba2('0x3')]][_0x1ba2('0x16')]=![];queues[_0x184eac['uniqueid']][_0x1ba2('0x16')]=![];queues[_0x184eac[_0x1ba2('0x3')]][_0x1ba2('0x23')]=null;queues[_0x184eac[_0x1ba2('0x3')]][_0x1ba2('0x27')]=![];queues[_0x184eac[_0x1ba2('0x3')]]['queuecallerexitreason']=null;queues[_0x184eac[_0x1ba2('0x3')]][_0x1ba2('0x24')]=null;queues[_0x184eac[_0x1ba2('0x3')]][_0x1ba2('0x38')]=!![];queues[_0x184eac[_0x1ba2('0x3')]][_0x1ba2('0x7')]=_0x184eac['destaccountcode'];queues[_0x184eac[_0x1ba2('0x3')]][_0x1ba2('0x39')]=_0x184eac['membername'];}}catch(_0x4ebeab){utils[_0x1ba2('0x11')](util[_0x1ba2('0x1')](_0x1ba2('0x3a'),_0x184eac[_0x1ba2('0x3')]),_0x4ebeab);}};exports['agentcomplete']=function(_0x2cbe89){try{if(!_[_0x1ba2('0x14')](queues[_0x2cbe89['uniqueid']])){if(queues[_0x2cbe89['uniqueid']]['queuecallerleaveAt']){utils['debug'](util['format'](_0x1ba2('0x3b'),_0x2cbe89[_0x1ba2('0x3')]),_0x2cbe89);queues[_0x2cbe89[_0x1ba2('0x3')]][_0x1ba2('0x16')]=![];queues[_0x2cbe89['uniqueid']]['queuecallerabandon']=![];queues[_0x2cbe89[_0x1ba2('0x3')]]['queuecallerabandonAt']=null;queues[_0x2cbe89[_0x1ba2('0x3')]]['queuecallerexit']=![];queues[_0x2cbe89[_0x1ba2('0x3')]][_0x1ba2('0x24')]=null;queues[_0x2cbe89['uniqueid']][_0x1ba2('0x38')]=!![];queues[_0x2cbe89[_0x1ba2('0x3')]][_0x1ba2('0x39')]=_0x2cbe89[_0x1ba2('0x36')];queues[_0x2cbe89['uniqueid']][_0x1ba2('0x3c')]=!![];queues[_0x2cbe89[_0x1ba2('0x3')]]['queuecallercompleteAt']=utils['now']();if(_0x2cbe89[_0x1ba2('0x3d')]==_0x1ba2('0x3e')){if(!queues[_0x2cbe89[_0x1ba2('0x3')]][_0x1ba2('0x3e')]){queues[_0x2cbe89[_0x1ba2('0x3')]][_0x1ba2('0x8')]=_0x1ba2('0x3f');}}else{queues[_0x2cbe89['uniqueid']][_0x1ba2('0x8')]='COMPLETEDBY'+_0x2cbe89[_0x1ba2('0x3d')][_0x1ba2('0x22')]();}utils[_0x1ba2('0x25')](util['format'](_0x1ba2('0x40'),_0x2cbe89[_0x1ba2('0x3')],queues[_0x2cbe89[_0x1ba2('0x3')]][_0x1ba2('0x19')],_0x2cbe89['membername'],queues[_0x2cbe89[_0x1ba2('0x3')]][_0x1ba2('0x8')]));writeDB(queues[_0x2cbe89['uniqueid']]);}}}catch(_0x3bb118){utils[_0x1ba2('0x11')](util['format'](_0x1ba2('0x3b'),_0x2cbe89['uniqueid']),_0x3bb118);}};exports[_0x1ba2('0x41')]=function(_0x8be85d){try{if(!_['isNil'](queues[_0x8be85d['transfereeuniqueid']])){utils[_0x1ba2('0x15')](util[_0x1ba2('0x1')]('[%s][queues][blindtransfer]',_0x8be85d[_0x1ba2('0x3')]),_0x8be85d);queues[_0x8be85d[_0x1ba2('0x42')]][_0x1ba2('0x3e')]=!![];queues[_0x8be85d['transfereeuniqueid']][_0x1ba2('0x43')]=_0x1ba2('0x44');queues[_0x8be85d[_0x1ba2('0x42')]][_0x1ba2('0x45')]=_0x8be85d['extension'];queues[_0x8be85d['transfereeuniqueid']][_0x1ba2('0x46')]=_0x8be85d[_0x1ba2('0x42')];queues[_0x8be85d[_0x1ba2('0x42')]][_0x1ba2('0x8')]=_0x1ba2('0x47');utils[_0x1ba2('0x25')](util[_0x1ba2('0x1')](_0x1ba2('0x48'),_0x8be85d[_0x1ba2('0x3')],queues[_0x8be85d[_0x1ba2('0x42')]][_0x1ba2('0x19')],_0x8be85d[_0x1ba2('0x42')],_0x8be85d[_0x1ba2('0x49')]));}}catch(_0x1bbcc3){utils['error'](util['format'](_0x1ba2('0x4a'),_0x8be85d[_0x1ba2('0x3')]),_0x1bbcc3);}};exports[_0x1ba2('0x4b')]=function(_0x355b08){try{utils[_0x1ba2('0x15')](util['format']('[%s][queues][attendedtransfer]',_0x355b08[_0x1ba2('0x4c')]),_0x355b08);if(_0x355b08[_0x1ba2('0x4c')]==_0x355b08['origtransfererlinkedid']){if(!_[_0x1ba2('0x14')](queues[_0x355b08['secondtransfererlinkedid']])){utils[_0x1ba2('0x25')](util[_0x1ba2('0x1')](_0x1ba2('0x4d'),_0x355b08['origtransfereruniqueid'],queues[_0x355b08[_0x1ba2('0x4e')]][_0x1ba2('0x19')],_0x355b08[_0x1ba2('0x4f')]));queues[_0x355b08[_0x1ba2('0x4e')]][_0x1ba2('0x3e')]=!![];queues[_0x355b08['secondtransfererlinkedid']][_0x1ba2('0x43')]=_0x1ba2('0x50');queues[_0x355b08[_0x1ba2('0x4e')]][_0x1ba2('0x45')]=_0x355b08['origtransfererexten'];queues[_0x355b08[_0x1ba2('0x4e')]][_0x1ba2('0x46')]=_0x355b08[_0x1ba2('0x4c')];queues[_0x355b08[_0x1ba2('0x4e')]][_0x1ba2('0x8')]='ATTENDEDTRANSFER';}if(!_[_0x1ba2('0x14')](queues[_0x355b08[_0x1ba2('0x51')]])){if(_0x355b08[_0x1ba2('0x52')]&&queues[_0x355b08['transfereelinkedid']]){queues[_0x355b08[_0x1ba2('0x52')]][_0x1ba2('0x1b')]=0x1;queues[_0x355b08[_0x1ba2('0x42')]]=_['clone'](queues[_0x355b08[_0x1ba2('0x52')]]);queues[_0x355b08[_0x1ba2('0x42')]][_0x1ba2('0xc')]=_0x355b08[_0x1ba2('0x53')];queues[_0x355b08[_0x1ba2('0x42')]][_0x1ba2('0x1b')]=0x2;queues[_0x355b08['transfereeuniqueid']][_0x1ba2('0x6')]=queues[_0x355b08[_0x1ba2('0x4e')]][_0x1ba2('0x6')];queues[_0x355b08[_0x1ba2('0x42')]]['calleridname']=queues[_0x355b08['secondtransfererlinkedid']][_0x1ba2('0x54')];queues[_0x355b08[_0x1ba2('0x42')]][_0x1ba2('0x32')]=utils[_0x1ba2('0x10')]();queues[_0x355b08['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0x1ba2('0x10')]();queues[_0x355b08['transfereeuniqueid']]['holdtime']=0x0;queues[_0x355b08['transfereeuniqueid']][_0x1ba2('0x55')]=0x0;utils[_0x1ba2('0x25')](util[_0x1ba2('0x1')](_0x1ba2('0x56'),_0x355b08[_0x1ba2('0x4c')],queues[_0x355b08[_0x1ba2('0x42')]]['name'],queues[_0x355b08['transfereeuniqueid']]['calleridnum'],queues[_0x355b08['transfereeuniqueid']][_0x1ba2('0x54')]));}else{utils[_0x1ba2('0x25')](util[_0x1ba2('0x1')](_0x1ba2('0x57'),_0x355b08[_0x1ba2('0x4c')],queues[_0x355b08[_0x1ba2('0x51')]][_0x1ba2('0x19')],_0x355b08[_0x1ba2('0x4e')]));queues[_0x355b08['origtransfererlinkedid']][_0x1ba2('0xc')]=_0x355b08[_0x1ba2('0x4e')];}}}else if(_0x355b08[_0x1ba2('0x58')]==_0x355b08[_0x1ba2('0x4e')]){if(!_[_0x1ba2('0x14')](queues[_0x355b08[_0x1ba2('0x51')]])){utils[_0x1ba2('0x25')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x355b08[_0x1ba2('0x4c')],queues[_0x355b08[_0x1ba2('0x51')]][_0x1ba2('0x19')],_0x355b08['secondtransfereruniqueid'],_0x355b08[_0x1ba2('0x59')]));queues[_0x355b08[_0x1ba2('0x51')]]['transfer']=!![];queues[_0x355b08[_0x1ba2('0x51')]][_0x1ba2('0x43')]=_0x1ba2('0x50');queues[_0x355b08[_0x1ba2('0x51')]]['transferexten']=_0x355b08[_0x1ba2('0x59')];queues[_0x355b08[_0x1ba2('0x51')]][_0x1ba2('0x46')]=_0x355b08[_0x1ba2('0x58')];queues[_0x355b08[_0x1ba2('0x51')]][_0x1ba2('0x8')]=_0x1ba2('0x5a');}if(!_[_0x1ba2('0x14')](queues[_0x355b08[_0x1ba2('0x4e')]])){if(_0x355b08[_0x1ba2('0x5b')]&&queues[_0x355b08[_0x1ba2('0x5b')]]){queues[_0x355b08['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x355b08['transfertargetuniqueid']]=_[_0x1ba2('0x5c')](queues[_0x355b08[_0x1ba2('0x5b')]]);queues[_0x355b08[_0x1ba2('0x53')]][_0x1ba2('0xc')]=_0x355b08[_0x1ba2('0x53')];queues[_0x355b08[_0x1ba2('0x53')]][_0x1ba2('0x1b')]=0x2;queues[_0x355b08[_0x1ba2('0x53')]]['calleridnum']=queues[_0x355b08[_0x1ba2('0x51')]][_0x1ba2('0x6')];queues[_0x355b08[_0x1ba2('0x53')]][_0x1ba2('0x54')]=queues[_0x355b08[_0x1ba2('0x51')]][_0x1ba2('0x54')];queues[_0x355b08['transfertargetuniqueid']][_0x1ba2('0x32')]=utils[_0x1ba2('0x10')]();queues[_0x355b08[_0x1ba2('0x53')]]['queuecallerleaveAt']=utils[_0x1ba2('0x10')]();queues[_0x355b08[_0x1ba2('0x53')]][_0x1ba2('0x30')]=0x0;queues[_0x355b08[_0x1ba2('0x53')]][_0x1ba2('0x55')]=0x0;utils['info'](util[_0x1ba2('0x1')](_0x1ba2('0x5d'),_0x355b08['origtransfereruniqueid'],queues[_0x355b08['transfertargetuniqueid']][_0x1ba2('0x19')],queues[_0x355b08[_0x1ba2('0x53')]][_0x1ba2('0xc')],queues[_0x355b08[_0x1ba2('0x53')]][_0x1ba2('0x6')],queues[_0x355b08[_0x1ba2('0x53')]][_0x1ba2('0x54')]));}else{utils[_0x1ba2('0x25')](util[_0x1ba2('0x1')](_0x1ba2('0x57'),_0x355b08['origtransfereruniqueid'],queues[_0x355b08[_0x1ba2('0x4e')]][_0x1ba2('0x19')],_0x355b08[_0x1ba2('0x51')]));queues[_0x355b08[_0x1ba2('0x4e')]][_0x1ba2('0xc')]=_0x355b08['origtransfererlinkedid'];}}}}catch(_0xe81601){utils[_0x1ba2('0x11')](util[_0x1ba2('0x1')](_0x1ba2('0x5e'),_0x355b08[_0x1ba2('0x4c')]),_0xe81601);}};exports[_0x1ba2('0x5f')]=function(_0x2c56d1){try{if(!_[_0x1ba2('0x14')](queues[_0x2c56d1[_0x1ba2('0x3')]])){utils[_0x1ba2('0x15')](util[_0x1ba2('0x1')](_0x1ba2('0x60'),_0x2c56d1['uniqueid']),_0x2c56d1);queues[_0x2c56d1[_0x1ba2('0x3')]][_0x1ba2('0x61')]=utils[_0x1ba2('0x10')]();utils[_0x1ba2('0x25')](util[_0x1ba2('0x1')](_0x1ba2('0x62'),_0x2c56d1['uniqueid'],queues[_0x2c56d1[_0x1ba2('0x3')]][_0x1ba2('0x19')],queues[_0x2c56d1[_0x1ba2('0x3')]][_0x1ba2('0x61')]));}}catch(_0x41faed){utils[_0x1ba2('0x11')](util[_0x1ba2('0x1')](_0x1ba2('0x60'),_0x2c56d1[_0x1ba2('0x3')]),_0x41faed);}};exports['musiconholdstop']=function(_0x1ca7df){try{if(!_['isNil'](queues[_0x1ca7df[_0x1ba2('0x3')]])){if(!_[_0x1ba2('0x14')](queues[_0x1ca7df[_0x1ba2('0x3')]]['musiconholdstartAt'])){utils[_0x1ba2('0x15')](util[_0x1ba2('0x1')](_0x1ba2('0x63'),_0x1ca7df[_0x1ba2('0x3')]),_0x1ca7df);queues[_0x1ca7df[_0x1ba2('0x3')]][_0x1ba2('0x55')]+=utils['diffTime'](utils[_0x1ba2('0x10')](),queues[_0x1ca7df['uniqueid']]['musiconholdstartAt']);utils[_0x1ba2('0x25')](util[_0x1ba2('0x1')](_0x1ba2('0x64'),_0x1ca7df[_0x1ba2('0x3')],queues[_0x1ca7df[_0x1ba2('0x3')]][_0x1ba2('0x19')],queues[_0x1ca7df[_0x1ba2('0x3')]]['mohtime']));delete queues[_0x1ca7df[_0x1ba2('0x3')]][_0x1ba2('0x61')];}}}catch(_0x38a22e){utils[_0x1ba2('0x11')](util[_0x1ba2('0x1')](_0x1ba2('0x63'),_0x1ca7df[_0x1ba2('0x3')]),_0x38a22e);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 9f3c83c..81598e8 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 _0xa9af=['linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','[%s][recordings][newstate]','varset','variable','[%s][recordings][varset]','value','replace','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','clone','error','newexten','[%s][recordings][newexten]','appdata','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queue','[%s][recordings][queuecallerjoin]','./utils','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]'];(function(_0x409dd7,_0x446dd1){var _0x1540d3=function(_0x38a658){while(--_0x38a658){_0x409dd7['push'](_0x409dd7['shift']());}};_0x1540d3(++_0x446dd1);}(_0xa9af,0x1d9));var _0xfa9a=function(_0x2871c2,_0xe4c551){_0x2871c2=_0x2871c2-0x0;var _0x279bac=_0xa9af[_0x2871c2];return _0x279bac;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xfa9a('0x0'));var recordings={};function writeDB(_0x35d794){utils['info'](util[_0xfa9a('0x1')](_0xfa9a('0x2'),_0x35d794[_0xfa9a('0x3')]));if(_0x35d794[_0xfa9a('0x4')]){utils[_0xfa9a('0x5')](_0x35d794[_0xfa9a('0x4')])[_0xfa9a('0x6')](function(_0x486822){if(_0x486822){_0x35d794[_0xfa9a('0x7')]=_0x486822[_0xfa9a('0x8')];_0x35d794[_0xfa9a('0x9')]=_0x486822['id'];}utils[_0xfa9a('0xa')](_0xfa9a('0xb'),_0x35d794);});}else{utils[_0xfa9a('0xa')](_0xfa9a('0xb'),_0x35d794);}}exports[_0xfa9a('0xc')]=function(_0x3b8ca5){try{utils[_0xfa9a('0xd')](util[_0xfa9a('0x1')](_0xfa9a('0xe'),_0x3b8ca5[_0xfa9a('0x3')]),_0x3b8ca5);if(_0x3b8ca5[_0xfa9a('0x3')]==_0x3b8ca5[_0xfa9a('0xf')]){utils[_0xfa9a('0x10')](util[_0xfa9a('0x1')](_0xfa9a('0x11'),_0x3b8ca5[_0xfa9a('0x3')],_0x3b8ca5[_0xfa9a('0x12')],_0x3b8ca5[_0xfa9a('0x13')]));recordings[_0x3b8ca5[_0xfa9a('0x3')]]={'uniqueid':_0x3b8ca5[_0xfa9a('0x3')],'accountcode':_0x3b8ca5[_0xfa9a('0x4')],'exten':_0x3b8ca5[_0xfa9a('0x13')],'context':_0x3b8ca5[_0xfa9a('0x12')],'channel':_0x3b8ca5['channel'],'monitors':[]};}}catch(_0x296f67){utils['error'](util[_0xfa9a('0x1')]('[%s][recordings][newchannel]',_0x3b8ca5[_0xfa9a('0x3')]),_0x296f67);}};exports[_0xfa9a('0x14')]=function(_0xb90e7e){try{utils[_0xfa9a('0xd')](util[_0xfa9a('0x1')]('[%s][recordings][newstate]',_0xb90e7e[_0xfa9a('0x3')]),_0xb90e7e);if(!_[_0xfa9a('0x15')](recordings[_0xb90e7e[_0xfa9a('0x3')]])&&_0xb90e7e[_0xfa9a('0x16')]==0x6){utils[_0xfa9a('0x10')](util[_0xfa9a('0x1')](_0xfa9a('0x17'),_0xb90e7e[_0xfa9a('0x3')],_0xb90e7e['context'],_0xb90e7e[_0xfa9a('0x18')]));}else if(!_[_0xfa9a('0x15')](recordings[_0xb90e7e[_0xfa9a('0xf')]])&&_0xb90e7e[_0xfa9a('0x16')]==0x6&&_0xb90e7e[_0xfa9a('0x12')]!=_0xfa9a('0x19')){utils[_0xfa9a('0x10')](util[_0xfa9a('0x1')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0xb90e7e['uniqueid'],_0xb90e7e[_0xfa9a('0xf')],_0xb90e7e[_0xfa9a('0x12')],_0xb90e7e[_0xfa9a('0x18')]));recordings[_0xb90e7e['linkedid']]['accountcode']=_0xb90e7e['accountcode'];}}catch(_0x341848){utils['error'](util[_0xfa9a('0x1')](_0xfa9a('0x1a'),_0xb90e7e['uniqueid']),_0x341848);}};exports[_0xfa9a('0x1b')]=function(_0x2be5b4){try{if(!_['isNil'](_0x2be5b4[_0xfa9a('0x1c')])&&!_[_0xfa9a('0x15')](_0x2be5b4[_0xfa9a('0x1c')]['mixmonitor_filename'])){utils['debug'](util[_0xfa9a('0x1')](_0xfa9a('0x1d'),_0x2be5b4[_0xfa9a('0x3')]),_0x2be5b4);utils['info'](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x2be5b4[_0xfa9a('0x3')],_0x2be5b4[_0xfa9a('0x1c')],_0x2be5b4[_0xfa9a('0x1e')]));if(_['endsWith'](_0x2be5b4[_0xfa9a('0x1e')],'.wav49')){_0x2be5b4['value']=_0x2be5b4[_0xfa9a('0x1e')][_0xfa9a('0x1f')](_0xfa9a('0x20'),_0xfa9a('0x21'));}if(recordings[_0x2be5b4[_0xfa9a('0xf')]]){var _0x40f210=_[_0xfa9a('0x22')](recordings[_0x2be5b4['linkedid']][_0xfa9a('0x23')],{'value':_0x2be5b4[_0xfa9a('0x1e')]});if(_['isNil'](_0x40f210)){recordings[_0x2be5b4[_0xfa9a('0xf')]][_0xfa9a('0x23')][_0xfa9a('0x24')]({'value':_0x2be5b4[_0xfa9a('0x1e')]});}}}}catch(_0x4671db){utils['error'](util[_0xfa9a('0x1')](_0xfa9a('0x1d'),_0x2be5b4[_0xfa9a('0x3')]),_0x4671db);}};exports[_0xfa9a('0x25')]=function(_0x58dc6c){try{if(!_[_0xfa9a('0x15')](recordings[_0x58dc6c[_0xfa9a('0x3')]])){utils[_0xfa9a('0xd')](util['format'](_0xfa9a('0x26'),_0x58dc6c[_0xfa9a('0x3')]),_0x58dc6c);utils[_0xfa9a('0x10')](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x58dc6c[_0xfa9a('0x3')],_0x58dc6c['calleridnum'],_0x58dc6c[_0xfa9a('0x27')],_0x58dc6c[_0xfa9a('0x28')]));recordings[_0x58dc6c[_0xfa9a('0x3')]]['calleridnum']=_0x58dc6c[_0xfa9a('0x29')];recordings[_0x58dc6c['uniqueid']][_0xfa9a('0x27')]=_0x58dc6c[_0xfa9a('0x27')];recordings[_0x58dc6c[_0xfa9a('0x3')]][_0xfa9a('0x2a')]=_0x58dc6c['connectedlinenum'];recordings[_0x58dc6c[_0xfa9a('0x3')]][_0xfa9a('0x2b')]=_0x58dc6c[_0xfa9a('0x2b')];if(recordings[_0x58dc6c[_0xfa9a('0x3')]][_0xfa9a('0x2c')]==_0xfa9a('0x2d')&&recordings[_0x58dc6c['uniqueid']]['accountcode']){recordings[_0x58dc6c['uniqueid']][_0xfa9a('0x2a')]=recordings[_0x58dc6c['uniqueid']][_0xfa9a('0x4')];recordings[_0x58dc6c[_0xfa9a('0x3')]]['connectedlinename']='';}recordings[_0x58dc6c['uniqueid']][_0xfa9a('0x23')]['forEach'](function(_0x4582db){var _0xc24633=_[_0xfa9a('0x2e')](recordings[_0x58dc6c[_0xfa9a('0x3')]]);_0xc24633[_0xfa9a('0x1e')]=_0x4582db[_0xfa9a('0x1e')];writeDB(_0xc24633);});delete recordings[_0x58dc6c['uniqueid']];}}catch(_0x5783f5){utils[_0xfa9a('0x2f')](util[_0xfa9a('0x1')]('[%s][recordings][hangup]',_0x58dc6c['uniqueid']),_0x5783f5);}};exports[_0xfa9a('0x30')]=function(_0x529610){try{if(!_['isNil'](recordings[_0x529610[_0xfa9a('0x3')]])){utils[_0xfa9a('0xd')](util['format'](_0xfa9a('0x31'),_0x529610[_0xfa9a('0x3')]),_0x529610);utils['info'](util[_0xfa9a('0x1')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x529610[_0xfa9a('0x3')],_0x529610['application'],_0x529610[_0xfa9a('0x32')]));if(_0x529610[_0xfa9a('0x33')][_0xfa9a('0x34')]()==_0xfa9a('0x35')&&_[_0xfa9a('0x36')](_0x529610[_0xfa9a('0x32')][_0xfa9a('0x34')](),_0xfa9a('0x37'))){var _0x3df8fc=_0x529610[_0xfa9a('0x32')][_0xfa9a('0x38')]('=');var _0x3cb158=_0x3df8fc[0x0][_0xfa9a('0x39')](_0x3df8fc[0x0]['lastIndexOf']('(')+0x1,_0x3df8fc[0x0][_0xfa9a('0x3a')](')'));var _0x25a5b1=_0x3df8fc[0x1];recordings[_0x529610[_0xfa9a('0x3')]][_0x3cb158]=_0x25a5b1;}}}catch(_0x101ad8){utils['error'](util['format'](_0xfa9a('0x31'),_0x529610[_0xfa9a('0x3')]),_0x101ad8);}};exports['queuecallerjoin']=function(_0x44961c){try{if(!_[_0xfa9a('0x15')](recordings[_0x44961c[_0xfa9a('0x3')]])){utils[_0xfa9a('0xd')](util[_0xfa9a('0x1')]('[%s][recordings][queuecallerjoin]',_0x44961c[_0xfa9a('0x3')]),_0x44961c);utils[_0xfa9a('0x10')](util[_0xfa9a('0x1')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x44961c['uniqueid'],_0x44961c[_0xfa9a('0x3b')]));recordings[_0x44961c['uniqueid']][_0xfa9a('0x3b')]=_0x44961c['queue'];}}catch(_0x117c9e){utils[_0xfa9a('0x2f')](util[_0xfa9a('0x1')](_0xfa9a('0x3c'),_0x44961c[_0xfa9a('0x3')]),_0x117c9e);}}; \ No newline at end of file +var _0xe2f5=['lodash','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','accountcode','then','membername','CreateVoiceRecording','newchannel','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newchannel]','isNil','channelstate','transfer','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','value','replace','.wav49','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','debug','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinename','type','connectedlinenum','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','toLowerCase','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0xe2f5,0x11d));var _0x5e2f=function(_0xb2c544,_0x3713e9){_0xb2c544=_0xb2c544-0x0;var _0x5568d0=_0xe2f5[_0xb2c544];return _0x5568d0;};'use strict';var _=require(_0x5e2f('0x0'));var util=require('util');var utils=require('./utils');var recordings={};function writeDB(_0x4061ca){utils['info'](util[_0x5e2f('0x1')](_0x5e2f('0x2'),_0x4061ca[_0x5e2f('0x3')]));if(_0x4061ca['accountcode']){utils[_0x5e2f('0x4')](_0x4061ca[_0x5e2f('0x5')])[_0x5e2f('0x6')](function(_0x5e0044){if(_0x5e0044){_0x4061ca[_0x5e2f('0x7')]=_0x5e0044['name'];_0x4061ca['UserId']=_0x5e0044['id'];}utils['request'](_0x5e2f('0x8'),_0x4061ca);});}else{utils['request'](_0x5e2f('0x8'),_0x4061ca);}}exports[_0x5e2f('0x9')]=function(_0x681ba7){try{utils['debug'](util[_0x5e2f('0x1')]('[%s][recordings][newchannel]',_0x681ba7[_0x5e2f('0x3')]),_0x681ba7);if(_0x681ba7[_0x5e2f('0x3')]==_0x681ba7[_0x5e2f('0xa')]){utils[_0x5e2f('0xb')](util[_0x5e2f('0x1')](_0x5e2f('0xc'),_0x681ba7[_0x5e2f('0x3')],_0x681ba7[_0x5e2f('0xd')],_0x681ba7['exten']));recordings[_0x681ba7['uniqueid']]={'uniqueid':_0x681ba7[_0x5e2f('0x3')],'accountcode':_0x681ba7[_0x5e2f('0x5')],'exten':_0x681ba7[_0x5e2f('0xe')],'context':_0x681ba7[_0x5e2f('0xd')],'channel':_0x681ba7[_0x5e2f('0xf')],'monitors':[]};}}catch(_0x5e54c8){utils[_0x5e2f('0x10')](util[_0x5e2f('0x1')](_0x5e2f('0x11'),_0x681ba7[_0x5e2f('0x3')]),_0x5e54c8);}};exports['newstate']=function(_0x1eb26b){try{utils['debug'](util['format']('[%s][recordings][newstate]',_0x1eb26b['uniqueid']),_0x1eb26b);if(!_[_0x5e2f('0x12')](recordings[_0x1eb26b['uniqueid']])&&_0x1eb26b['channelstate']==0x6){utils[_0x5e2f('0xb')](util[_0x5e2f('0x1')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x1eb26b['uniqueid'],_0x1eb26b[_0x5e2f('0xd')],_0x1eb26b['channel']));}else if(!_['isNil'](recordings[_0x1eb26b[_0x5e2f('0xa')]])&&_0x1eb26b[_0x5e2f('0x13')]==0x6&&_0x1eb26b[_0x5e2f('0xd')]!=_0x5e2f('0x14')){utils[_0x5e2f('0xb')](util[_0x5e2f('0x1')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x1eb26b['uniqueid'],_0x1eb26b[_0x5e2f('0xa')],_0x1eb26b['context'],_0x1eb26b[_0x5e2f('0xf')]));recordings[_0x1eb26b[_0x5e2f('0xa')]]['accountcode']=_0x1eb26b[_0x5e2f('0x5')];}}catch(_0x16d566){utils[_0x5e2f('0x10')](util[_0x5e2f('0x1')](_0x5e2f('0x15'),_0x1eb26b[_0x5e2f('0x3')]),_0x16d566);}};exports[_0x5e2f('0x16')]=function(_0x591103){try{if(!_[_0x5e2f('0x12')](_0x591103[_0x5e2f('0x17')])&&!_[_0x5e2f('0x12')](_0x591103['variable'][_0x5e2f('0x18')])){utils['debug'](util[_0x5e2f('0x1')]('[%s][recordings][varset]',_0x591103[_0x5e2f('0x3')]),_0x591103);utils['info'](util[_0x5e2f('0x1')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x591103[_0x5e2f('0x3')],_0x591103[_0x5e2f('0x17')],_0x591103[_0x5e2f('0x19')]));if(_['endsWith'](_0x591103[_0x5e2f('0x19')],'.wav49')){_0x591103[_0x5e2f('0x19')]=_0x591103['value'][_0x5e2f('0x1a')](_0x5e2f('0x1b'),_0x5e2f('0x1c'));}if(recordings[_0x591103['linkedid']]){var _0x117390=_[_0x5e2f('0x1d')](recordings[_0x591103['linkedid']][_0x5e2f('0x1e')],{'value':_0x591103[_0x5e2f('0x19')]});if(_['isNil'](_0x117390)){recordings[_0x591103[_0x5e2f('0xa')]][_0x5e2f('0x1e')][_0x5e2f('0x1f')]({'value':_0x591103[_0x5e2f('0x19')]});}}}}catch(_0xcc5048){utils['error'](util['format'](_0x5e2f('0x20'),_0x591103[_0x5e2f('0x3')]),_0xcc5048);}};exports[_0x5e2f('0x21')]=function(_0x321d17){try{if(!_[_0x5e2f('0x12')](recordings[_0x321d17[_0x5e2f('0x3')]])){utils[_0x5e2f('0x22')](util[_0x5e2f('0x1')](_0x5e2f('0x23'),_0x321d17['uniqueid']),_0x321d17);utils[_0x5e2f('0xb')](util[_0x5e2f('0x1')](_0x5e2f('0x24'),_0x321d17[_0x5e2f('0x3')],_0x321d17[_0x5e2f('0x25')],_0x321d17[_0x5e2f('0x26')],_0x321d17['cause-txt']));recordings[_0x321d17['uniqueid']]['calleridnum']=_0x321d17[_0x5e2f('0x25')];recordings[_0x321d17[_0x5e2f('0x3')]][_0x5e2f('0x26')]=_0x321d17['calleridname'];recordings[_0x321d17[_0x5e2f('0x3')]]['connectedlinenum']=_0x321d17['connectedlinenum'];recordings[_0x321d17[_0x5e2f('0x3')]]['connectedlinename']=_0x321d17[_0x5e2f('0x27')];if(recordings[_0x321d17[_0x5e2f('0x3')]][_0x5e2f('0x28')]=='outbound'&&recordings[_0x321d17['uniqueid']][_0x5e2f('0x5')]){recordings[_0x321d17['uniqueid']][_0x5e2f('0x29')]=recordings[_0x321d17[_0x5e2f('0x3')]][_0x5e2f('0x5')];recordings[_0x321d17['uniqueid']]['connectedlinename']='';}recordings[_0x321d17[_0x5e2f('0x3')]]['monitors'][_0x5e2f('0x2a')](function(_0x3d3534){var _0x3fbd8f=_[_0x5e2f('0x2b')](recordings[_0x321d17[_0x5e2f('0x3')]]);_0x3fbd8f['value']=_0x3d3534[_0x5e2f('0x19')];writeDB(_0x3fbd8f);});delete recordings[_0x321d17[_0x5e2f('0x3')]];}}catch(_0x2c7b17){utils[_0x5e2f('0x10')](util[_0x5e2f('0x1')](_0x5e2f('0x23'),_0x321d17['uniqueid']),_0x2c7b17);}};exports['newexten']=function(_0x11b4f3){try{if(!_[_0x5e2f('0x12')](recordings[_0x11b4f3[_0x5e2f('0x3')]])){utils[_0x5e2f('0x22')](util[_0x5e2f('0x1')](_0x5e2f('0x2c'),_0x11b4f3['uniqueid']),_0x11b4f3);utils[_0x5e2f('0xb')](util['format'](_0x5e2f('0x2d'),_0x11b4f3[_0x5e2f('0x3')],_0x11b4f3[_0x5e2f('0x2e')],_0x11b4f3[_0x5e2f('0x2f')]));if(_0x11b4f3[_0x5e2f('0x2e')]['toLowerCase']()==_0x5e2f('0x30')&&_['startsWith'](_0x11b4f3[_0x5e2f('0x2f')][_0x5e2f('0x31')](),_0x5e2f('0x32'))){var _0x46432c=_0x11b4f3[_0x5e2f('0x2f')][_0x5e2f('0x33')]('=');var _0x2401af=_0x46432c[0x0][_0x5e2f('0x34')](_0x46432c[0x0]['lastIndexOf']('(')+0x1,_0x46432c[0x0][_0x5e2f('0x35')](')'));var _0x7de7e0=_0x46432c[0x1];recordings[_0x11b4f3['uniqueid']][_0x2401af]=_0x7de7e0;}}}catch(_0x2c6c1f){utils[_0x5e2f('0x10')](util[_0x5e2f('0x1')](_0x5e2f('0x2c'),_0x11b4f3[_0x5e2f('0x3')]),_0x2c6c1f);}};exports['queuecallerjoin']=function(_0x104496){try{if(!_[_0x5e2f('0x12')](recordings[_0x104496[_0x5e2f('0x3')]])){utils[_0x5e2f('0x22')](util[_0x5e2f('0x1')](_0x5e2f('0x36'),_0x104496[_0x5e2f('0x3')]),_0x104496);utils[_0x5e2f('0xb')](util[_0x5e2f('0x1')](_0x5e2f('0x37'),_0x104496[_0x5e2f('0x3')],_0x104496[_0x5e2f('0x38')]));recordings[_0x104496[_0x5e2f('0x3')]][_0x5e2f('0x38')]=_0x104496[_0x5e2f('0x38')];}}catch(_0x3ab692){utils['error'](util[_0x5e2f('0x1')](_0x5e2f('0x36'),_0x104496[_0x5e2f('0x3')]),_0x3ab692);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 54abe55..20e8cf5 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 _0x354b=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','format','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfertargetchannel'];(function(_0x1e29a9,_0x3b695a){var _0x48786a=function(_0x24e9ab){while(--_0x24e9ab){_0x1e29a9['push'](_0x1e29a9['shift']());}};_0x48786a(++_0x3b695a);}(_0x354b,0x19a));var _0xb354=function(_0x34c86f,_0x3a5a41){_0x34c86f=_0x34c86f-0x0;var _0x35e9a7=_0x354b[_0x34c86f];return _0x35e9a7;};'use strict';var _=require(_0xb354('0x0'));var util=require(_0xb354('0x1'));var utils=require(_0xb354('0x2'));function writeDB(_0x3d738e){utils[_0xb354('0x3')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x3d738e[_0xb354('0x4')]===_0xb354('0x5')?_0x3d738e[_0xb354('0x6')]:_0x3d738e[_0xb354('0x7')],_0x3d738e[_0xb354('0x4')]));utils[_0xb354('0x8')](_0xb354('0x9'),_0x3d738e);}exports[_0xb354('0xa')]=function(_0x8f6a93){try{utils[_0xb354('0xb')](util[_0xb354('0xc')]('[%s][transfers][blindtransfer]',_0x8f6a93[_0xb354('0x7')]),_0x8f6a93);utils[_0xb354('0x3')](util[_0xb354('0xc')](_0xb354('0xd'),_0x8f6a93['uniqueid'],_0x8f6a93[_0xb354('0xe')],_0x8f6a93[_0xb354('0xf')],_0x8f6a93[_0xb354('0x10')],_0x8f6a93[_0xb354('0x11')]));_0x8f6a93[_0xb354('0x4')]=_0xb354('0x12');writeDB(_0x8f6a93);}catch(_0x131abe){utils[_0xb354('0x13')](util[_0xb354('0xc')](_0xb354('0x14'),_0x8f6a93[_0xb354('0x7')]),_0x131abe);}};exports[_0xb354('0x15')]=function(_0x394519){try{utils[_0xb354('0xb')](util[_0xb354('0xc')](_0xb354('0x16'),_0x394519[_0xb354('0x6')]),_0x394519);utils[_0xb354('0x3')](util[_0xb354('0xc')](_0xb354('0x17'),_0x394519[_0xb354('0x6')],_0x394519[_0xb354('0x18')],_0x394519[_0xb354('0x19')],_0x394519[_0xb354('0x1a')],_0x394519[_0xb354('0x1b')]));_0x394519=_[_0xb354('0x1c')](_0x394519,{'transfererchannel':_0x394519[_0xb354('0x1d')],'transferercalleridnum':_0x394519[_0xb354('0x18')],'transferercalleridname':_0x394519[_0xb354('0x19')],'transfererconnectedlinenum':_0x394519[_0xb354('0x1e')],'transfererconnectedlinename':_0x394519[_0xb354('0x1f')],'transfereraccountcode':_0x394519[_0xb354('0x20')],'transferercontext':_0x394519[_0xb354('0x21')],'transfererexten':_0x394519[_0xb354('0x22')],'transfererlinkedid':_0x394519[_0xb354('0x23')],'context':_0x394519[_0xb354('0x24')],'extension':_0x394519[_0xb354('0x25')],'type':'attended'});if(_[_0xb354('0x26')](_0x394519['transfereechannel'])){_0x394519=_['assign'](_0x394519,{'transfereechannel':_0x394519[_0xb354('0x27')],'transfereecalleridnum':_0x394519['transfertargetcalleridnum'],'transfereecalleridname':_0x394519[_0xb354('0x1b')],'transfereeconnectedlinenum':_0x394519['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x394519[_0xb354('0x28')],'transfereeaccountcode':_0x394519[_0xb354('0x29')],'transfereecontext':_0x394519[_0xb354('0x2a')],'transfereeexten':_0x394519[_0xb354('0x2b')],'transfereelinkedid':_0x394519[_0xb354('0x2c')]});}writeDB(_0x394519);}catch(_0x206465){utils[_0xb354('0x13')](util['format']('[%s][transfers][attendedtransfer]',_0x394519[_0xb354('0x6')]),_0x206465);}}; \ No newline at end of file +var _0xcd54=['secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','info','format','transferercalleridnum','transferercalleridname','transfereecalleridname','type','blind','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','assign','origtransferercalleridnum'];(function(_0x20713e,_0x44f710){var _0x7d998b=function(_0x5d98ab){while(--_0x5d98ab){_0x20713e['push'](_0x20713e['shift']());}};_0x7d998b(++_0x44f710);}(_0xcd54,0xaf));var _0x4cd5=function(_0x2f7bfc,_0xa1d0ef){_0x2f7bfc=_0x2f7bfc-0x0;var _0x465f2e=_0xcd54[_0x2f7bfc];return _0x465f2e;};'use strict';var _=require(_0x4cd5('0x0'));var util=require(_0x4cd5('0x1'));var utils=require(_0x4cd5('0x2'));function writeDB(_0x5a4392){utils['info'](util['format'](_0x4cd5('0x3'),_0x5a4392['type']===_0x4cd5('0x4')?_0x5a4392[_0x4cd5('0x5')]:_0x5a4392[_0x4cd5('0x6')],_0x5a4392['type']));utils[_0x4cd5('0x7')](_0x4cd5('0x8'),_0x5a4392);}exports[_0x4cd5('0x9')]=function(_0x19eab5){try{utils[_0x4cd5('0xa')](util['format'](_0x4cd5('0xb'),_0x19eab5[_0x4cd5('0x6')]),_0x19eab5);utils[_0x4cd5('0xc')](util[_0x4cd5('0xd')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x19eab5[_0x4cd5('0x6')],_0x19eab5[_0x4cd5('0xe')],_0x19eab5[_0x4cd5('0xf')],_0x19eab5['transfereecalleridnum'],_0x19eab5[_0x4cd5('0x10')]));_0x19eab5[_0x4cd5('0x11')]=_0x4cd5('0x12');writeDB(_0x19eab5);}catch(_0x95d896){utils['error'](util[_0x4cd5('0xd')](_0x4cd5('0xb'),_0x19eab5[_0x4cd5('0x6')]),_0x95d896);}};exports['attendedtransfer']=function(_0x377e5a){try{utils[_0x4cd5('0xa')](util[_0x4cd5('0xd')](_0x4cd5('0x13'),_0x377e5a[_0x4cd5('0x5')]),_0x377e5a);utils[_0x4cd5('0xc')](util[_0x4cd5('0xd')](_0x4cd5('0x14'),_0x377e5a[_0x4cd5('0x5')],_0x377e5a['origtransferercalleridnum'],_0x377e5a[_0x4cd5('0x15')],_0x377e5a[_0x4cd5('0x16')],_0x377e5a['transfertargetcalleridname']));_0x377e5a=_[_0x4cd5('0x17')](_0x377e5a,{'transfererchannel':_0x377e5a['origtransfererchannel'],'transferercalleridnum':_0x377e5a[_0x4cd5('0x18')],'transferercalleridname':_0x377e5a[_0x4cd5('0x15')],'transfererconnectedlinenum':_0x377e5a[_0x4cd5('0x19')],'transfererconnectedlinename':_0x377e5a[_0x4cd5('0x1a')],'transfereraccountcode':_0x377e5a[_0x4cd5('0x1b')],'transferercontext':_0x377e5a[_0x4cd5('0x1c')],'transfererexten':_0x377e5a[_0x4cd5('0x1d')],'transfererlinkedid':_0x377e5a['origtransfererlinkedid'],'context':_0x377e5a[_0x4cd5('0x1e')],'extension':_0x377e5a[_0x4cd5('0x1f')],'type':_0x4cd5('0x4')});if(_['isNil'](_0x377e5a['transfereechannel'])){_0x377e5a=_[_0x4cd5('0x17')](_0x377e5a,{'transfereechannel':_0x377e5a[_0x4cd5('0x20')],'transfereecalleridnum':_0x377e5a[_0x4cd5('0x16')],'transfereecalleridname':_0x377e5a[_0x4cd5('0x21')],'transfereeconnectedlinenum':_0x377e5a[_0x4cd5('0x22')],'transfereeconnectedlinename':_0x377e5a[_0x4cd5('0x23')],'transfereeaccountcode':_0x377e5a['transfertargetaccountcode'],'transfereecontext':_0x377e5a[_0x4cd5('0x24')],'transfereeexten':_0x377e5a[_0x4cd5('0x25')],'transfereelinkedid':_0x377e5a[_0x4cd5('0x26')]});}writeDB(_0x377e5a);}catch(_0x37cc47){utils[_0x4cd5('0x27')](util[_0x4cd5('0xd')]('[%s][transfers][attendedtransfer]',_0x377e5a[_0x4cd5('0x5')]),_0x37cc47);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index c264020..2bbbabb 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 _0xa701=['isBefore','bluebird','jayson/promise','util','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','[utils][getUserByName]','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime','sumTime','now','isAfter'];(function(_0x1deff0,_0x2892c7){var _0x3e4029=function(_0x1536d5){while(--_0x1536d5){_0x1deff0['push'](_0x1deff0['shift']());}};_0x3e4029(++_0x2892c7);}(_0xa701,0x1cd));var _0x1a70=function(_0x22b112,_0x59ee43){_0x22b112=_0x22b112-0x0;var _0x3ee1b7=_0xa701[_0x22b112];return _0x3ee1b7;};'use strict';var BPromise=require(_0x1a70('0x0'));var jayson=require(_0x1a70('0x1'));var moment=require('moment');var util=require(_0x1a70('0x2'));var client=jayson['client'][_0x1a70('0x3')]({'port':0x2329});var logger=require(_0x1a70('0x4'))(_0x1a70('0x5'));exports['info']=function(_0x53c290,_0x2d02e0){logger[_0x1a70('0x6')](_0x53c290,_0x2d02e0?util[_0x1a70('0x7')](_0x2d02e0,{'showHidden':![],'depth':null}):'');};exports[_0x1a70('0x8')]=function(_0x435973,_0x2c17b9){logger[_0x1a70('0x8')](_0x435973,_0x2c17b9?util[_0x1a70('0x7')](_0x2c17b9,{'showHidden':![],'depth':null}):'');};exports[_0x1a70('0x9')]=function(_0xbc7c89,_0x4a3ae8){logger[_0x1a70('0x9')](_0xbc7c89,_0x4a3ae8?util[_0x1a70('0x7')](_0x4a3ae8,{'showHidden':![],'depth':null}):'');};exports[_0x1a70('0xa')]=function(_0x4d48d3,_0x6fcde7){return client[_0x1a70('0xa')](_0x4d48d3,{'body':_0x6fcde7})[_0x1a70('0xb')](function(_0x3fee71){logger[_0x1a70('0x8')](_0x1a70('0xc'),_0x4d48d3,_0x3fee71?util[_0x1a70('0x7')](_0x3fee71,{'showHidden':![],'depth':null}):'');})[_0x1a70('0xd')](function(_0x1b0a7e){logger['error'](_0x1a70('0xc'),_0x4d48d3,_0x1b0a7e?util[_0x1a70('0x7')](_0x1b0a7e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4da2cc){return client[_0x1a70('0xa')](_0x1a70('0xe'),{'options':{'raw':!![],'attributes':['id',_0x1a70('0xf'),_0x1a70('0x10'),_0x1a70('0x11')],'where':_0x4da2cc,'limit':0x1}})[_0x1a70('0xb')](function(_0x415382){logger[_0x1a70('0x8')](_0x1a70('0x12'),JSON[_0x1a70('0x13')](_0x4da2cc),_0x415382?util['inspect'](_0x415382,{'showHidden':![],'depth':null}):'');return _0x415382[_0x1a70('0x14')][_0x1a70('0x15')]?_0x415382['result'][0x0]:null;});}exports[_0x1a70('0x16')]=function(_0xbc2f24){return new BPromise(function(_0x35209b,_0x483b6f){if(_0xbc2f24){return getUser({'internal':_0xbc2f24})[_0x1a70('0xb')](function(_0x4991a4){logger[_0x1a70('0x6')](_0x1a70('0x17'),_0xbc2f24,_0x4991a4?_0x1a70('0x18'):'notfound');return _0x35209b(_0x4991a4);})[_0x1a70('0xd')](function(_0x21a5b0){logger['error'](_0x1a70('0x19'),_0x21a5b0?util['inspect'](_0x21a5b0,{'showHidden':![],'depth':null}):'');return _0x35209b(null);});}return _0x35209b(null);});};exports[_0x1a70('0x1a')]=function(_0x140fbc){return new BPromise(function(_0x2e9fc2,_0x2ff161){if(_0x140fbc){return getUser({'interface':_0x140fbc})[_0x1a70('0xb')](function(_0xcf6b24){logger[_0x1a70('0x6')](_0x1a70('0x1b'),_0x140fbc,_0xcf6b24?_0x1a70('0x18'):_0x1a70('0x1c'));return _0x2e9fc2(_0xcf6b24);})[_0x1a70('0xd')](function(_0x412fe7){logger['error'](_0x1a70('0x1d'),_0x412fe7?util[_0x1a70('0x7')](_0x412fe7,{'showHidden':![],'depth':null}):'');return _0x2e9fc2(null);});}return _0x2e9fc2(null);});};exports['getUserByName']=function(_0x4d120a){return new BPromise(function(_0x5adea3,_0x5844ad){if(_0x4d120a){return getUser({'name':_0x4d120a})['then'](function(_0x4da46f){logger[_0x1a70('0x6')]('[utils][getUserByName]\x20name:%s\x20%s',_0x4d120a,_0x4da46f?_0x1a70('0x18'):_0x1a70('0x1c'));return _0x5adea3(_0x4da46f);})[_0x1a70('0xd')](function(_0x3d8efd){logger[_0x1a70('0x9')](_0x1a70('0x1e'),_0x3d8efd?util[_0x1a70('0x7')](_0x3d8efd,{'showHidden':![],'depth':null}):'');return _0x5adea3(null);});}return _0x5adea3(null);});};exports['getVoiceQueueByName']=function(_0x3d010a){return new BPromise(function(_0x311610,_0x149aa9){if(_0x3d010a){return client[_0x1a70('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x1a70('0x10'),_0x1a70('0x1f'),_0x1a70('0x20'),_0x1a70('0x21')],'where':{'name':_0x3d010a},'limit':0x1}})['then'](function(_0xb44232){logger[_0x1a70('0x8')](_0x1a70('0x22'),_0x3d010a,_0xb44232?util['inspect'](_0xb44232,{'showHidden':![],'depth':null}):'');logger[_0x1a70('0x6')](_0x1a70('0x23'),_0x3d010a,_0xb44232?_0x1a70('0x18'):_0x1a70('0x1c'));return _0x311610(_0xb44232[_0x1a70('0x14')][_0x1a70('0x15')]?_0xb44232[_0x1a70('0x14')][0x0]:null);})[_0x1a70('0xd')](function(_0x2de164){logger['error']('[utils][getVoiceQueueByName]',_0x2de164?util[_0x1a70('0x7')](_0x2de164,{'showHidden':![],'depth':null}):'');return _0x311610(null);});}return _0x311610(null);});};exports['addTime']=function(_0x464f96,_0x12b1c7){return moment(_0x464f96)[_0x1a70('0x24')](_0x12b1c7,_0x1a70('0x25'))[_0x1a70('0x26')](_0x1a70('0x27'));};exports[_0x1a70('0x28')]=function(_0x305ce9,_0x379df8){return moment(_0x305ce9)['subtract'](_0x379df8,_0x1a70('0x25'))['format'](_0x1a70('0x27'));};exports[_0x1a70('0x29')]=function(_0x24e203,_0x47e059){return moment(_0x24e203)['diff'](moment(_0x47e059),_0x1a70('0x25'));};exports[_0x1a70('0x2a')]=function(_0x298164,_0x1ab94f){return parseInt(_0x298164,0xa)+parseInt(_0x1ab94f,0xa);};exports[_0x1a70('0x2b')]=function(){return moment()[_0x1a70('0x26')](_0x1a70('0x27'));};exports[_0x1a70('0x2c')]=function(_0x2a7e12,_0x5f548){if(_0x5f548){return moment(_0x2a7e12)[_0x1a70('0x2c')](_0x5f548);}return!![];};exports[_0x1a70('0x2d')]=function(_0xd2fc9,_0xe1ecd7){if(_0xe1ecd7){return moment(_0xd2fc9)[_0x1a70('0x2d')](_0xe1ecd7);}else if(_0xd2fc9){return!![];}return![];}; \ No newline at end of file +var _0x5aa5=['getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','sumTime','now','isAfter','isBefore','bluebird','moment','client','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','length','result','getUserByInternal','found','notfound','[utils][getUserByInternal]'];(function(_0x546496,_0x51544c){var _0x3afe5a=function(_0x190030){while(--_0x190030){_0x546496['push'](_0x546496['shift']());}};_0x3afe5a(++_0x51544c);}(_0x5aa5,0x185));var _0x55aa=function(_0x19c56b,_0x3c9331){_0x19c56b=_0x19c56b-0x0;var _0x325643=_0x5aa5[_0x19c56b];return _0x325643;};'use strict';var BPromise=require(_0x55aa('0x0'));var jayson=require('jayson/promise');var moment=require(_0x55aa('0x1'));var util=require('util');var client=jayson[_0x55aa('0x2')][_0x55aa('0x3')]({'port':0x2329});var logger=require('../../config/logger')(_0x55aa('0x4'));exports['info']=function(_0x171870,_0x409f01){logger[_0x55aa('0x5')](_0x171870,_0x409f01?util[_0x55aa('0x6')](_0x409f01,{'showHidden':![],'depth':null}):'');};exports[_0x55aa('0x7')]=function(_0x87fda8,_0x43f9ec){logger['debug'](_0x87fda8,_0x43f9ec?util[_0x55aa('0x6')](_0x43f9ec,{'showHidden':![],'depth':null}):'');};exports[_0x55aa('0x8')]=function(_0x3e3399,_0x474155){logger[_0x55aa('0x8')](_0x3e3399,_0x474155?util['inspect'](_0x474155,{'showHidden':![],'depth':null}):'');};exports[_0x55aa('0x9')]=function(_0x4535ab,_0x5143a3){return client[_0x55aa('0x9')](_0x4535ab,{'body':_0x5143a3})[_0x55aa('0xa')](function(_0xdfe468){logger[_0x55aa('0x7')](_0x55aa('0xb'),_0x4535ab,_0xdfe468?util[_0x55aa('0x6')](_0xdfe468,{'showHidden':![],'depth':null}):'');})[_0x55aa('0xc')](function(_0x4ef973){logger[_0x55aa('0x8')](_0x55aa('0xb'),_0x4535ab,_0x4ef973?util['inspect'](_0x4ef973,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3dce6a){return client['request'](_0x55aa('0xd'),{'options':{'raw':!![],'attributes':['id',_0x55aa('0xe'),_0x55aa('0xf'),_0x55aa('0x10')],'where':_0x3dce6a,'limit':0x1}})[_0x55aa('0xa')](function(_0x2ba4a8){logger[_0x55aa('0x7')](_0x55aa('0x11'),JSON[_0x55aa('0x12')](_0x3dce6a),_0x2ba4a8?util[_0x55aa('0x6')](_0x2ba4a8,{'showHidden':![],'depth':null}):'');return _0x2ba4a8['result'][_0x55aa('0x13')]?_0x2ba4a8[_0x55aa('0x14')][0x0]:null;});}exports[_0x55aa('0x15')]=function(_0x510462){return new BPromise(function(_0x98aa31,_0x28145e){if(_0x510462){return getUser({'internal':_0x510462})[_0x55aa('0xa')](function(_0x45cfbf){logger[_0x55aa('0x5')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x510462,_0x45cfbf?_0x55aa('0x16'):_0x55aa('0x17'));return _0x98aa31(_0x45cfbf);})['catch'](function(_0x188348){logger['error'](_0x55aa('0x18'),_0x188348?util['inspect'](_0x188348,{'showHidden':![],'depth':null}):'');return _0x98aa31(null);});}return _0x98aa31(null);});};exports[_0x55aa('0x19')]=function(_0x5c4063){return new BPromise(function(_0x165024,_0x2077a1){if(_0x5c4063){return getUser({'interface':_0x5c4063})[_0x55aa('0xa')](function(_0xf6d01d){logger[_0x55aa('0x5')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x5c4063,_0xf6d01d?_0x55aa('0x16'):_0x55aa('0x17'));return _0x165024(_0xf6d01d);})[_0x55aa('0xc')](function(_0x2c9424){logger[_0x55aa('0x8')](_0x55aa('0x1a'),_0x2c9424?util['inspect'](_0x2c9424,{'showHidden':![],'depth':null}):'');return _0x165024(null);});}return _0x165024(null);});};exports[_0x55aa('0x1b')]=function(_0x1321b3){return new BPromise(function(_0x5c04c,_0x345f9c){if(_0x1321b3){return getUser({'name':_0x1321b3})[_0x55aa('0xa')](function(_0x44dbb5){logger[_0x55aa('0x5')]('[utils][getUserByName]\x20name:%s\x20%s',_0x1321b3,_0x44dbb5?'found':_0x55aa('0x17'));return _0x5c04c(_0x44dbb5);})[_0x55aa('0xc')](function(_0x51b64e){logger['error'](_0x55aa('0x1c'),_0x51b64e?util[_0x55aa('0x6')](_0x51b64e,{'showHidden':![],'depth':null}):'');return _0x5c04c(null);});}return _0x5c04c(null);});};exports['getVoiceQueueByName']=function(_0x555f21){return new BPromise(function(_0x585b57,_0x4ef897){if(_0x555f21){return client[_0x55aa('0x9')](_0x55aa('0x1d'),{'options':{'raw':!![],'attributes':['id',_0x55aa('0xf'),_0x55aa('0x1e'),_0x55aa('0x1f'),'acwTimeout'],'where':{'name':_0x555f21},'limit':0x1}})[_0x55aa('0xa')](function(_0x4117fe){logger[_0x55aa('0x7')](_0x55aa('0x20'),_0x555f21,_0x4117fe?util[_0x55aa('0x6')](_0x4117fe,{'showHidden':![],'depth':null}):'');logger['info'](_0x55aa('0x21'),_0x555f21,_0x4117fe?_0x55aa('0x16'):_0x55aa('0x17'));return _0x585b57(_0x4117fe[_0x55aa('0x14')]['length']?_0x4117fe[_0x55aa('0x14')][0x0]:null);})['catch'](function(_0x5393d4){logger[_0x55aa('0x8')](_0x55aa('0x22'),_0x5393d4?util[_0x55aa('0x6')](_0x5393d4,{'showHidden':![],'depth':null}):'');return _0x585b57(null);});}return _0x585b57(null);});};exports[_0x55aa('0x23')]=function(_0xde97bb,_0x1581d8){return moment(_0xde97bb)[_0x55aa('0x24')](_0x1581d8,_0x55aa('0x25'))[_0x55aa('0x26')](_0x55aa('0x27'));};exports[_0x55aa('0x28')]=function(_0x1f97fc,_0x57c547){return moment(_0x1f97fc)[_0x55aa('0x29')](_0x57c547,_0x55aa('0x25'))[_0x55aa('0x26')](_0x55aa('0x27'));};exports['diffTime']=function(_0xa645f6,_0x288179){return moment(_0xa645f6)['diff'](moment(_0x288179),_0x55aa('0x25'));};exports[_0x55aa('0x2a')]=function(_0x17e71c,_0x208b14){return parseInt(_0x17e71c,0xa)+parseInt(_0x208b14,0xa);};exports[_0x55aa('0x2b')]=function(){return moment()[_0x55aa('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x55aa('0x2c')]=function(_0x2c8687,_0x212903){if(_0x212903){return moment(_0x2c8687)[_0x55aa('0x2c')](_0x212903);}return!![];};exports[_0x55aa('0x2d')]=function(_0x192b0c,_0x2b87c4){if(_0x2b87c4){return moment(_0x192b0c)['isBefore'](_0x2b87c4);}else if(_0x192b0c){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 b45a651..8d604df 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 _0x623a=['catch','user','no-user','data','timestamp','error','api','set','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','headers','connection','remoteAddress','url','statusCode','responseTime','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','method','x-forwarded-for','device','other','agent_name','test','setupLoggers','fs-extra','path','util','./loggers','fileLogger','safeTemplate','./mask-sensitive-data','join','/var','xcally','client','role','name','ensureDir','then'];(function(_0x4a3c7f,_0x377b5e){var _0x498876=function(_0x5ac035){while(--_0x5ac035){_0x4a3c7f['push'](_0x4a3c7f['shift']());}};_0x498876(++_0x377b5e);}(_0x623a,0x198));var _0xa623=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x623a[_0x543084];return _0x306a57;};var fs=require(_0xa623('0x0'));var _=require('lodash');var ewinston=require('express-winston');var path=require(_0xa623('0x1'));var util=require(_0xa623('0x2'));var fileLogger=require(_0xa623('0x3'))[_0xa623('0x4')];var safeTemplate=require('./safe-template')[_0xa623('0x5')];var maskSensitiveData=require(_0xa623('0x6'))['maskSensitiveData'];function ClientSideLogger(){function _0x3a3f02(_0x15ada7){var _0x5d0bed=path[_0xa623('0x7')](_0xa623('0x8'),'log',_0xa623('0x9'));var _0x290df5=path[_0xa623('0x7')](_0xa623('0xa'),_0x15ada7[_0xa623('0xb')]+'-'+_0x15ada7[_0xa623('0xc')]);return fs[_0xa623('0xd')](path[_0xa623('0x7')](_0x5d0bed,_0x290df5))[_0xa623('0xe')](function(){var _0x47100f=fileLogger(_0xa623('0xa'),path['join'](_0x5d0bed,_0x290df5));return _0x47100f;})[_0xa623('0xf')](function(_0x57b93b){throw _0x57b93b;});}this['log']=function(_0x55b095,_0x4cbb77,_0x3bcf87,_0x54d9e6){return _0x3a3f02(_0x55b095[_0xa623('0x10')])[_0xa623('0xe')](function(_0xef04fd){var _0x46c00d=_0xef04fd[_0x4cbb77];return _0x46c00d;})[_0xa623('0xe')](function(_0x3c5e33){var _0x5ec775=_0x55b095[_0xa623('0x10')]?_0x55b095[_0xa623('0x10')]['id']:_0xa623('0x11');var _0x267ead=_0x54d9e6[_0xa623('0x12')];var _0x375f7f=_0x54d9e6[_0xa623('0x13')];var _0x1e9e0e=new Date(Number(_0x375f7f));return _0x3c5e33(_0x5ec775,_0x1e9e0e,_0x3bcf87,_0x267ead);})[_0xa623('0xf')](function(_0xe955a3){fileLogger(_0xa623('0xa'))[_0xa623('0x14')](_0xe955a3);});};}function setupLoggers(_0x4aa02b){return new Promise(function(_0x31423a){var _0x454138=new ClientSideLogger();var _0x1dc3ba=fileLogger(_0xa623('0x15'));var _0x2516e4=fileLogger('auth');_0x4aa02b[_0xa623('0x16')](_0xa623('0x17'),_0x454138);_0x4aa02b['use'](ewinston[_0xa623('0x18')]({'winstonInstance':_0x1dc3ba,'meta':![],'statusLevels':!![],'msg':function(_0xd57d56,_0x1d3821){var _0xfb6ae2=_0xa623('0x19');if(!_[_0xa623('0x1a')](_0xd57d56[_0xa623('0x1b')])){_0xfb6ae2+=_0xa623('0x1c');var _0x2d34d4=_0xd57d56[_0xa623('0x1b')];maskSensitiveData(_0x2d34d4);}return safeTemplate(util[_0xa623('0x1d')](_0xfb6ae2,_0xd57d56['method'],_0xd57d56[_0xa623('0x1e')]['x-forwarded-for']?_0xd57d56[_0xa623('0x1e')]['x-forwarded-for']:_0xd57d56[_0xa623('0x1f')][_0xa623('0x20')]||_0xd57d56['ip'],_0xd57d56[_0xa623('0x21')],_0x1d3821[_0xa623('0x22')],_0x1d3821[_0xa623('0x23')],_0xd57d56[_0xa623('0x10')]?_0xd57d56[_0xa623('0x10')]['id']:null,_0xd57d56[_0xa623('0x10')]?_0xd57d56[_0xa623('0x10')][_0xa623('0xc')]:null,_0xd57d56['user']?_0xd57d56[_0xa623('0x10')][_0xa623('0xb')]:null,_0x2d34d4?util[_0xa623('0x24')](_0x2d34d4,![],null):''));}}));_0x4aa02b[_0xa623('0x25')](ewinston[_0xa623('0x18')]({'winstonInstance':_0x2516e4,'meta':![],'statusLevels':!![],'msg':function(_0x12a3d8,_0x48f5a4){var _0x3edfcf=_0xa623('0x26');if(_0x12a3d8['body']&&_0x12a3d8[_0xa623('0x1b')]['device']&&_0x12a3d8['body'][_0xa623('0x27')]){_0x3edfcf='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xa623('0x1d')](_0x3edfcf,_0x12a3d8[_0xa623('0x28')],_0x12a3d8[_0xa623('0x1e')][_0xa623('0x29')]?_0x12a3d8[_0xa623('0x1e')]['x-forwarded-for']:_0x12a3d8[_0xa623('0x1f')][_0xa623('0x20')]||_0x12a3d8['ip'],_0x12a3d8['url'],_0x48f5a4[_0xa623('0x22')],_0x48f5a4['responseTime'],_0x12a3d8[_0xa623('0x10')]?_0x12a3d8['user']['id']:null,_0x12a3d8[_0xa623('0x10')]?_0x12a3d8[_0xa623('0x10')][_0xa623('0xc')]:null,_0x12a3d8[_0xa623('0x10')]?_0x12a3d8['user'][_0xa623('0xb')]:null,_0x12a3d8[_0xa623('0x1b')]&&_0x12a3d8[_0xa623('0x1b')][_0xa623('0x2a')]?_0x12a3d8[_0xa623('0x1b')][_0xa623('0x2a')]:_0xa623('0x2b'),_0x12a3d8[_0xa623('0x1b')]&&_0x12a3d8['body'][_0xa623('0x27')]?_0x12a3d8['body'][_0xa623('0x27')]:'',_0x12a3d8['body']&&_0x12a3d8['body'][_0xa623('0x2c')]?_0x12a3d8[_0xa623('0x1b')][_0xa623('0x2c')]:'');},'ignoreRoute':function(_0x58be50){var _0x10c238=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x10c238[_0xa623('0x2d')](_0x58be50['url']);}}));return _0x31423a();});}exports[_0xa623('0x2e')]=setupLoggers; \ No newline at end of file +var _0xea06=['body','\x20body=%s','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','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','other','agent_name','test','setupLoggers','express-winston','./loggers','fileLogger','./safe-template','maskSensitiveData','join','/var','log','client','role','name','ensureDir','then','catch','user','no-user','timestamp','error','api','set','client-side-logger','use','logger','isEmpty'];(function(_0x505bad,_0x4f6823){var _0x29ed15=function(_0xb1f317){while(--_0xb1f317){_0x505bad['push'](_0x505bad['shift']());}};_0x29ed15(++_0x4f6823);}(_0xea06,0xc4));var _0x6ea0=function(_0x4fae4e,_0x228213){_0x4fae4e=_0x4fae4e-0x0;var _0x2ef808=_0xea06[_0x4fae4e];return _0x2ef808;};var fs=require('fs-extra');var _=require('lodash');var ewinston=require(_0x6ea0('0x0'));var path=require('path');var util=require('util');var fileLogger=require(_0x6ea0('0x1'))[_0x6ea0('0x2')];var safeTemplate=require(_0x6ea0('0x3'))['safeTemplate'];var maskSensitiveData=require('./mask-sensitive-data')[_0x6ea0('0x4')];function ClientSideLogger(){function _0x236081(_0x35a9f6){var _0xa9e09e=path[_0x6ea0('0x5')](_0x6ea0('0x6'),_0x6ea0('0x7'),'xcally');var _0x38643e=path[_0x6ea0('0x5')](_0x6ea0('0x8'),_0x35a9f6[_0x6ea0('0x9')]+'-'+_0x35a9f6[_0x6ea0('0xa')]);return fs[_0x6ea0('0xb')](path[_0x6ea0('0x5')](_0xa9e09e,_0x38643e))[_0x6ea0('0xc')](function(){var _0x3b6381=fileLogger(_0x6ea0('0x8'),path['join'](_0xa9e09e,_0x38643e));return _0x3b6381;})[_0x6ea0('0xd')](function(_0x3d3ab2){throw _0x3d3ab2;});}this[_0x6ea0('0x7')]=function(_0x79d186,_0x44cff6,_0x11859f,_0x371bc6){return _0x236081(_0x79d186['user'])['then'](function(_0x22a31f){var _0x7b3316=_0x22a31f[_0x44cff6];return _0x7b3316;})[_0x6ea0('0xc')](function(_0x373e77){var _0x14ad56=_0x79d186[_0x6ea0('0xe')]?_0x79d186[_0x6ea0('0xe')]['id']:_0x6ea0('0xf');var _0x11054d=_0x371bc6['data'];var _0x214104=_0x371bc6[_0x6ea0('0x10')];var _0x506174=new Date(Number(_0x214104));return _0x373e77(_0x14ad56,_0x506174,_0x11859f,_0x11054d);})[_0x6ea0('0xd')](function(_0x22675f){fileLogger(_0x6ea0('0x8'))[_0x6ea0('0x11')](_0x22675f);});};}function setupLoggers(_0x5b5c27){return new Promise(function(_0x5a9e07){var _0x2bbb4a=new ClientSideLogger();var _0x5e0915=fileLogger(_0x6ea0('0x12'));var _0x2352b5=fileLogger('auth');_0x5b5c27[_0x6ea0('0x13')](_0x6ea0('0x14'),_0x2bbb4a);_0x5b5c27[_0x6ea0('0x15')](ewinston[_0x6ea0('0x16')]({'winstonInstance':_0x5e0915,'meta':![],'statusLevels':!![],'msg':function(_0x38382c,_0x4c69b2){var _0x431b56='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x6ea0('0x17')](_0x38382c[_0x6ea0('0x18')])){_0x431b56+=_0x6ea0('0x19');var _0xa81db0=_0x38382c[_0x6ea0('0x18')];maskSensitiveData(_0xa81db0);}return safeTemplate(util[_0x6ea0('0x1a')](_0x431b56,_0x38382c[_0x6ea0('0x1b')],_0x38382c[_0x6ea0('0x1c')][_0x6ea0('0x1d')]?_0x38382c[_0x6ea0('0x1c')]['x-forwarded-for']:_0x38382c[_0x6ea0('0x1e')][_0x6ea0('0x1f')]||_0x38382c['ip'],_0x38382c[_0x6ea0('0x20')],_0x4c69b2[_0x6ea0('0x21')],_0x4c69b2[_0x6ea0('0x22')],_0x38382c[_0x6ea0('0xe')]?_0x38382c[_0x6ea0('0xe')]['id']:null,_0x38382c['user']?_0x38382c[_0x6ea0('0xe')][_0x6ea0('0xa')]:null,_0x38382c[_0x6ea0('0xe')]?_0x38382c['user'][_0x6ea0('0x9')]:null,_0xa81db0?util[_0x6ea0('0x23')](_0xa81db0,![],null):''));}}));_0x5b5c27[_0x6ea0('0x15')](ewinston[_0x6ea0('0x16')]({'winstonInstance':_0x2352b5,'meta':![],'statusLevels':!![],'msg':function(_0x59838b,_0x46cb6a){var _0x506c7f=_0x6ea0('0x24');if(_0x59838b['body']&&_0x59838b[_0x6ea0('0x18')]['device']&&_0x59838b[_0x6ea0('0x18')][_0x6ea0('0x25')]){_0x506c7f=_0x6ea0('0x26');}return util[_0x6ea0('0x1a')](_0x506c7f,_0x59838b[_0x6ea0('0x1b')],_0x59838b['headers'][_0x6ea0('0x1d')]?_0x59838b[_0x6ea0('0x1c')][_0x6ea0('0x1d')]:_0x59838b['connection']['remoteAddress']||_0x59838b['ip'],_0x59838b[_0x6ea0('0x20')],_0x46cb6a[_0x6ea0('0x21')],_0x46cb6a[_0x6ea0('0x22')],_0x59838b['user']?_0x59838b[_0x6ea0('0xe')]['id']:null,_0x59838b[_0x6ea0('0xe')]?_0x59838b[_0x6ea0('0xe')][_0x6ea0('0xa')]:null,_0x59838b[_0x6ea0('0xe')]?_0x59838b[_0x6ea0('0xe')][_0x6ea0('0x9')]:null,_0x59838b['body']&&_0x59838b[_0x6ea0('0x18')][_0x6ea0('0x27')]?_0x59838b[_0x6ea0('0x18')][_0x6ea0('0x27')]:_0x6ea0('0x28'),_0x59838b[_0x6ea0('0x18')]&&_0x59838b[_0x6ea0('0x18')][_0x6ea0('0x25')]?_0x59838b[_0x6ea0('0x18')][_0x6ea0('0x25')]:'',_0x59838b['body']&&_0x59838b[_0x6ea0('0x18')]['agent_name']?_0x59838b[_0x6ea0('0x18')][_0x6ea0('0x29')]:'');},'ignoreRoute':function(_0x2eb83b){var _0x22a78d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x22a78d[_0x6ea0('0x2a')](_0x2eb83b['url']);}}));return _0x5a9e07();});}exports[_0x6ea0('0x2b')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 4041564..37d2ac2 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1d3=['minutes','isBefore','day','endOf','isBetween','format','ddd','dowCompare','min','MMM','includes','test','isMoment','padStart','length','iftime','lodash','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','map','toLowerCase','slice','concat','circularDoWInterval','indexOf','exports','clone','hours'];(function(_0x15296b,_0x1607e8){var _0x1173b5=function(_0x367699){while(--_0x367699){_0x15296b['push'](_0x15296b['shift']());}};_0x1173b5(++_0x1607e8);}(_0xc1d3,0x1ec));var _0x3c1d=function(_0x32e186,_0xd9810d){_0x32e186=_0x32e186-0x0;var _0xa7a310=_0xc1d3[_0x32e186];return _0xa7a310;};var _=require(_0x3c1d('0x0'));var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x947528){return _0x947528[_0x3c1d('0x1')];})[_0x3c1d('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x3c1d('0x3');var EINVALID_DATE=_0x3c1d('0x4');function throwIfDateNotValid(_0x5bbb96){if(!_0x5bbb96[_0x3c1d('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x28c61b){var _0x340825=_0x28c61b[_0x3c1d('0x6')](':')['map'](function(_0x235c03){return parseInt(_0x235c03,0xa);});var _0x1ea0b0=_0x340825[0x0];var _0x39168d=_0x340825[0x1];if(_0x1ea0b0<0x0||_0x1ea0b0>0x17||_0x39168d<0x0||_0x39168d>0x3b){throw new Error(EINVALID_DATE);}return[_0x1ea0b0,_0x39168d];}function circularDoWInterval(_0x10d61b,_0x1d3d8c){if(_0x10d61b===_0x1d3d8c){return[_0x10d61b];}else{var _0x3a0560=moment[_0x3c1d('0x7')]();moment['locale']('en');var _0xb276a9=moment[_0x3c1d('0x8')]()[_0x3c1d('0x9')](function(_0x3ae558){return _0x3ae558[_0x3c1d('0xa')]();});moment[_0x3c1d('0x7')](_0x3a0560);var _0x29663a=_0xb276a9['indexOf'](_0x10d61b);var _0x2a40e0=_0xb276a9['indexOf'](_0x1d3d8c);if(_0x2a40e0>_0x29663a){return _0xb276a9[_0x3c1d('0xb')](_0x29663a,_0x2a40e0+0x1);}else{var _0x487eb1=_0xb276a9[_0x3c1d('0xb')](0x0,_0x2a40e0+0x1);var _0x14c4b5=_0xb276a9[_0x3c1d('0xb')](_0x29663a);return _0x14c4b5[_0x3c1d('0xc')](_0x487eb1);}}}module['exports'][_0x3c1d('0xd')]=circularDoWInterval;function circularMonthInterval(_0x320bdd,_0x4a9f7f){if(_0x320bdd===_0x4a9f7f){return[_0x320bdd];}else{var _0x521b1a=moment[_0x3c1d('0x7')]();moment[_0x3c1d('0x7')]('en');var _0x321523=moment['monthsShort']()[_0x3c1d('0x9')](function(_0x2ae4a2){return _0x2ae4a2[_0x3c1d('0xa')]();});moment[_0x3c1d('0x7')](_0x521b1a);var _0x264dff=_0x321523[_0x3c1d('0xe')](_0x320bdd);var _0x935e73=_0x321523['indexOf'](_0x4a9f7f);if(_0x935e73>_0x264dff){return _0x321523['slice'](_0x264dff,_0x935e73+0x1);}else{var _0x5f0db9=_0x321523[_0x3c1d('0xb')](0x0,_0x935e73+0x1);var _0x3c90bc=_0x321523[_0x3c1d('0xb')](_0x264dff);return _0x3c90bc[_0x3c1d('0xc')](_0x5f0db9);}}}module[_0x3c1d('0xf')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x30a248){var _0x330699=parseInt(_0x30a248,0xa);if(_0x330699<0x1||_0x330699>0x1f){throw new Error(EINVALID_DATE);}return _0x330699;}function timeCompare(_0x446e98,_0x1eb872,_0x2807ec){var _0x3c704e=_0x446e98[_0x3c1d('0x10')]();var _0x478878=extractTime(_0x1eb872);var _0x2e34cc=_0x478878[0x0];var _0x217a82=_0x478878[0x1];var _0x463e18=_0x446e98[_0x3c1d('0x10')]()[_0x3c1d('0x11')](_0x2e34cc)[_0x3c1d('0x12')](_0x217a82);throwIfDateNotValid(_0x463e18);var _0x235239=extractTime(_0x2807ec);var _0x75ca4a=_0x235239[0x0];var _0x59c746=_0x235239[0x1];var _0x4f0f8a=_0x446e98['clone']()[_0x3c1d('0x11')](_0x75ca4a)[_0x3c1d('0x12')](_0x59c746);throwIfDateNotValid(_0x4f0f8a);if(_0x4f0f8a[_0x3c1d('0x13')](_0x463e18)){var _0x300e97=_0x3c704e[_0x3c1d('0x10')]()['startOf'](_0x3c1d('0x14'));var _0x4f8645=_0x3c704e[_0x3c1d('0x10')]()[_0x3c1d('0x15')](_0x3c1d('0x14'));return _0x3c704e['isBetween'](_0x463e18,_0x4f8645,undefined,'[]')||_0x3c704e[_0x3c1d('0x16')](_0x300e97,_0x4f0f8a,undefined,'[]');}else{return _0x3c704e['isBetween'](_0x463e18,_0x4f0f8a,undefined,'[]');}}module[_0x3c1d('0xf')]['timeCompare']=timeCompare;function dowCompare(_0x4e3740,_0x450808,_0x4b101d){var _0x50aa33=_0x4e3740['locale']('en')[_0x3c1d('0x17')](_0x3c1d('0x18'))['toLowerCase']();return circularDoWInterval(_0x450808,_0x4b101d)['includes'](_0x50aa33);}module[_0x3c1d('0xf')][_0x3c1d('0x19')]=dowCompare;function domCompare(_0xbb75ff,_0x4bd65f,_0x482a12){var _0x125073=_0xbb75ff['date']();if(_0x4bd65f===_0x482a12){return _0x125073===_0x4bd65f;}else{var _0xc61389=_0xbb75ff['daysInMonth']();var _0x53ab4a=_0x4bd65f<_0x482a12;let _0x50c9a8=![];var _0x2fe21c=0x0;var _0x42e199=0x0;if(_0x53ab4a){_0x2fe21c=Math['max'](0x1,_0x4bd65f);_0x42e199=Math[_0x3c1d('0x1a')](_0x482a12,_0xc61389);_0x50c9a8=_0x125073>=_0x2fe21c&&_0x125073<=_0x42e199;}else{_0x2fe21c=Math[_0x3c1d('0x1a')](_0x4bd65f,_0xc61389);_0x42e199=Math['max'](0x1,_0x482a12);_0x50c9a8=_0x125073>=_0x2fe21c||_0x125073<=_0x42e199;}return _0x50c9a8;}}module['exports']['domCompare']=domCompare;function monthCompare(_0x220fcc,_0xf13480,_0x36859a){var _0x3fb667=_0x220fcc['locale']('en')[_0x3c1d('0x17')](_0x3c1d('0x1b'))[_0x3c1d('0xa')]();return circularMonthInterval(_0xf13480,_0x36859a)[_0x3c1d('0x1c')](_0x3fb667);}module[_0x3c1d('0xf')]['monthCompare']=monthCompare;function iftime(_0x1dd322,_0x24252c=moment['tz']['guess'](),_0x297add=moment()){if(!validateRx[_0x3c1d('0x1d')](_0x1dd322)){throw new Error(EINVALID_STRING);}else{var _0x5b4221=(moment[_0x3c1d('0x1e')](_0x297add)?_0x297add['clone']():moment(_0x297add))['tz'](_0x24252c)[_0x3c1d('0x7')]('en');throwIfDateNotValid(_0x5b4221);var _0x506833=_0x1dd322['split'](',');var _0x2962f0=_0x506833[0x0];var _0x5836ac=_0x506833[0x1];var _0x15f853=_0x506833[0x2];var _0x71cfea=_0x506833[0x3];let _0x1931b3=!![];if(_0x2962f0!=='*'){var _0x52759b=_0x2962f0[_0x3c1d('0x6')]('-');var _0xbb5466=_[_0x3c1d('0x1f')](_0x52759b[0x0],0x5,'0');var _0x2a3652=_0x52759b[_0x3c1d('0x20')]===0x2?_[_0x3c1d('0x1f')](_0x52759b[0x1],0x5,'0'):_0xbb5466;_0x1931b3=timeCompare(_0x5b4221,_0xbb5466,_0x2a3652);}let _0x1d692b=!![];if(_0x5836ac!=='*'){var _0xd64a53=_0x5836ac[_0x3c1d('0x6')]('-');var _0x396c99=_0xd64a53[0x0];var _0x37b4e1=_0xd64a53['length']===0x2?_0xd64a53[0x1]:_0x396c99;_0x1d692b=dowCompare(_0x5b4221,_0x396c99,_0x37b4e1);}let _0x959962=!![];if(_0x15f853!=='*'){var _0x555369=_0x15f853['split']('-');var _0x52121e=parseDom(_0x555369[0x0]);var _0x5bd275=_0x555369[_0x3c1d('0x20')]===0x2?parseDom(_0x555369[0x1]):_0x52121e;_0x959962=domCompare(_0x5b4221,_0x52121e,_0x5bd275);}let _0x16e470=!![];if(_0x71cfea!=='*'){var _0x1c10b3=_0x71cfea[_0x3c1d('0x6')]('-');var _0x5c19ac=_0x1c10b3[0x0];var _0x3b3a4b=_0x1c10b3[_0x3c1d('0x20')]===0x2?_0x1c10b3[0x1]:_0x1c10b3[0x0];_0x16e470=monthCompare(_0x5b4221,_0x5c19ac,_0x3b3a4b);}return _0x1931b3&&_0x1d692b&&_0x959962&&_0x16e470;}}module[_0x3c1d('0xf')][_0x3c1d('0x21')]=iftime; \ No newline at end of file +var _0x0e86=['max','domCompare','MMM','test','isMoment','padStart','length','iftime','lodash','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','exports','monthsShort','concat','circularMonthInterval','clone','hours','isBefore','startOf','day','endOf','isBetween','format','includes','daysInMonth','min'];(function(_0x49d42f,_0x2a1c49){var _0x5880a6=function(_0xeeaf28){while(--_0xeeaf28){_0x49d42f['push'](_0x49d42f['shift']());}};_0x5880a6(++_0x2a1c49);}(_0x0e86,0xe6));var _0x60e8=function(_0x20156c,_0x12e1ff){_0x20156c=_0x20156c-0x0;var _0x4cb19a=_0x0e86[_0x20156c];return _0x4cb19a;};var _=require(_0x60e8('0x0'));var moment=require(_0x60e8('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x60e8('0x2')](function(_0x49e6c7){return _0x49e6c7[_0x60e8('0x3')];})[_0x60e8('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x60e8('0x5');var EINVALID_DATE=_0x60e8('0x6');function throwIfDateNotValid(_0x3ba632){if(!_0x3ba632[_0x60e8('0x7')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x4ff6ba){var _0xeb38e9=_0x4ff6ba[_0x60e8('0x8')](':')[_0x60e8('0x2')](function(_0x32a8ad){return parseInt(_0x32a8ad,0xa);});var _0x3c36d1=_0xeb38e9[0x0];var _0x598c49=_0xeb38e9[0x1];if(_0x3c36d1<0x0||_0x3c36d1>0x17||_0x598c49<0x0||_0x598c49>0x3b){throw new Error(EINVALID_DATE);}return[_0x3c36d1,_0x598c49];}function circularDoWInterval(_0xb572e9,_0x24f069){if(_0xb572e9===_0x24f069){return[_0xb572e9];}else{var _0x59a914=moment[_0x60e8('0x9')]();moment[_0x60e8('0x9')]('en');var _0x5116a4=moment[_0x60e8('0xa')]()[_0x60e8('0x2')](function(_0x14321e){return _0x14321e[_0x60e8('0xb')]();});moment[_0x60e8('0x9')](_0x59a914);var _0x2cb387=_0x5116a4[_0x60e8('0xc')](_0xb572e9);var _0x4c3342=_0x5116a4['indexOf'](_0x24f069);if(_0x4c3342>_0x2cb387){return _0x5116a4[_0x60e8('0xd')](_0x2cb387,_0x4c3342+0x1);}else{var _0x5045cb=_0x5116a4['slice'](0x0,_0x4c3342+0x1);var _0x500d8b=_0x5116a4[_0x60e8('0xd')](_0x2cb387);return _0x500d8b['concat'](_0x5045cb);}}}module[_0x60e8('0xe')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x2edf37,_0xb35194){if(_0x2edf37===_0xb35194){return[_0x2edf37];}else{var _0x340cb7=moment['locale']();moment[_0x60e8('0x9')]('en');var _0x4239e4=moment[_0x60e8('0xf')]()[_0x60e8('0x2')](function(_0x28e42e){return _0x28e42e[_0x60e8('0xb')]();});moment[_0x60e8('0x9')](_0x340cb7);var _0x1a6a1b=_0x4239e4[_0x60e8('0xc')](_0x2edf37);var _0x448bfb=_0x4239e4[_0x60e8('0xc')](_0xb35194);if(_0x448bfb>_0x1a6a1b){return _0x4239e4[_0x60e8('0xd')](_0x1a6a1b,_0x448bfb+0x1);}else{var _0x3cc790=_0x4239e4[_0x60e8('0xd')](0x0,_0x448bfb+0x1);var _0xf99a73=_0x4239e4[_0x60e8('0xd')](_0x1a6a1b);return _0xf99a73[_0x60e8('0x10')](_0x3cc790);}}}module[_0x60e8('0xe')][_0x60e8('0x11')]=circularMonthInterval;function parseDom(_0x55ccc1){var _0x54d875=parseInt(_0x55ccc1,0xa);if(_0x54d875<0x1||_0x54d875>0x1f){throw new Error(EINVALID_DATE);}return _0x54d875;}function timeCompare(_0x33ba82,_0x18b6d7,_0x6398d7){var _0xf0fffb=_0x33ba82[_0x60e8('0x12')]();var _0x18f46d=extractTime(_0x18b6d7);var _0x45faee=_0x18f46d[0x0];var _0x543c5b=_0x18f46d[0x1];var _0x1e90df=_0x33ba82[_0x60e8('0x12')]()[_0x60e8('0x13')](_0x45faee)['minutes'](_0x543c5b);throwIfDateNotValid(_0x1e90df);var _0x1cca7c=extractTime(_0x6398d7);var _0x35debc=_0x1cca7c[0x0];var _0x5c4c78=_0x1cca7c[0x1];var _0x15f650=_0x33ba82[_0x60e8('0x12')]()['hours'](_0x35debc)['minutes'](_0x5c4c78);throwIfDateNotValid(_0x15f650);if(_0x15f650[_0x60e8('0x14')](_0x1e90df)){var _0x4b64e6=_0xf0fffb['clone']()[_0x60e8('0x15')](_0x60e8('0x16'));var _0x5ecb8f=_0xf0fffb['clone']()[_0x60e8('0x17')](_0x60e8('0x16'));return _0xf0fffb['isBetween'](_0x1e90df,_0x5ecb8f,undefined,'[]')||_0xf0fffb['isBetween'](_0x4b64e6,_0x15f650,undefined,'[]');}else{return _0xf0fffb[_0x60e8('0x18')](_0x1e90df,_0x15f650,undefined,'[]');}}module[_0x60e8('0xe')]['timeCompare']=timeCompare;function dowCompare(_0x5d7f16,_0x3a8386,_0x4840ae){var _0x350819=_0x5d7f16['locale']('en')[_0x60e8('0x19')]('ddd')[_0x60e8('0xb')]();return circularDoWInterval(_0x3a8386,_0x4840ae)[_0x60e8('0x1a')](_0x350819);}module[_0x60e8('0xe')]['dowCompare']=dowCompare;function domCompare(_0x473a6b,_0x41186e,_0x4a5245){var _0x533522=_0x473a6b['date']();if(_0x41186e===_0x4a5245){return _0x533522===_0x41186e;}else{var _0x4d676c=_0x473a6b[_0x60e8('0x1b')]();var _0x3e3274=_0x41186e<_0x4a5245;let _0x55efe5=![];var _0x34fede=0x0;var _0x409bb0=0x0;if(_0x3e3274){_0x34fede=Math['max'](0x1,_0x41186e);_0x409bb0=Math[_0x60e8('0x1c')](_0x4a5245,_0x4d676c);_0x55efe5=_0x533522>=_0x34fede&&_0x533522<=_0x409bb0;}else{_0x34fede=Math[_0x60e8('0x1c')](_0x41186e,_0x4d676c);_0x409bb0=Math[_0x60e8('0x1d')](0x1,_0x4a5245);_0x55efe5=_0x533522>=_0x34fede||_0x533522<=_0x409bb0;}return _0x55efe5;}}module['exports'][_0x60e8('0x1e')]=domCompare;function monthCompare(_0x3a02a6,_0x50a551,_0xd74cf0){var _0x2acb1b=_0x3a02a6[_0x60e8('0x9')]('en')[_0x60e8('0x19')](_0x60e8('0x1f'))[_0x60e8('0xb')]();return circularMonthInterval(_0x50a551,_0xd74cf0)[_0x60e8('0x1a')](_0x2acb1b);}module[_0x60e8('0xe')]['monthCompare']=monthCompare;function iftime(_0x8f7988,_0x35f398=moment['tz']['guess'](),_0x22996f=moment()){if(!validateRx[_0x60e8('0x20')](_0x8f7988)){throw new Error(EINVALID_STRING);}else{var _0x2ab909=(moment[_0x60e8('0x21')](_0x22996f)?_0x22996f[_0x60e8('0x12')]():moment(_0x22996f))['tz'](_0x35f398)[_0x60e8('0x9')]('en');throwIfDateNotValid(_0x2ab909);var _0x399ceb=_0x8f7988[_0x60e8('0x8')](',');var _0x32f19c=_0x399ceb[0x0];var _0x6b82bd=_0x399ceb[0x1];var _0x48678b=_0x399ceb[0x2];var _0x4cd23f=_0x399ceb[0x3];let _0x5f1fbf=!![];if(_0x32f19c!=='*'){var _0x40d70f=_0x32f19c['split']('-');var _0x25b8dd=_[_0x60e8('0x22')](_0x40d70f[0x0],0x5,'0');var _0x375b90=_0x40d70f[_0x60e8('0x23')]===0x2?_[_0x60e8('0x22')](_0x40d70f[0x1],0x5,'0'):_0x25b8dd;_0x5f1fbf=timeCompare(_0x2ab909,_0x25b8dd,_0x375b90);}let _0x10ae6a=!![];if(_0x6b82bd!=='*'){var _0xd920e8=_0x6b82bd[_0x60e8('0x8')]('-');var _0x35efff=_0xd920e8[0x0];var _0x169f44=_0xd920e8[_0x60e8('0x23')]===0x2?_0xd920e8[0x1]:_0x35efff;_0x10ae6a=dowCompare(_0x2ab909,_0x35efff,_0x169f44);}let _0x5b1d5d=!![];if(_0x48678b!=='*'){var _0xd6e0e2=_0x48678b[_0x60e8('0x8')]('-');var _0x54bcb9=parseDom(_0xd6e0e2[0x0]);var _0x3d1a67=_0xd6e0e2['length']===0x2?parseDom(_0xd6e0e2[0x1]):_0x54bcb9;_0x5b1d5d=domCompare(_0x2ab909,_0x54bcb9,_0x3d1a67);}let _0x1df03a=!![];if(_0x4cd23f!=='*'){var _0x1ac05d=_0x4cd23f[_0x60e8('0x8')]('-');var _0x4eb049=_0x1ac05d[0x0];var _0x4824b6=_0x1ac05d['length']===0x2?_0x1ac05d[0x1]:_0x1ac05d[0x0];_0x1df03a=monthCompare(_0x2ab909,_0x4eb049,_0x4824b6);}return _0x5f1fbf&&_0x10ae6a&&_0x5b1d5d&&_0x1df03a;}}module[_0x60e8('0xe')][_0x60e8('0x24')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 8191c50..d7511f2 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x43bd=['bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','File','%s-%s','error','warn','consoleLogger','fileLogger','path','util','winston','../config/environment','debugLevel','toLowerCase','redBG\x20white','red','white','gray'];(function(_0x8e6327,_0x47c5db){var _0x5753b7=function(_0xf635d8){while(--_0xf635d8){_0x8e6327['push'](_0x8e6327['shift']());}};_0x5753b7(++_0x47c5db);}(_0x43bd,0x8e));var _0xd43b=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x43bd[_0x3e5086];return _0xfeb102;};'use strict';var path=require(_0xd43b('0x0'));var util=require(_0xd43b('0x1'));var moment=require('moment');var winston=require(_0xd43b('0x2'));var config=require(_0xd43b('0x3'));var debugLevel=config[_0xd43b('0x4')]?config[_0xd43b('0x4')][_0xd43b('0x5')]():'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':_0xd43b('0x6'),'error':_0xd43b('0x7'),'warn':'bold\x20yellow','info':_0xd43b('0x8'),'print':'bold\x20white','success':'bold\x20green','http':_0xd43b('0x9'),'verbose':'bold\x20magenta','debug':_0xd43b('0xa'),'silly':_0xd43b('0xb')};winston[_0xd43b('0xc')](XC_LOG_COLORS);function getLogFileName(_0x41cee7,_0x5ed8c9,_0x2600cb){var _0x1d11c7=_0x41cee7||_0xd43b('0xd');return path[_0xd43b('0xe')](_0x1d11c7,util[_0xd43b('0xf')](_0xd43b('0x10'),_0x5ed8c9,_0x2600cb));}function formatter(_0x4103bb,_0xaf7853){_0xaf7853[_0xd43b('0x11')]=_0xaf7853['message']['replace'](/@@{/g,_0xd43b('0x12'))[_0xd43b('0x13')](/}@@/g,_0xd43b('0x14'))['replace'](/@{/g,'{{')[_0xd43b('0x13')](/}@/g,'}}');return util[_0xd43b('0xf')](_0xd43b('0x15'),moment()[_0xd43b('0xf')](_0xd43b('0x16')),_0xaf7853[_0xd43b('0x17')][_0xd43b('0x18')](),_0x4103bb,_0xaf7853[_0xd43b('0x11')]);}function fileFormat(_0x451aba,_0x1f7706){_0x1f7706[_0xd43b('0x11')]=_0x1f7706[_0xd43b('0x11')][_0xd43b('0x13')](/@@{/g,'{{{')['replace'](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0xd43b('0x13')](/}@/g,'}}');var _0x17cf49=_0x1f7706[_0xd43b('0x19')]&&Object[_0xd43b('0x1a')](_0x1f7706['meta'])[_0xd43b('0x1b')]?'\x0a\x09'+JSON['stringify'](_0x1f7706['meta']):'';return util[_0xd43b('0xf')](_0xd43b('0x1c'),moment()[_0xd43b('0xf')](_0xd43b('0x16')),_0x1f7706[_0xd43b('0x17')]['toUpperCase'](),_0x451aba,_0x1f7706[_0xd43b('0x11')],_0x17cf49);}function consoleLogger(){var _0x11939a=new winston[(_0xd43b('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xd43b('0x1e'))][(_0xd43b('0x1f'))]({'level':'warn','json':![],'formatter':function(_0x60e563){return formatter('',_0x60e563);}})]});return _0x11939a;}function fileLogger(_0x5da799,_0x42f70e){var _0x3087b3=new winston[(_0xd43b('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xd43b('0x1e'))][(_0xd43b('0x20'))]({'name':util['format'](_0xd43b('0x21'),_0x5da799,_0xd43b('0x22')),'filename':getLogFileName(_0x42f70e,_0x5da799,_0xd43b('0x22')),'level':_0xd43b('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x381eee){return fileFormat(_0x5da799,_0x381eee);}}),new winston[(_0xd43b('0x1e'))][(_0xd43b('0x20'))]({'name':util[_0xd43b('0xf')](_0xd43b('0x21'),_0x5da799,debugLevel),'filename':getLogFileName(_0x42f70e,_0x5da799,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xdbf21f){return fileFormat(_0x5da799,_0xdbf21f);}}),new winston[(_0xd43b('0x1e'))][(_0xd43b('0x1f'))]({'level':_0xd43b('0x23'),'json':![],'formatter':function(_0x53119b){return fileFormat(_0x5da799,_0x53119b);}})]});return _0x3087b3;}exports[_0xd43b('0x24')]=consoleLogger;exports[_0xd43b('0x25')]=fileLogger; \ No newline at end of file +var _0xe545=['debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20green','gray','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','File','%s-%s','error','Console','consoleLogger','path','util','moment','winston','../config/environment'];(function(_0x4e9e70,_0x4d6c89){var _0x29f6b9=function(_0x433f0d){while(--_0x433f0d){_0x4e9e70['push'](_0x4e9e70['shift']());}};_0x29f6b9(++_0x4d6c89);}(_0xe545,0x19d));var _0x5e54=function(_0x272723,_0x173e0b){_0x272723=_0x272723-0x0;var _0x14ae92=_0xe545[_0x272723];return _0x14ae92;};'use strict';var path=require(_0x5e54('0x0'));var util=require(_0x5e54('0x1'));var moment=require(_0x5e54('0x2'));var winston=require(_0x5e54('0x3'));var config=require(_0x5e54('0x4'));var debugLevel=config[_0x5e54('0x5')]?config['debugLevel'][_0x5e54('0x6')]():_0x5e54('0x7');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x5e54('0x8'),'error':_0x5e54('0x9'),'warn':_0x5e54('0xa'),'info':_0x5e54('0xb'),'print':'bold\x20white','success':_0x5e54('0xc'),'http':_0x5e54('0xd'),'verbose':'bold\x20magenta','debug':_0x5e54('0xe'),'silly':_0x5e54('0xf')};winston[_0x5e54('0x10')](XC_LOG_COLORS);function getLogFileName(_0x45cd28,_0xa4724,_0x46aa2c){var _0x5e9f14=_0x45cd28||_0x5e54('0x11');return path[_0x5e54('0x12')](_0x5e9f14,util[_0x5e54('0x13')](_0x5e54('0x14'),_0xa4724,_0x46aa2c));}function formatter(_0x36ba9b,_0x45c337){_0x45c337[_0x5e54('0x15')]=_0x45c337[_0x5e54('0x15')][_0x5e54('0x16')](/@@{/g,_0x5e54('0x17'))[_0x5e54('0x16')](/}@@/g,_0x5e54('0x18'))[_0x5e54('0x16')](/@{/g,'{{')[_0x5e54('0x16')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x5e54('0x13')](_0x5e54('0x19')),_0x45c337[_0x5e54('0x1a')][_0x5e54('0x1b')](),_0x36ba9b,_0x45c337[_0x5e54('0x15')]);}function fileFormat(_0x36f3ca,_0x1d7a81){_0x1d7a81[_0x5e54('0x15')]=_0x1d7a81[_0x5e54('0x15')]['replace'](/@@{/g,_0x5e54('0x17'))[_0x5e54('0x16')](/}@@/g,_0x5e54('0x18'))[_0x5e54('0x16')](/@{/g,'{{')[_0x5e54('0x16')](/}@/g,'}}');var _0x1ca282=_0x1d7a81['meta']&&Object[_0x5e54('0x1c')](_0x1d7a81['meta'])['length']?'\x0a\x09'+JSON[_0x5e54('0x1d')](_0x1d7a81['meta']):'';return util['format'](_0x5e54('0x1e'),moment()[_0x5e54('0x13')](_0x5e54('0x19')),_0x1d7a81[_0x5e54('0x1a')][_0x5e54('0x1b')](),_0x36f3ca,_0x1d7a81['message'],_0x1ca282);}function consoleLogger(){var _0x417679=new winston[(_0x5e54('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x5e54('0x20'))]['Console']({'level':'warn','json':![],'formatter':function(_0x2cd54a){return formatter('',_0x2cd54a);}})]});return _0x417679;}function fileLogger(_0xcdacb1,_0x2ded50){var _0x5e9b52=new winston[(_0x5e54('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x5e54('0x20'))][(_0x5e54('0x21'))]({'name':util['format'](_0x5e54('0x22'),_0xcdacb1,'error'),'filename':getLogFileName(_0x2ded50,_0xcdacb1,_0x5e54('0x23')),'level':_0x5e54('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x534596){return fileFormat(_0xcdacb1,_0x534596);}}),new winston['transports'][(_0x5e54('0x21'))]({'name':util[_0x5e54('0x13')](_0x5e54('0x22'),_0xcdacb1,debugLevel),'filename':getLogFileName(_0x2ded50,_0xcdacb1,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xdbbc25){return fileFormat(_0xcdacb1,_0xdbbc25);}}),new winston['transports'][(_0x5e54('0x24'))]({'level':'warn','json':![],'formatter':function(_0x29a2a1){return fileFormat(_0xcdacb1,_0x29a2a1);}})]});return _0x5e9b52;}exports[_0x5e54('0x25')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index a971d6a..fecaa76 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 _0x5f66=['consumerSecret','membername','calleridname','exten','privateKey','secretaccesskey','user','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','length','isPlainObject','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','lastName','street','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','consumerKey'];(function(_0x277bb4,_0x1c5e19){var _0x45ec82=function(_0x436eea){while(--_0x436eea){_0x277bb4['push'](_0x277bb4['shift']());}};_0x45ec82(++_0x1c5e19);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};var _=require('lodash');var sensitiveFields=[_0x65f6('0x0'),'password',_0x65f6('0x1'),_0x65f6('0x2'),_0x65f6('0x3'),_0x65f6('0x4'),_0x65f6('0x5'),'phone',_0x65f6('0x6'),'fax',_0x65f6('0x7'),_0x65f6('0x8'),'clientSecret','securityToken',_0x65f6('0x9'),_0x65f6('0xa'),_0x65f6('0xb'),_0x65f6('0xc'),_0x65f6('0xd'),_0x65f6('0xe'),'accessTokenSecret','authToken',_0x65f6('0xf'),_0x65f6('0x10'),_0x65f6('0x11'),_0x65f6('0x12'),'calleridnum',_0x65f6('0x13'),'vidaooApiKey','clientEmail',_0x65f6('0x14'),'accesskeyid',_0x65f6('0x15'),'key',_0x65f6('0x16'),_0x65f6('0x17'),_0x65f6('0x18'),_0x65f6('0x19'),_0x65f6('0x1a'),_0x65f6('0x1b'),_0x65f6('0x1c'),_0x65f6('0x1d')];function maskSensitiveData(_0x46dbc6){const _0x3440af=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x46dbc6)){for(const _0x19b9ff in _0x46dbc6){if(_['isArray'](_0x46dbc6[_0x19b9ff])){for(let _0x5dd324=0x0;_0x5dd324<_0x46dbc6[_0x19b9ff][_0x65f6('0x1e')];_0x5dd324++){maskSensitiveData(_0x46dbc6[_0x19b9ff][_0x5dd324]);}}else if(_[_0x65f6('0x1f')](_0x46dbc6[_0x19b9ff])){maskSensitiveData(_0x46dbc6[_0x19b9ff]);}else if(_[_0x65f6('0x20')](_0x46dbc6[_0x19b9ff])){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](/{{{/g,_0x65f6('0x22'))[_0x65f6('0x21')](/}}}/g,_0x65f6('0x23'))[_0x65f6('0x21')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x19b9ff)){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](_0x3440af,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0xdb28=['registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','exports','maskSensitiveData','lodash','username','password','newPassword','firstName','lastName','street','phone','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xdb28,0x106));var _0x8db2=function(_0x263daf,_0x49a309){_0x263daf=_0x263daf-0x0;var _0x528f2a=_0xdb28[_0x263daf];return _0x528f2a;};var _=require(_0x8db2('0x0'));var sensitiveFields=[_0x8db2('0x1'),_0x8db2('0x2'),_0x8db2('0x3'),'apiKey',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'fax',_0x8db2('0x9'),_0x8db2('0xa'),'clientSecret','securityToken',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'authToken',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'calleridname',_0x8db2('0x15'),_0x8db2('0x16'),'vidaooApiKey',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'user','pass',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21')];function maskSensitiveData(_0x2f177a){const _0x3c96a7=/(?!^)[\s\S](?!$)/g;if(_[_0x8db2('0x22')](_0x2f177a)){for(const _0x16c8c2 in _0x2f177a){if(_['isArray'](_0x2f177a[_0x16c8c2])){for(let _0x13b0f5=0x0;_0x13b0f5<_0x2f177a[_0x16c8c2][_0x8db2('0x23')];_0x13b0f5++){maskSensitiveData(_0x2f177a[_0x16c8c2][_0x13b0f5]);}}else if(_['isPlainObject'](_0x2f177a[_0x16c8c2])){maskSensitiveData(_0x2f177a[_0x16c8c2]);}else if(_[_0x8db2('0x24')](_0x2f177a[_0x16c8c2])){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](/{{{/g,_0x8db2('0x26'))[_0x8db2('0x25')](/}}}/g,_0x8db2('0x27'))[_0x8db2('0x25')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x16c8c2)){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](_0x3c96a7,'*');}}}}}module[_0x8db2('0x28')][_0x8db2('0x29')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 7995441..6290528 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 _0xbaf0=['exports','{\x20{\x20','\x20}\x20}','string','isArray','map','isPlainObject','keys','reduce'];(function(_0x129540,_0x5a005b){var _0x4e8dd8=function(_0x447e21){while(--_0x447e21){_0x129540['push'](_0x129540['shift']());}};_0x4e8dd8(++_0x5a005b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x286ac2){return _0x286ac2==='{{'?_0x0baf('0x0'):_0x0baf('0x1');}function safeTemplate(_0x263f79){var _0x1688bc=_0x263f79;if(typeof _0x263f79===_0x0baf('0x2')){_0x1688bc=_0x263f79['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x0baf('0x3')](_0x263f79)){_0x1688bc=_0x263f79[_0x0baf('0x4')](function(_0x2d3fa5){return safeTemplate(_0x2d3fa5);});}else if(_[_0x0baf('0x5')](_0x263f79)){_0x1688bc=Object[_0x0baf('0x6')](_0x263f79)[_0x0baf('0x7')](function(_0x1a10b1,_0x2dcaac){_0x1a10b1[_0x2dcaac]=safeTemplate(_0x263f79[_0x2dcaac]);return _0x1a10b1;},{});}return _0x1688bc;}module[_0x0baf('0x8')]['safeTemplate']=safeTemplate; \ No newline at end of file +var _0xb688=['{\x20{\x20','\x20}\x20}','string','isArray','map','isPlainObject','reduce','exports','safeTemplate'];(function(_0x3c7264,_0x2474f6){var _0x21ac86=function(_0x184262){while(--_0x184262){_0x3c7264['push'](_0x3c7264['shift']());}};_0x21ac86(++_0x2474f6);}(_0xb688,0xcf));var _0x8b68=function(_0x4062c8,_0xb638e2){_0x4062c8=_0x4062c8-0x0;var _0x3df39e=_0xb688[_0x4062c8];return _0x3df39e;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x39c8c5){return _0x39c8c5==='{{'?_0x8b68('0x0'):_0x8b68('0x1');}function safeTemplate(_0x1080e8){var _0x23bbaa=_0x1080e8;if(typeof _0x1080e8===_0x8b68('0x2')){_0x23bbaa=_0x1080e8['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x8b68('0x3')](_0x1080e8)){_0x23bbaa=_0x1080e8[_0x8b68('0x4')](function(_0x30f33d){return safeTemplate(_0x30f33d);});}else if(_[_0x8b68('0x5')](_0x1080e8)){_0x23bbaa=Object['keys'](_0x1080e8)[_0x8b68('0x6')](function(_0x57ee56,_0x37677d){_0x57ee56[_0x37677d]=safeTemplate(_0x1080e8[_0x37677d]);return _0x57ee56;},{});}return _0x23bbaa;}module[_0x8b68('0x7')][_0x8b68('0x8')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index dfa3b60..89416a7 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1eca=['server/app.json','legacy-libs','isArray','apps','name','motion2','NODE_PATH','readJSON','then','updated','info','Updating\x20app.json','writeJSON','resolve','exports','root'];(function(_0x167dc2,_0x4983cf){var _0x4ec054=function(_0x3c8b8b){while(--_0x3c8b8b){_0x167dc2['push'](_0x167dc2['shift']());}};_0x4ec054(++_0x4983cf);}(_0x1eca,0x15f));var _0xa1ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1eca[_0x3dd15e];return _0x231fd0;};var fs=require('fs-extra');var path=require('path');var config=require('../config/environment');var root=config[_0xa1ec('0x0')];var APP_JSON_PATH=path['resolve'](root,_0xa1ec('0x1'));var NODEPATH=path['resolve'](root,_0xa1ec('0x2'));function setLegacyLibsNodeEnvPath(_0x3d38e9){let _0x2d1058=![];if(Array[_0xa1ec('0x3')](_0x3d38e9[_0xa1ec('0x4')])){var _0xa9fabb=_0x3d38e9[_0xa1ec('0x4')]['findIndex'](function(_0x3e9ca6){return _0x3e9ca6[_0xa1ec('0x5')]===_0xa1ec('0x6');});if(_0xa9fabb>-0x1){var _0x4b6cf2=_0x3d38e9['apps'][_0xa9fabb];if(typeof _0x4b6cf2['env'][_0xa1ec('0x7')]!=='string'){_0x4b6cf2['env'][_0xa1ec('0x7')]=NODEPATH;_0x2d1058=!![];}}return{'appConfig':_0x3d38e9,'updated':_0x2d1058};}}function updateAppConfig(_0x41a65b){return fs['pathExists'](APP_JSON_PATH)['then'](function(_0x44bcbd){if(_0x44bcbd){return fs[_0xa1ec('0x8')](APP_JSON_PATH)[_0xa1ec('0x9')](function(_0x2e0251){var _0x572e71=setLegacyLibsNodeEnvPath(_0x2e0251);if(_0x572e71[_0xa1ec('0xa')]){_0x41a65b[_0xa1ec('0xb')](_0xa1ec('0xc'));return fs[_0xa1ec('0xd')](APP_JSON_PATH,_0x2e0251,{'spaces':0x2});}else{return Promise[_0xa1ec('0xe')]();}});}else{return Promise[_0xa1ec('0xe')]();}});}module[_0xa1ec('0xf')]=updateAppConfig; \ No newline at end of file +var _0x1793=['root','resolve','server/app.json','legacy-libs','isArray','apps','findIndex','name','motion2','env','NODE_PATH','string','pathExists','then','readJSON','updated','Updating\x20app.json','writeJSON','fs-extra','path','../config/environment'];(function(_0x785934,_0x20e888){var _0x15e3d6=function(_0x3c2ea0){while(--_0x3c2ea0){_0x785934['push'](_0x785934['shift']());}};_0x15e3d6(++_0x20e888);}(_0x1793,0x138));var _0x3179=function(_0x153a08,_0x8d956d){_0x153a08=_0x153a08-0x0;var _0x334eaf=_0x1793[_0x153a08];return _0x334eaf;};var fs=require(_0x3179('0x0'));var path=require(_0x3179('0x1'));var config=require(_0x3179('0x2'));var root=config[_0x3179('0x3')];var APP_JSON_PATH=path[_0x3179('0x4')](root,_0x3179('0x5'));var NODEPATH=path['resolve'](root,_0x3179('0x6'));function setLegacyLibsNodeEnvPath(_0x2a32c4){let _0x2195f6=![];if(Array[_0x3179('0x7')](_0x2a32c4[_0x3179('0x8')])){var _0x35c248=_0x2a32c4[_0x3179('0x8')][_0x3179('0x9')](function(_0xad0bf3){return _0xad0bf3[_0x3179('0xa')]===_0x3179('0xb');});if(_0x35c248>-0x1){var _0x361491=_0x2a32c4[_0x3179('0x8')][_0x35c248];if(typeof _0x361491[_0x3179('0xc')][_0x3179('0xd')]!==_0x3179('0xe')){_0x361491[_0x3179('0xc')][_0x3179('0xd')]=NODEPATH;_0x2195f6=!![];}}return{'appConfig':_0x2a32c4,'updated':_0x2195f6};}}function updateAppConfig(_0x3fffbe){return fs[_0x3179('0xf')](APP_JSON_PATH)[_0x3179('0x10')](function(_0x56036f){if(_0x56036f){return fs[_0x3179('0x11')](APP_JSON_PATH)[_0x3179('0x10')](function(_0x31a018){var _0x387cbe=setLegacyLibsNodeEnvPath(_0x31a018);if(_0x387cbe[_0x3179('0x12')]){_0x3fffbe['info'](_0x3179('0x13'));return fs[_0x3179('0x14')](APP_JSON_PATH,_0x31a018,{'spaces':0x2});}else{return Promise[_0x3179('0x4')]();}});}else{return Promise[_0x3179('0x4')]();}});}module['exports']=updateAppConfig; \ No newline at end of file -- 1.7.1